frama-c-20.0-Calcium/0000777000000000000000000000000013571573400011213 5ustar frama-c-20.0-Calcium/.force-reconfigure0000666000000000000000000000000213571573400014610 0ustar 2 frama-c-20.0-Calcium/.make-clean0000666000000000000000000000000013571573400013177 0ustar frama-c-20.0-Calcium/.make-clean-stamp0000666000000000000000000000000213571573400014323 0ustar 7 frama-c-20.0-Calcium/Changelog0000666000000000000000000073763313571573400013050 0ustar ############################################################################### # Preliminary notes: # # ------------------ # # Mark "-": change with an impact for users (and possibly developers). # # Mark "o": change with an impact for developers only. # # Mark "+": change for Frama-C-commits audience (not in html version). # # Mark "*": bug fixed. # # Mark "!": change that can break compatibility with existing development. # # '#nnn' : BTS entry #nnn # # '#!nnn' : BTS private entry #nnn # # '#@nnn' : Gitlab frama-c/frama-c issue # # For compatibility with old change log formats: # # '#?nnn' : OLD-BTS entry #nnn # ############################################################################### ################################## Open Source Release 20.0 (Calcium) ################################## - Eva [2019/11/25] In the summary, fixes the number of alarms by category when the RTE plugin is used, and do not count logical properties in dead code as proven. -! Kernel [2019/10/31] More stringent verifications on the use of ghost variable in non ghost-code. Fixes #2421 - MdR [2019/10/31] New plug-in Markdown-Report (MdR) for markdown and SARIF outputs - Eva [2019/10/23] In the summary, fixes the total number of functions (and thus the computed analysis coverage). - Eva [2019/10/23] New option -eva-auto-loop-unroll N to unroll all loops whose number of iterations can be easily bounded by . - Eva [2019/10/21] New octagon domain inferring relations of the form l ≤ ±X±Y ≤ e between pairs of integer variables X and Y. Enabled with option -eva-octagon-domain. Only infers relations between pairs of scalar variables occuring in a same instruction. Intra-procedural by default; octagons can be propagated through function calls with option -eva-octagon-through-calls. - ACSL [2019/10/04] Support for ghost parameters - Eva [2019/10/04] Evaluates ACSL predicates \is_plus_infinity and \is_minus_infinity. - Kernel [2019/10/04] Supports macro INFINITY and NAN. o Config [2019/09/27] ocp-indent 1.7.0 is now used for indentation o Eva [2019/09/16] Dynamic registration of abstract values and domains: developers of new domains no longer need to modify Eva's engine. -* Kernel [2019/09/13] Fixes Hptmap on keys with id greater than 2^28. -* Makefile [2019/09/12] Fixes #2378 - bytecode only compilation (patch contributed by madroach) and use -thread where needed. -* Eva [2019/08/21] Fixes the reduction by the negation of \initialized and \dangling predicates on imprecise lvalues. -* Kernel [2019/08/20] Fixes a rare but critical bug which occured when Frama-C internally switched the current project in presence of >2 projects and destroyed the old current project at about the same time: the Frama-C internal state became inconsistent and lead to unsound computations and crashes. It may be revealed to the end-user when using a long sequence of -then-replace (at least 3 of them). -* Kernel [2019/08/20] Fixed sequence of -removed-projects and -then options. o Ptests [2019/08/05] Add new MODULE directive for compiling and loading an auxiliary OCaml module for a test - Kernel [2019/08/05] Add -keep-unused-types normalization option - Libc [2019/08/05] Remove obsolete (and forcing cpp error) builtins.h o! Kernel [2019/08/02] Functions over visitor's behaviors have been moved from Cil into a new module Visitor_behavior. Apply the migration script potassium2calcium.sh to update your plug-ins automatically. o! Sparecode [2019/07/26] Removed from Db. Use proper Sparecode API instead. -! Kernel [2019/07/24] OCaml version greater than or equal to 4.05.0 required. - Kernel [2019/07/24] Improve placeholders handling in -cpp-command o! Kernel [2019/07/23] Types in Properties are now records and not tuples - Eva [2019/07/09] Supports ACSL floating-point comparison operators eq_float, le_float, eq_double, le_double, etc. o! Kernel [2019/06/28] removes AST constructors TCoerce, TCoerceE, PLCoercion, PLCoercionE, Psubtype and PLsubtype -* Kernel [2019/06/20] fixes dangling ref when removing unused static local #################################### Open Source Release 19.0 (Potassium) #################################### -* RTE [2019/05/24] fixes a crash when visiting variable declarations - Eva [2019/04/19] The new annotation /*@ split exp; */ enumerates the possible values of an expression and continues the analysis for each of these value separately, until a /*@ merge exp; */ is encountered. It is also possible to maintain this partitioning at all times with the option -eva-partition-value exp. - Eva [2019/04/19] New option -eva-partition-history N to delay the join of abstract states for up to N merging points, thus keeping these states separate longer. Useful when a reasoning depends on the path taken to reach a control point, but can increase the analysis time exponentially in N. - Eva [2019/04/19] Loop unroll annotations now accept non-constant but bounded expressions as the maximum number of unrollings to perform. -* Kernel [2019/04/09] Avoid crashing on one-letter attributes. Fixes #2432 -* Obfuscator [2019/04/09] Also obfuscate formals in function pointer types. Fixes #2433. - Eva [2019/04/05] Prints an analysis summary at the end, outlining the analysis coverage and the number of errors, warnings and emitted alarms. It can be disabled with the option -eva-msg-key=-summary - Eva [2019/04/03] New option -eva-precision to globally configure the analysis from 0 (fast but imprecise) to 11 (accurate but slow). A precision of 5 is often a reasonable trade-off. This meta-option automatically sets up other options that can also be overriden. - Inout [2019/04/01] Fix performance issue when initializing large arrays. - ACSL [2019/03/08] Add check annotation, similar to assert except that it does not introduce additional hypotheses on the program state -* Makefile [2019/03/07] Do not attempt to install .cmx on bytecode-only architectures. Patch by M. Dogguy backported from Debian package - Libc [2019/03/05] Better specs and removal of half-implemented ifdef that tried to take various POSIX versions into account -* Kernel [2019/03/05] Better detection of invalid goto in presence of VLA (fixes #@499) - GUI [2019/03/04] Compatibility with lablgtk3 and improved handling of some widgets - ACSL [2019/03/01] Clarifies which C variables are in scope under a \at(·,L) (#@575) - Libc [2019/02/26] Ask clang not to warn about unknown FRAMA_C_MODEL attribute when pre-processing frama-c's libc -* Obfuscator [2019/02/26] Obfuscate logic types and logic constructors. -* Inout [2019/02/21] Fixes operational input on const local initialization o RTE [2019/02/21] RTE has a static API o Kernel [2019/02/18] When registering extended ACSL annotations, one must now indicate whether they should have a status. o Kernel [2019/02/05] Integer API moving closer to Zarith - Eva [2019/01/19] New warning category for detecting loops without 'unroll' directive - Eva [2019/01/31] Ignore annotations with "no_eva" tag -* ACSL [2019/01/19] Accept C identifiers that happen to be ACSL keywords in volatile and reads clauses - Eva [2019/01/10] Improved precision on nested loops (by postponing the widening on inner loops according to -eva-widening-period). -* Aorai [2019/01/04] Fixes #@586: avoid removing the initial state of the automaton - Kernel [2019/01/03] Add attributes for loop statements to allow distinguishing between for, while and dowhile loops. -! Kernel [2019/01/03] Add statement attributes (sattr) to the AST. They are not printed by default, use -kernel-msg-key printer:attrs -! Kernel [2019/01/03] Improved precision of integer abstract bitwise operators. -* Eva [2018/12/17] Fixes -eva-split-return on uninitialized or escaping function returns when -eva-warn-copy-indeterminate is disabled. o Kernel [2018/12/11] New functions for retrieving major and minor version -* Kernel [2018/12/04] Fixes AST integrity check wrt volatile accesses -* Kernel [2018/11/21] Fixes #@553 - pretty-printing of basic asm template ################################ Open Source Release 18.0 (Argon) ################################ -! Kernel [2018/10/24] Log.error and Log.failure will eventually make Frama-C exit with a non-zero status. Fixes #@552 - Kernel [2018/10/24] More ergonomic command-line options for governing warning categories statuses. - Eva [2018/10/24] Enable the memexec cache by default. It can be disabled by option -eva-no-memexec. - Eva [2018/10/22] Improved performances when the symbolic locations domain and the memexec cache are enabled. - Eva [2018/10/22] The memexec cache is now fully compatible with all abstract domains provided by Eva. However, the binding to the Apron domains disable memexec. - Eva [2018/10/18] New experimental domain "numerors" inferring absolute and relative errors of floating-point computations. Enabled by the option -eva-numerors-domain. Does not handle loops for now. -* Kernel [2018/10/18] Fixes parsing of compound initializers with anonymous fields. Fixes #2384 -* Kernel [2018/10/16] Consider that asm can change content of pointers used as inputs when generating assigns clauses. Fixes #@458 - Eva [2018/10/12] Remove option -obviously-terminates. - Kernel [2018/10/05] New option -warn-invalid-bool, to warn when reading trap representations of type _Bool. - Eva [2018/10/04] ACSL predicates with a "no_eva" tag are now ignored. - Eva [2018/10/03] Warn about currently unsupported specifications of some libc functions. - Eva [2018/10/02] Fix the gauges domain on weak bases. - Eva [2018/10/02] Some fixes and improvements of the equality domain. -* Kernel [2018/10/02] Rejects sizeof of an incomplete type. Fixes #@560. -* Kernel [2018/09/26] Add attribute to allow writing into const lvals in specific (aka C++ constructors and mutable fields) circumstances. Fixes #2395. - Kernel [2018/09/14] New warning (disabled by default) when multiple side effects are unsequenced (CERT-EXP10-C recommandation). Fixes #@492 - Eva [2018/09/13] Remove option -val-warn-left-shift-negative, and comply with kernel option -warn-[left|right]-shift-negative. - Kernel [2018/09/13] New options -warn-left-shift-negative (enabled by default) and -warn-right-shift-negative (disabled by default), to control the emission of alarms on shifts on negative integers. o! Constant Propagation [2018/09/12] Removing Db API for Constant Propagation plug-in. Calls to !Db.Constant_Propagation should be replaced by calls to Constant_Propagation.Api. - Eva [2018/09/12] Reduction of values leading to division by zero alarms, when possible. - Eva [2018/09/11] Better reduction of floating-point values cast into integer types when an alarm is emitted. - Metrics [2018/09/06] Add option -metrics-used-files, to help identify unnecessary files given in the command line - RTE [2018/09/05] Remove option -rte-precond. - Eva [2018/08/31] Supports the ACSL functions \min and \max. - Eva [2018/08/30] Fixes the alarms on subtractions and comparisons of pointers on weak bases (created by allocations in loops). -! ACSL [2018/08/28] Introduce extensions to global annotations and better characterization of each extension kind. See development guide for more information - Eva [2018/08/28] All options of Eva start with -eva. Aliases to previous option names preserve backward compatibility. -! Eva [2018/08/28] Rename plug-in shortname from 'value' to 'eva'. Eva is now properly named Eva in all logs, in the GUI, and as the emitter of the alarms. -! Kernel [2018/08/23] Introduce Filepath dataype for more consistent normalization of filenames -* Kernel [2018/08/23] Do not allow compound assignments to const variables Fixes #@384 -! Kernel [2018/08/23] Remove option -const-writable: const globals are unconditionally constants -* Eva [2018/08/02] Deprecate option -val-warn-builtin-override in favor of warning category builtins:override. - Kernel [2018/07/26] Fix compilation on OpenBSD patch contributed by madroach. Fixes #2379 - Kernel [2018/07/26] New option -remove-inlined to remove function(s) after -inline-calls, add category @inline to refer to all functions with inline attribute (for both options). - Eva [2018/07/23] The debug category "garbled-mix" becomes a warning category. Better track of garbled mix created by specification. -* ACSL [2018/07/23] Avoid removing cast of void ptr used as argument of function expecting a ptr with known size. Fixes #@432 o! Kernel [2018/07/23] Remove completely outdated module Dataflow. Deprecated since 3+ years. Use Dataflow2 instead. -* RTE [2018/07/23] Stop generating spurious \initialized alarms. Fixes #@429 -* Kernel [2018/07/06] Respect relative order of labels and ACSL annots. Fixes #@524 o* Ptests [2018/07/02] Do not keep oracles for empty stderr. Fixes #@402 -*! ACSL [2018/07/02] introduce ACSL operators \le_double, \ge_double, ... in addition to \le_float, \ge_float, ... Remove overloading of \le_float that made it accept double as arguments. Fixes #@502 - Eva [2018/06/28] New option -eva-report-red-statuses listing in a csv file the properties invalid for some states of the analysis (as in the "Red Alarms" panel of the GUI). - Eva [2018/06/25] Release all builtins, including memset and memcpy, as open-source. - Eva [2018/06/15] When a cvalue builtin is used, other domains use the frama-c libc specification to interpret the call without losing too much information. - Eva [2018/06/14] The variables from the frama-c libc are no longer shown in the initial state print. - Eva [2018/06/11] Improved precision of string builtins for strlen, strchr and memchr. - Eva [2018/04/25] Renamed option -wlevel into -eva-widening-delay. New option -eva-widening-period to control the number of iterations between two widenings. - Eva [2018/04/25] New propagation strategy that allows unrolling loops even when the slevel has been exceeded. Unroll the N first loop iterations via the global option -eva-min-loop-unrolling N or via specific code annotations /*@ loop unroll N; */. The new strategy may affect analyses even without loop unrolling. ##################################### Open Source Release Chlorine-20180502 ##################################### - Libc [2018/07/05] Fix C++ compatibility for Frama-Clang plug-in ##################################### Open Source Release Chlorine-20180501 ##################################### - Eva [2018/04/25] Added scripts and templates to help automate case studies (in $FRAMAC_SHARE/analysis-scripts) -* Typing [2018/04/23] Stronger checks w.r.t. implicit conversions in function pointers (must have compatible types) and assignments (modifiable lvalues). Fixes #@479 - Kernel [2018/04/23] Added option -inline-calls for syntactic inlining -* Kernel [2018/04/19] Avoid crash when re-declaring a function with formals after it has been called without any. Fixes #@454 - Kernel [2018/04/13] Deprecate option -warn-decimal-float in favor of warning category parser:decimal-float - Kernel [2018/04/13] More possible statuses for warning categories. Fixes #@486 o Kernel [2018/04/13] Change Cil.typeHasAttributeDeep into Cil.typeHasAttributeMemoryBlock. Fixes #@489 o* Logic [2018/04/11] properly reset logic environment in case of typing errors. Fixes #@326 - Eva [2018/04/10] Interpret the logic constants \pi and \e. - Eva [2018/04/06] Initialization of volatile pointers now keeps the base addresses of the pointer (with arbitrary offsets). - Eva [2018/04/06] Fix the initialization of local volatile variables, which can always have any value. - Eva [2018/04/06] In the logic, interpret the ACSL function \sign and the constructors \Positive and \Negative. - Metrics [2018/04/05] When the value coverage is computed, also shows the total number of statements by function in the filetree of the Gui. - Gui [2018/04/04] Added Preferences menu (shortcut: Ctrl+P) to set themes for property bullets and external source editor o Lib [2018/03/30] New Rich_text module to create message with tags o! Kernel [2018/03/30] Never or rarely used Log functions have been removed or deprecated - Eva [2018/03/15] Avoid enumeration on values with too many bases — fixes a performance issue. - Gui [2018/03/07] The preconditions of a function call can now be displayed before the call statement itself (click on status bullets with '+' or '-' to unfold/fold them) - Typing [2018/03/02] Support for CERT EXP46-C - Eva [2018/03/01] Fix a soundness bug in the equality domain: do not infer incorrect equalities between incomparable pointers, or between -0. and +0. - Eva [2018/02/26] deprecate option -val-warn-on-alarms in favor of warning category alarm - Kernel [2018/02/26] deprecate option -continue-annot-error in favor of warning category annot-error -! Kernel [2018/02/26] introduce warning categories, with various possible behaviors. Refactor management of debug categories -* RTE [2018/02/23] Do not emit spurious 'idx < 0' assert on gcc-style FAM. Fixes #@393 -* Kernel [2018/02/23] Handle anonymous struct/union init. Fixes #@376 - Eva [2018/02/22] Equalities can be propagated through function calls. New options -eva-equality-through-calls[-function] to decide (globally or by function) which ones are kept from the caller. - Eva [2018/02/21] When an lvalue lv is assigned or leaves the scope, the equality domain tries to replace lv by an equal term (if any) in the expressions depending on lv (instead of removing them). o! Occurrence [2018/02/20] Removing Db API for Occurrence plug-in. Calls to !Db.Occurrence should be replaced by calls to Occurrence.Register. o! Impact [2018/02/20] Removing Db API for Impact plug-in. Calls to !Db.Impact should be replaced by calls to Impact.Register. o! Users [2018/02/20] Removing Db API for Users plug-in. Calls to !Db.Users should be replaced by calls to Users.Users_register. - Eva [2018/02/13] Removed *_alloced_return base created for functions without body that return pointers. Such bases were imprecise and could be unsound in corner cases. - Eva [2018/02/08] Shifts of addresses now create garbled mixes (as any other arithmetic operation). - Logic [2018/02/07] Ghost code now supports /@ ... @/ annotations - Eva [2018/02/06] By default, do not emit pointer_comparable alarms for non pointer operations. Always compute {0;1} for non pointer comparisons involving incomparable addresses. - Eva [2018/02/01] Warn about unsupported allocates clauses. - Eva [2018/01/30] The subdivision of evaluations (through the option -val-subdivide-non-linear) can subdivide the values of several lvalues simultaneously (on expressions such as x*x - 2*x*y + y*y). - Kernel [2018/01/24] Better renaming of variables in case of name collision. o! Kernel [2018/01/24] Keep information about syntactic scope of local static variables. Accessed through Globals.Syntactic_search.find_in_scope. -! Eva [2018/01/24] Renamed option -val-malloc-returns-null to -val-alloc-returns-null, which also applies to realloc builtins. - Kernel [2018/01/16] Added option -json-compilation-database to help with preprocessing. Requires yojson during Frama-C compilation. - Eva [2018/01/15] New function post_analysis in abstract domains, called at the end of the analysis. - Eva [2018/01/11] The Simple_memory functor lets builtins interpret C functions from the value of arguments to the result value. - Eva [2018/01/11] Evaluate the preconditions of the functions for which a builtin is used; builtins do not emit alarms anymore. -! Kernel [2018/01/11] Alarms Logic_memory_access and Valid_string, that were only emitted by Eva builtins, are removed. -* ACSL [2017/12/14] Reinforce rejection of void* pointer types in the arguments of ACSL built-in constructs related to memory blocks and pointer dereferencing. -* ACSL [2017/12/14] Reinforce rejection of implicit casts from array types to pointer types in the arguments of ACSL built-in constructs related to memory blocks and pointer dereferencing. -* Kernel [2017/12/13] Clean up typechecking environment when dropping side-effects (in sizeof et al.). Fixes #@430 o! Kernel [2017/12/13] Old Cil.isCharType renamed as Cil.isAnyCharType. New Cil.isCharType is now only true for plain char, neither signed nor unsigned. Derived functions (isCharPtr et al.) also updated - Eva [2017/12/12] Fix a crash when using -val-stop-at-nth-alarm. - Eva [2017/12/07] Eva complies with option -warn-special-float, and propagates or warns on NaN and infinite values accordingly. -! Kernel [2017/12/07] Option -warn-not-finite-float renamed into -warn-special-float and extended (accepts non-finite/nan/none). - Kernel [2017/12/07] Make some typechecking warnings controllable with -kernel-msg-key keys. - Eva [2017/12/07] New option -val-skip-stdlib-specs, set by default. When analyzing the body of a function from Frama-C's standard library, specifications will be skipped. - Eva [2017/11/28] New builtins for the single-precision mathematical functions fmodf, cosf, sinf and atan2f. -! Eva [2017/11/16] In the log, messages on preconditions are now reported with the location of the call site. o! Eva [2017/11/09] The Fval module now supports NaN and infinite values. Major API changes in Fval, Ival and Cvalue.V (regarding casts, mostly) -o Eva [2017/11/09] Option -all-rounding-modes has been removed -* Eva [2017/11/09] Fix bugs in builtins for cos and sin. The results may be less precise than previously - Eva [2017/11/09] Various improvements in the handling of floating-point variables: evaluation of \is_finite, computation of the bits of a floating-point range, etc - Eva [2017/11/09] New panel "Red alarms" in the GUI that shows all red statuses emitted for some states during the analysis. They are not completely invalid, but should often be investigated first. -* Eva [2017/10/27] Fix bug in the handling of non-explicitly volatile fields inside volatile structs or unions ################################### Open Source Release Sulfur-20171101 ################################### -* Eva [2017/10/27] Fix bugs when evaluating \ìnitialized, \dangling and \separated on addresses of bitfields -* Eva [2017/10/27] Fix bug in the handling of non-explicitly volatile fields inside volatile structs or unions - RTE [2017/10/27] add option -rte-initialized to generate assertions over read accesses to potentially uninitialized locations. -* RTE [2017/10/16] Fix bounds of alarms emitted when downcasting to bitfields (issue #?2314) o Makefile [2017/10/13] add gui-byte target to only build bytecode GUI o Kernel [2017/10/11] sizeof() and alignof() applied to a function can now be rejected when the compiler does not support this construct, depending on the fields sizeof_fun and alignof_fun of the machdep -* Kernel [2017/10/11] More thorough checks on l-values with function type. Non-sensical expressions are now rejected at parsing type. - Eva [2017/10/10] Uses assigns clauses to over-approximate the effects of assembly statements. Warns if no assigns clause is provided. -* Eva [2017/10/10] Fixes a performance issue in offsetmaps, that occured when reading or copying values smaller than cells in large arrays. - Eva [2017/10/10] The backward propagation tries to reduce integer values by considering separately the bounds of their intervals. -* Eva [2017/10/10] Fixes an optimization issue where the reduction by a loop invariant just after widenings could impede the convergence. -* Eva [2017/10/10] Fixes a soundness bug where a loop invariant could be wrongly proved correct in some marginal cases. + Slicing [2017/10/05] File slicing_types/*.ml moved into slicing subdir. - Gui [2017/09/13] In the filetree, the filter menu appears on a right click on the header, while a left click sorts the tree. - Metrics [2017/09/13] In the Gui, shows the percentage and the number of dead statements (when computed) for each function of the filetree. -! Callgraph [2017/09/01] Option -cg-init-roots replaced by -cg-service-roots (almost equivalent); new options -cg-function-pointers (ignore function pointers; unsound) and -cg-roots (compute subgraphs). o! Eva [2017/09/01] In abstract domains, compute_using_specification is replaced by logic_assign, that interprets one \assigns clause. Complete specification are now interpreted through successive calls to evaluate_predicate, reduce_by_predicate and logic_assign. - Eva [2017/09/01] Various precision improvements in the interpretation of the behaviors of a specification. -* Kernel [2017/08/31] Fixes configure script on bytecode only architecture. Initial version of the patch by Debian. Fixes #2325 -* Kernel [2017/08/31] Fix various typos in source code and user messages. Patch by Debian. Fixes #2323 -! Sparecode [2017/08/31] Rename option -rm-unused-globals to -sparecode-rm-unused-globals. o! ACSL [2017/08/24] Refactor handling of logic labels in AST -! Eva [2017/08/03] Fix soundness (resp. precision) bug on big-endian (resp. little-endian) architectures. This bug triggered on low-level code, typically when using bitfields -* Kernel [2017/08/03] Strip bitfield attribute when performing integral promotions on bitfields of size short or char. Fixes incorrect attributes on the resulting expression. -! ACSL [2017/08/03] Explicitely disallow /* and */ in ACSL annotations. Allows to re-use logic parser for parsing annotations in external files that can use /* ... */ as comments. As a consequence, expressions like y/*p are thus rejected, but this was already the case when -pp-annot is activated (default for .c files) and can be fixed easily in y / *p (as it is pretty-printed) -* Kernel [2017/07/29] Fix unmarshalling of save files that contain more than 4Gb of uncompressed data. Patch from TIS-interpreter. -* Eva [2017/07/27] Fix performance issue with the equality domain. -! Kernel [2017/08/28] Fix invalid eids on code generated through loop unrolling -! Slicing [2017/08/28] Fix invalid eids on code generated through option -slicing-level >= 2 -! Eva [2017/07/28] Fixed memory leak with option -val-subdivide-non-linear o! Slicing [2017/08/01] Removing Db API for Slicing plug-in. Calls to !Db.Slicing should be replaced by calls to Slicing.Api. -o! Slicing [2017/07/27] Removing deprecated '-slice-option' and related !Db.Slicing.Projet.print_exported_project. Minor changes into !Db.Slicing.Projet.extract. o! Scope [2017/07/27] Removing Db API for Scope plug-in. Calls to !Db.Scope should be replaced by calls to Scope. o! Report [2017/07/24] Removing Db API for Report plug-in. Calls to !Db.Report.print should be replaced by calls to Report.Register.print. - RTE [2017/07/17] Emits overflow alarms on unsigned left shift when -warn-unsigned-overflow is enabled. - Eva [2017/07/17] Emits overflow alarms on unsigned left shift when -warn-unsigned-overflow is enabled. - Kernel [2017/07/10] Composite types are now required to have equal tags as per the C standard; no more support for isomorphic structs. - Eva [2017/07/01] In the GUI, the "Values" panel displays the values computed by using the properties inferred by all enabled domains. -! Eva [2017/06/30] Better handling of function alloca(), via builtin Frama_C_alloca. -* Eva [2017/06/28] The cvalue states saved after each statement are now properly deleted when an Eva parameter is changed in the GUI. o Eva [2017/06/26] New functor in domains/simple_memory.ml to build a complete domain from a value abstraction. The abstract states link each scalar variable of a program to an abstract value. - Eva [2017/06/26] New sign domain for demonstration purposes only. -* Kernel [2017/06/09] Parser now handle mixed concatenation of string and wstring. Fixes #@1467 - Eva [2017/06/07] The subdivision of the evaluation of non-linear expressions (through the -val-subdivide-non-linear option) also applies to the new evaluations requested by the equality domain. -* Eva [2017/06/14] Fix a crash when downcasting pointer values with the option -val-warn-signed-converted-downcast enabled. -* Eva [2017/06/14] Fix missing alarms when downcasting pointer values. -o Eva [2017/05/24] The argument ~with_alarms for functions of Db.Value is now optional, and will be removed in a later version. * Eva [2017/05/24] Fix soundness bug in string builtins where some invalid offsets did not generate alarms. - Eva [2017/05/22] Removes all effects of the special functions Frama_C_[dump|show]_each on the analyses: no alarms are emitted and the states are never reduced on these calls. - Eva [2017/05/22] Frama_C_dump_each prints the state of each available domain whose log category is enabled. - Eva [2017/05/22] New directive Frama_C_domain_show_each prints the internal properties about the arguments inferred by each available domain whose log category is enabled. o! Eva [2017/05/22] Abstract domains have to provide a log category and a function show_expr that prints the internal properties inferred about an expression. - Kernel [2017/05/18] Added option -print-return to inline gotos to return - RTE [2017/05/12] add -warn-not-finite-float for checking that infinite and NaN floats are not produced. -! Kernel [2017/05/17] qualifiers are dropped from the return type of functions, as they make no real sense -* Kernel [2017/04/27] stop removing const attribute on local variables. Fixes #@301 o! Kernel [2017/04/27] Remove needless repetition of declared logic labels in Tapp and Papp nodes. Fixes #@274 o! Kernel [2017/04/27] Completely separate types between Cil_types and Logic_ptree, removing needless polymorphism - Eva [2017/04/06] More precise evaluation of \initialized and \dangling predicates. ####################################### Open Source Release Phosphorus-20170501 ####################################### -* Eva [2017/05/08] Fix widening in the gauges domain, in particular with nested loops and pointers that change base address through iterations -* Eva [2017/04/25] Perform widening in the symbolic locations domain. -* Eva [2017/04/24] Fixes a crash when backward-propagating an imprecise value on a 32-bits floating point addition. A non-single precision value was erroneously returned. -* Eva [2017/04/05] Fixes a crash with the -val-subdivide-non-linear option, on subdivisions of evaluations involving pointer values. -! Eva [2017/03/31] Renamed dynamic allocation builtins for improved consistency. In particular, Frama_C_alloc_size becomes Frama_C_malloc_fresh. - Eva [2017/03/31] New option -val-builtins-list -* Scope [2017/03/31] Fix bug in the functions of Db.Scope in presence of alarms refering to volatile memory locations, or to variables that leave scope. Also impacts Eva option -remove-redundant-alarms - Eva [2017/03/31] Activate option -remove-redundant-alarms by default. - Inout [2017/03/28] Option -inout-callwise is now always active, and will be removed in a later version -* Inout [2017/03/28] Prevent formal variables of functions with only a specification from leaking into results - Kernel [2017/03/28] Dynlink is now mandatory, no degraded static mode. o! Eva [2017/03/17] Incompatible API changes in module Cvalue.Model. Functions named 'unspecified' have been renamed into 'indeterminate', and some arguments have been removed. o! Gui [2017/03/10] Signature change for constructor Pretty_source.PVDecl -! Kernel [2017/03/10] Explicit AST nodes to mark local variables initialization. -! Kernel [2017/03/10] Better handling of VLA (use explicit function calls to mark deallocation of VLA at appropriate program points) -* Callgraph [2017/03/10] Fixes inverted callers/callee in indirect calls -! Eva [2017/03/09] Option -val-show-progress is now unset by default -* Eva [2017/03/08] Fix bug #2277. The initial state of the analysis now depends on all relevant options, including kernel options -warn-... -! Variadic [2017/03/08] Change of command line argument names for the plugin Variadic. The new names are more expressive and avoid confusions with the plugin Value. Use -variadic-translation or -variadic-no-translation instead of -va or -no-va. -! Value [2017/03/07] Support for the legacy value analysis has been abandoned, Eva is now always active. Option -no-eva has been removed. -* Eva [2017/03/07] Unsound support for recursion, through option -val-ignore-recursive-calls. The support of recursion through the use of 'assigns' clauses, previously available in Value, was unsound and has been removed -! Kernel [2017/03/01] Zarith library is now required -* Kernel [2017/02/24] Fix crash when loading a saved file without a plug-in which has previously emitted a status with a tuning parameter. - Eva [2017/02/06] New (internal) mechanism to handle C functions' return values. Messages now mention \result for the value returned by 'foo'. - Variadic [2017/02/08] The plugin is now enabled by default. Use the option -variadic-no-translation to keep the original behaviour. The specification generated for the fprintf function family is now more accurate. - Kernel [2017/01/26] New option -print-libc, to expand include directives for files in the Frama-C stdlib (no longer expanded by default). -* Obfuscator [2017/01/19] Fix typo in help message (bts #2269). - Kernel [2017/01/09] Bash completion for Frama-C options. See #@154. -* Kernel [2016/12/09] Fixes oneret normalization in presence of statement contract and absence of return. See #@255 and #2235. - Kernel [2016/12/06] New option -print-machdep (help group). - Rte [2016/11/25] Remove option -rte-all. -* Cil [2016/11/20] Pointer subtractions with arguments of incompatible types are now refused. The resulting expression is typed as ptrdiff_t instead of int. - Value [2016/11/18] Widen hints directives @widen_hints now accept arbitrary l-values (evaluated at analysis time) in place of variables. -* Kernel [2016/11/17] Fixed some issues with #pragma pack() behavior, in both GCC and MSVC machdeps. Also fixed some related issues with __aligned__ and __packed__ attributes (including bts #2249). -o Kernel [2016/11/17] Utility API for checking volatile attribute in Cil. - Metrics [2016/11/17] Programmatic API for some functions via Metrics.mli. - Kernel [2016/11/07] New option -no-autoload-plugins (equivalent to old -no-dynlink); mostly for internal use. -! Kernel [2016/10/19] Stricter verification for extern, static and inline specifiers (support for CERT DCL-36-C coding rule) o* Eva [2016/10/22] Functions Db.Value.fun_set_args and Db.Value.globals_set_initial_state are now compatible with Eva. ###################################### Open Source Release Silicon-20161101 ###################################### -*! Eva [2016/10/29] Fix soundness bug on statements with RTE or programmatically-added user assertions (bts #2258). This leads to minor changes in the way states are propagated when all slevel has been consumed. Also, consolidated states now return the abstraction before any reduction by assertions or alarms. -* Eva [2016/10/20] Fix bug in the bitwise domain, on some applications of the & and | operators - Value [2016/10/20] New (experimental) option -val-builtins-auto, to automatically replace known C functions by builtins. Will be set by default in Phosphorus. -* Value [2016/10/19] Frama_C_cos and Frama_C_sin builtins are now precise by default. The former Frama_C_cos / Frama_Csin_precise have been removed -* Kernel [2016/10/18] Fix bug when pretty printing an ACSL term "divisor / *p" (bts #2250). - Eva [2016/10/18] New experimental Gauges domain, that relates integer variable to loop counters. -! Kernel [2016/10/15] Fix major bug in the backward dataflow of module Dataflows -! Scope [2016/10/15] Fix bug that might lead to unsoundness and / or looping in 'Datascope' functionality (#!235) -* Eva [2016/10/11] Prevent incorrect reductions on memory locations with volatile qualifier -! Value [2016/10/11] Option -val-warn-copy-indeterminate is now set by default. See command-line help if you want to deactivate it. - Kernel [2016/10/07] Fix bug that may occur when modifying several times command line-options taking functions as argument (issue #@109) -! Libc [2016/10/07] Functions in share/libc.c have been inlined into the proper .c files under share/libc - Eva [2016/10/07] More systematic backward-propagation between actual parameters and formals - Nonterm [2016/10/05] overall increase in precision, especially on compound statements (if, switch, loops...). Verbosity has been decreased - Nonterm [2016/10/05] New options -nonterm-ignore f1,..,fn (to ignore calls to functions f1,..,fn) and -nonterm-dead-code (to warn about syntactically dead code) - Value [2016/09/23] Extended support for syntactic widening hints (@widen_hints - see the Value user manual for more details) - Value [2016/09/20] New builtins for string-related functions: Frama_C_strlen, Frama_C_strchr, Frama_C_strnlen, Frama_C_memchr and Frama_C_rawmemchr - Value [2016/09/20] valid_string and valid_read_string predicates are now evaluated by Value -* Eva [2016/09/18] Fix bug in equality domain, after assignements lv = e where the modified locations intersect those involved in computing lv -* Eva [2016/09/18] fix performance bug in the equality domain, especially visible on programs with many local variables. o! Kernel [2016/09/16] Rename some types of the logic AST for more coherence - Kernel [2016/09/13] Support for C11 redefinition of typedefs - Kernel [2016/09/06] Deprecated Pretty_utils.sfprintf, use Format.asprintf instead. -! Logic [2016/08/31] Refactoring of ACSL extensions + allow extensions in loop annotations -! Libc [2016/08/29] New file share/libc/string.c, with simple implementations for C99 functions defined in string.h. Duplicate implementations were removed from share/libc.c. -* Kernel [2016/08/12] Fix bug #2239 about unsoundness of callgraph's services computation (bug introduced in Frama-C Magnesium). o! Kernel [2016/07/26] Suppress return_stmt field of kernel_function type. Use Kernel_function.find_return instead. -* Kernel [2016/07/31] Scripts that use Gtk can again be loaded using option -load-script (bug report: http://stackoverflow.com/questions/38677256/) -! From [2016/07/28] Removed options -experimental-path-deps and -experimental-mem-deps. -! Value [2016/06/26] Do not compute the sizeof of a function when evaluating a function call through a pointer. This avoids some warnings in MSVC mode. -! Value [2016/06/26] Option -val-show-time has been removed. Options -val-show-perf or -val-flamegraph offer more information - Value [2016/06/26] New option -val-flamegraph, to dump information about analysis times as a Flamegraph -* Value [2016/06/26] Option -val-show-perf now properly takes into account the time taken by the main function itself (without its callees) -! Kernel [2016/06/14] OCamlGraph is no longer packaged within Frama-C, and must be installed to build Frama-C from source o! Kernel [2016/06/14] Remove class Filecheck.check from API. Use Filecheck.check_ast that provides the correct encapsulation. - Eva [2016/06/11] Various improvements to experimental Apron domain - Value [2016/06/11] Pointers to functions with an incompatible type are now handled in a more stringent manner. Previously, arguments with incompatibles types but equal size were reported with an orange status. Now, any mismatch (e.g. int/float or signed/unsigned) causes a red alarm. -* Eva [2016/06/06] Setting option -val-warn-copy-indeterminate now forces lvalue copies to perform a full evaluation. This includes converting the copied value to the proper type, and emitting alarms if it is indeterminate. This option should not be set for memcpy-like functions, or for functions that copy bits of pointers -! Value [2016/06/05] API changes in modules Lmap and Cvalue.Model. All occurrences of `Map in returned value should be replaced by `Value -! Value [2016/06/03] Several warnings emitted by Value are now properly prefixed by [value] instead of [kernel] - Value [2016/05/31] New message key 'garbled-mix', to track garbled mix generated during the analysis -* Value [2016/05/30] Garbled mix created when analyzing assigns / from clauses are now tagged as having "Library function" origin - Value [2016/05/30] New option -val-warn-on-alarms, which governs whether alarms are printed as warnings or text. -* Kernel [2016/05/23] Side-effect free instructions such as 'e;' are now translated as 'tmp = e;' instead of 'if (e) {}' (which was incorrect when e did not have a scalar type) - Eva [2016/05/27] Improvements to option -val-subdivide-non-linear for high number of subdivisions -* Value [2016/05/23] Option -val-show-initial-state has been removed. Instead, -value-msg-key=-initial-state can be used - Value [2016/05/23] New message key final-states, that can be used to deactivate the printing of the abstract states at the end of each function o* Kernel [2016/05/18] Fixes merging of contract when using Annotations.add_code_annot - Rte [2016/05/15] New option -rte-pointer-call, to generate annotations for calls through function pointers -* Value [2016/05/15] Fix crash when extracting bits of a long double value. (Issue 92 on TIS-interpreter, reported by ch3root.). - Value [2016/05/14] Builtins are now available for malloc: Frama_C_alloc_size (one new base each time, may diverge) and Frama_C_alloc_by_stack (one base by stack, may end up performing weak updates). -! Cil [2016/05/12] Conversions between a bit-field lvalue and the (integral) type of the bitfield are now always made explicit through casts; the attribute FRAMA_C_BITFIELD_SIZE is present on the type of the cast if needed. - Libc [2016/05/03] Implementations of some functions of the standard library are now available in share/libc/*.c -* Makefile [2016/04/27] Fix compilation of plug-ins which depends on another plug-ins when compiled outside Frama-C. - Gui [2016/04/24] Different filters for user assertions and RTEs are now available. - Eva [2016/04/05] Improvements to option -val-subdivide-non-linear on expressions such as x*x+y*y, or t[i*i]. - Eva [2016/04/01] Support for options -warn-signed-downcast and -warn-unsigned-downcast. -! Kernel [2016/03/31] OCaml version greater than or equal to 4.02.3 required. o Makefile [2016/03/31] Warnings and warn-error are activated only if a file .for_devel is present along side the Makefile (also for plugins) o! Kernel [2016/03/29] Functions Integer.pgcd and Integer.ppcm are now guaranteed to return a positive result. ###################################### Open Source Release Aluminium-20160502 ###################################### - Value [2016/04/19] Support for evaluation of predicate \valid_read_string on constant strings. -* Sparecode [2016/04/11] Fix crash when an entire function becomes spare. (issue #@157). - Eva [2016/03/30] New experimental domain that improves precision on bitwise operations, for example on pointers. Activated by option -eva-bitwise-domain. o! Value [2016/03/30] API change in functor Lmap.Make. - LoopAnalysis [2016/03/29] New plug-in 'LoopAnalysis' which estimates loop bounds and -slevel-function parameters. Invoked using option -loop. -* ACSL [2016/03/30] Fixes precedence uncompliance within ACSL Manual of some bitwise operators and more aggressive checks of consistent relation chains. -* Metrics [2016/03/24] Fix list of undefined functions; functions that are never called were not reported. -* Metrics [2016/03/24] Fix option -metrics-value-cover when option -metrics-libc is not set. -! Metrics [2016/03/24] Global variables defined in Frama-C standard library are no longer counted when option -metrics-libc is not set. - Variadic [2016/03/17] New plug-in 'Variadic' which translates variadic functions, calls and macros to allow analyses to handle them more easily. Invoked using the -va option. - Nonterm [2016/03/09] New plug-in 'nonterm' for detection of definite non-termination based on Value. !o Kernel [2016/02/29] Do not raise Invalid_arg and Failure exn but use custom exceptions instead. Prevents warning 52 in OCaml 4.03.0 Functions raising new exceptions are: - Db.From.find_deps_term_no_transitivity_state - Db.Interp.* - Kernel [2016/02/24] New option --log to copy the output of plug-ins into one or several text files (described in the User Manual). -* ACSL [2016/02/23] Fixes implicit logic label generation on recursive definitions. Fixes bug #2158. - Eva [2016/02/22] Experimental domain dedicated to storing and learning information from syntactic equalities (option -eva-equality-domain). - Eva [2016/02/22] Improvements to backward propagation, on memory accsses and bitwise operations. -* Value [2016/02/17] Fix handling of functions without a body that return a pointer. The pointer was aligned on an incorrect frontier. -* Value [2016/02/17] Fix crashes when analysing a function (without a body) that returns an empty struct, or a pointer to an empty struct. Bugs reported by TrustInSoft. - Kernel [2016/02/10] Registering twice the same machdep is now accepted. - Cil [2016/02/10] Add proper support for empty aggregate initializers in GCC mode. - Cil [2016/02/08] Operator ! applied to constant expression is no longer simplified when not required. - Value [2016/02/05] Informative messages about inactive behaviors are now emitted only at verbosity level 2. - Value [2016/02/05] Messages on ACSL predicates with Unknown/Invalid status are now emitted with a 'warning' severity, consistently with the emission of alarms. 'True' statuses are hidden if option -val-show-progress is unset. - From [2016/02/03] Option -from-verify-assigns takes into account direct and indirect dependencies. - Value [2016/02/03] Distinguish direct and indirect dependencies in 'from' clauses to compute the effecst of an 'assigns/from' clause. See section 7.2 of the manual. -* Libc [2016/02/02] Fix specifications of memchr and strncpy. -* ACSL [2016/01/27] Fixes example of logic label use. Fixes bug #2203. -* Logic [2016/01/17] Meaningless assigns clauses are now rejected more aggressively. Fixes bug #1790. o Kernel [2016/01/08] Several incompatible changes in module Property. - Kernel [2016/01/08] Automatic generation of assigns from GCC's extended asm. -* Value [2016/01/06] Evaluation of ACSL ranges takes into account option -safe-arrays. In particular t[..] remains within the bounds of t. Fixes bug #!1639. -* Value [2016/01/05] Take into account 'volatile' qualifiers on struct typedefs, which were previously ignored. Fixes issue #@102. - Value [2016/01/03] Support for \valid_function predicate during evaluation. - ACSL [2016/01/03] New predicate \valid_function, requiring the compatibility between the type of the pointer and the function being pointed. -* Eva [2016/01/01] Fixed some bugs related to 0. vs. -0. in conditions. - Eva [2016/01/01] More aggressive reductions in complex conditions such as if(a+3 < 10). -*! Value [2016/01/01] Reimplementation of all the upper layers of the plugin. Compatibility with the legacy version is almost complete, save for some text messages and a few functions of the API. Use option -no-eva to switch back to the legacy version. Changelog entries labelled 'Eva' refer to this new version. Entries labelled 'Value' apply to both versions. o! Value [2015/12/02] Base.base_max_offset has been removed. Part of its functionality is still available via Base.valid_range, whose return type is now more expressive. -* RTE [2015/12/09] Fix unsoundness for overflows on binary operations when one or two operands were constant. -* RTE [2015/12/09] Fix unsoundness on unary minus expressions when option -rte-trivial-annotations is active. -! Cil [2015/12/02] Changes in the handling of incomplete structs and zero-length arrays. Initialization of incomplete (completely undefined) structs is now duly rejected. Several compiler extensions to the C99 standard (empty initializers, zero-length arrays, etc.) now require a GCC or MSVC machdep (e.g. -machdep gcc_x86_32). -! Cil [2015/12/02] Better handling of C99 flexible array members (FAMs). Static initialization of FAMs (a GCC extension) is no longer supported. o! Gui [2015/12/01] Refactor GUI Helpers. (Toolbox and (partially) Gtk_helper moved to Wutil,Widget, Wform, Wtext and Wtable). -! Value [2015/11/26] Widening hints now includes signed and unsigned limits for the bitsize of the value being widened, but does not include arbitrary limits anymore. The convergence is generally faster but results may be more or less precises depending on the case. -! Value [2015/11/26] Better propagation strategy for nested loops. Results are usually much more predictable (and often more precise) when the loops are not fully unrolled by slevel. -! Makefile [2015/11/26] Target 'make rebuild' has been renamed into 'make clean-rebuild'. -* Value [2015/11/24] The preconditions of functions overridden by builtins no longer receive an 'Unreachable status for calls within dead code: the specification is ignored everywhere. Fixes bug #!1956. -! Cil [2015/11/23] Incorrect return statements (return void on non-void functions and vice-versa) now generate errors instead of warnings. - Value [2015/11/23] New option -val-warn-undefined-pointer-comparison. - ACSL [2015/11/23] Add built-in operators for lists. - ACSL [2015/11/23] Add notation '{ x, y, z }' for defining sets. o Makefile [2015/11/19] New option PLUGIN_EXTRA_DIRS for multi-dir plugins. -* Kernel [2015/11/18] do not crash when loading statuses depending from non existing parameter. Fixes issue #!2181. o! Makefile [2015/11/12] Get rid of FRAMAC_MAKE variable. Use FRAMAC_INTERNAL instead for distinguishing internal and external mode. - Kernel [2015/10/28] Option -collect-messages is obsolete and will be removed in a future version; messages are now always collected. o! Kernel [2015/10/19] Removed function State_selection.list_state_union. Use State_selection.of_list or State_selection.list_union instead. -* Kernel [2015/10/15] Avoid comment duplications on generated code. -* Kernel [2015/10/15] Comments are preserved even when loops are unrolled. Fixes issue #!2176. -! Kernel [2015/10/15] Option -warn-undeclared-callee changed to -implicit-function-declaration, which receives an argument (ignore, warn or error) specifying what to do when an undeclared function is called. -! GUI [2015/10/15] Signature change for function Design.register_source_highlighter; the first argument of the callback has now type Design.reactive_buffer, which can be coerced back to a GSourceView2.source_buffer using method buffer. - Value [2015/10/13] During the evaluation of ACSL 'assert', intermediate statuses (e.g. True, then Unknown, then True) are now reported in the console. o! Kernel [2015/12/09] API change for function Alarms.register. See .mli for details. - Cil [2015/10/09] Add support for parsing digraphs. o! Cil [2015/10/09] Buggy record Cil.miscState has been removed. Customization must be done directly in Cil_printer.state. - Value [2015/09/30] Better precision for calls through function pointers when multiple functions are possible. The abstract state now contains the information of which function was called. o! Value [2015/09/20] Functions filter_le_ge_lt_gt_* have been renamed into backward_comp_*. Evaluation and reduction functions for comparisons now use and return dedicated types, in Abstract_interp.Comp. - Cil [2015/09/20] Double pointer casts on the NULL pointer are now simplified. -! Cil [2015/09/20] Typing within comparisons is now more strict, or made more explicit through casts. - Kernel [2015/09/20] The untyped AST is no longer removed by basic program transformations such as loop unrolling. o Ptests [2015/07/29] New EXEC: directive. - Kernel [2015/07/01] New options -then-last and -then-replace. - Kernel [2015/07/01] New option -remove-projects. - Kernel [2015/06/30] New option -set-project-as-default. ###################################### Open Source Release Magnesium-20151002 ###################################### o! Kernel [2016/01/03] Modules Dataflow is deprecated, and will be removed in Aluminium. Module Dataflow2 offers a very similar but simpler API. - Doc [2015/11/16] Fixed typo in the manual (Thx Mihaela Sighireanu). -* Kernel [2015/10/12] Fix clearing of old statuses and hypotheses when a new status is emitted or an annotation is removed. -* Libc [2015/09/29] Removed obsolete file machine.h (along with other similar files) from the Frama-C share folder. Fixes bug #2171 -! Kernel [2015/09/07] Removed support for OCaml 3.12.1 - Value [2015/09/03] Assertions containing \at(P, L), where L is a C label, can now be evaluated. Evaluation is done once Value has run; thus, it ignores option -slevel. -* Value [2015/09/03] pointer_comparable alarms are now emitted with arguments properly cast to void* or void (*)(). - Value [2015/08/10] The alarms raised when evaluating a global initializer that leads to an undefined behavior are now marked with an "Invalid" status. - Report [2015/08/10] Reports in csv format now honor option -report-specialized (previously, preconditions at a callsite were always skipped). -* Libc [2015/08/26] Fix bug in the specifications of readir, opendir, closedir and fopen functions, that would cause incorrect analysis in -lib-entry-mode. - Gui [2015/08/14] When a call statement is selected, the statuses of the preconditions of the called functions are displayed in the 'information' panel. o! Gui [2015/08/14] Minor API changes regarding Design.reactive_buffer. Some values that used to have an option type are now guaranteed to be present. - Gui [2015/08/12] Internal ids (for statements, code annotations, etc.) are now hidden by default. Start the GUI in debug mode if you want to see them. -* Gui [2015/08/10] Filenames in the GUI file tree (top-left panel) are now sorted correctly. Fixes bug #2173. -! Value [2015/08/03] WIDEN_HINTS directive are now cumulative with automatically inferred bounds. Fixes bug #876. -* Cil [2015/08/03] Fix bug #1553, related to nested initialisations of structures containing pointers. -! Value [2015/08/03] All plugins that depend on Value, plus Value itself are now dynamic. Custom plugins must specify in their Makefile the plugins they depend on (e.g. PLUGIN_DEPENDENCIES:=Inout Value). -* Cil [2015/07/29] Cil transformation can introduce assertion to ensure that size expressions in an array declarations evaluated at program execution time are positive and do not overflow. o Ptests [2015/07/29] New LOG: directive. - Value [2015/07/19] Garbled mix origins now include at most one source location. - Report [2015/07/19] New option -report-proven to control the display of proven properties. - Report [2015/07/19] New export format (.csv), through option -report-csv. o! Callgraph [2015/07/16] Remove Cil.Callgraph, Db.Syntactic_callgraph and Db.Semantic_callgraph which are all replaced by the single plug-in Callgraph. See Changelog_detailled.md for further detail about this change. -! Callgraph [2015/07/16] New plug-in callgraph which merges the old Syntactic_callgraph and Semantic_callgraph plug-ins (now removed). Either this plug-in uses Value if already computed, or computes the syntactic callgraph otherwise. This new plug-in unifies the behavior of its two ancestors. In particular, the edges of callgraph computed with the help of Value are now directed in the same way as the syntactic callgraph (was reversed before) and so the computed services are now equivalent. Also, the uncalled functions are now displayed by default. For plug-in developers, the callgraph is easily accessible via an API (bts #755). -! Value [2015/07/14] Float operations that are guaranteed to lead to +/-infty (e.g. x = FLT_MAX*10.) now stop propagation. Previous behavior was to continue with an imprecise value for x. - Kernel [2015-07-09] New option -custom-char-annot for changing the character introducing ACSL annotations (instead of '@'). - Value [2015/07/09] Do not emit pointer_comparable alarms on valid pointer comparisons involving objects of size 0. - Value [2015/07/07] The semantics of copying a lvalue has been changed when a type mismatch occurs between the destination and the copied value. A bitwise reinterpretation of the value to the destination type is now performed during the copy. o! Kernel [2015/07/01] Ival.Float_abstract renamed to Fval. Fval.inject_r now may raise Fval.Non_finite instead of the old Float_abstract.Bottom. - Value [2015/06/29] Option -val-split-return-auto now always split between NULL/non-NULL pointers. -* Value [2015/06/26] Check the validity of the operands of the ACSL operators /, %, << and >> when evaluating a predicate. o! Value [2015/06/25] Remove duplicate values Ival.singleton_zero and Ival.singleton_one. Use script sodium2magnesium.sh for automatic migration. -* Parsing [2015/06/22] Black-list gcc's builtin macros for logic pre-processing to avoid warnings for duplication. Fixes bug #2161. -* Logic [2015/06/15] Fix typing bug when converting into a term an expression containing a pointer subtraction. -* Value [2015/06/09] Pointer comparisons using relational operators (<, >=, etc) between a pointer and NULL is now flagged as undefined. o! Kernel [2015/06/09] Remove support of plug-ins without .mli. Fixes bug #!1825. -* Cil [2015/05/29] Better typing of '?' operator. Fixes bug #2117. o! Kernel [2015/05/29] Remove long-obsoleted functions Cfg.computeCFGInfo Cfg.printCfgFilename, and Cfg.printCfgChannel. - Value [2015/05/28] Functions call using a function pointer are now treated more leniently when too many arguments are supplied. An alarm is emitted, but execution continues with the right number of arguments. - Value [2015/05/12] Improved reduction by predicate \initialized when the left argument is a range of locations. - Impact [2015/05/12] Removed function Db.Impact.slice, that was actually unrelated to Impact. You can use the functions contained in Db.Slicing.Select, in particular Db.Slicing.Select.select_stmt, to obtain the same result. - Makefile [2015/05/06] Dynamic plug-ins are now declared as Findlib packages. Use variables PLUGIN_REQUIRES and PLUGIN_DEPENDENCIES. Loading a plug-in automatically loads all necessary dependencies. Plugin "MyPlugin" is register under "frama-c-myplugin" package. -! Kernel [2015/05/06] Dynamic now rely on Findlib. Small changes in API. Option -load-module can now load any Findlib package and its dependencies as well. - Kernel [2015/05/06] Reformulated help messages. Option -help is more concise. Option -version only prints version number. Options -print-xxx uniformized. New options -plugins, -print-config. - Value [2015/05/29] Added built-ins for mathematical functions: atan2, fmod, pow, expf, logf, log10f, powf, sqrtf, floor, floorf, ceil, ceilf, round, roundf, trunc, truncf. -* Value [2015/05/03] In -lib-entry mode, allow the generation of initial states with 0-sized bitfields. -* Metrics [2015/05/05] Fix computation of global cyclomatic complexity. Fixes bug #!2089. -* Libc [2015/04/29] Added ACSL specifications to some standard library functions, including read, write and realloc. Fixes bug #1939. - Scope [2015/04/22] Assertions previously removed by -remove-redundant-alarms are now marked as proven, but remain in the AST. - Value [2015/04/22] New GUI panel 'Values', that displays nearly all the information previously available under the 'Information' panel. -* Logic [2015/04/14] Correct handling of string and char constant in logic pre-processing. Fixes bug #2101. -* Logic [2015/04/14] Better overloading resolution. Fixes bug #2098. o! Logic [2015/04/08] Functions Db.Properties.Interp.lval and Db.Properties.Interp.expr have been renamed (into term_lval and term, respectively), and have a new signature. -* Cil [2015/04/19] Fix parsing of packing directives of the form '#pragma pack(push, N)'. -! Value [2015/04/13] In -lib-entry mode, functions pointers no longer force the generation of dummy functions. Instead, they are initialized to NULL. Fixes bug #!2104. - Kernel [2015/04/01] New API for backward dataflow propagation in file Dataflows. - Metrics [2015/03/25] New category 'Extern global variables', that can be used to check whether some files are missing. - Metrics [2015/03/24] Functions from Frama-C standard library are now hidden by default. -* Cil [2015/03/26] Switch statements in which some cases are not constant expressions are now completely disallowed, as per the C standard. -* Cil [2015/03/21] Disallow all incomplete types for struct fields Fixes bug #!1672. -! Cil [2015/03/21] Parsing no longer accepts structures containing incomplete types. Fixes bug #!2091. - Kernel [2015/03/24] Special functions CEA_ have been removed. -! Libc [2015/03/19] Most .c and .h files under /share have been merged into /share/libc. Inclusions of builtin.h should be replaced by __fc_builtin.h. - Kernel [2015/03/18] New ACSL predicate \valid_read_string in share/libc/__fc_string_axiomatic.h. -! Value [2015/03/12] Terms involving l-values that are bit-fields are now correctly handled. - Cil [2015/03/19] Fix incorrect simplifications of '!E' to 0 when E is either an enum with value 0 (bug #2090), or an expression whose value wraps. -! Kernel [2015/03/17] Removed option -no-dynlink. - Kernel [2015/03/10] macro __FRAMAC__ is defined when pre-processing C files in Frama-C. o! Kernel [2015/03/10] AST change: split GVarDecl into GVarDecl and GFunDecl o! GUI [2015/04/04] Constructor Pretty_source.PTermLval now has an additional argument, the property in which the term appears. - Defs [2015/04/04] L-values for which defs are queried are now evaluated only for the callstacks that are currently active, resulting in possibly less locations. -! Value [2015/03/08] Fix bug in -memexec-all option in presence of instructions where evaluation was guaranteed to fail. -! Inout [2015/03/08] The inputs of an instruction whose evaluation always fail include the sub-expressions for which evaluation succeeds. - Kernel [2015/02/26] Added -no-tty option to disable terminal capabilities - Value [2015/02/23] Faster treatment of imprecise struct copying and left shifts in the logic. o! Kernel [2015/02/22] Function Integer.two_power now raises an exception for overly big arguments. - Kernel [2015/02/20] Add new suffix '.ci' for pre-processed files containing ACSL annotations to be pre-processed. -! Value [2015/02/18] In synthetic results, for local variables that are not those of the current function, the approximated values encompass only the callstacks for which the variables were in scope in one of the callers. - Value [2015/02/18] Local variables that are in scope but not yet initialized are now present in the environment. -! Value [2015/02/15] Option -subdivide-float-var has been renamed into -val-subdivide-non-linear, and has now an effect on non-linear integer expressions. o! Value [2015/02/15] Removed function Cvalue.V.min_and_max_float. Use Cvalue.V.project_ival and Ival.min_and_max_float. - Cil [2015/02/11] Function Printer.change_printer now allows composing printers, and is called Printer.update_printer. - GUI [2015/02/11] Variables are now left- and right- clickable in the 'information' panel. - Value [2015/01/31] Improved reduction by assertions of the form \initialized(&t[0..N]) when N is above -plevel. o! Kernel [2015/30/01] Fixed bug #!2012 about combining Ast.is_last_decl and Kernel_function.get_global. - Value [2015/01/26] New option -val-initialization-padding-globals to specify how padding bits should be initialized. Option -initialized-padding-globals is deprecated. -* Value [2015/01/26] Fix initial state in which some volatile qualifiers for nested types were ignored. -* Value [2015/01/26] Fix incorrect initialization of padding bits. Option -initialized-padding was ignored in some cases. -* Cil [2014/01/26] Fix iterators on C99 designated initializers. - Value [2015/01/26] Improvements to option -subdivide-float-var, when subdividing may avoid the emission of an alarm. - Value [2015/01/21] Support for \subset predicate. ################################### Open Source Release Sodium-20150201 ################################### - Kernel [2015/02/01] Tests are added to the distrib (make tests). -* Logic [2015/02/09] The ACSL parser accepts qualifiers in logic C types. - Value [2015/01/07] Special functions CEA_ are deprecated. Use Frama_C_show_each or Frama_C_dump_each instead. - Kernel [2014/12/28] Improve pretty-printing of some loops. -* Kernel [2014/12/16] -load-module M now works fine if M uses the API of another plug-in (bts #!1824). -! Cil [2014/12/09] Default preprocessing command now includes Frama-C's standard library, and when possible sets option '-nostdinc'. See options -frama-c-stdlib and -cpp-gnu-like. *! Cil [2014/12/09] Variables __FC_MACHDEP_FOO_BAR are now automatically positioned when setting a non-standard machdep and using Frama-C's standard library. - Cil [2014/12/09] Option -pp-annot should be much faster when parsing files with many ACSL annotations. - Logic [2014/11/28] The ACSL parser now ignores /*@{ and /*@} comments, to avoid conflicting with Doxygen. - Value [2014/11/10] Accesses to locations that contain garbled mix now cause the garbled mix to be reduced to the set of valid locations. - Value [2014/11/07] Accesses to '*(foo *)p' may now reduce p according to the validity of the access, when useful. - Value [2014/11/07] Removed message "assigning non-deterministic value from the first time". - Value [2014/10/28] Option -slevel-merge-after-loop renamed to -val-slevel-merge-after-loop. Now takes a set of kernel functions as an argument. - Value [2014/10/24] Per-callstack results are now always computed. Option -val-callstack-results is deprecated. - From [2014/10/24] New option -from-verify-assigns to give assigns/from clauses of function with bodies a validity status. -! Value [2014/10/24] Logic ranges are now evaluated using a dedicated lattice. Results are almost always more precise, and the analysis faster. -* Kernel [2014/10/23] allow dynamically loaded module to start with a lower-case letter. Fixes #1276. -* Value [2014/10/15] Improved precision for variables that are reduced (but not written) during a call memorized by option -memexec-all - Value [2014/10/15] Indeterminate bits copied when option -val-warn-copy-indeterminate is active now cause a reduction in the source location. - Value [2014/10/15] Arguments of functions that give rise to an alarm are now reduced when possible. - Value [2014/09/26] Reduce arguments of a function according to the possible values of the formal at the end of the call. - Value [2014/09/26] Better precision when a scalar value is written through a garbled mix. o! Value [2014/09/26] Remove experimental support for periodic bases. -* Value [2014/09/25] Fix bug when writing precise values at too many locations in packed arrays. -* Value [2014/09/19] When for missing '\from' clause for '\result' when result is used in a postcondition. Fixes bug #1908. o! Value [2014/08/29] Garbled mix (constructor Top in modules Location_Bits/Bytes) now explicitly mention the NULL base. - Kernel [2014/08/15] New option '-then-last', which behaves like '-then-on' on the last project created by a program transformer. -* Value [2014/07/27] Text-only alarms that used the '\defined' predicate (to warn about dereferencing pointers to out-of-scope variables) are now emitted with the '\dangling_contents predicate. - Logic [2014/07/27] The ACSL predicate '\specified', which has been renamed to '!\dangling_contents' is now supported. o! Value [2014/07/22] Value 'empty' is no longer exported in module Offsetmap. The API should prevent any accidental creation. - Inout [2014/07/22] Remove undocumented option -access-path o! Value [2014/07/22] Most iterators of module Lmap and Cvalue.Model now accept only the non-bottom and non-top cases. o! Value [2014/07/22] API of module Cvalue.V_Or_Uninitialized is now type-safe. Replace all occurrences of 'get_flags v' by 'v'. o! Value [2014/07/22] Improve and clarify the return conventions of modules Offsetmap, Lmap, Cvalue.V_Offsetmap and Cvalue.Model, by returning three cases: `Bottom, `Top and `Map. The latter case indicates the operation succeeded precisely'. o! Value [2014/07/22] Functions find_base and find_base_or_default in modules Lmap and Cvalue.Model now return an optional type, to account for invalid bases (that may not be present in the map). o! Value [2014/07/22] Some functions of modules Offsetmap, Lmap, Cvalue.V_Offsetmap and Cvalue.Model now require a separate Locations.Location_Bits.t and (integer) size, instead of a Locations.location. This avoids errors when the case was Int_Base.Top. o Value [2014/07/22] Argument ~conflate_bottom to Cvalue.Model.find is now optional. The documentation has been updated to better explain its meaning. - Value [2014/07/22] Message 'extracting bits of a pointer' is no longer emitted, as it was redundant with the warnings about garbled mix. -* Value [2014/07/22] Fix evaluation of '/' in the logic, that silently ignored the presence of the value 0 in the divisor. - Value [2014/07/22] The arguments of an invalid shift operation are now reduced so that they belong to the proper range. o! Value [2014/07/22] Multiple low-level functions have been removed from modules Cvalue.V and Cvalue.Model, and are no longer available. o! Value [2014/07/22] Function Cvalue.Model.find does *not* signal its result is indeterminate anymore. Use function Cvalue.Model.find_unspecified instead. o! Value [2014/07/22] Major API change in directories src/ai and src/memory_state. Functions no longer take ~with_alarms arguments. Instead, they return booleans, that indicate an alarm occurred. - Value [2014/07/22] More systematic emission of message 'operation [...] incurs a loss of precision', signaling an arithmetic operation on a pointer address. This message is now emitted by Value itself. -! Kernel [2014/07/09] New way to handle command line options which accepts sets of values. Values may be prefixed by '+' or '-' to add/remove them and categories of values prefixed by '@' are available as well (for instance @all). o! Kernel [2014/07/09] A new bunch of functors are available to define command line collections. o! Cil [2014/07/03] Field 'vgenerated' of type Cil_types.varinfo has been replaced by the field 'vtemp' to emphasize the fact that it should only be set to true for temp variables generated during elaboration. o Cil [2014/06/27] Variables are created with a field 'vgenerated' set to 'false' by default. Only Cil should position this field to 'true'. o! Cil [2014/06/27] The field 'vlogic' of type Cil_types.varinfo has been replaced by the field 'vsource', to avoid confusion with logic variables. The value of the new field is the negation of the previous one. -! Cil [2014/06/17] Frama-C's x86 default machdeps no longer assume that the compiler is GCC. Some typing extensions and builtin are thus deactivated. If you want a GCC-centric analysis, use the gcc-prefixed machdeps. o! Cil [2014/06/17] Modifications in some fields of type Cil_types.mach. Function File.new_machdep has a simpler type. - Value [2014/06/17] Option -val-split-return can now be used to split between NULL / non-NULL pointers - Kernel [2014/06/16] New option -const-readonly (set by default), that asserts that 'const' variables must never be written. - Logic [2014/06/16] New logic label "Init", that refers to the state just after the initialization of globals. - Cil [2014/06/16] Values extracted from initializers of const variables are now accepted as arguments of directives pragma loop UNROLL. - Logic [2014/06/16] New builtin functions \min and \max of type Set(Integer) -> Int - Semantic Constant Folding [2014/06/12] Reducing the number of introduced casts; feature #!1787. - Value [2014/06/07] Improve conversion of float values that have been written as integers (through low-level memory accesses) - Value [2014/06/06] Improved pretty-printing of variables containing pointers. -* Makefile [2014/06/05] Do not install ZArith with Frama-C anymore. o* Makefile [2014/06/05] Fixed compilation bug for plug-ins with both a GUI and a non-empty API (bug #!1798). - Value [2014/06/01] Improved widening on variables that are used to access an array - Value [2014/05/27] The GUI now showns the value of logic l-values inside function specifications. They are evaluated in the pre-state of the function, before the evaluation of preconditions. o Gui [2014/05/27] Logic l-values inside function specifications can now be selected * Slicing [2014/05/23] Fix issues about slicing calls to the main function and journalization (bug #!1684). - Kernel [2014/05/22] Nicer error message in case of code incompatibility when loading a plug-in. -* Kernel [2014/05/15] Fix bug #1765 (spelling errors). -* Slicing [2014/05/14] Fix crashes about multiple slicing pragma inside a function (bug #1768). - Report [2014/04/07] New option -report-callsite-preconditions. - Report [2014/04/07] More consistent behavior when option -report-untried is not set. - Report [2014/04/07] Better reporting of reachability statuses; do not coalesce unproven reachability assertions with other alarms. - Value [2014/04/05] When option -val-callstack-results is set, the GUI now displays a callstacks-wide consolidation of the possibles values for expressions and terms. Previously, the potentially less precise summary state was used. - From [2014/04/05] Major performance improvements on big analyses. -! Value [2014/04/05] Complete rewrite of the modules Int_Intervals and Offsetmap_bitwise; both are now implemented with the same datastructure as Offsetmap. Many performance improvements. Many changes in the API of module Offsetmap_bitwise. Few changes in Int_Intervals, but the englobing module Lattice_Interval_Set has been removed. - Gui [2014/03/27] New option -gui-project to run the GUI in a given project. - Semantic Constant Folding [2014/03/25] Reducing the number of introduced casts; feature issue #!1697. - Semantic Constant Folding [2014/03/25] New option -scf-project-name. o! Cil [2014/03/24] The ikind for Cil.kinteger64 is now optional. - Value [2014/03/20] File-scope and formal const variables are read-only. Any possibility of writing there is treated as alarm. -! Gui [2014/03/14] C expressions can now be selected through the source panel. -* Cil [2014/03/13] Fix erroneous integral promotion of type 'char' on architectures where 'char' is unsigned. - Semantic Constant Folding [2014/03/13] Generate nicer constants for integers and pointers - Semantic Constant Folding [2014/03/13] Floating-point constants can now be propagated. -* Semantic Constant Folding [2014/03/13] Fix crashes and/or multiple declations when a global was referenced in the constant-folded project earlier than in the original one. - Value [2014/03/12] Improve precision of &. o Logic [2014/03/04] Annotations.{iter,fold}_all_code_annot are now by default sorted. Use ~sorted:false in case of efficiency issues. -* Value [2014/03/02] Dividing an integer value by a memory address requires the address to be comparable to NULL. - Value [2014/03/02] Alarms are now re-evaluated at the end of the analysis. If their truth value is 'Valid' or 'Invalid', this more precise status is used, instead of the previous 'Unknown' one. - Value [2014/03/01] Preconditions of functions that are never called are now also marked as dead at each call-site. - Rte [2014/03/01] Very big floating-point constants that are converted to an integer are now reported as overflowing in only one direction - Value [2014/03/01] Alarms when converting integers to floating-point are now reported only for the range that overflows - Value [2014/03/01] Instructions whose execution is guaranteed to fail are now displayed in the GUI - Value [2014/03/01] Option -val-after-results is now always active by default, and can no longer be unset -! Kernel [2014/05/12] require ocamlgraph version 1.8.5 - Kernel [2014/08/07] add instructions for downloading the manuals -* Configure [2014/03/17] use the gcc from the configure for compiling c files -* Configure [2014/03/10] fix for autoconf < 2.67 when checking ability of default pre-processor to keep comments ################################# Open Source Release Neon-20140301 ################################# -* Value [2014/03/04] Fix bug when writing imprecisely in a struct containing a 1-bit wide bitfield (bug #!1671) -* Kernel [2014/02/18] Fix -machdep help in presence of other actions (bts #1643). +* Logic [2014/02/05] Better handling of sets. Use Tlogic_coerce to explicitly mark conversion from singleton to set. - Kernel [2014/02/04] Assigns clauses generated by the kernel for functions with neither a specification nor a body receive an 'Unknown' status. - Value [2014/02/05] For functions for which only the specification is available, non-invalid statuses are no longer reported when evaluating a postcondition. Invalid statuses are reported, and usually indicate a specification error. -* Kernel [2014/02/05] Fix typing of variadic arguments. - Configure [2014/02/05] New option --disable-local-ocamlgraph to disable the use of the OcamlGraph version provided by Frama-C. -* Value [2014/02/04] Fix potential unsoundness in the operation testing the inclusion of two memory states (never observed in practice) o! Kernel [2014/02/03] The module Parameter_state now contains the functions to select group of parameters (was in module Plugin). o! Kernel [2014/02/03] The module Parameter_customize now contains the functions to customize command line options (was in module Plugin). o! Kernel [2014/02/03] Parameter is now called Typed_parameter. o! Kernel [2014/02/03] The module Parameter_sig now contains the signatures of command line options (was in module Plugin). - Kernel [2014/02/03] FRAMAC_PLUGIN may now specify a list of comma-separated directories instead of a single one. o* Logic [2014/01/30] Better specification and more checks on Annotations.{add,remove}_* functions (fixes bug #!1635). o! Kernel [2014/01/29] Changes to the signatures in lattice_type: top and bottom are now optional, a join_and_is_included function is required, and Upper_Semi_Lattice was renamed to Join_Semi_Lattice. -* Value [2014/01/25] Remove support for ACSL \inter operator, which could lead to unsoundness with predicates involving the empty set (fixes bug #!1624) - Value [2014/01/25] Fix spurious messages about integer overflow when an arithmetic operation is guaranteed to result in an undefined behavior. o! Kernel [2014/01/21] Removed Db.Dominators. Use the Dominators kernel module instead. -* Value [2014/01/18] Fixed spurious warning about floating-point values containing addresses. -* Kernel [2014/01/18] Fixed parsing bug with decimal single-precision floating-point literals representing numbers above MAX_FLOAT. -! Value [2014/01/16] Replace mostly-inoperant option -memory-footprint by an environment variable FRAMA_C_MEMORY_FOOTPRINT o Ptests [2014/01/16] Use ptests.opt whenever possible. o! Kernel [2014/01/14] For building a datatype, you now need to use smart constructors provided in Structural_descr. -* From [2014/01/11] Fix incorrect dependencies with code of the form 'f(); x = 1; f();' when f assigns a value with a right-hand side that depends on x. -* Value [2014/01/11] Fix missing read/written zones and dependencies when accessing a completely imprecise pointer (garbled mix) and using option -absolute-valid-range. Impacts the results of plugins Inout, From, Pdg, Impact and Slicing. o! Value [2014/01/08] Harmonisation and simplifications of functions related to memory states in Cvalue.Model. Different functions are now available for updating, refining and creating a state -* Value [2014/01/07] Fix crash on analyses involving very imprecise pointers and a partially valid absolute memory range -* Cil [2014/01/06] Fixes issue #1589 (do not drop access to volatile lvals in pure expressions). - From [2014/01/01] Fix possibly invalid dependencies for functions that return partially-written structs. o Kernel [2013/12/23] Plug-ins may now have a non-empty .mli interface. It deprecates the old way to register them through module Db or Dynamic (this last one may remain useful for mutually recursive plug-ins). -* Value [2013/12/23] Fix possible unsoundness in presence of &. (unsoundness never observed in practice) - Value [2013/12/23] Improve precision of treatment of x = e1 & e2; - Value [2013/12/23] Improve precision of treatment of: if ((int)floatvar == intexpr) - Value [2013/12/13] Ensure convergence in presence of some non-natural loops -* Cil [2013/12/12] Do not pretty-print while(1) into while(c) when the 'break' branch is not reduced to a single break, or contains an annotation -! Syntactic_callgraph [2013/12/10] Remove option -cg-services-only which was unused since a while. -* Value [2013/12/09] Fix rare crash during widening operation in C union intensive code -* Value [2013/12/03] Fix potentially invalid source line number in origin of Merge garbled mix values. - Value [2013/12/03] Display information about temporaries when emitting an alarm - Kernel [2013/12/03] "-machdep help" now specifies the default machdep (bts #!1558). - Obfuscator [2013/12/03] New option -obfuscator-string-dictionary to generate the dictionary of literal strings into a separated file. - Obfuscator [2013/12/03] New option -obfuscator-dictionary to generate the dictionary into a file. -* Kernel [2013/12/03] Fix bug which may occur when pretty printing range of terms. - Obfuscator [2013/12/03] Warn about unobfuscated symbols. - Obfuscator [2013/12/03] Handle literal strings in a separate dictionary (bts #!1564). -* Obfuscator [2013/12/03] Now properly handle option -ocode. - Obfuscator [2013/12/02] Obfuscate (most of) logical constructs (bts #1563). - Obfuscator [2013/12/02] Obfuscate labels (bts #1562). - Obfuscator [2013/12/02] Print the category which each symbol belongs to (bts #!1566). -! Value [2013/12/01] Volatile pointers are now modeled as the base addresses that are stored into the pointer, shifted by an unspecified offset. o! Value [2013/11/28] Functions previously required by some functors in directories src/ai and src/memory_state are no longer needed. Use script bin/fluorine2neon.sh for partially automatic migration. - Scope [2013/11/27] Option -inout-callwise can be used to improve the precision of computations, including the effects of option -remove-redundant-alarms. Option -calldeps is no longer necessary - Value [2013/11/27] Experimental option -slevel-merge-after-loop - Value [2013/11/25] Improve precision of bitwise conversion from floating-point value to integers -* Value [2013/11/22] Ensures that sqrt(-0.) is -0., even with buggy MSVC runtime. Fixes bug #!1396 - Kernel [2013/11/20] Support for binary literal constants in C and in logic denoted by '0[bB][01]+' (common ISO/C extension). - Value [2013/11/14] Copies of non-struct left-values that contain indeterminate bits can now be reported using option -val-warn-copy-indeterminate. -! Value [2013/11/14] Passing a struct containing uninitialized fields or padding bits to a function without a body no longer raises an alarm. - Value [2013/11/14] The option -val-left-shift-negative-alarms has been renamed into -val-warn-left-shift-negative -! Value [2013/11/14] Pointer subtraction now requires that the pointers refer to the same allocated block, and returns the pointwise difference between the corresponding offsets. Use -no-val-warn-pointer-subtraction to obtain the previous behavior. -! Value [2013/11/13] No alarms are emitted for overflowing unsigned left shift operations. -* Rte [2013/11/13] No assertions are generated for unsigned left-shift that may overflow, regardless of whether -warn-unsigned-overflow is set. Fixes issue #!1555. -* Value [2013/11/13] Prevent GUI crashes when options -no-results or -obviously-terminates are set and some functions have ACSL preconditions -* Value [2013/11/12] Fixed bug involving the conversion to float of a double expression e s.t. 0 < fabs(e) <= 0x1.0p-150. -* Kernel [2013/11/12] The parsed value could be wrong and the warning for inexact decimal floating-point constants be wrongly omitted for constants smaller than the smallest subnormal. -* Logic [2013/11/08] Support for _Bool in ACSL formulas -! From [2013/11/08] Separately compute data dependencies and indirect (address, control) dependencies with option -show-indirect-deps o Kernel [2013/11/08] parameters can be preserved across project creation through copy visitor (do_not_reset_on_copy function). fixes do_not_projectify and do_not_reset_on_copy status of Kernel's options. -* Logic [2013/11/06] do not cast an enum value toward its associated integral type when comparing to an enum constant. Fixes #!1546 -* Kernel [2013/11/06] Fixes loop unrolling having in their body 'switch' with 'continue' stmts. - Report [2013/11/05] New option -report-untried -*! Logic [2013/10/29] -check checks that C and associated logic variable agree on their type. transfer completion of type up to associated logic var and term when needed. Fixes #1538 -* Logic [2013/10/29] Do not remove labels out of scope of annotations too quickly. Fixes #1536 -* Kernel [2013/10/29] Do not fail on nested ternary operators whose value is dropped, as in #1503 -* Logic [2013/10/29] Accept struct with same name as typedef in specs. Fixes #1518 -* Kernel [2013/10/29] Do not consider array variable as read lval in unspecified sequence. It can't be written anyway. Fixes #!1519 o* Value [2013/10/27] Type Base.string_id is now concrete. No more need for function Base.cstring_of_string_id -* RTE [2013/10/28] Better normalization when using -rte-precond. - Kernel [2013/10/27] Generate more aggressive assigns clauses for unspecified library functions that arguments with type pointer to void or char -* Kernel [2013/10/26] Do not generate invalid assigns clauses when some formals are pointers to arrays - Kernel [2013/10/22] Support for static evaluation of the __builtin_compatible_p GCC specific function. - Kernel [2013/10/22] Add -aggressive-merging option to merge two inline functions if they are equal modulo alpha conversion. -* Kernel [2013/10/17] Correctly distinguish typenames and declared identifiers in declarations. Fixes #1500 -* Kernel [2013/10/17] Statements with a label attached to them are never erased during elaboration. Fixes #1502. -* Slicing [2013/10/17] Slicing is now compatible with option -val-use-spec - From [2013/10/15] Better precision when querying information about a zone that has the same dependencies as its neighbors. o! Value [2013/10/15] Function Map_Lattice.Make requires a new argument - Value [2013/10/14] Evaluation of left-values such as t[i][j] or p->arr[i] is now more precise when the total number of locations to read or write is less than the value of -plevel option - Value [2013/10/13] Syntactic loops (ie. 'for', 'while' and 'do ... while') are now always used to perform widening, regardless of whether they are reducible -! Impact [2013/10/11] More generic dynamic function impact_statement_gui. The set of nodes impacted can now be filtered by a memory zone. -! Journal [2013/10/09] By default, the journal is now generated into the Frama-C session directory. o*! Makefile [2013/10/03] Split Makefile.common in two parts in order to include generic rules (new Makefile.generic file) at the end of main Makefile, so specialized patterns will be considered first in make < v3.82 -*! Logic [2013/10/02] Disallow cyclic logic type definitions -! Gui [2013/10/01] the configuration file .frama-c-gui.config is now put in the GUI config directory and named frama-c-gui.config. o Kernel [2013/10/01] Plug-ins may now have their own configuration directory in which they can generate configuration files during a Frama-C session. o Kernel [2013/09/30] Plug-ins may now have their own session directory in which they can generate project-dependent files during a Frama-C session. o* Doc [2013/09/27] Fix ugly display of documentation of dynamic plug-ins API (bts #!1394). -* Value [2013/09/26] Fix crash when evaluating \valid(p->off) when p is NULL or a valid pointer, and p->off is itself only partially valid (bug #1486). -* Kernel [2013/09/26] Reject identifiers in the same namespace and same scope, according to C standard's rules. fixes bug #1330. o! Kernel [2013/09/26] Alpha.{new,register}AlphaName: transform labelled argument 'undolist' with option type into optional argument. -* Kernel [2013/09/26] Fixes issue #1451 about -unicode which was not taken into account by -load-script. -* Kernel [2013/09/24] Fixes binding of formals when linking static prototypes. Fixes issue #1475 o* Scope [2013/09/21] Functions registered in Db now return Stmt.Hptset values instead of Stmt.Set o* Value [2013/09/21] Minor signature change for widening functions - Metrics [2013/09/19] More precise information about coverage -o Value [2013/09/18] Fix bug in which two distinct memory states could be erroneously made equal -* Slicing [2013/09/12] Slicing on a composite statement containing dead code now works properly o* PDG [2013/09/12] Function Db.Pdg.find_stmt_and_blocks_nodes returns a correct result on partially dead composite statements - Slicing [2013/09/12] -slice-calls main only selects the calls to the main function, nothing more. o* Kernel [2013/09/11] Fixed buggy function Property.location. - Logic [2013/09/10] Improve localisation of error messages during logic typing. - Value [2013/09/07] Degeneration points are now shown in the GUI - Value [2013/09/07] Value analysis can now be aborted while keeping intermediate results, by sending SIGUSR1 to Frama-C - Value [2013/09/06] More aggressive evaluation of \initialized(p) when p points to a memory zone containing both bottom and non-bottom values o! Value [2013/09/06] Function Cvalue.Model.find_unspecified now requires one additional argument ~conflate_bottom - Value [2013/09/06] Warn for missing '\from' or 'assigns \result \from' clauses. Fixes wish #1448 -* Logic [2013/09/02] Conversion from C array to pointers do not lose cast on pointed types. Fixes issue #1469 o* Cil [2013/08/30] Terms containing ACSL keywords are now properly parsed by function Logic_lexer.lexpr o* Cil [2013/08/26] Statements containing calls to va_start can now be printed outside of a function -* Pdg [2013/08/26] Fix possible non-termination during the computation of the control dependencies (bug #1436) - Metrics [2013/07/29] ACSL statistics -! Value [2013/07/24] Fewer and better widening bounds for pointer addresses: try the frontier of the block -! Value [2013/07/24] Better widening bound for signed 32 bits integers -* Kernel [2013/07/18] More clever merge of function contracts. Fixes issue #1455 o Lib [2013/07/18] Filepath.normalize can replace paths by a symbolic name. o Ptests [2013/07/16] add the possibility to define macros in configurations. See developer documentation. -* Kernel [2013/07/11] designated initializers are correctly pretty-printed. Fixes issue #1457 -* Semantic Constant Folding [2013/07/10] Fixes error when folding fct pointer resulting in two distinct kf for the same function. o* Kernel [2013/07/08] Cil.mkEmptyStmt gets a valid_sid argument in order to generate valid statements. -* Kernel [2013/07/05] Tmp vars created during typecheck all have a description. Fixes bug #!1387 -* Kernel [2013/07/04] more informative error message. Fixes bug #1352 -* Kernel [2013/07/04] implicit annotation status is not lost through code transformations anymore. Fixes bug #!1442 o Kernel [2013/07/04] Added hooks when registering/removing a property o Kernel [2013/07/03] Added StringList.append_{before,after} for manipulating options (both static and dynamic API) - Kernel [2013/06/27] An 'unknown' local status is set on assigns generated from the C prototype of leaf functions o Kernel [2013/06/25] Add hooks to register transformation to be performed on a freshly computed AST. See src/kernel/file.mli o Kernel [2013/06/25] Add hook builders for hooks that can have dependencies. See src/lib/hook.mli o Kernel [2013/06/21] adding a category do not set debugging level to 1. Conversely debug ~dkey "..." (without ~level) will output "..." if dkey is requested by the user, even if debugging level is 0. -* From [2013/06/21] Position the 'and SELF' flag when an assigns clause z1 and z2 overlap in an assigns clause z1 \from z2 . - Value [2013/06/21] Better documentation of module Hptmap. Some incompatible API changes. - From [2013/06/20] Slowndowns in the analyses can be mitigated using higher values for option -memory-footprint - Value [2013/06/20] Option -memory-footprint now accepts much bigger arguments. The size allocated to each cache is multiplied by 2 between each increment. -! Kernel [2013/06/20] Renamed argument ~cache of functions cached_fold into ~cache_name. The previous integer is no longer used. -* Kernel [2013/06/20] Fix consolidation algorithm of property statuses which possibly occurs on cycles involving an unproved property (bts #1443). -* Kernel [2013/06/20] Fix incorrect dot output of consolidation graph of property statuses. -* Kernel [2013/06/19] Fix pretty-printing of comments in ghost code (bts #1378 and #1404). - RTE [2013/06/18] Remove limitation about alarms which do not fit into 64 bits (bts #1391). - Kernel [2013/06/18] Better strategy when -save is set and Frama-C crashes (bts #1388). -* Project [2013/06/17] Fix messages about projects. -* Slicing [2013/06/17] Fix crash in presence of assertions involving sizeof(t), where t is an array. Fixes similar bug with option -remove-redudant-alarms -! Inout [2013/06/13] Inputs of an instruction whose evaluation fails now include the sub-expressions for which evaluation succeeds -* Value [2013/06/12] Fix crash when the creation of the initial state encounters a completely invalid compound initializer. - Value [2013/06/11] The name of an evaluated property is now displayed in the log message. Fixes wish #1415. - Value [2013/06/11] Assertions on dead code now get a "true because unreachable" status. - Kernel [2013/06/23] The annotation 'loop pragma UNROLL "done", n;' disables the unrolling of the annoted loop. Option -ulevel-force has to to used for enabling the transformation of such a loop. This pragma is introduced by the unrolling process in order to prevent unrolling on source code obtained by a previous frama-C run. - Value [2013/06/05] Preliminary support on \forall and \exists quantification when the introduced variables have a C type. o! Value [2013/06/05] API change in module Base. Use script bin/fluorine2neon.sh for automatic migration. - Value [2013/05/26] Evaluation of \base_addr, \offset and \block_length logic predicates. o! Cil [2013/05/26] Rename function sizeOf_int into bytesSizeOf. - Value [2013/05/26] Basic support for \inter logical predicate (treated as an union). - Value [2013/05/25] Distinguish unreachable state and invalid location when printing the value of a l-value in the GUI - Value [2013/05/25] Frama_C_show_foo functions now display struct arguments in extenso. -* Value [2013/05/24] Failure during a memory zone copy is now properly notified. Alarms were emitted, but a non-bottom result was simultaneously returned. - Slicing [2013/05/24] Better slicing of complex logical assertions (bug #690). o! Value [2013/05/23] Do not crash when printing arrays or structs containing abstract structs (bug #1416). -! Kernel [2013/05/20] Support parsing and printing "asm goto" from gcc 4.6. Added a component to Cil_types.Asm constructor. - Pdg [2013/05/03] Shorter output when outputting results o! Pdg [2013/05/03] Results of Pdg cannot be intercepted by Log.add_listener anymore. Use Db.Pdg.get and Db.Pdg.pretty instead. o! From [2013/05/03] Results of From cannot be intercepted by Log.add_listener anymore. Use Db.From.{pretty,display} to print them. o! Value [2013/05/03] Results of Value cannot be intercepted by Log.add_listener anymore. Use Db.Value.display to print them o! Value [2013/05/03] Remove functions Cvalue.Model.pretty_without_null and Db.Value.display_globals. Function Db.Value.display is now a reference to the real function. Removed last argument of Cvalue.Model.pretty_filter. ##################################### Open Source Release Fluorine-20130601 ##################################### -* Value [2013/06/11] Add missing C library files. ##################################### Open Source Release Fluorine-20130501 ##################################### - Value [2013/05/22] Better precision for ^ (bitwise xor) operator when applied on intervals of positive integers -* RTE [2013/05/22] Fix off-by-one error in alarms on overflowing unsigned unary minuses. -* Value [2013/05/21] Catch evaluation errors when selecting a logic l-value in the GUI. o* Kernel [2013/05/06] Fixed Type.pp_ml_name for polymorphic types with 3 and 4 type variables (bug #1127). -* Makefile [2013/05/06] Fixed installation directory of the doc in plug-in's Makefile (bug #1278). ##################################### Open Source Release Fluorine-20130401 ##################################### o! Cil [2013/04/11] Remove Cil pretty-printer. Use module Printer instead. The script bin/oxygen2fluorine.sh may be used to automatically convert your code. - Cil [2013/04/09] Handles interpretation of linemarker ending by // and cleanup file paths. - Value [2013/03/26] Highlight non-terminating calls. - Value [2013/03/26] The location in which the result of a call is stored is now evaluated before the call. A warning is emitted if this location has changed after the call. - Logic [2013/03/26] Improved merge strategy for assigns, and report the presence of different assigns clauses between two files. - Value [2013/03/23] Better precision for postconditions in functions with multiple return analyzed without slevel. -* Value [2013/03/20] Fix incorrect interpretation of \valid{L}(P) when L is not Here label. -! Value [2013/03/20] The first element of a -lib-entry allocated array, or of an array passed as an argument to main, is now valid regardless of option -valid-context-pointers. -* Slicing [2013/03/18] Fix incorrectness in presence of assertions involving \initialized predicate. User predicates are no longer treated. -* Value [2013/03/15] Fix incorrectness of option -remove-redundant-alarms in presence of '\initialized(...)' alarms. - Value [2013/03/15] Optionally warn against unsigned overflows according to option -warn-unsigned-overflow. - Cil [2013/03/14] The type of fields that are bit-fields now carry an informative attribute FRAMA_C_BITFIELD_SIZE. -* Value [2013/03/09] Fixed misleading "after statement" state on statements followed by an assertion. -* Value [2013/03/09] Option -memexec is now correct in presence of RTE alarms. -! Value [2013/03/09] Consolidated states are now stored before 'assert' clauses are evaluatued. -* Slicing [2013/03/03] Fix options -slice-assert and -slice-threat (-threat did nothing, -assert selected all alarms). -! Sparecode [2013/03/03] Alarms are now ignored during the analysis. -* Value [2013/03/03] Fix incorrect reduction in integers containing pointers address when option -warn-signed-overflow is set. -! Value [2013/03/03] Signed overflows now cause an alarm. Option -no-warn-signed-overflow can be used to get 2's complement. -! Kernel [2013/03/03] Signed overflow alarms are now emitted by default. -! Kernel [2013/03/03] Signed downcast alarms are no longer emitted by default. Use option -warn-signed-downcast to activate them. - Kernel [2013/03/02] Print signed downcast alarms as 'signed_downcast' -! Value [2013/03/02] Removed option -val-signed-overflow-alarms. Use -warn-signed-overflow instead. -! Rte [2013/03/02] Removed options -rte-signed, rte-unsigned-ov, -rte-downcast and -rte-unsigned-downcast. They are replaced by -warn-signed-overflow, -warn-unsigned-overflow, -warn-signed-downcast and -warn-unsigned-downcast respectively. -* Rte [2013/03/02] Added missing alarm for casts from overly large floating-point numbers to integer. Fixes #!1318. -* Value [2013/02/28] Initial state of Value does not depend on -main option, but depends on -context-<...>. - Value [2013/02/27] Emit proper alarms for completely imprecise floating-point values, and for casts from float to int. -* Impact [2013/02/23] Prevent crash when a caller or callee function has been imprecisely analyzed. - Pdg [2013/02/23] Ignore inline asm statements (previous behavior was to generate Top Pdgs). -* Value [2013/02/23] In -lib-entry mode, void* fields or pointers now point to something potentially valid. - Value [2013/02/22] Option -val-ignore-recursive-calls now uses the assigns clauses of the recursive function to treat the call. - Value [2013/02/17] Improved support for va_arg variadic macro. -! Value [2013/02/17] Renamed options -initialized-padding-globals and -no-no-results into -uninitialized-padding-globals and -val-store-results respectively. -* Value [2013/02/17] Improved again support for abstract structs. o! Value [2013/02/15] Generic types of Value are now in Value_types (previously Value_aux). Implies a signature change for Db.Value.register_builtin. Value_aux.accept_base is now in Db.Semantic_Callgraph. - Value [2013/02/13] Offsets in misaligned values that repeat themselves are now always printed relatively to the beginning of the binding. - Value [2013/02/12] Suppress superfluous warning when passing as argument a struct that contains pointers. -* Metrics [2013/02/12] Global variables both declared and defined were counted twice. -* Metrics [2013/02/11] Option -value-metrics now report a correct location for function referenced by an initializer. Fixes #!1361. o! Value [2013/02/08] Renamed Locations.valid_enumerate_bits into Locations.enumerate_valid_bits. o*! Kernel [2013/02/08] Must register keywords introducing new clauses of ACSL contracts. Fixes issue #!1358. o! Kernel [2013/02/08] redesign of message categories. See detailed changelog for more information. o! Cil [2013/02/07] Clean up registering of new machdeps. Some machdep options have been integrated into Cil_types.mach, or removed from Cil.theMachine (as they were already in Cil_types.mach). - Value [2013/02/06] Improve reduction by conditions that involve '&' and '|' operators. -* Value [2013/02/06] Fix validities of degenerate variables, which were too big considering the size of the memory. -* Impact [2013/02/06] Prevent crash when considering a function with an unreachable first statement. o! Logic [2013/02/04] Change Property_status.Consolidation_graph.dump now takes a formatter instead of a file name. - Value [2013/02/02] Improved support for abstract structs. o! Value [2013/02/02] Removed Base.All validity. Use big validities with unknown flag instead. Improved signature of Base.Unknown. o! Cil [2013/02/02] Renamed function Cil.alignOf_int into bytesAlignOf. o! Cil [2013/02/02] Remove unused 'alignof_char_array' machdep field. -* Value [2013/02/01] Fix erroneous casting operating when interpreting logic casts. -* Kernel [2013/02/01] Ghost status is appropriately propagated in statements (instead of only instructions) and pretty-printed accordingly. Fixes issue #1328. - Value [2013/02/01] Value more aggressive evaluation of construct '//@ for b: assert p' when b is guaranteed to be active. Harmonize behaviors-related messages. - Kernel [2013/01/29] The level of verbose is at least the level of debug. -* Value [2013/01/28] Ignore 'const' qualifier on extern globals in lib-entry mode. Previously, those globals were initialized to 0. - Obfuscator [2013/01/28] Hide variables that do not appear in the output from the dictionary. -* From [2013/01/28] Fix rare bug in presence of involved control-flow graphs and non-terminating calls. o! Slicing [2013/01/21] Remove no longer used ~ai argument. -!*Value [2013/01/21] Various changes in the way undefined functions returning pointers are handled. - Value [2013/01/20] Alarms emitted by Value are no longer evaluated during analysis (unlike user assertions). - Value [2013/01/20] More aggressive reduction in presence of write through partially invalid pointers. Warn if the pointer is completely invalid. -* Value [2013/01/20] Option -absolute-valid-range can now be changed between two executions of Value. -! Slicing [2013/01/19] Alarms are now removed in the generated project (regardless of option -slicing-keep-annotations). -! Sparecode [2013/01/19] RTE or Value-generated alarms are now removed in the generated project. o! Value [2013/01/17] Builtins must now warn if their results should not be cached (signature change in Db.Value.builtin_result). o* Kernel [2013/01/16] Visitor no longer crashes when a non-function global is replaced by a list containing at least one function or prototype (fixes bug #!1349). !* Kernel [2013/01/10] Add lv_kind field to trace origin of logic variables. Cil_const.make_logic_var is deprecated in favor of specialized. -* Kernel [2013/01/10] Fixed bug #!1347 about accessing to a consolidated status of a property which depends on removed hypotheses. o! Kernel [2013/01/10] Remove method is_annot_before from visitors (it return only 'true'). -* Makefile [2013/01/08] Compile OcamlGraph less often: fixes issue #1343. - Value [2013/01/08] More agressive analysis of statements with improperly sequenced accesses when option -unspecified-access is used. o Kernel [2013/01/04] New methods videntified_term and videntified_predicate for the visitor. -* Kernel [2013/01/04] Fixed discrepancy between compare_type and hash_type. Added new datatype TypNoUnroll. o Kernel [2013/01/03] Added pp_field and pp_model_field in Printer_api. o Kernel [2013/01/03] Added type modules Cil_datatype.Wide_string and Datatype.List_with_collections. -* Logic [2013/01/03] Fixes various type-checking issues in presence of polymorphism and implicit conversions (including #1146). o! Kernel [2012/12/21] Module Cilutil has been removed. Previously used list functions can now be found in Extlib (use script oxygen2fluorine.sh for migration). Functions related to configuration files are now Cilconfig. o! Impact [2012/12/21] Function Db.Impact.compute_pragmas now returns a list of statements. -* From [2012/12/21] Fix absence of effect of option -calldeps after a save/load cycle. -* Inout [2012/12/21] Fix absence of effect option -inout-callwise after a save/load cycle. o! Kernel [2012/12/13] Reorganize AST's pretty-printers. You must now use module Printer. Use the script oxygen2fluorine.sh to upgrade your plug-in. o! Kernel [2012/12/13] Remove Cilutil's pretty printing helpers. Use Pretty_utils' ones instead. - Inout [2012/12/12] Indirect reads (for example 'p' for '*p') are now automatically added to inputs when evaluating assigns. - Value [2012/12/12] Evaluation of assigns now include indirect reads (ie 'assigns *p' depends on p) automatically. - Value [2012/12/07] Improve handling of conditionals when option -val-ilevel is used. - Pdg [2012/11/28] InCtrl nodes are no longer displayed in Dot graphs. o! Kernel [2012/11/24] Various types whose names started by t_ in PDG/slicing related modules are now unprefixed. o Rte [2012/11/23] Export function "exp_annotations" to get RTEs of a C expression as annotations. o*!Kernel [2012/11/23] Added TLogic_coerce constructor to mark explicitly a conversion from a C type to a logical one (in particular floating point -> real and integral -> integer). Fixes issue #1309. o! Kernel [2012/11/22] Remove unintuitive ?prj argument from Cil visitors, and first argument of Visitor.generic_frama_c_visitor. Information is now stored inside the type Cil.visitor_behavior. -* Value [2012/11/20] Fix evaluation of logic constant characters above 127. -* Value [2012/11/20] Fix soundness bugs for comparisons with logic constants that are not representable as 64 bits double. o! Kernel [2012/11/20] Signature change for constructor LReal. - Rte [2012/11/16] Generate Value-compatible alarms and annotations. - Kernel [2012/11/16] Syntactic constant folding is done once by AST (fixed bug #!1306). - Value [2012/11/13] More precise line numbers for statuses of assertions and loop invariants. - Value [2012/11/09] New option -val-callstack-results to record and display in GUI the results split by callstacks. o Kernel [2012/11/08] New function Annotations.model_fields. -! Rte [2012/11/06] Remove option -rte-print. Use -print instead. -* Kernel [2012/11/06] Do not print help of negative options when the positive one is invisible (fixed #1295). o! Kernel [2012/11/05] Get rid of useless rooted_code_annotation datatype. -* Aorai [2012/10/31] Adds locations modified by Aorai to existing loop assigns (fixes issue #1290). o Kernel [2012/10/31] Renamed Kernel_function.self to Kernel_function.auxiliary_kf_stmt_state to avoid confusion. o Kernel [2012/10/31] New function 'get' for projectified counters. - Kernel [2012/10/29] Better frama-c.top (fixed issue #1287). -* Kernel [2012/10/26] Do not attempt to merge unrelated anonymous enum that have been given the same name by Cil (fixes #1283). - Logic [2012/10/26] Extended syntax for naming terms and predicates ("string":pred and "string":term are now allowed). o! Kernel [2012/10/18] New API for module Alarms. - Kernel [2012/10/18] When printing the AST, display the emitter name of generated annotations and also the origin of annotations corresponding to an alarm. o* Kernel [2012/10/18] Fixes incorrect visitor behavior with JustCopy (issue #1282). - Value [2012/10/16] Reduce more aggressively on accesses *p where p is imprecise but contains only one valid value. -* Value [2012/10/16] Correct potentially incorrect reduction on l-values of the form *(p+off) or *(p-off). -* Kernel [2012/10/16] Fixed bug with Type.pp_ml_name for pairs, triples and quadruples which can lead to incorrect journal generation (new occurrence of bts #1127). o Kernel [2012/10/12] Optional argument 'reorder' to File.* functions creating an AST in a new project from a visitor. -* Value [2012/10/12] A bug causing the number of superposed states to be slightly underestimated has been fixed. As a result, it may be necessary to up the -slevel argument a little bit for existing proof scripts. - Kernel [2012/10/11] Option -enums for choosing representation of enums. -* Scope [2012/10/10] Prevent crash in defs computation when a lvalue is a formal. o* Makefile [2012/10/01] Fix installation directory of API documentation (fixed bts #1278). - Kernel [2012/10/01] Assumptions and axioms now get consolidated status "Considered valid" instead of "Valid". -* Value [2012/10/01] Fix "Semantic level unrolling superposing up to" messages. The number displayed was sometimes lower than the actual number of superposed states. -* Gui [2012/10/01] In some cases, after a crash of an analyzer, the GUI was not fully restored, became inconsistent and could crash. o! Value [2012/09/30] Remove various instances of Top_Param, which were all equal to Base.SetLattice. o Pdg [2012/09/30] Fix display for control dependencies in PDG graphs. o Kernel [2012/09/20] Provide Datatype.triple and Datatype.quadruple (bts wish #1277). o* Kernel [2012/09/20] Fixed consistency check of descriptor when building polymorphic datatypes (fixed bts #1277). ################################### Open Source Release Oxygen-20120901 ################################### -! Kernel [2012/09/17] Remove useless negative options -no-help, -no-version, -no-print-share-path, -no-print-lib-path and -no-print-plugin-path. - Kernel [2012/09/13] All globals with attribute FC_BUILTIN are preserved even if unused. - Value [2012/09/13] Print misaligned values in a simpler way. Fixes wish #!1271. o!* Cil [2012/09/12] Split constants of logic and C (fixes bts #745). o! Cil [2012/09/12] Remove type Cil_type.typeSig. Use the functions in Cil_datatype.Typ and Cil_datatype.Logic_typ to compare types. -* Kernel [2012/09/07] Identical messages emitted in two different projects will now be visible in both projects. Fix bug #1104. o Kernel [2012/09/07] Improve signature of State_builder.Set_ref. o* Kernel [2012/09/07] Correct hash function for Sets created by Datatype.Make_with_collections or Datatype.With_collections. o* Kernel [2012/09/06] Datatype with structural comparison for exp and lval fixes bts #1263. -* Kernel [2012/09/06] Fine tuning AST dependencies. See developer guide. -* Kernel [2012/09/05] Fixed missing undefined behavior for multiple write accesses (fixes bts #1059). -* Metrics [2012/09/05] Fixes count of pointer accesses. - Value [2012/09/05] Clarified message about completely indeterminate memory. -* Kernel [2012/09/03] Do not accept spurious '}'. Fixes bts #1273. o! Kernel [2012/09/03] Remove obsolete constructors Cabs.TRANSFORMER and Cabs.EXPRTRANSFORMER and related parsing rules. - Value [2012/09/02] Warn when 'assigns *p' points to a completely invalid location. - Value [2012/09/01] Assertions such as \valid(p) now evaluate to Invalid when p is not initialized or an escaping address. -* Value [2012/08/30] Fix crash when evaluating *((int*)0+x)=v when the NULL base is invalid. -* Kernel [2012/08/29] Fixed #!1267 (adds explicit casts for default argument promotions). o! Value [2012/08/29] Signature change for function Db.Value.register_builtin: builtins can now return multiple states. o! Value [2012/08/20] Rename Db.Value.assigns_to_zone_inputs_state to Db.Value.assigns_inputs_to_zone. Add new functions Db.Value.assigns_outputs_to_zone and Db.Value.assigns_inputs_to_locations. -* Kernel [2012/08/21] Fixed bug with save/load: loading a file , then quitting Frama-C can no longer modify (bts #!1269). +* Logic [2012/08/08] Fixed bts #!1262 about logic preprocessing and string escapes. - Value [2012/08/02] Statutes 'Invalid' are now positioned on 'for behav:' assertions even when 'behav' is not the only active behavior. o* Cil [2012/08/02] Fixed bts #1254: incorrect documentation of Cil.d_plaininit. -* Logic [2012/08/01] Fixed bts #!1253: IndexPI and PlusPI are equivalent. o* Kernel [2012/08/01] Fixed bts #!1250: setting formals of visited function is not delayed until fill_global_tables anymore. +* Slicing [2012/07/31] Fixed bts #!1248 about empty slicing request. -* Journal [2012/07/31] Fixed bts #932 about journalization of dynamic plug-ins in some corner cases. o!* Kernel [2012/07/31] Operations that silently mutate AST should now call Ast.mark_as_changed to clear states depending on it (fixes #!1244). o Kernel [2012/07/30] API of dynamic plug-ins is now documented as well as static plug-ins (fixed bts #!171). - Slicing [2012/07/30] No more blank between -slicing-project-name and -slicing-exported-project-postfix (from #!1249 entry). - Gui [2012/07/27] Fixed bugs when the consolidation graph cannot be displayed (fixed bts #1122). - Kernel [2012/07/24] The annotation 'loop pragma UNROLL "completly", n;' unroll 'n' times the annoted loop and then add it a clause 'loop invariant \false;'. The remaining loop should be death code. o Kernel [2012/07/24] Changes in interface of StringHashtbl options. -! Inout [2012/07/22] Option -inout-callwise restarts Value when it is newly set - Impact [2012/07/19] Complete rewrite. Improved precision and computation time. Fixes wishes #!5 and #!6. -* Logic [2012/07/18] Fixes sizeof("string_literal") in logic. - Logic [2012/07/18] Better error messages when parsing logic. - Kernel [2012/07/16] C constant expressions are now allowed as UNROLL level into loop pragmas. o! Cil [2012/07/16] Ast changed: Unrool_level renamed into Unroll_specs and its argument becomes a list for next evolutions. o! Kernel [2012/07/16] Add function [stmt_can_reach] to the arguments of Dataflow.Backwards, which is used to speed up the analysis. See dataflow.mli for good possible values. - Kernel [2012/07/16] linker checks that the ghost status of two merged declaration is the same, and raises an error otherwise. o* Kernel [2012/07/16] -check verifies if vdefined flag is coherent with status of variable in Globals tables and AST. Fixes one of the issues of #!1241. -! Rte [2012/07/16] Rename option -rte-const into -rte-no-trivial-annotations (set by default). -* Value [2012/07/15] Fix crash when an undeclared function returned a pointer to a function that was later called. -* Rte [2012/07/14] Prevent generation of incorrect alarms on statements whose order of execution is not completely specified. - Rte [2012/07/14] Generate simpler assertions for accesses to arrays, and discard trivial ones; improve ordering of assertions. Honor option -unsafe-arrays. o Makefile [2012/07/13] Added variables PTESTS_OPTS and PLUGIN_PTESTS_OPTS to pass options to ptests through make tests. See dev manual. -! Value [2012/07/12] More thorough checks for calls through a function pointer: warn when the function type and the pointer are not compatible, and stop when they cannot be reconciled. -! Kernel [2012/07/12] A negative value given to -ulevel option hides all UNROLL_LOOP pragmas. - Report [2012/07/10] Display unreachable properties in a special way; identify unreachable statement more clearly. - Gui [2012/07/10] Display all properties in 'Properties' panel, including generated ones without location. +! Kernel [2012/07/10] Change semantics of 'reachable' properties for functions. Use intrinsic notion instead of accessibility of first statement. o Kernel [2012/07/04] Hook for handling for loop components in Cabs. o Makefile [2012/07/04] plugin is distributed iff PLUGIN_DISTRIBUTED and PLUGIN_ENABLE are not 'no' (instead of PLUGIN_DISTRIBUTED == yes). -* Kernel [2012/07/03] Fixes bug #840 (inaccurate position in presence of -pp-annot). o+ Kernel [2012/06/29] New functions Annotations.remove_* and .fold_* for each component of a contract and other small API changes. Better compatibility between Visitor and Annotations. - Kernel [2012/06/26] New option -keep-unused-specified-functions. o! Kernel [2012/06/25] Correct (albeit slow) hash function for terms and term lvalues. -* Cil [2012/06/25] Better propagatation of volatile, const and restrict type qualifiers through typedefs on arrays -* Cil [2012/06/25] Preserve typedefs on global variables with an initializer -! Kernel [2012/06/22] improve 'reachable' properties. o! Kernel [2012/06/19] Remove module Inthash. Use Datatype.Int.Hashtbl instead, or directly carbon2nitrogen.sh migration script. o! Value [2012/06/18] Made type Ival.tt private. - Kernel [2012/06/16] Consolidation from call-site preconditions to original precondition now handle calls through function pointers - Value [2012/06/16] Position call-site statuses for function preconditions, instead of the previous global status. - Cil [2012/06/13] New option -warn-undeclared-callee for calls to functions that have not been previously declared. - From [2012/06/12] Better precision for code of the form 'if (c) stop(); else y = x+1;', where stop does not terminate - Pdg [2012/06/12] Improve precision in presence of provably dead code branches. Fixes issue #1194. o Makefile [2012/06/12] Use ocamldoc.opt whenever possible. - Rte [2012/06/11] Reuse behaviors names when -rte-precond is used on fonctions with multiple behaviors. o! Kernel [2012/06/11] New API for Annotations which merges old Annotations, Globals.Annotations and operations of Kernel_function over function contracts. - Scope [2012/06/08] Improved computation of defs. Statements are categorized between direct and indirect accesses. -! Pdg [2012/06/08] Rename option -dot-pdg into -pdg-dot - Logic [2012/06/07] Cleaner generated assertions in presence of multiple pointer casts. o! Kernel [2012/05/30] Kernel.Functions.get does not silently create a kernel function if it does not already exist. This behavior is kept for Cil builtins. -* Kernel [2012/05/29] Fix graph of consolidation statuses when several properties get the same name. -* Value [2012/05/19] Calls (*p)() where p resolves to both valid functions and invalid addresses are now properly handled. - Value [2012/05/19] Add bzero builtin. A precise destination and size are required (wish #915). -* Value [2012/05/19] In lib-entry mode, honor 'const' attributes that appear deep inside the type (bts #759). -* Value [2012/05/19] Better time and space complexity for initialization of big arrays in -lib-entry mode (bts #1026). o* Kernel [2012/05/16] Fix implementation of Datatype.Triple and Datatype.Quadruple (bts #!1133). -* Value [2012/05/15] Re-emit alarms when Value options are changed and an analysis is restarted. - Value [2012/04/29] New option -val-ilevel, to change the frontier between sets of integers and intervals. - Kernel [2012/04/27] when printing help, display the name of the opposite boolean option (bts #1085). -* Kernel [2012/04/26] Fixed bug with Type.pp_ml_name for generic sets which can lead to incorrect journal generation (bts #1127). o! Kernel [2012/04/26] Plugin.set_optional_help is now deprecated. -* Value [2012/04/26] Fix possible typing bugs when evaluating logic expressions with non-integral types (bts #!1175). - Kernel [2012/04/24] Use Zarith whenever possible (bts #!983). - Value [2012/04/16] Allow comparison of invalid pointers in the logic. - Value [2012/04/15] Old "Evaluate expression" menu in the GUI replaced by "Evaluate ACSL term"; value of term lval is now displayed. Evaluations that may fail are flagged. - Value [2012/04/15] Errors during evaluation in the logic are now reported. *! Kernel [2012/04/14] Introduce more temporaries for a call [lv = f()] if the return type of f and the type of lv do not match. Fix issue #1024. -* Value [2012/04/14] Fix incorrect initialization of volatile fields or globals in presence of initializers (bts #!1112). o* Makefile [2012/04/12] Fix bug #1145 about PLUGIN_LINK_GUI_OFLAGS. -* Kernel [2012/04/12] Strict checking of type compatibility when merging an already called prototype without arg list and a full prototype (fixes issue #728, #!109). - Kernel [2012/04/12] New option --share for plug-ins to customize their specific share directories. - Rte [2012/04/06] Emit \valid_read alarms instead of \valid for read accesses. - Inout [2012/04/05] Better precision for 'if' in which only a side is reachable. - Kernel [2012/04/05] Keep all prototypes with a spec, even if not referenced. - Inout [2012/04/04] Operational inputs are now more precise for function with only an ACSL prototype. -* Kernel [2012/04/04] Fixes issue in loop unrolling and annotations. -* Kernel [2012/04/02] Fixed bug #1135 and bug #1139 about loop unrolling. - Logic [2012/03/29] LoopEntry and LoopCurrent built-in labels. - Value [2012/03/26] Support for \valid_read predicate; evaluation of \at(p,Pre) and \initialized{Pre}(...). o! Kernel [2012/03/26] Kernel.CppExtraArgs now gets type Plugin.String_list and not Plugin.String_set (fixed bts #!1132). - Value [2012/03/24] Improved handling of conditions involving the conversion to int of a floating-point variable. - Journal [2012/03/21] Better journalisation of command line options setting a list of arguments (e.g. -slevel-function): avoid quadratic complexity in the generated code (fixed bts #!1123). - Gui [2012/03/20] Removing 'add assert before' from contextual menu. Uses ACSL_Importer plugin for such a feature. -* Value [2012/03/18] Handle 'assigns *p' where p has a typedef type - Kernel [2012/03/18] Support for model fields -* Kernel [2012/03/12] Initialization of locals is correct for all sizes; uses bzero to 0 + contract (directly validated by Kernel) -* Value [2012/03/12] Fixed bug where user assertions accessing uninitialized variables got the wrong status. - Value [2012/03/12] Improved handling of *(p+i) (or equivalently p[i]) when p is a known pointer and i is unknown. -! Kernel [2012/02/29] Adding some more supports for built-in related to memory blocks. -! Cil [2012/02/24] Functions returning a value cannot let control flow falling through the closing '}' Fixes #685. - Inout [2012/02/24] Option -inout-callwise to compute callsite-wise operational inputs. Improves precision of -inout, of the "Modifies" clause in the gui, and of the slicing. -! Kernel [2012/02/23] Sets generated assigns clauses into the default behavior. - Value [2012/02/22] New message for functions with only a specification. Changed old message for functions with neither code nor specification to "No code nor specification for function ...". - Value [2012/02/21] Evaluation of \separated predicate -* Value [2012/02/21] Fix bug in evaluation of pointers to start of array. -* Cil [2012/02/20] Improve label positions in presence of loop unrolling (bug #1100). -* Value [2012/02/18] Fix crashes and/or missing alarms when evaluating *p=(cast)f() with p invalid (bug #!1097). -* Cil [2012/02/13] Correct sharing bug on widening pragmas. Fixes #!1090. o* Cil [2012/02/11] Fixed off-by-one error in foldLeftCompound ~implicit:true. o* Makefile [2012/02/09] 'make doc' did not work when GUI disabled (bts #1014). -! Kernel [2012/02/08] Adding supports for clause allocates and frees and their version for loops. - Slicing [2012/02/07] More precise slicing when -calldeps is used (fixes wish #107). -* Kernel [2012/02/07] Fixed bug about property statuses and setting parameters after -load (statuses were not cleared when required). -* Value [2012/02/07] Allocate a finite space for malloc builtins; fixes some bugs when a pointer refers to a non-yet allocated space. -* Journal [2012/02/07] Fixed bug #!1080: better generated journal in case of missing internal data preventing it of being runable. o* Makefile [2012/02/07] Fixed bug #1082 about wrong link in generated code documentation. - Scope [2012/02/04] Improve precision of Defs computation (wish #1079). - Value [2012/02/02] Assertions of the form \valid(p+i) and \valid(&p->f) are now used to reduce p whenever possible. - Value [2012/01/30] Improve precision for code with pointer casts (fixes bug #1074). -* Syntactic_callgraph [2012/01/27] Fix bug #989 about difference of display between GUI and dot output. -* Syntactic_callgraph [2012/01/27] Fix tricky bug while computing services when a cycle depends on another cycle (most part of the fix is actually in OcamlGraph itself). -* Value [2012/01/27] Evaluate ACSL && and || when they appear as terms (fixes bug #1072). - From [2012/01/25] More sharing between identical values when printing results. - Pdg [2012/01/25] Improve performance, typically on arrays of structs. - Logic [2012/01/23] Better label inference in axiomatics (see bts #1068). - Cil [2012/01/20] In debug mode, pretty-print numerical constants instead of displaying the source file strings. - GUI [2012/01/19] Add filters for properties' consolidated statuses. - Value [2012/01/19] Aesthetic fix: do not display {{ &NULL }} and {{ &"foo" + {2} }} but rather {{ NULL }} and {{ "foo" + {2} }}. - Occurrence [2012/01/10] Results can be filtered to display only occurrences in read or write positions. - Value [2012/01/09] FRAMA_C_MALLOC_INDIVIDUAL modelization now properly treats allocated blocks as uninitialized. - Value [2012/01/07] Reduce more aggressively invalid pointers: { p->f1 = v1; p->f2 = v2 } will usually raise at most one alarm. - Value [2012/01/03] During evaluation, reduce indexes that are detected as out-of_bounds. - Value [2012/01/03] In index out-of-bounds alarms, do not generate 'assert 0 <= i' part when 'i' is always greater than 0. o Kernel [2011/12/19] Added Property.location function. o* Value [2011/12/05] Fix option -absolute-valid-range being reset by project copies. -* Value [2011/12/05] Fix wrong hash function, which could cause memory overuse and worse. o Value [2011/12/02] Lmap.paste_offsetmap now handles imprecise destinations. o! Value [2011/12/02] Moved contents of memory_state/Abstract_value into ai/Lattice_Interval_Set. Use bin/nitrogen2oxygen for automatic migration. - Project [2011/11/28] Accept to load inconsistent project by setting to default the inconsistent states and their dependencies. - Value [2011/11/26] Minor improvements related to single-precision floating-point handling. -* Pdg [2011/11/24] Option -pdg did nothing if -pdg-print was not set. - Value [2011/11/22] After emitted an alarm \initialized(lv), the value analysis tries to remember that lv is initialized. This suppresses redundant alarms that were emitted further on. -* Value [2011/11/22] Fixed soundness bugs involving lval = lval; assignments targeting literal strings and automatically created S_... memory zones. - Value [2011/11/22] Suppressed confusing message "all target addresses were invalid. This path is assumed to be dead.". -* Value [2011/11/21] Prevent potentially incorrect assertions from being emitted when the result a call must be cast. Fixes #997 and #1024. o Kernel [2011/11/21] New File.init_from_project function. - Value [2011/11/20] New builtin Frama_C_assert. Take advantage of existing assertions with "#define assert Frama_C_assert". -* Occurrence [2011/11/19] Fix bug where some occurrences were silently ignored in big asts; improve performance. -* Cil [2011/11/18] Go to new line more often when printing sequence of statements. Fixes issues #1021. - Value [2011/11/17] Better evaluation of \initialized predicate when only some parts of the location are initialized. - Value [2011/11/17] New option -no-val-left-shift-negative-alarms to treat left shift of negative integers as defined. -* Cil [2011/11/14] Fail when encountering a lvalue of type void (#1013). - Value [2011/11/10] Evaluate more precisely statements of the form if (*p == 1) {...} when *p is reused within the if block. This also improves the handling of switches. -* Kernel [2011/11/09] keep track of local variables even in presence of annotation + do not silently lose statement contract. Fixes issue #1009. -*! Kernel [2011/11/07] empty list in complete/disjoint is expanded by logic type-checker to the list of behavior name of current contract. Fixes issue #1006. See bts comments for the differences that can appear in the treatment of specs. - Aorai [2011/11/07] Aorai gets a real Dataflow analysis for contract generation + various logic simplifications. - Gui [2011/11/04] Display global annotations in the filetree. o! Cil [2011/11/04] Add method pFile in printers. Signature change for Cil.d_file (but you should use !Ast_printer.d_file). - Inout [2011/11/03] Major precision improvements when evaluating library functions whose assigns contains ranges. - From [2011/11/03] Major precision improvements when evaluating library functions whose assigns contains ranges. -* Logic [2011/10/30] Fixes issue #1005 (earlier detection of duplicated axiom name avoids Kernel.fatal). o Kernel [2011/10/27] Plugin.Register defines a new option -plugin-debug-category that allows to enable debugging for sub-categories of messages (See Log.set_debug_keys for more info). -* Value [2011/10/27] Fixed #1001: do not warn for unsigned shifts, do not end propagation on signed left shift of an address. o Value [2011/10/27] shift_left and shift_right functions now take an optional signedness boolean in addition to the optional size. -* Value [2011/10/26] Generate correct assertions when using memcpy builtin. Fix #1000. - Value [2011/10/25] Improve interpretation of ACSL annotations in presence of typedefs. -* Value [2011/10/24] Improve warnings and evaluation in presence of possibly infinite floats (fixes #997). -* From [2011/10/21] The interpretation of explicit assigns clauses for library function "assigns *p \from x;" was wrong: every possible location was assumed to have been overwritten. -* Kernel [2011/10/20] Link error aborts Frama-C (fixes #990). -* Kernel [2011/10/20] Better linking behavior (fixes #672). o! Kernel [2011/10/18] Logic_preprocess.file takes an additional parameter, as gcc pre-processor treats differently .c and .cxx files, and this must be reflected in annotation pre-processing. - Value [2011/10/18] Improve evaluation of logic when option -val-signed-overflow-alarms is active. -* Value [2011/10/17] Fixed crash when a library function is called in a state where the function's precondition cannot be true. -* Value [2011/10/10] Fixed spurious alarm \valid(p) in *p = e; when e is completely invalid. Soundness was not affected (the alarm for whatever made e invalid was present). ##################################### Open Source Release Nitrogen-20111001 ##################################### - Rte [2011/10/07] No longer position 'Don't know' statuses - Value [2011/10/07] New alarm for left shift of negative values. Minor other changes related to shift operation alarms. o*! Rte [2011/10/06] Correct plug-in name for dynamically registered RTE functions. -* Kernel [2011/10/06] Warn when the plug-in specified by -load-module or -load-script is not found (used to remain silent) -!* Kernel [2011/10/06] Do not normalize Pre in Old, especially where Old is not allowed. - Value [2011/10/01] Do not continue evaluating successive 'requires' or 'ensures' clauses if one of them is false. - Kernel [2011/10/01] New kind of command-line parameter, for commands that do heavy output. Used for Value, Pdg and Metrics. -* Cil [2011/09/30] Correctly handle casts in switch. Fixes #961. -! Rte [2011/09/30] Option -rte-precond is not entailed by -rte-all anymore (precontion annotations must now be required explicitly). -* Aorai [2011/09/30] Generation of loop invariant for intermediate counter + fixes various issues -! Slicing [2011/09/30] Option -slice-print is now deprecated: use instead -then-on 'Slicing export' -print - From [2011/09/29] Display results function by function, instead of as one big block (may lower memory consumption considerably). - Value [2011/09/27] New option -remove-redundant-alarms for removing redundant alarms. This was previously done by default. Use this option if you are going to inspect alarms emitted by Value. -* Kernel [2011/09/26] Treat long bitfields the same way as gcc and clang. Fixes #!959. -* Kernel [2011/09/26] New exception for Ast.UntypedFiles.get when no untyped AST is available. Fixes #954. - Value [2011/09/23] New alarm, for programs that do not respect C99 6.5.16.1:3 (overlapping assignment from lvalue to lvalue). Partially supported (not emitted in some cases). -* Kernel [2011/09/23] Fixes various performance issues when parsing very large functions. Fixes #!965. - Value [2011/09/23] Improved precision of if (x!=c) when the value set of x is an interval of 9 elements. -* Slicing [2011/09/23] Use correct function during generation of sliced project. Fixes #!950. o* Kernel [2011/09/22] Copy visitor creates new kf before visiting a function, allowing to use it for creating Property.t items in the new project during visit (fixes #!942). -* Value [2011/09/22] Much more clever when interpreting logic terms, including those containing \old (eg. formals in postconditions) - Value [2011/09/21] Raised cut-off limit between sets and intervals from 7 to 8 elements. - Value [2011/09/21] New informative message when not using. -val-signed-overflow-alarms "2's complement assumed for overflow" o! Value [2011/09/18] Changed the representation of Ival.t. If an external plug-in matches "Ival.Set s", a simple fix is to add "let s = Ival.set_of_array s in" as first line of that case. - Value [2011/09/16] Improved precision of &. - Value [2011/09/16] Improved precision when using -all-rounding-modes. o Kernel [2011/09/09] Map_common_interface to have a merge function for Ocaml < 3.12. o Kernel [2011/09/09] Quadruple datatype. - Value [2011/09/09] Better message when interpretation stops for a function argument. - Pdg [2011/09/06] Pdg can now be saved on disk. -* Logic [2011/04/20] Fix bug #!501: volatile clauses relative to partially volatile lvalues are handled by the kernel. - Pdg [2011/09/03] Improved time and space complexity on big functions. - Cil [2011/09/02] Add support for GCC specific cast from field of union to union -* Cil [2011/09/02] Fix merging bug (#!948). -* Slicing [2011/09/02] Fix incorrect simplification of single-statement block in presence of label. - Value [2011/09/02] Wide strings more supported. - Kernel [2011/09/02] Improve space complexity of function stmt_can_reach. - Semantic Constant Folding [2011/09/02] All options are prefixed by "scf". Use -scf-help for the details. Fixed #!946. Compatibility is preserved thanks to option aliases. - Value [2011/08/30] Remove non-relevant variables from the 'Modifies' clauses of the GUI. o! Kernel [2011/08/30] Add parameter ~with_locals to Db.accept_base (prior this, ~with_locals was implicitly false) o! Value [2011/08/30] Signature change in CilE: plugins that want to emit Value analysis alarms must define their own emitters. o! Value [2011/08/30] Add some missing ~with_alarms arguments, notably to offsetmaps copy and paste. o! Kernel [2011/08/29] Export datatype Varinfo.Hptset. Signature change in functor Abstract_interp.Make_Hashconsed_Lattice_Set. - Metrics [2011/08/26] New command-line options to compute the functions potentially called from a given function, and the percentage of functions analyzed by the value analysis. - Value [2011/08/25] Improve handling of assigns in library functions. - Occurrence [2011/08/25] Better pretty-printing: do not display internal ids anymore. -! Value [2011/08/24] Improve behavior in presence of errors during the computation of the initial state. Allow non ISO global initializers using the value of constant globals defined earlier. o! Kernel [2011/08/23] Getters of Dynamic.Parameter now get an extra argument of type unit. May improve efficiency a lot. -* Kernel [2011/08/23] Fixes visitor bug + properly refresh ids of properties in code transformation (in particular loop unrolling). -* Kernel [2011/08/15] Add parameter ~declarations to Globals.FileIndex.get_functions. Prevent duplication bug in properties navigator of the GUI. - Inout [2011/08/12] Operational inputs and outputs are now more precise for library functions: assigns clause are evaluated at each call. o! Inout [2011/08/12] Interface change. Non_contextual renamed to Cumulative_analysis. -* Cil [2011/08/10] Fix conversion bug for f(i++) or f(++i) when i has size less than int, and f expects an int (bug #911). - Value [2011/08/10] Loop invariants are now used to improve analysis. - Value [2011/08/09] Uses "complete behaviors" information. - Scope [2011/08/09] "Show Defs" is now an interprocedural analysis. o! Value [2011/08/09] Module Cvalue_type renamed to Cvalue. Module Relations_type removed. Use Cvalue instead. - Value [2011/08/04] Postconditions containing \old are now handled. - Kernel [2011/08/04] Current pragmas no longer give rise to code annotations (as they do not contain anything that can be proven). -! Gui [2011/08/04] Improve labels under the icons of the toolbar. Smart constructors in Menu_manager now require a label and a tooltip. o Kernel [2011/08/04] Add Kernel.Unicode.without_unicode, which applies a function without upsetting the Unicode option in the gui. -* Impact [2011/08/04] Correct a journalisation bug in gui mode. - Value [2011/08/01] More precise when an alarm is emitted in a loop. o! Kernel [2011/08/01] Signature of Plugin renamed for consistency. Use carbon2nitrogen for automatic translation. o! Kernel [2011/08/01] Annotations.replace and Globals.Annotations.replace_all are removed. o! Kernel [2011/08/01] Add IPLemma, IPNotacsl and IPConjunction as new constructors of Property.t; remove IPBehavior. - Kernel [2011/08/01] Better pretty printing of lists of any elements o! Kernel [2011/08/01] Properties_status is now called Property_status. Fully new interface. o! Cil [2011/08/01] Removing types about validity status from the AST. Use module Property_status instead. o Kernel [2011/07/25] Adding option ~dkey to Log.debug functions. See Log.Messages for details. o! Kernel [2011/07/22] Modification of Log.print_on_console. No more based on Format.kfprintf to avoid deadlock when error are raised by plugin pretty printers. -* Logic [2011/07/22] Fixes bug #885 (wrong insertion of cast). -* Logic [2011/07/21] Fixes bug #!887 (merging logic constants). o* Kernel [2011/07/20] Ensures that a unique kf is generated per function in each project, avoid using kf for project A in project B. -! Kernel [2011/07/18] Better handling of comments with -keep-comments and new API. See Cabshelper.Comments and Globals.get_comments_* o! Aorai [2011/07/12] Redefinition of internal structures before enabling Ya extensions for sequences o! Value [2011/07/11] Add argument "exact" to Lmap.paste_offsetmap (which was preciously supposed to be always true). -* Cil [2011/07/06] Correct obscure Cil bug linked to the removal of trivial unspecified sequences or blocks. Fixes bug #882. - Value [2011/07/05] Option -val-builtin: experimental support for builtins that can fail (by calling a fallback C function). - Value [2011/07/04] New builtin Frama_C_dump_each_file, which dumps the entire memory state into successive files. o* Logic [2011/06/29] Fixes bug #751 (Cil.lconstant now returns terms of type integer and not int). - Metrics [2011/06/27] Improves efficiency of metrics computation. o! Cil [2011/06/24] Improve performances of Cil_datatype.Typ.{compare, equal, hash}. - Cil [2011/06/22] Cache results of offsets computations. -* Logic [2011/06/22] Fixed issue #!866 (merging specs included twice) o Kernel [2011/06/16] Exporting Property_status.self state o! Kernel [2011/06/16] Dynamic.load_module searches in plugin path as advertised in its documentation o*! Cil [2011/06/14] Support for large constants in programs. My_bigint is now used instead of Int64.t in the AST. Fixes #!858. o* Kernel [2011/06/10] Fix dynamic access to function [is_default] of parameters. o! Kernel [2011/06/10] New way for handling abstract type in the type library. -* Value [2011/06/09] Remove some uneeded warnings when comparing function pointers with NULL. Fixes bug #!855. -* Kernel [2011/06/09] Correct syntactic loop unrolling in presence of switch. Fixes bug #861. o! Kernel [2011/06/09] Remove function CilE.update_gotos. o! Kernel [2011/06/09] new function Kernel_function.set_spec which must be called whenever the spec of a kf is modified. o! Kernel [2011/06/08] Remove Kernel_datatype (merge with Cil_datatatype). o! Kernel [2011/06/07] Most types of module Property are now private. Use smart constructors instead. o Kernel [2011/06/07] New function Dynamic.is_plugin_present. -* Cil [2011/06/07] Fixes bug #857 (problem with some C enum value and Ocaml 32 bits 3.11.0). -* Logic [2011/06/06] Normalization of assigns clause: \result and \exit_status only appear if a \from is specified. Fixes #!557, #!845 o! Kernel [2011/06/06] Structural_descr.pack is now a private type. Use smart constructors instead. - Value [2011/06/04] Emit \pointer_comparable alarm for unspecified. equality test between literal strings such as "foo" == "foo". - GUI [2011/06/03] Double-clicking on a warning now displays the pretty-printed source location o! Value [2011/06/03] Functions valid_* now take an argument ~for_writing Pass true when the lvalue being considered is used for writing in the program. Pass false when unsure. - Value [2011/06/03] Literal strings are now read-only. - Value [2011/06/03] More aggressive state reduction when emitting pointer_comparable assertions. Use option -undefined-pointer-comparison-propagate-all if you liked the old behavior better. o GUI [2011/06/02] Menu_manager now support check menus and toggle buttons - Value [2011/06/02] New option -no-val-show-progress - Cil [2011/06/02] Pretty-printing lval and term_lval the same way - Cil [2011/06/01] Normalization of lval: T+1 ==> &T[1] when T is in fact an array (implies *(T+1) ==> T[1]) -* Logic [2011/05/31] can have a local binding for a predicate (even a constant one) without spurious warnings from typechecker. (fixes #!848) + Ptests [2011/05/31] Add -xunit option to support JUnit like output. o Kernel [2011/05/31] Cil_datatype.LogicLabel implemented o Kernel [2011/05/31] New function File.new_machdep in order to register a new machdep dynamically. - Dominators,Postdominators [2011/05/31] No feedback by default. Use -dominators-verbose 2 or -postdominators-verbose 2 if you need it. -* Project [2011/05/31] Fix sharing bug when copying project. - Value [2011/05/31] Alarms may pretty print the abstract value culprit for the potential violation. This is particularly informative for certain alarms. - Cil [2011/05/30] Support for &"constant_string" in parser. -* Kernel [2011/05/29] Fixed macros in limit.h. - GUI [2011/05/28] Support to display the state of the absolute memory. o! Kernel [2011/05/26] Module Parameters is dead. Each module corresponding to a parameters is moved to Kernel. Module Parameters.Dynamic is now Dynamic.Parameter while Parameters.get_selection_context is now Plugin.get_selection_context. You can use the script bin/carbon2nitrogen to perform the translation (almost) automatically. - Value [2011/05/24] Option -val-after-results to control the recording of post-statement states. Active by default in the GUI. -* Cil [2011/05/24] Fixes bug #832 (spurious warning for read/write accesses in undefined order) o! Logic [2011/05/24] Add possibility to cast integer to C integral type when type-checking (Changes parameter of Logic_typing.Make) o! Kernel [2011/05/24] Kernel_function.find_return may now raise exception Kernel_function.No_Statement. -* Cil [2011/05/17] Fixes bug #771 (spurious warning for read/write accesses in undefined order). -* Kernel [2011/05/13] Support GCC like typing of enums. - GUI [2011/05/13] Add history for navigating source code. o! GUI [2011/05/13] Signature change for Filetree#add_select_function, Filetree#select_global and Menu_manager.entry. Deprecate Design.apply_on_selected. -* Kernel [2011/05/12] Fixed typing of bitfields whose size is equal to the size of int (bugs #823, #817). -* Value [2011/05/11] Fixed undocumented builtin is_base_aligned. -* Value [2011/05/11] Fixed bug when bitfield receives the result of a function call (bug #819). - GUI [2011/05/10] Menu to configure what is displayed in the filetree. -* Logic [2011/05/08] Fixed overloading resolution (fixes bug #655). -* Logic [2011/05/06] Fixed issue with -pp-annot (fix bug #691 and #812). o Kernel [2011/05/05] Kernel now accepts declarations as main entry point. - Aorai [2011/05/04] Automaton is handled by contract of leaf functions. o Cil [2011/05/04] Various smart constructors and ast helper functions. -* Cil [2011/05/04] Fixes wrong precedence of not in predicate when pretty-printing. - GUI [2011/05/04] Automatically show the main function at launch. - GUI [2011/05/04] Hide empty plugins columns in the filetree. Add support for hiding globals entirely. o! GUI [2011/05/04] Signature change for Filetree#append_pixbuf_column. o! Kernel [2011/05/03] Remove Db_types module. All types are now in Cil_types. Moved type Alarms.t to Cil_types.alarm. -* Kernel [2011/05/02] Support for GCC packed and aligned attributes and for GCC pack pragmas. Fixes #719. -* Configure [2011/05/02] Fix bug #!262: --disable-plugin works for external plugins compiled from within Frama-C kernel. - Dataflow [2011/04/29] Improve precision of backwards dataflow algorithm and of postdominators on 'if' with a missing branch -* Pdg [2011/04/28] Better precision in the dependencies. Fix bug #787, #789 and #802 : infinite loops creation in slicing. o Value [2011/04/28] Changed representation of bases for literal strings in preparation of related checks. o Postdominators [2011/04/27] Add Db.PostdominatorsValue: postdominators taking into account value analysis results -* Value [2011/04/24] Fixed crash for high values of -subdivide-float-var - Value [2011/04/24] Improved results for operation % by zero. Removed message about binary operators raising exceptions. o Value [2011/04/24] Defunctorized Lattice_Interval_Set. -* Logic [2011/04/20] Fix bug #761: adding \old in ensures clause for parameters does not capture terms in associated offset. -* Logic [2011/04/20] Fix bug #!501: volatile clauses are handled by the kernel. -* Slicing [2011/04/20] Fix bug #799: missing label in sliced program. -* Value [2011/04/17] Fix bug #798: calls to functions that return a value with latent conversion. -* Cil [2011/04/15] Fix bug #785: promotion between long long and an unsigned same-sized type. -* Cil [2011/04/14] Fix bugs #780 and #791: use ids unique between projects for varinfos, statements and expressions. o*! Cil [2011/04/14] Remove incorrect Cil_const.Build_Counter; use State_builder.SharedCounter instead. -! Value [2011/04/14] Use hash-consed sets of statements, making many analyses faster and leaner for large functions or idioms that make functions large at normalization (e.g. large initialized local arrays). -* Kernel [2011/04/14] Fix 'make clean' of plug-ins. -* Kernel [2011/04/13] Fix bug #769: merging issue for declared struct. o* Kernel [2011/04/13] Fix bug #790: AST integrity checker issue. -* Pdg [2011/04/13] Fix bug #787 but leads to less precise dependencies. -* Slicing [2011/04/02] Fix bug #786: missing label in sliced program. -* Value [2011/04/12] Correctly emit \pointer_comparable(...) alarms. -* From [2011/04/11] Fix #781: handling of function calls with an implicit cast for the assignment of the result. o Makefile [2011/04/08] Add target to launch the tests of a specific dynamic internal plugin from Frama-C's main Makefile. -* Aorai [2011/04/08] Existing assigns are augmented with the locations corresponding to the instrumentation of the automaton. - Value [2011/04/05] Each precondition can get a specific validity status. -* Kernel [2011/04/01] Fixed bug #770 and #769, part 1. Fixed typo in anonFieldName (was annonFieldName). -* Kernel [2011/04/1] Fixed bug #775. Large octal and hexadecimal constants are now correctly typed. -* Occurrence [2011/04/01] Fixed bug when journalising. -* Slicing [2011/04/01] Fixed bug #774: journalisation works again. o Kernel [2011/03/30] Removed type Log.source. From now on all locations have type Lexing.position. - Kernel [2011/03/30] Some messages may be printed several time for the same line if they refer to different columns. -* Value [2011/03/30] Fixed bug #689. Each postcondition can get a specific validity status. -* Impact [2011/03/30] Bug fixed when plug-in `Security_slicing' cannot be loaded or is incompatible with Impact. -* Impact [2011/03/30] Bug fixed with '-impact-pragma f' on an unknown function f. -* Security_slicing [2011/03/30] Fixed bug #768 about exception raised when analysing variadic functions. A warning is now emitted: the function is ignored by the analyzer, thus the result is potentially incorrect. o! Kernel [2011/03/29] Alternative signature for dataflow initial state. A few IntHash replaced by Stmt.Hashtbl. - Users [2011/03/28] Calls to this plug-in are now written in the journal. -* Value [2011/03/26] Some floating-point alarms could be printed several times. Fixed. o! Kernel [2011/03/25] get rid of bin/sed_inplace (use ISED from share/Makefile.common where needed, which was the recommended way from the beginning). o* Kernel [2011/03/25] Makefile.plugin and .dynamic more robust wrt external plugins (can make doc clean depend more easily; fixes bug #754, improves bug #742). -* Logic [2011/03/24] \at(t,L) when t is a C array is now a logic array whose content is the one of t at L, not the address of the first element of t (which stays the same between L and Here anyway). partial fix of bug #761. - Kernel [2011/03/24] \at(p,Old) is pretty-printed as \old(p). o! Cil [2011/03/24] AST changed: removing Told and Pold constructs. o! Kernel [2011/03/11] Following items are now deprecated: function Kernel_function.pretty_name: use Kernel_function.pretty module UseUnicode: use module Unicode. o! Kernel [2011/03/11] Remove several kernel functions: Ast_info.pretty_vname: use Cil_datatype.Varinfo.pretty_vname Cil.print_utf8: use module Parameters.UseUnicode- Clexer.keep_comment: use module Parameters.PrintComments Cabshelper.continue_annot_error_set: Cabshelper.continue_annot_error_set: use Parameters.ContinueOnAnnotError.off all Cil, Cilmsg and CilE functions for pretty printing: use Kernel ones instead. - From [2011/03/11] Display name of called function when displaying results of option -calldeps. o!* Logic [2011/03/11] Implementation of statement contracts for function behaviors. -* Value [2011/03/11] Fixed crash with ACSL assertions involving floating-point variables (bug #752). -* Logic [2011/03/10] Fixed bug #744 (comparison between arithmetic types is done in the smallest possible type). -* Kernel [2011/03/10] Bug fixed in File.create_project_from_visitor potentially impacted programs transformation. -* Kernel [2011/03/10] Bug fixed in pretty printer. (incorrect precedences leading to missing parenthesis). - Kernel [2011/03/09] Big integers can now be displayed using hexadecimal notation. - Value [2011/03/06] Improved option -subdivide-float-var when used without -all-rounding-modes. Improvement marginal for double computations and significant for float ones. o! Cil [2011/03/04] AST changed: 'a before_after type is deleted. All annotations are now attached before. -* Value [2011/03/04] Fixed correctness bug when bitfield initializer exceeds range (bug #721) (jrrt). o! Value [2011/03/02] Minor interface changes in Value. Replace some meaningless kinstr by stmt, and make the callbacks lazy. o! From [2011/03/02] Minor interface changes in From. Replace some meaningless kinstr by stmt, and make the callbacks lazy. -! Cil [2011/03/02] Fixed #720 (incorrect simplification of switch). - Kernel [2011/03/02] Better error message when plug-in crashes on loading (bts #737). o Kernel [2011/03/02] New function File.create_rebuilt_project_from_visitor - Cil [2011/02/24] Implement precise dataflow on switch constructs. As side effect, improve precision of value analysis. o* Kernel [2011/02/24] Fixed bug #727 (visiting a GFun spec in frama-c visitor was not done in the appropriate context). o* Ptests [2011/02/24] Ptests adds filename of current test before the options given to frama-c (see #736). - Aorai [2011/02/24] Deterministic automata. -* Aorai [2011/02/24] Fix issue in translation of guards + better error messages. o! Inout [2011/02/23] Db.InOutContext becomes Db.Operational_inputs. - Inout [2011/02/23] Correctness in presence of recursive calls. See issue #733. - Value [2011/02/23] Improved informative messages about addresses of locals escaping their scope. o! Kernel [2011/02/22] Change semantics of ChangeDoChildrenPost for vstmt_aux. See developer's manual for more precision. - Value [2011/02/22] Take Flush-To-Zero possibility into account for single-precision floats. - Kernel [2011/02/22] Exit status on unknown error is now 125. 127 and 126 are reserved for the shell by POSIX. o!* Kernel [2011/02/21] Extlib.temp_file_cleanup_at_exit and Extlib.temp_dir_cleanup_at_exit may now raise exception Temp_file_error. They may raise an unspecified exception before. -* Value [2011/02/20] Fixed bug #732: Synthetic results were partial when -slevel was set not high enough to unroll loops completely. - Inout [2011/02/20] Improved messages in presence of recursive calls o! Kernel [2011/02/18] Bts #729: calling function Plugin.is_visible (resp. Plugin.is_invisible) forces to display (resp. prevents from displaying) the corresponding parameters in an help message. o! Kernel [2011/02/18] module Service_graph: function entry_point in input and output of functor Make now returns an option type. - Syntactic Callgraph [2011/02/18] Fixed issue #723: syntactic callgraph does not require an entry point anymore. If no entry point, services are less precise yet. -* Cil [2011/02/17] Fixed bug #725 (type-checking && operator). - Inout [2011/02/17] Improved precision of the computation of operational inputs in presence of function calls. -* Logic [2011/02/17] Fixed bug #714 about lexing ACSL characters and strings. o Cil/Logic [2011/02/16] New functions Clexer.is_c_keyword and Logic_lexer.is_acsl_keyword. -! Cil [2011/02/16] Enumerated constants are kept in the AST. -* Aorai [2011/02/16] State names used as enum constant are checked to be admissible fresh C identifiers. -* Value [2011/02/15] Fixed bug when passing struct as argument to function with a big-endian target architecture. - Value [2011/02/15] Uniformized message displayed when no information is available for a function. - Logic [2011/02/14] Added support for bitwise operators --> and <--> into ACSL formula. -* Slicing [2011/04/02] Fixed bug #709: missing statements in sliced program. -* Value [2011/02/14] Fixed bug when passing bitfield as argument to function. (jrrt) -* Value [2011/02/12] Fixed forgotten warning when passing completely undefined lvalue as argument to function. (jrrt) -* Value [2011/02/12] Fixed correctness bug involving nested structs (jrrt). -* Value [2011/02/12] Fixed crash when passing invalid argument to function, found by John Regehr using random testing (jrrt). -* Value [2011/02/09] Fixed representation of unknown single-precision floats in initial context (it used to be the same as for an unknown double). -* Value [2011/02/09] Changes related to 0., +0., -0., sort of thing. Unwarranted loss of precision fixed. ################################### Open Source Release Carbon-20110201 ################################### - WP [2011/02/07] Plug-in WP removed from kernel-releases (now an independent plug-in). - Logic [2011/02/04] Mentioning a formal on the left-hand side of an assigns clause is now an error when type-checking logic annotations. o! Logic [2011/02/04] Refactoring of assigns and from AST representation and of Property.identified_property. - Value [2011/02/04] Changes in Frama_C_memcpy built-in. Still not perfect. - Value [2011/02/04] Is is now possible to call Frama_C_show_each without ..._x. - Value [2011/02/04] Generate independent assertions for signed overflow and signed underflow. In many cases only one is generated (win!). o! Value [2011/02/02] Renamed copy to copy_offsmap in Offsetmaps. The name "copy" clashed with Datatypes. o Kernel [2011/02/01] New syntactic context for memory accesses with user-supplied validity range. + WP [2011/01/31] Option -wp-warnings to display additional informations for 'Stronger' and 'Degenerated' goals. + WP [2011/01/24] Option -wp-split-dim to limit spliting up to 2**n sub-goals (see -wp-split option). -! Kernel [2011/01/27] Handle errors better when they occur when exiting Frama-C. Slight semantic changes for exit code: - old code 5 is now 127; - code 5 is now: error raised when exiting Frama-C normally; - code 6: error raised when exiting Frama-C abnormally. - Kernel [2011/01/27] Improve performance on platform with dynami.c loading. Mainly impact value analysis (for developers: improve efficiency of Dynamic.get). - Value [2011/01/25] Change in initial states generated by -lib-entry Much smaller. Perhaps more representative. + WP [2011/01/24] When -rte-precond is not used, wp generates a separate proof obligation for each call site. -! Configure [2011/01/24] Frama-C does not require Apron anymore (Why does for Jessie). Thus fix bug #647. - Value [2011/01/22] More aggressive handling of if(x>e) where x has type double. o* Kernel [2011/01/20] Fix bug #677. As a side-effect, function Plugin.add_alias is now deprecated and replaced by Plugin.add_aliases. o Kernel [2011/01/21] New function in API: Kernel_function.find_syntactic_callsites. + WP [2011/01/20] Options -wp-status-xxx to refine goal selection. o Report [2011/01/20] Option -report no longer survive after -then. + WP [2011/01/19] Clarification of -save/-then effect on WP. * Slicing [2011/01/19] Fixed bug #673. - Value [2011/01/19] Various minor speed improvements. -* Value [2011/01/19] Fixed correctness bug involving pointers to signed integer pointing to memory locations containing unsigned integers or vice versa. -* Kernel [2011/01/19] Fixed bug if an empty string is given on the command line while an option name is expected. There is now a proper error message. - Logic [2011/01/16] Fix priority bug in parser. - Slicing [2011/01/14] New options added for fixing bug #668. o Sparecode [2011/01/14] API modified for fixing #668. o GUI [2011/01/13] Added support for icons in Gtk_helper.Icon. -* GUI [2011/01/12] Fixed bug #666. Do not display misleading "After statement". - Value [2011/01/12] Improve performance of callbacks. - GUI [2011/01/11] Display more precise state after statement (http://blog.frama-c.com/index.php?post/2011/01/11/Seven-errors-game). -o Value [2011/01/11] New callback for recording the state after a statement. +* WP [2011/01/10] Fixed incorrect status refresh problem in the GUI. -* Kernel [2011/01/10] Fixed #!313. Entry point with a specification is no longer wiped out. -* GUI [2011/01/10] Fixed 100% cpu load while external command are launched. - Value [2011/01/09] Disabled incorrect interpretation of ACSL statement contracts. - Value [2011/01/07] Interpretation of ==> in ACSL annotations. -* Value [2011/01/07] Fixed obscure crash that could happen during very imprecise analyses. -* Makefile [2011/01/06] Fixed bug #!660 related to a default Frama-C-compatible ocamlgraph installation under Cygwin (i.e. in a Win32 path containing the ':' character). - Value [2011/01/06] Improved precision of & operator. - Value [2011/01/05] Added check that denormals work correctly on host computer (correction would be affected otherwise). o! Kernel [2011/01/05] Remove Messages.disable_echo (can be done using Log module) and Messages.depend (can be done using Messages.self). - Value [2011/01/05] New alarm for float -> int cast overflows. - Value [2011/01/04] Improved precision of | operator. +* WP [2011/01/04] Fixed bug #702 on Coq output with large integers. -* Inout [2010/12/22] Return statement dependencies were forgotten in operational input computations. Fixed. o! Kernel [2010/12/21] Remove API function Messages.enable_collect: please let the kernel do the job. - GUI [2010/12/21] Implement feature #635: display messages in the messages panel while loading a batch session in the GUI. The batch session must have been previously executed with the new option -collect-messages. -* Makefile [2010/12/21] Fixed bug #637: "make install -n" did wrongly create directories. -! GUI [2010/12/21] Gui options start by -gui and not -GUI - Makefile [2010/12/21] Fixed bug #!638. By default, warnings are no more errors when compiling a public Frama-C distribution and plug-ins. SVN versions of Frama-C are still compiled with "-warn-error A". o* Cil [2010/12/20] Fixed bug #645. Ast_info.constant_expr, Cil.[zero,one,new_exp,makeZeroInit,mone,kinteger64_repr, kinteger64,kinteger,integer,constFoldBinOp,mkAddrOf, mkAddrOrStartOf,mkString,parseInt,sizeOf] no longer use an optional argument ?loc. It is now a non optional labeled argument. Previous default value of loc was ~loc:Cil_datatype.Location.unknown which is most of the time not accurate. ################################### Open Source Release Carbon-20101202 ################################### -* WP [2010/12/16] Fixed bug #639: no more Coq compilation to shared directory. - WP [2010/12/16] Accessibility of all provers from gui. ################################### Open Source Release Carbon-20101201 ################################### -! Kernel [2010/12/13] Fixed bug #548: limit.h now syntactically correct. Architectures other than x86_32 still unsupported. - Value [2010/12/12] New option -float-normal (undocumented) - Value [2010/12/12] Removed undocumented option -float-digits - Value [2010/12/10] New option named -undefined-pointer-comparison-propagate-all -* Configure [2010/12/10] Always configure OcamlGraph local version (if used) when configuring Frama-C. -* Value [2010/12/09] Fixed bug that could happen in programs casting address of floating-point type to address of integer type o! Kernel [2010/12/07] Remove function Globals.has_entry_point. Use Globals.entry_point instead. -* Syntactic callgraph [2010/12/07] Fixed bug #!587: proper error message when the entry point is invalid. -* Value [2010/12/06] Do not evaluate annotations right after propagation is stopped. - Inout [2010/12/03] Improve printing of -out -input -deps - Value [2010/12/03] Preliminary support for interpreting C type float as IEEE 754 single-precision. -* Value [2010/12/02] Emit proper ACSL alarm for overflowing floating-point binary and unary operators. Fixed #259. -* Value [2010/12/02] Emit alarm for overflowing floating-point constants instead of crashing. - Value [2010/12/02] Emit alarm for uninitialized arguments to library functions. - Value [2010/12/01] Improved speed of options -slevel* for arguments in the thousands. Synthetizing results remains slow, so consider options -no-results* if you take advantage of them. - Value [2010/11/24] Do not emit alarm for uninitialized arguments to non-library functions. Necessary for structs. Relevant messages changed a little. -! Cil [2010/11/16] Cil normalization takes care of abrupt clauses o Kernel [2010/11/15] New Task module: a monadic library for calling asynchronous commands from the toplevel and the gui. o! Kernel [2010/11/05] File.check_file takes a new argument, allowing to describe which AST fails integrity check in case of trouble. -!* Kernel [2010/11/05] Fixed #620 (default assigns generation). o! Cil [2010/11/04] Changed type of doGuard in forward dataflow -* Value [2010/10/29] Disappearance of non termination messages from the log. The messages were inconsistent. -! Cil [2010/10/15] Clean up local variables handling and pretty-printing modified pBlock method interface (unified pBlock and pInnerBlock) o! Cil [2010/10/13] Extending logic label for plugin purpose. -! GUI [2010/10/08] New graph viewer, requires ocamlgraph > 1.5 -* Logic [2010/09/30] Priority is used for pretty printing predicates. o!* Kernel [2010/09/30] Major changes in the kernel. Mainly merge the old modules Datatype and Type into a single most powerful library called Type. The API of these libraries changes. Consequently, some other API changes. By side effect, a lot of functions of module Cilutil has been removed and replaced by their counterpart in module Cil_datatype. The script bin/boron2carbon.sh fixes most changes automatically. Feel free to use it to upgrade your plug-in. In the process, some minor bugs found and fixed in the Frama-C kernel. o! Cil [2010/09/20] Changed ignored pure exp hook + hook for conditional evaluation of side-effects -* Value [2010/09/18] Fixed memory leak. o! Cil [2010/09/14] Cil and Cabs expression have now a location. o Ptests [2010/09/01] Slightly changed semantics of CMD and STDOPT. See developer manual for more info -* Logic [2010/08/31] Fixed #570 (implicit conversion to void*) and fixes issue in overloading resolution -* Value [2010/08/27] Fixed performance bug that could lead to "stack overflow" error during large analyses. -* Logic [2010/08/27] Fixed #549 (Arrays in the logic) -* Cil [2010/08/27] Fixed #542 (now raises parse error when C function call dot not provide correct number of arguments) - Value [2010/08/26] "assert(TODO)", used when a property to check in the analyzed code cannot be expressed as ACSL and the user should read the English explanation (e.g. "accessing uninitialized left-value") instead, could look unprofessional to the superficial onlooker. "assert(Ook)" will now be used instead. - Value [2010/08/23] Lowered memory consumption slightly. o! Value [2010/08/22] Renamed Int.eq into Int.equal. Removed Int.neq -* Configure [2010/08/18] get rid of known_plugins.ac (fix #462) -* Logic [2010/08/18] Better error messages for logic parser and other fix (fix #512, #538, #!553, #!560) -* Kernel [2010/08/17] CL options for cabs2cil flags (fix #506) -* Occurrence [2010/08/17] Fix bug #550: crash when selecting an occurrence if the entry point set by "-main" is incorrect. -* Logic [2010/08/16] ACSL identifiers starting with a \ are not replaced by pre-processing when a macro of the same name exists (fix #541) - Value [2010/07/28] Clean local variables passed by address to callees from results of -val. - Inout [2010/07/28] Clean local variables passed by address to callees from results of -input, -out, -deps -! Value [2010/07/28] Abort analysis when recursion is encountered. -! Value [2010/07/23] Structures passed as function arguments now precisely handled. o! Value [2010/07/21] Function Cvalue_type.V.is_top rebaptized is_imprecise o! Value [2010/07/21] There was one too many function called "find_ival". One was renamed to "project_ival". - Value [2010/07/19] Improved precision of analysis for program short s[]= {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1};main(){return((int*)s)[u()];} -* Value [2010/07/14] Fixed bug involving typedefs when using option -val-signed-overflow-alarms. -* Kernel [2010/07/12] Tried to fix all permissions on *.{c,h} files -* Makefile [2010/07/05] Fix bug #528 when building a dynamic plug-in in a sandbox. - Configure [2010/07/05] Better detection of native dynlink support. -* GUI [2010/06/30] Fixed parsing of floats in frama-c-gui.config - Cil [2010/06/30] Be less aggressive during inline function merge. Alpha equivalent function are now kept separate. - GUI [2010/06/29] One tooltip by parameter in the launcher o! Cil [2010/06/23] Removed function varinfo_from_vid. You can use maps or hashtables indexed by varinfos directly instead. o! Kernel [2010/06/21] New implementation of module Properties_status o! Cil [2010/06/15] global_annotation has location information o Cil [2010/06/11] Cil.makeLocalVar now inserts the variable into one of the function's local blocks. -* Value [2010/06/11] Some "Misaligned" imprecision origins were wrongly classified as "Arithmetic". Fixed. -* Logic [2010/06/11] Fix bug #!498 (behaviors within same scope must now have unique names) o* Logic [2010/06/10] Fix bug #505 (Associate default label for predicates with a single label parameter and no argument) o!* Project [2010/06/08] Reimplementation of the project library (the contents of directory src/project). New API. o! Cil [2010/06/04] Preliminary support for function calls in UnspecifiedSequence o Cil [2010/06/04] Support for custom extension in grammar of behaviors. See Logic_typing.register_behavior_extension. -* Value [2010/06/03] Do not emit an alarm for the comparison of function addresses to NULL. -* Cil [2010/06/02] Fixed bug #440 (remove spurious block generation at parsing time that clashed with label scoping rule in ACSL) -* Value [2010/06/01] Fixed correctness bug involving the comparison of a variable of type float or double. - Inout [2010/06/01] Improved precision for option -inout-with-formals * Cil [2010/05/31] Fixed bugs #451 (break outside of loop/switch) and #452 (spurious 'body of f call falls through' warnings) -* Cil [2010/05/31] Extended grammar of pragma lines. o* Cil [2010/05/28] Fix bug #489: constant literal present in original source are preserved in the AST. NB: this implies that they might be explicitly cast when an integer conversion occur. -* Kernel [2010/05/28] Fixed bug in handling of -cpp-command o! Cil [2010/05/21] Remove deprecated annotation_status of AAssert in the AST o! Kernel [2010/05/20] Added field b_extended in behaviors to support grammar extensions -* Logic [2010/05/19] Checking for loop variant position - Kernel [2010/05/19] Feature #484 about requires into named behaviors -* Inout [2010/05/12] Fixed bug in -inout where operational inputs of called library function were improperly inferred from assigns -* Value [2010/05/12] Fixed bug with extern variables of incomplete type -* Logic [2010/05/11] Fixed wrong precedence of <==> - Value [2010/05/11] Improved Frama_C_memcpy built-in. - From [2010/05/11] Improved interpretation of assigns clauses - Inout [2010/05/05] Improve option -inout-with-formals: cleanup local variables that come from out of call tree functions. - GUI [2010/05/07] In expressions 't[v]', allow to select 't' (when it is a variable). To select the entire expression 't[v]', click on the ']' on the right. o Kernel [2010/05/07] Deprecate Globals.Functions.find_englobing_kf. Use Kernel_function.find_englobing_kf which has a much better complexity instead. - Value [2010/05/06] More consistent naming scheme for generating shorter names when using -lib-entry. "star_" becomes "S_". - Value [2010/05/05] Tweak in -slevel* options. A little slower for some programs, much faster for others. - Inout [2010/05/04] New option -inout-with-formals similar to -inout but without locals and with formals - Inout [2010/05/04] Improved precision of -inout with possibly invalid pointers. - Value [2010/05/03] Variables now uninitialized by default. Improves -deps, -input, -output when addresses of local variables are passed as arguments of called functions. o! Logic [2010/04/30] Parameterize search of field in logic typing functor in a similar way to search of other C symbols o!* Kernel [2010/04/30] Fix bug #!441 (keep track of original names in AST) -* Makefile [2010/04/24] Fix bug #461 when installing the GUI on a bytecode-only architecture -* Makefile [2010/04/24] Fix bug #460 when using a non-local ocamlgraph - GUI [2010/04/27] First support for persistent GUI configuration. GtkPaned ratios, main and launcher window dimensions are saved to file frama-c-gui.config in the user's home directory. - Value [2010/04/26] Yet more small improvements in value analysis of large programs. -* GUI [2010/04/26] Fix bug with toolbar button 'duplicate project' - Value [2010/04/26] More optimization of library functions -* Logic [2010/04/23] fix bug #!454 (multiple labels in same statement) - Security_slicing [2010/04/23] Only use the GUI; does not require it anymore o! Kernel [2010/04/22] Ptmap (resp. Ptset) is renamed into Hptmap (Hptset) -! Obfuscator [2010/04/22] Option -obfuscate is now part of a new dynamic plug-in `Obfuscator' (fixed issue #!265). The behaviour of this option is now journalized and may be run by other plug-ins. -* Makefile [2010/04/20] Fixed potential generation of corrupted .o - GUI [2010/04/19] Better graph display. Require ocamlgraph > 1.4 - Value [2010/04/19] Optimization in the handling of library functions -* Slicing [2010/04/16] Fixed bug #!448 about -keep-annotations option -* Configure [2010/04/14] Fixed bug in configuration of external plug-ins + Logic [2010/04/13] #!346 Formals have an \old label when used in post conditions ################################## Open Source Release Boron-20100401 ################################## - Kernel [2010/04/12] Preliminary standard C library in $FRAMAC_SHARE/libc o* Cil [2010/04/12] New hook after Cabs elaboration (fix bug #!446) o! Kernel [2010/04/12] Slight modification of Hook API o* Configure [2010/04/09] Improved dependencies handling (fix #!054) - Value [2010/04/08] Experimental new option -val-signed-overflow-alarms - Value [2010/04/04] Experimental new option -subdivide-float-var - Logic [2010/04/02] Adding "\pi" as built-in symbol -! Configure [2010/03/24] Compiling the GUI now requires LablGnomeCanvas. -* Makefile [2010/03/24] Fix bug for generating .o files through recursive calls to Make in quiet mode (VERBOSEMAKE unset) o! Kernel [2010/03/23] Dynamic.register and Dynamic.get are more robust, but take an extra parameter - Value [2010/03/23] New options -no-results and -no-results-function, improved replacements for undocumented option -klr -+ Kernel [2010/03/23] New saving/loading algorithms. Option -load is faster, and rid of its previous allocation peak -! Logic [2010/03/22] Support for "reads \nothing" -! Logic [2010/03/19] Support for type abbreviation in logic - Value [2010/03/11] Suppressed undocumented option -klr - Value [2010/03/10] New option -slevel-function f:n for fine-tuning semantic unrolling. - Kernel [2010/03/05] New option "-plugin-h" as an alias for option "-plugin-help" - Logic [2010/02/23] If a C typedef integer, real or boolean exists, it takes precedence over corresponding logic type. The logic type remains accessible through its utf-8 denomination. - Value [2010/02/22] Interpreting post-conditions about \result in contracts for functions that have implementations. o! Kernel [2010/02/22] Type changes in Db.Properties.Interp. Use ~result:None to get your plug-in to compile again. o! Kernel [2010/02/22] Kernel_function.Set now implemented with Patricia. o! Value [2010/02/21] Changed type of functions Db.Value.*_to_kernel_function. These functions now return a Kernel_function.Set.t. Use Kernel_function.Set.elements to transform this set into a list. o! Project [2010/02/19] Project.register_todo_on_clear is deprecated and replaced by Project.register_todo_before_clear - Value [2010/02/19] Improved precision when loop index has type char or short. Fixes bug #325 o! Kernel [2010/02/17] Log.protect is replaced by Cmdline.protect -!* Logic [2010/02/17] Arrays and pointers are distinct in the logic, as per ACSL reference. Fixes bug #396 -* Makefile [2010/02/16] Fixed 'make clean' in plug-in directory (bug #!407) o! Kernel [2010/02/15] Major changes in API of module Annotations: add possible dependencies from/to a single annotation of a statement -+ Value [2010/02/14] New options -no-results and -no-results-all, improved replacements for undocumented option -klr -! Value [2010/02/14] Clarified progress messages -* Cil [2010/02/10] Fix crash in parser when double definition of variable in two different files, in some order (fixed bug #213) - Slicing [2010/02/04] Assigns clauses was missing from the sliced program (fixed bug #393) -!* Logic [2010/02/03] Full support for \let (fixed bug #!344) - Kernel [2010/02/03] Backtrace when Frama-C is crashing (only if Frama-C is compiled with caml >= 3.11.0) - Security_slicing [2010/02/01] New experimental and quite undocumented plug-in. Sub-part of the old plug-in security. Only usable through the GUI. -! Security [2010/02/01] No more distributed. -* Cil [2010/02/01] Bug fixed with incompatible declarations of C functions -* Logic [2010/01/29] complete/disjoint behaviors do not accept undefined behaviors anymore (fixed bug #364) -* Logic [2010/01/27] Default label is "Old" inside \old(...) - Value [2010/01/25] New display option -float-relative -* Value [2010/01/25] Fixed uncaught exception that could happen in analysis of programs with floating-point operations. - Value [2010/01/22] Preliminary support of post-conditions for library functions. - Value [2010/01/21] Take into account all known flush-to-zero floating-point variants. No option seems necessary for now. - Value [2010/01/20] Improved precision of floating-point operations +-* Logic [2010/01/18] \let is supported (except \let id = pred; pred) - GUI [2010/01/18] Add a menu entry for setting C source files of the current project -* GUI [2010/01/18] Fixed bug while choosing 'New project' if -cpp-command is set (fixed bug #374) - GUI [2010/01/18] New menu entries for loading ocaml scripts and ocaml object files (fixed issue #!318) -! Inout [2010/01/17] -out and -out-external now obey -inout-verbose option Generated logs re-ordered a little. - GUI [2010/01/15] Plug-in panels can be detached with drag and drop. o! Kernel [2010/01/15] Type.register is more robust but gets a modified interface (fixed issue #!276) -* Kernel [2010/01/15] -load-script did not clean up compiled files after exiting (fixed bug #!371) - Impact [2010/01/15] In the GUI filetree, for each function, a bullet shows if some statements are highlighted - GUI [2010/01/15] Now possible to save/load a single project (fixed issue #!9) o! Kernel [2010/01/14] New implementation of save/load with small changes in the project API. Loading is now rid of its previous allocation peak and faster. - GUI [2010/01/14] View property status in GUI. Fixed a bug on reset with strange reactive zones in default buffer. -* Logic [2010/01/14] More utf-8 identifier accepted (fixes bug #366) -* Value [2010/01/13] Fixed bug #372 - Value [2010/01/08] New option -all-rounding-modes (floating-point) New dependency on C99 functions to control the FPU. o! GUI [2009/12/17] New implementation for the menubar and the toolbar. API fully changed for adding an item in these bars. -! GUI [2009/12/04] Drop gtksourceview 1.x dependency and replace it with gtksourceview 2.x. -* Makefile [2009/12/03] Some GUI library files was not installed o Kernel [2009/11/30] Support for dynamic uses of StringSet parameters -* Kernel [2009/11/30] -kernel-debug and -kernel-verbose did not work as expected (bts #!343). - Configure [2009/11/27] Dynamic plug-ins are now statically linked by default whenever native dynlink is not usable (bts #!301). o! Kernel [2009/11/24] Use of global logic constants is now a TLval (TVar _,TNoOffset) instead of TApp(_,[]) - Value [2009/11/24] Handling of behavior-specific assertions now correct (albeit imprecise). -! Kernel [2009/11/19] The journal is generated only if the GUI is crashing, or if the option -journal-enable is explicitly set (fixed issue #!330). +- Value [2009/11/19] New option -slevel-exclude f for fine-tuning semantic unrolling. - Logic [2009/11/13] ordering of clauses in contracts -* Logic [2009/11/10] Fixed bug #228, #327 (syntax garbage at end of contracts) - GUI [2009/11/09] Now possible to delete the current project. - GUI [2009/11/09] New shortcut buttons. - GUI [2009/11/04] Options *-verbose, *-debug and -quiet are now settable via the launcher dialog box (bts #!317). -* Logic [2009/11/04] Fixed bug #272 (complete behaviors wo name) - Logic [2009/11/03] Better error message when using = in annotations -* Makefile [2009/11/02] Fixed bug #310: improve robustness against new ocaml warnings. - Kernel [2009/11/02] New option -no-dynlink in order to prevent loading of dynamic plug-ins. -* Makefile [2009/10/28] Fixed bug #305: make did not terminate when all plug-ins were disabled. -* Configure [2009/10/28] Fixed bug with -help. - Kernel [2009/10/28] Better -*-help. - Kernel [2009/10/28] Better error messages when a dynamic plug-in cannot be loaded. - Kernel [2009/10/21] Clarification of the multiple accesses warning. Becomes "undefined multiple accesses in expression". -* Value [2009/10/21] Some "loss of precision" messages were duplicated and failed to be localized. Fixed. o Kernel [2009/10/18] Extlib now contains various functions to replace Sys.command but with portability and efficiency in mind. -*! Logic [2009/10/16] Support for abrupt clauses; Modifies AST - Syntactic_callgraph [2009/10/15] Big speedup for showing the callgraph in the GUI. Require ocamlgraph >= 1.4. o! Kernel [2009/10/13] Module Db.Properties.Status replaced by module Properties_status. o! Kernel [2009/10/13] Function Db.Properties.predicate_on_stmt and Db.Properties.get_user_assert does not exist anymore. -* Value [2009/10/12] Synthetic validity status for assertions. -* Syntactic_callgraph [2009/10/12] Fixed bug in services computation. -* GUI [2009/10/09] Instantaneous actions are no longer cancelable but are as fast as possible now. o! GUI [2009/10/09] Methods protect and full_protect of main_window_extension_points now have an additional arguments. o Kernel [2009/10/08] Add unique id for elements in Db.Properties.Status tables. - Kernel [2009/10/08] Add status for all clauses - Cil [2009/10/08] Extend logic pretty printer to handle all specific clauses -! GUI [2009/10/08] Extend type Pretty_source.localizable o! Cil [2009/09/28] pAssigns now prints directly a whole list of assigns - GUI [2009/09/28] Assigns clauses are now localizable in GUI - Value [2009/09/25] Improved treatment of "assigns p[..]" clauses in -input ###################################### Open Source Release Beryllium-20090902 ###################################### -* Obfuscator [2009/09/23] obfuscator does not lose links between logic and C variables anymore (bts #250). Obfuscator now gives a specific name to formal parameters. - Journal [2009/09/23] Better handling of exceptions. -! Value [2009/09/21] Computed values not displayed on -load. Use -val-load to force display of computed values. Use -val -quiet to compute without printing results. o Cil [2009/09/21] New pIdentifiedPredicate method in pretty-printer -* GUI [2009/09/21] Elimination of repeated messages (bts #237). -! Syntactic callgraph [2009/09/18] Improvement of the GUI of syntactic callgraph. Require ocamlgraph > 1.2. - Kernel [2009/09/18] Slightly less false alarms with -warn-unspecified-order o Cil [2009/09/18] Deprecated Cil.get_status. Use Db.Properties.Status.* instead. o* Makefile [2009/09/18] Fixed bugs with the use of PLUGIN_EXTRA_BYTE and PLUGIN_EXTRA_OPT by plug-ins. - Value [2009/09/15] Stopped displaying temporary variables introduced by normalization of source code, and block-local variables. -!* Makefile [2009/09/14] Fixed bug #236. Require ocamlgraph version > 1.2. - Configure [2009/09/13] Detection of dot if required. - Syntactic_callgraph [2009/09/11] Better implementation for computing the service graph: faster + correctly handle cycles. -! Syntactic_callgraph [2009/09/11] -cg-services-only is not relevant anymore. - Makefile [2009/09/09] Now possible to build custom binaries for plug-ins. Roughly these binaries are frama-c[.byte] + the plug-in statically-linked. The goal is called "static" in the plug-in's makefile. -* Value [2009/09/08] Fixed display bug when logging the call stack introduced in Beryllium. - Value [2009/09/08] Improved treatment of "assigns p[..]" clauses in value analysis. Other plug-ins (outputs,...) have not had the same improvement yet. -* Makefile [2009/09/08] Frama-C compiles even if ocamlopt is not available. -* Project [2009/09/08] Fixed bug involving loading and options previously set while saving. -* GUI [2009/09/08] Release the terminal when the splash window is deleted. - Jessie [2009/09/08] Is no longer built within Frama-C. It becomes part of Why. - Makefile [2009/09/08] Why is no longer a compilation dependency. It is required only at runtime for the experimental WP plugin. -* Makefile [2009/09/07] Fixed compilation error occurring on a platform which does not support native dynlink and with ocaml >= 3.11 (bts #224). ###################################### Open Source Release Beryllium-20090901 ###################################### -! Syntactic_callgraph [2009/08/27] New design of the callgraph in the GUI. Frama-C now requires ocamlgraph 1.2. - Logic "reads" clauses on logic functions and predicates, which disappeared with the introduction of axiomatic blocks, have been resurected. Beware that the semantics is slightly different from before: see ACSL document for details. It is used to automatically generate footprint axioms. - GUI [2009/08/18] Improved display of summary information when selecting a file. - Kernel [2009/08/05] New options -kernel-help, -kernel-verbose and -kernel-debug (bts #!205). - Syntactic_callgraph [2009/08/04] New option -cg-services-only to only computes the graph of services - Value [2009/07/29] Improved treatment of conditions involving char or short variables. - GUI [2009/07/28] Possible to stop the GUI while computing analysis o! Project [2009/07/26] Preliminary support for direct unmarshalling. Datatypes must define value descr. Using Unmarshal.Direct is okay for now. -* Makefile [2009/07/24] Fixed bug with static linking of plug-ins using external libraries (bts #200) - Value [2009/07/22] Improved integer division. Now returns best effort results when 0 is among the possible values for the divisor. -* Project [2009/07] Fixed bug causing delays with -load (bts #180) - GUI [2009/07/08] New message panel -* Journal [2009/07/07] Fix generation of invalid variable name in journal -* Semantic Constant Folding [2009/07/07] Fix bad journalisation - GUI [2009/07/03] Redesign the dialog box for running analysis o! Cil [2009/06/24] Added 2 components to Cil_types.typ to optimize bitsSizeOf. The proper way to get a default value is Cil.empty_size_cache. The added value must not be shared by types. No one should need to read this value directly. - GUI [2009/06/24] Graphical customization now uses Gtk rc files. A default file is loaded from FRAMAC_SHARE/frama-c.rc. The end user can provide its custom FRAMAC_SHARE/frama-c-user.rc to override defaults. -* Project [2009/06/24] Fixed bug with save/load in multi-project contexts (bts #!161) -* Kernel [2009/06/24] Restore compatibility with ocaml 3.10.2 -* Configure [2009/06/24] Fixed bug with --disable-gui in configure.in ###################################### Open Source Release Beryllium-20090601 ###################################### o Value [2009/06/23] New constructor Signed_overflow_alarm for type Alarms.t -! Jessie [2009/06/23] Option for launching jessie is now -jessie, not -jessie-analysis -* Jessie [2009/06/23] Fixed contract for strchr() and strrchr() in string.h -* Jessie [2009/06/23] Support for label Post in assigns clauses. Fixes bug #160 -! Jessie [2009/06/18] GUI mode is now the default, options -jessie-gui and -jessie-goals do not exists anymore -* Jessie [2009/06/18] Full support for loop assigns, including those implicitly generated from function's assigns, fixes bug #41 - GUI [2009/06/18] Change the warning to panel to preserve decent performance. This imposes lablgtk 2.12 at least. - Semantic_callgraph [2009/06/15] small change in the computation of services: the roots are now the same as the syntactic callgraph (while there is no function pointer). -! Semantic_callgraph [2009/06/15] new options -scg-dump and -scg-init-func consistent with the options -cg-dump and -cg-init-func of the syntactic callgraph. o Users [2009/06/15] Users are now computed on need while calling !Db.Users.get - Journal [2009/06/15] Journal disabled by default in batch mode -! Kernel [2009/06/10] FRAMAC_DYN_PATH is now called FRAMAC_PLUGIN -* GUI [2009/06/10] Changes having to do with dependencies between computations. Hopefully less problems exist now than before. -* Jessie [2009/06/09] Support for loop assigns, partially fixes bug #41 see tests/jessie/bts0041-bis.c for details o! Kernel [2009/06/09] Db.Main.extend is now of type unit -> unit - Kernel [2009/06/08] By default, Frama-C stops on annotation errors. Option -continue-annotation-error o GUI [2009/06/05] The plug-in GUI is now packed with the core plug-in -* Jessie [2009/06/05] Fix bug #!8, compilation of jessie with Apron -* Configure [2009/06/05] Fixed issues in configure and makefile if lablgtk2 is not enabled. o! Kernel [2009/06/03] Moved lightweight annotation support from Jessie to Kernel. They are now available for all plugins. Support for lightweight global invariants on globals has been dropped. -* Project [2009/06/03] Fixed bug #!113: loading a session containing a project p referring to another project generated a new incorrect project p. o! Project [2009/06/03] Remove functions Project.save and Project.load: cannot ensure their correctness. - Kernel [2009/05/29] New options -no-type and -no-obj - Kernel [2009/05/29] New environment variable FRAMAC_LIB - Kernel [2009/05/29] When loading a module via -load-module, the dynamically registered options are now recognized on the command line. - Kernel [2009/05/29] New option -load-script to dynamically compile and load an ocaml script. -! Journal [2009/05/29] Option -journal-loader-run does not exist anymore. Use -load-module instead. o! Logic [2009/05/29] Tresult has a type attached to it -* Jessie [2009/05/22] fixed bugs #!63 and #71 (labels and \at) - Slicing [2009/05/20] New option "-slicing-keep-annotations" o Pdg [2009/05/20] The functions that return nodes from an annotations now also return a list of the variables declarations nodes. - Kernel [2009/05/18] Each boolean option now has an opposite. - Kernel [2009/05/15] New alias "-h" and "--help" for "-help" (bug #61). o Kernel [2009/05/15] Possibility to define alias for options. - Kernel [2009/05/14] Better message for errors on the command line. - Kernel [2009/05/14] Syntax "-option-name=value" is now valid on the command line. In such a case, [value] may begin by '-', which is forbidden for the usual syntax "-option-name value". -* Value [2009/05/11] Fixed bug with the interpretation of "==>". - Value [2009/05/04] Improved reduction for (ptr-ptr) expressions. - Value [2009/04/28] Trivially redundant alarms are now automatically discharged. - Value [2009/04/28] Improved results for char ones[] = "11111111"; col_ones = 1 + * (int*) ones; o Configure [2009/04/21] Explicitly require >= OCaml 3.10.0 -! Inout [2009/04/17] -input_with_formals is now called -input-with-formals -! Kernel [2009/04/15] New implementation of command line parsing -* Kernel [2009/04/08] Frama-C has now a very early initialisation step. That's fixed minor issues with -journal-disable (bts #!14 and #!16). o! Kernel [2009/04/07] Cil_state is now called Ast and Cil_state.file is now called Ast.get. -* Sparecode [2009/04/07] Selected an annotation attached to a function call made a wrong propagation in the visibility of the call (bts #!3). -* Sparecode [2009/04/07] The generated project lost some useful parameters like the entry point (bts #!10). o Makefile [2009/04/03] Independent Makefile for dynamic plug-ins. - Configure [2009/04/01] Auto-detection of lablgtk2's custom tree model. -* Configure [2009/04/01] Fixed bug with --disable-* options (except when '*' was a plug-in name). - Logic [2009/03/27] Overloaded logic symbols. -* Jessie [2009/03/27] proper message when \lambda is encountered (bts #?7528). - Configure [2009/03/27] better message when a plug-in isn't enable by default. -* Syntactic_callgraph [2009/03/26] Fixed bug when the callgraph is computed twice -* Logic [2009/03/24] Fixed bugs in type unification. -* Value [2009/03/23] Fixed bug that could appear with assignments like t[5] = t[4]; where t[4] is not a singleton. o* Makefile [2009/03/20] Fixed "dist" and "bdist" targets that had been broken on 02/27. -* Value [2009/03/20] Fixed performance bug. - GUI [2009/03/20] Environment variables FRAMAC_MONOSPACEFONT and FRAMAC_GENERALFONT. o! Cil [2009/03/19] C expressions now have a unique ID. See frama-c-commits for details. -* From [2009/03/17] Improved dependencies + bug fixes -* GUI [2009/03/17] Fixed bug with some utf8 strings. -* Value [2009/03/13] Fixed correctness bug that had a tiny chance to manifest itself when analyzing code that dereferences casted pointers. -* Logic [2009/03/11] Fixed predicate typing of \pointer_comparable. -* Logic [2009/03/11] Changed \result_finite_float into \is_finite_float. Alarm generation is still untyped. -* Logic [2009/03/11] Allow \ as first letter of identifier. o Makefile [2009/02/27] New implementation of (un)verbose mode (bts #?442). -* Value [2009/02/24] Miscellaneous fixes and tuning. -* Cil [2009/02/23] Keep track of variables that have block scope (bts #?218) uninitialize them at the exit of corresponding block. - InOut [2009/02/18] Add -out-external option. -* Cil [2009/02/18] Fixed some localization problems with frontc visitor. o! Logic [2009/02/13] Merge terms and tsets in the AST. - Value [2009/02/09] Adjustments in the appearance of some alarms -* Cil [2009/02/03] Fixed parsing of global initializers like "(3>0)?0:1" when Cil.lowerConstants is false. o GUI [2009/01/29] Add function Design.main_window_extension_points#help_message. o! Kernel [2009/01/28] Dynamic plug-ins have to take care about journalisation. o! Kernel [2009/01/26] Type of Db.register changed in order to be able to say that a function call must never be written in the journal. - Journal [2009/01/23] Operations on projects (bts #?436) and code outputs are journalised. o! Kernel [2009/01/23] File.pretty does not take anymore a formatter as argument. The default output is the one specified by option -ocode. - Journal [2009/01/23] Journalisation of functions with labels is now possible (bts #?427). - Journal [2009/01/21] Journalisation of plug-ins slicing, sparecode, impact and security done. - Value [2009/01/20] Minor changes in floating-point handling. -* Journal [2009/01/19] Fixed bug with -disable-journal and type with no pretty-printer. - Configure [2009/01/19] New option -with-all-static in order to statically link all plug-ins, except those explicitly specified as dynamic (bts #?430). -* Journal [2009/01/19] Fixed bug in journalisation of non-functional values. -* Makefile [2009/01/19] Fixed bug whenever all plug-ins should be static. -* Makefile [2009/01/19] Fixed bug in compilation of dynamic plug-ins with a GUI. -* Logic [2009/01/09] Fixed bug in type-checking of polymorphic functions. - Logic [2009/01/09] Support for concrete type definition. - Aorai [2009/01/08] Aorai is now a dynamic plug-in. - Jessie [2009/01/08] Jessie is now a dynamic plug-in (bts #?419). - Configure [2009/01/08] For each dynamic plug-in P, a new option --with-P-static is added to configure.in for linking P statically with Frama-C. o Configure [2009/01/08] No longer require to modify the end of configure.in when you add a new plug-in. o Kernel [2009/01/06] Dynamic plug-ins can now register their own types (abstract from the outside) and operations on such types (bts #?413). o! Kernel [2009/01/05] Some changes in API of module Type (bts #?410). In particular: 1) module FunTbl no longer exist. Replaced by Type.Tbl 2) Merge of pretty printer registration with type registration. No more in module Journal. Only in module Type. -* GUI [2008/12/22] Reentrancy fix with left panels. -* Impact [2008/12/22] In the GUI, fixed bug while the analysis raised an exception. It is now properly caught and displayed on stderr. - Impact [2008/12/22] In the GUI, highlight the selected statement in cyan. -! Impact [2008/12/22] Do not select anymore the selected statements except if they are effectively impacted themselves (bts #?411). -! GUI [2008/12/21] Code annotation and all globals are now reactive to selections (bts #?359 and #?387). -* Jessie [2008/12/20] Support constant sizeof and alignof in logic terms (bts #?396). -* GUI [2008/12/20] Fix a bug with broken UTF-8 output on stdout (bts #?420). - GUI [2008/12/20] Add 2 separate pages for stdout and stderr redirections . - Syntactic_callgraph [2008/12/20] Separate services are now created for callees of the entry point. - Impact [2008/12/19] Slicing after impact is now possible (bts #?301). -* Impact [2008/12/19] Bug fixed in the GUI (on project switching). - Value [2008/12/18] Improved support for state reduction on a memory read. #################################### Open Source Release Lithium-20081201 #################################### -! GUI [2008/12/09] Improved consistency of some information messages. - Value [2008/12/09] Abstract structs are now supported in conjunction with option -lib-entry, and invalid to access. -! Value [2008/12/09] Removed outdated warning about uninitialized const variables. o! Cil [2008/12/09] Modified typeForInsertedCast hook to take as arguments the expression and its original type in addition to the destination type. o* Makefile [2008/12/02] Fixed various bugs in Makefile.template. - Logic [2008/11/24] Added support for (wide) string constants in ACSL formula. -! Kernel [2008/11/21] Changed the definition of non-determinist functions in builtin.c. These functions no longer rely on a volatile variable. Analysis logs may change slightly as a result. - Value [2008/11/21] Introduced preliminary support for state reductions on a memory read access. This should eliminate some redundant alarms. - Sparecode [2008/11/20] New option -rm-unused-globals to remove unused global variables and types. -! Slicing [2008/11/20] Unused global variables and types are now removed in sparecode analysis and slicing results. o Cil [2008/11/17] New methods current_function and current_kf methods (bts #?406). o! Cil [2008/11/17] enum items now have their own type and are shared between declaration and use. o Cil [2008/11/17] New methods for visiting compinfo, enuminfo, fieldinfo and enumitem (prevents potential misuse of copy visitor for these types). -* Jessie [2008/11/14] Fixed bug with multiple labels in axiomatic definitions. - Jessie [2008/11/14] Added example tests/jessie/minimum_sort.c in Jessie tutorial. -* Jessie [2008/11/10] Fixed problem with array in logical annotations. -* Jessie [2008/11/05] Fixed problem with memory model preventing the proof of some pointer programs. The solution is to require pointers that are compared to belong to the same allocated memory block, which can be expressed in logical annotations using equality of \base_addr constructs. - Impact [2008/11/04] In the GUI, new panel to manage impact analysis actions. o Makefile [2008/11/03] Support for native compilation in Makefile.template (require ocaml >= 3.11). #################################### Open Source Release Lithium-20081002 #################################### -! Value [2008/10/23] Changed behavior of option -context-valid-pointers to make it more like the documentation says it is. -* Value [2008/10/23] Fixed a bug introduced with the "value concatenation" feature where an imprecise value obtained by reading misaligned data would have the origin "Arithmetic" instead of "Misaligned". -* Value [2008/10/14] Fixed huge bug in the computation of the dependencies of an expression. Differences are most visible in the results of options -input and -deps, and of course all she slicing options that make use of these. o! Value [2008/10/14] Removed argument ~skip_base_deps from all functions in Db.Value that had one. This argument did not make sense. - Slicing [2008/10/07] In the GUI, slicing request related to values returned by functions is available from the contextual submenu. - Slicing [2008/10/07] In the GUI, new panel to manage slicing actions. - Semantic_callgraph [2008/09/24] New option -scg-dump to dump a semantic callgraph to stdout. - Logic [2008/09/23] Support for address-of operator (&) in tsets. - Logic [2008/09/18] Basic support for sets as first-class value. - Kernel [2008/09/15] Added option -warn-unspecified-order to display a warning for each unspecified sequence containing writes. o Ptests [2008/09/11] Added config option STDOPT (see developer's manual for details). o! Kernel [2008/09/11] Refined UnspecifiedSequence information. -! Value [2008/09/11] Raise alarm for undefined behavior caused by side-effects in UnspecifiedSequence (except for function calls). - Value [2008/09/11] Added option -no-unspecified-access to disable alarm above. - Logic [2008/09/04] Support for \separated. - Inout [2008/09/04] New option -input_with_formals. - Journal [2008/08/28] New options available -load-journal, -journal-name, -journal-disable for user management of journals. - Journal [2008/08/22] Journalization available (only Cmdline and Occurrence are done yet). -* Logic [2008/08/21] Fixed typing error of pointer lval hidden by typdefs. - Deps [2008/08/01] In the GUI, the "Dependencies" contextual menu provides the old "Scope" and "Show Def" features in addition to the new "Zones" feature. These three actions can be launch together with the "All" button. - Slicing [2008/07/22] In the GUI, implemented feature request related to highlighting when the source function is called, for CAT/AF evaluation. - Project [2008/07/21] Projectification of machdep (bts #?101). -* Logic [2008/07/21] Fixed bug "0 can be seen as pointer to any type" (bts #?338). -* Pdg [2008/07/21] Fixed bugs for CAT/AF evaluation. - GUI [2008/07/18] Lower the bound on maximum number of displayed globals to 20 (bts #?342). - Slicing [2008/07/18] In the GUI, request related to read/write accesses to lvalues is available from the contextual submenu. -* Slicing [2008/07/18] In the GUI, fixed bugs related to enabling/disabling conditions of the slicing submenu. - Kernel [2008/07/17] Dynamic linking of plugin available (experimental). o! Cil [2008/07/17] AST changes for unspecified sequences (experimental). -* Jessie [2008/07/16] Fixed path problems with binary distributions. ################################### Open Source Release Helium-20080701 ################################### - Occurrence [2008/07/11] Occurrences of a variable can be computed from any occurrence of the program (not only from its declaration). - Project [2008/07/11] Loading works even if the configuration while saving is not exactly equal to the one while loading. - Pdg [2008/07/09] Improvement of the precision of interprocedural analysis (bts #?179). -* Impact [2008/07/02] Fixed bug when a function is undefined (bts #?322). - Logic [2008/07/02] Typing of recursive logic functions. - Logic [2008/07/02] Enforce correct return type of logic functions. - Sparecode [2008/07/01] New option -sparecode-no-annot (bts #?331 and #?334). -* Pdg [2008/06/26] Fixed bug in interprocedural analysis (bts #?324). - Slicing [2008/06/24] In the GUI, slicing contextual submenu available. -! Logic [2008/06/24] Merge predicates and logic functions when linking multiple c files. o! Logic [2008/06/24] AST changes for invariants. -! GUI [2008/06/23] Enforce lablgtksourceview dependency and suppressed camlp4 need. - GUI [2008/06/23] First rehighlight support. - Slicing [2008/06/19] Some slicing requests are available from the GUI. - Configure [2008/06/19] ./configure will not emit so many warning when gui is not available (bts #?296). - GUI [2008/06/18] Invalidate display cache on project switching. -! Value [2008/06/18] Do not emit imprecision tracing warning when a lval=lval is optimized. - Value [2008/06/18] New option -context-width for auto-allocated context pointer width. Defaults to 2. - Makefile [2008/06/17] Prefix install directories by the value of DESTDIR (patch contributed by Igor Galic). -! Logic [2008/06/17] \valid* predicates rejects void pointers. -! Value [2008/06/16] Removed last top from merging leaf functions returns. - Value [2008/06/13] Some partial builtin_va_start support - Value [2008/06/13] New implicit context generation with a fixed width of 6 (an option will be available later). -! Value [2008/06/12] Remove remaining TOP in value analysis: WELL at amx-valid-depth and for leaf functions. - GUI [2008/06/10] Improve speed of configuration menu. -! Kernel [2008/06/10] Change -lib-entry option into a boolean. "-lib-entry foo" becomes "-lib-entry -main foo" - Metrics [2008/06/10] Number of syntactic calls by functions and potential entry points. - Metrics [2008/06/10] New option -metrics-dump. -! Constfold [2008/06/09] Semantic constant folding does not introduce casts by default. - Constfold [2008/06/09] New option -cast-from-constant has been added to allows cast introductions. -! Kernel [2008/06/06] Do not remove unused static functions. -! Logic [2008/06/05] Quantification over arrays are interpreted as quantification over pointers to be consistent with predicates and C function calls. - Logic [2008/06/05] Pretty printing of pointer accesses in terms and tsets are now much nicer. For example *(T+(0+i..j)) becomes T[0+i..j]. -! Value [2008/06/05] Separate warnings for uninitialized and addresses escaping their scopes (these used to be grouped together as "unspecified" alarms) -* Makefile [2008/06/04] Fixed bug in "make distclean" (bts #?308). -* Logic [2008/06/03] Correct typing for predicates: no more dangerous promotions. - Logic [2008/06/03] Typing of terms: implement ACSL semantics for integral/real promotions. - Logic [2008/06/03] Better error messages for logic typing errors. -! Logic [2008/06/03] Support for constant predicates and functions (breaks 0-argument old syntax). -* Kernel [2008/06/03] Correct promotion rules from bitfields to integers. -* Kernel [2008/06/02] -machdep was ignored (bts #?309). ##################################### Open Source Release Hydrogen-20080502 ##################################### o* Makefile [2008/05/21] Fixed bug in "make clean-doc" (and "make distclean"). - GUI [2008/05/19] All internal options are available in the GUI preferences pannel. ##################################### Open Source Release Hydrogen-20080501 ##################################### -! Value [2008/04/24] Display a warning whenever an uninitialized value causes the death of a branch. - GUI [2008/04/18] Project names are pairwise different in the GUI. -* GUI [2008/04/17] Win32 default fonts fixed. - Value [2008/04/14] In the GUI, function level information displayed in Information panel. - GUI [2008/04/14] Progress added in existing plugins. - GUI [2008/04/10] Buffer memoization for speedup. - GUI [2008/04/10] Persistent position. - GUI [2008/04/10] No file selection on startup. - Scope [2008/04/09] First release of the plug-in (bts #?191). - Impact [2008/04/08] Available from toplevel through -impact-pragma and -impact-print. o Project [2008/04/08] Warnings are project compliant. - GUI [2008/04/07] Large improvements in reactivity -* GUI [2008/04/07] Prefs/Execute bugs fixed. o GUI [2008/04/07] Project management redesigned for older Gtk and for the best. -* Project [2008/04/07] Fixed bug in save/load with duplicated computations. -* Project [2008/04/07] Inconsistent data with multiple projects and while removing projects. -* Kernel [2008/04/01] Various Win32 path fixes. - Kernel [2008/04/01] Option -no-unicode : do not print Unicode chars. ################################ Binary Release Hydrogen-20080302 ################################ - Occurrence [2008/03/17] New option -occurrence. - Occurrence [2008/03/17] First release of the plug-in. -* GUI [2008/03/16] GUI no longer frozen during computations. - GUI [2008/03/16] 'New' menu entry. -* Makefile [2008/03/14] Fixed bug with GUI compilation. -* Project [2008/03/14] Fixed bug with checksum computation during save/load. -* Slicing [2008/02/25] Fixed bug in interprocedural slicing (bts #?201). ########################################### First Open Source Release Hydrogen-20080301 ########################################### - First release ################### # Local Variables: # mode: text # End: ################### frama-c-20.0-Calcium/INSTALL.md0000666000000000000000000003652213571573400012653 0ustar # Installing Frama-C - [Installing Frama-C](#installing-frama-c) - [Table of Contents](#table-of-contents) - [Installing Frama-C via opam](#installing-frama-c-via-opam) - [Installing opam](#installing-opam) - [Installing Frama-C from opam repository](#installing-frama-c-from-opam-repository) - [Installing Custom Versions of Frama-C](#installing-custom-versions-of-frama-c) - [Installing Frama-C on Windows via WSL](#installing-frama-c-on-windows-via-wsl) - [Installing Frama-C on macOS](#installing-frama-c-on-mac-os) - [Installing Frama-C via your Linux distribution (Debian/Ubuntu/Fedora)](#installing-frama-c-via-your-linux-distribution-debianubuntufedora) - [Compiling from source](#compiling-from-source) - [Quick Start](#quick-start) - [Full Compilation Guide](#full-compilation-guide) - [Testing the Installation](#testing-the-installation) - [Available resources](#available-resources) - [Executables: (in `/INSTALL_DIR/bin`)](#executables-in-install_dirbin) - [Shared files: (in `/INSTALL_DIR/share/frama-c` and subdirectories)](#shared-files-in-install_dirshareframa-c-and-subdirectories) - [Documentation files: (in `/INSTALL_DIR/share/frama-c/doc`)](#documentation-files-in-install_dirshareframa-cdoc) - [Object files: (in `/INSTALL_DIR/lib/frama-c`)](#object-files-in-install_dirlibframa-c) - [Plugin files: (in `/INSTALL_DIR/lib/frama-c/plugins`)](#plugin-files-in-install_dirlibframa-cplugins) - [Man files: (in `/INSTALL_DIR/man/man1`)](#man-files-in-install_dirmanman1) - [Installing Additional Frama-C Plugins](#installing-additional-frama-c-plugins) - [HAVE FUN WITH FRAMA-C!](#have-fun-with-frama-c) ## Installing Frama-C via opam [opam](http://opam.ocaml.org/) is the OCaml package manager. Every Frama-C release is made available via an opam package. First you need to install opam, then you may install Frama-C using opam. ### Installing opam Several Linux distributions already include an `opam` package. **Note:** make sure your opam version is >= 2.0.0. macOS has opam through Homebrew. Windows users can install opam via WSL (Windows Subsystem for Linux). If your system does not have an opam package >= 2.0.0 you can compile it from source, or use the provided opam binaries available at: http://opam.ocaml.org/doc/Install.html ### Installing Frama-C from opam repository The Frama-C package in opam is called `frama-c`, which includes both the command-line `frama-c` executable and the graphical interface `frama-c-gui`. `frama-c` has some non-OCaml dependencies, such as Gtk and GMP. In most systems, opam can take care of these external dependencies through its `depext` plug-in: issuing the two commands # install Frama-C's dependencies opam install depext opam depext frama-c will install the appropriate system packages (this of course requires administrator rights on the system). If your system is not supported by `depext`, you will need to install Gtk, GtkSourceView, GnomeCanvas and GMP, including development libraries, separately. If you do so, please consider providing the system name and list of packages (e.g. via a [Github issue](https://github.com/Frama-C/Frama-C-snapshot/issues/new)) so that we can add it to the Frama-C `depext` package. # install Frama-C opam install frama-c ### Configuring provers for Frama-C/WP Frama-C/WP uses the [Why3](http://why3.lri.fr/) platform to run external provers for proving ACSL annotations. The Why3 platform and the Alt-Ergo prover are automatically installed _via_ opam when installing Frama-C. Other recommended, efficient provers are CVC4 and Z3. They can be used as replacement or combined with Alt-Ergo. Actually, you can use any prover supported by Why3 in combination with Frama-C/WP. Most provers are available on all platforms. After their installation, Why3 must be configured to make them available for Frama-C/WP: ```shell why3 config --detect ``` ### Known working configuration The following set of packages is known to be a working configuration for Frama-C 20 (Calcium): - OCaml 4.05.0 - ocamlfind.1.8.0 - apron.20160125 (optional) - lablgtk.2.18.8 | lablgtk3.3.0.beta6 + lablgtk3-sourceview3.3.0.beta6 - mlgmpidl.1.2.11 (optional) - ocamlgraph.1.8.8 - why3.1.2.0 - alt-ergo.2.0.0 (for wp, optional) - yojson.1.7.0 - zarith.1.9.1 ### Installing Custom Versions of Frama-C If you have a **non-standard** version of Frama-C available (with proprietary extensions, custom plugins, etc.), you can use opam to install Frama-C's dependencies and compile your own sources directly: # optional: remove the standard frama-c package if it was installed opam remove --force frama-c # install Frama-C's dependencies opam install depext opam depext frama-c opam install --deps-only frama-c # install custom version of frama-c opam pin add --kind=path frama-c where `` is the root of your unpacked Frama-C archive. See `opam pin` for more details. If your extensions require other libraries than the ones already used by Frama-C, they must of course be installed as well. ### Installing Frama-C on Windows via WSL Frama-C is developed on Linux, but it can be installed on Windows using the following tools: - Windows Subsystem for Linux (Ubuntu 18.04) - VcXsrv (X server for Windows) For enabling WSL on Windows, you may follow these instructions: https://docs.microsoft.com/en-us/windows/wsl/install-win10 As a quick guide, the following instructions should work. First, start PowerShell with administrator rights and run the following command to activate Windows Subsystem for Linux: ``` Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux ``` Then, reboot the operating system. After rebooting, run again the PowerShell terminal with administrator rights. Move to your user directory, download the distribution and install it: ``` cd C:\Users\ Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile Ubuntu.appx -UseBasicParsing Add-AppxPackage .\Ubuntu.appx ``` Ubuntu should now be available in the Windows menu. Run it and follow the instructions to create a user. For installing opam, some packages are required. The following commands can be run to update the system and install those packages: ``` sudo add-apt-repository -y ppa:avsm/ppa sudo apt update sudo apt upgrade sudo apt install make m4 gcc opam ``` Then opam can be set up using these commands: ``` opam init --disable-sandboxing -c 4.05.0 --shell-setup eval $(opam env) opam install -y depext ``` Now, for installing Frama-C, run the following commands that will use `apt` to install the dependencies of the opam packages and then install them: ``` opam depext --install -y lablgtk3 lablgtk3-sourceview3 opam depext --install -y frama-c ``` Microsoft WSL does not support graphical user interfaces directly. If you want to run Frama-C's GUI, you need to install an X server, such as VcXsrv or Cygwin/X. We present below how to install VcXsrv. First, install VcXsrv from: https://sourceforge.net/projects/vcxsrv/ The default installation settings should work. Now run it from the Windows menu (it is named XLaunch). On the first configuration screen, select "Multiple Windows". On the second, keep "Start no client" selected. On the third configuration step, add an additional parameter `-nocursor` in the field "Additional parameters for VcXsrv". You can save this configuration at the last step if you want, before clicking "Finish". Once it is done, the Xserver is ready. From WSL, run: ``` export DISPLAY=:0 frama-c-gui ``` ### Installing Frama-C on macOS [opam](https://opam.ocaml.org) works perfectly on macOS via [Homebrew](https://brew.sh). We highly recommend to rely on it for the installation of Frama-C. 1. Install *required* general macOS tools for OCaml: ```shell brew install autoconf pkg-config opam ``` Do not forget to `opam init` and ``eval `opam config env` `` for a proper opam installation (if not already done before). 2. Set up a compatible OCaml version (replace `` with the version indicated in the 'recommended working configuration' section): ```shell opam switch create ``` 3. Install *required* dependencies for Frama-C: ```shell brew install gmp gtk+ gtksourceview libgnomecanvas ``` The graphical libraries require additional manual configuration of your bash profile. Consult this [issue](https://github.com/ocaml/opam-repository/issues/13709) on opam for details. A known working configuration is: ```shell export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/lib/pkgconfig ``` 4. Install *recommended* dependencies for Frama-C: ```shell brew install graphviz ``` 5. Install Frama-C: ```shell opam install frama-c ``` ## Installing Frama-C via your Linux distribution (Debian/Ubuntu/Fedora) **NOTE**: Distribution packages are updated later than opam packages, so if you want access to the most recent versions of Frama-C, opam is currently the recommended approach. Also note that it is **not** recommended to mix OCaml packages installed by your distribution with packages installed via opam. When using opam, we recommend uninstalling all `ocaml-*` packages from your distribution, and then installing, exclusively via opam, an OCaml compiler and all the OCaml packages you need. This ensures that only those versions will be in the PATH. The advantage of using distribution packages is that dependencies are almost always handled by the distribution's package manager. The disadvantage is that, if you need some optional OCaml package that has not been packaged in your distribution (e.g. `landmarks`, which is distributed via opam), it may be very hard to install it, since mixing opam and non-opam packages often fails (and is **strongly** discouraged). Debian/Ubuntu: `apt-get install frama-c` Fedora: `dnf install frama-c` Arch Linux: `pikaur -S frama-c` ## Compiling from source **Note**: These instructions are no longer required in the vast majority of cases. They are kept here mostly for historical reference. ### Quick Start 1. Install OCaml, OCamlfind, OCamlGraph and Zarith if not already installed. Note that OCaml >= 4.05.0 is needed in order to compile Frama-C. 2. (Optional) For the GUI, also install Gtk, GtkSourceView, GnomeCanvas and Lablgtk2 or Lablgtk3 + Lablgtksourceview3 if not already installed. See section 'REQUIREMENTS' below for indications on the names of the packages to install, or use 'opam depext' as explained in section 'Opam' above. 3. On Linux-like distributions: ./configure && make && sudo make install See section *Configuration* below for options. 4. On Windows+Cygwin: ./configure --prefix="$(cygpath -a -m )" && make && make install 5. The binary `frama-c` (and `frama-c-gui` if you have lablgtk2) is now installed. ### Full Compilation Guide #### Frama-C Requirements - GNU make version >= 3.81 - OCaml >= 4.05.0 - a C compiler with standard C and POSIX headers and libraries - [OCamlGraph][OCamlGraph] >= 1.8.8 - [findlib][findlib] >= 1.6.1 - [Zarith][Zarith] The Frama-C GUI also requires: - Gtk (>= 2.4) - GtkSourceView 2.x or 3.x (compatible with your Gtk version) - GnomeCanvas 2.x (only for Gtk 2.x) - LablGtk >= 2.18.5 or Lablgtk3 >= beta5 + corresponding Lablgtksourceview3 Plugins may have their own requirements. Consult their specific documentations for details. [OCamlGraph]: http://ocamlgraph.lri.fr [findlib]: http://projects.camlcity.org/projects/findlib.html [Zarith]: http://github.com/ocaml/Zarith #### Configuration Frama-C is configured by `./configure [options]`. `configure` is generated by `autoconf`, so that the standard options for setting installation directories are available, in particular `--prefix=/path`. A plugin can be enabled by `--enable-plugin` and disabled by `--disable-plugin`. By default, all distributed plugins are enabled. Those who default to 'no' are not part of the Frama-C distribution (usually because they are too experimental to be released as is). See `./configure --help` for the current list of plugins, and available options. ##### Under Cygwin Use `./configure --prefix="$(cygpath -a -m )"`. (using Unix-style paths without the drive letter will probably not work) #### Compilation Type `make`. Some Makefile targets of interest are: - `doc` generates the API documentation. - `oracles` sets up the Frama-C test suite oracles for your own configuration. - `tests` performs Frama-C's own tests. #### Installation Type `make install` (depending on the installation directory, this may require superuser privileges. The installation directory is chosen through `--prefix`). #### API Documentation For plugin developers, the API documentation of the Frama-C kernel and distributed plugins is available in the file `frama-c-api.tar.gz`, after running `make doc-distrib`. #### Uninstallation Type `make uninstall` to remove Frama-C and all the installed plugins. (Depending on the installation directory, this may require superuser privileges.) # Testing the Installation This step is optional. Download some test files: export PREFIX_URL="https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/master/tests/value/" wget -P test ${PREFIX_URL}/CruiseControl.c wget -P test ${PREFIX_URL}/CruiseControl_const.c wget -P test ${PREFIX_URL}/CruiseControl.h wget -P test ${PREFIX_URL}/CruiseControl_extern.h wget -P test ${PREFIX_URL}/scade_types.h wget -P test ${PREFIX_URL}/config_types.h wget -P test ${PREFIX_URL}/definitions.h Then test your installation by running: frama-c -eva test/CruiseControl*.c # or (if frama-c-gui is available) frama-c-gui -eva test/CruiseControl*.c # Available resources Once Frama-C is installed, the following resources should be installed and available: ## Executables: (in `/INSTALL_DIR/bin`) - `frama-c` - `frama-c-gui` if available - `frama-c-config` displays Frama-C configuration paths - `frama-c.byte` bytecode version of frama-c - `frama-c-gui.byte` bytecode version of frama-c-gui, if available - `ptests.opt` testing tool for Frama-c - `frama-c-script` utilities related to analysis parametrization ## Shared files: (in `/INSTALL_DIR/share/frama-c` and subdirectories) - some `.h` and `.c` files used as preludes by Frama-C - some `Makefiles` used to compile dynamic plugins - some `.rc` files used to configure Frama-C - some image files used by the Frama-C GUI - some files for Frama-C/plug-in development (autocomplete scripts, Emacs settings, scripts for running Eva, ...) ## Documentation files: (in `/INSTALL_DIR/share/frama-c/doc`) - files used to generate dynamic plugin documentation ## Object files: (in `/INSTALL_DIR/lib/frama-c`) - object files used to compile dynamic plugins ## Plugin files: (in `/INSTALL_DIR/lib/frama-c/plugins`) - object files of available dynamic plugins ## Man files: (in `/INSTALL_DIR/man/man1`) - `man` files for `frama-c` (and `frama-c-gui` if available) # Installing Additional Frama-C Plugins Plugins may be released independently of Frama-C. The standard way for installing them should be: ./configure && make && make install Plugins may have their own custom installation procedures. Consult their specific documentation for details. # HAVE FUN WITH FRAMA-C! frama-c-20.0-Calcium/Makefile0000666000000000000000000025246213571573400012666 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # This file is the main makefile of Frama-C. FRAMAC_SRC=. MAKECONFIG_DIR=share PLUGIN_TESTS_LIST:= include share/Makefile.common include share/Makefile.dynamic_config.internal #Check share/Makefile.config available ifndef FRAMAC_ROOT_SRCDIR $(error \ "You should run ./configure first (or autoconf if there is no configure)") endif ################### # Frama-C Version # ################### VERSION:=$(shell $(CAT) VERSION) VERSION_CODENAME:=$(shell $(CAT) VERSION_CODENAME) ########################### # Global plugin variables # ########################### # the directory where compiled plugin non-GUI files are stored PLUGIN_TOP_LIB_DIR= $(PLUGIN_LIB_DIR)/top # the directory where compiled plugin GUI files are stored PLUGIN_GUI_LIB_DIR= $(PLUGIN_LIB_DIR)/gui # the directory where the other Makefiles are FRAMAC_SHARE = share # Shared lists between Makefile.plugin and Makefile : # initialized them as "simply extended variables" (with :=) # for a correct behavior of += (see section 6.6 of GNU Make manual) PLUGIN_LIST := PLUGIN_GENERATED_LIST:= PLUGIN_CMO_LIST := PLUGIN_CMX_LIST := PLUGIN_META_LIST := PLUGIN_DYN_CMI_LIST := PLUGIN_DYN_CMO_LIST := PLUGIN_DYN_CMX_LIST := PLUGIN_INTERNAL_CMO_LIST:= PLUGIN_INTERNAL_CMX_LIST:= PLUGIN_GUI_CMO_LIST:= PLUGIN_GUI_CMX_LIST:= PLUGIN_DYN_DEP_GUI_CMO_LIST:= PLUGIN_DYN_DEP_GUI_CMX_LIST:= PLUGIN_DYN_GUI_CMO_LIST := PLUGIN_DYN_GUI_CMX_LIST := PLUGIN_TYPES_CMO_LIST := PLUGIN_TYPES_CMX_LIST := PLUGIN_DEP_LIST:= PLUGIN_DOC_LIST := PLUGIN_DOC_DIRS := PLUGIN_DISTRIBUTED_LIST:= PLUGIN_DIST_TARGET_LIST:= PLUGIN_DIST_DOC_LIST:= PLUGIN_BIN_DOC_LIST:= PLUGIN_DIST_EXTERNAL_LIST:= PLUGIN_DIST_TESTS_LIST:= PLUGIN_DISTRIBUTED_NAME_LIST:= MERLIN_PACKAGES:= PLUGIN_HEADER_SPEC_LIST := PLUGIN_HEADER_DIRS_LIST := PLUGIN_HEADER_EXCEPTIONS_LIST := PLUGIN_CEA_PROPRIETARY_HEADERS_LIST := PLUGIN_CEA_PROPRIETARY_FILES_LIST := # default value used for HEADER_SPEC and PLUGIN_HEADER_SPEC DEFAULT_HEADER_SPEC := headers/header_spec.txt # default value used for HEADER_DIRS and PLUGIN_HEADER_DIRS DEFAULT_HEADER_DIRS := headers # default value used for HEADER_EXCEPTIONS and PLUGIN_HEADER_EXCEPTIONS DEFAULT_HEADER_EXCEPTIONS := configure # default value used for CEA_PROPRIETARY_FILES and PLUGIN_CEA_PROPRIETARY_FILES DEFAULT_CEA_PROPRIETARY_FILES := tests/non-free/% # default value used for CEA_PROPRIETARY_HEADERS # and PLUGIN_CEA_PROPRIETARY_HEADERS DEFAULT_CEA_PROPRIETARY_HEADERS := CEA_PROPRIETARY MERLIN_PACKAGES:= ############################### # Additional global variables # ############################### # Directories containing some source code SRC_DIRS= ptests $(PLUGIN_LIB_DIR) $(FRAMAC_SRC_DIRS) # Directory containing source code documentation DOC_DIR = doc/code # Source files to document MODULES_TODOC= # Directories to include when compiling INCLUDES=$(addprefix -I ,$(FRAMAC_SRC_DIRS)) -I $(PLUGIN_LIB_DIR) ifneq ($(ENABLE_GUI),no) GUI_INCLUDES = $(addprefix -package ,$(LIBRARY_NAMES_GUI)) else GUI_INCLUDES = endif # Files for which dependencies must be computed. # Other files are added later in this Makefile. FILES_FOR_OCAMLDEP+=$(PLUGIN_LIB_DIR)/*.mli BFLAGS = $(PACKAGES) $(FLAGS) $(DEBUG) $(INCLUDES) \ $(FRAMAC_USER_BFLAGS) OFLAGS = $(PACKAGES) $(FLAGS) $(DEBUG) $(INCLUDES) -compact \ $(FRAMAC_USER_OFLAGS) BLINKFLAGS += -linkpkg $(BFLAGS) -linkall -custom OLINKFLAGS += -linkpkg $(OFLAGS) -linkall DOC_FLAGS= -charset utf8 -colorize-code -stars -m A $(PACKAGES) $(INCLUDES) $(GUI_INCLUDES) ifneq ($(VERBOSEMAKE),yes) DOC_FLAGS+= -hide-warnings endif # Files that depend on external libraries -namely Zarith- whose interface # has not been explicitely declared -opaque, hence would trigger warning 58. # This can't be solved by Frama-C itself, we can only wait for an update of # said library. NON_OPAQUE_DEPS:= # Libraries generated by Frama-C GEN_BYTE_LIBS= GEN_OPT_LIBS= # Libraries used in Frama-C EXTRA_OPT_LIBS:= PACKAGES = $(addprefix -package ,$(LIBRARY_NAMES)) BYTE_LIBS = $(GEN_BYTE_LIBS) OPT_LIBS = $(EXTRA_OPT_LIBS) OPT_LIBS+= $(GEN_OPT_LIBS) ICONS:= $(addprefix share/,\ frama-c.ico frama-c.png unmark.png \ switch-on.png switch-off.png) THEME_ICON_NAMES:= \ never_tried.png \ unknown.png \ surely_valid.png \ surely_invalid.png \ considered_valid.png \ valid_under_hyp.png \ invalid_under_hyp.png \ invalid_but_dead.png \ unknown_but_dead.png \ valid_but_dead.png \ inconsistent.png \ fold.png unfold.png THEME_ICONS_DEFAULT:= \ $(addprefix share/theme/default/,$(THEME_ICON_NAMES)) THEME_ICONS_COLORBLIND:= \ $(addprefix share/theme/colorblind/,$(THEME_ICON_NAMES)) THEME_ICONS_FLAT:= \ $(addprefix share/theme/flat/,$(THEME_ICON_NAMES)) ROOT_LIBC_DIR:= share/libc LIBC_SUBDIRS:= sys netinet net arpa LIBC_DIR:= $(ROOT_LIBC_DIR) $(addprefix $(ROOT_LIBC_DIR)/,$(LIBC_SUBDIRS)) LIBC_FILES:= \ $(wildcard share/*.h share/*.c) \ $(wildcard $(addsuffix /*.h,$(LIBC_DIR))) \ $(wildcard $(addsuffix /*.c,$(LIBC_DIR))) # Checks that all .h can be included multiple times. ALL_LIBC_HEADERS:=$(wildcard share/*.h $(addsuffix /*.h,$(LIBC_DIR))) check-libc: bin/toplevel.$(OCAMLBEST)$(EXE) @echo "checking libc..."; \ EXIT_VALUE=0; \ for file in $(filter-out share/builtin.h,$(ALL_LIBC_HEADERS)); do \ echo "#include \"$$file\"" > check-libc.c; \ echo "#include \"$$file\"" >> check-libc.c; \ FRAMAC_SHARE=share bin/toplevel.$(OCAMLBEST)$(EXE) \ -cpp-extra-args="-Ishare/libc -nostdinc" check-libc.c \ > $$(basename $$file .h).log 2>&1; \ if test $$? -ne 0; then \ if grep -q -e '#error "Frama-C:' $$file; then : ; \ else \ echo "$$file cannot be included twice. \ Output is in $$(basename $$file .h).log"; \ EXIT_VALUE=1; \ fi; \ else \ rm $$(basename $$file .h).log; \ fi; \ done; \ rm check-libc.c; \ exit $$EXIT_VALUE clean-check-libc: $(RM) *.log # Kernel files to be included in the distribution. # Plug-ins should use PLUGIN_DISTRIB_EXTERNAL if they export something else # than *.ml* files in their directory. # NB: configure for the distribution is generated in the distrib directory # itself, rather than copied: otherwise, it could include references to # non-distributed plug-ins. DISTRIB_FILES:=\ $(wildcard bin/migration_scripts/*2*.sh) bin/local_export.sh \ bin/frama-c bin/frama-c.byte bin/frama-c-gui bin/frama-c-gui.byte \ bin/frama-c-config bin/frama-c-script \ share/frama-c.WIN32.rc share/frama-c.Unix.rc \ $(ICONS) $(THEME_ICONS_DEFAULT) $(THEME_ICONS_COLORBLIND) \ $(THEME_ICONS_FLAT) \ man/frama-c.1 doc/README \ doc/code/docgen.ml \ doc/code/*.css doc/code/intro_plugin.txt \ doc/code/intro_plugin_D_and_S.txt \ doc/code/intro_plugin_default.txt \ doc/code/intro_kernel_plugin.txt \ doc/code/toc_head.htm \ doc/code/toc_tail.htm \ doc/Makefile \ $(filter-out ptests/ptests_config.ml,$(wildcard ptests/*.ml*)) \ configure.in Makefile Makefile.generating \ Changelog config.h.in \ VERSION VERSION_CODENAME $(wildcard licenses/*) \ $(LIBC_FILES) \ share/analysis-scripts/benchmark_database.py \ share/analysis-scripts/cmd-dep.sh \ share/analysis-scripts/concat-csv.sh \ share/analysis-scripts/clone.sh \ $(wildcard share/analysis-scripts/examples/*) \ share/analysis-scripts/fc_stubs.c \ share/analysis-scripts/find_fun.py \ share/analysis-scripts/flamegraph.pl \ share/analysis-scripts/frama-c.mk \ share/analysis-scripts/frama_c_results.py \ share/analysis-scripts/git_utils.py \ share/analysis-scripts/list_files.py \ share/analysis-scripts/make_template.py \ share/analysis-scripts/make_wrapper.py \ share/analysis-scripts/parse-coverage.sh \ share/analysis-scripts/README.md \ share/analysis-scripts/results_display.py \ share/analysis-scripts/summary.py \ share/analysis-scripts/template.mk \ $(wildcard share/emacs/*.el) share/autocomplete_frama-c \ share/_frama-c \ share/compliance/c11_functions.json \ share/compliance/glibc_functions.json \ share/compliance/nonstandard_identifiers.json \ share/compliance/posix_identifiers.json \ share/configure.ac \ share/Makefile.config.in share/Makefile.common \ share/Makefile.generic \ share/Makefile.plugin.template share/Makefile.dynamic \ share/Makefile.dynamic_config.external \ share/Makefile.dynamic_config.internal \ share/META.frama-c \ $(filter-out src/kernel_internals/runtime/config.ml, \ $(wildcard src/kernel_internals/runtime/*.ml*)) \ $(wildcard src/kernel_services/abstract_interp/*.ml*) \ $(wildcard src/plugins/gui/*.ml*) \ $(wildcard src/libraries/stdlib/*.ml*) \ $(wildcard src/libraries/utils/*.ml*) \ $(wildcard src/libraries/utils/*.c) \ $(wildcard src/libraries/project/*.ml*) \ $(filter-out src/kernel_internals/parsing/check_logic_parser.ml, \ $(wildcard src/kernel_internals/parsing/*.ml*)) \ $(wildcard src/kernel_internals/typing/*.ml*) \ $(wildcard src/kernel_services/ast_data/*.ml*) \ $(wildcard src/kernel_services/ast_queries/*.ml*) \ $(wildcard src/kernel_services/ast_printing/*.ml*) \ $(wildcard src/kernel_services/cmdline_parameters/*.ml*) \ $(wildcard src/kernel_services/analysis/*.ml*) \ $(wildcard src/kernel_services/ast_transformations/*.ml*) \ $(wildcard src/kernel_services/plugin_entry_points/*.ml*) \ $(wildcard src/kernel_services/visitors/*.ml*) \ $(wildcard src/kernel_services/parsetree/*.ml*) \ $(wildcard src/libraries/datatype/*.ml*) \ bin/sed_get_make_major bin/sed_get_make_minor \ INSTALL.md README.md .make-clean \ .make-clean-stamp .force-reconfigure \ opam/opam opam/descr \ # Test files to be included in the distribution (without header checking). # Plug-ins should use PLUGIN_DISTRIB_TESTS to export their test files. DISTRIB_TESTS=$(shell git ls-files \ tests \ src/plugins/aorai/tests \ src/plugins/report/tests \ src/plugins/wp/tests) # files that are needed to compile API documentation of external plugins DOC_GEN_FILES:=$(addprefix doc/code/,\ *.css intro_plugin.txt intro_kernel_plugin.txt \ intro_plugin_default.txt intro_plugin_D_and_S \ kernel-doc.ocamldoc \ docgen.ml docgen.cm* *.htm) ################ # Main targets # ################ # additional compilation targets for 'make all'. # cannot be delayed after 'make all' EXTRAS = ptests bin/fc-config$(EXE) ifneq ($(ENABLE_GUI),no) ifeq ($(HAS_LABLGTK),yes) EXTRAS += gui endif endif all:: byte $(OCAMLBEST) $(EXTRAS) plugins_ptests_config .PHONY: top opt byte dist bdist rebuild rebuild-branch dist: clean $(QUIET_MAKE) all clean-rebuild: clean $(QUIET_MAKE) all rebuild: config.status $(MAKE) smartclean $(MAKE) depend $(FRAMAC_PARALLEL) $(MAKE) all $(FRAMAC_PARALLEL) || \ (touch .force-reconfigure; \ $(MAKE) config.status && \ $(MAKE) depend $(FRAMAC_PARALLEL) && \ $(MAKE) all $(FRAMAC_PARALLEL)) sinclude .Makefile.user # Should define FRAMAC_PARALLEL, FRAMAC_USER_FLAGS, FRAMAC_USER_MERLIN_FLAGS #Create link in share for local execution if .PHONY:create_share_link create_share_link: share/.gitignore # note: when using opam pin path in a cloned Frama-C git, the symbolic links # become directories, so a different command is necessary for each situation share/.gitignore: share/Makefile.config if test -f $@; then \ for link in $$(cat $@); do \ if test -L share$$link; then \ rm -f share$$link \ else \ rm -rf share$$link; \ fi; \ done; \ fi $(RM) $@.tmp touch $@.tmp $(foreach dir,$(EXTERNAL_PLUGINS),\ if test -d $(dir)/share; then \ echo "Sharing $(dir)/link"; \ ln -s $(realpath $(dir)/share) share/$(notdir $(dir)); \ echo /$(notdir $(dir)) >> $@.tmp; \ fi; ) mv $@.tmp $@ ifeq ("$(DEVELOPMENT)","yes") all:: share/.gitignore endif clean_share_link: if test -f share/.gitignore; then \ for link in $$(cat share/.gitignore); do \ if test -L share$$link; then \ rm -f share$$link \ else \ rm -rf share$$link; \ fi; \ done; \ rm share/.gitignore; \ fi clean:: clean_share_link ############## # Ocamlgraph # ############## # dgraph (included in ocamlgraph) #[LC] Cf https://github.com/backtracking/ocamlgraph/pull/32 ifeq ($(HAS_GNOMECANVAS),yes) ifneq ($(ENABLE_GUI),no) GRAPH_GUICMO= dgraph.cmo GRAPH_GUICMX= dgraph.cmx GRAPH_GUIO= dgraph.o HAS_DGRAPH=yes else # enable_gui is no: disable dgraph HAS_DGRAPH=no endif else # gnome_canvas is not yes: disable dgraph HAS_DGRAPH=no endif ################## # Frama-C Kernel # ################## # Libraries which could be compiled fully independently ####################################################### VERY_FIRST_CMO = src/kernel_internals/runtime/frama_c_init.cmo CMO += $(VERY_FIRST_CMO) LIB_CMO =\ src/libraries/stdlib/transitioning \ src/libraries/stdlib/FCSet \ src/libraries/stdlib/FCMap \ src/libraries/stdlib/FCBuffer \ src/libraries/stdlib/FCHashtbl \ src/libraries/stdlib/extlib \ src/libraries/datatype/unmarshal \ src/libraries/datatype/unmarshal_z \ src/libraries/datatype/structural_descr \ src/libraries/datatype/type \ src/libraries/datatype/descr \ src/libraries/utils/filepath \ src/libraries/utils/sanitizer \ src/libraries/utils/pretty_utils \ src/libraries/utils/hook \ src/libraries/utils/bag \ src/libraries/utils/wto \ src/libraries/utils/vector \ src/libraries/utils/indexer \ src/libraries/utils/rgmap \ src/libraries/utils/bitvector \ src/libraries/utils/qstack \ src/libraries/stdlib/integer \ src/libraries/utils/json \ src/libraries/utils/markdown \ src/libraries/utils/rich_text \ src/libraries/utils/dotgraph NON_OPAQUE_DEPS+=\ src/libraries/datatype/unmarshal_z \ src/libraries/stdlib/integer LIB_CMO:= $(addsuffix .cmo,$(LIB_CMO)) CMO += $(LIB_CMO) # Very first files to be linked (most modules use them) ############################### FIRST_CMO= src/kernel_internals/runtime/config \ src/kernel_internals/runtime/gui_init \ src/kernel_services/plugin_entry_points/log \ src/kernel_services/cmdline_parameters/cmdline \ src/libraries/project/project_skeleton \ src/libraries/datatype/datatype \ src/kernel_services/plugin_entry_points/journal # project_skeleton requires log # datatype requires project_skeleton # rangemap requires datatype FIRST_CMO:= $(addsuffix .cmo,$(FIRST_CMO)) CMO += $(FIRST_CMO) #Project (Project_skeleton must be linked before Journal) PROJECT_CMO= \ state \ state_dependency_graph \ state_topological \ state_selection \ project \ state_builder PROJECT_CMO:= $(patsubst %,src/libraries/project/%.cmo,$(PROJECT_CMO)) CMO += $(PROJECT_CMO) # kernel ######## KERNEL_CMO=\ src/libraries/utils/utf8_logic.cmo \ src/libraries/utils/binary_cache.cmo \ src/libraries/utils/hptmap.cmo \ src/libraries/utils/hptset.cmo \ src/libraries/utils/escape.cmo \ src/kernel_services/ast_queries/cil_datatype.cmo \ src/kernel_services/cmdline_parameters/typed_parameter.cmo \ src/kernel_services/plugin_entry_points/dynamic.cmo \ src/kernel_services/cmdline_parameters/parameter_category.cmo \ src/kernel_services/cmdline_parameters/parameter_customize.cmo \ src/kernel_services/cmdline_parameters/parameter_state.cmo \ src/kernel_services/cmdline_parameters/parameter_builder.cmo \ src/kernel_services/plugin_entry_points/plugin.cmo \ src/kernel_services/plugin_entry_points/kernel.cmo \ src/libraries/utils/unicode.cmo \ src/kernel_services/plugin_entry_points/emitter.cmo \ src/libraries/utils/floating_point.cmo \ src/libraries/utils/rangemap.cmo \ src/kernel_services/ast_printing/cil_types_debug.cmo \ src/kernel_services/ast_printing/printer_builder.cmo \ src/libraries/utils/cilconfig.cmo \ src/kernel_internals/typing/alpha.cmo \ src/kernel_services/ast_queries/cil_state_builder.cmo \ src/kernel_internals/runtime/machdeps.cmo \ src/kernel_services/ast_queries/cil_const.cmo \ src/kernel_services/ast_queries/logic_env.cmo \ src/kernel_services/ast_queries/logic_const.cmo \ src/kernel_services/visitors/visitor_behavior.cmo \ src/kernel_services/ast_queries/cil.cmo \ src/kernel_internals/parsing/errorloc.cmo \ src/kernel_services/ast_printing/cil_printer.cmo \ src/kernel_services/ast_printing/cil_descriptive_printer.cmo \ src/kernel_services/parsetree/cabs.cmo \ src/kernel_services/parsetree/cabshelper.cmo \ src/kernel_services/ast_printing/logic_print.cmo \ src/kernel_services/ast_queries/logic_utils.cmo \ src/kernel_internals/parsing/logic_parser.cmo \ src/kernel_internals/parsing/logic_lexer.cmo \ src/kernel_services/ast_queries/logic_typing.cmo \ src/kernel_services/ast_queries/ast_info.cmo \ src/kernel_services/ast_data/ast.cmo \ src/kernel_services/ast_printing/cprint.cmo \ src/kernel_services/visitors/cabsvisit.cmo \ src/kernel_internals/typing/cabs2cil.cmo \ src/kernel_services/ast_data/globals.cmo \ src/kernel_internals/typing/cfg.cmo \ src/kernel_services/ast_data/kernel_function.cmo \ src/kernel_services/ast_data/property.cmo \ src/kernel_services/ast_data/property_status.cmo \ src/kernel_services/ast_data/annotations.cmo \ src/kernel_services/ast_printing/printer.cmo \ src/kernel_internals/typing/logic_builtin.cmo \ src/kernel_services/ast_printing/cabs_debug.cmo \ src/kernel_internals/parsing/lexerhack.cmo \ src/kernel_internals/parsing/clexer.cmo \ src/kernel_internals/parsing/cparser.cmo \ src/kernel_internals/parsing/logic_preprocess.cmo \ src/kernel_internals/typing/mergecil.cmo \ src/kernel_internals/typing/rmtmps.cmo \ src/kernel_internals/typing/oneret.cmo \ src/kernel_internals/typing/frontc.cmo \ src/kernel_services/analysis/ordered_stmt.cmo \ src/kernel_services/analysis/wto_statement.cmo \ src/kernel_services/analysis/dataflows.cmo \ src/kernel_services/analysis/dataflow2.cmo \ src/kernel_services/analysis/stmts_graph.cmo \ src/kernel_services/analysis/dominators.cmo \ src/kernel_services/analysis/service_graph.cmo \ src/kernel_services/analysis/undefined_sequence.cmo \ src/kernel_services/analysis/interpreted_automata.cmo \ src/kernel_services/ast_data/alarms.cmo \ src/kernel_services/ast_printing/description.cmo \ src/kernel_services/abstract_interp/lattice_messages.cmo \ src/kernel_services/abstract_interp/abstract_interp.cmo \ src/kernel_services/abstract_interp/bottom.cmo \ src/kernel_services/abstract_interp/int_Base.cmo \ src/kernel_services/analysis/bit_utils.cmo \ src/kernel_services/abstract_interp/fc_float.cmo \ src/kernel_services/abstract_interp/float_interval.cmo \ src/kernel_services/abstract_interp/fval.cmo \ src/kernel_services/abstract_interp/ival.cmo \ src/kernel_services/abstract_interp/base.cmo \ src/kernel_services/abstract_interp/origin.cmo \ src/kernel_services/abstract_interp/map_lattice.cmo \ src/kernel_services/abstract_interp/tr_offset.cmo \ src/kernel_services/abstract_interp/offsetmap.cmo \ src/kernel_services/abstract_interp/int_Intervals.cmo \ src/kernel_services/abstract_interp/locations.cmo \ src/kernel_services/abstract_interp/lmap.cmo \ src/kernel_services/abstract_interp/lmap_bitwise.cmo \ src/kernel_services/visitors/visitor.cmo \ src/kernel_services/ast_data/statuses_by_call.cmo \ src/kernel_services/ast_printing/printer_tag.cmo \ $(PLUGIN_TYPES_CMO_LIST) \ src/kernel_services/plugin_entry_points/db.cmo \ src/libraries/utils/command.cmo \ src/libraries/utils/task.cmo \ src/kernel_services/ast_queries/filecheck.cmo \ src/kernel_services/ast_queries/json_compilation_database.cmo \ src/kernel_services/ast_queries/file.cmo \ src/kernel_internals/typing/translate_lightweight.cmo \ src/kernel_internals/typing/allocates.cmo \ src/kernel_internals/typing/unroll_loops.cmo \ src/kernel_internals/typing/asm_contracts.cmo \ src/kernel_services/analysis/loop.cmo \ src/kernel_services/analysis/exn_flow.cmo \ src/kernel_services/analysis/destructors.cmo \ src/kernel_services/analysis/logic_interp.cmo \ src/kernel_internals/typing/infer_annotations.cmo \ src/kernel_services/ast_transformations/clone.cmo \ src/kernel_services/ast_transformations/filter.cmo \ src/kernel_services/ast_transformations/inline.cmo \ src/kernel_internals/runtime/special_hooks.cmo \ src/kernel_internals/runtime/messages.cmo CMO += $(KERNEL_CMO) MLI_ONLY+=\ src/libraries/utils/hptmap_sig.mli \ src/kernel_services/cmdline_parameters/parameter_sig.mli \ src/kernel_services/ast_data/cil_types.mli \ src/kernel_services/parsetree/logic_ptree.mli \ src/kernel_services/ast_printing/printer_api.mli \ src/kernel_services/abstract_interp/float_sig.mli \ src/kernel_services/abstract_interp/float_interval_sig.mli \ src/kernel_services/abstract_interp/lattice_type.mli \ src/kernel_services/abstract_interp/int_Intervals_sig.mli \ src/kernel_services/abstract_interp/offsetmap_lattice_with_isotropy.mli \ src/kernel_services/abstract_interp/offsetmap_sig.mli \ src/kernel_services/abstract_interp/lmap_sig.mli \ src/kernel_services/abstract_interp/offsetmap_bitwise_sig.mli NO_MLI+= src/kernel_services/parsetree/cabs.mli \ src/kernel_internals/runtime/machdep_ppc_32.mli \ src/kernel_internals/runtime/machdep_x86_16.mli \ src/kernel_internals/runtime/machdep_x86_32.mli \ src/kernel_internals/runtime/machdep_x86_64.mli \ src/kernel_services/ast_printing/cabs_debug.mli \ src/kernel_internals/parsing/logic_lexer.mli \ src/kernel_internals/parsing/lexerhack.mli \ MODULES_NODOC+= src/kernel_internals/runtime/machdep_ppc_32.ml \ src/kernel_internals/runtime/machdep_x86_16.ml \ src/kernel_internals/runtime/machdep_x86_32.ml \ src/kernel_internals/runtime/machdep_x86_64.ml \ external/unmarshal_z.mli GENERATED += $(addprefix src/kernel_internals/parsing/,\ clexer.ml cparser.ml cparser.mli \ logic_lexer.ml logic_parser.ml \ logic_parser.mli logic_preprocess.ml) .PHONY: check-logic-parser-wildcard check-logic-parser-wildcard: cd src/kernel_internals/parsing && ocaml check_logic_parser.ml NON_OPAQUE_DEPS+= src/kernel_services/plugin_entry_points/dynamic # C Bindings ############ GEN_C_BINDINGS=src/libraries/utils/c_bindings.o GEN_C_BINDINGS_FLAGS= -fPIC GEN_BYTE_LIBS+= $(GEN_C_BINDINGS) GEN_OPT_LIBS+= $(GEN_C_BINDINGS) src/libraries/utils/c_bindings.o: src/libraries/utils/c_bindings.c $(PRINT_CC) $@ $(CC) $(GEN_C_BINDINGS_FLAGS) -c -I$(call winpath,$(OCAMLLIB)) -O3 -Wall -o $@ $< # Common startup module # All link command should add it as last linked module and depend on it. ######################################################################## STARTUP_CMO=src/kernel_internals/runtime/boot.cmo STARTUP_CMX=$(STARTUP_CMO:.cmo=.cmx) # GUI modules # See below for GUI compilation ############################################################################## WTOOLKIT= \ wutil widget wbox wfile wpane wpalette wtext wtable ifeq ("$(LABLGTK_VERSION)","3") src/plugins/gui/GSourceView.ml: src/plugins/gui/GSourceView3.ml.in $(CP) $< $@ $(CHMOD_RO) $@ src/plugins/gui/GSourceView.mli: src/plugins/gui/GSourceView3.mli.in $(CP) $< $@ $(CHMOD_RO) $@ else src/plugins/gui/GSourceView.ml: src/plugins/gui/GSourceView2.ml.in $(CP) $< $@ $(CHMOD_RO) $@ src/plugins/gui/GSourceView.mli: src/plugins/gui/GSourceView2.mli.in $(CP) $< $@ $(CHMOD_RO) $@ endif SOURCEVIEWCOMPAT:=GSourceView GENERATED+=src/plugins/gui/GSourceView.ml src/plugins/gui/GSourceView.mli \ src/plugins/gui/dgraph_helper.ml src/plugins/gui/gtk_compat.ml ifeq ($(LABLGTK),lablgtk3) src/plugins/gui/gtk_compat.ml: src/plugins/gui/gtk_compat.3.ml $(CP) $< $@ $(CHMOD_RO) $@ else src/plugins/gui/gtk_compat.ml: src/plugins/gui/gtk_compat.2.ml $(CP) $< $@ $(CHMOD_RO) $@ endif GENERATED+=src/plugins/gui/gtk_compat.ml ifeq ($(HAS_DGRAPH),yes) DGRAPHFILES:=debug_manager src/plugins/gui/dgraph_helper.ml: src/plugins/gui/dgraph_helper.yes.ml $(CP) $< $@ $(CHMOD_RO) $@ else DGRAPHFILES:= src/plugins/gui/dgraph_helper.ml: src/plugins/gui/dgraph_helper.no.ml $(CP) $< $@ $(CHMOD_RO) $@ endif SINGLE_GUI_CMO:= \ wutil_once \ gtk_compat \ $(WTOOLKIT) \ $(SOURCEVIEWCOMPAT) \ gui_parameters \ gtk_helper \ dgraph_helper \ gtk_form \ source_viewer pretty_source source_manager book_manager \ warning_manager \ filetree \ launcher \ menu_manager \ history \ gui_printers \ design \ analyses_manager file_manager project_manager \ help_manager \ $(DGRAPHFILES) \ property_navigator \ SINGLE_GUI_CMO:= $(patsubst %,src/plugins/gui/%.cmo,$(SINGLE_GUI_CMO)) ############################################################################### # # #################### # # Plug-in sections # # #################### # # # # For 'internal' developers: # # you can add your own plug-in here, # # but it is better to have your own separated Makefile # ############################################################################### ########### # Metrics # ########### PLUGIN_ENABLE:=$(ENABLE_METRICS) PLUGIN_NAME:=Metrics PLUGIN_DISTRIBUTED:=yes PLUGIN_DIR:=src/plugins/metrics PLUGIN_CMO:= metrics_parameters css_html metrics_base metrics_acsl \ metrics_cabs metrics_cilast metrics_coverage \ register PLUGIN_GUI_CMO:= metrics_gui register_gui PLUGIN_DEPENDENCIES:=Eva PLUGIN_INTERNAL_TEST:=yes $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ############# # Callgraph # ############# PLUGIN_ENABLE:=$(ENABLE_CALLGRAPH) PLUGIN_NAME:=Callgraph PLUGIN_DISTRIBUTED:=yes PLUGIN_DIR:=src/plugins/callgraph PLUGIN_CMO:= options journalize subgraph cg services uses register ifeq ($(HAS_DGRAPH),yes) PLUGIN_GUI_CMO:=cg_viewer else PLUGIN_GUI_CMO:= PLUGIN_DISTRIB_EXTERNAL:=cg_viewer.ml endif PLUGIN_CMI:= callgraph_api PLUGIN_INTERNAL_TEST:=yes PLUGIN_TESTS_DIRS:=callgraph PLUGIN_TESTS_LIB:=tests/callgraph/function_pointer.ml $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ################## # Evolved Value Analysis # ################## PLUGIN_ENABLE:=$(ENABLE_EVA) PLUGIN_NAME:=Eva PLUGIN_DIR:=src/plugins/value PLUGIN_EXTRA_DIRS:=engine values domains domains/cvalue domains/apron \ domains/gauges domains/equality legacy partitioning utils gui_files \ values/numerors domains/numerors PLUGIN_TESTS_DIRS+=value/traces # Files for the binding to Apron domains. Only available if Apron is available. ifeq ($(HAS_APRON),yes) PLUGIN_REQUIRES+= apron.octMPQ apron.boxMPQ apron.polkaMPQ apron.apron gmp APRON_CMO:= domains/apron/apron_domain else APRON_CMO:= PLUGIN_DISTRIB_EXTERNAL+= \ domains/apron/apron_domain.ml domains/apron/apron_domain.mli endif # Files for the numerors domain. Only available is MPFR is available. NUMERORS_FILES:= \ values/numerors/numerors_utils values/numerors/numerors_float \ values/numerors/numerors_interval values/numerors/numerors_arithmetics \ values/numerors/numerors_value domains/numerors/numerors_domain ifeq ($(HAS_MPFR),yes) PLUGIN_REQUIRES+= gmp PLUGIN_TESTS_DIRS+=value/numerors NUMERORS_CMO:= $(NUMERORS_FILES) else # Do not compile numerors files, but include them in the distributed files. NUMERORS_CMO:= PLUGIN_DISTRIB_EXTERNAL+= $(addsuffix .ml,$(NUMERORS_FILES)) PLUGIN_DISTRIB_EXTERNAL+= $(addsuffix .mli,$(NUMERORS_FILES)) endif # General rules for ordering files within PLUGIN_CMO: # - try to keep the legacy Value before Eva PLUGIN_CMO:= partitioning/split_strategy value_parameters \ utils/value_perf utils/value_util utils/red_statuses \ utils/mark_noresults \ utils/widen_hints_ext utils/widen utils/partitioning_annots \ partitioning/split_return \ partitioning/per_stmt_slevel \ utils/library_functions \ utils/eval_typ utils/backward_formals \ alarmset eval utils/structure utils/abstract \ values/value_product values/location_lift \ values/cvalue_forward values/cvalue_backward \ values/main_values values/main_locations \ values/offsm_value values/sign_value \ legacy/eval_op legacy/function_args \ domains/domain_store domains/domain_builder \ domains/domain_product domains/domain_lift domains/unit_domain \ domains/printer_domain \ domains/traces_domain \ domains/simple_memory \ domains/octagons \ domains/gauges/gauges_domain \ domains/hcexprs \ domains/equality/equality domains/equality/equality_domain \ domains/offsm_domain \ domains/symbolic_locs \ domains/sign_domain \ domains/cvalue/warn domains/cvalue/locals_scoping \ domains/cvalue/cvalue_offsetmap \ utils/value_results \ domains/cvalue/builtins domains/cvalue/builtins_malloc \ domains/cvalue/builtins_string domains/cvalue/builtins_misc \ domains/cvalue/builtins_memory domains/cvalue/builtins_print_c \ domains/cvalue/builtins_watchpoint \ domains/cvalue/builtins_float domains/cvalue/builtins_split \ domains/inout_domain \ utils/state_import \ legacy/eval_terms legacy/eval_annots \ domains/powerset engine/transfer_logic \ domains/cvalue/cvalue_transfer domains/cvalue/cvalue_init \ domains/cvalue/cvalue_specification \ domains/cvalue/cvalue_domain \ engine/subdivided_evaluation engine/evaluation engine/abstractions \ engine/recursion engine/transfer_stmt engine/transfer_specification \ partitioning/auto_loop_unroll \ partitioning/partition partitioning/partitioning_parameters \ partitioning/partitioning_index partitioning/trace_partitioning \ engine/mem_exec engine/iterator engine/initialization \ engine/compute_functions engine/analysis register \ $(APRON_CMO) $(NUMERORS_CMO) PLUGIN_CMI:= values/abstract_value values/abstract_location \ domains/abstract_domain domains/simpler_domains PLUGIN_DEPENDENCIES:=Callgraph LoopAnalysis RteGen # These files are used by the GUI, but do not depend on Lablgtk VALUE_GUI_AUX:=gui_files/gui_types gui_files/gui_eval \ gui_files/gui_callstacks_filters PLUGIN_GUI_CMO:=$(VALUE_GUI_AUX) gui_files/gui_callstacks_manager \ gui_files/gui_red gui_files/register_gui PLUGIN_INTERNAL_TEST:= yes PLUGIN_TESTS_LIB=tests/float/fval_test.ml PLUGIN_DISTRIBUTED:=yes VALUE_TYPES:=$(addprefix src/plugins/value_types/,\ cilE cvalue precise_locs value_types widen_type) PLUGIN_TYPES_CMO:=$(VALUE_TYPES) PLUGIN_TYPES_TODOC:=$(addsuffix .mli,$(VALUE_TYPES)) $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ################## # Occurrence # ################## PLUGIN_ENABLE:=$(ENABLE_OCCURRENCE) PLUGIN_NAME:=Occurrence PLUGIN_DISTRIBUTED:=yes PLUGIN_DIR:=src/plugins/occurrence PLUGIN_CMO:= options register PLUGIN_GUI_CMO:=register_gui PLUGIN_INTRO:=doc/code/intro_occurrence.txt PLUGIN_INTERNAL_TEST:=yes PLUGIN_DEPENDENCIES:=Eva $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ################################################ # Runtime Error Annotation Generation analysis # ################################################ PLUGIN_ENABLE:=$(ENABLE_RTEGEN) PLUGIN_NAME:=RteGen PLUGIN_DIR:=src/plugins/rte PLUGIN_CMO:= options generator rte flags visit register PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes PLUGIN_TESTS_DIRS:=rte rte_manual PLUGIN_TESTS_LIB:=\ tests/rte/my_annotation/my_annotation.ml \ tests/rte/rte_api/rte_get_annot.ml \ tests/rte/compute_annot/compute_annot.ml \ tests/rte/my_annot_proxy/my_annot_proxy.ml $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ################# # From analysis # ################# PLUGIN_ENABLE:=$(ENABLE_FROM_ANALYSIS) PLUGIN_NAME:=From PLUGIN_DIR:=src/plugins/from PLUGIN_CMO:= from_parameters from_compute \ functionwise callwise from_register PLUGIN_GUI_CMO:=from_register_gui PLUGIN_TESTS_DIRS:=idct test float PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes FROM_TYPES:=src/plugins/value_types/function_Froms PLUGIN_TYPES_CMO:=$(FROM_TYPES) PLUGIN_TYPES_TODOC:=$(addsuffix .mli,$(FROM_TYPES)) PLUGIN_DEPENDENCIES:=Callgraph Eva Postdominators $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ################## # Users analysis # ################## PLUGIN_ENABLE:=$(ENABLE_USERS) PLUGIN_NAME:=Users PLUGIN_DIR:=src/plugins/users PLUGIN_CMO:= users_register PLUGIN_NO_TEST:=yes PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes PLUGIN_DEPENDENCIES:=Callgraph Eva $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ######################## # Constant propagation # ######################## PLUGIN_ENABLE:=$(ENABLE_CONSTANT_PROPAGATION) PLUGIN_NAME:=Constant_Propagation PLUGIN_DIR:=src/plugins/constant_propagation PLUGIN_TESTS_LIB:=tests/constant_propagation/introduction_of_non_explicit_cast.ml PLUGIN_CMO:= propagationParameters \ api PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes PLUGIN_DEPENDENCIES:=Eva $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ################### # Post-dominators # ################### PLUGIN_ENABLE:=$(ENABLE_POSTDOMINATORS) PLUGIN_NAME:=Postdominators PLUGIN_DIR:=src/plugins/postdominators PLUGIN_CMO:= postdominators_parameters print compute PLUGIN_NO_TEST:=yes PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ######### # inout # ######### PLUGIN_ENABLE:=$(ENABLE_INOUT) PLUGIN_NAME:=Inout PLUGIN_DIR:=src/plugins/inout PLUGIN_CMO:= inout_parameters cumulative_analysis \ operational_inputs outputs inputs derefs register PLUGIN_NO_TEST:=yes PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes INOUT_TYPES:=src/plugins/value_types/inout_type PLUGIN_TYPES_CMO:=$(INOUT_TYPES) PLUGIN_TYPES_TODOC:=$(addsuffix .mli,$(INOUT_TYPES)) PLUGIN_DEPENDENCIES:=Callgraph Eva From $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ################### # Impact analysis # ################### PLUGIN_ENABLE:=$(ENABLE_IMPACT) PLUGIN_NAME:=Impact PLUGIN_DIR:=src/plugins/impact PLUGIN_CMO:= options pdg_aux reason_graph compute_impact register PLUGIN_GUI_CMO:= register_gui PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes PLUGIN_DEPENDENCIES:=Inout Eva Pdg Slicing $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ################################## # PDG : program dependence graph # ################################## PLUGIN_ENABLE:=$(ENABLE_PDG) PLUGIN_NAME:=Pdg PLUGIN_DIR:=src/plugins/pdg PLUGIN_TESTS_LIB:=tests/pdg/dyn_dpds.ml \ tests/pdg/sets.ml PLUGIN_TESTS_DIRS:=pdg PLUGIN_CMO:= pdg_parameters \ ctrlDpds \ pdg_state \ build \ sets \ annot \ marks \ register PDG_TYPES:=pdgIndex pdgTypes pdgMarks PDG_TYPES:=$(addprefix src/plugins/pdg_types/,$(PDG_TYPES)) PLUGIN_TYPES_CMO:=$(PDG_TYPES) PLUGIN_INTRO:=doc/code/intro_pdg.txt PLUGIN_TYPES_TODOC:=$(addsuffix .mli,$(PDG_TYPES)) PLUGIN_DEPENDENCIES:=Callgraph Eva From PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ################################################ # Scope : show different kinds of dependencies # ################################################ PLUGIN_ENABLE:=$(ENABLE_SCOPE) PLUGIN_NAME:=Scope PLUGIN_DIR:=src/plugins/scope PLUGIN_TESTS_LIB:=tests/scope/bts971.ml \ tests/scope/zones.ml PLUGIN_CMO:= datascope zones defs PLUGIN_GUI_CMO:=dpds_gui PLUGIN_DEPENDENCIES:=Eva Inout PLUGIN_INTRO:=doc/code/intro_scope.txt PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ##################################### # Sparecode : unused code detection # ##################################### PLUGIN_ENABLE:=$(ENABLE_SPARECODE) PLUGIN_NAME:=Sparecode PLUGIN_DIR:=src/plugins/sparecode PLUGIN_CMO:= sparecode_params globs spare_marks transform register PLUGIN_INTRO:=doc/code/intro_sparecode.txt PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes PLUGIN_DEPENDENCIES:=Pdg Eva Users $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ########### # Slicing # ########### PLUGIN_ENABLE:=$(ENABLE_SLICING) PLUGIN_NAME:=Slicing PLUGIN_DIR:=src/plugins/slicing PLUGIN_CMO:= slicingInternals \ slicingTypes \ slicingParameters \ slicingState \ slicingMacros \ slicingMarks \ slicingActions \ fct_slice \ printSlice \ slicingProject \ slicingTransform \ slicingSelect \ slicingCmds \ api \ register PLUGIN_GUI_CMO:=register_gui PLUGIN_INTRO:=doc/code/intro_slicing.txt PLUGIN_UNDOC:=register.ml # slicing_gui.ml PLUGIN_TESTS_DIRS:= slicing PLUGIN_TESTS_LIB:= tests/slicing/libSelect.ml tests/slicing/libAnim.ml \ tests/slicing/simple_intra_slice.ml tests/slicing/combine.ml \ tests/slicing/ex_spec_interproc.ml tests/slicing/horwitz.ml \ tests/slicing/mark_all_slices.ml tests/slicing/merge.ml \ tests/slicing/min_call.ml tests/slicing/select_by_annot.ml \ tests/slicing/select_simple.ml tests/slicing/simple_intra_slice.ml \ tests/slicing/slice_no_body.ml tests/slicing/switch.ml \ tests/slicing/adpcm.ml PLUGIN_DISTRIBUTED:=yes PLUGIN_INTERNAL_TEST:=yes PLUGIN_DEPENDENCIES:=Pdg Callgraph Eva Sparecode $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) ##################### # External plug-ins # ##################### define INCLUDE_PLUGIN FRAMAC_SHARE:=$(FRAMAC_ROOT_SRCDIR)/share FRAMAC_PLUGIN:=$(FRAMAC_ROOT_SRCDIR)/lib/plugins FRAMAC_PLUGIN_GUI:=$(FRAMAC_ROOT_SRCDIR)/lib/plugins/gui PLUGIN_DIR:=$(1) include $(1)/Makefile endef $(foreach p,$(EXTERNAL_PLUGINS),$(eval $(call INCLUDE_PLUGIN,$p))) ############################################################################### # # ########################### # # End of plug-in sections # # ########################### # # # ############################################################################### ##################### # Generic variables # ##################### CMX = $(CMO:.cmo=.cmx) CMI = $(CMO:.cmo=.cmi) ALL_CMO = $(CMO) $(PLUGIN_CMO_LIST) $(STARTUP_CMO) ALL_CMX = $(CMX) $(PLUGIN_CMX_LIST) $(STARTUP_CMX) FILES_FOR_OCAMLDEP+= $(addsuffix /*.mli,$(FRAMAC_SRC_DIRS)) \ $(addsuffix /*.ml,$(FRAMAC_SRC_DIRS)) MODULES_TODOC+=$(filter-out $(MODULES_NODOC),\ $(MLI_ONLY) $(NO_MLI:.mli=.ml) \ $(filter-out $(NO_MLI),\ $(filter-out $(PLUGIN_TYPES_CMO_LIST:.cmo=.mli),$(CMO:.cmo=.mli)))) ################################ # toplevel.{byte,opt} binaries # ################################ ALL_BATCH_CMO= $(filter-out src/kernel_internals/runtime/gui_init.cmo,\ $(ALL_CMO)) ALL_BATCH_CMX= $(filter-out src/kernel_internals/runtime/gui_init.cmx,\ $(ALL_CMX)) bin/toplevel.byte$(EXE): $(ALL_BATCH_CMO) $(GEN_BYTE_LIBS) \ $(PLUGIN_DYN_CMO_LIST) $(PRINT_LINKING) $@ $(OCAMLC) $(BLINKFLAGS) -o $@ $(BYTE_LIBS) $(ALL_BATCH_CMO) #Profiling version of toplevel.byte using ocamlprof bin/toplevel.prof$(EXE): $(ALL_BATCH_CMO) $(GEN_BYTE_LIBS) \ $(PLUGIN_DYN_CMO_LIST) $(PRINT_OCAMLCP) $@ $(OCAMLCP) $(BLINKFLAGS) -o $@ $(BYTE_LIBS) $(ALL_BATCH_CMO) bin/toplevel.opt$(EXE): $(ALL_BATCH_CMX) $(GEN_OPT_LIBS) \ $(PLUGIN_DYN_CMX_LIST) $(PRINT_LINKING) $@ $(OCAMLOPT) $(OLINKFLAGS) -o $@ $(OPT_LIBS) $(ALL_BATCH_CMX) LIB_KERNEL_CMO= $(filter-out src/kernel_internals/runtime/gui_init.cmo, $(CMO)) LIB_KERNEL_CMX= $(filter-out src/kernel_internals/runtime/gui_init.cmx, $(CMX)) lib/fc/frama-c.cma: $(LIB_KERNEL_CMO) $(GEN_BYTE_LIBS) lib/fc/META.frama-c $(PRINT_LINKING) $@ $(MKDIR) $(FRAMAC_LIB) $(OCAMLMKLIB) -o lib/fc/frama-c $(BYTE_LIBS) $(LIB_KERNEL_CMO) lib/fc/frama-c.cmxa: lib/fc/frama-c.cma $(GEN_OPT_LIBS) $(LIB_KERNEL_CMX) $(MKDIR) $(FRAMAC_LIB) $(PRINT_LINKING) $@ $(OCAMLMKLIB) -o lib/fc/frama-c $(OPT_LIBS) $(LIB_KERNEL_CMX) #################### # (Ocaml) Toplevel # #################### bin/toplevel.top$(EXE): $(filter-out src/kernel_internals/runtime/boot.ml,$(ALL_BATCH_CMO)) \ src/kernel_internals/runtime/toplevel_config.cmo \ $(GEN_BYTE_LIBS) $(PLUGIN_DYN_CMO_LIST) $(PRINT_OCAMLMKTOP) $@ $(OCAMLMKTOP) $(BFLAGS) -warn-error -31 -custom -o $@ \ -linkpkg $(BYTE_LIBS) $(ALL_BATCH_CMO) \ src/kernel_internals/runtime/toplevel_config.cmo ####### # GUI # ####### ifneq ($(ENABLE_GUI),no) SINGLE_GUI_CMI = $(SINGLE_GUI_CMO:.cmo=.cmi) SINGLE_GUI_CMX = $(SINGLE_GUI_CMO:.cmo=.cmx) GUICMO += $(SINGLE_GUI_CMO) $(PLUGIN_GUI_CMO_LIST) MODULES_TODOC+= $(filter-out src/plugins/gui/book_manager.mli,\ $(SINGLE_GUI_CMO:.cmo=.mli)) GUICMI = $(GUICMO:.cmo=.cmi) GUICMX = $(SINGLE_GUI_CMX) $(PLUGIN_GUI_CMX_LIST) $(GUICMI) $(GUICMO) bin/viewer.byte$(EXE): BFLAGS+= $(GUI_INCLUDES) $(GUICMX) bin/viewer.opt$(EXE): OFLAGS+= $(GUI_INCLUDES) $(PLUGIN_DYN_DEP_GUI_CMO_LIST): BFLAGS+= $(GUI_INCLUDES) $(PLUGIN_DYN_DEP_GUI_CMX_LIST): OFLAGS+= $(GUI_INCLUDES) .PHONY:gui gui-byte:: bin/viewer.byte$(EXE) share/Makefile.dynamic_config \ $(PLUGIN_META_LIST) gui-opt:: gui-byte bin/viewer.opt$(EXE) gui: gui-$(OCAMLBEST) ALL_GUI_CMO= $(ALL_CMO) $(GRAPH_GUICMO) $(GUICMO) ALL_GUI_CMX= $(patsubst %.cma,%.cmxa,$(ALL_GUI_CMO:.cmo=.cmx)) bin/viewer.byte$(EXE): BYTE_LIBS+= $(GRAPH_GUICMO) bin/viewer.byte$(EXE): $(filter-out $(GRAPH_GUICMO),$(ALL_GUI_CMO)) \ $(GEN_BYTE_LIBS) \ $(PLUGIN_DYN_CMO_LIST) $(PLUGIN_DYN_GUI_CMO_LIST) $(PRINT_LINKING) $@ $(OCAMLC) $(BLINKFLAGS) $(THREAD) -o $@ $(BYTE_LIBS) \ $(CMO) \ $(filter-out \ $(patsubst $(PLUGIN_GUI_LIB_DIR)/%,$(PLUGIN_LIB_DIR)/%,\ $(PLUGIN_GUI_CMO_LIST)),\ $(PLUGIN_CMO_LIST)) \ $(GUICMO) $(STARTUP_CMO) bin/viewer.opt$(EXE): OPT_LIBS+= $(GRAPH_GUICMX) bin/viewer.opt$(EXE): $(filter-out $(GRAPH_GUICMX),$(ALL_GUI_CMX)) \ $(GEN_OPT_LIBS) \ $(PLUGIN_DYN_CMX_LIST) $(PLUGIN_DYN_GUI_CMX_LIST) \ $(PLUGIN_CMX_LIST) $(PLUGIN_GUI_CMX_LIST) $(PRINT_LINKING) $@ $(OCAMLOPT) $(OLINKFLAGS) $(THREAD) -o $@ $(OPT_LIBS) \ $(CMX) \ $(filter-out \ $(patsubst $(PLUGIN_GUI_LIB_DIR)/%,$(PLUGIN_LIB_DIR)/%,\ $(PLUGIN_GUI_CMX_LIST)),\ $(PLUGIN_CMX_LIST)) \ $(GUICMX) $(STARTUP_CMX) endif ##################### # Config Ocaml File # ##################### CONFIG_DIR=src/kernel_internals/runtime CONFIG_FILE=$(CONFIG_DIR)/config.ml CONFIG_CMO=$(CONFIG_DIR)/config.cmo GENERATED +=$(CONFIG_FILE) #Generated in Makefile.generating empty:= space:=$(empty) $(empty) ifeq ($(ENABLE_GUI),no) CONFIG_CMO=$(ALL_CMO) CONFIG_PLUGIN_CMO=$(PLUGIN_CMO_LIST) else CONFIG_CMO=$(ALL_GUI_CMO) CONFIG_PLUGIN_CMO=$(PLUGIN_GUI_CMO_LIST) endif ifeq ($(HAS_DOT),yes) OPTDOT=Some \"$(DOT)\" else OPTDOT=None endif COMPILATION_UNITS=\ $(foreach p,$(CONFIG_CMO),\"$(notdir $(patsubst %.cmo,%,$p))\"; ) ################### # Generating part # ################### # It is in another file in order to have a dependency only on Makefile.generating. # It must be before `.depend` definition because it modifies $GENERATED. include Makefile.generating ######### # Tests # ######### ifeq ($(OCAMLBEST),opt) PTESTS_FILES=ptests_config.cmi ptests_config.cmx ptests_config.o else PTESTS_FILES=ptests_config.cmi ptests_config.cmo endif .PHONY: tests oracles btests tests_dist libc_tests plugins_ptests_config external_tests \ update_external_tests tests:: byte opt ptests $(PRINT_EXEC) ptests time -p $(PTESTS) $(PTESTS_OPTS) $(FRAMAC_PARALLEL) \ -make "$(MAKE)" $(PLUGIN_TESTS_LIST) external_tests: byte opt ptests tests:: external_tests update_external_tests: PTESTS_OPTS="-update" update_external_tests: external_tests oracles: byte opt ptests $(PRINT_MAKING) oracles ./bin/ptests.$(OCAMLBEST)$(EXE) -make "$(MAKE)" $(PLUGIN_TESTS_LIST) \ > /dev/null 2>&1 ./bin/ptests.$(OCAMLBEST)$(EXE) -make "$(MAKE)" -update \ $(PLUGIN_TESTS_LIST) btests: byte ./bin/ptests.byte$(EXE) $(PRINT_EXEC) ptests -byte time -p ./bin/ptests.byte$(EXE) -make "$(MAKE)" -byte \ $(PLUGIN_TESTS_LIST) tests_dist: dist ptests $(PRINT_EXEC) ptests time -p ./bin/ptests.$(OCAMLBEST)$(EXE) -make "$(MAKE)" \ $(PLUGIN_TESTS_LIST) # test only one test suite : make suite_tests %_tests: opt ptests $(PRINT_EXEC) ptests ./bin/ptests.$(OCAMLBEST)$(EXE) -make "$(MAKE)" $($*_TESTS_OPTS) $* # full test suite wp_TESTS_OPTS=-j 1 fulltests: tests wp_tests acsl_tests: byte $(PRINT_EXEC) acsl_tests find doc/speclang -name \*.c -exec ./bin/toplevel.byte$(EXE) {} \; > /dev/null LONELY_TESTS_ML_FILES:=\ $(sort $(shell find $(TEST_DIRS_AS_PLUGIN:%=tests/%) -not -path '*/\.*' -name '*.ml')) $(foreach file,$(LONELY_TESTS_ML_FILES),\ $(eval $(file:%.ml=%.cmo): BFLAGS+=-I $(dir $(file)))) $(foreach file,$(LONELY_TESTS_ML_FILES),\ $(eval $(file:%.ml=%.cmx): OFLAGS+=-I $(dir $(file)))) $(foreach file,$(LONELY_TESTS_ML_FILES),\ $(eval $(file:%.ml=%.cmxs): OFLAGS+=-I $(dir $(file)))) .PRECIOUS: $(LONELY_TESTS_ML_FILES:%.ml=%.cmx) \ $(LONELY_TESTS_ML_FILES:%.ml=%.cmxs) \ $(LONELY_TESTS_ML_FILES:%.ml=%.cmo) \ $(LONELY_TESTS_ML_FILES:%.ml=%.cmi) bin/ocamldep_transitive_closure: devel_tools/ocamldep_transitive_closure.ml $(OCAMLOPT) -package ocamlgraph -package str -linkpkg -o $@ $< tests/crowbar/.%.depend: tests/crowbar/%.ml $(OCAMLDEP) $(INCLUDES) $< > $@ tests/crowbar/%: tests/crowbar/%.ml tests/crowbar/.%.depend .depend \ bin/ocamldep_transitive_closure bin/toplevel.opt $(OCAMLOPT) $(OLINKFLAGS) -w -42 -package crowbar -o $@ \ $(GEN_C_BINDINGS) \ $$(bin/ocamldep_transitive_closure -root tests/crowbar/$*.cmx \ -deps tests/crowbar/.$*.depend -deps .depend) \ $< crowbar-%: tests/crowbar/% $< crowbar-afl-%: tests/crowbar/% $(MKDIR) tests/crowbar/output-$* afl-fuzz -i tests/crowbar/input -o tests/crowbar/output-$* $< @@ ############## # Emacs tags # ############## .PHONY: tags # otags gives a better tagging of ocaml files than etags ifdef OTAGS tags: $(OTAGS) -r src lib vtags: $(OTAGS) -vi -r src lib else tags: find . -name "*.ml[ily]" -o -name "*.ml" | sort -r | xargs \ etags "--regex=/[ \t]*let[ \t]+\([^ \t]+\)/\1/" \ "--regex=/[ \t]*let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \ "--regex=/[ \t]*and[ \t]+\([^ \t]+\)/\1/" \ "--regex=/[ \t]*type[ \t]+\([^ \t]+\)/\1/" \ "--regex=/[ \t]*exception[ \t]+\([^ \t]+\)/\1/" \ "--regex=/[ \t]*val[ \t]+\([^ \t]+\)/\1/" \ "--regex=/[ \t]*module[ \t]+\([^ \t]+\)/\1/" endif ################# # Documentation # ################# .PHONY: doc doc-distrib # private targets, useful for recompiling the doc without dependencies # (too long!) .PHONY: doc-kernel doc-index plugins-doc doc-update doc-tgz DOC_DEPEND=$(MODULES_TODOC) byte $(DOC_PLUGIN) ifneq ($(ENABLE_GUI),no) DOC_DEPEND+=bin/viewer.byte$(EXE) endif $(DOC_DIR)/docgen.cmo: $(DOC_DIR)/docgen.ml $(PRINT_OCAMLC) $@ $(OCAMLC) -c -I +ocamldoc -I $(CONFIG_DIR) $(DOC_DIR)/docgen.ml $(DOC_DIR)/docgen.cmxs: $(DOC_DIR)/docgen.ml $(PRINT_PACKING) $@ $(OCAMLOPT) -o $@ -shared -I +ocamldoc -I $(CONFIG_DIR) \ $(DOC_DIR)/docgen.ml clean-doc:: $(PRINT_RM) "documentation generator" $(RM) $(DOC_DIR)/docgen.cm* DOC_NOT_FOR_DISTRIB=yes plugins-doc: $(QUIET_MAKE) \ $(if $(DOC_NOT_FOR_DISTRIB),$(PLUGIN_DOC_LIST),\ $(filter \ $(addsuffix _DOC,$(PLUGIN_DISTRIBUTED_NAME_LIST)),\ $(PLUGIN_DOC_LIST))) .PHONY: server-doc-md server-doc-html server-doc server-doc-md: byte $(PRINT) 'Generating Markdown server documentation' @rm -fr doc/server @mkdir -p doc/server ./bin/frama-c.byte -server-doc doc/server server-doc-html: server-doc-md $(PRINT) 'Generating HTML server documentation' @find doc/server -name "*.md" -print -exec pandoc \ --standalone --toc --toc-depth=2 --to html \ --template doc/pandoc/template.html \ --metadata-file {}.json \ --lua-filter doc/pandoc/href.lua \ {} -o {}.html \; @cp -f doc/pandoc/style.css doc/server/ $(PRINT) 'HTML server documentation ready:' $(PRINT) ' open doc/server/readme.md.html' server-doc: server-doc-html # to make the documentation for one plugin only, # the name of the plugin should begin with a capital letter : # Example for the pdg doc : make Pdg_DOC # While working on the documentation of a plugin, it can also be useful # to use : make -o doc/code/kernel-doc.ocamldoc Plugin_DOC # to avoid redoing the global documentation each time. STDLIB_FILES:=\ array \ buffer \ bytes \ char \ format \ hashtbl \ int64 \ list \ map \ marshal \ obj \ parsing \ printf \ queue \ scanf \ set \ stack \ string \ sys \ weak \ ephemeron ifeq ($(HAS_OCAML407),no) STDLIB_FILES+=pervasives endif STDLIB_FILES:=$(patsubst %,$(OCAMLLIB)/%.mli,$(STDLIB_FILES)) .PHONY: doc-kernel doc-kernel: $(DOC_DIR)/kernel-doc.ocamldoc $(DOC_DIR)/kernel-doc.ocamldoc: $(DOC_DEPEND) $(PRINT_DOC) Kernel Documentation $(MKDIR) $(DOC_DIR)/html $(RM) $(DOC_DIR)/html/*.html $(OCAMLDOC) $(DOC_FLAGS) \ $(addprefix -passopt -stdlib ,$(STDLIB_FILES)) \ -t "Frama-C Kernel" \ -sort -css-style ../style.css \ -g $(DOC_PLUGIN) \ -d $(DOC_DIR)/html -dump $@ \ $(MODULES_TODOC); \ RES=$$?; \ if test $$RES -ne 0; then \ $(RM) $@; \ exit $$RES; \ fi DYN_MLI_DIR := src/plugins/print_api .PHONY: doc-dynamic doc-dynamic: doc-kernel $(RM) $(DYN_MLI_DIR)/dynamic_plugins.mli ./bin/frama-c.byte \ -print_api $(call winpath,$(FRAMAC_ROOT_SRCDIR)/$(DYN_MLI_DIR)) $(PRINT_DOC) Dynamically registered plugins Documentation $(MKDIR) $(DOC_DIR)/dynamic_plugins $(RM) $(DOC_DIR)/dynamic_plugins/*.html $(OCAMLDOC) $(DOC_FLAGS) -I $(FRAMAC_LIB) -I $(OCAMLLIB) \ -passopt -docpath $(DOC_DIR)/html \ -sort -css-style ../style.css \ -load $(DOC_DIR)/kernel-doc.ocamldoc \ -t " Dynamically registered plugins" \ -g $(DOC_PLUGIN) \ -d $(DOC_DIR)/dynamic_plugins \ $(DYN_MLI_DIR)/dynamic_plugins.mli $(ECHO) '
  • Dynamically registered plugins' > $(DOC_DIR)/dynamic_plugins.toc doc-index: doc-kernel doc-dynamic plugins-doc $(PRINT_MAKING) doc/code/index.html $(CAT) $(DOC_DIR)/toc_head.htm $(DOC_DIR)/*.toc \ $(DOC_DIR)/toc_tail.htm > $(DOC_DIR)/index.html doc-update: doc-kernel doc-dynamic plugins-doc doc-index doc:: doc-kernel doc-dynamic plugins-doc doc-index doc-kernel doc-dynamic plugins-doc doc-index: $(DOC_DEPEND) doc-tgz: $(PRINT_MAKING) frama-c-api.tar.gz cd $(DOC_DIR); \ $(TAR) zcf tmp.tgz index.html *.txt \ $(notdir $(wildcard $(DOC_DIR)/*.css $(DOC_DIR)/*.png \ $(DOC_DIR)/dynamic_plugins*)) \ html \ $(foreach p,$(PLUGIN_DISTRIBUTED_NAME_LIST),\ $(notdir $($(p)_DOC_DIR))) $(MKDIR) frama-c-api $(RM) -r frama-c-api/* cd frama-c-api; $(TAR) zxf ../$(DOC_DIR)/tmp.tgz $(TAR) zcf frama-c-api.tar.gz frama-c-api $(RM) -r frama-c-api $(DOC_DIR)/tmp.tgz doc-distrib: $(QUIET_MAKE) clean-doc $(QUIET_MAKE) doc DOC_NOT_FOR_DISTRIB= $(QUIET_MAKE) doc-tgz #find src -name "*.ml[i]" -o -name "*.ml" -maxdepth 3 | sort -r | xargs dots: $(ALL_CMO) $(PRINT_DOC) callgraph $(OCAMLDOC) $(DOC_FLAGS) $(INCLUDES) -o doc/call_graph.dot \ -dot -dot-include-all -dot-reduce $(MODULES_TODOC) $(QUIET_MAKE) doc/call_graph.svg $(QUIET_MAKE) doc/call_graph.ps # pandoc is required to regenerate the manpage man/frama-c.1: man/frama-c.1.header man/frama-c.1.md $(PRINT) 'generating $@' $(RM) $@ pandoc -s -t man -H $^ | tail -n +5 > man/frama-c.1 $(CHMOD_RO) $@ # Checking consistency with the current implementation ###################################################### DOC_DEV_DIR = doc/developer CHECK_API_DIR=$(DOC_DEV_DIR)/check_api $(CHECK_API_DIR)/check_code.cmo: $(CHECK_API_DIR)/check_code.ml $(PRINT_OCAMLC) $@ $(OCAMLC) -c -I +ocamldoc str.cma $(CHECK_API_DIR)/check_code.ml $(CHECK_API_DIR)/check_code.cmxs: $(CHECK_API_DIR)/check_code.ml $(PRINT_PACKING) $@ $(OCAMLOPT) -o $@ -shared -I +ocamldoc \ str.cmxa $(CHECK_API_DIR)/check_code.ml CHECK_CODE=$(CHECK_API_DIR)/check_code.cmxs .PHONY: check-devguide check-devguide: $(CHECK_CODE) $(DOC_DEPEND) $(DOC_DIR)/kernel-doc.ocamldoc $(PRINT) 'Checking developer guide consistency' $(MKDIR) $(CHECK_API_DIR)/html $(OCAMLDOC) $(DOC_FLAGS) -I $(OCAMLLIB) \ -g $(CHECK_CODE) \ -passopt -docdevpath -passopt "`pwd`/$(CHECK_API_DIR)" \ -load $(DOC_DIR)/kernel-doc.ocamldoc \ -d $(CHECK_API_DIR)/html $(RM) -r $(CHECK_API_DIR)/html $(MAKE) --silent -C $(CHECK_API_DIR) main.idx $(MAKE) --silent -C $(CHECK_API_DIR) >$(CHECK_API_DIR)/summary.txt $(ECHO) see all the information displayed here \ in $(CHECK_API_DIR)/summary.txt $(RM) code_file ################################ # Code prettyfication and lint # ################################ # We're interested by any .ml[i]? file in src, except for scripts in test # directories, and generated files (in particular lexers and parsers) # Note: the find command below is *very* ugly, but it should be POSIX-compliant. ALL_ML_FILES:=$(shell find src -name '*.ml' -print -o -name '*.mli' -print -o -path '*/tests' -prune '!' -name '*') MANUAL_ML_FILES:=$(filter-out $(GENERATED) $(PLUGIN_GENERATED_LIST), $(ALL_ML_FILES)) # Allow control of files to be linted/fixed by external sources # (e.g. pre-commit hook that will concentrate on files which have changed) sinclude .Makefile.lint HAS_GIT_FILE:=$(wildcard .git/HEAD) ifeq ("$(HAS_GIT_FILE)","") LINT_OTHER_SOURCES:= else LINT_OTHER_SOURCES:=\ $(filter-out \ $(shell git ls-tree --name-only HEAD src/plugins/*), \ $(wildcard src/plugins/*)) endif $(foreach dir,$(LINT_OTHER_SOURCES),$(eval sinclude $(dir)/.Makefile.lint)) ML_LINT_MISSING:=$(filter-out $(MANUAL_ML_FILES), $(ML_LINT_KO)) # By default, also checks files with unknown status: # this requires new files to pass lint checker from the beginning ML_LINT_CHECK?=$(filter-out $(ML_LINT_KO), $(MANUAL_ML_FILES)) # this NEWLINE variable containing a literal newline character is used to avoid # the error "argument list too long", in some instances of "foreach". # For details, see https://stackoverflow.com/questions/7039811 define NEWLINE endef # pre-requisite intentionally left blank: this target should only be used # if the file is not present to generate it once and forall, # and be edited manually afterwards # double colon here tells make not to attempt updating the .Makefile.lint # if it does not exist, but just to ignore it. .Makefile.lint:: echo "ML_LINT_KO:=" >> $@ $(foreach file,$(sort $(MANUAL_ML_FILES)), \ if ! $(MAKE) ML_LINT_CHECK=$(file) lint; \ then echo "ML_LINT_KO+=$(file)" >> $@; fi;$(NEWLINE) ) $(foreach dir,$(LINT_OTHER_SOURCES),\ $(eval $(dir)/.Makefile.lint:: ; \ $(foreach file, $(sort $(filter $(dir)/%, $(MANUAL_ML_FILES))), \ if ! $$(MAKE) ML_LINT_CHECK=$(file) lint; \ then echo "ML_LINT_KO+=$(file)" >> $$@; fi; ))) .PHONY: stats-lint stats-lint: echo \ "scale = 2; bad = $(words $(ML_LINT_MISSING)); \ all = $(words $(sort $(MANUAL_ML_FILES))); \ fail = $(words $(ML_LINT_KO)); \ \"lint coverage: \"; \ ((all - fail) * 100) / all; " | bc echo "number of files supposed to pass lint: $(words $(ML_LINT_CHECK))" echo "number of files supposed to fail lint: $(words $(ML_LINT_KO))" ifneq ($(strip $(ML_LINT_MISSING)),) echo "number of files missing from src/ : $(words $(ML_LINT_MISSING))" $(foreach file, $(ML_LINT_MISSING), echo $(file);) exit 1 endif INDENT_TARGET= $(patsubst %,%.indent,$(ML_LINT_CHECK)) LINT_TARGET= $(patsubst %,%.lint,$(ML_LINT_CHECK)) FIX_SYNTAX_TARGET=$(patsubst %,%.fix-syntax,$(ML_LINT_CHECK)) .PHONY: $(INDENT_TARGET) $(LINT_TARGET) $(FIX_SYNTAX_TARGET) \ indent lint fix-syntax indent: $(INDENT_TARGET) lint: $(LINT_TARGET) check-ocp-indent-version: if command -v ocp-indent >/dev/null; then \ $(eval ocp_version_major := $(shell ocp-indent --version | $(SED) -E "s/^([0-9]+)\.[0-9]+\..*/\1/")) \ $(eval ocp_version_minor := $(shell ocp-indent --version | $(SED) -E "s/^[0-9]+\.([0-9]+)\..*/\1/")) \ if [ "$(ocp_version_major)" -lt 1 -o "$(ocp_version_minor)" -lt 7 ]; then \ echo "error: ocp-indent >=1.7.0 required for linting (got $(ocp_version_major).$(ocp_version_minor))"; \ exit 1; \ fi; \ else \ exit 1; \ fi; fix-syntax: $(FIX_SYNTAX_TARGET) $(INDENT_TARGET): %.indent: % check-ocp-indent-version ocp-indent -i $< $(LINT_TARGET): %.lint: % check-ocp-indent-version # See SO 1825552 on mixing grep and \t (and cry) # For OK_NL, we have three cases: # - for empty files, the computation boils down to 0 - 0 == 0 # - for non-empty files with a proper \n at the end, to 1 - 1 == 0 # - for empty files without \n, to 1 - 0 == 1 that will be catched OK_TAB=$$(grep -c -e "$$(printf '^ *\t')" $<) ; \ OK_SPACE=$$(grep -c -e '[[:blank:]]$$' $<) ; \ OK_NL=$$(($$(tail -c -1 $< | wc -c) - $$(tail -n -1 $< | wc -l))) ; \ OK_EMPTY=$$(tail -n -1 $< | grep -c -e '^[[:blank:]]*$$') ; \ ERROR=$$(($$OK_TAB + $$OK_SPACE + $$OK_NL + $$OK_EMPTY)) ; \ if test $$ERROR -gt 0; then \ echo "File $< does not pass syntactic checks:"; \ echo "$$OK_TAB lines indented with tabulation instead of spaces"; \ echo "$$OK_SPACE lines with spaces at end of line"; \ test $$OK_NL -eq 0 || echo "No newline at end of file"; \ test $$OK_EMPTY -eq 0 || echo "Empty line(s) at end of file"; \ echo "Please run make ML_LINT_CHECK=$< fix-syntax"; \ exit 1 ; \ fi ocp-indent $< > $<.tmp; if cmp -s $< $<.tmp; \ then rm -f $<.tmp; \ else \ echo "File $< is not indented correctly."; \ echo "Please run make ML_LINT_CHECK=$< indent";\ rm $<.tmp; \ exit 1; \ fi $(FIX_SYNTAX_TARGET): %.fix-syntax: % $(ISED) -e 's/^ *\t\+/ /' $< $(ISED) -e 's/\(.*[^[:blank:]]\)[[:blank:]]\+$$/\1/' $< $(ISED) -e 's/^[ \t]\+$$//' $< if test \( $$(tail -n -1 $< | wc -l) -eq 0 \) -a \( $$(wc -c $< | cut -d " " -f 1) -gt 0 \) ; then \ echo "" >> $<; \ else \ while tail -n -1 $< | grep -l -e '^[ \t]*$$'; do \ head -n -1 $< > $<.tmp; \ mv $<.tmp $<; \ done; \ fi # Avoid a UTF-8 locale at all cost: in such setting, sed does not work # reliably if you happen to have latin-1 encoding somewhere, # which is still unfortunately the case in some dark corners of the platform %.fix-syntax: LC_ALL = C ################ # Installation # ################ # line below does not work if INCLUDES contains twice the same directory # Do not attempt to copy gui interfaces if gui is disabled #Byte ALL_BATCH_CMO_FIXED=$(filter-out src/kernel_internals/runtime/gui_init.cmo,$(CMO) $(STARTUP_CMO)) LIB_BYTE_TO_INSTALL=\ $(MLI_ONLY:.mli=.cmi) \ $(ALL_BATCH_CMO_FIXED:.cmo=.cmi) \ $(ALL_BATCH_CMO_FIXED) \ $(filter-out %.o,$(GEN_BYTE_LIBS:.cmo=.cmi)) \ $(GEN_BYTE_LIBS) #Byte GUI ifneq ("$(ENABLE_GUI)","no") LIB_BYTE_TO_INSTALL+=$(SINGLE_GUI_CMI) $(SINGLE_GUI_CMO) endif #Opt ifeq ("$(OCAMLBEST)","opt") ALL_BATCH_CMX_FIXED= $(filter-out src/kernel_internals/runtime/gui_init.cmx,\ $(CMX) $(STARTUP_CMX)) LIB_OPT_TO_INSTALL +=\ $(ALL_BATCH_CMX) \ $(filter %.a,$(ALL_BATCH_CMX_FIXED:.cmxa=.a)) \ $(filter %.o,$(ALL_BATCH_CMX_FIXED:.cmx=.o)) \ $(filter-out %.o,$(GEN_OPT_LIBS)) \ $(filter-out $(GEN_BYTE_LIBS),$(filter %.o,$(GEN_OPT_LIBS:.cmx=.o))) #Opt GUI ifneq ("$(ENABLE_GUI)","no") LIB_OPT_TO_INSTALL += $(SINGLE_GUI_CMX) $(SINGLE_GUI_CMX:.cmx=.o) endif endif clean-install: $(PRINT_RM) "Installation directory" $(RM) -r $(FRAMAC_LIBDIR) install-lib-byte: clean-install $(PRINT_INSTALL) kernel API $(MKDIR) $(FRAMAC_LIBDIR) $(CP) $(LIB_BYTE_TO_INSTALL) $(FRAMAC_LIBDIR) $(CP) $(addprefix lib/fc/,dllframa-c.so libframa-c.a frama-c.cma META.frama-c) $(FRAMAC_LIBDIR) install-lib-opt: install-lib-byte $(CP) $(LIB_OPT_TO_INSTALL) $(FRAMAC_LIBDIR) $(CP) $(addprefix lib/fc/,frama-c.a frama-c.cmxa) $(FRAMAC_LIBDIR) install-doc-code: $(PRINT_INSTALL) API documentation $(MKDIR) $(FRAMAC_DATADIR)/doc/code (cd doc ; tar cf - --exclude='.svn' --exclude='*.toc' \ --exclude='*.htm' --exclude='*.txt' \ --exclude='*.ml' \ code \ | (cd $(FRAMAC_DATADIR)/doc ; tar xf -)) .PHONY: install install:: install-lib-$(OCAMLBEST) $(PRINT_MAKING) destination directories $(MKDIR) $(BINDIR) $(MKDIR) $(MANDIR)/man1 $(MKDIR) $(FRAMAC_PLUGINDIR)/top $(MKDIR) $(FRAMAC_PLUGINDIR)/gui $(MKDIR) $(FRAMAC_DATADIR)/theme/default $(MKDIR) $(FRAMAC_DATADIR)/theme/colorblind $(MKDIR) $(FRAMAC_DATADIR)/theme/flat $(MKDIR) $(FRAMAC_DATADIR)/libc/sys $(MKDIR) $(FRAMAC_DATADIR)/libc/netinet $(MKDIR) $(FRAMAC_DATADIR)/libc/net $(MKDIR) $(FRAMAC_DATADIR)/libc/arpa $(PRINT_INSTALL) shared files $(CP) \ $(wildcard share/*.c share/*.h) \ share/Makefile.dynamic share/Makefile.plugin.template \ share/Makefile.config share/Makefile.common share/Makefile.generic \ share/configure.ac share/autocomplete_frama-c share/_frama-c \ $(FRAMAC_DATADIR) $(MKDIR) $(FRAMAC_DATADIR)/analysis-scripts $(CP) share/analysis-scripts/benchmark_database.py \ share/analysis-scripts/cmd-dep.sh \ share/analysis-scripts/concat-csv.sh \ share/analysis-scripts/clone.sh \ share/analysis-scripts/fc_stubs.c \ share/analysis-scripts/find_fun.py \ share/analysis-scripts/flamegraph.pl \ share/analysis-scripts/frama-c.mk \ share/analysis-scripts/frama_c_results.py \ share/analysis-scripts/git_utils.py \ share/analysis-scripts/list_files.py \ share/analysis-scripts/make_template.py \ share/analysis-scripts/make_wrapper.py \ share/analysis-scripts/parse-coverage.sh \ share/analysis-scripts/README.md \ share/analysis-scripts/results_display.py \ share/analysis-scripts/summary.py \ share/analysis-scripts/template.mk \ $(FRAMAC_DATADIR)/analysis-scripts $(MKDIR) $(FRAMAC_DATADIR)/analysis-scripts/examples $(CP) share/analysis-scripts/examples/* \ $(FRAMAC_DATADIR)/analysis-scripts/examples $(MKDIR) $(FRAMAC_DATADIR)/compliance $(CP) share/compliance/c11_functions.json \ share/compliance/glibc_functions.json \ share/compliance/nonstandard_identifiers.json \ share/compliance/posix_identifiers.json \ $(FRAMAC_DATADIR)/compliance $(MKDIR) $(FRAMAC_DATADIR)/emacs $(CP) $(wildcard share/emacs/*.el) $(FRAMAC_DATADIR)/emacs $(CP) share/frama-c.rc $(ICONS) $(FRAMAC_DATADIR) $(CP) $(THEME_ICONS_DEFAULT) $(FRAMAC_DATADIR)/theme/default $(CP) $(THEME_ICONS_COLORBLIND) $(FRAMAC_DATADIR)/theme/colorblind $(CP) $(THEME_ICONS_FLAT) $(FRAMAC_DATADIR)/theme/flat if [ -d $(EMACS_DATADIR) ]; then \ $(CP) $(wildcard share/emacs/*.el) $(EMACS_DATADIR); \ fi $(CP) share/Makefile.dynamic_config.external \ $(FRAMAC_DATADIR)/Makefile.dynamic_config $(PRINT_INSTALL) C standard library $(CP) $(wildcard share/libc/*.c share/libc/*.i share/libc/*.h) \ $(FRAMAC_DATADIR)/libc $(CP) share/libc/sys/*.[ch] $(FRAMAC_DATADIR)/libc/sys $(CP) share/libc/arpa/*.[ch] $(FRAMAC_DATADIR)/libc/arpa $(CP) share/libc/net/*.[ch] $(FRAMAC_DATADIR)/libc/net $(CP) share/libc/netinet/*.[ch] $(FRAMAC_DATADIR)/libc/netinet $(PRINT_INSTALL) binaries $(CP) bin/toplevel.$(OCAMLBEST) $(BINDIR)/frama-c$(EXE) $(CP) bin/toplevel.byte$(EXE) $(BINDIR)/frama-c.byte$(EXE) if [ -x bin/toplevel.top ] ; then \ $(CP) bin/toplevel.top $(BINDIR)/frama-c.toplevel$(EXE); \ fi if [ -x bin/viewer.$(OCAMLBEST) ] ; then \ $(CP) bin/viewer.$(OCAMLBEST) $(BINDIR)/frama-c-gui$(EXE);\ fi if [ -x bin/viewer.byte$(EXE) ] ; then \ $(CP) bin/viewer.byte$(EXE) $(BINDIR)/frama-c-gui.byte$(EXE); \ fi $(CP) bin/ptests.$(OCAMLBEST)$(EXE) \ $(BINDIR)/ptests.$(OCAMLBEST)$(EXE) if [ -x bin/fc-config$(EXE) ] ; then \ $(CP) bin/fc-config$(EXE) $(BINDIR)/frama-c-config$(EXE); \ fi if [ -x bin/frama-c-script ] ; then \ $(CP) bin/frama-c-script $(BINDIR)/frama-c-script; \ fi $(PRINT_INSTALL) config files $(CP) $(addprefix ptests/,$(PTESTS_FILES)) $(FRAMAC_LIBDIR) $(PRINT_INSTALL) API documentation $(MKDIR) $(FRAMAC_DATADIR)/doc/code $(CP) $(wildcard $(DOC_GEN_FILES)) $(FRAMAC_DATADIR)/doc/code $(PRINT_INSTALL) plug-ins if [ -d "$(FRAMAC_PLUGIN)" ]; then \ $(CP) $(PLUGIN_DYN_CMI_LIST) $(PLUGIN_META_LIST) \ $(FRAMAC_PLUGINDIR); \ $(CP) $(PLUGIN_DYN_CMO_LIST) $(FRAMAC_PLUGINDIR)/top; \ if [ "$(OCAMLBEST)" = "opt" ]; then \ $(CP) $(PLUGIN_DYN_CMX_LIST) $(FRAMAC_PLUGINDIR)/top; \ fi; \ fi $(PRINT_INSTALL) gui plug-ins if [ -d "$(FRAMAC_PLUGIN_GUI)" -a "$(PLUGIN_DYN_GUI_EXISTS)" = "yes" ]; \ then \ $(CP) $(patsubst %.cma,%.cmi,$(PLUGIN_DYN_GUI_CMO_LIST:.cmo=.cmi)) \ $(PLUGIN_DYN_GUI_CMO_LIST) $(FRAMAC_PLUGINDIR)/gui; \ if [ "$(OCAMLBEST)" = "opt" ]; then \ $(CP) $(PLUGIN_DYN_GUI_CMX_LIST) $(FRAMAC_PLUGINDIR)/gui; \ fi; \ fi $(PRINT_INSTALL) man pages $(CP) man/frama-c.1 $(MANDIR)/man1/frama-c.1 $(CP) man/frama-c.1 $(MANDIR)/man1/frama-c-gui.1 .PHONY: uninstall uninstall:: $(PRINT_RM) installed binaries $(RM) $(BINDIR)/frama-c* $(BINDIR)/ptests.$(OCAMLBEST)$(EXE) $(PRINT_RM) installed shared files $(RM) -R $(FRAMAC_DATADIR) $(PRINT_RM) installed libraries $(RM) -R $(FRAMAC_LIBDIR) $(FRAMAC_PLUGINDIR) $(PRINT_RM) installed man files $(RM) $(MANDIR)/man1/frama-c.1 $(MANDIR)/man1/frama-c-gui.1 ################################ # File headers: license policy # ################################ # Generating headers #################### # Default header specification files HEADER_SPEC := $(DEFAULT_HEADER_SPEC) # The list can be extended by external plugins using PLUGIN_HEADER_SPEC variable HEADER_SPEC += $(PLUGIN_HEADER_SPEC_LIST) # Default list of header specification files can be overloaded. HEADER_SPEC_FILE?=$(HEADER_SPEC) # Default directory (containing subdirectories open-source and close-source) HEADER_DIRS := $(DEFAULT_HEADER_DIRS) # The list can be extended by external plugins using PLUGIN_HEADER_DIRS variable HEADER_DIRS += $(PLUGIN_HEADER_DIRS_LIST) # Takes into account the kind of distribution (open-souce/close-source) DISTRIB_HEADER_DIRS?=$(addsuffix /$(DISTRIB_HEADERS),$(HEADER_DIRS)) # List of distributed files allowed to have no entry into the HEADER_SPEC_FILE HEADER_EXCEPTIONS := $(DEFAULT_HEADER_EXCEPTIONS) HEADER_EXCEPTIONS += opam/files $(wildcard $(PLUGIN_HEADER_EXCEPTIONS_LIST)) # List of headers that cannot be part of an open-source distribution CEA_PROPRIETARY_HEADERS := $(DEFAULT_CEA_PROPRIETARY_HEADERS) CEA_PROPRIETARY_HEADERS += $(PLUGIN_CEA_PROPRIETARY_HEADERS_LIST) # List of files that cannot be part of an open-source distribution CEA_PROPRIETARY_FILES := $(DEFAULT_CEA_PROPRIETARY_FILES) CEA_PROPRIETARY_FILES += $(PLUGIN_CEA_PROPRIETARY_FILES_LIST) HDRCK=./headers/hdrck$(EXE) HDRCK_EXTRA?=$(STRICT_HEADERS) # Can be set to "-exit-on-warning" ifeq ($(HDRCK_EXTRA),no) HDRCK_EXTRA:="" else ifeq ($(HDRCK_EXTRA),yes) HDRCK_EXTRA:="-exit-on-warning" endif endif .PHONY: headers # OPEN_SOURCE: set it to 'no' if you want to apply close source headers. # STRICT_HEADERS: set it to 'yes' if you want to consider warnings as errors headers:: $(HDRCK) $(PRINT) "|$(OPEN_SOURCE)|$(SPECIFIED_OPEN_SOURCE)|" $(PRINT) "Applying $(HDRCK_DISTRIB_HEADERS) headers (OPEN_SOURCE=$(HDRCK_OPEN_SOURCE))..." $(PRINT) "- HEADER_SPEC_FILE=$(HEADER_SPEC_FILE)" $(PRINT) "- DISTRIB_HEADER_DIRS=$(HDRCK_DISTRIB_HEADER_DIRS)" $(HDRCK) \ $(HDRCK_EXTRA) \ -update -C . \ $(addprefix -header-dirs ,$(HDRCK_DISTRIB_HEADER_DIRS)) \ -headache-config-file ./headers/headache_config.txt \ $(HEADER_SPEC_FILE) hdrck: $(HDRCK) $(HDRCK): headers/hdrck.ml $(PRINT_MAKING) $@ ifeq ($(OCAMLBEST),opt) $(OCAMLOPT) str.cmxa unix.cmxa $< -o $@ else $(OCAMLC) str.cma unix.cma $< -o $@ endif hdrck-clean: $(RM) headers/hdrck headers/hdrck.o $(RM) headers/hdrck.cmx headers/hdrck.cmi headers/hdrck.cmp clean:: hdrck-clean CURRENT_HEADERS?=open-source CURRENT_HEADER_DIRS?=$(addsuffix /$(CURRENT_HEADERS),$(HEADER_DIRS)) # OPEN_SOURCE: set it to 'yes' if you want to check open source headers # STRICT_HEADERS: set it to 'yes' if you want to consider warnings as errors # The target check-headers does the following checks: # 1. Checks entries of HEADER_SPEC_FILE # 2. Checks that every DISTRIB_FILES (except HEADER_EXCEPTIONS) have an entry # inside HEADER_SPEC_FILE # 3. Checks that all these files are not under DISTRIB_PROPRIETARY_HEADERS # licences # Also check that distributed files are not encoded in ISO-8859. Do this first, # because identical headers but with different encodings are not exactly # easy to distinguish .PHONY: check-headers check-headers: $(HDRCK) $(PRINT) "Checking $(DISTRIB_HEADERS) headers (OPEN_SOURCE=$(OPEN_SOURCE), CURRENT_HEADERS=$(CURRENT_HEADERS))..." $(PRINT) "- HEADER_SPEC_FILE=$(HEADER_SPEC_FILE)" $(PRINT) "- CURRENT_HEADER_DIRS=$(CURRENT_HEADER_DIRS)" $(PRINT) "- FORBIDDEN_HEADERS=$(DISTRIB_PROPRIETARY_HEADERS)" # Workaround to avoid "argument list too long" in make 3.82+ without # using 'file' built-in, only available on make 4.0+ # for make 4.0+, using the 'file' function could be a better solution, # although it seems to segfault in 4.0 (but not in 4.1) $(RM) file_list_to_check.tmp file_list_exceptions.tmp @$(foreach file,$(DISTRIB_FILES),\ echo $(file) >> file_list_to_check.tmp$(NEWLINE)) @$(foreach file,$(HEADER_EXCEPTIONS),\ echo $(file) >> file_list_exceptions.tmp$(NEWLINE)) @if command -v file >/dev/null 2>/dev/null; then \ echo "Checking that distributed files do not use iso-8859..."; \ file --mime-encoding -f file_list_to_check.tmp | \ grep "iso-8859" \ | $(SED) "s/^/error: invalid encoding in /" \ | ( ! grep "error: invalid encoding" ); \ else echo "command 'file' not found, skipping encoding checks"; \ fi $(HDRCK) \ $(HDRCK_EXTRA) \ $(addprefix -header-dirs ,$(CURRENT_HEADER_DIRS)) \ $(addprefix -forbidden-headers ,$(DISTRIB_PROPRIETARY_HEADERS)) \ -headache-config-file ./headers/headache_config.txt \ -distrib-file file_list_to_check.tmp \ -header-except-file file_list_exceptions.tmp \ $(HEADER_SPEC_FILE) $(RM) file_list_to_check.tmp file_list_exceptions.tmp ######################################################################## # Makefile is rebuilt whenever Makefile.in or configure.in is modified # ######################################################################## share/Makefile.config: share/Makefile.config.in config.status $(PRINT_MAKING) $@ ./config.status --file $@ share/Makefile.dynamic_config: share/Makefile.dynamic_config.internal $(PRINT_MAKING) $@ $(RM) $@ $(CP) $< $@ $(CHMOD_RO) $@ config.status: configure $(PRINT_MAKING) $@ ./config.status --recheck configure: configure.in .force-reconfigure $(PRINT_MAKING) $@ autoconf -f # If 'make clean' has to be performed after 'svn update': # change '.make-clean-stamp' before 'svn commit' .make-clean: .make-clean-stamp $(TOUCH) $@ $(QUIET_MAKE) clean include .make-clean # force "make clean" to be executed for all users of SVN force-clean: expr `$(CAT) .make-clean-stamp` + 1 > .make-clean-stamp # force a reconfiguration for all svn users force-reconfigure: expr `$(CAT) .force-reconfigure` + 1 > .force-reconfigure .PHONY: force-clean force-reconfigure ############ # cleaning # ############ clean-journal: $(PRINT_RM) journal $(RM) frama_c_journal* clean-tests: $(PRINT_RM) tests $(RM) tests/*/*.byte$(EXE) tests/*/*.opt$(EXE) tests/*/*.cm* \ tests/dynamic/.cm* tests/*/*~ tests/*/#* $(RM) tests/*/result/*.* clean-doc:: $(PLUGIN_LIST:=_CLEAN_DOC) $(PRINT_RM) documentation $(RM) -r $(DOC_DIR)/html $(RM) $(DOC_DIR)/docgen.cm* $(DOC_DIR)/*~ $(RM) doc/db/*~ doc/db/ocamldoc.sty doc/db/db.tex $(RM) doc/training/*/*.cm* if [ -f doc/developer/Makefile ]; then \ $(MAKE) --silent -C doc/developer clean; \ fi clean-gui:: $(PRINT_RM) gui $(RM) src/*/*/*_gui.cm* src/*/*/*_gui.o \ src/plugins/gui/*.cm* src/plugins/gui/*.o clean:: $(PLUGIN_LIST:=_CLEAN) \ clean-tests clean-journal clean-check-libc $(PRINT_RM) lib/plugins $(RM) $(addprefix $(PLUGIN_LIB_DIR)/,*.mli *.cm* *.o META.*) $(RM) $(addprefix $(PLUGIN_TOP_LIB_DIR)/,*.mli *.cm* *.o *.a) $(RM) $(addprefix $(PLUGIN_GUI_LIB_DIR)/,*.mli *.cm* *.o *.a) $(PRINT_RM) local installation $(RM) lib/*.cm* lib/*.o lib/fc/*.cm* lib/fc/*.o lib/gui/*.cm* lib/*.cm* $(PRINT_RM) other sources for d in . $(SRC_DIRS) src/plugins/gui share; do \ $(RM) $$d/*.cm* $$d/*.o $$d/*.a $$d/*.annot $$d/*~ $$d/*.output \ $$d/*.annot $$d/\#*; \ done $(PRINT_RM) generated files $(RM) $(GENERATED) $(PRINT_RM) binaries $(RM) bin/toplevel.byte$(EXE) bin/viewer.byte$(EXE) \ bin/ptests.byte$(EXE) bin/*.opt$(EXE) bin/toplevel.top$(EXE) $(RM) bin/fc-config$(EXE) smartclean: $(MAKE) -f share/Makefile.clean smartclean # Do NOT use :: for this rule: it is mandatory to remove share/Makefile.config # as the very last step performed by make (who'll otherwise try to regenerate # it in the middle of cleaning) dist-clean distclean: clean clean-doc \ $(PLUGIN_LIST:=_DIST_CLEAN) $(PRINT_RM) config $(RM) share/Makefile.config $(RM) config.cache config.log config.h $(RM) -r autom4te.cache $(PRINT_RM) documentation $(RM) $(DOC_DIR)/kernel-doc.ocamldoc $(PRINT_RM) dummy plug-ins $(RM) src/dummy/*/*.cm* src/dummy/*/*.o src/dummy/*/*.a \ src/dummy/*/*.annot src/dummy/*/*~ src/dummy/*/*.output \ src/dummy/*/*.annot src/dummy/*/\#* ifeq ($(OCAMLWIN32),yes) # Use Win32 typical resources share/frama-c.rc: share/frama-c.WIN32.rc $(PRINT_MAKING) $@ $(CP) $^ $@ else # Use Unix typical resources share/frama-c.rc: share/frama-c.Unix.rc $(PRINT_MAKING) $@ $(CP) $^ $@ endif GENERATED+=share/frama-c.rc ########## # Depend # ########## PLUGIN_DEP_LIST:=$(PLUGIN_LIST) .PHONY: depend # in case .depend is absent, we will make it. Otherwise, it will be left # untouched. Only make depend will force a recomputation of dependencies .depend: $(GENERATED) share/Makefile.dynamic_config $(MAKE) depend depend:: $(GENERATED) share/Makefile.dynamic_config $(PRINT_MAKING) .depend $(RM) .depend $(OCAMLDEP) $(INCLUDES) $(FILES_FOR_OCAMLDEP) > .depend $(OCAMLDEP) $(INCLUDES) $(TEST_DIRS_AS_PLUGIN:%=-I tests/%) \ $(LONELY_TESTS_ML_FILES) >> .depend $(CHMOD_RO) .depend #Used by internal plugins to wait until the *.mli of all the plugins are in # $(PLUGIN_LIB_DIR) before computing their .depend. Otherwise ocamldep doesn't # mark inter-plugin dependencies $(PLUGIN_LIB_DIR)/.placeholders_ready: touch $@ ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) ifneq ($(MAKECMDGOALS),smartclean) ifneq ($(MAKECMDGOALS),depend) sinclude .depend endif endif endif endif ##################### # ptest development # ##################### .PHONY: ptests PTESTS_SRC=ptests/ptests_config.ml ptests/ptests.ml # Do not generate tests/ptests_config if we are compiling a distribution # that does not contain a 'tests' dir PTESTS_CONFIG:= $(shell if test -d tests; then echo tests/ptests_config; fi) ptests: bin/ptests.$(OCAMLBEST)$(EXE) $(PTESTS_CONFIG) bin/ptests.byte$(EXE): $(PTESTS_SRC) $(PRINT_LINKING) $@ $(OCAMLC) -I ptests -dtypes -thread -g -o $@ \ unix.cma threads.cma str.cma dynlink.cma $^ bin/ptests.opt$(EXE): $(PTESTS_SRC) $(PRINT_LINKING) $@ $(OCAMLOPT) -I ptests -dtypes -thread -o $@ \ unix.cmxa threads.cmxa str.cmxa dynlink.cmxa $^ GENERATED+=ptests/ptests_config.ml tests/ptests_config ####################### # Source distribution # ####################### .PHONY: src-distrib STANDALONE_PLUGINS_FILES = \ $(addprefix src/dummy/hello_world/,hello_world.ml Makefile) \ $(addprefix src/dummy/untyped_metrics/,count_for.ml Makefile) DISTRIB_FILES += $(wildcard $(PLUGIN_DISTRIBUTED_LIST) \ $(PLUGIN_DIST_EXTERNAL_LIST) \ $(PLUGIN_DIST_DOC_LIST) $(STANDALONE_PLUGINS_FILES)) DISTRIB_FILES:=$(filter-out $(GENERATED) $(PLUGIN_GENERATED_LIST),\ $(DISTRIB_FILES)) DISTRIB_TESTS += $(wildcard $(PLUGIN_DIST_TESTS_LIST)) SPECIFIED_OPEN_SOURCE:=$(OPEN_SOURCE) OPEN_SOURCE ?= no ifneq ($(OPEN_SOURCE),yes) # close source version DISTRIB_HEADERS:=close-source DISTRIB_PROPRIETARY_HEADERS:= else # open source version DISTRIB_HEADERS:=open-source # for checking that distributed files aren't under proprietary licence. DISTRIB_PROPRIETARY_HEADERS:=$(CEA_PROPRIETARY_HEADERS) # DISTRIB_TESTS contents files that can be distributed without header checking DISTRIB_TESTS:=$(filter-out $(CEA_PROPRIETARY_FILES) ,\ $(DISTRIB_TESTS)) # DISTRIB_FILES contents files that can be distributed with header checking DISTRIB_FILES:=$(filter-out $(CEA_PROPRIETARY_FILES) ,\ $(DISTRIB_FILES)) endif # Set some variables for `headers`target. ifeq ($(OPEN_SOURCE),$(SPECIFIED_OPEN_SOURCE)) # The OPEN_SOURCE variable is specified. So, use it for `make headers` HDRCK_OPEN_SOURCE=$(SPECIFIED_OPEN_SOURCE) HDRCK_DISTRIB_HEADERS=$(DISTRIB_HEADERS) HDRCK_DISTRIB_HEADER_DIRS=$(DISTRIB_HEADER_DIRS) else # The OPEN_SOURCE variable is unspecified. So, use open-source default for `make headers` HDRCK_OPEN_SOURCE=unspecified HDRCK_DISTRIB_HEADERS=open-source HDRCK_DISTRIB_HEADER_DIRS?=$(addsuffix /$(HDRCK_DISTRIB_HEADERS),$(HEADER_DIRS)) endif # Variables governing the name of the generated .tar.gz. # Optionally define them as empty to silence warnings about undefined variables CLIENT ?= DISTRIB_DIR=tmp ifeq ("$(CLIENT)","") VERSION_NAME:=$(VERSION) else VERSION_NAME:=$(VERSION)-$(CLIENT) endif DISTRIB?=frama-c-$(VERSION_NAME)-$(VERSION_CODENAME) CLIENT_DIR=$(DISTRIB_DIR)/$(DISTRIB) # useful parameters: # CLIENT: name of the client (in the version number, the archive name, etc) # DISTRIB: name of the generated tarball and of the root tarball directory # OPEN_SOURCE: set it to 'yes' if you want to exclude close source files # note: make headers has to be applied... src-distrib: $(HDRCK) check-headers ifeq ("$(CLIENT)","") $(PRINT_BUILD) "$(DISTRIB_HEADERS) tarball $(DISTRIB) (OPEN_SOURCE=$(OPEN_SOURCE))" else $(PRINT_BUILD) "$(DISTRIB_HEADERS) tarball $(DISTRIB) for $(CLIENT) (OPEN_SOURCE=$(OPEN_SOURCE))" endif $(RM) -r $(CLIENT_DIR) $(MKDIR) -p $(CLIENT_DIR) @#Workaround to avoid "argument list too long" in make 3.82+ without @#using 'file' built-in, only available on make 4.0+ @#for make 4.0+, using the 'file' function could be a better solution, @#although it seems to segfault in 4.0 (but not in 4.1) $(RM) file_list_to_archive.tmp @$(foreach file,$(DISTRIB_FILES) $(DISTRIB_TESTS),\ echo $(file) >> file_list_to_archive.tmp$(NEWLINE)) $(TAR) -cf - --files-from file_list_to_archive.tmp | $(TAR) -C $(CLIENT_DIR) -xf - $(RM) file_list_to_archive.tmp $(PRINT_MAKING) files (cd $(CLIENT_DIR) ; \ echo "$(VERSION_NAME)" > VERSION && \ DISTRIB_CONF=yes autoconf > ../../.log.autoconf 2>&1) $(MKDIR) $(CLIENT_DIR)/bin $(MKDIR) $(CLIENT_DIR)/lib/plugins $(MKDIR) $(CLIENT_DIR)/lib/gui $(RM) ../$(DISTRIB).tar.gz $(PRINT) "Updating files to archive with $(DISTRIB_HEADERS) headers" $(HDRCK) \ $(HDRCK_EXTRA) \ -update -C $(CLIENT_DIR) \ $(addprefix -header-dirs ,$(DISTRIB_HEADER_DIRS)) \ -headache-config-file ./headers/headache_config.txt \ $(HEADER_SPEC_FILE) $(PRINT_TAR) $(DISTRIB).tar.gz (cd $(DISTRIB_DIR); $(TAR) cf - \ --numeric-owner --owner=0 --group=0 --sort=name \ --mtime="$$(date +"%F") Z" --mode='a+rw' \ --exclude "*autom4te.cache*" \ $(DISTRIB) | gzip -9 -n > ../$(DISTRIB).tar.gz \ ) $(PRINT_RM) $(DISTRIB_DIR) $(RM) -r $(DISTRIB_DIR) doc-companions: $(MAKE) -C doc/developer archives VERSION=$(VERSION)-$(VERSION_CODENAME) $(MV) doc/developer/hello-$(VERSION)-$(VERSION_CODENAME).tar.gz hello-$(VERSION)-$(VERSION_CODENAME).tar.gz $(ECHO) "The documentation companion hello-$(VERSION)-$(VERSION_CODENAME).tar.gz has been generated." clean-distrib: dist-clean $(PRINT_RM) distrib $(RM) -r $(DISTRIB_DIR) $(DISTRIB).tar.gz create_lib_to_install_list = $(addprefix $(FRAMAC_LIB)/,$(call map,notdir,$(1))) byte:: bin/toplevel.byte$(EXE) lib/fc/frama-c.cma share/Makefile.dynamic_config \ $(call create_lib_to_install_list,$(LIB_BYTE_TO_INSTALL)) \ $(PLUGIN_META_LIST) lib/fc/META.frama-c opt:: bin/toplevel.opt$(EXE) lib/fc/frama-c.cmxa share/Makefile.dynamic_config \ $(call create_lib_to_install_list,$(LIB_OPT_TO_INSTALL)) \ $(filter %.o %.cmi,\ $(call create_lib_to_install_list,$(LIB_BYTE_TO_INSTALL))) \ $(PLUGIN_META_LIST) lib/fc/META.frama-c top: bin/toplevel.top$(EXE) \ $(call create_lib_to_install_list,$(LIB_BYTE_TO_INSTALL)) \ $(PLUGIN_META_LIST) ################## # Copy in lib/fc # ################## define copy_in_lib $(FRAMAC_LIB)/$(notdir $(1)): $(1) $(MKDIR) $(FRAMAC_LIB) $(CP) $$< $$@ endef $(eval $(foreach file,$(LIB_BYTE_TO_INSTALL),$(call copy_in_lib,$(file)))) $(eval $(foreach file,$(LIB_OPT_TO_INSTALL),$(call copy_in_lib,$(file)))) ################ # Generic part # ################ $(NON_OPAQUE_DEPS:%=%.cmx): OFLAGS := $(OFLAGS) -w -58 $(CROWBAR_AFL_TARGET:%=%.cmx): OFLAGS:=$(OFLAGS) -afl-instrument include share/Makefile.generic ############################################################################### # Local Variables: # compile-command: "make" # End: frama-c-20.0-Calcium/Makefile.generating0000666000000000000000000002032413571573400014776 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ptests/ptests_config.ml: Makefile.generating share/Makefile.config $(PRINT_MAKING) $@ $(RM) $@ $(TOUCH) $@ $(CHMOD_RO) $@ tests/ptests_config: Makefile.generating share/Makefile.config $(PRINT_MAKING) $@ $(RM) $@ $(TOUCH) $@ $(ECHO) "DEFAULT_SUITES=$(PLUGIN_TESTS_LIST)" >> $@ $(ECHO) "TOPLEVEL_PATH=bin/toplevel.$(OCAMLBEST)$(EXE)" >> $@ $(ECHO) "OCAMLRUNPARAM=" >> $@ $(ECHO) "FRAMAC_SESSION=." >> $@ $(ECHO) "FRAMAC_SHARE=./share" >> $@ $(ECHO) "FRAMAC_PLUGIN=./lib/plugins" >> $@ $(ECHO) "FRAMAC_PLUGIN_GUI=./lib/plugins/gui" >> $@ $(ECHO) "FRAMAC_LIB=./lib/fc" >> $@ $(CHMOD_RO) $@ ALL_LIBRARY_NAMES=$(shell ocamlfind query -r -p-format $(LIBRARY_NAMES) $(LIBRARY_NAMES_GUI)) MAJOR_VERSION=$(shell $(SED) -E 's/^([0-9]+)\..*/\1/' VERSION) MINOR_VERSION=$(shell $(SED) -E 's/^[0-9]+\.([0-9]+).*/\1/' VERSION) $(CONFIG_FILE): $(CONFIG_FILE).in VERSION VERSION_CODENAME share/Makefile.config Makefile.generating configure.in $(SED) \ -e "s|@VERSION@|$(VERSION)|" \ -e "s|@VERSION_CODENAME@|$(VERSION_CODENAME)|" \ -e "s|@CURR_DATE@|$$(LC_ALL=C date)|" \ -e "s|@OCAMLC@|$(OCAMLC)|" \ -e "s|@OCAMLOPT@|$(OCAMLOPT)|" \ -e "s|@WARNINGS@|$(WARNINGS)|" \ -e "s|@FRAMAC_DATADIR@|$(FRAMAC_DATADIR)|" \ -e "s|@FRAMAC_LIBDIR@|$(FRAMAC_LIBDIR)|" \ -e "s|@FRAMAC_ROOT_SRCDIR@|$(FRAMAC_ROOT_SRCDIR)|" \ -e "s|@FRAMAC_PLUGINDIR@|$(FRAMAC_PLUGINDIR)|" \ -e "s|@FRAMAC_DEFAULT_CPP@|$(FRAMAC_DEFAULT_CPP)|" \ -e "s|@FRAMAC_DEFAULT_CPP_ARGS@|$(FRAMAC_DEFAULT_CPP_ARGS)|" \ -e "s|@FRAMAC_GNU_CPP@|$(FRAMAC_GNU_CPP)|" \ -e "s|@DEFAULT_CPP_KEEP_COMMENTS@|$(DEFAULT_CPP_KEEP_COMMENTS)|" \ -e "s|@DEFAULT_CPP_SUPPORTED_ARCH_OPTS@|$(DEFAULT_CPP_SUPPORTED_ARCH_OPTS)|" \ -e "s|@COMPILATION_UNITS@|$(COMPILATION_UNITS)|" \ -e "s|@LIBRARY_NAMES@|$(foreach p,$(ALL_LIBRARY_NAMES),\"$p\";)|" \ -e "s|@OPTDOT@|$(OPTDOT)|" \ -e "s|@EXE@|$(EXE)|" \ -e "s|@MAJOR_VERSION@|$(MAJOR_VERSION)|" \ -e "s|@MINOR_VERSION@|$(MINOR_VERSION)|" \ $< > $@.tmp @touch -r $@.tmp $< $(CP_IF_DIFF) $@.tmp $@ $(RM) $@.tmp $(CHMOD_RO) $@ ifeq ("$(LOCAL_MACHDEP)","yes") MACHDEP_PATH=share # Create the machine dependency module # If the cl command cannot be run then the MSVC part will be identical to GCC .PHONY : machdep $(MACHDEP_PATH)/local_machdep.ml machdep: $(MACHDEP_PATH)/local_machdep.ml bin/machdep.exe: machdep config.h: $(PRINT_MAKING) $@ $(ECHO) "missing config.h file generated at configure stage using --enable-localmachdep option." exit 1; $(MACHDEP_PATH)/local_machdep.ml: \ $(MACHDEP_PATH)/machdep.c config.h Makefile.generating $(PRINT_MAKING) $@ $(RM) $@ $(ECHO) "(* This module was generated automatically by code in Makefile and machdep.c *)" >$@ # Now generate the type definition $(ECHO) "open Cil_types" >> $@ if $(CC) -D_GNUCC $< -o bin/machdep.exe ;then \ $(ECHO) "machdep.exe created successfully."; \ else \ $(RM) $@; exit 1; \ fi $(ECHO) "let gcc = {" >>$@ ./bin/machdep.exe >>$@ $(ECHO) " underscore_name = $(UNDERSCORE_NAME) ;" >> $@ $(ECHO) "}" >>$@ if cl /D_MSVC $< /Febin/machdep.exe /Fobin/machdep.obj ;then \ $(ECHO) "let hasMSVC = true" >>$@; \ else \ $(ECHO) "let hasMSVC = false" >>$@; \ fi $(ECHO) "let msvc = {" >>$@ ./bin/machdep.exe >>$@ $(ECHO) " underscore_name = true ;" >> $@ $(ECHO) "}" >>$@ $(ECHO) \ "let gccHas__builtin_va_list = $(HAVE_BUILTIN_VA_LIST)" >>$@ $(ECHO) "let __thread_is_keyword = $(THREAD_IS_KEYWORD)" >>$@ $(ECHO) \ "$@ generated. You may have this file merged into Frama-C by developers." $(CHMOD_RO) $@ endif # transitioning.ml GENERATED+= src/libraries/utils/json.ml src/libraries/stdlib/transitioning.ml ifeq ($(HAS_OCAML408),yes) DYNLINK_INIT=fun () -> () FORMAT_STAG=stag FORMAT_STRING_OF_STAG=match s with \ Format.String_tag str -> str \ | _ -> raise (Invalid_argument "unsupported tag extension") FORMAT_STAG_OF_STRING=Format.String_tag s HAS_OCAML407_OR_408=yes else DYNLINK_INIT=Dynlink.init FORMAT_STAG=tag FORMAT_STRING_OF_STAG=s FORMAT_STAG_OF_STRING=s ifeq ($(HAS_OCAML407),yes) HAS_OCAML407_OR_408=yes else HAS_OCAML407_OR_408=no endif endif ifeq ($(HAS_OCAML407_OR_408),yes) FLOAT_MAX_FLOAT=Float.max_float else FLOAT_MAX_FLOAT=Pervasives.max_float endif src/libraries/stdlib/transitioning.ml: \ src/libraries/stdlib/transitioning.ml.in \ Makefile.generating share/Makefile.config $(PRINT_MAKING) $@ rm -f $@ sed \ -e 's/@SPLIT_ON_CHAR@/$(SPLIT_ON_CHAR)/g' \ -e 's/@STACK_FOLD@/$(STACK_FOLD)/g' \ -e 's/@NTH_OPT@/$(NTH_OPT)/g' \ -e 's/@FIND_OPT@/$(FIND_OPT)/g' \ -e 's/@ASSOC_OPT@/$(ASSOC_OPT)/g' \ -e 's/@ASSQ_OPT@/$(ASSQ_OPT)/g' \ -e 's/@DYNLINK_INIT@/$(DYNLINK_INIT)/g' \ -e 's/@FLOAT_MAX_FLOAT@/$(FLOAT_MAX_FLOAT)/g' \ -e 's/@FORMAT_STAG@/$(FORMAT_STAG)/g' \ -e 's/@FORMAT_STRING_OF_STAG@/$(FORMAT_STRING_OF_STAG)/g' \ -e 's/@FORMAT_STAG_OF_STRING@/$(FORMAT_STAG_OF_STRING)/g' \ $< > $@ $(CHMOD_RO) $@ ################## # Frama-C-config # ################## src/kernel_internals/runtime/frama_c_config.ml: src/kernel_internals/runtime/config.ml \ src/kernel_internals/runtime/frama_c_config.ml.in Makefile.generating $(PRINT_MAKING) $@ $(RM) $@ $(ECHO) "module Filepath = struct let add_symbolic_dir _ _ = () end" >> $@ $(ECHO) "module Config = struct" >> $@ $(CAT) src/kernel_internals/runtime/config.ml >> $@ $(ECHO) "end" >> $@ $(CAT) src/kernel_internals/runtime/frama_c_config.ml.in >> $@ $(CHMOD_RO) $@ GENERATED+= src/kernel_internals/runtime/frama_c_config.ml bin/fc-config$(EXE): src/kernel_internals/runtime/frama_c_config.ml ifeq ($(OCAMLBEST),opt) $(OCAMLOPT) str.cmxa $< -o $@ else $(OCAMLC) str.cma $< -o $@ endif # Merlin # .PHONY:merlin .merlin merlin: share/Makefile.config Makefile.generating #create Merlin file $(PRINT_MAKING) $@ echo "FLG -c $(FLAGS) $(FRAMAC_USER_MERLIN_FLAGS)" > .merlin for PKG in $(LIBRARY_NAMES); do echo PKG $$PKG >> .merlin; done for PKG in $(LIBRARY_NAMES_GUI); do echo PKG $$PKG >> .merlin; done for PKG in $(MERLIN_PACKAGES); do echo PKG $$PKG >> .merlin; done echo "B lib/plugins" >> .merlin echo "B lib/plugins/gui" >> .merlin find src \( -name '.*' -o -name tests -o -name doc -o -name '*.cache' \) -prune \ -o \( -type d -exec printf "B %s\n" {} \; -exec printf "S %s\n" {} \; \) >> .merlin ifeq ("$(DEVELOPMENT)","yes") all:: .merlin endif lib/fc/META.frama-c: share/META.frama-c share/Makefile.config Makefile.generating $(MKDIR) lib/fc/ $(SED) "s/@REQUIRES/$(LIBRARY_NAMES)/" $< > $@ GENERATED += lib/fc/META.frama-c # Local Variables: # mode: makefile # End: frama-c-20.0-Calcium/README.md0000666000000000000000000001053013571573400012471 0ustar ![Frama-C](share/frama-c.png?raw=true) [Frama-C](http://frama-c.com) is a platform dedicated to the analysis of source code written in C. ## A Collaborative Platform Frama-C gathers several analysis techniques in a single collaborative platform, consisting of a **kernel** providing a core set of features (e.g., a normalized AST for C programs) plus a set of analyzers, called **plug-ins**. Plug-ins can build upon results computed by other plug-ins in the platform. Thanks to this approach, Frama-C provides sophisticated tools, including: - an analyzer based on abstract interpretation, aimed at verifying the absence of run-time errors (**Eva**); - a program proof framework based on weakest precondition calculus (**WP**); - a program slicer (**Slicing**); - a tool for verification of temporal (LTL) properties (**Aoraï**); - a runtime verification tool (**E-ACSL**); - several tools for code base exploration and dependency analysis (**From**, **Impact**, **Metrics**, **Occurrence**, **Scope**, etc.). These plug-ins share a common language and can exchange information via **[ACSL](http://frama-c.com/acsl.html)** (*ANSI/ISO C Specification Language*) properties. Plug-ins can also collaborate via their APIs. ## Installation For more detailed information about installing OPAM/Frama-C, see [INSTALL.md](INSTALL.md). Frama-C is available through [OPAM](http://opam.ocaml.org/), the OCaml Package Manager. This is the preferred installation method. Be sure to install opam v2.0 or higher. Then the following sequence of commands should install frama-c and its gui: opam init opam install depext opam depext frama-c opam install frama-c Frama-C is developed mainly in Linux, often tested in macOS (via Homebrew), and occasionally tested on Windows (via the Windows Subsystem for Linux). ## Usage Frama-C can be run from the command-line, or via its graphical interface. #### Simple usage The recommended usage for simple files is one of the following lines: frama-c file.c - [options] frama-c-gui file.c Where `-` is one of the several Frama-C plug-ins, e.g. `-eva`, or `-wp`, or `-metrics`, etc. Plug-ins can also be run directly from the GUI. To list all plug-ins, run: frama-c -plugins Each plug-in has a help command (`--help` or `--h`) that describes its several options. Finally, the list of options governing the behavior of Frama-C's kernel itself is available through frama-c -kernel-help #### Complex scenarios For more complex usage scenarios (lots of files and directories, with several preprocessing directives), we recommend splitting Frama-C's usage in two parts: 1. Parsing the input files and saving the result to a file; 2. Loading the parsing results and then running the analyses or the GUI. Parsing typically involves giving extra arguments to the C preprocessor, so the `-cpp-extra-args` option is often useful, as in the example below: frama-c *.c *.h -cpp-extra-args="-D -I" -save parsed.sav The results are then loaded into Frama-C for further analyses or for inspection via the GUI: frama-c -load parsed.sav - [options] frama-c-gui -load parsed.sav - [options] ## Further reference - Links to user and developer manuals, Frama-C archives, and plug-in manuals are available at
    http://frama-c.com/download.html - [StackOverflow](http://stackoverflow.com/questions/tagged/frama-c) has several questions with the `frama-c` tag, which is monitored by several members of the Frama-C community. - The [Frama-c-discuss mailing list](http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/frama-c-discuss) is used for announcements and general discussions. - The [official bug tracking system](http://bts.frama-c.com/) can be used for bug reports. - The [Frama-C wiki](https://bts.frama-c.com/dokuwiki/doku.php?id=mantis:frama-c:start) has some useful information, although it is not entirely up-to-date. - The [Frama-C blog](http://blog.frama-c.com/) has several posts about new developments of Frama-C, as well as general discussions about the C language, undefined behavior, floating-point computations, etc. - The [Github snapshot repository](https://github.com/Frama-C/Frama-C-snapshot) contains the .tar.gz archives of stable Frama-C releases, ready to be cloned. It can also be used for reporting issues and submitting pull requests. frama-c-20.0-Calcium/VERSION0000666000000000000000000000000513571573400012256 0ustar 20.0 frama-c-20.0-Calcium/VERSION_CODENAME0000666000000000000000000000001013571573400013505 0ustar Calcium frama-c-20.0-Calcium/bin/0000777000000000000000000000000013571573400011763 5ustar frama-c-20.0-Calcium/bin/frama-c0000777000000000000000000000316613571573400013225 0ustar #!/bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## . $(dirname $0)/local_export.sh exec $BINDIR/toplevel.opt "$@" frama-c-20.0-Calcium/bin/frama-c-config0000777000000000000000000000316313571573400014465 0ustar #!/bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## . $(dirname $0)/local_export.sh exec $BINDIR/fc-config "$@" frama-c-20.0-Calcium/bin/frama-c-gui0000777000000000000000000000316413571573400014005 0ustar #!/bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## . $(dirname $0)/local_export.sh exec $BINDIR/viewer.opt "$@" frama-c-20.0-Calcium/bin/frama-c-gui.byte0000777000000000000000000000316513571573400014750 0ustar #!/bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## . $(dirname $0)/local_export.sh exec $BINDIR/viewer.byte "$@" frama-c-20.0-Calcium/bin/frama-c-script0000777000000000000000000002061113571573400014521 0ustar #!/bin/bash ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Accept '-check' to avoid issues with ptests while [ $# -ge 1 -a "$1" = "-check" ]; do shift done usage() { echo "usage: $0 cmd [args]" echo "" echo " where cmd is:" echo "" echo " - help" echo " Display this help message and exit." echo "" echo " - make-template [dir]" echo " Interactively prepares a template for running analysis scripts," echo " writing it to [dir/GNUmakefile]. [dir] is [.] if omitted." echo "" echo " - make-path" echo " [for Frama-C developers and advanced users without Frama-C in the path]" echo " Creates a frama-c-path.mk file in the current working directory." echo "" echo " - list-files [path/to/compile_commands.json]" echo " Lists all sources in the given compile_commands.json" echo " (defaults to './compile_commands.json' if omitted)." echo " Also lists files defining a 'main' function" echo " (heuristics-based; neither correct nor complete)." echo "" echo " - flamegraph [dir]" echo " Generates flamegraph.svg and flamegraph.html in [dir]" echo " (or in the FRAMAC_SESSION directory by default)." echo " Also opens it in a browser, unless variable NOGUI is set." echo "" echo " - find-fun [dirs]" echo " Lists files in [dirs] declaring or defining " echo " (defaults to PWD + /usr/include)." echo " Heuristics-based: neither correct nor complete." echo "" echo " - summary [options]" echo " Monitors and summarizes multiple analyses dispatched by a Makefile" echo " in the current PWD." echo " Use $0 summary --help for more informations." echo "" echo " - configure " echo " Runs an existing configure script to only consider files" echo " in Frama-C's libc; this will hopefully disable non-essential" echo " and non-POSIX external libraries." echo " is necessary to define a required preprocessor symbol" echo " (run 'frama-c -machdep' help to get the list of machdeps)." echo "" echo " - make-wrapper " echo " Runs 'make ', parsing the output to suggest" echo " useful commands in case of failure." echo "" echo " - normalize-jcdb [path/to/compile_commands.json]" echo " Applies some transformations to an existing compile_commands.json" echo " (such as relativizing paths) to improve portability" exit $1 } if [ $# -lt 1 ]; then usage 1 fi DIR="$( cd "$( dirname "$0" )" && pwd )" FRAMAC_SHARE=$("${DIR}/frama-c-config" -print-share-path) if [ -z ${FRAMAC_SESSION+x} ]; then FRAMAC_SESSION="./.frama-c"; fi command="$1" # [check_path_exists path]: if [path] exists, # ask if it should be overwritten check_path_exists() { if [ -e "$1" ]; then read -p "warning: '$1' already exists. Overwrite? [y/N] " yn case $yn in [Yy]) ;; *) echo "Exiting without overwriting." exit 0;; esac fi } # [open file] open_file() { case "$OSTYPE" in cygwin*) cmd /c start "$1" ;; linux*) xdg-open "$1" ;; darwin*) open "$1" ;; esac } make_path() { cat < frama-c-path.mk FRAMAC_DIR=${DIR} ifeq (\$(wildcard \$(FRAMAC_DIR)),) # Frama-C not installed locally; using the version in the PATH else FRAMAC=\$(FRAMAC_DIR)/frama-c FRAMAC_GUI=\$(FRAMAC_DIR)/frama-c-gui FRAMAC_CONFIG=\$(FRAMAC_DIR)/frama-c-config endif EOF echo "Wrote to: frama-c-path.mk" } flamegraph() { if [ "$#" -eq 0 ]; then echo "error: 'flamegraph' command requires a path"; exit 1 fi if [ ! -e "$1" ]; then echo "error: '$1' not found" exit 1 else path="$1" fi if [ "$#" -ge 2 ]; then dir="${2%/}" else dir="$FRAMAC_SESSION" fi if [ ! -d "$dir" ]; then mkdir "$dir" if [ $? -ne 0 ]; then echo "error: could not create '$dir'" exit 1 fi fi out_svg="$dir/flamegraph.svg" "${FRAMAC_SHARE}/analysis-scripts/flamegraph.pl" \ --title "Eva Flamegraph" --inverted --hash "$path" \ --width 1400 --fontsize 11 > "$out_svg.tmp" if [ ! $? -eq 0 ]; then echo "Error creating flamegraph, aborting." exit 1 fi mv "$out_svg.tmp" "$out_svg" out_html="$dir/flamegraph.html" cat < "$out_html" Eva Flamegraph EOF if [ -z "$NOGUI" ]; then open_file "$out_html" fi } configure_for_frama_c() { if [ "$#" -eq 0 ]; then echo "error: 'configure' command requires a machdep"; exit 1 fi MACHDEP="$(echo $1 | tr a-z A-Z)" shift CPP="gcc -E -nostdinc -fno-builtin -I${FRAMAC_SHARE}/libc -D__FC_MACHDEP_${MACHDEP}" ./configure "$@" } normalize_jcdb() { path="" if [ "$#" -eq 0 ]; then path="./compile_commands.json" else path="$1" fi if [ ! -e "$path" ]; then echo "error: cannot find file: $path"; exit 1 fi sed "s|$PWD/||g" "$path" > "${path}.tmp" cmp -s "$path" "${path}.tmp" if [ $? -eq 0 ]; then echo "No changes to be applied to $path" rm "${path}.tmp" else echo "Differences to be applied to $path:" diff -u0 "$path" "${path}.tmp" read -p "Normalize $path? [y/N] " yn case $yn in [Yy]) mv "${path}.tmp" "$path" echo "Normalization applied to $path" ;; *) echo "Exiting without overwriting." exit 0;; esac fi } case "$command" in "help" | "-help" | "--help" | "-h") usage 0; ;; "make-template") shift; ${FRAMAC_SHARE}/analysis-scripts/make_template.py "$0" "$@"; ;; "make-path") shift; make_path; ;; "list-files") shift; ${FRAMAC_SHARE}/analysis-scripts/list_files.py "$@"; ;; "find-fun") shift; ${FRAMAC_SHARE}/analysis-scripts/find_fun.py "$@"; ;; "flamegraph") shift; flamegraph "$@"; ;; "summary") shift; ${FRAMAC_SHARE}/analysis-scripts/summary.py "$@"; ;; "configure") shift; configure_for_frama_c "$@"; ;; "make-wrapper") shift; ${FRAMAC_SHARE}/analysis-scripts/make_wrapper.py "$0" "$@"; ;; "normalize-jcdb") shift; normalize_jcdb "$@"; ;; *) echo "error: unrecognized command: $command"; exit 1 esac frama-c-20.0-Calcium/bin/frama-c.byte0000777000000000000000000000316713571573400014170 0ustar #!/bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## . $(dirname $0)/local_export.sh exec $BINDIR/toplevel.byte "$@" frama-c-20.0-Calcium/bin/local_export.sh0000666000000000000000000000345713571573400015023 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## MYDIR=$(dirname $0) BINDIR=$(cd $MYDIR && pwd) #more portable realpath ROOTDIR=$BINDIR/.. export FRAMAC_PLUGIN_GUI="$ROOTDIR/lib/plugins/gui" export FRAMAC_LIB="$ROOTDIR/lib/fc" export FRAMAC_PLUGIN="$ROOTDIR/lib/plugins" export FRAMAC_SHARE="$ROOTDIR/share" frama-c-20.0-Calcium/bin/migration_scripts/0000777000000000000000000000000013571573400015523 5ustar frama-c-20.0-Calcium/bin/migration_scripts/aluminium2silicon.sh0000777000000000000000000001034013571573400021523 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # convert a Frama-C plugin from Frama-C Aluminium to Frama-C Silicon # as most as possible (no guarantee that the result is fully compatible) # # known missing features: # - doesn't work if a directory name contains spaces # - doesn't follow symbolic links to directories ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "\"s/Pretty_utils.sfprintf/Format.asprintf/g\"" \ -e "\"s/method! vpredicate/method! vpredicate_node/g\"" \ -e "\"s/predicate named/predicate/g\"" \ -e "\"s/visitFramacPredicateNamed/visitFramacPredicate/g\"" \ -e "\"s/visitCilPredicateNamed/visitCilPredicate/g\"" \ -e "\"s/Printer.pp_predicate_named/Printer.pp_predicate/g\"" \ -e "\"s/Logic_utils.named_of_identified_predicate/Logic_const.pred_of_id_pred/g\"" \ -e "\"s/Value_util.pretty_call_stack/Value_types.Callstack.pretty/g\"" \ -e "\"s/Value_util.pretty_call_stack_short/Value_types.Callstack.pretty_short/g\"" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $0 [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$0 -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/boron2carbon.sh0000777000000000000000000003706613571573400020464 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # boron2carbon: # convert caml source files from Frama-C Boron to Frama-C Carbon # # known miss features: don't work if a directory name contains some spaces NAME=boron2carbon ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } # Do not automatically process these ones: too much false positive # -e "\"s/Instr\\\([\\\.a-z]*\\\)/Cil_datatype.Instr\\\1/g\"" \ # -e "\"s/StringSet\\\([\\\.a-z]*\\\)/Datatype.String.Set\\\1/g\"" \ # -e "\"s/Cilutil.Instr\\\([\\\.a-z]*\\\)/Cil_datatype.Instr\\\1/g\"" \ process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi # apply change to Cilutil first in order to not conflict with changes # supposing that Cilutil is opened: order in which sed's "-e" applies does not # seem to be specified sedi \ -e "\"s/Properties_status.identified_property/Property.t/g\"" \ \ \ -e "\"s/Cil.prepareCfg/Cfg.prepareCFG/g\"" \ -e "\"s/Cil.computeCFGInfo/Cfg.computeCFGInfo/g\"" \ \ \ -e "\"s/Cilutil.locUnknown/Cil_datatype.Location.unknown/g\"" \ -e "\"s/Cilutil.get_instrLoc/Cil_datatype.Instr.loc/g\"" \ -e "\"s/Cilutil.get_globalLoc/Cil_datatype.Global.loc/g\"" \ -e "\"s/Cilutil.get_stmtLoc/Cil_datatype.Stmt.loc/g\"" \ -e "\"s/Cilutil.get_code_annotationLoc/Cil_datatype.Code_annotation.loc/g\"" \ -e "\"s/Cilutil.get_global_annotationLoc/Cil_datatype.Global_annotation.loc/g\"" \ \ \ -e "\"s/Cilutil.StringMap\\\([\\\.a-z]*\\\)/Datatype.String.Map\\\1/g\"" \ -e "\"s/Cilutil.StringSet\\\([\\\.a-z]*\\\)/Datatype.String.Set\\\1/g\"" \ -e "\"s/Cilutil.StringSet\\\([\\\.a-z]*\\\)/Datatype.String.Set\\\1/g\"" \ -e "\"s/Cilutil.InstrHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Instr.Hashtbl\\\1/g\"" \ -e "\"s/Cilutil.StmtMap\\\([\\\.a-z]*\\\)/Cil_datatype.Stmt.Map\\\1/g\"" \ -e "\"s/Cilutil.StmtHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Stmt.Hashtbl\\\1/g\"" \ -e "\"s/Cilutil.StmtComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Stmt\\\1/g\"" \ -e "\"s/Cilutil.KinstrComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Kinstr\\\1/g\"" \ -e "\"s/Cilutil.VarinfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Varinfo\\\1/g\"" \ -e "\"s/Cilutil.VarinfoHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Varinfo.Hashtbl\\\1/g\"" \ -e "\"s/Cilutil.VarinfoMap\\\([\\\.a-z]*\\\)/Cil_datatype.Varinfo.Map\\\1/g\"" \ -e "\"s/Cilutil.VarinfoSet\\\([\\\.a-z]*\\\)/Cil_datatype.Varinfo.Set\\\1/g\"" \ -e "\"s/Cilutil.EnuminfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Enuminfo\\\1/g\"" \ -e "\"s/Cilutil.EnuminfoHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Enuminfo.Hashtbl\\\1/g\"" \ -e "\"s/Cilutil.EnuminfoMap\\\([\\\.a-z]*\\\)/Cil_datatype.Enuminfo.Map\\\1/g\"" \ -e "\"s/Cilutil.EnuminfoSet\\\([\\\.a-z]*\\\)/Cil_datatype.Enuminfo.Set\\\1/g\"" \ -e "\"s/Cilutil.EnumitemComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Enumitem\\\1/g\"" \ -e "\"s/Cilutil.EnumitemHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Enumitem.Hashtbl\\\1/g\"" \ -e "\"s/Cilutil.EnumitemMap\\\([\\\.a-z]*\\\)/Cil_datatype.Enumitem.Map\\\1/g\"" \ -e "\"s/Cilutil.EnumitemSet\\\([\\\.a-z]*\\\)/Cil_datatype.Enumitem.Set\\\1/g\"" \ -e "\"s/Cilutil.Compinfo\\\([\\\.a-z]*\\\)/Cil_datatype.Compinfo\\\1/g\"" \ -e "\"s/Cilutil.LogicVarComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_var\\\1/g\"" \ -e "\"s/Cilutil.LogicVarHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_var.Hashtbl\\\1/g\"" \ -e "\"s/Cilutil.LogicVarMap\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_var.Map\\\1/g\"" \ -e "\"s/Cilutil.LogicVarSet\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_var.Set\\\1/g\"" \ -e "\"s/Cilutil.LogicInfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_info.Set\\\1/g\"" \ -e "\"s/Cilutil.LogicInfoSet\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_info.Set\\\1/g\"" \ -e "\"s/Cilutil.FieldinfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Fieldinfo\\\1/g\"" \ -e "\"s/Cilutil.FieldinfoHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Fieldinfo.Hashtbl\\\1/g\"" \ -e "\"s/Cilutil.FieldinfoMap\\\([\\\.a-z]*\\\)/Cil_datatype.Fieldinfo.Map\\\1/g\"" \ -e "\"s/Cilutil.FieldinfoSet\\\([\\\.a-z]*\\\)/Cil_datatype.Fieldinfo.Set\\\1/g\"" \ -e "\"s/Cilutil.TypeComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Typ\\\1/g\"" \ -e "\"s/Cilutil.TypeHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Typ.Hashtbl\\\1/g\"" \ -e "\"s/Cilutil.TypeSet\\\([\\\.a-z]*\\\)/Cil_datatype.Typ.Set\\\1/g\"" \ -e "\"s/Cilutil.LogictypeComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_type\\\1/g\"" \ -e "\"s/Cilutil.LogictypeHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_type.Hashtbl\\\1/g\"" \ -e "\"s/Cilutil.LogictypeMap\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_type.Map\\\1/g\"" \ -e "\"s/Cilutil.LogictypeSet\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_type.Set\\\1/g\"" \ -e "\"s/Cilutil.LvalComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Lval\\\1/g\"" \ -e "\"s/Cilutil.LvalSet\\\([\\\.a-z]*\\\)/Cil_datatype.Lval.Set\\\1/g\"" \ -e "\"s/Cilutil.TermComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Term\\\1/g\"" \ -e "\"s/Cilutil.TermSet\\\([\\\.a-z]*\\\)/Cil_datatype.Term.Set\\\1/g\"" \ \ \ $file sedi \ -e "\"s/prepareCfg/Cfg.prepareCFG/g\"" \ -e "\"s/computeCFGInfo/Cfg.computeCFGInfo/g\"" \ -e "\"s/Rooted_Code_Annotation_Before_After/Rooted_code_annotation_before_after/g\"" \ -e "\"s/locUnknown/Cil_datatype.Location.unknown/g\"" \ -e "\"s/pTypeSig/Cil_datatype.pTypeSig/g\"" \ -e "\"s/get_instrLoc/Cil_datatype.Instr.loc/g\"" \ -e "\"s/get_globalLoc/Cil_datatype.Global.loc/g\"" \ -e "\"s/get_stmtLoc/Cil_datatype.Stmt.loc/g\"" \ -e "\"s/Ast_info.loc_stmt/Cil_datatype.Stmt.loc/g\"" \ -e "\"s/get_code_annotationLoc/Cil_datatype.Code_annotation.loc/g\"" \ -e "\"s/get_global_annotationLoc/Cil_datatype.Global_annotation.loc/g\"" \ -e "\"s/BuiltinFunctions\\\([\\\.a-z]*\\\)/Cil.Builtin_functions\\\1/g\"" \ -e "\"s/StringMap\\\([\\\.a-z]*\\\)/Datatype.String.Map\\\1/g\"" \ -e "\"s/InstrHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Instr.Hashtbl\\\1/g\"" \ -e "\"s/StmtMap\\\([\\\.a-z]\\\*\\\)/Cil_datatype.Stmt.Map\\\1/g\"" \ -e "\"s/StmtHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Stmt.Hashtbl\\\1/g\"" \ -e "\"s/StmtComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Stmt\\\1/g\"" \ -e "\"s/KinstrComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Kinstr\\\1/g\"" \ -e "\"s/VarinfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Varinfo\\\1/g\"" \ -e "\"s/VarinfoHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Varinfo.Hashtbl\\\1/g\"" \ -e "\"s/VarinfoMap\\\([\\\.a-z]*\\\)/Cil_datatype.Varinfo.Map\\\1/g\"" \ -e "\"s/VarinfoSet\\\([\\\.a-z]*\\\)/Cil_datatype.Varinfo.Set\\\1/g\"" \ -e "\"s/EnumitemComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Enumitem\\\1/g\"" \ -e "\"s/EnumitemHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Enumitem.Hashtbl\\\1/g\"" \ -e "\"s/EnumitemMap\\\([\\\.a-z]*\\\)/Cil_datatype.Enumitem.Map\\\1/g\"" \ -e "\"s/EnumitemSet\\\([\\\.a-z]*\\\)/Cil_datatype.Enumitem.Set\\\1/g\"" \ -e "\"s/EnuminfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Enuminfo\\\1/g\"" \ -e "\"s/EnuminfoHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Enuminfo.Hashtbl\\\1/g\"" \ -e "\"s/EnuminfoMap\\\([\\\.a-z]*\\\)/Cil_datatype.Enuminfo.Map\\\1/g\"" \ -e "\"s/EnuminfoSet\\\([\\\.a-z]*\\\)/Cil_datatype.Enuminfo.Set\\\1/g\"" \ -e "\"s/CompinfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Compinfo\\\1/g\"" \ -e "\"s/LogicVarComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_var\\\1/g\"" \ -e "\"s/LogicVarHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_var.Hashtbl\\\1/g\"" \ -e "\"s/LogicVarMap\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_var.Map\\\1/g\"" \ -e "\"s/LogicVarSet\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_var.Set\\\1/g\"" \ -e "\"s/LogicInfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_info.Set\\\1/g\"" \ -e "\"s/LogicInfoSet\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_info.Set\\\1/g\"" \ -e "\"s/FieldinfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Fieldinfo\\\1/g\"" \ -e "\"s/FieldinfoHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Fieldinfo.Hashtbl\\\1/g\"" \ -e "\"s/FieldinfoMap\\\([\\\.a-z]*\\\)/Cil_datatype.Fieldinfo.Map\\\1/g\"" \ -e "\"s/FieldinfoSet\\\([\\\.a-z]*\\\)/Cil_datatype.Fieldinfo.Set\\\1/g\"" \ -e "\"s/TypComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Typ\\\1/g\"" \ -e "\"s/TypHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Typ.Hashtbl\\\1/g\"" \ -e "\"s/TypSet\\\([\\\.a-z]*\\\)/Cil_datatype.Typ.Set\\\1/g\"" \ -e "\"s/TypeinfoComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Typeinfo\\\1/g\"" \ -e "\"s/TypeinfoHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Typeinfo.Hashtbl\\\1/g\"" \ -e "\"s/TypeinfoSet\\\([\\\.a-z]*\\\)/Cil_datatype.Typeinfo.Set\\\1/g\"" \ -e "\"s/TypeinfoMap\\\([\\\.a-z]*\\\)/Cil_datatype.Typeinfo.Map\\\1/g\"" \ -e "\"s/ExpComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Exp\\\1/g\"" \ -e "\"s/ExpHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Exp.Hashtbl\\\1/g\"" \ -e "\"s/ExpSet\\\([\\\.a-z]*\\\)/Cil_datatype.Exp.Set\\\1/g\"" \ -e "\"s/ExpMap\\\([\\\.a-z]*\\\)/Cil_datatype.Exp.Map\\\1/g\"" \ -e "\"s/LogictypeComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_type\\\1/g\"" \ -e "\"s/LogictypeHashtbl\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_type.Hashtbl\\\1/g\"" \ -e "\"s/LogictypeMap\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_type.Map\\\1/g\"" \ -e "\"s/LogictypeSet\\\([\\\.a-z]*\\\)/Cil_datatype.Logic_type.Set\\\1/g\"" \ -e "\"s/LvalComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Lval\\\1/g\"" \ -e "\"s/LvalSet\\\([\\\.a-z]*\\\)/Cil_datatype.Lval.Set\\\1/g\"" \ -e "\"s/TermComparable\\\([\\\.a-z]*\\\)/Cil_datatype.Term\\\1/g\"" \ -e "\"s/TermSet\\\([\\\.a-z]*\\\)/Cil_datatype.Term.Set\\\1/g\"" \ \ \ \ \ -e "\"s/Logic_env.LogicBuiltin\\\([\\\.a-z]*\\\)/Logic_env.Logic_builtin\\\1/g\"" \ -e "\"s/Logic_env.LogicBuiltinUsed\\\([\\\.a-z]*\\\)/Logic_env.Logic_builtin_used\\\1/g\"" \ -e "\"s/Logic_env.LogicInfo\\\([\\\.a-z]*\\\)/Logic_env.Logic_info\\\1/g\"" \ -e "\"s/Logic_env.LogicTypeInfo\\\([\\\.a-z]*\\\)/Logic_env.Logic_type_info\\\1/g\"" \ -e "\"s/Logic_env.LogicCtorInfo\\\([\\\.a-z]*\\\)/Logic_env.Logic_ctor_info\\\1/g\"" \ \ \ -e "\"s/Type.unit/Datatype.unit/g\"" \ -e "\"s/Type.bool/Datatype.bool/g\"" \ -e "\"s/Type.int/Datatype.int/g\"" \ -e "\"s/Type.int32/Datatype.int32/g\"" \ -e "\"s/Type.int64/Datatype.int64/g\"" \ -e "\"s/Type.nativeint/Datatype.nativeint/g\"" \ -e "\"s/Type.float/Datatype.float/g\"" \ -e "\"s/Type.char/Datatype.char/g\"" \ -e "\"s/Type.string/Datatype.string/g\"" \ -e "\"s/Type.formatter/Datatype.formatter/g\"" \ -e "\"s/Type.big_int/Datatype.big_int/g\"" \ -e "\"s/Type.t_ref/Datatype.t_ref/g\"" \ -e "\"s/Type.option/Datatype.option/g\"" \ -e "\"s/Type.list/Datatype.list/g\"" \ -e "\"s/Type.queue/Datatype.queue/g\"" \ -e "\"s/Type.tuple/Datatype.pair/g\"" \ -e "\"s/Type.func/Datatype.func/g\"" \ -e "\"s/Type.func2/Datatype.func2/g\"" \ -e "\"s/Type.func3/Datatype.func3/g\"" \ -e "\"s/Type.func4/Datatype.func4/g\"" \ \ \ -e "\"s/Kernel_function.Set/Kernel_function.Hptset/g\"" \ -e "\"s/File.pretty/File.pretty_ast/g\"" \ -e "\"s/File.name/File.get_name/g\"" \ -e "\"s/State.name/State.get_name/g\"" \ -e "\"s/State.unique_name/State.get_unique_name/g\"" \ -e "\"s/Project.name/Project.get_name/g\"" \ -e "\"s/Project.unique_name/Project.get_unique_name/g\"" \ \ \ -e "\"s/Baseutil.BaseMap\\\([\\\.a-z]*\\\)/Base.Map\\\1/g\"" \ -e "\"s/Baseutil.BaseSet\\\([\\\.a-z]*\\\)/Base.Set\\\1/g\"" \ -e "\"s/Baseutil.BaseHashtbl\\\([\\\.a-z]*\\\)/Base.Hashtbl\\\1/g\"" \ \ \ -e "\"s/Properties_status.compare/Property.compare/g\"" \ -e "\"s/Properties_status.equal/Property.equal/g\"" \ -e "\"s/Properties_status.hash/Property.hash/g\"" \ -e "\"s/Properties_status.pretty /Property.pretty /g\"" \ -e "\"s/Properties_status.identified_\\\([\\\.a-z]*\\\)/Property.identified_\\\1/g\"" \ -e "\"s/Properties_status.IP\\\([\\\A-Za-z]*\\\)/Property.IP\\\1/g\"" \ -e "\"s/Properties_status.PK\\\([\\\A-Za-z]*\\\)/Property.PK\\\1/g\"" \ -e "\"s/Properties_status.predicate_kind/Property.predicate_kind/g\"" \ -e "\"s/Properties_status.get_ip_kinstr/Property.get_kinstr/g\"" \ -e "\"s/Properties_status.get_ip_kf/Property.get_kf/g\"" \ -e "\"s/Properties_status.get_ip_behavior/Property.get_behavior/g\"" \ \ \ -e "\"s/let descr/let help/g\"" \ \ \ -e "\"s/Kernel_type.string_set/Datatype.String.Set.ty/g\"" \ -e "\"s/Kernel_type.cil_file/Cil_datatype.File.ty/g\"" \ -e "\"s/Kernel_type.cabs_file/Cil_datatype.Cabs_file.ty/g\"" \ \ \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: boron2carbon [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$NAME -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/carbon2nitrogen.sh0000777000000000000000000001126513571573400021163 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # carbon2nitrogen: # convert a Frama-C plugin from Frama-C Carbon to Frama-C Nitrogen # as most as possible (no guarantee that the result is fully compatible) # # known miss features: don't work if a directory name contains some spaces NAME=carbon2nitrogen ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "\"s/Db_types/Cil_types/g\"" \ -e "\"s/Alarms.t/Cil_types.alarm/g\"" \ -e "\"s/Kernel_function.pretty_name/Kernel_function.pretty/g\"" \ -e "\"s/UseUnicode/Unicode/g\"" \ -e "\"s/Ast_info.pretty_vname/Cil_datatype.Varinfo.pretty_vname/g\"" \ -e "\"s/InOutContext/Operational_inputs/g\"" \ -e "\"s/Parameters.Dynamic/Dynamic.Parameter/g\"" \ -e "\"s/Parameters.get_selection_context/Plugin.get_selection_context/g\"" \ -e "\"s/Parameters/Kernel/g\"" \ -e "\"s/Kernel_datatype.Kernel_function/Cil_datatype.Kf/g\"" \ -e "\"s/Kernel_datatype/Cil_datatype/g\"" \ -e "\"s/Cvalue_type/Cvalue/g\"" \ -e "\"s/Relations_type.Model/Cvalue.Model/g\"" \ \ \ -e "\"s/INT/Int/g\"" \ -e "\"s/BOOL/Bool/g\"" \ -e "\"s/GEN_STRING_SET/String_collection/g\"" \ -e "\"s/STRING_SET/String_set/g\"" \ -e "\"s/STRING_LIST/String_list/g\"" \ -e "\"s/STRING_HASHTBL/String_hashtbl/g\"" \ -e "\"s/STRING/String/g\"" \ -e "\"s/COMPLEX_VALUE/Indexed_val_input/g\"" \ -e "\"s/INDEXED_VAL/Indexed_val/g\"" \ \ \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: boron2carbon [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$NAME -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/chlorine2argon.sh0000777000000000000000000000730713571573400021005 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # Converts a Frama-C plugin from Frama-C 17 Chlorine to Frama-C 18 Argon, # on a best-efforts basis (no guarantee that the result is fully compatible). # # known missing features: # - doesn't work if a directory name contains spaces # - doesn't follow symbolic links to directories ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "s/\!Db\.Constant_Propagation/Constant_Propagation.Api/g" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $0 [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$0 -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/fluorine2neon.sh0000777000000000000000000001620313571573400020651 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # fluorine2neon: # convert a Frama-C plugin from Frama-C Fluorine to Frama-C Neon # as most as possible (no guarantee that the result is fully compatible) # # known miss features: don't work if a directory name contains some spaces NAME=fluorine2neon ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "\"s/Upper_Semi_Lattice/Join_Semi_Lattice/g\""\ -e "\"s/!Db.Dominators.is_dominator/Dominators.dominates/g\"" \ -e "\"s/sizeOf_int/bytesSizeOf/g\"" \ -e "\"s/\\\([^a-zA-Z0-9]\\\)Base\\\.create_varinfo/\\\1Base.of_varinfo/g\"" \ -e "\"s/\\\([^a-zA-Z0-9]\\\)Base\\\.create_logic/\\\1Base.of_varinfo/g\"" \ -e "\"s/\\\([^a-zA-Z0-9]\\\)Base\\\.find/\\\1Base.of_varinfo/g\"" \ -e "\"s/generic_symetric_existential_predicate/generic_symetric_predicate/g\"" \ -e "\"s/generic_generic_is_included/generic_predicate/g\"" \ -e "\"s/symetric/symmetric/g\"" \ -e "\"s/Symetric/Symmetric/g\"" \ -e "\"s/Cil.isPtrType/Cil.isPointerType/g\"" \ -e "\"s/Base.cstring_of_string_id//g\"" \ -e "\"s/Ival.fold\\\([^_]\\\)/Ival.fold_int\\\1/g\"" \ -e "\"s/Abstract_interp.Lattice_/Lattice_type.Lattice_/g\"" \ -e "\"s/Abstract_interp.Lattice/Lattice_type.AI_Lattice_with_cardinal_one/g\"" \ -e "\"s/Loop.get_loop_stmts/Stmts_graph.get_stmt_stmts/g\"" \ -e "\"s/Lmap_bitwise.From_Model/Function_Froms.Memory/g\"" \ \ -e "\"s/Structural_descr.Abstract/Structural_descr.t_abstract/g\"" \ \ -e "\"s/Structural_descr.Unknown/Structural_descr.t_unknown/g\"" \ \ -e "\"s/Plugin.group/Cmdline.Group.t/g\"" \ -e "\"s/\\\([^.a-zA-Z_0-9]\\\)Parameter\\\([^_]\\\)/\\1Typed_parameter\\2/g\"" \ -e "\"s/Plugin.Parameter_input/Parameter_sig.Input/g\"" \ -e "\"s/Plugin.Parameter_input_with_arg/Parameter_sig.Input_with_arg/g\"" \ -e "\"s/Plugin.Parameter/Parameter_sig.S/g\"" \ -e "\"s/Plugin.Bool/Parameter_sig.Bool/g\"" \ -e "\"s/Plugin.WithOutput/Parameter_sig.With_output/g\"" \ -e "\"s/Plugin.Int/Parameter_sig.Int/g\"" \ -e "\"s/Plugin.String/Parameter_sig.String/g\"" \ -e "\"s/Plugin.String_collection/Parameter_sig.String_collection/g\"" \ -e "\"s/Plugin.String_set/Parameter_sig.String_set/g\"" \ -e "\"s/Plugin.String_list/Parameter_sig.String_list/g\"" \ -e "\"s/Plugin.String_hashtbl/Parameter_sig.String_hashtbl/g\"" \ -e "\"s/Plugin.Indexed_val/Parameter_sig.Indexed_val/g\"" \ -e "\"s/Plugin.Indexed_val_input/Parameter_sig.Indexed_val_input/g\"" \ -e "\"s/Plugin.Specific_dir/Parameter_sig.Specific_dir/g\"" \ \ -e "\"s/Plugin.set_cmdline_stage/Parameter_customize.set_cmdline_stage/g\"" \ -e "\"s/Plugin.do_not_journalize/Parameter_customize.do_not_journalize/g\"" \ -e "\"s/Plugin.do_not_projectify/Parameter_customize.do_not_projectify/g\"" \ -e "\"s/Plugin.do_not_reset_on_copy/Parameter_customize.do_not_reset_on_copy/g\"" \ -e "\"s/Plugin.do_not_save/Parameter_customize.do_not_save/g\"" \ -e "\"s/Plugin.set_negative_option_name/Parameter_customize.set_negative_option_name/g\"" \ -e "\"s/Plugin.set_unset_option_name/Parameter_customize.set_unset_option_name/g\"" \ -e "\"s/Plugin.set_unset_option_help/Parameter_customize.set_unset_option_help/g\"" \ -e "\"s/Plugin.set_group/Parameter_customize.set_group/g\"" \ -e "\"s/Plugin.is_invisible/Parameter_customize.is_invisible/g\"" \ -e "\"s/Plugin.argument_is_function_name/Parameter_customize.argument_is_function_name/g\"" \ -e "\"s/Plugin.do_iterate/Parameter_customize.do_iterate/g\"" \ -e "\"s/Plugin.do_not_iterate/Parameter_customize.do_not_iterate/g\"" \ -e "\"s/Plugin.get_selection/Parameter_state.get_selection/g\"" \ -e "\"s/Plugin.get_reset_selection/Parameter_state.get_reset_selection/g\"" \ -e "\"s/Plugin.get_selection_context/Parameter_state.get_selection_context/g\"" \ -e "\"s/Base.get_varinfo/Base.to_varinfo/g\"" \ -e "\"s/Base.Not_a_variable/Base.Not_a_C_variable/g\"" \ \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $NAME [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$NAME -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/lithium2beryllium.sh0000777000000000000000000001141413571573400021545 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # lithium2beryllium: # convert caml source files from Frama-C Lithium to Frama-C Beryllium # # known miss features: don't work if a directory name contains some spaces NAME=lithium2beryllium ARGS=$@ DIR= # verbosing on by default VERBOSE="v" CONVERT_CMDLINE="yes" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi tmp="" if [ "$CONVERT_CMDLINE" ]; then sedi -e "\"s/Cmdline\\\($\\\|[\\\.]\\\+\\\)/Parameters\\\1/g\"" $file fi sedi \ -e "\"s/Dynamic\\\.apply\\\($\\\|[ ]\\\+\\\)/Dynamic.get\\\1/g\"" \ -e "\"s/Dynamic\\\.Main\\\.extend\\\($\\\|[ ]\\\+\\\)/Db.Main.extend\\\1/g\"" \ -e "\"s/Version\\\.dataroot\\\($\\\|[ ]\\\+\\\)/Version.datadir\\\1/g\"" \ -e "\"s/Cil_state\\\.file/Ast.get/g\"" \ -e "\"s/Cil_state\\\./Ast./g\"" \ -e "\"s/Options\\\.register_plugin_init\\\($\\\|[ ]\\\+\\\)/Cmdline.run_after_exiting_stage\\\1/g\"" \ -e "\"s/[^_]Options\\\($\\\|[\\\.]\\\+\\\)/Cmdline\\\1/g\"" \ -e "\"s/Parameters\\\.get_selection\\\($\\\|[ ]\\\+\\\)/Parameters_factory.get_selection\\\1/g\"" \ -e "\"s/Parameters\\\.iter_on_options\\\($\\\|[ ]\\\+\\\)/Parameters_factory.iter_on_options\\\1/g\"" \ -e "\"s/Parameters\\\.MinValidAbsoluteAddress\\\.get\\\($\\\|[ ]\\\+\\\)/Base.min_valid_absolute_address\\\1/g\"" \ -e "\"s/Parameters\\\.MaxValidAbsoluteAddress\\\.get\\\($\\\|[ ]\\\+\\\)/Base.max_valid_absolute_address\\\1/g\"" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $NAME [options | directories] Options are: -a | --all Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -s | --second Put this option if you have previously applied this script on this code -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$NAME -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -s | --second ) CONVERT_CMDLINE="";; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/magnesium2aluminium.sh0000777000000000000000000000720613571573400022057 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # convert a Frama-C plugin from Frama-C Magnesium to Frama-C Aluminium # as most as possible (no guarantee that the result is fully compatible) # # known miss features: don't work if a directory name contains some spaces ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "\"s/filter_le_ge_lt_gt/backward_comp/g\"" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $0 [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$0 -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/neon2sodium.sh0000777000000000000000000001025713571573400020331 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # neon2sodium: # convert a Frama-C plugin from Frama-C Neon to Frama-C Sodium # as most as possible (no guarantee that the result is fully compatible) # # known miss features: don't work if a directory name contains some spaces NAME=neon2sodium ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "\"s/EmptyString/Empty_string/g\"" \ -e "\"s/StringSet/String_set/g\"" \ -e "\"s/StringList/String_list/g\"" \ -e "\"s/Cil.kinteger64 ~loc \\([^~]\\)/Cil.kinteger64 ~loc ~kind:\\1/g\"" \ -e "\"s/Integer.bits_of_max_float/Floating_point.bits_of_max_double/g\"" \ -e "\"s/Integer.bits_of_most_negative_float/Floating_point.bits_of_most_negative_double/g\"" \ -e "\"s/Cil.charConstToInt/Cil.charConstToIntConstant/g\"" \ -e "\"s/Ival.neg/Ival.neg_int/g\"" \ -e "\"s/Ival.sub/Ival.sub_int/g\"" \ -e "\"s/Datatype.Big_int/Datatype.Integer/g\"" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $NAME [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$NAME -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/nitrogen2oxygen.sh0000777000000000000000000001077313571573400021233 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # nitrogen2oxygen: # convert a Frama-C plugin from Frama-C Nitrogen to Frama-C Oxygen # as most as possible (no guarantee that the result is fully compatible) # # known miss features: don't work if a directory name contains some spaces NAME=nitrogen2oxygen ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "\"s/Abstract_value/Lattice_Interval_Set/g\"" \ -e "\"s/Cilutil.out_some/Extlib.the/g\"" \ -e "\"s/Cil_state_builder.Inthash/State_builder.Int_hashtbl/g\"" \ -e "\"s/Inthash/Datatype.Int.Hashtbl/g\"" \ -e "\"s/Cil_datatype.Int_hashtbl/Datatype.Int.Hashtbl/g\"" \ -e "\"s/Globals.Annotations.self/Annotations.global_state/g\"" \ -e "\"s/Annotations.self/Annotations.code_annot_state/g\"" \ -e "\"s/Kernel_function.get_spec/Annotations.funspec/g\"" \ -e "\"s/Kernel_function.code_annotations/Annotations.code_annot_of_kf/g\"" \ -e "\"s/Kernel_function.fresh_behavior_name/Annotations.fresh_behavior_name/g\"" \ -e "\"s/Kernel_function.internal_function_behaviors/Annotations.behavior_names_of_stmt_in_kf/g\"" \ -e "\"s/assigns_to_zone_inputs_state/assigns_inputs_to_zone/g\"" \ -e "\"s/Log.reset_once_flag/Messages.reset_once_flag/g\"" \ \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $NAME [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$NAME -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/oxygen2fluorine.sh0000777000000000000000000002257013571573400021227 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # oxygen2fluorine: # convert a Frama-C plugin from Frama-C Oxygen to Frama-C Fluorine # as most as possible (no guarantee that the result is fully compatible) # # known miss features: don't work if a directory name contains some spaces NAME=oxygen2fluorine ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "\"s/Cilutil.out_some/Extlib.the/g\"" \ -e "\"s/Cil_types.rooted_code_annotation/Cil_types.code_annotation/g\"" \ -e "\"s/Ast_info.is_trivial_rooted_assertion/Ast_info.is_trivial_annotation/g\"" \ -e "\"s/Ast_info.lift_annot_func//g\"" \ -e "\"s/Ast_info.lift_annot_list_func//g\"" \ -e "\"s/Ast_printer.d_rooted_code_annotation/Ast_printer.d_code_annotation/g\"" \ -e "\"s/Annotation.code_annotation_of_rooted//g\"" \ -e "\"s/V_Offsetmap_ext/V_Offsetmap/g\"" \ -e "\"s/My_bigint/Integer/g\"" \ -e "\"s/State_dependency_graph.Static/State_dependency_graph/g\"" \ \ -e "\"s/#pVarName/#varname/g\"" \ -e "\"s/#pVar/#varinfo/g\"" \ -e "\"s/#pVDecl/#vdecl/g\"" \ -e "\"s/#pAttr/#attribute/g\"" \ -e "\"s/#pType/#typ/g\"" \ -e "\"s/#pOffset/#offset/g\"" \ -e "\"s/#pExp/#exp/g\"" \ -e "\"s/#pLval/#lval/g\"" \ -e "\"s/#pInstr/#instr/g\"" \ -e "\"s/#pStmt/#stmt/g\"" \ -e "\"s/#pStmtNext/#next_stmt/g\"" \ -e "\"s/#pCode_annot/#code_annotation/g\"" \ -e "\"s/#pGlobal/#global/g\"" \ -e "\"s/#pLabel/#label/g\"" \ -e "\"s/#pBlock/#block/g\"" \ -e "\"s/#pFieldDecl/#fieldinfo/g\"" \ -e "\"s/#pSpec/#funspec/g\"" \ -e "\"s/#pLogic_type/#logic_type/g\"" \ -e "\"s/#pTerm/#term/g\"" \ -e "\"s/#pLogic_const/#logic_constant/g\"" \ -e "\"s/#pPredicate/#predicate/g\"" \ -e "\"s/#pIdentified/#identified/g\"" \ -e "\"s/#pAssigns/#assigns/g\"" \ -e "\"s/#pFrom/#from/g\"" \ -e "\"s/#pDecreases/#decreases/g\"" \ -e "\"s/#pAssumes/#assumes/g\"" \ -e "\"s/#pRequires/#requires/g\"" \ -e "\"s/#pPost_cond/#post_cond/g\"" \ -e "\"s/#pAllocation/#allocation/g\"" \ -e "\"s/#pBehavior/#behavior/g\"" \ -e "\"s/#pCompleteBehavior/#complete_behavior/g\"" \ -e "\"s/#pDisjointBehavior/#disjoint_behavior/g\"" \ -e "\"s/#pSpec/#funspec/g\"" \ -e "\"s/#pAnnotation/#global_annotation/g\"" \ \ -e "\"s/!Ast_printer.d_funspec/Printer.pp_funspec/g\"" \ -e "\"s/!Ast_printer.d_global/Printer.pp_global/g\"" \ -e "\"s/!Ast_printer.d_stmt/Printer.pp_stmt/g\"" \ -e "\"s/!Ast_printer.d_exp/Printer.pp_exp/g\"" \ -e "\"s/!Ast_printer.d_type/Printer.pp_typ/g\"" \ -e "\"s/!Ast_printer.d_ident/Format.pp_print_string/g\"" \ -e "\"s/!Ast_printer.d_var/Printer.pp_varinfo/g\"" \ -e "\"s/!Ast_printer.d_block/Printer.pp_block/g\"" \ -e "\"s/!Ast_printer.d_label/Printer.pp_label/g\"" \ -e "\"s/!Ast_printer.d_term/Printer.pp_term/g\"" \ -e "\"s/!Ast_printer.d_logic_type/Printer.pp_logic_type/g\"" \ -e "\"s/!Ast_printer.d_lval/Printer.pp_lval/g\"" \ -e "\"s/!Ast_printer.d_instr/Printer.pp_instr/g\"" \ -e "\"s/!Ast_printer.d_attrlist/Printer.pp_attributes/g\"" \ -e "\"s/!Ast_printer.d_file/Printer.pp_file/g\"" \ -e "\"s/!Ast_printer.d_code_annotation/Printer.pp_code_annotation/g\"" \ -e "\"s/!Ast_printer.d_predicate_named/Printer.pp_predicate_named/g\"" \ -e "\"s/!Ast_printer.d_relation/Printer.pp_relation/g\"" \ -e "\"s/!Ast_printer.d_term_lval/Printer.pp_term_lval/g\"" \ -e "\"s/!Ast_printer.d_logic_var/Printer.pp_logic_var/g\"" \ -e "\"s/!Ast_printer.d_unop/Printer.pp_unop/g\"" \ -e "\"s/!Ast_printer.d_binop/Printer.pp_binop/g\"" \ \ -e "\"s/Cil.compareLoc/Cil_datatype.Location.compare/g\"" \ -e "\"s/Cil.d_thisLoc/Cil.pp_thisLoc/g\"" \ -e "\"s/Cil.d_loc/Printer.pp_location/g\"" \ -e "\"s/Cil.d_constant/Printer.pp_constant/g\"" \ -e "\"s/Cil.d_ikind/Printer.pp_ikind/g\"" \ -e "\"s/Cil.d_type/Printer.pp_typ/g\"" \ -e "\"s/Cil.d_exp/Printer.pp_exp/g\"" \ -e "\"s/Cil.d_var/Printer.pp_varinfo/g\"" \ -e "\"s/Cil.d_lval/Printer.pp_lval/g\"" \ -e "\"s/Cil.d_offset/Printer.pp_offset/g\"" \ -e "\"s/Cil.d_init/Printer.pp_init/g\"" \ -e "\"s/Cil.d_binop/Printer.pp_binop/g\"" \ -e "\"s/Cil.d_unop/Printer.pp_unop/g\"" \ -e "\"s/Cil.d_attr/Printer.pp_attribute/g\"" \ -e "\"s/Cil.d_attrparam/Printer.pp_attrparam/g\"" \ -e "\"s/Cil.d_attrlist/Printer.pp_attributes/g\"" \ -e "\"s/Cil.d_label/Printer.pp_label/g\"" \ -e "\"s/Cil.d_stmt/Printer.pp_stmt/g\"" \ -e "\"s/Cil.d_block/Printer.pp_block/g\"" \ -e "\"s/Cil.d_global/Printer.pp_global/g\"" \ -e "\"s/Cil.d_file/Printer.pp_file/g\"" \ -e "\"s/Cil.d_relation/Printer.pp_relation/g\"" \ -e "\"s/Cil.d_model_info/Printer.pp_model_info/g\"" \ -e "\"s/Cil.d_term_lval/Printer.pp_term_lval/g\"" \ -e "\"s/Cil.d_logic_var/Printer.pp_logic_var/g\"" \ -e "\"s/Cil.d_logic_type/Printer.pp_logic_type/g\"" \ -e "\"s/Cil.d_identified_term/Printer.pp_identified_term/g\"" \ -e "\"s/Cil.d_term/Printer.pp_term/g\"" \ -e "\"s/Cil.d_term_offset/Printer.pp_term_offset/g\"" \ -e "\"s/Cil.d_predicate_named/Printer.pp_predicate_named/g\"" \ -e "\"s/Cil.d_identified_predicate/Printer.pp_identified_predicate/g\"" \ -e "\"s/Cil.d_code_annotation/Printer.pp_code_annotation/g\"" \ -e "\"s/Cil.d_funspec/Printer.pp_funspec/g\"" \ -e "\"s/Cil.d_behavior/Printer.pp_behavior/g\"" \ -e "\"s/Cil.d_annotation/Printer.pp_code_annotation/g\"" \ -e "\"s/Cil.d_decreases/Printer.pp_decreases/g\"" \ -e "\"s/Cil.d_loop_variant/Printer.pp_variant/g\"" \ -e "\"s/Cil.d_from/Printer.pp_from/g\"" \ -e "\"s/Cil.d_assigns/Printer.pp_assigns/g\"" \ -e "\"s/Cil.d_allocation/Printer.pp_allocation/g\"" \ -e "\"s/Cil.d_loop_from/Printer.pp_loop_from/g\"" \ -e "\"s/Cil.defaultCilPrinterClass/Printer.extensible_printer/g\"" \ -e "\"s/!Cilutil.list_last/Extlib.last/g\"" \ -e "\"s/!Cilutil.list_iteri/Extlib.iteri/g\"" \ -e "\"s/!Cilutil.swap/Extlib.swap/g\"" \ -e "\"s/!Cilutil./Extlib./g\"" \ -e "\"s/location_shift/shift/g\"" \ -e "\"s/alignOf_int/bytesAlignOf/g\"" \ -e "\"s/valid_enumerate_bits/enumerate_valid_bits/g\"" \ -e "\"s/Value_aux.accept_base/!Db.Semantic_callgraph.accept_base/g\"" \ -e "\"s/Value_aux/Value_types/g\"" \ \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $NAME [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$NAME -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/phosphorus2sulfur.sh0000777000000000000000000001261513571573400021624 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # convert a Frama-C plugin from Frama-C Phosphorus to Frama-C Sulfur # as most as possible (no guarantee that the result is fully compatible) # # known missing features: # - doesn't work if a directory name contains spaces # - doesn't follow symbolic links to directories ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "s/\<\(Cil_types\.\)\?identified_term\> *\<\(\(Cil_types\.\)\?\(from\|assigns\|allocation\|deps\)\)\>/\2/g" \ -e "s/\<\(Cil_types\.\)\?term\> *\<\(\(Cil_types\.\)\?\(variant\|loop_pragma\|slice_pragma\|impact_pragma\|pragma\)\)\>/\2/g" \ -e "s/\<\(Logic_ptree\.\)\?lexpr\> \<\(Cil_types\.\)\?\(from\|assigns\|allocation\|deps\)\>/\1\3/g" \ -e "s/\<\(Logic_ptree\.\)\?lexpr\> \<\(Cil_types\.\)\?\(variant\|loop_pragma\|slice_pragma\|impact_pragma\|pragma\)\>/\1\3/g" \ -e "s/!Db\.Slicing\./Slicing\.Api\./g" \ -e "s/Db\.Slicing/Slicing\.Api/g" \ -e "s/!Db\.Report\.print/Report\.Register\.print/g" \ -e "s/!Db\.Scope\.get_defs/Scope\.Defs\.get_defs/g" \ -e "s/!Db\.Scope\.get_defs_with_type/Scope\.Defs\.get_defs_with_type/g" \ -e "s/!Db\.Scope\.get_data_scope_at_stmt/Scope\.Datascope\.get_data_scope_at_stmt/g" \ -e "s/!Db\.Scope\.get_prop_scope_at_stmt/Scope\.Datascope\.get_prop_scope_at_stmt/g" \ -e "s/!Db\.Scope\.check_asserts/Scope\.Datascope\.check_asserts/g" \ -e "s/!Db\.Scope\.rm_asserts/Scope\.Datascope\.rm_asserts/g" \ -e "s/Db\.Scope\.t_zones/Scope\.Zones\.t_zones/g" \ -e "s/!Db\.Scope\.build_zones/Scope\.Zones\.build_zones/g" \ -e "s/!Db\.Scope\.pretty_zones/Scope\.Zones\.pretty_zones/g" \ -e "s/!Db\.Scope\.get_zones/Scope\.Zones\.get_zones/g" \ -e "s/Ival\.inject_top/Ival\.inject_interval/g" -e "s/[^e]-rm-unused-globals/-sparecode-rm-unused-globals/g" \ -e "s/SlicingTypes\.sl_mark/Slicing.Api.Mark.t/g" \ -e "s/SlicingTypes\.dyn_sl_mark/Slicing.Api.Mark.dyn_t/g" \ -e "s/SlicingTypes\.sl_select/Slicing.Api.Select.t/g" \ -e "s/SlicingTypes\.Sl_select.ty/Slicing.Api.Select.dyn_t/g" \ -e "s/SlicingTypes\.sl_fct_slice/Slicing.Api.Slice.t/g" \ -e "s/SlicingTypes\.dyn_sl_fct_slice/Slicing.Api.Slice.dyn_t/g" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $0 [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$0 -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/potassium2calcium.sh0000777000000000000000000001157413571573400021536 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # Converts a Frama-C plugin from Frama-C 19 Potassium to Frama-C 20 Calcium, # on a best-efforts basis (no guarantee that the result is fully compatible). # # known missing features: # - doesn't work if a directory name contains spaces # - doesn't follow symbolic links to directories ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "s/Transitioning\.Char\./Char./g" \ -e "s/Transitioning\.List\./List./g" \ -e "s/Transitioning\.Stack\./Stack./g" \ -e "s/Transitioning\.String\./String./g" \ -e "s/Cil\.Eid/Cil_const\.Eid/g" \ -e "s/Cil\.Sid/Cil_const\.Sid/g" \ -e "s/Cil\.mkCompInfo/Cil_const\.mkCompInfo/g" \ -e "s/Cil\.copyCompInfo/Cil_const\.copyCompInfo/g" \ -e "s/Cil\.visitor_behavior/Visitor_behavior\.t/g" \ -e "s/Cil\.inplace_visit/Visitor_behavior\.inplace/g" \ -e "s/Cil\.copy_visit/Visitor_behavior\.copy/g" \ -e "s/Cil\.refresh_visit/Visitor_behavior\.refresh/g" \ -e "s/Cil\.is_fresh_behavior/Visitor_behavior\.is_fresh/g" \ -e "s/Cil\.is_copy_behavior/Visitor_behavior\.is_copy/g" \ -e "s/Cil\.reset_behavior_/Visitor_behavior\.Reset\./g" \ -e "s/Cil\.get_original_/Visitor_behavior\.Get_orig\./g" \ -e "s/Cil\.get_/Visitor_behavior\.Get\./g" \ -e "s/Cil\.set_orig_/Visitor_behavior\.Set_orig\./g" \ -e "s/Cil\.set_/Visitor_behavior\.Set\./g" \ -e "s/Cil\.unset_orig_/Visitor_behavior\.Unset_orig\./g" \ -e "s/Cil\.unset_/Visitor_behavior\.Unset\./g" \ -e "s/Cil\.memo_/Visitor_behavior\.Memo\./g" \ -e "s/Cil\.iter_visitor_/Visitor_behavior\.Iter\./g" \ -e "s/Cil\.fold_visitor_/Visitor_behavior\.Fold\./g" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $0 [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$0 -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/silicon2phosphorus.sh0000777000000000000000000000736213571573400021747 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # convert a Frama-C plugin from Frama-C Silicon to Frama-C Phosphorus # as most as possible (no guarantee that the result is fully compatible) # # known missing features: # - doesn't work if a directory name contains spaces # - doesn't follow symbolic links to directories ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "\"s/Cabs2cil.compatibleTypesp/Cabs2cil.areCompatibleTypes/g\"" \ -e "\"s/FCDynlink/Dynlink/g\"" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $0 [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$0 -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/sodium2magnesium.sh0000777000000000000000000001260013571573400021351 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # convert a Frama-C plugin from Frama-C Sodium to Frama-C Magnesium # as most as possible (no guarantee that the result is fully compatible) # # known miss features: don't work if a directory name contains some spaces ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then eval sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 eval sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "\"s/Extlib.pretty_position/Cil_datatype.Location.pretty/g\"" \ -e "\"s/Dynlink_common_interface/FCDynlink/g\"" \ -e "\"s/Varinfo.pretty_vname/Varinfo.pretty/g\"" \ -e "\"s/Ast.is_last_decl/Ast.is_def_or_last_decl/g\"" \ -e "\"s/Hptmap.NoCache/Hptmap_sig.NoCache/g\"" \ -e "\"s/Hptmap.PersistentCache/Hptmap_sig.PersistentCache/g\"" \ -e "\"s/Hptmap.TemporaryCache/Hptmap_sig.TemporaryCache/g\"" \ -e "\"s/CEA_DUMP/Frama_C_dump_each/g\"" \ -e "\"s/Properties.Interp.lval/Properties.Interp.term_lval/g\"" \ -e "\"s/Properties.Interp.expr/Properties.Interp.term/g\"" \ -e "\"s/Dynamic.is_plugin_present/Plugin.is_present/g\"" \ -e "\"s/Errorloc.getPosition/Errorloc.currentLoc/g\"" \ -e "\"s/Cabshelper.getPosition/Errorloc.currentLoc/g\"" \ -e "\"s/Ival.singleton_zero/Ival.zero/g\"" \ -e "\"s/Ival.singleton_one/Ival.one/g\"" \ -e "\"s/Ival.Float_abstract/Fval/g\"" \ -e "\"s/Ival.F\b/Fval.F/g\"" \ -e "\"s/Ival.min_and_max_float\b/Fval.min_and_max/g\"" \ -e "\"s/!Db.Semantic_Callgraph.topologically_iter_on_functions/Callgraph.Uses.iter_in_rev_order/g\"" \ -e "\"s/!Db.Semantic_Callgraph.iter_on_callers/Callgraph.Uses.iter_on_callers/g\"" \ -e "\"s/!Db.Semantic_Callgraph.accept_base/Callgraph.Uses.accept_base/g\"" \ -e "\"s/!Db.Semantic_Callgraph.dump/Callgraph.Cg.Services.dump/g\"" \ -e "\"s/!Db.Syntactic_Callgraph.dump/Callgraph.Cg.Services.dump/g\"" \ -e "\"s/!Semantic_Callgraph.topologically_iter_on_functions/Callgraph.Uses.iter_in_rev_order/g\"" \ -e "\"s/!Semantic_Callgraph.iter_on_callers/Callgraph.Uses.iter_on_callers/g\"" \ -e "\"s/!Semantic_Callgraph.accept_base/Callgraph.Uses.accept_base/g\"" \ -e "\"s/!Semantic_Callgraph.dump/Callgraph.Cg.Services.dump/g\"" \ -e "\"s/!Syntactic_Callgraph.dump/Callgraph.Cg.Services.dump/g\"" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $0 [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$0 -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/migration_scripts/sulfur2chlorine.sh0000777000000000000000000001005713571573400021213 0ustar #! /bin/sh ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # # Converts a Frama-C plugin from Frama-C 16 Sulfur to Frama-C 17 Chlorine, # on a best-efforts basis (no guarantee that the result is fully compatible). # # known missing features: # - doesn't work if a directory name contains spaces # - doesn't follow symbolic links to directories ARGS=$@ DIR= # verbosing on by default VERBOSE="v" sedi () { if [ -n "`sed --help 2> /dev/null | grep \"\\-i\" 2> /dev/null`" ]; then sed -i "$@" else # option '-i' is not recognized by sed: use a tmp file new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1 sed "$@" > $new_temp eval last=\${$#} mv $new_temp $last fi } dirs () { if [ -z "$DIR" ]; then DIR=. fi } safe_goto () { dir=$1 cd $dir $3 cd $2 } goto () { if [ -d $1 ]; then safe_goto $1 $2 $3 else echo "Directory '$1' does not exist. Omitted." fi } process_file () { file=$1 if [ "$VERBOSE" ]; then echo "Processing file $file" fi sedi \ -e "s/Cil\.isCharType/Cil.isAnyCharType/g" \ -e "s/Cil\.isCharPtrType/Cil.isAnyCharPtrType/g" \ -e "s/Cil\.isCharArrayType/Cil.isAnyCharArrayType/g" \ -e "s/Cil\.mkBinOp/Cil.mkBinOp_safe_ptr_cmp/g" \ -e "s/\!Db\.Occurrence/Occurrence.Register/g" \ -e "s/\!Db\.Impact/Impact.Register/g" \ -e "s/\!Db\.Users/Users.Users_register/g" \ -e "s/Cil\.typeHasAttributeDeep/Cil.typeHasAttributeMemoryBlock/g" \ $file } apply_one_dir () { if [ "$VERBOSE" ]; then echo "Processing directory `pwd`" fi for f in `ls -p1 *.ml* 2> /dev/null`; do process_file $f done } apply_recursively () { apply_one_dir for d in `ls -p1 | grep \/`; do safe_goto $d .. apply_recursively done } applying_to_list () { dirs tmpdir=`pwd` for d in $DIR; do goto $d $tmpdir $1 done } help () { echo "Usage: $0 [options | directories] Options are: -r | --recursive Check subdirectories recursively -h | --help Display help message -q | --quiet Quiet mode (i.e. non-verbose mode) -v | --verbose Verbose mode (default)" exit 0 } error () { echo "$1. Do \"$0 -h\" for help." exit 1 } FN="apply_one_dir" parse_arg () { case $1 in -r | --recursive) FN="apply_recursively";; -h | -help ) help; exit 0;; -q | --quiet ) VERBOSE=;; -v | --verbose ) VERBOSE="v";; -* ) error "Invalid option $1";; * ) DIR="$DIR $1";; esac } cmd_line () { for s in $ARGS; do parse_arg $s done applying_to_list $FN } cmd_line exit 0 frama-c-20.0-Calcium/bin/sed_get_make_major0000666000000000000000000000004513571573400015504 0ustar s/.* Make[^0-9]*\([0-9]*\)\..*$/\1/p frama-c-20.0-Calcium/bin/sed_get_make_minor0000666000000000000000000000005313571573400015517 0ustar s/.* Make[^0-9]*[0-9]*\.\([0-9]*\).*$/\1/p frama-c-20.0-Calcium/config.h.in0000666000000000000000000000373413571573400013245 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #undef HAVE_WCHAR_T #undef HAVE_STDLIB_H #undef HAVE_STRINGS_H #undef HAVE_SYS_TIME_H #undef HAVE_UNISTD_H #undef HAVE_CONST #undef HAVE_INLINE #undef HAVE_TIME_H #undef HAVE_MEMCP #undef HAVE_MKDIR #undef HAVE_SELECT #undef HAVE_SOCKET #undef TYPE_SIZE_T #undef TYPE_WCHAR_T #undef TYPE_PTRDIFF_T #undef HAVE_BUILTIN_VA_LIST #undef THREAD_IS_KEYWORD #undef UNDERSCORE_NAME frama-c-20.0-Calcium/configure0000777000000000000000000124141713571573400013134 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="src/kernel_internals/runtime/boot.ml" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LABLGTK_PATH EXTERNAL_PLUGINS DEFAULT_CPP_KEEP_COMMENTS FRAMAC_GNU_CPP DEFAULT_CPP_SUPPORTED_ARCH_OPTS FRAMAC_DEFAULT_CPP_ARGS FRAMAC_DEFAULT_CPP LOCAL_MACHDEP CYCLES_PER_USEC UNDERSCORE_NAME THREAD_IS_KEYWORD HAVE_BUILTIN_VA_LIST HAVE_PTRDIFF_H HAVE_WCHAR_H HAVE_STDLIB_H EXE OCAML_ANNOT_OPTION OCAMLWIN32 OCAMLLIB OCAMLVERSION OCAMLBEST LABLGTK_VERSION HAS_LANDMARKS HAS_MPFR HAS_APRON DEVELOPMENT VERBOSEMAKE PLATFORM DOT HAS_DOT HAS_LABLGTK LABLGTK HAS_GNOMECANVAS GNOMECANVAS HAS_GTKSOURCEVIEW GTKSOURCEVIEW COQC HAS_WHY3 WHY3 ENABLE_WP ENABLE_VARIADIC ENABLE_STUDIA SERVER_ZMQ HAS_OCAML_ZMQ OCAML_ZMQ ENABLE_SERVER ENABLE_SECURITY_SLICING ENABLE_REPORT ENABLE_QED ENABLE_PRINT_API ENABLE_OBFUSCATOR ENABLE_NONTERM HAS_OCAML_PPX_DERIVING_YOJSON OCAML_PPX_DERIVING_YOJSON HAS_OCAML_PPX_DERIVING OCAML_PPX_DERIVING ENABLE_MDR ENABLE_LOOP_ANALYSIS MAY_RUN_TESTS LTLIBOBJS LIBOBJS HAVE_DOT DOXYGEN UNAME ENABLE_E_ACSL LTLTOBA HAS_LTLTOBA ENABLE_AORAI ENABLE_EVA ENABLE_USERS ENABLE_SPARECODE ENABLE_SLICING ENABLE_SCOPE ENABLE_RTEGEN ENABLE_POSTDOMINATORS ENABLE_PDG ENABLE_OCCURRENCE ENABLE_METRICS ENABLE_INOUT ENABLE_IMPACT ENABLE_GUI ENABLE_FROM_ANALYSIS ENABLE_SEMANTIC_CONSTANT_FOLDING ENABLE_CALLGRAPH EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC CYGPATH OTAGS OCAMLMKTOP OCAMLDOC OCAMLCP OCAMLYACC OCAMLLEXDOTOPT OCAMLLEX OCAMLDEP OCAMLFIND OCAMLOPT HAS_OCAML408 HAS_OCAML407 OCAMLPATCHNB OCAMLMINORNB OCAMLMAJORNB OCAMLC MAKE FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_verbosemake enable_devel_mode enable_landmarks with_cc enable_localmachdep with_cpp with_no_plugin enable_callgraph enable_semantic_constant_folding enable_from_analysis enable_gui enable_impact enable_inout enable_metrics enable_occurrence enable_pdg enable_postdominators enable_rtegen enable_scope enable_slicing enable_sparecode enable_users enable_eva enable_external enable_aorai enable_e_acsl enable_loop_analysis enable_mdr enable_nonterm enable_obfuscator enable_print_api enable_qed enable_report enable_security_slicing enable_server enable_server_zmq enable_studia enable_variadic enable_wp enable_wp_coq enable_lablgtk3 ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-verbosemake verbose makefile commands --enable-devel-mode force the devel mode (warnings and warn-error). --disable-devel-mode force the distrib mode (no warnings and no warn-error). --enable-landmarks enable landmarks profiling (default: yes if package installed) --enable-localmachdep enable local machdep configuration --enable-callgraph support for callgraph plugin (default: yes) --enable-semantic_constant_folding support for constant propagation plugin (default: yes) --enable-from_analysis support for from analysis (default: yes) --enable-gui support for gui (default: yes) --enable-impact support for impact plugin (default: yes) --enable-inout support for inout analysis (default: yes) --enable-metrics support for metrics analysis (default: yes) --enable-occurrence support for occurrence analysis (default: yes) --enable-pdg support for pdg plugin (default: yes) --enable-postdominators support for postdominators plugin (default: yes) --enable-rtegen support for runtime error annotation (default: yes) --enable-scope support for scope plugin (default: yes) --enable-slicing support for slicing plugin (default: yes) --enable-sparecode support for sparecode plugin (default: yes) --enable-users support for users analysis (default: yes) --enable-eva support for value analysis (default: yes) --enable-external=plugin allows to compile directly from Frama-C kernel some external plug-ins. --enable-aorai support for Aorai plug-in (default: yes) --enable-e_acsl support for E-ACSL plug-in (default: yes) --enable-loop_analysis support for loop analysis plug-in (default: yes) --enable-mdr Markdown/SARIF report plug-in (default: yes) --enable-nonterm support for nonterm plug-in (default: yes) --enable-obfuscator support for Obfuscator plug-in (default: yes) --enable-print_api support for print_api plug-in (default: yes) --enable-qed support for qed plug-in (default: yes) --enable-report support for report plug-in (default: yes) --enable-security_slicing support for Security_slicing plug-in (default: yes) --enable-server Server plug-in (default: yes) --enable-server-zmq Server ZeroMQ support (default: yes) --enable-studia support for studia plug-in (default: yes) --enable-variadic support for variadic plug-in (default: yes) --enable-wp WP plug-in (default: yes) --enable-wp-coq Wp precompiled Coq libraries (default: yes) --disable-lablgtk3 in case lablgtk2 and lablgtk3 are available, the default is to compile against lablgtk3. Use this option to force compiling against lablgtk2 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) specifies a custom C compiler and pre-processor --with-cpp customize default preprocessor for Frama-C --with-no-plugin disable all plug-ins (default: no) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # AC_ARG_WITH(frama-c, # AC_HELP_STRING([Frama-C executable name (default is 'frama-c')]), # [FRAMA_C=$withval], # [FRAMA_C=frama-c]) # AC_ARG_WITH(frama-c-gui, # AC_HELP_STRING([Frama-C executable name (default is 'frama-c')]), # [FRAMA_C_GUI=$withval], # [FRAMA_C_GUI=frama-c-gui]) upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } FRAMAC_VERSION=`cat VERSION` # export CYGWIN=nobinmode ########################## # Check for Make version # ########################## new_section "configure make" for ac_prog in gmake make do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MAKE+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MAKE"; then ac_cv_prog_MAKE="$MAKE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MAKE="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MAKE=$ac_cv_prog_MAKE if test -n "$MAKE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5 $as_echo "$MAKE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MAKE" && break done test -n "$MAKE" || MAKE="make" { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of make" >&5 $as_echo_n "checking version of make... " >&6; } MAKE_DISTRIB=`sh -c "$MAKE -v | sed -n -e 's/\(.*\) Make.*$/\1/p'"` MAKE_MAJOR=`sh -c "$MAKE -v | sed -n -f bin/sed_get_make_major"` MAKE_MINOR=`sh -c "$MAKE -v | sed -n -f bin/sed_get_make_minor"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE_MAJOR.$MAKE_MINOR" >&5 $as_echo "$MAKE_MAJOR.$MAKE_MINOR" >&6; } if test "$MAKE_DISTRIB" != GNU -o "$MAKE_MAJOR" -lt 3 \ -o "$MAKE_MAJOR" = 3 -a "$MAKE_MINOR" -lt 81 then as_fn_error $? "unsupported version; GNU Make version 3.81 or higher is required." "$LINENO" 5; fi # verbosemake feature # Check whether --enable-verbosemake was given. if test "${enable_verbosemake+set}" = set; then : enableval=$enable_verbosemake; VERBOSEMAKE=$enableval else VERBOSEMAKE=no fi if test "$VERBOSEMAKE" = yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Make will be verbose." >&5 $as_echo "Make will be verbose." >&6; } fi ########################################## # Check for invalid command-line options # ########################################## case $prefix in *\ * ) as_fn_error $? "spaces not allowed in --prefix argument \"$prefix\"" "$LINENO" 5;; * ) ;; esac ############################# # Check for Ocaml compilers # ############################# new_section "configure ocaml compilers" # we first look for ocamlc in the path; if not present, we fail # Extract the first word of "ocamlc", so it can be a program name with args. set dummy ocamlc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLC"; then ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLC="ocamlc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLC" && ac_cv_prog_OCAMLC="no" fi fi OCAMLC=$ac_cv_prog_OCAMLC if test -n "$OCAMLC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 $as_echo "$OCAMLC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLC" = no ; then as_fn_error $? "Cannot find ocamlc." "$LINENO" 5 fi # we extract Ocaml version number and library path # "sed -n" is the posix version of "sed --quiet" { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of OCaml" >&5 $as_echo_n "checking version of OCaml... " >&6; } OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLVERSION" >&5 $as_echo "$OCAMLVERSION" >&6; } case $OCAMLVERSION in 0.*|1.*|2.*|3.*|4.00.*|4.01.*|4.02.*|4.03.*|4.04.*) as_fn_error $? "Incompatible OCaml version; use 4.05+." "$LINENO" 5;; *) OCAML_ANNOT_OPTION="-bin-annot";; esac OCAMLMAJORNB=$(echo $OCAMLVERSION | cut -f 1 -d .) OCAMLMINORNB=$(echo $OCAMLVERSION | cut -f 2 -d .) OCAMLPATCHNB=$(echo $OCAMLVERSION | cut -f 3 -d .) if test $OCAMLMAJORNB -gt 4; then HAS_OCAML407=yes; HAS_OCAML408=yes; else HAS_OCAML407=no; HAS_OCAML408=no; if test $OCAMLMINORNB -ge 7; then HAS_OCAML407=yes; fi; if test $OCAMLMINORNB -ge 8; then HAS_OCAML408=yes; fi; fi; # MAJORNB -gt 4 # Ocaml library path { $as_echo "$as_me:${as_lineno-$LINENO}: checking OCaml library path" >&5 $as_echo_n "checking OCaml library path... " >&6; } OCAMLLIB=`$OCAMLC -where | tr -d '\\r'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLIB" >&5 $as_echo "$OCAMLLIB" >&6; } # then we look for ocamlopt; if not present, we issue a warning # if the version or the stdlib directory is not the same, we also discard it # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not # Extract the first word of "ocamlopt", so it can be a program name with args. set dummy ocamlopt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLOPT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLOPT"; then ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLOPT="ocamlopt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLOPT" && ac_cv_prog_OCAMLOPT="no" fi fi OCAMLOPT=$ac_cv_prog_OCAMLOPT if test -n "$OCAMLOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 $as_echo "$OCAMLOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi OCAMLBEST=byte if test "$OCAMLOPT" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 $as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking ocamlopt version and standard library" >&5 $as_echo_n "checking ocamlopt version and standard library... " >&6; } TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'` if test "$TMPVERSION" != "$OCAMLVERSION" \ -o `$OCAMLOPT -where | tr -d '\\r'` != "$OCAMLLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: differs from ocamlc; ocamlopt discarded." >&5 $as_echo "differs from ocamlc; ocamlopt discarded." >&6; } OCAMLOPT=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } OCAMLBEST=opt fi fi # In case we have a native compiler, check that native dynlink works. # Otherwise, fall back to bytecode-only compilation if test "$OCAMLBEST" = opt; then echo "let f x y =" > test_dynlink.ml echo " Dynlink.loadfile \"foo\"; " >> test_dynlink.ml echo " ignore (Dynlink.is_native);" >> test_dynlink.ml echo " abs_float (x -. y)" >> test_dynlink.ml if ($OCAMLOPT -shared -linkall -o test_dynlink.cmxs test_dynlink.ml) \ 2> /dev/null ; \ then { $as_echo "$as_me:${as_lineno-$LINENO}: result: native dynlink works fine. Great." >&5 $as_echo "native dynlink works fine. Great." >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Native dynlink does not work, disabling native compilation." >&5 $as_echo "$as_me: WARNING: Native dynlink does not work, disabling native compilation." >&2;} OCAMLBEST=byte fi rm -f test_dynlink.* fi if test "$OCAMLBEST" = "opt"; then LIB_SUFFIX=cmxa DYN_SUFFIX=cmxs OBJ_SUFFIX=cmx; else LIB_SUFFIX=cma DYN_SUFFIX=cma OBJ_SUFFIX=cmo; fi # checking for ocamlfind # Extract the first word of "ocamlfind", so it can be a program name with args. set dummy ocamlfind; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLFIND+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLFIND"; then ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLFIND="ocamlfind" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLFIND" && ac_cv_prog_OCAMLFIND="no" fi fi OCAMLFIND=$ac_cv_prog_OCAMLFIND if test -n "$OCAMLFIND"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5 $as_echo "$OCAMLFIND" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLFIND" != no ; then OCAMLC="$OCAMLFIND ocamlc" OCAMLOPT="$OCAMLFIND ocamlopt" else as_fn_error $? "Cannot find ocamlfind." "$LINENO" 5 fi ################################################### # Select devel compilation (warnings, warn-error) # ################################################### # It is inherited by the plugins if test -e ".for_devel"; then DEFAULT_DEVEL_MODE=yes else DEFAULT_DEVEL_MODE=no fi # Check whether --enable-devel-mode was given. if test "${enable_devel_mode+set}" = set; then : enableval=$enable_devel_mode; DEVELOPMENT=$enableval else DEVELOPMENT=$DEFAULT_DEVEL_MODE fi if test "$DEVELOPMENT" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: Development mode: warnings and warn-errors are activated" >&5 $as_echo "$as_me: Development mode: warnings and warn-errors are activated" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: Distribution mode: all warnings are deactivated" >&5 $as_echo "$as_me: Distribution mode: all warnings are deactivated" >&6;} fi ############################################## # Check for other mandatory tools/libraries # ############################################## new_section "configure mandatory tools and libraries" # ocamldep # Extract the first word of "ocamldep", so it can be a program name with args. set dummy ocamldep; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLDEP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLDEP"; then ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLDEP="ocamldep" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLDEP" && ac_cv_prog_OCAMLDEP="no" fi fi OCAMLDEP=$ac_cv_prog_OCAMLDEP if test -n "$OCAMLDEP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 $as_echo "$OCAMLDEP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLDEP" = no ; then as_fn_error $? "Cannot find ocamldep." "$LINENO" 5 else OCAMLDEP="$OCAMLFIND ocamldep" fi # ocamllex # Extract the first word of "ocamllex", so it can be a program name with args. set dummy ocamllex; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLLEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLLEX"; then ac_cv_prog_OCAMLLEX="$OCAMLLEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLLEX="ocamllex" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLLEX" && ac_cv_prog_OCAMLLEX="no" fi fi OCAMLLEX=$ac_cv_prog_OCAMLLEX if test -n "$OCAMLLEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEX" >&5 $as_echo "$OCAMLLEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLLEX" = no ; then as_fn_error $? "Cannot find ocamllex." "$LINENO" 5 else # Extract the first word of "ocamllex.opt", so it can be a program name with args. set dummy ocamllex.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLLEXDOTOPT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLLEXDOTOPT"; then ac_cv_prog_OCAMLLEXDOTOPT="$OCAMLLEXDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLLEXDOTOPT="ocamllex.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLLEXDOTOPT" && ac_cv_prog_OCAMLLEXDOTOPT="no" fi fi OCAMLLEXDOTOPT=$ac_cv_prog_OCAMLLEXDOTOPT if test -n "$OCAMLLEXDOTOPT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLLEXDOTOPT" >&5 $as_echo "$OCAMLLEXDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLLEXDOTOPT" != no ; then OCAMLLEX=$OCAMLLEXDOTOPT fi fi # ocamlyacc # Extract the first word of "ocamlyacc", so it can be a program name with args. set dummy ocamlyacc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLYACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLYACC"; then ac_cv_prog_OCAMLYACC="$OCAMLYACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLYACC="ocamlyacc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLYACC" && ac_cv_prog_OCAMLYACC="no" fi fi OCAMLYACC=$ac_cv_prog_OCAMLYACC if test -n "$OCAMLYACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLYACC" >&5 $as_echo "$OCAMLYACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLYACC" = no ; then as_fn_error $? "Cannot find ocamlyacc." "$LINENO" 5 fi # ocamlcp # Extract the first word of "ocamlcp", so it can be a program name with args. set dummy ocamlcp; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLCP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLCP"; then ac_cv_prog_OCAMLCP="$OCAMLCP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLCP="ocamlcp" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLCP" && ac_cv_prog_OCAMLCP="no" fi fi OCAMLCP=$ac_cv_prog_OCAMLCP if test -n "$OCAMLCP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCP" >&5 $as_echo "$OCAMLCP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLCP" = no ; then as_fn_error $? "Cannot find ocamlcp." "$LINENO" 5 else OCAMLCP="$OCAMLFIND ocamlcp" fi # ocamlgraph ############ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ocamlgraph" >&5 $as_echo_n "checking for ocamlgraph... " >&6; } OCAMLGRAPH=$($OCAMLFIND query ocamlgraph -format %v) if test -z "$OCAMLGRAPH" ; then as_fn_error $? "Cannot find ocamlgraph via ocamlfind \ (requires ocamlgraph 1.8.5 or higher)." "$LINENO" 5 fi case $OCAMLGRAPH in 0.* | 1.[01234567].* \ | 1.8.0 | 1.8.0+dev \ | 1.8.1 | 1.8.1+dev \ | 1.8.2 | 1.8.2+dev \ | 1.8.3 | 1.8.3+dev \ | 1.8.4 | 1.8.4+dev) as_fn_error $? "found $OCAMLGRAPH: requires 1.8.5 or higher." "$LINENO" 5;; 1.8.5 | 1.8.6 | 1.8.7) { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; };; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $OCAMLGRAPH: should work" >&5 $as_echo "found $OCAMLGRAPH: should work" >&6; };; esac # zarith ######## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zarith" >&5 $as_echo_n "checking for zarith... " >&6; } ZARITH=$($OCAMLFIND query zarith -format %v) if test -z "$ZARITH" ; then as_fn_error $? "Cannot find zarith via ocamlfind." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $ZARITH" >&5 $as_echo "found $ZARITH" >&6; } fi # yojson ######## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Yojson" >&5 $as_echo_n "checking for Yojson... " >&6; } YOJSON=$($OCAMLFIND query yojson -format %v) if test -z "$YOJSON" ; then as_fn_error $? "Cannot find yojson via ocamlfind \ (requires yojson 1.4.1 or higher)." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $YOJSON" >&5 $as_echo "found $YOJSON" >&6; } fi ################################################# # Check for other (optional) tools/libraries # ################################################# new_section "configure optional tools and libraries" # Extract the first word of "ocamldoc", so it can be a program name with args. set dummy ocamldoc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLDOC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLDOC"; then ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLDOC="ocamldoc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLDOC" && ac_cv_prog_OCAMLDOC="no" fi fi OCAMLDOC=$ac_cv_prog_OCAMLDOC if test -n "$OCAMLDOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5 $as_echo "$OCAMLDOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLDOC" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ocamldoc discarded not present" >&5 $as_echo "ocamldoc discarded not present" >&6; } else OCAMLDOC="$OCAMLFIND ocamldoc" fi # Extract the first word of "ocamlmktop", so it can be a program name with args. set dummy ocamlmktop; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OCAMLMKTOP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OCAMLMKTOP"; then ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OCAMLMKTOP="ocamlmktop" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_OCAMLMKTOP" && ac_cv_prog_OCAMLMKTOP="no" fi fi OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP if test -n "$OCAMLMKTOP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5 $as_echo "$OCAMLMKTOP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$OCAMLMKTOP" = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Cannot find ocamlmktop: toplevels cannot be built." >&5 $as_echo "Cannot find ocamlmktop: toplevels cannot be built." >&6; } else OCAMLMKTOP="$OCAMLFIND ocamlmktop" fi # Extract the first word of "otags", so it can be a program name with args. set dummy otags; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTAGS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTAGS"; then ac_cv_prog_OTAGS="$OTAGS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTAGS="otags" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTAGS=$ac_cv_prog_OTAGS if test -n "$OTAGS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTAGS" >&5 $as_echo "$OTAGS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # apron ######## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Apron" >&5 $as_echo_n "checking for Apron... " >&6; } APRON_PATH=$($OCAMLFIND query apron 2>/dev/null | tr -d '\r\n') if test -f "$APRON_PATH/apron.$DYN_SUFFIX"; then HAS_APRON="yes"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else HAS_APRON="no"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found. The corresponding domains won't be available in Eva" >&5 $as_echo "not found. The corresponding domains won't be available in Eva" >&6; } fi; # mpfr ####### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPFR" >&5 $as_echo_n "checking for MPFR... " >&6; } MPFR_PATH=$($OCAMLFIND query gmp 2>/dev/null | tr -d '\r\n') if test -f "$MPFR_PATH/gmp.$DYN_SUFFIX" -a -f "$MPFR_PATH/mpfr.cmx" ; then HAS_MPFR="yes"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else HAS_MPFR="no"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found. The numerors domain won't be available in Eva" >&5 $as_echo "not found. The numerors domain won't be available in Eva" >&6; } fi; # landmarks (profiling tool, for developers) ######## # Check whether --enable-landmarks was given. if test "${enable_landmarks+set}" = set; then : enableval=$enable_landmarks; ENABLE_LANDMARKS=$enableval else ENABLE_LANDMARKS=yes fi if test "$ENABLE_LANDMARKS" = yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Landmarks" >&5 $as_echo_n "checking for Landmarks... " >&6; } LANDMARKS_PATH=$($OCAMLFIND query landmarks 2>/dev/null | tr -d '\r\n') LANDMARKS_PPX_PATH=$($OCAMLFIND query landmarks.ppx 2>/dev/null | tr -d '\r\n') if test -f "$LANDMARKS_PATH/landmark.$DYN_SUFFIX" -a -f "$LANDMARKS_PPX_PATH/ppx_landmarks.$DYN_SUFFIX"; then HAS_LANDMARKS="yes"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else HAS_LANDMARKS="no"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found." >&5 $as_echo "not found." >&6; } fi; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Landmarks profiling disabled" >&5 $as_echo "Landmarks profiling disabled" >&6; }; HAS_LANDMARKS="no" fi ############ # Platform # ############ new_section "configure platform" { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5 $as_echo_n "checking platform... " >&6; } # get Sys.os_type as OCAML_OS_TYPE echo "let () = print_string Sys.os_type;;" > test_os_type.ml $OCAMLC -o test_os_type test_os_type.ml OCAML_OS_TYPE=$(./test_os_type) rm -f test_os_type.cmi test_os_type.cmo test_os_type.ml test_os_type if test "$OCAML_OS_TYPE" = "Win32"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Win32" >&5 $as_echo "Win32" >&6; } # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CYGPATH+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="no" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 $as_echo "$CYGPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi PLATFORM=Win32 OCAMLWIN32=yes EXE=.exe else OCAMLWIN32=no if test "$OCAML_OS_TYPE" = "Cygwin"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Cygwin" >&5 $as_echo "Cygwin" >&6; } PLATFORM=Cygwin EXE=.exe else if test $(uname -s) = "Darwin"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: MacOS" >&5 $as_echo "MacOS" >&6; } PLATFORM=MacOS else { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unix" >&5 $as_echo "Unix" >&6; } PLATFORM=Unix fi EXE= fi fi # C and POSIX standard headers used by C bindings. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Check whether --with-cc was given. if test "${with_cc+set}" = set; then : withval=$with_cc; CC=$withval fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done for ac_header in assert.h do : ac_fn_c_check_header_mongrel "$LINENO" "assert.h" "ac_cv_header_assert_h" "$ac_includes_default" if test "x$ac_cv_header_assert_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ASSERT_H 1 _ACEOF fi done for ac_header in float.h do : ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" if test "x$ac_cv_header_float_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FLOAT_H 1 _ACEOF fi done for ac_header in math.h do : ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" if test "x$ac_cv_header_math_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MATH_H 1 _ACEOF fi done for ac_header in signal.h do : ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" if test "x$ac_cv_header_signal_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGNAL_H 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done # Local machdep feature (to generate new platforms) # Check whether --enable-localmachdep was given. if test "${enable_localmachdep+set}" = set; then : enableval=$enable_localmachdep; LOCAL_MACHDEP=$enableval else LOCAL_MACHDEP=no fi if test "$LOCAL_MACHDEP" = yes ; then ac_config_headers="$ac_config_headers config.h" for ac_header in wchar.h do : ac_fn_c_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" if test "x$ac_cv_header_wchar_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WCHAR_H 1 _ACEOF fi done # Find out the true definitions of some integer types # checkIntegerype(size_t) will echo "int" or "long" checkIntegerType() { fn="testtype.c" fo="testtype.o" for t in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" ;do echo "#include " >$fn echo "#include " >>$fn # We define a prototype with one type and the function with # another type. This will result in compilation error # unless the types are really identical echo "$t foo($t x);" >>$fn echo "$1 foo($1 x) { return x;}" >>$fn if gcc -c $fn 2>/dev/null ;then # Found it echo $t rm -f $fn $fo return fi done rm -f $fn $fo } { $as_echo "$as_me:${as_lineno-$LINENO}: checking definition of size_t" >&5 $as_echo_n "checking definition of size_t... " >&6; } TYPE_SIZE_T=`checkIntegerType "size_t"` if test "x$TYPE_SIZE_T" = "x" ;then as_fn_error $? "Cannot find definition of size_t" "$LINENO" 5 fi cat >>confdefs.h <<_ACEOF #define TYPE_SIZE_T "$TYPE_SIZE_T" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TYPE_SIZE_T" >&5 $as_echo "$TYPE_SIZE_T" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking definition of wchar_t" >&5 $as_echo_n "checking definition of wchar_t... " >&6; } TYPE_WCHAR_T=`checkIntegerType "wchar_t"` if test "x$TYPE_WCHAR_T" = "x" ;then as_fn_error $? "Cannot find definition of wchar_t" "$LINENO" 5 fi cat >>confdefs.h <<_ACEOF #define TYPE_WCHAR_T "$TYPE_WCHAR_T" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TYPE_WCHAR_T" >&5 $as_echo "$TYPE_WCHAR_T" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking definition of ptrdiff_t" >&5 $as_echo_n "checking definition of ptrdiff_t... " >&6; } TYPE_PTRDIFF_T=`checkIntegerType "ptrdiff_t"` if test "x$TYPE_PTRDIFF_T" = "x" ;then as_fn_error $? "Cannot find definition of ptrdiff_t" "$LINENO" 5 fi cat >>confdefs.h <<_ACEOF #define TYPE_PTRDIFF_T "$TYPE_PTRDIFF_T" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TYPE_PTRDIFF_T" >&5 $as_echo "$TYPE_PTRDIFF_T" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc version" >&5 $as_echo_n "checking for gcc version... " >&6; } ac_fn_c_check_type "$LINENO" "__builtin_va_list" "ac_cv_type___builtin_va_list" "$ac_includes_default" if test "x$ac_cv_type___builtin_va_list" = xyes; then : HAVE_BUILTIN_VA_LIST=true else HAVE_BUILTIN_VA_LIST=false fi if test "$HAVE_BUILTIN_VA_LIST" = "true" ;then cat >>confdefs.h <<_ACEOF #define HAVE_BUILTIN_VA_LIST 1 _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if __thread is a keyword" >&5 $as_echo_n "checking if __thread is a keyword... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(int __thread) { return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : THREAD_IS_KEYWORD=false else THREAD_IS_KEYWORD=true fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THREAD_IS_KEYWORD" >&5 $as_echo "$THREAD_IS_KEYWORD" >&6; } if test "$THREAD_IS_KEYWORD" = "true" ;then cat >>confdefs.h <<_ACEOF #define THREAD_IS_KEYWORD 1 _ACEOF fi # Does gcc add underscores to identifiers to make assembly labels? # (I think MSVC always does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc adds underscores to assembly labels." >&5 $as_echo_n "checking if gcc adds underscores to assembly labels.... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main() { __asm__("jmp _main"); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : UNDERSCORE_NAME=true else UNDERSCORE_NAME=false fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNDERSCORE_NAME" >&5 $as_echo "$UNDERSCORE_NAME" >&6; } if test "$UNDERSCORE_NAME" = "true" ;then cat >>confdefs.h <<_ACEOF #define UNDERSCORE_NAME 1 _ACEOF fi fi # local machdep configuration ################################### # Frama-C's pre-processor support # ################################### # Specific preprocessor support # Check whether --with-cpp was given. if test "${with_cpp+set}" = set; then : withval=$with_cpp; FRAMAC_DEFAULT_CPP=$withval else FRAMAC_DEFAULT_CPP= fi # if no specific pre-processor has been given, check whether we can use # $CC. Note that we want to keep comments in the output, so that AC_PROG_CPP # alone is not sufficient. if test -z "$FRAMAC_DEFAULT_CPP"; then ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CPPFLAGS="-C -I."; if test -n "$GCC"; then FRAMAC_GNU_CPP=true; else FRAMAC_GNU_CPP=false; fi else CPP=$FRAMAC_DEFAULT_CPP; FRAMAC_GNU_CPP=true; CPPFLAGS="-dD -nostdinc" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define foo 0 /* foo */ _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : FRAMAC_GNU_CPP=true else FRAMAC_GNU_CPP=false fi rm -f conftest.err conftest.i conftest.$ac_ext CPPFLAGS= fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Check whether comments are kept in output */ _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : if test -e conftest.i; then if grep -e kept conftest.i; then FRAMAC_DEFAULT_CPP="$CPP $CPPFLAGS"; DEFAULT_CPP_KEEP_COMMENTS=true; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Default pre-processing command '$CPP' do not preserve comments. Please define an appropriate pre-processor with --with-cpp, or you will only be able to use ACSL annotations in already pre-processed files" >&5 $as_echo "$as_me: WARNING: Default pre-processing command '$CPP' do not preserve comments. Please define an appropriate pre-processor with --with-cpp, or you will only be able to use ACSL annotations in already pre-processed files" >&2;} FRAMAC_DEFAULT_CPP=$CPP; DEFAULT_CPP_KEEP_COMMENTS=false; fi; else # handling old version of autoconf (<2.67) that does not keep # preprocessor result in conftest.i { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to check whether $CPP preserves comments. Assuming everything is fine" >&5 $as_echo "$as_me: WARNING: Unable to check whether $CPP preserves comments. Assuming everything is fine" >&2;} FRAMAC_DEFAULT_CPP="$CPP $CPPFLAGS"; DEFAULT_CPP_KEEP_COMMENTS=true; fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to find a working pre-processor. Please define one with --with-cpp, or you will be able to launch Frama-C only on pre-processed files" >&5 $as_echo "$as_me: WARNING: Unable to find a working pre-processor. Please define one with --with-cpp, or you will be able to launch Frama-C only on pre-processed files" >&2;}; FRAMAC_DEFAULT_CPP=""; DEFAULT_CPP_KEEP_COMMENTS=false; fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: Default preprocessor is '$FRAMAC_DEFAULT_CPP'." >&5 $as_echo "Default preprocessor is '$FRAMAC_DEFAULT_CPP'." >&6; } FRAMAC_DEFAULT_CPP_ARGS=$CPPFLAGS # Test if preprocessor supports options such as -m16/-m32/-m64 DEFAULT_CPP_SUPPORTED_ARCH_OPTS= # Store original value of CPPFLAGS before doing tests OLD_CPPFLAGS=$CPPFLAGS rm -f conftest.i CPPFLAGS="$OLD_CPPFLAGS -m32" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Check if preprocessor supports option -m32 */ _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : if test -e conftest.i; then DEFAULT_CPP_SUPPORTED_ARCH_OPTS+='\"-m32\"; '; fi fi rm -f conftest.err conftest.i conftest.$ac_ext rm -f conftest.i CPPFLAGS="$OLD_CPPFLAGS -m64" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Check if preprocessor supports option -m64 */ _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : if test -e conftest.i; then DEFAULT_CPP_SUPPORTED_ARCH_OPTS+='\"-m64\"; '; fi fi rm -f conftest.err conftest.i conftest.$ac_ext rm -f conftest.i CPPFLAGS="$OLD_CPPFLAGS -m16" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Check if preprocessor supports option -m16 */ _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : if test -e conftest.i; then DEFAULT_CPP_SUPPORTED_ARCH_OPTS+='\"-m16\"; '; fi fi rm -f conftest.err conftest.i conftest.$ac_ext # revert CPPFLAGS to original value CPPFLAGS=$OLD_CPPFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: result: Default preprocessor supported architecture-related options: $DEFAULT_CPP_SUPPORTED_ARCH_OPTS" >&5 $as_echo "Default preprocessor supported architecture-related options: $DEFAULT_CPP_SUPPORTED_ARCH_OPTS" >&6; } ################# # Plugin wished # ################# new_section "wished frama-c plug-ins" # Option -with-no-plugin ####################### # Check whether --with-no-plugin was given. if test "${with_no_plugin+set}" = set; then : withval=$with_no_plugin; ONLY_KERNEL=$withval else ONLY_KERNEL=no fi # library declarations ###################### # REQUIRE_LIBRARY: library *must* be present in order to build plugins # USE_LIBRARY: better for plugins if library is present, but not required # HAS_LIBRARY: is the library available? REQUIRE_LABLGTK= USE_LABLGTK= HAS_LABLGTK= # Tool declarations #################### DOT= REQUIRE_DOT= USE_DOT= HAS_DOT= ### Now plugin declarations PLUGINS_FORCE_LIST= ############################################################################### # # #################### # # Plug-in sections # # #################### # # # # For 'internal' developers: # # Add your own plug-in here # # # ############################################################################### # callgraph ########### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/callgraph" >&5 $as_echo_n "checking for src/plugins/callgraph... " >&6; } if ${ac_cv_file_src_plugins_callgraph+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/callgraph"; then ac_cv_file_src_plugins_callgraph=yes else ac_cv_file_src_plugins_callgraph=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_callgraph" >&5 $as_echo "$ac_cv_file_src_plugins_callgraph" >&6; } if test "x$ac_cv_file_src_plugins_callgraph" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-callgraph was given. if test "${enable_callgraph+set}" = set; then : enableval=$enable_callgraph; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "callgraph is not available" "$LINENO" 5 fi FORCE_CALLGRAPH=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_CALLGRAPH ENABLE_CALLGRAPH=$ENABLE NAME_CALLGRAPH=callgraph if test "$default" = "no" -a "$FORCE" = "no"; then INFO_CALLGRAPH=" (not available by default)" fi echo "callgraph... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) USE_DOT=$USE_DOT" "callgraph USE_GUI=$USE_GUI" "callgraph USED_CALLGRAPH=$USED_CALLGRAPH" "gui USE_EVA=$USE_EVA" "callgraph USED_CALLGRAPH=$USED_CALLGRAPH" "eva # constant propagation ###################### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/constant_propagation" >&5 $as_echo_n "checking for src/plugins/constant_propagation... " >&6; } if ${ac_cv_file_src_plugins_constant_propagation+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/constant_propagation"; then ac_cv_file_src_plugins_constant_propagation=yes else ac_cv_file_src_plugins_constant_propagation=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_constant_propagation" >&5 $as_echo "$ac_cv_file_src_plugins_constant_propagation" >&6; } if test "x$ac_cv_file_src_plugins_constant_propagation" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-semantic_constant_folding was given. if test "${enable_semantic_constant_folding+set}" = set; then : enableval=$enable_semantic_constant_folding; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "semantic_constant_folding is not available" "$LINENO" 5 fi FORCE_SEMANTIC_CONSTANT_FOLDING=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_SEMANTIC_CONSTANT_FOLDING ENABLE_SEMANTIC_CONSTANT_FOLDING=$ENABLE NAME_SEMANTIC_CONSTANT_FOLDING=semantic_constant_folding if test "$default" = "no" -a "$FORCE" = "no"; then INFO_SEMANTIC_CONSTANT_FOLDING=" (not available by default)" fi echo "semantic_constant_folding... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_EVA=$REQUIRE_EVA" "semantic_constant_folding REQUIRED_SEMANTIC_CONSTANT_FOLDING=$REQUIRED_SEMANTIC_CONSTANT_FOLDING" "eva # from ###### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/from" >&5 $as_echo_n "checking for src/plugins/from... " >&6; } if ${ac_cv_file_src_plugins_from+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/from"; then ac_cv_file_src_plugins_from=yes else ac_cv_file_src_plugins_from=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_from" >&5 $as_echo "$ac_cv_file_src_plugins_from" >&6; } if test "x$ac_cv_file_src_plugins_from" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-from_analysis was given. if test "${enable_from_analysis+set}" = set; then : enableval=$enable_from_analysis; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "from_analysis is not available" "$LINENO" 5 fi FORCE_FROM_ANALYSIS=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_FROM_ANALYSIS ENABLE_FROM_ANALYSIS=$ENABLE NAME_FROM_ANALYSIS=from_analysis if test "$default" = "no" -a "$FORCE" = "no"; then INFO_FROM_ANALYSIS=" (not available by default)" fi echo "from_analysis... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_EVA=$REQUIRE_EVA" "from_analysis REQUIRED_FROM_ANALYSIS=$REQUIRED_FROM_ANALYSIS" "eva REQUIRE_CALLGRAPH=$REQUIRE_CALLGRAPH" "from_analysis REQUIRED_FROM_ANALYSIS=$REQUIRED_FROM_ANALYSIS" "callgraph # gui ##### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/gui" >&5 $as_echo_n "checking for src/plugins/gui... " >&6; } if ${ac_cv_file_src_plugins_gui+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/gui"; then ac_cv_file_src_plugins_gui=yes else ac_cv_file_src_plugins_gui=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_gui" >&5 $as_echo "$ac_cv_file_src_plugins_gui" >&6; } if test "x$ac_cv_file_src_plugins_gui" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-gui was given. if test "${enable_gui+set}" = set; then : enableval=$enable_gui; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "gui is not available" "$LINENO" 5 fi FORCE_GUI=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_GUI ENABLE_GUI=$ENABLE NAME_GUI=gui if test "$default" = "no" -a "$FORCE" = "no"; then INFO_GUI=" (not available by default)" fi echo "gui... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_LABLGTK=$REQUIRE_LABLGTK" "gui USE_GNOMECANVAS=$USE_GNOMECANVAS" "gui REQUIRE_GTKSOURCEVIEW=$REQUIRE_GTKSOURCEVIEW" "gui USE_DOT=$USE_DOT" "gui # impact ######## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/impact" >&5 $as_echo_n "checking for src/plugins/impact... " >&6; } if ${ac_cv_file_src_plugins_impact+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/impact"; then ac_cv_file_src_plugins_impact=yes else ac_cv_file_src_plugins_impact=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_impact" >&5 $as_echo "$ac_cv_file_src_plugins_impact" >&6; } if test "x$ac_cv_file_src_plugins_impact" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-impact was given. if test "${enable_impact+set}" = set; then : enableval=$enable_impact; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "impact is not available" "$LINENO" 5 fi FORCE_IMPACT=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_IMPACT ENABLE_IMPACT=$ENABLE NAME_IMPACT=impact if test "$default" = "no" -a "$FORCE" = "no"; then INFO_IMPACT=" (not available by default)" fi echo "impact... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) USE_GUI=$USE_GUI" "impact USED_IMPACT=$USED_IMPACT" "gui USE_SLICING=$USE_SLICING" "impact USED_IMPACT=$USED_IMPACT" "slicing REQUIRE_PDG=$REQUIRE_PDG" "impact REQUIRED_IMPACT=$REQUIRED_IMPACT" "pdg REQUIRE_EVA=$REQUIRE_EVA" "impact REQUIRED_IMPACT=$REQUIRED_IMPACT" "eva REQUIRE_INOUT=$REQUIRE_INOUT" "impact REQUIRED_IMPACT=$REQUIRED_IMPACT" "inout # inout ####### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/inout" >&5 $as_echo_n "checking for src/plugins/inout... " >&6; } if ${ac_cv_file_src_plugins_inout+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/inout"; then ac_cv_file_src_plugins_inout=yes else ac_cv_file_src_plugins_inout=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_inout" >&5 $as_echo "$ac_cv_file_src_plugins_inout" >&6; } if test "x$ac_cv_file_src_plugins_inout" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-inout was given. if test "${enable_inout+set}" = set; then : enableval=$enable_inout; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "inout is not available" "$LINENO" 5 fi FORCE_INOUT=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_INOUT ENABLE_INOUT=$ENABLE NAME_INOUT=inout if test "$default" = "no" -a "$FORCE" = "no"; then INFO_INOUT=" (not available by default)" fi echo "inout... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_FROM_ANALYSIS=$REQUIRE_FROM_ANALYSIS" "inout REQUIRED_INOUT=$REQUIRED_INOUT" "from_analysis REQUIRE_EVA=$REQUIRE_EVA" "inout REQUIRED_INOUT=$REQUIRED_INOUT" "eva REQUIRE_CALLGRAPH=$REQUIRE_CALLGRAPH" "inout REQUIRED_INOUT=$REQUIRED_INOUT" "callgraph # metrics ######### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/metrics" >&5 $as_echo_n "checking for src/plugins/metrics... " >&6; } if ${ac_cv_file_src_plugins_metrics+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/metrics"; then ac_cv_file_src_plugins_metrics=yes else ac_cv_file_src_plugins_metrics=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_metrics" >&5 $as_echo "$ac_cv_file_src_plugins_metrics" >&6; } if test "x$ac_cv_file_src_plugins_metrics" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-metrics was given. if test "${enable_metrics+set}" = set; then : enableval=$enable_metrics; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "metrics is not available" "$LINENO" 5 fi FORCE_METRICS=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_METRICS ENABLE_METRICS=$ENABLE NAME_METRICS=metrics if test "$default" = "no" -a "$FORCE" = "no"; then INFO_METRICS=" (not available by default)" fi echo "metrics... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_EVA=$REQUIRE_EVA" "metrics REQUIRED_METRICS=$REQUIRED_METRICS" "eva USE_GUI=$USE_GUI" "metrics USED_METRICS=$USED_METRICS" "gui # occurrence ############ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/occurrence" >&5 $as_echo_n "checking for src/plugins/occurrence... " >&6; } if ${ac_cv_file_src_plugins_occurrence+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/occurrence"; then ac_cv_file_src_plugins_occurrence=yes else ac_cv_file_src_plugins_occurrence=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_occurrence" >&5 $as_echo "$ac_cv_file_src_plugins_occurrence" >&6; } if test "x$ac_cv_file_src_plugins_occurrence" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-occurrence was given. if test "${enable_occurrence+set}" = set; then : enableval=$enable_occurrence; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "occurrence is not available" "$LINENO" 5 fi FORCE_OCCURRENCE=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_OCCURRENCE ENABLE_OCCURRENCE=$ENABLE NAME_OCCURRENCE=occurrence if test "$default" = "no" -a "$FORCE" = "no"; then INFO_OCCURRENCE=" (not available by default)" fi echo "occurrence... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) USE_GUI=$USE_GUI" "occurrence USED_OCCURRENCE=$USED_OCCURRENCE" "gui REQUIRE_EVA=$REQUIRE_EVA" "occurrence REQUIRED_OCCURRENCE=$REQUIRED_OCCURRENCE" "eva # pdg ##### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/pdg" >&5 $as_echo_n "checking for src/plugins/pdg... " >&6; } if ${ac_cv_file_src_plugins_pdg+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/pdg"; then ac_cv_file_src_plugins_pdg=yes else ac_cv_file_src_plugins_pdg=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_pdg" >&5 $as_echo "$ac_cv_file_src_plugins_pdg" >&6; } if test "x$ac_cv_file_src_plugins_pdg" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-pdg was given. if test "${enable_pdg+set}" = set; then : enableval=$enable_pdg; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "pdg is not available" "$LINENO" 5 fi FORCE_PDG=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_PDG ENABLE_PDG=$ENABLE NAME_PDG=pdg if test "$default" = "no" -a "$FORCE" = "no"; then INFO_PDG=" (not available by default)" fi echo "pdg... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_FROM_ANALYSIS=$REQUIRE_FROM_ANALYSIS" "pdg REQUIRED_PDG=$REQUIRED_PDG" "from_analysis REQUIRE_EVA=$REQUIRE_EVA" "pdg REQUIRED_PDG=$REQUIRED_PDG" "eva REQUIRE_CALLGRAPH=$REQUIRE_CALLGRAPH" "pdg REQUIRED_PDG=$REQUIRED_PDG" "callgraph # postdominators ################ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/postdominators" >&5 $as_echo_n "checking for src/plugins/postdominators... " >&6; } if ${ac_cv_file_src_plugins_postdominators+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/postdominators"; then ac_cv_file_src_plugins_postdominators=yes else ac_cv_file_src_plugins_postdominators=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_postdominators" >&5 $as_echo "$ac_cv_file_src_plugins_postdominators" >&6; } if test "x$ac_cv_file_src_plugins_postdominators" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-postdominators was given. if test "${enable_postdominators+set}" = set; then : enableval=$enable_postdominators; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "postdominators is not available" "$LINENO" 5 fi FORCE_POSTDOMINATORS=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_POSTDOMINATORS ENABLE_POSTDOMINATORS=$ENABLE NAME_POSTDOMINATORS=postdominators if test "$default" = "no" -a "$FORCE" = "no"; then INFO_POSTDOMINATORS=" (not available by default)" fi echo "postdominators... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) # rte ##### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/rte" >&5 $as_echo_n "checking for src/plugins/rte... " >&6; } if ${ac_cv_file_src_plugins_rte+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/rte"; then ac_cv_file_src_plugins_rte=yes else ac_cv_file_src_plugins_rte=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_rte" >&5 $as_echo "$ac_cv_file_src_plugins_rte" >&6; } if test "x$ac_cv_file_src_plugins_rte" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-rtegen was given. if test "${enable_rtegen+set}" = set; then : enableval=$enable_rtegen; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "rtegen is not available" "$LINENO" 5 fi FORCE_RTEGEN=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_RTEGEN ENABLE_RTEGEN=$ENABLE NAME_RTEGEN=rtegen if test "$default" = "no" -a "$FORCE" = "no"; then INFO_RTEGEN=" (not available by default)" fi echo "rtegen... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) # scope ############ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/scope" >&5 $as_echo_n "checking for src/plugins/scope... " >&6; } if ${ac_cv_file_src_plugins_scope+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/scope"; then ac_cv_file_src_plugins_scope=yes else ac_cv_file_src_plugins_scope=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_scope" >&5 $as_echo "$ac_cv_file_src_plugins_scope" >&6; } if test "x$ac_cv_file_src_plugins_scope" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-scope was given. if test "${enable_scope+set}" = set; then : enableval=$enable_scope; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "scope is not available" "$LINENO" 5 fi FORCE_SCOPE=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_SCOPE ENABLE_SCOPE=$ENABLE NAME_SCOPE=scope if test "$default" = "no" -a "$FORCE" = "no"; then INFO_SCOPE=" (not available by default)" fi echo "scope... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_POSTDOMINATORS=$REQUIRE_POSTDOMINATORS" "scope REQUIRED_SCOPE=$REQUIRED_SCOPE" "postdominators REQUIRE_EVA=$REQUIRE_EVA" "scope REQUIRED_SCOPE=$REQUIRED_SCOPE" "eva REQUIRE_FROM_ANALYSIS=$REQUIRE_FROM_ANALYSIS" "scope REQUIRED_SCOPE=$REQUIRED_SCOPE" "from_analysis REQUIRE_PDG=$REQUIRE_PDG" "scope REQUIRED_SCOPE=$REQUIRED_SCOPE" "pdg USE_GUI=$USE_GUI" "scope USED_SCOPE=$USED_SCOPE" "gui # slicing ######### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/slicing" >&5 $as_echo_n "checking for src/plugins/slicing... " >&6; } if ${ac_cv_file_src_plugins_slicing+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/slicing"; then ac_cv_file_src_plugins_slicing=yes else ac_cv_file_src_plugins_slicing=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_slicing" >&5 $as_echo "$ac_cv_file_src_plugins_slicing" >&6; } if test "x$ac_cv_file_src_plugins_slicing" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-slicing was given. if test "${enable_slicing+set}" = set; then : enableval=$enable_slicing; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "slicing is not available" "$LINENO" 5 fi FORCE_SLICING=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_SLICING ENABLE_SLICING=$ENABLE NAME_SLICING=slicing if test "$default" = "no" -a "$FORCE" = "no"; then INFO_SLICING=" (not available by default)" fi echo "slicing... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_FROM_ANALYSIS=$REQUIRE_FROM_ANALYSIS" "slicing REQUIRED_SLICING=$REQUIRED_SLICING" "from_analysis REQUIRE_PDG=$REQUIRE_PDG" "slicing REQUIRED_SLICING=$REQUIRED_SLICING" "pdg REQUIRE_EVA=$REQUIRE_EVA" "slicing REQUIRED_SLICING=$REQUIRED_SLICING" "eva REQUIRE_CALLGRAPH=$REQUIRE_CALLGRAPH" "slicing REQUIRED_SLICING=$REQUIRED_SLICING" "callgraph USE_GUI=$USE_GUI" "slicing USED_SLICING=$USED_SLICING" "gui # spare code ############ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/sparecode" >&5 $as_echo_n "checking for src/plugins/sparecode... " >&6; } if ${ac_cv_file_src_plugins_sparecode+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/sparecode"; then ac_cv_file_src_plugins_sparecode=yes else ac_cv_file_src_plugins_sparecode=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_sparecode" >&5 $as_echo "$ac_cv_file_src_plugins_sparecode" >&6; } if test "x$ac_cv_file_src_plugins_sparecode" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-sparecode was given. if test "${enable_sparecode+set}" = set; then : enableval=$enable_sparecode; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "sparecode is not available" "$LINENO" 5 fi FORCE_SPARECODE=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_SPARECODE ENABLE_SPARECODE=$ENABLE NAME_SPARECODE=sparecode if test "$default" = "no" -a "$FORCE" = "no"; then INFO_SPARECODE=" (not available by default)" fi echo "sparecode... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_PDG=$REQUIRE_PDG" "sparecode REQUIRED_SPARECODE=$REQUIRED_SPARECODE" "pdg REQUIRE_EVA=$REQUIRE_EVA" "sparecode REQUIRED_SPARECODE=$REQUIRED_SPARECODE" "eva # users ####### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/users" >&5 $as_echo_n "checking for src/plugins/users... " >&6; } if ${ac_cv_file_src_plugins_users+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/users"; then ac_cv_file_src_plugins_users=yes else ac_cv_file_src_plugins_users=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_users" >&5 $as_echo "$ac_cv_file_src_plugins_users" >&6; } if test "x$ac_cv_file_src_plugins_users" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-users was given. if test "${enable_users+set}" = set; then : enableval=$enable_users; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "users is not available" "$LINENO" 5 fi FORCE_USERS=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_USERS ENABLE_USERS=$ENABLE NAME_USERS=users if test "$default" = "no" -a "$FORCE" = "no"; then INFO_USERS=" (not available by default)" fi echo "users... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_EVA=$REQUIRE_EVA" "users REQUIRED_USERS=$REQUIRED_USERS" "eva USE_CALLGRAPH=$USE_CALLGRAPH" "users USED_USERS=$USED_USERS" "callgraph # value ####### { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/value" >&5 $as_echo_n "checking for src/plugins/value... " >&6; } if ${ac_cv_file_src_plugins_value+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/value"; then ac_cv_file_src_plugins_value=yes else ac_cv_file_src_plugins_value=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_value" >&5 $as_echo "$ac_cv_file_src_plugins_value" >&6; } if test "x$ac_cv_file_src_plugins_value" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-eva was given. if test "${enable_eva+set}" = set; then : enableval=$enable_eva; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "eva is not available" "$LINENO" 5 fi FORCE_EVA=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_EVA ENABLE_EVA=$ENABLE NAME_EVA=eva if test "$default" = "no" -a "$FORCE" = "no"; then INFO_EVA=" (not available by default)" fi echo "eva... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) USE_GUI=$USE_GUI" "eva USED_EVA=$USED_EVA" "gui USE_SCOPE=$USE_SCOPE" "eva USED_EVA=$USED_EVA" "scope USE_CALLGRAPH=$USE_CALLGRAPH" "eva USED_EVA=$USED_EVA" "callgraph #################### # External plugins # #################### EXTRA_EXTERNAL_PLUGINS= # Check whether --enable-external was given. if test "${enable_external+set}" = set; then : enableval=$enable_external; for dir in $enableval; do if test -d $dir; then { $as_echo "$as_me:${as_lineno-$LINENO}: external plug-in $dir found." >&5 $as_echo "$as_me: external plug-in $dir found." >&6;} EXTRA_EXTERNAL_PLUGINS="$EXTRA_EXTERNAL_PLUGINS $dir" olddir=$(pwd) cd $dir; if test -x ./configure; then new_section "configure plug-in $dir" ./configure --prefix=$prefix --datarootdir=$datarootdir \ --exec_prefix=$exec_prefix --bindir=$bindir --libdir=$datadir/frama-c \ --host=$host --build=$build --mandir=$mandir \ || \ as_fn_error $? "cannot configure requested external plugin in $dir" "$LINENO" 5 fi; cd $olddir else as_fn_error $? "--enable-external expects an existing directory as argument." "$LINENO" 5 fi; done fi ########################################################################## # # # This file is part of Aorai plug-in of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # INRIA (Institut National de Recherche en Informatique et en # # Automatique) # # INSA (Institut National des Sciences Appliquees) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/aorai/Makefile.in" >&5 $as_echo_n "checking for src/plugins/aorai/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_aorai_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/aorai/Makefile.in"; then ac_cv_file_src_plugins_aorai_Makefile_in=yes else ac_cv_file_src_plugins_aorai_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_aorai_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_aorai_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_aorai_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-aorai was given. if test "${enable_aorai+set}" = set; then : enableval=$enable_aorai; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "aorai is not available" "$LINENO" 5 fi FORCE_AORAI=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_AORAI ENABLE_AORAI=$ENABLE NAME_AORAI=aorai if test "$default" = "no" -a "$FORCE" = "no"; then INFO_AORAI=" (not available by default)" fi echo "aorai... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) USE_LTLTOBA=$USE_LTLTOBA" "aorai if test "$ENABLE_AORAI" != "no"; then # ltl2ba library for file in ltl2ba; do HAS_LTLTOBA= # Extract the first word of "$file", so it can be a program name with args. set dummy $file; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAS_LTLTOBA+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAS_LTLTOBA"; then ac_cv_prog_HAS_LTLTOBA="$HAS_LTLTOBA" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAS_LTLTOBA="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAS_LTLTOBA" && ac_cv_prog_HAS_LTLTOBA="no" fi fi HAS_LTLTOBA=$ac_cv_prog_HAS_LTLTOBA if test -n "$HAS_LTLTOBA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_LTLTOBA" >&5 $as_echo "$HAS_LTLTOBA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$HAS_LTLTOBA" = "yes"; then SELECTED_VAR=$file break; fi done fi if test "$ENABLE_AORAI" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/aorai"; fi ########################################################################## # # # This file is part of the Frama-C's E-ACSL plug-in. # # # # Copyright (C) 2012-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # E-ACSL as a standard Frama-C plug-in # ######################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/e-acsl/Makefile.in" >&5 $as_echo_n "checking for src/plugins/e-acsl/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_e_acsl_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/e-acsl/Makefile.in"; then ac_cv_file_src_plugins_e_acsl_Makefile_in=yes else ac_cv_file_src_plugins_e_acsl_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_e_acsl_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_e_acsl_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_e_acsl_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-e_acsl was given. if test "${enable_e_acsl+set}" = set; then : enableval=$enable_e_acsl; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "e_acsl is not available" "$LINENO" 5 fi FORCE_E_ACSL=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_E_ACSL ENABLE_E_ACSL=$ENABLE NAME_E_ACSL=e_acsl if test "$default" = "no" -a "$FORCE" = "no"; then INFO_E_ACSL=" (not available by default)" fi echo "e_acsl... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_RTEGEN=$REQUIRE_RTEGEN" "e_acsl REQUIRED_E_ACSL=$REQUIRED_E_ACSL" "rtegen # E-ACSL only works on Linux as of now. Disable it on Mac OS and Windows # Extract the first word of "uname", so it can be a program name with args. set dummy uname; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_UNAME+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$UNAME"; then ac_cv_prog_UNAME="$UNAME" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_UNAME="uname" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_UNAME" && ac_cv_prog_UNAME="no" fi fi UNAME=$ac_cv_prog_UNAME if test -n "$UNAME"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNAME" >&5 $as_echo "$UNAME" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$UNAME" = "no"; then if test "FORCE_E_ACSL" = "yes"; then as_fn_error $? "e_acsl requested but Not on a POSIX platform." "$LINENO" 5; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: e_acsl disabled because Not on a POSIX platform." >&5 $as_echo "$as_me: WARNING: e_acsl disabled because Not on a POSIX platform." >&2;}; ENABLE_E_ACSL=no; INFO_E_ACSL=", Not on a POSIX platform." fi fi HOST_OS=$($UNAME -s) case $HOST_OS in Darwin | Linux | DragonFly | FreeBSD | NetBSD | OpenBSD) # BSDs haven't really be tested, but it should at least compile fine ;; *) if test "FORCE_E_ACSL" = "yes"; then as_fn_error $? "e_acsl requested but unsupported system $HOST_OS" "$LINENO" 5; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: e_acsl disabled because unsupported system $HOST_OS" >&5 $as_echo "$as_me: WARNING: e_acsl disabled because unsupported system $HOST_OS" >&2;}; ENABLE_E_ACSL=no; INFO_E_ACSL=", unsupported system $HOST_OS" fi ;; esac if test "$ENABLE_E_ACSL" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/e-acsl"; fi ############################### # Configure contrib libraries # ############################### ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ############################################## # LoopAnalysis as a standard Frama-C plug-in # ############################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/loop_analysis/Makefile.in" >&5 $as_echo_n "checking for src/plugins/loop_analysis/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_loop_analysis_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/loop_analysis/Makefile.in"; then ac_cv_file_src_plugins_loop_analysis_Makefile_in=yes else ac_cv_file_src_plugins_loop_analysis_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_loop_analysis_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_loop_analysis_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_loop_analysis_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-loop_analysis was given. if test "${enable_loop_analysis+set}" = set; then : enableval=$enable_loop_analysis; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "loop_analysis is not available" "$LINENO" 5 fi FORCE_LOOP_ANALYSIS=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_LOOP_ANALYSIS ENABLE_LOOP_ANALYSIS=$ENABLE NAME_LOOP_ANALYSIS=loop_analysis if test "$default" = "no" -a "$FORCE" = "no"; then INFO_LOOP_ANALYSIS=" (not available by default)" fi echo "loop_analysis... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files src/plugins/loop_analysis/Makefile" if test "$ENABLE_LOOP_ANALYSIS" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/loop_analysis"; fi ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/markdown-report/Makefile.in" >&5 $as_echo_n "checking for src/plugins/markdown-report/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_markdown_report_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/markdown-report/Makefile.in"; then ac_cv_file_src_plugins_markdown_report_Makefile_in=yes else ac_cv_file_src_plugins_markdown_report_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_markdown_report_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_markdown_report_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_markdown_report_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-mdr was given. if test "${enable_mdr+set}" = set; then : enableval=$enable_mdr; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "mdr is not available" "$LINENO" 5 fi FORCE_MDR=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_MDR ENABLE_MDR=$ENABLE NAME_MDR=mdr if test "$default" = "no" -a "$FORCE" = "no"; then INFO_MDR=" (not available by default)" fi echo "mdr... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_OCAML_PPX_DERIVING=$REQUIRE_OCAML_PPX_DERIVING" "mdr REQUIRE_OCAML_PPX_DERIVING_YOJSON=$REQUIRE_OCAML_PPX_DERIVING_YOJSON" "mdr HAS_OCAML_PPX_DERIVING= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml package ppx_deriving" >&5 $as_echo_n "checking for OCaml package ppx_deriving... " >&6; } OCAML_PPX_DERIVING=$(ocamlfind query ppx_deriving -format %v 2>/dev/null) if test -z "$OCAML_PPX_DERIVING" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found via ocamlfind." >&5 $as_echo "not found via ocamlfind." >&6; } HAS_OCAML_PPX_DERIVING=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 $as_echo "found." >&6; } HAS_OCAML_PPX_DERIVING=yes fi HAS_OCAML_PPX_DERIVING_YOJSON= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml package ppx_deriving_yojson" >&5 $as_echo_n "checking for OCaml package ppx_deriving_yojson... " >&6; } OCAML_PPX_DERIVING_YOJSON=$(ocamlfind query ppx_deriving_yojson -format %v 2>/dev/null) if test -z "$OCAML_PPX_DERIVING_YOJSON" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found via ocamlfind." >&5 $as_echo "not found via ocamlfind." >&6; } HAS_OCAML_PPX_DERIVING_YOJSON=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 $as_echo "found." >&6; } HAS_OCAML_PPX_DERIVING_YOJSON=yes fi if test "$ENABLE_MDR" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/markdown-report"; fi ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # Nonterm as a standard Frama-C plug-in # ######################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/nonterm/Makefile.in" >&5 $as_echo_n "checking for src/plugins/nonterm/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_nonterm_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/nonterm/Makefile.in"; then ac_cv_file_src_plugins_nonterm_Makefile_in=yes else ac_cv_file_src_plugins_nonterm_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_nonterm_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_nonterm_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_nonterm_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-nonterm was given. if test "${enable_nonterm+set}" = set; then : enableval=$enable_nonterm; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "nonterm is not available" "$LINENO" 5 fi FORCE_NONTERM=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_NONTERM ENABLE_NONTERM=$ENABLE NAME_NONTERM=nonterm if test "$default" = "no" -a "$FORCE" = "no"; then INFO_NONTERM=" (not available by default)" fi echo "nonterm... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_EVA=$REQUIRE_EVA" "nonterm REQUIRED_NONTERM=$REQUIRED_NONTERM" "eva ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files src/plugins/nonterm/Makefile" if test "$ENABLE_NONTERM" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/nonterm"; fi ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/obfuscator/Makefile.in" >&5 $as_echo_n "checking for src/plugins/obfuscator/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_obfuscator_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/obfuscator/Makefile.in"; then ac_cv_file_src_plugins_obfuscator_Makefile_in=yes else ac_cv_file_src_plugins_obfuscator_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_obfuscator_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_obfuscator_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_obfuscator_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-obfuscator was given. if test "${enable_obfuscator+set}" = set; then : enableval=$enable_obfuscator; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "obfuscator is not available" "$LINENO" 5 fi FORCE_OBFUSCATOR=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_OBFUSCATOR ENABLE_OBFUSCATOR=$ENABLE NAME_OBFUSCATOR=obfuscator if test "$default" = "no" -a "$FORCE" = "no"; then INFO_OBFUSCATOR=" (not available by default)" fi echo "obfuscator... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ac_config_files="$ac_config_files src/plugins/obfuscator/Makefile" if test "$ENABLE_OBFUSCATOR" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/obfuscator"; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/print_api" >&5 $as_echo_n "checking for src/plugins/print_api... " >&6; } if ${ac_cv_file_src_plugins_print_api+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/print_api"; then ac_cv_file_src_plugins_print_api=yes else ac_cv_file_src_plugins_print_api=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_print_api" >&5 $as_echo "$ac_cv_file_src_plugins_print_api" >&6; } if test "x$ac_cv_file_src_plugins_print_api" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-print_api was given. if test "${enable_print_api+set}" = set; then : enableval=$enable_print_api; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "print_api is not available" "$LINENO" 5 fi FORCE_PRINT_API=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_PRINT_API ENABLE_PRINT_API=$ENABLE NAME_PRINT_API=print_api if test "$default" = "no" -a "$FORCE" = "no"; then INFO_PRINT_API=" (not available by default)" fi echo "print_api... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) if test "$ENABLE_PRINT_API" != "no"; then EXTERNAL_PLUGINS="$EXTERNAL_PLUGINS src/plugins/print_api"; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/qed" >&5 $as_echo_n "checking for src/plugins/qed... " >&6; } if ${ac_cv_file_src_plugins_qed+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/qed"; then ac_cv_file_src_plugins_qed=yes else ac_cv_file_src_plugins_qed=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_qed" >&5 $as_echo "$ac_cv_file_src_plugins_qed" >&6; } if test "x$ac_cv_file_src_plugins_qed" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-qed was given. if test "${enable_qed+set}" = set; then : enableval=$enable_qed; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "qed is not available" "$LINENO" 5 fi FORCE_QED=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_QED ENABLE_QED=$ENABLE NAME_QED=qed if test "$default" = "no" -a "$FORCE" = "no"; then INFO_QED=" (not available by default)" fi echo "qed... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) if test "$ENABLE_QED" != "no"; then EXTERNAL_PLUGINS="$EXTERNAL_PLUGINS src/plugins/qed"; fi ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # E-ACSL as a standard Frama-C plug-in # ######################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/report/Makefile.in" >&5 $as_echo_n "checking for src/plugins/report/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_report_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/report/Makefile.in"; then ac_cv_file_src_plugins_report_Makefile_in=yes else ac_cv_file_src_plugins_report_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_report_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_report_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_report_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-report was given. if test "${enable_report+set}" = set; then : enableval=$enable_report; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "report is not available" "$LINENO" 5 fi FORCE_REPORT=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_REPORT ENABLE_REPORT=$ENABLE NAME_REPORT=report if test "$default" = "no" -a "$FORCE" = "no"; then INFO_REPORT=" (not available by default)" fi echo "report... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files src/plugins/report/Makefile" if test "$ENABLE_REPORT" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/report"; fi ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/security_slicing/Makefile.in" >&5 $as_echo_n "checking for src/plugins/security_slicing/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_security_slicing_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/security_slicing/Makefile.in"; then ac_cv_file_src_plugins_security_slicing_Makefile_in=yes else ac_cv_file_src_plugins_security_slicing_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_security_slicing_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_security_slicing_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_security_slicing_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-security_slicing was given. if test "${enable_security_slicing+set}" = set; then : enableval=$enable_security_slicing; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "security_slicing is not available" "$LINENO" 5 fi FORCE_SECURITY_SLICING=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_SECURITY_SLICING ENABLE_SECURITY_SLICING=$ENABLE NAME_SECURITY_SLICING=security_slicing if test "$default" = "no" -a "$FORCE" = "no"; then INFO_SECURITY_SLICING=" (not available by default)" fi echo "security_slicing... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_SLICING=$REQUIRE_SLICING" "security_slicing REQUIRED_SECURITY_SLICING=$REQUIRED_SECURITY_SLICING" "slicing REQUIRE_EVA=$REQUIRE_EVA" "security_slicing REQUIRED_SECURITY_SLICING=$REQUIRED_SECURITY_SLICING" "eva REQUIRE_PDG=$REQUIRE_PDG" "security_slicing REQUIRED_SECURITY_SLICING=$REQUIRED_SECURITY_SLICING" "pdg REQUIRE_GUI=$REQUIRE_GUI" "security_slicing REQUIRED_SECURITY_SLICING=$REQUIRED_SECURITY_SLICING" "gui if test "$ENABLE_SECURITY_SLICING" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/security_slicing"; fi ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # Server as a standard Frama-C plug-in # ######################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/server/Makefile.in" >&5 $as_echo_n "checking for src/plugins/server/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_server_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/server/Makefile.in"; then ac_cv_file_src_plugins_server_Makefile_in=yes else ac_cv_file_src_plugins_server_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_server_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_server_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_server_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-server was given. if test "${enable_server+set}" = set; then : enableval=$enable_server; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "server is not available" "$LINENO" 5 fi FORCE_SERVER=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_SERVER ENABLE_SERVER=$ENABLE NAME_SERVER=server if test "$default" = "no" -a "$FORCE" = "no"; then INFO_SERVER=" (not available by default)" fi echo "server... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ######################################## # Server ZMQ Configuration # ######################################## # Check whether --enable-server-zmq was given. if test "${enable_server_zmq+set}" = set; then : enableval=$enable_server_zmq; SERVER_ZMQ=$enableval else SERVER_ZMQ=yes fi if test "$SERVER_ZMQ" = "yes" ; then HAS_OCAML_ZMQ= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml package zmq" >&5 $as_echo_n "checking for OCaml package zmq... " >&6; } OCAML_ZMQ=$(ocamlfind query zmq -format %v 2>/dev/null) if test -z "$OCAML_ZMQ" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found via ocamlfind." >&5 $as_echo "not found via ocamlfind." >&6; } HAS_OCAML_ZMQ=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 $as_echo "found." >&6; } HAS_OCAML_ZMQ=yes fi USE_OCAML_ZMQ=$USE_OCAML_ZMQ" "server SERVER_ZMQ=$HAS_OCAML_ZMQ fi ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files src/plugins/server/Makefile" if test "$ENABLE_SERVER" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/server"; fi ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # Studia as a standard Frama-C plug-in # ######################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/studia/Makefile.in" >&5 $as_echo_n "checking for src/plugins/studia/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_studia_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/studia/Makefile.in"; then ac_cv_file_src_plugins_studia_Makefile_in=yes else ac_cv_file_src_plugins_studia_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_studia_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_studia_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_studia_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-studia was given. if test "${enable_studia+set}" = set; then : enableval=$enable_studia; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "studia is not available" "$LINENO" 5 fi FORCE_STUDIA=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_STUDIA ENABLE_STUDIA=$ENABLE NAME_STUDIA=studia if test "$default" = "no" -a "$FORCE" = "no"; then INFO_STUDIA=" (not available by default)" fi echo "studia... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_EVA=$REQUIRE_EVA" "studia REQUIRED_STUDIA=$REQUIRED_STUDIA" "eva ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files src/plugins/studia/Makefile" if test "$ENABLE_STUDIA" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/studia"; fi ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ########################################## # Variadic as a standard Frama-C plug-in # ########################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/variadic/Makefile.in" >&5 $as_echo_n "checking for src/plugins/variadic/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_variadic_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/variadic/Makefile.in"; then ac_cv_file_src_plugins_variadic_Makefile_in=yes else ac_cv_file_src_plugins_variadic_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_variadic_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_variadic_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_variadic_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-variadic was given. if test "${enable_variadic+set}" = set; then : enableval=$enable_variadic; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "variadic is not available" "$LINENO" 5 fi FORCE_VARIADIC=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_VARIADIC ENABLE_VARIADIC=$ENABLE NAME_VARIADIC=variadic if test "$default" = "no" -a "$FORCE" = "no"; then INFO_VARIADIC=" (not available by default)" fi echo "variadic... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files src/plugins/variadic/Makefile" if test "$ENABLE_VARIADIC" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/variadic"; fi ########################################################################## # # # This file is part of WP plug-in of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat a l'energie atomique et aux energies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for src/plugins/wp/Makefile.in" >&5 $as_echo_n "checking for src/plugins/wp/Makefile.in... " >&6; } if ${ac_cv_file_src_plugins_wp_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "src/plugins/wp/Makefile.in"; then ac_cv_file_src_plugins_wp_Makefile_in=yes else ac_cv_file_src_plugins_wp_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_src_plugins_wp_Makefile_in" >&5 $as_echo "$ac_cv_file_src_plugins_wp_Makefile_in" >&6; } if test "x$ac_cv_file_src_plugins_wp_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-wp was given. if test "${enable_wp+set}" = set; then : enableval=$enable_wp; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "wp is not available" "$LINENO" 5 fi FORCE_WP=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_WP ENABLE_WP=$ENABLE NAME_WP=wp if test "$default" = "no" -a "$FORCE" = "no"; then INFO_WP=" (not available by default)" fi echo "wp... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) # Check whether --enable-wp-coq was given. if test "${enable_wp_coq+set}" = set; then : enableval=$enable_wp_coq; WPCOQ=$enableval else WPCOQ=yes fi REQUIRE_QED=$REQUIRE_QED" "wp REQUIRED_WP=$REQUIRED_WP" "qed REQUIRE_RTEGEN=$REQUIRE_RTEGEN" "wp REQUIRED_WP=$REQUIRED_WP" "rtegen USE_GUI=$USE_GUI" "wp USED_WP=$USED_WP" "gui # Why3 API dependency ###################### # REQUIRE_LIBRARY: library *must* be present in order to build plugins # USE_LIBRARY: better for plugins if library is present, but not required # HAS_LIBRARY: is the library available? REQUIRE_WHY3= USE_WHY3= HAS_WHY3= WHY3_PATH=`ocamlfind query why3 | tr -d '\\r\\n'` echo "Ocamlfind -> using $WHY3_PATH" WHY3PATH_FOR_CONFIGURE=$WHY3_PATH # No need to check the same thing multiple times. # [JS 2009/06/02] sh tests and m4 variables do not mix well together. # It works by chance but it is not robust enough. # Should be rewritten HAS_WHY3=no if test "$HAS_WHY3" != "yes"; then as_ac_File=`$as_echo "ac_cv_file_$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX" >&5 $as_echo_n "checking for $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX existence when cross compiling" "$LINENO" 5 if test -r "$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : HAS_WHY3=yes else HAS_WHY3=no fi if test "$HAS_WHY3" = "yes"; then SELECTED_WHY3=$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX fi fi WHY3=$SELECTED_WHY3 REQUIRE_WHY3=$REQUIRE_WHY3" "wp if test "$ENABLE_WP" != "no"; then EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} src/plugins/wp"; fi ##################################################### # Check for tools/libraries requirements of plugins # ##################################################### new_section "configure tools and libraries used by some plug-ins" # lablgtk2 ########## # Check whether --enable-lablgtk3 was given. if test "${enable_lablgtk3+set}" = set; then : enableval=$enable_lablgtk3; ENABLE_LABLGTK3=$enableval else ENABLE_LABLGTK3=yes fi REQUIRE_LABLGTK="$REQUIRE_LABLGTK$REQUIRE_GNOMECANVAS" USE_LABLGTK="$USE_LABLGTK$USE_GNOMECANVAS" LABLGTK_PATH="" SOURCEVIEW_PATH="" if test "$PLATFORM" != "MacOS"; then if test "$ENABLE_LABLGTK3" = "yes"; then LABLGTK_PATH=`ocamlfind query lablgtk3 | tr -d '\\r\\n'`; fi if test "$LABLGTK_PATH" != ""; then SOURCEVIEW_PATH=`ocamlfind query lablgtk3-sourceview3 | tr -d '\\r\\n'`; fi fi if test "$SOURCEVIEW_PATH" = ""; then LABLGTK_VERSION=2 LABLGTK_PATH=`ocamlfind query lablgtk2 | tr -d '\\r\\n'` if test "$LABLGTK_PATH" = "" -o \ "$LABLGTK_PATH" -ef "$OCAMLLIB/lablgtk2" ; then echo "Ocamlfind -> using +lablgtk2.($LABLGTK_PATH,$OCAMLLIB/lablgtk2)" LABLGTK_PATH=+lablgtk2 LABLGTKPATH_FOR_CONFIGURE=$OCAMLLIB/lablgtk2 else echo "Ocamlfind -> using $LABLGTK_PATH" LABLGTKPATH_FOR_CONFIGURE=$LABLGTK_PATH fi; SOURCEVIEW_PATH=$LABLGTKPATH_FOR_CONFIGURE; else LABLGTK_VERSION=3 echo "ocamlfind -> using $LABLGTK_PATH" LABLGTKPATH_FOR_CONFIGURE=$LABLGTK_PATH; fi # No need to check the same thing multiple times. # [JS 2009/06/02] sh tests and m4 variables do not mix well together. # It works by chance but it is not robust enough. # Should be rewritten HAS_GTKSOURCEVIEW=no if test "$HAS_GTKSOURCEVIEW" != "yes"; then as_ac_File=`$as_echo "ac_cv_file_$SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX" >&5 $as_echo_n "checking for $SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for $SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX existence when cross compiling" "$LINENO" 5 if test -r "$SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : HAS_GTKSOURCEVIEW=yes else HAS_GTKSOURCEVIEW=no fi if test "$HAS_GTKSOURCEVIEW" = "yes"; then SELECTED_GTKSOURCEVIEW=$SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX fi fi if test "$HAS_GTKSOURCEVIEW" != "yes"; then as_ac_File=`$as_echo "ac_cv_file_$SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX" >&5 $as_echo_n "checking for $SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for $SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX existence when cross compiling" "$LINENO" 5 if test -r "$SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : HAS_GTKSOURCEVIEW=yes else HAS_GTKSOURCEVIEW=no fi if test "$HAS_GTKSOURCEVIEW" = "yes"; then SELECTED_GTKSOURCEVIEW=$SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX fi fi GTKSOURCEVIEW=$SELECTED_GTKSOURCEVIEW # No need to check the same thing multiple times. # [JS 2009/06/02] sh tests and m4 variables do not mix well together. # It works by chance but it is not robust enough. # Should be rewritten HAS_GNOMECANVAS=no if test "$HAS_GNOMECANVAS" != "yes"; then as_ac_File=`$as_echo "ac_cv_file_$LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX" >&5 $as_echo_n "checking for $LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for $LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX existence when cross compiling" "$LINENO" 5 if test -r "$LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : HAS_GNOMECANVAS=yes else HAS_GNOMECANVAS=no fi if test "$HAS_GNOMECANVAS" = "yes"; then SELECTED_GNOMECANVAS=$LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX fi fi GNOMECANVAS=$SELECTED_GNOMECANVAS # No need to check the same thing multiple times. # [JS 2009/06/02] sh tests and m4 variables do not mix well together. # It works by chance but it is not robust enough. # Should be rewritten HAS_LABLGTK=no if test "$HAS_LABLGTK" != "yes"; then as_ac_File=`$as_echo "ac_cv_file_$LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX" >&5 $as_echo_n "checking for $LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for $LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX existence when cross compiling" "$LINENO" 5 if test -r "$LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : HAS_LABLGTK=yes else HAS_LABLGTK=no fi if test "$HAS_LABLGTK" = "yes"; then SELECTED_LABLGTK=$LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX fi fi if test "$HAS_LABLGTK" != "yes"; then as_ac_File=`$as_echo "ac_cv_file_$LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX" >&5 $as_echo_n "checking for $LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for $LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX existence when cross compiling" "$LINENO" 5 if test -r "$LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : HAS_LABLGTK=yes else HAS_LABLGTK=no fi if test "$HAS_LABLGTK" = "yes"; then SELECTED_LABLGTK=$LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX fi fi LABLGTK=$SELECTED_LABLGTK # dot and xdot tools #################### for file in dot; do HAS_DOT= # Extract the first word of "$file", so it can be a program name with args. set dummy $file; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAS_DOT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAS_DOT"; then ac_cv_prog_HAS_DOT="$HAS_DOT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAS_DOT="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAS_DOT" && ac_cv_prog_HAS_DOT="no" fi fi HAS_DOT=$ac_cv_prog_HAS_DOT if test -n "$HAS_DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_DOT" >&5 $as_echo "$HAS_DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$HAS_DOT" = "yes"; then SELECTED_VAR=$file break; fi done ######################## # Plug-in dependencies # ######################## new_section "checking for plug-in dependencies" if test -n "$REQUIRE_LTLTOBA" -o -n "$USE_LTLTOBA" -o "$no" = "yes"; then if test "$HAS_LTLTOBA" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ltl2ba not found." >&5 $as_echo "$as_me: WARNING: ltl2ba not found." >&2;} reason="ltl2ba missing" for p in $REQUIRE_LTLTOBA; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ ltl2ba\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_LTLTOBA; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ ltl2ba\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done else LTLTOBA=ltl2ba fi fi ac_config_files="$ac_config_files src/plugins/aorai/Makefile" ############################### # C specific stuff for E-ACSL # ############################### MAY_RUN_TESTS=yes # C compiler and stdio.h ######################### for ac_header in stdio.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" if test "x$ac_cv_header_stdio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDIO_H 1 _ACEOF HAVE_STDIO_H=yes fi done # not sure it can actually happen: # looks like configure stops on error if no C compiler detected if test -z $HAVE_STDIO_H; then MAY_RUN_TESTS=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: stdio.h missing: non-regression tests unavailable." >&5 $as_echo "$as_me: WARNING: stdio.h missing: non-regression tests unavailable." >&2;} fi # Doxygen ######### # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DOXYGEN"; then ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DOXYGEN="doxygen" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_DOXYGEN" && ac_cv_prog_DOXYGEN="no" fi fi DOXYGEN=$ac_cv_prog_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_DOT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_DOT"; then ac_cv_prog_HAVE_DOT="$HAVE_DOT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_DOT="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_DOT" && ac_cv_prog_HAVE_DOT="no" fi fi HAVE_DOT=$ac_cv_prog_HAVE_DOT if test -n "$HAVE_DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DOT" >&5 $as_echo "$HAVE_DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ac_config_files="$ac_config_files src/plugins/e-acsl/doc/doxygen/doxygen.cfg" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "src/plugins/aorai/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/aorai/Makefile" ;; "src/plugins/e-acsl/doc/doxygen/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES src/plugins/e-acsl/doc/doxygen/doxygen.cfg" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "src/plugins/aorai/Makefile":F) chmod -w src/plugins/aorai/Makefile ;; "default":C) ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files src/plugins/e-acsl/Makefile" if test -n "$REQUIRE_OCAML_PPX_DERIVING" -o -n "$USE_OCAML_PPX_DERIVING" -o "$no" = "yes"; then if test "$HAS_OCAML_PPX_DERIVING" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: package ppx_deriving not found" >&5 $as_echo "$as_me: WARNING: package ppx_deriving not found" >&2;} reason="ppx_deriving missing" for p in $REQUIRE_OCAML_PPX_DERIVING; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ ppx_deriving\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_OCAML_PPX_DERIVING; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ ppx_deriving\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done else OCAML_PPX_DERIVING=PPX_DERIVING fi fi if test -n "$REQUIRE_OCAML_PPX_DERIVING_YOJSON" -o -n "$USE_OCAML_PPX_DERIVING_YOJSON" -o "$no" = "yes"; then if test "$HAS_OCAML_PPX_DERIVING_YOJSON" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: package ppx_deriving_yojson not found" >&5 $as_echo "$as_me: WARNING: package ppx_deriving_yojson not found" >&2;} reason="ppx_deriving_yojson missing" for p in $REQUIRE_OCAML_PPX_DERIVING_YOJSON; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ ppx_deriving_yojson\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_OCAML_PPX_DERIVING_YOJSON; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ ppx_deriving_yojson\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done else OCAML_PPX_DERIVING_YOJSON=PPX_DERIVING_YOJSON fi fi ac_config_files="$ac_config_files src/plugins/markdown-report/Makefile" ac_config_files="$ac_config_files src/plugins/security_slicing/Makefile" if test -n "$REQUIRE_OCAML_ZMQ" -o -n "$USE_OCAML_ZMQ" -o "$no" = "yes"; then if test "$HAS_OCAML_ZMQ" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Server support for ZeroMQ disabled (try 'opam install zmq')." >&5 $as_echo "$as_me: WARNING: Server support for ZeroMQ disabled (try 'opam install zmq')." >&2;} reason="zmq missing" for p in $REQUIRE_OCAML_ZMQ; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ zmq\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_OCAML_ZMQ; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ zmq\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done else OCAML_ZMQ=ZMQ fi fi if test -n "$REQUIRE_WHY3" -o -n "$USE_WHY3" -o "$no" = "yes"; then if test "$HAS_WHY3" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX not found." >&5 $as_echo "$as_me: WARNING: $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX not found." >&2;} reason="$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX missing" for p in $REQUIRE_WHY3; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_WHY3; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done fi fi # NB: this would deserve to use plugin_requires mechanism if test "$ENABLE_WP" != "no"; then ## Configuring for WP-COQ if test "$WPCOQ" = "yes" ; then # Extract the first word of "coqc", so it can be a program name with args. set dummy coqc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_COQC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$COQC"; then ac_cv_prog_COQC="$COQC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_COQC="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_COQC" && ac_cv_prog_COQC="no" fi fi COQC=$ac_cv_prog_COQC if test -n "$COQC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COQC" >&5 $as_echo "$COQC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$COQC" = "yes" ; then COQVERSION=`coqc -v | sed -n -e 's|.*version* *\([^ ]*\) .*$|\1|p' ` case $COQVERSION in 8.7*|8.8*|8.9*|8.10*|trunk) { $as_echo "$as_me:${as_lineno-$LINENO}: result: coqc version $COQVERSION found" >&5 $as_echo "coqc version $COQVERSION found" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported coqc version $COQVERSION" >&5 $as_echo "unsupported coqc version $COQVERSION" >&6; } COQC="no" ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: rerun configure to make wp using coq 8.7.2 or higher" >&5 $as_echo "$as_me: rerun configure to make wp using coq 8.7.2 or higher" >&6;} fi else COQC="no" fi fi ac_config_files="$ac_config_files src/plugins/wp/Makefile" if test -n "$REQUIRE_GTKSOURCEVIEW" -o -n "$USE_GTKSOURCEVIEW" -o "$no" = "yes"; then if test "$HAS_GTKSOURCEVIEW" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: lablgtksourceview not found" >&5 $as_echo "$as_me: WARNING: lablgtksourceview not found" >&2;} reason="$SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX, $SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX missing" for p in $REQUIRE_GTKSOURCEVIEW; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ $SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX, $SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_GTKSOURCEVIEW; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ $SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX, $SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done fi fi if test -n "$REQUIRE_GNOMECANVAS" -o -n "$USE_GNOMECANVAS" -o "$no" = "yes"; then if test "$HAS_GNOMECANVAS" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: lablgnomecanvas.$LIB_SUFFIX not found" >&5 $as_echo "$as_me: WARNING: lablgnomecanvas.$LIB_SUFFIX not found" >&2;} reason="$LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX missing" for p in $REQUIRE_GNOMECANVAS; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ $LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_GNOMECANVAS; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ $LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done fi fi if test -n "$REQUIRE_LABLGTK" -o -n "$USE_LABLGTK" -o "$no" = "yes"; then if test "$HAS_LABLGTK" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX not found." >&5 $as_echo "$as_me: WARNING: $LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX not found." >&2;} reason="$LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX, $LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX missing" for p in $REQUIRE_LABLGTK; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ $LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX, $LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_LABLGTK; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ $LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX, $LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done fi fi if test -n "$REQUIRE_DOT" -o -n "$USE_DOT" -o "$no" = "yes"; then if test "$HAS_DOT" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dot not found: you should install GraphViz" >&5 $as_echo "$as_me: WARNING: dot not found: you should install GraphViz" >&2;} reason="dot missing" for p in $REQUIRE_DOT; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ dot\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_DOT; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ dot\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done else DOT=dot fi fi # First, initialize some variables for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` TODOLIST=$TODOLIST" "$plugin eval MARK_$plugin= eval REMEMBER_$plugin= fi done # main call compute_dependency ############################ # Substitutions to perform # ############################ EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} ${EXTRA_EXTERNAL_PLUGINS}" # m4_foreach_w is not supported in some old autoconf versions. # Sadly AC_FOREACH is deprecated now... ################################################ # Finally create the Makefile from Makefile.in # ################################################ new_section "creating makefile" ac_config_files="$ac_config_files share/Makefile.config" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "src/plugins/aorai/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/aorai/Makefile" ;; "src/plugins/e-acsl/doc/doxygen/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES src/plugins/e-acsl/doc/doxygen/doxygen.cfg" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "src/plugins/e-acsl/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/e-acsl/Makefile" ;; "src/plugins/loop_analysis/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/loop_analysis/Makefile" ;; "src/plugins/markdown-report/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/markdown-report/Makefile" ;; "src/plugins/nonterm/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/nonterm/Makefile" ;; "src/plugins/obfuscator/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/obfuscator/Makefile" ;; "src/plugins/report/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/report/Makefile" ;; "src/plugins/security_slicing/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/security_slicing/Makefile" ;; "src/plugins/server/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/server/Makefile" ;; "src/plugins/studia/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/studia/Makefile" ;; "src/plugins/variadic/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/variadic/Makefile" ;; "src/plugins/wp/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/wp/Makefile" ;; "share/Makefile.config") CONFIG_FILES="$CONFIG_FILES share/Makefile.config" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "src/plugins/aorai/Makefile":F) chmod -w src/plugins/aorai/Makefile ;; "default":C) ;; "src/plugins/e-acsl/Makefile":F) chmod -w src/plugins/e-acsl/Makefile ;; "src/plugins/loop_analysis/Makefile":F) chmod -w src/plugins/loop_analysis/Makefile ;; "src/plugins/markdown-report/Makefile":F) chmod -w src/plugins/markdown-report/Makefile ;; "src/plugins/nonterm/Makefile":F) chmod -w src/plugins/nonterm/Makefile ;; "src/plugins/obfuscator/Makefile":F) chmod -w src/plugins/obfuscator/Makefile ;; "src/plugins/report/Makefile":F) chmod -w src/plugins/report/Makefile ;; "src/plugins/security_slicing/Makefile":F) chmod -w src/plugins/security_slicing/Makefile ;; "src/plugins/server/Makefile":F) chmod -w src/plugins/server/Makefile ;; "src/plugins/studia/Makefile":F) chmod -w src/plugins/studia/Makefile ;; "src/plugins/variadic/Makefile":F) chmod -w src/plugins/variadic/Makefile ;; "src/plugins/wp/Makefile":F) chmod -w src/plugins/wp/Makefile ;; "share/Makefile.config":F) chmod a-w share/Makefile.config ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ########### # Summary # ########### new_section "summary: plug-ins available" for plugin in CALLGRAPH SEMANTIC_CONSTANT_FOLDING FROM_ANALYSIS GUI IMPACT INOUT METRICS OCCURRENCE PDG POSTDOMINATORS RTEGEN SCOPE SLICING SPARECODE USERS EVA AORAI E_ACSL LOOP_ANALYSIS MDR NONTERM OBFUSCATOR PRINT_API QED REPORT SECURITY_SLICING SERVER STUDIA VARIADIC WP; do n=NAME_$plugin e=ENABLE_$plugin i=INFO_$plugin eval nv=\$$n eval ev=\$$e eval iv=\$$i { $as_echo "$as_me:${as_lineno-$LINENO}: $nv: $ev$iv" >&5 $as_echo "$as_me: $nv: $ev$iv" >&6;} done if test "$EXTRA_EXTERNAL_PLUGINS" != ""; then new_section "summary: requested external plugins" fi for plugin in $EXTRA_EXTERNAL_PLUGINS; do { $as_echo "$as_me:${as_lineno-$LINENO}: $plugin" >&5 $as_echo "$as_me: $plugin" >&6;} done frama-c-20.0-Calcium/configure.in0000666000000000000000000007411413571573400013533 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # INRIA (Institut National de Recherche en Informatique et en # # Automatique) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # autoconf input for Objective Caml programs # Copyright (C) 2001 Jean-Christophe Filliâtre # from a first script by Georges Mariano # the script generated by autoconf from this input will set the following # variables: # OCAMLC "ocamlc" if present in the path, or a failure # or "ocamlc.opt" if present with same version number as ocamlc # OCAMLOPT "ocamlopt" (or "ocamlopt.opt" if present), or "no" # OCAMLBEST either "byte" if no native compiler was found, # or "opt" otherwise # OCAMLDEP "ocamldep" # OCAMLLEX "ocamllex" (or "ocamllex.opt" if present) # OCAMLYACC "ocamlyacc" # OCAMLLIB the path to the ocaml standard library # OCAMLVERSION the ocaml version number # OCAMLWIN32 "yes"/"no" depending on Sys.os_type = "Win32" # EXE ".exe" if OCAMLWIN32=yes, "" otherwise AC_INIT(src/kernel_internals/runtime/boot.ml) define([FRAMAC_MAIN_AUTOCONF]) m4_include(share/configure.ac) AC_SUBST([FRAMAC_VERSION],[`cat VERSION`]) # export CYGWIN=nobinmode ########################## # Check for Make version # ########################## new_section "configure make" AC_CHECK_PROGS(MAKE,gmake make,make,) AC_MSG_CHECKING([version of make]) MAKE_DISTRIB=`sh -c "$MAKE -v | sed -n -e 's/\(.*\) Make.*$/\1/p'"` MAKE_MAJOR=`sh -c "$MAKE -v | sed -n -f bin/sed_get_make_major"` MAKE_MINOR=`sh -c "$MAKE -v | sed -n -f bin/sed_get_make_minor"` AC_MSG_RESULT($MAKE_MAJOR.$MAKE_MINOR) if test "$MAKE_DISTRIB" != GNU -o "$MAKE_MAJOR" -lt 3 \ -o "$MAKE_MAJOR" = 3 -a "$MAKE_MINOR" -lt 81 then AC_MSG_ERROR([unsupported version; GNU Make version 3.81 or higher is required.]); fi # verbosemake feature AC_ARG_ENABLE( verbosemake, [ --enable-verbosemake verbose makefile commands], VERBOSEMAKE=$enableval, VERBOSEMAKE=no ) if test "$VERBOSEMAKE" = yes ; then AC_MSG_RESULT(Make will be verbose.) fi ########################################## # Check for invalid command-line options # ########################################## case $prefix in *\ * ) AC_MSG_ERROR(spaces not allowed in --prefix argument "$prefix");; * ) ;; esac ############################# # Check for Ocaml compilers # ############################# new_section "configure ocaml compilers" # we first look for ocamlc in the path; if not present, we fail AC_CHECK_PROG(OCAMLC,ocamlc,ocamlc,no) if test "$OCAMLC" = no ; then AC_MSG_ERROR(Cannot find ocamlc.) fi # we extract Ocaml version number and library path # "sed -n" is the posix version of "sed --quiet" AC_MSG_CHECKING(version of OCaml) OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version *\(.*\)$|\1|p' ` AC_MSG_RESULT($OCAMLVERSION) case $OCAMLVERSION in 0.*|1.*|2.*|3.*|4.00.*|4.01.*|4.02.*|4.03.*|4.04.*) AC_MSG_ERROR(Incompatible OCaml version; use 4.05+.);; *) OCAML_ANNOT_OPTION="-bin-annot";; esac AC_SUBST(OCAMLMAJORNB) AC_SUBST(OCAMLMINORNB) AC_SUBST(OCAMLPATCHNB) AC_SUBST(HAS_OCAML407) AC_SUBST(HAS_OCAML408) OCAMLMAJORNB=$(echo $OCAMLVERSION | cut -f 1 -d .) OCAMLMINORNB=$(echo $OCAMLVERSION | cut -f 2 -d .) OCAMLPATCHNB=$(echo $OCAMLVERSION | cut -f 3 -d .) if test $OCAMLMAJORNB -gt 4; then HAS_OCAML407=yes; HAS_OCAML408=yes; else HAS_OCAML407=no; HAS_OCAML408=no; if test $OCAMLMINORNB -ge 7; then HAS_OCAML407=yes; fi; if test $OCAMLMINORNB -ge 8; then HAS_OCAML408=yes; fi; fi; # MAJORNB -gt 4 # Ocaml library path AC_MSG_CHECKING(OCaml library path) OCAMLLIB=`$OCAMLC -where | tr -d '\\r'` AC_MSG_RESULT($OCAMLLIB) # then we look for ocamlopt; if not present, we issue a warning # if the version or the stdlib directory is not the same, we also discard it # we set OCAMLBEST to "opt" or "byte", whether ocamlopt is available or not AC_CHECK_PROG(OCAMLOPT,ocamlopt,ocamlopt,no) OCAMLBEST=byte if test "$OCAMLOPT" = no ; then AC_MSG_WARN(Cannot find ocamlopt; bytecode compilation only.) else AC_MSG_CHECKING(ocamlopt version and standard library) TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version *\(.*\)$|\1|p'` if test "$TMPVERSION" != "$OCAMLVERSION" \ -o `$OCAMLOPT -where | tr -d '\\r'` != "$OCAMLLIB"; then AC_MSG_RESULT(differs from ocamlc; ocamlopt discarded.) OCAMLOPT=no else AC_MSG_RESULT(ok) OCAMLBEST=opt fi fi # In case we have a native compiler, check that native dynlink works. # Otherwise, fall back to bytecode-only compilation if test "$OCAMLBEST" = opt; then echo "let f x y =" > test_dynlink.ml echo " Dynlink.loadfile \"foo\"; " >> test_dynlink.ml echo " ignore (Dynlink.is_native);" >> test_dynlink.ml echo " abs_float (x -. y)" >> test_dynlink.ml if ($OCAMLOPT -shared -linkall -o test_dynlink.cmxs test_dynlink.ml) \ 2> /dev/null ; \ then AC_MSG_RESULT([native dynlink works fine. Great.]) else AC_MSG_WARN([Native dynlink does not work, disabling native compilation.]) OCAMLBEST=byte fi rm -f test_dynlink.* fi if test "$OCAMLBEST" = "opt"; then LIB_SUFFIX=cmxa DYN_SUFFIX=cmxs OBJ_SUFFIX=cmx; else LIB_SUFFIX=cma DYN_SUFFIX=cma OBJ_SUFFIX=cmo; fi # checking for ocamlfind AC_CHECK_PROG(OCAMLFIND,ocamlfind,ocamlfind,no) if test "$OCAMLFIND" != no ; then OCAMLC="$OCAMLFIND ocamlc" OCAMLOPT="$OCAMLFIND ocamlopt" else AC_MSG_ERROR(Cannot find ocamlfind.) fi ################################################### # Select devel compilation (warnings, warn-error) # ################################################### # It is inherited by the plugins if test -e ".for_devel"; then DEFAULT_DEVEL_MODE=yes else DEFAULT_DEVEL_MODE=no fi AC_ARG_ENABLE( devel-mode, [ --enable-devel-mode force the devel mode (warnings and warn-error). --disable-devel-mode force the distrib mode (no warnings and no warn-error). ], DEVELOPMENT=$enableval, DEVELOPMENT=$DEFAULT_DEVEL_MODE, # default value ) if test "$DEVELOPMENT" = "yes" ; then AC_MSG_NOTICE(Development mode: warnings and warn-errors are activated) else AC_MSG_NOTICE(Distribution mode: all warnings are deactivated) fi ############################################## # Check for other mandatory tools/libraries # ############################################## new_section "configure mandatory tools and libraries" # ocamldep AC_CHECK_PROG(OCAMLDEP,ocamldep,ocamldep,no) if test "$OCAMLDEP" = no ; then AC_MSG_ERROR(Cannot find ocamldep.) else OCAMLDEP="$OCAMLFIND ocamldep" fi # ocamllex AC_CHECK_PROG(OCAMLLEX,ocamllex,ocamllex,no) if test "$OCAMLLEX" = no ; then AC_MSG_ERROR(Cannot find ocamllex.) else AC_CHECK_PROG(OCAMLLEXDOTOPT,ocamllex.opt,ocamllex.opt,no) if test "$OCAMLLEXDOTOPT" != no ; then OCAMLLEX=$OCAMLLEXDOTOPT fi fi # ocamlyacc AC_CHECK_PROG(OCAMLYACC,ocamlyacc,ocamlyacc,no) if test "$OCAMLYACC" = no ; then AC_MSG_ERROR(Cannot find ocamlyacc.) fi # ocamlcp AC_CHECK_PROG(OCAMLCP,ocamlcp,ocamlcp,no) if test "$OCAMLCP" = no ; then AC_MSG_ERROR(Cannot find ocamlcp.) else OCAMLCP="$OCAMLFIND ocamlcp" fi # ocamlgraph ############ AC_MSG_CHECKING(for ocamlgraph) OCAMLGRAPH=$($OCAMLFIND query ocamlgraph -format %v) if test -z "$OCAMLGRAPH" ; then AC_MSG_ERROR(Cannot find ocamlgraph via ocamlfind \ (requires ocamlgraph 1.8.5 or higher).) fi case $OCAMLGRAPH in 0.* | 1.[[01234567]].* \ | 1.8.0 | 1.8.0+dev \ | 1.8.1 | 1.8.1+dev \ | 1.8.2 | 1.8.2+dev \ | 1.8.3 | 1.8.3+dev \ | 1.8.4 | 1.8.4+dev) AC_MSG_ERROR(found $OCAMLGRAPH: requires 1.8.5 or higher.);; 1.8.5 | 1.8.6 | 1.8.7) AC_MSG_RESULT(found);; *) AC_MSG_RESULT(found $OCAMLGRAPH: should work);; esac # zarith ######## AC_MSG_CHECKING(for zarith) ZARITH=$($OCAMLFIND query zarith -format %v) if test -z "$ZARITH" ; then AC_MSG_ERROR(Cannot find zarith via ocamlfind.) else AC_MSG_RESULT(found $ZARITH) fi # yojson ######## AC_MSG_CHECKING(for Yojson) YOJSON=$($OCAMLFIND query yojson -format %v) if test -z "$YOJSON" ; then AC_MSG_ERROR(Cannot find yojson via ocamlfind \ (requires yojson 1.4.1 or higher).) else AC_MSG_RESULT(found $YOJSON) fi ################################################# # Check for other (optional) tools/libraries # ################################################# new_section "configure optional tools and libraries" AC_CHECK_PROG(OCAMLDOC,ocamldoc,ocamldoc,no) if test "$OCAMLDOC" = no ; then AC_MSG_RESULT(ocamldoc discarded not present) else OCAMLDOC="$OCAMLFIND ocamldoc" fi AC_CHECK_PROG(OCAMLMKTOP,ocamlmktop,ocamlmktop,no) if test "$OCAMLMKTOP" = no ; then AC_MSG_RESULT(Cannot find ocamlmktop: toplevels cannot be built.) else OCAMLMKTOP="$OCAMLFIND ocamlmktop" fi AC_CHECK_PROG(OTAGS,otags,otags,) # apron ######## AC_MSG_CHECKING(for Apron) APRON_PATH=$($OCAMLFIND query apron 2>/dev/null | tr -d '\r\n') if test -f "$APRON_PATH/apron.$DYN_SUFFIX"; then HAS_APRON="yes"; AC_MSG_RESULT(found) else HAS_APRON="no"; AC_MSG_RESULT(not found. The corresponding domains won't be available in Eva) fi; # mpfr ####### AC_MSG_CHECKING(for MPFR) MPFR_PATH=$($OCAMLFIND query gmp 2>/dev/null | tr -d '\r\n') if test -f "$MPFR_PATH/gmp.$DYN_SUFFIX" -a -f "$MPFR_PATH/mpfr.cmx" ; then HAS_MPFR="yes"; AC_MSG_RESULT(found) else HAS_MPFR="no"; AC_MSG_RESULT(not found. The numerors domain won't be available in Eva) fi; # landmarks (profiling tool, for developers) ######## AC_ARG_ENABLE( landmarks, [ --enable-landmarks enable landmarks profiling (default: yes if package installed)], ENABLE_LANDMARKS=$enableval, ENABLE_LANDMARKS=yes) if test "$ENABLE_LANDMARKS" = yes ; then AC_MSG_CHECKING(for Landmarks) LANDMARKS_PATH=$($OCAMLFIND query landmarks 2>/dev/null | tr -d '\r\n') LANDMARKS_PPX_PATH=$($OCAMLFIND query landmarks.ppx 2>/dev/null | tr -d '\r\n') if test -f "$LANDMARKS_PATH/landmark.$DYN_SUFFIX" -a -f "$LANDMARKS_PPX_PATH/ppx_landmarks.$DYN_SUFFIX"; then HAS_LANDMARKS="yes"; AC_MSG_RESULT(found) else HAS_LANDMARKS="no"; AC_MSG_RESULT(not found.) fi; else AC_MSG_RESULT(Landmarks profiling disabled); HAS_LANDMARKS="no" fi ############ # Platform # ############ new_section "configure platform" AC_MSG_CHECKING(platform) # get Sys.os_type as OCAML_OS_TYPE echo "let () = print_string Sys.os_type;;" > test_os_type.ml $OCAMLC -o test_os_type test_os_type.ml OCAML_OS_TYPE=$(./test_os_type) rm -f test_os_type.cmi test_os_type.cmo test_os_type.ml test_os_type if test "$OCAML_OS_TYPE" = "Win32"; then AC_MSG_RESULT(Win32) AC_CHECK_PROG(CYGPATH,cygpath,cygpath,no) PLATFORM=Win32 OCAMLWIN32=yes EXE=.exe else OCAMLWIN32=no if test "$OCAML_OS_TYPE" = "Cygwin"; then AC_MSG_RESULT(Cygwin) PLATFORM=Cygwin EXE=.exe else if test $(uname -s) = "Darwin"; then AC_MSG_RESULT(MacOS) PLATFORM=MacOS else AC_MSG_RESULT(Unix) PLATFORM=Unix fi EXE= fi fi # C and POSIX standard headers used by C bindings. AC_LANG([C]) AC_ARG_WITH(cc,[specifies a custom C compiler and pre-processor],[CC=$withval]) AC_PROG_CC AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(assert.h) AC_CHECK_HEADERS(float.h) AC_CHECK_HEADERS(math.h) AC_CHECK_HEADERS(signal.h) AC_CHECK_HEADERS(unistd.h) # Local machdep feature (to generate new platforms) AC_ARG_ENABLE( localmachdep, [ --enable-localmachdep enable local machdep configuration], LOCAL_MACHDEP=$enableval, LOCAL_MACHDEP=no) if test "$LOCAL_MACHDEP" = yes ; then AC_CONFIG_HEADER(config.h) AC_CHECK_HEADERS(wchar.h) # Find out the true definitions of some integer types # checkIntegerype(size_t) will echo "int" or "long" checkIntegerType() { fn="testtype.c" fo="testtype.o" for t in "int" "unsigned int" "long" "unsigned long" "short" "unsigned short" "char" "unsigned char" ;do echo "#include " >$fn echo "#include " >>$fn # We define a prototype with one type and the function with # another type. This will result in compilation error # unless the types are really identical echo "$t foo($t x);" >>$fn echo "$1 foo($1 x) { return x;}" >>$fn if gcc -c $fn 2>/dev/null ;then # Found it echo $t rm -f $fn $fo return fi done rm -f $fn $fo } AC_MSG_CHECKING([definition of size_t]) TYPE_SIZE_T=`checkIntegerType "size_t"` if test "x$TYPE_SIZE_T" = "x" ;then AC_MSG_ERROR([Cannot find definition of size_t]) fi AC_DEFINE_UNQUOTED(TYPE_SIZE_T, "$TYPE_SIZE_T") AC_MSG_RESULT([$TYPE_SIZE_T]) AC_MSG_CHECKING([definition of wchar_t]) TYPE_WCHAR_T=`checkIntegerType "wchar_t"` if test "x$TYPE_WCHAR_T" = "x" ;then AC_MSG_ERROR([Cannot find definition of wchar_t]) fi AC_DEFINE_UNQUOTED(TYPE_WCHAR_T, "$TYPE_WCHAR_T") AC_MSG_RESULT([$TYPE_WCHAR_T]) AC_MSG_CHECKING([definition of ptrdiff_t]) TYPE_PTRDIFF_T=`checkIntegerType "ptrdiff_t"` if test "x$TYPE_PTRDIFF_T" = "x" ;then AC_MSG_ERROR([Cannot find definition of ptrdiff_t]) fi AC_DEFINE_UNQUOTED(TYPE_PTRDIFF_T, "$TYPE_PTRDIFF_T") AC_MSG_RESULT([$TYPE_PTRDIFF_T]) AC_MSG_CHECKING([for gcc version]) AC_CHECK_TYPE(__builtin_va_list, HAVE_BUILTIN_VA_LIST=true, HAVE_BUILTIN_VA_LIST=false) if test "$HAVE_BUILTIN_VA_LIST" = "true" ;then AC_DEFINE_UNQUOTED(HAVE_BUILTIN_VA_LIST, 1) fi AC_MSG_CHECKING([if __thread is a keyword]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(int __thread) { return 0; }])], THREAD_IS_KEYWORD=false, THREAD_IS_KEYWORD=true) AC_MSG_RESULT($THREAD_IS_KEYWORD) if test "$THREAD_IS_KEYWORD" = "true" ;then AC_DEFINE_UNQUOTED(THREAD_IS_KEYWORD, 1) fi # Does gcc add underscores to identifiers to make assembly labels? # (I think MSVC always does) AC_MSG_CHECKING([if gcc adds underscores to assembly labels.]) AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { __asm__("jmp _main"); }])], UNDERSCORE_NAME=true, UNDERSCORE_NAME=false) AC_MSG_RESULT($UNDERSCORE_NAME) if test "$UNDERSCORE_NAME" = "true" ;then AC_DEFINE_UNQUOTED(UNDERSCORE_NAME, 1) fi fi # local machdep configuration ################################### # Frama-C's pre-processor support # ################################### # Specific preprocessor support AC_ARG_WITH( cpp, [ --with-cpp customize default preprocessor for Frama-C], [FRAMAC_DEFAULT_CPP=$withval], [FRAMAC_DEFAULT_CPP=]) # if no specific pre-processor has been given, check whether we can use # $CC. Note that we want to keep comments in the output, so that AC_PROG_CPP # alone is not sufficient. if test -z "$FRAMAC_DEFAULT_CPP"; then AC_PROG_CPP CPPFLAGS="-C -I."; if test -n "$GCC"; then FRAMAC_GNU_CPP=true; else FRAMAC_GNU_CPP=false; fi else CPP=$FRAMAC_DEFAULT_CPP; FRAMAC_GNU_CPP=true; CPPFLAGS="-dD -nostdinc" AC_PREPROC_IFELSE( [AC_LANG_SOURCE([#define foo 0 /* foo */ ])], FRAMAC_GNU_CPP=true, FRAMAC_GNU_CPP=false) CPPFLAGS= fi AC_PREPROC_IFELSE( [AC_LANG_SOURCE([/* Check whether comments are kept in output */])], [if test -e conftest.i; then if grep -e kept conftest.i; then FRAMAC_DEFAULT_CPP="$CPP $CPPFLAGS"; DEFAULT_CPP_KEEP_COMMENTS=true; else AC_MSG_WARN([Default pre-processing command '$CPP' do not preserve comments. Please define an appropriate pre-processor with --with-cpp, or you will only be able to use ACSL annotations in already pre-processed files]) FRAMAC_DEFAULT_CPP=$CPP; DEFAULT_CPP_KEEP_COMMENTS=false; fi; else # handling old version of autoconf (<2.67) that does not keep # preprocessor result in conftest.i AC_MSG_WARN([Unable to check whether $CPP preserves comments. Assuming everything is fine]) FRAMAC_DEFAULT_CPP="$CPP $CPPFLAGS"; DEFAULT_CPP_KEEP_COMMENTS=true; fi ], [AC_MSG_WARN([Unable to find a working pre-processor. Please define one with --with-cpp, or you will be able to launch Frama-C only on pre-processed files])]; FRAMAC_DEFAULT_CPP=""; DEFAULT_CPP_KEEP_COMMENTS=false; ) AC_MSG_RESULT(Default preprocessor is '$FRAMAC_DEFAULT_CPP'.) FRAMAC_DEFAULT_CPP_ARGS=$CPPFLAGS # Test if preprocessor supports options such as -m16/-m32/-m64 DEFAULT_CPP_SUPPORTED_ARCH_OPTS= # Store original value of CPPFLAGS before doing tests OLD_CPPFLAGS=$CPPFLAGS rm -f conftest.i CPPFLAGS="$OLD_CPPFLAGS -m32" AC_PREPROC_IFELSE( [AC_LANG_SOURCE([/* Check if preprocessor supports option -m32 */])], [if test -e conftest.i; then DEFAULT_CPP_SUPPORTED_ARCH_OPTS+='\"-m32\"; '; fi], []) rm -f conftest.i CPPFLAGS="$OLD_CPPFLAGS -m64" AC_PREPROC_IFELSE( [AC_LANG_SOURCE([/* Check if preprocessor supports option -m64 */])], [if test -e conftest.i; then DEFAULT_CPP_SUPPORTED_ARCH_OPTS+='\"-m64\"; '; fi], []) rm -f conftest.i CPPFLAGS="$OLD_CPPFLAGS -m16" AC_PREPROC_IFELSE( [AC_LANG_SOURCE([/* Check if preprocessor supports option -m16 */])], [if test -e conftest.i; then DEFAULT_CPP_SUPPORTED_ARCH_OPTS+='\"-m16\"; '; fi], []) # revert CPPFLAGS to original value CPPFLAGS=$OLD_CPPFLAGS AC_MSG_RESULT(Default preprocessor supported architecture-related options: $DEFAULT_CPP_SUPPORTED_ARCH_OPTS) ################# # Plugin wished # ################# new_section "wished frama-c plug-ins" # Option -with-no-plugin ####################### define([NO_PLUGIN_HELP], AC_HELP_STRING([--with-no-plugin], [disable all plug-ins (default: no)])) AC_ARG_WITH(no-plugin,NO_PLUGIN_HELP,[ONLY_KERNEL=$withval],[ONLY_KERNEL=no]) # library declarations ###################### # REQUIRE_LIBRARY: library *must* be present in order to build plugins # USE_LIBRARY: better for plugins if library is present, but not required # HAS_LIBRARY: is the library available? REQUIRE_LABLGTK= USE_LABLGTK= HAS_LABLGTK= # Tool declarations #################### DOT= REQUIRE_DOT= USE_DOT= HAS_DOT= ### Now plugin declarations PLUGINS_FORCE_LIST= ############################################################################### # # #################### # # Plug-in sections # # #################### # # # # For 'internal' developers: # # Add your own plug-in here # # # ############################################################################### # callgraph ########### check_plugin(callgraph, src/plugins/callgraph, [support for callgraph plugin], yes) plugin_use_external(callgraph,dot) plugin_use(callgraph,gui) plugin_use(callgraph,eva) # constant propagation ###################### check_plugin(semantic_constant_folding, src/plugins/constant_propagation, [support for constant propagation plugin],yes) plugin_require(semantic_constant_folding,eva) # from ###### check_plugin(from_analysis,src/plugins/from,[support for from analysis],yes) plugin_require(from_analysis,eva) plugin_require(from_analysis,callgraph) # gui ##### check_plugin(gui,src/plugins/gui,[support for gui],yes) plugin_require_external(gui,lablgtk) plugin_use_external(gui,gnomecanvas) plugin_require_external(gui,gtksourceview) plugin_use_external(gui,dot) # impact ######## check_plugin(impact,src/plugins/impact,[support for impact plugin],yes) plugin_use(impact,gui) plugin_use(impact,slicing) plugin_require(impact,pdg) plugin_require(impact,eva) plugin_require(impact,inout) # inout ####### check_plugin(inout,src/plugins/inout,[support for inout analysis],yes) plugin_require(inout,from_analysis) plugin_require(inout,eva) plugin_require(inout,callgraph) # metrics ######### check_plugin(metrics,src/plugins/metrics,[support for metrics analysis],yes) plugin_require(metrics,eva) plugin_use(metrics,gui) # occurrence ############ check_plugin(occurrence,src/plugins/occurrence, [support for occurrence analysis],yes) plugin_use(occurrence,gui) plugin_require(occurrence,eva) # pdg ##### check_plugin(pdg,src/plugins/pdg,[support for pdg plugin],yes,pdg_types) plugin_require(pdg,from_analysis) plugin_require(pdg,eva) plugin_require(pdg,callgraph) # postdominators ################ check_plugin(postdominators,src/plugins/postdominators, [support for postdominators plugin],yes) # rte ##### check_plugin(rtegen,src/plugins/rte, [support for runtime error annotation],yes) # scope ############ check_plugin(scope,src/plugins/scope,[support for scope plugin],yes) plugin_require(scope,postdominators) plugin_require(scope,eva) plugin_require(scope,from_analysis) plugin_require(scope,pdg) plugin_use(scope,gui) # slicing ######### check_plugin(slicing,src/plugins/slicing,[support for slicing plugin],yes) plugin_require(slicing,from_analysis) plugin_require(slicing,pdg) plugin_require(slicing,eva) plugin_require(slicing,callgraph) plugin_use(slicing,gui) # spare code ############ check_plugin(sparecode,src/plugins/sparecode, [support for sparecode plugin],yes) plugin_require(sparecode,pdg) plugin_require(sparecode,eva) # users ####### check_plugin(users,src/plugins/users,[support for users analysis],yes) plugin_require(users,eva) plugin_use(users,callgraph) # value ####### check_plugin(eva,src/plugins/value, [support for value analysis],yes) plugin_use(eva,gui) plugin_use(eva,scope) plugin_use(eva,callgraph) #################### # External plugins # #################### EXTRA_EXTERNAL_PLUGINS= AC_ARG_ENABLE(external, [[ --enable-external=plugin allows to compile directly from Frama-C kernel some external plug-ins.]], [ for dir in $enableval; do if test -d $dir; then AC_MSG_NOTICE([external plug-in $dir found.]) EXTRA_EXTERNAL_PLUGINS="$EXTRA_EXTERNAL_PLUGINS $dir" olddir=$(pwd) cd $dir; if test -x ./configure; then new_section "configure plug-in $dir" ./configure --prefix=$prefix --datarootdir=$datarootdir \ --exec_prefix=$exec_prefix --bindir=$bindir --libdir=$datadir/frama-c \ --host=$host --build=$build --mandir=$mandir \ || \ AC_MSG_ERROR([cannot configure requested external plugin in $dir]) fi; cd $olddir else AC_MSG_ERROR([--enable-external expects an existing directory as argument.]) fi; done ]) AC_FOREACH([__plugin],m4_esyscmd([ls src/plugins]), [ m4_if(m4_regexp(KNOWN_SRC_DIRS,`\<__plugin\>'),[-1], [ m4_define([plugin_dir],[src/plugins/__plugin]) m4_syscmd(test -r plugin_dir/configure.in) m4_define([is_configure_in],m4_sysval) m4_syscmd(test -r plugin_dir/configure.ac) m4_define([is_configure_ac],m4_sysval) m4_define([config_file], [m4_if(is_configure_in,0,plugin_dir/configure.in, m4_if(is_configure_ac,0,plugin_dir/configure.ac,no))]) m4_if(config_file,[no], [ m4_syscmd(test -r plugin_dir/Makefile) m4_if(m4_sysval,[0], [ m4_syscmd(test "$DISTRIB_CONF" = "yes" && \ grep -q -e "PLUGIN_DISTRIBUTED *:= *no" \ plugin_dir/Makefile ) m4_if(m4_sysval,[0],, [ check_plugin(__plugin,plugin_dir, [support for __plugin plug-in],yes) if test "$[ENABLE_]tovarname(__plugin)" != "no"; then EXTERNAL_PLUGINS="$EXTERNAL_PLUGINS plugin_dir"; fi])])], [ m4_syscmd(test "$DISTRIB_CONF" = "yes" && \ grep -q -e "PLUGIN_DISTRIBUTED:=no" \ plugin_dir/Makefile.in) m4_if(m4_sysval,[0],, [ m4_define([plugin_prefix],plugin_dir) m4_include(config_file) m4_syscmd(cd plugin_dir && \ [FRAMAC_SHARE]=../../../share autoconf)]) ]) m4_undefine([plugin_dir]) ]) ]) ##################################################### # Check for tools/libraries requirements of plugins # ##################################################### new_section "configure tools and libraries used by some plug-ins" # lablgtk2 ########## define([ENABLE_LABLGTK3_HELP], AC_HELP_STRING([--disable-lablgtk3], [in case lablgtk2 and lablgtk3 are available, the default is to compile against lablgtk3. Use this option to force compiling against lablgtk2])) AC_ARG_ENABLE( lablgtk3,[ENABLE_LABLGTK3_HELP], [ENABLE_LABLGTK3=$enableval],[ENABLE_LABLGTK3=yes]) REQUIRE_LABLGTK="$REQUIRE_LABLGTK$REQUIRE_GNOMECANVAS" USE_LABLGTK="$USE_LABLGTK$USE_GNOMECANVAS" LABLGTK_PATH="" SOURCEVIEW_PATH="" if test "$PLATFORM" != "MacOS"; then if test "$ENABLE_LABLGTK3" = "yes"; then LABLGTK_PATH=`ocamlfind query lablgtk3 | tr -d '\\r\\n'`; fi if test "$LABLGTK_PATH" != ""; then SOURCEVIEW_PATH=`ocamlfind query lablgtk3-sourceview3 | tr -d '\\r\\n'`; fi fi if test "$SOURCEVIEW_PATH" = ""; then LABLGTK_VERSION=2 LABLGTK_PATH=`ocamlfind query lablgtk2 | tr -d '\\r\\n'` if test "$LABLGTK_PATH" = "" -o \ "$LABLGTK_PATH" -ef "$OCAMLLIB/lablgtk2" ; then echo "Ocamlfind -> using +lablgtk2.($LABLGTK_PATH,$OCAMLLIB/lablgtk2)" LABLGTK_PATH=+lablgtk2 LABLGTKPATH_FOR_CONFIGURE=$OCAMLLIB/lablgtk2 else echo "Ocamlfind -> using $LABLGTK_PATH" LABLGTKPATH_FOR_CONFIGURE=$LABLGTK_PATH fi; SOURCEVIEW_PATH=$LABLGTKPATH_FOR_CONFIGURE; else LABLGTK_VERSION=3 echo "ocamlfind -> using $LABLGTK_PATH" LABLGTKPATH_FOR_CONFIGURE=$LABLGTK_PATH; fi configure_library([GTKSOURCEVIEW], [$SOURCEVIEW_PATH/lablgtksourceview2.$LIB_SUFFIX, $SOURCEVIEW_PATH/lablgtk3_sourceview3.$LIB_SUFFIX], [lablgtksourceview not found], no) configure_library([GNOMECANVAS], [$LABLGTKPATH_FOR_CONFIGURE/lablgnomecanvas.$LIB_SUFFIX], [lablgnomecanvas.$LIB_SUFFIX not found], no) configure_library([LABLGTK], [$LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX, $LABLGTKPATH_FOR_CONFIGURE/lablgtk3.$LIB_SUFFIX], [$LABLGTKPATH_FOR_CONFIGURE/lablgtk.$LIB_SUFFIX not found.], no) # dot and xdot tools #################### configure_tool([DOT],[dot],[dot not found: you should install GraphViz],no) ######################## # Plug-in dependencies # ######################## new_section "checking for plug-in dependencies" check_frama_c_dependencies ############################ # Substitutions to perform # ############################ EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} ${EXTRA_EXTERNAL_PLUGINS}" AC_SUBST(PLATFORM) AC_SUBST(VERBOSEMAKE) AC_SUBST(DEVELOPMENT) AC_SUBST(DOT) AC_SUBST(HAS_DOT) AC_SUBST(HAS_APRON) AC_SUBST(HAS_MPFR) AC_SUBST(HAS_LANDMARKS) AC_SUBST(LABLGTK_VERSION) AC_SUBST(OCAMLBEST) AC_SUBST(OCAMLVERSION) AC_SUBST(OCAMLLIB) AC_SUBST(OCAMLWIN32) AC_SUBST(OCAML_ANNOT_OPTION) AC_SUBST(EXE) AC_SUBST(HAVE_STDLIB_H) AC_SUBST(HAVE_WCHAR_H) AC_SUBST(HAVE_PTRDIFF_H) AC_SUBST(HAVE_BUILTIN_VA_LIST) AC_SUBST(THREAD_IS_KEYWORD) AC_SUBST(UNDERSCORE_NAME) AC_SUBST(CYCLES_PER_USEC) AC_SUBST(LOCAL_MACHDEP) AC_SUBST(datarootdir) AC_SUBST(FRAMAC_DEFAULT_CPP) AC_SUBST(FRAMAC_DEFAULT_CPP_ARGS) AC_SUBST(DEFAULT_CPP_SUPPORTED_ARCH_OPTS) AC_SUBST(FRAMAC_GNU_CPP) AC_SUBST(DEFAULT_CPP_KEEP_COMMENTS) AC_SUBST(CC) AC_SUBST(EXTERNAL_PLUGINS) AC_SUBST(LABLGTK_PATH) # m4_foreach_w is not supported in some old autoconf versions. # Sadly AC_FOREACH is deprecated now... AC_FOREACH([p],PLUGINS_LIST, [AC_SUBST([ENABLE_]p) ]) ################################################ # Finally create the Makefile from Makefile.in # ################################################ new_section "creating makefile" AC_CONFIG_FILES([share/Makefile.config], [chmod a-w share/Makefile.config]) AC_OUTPUT() ########### # Summary # ########### new_section "summary: plug-ins available" for plugin in m4_flatten(PLUGINS_LIST); do n=NAME_$plugin e=ENABLE_$plugin i=INFO_$plugin eval nv=\$$n eval ev=\$$e eval iv=\$$i AC_MSG_NOTICE([$nv: $ev$iv]) done if test "$EXTRA_EXTERNAL_PLUGINS" != ""; then new_section "summary: requested external plugins" fi for plugin in $EXTRA_EXTERNAL_PLUGINS; do AC_MSG_NOTICE([$plugin]) done frama-c-20.0-Calcium/doc/0000777000000000000000000000000013571573400011760 5ustar frama-c-20.0-Calcium/doc/Makefile0000666000000000000000000000543413571573400013426 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # This file just download the manuals in the released version all:download FRAMAC_SRC=.. MAKECONFIG_DIR=$(FRAMAC_SRC)/share include $(FRAMAC_SRC)/share/Makefile.common DOCDIR ?= "$(DESTDIR)${prefix}/share/doc" FRAMAC_DOCDIR ?= $(DOCDIR)/frama-c ################### # Frama-C Version # ################### VERSION=$(shell $(SED) -e 's/\\(.*\\)/\\1/' $(FRAMAC_SRC)/VERSION) ifeq ($(findstring +dev,$(VERSION)),+dev) DEVELOPMENT=yes else DEVELOPMENT=no endif ### .PHONY: force MANUALS=acsl #MANUALS that depend on the frama-c version VERSIONED_MANUALS=acsl-implementation aorai-manual rte-manual \ wp-manual metrics-manual user-manual \ plugin-development-guide eva-manual FILES= $(addprefix manuals/, \ $(addsuffix -$(VERSION).pdf, $(VERSIONED_MANUALS)) \ $(addsuffix .pdf, $(MANUALS)) \ ) ifeq ($(DEVELOPMENT),yes) download: force @echo "You can't download the manuals in this way for the development version" else download: force $(MKDIR) manuals wget -nv -N -P manuals \ $(addprefix http://frama-c.com/download/,$(addsuffix -$(VERSION).pdf, $(VERSIONED_MANUALS))) \ $(addprefix http://frama-c.com/download/,$(addsuffix .pdf, $(MANUALS))) endif install: $(MKDIR) $(FRAMAC_DOCDIR) $(CP) $(FILES) $(FRAMAC_DOCDIR) frama-c-20.0-Calcium/doc/README0000666000000000000000000000116113571573400012637 0ustar The main source of documentation for the Frama-C distribution can be downloaded by running `make` in the directory of this README. Then the manuals directory will contain the following manuals * acsl is the reference manual of the specification manual * acsl-implementation is a copy of the ACSL reference manual with some implementation-specific remarks. In particular, it explains which features are not currently supported by Frama-C * user-manal describes the use of frama-c * plugin-development-guide provides information needed to develop a Frama-C plugin * the other manuals document specific plug-ins frama-c-20.0-Calcium/doc/code/0000777000000000000000000000000013571573400012672 5ustar frama-c-20.0-Calcium/doc/code/docgen.ml0000666000000000000000000003467213571573400014477 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Odoc_module open Odoc_info open Odoc_html let doc_path = ref "." let lib_files = ref [] let add_libfiles analyse s = let f = Odoc_global.Intf_file s in lib_files := (String.capitalize (Filename.chop_extension (Filename.basename s))) :: !lib_files; if analyse then Odoc_global.files := f :: !Odoc_global.files let rec root_name s = let simple = Odoc_info.Name.simple s in let father = Odoc_info.Name.father s in if father = "" then simple else root_name father let equal_module_name m s = let n = m.m_name in n = s && n = root_name n let equal_module m1 m2 = equal_module_name m1 m2.m_name type chapter = Chapter of int * string * string | Directory of string let compare_chapter c1 c2 = match c1 , c2 with | Chapter(a,_,_) , Chapter(b,_,_) -> a-b | Directory a , Directory b -> compare a b | Chapter _ , Directory _ -> (-1) | Directory _ , Chapter _ -> 1 let merge3 (s1 : 'a -> 'a -> int) (s2 : 'b -> 'b -> int) (s3 : 'c -> 'c -> int) (triplets : ('a * 'b * 'c) list) : ('a * ('b * 'c list) list) list = let sort3_rev s1 s2 s3 (x,y,z) (x',y',z') = let c = s1 x' x in if c <> 0 then c else let c = s2 y' y in if c <> 0 then c else s3 z' z in let rec merge3_rev acc triplets = match triplets , acc with | [] , _ -> acc | (a,b,c)::tail , (dir_a,all_a)::a_merged when a = dir_a -> begin match all_a with | (dir_b,all_b)::b_merged when b = dir_b -> merge3_rev ((dir_a,(dir_b,c::all_b)::b_merged)::a_merged) tail | _ -> merge3_rev ((dir_a,(b,[c])::all_a)::a_merged) tail end | (a,b,c)::tail , merged -> merge3_rev (( a , [b,[c]] )::merged) tail in merge3_rev [] (List.sort (sort3_rev s1 s2 s3) triplets) module Generator (G:Odoc_html.Html_generator) = struct class html = object (self) inherit G.html as super val mutable memo = [] method private loaded_modules = match memo with | [] -> let l = List.flatten (List.map (fun f -> Odoc_info.verbose (Odoc_messages.loading f); try let l = Odoc_analyse.load_modules f in Odoc_info.verbose Odoc_messages.ok; l with Failure s -> prerr_endline s ; incr Odoc_global.errors ; [] ) !Odoc_global.load ) in memo <- l; l | (_ :: _) as l -> l method private path s = let name = root_name s in if List.exists (fun m -> m = name) !lib_files then "http://caml.inria.fr/pub/docs/manual-ocaml/libref/" else if List.exists (fun m -> m.m_name = name) self#loaded_modules then !doc_path ^ "/" else "./" method create_fully_qualified_idents_links m_name s = let f str_t = let match_s = Str.matched_string str_t in let rel = Odoc_info.Name.get_relative m_name match_s in let s_final = Odoc_info.apply_if_equal Odoc_info.use_hidden_modules match_s rel in if StringSet.mem match_s known_types_names then "" ^ s_final ^ "" else if StringSet.mem match_s known_classes_names then let (html_file, _) = Naming.html_files match_s in ""^s_final^"" else s_final in let s2 = Str.global_substitute (Str.regexp "\\([A-Z]\\([a-zA-Z_'0-9]\\)*\\.\\)+\\([a-z][a-zA-Z_'0-9]*\\)") f s in s2 (** Take a string and return the string where fully qualified module idents have been replaced by links to the module referenced by the ident.*) method create_fully_qualified_module_idents_links m_name s = let f str_t = let match_s = Str.matched_string str_t in let rel = Odoc_info.Name.get_relative m_name match_s in let s_final = Odoc_info.apply_if_equal Odoc_info.use_hidden_modules match_s rel in if StringSet.mem match_s known_modules_names then let (html_file, _) = Naming.html_files match_s in ""^s_final^"" else s_final in let s2 = Str.global_substitute (Str.regexp "\\([A-Z]\\([a-zA-Z_'0-9]\\)*\\.\\)+\\([A-Z][a-zA-Z_'0-9]*\\)") f s in s2 (** redefine from file odoc_html.ml *) method html_of_Module_list b l = let dir f = (* , *) let chop dir f = let n = Str.search_forward (Str.regexp dir) f 0 in let f = String.sub f n (String.length f - n) in let d = Filename.dirname f in String.capitalize (Filename.basename d) in try Chapter(1,"Kernel Services","src/kernel_services"), chop "kernel_services/" f with Not_found -> try Chapter(2,"Libraries","src/libraries"), chop "libraries/" f with Not_found -> try Chapter(3,"Kernel Internals","src/kernel_internals"), chop "kernel_internals/" f with Not_found -> let d = Filename.dirname f in Directory (Filename.basename (Filename.dirname d)) , String.capitalize (Filename.basename d) in let structured_modules (* chapter, section, module *) = (List.map (fun name -> let m = List.find (fun m -> m.m_name = name) self#list_modules in let dir,name = dir m.m_file in dir,name,m) l) in let toc_modules (* chapter/section/modules *) = merge3 compare_chapter compare compare structured_modules in List.iter (fun (chapter, subdirs) -> let dir = ( match chapter with | Chapter (n,a,d) -> bp b "

    Chapter %d. %s

    " n a ; d | Directory d -> bp b "

    Directory %s

    " d ; d) in List.iter (fun (subdir,modules) -> bp b "

    Section %s (in %s/%s)

    \n" subdir dir (String.lowercase subdir) ; bs b "
    \n\n"; List.iter (fun m -> bs b "" html m.m_name; bs b "\n") modules; bs b "
    "; (try let (html, _) = Naming.html_files m.m_name in bp b "%s"; self#html_of_info_first_sentence b m.m_info; with Not_found -> Odoc_global.pwarning (Odoc_messages.cross_module_not_found m.m_name); bp b "%s" m.m_name); bs b "
    \n") subdirs) toc_modules (** Print html code for an included module. *) method html_of_included_module b im = bs b "
    ";
          bs b ((self#keyword "include")^" ");
          (
            match im.im_module with
              None ->
                bs b im.im_name
            | Some mmt ->
              let (file, name) =
                match mmt with
                  Mod m ->
                    let (html_file, _) = Naming.html_files m.m_name in
                    (html_file, m.m_name)
                | Modtype mt ->
                  let (html_file, _) =
    		Naming.html_files mt.mt_name
    	      in
                  (html_file, mt.mt_name)
              in
              bp b "%s" (self#path name) file name
          );
          bs b "
    \n"; self#html_of_info b im.im_info (** Generate all the html files from a module list. The main file is [.html]. *) method generate module_list = (* init the style *) self#init_style ; (* init the lists of elements *) list_values <- Odoc_info.Search.values module_list ; list_exceptions <- Odoc_info.Search.exceptions module_list ; list_types <- Odoc_info.Search.types module_list ; list_attributes <- Odoc_info.Search.attributes module_list ; list_methods <- Odoc_info.Search.methods module_list ; list_classes <- Odoc_info.Search.classes module_list ; list_class_types <- Odoc_info.Search.class_types module_list ; list_modules <- Odoc_info.Search.modules module_list ; list_module_types <- Odoc_info.Search.module_types module_list ; (* prepare the page header *) self#prepare_header module_list ; (* Get the names of all known types. *) let types = Odoc_info.Search.types module_list in known_types_names <- List.fold_left (fun acc t -> StringSet.add t.Odoc_type.ty_name acc) known_types_names types ; (* Get the names of all class and class types. *) let classes = Odoc_info.Search.classes module_list in let class_types = Odoc_info.Search.class_types module_list in known_classes_names <- List.fold_left (fun acc c -> StringSet.add c.Odoc_class.cl_name acc) known_classes_names classes ; known_classes_names <- List.fold_left (fun acc ct -> StringSet.add ct.Odoc_class.clt_name acc) known_classes_names class_types ; (* Get the names of all known modules and module types. *) let module_types = Odoc_info.Search.module_types module_list in let modules = Odoc_info.Search.modules module_list in known_modules_names <- List.fold_left (fun acc m -> StringSet.add m.m_name acc) known_modules_names modules ; known_modules_names <- List.fold_left (fun acc mt -> StringSet.add mt.mt_name acc) known_modules_names module_types ; (* generate html for each module *) let keep_list = let keep m = not (List.exists (equal_module m) self#loaded_modules) && not (List.exists (equal_module_name m) !lib_files) in List.filter keep module_list in if not !Odoc_html.index_only then self#generate_elements self#generate_for_module keep_list ; (* reinit the lists of elements *) list_values <- Odoc_info.Search.values keep_list ; list_exceptions <- Odoc_info.Search.exceptions keep_list ; list_types <- Odoc_info.Search.types keep_list ; list_attributes <- Odoc_info.Search.attributes keep_list ; list_methods <- Odoc_info.Search.methods keep_list ; list_classes <- Odoc_info.Search.classes keep_list ; list_class_types <- Odoc_info.Search.class_types keep_list ; list_modules <- Odoc_info.Search.modules keep_list ; list_module_types <- Odoc_info.Search.module_types keep_list ; try self#generate_index keep_list; self#generate_values_index keep_list ; self#generate_exceptions_index keep_list ; self#generate_types_index keep_list ; self#generate_attributes_index keep_list ; self#generate_methods_index keep_list ; self#generate_classes_index keep_list ; self#generate_class_types_index keep_list ; self#generate_modules_index keep_list ; self#generate_module_types_index keep_list ; with Failure s -> prerr_endline s ; incr Odoc_info.errors method private html_of_plugin_developer_guide _t = "Consult the Plugin Development Guide for additional details.
    \n" method private html_of_ignore _t = "" method private html_of_modify t = match t with | [] -> Odoc_info.warning "Found an empty @modify tag"; "" | Raw s :: l -> let time, explanation = try let idx = String.index s ' ' in String.sub s 0 idx, ":" ^ String.sub s idx (String.length s - idx) with Not_found -> s, "" in let text = Bold [ Raw "Change in "; Raw time ] :: Raw explanation :: l in let buf = Buffer.create 7 in self#html_of_text buf text; Buffer.add_string buf "
    \n"; Buffer.contents buf | _ :: _ -> assert false method private html_of_call t = match t with | [] -> Odoc_info.warning "Found an empty @call tag"; "" | l -> let buf = Buffer.create 97 in Buffer.add_string buf "Access it by "; self#html_of_text buf l; Buffer.add_string buf "\n"; Buffer.contents buf (* Write the subtitle (eg. "Frama-C Kernel" after the main title instead of before, for users that use many tabs in their browser *) method inner_title s = match self#title with "" -> "" | t -> self#escape s ^ " - " ^ t initializer tag_functions <- ("modify", self#html_of_modify) :: ("ignore", self#html_of_ignore) :: ("call", self#html_of_call) :: ("plugin", self#html_of_plugin_developer_guide) :: tag_functions end end let () = Odoc_args.extend_html_generator (module Generator: Odoc_gen.Html_functor); Odoc_args.add_option ("-docpath", Arg.Set_string doc_path, "Frama-C documentation directory"); Odoc_args.add_option ("-stdlib", Arg.String (add_libfiles true), "Standard library files"); Odoc_args.add_option ("-stdlib-path", Arg.String (add_libfiles false), "Standard library files") frama-c-20.0-Calcium/doc/code/intro_kernel_plugin.txt0000666000000000000000000000402113571573400017501 0ustar #*************************************************************************# #* # #* This file is part of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat à l'énergie atomique et aux énergies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 API Documentation} The _PluginName_ plugin is integrated with the Frama-C kernel: - {{:../index.html}Frama-C} complete kernel API - {{:../html/Db._PluginName_.html}_PluginName_} available kernel API {2 Internal Documentation} - {{:modules.svg}_PluginName_} architecture (SVG format) - Index of {{:index_modules.html}Modules} - Index of {{:index_types.html}Types} - Index of {{:index_values.html}Values} - Index of {{:index_exceptions.html}Exceptions} frama-c-20.0-Calcium/doc/code/intro_occurrence.txt0000666000000000000000000000420013571573400016772 0ustar #*************************************************************************# #* # #* This file is part of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat à l'énergie atomique et aux énergies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 Overview} The Occurrence module aims at highlighting the occurrence of any variable in the Frama-C GUI. Details about the use of this plugin may be found in {{:http://frama-c.cea.fr/occurrence.html}the user documentation}. {2 Inside the plug-in} The code of this plug-in is quite simple. It is splitted into the analysis itself and the extension to the GUI. The code of this plug-in is quite short but uses most advanced Frama-C features (visitor, projects, journalisation, log, gui). So it is a good complete not-toy example of a (kernel-integrated) Frama-C plug-in. frama-c-20.0-Calcium/doc/code/intro_pdg.txt0000666000000000000000000001204413571573400015421 0ustar #*************************************************************************# #* # #* This file is part of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat à l'énergie atomique et aux énergies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 Overview} The main modules are : - {!module: PdgIndex} that can be used to store different kind of information related to a function (not only related to PDG) - the types are defined in {!module: PdgTypes}. - the PDG computation is done in {!module: Build}. It also use the lexical successor graph, which is computed in {!module:Lexical_successors}. - {!module:Sets} provides functions to read a PDG. - {!module:Print} provides functions to print a PDG either in textual form or in a dot file (See {i "How to see a PDG"} below). {2 What is a PDG ?} A {b Program Dependences Graph} represent the dependences between the statements of a function. So the nodes of the graph mainly represent the statements (some more nodes are used to represents things like declarations, inputs, outputs, etc.) and the edges represent the dependences. [Y -> X] means that the computation of the statement Y depend on (the result of) the statement X. Example : {C {v X : x = a + b; Y : y = x + 1; v}} There are three kinds of dependencies : - a {b data} dependency : the simpler one, illustrated by the above example, - a {b control} dependency : {C Example : {v if (c) X : x = a + b; v}} X is control dependent on (c) because the statement will be executed or not according to the evaluation of the condition, - an {b address} dependency : dependencies on the elements that are used to compute the left part of an assignment, ie that decide which data will be modified. {C Example : {v t[i] = 3; v}} We say that this statement have address dependencies on the declaration of [tab] and the computation of [i]. A dependency between two nodes can have any combination of these kinds. You can find more documentation, particularly on how this graph is built, in this {{:../../pdg/index.html}report} (in French). {2 Dynamic dependencies} After having built the PDG for a function, there is a way of adding dynamically some dependencies to it. There are not stored directly in the PDG so they can be cleared later on. As PDG doesn't interpret the annotations of the code, this feature can for instance be used to add dependencies on assertions. To see an example of how to use it, please have a look at [tests/pdg/dyn_dpds.ml]. {2 How to see a PDG ?} Please, use the [-help] option of the tool to get the PDG options names. The PDG of a function can be seen either in textual form or exported in a {b dot} file which is the format of the {{:http://www.graphviz.org/}Graphviz} tool set. They can be viewed using {{:http://zvtm.sourceforge.net/zgrviewer.html}zgrviewer} or exported in SVG format to be seen with some browser or {{:http://www.inkscape.org/}Inkscape}. The graph is unfortunately generated with the output of the function at the top and its inputs at the bottom. If you find it uncomfortable to read, just change [TB] by [BT] in the [rankdir] property at the beginning of the dot file before viewing it. The color and the shape of the nodes are used to make it easier to read the graph, but add no more meaning. For the edges : - the color (blue) represent the {b data} dependency, - the shape of the arrow (circled) represent the {b control} dependency, - and the kind of line (dotted) represent the {b address} dependency. So a solid blue edge with a circle arrow represent a data+control dependency for instance, while a dotted black edge with a triangle arrow represent a address dependency. You are invited to look at {{:../../../tests/pdg/doc.g.svg}a simple example} to see the different kinds of dependencies. frama-c-20.0-Calcium/doc/code/intro_plugin.txt0000666000000000000000000000425513571573400016152 0ustar #*************************************************************************# #* # #* This file is part of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat à l'énergie atomique et aux énergies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 API Documentation} The _PluginName_ API is dynamically registered: - {{:../dynamic_plugins/Dynamic_plugins._PluginName_.html} _PluginName_} API - {{:../dynamic_plugins/Dynamic_plugins.html} Dynamically registered plugins} index - {{:../index.html}Frama-C} complete kernel API - {{:../html/Dynamic.html}Dynamic} kernel registry for plugins' API {2 Plugin Internal Documentation} - {{:modules.svg}_PluginName_} architecture (SVG format) - Index of {{:index_modules.html}Modules} - Index of {{:index_types.html}Types} - Index of {{:index_values.html}Values} - Index of {{:index_exceptions.html}Exceptions} frama-c-20.0-Calcium/doc/code/intro_plugin_D_and_S.txt0000666000000000000000000000445513571573400017523 0ustar #*************************************************************************# #* # #* This file is part of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat à l'énergie atomique et aux énergies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 Dynamic Entry Points} The _PluginName_ plugin is integrated with the Frama-C kernel: - {{:../index.html}Frama-C} complete kernel API - {{:../html/Db._PluginName_.html}_PluginName_} available kernel API This plugin is also dynamically registered: - {{:../dynamic_plugins/Dynamic_plugins._PluginName_.html}_PluginName_} dynamic API - {{:../dynamic_plugins/Dynamic_plugins.html}dynamically registered plugins} index - {{:../html/Dynamic.html}Dynamic} kernel registery for plugins' API {2 Internal Structure} - {{:modules.svg}_PluginName_} architecture (SVG format) - Index of {{:index_modules.html}Modules} - Index of {{:index_types.html}Types} - Index of {{:index_values.html}Values} - Index of {{:index_exceptions.html}Exceptions} frama-c-20.0-Calcium/doc/code/intro_plugin_default.txt0000666000000000000000000000414213571573400017651 0ustar #*************************************************************************# #* # #* This file is part of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat à l'énergie atomique et aux énergies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 API Documentation} The _PluginName_ API is dynamically registered. - {{:../index.html}Frama-C} complete kernel API - {{:../html/Dynamic.html}Dynamic} kernel registry for plugins' API - {{:../dynamic_plugins/Dynamic_plugins.html} Dynamically registered plugins} API index {2 Plugin Internal Documentation} - {{:modules.svg}_PluginName_} architecture (SVG format) - Index of {{:index_modules.html}Modules} - Index of {{:index_types.html}Types} - Index of {{:index_values.html}Values} - Index of {{:index_exceptions.html}Exceptions} frama-c-20.0-Calcium/doc/code/intro_scope.txt0000666000000000000000000000377013571573400015766 0ustar #*************************************************************************# #* # #* This file is part of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat à l'énergie atomique et aux énergies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 Overview} See how to use the plugin in the {{:../../www/src/scope.html}user documentation}. (see also {{:../../scope/scope.txt}there} for a discussion on how we arrived to those definitions) {2 Inside the plugin} The code of this plugin is quite simple. It is only composed of : - {!module:Datascope_gui} that handles the GUI part, - and {!module:Datascope} that makes the computations. Some explanations can be found in the code. frama-c-20.0-Calcium/doc/code/intro_slicing.txt0000666000000000000000000001062513571573400016302 0ustar #*************************************************************************# #* # #* This file is part of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat à l'énergie atomique et aux énergies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 Overview} To have more details about what we are trying to do, you may have a look to the {{:../../slicing/index.html}specification} report (in French). The internal types module ({!module:SlicingTypes.Internals}) can give a pretty good idea of the kind of objects that we deal with in this module. You can also find some general information below. {3 Project} The project was the global repository of the results obtained so far. If is mainly composed of a list of actions waiting to be applied, and the already computed slices. More precisely, see its type definition {!type:SlicingTypes.Internals.t_project} if you want to know what it is composed of, and the module {!module:SlicingProject} of the functions to handle it. {3 Program Dependence Graph} This computation is not part of this module anymore. See the {{:../html/Db.Pdg.html}API of Pdg module}. It is enough to know that the PDG of a function is a graph composed of nodes that represent the elements of a function (declarations, statements, and so on) and of edges that represent the dependencies relations between those elements. {3 Sliced function} A sliced function contains a mapping between the PDG nodes of a function and the some marks that are computed by the application of the actions. It also has a mapping between the function calls and the function called by the slice that can be either some other slices, or the source function (or nothing if the call is invisible in that slice). There can be more than one slice for a source function. See their type {!type:SlicingTypes.Internals.t_fct_slice}, and the associated functions in {!module:Fct_slice}. See also {!module:SlicingMarks} for more information about the low level marks computation. {3 Actions} The actions are the way of giving an order to modify the current application. There are many kinds of actions, but only one is really used to build the slice which is a list of nodes from the PDG of a function, and their associated marks. All the other actions dealing with the marks are first decomposed before being applied. Some other actions are can be used to manage the interprocedural part, ie. which slice to call where. See the top type {!type:SlicingTypes.Internals.t_criterion} or the functions in {!module:SlicingActions}. {3 Options} The propagation of the marks to the function call depend on a {!type:SlicingTypes.Internals.t_call_option}. Chosing this level makes it possible to obtain a more or less precise result. {3 High level commands} The module {!module:SlicingCmds} is a bit external because it only uses the {{:../html/Db.Pdg.html}slicing API} to define higher level function that are only a composition of the basic functions. {3 Producing a result } When there are non more actions in the task list, the project can be exported. This is done in {!module:SlicingTransform} module by building a new CIL application. frama-c-20.0-Calcium/doc/code/intro_sparecode.txt0000666000000000000000000000535713571573400016625 0ustar #*************************************************************************# #* # #* This file is part of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat à l'énergie atomique et aux énergies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 Overview} The Sparecode module aims at removing the unused code. It is composed of to parts : - one (in module {!module:Marks}) that computes some information to say what has to be kept in the result. It uses the generic PDG marking facility {{:../pdg/PdgMarks.html}PdgMarks}+{{:../pdg/Marks.html}Marks}, - and a second one (module {!module:Transform}) that read thoses results to produce a new application. This part mainly use {{:../html/Filter.html}Filter} which provides a functor that filters an application to create another one. To select the useful statements, we start from the [main] outputs and the reachable annotations, and mark backward all the dependencies. When reaching a function call, the called function statements are also marked according to the needed outputs, but the inputs are not propagated immediately because it would make every function call visible. The information provided by the PDG marking system is kept to be used later. So, after the first step, we iterate on the input marks to propagate, and propagate them only for the visible calls, ie those which have at least one visible output. This process is repeated as long as there are some modification. frama-c-20.0-Calcium/doc/code/style.css0000666000000000000000000001256213571573400014552 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ * { margin: 0; padding: 0 } body { color: #222; font-family: "Verdana", sans; font-size: 11px; width: 18cm; margin-left: 2.5cm; margin-top: 0.5cm; margin-bottom: 1cm; padding: 4mm 18mm 4mm 28mm; background: #ffffff url(frama-c.png) no-repeat fixed 5mm 1cm ; } h1 { width: 18cm; font-family: "Optima", "Verdana", "Arial", sans; text-align: left; margin-top: 5mm; margin-bottom: 2mm; padding-left: 3mm; border-left: 20px solid darkorange; } h2 { width: 18cm; font-family: "Optima", "Verdana", "Arial", sans; margin-top: 5mm; margin-bottom: 2mm; padding-left: 3mm; border-bottom: thin solid #404040; } h1.chapter { clear: both; text-align: left; font-family: "Optima", "Verdana", "Arial", sans; font-size: 2.0em; font-weight: normal; color: black; margin: 0.4em 0em 0.4em 0em; padding: 0.4em 0em 0em 0em; border-left: none; border-bottom: thin solid #404040; } h2.section { width: 18cm; font-family: "Optima", "Verdana", "Arial", sans; margin-top: 5mm; margin-bottom: 2mm; padding-left: 3mm; border-bottom: none; border-left: 20px solid darkorange; color: darkred; } h2.section .directory { font-size: smaller ; color: #707070 ; font-familly: "Everson Mono", monospace ; } h3 { width: 18cm; font-family: "Optima", "Verdana", "Arial", sans; color: black; margin-top: 5mm; margin-bottom: 3mm; border-bottom: thin solid #404040; } h4,h5,h6, div.h7, div.h8, div.h9 { margin-left: 4mm; margin-top: 4mm; margin-bottom: 1mm; font-family: "Optima", "Verdana", "Arial", sans; font-size: 10px; font-style: italic; font-weight: bold; color: darkred; } p,ul { margin: 2mm; width: 15cm; margin-left: 0mm; } hr { border: none ; border-top: 1px solid #404040; margin-top: 4mm; margin-bottom: 4mm } a:visited { color: darkblue; text-decoration: none } a:link { color: darkblue; text-decoration: none } a:hover { background-color: lightgray; color: firebrick } a:active { background-color: lightgray; color: darkgreen } .navbar { margin-left: 1cm ; margin-bottom: 4mm ; font-size: 9px ; } .navbar a:link { color: darkgreen; } .navbar a:visited { color: darkgreen; } .keyword { font-weight : bold; color: darkgoldenrod } .keywordsign { color : #C04600 } .superscript { font-size: 7px } .subscript { font-size: 7px } .warning { color: firebrick ; font-style: italic; margin-right:1ex } .info { padding: 1mm 1mm 1mm 1em; margin-top: 0mm; margin-bottom: 2mm; margin-left: 1em; margin-right: 3em; border-left: thin dotted darkgreen; } table .info { border: none } .param_info { margin-top: 4px; margin-left : 3em; margin-right : 3em } .typetable { border-style : hidden } .indextable { margin-left: 3mm; margin-top: 2mm ; padding: 2mm 6mm 2mm 4mm ; border-style : hidden ; border-left: darkgreen thin solid ; } .paramstable { border-style : hidden ; padding: 5pt 5pt } tr { font-size: 11px } td { padding:0 ; margin:2px 5px 2px 10px ; vertical-align: top } td .info { padding:0 ; margin-top:0 ; margin-bottom:0 ; border-left: none ; vertical-align: top } td.typefieldcomment { font-family: serif; color: darkgreen } pre { color : #263F71 ; font-size: 11px; font-family: "Everson Mono", monospace; margin-top: 1mm } .code { color : #465F91 ; font-size: 11px; font-family: "Everson Mono", monospace } .comment { color : darkgreen; font-family: serif } .constructor { color : darkblue } .type { color: #5C6585 } .string { color: maroon } div.sig_block {margin-left: 2em} li { margin-left: 2em } .copyright { margin-top: 5mm; font-size:10px; padding-top: 2mm; border-top: thin solid #404040; } .copyright a:visited { color:darkred } .copyright a:link { color:darkred }frama-c-20.0-Calcium/doc/code/toc_head.htm0000666000000000000000000000375413571573400015163 0ustar Frama-C API

    Frama-C API Documentation

    • Frama-C Kernel
    • frama-c-20.0-Calcium/doc/code/toc_tail.htm0000666000000000000000000000342413571573400015205 0ustar
    frama-c-20.0-Calcium/lib/0000777000000000000000000000000013571573400011761 5ustar frama-c-20.0-Calcium/lib/gui/0000777000000000000000000000000013571573400012545 5ustar frama-c-20.0-Calcium/lib/plugins/0000777000000000000000000000000013571573400013442 5ustar frama-c-20.0-Calcium/licenses/0000777000000000000000000000000013571573400013020 5ustar frama-c-20.0-Calcium/licenses/CDDL-1.00000666000000000000000000004324613571573400013756 0ustar COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 1. Definitions. 1.1. “Contributor” means each individual or entity that creates or contributes to the creation of Modifications. 1.2. “Contributor Version” means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. 1.3. “Covered Software” means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. 1.4. “Executable” means the Covered Software in any form other than Source Code. 1.5. “Initial Developer” means the individual or entity that first makes Original Software available under this License. 1.6. “Larger Work” means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. 1.7. “License” means this document. 1.8. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9. “Modifications” means the Source Code and Executable form of any of the following: A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; B. Any new file that contains any part of the Original Software or previous Modification; or C. Any new file that is contributed or otherwise made available under the terms of this License. 1.10. “Original Software” means the Source Code and Executable form of computer software code that is originally released under this License. 1.11. “Patent Claims” means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.12. “Source Code” means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. 1.13. “You” (or “Your”) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, “You” includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants. 2.1. The Initial Developer Grant. Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. 2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1. Availability of Source Code. Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. 3.2. Modifications. The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. 3.3. Required Notices. You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. 3.4. Application of Additional Terms. You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients’ rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.5. Distribution of Executable Versions. You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient’s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.6. Larger Works. You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. 4. Versions of the License. 4.1. New Versions. Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. 4.2. Effect of New Versions. You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. 4.3. Modified Versions. When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. 5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN “AS IS” BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 6. TERMINATION. 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as “Participant”) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. 6.3. If You assert a patent infringement claim against Participant alleging that the Participant Software directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. 6.4. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. 7. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY’S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 8. U.S. GOVERNMENT END USERS. The Covered Software is a “commercial item,” as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of “commercial computer software” (as that term is defined at 48 C.F.R. § 252.227-7014(a)(1)) and “commercial computer software documentation” as such terms are used in 48 C.F.R. 12.212 Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. 9. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction’s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys’ fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. 10. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. -------- NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) The OpenSolaris code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. frama-c-20.0-Calcium/licenses/LGPLv20000666000000000000000000006144713571573400013765 0ustar GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! frama-c-20.0-Calcium/licenses/LGPLv2.10000666000000000000000000005747613571573400014133 0ustar GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS frama-c-20.0-Calcium/licenses/Q_MODIFIED_LICENSE0000666000000000000000000007577613571573400015573 0ustar In the following, "the Library" refers to the following file: standard.mly and "the Generator" refers to all files marked "Copyright INRIA" in the root directory. The Generator is distributed under the terms of the Q Public License version 1.0 with a change to choice of law (included below). The Library is distributed under the terms of the GNU Library General Public License version 2 (included below). As a special exception to the Q Public License, you may develop application programs, reusable components and other software items that link with the original or modified versions of the Generator and are not made available to the general public, without any of the additional requirements listed in clause 6c of the Q Public license. As a special exception to the GNU Library General Public License, you may link, statically or dynamically, a "work that uses the Library" with a publicly distributed version of the Library to produce an executable file containing portions of the Library, and distribute that executable file under terms of your choice, without any of the additional requirements listed in clause 6 of the GNU Library General Public License. By "a publicly distributed version of the Library", we mean either the unmodified Library as distributed by INRIA, or a modified version of the Library that is distributed under the conditions defined in clause 3 of the GNU Library General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Library General Public License. ---------------------------------------------------------------------- THE Q PUBLIC LICENSE version 1.0 Copyright (C) 1999 Troll Tech AS, Norway. Everyone is permitted to copy and distribute this license document. The intent of this license is to establish freedom to share and change the software regulated by this license under the open source model. This license applies to any software containing a notice placed by the copyright holder saying that it may be distributed under the terms of the Q Public License version 1.0. Such software is herein referred to as the Software. This license covers modification and distribution of the Software, use of third-party application programs based on the Software, and development of free software which uses the Software. Granted Rights 1. You are granted the non-exclusive rights set forth in this license provided you agree to and comply with any and all conditions in this license. Whole or partial distribution of the Software, or software items that link with the Software, in any form signifies acceptance of this license. 2. You may copy and distribute the Software in unmodified form provided that the entire package, including - but not restricted to - copyright, trademark notices and disclaimers, as released by the initial developer of the Software, is distributed. 3. You may make modifications to the Software and distribute your modifications, in a form that is separate from the Software, such as patches. The following restrictions apply to modifications: a. Modifications must not alter or remove any copyright notices in the Software. b. When modifications to the Software are released under this license, a non-exclusive royalty-free right is granted to the initial developer of the Software to distribute your modification in future versions of the Software provided such versions remain available under these terms in addition to any other license(s) of the initial developer. 4. You may distribute machine-executable forms of the Software or machine-executable forms of modified versions of the Software, provided that you meet these restrictions: a. You must include this license document in the distribution. b. You must ensure that all recipients of the machine-executable forms are also able to receive the complete machine-readable source code to the distributed Software, including all modifications, without any charge beyond the costs of data transfer, and place prominent notices in the distribution explaining this. c. You must ensure that all modifications included in the machine-executable forms are available under the terms of this license. 5. You may use the original or modified versions of the Software to compile, link and run application programs legally developed by you or by others. 6. You may develop application programs, reusable components and other software items that link with the original or modified versions of the Software. These items, when distributed, are subject to the following requirements: a. You must ensure that all recipients of machine-executable forms of these items are also able to receive and use the complete machine-readable source code to the items without any charge beyond the costs of data transfer. b. You must explicitly license all recipients of your items to use and re-distribute original and modified versions of the items in both machine-executable and source code forms. The recipients must be able to do so without any charges whatsoever, and they must be able to re-distribute to anyone they choose. c. If the items are not available to the general public, and the initial developer of the Software requests a copy of the items, then you must supply one. Limitations of Liability In no event shall the initial developers or copyright holders be liable for any damages whatsoever, including - but not restricted to - lost revenue or profits or other direct, indirect, special, incidental or consequential damages, even if they have been advised of the possibility of such damages, except to the extent invariable law, if any, provides otherwise. No Warranty The Software and this license document are provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Choice of Law This license is governed by the Laws of France. ---------------------------------------------------------------------- GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! frama-c-20.0-Calcium/man/0000777000000000000000000000000013571573400011766 5ustar frama-c-20.0-Calcium/man/frama-c.10000666000000000000000000005503113571573400013362 0ustar .\"------------------------------------------------------------------------ .\" .\" This file is part of Frama-C. .\" .\" Copyright (C) 2007-2019 .\" CEA (Commissariat à l'énergie atomique et aux énergies .\" alternatives) .\" .\" you can redistribute it and/or modify it under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation, version 2.1. .\" .\" It is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU Lesser General Public License for more details. .\" .\" See the GNU Lesser General Public License version 2.1 .\" for more details (enclosed in the file licenses/LGPLv2.1). .\" .\"------------------------------------------------------------------------ .\" DO NOT EDIT THIS FILE! .\" This man file has been generated from a Markdown file (frama-c.1.md) .\" using pandoc 2.0 or newer. To modify this file, edit the Markdown file .\" and run `make man/frama-c.1`. .TH FRAMA-C 1 2019-07-29 .SH NAME .PP frama\-c[.byte] \- a static analyzer for C programs .PP frama\-c\-gui[.byte] \- the graphical interface of frama\-c .SH SYNOPSIS .PP \f[B]frama\-c\f[] [ \f[I]options\f[] ] \f[I]files\f[] .SH DESCRIPTION .PP \f[B]frama\-c\f[] is a suite of tools dedicated to the analysis of source code written in C. It gathers several analysis techniques in a single collaborative framework. This framework can be extended by additional plugins placed in the \f[B]$FRAMAC_PLUGIN\f[] directory. The command .RS .PP frama\-c \-\-plugins .RE .PP will provide the full list of the plugins that are currently installed. .PP \f[B]frama\-c\-gui\f[] is the graphical user interface of \f[B]frama\-c\f[]. It features the same options as the command\-line version. .PP \f[B]frama\-c.byte\f[] and \f[B]frama\-c\-gui.byte\f[] are the OCaml bytecode versions of the command\-line and graphical user interface respectively. .PP By default, Frama\-C recognizes \f[I].c\f[] files as C files needing pre\-processing and \f[I].i\f[] files as C files having been already pre\-processed. Some plugins may extend the list of recognized files. Pre\-processing can be customized through the \f[B]\-cpp\-command\f[] and \f[B]\-cpp\-extra\-args\f[] options. .SH OPTIONS .SS Syntax .PP Options taking an additional parameter can also be written under the form .RS .PP \-\f[I]option\f[]=\f[I]param\f[] .RE .PP This form is mandatory when \f[I]param\f[] starts with a dash (`\-'). .PP Most options that take no parameter have a corresponding .RS .PP \-no\-\f[I]option\f[] .RE .PP option which has the opposite effect. .SS Help options .TP .B \-help gives a short usage notice. .RS .RE .TP .B \-kernel\-help prints the list of options recognized by Frama\-C's kernel .RS .RE .TP .B \-verbose \f[I]n\f[] sets verbosity level. Defaults to 1. Setting it to 0 will output less progress messages. This level can also be set on a per\-\f[I]plugin\f[] basis, with option \-\f[I]plugin\f[]\-\f[B]verbose\f[] \f[I]n\f[]. Verbosity level of the kernel can be controlled with option \f[B]\-kernel\-verbose\f[] \f[I]n\f[]. .RS .RE .TP .B \-debug \f[I]n\f[] sets debugging level. Defaults to 0, meaning no debugging messages. This option has the same per\-plugin (and kernel) specializations as \f[B]\-verbose\f[]. .RS .RE .TP .B \-quiet sets verbosity and debugging level to 0. .RS .RE .SS Options controlling Frama\-C's kernel .TP .B \-absolute\-valid\-range \f[I]min\-max\f[] considers that all numerical addresses in the range \f[I]min\-max\f[] are valid. Bounds are parsed as OCaml integer constants. By default, all numerical addresses are considered invalid. .RS .RE .TP .B \-add\-path \f[I]p1[,p2[\&...,pn]]\f[] adds directories \f[I]p1\f[] through \f[I]pn\f[] to the list of directories in which plugins are searched. .RS .RE .TP .B [\-no]\-aggressive\-merging merges function definitions modulo renaming. Defaults to no. .RS .RE .TP .B [\-no]\-allow\-duplication allows duplication of small blocks during normalization of tests and loops. Otherwise, normalization uses labels and gotos. Bigger blocks and blocks with non\-trivial control flow are never duplicated. Defaults to yes. .RS .RE .TP .B [\-no]\-annot reads ACSL annotations. This is the default. Annotations are pre\-processed by default. Use \-no\-pp\-annot if you don't want to expand macros in annotations. .RS .RE .TP .B \-big\-ints\-hex \f[I]max\f[] integers larger than \f[I]max\f[] are displayed in hexadecimal (by default, all integers are displayed in decimal). .RS .RE .TP .B \-check performs integrity checks on the internal AST (for developers only). .RS .RE .TP .B [\-no]\-asm\-contracts generates contracts for assembly code written according to gcc's extended syntax. Defaults to yes. .RS .RE .TP .B [\-no]\-asm\-contracts\-auto\-validate automatically marks contracts generated from asm as valid. Defaults to no. .RS .RE .TP .B \-c11 enables (partial) C11 compatibility, e.g.\ typedef redefinitions. Defaults to no. .RS .RE .TP .B [\-no]\-collapse\-call\-cast allows implicit cast between the value returned by a function and the lvalue it is assigned to. Otherwise, a temporary variable is used and the cast is made explicit. Defaults to yes. .RS .RE .TP .B [\-no]\-constfold folds all syntactically constant expressions in the code before analyses. Defaults to no. .RS .RE .TP .B \-const\-readonly variables with const qualifier must be actually constant. Defaults to yes. The opposite option is \f[B]\-unsafe\-writable\f[]. .RS .RE .TP .B [\-no]\-continue\-annot\-error when analyzing an annotation, the default behavior (the \f[B]\-no\f[] version of this option) when a typechecking error occurs is to reject the source file as is the case for typechecking errors within the C code. With this option on, the typechecker will only output a warning and discard the annotation but type‐checking will continue (errors in C code are still fatal, though). .PD 0 .P .PD \f[B]Deprecated\f[]: use \f[B]\-kernel\-warn\-key annot\-error\f[] instead. .RS .RE .TP .B \-cpp\-command \f[I]cmd\f[] uses \f[I]cmd\f[] as the command to pre\-process C files. Defaults to the \f[B]CPP\f[] environment variable or to .RS .RE .RS .PP gcc \-C \-E \-I. .RE .PP if it is not set. If unset, the command is built as follows: .RS .PP CPP \-o .RE .PP \f[I]%1\f[] and \f[I]%2\f[] can be used into the \f[B]CPP\f[] string to mark the position of \f[I]\f[] and \f[I]\f[] respectively. Note that this option is often better replaced by \f[B]\-cpp\-extra\-args\f[]. .TP .B \-cpp\-extra\-args \f[I]args\f[] gives additional arguments to the pre\-processor. Pre\-processing annotations is done in two separate pre\-processing stages. The first one is a normal pass on the C code which retains macro definitions. These are then used in the second pass during which annotations are pre\-processed. \f[I]args\f[] are used only for the first pass, so that arguments that should not be used twice (such as additional include directives or macro definitions) must thus go there instead of \f[B]\-cpp\-command\f[]. .RS .RE .TP .B [\-no]\-cpp\-frama\-c\-compliant indicates that the chosen preprocessor complies to some Frama\-C requirements, such as accepting the same set of options as GNU cpp, and accepting architecture\-specific options such as \-m32/\-m64. Default values depend on the installed preprocessor at configure time. See also \f[B]\-pp\-annot\f[]. .RS .RE .TP .B [\-no]\-autoload\-plugins when on, load all the dynamic plugins found in the search path (see \f[B]\-print\-plugin\-path\f[] for more information on the default search path). Otherwise, only plugins requested by \f[B]\-load\-module\f[] will be loaded. Defaults to on. .RS .RE .TP .B \-enums \f[I]repr\f[] choose the way the representation of enumerated types is determined. \f[B]frama\-c \-enums help\f[] gives the list of available options. Default is \f[B]gcc\-enums\f[]. .RS .RE .TP .B \-float\-digits \f[I]n\f[] when outputting floating\-point numbers, display \f[I]n\f[] digits. Defaults to 12. .RS .RE .TP .B \-float\-flush\-to\-zero floating point operations flush to zero. .RS .RE .TP .B \-float\-hex display floats as hexadecimal. .RS .RE .TP .B \-float\-normal display floats with the standard OCaml routine. .RS .RE .TP .B \-float\-relative display float intervals as [ \f[I]lower_bound\f[]++\f[I]width\f[] ]. .RS .RE .TP .B [\-no]\-frama\-c\-stdlib adds \f[B]\-I$FRAMAC_SHARE/libc\f[] to the options given to the cpp command. If \f[B]\-cpp\-frama\-c\-compliant\f[] is not false, also adds \f[B]\-nostdinc\f[] to prevent an inconsistent mix of system and Frama\-C header files. Defaults to yes. .RS .RE .TP .B \-implicit\-function\-declaration \f[I]action\f[] warns or aborts when a function is called before it has been declared. \f[I]action\f[] can be one of \f[B]ignore\f[], \f[B]warn\f[], or \f[B]error\f[]. Defaults to \f[B]warn\f[]. .PD 0 .P .PD \f[B]Deprecated\f[]: use \f[B]\-kernel\-warn\-key typing:implicit\-function\-declaration\f[] instead. .RS .RE .TP .B \-initialized\-padding\-locals implicit initialization of locals sets padding bits to 0. If false, padding bits are left uninitialized. Defaults to yes. .RS .RE .TP .B \-inline\-calls \f[I]f1,\&...,fn\f[] syntactically inlines calls to functions \f[I]f1,\&...,fn\f[]. Use \f[B]\@inline\f[] to select all functions with attribute \f[I]inline\f[]. Recursive functions are inlined only at the first level. Calls via function pointers are not inlined. .RS .RE .TP .B \-journal\-disable do not output a journal of the current session. See \f[B]\-journal\-enable\f[]. .RS .RE .TP .B \-journal\-enable on by default, dumps a journal of all the actions performed during the current Frama\-C session in the form of an OCaml script that can be replayed with \f[B]\-load\-script\f[]. The name of the script can be set with the \f[B]\-journal\-name\f[] option. .RS .RE .TP .B \-journal\-name \f[I]name\f[] sets the name of the journal file (without the \f[I].ml\f[] extension). Defaults to \f[B]frama_c_journal\f[]. .RS .RE .TP .B \-json\-compilation\-database \f[I]path\f[] use \f[I]path\f[] as a JSON compilation database (see for more information): each file preprocessed by Frama\-C will include corresponding \f[B]\-I\f[] and \f[B]\-D\f[] flags according to the specifications in \f[I]path\f[]. If \f[I]path\f[] is a directory, use \f[B]/compile_commands.json\f[]. Disabled by default. .RS .RE .TP .B [\-no]\-keep\-comments tries to preserve comments when pretty\-printing the source code. Defaults to no. .RS .RE .TP .B [\-no]\-keep\-switch when \f[B]\-simplify\-cfg\f[] is set, keeps switch statements. Defaults to no. .RS .RE .TP .B \-keep\-unused\-specified\-functions see \f[B]\-remove\-unused\-specified\-functions\f[]. .RS .RE .TP .B \-keep\-unused\-types see \f[B]\-remove\-unused\-types\f[]. .RS .RE .TP .B \-kernel\-log \f[I]kind:file\f[] copies log messages from the Frama\-C's kernel to file. \f[I]kind\f[] specifies which kinds of messages to be copied (e.g. \f[B]w\f[] for warnings, \f[B]e\f[] for errors, etc.). See \f[B]\-kernel\-help\f[] for more details. Can also be set on a per\-plugin basis, with option \-\f[I]\f[]\-\f[B]log\f[]. .RS .RE .TP .B \-kernel\-msg\-key \f[I]k1,\&...,kn\f[] controls the emission of messages based on categories. Use \f[B]\-kernel\-msg\-key help\f[] to get a list of available categories, and \f[B]\-kernel\-msg\-key=\[lq]*\[rq]\f[] to control all categories. To disable a category, add a \f[B]\-\f[] before its name; to enable a category, simply add its name, with an optional \f[B]+\f[] before it. For instance, \f[B]\-kernel\-msg\-key=\-k1,k2\f[] will disable messages from category \f[B]k1\f[] and enable those from category \f[B]k2\f[]. Can also be set on a per\-plugin basis, with option \-\f[I]\f[]\-\f[B]msg\-key\f[]. Note that each plugin has its own set of categories. .RS .RE .TP .B \-kernel\-warn\-key \f[I]k1=a1,\&...,kn=an\f[] controls the emission of warnings based on categories: for each warning category \f[I]k\f[], associate action \f[I]a\f[]. Use \f[B]\-kernel\-warn\-key help\f[] to get a list of available warning categories and their currently associated actions. The following actions can be set per category: \f[B]active\f[] (warn), \f[B]feedback\f[], \f[B]error\f[], \f[B]abort\f[], \f[B]once\f[], \f[B]feedback\-once\f[], \f[B]err\-once\f[]. Omitting the action is equivalent to setting it to \f[B]active\f[]. Warning categories can also be set on a per\-plugin basis, with option \-\f[I]\f[]\f[B]\-warn\-key\f[]. .RS .RE .TP .B [\-no]\-lib\-entry indicates that the entry point is called during program execution. This implies in particular that global variables cannot be assumed to have their initial values. The default is \f[B]\-no\-lib\-entry\f[]: the entry point is also the starting point of the program and globals have their initial value. .RS .RE .TP .B \-load \f[I]file\f[] loads the (previously saved) state contained in \f[I]file\f[]. .RS .RE .TP .B \-load\-module \f[I]SPEC\f[] dynamically load OCaml plug\-ins, modules and scripts. Each \f[I]SPEC\f[] can be an OCaml source or object file, with or without extension, or a Findlib package. Loading order is preserved and additional dependencies can be listed in *\f[B].depend\f[] files. .RS .RE .TP .B \-load\-script \f[I]SPEC\f[] alias for option \f[B]\-load\-module\f[]. .RS .RE .TP .B \-machdep \f[I]machine\f[] uses \f[I]machine\f[] as the current machine\-dependent configuration (size of the various integer types, endiandness, \&...). The list of currently supported machines is available through option \f[I]\-machdep help\f[]. Default is \f[B]x86_32\f[]. .RS .RE .TP .B \-main \f[I]f\f[] sets \f[I]f\f[] as the entry point of the analysis. Defaults to \f[B]main\f[]. By default, it is considered as the starting point of the program under analysis. Use \f[B]\-lib\-entry\f[] if \f[I]f\f[] is supposed to be called in the middle of an execution. .RS .RE .TP .B \-obfuscate prints an obfuscated version of the code (where original identifiers are replaced by meaningless ones) and exits. The correspondence table between original and new symbols is kept at the beginning of the result. .RS .RE .TP .B \-ocode \f[I]file\f[] redirects pretty\-printed code to \f[I]file\f[] instead of standard output. .RS .RE .TP .B [\-no]\-orig\-name During the normalization phase, some variables may get renamed when different variables with the same name can co\-exist (e.g.\ a global variable and a formal parameter). When this option is on, a message is printed each time this occurs. Defaults to no. .RS .RE .TP .B [\-no]\-pp\-annot pre\-processes annotations. This is currently only possible when using gcc (or GNU cpp) pre\-processor. The default is to pre\-process annotations when the default pre\-processor is identified as GNU or GNU\-like. See also \f[B]\-cpp\-frama\-c\-compliant\f[]. .RS .RE .TP .B [\-no]\-print pretty\-prints the source code as normalized by CIL. Defaults to no. .RS .RE .TP .B [\-no]\-print\-libc expands \f[B]#include\f[] directives in the pretty\-printed CIL code for files in the Frama\-C standard library. Defaults to no. .RS .RE .TP .B \-print\-libpath outputs the directory where the Frama\-C kernel library is installed. .RS .RE .TP .B \-print\-path alias of \f[B]\-print\-share\-path\f[]. .RS .RE .TP .B \-print\-plugin\-path outputs the directory where Frama\-C searches its plugins (can be overridden by the \f[B]FRAMAC_PLUGIN\f[] variable and the \f[B]\-add\-path\f[] option). .RS .RE .TP .B \-print\-share\-path outputs the directory where Frama\-C stores its data (can be overridden by the \f[B]FRAMAC_SHARE\f[] variable). .RS .RE .TP .B [\-no]\-remove\-exn transforms throw and try/catch statements into normal C functions. Defaults to no, unless the input source language has an exception mechanism. .RS .RE .TP .B \-remove\-inlined \f[I]f1,\&...,fn\f[] removes inlined functions \f[I]f1,\&...,fn\f[] from the AST, which must have been given to \f[B]\-inline\-calls\f[]. Note: this option does not check if the given functions were fully inlined. .RS .RE .TP .B \-remove\-projects \f[I]p1,\&...,pn\f[] removes the given projects \f[I]p1,\&...,pn\f[]. \f[B]\@all_but_current\f[] removes all projects but the current one. .RS .RE .TP .B \-remove\-unused\-specified\-functions keeps function prototypes that have an ACSL specification but are not used in the code. This is the default. Functions having the attribute \f[B]FRAMAC_BUILTIN\f[] are always kept. .RS .RE .TP .B \-remove\-unused\-types remove types and struct/union/enum declarations that are not referenced anywhere else in the code. This is the default. Use \f[B]\-keep\-unused\-types\f[] to keep these definitions. .RS .RE .TP .B \-safe\-arrays for multidimensional arrays or arrays that are fields inside structs, assumes that all accesses must be in bound (set by default). The opposite option is \f[B]\-unsafe\-arrays\f[]. .RS .RE .TP .B \-save \f[I]file\f[] saves Frama\-C's state into \f[I]file\f[] after analyses have taken place. .RS .RE .TP .B \-session \f[I]s\f[] sets \f[I]s\f[] as the directory in which session files are searched. .RS .RE .TP .B [\-no]\-set\-project\-as\-default the current project becomes the default one (and so future \f[B]\-then\f[] sequences are applied on it). Defaults to no. .RS .RE .TP .B [\-no]\-simplify\-cfg removes \f[B]break\f[], \f[B]continue\f[] and \f[B]switch\f[] statements before analyses. Defaults to no. .RS .RE .TP .B [\-no]\-simplify\-trivial\-loops simplifies trivial loops such as \f[B]do \&... while (0)\f[] loops. Defaults to yes. .RS .RE .TP .B \-then allows one to compose analyses: a first run of Frama\-C will occur with the options before \f[B]\-then\f[] and a second run will be done with the options after \f[B]\-then\f[] on the current project from the first run. .RS .RE .TP .B \-then\-last like \f[B]\-then\f[], but the second group of actions is executed on the last project created by a program transformer. .RS .RE .TP .B \-then\-on \f[I]prj\f[] similar to \f[B]\-then\f[] except that the second run is performed in project \f[I]prj\f[]. If no such project exists, Frama\-C exits with an error. .RS .RE .TP .B \-then\-replace like \f[B]\-then\-last\f[], but also removes the previous current project. .RS .RE .TP .B \-time \f[I]file\f[] appends user time and date in the given file when Frama\-C exits. .RS .RE .TP .B \-typecheck forces typechecking of the source files. This option is only relevant if no further analysis is requested (as typechecking will implicitly occur before the analysis is launched). .RS .RE .TP .B \-ulevel \f[I]n\f[] syntactically unroll loops \f[I]n\f[] times before the analysis. This can be quite costly and some plugins (e.g.\ Eva) provide more efficient ways to perform the same thing. See their respective manuals for more information. This can also be activated on a per\-loop basis via the \f[B]loop pragma unroll \f[] directive. A negative value for \f[I]n\f[] will inhibit such pragmas. .RS .RE .TP .B [\-no]\-ulevel\-force ignores \f[B]UNROLL\f[] loop pragmas disabling unrolling. .RS .RE .PP [\-no]\-unicode outputs ACSL formulas with UTF\-8 characters. This is the default. When given the \f[B]\-no\-unicode\f[] option, Frama\-C will use the ASCII version instead. See the ACSL manual for the correspondence. .TP .B \-unsafe\-arrays see \f[B]\-safe\-arrays\f[]. .RS .RE .TP .B [\-no]\-unspecified\-access checks that read/write accesses occurring in an unspecified order (according to the C standard's notion of sequence points) are performed on separate locations. With \f[B]\-no\-unspecified\-access\f[], assumes that it is always the case (this is the default). .RS .RE .TP .B \-version outputs the version string of Frama\-C. .RS .RE .TP .B \-warn\-decimal\-float \f[I]freq\f[] warns when a floating\-point constant cannot be exactly represented (e.g.\ 0.1). \f[I]freq\f[] can be one of \f[B]none\f[], \f[B]once\f[], or \f[B]all\f[]. .PD 0 .P .PD \f[B]Deprecated\f[]: use \f[B]\-kernel\-warn\-key parser:decimal\-float=once\f[] (and variants) instead. .RS .RE .TP .B [\-no]\-warn\-left\-shift\-negative generate alarms for signed left shifts on negative values. Defaults to yes. .RS .RE .TP .B [\-no]\-warn\-right\-shift\-negative generate alarms for signed right shifts on negative values. Defaults to no. .RS .RE .TP .B [\-no]\-warn\-signed\-downcast generates alarms when signed downcasts may exceed the destination range. Defaults to no. .RS .RE .TP .B [\-no]\-warn\-signed\-overflow generates alarms for signed operations that overflow. Defaults to yes. .RS .RE .TP .B [\-no]\-warn\-unsigned\-downcast generates alarms when unsigned downcasts may exceed the destination range. Defaults to no. .RS .RE .TP .B [\-no]\-warn\-unsigned\-overflow generates alarms for unsigned operations that overflow. Defaults to no. .RS .RE .TP .B [\-no]\-warn\-invalid\-bool generates alarms for reads of trap representations of _Bool lvalues. Defaults to yes. .RS .RE .SS Plugin\-specific options .PP For each plugin, the command .RS .PP frama\-c \-plugin\-help .RE .PP will give the list of options that are specific to the plugin. .SH EXIT STATUS .TP .B 0 Successful execution .RS .RE .TP .B 1 Invalid user input .RS .RE .TP .B 2 User interruption (kill or equivalent) .RS .RE .TP .B 3 Unimplemented feature .RS .RE .TP .B 4 5 6 Internal error .RS .RE .TP .B 125 Unknown error .RS .RE .PP Exit statuses greater than 2 can be considered as a bug (or a feature request for the case of exit status 3) and may be reported on Frama\-C's BTS (see below). .SH ENVIRONMENT VARIABLES .PP It is possible to control the places where Frama\-C looks for its files through the following variables. .TP .B FRAMAC_LIB The directory where kernel's compiled interfaces are installed. .RS .RE .TP .B FRAMAC_PLUGIN The directory where Frama\-C can find standard plugins. If you wish to have plugins in several places, use \f[B]\-add\-path\f[] instead. .RS .RE .TP .B FRAMAC_SHARE The directory where Frama\-C data (e.g.\ its version of the standard library) is installed. .RS .RE .SH SEE ALSO .PP Frama\-C user manual: http://frama\-c.com/download/frama\-c\-user\-manual.pdf .PP Frama\-C homepage: http://frama\-c.com .PP Frama\-C BTS: http://bts.frama\-c.com frama-c-20.0-Calcium/opam/0000777000000000000000000000000013571573400012147 5ustar frama-c-20.0-Calcium/opam/descr0000666000000000000000000000157513571573400013202 0ustar Platform dedicated to the analysis of source code written in C. Frama-C gathers several analysis techniques in a single collaborative framework, based on analyzers (called "plug-ins") that can build upon the results computed by other analyzers in the framework. Thanks to this approach, Frama-C provides sophisticated tools, including: - an analyzer based on abstract interpretation (Eva plug-in); - a program proof framework based on weakest precondition calculus (WP plug-in); - a program slicer (Slicing plug-in); - a tool for verification of temporal (LTL) properties (Aoraï plug-in); - a runtime verification tool (E-ACSL plug-in); - several tools for code base exploration and dependency analysis (plug-ins From, Impact, Metrics, Occurrence, Scope, etc.). These plug-ins communicate between each other via the Frama-C API and via ACSL (ANSI/ISO C Specification Language) properties. frama-c-20.0-Calcium/opam/opam0000666000000000000000000000724513571573400013036 0ustar opam-version: "2.0" name: "frama-c" synopsis: "Platform dedicated to the analysis of source code written in C" version: "20.0" maintainer: "francois.bobot@cea.fr" authors: [ "Michele Alberti" "Thibaud Antignac" "Gergö Barany" "Patrick Baudin" "Allan Blanchard" "Lionel Blatter" "François Bobot" "Richard Bonichon" "Quentin Bouillaguet" "David Bühler" "Zakaria Chihani" "Loïc Correnson" "Julien Crétin" "Pascal Cuoq" "Zaynah Dargaye" "Jean-Christophe Filliâtre" "Philippe Herrmann" "Maxime Jacquemin" "Florent Kirchner" "Tristan Le Gall" "Jean-Christophe Léchenet" "Matthieu Lemerre" "Dara Ly" "David Maison" "Claude Marché" "André Maroneze" "Thibault Martin" "Fonenantsoa Maurica" "Melody Méaulle" "Benjamin Monate" "Yannick Moy" "Anne Pacalet" "Valentin Perrelle" "Guillaume Petiot" "Virgile Prevosto" "Armand Puccetti" "Virgile Robles" "Muriel Roger" "Julien Signoles" "Kostyantyn Vorobyov" "Boris Yakobowski" ] homepage: "http://frama-c.com/" license: "GNU Lesser General Public License version 2.1" dev-repo: "git+https://github.com/Frama-C/Frama-C-snapshot.git#latest" doc: "http://frama-c.com/download/user-manual-20.0-Calcium.pdf" bug-reports: "https://bts.frama-c.com/" tags: [ "deductive" "program verification" "formal specification" "automated theorem prover" "interactive theorem prover" "C" "plugins" "abstract interpretation" "slicing" "weakest precondition" "ACSL" "dataflow analysis" "runtime verification" ] build: [ ["autoconf"] {pinned} ["./configure" "--prefix" prefix "--disable-gui" { !conf-gtksourceview:installed | ( !conf-gnomecanvas:installed & !lablgtk3:installed) } "--mandir=%{man}%" ] [make "-j%{jobs}%"] [make "-C" "doc" "download"] {with-doc} ] install: [ [make "install"] [make "-C" "doc" "install"] {with-doc} ] run-test: [ [make "-j%{jobs}%" "PTESTS_OPTS=-error-code" "tests"] ] depends: [ "ocaml" { >= "4.05.0" & ( < "4.08.0~" | >= "4.08.1" ) } "ocamlgraph" { >= "1.8.8" & < "1.9~" } "ocamlfind" # needed beyond build stage, used by -load-module "zarith" "conf-autoconf" { build } ( ( "lablgtk" { >= "2.18.2" } & "conf-gnomecanvas" & "conf-gtksourceview" ) | ( "lablgtk3" { >= "3.0.beta4" & os!="macos" } & "lablgtk3-sourceview3" & "conf-gtksourceview3" ) ) ( "alt-ergo-free" | "alt-ergo" ) "conf-graphviz" { post } "yojson" "why3" { >= "1.2.0" } ] depopts: [ # cannot use {build}: Frama-C must be recompiled when Coq and libraries changes. # Coq: because .vo would would not be loadable by another version of Coq # libraries: because we use dynamic linking "coq" "mlgmpidl" "apron" "zmq" "ppx_deriving" "ppx_deriving_yojson" ] conflicts: [ "lablgtk" { < "2.18.2" } #for ocaml >= 4.02.1 "frama-c-e-acsl" #avoid mixing old releases of E-ACSL, it is already #distributed with this version of Frama-C "frama-c-base" #avoid mixing old releases of Frama-C, now that only the #'frama-c' package exists ] messages: [ "The Frama-C/Wp now uses Why-3 for all provers (Cf. deprecated -wp-prover native:alt-ergo)" {alt-ergo:installed} "The Frama-C/Wp native support for Coq is now deprecated (use TIP or Why-3 instead)." {coq:installed} "WARNING: There is a known issue with OCaml 4.05.0 and ocamlfind 1.8.1 (https://github.com/ocaml/opam-repository/issues/10925) when upgrading from a previous ocamlfind. If the compilation of Frama-C fails, try downgrading ocamlfind to 1.8.0 or upgrading OCaml to > 4.05.0." { ocaml:version = "4.05.0" & ocamlfind:version = "1.8.1" } ] frama-c-20.0-Calcium/ptests/0000777000000000000000000000000013571573400012535 5ustar frama-c-20.0-Calcium/ptests/ptests.ml0000666000000000000000000015744613571573400014432 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** the options to launch the toplevel with if the test file is not annotated with test options *) let default_options = "-journal-disable -check" let system = if Sys.os_type = "Win32" then fun f -> Unix.system (Format.sprintf "bash -c %S" f) else fun f -> Unix.system f module Filename = struct include Filename let concat = if Sys.os_type = "Win32" then fun a b -> a ^ "/" ^ b else concat let cygpath r = let cmd = Format.sprintf "bash -c \"cygpath -m %s\"" (String.escaped (String.escaped r)) in let in_channel = Unix.open_process_in cmd in let result = input_line in_channel in ignore(Unix.close_process_in in_channel); result let temp_file = if Sys.os_type = "Win32" then fun a b -> let r = temp_file a b in cygpath r else fun a b -> temp_file a b end let string_del_suffix suffix s = let lsuffix = String.length suffix in let ls = String.length s in if ls >= lsuffix && String.sub s (ls - lsuffix) lsuffix = suffix then Some (String.sub s 0 (ls - lsuffix)) else None let str_mutex = Mutex.create() let str_global_replace regex repl s = Mutex.lock str_mutex; let res = Str.global_replace regex repl s in Mutex.unlock str_mutex; res let str_string_match regex s n = Mutex.lock str_mutex; let res = Str.string_match regex s n in Mutex.unlock str_mutex; res let str_split regex s = Mutex.lock str_mutex; let res = Str.split regex s in Mutex.unlock str_mutex; res let default_env = ref [] let add_default_env x y = default_env:=(x,y)::!default_env let add_env var value = add_default_env var value; Unix.putenv var value let print_default_env fmt = match !default_env with [] -> () | l -> Format.fprintf fmt "@[Env:@\n"; List.iter (fun (x,y) -> Format.fprintf fmt "%s = \"%s\"@\n" x y) l; Format.fprintf fmt "@]" let default_env var value = try let v = Unix.getenv var in add_default_env (var ^ " (set from outside)") v with Not_found -> add_env var value (** the name of the directory-wide configuration file*) let dir_config_file = "test_config" (** the files in [suites] whose name matches the pattern [test_file_regexp] will be considered as test files *) let test_file_regexp = ".*\\.\\(c\\|i\\)$" (** the pattern that ends the parsing of options in a test file *) let end_comment = Str.regexp ".*\\*/" let regex_cmxs = Str.regexp ("\\([^/]+\\)[.]cmxs\\($\\|[ \t]\\)") let opt_to_byte toplevel = match string_del_suffix "frama-c" toplevel with | Some path -> path ^ "frama-c.byte" | None -> match string_del_suffix "toplevel.opt" toplevel with | Some path -> path ^ "toplevel.byte" | None -> match string_del_suffix "frama-c-gui" toplevel with | Some path -> path ^ "frama-c-gui.byte" | None -> match string_del_suffix "viewer.opt" toplevel with | Some path -> path ^ "viewer.byte" | None -> toplevel let opt_to_byte_options options = str_global_replace regex_cmxs "\\1.cmo\\2" options let execnow_opt_to_byte cmd = let cmd = opt_to_byte cmd in opt_to_byte_options cmd let output_unix_error (exn : exn) = match exn with | Unix.Unix_error (error, _function, arg) -> let message = Unix.error_message error in if arg = "" then Format.eprintf "%s@." message else Format.eprintf "%s: %s@." arg message | _ -> assert false let mv src dest = try Unix.rename src dest with Unix.Unix_error _ as e -> output_unix_error e let unlink ?(silent = true) file = let open Unix in try Unix.unlink file with | Unix_error _ when silent -> () | Unix_error (ENOENT,_,_) -> () (* Ignore "Not such file or directory" *) | Unix_error _ as e -> output_unix_error e let is_file_empty_or_nonexisting filename = let open Unix in try (Unix.stat filename).st_size = 0 with | Unix_error (UnixLabels.ENOENT, _, _) -> (* file does not exist *) true | Unix_error _ as e -> output_unix_error e; raise e let base_path = Filename.current_dir_name (* (Filename.concat (Filename.dirname Sys.executable_name) Filename.parent_dir_name) *) (** Command-line flags *) type behavior = Examine | Update | Run | Show | Gui let behavior = ref Run let verbosity = ref 0 let dry_run = ref false let use_byte = ref false let use_diff_as_cmp = ref (Sys.os_type = "Win32") let do_diffs = ref (if Sys.os_type = "Win32" then "diff --strip-trailing-cr -u" else "diff -u") let do_cmp = ref (if Sys.os_type="Win32" then !do_diffs else "cmp -s") let do_make = ref "make" let n = ref 4 (* the level of parallelism *) let suites = ref [] (** options appended to toplevel for all tests *) let additional_options = ref "" (** options prepended to toplevel for all tests *) let additional_options_pre = ref "" (** special configuration, with associated oracles *) let special_config = ref "" let do_error_code = ref false let exclude_suites = ref [] let exclude s = exclude_suites := s :: !exclude_suites let xunit = ref false let io_mutex = Mutex.create () let lock_fprintf f = Mutex.lock io_mutex; Format.kfprintf (fun _ -> Mutex.unlock io_mutex) f let lock_printf s = lock_fprintf Format.std_formatter s let lock_eprintf s = lock_fprintf Format.err_formatter s let make_test_suite s = suites := s :: !suites (* Those variables are read from a ptests_config file *) let default_suites = ref [] let toplevel_path = ref "" let change_toplevel_to_gui () = let s = !toplevel_path in match string_del_suffix "toplevel.opt" s with | Some s -> toplevel_path := s ^ "viewer.opt" | None -> match string_del_suffix "toplevel.byte" s with | Some s -> toplevel_path := s ^ "viewer.byte" | None -> match string_del_suffix "frama-c" s with | Some s -> toplevel_path := s ^ "frama-c-gui" | None -> match string_del_suffix "frama-c.byte" s with | Some s -> toplevel_path := s ^ "frama-c-gui.byte" | None -> () let () = Unix.putenv "LC_ALL" "C" (* some oracles, especially in Jessie, depend on the locale *) let example_msg = Format.sprintf "@.@[\ A test suite can be the name of a directory in ./tests or \ the path to a file.@ @ \ @[\ Some variables can be used in test command:@ \ @@PTEST_CONFIG@@ \ # test configuration suffix@ \ @@PTEST_FILE@@ \ # substituted by the test filename@ \ @@PTEST_DIR@@ \ # dirname of the test file@ \ @@PTEST_NAME@@ \ # basename of the test file@ \ @@PTEST_NUMBER@@ \ # test command number@] @ \ @[\ Examples:@ \ ptests@ \ ptests -diff \"echo diff\" -examine \ # see again the list of tests that failed@ \ ptests misc \ # for a single test suite@ \ ptests tests/misc/alias.c \ # for a single test@ \ ptests -examine tests/misc/alias.c \ # to see the differences again@ \ ptests -v -j 1 \ # to check the time taken by each test\ @]@ @]" ;; let umsg = "Usage: ptests [options] [names of test suites]";; let rec argspec = [ "-examine", Arg.Unit (fun () -> behavior := Examine) , " Examine the logs that are different from oracles."; "-gui", Arg.Unit (fun () -> behavior := Gui; n := 1; (* Disable parallelism to see which GUI is launched *) ) , " Start the tests in Frama-C's gui."; "-update", Arg.Unit (fun () -> behavior := Update) , " Take the current logs as oracles."; "-show", Arg.Unit (fun () -> behavior := Show) , " Show the results of the tests."; "-run", Arg.Unit (fun () -> behavior := Run) , " (default) Delete logs, run tests, then examine logs different from \ oracles."; "-v", Arg.Unit (fun () -> incr verbosity), " Increase verbosity (up to twice)" ; "-dry-run", Arg.Unit (fun () -> dry_run := true), " Do not run commands (use with -v to print all commands which would be run)" ; "-diff", Arg.String (fun s -> do_diffs := s; if !use_diff_as_cmp then do_cmp := s), " Use command for diffs" ; "-cmp", Arg.String (fun s -> do_cmp:=s), " Use command for comparison"; "-make", Arg.String (fun s -> do_make := s;), " Use command instead of make"; "-use-diff-as-cmp", Arg.Unit (fun () -> use_diff_as_cmp:=true; do_cmp:=!do_diffs), " Use the diff command for performing comparisons"; "-j", Arg.Int (fun i -> if i>=0 then n := i else ( lock_printf "Option -j requires nonnegative argument@."; exit (-1))), " Use nonnegative integer n for level of parallelism" ; "-byte", Arg.Set use_byte, " Use bytecode toplevel"; "-opt", Arg.Clear use_byte, " Use native toplevel (default)"; "-config", Arg.Set_string special_config, " Use special configuration and oracles"; "-add-options", Arg.Set_string additional_options, " Add additional options to be passed to the toplevels \ that will be launched. are added after standard test options"; "-add-options-pre", Arg.Set_string additional_options_pre, " Add additional options to be passed to the toplevels \ that will be launched. are added before standard test options."; "-add-options-post", Arg.Set_string additional_options, "Synonym of -add-options"; "-exclude", Arg.String exclude, " Exclude a test or a suite from the run"; "-xunit", Arg.Set xunit, " Create a xUnit file named xunit.xml collecting results"; "-error-code", Arg.Set do_error_code, " Exit with error code 1 if tests failed (useful for scripts"; ] and help_msg () = Arg.usage (Arg.align argspec) umsg;; let () = Arg.parse ((Arg.align (List.sort (fun (optname1, _, _) (optname2, _, _) -> compare optname1 optname2 ) argspec) ) @ ["", Arg.Unit (fun () -> ()), example_msg;]) make_test_suite umsg ;; let fail s = Format.printf "Error: %s@." s; exit 2 (** split the filename into before including "tests" dir and after including "tests" dir NOTA: both part contains "tests" (one as suffix the other as prefix). *) let rec get_upper_test_dir initial dir = let tests = Filename.dirname dir in if tests = dir then (* root directory *) (fail (Printf.sprintf "Can't find a tests directory below %s" initial)) else let base = Filename.basename dir in if base = "tests" then dir, "tests" else let tests, suffix = get_upper_test_dir initial tests in tests, Filename.concat suffix base let rec get_test_path = function | [] -> if Sys.file_exists "tests" && Sys.is_directory "tests" then "tests", [] else begin Format.eprintf "No test path found. Aborting@."; exit 1 end | [f] -> let tests, suffix = get_upper_test_dir f f in tests, [suffix] | a::l -> let tests, l = get_test_path l in let a_tests, a = get_upper_test_dir a a in if a_tests <> tests then fail (Printf.sprintf "All the tests should be inside the same tests directory") else tests, a::l let test_path = let files, names = List.partition Sys.file_exists !suites in let tests, l = get_test_path files in let names = List.map (Filename.concat tests) names in suites := names@l; Sys.chdir (Filename.dirname tests); "tests" let parse_config_line = let regexp_blank = Str.regexp "[ ]+" in fun (key, value) -> match key with | "DEFAULT_SUITES" -> let l = Str.split regexp_blank value in default_suites := List.map (Filename.concat test_path) l | "TOPLEVEL_PATH" -> toplevel_path := value | _ -> default_env key value (* Environnement variable that Frama-C reads*) (** parse config files *) let () = let config = "tests/ptests_config" in if Sys.file_exists config then begin try (*Parse the plugin configuration file for tests. Format is 'Key=value' *) let ch = open_in config in let regexp = Str.regexp "\\([^=]+\\)=\\(.*\\)" in while true do let line = input_line ch in if Str.string_match regexp line 0 then let key = Str.matched_group 1 line in let value = Str.matched_group 2 line in parse_config_line (key, value) else begin Format.eprintf "Cannot interpret line '%s' in ptests_config@." line; exit 1 end done with | End_of_file -> if !toplevel_path = "" then begin Format.eprintf "Missing TOPLEVEL_PATH variable. Aborting.@."; exit 1 end end else begin Format.eprintf "Cannot find configuration file %s. Aborting.@." config; exit 1 end (** Must be done after reading config *) let () = if !behavior = Gui then change_toplevel_to_gui () (* redefine name if special configuration expected *) let redefine_name name = if !special_config = "" then name else name ^ "_" ^ !special_config let dir_config_file = redefine_name dir_config_file let gen_make_file s dir file = Filename.concat (Filename.concat dir s) file module SubDir: sig type t val get: t -> string val create: ?with_subdir:bool -> string (** dirname *) -> t (** By default, creates the needed subdirectories if absent. Anyway, fails if the given dirname doesn't exists *) val make_oracle_file: t -> string -> string val make_result_file: t -> string -> string val make_file: t -> string -> string end = struct type t = string let get s = s let create_if_absent dir = if not (Sys.file_exists dir) then Unix.mkdir dir 0o750 (** rwxr-w--- *) else if not (Sys.is_directory dir) then fail (Printf.sprintf "the file %s exists but is not a directory" dir) let oracle_dirname = redefine_name "oracle" let result_dirname = redefine_name "result" let make_result_file = gen_make_file result_dirname let make_oracle_file = gen_make_file oracle_dirname let make_file = Filename.concat let create ?(with_subdir=true) dir = if not (Sys.file_exists dir && Sys.is_directory dir) then fail (Printf.sprintf "the directory %s must be an existing directory" dir); if (with_subdir) then begin create_if_absent (Filename.concat dir result_dirname); create_if_absent (Filename.concat dir oracle_dirname) end; dir end type execnow = { ex_cmd: string; (** command to launch *) ex_log: string list; (** log files *) ex_bin: string list; (** bin files *) ex_dir: SubDir.t; (** directory of test suite *) ex_once: bool; (** true iff the command has to be executed only once per config file (otherwise it is executed for every file of the test suite) *) ex_done: bool ref; (** has the command been already fully executed. Shared between all copies of this EXECNOW. Do NOT use a mutable field here, as execnows are duplicated using OCaml 'with' syntax. *) } module Macros = struct module StringMap = Map.Make (String) open StringMap type t = string StringMap.t let empty = StringMap.empty let macro_regex = Str.regexp "\\([^@]*\\)@\\([^@]*\\)@\\(.*\\)" let does_expand macros s = if !verbosity >=2 then begin lock_printf "looking for macros in string %s\n%!" s; lock_printf "Existing macros:\n%!"; iter (fun s1 s2 -> lock_printf "%s => %s\n%!" s1 s2) macros; lock_printf "End macros\n%!"; end; let rec aux n (ptest_file_matched,s as acc) = if Str.string_match macro_regex s n then begin let macro = Str.matched_group 2 s in let ptest_file_matched = ptest_file_matched || macro = "PTEST_FILE" in let start = Str.matched_group 1 s in let rest = Str.matched_group 3 s in let new_n = Str.group_end 1 in let n, new_s = if macro = "" then begin new_n + 1, String.sub s 0 new_n ^ "@" ^ rest end else begin try if !verbosity >= 2 then lock_printf "macro is %s\n%!" macro; let replacement = find macro macros in if !verbosity >= 1 then lock_printf "replacement for %s is %s\n%!" macro replacement; new_n, String.sub s 0 n ^ start ^ replacement ^ rest with | Not_found -> Str.group_end 2 + 1, s end in if !verbosity >= 2 then lock_printf "new string is %s\n%!" new_s; let new_acc = ptest_file_matched, new_s in if n <= String.length new_s then aux n new_acc else new_acc end else acc in Mutex.lock str_mutex; try let res = aux 0 (false,s) in Mutex.unlock str_mutex; res with e -> lock_eprintf "Uncaught exception %s\n%!" (Printexc.to_string e); Mutex.unlock str_mutex; raise e let expand macros s = snd (does_expand macros s) let get ?(default="") name macros = try find name macros with Not_found -> default let add_list l map = List.fold_left (fun acc (k,v) -> add k v acc) map l let add_expand name def macros = add name (expand macros def) macros let append_expand name def macros = add name (get name macros ^ expand macros def) macros end (** configuration of a directory/test. *) type config = { dc_test_regexp: string; (** regexp of test files. *) dc_execnow : execnow list; (** command to be launched before the toplevel(s) *) dc_macros: Macros.t; (** existing macros. *) dc_default_toplevel : string; (** full path of the default toplevel. *) dc_filter : string option; (** optional filter to apply to standard output *) dc_toplevels : (string * string * string list * Macros.t) list; (** toplevel full path, options to launch the toplevel on, and list of output files to monitor beyond stdout and stderr. *) dc_dont_run : bool; dc_default_log: string list; } let default_macros () = let l = [ "frama-c", !toplevel_path; "PTEST_MAKE_MODULE", "make -s" ] in Macros.add_list l Macros.empty let default_config () = { dc_test_regexp = test_file_regexp ; dc_macros = default_macros (); dc_execnow = []; dc_filter = None ; dc_default_toplevel = !toplevel_path; dc_toplevels = [ !toplevel_path, default_options, [], Macros.empty ]; dc_dont_run = false; dc_default_log = [] } let launch command_string = if !dry_run then 0 (* do not run command; return as if no error *) else let result = system command_string in match result with | Unix.WEXITED 127 -> lock_printf "%% Couldn't execute command. Retrying once.@."; Thread.delay 0.125; ( match system command_string with Unix.WEXITED r when r <> 127 -> r | _ -> lock_printf "%% Retry failed with command:@\n%s@\nStopping@." command_string ; exit 1 ) | Unix.WEXITED r -> r | Unix.WSIGNALED s -> lock_printf "%% SIGNAL %d received while executing command:@\n%s@\nStopping@." s command_string ; exit 1 | Unix.WSTOPPED s -> lock_printf "%% STOP %d received while executing command:@\n%s@\nStopping@." s command_string; exit 1 let scan_execnow ~once dir (s:string) = let rec aux (s:execnow) = try Scanf.sscanf s.ex_cmd "%_[ ]LOG%_[ ]%[-A-Za-z0-9_',+=:.\\@@]%_[ ]%s@\n" (fun name cmd -> aux { s with ex_cmd = cmd; ex_log = name :: s.ex_log }) with Scanf.Scan_failure _ -> try Scanf.sscanf s.ex_cmd "%_[ ]BIN%_[ ]%[A-Za-z0-9_.\\-@@]%_[ ]%s@\n" (fun name cmd -> aux { s with ex_cmd = cmd; ex_bin = name :: s.ex_bin }) with Scanf.Scan_failure _ -> try Scanf.sscanf s.ex_cmd "%_[ ]make%_[ ]%s@\n" (fun cmd -> let s = aux ({ s with ex_cmd = cmd; }) in { s with ex_cmd = !do_make^" "^cmd; } ) with Scanf.Scan_failure _ -> s in aux { ex_cmd = s; ex_log = []; ex_bin = []; ex_dir = dir; ex_once = once; ex_done = ref false } (* the default toplevel for the current level of options. *) let current_default_toplevel = ref !toplevel_path let current_default_log = ref [] let current_default_cmds = ref [!toplevel_path,default_options,[], Macros.empty] let make_custom_opts = let space = Str.regexp " " in fun stdopts s -> let rec aux opts s = try Scanf.sscanf s "%_[ ]%1[+#\\-]%_[ ]%S%_[ ]%s@\n" (fun c opt rem -> match c with | "+" -> aux (opt :: opts) rem | "#" -> aux (opts @ [ opt ]) rem | "-" -> aux (List.filter (fun x -> x <> opt) opts) rem | _ -> assert false (* format of scanned string disallow it *)) with | Scanf.Scan_failure _ -> if s <> "" then lock_eprintf "unknown STDOPT configuration string: %s\n%!" s; opts | End_of_file -> opts in (* NB: current settings does not allow to remove a multiple-argument option (e.g. -verbose 2). *) (* revert the initial list, as it will be reverted back in the end. *) let opts = aux (List.rev (str_split space stdopts)) s in (* preserve options ordering *) List.fold_right (fun x s -> s ^ " " ^ x) opts "" (* how to process options *) let config_exec ~once dir s current = { current with dc_execnow = scan_execnow ~once dir s :: current.dc_execnow } let config_macro _dir s current = let regex = Str.regexp "[ \t]*\\([^ \t@]+\\)\\([ \t]+\\(.*\\)\\|$\\)" in Mutex.lock str_mutex; if Str.string_match regex s 0 then begin let name = Str.matched_group 1 s in let def = try Str.matched_group 3 s with Not_found -> (* empty text *) "" in Mutex.unlock str_mutex; if !verbosity >= 1 then lock_printf "new macro %s with definition %s\n%!" name def; { current with dc_macros = Macros.add_expand name def current.dc_macros } end else begin Mutex.unlock str_mutex; lock_eprintf "cannot understand MACRO definition: %s\n%!" s; current end let config_module dir s current = let make_cmd = "@PTEST_MAKE_MODULE@ " ^ s in let make_cmd = Macros.expand current.dc_macros make_cmd in let current = config_exec ~once:true dir make_cmd current in let k = "PTEST_LOAD_MODULES" and v = " -load-module " ^ s in { current with dc_macros = Macros.append_expand k v current.dc_macros } let config_options = [ "CMD", (fun _ s current -> { current with dc_default_toplevel = s}); "OPT", (fun _ s current -> let t = current.dc_default_toplevel, s, current.dc_default_log, current.dc_macros in { current with (* dc_default_toplevel = !current_default_toplevel;*) dc_default_log = !current_default_log; dc_toplevels = t :: current.dc_toplevels }); "STDOPT", (fun _ s current -> let new_top = List.map (fun (cmd,opts, log, macros) -> cmd, make_custom_opts opts s, log, current.dc_macros) !current_default_cmds in { current with dc_toplevels = new_top @ current.dc_toplevels; dc_default_log = !current_default_log @ current.dc_default_log }); "FILEREG", (fun _ s current -> { current with dc_test_regexp = s }); "FILTER", (fun _ s current -> { current with dc_filter = Some s }); "GCC", (fun _ _ acc -> acc); "COMMENT", (fun _ _ acc -> acc); "DONTRUN", (fun _ s current -> { current with dc_dont_run = true }); "EXECNOW", config_exec ~once:true; "EXEC", config_exec ~once:false; "MACRO", config_macro; "MODULE", config_module; "LOG", (fun _ s current -> { current with dc_default_log = s :: current.dc_default_log }) ] let scan_options dir scan_buffer default = let r = ref { default with dc_toplevels = [] } in current_default_toplevel := default.dc_default_toplevel; current_default_log := default.dc_default_log; current_default_cmds := List.rev default.dc_toplevels; let treat_line s = try Scanf.sscanf s "%[ *]%[A-Za-z0-9]: %s@\n" (fun _ name opt -> try r := (List.assoc name config_options) dir opt !r with Not_found -> lock_eprintf "@[unknown configuration option: %s@\n%!@]" name) with Scanf.Scan_failure _ -> if str_string_match end_comment s 0 then raise End_of_file else () in try while true do Scanf.bscanf scan_buffer "%s@\n" treat_line done; assert false with End_of_file -> (match !r.dc_toplevels with | [] -> { !r with dc_toplevels = default.dc_toplevels } | l -> { !r with dc_toplevels = List.rev l }) let split_config = Str.regexp ",[ ]*" let scan_test_file default dir f = let f = SubDir.make_file dir f in let exists_as_file = try (Unix.lstat f).Unix.st_kind = Unix.S_REG with Unix.Unix_error _ | Sys_error _ -> false in if exists_as_file then begin let scan_buffer = Scanf.Scanning.open_in f in let rec scan_config () = (* space in format string matches any number of whitespace *) Scanf.bscanf scan_buffer " /* %s@\n" (fun names -> let is_current_config name = name = "run.config*" || name = "run.config" && !special_config = "" || name = "run.config_" ^ !special_config in let configs = Str.split split_config (String.trim names) in if List.exists is_current_config configs then (* Found options for current config! *) scan_options dir scan_buffer default else (* config name does not match: eat config and continue. But only if the comment is still opened by the end of the line... *) (if not (str_string_match end_comment names 0) then ignore (scan_options dir scan_buffer default); scan_config ())) in try let options = scan_config () in Scanf.Scanning.close_in scan_buffer; options with End_of_file | Scanf.Scan_failure _ -> Scanf.Scanning.close_in scan_buffer; default end else (* if the file has disappeared, don't try to run it... *) { default with dc_dont_run = true } type toplevel_command = { macros: Macros.t; mutable log_files: string list; file : string ; nb_files : int ; options : string ; toplevel: string ; filter : string option ; directory : SubDir.t ; n : int; execnow:bool } type command = | Toplevel of toplevel_command | Target of execnow * command Queue.t type log = Err | Res type diff = | Command_error of toplevel_command * log | Target_error of execnow | Log_error of SubDir.t (** directory *) * string (** file *) type cmps = | Cmp_Toplevel of toplevel_command | Cmp_Log of SubDir.t (** directory *) * string (** file *) type shared = { lock : Mutex.t ; mutable building_target : bool ; target_queue : command Queue.t ; commands_empty : Condition.t ; work_available : Condition.t ; diff_available : Condition.t ; mutable commands : command Queue.t ; (* file, options, number *) cmps : cmps Queue.t ; (* command that has finished its execution *) diffs : diff Queue.t ; (* cmp that showed some difference *) mutable commands_finished : bool ; mutable cmp_finished : bool ; mutable summary_time : float ; mutable summary_run : int ; mutable summary_ok : int ; mutable summary_log : int; } let shared = { lock = Mutex.create () ; building_target = false ; target_queue = Queue.create () ; commands_empty = Condition.create () ; work_available = Condition.create () ; diff_available = Condition.create () ; commands = Queue.create () ; cmps = Queue.create () ; diffs = Queue.create () ; commands_finished = false ; cmp_finished = false ; summary_time = (Unix.times()).Unix.tms_cutime ; summary_run = 0 ; summary_ok = 0 ; summary_log = 0 } let unlock () = Mutex.unlock shared.lock let lock () = Mutex.lock shared.lock let catenate_number nb_files prefix n = if nb_files > 1 then prefix ^ "." ^ (string_of_int n) else prefix let name_without_extension command = try (Filename.chop_extension command.file) with Invalid_argument _ -> fail ("this test file does not have any extension: " ^ command.file) let gen_prefix gen_file cmd = let prefix = gen_file cmd.directory (name_without_extension cmd) in catenate_number cmd.nb_files prefix cmd.n let log_prefix = gen_prefix SubDir.make_result_file let oracle_prefix = gen_prefix SubDir.make_oracle_file let get_ptest_file cmd = SubDir.make_file cmd.directory cmd.file let get_macros cmd = let ptest_config = if !special_config = "" then "" else "_" ^ !special_config in let ptest_file = get_ptest_file cmd in let ptest_name = try Filename.chop_extension cmd.file with Invalid_argument _ -> cmd.file in let macros = [ "PTEST_CONFIG", ptest_config; "PTEST_DIR", SubDir.get cmd.directory; "PTEST_RESULT", SubDir.get cmd.directory ^ "/" ^ redefine_name "result"; "PTEST_FILE", ptest_file; "PTEST_NAME", ptest_name; "PTEST_NUMBER", string_of_int cmd.n; ] in Macros.add_list macros cmd.macros let basic_command_string = let contains_toplevel_or_frama_c = Str.regexp "[^( ]*\\(\\(toplevel\\)\\|\\(viewer\\)\\|\\(frama-c\\)\\).*" in fun command -> let macros = get_macros command in let logfiles = List.map (Macros.expand macros) command.log_files in command.log_files <- logfiles; let has_ptest_file_t, toplevel = Macros.does_expand macros command.toplevel in let has_ptest_file_o, options = Macros.does_expand macros command.options in let toplevel = if !use_byte then opt_to_byte toplevel else toplevel in let options = if str_string_match contains_toplevel_or_frama_c command.toplevel 0 then begin let opt_modules = Macros.expand macros (Macros.get "PTEST_LOAD_MODULES" macros) in let opt_pre = Macros.expand macros !additional_options_pre in let opt_post = Macros.expand macros !additional_options in "-check " ^ opt_modules ^ " " ^ opt_pre ^ " " ^ options ^ " " ^ opt_post end else options in let options = if !use_byte then opt_to_byte_options options else options in if has_ptest_file_t || has_ptest_file_o || command.execnow then toplevel ^ " " ^ options else toplevel ^ " " ^ get_ptest_file command ^ " " ^ options (* Searches for executable [s] in the directories contained in the PATH environment variable. Returns [None] if not found, or [Some ] otherwise. *) let find_in_path s = let trim_right s = let n = ref (String.length s - 1) in let last_char_to_keep = try while !n > 0 do if String.get s !n <> ' ' then raise Exit; n := !n - 1 done; 0 with Exit -> !n in String.sub s 0 (last_char_to_keep+1) in let s = trim_right s in let path_separator = if Sys.os_type = "Win32" then ";" else ":" in let re_path_sep = Str.regexp path_separator in let path_dirs = Str.split re_path_sep (Sys.getenv "PATH") in let found = ref "" in try List.iter (fun dir -> let fullname = dir ^ Filename.dir_sep ^ s in if Sys.file_exists fullname then begin found := fullname; raise Exit end ) path_dirs; None with Exit -> Some !found let command_string command = let log_prefix = log_prefix command in let errlog = log_prefix ^ ".err.log" in let stderr = match command.filter with None -> errlog | Some _ -> let stderr = Filename.temp_file (Filename.basename log_prefix) ".err.log" in at_exit (fun () -> unlink stderr); stderr in let filter = match command.filter with | None -> None | Some filter -> let len = String.length filter in let rec split_filter i = if i < len && filter.[i] = ' ' then split_filter (i+1) else try let idx = String.index_from filter i ' ' in String.sub filter i idx, String.sub filter idx (len - idx) with Not_found -> String.sub filter i (len - i), "" in let exec_name, params = split_filter 0 in let exec_name = if Sys.file_exists exec_name || not (Filename.is_relative exec_name) then exec_name else match find_in_path exec_name with | Some full_exec_name -> full_exec_name | None -> Filename.concat (Filename.dirname (Filename.dirname log_prefix)) (Filename.basename exec_name) in Some (exec_name ^ params) in let command_string = basic_command_string command in let command_string = command_string ^ " 2>" ^ stderr in let command_string = match filter with | None -> command_string | Some filter -> command_string ^ " | " ^ filter in let command_string = command_string ^ " >" ^ log_prefix ^ ".res.log" in let command_string = match filter with | None -> command_string | Some filter -> Printf.sprintf "%s && %s < %s >%s && rm -f %s" command_string filter stderr errlog stderr in command_string let update_log_files dir file = mv (SubDir.make_result_file dir file) (SubDir.make_oracle_file dir file) let update_toplevel_command command = let log_prefix = log_prefix command in let oracle_prefix = oracle_prefix command in (* Update oracle *) mv (log_prefix ^ ".res.log") (oracle_prefix ^ ".res.oracle"); (* Is there an error log ? *) begin try let log = log_prefix ^ ".err.log" and oracle = oracle_prefix ^ ".err.oracle" in if is_file_empty_or_nonexisting log then (* No, remove the error oracle *) unlink ~silent:false oracle else (* Yes, update the error oracle*) mv log oracle with (* Possible error in [is_file_empty] *) Unix.Unix_error _ -> () end; let macros = get_macros command in let log_files = List.map (Macros.expand macros) command.log_files in List.iter (update_log_files command.directory) log_files let rec update_command = function Toplevel cmd -> update_toplevel_command cmd | Target (execnow,cmds) -> List.iter (update_log_files execnow.ex_dir) execnow.ex_log; Queue.iter update_command cmds let remove_execnow_results execnow = List.iter (fun f -> unlink (SubDir.make_result_file execnow.ex_dir f)) (execnow.ex_bin @ execnow.ex_log) module Make_Report(M:sig type t end)=struct module H=Hashtbl.Make (struct type t = toplevel_command let project cmd = (cmd.directory,cmd.file,cmd.n) let compare c1 c2 = compare (project c1) (project c2) let equal c1 c2 = (project c1)=(project c2) let hash c = Hashtbl.hash (project c) end) let tbl = H.create 774 let m = Mutex.create () let record cmd (v:M.t) = if !xunit then begin Mutex.lock m; H.add tbl cmd v; Mutex.unlock m end let iter f = Mutex.lock m; H.iter f tbl; Mutex.unlock m let find k = H.find tbl k let remove k = H.remove tbl k end module Report_run=Make_Report(struct type t=int*float (* At some point will contain the running time*) end) let report_run cmp r = Report_run.record cmp r module Report_cmp=Make_Report(struct type t=int*int end) let report_cmp = Report_cmp.record let pretty_report fmt = Report_run.iter (fun test (_run_result,time_result) -> Format.fprintf fmt "%s@." (Filename.basename (SubDir.get test.directory)) test.file time_result (let res,err = Report_cmp.find test in Report_cmp.remove test; (if res=0 && err=0 then "" else Format.sprintf "%s" (if res=1 then "Stdout oracle difference" else if res=2 then "Stdout System Error (missing oracle?)" else if err=1 then "Stderr oracle difference" else if err=2 then "Stderr System Error (missing oracle?)" else "Unexpected errror")))); (* Test that were compared but not runned *) Report_cmp.iter (fun test (res,err) -> Format.fprintf fmt "%s@." (Filename.basename (SubDir.get test.directory)) test.file (if res=0 && err=0 then "" else Format.sprintf "%s" (if res=1 then "Stdout oracle difference" else if res=2 then "Stdout System Error (missing oracle?)" else if err=1 then "Stderr oracle difference" else if err=2 then "Stderr System Error (missing oracle?)" else "Unexpected errror"))) let xunit_report () = if !xunit then begin let out = open_out_bin "xunit.xml" in let fmt = Format.formatter_of_out_channel out in Format.fprintf fmt "\ @\n\ @\n%t@." (shared.summary_log-shared.summary_ok) "Frama-C" shared.summary_log ((Unix.times()).Unix.tms_cutime -. shared.summary_time) (Unix.gettimeofday ()) pretty_report; close_out out; end let do_command command = match command with | Toplevel command -> (* Update : copy the logs. Do not enqueue any cmp Run | Show: launch the command, then enqueue the cmp Gui: launch the command in the gui Examine : just enqueue the cmp *) if !behavior = Update then update_toplevel_command command else begin (* Run, Show, Gui or Examine *) if !behavior = Gui then begin (* basic_command_string does not redirect the outputs, and does not overwrite the result files *) let basic_command_string = basic_command_string command in lock_printf "%% launch %s@." basic_command_string ; ignore (launch basic_command_string) end else begin (* command string also replaces macros in logfiles names, which is useful for Examine as well. *) let command_string = command_string command in if !behavior <> Examine then begin if !verbosity >= 1 then lock_printf "%% launch %s@." command_string ; let launch_result = launch command_string in let time = 0. (* Individual time is difficult to compute correctly for now, and currently unused *) in report_run command (launch_result, time) end; lock (); shared.summary_run <- succ shared.summary_run ; Queue.push (Cmp_Toplevel command) shared.cmps; List.iter (fun f -> Queue.push (Cmp_Log (command.directory, f)) shared.cmps) command.log_files; unlock () end end | Target (execnow, cmds) -> let continue res = lock(); shared.summary_log <- succ shared.summary_log; if res = 0 then begin shared.summary_ok <- succ shared.summary_ok; Queue.transfer shared.commands cmds; shared.commands <- cmds; shared.building_target <- false; Condition.broadcast shared.work_available; if !behavior = Examine || !behavior = Run then begin List.iter (fun f -> Queue.push (Cmp_Log(execnow.ex_dir, f)) shared.cmps) execnow.ex_log end end else begin let rec treat_cmd = function Toplevel cmd -> shared.summary_run <- shared.summary_run + 1; let log_prefix = log_prefix cmd in unlink (log_prefix ^ ".res.log ") | Target (execnow,cmds) -> shared.summary_run <- succ shared.summary_run; remove_execnow_results execnow; Queue.iter treat_cmd cmds in Queue.iter treat_cmd cmds; Queue.push (Target_error execnow) shared.diffs; shared.building_target <- false; Condition.signal shared.diff_available end; unlock() in if !behavior = Update then begin update_command command; lock (); shared.building_target <- false; Condition.signal shared.work_available; unlock (); end else begin if !behavior <> Examine && not (!(execnow.ex_done) && execnow.ex_once) then begin remove_execnow_results execnow; let cmd = if !use_byte then execnow_opt_to_byte execnow.ex_cmd else execnow.ex_cmd in if !verbosity >= 1 then begin lock_printf "%% launch %s@." cmd; end; let r = launch cmd in (* mark as already executed. For EXECNOW in test_config files, other instances (for example another test of the same directory), won't relaunch the command. For EXECNOW in stand-alone tests, there is only one copy of the EXECNOW anyway *) execnow.ex_done := true; continue r end else continue 0 end let log_ext = function Res -> ".res" | Err -> ".err" let launch_and_check_compare_file diff ~cmp_string ~log_file ~oracle_file = lock(); shared.summary_log <- shared.summary_log + 1; unlock(); let res = launch cmp_string in begin match res with 0 -> lock(); shared.summary_ok <- shared.summary_ok + 1; unlock() | 1 -> lock(); Queue.push diff shared.diffs; Condition.signal shared.diff_available; unlock() | 2 -> lock_printf "%% System error while comparing. Maybe one of the files is missing...@\n%s or %s@." log_file oracle_file | n -> lock_printf "%% Comparison function exited with code %d for files %s and %s. \ Allowed exit codes are 0 (no diff), 1 (diff found) and \ 2 (system error). This is a fatal error.@." n log_file oracle_file; exit 2 end; res let check_file_is_empty_or_nonexisting diff ~log_file = if is_file_empty_or_nonexisting log_file then 0 else begin lock(); Queue.push diff shared.diffs; Condition.signal shared.diff_available; unlock(); 1 end let compare_one_file cmp log_prefix oracle_prefix log_kind = if !behavior = Show then begin lock(); Queue.push (Command_error(cmp,log_kind)) shared.diffs; Condition.signal shared.diff_available; unlock(); -1 end else let ext = log_ext log_kind in let log_file = log_prefix ^ ext ^ ".log" in let oracle_file = oracle_prefix ^ ext ^ ".oracle" in if log_kind = Err && not (Sys.file_exists oracle_file) then check_file_is_empty_or_nonexisting (Command_error (cmp,log_kind)) ~log_file else begin let cmp_string = !do_cmp ^ " " ^ log_file ^ " " ^ oracle_file ^ " > /dev/null 2> /dev/null" in if !verbosity >= 2 then lock_printf "%% cmp%s (%d) :%s@." ext cmp.n cmp_string; launch_and_check_compare_file (Command_error (cmp,log_kind)) ~cmp_string ~log_file ~oracle_file end let compare_one_log_file dir file = if !behavior = Show then begin lock(); Queue.push (Log_error(dir,file)) shared.diffs; Condition.signal shared.diff_available; unlock() end else let log_file = SubDir.make_result_file dir file in let oracle_file = SubDir.make_oracle_file dir file in let cmp_string = !do_cmp ^ " " ^ log_file ^ " " ^ oracle_file ^ " > /dev/null 2> /dev/null" in if !verbosity >= 2 then lock_printf "%% cmplog: %s / %s@." (SubDir.get dir) file; ignore (launch_and_check_compare_file (Log_error (dir,file)) ~cmp_string ~log_file ~oracle_file) let do_cmp = function | Cmp_Toplevel cmp -> let log_prefix = log_prefix cmp in let oracle_prefix = oracle_prefix cmp in let res = compare_one_file cmp log_prefix oracle_prefix Res in let err = compare_one_file cmp log_prefix oracle_prefix Err in report_cmp cmp (res,err) | Cmp_Log(dir, f) -> ignore (compare_one_log_file dir f) let worker_thread () = while true do lock () ; if (Queue.length shared.commands) + (Queue.length shared.cmps) < !n then Condition.signal shared.commands_empty; try let cmp = Queue.pop shared.cmps in unlock () ; do_cmp cmp with Queue.Empty -> try let rec real_command () = let command = try if shared.building_target then raise Queue.Empty; Queue.pop shared.target_queue with Queue.Empty -> Queue.pop shared.commands in match command with Target _ -> if shared.building_target then begin Queue.push command shared.target_queue; real_command() end else begin shared.building_target <- true; command end | _ -> command in let command = real_command() in unlock () ; do_command command with Queue.Empty -> if shared.commands_finished && Queue.is_empty shared.target_queue && not shared.building_target (* a target being built would mean work can still appear *) then (unlock () ; Thread.exit ()); Condition.signal shared.commands_empty; (* we still have the lock at this point *) Condition.wait shared.work_available shared.lock; (* this atomically releases the lock and suspends the thread on the condition work_available *) unlock (); done let do_diff = function | Command_error (diff, kind) -> let log_prefix = log_prefix diff in let log_ext = log_ext kind in let command_string = command_string diff in lock_printf "%tCommand:@\n%s@." print_default_env command_string; if !behavior = Show then ignore (launch ("cat " ^ log_prefix ^ log_ext ^ ".log")) else let oracle_prefix = oracle_prefix diff in let diff_string = !do_diffs ^ " " ^ oracle_prefix ^ log_ext ^ ".oracle " ^ log_prefix ^ log_ext ^ ".log" in ignore (launch diff_string) | Target_error execnow -> lock_printf "Custom command failed: %s@\n" execnow.ex_cmd | Log_error(dir, file) -> let result_file = SubDir.make_result_file dir file in lock_printf "Log of %s:@." result_file; if !behavior = Show then ignore (launch ("cat " ^ result_file)) else let diff_string = !do_diffs ^ " " ^ SubDir.make_oracle_file dir file ^ " " ^ result_file in ignore (launch diff_string) let diff_thread () = lock () ; while true do try let diff = Queue.pop shared.diffs in unlock (); do_diff diff; lock () with Queue.Empty -> if shared.cmp_finished then (unlock () ; Thread.exit ()); Condition.wait shared.diff_available shared.lock (* this atomically releases the lock and suspends the thread on the condition cmp_available *) done let test_pattern config = let regexp = Str.regexp config.dc_test_regexp in fun file -> str_string_match regexp file 0 let files = Queue.create () (* test for a possible toplevel configuration. *) let default_config () = let general_config_file = Filename.concat test_path dir_config_file in if Sys.file_exists general_config_file then begin let scan_buffer = Scanf.Scanning.from_file general_config_file in scan_options (SubDir.create ~with_subdir:false Filename.current_dir_name) scan_buffer (default_config ()) end else default_config () let () = (* enqueue the test files *) let default_suites () = let priority = "tests/idct" in let default = !default_suites in if List.mem priority default then priority :: (List.filter (fun name -> name <> priority) default) else default in let suites = match !suites with | [] -> default_suites () | l -> List.fold_left (fun acc x -> if x = "tests" then (default_suites ()) @ acc else x::acc ) [] l in let interpret_as_file suite = try let ext = Filename.chop_extension suite in ext <> "" with Invalid_argument _ -> false in let exclude_suite, exclude_file = List.fold_left (fun (suite,test) x -> if interpret_as_file x then (suite,x::test) else (x::suite,test)) ([],[]) !exclude_suites in List.iter (fun suite -> if !verbosity >= 2 then lock_printf "%% producer now treating test %s\n%!" suite; (* the "suite" may be a directory or a single file *) let interpret_as_file = interpret_as_file suite in let directory = SubDir.create (if interpret_as_file then Filename.dirname suite else suite) in let config = SubDir.make_file directory dir_config_file in let dir_config = if Sys.file_exists config then begin let scan_buffer = Scanf.Scanning.from_file config in scan_options directory scan_buffer (default_config ()) end else default_config () in if interpret_as_file then begin if not (List.mem suite exclude_file) then Queue.push (Filename.basename suite, directory, dir_config) files end else begin if not (List.mem suite exclude_suite) then begin let dir_files = Sys.readdir (SubDir.get directory) in for i = 0 to pred (Array.length dir_files) do let file = dir_files.(i) in assert (Filename.is_relative file); if test_pattern dir_config file && (not (List.mem (SubDir.make_file directory file) exclude_file)) then Queue.push (file, directory, dir_config) files; done end end) suites let dispatcher () = try while true do lock (); while (Queue.length shared.commands) + (Queue.length shared.cmps) >= !n do Condition.wait shared.commands_empty shared.lock; done; (* we have the lock *) let file, directory, config = Queue.pop files in let config = scan_test_file config directory file in let i = ref 0 in let e = ref 0 in let nb_files = List.length config.dc_toplevels in let make_toplevel_cmd (toplevel, options, log_files, macros) = let n = !i in {file; options; toplevel; nb_files; directory; n; log_files; filter = config.dc_filter; macros; execnow=false; } in let mk_cmd s = { file = file; nb_files = nb_files; log_files = []; options = ""; toplevel = s; n = !e; directory = directory; filter = config.dc_filter; macros = config.dc_macros; execnow = true; } in let process_macros_cmd s = basic_command_string (mk_cmd s) in let macros = get_macros (mk_cmd "/bin/true") in let process_macros s = Macros.expand macros s in let make_execnow_cmd execnow = let res = { ex_cmd = process_macros_cmd execnow.ex_cmd; ex_log = List.map process_macros execnow.ex_log; ex_bin = List.map process_macros execnow.ex_bin; ex_dir = execnow.ex_dir; ex_once = execnow.ex_once; ex_done = execnow.ex_done; } in incr e; res in let treat_option q option = Queue.push (Toplevel (make_toplevel_cmd option)) q; incr i in if not config.dc_dont_run then begin (match config.dc_execnow with | hd :: tl -> let subworkqueue = Queue.create () in List.iter (treat_option subworkqueue) config.dc_toplevels; let target = List.fold_left (fun current_target execnow -> let subworkqueue = Queue.create () in Queue.add current_target subworkqueue; Target(make_execnow_cmd execnow,subworkqueue)) (Target(make_execnow_cmd hd,subworkqueue)) tl in Queue.push target shared.commands | [] -> List.iter (treat_option shared.commands) config.dc_toplevels); Condition.broadcast shared.work_available; end; unlock () ; done with Queue.Empty -> shared.commands_finished <- true; unlock () let () = let worker_ids = Array.init !n (fun _ -> Thread.create worker_thread ()) in let diff_id = Thread.create diff_thread () in dispatcher (); if !behavior = Run then lock_printf "%% Dispatch finished, waiting for workers to complete@."; ignore (Thread.create (fun () -> while true do Condition.broadcast shared.work_available; Thread.delay 0.5; done) ()); Array.iter Thread.join worker_ids; if !behavior = Run then lock_printf "%% Comparisons finished, waiting for diffs to complete@."; lock(); shared.cmp_finished <- true; unlock(); ignore (Thread.create (fun () -> while true do Condition.broadcast shared.diff_available; Thread.delay 0.5; done) ()); Thread.join diff_id; if !behavior = Run then lock_printf "%% Diffs finished. Summary:@\nRun = %d@\nOk = %d of %d@\nTime = %f s.@." shared.summary_run shared.summary_ok shared.summary_log ((Unix.times()).Unix.tms_cutime -. shared.summary_time); xunit_report (); let error_code = if !do_error_code && shared.summary_log <> shared.summary_ok then 1 else 0 in exit error_code (* Local Variables: compile-command: "LC_ALL=C make -C .. ptests" End: *) frama-c-20.0-Calcium/share/0000777000000000000000000000000013571573400012315 5ustar frama-c-20.0-Calcium/share/META.frama-c0000666000000000000000000000046613571573400014301 0ustar description="frama-c" version="" requires="" package "kernel" ( description="The kernel library of frama-c" version="" requires="@REQUIRES" archive(byte) = "frama-c.cma" plugin(byte) = "frama-c.cma" archive(native) = "frama-c.cmxa" plugin(native) = "frama-c.cmxs" directory="" ) directory="" frama-c-20.0-Calcium/share/Makefile.common0000666000000000000000000002372613571573400015256 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ########################################################################## # # # Define common stuff shared by makefiles. # # # ########################################################################## include $(MAKECONFIG_DIR)/Makefile.config ####################### # Working directories # ####################### # Frama-C kernel directories FRAMAC_SRC_DIRS= plugins/pdg_types plugins/value_types \ libraries/stdlib libraries/utils \ libraries/project libraries/datatype \ kernel_internals/parsing \ kernel_internals/typing \ kernel_internals/runtime \ kernel_services/parsetree \ kernel_services/ast_data \ kernel_services/ast_queries \ kernel_services/ast_printing \ kernel_services/cmdline_parameters \ kernel_services/plugin_entry_points \ kernel_services/abstract_interp \ kernel_services/visitors \ kernel_services/analysis \ kernel_services/ast_transformations \ plugins/gui FRAMAC_SRC_DIRS:= $(addprefix src/, $(FRAMAC_SRC_DIRS)) ################## # Flags # ################## # Flags to be used by ocamlc and ocamlopt when compiling Frama-C # itself. For development versions, we add -warn-error for most # warnings -warn-error has effect only for warnings that are # explicitly set using '-w'. ifeq ($(DEVELOPMENT),yes) # Most warnings are activated by default. Those settings are inherited # in the compilation of external plugins. # - 4 (fragile pattern-matching) only make sense when adding a node to a type. # OCaml GPR #1071 will make it usable # - 6 (omit label in application) would make code clearer, but requires # refactoring before being enabled. # - 9 (missing field in record pattern) is much too heavy. Most of the time # not all fields are relevant in pattern-matching Frama-C's AST. # - 41 (ambiguous constructor or label name) prevents type-based # disambiguation, a feature which is seen as a good thing by many developers # - 44 (open shadows an identifier) # - 45 (open shadows a label or constructor): While the use of open directives # is supposed to stay small, it should still be possible to open modules # that share common names, barring some mechanism to open only parts of a # module. # - 48 (implicit elimination of optional arguments): makes use of functions # with optional arguments heavier in higher-order context # - 50 (warning about ambiguously placed OCamldoc comments): while it would be # useful to ensure OCamldoc understands comments correctly, some clean-up # is needed before enabling this warning. WARNINGS ?= -w +a-4-6-9-41-44-45-48-50 # - 3 (deprecated feature) cannot always be avoided for OCaml stdlib when # supporting several OCaml versions # - 4 (fragile pattern matching) will be activated when adding a node (see # above), in order to let the developer decide whether a case should be # added on relevant fragile pattern or not: a matching might very well stay # fragile without triggering an error. # - 3x (various categories of unused identifiers) it is sometimes useful to # let code compile despite such warnings when in the middle of a development. # On the other hand, a completed feature should not trigger such warnings. # - 58 (missing cmx) is triggered by some versions of external libraries. # Situation should probably improve as these libraries get updated, leading # to treat this warning as error. WARN_ERROR ?= -warn-error +a-3-4-32-33-34-35-36-37-38-39-58 else WARNINGS ?= -w -a endif #DEVELOPMENT FLAGS = $(WARNINGS) $(WARN_ERROR) $(OCAML_ANNOT_OPTION) -strict-sequence \ -safe-string DEBUG = -g ############# # Verbosing # ############# ifneq ($(VERBOSEMAKE),no) # Do not change to ifeq ($(VERBOSEMAKE),yes), as this # version makes it easier for the user to set the # option on the command-line to investigate # Makefile-related problems # ignore the PRINT_* materials but print all the other commands PRINT = @true # prevent the warning "jobserver unavailable: using -j1". # see GNU make manual (section 5.7.1 and appendix B) QUIET_MAKE:= + $(MAKE) # prevent the warning: "-jN forced in submake: disabling jobserver mode". # see GNU make manual (appendix B) MAKE := MAKEFLAGS="$(patsubst j,,$(MAKEFLAGS))" $(MAKE) else # print the PRINT_* materials PRINT = @echo # but silently execute all the other commands # fixed bug #637: do not write spaces between flags OLDFLAGS:=r$(MAKEFLAGS) MAKEFLAGS:=rs$(MAKEFLAGS) # do not silently execute other makefiles (e.g the one of why): # the redefinition of MAKE below is for this purpose # but use QUIET_MAKE in order to call silently the initial Makefile QUIET_MAKE:= + $(MAKE) MAKE := MAKEFLAGS="$(OLDFLAGS)" $(MAKE) endif ################## # Shell commands # ################## # prefer to use these commands and not directly "cp" or others CAT = cat CHMOD = chmod CHMOD_RO= chmod a-w CHMOD_RW= sh -c \ 'for f in "$$@"; do \ if test -e $$f; then chmod u+w $$f; fi \ done' chmod_rw CP = install CP_IF_DIFF = sh -c \ 'if cmp -s $$1 $$2; \ then touch -r $$2 $$1; \ else echo "Generating $$2"; install $$1 $$2; fi' cpifdiff #follow symbolic link CP_L = cp -fL ECHO = echo MKDIR = mkdir -p MV = mv ISED = sh -c \ 'new_temp=`mktemp /tmp/frama-c.XXXXXXX` || exit 1; \ sed "$$@" > $$new_temp; \ eval last=\$${$$\#}; \ mv $$new_temp $$last' sed_inplace SED = LC_ALL=C sed RM = rm -f ifeq ($(shell uname -s 2> /dev/null),Darwin) TAR = gtar else TAR = tar endif TOUCH = touch GIT = git ################## # Make commands # ################## map=$(foreach a,$(2),$(call $(1),$(a))) define assert_defined ifndef $(1) $$(error Undefined variable $(1) please report.) endif endef ########################### # Command pretty printing # ########################### PRINT_OCAMLC =$(PRINT) 'Ocamlc '# PRINT_OCAMLOPT =$(PRINT) 'Ocamlopt '# PRINT_DEP =$(PRINT) 'Ocamldep '# PRINT_OCAMLLEX =$(PRINT) 'Ocamllex '# PRINT_OCAMLYACC =$(PRINT) 'Ocamlyacc '# PRINT_OCAMLMKTOP=$(PRINT) 'Ocamlmktop '# PRINT_DOC =$(PRINT) 'Ocamldoc '# PRINT_OCAMLCP =$(PRINT) 'Profiling '# PRINT_CAMLP4 =$(PRINT) 'Camlp4 '# PRINT_PACKING =$(PRINT) 'Packing '# PRINT_LINKING =$(PRINT) 'Linking '# PRINT_INFERRING =$(PRINT) 'Inferring '# PRINT_CC =$(PRINT) 'CC '# PRINT_MAKING =$(PRINT) 'Generating '# PRINT_MV =$(PRINT) 'Moving to '# PRINT_CP =$(PRINT) 'Copying to '# PRINT_RM =$(PRINT) 'Cleaning '# PRINT_EXEC =$(PRINT) 'Running '# PRINT_TAR =$(PRINT) 'Archiving '# PRINT_UNTAR =$(PRINT) 'Unarchiving '# PRINT_CONFIG =$(PRINT) 'Configuring '# PRINT_BUILD =$(PRINT) 'Building '# PRINT_INSTALL =$(PRINT) 'Installing '# PRINT_UPDATE =$(PRINT) 'Updating '# PRINT_DOT =$(PRINT) 'Dot '# PRINT_LATEX =$(PRINT) 'Latex '# PRINT_DVIPS =$(PRINT) 'Dvips '# PRINT_HEVEA =$(PRINT) 'Hevea '# ######### # Tests # ######### ################# # Documentation # ################# NATIVE_OCAMLDOC:=$(shell ocamlfind ocamldoc -v | grep -o ocamldoc.opt) ifeq ("$(NATIVE_OCAMLDOC)","ocamldoc.opt") DOC_PLUGIN=$(DOC_DIR)/docgen.cmxs else DOC_PLUGIN=$(DOC_DIR)/docgen.cmo endif ########################## # Plugin File Generation # ########################## #take the name of the plugin as argument $(1) define include_generic_plugin_Makefile $(call assert_defined,PLUGIN_DIR) $(PLUGIN_DIR)/.Makefile.plugin.generated: $(MAKECONFIG_DIR)/Makefile.plugin.template $(PRINT_MAKING) $$@ $(SED) -e "s/@PLUGIN_NAME@/$(1)/g" $$< > $$@ # We still clean the old Makefile.plugin.generated (without the dot) temporarily clean:: rm -rf $(PLUGIN_DIR)/.Makefile.plugin.generated rm -rf $(PLUGIN_DIR)/Makefile.plugin.generated #We always define this variable because it can't wait the generation #of the Makefile.plugin.generated since the targets of rules defined in the #Makefile of the plugins could use this variable $(1)_DIR:=$(PLUGIN_DIR) sinclude $(PLUGIN_DIR)/.Makefile.plugin.generated endef %.check_mli_exists: %.mli touch $@ .PHONY:common_force_rule %.check_mli_exists: common_force_rule $(error "The file '$*.mli' must be provided. The simplest workaround is 'touch $*.mli') ########################################################################## # Local Variables: # compile-command: "make" # mode: makefile # End: frama-c-20.0-Calcium/share/Makefile.config.in0000666000000000000000000001546013571573400015634 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ########################################################################## # # # Define variables from configure. # # These variables may be redefined later. # # # ########################################################################## ###################### # Installation paths # ###################### CYGPATH ?=@CYGPATH@ DESTDIR ?= prefix ?=@prefix@ exec_prefix ?=@exec_prefix@ datarootdir ?=@datarootdir@ datadir ?=@datadir@ BINDIR ?=$(DESTDIR)@bindir@ LIBDIR ?=$(DESTDIR)@libdir@ DATADIR ?=$(DESTDIR)@datarootdir@ MANDIR ?=$(DESTDIR)@mandir@ FRAMAC_LIBDIR ?=$(LIBDIR)/frama-c FRAMAC_PLUGINDIR ?=$(FRAMAC_LIBDIR)/plugins FRAMAC_DATADIR ?=$(DATADIR)/frama-c EMACS_DATADIR ?=$(DATADIR)/emacs/site-lisp FRAMAC_DEFAULT_CPP ?=@FRAMAC_DEFAULT_CPP@ FRAMAC_DEFAULT_CPP_ARGS ?= @FRAMAC_DEFAULT_CPP_ARGS@ FRAMAC_GNU_CPP ?=@FRAMAC_GNU_CPP@ DEFAULT_CPP_KEEP_COMMENTS?=@DEFAULT_CPP_KEEP_COMMENTS@ DEFAULT_CPP_SUPPORTED_ARCH_OPTS?=@DEFAULT_CPP_SUPPORTED_ARCH_OPTS@ CC =@CC@ ############### # Ocaml stuff # ############### # compilers and others executables OCAMLC ?=@OCAMLC@ OCAMLOPT ?=@OCAMLOPT@ OCAMLDEP ?=@OCAMLDEP@ -slash OCAMLLEX ?=@OCAMLLEX@ OCAMLYACC ?=@OCAMLYACC@ OCAMLMKTOP ?=@OCAMLMKTOP@ OCAMLMKLIB ?=@OCAMLFIND@ ocamlmklib OCAMLFIND ?=@OCAMLFIND@ OCAMLDOC ?=@OCAMLDOC@ OCAMLCP ?=@OCAMLCP@ # others ocaml stuffs # either -annot or -dtypes OCAML_ANNOT_OPTION ?=@OCAML_ANNOT_OPTION@ # ocaml stdlib path OCAMLLIB ?=@OCAMLLIB@ # either opt or byte OCAMLBEST ?=@OCAMLBEST@ OCAMLVERSION ?=@OCAMLVERSION@ OCAMLMAJORNB ?=@OCAMLMAJORNB@ OCAMLMINORNB ?=@OCAMLMINORNB@ OCAMLPATCHNB ?=@OCAMLPATCHNB@ HAS_OCAML407 ?=@HAS_OCAML407@ HAS_OCAML408 ?=@HAS_OCAML408@ PLATFORM ?=@PLATFORM@ OCAMLWIN32 ?=@OCAMLWIN32@ DEVELOPMENT ?=@DEVELOPMENT@ ############# # Libraries # ############# # lablgtk HAS_LABLGTK ?=@HAS_LABLGTK@ HAS_LABLGTK_CUSTOM_MODEL ?=@HAS_LABLGTK@ LABLGTK_PATH ?=@LABLGTK_PATH@ LABLGTK ?= lablgtk@LABLGTK_VERSION@ # lablgtksourceview HAS_GTKSOURCEVIEW ?=@HAS_GTKSOURCEVIEW@ LABLGTK_VERSION ?=@LABLGTK_VERSION@ ifeq ("$(LABLGTK_VERSION)","3") GTKSOURCEVIEW:=lablgtk3-sourceview3 THREAD:=-thread else GTKSOURCEVIEW:=\ $(patsubst lablgtk%,$(LABLGTK).%,$(basename $(notdir @GTKSOURCEVIEW@))) THREAD:= endif # lablgnomecanvas HAS_GNOMECANVAS ?=@HAS_GNOMECANVAS@ # apron HAS_APRON ?=@HAS_APRON@ # mpfr HAS_MPFR ?=@HAS_MPFR@ # landmarks HAS_LANDMARKS ?=@HAS_LANDMARKS@ ########################## # Miscellaneous commands # ########################## OTAGS ?=@OTAGS@ DOT ?=@DOT@ HAS_DOT ?=@HAS_DOT@ HEADACHE ?= headache -c $(FRAMAC_SRC)/headers/headache_config.txt ########################### # Miscellaneous variables # ########################### VERBOSEMAKE ?=@VERBOSEMAKE@ LOCAL_MACHDEP ?=@LOCAL_MACHDEP@ EXE ?=@EXE@ # Required by Cil UNDERSCORE_NAME ?=@UNDERSCORE_NAME@ HAVE_BUILTIN_VA_LIST ?=@HAVE_BUILTIN_VA_LIST@ THREAD_IS_KEYWORD ?=@THREAD_IS_KEYWORD@ # test directories for ptests configuration # Non-plugin test directories containing some ML files to compile TEST_DIRS_AS_PLUGIN:=\ dynamic dynamic_plugin journal saveload spec misc syntax cil \ pretty_printing builtins libc value fc_script TEST_DIRS_AS_PLUGIN+=jcdb PLUGIN_TESTS_LIST+=$(TEST_DIRS_AS_PLUGIN) ########################## # Variables for plug-ins # ########################## EXTERNAL_PLUGINS ?=@EXTERNAL_PLUGINS@ # Integrated plugins ENABLE_CALLGRAPH ?=@ENABLE_CALLGRAPH@ ENABLE_CONSTANT_PROPAGATION ?=@ENABLE_SEMANTIC_CONSTANT_FOLDING@ ENABLE_FROM_ANALYSIS ?=@ENABLE_FROM_ANALYSIS@ ENABLE_GUI ?=@ENABLE_GUI@ ENABLE_IMPACT ?=@ENABLE_IMPACT@ ENABLE_INOUT ?=@ENABLE_INOUT@ ENABLE_METRICS ?=@ENABLE_METRICS@ ENABLE_OCCURRENCE ?=@ENABLE_OCCURRENCE@ ENABLE_PDG ?=@ENABLE_PDG@ ENABLE_POSTDOMINATORS ?=@ENABLE_POSTDOMINATORS@ ENABLE_RTEGEN ?=@ENABLE_RTEGEN@ ENABLE_SCOPE ?=@ENABLE_SCOPE@ ENABLE_SLICING ?=@ENABLE_SLICING@ ENABLE_SPARECODE ?=@ENABLE_SPARECODE@ ENABLE_USERS ?=@ENABLE_USERS@ ENABLE_EVA ?=@ENABLE_EVA@ #bytes is part of the stdlib, but is used as a transitional package. LIBRARY_NAMES := \ findlib ocamlgraph unix str dynlink bytes zarith yojson bigarray ifeq ($(HAS_LANDMARKS),yes) LIBRARY_NAMES += landmarks landmarks.ppx endif ifneq ($(ENABLE_GUI),no) LIBRARY_NAMES_GUI = $(LABLGTK) $(GTKSOURCEVIEW) ifeq ($(HAS_GNOMECANVAS),yes) LIBRARY_NAMES_GUI+=lablgtk2.gnomecanvas endif else LIBRARY_NAMES_GUI = endif ####################### # Working directories # ####################### ifeq ($(OCAMLWIN32),yes) ifneq ($(CYGPATH),no) # Note: using quotes in the line below leads to weird garbled characters # in some versions of Cygwin. winpath=$(shell $(CYGPATH) -m $(1)) else winpath=$(1) endif #CYGPATH else winpath=$(1) endif #OCAMLWIN32 FRAMAC_ROOT_SRCDIR ?= $(call winpath,@abs_top_srcdir@) ########################################################################## # Local Variables: # mode: makefile # End: frama-c-20.0-Calcium/share/Makefile.dynamic0000666000000000000000000002300313571573400015376 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## $(eval $(call assert_defined,PLUGIN_NAME)) PLUGIN_ENABLE ?=yes PLUGIN_DIR ?=. FRAMAC_SRC ?=$(PLUGIN_DIR)/../../.. FRAMAC_INTERNAL ?=no ifndef MAKECONFIG_DIR MAKECONFIG_DIR :=$(FRAMAC_SHARE) endif #Add required packages to merlin MERLIN_PACKAGES+=$(PLUGIN_REQUIRES) #Do not generate documentation for this. PLUGIN_UNDOC:=$(PLUGIN_UNDOC) ifeq ($(FRAMAC_INTERNAL),yes) ## The plugin is not compiled from an installed frama-c, ie ## internal plugin (in src/plugins or added during ## ./configure with --enable-external) PLUGIN_RESET :=yes else # The plugin is compiled from an installed frama-c PLUGIN_RESET :=no include $(MAKECONFIG_DIR)/Makefile.common include $(MAKECONFIG_DIR)/Makefile.dynamic_config tests:: external_tests ifeq ($(PLUGIN_ENABLE),no) tests:: doc:: else .PHONY: plugin-doc/$(PLUGIN_NAME) ifneq ($(FRAMAC_INTERNAL),yes) plugin-doc/$(PLUGIN_NAME): if test ! -e $(DOC_DIR)/kernel-doc.ocamldoc; then \ echo "Frama-C kernel was not installed with code documentation \ support. Cannot compile API documentation. To install it, run 'make doc \ install-doc-code' in Frama-C's main directory"; \ exit 1; \ fi $(MKDIR) $($(@:plugin-doc/%=%_DOC_DIR)) else ifeq ($(FRAMAC_INTERNAL),yes) plugin-doc/$(PLUGIN_NAME): : else plugin-doc/$(PLUGIN_NAME): $(MKDIR) $($(@:plugin-doc/%=%_DOC_DIR)) endif endif doc:: plugin-doc/$(PLUGIN_NAME) $(PLUGIN_NAME)_DOC clean-doc:: $(PLUGIN_DIR)/$(PLUGIN_NAME)_CLEAN_DOC ifneq ($(FRAMAC_INTERNAL),yes) install-doc-code:: $(PLUGIN_NAME)_INSTALL_DOC endif $(PLUGIN_NAME)_INSTALL_DOC: plugin-doc/$(PLUGIN_NAME) $(PRINT_CP) $(patsubst %_INSTALL_DOC,%,$@) Documentation $(MKDIR) $(DOC_DIR)/$(@:%_INSTALL_DOC=%) $(CP) $(patsubst %,"%",\ $(wildcard $($(@:%_INSTALL_DOC=%_DOC_DIR))/*.css \ $($(@:%_INSTALL_DOC=%_DOC_DIR))/*.html \ $($(@:%_INSTALL_DOC=%_DOC_DIR))/*.png)) \ $(DOC_DIR)/$(@:%_INSTALL_DOC=%) endif #PLUGIN_ENABLE endif #FRAMAC_INTERNAL #Must be defined before section TESTS, because function call in make #replace not only $(1) but all the other $(..) PLUGIN_LIB_DIR ?= $(PLUGIN_DIR) PLUGIN_GUI_LIB_DIR ?= $(PLUGIN_DIR)/gui PLUGIN_INSTALL_DIR ?=$(DESTDIR)$(FRAMAC_PLUGINDIR) ifneq ($(PLUGIN_ENABLE),no) ######################## TESTS ################# .PHONY: $(PLUGIN_NAME)_TESTS plugins_ptests_config $(eval $(call assert_defined,PLUGIN_LIB_DIR)) $(eval $(call assert_defined,FRAMAC_SHARE)) $(eval $(call assert_defined,FRAMAC_LIB)) # Do not generate tests-related rules when PLUGIN_NO_TEST is set to 'no' but # there is no 'tests' directory. Typically useful for plugins released without # their tests. HAS_TESTS_DIR:=$(shell if test \! -d $(PLUGIN_DIR)/tests; then echo KO; fi) ifneq (,$(HAS_TESTS_DIR)$(PLUGIN_INTERNAL_TEST)$(PLUGIN_NO_TEST)) $(PLUGIN_NAME)_TESTS: else PTESTS_DEP:=$(PLUGIN_DIR)/Makefile $(FRAMAC_SHARE)/Makefile.dynamic plugins_ptests_config: $(PLUGIN_DIR)/tests/ptests_config define TESTS_template $(PLUGIN_DIR)/tests/ptests_config: $(PTESTS_DEP) $(PRINT_MAKING) $$@ $(MKDIR) tests $(RM) $$@ $(ECHO) "DEFAULT_SUITES=" $(PLUGIN_TESTS_DIRS) > $$@ $(ECHO) "TOPLEVEL_PATH=$(FRAMAC_OPT)" >> $$@; $(ECHO) "FRAMAC_SHARE=$(FRAMAC_SHARE)" >> $$@ $(ECHO) "FRAMAC_LIB=$(FRAMAC_LIB)" >> $$@ if test "$(FRAMAC_INTERNAL)" = "no"; then \ $(ECHO) "FRAMAC_PLUGIN=$(PLUGIN_LIB_DIR):$(PLUGIN_INSTALL_DIR)" >> $$@; \ $(ECHO) "FRAMAC_PLUGIN_GUI=$(PLUGIN_GUI_LIB_DIR):$(PLUGIN_INSTALL_DIR)/gui" >> $$@; \ $(ECHO) "OCAMLFIND_IGNORE_DUPS_IN=$(PLUGIN_INSTALL_DIR)" >> $$@; \ else \ $(ECHO) "FRAMAC_PLUGIN=$(PLUGIN_LIB_DIR)" >> $$@; \ $(ECHO) "FRAMAC_PLUGIN_GUI=$(PLUGIN_GUI_LIB_DIR)" >> $$@; \ fi $(ECHO) "OCAMLRUNPARAM=" >> $$@ $(CHMOD_RO) $$@ # OCAMLFIND_IGNORE_DUPS_IN in external mode allows to ignore a previous # installation of the currently tested plugin. # $(PLUGIN_NAME)_DEFAULT_TESTS allows plugins to define rules that at # the same time depend on $(PLUGIN_NAME)_DEFAULT_TESTS and # $(PLUGIN_NAME)_TESTS depend on them .PHONY: $(PLUGIN_NAME)_DEFAULT_TESTS $(PLUGIN_NAME)_DEFAULT_TESTS: $$(TARGETS) $$(TARGETS_TOP) $$(TARGETS_GUI) $(PLUGIN_DIR)/tests/ptests_config $(PRINT) TESTING PLUG-IN $(PLUGIN_NAME) cd $(PLUGIN_DIR) && \ time -p $(PTESTS) $$(PTESTS_OPTS) $(PLUGIN_PTESTS_OPTS) $(PLUGIN_NAME)_TESTS: $(PLUGIN_NAME)_DEFAULT_TESTS endef $(eval $(call TESTS_template)) external_tests: $(PLUGIN_NAME)_TESTS endif endif # PLUGIN_ENABLE ################################################ PLUGIN_FLAGS:=$(FLAGS) $(DEBUG) $(FRAMAC_INCLUDES) PLUGIN_BFLAGS:=$(PLUGIN_FLAGS) $(PLUGIN_BFLAGS) PLUGIN_OFLAGS:=$(PLUGIN_FLAGS) $(PLUGIN_OFLAGS) ifeq ($(FRAMAC_INTERNAL),yes) PLUGIN_DEPFLAGS:=$(PLUGIN_DEPFLAGS) else PLUGIN_DEPFLAGS:=$(FRAMAC_INCLUDES) $(PLUGIN_DEPFLAGS) PLUGIN_DOC_DIR:=$(PLUGIN_DIR)/doc/code endif # For plugins that depends on the API of other ones, we need to add the # directory where the plugins' .cmi are compiled PLUGIN_DOCFLAGS:=\ $(FRAMAC_INCLUDES) -I $(FRAMAC_COMPILED_PLUGINDIR) $(PLUGIN_DOCFLAGS) $(eval $(call include_generic_plugin_Makefile,$(PLUGIN_NAME))) TARGETS := $(TARGET_META) $(TARGET_CMI) TARGETS_TOP := $(TARGET_TOP_CMO) $(TARGET_TOP_CMX) \ $(TARGET_TOP_CMA) $(TARGET_TOP_CMXS) $(TARGET_TOP_O) TARGETS_GUI_BYTE := $(TARGET_GUI_CMI) $(TARGET_GUI_CMO) TARGETS_GUI := $(TARGETS_GUI_BYTE) $(TARGET_GUI_CMX) $(TARGET_GUI_CMXS) $(TARGET_GUI_O) TARGETS_BYTE:= $(TARGET_META) $(TARGET_CMI) $(TARGET_TOP_CMO) $(TARGET_TOP_CMA) TARGETS_OPT:= $(TARGET_META) $(TARGET_CMI) $(TARGET_TOP_CMX) $(TARGET_TOP_CMXS) $(TARGET_TOP_O) byte:: $(TARGETS_BYTE) opt:: $(TARGETS_OPT) gui-byte:: $(TARGETS_GUI_BYTE) gui-opt:: $(TARGETS_GUI) # do not define additional targets if you come from the Frama-C Makefile ifneq ($(FRAMAC_INTERNAL),yes) ################### # Clean & Install # ################### .PHONY: tests all install uninstall clean depend dist-clean distclean: $(PLUGIN_DIR)/$(PLUGIN_NAME)_DIST_CLEAN all:: $(PLUGIN_DIR)/.depend byte $(OCAMLBEST) gui plugins_ptests_config gui: gui-$(OCAMLBEST) ifneq ($(PLUGIN_ENABLE),no) install:: $(PRINT_CP) $(PLUGIN_INSTALL_DIR) $(MKDIR) $(PLUGIN_INSTALL_DIR)/top $(CP) $(TARGETS) $(PLUGIN_INSTALL_DIR) $(CP) $(TARGETS_TOP) $(PLUGIN_INSTALL_DIR)/top $(PRINT_CP) $(BINDIR) if [ -f frama-c-$(PLUGIN_NAME).byte$(EXE) ]; then \ $(CP) frama-c-$(PLUGIN_NAME).byte$(EXE) $(BINDIR); \ fi if [ -f frama-c-$(PLUGIN_NAME).$(OCAMLBEST)$(EXE) ]; then \ $(CP) frama-c-$(PLUGIN_NAME).$(OCAMLBEST)$(EXE) \ $(BINDIR)/frama-c-$(PLUGIN_NAME)$(EXE); \ fi ifeq ($(HAS_GUI),yes) $(PRINT_CP) $(PLUGIN_INSTALL_DIR)/gui $(MKDIR) $(PLUGIN_INSTALL_DIR)/gui $(CP) $(TARGETS_GUI) $(PLUGIN_INSTALL_DIR)/gui endif uninstall:: $(PRINT_RM) installed $(PLUGIN_NAME) $(RM) $(PLUGIN_INSTALL_DIR)/META.$(PLUGIN_PKG) $(RM) $(PLUGIN_INSTALL_DIR)/$(PLUGIN_NAME).* $(RM) $(BINDIR)/frama-c-$(PLUGIN_NAME).* ifeq ($(HAS_GUI),yes) $(RM) $(PLUGIN_INSTALL_DIR)/gui/$(PLUGIN_NAME).* endif endif # PLUGIN_ENABLE <> no ########## # Merlin # ########## .PHONY: create_merlin create_merlin: #create Merlin file for external plug-in $(PRINT_MAKING) .merlin echo "FLG -c $(FLAGS) $(FRAMAC_USER_MERLIN_FLAGS)" > .merlin echo "B $(FRAMAC_LIBDIR)" >> .merlin echo "B $(FRAMAC_LIBDIR)/plugins" >> .merlin echo "B $(FRAMAC_LIBDIR)/plugins/gui" >> .merlin for PKG in $(LIBRARY_NAMES); do echo PKG $$PKG >> .merlin; done for PKG in $(LIBRARY_NAMES_GUI); do echo PKG $$PKG >> .merlin; done for PKG in $(MERLIN_PACKAGES); do echo PKG $$PKG >> .merlin; done for DIR in $(patsubst %/,%,$(sort $(dir $(PLUGIN_ML_SRC) $(PLUGIN_TESTS_LIB)))); do echo S $$DIR>> .merlin; echo B $$DIR >> .merlin; done # To allow completion of .merlin file .PHONY: merlin merlin:: create_merlin .merlin: merlin ############ # Cleaning # ############ clean:: $(PLUGIN_DIR)/$(PLUGIN_NAME)_CLEAN; ################ # Generic part # ################ include $(MAKECONFIG_DIR)/Makefile.generic endif # FRAMAC_INTERNAL <> yes PLUGIN_PTESTS_OPTS:= ############################################################################### # Local Variables: # mode: makefile # End: frama-c-20.0-Calcium/share/Makefile.dynamic_config.external0000666000000000000000000000455313571573400020555 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## export FRAMAC_INTERNAL=no export FRAMAC_OPT=$(BINDIR)/frama-c$(EXE) export FRAMAC_BYTE=$(BINDIR)/frama-c.byte$(EXE) export FRAMAC_INCLUDES=-I "$(FRAMAC_LIBDIR)" export PTESTS=$(BINDIR)/ptests.$(OCAMLBEST)$(EXE) export FRAMAC_LIB=$(FRAMAC_LIBDIR) export DOC_DIR=$(FRAMAC_SHARE)/doc/code export PLUGIN_LIB_DIR=$(PLUGIN_DIR) export FRAMAC_COMPILED_PLUGINDIR=$(FRAMAC_LIBDIR)/plugins export OCAMLPATH:=$(FRAMAC_LIB):$(FRAMAC_PLUGINDIR)$(if $(OCAMLPATH),:,)$(OCAMLPATH) export OCAMLFIND_IGNORE_DUPS_IN:=$(FRAMAC_LIB):$(FRAMAC_PLUGINDIR)$(if $(OCAMLFIND_IGNORE_DUPS_IN),:,)$(OCAMLFIND_IGNORE_DUPS_IN) # fake target corresponding to the clean-install of Frama-C's Makefile .PHONY: clean-install clean-install: ; ########################################################################## # Local Variables: # mode: makefile # End: frama-c-20.0-Calcium/share/Makefile.dynamic_config.internal0000666000000000000000000000462613571573400020550 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## export FRAMAC_INTERNAL=yes export FRAMAC_OPT=$(FRAMAC_ROOT_SRCDIR)/bin/toplevel.opt$(EXE) export FRAMAC_BYTE=$(FRAMAC_ROOT_SRCDIR)/bin/toplevel.byte$(EXE) export FRAMAC_INCLUDES=$(addprefix -I $(call winpath,$(FRAMAC_ROOT_SRCDIR))/,$(FRAMAC_SRC_DIRS) lib) export PTESTS=$(FRAMAC_ROOT_SRCDIR)/bin/ptests.$(OCAMLBEST)$(EXE) export FRAMAC_LIB=$(FRAMAC_ROOT_SRCDIR)/lib/fc export DOC_DIR=$(FRAMAC_ROOT_SRCDIR)/doc/code export PLUGIN_LIB_DIR=$(FRAMAC_ROOT_SRCDIR)/lib/plugins export FRAMAC_COMPILED_PLUGINDIR=$(FRAMAC_ROOT_SRCDIR)/lib/plugins export OCAMLPATH:=$(FRAMAC_LIB):$(PLUGIN_LIB_DIR)$(if $(OCAMLPATH),:,)$(OCAMLPATH) export OCAMLFIND_IGNORE_DUPS_IN:=$(FRAMAC_LIB):$(PLUGIN_LIB_DIR)$(if $(OCAMLFIND_IGNORE_DUPS_IN),:,)$(OCAMLFIND_IGNORE_DUPS_IN) ########################################################################## # Local Variables: # mode: makefile # End: frama-c-20.0-Calcium/share/Makefile.generic0000666000000000000000000001010313571573400015363 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## .DEFAULT_GOAL=all ifndef SUFFIXES_ARE_SET SUFFIXES_ARE_SET:=true # The former .SUFFIXES delete all predefined implicit rules # The latter .SUFFIXES defines our suffix list # See GNU Make manual, section 10.7 # This way of declaring implicit rules is deprecated, # but that is the only way for removing **all** predefined implicit rules # The only other way is to remove each predefined implicit rule, one by one. .SUFFIXES: .SUFFIXES: .c .o .mli .ml .cmi .cmo .cmx .mll .mly .tex .dvi .ps .html .cmxs \ .png .svg .ps ifdef DOT %.png: %.dot $(PRINT_DOT) $@ $(DOT) -Tpng -o $@ $< %.svg: %.dot $(PRINT_DOT) $@ $(ISED) -e "s/\(digraph .*\)/\1 node [href=\"\\\\N.html\"];/" $< $(DOT) -Tsvg -o $@ $< %.ps: %.dot $(PRINT_DOT) $@ $(DOT) -Tps -o $@ $< %.pdf: %.dot $(PRINT_DOT) $@ $(DOT) -Tpdf -o $@ $< else %.png: %.dot @$(ECHO) "dot missing: generation of $@ skipped." %.svg: %.dot @$(ECHO) "dot missing: generation of $@ skipped." %.ps: %.dot @$(ECHO) "dot missing: generation of $@ skipped." endif # the two rules below are used for .cmi. The first one will be preferred # by make when a .mli exists (see GNU Make manual 10.5.4), the second is a # fallback for mli-less (boo) source files. %.cmi: %.mli $(PRINT_OCAMLC) $@ $(OCAMLC) -c $(BFLAGS) $< %.cmi: %.cmo $(TOUCH) $@ %.cmo: %.ml $(PRINT_OCAMLC) $@ $(OCAMLC) -c $(BFLAGS) $< %.inferred.mli: %.ml $(PRINT_INFERRING) $@ $(OCAMLC) -i $(BFLAGS) $< > $@ # Using the technique of intf-suffix given by Alain Frisch in # http://caml.inria.fr/mantis/view.php?id=4991 # forces ocamlopt to not create a new cmi. %.cmx: %.ml %.cmi $(PRINT_OCAMLOPT) $@ $(OCAMLOPT) -intf-suffix .cmi -c $(OFLAGS) $< # So we can define specific variables that are not inherited # Cf. GNU Make manual, Section 6.12 Pattern-specific Variable Values %.cmx: OFLAGS:=$(OFLAGS) # .o are generated together with .cmx, but %.o %.cmx: %.ml only confuses # make when computing dependencies... %.o: %.cmx $(TOUCH) $@ %.cmxs: %.cmx $(PRINT_PACKING) $@ $(OCAMLOPT) -shared -o $@ $(OFLAGS) $< .mll.ml: $(PRINT_OCAMLLEX) $@ $(RM) $@ $(OCAMLLEX) $< $(CHMOD_RO) $@ %.mli %.ml: %.mly $(PRINT_OCAMLYACC) $@ $(RM) $(<:.mly=.ml) $(<:.mly=.mli) $(OCAMLYACC) -v $< $(CHMOD_RO) $(<:.mly=.ml) $(<:.mly=.mli) .tex.dvi: $(PRINT_LATEX) $@ latex $< && latex $< .dvi.ps: $(PRINT_DVIPS) $@ dvips $< -o $@ .tex.html: $(PRINT_HEVEA) $@ hevea $< .c.o: $(PRINT_OCAMLC) $@ $(OCAMLC) $(BFLAGS) -ccopt "-o $@" $< endif ########################################################################## # Local Variables: # mode: makefile # End: frama-c-20.0-Calcium/share/Makefile.plugin.template0000666000000000000000000011224613571573400017072 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ############################################################################### # # Generic makefile used to build plug-ins. # Setup the following required variables before including this makefile: # # Warning: You should not use these variables inside of your Makefile, # use the namespaced version (@PLUGIN_NAME@_*) at the end of this list. # # Usual information # ----------------- ifndef PLUGIN_NAME # The ML module name of the plugin $(error PLUGIN_NAME is not set) endif ifndef PLUGIN_DIR # The directory containing the source files $(error PLUGIN_DIR is not set) endif PLUGIN_DIR?= PLUGIN_ENABLE?= # Whether the plugin is enabled PLUGIN_DEPENDS?= # Deprecated (static plug-in dependencies, Frama-C only) # META file # --------- # The META for the plug-in is automatically generated, unless variable # PLUGIN_HAS_META is set to "yes". The following optional variables can # be set accordingly: # PLUGIN_HAS_META?= # defaults to empty # When setting PLUGIN_HAS_META to "yes", the next variables are not taken into # account. Instead, your are responsible for providing a full featured META # file in the PLUGIN_DIR source directory, which will be copied and installed # with the plug-in object files. PLUGIN_DESCRIPTION?= # if empty then defaults to "Frama-C NAME plug-in" PLUGIN_VERSION?= # if empty then defaults to current Frama-C version PLUGIN_REQUIRES?= # package(s) the plug-in depends on (defaults to empty) PLUGIN_DEPENDENCIES?= # plugins(s) the plug-in depends on (defaults to empty) # Remarks: # - the package name for "MyPlugin" is defined to be "frama-c-myplugin" # - PLUGIN_DEPENDENCIES is a shortcut for PLUGIN_REQUIRES # - the makefile adds a proper "directory" directive to both provided or # generated META files # Source files # ------------ PLUGIN_CMO?= # The .cmo files (do not add the plugin path and the # extension) PLUGIN_CMI?= # The .cmi files (only if there is no corresponding .cmo) PLUGIN_TYPES_CMO?= # The .cmo files containing the types definitions PLUGIN_GUI_CMI?= # The .cmi files for the GUI # (only if there is no corresponding .cmi) PLUGIN_GUI_CMO?= # The .cmo files to be linked with the graphical interface PLUGIN_GENERATED?= # source files generated by the plugins, typically parsers # Compilation flags # ----------------- PLUGIN_BFLAGS?= # Additional options for the bytecode compiler PLUGIN_OFLAGS?= # Additional options for the native compiler PLUGIN_EXTRA_BYTE?= # Additional bytecode files to link against PLUGIN_EXTRA_OPT?= # Additional native files to link against PLUGIN_EXTRA_DIRS?= # Additional directories (relative to the root of the # plugin) containing some of the source files of the # plugin PLUGIN_LINK_BFLAGS?= # Additional options for the bytecode linker PLUGIN_LINK_OFLAGS?= # Additional options for the native linker PLUGIN_LINK_GUI_BFLAGS?= # Additional options for the bytecode gui linker PLUGIN_LINK_GUI_OFLAGS?= # Additional options for the native gui linker # Dependencies # ------------ PLUGIN_DEPFLAGS?= # Additional options for ocamldep # Documentation # ------------- PLUGIN_DOCFLAGS?= # Additional options for ocamldoc PLUGIN_UNDOC?= # Do not document this source files (do not add the # plugin path) PLUGIN_TYPES_TODOC?= # Do document this source files containing the types # definition PLUGIN_INTRO?= # Add this text file to the introduction of the # documentation PLUGIN_HAS_EXT_DOC?= # (yes/no) Plugin has a pdf manual # Testing # ------- PLUGIN_NO_TEST?= # Set it to a non-empty value if there is no specific # test directory for this plugin PLUGIN_TESTS_DIRS?= # Test directories of the plugin. # Default is tests/$(PLUGIN_DIR) PLUGIN_TESTS_DIRS_DEFAULTS?= # Tests directories that should be run by default # Defaults to $(PLUGIN_TESTS_DIRS) PLUGIN_TESTS_LIB?= # Additional source (.ml) files used by tests. PLUGIN_NO_DEFAULT_TEST?= # Set it to a non-empty value if you don't want the # tests of your plugin to be executed systematically # by make tests PLUGIN_INTERNAL_TEST?= # Set it to a non-empty value if the tests of the plugin # are in Frama-C's tests directory and not a tests # subdirectory of the plugin (internal use only, # obsolete and not recommended way to handle tests) # Distribution # ------------ PLUGIN_DISTRIBUTED?= # should the plugin be included in the distribution # (yes/no) PLUGIN_DISTRIB_EXTERNAL?= # list of files that should be distributed within the # source distribution for this plug-in. They will be # put at their proper place in the frama-c-$(VERSION) # directory for a release. PLUGIN_DISTRIB_TESTS?= # list of files that should be also distributed without # headers checking. PLUGIN_HEADER_SPEC?=$(DEFAULT_HEADER_SPEC) # list of files containing header # specifications. PLUGIN_HEADER_DIRS?=$(DEFAULT_HEADER_DIRS) # list of directories containing # open/close-source header files. PLUGIN_HEADER_EXCEPTIONS?=$(DEFAULT_HEADER_EXCEPTIONS) # list of distributed files allowed # to have no entry into the # PLUGIN_HEADER_SPEC files PLUGIN_CEA_PROPRIETARY_FILES?=$(DEFAULT_CEA_PROPRIETARY_FILES) # list of files that cannot be # part of an OPEN_SOURCE distribution PLUGIN_CEA_PROPRIETARY_HEADERS?= # list of licenses that cannot # be part of an OPEN_SOURCE distribution. # Kernel developers only # ---------------------- PLUGIN_RESET?=yes # Set it to no in order to NOT reset plug-in variable. # Except for their initialization, all these variables should not be used # outside of this Makefile. # # Instead, you can safely use the corresponding following variables. # Warning: # - They contain the extensions and the plugin path unlike the originals # - except @PLUGIN_NAME@_DIR, they are undefined before # Makefile.plugin.generated is created # # @PLUGIN_NAME@_DIR # @PLUGIN_NAME@_CMO # @PLUGIN_NAME@_CMX # @PLUGIN_NAME@_CMI # @PLUGIN_NAME@_TYPES_CMO # @PLUGIN_NAME@_TYPES_CMX # @PLUGIN_NAME@_TYPES_TODOC # @PLUGIN_NAME@_BFLAGS # @PLUGIN_NAME@_OFLAGS # @PLUGIN_NAME@_DEPFLAGS # @PLUGIN_NAME@_DOCFLAGS # @PLUGIN_NAME@_GENERATED # @PLUGIN_NAME@_TESTS_DIRS # @PLUGIN_NAME@_TESTS_LIB # ############################################################################### # # Note for the Makefile.plugin developers: # If you add a new option to communicate with the main Makefile, # don't forget to reset it at the end of this file. # ############################################################################### DEPEND_PKG := $(addprefix frama-c-, $(shell echo $(PLUGIN_DEPENDENCIES) | tr '[:upper:]' '[:lower:]')) # Where the other plug-ins to load are already installed ifeq ($(FRAMAC_INTERNAL),yes) INSTALLED_PLUGIN_DIR:=$(FRAMAC_ROOT_SRCDIR)/lib/plugins # Also inform the main Makefile that there's another plug-in to be # considered PLUGIN_LIST+=$(PLUGIN_DIR)/@PLUGIN_NAME@ PLUGIN_PACKAGES:=$(PLUGIN_REQUIRES) else INSTALLED_PLUGIN_DIR:=$(PLUGIN_INSTALL_DIR) PLUGIN_PACKAGES:=$(PLUGIN_REQUIRES) $(DEPEND_PKG) endif PLUGIN_REQUIRES += $(DEPEND_PKG) # The plugin types .cm* files PLUGIN_TYPES_CMO:=$(addsuffix .cmo,$(PLUGIN_TYPES_CMO)) PLUGIN_TYPES_CMX:=$(PLUGIN_TYPES_CMO:.cmo=.cmx) @PLUGIN_NAME@_TYPES_CMO:=$(PLUGIN_TYPES_CMO) @PLUGIN_NAME@_TYPES_CMX:=$(PLUGIN_TYPES_CMX) @PLUGIN_NAME@_TYPES_TODOC:=$(PLUGIN_TYPES_TODOC) PLUGIN_TYPES_CMO_LIST += $(PLUGIN_TYPES_CMO) PLUGIN_TYPES_CMX_LIST += $(PLUGIN_TYPES_CMX) # [VP] don't exactly know why, but make has a tendency to add a # spurious space at the beginning of PLUGIN_BASE. Fortunately, $(strip ) # is behaving correctly. PLUGIN_BASE:=$(strip $(if $(notdir $(PLUGIN_DIR)),$(notdir $(PLUGIN_DIR)),\ $(notdir $(patsubst %/,%,$(PLUGIN_DIR))))) PLUGIN_DEPENDS:=$(PLUGIN_DEPENDS) $(PLUGIN_DEPENDENCIES) ################ # ml sources # ################ PLUGIN_SRC:= $(PLUGIN_DIR)/@PLUGIN_NAME@.mli \ $(patsubst %,$(PLUGIN_DIR)/%.ml*,$(PLUGIN_CMO)) \ $(patsubst %,$(PLUGIN_DIR)/%.mli,$(PLUGIN_CMI)) \ $(patsubst %.cmo,%.ml*,$(PLUGIN_TYPES_CMO)) ifneq ($(ENABLE_GUI),no) PLUGIN_SRC:= $(PLUGIN_SRC) $(patsubst %,$(PLUGIN_DIR)/%.ml*,$(PLUGIN_GUI_CMO)) endif @PLUGIN_NAME@_SRC:=$(PLUGIN_SRC) PLUGIN_ML_SRC:=$(patsubst %.ml*,%.ml,$(PLUGIN_SRC)) \ $(patsubst %.ml*,%.mli,$(filter %.ml*,$(PLUGIN_SRC))) @PLUGIN_NAME@_ML_SRC:=$(PLUGIN_ML_SRC) ################ # distribution # ################ ifneq ($(PLUGIN_ENABLE),no) # for `check-header` target even if the plugin is not distributed ifneq ("$(strip $(PLUGIN_HEADER_SPEC))","") # Don't remove the '/./' because it is used as separator: # i.e. filenames contained into the spec file 'src/plugins/MY-PLUGIN/./headers/header_spec.txt' # are considered being relative from 'src/plugins/MY-PLUGIN/'. # The wildcard is used in order to add only existing files. PLUGIN_HEADER_SPEC_LIST +=$(strip $(wildcard $(PLUGIN_DIR)/./$(PLUGIN_HEADER_SPEC))) endif ifneq ("$(strip $(PLUGIN_HEADER_DIRS))","") # The wildcard is used in order to add only existing directory. PLUGIN_HEADER_DIRS_LIST +=$(wildcard $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_HEADER_DIRS))) endif ifneq ("$(strip $(PLUGIN_HEADER_EXCEPTIONS))","") PLUGIN_HEADER_EXCEPTIONS_LIST +=$(addprefix $(PLUGIN_DIR)/,$(PLUGIN_HEADER_EXCEPTIONS)) endif ifneq ("$(strip $(PLUGIN_CEA_PROPRIETARY_HEADERS))","") PLUGIN_CEA_PROPRIETARY_HEADERS_LIST +=$(PLUGIN_CEA_PROPRIETARY_HEADERS) endif ifneq ("$(strip $(PLUGIN_CEA_PROPRIETARY_FILES))","") # Files that cannot be part of an OPEN_SOURCE distribution. # The wildcard is used in order to add only existing files. PLUGIN_CEA_PROPRIETARY_FILE_LIST +=$(wildcard $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_CEA_PROPRIETARY_FILES))) endif ifneq ($(PLUGIN_DISTRIBUTED),no) PLUGIN_DISTRIBUTED_LIST += $(PLUGIN_SRC) ifeq ($(ENABLE_GUI),no) # Also include GUI files to be distributed, even if not currently used PLUGIN_DISTRIBUTED_LIST += \ $(patsubst %,$(PLUGIN_DIR)/%.ml*,$(PLUGIN_GUI_CMO)) \ $(patsubst %,$(PLUGIN_DIR)/%.mli,$(PLUGIN_GUI_CMI)) endif # VP: this needs to be adapted for external plugins. ifeq ($(PLUGIN_HAS_EXT_DOC),yes) PLUGIN_EXT_DOC_DIR:=doc/$(PLUGIN_BASE) PLUGIN_DIST_DOC_LIST += doc/plugins/$(PLUGIN_BASE).pdf $(PLUGIN_EXT_DOC_DIR)/$(PLUGIN_BASE).pdf: $(PRINT_MAKING) $@ $(MAKE) -C $(dir $@) doc/plugins/$(PLUGIN_BASE).pdf: \ $(PLUGIN_EXT_DOC_DIR)/$(PLUGIN_BASE).pdf $(PRINT_CP) $< $(MKDIR) doc/plugins $(CP) $< $@ endif ifneq ("$(strip $(PLUGIN_DISTRIB_EXTERNAL))","") PLUGIN_DIST_EXTERNAL_LIST += \ $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_DISTRIB_EXTERNAL)) endif ifneq ("$(strip $(PLUGIN_DISTRIB_TESTS))","") PLUGIN_DIST_TESTS_LIST += \ $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_DISTRIB_TESTS)) endif endif #PLUGIN_DISTRIBUTED endif #PLUGIN_ENABLE PLUGIN_OPT:=`echo "@PLUGIN_NAME@" | tr 'A-Z' 'a-z' ` # Export some variables which can be safely used outside/inside Makefile.plugin # even if the plug-in is not enabled ifneq ("$(PLUGIN_ENABLE)","no") # The .cm* files list PLUGIN_CMO:= $(patsubst %,$(PLUGIN_DIR)/%.cmo,$(PLUGIN_CMO)) PLUGIN_CMX:= $(PLUGIN_CMO:.cmo=.cmx) PLUGIN_CMI_ONLY:=$(patsubst %,$(PLUGIN_DIR)/%.cmi,$(PLUGIN_CMI)) PLUGIN_CMI:= $(PLUGIN_CMI_ONLY) $(PLUGIN_CMO:.cmo=.cmi) PLUGIN_INFERRED_MLI:= $(PLUGIN_CMO:.cmo=.inferred.mli) @PLUGIN_NAME@_CMO:=$(PLUGIN_CMO) @PLUGIN_NAME@_CMX:=$(PLUGIN_CMX) @PLUGIN_NAME@_CMI_ONLY:=$(PLUGIN_CMI_ONLY) @PLUGIN_NAME@_CMI:=$(PLUGIN_CMI) @PLUGIN_NAME@_INFERRED_MLI:=$(PLUGIN_INFERRED_MLI) HAS_GUI:=no ifneq ($(ENABLE_GUI),no) ifneq ("$(PLUGIN_GUI_CMO)","") # The .cm* gui files list PLUGIN_GUI_CMO:= $(PLUGIN_CMO) \ $(patsubst %,$(PLUGIN_DIR)/%.cmo,$(PLUGIN_GUI_CMO)) PLUGIN_GUI_CMX:= $(PLUGIN_GUI_CMO:.cmo=.cmx) PLUGIN_GUI_CMI_ONLY:=$(PLUGIN_CMI_ONLY) $(PLUGIN_GUI_CMI) PLUGIN_GUI_CMI:= $(PLUGIN_CMI_ONLY) $(PLUGIN_GUI_CMO:.cmo=.cmi) HAS_GUI:=yes endif endif @PLUGIN_NAME@_GUI_CMO:=$(PLUGIN_GUI_CMO) @PLUGIN_NAME@_GUI_CMX:=$(PLUGIN_GUI_CMX) @PLUGIN_NAME@_GUI_CMI:=$(PLUGIN_GUI_CMI) # Interface for the the packed plugins TARGET_MLI:= $(PLUGIN_LIB_DIR)/@PLUGIN_NAME@.mli TARGET_CMI:= $(TARGET_MLI:.mli=.cmi) # The packed files for toplevel mode (in directory 'top') TARGET_TOP_MLI:= $(PLUGIN_LIB_DIR)/top/@PLUGIN_NAME@.mli TARGET_TOP_CMI:= $(TARGET_TOP_MLI:.mli=.cmi) TARGET_TOP_CMO:= $(TARGET_TOP_MLI:.mli=.cmo) ifdef PLUGIN_EXTRA_BYTE TARGET_TOP_CMA:= $(TARGET_TOP_CMO:.cmo=.cma) else TARGET_TOP_CMA:= endif TARGET_TOP_CMX:= $(TARGET_TOP_CMO:.cmo=.cmx) TARGET_TOP_CMXS:= $(TARGET_TOP_CMX:.cmx=.cmxs) # The packed files for GUI mode (in directory 'gui') ifeq ($(HAS_GUI),yes) TARGET_GUI_MLI:=$(PLUGIN_LIB_DIR)/gui/@PLUGIN_NAME@.mli TARGET_GUI_CMO:= $(PLUGIN_LIB_DIR)/gui/@PLUGIN_NAME@.cmo TARGET_GUI_CMI:= $(TARGET_GUI_CMO:.cmo=.cmi) TARGET_GUI_CMX:= $(TARGET_GUI_CMO:.cmo=.cmx) TARGET_GUI_CMA:= $(TARGET_GUI_CMO:.cmo=.cma) TARGET_GUI_CMXS:= $(TARGET_GUI_CMO:.cmo=.cmxs) else TARGET_GUI_MLI:= TARGET_GUI_CMO:= TARGET_GUI_CMI:= TARGET_GUI_CMX:= TARGET_GUI_CMA:= endif # Meta-variables for the targets: @PLUGIN_NAME@_TARGET_MLI:=$(TARGET_MLI) @PLUGIN_NAME@_TARGET_CMI:=$(TARGET_CMI) @PLUGIN_NAME@_TARGET_TOP_MLI:=$(TARGET_TOP_MLI) @PLUGIN_NAME@_TARGET_TOP_CMI:=$(TARGET_TOP_CMI) @PLUGIN_NAME@_TARGET_TOP_CMO:=$(TARGET_TOP_CMO) @PLUGIN_NAME@_TARGET_TOP_CMA:=$(TARGET_TOP_CMA) @PLUGIN_NAME@_TARGET_TOP_CMX:=$(TARGET_TOP_CMX) @PLUGIN_NAME@_TARGET_TOP_CMXS:=$(TARGET_TOP_CMXS) @PLUGIN_NAME@_TARGET_GUI_MLI:=$(TARGET_GUI_MLI) @PLUGIN_NAME@_TARGET_GUI_CMI:=$(TARGET_GUI_CMI) @PLUGIN_NAME@_TARGET_GUI_CMO:=$(TARGET_GUI_CMO) @PLUGIN_NAME@_TARGET_GUI_CMA:=$(TARGET_GUI_CMA) @PLUGIN_NAME@_TARGET_GUI_CMX:=$(TARGET_GUI_CMX) @PLUGIN_NAME@_TARGET_GUI_CMXS:=$(TARGET_GUI_CMXS) # Some meta-variables for compilation flags NAME_BFLAGS :=@PLUGIN_NAME@_BFLAGS NAME_OFLAGS :=@PLUGIN_NAME@_OFLAGS NAME_TEST_BFLAGS :=@PLUGIN_NAME@_TEST_BFLAGS NAME_TEST_OFLAGS :=@PLUGIN_NAME@_TEST_OFLAGS TARGET_OFLAGS :=@PLUGIN_NAME@_TARGET_OFLAGS TARGET_BFLAGS :=@PLUGIN_NAME@_TARGET_BFLAGS ifeq ($(HAS_GUI),yes) NAME_GUI_BFLAGS :=@PLUGIN_NAME@_GUI_BFLAGS NAME_GUI_OFLAGS :=@PLUGIN_NAME@_GUI_OFLAGS TARGET_GUI_OFLAGS:=@PLUGIN_NAME@_GUI_TARGET_OFLAGS TARGET_GUI_BFLAGS:=@PLUGIN_NAME@_GUI_TARGET_BFLAGS endif NAME_DEPFLAGS :=@PLUGIN_NAME@_DEPFLAGS NAME_DOCFLAGS :=@PLUGIN_NAME@_DOCFLAGS # Export some variables which can be safely used outside/inside Makefile.plugin @PLUGIN_NAME@_CMO:=$(PLUGIN_CMO) @PLUGIN_NAME@_CMX:=$(PLUGIN_CMX) @PLUGIN_NAME@_CMI:=$(PLUGIN_CMI) @PLUGIN_NAME@_GENERATED:=$(PLUGIN_GENERATED) @PLUGIN_NAME@_TARGET_BFLAGS:=$(PLUGIN_LINK_BFLAGS) @PLUGIN_NAME@_TARGET_OFLAGS:=$(PLUGIN_LINK_OFLAGS) @PLUGIN_NAME@_EXTRA_BYTE:=$(PLUGIN_EXTRA_BYTE) @PLUGIN_NAME@_EXTRA_OPT:=$(PLUGIN_EXTRA_OPT) @PLUGIN_NAME@_EXTRA_DIRS:=$(PLUGIN_EXTRA_DIRS) ifeq ($(HAS_GUI),yes) # gui variable @PLUGIN_NAME@_GUI_CMO:=$(PLUGIN_GUI_CMO) @PLUGIN_NAME@_GUI_CMX:=$(PLUGIN_GUI_CMX) @PLUGIN_NAME@_GUI_CMI:=$(PLUGIN_GUI_CMI) @PLUGIN_NAME@_GUI_CMI_ONLY:=$(PLUGIN_GUI_CMI_ONLY) @PLUGIN_NAME@_GUI_TARGET_BFLAGS:=$(PLUGIN_LINK_GUI_BFLAGS) @PLUGIN_NAME@_GUI_TARGET_OFLAGS:=$(PLUGIN_LINK_GUI_OFLAGS) endif PLUGIN_EXTRA_DIRS_INC:=$(patsubst %,-I $(PLUGIN_DIR)/% ,$(PLUGIN_EXTRA_DIRS)) # Set the compilation flags for the plugin INCLUDE_EXT_FLAGS:=-I $(INSTALLED_PLUGIN_DIR) \ $(addprefix -package ,$(PLUGIN_PACKAGES) $(LIBRARY_NAMES)) INCLUDE_FLAGS:=-I $(PLUGIN_DIR) $(PLUGIN_EXTRA_DIRS_INC) $(INCLUDE_EXT_FLAGS) $(NAME_BFLAGS):=$(BFLAGS) $(INCLUDE_FLAGS) $(PLUGIN_BFLAGS) $(NAME_OFLAGS):=$(OFLAGS) $(INCLUDE_FLAGS) $(PLUGIN_OFLAGS) # DO NOT include the plugin's own directory as search path for compiling # ml test scripts: they will be loaded in a separate phase, and will only see # the plugin through its static API $(NAME_TEST_BFLAGS):= $(BFLAGS) $(INCLUDE_EXT_FLAGS) $(PLUGIN_BFLAGS) $(NAME_TEST_OFLAGS):= $(OFLAGS) $(INCLUDE_EXT_FLAGS) $(PLUGIN_OFLAGS) $(TARGET_BFLAGS):= $(PLUGIN_LINK_BFLAGS) $(TARGET_OFLAGS):= $(PLUGIN_LINK_OFLAGS) $(NAME_DOCFLAGS):= $(DOC_FLAGS) $(PLUGIN_DOCFLAGS) \ -I $(PLUGIN_DIR) \ $(PLUGIN_EXTRA_DIRS_INC) \ -I $(PLUGIN_LIB_DIR) \ $(addprefix -package ,$(PLUGIN_REQUIRES) $(LIBRARY_NAMES)) ifeq ($(HAS_GUI),yes) $(NAME_GUI_BFLAGS):=$($(NAME_BFLAGS)) $(THREAD) $(addprefix -package ,$(LIBRARY_NAMES_GUI)) $(NAME_GUI_OFLAGS):=$($(NAME_OFLAGS)) $(THREAD) $(addprefix -package ,$(LIBRARY_NAMES_GUI)) $(TARGET_GUI_BFLAGS):= $(PLUGIN_LINK_GUI_BFLAGS) $(TARGET_GUI_OFLAGS):= $(PLUGIN_LINK_GUI_OFLAGS) $(NAME_DOCFLAGS) := $($(NAME_DOCFLAGS)) $(addprefix -package ,$(LIBRARY_NAMES_GUI)) endif $(NAME_DEPFLAGS):= -I $(PLUGIN_DIR) $(PLUGIN_DEPFLAGS) $(PLUGIN_EXTRA_DIRS_INC) # Add the flags to the compilation line of the plugin source files $(PLUGIN_CMO) $(PLUGIN_CMI) $(PLUGIN_INFERRED_MLI): BFLAGS:=$($(NAME_BFLAGS)) $(PLUGIN_CMX): OFLAGS:=$($(NAME_OFLAGS)) -for-pack @PLUGIN_NAME@ ifeq ($(HAS_GUI),yes) $(PLUGIN_GUI_CMO) $(PLUGIN_GUI_CMI): BFLAGS:=$($(NAME_GUI_BFLAGS)) $(PLUGIN_GUI_CMX): OFLAGS:=$($(NAME_GUI_OFLAGS)) -for-pack @PLUGIN_NAME@ endif # META file PLUGIN_PKG :=$(shell echo frama-c-@PLUGIN_NAME@ | tr '[:upper:]' '[:lower:]') TARGET_META :=$(PLUGIN_LIB_DIR)/META.$(PLUGIN_PKG) PLUGIN_GENERATED+= $(TARGET_META) ifneq ($(PLUGIN_HAS_META),yes) # generated META ifeq ($(PLUGIN_DESCRIPTION),) PLUGIN_DESCRIPTION :="Frama-C @PLUGIN_NAME@ plug-in" endif ifeq ($(PLUGIN_VERSION),) ifeq ($(FRAMAC_INTERNAL),yes) ifeq ($(FRAMAC_ROOT_SRCDIR),) PLUGIN_VERSION :=$(shell cat VERSION) else # To remove "cat: VERSION: No such file or directory" in EXECNOW target performing make commands under a plugin directory PLUGIN_VERSION :=$(shell cat $(FRAMAC_ROOT_SRCDIR)/VERSION) endif else PLUGIN_VERSION :=$(shell frama-c-config -print-version) endif endif # registering package description for later use META.$(PLUGIN_PKG).DESCRIPTION :=$(PLUGIN_DESCRIPTION) META.$(PLUGIN_PKG).VERSION :=$(PLUGIN_VERSION) META.$(PLUGIN_PKG).REQUIRES :=$(PLUGIN_REQUIRES) ifdef PLUGIN_EXTRA_BYTE META.$(PLUGIN_PKG).BYTE :=@PLUGIN_NAME@.cma else META.$(PLUGIN_PKG).BYTE :=@PLUGIN_NAME@.cmo endif META.$(PLUGIN_PKG).NATIVE :=@PLUGIN_NAME@.cmx META.$(PLUGIN_PKG).PLUGIN :=@PLUGIN_NAME@.cmxs ifeq ($(FRAMAC_INTERNAL),yes) # In internal mode, we depend on the main Makefile for plugins that do not # have their own Makefile. To detect that, we check whether there is a # plugin-specific Makefile in the include stack. ifeq ($(filter $(PLUGIN_DIR)/Makefile,$(MAKEFILE_LIST)),) $(TARGET_META): Makefile else $(TARGET_META): $(PLUGIN_DIR)/Makefile endif # PLUGIN_DIR/Makefile else $(TARGET_META): $(PLUGIN_DIR)/Makefile endif # FRAMAC_INTERNAL $(TARGET_META): $(PRINT_MAKING) $(notdir $@) $(RM) $@ $(MKDIR) $(dir $@) $(ECHO) "description = \"$($(notdir $@).DESCRIPTION)\"" >> $@ $(ECHO) "version = \"$($(notdir $@).VERSION)\"" >> $@ $(ECHO) "requires = \"frama-c.kernel $($(notdir $@).REQUIRES)\"" >> $@ $(ECHO) "archive(byte) = \"top/$($(notdir $@).BYTE)\"" >> $@ $(ECHO) "archive(native) = \"top/$($(notdir $@).NATIVE)\"" >> $@ $(ECHO) "plugin(native) = \"top/$($(notdir $@).PLUGIN)\"" >> $@ $(ECHO) "plugin(byte) = \"top/$($(notdir $@).BYTE)\"" >> $@ ifeq ($(HAS_GUI),yes) $(ECHO) "archive(byte,gui) = \"gui/$($(notdir $@).BYTE)\"" >> $@ $(ECHO) "archive(native,gui) = \"gui/$($(notdir $@).NATIVE)\"" >> $@ $(ECHO) "plugin(native,gui) = \"gui/$($(notdir $@).PLUGIN)\"" >> $@ $(ECHO) "plugin(byte,gui) = \"gui/$($(notdir $@).BYTE)\"" >> $@ endif $(ECHO) "directory = \"\"" >> $@ else # PLUGIN_HAS_META # user-defined META $(TARGET_META): $(PLUGIN_DIR)/META $(PRINT_CP) $(notdir $@) $(CP) $< $@ $(ECHO) "directory = \"\"" >> $@ endif # PLUGIN_HAS_META # Now build the targets ####################### @PLUGIN_NAME@_PLUGIN_MLI:= $(PLUGIN_DIR)/@PLUGIN_NAME@.mli @PLUGIN_NAME@_CHECK_PLUGIN_MLI:=$(PLUGIN_DIR)/@PLUGIN_NAME@.check_mli_exists $(TARGET_CMI): BFLAGS:=$($(NAME_BFLAGS)) -opaque $(TARGET_CMI): $(PLUGIN_CMO) ifneq ($(TARGET_MLI),$(@PLUGIN_NAME@_PLUGIN_MLI)) # Copy the plugin interface in the plugins directory $(TARGET_MLI): $(@PLUGIN_NAME@_CHECK_PLUGIN_MLI) $(PRINT_MAKING) $@ $(MKDIR) $(PLUGIN_LIB_DIR) $(RM) $@ $(ECHO) "(* This module was generated automatically by code in Makefile and $(@PLUGIN_NAME@_PLUGIN_MLI) *)" > $@ $(ECHO) "#1 \"$(@PLUGIN_NAME@_PLUGIN_MLI)\"" >> $@ $(CAT) $(@PLUGIN_NAME@_PLUGIN_MLI) >> $@ $(CHMOD_RO) $@ $(INSTALLED_PLUGIN_DIR)/.placeholders_ready: $(TARGET_MLI) PLUGIN_GENERATED+= $(TARGET_MLI) endif $(TARGET_TOP_MLI): $(@PLUGIN_NAME@_CHECK_PLUGIN_MLI) $(TARGET_MLI) $(PRINT_MAKING) $@ $(MKDIR) $(PLUGIN_LIB_DIR)/top $(RM) $@ $(CP) $(@PLUGIN_NAME@_TARGET_MLI) $@ PLUGIN_GENERATED+= $(TARGET_TOP_MLI) @PLUGIN_NAME@_MLI:=$(TARGET_MLI) $(TARGET_TOP_CMI): $(TARGET_CMI) $(PRINT_MAKING) $@ $(MKDIR) $(PLUGIN_LIB_DIR)/top $(RM) $@ $(CP) $< $@ $(TARGET_TOP_CMO): $(PLUGIN_CMO) \ $(TARGET_CMI) $(TARGET_TOP_CMI) $(PRINT_PACKING) $@ $(OCAMLC) -o $(call winpath,$@) $(@PLUGIN_NAME@_BFLAGS) -pack \ $(@PLUGIN_NAME@_TARGET_BFLAGS) \ $(@PLUGIN_NAME@_CMI_ONLY) $(@PLUGIN_NAME@_CMO) $(TARGET_TOP_CMX): $(PLUGIN_CMX) \ $(TARGET_CMI) $(TARGET_TOP_CMI) $(PRINT_PACKING) $@ $(OCAMLOPT) -o $(call winpath,$@) $(@PLUGIN_NAME@_OFLAGS) -pack \ $(@PLUGIN_NAME@_TARGET_OFLAGS) \ $(@PLUGIN_NAME@_CMI_ONLY) $(@PLUGIN_NAME@_CMX) $(TARGET_TOP_CMXS): $(TARGET_TOP_CMX) $(PLUGIN_EXTRA_OPT) $(PRINT_PACKING) $@ $(OCAMLOPT) -o $(call winpath,$@) -shared \ $(@PLUGIN_NAME@_OFLAGS) \ $(@PLUGIN_NAME@_EXTRA_OPT) \ $(@:.cmxs=.cmx) ifdef PLUGIN_EXTRA_BYTE $(TARGET_TOP_CMA): $(PLUGIN_EXTRA_BYTE) $(TARGET_TOP_CMO) $(PRINT_PACKING) $@ $(OCAMLC) -o $(call winpath,$@) $(@PLUGIN_NAME@_BFLAGS) \ $(@PLUGIN_NAME@_TARGET_BFLAGS) \ -a $(@PLUGIN_NAME@_EXTRA_BYTE) $(@:.cma=.cmo) endif ifeq ($(HAS_GUI),yes) # packing gui files ################### $(TARGET_GUI_CMI): $(TARGET_CMI) $(PRINT_MAKING) $@ $(MKDIR) $(PLUGIN_LIB_DIR)/gui $(RM) $@ $(CP) $< $@ PLUGIN_GENERATED+= $(TARGET_GUI_MLI) $(TARGET_GUI_MLI): $(@PLUGIN_NAME@_CHECK_PLUGIN_MLI) $(TARGET_MLI) $(PRINT_MAKING) $@ $(MKDIR) $(PLUGIN_LIB_DIR)/gui $(RM) $@ $(CP) $(@PLUGIN_NAME@_TARGET_MLI) $@ $(TARGET_GUI_CMO): $(PLUGIN_GUI_CMO) $(TARGET_CMI) $(TARGET_GUI_CMI) $(PRINT_PACKING) $@ $(MKDIR) $(PLUGIN_LIB_DIR)/gui $(OCAMLC) -o $(call winpath,$@) $(@PLUGIN_NAME@_GUI_BFLAGS) -pack \ $(@PLUGIN_NAME@_GUI_TARGET_BFLAGS) \ $(@PLUGIN_NAME@_GUI_CMI_ONLY) \ $(@PLUGIN_NAME@_GUI_CMO) $(TARGET_GUI_CMX): $(PLUGIN_GUI_CMX) $(TARGET_CMI) $(TARGET_GUI_CMI) $(PRINT_PACKING) $@ $(MKDIR) $(PLUGIN_LIB_DIR)/gui $(OCAMLOPT) -o $(call winpath,$@) $(@PLUGIN_NAME@_GUI_OFLAGS) -pack \ $(@PLUGIN_NAME@_GUI_TARGET_OFLAGS) \ $(@PLUGIN_NAME@_GUI_CMI_ONLY) \ $(@PLUGIN_NAME@_GUI_CMX) $(TARGET_GUI_CMXS): $(TARGET_GUI_CMX) $(PRINT_PACKING) $@ $(MKDIR) $(PLUGIN_LIB_DIR)/gui $(OCAMLOPT) -o $(call winpath,$@) -shared \ $(@PLUGIN_NAME@_GUI_OFLAGS) \ $(@PLUGIN_NAME@_GUI_TARGET_OFLAGS) \ $(@PLUGIN_NAME@_EXTRA_OPT) \ $^ ifdef PLUGIN_EXTRA_BYTE $(TARGET_GUI_CMA): $(PLUGIN_EXTRA_BYTE) $(TARGET_GUI_CMO) $(PRINT_PACKING) $@ $(OCAMLC) -o $(call winpath,$@) $(@PLUGIN_NAME@_GUI_BFLAGS) \ $(@PLUGIN_NAME@_GUI_TARGET_BFLAGS) \ -a $(@PLUGIN_NAME@_EXTRA_BYTE) $(@:.cma=.cmo) endif else # No specific gui items TARGET_GUI_MLI:= TARGET_GUI_CMI:= endif # HAS_GUI ######### # The following rules used some plugin info (name and path) in their names # in order to used them in the command: # it is not possible to use $(PLUGIN_*) in commands due to the evaluation rules # of make ########################## # Internal documentation # ########################## MODULES_TODOC+= $(PLUGIN_TYPES_TODOC) PLUGIN_UNDOC := $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_UNDOC)) PLUGIN_DOC_SRC:=$(filter-out $(PLUGIN_UNDOC),$(PLUGIN_ML_SRC)) @PLUGIN_NAME@_DOC_SRC:=$(PLUGIN_DOC_SRC) ifndef PLUGIN_DOC_DIR PLUGIN_DOC_DIR := $(DOC_DIR)/$(PLUGIN_BASE) endif @PLUGIN_NAME@_DOC_DIR:= $(PLUGIN_DOC_DIR) @PLUGIN_NAME@_INTRO:=$(PLUGIN_INTRO) ifdef PLUGIN_INTRO @PLUGIN_NAME@_CAT_INTRO:= cp -f $(PLUGIN_INTRO) $(PLUGIN_DOC_DIR)/@PLUGIN_NAME@.txt ifeq ($(PLUGIN_DISTRIBUTED),yes) PLUGIN_DIST_EXTERNAL_LIST+= $(PLUGIN_INTRO) endif else @PLUGIN_NAME@_CAT_INTRO:= echo "" > $(PLUGIN_DOC_DIR)/@PLUGIN_NAME@.txt endif ifeq ($(FRAMAC_INTERNAL),yes) DOC_INTRO:= $(DOC_DIR)/intro_kernel_plugin.txt \ $(DOC_DIR)/intro_plugin.txt \ $(DOC_DIR)/intro_plugin_D_and_S.txt \ $(DOC_DIR)/intro_plugin_default.txt else DOC_INTRO:= endif $(@PLUGIN_NAME@_DOC_DIR)/@PLUGIN_NAME@.txt: $(DOC_INTRO) $(@PLUGIN_NAME@_INTRO) $(PRINT_MAKING) "$@" $(MKDIR) $(dir $@) $(@PLUGIN_NAME@_CAT_INTRO) if [ -f "$(DOC_DIR)/html/Db.@PLUGIN_NAME@.html" ] ; then \ if [ -f "$(DOC_DIR)/dynamic_plugins/Dynamic_plugins.@PLUGIN_NAME@.html" ] ; then \ cat $(DOC_DIR)/intro_plugin_D_and_S.txt >> $@ ; \ else \ cat $(DOC_DIR)/intro_kernel_plugin.txt >> $@ ; \ fi ; \ elif [ -f "$(DOC_DIR)/dynamic_plugins/Dynamic_plugins.@PLUGIN_NAME@.html" ] ; then \ cat $(DOC_DIR)/intro_plugin.txt >> $@ ; \ else \ cat $(DOC_DIR)/intro_plugin_default.txt >> $@ ; \ fi $(ISED) -e "s/_PluginName_/@PLUGIN_NAME@/g" \ -e "/^#\*/d" $@ ifeq ($(FRAMAC_INTERNAL),yes) OCAMLDOC_GEN:=$(DOC_PLUGIN) OCAMLDOC_GEN+=$(DOC_DIR)/kernel-doc.ocamldoc else OCAMLDOC_GEN:= # not doing kernel documentation if just compiling plugin's one $(DOC_DIR)/docgen.cmo: $(DOC_DIR)/docgen.ml $(PRINT_OCAMLC) $@ $(OCAMLC) -c -I +ocamldoc $(call winpath,$(DOC_DIR))/docgen.ml $(DOC_DIR)/docgen.cmxs: $(DOC_DIR)/docgen.ml $(PRINT_PACKING) $@ $(OCAMLOPT) -o $(call winpath,$@) -shared -I +ocamldoc \ $(call winpath,$(DOC_DIR))/docgen.ml endif OCAMLDOC_DEPEND:= $(PLUGIN_CMO) ifneq ($(ENABLE_GUI),no) OCAMLDOC_DEPEND:= $(OCAMLDOC_DEPEND) $(PLUGIN_GUI_CMO) endif .PHONY: @PLUGIN_NAME@_DOC @PLUGIN_NAME@_DOC: $(OCAMLDOC_DEPEND) \ $(OCAMLDOC_GEN) \ $(@PLUGIN_NAME@_DOC_DIR)/@PLUGIN_NAME@.txt \ $(@PLUGIN_NAME@_DOC_DIR)/modules.svg \ $(DOC_PLUGIN) $(PRINT_DOC) @PLUGIN_NAME@ $(MKDIR) $(@PLUGIN_NAME@_DOC_DIR) $(RM) $(@PLUGIN_NAME@_DOC_DIR)/*.html # Only generate toc for kernel's documentation if we are in Frama-C's main # Makefile ifeq ($(FRAMAC_INTERNAL),yes) $(ECHO) '
  • $(subst _, ,@PLUGIN_NAME@)
  • ' > $(DOC_DIR)/@PLUGIN_NAME@.toc endif $(OCAMLDOC) $(@PLUGIN_NAME@_DOCFLAGS) \ -t "@PLUGIN_NAME@ plugin" \ -css-style ../style.css \ -d $(@PLUGIN_NAME@_DOC_DIR) -g $(DOC_PLUGIN) -passopt -docpath $(DOC_DIR)/html \ $(addprefix -load ,$(wildcard $(DOC_DIR)/kernel-doc.ocamldoc)) \ $(wildcard $(@PLUGIN_NAME@_DOC_SRC)) # [rb+js] 20090619 # pwd is required to avoid "bad directory" message on OpenBSD # don't know why cd `pwd`/$(@PLUGIN_NAME@_DOC_DIR); \ for f in $(foreach f,$(@PLUGIN_NAME@_TYPES_TODOC),\ $(basename $(notdir $f))); do \ for g in \ $(wildcard ../html/$(shell $(ECHO) $(f) | $(SED) 's/^./\u&/')); \ do \ ln -sf $$g; \ done; \ done; \ for f in *.html; do \ $(ISED) -e 's|\(doc/code/html\)|../../../\1|g' $$f ; \ done # removed dependencies: # $(PLUGIN_DOC_DIR)/modules.ps \ # $(PLUGIN_DOC_DIR)/modules-all.ps \ # $(PLUGIN_DOC_DIR)/types.ps $(PLUGIN_DOC_DIR)/modules.dot: DOC_FLAGS:=$($(NAME_DOCFLAGS)) $(PLUGIN_DOC_DIR)/modules.dot: $(wildcard $(PLUGIN_DOC_SRC)) $(PRINT_DOC) $@ $(MKDIR) $(dir $@) $(OCAMLDOC) $(DOC_FLAGS) -o $@ -dot $^ \ || { $(RM) $@; exit 2; } # in case of error, ocamldoc still generates # something $(ISED) -e "s/rotate=90;//" \ -e 's/digraph G/digraph "Plugin architecture ($(subst /,,$(subst doc/code,,$(dir $@))))"/' \ $@ $(PLUGIN_DOC_DIR)/modules-all.dot: DOC_FLAGS:=$($(NAME_DOCFLAGS)) $(PLUGIN_DOC_DIR)/modules-all.dot: $(wildcard $(PLUGIN_DOC_SRC)) $(PRINT_DOC) $@ $(MKDIR) $(dir $@) $(OCAMLDOC) $(DOC_FLAGS) $($(dir $@)FLAGS) -o $@ -dot \ -dot-include-all $^ $(ISED) -e "s/rotate=90;//" $@ $(PLUGIN_DOC_DIR)/types.dot: DOC_FLAGS:=$($(NAME_DOCFLAGS)) $(PLUGIN_DOC_DIR)/types.dot: $(wildcard $(PLUGIN_DOC_SRC)) $(PRINT_DOC) $@ $(MKDIR) $(dir $@) $(OCAMLDOC) $(DOC_FLAGS) $($(dir $@)FLAGS) -o $@ -dot -dot-types $^ $(ISED) -e "s/rotate=90;//" $@ .PHONY: @PLUGIN_NAME@_metrics @PLUGIN_NAME@_metrics : $(PLUGIN_DOC_DIR)/metrics.html $(PLUGIN_DOC_DIR)/metrics.html : $(wildcard $(PLUGIN_DOC_SRC)) $(PRINT_DOC) $@ ocamlmetrics $^ > $@ ############ # Tests # ############ ifneq ("$(PLUGIN_ENABLE)","no") ifndef PLUGIN_NO_TEST ifndef PLUGIN_TESTS_DIRS PLUGIN_TESTS_DIRS:=$(PLUGIN_BASE) endif endif ifndef PLUGIN_TESTS_DIRS_DEFAULT PLUGIN_TESTS_DIRS_DEFAULT:=$(PLUGIN_TESTS_DIRS) endif ifndef PLUGIN_NO_DEFAULT_TEST ifdef PLUGIN_INTERNAL_TEST PLUGIN_TESTS_LIST += $(PLUGIN_TESTS_DIRS_DEFAULT) endif endif @PLUGIN_NAME@_TESTS_DIRS:=$(PLUGIN_TESTS_DIRS) @PLUGIN_NAME@_TESTS_LIB_DIR:=$(sort $(dir $(PLUGIN_TESTS_LIB))) @PLUGIN_NAME@_TESTS_LIB_DIR_INCLUDE:=$(foreach d,$(@PLUGIN_NAME@_TESTS_LIB_DIR),-I $d ) @PLUGIN_NAME@_EXTRA_DIRS:=$(@PLUGIN_NAME@_EXTRA_DIRS) $(@PLUGIN_NAME@_TESTS_LIB_DIR) @PLUGIN_NAME@_TESTS_LIB_OPT:=$(PLUGIN_TESTS_LIB:%.ml=%.cmx) @PLUGIN_NAME@_TESTS_LIB_OPT_DYN:=$(PLUGIN_TESTS_LIB:%.ml=%.cmxs) @PLUGIN_NAME@_TESTS_LIB_BYTE:=$(PLUGIN_TESTS_LIB:%.ml=%.cmo) $(@PLUGIN_NAME@_TESTS_LIB_OPT): OFLAGS:=$($(NAME_TEST_OFLAGS)) $(@PLUGIN_NAME@_TESTS_LIB_DIR_INCLUDE) $(@PLUGIN_NAME@_TESTS_LIB_OPT_DYN): OFLAGS:=$($(NAME_TEST_OFLAGS)) $(@PLUGIN_NAME@_TESTS_LIB_DIR_INCLUDE) $(@PLUGIN_NAME@_TESTS_LIB_BYTE): BFLAGS:=$($(NAME_TEST_BFLAGS)) $(@PLUGIN_NAME@_TESTS_LIB_DIR_INCLUDE) # [JS 2009/03/18] both .PRECIOUS are required in order to prevent 'make' # deletion of intermediate generated files. Such a deletion forces 'make' to # unnecessarily recompile those files. .PRECIOUS: $(@PLUGIN_NAME@_TESTS_LIB_OPT) \ $(@PLUGIN_NAME@_TESTS_LIB_OPT_DYN) \ $(@PLUGIN_NAME@_TESTS_LIB_BYTE) \ $(@PLUGIN_NAME@_TESTS_LIB_BYTE:%.cmo=%.cmi) endif # PLUGIN_ENABLE ########## # Depend # ########## # for reasons known to themselves, ocamldep and make are confused by ./file.ml # hence (one of) the patsubst below in case PLUGIN_DIR is . # If you explicitly do "make depend" it is # $(PLUGIN_DIR)/@PLUGIN_NAME@_DEP_REDO. it forces the computation of # dependencies. Otherwise usual dependency for $(PLUGIN_DIR)/.depend. .PHONY: $(@PLUGIN_NAME@_DIR)/@PLUGIN_NAME@_DEP_REDO $(@PLUGIN_NAME@_DIR)/@PLUGIN_NAME@_DEP_REDO $(@PLUGIN_NAME@_DIR)/.depend: \ $(PLUGIN_GENERATED) $(PRINT_DEP) $(@PLUGIN_NAME@_DIR)/.depend $(RM) $(@PLUGIN_NAME@_DIR)/.depend $(OCAMLDEP) $(INCLUDES) \ $(@PLUGIN_NAME@_DEPFLAGS) \ $(patsubst ./%,%,\ $(@PLUGIN_NAME@_ML_SRC) \ $(@PLUGIN_NAME@_MLI) \ $(@PLUGIN_NAME@_GUI_MLI)) \ $(foreach d,$(@PLUGIN_NAME@_TESTS_LIB_DIR),\ -I $d $d*.ml $d*.mli) \ > $(@PLUGIN_NAME@_DIR)/.depend $(CHMOD_RO) $(@PLUGIN_NAME@_DIR)/.depend depend:: $(@PLUGIN_NAME@_DIR)/@PLUGIN_NAME@_DEP_REDO #Just for backward compatibility (19/10/2015) $(@PLUGIN_NAME@_DIR)/@PLUGIN_NAME@_DEP: $(@PLUGIN_NAME@_DIR)/.depend $(TOUCH) $@ #In internal mode wait for lib/plugins to be populated by .mli. ifeq ($(FRAMAC_INTERNAL),yes) $(@PLUGIN_NAME@_DIR)/@PLUGIN_NAME@_DEP_REDO $(@PLUGIN_NAME@_DIR)/.depend: $(INSTALLED_PLUGIN_DIR)/.placeholders_ready endif # MAKECMDGOALS contains the targets passed to make. We set it to non-empty # (if needed) to silence warnings about undefined variables. MAKECMDGOALS ?= ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) ifneq ($(MAKECMDGOALS),smartclean) sinclude $(PLUGIN_DIR)/.depend endif endif endif ############ # Cleaning # ############ .PHONY: $(PLUGIN_DIR)/@PLUGIN_NAME@_CLEAN $(PLUGIN_DIR)/@PLUGIN_NAME@_CLEAN: $(PRINT_RM) $(patsubst %_CLEAN,%,$(notdir $@)) if test "$(FRAMAC_INTERNAL)" = "yes"; then \ $(RM) $(dir $@).depend; \ fi $(RM) $(PLUGIN_GENERATED) $(RM) $(@:%CLEAN=%DEP) $(@:%CLEAN=%DEP_REDO) $(RM) $(patsubst %.cmo,%.cm*,$($(patsubst %_CLEAN,%_CMO,$(notdir $@)))) $(RM) $(patsubst %.cmi,%.cm*,$($(patsubst %_CLEAN,%_CMI,$(notdir $@)))) $(RM) $(patsubst %.cmo,%.annot,\ $($(patsubst %_CLEAN,%_CMO,$(notdir $@)))) $(RM) $(patsubst %.cmo,%.o,$($(patsubst %_CLEAN,%_CMO,$(notdir $@)))) $(RM) $(patsubst %.cmo,%.cm*,\ $($(patsubst %_CLEAN,%_GUI_CMO,$(notdir $@)))) $(RM) $(patsubst %.cmi,%.cm*,\ $($(patsubst %_CLEAN,%_GUI_CMI,$(notdir $@)))) $(RM) $(patsubst %.cmo,%.annot,\ $($(patsubst %_CLEAN,%_GUI_CMO,$(notdir $@)))) $(RM) $(patsubst %.cmo,%.o,\ $($(patsubst %_CLEAN,%_GUI_CMO,$(notdir $@)))) $(RM) $(dir $@)*~ $(dir $@)*.cm* $(dir $@)*.o $(dir $@)*.annot $(RM) $(foreach d,$(@:%CLEAN=%TESTS_LIB_OPT),\ $(foreach f,$($(notdir $d)),\ $f $(f:.cmx=.cm*) $(f:.cmx=.opt) $(f:.cmx=.byte) $(f:.cmx=.o))) $(RM) -f $(@PLUGIN_NAME@_CHECK_PLUGIN_MLI) .PHONY: $(PLUGIN_DIR)/@PLUGIN_NAME@_DIST_CLEAN $(PLUGIN_DIR)/@PLUGIN_NAME@_DIST_CLEAN: $(RM) $(dir $@)/tests/ptests_config .PHONY: $(PLUGIN_DIR)/@PLUGIN_NAME@_CLEAN_DOC $(@PLUGIN_NAME@_DOC_DIR) $(PLUGIN_DIR)/@PLUGIN_NAME@_CLEAN_DOC: $(@PLUGIN_NAME@_DOC_DIR) $(PRINT_RM) documentation of $(patsubst %_CLEAN_DOC,%,$(notdir $@)) $(RM) -r $< $(RM) $(DOC_DIR)/$(notdir $(patsubst %_CLEAN_DOC,%,$@).toc) # Global lists seen in Makefile PLUGIN_GENERATED_LIST += $(PLUGIN_GENERATED) PLUGIN_META_LIST += $(TARGET_META) PLUGIN_DYN_CMI_LIST += $(TARGET_CMI) ifdef PLUGIN_EXTRA_BYTE .PRECIOUS: $(TARGET_TOP_CMO) PLUGIN_DYN_CMO_LIST += $(TARGET_TOP_CMA) else PLUGIN_DYN_CMO_LIST += $(TARGET_TOP_CMO) endif PLUGIN_DYN_DEP_GUI_CMO_LIST += $(PLUGIN_GUI_CMO) ifeq ($(HAS_GUI),yes) PLUGIN_DYN_GUI_EXISTS:=yes ifdef PLUGIN_EXTRA_BYTE PLUGIN_DYN_GUI_CMO_LIST += $(TARGET_GUI_CMA) else PLUGIN_DYN_GUI_CMO_LIST += $(TARGET_GUI_CMO) endif #EXTRA_BYTE endif #HAS_GUI PLUGIN_DYN_DEP_GUI_CMX_LIST += $(PLUGIN_GUI_CMX) PLUGIN_DYN_CMX_LIST += $(TARGET_TOP_CMXS) $(TARGET_TOP_CMX) $(TARGET_TOP_O) # If P1 depends on P2, then dynamically link P1.cmxs requires to have # compiled P1's sources wrt the P2's .cmx. ifeq ($(HAS_GUI),yes) PLUGIN_DYN_GUI_CMX_LIST += $(TARGET_GUI_CMXS) endif # HAS_GUI PLUGIN_INTERNAL_CMO_LIST += $(PLUGIN_CMO) PLUGIN_INTERNAL_CMX_LIST += $(PLUGIN_CMX) PLUGIN_DOC_LIST += @PLUGIN_NAME@_DOC PLUGIN_DOC_DIRS += $(PLUGIN_BASE) ifeq ($(PLUGIN_DISTRIBUTED),yes) PLUGIN_DISTRIBUTED_NAME_LIST += @PLUGIN_NAME@ PLUGIN_DISTRIBUTED_DIR_LIST += @PLUGIN_NAME@ endif else $(PLUGIN_DIR)/@PLUGIN_NAME@_DEP_REDO: $(PLUGIN_DIR)/@PLUGIN_NAME@_DEP: $(PLUGIN_DIR)/@PLUGIN_NAME@_CLEAN: $(PLUGIN_DIR)/@PLUGIN_NAME@_CLEAN_DOC: endif # Reset each "local" plugin variable ifneq ($(PLUGIN_RESET),no) PLUGIN_RESET:= PLUGIN_NAME:= PLUGIN_DIR:= PLUGIN_DESCRIPTION:= PLUGIN_VERSION:= PLUGIN_REQUIRES:= PLUGIN_HAS_META:= PLUGIN_CMI:= PLUGIN_CMO:= PLUGIN_BFLAGS:= PLUGIN_OFLAGS:= PLUGIN_DEPFLAGS:= PLUGIN_DOCFLAGS:= PLUGIN_GENERATED:= PLUGIN_TYPES_CMO:= PLUGIN_GUI_CMO:= PLUGIN_GUI_CMX:= PLUGIN_GUI_CMI:= PLUGIN_GUI_MLI:= PLUGIN_UNDOC:= PLUGIN_TYPES_TODOC:= PLUGIN_INTRO:= PLUGIN_ENABLE:= PLUGIN_NO_TEST:= PLUGIN_TESTS_LIB:= PLUGIN_TESTS_DIRS:= PLUGIN_DEPENDS:= PLUGIN_DEPENDENCIES:= PLUGIN_DISTRIBUTED:= PLUGIN_DISTRIB_EXTERNAL:= PLUGIN_DISTRIB_TESTS:= PLUGIN_HAS_EXT_DOC:= PLUGIN_NO_DEFAULT_TEST:= PLUGIN_TESTS_DIRS_DEFAULT:= PLUGIN_LINK_GUI_BFLAGS:= PLUGIN_LINK_GUI_OFLAGS:= PLUGIN_LINK_BFLAGS:= PLUGIN_LINK_OFLAGS:= PLUGIN_EXTRA_BYTE:= PLUGIN_EXTRA_OPT:= PLUGIN_EXTRA_DIRS:= PLUGIN_INTERNAL_TEST:= PLUGIN_DOC_DIR:= PLUGIN_HEADER_SPEC:=$(DEFAULT_HEADER_SPEC) PLUGIN_HEADER_DIRS:=$(DEFAULT_HEADER_DIRS) PLUGIN_HEADER_EXCEPTIONS:=$(DEFAULT_HEADER_EXCEPTIONS) PLUGIN_CEA_PROPRIETARY_FILES:=$(DEFAULT_CEA_PROPRIETARY_FILES) PLUGIN_CEA_PROPRIETARY_HEADERS:= endif ############################################################################### # Local Variables: # mode: makefile # End: frama-c-20.0-Calcium/share/_frama-c0000666000000000000000000001426213571573400013712 0ustar #compdef frama-c frama-c-gui frama-c.byte frama-c-gui.byte ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # zsh completion for Frama-C # ========================== # # Installation # ============ # # This file must be placed in a directory listed in the $fpath variable. # You can add a directory to $fpath by adding a line like the following # to your ~/.zshrc file: # # fpath=(~/newdir $fpath) # # It also works with relative paths, such as 'bin/frama-c'. # # # The autocompletion can benefit from the caching system offered by zsh: # `zstyle ':completion:*' use-cache on` to enable caching for all commands # `zstyle ':completion:*:*:frama-c*:*' use-cache on` only for frama-c # # ----------------------------------------------------------------------------- # TODO: # - use _call_program to call frama-c instead of calling frama-c directly ? # - other ideas when to renew cache ? #local curcontext="$curcontext" state state_descr line # expl ret=1 ?? #typeset -A opt_args # filter_load takes a command line calling frama-c and # removes everything not a -load-module or -load-script # argument 1 is the variable name of the input # argument 2 is the variable name of the output function filter_load () { local next=0 local -a my_args my_args=(${(P)1[1]}) for w in ${(P)1}; do if [[ $next -eq 1 ]]; then my_args+=($w) next=0 else # very strange behaviour when ' is used instead of " around -load-* # actually not related to this if [[ $w = '-load-module' ]] || [[ $w = '-load-script' ]]; then my_args+=("$w") next=1 fi fi done eval "$2=($my_args)" } function _frama_c () { local ret=1 # the return value (1 if no autocompletion is done, 0 otherwise) local -a my_words my_words=($words) my_words[1]=${my_words[1]/-gui} # call frama-c instead of frama-c-gui # we do not waste our time on computation if we are not completing an option if [[ -prefix -* ]]; then # if the first character of the current word is a '-' # is the first word on the line executable ? if $my_words[1] 2>/dev/null; then local -a the_args local -a the_previous_args # we keep only parts of the command line relevant to -load-module/-load-script filter_load my_words the_args # we load the previous filtered command from cache if available _retrieve_cache frama-c_previous_command # can overwrite the_previous_args # some gymnastics because the name of the variable matters local -a tmp tmp=($the_previous_args) the_previous_args=($the_args) _store_cache frama-c_previous_command the_previous_args the_previous_args=($tmp) # if the time of the most recent modification in # `frama-c -print-plugin-path` is not the same as the one # in the cache, we deduce that it is not the same "frama-c" # as before and recompute the cache. # We put the new date in the cache and store # this information in $recompute local last_change _retrieve_cache frama-c_last_change zmodload -F zsh/stat b:zstat 2>/dev/null local current_last_change=$(zstat +mtime $($my_words[1] -print-plugin-path)/**/*(.om[1])) local recompute (( recompute = $current_last_change != ${last_change:-0} )) if (( $recompute )); then last_change=$current_last_change _store_cache frama-c_last_change last_change fi # if something in `frama-c -print-plugin-path` changed, # if the filtered current command is different from the remembered one or # if the cache is unavailable, recompute the list of options, # otherwise just load the cache if (( $recompute )) || [[ $the_args != $the_previous_args ]] || _cache_invalid frama-c_autocompletion || ! _retrieve_cache frama-c_autocompletion then local -a autocompletion local autocomp # call frama-c with all the -load-module ; if it fails, test without the load-modules ; # if it fails again, abort autocomp=$($the_args -autocomplete 2>/dev/null) || autocomp=$($my_words[1] -autocomplete 2>/dev/null) || unset autocomp (( $+autocomp )) && autocompletion=($(grep -o "\-[^ ]*" <<< $autocomp | sort)) (( $#autocompletion )) || _message "$my_words[1] exists, but no option was detected" _store_cache frama-c_autocompletion autocompletion fi _describe 'options' autocompletion && ret=0 else _message "$my_words[1] not found, dynamic autocompletion aborted" _files && ret=0 # defaults to _files fi else # if we complete a file (not sure if '_files' is the best default) _files && ret=0 fi return $ret } # call _frama_c when autocompletion is requested _frama_c "$@" frama-c-20.0-Calcium/share/analysis-scripts/0000777000000000000000000000000013571573400015625 5ustar frama-c-20.0-Calcium/share/analysis-scripts/README.md0000666000000000000000000001477013571573400017115 0ustar This directory contains a set of a Makefile and several bash scripts which can be used to simplify non-trivial analyses with Frama-C and some of its plugins, in particular Eva. This Makefile can be included in your own Makefile for the following advantages. 1. It ensures that no unnecessary work is done. If you change the Makefile, targets that have their command line affected will be rebuilt, but any target for which the command line doesn't change won't be rebuilt. 2. It provides commonly used default parameters for the analysis. Note that you can still append new parameters or completely redefine them. 3. It splits between parsing and analysis, storing outputs in separate repositories: .parse for parsing-related outputs, and .eva for Eva-related outputs. 4. It produces several additional outputs after parsing and after an Eva analysis: * `.parse/parse.log`, or `.eva/eva.log`: contain the entire output of the parsing/analysis command, * `warnings.log`: only the warnings emitted by Frama-C/Eva, * `alarms.csv`: list of emitted alarms in csv form, * `metrics.log`: various metrics about the analysis, * `stats.txt`: stats about the analysis, such as user time, memory consumption, the date of the analysis, coverage of the analysis, number of warnings and alarms, and the command line arguments. 5. It keeps copies of all previous analyses you have done in timestamped directories. Getting started =============== There is a ready-to-use Makefile skeleton at the end of this section. If you want explanations about this Makefile, read this entire section. Other usage examples are available in Frama-C's Github open-source-case-studies repository: https://github.com/Frama-C/open-source-case-studies (If you have access to Frama-C's development repositories, you can also use the examples in `analysis-scripts/examples`.) Including analysis-scripts ------------------- This folder contains several shell scripts and, most importantly, the `frama-c.mk` file. This file is intended to be included at the top of your `GNUmakefile`: ```` include $(shell frama-c -print-share-path)/analysis-scripts/frama-c.mk ```` The file is named `GNUmakefile` instead of `Makefile` for pragmatic reasons: in GNU Make, the file `GNUmakefile`, if it exists, takes precedence over a `Makefile`, which avoid having to rename existing Makefiles and having to manually specify the Makefile to use when running make (e.g. via `-f`). The analysis-scripts Makefile relies on GNU-specific features anyway. By default, the scripts use the frama-c binaries located in your `$PATH` environment variable. You may want to specify different binaries, but, if you want to version your analysis, this path will depend on the computer it is run on. So, we recommend you use an unversioned file `frama-c-path.mk`. Add this file to your `.gitignore` and define the `FRAMAC`, `FRAMAC_GUI` and `FRAMAC_CONFIG` variables there. For instance: ```` FRAMAC_DIR=frama-c/bin FRAMAC=$(FRAMAC_DIR)/frama-c FRAMAC_GUI=$(FRAMAC_DIR)/frama-c-gui FRAMAC_CONFIG=$(FRAMAC_DIR)/frama-c-config ```` And include this file before `frama-c.mk` in your Makefile. As this file is computer dependent and unversioned, it will not always be present. Prefix the include command with a minus sign `-` to tell `make` to ignore missing files: ```` -include frama-c-path.mk ```` Then, to handle both cases when Frama-C is in the path, and when it is not, use the following conditional definition of `FRAMAC_CONFIG` followed by the inclusion of `frama-c.mk`: ``` FRAMAC_CONFIG ?= frama-c-config include $(shell $(FRAMAC_CONFIG) -print-share-path)/analysis-scripts/frama-c.mk ``` Defining analysis global parameters ----------------------------------- Once `frama-c.mk` is included, you may change default values of variables. Most usual variables you may want to change are `CPPFLAGS`, `FCFLAGS` and `EVAFLAGS`. For example: ```` CPPFLAGS = -D__I586__ FCFLAGS += -verbose 0 EVAFLAGS += -plevel 100 ```` Some arguments are passed to Frama-C from the environment. This is the case of the `FRAMA_C_MEMORY_FOOTPRINT` variable. You can set it in your Makefile with the following line: ```` export FRAMA_C_MEMORY_FOOTPRINT = 8 ```` The two steps of the analysis ----------------------------- Parsing might be long on some analyses. The analysis scripts save the result of the parsing phase so that it is not redone when modifying only analysis parameters but not parsing parameters. The parsing result is saved in a `.parse` directory while the result of the analysis is saved in a `.eva` directory. The second automatically depends on the first. Thus, each time you require that make build the `.eva` target, it will build the `.parse` one first. ```` all: example.eva ```` Defining analysis sources ------------------------- To define the set of sources to analyze, you must define them as dependencies of your `.parse` target. ```` example.parse: file1.c file2.c file3.c ... ```` As they are dependencies, parsing will be remade if the sources change. Defining project-specific parameters ------------------------------------ You can describe several analyses with the same Makefile. We call these analyses "projects". Projects are not likely to share the exact same parameters. Thus, it is useful to define these parameters project wise. `make` allows this by putting the variable definition after the target. For instance: ```` example.parse: CPPFLAGS += -D__FRAMAC__ example.eva: FCFLAGS += -main my_main example.eva: EVAFLAGS += -slevel 500 ```` Full example ------------ ### `GNUmakefile` ```` # optional include, in case frama-c-path.mk does not exist (frama-c in the PATH) -include frama-c-path.mk # frama-c-config is used to find the analysis scripts and frama-c.mk FRAMAC_CONFIG ?= frama-c-config include $(shell $(FRAMAC_CONFIG) -print-share-path)/analysis-scripts/frama-c.mk # Global parameters CPPFLAGS = -D__I586__ FCFLAGS += -verbose 0 EVAFLAGS += -plevel 100 export FRAMA_C_MEMORY_FOOTPRINT = 8 # Default targets all: example.eva # Input files example.parse: example.c # Project-specific parameters example.parse: CPPFLAGS += -D__FRAMAC__ example.eva: FCFLAGS += -main my_main example.eva: EVAFLAGS += -slevel 500 ```` ### `frama-c-path.mk` ```` FRAMAC_DIR=frama-c/bin FRAMAC=$(FRAMAC_DIR)/frama-c FRAMAC_GUI=$(FRAMAC_DIR)/frama-c-gui FRAMAC_CONFIG=$(FRAMAC_DIR)/frama-c-config ```` ### `.gitignore` ```` *.parse* *.eva* *.crash command parse.log eva.log stats.txt frama-c-path.mk ```` frama-c-20.0-Calcium/share/analysis-scripts/benchmark_database.py0000666000000000000000000001716513571573400021767 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## import time import os import csv import sqlite3 import git_utils def dict_factory(cursor, row): d = {} for idx, col in enumerate(cursor.description): d[col[0]] = row[idx] return d class Database: inserted_targets = {} def __init__(self, benchmark_tag, benchmark_comment, gitdir, analyzer_rev, reference_rev): self.benchmark_tag = benchmark_tag self.benchmark_comment = benchmark_comment if analyzer_rev is None: self.analyzer_hash = None self.analyzer = None else: self.analyzer_hash = git_utils.rev_parse(gitdir, analyzer_rev) self.analyzer = git_utils.name_rev(gitdir, analyzer_rev) self.reference_hash = git_utils.rev_parse(gitdir, reference_rev) self.connection = sqlite3.connect('benchmark-results.db') self.connection.row_factory = dict_factory self.setup_rdb() self.reference_results = self.query_rdb(self.reference_hash) def update(self, results): if not self.benchmark_tag is None: for result in results: inserted = result["target"] in self.inserted_targets if result["up_to_date"] and not inserted: self.insert(result) self.inserted_targets[result["target"]] = True for result in results: if result['target'] in self.reference_results: ref = self.reference_results[result['target']] def compute_diff(column, ratio): nonlocal result, ref try: if ratio: diff = result[column] / ref[column] - 1.0 else: diff = result[column] - ref[column] except TypeError: diff =None result['diff_' + column] = diff compute_diff('alarms', False) compute_diff('warnings', False) compute_diff('user_time', True) compute_diff('memory', True) compute_diff('coverage', False) else: result['diff_alarms'] = None result['diff_warnings'] = None result['diff_user_time'] = None result['diff_memory'] = None result['diff_coverage'] = None def insert_csv(self, result): filename="benchmark-results.csv" file_already_exists=os.path.isfile(filename) fieldnames = [ 'benchmark_tag', 'timestamp', 'analyzer', 'analyzer_hash', 'target', 'target_hash', 'user_time', 'memory', 'alarms', 'warnings', 'sem_reach_fun', 'syn_reach_fun', 'total_fun', 'sem_reach_stmt', 'syn_reach_stmt', 'cmd_args', 'benchmark_comment'] with open(filename, 'a', newline='') as file: writer = csv.DictWriter(file, fieldnames=fieldnames, extrasaction='ignore', delimiter="\t", quotechar='"') if not file_already_exists: writer.writeheader() writer.writerow(result) def insert(self, result): completed_result = { **result, 'benchmark_tag' : self.benchmark_tag, 'benchmark_comment' : self.benchmark_comment, 'target_hash' : git_utils.current_rev(result["target"]), 'analyzer' : self.analyzer, 'analyzer_hash' : self.analyzer_hash } self.insert_csv(completed_result) self.insert_rdb(completed_result) def setup_rdb(self): cursor = self.connection.cursor() cursor.execute( "CREATE TABLE IF NOT EXISTS benchmark_results (" "benchmark_tag TEXT NOT NULL," "timestamp TEXT NOT NULL," "analyzer TEXT NOT NULL," "analyzer_hash TEXT NOT NULL," "target TEXT NOT NULL," "target_hash TEXT NOT NULL," "user_time REAL NOT NULL," "memory INTEGER NOT NULL," "alarms INTEGER NOT NULL," "warnings INTEGER NOT NULL," "sem_reach_fun INTEGER NOT NULL," "syn_reach_fun INTEGER NOT NULL," "total_fun INTEGER NOT NULL," "sem_reach_stmt INTEGER NOT NULL," "syn_reach_stmt INTEGER NOT NULL," "cmd_args TEXT NOT NULL," "benchmark_comment TEXT);") self.connection.commit() def insert_rdb(self, result): cursor = self.connection.cursor() cursor.execute( "INSERT INTO benchmark_results(" "benchmark_tag, timestamp, " "analyzer, analyzer_hash, target, target_hash, " "user_time, memory, alarms, warnings, " "sem_reach_fun, syn_reach_fun, total_fun, " "sem_reach_stmt, syn_reach_stmt, " "cmd_args, benchmark_comment) " "VALUES(" "DATETIME('now','localtime'), " ":benchmark_tag, :analyzer, " ":analyzer_hash, :target, :target_hash, " ":user_time, :memory, :alarms, :warnings, " ":sem_reach_fun, :syn_reach_fun, :total_fun, " ":sem_reach_stmt, :syn_reach_stmt, " ":cmd_args, :benchmark_comment)", result) self.connection.commit() def query_rdb(self, analyzer_hash): cursor = self.connection.cursor() cursor.execute( "SELECT " "target, " "avg(user_time) as user_time, avg(memory) as memory, " "min(alarms) as alarms, min(warnings) as warnings, " "max(sem_reach_stmt) as sem_reach_stmt, " "max(syn_reach_stmt) as syn_reach_stmt " "FROM benchmark_results " "WHERE analyzer_hash=? " "GROUP BY target", (analyzer_hash,)) results = {} for r in cursor.fetchall(): r['coverage'] = r['sem_reach_stmt'] / r['syn_reach_stmt'] results[r['target']] = r return results frama-c-20.0-Calcium/share/analysis-scripts/clone.sh0000777000000000000000000000412313571573400017264 0ustar #!/bin/bash -eu git_hash="master" clone_dir="frama-c-clones" repository_path="git@git.frama-c.com:frama-c/frama-c" show_usage="" while [[ $# > 0 ]] do case $1 in -d|--clone-dir) clone_dir="$2" shift ;; -p|--repository-path) repository_path="$2" shift ;; -h|--help) show_usage="yes" ;; *) git_hash="$1" ;; esac shift done if [ -n "$show_usage" ] then echo "Usage: $0 HASH" echo "Provides a working tree of Frama-C." echo "" echo "The following arguments can be given:" echo " -d, --clone-dir path to the directory where frama-c versions are" echo " cloned" echo " -p, --repository-path PATH do not clone from frama-c gitlab, use this path instead" echo " -h, --help prints this help and quits" exit 1 fi bare="$clone_dir/frama-c.git" # Check if bench clone exists if [ ! -d "$bare" ] then git clone --bare --quiet $repository_path "$bare" sed --in-place '/bare = true/d' $bare/config fi # Fetch all refs git -C $bare fetch origin '+refs/heads/*:refs/heads/*' --prune # Resolve branch name if given git_hash=`git --git-dir="$bare" rev-parse "$git_hash"` # target_path must be an absolute path target_path="$(readlink -f "$clone_dir/$git_hash")" # Checkout if [ ! -e "$target_path" ] then # The workdir cmd can extract a working tree of the desired hash # without cloning once more workdir_cmd=`locate git-new-workdir --limit 1` if [ -z "$workdir_cmd" ] then git --git-dir="$bare" worktree add "$target_path" "$git_hash" else bash "$workdir_cmd" "$bare" "$target_path" "$git_hash" fi fi # Build Frama-C if [ ! -e "$target_path/build/bin/frama-c" ] then ( cd "$target_path"; autoconf -f --warnings=none; ./configure --quiet --prefix=$(pwd)/build > /dev/null; make -j > /dev/null; make install > /dev/null; ) fi # Output repository path echo "$target_path" frama-c-20.0-Calcium/share/analysis-scripts/cmd-dep.sh0000777000000000000000000000071713571573400017502 0ustar #!/bin/bash set -eu if [ $# -lt 1 ] then ( echo "usage: $0 FILE STRING" echo "Test whether the contents of FILE are different from STRING." \ "If it does, FILE is updated to match STRING. The file" \ "name is always printed." ) >&2 exit 1 fi FILE=$1 shift STRING=$* if [ ! -e $FILE ] || ! (diff --brief --ignore-space-change $FILE - <<< "$STRING") then mkdir -p $(dirname "$FILE") echo $STRING > "$FILE" fi echo $FILE frama-c-20.0-Calcium/share/analysis-scripts/concat-csv.sh0000777000000000000000000000346013571573400020227 0ustar #!/bin/bash -eu set -o pipefail header_column="" delete_first="" sort="" files="" show_usage="" while [[ $# > 0 ]] do case $1 in --add-header-column) header_column="yes" ;; --delete-first) delete_first="$2" shift ;; --sort) sort="yes" ;; -h|--help) show_usage="yes" ;; *) files="$files $1" ;; esac shift done target="" sources="" read target sources <<<$files if [ -z "$sources" -o -n "$show_usage" ] then echo "Usage: $0 TARGET SOURCE1 ..." echo "Concat and/or transform CSV files." echo "" echo "The following arguments can be given:" echo " --add-header-column, add a header column consisting of the base name of" echo " the CSV file" echo " --delete-first N delete the first N columns" echo " --sort sort the CSV file" echo " -h, --help prints this help and quits" exit 1 fi # Read header line read first rest <<<$sources header=$(head --quiet --lines 1 $first) if [ -n "$header_column" ] then header="project $header" fi if [ -n "$delete_first" ] then header=$(cut -f1-$delete_first --complement <<<"$header") fi # Read sources { for f in $sources do if [ -n "$header_column" ] then base=$(basename "$f") project="${base%%.*}" sed -e '1d' -e "s/^/$project\t/" "$f"; else sed -e '1d' "$f"; fi done } | # Remove first columns { if [ -n "$delete_first" ] then cut -f1-$delete_first --complement else cat fi } | # Remove blanks sed '/^$/d' | # Sort the file { echo "$header" if [ -n $sort ] then sort -u else cat fi } > "$target" frama-c-20.0-Calcium/share/analysis-scripts/examples/0000777000000000000000000000000013571573400017443 5ustar frama-c-20.0-Calcium/share/analysis-scripts/examples/Makefile0000666000000000000000000000052713571573400021107 0ustar TARGETS=example example-multi example-slevel .PHONY: all update-submodules clean $(TARGETS) all: $(TARGETS) update-submodules: git submodule update --init --recursive --remote clean: @for f in $(TARGETS); \ do \ $(MAKE) --no-print-directory --file $$f.mk clean; \ done $(TARGETS): %: %.mk @$(MAKE) --no-print-directory --file $< frama-c-20.0-Calcium/share/analysis-scripts/examples/example-multi.mk0000666000000000000000000000117113571573400022557 0ustar -include frama-c-path.mk FRAMAC_CONFIG ?= frama-c-config -include $(shell $(FRAMAC_CONFIG) -print-share-path)/analysis-scripts/frama-c.mk # Global parameters CPPFLAGS = -D__I586__ FCFLAGS += -verbose 0 EVAFLAGS += -plevel 100 EVABUILTINS += memset:Frama_C_memset memcpy:Frama_C_memcpy export FRAMA_C_MEMORY_FOOTPRINT = 8 # Default targets all: example1.val example2.val # Input files example1.parse example2.parse: example.c # Project specific parameters example1.parse: CPPFLAGS += -D__FRAMAC__ example1.val: FCFLAGS += -main my_main example2.val: EVAFLAGS += -slevel 500 example2.val: FCFLAGS += -main main frama-c-20.0-Calcium/share/analysis-scripts/examples/example-slevel.mk0000666000000000000000000000227313571573400022723 0ustar # This example is the same as example-multi.mk but pay attention to the # following changes : # 1. slevel is set inside SLEVEL variable instead of EVAFLAGS to allow # overriding when testing specific slevels # 2. A percent (%) is used in example1.% and example2.% so that # options are used also for instance for example1.5000.val which # is the same target as example1.val but with 5000 slevel. # 3. The all rule invoke the script -include frama-c-path.mk FRAMAC_CONFIG ?= frama-c-config -include $(shell $(FRAMAC_CONFIG) -print-share-path)/analysis-scripts/frama-c.mk # Global parameters CPPFLAGS = -D__I586__ FCFLAGS += -verbose 0 EVAFLAGS += -plevel 100 EVABUILTINS += memset:Frama_C_memset memcpy:Frama_C_memcpy export FRAMA_C_MEMORY_FOOTPRINT = 8 # Default targets all: $(shell $(FRAMAC_CONFIG) -print-share-path)/analysis-scripts/slevel-tweaker.sh -f example-slevel.mk example1 example2 # Clean clean:: $(RM) slevel-tweaker.log # Input files example1.parse example2.parse: example.c # Project specific parameters example1.parse: CPPFLAGS += -D__FRAMAC__ example1.%: FCFLAGS += -main my_main example2.%: SLEVEL += -slevel 500 example2.%: FCFLAGS += -main main frama-c-20.0-Calcium/share/analysis-scripts/examples/example.c0000666000000000000000000000030713571573400021242 0ustar #include char s[10], t[10]; int f() { memset(s, 0, 10); memcpy(t, s, 10); return 42; } void main(void) { f(); } #ifdef __FRAMAC__ int my_main(void) { return f(); } #endif frama-c-20.0-Calcium/share/analysis-scripts/examples/example.mk0000666000000000000000000000171013571573400021426 0ustar # frama-c-path.mk contains variables which are specific to each # user and should not be versioned, such as the path to the # frama-c binaries (e.g. FRAMAC and FRAMAC_GUI). # It is an optional include, unnecessary if frama-c is in the PATH -include frama-c-path.mk # FRAMAC_CONFIG is defined in frama-c-path.mk when it is included, so the # line below will be safely ignored if this is the case FRAMAC_CONFIG ?= frama-c-config # frama-c.mk should be included at the top of your Makefile, right below # the inclusion of frama-c-path.mk -include $(shell $(FRAMAC_CONFIG) -print-share-path)/analysis-scripts/frama-c.mk # Define global parameters CPPFLAGS += -D__I586__ -D__FRAMAC__ FCFLAGS += -verbose 0 -main my_main EVAFLAGS += -plevel 611 EVABUILTINS += memset:Frama_C_memset memcpy:Frama_C_memcpy # Export environment variable for Frama-C export FRAMA_C_MEMORY_FOOTPRINT = 8 # Default target all: example.val # List input files example.parse: example.c frama-c-20.0-Calcium/share/analysis-scripts/fc_stubs.c0000666000000000000000000000144113571573400017601 0ustar // Stub for a main function which reads arguments from the command line, to be // used by the Eva plug-in. // This stub emulates non-deterministic input of up to 5 arguments, each up // to 256 characters long. This is sufficient to ensure arbitrary input in // virtually every case. // Do not forget to add option '-main eva_main' in order to use this stub. #ifdef __FRAMAC__ # include "__fc_builtin.h" int main(int, char **); static volatile int nondet; int eva_main() { int argc = Frama_C_interval(0, 5); char argv0[256], argv1[256], argv2[256], argv3[256], argv4[256]; char *argv[5] = {argv0, argv1, argv2, argv3, argv4}; //@ loop unroll 5; for (int i = 0; i < 5; i++) { Frama_C_make_unknown(argv[i], 255); argv[i][255] = 0; } return main(argc, argv); } #endif // __FRAMAC__ frama-c-20.0-Calcium/share/analysis-scripts/find_fun.py0000777000000000000000000001157613571573400020004 0ustar #!/usr/bin/env python3 #-*- coding: utf-8 -*- ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # This script finds files containing likely declarations and definitions # for a given function name, via heuristic syntactic matching. import sys import os import re import glob MIN_PYTHON = (3, 5) # for glob(recursive) if sys.version_info < MIN_PYTHON: sys.exit("Python %s.%s or later is required.\n" % MIN_PYTHON) debug = False arg = "" if len(sys.argv) < 2: print("usage: %s fname [dir1 dir2 ...]" % sys.argv[0]) print(" looks for likely declarations/definitions of function fname") print(" in files with extensions '.c', '.h' and '.i';") print(" if dir1, dir2, etc, are specified, looks inside them,") print(" otherwise looks inside PWD and /usr/include.") print(" Subdirectories are always considered recursively.") sys.exit(1) else: fname = sys.argv[1] if re.match('[a-zA-Z_][a-zA-Z0-9_]*$', fname) == None: print("error: function name contains invalid characters: %s" % fname) print(" (only letters/digits/underscore allowed)") sys.exit(1) dirs = set() if len(sys.argv) < 3: pwd = os.getcwd() dirs = [pwd, "/usr/include"] else: dirs = set(sys.argv[2:]) if debug: print("Looking for files in dirs (and their subdirs): %s" % dirs) files = [] for d in dirs: files += glob.glob(d + "/**/*.[ich]", recursive=True) print("Looking for '%s' inside %d file(s)..." % (fname, len(files))) #print("\n".join(files)) # To minimize the amount of false positives, we try to match the following: # - the line must begin with a C identifier (declarations and definitions in C # rarely start with spaces in the line), or with the function name itself # (supposing the return type is in the previous line) # - any number of identifiers are allowed (to allow for 'struct', 'volatile', # 'extern', etc) # - asterisks are allowed both before and after identifiers, except for the # first one (to allow for 'char *', 'struct **ptr', etc) # - identifiers are allowed after the parentheses, to allow for some macros/ # modifiers possible_declarators = [] possible_definers = [] c_identifier = "[a-zA-Z_][a-zA-Z0-9_]*" c_id_maybe_pointer = c_identifier + "\**" type_prefix = c_id_maybe_pointer + "(?:\s+\**" + c_id_maybe_pointer + ")*\s+\**" parentheses_suffix = "\s*\([^)]*\)" re_fun = re.compile("^(?:" + type_prefix + "\s*)?" + fname + parentheses_suffix + "\s*(?:" + c_identifier + ")?\s*(;|{)", flags=re.MULTILINE) for f in files: with open(f, encoding="ascii", errors='ignore') as content_file: content = content_file.read() has_decl_or_def = re_fun.search(content) if has_decl_or_def is not None: is_decl = has_decl_or_def.group(1) == ";" if is_decl: possible_declarators.append(f) else: possible_definers.append(f) if possible_declarators == [] and possible_definers == []: print("No declaration/definition found for function '%s'" % fname) else: if possible_declarators != []: print("Possible declarations for function '%s' in the following file(s):" % fname) print(" " + "\n ".join(map(os.path.relpath, possible_declarators))) if possible_definers != []: print("Possible definitions for function '%s' in the following file(s):" % fname) print(" " + "\n ".join(map(os.path.relpath, possible_definers))) frama-c-20.0-Calcium/share/analysis-scripts/flamegraph.pl0000777000000000000000000010433613571573400020302 0ustar #!/usr/bin/perl -w ########################################################################## # # # The contents of this file are subject to the terms of the # # Common Development and Distribution License (the "License"). # # You may not use this file except in compliance with the License. # # # # You can obtain a copy of the license at licenses/CDDL-1.0 or # # http://opensource.org/licenses/CDDL-1.0. # # See the License for the specific language governing permissions # # and limitations under the License. # # # ########################################################################## # flamegraph.pl flame stack grapher. # # This takes stack samples and renders a call graph, allowing hot functions # and codepaths to be quickly identified. Stack samples can be generated using # tools such as DTrace, perf, SystemTap, and Instruments. # # USAGE: ./flamegraph.pl [options] input.txt > graph.svg # # grep funcA input.txt | ./flamegraph.pl [options] > graph.svg # # Then open the resulting .svg in a web browser, for interactivity: mouse-over # frames for info, click to zoom, and ctrl-F to search. # # Options are listed in the usage message (--help). # # The input is stack frames and sample counts formatted as single lines. Each # frame in the stack is semicolon separated, with a space and count at the end # of the line. These can be generated for Linux perf script output using # stackcollapse-perf.pl, for DTrace using stackcollapse.pl, and for other tools # using the other stackcollapse programs. Example input: # # swapper;start_kernel;rest_init;cpu_idle;default_idle;native_safe_halt 1 # # An optional extra column of counts can be provided to generate a differential # flame graph of the counts, colored red for more, and blue for less. This # can be useful when using flame graphs for non-regression testing. # See the header comment in the difffolded.pl program for instructions. # # The input functions can optionally have annotations at the end of each # function name, following a precedent by some tools (Linux perf's _[k]): # _[k] for kernel # _[i] for inlined # _[j] for jit # _[w] for waker # Some of the stackcollapse programs support adding these annotations, eg, # stackcollapse-perf.pl --kernel --jit. They are used merely for colors by # some palettes, eg, flamegraph.pl --color=java. # # The output flame graph shows relative presence of functions in stack samples. # The ordering on the x-axis has no meaning; since the data is samples, time # order of events is not known. The order used sorts function names # alphabetically. # # While intended to process stack samples, this can also process stack traces. # For example, tracing stacks for memory allocation, or resource usage. You # can use --title to set the title to reflect the content, and --countname # to change "samples" to "bytes" etc. # # There are a few different palettes, selectable using --color. By default, # the colors are selected at random (except for differentials). Functions # called "-" will be printed gray, which can be used for stack separators (eg, # between user and kernel stacks). # # HISTORY # # This was inspired by Neelakanth Nadgir's excellent function_call_graph.rb # program, which visualized function entry and return trace events. As Neel # wrote: "The output displayed is inspired by Roch's CallStackAnalyzer which # was in turn inspired by the work on vftrace by Jan Boerhout". See: # https://blogs.oracle.com/realneel/entry/visualizing_callstacks_via_dtrace_and # # Copyright 2016 Netflix, Inc. # Copyright 2011 Joyent, Inc. All rights reserved. # Copyright 2011 Brendan Gregg. All rights reserved. # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at docs/cddl1.txt or # http://opensource.org/licenses/CDDL-1.0. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at docs/cddl1.txt. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # 11-Oct-2014 Adrien Mahieux Added zoom. # 21-Nov-2013 Shawn Sterling Added consistent palette file option # 17-Mar-2013 Tim Bunce Added options and more tunables. # 15-Dec-2011 Dave Pacheco Support for frames with whitespace. # 10-Sep-2011 Brendan Gregg Created this. use strict; use Getopt::Long; use open qw(:std :utf8); # tunables my $encoding; my $fonttype = "Verdana"; my $imagewidth = 1200; # max width, pixels my $frameheight = 16; # max height is dynamic my $fontsize = 12; # base text size my $fontwidth = 0.59; # avg width relative to fontsize my $minwidth = 0.1; # min function width, pixels my $nametype = "Function:"; # what are the names in the data? my $countname = "samples"; # what are the counts in the data? my $colors = "hot"; # color theme my $bgcolor1 = "#eeeeee"; # background color gradient start my $bgcolor2 = "#eeeeb0"; # background color gradient stop my $nameattrfile; # file holding function attributes my $timemax; # (override the) sum of the counts my $factor = 1; # factor to scale counts by my $hash = 0; # color by function name my $palette = 0; # if we use consistent palettes (default off) my %palette_map; # palette map hash my $pal_file = "palette.map"; # palette map file name my $stackreverse = 0; # reverse stack order, switching merge end my $inverted = 0; # icicle graph my $negate = 0; # switch differential hues my $titletext = ""; # centered heading my $titledefault = "Flame Graph"; # overwritten by --title my $titleinverted = "Icicle Graph"; # " " my $searchcolor = "rgb(230,0,230)"; # color for search highlighting my $notestext = ""; # embedded notes in SVG my $subtitletext = ""; # second level title (optional) my $help = 0; sub usage { die < outfile.svg\n --title TEXT # change title text --subtitle TEXT # second level title (optional) --width NUM # width of image (default 1200) --height NUM # height of each frame (default 16) --minwidth NUM # omit smaller functions (default 0.1 pixels) --fonttype FONT # font type (default "Verdana") --fontsize NUM # font size (default 12) --countname TEXT # count type label (default "samples") --nametype TEXT # name type label (default "Function:") --colors PALETTE # set color palette. choices are: hot (default), mem, # io, wakeup, chain, java, js, perl, red, green, blue, # aqua, yellow, purple, orange --hash # colors are keyed by function name hash --cp # use consistent palette (palette.map) --reverse # generate stack-reversed flame graph --inverted # icicle graph --negate # switch differential hues (blue<->red) --notes TEXT # add notes comment in SVG (for debugging) --help # this message eg, $0 --title="Flame Graph: malloc()" trace.txt > graph.svg USAGE_END } GetOptions( 'fonttype=s' => \$fonttype, 'width=i' => \$imagewidth, 'height=i' => \$frameheight, 'encoding=s' => \$encoding, 'fontsize=f' => \$fontsize, 'fontwidth=f' => \$fontwidth, 'minwidth=f' => \$minwidth, 'title=s' => \$titletext, 'subtitle=s' => \$subtitletext, 'nametype=s' => \$nametype, 'countname=s' => \$countname, 'nameattr=s' => \$nameattrfile, 'total=s' => \$timemax, 'factor=f' => \$factor, 'colors=s' => \$colors, 'hash' => \$hash, 'cp' => \$palette, 'reverse' => \$stackreverse, 'inverted' => \$inverted, 'negate' => \$negate, 'notes=s' => \$notestext, 'help' => \$help, ) or usage(); $help && usage(); # internals my $ypad1 = $fontsize * 3; # pad top, include title my $ypad2 = $fontsize * 2 + 10; # pad bottom, include labels my $ypad3 = $fontsize * 2; # pad top, include subtitle (optional) my $xpad = 10; # pad lefm and right my $framepad = 1; # vertical padding for frames my $depthmax = 0; my %Events; my %nameattr; if ($titletext eq "") { unless ($inverted) { $titletext = $titledefault; } else { $titletext = $titleinverted; } } if ($nameattrfile) { # The name-attribute file format is a function name followed by a tab then # a sequence of tab separated name=value pairs. open my $attrfh, $nameattrfile or die "Can't read $nameattrfile: $!\n"; while (<$attrfh>) { chomp; my ($funcname, $attrstr) = split /\t/, $_, 2; die "Invalid format in $nameattrfile" unless defined $attrstr; $nameattr{$funcname} = { map { split /=/, $_, 2 } split /\t/, $attrstr }; } } if ($notestext =~ /[<>]/) { die "Notes string can't contain < or >" } # background colors: # - yellow gradient: default (hot, java, js, perl) # - blue gradient: mem, chain # - gray gradient: io, wakeup, flat colors (red, green, blue, ...) if ($colors eq "mem" or $colors eq "chain") { $bgcolor1 = "#eeeeee"; $bgcolor2 = "#e0e0ff"; } if ($colors =~ /^(io|wakeup|red|green|blue|aqua|yellow|purple|orange)$/) { $bgcolor1 = "#f8f8f8"; $bgcolor2 = "#e8e8e8"; } # SVG functions { package SVG; sub new { my $class = shift; my $self = {}; bless ($self, $class); return $self; } sub header { my ($self, $w, $h) = @_; my $enc_attr = ''; if (defined $encoding) { $enc_attr = qq{ encoding="$encoding"}; } $self->{svg} .= < SVG } sub include { my ($self, $content) = @_; $self->{svg} .= $content; } sub colorAllocate { my ($self, $r, $g, $b) = @_; return "rgb($r,$g,$b)"; } sub group_start { my ($self, $attr) = @_; my @g_attr = map { exists $attr->{$_} ? sprintf(qq/$_="%s"/, $attr->{$_}) : () } qw(class style onmouseover onmouseout onclick); push @g_attr, $attr->{g_extra} if $attr->{g_extra}; $self->{svg} .= sprintf qq/\n/, join(' ', @g_attr); $self->{svg} .= sprintf qq/%s<\/title>/, $attr->{title} if $attr->{title}; # should be first element within g container if ($attr->{href}) { my @a_attr; push @a_attr, sprintf qq/xlink:href="%s"/, $attr->{href} if $attr->{href}; # default target=_top else links will open within SVG push @a_attr, sprintf qq/target="%s"/, $attr->{target} || "_top"; push @a_attr, $attr->{a_extra} if $attr->{a_extra}; $self->{svg} .= sprintf qq//, join(' ', @a_attr); } } sub group_end { my ($self, $attr) = @_; $self->{svg} .= qq/<\/a>\n/ if $attr->{href}; $self->{svg} .= qq/<\/g>\n/; } sub filledRectangle { my ($self, $x1, $y1, $x2, $y2, $fill, $extra) = @_; $x1 = sprintf "%0.1f", $x1; $x2 = sprintf "%0.1f", $x2; my $w = sprintf "%0.1f", $x2 - $x1; my $h = sprintf "%0.1f", $y2 - $y1; $extra = defined $extra ? $extra : ""; $self->{svg} .= qq/\n/; } sub stringTTF { my ($self, $color, $font, $size, $angle, $x, $y, $str, $loc, $extra) = @_; $x = sprintf "%0.2f", $x; $loc = defined $loc ? $loc : "left"; $extra = defined $extra ? $extra : ""; $self->{svg} .= qq/$str<\/text>\n/; } sub svg { my $self = shift; return "$self->{svg}\n"; } 1; } sub namehash { # Generate a vector hash for the name string, weighting early over # later characters. We want to pick the same colors for function # names across different flame graphs. my $name = shift; my $vector = 0; my $weight = 1; my $max = 1; my $mod = 10; # if module name present, trunc to 1st char $name =~ s/.(.*?)`//; foreach my $c (split //, $name) { my $i = (ord $c) % $mod; $vector += ($i / ($mod++ - 1)) * $weight; $max += 1 * $weight; $weight *= 0.70; last if $mod > 12; } return (1 - $vector / $max) } sub color { my ($type, $hash, $name) = @_; my ($v1, $v2, $v3); if ($hash) { $v1 = namehash($name); $v2 = $v3 = namehash(scalar reverse $name); } else { $v1 = rand(1); $v2 = rand(1); $v3 = rand(1); } # theme palettes if (defined $type and $type eq "hot") { my $r = 205 + int(50 * $v3); my $g = 0 + int(230 * $v1); my $b = 0 + int(55 * $v2); return "rgb($r,$g,$b)"; } if (defined $type and $type eq "mem") { my $r = 0; my $g = 190 + int(50 * $v2); my $b = 0 + int(210 * $v1); return "rgb($r,$g,$b)"; } if (defined $type and $type eq "io") { my $r = 80 + int(60 * $v1); my $g = $r; my $b = 190 + int(55 * $v2); return "rgb($r,$g,$b)"; } # multi palettes if (defined $type and $type eq "java") { # Handle both annotations (_[j], _[i], ...; which are # accurate), as well as input that lacks any annotations, as # best as possible. Without annotations, we get a little hacky # and match on java|org|com, etc. if ($name =~ m:_\[j\]$:) { # jit annotation $type = "green"; } elsif ($name =~ m:_\[i\]$:) { # inline annotation $type = "aqua"; } elsif ($name =~ m:^L?(java|org|com|io|sun)/:) { # Java $type = "green"; } elsif ($name =~ m:_\[k\]$:) { # kernel annotation $type = "orange"; } elsif ($name =~ /::/) { # C++ $type = "yellow"; } else { # system $type = "red"; } # fall-through to color palettes } if (defined $type and $type eq "perl") { if ($name =~ /::/) { # C++ $type = "yellow"; } elsif ($name =~ m:Perl: or $name =~ m:\.pl:) { # Perl $type = "green"; } elsif ($name =~ m:_\[k\]$:) { # kernel $type = "orange"; } else { # system $type = "red"; } # fall-through to color palettes } if (defined $type and $type eq "js") { # Handle both annotations (_[j], _[i], ...; which are # accurate), as well as input that lacks any annotations, as # best as possible. Without annotations, we get a little hacky, # and match on a "/" with a ".js", etc. if ($name =~ m:_\[j\]$:) { # jit annotation if ($name =~ m:/:) { $type = "green"; # source } else { $type = "aqua"; # builtin } } elsif ($name =~ /::/) { # C++ $type = "yellow"; } elsif ($name =~ m:/.*\.js:) { # JavaScript (match "/" in path) $type = "green"; } elsif ($name =~ m/:/) { # JavaScript (match ":" in builtin) $type = "aqua"; } elsif ($name =~ m/^ $/) { # Missing symbol $type = "green"; } elsif ($name =~ m:_\[k\]:) { # kernel $type = "orange"; } else { # system $type = "red"; } # fall-through to color palettes } if (defined $type and $type eq "wakeup") { $type = "aqua"; # fall-through to color palettes } if (defined $type and $type eq "chain") { if ($name =~ m:_\[w\]:) { # waker $type = "aqua" } else { # off-CPU $type = "blue"; } # fall-through to color palettes } # color palettes if (defined $type and $type eq "red") { my $r = 200 + int(55 * $v1); my $x = 50 + int(80 * $v1); return "rgb($r,$x,$x)"; } if (defined $type and $type eq "green") { my $g = 200 + int(55 * $v1); my $x = 50 + int(60 * $v1); return "rgb($x,$g,$x)"; } if (defined $type and $type eq "blue") { my $b = 205 + int(50 * $v1); my $x = 80 + int(60 * $v1); return "rgb($x,$x,$b)"; } if (defined $type and $type eq "yellow") { my $x = 175 + int(55 * $v1); my $b = 50 + int(20 * $v1); return "rgb($x,$x,$b)"; } if (defined $type and $type eq "purple") { my $x = 190 + int(65 * $v1); my $g = 80 + int(60 * $v1); return "rgb($x,$g,$x)"; } if (defined $type and $type eq "aqua") { my $r = 50 + int(60 * $v1); my $g = 165 + int(55 * $v1); my $b = 165 + int(55 * $v1); return "rgb($r,$g,$b)"; } if (defined $type and $type eq "orange") { my $r = 190 + int(65 * $v1); my $g = 90 + int(65 * $v1); return "rgb($r,$g,0)"; } return "rgb(0,0,0)"; } sub color_scale { my ($value, $max) = @_; my ($r, $g, $b) = (255, 255, 255); $value = -$value if $negate; if ($value > 0) { $g = $b = int(210 * ($max - $value) / $max); } elsif ($value < 0) { $r = $g = int(210 * ($max + $value) / $max); } return "rgb($r,$g,$b)"; } sub color_map { my ($colors, $func) = @_; if (exists $palette_map{$func}) { return $palette_map{$func}; } else { $palette_map{$func} = color($colors, $hash, $func); return $palette_map{$func}; } } sub write_palette { open(FILE, ">$pal_file"); foreach my $key (sort keys %palette_map) { print FILE $key."->".$palette_map{$key}."\n"; } close(FILE); } sub read_palette { if (-e $pal_file) { open(FILE, $pal_file) or die "can't open file $pal_file: $!"; while ( my $line = ) { chomp($line); (my $key, my $value) = split("->",$line); $palette_map{$key}=$value; } close(FILE) } } my %Node; # Hash of merged frame data my %Tmp; # flow() merges two stacks, storing the merged frames and value data in %Node. sub flow { my ($last, $this, $v, $d) = @_; my $len_a = @$last - 1; my $len_b = @$this - 1; my $i = 0; my $len_same; for (; $i <= $len_a; $i++) { last if $i > $len_b; last if $last->[$i] ne $this->[$i]; } $len_same = $i; for ($i = $len_a; $i >= $len_same; $i--) { my $k = "$last->[$i];$i"; # a unique ID is constructed from "func;depth;etime"; # func-depth isn't unique, it may be repeated later. $Node{"$k;$v"}->{stime} = delete $Tmp{$k}->{stime}; if (defined $Tmp{$k}->{delta}) { $Node{"$k;$v"}->{delta} = delete $Tmp{$k}->{delta}; } delete $Tmp{$k}; } for ($i = $len_same; $i <= $len_b; $i++) { my $k = "$this->[$i];$i"; $Tmp{$k}->{stime} = $v; if (defined $d) { $Tmp{$k}->{delta} += $i == $len_b ? $d : 0; } } return $this; } # parse input my @Data; my $last = []; my $time = 0; my $delta = undef; my $ignored = 0; my $line; my $maxdelta = 1; # reverse if needed foreach (<>) { chomp; $line = $_; if ($stackreverse) { # there may be an extra samples column for differentials # XXX todo: redo these REs as one. It's repeated below. my($stack, $samples) = (/^(.*)\s+?(\d+(?:\.\d*)?)$/); my $samples2 = undef; if ($stack =~ /^(.*)\s+?(\d+(?:\.\d*)?)$/) { $samples2 = $samples; ($stack, $samples) = $stack =~ (/^(.*)\s+?(\d+(?:\.\d*)?)$/); unshift @Data, join(";", reverse split(";", $stack)) . " $samples $samples2"; } else { unshift @Data, join(";", reverse split(";", $stack)) . " $samples"; } } else { unshift @Data, $line; } } # process and merge frames foreach (sort @Data) { chomp; # process: folded_stack count # eg: func_a;func_b;func_c 31 my ($stack, $samples) = (/^(.*)\s+?(\d+(?:\.\d*)?)$/); unless (defined $samples and defined $stack) { ++$ignored; next; } # there may be an extra samples column for differentials: my $samples2 = undef; if ($stack =~ /^(.*)\s+?(\d+(?:\.\d*)?)$/) { $samples2 = $samples; ($stack, $samples) = $stack =~ (/^(.*)\s+?(\d+(?:\.\d*)?)$/); } $delta = undef; if (defined $samples2) { $delta = $samples2 - $samples; $maxdelta = abs($delta) if abs($delta) > $maxdelta; } # for chain graphs, annotate waker frames with "_[w]", for later # coloring. This is a hack, but has a precedent ("_[k]" from perf). if ($colors eq "chain") { my @parts = split ";--;", $stack; my @newparts = (); $stack = shift @parts; $stack .= ";--;"; foreach my $part (@parts) { $part =~ s/;/_[w];/g; $part .= "_[w]"; push @newparts, $part; } $stack .= join ";--;", @parts; } # merge frames and populate %Node: $last = flow($last, [ '', split ";", $stack ], $time, $delta); if (defined $samples2) { $time += $samples2; } else { $time += $samples; } } flow($last, [], $time, $delta); warn "Ignored $ignored lines with invalid format\n" if $ignored; unless ($time) { warn "ERROR: No stack counts found\n"; my $im = SVG->new(); # emit an error message SVG, for tools automating flamegraph use my $imageheight = $fontsize * 5; $im->header($imagewidth, $imageheight); $im->stringTTF($im->colorAllocate(0, 0, 0), $fonttype, $fontsize + 2, 0.0, int($imagewidth / 2), $fontsize * 2, "ERROR: No valid input provided to flamegraph.pl.", "middle"); print $im->svg; exit 2; } if ($timemax and $timemax < $time) { warn "Specified --total $timemax is less than actual total $time, so ignored\n" if $timemax/$time > 0.02; # only warn is significant (e.g., not rounding etc) undef $timemax; } $timemax ||= $time; my $widthpertime = ($imagewidth - 2 * $xpad) / $timemax; my $minwidth_time = $minwidth / $widthpertime; # prune blocks that are too narrow and determine max depth while (my ($id, $node) = each %Node) { my ($func, $depth, $etime) = split ";", $id; my $stime = $node->{stime}; die "missing start for $id" if not defined $stime; if (($etime-$stime) < $minwidth_time) { delete $Node{$id}; next; } $depthmax = $depth if $depth > $depthmax; } # draw canvas, and embed interactive JavaScript program my $imageheight = (($depthmax + 1) * $frameheight) + $ypad1 + $ypad2; $imageheight += $ypad3 if $subtitletext ne ""; my $im = SVG->new(); $im->header($imagewidth, $imageheight); my $inc = < INC $im->include($inc); $im->filledRectangle(0, 0, $imagewidth, $imageheight, 'url(#background)'); my ($white, $black, $vvdgrey, $vdgrey, $dgrey) = ( $im->colorAllocate(255, 255, 255), $im->colorAllocate(0, 0, 0), $im->colorAllocate(40, 40, 40), $im->colorAllocate(160, 160, 160), $im->colorAllocate(200, 200, 200), ); $im->stringTTF($black, $fonttype, $fontsize + 5, 0.0, int($imagewidth / 2), $fontsize * 2, $titletext, "middle"); if ($subtitletext ne "") { $im->stringTTF($vdgrey, $fonttype, $fontsize, 0.0, int($imagewidth / 2), $fontsize * 4, $subtitletext, "middle"); } $im->stringTTF($black, $fonttype, $fontsize, 0.0, $xpad, $imageheight - ($ypad2 / 2), " ", "", 'id="details"'); $im->stringTTF($black, $fonttype, $fontsize, 0.0, $xpad, $fontsize * 2, "Reset Zoom", "", 'id="unzoom" onclick="unzoom()" style="opacity:0.0;cursor:pointer"'); $im->stringTTF($black, $fonttype, $fontsize, 0.0, $imagewidth - $xpad - 100, $fontsize * 2, "Search", "", 'id="search" onmouseover="searchover()" onmouseout="searchout()" onclick="search_prompt()" style="opacity:0.1;cursor:pointer"'); $im->stringTTF($black, $fonttype, $fontsize, 0.0, $imagewidth - $xpad - 100, $imageheight - ($ypad2 / 2), " ", "", 'id="matched"'); if ($palette) { read_palette(); } # draw frames while (my ($id, $node) = each %Node) { my ($func, $depth, $etime) = split ";", $id; my $stime = $node->{stime}; my $delta = $node->{delta}; $etime = $timemax if $func eq "" and $depth == 0; my $x1 = $xpad + $stime * $widthpertime; my $x2 = $xpad + $etime * $widthpertime; my ($y1, $y2); unless ($inverted) { $y1 = $imageheight - $ypad2 - ($depth + 1) * $frameheight + $framepad; $y2 = $imageheight - $ypad2 - $depth * $frameheight; } else { $y1 = $ypad1 + $depth * $frameheight; $y2 = $ypad1 + ($depth + 1) * $frameheight - $framepad; } my $samples = sprintf "%.0f", ($etime - $stime) * $factor; (my $samples_txt = $samples) # add commas per perlfaq5 =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; my $info; if ($func eq "" and $depth == 0) { $info = "all ($samples_txt $countname, 100%)"; } else { my $pct = sprintf "%.2f", ((100 * $samples) / ($timemax * $factor)); my $escaped_func = $func; # clean up SVG breaking characters: $escaped_func =~ s/&/&/g; $escaped_func =~ s//>/g; $escaped_func =~ s/"/"/g; $escaped_func =~ s/_\[[kwij]\]$//; # strip any annotation unless (defined $delta) { $info = "$escaped_func ($samples_txt $countname, $pct%)"; } else { my $d = $negate ? -$delta : $delta; my $deltapct = sprintf "%.2f", ((100 * $d) / ($timemax * $factor)); $deltapct = $d > 0 ? "+$deltapct" : $deltapct; $info = "$escaped_func ($samples_txt $countname, $pct%; $deltapct%)"; } } my $nameattr = { %{ $nameattr{$func}||{} } }; # shallow clone $nameattr->{class} ||= "func_g"; $nameattr->{onmouseover} ||= "s(this)"; $nameattr->{onmouseout} ||= "c()"; $nameattr->{onclick} ||= "zoom(this)"; $nameattr->{title} ||= $info; $im->group_start($nameattr); my $color; if ($func eq "--") { $color = $vdgrey; } elsif ($func eq "-") { $color = $dgrey; } elsif (defined $delta) { $color = color_scale($delta, $maxdelta); } elsif ($palette) { $color = color_map($colors, $func); } else { $color = color($colors, $hash, $func); } $im->filledRectangle($x1, $y1, $x2, $y2, $color, 'rx="2" ry="2"'); my $chars = int( ($x2 - $x1) / ($fontsize * $fontwidth)); my $text = ""; if ($chars >= 3) { # room for one char plus two dots $func =~ s/_\[[kwij]\]$//; # strip any annotation $text = substr $func, 0, $chars; substr($text, -2, 2) = ".." if $chars < length $func; $text =~ s/&/&/g; $text =~ s//>/g; } $im->stringTTF($black, $fonttype, $fontsize, 0.0, $x1 + 3, 3 + ($y1 + $y2) / 2, $text, ""); $im->group_end($nameattr); } print $im->svg; if ($palette) { write_palette(); } # vim: ts=8 sts=8 sw=8 noexpandtab frama-c-20.0-Calcium/share/analysis-scripts/frama-c.mk0000666000000000000000000002073713571573400017475 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # This file is intended to be included by a classic Makefile when doing # non-trivial analyses with Frama-C and its Eva plugin. For instance, you # can start your Makefile with the following line: # # include path/to/frama-c.mk # # This Makefile uses the following variables. # # FRAMAC the frama-c binary # FRAMAC_GUI the frama-c gui binary # CPPFLAGS preprocessing flags # FCFLAGS general flags to use with frama-c # FCGUIFLAGS flags to use with frama-c-gui # EVAFLAGS flags to use with the Eva plugin # SLEVEL the part of the frama-c command line concerning slevel # (you can use EVAFLAGS for this, if you don't intend # to use slevel-tweaker.sh) # EVABUILTINS Eva builtins to be set (via -eva-builtin) # EVAUSESPECS Eva functions to be overridden by specs (-eva-use-spec) # # FLAMEGRAPH If set (to any value), running an analysis will produce an # SVG + HTML flamegraph at the end. # # There are several ways to define or change these variables. # # With an environment variable: # export FRAMAC=~/bin/frama-c # make # # With command line arguments: # make FRAMAC=~/bin/frama-c # # In your Makefile, when you want to change a parameter for all analyses : # FCFLAGS += -verbose 2 # # In your Makefile, for a single target : # target.eva: FCFLAGS += -main my_main # # In order to define an analysis target named target, you must in addition # give the list of source files containing the code to be analyzed by adding # them as dependencies of target.parse, a in # # target.parse: file1.c file2.c file3.c... # # Test if Makefile is > 4.0 ifneq (4.0,$(firstword $(sort $(MAKE_VERSION) 4.0))) $(error This Makefile requires Make >= 4.0 - available at http://ftp.gnu.org/gnu/make/) endif # Test if on a Mac (and therefore sed has fewer options) UNAME := $(shell uname -s) ifeq ($(UNAME),Darwin) SED_UNBUFFERED:=sed define time_with_output /usr/bin/time -p endef else SED_UNBUFFERED:=sed --unbuffered define time_with_output /usr/bin/time --format='user_time=%U\nmemory=%M' --output="$(1)" endef endif # --- Utilities --- define display_command = $(info ) $(info $(shell tput setaf 4)Command: $(1)$(shell tput sgr0)) $(info ) endef space := space += comma := , fc_list = $(subst $(space),$(comma),$(strip $1)) # --- Default configuration --- FRAMAC ?= frama-c FRAMAC_SCRIPT = $(FRAMAC)-script FRAMAC_GUI ?= frama-c-gui SLEVEL ?= EVAFLAGS ?= \ -eva-no-print -eva-no-show-progress -eva-msg-key=-initial-state \ -eva-print-callstacks -eva-warn-key alarm=inactive \ -no-deps-print -no-calldeps-print \ -eva-warn-key garbled-mix \ -memexec-all -calldeps -permissive -from-verbose 0 \ $(SLEVEL) \ $(if $(EVABUILTINS), -eva-builtin=$(call fc_list,$(EVABUILTINS)),) \ $(if $(EVAUSESPECS), -eva-use-spec $(call fc_list,$(EVAUSESPECS)),) FCFLAGS ?= FCGUIFLAGS ?= export LIBOVERLAY_SCROLLBAR=0 # --- Cleaning --- .PHONY: clean clean:: $(RM) -r *.parse *.eva *.loop clean-backups: find . -regextype posix-extended \ -regex '^.*_[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{2}-[0-9]{2}-[0-9]{2}\.eva(\.(log|stats|alarms|warnings|metrics))?' \ -delete # --- Generic rules --- TIMESTAMP := $(shell date +"%Y-%m-%d_%H-%M-%S") HR_TIMESTAMP := $(shell date +"%H:%M:%S %d/%m/%Y")# Human readable DIR := $(dir $(lastword $(MAKEFILE_LIST))) SHELL := /bin/bash .SHELLFLAGS := -eu -o pipefail -c .ONESHELL: .SECONDEXPANSION: .FORCE: .SUFFIXES: # Disable make builtins %.parse/command %.eva/command: @# %.parse: SOURCES = $(filter-out %/command,$^) %.parse: PARSE = $(FRAMAC) $(FCFLAGS) -cpp-extra-args="$(CPPFLAGS)" $(SOURCES) %.parse: $$(if $$^,,.IMPOSSIBLE) $$(shell $(DIR)cmd-dep.sh $$@/command $$(PARSE)) @$(call display_command,$(PARSE)) mkdir -p $@ mv -f $@/{command,running} { $(call time_with_output,$@/stats.txt) \ $(PARSE) \ -kernel-log w:$@/warnings.log \ -variadic-log w:$@/warnings.log \ -metrics -metrics-log a:$@/metrics.log \ -save $@/framac.sav \ -print -ocode $@/framac.ast -then -no-print \ || ($(RM) $@/stats.txt && false) # Prevents having error code reporting in stats.txt } 2>&1 | $(SED_UNBUFFERED) '/\[metrics\]/,999999d' | tee $@/parse.log { printf 'timestamp=%q\n' "$(HR_TIMESTAMP)"; printf 'warnings=%s\n' "`cat $@/warnings.log | grep ':\[kernel\]' | wc -l`"; printf 'cmd_args=%q\n' "$(subst ",\",$(wordlist 2,999,$(PARSE)))" } >> $@/stats.txt mv $@/{running,command} touch $@ # Update timestamp and prevents remake if nothing changes %.slevel.eva: SLEVEL = -slevel $(word 2,$(subst ., ,$*)) %.eva: EVA = $(FRAMAC) $(FCFLAGS) -eva $(EVAFLAGS) %.eva: PARSE_RESULT = $(word 1,$(subst ., ,$*)).parse %.eva: $$(PARSE_RESULT) $$(shell $(DIR)cmd-dep.sh $$@/command $$(EVA)) $(if $(BENCHMARK),.FORCE,) @$(call display_command,$(EVA)) mkdir -p $@ mv -f $@/{command,running} { $(call time_with_output,$@/stats.txt) \ $(EVA) \ -load $(PARSE_RESULT)/framac.sav -save $@/framac.sav \ -eva-flamegraph $@/flamegraph.txt \ -kernel-log w:$@/warnings.log \ -from-log w:$@/warnings.log \ -inout-log w:$@/warnings.log \ -scope-log w:$@/warnings.log \ -eva-log w:$@/warnings.log \ -then \ -report-csv $@/alarms.csv -report-no-proven \ -report-log w:$@/warnings.log \ -metrics-eva-cover \ -metrics-log a:$@/metrics.log \ -nonterm -nonterm-log a:$@/nonterm.log \ || ($(RM) $@/stats.txt && false) # Prevents having error code reporting in stats.txt } 2>&1 | $(SED_UNBUFFERED) '/\[eva\] Values at end of function/,999999d' | tee $@/eva.log $(DIR)parse-coverage.sh $@/eva.log $@/stats.txt { printf 'timestamp=%q\n' "$(HR_TIMESTAMP)"; printf 'warnings=%s\n' "`cat $@/warnings.log | grep ':\[\(eva\|kernel\|from\)\]' | wc -l`"; printf 'alarms=%s\n' "`expr $$(cat $@/alarms.csv | wc -l) - 1`"; printf 'cmd_args=%q\n' "$(subst ",\",$(wordlist 2,999,$(EVA)))"; printf 'benchmark_tag=%s' "$(BENCHMARK)" } >> $@/stats.txt if [ ! -z $${FLAMEGRAPH+x} ]; then NOGUI=1 $(FRAMAC_SCRIPT) flamegraph $@/flamegraph.txt $@/ fi mv $@/{running,command} touch $@ # Update timestamp and prevents remake if nothing changes cp -r $@ $*_$(TIMESTAMP).eva %.gui: % $(FRAMAC_GUI) $(FCGUIFLAGS) -load $^/framac.sav & # Run loop bound analysis plug-in and store result in *.loop %.loop: % @ { $(FRAMAC) $(FCFLAGS) -load $^/framac.sav -loop -loop-no-branches | sed -e '1,/Add this to your command line:/d' } > $@ # Produce and open an SVG + HTML from raw flamegraph data produced by Eva %/flamegraph: %/flamegraph.html @ case "$$OSTYPE" in cygwin*) cmd /c start "$^";; linux*) xdg-open "$^";; darwin*) open "$^";; esac %/flamegraph.html %/flamegraph.svg: %/flamegraph.txt NOGUI=1 $(FRAMAC_SCRIPT) flamegraph $^ $(dir $^) .PRECIOUS: %/flamegraph.html # clean is generally not the default goal, but if there is no default # rule when including this file, it would be. ifeq ($(.DEFAULT_GOAL),clean) .DEFAULT_GOAL := endif frama-c-20.0-Calcium/share/analysis-scripts/frama_c_results.py0000666000000000000000000000641413571573400021355 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## import re stat_file_re = re.compile("^([^=]*)=(.*)$", re.MULTILINE) def load(filename): data = {} try: with open(filename, 'r') as file: content = file.read() for (key,value) in stat_file_re.findall(content): data[key] = value except OSError: pass return data re_escape_space = re.compile(r'\\ ') def convert(data, key, to_type, default=None): try: value = data[key].strip() if to_type is str: value = re.sub(r'\\ ', ' ', value) value = re.sub(r'\\,', ',', value) return value else: return to_type(value) except (ValueError, TypeError, KeyError): return default def parse(data): result = {} result["timestamp"] = convert(data, "timestamp", str) result["sem_reach_fun"] = convert(data, "sem_reach_fun", int) result["syn_reach_fun"] = convert(data, "syn_reach_fun", int) result["total_fun"] = convert(data, "total_fun", int) result["sem_reach_stmt"] = convert(data, "sem_reach_stmt", int) result["syn_reach_stmt"] = convert(data, "syn_reach_stmt", int) result["alarms"] = convert(data, "alarms", int) result["warnings"] = convert(data, "warnings", int) result["user_time"] = convert(data, "user_time", float) result["memory"] = convert(data, "memory", int) result["cmd_args"] = convert(data, "cmd_args", str) result["benchmark_tag"] = convert(data, "benchmark_tag", str) if result["sem_reach_stmt"] != None and result["syn_reach_stmt"] != None: result["coverage"] = result["sem_reach_stmt"] / result["syn_reach_stmt"] else: result["coverage"] = None return result def read(filename): return parse(load(filename)) frama-c-20.0-Calcium/share/analysis-scripts/git_utils.py0000666000000000000000000000513513571573400020206 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## import subprocess def rev_parse(gitdir, rev): res = subprocess.run( ['git', 'rev-parse', rev], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, encoding='ascii', cwd=gitdir) name = res.stdout.strip() return name if name else None def name_rev(gitdir, rev): res = subprocess.run( ['git', 'name-rev', '--name-only', rev], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, encoding='ascii', cwd=gitdir) name = res.stdout.strip() return name if name else None def current_rev(gitdir): return name_rev(gitdir, "HEAD") def is_clean(gitdir): # git diff and diff-index are not working on some of our case studies to # decide whether the workingin dir is clean or not ; git status is more # reliable res = subprocess.run( ['git', 'status', '--untracked-files=no', '--porcelain'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, encoding='ascii', cwd=gitdir) return res.returncode == 0 and not res.stdout frama-c-20.0-Calcium/share/analysis-scripts/list_files.py0000777000000000000000000000647613571573400020354 0ustar #!/usr/bin/env python #-*- coding: utf-8 -*- ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # This script parses a compile_commands.json[1] file and lists the C files # in it. # # [1] See: http://clang.llvm.org/docs/JSONCompilationDatabase.html import sys import os import json import re arg = "" if len(sys.argv) < 2: # no argument, assume default name arg = "compile_commands.json" else: arg = sys.argv[1] if not os.path.exists(arg): print("error: file '%s' not found" % arg) print("usage: %s [compile_commands.json]" % sys.argv[0]) sys.exit(1) # check if arg has a known extension def has_known_c_extension(arg): return arg.endswith(".c") or arg.endswith(".i") or arg.endswith(".h") pwd = os.getcwd() json = json.loads(open(arg).read()) includes = set() defines = set() files = set() for entry in json: arg_includes = [] # before normalization dir = entry["directory"] file = entry["file"] # json compile spec says either command or arguments are mandatory if os.path.isabs(file): filepath = file else: filepath = os.path.join(dir, file) if not has_known_c_extension(filepath): print("warning: ignoring file of unknown type: %s" % filepath) else: files.add(os.path.relpath(filepath, pwd)) print("SRCS=\\\n" + " \\\n".join(sorted(files)) + " \\") print("") files_defining_main = set() re_main = re.compile("(int|void)\s+main\s*\([^)]*\)\s*\{") for file in files: assert os.path.exists(file), "file does not exist: %s" % file with open(file, 'r') as content_file: content = content_file.read() res = re.search(re_main, content) if res is not None: files_defining_main.add(file) if files_defining_main != []: print("") print("# Possible definition of main function in the following file(s):") print("\n".join(sorted(files_defining_main))) frama-c-20.0-Calcium/share/analysis-scripts/make_template.py0000777000000000000000000001742013571573400021016 0ustar #!/usr/bin/env python3 #-*- coding: utf-8 -*- ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2018 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # This script is used to interactively fill template.mk, converting it # into a GNUmakefile ready for analysis. import sys import os import re from subprocess import Popen, PIPE from pathlib import Path MIN_PYTHON = (3, 6) # for glob(recursive) and automatic Path conversions if sys.version_info < MIN_PYTHON: sys.exit("Python %s.%s or later is required.\n" % MIN_PYTHON) if len(sys.argv) > 3: print("usage: %s path-to-frama-c-script [dir]" % sys.argv[0]) print(" creates a GNUmakefile for running Frama-C on a set of files,") print(" interactively filling a template.") sys.exit(1) if not os.path.isfile(sys.argv[1]): print("error: path to frama-c-script is not a file: " + sys.argv[1]) sys.exit(1) jcdb = Path("compile_commands.json") if "PTESTS_TESTING" in os.environ: print("Running ptests: setting up mock files...") jcdb.touch() bindir = Path(os.path.dirname(os.path.abspath(sys.argv[1]))) frama_c_config = bindir / "frama-c-config" process = Popen([frama_c_config, "-print-share-path"], stdout=PIPE) (output, err) = process.communicate() output = output.decode('utf-8') exit_code = process.wait() if exit_code != 0: print("error running frama-c-config") sys.exit(1) sharedir = Path(output) def get_known_machdeps(): process = Popen([bindir / "frama-c", "-machdep", "help"], stdout=PIPE) (output, err) = process.communicate() output = output.decode('utf-8') exit_code = process.wait() if exit_code != 0: print("error getting machdeps: " + output) sys.exit(1) match = re.match("\[kernel\] supported machines are (.*) \(default is (.*)\).", output, re.DOTALL) if not match: print("error getting known machdeps: " + output) sys.exit(1) machdeps = match.group(1).split() default_machdep = match.group(2) return (default_machdep, machdeps) dir = Path(sys.argv[2] if len(sys.argv) == 3 else ".") gnumakefile = dir / "GNUmakefile" def check_path_exists(path): if os.path.exists(path): yn = input("warning: {} already exists. Overwrite? [y/N] ".format(path)) if yn == "" or not (yn[0] == "Y" or yn[0] == "y"): print("Exiting without overwriting.") sys.exit(0) check_path_exists(gnumakefile) main = input("Main target name: ") if not re.match("^[a-zA-Z_0-9]+$", main): print("error: invalid main target name") sys.exit(1) sources = input("Source files separated by spaces (default if empty: *.c): ") if not sources: sources="*.c" json_compilation_database = None if jcdb.is_file(): yn = input("compile_commands.json exists, add option -json-compilation-database? [Y/n] ") if yn == "" or not (yn[0] == "N" or yn[0] == "n"): json_compilation_database = "." else: print("Option not added; you can later add it to FCFLAGS.") add_main_stub = False yn = input("Add stub for function main (only needed if it uses command-line arguments)? [y/N] ") if yn != "" and (yn[0] == "Y" or yn[0] == "y"): add_main_stub = True sources = "fc_stubs.c " + sources print("Please define the architectural model (machdep) of the target machine.") (default_machdep, machdeps) = get_known_machdeps() print("Known machdeps: " + " ".join(machdeps)) machdep_chosen = False while not machdep_chosen: machdep = input("Please enter the machdep [" + default_machdep + "]: ") if not machdep: machdep = default_machdep machdep_chosen = True else: if not (machdep in machdeps): yn = input("'{}' is not a standard machdep. Proceed anyway? [y/N]".format(machdep)) if yn != "" and (yn[0] == "Y" or yn[0] == "y"): machdep_chosen = True else: machdep_chosen = True def insert_line_after(lines, line_pattern, newline): re_line = re.compile(line_pattern) for i in range(0, len(lines)): if re_line.search(lines[i]): lines.insert(i+1, newline) return lines print("error: no lines found matching pattern: " + line_pattern) sys.exit(1) def replace_line(lines, line_pattern, value): re_line = re.compile(line_pattern) for i in range(0, len(lines)): if re_line.search(lines[i]): lines[i] = value return lines print("error: no lines found matching pattern: " + line_pattern) sys.exit(1) def remove_lines_between(lines, start_pattern, end_pattern): re_start = re.compile(start_pattern) re_end = re.compile(end_pattern) first_to_remove = -1 last_to_remove = -1 for i in range(0, len(lines)): if first_to_remove == -1 and re_start.search(lines[i]): first_to_remove = i elif re_end.search(lines[i]): last_to_remove = i break if first_to_remove == -1: print("error: could not find start pattern: " + start_pattern) sys.exit(1) elif last_to_remove == -1: print("error: could not find end pattern: " + end_pattern) sys.exit(1) return (lines[:first_to_remove-1] if first_to_remove > 0 else []) + (lines[last_to_remove+1:] if last_to_remove < len(lines)-1 else []) with open(sharedir / "analysis-scripts" / "template.mk") as f: lines = list(f) lines = replace_line(lines, "^MAIN_TARGET :=", "MAIN_TARGET := {}\n".format(main)) lines = remove_lines_between(lines, "Remove these lines.*main target", "^endif") lines = replace_line(lines, "^\$\(MAIN_TARGET\).parse:", "$(MAIN_TARGET).parse: {}\n".format(sources)) if json_compilation_database: lines = insert_line_after(lines, "^FCFLAGS", " -json-compilation-database {} \\\n".format(json_compilation_database)) lines = insert_line_after(lines, "^FCFLAGS", " -machdep {} \\\n".format(machdep)) if add_main_stub: check_path_exists("fc_stubs.c") from shutil import copyfile copyfile(sharedir / "analysis-scripts" / "fc_stubs.c", "fc_stubs.c") lines = insert_line_after(lines, "^FCFLAGS", " -main eva_main \\\n") print("Created stub for main function: fc_stubs.c") gnumakefile.write_text("".join(lines)) print("Template created: " + gnumakefile.name) if "PTESTS_TESTING" in os.environ: print("Running ptests: cleaning up after tests...") jcdb.unlink() if add_main_stub: Path("fc_stubs.c").unlink() frama-c-20.0-Calcium/share/analysis-scripts/make_wrapper.py0000777000000000000000000001334313571573400020663 0ustar #!/usr/bin/env python3 #-*- coding: utf-8 -*- ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2018 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # This script serves as wrapper to 'make' (when using the analysis-scripts # GNUmakefile template): it parses the output and suggests useful commands # whenever it can, by calling frama-c-script itself. import subprocess import sys import os import re from functools import partial if len(sys.argv) < 3: print("usage: %s path-to-frama-c-script target" % sys.argv[0]) print(" Builds the specified target, parsing the output to") print(" identify and recommend actions in case of failure.") print(" The first argument must be the path to the frama-c-script") print(" binary.") sys.exit(1) framac_script = sys.argv[1] target = sys.argv[2] args = sys.argv[3:] out = subprocess.Popen(['make', target] + args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = out.communicate()[0].decode('utf-8') re_missing_spec = re.compile("Neither code nor specification for function ([^,]+),") re_recursive_call_start = re.compile("detected recursive call") re_recursive_call_end = re.compile("Use -eva-ignore-recursive-calls to ignore") tips = [] lines = iter(output.splitlines()) for line in lines: print(line) match = re_missing_spec.search(line) if match: fname = match.group(1) def action(fname): out = subprocess.Popen([framac_script, "find-fun", fname], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = out.communicate()[0].decode('utf-8') re_possible_definers = re.compile("Possible definitions for function") find_fun_lines = iter(output.splitlines()) for find_fun_line in find_fun_lines: if re_possible_definers.match(find_fun_line): found_files = [next(find_fun_lines)] while True: try: found_files.append(next(find_fun_lines)) except StopIteration: if len(found_files) > 1: print("Found several files defining function '" + fname + "', cannot recommend automatically.") print("Check which one is appropriate and add it " + "to the list of sources to be parsed:") print("\n".join(found_files)) else: print("Add the following file to the list of " + "sources to be parsed:\n" + found_files[0]) return print("Could not find any files defining " + fname + ".") print("Find the sources defining it and add them, " + "or provide a stub.") tip = {"message": "Found function with missing spec: " + fname + "\n" + " Looking for files defining it...", "action":partial(action, fname) } tips.append(tip) else: match = re_recursive_call_start.search(line) if match: def action(): print("Consider patching or stubbing the recursive call, " + "then re-run the analysis.") msg_lines = [] line = next(lines) while True: match = re_recursive_call_end.search(line) if match: tip = {"message": "Found recursive call at:\n" + "\n".join(msg_lines), "action":action } tips.append(tip) break else: msg_lines.append(line) try: line = next(lines) except StopIteration: print("** Error: EOF without ending recursive call stack?") assert False if tips != []: print("") print("***** make-wrapper recommendations *****") print("") counter = 1 print("*** recommendation #" + str(counter) + " ***") print("") for tip in tips: if counter > 1: print("") print("*** recommendation #" + str(counter) + " ***") print(str(counter) + ". " + tip["message"]) counter += 1 tip["action"]() frama-c-20.0-Calcium/share/analysis-scripts/parse-coverage.sh0000777000000000000000000000156613571573400021077 0ustar #!/bin/bash log_file=$1 stats_file=$2 read syn_reach_fun total_fun \ <<<`sed -n 's/^[[:blank:]]*Syntactically reachable functions = \([[:digit:]]*\) (out of \([[:digit:]]*\))$/\1 \2/p' $log_file` read sem_reach_fun \ <<<`sed -n 's/^[[:blank:]]*Semantically reached functions = \([[:digit:]]*\)$/\1/p' $log_file` read reach_fun_percent \ <<<`sed -n 's/^[[:blank:]]*Coverage estimation = \([[:digit:].]*\)%/\1/p' $log_file` read syn_reach_stmt sem_reach_stmt reach_stmt_percent \ <<<`sed -n 's/^[[:blank:]]*\([[:digit:]]*\) stmts in analyzed functions, \([[:digit:]]*\) stmts analyzed (\([[:digit:].]*\)%)$/\1 \2 \3/p' $log_file` ( printf 'sem_reach_fun=%s\n' $sem_reach_fun; printf 'syn_reach_fun=%s\n' $syn_reach_fun; printf 'total_fun=%s\n' $total_fun; printf 'sem_reach_stmt=%s\n' $sem_reach_stmt; printf 'syn_reach_stmt=%s\n' $syn_reach_stmt; ) >> $stats_file frama-c-20.0-Calcium/share/analysis-scripts/results_display.py0000666000000000000000000002162713571573400021435 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## import re import sys import string import curses sensitivity = 0.02 class ResultsFormatter(string.Formatter): @staticmethod def format_memory(kilobytes): if kilobytes < 4096: return str(kilobytes) + " kiB" megabytes = round(kilobytes / 1024) if megabytes < 4096: return str(megabytes) + " MiB" gigabytes = round(megabytes / 1024) return str(gygabytes) + " GiB" @staticmethod def format_time(seconds): if seconds < 10: return str(round(seconds,2)) + "s" if seconds < 100: return str(round(seconds,1)) + "s" if seconds < 600: return str(round(seconds)) + "s" minutes = round(seconds / 60) if minutes < 600: return str(minutes) + "m" hours = round(minutes / 60) return str(hours) + "h" @staticmethod def attribute(value, inverted): if value > sensitivity: return "@-" if inverted else "@+" elif value < -sensitivity: return "@+" if inverted else "@-" else: return "@=" def get_field(self, field_name, args, kwargs): try: return super().get_field(field_name, args, kwargs) except (KeyError, AttributeError): return None,field_name def format_field(self, value, format_spec): if value == None: return "" elif format_spec.startswith('+cmp:'): remainder = format_spec.split("+cmp:",1)[1] return (self.attribute(value, False) + self.format_field(value, remainder) + "@=") elif format_spec.startswith('-cmp:'): remainder = format_spec.split("-cmp:",1)[1] return (self.attribute(value, True) + self.format_field(value, remainder) + "@=") elif format_spec == 'time': return self.format_time(value) elif format_spec == 'memory': return self.format_memory(value) else: return super().format_field(value, format_spec) class UserExitRequest (Exception): pass class PlainDisplay: NEGATIVE = 1 POSITIVE = 2 RUNNING = 3 HEADER = 4 columns = [ {"size":64, "caption":"Case", "format":"{target_name:s}"}, {"size":14, "caption":"Coverage", "format":"{coverage:>8.0%} {diff_coverage:+cmp:+.0%}"}, {"size":14, "caption":"Alarms", "format":"{alarms:>8d} {diff_alarms:-cmp:+d}"}, {"size":14 , "caption":"Warnings", "format":"{warnings:>8d} {diff_warnings:-cmp:+d}"}, {"size":14, "caption":"Time", "format":"{user_time:time} {diff_user_time:-cmp:+.0%}"}, {"size":14, "caption":"Memory", "format":"{memory:memory} {diff_memory:-cmp:+.0%}"}] def __init__(self): self.NEGATIVE = 0 self.POSITIVE = 0 self.RUNNING = 0 self.HEADER = 0 self.OBSOLETE = 0 self.needs_update = False def write(self, text, attributes=0): sys.stdout.write(text) def rich_write(self, text, override=None, size=0): attributes = 0 n = 0 for s in re.split(r'(@.)', text): if s == "@=": attributes = 0 elif s == "@+": attributes = self.POSITIVE elif s == "@-": attributes = self.NEGATIVE else: n += len(s) self.write(s, attributes if override is None else override) if n < size: self.write(' ' * (size - n), attributes if override is None else override) fmt = ResultsFormatter() def format(self, *args, **kwargs): return self.fmt.format(*args, **kwargs) def print_table(self, results): self.write(" ", self.HEADER) for column in self.columns: self.write(self.format('{caption:^{size}}', **column), self.HEADER) self.write(" ", self.HEADER) self.write("\n-") for column in self.columns: self.write(self.format('{:-^{size}}', "", **column)) self.write("-") self.write("\n") for result in results: self.write(" ") for column in self.columns: s = self.fmt.format(column["format"], **result) if result["is_running"]: attribute = self.RUNNING elif not result["up_to_date"]: attribute = self.OBSOLETE else: attribute = None self.rich_write(s, attribute, size=column['size']) self.write(" ") self.write("\n") self.write("\n") self.needs_update = False def process_inputs(self): pass class CursesDisplay(PlainDisplay): def __init__(self, stdscr): self.stdscr = stdscr #curses.mousemask(curses.ALL_MOUSE_EVENTS) stdscr.nodelay(True) stdscr.refresh() # Needs to be done once or nothing will be output self.window = curses.newpad(400, 160) curses.init_color(curses.COLOR_YELLOW, 300, 300, 300) curses.init_pair(1, curses.COLOR_RED, 0) curses.init_pair(2, curses.COLOR_GREEN, 0) curses.init_pair(3, curses.COLOR_WHITE, curses.COLOR_YELLOW) curses.init_pair(4, curses.COLOR_YELLOW, 0) self.NEGATIVE = curses.color_pair(1) self.POSITIVE = curses.color_pair(2) self.RUNNING = curses.A_BLINK | curses.color_pair(3) self.HEADER = curses.A_BOLD self.OBSOLETE = curses.color_pair(4) self.scroll_y = 0 def write(self, text, attributes=0): self.window.addstr(text, attributes) def print_table(self, results): self.window.clear() PlainDisplay.print_table(self, results) height, width = self.stdscr.getmaxyx() try: self.window.refresh(0, 0, 0, 0, 1, width-1) self.window.refresh(self.scroll_y+2, 0, 2, 0, height-1, width-1) except Exception: # getmaxyx may be out of date, especially when resizing down the # window ; just ignore errors pass def process_inputs(self): previous_y = self.scroll_y c = self.stdscr.getch() while c != -1: if c == ord('q'): raise UserExitRequest elif c == curses.KEY_UP: self.scroll_y -= 1 elif c == curses.KEY_DOWN: self.scroll_y += 1 elif c == curses.KEY_NPAGE: self.scroll_y += 10 elif c == curses.KEY_PPAGE: self.scroll_y -= 10 elif c == curses.KEY_MOUSE: id,x,y,z,bstate = curses.getmouse() if z > 0: self.scroll_y += 1 elif z < 0: self.scroll_y -= 1 self.scroll_y = max(0, self.scroll_y) c = self.stdscr.getch() if self.scroll_y != previous_y: self.needs_update = True def wrapper(f, *args, **kwargs): if 'curses' in kwargs: use_curses = kwargs['curses'] del kwargs['curses'] else: use_curses = False if use_curses: def g(stdscr): nonlocal f, args, kwargs display = CursesDisplay(stdscr) return f(display, *args, **kwargs) return curses.wrapper(g) else: display = PlainDisplay() return f(display, *args, **kwargs) frama-c-20.0-Calcium/share/analysis-scripts/summary.py0000777000000000000000000001676513571573400017716 0ustar #!/usr/bin/env python3 #-*- coding: utf-8 -*- ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## import re import sys import subprocess import time import os import signal import argparse import uuid import frama_c_results import results_display import benchmark_database class OperationException(Exception): pass def build_env(framac): if framac is None: return { **os.environ } else: bindir = framac + '/build/bin' return { **os.environ, 'PATH' : bindir + ':' + os.environ['PATH'] } def list_targets(): env = build_env(framac) res = subprocess.run( ["make", "--quiet", "display-targets"], env=env, stdout=subprocess.PIPE, encoding='ascii') return res.stdout.split() def clone_frama_c(clonedir, hash): print("Cloning Frama-C", hash, "...") res = subprocess.run( ["./scripts/clone.sh", "--clone-dir", clonedir, hash], stdout=subprocess.PIPE, encoding='ascii') if res.returncode != 0: raise OperationException("Cannot clone repository. Try to manually" "remove the broken clone in " + clonedir) return res.stdout.strip() def run_make(framac, benchmark_tag=None): args = ['make', '--keep-going', 'all'] env = build_env(framac) if not framac is None: bindir = framac + '/build/bin' args += [ 'FRAMAC_DIR=' + bindir, 'FRAMAC=' + bindir + '/frama-c', 'FRAMAC_CONFIG=' + bindir + '/frama-c-config'] if benchmark_tag is None: args += ['-j', '8'] else: args += ['BENCHMARK=' + benchmark_tag] return subprocess.Popen(args, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, preexec_fn=os.setsid) def terminate_process(process): if process is None: return b"" else: try: os.killpg(os.getpgid(process.pid), signal.SIGTERM) pass except ProcessLookupError: pass output,errors = process.communicate() return errors def smart_rename(target): target = re.sub('main\.eva$', '', target) target = re.sub('\.eva$', '', target) target = re.sub('qds/frama-c', 'qds', target) return target def is_running(target): return os.path.isfile(target + '/running') def poll_results(targets, benchmark_tag): results = [] for target in targets: filename = target + '/stats.txt' result = frama_c_results.read(filename) result["target"] = target result["target_name"] = smart_rename(target) result["is_running"] = is_running(target) result["up_to_date"] = benchmark_tag is None or benchmark_tag == result['benchmark_tag'] results.append(result); return results def run_analyses(display, database, framac, benchmark_tag): results = [] targets = list_targets() process = run_make(framac, benchmark_tag) errors = b"" next_poll = time.time() def update(): nonlocal display, database, targets, benchmark_tag, results results = poll_results(targets, benchmark_tag) if not database is None: database.update(results) display.needs_update = True try: while process.poll() is None: if time.time() >= next_poll: update() next_poll = time.time() + 2.0 display.process_inputs() if display.needs_update: display.print_table(results) time.sleep(0.05) update() except (KeyboardInterrupt, results_display.UserExitRequest): print("Analyzes interrupted by user.") except Exception as e: # terminate_process below is somehow blocking the exception printing errors += bytearray(str(e), 'ascii') raise e finally: errors += terminate_process(process) return results,errors parser = argparse.ArgumentParser( description="Run analyses and summarize the results. Must be run in a " "directory with a Makefile having two rules: 'all', a target " "that runs the analysis, and 'display-targets', the target that " "lists the built results.") parser.add_argument('rev', nargs='?', metavar="REVISION", help="a Frama-C revision to use for analyses (default: use the " "default configuration for Frama-C)") parser.add_argument('-b', '--benchmark', action="store_true", help="sets benchmark mode: do not run analyses in parallel and rerun all " "analyses") parser.add_argument('-v', '--vs', action="store", metavar="REVISION", default="master", help="a revision to compare the results to") parser.add_argument('-c', '--comment', action="store", metavar="COMMENT", help="when benchmarking, add this comment inside the database") parser.add_argument('-p', '--repository-path', action="store", metavar="PATH", help="don't clone Frama-C, use this git repository instead") errors = b'' try: args = parser.parse_args() if args.repository_path is None: if args.rev is None: gitdir = None framac = None else: clonedir = "./frama-c-clones" gitdir = clonedir + "/frama-c.git" framac = clone_frama_c(clonedir, args.rev) else: framac = args.repository_path gitdir = framac if args.benchmark: benchmark_tag=str(uuid.uuid1()) print("Running benchmarks with benchmark tag", benchmark_tag, "...") else: benchmark_tag=None print("Running analyses ...") benchmark_comment = args.comment if gitdir is None: database = None else: database = benchmark_database.Database(benchmark_tag, benchmark_comment, gitdir, args.rev, args.vs) results,errors = results_display.wrapper(run_analyses, database, framac, benchmark_tag, curses=True) print("Results:\n") results_display.PlainDisplay().print_table(results) except OperationException as e: errors += bytearray(str(e), 'ascii') sys.stderr.buffer.write(errors + b'\n') frama-c-20.0-Calcium/share/analysis-scripts/template.mk0000666000000000000000000000457713571573400020006 0ustar # TEMPLATE FOR MAKEFILE TO USE IN FRAMA-C/EVA CASE STUDIES # DO NOT EDIT THE LINES BETWEEN THE '#'S ############################################################################### # Improves analysis time, at the cost of extra memory usage export FRAMA_C_MEMORY_FOOTPRINT = 8 # # frama-c-path.mk contains variables which are specific to each # user and should not be versioned, such as the path to the # frama-c binaries (e.g. FRAMAC and FRAMAC_GUI). # It is an optional include, unnecessary if frama-c is in the PATH -include frama-c-path.mk # # FRAMAC_CONFIG is defined in frama-c-path.mk when it is included, so the # line below will be safely ignored if this is the case FRAMAC_CONFIG ?= frama-c-config # # frama-c.mk contains the main rules and targets -include $(shell $(FRAMAC_CONFIG) -print-share-path)/analysis-scripts/frama-c.mk # ############################################################################### # EDIT VARIABLES AND TARGETS BELOW AS NEEDED # The flags below are only suggestions to use with Eva, and can be removed # (Optional) preprocessing flags, usually handled by -json-compilation-database CPPFLAGS += # (Optional) Frama-C general flags (parsing and kernel) FCFLAGS += \ -kernel-warn-key annot:missing-spec=abort \ -kernel-warn-key typing:implicit-function-declaration=abort \ # (Optional) Eva-specific flags EVAFLAGS += \ -eva-warn-key builtins:missing-spec=abort \ # (MANDATORY) Name of the main target MAIN_TARGET := # Remove these lines after defining the main target ifeq ($(MAIN_TARGET),) $(error MAIN_TARGET not defined in $(firstword $(MAKEFILE_LIST))) endif # Add other targets if needed TARGETS = $(MAIN_TARGET).eva # Default target all: $(TARGETS) # (MANDATORY) List of source files used by MAIN_TARGET. # If there is a JSON compilation database, # 'frama-c-script list-files' can help obtain it $(MAIN_TARGET).parse: # The following targets are optional and provided for convenience only parse: $(TARGETS:%.eva=%.parse) loop: $(TARGETS:%.eva=%.parse.loop) $(TARGETS:%=%.loop) gui: $(MAIN_TARGET).eva.gui # Run 'make .eva.loop' to obtain a .loop file, fine-tune it by hand, # then rename it to .slevel to prevent it from being overwritten. # If such file exists, use it to define per-function slevel values. ifneq (,$(wildcard $(MAIN_TARGET).slevel)) $(MAIN_TARGET).eva: \ EVAFLAGS += $(shell cat $(MAIN_TARGET).slevel | tr -d '\n\\') endif frama-c-20.0-Calcium/share/autocomplete_frama-c0000666000000000000000000000600613571573400016331 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # file: autocomplete_frama-c # bash completion for Frama-C # ========================== # # Installation # ============ # # To enable system-wide completion, put this file in /etc/bash_completion.d # If you want to enable Frama-C completion only for your account, append # this file to ~/.bash_completion. # # Assuming frama-c is in your PATH, # you can also put the following line into your .bashrc: # # source $(frama-c -print-share-path)/autocomplete_frama-c || true # # ----------------------------------------------------------------------------- _frama-c () { local cur local basic_options local sub_options COMPREPLY=() # Array variable storing the possible completions. local sub_comp_line="${COMP_LINE[@]:0:(${COMP_POINT})}" local sub_comp_set=( $sub_comp_line ) if [[ ${sub_comp_line: -1} == ' ' ]] ; then cur="" else cur="${sub_comp_set[@]: -1}" fi # Generate the completion matches and load them into $COMPREPLY array. case "$cur" in -*-*) sub_option="$(frama-c -autocomplete | grep -E -o " $cur[^*]+" |sort |uniq)"; COMPREPLY=( $( compgen -W "${sub_option}" -- $cur ) );; -*) basic_options="$(frama-c -autocomplete | grep -E -o " \-[^-]+-?" |sort |uniq)" COMPREPLY=( $( compgen -W "${basic_options}" -- $cur ) );; esac return 0 } complete -o nospace -f -F _frama-c filename frama-c complete -o nospace -f -F _frama-c filename frama-c-gui # Local Variables: # mode: sh # sh-shell: bash # End: frama-c-20.0-Calcium/share/compliance/0000777000000000000000000000000013571573400014427 5ustar frama-c-20.0-Calcium/share/compliance/c11_functions.json0000666000000000000000000007223613571573400020010 0ustar { "description": "C11 reserved function identifiers", "source":"ISO/IEC 9899:2011", "data":[ {"ident":"abort", "header":"stdlib.h"}, {"ident":"abort_handler_s", "header":"stdlib.h"}, {"ident":"abs", "header":"stdlib.h"}, {"ident":"acos", "header":"math.h"}, {"ident":"acosf", "header":"math.h"}, {"ident":"acosh", "header":"math.h"}, {"ident":"acoshf", "header":"math.h"}, {"ident":"acoshl", "header":"math.h"}, {"ident":"acosl", "header":"math.h"}, {"ident":"aligned_alloc", "header":"stdlib.h"}, {"ident":"asctime", "header":"time.h"}, {"ident":"asctime_s", "header":"time.h"}, {"ident":"asin", "header":"math.h"}, {"ident":"asinf", "header":"math.h"}, {"ident":"asinh", "header":"math.h"}, {"ident":"asinhf", "header":"math.h"}, {"ident":"asinhl", "header":"math.h"}, {"ident":"asinl", "header":"math.h"}, {"ident":"at_quick_exit", "header":"stdlib.h"}, {"ident":"atan", "header":"math.h"}, {"ident":"atan2", "header":"math.h"}, {"ident":"atan2f", "header":"math.h"}, {"ident":"atanf", "header":"math.h"}, {"ident":"atanh", "header":"math.h"}, {"ident":"atanhf", "header":"math.h"}, {"ident":"atanhl", "header":"math.h"}, {"ident":"atanl", "header":"math.h"}, {"ident":"atexit", "header":"stdlib.h"}, {"ident":"atof", "header":"stdlib.h"}, {"ident":"atoi", "header":"stdlib.h"}, {"ident":"atol", "header":"stdlib.h"}, {"ident":"atoll", "header":"stdlib.h"}, {"ident":"atomic_compare_exchange_strong", "header":"stdatomic.h"}, {"ident":"atomic_compare_exchange_strong_explicit", "header":"stdatomic.h"}, {"ident":"atomic_compare_exchange_weak", "header":"stdatomic.h"}, {"ident":"atomic_compare_exchange_weak_explicit", "header":"stdatomic.h"}, {"ident":"atomic_exchange", "header":"stdatomic.h"}, {"ident":"atomic_exchange_explicit", "header":"stdatomic.h"}, {"ident":"atomic_fetch_key", "header":"stdatomic.h"}, {"ident":"atomic_fetch_key_explicit", "header":"stdatomic.h"}, {"ident":"atomic_flag_clear", "header":"stdatomic.h"}, {"ident":"atomic_flag_clear_explicit", "header":"stdatomic.h"}, {"ident":"atomic_flag_test_and_set", "header":"stdatomic.h"}, {"ident":"atomic_flag_test_and_set_explicit", "header":"stdatomic.h"}, {"ident":"atomic_init", "header":"stdatomic.h"}, {"ident":"atomic_is_lock_free", "header":"stdatomic.h"}, {"ident":"atomic_load", "header":"stdatomic.h"}, {"ident":"atomic_load_explicit", "header":"stdatomic.h"}, {"ident":"atomic_signal_fence", "header":"stdatomic.h"}, {"ident":"atomic_store", "header":"stdatomic.h"}, {"ident":"atomic_store_explicit", "header":"stdatomic.h"}, {"ident":"atomic_thread_fence", "header":"stdatomic.h"}, {"ident":"bsearch", "header":"stdlib.h"}, {"ident":"bsearch_s", "header":"stdlib.h"}, {"ident":"btowc", "header":"wchar.h"}, {"ident":"c16rtomb", "header":"uchar.h"}, {"ident":"c32rtomb", "header":"uchar.h"}, {"ident":"cabs", "header":"complex.h"}, {"ident":"cabsf", "header":"complex.h"}, {"ident":"cabsl", "header":"complex.h"}, {"ident":"cacos", "header":"complex.h"}, {"ident":"cacosf", "header":"complex.h"}, {"ident":"cacosh", "header":"complex.h"}, {"ident":"cacoshf", "header":"complex.h"}, {"ident":"cacoshl", "header":"complex.h"}, {"ident":"cacosl", "header":"complex.h"}, {"ident":"call_once", "header":"threads.h"}, {"ident":"calloc", "header":"stdlib.h"}, {"ident":"carg", "header":"complex.h"}, {"ident":"cargf", "header":"complex.h"}, {"ident":"cargl", "header":"complex.h"}, {"ident":"casin", "header":"complex.h"}, {"ident":"casinf", "header":"complex.h"}, {"ident":"casinh", "header":"complex.h"}, {"ident":"casinhf", "header":"complex.h"}, {"ident":"casinhl", "header":"complex.h"}, {"ident":"casinl", "header":"complex.h"}, {"ident":"catan", "header":"complex.h"}, {"ident":"catanf", "header":"complex.h"}, {"ident":"catanh", "header":"complex.h"}, {"ident":"catanhf", "header":"complex.h"}, {"ident":"catanhl", "header":"complex.h"}, {"ident":"catanl", "header":"complex.h"}, {"ident":"cbrt", "header":"math.h"}, {"ident":"cbrtf", "header":"math.h"}, {"ident":"cbrtl", "header":"math.h"}, {"ident":"ccos", "header":"complex.h"}, {"ident":"ccosf", "header":"complex.h"}, {"ident":"ccosh", "header":"complex.h"}, {"ident":"ccoshf", "header":"complex.h"}, {"ident":"ccoshl", "header":"complex.h"}, {"ident":"ccosl", "header":"complex.h"}, {"ident":"ceil", "header":"math.h"}, {"ident":"ceilf", "header":"math.h"}, {"ident":"ceill", "header":"math.h"}, {"ident":"cexp", "header":"complex.h"}, {"ident":"cexpf", "header":"complex.h"}, {"ident":"cexpl", "header":"complex.h"}, {"ident":"cimag", "header":"complex.h"}, {"ident":"cimagf", "header":"complex.h"}, {"ident":"cimagl", "header":"complex.h"}, {"ident":"clearerr", "header":"stdio.h"}, {"ident":"clock", "header":"time.h"}, {"ident":"clog", "header":"complex.h"}, {"ident":"clogf", "header":"complex.h"}, {"ident":"clogl", "header":"complex.h"}, {"ident":"cnd_broadcast", "header":"threads.h"}, {"ident":"cnd_destroy", "header":"threads.h"}, {"ident":"cnd_init", "header":"threads.h"}, {"ident":"cnd_signal", "header":"threads.h"}, {"ident":"cnd_timedwait", "header":"threads.h"}, {"ident":"cnd_wait", "header":"threads.h"}, {"ident":"conj", "header":"complex.h"}, {"ident":"conjf", "header":"complex.h"}, {"ident":"conjl", "header":"complex.h"}, {"ident":"copysign", "header":"math.h"}, {"ident":"copysignf", "header":"math.h"}, {"ident":"copysignl", "header":"math.h"}, {"ident":"cos", "header":"math.h"}, {"ident":"cosf", "header":"math.h"}, {"ident":"cosh", "header":"math.h"}, {"ident":"coshf", "header":"math.h"}, {"ident":"coshl", "header":"math.h"}, {"ident":"cosl", "header":"math.h"}, {"ident":"cpow", "header":"complex.h"}, {"ident":"cpowf", "header":"complex.h"}, {"ident":"cpowl", "header":"complex.h"}, {"ident":"cproj", "header":"complex.h"}, {"ident":"cprojf", "header":"complex.h"}, {"ident":"cprojl", "header":"complex.h"}, {"ident":"creal", "header":"complex.h"}, {"ident":"crealf", "header":"complex.h"}, {"ident":"creall", "header":"complex.h"}, {"ident":"csin", "header":"complex.h"}, {"ident":"csinf", "header":"complex.h"}, {"ident":"csinh", "header":"complex.h"}, {"ident":"csinhf", "header":"complex.h"}, {"ident":"csinhl", "header":"complex.h"}, {"ident":"csinl", "header":"complex.h"}, {"ident":"csqrt", "header":"complex.h"}, {"ident":"csqrtf", "header":"complex.h"}, {"ident":"csqrtl", "header":"complex.h"}, {"ident":"ctan", "header":"complex.h"}, {"ident":"ctanf", "header":"complex.h"}, {"ident":"ctanh", "header":"complex.h"}, {"ident":"ctanhf", "header":"complex.h"}, {"ident":"ctanhl", "header":"complex.h"}, {"ident":"ctanl", "header":"complex.h"}, {"ident":"ctime", "header":"time.h"}, {"ident":"ctime_s", "header":"time.h"}, {"ident":"difftime", "header":"time.h"}, {"ident":"div", "header":"stdlib.h"}, {"ident":"erf", "header":"math.h"}, {"ident":"erfc", "header":"math.h"}, {"ident":"erfcf", "header":"math.h"}, {"ident":"erfcl", "header":"math.h"}, {"ident":"erff", "header":"math.h"}, {"ident":"erfl", "header":"math.h"}, {"ident":"exit", "header":"stdlib.h"}, {"ident":"exp", "header":"math.h"}, {"ident":"exp2", "header":"math.h"}, {"ident":"exp2f", "header":"math.h"}, {"ident":"exp2l", "header":"math.h"}, {"ident":"expf", "header":"math.h"}, {"ident":"expl", "header":"math.h"}, {"ident":"expm1", "header":"math.h"}, {"ident":"expm1f", "header":"math.h"}, {"ident":"expm1l", "header":"math.h"}, {"ident":"fabs", "header":"math.h"}, {"ident":"fabsf", "header":"math.h"}, {"ident":"fabsl", "header":"math.h"}, {"ident":"fclose", "header":"stdio.h"}, {"ident":"fdim", "header":"math.h"}, {"ident":"fdimf", "header":"math.h"}, {"ident":"fdiml", "header":"math.h"}, {"ident":"feclearexcept", "header":"fenv.h"}, {"ident":"fegetenv", "header":"fenv.h"}, {"ident":"fegetexceptflag", "header":"fenv.h"}, {"ident":"fegetround", "header":"fenv.h"}, {"ident":"feholdexcept", "header":"fenv.h"}, {"ident":"feof", "header":"stdio.h"}, {"ident":"feraiseexcept", "header":"fenv.h"}, {"ident":"ferror", "header":"stdio.h"}, {"ident":"fesetenv", "header":"fenv.h"}, {"ident":"fesetexceptflag", "header":"fenv.h"}, {"ident":"fesetround", "header":"fenv.h"}, {"ident":"fetestexcept", "header":"fenv.h"}, {"ident":"feupdateenv", "header":"fenv.h"}, {"ident":"fflush", "header":"stdio.h"}, {"ident":"fgetc", "header":"stdio.h"}, {"ident":"fgetpos", "header":"stdio.h"}, {"ident":"fgets", "header":"stdio.h"}, {"ident":"fgetwc", "header":"wchar.h"}, {"ident":"fgetws", "header":"wchar.h"}, {"ident":"floor", "header":"math.h"}, {"ident":"floorf", "header":"math.h"}, {"ident":"floorl", "header":"math.h"}, {"ident":"fma", "header":"math.h"}, {"ident":"fmaf", "header":"math.h"}, {"ident":"fmal", "header":"math.h"}, {"ident":"fmax", "header":"math.h"}, {"ident":"fmaxf", "header":"math.h"}, {"ident":"fmaxl", "header":"math.h"}, {"ident":"fmin", "header":"math.h"}, {"ident":"fminf", "header":"math.h"}, {"ident":"fminl", "header":"math.h"}, {"ident":"fmod", "header":"math.h"}, {"ident":"fmodf", "header":"math.h"}, {"ident":"fmodl", "header":"math.h"}, {"ident":"fopen", "header":"stdio.h"}, {"ident":"fopen_s", "header":"stdio.h"}, {"ident":"fpclassify", "header":"math.h"}, {"ident":"fprintf", "header":"stdio.h"}, {"ident":"fprintf_s", "header":"stdio.h"}, {"ident":"fputc", "header":"stdio.h"}, {"ident":"fputs", "header":"stdio.h"}, {"ident":"fputwc", "header":"wchar.h"}, {"ident":"fputws", "header":"wchar.h"}, {"ident":"fread", "header":"stdio.h"}, {"ident":"free", "header":"stdlib.h"}, {"ident":"freopen", "header":"stdio.h"}, {"ident":"freopen_s", "header":"stdio.h"}, {"ident":"frexp", "header":"math.h"}, {"ident":"frexpf", "header":"math.h"}, {"ident":"frexpl", "header":"math.h"}, {"ident":"fscanf", "header":"stdio.h"}, {"ident":"fscanf_s", "header":"stdio.h"}, {"ident":"fseek", "header":"stdio.h"}, {"ident":"fsetpos", "header":"stdio.h"}, {"ident":"ftell", "header":"stdio.h"}, {"ident":"fwide", "header":"wchar.h"}, {"ident":"fwprintf", "header":"wchar.h"}, {"ident":"fwprintf_s", "header":"wchar.h"}, {"ident":"fwrite", "header":"stdio.h"}, {"ident":"fwscanf", "header":"wchar.h"}, {"ident":"fwscanf_s", "header":"wchar.h"}, {"ident":"getc", "header":"stdio.h"}, {"ident":"getchar", "header":"stdio.h"}, {"ident":"getenv", "header":"stdlib.h"}, {"ident":"getenv_s", "header":"stdlib.h"}, {"ident":"gets_s", "header":"stdio.h"}, {"ident":"getwc", "header":"wchar.h"}, {"ident":"getwchar", "header":"wchar.h"}, {"ident":"gmtime", "header":"time.h"}, {"ident":"gmtime_s", "header":"time.h"}, {"ident":"hypot", "header":"math.h"}, {"ident":"hypotf", "header":"math.h"}, {"ident":"hypotl", "header":"math.h"}, {"ident":"ignore_handler_s", "header":"stdlib.h"}, {"ident":"ilogb", "header":"math.h"}, {"ident":"ilogbf", "header":"math.h"}, {"ident":"ilogbl", "header":"math.h"}, {"ident":"imaxabs", "header":"inttypes.h"}, {"ident":"imaxdiv", "header":"inttypes.h"}, {"ident":"isalnum", "header":"ctype.h"}, {"ident":"isalpha", "header":"ctype.h"}, {"ident":"isblank", "header":"ctype.h"}, {"ident":"iscntrl", "header":"ctype.h"}, {"ident":"isdigit", "header":"ctype.h"}, {"ident":"isfinite", "header":"math.h"}, {"ident":"isgraph", "header":"ctype.h"}, {"ident":"isgreater", "header":"math.h"}, {"ident":"isgreaterequal", "header":"math.h"}, {"ident":"isinf", "header":"math.h"}, {"ident":"isless", "header":"math.h"}, {"ident":"islessequal", "header":"math.h"}, {"ident":"islessgreater", "header":"math.h"}, {"ident":"islower", "header":"ctype.h"}, {"ident":"isnan", "header":"math.h"}, {"ident":"isnormal", "header":"math.h"}, {"ident":"isprint", "header":"ctype.h"}, {"ident":"ispunct", "header":"ctype.h"}, {"ident":"isspace", "header":"ctype.h"}, {"ident":"isunordered", "header":"math.h"}, {"ident":"isupper", "header":"ctype.h"}, {"ident":"iswalnum", "header":"wctype.h"}, {"ident":"iswalpha", "header":"wctype.h"}, {"ident":"iswblank", "header":"wctype.h"}, {"ident":"iswcntrl", "header":"wctype.h"}, {"ident":"iswctype", "header":"wctype.h"}, {"ident":"iswdigit", "header":"wctype.h"}, {"ident":"iswgraph", "header":"wctype.h"}, {"ident":"iswlower", "header":"wctype.h"}, {"ident":"iswprint", "header":"wctype.h"}, {"ident":"iswpunct", "header":"wctype.h"}, {"ident":"iswspace", "header":"wctype.h"}, {"ident":"iswupper", "header":"wctype.h"}, {"ident":"iswxdigit", "header":"wctype.h"}, {"ident":"isxdigit", "header":"ctype.h"}, {"ident":"kill_dependency", "header":"stdatomic.h"}, {"ident":"labs", "header":"stdlib.h"}, {"ident":"ldexp", "header":"math.h"}, {"ident":"ldexpf", "header":"math.h"}, {"ident":"ldexpl", "header":"math.h"}, {"ident":"ldiv", "header":"stdlib.h"}, {"ident":"lgamma", "header":"math.h"}, {"ident":"lgammaf", "header":"math.h"}, {"ident":"lgammal", "header":"math.h"}, {"ident":"llabs", "header":"stdlib.h"}, {"ident":"lldiv", "header":"stdlib.h"}, {"ident":"llrint", "header":"math.h"}, {"ident":"llrintf", "header":"math.h"}, {"ident":"llrintl", "header":"math.h"}, {"ident":"llround", "header":"math.h"}, {"ident":"llroundf", "header":"math.h"}, {"ident":"llroundl", "header":"math.h"}, {"ident":"localeconv", "header":"locale.h"}, {"ident":"localtime", "header":"time.h"}, {"ident":"localtime_s", "header":"time.h"}, {"ident":"log", "header":"math.h"}, {"ident":"log10", "header":"math.h"}, {"ident":"log10f", "header":"math.h"}, {"ident":"log10l", "header":"math.h"}, {"ident":"log1p", "header":"math.h"}, {"ident":"log1pf", "header":"math.h"}, {"ident":"log1pl", "header":"math.h"}, {"ident":"log2", "header":"math.h"}, {"ident":"log2f", "header":"math.h"}, {"ident":"log2l", "header":"math.h"}, {"ident":"logb", "header":"math.h"}, {"ident":"logbf", "header":"math.h"}, {"ident":"logbl", "header":"math.h"}, {"ident":"logf", "header":"math.h"}, {"ident":"logl", "header":"math.h"}, {"ident":"longjmp", "header":"setjmp.h"}, {"ident":"lrint", "header":"math.h"}, {"ident":"lrintf", "header":"math.h"}, {"ident":"lrintl", "header":"math.h"}, {"ident":"lround", "header":"math.h"}, {"ident":"lroundf", "header":"math.h"}, {"ident":"lroundl", "header":"math.h"}, {"ident":"malloc", "header":"stdlib.h"}, {"ident":"mblen", "header":"stdlib.h"}, {"ident":"mbrlen", "header":"wchar.h"}, {"ident":"mbrtoc16", "header":"uchar.h"}, {"ident":"mbrtoc32", "header":"uchar.h"}, {"ident":"mbrtowc", "header":"wchar.h"}, {"ident":"mbsinit", "header":"wchar.h"}, {"ident":"mbsrtowcs", "header":"wchar.h"}, {"ident":"mbsrtowcs_s", "header":"wchar.h"}, {"ident":"mbstowcs", "header":"stdlib.h"}, {"ident":"mbstowcs_s", "header":"stdlib.h"}, {"ident":"mbtowc", "header":"stdlib.h"}, {"ident":"memchr", "header":"string.h"}, {"ident":"memcmp", "header":"string.h"}, {"ident":"memcpy", "header":"string.h"}, {"ident":"memcpy_s", "header":"string.h"}, {"ident":"memmove", "header":"string.h"}, {"ident":"memmove_s", "header":"string.h"}, {"ident":"memset", "header":"string.h"}, {"ident":"memset_s", "header":"string.h"}, {"ident":"mktime", "header":"time.h"}, {"ident":"modf", "header":"math.h"}, {"ident":"modff", "header":"math.h"}, {"ident":"modfl", "header":"math.h"}, {"ident":"mtx_destroy", "header":"threads.h"}, {"ident":"mtx_init", "header":"threads.h"}, {"ident":"mtx_lock", "header":"threads.h"}, {"ident":"mtx_timedlock", "header":"threads.h"}, {"ident":"mtx_trylock", "header":"threads.h"}, {"ident":"mtx_unlock", "header":"threads.h"}, {"ident":"nan", "header":"math.h"}, {"ident":"nanf", "header":"math.h"}, {"ident":"nanl", "header":"math.h"}, {"ident":"nearbyint", "header":"math.h"}, {"ident":"nearbyintf", "header":"math.h"}, {"ident":"nearbyintl", "header":"math.h"}, {"ident":"nextafter", "header":"math.h"}, {"ident":"nextafterf", "header":"math.h"}, {"ident":"nextafterl", "header":"math.h"}, {"ident":"nexttoward", "header":"math.h"}, {"ident":"nexttowardf", "header":"math.h"}, {"ident":"nexttowardl", "header":"math.h"}, {"ident":"perror", "header":"stdio.h"}, {"ident":"pow", "header":"math.h"}, {"ident":"powf", "header":"math.h"}, {"ident":"powl", "header":"math.h"}, {"ident":"printf", "header":"stdio.h"}, {"ident":"printf_s", "header":"stdio.h"}, {"ident":"putc", "header":"stdio.h"}, {"ident":"putchar", "header":"stdio.h"}, {"ident":"puts", "header":"stdio.h"}, {"ident":"putwc", "header":"wchar.h"}, {"ident":"putwchar", "header":"wchar.h"}, {"ident":"qsort", "header":"stdlib.h"}, {"ident":"qsort_s", "header":"stdlib.h"}, {"ident":"quick_exit", "header":"stdlib.h"}, {"ident":"raise", "header":"signal.h"}, {"ident":"rand", "header":"stdlib.h"}, {"ident":"realloc", "header":"stdlib.h"}, {"ident":"remainder", "header":"math.h"}, {"ident":"remainderf", "header":"math.h"}, {"ident":"remainderl", "header":"math.h"}, {"ident":"remove", "header":"stdio.h"}, {"ident":"remquo", "header":"math.h"}, {"ident":"remquof", "header":"math.h"}, {"ident":"remquol", "header":"math.h"}, {"ident":"rename", "header":"stdio.h"}, {"ident":"rewind", "header":"stdio.h"}, {"ident":"rint", "header":"math.h"}, {"ident":"rintf", "header":"math.h"}, {"ident":"rintl", "header":"math.h"}, {"ident":"round", "header":"math.h"}, {"ident":"roundf", "header":"math.h"}, {"ident":"roundl", "header":"math.h"}, {"ident":"scalbln", "header":"math.h"}, {"ident":"scalblnf", "header":"math.h"}, {"ident":"scalblnl", "header":"math.h"}, {"ident":"scalbn", "header":"math.h"}, {"ident":"scalbnf", "header":"math.h"}, {"ident":"scalbnl", "header":"math.h"}, {"ident":"scanf", "header":"stdio.h"}, {"ident":"scanf_s", "header":"stdio.h"}, {"ident":"set_constraint_handler_s", "header":"stdlib.h"}, {"ident":"setbuf", "header":"stdio.h"}, {"ident":"setjmp", "header":"setjmp.h"}, {"ident":"setlocale", "header":"locale.h"}, {"ident":"setvbuf", "header":"stdio.h"}, {"ident":"signal", "header":"signal.h"}, {"ident":"signbit", "header":"math.h"}, {"ident":"sin", "header":"math.h"}, {"ident":"sinf", "header":"math.h"}, {"ident":"sinh", "header":"math.h"}, {"ident":"sinhf", "header":"math.h"}, {"ident":"sinhl", "header":"math.h"}, {"ident":"sinl", "header":"math.h"}, {"ident":"snprintf", "header":"stdio.h"}, {"ident":"snprintf_s", "header":"stdio.h"}, {"ident":"snwprintf_s", "header":"wchar.h"}, {"ident":"sprintf", "header":"stdio.h"}, {"ident":"sprintf_s", "header":"stdio.h"}, {"ident":"sqrt", "header":"math.h"}, {"ident":"sqrtf", "header":"math.h"}, {"ident":"sqrtl", "header":"math.h"}, {"ident":"srand", "header":"stdlib.h"}, {"ident":"sscanf", "header":"stdio.h"}, {"ident":"sscanf_s", "header":"stdio.h"}, {"ident":"strcat", "header":"string.h"}, {"ident":"strcat_s", "header":"string.h"}, {"ident":"strchr", "header":"string.h"}, {"ident":"strcmp", "header":"string.h"}, {"ident":"strcoll", "header":"string.h"}, {"ident":"strcpy", "header":"string.h"}, {"ident":"strcpy_s", "header":"string.h"}, {"ident":"strcspn", "header":"string.h"}, {"ident":"strerror", "header":"string.h"}, {"ident":"strerror_s", "header":"string.h"}, {"ident":"strerrorlen_s", "header":"string.h"}, {"ident":"strftime", "header":"time.h"}, {"ident":"strlen", "header":"string.h"}, {"ident":"strncat", "header":"string.h"}, {"ident":"strncat_s", "header":"string.h"}, {"ident":"strncmp", "header":"string.h"}, {"ident":"strncpy", "header":"string.h"}, {"ident":"strncpy_s", "header":"string.h"}, {"ident":"strnlen_s", "header":"string.h"}, {"ident":"strpbrk", "header":"string.h"}, {"ident":"strrchr", "header":"string.h"}, {"ident":"strspn", "header":"string.h"}, {"ident":"strstr", "header":"string.h"}, {"ident":"strtod", "header":"stdlib.h"}, {"ident":"strtof", "header":"stdlib.h"}, {"ident":"strtoimax", "header":"inttypes.h"}, {"ident":"strtok", "header":"string.h"}, {"ident":"strtok_s", "header":"string.h"}, {"ident":"strtol", "header":"stdlib.h"}, {"ident":"strtold", "header":"stdlib.h"}, {"ident":"strtoll", "header":"stdlib.h"}, {"ident":"strtoul", "header":"stdlib.h"}, {"ident":"strtoull", "header":"stdlib.h"}, {"ident":"strtoumax", "header":"inttypes.h"}, {"ident":"strxfrm", "header":"string.h"}, {"ident":"swprintf", "header":"wchar.h"}, {"ident":"swprintf_s", "header":"wchar.h"}, {"ident":"swscanf", "header":"wchar.h"}, {"ident":"swscanf_s", "header":"wchar.h"}, {"ident":"system", "header":"stdlib.h"}, {"ident":"tan", "header":"math.h"}, {"ident":"tanf", "header":"math.h"}, {"ident":"tanh", "header":"math.h"}, {"ident":"tanhf", "header":"math.h"}, {"ident":"tanhl", "header":"math.h"}, {"ident":"tanl", "header":"math.h"}, {"ident":"tgamma", "header":"math.h"}, {"ident":"tgammaf", "header":"math.h"}, {"ident":"tgammal", "header":"math.h"}, {"ident":"thrd_create", "header":"threads.h"}, {"ident":"thrd_current", "header":"threads.h"}, {"ident":"thrd_detach", "header":"threads.h"}, {"ident":"thrd_equal", "header":"threads.h"}, {"ident":"thrd_exit", "header":"threads.h"}, {"ident":"thrd_join", "header":"threads.h"}, {"ident":"thrd_sleep", "header":"threads.h"}, {"ident":"thrd_yield", "header":"threads.h"}, {"ident":"time", "header":"time.h"}, {"ident":"timespec_get", "header":"time.h"}, {"ident":"tmpfile", "header":"stdio.h"}, {"ident":"tmpfile_s", "header":"stdio.h"}, {"ident":"tmpnam", "header":"stdio.h"}, {"ident":"tmpnam_s", "header":"stdio.h"}, {"ident":"tolower", "header":"ctype.h"}, {"ident":"toupper", "header":"ctype.h"}, {"ident":"towctrans", "header":"wctype.h"}, {"ident":"towlower", "header":"wctype.h"}, {"ident":"towupper", "header":"wctype.h"}, {"ident":"trunc", "header":"math.h"}, {"ident":"truncf", "header":"math.h"}, {"ident":"truncl", "header":"math.h"}, {"ident":"tss_create", "header":"threads.h"}, {"ident":"tss_delete", "header":"threads.h"}, {"ident":"tss_get", "header":"threads.h"}, {"ident":"tss_set", "header":"threads.h"}, {"ident":"ungetc", "header":"stdio.h"}, {"ident":"ungetwc", "header":"wchar.h"}, {"ident":"va_arg", "header":"stdarg.h"}, {"ident":"va_copy", "header":"stdarg.h"}, {"ident":"va_end", "header":"stdarg.h"}, {"ident":"va_start", "header":"stdarg.h"}, {"ident":"vfprintf", "header":"stdio.h"}, {"ident":"vfprintf_s", "header":"stdio.h"}, {"ident":"vfscanf", "header":"stdio.h"}, {"ident":"vfscanf_s", "header":"stdio.h"}, {"ident":"vfwprintf", "header":"wchar.h"}, {"ident":"vfwprintf_s", "header":"wchar.h"}, {"ident":"vfwscanf", "header":"wchar.h"}, {"ident":"vfwscanf_s", "header":"wchar.h"}, {"ident":"vprintf", "header":"stdio.h"}, {"ident":"vprintf_s", "header":"stdio.h"}, {"ident":"vscanf", "header":"stdio.h"}, {"ident":"vscanf_s", "header":"stdio.h"}, {"ident":"vsnprintf", "header":"stdio.h"}, {"ident":"vsnprintf_s", "header":"stdio.h"}, {"ident":"vsnwprintf_s", "header":"wchar.h"}, {"ident":"vsprintf", "header":"stdio.h"}, {"ident":"vsprintf_s", "header":"stdio.h"}, {"ident":"vsscanf", "header":"stdio.h"}, {"ident":"vsscanf_s", "header":"stdio.h"}, {"ident":"vswprintf", "header":"wchar.h"}, {"ident":"vswprintf_s", "header":"wchar.h"}, {"ident":"vswscanf", "header":"wchar.h"}, {"ident":"vswscanf_s", "header":"wchar.h"}, {"ident":"vwprintf", "header":"wchar.h"}, {"ident":"vwprintf_s", "header":"wchar.h"}, {"ident":"vwscanf", "header":"wchar.h"}, {"ident":"vwscanf_s", "header":"wchar.h"}, {"ident":"wcrtomb", "header":"wchar.h"}, {"ident":"wcrtomb_s", "header":"wchar.h"}, {"ident":"wcscat", "header":"wchar.h"}, {"ident":"wcscat_s", "header":"wchar.h"}, {"ident":"wcschr", "header":"wchar.h"}, {"ident":"wcscmp", "header":"wchar.h"}, {"ident":"wcscoll", "header":"wchar.h"}, {"ident":"wcscpy", "header":"wchar.h"}, {"ident":"wcscpy_s", "header":"wchar.h"}, {"ident":"wcscspn", "header":"wchar.h"}, {"ident":"wcsftime", "header":"wchar.h"}, {"ident":"wcslen", "header":"wchar.h"}, {"ident":"wcsncat", "header":"wchar.h"}, {"ident":"wcsncat_s", "header":"wchar.h"}, {"ident":"wcsncmp", "header":"wchar.h"}, {"ident":"wcsncpy", "header":"wchar.h"}, {"ident":"wcsncpy_s", "header":"wchar.h"}, {"ident":"wcsnlen_s", "header":"wchar.h"}, {"ident":"wcspbrk", "header":"wchar.h"}, {"ident":"wcsrchr", "header":"wchar.h"}, {"ident":"wcsrtombs", "header":"wchar.h"}, {"ident":"wcsrtombs_s", "header":"wchar.h"}, {"ident":"wcsspn", "header":"wchar.h"}, {"ident":"wcsstr", "header":"wchar.h"}, {"ident":"wcstod", "header":"wchar.h"}, {"ident":"wcstof", "header":"wchar.h"}, {"ident":"wcstoimax", "header":"inttypes.h"}, {"ident":"wcstok", "header":"wchar.h"}, {"ident":"wcstok_s", "header":"wchar.h"}, {"ident":"wcstol", "header":"wchar.h"}, {"ident":"wcstold", "header":"wchar.h"}, {"ident":"wcstoll", "header":"wchar.h"}, {"ident":"wcstombs", "header":"stdlib.h"}, {"ident":"wcstombs_s", "header":"stdlib.h"}, {"ident":"wcstoul", "header":"wchar.h"}, {"ident":"wcstoull", "header":"wchar.h"}, {"ident":"wcstoumax", "header":"inttypes.h"}, {"ident":"wcsxfrm", "header":"wchar.h"}, {"ident":"wctob", "header":"wchar.h"}, {"ident":"wctomb", "header":"stdlib.h"}, {"ident":"wctomb_s", "header":"stdlib.h"}, {"ident":"wctrans", "header":"wctype.h"}, {"ident":"wctype", "header":"wctype.h"}, {"ident":"wmemchr", "header":"wchar.h"}, {"ident":"wmemcmp", "header":"wchar.h"}, {"ident":"wmemcpy", "header":"wchar.h"}, {"ident":"wmemcpy_s", "header":"wchar.h"}, {"ident":"wmemmove", "header":"wchar.h"}, {"ident":"wmemmove_s", "header":"wchar.h"}, {"ident":"wmemset", "header":"wchar.h"}, {"ident":"wprintf", "header":"wchar.h"}, {"ident":"wprintf_s", "header":"wchar.h"}, {"ident":"wscanf", "header":"wchar.h"}, {"ident":"wscanf_s", "header":"wchar.h"} ] } frama-c-20.0-Calcium/share/compliance/glibc_functions.json0000666000000000000000000013517413571573400020505 0ustar { "description": "Function and macro identifiers defined in the GNU C Library", "last_update": "2017-11", "source": "glibc - https://www.gnu.org/software/libc/manual/html_node/Function-Index.html", "data":[ {"ident":"__fbufsize"}, {"ident":"__flbf"}, {"ident":"__fpending"}, {"ident":"__fpurge"}, {"ident":"__freadable"}, {"ident":"__freading"}, {"ident":"__fsetlocking"}, {"ident":"__fwritable"}, {"ident":"__fwriting"}, {"ident":"__ppc_get_timebase"}, {"ident":"__ppc_get_timebase_freq"}, {"ident":"__ppc_mdoio"}, {"ident":"__ppc_mdoom"}, {"ident":"__ppc_set_ppr_low"}, {"ident":"__ppc_set_ppr_med"}, {"ident":"__ppc_set_ppr_med_high"}, {"ident":"__ppc_set_ppr_med_low"}, {"ident":"__ppc_set_ppr_very_low"}, {"ident":"__ppc_yield"}, {"ident":"__va_copy"}, {"ident":"_exit"}, {"ident":"_Exit"}, {"ident":"_flushlbf"}, {"ident":"_tolower"}, {"ident":"_toupper"}, {"ident":"a64l"}, {"ident":"abort"}, {"ident":"abs"}, {"ident":"accept"}, {"ident":"access"}, {"ident":"acos"}, {"ident":"acosf"}, {"ident":"acosfN"}, {"ident":"acosfNx"}, {"ident":"acosh"}, {"ident":"acoshf"}, {"ident":"acoshfN"}, {"ident":"acoshfNx"}, {"ident":"acoshl"}, {"ident":"acosl"}, {"ident":"addmntent"}, {"ident":"addseverity"}, {"ident":"adjtime"}, {"ident":"adjtimex"}, {"ident":"aio_cancel"}, {"ident":"aio_cancel64"}, {"ident":"aio_error"}, {"ident":"aio_error64"}, {"ident":"aio_fsync"}, {"ident":"aio_fsync64"}, {"ident":"aio_init"}, {"ident":"aio_read"}, {"ident":"aio_read64"}, {"ident":"aio_return"}, {"ident":"aio_return64"}, {"ident":"aio_suspend"}, {"ident":"aio_suspend64"}, {"ident":"aio_write"}, {"ident":"aio_write64"}, {"ident":"alarm"}, {"ident":"aligned_alloc"}, {"ident":"alloca"}, {"ident":"alphasort"}, {"ident":"alphasort64"}, {"ident":"argp_error"}, {"ident":"argp_failure"}, {"ident":"argp_help"}, {"ident":"argp_parse"}, {"ident":"argp_state_help"}, {"ident":"argp_usage"}, {"ident":"argz_add"}, {"ident":"argz_add_sep"}, {"ident":"argz_append"}, {"ident":"argz_count"}, {"ident":"argz_create"}, {"ident":"argz_create_sep"}, {"ident":"argz_delete"}, {"ident":"argz_extract"}, {"ident":"argz_insert"}, {"ident":"argz_next"}, {"ident":"argz_replace"}, {"ident":"argz_stringify"}, {"ident":"asctime"}, {"ident":"asctime_r"}, {"ident":"asin"}, {"ident":"asinf"}, {"ident":"asinfN"}, {"ident":"asinfNx"}, {"ident":"asinh"}, {"ident":"asinhf"}, {"ident":"asinhfN"}, {"ident":"asinhfNx"}, {"ident":"asinhl"}, {"ident":"asinl"}, {"ident":"asprintf"}, {"ident":"assert"}, {"ident":"assert_perror"}, {"ident":"atan"}, {"ident":"atan2"}, {"ident":"atan2f"}, {"ident":"atan2fN"}, {"ident":"atan2fNx"}, {"ident":"atan2l"}, {"ident":"atanf"}, {"ident":"atanfN"}, {"ident":"atanfNx"}, {"ident":"atanh"}, {"ident":"atanhf"}, {"ident":"atanhfN"}, {"ident":"atanhfNx"}, {"ident":"atanhl"}, {"ident":"atanl"}, {"ident":"atexit"}, {"ident":"atof"}, {"ident":"atoi"}, {"ident":"atol"}, {"ident":"atoll"}, {"ident":"backtrace"}, {"ident":"backtrace_symbols"}, {"ident":"backtrace_symbols_fd"}, {"ident":"basename"}, {"ident":"basename"}, {"ident":"bcmp"}, {"ident":"bcopy"}, {"ident":"bind"}, {"ident":"bind_textdomain_codeset"}, {"ident":"bindtextdomain"}, {"ident":"brk"}, {"ident":"bsearch"}, {"ident":"btowc"}, {"ident":"bzero"}, {"ident":"cabs"}, {"ident":"cabsf"}, {"ident":"cabsfN"}, {"ident":"cabsfNx"}, {"ident":"cabsl"}, {"ident":"cacos"}, {"ident":"cacosf"}, {"ident":"cacosfN"}, {"ident":"cacosfNx"}, {"ident":"cacosh"}, {"ident":"cacoshf"}, {"ident":"cacoshfN"}, {"ident":"cacoshfNx"}, {"ident":"cacoshl"}, {"ident":"cacosl"}, {"ident":"calloc"}, {"ident":"canonicalize"}, {"ident":"canonicalize_file_name"}, {"ident":"canonicalizef"}, {"ident":"canonicalizefN"}, {"ident":"canonicalizefNx"}, {"ident":"canonicalizel"}, {"ident":"carg"}, {"ident":"cargf"}, {"ident":"cargfN"}, {"ident":"cargfNx"}, {"ident":"cargl"}, {"ident":"casin"}, {"ident":"casinf"}, {"ident":"casinfN"}, {"ident":"casinfNx"}, {"ident":"casinh"}, {"ident":"casinhf"}, {"ident":"casinhfN"}, {"ident":"casinhfNx"}, {"ident":"casinhl"}, {"ident":"casinl"}, {"ident":"catan"}, {"ident":"catanf"}, {"ident":"catanfN"}, {"ident":"catanfNx"}, {"ident":"catanh"}, {"ident":"catanhf"}, {"ident":"catanhfN"}, {"ident":"catanhfNx"}, {"ident":"catanhl"}, {"ident":"catanl"}, {"ident":"catclose"}, {"ident":"catgets"}, {"ident":"catopen"}, {"ident":"cbc_crypt"}, {"ident":"cbrt"}, {"ident":"cbrtf"}, {"ident":"cbrtfN"}, {"ident":"cbrtfNx"}, {"ident":"cbrtl"}, {"ident":"ccos"}, {"ident":"ccosf"}, {"ident":"ccosfN"}, {"ident":"ccosfNx"}, {"ident":"ccosh"}, {"ident":"ccoshf"}, {"ident":"ccoshfN"}, {"ident":"ccoshfNx"}, {"ident":"ccoshl"}, {"ident":"ccosl"}, {"ident":"ceil"}, {"ident":"ceilf"}, {"ident":"ceilfN"}, {"ident":"ceilfNx"}, {"ident":"ceill"}, {"ident":"cexp"}, {"ident":"cexpf"}, {"ident":"cexpfN"}, {"ident":"cexpfNx"}, {"ident":"cexpl"}, {"ident":"cfgetispeed"}, {"ident":"cfgetospeed"}, {"ident":"cfmakeraw"}, {"ident":"cfsetispeed"}, {"ident":"cfsetospeed"}, {"ident":"cfsetspeed"}, {"ident":"chdir"}, {"ident":"chmod"}, {"ident":"chmod"}, {"ident":"chown"}, {"ident":"cimag"}, {"ident":"cimagf"}, {"ident":"cimagfN"}, {"ident":"cimagfNx"}, {"ident":"cimagl"}, {"ident":"clearenv"}, {"ident":"clearerr"}, {"ident":"clearerr_unlocked"}, {"ident":"clock"}, {"ident":"clog"}, {"ident":"clog10"}, {"ident":"clog10f"}, {"ident":"clog10fN"}, {"ident":"clog10fNx"}, {"ident":"clog10l"}, {"ident":"clogf"}, {"ident":"clogfN"}, {"ident":"clogfNx"}, {"ident":"clogl"}, {"ident":"close"}, {"ident":"closedir"}, {"ident":"closelog"}, {"ident":"confstr"}, {"ident":"conj"}, {"ident":"conjf"}, {"ident":"conjfN"}, {"ident":"conjfNx"}, {"ident":"conjl"}, {"ident":"connect"}, {"ident":"continue"}, {"ident":"copysign"}, {"ident":"copysignf"}, {"ident":"copysignfN"}, {"ident":"copysignfNx"}, {"ident":"copysignl"}, {"ident":"cos"}, {"ident":"cosf"}, {"ident":"cosfN"}, {"ident":"cosfNx"}, {"ident":"cosh"}, {"ident":"coshf"}, {"ident":"coshfN"}, {"ident":"coshfNx"}, {"ident":"coshl"}, {"ident":"cosl"}, {"ident":"cpow"}, {"ident":"cpowf"}, {"ident":"cpowfN"}, {"ident":"cpowfNx"}, {"ident":"cpowl"}, {"ident":"cproj"}, {"ident":"cprojf"}, {"ident":"cprojfN"}, {"ident":"cprojfNx"}, {"ident":"cprojl"}, {"ident":"CPU_CLR"}, {"ident":"CPU_ISSET"}, {"ident":"CPU_SET"}, {"ident":"CPU_ZERO"}, {"ident":"creal"}, {"ident":"crealf"}, {"ident":"crealfN"}, {"ident":"crealfNx"}, {"ident":"creall"}, {"ident":"creat"}, {"ident":"creat64"}, {"ident":"crypt"}, {"ident":"crypt_r"}, {"ident":"csin"}, {"ident":"csinf"}, {"ident":"csinfN"}, {"ident":"csinfNx"}, {"ident":"csinh"}, {"ident":"csinhf"}, {"ident":"csinhfN"}, {"ident":"csinhfNx"}, {"ident":"csinhl"}, {"ident":"csinl"}, {"ident":"csqrt"}, {"ident":"csqrtf"}, {"ident":"csqrtfN"}, {"ident":"csqrtfNx"}, {"ident":"csqrtl"}, {"ident":"ctan"}, {"ident":"ctanf"}, {"ident":"ctanfN"}, {"ident":"ctanfNx"}, {"ident":"ctanh"}, {"ident":"ctanhf"}, {"ident":"ctanhfN"}, {"ident":"ctanhfNx"}, {"ident":"ctanhl"}, {"ident":"ctanl"}, {"ident":"ctermid"}, {"ident":"ctime"}, {"ident":"ctime_r"}, {"ident":"cuserid"}, {"ident":"dcgettext"}, {"ident":"dcngettext"}, {"ident":"DES_FAILED"}, {"ident":"des_setparity"}, {"ident":"dgettext"}, {"ident":"difftime"}, {"ident":"dirfd"}, {"ident":"dirname"}, {"ident":"div"}, {"ident":"dngettext"}, {"ident":"drand48"}, {"ident":"drand48_r"}, {"ident":"drem"}, {"ident":"dremf"}, {"ident":"dreml"}, {"ident":"DTTOIF"}, {"ident":"dup"}, {"ident":"dup2"}, {"ident":"ecb_crypt"}, {"ident":"ecvt"}, {"ident":"ecvt_r"}, {"ident":"encrypt"}, {"ident":"encrypt_r"}, {"ident":"endfsent"}, {"ident":"endgrent"}, {"ident":"endhostent"}, {"ident":"endmntent"}, {"ident":"endnetent"}, {"ident":"endnetgrent"}, {"ident":"endprotoent"}, {"ident":"endpwent"}, {"ident":"endservent"}, {"ident":"endutent"}, {"ident":"endutxent"}, {"ident":"envz_add"}, {"ident":"envz_entry"}, {"ident":"envz_get"}, {"ident":"envz_merge"}, {"ident":"envz_remove"}, {"ident":"envz_strip"}, {"ident":"erand48"}, {"ident":"erand48_r"}, {"ident":"erf"}, {"ident":"erfc"}, {"ident":"erfcf"}, {"ident":"erfcfN"}, {"ident":"erfcfNx"}, {"ident":"erfcl"}, {"ident":"erff"}, {"ident":"erffN"}, {"ident":"erffNx"}, {"ident":"erfl"}, {"ident":"err"}, {"ident":"error"}, {"ident":"error_at_line"}, {"ident":"errx"}, {"ident":"execl"}, {"ident":"execle"}, {"ident":"execlp"}, {"ident":"execv"}, {"ident":"execve"}, {"ident":"execvp"}, {"ident":"exit"}, {"ident":"exp"}, {"ident":"exp10"}, {"ident":"exp10f"}, {"ident":"exp10fN"}, {"ident":"exp10fNx"}, {"ident":"exp10l"}, {"ident":"exp2"}, {"ident":"exp2f"}, {"ident":"exp2fN"}, {"ident":"exp2fNx"}, {"ident":"exp2l"}, {"ident":"expf"}, {"ident":"expfN"}, {"ident":"expfNx"}, {"ident":"expl"}, {"ident":"explicit_bzero"}, {"ident":"expm1"}, {"ident":"expm1f"}, {"ident":"expm1fN"}, {"ident":"expm1fNx"}, {"ident":"expm1l"}, {"ident":"fabs"}, {"ident":"fabsf"}, {"ident":"fabsfN"}, {"ident":"fabsfNx"}, {"ident":"fabsl"}, {"ident":"fchdir"}, {"ident":"fchmod"}, {"ident":"fchown"}, {"ident":"fclose"}, {"ident":"fcloseall"}, {"ident":"fcntl"}, {"ident":"fcvt"}, {"ident":"fcvt_r"}, {"ident":"FD_CLR"}, {"ident":"FD_ISSET"}, {"ident":"FD_SET"}, {"ident":"FD_ZERO"}, {"ident":"fdatasync"}, {"ident":"fdim"}, {"ident":"fdimf"}, {"ident":"fdimfN"}, {"ident":"fdimfNx"}, {"ident":"fdiml"}, {"ident":"fdopen"}, {"ident":"fdopendir"}, {"ident":"feclearexcept"}, {"ident":"fedisableexcept"}, {"ident":"feenableexcept"}, {"ident":"fegetenv"}, {"ident":"fegetexcept"}, {"ident":"fegetexceptflag"}, {"ident":"fegetmode"}, {"ident":"fegetround"}, {"ident":"feholdexcept"}, {"ident":"feof"}, {"ident":"feof_unlocked"}, {"ident":"feraiseexcept"}, {"ident":"ferror"}, {"ident":"ferror_unlocked"}, {"ident":"fesetenv"}, {"ident":"fesetexcept"}, {"ident":"fesetexceptflag"}, {"ident":"fesetmode"}, {"ident":"fesetround"}, {"ident":"fetestexcept"}, {"ident":"fetestexceptflag"}, {"ident":"feupdateenv"}, {"ident":"fflush"}, {"ident":"fflush_unlocked"}, {"ident":"fgetc"}, {"ident":"fgetc_unlocked"}, {"ident":"fgetgrent"}, {"ident":"fgetgrent_r"}, {"ident":"fgetpos"}, {"ident":"fgetpos64"}, {"ident":"fgetpwent"}, {"ident":"fgetpwent_r"}, {"ident":"fgets"}, {"ident":"fgets_unlocked"}, {"ident":"fgetwc"}, {"ident":"fgetwc_unlocked"}, {"ident":"fgetws"}, {"ident":"fgetws_unlocked"}, {"ident":"fileno"}, {"ident":"fileno_unlocked"}, {"ident":"finite"}, {"ident":"finitef"}, {"ident":"finitel"}, {"ident":"flockfile"}, {"ident":"floor"}, {"ident":"floorf"}, {"ident":"floorfN"}, {"ident":"floorfNx"}, {"ident":"floorl"}, {"ident":"fma"}, {"ident":"fmaf"}, {"ident":"fmafN"}, {"ident":"fmafNx"}, {"ident":"fmal"}, {"ident":"fmax"}, {"ident":"fmaxf"}, {"ident":"fmaxfN"}, {"ident":"fmaxfNx"}, {"ident":"fmaxl"}, {"ident":"fmaxmag"}, {"ident":"fmaxmagf"}, {"ident":"fmaxmagfN"}, {"ident":"fmaxmagfNx"}, {"ident":"fmaxmagl"}, {"ident":"fmemopen"}, {"ident":"fmin"}, {"ident":"fminf"}, {"ident":"fminfN"}, {"ident":"fminfNx"}, {"ident":"fminl"}, {"ident":"fminmag"}, {"ident":"fminmagf"}, {"ident":"fminmagfN"}, {"ident":"fminmagfNx"}, {"ident":"fminmagl"}, {"ident":"fmod"}, {"ident":"fmodf"}, {"ident":"fmodfN"}, {"ident":"fmodfNx"}, {"ident":"fmodl"}, {"ident":"fmtmsg"}, {"ident":"fnmatch"}, {"ident":"fopen"}, {"ident":"fopen64"}, {"ident":"fopencookie"}, {"ident":"fork"}, {"ident":"forkpty"}, {"ident":"fpathconf"}, {"ident":"fpclassify"}, {"ident":"fprintf"}, {"ident":"fputc"}, {"ident":"fputc_unlocked"}, {"ident":"fputs"}, {"ident":"fputs_unlocked"}, {"ident":"fputwc"}, {"ident":"fputwc_unlocked"}, {"ident":"fputws"}, {"ident":"fputws_unlocked"}, {"ident":"fread"}, {"ident":"fread_unlocked"}, {"ident":"free"}, {"ident":"freopen"}, {"ident":"freopen64"}, {"ident":"frexp"}, {"ident":"frexpf"}, {"ident":"frexpfN"}, {"ident":"frexpfNx"}, {"ident":"frexpl"}, {"ident":"fromfp"}, {"ident":"fromfpf"}, {"ident":"fromfpfN"}, {"ident":"fromfpfNx"}, {"ident":"fromfpl"}, {"ident":"fromfpx"}, {"ident":"fromfpxf"}, {"ident":"fromfpxfN"}, {"ident":"fromfpxfNx"}, {"ident":"fromfpxl"}, {"ident":"fscanf"}, {"ident":"fseek"}, {"ident":"fseeko"}, {"ident":"fseeko64"}, {"ident":"fsetpos"}, {"ident":"fsetpos64"}, {"ident":"fstat"}, {"ident":"fstat64"}, {"ident":"fsync"}, {"ident":"ftell"}, {"ident":"ftello"}, {"ident":"ftello64"}, {"ident":"ftruncate"}, {"ident":"ftruncate64"}, {"ident":"ftrylockfile"}, {"ident":"ftw"}, {"ident":"ftw64"}, {"ident":"funlockfile"}, {"ident":"futimes"}, {"ident":"fwide"}, {"ident":"fwprintf"}, {"ident":"fwrite"}, {"ident":"fwrite_unlocked"}, {"ident":"fwscanf"}, {"ident":"gamma"}, {"ident":"gammaf"}, {"ident":"gammal"}, {"ident":"gcvt"}, {"ident":"get_avphys_pages"}, {"ident":"get_current_dir_name"}, {"ident":"get_nprocs"}, {"ident":"get_nprocs_conf"}, {"ident":"get_phys_pages"}, {"ident":"getauxval"}, {"ident":"getc"}, {"ident":"getc_unlocked"}, {"ident":"getchar"}, {"ident":"getchar_unlocked"}, {"ident":"getcontext"}, {"ident":"getcwd"}, {"ident":"getdate"}, {"ident":"getdate_r"}, {"ident":"getdelim"}, {"ident":"getdomainnname"}, {"ident":"getegid"}, {"ident":"getentropy"}, {"ident":"getenv"}, {"ident":"geteuid"}, {"ident":"getfsent"}, {"ident":"getfsfile"}, {"ident":"getfsspec"}, {"ident":"getgid"}, {"ident":"getgrent"}, {"ident":"getgrent_r"}, {"ident":"getgrgid"}, {"ident":"getgrgid_r"}, {"ident":"getgrnam"}, {"ident":"getgrnam_r"}, {"ident":"getgrouplist"}, {"ident":"getgroups"}, {"ident":"gethostbyaddr"}, {"ident":"gethostbyaddr_r"}, {"ident":"gethostbyname"}, {"ident":"gethostbyname2"}, {"ident":"gethostbyname2_r"}, {"ident":"gethostbyname_r"}, {"ident":"gethostent"}, {"ident":"gethostid"}, {"ident":"gethostname"}, {"ident":"getitimer"}, {"ident":"getline"}, {"ident":"getloadavg"}, {"ident":"getlogin"}, {"ident":"getmntent"}, {"ident":"getmntent_r"}, {"ident":"getnetbyaddr"}, {"ident":"getnetbyname"}, {"ident":"getnetent"}, {"ident":"getnetgrent"}, {"ident":"getnetgrent_r"}, {"ident":"getopt"}, {"ident":"getopt_long"}, {"ident":"getopt_long_only"}, {"ident":"getpagesize"}, {"ident":"getpass"}, {"ident":"getpayload"}, {"ident":"getpayloadf"}, {"ident":"getpayloadfN"}, {"ident":"getpayloadfNx"}, {"ident":"getpayloadl"}, {"ident":"getpeername"}, {"ident":"getpgid"}, {"ident":"getpgrp"}, {"ident":"getpid"}, {"ident":"getppid"}, {"ident":"getpriority"}, {"ident":"getprotobyname"}, {"ident":"getprotobynumber"}, {"ident":"getprotoent"}, {"ident":"getpt"}, {"ident":"getpwent"}, {"ident":"getpwent_r"}, {"ident":"getpwnam"}, {"ident":"getpwnam_r"}, {"ident":"getpwuid"}, {"ident":"getpwuid_r"}, {"ident":"getrandom"}, {"ident":"getrlimit"}, {"ident":"getrlimit64"}, {"ident":"getrusage"}, {"ident":"gets"}, {"ident":"getservbyname"}, {"ident":"getservbyport"}, {"ident":"getservent"}, {"ident":"getsid"}, {"ident":"getsockname"}, {"ident":"getsockopt"}, {"ident":"getsubopt"}, {"ident":"gettext"}, {"ident":"gettimeofday"}, {"ident":"getuid"}, {"ident":"getumask"}, {"ident":"getutent"}, {"ident":"getutent_r"}, {"ident":"getutid"}, {"ident":"getutid_r"}, {"ident":"getutline"}, {"ident":"getutline_r"}, {"ident":"getutmp"}, {"ident":"getutmpx"}, {"ident":"getutxent"}, {"ident":"getutxid"}, {"ident":"getutxline"}, {"ident":"getw"}, {"ident":"getwc"}, {"ident":"getwc_unlocked"}, {"ident":"getwchar"}, {"ident":"getwchar_unlocked"}, {"ident":"getwd"}, {"ident":"glob"}, {"ident":"glob64"}, {"ident":"globfree"}, {"ident":"globfree64"}, {"ident":"gmtime"}, {"ident":"gmtime_r"}, {"ident":"grantpt"}, {"ident":"grantpt"}, {"ident":"gsignal"}, {"ident":"gtty"}, {"ident":"hasmntopt"}, {"ident":"hcreate"}, {"ident":"hcreate_r"}, {"ident":"hdestroy"}, {"ident":"hdestroy_r"}, {"ident":"hsearch"}, {"ident":"hsearch_r"}, {"ident":"htonl"}, {"ident":"htons"}, {"ident":"hypot"}, {"ident":"hypotf"}, {"ident":"hypotfN"}, {"ident":"hypotfNx"}, {"ident":"hypotl"}, {"ident":"iconv"}, {"ident":"iconv_close"}, {"ident":"iconv_open"}, {"ident":"if_freenameindex"}, {"ident":"if_indextoname"}, {"ident":"if_nameindex"}, {"ident":"if_nametoindex"}, {"ident":"IFTODT"}, {"ident":"ilogb"}, {"ident":"ilogbf"}, {"ident":"ilogbfN"}, {"ident":"ilogbfNx"}, {"ident":"ilogbl"}, {"ident":"imaxabs"}, {"ident":"imaxdiv"}, {"ident":"index"}, {"ident":"inet_addr"}, {"ident":"inet_aton"}, {"ident":"inet_lnaof"}, {"ident":"inet_makeaddr"}, {"ident":"inet_netof"}, {"ident":"inet_network"}, {"ident":"inet_ntoa"}, {"ident":"inet_ntop"}, {"ident":"inet_pton"}, {"ident":"initgroups"}, {"ident":"initstate"}, {"ident":"initstate_r"}, {"ident":"innetgr"}, {"ident":"ioctl"}, {"ident":"isalnum"}, {"ident":"isalpha"}, {"ident":"isascii"}, {"ident":"isatty"}, {"ident":"isblank"}, {"ident":"iscanonical"}, {"ident":"iscntrl"}, {"ident":"isdigit"}, {"ident":"iseqsig"}, {"ident":"isfinite"}, {"ident":"isgraph"}, {"ident":"isgreater"}, {"ident":"isgreaterequal"}, {"ident":"isinf"}, {"ident":"isinff"}, {"ident":"isinfl"}, {"ident":"isless"}, {"ident":"islessequal"}, {"ident":"islessgreater"}, {"ident":"islower"}, {"ident":"isnan"}, {"ident":"isnan"}, {"ident":"isnanf"}, {"ident":"isnanl"}, {"ident":"isnormal"}, {"ident":"isprint"}, {"ident":"ispunct"}, {"ident":"issignaling"}, {"ident":"isspace"}, {"ident":"issubnormal"}, {"ident":"isunordered"}, {"ident":"isupper"}, {"ident":"iswalnum"}, {"ident":"iswalpha"}, {"ident":"iswblank"}, {"ident":"iswcntrl"}, {"ident":"iswctype"}, {"ident":"iswdigit"}, {"ident":"iswgraph"}, {"ident":"iswlower"}, {"ident":"iswprint"}, {"ident":"iswpunct"}, {"ident":"iswspace"}, {"ident":"iswupper"}, {"ident":"iswxdigit"}, {"ident":"isxdigit"}, {"ident":"iszero"}, {"ident":"j0"}, {"ident":"j0f"}, {"ident":"j0fN"}, {"ident":"j0fNx"}, {"ident":"j0l"}, {"ident":"j1"}, {"ident":"j1f"}, {"ident":"j1fN"}, {"ident":"j1fNx"}, {"ident":"j1l"}, {"ident":"jn"}, {"ident":"jnf"}, {"ident":"jnfN"}, {"ident":"jnfNx"}, {"ident":"jnl"}, {"ident":"jrand48"}, {"ident":"jrand48_r"}, {"ident":"kill"}, {"ident":"killpg"}, {"ident":"l64a"}, {"ident":"labs"}, {"ident":"lcong48"}, {"ident":"lcong48_r"}, {"ident":"ldexp"}, {"ident":"ldexpf"}, {"ident":"ldexpfN"}, {"ident":"ldexpfNx"}, {"ident":"ldexpl"}, {"ident":"ldiv"}, {"ident":"lfind"}, {"ident":"lgamma"}, {"ident":"lgamma_r"}, {"ident":"lgammaf"}, {"ident":"lgammaf_r"}, {"ident":"lgammafN"}, {"ident":"lgammafN_r"}, {"ident":"lgammafNx"}, {"ident":"lgammafNx_r"}, {"ident":"lgammal"}, {"ident":"lgammal_r"}, {"ident":"link"}, {"ident":"lio_listio"}, {"ident":"lio_listio64"}, {"ident":"listen"}, {"ident":"llabs"}, {"ident":"lldiv"}, {"ident":"llogb"}, {"ident":"llogbf"}, {"ident":"llogbfN"}, {"ident":"llogbfNx"}, {"ident":"llogbl"}, {"ident":"llrint"}, {"ident":"llrintf"}, {"ident":"llrintfN"}, {"ident":"llrintfNx"}, {"ident":"llrintl"}, {"ident":"llround"}, {"ident":"llroundf"}, {"ident":"llroundfN"}, {"ident":"llroundfNx"}, {"ident":"llroundl"}, {"ident":"localeconv"}, {"ident":"localtime"}, {"ident":"localtime_r"}, {"ident":"log"}, {"ident":"log10"}, {"ident":"log10f"}, {"ident":"log10fN"}, {"ident":"log10fNx"}, {"ident":"log10l"}, {"ident":"log1p"}, {"ident":"log1pf"}, {"ident":"log1pfN"}, {"ident":"log1pfNx"}, {"ident":"log1pl"}, {"ident":"log2"}, {"ident":"log2f"}, {"ident":"log2fN"}, {"ident":"log2fNx"}, {"ident":"log2l"}, {"ident":"logb"}, {"ident":"logbf"}, {"ident":"logbfN"}, {"ident":"logbfNx"}, {"ident":"logbl"}, {"ident":"logf"}, {"ident":"logfN"}, {"ident":"logfNx"}, {"ident":"login"}, {"ident":"login_tty"}, {"ident":"logl"}, {"ident":"logout"}, {"ident":"logwtmp"}, {"ident":"longjmp"}, {"ident":"lrand48"}, {"ident":"lrand48_r"}, {"ident":"lrint"}, {"ident":"lrintf"}, {"ident":"lrintfN"}, {"ident":"lrintfNx"}, {"ident":"lrintl"}, {"ident":"lround"}, {"ident":"lroundf"}, {"ident":"lroundfN"}, {"ident":"lroundfNx"}, {"ident":"lroundl"}, {"ident":"lsearch"}, {"ident":"lseek"}, {"ident":"lseek64"}, {"ident":"lstat"}, {"ident":"lstat64"}, {"ident":"lutimes"}, {"ident":"madvise"}, {"ident":"main"}, {"ident":"makecontext"}, {"ident":"mallinfo"}, {"ident":"malloc"}, {"ident":"mallopt"}, {"ident":"matherr"}, {"ident":"mblen"}, {"ident":"mbrlen"}, {"ident":"mbrtowc"}, {"ident":"mbsinit"}, {"ident":"mbsnrtowcs"}, {"ident":"mbsrtowcs"}, {"ident":"mbstowcs"}, {"ident":"mbtowc"}, {"ident":"mcheck"}, {"ident":"memalign"}, {"ident":"memccpy"}, {"ident":"memchr"}, {"ident":"memcmp"}, {"ident":"memcpy"}, {"ident":"memfrob"}, {"ident":"memmem"}, {"ident":"memmove"}, {"ident":"mempcpy"}, {"ident":"memrchr"}, {"ident":"memset"}, {"ident":"merge"}, {"ident":"mkdir"}, {"ident":"mkdtemp"}, {"ident":"mkfifo"}, {"ident":"mknod"}, {"ident":"mkstemp"}, {"ident":"mktemp"}, {"ident":"mktime"}, {"ident":"mlock"}, {"ident":"mlockall"}, {"ident":"mmap"}, {"ident":"mmap64"}, {"ident":"modf"}, {"ident":"modff"}, {"ident":"modffN"}, {"ident":"modffNx"}, {"ident":"modfl"}, {"ident":"mount"}, {"ident":"mprobe"}, {"ident":"mrand48"}, {"ident":"mrand48_r"}, {"ident":"mremap"}, {"ident":"msync"}, {"ident":"mtrace"}, {"ident":"munlock"}, {"ident":"munlockall"}, {"ident":"munmap"}, {"ident":"muntrace"}, {"ident":"nan"}, {"ident":"nanf"}, {"ident":"nanfN"}, {"ident":"nanfNx"}, {"ident":"nanl"}, {"ident":"nanosleep"}, {"ident":"nearbyint"}, {"ident":"nearbyintf"}, {"ident":"nearbyintfN"}, {"ident":"nearbyintfNx"}, {"ident":"nearbyintl"}, {"ident":"nextafter"}, {"ident":"nextafterf"}, {"ident":"nextafterfN"}, {"ident":"nextafterfNx"}, {"ident":"nextafterl"}, {"ident":"nextdown"}, {"ident":"nextdownf"}, {"ident":"nextdownfN"}, {"ident":"nextdownfNx"}, {"ident":"nextdownl"}, {"ident":"nexttoward"}, {"ident":"nexttowardf"}, {"ident":"nexttowardl"}, {"ident":"nextup"}, {"ident":"nextupf"}, {"ident":"nextupfN"}, {"ident":"nextupfNx"}, {"ident":"nextupl"}, {"ident":"nftw"}, {"ident":"nftw64"}, {"ident":"ngettext"}, {"ident":"nice"}, {"ident":"nl_langinfo"}, {"ident":"notfound"}, {"ident":"nrand48"}, {"ident":"nrand48_r"}, {"ident":"ntohl"}, {"ident":"ntohs"}, {"ident":"ntp_adjtime"}, {"ident":"ntp_gettime"}, {"ident":"obstack_1grow"}, {"ident":"obstack_1grow_fast"}, {"ident":"obstack_alignment_mask"}, {"ident":"obstack_alloc"}, {"ident":"obstack_base"}, {"ident":"obstack_blank"}, {"ident":"obstack_blank_fast"}, {"ident":"obstack_chunk_alloc"}, {"ident":"obstack_chunk_free"}, {"ident":"obstack_chunk_size"}, {"ident":"obstack_copy"}, {"ident":"obstack_copy0"}, {"ident":"obstack_finish"}, {"ident":"obstack_free"}, {"ident":"obstack_grow"}, {"ident":"obstack_grow0"}, {"ident":"obstack_init"}, {"ident":"obstack_int_grow"}, {"ident":"obstack_int_grow_fast"}, {"ident":"obstack_next_free"}, {"ident":"obstack_object_size"}, {"ident":"obstack_object_size"}, {"ident":"obstack_printf"}, {"ident":"obstack_ptr_grow"}, {"ident":"obstack_ptr_grow_fast"}, {"ident":"obstack_room"}, {"ident":"obstack_vprintf"}, {"ident":"offsetof"}, {"ident":"on_exit"}, {"ident":"open"}, {"ident":"open64"}, {"ident":"open_memstream"}, {"ident":"opendir"}, {"ident":"openlog"}, {"ident":"openpty"}, {"ident":"parse_printf_format"}, {"ident":"pathconf"}, {"ident":"pause"}, {"ident":"pclose"}, {"ident":"perror"}, {"ident":"pipe"}, {"ident":"popen"}, {"ident":"posix_fallocate"}, {"ident":"posix_fallocate64"}, {"ident":"posix_memalign"}, {"ident":"pow"}, {"ident":"pow10"}, {"ident":"pow10f"}, {"ident":"pow10l"}, {"ident":"powf"}, {"ident":"powfN"}, {"ident":"powfNx"}, {"ident":"powl"}, {"ident":"pread"}, {"ident":"pread64"}, {"ident":"preadv"}, {"ident":"preadv2"}, {"ident":"preadv64"}, {"ident":"preadv64v2"}, {"ident":"printf"}, {"ident":"printf_size"}, {"ident":"printf_size_info"}, {"ident":"psignal"}, {"ident":"pthread_getattr_default_np"}, {"ident":"pthread_getspecific"}, {"ident":"pthread_key_create"}, {"ident":"pthread_key_delete"}, {"ident":"pthread_setattr_default_np"}, {"ident":"pthread_setspecific"}, {"ident":"ptsname"}, {"ident":"ptsname_r"}, {"ident":"putc"}, {"ident":"putc_unlocked"}, {"ident":"putchar"}, {"ident":"putchar_unlocked"}, {"ident":"putenv"}, {"ident":"putpwent"}, {"ident":"puts"}, {"ident":"pututline"}, {"ident":"pututxline"}, {"ident":"putw"}, {"ident":"putwc"}, {"ident":"putwc_unlocked"}, {"ident":"putwchar"}, {"ident":"putwchar_unlocked"}, {"ident":"pwrite"}, {"ident":"pwrite64"}, {"ident":"pwritev"}, {"ident":"pwritev2"}, {"ident":"pwritev64"}, {"ident":"pwritev64v2"}, {"ident":"qecvt"}, {"ident":"qecvt_r"}, {"ident":"qfcvt"}, {"ident":"qfcvt_r"}, {"ident":"qgcvt"}, {"ident":"qsort"}, {"ident":"raise"}, {"ident":"rand"}, {"ident":"rand_r"}, {"ident":"random"}, {"ident":"random_r"}, {"ident":"rawmemchr"}, {"ident":"read"}, {"ident":"readdir"}, {"ident":"readdir64"}, {"ident":"readdir64_r"}, {"ident":"readdir_r"}, {"ident":"readlink"}, {"ident":"readv"}, {"ident":"realloc"}, {"ident":"reallocarray"}, {"ident":"realpath"}, {"ident":"recv"}, {"ident":"recvfrom"}, {"ident":"regcomp"}, {"ident":"regerror"}, {"ident":"regexec"}, {"ident":"regfree"}, {"ident":"register_printf_function"}, {"ident":"remainder"}, {"ident":"remainderf"}, {"ident":"remainderfN"}, {"ident":"remainderfNx"}, {"ident":"remainderl"}, {"ident":"remove"}, {"ident":"rename"}, {"ident":"return"}, {"ident":"rewind"}, {"ident":"rewinddir"}, {"ident":"rindex"}, {"ident":"rint"}, {"ident":"rintf"}, {"ident":"rintfN"}, {"ident":"rintfNx"}, {"ident":"rintl"}, {"ident":"rmdir"}, {"ident":"round"}, {"ident":"roundeven"}, {"ident":"roundevenf"}, {"ident":"roundevenfN"}, {"ident":"roundevenfNx"}, {"ident":"roundevenl"}, {"ident":"roundf"}, {"ident":"roundfN"}, {"ident":"roundfNx"}, {"ident":"roundl"}, {"ident":"rpmatch"}, {"ident":"S_ISBLK"}, {"ident":"S_ISCHR"}, {"ident":"S_ISDIR"}, {"ident":"S_ISFIFO"}, {"ident":"S_ISLNK"}, {"ident":"S_ISREG"}, {"ident":"S_ISSOCK"}, {"ident":"S_TYPEISMQ"}, {"ident":"S_TYPEISSEM"}, {"ident":"S_TYPEISSHM"}, {"ident":"sbrk"}, {"ident":"scalb"}, {"ident":"scalbf"}, {"ident":"scalbl"}, {"ident":"scalbln"}, {"ident":"scalblnf"}, {"ident":"scalblnfN"}, {"ident":"scalblnfNx"}, {"ident":"scalblnl"}, {"ident":"scalbn"}, {"ident":"scalbnf"}, {"ident":"scalbnfN"}, {"ident":"scalbnfNx"}, {"ident":"scalbnl"}, {"ident":"scandir"}, {"ident":"scandir64"}, {"ident":"scanf"}, {"ident":"sched_get_priority_max"}, {"ident":"sched_get_priority_min"}, {"ident":"sched_getaffinity"}, {"ident":"sched_getparam"}, {"ident":"sched_getscheduler"}, {"ident":"sched_rr_get_interval"}, {"ident":"sched_setaffinity"}, {"ident":"sched_setparam"}, {"ident":"sched_setscheduler"}, {"ident":"sched_yield"}, {"ident":"secure_getenv"}, {"ident":"seed48"}, {"ident":"seed48_r"}, {"ident":"seekdir"}, {"ident":"select"}, {"ident":"sem_close"}, {"ident":"sem_destroy"}, {"ident":"sem_getvalue"}, {"ident":"sem_init"}, {"ident":"sem_open"}, {"ident":"sem_post"}, {"ident":"sem_timedwait"}, {"ident":"sem_trywait"}, {"ident":"sem_unlink"}, {"ident":"sem_wait"}, {"ident":"semctl"}, {"ident":"semget"}, {"ident":"semop"}, {"ident":"semtimedop"}, {"ident":"send"}, {"ident":"sendto"}, {"ident":"setbuf"}, {"ident":"setbuffer"}, {"ident":"setcontext"}, {"ident":"setdomainname"}, {"ident":"setegid"}, {"ident":"setenv"}, {"ident":"seteuid"}, {"ident":"setfsent"}, {"ident":"setgid"}, {"ident":"setgrent"}, {"ident":"setgroups"}, {"ident":"sethostent"}, {"ident":"sethostid"}, {"ident":"sethostname"}, {"ident":"setitimer"}, {"ident":"setjmp"}, {"ident":"setkey"}, {"ident":"setkey_r"}, {"ident":"setlinebuf"}, {"ident":"setlocale"}, {"ident":"setlogmask"}, {"ident":"setmntent"}, {"ident":"setnetent"}, {"ident":"setnetgrent"}, {"ident":"setpayload"}, {"ident":"setpayloadf"}, {"ident":"setpayloadfN"}, {"ident":"setpayloadfNx"}, {"ident":"setpayloadl"}, {"ident":"setpayloadsig"}, {"ident":"setpayloadsigf"}, {"ident":"setpayloadsigfN"}, {"ident":"setpayloadsigfNx"}, {"ident":"setpayloadsigl"}, {"ident":"setpgid"}, {"ident":"setpgrp"}, {"ident":"setpriority"}, {"ident":"setprotoent"}, {"ident":"setpwent"}, {"ident":"setregid"}, {"ident":"setreuid"}, {"ident":"setrlimit"}, {"ident":"setrlimit64"}, {"ident":"setservent"}, {"ident":"setsid"}, {"ident":"setsockopt"}, {"ident":"setstate"}, {"ident":"setstate_r"}, {"ident":"settimeofday"}, {"ident":"setuid"}, {"ident":"setutent"}, {"ident":"setutxent"}, {"ident":"setvbuf"}, {"ident":"shm_open"}, {"ident":"shm_unlink"}, {"ident":"shutdown"}, {"ident":"sigaction"}, {"ident":"sigaddset"}, {"ident":"sigaltstack"}, {"ident":"sigblock"}, {"ident":"sigdelset"}, {"ident":"sigemptyset"}, {"ident":"sigfillset"}, {"ident":"siginterrupt"}, {"ident":"sigismember"}, {"ident":"siglongjmp"}, {"ident":"sigmask"}, {"ident":"signal"}, {"ident":"signbit"}, {"ident":"significand"}, {"ident":"significandf"}, {"ident":"significandl"}, {"ident":"sigpause"}, {"ident":"sigpending"}, {"ident":"sigprocmask"}, {"ident":"sigsetjmp"}, {"ident":"sigsetmask"}, {"ident":"sigstack"}, {"ident":"sigsuspend"}, {"ident":"sin"}, {"ident":"sincos"}, {"ident":"sincosf"}, {"ident":"sincosfN"}, {"ident":"sincosfNx"}, {"ident":"sincosl"}, {"ident":"sinf"}, {"ident":"sinfN"}, {"ident":"sinfNx"}, {"ident":"sinh"}, {"ident":"sinhf"}, {"ident":"sinhfN"}, {"ident":"sinhfNx"}, {"ident":"sinhl"}, {"ident":"sinl"}, {"ident":"sleep"}, {"ident":"snprintf"}, {"ident":"socket"}, {"ident":"socketpair"}, {"ident":"sprintf"}, {"ident":"sqrt"}, {"ident":"sqrtf"}, {"ident":"sqrtfN"}, {"ident":"sqrtfNx"}, {"ident":"sqrtl"}, {"ident":"srand"}, {"ident":"srand48"}, {"ident":"srand48_r"}, {"ident":"srandom"}, {"ident":"srandom_r"}, {"ident":"sscanf"}, {"ident":"ssignal"}, {"ident":"stat"}, {"ident":"stat64"}, {"ident":"stime"}, {"ident":"stpcpy"}, {"ident":"stpncpy"}, {"ident":"strcasecmp"}, {"ident":"strcasestr"}, {"ident":"strcat"}, {"ident":"strchr"}, {"ident":"strchrnul"}, {"ident":"strcmp"}, {"ident":"strcoll"}, {"ident":"strcpy"}, {"ident":"strcspn"}, {"ident":"strdup"}, {"ident":"strdupa"}, {"ident":"strerror"}, {"ident":"strerror_r"}, {"ident":"strfmon"}, {"ident":"strfromd"}, {"ident":"strfromf"}, {"ident":"strfromfN"}, {"ident":"strfromfNx"}, {"ident":"strfroml"}, {"ident":"strfry"}, {"ident":"strftime"}, {"ident":"strlen"}, {"ident":"strncasecmp"}, {"ident":"strncat"}, {"ident":"strncmp"}, {"ident":"strncpy"}, {"ident":"strndup"}, {"ident":"strndupa"}, {"ident":"strnlen"}, {"ident":"strpbrk"}, {"ident":"strptime"}, {"ident":"strrchr"}, {"ident":"strsep"}, {"ident":"strsignal"}, {"ident":"strspn"}, {"ident":"strstr"}, {"ident":"strtod"}, {"ident":"strtof"}, {"ident":"strtofN"}, {"ident":"strtofNx"}, {"ident":"strtoimax"}, {"ident":"strtok"}, {"ident":"strtok_r"}, {"ident":"strtol"}, {"ident":"strtold"}, {"ident":"strtoll"}, {"ident":"strtoq"}, {"ident":"strtoul"}, {"ident":"strtoull"}, {"ident":"strtoumax"}, {"ident":"strtouq"}, {"ident":"strverscmp"}, {"ident":"strxfrm"}, {"ident":"stty"}, {"ident":"success"}, {"ident":"SUN_LEN"}, {"ident":"swapcontext"}, {"ident":"swprintf"}, {"ident":"swscanf"}, {"ident":"symlink"}, {"ident":"sync"}, {"ident":"syscall"}, {"ident":"sysconf"}, {"ident":"sysctl"}, {"ident":"syslog"}, {"ident":"system"}, {"ident":"sysv_signal"}, {"ident":"tan"}, {"ident":"tanf"}, {"ident":"tanfN"}, {"ident":"tanfNx"}, {"ident":"tanh"}, {"ident":"tanhf"}, {"ident":"tanhfN"}, {"ident":"tanhfNx"}, {"ident":"tanhl"}, {"ident":"tanl"}, {"ident":"tcdrain"}, {"ident":"tcflow"}, {"ident":"tcflush"}, {"ident":"tcgetattr"}, {"ident":"tcgetpgrp"}, {"ident":"tcgetsid"}, {"ident":"tcsendbreak"}, {"ident":"tcsetattr"}, {"ident":"tcsetpgrp"}, {"ident":"tdelete"}, {"ident":"tdestroy"}, {"ident":"telldir"}, {"ident":"TEMP_FAILURE_RETRY"}, {"ident":"tempnam"}, {"ident":"textdomain"}, {"ident":"tfind"}, {"ident":"tgamma"}, {"ident":"tgammaf"}, {"ident":"tgammafN"}, {"ident":"tgammafNx"}, {"ident":"tgammal"}, {"ident":"time"}, {"ident":"timegm"}, {"ident":"timelocal"}, {"ident":"times"}, {"ident":"tmpfile"}, {"ident":"tmpfile64"}, {"ident":"tmpnam"}, {"ident":"tmpnam_r"}, {"ident":"toascii"}, {"ident":"tolower"}, {"ident":"totalorder"}, {"ident":"totalorderf"}, {"ident":"totalorderfN"}, {"ident":"totalorderfNx"}, {"ident":"totalorderl"}, {"ident":"totalordermag"}, {"ident":"totalordermagf"}, {"ident":"totalordermagfN"}, {"ident":"totalordermagfNx"}, {"ident":"totalordermagl"}, {"ident":"toupper"}, {"ident":"towctrans"}, {"ident":"towlower"}, {"ident":"towupper"}, {"ident":"trunc"}, {"ident":"truncate"}, {"ident":"truncate64"}, {"ident":"truncf"}, {"ident":"truncfN"}, {"ident":"truncfNx"}, {"ident":"truncl"}, {"ident":"tryagain"}, {"ident":"tsearch"}, {"ident":"ttyname"}, {"ident":"ttyname_r"}, {"ident":"twalk"}, {"ident":"tzset"}, {"ident":"ufromfp"}, {"ident":"ufromfpf"}, {"ident":"ufromfpfN"}, {"ident":"ufromfpfNx"}, {"ident":"ufromfpl"}, {"ident":"ufromfpx"}, {"ident":"ufromfpxf"}, {"ident":"ufromfpxfN"}, {"ident":"ufromfpxfNx"}, {"ident":"ufromfpxl"}, {"ident":"ulimit"}, {"ident":"umask"}, {"ident":"umount"}, {"ident":"umount2"}, {"ident":"uname"}, {"ident":"unavail"}, {"ident":"ungetc"}, {"ident":"ungetwc"}, {"ident":"unlink"}, {"ident":"unlockpt"}, {"ident":"unsetenv"}, {"ident":"updwtmp"}, {"ident":"utime"}, {"ident":"utimes"}, {"ident":"utmpname"}, {"ident":"utmpxname"}, {"ident":"va_arg"}, {"ident":"va_copy"}, {"ident":"va_end"}, {"ident":"va_start"}, {"ident":"valloc"}, {"ident":"vasprintf"}, {"ident":"verr"}, {"ident":"verrx"}, {"ident":"versionsort"}, {"ident":"versionsort64"}, {"ident":"vfork"}, {"ident":"vfprintf"}, {"ident":"vfscanf"}, {"ident":"vfwprintf"}, {"ident":"vfwscanf"}, {"ident":"vlimit"}, {"ident":"vprintf"}, {"ident":"vscanf"}, {"ident":"vsnprintf"}, {"ident":"vsprintf"}, {"ident":"vsscanf"}, {"ident":"vswprintf"}, {"ident":"vswscanf"}, {"ident":"vsyslog"}, {"ident":"vtimes"}, {"ident":"vwarn"}, {"ident":"vwarnx"}, {"ident":"vwprintf"}, {"ident":"vwscanf"}, {"ident":"wait"}, {"ident":"wait3"}, {"ident":"wait4"}, {"ident":"waitpid"}, {"ident":"warn"}, {"ident":"warnx"}, {"ident":"WCOREDUMP"}, {"ident":"wcpcpy"}, {"ident":"wcpncpy"}, {"ident":"wcrtomb"}, {"ident":"wcscasecmp"}, {"ident":"wcscat"}, {"ident":"wcschr"}, {"ident":"wcschrnul"}, {"ident":"wcscmp"}, {"ident":"wcscoll"}, {"ident":"wcscpy"}, {"ident":"wcscspn"}, {"ident":"wcsdup"}, {"ident":"wcsftime"}, {"ident":"wcslen"}, {"ident":"wcsncasecmp"}, {"ident":"wcsncat"}, {"ident":"wcsncmp"}, {"ident":"wcsncpy"}, {"ident":"wcsnlen"}, {"ident":"wcsnrtombs"}, {"ident":"wcspbrk"}, {"ident":"wcsrchr"}, {"ident":"wcsrtombs"}, {"ident":"wcsspn"}, {"ident":"wcsstr"}, {"ident":"wcstod"}, {"ident":"wcstof"}, {"ident":"wcstofN"}, {"ident":"wcstofNx"}, {"ident":"wcstoimax"}, {"ident":"wcstok"}, {"ident":"wcstol"}, {"ident":"wcstold"}, {"ident":"wcstoll"}, {"ident":"wcstombs"}, {"ident":"wcstoq"}, {"ident":"wcstoul"}, {"ident":"wcstoull"}, {"ident":"wcstoumax"}, {"ident":"wcstouq"}, {"ident":"wcswcs"}, {"ident":"wcsxfrm"}, {"ident":"wctob"}, {"ident":"wctomb"}, {"ident":"wctrans"}, {"ident":"wctype"}, {"ident":"WEXITSTATUS"}, {"ident":"WIFEXITED"}, {"ident":"WIFSIGNALED"}, {"ident":"WIFSTOPPED"}, {"ident":"wmemchr"}, {"ident":"wmemcmp"}, {"ident":"wmemcpy"}, {"ident":"wmemmove"}, {"ident":"wmempcpy"}, {"ident":"wmemset"}, {"ident":"wordexp"}, {"ident":"wordfree"}, {"ident":"wprintf"}, {"ident":"write"}, {"ident":"writev"}, {"ident":"wscanf"}, {"ident":"WSTOPSIG"}, {"ident":"WTERMSIG"}, {"ident":"y0"}, {"ident":"y0f"}, {"ident":"y0fN"}, {"ident":"y0fNx"}, {"ident":"y0l"}, {"ident":"y1"}, {"ident":"y1f"}, {"ident":"y1fN"}, {"ident":"y1fNx"}, {"ident":"y1l"}, {"ident":"yn"}, {"ident":"ynf"}, {"ident":"ynfN"}, {"ident":"ynfNx"}, {"ident":"ynl"} ] } frama-c-20.0-Calcium/share/compliance/nonstandard_identifiers.json0000666000000000000000000000141313571573400022221 0ustar { "description": "Non-ISO C, Non-POSIX identifiers known to the Frama-C standard library", "source":"Manpages, mostly Linux and BSD", "data":[ {"ident":"facilitynames", "header":"syslog.h"}, {"ident":"getresgid", "header":"unistd.h"}, {"ident":"getresuid", "header":"unistd.h"}, {"ident":"option", "header":"getopt.h"}, {"ident":"prioritynames", "header":"syslog.h"}, {"ident":"setresgid", "header":"unistd.h"}, {"ident":"setresuid", "header":"unistd.h"}, {"ident":"strcspn", "header":"string.h"}, {"ident":"strlcat", "header":"string.h"}, {"ident":"strlcpy", "header":"string.h"}, {"ident":"wcslcat", "header":"wchar.h"}, {"ident":"wcslcpy", "header":"wchar.h"} ] } frama-c-20.0-Calcium/share/compliance/posix_identifiers.json0000666000000000000000000056036613571573400021071 0ustar { "description": "POSIX.1-2008 reserved function identifiers (plus a few legacy POSIX identifiers)", "source":"POSIX.1-2008 - Base Specifications, Issue 7 (IEEE Std 1003.1-2008, 2016 Edition)", "id_types":[ {"type":"function", "description":"declared as a function; may also be defined as a macro"}, {"type":"variable", "description":"external variable"}, {"type":"macroOrIdentifier", "description":"declaration or definition; unspecified whether it is a macro or an identifier declared with external linkage"}, {"type":"macro", "description":"macro"}, {"type":"constant", "description":"symbolic constant"}, {"type":"type", "description":"type or structure"} ], "headers":[ "aio.h", "arpa/inet.h", "assert.h", "complex.h", "cpio.h", "ctype.h", "dirent.h", "dlfcn.h", "errno.h", "fcntl.h", "fenv.h", "float.h", "fmtmsg.h", "fnmatch.h", "ftw.h", "glob.h", "grp.h", "iconv.h", "inttypes.h", "iso646.h", "langinfo.h", "libgen.h", "limits.h", "locale.h", "math.h", "monetary.h", "mqueue.h", "ndbm.h", "net/if.h", "netdb.h", "netinet/in.h", "netinet/tcp.h", "nl_types.h", "poll.h", "pthread.h", "pwd.h", "regex.h", "sched.h", "search.h", "semaphore.h", "setjmp.h", "signal.h", "spawn.h", "stdarg.h", "stdbool.h", "stddef.h", "stdint.h", "stdio.h", "stdlib.h", "string.h", "strings.h", "stropts.h", "sys/ipc.h", "sys/mman.h", "sys/msg.h", "sys/resource.h", "sys/select.h", "sys/sem.h", "sys/shm.h", "sys/socket.h", "sys/stat.h", "sys/statvfs.h", "sys/time.h", "sys/times.h", "sys/types.h", "sys/uio.h", "sys/un.h", "sys/utsname.h", "sys/wait.h", "syslog.h", "tar.h", "termios.h", "tgmath.h", "time.h", "trace.h", "ulimit.h", "unistd.h", "utime.h", "utmpx.h", "wchar.h", "wctype.h", "wordexp.h" ], "extension_names":{ "ADV":"Advisory Information", "CX":"Extension to the ISO C standard", "FSC":"File Synchronization", "IP6":"IPV6", "MC1":"Non-Robust Mutex Priority Protection or Non-Robust Mutex Priority Inheritance or Robust Mutex Priority Protection or Robust Mutex Priority Inheritance", "ML":"Process Memory Locking", "MLR":"Range Memory Locking", "MON":"Monotonic Clock", "OB":"Obsolescent", "PS":"Process Scheduling", "REM":"Removed from POSIX.1-2008 (but present in a previous version)", "RPP":"Robust Mutex Priority Protection", "SHM":"Shared Memory Objects", "SIO":"Synchronized Input and Output", "SS":"Process Sporadic Server", "TCT":"Thread CPU-Time Clocks", "TEF":"Trace Event Filter", "TPP":"Non-Robust Mutex Priority Protection", "TPS":"Thread Execution Scheduling", "TRC":"Trace", "TRI":"Trace Inherit", "TRL":"Trace Log", "TSA":"Thread Stack Address Attribute", "TSH":"Thread Process-Shared Synchronization", "TSP":"Thread Sporadic Server", "TSS":"Thread Stack Size Attribute", "TYM":"Typed Memory Objects", "XSI":"X/Open System Interfaces", "XSR":"XSI STREAMS" }, "data":[ {"ident":"__bool_true_false_are_defined", "id_type":"macro", "header":"stdbool.h", "extensions":[]}, {"ident":"_Complex_I", "id_type":"macro", "header":"complex.h", "extensions":[]}, {"ident":"_CS_PATH", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_ILP32_OFF32_CFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_ILP32_OFF32_LDFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_ILP32_OFF32_LIBS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_ILP32_OFFBIG_LIBS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_LP64_OFF64_CFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_LP64_OFF64_LDFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_LP64_OFF64_LIBS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_LPBIG_OFFBIG_LIBS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_THREADS_CFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_THREADS_LDFLAGS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_POSIX_V7_WIDTH_RESTRICTED_ENVS", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_CS_V7_ENV", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_Exit", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"_exit", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"_Imaginary_I", "id_type":"macro", "header":"complex.h", "extensions":[]}, {"ident":"_IOFBF", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"_IOLBF", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"_IONBF", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"_longjmp", "id_type":"function", "header":"setjmp.h", "extensions":["OB","XSI"]}, {"ident":"_POSIX2_VERSION", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_POSIX_AIO_LISTIO_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_AIO_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_ARG_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_CHILD_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_CLOCKRES_MIN", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_DELAYTIMER_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_HOST_NAME_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_LINK_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_LOGIN_NAME_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_MAX_CANON", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_MAX_INPUT", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_MQ_OPEN_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_MQ_PRIO_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_NAME_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_NGROUPS_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_OPEN_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_PATH_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_PIPE_BUF", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_RE_DUP_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_RTSIG_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_SEM_NSEMS_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_SEM_VALUE_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_SIGQUEUE_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_SS_REPL_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_SSIZE_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_STREAM_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_SYMLINK_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_SYMLOOP_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_THREAD_DESTRUCTOR_ITERATIONS", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_THREAD_KEYS_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_THREAD_THREADS_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_TIMER_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_TRACE_EVENT_NAME_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_TRACE_NAME_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_TRACE_SYS_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_TRACE_USER_EVENT_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_TTY_NAME_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_TZNAME_MAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"_POSIX_VDISABLE", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_POSIX_VERSION", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"_setjmp", "id_type":"function", "header":"setjmp.h", "extensions":["OB","XSI"]}, {"ident":"_tolower", "id_type":"function", "header":"ctype.h", "extensions":["OB","XSI"]}, {"ident":"_toupper", "id_type":"function", "header":"ctype.h", "extensions":["OB","XSI"]}, {"ident":"_XOPEN_VERSION", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"a64l", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"abort", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"abs", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"accept", "id_type":"function", "header":"sys/socket.h", "extensions":["XSI"]}, {"ident":"access", "id_type":"function", "header":"unistd.h", "extensions":["ADV"]}, {"ident":"acos", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"acosf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"acosh", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"acoshf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"acoshl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"acosl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"addrinfo", "id_type":"type", "header":"netdb.h", "extensions":[]}, {"ident":"AF_INET", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"AF_INET6", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"AF_UNIX", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"AF_UNSPEC", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"AI_ADDRCONFIG", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"AI_ALL", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"AI_CANONNAME", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"AI_NUMERICHOST", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"AI_NUMERICSERV", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"AI_PASSIVE", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"AI_V4MAPPED", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"AIO_ALLDONE", "id_type":"constant", "header":"aio.h", "extensions":[]}, {"ident":"aio_cancel", "id_type":"function", "header":"aio.h", "extensions":[]}, {"ident":"AIO_CANCELED", "id_type":"constant", "header":"aio.h", "extensions":[]}, {"ident":"aio_error", "id_type":"function", "header":"aio.h", "extensions":[]}, {"ident":"aio_fsync", "id_type":"function", "header":"aio.h", "extensions":["FSC","SIO"]}, {"ident":"AIO_NOTCANCELED", "id_type":"constant", "header":"aio.h", "extensions":[]}, {"ident":"aio_read", "id_type":"function", "header":"aio.h", "extensions":[]}, {"ident":"aio_return", "id_type":"function", "header":"aio.h", "extensions":[]}, {"ident":"aio_suspend", "id_type":"function", "header":"aio.h", "extensions":[]}, {"ident":"aio_write", "id_type":"function", "header":"aio.h", "extensions":[]}, {"ident":"aiocb", "id_type":"type", "header":"aio.h", "extensions":["FSC","SIO"]}, {"ident":"alarm", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"alphasort", "id_type":"function", "header":"dirent.h", "extensions":[]}, {"ident":"and", "id_type":"macro", "header":"iso646.h", "extensions":["CX"]}, {"ident":"and_eq", "id_type":"macro", "header":"iso646.h", "extensions":[]}, {"ident":"asctime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"asctime_r", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"asin", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"asinf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"asinh", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"asinhf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"asinhl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"asinl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"assert", "id_type":"macro", "header":"assert.h", "extensions":[]}, {"ident":"AT_EACCESS", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"AT_FDCWD", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"AT_REMOVEDIR", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"AT_SYMLINK_FOLLOW", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"AT_SYMLINK_NOFOLLOW", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"atan", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"atan2", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"atan2f", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"atan2l", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"atanf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"atanh", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"atanhf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"atanhl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"atanl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"atexit", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"atof", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"atoi", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"atol", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"atoll", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"B0", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B110", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B1200", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B134", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B150", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B1800", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B19200", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B200", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B2400", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B300", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B38400", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B4800", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B50", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B600", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B75", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"B9600", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"bandinfo", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"basename", "id_type":"function", "header":"libgen.h", "extensions":[]}, {"ident":"bind", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"bitand", "id_type":"macro", "header":"iso646.h", "extensions":[]}, {"ident":"bitor", "id_type":"macro", "header":"iso646.h", "extensions":[]}, {"ident":"blkcnt_t", "id_type":"type", "header":"sys/types.h", "extensions":["XSI"]}, {"ident":"blksize_t", "id_type":"type", "header":"sys/types.h", "extensions":["XSI"]}, {"ident":"bool", "id_type":"macro", "header":"stdbool.h", "extensions":[]}, {"ident":"BOOT_TIME", "id_type":"constant", "header":"utmpx.h", "extensions":[]}, {"ident":"BRKINT", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"BSDLY", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"bsearch", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"btowc", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"BUFSIZ", "id_type":"type", "header":"stdio.h", "extensions":[]}, {"ident":"cabs", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cabsf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cabsl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cacos", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cacosf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cacosh", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cacoshf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cacoshl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cacosl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"calloc", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"carg", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cargf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cargl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"casin", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"casinf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"casinh", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"casinhf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"casinhl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"casinl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"catan", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"catanf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"catanh", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"catanhf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"catanhl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"catanl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"catclose", "id_type":"function", "header":"nl_types.h", "extensions":[]}, {"ident":"catgets", "id_type":"function", "header":"nl_types.h", "extensions":[]}, {"ident":"catopen", "id_type":"function", "header":"nl_types.h", "extensions":[]}, {"ident":"cbrt", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"cbrtf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"cbrtl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"cc_t", "id_type":"type", "header":"termios.h", "extensions":[]}, {"ident":"ccos", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ccosf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ccosh", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ccoshf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ccoshl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ccosl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ceil", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"ceilf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"ceill", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"cexp", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cexpf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cexpl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cfgetispeed", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"cfgetospeed", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"cfsetispeed", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"cfsetospeed", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"CHAR_BIT", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"CHAR_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"CHAR_MIN", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"chdir", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"chmod", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"chown", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"chroot", "id_type":"function", "header":"unistd.h", "extensions":["OB","REM"]}, {"ident":"cimag", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cimagf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cimagl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"clearerr", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"CLOCAL", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"clock", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"clock_getcpuclockid", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"clock_getres", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"clock_gettime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"CLOCK_MONOTONIC", "id_type":"macro", "header":"time.h", "extensions":["MON"]}, {"ident":"clock_nanosleep", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"CLOCK_PROCESS_CPUTIME_ID", "id_type":"macro", "header":"time.h", "extensions":["IP6"]}, {"ident":"CLOCK_REALTIME", "id_type":"macro", "header":"time.h", "extensions":["IP6"]}, {"ident":"clock_settime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"clock_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"CLOCK_THREAD_CPUTIME_ID", "id_type":"macro", "header":"time.h", "extensions":["IP6"]}, {"ident":"clockid_t", "id_type":"type", "header":"sys/types.h", "extensions":["TCT"]}, {"ident":"CLOCKS_PER_SEC", "id_type":"macro", "header":"time.h", "extensions":["IP6"]}, {"ident":"clog", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"clogf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"clogl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"close", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"closedir", "id_type":"function", "header":"dirent.h", "extensions":[]}, {"ident":"closelog", "id_type":"function", "header":"syslog.h", "extensions":[]}, {"ident":"CMSG_DATA", "id_type":"macro", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"CMSG_FIRSTHDR", "id_type":"macro", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"CMSG_NXTHDR", "id_type":"macro", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"cmsghdr", "id_type":"type", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"compl", "id_type":"macro", "header":"iso646.h", "extensions":[]}, {"ident":"complex", "id_type":"macro", "header":"complex.h", "extensions":[]}, {"ident":"confstr", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"conj", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"conjf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"conjl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"connect", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"copysign", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"copysignf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"copysignl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"cos", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"cosf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"cosh", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"coshf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"coshl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"cosl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"cpow", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cpowf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cpowl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cproj", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cprojf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"cprojl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"CRDLY", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"CREAD", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"creal", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"crealf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"creall", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"creat", "id_type":"function", "header":"fcntl.h", "extensions":[]}, {"ident":"crypt", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"csin", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"csinf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"csinh", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"csinhf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"csinhl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"csinl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"CSIZE", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"csqrt", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"csqrtf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"csqrtl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"CSTOPB", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"ctan", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ctanf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ctanh", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ctanhf", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ctanhl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ctanl", "id_type":"function", "header":"complex.h", "extensions":[]}, {"ident":"ctermid", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"ctime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"ctime_r", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"datum", "id_type":"type", "header":"ndbm.h", "extensions":[]}, {"ident":"daylight", "id_type":"variable", "header":"time.h", "extensions":["IP6"]}, {"ident":"DBM", "id_type":"type", "header":"ndbm.h", "extensions":[]}, {"ident":"dbm_clearerr", "id_type":"function", "header":"ndbm.h", "extensions":[]}, {"ident":"dbm_close", "id_type":"function", "header":"ndbm.h", "extensions":[]}, {"ident":"dbm_delete", "id_type":"function", "header":"ndbm.h", "extensions":[]}, {"ident":"dbm_error", "id_type":"function", "header":"ndbm.h", "extensions":[]}, {"ident":"dbm_fetch", "id_type":"function", "header":"ndbm.h", "extensions":[]}, {"ident":"dbm_firstkey", "id_type":"function", "header":"ndbm.h", "extensions":[]}, {"ident":"DBM_INSERT", "id_type":"constant", "header":"ndbm.h", "extensions":[]}, {"ident":"dbm_nextkey", "id_type":"function", "header":"ndbm.h", "extensions":[]}, {"ident":"dbm_open", "id_type":"function", "header":"ndbm.h", "extensions":[]}, {"ident":"DBM_REPLACE", "id_type":"constant", "header":"ndbm.h", "extensions":[]}, {"ident":"dbm_store", "id_type":"function", "header":"ndbm.h", "extensions":[]}, {"ident":"DEAD_PROCESS", "id_type":"constant", "header":"utmpx.h", "extensions":[]}, {"ident":"dev_t", "id_type":"type", "header":"sys/types.h", "extensions":["XSI"]}, {"ident":"difftime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"DIR", "id_type":"type", "header":"dirent.h", "extensions":[]}, {"ident":"dirent", "id_type":"type", "header":"dirent.h", "extensions":[]}, {"ident":"dirfd", "id_type":"function", "header":"dirent.h", "extensions":[]}, {"ident":"dirname", "id_type":"function", "header":"libgen.h", "extensions":[]}, {"ident":"div", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"div_t", "id_type":"type", "header":"stdlib.h", "extensions":[]}, {"ident":"dlclose", "id_type":"function", "header":"dlfcn.h", "extensions":[]}, {"ident":"dlerror", "id_type":"function", "header":"dlfcn.h", "extensions":[]}, {"ident":"dlopen", "id_type":"function", "header":"dlfcn.h", "extensions":[]}, {"ident":"dlsym", "id_type":"function", "header":"dlfcn.h", "extensions":[]}, {"ident":"dprintf", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"drand48", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"dup", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"dup2", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"duplocale", "id_type":"function", "header":"locale.h", "extensions":["CX"]}, {"ident":"E2BIG", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EACCES", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EADDRINUSE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EADDRNOTAVAIL", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EAFNOSUPPORT", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EAGAIN", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EAI_AGAIN", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EAI_BADFLAGS", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EAI_FAIL", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EAI_FAMILY", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EAI_MEMORY", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EAI_NONAME", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EAI_OVERFLOW", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EAI_SERVICE", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EAI_SOCKTYPE", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EAI_SYSTEM", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"EALREADY", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EBADF", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EBADMSG", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EBUSY", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ECANCELED", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ECHILD", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ECHO", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"ECHOE", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"ECHOK", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"ECHONL", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"ECONNABORTED", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ECONNREFUSED", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ECONNRESET", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EDEADLK", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EDESTADDRREQ", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EDOM", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EDQUOT", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EEXIST", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EFAULT", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EFBIG", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EHOSTUNREACH", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EIDRM", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EILSEQ", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EINPROGRESS", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EINTR", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EINVAL", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EIO", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EISCONN", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EISDIR", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ELOOP", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EMFILE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EMLINK", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EMPTY", "id_type":"constant", "header":"utmpx.h", "extensions":[]}, {"ident":"EMSGSIZE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EMULTIHOP", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENAMETOOLONG", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"encrypt", "id_type":"function", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"endgrent", "id_type":"function", "header":"grp.h", "extensions":["XSI"]}, {"ident":"endhostent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"endnetent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"endprotoent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"endpwent", "id_type":"function", "header":"pwd.h", "extensions":["XSI"]}, {"ident":"endservent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"endutxent", "id_type":"function", "header":"utmpx.h", "extensions":[]}, {"ident":"ENETDOWN", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENETRESET", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENETUNREACH", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENFILE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOBUFS", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENODATA", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENODEV", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOENT", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOEXEC", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOLCK", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOLINK", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOMEM", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOMSG", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOPROTOOPT", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOSPC", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOSR", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOSTR", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOSYS", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOTCONN", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOTDIR", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOTEMPTY", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOTRECOVERABLE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOTSOCK", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOTSUP", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENOTTY", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ENTRY", "id_type":"type", "header":"search.h", "extensions":[]}, {"ident":"entry", "id_type":"type", "header":"search.h", "extensions":[]}, {"ident":"ENXIO", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EOF", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"EOPNOTSUPP", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EOVERFLOW", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EOWNERDEAD", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EPERM", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EPIPE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EPROTO", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EPROTONOSUPPORT", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EPROTOTYPE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"erand48", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"ERANGE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"erf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"erfc", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"erfcf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"erfcl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"erff", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"erfl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"EROFS", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"errno", "id_type":"macroOrIdentifier", "header":"errno.h", "extensions":[]}, {"ident":"ESPIPE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ESRCH", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ESTALE", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ETIME", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ETIMEDOUT", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"ETXTBSY", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EWOULDBLOCK", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"EXDEV", "id_type":"macro", "header":"errno.h", "extensions":[]}, {"ident":"execl", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"execle", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"execlp", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"execv", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"execve", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"execvp", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"exit", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"EXIT_FAILURE", "id_type":"macro", "header":"stdlib.h", "extensions":[]}, {"ident":"EXIT_SUCCESS", "id_type":"macro", "header":"stdlib.h", "extensions":[]}, {"ident":"exp", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"exp2", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"exp2f", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"exp2l", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"expf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"expl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"expm1", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"expm1f", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"expm1l", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"F_DUPFD", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_DUPFD_CLOEXEC", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_GETFD", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_GETFL", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_GETLK", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_GETOWN", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_LOCK", "id_type":"constant", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"F_OK", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"F_SETFD", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_SETFL", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_SETLK", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_SETLKW", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_SETOWN", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"F_TEST", "id_type":"constant", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"F_TLOCK", "id_type":"constant", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"F_ULOCK", "id_type":"constant", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"fabs", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fabsf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fabsl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"faccessat", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"false", "id_type":"macro", "header":"stdbool.h", "extensions":[]}, {"ident":"fattach", "id_type":"function", "header":"stropts.h", "extensions":[]}, {"ident":"fchdir", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"fchmod", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"fchmodat", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"fchown", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"fchownat", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"fclose", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fcntl", "id_type":"function", "header":"fcntl.h", "extensions":[]}, {"ident":"FD_CLOEXEC", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"FD_CLR", "id_type":"function", "header":"sys/select.h", "extensions":[]}, {"ident":"FD_ISSET", "id_type":"function", "header":"sys/select.h", "extensions":[]}, {"ident":"FD_SET", "id_type":"function", "header":"sys/select.h", "extensions":[]}, {"ident":"fd_set", "id_type":"type", "header":"sys/select.h", "extensions":[]}, {"ident":"FD_SETSIZE", "id_type":"constant", "header":"sys/select.h", "extensions":[]}, {"ident":"FD_ZERO", "id_type":"function", "header":"sys/select.h", "extensions":[]}, {"ident":"fdatasync", "id_type":"function", "header":"unistd.h", "extensions":["SIO"]}, {"ident":"fdetach", "id_type":"function", "header":"stropts.h", "extensions":[]}, {"ident":"fdim", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fdimf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fdiml", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fdopen", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fdopendir", "id_type":"function", "header":"dirent.h", "extensions":[]}, {"ident":"feclearexcept", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"fegetenv", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"fegetexceptflag", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"fegetround", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"feholdexcept", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"fenv_t", "id_type":"type", "header":"fenv.h", "extensions":[]}, {"ident":"feof", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"feraiseexcept", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"ferror", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fesetenv", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"fesetexceptflag", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"fesetround", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"fetestexcept", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"feupdateenv", "id_type":"function", "header":"fenv.h", "extensions":[]}, {"ident":"fexcept_t", "id_type":"type", "header":"fenv.h", "extensions":[]}, {"ident":"fexecve", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"FFDLY", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"fflush", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"ffs", "id_type":"function", "header":"strings.h", "extensions":["XSI"]}, {"ident":"fgetc", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fgetpos", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fgets", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fgetwc", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"fgetws", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"FILE", "id_type":"type", "header":"stdio.h", "extensions":["CX"]}, {"ident":"FILENAME_MAX", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"fileno", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"flock", "id_type":"type", "header":"fcntl.h", "extensions":[]}, {"ident":"flockfile", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"floor", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"floorf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"floorl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fma", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmaf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmal", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmax", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmaxf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmaxl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmemopen", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fmin", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fminf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fminl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmod", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmodf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmodl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fmtmsg", "id_type":"function", "header":"fmtmsg.h", "extensions":[]}, {"ident":"FNM_NOESCAPE", "id_type":"constant", "header":"fnmatch.h", "extensions":[]}, {"ident":"FNM_NOMATCH", "id_type":"constant", "header":"fnmatch.h", "extensions":[]}, {"ident":"FNM_PATHNAME", "id_type":"constant", "header":"fnmatch.h", "extensions":[]}, {"ident":"FNM_PERIOD", "id_type":"constant", "header":"fnmatch.h", "extensions":[]}, {"ident":"fnmatch", "id_type":"function", "header":"fnmatch.h", "extensions":[]}, {"ident":"fopen", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"FOPEN_MAX", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"fork", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"fpathconf", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"fpos_t", "id_type":"type", "header":"stdio.h", "extensions":[]}, {"ident":"fprintf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fputc", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fputs", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fputwc", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"fputws", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"fread", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"free", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"freeaddrinfo", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"freelocale", "id_type":"function", "header":"locale.h", "extensions":["CX"]}, {"ident":"freopen", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"frexp", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"frexpf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"frexpl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"fsblkcnt_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"fscanf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fseek", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fseeko", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"fsetpos", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fsfilcnt_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"fstat", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"fstatat", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"fstatvfs", "id_type":"function", "header":"sys/statvfs.h", "extensions":[]}, {"ident":"fsync", "id_type":"function", "header":"unistd.h", "extensions":["FSC"]}, {"ident":"ftell", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"ftello", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"ftok", "id_type":"function", "header":"sys/ipc.h", "extensions":[]}, {"ident":"ftruncate", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"ftrylockfile", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"ftw", "id_type":"function", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW", "id_type":"type", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_CHDIR", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_D", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_DEPTH", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_DNR", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_DP", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_F", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_MOUNT", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_NS", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_PHYS", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_SL", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"FTW_SLN", "id_type":"constant", "header":"ftw.h", "extensions":["OB"]}, {"ident":"funlockfile", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"futimens", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"fwide", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"fwprintf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"fwrite", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"fwscanf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"gai_strerror", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getaddrinfo", "id_type":"function", "header":"netdb.h", "extensions":["IP6"]}, {"ident":"GETALL", "id_type":"constant", "header":"sys/sem.h", "extensions":[]}, {"ident":"getc", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"getc_unlocked", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"getchar", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"getchar_unlocked", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"getcwd", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getdate", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"getdelim", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"getegid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getenv", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"geteuid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getgid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getgrent", "id_type":"function", "header":"grp.h", "extensions":[]}, {"ident":"getgrgid", "id_type":"function", "header":"grp.h", "extensions":[]}, {"ident":"getgrgid_r", "id_type":"function", "header":"grp.h", "extensions":[]}, {"ident":"getgrnam", "id_type":"function", "header":"grp.h", "extensions":[]}, {"ident":"getgrnam_r", "id_type":"function", "header":"grp.h", "extensions":[]}, {"ident":"getgroups", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"gethostbyaddr", "id_type":"function", "header":"netdb.h", "extensions":["OB","REM"]}, {"ident":"gethostbyname", "id_type":"function", "header":"netdb.h", "extensions":["OB","REM"]}, {"ident":"gethostent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"gethostid", "id_type":"function", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"gethostname", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getitimer", "id_type":"function", "header":"sys/time.h", "extensions":["IP6"]}, {"ident":"getline", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"getlogin", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getlogin_r", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getmsg", "id_type":"function", "header":"stropts.h", "extensions":[]}, {"ident":"getnameinfo", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"GETNCNT", "id_type":"constant", "header":"sys/sem.h", "extensions":[]}, {"ident":"getnetbyaddr", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getnetbyname", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getnetent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getopt", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getpeername", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"getpgid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getpgrp", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"GETPID", "id_type":"constant", "header":"sys/sem.h", "extensions":[]}, {"ident":"getpid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getpmsg", "id_type":"function", "header":"stropts.h", "extensions":[]}, {"ident":"getppid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getpriority", "id_type":"function", "header":"sys/resource.h", "extensions":[]}, {"ident":"getprotobyname", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getprotobynumber", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getprotoent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getpwent", "id_type":"function", "header":"pwd.h", "extensions":[]}, {"ident":"getpwnam", "id_type":"function", "header":"pwd.h", "extensions":[]}, {"ident":"getpwnam_r", "id_type":"function", "header":"pwd.h", "extensions":[]}, {"ident":"getpwuid", "id_type":"function", "header":"pwd.h", "extensions":[]}, {"ident":"getpwuid_r", "id_type":"function", "header":"pwd.h", "extensions":[]}, {"ident":"getrlimit", "id_type":"function", "header":"sys/resource.h", "extensions":[]}, {"ident":"getrusage", "id_type":"function", "header":"sys/resource.h", "extensions":[]}, {"ident":"gets", "id_type":"function", "header":"stdio.h", "extensions":["OB"]}, {"ident":"getservbyname", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getservbyport", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getservent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"getsid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getsockname", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"getsockopt", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"getsubopt", "id_type":"function", "header":"stdlib.h", "extensions":["CX"]}, {"ident":"gettimeofday", "id_type":"function", "header":"sys/time.h", "extensions":["IP6"]}, {"ident":"getuid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"getutxent", "id_type":"function", "header":"utmpx.h", "extensions":[]}, {"ident":"getutxid", "id_type":"function", "header":"utmpx.h", "extensions":[]}, {"ident":"getutxline", "id_type":"function", "header":"utmpx.h", "extensions":[]}, {"ident":"GETVAL", "id_type":"constant", "header":"sys/sem.h", "extensions":[]}, {"ident":"getwc", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"getwchar", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"GETZCNT", "id_type":"constant", "header":"sys/sem.h", "extensions":[]}, {"ident":"gid_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"glob", "id_type":"function", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_ABORTED", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_APPEND", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_DOOFFS", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_ERR", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_MARK", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_NOCHECK", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_NOESCAPE", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_NOMATCH", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_NOSORT", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"GLOB_NOSPACE", "id_type":"constant", "header":"glob.h", "extensions":[]}, {"ident":"glob_t", "id_type":"type", "header":"glob.h", "extensions":[]}, {"ident":"globfree", "id_type":"function", "header":"glob.h", "extensions":[]}, {"ident":"gmtime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"gmtime_r", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"grantpt", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"group", "id_type":"type", "header":"grp.h", "extensions":["XSI"]}, {"ident":"h_errno", "id_type":"macroOrIdentifier", "header":"netdb.h", "extensions":["OB","REM"]}, {"ident":"hcreate", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"hdestroy", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"hostent", "id_type":"type", "header":"netdb.h", "extensions":[]}, {"ident":"hsearch", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"htonl", "id_type":"function", "header":"arpa/inet.h", "extensions":[]}, {"ident":"htons", "id_type":"function", "header":"arpa/inet.h", "extensions":[]}, {"ident":"HUGE_VAL", "id_type":"macro", "header":"math.h", "extensions":[]}, {"ident":"HUGE_VALF", "id_type":"macro", "header":"math.h", "extensions":[]}, {"ident":"HUGE_VALL", "id_type":"macro", "header":"math.h", "extensions":[]}, {"ident":"HUPCL", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"hypot", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"hypotf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"hypotl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"I", "id_type":"macro", "header":"complex.h", "extensions":[]}, {"ident":"ICANON", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"iconv", "id_type":"function", "header":"iconv.h", "extensions":[]}, {"ident":"iconv_close", "id_type":"function", "header":"iconv.h", "extensions":[]}, {"ident":"iconv_open", "id_type":"function", "header":"iconv.h", "extensions":[]}, {"ident":"iconv_t", "id_type":"type", "header":"iconv.h", "extensions":[]}, {"ident":"ICRNL", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"id_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"IEXTEN", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"if_freenameindex", "id_type":"function", "header":"net/if.h", "extensions":[]}, {"ident":"if_indextoname", "id_type":"function", "header":"net/if.h", "extensions":[]}, {"ident":"if_nameindex", "id_type":"function", "header":"net/if.h", "extensions":[]}, {"ident":"IF_NAMESIZE", "id_type":"constant", "header":"net/if.h", "extensions":[]}, {"ident":"if_nametoindex", "id_type":"function", "header":"net/if.h", "extensions":[]}, {"ident":"IGNBRK", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"IGNCR", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"IGNPAR", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"ilogb", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"ilogbf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"ilogbl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"imaginary", "id_type":"macro", "header":"complex.h", "extensions":[]}, {"ident":"imaxabs", "id_type":"function", "header":"inttypes.h", "extensions":[]}, {"ident":"imaxdiv", "id_type":"function", "header":"inttypes.h", "extensions":[]}, {"ident":"in6_addr", "id_type":"type", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_LINKLOCAL", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_LOOPBACK", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_MC_GLOBAL", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_MC_LINKLOCAL", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_MC_NODELOCAL", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_MC_ORGLOCAL", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_MC_SITELOCAL", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_MULTICAST", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_SITELOCAL", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_UNSPECIFIED", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_V4COMPAT", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IN6_IS_ADDR_V4MAPPED", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"in6addr_any", "id_type":"variable", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"in6addr_loopback", "id_type":"variable", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"in_addr", "id_type":"type", "header":"netinet/in.h", "extensions":[]}, {"ident":"in_addr_t", "id_type":"type", "header":"netinet/in.h", "extensions":[]}, {"ident":"in_port_t", "id_type":"type", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"INADDR_ANY", "id_type":"constant", "header":"netinet/in.h", "extensions":[]}, {"ident":"INADDR_BROADCAST", "id_type":"constant", "header":"netinet/in.h", "extensions":[]}, {"ident":"INET6_ADDRSTRLEN", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"inet_addr", "id_type":"function", "header":"arpa/inet.h", "extensions":[]}, {"ident":"INET_ADDRSTRLEN", "id_type":"constant", "header":"netinet/in.h", "extensions":[]}, {"ident":"inet_ntoa", "id_type":"function", "header":"arpa/inet.h", "extensions":[]}, {"ident":"inet_ntop", "id_type":"function", "header":"arpa/inet.h", "extensions":[]}, {"ident":"inet_pton", "id_type":"function", "header":"arpa/inet.h", "extensions":[]}, {"ident":"INFINITY", "id_type":"macro", "header":"math.h", "extensions":[]}, {"ident":"INIT_PROCESS", "id_type":"constant", "header":"utmpx.h", "extensions":[]}, {"ident":"initstate", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"INLCR", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"ino_t", "id_type":"type", "header":"sys/types.h", "extensions":["XSI"]}, {"ident":"INPCK", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"insque", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"INT_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"INT_MIN", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"ioctl", "id_type":"function", "header":"stropts.h", "extensions":["OB","XSR"]}, {"ident":"iovec", "id_type":"type", "header":"sys/uio.h", "extensions":["XSI"]}, {"ident":"IPC_CREAT", "id_type":"constant", "header":"sys/ipc.h", "extensions":[]}, {"ident":"IPC_EXCL", "id_type":"constant", "header":"sys/ipc.h", "extensions":[]}, {"ident":"IPC_NOWAIT", "id_type":"constant", "header":"sys/ipc.h", "extensions":[]}, {"ident":"ipc_perm", "id_type":"type", "header":"sys/ipc.h", "extensions":[]}, {"ident":"IPPROTO_ICMP", "id_type":"constant", "header":"netinet/in.h", "extensions":[]}, {"ident":"IPPROTO_IP", "id_type":"constant", "header":"netinet/in.h", "extensions":[]}, {"ident":"IPPROTO_IPV6", "id_type":"constant", "header":"netinet/in.h", "extensions":[]}, {"ident":"IPPROTO_RAW", "id_type":"constant", "header":"netinet/in.h", "extensions":[]}, {"ident":"IPPROTO_TCP", "id_type":"constant", "header":"netinet/in.h", "extensions":[]}, {"ident":"IPPROTO_UDP", "id_type":"constant", "header":"netinet/in.h", "extensions":[]}, {"ident":"IPV6_JOIN_GROUP", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IPV6_LEAVE_GROUP", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"ipv6_mreq", "id_type":"type", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IPV6_MULTICAST_HOPS", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IPV6_MULTICAST_IF", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IPV6_MULTICAST_LOOP", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IPV6_UNICAST_HOPS", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"IPV6_V6ONLY", "id_type":"constant", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"isalnum", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"isalnum_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"isalpha", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"isalpha_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"isascii", "id_type":"function", "header":"ctype.h", "extensions":["OB","XSI"]}, {"ident":"isastream", "id_type":"function", "header":"stropts.h", "extensions":[]}, {"ident":"isatty", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"isblank", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"isblank_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"iscntrl", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"iscntrl_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"isdigit", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"isdigit_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"isgraph", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"isgraph_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"ISIG", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"islower", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"islower_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"isprint", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"isprint_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"ispunct", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"ispunct_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"isspace", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"isspace_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"ISTRIP", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"isupper", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"isupper_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"iswalnum", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswalnum_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswalpha", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswalpha_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswblank", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswblank_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswcntrl", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswcntrl_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswctype", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswctype_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswdigit", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswdigit_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswgraph", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswgraph_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswlower", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswlower_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswprint", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswprint_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswpunct", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswpunct_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswspace", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswspace_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswupper", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswupper_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswxdigit", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"iswxdigit_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"isxdigit", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"isxdigit_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"ITIMER_PROF", "id_type":"constant", "header":"sys/time.h", "extensions":["IP6"]}, {"ident":"ITIMER_REAL", "id_type":"constant", "header":"sys/time.h", "extensions":["IP6"]}, {"ident":"ITIMER_VIRTUAL", "id_type":"constant", "header":"sys/time.h", "extensions":["IP6"]}, {"ident":"itimerspec", "id_type":"type", "header":"time.h", "extensions":["IP6"]}, {"ident":"itimerval", "id_type":"type", "header":"sys/time.h", "extensions":["IP6"]}, {"ident":"IXANY", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"IXOFF", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"IXON", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"j0", "id_type":"function", "header":"math.h", "extensions":["XSI"]}, {"ident":"j1", "id_type":"function", "header":"math.h", "extensions":["XSI"]}, {"ident":"jn", "id_type":"function", "header":"math.h", "extensions":["XSI"]}, {"ident":"jrand48", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"key_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"kill", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"killpg", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"l64a", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"L_ctermid", "id_type":"type", "header":"stdio.h", "extensions":[]}, {"ident":"L_tmpnam", "id_type":"type", "header":"stdio.h", "extensions":[]}, {"ident":"labs", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"lchown", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"lcong48", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"lconv", "id_type":"type", "header":"locale.h", "extensions":[]}, {"ident":"ldexp", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"ldexpf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"ldexpl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"ldiv", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"ldiv_t", "id_type":"type", "header":"stdlib.h", "extensions":[]}, {"ident":"lfind", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"lgamma", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"lgammaf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"lgammal", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"linger", "id_type":"type", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"link", "id_type":"function", "header":"unistd.h", "extensions":["IP6"]}, {"ident":"linkat", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"lio_listio", "id_type":"function", "header":"aio.h", "extensions":[]}, {"ident":"LIO_NOP", "id_type":"constant", "header":"aio.h", "extensions":[]}, {"ident":"LIO_NOWAIT", "id_type":"constant", "header":"aio.h", "extensions":[]}, {"ident":"LIO_READ", "id_type":"constant", "header":"aio.h", "extensions":[]}, {"ident":"LIO_WAIT", "id_type":"constant", "header":"aio.h", "extensions":[]}, {"ident":"LIO_WRITE", "id_type":"constant", "header":"aio.h", "extensions":[]}, {"ident":"listen", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"llabs", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"lldiv", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"lldiv_t", "id_type":"type", "header":"stdlib.h", "extensions":[]}, {"ident":"LLONG_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"LLONG_MIN", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"llrint", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"llrintf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"llrintl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"llround", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"llroundf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"llroundl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"locale_t", "id_type":"type", "header":"wchar.h", "extensions":["CX"]}, {"ident":"localeconv", "id_type":"function", "header":"locale.h", "extensions":[]}, {"ident":"localtime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"localtime_r", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"lockf", "id_type":"function", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"log", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"log10", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"log10f", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"log10l", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"log1p", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"log1pf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"log1pl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"log2", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"log2f", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"log2l", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"LOG_ALERT", "id_type":"macro", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_AUTH", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_CONS", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_CRIT", "id_type":"macro", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_CRON", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_DAEMON", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_DEBUG", "id_type":"macro", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_EMERG", "id_type":"macro", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_ERR", "id_type":"macro", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_INFO", "id_type":"macro", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_KERN", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_LOCAL0", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_LOCAL1", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_LOCAL2", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_LOCAL3", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_LOCAL4", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_LOCAL5", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_LOCAL6", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_LOCAL7", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_LPR", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_MAIL", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_MASK", "id_type":"macro", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_NDELAY", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_NEWS", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_NOTICE", "id_type":"macro", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_NOWAIT", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_ODELAY", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_PID", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_USER", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_UUCP", "id_type":"constant", "header":"syslog.h", "extensions":[]}, {"ident":"LOG_WARNING", "id_type":"macro", "header":"syslog.h", "extensions":[]}, {"ident":"logb", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"logbf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"logbl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"logf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"LOGIN_PROCESS", "id_type":"constant", "header":"utmpx.h", "extensions":[]}, {"ident":"logl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"LONG_BIT", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"LONG_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"LONG_MIN", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"longjmp", "id_type":"function", "header":"setjmp.h", "extensions":[]}, {"ident":"lrand48", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"lrint", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"lrintf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"lrintl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"lround", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"lroundf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"lroundl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"lsearch", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"lseek", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"lstat", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"M_1_PI", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_2_PI", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_2_SQRTPI", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_E", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_LN10", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_LN2", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_LOG10E", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_LOG2E", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_PI", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_PI_2", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_PI_4", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_SQRT1_2", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"M_SQRT2", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"malloc", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"MAP_FAILED", "id_type":"constant", "header":"sys/mman.h", "extensions":[]}, {"ident":"MAP_FIXED", "id_type":"constant", "header":"sys/mman.h", "extensions":[]}, {"ident":"MAP_PRIVATE", "id_type":"constant", "header":"sys/mman.h", "extensions":[]}, {"ident":"MAP_SHARED", "id_type":"constant", "header":"sys/mman.h", "extensions":[]}, {"ident":"MAXFLOAT", "id_type":"constant", "header":"math.h", "extensions":[]}, {"ident":"MB_CUR_MAX", "id_type":"macro", "header":"stdlib.h", "extensions":[]}, {"ident":"MB_LEN_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"mblen", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"mbrlen", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"mbrtowc", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"mbsinit", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"mbsnrtowcs", "id_type":"function", "header":"wchar.h", "extensions":["CX"]}, {"ident":"mbsrtowcs", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"mbstate_t", "id_type":"type", "header":"wchar.h", "extensions":["CX"]}, {"ident":"mbstowcs", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"mbtowc", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"MCL_CURRENT", "id_type":"constant", "header":"sys/mman.h", "extensions":["ML"]}, {"ident":"MCL_FUTURE", "id_type":"constant", "header":"sys/mman.h", "extensions":["ML"]}, {"ident":"memccpy", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"memchr", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"memcmp", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"memcpy", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"memmove", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"memset", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"MINSIGSTKSZ", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"mkdir", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"mkdirat", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"mkdtemp", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"mkfifo", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"mkfifoat", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"mknod", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"mknodat", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"mkstemp", "id_type":"function", "header":"stdlib.h", "extensions":["CX"]}, {"ident":"mktime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"mlock", "id_type":"function", "header":"sys/mman.h", "extensions":["MLR"]}, {"ident":"mlockall", "id_type":"function", "header":"sys/mman.h", "extensions":["ML"]}, {"ident":"MM_APPL", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_CONSOLE", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_ERROR", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_FIRM", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_HALT", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_HARD", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_INFO", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_NOSEV", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_NRECOV", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_OPSYS", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_PRINT", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_RECOVER", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_SOFT", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_UTIL", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"MM_WARNING", "id_type":"constant", "header":"fmtmsg.h", "extensions":[]}, {"ident":"mmap", "id_type":"function", "header":"sys/mman.h", "extensions":["TYM"]}, {"ident":"mode_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"modf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"modff", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"modfl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"MORECTL", "id_type":"constant", "header":"stropts.h", "extensions":[]}, {"ident":"MOREDATA", "id_type":"constant", "header":"stropts.h", "extensions":[]}, {"ident":"mprotect", "id_type":"function", "header":"sys/mman.h", "extensions":[]}, {"ident":"mq_attr", "id_type":"type", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_close", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_getattr", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_notify", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_open", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_receive", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_send", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_setattr", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_timedreceive", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_timedsend", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mq_unlink", "id_type":"function", "header":"mqueue.h", "extensions":[]}, {"ident":"mrand48", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"MS_ASYNC", "id_type":"constant", "header":"sys/mman.h", "extensions":["XSI","SIO"]}, {"ident":"MS_INVALIDATE", "id_type":"constant", "header":"sys/mman.h", "extensions":["XSI","SIO"]}, {"ident":"MS_SYNC", "id_type":"constant", "header":"sys/mman.h", "extensions":["XSI","SIO"]}, {"ident":"MSG_ANY", "id_type":"constant", "header":"stropts.h", "extensions":[]}, {"ident":"MSG_BAND", "id_type":"constant", "header":"stropts.h", "extensions":[]}, {"ident":"MSG_CTRUNC", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"MSG_DONTROUTE", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"MSG_EOR", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"MSG_HIPRI", "id_type":"constant", "header":"stropts.h", "extensions":[]}, {"ident":"MSG_NOERROR", "id_type":"constant", "header":"sys/msg.h", "extensions":[]}, {"ident":"MSG_NOSIGNAL", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"MSG_OOB", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"MSG_PEEK", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"MSG_TRUNC", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"MSG_WAITALL", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"msgctl", "id_type":"function", "header":"sys/msg.h", "extensions":[]}, {"ident":"msgget", "id_type":"function", "header":"sys/msg.h", "extensions":[]}, {"ident":"msghdr", "id_type":"type", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"msglen_t", "id_type":"type", "header":"sys/msg.h", "extensions":[]}, {"ident":"msgqnum_t", "id_type":"type", "header":"sys/msg.h", "extensions":[]}, {"ident":"msgrcv", "id_type":"function", "header":"sys/msg.h", "extensions":[]}, {"ident":"msgsnd", "id_type":"function", "header":"sys/msg.h", "extensions":[]}, {"ident":"msqid_ds", "id_type":"type", "header":"sys/msg.h", "extensions":[]}, {"ident":"msync", "id_type":"function", "header":"sys/mman.h", "extensions":["XSI","SIO"]}, {"ident":"munlock", "id_type":"function", "header":"sys/mman.h", "extensions":["MLR"]}, {"ident":"munlockall", "id_type":"function", "header":"sys/mman.h", "extensions":["ML"]}, {"ident":"munmap", "id_type":"function", "header":"sys/mman.h", "extensions":[]}, {"ident":"nan", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"NAN", "id_type":"macro", "header":"math.h", "extensions":[]}, {"ident":"nanf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nanl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nanosleep", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"NCCS", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"nearbyint", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nearbyintf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nearbyintl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"netent", "id_type":"type", "header":"netdb.h", "extensions":[]}, {"ident":"NEW_TIME", "id_type":"constant", "header":"utmpx.h", "extensions":[]}, {"ident":"newlocale", "id_type":"function", "header":"locale.h", "extensions":["CX"]}, {"ident":"nextafter", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nextafterf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nextafterl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nexttoward", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nexttowardf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nexttowardl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"nfds_t", "id_type":"type", "header":"poll.h", "extensions":[]}, {"ident":"nftw", "id_type":"function", "header":"ftw.h", "extensions":["OB"]}, {"ident":"NI_DGRAM", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"NI_NAMEREQD", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"NI_NOFQDN", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"NI_NUMERICHOST", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"NI_NUMERICSCOPE", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"NI_NUMERICSERV", "id_type":"constant", "header":"netdb.h", "extensions":[]}, {"ident":"nice", "id_type":"function", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"NL_ARGMAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"nl_langinfo", "id_type":"function", "header":"langinfo.h", "extensions":[]}, {"ident":"nl_langinfo_l", "id_type":"function", "header":"langinfo.h", "extensions":[]}, {"ident":"NL_LANGMAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"NL_MSGMAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"NL_SETMAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"NL_TEXTMAX", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"NLDLY", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"nlink_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"NOFLSH", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"not", "id_type":"macro", "header":"iso646.h", "extensions":["ADV"]}, {"ident":"not_eq", "id_type":"macro", "header":"iso646.h", "extensions":[]}, {"ident":"nrand48", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"ntohl", "id_type":"function", "header":"arpa/inet.h", "extensions":[]}, {"ident":"ntohs", "id_type":"function", "header":"arpa/inet.h", "extensions":[]}, {"ident":"NULL", "id_type":"macro", "header":"stddef.h", "extensions":[]}, {"ident":"NZERO", "id_type":"constant", "header":"limits.h", "extensions":[]}, {"ident":"O_ACCMODE", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_APPEND", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_CLOEXEC", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_CREAT", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_DIRECTORY", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_DSYNC", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_EXCL", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_EXEC", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_NOCTTY", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_NOFOLLOW", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_NONBLOCK", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_RDONLY", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_RDWR", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_RSYNC", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_SEARCH", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_SYNC", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_TRUNC", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_TTY_INIT", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"O_WRONLY", "id_type":"constant", "header":"fcntl.h", "extensions":[]}, {"ident":"OCRNL", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"OFDEL", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"off_t", "id_type":"type", "header":"stdio.h", "extensions":["CX"]}, {"ident":"offsetof", "id_type":"macro", "header":"stddef.h", "extensions":[]}, {"ident":"OFILL", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"OLD_TIME", "id_type":"constant", "header":"utmpx.h", "extensions":[]}, {"ident":"ONLCR", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"ONLRET", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"ONOCR", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"open", "id_type":"function", "header":"fcntl.h", "extensions":["ADV"]}, {"ident":"open_memstream", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"open_wmemstream", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"openat", "id_type":"function", "header":"fcntl.h", "extensions":[]}, {"ident":"opendir", "id_type":"function", "header":"dirent.h", "extensions":[]}, {"ident":"openlog", "id_type":"function", "header":"syslog.h", "extensions":[]}, {"ident":"OPOST", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"optarg", "id_type":"variable", "header":"unistd.h", "extensions":[]}, {"ident":"opterr", "id_type":"variable", "header":"unistd.h", "extensions":[]}, {"ident":"optind", "id_type":"variable", "header":"unistd.h", "extensions":[]}, {"ident":"optopt", "id_type":"variable", "header":"unistd.h", "extensions":[]}, {"ident":"or", "id_type":"macro", "header":"iso646.h", "extensions":["XSI"]}, {"ident":"or_eq", "id_type":"macro", "header":"iso646.h", "extensions":[]}, {"ident":"P_tmpdir", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"PARENB", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"PARMRK", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"PARODD", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"passwd", "id_type":"type", "header":"pwd.h", "extensions":["XSI"]}, {"ident":"pathconf", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"pause", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"pclose", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"perror", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"pid_t", "id_type":"type", "header":"signal.h", "extensions":["PS"]}, {"ident":"pipe", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"poll", "id_type":"function", "header":"poll.h", "extensions":[]}, {"ident":"POLLERR", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"pollfd", "id_type":"type", "header":"poll.h", "extensions":[]}, {"ident":"POLLHUP", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"POLLIN", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"POLLNVAL", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"POLLOUT", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"POLLPRI", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"POLLRDBAND", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"POLLRDNORM", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"POLLWRBAND", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"POLLWRNORM", "id_type":"constant", "header":"poll.h", "extensions":[]}, {"ident":"popen", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"POSIX_FADV_DONTNEED", "id_type":"constant", "header":"fcntl.h", "extensions":["ADV"]}, {"ident":"POSIX_FADV_NOREUSE", "id_type":"constant", "header":"fcntl.h", "extensions":["ADV"]}, {"ident":"POSIX_FADV_NORMAL", "id_type":"constant", "header":"fcntl.h", "extensions":["ADV"]}, {"ident":"POSIX_FADV_RANDOM", "id_type":"constant", "header":"fcntl.h", "extensions":["ADV"]}, {"ident":"POSIX_FADV_SEQUENTIAL", "id_type":"constant", "header":"fcntl.h", "extensions":["ADV"]}, {"ident":"POSIX_FADV_WILLNEED", "id_type":"constant", "header":"fcntl.h", "extensions":["ADV"]}, {"ident":"posix_fadvise", "id_type":"function", "header":"fcntl.h", "extensions":["ADV"]}, {"ident":"posix_fallocate", "id_type":"function", "header":"fcntl.h", "extensions":["ADV"]}, {"ident":"posix_madvise", "id_type":"function", "header":"sys/mman.h", "extensions":["ADV"]}, {"ident":"posix_mem_offset", "id_type":"function", "header":"sys/mman.h", "extensions":["TYM"]}, {"ident":"posix_memalign", "id_type":"function", "header":"stdlib.h", "extensions":["ADV"]}, {"ident":"posix_openpt", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"posix_spawn", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawn_file_actions_addclose", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawn_file_actions_adddup2", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawn_file_actions_addopen", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawn_file_actions_destroy", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawn_file_actions_init", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_destroy", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_getflags", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_getpgroup", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_getschedparam", "id_type":"function", "header":"spawn.h", "extensions":["PS"]}, {"ident":"posix_spawnattr_getschedpolicy", "id_type":"function", "header":"spawn.h", "extensions":["PS"]}, {"ident":"posix_spawnattr_getsigdefault", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_getsigmask", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_init", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_setflags", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_setpgroup", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_setschedparam", "id_type":"function", "header":"spawn.h", "extensions":["PS"]}, {"ident":"posix_spawnattr_setschedpolicy", "id_type":"function", "header":"spawn.h", "extensions":["PS"]}, {"ident":"posix_spawnattr_setsigdefault", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnattr_setsigmask", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_spawnp", "id_type":"function", "header":"spawn.h", "extensions":[]}, {"ident":"posix_trace_attr_destroy", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_getclockres", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_getcreatetime", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_getgenversion", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_getinherited", "id_type":"function", "header":"trace.h", "extensions":["TRI"]}, {"ident":"posix_trace_attr_getlogfullpolicy", "id_type":"function", "header":"trace.h", "extensions":["TRL"]}, {"ident":"posix_trace_attr_getlogsize", "id_type":"function", "header":"trace.h", "extensions":["TRL"]}, {"ident":"posix_trace_attr_getmaxdatasize", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_getmaxsystemeventsize", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_getmaxusereventsize", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_getname", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_getstreamfullpolicy", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_getstreamsize", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_init", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_setinherited", "id_type":"function", "header":"trace.h", "extensions":["TRI"]}, {"ident":"posix_trace_attr_setlogfullpolicy", "id_type":"function", "header":"trace.h", "extensions":["TRL"]}, {"ident":"posix_trace_attr_setlogsize", "id_type":"function", "header":"trace.h", "extensions":["TRL"]}, {"ident":"posix_trace_attr_setmaxdatasize", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_setname", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_setstreamfullpolicy", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_attr_setstreamsize", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_clear", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_close", "id_type":"function", "header":"trace.h", "extensions":["TRL"]}, {"ident":"posix_trace_create", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_create_withlog", "id_type":"function", "header":"trace.h", "extensions":["TRL"]}, {"ident":"posix_trace_event", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_event_info", "id_type":"type", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_eventid_equal", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_eventid_get_name", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_eventid_open", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_eventset_add", "id_type":"function", "header":"trace.h", "extensions":["TEF"]}, {"ident":"posix_trace_eventset_del", "id_type":"function", "header":"trace.h", "extensions":["TEF"]}, {"ident":"posix_trace_eventset_empty", "id_type":"function", "header":"trace.h", "extensions":["TEF"]}, {"ident":"posix_trace_eventset_fill", "id_type":"function", "header":"trace.h", "extensions":["TEF"]}, {"ident":"posix_trace_eventset_ismember", "id_type":"function", "header":"trace.h", "extensions":["TEF"]}, {"ident":"posix_trace_eventtypelist_getnext_id", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_eventtypelist_rewind", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_flush", "id_type":"function", "header":"trace.h", "extensions":["TRL"]}, {"ident":"posix_trace_get_attr", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_get_filter", "id_type":"function", "header":"trace.h", "extensions":["TEF"]}, {"ident":"posix_trace_get_status", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_getnext_event", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_open", "id_type":"function", "header":"trace.h", "extensions":["TRL"]}, {"ident":"posix_trace_rewind", "id_type":"function", "header":"trace.h", "extensions":["TRL"]}, {"ident":"posix_trace_set_filter", "id_type":"function", "header":"trace.h", "extensions":["TEF"]}, {"ident":"posix_trace_shutdown", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_start", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_status_info", "id_type":"type", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_stop", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_timedgetnext_event", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"posix_trace_trid_eventid_open", "id_type":"function", "header":"trace.h", "extensions":["TEF"]}, {"ident":"posix_trace_trygetnext_event", "id_type":"function", "header":"trace.h", "extensions":[]}, {"ident":"POSIX_TYPED_MEM_ALLOCATE", "id_type":"constant", "header":"sys/mman.h", "extensions":["TYM"]}, {"ident":"POSIX_TYPED_MEM_ALLOCATE_CONTIG", "id_type":"constant", "header":"sys/mman.h", "extensions":["TYM"]}, {"ident":"posix_typed_mem_get_info", "id_type":"function", "header":"sys/mman.h", "extensions":["TYM"]}, {"ident":"posix_typed_mem_info", "id_type":"type", "header":"sys/mman.h", "extensions":["TYM"]}, {"ident":"POSIX_TYPED_MEM_MAP_ALLOCATABLE", "id_type":"constant", "header":"sys/mman.h", "extensions":["TYM"]}, {"ident":"posix_typed_mem_open", "id_type":"function", "header":"sys/mman.h", "extensions":["TYM"]}, {"ident":"pow", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"powf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"powl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"pread", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"printf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"PRIO_PGRP", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"PRIO_PROCESS", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"PRIO_USER", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"PROT_EXEC", "id_type":"constant", "header":"sys/mman.h", "extensions":[]}, {"ident":"PROT_NONE", "id_type":"constant", "header":"sys/mman.h", "extensions":[]}, {"ident":"PROT_READ", "id_type":"constant", "header":"sys/mman.h", "extensions":[]}, {"ident":"PROT_WRITE", "id_type":"constant", "header":"sys/mman.h", "extensions":[]}, {"ident":"protoent", "id_type":"type", "header":"netdb.h", "extensions":[]}, {"ident":"pselect", "id_type":"function", "header":"sys/select.h", "extensions":[]}, {"ident":"psiginfo", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"psignal", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"pthread_atfork", "id_type":"function", "header":"pthread.h", "extensions":["OB"]}, {"ident":"pthread_attr_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_attr_getdetachstate", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_attr_getguardsize", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_attr_getinheritsched", "id_type":"function", "header":"pthread.h", "extensions":["TPS"]}, {"ident":"pthread_attr_getschedparam", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_attr_getschedpolicy", "id_type":"function", "header":"pthread.h", "extensions":["TPS"]}, {"ident":"pthread_attr_getscope", "id_type":"function", "header":"pthread.h", "extensions":["TPS"]}, {"ident":"pthread_attr_getstack", "id_type":"function", "header":"pthread.h", "extensions":["TSA","TSS"]}, {"ident":"pthread_attr_getstacksize", "id_type":"function", "header":"pthread.h", "extensions":["TSS"]}, {"ident":"pthread_attr_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_attr_setdetachstate", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_attr_setguardsize", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_attr_setinheritsched", "id_type":"function", "header":"pthread.h", "extensions":["TPS"]}, {"ident":"pthread_attr_setschedparam", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_attr_setschedpolicy", "id_type":"function", "header":"pthread.h", "extensions":["TPS"]}, {"ident":"pthread_attr_setscope", "id_type":"function", "header":"pthread.h", "extensions":["TPS"]}, {"ident":"pthread_attr_setstack", "id_type":"function", "header":"pthread.h", "extensions":["TSA","TSS"]}, {"ident":"pthread_attr_setstacksize", "id_type":"function", "header":"pthread.h", "extensions":["TSS"]}, {"ident":"pthread_attr_t", "id_type":"type", "header":"sys/types.h", "extensions":["TPS"]}, {"ident":"pthread_barrier_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_barrier_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_barrier_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"pthread_barrier_wait", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_barrierattr_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_barrierattr_getpshared", "id_type":"function", "header":"pthread.h", "extensions":["TSH"]}, {"ident":"pthread_barrierattr_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_barrierattr_setpshared", "id_type":"function", "header":"pthread.h", "extensions":["TSH"]}, {"ident":"pthread_barrierattr_t", "id_type":"type", "header":"sys/types.h", "extensions":["TSH"]}, {"ident":"pthread_cancel", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_cleanup_pop", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_cleanup_push", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_cond_broadcast", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_cond_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_cond_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_cond_signal", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_cond_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"pthread_cond_timedwait", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_cond_wait", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_condattr_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_condattr_getclock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_condattr_getpshared", "id_type":"function", "header":"pthread.h", "extensions":["TSH"]}, {"ident":"pthread_condattr_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_condattr_setclock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_condattr_setpshared", "id_type":"function", "header":"pthread.h", "extensions":["TSH"]}, {"ident":"pthread_condattr_t", "id_type":"type", "header":"sys/types.h", "extensions":["TSH"]}, {"ident":"pthread_create", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_detach", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_equal", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_exit", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_getconcurrency", "id_type":"function", "header":"pthread.h", "extensions":["OB","XSI"]}, {"ident":"pthread_getcpuclockid", "id_type":"function", "header":"pthread.h", "extensions":["TCT"]}, {"ident":"pthread_getschedparam", "id_type":"function", "header":"pthread.h", "extensions":["TPS"]}, {"ident":"pthread_getspecific", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_join", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_key_create", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_key_delete", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_key_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"pthread_kill", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"pthread_mutex_consistent", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutex_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutex_getprioceiling", "id_type":"function", "header":"pthread.h", "extensions":["RPP","TPP"]}, {"ident":"pthread_mutex_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutex_lock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutex_setprioceiling", "id_type":"function", "header":"pthread.h", "extensions":["RPP","TPP"]}, {"ident":"pthread_mutex_t", "id_type":"type", "header":"sys/types.h", "extensions":["RPP","TPP"]}, {"ident":"pthread_mutex_timedlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutex_trylock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutex_unlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutexattr_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutexattr_getprioceiling", "id_type":"function", "header":"pthread.h", "extensions":["RPP","TPP"]}, {"ident":"pthread_mutexattr_getprotocol", "id_type":"function", "header":"pthread.h", "extensions":["MC1"]}, {"ident":"pthread_mutexattr_getpshared", "id_type":"function", "header":"pthread.h", "extensions":["TSH"]}, {"ident":"pthread_mutexattr_getrobust", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutexattr_gettype", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutexattr_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutexattr_setprioceiling", "id_type":"function", "header":"pthread.h", "extensions":["RPP","TPP"]}, {"ident":"pthread_mutexattr_setprotocol", "id_type":"function", "header":"pthread.h", "extensions":["MC1"]}, {"ident":"pthread_mutexattr_setpshared", "id_type":"function", "header":"pthread.h", "extensions":["TSH"]}, {"ident":"pthread_mutexattr_setrobust", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutexattr_settype", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_mutexattr_t", "id_type":"type", "header":"sys/types.h", "extensions":["RPP","TPP"]}, {"ident":"pthread_once", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_once_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"pthread_rwlock_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlock_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlock_rdlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlock_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"pthread_rwlock_timedrdlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlock_timedwrlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlock_tryrdlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlock_trywrlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlock_unlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlock_wrlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlockattr_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlockattr_getpshared", "id_type":"function", "header":"pthread.h", "extensions":["TSH"]}, {"ident":"pthread_rwlockattr_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_rwlockattr_setpshared", "id_type":"function", "header":"pthread.h", "extensions":["TSH"]}, {"ident":"pthread_rwlockattr_t", "id_type":"type", "header":"sys/types.h", "extensions":["TSH"]}, {"ident":"pthread_self", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_setcancelstate", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_setcanceltype", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_setconcurrency", "id_type":"function", "header":"pthread.h", "extensions":["OB","XSI"]}, {"ident":"pthread_setschedparam", "id_type":"function", "header":"pthread.h", "extensions":["TPS"]}, {"ident":"pthread_setschedprio", "id_type":"function", "header":"pthread.h", "extensions":["TPS"]}, {"ident":"pthread_setspecific", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_sigmask", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"pthread_spin_destroy", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_spin_init", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_spin_lock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_spin_trylock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_spin_unlock", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"pthread_spinlock_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"pthread_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"pthread_testcancel", "id_type":"function", "header":"pthread.h", "extensions":[]}, {"ident":"ptrdiff_t", "id_type":"macro", "header":"stddef.h", "extensions":[]}, {"ident":"ptsname", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"putc", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"putc_unlocked", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"putchar", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"putchar_unlocked", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"putenv", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"putmsg", "id_type":"function", "header":"stropts.h", "extensions":[]}, {"ident":"putpmsg", "id_type":"function", "header":"stropts.h", "extensions":[]}, {"ident":"puts", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"pututxline", "id_type":"function", "header":"utmpx.h", "extensions":[]}, {"ident":"putwc", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"putwchar", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"pwrite", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"qsort", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"R_OK", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"raise", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"rand", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"RAND_MAX", "id_type":"macro", "header":"stdlib.h", "extensions":[]}, {"ident":"rand_r", "id_type":"function", "header":"stdlib.h", "extensions":["OB","CX"]}, {"ident":"random", "id_type":"function", "header":"stdlib.h", "extensions":["ADV"]}, {"ident":"read", "id_type":"function", "header":"unistd.h", "extensions":["OB","XSR"]}, {"ident":"readdir", "id_type":"function", "header":"dirent.h", "extensions":[]}, {"ident":"readdir_r", "id_type":"function", "header":"dirent.h", "extensions":[]}, {"ident":"readlink", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"readlinkat", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"readv", "id_type":"function", "header":"sys/uio.h", "extensions":["XSI"]}, {"ident":"realloc", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"realpath", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"recv", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"recvfrom", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"recvmsg", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"REG_BADBR", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_BADPAT", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_BADRPT", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_EBRACE", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_EBRACK", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_ECOLLATE", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_ECTYPE", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_EESCAPE", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_EPAREN", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_ERANGE", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_ESPACE", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_ESUBREG", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_EXTENDED", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_ICASE", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_NEWLINE", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_NOMATCH", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_NOSUB", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_NOTBOL", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"REG_NOTEOL", "id_type":"constant", "header":"regex.h", "extensions":[]}, {"ident":"regcomp", "id_type":"function", "header":"regex.h", "extensions":[]}, {"ident":"regerror", "id_type":"function", "header":"regex.h", "extensions":[]}, {"ident":"regex_t", "id_type":"type", "header":"regex.h", "extensions":[]}, {"ident":"regexec", "id_type":"function", "header":"regex.h", "extensions":[]}, {"ident":"regfree", "id_type":"function", "header":"regex.h", "extensions":[]}, {"ident":"regmatch_t", "id_type":"type", "header":"regex.h", "extensions":[]}, {"ident":"regoff_t", "id_type":"type", "header":"regex.h", "extensions":[]}, {"ident":"remainder", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"remainderf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"remainderl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"remove", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"remque", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"remquo", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"remquof", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"remquol", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"rename", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"renameat", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"rewind", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"rewinddir", "id_type":"function", "header":"dirent.h", "extensions":[]}, {"ident":"rint", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"rintf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"rintl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"RLIM_INFINITY", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"RLIM_SAVED_CUR", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"RLIM_SAVED_MAX", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"rlim_t", "id_type":"type", "header":"sys/resource.h", "extensions":[]}, {"ident":"rlimit", "id_type":"type", "header":"sys/resource.h", "extensions":[]}, {"ident":"RLIMIT_AS", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"RLIMIT_CORE", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"RLIMIT_CPU", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"RLIMIT_DATA", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"RLIMIT_FSIZE", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"RLIMIT_NOFILE", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"RLIMIT_STACK", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"rmdir", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"round", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"roundf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"roundl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"rusage", "id_type":"type", "header":"sys/resource.h", "extensions":[]}, {"ident":"RUSAGE_CHILDREN", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"RUSAGE_SELF", "id_type":"constant", "header":"sys/resource.h", "extensions":[]}, {"ident":"S_IFMT", "id_type":"constant", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"SA_NOCLDSTOP", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SA_NOCLDWAIT", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SA_NODEFER", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SA_ONSTACK", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SA_RESETHAND", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SA_RESTART", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SA_SIGINFO", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"scalbln", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"scalblnf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"scalblnl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"scalbn", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"scalbnf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"scalbnl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"scandir", "id_type":"function", "header":"dirent.h", "extensions":[]}, {"ident":"scanf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"SCHAR_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"SCHAR_MIN", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"sched_get_priority_max", "id_type":"function", "header":"sched.h", "extensions":["PS","TPS"]}, {"ident":"sched_get_priority_min", "id_type":"function", "header":"sched.h", "extensions":["PS","TPS"]}, {"ident":"sched_getparam", "id_type":"function", "header":"sched.h", "extensions":["PS"]}, {"ident":"sched_getscheduler", "id_type":"function", "header":"sched.h", "extensions":["PS"]}, {"ident":"sched_param", "id_type":"type", "header":"sched.h", "extensions":["TPS"]}, {"ident":"sched_rr_get_interval", "id_type":"function", "header":"sched.h", "extensions":["PS","TPS"]}, {"ident":"sched_setparam", "id_type":"function", "header":"sched.h", "extensions":["PS"]}, {"ident":"sched_setscheduler", "id_type":"function", "header":"sched.h", "extensions":["PS"]}, {"ident":"sched_yield", "id_type":"function", "header":"sched.h", "extensions":[]}, {"ident":"SCM_RIGHTS", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"seed48", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"SEEK_CUR", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"SEEK_END", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"SEEK_SET", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"seekdir", "id_type":"function", "header":"dirent.h", "extensions":["XSI"]}, {"ident":"select", "id_type":"function", "header":"sys/select.h", "extensions":[]}, {"ident":"sem_close", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"sem_destroy", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"sem_getvalue", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"sem_init", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"sem_open", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"sem_post", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"sem_timedwait", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"sem_trywait", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"SEM_UNDO", "id_type":"constant", "header":"sys/sem.h", "extensions":[]}, {"ident":"sem_unlink", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"sem_wait", "id_type":"function", "header":"semaphore.h", "extensions":[]}, {"ident":"sembuf", "id_type":"type", "header":"sys/sem.h", "extensions":[]}, {"ident":"semctl", "id_type":"function", "header":"sys/sem.h", "extensions":[]}, {"ident":"semget", "id_type":"function", "header":"sys/sem.h", "extensions":[]}, {"ident":"semid_ds", "id_type":"type", "header":"sys/sem.h", "extensions":[]}, {"ident":"semop", "id_type":"function", "header":"sys/sem.h", "extensions":[]}, {"ident":"send", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"sendmsg", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"sendto", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"servent", "id_type":"type", "header":"netdb.h", "extensions":[]}, {"ident":"SETALL", "id_type":"constant", "header":"sys/sem.h", "extensions":[]}, {"ident":"setbuf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"setegid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"setenv", "id_type":"function", "header":"stdlib.h", "extensions":["CX"]}, {"ident":"seteuid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"setgid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"setgrent", "id_type":"function", "header":"grp.h", "extensions":["XSI"]}, {"ident":"sethostent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"setitimer", "id_type":"function", "header":"sys/time.h", "extensions":["IP6"]}, {"ident":"setjmp", "id_type":"function", "header":"setjmp.h", "extensions":[]}, {"ident":"setkey", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"setlocale", "id_type":"function", "header":"locale.h", "extensions":[]}, {"ident":"setlogmask", "id_type":"function", "header":"syslog.h", "extensions":[]}, {"ident":"setnetent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"setpgid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"setpgrp", "id_type":"function", "header":"unistd.h", "extensions":["OB","XSI"]}, {"ident":"setpriority", "id_type":"function", "header":"sys/resource.h", "extensions":[]}, {"ident":"setprotoent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"setpwent", "id_type":"function", "header":"pwd.h", "extensions":["XSI"]}, {"ident":"setregid", "id_type":"function", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"setreuid", "id_type":"function", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"setrlimit", "id_type":"function", "header":"sys/resource.h", "extensions":[]}, {"ident":"setservent", "id_type":"function", "header":"netdb.h", "extensions":[]}, {"ident":"setsid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"setsockopt", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"setstate", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"setuid", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"setutxent", "id_type":"function", "header":"utmpx.h", "extensions":[]}, {"ident":"SETVAL", "id_type":"constant", "header":"sys/sem.h", "extensions":[]}, {"ident":"setvbuf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"shm_open", "id_type":"function", "header":"sys/mman.h", "extensions":["SHM"]}, {"ident":"SHM_RDONLY", "id_type":"constant", "header":"sys/shm.h", "extensions":[]}, {"ident":"SHM_RND", "id_type":"constant", "header":"sys/shm.h", "extensions":[]}, {"ident":"shm_unlink", "id_type":"function", "header":"sys/mman.h", "extensions":["SHM"]}, {"ident":"shmat", "id_type":"function", "header":"sys/shm.h", "extensions":[]}, {"ident":"shmatt_t", "id_type":"type", "header":"sys/shm.h", "extensions":[]}, {"ident":"shmctl", "id_type":"function", "header":"sys/shm.h", "extensions":[]}, {"ident":"shmdt", "id_type":"function", "header":"sys/shm.h", "extensions":[]}, {"ident":"shmget", "id_type":"function", "header":"sys/shm.h", "extensions":[]}, {"ident":"shmid_ds", "id_type":"type", "header":"sys/shm.h", "extensions":[]}, {"ident":"SHMLBA", "id_type":"constant", "header":"sys/shm.h", "extensions":[]}, {"ident":"SHRT_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"SHRT_MIN", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"SHUT_RD", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SHUT_RDWR", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SHUT_WR", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"shutdown", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"sig_atomic_t", "id_type":"type", "header":"signal.h", "extensions":[]}, {"ident":"SIG_BLOCK", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SIG_DFL", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SIG_ERR", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SIG_HOLD", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SIG_IGN", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SIG_SETMASK", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SIG_UNBLOCK", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"sigaction", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigaction", "id_type":"type", "header":"signal.h", "extensions":[]}, {"ident":"sigaddset", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigaltstack", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigdelset", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigemptyset", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"SIGEV_NONE", "id_type":"constant", "header":"signal.h", "extensions":[]}, {"ident":"SIGEV_SIGNAL", "id_type":"constant", "header":"signal.h", "extensions":[]}, {"ident":"SIGEV_THREAD", "id_type":"constant", "header":"signal.h", "extensions":[]}, {"ident":"sigevent", "id_type":"type", "header":"signal.h", "extensions":["CX"]}, {"ident":"sigfillset", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sighold", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigignore", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"siginfo_t", "id_type":"type", "header":"signal.h", "extensions":[]}, {"ident":"siginterrupt", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigismember", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"siglongjmp", "id_type":"function", "header":"setjmp.h", "extensions":["CX"]}, {"ident":"signal", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"signgam", "id_type":"variable", "header":"math.h", "extensions":[]}, {"ident":"sigpause", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigpending", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigprocmask", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigqueue", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigrelse", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigset", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigset_t", "id_type":"type", "header":"signal.h", "extensions":[]}, {"ident":"sigsetjmp", "id_type":"function", "header":"setjmp.h", "extensions":["CX"]}, {"ident":"SIGSTKSZ", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"sigsuspend", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigtimedwait", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigval", "id_type":"type", "header":"signal.h", "extensions":[]}, {"ident":"sigwait", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sigwaitinfo", "id_type":"function", "header":"signal.h", "extensions":[]}, {"ident":"sin", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"sinf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"sinh", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"sinhf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"sinhl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"sinl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"size_t", "id_type":"macro", "header":"stddef.h", "extensions":["TSA","TSS"]}, {"ident":"sleep", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"snprintf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"SO_ACCEPTCONN", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_BROADCAST", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_DEBUG", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_DONTROUTE", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_ERROR", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_KEEPALIVE", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_LINGER", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_OOBINLINE", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_RCVBUF", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_RCVLOWAT", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_RCVTIMEO", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_REUSEADDR", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_SNDBUF", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_SNDLOWAT", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_SNDTIMEO", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SO_TYPE", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SOCK_DGRAM", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SOCK_RAW", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SOCK_SEQPACKET", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SOCK_STREAM", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"sockaddr", "id_type":"type", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"sockaddr_in", "id_type":"type", "header":"netinet/in.h", "extensions":[]}, {"ident":"sockaddr_in6", "id_type":"type", "header":"netinet/in.h", "extensions":["IP6"]}, {"ident":"sockaddr_un", "id_type":"type", "header":"sys/un.h", "extensions":[]}, {"ident":"sockatmark", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"socket", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"socketpair", "id_type":"function", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SOL_SOCKET", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"SOMAXCONN", "id_type":"constant", "header":"sys/socket.h", "extensions":["IP6"]}, {"ident":"speed_t", "id_type":"type", "header":"termios.h", "extensions":[]}, {"ident":"sprintf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"sqrt", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"sqrtf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"sqrtl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"srand", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"srand48", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"srandom", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"SS_DISABLE", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"SS_ONSTACK", "id_type":"macro", "header":"signal.h", "extensions":[]}, {"ident":"sscanf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"SSIZE_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"ssize_t", "id_type":"type", "header":"stdio.h", "extensions":["CX"]}, {"ident":"ST_NOSUID", "id_type":"constant", "header":"sys/statvfs.h", "extensions":[]}, {"ident":"ST_RDONLY", "id_type":"constant", "header":"sys/statvfs.h", "extensions":[]}, {"ident":"stack_t", "id_type":"type", "header":"signal.h", "extensions":[]}, {"ident":"stat", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"stat", "id_type":"type", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"static_assert", "id_type":"macro", "header":"assert.h", "extensions":[]}, {"ident":"statvfs", "id_type":"function", "header":"sys/statvfs.h", "extensions":[]}, {"ident":"statvfs", "id_type":"type", "header":"sys/statvfs.h", "extensions":[]}, {"ident":"stderr", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"STDERR_FILENO", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"stdin", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"STDIN_FILENO", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"stdout", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"STDOUT_FILENO", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"stpcpy", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"stpncpy", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"str_list", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"str_mlist", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"strbuf", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"strcasecmp", "id_type":"function", "header":"strings.h", "extensions":[]}, {"ident":"strcasecmp_l", "id_type":"function", "header":"strings.h", "extensions":[]}, {"ident":"strcat", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strchr", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strcmp", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strcoll", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strcoll_l", "id_type":"function", "header":"string.h", "extensions":["CX"]}, {"ident":"strcpy", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strcspn", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strdup", "id_type":"function", "header":"string.h", "extensions":["XSI"]}, {"ident":"strerror", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strerror_l", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strerror_r", "id_type":"function", "header":"string.h", "extensions":["CX"]}, {"ident":"strfdinsert", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"strfmon", "id_type":"function", "header":"monetary.h", "extensions":[]}, {"ident":"strfmon_l", "id_type":"function", "header":"monetary.h", "extensions":[]}, {"ident":"strftime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"strftime_l", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"strioctl", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"strlen", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strncasecmp", "id_type":"function", "header":"strings.h", "extensions":[]}, {"ident":"strncasecmp_l", "id_type":"function", "header":"strings.h", "extensions":[]}, {"ident":"strncat", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strncmp", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strncpy", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strndup", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strnlen", "id_type":"function", "header":"string.h", "extensions":["CX"]}, {"ident":"strpbrk", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strpeek", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"strptime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"strrchr", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strrecvfd", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"strsignal", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strspn", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strstr", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strtod", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"strtof", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"strtoimax", "id_type":"function", "header":"inttypes.h", "extensions":[]}, {"ident":"strtok", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strtok_r", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strtol", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"strtold", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"strtoll", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"strtoul", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"strtoull", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"strtoumax", "id_type":"function", "header":"inttypes.h", "extensions":[]}, {"ident":"strxfrm", "id_type":"function", "header":"string.h", "extensions":[]}, {"ident":"strxfrm_l", "id_type":"function", "header":"string.h", "extensions":["CX"]}, {"ident":"suseconds_t", "id_type":"type", "header":"sys/types.h", "extensions":["XSI"]}, {"ident":"swab", "id_type":"function", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"swprintf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"swscanf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"symlink", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"symlinkat", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"sync", "id_type":"function", "header":"unistd.h", "extensions":["XSI"]}, {"ident":"sysconf", "id_type":"function", "header":"unistd.h", "extensions":["ADV"]}, {"ident":"syslog", "id_type":"function", "header":"syslog.h", "extensions":[]}, {"ident":"system", "id_type":"function", "header":"stdlib.h", "extensions":["IP6"]}, {"ident":"t_scalar_t", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"t_uscalar_t", "id_type":"type", "header":"stropts.h", "extensions":[]}, {"ident":"TABDLY", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"tan", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"tanf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"tanh", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"tanhf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"tanhl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"tanl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"tcdrain", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"tcflag_t", "id_type":"type", "header":"termios.h", "extensions":[]}, {"ident":"tcflow", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"tcflush", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"tcgetattr", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"tcgetpgrp", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"tcgetsid", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"TCIFLUSH", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"TCIOFF", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"TCIOFLUSH", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"TCION", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"TCOFLUSH", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"TCOOFF", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"TCOON", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"TCP_NODELAY", "id_type":"constant", "header":"netinet/tcp.h", "extensions":[]}, {"ident":"TCSADRAIN", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"TCSAFLUSH", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"TCSANOW", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"tcsendbreak", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"tcsetattr", "id_type":"function", "header":"termios.h", "extensions":[]}, {"ident":"tcsetpgrp", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"tdelete", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"telldir", "id_type":"function", "header":"dirent.h", "extensions":["XSI"]}, {"ident":"tempnam", "id_type":"function", "header":"stdio.h", "extensions":["OB","XSI"]}, {"ident":"termios", "id_type":"type", "header":"termios.h", "extensions":[]}, {"ident":"tfind", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"tgamma", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"tgammaf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"tgammal", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"time", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"time_t", "id_type":"type", "header":"sys/types.h", "extensions":["SS","TSP"]}, {"ident":"TIMER_ABSTIME", "id_type":"constant", "header":"time.h", "extensions":["IP6"]}, {"ident":"timer_create", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"timer_delete", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"timer_getoverrun", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"timer_gettime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"timer_settime", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"timer_t", "id_type":"type", "header":"sys/types.h", "extensions":["CX"]}, {"ident":"times", "id_type":"function", "header":"sys/times.h", "extensions":["OB"]}, {"ident":"timespec", "id_type":"type", "header":"time.h", "extensions":["IP6"]}, {"ident":"timeval", "id_type":"type", "header":"sys/time.h", "extensions":["IP6"]}, {"ident":"timezone", "id_type":"variable", "header":"time.h", "extensions":["IP6"]}, {"ident":"tm", "id_type":"type", "header":"time.h", "extensions":["IP6"]}, {"ident":"TMP_MAX", "id_type":"macro", "header":"stdio.h", "extensions":[]}, {"ident":"tmpfile", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"tmpnam", "id_type":"function", "header":"stdio.h", "extensions":["OB"]}, {"ident":"tms", "id_type":"type", "header":"sys/times.h", "extensions":["OB"]}, {"ident":"toascii", "id_type":"function", "header":"ctype.h", "extensions":["OB","XSI"]}, {"ident":"tolower", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"tolower_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"TOSTOP", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"toupper", "id_type":"function", "header":"ctype.h", "extensions":[]}, {"ident":"toupper_l", "id_type":"function", "header":"ctype.h", "extensions":["CX"]}, {"ident":"towctrans", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"towctrans_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"towlower", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"towlower_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"towupper", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"towupper_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"trace_attr_t", "id_type":"type", "header":"sys/types.h", "extensions":["OB","TRC"]}, {"ident":"trace_event_id_t", "id_type":"type", "header":"sys/types.h", "extensions":["OB","TRC"]}, {"ident":"trace_event_set_t", "id_type":"type", "header":"sys/types.h", "extensions":["OB","TEF"]}, {"ident":"trace_id_t", "id_type":"type", "header":"sys/types.h", "extensions":["OB","TRC"]}, {"ident":"true", "id_type":"macro", "header":"stdbool.h", "extensions":[]}, {"ident":"trunc", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"truncate", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"truncf", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"truncl", "id_type":"function", "header":"math.h", "extensions":[]}, {"ident":"tsearch", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"ttyname", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"ttyname_r", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"twalk", "id_type":"function", "header":"search.h", "extensions":[]}, {"ident":"tzname", "id_type":"variable", "header":"time.h", "extensions":["IP6"]}, {"ident":"tzset", "id_type":"function", "header":"time.h", "extensions":["IP6"]}, {"ident":"UCHAR_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"ucontext_t", "id_type":"type", "header":"signal.h", "extensions":[]}, {"ident":"uid_t", "id_type":"type", "header":"sys/types.h", "extensions":[]}, {"ident":"UINT_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"ulimit", "id_type":"function", "header":"ulimit.h", "extensions":[]}, {"ident":"ULLONG_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"ULONG_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"umask", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"uname", "id_type":"function", "header":"sys/utsname.h", "extensions":[]}, {"ident":"ungetc", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"ungetwc", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"unlink", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"unlinkat", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"unlockpt", "id_type":"function", "header":"stdlib.h", "extensions":["XSI"]}, {"ident":"unsetenv", "id_type":"function", "header":"stdlib.h", "extensions":["CX"]}, {"ident":"USER_PROCESS", "id_type":"constant", "header":"utmpx.h", "extensions":[]}, {"ident":"USHRT_MAX", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"usleep", "id_type":"function", "header":"unistd.h", "extensions":["OB","REM"]}, {"ident":"utimbuf", "id_type":"type", "header":"utime.h", "extensions":[]}, {"ident":"utime", "id_type":"function", "header":"utime.h", "extensions":[]}, {"ident":"utimensat", "id_type":"function", "header":"sys/stat.h", "extensions":["OB"]}, {"ident":"utimes", "id_type":"function", "header":"sys/time.h", "extensions":["IP6"]}, {"ident":"utmpx", "id_type":"type", "header":"utmpx.h", "extensions":[]}, {"ident":"utsname", "id_type":"type", "header":"sys/utsname.h", "extensions":[]}, {"ident":"va_arg", "id_type":"type", "header":"stdarg.h", "extensions":[]}, {"ident":"va_copy", "id_type":"macro", "header":"stdarg.h", "extensions":[]}, {"ident":"va_end", "id_type":"macro", "header":"stdarg.h", "extensions":[]}, {"ident":"va_list", "id_type":"type", "header":"stdarg.h", "extensions":[]}, {"ident":"va_start", "id_type":"macro", "header":"stdarg.h", "extensions":[]}, {"ident":"vdprintf", "id_type":"function", "header":"stdio.h", "extensions":["CX"]}, {"ident":"vfprintf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"vfscanf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"vfwprintf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"vfwscanf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"vprintf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"vscanf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"vsnprintf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"vsprintf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"vsscanf", "id_type":"function", "header":"stdio.h", "extensions":[]}, {"ident":"vswprintf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"vswscanf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"VTDLY", "id_type":"constant", "header":"termios.h", "extensions":[]}, {"ident":"vwprintf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"vwscanf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"W_OK", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"wait", "id_type":"function", "header":"sys/wait.h", "extensions":[]}, {"ident":"waitid", "id_type":"function", "header":"sys/wait.h", "extensions":[]}, {"ident":"waitpid", "id_type":"function", "header":"sys/wait.h", "extensions":[]}, {"ident":"WCHAR_MAX", "id_type":"macro", "header":"wchar.h", "extensions":[]}, {"ident":"WCHAR_MIN", "id_type":"macro", "header":"wchar.h", "extensions":[]}, {"ident":"wchar_t", "id_type":"macro", "header":"stddef.h", "extensions":["CX"]}, {"ident":"WCONTINUED", "id_type":"constant", "header":"sys/wait.h", "extensions":["XSI"]}, {"ident":"wcpcpy", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcpncpy", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcrtomb", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcscasecmp", "id_type":"function", "header":"wchar.h", "extensions":["CX"]}, {"ident":"wcscasecmp_l", "id_type":"function", "header":"wchar.h", "extensions":["CX"]}, {"ident":"wcscat", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcschr", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcscmp", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcscoll", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcscoll_l", "id_type":"function", "header":"wchar.h", "extensions":["CX"]}, {"ident":"wcscpy", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcscspn", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsdup", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsftime", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcslen", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsncasecmp", "id_type":"function", "header":"wchar.h", "extensions":["CX"]}, {"ident":"wcsncasecmp_l", "id_type":"function", "header":"wchar.h", "extensions":["CX"]}, {"ident":"wcsncat", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsncmp", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsncpy", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsnlen", "id_type":"function", "header":"wchar.h", "extensions":["CX"]}, {"ident":"wcsnrtombs", "id_type":"function", "header":"wchar.h", "extensions":["CX"]}, {"ident":"wcspbrk", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsrchr", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsrtombs", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsspn", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsstr", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcstod", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcstof", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcstoimax", "id_type":"function", "header":"inttypes.h", "extensions":[]}, {"ident":"wcstok", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcstol", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcstold", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcstoll", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcstombs", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"wcstoul", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcstoull", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcstoumax", "id_type":"function", "header":"inttypes.h", "extensions":[]}, {"ident":"wcswidth", "id_type":"function", "header":"wchar.h", "extensions":["XSI"]}, {"ident":"wcsxfrm", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wcsxfrm_l", "id_type":"function", "header":"wchar.h", "extensions":["CX"]}, {"ident":"wctob", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wctomb", "id_type":"function", "header":"stdlib.h", "extensions":[]}, {"ident":"wctrans", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"wctrans_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"wctrans_t", "id_type":"type", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"wctype", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"wctype_l", "id_type":"function", "header":"wctype.h", "extensions":["OB","XSI"]}, {"ident":"wctype_t", "id_type":"type", "header":"wchar.h", "extensions":["OB","XSI"]}, {"ident":"wcwidth", "id_type":"function", "header":"wchar.h", "extensions":["XSI"]}, {"ident":"WEOF", "id_type":"macro", "header":"wchar.h", "extensions":[]}, {"ident":"WEXITED", "id_type":"constant", "header":"sys/wait.h", "extensions":[]}, {"ident":"WEXITSTATUS", "id_type":"constant", "header":"sys/wait.h", "extensions":["CX"]}, {"ident":"WIFCONTINUED", "id_type":"constant", "header":"sys/wait.h", "extensions":[]}, {"ident":"WIFEXITED", "id_type":"constant", "header":"sys/wait.h", "extensions":["CX"]}, {"ident":"WIFSIGNALED", "id_type":"constant", "header":"sys/wait.h", "extensions":["CX"]}, {"ident":"WIFSTOPPED", "id_type":"constant", "header":"sys/wait.h", "extensions":["CX"]}, {"ident":"wint_t", "id_type":"type", "header":"wchar.h", "extensions":["OB","XSI"]}, {"ident":"wmemchr", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wmemcmp", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wmemcpy", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wmemmove", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"wmemset", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"WNOHANG", "id_type":"constant", "header":"sys/wait.h", "extensions":["CX"]}, {"ident":"WNOWAIT", "id_type":"constant", "header":"sys/wait.h", "extensions":[]}, {"ident":"WORD_BIT", "id_type":"macro", "header":"limits.h", "extensions":[]}, {"ident":"wordexp", "id_type":"function", "header":"wordexp.h", "extensions":[]}, {"ident":"wordexp_t", "id_type":"type", "header":"wordexp.h", "extensions":[]}, {"ident":"wordfree", "id_type":"function", "header":"wordexp.h", "extensions":[]}, {"ident":"wprintf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"WRDE_APPEND", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_BADCHAR", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_BADVAL", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_CMDSUB", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_DOOFFS", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_NOCMD", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_NOSPACE", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_REUSE", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_SHOWERR", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_SYNTAX", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"WRDE_UNDEF", "id_type":"constant", "header":"wordexp.h", "extensions":[]}, {"ident":"write", "id_type":"function", "header":"unistd.h", "extensions":[]}, {"ident":"writev", "id_type":"function", "header":"sys/uio.h", "extensions":["XSI"]}, {"ident":"wscanf", "id_type":"function", "header":"wchar.h", "extensions":[]}, {"ident":"WSTOPPED", "id_type":"constant", "header":"sys/wait.h", "extensions":[]}, {"ident":"WSTOPSIG", "id_type":"constant", "header":"sys/wait.h", "extensions":["CX"]}, {"ident":"WTERMSIG", "id_type":"constant", "header":"sys/wait.h", "extensions":["CX"]}, {"ident":"WUNTRACED", "id_type":"constant", "header":"sys/wait.h", "extensions":["CX"]}, {"ident":"X_OK", "id_type":"constant", "header":"unistd.h", "extensions":[]}, {"ident":"xor", "id_type":"macro", "header":"iso646.h", "extensions":[]}, {"ident":"xor_eq", "id_type":"macro", "header":"iso646.h", "extensions":[]}, {"ident":"y0", "id_type":"function", "header":"math.h", "extensions":["XSI"]}, {"ident":"y1", "id_type":"function", "header":"math.h", "extensions":["XSI"]}, {"ident":"yn", "id_type":"function", "header":"math.h", "extensions":["XSI"]} ] } frama-c-20.0-Calcium/share/configure.ac0000666000000000000000000005073113571573400014611 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # AC_ARG_WITH(frama-c, # AC_HELP_STRING([Frama-C executable name (default is 'frama-c')]), # [FRAMA_C=$withval], # [FRAMA_C=frama-c]) # AC_ARG_WITH(frama-c-gui, # AC_HELP_STRING([Frama-C executable name (default is 'frama-c')]), # [FRAMA_C_GUI=$withval], # [FRAMA_C_GUI=frama-c-gui]) m4_ifdef([FRAMAC_MAIN_AUTOCONF],, [m4_ifdef([plugin_file], [AC_INIT(plugin_file)], [AC_INIT(aclocal.m4)]) [KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done ] AC_SUBST([FRAMAC_VERSION],[`frama-c -version`]) AC_CHECK_PROG(ENABLE_GUI,[frama-c-gui],[yes],[no]) ]) m4_define([PLUGIN_RELATIVE_PATH], [m4_ifdef([plugin_prefix],plugin_prefix/$1,$1)]) upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } m4_define([tovarname],[m4_esyscmd(printf "%s" $1 | tr "a-z-" "A-Z_")]) new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` AC_MSG_NOTICE($banner) AC_MSG_NOTICE($title) AC_MSG_NOTICE($banner) } define([FRAMAC_M4_MACROS]) # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... m4_define([frama_c_configure_tool],m4_incr(m4_divnum)) m4_define([PLUGINS_LIST],[]) # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c define([KNOWN_SRC_DIRS],[]) define([check_plugin], [ define([PLUGIN_NAME],$1) define([PLUGIN_FILE],$2) define([PLUGIN_MSG],$3) define([PLUGIN_DEFAULT],$4) define([PLUGIN_ADDITIONAL_DIR],$5) AC_CHECK_FILE(PLUGIN_FILE, default=PLUGIN_DEFAULT;plugin_present=yes, plugin_present=no;default=no) FORCE=no define([PLUGIN_HELP], AC_HELP_STRING([--enable-PLUGIN_NAME], [PLUGIN_MSG (default: PLUGIN_DEFAULT)])) AC_ARG_ENABLE( [PLUGIN_NAME], PLUGIN_HELP, ENABLE=$enableval;FORCE=$enableval, ENABLE=$default ) if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi define([KNOWN_SRC_DIRS],KNOWN_SRC_DIRS PLUGIN_FILE PLUGIN_ADDITIONAL_DIR) if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then AC_MSG_ERROR([PLUGIN_NAME is not available]) fi define([UP],[tovarname(PLUGIN_NAME)]) [FORCE_]UP=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "[FORCE_]UP define([PLUGINS_LIST],PLUGINS_LIST UP) [ENABLE_]UP=$ENABLE [NAME_]UP=PLUGIN_NAME if test "$default" = "no" -a "$FORCE" = "no"; then [INFO_]UP=" (not available by default)" fi AC_SUBST([ENABLE_]UP) echo "PLUGIN_NAME... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) m4_undefine([PLUGIN_FILE]) m4_undefine([PLUGIN_MSG]) m4_undefine([PLUGIN_DEFAULT]) m4_undefine([PLUGIN_ADDITIONAL_DIR]) m4_undefine([UP]) ]) # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) m4_define([configure_library], [ # No need to check the same thing multiple times. m4_ifdef(SELECTED_$1,, [ m4_define([VAR],[$1]) m4_define([SELECTED_VAR],[SELECTED_$1]) m4_define([PROG],[$2]) m4_define([require],[$REQUIRE_$1]) m4_define([use],[$USE_$1]) m4_define([msg],[$3]) m4_define([has],[HAS_$1]) m4_define([file],[FILE_$1]) # [JS 2009/06/02] sh tests and m4 variables do not mix well together. # It works by chance but it is not robust enough. # Should be rewritten has=no m4_foreach(file,[PROG], [if test "$has" != "yes"; then AC_CHECK_FILE(file,has=yes,has=no) if test "$has" = "yes"; then SELECTED_VAR=file fi fi] ) VAR=$SELECTED_VAR m4_divert_push(frama_c_configure_tool) if test -n "require" -o -n "use" -o "$force_check" = "yes"; then if test "$has" = "no"; then AC_MSG_WARN([msg]) reason="PROG missing" $5 for p in require; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then AC_MSG_ERROR([$p requested but $reason.]) fi eval $ep="no\ \(see\ warning\ about\ PROG\)" AC_MSG_WARN([$p disabled because $reason.]) eval INFO_$up=\", $reason\" fi done for p in use; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ PROG\)" AC_MSG_WARN([$p partially enabled because $reason.]) eval INFO_$up=\", $reason\" fi done fi fi m4_divert_pop(frama_c_configure_tool) AC_SUBST(VAR) AC_SUBST(has) undefine([SELECTED_VAR]) undefine([VAR]) undefine([PROG]) undefine([require]) undefine([use]) undefine([msg]) undefine([has]) undefine([file]) ]) ]) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem m4_define([configure_pkg], [ define([PKG_UP],[tovarname($1)]) m4_ifdef([HAS_OCAML_]PKG_UP,, [ define([VAR],[[OCAML_]PKG_UP]) define([require],[$[REQUIRE_OCAML_]PKG_UP]) define([use],[$[USE_OCAML_]PKG_UP]) define([msg],[$2]) define([has],[[HAS_OCAML_]PKG_UP]) has= AC_MSG_CHECKING(for OCaml package $1) VAR=$(ocamlfind query $1 -format %v 2>/dev/null) if test -z "$VAR" ; then AC_MSG_RESULT(not found via ocamlfind.) has=no else AC_MSG_RESULT(found.) has=yes fi m4_divert_push(frama_c_configure_tool) if test -n "require" -o -n "use" -o "$force_check" = "yes"; then if test "$has" = "no"; then AC_MSG_WARN([msg]) reason="$1 missing" for p in require; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then AC_MSG_ERROR([$p requested but $reason.]) fi eval $ep="no\ \(see\ warning\ about\ $1\)" AC_MSG_WARN([$p disabled because $reason.]) eval INFO_$up=\", $reason\" fi done for p in use; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ $1\)" AC_MSG_WARN([$p partially enabled because $reason.]) eval INFO_$up=\", $reason\" fi done else VAR=PKG_UP fi fi m4_divert_pop(frama_c_configure_tool) AC_SUBST(VAR) AC_SUBST(has) undefine([PKG_UP]) undefine([VAR]) undefine([require]) undefine([use]) undefine([msg]) undefine([has]) ]) ]) # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) m4_define([configure_tool], [ m4_ifdef(HAS_$1,, [ define([VAR],[$1]) define([PROG],[$2]) define([require],[$REQUIRE_$1]) define([use],[$USE_$1]) define([msg],[$3]) define([has],[HAS_$1]) define([force_check],[$4]) for file in PROG; do has= AC_CHECK_PROG(has,$file,yes,no) if test "$has" = "yes"; then SELECTED_VAR=$file break; fi done m4_divert_push(frama_c_configure_tool) if test -n "require" -o -n "use" -o "$force_check" = "yes"; then if test "$has" = "no"; then AC_MSG_WARN([msg]) reason="PROG missing" for p in require; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then AC_MSG_ERROR([$p requested but $reason.]) fi eval $ep="no\ \(see\ warning\ about\ PROG\)" AC_MSG_WARN([$p disabled because $reason.]) eval INFO_$up=\", $reason\" fi done for p in use; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ PROG\)" AC_MSG_WARN([$p partially enabled because $reason.]) eval INFO_$up=\", $reason\" fi done else VAR=PROG fi fi m4_divert_pop(frama_c_configure_tool) AC_SUBST(VAR) AC_SUBST(has) undefine([VAR]) undefine([PROG]) undefine([require]) undefine([use]) undefine([msg]) undefine([has]) ]) ]) EXTERNAL_PLUGINS= define([plugin_require_external], [m4_define([UPORIG],tovarname($2)) m4_define([REQUIRE],[REQUIRE_]UPORIG) REQUIRE=$REQUIRE" "$1 m4_undefine([REQUIRE]) m4_undefine([UPORIG])]) define([plugin_use_external], [m4_define([UPORIG],tovarname($2)) m4_define([USE],[USE_]UPORIG) USE=$USE" "$1 m4_undefine([USE]) m4_undefine([UPORIG])]) define([plugin_require_pkg], [m4_define([UPORIG],[OCAML_]tovarname($2)) m4_define([REQUIRE],[REQUIRE_]UPORIG) REQUIRE=$REQUIRE" "$1 m4_undefine([REQUIRE]) m4_undefine([UPORIG])]) define([plugin_use_pkg], [m4_define([UPORIG],[OCAML_]tovarname($2)) m4_define([USE],[USE_]UPORIG) USE=$USE" "$1 m4_undefine([USE]) m4_undefine([UPORIG])]) define([plugin_require], [m4_define([UPTARGET],tovarname($1)) m4_define([UPORIG],tovarname($2)) m4_define([REQUIRE],[REQUIRE_]UPORIG) m4_define([REQUIRED],[REQUIRED_]UPTARGET) REQUIRE=$REQUIRE" "$1 REQUIRED=$REQUIRED" "$2 m4_undefine([UPTARGET]) m4_undefine([UPORIG]) m4_undefine([REQUIRE]) m4_undefine([REQUIRED]) ]) define([plugin_use], [m4_define([UPTARGET],tovarname($1)) m4_define([UPORIG],tovarname($2)) m4_define([USE],[USE_]UPORIG) m4_define([USED],[USED_]UPTARGET) USE=$USE" "$1 USED=$USED" "$2 m4_undefine([UPTARGET]) m4_undefine([UPORIG]) m4_undefine([USE]) m4_undefine([USED]) ]) # Usage: plugin_disable([plugin],[reason]) define([plugin_disable], [m4_define([PLUGIN_NAME],$1) m4_define([MSG],$2) m4_define([UP],[tovarname(PLUGIN_NAME)]) if test "[FORCE_]UP" = "yes"; then AC_MSG_ERROR([PLUGIN_NAME requested but MSG]); else AC_MSG_WARN([PLUGIN_NAME disabled because MSG]); [ENABLE_]UP=no; [INFO_]UP=", MSG" fi]) define([has_pushed],0) define([after_plugin_dependencies],[ define([has_pushed],1) m4_divert_push(frama_c_configure_tool)]) define([end_after_plugin_dependencies],[ m4_if(has_pushed,1, [m4_divert_pop(frama_c_configure_tool)] m4_define([has_pushed],0) )]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then AC_MSG_ERROR([$lp requested but $reason.]) else AC_MSG_WARN([$lp disabled because $reason.]) fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` AC_MSG_WARN([$lp only partially enable because $reason.]) fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then AC_MSG_WARN([$lp only partially enabled because $reason.]) fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` AC_MSG_WARN([$p_name disabled because $reason.]) eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` AC_MSG_WARN([$p_name partially enabled because $reason.]) eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[[^ ]]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } define([compute_plugin_dependencies], [ # First, initialize some variables for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` TODOLIST=$TODOLIST" "$plugin eval MARK_$plugin= eval REMEMBER_$plugin= fi done # main call compute_dependency ]) define([check_frama_c_dependencies], [m4_undivert(frama_c_configure_tool) compute_plugin_dependencies]) define([check_plugin_dependencies], [m4_ifdef([FRAMAC_MAIN_AUTOCONF], [after_plugin_dependencies], [m4_undivert(frama_c_configure_tool) compute_plugin_dependencies])]) define([write_plugin_summary], [ m4_ifdef([FRAMAC_MAIN_AUTOCONF],, [ # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[[a-z]]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi AC_MSG_NOTICE([$name: $ep_v$info]) fi done])]) define([write_plugin_config], [m4_ifndef([plugin_prefix],[define([plugin_prefix],[.])]) m4_define([plugin_files], AC_FOREACH([plugin_file],$1,[plugin_prefix/plugin_file ])) m4_define([files_chmod], AC_FOREACH([plugin_file],plugin_files,[chmod -w plugin_file])) AC_CONFIG_FILES(plugin_files,files_chmod) m4_ifdef( [FRAMAC_MAIN_AUTOCONF], [end_after_plugin_dependencies] if test "$[ENABLE_]tovarname(PLUGIN_NAME)" != "no"; then [EXTERNAL_PLUGINS="${EXTERNAL_PLUGINS} plugin_prefix"]; fi, [ write_plugin_summary AC_OUTPUT() ]) ]) frama-c-20.0-Calcium/share/emacs/0000777000000000000000000000000013571573400013405 5ustar frama-c-20.0-Calcium/share/emacs/acsl.el0000666000000000000000000001662613571573400014664 0ustar ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; This file is part of Frama-C. ; ; ; ; Copyright (C) 2008-2011 ; ; Pierre Roux ; ; ; ; Copyright (C) 2009-2019 ; ; CEA LIST ; ; ; ; you can redistribute it and/or modify it under the terms of the GNU ; ; Lesser General Public License as published by the Free Software ; ; Foundation, version 2.1. ; ; ; ; It is distributed in the hope that it will be useful, ; ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; ; GNU Lesser General Public License for more details. ; ; ; ; See the GNU Lesser General Public License version 2.1 ; ; for more details (enclosed in the file licenses/LGPLv2.1). ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; How to install: ;; copy the following in your .emacs file ;; ;; (setq load-path (cons "/directory/in/which/you/put/the/file/acsl.el" load-path)) ;; (autoload 'acsl-mode "acsl" "Major mode for editing ACSL code" t) ;; ;; uncomment this if you want to automatically load ACSL mode with ;; ;; each C file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setq auto-mode-alist (append '(("\\.[chi]" . acsl-mode)) auto-mode-alist)) ;; you can then load the mode in emacs with M-x acsl-mode ;; TODO: ;; - font-lock for ghost code ;; code (defun acsl-keymap-init () "Init keymap" (define-key acsl-mode-map "\C-c\C-j" 'acsl-jessie-gui)) ;; font-lock (defconst acsl-keywords '("assert" "assigns" "assumes" "allocates" "axiom" "axiomatic" "behavior" "behaviors" "breaks" "case" "char" "complete" "continues" "decreases" "disjoint" "double" "else" "ensures" "enum" "exits" "float" "for" "frees" "if" "inductive" "int" "integer" "invariant" "global" "label" "lemma" "logic" "long" "loop" "pragma" "predicate" "reads" "real" "requires" "returns" "short" "signed" "sizeof" "slice" "impact" "struct" "terminates" "type" "union" "unsigned" "variant" "void" ) "List of ACSL keywords to highlight.") (defun acsl-in-acsl-annot () "If we are in a C comment beginning with @." (and (nth 4 (syntax-ppss)) (eq (char-after (+ (nth 8 (syntax-ppss)) 2)) ?@))) (defvar acsl-font-lock-keywords (let ((pre-match-form (lambda () (goto-char (match-beginning 0)) (match-end 0))) (find-annot (lambda (limit) ;; skip comments (if (and (looking-at "//") (acsl-in-acsl-annot)) (re-search-forward "\n" limit 'e)) (while (and (not (acsl-in-acsl-annot)) (< (point) limit)) (re-search-forward "/[*/]" limit 'e)) (if (>= (point) limit) nil (let ((b (save-excursion (re-search-backward "/[*/]" (- (point) 2) t) (point)))) (re-search-forward "[*/]/\\|\n" limit 'e) (re-search-backward "//" (- (point) 2) t) ; don't recolor comments (set-match-data (list b (point) (nth 2 (match-data t)))) t))))) (list `(,find-annot (0 font-lock-type-face t) (,(concat (regexp-opt acsl-keywords 'words) "\\|?\\|&&\\|||\\|!=?\\|\\^\\^") (,pre-match-form) nil (0 font-lock-keyword-face t)) ("\\(\\?\\)[^:]*\\(:\\)" (,pre-match-form) nil (1 font-lock-keyword-face t) (2 font-lock-keyword-face t)) ("\\(axiom\\|behavior\\|case\\|inductive\\|predicate\\|l\\(ogic\\|emma\\)\\)\\>[ \t\n@]*\\([a-zA-Z_][a-zA-Z_0-9]*\\)" (,pre-match-form) nil (3 font-lock-function-name-face t)) ("\\\\\\(at\\|e\\(mpty\\|xists\\)\\|f\\(alse\\|orall\\)\\|old\\|result\\|true\\|valid\\(_range\\|_index\\)?\\)" (,pre-match-form) nil (0 font-lock-constant-face t))))) "Default highlighting for ACSL mode") (defun acsl-font-lock-init () "Initialize font-lock for ACSL." (add-hook 'c-mode-hook (lambda () (font-lock-add-keywords nil acsl-font-lock-keywords)))) ;; custom variables (require 'custom) (defcustom acsl-jessie-gui-prog-name "frama-c -jessie" "Frama-C/Jessie executable name." :group 'acsl :type 'string) (defcustom acsl-jessie-int-model "exact" "Jessie int model." :group 'acsl :type '(choice (const :tag "Exact" "exact") (const :tag "Bounded" "bounded") (const :tag "Modulo" "modulo"))) (defun acsl-jessie-gui () "Generate VCs and show them in a GUI" (interactive) (compile (concat acsl-jessie-gui-prog-name " -jessie-int-model " acsl-jessie-int-model " " (buffer-file-name)))) ;; menu (require 'easymenu) (defun acsl-menu-init () (easy-menu-define acsl-menu (list acsl-mode-map) "ACSL Mode Menu." '("ACSL" ["Customize ACSL mode" (customize-group 'acsl) t] "---" ["Jessie GUI" acsl-jessie-gui t] )) (easy-menu-add acsl-menu)) ;; indent (defun acsl-indent-command (&optional arg) "Indent ACSL code (quite basic yet)." (interactive "*") (c-indent-line) (when (and (acsl-in-acsl-annot) (< (nth 8 (syntax-ppss)) (line-beginning-position))) ; not the first line of an annot (which don't need to be indented) (save-excursion (back-to-indentation) (if (not (eq (char-after) ?@)) (insert "@") (goto-char (+ (point) 1))) (if (not (looking-at "*/")) ; to avoid indenting last lines of annotation of the form "@*/" (thanks Yannick) (let ((current (save-excursion (skip-chars-forward " \t@"))) (expected (save-excursion (let ((cc (current-column))) (forward-line -1) (move-to-column cc)) (skip-chars-forward " \t@")))) (if (save-excursion (skip-chars-backward " \t\n@") (memq (char-before) '(?: ?=))) (setq expected (+ expected 2))) (if (save-excursion (skip-chars-forward " \t@") (looking-at "\\<\\(axiom\\|behavior\\|predicate\\|l\\(ogic\\|emma\\)\\|inductive\\)\\>")) (setq expected (save-excursion (goto-char (+ (nth 8 (syntax-ppss)) 3)) (skip-chars-forward " \t@")))) (if (< current expected) (insert-char ? (- expected current))) (if (> current expected) (kill-forward-chars (- current expected)))))) (if (eq (char-after) ?@) (skip-chars-forward " \t@")))) (defun acsl-indent-init () (setq indent-line-function 'acsl-indent-command) ;; maybe not the best solution for C code but still works (setq indent-region-function nil)) ;; main function for the mode (define-derived-mode acsl-mode c-mode "ACSL" "Major mode for C annoted with ACSL." (acsl-font-lock-init) (acsl-keymap-init) (acsl-indent-init) (acsl-menu-init)) (provide 'acsl-mode) frama-c-20.0-Calcium/share/emacs/frama-c-dev.el0000666000000000000000000000761413571573400016021 0ustar ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; This file is part of Frama-C. ; ; ; ; Copyright (C) 2007-2019 ; ; CEA (Commissariat à l'énergie atomique et aux énergies ; ; alternatives) ; ; ; ; you can redistribute it and/or modify it under the terms of the GNU ; ; Lesser General Public License as published by the Free Software ; ; Foundation, version 2.1. ; ; ; ; It is distributed in the hope that it will be useful, ; ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; ; GNU Lesser General Public License for more details. ; ; ; ; See the GNU Lesser General Public License version 2.1 ; ; for more details (enclosed in the file licenses/LGPLv2.1). ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; *** Mandatory Emacs settings for Frama-C developers *** ;; ;; If you are using 'frama-c-recommended.el', ignore these instructions ;; (this file is already included by frama-c-recommended.el). ;; ;; Otherwise, do the following: ;; 1. Include the directory containing this file in your Emacs load path; ;; 2. Load this file as a library. ;; ;; You can do so by adding these lines in the beginning of your ~/.emacs file: ;; ;; (add-to-list 'load-path "path/to/this/file/") ;; (load-library "frama-c-dev") ;; ;; tuareg and ocp-indent must be installed (e.g. via their OPAM packages). ;; ;; Note: 'frama-c-init.el' must also be in the load path. (load-library "frama-c-init") ;; ocp-indent should always be used (safe-require ocp-indent (add-hook 'tuareg-mode-hook (lambda () (setq indent-line-function 'ocp-indent-line))) ) ;; Never indent Caml files using tabs (defun no-tabs-hook () (setq indent-tabs-mode nil)) (add-hook 'tuareg-mode-hook 'no-tabs-hook) (add-hook 'caml-mode-hook 'no-tabs-hook) ;; Load Merlin (IDE features for OCaml, such as type info and code navigation) (safe-require merlin ;; Start merlin on ocaml files (add-hook 'tuareg-mode-hook 'merlin-mode t) (add-hook 'caml-mode-hook 'merlin-mode t) ;; Enable auto-completion: definitions for company-mode (set (make-local-variable 'company-backends) '(company-predictive)) (global-set-key (kbd "") 'company-complete-common) (add-to-list 'company-backends 'merlin-company-backend) ;; Enable company on merlin managed buffers (add-hook 'merlin-mode-hook 'company-mode) ;; Or enable it globally: ;(add-hook 'after-init-hook 'global-company-mode) ;; If you do not want to use company-mode, you can use auto-complete mode ;; (setq merlin-use-auto-complete-mode 'easy) ;; This hook avoids accidents with merlin's "C-c C-x", which often quits ;; Emacs without confirmation when the user presses "C-x C-c" by accident. ;; This hook is local to merlin-mode: Emacs will quit normally in non-ML ;; files. It is also only displayed when the keyboard shortcut is used, ;; but not when the user clicks the Close button on Emacs' window. (defun confirm-before-save-kill-emacs () (interactive) (let ((confirm-kill-emacs 'y-or-n-p)) (save-buffers-kill-emacs))) (add-hook 'merlin-mode-hook (lambda () (local-set-key (kbd "C-x C-c") 'confirm-before-save-kill-emacs))) ) frama-c-20.0-Calcium/share/emacs/frama-c-init.el0000666000000000000000000000616313571573400016204 0ustar ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; This file is part of Frama-C. ; ; ; ; Copyright (C) 2007-2019 ; ; CEA (Commissariat à l'énergie atomique et aux énergies ; ; alternatives) ; ; ; ; you can redistribute it and/or modify it under the terms of the GNU ; ; Lesser General Public License as published by the Free Software ; ; Foundation, version 2.1. ; ; ; ; It is distributed in the hope that it will be useful, ; ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; ; GNU Lesser General Public License for more details. ; ; ; ; See the GNU Lesser General Public License version 2.1 ; ; for more details (enclosed in the file licenses/LGPLv2.1). ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; *** Auxiliary definitions for Frama-C Emacs files *** ;; ;; This file is automatically included by both 'frama-c-dev.el' and ;; 'frama-c-recommended.el'. You do not need to do anything here. ;; ;; Macro to avoid crashing if the required file does not exist (defmacro safe-require (symbol &rest body) `(condition-case nil (progn (require ',symbol) ,@body) (error (message (format "Require NOT available: %s" ',symbol)) nil))) ;; Macro to avoid crashing if the library to load does not exist (defun safe-load-library (path) (condition-case nil (load-library path) (error (message (format "Library NOT available: %s" path)) nil))) ;; Add opam emacs directory to the load-path (condition-case nil (progn nil (setq opam-share (substring (shell-command-to-string "opam config var share 2> /dev/null") 0 -1)) (add-to-list 'load-path (concat opam-share "/emacs/site-lisp"))) (error (message "Error configuring OPAM, check your installation.") nil)) ;; Setup environment variables using OPAM ;; This helps when compiling OCaml installed via OPAM directly from Emacs (condition-case nil (dolist (var (car (read-from-string (shell-command-to-string "opam config env --sexp")))) (setenv (car var) (cadr var))) (error (message "Error configuring OPAM sexp, check your installation.") nil)) ;; One of the `opam config env` variables is PATH. Update `exec-path` to that. (setq exec-path (split-string (getenv "PATH") path-separator)) frama-c-20.0-Calcium/share/emacs/frama-c-recommended.el0000666000000000000000000001230113571573400017512 0ustar ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; This file is part of Frama-C. ; ; ; ; Copyright (C) 2007-2019 ; ; CEA (Commissariat à l'énergie atomique et aux énergies ; ; alternatives) ; ; ; ; you can redistribute it and/or modify it under the terms of the GNU ; ; Lesser General Public License as published by the Free Software ; ; Foundation, version 2.1. ; ; ; ; It is distributed in the hope that it will be useful, ; ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; ; GNU Lesser General Public License for more details. ; ; ; ; See the GNU Lesser General Public License version 2.1 ; ; for more details (enclosed in the file licenses/LGPLv2.1). ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; *** Recommended Emacs settings for Frama-C developers *** ;; ;; This file should be loaded in the beginning of your .emacs file. ;; ;; 1. Include the directory containing this file in your Emacs load path; ;; 2. Load this file as a library. ;; ;; You can do so by adding these lines in the beginning of your ~/.emacs file: ;; ;; (add-to-list 'load-path "path/to/this/file/") ;; (load-library "frama-c-recommended") ;; ;; Note: 'frama-c-init.el' and 'frama-c-dev.el' must also be in the load path. ;; ***** Initialization and configuration settings ***** (load-library "frama-c-init") (load-library "frama-c-dev") ;; MELPA helps with the installation of several Emacs packages (safe-require package (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/")) ) ;; ***** OCaml settings ***** ;; ;; Load Tuareg (OCaml mode for Emacs) if installed (safe-load-library "tuareg-site-file") ;; ***** End of OCaml settings ***** ;; ***** Miscellaneous settings ***** ;; ;; fill-column-indicator adds a vertical line to help enforce the ;; 80-characters-per-line rule ;; Note: in some specific configurations (e.g. KDE, maximized window), ;; this library may interfere with window redrawing when using e.g. some ;; merlin functions. Try deactivating this extension if you have problems. (safe-require fill-column-indicator (setq-default fill-column 80) (setq fci-rule-color "#8f8f8f") (add-hook 'tuareg-mode-hook 'fci-mode t) ) ;; Disable insertion of tabs for indentation everywhere but in Makefiles ;; (Emacs always inserts tabs in Makefiles, regardless of this option) (setq-default indent-tabs-mode nil) ;; Disable overwrite mode, which is rarely used nowadays and can be annoying ;; when enabled accidentally (global-unset-key [insert]) ;; redo+ (needs to be installed via ELPA) enables a somewhat "standard" ;; undo/redo mechanism, similar to most modern applications; ;; these key settings bind Ctrl+Z and Ctrl+Shift+Z to undo/redo, respectively (safe-require redo+ (global-set-key (kbd "C-z") 'undo-only) (global-set-key (kbd "C-S-z") 'redo) ; Avoid accidental minimization when pressing pressing C-z just after a 'C-x' (global-unset-key (kbd "C-x C-z")) ) ;; This hook removes trailing whitespace, which should always be avoided ;; Note that, if applied to an existing file with trailing whitespace, this ;; will remove it in *every* line. This can generate large diffs and is not ;; always ideal. For new files, however, this should be on by default. ;(add-hook 'before-save-hook 'delete-trailing-whitespace) ;; Require a final newline in a file in order to avoid confusing some tools ;; (also helps 'git diff') (setq require-final-newline t) ;; whitespace-mode, when activated, displays several kinds of possibly ;; undesirable whitespace. ;; The settings below enable display of tabs, empty lines at the end of ;; the file, and the most important one: trailing spaces ;; It is also possible to use whitespace-mode to highlight long lines ;; (over 80 characters, or the width that you prefer), but they are ;; not activated in these settings. (global-whitespace-mode 1) (setq whitespace-style '(face empty tabs trailing)) ;; Terminal Settings ;; (related to colors in compilation mode; see MR frama-c/frama-c!300) (safe-require ansi-color (defun my-colorize-compilation-buffer () (ansi-color-apply-on-region (point-min) (point-max)) (goto-char (point-min)) (while (search-forward "\x0d" nil t) (delete-region (line-beginning-position) (point))) (goto-char (point-min)) (while (search-forward "\x1b[K" nil t) (replace-match "")) (goto-char (point-min)) ) (add-hook 'compilation-filter-hook 'my-colorize-compilation-buffer) ) frama-c-20.0-Calcium/share/frama-c.Unix.rc0000666000000000000000000000451213571573400015075 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Default font for all widgets The first exisiting font is used. style "general 1" { font_name = "DejaVu Sans" } style "general 2" { font_name = "Lucida Sans Unicode" } style "general 3" { font_name = "Sans" } widget "*" style "general 3" widget "*" style "general 2" widget "*" style "general 1" # Style for widgets displaying source code. The first exisiting font is used. style "monospace 1" { font_name = "Menlo" } style "monospace 2" { font_name = "DejaVu Sans Mono" } style "monospace 3" { font_name = "Lucida Sans Mono Unicode" } style "monospace 4" { font_name = "Monospace" } widget "*source" style "monospace 4" widget "*source" style "monospace 3" widget "*source" style "monospace 2" #widget "*source" style "monospace 1" frama-c-20.0-Calcium/share/frama-c.WIN32.rc0000666000000000000000000000347213571573400014760 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Default font for all widgets The first exisiting font is used. style "general" { font_name = "Sans" } widget "*" style "general" # Style for widgets displaying source code. style "monospace" { font_name = "Sans" } widget "*source" style "monospace" frama-c-20.0-Calcium/share/frama-c.ico0000666000000000000000000026024613571573400014331 0ustar hF@@ (B  G (~X(  G#I$K&L(M*O+P-R1U9\?`Qox~               (@ &U >*DR⏱ZMd`G{I}ffeDyCxCxCxCxCxCxCxyTCxCxCxmRCxCxCxCxCxCxCxCxCxCxCxCxCxCxCxJ}gTCxCxwp {\Bw4mlK~Sc7o[cG{4m4m4m4m4m4m4m;ry5m4m4m4m`Fz4m4m4m4m4mK}SSS6o4m4m4m4m4mmK}q:q4mGzK}4mR-aDw5l6mp6l:om5lM~g6m5l5l5l5l5l5l5lEwk5l5l5l5laGy5l5l5l5l5lI{RRQ7n5l5l5l5l;qi5l^Hz5l6l7n5l5l@vתQztd5lQonHz6mons[5l5l5l5l5l5l9o}8n5lUqxFx5l5l5l5l5l`qqo9o5l5l5l5lt5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5meN5m5m;qN5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mqUr6n5m5m5m5m5m5m5m iO4m5nG{L~6o4m4m4m4m4m4m4m4m4m4m4m4m4m4m4m4mte5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mWL~5m5m5m5m5m5m5m5m6nkBv5m5m5mj8;rSool7m_ooN~6m6m6m6m6m6m6mbY6m]oocGyoK|Y]FxoooBu9ojr^6mFyt6m6m6m6m6m6m6m6m@ug6m6m6m6mi8CH;r5mDxd6n5m6nq7o5m5m5m5m5m5m5m5mu?t5m6nQW6n5mq5mSS5m7oq7o5mJ|\7nAv5m5mxs;qke8o9ppvjGz6m@t{7m6m6m6m6m6m6m6m@ug6m6m6m6mj8t8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p9q9q:qwUpqX9sF|psT>wmpn\9setgx:u:u:u:u:u:uMvH@z>xgp_G~ztm@z;vdq];vg}nT;vPoWxrA{yz?{D~z]C}>z=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=ym8C>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>{@|E{]D~?|>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>z>zn8D?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|@}B~G{^FA}?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|o8E@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}A~BG|_GB~@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}n8FA~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~BCH}_GBA~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~o8FAAAAAAAAAAAAAAAAAAABDI}`HCBAAAAAAAAAAAAAAAAAAAAAAAo8HCCCCCCCCCCCCCCCCCDDEFK~cJEEDDCCCCCCCCCCCCCCCCCCCCCp8IDDDDDDDDDDDDDDDDEEFGJOdMIHGFFEDDDDDDDDDDDDDDDDDDDp8IDDDDDDDDDDDDDDDDEGHKNQhQMLJIGEDDDDDDDDDDDDDDDDDDDq8KFFFFFFFFFFFFFFFFGJIGFFFFFFFFFFFFFFFFFFFr8LGGGGGGGGGGGGGGGGHIZ^`cwb_^^\IHGGGGGGGGGGGGGGGGGGGs8MIIIIIIIIIIIIIIIIJJKLNRhQNMLKJJIIIIIIIIIIIIIIIIIIIs8NIIIIIIIIIIIIIIIIIJJKMQgPLKJJJIIIIIIIIIIIIIIIIIIIIs8PKKKKKKKKKKKKKKKKKKKLNQiQMLKKKKKKKKKKKKKKKKKKKKKKKt8QLLLLLLLLLLLLLLLLLLLLMQtiQMLLLLLLLLLLLLLLLLLLLLLLLLu8QMMMMMMMMMMMMMMMMMMMMOSbkSOMMMMMMMMMMMMMMMMMMMMMMMMv8RNNNNNNNNNNNNNNNNNNNNPSZkTPNNNNNNNNNNNNNNNNNNNNNNNNv8TPPPPPPPPPPPPPPPPPPPPPTZlUQPPPPPPPPPPPPPPPPPPPPPPPPw8UQQQQQQQQQQQQQQQQQQQQRTZmWSRTUUTRRQQQQQQQQQQQQQQQQQw8WRRRRRRRRRRRRRRRRRRRRSUZvYVWZhiZVTSRRRRRRRRRRRRRRRRx8WSSSSSSSSSSSSSSSSSSSSSUXc[X[\VTSSSSSSSSSSSSSSSSy8YUUUUUUUUUUUUUUUUUUUUUVX^][d[VUUUUUUUUUUUUUUUUy8[WWWWWWWWWWWWWWWWWWWWWWY\_]`\XWWWWWWWWWWWWWWWWz8aXXXXXXXXXXXXXXXXXXXXXXY[`b_`^ZXXXXXXXXXXXXXXXX(VpZZZZZZZZZZZZZZZZZZZZZZ[\_c}bbeii^\ZZZZZZZZZZZZZZZZ%\\\\\\\\\\\\\\\\\\\\\\\]^`gkla^]\\\\\\\\\\\\\\\^i]]]]]]]]]]]]]]]]]]]]]]]^`be{ca^]]]]]]]]]]]]]]]]Oc_______________________`abdeeedca``_______________p6raaaaaaaaaaaaaaaaaaaaaaaabbccccbaaaaaaaaaaaaaaaab ~zzzzzzzzzzzzzzzzzzzzzz{{{{{zzzzzzzzzzzzzzzW>DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD4 ??( @ dkkkkkkkrqkkkkkkkkkkc%YYVP]:r:r:r:rZ:rOAw:r:rH|J};r:r:r[OKafBvZXK}_?t5m5m9pU=s`s5m5m5m6mH{5mM|@ufDxbJ|5m5m5mM=sXZZNK}fGzVQ7oX5m5m5m?tM~5mN=|s6n>t;r6n6n6n6nEy6nO |;r8o8o8o8o8o8o8o9p:q=s\J|=s:q9p8o8o8o8o8o8o8o8o8oO|;t9s8r9r9s8r9r8r9s8r;s\H}9r8r8r8r8r8r8r9s8r8r8r8rP}I~lS]R]sH}bI~]zS:t:sWc\PRbM:s:sM~0}C{bLkKHcJhB{UgXz>z>z>z>z>z>z>z>z?{`L>z>z>z>z>z>z>z>z>z>z>z>zT~B~?|?|?|?|?|?|?|?|?|A}aN@|?|?|?|?|?|?|?|?|?|?|?|V~DA~A~A~A~A~A~A~A~A~CcPBA~A~A~A~A~A~A~A~A~A~A~VFCCCCCCCCEGfTGEDCCCCCCCCCXGEEEEEEEFgGEEEEEEEEEYJHHHHHHHILQo]QQIHHHHHHHHH\LJJJJJJJJJLiXKKJJJJJJJJJJ]NMMMMMMMMMM\ZMMMMMMMMMMMM`QOOOOOOOOOOV]PPPOOOOOOOOOaTRRRRRRRRRRVdTY[TRRRRRRRRdWUUUUUUUUUUX]eVUUUUUUUes[WWWWWWWWWWXf`qXWWWWWWWj n[[[[[[[[[[[]|t_[[[[[[[[_^^^^^^^^^^_`gb_^^^^^^^c mllllllllllmnnmllllllp!%%%%%%%%%%%%%%%%%%%%( $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%)%%%5qurb5%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$ Z]Y C̥ըR 79B cԞj_UNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNY{NNNNNNNbfNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNte{;kչ{J|5m5m5mI{o}yg>s5m5mJ|mnnnne6n5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mfDx5m5m5m5m5m5m5m>tV5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mXux]9p5m5m5m5mGzQ5mAvd٩TsrN5m5mO~iq|>s5mM~r}ssk7n5m5m5m5m5m5m5m5m5m5m5m5m5m5m:qn5m5m5m5m5m5m5m5m>tV5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mYzqf5m5m5m5m6n|x7n5m5m=tqyVzT5m5m5m5m6m|x9p5m5mI{e5m5m5mh{5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mGz[5m5m5m5m5m5m5m5m>tV5m5m5m5m5m5m5m5m5m5m5mGzabbbbb_9p5m5m5m5m5m5m5m5m5m5m6nzr8o5m`Ey5m5m5m5mI{OtV5m5m5m5m5m5m5m5m5m5m5m\}Dx5m5m5m5m5m5m5m5m5m5m?t\5m5mGzT5m5m5m5m5m5m5m5m5m5m5m5mZ` 8oAvT5m5m5m5m8oo5m5m5m>sk5m5m5mhV5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mSN5m5m5m5m5m5m5m5m>tV5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mGzM5m5m8o_5m5m5m5m5m5m5m5m5m5m5m5m5mi/kBxH{_iYXDx5m5mbkRYvJ}5m5mStkRkH{5m5m5m5m5m5m5m5m5m5m5m5m5mFy[5m5m5m5m7nUYY^V5m5m5m5m5m5m5m5m5m5m5mL~iiiiiigt5m5m5m5m5m5m7n)--j5mqh5m5m7oa|Q5m5m:qu|YzDx5m5m5m5m5m5m5m5m5m5m5m5m5m9pm5m5m5m5mCwV5m5m5m5m5m5m5m5m5m5m5mVwxxxxxtAv5m5m5m5m5m5m5m5m5m5m@uV5m5mAvY5m5m5m5mo~Bv5m5m5m5m5m5m5mT<```X?u5m7oGz\?t>s6n5m5m5m5ms5m;qGz6n5m5m5m5m5m5m5m5m5m5m5m5m5m5m5meCw5m5m5m5m;q?t?t?t?t9p5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m6nj5m5mUM~5m5m5m5m5m8o5m5m5m5m5m5m5m5m5m 5m5m5m5mpzadkP5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m@ug5m5m5m5m5m5mEyeN5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mag\~x6n5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mgשa5m5m5m5mDxf{~uK}5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mc{5m5m5m5m5m5mO^5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m8ojzDx5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mK~4+S5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m6n9p5m5m5m5m5m5m6m7o6n5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m;qDx6n5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m=sL/K~5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m`=Cy5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mn>Cx5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mp>Cx5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mp>Cx5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mp>Cx5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mp>Cx5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mYFz5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m6m^Au5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m=s\H{5m5m5m5m5m5m5m5mp>Cx5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mOX5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m8o}q5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mwU5m5m5m5m5m5m5m5mp>Cx5m5mCwH{H{H{H{H{Av5m5m9pGzH{H{H{H{?t5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5ms}:q5m5m8oGzH{H{H{H{Gz;q5m;rGzH{=s5m5mEyGz:p5m;qGzH{H{H{H{Gz8o5m5m5m7oJ|XO;r5m5m5m5m^J|5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mExP5m5m5m5m5m5m5m5m5mp>Cx5mBv8o5m_z5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mK}_5m5m5m]h5mku5mU^5mj[5m5m;q}a5m5m5mCx5m5mJ|M~_XM~Fz5m5mt5m?tryBv5m6mtu6n5m?tM~M~zqM~L};q5m5m[L~?tNa^5m5m5m5mj8o5m5m5m5m5m5m5m5m5m5m5m5m5m5m5m5mGzM~5m5m5m5m5m5m5m5m5mp+`6>Dx6m6m6m6mPFy6m6m6m6m6m6mnt6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6mm8n6m6m6m6m6m6mkx6m6m6m6m6mlv6m6m6mqq6m6m6m6m6mxk6m6m6m6m6md6m6m6m6m6m6m6m6m6m]Ex6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m[J{6m6m6m6m6m6m6m6m6mp`#>Dx6m6m6m6mPFy6m6m6m6m6m6mnt6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6mvx6m6m6m7m7n7n7nky7n7n7n7n7nmw7n7n7nrr7n7n7n7n7nxl7m6m6m6m6md6m6m6m6m6m6m6m6m6mTO6m6m6m6m6m6m6m6m6m6m6m6m6m6m6mK|9o6m6m6m6m6m6m6m6m6mp`#>Dx6m6m6m6mPFy6m6m6m6m6m6mnt6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6mm7n7n7n7n8n8n8nly8o8o8o8o8onN~8o:p|i8o8n8n8n8nyl7n7n7n6m6md6m6m6m6m6m6m6m6m6m]Fx6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m6m^J{6m6m6m6m6m6m6m6m6mp`#>Dx6m6mU~Fy6m6m6m6mN~}yDy6n6nEydee@u6n6n6n6nAvc{}ee`7o6n6n6n6n6n6n6n6n6n6n6n6n6n6nK}_8o9p:q:qXiidDy6n6n6n6n>t?u6n6n6n6n6n6n6nc}Cw;rCwBw6n6n6n6n6n6n6n6n6n6n6n6n6n6n7ns>s:q;rt?u@uAvBvBwBwBwBwAvAv@u?t>t>s=s@uEy@u;q:q9p8o7oe6n6n6n6n6n6n6n6n^M~6n6n6n6n6n6n6n6n6n6n6n6n6n6n6n6n6nDxV6n6n6n6n6n6n6n6n6np]9>Dy6n6n6n6nv6n6n6n6n6n6n6n@u}7o6n6n6n6n6n6n6n6n6n6n6n6n6n7oN[]gghtjklnooooonmlkjji}fT9p8p7oWr6n6n6n6n6n6n6n9p~t6n6n6n6n6n6n6n6n6n6n6n6n6n6n6n6n6n6n6ns[6n6n6n6n6n6n6n6np6`>Ey7n7n7n7nY_7n7n7n7n7n7n7n7n;qN\UDw7n7n7n7n7n7n7n7n7n7n7n7n7n7n8o9o^M~:q9p8o8o7n7n7n7n7n7n7n7n8n`Cw7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n:pUDw7n7n7n7n7n7n7n7np>Ey7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n8o9o9p:qn:p9p8o8o7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7n7np>Ez7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o8p8p9p:q;rt?u@vBwEyH{mGzDxBw@u?u>t=sEz7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o7o8p9p9q:q;rt=sFz8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o8o9o9p:p:p;q;qtAuDxH{mGzCw@u>s=rF{8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p8p9p9q9q:q:q:r;r=t?uCxH{lFzBw?uF|8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q9q9r9r:r:su;s:s9r9r9r9q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8qp>F|8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q9r9r:ruBxG|lEzAw=u;s:r9r9q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8q8qp>F}8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r9s:s;t>vByG|lE{@x=v;t9s9r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8r8rp>G}9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r:r;su;t:s9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9r9rp>G~9s9sRTbm^K9s9s9s9s>wUjj]E{9s9s9sMdiWP^\@x9s9sAyYliYAy9s9sD{^`acgizF|Ay>v;u:t9s9s9s9s9s9s=v[^^^^^R9sCz]^X9s9sV^P9s9s9sOdmbM:s9s9s9s9s9s9s9s9s9s9s9sS^R9s@x,>G~9sAxzV9s9s9sh}O9sP{T9s9su{D{9s^\Ay>v;u:t9s9s9s9s9s9sL{9sZ?wG}j9s9sR|e9s9s9s9s9s9s9s9s9s9sCzF|MX >H~:s=u^By:s@w|:s:s>vf:s;tI}ZAx:sl@w:sCykM:s:sJY:sH:u:uH:u:uUzhU;v:u:u@y`:u:u:u:u:u:u:uPtK:u:uMS:u:u:u:u:u:u:u;uxoq>H;u;uoP@xRub;u=wOhKKH~;u;u;u;uMNC{@xfC{;u?xZ^KKE|;u;u;u;uByMuE|IYC{@x=wwJeC{;u;u;u;u`oE|D{wv;u;uG~xzKKJ>w;u;u;u;u;u;u;u;u;u;u;u;uD|x^d>H;v;vJf;vaM;v;v;v}g;v;vnAz;v;v;vzE}ITC|@y=xH;v;v;v@yS`TQ@z;vB{ZnWWS=w;v;v;vAzP\]I;v;v;vF~bfWWP;v;v;v;vKXYXE}I~HC|@y=xx;v;v;v;vLWAzZ]E};v;vx;v>Iy=xIz=yIz=yJ=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y>y?z@{C}FKpIEB|?{>z=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=yp>J=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y>y?z@{C}FKpIEB|?{>z=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=yp>J=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y>y?z@{C}FKpIEB|?{>z=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=y=yp>K>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{?{@|A}DGLpJFC~@}?|>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{p>K>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{?{@|A}DGLpJFC~@}?|>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{>{p>L?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{@{A|B}EHMqKGD~A}@|?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{?{p>L?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|@|A}B~EHMqKGDA~@}?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|?|p>M@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}A}A~CFINrLHEBA~@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}p>M@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}A}A~CFINrLHEBA~@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}@}p>M@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~A~ACFINrLHEBA@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~p>NA~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~B~BDGJOsMIFCBA~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~A~p>NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABCDGJOsMIFDBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAp>OBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCDEHKPtNJGECCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBp>OBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCDFHLPtOJGEDCCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBp>OCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDEFGIMQtPLIFEEDDDDDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCp>OCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDEEFFHJNRuQMIGFFEEEDDDDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCp>PDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDEEEFGGHIJMPTvSOLJIHGGGFFFEEDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDp>PDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDEEFGHIIJLNQUwTPMKJIIIHHGFFEEDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDp>QEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFGHIJKLMNPSWyVRPNMLLKKJIHGFFEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEp>RFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFGGHIIHGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFp>RFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFGGHIJHHGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFp>SGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHIJgnopqrtvyxusrqppponlJIHHGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGp>SGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHIJJKLMNPRUXzWTQONNMMLKKJIHHGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGp>THHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHIIJJKLLNOQTXzWSPONMMLLKKJIIHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHp>THHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHIIJJKKLNPSWyVROMLKKKJJJIIIHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHp>UIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJKKLMPSWyVROMLKKJJJJJIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIp>VJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJKKKLNPSXzVROMLKKKKKJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJp>VJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJKKLMOSWyVROMKKJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJp>VKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKLLNPSXzWSPMLLKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKp>VKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKLLNPSXzWROMLKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKp>WLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMOQTX{XSPNMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLp>XMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNOQUY|XTQONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMp>XMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNOQTX|XTQONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMp>YNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOPRUYw|YURPONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNp>ZOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPQSUY`}ZVSQPPOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOp>ZOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPQRUY]}ZVSQPPPPPPPPPPPOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOp>[PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPQRSUY]~[WTRQQQQQRRRRRQQQPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPp>[PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPQQSUX\~[XUSRQRRRSSSSSRRQQPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPp>\QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQRSUX\\YVTSSTTUVWWVVUTSRRQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQp>]RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRSTVX\b^ZWUUUVWYZ[[ZYXVUTSSRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRp>]RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRSTUX[_^ZWVVVXZ\~`[YWUTSRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRp>]SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSTTVX[^_[YWXY[h\YWVTTSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSp>^TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTUVXZ^l`]ZYY[^q\ZWVUTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTp>^TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTUVWY]`a][ZZ\m^[XVUUTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTp>_UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVWY\`xb_\[\]`\ZXVVUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUp>`VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWXY\_bd`^\]^xb^[YWWVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVp>aWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWXXZ[^ahb_^^_cb_\ZXXWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWp8dXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXYZ[^`cca__`b~c_\ZYYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXj$kYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYZZ[]`bheba``bdic`][ZZYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY[VrZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ[\]_adodbbabdfhj|b`]\[ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZcBǁZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ[[\]_bdecbbbcefhida_][[ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZrv\[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[\\]_abdedccdefgnb`^]\\[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[9o\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\]^^`acehfwcb`^]]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\be^]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]^^__abcdfgdba`_^^]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]ک5x^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__``abcdeglddcba`__^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^jem_______________________________________________```abccdeeeeeeeeddcbaa``________________________________e l````````````````````````````````````````````````aaabccddddddddccbbaaa````````````````````````````````eөuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbccddddddcccbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalש3jaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbcccbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae"ZПwgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbdsr eͩwRg{lX-?frama-c-20.0-Calcium/share/frama-c.png0000666000000000000000000001407213571573400014335 0ustar PNG  IHDRlPLTEe!bG   # !&#$)&',)*0-.523C@AB?@@=>KHIHEFSPQMJK^[\`]^:89USTOMNdbcZXYWUVzxyustpnomklή "#+6DKT]d}NJМէp̔޻({2s m]^^`abcce g!f!f!f"uĩU Y[]]]^_``aabbacadd e!e!e"e"b"f"a!h&k)p1w:GOZ`i]"ɴUMLW"S#M#H"C F!E!E!G#G"H$G$F$E#F#E#F#H$L*R2X8\?_A_B`CcFbFdGhLlQv]~fyB$E$C#A#V9YQʛU܂^WV^.g`EgApftwGX=iC;E=G(G|BoaCz"'wX$kaKUED4=kH;Dcs"w%Wb?$ALz _c lK¢@'3,^&lm7A @ZIbXi3X@䧤XQ $OdOC4K4%֭1Õ?M蓉y-xcZ"m:|M۟@猱/ w_ OKώ޿+3k2IP^}4@ՇL75[ oOs=Tj1yll ᜱf/pO$Y''gC$r'|_,Q\l=|jѦ0ߞb5I'Zc ~T-X r4k@M%c b3]lg誐TA)N;a<ק~ܴnX<@3xvDBFnO/ ໱5G+]3##8 I9dz3)cWENc @̙_ 5UEE?[:Q$~0$y$|bA-=OM#ɨNBFxꁴO0HD|_xuy׋N U(<]tČ3j(f6c26 J/YSa L&dg27YLL$yO rg 6] 6i(OUR3|{P$kgEQteAwR$JP2I[ţ.g˟@,zy+ݎ0Z e$"N\%dž̆5 Pw(VAr y4o$X  h4N0ei:c2s t70h2"dhT½O Xa>64b8QwF3ڟG z|40Fxb[pw1 k\=} @F!,vl_R8n7B!&H f@VJ3Cq.7a+!,)I 3xC*ZtM]*.SER7XA9x<p@"x[~vIiŅcD u@$Au'ێA8x*f$# /X /XhW,^nZ?i/(TWT=ZQQ~xc}/Y?00y%psG.vc{woBz~:Zݩ]#@Wxx#D9rSh("(|oj@V8c)Ѝ-{օҊ>~~?o`8`w6X5@]0HqZdPNz"M h`j;Eژ(@|쟡 D944!`eU(#׀u"E rpWv9::q]/|Wܼ83.3b JL9ahuBNʅ J p#A"ŇS#8z{\ꗽf;A?y?R (p7|\$n2t&B i<@-`3Ά!r%0' ?zp<3U5"0YOMWmc1E_o,2:W U#R$BV:b D…+yٗ~L`  Q229>37/2#-% 9]9Hgg($ Th QT? p Ě`~]&K`M-P~~ҙ<ʶe dxax>03bELPycFJ"(l ٩I$ q>Ùn*`gb@|t@1̤TjpnPEi @. 3ar<'ڡV>%A鸗gh0 $ xUS"(>]$P\EΆ"(ZbXl ^\i*A/~_^q9 l,]Q*5^3`oo7$yQ~hE3D}x &^F#ر=**2"OMీ(5W+S s*.(ڐs3'j:O7zF'ͻ#2!D \ :]}y[9^;慧y"77GG'77w/e\鯙IҲ5%%eexTѹ/ussFNJxhM$899n}Aa~g$Fq\zƁX*)>@zRool/c3"fF ̟^ݴ 0˚bzR\frm⅒ߕ _ǿxziWL'~ĵ“̾ĄxZn$3K8 ~fߜז$x14EO.t,> x9v)?L5d2eu"]=ŬHĪF&B>pak@/&ᓳ乾"I0T~K9q>HM ~Y%%f_&BդFͰ|'O )@ԢMQ.F1K0O! i4xY@nZ< P*PqXd:OB_ypͯJ8`QA.Ⓣ=dJل"$0@Ko|y@nz>$qH[ڲ(zĜ51ܝ赫?.1-%WKUِQxA3{)f]b_Ɗ^iCI)xJИb 9^$|ݜRB@%?XӍ ~ ij0Lgnk?ϼ ؽ9ݪvڃ.s[i kMh{kx``|޲!wM :!.[s ՚6ȁ#Xdhw;@5x\gy4϶v!hof?o't1xi`֖AmBdYϸ|k=[ k0|.mV yNxmط4Kp|[mVfn.5x Bno@PL[Z?PvaM]#|ckgmZ --0`e\o؀ɤŮi:y]cI#7SnolaР蜇JlPk`ܚ='f jku=kxȤhlT' 5fg V td^w3[_1==n7蜽L̡MڍA`x4^oVp@>5tNY_ __FC_SIZE_MAX ==> !is_allocable(i); @ } */ __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_builtin.c0000666000000000000000000000641513571573400016014 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "__fc_builtin.h" __PUSH_FC_STDLIB /* Those builtins implementations could probably be removed entirely for Value, as the spec is informative enough. There remains a slight difference with Frama_C_float/double_interval and +0./-0., because the specification is not sufficient to to exclude -0. when requiring >= +0. */ int volatile Frama_C_entropy_source; //@ assigns Frama_C_entropy_source \from Frama_C_entropy_source; void Frama_C_update_entropy(void) { Frama_C_entropy_source = Frama_C_entropy_source; } void Frama_C_make_unknown(char *p, size_t l) { Frama_C_update_entropy(); for (size_t i = 0; i < l; i++) { p[i] = Frama_C_entropy_source; } } int Frama_C_nondet(int a, int b) { Frama_C_update_entropy(); return Frama_C_entropy_source ? a : b; } void *Frama_C_nondet_ptr(void *a, void *b) { Frama_C_update_entropy(); return Frama_C_entropy_source ? a : b; } int Frama_C_interval(int min, int max) { int r,aux; Frama_C_update_entropy(); aux = Frama_C_entropy_source; if ((aux>=min) && (aux <=max)) r = aux; else r = min; return r; } char Frama_C_char_interval(char min, char max) { int r; char aux; Frama_C_update_entropy(); aux = Frama_C_entropy_source; if ((aux>=min) && (aux <=max)) r = aux; else r = min; return r; } float Frama_C_float_interval(float min, float max) { Frama_C_update_entropy(); return Frama_C_entropy_source ? min : max; } double Frama_C_double_interval(double min, double max) { Frama_C_update_entropy(); return Frama_C_entropy_source ? min : max; } extern void __builtin_abort(void) __attribute__((noreturn)); // GCC builtin void Frama_C_abort(void) { __builtin_abort(); } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/__fc_builtin.h0000666000000000000000000001746113571573400016024 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef Frama_C_BUILTIN #define Frama_C_BUILTIN #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_size_t.h" __BEGIN_DECLS extern volatile int Frama_C_entropy_source __attribute__((unused)) __attribute__((FRAMA_C_MODEL)); /*@ requires valid_p: \valid(p + (0 .. l-1)); assigns p[0 .. l-1] \from Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures initialization: \initialized(p + (0 .. l-1)); */ extern void Frama_C_make_unknown(char *p, size_t l); /*@ assigns \result \from a, b, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_a_or_b: \result == a || \result == b ; */ extern int Frama_C_nondet(int a, int b); /*@ assigns \result \from a, b, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_a_or_b: \result == a || \result == b ; */ extern void *Frama_C_nondet_ptr(void *a, void *b); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern int Frama_C_interval(int min, int max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern int Frama_C_interval_split(int min, int max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern unsigned char Frama_C_unsigned_char_interval (unsigned char min, unsigned char max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern char Frama_C_char_interval(char min, char max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern unsigned short Frama_C_unsigned_short_interval(unsigned short min, unsigned short max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern short Frama_C_short_interval(short min, short max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern unsigned int Frama_C_unsigned_int_interval(unsigned int min, unsigned int max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern int Frama_C_int_interval(int min, int max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern unsigned long Frama_C_unsigned_long_interval (unsigned long min, unsigned long max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern long Frama_C_long_interval(long min, long max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern unsigned long long Frama_C_unsigned_long_long_interval (unsigned long long min, unsigned long long max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern long long Frama_C_long_long_interval(long long min, long long max); /*@ requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: min <= \result <= max ; */ extern size_t Frama_C_size_t_interval(size_t min, size_t max); /*@ requires finite: \is_finite(min) && \is_finite(max); requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: \is_finite(\result) && min <= \result <= max; */ extern float Frama_C_float_interval(float min, float max); /*@ requires finite: \is_finite(min) && \is_finite(max); requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: \is_finite(\result) && min <= \result <= max; */ extern double Frama_C_double_interval(double min, double max); /*@ requires finite: \is_finite(min) && \is_finite(max); requires order: min <= max; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_bounded: \is_finite(\result) && min <= \result <= max; */ extern double Frama_C_real_interval_as_double(double min, double max); /*@ // Signals an error; terminates \false; assigns \nothing; ensures never_terminates: \false; */ extern void Frama_C_abort(void) __attribute__ ((__noreturn__)); /*@ assigns \result \from p; */ extern size_t Frama_C_offset(const void* p); extern void *Frama_C_malloc_fresh(size_t size); //@ assigns \result \from i; extern long long Frama_C_abstract_cardinal(long long i); //@ assigns \result \from i; extern long long Frama_C_abstract_max(long long i); //@ assigns \result \from i; extern long long Frama_C_abstract_min(long long i); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_blkcnt_t.h0000666000000000000000000000350413571573400017461 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_BLKCNT_T #define __FC_DEFINE_BLKCNT_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __blkcnt_t_defined typedef unsigned int blkcnt_t; #define __blkcnt_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_blksize_t.h0000666000000000000000000000351113571573400017645 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_BLKSIZE_T #define __FC_DEFINE_BLKSIZE_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __blksize_t_defined typedef unsigned int blksize_t; #define __blksize_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_clockid_t.h0000666000000000000000000000340013571573400017607 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_CLOCKID_T #define __FC_DEFINE_CLOCKID_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS typedef int clockid_t; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_dev_t.h0000666000000000000000000000346513571573400016770 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_DEV_T #define __FC_DEFINE_DEV_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __dev_t_defined typedef unsigned int dev_t; #define __dev_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_eof.h0000666000000000000000000000341413571573400016432 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_EOF #define __FC_DEFINE_EOF #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS #define EOF __FC_EOF __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_fd_set_t.h0000666000000000000000000000544613571573400017457 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_FD_SET_T #define __FC_DEFINE_FD_SET_T #include "features.h" __PUSH_FC_STDLIB #define FD_SETSIZE 1024 #define NFDBITS (8 * sizeof(long)) __BEGIN_DECLS typedef struct __fc_fd_set { long __fc_fd_set[FD_SETSIZE / NFDBITS]; } fd_set; /*@ requires valid_fdset: \valid(fdset); requires initialization: \initialized(fdset); assigns *fdset \from *fdset, indirect:fd; */ extern void FD_CLR(int fd, fd_set *fdset); #define FD_CLR FD_CLR // Note: the 2nd argument in FD_ISSET is not const in some implementations // due to historical and compatibility reasons. /*@ requires valid_fdset: \valid_read(fdset); requires initialization: \initialized(fdset); assigns \result \from indirect:*fdset, indirect:fd; */ extern int FD_ISSET(int fd, const fd_set *fdset); #define FD_ISSET FD_ISSET /*@ requires valid_fdset: \valid(fdset); requires initialization: \initialized(fdset); assigns *fdset \from *fdset, indirect:fd; */ extern void FD_SET(int fd, fd_set *fdset); #define FD_SET FD_SET /*@ requires valid_fdset: \valid(fdset); assigns *fdset \from \nothing; ensures initialization: \initialized(fdset); */ extern void FD_ZERO(fd_set *fdset); #define FD_ZERO FD_ZERO __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_file.h0000666000000000000000000000370613571573400016604 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_FILE #define __FC_DEFINE_FILE #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_stat.h" #include "__fc_define_fpos_t.h" __BEGIN_DECLS #ifndef __FILE_defined struct __fc_FILE { unsigned int __fc_FILE_id; unsigned int __fc_FILE_data; }; typedef struct __fc_FILE FILE; #define __FILE_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_fpos_t.h0000666000000000000000000000350613571573400017155 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_FPOS_T_H #define __FC_DEFINE_FPOS_T_H #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS struct __fc_pos_t { unsigned long __fc_stdio_position; }; typedef struct __fc_pos_t fpos_t; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_id_t.h0000666000000000000000000000346013571573400016601 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_ID_T #define __FC_DEFINE_ID_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __id_t_defined typedef unsigned int id_t; #define __id_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_ino_t.h0000666000000000000000000000346513571573400016777 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_INO_T #define __FC_DEFINE_INO_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __ino_t_defined typedef unsigned int ino_t; #define __ino_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_intptr_t.h0000666000000000000000000000367613571573400017536 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_INTPTR_T #define __FC_DEFINE_INTPTR_T #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS #ifdef __INTPTR_T #ifndef __intptr_t_defined typedef __INTPTR_T intptr_t; #define INTPTR_MIN __FC_INTPTR_MIN #define INTPTR_MAX __FC_INTPTR_MAX #define __intptr_t_defined #endif #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_iovec.h0000666000000000000000000000347313571573400016773 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_IOVEC #define __FC_DEFINE_IOVEC #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_size_t.h" __BEGIN_DECLS struct iovec { void *iov_base; size_t iov_len; }; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_key_t.h0000666000000000000000000000346413571573400017001 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_KEY_T #define __FC_DEFINE_KEY_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __key_t_defined typedef unsigned int key_t; #define __key_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_mode_t.h0000666000000000000000000000556513571573400017141 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_MODE_T #define __FC_DEFINE_MODE_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __mode_t_defined typedef unsigned int mode_t; #define __mode_t_defined #endif __END_DECLS #define S_IFMT 0170000 #define S_IFBLK 0060000 #define S_IFCHR 0020000 #define S_IFIFO 0010000 #define S_IFREG 0100000 #define S_IFDIR 0040000 #define S_IFLNK 0120000 #define S_IFSOCK 0140000 #define S_IRUSR 00400 #define S_IWUSR 00200 #define S_IXUSR 00100 #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) #define S_IRGRP 00040 #define S_IWGRP 00020 #define S_IXGRP 00010 #define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) #define S_IROTH 00004 #define S_IWOTH 00002 #define S_IXOTH 00001 #define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) #define S_ISUID 0004000 #define S_ISGID 0002000 #define S_ISVTX 0001000 #define S_IEXEC S_IXUSR #define S_IWRITE S_IWUSR #define S_IREAD S_IRUSR #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_nlink_t.h0000666000000000000000000000347713571573400017330 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_NLINK_T #define __FC_DEFINE_NLINK_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __nlink_t_defined typedef unsigned int nlink_t; #define __nlink_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_null.h0000666000000000000000000000334213571573400016633 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_NULL #define __FC_DEFINE_NULL #undef NULL #ifdef __cplusplus #define NULL 0 #else #define NULL ((void*)0) #endif #endif frama-c-20.0-Calcium/share/libc/__fc_define_off_t.h0000666000000000000000000000364113571573400016760 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_OFF_T #define __FC_DEFINE_OFF_T #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS #ifndef __off_t_defined typedef long int off_t; #define __off_t_defined #endif #ifndef __off64_t_defined typedef __INT64_T off64_t; #define __off64_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_pid_t.h0000666000000000000000000000345513571573400016765 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_PID_T #define __FC_DEFINE_PID_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __pid_t_defined typedef int pid_t ; #define __pid_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_pthread_types.h0000666000000000000000000000543413571573400020540 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_PTHREAD_TYPES_T #define __FC_DEFINE_PTHREAD_TYPES_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS // These types are defined as structs with a meaningless field just to provide // stronger typing constraints #ifndef __have_pthread_attr_t typedef struct __fc_pthread_attr_t { int _fc; } pthread_attr_t; #define __have_pthread_attr_t #endif typedef struct __fc_pthread_barrier_t { int _fc; } pthread_barrier_t; typedef struct __fc_pthread_barrierattr_t { int _fc; } pthread_barrierattr_t; typedef struct __fc_pthread_cond_t { int _fc; } pthread_cond_t; typedef struct __fc_pthread_condattr_t { int _fc; } pthread_condattr_t; typedef struct __fc_pthread_key_t { int _fc; } pthread_key_t; typedef struct __fc_pthread_mutex_t { int _fc; } pthread_mutex_t; typedef struct __fc_pthread_mutexattr_t { int _fc; } pthread_mutexattr_t; typedef struct __fc_pthread_once_t { int _fc; } pthread_once_t; typedef struct __fc_pthread_rwlock_t { int _fc; } pthread_rwlock_t; typedef struct __fc_pthread_rwlockattr_t { int _fc; } pthread_rwlockattr_t; typedef struct __fc_pthread_spinlock_t { int _fc; } pthread_spinlock_t; typedef struct __fc_pthread_t { int _fc; } pthread_t; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_sa_family_t.h0000666000000000000000000000345513571573400020155 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_SA_FAMILY_T #define __FC_DEFINE_SA_FAMILY_T #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS typedef __UINT_LEAST16_T sa_family_t; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_seek_macros.h0000666000000000000000000000355613571573400020163 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_SEEK_MACROS #define __FC_DEFINE_SEEK_MACROS /* Values for the WHENCE argument to lseek. */ # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Seek from end of file. */ #endif frama-c-20.0-Calcium/share/libc/__fc_define_sigset_t.h0000666000000000000000000000350513571573400017503 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_SIGSET_T #define __FC_DEFINE_SIGSET_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __sigset_t_defined typedef unsigned long sigset_t; #define __sigset_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_size_t.h0000666000000000000000000000342613571573400017161 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_SIZE_T #define __FC_DEFINE_SIZE_T #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS typedef __SIZE_T size_t; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_sockaddr.h0000666000000000000000000000362213571573400017454 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_SOCKADDR #define __FC_DEFINE_SOCKADDR #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_sa_family_t.h" __BEGIN_DECLS struct sockaddr { sa_family_t sa_family; /* address family, AF_xxx */ char sa_data[14]; /* 14 bytes of protocol address */ }; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_ssize_t.h0000666000000000000000000000372513571573400017346 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_SSIZE_T #define __FC_DEFINE_SSIZE_T #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS // This file may be included by non-POSIX machdeps (e.g. via sys/types.h), // so we must check if ssize_t should be defined #ifdef __FC_POSIX_VERSION typedef __SSIZE_T ssize_t; #define SSIZE_MAX __SSIZE_MAX #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_stat.h0000666000000000000000000000522713571573400016640 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_STAT_H #define __FC_DEFINE_STAT_H #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_ino_t.h" #include "__fc_define_uid_and_gid.h" #include "__fc_define_time_t.h" #include "__fc_define_blkcnt_t.h" #include "__fc_define_blksize_t.h" #include "__fc_define_dev_t.h" #include "__fc_define_mode_t.h" #include "__fc_define_nlink_t.h" #include "__fc_define_off_t.h" #define __statfs_word unsigned int __BEGIN_DECLS struct statfs { __statfs_word f_type; __statfs_word f_bsize; __statfs_word f_blocks; __statfs_word f_bfree; __statfs_word f_bavail; __statfs_word f_files; __statfs_word f_ffree; __statfs_word f_fsid; __statfs_word f_namelen; __statfs_word f_frsize; __statfs_word f_flags; __statfs_word f_spare[4]; }; struct stat { dev_t st_dev; ino_t st_ino; mode_t st_mode; nlink_t st_nlink; uid_t st_uid; gid_t st_gid; dev_t st_rdev; off_t st_size; time_t st_atime; time_t st_mtime; time_t st_ctime; blksize_t st_blksize; blkcnt_t st_blocks; }; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_suseconds_t.h0000666000000000000000000000352013571573400020210 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_SUSECONDS_T #define __FC_DEFINE_SUSECONDS_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __suseconds_t_defined typedef signed int suseconds_t; #define __suseconds_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_time_t.h0000666000000000000000000000352213571573400017142 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_TIME_T #define __FC_DEFINE_TIME_T #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS #ifndef __time_t_defined typedef __FC_TIME_T time_t; #define __time_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_timer_t.h0000666000000000000000000000337413571573400017331 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_TIMER_T #define __FC_DEFINE_TIMER_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS typedef void* timer_t; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_timespec.h0000666000000000000000000000344113571573400017472 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_TIMESPEC #define __FC_DEFINE_TIMESPEC #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS struct timespec { long tv_sec; long tv_nsec; }; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_uid_and_gid.h0000666000000000000000000000362413571573400020112 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_UID_AND_GID #define __FC_DEFINE_UID_AND_GID #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __gid_t_defined typedef unsigned int gid_t; #define __gid_t_defined #endif #ifndef __uid_t_defined typedef unsigned int uid_t; #define __uid_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_useconds_t.h0000666000000000000000000000351613571573400020032 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_USECONDS_T #define __FC_DEFINE_USECONDS_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #ifndef __useconds_t_defined typedef unsigned int useconds_t; #define __useconds_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_wchar_t.h0000666000000000000000000000363513571573400017315 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_WCHAR_T #define __FC_DEFINE_WCHAR_T #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "__fc_machdep.h" #if !defined(__cplusplus) /* wchar_t is a keyword in C++ and shall not be a typedef. */ typedef __WCHAR_T wchar_t; #else typedef __WCHAR_T fc_wchar_t; #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_define_wint_t.h0000666000000000000000000000342613571573400017170 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DEFINE_WINT_T #define __FC_DEFINE_WINT_T #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS typedef __WINT_T wint_t; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_gcc_builtins.h0000666000000000000000000001755513571573400017027 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ // This file contains some GCC builtins which are not already hardcoded in // Frama-C, and which can be expressed using ACSL. #ifndef __FC_GCC_BUILTINS #define __FC_GCC_BUILTINS #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (int)(a + b); ensures result_overflow: a + b == (int)(a + b) ? \result == 0 : \result == 1; */ _Bool __builtin_sadd_overflow (int a, int b, int *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (long)(a + b); ensures result_overflow: a + b == (long)(a + b) ? \result == 0 : \result == 1; */ _Bool __builtin_saddl_overflow (long a, long b, long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (long long)(a + b); ensures result_overflow: a + b == (long long)(a + b) ? \result == 0 : \result == 1; */ _Bool __builtin_saddll_overflow (long long a, long long b, long long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (unsigned)(a + b); ensures result_overflow: a + b == (unsigned)(a + b) ? \result == 0 : \result == 1; */ _Bool __builtin_uadd_overflow (unsigned a, unsigned b, unsigned *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (unsigned long)(a + b); ensures result_overflow: a + b == (unsigned long)(a + b) ? \result == 0 : \result == 1; */ _Bool __builtin_uaddl_overflow (unsigned long a, unsigned long b, unsigned long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (unsigned long long)(a + b); ensures result_overflow: a + b == (unsigned long long)(a + b) ? \result == 0 : \result == 1; */ _Bool __builtin_uaddll_overflow (unsigned long long a, unsigned long long b, unsigned long long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (int)(a - b); ensures result_overflow: a - b == (int)(a - b) ? \result == 0 : \result == 1; */ _Bool __builtin_ssub_overflow (int a, int b, int *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (long)(a - b); ensures result_overflow: a - b == (long)(a - b) ? \result == 0 : \result == 1; */ _Bool __builtin_ssubl_overflow (long a, long b, long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (long long)(a - b); ensures result_overflow: a - b == (long long)(a - b) ? \result == 0 : \result == 1; */ _Bool __builtin_ssubll_overflow (long long a, long long b, long long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (unsigned)(a - b); ensures result_overflow: a - b == (unsigned)(a - b) ? \result == 0 : \result == 1; */ _Bool __builtin_usub_overflow (unsigned a, unsigned b, unsigned *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (unsigned long)(a - b); ensures result_overflow: a - b == (unsigned long)(a - b) ? \result == 0 : \result == 1; */ _Bool __builtin_usubl_overflow (unsigned long a, unsigned long b, unsigned long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (unsigned long long)(a - b); ensures result_overflow: a - b == (unsigned long long)(a - b) ? \result == 0 : \result == 1; */ _Bool __builtin_usubll_overflow (unsigned long long a, unsigned long long b, unsigned long long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (int)(a * b); ensures result_overflow: a * b == (int)(a * b) ? \result == 0 : \result == 1; */ _Bool __builtin_smul_overflow (int a, int b, int *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (long)(a * b); ensures result_overflow: a * b == (long)(a * b) ? \result == 0 : \result == 1; */ _Bool __builtin_smull_overflow (long a, long b, long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (long long)(a * b); ensures result_overflow: a * b == (long long)(a * b) ? \result == 0 : \result == 1; */ _Bool __builtin_smulll_overflow (long long a, long long b, long long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (unsigned)(a * b); ensures result_overflow: a * b == (unsigned)(a * b) ? \result == 0 : \result == 1; */ _Bool __builtin_umul_overflow (unsigned a, unsigned b, unsigned *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (unsigned long)(a * b); ensures result_overflow: a * b == (unsigned long)(a * b) ? \result == 0 : \result == 1; */ _Bool __builtin_umull_overflow (unsigned long a, unsigned long b, unsigned long *res); /*@ requires valid_res: \valid(res); assigns \result, *res \from a, b; ensures initialization:res: \initialized(res); ensures res_wrapped: *res == (unsigned long long)(a * b); ensures result_overflow: a * b == (unsigned long long)(a * b) ? \result == 0 : \result == 1; */ _Bool __builtin_umulll_overflow (unsigned long long a, unsigned long long b, unsigned long long *res); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_inet.h0000666000000000000000000003227113571573400015311 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ // This file regroups all definitions from these two files: // // - // // - // // POSIX.1-2008 states that each of them may make the symbols of the other // visible, so we define them all here. #ifndef __FC_INET #define __FC_INET #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS #include "__fc_string_axiomatic.h" #include "__fc_define_pthread_types.h" #include "inttypes.h" #include "signal.h" #include "sys/socket.h" ////////// DEFINITIONS BELOW WERE ORIGINALLY IN typedef uint16_t in_port_t; typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; struct sockaddr_in { sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; }; struct in6_addr { uint8_t s6_addr[16]; }; struct sockaddr_in6 { sa_family_t sin6_family; in_port_t sin6_port; uint32_t sin6_flowinfo; struct in6_addr sin6_addr; uint32_t sin6_scope_id; }; #define INADDR_ANY 0 #define INADDR_BROADCAST 0XFFFFFFFFUL #define INET_ADDRSTRLEN 16 // Non-POSIX #define INADDR_NONE ((in_addr_t) 0xffffffff) #define IN6ADDR_ANY 0 #define IN6ADDR_BROADCAST 0XFFFFFFFFFFFFFFFFULL #define INET6_ADDRSTRLEN 46 // Not required by POSIX #define INADDR_LOOPBACK (uint32_t)0x7F000001 const struct in6_addr in6addr_any={{0}}; const struct in6_addr in6addr_loopback= {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}} ; struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned ipv6mr_interface; }; struct in6_pktinfo { struct in6_addr ipi6_addr; int ipi6_ifindex; }; /* Standard well-defined IP protocols. */ enum __fc_ipproto { IPPROTO_IP = 0, /* Dummy protocol for TCP. */ #define IPPROTO_IP IPPROTO_IP IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */ #define IPPROTO_HOPOPTS IPPROTO_HOPOPTS IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */ #define IPPROTO_ICMP IPPROTO_ICMP IPPROTO_IGMP = 2, /* Internet Group Management Protocol. */ #define IPPROTO_IGMP IPPROTO_IGMP IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94). */ #define IPPROTO_IPIP IPPROTO_IPIP IPPROTO_TCP = 6, /* Transmission Control Protocol. */ #define IPPROTO_TCP IPPROTO_TCP IPPROTO_EGP = 8, /* Exterior Gateway Protocol. */ #define IPPROTO_EGP IPPROTO_EGP IPPROTO_PUP = 12, /* PUP protocol. */ #define IPPROTO_PUP IPPROTO_PUP IPPROTO_UDP = 17, /* User Datagram Protocol. */ #define IPPROTO_UDP IPPROTO_UDP IPPROTO_IDP = 22, /* XNS IDP protocol. */ #define IPPROTO_IDP IPPROTO_IDP IPPROTO_TP = 29, /* SO Transport Protocol Class 4. */ #define IPPROTO_TP IPPROTO_TP IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol. */ #define IPPROTO_DCCP IPPROTO_DCCP IPPROTO_IPV6 = 41, /* IPv6 header. */ #define IPPROTO_IPV6 IPPROTO_IPV6 IPPROTO_ROUTING = 43, /* IPv6 routing header. */ #define IPPROTO_ROUTING IPPROTO_ROUTING IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header. */ #define IPPROTO_FRAGMENT IPPROTO_FRAGMENT IPPROTO_RSVP = 46, /* Reservation Protocol. */ #define IPPROTO_RSVP IPPROTO_RSVP IPPROTO_GRE = 47, /* General Routing Encapsulation. */ #define IPPROTO_GRE IPPROTO_GRE IPPROTO_ESP = 50, /* encapsulating security payload. */ #define IPPROTO_ESP IPPROTO_ESP IPPROTO_AH = 51, /* authentication header. */ #define IPPROTO_AH IPPROTO_AH IPPROTO_ICMPV6 = 58, /* ICMPv6. */ #define IPPROTO_ICMPV6 IPPROTO_ICMPV6 IPPROTO_NONE = 59, /* IPv6 no next header. */ #define IPPROTO_NONE IPPROTO_NONE IPPROTO_DSTOPTS = 60, /* IPv6 destination options. */ #define IPPROTO_DSTOPTS IPPROTO_DSTOPTS IPPROTO_MTP = 92, /* Multicast Transport Protocol. */ #define IPPROTO_MTP IPPROTO_MTP IPPROTO_ENCAP = 98, /* Encapsulation Header. */ #define IPPROTO_ENCAP IPPROTO_ENCAP IPPROTO_PIM = 103, /* Protocol Independent Multicast. */ #define IPPROTO_PIM IPPROTO_PIM IPPROTO_COMP = 108, /* Compression Header Protocol. */ #define IPPROTO_COMP IPPROTO_COMP IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */ #define IPPROTO_SCTP IPPROTO_SCTP IPPROTO_UDPLITE = 136, /* UDP-Lite protocol. */ #define IPPROTO_UDPLITE IPPROTO_UDPLITE IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW IPPROTO_MAX }; /*** originally from bits/in.h ***/ /* Options for use with `getsockopt' and `setsockopt' at the IP level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */ #define IP_HDRINCL 3 /* int; Header is included with data. */ #define IP_TOS 1 /* int; IP type of service and precedence. */ #define IP_TTL 2 /* int; IP time to live. */ #define IP_RECVOPTS 6 /* bool; Receive all IP options w/datagram. */ /* For BSD compatibility. */ #define IP_RECVRETOPTS IP_RETOPTS /* bool; Receive IP options for response. */ #define IP_RETOPTS 7 /* ip_opts; Set/get IP per-packet options. */ #define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */ #define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */ #define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */ #define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */ #define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */ #define IP_UNBLOCK_SOURCE 37 /* ip_mreq_source: unblock data from source */ #define IP_BLOCK_SOURCE 38 /* ip_mreq_source: block data from source */ #define IP_ADD_SOURCE_MEMBERSHIP 39 /* ip_mreq_source: join source group */ #define IP_DROP_SOURCE_MEMBERSHIP 40 /* ip_mreq_source: leave source group */ #define IP_MSFILTER 41 #if defined __USE_MISC || defined __USE_GNU # define MCAST_JOIN_GROUP 42 /* group_req: join any-source group */ # define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */ # define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/ # define MCAST_LEAVE_GROUP 45 /* group_req: leave any-source group */ # define MCAST_JOIN_SOURCE_GROUP 46 /* group_source_req: join source-spec gr */ # define MCAST_LEAVE_SOURCE_GROUP 47 /* group_source_req: leave source-spec gr*/ # define MCAST_MSFILTER 48 # define MCAST_EXCLUDE 0 # define MCAST_INCLUDE 1 #endif #define IP_ROUTER_ALERT 5 /* bool */ #define IP_PKTINFO 8 /* bool */ #define IP_PKTOPTIONS 9 #define IP_PMTUDISC 10 /* obsolete name? */ #define IP_MTU_DISCOVER 10 /* int; see below */ #define IP_RECVERR 11 /* bool */ #define IP_RECVTTL 12 /* bool */ #define IP_RECVTOS 13 /* bool */ #define IP_MTU 14 /* int */ #define IP_FREEBIND 15 #define IP_IPSEC_POLICY 16 #define IP_XFRM_POLICY 17 #define IP_PASSSEC 18 #define IP_TRANSPARENT 19 /* TProxy original addresses */ #define IP_ORIGDSTADDR 20 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR #define IP_MINTTL 21 /* IP_MTU_DISCOVER arguments. */ #define IP_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IP_PMTUDISC_WANT 1 /* Use per route hints. */ #define IP_PMTUDISC_DO 2 /* Always DF. */ #define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ /* To select the IP level. */ #define SOL_IP 0 #define IP_DEFAULT_MULTICAST_TTL 1 #define IP_DEFAULT_MULTICAST_LOOP 1 #define IP_MAX_MEMBERSHIPS 20 #if defined __USE_MISC || defined __USE_GNU /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS. The `ip_dst' field is used for the first-hop gateway when using a source route (this gets put into the header proper). */ struct ip_opts { struct in_addr ip_dst; /* First hop; zero without source route. */ char ip_opts[40]; /* Actually variable in size. */ }; /* Like `struct ip_mreq' but including interface specification by index. */ struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_address; /* local IP address of interface */ int imr_ifindex; /* Interface index */ }; /* Structure used for IP_PKTINFO. */ struct in_pktinfo { int ipi_ifindex; /* Interface index */ struct in_addr ipi_spec_dst; /* Routing destination address */ struct in_addr ipi_addr; /* Header destination address */ }; #endif /* Options for use with `getsockopt' and `setsockopt' at the IPv6 level. The first word in the comment at the right is the data type used; "bool" means a boolean value stored in an `int'. */ #define IPV6_ADDRFORM 1 #define IPV6_2292PKTINFO 2 #define IPV6_2292HOPOPTS 3 #define IPV6_2292DSTOPTS 4 #define IPV6_2292RTHDR 5 #define IPV6_2292PKTOPTIONS 6 #define IPV6_CHECKSUM 7 #define IPV6_2292HOPLIMIT 8 #define SCM_SRCRT IPV6_RXSRCRT #define IPV6_NEXTHOP 9 #define IPV6_AUTHHDR 10 #define IPV6_UNICAST_HOPS 16 #define IPV6_MULTICAST_IF 17 #define IPV6_MULTICAST_HOPS 18 #define IPV6_MULTICAST_LOOP 19 #define IPV6_JOIN_GROUP 20 #define IPV6_LEAVE_GROUP 21 #define IPV6_ROUTER_ALERT 22 #define IPV6_MTU_DISCOVER 23 #define IPV6_MTU 24 #define IPV6_RECVERR 25 #define IPV6_V6ONLY 26 #define IPV6_JOIN_ANYCAST 27 #define IPV6_LEAVE_ANYCAST 28 #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 #define IPV6_RECVPKTINFO 49 #define IPV6_PKTINFO 50 #define IPV6_RECVHOPLIMIT 51 #define IPV6_HOPLIMIT 52 #define IPV6_RECVHOPOPTS 53 #define IPV6_HOPOPTS 54 #define IPV6_RTHDRDSTOPTS 55 #define IPV6_RECVRTHDR 56 #define IPV6_RTHDR 57 #define IPV6_RECVDSTOPTS 58 #define IPV6_DSTOPTS 59 #define IPV6_RECVTCLASS 66 #define IPV6_TCLASS 67 /* Obsolete synonyms for the above. */ #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP #define IPV6_RXHOPOPTS IPV6_HOPOPTS #define IPV6_RXDSTOPTS IPV6_DSTOPTS /* IPV6_MTU_DISCOVER values. */ #define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */ #define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */ #define IPV6_PMTUDISC_DO 2 /* Always DF. */ #define IPV6_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ /* Socket level values for IPv6. */ #define SOL_IPV6 41 #define SOL_ICMPV6 58 /* Routing header options for IPv6. */ #define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */ #define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */ // END OF DEFINITIONS FROM // THE DEFINITIONS BELOW WERE ORIGINALLY IN /*@ assigns \result \from arg ; */ extern uint32_t htonl(uint32_t arg); /*@ assigns \result \from arg ; */ extern uint16_t htons(uint16_t arg); /*@ assigns \result \from arg ; */ extern uint32_t ntohl(uint32_t arg); /*@ assigns \result \from arg ; */ extern uint16_t ntohs(uint16_t arg); /*@ requires valid_arg: valid_read_string(arg); assigns \result \from indirect:arg[0..]; */ extern in_addr_t inet_addr(const char *arg); volatile char __fc_inet_ntoa_array[16]; char *__fc_inet_ntoa = (char*)__fc_inet_ntoa_array; /*@ assigns \result \from indirect:arg, __fc_inet_ntoa; assigns __fc_inet_ntoa[0..] \from indirect:arg; ensures result_static_string: \result == __fc_inet_ntoa; ensures result_null_terminated: \result[15] == 0; // always null-terminated ensures result_valid_string: valid_read_string(\result); */ extern char *inet_ntoa(struct in_addr arg); /*@ assigns \result \from dst,af,((char*)src)[0..]; assigns dst[0..size-1] \from af,((char*)src)[0..] ; */ extern const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); /*@ assigns \result \from af,src[..]; assigns ((char*)dst)[0..] \from af,src[0..] ; */ extern int inet_pton(int af, const char *src, void *dst); ////////// END OF DEFINITIONS FROM __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_integer.h0000666000000000000000000000343413571573400016006 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef Frama_C_INTEGER #define Frama_C_INTEGER #include "features.h" __PUSH_FC_STDLIB /*@ logic boolean bit_test(integer x, integer pos) = (boolean)(x & (1<, where is one of the \ following: X86_32, X86_64, X86_16, GCC_X86_32, GCC_X86_64, \ GCC_X86_16, PPC_32, MSVC_X86_64. \ If you are using a custom machdep, you must include your machdep \ header file defining __FC_MACHDEP to avoid inclusion of this file. #endif #endif #endif #endif #endif #endif frama-c-20.0-Calcium/share/libc/__fc_machdep_linux_shared.h0000666000000000000000000001760713571573400020526 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_FORCE_INCLUDE_MACHDEP__ #error "Frama-C: This file shall not be directly included" #endif /* This file contains common machine specific values between Linux x86 32-bit, AMD64 and x86 16-bit.*/ #ifndef __FC_MACHDEP_LINUX_SHARED #define __FC_MACHDEP_LINUX_SHARED // These machdeps strive to conform themselves to POSIX.1-2008 #define __FC_POSIX_VERSION 200809L /* Optional */ #define __INT8_T signed char #define __INT8_MIN __FC_SCHAR_MIN #define __INT8_MAX __FC_SCHAR_MAX #define __UINT8_T unsigned char #define __UINT8_MIN __FC_UCHAR_MAX #define __INT16_T signed short #define __INT16_MIN __FC_SHRT_MIN #define __INT16_MAX __FC_SHRT_MAX #define __UINT16_T unsigned short #define __UINT16_MAX __FC_USHRT_MAX /* inttypes */ #define __PRI8_PREFIX "hh" #define __PRI16_PREFIX "h" /* Required */ #define __INT_LEAST8_T signed char #define __INT_LEAST8_MIN __FC_SCHAR_MIN #define __INT_LEAST8_MAX __FC_SCHAR_MAX #define __UINT_LEAST8_T unsigned char #define __UINT_LEAST8_MAX __FC_UCHAR_MAX #define __INT_LEAST16_T signed short #define __INT_LEAST16_MIN __FC_SHRT_MIN #define __INT_LEAST16_MAX __FC_SHRT_MAX #define __UINT_LEAST16_T unsigned short #define __UINT_LEAST16_MAX __FC_USHRT_MAX /* Required */ #define __INT_FAST8_T signed char #define __INT_FAST8_MIN __FC_SCHAR_MIN #define __INT_FAST8_MAX __FC_SCHAR_MAX #define __UINT_FAST8_T unsigned char #define __UINT_FAST8_MAX __FC_UCHAR_MAX #define __INT_FAST16_T signed int #define __INT_FAST16_MIN __FC_INT_MIN #define __INT_FAST16_MAX __FC_INT_MAX #define __UINT_FAST16_T unsigned int #define __UINT_FAST16_MAX __FC_UINT_MAX #define __PRIFAST16_PREFIX "" /* Required */ #define __INT_MAX_T signed long long #define __UINT_MAX_T unsigned long long #define __PRIMAX_PREFIX "ll" /* min and max values as specified in limits.h */ #define __FC_SCHAR_MIN (-128) #define __FC_SCHAR_MAX 127 #define __FC_UCHAR_MAX 255 #define __FC_SHRT_MIN (-32768) #define __FC_SHRT_MAX 32767 #define __FC_USHRT_MAX 65535 #define __FC_LLONG_MIN (-9223372036854775807LL -1LL) #define __FC_LLONG_MAX 9223372036854775807LL #define __FC_ULLONG_MAX 18446744073709551615ULL #define __FC_PATH_MAX 256 // Note: POSIX requires HOST_NAME_MAX >= 255, but Linux uses 64 #define __FC_HOST_NAME_MAX 64 #define __FC_TTY_NAME_MAX 32 /* for stdarg.h */ #define __FC_VA_LIST_T __builtin_va_list /* stdint.h */ /* NB: in signal.h, sig_atomic_t is hardwired to int. */ #define __FC_SIG_ATOMIC_MIN __FC_INT_MIN #define __FC_SIG_ATOMIC_MAX __FC_INT_MAX #define __FC_WCHAR_MIN __FC_INT_MIN #define __FC_WCHAR_MAX __FC_INT_MAX #define __FC_INTMAX_MIN (-9223372036854775807LL -1LL) #define __FC_INTMAX_MAX 9223372036854775807LL #define __FC_UINTMAX_MAX 18446744073709551615ULL // Linux usually defines wchar_t as a signed int, but this is not required #define __WCHAR_T int /* stdio.h */ #define __FC_BUFSIZ 8192 #define __FC_EOF (-1) #define __FC_FOPEN_MAX 16 #define __FC_FILENAME_MAX 2048 #define __FC_L_tmpnam 2048 #define __FC_TMP_MAX 0xFFFFFFFF /* stdlib.h */ #define __FC_RAND_MAX 32767 #define __FC_MB_CUR_MAX ((size_t)16) /* errno.h */ #define __FC_EPERM 1 #define __FC_ENOENT 2 #define __FC_ESRCH 3 #define __FC_EINTR 4 #define __FC_EIO 5 #define __FC_ENXIO 6 #define __FC_E2BIG 7 #define __FC_ENOEXEC 8 #define __FC_EBADF 9 #define __FC_ECHILD 10 #define __FC_EAGAIN 11 #define __FC_ENOMEM 12 #define __FC_EACCES 13 #define __FC_EFAULT 14 #define __FC_ENOTBLK 15 #define __FC_EBUSY 16 #define __FC_EEXIST 17 #define __FC_EXDEV 18 #define __FC_ENODEV 19 #define __FC_ENOTDIR 20 #define __FC_EISDIR 21 #define __FC_EINVAL 22 #define __FC_ENFILE 23 #define __FC_EMFILE 24 #define __FC_ENOTTY 25 #define __FC_ETXTBSY 26 #define __FC_EFBIG 27 #define __FC_ENOSPC 28 #define __FC_ESPIPE 29 #define __FC_EROFS 30 #define __FC_EMLINK 31 #define __FC_EPIPE 32 #define __FC_EDOM 33 #define __FC_ERANGE 34 #define __FC_EDEADLK 35 #define __FC_ENAMETOOLONG 36 #define __FC_ENOLCK 37 #define __FC_ENOSYS 38 #define __FC_ENOTEMPTY 39 #define __FC_ELOOP 40 #define __FC_EWOULDBLOCK EAGAIN #define __FC_ENOMSG 42 #define __FC_EIDRM 43 #define __FC_ECHRNG 44 #define __FC_EL2NSYNC 45 #define __FC_EL3HLT 46 #define __FC_EL3RST 47 #define __FC_ELNRNG 48 #define __FC_EUNATCH 49 #define __FC_ENOCSI 50 #define __FC_EL2HLT 51 #define __FC_EBADE 52 #define __FC_EBADR 53 #define __FC_EXFULL 54 #define __FC_ENOANO 55 #define __FC_EBADRQC 56 #define __FC_EBADSLT 57 #define __FC_EDEADLOCK EDEADLK #define __FC_EBFONT 59 #define __FC_ENOSTR 60 #define __FC_ENODATA 61 #define __FC_ETIME 62 #define __FC_ENOSR 63 #define __FC_ENONET 64 #define __FC_ENOPKG 65 #define __FC_EREMOTE 66 #define __FC_ENOLINK 67 #define __FC_EADV 68 #define __FC_ESRMNT 69 #define __FC_ECOMM 70 #define __FC_EPROTO 71 #define __FC_EMULTIHOP 72 #define __FC_EDOTDOT 73 #define __FC_EBADMSG 74 #define __FC_EOVERFLOW 75 #define __FC_ENOTUNIQ 76 #define __FC_EBADFD 77 #define __FC_EREMCHG 78 #define __FC_ELIBACC 79 #define __FC_ELIBBAD 80 #define __FC_ELIBSCN 81 #define __FC_ELIBMAX 82 #define __FC_ELIBEXEC 83 #define __FC_EILSEQ 84 #define __FC_ERESTART 85 #define __FC_ESTRPIPE 86 #define __FC_EUSERS 87 #define __FC_ENOTSOCK 88 #define __FC_EDESTADDRREQ 89 #define __FC_EMSGSIZE 90 #define __FC_EPROTOTYPE 91 #define __FC_ENOPROTOOPT 92 #define __FC_EPROTONOSUPPORT 93 #define __FC_ESOCKTNOSUPPORT 94 #define __FC_ENOTSUP 95 #define __FC_EOPNOTSUPP 95 #define __FC_EPFNOSUPPORT 96 #define __FC_EAFNOSUPPORT 97 #define __FC_EADDRINUSE 98 #define __FC_EADDRNOTAVAIL 99 #define __FC_ENETDOWN 100 #define __FC_ENETUNREACH 101 #define __FC_ENETRESET 102 #define __FC_ECONNABORTED 103 #define __FC_ECONNRESET 104 #define __FC_ENOBUFS 105 #define __FC_EISCONN 106 #define __FC_ENOTCONN 107 #define __FC_ESHUTDOWN 108 #define __FC_ETOOMANYREFS 109 #define __FC_ETIMEDOUT 110 #define __FC_ECONNREFUSED 111 #define __FC_EHOSTDOWN 112 #define __FC_EHOSTUNREACH 113 #define __FC_EALREADY 114 #define __FC_EINPROGRESS 115 #define __FC_ESTALE 116 #define __FC_EUCLEAN 117 #define __FC_ENOTNAM 118 #define __FC_ENAVAIL 119 #define __FC_EISNAM 120 #define __FC_EREMOTEIO 121 #define __FC_EDQUOT 122 #define __FC_ENOMEDIUM 123 #define __FC_EMEDIUMTYPE 124 #define __FC_ECANCELED 125 #define __FC_ENOKEY 126 #define __FC_EKEYEXPIRED 127 #define __FC_EKEYREVOKED 128 #define __FC_EKEYREJECTED 129 #define __FC_EOWNERDEAD 130 #define __FC_ENOTRECOVERABLE 131 #define __FC_ERFKILL 132 #define __FC_EHWPOISON 133 /* time.h */ #define __FC_TIME_T long #endif frama-c-20.0-Calcium/share/libc/__fc_runtime.c0000666000000000000000000000362213571573400016026 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "__fc_builtin.c" #include "assert.c" #include "ctype.c" #include "errno.c" #include "fenv.c" #include "getopt.c" #include "glob.c" #include "inttypes.c" #include "locale.c" #include "math.c" #include "netdb.c" #include "signal.c" #include "stdio.c" #include "stdlib.c" #include "string.c" #include "wchar.c" frama-c-20.0-Calcium/share/libc/__fc_select.h0000666000000000000000000000705113571573400015627 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SELECT__ #define __FC_SELECT__ #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_time_t.h" #include "__fc_define_suseconds_t.h" #include "__fc_define_fd_set_t.h" #include "__fc_define_sigset_t.h" #include "sys/time.h" __BEGIN_DECLS /* assigns \result \from nfds, *readfds, *writefds,*errorfds,*timeout,*sigmask; */ extern int pselect(int nfds, fd_set * readfds, fd_set * writefds, fd_set * errorfds, const struct timespec * timeout, const sigset_t * sigmask); // __fc_fds_state is a very coarse model for the state of all // file descriptor sets; it is sound, but very imprecise. //@ ghost volatile int __fc_fds_state; /*@ requires nfds: nfds >= 0; requires readfs: readfds == \null || \valid(readfds); requires writefds: writefds == \null || \valid(writefds); requires errorfds: errorfds == \null || \valid(errorfds); requires timeout: timeout == \null || \valid(timeout); assigns __fc_fds_state \from __fc_fds_state; assigns *readfds, *writefds, *errorfds, *timeout, \result \from indirect:nfds, indirect:readfds, indirect:*readfds, indirect:writefds, indirect:*writefds, indirect:errorfds, indirect:*errorfds, indirect:timeout, indirect:*timeout, __fc_fds_state; behavior read_notnull: assumes readfds_is_not_null: readfds != \null; ensures initialization:readfds: \initialized(readfds); behavior write_notnull: assumes writefds_is_not_null: writefds != \null; ensures initialization:writefds: \initialized(writefds); behavior error_notnull: assumes errorfds_is_not_null: errorfds != \null; ensures initialization:errorfds: \initialized(errorfds); behavior timeout_notnull: assumes timeout_is_not_null: timeout != \null; ensures initialization:timeout: \initialized(timeout); */ extern int select(int nfds, fd_set * readfds, fd_set * writefds, fd_set * errorfds, struct timeval * timeout); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/__fc_string_axiomatic.h0000666000000000000000000002464113571573400017720 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* $Id: jessie_machine_prolog.h,v 1.8 2008-12-09 10:17:25 uid525 Exp $ */ #ifndef __FC_STRING_AXIOMATIC #define __FC_STRING_AXIOMATIC #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_null.h" #include "__fc_define_wchar_t.h" __BEGIN_DECLS /*@ axiomatic MemCmp { @ logic ℤ memcmp{L1,L2}(char *s1, char *s2, ℤ n) @ reads \at(s1[0..n - 1],L1), \at(s2[0..n - 1],L2); @ @ axiom memcmp_zero{L1,L2}: @ \forall char *s1, *s2; \forall ℤ n; @ memcmp{L1,L2}(s1,s2,n) == 0 @ <==> \forall ℤ i; 0 <= i < n ==> \at(s1[i],L1) == \at(s2[i],L2); @ @ } @*/ /*@ axiomatic MemChr { @ logic 𝔹 memchr{L}(char *s, ℤ c, ℤ n) @ reads s[0..n - 1]; @ // Returns [true] iff array [s] contains character [c] @ @ logic ℤ memchr_off{L}(char *s, ℤ c, ℤ n) @ reads s[0..n - 1]; @ // Returns the offset at which [c] appears in [s]. // TODO: is n useful? @ @ axiom memchr_def{L}: @ \forall char *s; \forall ℤ c; \forall ℤ n; @ memchr(s,c,n) <==> \exists int i; 0 <= i < n && s[i] == c; @ } @*/ /*@ axiomatic MemSet { @ logic 𝔹 memset{L}(char *s, ℤ c, ℤ n) @ reads s[0..n - 1]; @ // Returns [true] iff array [s] contains only character [c] @ @ axiom memset_def{L}: @ \forall char *s; \forall ℤ c; \forall ℤ n; @ memset(s,c,n) <==> \forall ℤ i; 0 <= i < n ==> s[i] == c; @ } @*/ /*@ axiomatic StrLen { @ logic ℤ strlen{L}(char *s) @ reads s[0..]; @ @ axiom strlen_pos_or_null{L}: @ \forall char* s; \forall ℤ i; @ (0 <= i @ && (\forall ℤ j; 0 <= j < i ==> s[j] != '\0') @ && s[i] == '\0') ==> strlen(s) == i; @ @ axiom strlen_neg{L}: @ \forall char* s; @ (\forall ℤ i; 0 <= i ==> s[i] != '\0') @ ==> strlen(s) < 0; @ @ axiom strlen_before_null{L}: @ \forall char* s; \forall ℤ i; 0 <= i < strlen(s) ==> s[i] != '\0'; @ @ axiom strlen_at_null{L}: @ \forall char* s; 0 <= strlen(s) ==> s[strlen(s)] == '\0'; @ @ axiom strlen_not_zero{L}: @ \forall char* s; \forall ℤ i; @ 0 <= i <= strlen(s) && s[i] != '\0' ==> i < strlen(s); @ @ axiom strlen_zero{L}: @ \forall char* s; \forall ℤ i; @ 0 <= i <= strlen(s) && s[i] == '\0' ==> i == strlen(s); @ @ axiom strlen_sup{L}: @ \forall char* s; \forall ℤ i; @ 0 <= i && s[i] == '\0' ==> 0 <= strlen(s) <= i; @ @ axiom strlen_shift{L}: @ \forall char* s; \forall ℤ i; @ 0 <= i <= strlen(s) ==> strlen(s + i) == strlen(s) - i; @ @ axiom strlen_create{L}: @ \forall char* s; \forall ℤ i; @ 0 <= i && s[i] == '\0' ==> 0 <= strlen(s) <= i; @ @ axiom strlen_create_shift{L}: @ \forall char* s; \forall ℤ i; \forall ℤ k; @ 0 <= k <= i && s[i] == '\0' ==> 0 <= strlen(s+k) <= i - k; @ @ axiom memcmp_strlen_left{L}: @ \forall char *s1, *s2; \forall ℤ n; @ memcmp{L,L}(s1,s2,n) == 0 && strlen(s1) < n ==> strlen(s1) == strlen(s2); @ @ axiom memcmp_strlen_right{L}: @ \forall char *s1, *s2; \forall ℤ n; @ memcmp{L,L}(s1,s2,n) == 0 && strlen(s2) < n ==> strlen(s1) == strlen(s2); @ @ axiom memcmp_strlen_shift_left{L}: @ \forall char *s1, *s2; \forall ℤ k, n; @ memcmp{L,L}(s1,s2 + k,n) == 0 && 0 <= k && strlen(s1) < n ==> @ 0 <= strlen(s2) <= k + strlen(s1); @ @ axiom memcmp_strlen_shift_right{L}: @ \forall char *s1, *s2; \forall ℤ k, n; @ memcmp{L,L}(s1 + k,s2,n) == 0 && 0 <= k && strlen(s2) < n ==> @ 0 <= strlen(s1) <= k + strlen(s2); @ } @*/ /*@ axiomatic StrCmp { @ logic ℤ strcmp{L}(char *s1, char *s2) @ reads s1[0..strlen(s1)], s2[0..strlen(s2)]; @ @ axiom strcmp_zero{L}: @ \forall char *s1, *s2; @ strcmp(s1,s2) == 0 <==> @ (strlen(s1) == strlen(s2) @ && \forall ℤ i; 0 <= i <= strlen(s1) ==> s1[i] == s2[i]); @ } @*/ /*@ axiomatic StrNCmp { @ logic ℤ strncmp{L}(char *s1, char *s2, ℤ n) @ reads s1[0..n-1], s2[0..n-1]; @ @ axiom strncmp_zero{L}: @ \forall char *s1, *s2; \forall ℤ n; @ strncmp(s1,s2,n) == 0 <==> @ (strlen(s1) < n && strcmp(s1,s2) == 0 @ || \forall ℤ i; 0 <= i < n ==> s1[i] == s2[i]); @ } @*/ /*@ axiomatic StrChr { @ logic 𝔹 strchr{L}(char *s, ℤ c) @ reads s[0..strlen(s)]; @ // Returns [true] iff string [s] contains [c] (interpreted as char) @ @ axiom strchr_def{L}: @ \forall char *s; \forall ℤ c; @ strchr(s,c) <==> \exists ℤ i; 0 <= i <= strlen(s) && s[i] == (char)c; @ } @*/ /*@ axiomatic WMemChr { @ logic 𝔹 wmemchr{L}(wchar_t *s, wchar_t c, ℤ n) @ reads s[0..n - 1]; @ // Returns [true] iff wide char array [s] contains wide character [c] @ @ logic ℤ wmemchr_off{L}(wchar_t *s, wchar_t c, ℤ n) @ reads s[0..n - 1]; @ // Returns the offset at which [c] appears in [s]. @ @ axiom wmemchr_def{L}: @ \forall wchar_t *s; \forall wchar_t c; \forall ℤ n; @ wmemchr(s,c,n) <==> \exists int i; 0 <= i < n && s[i] == c; @ } @*/ /*@ axiomatic WcsLen { @ logic ℤ wcslen{L}(wchar_t *s) @ reads s[0..]; @ @ axiom wcslen_pos_or_null{L}: @ \forall wchar_t* s; \forall ℤ i; @ (0 <= i @ && (\forall ℤ j; 0 <= j < i ==> s[j] != L'\0') @ && s[i] == L'\0') ==> wcslen(s) == i; @ @ axiom wcslen_neg{L}: @ \forall wchar_t* s; @ (\forall ℤ i; 0 <= i ==> s[i] != L'\0') @ ==> wcslen(s) < 0; @ @ axiom wcslen_before_null{L}: @ \forall wchar_t* s; \forall int i; 0 <= i < wcslen(s) ==> s[i] != L'\0'; @ @ axiom wcslen_at_null{L}: @ \forall wchar_t* s; 0 <= wcslen(s) ==> s[wcslen(s)] == L'\0'; @ @ axiom wcslen_not_zero{L}: @ \forall wchar_t* s; \forall int i; @ 0 <= i <= wcslen(s) && s[i] != L'\0' ==> i < wcslen(s); @ @ axiom wcslen_zero{L}: @ \forall wchar_t* s; \forall int i; @ 0 <= i <= wcslen(s) && s[i] == L'\0' ==> i == wcslen(s); @ @ axiom wcslen_sup{L}: @ \forall wchar_t* s; \forall int i; @ 0 <= i && s[i] == L'\0' ==> 0 <= wcslen(s) <= i; @ @ axiom wcslen_shift{L}: @ \forall wchar_t* s; \forall int i; @ 0 <= i <= wcslen(s) ==> wcslen(s+i) == wcslen(s)-i; @ @ axiom wcslen_create{L}: @ \forall wchar_t* s; \forall int i; @ 0 <= i && s[i] == L'\0' ==> 0 <= wcslen(s) <= i; @ @ axiom wcslen_create_shift{L}: @ \forall wchar_t* s; \forall int i; \forall int k; @ 0 <= k <= i && s[i] == L'\0' ==> 0 <= wcslen(s+k) <= i - k; @ } @*/ /*@ axiomatic WcsCmp { @ logic ℤ wcscmp{L}(wchar_t *s1, wchar_t *s2) @ reads s1[0..wcslen(s1)], s2[0..wcslen(s2)]; @ @ axiom wcscmp_zero{L}: @ \forall wchar_t *s1, *s2; @ wcscmp(s1,s2) == 0 <==> @ (wcslen(s1) == wcslen(s2) @ && \forall ℤ i; 0 <= i <= wcslen(s1) ==> s1[i] == s2[i]); @ } @*/ /*@ axiomatic WcsNCmp { @ logic ℤ wcsncmp{L}(wchar_t *s1, wchar_t *s2, ℤ n) @ reads s1[0..n-1], s2[0..n-1]; @ @ axiom wcsncmp_zero{L}: @ \forall wchar_t *s1, *s2; \forall ℤ n; @ wcsncmp(s1,s2,n) == 0 <==> @ (wcslen(s1) < n && wcscmp(s1,s2) == 0 @ || \forall ℤ i; 0 <= i < n ==> s1[i] == s2[i]); @ } @*/ /*@ axiomatic WcsChr { @ logic 𝔹 wcschr{L}(wchar_t *wcs, ℤ wc) @ reads wcs[0..wcslen(wcs)]; @ // Returns [true] iff wide string [wcs] contains [wc] @ //(interpreted as wchar_t) @ @ axiom wcschr_def{L}: @ \forall wchar_t *wcs; \forall ℤ wc; @ wcschr(wcs,wc) <==> \exists ℤ i; 0 <= i <= wcslen(wcs) @ && wcs[i] == (wchar_t)wc; @ } @*/ /*@ logic ℤ minimum(ℤ i, ℤ j) = i < j ? i : j; @ logic ℤ maximum(ℤ i, ℤ j) = i < j ? j : i; @*/ /*@ predicate valid_string{L}(char *s) = @ 0 <= strlen(s) && \valid(s+(0..strlen(s))); @ @ predicate valid_read_string{L}(char *s) = @ 0 <= strlen(s) && \valid_read(s+(0..strlen(s))); @ @ predicate valid_read_nstring{L}(char *s, ℤ n) = @ (\valid_read(s+(0..n-1)) && \initialized(s+(0..n-1))) @ || valid_read_string{L}(s); @ @ predicate valid_string_or_null{L}(char *s) = @ s == \null || valid_string(s); @ @ predicate valid_wstring{L}(wchar_t *s) = @ 0 <= wcslen(s) && \valid(s+(0..wcslen(s))); @ @ predicate valid_read_wstring{L}(wchar_t *s) = @ 0 <= wcslen(s) && \valid_read(s+(0..wcslen(s))); @ @ predicate valid_read_nwstring{L}(wchar_t *s, ℤ n) = @ (\valid_read(s+(0..n-1)) && \initialized(s+(0..n-1))) @ || valid_read_wstring{L}(s); @ @ predicate valid_wstring_or_null{L}(wchar_t *s) = @ s == \null || valid_wstring(s); @*/ __END_DECLS #define FRAMA_C_PTR __declspec(valid) #define FRAMA_C_ARRAY(n) __declspec(valid_range(0,n)) #define FRAMA_C_STRING __declspec(valid_string) #define FRAMA_C_STRING_OR_NULL __declspec(valid_string_or_null) #define FRAMA_C_WSTRING __declspec(valid_wstring) #define FRAMA_C_WSTRING_OR_NULL __declspec(valid_wstring_or_null) __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/alloca.h0000666000000000000000000000445713571573400014644 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_ALLOCA #define __FC_ALLOCA #include "features.h" __PUSH_FC_STDLIB #include "stdlib.h" __BEGIN_DECLS /*@ ghost extern int __fc_stack_status __attribute__((FRAMA_C_MODEL)); */ // Note: alloca is considered to never fail, unlike malloc // Currently, ACSL does not allow specifying that the memory allocated by // alloca must be freed at the end of the execution of its caller, // therefore this responsibility is given to the user of this function. /*@ allocates \result; assigns __fc_stack_status \from size, __fc_stack_status; assigns \result \from indirect:size, indirect:__fc_stack_status; ensures allocation: \fresh(\result,size); */ extern void *alloca(size_t size); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/arpa/0000777000000000000000000000000013571573400014151 5ustar frama-c-20.0-Calcium/share/libc/arpa/inet.h0000666000000000000000000000356413571573400015271 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ // According to POSIX, definitions from both arpa/inet.h and netinet/in.h // may be exported by one another, so everything is defined in a common file. #ifndef __FC_ARPA_INET #define __FC_ARPA_INET #include "features.h" __PUSH_FC_STDLIB #include "../__fc_inet.h" __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/assert.c0000666000000000000000000000365713571573400014706 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "__fc_builtin.h" #include "assert.h" __PUSH_FC_STDLIB //@ assigns \nothing; extern void Frama_C_show_each_warning(); void __FC_assert(int c,const char* file,int line,const char*expr) { if (!c) { #ifdef __FRAMAC__ Frama_C_show_each_warning("Assertion may fail",file,line,expr); #endif Frama_C_abort (); } } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/assert.h0000666000000000000000000000377613571573400014715 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_ASSERT #define __FC_ASSERT #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS /*@ requires nonnull_c: c != 0; terminates c != 0; assigns \nothing; */ extern void __FC_assert(int c, const char* file, int line, const char*expr); __END_DECLS __POP_FC_STDLIB #endif #undef assert #ifdef NDEBUG #define assert(ignore) ((void)0) #else #define assert(e) (__FC_assert((e) != 0,__FILE__,__LINE__,#e)) #endif frama-c-20.0-Calcium/share/libc/byteswap.h0000666000000000000000000001252013571573400015235 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _BYTESWAP_H #define _BYTESWAP_H 1 /* Get the machine specific, optimized definitions. */ //#include /* Swap bytes in 16 bit value. */ #define __bswap_constant_16(x) \ ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)) /* This is better than nothing. */ # define __bswap_16(x) \ (__extension__ \ ({ register unsigned short int __x = (x); __bswap_constant_16 (__x); })) /* Swap bytes in 32 bit value. */ #define __bswap_constant_32(x) \ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) # define __bswap_32(x) \ (__extension__ \ ({ register unsigned int __x = (x); __bswap_constant_32 (__x); })) /* Swap bytes in 64 bit value. */ # define __bswap_constant_64(x) \ ((((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56)) # define __bswap_64(x) \ (__extension__ \ ({ union __fc_bswap { __extension__ unsigned long long int __ll; \ unsigned int __l[2]; } __w, __r; \ if (__builtin_constant_p (x)) \ __r.__ll = __bswap_constant_64 (x); \ else \ { \ __w.__ll = (x); \ __r.__l[0] = __bswap_32 (__w.__l[1]); \ __r.__l[1] = __bswap_32 (__w.__l[0]); \ } \ __r.__ll; })) /* The following definitions must all be macros since otherwise some of the possible optimizations are not possible. */ /* Return a value with all bytes in the 16 bit argument swapped. */ #define bswap_16(x) __bswap_16 (x) /* Return a value with all bytes in the 32 bit argument swapped. */ #define bswap_32(x) __bswap_32 (x) #if defined __GNUC__ && __GNUC__ >= 2 /* Return a value with all bytes in the 64 bit argument swapped. */ # define bswap_64(x) __bswap_64 (x) #endif #endif /* byteswap.h */ frama-c-20.0-Calcium/share/libc/complex.h0000666000000000000000000000333413571573400015051 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.3 */ #ifndef __FC_COMPLEX #define __FC_COMPLEX #ifndef __FC_REG_TEST #error "Frama-C: unsupported complex.h" #endif #endif frama-c-20.0-Calcium/share/libc/ctype.c0000666000000000000000000000624013571573400014520 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "ctype.h" #include "__fc_builtin.h" __PUSH_FC_STDLIB // This file assumes a simple, C-like locale, with no extra characters // or special cases. #define ISDIGIT(_c) \ ((_c) >= '0' && (_c) <= '9') #define ISXDIGIT(_c) \ (ISDIGIT(_c) || \ ((_c) >= 'a' && (_c) <= 'f') || \ ((_c) >= 'A' && (_c) <= 'F')) // if locale = "C" #define ISLOWER(_c) \ ((_c) >= 'a' && (_c) <= 'z') // if locale = "C" #define ISUPPER(_c) \ ((_c) >= 'A' && (_c) <= 'Z') #define ISALPHA(_c) \ (ISUPPER(_c) || \ ISLOWER(_c)) #define ISALNUM(_c) \ (ISALPHA(_c) || \ ISDIGIT(_c)) // if locale = "C" #define ISSPACE(_c) \ ((_c) == ' ' || \ (_c) == '\f' || \ (_c) == '\n' || \ (_c) == '\r' || \ (_c) == '\t' || \ (_c) == '\v' ) // if locale = "C" #define ISBLANK(_c) \ ((_c) == ' ' || \ (_c) == '\t') int isalnum(int c) { return (ISALNUM(c)); } int isalpha(int c){ return (ISALPHA(c)); } int isblank(int c){ return (ISBLANK(c)||ISSPACE(c)); } int iscntrl(int c) { return (Frama_C_nondet(0,1)); } int isdigit(int c) { return (ISDIGIT(c)); } int isgraph(int c) { return (Frama_C_nondet(0,1)); } int islower(int c) { return (ISLOWER(c)); } int isprint(int c) { return (Frama_C_nondet(0,1)); } int ispunct(int c) { return (Frama_C_nondet(0,1)); } int isspace(int c) { return (ISSPACE(c)); } int isupper(int c) { return (ISUPPER(c)); } int isxdigit(int c) { return (ISXDIGIT(c)); } int tolower(int c) { if ((c >= 'A') && (c <= 'Z')) return c + 0x20; return c; } int toupper (int c) { if ((c >= 'a') && (c <= 'z')) return c - 0x20; return c; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/ctype.h0000666000000000000000000002062613571573400014531 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_CTYPE #define __FC_CTYPE #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_eof.h" /* ISO C : 7.4.1 */ __BEGIN_DECLS /* Functions which have no complete behaviors are either due to locale-dependent characters, or under-specification by the C standard. */ /* Note: most functions use '\result < 0 || \result > 0' instead of of '\result != 0' for better precision if there is enough slevel. */ /*@ requires c_uchar_or_eof_or_EOF: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior definitely_match: assumes c_alnum: 'A' <= c <= 'Z' || 'a' <= c <= 'z' || '0' <= c <= '9'; ensures nonzero_result: \result < 0 || \result > 0; behavior definitely_not_match: assumes c_non_alnum: c == EOF || 0 <= c <= 47 || 58 <= c <= 64 || 91 <= c <= 96 || 123 <= c <= 127; ensures zero_result: \result == 0; disjoint behaviors; */ extern int isalnum(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior definitely_match: assumes c_alpha: 'A' <= c <= 'Z' || 'a' <= c <= 'z'; ensures nonzero_result: \result < 0 || \result > 0; behavior definitely_not_match: assumes c_non_alpha: c == EOF || 0 <= c <= 64 || 91 <= c <= 96 || 123 <= c <= 127; ensures zero_result: \result == 0; disjoint behaviors; */ extern int isalpha(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior match: assumes c_tab_or_space: c == ' ' || c == '\t'; ensures nonzero_result: \result < 0 || \result > 0; behavior no_match: assumes c_non_blank: c != ' ' && c != '\t'; ensures zero_result: \result == 0; disjoint behaviors; complete behaviors; */ extern int isblank(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior definitely_match: assumes c_control_char: 0 <= c <= 31 || c == 127; ensures nonzero_result: \result < 0 || \result > 0; behavior definitely_not_match: assumes c_non_control_char: c == EOF || 32 <= c <= 126; ensures zero_result: \result == 0; disjoint behaviors; */ extern int iscntrl(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior match: assumes c_digit: '0' <= c <= '9'; ensures nonzero_result: \result < 0 || \result > 0; behavior no_match: assumes c_non_digit: c < '0' || c > '9'; ensures zero_result: \result == 0; disjoint behaviors; complete behaviors; */ extern int isdigit(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior definitely_match: assumes c_graphical: 33 <= c <= 126; ensures nonzero_result: \result < 0 || \result > 0; behavior definitely_not_match: assumes c_non_graphical: c == EOF || 0 <= c <= 32 || c == 127; ensures zero_result: \result == 0; disjoint behaviors; */ extern int isgraph(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior definitely_match: assumes c_lower: 'a' <= c <= 'z'; ensures nonzero_result: \result < 0 || \result > 0; behavior definitely_not_match: assumes c_non_lower: c == EOF || 0 <= c < 'a' || 'z' < c < 127; ensures zero_result: \result == 0; disjoint behaviors; */ extern int islower(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior definitely_match: assumes c_printable: 32 <= c <= 126; ensures nonzero_result: \result < 0 || \result > 0; behavior definitely_not_match: assumes c_non_printable: c == EOF || 0 <= c <= 31 || c == 127; ensures zero_result: \result == 0; disjoint behaviors; */ extern int isprint(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior definitely_match: assumes c_punct: 33 <= c <= 47 || 58 <= c <= 64 || 91 <= c <= 96 || 123 <= c <= 126; ensures nonzero_result: \result < 0 || \result > 0; behavior definitely_not_match: assumes c_non_punct: c == EOF || 0 <= c <= 32 || 48 <= c <= 57 || 65 <= c <= 90 || 97 <= c <= 122 || c == 127; ensures zero_result: \result == 0; disjoint behaviors; */ extern int ispunct(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior definitely_match: assumes c_space: 9 <= c <= 13 || c == ' '; ensures nonzero_result: \result < 0 || \result > 0; behavior definitely_not_match: assumes c_non_space: c == EOF || 0 <= c <= 8 || 14 <= c < ' ' || ' ' < c <= 127; ensures zero_result: \result == 0; disjoint behaviors; */ extern int isspace(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior definitely_match: assumes c_upper: 'A' <= c <= 'Z'; ensures nonzero_result: \result < 0 || \result > 0; behavior definitely_not_match: assumes c_non_upper: c == EOF || 0 <= c < 'A' || 'Z' < c <= 127; ensures zero_result: \result == 0; disjoint behaviors; */ extern int isupper(int c); /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior match: assumes c_hexa_digit: '0' <= c <= '9' || 'A' <= c <= 'F' || 'a' <= c <= 'f'; ensures nonzero_result: \result < 0 || \result > 0; behavior no_match: assumes c_non_hexa_digit: !('0' <= c <= '9' || 'A' <= c <= 'F' || 'a' <= c <= 'f'); ensures zero_result: \result == 0; disjoint behaviors; complete behaviors; */ extern int isxdigit(int c); /* ISO C : 7.4.2 */ /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; ensures result_uchar_of_eof: 0 <= \result <= 255 || \result == EOF; behavior definitely_changed: assumes c_ascii_upper: 'A' <= c <= 'Z'; ensures result_ascii_lower: \result == c + 32; behavior definitely_not_changed: assumes c_ascii_but_non_upper: c == EOF || 0 <= c < 'A' || 'Z' < c <= 127; ensures result_unchanged: \result == c; disjoint behaviors; */ extern int tolower(int c); /*@ requires c_uchar_of_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; ensures result_uchar_of_eof: 0 <= \result <= 255 || \result == EOF; behavior definitely_changed: assumes c_ascii_lower: 'a' <= c <= 'z'; ensures result_ascii_upper: \result == c - 32; behavior definitely_not_changed: assumes c_ascii_but_non_lower: c == EOF || 0 <= c < 'a' || 'z' < c <= 127; ensures result_unchanged: \result == c; disjoint behaviors; */ extern int toupper(int c); /* POSIX */ /*@ requires c_uchar_or_eof: 0 <= c <= 255 || c == EOF; assigns \result \from c; behavior match: assumes c_ascii: 0 <= c <= 127; ensures nonzero_result: \result < 0 || \result > 0; behavior no_match: assumes c_non_ascii: !(0 <= c <= 127); ensures zero_result: \result == 0; disjoint behaviors; complete behaviors; */ extern int isascii(int c); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/dirent.h0000666000000000000000000001136413571573400014671 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DIRENT_H #define __FC_DIRENT_H #include "features.h" __PUSH_FC_STDLIB #include "errno.h" #include "__fc_define_ino_t.h" #include "__fc_define_off_t.h" __BEGIN_DECLS struct dirent { ino_t d_ino; /* inode number */ off_t d_off; /* offset to the next dirent */ unsigned short d_reclen; /* length of this record */ unsigned char d_type; /* type of file; not supported by all file system types */ char d_name[256]; /* filename */ }; typedef struct DIR { unsigned int __fc_dir_id; unsigned int __fc_dir_position; struct stat* __fc_dir_inode; struct dirent ** __fc_dir_entries; } DIR; DIR __fc_opendir[__FC_FOPEN_MAX]; DIR* const __fc_p_opendir = __fc_opendir; extern int alphasort(const struct dirent **, const struct dirent **); /*@ requires dirp_valid_dir_stream: \subset(dirp,&__fc_opendir[0 .. __FC_FOPEN_MAX-1]); assigns \result \from dirp, *dirp, __fc_p_opendir; assigns __fc_errno \from dirp, *dirp, __fc_p_opendir; assigns *dirp \from dirp, *dirp, __fc_p_opendir; ensures err_or_closed_on_success: (\result == 0 && dirp->__fc_dir_inode == \null) || \result == -1; */ extern int closedir(DIR *dirp); extern int dirfd(DIR *); extern DIR *fdopendir(int); /*@ assigns \result \from path[0..], __fc_p_opendir; assigns __fc_errno \from path[0..], __fc_p_opendir; ensures result_null_or_valid: \result == \null || \valid(\result); ensures valid_dir_stream_on_success: \result != \null ==> \result == &__fc_opendir[\result->__fc_dir_id]; ensures stream_positioned_on_success: \result != \null ==> \result->__fc_dir_inode != \null; */ extern DIR *opendir(const char *path); /*@ requires dirp_valid_dir_stream: \subset(dirp, &__fc_opendir[0 .. __FC_FOPEN_MAX-1]); assigns \result \from *dirp, __fc_p_opendir; assigns dirp->__fc_dir_position \from dirp->__fc_dir_position; assigns __fc_errno \from dirp, *dirp, __fc_p_opendir; ensures result_null_or_valid: \result == \null || \valid(\result); */ extern struct dirent *readdir(DIR *dirp); extern int readdir_r(DIR * dirp, struct dirent * entry, struct dirent ** result); extern void rewinddir(DIR *); extern int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)); extern void seekdir(DIR *, long); extern long telldir(DIR *); /* File types for `d_type'. */ enum __fc_readdir_dtype { DT_UNKNOWN = 0, # define DT_UNKNOWN DT_UNKNOWN DT_FIFO = 1, # define DT_FIFO DT_FIFO DT_CHR = 2, # define DT_CHR DT_CHR DT_DIR = 4, # define DT_DIR DT_DIR DT_BLK = 6, # define DT_BLK DT_BLK DT_REG = 8, # define DT_REG DT_REG DT_LNK = 10, # define DT_LNK DT_LNK DT_SOCK = 12, # define DT_SOCK DT_SOCK DT_WHT = 14 # define DT_WHT DT_WHT }; /* Convert between stat structure types and directory types. */ # define IFTODT(mode) (((mode) & 0170000) >> 12) # define DTTOIF(dirtype) ((dirtype) << 12) __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/dlfcn.h0000666000000000000000000000367213571573400014475 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_DLFCN_H #define __FC_DLFCN_H #include "features.h" __PUSH_FC_STDLIB #define RTLD_LAZY 1 #define RTLD_NOW 2 #define RTLD_GLOBAL 3 #define RTLD_LOCAL 4 __BEGIN_DECLS extern void *dlopen(const char *, int); extern void *dlsym(void *, const char *); extern int dlclose(void *); extern char *dlerror(void); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/endian.h0000666000000000000000000000513513571573400014641 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* Copyright (C) 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _ENDIAN_H #define _ENDIAN_H 1 #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #include "__fc_machdep.h" #define __BYTE_ORDER __FC_BYTE_ORDER #endif /* endian.h */ frama-c-20.0-Calcium/share/libc/errno.c0000666000000000000000000000323713571573400014524 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "errno.h" __PUSH_FC_STDLIB int __fc_errno = 0; __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/errno.h0000666000000000000000000001275613571573400014537 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.5 */ #ifndef __FC_ERRNO #define __FC_ERRNO #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" /* Mandatory */ #define EDOM __FC_EDOM #define EILSEQ __FC_EILSEQ #define ERANGE __FC_ERANGE /* Implementation defined by POSIX and GNU Linux */ #define E2BIG __FC_E2BIG #define EACCES __FC_EACCES #define EADDRINUSE __FC_EADDRINUSE #define EADDRNOTAVAIL __FC_EADDRNOTAVAIL #define EAFNOSUPPORT __FC_EAFNOSUPPORT #define EAGAIN __FC_EAGAIN #define EALREADY __FC_EALREADY #define EBADE __FC_EBADE #define EBADF __FC_EBADF #define EBADFD __FC_EBADFD #define EBADMSG __FC_EBADMSG #define EBADR __FC_EBADR #define EBADRQC __FC_EBADRQC #define EBADSLT __FC_EBADSLT #define EBUSY __FC_EBUSY #define ECANCELED __FC_ECANCELED #define ECHILD __FC_ECHILD #define ECHRNG __FC_ECHRNG #define ECOMM __FC_ECOMM #define ECONNABORTED __FC_ECONNABORTED #define ECONNREFUSED __FC_ECONNREFUSED #define ECONNRESET __FC_ECONNRESET #define EDEADLK __FC_EDEADLK #define EDEADLOCK __FC_EDEADLOCK #define EDESTADDRREQ __FC_EDESTADDRREQ #define EDQUOT __FC_EDQUOT #define EEXIST __FC_EEXIST #define EFAULT __FC_EFAULT #define EFBIG __FC_EFBIG #define EHOSTDOWN __FC_EHOSTDOWN #define EHOSTUNREACH __FC_EHOSTUNREACH #define EIDRM __FC_EIDRM #define EINPROGRESS __FC_EINPROGRESS #define EINTR __FC_EINTR #define EINVAL __FC_EINVAL #define EIO __FC_EIO #define EISCONN __FC_EISCONN #define EISDIR __FC_EISDIR #define EISNAM __FC_EISNAM #define EKEYEXPIRED __FC_EKEYEXPIRED #define EKEYREJECTED __FC_EKEYREJECTED #define EKEYREVOKED __FC_EKEYREVOKED #define EL2HLT __FC_EL2HLT #define EL2NSYNC __FC_EL2NSYNC #define EL3HLT __FC_EL3HLT #define EL3RST __FC_EL3RST #define ELIBACC __FC_ELIBACC #define ELIBBAD __FC_ELIBBAD #define ELIBMAX __FC_ELIBMAX #define ELIBSCN __FC_ELIBSCN #define ELIBEXEC __FC_ELIBEXEC #define ELOOP __FC_ELOOP #define EMEDIUMTYPE __FC_EMEDIUMTYPE #define EMFILE __FC_EMFILE #define EMLINK __FC_EMLINK #define EMSGSIZE __FC_EMSGSIZE #define EMULTIHOP __FC_EMULTIHOP #define ENAMETOOLONG __FC_ENAMETOOLONG #define ENETDOWN __FC_ENETDOWN #define ENETRESET __FC_ENETRESET #define ENETUNREACH __FC_ENETUNREACH #define ENFILE __FC_ENFILE #define ENOBUFS __FC_ENOBUFS #define ENODATA __FC_ENODATA #define ENODEV __FC_ENODEV #define ENOENT __FC_ENOENT #define ENOEXEC __FC_ENOEXEC #define ENOKEY __FC_ENOKEY #define ENOLCK __FC_ENOLCK #define ENOLINK __FC_ENOLINK #define ENOMEDIUM __FC_ENOMEDIUM #define ENOMEM __FC_ENOMEM #define ENOMSG __FC_ENOMSG #define ENONET __FC_ENONET #define ENOPKG __FC_ENOPKG #define ENOPROTOOPT __FC_ENOPROTOOPT #define ENOSPC __FC_ENOSPC #define ENOSR __FC_ENOSR #define ENOSTR __FC_ENOSTR #define ENOSYS __FC_ENOSYS #define ENOTBLK __FC_ENOTBLK #define ENOTCONN __FC_ENOTCONN #define ENOTDIR __FC_ENOTDIR #define ENOTEMPTY __FC_ENOTEMPTY #define ENOTSOCK __FC_ENOTSOCK #define ENOTSUP __FC_ENOTSUP #define ENOTTY __FC_ENOTTY #define ENOTUNIQ __FC_ENOTUNIQ #define ENXIO __FC_ENXIO #define EOPNOTSUPP __FC_EOPNOTSUPP #define EOVERFLOW __FC_EOVERFLOW #define EPERM __FC_EPERM #define EPFNOSUPPORT __FC_EPFNOSUPPORT #define EPIPE __FC_EPIPE #define EPROTO __FC_EPROTO #define EPROTONOSUPPORT __FC_EPROTONOSUPPORT #define EPROTOTYPE __FC_EPROTOTYPE #define EREMCHG __FC_EREMCHG #define EREMOTE __FC_EREMOTE #define EREMOTEIO __FC_EREMOTEIO #define ERESTART __FC_ERESTART #define EROFS __FC_EROFS #define ESHUTDOWN __FC_ESHUTDOWN #define ESPIPE __FC_ESPIPE #define ESOCKTNOSUPPORT __FC_ESOCKTNOSUPPORT #define ESRCH __FC_ESRCH #define ESTALE __FC_ESTALE #define ESTRPIPE __FC_ESTRPIPE #define ETIME __FC_ETIME #define ETIMEDOUT __FC_ETIMEDOUT #define ETXTBSY __FC_ETXTBSY #define EUCLEAN __FC_EUCLEAN #define EUNATCH __FC_EUNATCH #define EUSERS __FC_EUSERS #define EWOULDBLOCK __FC_EWOULDBLOCK #define EXDEV __FC_EXDEV #define EXFULL __FC_EXFULL __BEGIN_DECLS extern int __fc_errno; #define errno __fc_errno /* _GNU_SOURCE */ extern char *program_invocation_name; extern char *program_invocation_short_name; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/fcntl.h0000666000000000000000000001414513571573400014512 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_FCNTL #define __FC_FCNTL #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_off_t.h" #include "__fc_define_pid_t.h" #include "__fc_define_mode_t.h" #include "__fc_string_axiomatic.h" // The values for the constants below are based on an x86 Linux, // declared in the order given by POSIX.1-2008. // Macros which are not defined in such Linux are commented out. #define F_DUPFD 0 #define F_DUPFD_CLOEXEC 0x406 #define F_GETFD 1 #define F_SETFD 2 #define F_GETFL 3 #define F_SETFL 4 #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 #define F_GETOWN 9 #define F_SETOWN 8 #define FD_CLOEXEC 1 #define F_RDLCK 0 #define F_UNLCK 2 #define F_WRLCK 1 #include "__fc_define_seek_macros.h" #define O_CLOEXEC 0x80000 #define O_CREAT 0x40 #define O_DIRECTORY 0x10000 #define O_EXCL 0x80 #define O_NOCTTY 0x100 #define O_NOFOLLOW 0x20000 #define O_TRUNC 0x200 //#define O_TTY_INIT #define O_APPEND 0x400 #define O_DSYNC 0x1000 #define O_NONBLOCK 0x800 #define O_RSYNC 0x101000 #define O_SYNC 0x101000 #define O_ACCMODE 3 //#define O_EXEC #define O_RDONLY 0 #define O_RDWR 2 //#define O_SEARCH #define O_WRONLY 1 #define AT_FDCWD -100 #define AT_EACCESS 0x200 #define AT_SYMLINK_NOFOLLOW 0x100 #define AT_SYMLINK_FOLLOW 0x400 #define AT_REMOVEDIR 0x200 #define POSIX_FADV_DONTNEED 4 #define POSIX_FADV_NOREUSE 5 #define POSIX_FADV_NORMAL 0 #define POSIX_FADV_RANDOM 1 #define POSIX_FADV_SEQUENTIAL 2 #define POSIX_FADV_WILLNEED 3 __BEGIN_DECLS struct flock { short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ off_t l_start; /* Offset where the lock begins. */ off_t l_len; /* Size of the locked area; zero means until EOF. */ pid_t l_pid; /* Process holding the lock. */ }; /*@ requires valid_filename: valid_read_string(filename); assigns \result \from indirect:filename[0..], indirect:mode; */ extern int creat(const char *filename, mode_t mode); /*@ assigns \result \from fd, cmd ; */ extern int fcntl(int fd, int cmd, ...); /*@ requires valid_filename: valid_read_string(filename); assigns \result \from indirect:filename[0..], indirect:flags; */ extern int open(const char *filename, int flags, ...); /*@ requires valid_filename: valid_read_string(filename); assigns \result \from indirect:dirfd, indirect:filename[0..], indirect:flags; */ extern int openat(int dirfd, const char *filename, int flags, ...); /* The following functions are "fixed-argument" versions of open/fcntl. They are used when the translation of variadic function to fixed-adic is enabled */ /*@ requires cmd_has_void_arg: cmd == F_GETFD || cmd == F_GETFL || cmd == F_GETOWN; assigns \result \from fd, cmd ; */ extern int __va_fcntl_void(int fd, int cmd); /*@ requires cmd_has_int_arg: cmd == F_DUPFD || cmd == F_DUPFD_CLOEXEC || cmd == F_SETFL || cmd == F_SETOWN || cmd == F_SETFD; assigns \result \from fd, cmd, arg ;*/ extern int __va_fcntl_int(int fd, int cmd, int arg); /*@ requires cmd_as_flock_arg: cmd == F_GETLK || cmd == F_SETLK || cmd == F_SETLKW ; requires valid_arg: \valid(arg) ; assigns \result, *arg \from fd, cmd, *arg ; */ extern int __va_fcntl_flock(int fd, int cmd, struct flock *arg); /*@ requires valid_filename: valid_read_string(filename); requires flag_not_CREAT: !(flags & O_CREAT) ; assigns \result \from indirect:filename[0..], indirect:flags; */ extern int __va_open_void(const char *filename, int flags); /*@ requires valid_filename: valid_read_string(filename); assigns \result \from indirect:filename[0..], indirect:flags, indirect:mode; */ extern int __va_open_mode_t(const char *filename, int flags, mode_t mode); /*@ requires valid_filename: valid_read_string(filename); requires flag_not_CREAT: !(flags & O_CREAT); assigns \result \from indirect:dirfd, indirect:filename[0..], indirect:flags; */ extern int __va_openat_void(int dirfd, const char *filename, int flags); /*@ requires valid_filename: valid_read_string(filename); assigns \result \from indirect:dirfd, indirect:filename[0..], indirect:flags, indirect:mode; */ extern int __va_openat_mode_t(int dirfd, const char *filename, int flags, mode_t mode); // The constants below are not in POSIX-1.2008, but are kept for compatibility #define O_NDELAY O_NONBLOCK #define O_FSYNC O_SYNC #define O_ASYNC 0x2000 /* For old implementation of bsd flock(). */ #define F_EXLCK 4 #define F_SHLCK 8 __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/features.h0000666000000000000000000001051413571573400015216 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_FEATURES_H #define __FC_FEATURES_H // *** Definitions to improve compatibility with GCC-specific built-ins // and GNU-based code *** #ifdef __FRAMAC__ #define __PUSH_FC_STDLIB #pragma fc_stdlib(push,__FILE__) #define __POP_FC_STDLIB #pragma fc_stdlib(pop) #else #define __PUSH_FC_STDLIB #define __POP_FC_STDLIB #endif #ifdef __clang__ # define __CLANG_IGNORE_ATTRS_PUSH__ \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") # define __CLANG_IGNORE_ATTRS_POP__ \ _Pragma("clang diagnostic pop") #else # define __CLANG_IGNORE_ATTRS_PUSH__ # define __CLANG_IGNORE_ATTRS_POP__ #endif #ifdef __cplusplus # define __BEGIN_DECLS \ extern "C" { \ __CLANG_IGNORE_ATTRS_PUSH__ # define __END_DECLS \ __CLANG_IGNORE_ATTRS_POP__ \ } #else # define __BEGIN_DECLS __CLANG_IGNORE_ATTRS_PUSH__ # define __END_DECLS __CLANG_IGNORE_ATTRS_POP__ #endif #undef __LEAF #define __LEAF #undef __LEAF_ATTR #define __LEAF_ATTR #undef __THROW #undef __THROWNL #undef __NTH #if defined __cplusplus # define __THROW throw () # define __THROWNL throw () # define __NTH(fct) fct throw () #else # define __THROW # define __THROWNL # define __NTH(fct) fct #endif // Frama-C does not support GCC's __builtin_object_size. // To improve compatibility with some codebases, // we define it anyway, but it always returns -1, as if // the compiler were unable to statically determine // the object size (we only consider the cases where type // is either 0 or 1). // Note that for some built-ins, we force them to our definition, // while others we leave unmodified if they exist #undef __builtin_object_size #define __builtin_object_size (ptr, type) ((size_t)-1) #undef __bos #define __bos(ptr) __builtin_object_size (ptr, 0) #undef __bos0 #define __bos0(ptr) __builtin_object_size (ptr, 0) #undef __warndecl #define __warndecl(name, msg) extern void name (void) #undef __warnattr #define __warnattr(msg) #undef __errordecl #define __errordecl(name, msg) extern void name (void) #undef __nonnull #define __nonnull(args...) #ifndef __attribute_deprecated__ # define __attribute_deprecated__ __attribute__((__deprecated__)) #endif #ifndef __attribute_format_arg__ # define __attribute_format_arg__(x) __attribute__((__format_arg__(x))) #endif #ifndef __attribute_const__ # define __attribute_const__ __attribute__((__const__)) #endif #ifndef __attribute_malloc__ # define __attribute_malloc__ __attribute__((__malloc__)) #endif #ifndef __attribute_artificial__ # define __attribute_artificial__ /* Ignore */ #endif #undef __attribute_warn_unused_result__ #define __attribute_warn_unused_result__ /* empty */ #ifndef __wur # define __wur /* Ignore */ #endif #define restrict __restrict #define __restrict__ __restrict #define __USE_ISOC99 1 /* end __FC_FEATURES_H */ #endif frama-c-20.0-Calcium/share/libc/fenv.c0000666000000000000000000000633113571573400014333 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.6 */ #include "fenv.h" __PUSH_FC_STDLIB /** Determines which of a specified subset of the floating-point exception flags * are currently set. * \param excepts Specifies the floating-point status flags to be queried. * \return The value of the bitwise OR of the floating-point exception macros * corresponding to the currently set floating-point exceptions included in * parameter excepts. */ int fetestexcept( int excepts ) { static volatile int __fc_random_fetestexcept __attribute__((FRAMA_C_MODEL)); /* random represent the FPU status word. */ return (0x00FF & __fc_random_fetestexcept); /* B, C3, TOSP, C2, C1, and C0 don't matter. Mask the selected bits. */ } volatile fenv_t __fc_fenv_state __attribute__((FRAMA_C_MODEL)); /** Saves the current floating-point environment in the object pointed to by * envp, clears the floating-point status flags, and then installs a non-stop * (continue on floating-point exceptions) mode for all floating-point * exceptions. * \return Always returns zero. */ int feholdexcept( fenv_t *envp ) { *envp = __fc_fenv_state; /* store the current FPU environment */ return 0; } /** Establishes the floating-point environment represented by the object pointed * to by envp. The argument envp shall point to a valid floating-point * environment object. * In principle, this function has the potential to trigger pending previous * exceptions: If envp contains a raised exception flag and at the same time * unmasks that exception type, then this will cause an interrupt. */ int fesetenv( const fenv_t *envp ) { __fc_fenv_state = *envp; return 0; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/fenv.h0000666000000000000000000001055613571573400014344 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.6 */ #ifndef __FC_FENV #define __FC_FENV #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS /* Define bits representing the exception. We use the bit positions of the appropriate bits in the FPU control word. */ enum __fc_fe_error { FE_INVALID = 0x01, #define FE_INVALID FE_INVALID __FE_DENORM = 0x02, FE_DIVBYZERO = 0x04, #define FE_DIVBYZERO FE_DIVBYZERO FE_OVERFLOW = 0x08, #define FE_OVERFLOW FE_OVERFLOW FE_UNDERFLOW = 0x10, #define FE_UNDERFLOW FE_UNDERFLOW FE_INEXACT = 0x20 #define FE_INEXACT FE_INEXACT }; #define FE_ALL_EXCEPT \ (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) /* Type representing floating-point environment. This structure corresponds to the layout of the block written by the `fstenv' instruction and has additional fields for the contents of the MXCSR register as written by the `stmxcsr' instruction. */ typedef struct __fc_fenv_t { unsigned short int __control_word; unsigned short int __unused1; unsigned short int __status_word; unsigned short int __unused2; unsigned short int __tags; unsigned short int __unused3; unsigned int __eip; unsigned short int __cs_selector; unsigned int __opcode:11; unsigned int __unused4:5; unsigned int __data_offset; unsigned short int __data_selector; unsigned short int __unused5; #ifdef __FC_MACHDEP_X86_64 /* only for x86_64 */ unsigned int __mxcsr; #endif } fenv_t; /** Determines which of a specified subset of the floating-point exception flags * are currently set. * \param excepts Specifies the floating-point status flags to be queried. * \return The value of the bitwise OR of the floating-point exception macros * corresponding to the currently set floating-point exceptions included in * parameter excepts. */ extern int fetestexcept( int excepts ); /** Saves the current floating-point environment in the object pointed to by * envp, clears the floating-point status flags, and then installs a non-stop * (continue on floating-point exceptions) mode for all floating-point * exceptions. * \return Always returns zero. */ extern int feholdexcept( fenv_t *envp ); /** Establishes the floating-point environment represented by the object pointed * to by envp. The argument envp shall point to a valid floating-point * environment object. * In principle, this function has the potential to trigger pending previous * exceptions: If envp contains a raised exception flag and at the same time * unmasks that exception type, then this will cause an interrupt. */ extern int fesetenv( const fenv_t *envp ); /** Clears the supported floating-point exceptions represented by argument. */ extern int feclearexcept( int excepts ); __END_DECLS __POP_FC_STDLIB #endif /* __FC_FENV */ frama-c-20.0-Calcium/share/libc/float.h0000666000000000000000000000614513571573400014512 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.7 */ #ifndef __FC_FLOAT #define __FC_FLOAT /* Note: Values for long double are only valid for x86 extended format. Some black magic will be needed if some other format (or none) is supposed to be provided. */ // *_TRUE_MIN and *_HAS_SUBNORM are C11 constants not present in POSIX-1.2008 #define FLT_RADIX 2 #define FLT_MANT_DIG 24 #define DBL_MANT_DIG 53 #define LDBL_MANT_DIG 64 #define FLT_DIG 6 #define DBL_DIG 15 #define LDBL_DIG 18 #define FLT_MIN_EXP -125 #define DBL_MIN_EXP -1021 #define LDBL_MIN_EXP -16381 #define FLT_MIN_10_EXP -37 #define DBL_MIN_10_EXP -307 #define LDBL_MIN_10_EXP -4931 #define FLT_MAX_EXP 128 #define DBL_MAX_EXP 1024 #define LDBL_MAX_EXP 16384 #define FLT_MAX_10_EXP 38 #define DBL_MAX_10_EXP 308 #define LDBL_MAX_10_EXP 4932 #define FLT_MAX 0x1.fffffep+127 #define DBL_MAX 0x1.fffffffffffffp+1023 #define LDBL_MAX 0x1.fffffffffffffffep+16383L #define FLT_EPSILON 0x1p-23 #define DBL_EPSILON 0x1p-52 #define LDBL_EPSILON 0x1p-63L #define FLT_HAS_SUBNORM 1 #define DBL_HAS_SUBNORM 1 #define LDBL_HAS_SUBNORM 1 #define FLT_MIN 0x1p-126 #define FLT_TRUE_MIN 0x1p-149 #define DBL_MIN 0x1p-1022 #define DBL_TRUE_MIN 0x1p-1074 #define LDBL_MIN 0x1p-16382L #define LDBL_TRUE_MIN 0x1p-16445L // By default, force IEEE evaluation, but leave // the possibility to work at a more abstract level #ifdef __FC_INDETERMINABLE_FLOATS #define FLT_ROUNDS -1 #define FLT_EVAL_METHOD -1 #else #define FLT_ROUNDS 1 #define FLT_EVAL_METHOD 0 #endif #endif frama-c-20.0-Calcium/share/libc/fnmatch.h0000666000000000000000000000376613571573400015033 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_FNMATCH #define __FC_FNMATCH #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS // The values for the constants below are based on those // of the glibc, declared in the order given by POSIX.1-2008. #define FNM_NOMATCH 1 #define FNM_PATHNAME (1 << 0) #define FNM_PERIOD (1 << 2) #define FNM_NOESCAPE (1 << 1) extern int fnmatch(const char *, const char *, int); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/ftw.h0000666000000000000000000000510013571573400014173 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_FTW #define __FC_FTW #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS struct FTW { int base; int level; }; enum __fc_ftw { FTW_F, #define FTW_F FTW_F FTW_D, #define FTW_D FTW_D FTW_DNR, #define FTW_DNR FTW_DNR FTW_DP, #define FTW_DP FTW_DP FTW_NS, #define FTW_NS FTW_NS FTW_SL, #define FTW_SL FTW_SL FTW_SLN, #define FTW_SLN FTW_SLN }; enum __fc_nftw { NFTW_PHYS, #define NFTW_PHYS NFTW_PHYS NFTW_MOUNT, #define NFTW_MOUNT NFTW_MOUNT NFTW_DEPTH, #define NFTW_DEPTH NFTW_DEPTH NFTW_CHDIR, #define NFTW_CHDIR NFTW_CHDIR }; // From POSIX 1.2008: "Inclusion of the header may also make visible // all symbols from ". #include "sys/stat.h" int ftw(const char *path, int (*fn)(const char *, const struct stat *ptr, int flag), int ndirs); int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, struct FTW *), int fd_limit, int flags); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/getopt.c0000666000000000000000000000323413571573400014676 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "getopt.h" __PUSH_FC_STDLIB int optind = 1; __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/getopt.h0000666000000000000000000000476213571573400014712 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_GETOPT_H #define __FC_GETOPT_H #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "unistd.h" /* GNU specific */ struct option { const char *name; int has_arg; int *flag; int val; }; # define no_argument 0 # define required_argument 1 # define optional_argument 2 /*@ assigns \result, *optarg, optind, opterr, optopt, *(longopts[0..].flag) \from argc, argv[0..argc-1], shortopts[0..], longopts[0..]; */ extern int getopt_long (int argc, char *const argv[], const char *shortopts, const struct option *longopts, int *longind); /*@ assigns \result, *optarg, optind, opterr, optopt, *(longopts[0..].flag) \from argc, argv[0..argc-1], shortopts[0..], longopts[0..]; */ extern int getopt_long_only (int argc, char *const argv[], const char *shortopts, const struct option *longopts, int *longind); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/glob.c0000666000000000000000000001026613571573400014322 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "glob.h" #include "stdlib.h" #include "__fc_builtin.h" __PUSH_FC_STDLIB int glob(const char *pattern, int flags, int (*errfunc) (const char *epath, int eerrno), glob_t *pglob) { // arbitrarily simulate finding a number of results between 0 and 10 pglob->gl_pathc = Frama_C_interval(0, 10); // reserve_offs is 0 unless GLOB_DOOFFS is set; it is the number of // offsets to skip size_t reserve_offs = flags & GLOB_DOOFFS ? pglob->gl_offs : 0; // prev_len is 0 unless GLOB_APPEND is set; it is the length // of the previous call to glob() size_t prev_len = 0; // count previous list size, used for new allocation if (flags & GLOB_APPEND) while (pglob->gl_pathv[reserve_offs+prev_len]) prev_len++; // path points to pglob->gl_pathv if GLOB_APPEND, or NULL otherwise char **path = flags & GLOB_APPEND ? pglob->gl_pathv : NULL; if (pglob->gl_pathc == 0) { // no results found if (flags & GLOB_NOCHECK) { // allocate 1 slot per reserved offset, + previous length, // +1 for the pattern itself (to be recopied), +1 for the terminator pglob->gl_pathv = realloc(path, (reserve_offs + prev_len + 2) * sizeof(char*)); if (!pglob->gl_pathv) return GLOB_NOSPACE; // 0-init reserved offsets for (size_t i = 0; i < reserve_offs; i++) pglob->gl_pathv[i] = 0; pglob->gl_pathv[reserve_offs + prev_len] = (char*)pattern; pglob->gl_pathv[reserve_offs + prev_len + 1] = 0; // terminator return 0; } else { return GLOB_NOMATCH; } } // found some results pglob->gl_pathv = // allocate 1 slot per reserved offset, + previous length, // +1 for each result, +1 for the terminator realloc(path, (reserve_offs + prev_len + pglob->gl_pathc + 1) * sizeof(char*)); if (!pglob->gl_pathv) return GLOB_NOSPACE; // 0-init reserved offsets for (size_t i = 0; i < reserve_offs; i++) pglob->gl_pathv[i] = 0; for (size_t i = 0; i < pglob->gl_pathc; i++) { pglob->gl_pathv[reserve_offs + prev_len + i] = "glob result"; } pglob->gl_pathv[prev_len + reserve_offs + pglob->gl_pathc] = 0; // terminator if (Frama_C_nondet(0, 1)) { // simulate "no error" return 0; } else { // simulate error during operation if (errfunc) { int res = errfunc("glob.c error path", Frama_C_interval(0, 255)); if (res || flags & GLOB_ERR) return GLOB_ABORTED; } return 0; } } void globfree(glob_t *pglob) { // check for gl_pathc, because: // "if gl_pathc is zero, the contents of gl_pathv are undefined" if (pglob->gl_pathc > 0) free(pglob->gl_pathv); } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/glob.h0000666000000000000000000000676613571573400014341 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_GLOB_H #define __FC_GLOB_H #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" #define GLOB_ERR (1 << 0)/* Return on read errors. */ #define GLOB_MARK (1 << 1)/* Append a slash to each name. */ #define GLOB_NOSORT (1 << 2)/* Don't sort the names. */ #define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */ #define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */ #define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */ #define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */ #define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */ #define GLOB_NOSPACE 1 /* Ran out of memory. */ #define GLOB_ABORTED 2 /* Read error. */ #define GLOB_NOMATCH 3 /* No matches found. */ #define GLOB_NOSYS 4 /* Not implemented. */ __BEGIN_DECLS typedef struct __fc_glob_t { __SIZE_T gl_pathc; /* Count of paths matched by the pattern. */ char **gl_pathv; /* List of matched pathnames. */ __SIZE_T gl_offs; /* Slots to reserve in `gl_pathv'. */ int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */ /* If the GLOB_ALTDIRFUNC flag is set, the following functions are used instead of the normal file access functions. */ void (*gl_closedir) (void *); #ifdef __USE_GNU struct dirent *(*gl_readdir) (void *); #else void *(*gl_readdir) (void *); #endif void *(*gl_opendir) (__const char *); #ifdef __USE_GNU int (*gl_lstat) (__const char *__restrict, struct stat *__restrict); int (*gl_stat) (__const char *__restrict, struct stat *__restrict); #else int (*gl_lstat) (__const char *__restrict, void *__restrict); int (*gl_stat) (__const char *__restrict, void *__restrict); #endif } glob_t; extern int glob(const char *pattern, int flags, int (*errfunc) (const char *epath, int eerrno), glob_t *pglob); extern void globfree(glob_t *pglob); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/grp.h0000666000000000000000000000441413571573400014172 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_GRP_H #define __FC_GRP_H #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_uid_and_gid.h" #include "__fc_define_size_t.h" __BEGIN_DECLS struct group { char *gr_name; gid_t gr_gid; char **gr_mem; }; extern struct group *getgrgid(gid_t); extern struct group *getgrnam(const char *); extern int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); extern int getgrnam_r(const char *, struct group *, char *, size_t , struct group **); extern struct group *getgrent(void); extern void endgrent(void); extern void setgrent(void); /* BSD function */ extern int initgroups (const char *user, gid_t group); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/iconv.h0000666000000000000000000000447213571573400014524 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_ICONV #define __FC_ICONV #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_size_t.h" __BEGIN_DECLS typedef void * iconv_t; extern int __fc_errno; /*@ assigns *outbuf[0 .. *outbytesleft-1] \from *inbuf[0 .. *inbytesleft-1]; assigns __fc_errno ; */ extern size_t iconv(iconv_t cd, char **restrict inbuf, size_t *restrict inbytesleft, char **restrict outbuf, size_t *restrict outbytesleft); /*@ assigns __fc_errno; ensures result_zero_or_neg: \result == 0 || \result == -1 ; */ extern int iconv_close(iconv_t); /*@ assigns \result \from tocode[..],fromcode[..]; assigns __fc_errno; */ extern iconv_t iconv_open(const char *tocode, const char *fromcode); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/ifaddrs.h0000666000000000000000000000503613571573400015017 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef FC_IFADDRS #define FC_IFADDRS #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_sockaddr.h" __BEGIN_DECLS /* Linux header */ struct ifaddrs { struct ifaddrs *ifa_next; char *ifa_name; unsigned int ifa_flags; struct sockaddr *ifa_addr; struct sockaddr *ifa_netmask; struct sockaddr *ifa_dstaddr; union __fc_ifaddrs_ifa_ifu { struct sockaddr *ifu_broadaddr; struct sockaddr *ifu_dstaddr; } ifa_ifu; # ifndef ifa_broadaddr # define ifa_broadaddr ifa_ifu.ifu_broadaddr # endif # ifndef ifa_dstaddr # define ifa_dstaddr ifa_ifu.ifu_dstaddr # endif void *ifa_data; }; struct ifmaddrs { struct ifmaddrs *ifma_next; struct sockaddr *ifma_name; struct sockaddr *ifma_addr; struct sockaddr *ifma_lladdr; }; extern int getifaddrs(struct ifaddrs **); extern void freeifaddrs(struct ifaddrs *); extern int getifmaddrs(struct ifmaddrs **); extern void freeifmaddrs(struct ifmaddrs *); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/inttypes.c0000666000000000000000000000352513571573400015256 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "inttypes.h" __PUSH_FC_STDLIB intmax_t imaxabs(intmax_t c) { if (c>0) return c; else return (-c); } imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom){ imaxdiv_t r; r.quot=numer/denom; r.rem=numer%denom; return r; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/inttypes.h0000666000000000000000000002245713571573400015270 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_INTTYPES #define __FC_INTTYPES #include "features.h" __PUSH_FC_STDLIB /* ISO C: 7.8 */ #include "__fc_machdep.h" #include "stdint.h" #include "errno.h" /* ISO C: 7.8.1 */ /* Macros for printing format specifiers. */ /* Decimal notation. */ # define PRId8 __PRI8_PREFIX "d" # define PRId16 __PRI16_PREFIX "d" # define PRId32 __PRI32_PREFIX "d" # define PRId64 __PRI64_PREFIX "d" # define PRIdLEAST8 __PRI8_PREFIX "d" # define PRIdLEAST16 __PRI16_PREFIX "d" # define PRIdLEAST32 __PRI32_PREFIX "d" # define PRIdLEAST64 __PRI64_PREFIX "d" # define PRIdFAST8 __PRI8_PREFIX "d" # define PRIdFAST16 __PRIFAST16_PREFIX "d" # define PRIdFAST32 __PRI32_PREFIX "d" # define PRIdFAST64 __PRI64_PREFIX "d" # define PRIi8 __PRI8_PREFIX "i" # define PRIi16 __PRI16_PREFIX "i" # define PRIi32 __PRI32_PREFIX "i" # define PRIi64 __PRI64_PREFIX "i" # define PRIiLEAST8 __PRI8_PREFIX "i" # define PRIiLEAST16 __PRI16_PREFIX "i" # define PRIiLEAST32 __PRI32_PREFIX "i" # define PRIiLEAST64 __PRI64_PREFIX "i" # define PRIiFAST8 __PRI8_PREFIX "i" # define PRIiFAST16 __PRIFAST16_PREFIX "i" # define PRIiFAST32 __PRI32_PREFIX "i" # define PRIiFAST64 __PRI64_PREFIX "i" /* Octal notation. */ # define PRIo8 __PRI8_PREFIX "o" # define PRIo16 __PRI16_PREFIX "o" # define PRIo32 __PRI32_PREFIX "o" # define PRIo64 __PRI64_PREFIX "o" # define PRIoLEAST8 __PRI8_PREFIX "o" # define PRIoLEAST16 __PRI16_PREFIX "o" # define PRIoLEAST32 __PRI32_PREFIX "o" # define PRIoLEAST64 __PRI64_PREFIX "o" # define PRIoFAST8 __PRI8_PREFIX "o" # define PRIoFAST16 __PRIFAST16_PREFIX "o" # define PRIoFAST32 __PRI32_PREFIX "o" # define PRIoFAST64 __PRI64_PREFIX "o" /* Unsigned integers. */ # define PRIu8 __PRI8_PREFIX "u" # define PRIu16 __PRI16_PREFIX "u" # define PRIu32 __PRI32_PREFIX "u" # define PRIu64 __PRI64_PREFIX "u" # define PRIuLEAST8 __PRI8_PREFIX "u" # define PRIuLEAST16 __PRI16_PREFIX "u" # define PRIuLEAST32 __PRI32_PREFIX "u" # define PRIuLEAST64 __PRI64_PREFIX "u" # define PRIuFAST8 __PRI8_PREFIX "u" # define PRIuFAST16 __PRIFAST16_PREFIX "u" # define PRIuFAST32 __PRI32_PREFIX "u" # define PRIuFAST64 __PRI64_PREFIX "u" /* lowercase hexadecimal notation. */ # define PRIx8 __PRI8_PREFIX "x" # define PRIx16 __PRI16_PREFIX "x" # define PRIx32 __PRI32_PREFIX "x" # define PRIx64 __PRI64_PREFIX "x" # define PRIxLEAST8 __PRI8_PREFIX "x" # define PRIxLEAST16 __PRI16_PREFIX "x" # define PRIxLEAST32 __PRI32_PREFIX "x" # define PRIxLEAST64 __PRI64_PREFIX "x" # define PRIxFAST8 __PRI8_PREFIX "x" # define PRIxFAST16 __PRIFAST16_PREFIX "x" # define PRIxFAST32 __PRI32_PREFIX "x" # define PRIxFAST64 __PRI64_PREFIX "x" /* UPPERCASE hexadecimal notation. */ # define PRIX8 __PRI8_PREFIX "X" # define PRIX16 __PRI16_PREFIX "X" # define PRIX32 __PRI32_PREFIX "X" # define PRIX64 __PRI64_PREFIX "X" # define PRIXLEAST8 __PRI8_PREFIX "X" # define PRIXLEAST16 __PRI16_PREFIX "X" # define PRIXLEAST32 __PRI32_PREFIX "X" # define PRIXLEAST64 __PRI64_PREFIX "X" # define PRIXFAST8 __PRI8_PREFIX "X" # define PRIXFAST16 __PRIFAST16_PREFIX "X" # define PRIXFAST32 __PRI32_PREFIX "X" # define PRIXFAST64 __PRI64_PREFIX "X" /* Macros for printing `intmax_t' and `uintmax_t'. */ # define PRIdMAX __PRIMAX_PREFIX "d" # define PRIiMAX __PRIMAX_PREFIX "i" # define PRIoMAX __PRIMAX_PREFIX "o" # define PRIuMAX __PRIMAX_PREFIX "u" # define PRIxMAX __PRIMAX_PREFIX "x" # define PRIXMAX __PRIMAX_PREFIX "X" /* Macros for printing `intptr_t' and `uintptr_t'. */ # define PRIdPTR __PRIPTR_PREFIX "d" # define PRIiPTR __PRIPTR_PREFIX "i" # define PRIoPTR __PRIPTR_PREFIX "o" # define PRIuPTR __PRIPTR_PREFIX "u" # define PRIxPTR __PRIPTR_PREFIX "x" # define PRIXPTR __PRIPTR_PREFIX "X" /* Macros for scanning format specifiers. */ /* Signed decimal notation. */ # define SCNd8 __PRI8_PREFIX "d" # define SCNd16 __PRI16_PREFIX "d" # define SCNd32 __PRI32_PREFIX "d" # define SCNd64 __PRI64_PREFIX "d" # define SCNdLEAST8 __PRI8_PREFIX "d" # define SCNdLEAST16 __PRI16_PREFIX "d" # define SCNdLEAST32 __PRI32_PREFIX "d" # define SCNdLEAST64 __PRI64_PREFIX "d" # define SCNdFAST8 __PRI8_PREFIX "d" # define SCNdFAST16 __PRIFAST16_PREFIX "d" # define SCNdFAST32 __PRI32_PREFIX "d" # define SCNdFAST64 __PRI64_PREFIX "d" /* Signed decimal notation. */ # define SCNi8 __PRI8_PREFIX "i" # define SCNi16 __PRI16_PREFIX "i" # define SCNi32 __PRI32_PREFIX "i" # define SCNi64 __PRI64_PREFIX "i" # define SCNiLEAST8 __PRI8_PREFIX "i" # define SCNiLEAST16 __PRI16_PREFIX "i" # define SCNiLEAST32 __PRI32_PREFIX "i" # define SCNiLEAST64 __PRI64_PREFIX "i" # define SCNiFAST8 __PRI8_PREFIX "i" # define SCNiFAST16 __PRIFAST16_PREFIX "i" # define SCNiFAST32 __PRI32_PREFIX "i" # define SCNiFAST64 __PRI64_PREFIX "i" /* Unsigned decimal notation. */ # define SCNu8 __PRI8_PREFIX "u" # define SCNu16 __PRI16_PREFIX "u" # define SCNu32 __PRI32_PREFIX "u" # define SCNu64 __PRI64_PREFIX "u" # define SCNuLEAST8 __PRI8_PREFIX "u" # define SCNuLEAST16 __PRI16_PREFIX "u" # define SCNuLEAST32 __PRI32_PREFIX "u" # define SCNuLEAST64 __PRI64_PREFIX "u" # define SCNuFAST8 __PRI8_PREFIX "u" # define SCNuFAST16 __PRIFAST16_PREFIX "u" # define SCNuFAST32 __PRI32_PREFIX "u" # define SCNuFAST64 __PRI64_PREFIX "u" /* Octal notation. */ # define SCNo8 __PRI8_PREFIX "o" # define SCNo16 __PRI16_PREFIX "o" # define SCNo32 __PRI32_PREFIX "o" # define SCNo64 __PRI64_PREFIX "o" # define SCNoLEAST8 __PRI8_PREFIX "o" # define SCNoLEAST16 __PRI16_PREFIX "o" # define SCNoLEAST32 __PRI32_PREFIX "o" # define SCNoLEAST64 __PRI64_PREFIX "o" # define SCNoFAST8 __PRI8_PREFIX "o" # define SCNoFAST16 __PRIFAST16_PREFIX "o" # define SCNoFAST32 __PRI32_PREFIX "o" # define SCNoFAST64 __PRI64_PREFIX "o" /* Hexadecimal notation. */ # define SCNx8 __PRI8_PREFIX "x" # define SCNx16 __PRI16_PREFIX "x" # define SCNx32 __PRI32_PREFIX "x" # define SCNx64 __PRI64_PREFIX "x" # define SCNxLEAST8 __PRI8_PREFIX "x" # define SCNxLEAST16 __PRI16_PREFIX "x" # define SCNxLEAST32 __PRI32_PREFIX "x" # define SCNxLEAST64 __PRI64_PREFIX "x" # define SCNxFAST8 __PRI8_PREFIX "x" # define SCNxFAST16 __PRIFAST16_PREFIX "x" # define SCNxFAST32 __PRI32_PREFIX "x" # define SCNxFAST64 __PRI64_PREFIX "x" /* Macros for scanning `intmax_t' and `uintmax_t'. */ # define SCNdMAX __PRIMAX_PREFIX "d" # define SCNiMAX __PRIMAX_PREFIX "i" # define SCNoMAX __PRIMAX_PREFIX "o" # define SCNuMAX __PRIMAX_PREFIX "u" # define SCNxMAX __PRIMAX_PREFIX "x" /* Macros for scaning `intptr_t' and `uintptr_t'. */ # define SCNdPTR __PRIPTR_PREFIX "d" # define SCNiPTR __PRIPTR_PREFIX "i" # define SCNoPTR __PRIPTR_PREFIX "o" # define SCNuPTR __PRIPTR_PREFIX "u" # define SCNxPTR __PRIPTR_PREFIX "x" __BEGIN_DECLS typedef struct __fc_imaxdiv_t { intmax_t quot; /* Quotient. */ intmax_t rem; /* Remainder. */ } imaxdiv_t; /* ISO C: 7.8.2 */ /*@ requires abs_representable: (intmax_t)(-c) != c ; assigns \result \from c ; */ extern intmax_t imaxabs(intmax_t c); /*@ requires no_div_by_zero: denom != 0; requires no_overflow: denom != -1 || (intmax_t)(-numer) != numer; assigns \result \from numer, denom ; ensures correct_div: \result.quot == numer / denom; ensures correct_mod: \result.rem == numer % denom; */ extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); #include "__fc_define_wchar_t.h" /*@ assigns \result \from nptr[..], base ; assigns endptr[..] \from nptr[..], base ; assigns __fc_errno \from nptr[..], base ; */ extern intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base); extern uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base); extern intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); extern uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/iso646.h0000666000000000000000000000353113571573400014433 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_ISO646 #define __FC_ISO646 /* ISO C: 7.9 */ #define and && #define and_eq &= #define bitand & #define bitor | #define compl ~ #define not ! #define not_eq != #define or || #define or_eq |= #define xor ^ #define xor_eq ^= #endif frama-c-20.0-Calcium/share/libc/libgen.h0000666000000000000000000000540413571573400014642 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_LIBGEN_H #define __FC_LIBGEN_H #include "features.h" #include "__fc_machdep.h" #include "__fc_string_axiomatic.h" __PUSH_FC_STDLIB __BEGIN_DECLS extern char __fc_basename[__FC_PATH_MAX]; char *__fc_p_basename = __fc_basename; /*@ // missing: assigns path[0 ..], __fc_p_basename[0 ..] \from 'filesystem'; requires null_or_valid_string_path: path == \null || valid_read_string(path); assigns path[0 ..], __fc_basename[0 ..] \from path[0 ..], __fc_basename[0 ..]; assigns \result \from __fc_p_basename, path; ensures result_points_to_internal_storage_or_path: \subset(\result, {__fc_p_basename, path}); */ extern char *basename(char *path); extern char __fc_dirname[__FC_PATH_MAX]; char *__fc_p_dirname = __fc_dirname; /*@ // missing: assigns path[0 ..], __fc_p_dirname[0 ..] \from 'filesystem'; requires null_or_valid_string_path: path == \null || valid_read_string(path); assigns path[0 ..], __fc_dirname[0 ..] \from path[0 ..], __fc_dirname[0 ..]; assigns \result \from __fc_p_dirname, path; ensures result_points_to_internal_storage_or_path: \subset(\result, {__fc_p_dirname, path}); */ extern char *dirname(char *path); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/limits.h0000666000000000000000000000756313571573400014713 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.10 and 5.2.4.2.1 */ #ifndef __FC_LIMITS #define __FC_LIMITS #include "__fc_machdep.h" /* Number of bits in a `char'. */ #define CHAR_BIT __CHAR_BIT /* Minimum and maximum values a `signed char' can hold. */ # define SCHAR_MIN __FC_SCHAR_MIN # define SCHAR_MAX __FC_SCHAR_MAX /* Maximum value an `unsigned char' can hold. (Minimum is 0.) */ # define UCHAR_MAX __FC_UCHAR_MAX /* Minimum and maximum values a `char' can hold. */ # ifdef __CHAR_UNSIGNED__ # define CHAR_MIN 0 # define CHAR_MAX UCHAR_MAX # else # define CHAR_MIN SCHAR_MIN # define CHAR_MAX SCHAR_MAX # endif #define MB_LEN_MAX 16 /* Minimum and maximum values a `signed short int' can hold. */ # define SHRT_MIN __FC_SHRT_MIN # define SHRT_MAX __FC_SHRT_MAX /* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */ # define USHRT_MAX __FC_USHRT_MAX /* Minimum and maximum values a `signed int' can hold. */ # define INT_MIN __FC_INT_MIN # define INT_MAX __FC_INT_MAX /* Maximum value an `unsigned int' can hold. (Minimum is 0.) */ # define UINT_MAX __FC_UINT_MAX /* Minimum and maximum values a `signed long int' can hold. */ # define LONG_MAX __FC_LONG_MAX # define LONG_MIN __FC_LONG_MIN /* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */ #define ULONG_MAX __FC_ULONG_MAX /* Minimum and maximum values a `signed long long int' can hold. */ # define LLONG_MAX __FC_LLONG_MAX # define LLONG_MIN __FC_LLONG_MIN /* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */ # define ULLONG_MAX __FC_ULLONG_MAX /* Maximum number of bytes in a pathname, including the terminating null character. (Minimum is 256.) */ #define PATH_MAX __FC_PATH_MAX /* Maximum length of a host name (not including the terminating null) as returned from the gethostname() function. Note: Mac OS does not define this constant. */ #define HOST_NAME_MAX __FC_HOST_NAME_MAX /* Maximum length of a terminal device name. */ #define TTY_NAME_MAX __FC_TTY_NAME_MAX /* Maximum length of argument to the exec functions including environment data. Minimum Acceptable Value: {_POSIX_ARG_MAX} (4096 in POSIX.1-2008) "... the total space used to store the environment and the arguments to the process is limited to {ARG_MAX} bytes." */ #define ARG_MAX 4096 #endif frama-c-20.0-Calcium/share/libc/locale.c0000666000000000000000000000423713571573400014637 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "locale.h" #include "limits.h" __PUSH_FC_STDLIB struct lconv __C_locale = {".","","","","","","","","","",CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX,CHAR_MAX}; struct lconv *__frama_c_locale=&__C_locale; char*__frama_c_locale_names[512]={"C"}; char *setlocale(int category, const char *locale) { if (*locale == 'C') { __frama_c_locale = &__C_locale; return __frama_c_locale_names[0]; }; return NULL; } struct lconv *localeconv(void) { return __frama_c_locale; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/locale.h0000666000000000000000000001555313571573400014647 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_LOCALE #define __FC_LOCALE #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS /* Structure giving information about numeric and monetary notation. */ struct lconv { /* Numeric (non-monetary) information. */ char *decimal_point; /* Decimal point character. */ char *thousands_sep; /* Thousands separator. */ /* Each element is the number of digits in each group; elements with higher indices are farther left. An element with value CHAR_MAX means that no further grouping is done. An element with value 0 means that the previous element is used for all groups farther left. */ char *grouping; /* Monetary information. */ /* First three chars are a currency symbol from ISO 4217. Fourth char is the separator. Fifth char is '\0'. */ char *int_curr_symbol; char *currency_symbol; /* Local currency symbol. */ char *mon_decimal_point; /* Decimal point character. */ char *mon_thousands_sep; /* Thousands separator. */ char *mon_grouping; /* Like `grouping' element (above). */ char *positive_sign; /* Sign for positive values. */ char *negative_sign; /* Sign for negative values. */ char int_frac_digits; /* Int'l fractional digits. */ char frac_digits; /* Local fractional digits. */ /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */ char p_cs_precedes; /* 1 iff a space separates currency_symbol from a positive value. */ char p_sep_by_space; /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */ char n_cs_precedes; /* 1 iff a space separates currency_symbol from a negative value. */ char n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and currency_symbol. 1 The sign string precedes the quantity and currency_symbol. 2 The sign string follows the quantity and currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately follows the currency_symbol. */ char p_sign_posn; char n_sign_posn; /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */ char int_p_cs_precedes; /* 1 iff a space separates int_curr_symbol from a positive value. */ char int_p_sep_by_space; /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */ char int_n_cs_precedes; /* 1 iff a space separates int_curr_symbol from a negative value. */ char int_n_sep_by_space; /* Positive and negative sign positions: 0 Parentheses surround the quantity and int_curr_symbol. 1 The sign string precedes the quantity and int_curr_symbol. 2 The sign string follows the quantity and int_curr_symbol. 3 The sign string immediately precedes the int_curr_symbol. 4 The sign string immediately follows the int_curr_symbol. */ char int_p_sign_posn; char int_n_sign_posn; }; #include "__fc_define_null.h" #include "__fc_string_axiomatic.h" #define LC_CTYPE 0 #define LC_NUMERIC 1 #define LC_TIME 2 #define LC_COLLATE 3 #define LC_MONETARY 4 #define LC_MESSAGES 5 #define LC_ALL 6 #define LC_PAPER 7 #define LC_NAME 8 #define LC_ADDRESS 9 #define LC_TELEPHONE 10 #define LC_MEASUREMENT 11 #define LC_IDENTIFICATION 12 # define LC_CTYPE_MASK (1 << LC_CTYPE) # define LC_NUMERIC_MASK (1 << LC_NUMERIC) # define LC_TIME_MASK (1 << LC_TIME) # define LC_COLLATE_MASK (1 << LC_COLLATE) # define LC_MONETARY_MASK (1 << LC_MONETARY) # define LC_MESSAGES_MASK (1 << LC_MESSAGES) # define LC_PAPER_MASK (1 << LC_PAPER) # define LC_NAME_MASK (1 << LC_NAME) # define LC_ADDRESS_MASK (1 << LC_ADDRESS) # define LC_TELEPHONE_MASK (1 << LC_TELEPHONE) # define LC_MEASUREMENT_MASK (1 << LC_MEASUREMENT) # define LC_IDENTIFICATION_MASK (1 << LC_IDENTIFICATION) # define LC_ALL_MASK (LC_CTYPE_MASK \ | LC_NUMERIC_MASK \ | LC_TIME_MASK \ | LC_COLLATE_MASK \ | LC_MONETARY_MASK \ | LC_MESSAGES_MASK \ | LC_PAPER_MASK \ | LC_NAME_MASK \ | LC_ADDRESS_MASK \ | LC_TELEPHONE_MASK \ | LC_MEASUREMENT_MASK \ | LC_IDENTIFICATION_MASK \ ) extern struct lconv* __fc_locale; extern char*__fc_locale_names[512]; /*@ requires locale_null_or_valid_string: locale == \null || valid_read_string(locale); assigns __fc_locale \from category, locale[..]; assigns \result \from __fc_locale,category, locale[..]; ensures result_null_or_locale_name: \result==\null || (\valid(\result) && \exists ℤ i ; \result == __fc_locale_names[i]) ; */ extern char *setlocale(int category, const char *locale); /*@ assigns \nothing; ensures result_current_locale: \result == __fc_locale; */ extern struct lconv *localeconv(void); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/malloc.h0000666000000000000000000000326513571573400014654 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ // This file is not in the C standard; it exists for compatibility purposes #include "stdlib.h" frama-c-20.0-Calcium/share/libc/math.c0000666000000000000000000000515013571573400014324 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.12 */ #include "math.h" __PUSH_FC_STDLIB double fabs(double x){ if(x==0.0) return 0.0; if (x>0.0) return x; return -x; } float fabsf(float x) { if (x == 0.0f) { return 0.0f; } else if (x > 0.0f) { return x; } else { return -x; } } int __finitef(float f) { union __fc_u_finitef { float f ; unsigned short w[2] ; } u ; unsigned short usExp ; u.f = f ; /* Initilize for word access */ usExp = (u.w[1] & 0x7F80) ; /* Isolate the exponent */ usExp >>= 7 ; /* Right align */ /* A floating point value is invalid, if the exponent is 0xff */ return !(usExp == 0xff) ; } int __finite(double d) { union __fc_u_finite { double d ; unsigned short w[4] ; } u ; unsigned short usExp ; u.d = d ; /* Initilize for word access */ usExp = (u.w[3] & 0x7F80) ; /* Isolate the exponent */ usExp >>= 7 ; /* Right align */ /* A floating point value is invalid, if the exponent is 0xff */ return !(usExp == 0xff) ; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/math.h0000666000000000000000000005764513571573400014351 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.12 */ #ifndef __FC_MATH #define __FC_MATH #include "features.h" __PUSH_FC_STDLIB #include "__fc_string_axiomatic.h" #include "errno.h" __BEGIN_DECLS typedef float float_t; typedef double double_t; #define MATH_ERRNO 1 #define MATH_ERREXCEPT 2 /* The constants below are not part of C99/C11 but they are defined in POSIX */ #define M_E 0x1.5bf0a8b145769p1 /* e */ #define M_LOG2E 0x1.71547652b82fep0 /* log_2 e */ #define M_LOG10E 0x1.bcb7b1526e50ep-2 /* log_10 e */ #define M_LN2 0x1.62e42fefa39efp-1 /* log_e 2 */ #define M_LN10 0x1.26bb1bbb55516p1 /* log_e 10 */ #define M_PI 0x1.921fb54442d18p1 /* pi */ #define M_PI_2 0x1.921fb54442d18p0 /* pi/2 */ #define M_PI_4 0x1.921fb54442d18p-1 /* pi/4 */ #define M_1_PI 0x1.45f306dc9c883p-2 /* 1/pi */ #define M_2_PI 0x1.45f306dc9c883p-1 /* 2/pi */ #define M_2_SQRTPI 0x1.20dd750429b6dp0 /* 2/sqrt(pi) */ #define M_SQRT2 0x1.6a09e667f3bcdp0 /* sqrt(2) */ #define M_SQRT1_2 0x1.6a09e667f3bcdp-1 /* 1/sqrt(2) */ /* The following specifications will set errno. */ #define math_errhandling MATH_ERRNO #define FP_NAN 0 #define FP_INFINITE 1 #define FP_ZERO 2 #define FP_SUBNORMAL 3 #define FP_NORMAL 4 #include "float.h" // for DBL_MIN and FLT_MIN /*@ assigns \result \from x; behavior nan: assumes is_nan: \is_NaN(x); ensures fp_nan: \result == FP_NAN; behavior inf: assumes is_infinite: !\is_NaN(x) && !\is_finite(x); ensures fp_infinite: \result == FP_INFINITE; behavior zero: assumes is_a_zero: x == 0.0; // also includes -0.0 ensures fp_zero: \result == FP_ZERO; behavior subnormal: assumes is_finite: \is_finite(x); assumes is_subnormal: (x > 0.0 && x < FLT_MIN) || (x < 0.0 && x > -FLT_MIN); ensures fp_subnormal: \result == FP_SUBNORMAL; behavior normal: assumes is_finite: \is_finite(x); assumes not_subnormal: (x <= -FLT_MIN || x >= FLT_MIN); ensures fp_normal: \result == FP_NORMAL; complete behaviors; disjoint behaviors; */ int __fc_fpclassifyf(float x); /*@ assigns \result \from x; behavior nan: assumes is_nan: \is_NaN(x); ensures fp_nan: \result == FP_NAN; behavior inf: assumes is_infinite: !\is_NaN(x) && !\is_finite(x); ensures fp_infinite: \result == FP_INFINITE; behavior zero: assumes is_a_zero: x == 0.0; // also includes -0.0 ensures fp_zero: \result == FP_ZERO; behavior subnormal: assumes is_finite: \is_finite(x); assumes is_subnormal: (x > 0.0 && x < DBL_MIN) || (x < 0.0 && x > -DBL_MIN); ensures fp_subnormal: \result == FP_SUBNORMAL; behavior normal: assumes is_finite: \is_finite(x); assumes not_subnormal: (x <= -DBL_MIN || x >= DBL_MIN); ensures fp_normal: \result == FP_NORMAL; complete behaviors; disjoint behaviors; */ int __fc_fpclassify(double x); // Incorrect in presence of long double with >64 bits #define fpclassify(x) \ (sizeof(x) == sizeof(float) ? __fc_fpclassifyf(x) : __fc_fpclassify(x)) #define isinf(x) \ (sizeof(x) == sizeof(float) ? __fc_fpclassifyf(x) == FP_INFINITE : __fc_fpclassify(x) == FP_INFINITE) #define isnan(x) \ (sizeof(x) == sizeof(float) ? __fc_fpclassifyf(x) == FP_NAN : __fc_fpclassify(x) == FP_NAN) #define isnormal(x) \ (sizeof(x) == sizeof(float) ? __fc_fpclassifyf(x) == FP_NORMAL : __fc_fpclassify(x) == FP_NORMAL) /*@ assigns __fc_errno, \result \from x; behavior normal: assumes in_domain: \is_finite(x) && \abs(x) <= 1; assigns \result \from x; ensures positive_result: \is_finite(\result) && \result >= 0; behavior domain_error: assumes out_of_domain: \is_infinite(x) || (\is_finite(x) && \abs(x) > 1); assigns __fc_errno, \result \from x; ensures errno_set: __fc_errno == 1; disjoint behaviors; */ extern double acos(double x); /*@ assigns __fc_errno, \result \from x; behavior normal: assumes in_domain: \is_finite(x) && \abs(x) <= 1; assigns \result \from x; ensures positive_result: \is_finite(\result) && \result >= 0; behavior domain_error: assumes out_of_domain: \is_infinite(x) || (\is_finite(x) && \abs(x) > 1); assigns __fc_errno, \result \from x; ensures errno_set: __fc_errno == 1; disjoint behaviors; */ extern float acosf(float x); /*@ assigns __fc_errno, \result \from x; behavior normal: assumes in_domain: \is_finite(x) && \abs(x) <= 1; assigns \result \from x; ensures positive_result: \is_finite(\result) && \result >= 0; behavior domain_error: assumes out_of_domain: \is_infinite(x) || (\is_finite(x) && \abs(x) > 1); assigns __fc_errno, \result \from x; ensures errno_set: __fc_errno == 1; disjoint behaviors; */ extern long double acosl(long double x); /*@ assigns __fc_errno, \result \from x; behavior normal: assumes in_domain: \is_finite(x) && \abs(x) <= 1; assigns \result \from x; ensures finite_result: \is_finite(\result); behavior domain_error: assumes out_of_domain: \is_infinite(x) || (\is_finite(x) && \abs(x) > 1); assigns __fc_errno, \result \from x; ensures errno_set: __fc_errno == 1; disjoint behaviors; */ extern double asin(double x); /*@ assigns __fc_errno, \result \from x; behavior normal: assumes in_domain: \is_finite(x) && \abs(x) <= 1; assigns \result \from x; ensures finite_result: \is_finite(\result); behavior domain_error: assumes out_of_domain: \is_infinite(x) || (\is_finite(x) && \abs(x) > 1); assigns __fc_errno, \result \from x; ensures errno_set: __fc_errno == 1; disjoint behaviors; */ extern float asinf(float x); /*@ assigns __fc_errno, \result \from x; behavior normal: assumes in_domain: \is_finite(x) && \abs(x) <= 1; assigns \result \from x; ensures finite_result: \is_finite(\result); behavior domain_error: assumes out_of_domain: \is_infinite(x) || (\is_finite(x) && \abs(x) > 1); assigns __fc_errno, \result \from x; ensures errno_set: __fc_errno == 1; disjoint behaviors; */ extern long double asinl(long double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); ensures result_domain: -1.571 <= \result <= 1.571; */ extern float atanf(float x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); ensures result_domain: -1.571 <= \result <= 1.571; */ extern double atan(double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); ensures result_domain: -1.571 <= \result <= 1.571; */ extern long double atanl(long double x); /*@ requires finite_args: \is_finite(x) && \is_finite(y); requires finite_result: \is_finite(atan2(x, y)); assigns \result \from x, y; ensures finite_result: \is_finite(\result); */ extern double atan2(double y, double x); /*@ requires finite_args: \is_finite(x) && \is_finite(y); requires finite_logic_result: \is_finite(atan2f(x, y)); assigns \result \from x, y; ensures finite_result: \is_finite(\result); */ extern float atan2f(float y, float x); extern long double atan2l(long double y, long double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); ensures result_domain: -1. <= \result <= 1.; */ extern double cos(double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); ensures result_domain: -1. <= \result <= 1.; */ extern float cosf(float x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); ensures result_domain: -1. <= \result <= 1.; */ extern long double cosl(long double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); ensures result_domain: -1. <= \result <= 1.; */ extern double sin(double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); ensures result_domain: -1. <= \result <= 1.; */ extern float sinf(float x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); ensures result_domain: -1. <= \result <= 1.; */ extern long double sinl(long double x); extern double tan(double x); extern float tanf(float x); extern long double tanl(long double x); /*@ assigns __fc_errno, \result \from x; behavior normal: assumes in_domain: \is_finite(x) && x >= 1; assigns \result \from x; ensures positive_result: \is_finite(\result) && \result >= 0; behavior infinite: assumes is_plus_infinity: \is_plus_infinity(x); assigns \result \from x; ensures result_plus_infinity: \is_plus_infinity(\result); behavior domain_error: assumes out_of_domain: \is_minus_infinity(x) || (\is_finite(x) && x < 1); assigns __fc_errno, \result \from x; ensures errno_set: __fc_errno == 1; disjoint behaviors; */ extern double acosh(double x); /*@ assigns __fc_errno, \result \from x; behavior normal: assumes in_domain: \is_finite(x) && x >= 1; assigns \result \from x; ensures positive_result: \is_finite(\result) && \result >= 0; behavior infinite: assumes is_plus_infinity: \is_plus_infinity(x); assigns \result \from x; ensures result_plus_infinity: \is_plus_infinity(\result); behavior domain_error: assumes out_of_domain: \is_minus_infinity(x) || (\is_finite(x) && x < 1); assigns __fc_errno, \result \from x; ensures errno_set: __fc_errno == 1; disjoint behaviors; */ extern float acoshf(float x); /*@ assigns __fc_errno, \result \from x; behavior normal: assumes in_domain: \is_finite(x) && x >= 1; assigns \result \from x; ensures positive_result: \is_finite(\result) && \result >= 0; behavior infinite: assumes is_plus_infinity: \is_plus_infinity(x); assigns \result \from x; ensures result_plus_infinity: \is_plus_infinity(\result); behavior domain_error: assumes out_of_domain: \is_minus_infinity(x) || (\is_finite(x) && x < 1); assigns __fc_errno, \result \from x; ensures errno_set: __fc_errno == 1; disjoint behaviors; */ extern long double acoshl(long double x); extern double asinh(double x); extern float asinhf(float x); extern long double asinhl(long double x); extern double atanh(double x); extern float atanhf(float x); extern long double atanhl(long double x); extern double cosh(double x); extern float coshf(float x); extern long double coshl(long double x); extern double sinh(double x); extern float sinhf(float x); extern long double sinhl(long double x); extern double tanh(double x); extern float tanhf(float x); extern long double tanhl(long double x); /*@ requires finite_arg: \is_finite(x); requires finite_domain: x <= 0x1.62e42fefa39efp+9; assigns \result \from x; ensures res_finite: \is_finite(\result); ensures positive_result: \result > 0.; */ extern double exp(double x); /*@ requires finite_arg: \is_finite(x); requires res_finite: x <= 0x1.62e42ep+6; assigns \result \from x; ensures res_finite: \is_finite(\result); ensures positive_result: \result > 0.; */ extern float expf(float x); extern long double expl(long double x); extern double exp2(double x); extern float exp2f(float x); extern long double exp2l(long double x); extern double expm1(double x); extern float expm1f(float x); extern long double expm1l(long double x); extern double frexp(double value, int *exp); extern float frexpf(float value, int *exp); extern long double frexpl(long double value, int *exp); extern int ilogb(double x); extern int ilogbf(float x); extern int ilogbl(long double x); extern double ldexp(double x, int exp); extern float ldexpf(float x, int exp); extern long double ldexpl(long double x, int exp); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern double log(double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern float logf(float x); /*@ requires finite_arg: \is_finite(x); requires arg_pos: x > 0; assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern long double logl(long double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern double log10(double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern float log10f(float x); /*@ requires finite_arg: \is_finite(x); requires arg_postive: x > 0; assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern long double log10l(long double x); extern double log1p(double x); extern float log1pf(float x); extern long double log1pl(long double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern double log2(double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern float log2f(float x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern long double log2l(long double x); extern double logb(double x); extern float logbf(float x); extern long double logbl(long double x); extern double modf(double value, double *iptr); extern float modff(float value, float *iptr); extern long double modfl(long double value, long double *iptr); extern double scalbn(double x, int n); extern float scalbnf(float x, int n); extern long double scalbnl(long double x, int n); extern double scalbln(double x, long int n); extern float scalblnf(float x, long int n); extern long double scalblnl(long double x, long int n); extern double cbrt(double x); extern float cbrtf(float x); extern long double cbrtl(long double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures res_finite: \is_finite(\result); ensures positive_result: \result >= 0.; ensures equal_magnitude_result: \result == x || \result == -x; */ extern double fabs(double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures res_finite: \is_finite(\result); ensures positive_result: \result >= 0.; ensures equal_magnitude_result: \result == x || \result == -x; */ extern float fabsf(float x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures res_finite: \is_finite(\result); ensures positive_result: \result >= 0.; ensures equal_magnitude_result: \result == x || \result == -x; */ extern long double fabsl(long double x); extern double hypot(double x, double y); extern float hypotf(float x, float y); extern long double hypotl(long double x, long double y); /*@ requires finite_args: \is_finite(x) && \is_finite(y); requires finite_logic_res: \is_finite(pow(x, y)); assigns \result \from x, y; ensures finite_result: \is_finite(\result); */ extern double pow(double x, double y); /*@ requires finite_args: \is_finite(x) && \is_finite(y); requires finite_logic_res: \is_finite(powf(x, y)); assigns \result \from x, y; ensures finite_result: \is_finite(\result); */ extern float powf(float x, float y); extern long double powl(long double x, long double y); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x >= -0.; assigns \result \from x; ensures finite_result: \is_finite(\result); ensures positive_result: \result >= -0.; */ extern double sqrt(double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x >= -0.; assigns \result \from x; ensures finite_result: \is_finite(\result); ensures positive_result: \result >= -0.; */ extern float sqrtf(float x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x >= -0.; assigns \result \from x; ensures finite_result: \is_finite(\result); ensures positive_result: \result >= -0.; */ extern long double sqrtl(long double x); extern double erf(double x); extern float erff(float x); extern long double erfl(long double x); extern double erfc(double x); extern float erfcf(float x); extern long double erfcl(long double x); extern double lgamma(double x); extern float lgammaf(float x); extern long double lgammal(long double x); extern double tgamma(double x); extern float tgammaf(float x); extern long double tgammal(long double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern double ceil(double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern float ceilf(float x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern long double ceill(long double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern double floor(double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern float floorf(float x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern long double floorl(long double x); extern double nearbyint(double x); extern float nearbyintf(float x); extern long double nearbyintl(long double x); extern double rint(double x); extern float rintf(float x); extern long double rintl(long double x); extern long int lrint(double x); extern long int lrintf(float x); extern long int lrintl(long double x); extern long long int llrint(double x); extern long long int llrintf(float x); extern long long int llrintl(long double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern double round(double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern float roundf(float x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern long double roundl(long double x); extern long int lround(double x); extern long int lroundf(float x); extern long int lroundl(long double x); extern long long int llround(double x); extern long long int llroundf(float x); extern long long int llroundl(long double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern double trunc(double x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern float truncf(float x); /*@ requires finite_arg: \is_finite(x); assigns \result \from x; ensures finite_result: \is_finite(\result); */ extern long double truncl(long double x); /*@ requires finite_args: \is_finite(x) && \is_finite(y); requires finite_logic_result: \is_finite(fmod(x, y)); assigns \result \from x, y; ensures finite_result: \is_finite(\result); */ extern double fmod(double x, double y); /*@ requires finite_args: \is_finite(x) && \is_finite(y); requires finite_logic_result: \is_finite(fmodf(x, y)); assigns \result \from x, y; ensures finite_result: \is_finite(\result); */ extern float fmodf(float x, float y); extern long double fmodl(long double x, long double y); extern double remainder(double x, double y); extern float remainderf(float x, float y); extern long double remainderl(long double x, long double y); extern double remquo(double x, double y, int *quo); extern float remquof(float x, float y, int *quo); extern long double remquol(long double x, long double y, int *quo); extern double copysign(double x, double y); extern float copysignf(float x, float y); extern long double copysignl(long double x, long double y); /*@ requires tagp_valid_string: valid_read_string(tagp); assigns \result \from indirect:tagp[0..]; ensures result_is_nan: \is_NaN(\result); */ extern double nan(const char *tagp); /*@ requires tagp_valid_string: valid_read_string(tagp); assigns \result \from indirect:tagp[0..]; ensures result_is_nan: \is_NaN(\result); */ extern float nanf(const char *tagp); /*@ requires tagp_valid_string: valid_read_string(tagp); assigns \result \from indirect:tagp[0..]; ensures result_is_nan: \is_NaN(\result); */ extern long double nanl(const char *tagp); extern double nextafter(double x, double y); extern float nextafterf(float x, float y); extern long double nextafterl(long double x, long double y); extern double nexttoward(double x, long double y); extern float nexttowardf(float x, long double y); extern long double nexttowardl(long double x, long double y); extern double fdim(double x, double y); extern float fdimf(float x, float y); extern long double fdiml(long double x, long double y); extern double fmax(double x, double y); extern float fmaxf(float x, float y); extern long double fmaxl(long double x, long double y); extern double fmin(double x, double y); extern float fminf(float x, float y); extern long double fminl(long double x, long double y); extern double fma(double x, double y, double z); extern float fmaf(float x, float y, float z); extern long double fmal(long double x, long double y, long double z); extern int __finitef(float f); extern int __finite(double d); # define isfinite(x) \ (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x)) //The (integer x) argument is just here because a function without argument is //applied differently in ACSL and C /*@ logic float __fc_infinity(integer x) = \plus_infinity; logic float __fc_nan(integer x) = \NaN; @*/ /*@ ensures result_is_infinity: \is_plus_infinity(\result); assigns \result \from \nothing; @*/ extern const float __fc_infinity(int x); /*@ ensures result_is_nan: \is_NaN(\result); assigns \result \from \nothing; @*/ extern const float __fc_nan(int x); #define INFINITY __fc_infinity(0) #define NAN __fc_nan(0) #define HUGE_VALF INFINITY #define HUGE_VAL ((double)INFINITY) #define HUGE_VALL ((long double)INFINITY) __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/memory.h0000666000000000000000000000326513571573400014715 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ // This file is not in the C standard; it exists for compatibility purposes #include "string.h" frama-c-20.0-Calcium/share/libc/net/0000777000000000000000000000000013571573400014014 5ustar frama-c-20.0-Calcium/share/libc/net/if.h0000666000000000000000000001543313571573400014571 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef FC_NET_IF #define FC_NET_IF #include "../features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "sys/socket.h" struct if_nameidx {unsigned if_index; char *if_name;}; #define IF_NAMESIZE 16 extern unsigned if_nametoindex(const char * name); extern char *if_indextoname(unsigned index, char *name); extern struct if_nameindex *if_nameindex(void); extern void if_freenameindex(struct if_nameindex *ni); #define IFF_UP 0x1 /* interface is up */ #define IFF_BROADCAST 0x2 /* broadcast address valid */ #define IFF_DEBUG 0x4 /* turn on debugging */ #define IFF_LOOPBACK 0x8 /* is a loopback net */ #define IFF_POINTOPOINT 0x10 /* interface is has p-p link */ #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ #define IFF_RUNNING 0x40 /* interface RFC2863 OPER_UP */ #define IFF_NOARP 0x80 /* no ARP protocol */ #define IFF_PROMISC 0x100 /* receive all packets */ #define IFF_ALLMULTI 0x200 /* receive all multicast packets*/ #define IFF_MASTER 0x400 /* master of a load balancer */ #define IFF_SLAVE 0x800 /* slave of a load balancer */ #define IFF_MULTICAST 0x1000 /* Supports multicast */ #define IFF_PORTSEL 0x2000 /* can set media type */ #define IFF_AUTOMEDIA 0x4000 /* auto media select active */ #define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/ #define IFF_LOWER_UP 0x10000 /* driver signals L1 up */ #define IFF_DORMANT 0x20000 /* driver signals dormant */ #define IFF_ECHO 0x40000 /* echo sent packets */ #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\ IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) /* The ifaddr structure contains information about one address of an interface. They are maintained by the different address families, are allocated and attached when an address is set, and are linked together so all addresses for an interface can be located. */ struct ifaddr { struct sockaddr ifa_addr; /* Address of interface. */ union __fc_ifa_ifu { struct sockaddr ifu_broadaddr; struct sockaddr ifu_dstaddr; } ifa_ifu; struct iface *ifa_ifp; /* Back-pointer to interface. */ struct ifaddr *ifa_next; /* Next address for interface. */ }; #if 0 /* NOTE: Conflicts with file ifaddrs.h */ # define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */ # define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of link */ #endif /* Device mapping structure. I'd just gone off and designed a beautiful scheme using only loadable modules with arguments for driver options and along come the PCMCIA people 8) Ah well. The get() side of this is good for WDSETUP, and it'll be handy for debugging things. The set side is fine for now and being very small might be worth keeping for clean configuration. */ struct ifmap { unsigned long int mem_start; unsigned long int mem_end; unsigned short int base_addr; unsigned char irq; unsigned char dma; unsigned char port; /* 3 bytes spare */ }; /* Interface request structure used for socket ioctl's. All interface ioctl's must have parameter definitions which begin with ifr_name. The remainder may be interface specific. */ struct ifreq { # define IFHWADDRLEN 6 # define IFNAMSIZ IF_NAMESIZE union __fc_ifr_ifrn { char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */ } ifr_ifrn; union __fc_ifr_ifru { struct sockaddr ifru_addr; struct sockaddr ifru_dstaddr; struct sockaddr ifru_broadaddr; struct sockaddr ifru_netmask; struct sockaddr ifru_hwaddr; short int ifru_flags; int ifru_ivalue; int ifru_mtu; struct ifmap ifru_map; char ifru_slave[IFNAMSIZ]; /* Just fits the size */ char ifru_newname[IFNAMSIZ]; char * ifru_data; } ifr_ifru; }; # define ifr_name ifr_ifrn.ifrn_name /* interface name */ # define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ # define ifr_addr ifr_ifru.ifru_addr /* address */ # define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */ # define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ # define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */ # define ifr_flags ifr_ifru.ifru_flags /* flags */ # define ifr_metric ifr_ifru.ifru_ivalue /* metric */ # define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ # define ifr_map ifr_ifru.ifru_map /* device map */ # define ifr_slave ifr_ifru.ifru_slave /* slave device */ # define ifr_data ifr_ifru.ifru_data /* for use by interface */ # define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */ # define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */ # define ifr_qlen ifr_ifru.ifru_ivalue /* queue length */ # define ifr_newname ifr_ifru.ifru_newname /* New name */ # define _IOT_ifreq _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0) # define _IOT_ifreq_short _IOT(_IOTS(char),IFNAMSIZ,_IOTS(short),1,0,0) # define _IOT_ifreq_int _IOT(_IOTS(char),IFNAMSIZ,_IOTS(int),1,0,0) struct ifconf { int ifc_len; /* Size of buffer. */ union __fc_ifc_ifcu { char *ifcu_buf; struct ifreq *ifcu_req; } ifc_ifcu; }; # define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */ # define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */ __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/netdb.c0000666000000000000000000001345213571573400014473 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "netdb.h" #include "sys/socket.h" #include "netinet/in.h" #include "stdlib.h" #include "stddef.h" #include "string.h" #include "errno.h" #include "__fc_builtin.h" __PUSH_FC_STDLIB /* dummy implementation of getaddrinfo. Returns at most one addrinfo. */ int getaddrinfo( const char *restrict nodename, const char *restrict servname, const struct addrinfo *restrict hints, struct addrinfo **restrict res) { static unsigned int volatile net_state; if (nodename == NULL && servname == NULL) return EAI_NONAME; // very crude modelling: except for AGAIN, FAIL, and SYSTEM, failures // could be inferred from the arguments. switch (net_state) { case 0: return EAI_BADFLAGS; case 1: return EAI_AGAIN; case 2: return EAI_FAIL; case 3: return EAI_FAMILY; case 5: return EAI_SERVICE; case 6: return EAI_SOCKTYPE; case 7: { errno = EIO; // pick a semi-plausible errcode. return EAI_SYSTEM; } default: { struct addrinfo* ai = malloc(sizeof(*ai)); if (!ai) return EAI_MEMORY; struct sockaddr* sa = malloc(sizeof(*sa)); if (!sa) return EAI_MEMORY; sa -> sa_family = Frama_C_interval(0,AF_MAX); //@ slevel 15; for (int i = 0; i < 14; i++) { sa -> sa_data[i] = Frama_C_interval(CHAR_MIN,CHAR_MAX); } //@ slevel default; ai -> ai_flags = 0; ai -> ai_family = sa -> sa_family; ai -> ai_socktype = Frama_C_interval(0,SOCK_SEQPACKET); ai -> ai_protocol = Frama_C_interval(0,IPPROTO_MAX); ai -> ai_addrlen = sizeof(*sa) ; ai -> ai_addr = sa ; ai -> ai_canonname = "dummy" ; ai -> ai_next = NULL; *res = ai; return 0; } } } #define __FC_MAX_HOST_ADDRS 2 #define __FC_MAX_HOST_ALIASES 2 #define __FC_HOSTBUF_SIZE 128 #define __FC_QUERYBUF_SIZE 128 struct __fc_gethostbyname { struct hostent host; unsigned char host_addr[sizeof(struct in_addr)]; char *h_addr_ptrs[__FC_MAX_HOST_ADDRS + 1]; char *host_aliases[__FC_MAX_HOST_ALIASES]; char hostbuf[__FC_HOSTBUF_SIZE]; }; struct __fc_gethostbyname __fc_ghbn; int res_search(const char *dname, int class, int type, char *answer, int anslen) { for (int i = 0; i < anslen-1; i++) { answer[i] = Frama_C_char_interval(CHAR_MIN, CHAR_MAX); } answer[anslen-1] = 0; return Frama_C_interval(-1, anslen); } struct hostent *gethostbyname(const char *name) { char buf[__FC_QUERYBUF_SIZE]; const char *cp; int n; __fc_ghbn.host.h_addrtype = AF_INET; __fc_ghbn.host.h_length = sizeof(struct in_addr); // Disallow names consisting only of digits/dots, unless they end in a dot if (*name >= '0' && *name <= '9') { for (cp = name;; ++cp) { if (!*cp) { struct in_addr addr; if (*--cp == '.') break; // All-numeric, no dot at the end. Fake up a hostent as if we'd actually done a lookup. addr.s_addr = inet_addr(name); if (addr.s_addr == INADDR_NONE) return NULL; memcpy(__fc_ghbn.host_addr, &addr, __fc_ghbn.host.h_length); strncpy(__fc_ghbn.hostbuf, name, __FC_HOSTBUF_SIZE - 1); __fc_ghbn.hostbuf[__FC_HOSTBUF_SIZE - 1] = '\0'; __fc_ghbn.host.h_name = __fc_ghbn.hostbuf; __fc_ghbn.host.h_aliases = __fc_ghbn.host_aliases; __fc_ghbn.host_aliases[0] = NULL; __fc_ghbn.h_addr_ptrs[0] = (char *) __fc_ghbn.host_addr; __fc_ghbn.h_addr_ptrs[1] = NULL; __fc_ghbn.host.h_addr_list = __fc_ghbn.h_addr_ptrs; return &__fc_ghbn.host; } if (*cp < '0' && *cp > '9' && *cp != '.') break; } } n = res_search(name, 1, 1, buf, sizeof(buf)); if (n < 0) return NULL; if (Frama_C_nondet(0, 1)) return NULL; else { struct in_addr addr; addr.s_addr = inet_addr(name); memcpy(__fc_ghbn.host_addr, &addr, __fc_ghbn.host.h_length); strncpy(__fc_ghbn.hostbuf, name, __FC_HOSTBUF_SIZE - 1); __fc_ghbn.hostbuf[__FC_HOSTBUF_SIZE - 1] = '\0'; __fc_ghbn.host.h_name = __fc_ghbn.hostbuf; __fc_ghbn.host.h_aliases = __fc_ghbn.host_aliases; __fc_ghbn.host_aliases[0] = NULL; __fc_ghbn.h_addr_ptrs[0] = (char *) __fc_ghbn.host_addr; __fc_ghbn.h_addr_ptrs[1] = NULL; __fc_ghbn.host.h_addr_list = __fc_ghbn.h_addr_ptrs; return &__fc_ghbn.host; } } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/netdb.h0000666000000000000000000001702413571573400014477 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_NETDB #define __FC_NETDB #include "features.h" __PUSH_FC_STDLIB #include "netinet/in.h" #include "sys/socket.h" #include "inttypes.h" #include "__fc_string_axiomatic.h" __BEGIN_DECLS struct hostent { char *h_name; /* Official name of host. */ char **h_aliases; /* Alias list. */ int h_addrtype; /* Host address type. */ int h_length; /* Length of address. */ char **h_addr_list; /* List of addresses from name server. */ }; #define h_addr h_addr_list[0] /* for backward compatibility */ struct netent { char *n_name; /* Official name of network. */ char **n_aliases; /* Alias list. */ int n_addrtype; /* Net address type. */ uint32_t n_net; /* Network number. */ }; struct protoent { char *p_name; /* Official protocol name. */ char **p_aliases; /* Alias list. */ int p_proto; /* Protocol number. */ }; struct servent { char *s_name; /* Official service name. */ char **s_aliases; /* Alias list. */ int s_port; /* Port number. */ char *s_proto; /* Protocol to use. */ }; #define IPPORT_RESERVED 1024 int h_errno; # define HOST_NOT_FOUND 1 # define TRY_AGAIN 2 # define NO_RECOVERY 3 # define NO_DATA 4 struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Protocol family for socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol for socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address for socket. */ char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; # define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ # define AI_CANONNAME 0x0002 /* Request for canonical name. */ # define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ # define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */ # define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ # define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ # define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type.. */ # define NI_NUMERICHOST 1 /* Don't try to look up hostname. */ # define NI_NUMERICSERV 2 /* Don't convert port number to name. */ # define NI_NOFQDN 4 /* Only return nodename portion. */ # define NI_NAMEREQD 8 /* Don't return numeric addresses. */ # define NI_DGRAM 16 /* Look up UDP service rather than TCP. */ # define NI_NUMERICSCOPE 32 # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ # define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ # define EAI_AGAIN -3 /* Temporary failure in name resolution. */ # define EAI_FAIL -4 /* Non-recoverable failure in name res. */ # define EAI_FAMILY -6 /* `ai_family' not supported. */ # define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ # define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ # define EAI_MEMORY -10 /* Memory allocation failure. */ # define EAI_SYSTEM -11 /* System error returned in `errno'. */ # define EAI_OVERFLOW -12 /* Argument buffer overflow. */ extern void endhostent(void); extern void endnetent(void); extern void endprotoent(void); extern void endservent(void); /*@ requires addrinfo_valid: \valid(addrinfo); assigns \nothing; frees addrinfo; ensures allocation: \allocable(addrinfo); */ extern void freeaddrinfo(struct addrinfo * addrinfo); char *__fc_gai_strerror = ""; /*@ assigns \result \from indirect:errcode, __fc_gai_strerror; ensures result_string: \result == __fc_gai_strerror; ensures result_valid_string: valid_read_string(\result); */ extern const char *gai_strerror(int errcode); /*@ requires nodename_string: nodename == \null || valid_read_string(nodename); requires servname_string: servname == \null || valid_read_string(servname); requires hints_option: hints == \null || \valid_read(hints); requires valid_res: \valid(res); assigns *res \from indirect:nodename, indirect:servname, indirect:hints; assigns \result \from indirect:nodename, indirect:servname,indirect:hints; assigns errno \from indirect:nodename, indirect:servname, indirect:hints; allocates *res; behavior empty_request: assumes empty: nodename == \null && servname == \null; assigns \result \from indirect:nodename, indirect:servname; ensures no_name: \result == EAI_NONAME; behavior normal_request: assumes has_name: nodename != \null || servname != \null; ensures initialization:allocation:success_or_error: (\result == 0 && \fresh(*res,sizeof(*res)) && \initialized(*res)) || \result == EAI_AGAIN || \result == EAI_BADFLAGS || \result == EAI_FAIL || \result == EAI_FAMILY || \result == EAI_MEMORY || \result == EAI_SERVICE || \result == EAI_SOCKTYPE || \result == EAI_SYSTEM; complete behaviors; disjoint behaviors; */ extern int getaddrinfo( const char *restrict nodename, const char *restrict servname, const struct addrinfo *restrict hints, struct addrinfo **restrict res); extern struct hostent *gethostbyaddr(const void *, socklen_t, int); extern struct hostent *gethostbyname(const char *); extern struct hostent *gethostent(void); extern int getnameinfo(const struct sockaddr *restrict, socklen_t, char *restrict, socklen_t, char *restrict, socklen_t, int); extern struct netent *getnetbyaddr(uint32_t, int); extern struct netent *getnetbyname(const char *); extern struct netent *getnetent(void); extern struct protoent *getprotobyname(const char *); extern struct protoent *getprotobynumber(int); extern struct protoent *getprotoent(void); extern struct servent *getservbyname(const char *, const char *); extern struct servent *getservbyport(int, const char *); extern struct servent *getservent(void); extern void sethostent(int); extern void setnetent(int); extern void setprotoent(int); extern void setservent(int); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/netinet/0000777000000000000000000000000013571573400014674 5ustar frama-c-20.0-Calcium/share/libc/netinet/in.h0000666000000000000000000000356613571573400015465 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ // According to POSIX, definitions from both arpa/inet.h and netinet/in.h // may be exported by one another, so everything is defined in a common file. #ifndef __FC_NETINET_IN #define __FC_NETINET_IN #include "features.h" __PUSH_FC_STDLIB #include "../__fc_inet.h" __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/netinet/tcp.h0000666000000000000000000002565113571573400015644 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tcp.h 8.1 (Berkeley) 6/10/93 */ #ifndef _NETINET_TCP_H #define _NETINET_TCP_H 1 #include __PUSH_FC_STDLIB /* * User-settable options (used with setsockopt). */ #define TCP_NODELAY 1 /* Don't delay send to coalesce packets */ #define TCP_MAXSEG 2 /* Set maximum segment size */ #define TCP_CORK 3 /* Control sending of partial frames */ #define TCP_KEEPIDLE 4 /* Start keeplives after this period */ #define TCP_KEEPINTVL 5 /* Interval between keepalives */ #define TCP_KEEPCNT 6 /* Number of keepalives before death */ #define TCP_SYNCNT 7 /* Number of SYN retransmits */ #define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */ #define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */ #define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ #define TCP_INFO 11 /* Information about this connection. */ #define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */ #define TCP_CONGESTION 13 /* Congestion control algorithm. */ #define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ #define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ #define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ #define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ #define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */ #define TCP_REPAIR 19 /* TCP sock is under repair right now */ #define TCP_REPAIR_QUEUE 20 /* Set TCP queue to repair */ #define TCP_QUEUE_SEQ 21 /* Set sequence number of repaired queue. */ #define TCP_REPAIR_OPTIONS 22 /* Repair TCP connection options */ #define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ #define TCP_TIMESTAMP 24 /* TCP time stamp */ #define TCP_NOTSENT_LOWAT 25 /* Limit number of unsent bytes in write queue. */ #define TCP_CC_INFO 26 /* Get Congestion Control (optional) info. */ #define TCP_SAVE_SYN 27 /* Record SYN headers for new connections. */ #define TCP_SAVED_SYN 28 /* Get SYN headers recorded for connection. */ #ifdef __USE_MISC # include # include // macros to compensate for the non-standard types used here #ifndef u_int8_t #define u_int8_t uint8_t #endif #ifndef u_int16_t #define u_int16_t uint16_t #endif #ifndef u_int32_t #define u_int32_t uint32_t #endif typedef u_int32_t tcp_seq; /* * TCP header. * Per RFC 793, September, 1981. */ struct tcphdr { __extension__ union __fc_tcphdr { struct __fc_tcp_header_1 { u_int16_t th_sport; /* source port */ u_int16_t th_dport; /* destination port */ tcp_seq th_seq; /* sequence number */ tcp_seq th_ack; /* acknowledgement number */ # if __BYTE_ORDER == __LITTLE_ENDIAN u_int8_t th_x2:4; /* (unused) */ u_int8_t th_off:4; /* data offset */ # endif # if __BYTE_ORDER == __BIG_ENDIAN u_int8_t th_off:4; /* data offset */ u_int8_t th_x2:4; /* (unused) */ # endif u_int8_t th_flags; # define TH_FIN 0x01 # define TH_SYN 0x02 # define TH_RST 0x04 # define TH_PUSH 0x08 # define TH_ACK 0x10 # define TH_URG 0x20 u_int16_t th_win; /* window */ u_int16_t th_sum; /* checksum */ u_int16_t th_urp; /* urgent pointer */ }; struct __fc_tcp_header_2 { u_int16_t source; u_int16_t dest; u_int32_t seq; u_int32_t ack_seq; # if __BYTE_ORDER == __LITTLE_ENDIAN u_int16_t res1:4; u_int16_t doff:4; u_int16_t fin:1; u_int16_t syn:1; u_int16_t rst:1; u_int16_t psh:1; u_int16_t ack:1; u_int16_t urg:1; u_int16_t res2:2; # elif __BYTE_ORDER == __BIG_ENDIAN u_int16_t doff:4; u_int16_t res1:4; u_int16_t res2:2; u_int16_t urg:1; u_int16_t ack:1; u_int16_t psh:1; u_int16_t rst:1; u_int16_t syn:1; u_int16_t fin:1; # else # error "Adjust your defines" # endif u_int16_t window; u_int16_t check; u_int16_t urg_ptr; }; }; }; enum __fc_tcp_state { TCP_ESTABLISHED = 1, TCP_SYN_SENT, TCP_SYN_RECV, TCP_FIN_WAIT1, TCP_FIN_WAIT2, TCP_TIME_WAIT, TCP_CLOSE, TCP_CLOSE_WAIT, TCP_LAST_ACK, TCP_LISTEN, TCP_CLOSING /* now a valid state */ }; # define TCPOPT_EOL 0 # define TCPOPT_NOP 1 # define TCPOPT_MAXSEG 2 # define TCPOLEN_MAXSEG 4 # define TCPOPT_WINDOW 3 # define TCPOLEN_WINDOW 3 # define TCPOPT_SACK_PERMITTED 4 /* Experimental */ # define TCPOLEN_SACK_PERMITTED 2 # define TCPOPT_SACK 5 /* Experimental */ # define TCPOPT_TIMESTAMP 8 # define TCPOLEN_TIMESTAMP 10 # define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ # define TCPOPT_TSTAMP_HDR \ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) /* * Default maximum segment size for TCP. * With an IP MSS of 576, this is 536, * but 512 is probably more convenient. * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). */ # define TCP_MSS 512 # define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ # define TCP_MAX_WINSHIFT 14 /* maximum window shift */ # define SOL_TCP 6 /* TCP level */ # define TCPI_OPT_TIMESTAMPS 1 # define TCPI_OPT_SACK 2 # define TCPI_OPT_WSCALE 4 # define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */ # define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ # define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */ /* Values for tcpi_state. */ enum tcp_ca_state { TCP_CA_Open = 0, TCP_CA_Disorder = 1, TCP_CA_CWR = 2, TCP_CA_Recovery = 3, TCP_CA_Loss = 4 }; struct tcp_info { u_int8_t tcpi_state; u_int8_t tcpi_ca_state; u_int8_t tcpi_retransmits; u_int8_t tcpi_probes; u_int8_t tcpi_backoff; u_int8_t tcpi_options; u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; u_int32_t tcpi_rto; u_int32_t tcpi_ato; u_int32_t tcpi_snd_mss; u_int32_t tcpi_rcv_mss; u_int32_t tcpi_unacked; u_int32_t tcpi_sacked; u_int32_t tcpi_lost; u_int32_t tcpi_retrans; u_int32_t tcpi_fackets; /* Times. */ u_int32_t tcpi_last_data_sent; u_int32_t tcpi_last_ack_sent; /* Not remembered, sorry. */ u_int32_t tcpi_last_data_recv; u_int32_t tcpi_last_ack_recv; /* Metrics. */ u_int32_t tcpi_pmtu; u_int32_t tcpi_rcv_ssthresh; u_int32_t tcpi_rtt; u_int32_t tcpi_rttvar; u_int32_t tcpi_snd_ssthresh; u_int32_t tcpi_snd_cwnd; u_int32_t tcpi_advmss; u_int32_t tcpi_reordering; u_int32_t tcpi_rcv_rtt; u_int32_t tcpi_rcv_space; u_int32_t tcpi_total_retrans; }; /* For TCP_MD5SIG socket option. */ #define TCP_MD5SIG_MAXKEYLEN 80 struct tcp_md5sig { struct sockaddr_storage tcpm_addr; /* Address associated. */ u_int16_t __tcpm_pad1; /* Zero. */ u_int16_t tcpm_keylen; /* Key length. */ u_int32_t __tcpm_pad2; /* Zero. */ u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */ }; /* For socket repair options. */ struct tcp_repair_opt { u_int32_t opt_code; u_int32_t opt_val; }; /* Queue to repair, for TCP_REPAIR_QUEUE. */ enum __fc_tcp_queue { TCP_NO_QUEUE, TCP_RECV_QUEUE, TCP_SEND_QUEUE, TCP_QUEUES_NR, }; /* For cookie transactions socket options. */ #define TCP_COOKIE_MIN 8 /* 64-bits */ #define TCP_COOKIE_MAX 16 /* 128-bits */ #define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX) /* Flags for both getsockopt and setsockopt */ #define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */ #define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies, * supercedes everything. */ /* Flags for getsockopt */ #define TCP_S_DATA_IN (1 << 2) /* Was data received? */ #define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */ #define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */ #define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */ struct tcp_cookie_transactions { u_int16_t tcpct_flags; u_int8_t __tcpct_pad1; u_int8_t tcpct_cookie_desired; u_int16_t tcpct_s_data_desired; u_int16_t tcpct_used; u_int8_t tcpct_value[TCP_MSS_DEFAULT]; }; #endif /* Misc. */ __POP_FC_STDLIB #endif /* netinet/tcp.h */ frama-c-20.0-Calcium/share/libc/nl_types.h0000666000000000000000000000372013571573400015236 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_NL_TYPES #define __FC_NL_TYPES #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS typedef unsigned long nl_catd; typedef unsigned long nl_item; #define NL_SETD 1 #define NL_CAT_LOCALE 1 extern int catclose(nl_catd); extern char *catgets(nl_catd, int, int, const char *); extern nl_catd catopen(const char *, int); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/poll.h0000666000000000000000000000601213571573400014344 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_POLL #define __FC_POLL #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS struct pollfd { int fd; // input parameter in poll() short events; // input parameter in poll() short revents; // output parameter in poll() }; typedef unsigned long nfds_t; extern volatile int Frama_C_entropy_source; // The values used below are based on Linux. #define POLLIN 0x001 #define POLLPRI 0x002 #define POLLOUT 0x004 #define POLLERR 0x008 #define POLLHUP 0x010 #define POLLNVAL 0x020 #define POLLRDNORM 0x040 #define POLLRDBAND 0x080 #define POLLWRNORM 0x100 #define POLLWRBAND 0x200 /*@ requires valid_file_descriptors: \valid(fds+(0 .. nfds-1)); assigns fds[0 .. nfds-1].revents \from indirect:fds[0 .. nfds-1].fd, fds[0 .. nfds-1].events, indirect:nfds, indirect:timeout, indirect:Frama_C_entropy_source; assigns \result \from indirect:fds[0 .. nfds-1].fd, indirect:fds[0 .. nfds-1].events, indirect:nfds, indirect:timeout, indirect:Frama_C_entropy_source; ensures error_timeout_or_bounded: \result == -1 || \result == 0 || 1 <= \result <= nfds; ensures initialization:revents: \initialized(&fds[0 .. nfds-1].revents); */ extern int poll (struct pollfd *fds, nfds_t nfds, int timeout); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/pthread.h0000666000000000000000000003634513571573400015041 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_PTHREAD_H__ #define __FC_PTHREAD_H__ #include "features.h" __PUSH_FC_STDLIB #include "errno.h" // The values for the constants below are based on an x86 Linux, // declared in the order given by POSIX.1-2008. enum __fc_pthread_cancelstate { PTHREAD_CANCEL_ENABLE, PTHREAD_CANCEL_DISABLE }; enum __fc_pthread_canceltype { PTHREAD_CANCEL_DEFERRED, PTHREAD_CANCEL_ASYNCHRONOUS }; enum __fc_pthread_detachstate { PTHREAD_CREATE_JOINABLE, PTHREAD_CREATE_DETACHED }; enum __fc_pthread_inheritsched { PTHREAD_INHERIT_SCHED, PTHREAD_EXPLICIT_SCHED }; /* Scope handling. */ enum __fc_pthread_scope { PTHREAD_SCOPE_SYSTEM, PTHREAD_SCOPE_PROCESS }; enum __fc_pthread_mutex_type { PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_DEFAULT }; enum __fc_pthread_mutex_robust { PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST }; enum __fc_pthread_mutex_protocol { PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT }; enum __fc_pthread_mutex_pshared { PTHREAD_PROCESS_PRIVATE, PTHREAD_PROCESS_SHARED }; #define PTHREAD_BARRIER_SERIAL_THREAD (-1) #define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS #define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE #define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED #define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE #define PTHREAD_CANCELED ((void *) -1) #define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED #define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE #define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED #define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_DEFAULT #define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK #define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_NORMAL #define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE #define PTHREAD_MUTEX_ROBUST PTHREAD_MUTEX_ROBUST #define PTHREAD_MUTEX_STALLED PTHREAD_MUTEX_STALLED #define PTHREAD_ONCE_INIT 0 #define PTHREAD_PRIO_INHERIT PTHREAD_PRIO_INHERIT #define PTHREAD_PRIO_NONE PTHREAD_PRIO_NONE #define PTHREAD_PRIO_PROTECT PTHREAD_PRIO_PROTECT #define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED #define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE #define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM #define PTHREAD_COND_INITIALIZER { 0 } #define PTHREAD_MUTEX_INITIALIZER { 0 } #define PTHREAD_RWLOCK_INITIALIZER { 0 } // Include pthread-related types #include "__fc_define_pthread_types.h" #include "__fc_define_size_t.h" #include "sched.h" extern int pthread_attr_destroy(pthread_attr_t *); extern int pthread_attr_getdetachstate(const pthread_attr_t *, int *); extern int pthread_attr_getguardsize(const pthread_attr_t *restrict, size_t *restrict); extern int pthread_attr_getinheritsched(const pthread_attr_t *restrict, int *restrict); extern int pthread_attr_getschedparam(const pthread_attr_t *restrict, struct sched_param *restrict); extern int pthread_attr_getschedpolicy(const pthread_attr_t *restrict, int *restrict); extern int pthread_attr_getscope(const pthread_attr_t *restrict, int *restrict); extern int pthread_attr_getstack(const pthread_attr_t *restrict, void **restrict, size_t *restrict); extern int pthread_attr_getstacksize(const pthread_attr_t *restrict, size_t *restrict); extern int pthread_attr_init(pthread_attr_t *); extern int pthread_attr_setdetachstate(pthread_attr_t *, int); extern int pthread_attr_setguardsize(pthread_attr_t *, size_t); extern int pthread_attr_setinheritsched(pthread_attr_t *, int); extern int pthread_attr_setschedparam(pthread_attr_t *restrict, const struct sched_param *restrict); extern int pthread_attr_setschedpolicy(pthread_attr_t *, int); extern int pthread_attr_setscope(pthread_attr_t *, int); extern int pthread_attr_setstack(pthread_attr_t *, void *, size_t); extern int pthread_attr_setstacksize(pthread_attr_t *, size_t); extern int pthread_barrier_destroy(pthread_barrier_t *); extern int pthread_barrier_init(pthread_barrier_t *restrict, const pthread_barrierattr_t *restrict, unsigned); extern int pthread_barrier_wait(pthread_barrier_t *); extern int pthread_barrierattr_destroy(pthread_barrierattr_t *); extern int pthread_barrierattr_getpshared(const pthread_barrierattr_t *restrict, int *restrict); extern int pthread_barrierattr_init(pthread_barrierattr_t *); extern int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); extern int pthread_cancel(pthread_t); /*@ requires valid_cond: \valid(cond); assigns \result \from \nothing; ensures sucess: \result == 0; */ extern int pthread_cond_broadcast(pthread_cond_t *cond); /*@ requires valid_cond: \valid(cond); assigns \result \from indirect:*cond; ensures success_or_error: \result == 0 || \result == EBUSY; */ extern int pthread_cond_destroy(pthread_cond_t * cond); /*@ requires valid_cond: \valid(cond); requires valid_null_attr: attr == \null || \valid_read(attr); assigns *cond \from *attr; assigns \result \from \nothing; ensures initialization:cond: \initialized(cond); ensures success: \result == 0; // at least on Linux // Note: "never returns an error" comes from the French manpage for pthreads // (http://manpagesfr.free.fr/man/man3/pthread_cond_init.3.html) */ extern int pthread_cond_init(pthread_cond_t *restrict cond, const pthread_condattr_t *restrict attr); extern int pthread_cond_signal(pthread_cond_t *); extern int pthread_cond_timedwait(pthread_cond_t *restrict, pthread_mutex_t *restrict, const struct timespec *restrict); /*@ requires valid_cond: \valid(cond); requires valid_mutex: \valid(mutex); assigns \result \from \nothing; ensures success: \result == 0; // Note: "never returns an error" comes from the French manpage for pthreads // (http://manpagesfr.free.fr/man/man3/pthread_cond_init.3.html) */ extern int pthread_cond_wait(pthread_cond_t *restrict cond, pthread_mutex_t *restrict mutex); extern int pthread_condattr_destroy(pthread_condattr_t *); //clockid_t not available yet //extern int pthread_condattr_getclock(const pthread_condattr_t *restrict, // clockid_t *restrict); extern int pthread_condattr_getpshared(const pthread_condattr_t *restrict, int *restrict); extern int pthread_condattr_init(pthread_condattr_t *); //clockid_t not available yet //extern int pthread_condattr_setclock(pthread_condattr_t *, clockid_t); extern int pthread_condattr_setpshared(pthread_condattr_t *, int); /*@ requires valid_thread: \valid(thread); requires valid_null_attr: attr == \null || \valid_read(attr); requires valid_routine: \valid_function(start_routine); requires valid_null_arg: arg == \null || \valid((char*)arg); assigns *thread \from *attr; assigns \result \from indirect:*attr; ensures success_or_error: \result == 0 || \result == EAGAIN || \result == EINVAL || \result == EPERM; */ extern int pthread_create(pthread_t *restrict thread, const pthread_attr_t *restrict attr, void *(*start_routine)(void*), void *restrict arg); extern int pthread_detach(pthread_t); extern int pthread_equal(pthread_t, pthread_t); extern void pthread_exit(void *); extern int pthread_getconcurrency(void); //clockid_t not available yet //extern int pthread_getcpuclockid(pthread_t, clockid_t *); extern int pthread_getschedparam(pthread_t, int *restrict, struct sched_param *restrict); extern void *pthread_getspecific(pthread_key_t); /*@ requires valid_or_null_retval: retval == \null || \valid(retval); assigns *retval \from thread; assigns \result \from indirect:thread; ensures success_or_error: \result == 0 || \result == EDEADLK || \result == EINVAL || \result == ESRCH; behavior ignore_retval: assumes null_retval: retval == \null; assigns \result \from indirect:thread; behavior use_retval: assumes valid_retval: \valid(retval); assigns *retval \from thread; assigns \result \from indirect:thread; */ extern int pthread_join(pthread_t thread, void **retval); extern int pthread_key_create(pthread_key_t *, void (*)(void*)); extern int pthread_key_delete(pthread_key_t); extern int pthread_mutex_consistent(pthread_mutex_t *); /*@ requires mutex_valid: \valid(mutex); assigns *mutex \from *mutex; assigns \result \from indirect:*mutex; ensures init_or_busy: \result == 0 || \result == EBUSY; */ extern int pthread_mutex_destroy(pthread_mutex_t *mutex); extern int pthread_mutex_getprioceiling(const pthread_mutex_t *restrict, int *restrict); /*@ requires mutex_valid: \valid(mutex); requires attrs_valid_or_null: attrs == \null || \valid_read(attrs); assigns *mutex \from *mutex, *attrs; assigns \result \from indirect:*mutex, indirect:*attrs; // NB: under Linux, \result is guaranteed to be 0. ensures initialization:success_or_error: (\result == 0 && \initialized(mutex)) || \result == EAGAIN || \result == ENOMEM || \result == EPERM || \result == EINVAL; */ extern int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attrs); /*@ requires mutex_valid: \valid(mutex); assigns *mutex \from *mutex; assigns \result \from indirect:*mutex; ensures success_or_error: \result == 0 || \result == EAGAIN || \result == EINVAL || \result == EDEADLK; // NB: more error codes are specified in POSIX, but they are not // exported by our version of errno.h */ extern int pthread_mutex_lock(pthread_mutex_t * mutex); extern int pthread_mutex_setprioceiling(pthread_mutex_t *restrict, int, int *restrict); extern int pthread_mutex_timedlock(pthread_mutex_t *restrict, const struct timespec *restrict); extern int pthread_mutex_trylock(pthread_mutex_t *); /*@ requires mutex_valid: \valid(mutex); assigns *mutex \from *mutex; assigns \result \from indirect:*mutex; ensures success_or_error: \result == 0 || \result == EPERM; */ extern int pthread_mutex_unlock(pthread_mutex_t *mutex); extern int pthread_mutexattr_destroy(pthread_mutexattr_t *); extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *restrict, int *restrict); extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict, int *restrict); extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *restrict, int *restrict); extern int pthread_mutexattr_getrobust(const pthread_mutexattr_t *restrict, int *restrict); extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *restrict, int *restrict); extern int pthread_mutexattr_init(pthread_mutexattr_t *); extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int); extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int); extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); extern int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int); extern int pthread_mutexattr_settype(pthread_mutexattr_t *, int); extern int pthread_once(pthread_once_t *, void (*)(void)); extern int pthread_rwlock_destroy(pthread_rwlock_t *); extern int pthread_rwlock_init(pthread_rwlock_t *restrict, const pthread_rwlockattr_t *restrict); extern int pthread_rwlock_rdlock(pthread_rwlock_t *); extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *restrict, const struct timespec *restrict); extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *restrict, const struct timespec *restrict); extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *); extern int pthread_rwlock_trywrlock(pthread_rwlock_t *); extern int pthread_rwlock_unlock(pthread_rwlock_t *); extern int pthread_rwlock_wrlock(pthread_rwlock_t *); extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *); extern int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *restrict, int *restrict); extern int pthread_rwlockattr_init(pthread_rwlockattr_t *); extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int); extern pthread_t pthread_self(void); extern int pthread_setcancelstate(int, int *); extern int pthread_setcanceltype(int, int *); extern int pthread_setconcurrency(int); extern int pthread_setschedparam(pthread_t, int, const struct sched_param *); extern int pthread_setschedprio(pthread_t, int); extern int pthread_setspecific(pthread_key_t, const void *); extern int pthread_spin_destroy(pthread_spinlock_t *); extern int pthread_spin_init(pthread_spinlock_t *, int); extern int pthread_spin_lock(pthread_spinlock_t *); extern int pthread_spin_trylock(pthread_spinlock_t *); extern int pthread_spin_unlock(pthread_spinlock_t *); extern void pthread_testcancel(void); // From POSIX: "Inclusion of the header shall make symbols defined // in the headers and visible." // (sched.h has already been included) #include "time.h" __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/pwd.h0000666000000000000000000000677013571573400014203 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_PWD_H__ #define __FC_PWD_H__ #include "features.h" __PUSH_FC_STDLIB #include "__fc_builtin.h" #include "__fc_define_uid_and_gid.h" #include "__fc_string_axiomatic.h" // for size_t #include "stddef.h" __BEGIN_DECLS struct passwd { char *pw_name; char *pw_passwd; // not POSIX, but allowed by it, and present in glibc uid_t pw_uid; gid_t pw_gid; char *pw_gecos; // not POSIX, but present in most implementations char *pw_dir; char *pw_shell; }; extern char __fc_getpwuid_pw_name[64]; extern char __fc_getpwuid_pw_passwd[64]; extern char __fc_getpwuid_pw_dir[64]; extern char __fc_getpwuid_pw_shell[64]; struct passwd __fc_pwd = {.pw_name = __fc_getpwuid_pw_name, .pw_passwd = __fc_getpwuid_pw_passwd, .pw_dir = __fc_getpwuid_pw_dir, .pw_shell = __fc_getpwuid_pw_shell}; struct passwd *__fc_p_pwd = & __fc_pwd; /*@ // missing: may assign to errno: EIO, EINTR, EMFILE, ENFILE // missing: assigns \result, __fc_pwd[0..] \from 'password database' requires valid_name: valid_read_string(name); assigns \result \from __fc_p_pwd, indirect:name[0..]; assigns __fc_pwd \from indirect:name[0..]; ensures result_null_or_internal_struct: \result == \null || \result == __fc_p_pwd; */ extern struct passwd *getpwnam(const char *name); /*@ // missing: assigns \result, __fc_pwd[0..] \from 'password database' assigns \result \from __fc_p_pwd, indirect:uid; assigns __fc_pwd \from indirect:uid; ensures result_null_or_internal_struct: \result == \null || \result == __fc_p_pwd; */ extern struct passwd *getpwuid(uid_t uid); extern int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **); extern int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); extern void endpwent(void); extern struct passwd *getpwent(void); extern void setpwent(void); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/regex.h0000666000000000000000000000523213571573400014513 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef _REGEX_H #define _REGEX_H 1 #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_size_t.h" __BEGIN_DECLS struct re_pattern_buffer { size_t re_nsub; }; typedef struct re_pattern_buffer regex_t; #define REG_EXTENDED 1 #define REG_ICASE 2 #define REG_NEWLINE 4 #define REG_NOSUB 8 /* Eflags */ #define REG_NOTBOL 1 #define REG_NOTEOL 2 /* Error codes */ typedef enum __fc_reg_errcode_t { REG_NOERROR = 0, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE, REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN, REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND, REG_ESIZE, REG_ERPAREN } reg_errcode_t; typedef int regoff_t; typedef struct __fc_regmatch_t { regoff_t rm_so; regoff_t rm_eo; } regmatch_t; extern int regcomp(regex_t *, const char *, int); extern int regexec(const regex_t *, const char *, size_t, regmatch_t[], int); extern size_t regerror(int, const regex_t *, char *, size_t); extern void regfree(regex_t *); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/resolv.h0000666000000000000000000000634213571573400014716 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef _RESOLV_H #define _RESOLV_H 1 #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS // Note: resolv.h is neither ISO-C nor POSIX struct __res_state; typedef struct __res_state *res_state; // deprecated extern int res_init(void); extern int res_ninit(res_state statep); extern int res_nquery(res_state statep, const char *dname, int class, int type, unsigned char *answer, int anslen); extern int res_nsearch(res_state statep, const char *dname, int class, int type, unsigned char *answer, int anslen); extern int res_nquerydomain(res_state statep, const char *name, const char *domain, int class, int type, unsigned char *answer, int anslen); extern int res_nmkquery(res_state statep, int op, const char *dname, int class, int type, const unsigned char *data, int datalen, const unsigned char *newrr, unsigned char *buf, int buflen); extern int res_nsend(res_state statep, const unsigned char *msg, int msglen, unsigned char *answer, int anslen); extern int dn_comp(const char *exp_dn, unsigned char *comp_dn, int length, unsigned char **dnptrs, unsigned char **lastdnptr); extern int dn_expand(const unsigned char *msg, const unsigned char *eomorig, const unsigned char *comp_dn, char *exp_dn, int length); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sched.h0000666000000000000000000000456513571573400014477 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SCHED #define __FC_SCHED #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_timespec.h" #include "__fc_define_pid_t.h" __BEGIN_DECLS struct sched_param { int sched_priority; }; #define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 #define SCHED_SPORADIC 6 extern int sched_get_priority_max(int); extern int sched_get_priority_min(int); extern int sched_getparam(pid_t, struct sched_param *); extern int sched_getscheduler(pid_t); extern int sched_rr_get_interval(pid_t, struct timespec *); extern int sched_setparam(pid_t, const struct sched_param *); extern int sched_setscheduler(pid_t, int, const struct sched_param *); extern int sched_yield(void); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/semaphore.h0000666000000000000000000000447713571573400015376 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ // POSIX-compatible minimalist interface for sched.h #ifndef __FC_SEMAPHORE #define __FC_SEMAPHORE #include "features.h" __PUSH_FC_STDLIB #include "time.h" __BEGIN_DECLS typedef union __fc_sem_t { char __size[16]; } sem_t; #define SEM_FAILED ((sem_t *) 0) extern int sem_close(sem_t *); extern int sem_destroy(sem_t *); extern int sem_getvalue(sem_t *restrict, int *restrict); extern int sem_init(sem_t *, int, unsigned); extern sem_t *sem_open(const char *, int, ...); extern int sem_post(sem_t *); extern int sem_timedwait(sem_t *restrict, const struct timespec *restrict); extern int sem_trywait(sem_t *); extern int sem_unlink(const char *); extern int sem_wait(sem_t *); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/setjmp.h0000666000000000000000000000452113571573400014703 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SETJMP #define __FC_SETJMP #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS /* Note: setjmp/longjmp/sigsetjmp/siglongjmp are currently unsupported by Frama-C and should not be used. */ typedef int jmp_buf[5]; // arbitrary size /*@ assigns env[0..4]; // unsound - should "assigns \anything" */ extern int setjmp(jmp_buf env); /*@ assigns \nothing; ensures never_terminates: \false; */ extern void longjmp(jmp_buf env, int val); #include "__fc_define_sigset_t.h" typedef struct __fc_sigjmp_buf {jmp_buf buf; sigset_t sigs;} sigjmp_buf; extern int sigsetjmp(sigjmp_buf env, int savesigs); /*@ assigns \nothing; ensures never_terminates: \false; */ extern void siglongjmp(sigjmp_buf env, int val); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/signal.c0000666000000000000000000000327113571573400014652 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "signal.h" __PUSH_FC_STDLIB struct sigaction __fc_sigaction[SIGRTMAX+1]; __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/signal.h0000666000000000000000000001770113571573400014662 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SIGNAL #define __FC_SIGNAL /* ISO C: 7.14 */ #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_pid_t.h" #include "__fc_define_uid_and_gid.h" #include "__fc_define_pthread_types.h" __BEGIN_DECLS /* TODO: put sig_atomic_t in machdep */ #ifndef __sig_atomic_t_defined typedef volatile int sig_atomic_t; #define __sig_atomic_t_defined #endif typedef void (*__fc_sighandler_t) (int); #define sighandler_t __fc_sighandler_t /* for BSD 4.4 */ typedef __fc_sighandler_t sig_t; #define SIG_DFL ((__fc_sighandler_t)0) /* default signal handling */ #define SIG_IGN ((__fc_sighandler_t)1) /* ignore signal */ #define SIG_ERR ((__fc_sighandler_t)-1) /* error return from signal */ #define SIG_BLOCK 0 #define SIG_UNBLOCK 1 #define SIG_SETMASK 2 #define SIGHUP 1 #define SIGINT 2 #define SIGQUIT 3 #define SIGILL 4 #define SIGTRAP 5 #define SIGABRT 6 #define SIGIOT 6 #define SIGBUS 7 #define SIGFPE 8 #define SIGKILL 9 #define SIGUSR1 10 #define SIGSEGV 11 #define SIGUSR2 12 #define SIGPIPE 13 #define SIGALRM 14 #define SIGTERM 15 #define SIGSTKFLT 16 #define SIGCHLD 17 #define SIGCONT 18 #define SIGSTOP 19 #define SIGTSTP 20 #define SIGTTIN 21 #define SIGTTOU 22 #define SIGURG 23 #define SIGXCPU 24 #define SIGXFSZ 25 #define SIGVTALRM 26 #define SIGPROF 27 #define SIGWINCH 28 #define SIGIO 29 #define SIGPOLL SIGIO /* #define SIGLOST 29 */ #define SIGPWR 30 #define SIGSYS 31 #define SIGUNUSED 31 #define SIGRTMIN 32 #define SIGRTMAX 64 #define SA_NOCLDSTOP 0x00000001 #define SA_NOCLDWAIT 0x00000002 #define SA_SIGINFO 0x00000004 #define SA_ONSTACK 0x08000000 #define SA_RESTART 0x10000000 #define SA_NODEFER 0x40000000 #define SA_RESETHAND 0x80000000 #define SA_NOMASK SA_NODEFER #define SA_ONESHOT SA_RESETHAND /*@ assigns \nothing; */ extern void (*signal(int sig, void (*func)(int)))(int); /*@ assigns \nothing; ensures never_terminates: \false; */ extern int raise(int sig); #include "__fc_define_sigset_t.h" union sigval { int sival_int; void *sival_ptr; }; struct sigevent { int sigev_notify; int sigev_signo; union sigval sigev_value; void (*sigev_notify_function) (union sigval); pthread_attr_t *sigev_notify_attributes; }; #ifndef __have_siginfo_t #define __have_siginfo_t typedef struct __fc_siginfo_t { int si_signo; int si_code; union sigval si_value; int si_errno; pid_t si_pid; uid_t si_uid; void *si_addr; int si_status; int si_band; } siginfo_t; #endif struct sigaction { void (*sa_handler)(int); void (*sa_sigaction)(int, siginfo_t *, void *); sigset_t sa_mask; int sa_flags; }; /*@ requires valid_set: \valid(set); assigns *set \from \nothing; assigns \result \from \nothing; ensures initialization:set: \initialized(set); ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int sigemptyset(sigset_t *set); /*@ requires valid_set: \valid(set); assigns *set \from \nothing; assigns \result \from \nothing; ensures initialization:set: \initialized(set); ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int sigfillset(sigset_t *set); /*@ requires valid_set: \valid(set); requires initialization:set: \initialized(set); assigns *set \from indirect:signum; assigns \result \from signum; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int sigaddset(sigset_t *set, int signum); /*@ requires valid_set: \valid(set); requires initialization:set: \initialized(set); assigns *set \from indirect:signum; assigns \result \from signum; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int sigdelset(sigset_t *set, int signum); /*@ requires valid_read_set: \valid_read(set); requires initialization:set: \initialized(set); assigns \result \from *set, signum; ensures result_found_not_found_or_error: \result == 0 || \result == 1 || \result == -1; */ extern int sigismember(const sigset_t *set, int signum); extern struct sigaction __fc_sigaction[SIGRTMAX+1]; struct sigaction *__fc_p_sigaction = __fc_sigaction; /*@ // missing: errno may be set to EINVAL when trying to set some signals requires valid_signal: 0 <= signum <= SIGRTMAX; requires valid_oldact_or_null: oldact == \null || \valid(oldact); requires valid_read_act_or_null: act == \null || \valid_read(act); requires separation:separated_acts: \separated(act, oldact); assigns *oldact \from __fc_p_sigaction; assigns __fc_p_sigaction[signum] \from *act; assigns \result \from indirect:signum, indirect:act, indirect:*act, indirect:oldact, indirect:*oldact; ensures act_changed: act == \null || \subset(__fc_p_sigaction[signum], *act); ensures oldact_assigned: oldact == \null || \subset({*oldact}, __fc_p_sigaction[signum]); ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int sigaction(int signum, const struct sigaction *restrict act, struct sigaction *restrict oldact); /*@ // missing: assigns *oldset \from 'previous mask in process' requires valid_set_or_null: set == \null || \valid_read(set); requires valid_how: set != \null ==> how \in {SIG_BLOCK, SIG_SETMASK, SIG_UNBLOCK}; requires valid_oldset_or_null: oldset == \null || \valid(oldset); requires separation: (set == oldset == \null) || \separated(set, oldset); assigns \result \from indirect:how, indirect:set, indirect:oldset; assigns *oldset \from indirect:how, indirect:oldset; ensures result_ok_or_error: \result == 0 || \result == -1; ensures initialization:oldset_initialized: oldset != \null && \result == 0 ==> \initialized(oldset); */ extern int sigprocmask(int how, const sigset_t * restrict set, sigset_t *restrict oldset); /*@ // missing: errno may be set to EINVAL, EPERM, ESRCH // missing: assigns 'other processes' \from 'other processes' assigns \result \from indirect:pid, indirect: sig; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int kill(pid_t pid, int sig); /*@ // missing: errno may be set to EINVAL, EPERM, ESRCH // missing: assigns 'other processes' \from 'other processes' assigns \result \from indirect:pgrp, indirect: sig; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int killpg(pid_t pgrp, int sig); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/stdarg.h0000666000000000000000000000374113571573400014670 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.15 */ #ifndef __FC_STDARG #define __FC_STDARG #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" // for __FC_VA_LIST_T __BEGIN_DECLS typedef __FC_VA_LIST_T va_list; __END_DECLS #define va_arg(a,b) __builtin_va_arg(a,b) #define va_copy(a,b) __builtin_va_copy(a,b) #define va_end(a) __builtin_va_end(a) #define va_start(a,b) __builtin_va_start(a,b) __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/stdbool.h0000666000000000000000000000334013571573400015045 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_STDBOOL #define __FC_STDBOOL #define bool _Bool #define true 1 #define false 0 #define __bool_true_false_are_defined 1 #endif frama-c-20.0-Calcium/share/libc/stddef.h0000666000000000000000000000401513571573400014650 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_STDDEF #define __FC_STDDEF #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS #ifndef __ptrdiff_t_defined typedef __PTRDIFF_T ptrdiff_t; #define __ptrdiff_t_defined #endif __END_DECLS #include "__fc_define_size_t.h" #include "__fc_define_ssize_t.h" #include "__fc_define_wchar_t.h" #include "__fc_define_null.h" #define offsetof(type, member) __builtin_offsetof(type,member) __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/stdint.h0000666000000000000000000001272613571573400014714 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.18 */ #ifndef __FC_STDINT #define __FC_STDINT #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" __BEGIN_DECLS /* ISO C: 7.18.1.1 */ #ifdef __INT8_T typedef __INT8_T int8_t; #endif #ifdef __UINT8_T typedef __UINT8_T uint8_t; #ifndef u_int8_t #define u_int8_t uint8_t #endif #endif #ifdef __INT16_T typedef __INT16_T int16_t; #endif #ifdef __UINT16_T typedef __UINT16_T uint16_t; #ifndef u_int16_t #define u_int16_t uint16_t #endif #endif #ifdef __INT32_T typedef __INT32_T int32_t; #endif #ifdef __UINT32_T typedef __UINT32_T uint32_t; #ifndef u_int32_t #define u_int32_t uint32_t #endif #endif #ifdef __INT64_T typedef __INT64_T int64_t; #endif #ifdef __UINT64_T typedef __UINT64_T uint64_t; #ifndef u_int64_t #define u_int64_t uint64_t #endif #endif /* ISO C: 7.18.1.2 */ typedef __INT_LEAST8_T int_least8_t; typedef __UINT_LEAST8_T uint_least8_t; typedef __INT_LEAST16_T int_least16_t; typedef __UINT_LEAST16_T uint_least16_t; typedef __INT_LEAST32_T int_least32_t; typedef __UINT_LEAST32_T uint_least32_t; typedef __INT_LEAST64_T int_least64_t; typedef __UINT_LEAST64_T uint_least64_t; /* ISO C: 7.18.1.3 */ typedef __INT_FAST8_T int_fast8_t; typedef __UINT_FAST8_T uint_fast8_t; typedef __INT_FAST16_T int_fast16_t; typedef __UINT_FAST16_T uint_fast16_t; typedef __INT_FAST32_T int_fast32_t; typedef __UINT_FAST32_T uint_fast32_t; typedef __INT_FAST64_T int_fast64_t; typedef __UINT_FAST64_T uint_fast64_t; /* ISO C: 7.18.1.4 */ #include "__fc_define_intptr_t.h" #ifdef __UINTPTR_T typedef __UINTPTR_T uintptr_t; #define UINTPTR_MAX __FC_UINTPTR_MAX #endif /* ISO C: 7.18.1.5 */ typedef __INT_MAX_T intmax_t; typedef __UINT_MAX_T uintmax_t; /* ISO C: 7.18.2.1 */ #define INT8_MIN (-128) #define INT8_MAX 127 #define UINT8_MAX 255 #define INT16_MIN (-32768) #define INT16_MAX 32767 #define UINT16_MAX 65535 #define INT32_MIN (-INT32_MAX - 1) #define INT32_MAX 2147483647 #define UINT32_MAX 4294967295U #define INT64_MIN (-INT64_MAX -1LL) #define INT64_MAX 9223372036854775807LL #define UINT64_MAX 18446744073709551615ULL /* ISO C: 7.18.2.2 */ #define INT_LEAST8_MIN __INT_LEAST8_MIN #define INT_LEAST8_MAX __INT_LEAST8_MAX #define INT_LEAST16_MIN __INT_LEAST16_MIN #define INT_LEAST16_MAX __INT_LEAST16_MAX #define INT_LEAST32_MIN __INT_LEAST32_MIN #define INT_LEAST32_MAX __INT_LEAST32_MAX #define INT_LEAST64_MIN __INT_LEAST64_MIN #define INT_LEAST64_MAX __INT_LEAST64_MAX #define UINT_LEAST8_MAX __UINT_LEAST8_MAX #define UINT_LEAST16_MAX __UINT_LEAST16_MAX #define UINT_LEAST32_MAX __UINT_LEAST32_MAX #define UINT_LEAST64_MAX __UINT_LEAST64_MAX /* ISO C: 7.18.2.3 */ #define INT_FAST8_MIN __INT_FAST8_MIN #define INT_FAST8_MAX __INT_FAST8_MAX #define INT_FAST16_MIN __INT_FAST16_MIN #define INT_FAST16_MAX __INT_FAST16_MAX #define INT_FAST32_MIN __INT_FAST32_MIN #define INT_FAST32_MAX __INT_FAST32_MAX #define INT_FAST64_MIN __INT_FAST64_MIN #define INT_FAST64_MAX __INT_FAST64_MAX #define UINT_FAST8_MAX __UINT_FAST8_MAX #define UINT_FAST16_MAX __UINT_FAST16_MAX #define UINT_FAST32_MAX __UINT_FAST32_MAX #define UINT_FAST64_MAX __UINT_FAST64_MAX /* ISO C: 7.18.2.4 - Done directly with definition of corresponding types. */ /* ISO C: 7.18.2.5 */ #define INTMAX_MIN __FC_INTMAX_MIN #define INTMAX_MAX __FC_INTMAX_MAX #define UINTMAX_MAX __FC_UINTMAX_MAX /* ISO C: 7.18.3 */ #define PTRDIFF_MIN __FC_PTRDIFF_MIN #define PTRDIFF_MAX __FC_PTRDIFF_MAX #define SIG_ATOMIC_MIN __FC_SIG_ATOMIC_MIN #define SIG_ATOMIC_MAX __FC_SIG_ATOMIC_MAX #define SIZE_MAX __FC_SIZE_MAX #define WCHAR_MIN __FC_WCHAR_MIN #define WCHAR_MAX __FC_WCHAR_MAX #define WINT_MIN __FC_WINT_MIN #define WINT_MAX __FC_WINT_MAX /* ISO C: 7.18.4 */ #define INT8_C(c) c #define UINT8_C(c) c #define INT16_C(c) c #define UINT16_C(c) c #define INT32_C(c) (c ## L) #define UINT32_C(c) (c ## UL) #define INT64_C(c) (c ## LL) #define UINT64_C(c) (c ## ULL) #define INTMAX_C(c) (c ## LL) #define UINTMAX_C(c) (c ## ULL) __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/stdio.c0000666000000000000000000000664113571573400014523 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "stdio.h" #include "stdlib.h" #include "stdint.h" // for SIZE_MAX #include "sys/types.h" // for ssize_t #include "errno.h" __PUSH_FC_STDLIB FILE __fc_initial_stdout = {.__fc_FILE_id=1}; FILE * __fc_stdout = &__fc_initial_stdout; FILE __fc_initial_stderr = {.__fc_FILE_id=2}; FILE * __fc_stderr = &__fc_initial_stderr; FILE __fc_initial_stdin = {.__fc_FILE_id=0}; FILE * __fc_stdin = &__fc_initial_stdin; // inefficient but POSIX-conforming implementation of getline ssize_t getline(char **lineptr, size_t *n, FILE *stream) { if (!lineptr || !n || !stream) { errno = EINVAL; //TODO: set error indicator for stream return -1; } if (ferror(stream) || feof(stream)) { //TODO: set error indicator for stream return -1; } if (!*lineptr || *n == 0) { *lineptr = malloc(2); if (!lineptr) { errno = ENOMEM; //TODO: set error indicator for stream return -1; } *n = 2; } size_t cur = 0; while (!ferror(stream) && !feof(stream)) { while (cur < *n-1) { char c = fgetc(stream); if (c == EOF && cur == 0) { // no characters were read //TODO: set error indicator for stream return -1; } if (c != EOF) (*lineptr)[cur++] = c; if (c == '\n' || c == EOF) { // finished reading a line or the file (*lineptr)[cur] = '\0'; return cur; } } // try to realloc larger buffer if (*n == SSIZE_MAX) { errno = EOVERFLOW; //TODO: set error indicator for stream return -1; } size_t new_size = *n+1; *lineptr = realloc(*lineptr, new_size); if (!*lineptr) { // failed to realloc larger line errno = ENOMEM; //TODO: set error indicator for stream return -1; } *n = new_size; } //TODO: set error indicator for stream return -1; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/stdio.h0000666000000000000000000004325513571573400014532 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.19 */ #ifndef __FC_STDIO #define __FC_STDIO #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" #include "__fc_string_axiomatic.h" #include "stdarg.h" #include "stddef.h" #include "errno.h" #include "__fc_define_stat.h" #include "__fc_define_fpos_t.h" #include "__fc_define_file.h" #include "__fc_define_null.h" #include "__fc_define_eof.h" #include "__fc_define_ssize_t.h" #define _IOFBF 0 #define _IOLBF 1 #define _IONBF 2 #define BUFSIZ __FC_BUFSIZ #define FOPEN_MAX __FC_FOPEN_MAX #define FILENAME_MAX __FC_FILENAME_MAX #ifndef __FC_L_tmpnam #error machdep should have defined __FC_L_tmpnam! #endif #define L_tmpnam __FC_L_tmpnam #include "__fc_define_seek_macros.h" #define TMP_MAX __FC_TMP_MAX __BEGIN_DECLS extern FILE * __fc_stderr; #define stderr (__fc_stderr) extern FILE * __fc_stdin; #define stdin (__fc_stdin) extern FILE * __fc_stdout; #define stdout (__fc_stdout) /* Note: currently some functions only consider the __fc_FILE_id field of FILE. This models the fact that operations on different files are considered non-interferent between them. */ /*@ // missing: assigns 'filesystem' \from filename[0..]; // missing: assigns errno one of several possible values requires valid_filename: valid_read_string(filename); assigns \result \from indirect:filename[0..strlen(filename)]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int remove(const char *filename); /*@ // missing: assigns 'filesystem' \from old_name[0..], new_name[0..]; // missing: assigns errno one of 21 different possible values requires valid_old_name: valid_read_string(old_name); requires valid_new_name: valid_read_string(new_name); assigns \result \from indirect:old_name[0..strlen(old_name)], indirect:new_name[0..strlen(new_name)]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int rename(const char *old_name, const char *new_name); FILE __fc_fopen[__FC_FOPEN_MAX]; FILE* const __fc_p_fopen = __fc_fopen; /*@ assigns \result \from __fc_p_fopen; ensures result_null_or_valid_fd: \result == \null || (\subset(\result,&__fc_fopen[0 .. __FC_FOPEN_MAX-1])); */ extern FILE *tmpfile(void); char __fc_tmpnam[L_tmpnam]; char * const __fc_p_tmpnam = __fc_tmpnam; /*@ // Note: the tmpnam example in POSIX uses an array of size L_tmpnam+1 // missing: assigns __fc_p_tmpnam[0..L_tmpnam] \from 'PRNG and internal state' // missing: if called more than TMP_MAX, behavior is implementation-defined requires valid_s_or_null: s == \null || \valid(s+(0 .. L_tmpnam)); assigns __fc_p_tmpnam[0 .. L_tmpnam] \from __fc_p_tmpnam[0 .. L_tmpnam], indirect:s; assigns s[0 .. L_tmpnam] \from indirect:s, __fc_p_tmpnam[0 .. L_tmpnam]; assigns \result \from s, __fc_p_tmpnam; ensures result_string_or_null: \result == \null || \result == s || \result == __fc_p_tmpnam; */ extern char *tmpnam(char *s); /*@ // missing: assigns errno requires valid_stream: \valid(stream); assigns \result \from indirect:stream, indirect:*stream; ensures result_zero_or_EOF: \result == 0 || \result == EOF; */ extern int fclose(FILE *stream); /*@ // missing: assigns errno requires null_or_valid_stream: stream == \null || \valid_read(stream); ensures result_zero_or_EOF: \result == 0 || \result == EOF; assigns \result \from indirect:*stream, indirect:__fc_fopen[0 .. __FC_FOPEN_MAX-1]; assigns *stream, __fc_fopen[0 .. __FC_FOPEN_MAX-1] \from indirect:stream, *stream, __fc_fopen[0 .. __FC_FOPEN_MAX-1]; // may flush ALL open streams behavior flush_all: assumes all_streams: stream == \null; assigns __fc_fopen[0 .. __FC_FOPEN_MAX-1] \from __fc_fopen[0 .. __FC_FOPEN_MAX-1]; // flush ALL open streams assigns \result \from indirect:__fc_fopen[0 .. __FC_FOPEN_MAX-1]; behavior flush_stream: assumes single_stream: stream != \null; assigns *stream \from *stream; assigns \result \from indirect:*stream; complete behaviors; disjoint behaviors; */ extern int fflush(FILE *stream); /*@ requires valid_filename: valid_read_string(filename); requires valid_mode: valid_read_string(mode); assigns \result \from indirect:filename[0..strlen(filename)], indirect:mode[0..strlen(mode)], __fc_p_fopen; ensures result_null_or_valid_fd: \result==\null || (\subset(\result,&__fc_fopen[0 .. __FC_FOPEN_MAX-1])) ; */ extern FILE *fopen(const char * restrict filename, const char * restrict mode); /*@ requires valid_mode: valid_read_string(mode); assigns \result, __fc_fopen[fd] \from indirect:fd, indirect:mode[0..strlen(mode)], indirect:__fc_fopen[fd], __fc_p_fopen; ensures result_null_or_valid_fd: \result == \null || (\subset(\result,&__fc_fopen[0 .. __FC_FOPEN_MAX-1])) ; */ extern FILE *fdopen(int fd, const char *mode); /*@ requires valid_filename: valid_read_string(filename); requires valid_mode: valid_read_string(mode); requires valid_stream: \valid(stream); assigns \result \from indirect:filename[..], indirect:mode[..], __fc_p_fopen, indirect:stream; assigns *stream \from indirect:filename[..], indirect:mode[..], __fc_p_fopen, indirect:stream; ensures result_null_or_valid_fd: \result==\null || \result \in &__fc_fopen[0 .. __FC_FOPEN_MAX-1]; ensures stream_opened: *stream \in __fc_fopen[0 .. __FC_FOPEN_MAX-1]; */ extern FILE *freopen(const char * restrict filename, const char * restrict mode, FILE * restrict stream); /*@ assigns *stream \from buf; */ extern void setbuf(FILE * restrict stream, char * restrict buf); /*@ assigns *stream \from buf,mode,size; */ extern int setvbuf(FILE * restrict stream, char * restrict buf, int mode, size_t size); /*@ // Axiomatic used by the Variadic plugin to generate specifications // for some functions, e.g. snprintf(). axiomatic format_length { //TODO: this logic function will be extended to handle variadic formats logic integer format_length{L}(char *format); } */ // Direct specifications for variadic functions are unsupported; // use the Variadic plug-in instead. extern int fprintf(FILE * restrict stream, const char * restrict format, ...); extern int fscanf(FILE * restrict stream, const char * restrict format, ...); extern int printf(const char * restrict format, ...); extern int scanf(const char * restrict format, ...); extern int snprintf(char * restrict s, size_t n, const char * restrict format, ...); extern int sprintf(char * restrict s, const char * restrict format, ...); extern int sscanf(const char * restrict s, const char * restrict format, ...); /*@ assigns *stream \from format[..], arg; */ extern int vfprintf(FILE * restrict stream, const char * restrict format, va_list arg); /*@ assigns *stream \from format[..], *stream; // TODO: assign arg too. */ extern int vfscanf(FILE * restrict stream, const char * restrict format, va_list arg); /*@ assigns *__fc_stdout \from arg; */ extern int vprintf(const char * restrict format, va_list arg); /*@ assigns *__fc_stdin \from format[..]; // TODO: assign arg too. */ extern int vscanf(const char * restrict format, va_list arg); /*@ assigns s[0..n-1] \from format[..], arg; */ extern int vsnprintf(char * restrict s, size_t n, const char * restrict format, va_list arg); /*@ assigns s[0..] \from format[..], arg; */ extern int vsprintf(char * restrict s, const char * restrict format, va_list arg); /* TODO: assigns arg ; */ extern int vsscanf(const char * restrict s, const char * restrict format, va_list arg); /*@ requires valid_stream: \valid(stream); assigns *stream \from *stream; assigns \result \from indirect:*stream; ensures result_uchar_or_eof: 0 <= \result <= __FC_UCHAR_MAX || \result == EOF; */ extern int fgetc(FILE *stream); /*@ requires valid_stream: \valid(stream); requires room_s: \valid(s+(0..size-1)); assigns s[0..size-1] \from indirect:size, indirect:*stream; assigns \result \from s, indirect:size, indirect:*stream; ensures result_null_or_same: \result == \null || \result == s; ensures initialization:at_least_one:\result != \null ==> \initialized(&s[0]); // the return value does not tell how many characters were written, // so we can only ensure the first one was initialized ensures terminated_string_on_success: \result != \null ==> valid_string(s); */ extern char *fgets(char * restrict s, int size, FILE * restrict stream); /*@ requires valid_stream: \valid(stream); assigns *stream \from c, *stream; assigns \result \from indirect:*stream; */ extern int fputc(int c, FILE *stream); /*@ requires valid_string_s: valid_read_string(s); assigns *stream \from s[0..strlen(s)], *stream; assigns \result \from indirect:s[0..strlen(s)], indirect:*stream; */ extern int fputs(const char * restrict s, FILE * restrict stream); /*@ requires valid_stream: \valid(stream); assigns \result, *stream \from *stream; */ extern int getc(FILE *stream); /*@ assigns \result, *__fc_stdin \from *__fc_stdin; */ extern int getchar(void); // Number of characters that will read by gets() /*@ axiomatic GetsLength { logic size_t gets_length{L} reads *__fc_stdin; } */ /*@ requires room_s: \valid(s+(0..gets_length)); assigns s[0..gets_length] \from *__fc_stdin ; assigns \result \from s, *__fc_stdin; assigns *__fc_stdin \from *__fc_stdin; ensures result_null_or_same: \result == s || \result == \null; */ extern char *gets(char *s); /*@ requires valid_stream: \valid(stream); assigns *stream \from c, *stream; assigns \result \from indirect:*stream; */ extern int putc(int c, FILE *stream); /*@ assigns *__fc_stdout \from c, *__fc_stdout; assigns \result \from indirect:*__fc_stdout; */ extern int putchar(int c); /*@ requires valid_string_s: valid_read_string(s); assigns *__fc_stdout \from s[0..strlen(s)], *__fc_stdout; assigns \result \from indirect:s[0..strlen(s)], indirect:*__fc_stdout; */ extern int puts(const char *s); /*@ requires valid_stream: \valid(stream); assigns *stream \from indirect:c; assigns \result \from indirect:c, indirect:*stream; ensures result_ok_or_error: \result == c || \result == EOF; */ extern int ungetc(int c, FILE *stream); /*@ requires valid_ptr_block: \valid(((char*)ptr)+(0..(nmemb*size)-1)); requires valid_stream: \valid(stream); assigns *(((char*)ptr)+(0..(nmemb*size)-1)), *stream \from indirect:size, indirect:nmemb, indirect:*stream; assigns \result \from size, indirect:*stream; ensures size_read: \result <= nmemb; ensures initialization: \initialized(((char*)ptr)+(0..(\result*size)-1)); */ extern size_t fread(void * restrict ptr, size_t size, size_t nmemb, FILE * restrict stream); /*@ requires valid_ptr_block: \valid_read(((char*)ptr)+(0..(nmemb*size)-1)); requires valid_stream: \valid(stream); assigns *stream, \result \from indirect:*(((char*)ptr)+(0..(nmemb*size)-1)); ensures size_written: \result <= nmemb; */ extern size_t fwrite(const void * restrict ptr, size_t size, size_t nmemb, FILE * restrict stream); /*@ requires valid_stream: \valid(stream); requires valid_pos: \valid(pos); requires initialization:pos: \initialized(pos); assigns *pos \from indirect:*stream; assigns \result \from indirect:*stream; */ extern int fgetpos(FILE * restrict stream, fpos_t * restrict pos); /*@ requires valid_stream: \valid(stream); requires whence_enum: whence == SEEK_SET || whence == SEEK_CUR || whence == SEEK_END; assigns *stream \from *stream, indirect:offset, indirect:whence; assigns \result, __fc_errno \from indirect:*stream, indirect:offset, indirect:whence; */ extern int fseek(FILE *stream, long int offset, int whence); /*@ requires valid_stream: \valid(stream); requires valid_pos: \valid_read(pos); requires initialization:pos: \initialized(pos); assigns *stream \from *pos; */ extern int fsetpos(FILE *stream, const fpos_t *pos); /*@ requires valid_stream: \valid(stream); assigns \result, __fc_errno \from indirect:*stream ; ensures success_or_error: \result == -1 || (\result >= 0 && __fc_errno == \old(__fc_errno)); */ extern long int ftell(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns *stream \from \nothing; */ extern void rewind(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns *stream \from \nothing; */ extern void clearerr(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result \from indirect:*stream; */ extern int feof(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result \from indirect:*stream; */ extern int fileno(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns *stream \from \nothing; */ extern void flockfile(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns *stream \from \nothing; */ extern void funlockfile(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result,*stream \from \nothing; */ extern int ftrylockfile(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result \from indirect:*stream; */ extern int ferror(FILE *stream); /*@ requires valid_string_s: valid_read_string(s); assigns __fc_stdout \from __fc_errno, s[0..strlen(s)]; */ extern void perror(const char *s); /*@ requires valid_stream: \valid(stream); assigns \result,*stream \from *stream; */ extern int getc_unlocked(FILE *stream); /*@ assigns \result \from *__fc_stdin; */ extern int getchar_unlocked(void); /*@ requires valid_stream: \valid(stream); assigns *stream \from c; assigns \result \from indirect:*stream; */ extern int putc_unlocked(int c, FILE *stream); /*@ assigns *__fc_stdout \from c; assigns \result \from indirect:*__fc_stdout; */ extern int putchar_unlocked(int c); /*@ requires valid_stream: \valid(stream); assigns *stream \from \nothing; */ extern void clearerr_unlocked(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result \from indirect:*stream; */ extern int feof_unlocked(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result \from indirect:*stream; */ extern int ferror_unlocked(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result \from indirect:*stream; */ extern int fileno_unlocked(FILE *stream); extern int fflush_unlocked(FILE *stream); extern int fgetc_unlocked(FILE *stream); extern int fputc_unlocked(int c, FILE *stream); extern size_t fread_unlocked(void *ptr, size_t size, size_t n, FILE *stream); extern size_t fwrite_unlocked(const void *ptr, size_t size, size_t n, FILE *stream); extern char *fgets_unlocked(char *s, int n, FILE *stream); extern int fputs_unlocked(const char *s, FILE *stream); extern int dprintf(int fd, const char *restrict format, ...); /*@ axiomatic pipe_streams { predicate is_open_pipe{L}(FILE *stream); // is stream an open pipe? // Logic label L is not used, but must be present because the // predicate depends on the memory state } */ /*@ requires valid_command: valid_read_string(command); requires valid_type: valid_read_string(type); assigns \result \from indirect:*command, indirect:*type, __fc_p_fopen; assigns __fc_fopen[0..] \from indirect:*command, indirect:*type, __fc_fopen[0..]; ensures result_error_or_valid_open_pipe: \result == \null || (\subset(\result,&__fc_fopen[0 .. __FC_FOPEN_MAX-1]) && is_open_pipe(\result)); */ extern FILE *popen(const char *command, const char *type); /*@ requires valid_stream: \valid(stream); requires open_pipe: is_open_pipe(stream); assigns \result \from indirect:*stream; ensures closed_stream: !is_open_pipe(stream); */ extern int pclose(FILE *stream); // This file may be included by non-POSIX machdeps, which do not define // ssize_t, so we must check it #ifdef __FC_POSIX_VERSION // No specification given; include "stdio.c" to use Frama-C's implementation ssize_t getline(char **lineptr, size_t *n, FILE *stream); #endif __END_DECLS #define IOV_MAX 1024 __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/stdlib.c0000666000000000000000000001353613571573400014663 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.20 */ #include "stdlib.h" #include "__fc_builtin.h" #include "ctype.h" #include "string.h" #include "limits.h" #include "errno.h" __PUSH_FC_STDLIB int abs (int i) { if (i < 0) return -i; return i; } int atoi(const char *p) { int n; int c, neg = 0; unsigned char *up = (unsigned char *)p; if (!isdigit(c = *up)) { while (isspace(c)) c = *++up; switch (c) { case '-': neg++; /* FALLTHROUGH */ case '+': c = *++up; } if (!isdigit(c)) return (0); } for (n = '0' - c; isdigit(c = *++up); ) { n *= 10; /* two steps to avoid unnecessary overflow */ n += '0' - c; /* accum neg to avoid surprises at MAX */ } return (neg ? n : -n); } void *calloc(size_t nmemb, size_t size) { size_t l = nmemb * size; // test overflow, and fail if detected if (size != 0 && l / size != nmemb) { return 0; } char *p = malloc(l); if (p) memset(p, 0, l); return p; } char *__fc_env[ARG_MAX] __attribute__((FRAMA_C_MODEL)); // To provide for some non-determinism, __fc_initenv initializes the // environment with an arbitrary string #define __FC_INITENV_LEN 64 static char __fc_env_strings[__FC_INITENV_LEN]; static void __fc_initenv() { static char init; if (!init) { // -1 to ensure null-termination Frama_C_make_unknown(__fc_env_strings, __FC_INITENV_LEN-1); for (int i = 0; i < ARG_MAX; i++) { __fc_env[i] = __fc_env_strings + Frama_C_interval(0,__FC_INITENV_LEN-1); } init = 1; } } // all *env functions below follow this pattern: // - check input argument(s); // - initialize the environment, if not done already // - perform the actual function char *getenv(const char *name) { //@ assert !strchr(name, '='); __fc_initenv(); if (Frama_C_nondet(0, 1)) { return __fc_env[Frama_C_interval(0, ARG_MAX-1)]; } else { return 0; } } int putenv(char *string) { char *separator = strchr(string, '='); //@ assert string_contains_separator: separator != \null; //@ assert name_is_not_empty: separator != string; __fc_initenv(); // possible cases: // 1. key in string not found in env: // a. no more memory ==> ENOMEM // b. available memory ==> modify env to point to string // 2. key in string found in env ==> modify an existing entry if (Frama_C_nondet(0, 1)) { if (Frama_C_nondet(0, 1)) { //TODO: errno = ENOMEM; return Frama_C_interval(INT_MIN, INT_MAX); // return a non-zero value } __fc_env[Frama_C_interval(0, ARG_MAX-1)] = string; } return 0; } int setenv(const char *name, const char *value, int overwrite) { if (strchr(name, '=')) { //TODO: errno = EINVAL; return -1; } size_t namelen = strlen(name); if (namelen == 0) { //TODO: errno = EINVAL; return -1; } __fc_initenv(); // possible cases: // 1. found 'name' and will overwrite, or did not find, but no more memory // 2. found 'name' but will not overwrite // 3. did not find name and has available memory if (Frama_C_nondet(0, 1)) { //TODO: errno = ENOMEM; return -1; } else { if (Frama_C_nondet(0, 1)) { Frama_C_make_unknown(__fc_env_strings, __FC_INITENV_LEN-1); } __fc_env[Frama_C_interval(0,ARG_MAX-1)] = __fc_env_strings + Frama_C_interval(0,__FC_INITENV_LEN-1); return 0; } } int unsetenv(const char *name) { if (strchr(name, '=')) { //TODO: errno = EINVAL; return -1; } size_t namelen = strlen(name); if (namelen == 0) { //TODO: errno = EINVAL; return -1; } __fc_initenv(); if (Frama_C_nondet(0, 1)) { __fc_env[Frama_C_interval(0,ARG_MAX-1)] = 0; } return 0; } unsigned short __fc_random48_counter[3]; // Note: this implementation does not check the alignment, since it cannot // currently be specified in the memory model of most plug-ins int posix_memalign(void **memptr, size_t alignment, size_t size) { // By default, specifications in the libc are ignored for defined functions, // and since we do not actually use alignment, we need to check its validity. // The assertion below is the requires in the specification. /*@ assert alignment_is_a_suitable_power_of_two: alignment >= sizeof(void*) && ((size_t)alignment & ((size_t)alignment - 1)) == 0; */ *memptr = malloc(size); if (!*memptr) return ENOMEM; return 0; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/stdlib.h0000666000000000000000000006211413571573400014664 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.20 */ #ifndef __FC_STDLIB #define __FC_STDLIB #include "features.h" __PUSH_FC_STDLIB #include "__fc_machdep.h" #include "__fc_define_size_t.h" #include "__fc_define_wchar_t.h" #include "__fc_alloc_axiomatic.h" #include "__fc_string_axiomatic.h" __BEGIN_DECLS #ifndef __div_t_defined typedef struct __fc_div_t { int quot; /* Quotient. */ int rem; /* Remainder. */ } div_t; #define __div_t_defined #endif #ifndef __ldiv_t_defined typedef struct __fc_ldiv_t { long int quot; /* Quotient. */ long int rem; /* Remainder. */ } ldiv_t; #define __ldiv_t_defined #endif #ifndef __lldiv_t_defined typedef struct __fc_lldiv_t { long long int quot; /* Quotient. */ long long int rem; /* Remainder. */ } lldiv_t; #define __lldiv_t_defined #endif #include "__fc_define_null.h" /* These could be customizable */ #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 #include "limits.h" #define RAND_MAX __FC_RAND_MAX #define MB_CUR_MAX __FC_MB_CUR_MAX /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong assigns \result \from indirect:nptr, indirect:nptr[0 ..]; */ extern double atof(const char *nptr); /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong assigns \result \from indirect:nptr, indirect:nptr[0 ..]; */ extern int atoi(const char *nptr); /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong assigns \result \from indirect:nptr, indirect:nptr[0 ..]; */ extern long int atol(const char *nptr); /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong assigns \result \from indirect:nptr, indirect:nptr[0 ..]; */ extern long long int atoll(const char *nptr); /* See ISO C: 7.20.1.3 to complete these specifications */ /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong requires separation: \separated(nptr, endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..]; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr; behavior no_storage: assumes null_endptr: endptr == \null; assigns \result \from indirect:nptr, indirect:nptr[0 ..]; behavior store_position: assumes nonnull_endptr: endptr != \null; requires valid_endptr: \valid(endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..]; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr; ensures initialization: \initialized(endptr); ensures valid_endptr: \valid_read(endptr); ensures position_subset: \subset(*endptr, nptr + (0 ..)); complete behaviors; disjoint behaviors; */ extern double strtod(const char * restrict nptr, char ** restrict endptr); /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong requires separation: \separated(nptr, endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..]; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr; behavior no_storage: assumes null_endptr: endptr == \null; assigns \result \from indirect:nptr, indirect:nptr[0 ..]; behavior store_position: assumes nonnull_endptr: endptr != \null; requires valid_endptr: \valid(endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..]; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr; ensures initialization: \initialized(endptr); ensures valid_endptr: \valid_read(endptr); ensures position_subset: \subset(*endptr, nptr + (0 ..)); complete behaviors; disjoint behaviors; */ extern float strtof(const char * restrict nptr, char ** restrict endptr); /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong requires separation: \separated(nptr, endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..]; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr; behavior no_storage: assumes null_endptr: endptr == \null; assigns \result \from indirect:nptr, indirect:nptr[0 ..]; behavior store_position: assumes nonnull_endptr: endptr != \null; requires valid_endptr: \valid(endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..]; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr; ensures initialization: \initialized(endptr); ensures valid_endptr: \valid_read(endptr); ensures position_subset: \subset(*endptr, nptr + (0 ..)); complete behaviors; disjoint behaviors; */ extern long double strtold(const char * restrict nptr, char ** restrict endptr); /* TODO: See ISO C 7.20.1.4 to complete these specifications */ /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong requires separation: \separated(nptr, endptr); requires base_range: base == 0 || 2 <= base <= 36; assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr, indirect:base; behavior no_storage: assumes null_endptr: endptr == \null; assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; behavior store_position: assumes nonnull_endptr: endptr != \null; requires valid_endptr: \valid(endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr, indirect:base; ensures initialization: \initialized(endptr); ensures valid_endptr: \valid_read(endptr); ensures position_subset: \subset(*endptr, nptr + (0 ..)); complete behaviors; disjoint behaviors; */ extern long int strtol( const char * restrict nptr, char ** restrict endptr, int base); /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong requires separation: \separated(nptr, endptr); requires base_range: base == 0 || 2 <= base <= 36; assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr, indirect:base; behavior no_storage: assumes null_endptr: endptr == \null; assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; behavior store_position: assumes nonnull_endptr: endptr != \null; requires valid_endptr: \valid(endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr, indirect:base; ensures initialization: \initialized(endptr); ensures valid_endptr: \valid_read(endptr); ensures position_subset: \subset(*endptr, nptr + (0 ..)); complete behaviors; disjoint behaviors; */ extern long long int strtoll( const char * restrict nptr, char ** restrict endptr, int base); /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong requires separation: \separated(nptr, endptr); requires base_range: base == 0 || 2 <= base <= 36; assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr, indirect:base; behavior no_storage: assumes null_endptr: endptr == \null; assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; behavior store_position: assumes nonnull_endptr: endptr != \null; requires valid_endptr: \valid(endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr, indirect:base; ensures initialization: \initialized(endptr); ensures valid_endptr: \valid_read(endptr); ensures position_subset: \subset(*endptr, nptr + (0 ..)); complete behaviors; disjoint behaviors; */ extern unsigned long int strtoul( const char * restrict nptr, char ** restrict endptr, int base); /*@ requires valid_nptr: \valid_read(nptr); // cannot be precise, valid_read_string too strong requires separation: \separated(nptr, endptr); requires base_range: base == 0 || 2 <= base <= 36; assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr, indirect:base; behavior no_storage: assumes null_endptr: endptr == \null; assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; behavior store_position: assumes nonnull_endptr: endptr != \null; requires valid_endptr: \valid(endptr); assigns \result \from indirect:nptr, indirect:nptr[0 ..], indirect:base; assigns *endptr \from nptr, indirect:nptr[0 ..], indirect:endptr, indirect:base; ensures initialization: \initialized(endptr); ensures valid_endptr: \valid_read(endptr); ensures position_subset: \subset(*endptr, nptr + (0 ..)); complete behaviors; disjoint behaviors; */ extern unsigned long long int strtoull( const char * restrict nptr, char ** restrict endptr, int base); //@ ghost extern int __fc_random_counter __attribute__((unused)) __attribute__((FRAMA_C_MODEL)); const unsigned long __fc_rand_max = __FC_RAND_MAX; /* ISO C: 7.20.2 */ /*@ assigns \result \from __fc_random_counter ; @ assigns __fc_random_counter \from __fc_random_counter ; @ ensures result_range: 0 <= \result <= __fc_rand_max ; */ extern int rand(void); /*@ assigns __fc_random_counter \from seed ; */ extern void srand(unsigned int seed); /*@ assigns \result \from __fc_random_counter; ensures result_range: 0 <= \result <= __fc_rand_max; */ extern long int random(void); /*@ assigns __fc_random_counter \from seed; */ extern void srandom(unsigned int seed); // used to check if some *48() functions have called the seed initializer int __fc_random48_init __attribute__((FRAMA_C_MODEL)); extern unsigned short __fc_random48_counter[3] __attribute__((FRAMA_C_MODEL)); unsigned short *__fc_p_random48_counter = __fc_random48_counter; /*@ assigns __fc_random48_counter[0..2] \from seed; assigns __fc_random48_init \from \nothing; ensures random48_initialized: __fc_random48_init == 1; */ extern void srand48 (long int seed); /*@ requires initialization:initialized_seed16v: \initialized(seed16v+(0..2)); assigns __fc_random48_counter[0..2] \from indirect:seed16v[0..2]; assigns __fc_random48_init \from \nothing; assigns \result \from __fc_p_random48_counter; ensures random48_initialized: __fc_random48_init == 1; ensures result_counter: \result == __fc_p_random48_counter; */ extern unsigned short *seed48(unsigned short seed16v[3]); /*@ assigns __fc_random48_counter[0..2] \from param[0..5]; assigns __fc_random48_init \from \nothing; ensures random48_initialized: __fc_random48_init == 1; */ extern void lcong48(unsigned short param[7]); /*@ requires random48_initialized: __fc_random48_init == 1; assigns __fc_random48_counter[0..2] \from __fc_random48_counter[0..2]; assigns \result \from __fc_random48_counter[0..2]; ensures result_range: \is_finite(\result) && 0.0 <= \result < 1.0; */ extern double drand48(void); /*@ requires initialization:initialized_xsubi: \initialized(xsubi+(0..2)); assigns __fc_random48_counter[0..2] \from __fc_random48_counter[0..2]; assigns \result \from __fc_random48_counter[0..2]; ensures result_range: \is_finite(\result) && 0.0 <= \result < 1.0; */ extern double erand48(unsigned short xsubi[3]); /*@ requires random48_initialized: __fc_random48_init == 1; assigns __fc_random48_counter[0..2] \from __fc_random48_counter[0..2]; assigns \result \from __fc_random48_counter[0..2]; ensures result_range: 0 <= \result < 2147483648; */ extern long int lrand48 (void); /*@ requires initialization:initialized_xsubi: \initialized(xsubi+(0..2)); assigns __fc_random48_counter[0..2] \from __fc_random48_counter[0..2]; assigns \result \from __fc_random48_counter[0..2]; ensures result_range: 0 <= \result < 2147483648; */ extern long int nrand48 (unsigned short xsubi[3]); /*@ requires random48_initialized: __fc_random48_init == 1; assigns __fc_random48_counter[0..2] \from __fc_random48_counter[0..2]; assigns \result \from __fc_random48_counter[0..2]; ensures result_range: -2147483648 <= \result < 2147483648; */ extern long int mrand48 (void); /*@ requires initialization:initialized_xsubi: \initialized(xsubi+(0..2)); assigns __fc_random48_counter[0..2] \from __fc_random48_counter[0..2]; assigns \result \from __fc_random48_counter[0..2]; ensures result_range: -2147483648 <= \result < 2147483648; */ extern long int jrand48 (unsigned short xsubi[3]); /* ISO C: 7.20.3.1 */ /*@ allocates \result; assigns __fc_heap_status \from indirect:nmemb, indirect:size, __fc_heap_status; assigns \result \from indirect:nmemb, indirect:size, indirect:__fc_heap_status; behavior allocation: assumes can_allocate: is_allocable(nmemb * size); ensures allocation: \fresh(\result, nmemb * size); ensures initialization: \initialized(((char *)\result)+(0..nmemb*size-1)); ensures zero_initialization: \subset(((char *)\result)[0..nmemb*size-1], {0}); behavior no_allocation: assumes cannot_allocate: !is_allocable(nmemb * size); assigns \result \from \nothing; allocates \nothing; ensures null_result: \result == \null; complete behaviors; disjoint behaviors; */ extern void *calloc(size_t nmemb, size_t size); /*@ allocates \result; @ assigns __fc_heap_status \from size, __fc_heap_status; @ assigns \result \from indirect:size, indirect:__fc_heap_status; @ behavior allocation: @ assumes can_allocate: is_allocable(size); @ assigns __fc_heap_status \from size, __fc_heap_status; @ assigns \result \from indirect:size, indirect:__fc_heap_status; @ ensures allocation: \fresh(\result,size); @ behavior no_allocation: @ assumes cannot_allocate: !is_allocable(size); @ assigns \result \from \nothing; @ allocates \nothing; @ ensures null_result: \result==\null; @ complete behaviors; @ disjoint behaviors; @*/ extern void *malloc(size_t size); /*@ requires freeable: p==\null || \freeable(p); @ frees p; @ assigns __fc_heap_status \from __fc_heap_status; @ behavior deallocation: @ assumes nonnull_p: p!=\null; @ assigns __fc_heap_status \from __fc_heap_status; @ ensures freed: \allocable(p); @ behavior no_deallocation: @ assumes null_p: p==\null; @ assigns \nothing; @ frees \nothing; @ complete behaviors; @ disjoint behaviors; @*/ extern void free(void *p); /*@ requires freeable: ptr == \null || \freeable(ptr); allocates \result; frees ptr; assigns __fc_heap_status \from __fc_heap_status; assigns \result \from size, ptr, __fc_heap_status; behavior allocation: assumes can_allocate: is_allocable(size); allocates \result; assigns \result \from size, __fc_heap_status; ensures allocation: \fresh(\result,size); behavior deallocation: assumes nonnull_ptr: ptr != \null; assumes can_allocate: is_allocable(size); frees ptr; ensures freed: \allocable(ptr); ensures freeable: \result == \null || \freeable(\result); behavior fail: assumes cannot_allocate: !is_allocable(size); allocates \nothing; frees \nothing; assigns \result \from size, __fc_heap_status; ensures null_result: \result == \null; complete behaviors; disjoint behaviors allocation, fail; disjoint behaviors deallocation, fail; */ extern void *realloc(void *ptr, size_t size); /* ISO C: 7.20.4 */ /*@ assigns \exit_status \from \nothing; exits status: \exit_status != EXIT_SUCCESS; ensures never_terminates: \false; */ extern void abort(void) __attribute__ ((__noreturn__)); /*@ assigns \result \from \nothing ;*/ extern int atexit(void (*func)(void)); /*@ assigns \result \from \nothing ;*/ extern int at_quick_exit(void (*func)(void)); /*@ assigns \exit_status \from status; exits status: \exit_status == status; ensures never_terminates: \false; */ extern void exit(int status) __attribute__ ((__noreturn__)); /*@ assigns \nothing; ensures never_terminates: \false; */ extern void _Exit(int status) __attribute__ ((__noreturn__)); extern char *__fc_env[ARG_MAX] __attribute__((FRAMA_C_MODEL)); /*@ requires valid_name: valid_read_string(name); assigns \result \from __fc_env[0..], indirect:name, name[0 ..]; ensures null_or_valid_result: \result == \null || \valid(\result); */ extern char *getenv(const char *name); /*@ requires valid_string: valid_read_string(string); assigns __fc_env[0..] \from __fc_env[0..], string; assigns \result \from indirect:__fc_env[0..], indirect:string; */ extern int putenv(char *string); /*@ requires valid_name: valid_read_string(name); requires valid_value: valid_read_string(value); assigns \result, __fc_env[0..] \from __fc_env[0..], indirect:name, indirect:name[0 ..], indirect:value, indirect:value[0 ..], indirect:overwrite; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int setenv(const char *name, const char *value, int overwrite); /*@ requires valid_name: valid_read_string(name); assigns \result, __fc_env[0..] \from __fc_env[0..], indirect:name, indirect:name[0 ..]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int unsetenv(const char *name); /*@ assigns \nothing; ensures never_terminates: \false; */ extern void quick_exit(int status) __attribute__ ((__noreturn__)); /*@ requires null_or_valid_string_command: command == \null || valid_read_string(command); assigns \result \from indirect:command, indirect:command[0 ..]; */ extern int system(const char *command); /* ISO C: 7.20.5 */ /* TODO: use one of the well known specification with high order compare :-) */ // NOTE: the assigns of function [compar] are not currently taken into account // by ACSL. If [compar] is not purely functional, the result may be unsound. // To ensure soundness, you should manually give a specification to the // comparison function that is equivalent to: // assigns \result \from *(*)a, *(*)b; // where is the type of the compared arguments. /*@ requires valid_function_compar: \valid_function(compar); assigns \result \from indirect:key, ((char*)key)[0 .. size-1], base, ((char*)base)[0 .. size * (nmemb-1)], indirect:nmemb, indirect:size, indirect:*compar; ensures null_or_correct_result: \result == \null || \subset(\result, (void*)(((char*)base) + (0 .. size * (nmemb-1)))); */ extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); // NOTE: the assigns of function [compar] are not currently taken into account // by ACSL. If [compar] is not purely functional, the result may be unsound. /*@ requires valid_function_compar: \valid_function(compar); assigns ((char*)base)[0 ..] \from indirect:base, ((char*)base)[0 ..], indirect:nmemb, indirect:size, indirect:compar, indirect:*compar; */ extern void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); /* ISO C: 7.20.6 */ /*@ requires abs_representable: j > INT_MIN; assigns \result \from j; behavior negative: assumes negative: j < 0; ensures opposite_result: \result == -j; behavior nonnegative: assumes nonnegative: j >= 0; ensures same_result: \result == j; complete behaviors; disjoint behaviors; */ extern int abs(int j); /*@ requires abs_representable: j > LONG_MIN ; assigns \result \from j; behavior negative: assumes negative: j < 0; ensures opposite_result: \result == -j; behavior nonnegative: assumes nonnegative: j >= 0; ensures same_result: \result == j; complete behaviors; disjoint behaviors; */ extern long int labs(long int j); /*@ requires abs_representable: j > LLONG_MIN ; assigns \result \from j; behavior negative: assumes negative: j < 0; ensures opposite_result: \result == -j; behavior nonnegative: assumes nonnegative: j >= 0; ensures same_result: \result == j; complete behaviors; disjoint behaviors; */ extern long long int llabs(long long int j); /*@ assigns \result \from numer,denom ; */ extern div_t div(int numer, int denom); /*@ assigns \result \from numer,denom ; */ extern ldiv_t ldiv(long int numer, long int denom); /*@ assigns \result \from numer,denom ; */ extern lldiv_t lldiv(long long int numer, long long int denom); /* ISO C: 7.20.7 */ //@ ghost extern int __fc_mblen_state; /*@ assigns \result, __fc_mblen_state \from indirect:s, indirect:s[0 ..], indirect:n, __fc_mblen_state; */ extern int mblen(const char *s, size_t n); //@ ghost extern int __fc_mbtowc_state; /*@ requires separation: \separated(pwc, s); assigns \result \from indirect:s, indirect:s[0 .. n-1], indirect:n, __fc_mbtowc_state; assigns pwc[0 .. \result-1], __fc_mbtowc_state \from indirect:s, s[0 .. n-1], indirect:n, __fc_mbtowc_state; ensures consumed_range: \result <= n; */ extern int mbtowc(wchar_t * restrict pwc, const char * restrict s, size_t n); //@ ghost extern int __fc_wctomb_state; /*@ //requires room_string: \valid(s + (0 .. __fc_mb_cur_max - 1)); assigns \result \from indirect:wc, __fc_wctomb_state; assigns s[0 ..], __fc_wctomb_state \from wc, __fc_wctomb_state; */ extern int wctomb(char *s, wchar_t wc); /* ISO C: 7.20.8 */ /*@ requires separation: \separated(pwcs, s); assigns \result \from indirect:s, indirect:s[0 .. n-1], indirect:n; assigns pwcs[0 .. n-1] \from indirect:s, s[0 .. n-1], indirect:n; */ extern size_t mbstowcs(wchar_t * restrict pwcs, const char * restrict s, size_t n); /*@ requires separation: \separated(s, pwcs); assigns \result \from indirect:pwcs, indirect:pwcs[0 .. n-1], indirect:n; assigns s[0 .. n-1] \from indirect:pwcs, pwcs[0 .. n-1], indirect:n; */ extern size_t wcstombs(char * restrict s, const wchar_t * restrict pwcs, size_t n); // Note: this specification should ideally use a more specific predicate, // such as 'is_allocable_aligned(alignment, size)'. /*@ requires valid_memptr: \valid(memptr); requires alignment_is_a_suitable_power_of_two: alignment >= sizeof(void*) && ((size_t)alignment & ((size_t)alignment - 1)) == 0; allocates *memptr; assigns __fc_heap_status \from indirect:alignment, size, __fc_heap_status; assigns \result \from indirect:alignment, indirect:size, indirect:__fc_heap_status; behavior allocation: assumes can_allocate: is_allocable(size); assigns __fc_heap_status \from indirect:alignment, size, __fc_heap_status; assigns \result \from indirect:alignment, indirect:size, indirect:__fc_heap_status; ensures allocation: \fresh(*memptr,size); ensures result_zero: \result == 0; behavior no_allocation: assumes cannot_allocate: !is_allocable(size); assigns \result \from indirect:alignment; allocates \nothing; ensures result_non_zero: \result < 0 || \result > 0; complete behaviors; disjoint behaviors; */ extern int posix_memalign(void **memptr, size_t alignment, size_t size); /*@ // missing: requires 'last 6 characters of template must be XXXXXX' // missing: assigns \result, templat[0..] \from 'filesystem', 'RNG'; requires valid_template: valid_string(templat); assigns templat[0..] \from \nothing; assigns \result \from \nothing; ensures result_error_or_valid_fd: \result == -1 || 0 <= \result < __FC_FOPEN_MAX; */ extern int mkstemp(char *templat); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/string.c0000666000000000000000000002212013571573400014675 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "__fc_builtin.h" #include "string.h" #include "stdint.h" // for uintptr_t #include "stdlib.h" // for malloc() #include "errno.h" __PUSH_FC_STDLIB void* memcpy(void* restrict dest, const void* restrict src, size_t n) { /*@ loop invariant no_eva: 0 <= i <= n; loop invariant no_eva: \forall ℤ k; 0 <= k < i ==> ((char*)dest)[k] == ((char*)src)[k]; loop assigns i, ((char*)dest)[0 .. n-1]; loop variant n - i; */ for (size_t i = 0; i < n; i++) { ((char*)dest)[i] = ((char*)src)[i]; } return dest; } // memoverlap: auxiliary function that returns // 0 if p[0..n-1] and q[0..n-1] do not overlap; // -1/+1 otherwise, according to whether p is before or after q in the memory /*@ assigns \result \from indirect:p, indirect:q, indirect:n; behavior separated: assumes separation:no_overlap: \separated(p + (0 .. n-1), q + (0 .. n-1)); ensures result_no_overlap: \result == 0; behavior not_separated_lt: assumes separation:overlap: !\separated(p + (0 .. n-1), q + (0 .. n-1)); assumes p_before_q: p <= q < p + n; ensures result_p_before_q: \result == -1; behavior not_separated_gt: assumes separation:overlap: !\separated(p + (0 .. n-1), q + (0 .. n-1)); assumes p_after_q: q < p <= q + n; ensures result_p_after_q: \result == 1; complete behaviors; disjoint behaviors; */ static int memoverlap(char const *p, char const *q, size_t n) { uintptr_t p1 = (uintptr_t)p, p2 = (uintptr_t)(p+n), q1 = (uintptr_t)q, q2 = (uintptr_t)(q+n); if (p1 <= q1 && p2 > q1) return -1; else if (q1 <= p1 && q2 > p1) return 1; else return 0; } void* memmove(void* dest, const void* src, size_t n) { if (n == 0) return dest; char *s = (char*)src; char *d = (char*)dest; if (memoverlap(dest, src, n) <= 0) { /* default: copy up */ /*@ loop invariant no_eva: 0 <= i <= n; loop invariant no_eva: \forall ℤ k; 0 <= k < i ==> ((char*)dest)[k] == \at(((char*)src)[k],LoopEntry); loop invariant no_eva: \forall ℤ k; i <= k < n ==> ((char*)src)[k] == \at(((char*)src)[k],LoopEntry); loop assigns i, ((char*)dest)[0 .. n-1]; loop variant n - i; */ for (size_t i = 0; i < n; i++) d[i] = s[i]; } else { // beginning of dest overlaps with src: copy down // to avoid unsigned overflow in the loop below, the '0' case is // done outside the loop (note: n == 0 has already been tested) /*@ loop invariant no_eva: 0 <= i < n; loop invariant no_eva: \forall ℤ k; i < k < n ==> ((char*)dest)[k] == \at(((char*)src)[k],LoopEntry); loop invariant no_eva: \forall ℤ k; 0 <= k <= i ==> ((char*)src)[k] == \at(((char*)src)[k],LoopEntry); loop assigns i, ((char*)dest)[0 .. n-1]; loop variant i; */ for (size_t i = n-1; i > 0; i--) d[i] = s[i]; d[0] = s[0]; } return dest; } size_t strlen(const char *s) { size_t i; for (i = 0; s[i] != 0; i++); return i; } size_t strnlen(const char *s, size_t maxlen) { size_t i; for (i = 0; i < maxlen && s[i] != 0; i++); return i; } void* memset (void* s, int c, size_t n) { unsigned char *p = (unsigned char*)s; for (size_t i = 0; i < n; i++) { p[i] = c; } return s; } int strcmp(const char *s1, const char *s2) { size_t i; for (i = 0; s1[i] == s2[i]; i++) { if (s1[i] == 0) return 0; } return (((unsigned char *)s1)[i] - ((unsigned char *)s2)[i]); } int strncmp(const char *s1, const char *s2, size_t n) { for (size_t i = 0; i < n; i++) { if (s1[i] != s2[i]) return ((unsigned char *)s1)[i] - ((unsigned char *)s2)[i]; /* stop comparison when strings end */ if (s1[i] == 0) return 0; } return 0; } int memcmp(const void *s1, const void *s2, size_t n) { const unsigned char *p1, *p2; p1 = (const unsigned char *)s1; p2 = (const unsigned char *)s2; for (size_t i = 0; i < n; i++) if (p1[i] != p2[i]) return p1[i] - p2[i]; return 0; } // NOTE: strcasecmp is in POSIX's strings.h but not in C99 // auxiliary function for strcasecmp static int char_equal_ignore_case(char c1, char c2) { if (c1 >= 'A' && c1 <= 'Z') c1 -= ('A' - 'a'); if (c2 >= 'A' && c2 <= 'Z') c2 -= ('A' - 'a'); if (c1 == c2) return 0; else return (int) ((unsigned char)c2 - (unsigned char)c1); } int strcasecmp(const char *s1, const char *s2) { size_t i; for (i = 0; s1[i] != 0 && s2[i] != 0; i++) { int res = char_equal_ignore_case(s1[i], s2[i]); if (res != 0) return res; } if (s1[i] == 0 && s2[i] == 0) return 0; else if (s1[i] == 0) return -1; else return 1; } char* strcat(char *dest, const char *src) { size_t i; size_t n = strlen(dest); for (i = 0; src[i] != 0; i++) { dest[n+i] = src[i]; } dest[n+i] = 0; return dest; } /* From the strncat man page */ char* strncat(char *dest, const char *src, size_t n) { size_t dest_len = strlen(dest); size_t i; for (i = 0; i < n; i++) { if (src[i] == 0) break; dest[dest_len + i] = src[i]; } dest[dest_len + i] = 0; return dest; } char* strcpy(char *dest, const char *src) { size_t i; for (i = 0; src[i] != 0; i++) dest[i] = src[i]; dest[i] = 0; return dest; } char *strncpy(char *dest, const char *src, size_t n) { size_t i; for (i = 0; i < n; i++) { dest[i] = src[i]; if (src[i] == 0) break; } for (; i < n; i++) dest[i] = 0; return dest; } char *strchr(const char *s, int c) { const char ch = c; size_t i; for (i = 0; s[i] != ch; i++) if (s[i] == 0) return NULL; return (char*)&s[i]; } char *strrchr(const char *s, int c) { const char ch = c; for (size_t i = strlen(s)+1; i > 0; i--) if (s[i-1] == ch) return (char *)&s[i-1]; return NULL; } void *memchr(const void *s, int c, size_t n) { const unsigned char ch = c; const unsigned char *ss = (const unsigned char *)s; for (size_t i = 0; i < n; i++) if (ss[i] == ch) return (void *)&ss[i]; return NULL; } void *memrchr(const void *s, int c, size_t n) { const unsigned char ch = c; const unsigned char *ss = (const unsigned char *)s; for (size_t i = n; i > 0; i--) if (ss[i-1] == ch) return (void *)&ss[i-1]; return NULL; } char *strstr(const char *haystack, const char *needle) { // special case: empty string starts everywhere if (needle[0] == 0) return (char*)haystack; for (size_t i = 0; haystack[i] != 0; i++) { size_t j; for (j = 0; haystack[i+j] != 0; j++) { if (haystack[i+j] != needle[j]) break; } if (needle[j] == 0) return (char*)&haystack[i]; } return NULL; } char __fc_strerror[64]; static int __fc_strerror_init; char *strerror(int errnum) { #ifdef __FRAMAC__ if (!__fc_strerror_init) { Frama_C_make_unknown(__fc_strerror, 63); __fc_strerror[63] = 0; __fc_strerror_init = 1; } #endif return __fc_strerror; } /* Warning: read considerations about malloc() in Frama-C */ char *strdup(const char *s) { size_t l = strlen(s) + 1; char *p = malloc(l); if (!p) { errno = ENOMEM; return 0; } memcpy(p, s, l); return p; } /* Warning: read considerations about malloc() in Frama-C */ char *strndup(const char *s, size_t n) { /* find length up to n bytes */ size_t l; for (l = 0; l < n; l++) { if (s[l] == 0) break; } char *p = malloc(l+1); /* include terminating '\0' */ if (!p) { errno = ENOMEM; return 0; } memcpy(p, s, l); p[l] = 0; return p; } char __fc_strsignal[64]; static int __fc_strsignal_init; char *strsignal(int signum) { #ifdef __FRAMAC__ if (!__fc_strsignal_init) { Frama_C_make_unknown(__fc_strsignal, 63); __fc_strsignal[63] = 0; __fc_strsignal_init = 1; } #endif return __fc_strsignal; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/string.h0000666000000000000000000005421113571573400014710 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_STRING_H_ #define __FC_STRING_H_ #include "features.h" __PUSH_FC_STDLIB #include "__fc_string_axiomatic.h" #include "__fc_alloc_axiomatic.h" #include "stddef.h" #include "limits.h" __BEGIN_DECLS // Query memory /*@ predicate non_escaping{L}(void *s, size_t n) = \forall size_t i; 0 <= i < n ==> !\dangling((char *)s + i); */ /*@ predicate empty_block{L}(void *s) = \block_length((char*)s) == 0 && \offset((char*)s) == 0; // Note: the [\valid_read] below is intentional: if [malloc(0)] may return a // const base, then [memset(p, 0, 0)] requires p to have a readable // (but not writable) byte. predicate valid_or_empty{L}(void *s, size_t n) = (empty_block(s) || \valid_read((char*)s)) && \valid(((char*)s)+(0..n-1)); predicate valid_read_or_empty{L}(void *s, size_t n) = (empty_block(s) || \valid_read((char*)s)) && \valid_read(((char*)s)+(1..n-1)); */ /*@ requires valid_s1: valid_read_or_empty(s1, n); @ requires valid_s2: valid_read_or_empty(s2, n); @ requires initialization:s1: \initialized(((char*)s1)+(0..n - 1)); @ requires initialization:s2: \initialized(((char*)s2)+(0..n - 1)); @ requires danglingness:s1: non_escaping(s1, n); @ requires danglingness:s2: non_escaping(s2, n); @ assigns \result \from @ indirect:((char*)s1)[0.. n-1], indirect:((char*)s2)[0.. n-1]; @ ensures logic_spec: \result == memcmp{Pre,Pre}((char*)s1,(char*)s2,n); @*/ extern int memcmp (const void *s1, const void *s2, size_t n); /*@ requires valid: valid_read_or_empty(s, n) || \valid_read(((unsigned char*)s)+(0..memchr_off((char*)s,c,n))); @ requires initialization: \initialized(((unsigned char*)s)+(0..n - 1)) || \initialized(((unsigned char*)s)+(0..memchr_off((char*)s,c,n))); @ requires danglingness: non_escaping(s, n) || non_escaping(s, (size_t)(memchr_off((char*)s,c,n)+1)); @ assigns \result \from s, c, ((unsigned char*)s)[0..n-1]; @ behavior found: @ assumes char_found: memchr((char*)s,c,n); @ ensures result_same_base: \base_addr(\result) == \base_addr(s); @ ensures result_char: *(char*)\result == c; @ ensures result_in_str: \forall integer i; @ 0 <= i < n ==> *((unsigned char*)s+i) == c @ ==> \result <= s+i; @ behavior not_found: @ assumes char_not_found: !memchr((char*)s,c,n); @ ensures result_null: \result == \null; @*/ extern void *memchr(const void *s, int c, size_t n); // Copy memory /*@ requires valid_dest: valid_or_empty(dest, n); @ requires valid_src: valid_read_or_empty(src, n); @ requires separation: @ \separated(((char *)dest)+(0..n-1),((char *)src)+(0..n-1)); @ assigns ((char*)dest)[0..n - 1] \from ((char*)src)[0..n-1]; @ assigns \result \from dest; @ ensures copied_contents: memcmp{Post,Pre}((char*)dest,(char*)src,n) == 0; @ ensures result_ptr: \result == dest; @*/ extern void *memcpy(void *restrict dest, const void *restrict src, size_t n); /*@ requires valid_dest: valid_or_empty(dest, n); @ requires valid_src: valid_read_or_empty(src, n); @ assigns ((char*)dest)[0..n - 1] \from ((char*)src)[0..n-1]; @ assigns \result \from dest; @ ensures copied_contents: memcmp{Post,Pre}((char*)dest,(char*)src,n) == 0; @ ensures result_ptr: \result == dest; @*/ extern void *memmove(void *dest, const void *src, size_t n); // Set memory /*@ requires valid_s: valid_or_empty(s, n); @ assigns ((char*)s)[0..n - 1] \from c; @ assigns \result \from s; @ ensures acsl_c_equiv: memset((char*)s,c,n); @ ensures result_ptr: \result == s; @*/ extern void *memset(void *s, int c, size_t n); // Query strings /*@ requires valid_string_s: valid_read_string(s); @ assigns \result \from indirect:s[0..]; @ ensures acsl_c_equiv: \result == strlen(s); @*/ extern size_t strlen (const char *s); /*@ requires valid_string_s: valid_read_nstring(s, n); @ assigns \result \from indirect:s[0..n-1], indirect:n; @ ensures result_bounded: \result == strlen(s) || \result == n; @*/ extern size_t strnlen (const char *s, size_t n); /*@ requires valid_string_s1: valid_read_string(s1); @ requires valid_string_s2: valid_read_string(s2); @ assigns \result \from indirect:s1[0..], indirect:s2[0..]; @ ensures acsl_c_equiv: \result == strcmp(s1,s2); @*/ extern int strcmp (const char *s1, const char *s2); /*@ requires valid_string_s1: valid_read_nstring(s1, n); // over-strong @ requires valid_string_s2: valid_read_nstring(s2, n); // over-strong @ assigns \result \from indirect:s1[0 .. n-1], indirect:s2[0 ..n-1], indirect:n; @ ensures acsl_c_equiv: \result == strncmp(s1,s2,n); @*/ extern int strncmp (const char *s1, const char *s2, size_t n); /*@ requires valid_string_s1: valid_read_string(s1); // over-strong @ requires valid_string_s2: valid_read_string(s2); // over-strong @ assigns \result \from indirect:s1[0..], indirect:s2[0..]; @*/ extern int strcoll (const char *s1, const char *s2); /*@ requires valid_string_s: valid_read_string(s); @ assigns \result \from s, s[0..],c; @ behavior found: @ assumes char_found: strchr(s,c); @ ensures result_char: *\result == (char)c; @ ensures result_same_base: \base_addr(\result) == \base_addr(s); @ ensures result_in_length: s <= \result <= s + strlen(s); @ ensures result_valid_string: valid_read_string(\result); @ ensures result_first_occur: \forall char* p; s<=p<\result ==> *p != (char)c; @ behavior not_found: @ assumes char_not_found: !strchr(s,c); @ ensures result_null: \result == \null; @ behavior default: @ ensures result_null_or_same_base: @ \result == \null || \base_addr(\result) == \base_addr(s); @*/ extern char *strchr(const char *s, int c); /*@ requires valid_string_s: valid_read_string(s); @ assigns \result \from s, s[0..],c; @ behavior found: @ assumes char_found: strchr(s,c); @ ensures result_char: *\result == c; @ ensures result_same_base: \base_addr(\result) == \base_addr(s); @ ensures result_valid_string: valid_read_string(\result); @ behavior not_found: @ assumes char_not_found: !strchr(s,c); @ ensures result_null: \result == \null; @ behavior default: @ ensures result_null_or_same_base: @ \result == \null || \base_addr(\result) == \base_addr(s); @*/ extern char *strrchr(const char *s, int c); /*@ requires valid_string_s: valid_read_string(s); @ requires valid_string_reject: valid_read_string(reject); @ assigns \result \from indirect:s[0..], indirect:reject[0..]; @ ensures result_bounded: 0 <= \result <= strlen(s); @*/ extern size_t strcspn(const char *s, const char *reject); /*@ requires valid_string_s: valid_read_string(s); @ requires valid_string_accept: valid_read_string(accept); @ assigns \result \from s[0..], accept[0..]; @ assigns \result \from indirect:s[0..], indirect:accept[0..]; @ ensures result_bounded: 0 <= \result <= strlen(s); @*/ extern size_t strspn(const char *s, const char *accept); /*@ requires valid_string_s: valid_read_string(s); @ requires valid_string_accept: valid_read_string(accept); @ assigns \result \from s, s[0..], accept[0..]; @ ensures result_null_or_same_base: @ \result == \null || \base_addr(\result) == \base_addr(s); @*/ extern char *strpbrk(const char *s, const char *accept); /*@ requires valid_string_haystack: valid_read_string(haystack); @ requires valid_string_needle: valid_read_string(needle); @ assigns \result \from haystack, indirect:haystack[0..], @ indirect:needle[0..]; @ ensures result_null_or_in_haystack: @ \result == \null @ || (\subset(\result, haystack+(0..)) && \valid_read(\result) @ && memcmp{Pre,Pre}(\result,needle,strlen(needle)) == 0); @*/ extern char *strstr(const char *haystack, const char *needle); /*@ requires valid_string_haystack: valid_read_string(haystack); @ requires valid_string_needle: valid_read_string(needle); @ assigns \result \from haystack, indirect:haystack[0..], @ indirect:needle[0..]; @ ensures result_null_or_in_haystack: @ \result == \null @ || (\subset(\result, haystack+(0..)) && \valid_read(\result)); @*/ extern char *strcasestr (const char *haystack, const char *needle); // internal state of strtok char *__fc_strtok_ptr; /*@ // missing: separation requires valid_string_delim: valid_read_string(delim); assigns s[0..] \from s[0..], indirect:s, indirect:__fc_strtok_ptr, indirect:delim[0..]; assigns __fc_strtok_ptr[0..] \from __fc_strtok_ptr[0..], indirect:s, indirect:__fc_strtok_ptr, indirect:delim[0..]; assigns \result \from s, __fc_strtok_ptr, indirect:s[0..], indirect:__fc_strtok_ptr[0..], indirect:delim[0..]; assigns __fc_strtok_ptr \from \old(__fc_strtok_ptr), s, indirect:__fc_strtok_ptr[0..], indirect:delim[0..]; behavior new_str: assumes s_not_null: s != \null; requires valid_string_s_or_delim_not_found: valid_string(s) || (valid_read_string(s) && \forall int i; 0 <= i < strlen(delim) ==> !strchr(s,delim[i])); assigns __fc_strtok_ptr \from s, indirect:s[0..], indirect:delim[0..]; assigns s[0..] \from s[0..], indirect:s, indirect:delim[0..]; assigns \result \from s, indirect:s[0..], indirect:delim[0..]; ensures result_subset: \result == \null || \subset(\result, s+(0..)); ensures ptr_subset: \subset(__fc_strtok_ptr, s+(0..)); behavior resume_str: assumes s_null: s == \null; requires not_first_call: __fc_strtok_ptr != \null; assigns __fc_strtok_ptr[0..] \from __fc_strtok_ptr[0..], indirect:__fc_strtok_ptr, indirect:delim[0..]; assigns __fc_strtok_ptr \from \old(__fc_strtok_ptr), indirect:__fc_strtok_ptr[0..], indirect:delim[0..]; assigns \result \from __fc_strtok_ptr, indirect:__fc_strtok_ptr[0..], indirect:delim[0..]; ensures result_subset: \result == \null || \subset(\result, \old(__fc_strtok_ptr)+(0..)); ensures ptr_subset: \subset(__fc_strtok_ptr, \old(__fc_strtok_ptr)+(0..)); complete behaviors; disjoint behaviors; */ extern char *strtok(char *restrict s, const char *restrict delim); /*@ // missing: separation requires valid_string_delim: valid_read_string(delim); requires valid_saveptr: \valid(saveptr); assigns s[0..] \from s[0..], indirect:s, indirect:*saveptr, indirect:delim[0..]; assigns (*saveptr)[0..] \from (*saveptr)[0..], indirect:s, indirect:*saveptr, indirect:delim[0..]; assigns \result \from s, *saveptr, indirect:s[0..], indirect:(*saveptr)[0..], indirect:delim[0..]; assigns *saveptr \from \old(*saveptr), s, indirect:(*saveptr)[0..], indirect:delim[0..]; behavior new_str: assumes s_not_null: s != \null; requires valid_string_s_or_delim_not_found: valid_string(s) || (valid_read_string(s) && \forall int i; 0 <= i < strlen(delim) ==> !strchr(s,delim[i])); assigns *saveptr \from s, indirect:s[0..], indirect:delim[0..]; assigns s[0..] \from s[0..], indirect:s, indirect:delim[0..]; assigns \result \from s, indirect:s[0..], indirect:delim[0..]; ensures result_subset: \result == \null || \subset(\result, s+(0..)); ensures initialization: \initialized(saveptr); ensures saveptr_subset: \subset(*saveptr, s+(0..)); behavior resume_str: assumes s_null: s == \null; requires not_first_call: *saveptr != \null; requires initialization:saveptr: \initialized(saveptr); assigns (*saveptr)[0..] \from (*saveptr)[0..], indirect:*saveptr, indirect:delim[0..]; assigns *saveptr \from \old(*saveptr), indirect:(*saveptr)[0..], indirect:delim[0..]; assigns \result \from *saveptr, indirect:(*saveptr)[0..], indirect:delim[0..]; ensures result_subset: \result == \null || \subset(\result, \old(*saveptr)+(0..)); ensures saveptr_subset: \subset(*saveptr, \old(*saveptr)+(0..)); complete behaviors; disjoint behaviors; */ extern char *strtok_r(char *restrict s, const char *restrict delim, char **restrict saveptr); /*@ requires valid_string_stringp: \valid(stringp) && valid_string(*stringp); @ requires valid_string_delim: valid_read_string(delim); @ assigns *stringp \from delim[..], *stringp[..]; @ assigns \result \from delim[..], *stringp[..]; @*/ extern char *strsep (char **stringp, const char *delim); extern char __fc_strerror[64]; char * const __fc_p_strerror = __fc_strerror; // Note: postcondition "result_nul_terminated" is only a temporary patch, // to help plug-ins which are currently unable to reduce the post-state // using only 'result_valid_string'. /*@ assigns \result \from __fc_p_strerror, indirect:errnum; @ ensures result_internal_str: \result == __fc_p_strerror; @ ensures result_nul_terminated: \result[63] == 0; @ ensures result_valid_string: valid_read_string(\result); @*/ extern char *strerror(int errnum); // Copy strings /*@ requires valid_string_src: valid_read_string(src); @ requires room_string: \valid(dest+(0..strlen(src))); @ requires separation: @ \separated(dest+(0..strlen(src)), src+(0..strlen(src))); @ assigns dest[0..strlen(src)] \from src[0..strlen(src)]; @ assigns \result \from dest; @ ensures equal_contents: strcmp(dest,src) == 0; @ ensures result_ptr: \result == dest; @*/ extern char *strcpy(char *restrict dest, const char *restrict src); /*@ @ requires valid_string_src: valid_read_string(src); @ requires room_nstring: \valid(dest+(0 .. n-1)); @ requires separation: @ \separated(dest+(0..n-1), src+(0..n-1)); @ assigns dest[0..n - 1] \from src[0..n-1]; @ assigns \result \from dest; @ ensures result_ptr: \result == dest; @ ensures initialization: \initialized(dest+(0 .. n-1)); @ behavior complete: @ assumes src_fits: strlen(src) < n; @ ensures equal_after_copy: strcmp(dest,src) == 0; @ behavior partial: @ assumes src_too_long: n <= strlen(src); @ ensures equal_prefix: memcmp{Post,Post}(dest,src,n) == 0; @*/ extern char *strncpy(char *restrict dest, const char *restrict src, size_t n); /*@ // Non-POSIX, but often present @ requires valid_string_src: valid_read_string(src); @ requires room_nstring: \valid(dest+(0..n-1)); @ requires separation: @ \separated(dest+(0..n-1), src+(0..\max(n-1,strlen(src)))); @ assigns dest[0..n-1] \from src[0..n-1]; @ assigns \result \from indirect:src, indirect:src[0..n-1], indirect:n; @ ensures initialization: \initialized(dest+(0..\min(strlen(src),n-1))); @ ensures bounded_result: \result == strlen(src); */ size_t strlcpy(char * restrict dest, const char * restrict src, size_t n); // stpcpy is POSIX.1-2008 /*@ requires valid_string_src: valid_read_string(src); @ requires room_string: \valid(dest+(0..strlen(src))); @ requires separation: @ \separated(dest+(0..strlen(src)), src+(0..strlen(src))); @ assigns dest[0..strlen(src)] \from src[0..strlen(src)]; @ assigns \result \from dest; @ ensures equal_contents: strcmp(dest,src) == 0; @ ensures points_to_end: \result == dest + strlen(dest); @*/ extern char *stpcpy(char *restrict dest, const char *restrict src); /*@ // missing: separation @ requires valid_string_src: valid_read_string(src); @ requires valid_string_dest: valid_string(dest); @ requires room_string: \valid(dest+(0..strlen(dest) + strlen(src))); @ assigns dest[strlen(dest)..strlen(dest) + strlen(src)] @ \from src[0..strlen(src)]; @ ensures sum_of_lengths: strlen(dest) == \old(strlen(dest) + strlen(src)); @ assigns \result \from dest; @ ensures initialization:dest: @ \initialized(dest+(0..\old(strlen(dest) + strlen(src)))); @ ensures dest_null_terminated: dest[\old(strlen(dest) + strlen(src))] == 0; @ ensures result_ptr: \result == dest; @*/ extern char *strcat(char *restrict dest, const char *restrict src); /*@ // missing: separation @ requires valid_nstring_src: valid_read_nstring(src, n); @ requires valid_string_dest: valid_string(dest); @ assigns dest[strlen(dest) .. strlen(dest) + n] \from src[0..n]; @ assigns \result \from dest; @ ensures result_ptr: \result == dest; @ behavior complete: @ assumes valid_string_src_fits: valid_read_string(src) && strlen(src) <= n; @ requires room_string: \valid(dest + strlen(dest) + (0 .. strlen(src))); @ assigns dest[strlen(dest)..strlen(dest) + strlen(src)] @ \from src[0..strlen(src)]; @ assigns \result \from dest; @ ensures sum_of_lengths: strlen(dest) == \old(strlen(dest) + strlen(src)); @ behavior partial: @ assumes valid_string_src_too_large: @ !(valid_read_string(src) && strlen(src) <= n); @ requires room_string: \valid(dest + strlen(dest) + (0 .. n)); @ assigns dest[strlen(dest)..strlen(dest) + n] @ \from src[0..strlen(src)]; @ assigns \result \from dest; @ ensures sum_of_bounded_lengths: strlen(dest) == \old(strlen(dest)) + n; @*/ extern char *strncat(char *restrict dest, const char *restrict src, size_t n); /*@ // Non-POSIX, but often present @ // missing: separation @ requires valid_string_src: valid_read_string(src); @ requires valid_string_dest: valid_string(dest); @ requires room_nstring: \valid(dest+(0..n-1)); @ assigns dest[strlen(dest)..n] \from indirect:n, src[0..strlen(src)]; @ assigns \result \from indirect:src, indirect:src[0..n-1], indirect:n; @ ensures bounded_result: \result == strlen(dest) + strlen(src); @*/ extern size_t strlcat(char *restrict dest, const char *restrict src, size_t n); /*@ // missing: separation @ requires valid_dest: \valid(dest+(0..n - 1)); @ requires valid_string_src: valid_read_string(src); @ assigns dest[0..n - 1] \from indirect:src[0..], indirect:n; @ assigns \result \from dest; @*/ extern size_t strxfrm (char *restrict dest, const char *restrict src, size_t n); // Allocate strings /*@ requires valid_string_s: valid_read_string(s); @ allocates \result; @ assigns \result \from indirect:s[0..strlen(s)], indirect:__fc_heap_status; @ behavior allocation: @ assumes can_allocate: is_allocable(strlen(s)); @ assigns __fc_heap_status \from indirect:s, __fc_heap_status; @ assigns \result \from indirect:s[0..strlen(s)], indirect:__fc_heap_status; @ ensures allocation: \fresh(\result,strlen(s)); @ ensures result_valid_string_and_same_contents: @ valid_string(\result) && strcmp(\result,s) == 0; @ behavior no_allocation: @ assumes cannot_allocate: !is_allocable(strlen(s)); @ assigns \result \from \nothing; @ allocates \nothing; @ ensures result_null: \result == \null; @*/ extern char *strdup (const char *s); /*@ allocates \result; @ assigns \result \from indirect:s[0..strlen(s)], indirect:n, @ indirect:__fc_heap_status; @ behavior allocation: @ assumes can_allocate: is_allocable(\min(strlen(s), n+1)); @ assigns __fc_heap_status \from indirect:s, indirect:n, __fc_heap_status; @ assigns \result \from indirect:s[0..strlen(s)], indirect:n, @ indirect:__fc_heap_status; @ ensures allocation: \fresh(\result,\min(strlen(s), n+1)); @ ensures result_valid_string_bounded_and_same_prefix: @ \valid(\result+(0..\min(strlen(s),n))) && @ valid_string(\result) && strlen(\result) <= n && @ strncmp(\result,s,n) == 0; @ behavior no_allocation: @ assumes cannot_allocate: !is_allocable(\min(strlen(s), n+1)); @ assigns \result \from \nothing; @ allocates \nothing; @ ensures result_null: \result == \null; @*/ extern char *strndup (const char *s, size_t n); // More POSIX, non-C99 functions extern char *stpncpy(char *restrict dest, const char *restrict src, size_t n); //extern int strcoll_l(const char *s1, const char *s2, locale_t locale); //extern char *strerror_l(int errnum, locale_t locale); extern int strerror_r(int errnum, char *strerrbuf, size_t buflen); extern char __fc_strsignal[64]; char * const __fc_p_strsignal = __fc_strsignal; /*@ //missing: requires valid_signal(signum); @ assigns \result \from __fc_p_strsignal, indirect:signum; @ ensures result_internal_str: \result == __fc_p_strsignal; @ ensures result_nul_terminated: \result[63] == 0; @ ensures result_valid_string: valid_read_string(\result); @*/ extern char *strsignal(int signum); //extern size_t strxfrm_l(char *restrict s1, const char *restrict s2, size_t n, // locale_t locale); __END_DECLS /* Include strings.h: this is what BSD does, and glibc does something equivalent (having copied prototypes to string.h). */ #include "strings.h" __POP_FC_STDLIB #endif /* _STRING_H_ */ frama-c-20.0-Calcium/share/libc/strings.h0000666000000000000000000000542313571573400015074 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_STRINGS_H_ #define __FC_STRINGS_H_ #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_size_t.h" #include "__fc_string_axiomatic.h" __BEGIN_DECLS extern int bcmp(const void *, const void *, size_t); extern void bcopy(const void *, void *, size_t); /*@ requires valid_memory_area: \valid (((char*) s)+(0 .. n-1)); assigns ((char*) s)[0 .. n-1] \from \nothing; ensures s_initialized:initialization:\initialized(((char*) s)+(0 .. n-1)); ensures zero_initialized: \subset(((char*) s)[0 .. n-1], {0}); */ extern void bzero(void *s, size_t n); extern int ffs(int); extern char *index(const char *, int); extern char *rindex(const char *, int); /*@ requires valid_string_s1: valid_read_string(s1); requires valid_string_s2: valid_read_string(s2); assigns \result \from indirect:s1[0..], indirect:s2[0..]; */ extern int strcasecmp(const char *s1, const char *s2); /*@ requires valid_string_s1: valid_read_nstring(s1, n); requires valid_string_s2: valid_read_nstring(s2, n); assigns \result \from indirect:n, indirect:s1[0..n-1], indirect:s2[0..n-1]; */ extern int strncasecmp(const char *s1, const char *s2, size_t n); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/stropts.h0000666000000000000000000001236213571573400015121 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_STROPTS_H__ #define __FC_STROPTS_H__ #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "__fc_define_uid_and_gid.h" #include "__fc_machdep.h" typedef __INT32_T t_scalar_t; typedef __UINT32_T t_uscalar_t; struct bandinfo { int bi_flag; unsigned char bi_pri; }; struct strbuf { char *buf; int len; int maxlen; }; struct strpeek { struct strbuf ctlbuf; struct strbuf databuf; t_uscalar_t flags; }; struct strfdinsert { struct strbuf ctlbuf; struct strbuf databuf; int fildes; t_uscalar_t flags; int offset; }; struct strioctl { int ic_cmd; char *ic_dp; int ic_len; int ic_timout; }; struct strrecvfd { int fd; gid_t gid; uid_t uid; }; #define FMNAMESZ 8 struct str_mlist { char l_name[FMNAMESZ+1]; }; struct str_list { struct str_mlist *sl_modlist; int sl_nmods; }; // The values for the constants below are based on those of the glibc, // declared in the order given by POSIX.1-2008. #define I_ATMARK (__SID |31) #define I_CANPUT (__SID |34) #define I_CKBAND (__SID |29) #define I_FDINSERT (__SID |16) #define I_FIND (__SID |11) #define I_FLUSH (__SID | 5) #define I_FLUSHBAND (__SID |28) #define I_FLUSHBAND (__SID |28) #define I_GETBAND (__SID |30) #define I_GETCLTIME (__SID |33) #define I_GETSIG (__SID |10) #define I_GRDOPT (__SID | 7) #define I_GWROPT (__SID |20) #define I_LINK (__SID |12) #define I_LIST (__SID |21) #define I_LOOK (__SID | 4) #define I_NREAD (__SID | 1) #define I_PEEK (__SID |15) #define I_PLINK (__SID |22) #define I_POP (__SID | 3) #define I_PUNLINK (__SID |23) #define I_PUSH (__SID | 2) #define I_RECVFD (__SID |14) #define I_SENDFD (__SID |17) #define I_SETCLTIME (__SID |32) #define I_SETSIG (__SID | 9) #define I_SRDOPT (__SID | 6) #define I_STR (__SID | 8) #define I_SWROPT (__SID |19) #define I_UNLINK (__SID |13) #define FLUSHR 0x01 #define FLUSHRW 0x03 #define FLUSHRW 0x03 #define FLUSHW 0x02 #define S_BANDURG 0x0200 #define S_ERROR 0x0010 #define S_HANGUP 0x0020 #define S_HIPRI 0x0002 #define S_INPUT 0x0001 #define S_MSG 0x0008 #define S_OUTPUT 0x0004 #define S_RDBAND 0x0080 #define S_RDNORM 0x0040 #define S_WRBAND 0x0100 #define S_WRNORM S_OUTPUT #define RS_HIPRI 0x01 #define RMSGD 0x0001 #define RMSGN 0x0002 #define RNORM 0x0000 #define RPROTDAT 0x0004 #define RPROTDIS 0x0008 #define RPROTNORM 0x0010 #define SNDZERO 0x001 #define ANYMARK 0x01 #define LASTMARK 0x02 #define MUXID_ALL (-1) #define MORECTL 1 #define MOREDATA 2 #define MSG_ANY 0x02 #define MSG_BAND 0x04 #define MSG_HIPRI 0x01 extern int fattach(int, const char *); extern int fdetach(const char *); extern int getmsg(int, struct strbuf *restrict, struct strbuf *restrict, int *restrict); extern int getpmsg(int, struct strbuf *restrict, struct strbuf *restrict, int *restrict, int *restrict); extern int ioctl(int, int, ...); // for Variadic /*@ assigns \result \from indirect:fd, indirect:request; */ extern int __va_ioctl_void(int fd, int request); /*@ assigns \result \from indirect:fd, indirect:request, indirect:arg; */ extern int __va_ioctl_int(int fd, int request, int arg); /*@ assigns \result \from indirect:fd, indirect:request, indirect:((char*)argp)[0..]; assigns ((char*)argp)[0..] \from indirect:fd, indirect:request, ((char*)argp)[0..]; */ extern int __va_ioctl_ptr(int fd, int request, void* argp); extern int isastream(int); extern int putmsg(int, const struct strbuf *, const struct strbuf *, int); extern int putpmsg(int, const struct strbuf *, const struct strbuf *, int, int); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/0000777000000000000000000000000013571573400014044 5ustar frama-c-20.0-Calcium/share/libc/sys/file.h0000666000000000000000000000436713571573400015146 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_FILE_H__ #define __FC_SYS_FILE_H__ #include "../features.h" __PUSH_FC_STDLIB // Note: this file is not C11 nor POSIX, but Linux-specific. // The values for the constants below are based on the glibc. #define L_SET 0 #define L_INCR 1 #define L_XTND 2 #define LOCK_SH 1 #define LOCK_EX 2 #define LOCK_UN 8 #define LOCK_NB 4 /*@ // missing: may assign errno to EBADF, EINTR, EINVAL, ENOLCK, EWOULDBLOCK // missing: assigns \result, 'filesystem' \from 'filesystem' assigns \result \from indirect:fd, indirect:operation; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int flock(int fd, int operation); __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/ioctl.h0000666000000000000000000001230413571573400015327 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef FC_IOCTL #define FC_IOCTL // This file is neither in the C standard nor POSIX; it is here for // compatibility reasons. // For the ioctl() prototype #include "../stropts.h" /* Routing table calls. */ #define SIOCADDRT 0x890B /* add routing table entry */ #define SIOCDELRT 0x890C /* delete routing table entry */ #define SIOCRTMSG 0x890D /* call to routing system */ /* Socket configuration controls. */ #define SIOCGIFNAME 0x8910 /* get iface name */ #define SIOCSIFLINK 0x8911 /* set iface channel */ #define SIOCGIFCONF 0x8912 /* get iface list */ #define SIOCGIFFLAGS 0x8913 /* get flags */ #define SIOCSIFFLAGS 0x8914 /* set flags */ #define SIOCGIFADDR 0x8915 /* get PA address */ #define SIOCSIFADDR 0x8916 /* set PA address */ #define SIOCGIFDSTADDR 0x8917 /* get remote PA address */ #define SIOCSIFDSTADDR 0x8918 /* set remote PA address */ #define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ #define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ #define SIOCGIFNETMASK 0x891b /* get network PA mask */ #define SIOCSIFNETMASK 0x891c /* set network PA mask */ #define SIOCGIFMETRIC 0x891d /* get metric */ #define SIOCSIFMETRIC 0x891e /* set metric */ #define SIOCGIFMEM 0x891f /* get memory address (BSD) */ #define SIOCSIFMEM 0x8920 /* set memory address (BSD) */ #define SIOCGIFMTU 0x8921 /* get MTU size */ #define SIOCSIFMTU 0x8922 /* set MTU size */ #define SIOCSIFNAME 0x8923 /* set interface name */ #define SIOCSIFHWADDR 0x8924 /* set hardware address */ #define SIOCGIFENCAP 0x8925 /* get/set encapsulations */ #define SIOCSIFENCAP 0x8926 #define SIOCGIFHWADDR 0x8927 /* Get hardware address */ #define SIOCGIFSLAVE 0x8929 /* Driver slaving support */ #define SIOCSIFSLAVE 0x8930 #define SIOCADDMULTI 0x8931 /* Multicast address lists */ #define SIOCDELMULTI 0x8932 #define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */ #define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */ #define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */ #define SIOCGIFPFLAGS 0x8935 #define SIOCDIFADDR 0x8936 /* delete PA address */ #define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ #define SIOCGIFCOUNT 0x8938 /* get number of devices */ #define SIOCGIFBR 0x8940 /* Bridging support */ #define SIOCSIFBR 0x8941 /* Set bridging options */ #define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ #define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ /* ARP cache control calls. */ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ #define SIOCDARP 0x8953 /* delete ARP table entry */ #define SIOCGARP 0x8954 /* get ARP table entry */ #define SIOCSARP 0x8955 /* set ARP table entry */ /* RARP cache control calls. */ #define SIOCDRARP 0x8960 /* delete RARP table entry */ #define SIOCGRARP 0x8961 /* get RARP table entry */ #define SIOCSRARP 0x8962 /* set RARP table entry */ /* Driver configuration calls */ #define SIOCGIFMAP 0x8970 /* Get device parameters */ #define SIOCSIFMAP 0x8971 /* Set device parameters */ /* DLCI configuration calls */ #define SIOCADDDLCI 0x8980 /* Create new DLCI device */ #define SIOCDELDLCI 0x8981 /* Delete DLCI device */ /* Device private ioctl calls. */ /* These 16 ioctls are available to devices via the do_ioctl() device vector. Each device should include this file and redefine these names as their own. Because these are device dependent it is a good idea _NOT_ to issue them to random objects and hope. */ #define SIOCDEVPRIVATE 0x89F0 /* to 89FF */ /* * These 16 ioctl calls are protocol private */ #define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */ #endif frama-c-20.0-Calcium/share/libc/sys/ipc.h0000666000000000000000000000435013571573400014772 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_IPC_H__ #define __FC_SYS_IPC_H__ #include "../features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "../__fc_define_mode_t.h" #include "../__fc_define_uid_and_gid.h" #include "../__fc_define_key_t.h" struct ipc_perm { uid_t uid; gid_t gid; uid_t cuid; gid_t cgid; mode_t mode; }; // The values for the constants below are based on an x86 Linux, // declared in the order given by POSIX.1-2008. #define IPC_CREAT 01000 #define IPC_EXCL 02000 #define IPC_NOWAIT 04000 #define IPC_PRIVATE ((key_t) 0) #define IPC_RMID 0 #define IPC_SET 1 #define IPC_STAT 2 extern key_t ftok(const char *, int); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/mman.h0000666000000000000000000000726713571573400015161 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_MMAN_H__ #define __FC_SYS_MMAN_H__ #include "../features.h" #include "../__fc_define_mode_t.h" #include "../__fc_define_off_t.h" #include "../__fc_define_size_t.h" __PUSH_FC_STDLIB // The values for the constants below are based on an x86 Linux, // declared in the order given by POSIX.1-2008. #define PROT_EXEC 0x4 #define PROT_NONE 0x0 #define PROT_READ 0x1 #define PROT_WRITE 0x2 #define MAP_FIXED 0x10 #define MAP_PRIVATE 0x02 #define MAP_SHARED 0x01 // Non-POSIX, but used in some Linux code, so required for parsing #define MAP_ANONYMOUS 0x20 #define MAP_ANON MAP_ANONYMOUS #define MAP_SHARED_VALIDATE 0x03 #define MAP_FAILED ((void*) -1) #define MS_ASYNC 1 #define MS_INVALIDATE 2 #define MS_SYNC 4 #define MCL_CURRENT 1 #define MCL_FUTURE 2 #define POSIX_MADV_DONTNEED 4 #define POSIX_MADV_NORMAL 0 #define POSIX_MADV_RANDOM 1 #define POSIX_MADV_SEQUENTIAL 2 #define POSIX_MADV_WILLNEED 3 // Not currently defined in any Linux header //#define POSIX_TYPED_MEM_ALLOCATE //#define POSIX_TYPED_MEM_ALLOCATE_CONTIG //#define POSIX_TYPED_MEM_MAP_ALLOCATABLE // //struct posix_typed_mem_info { // size_t posix_tmi_length; //} extern int mlock (const void *addr, size_t len); extern int mlockall (int __flags); extern void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off); extern int mprotect (void *__addr, size_t __len, int __prot); extern int msync (void *__addr, size_t __len, int __flags); extern int munlock (const void *__addr, size_t __len); extern int munlockall (void); extern int munmap (void *__addr, size_t __len); extern int posix_madvise (void *__addr, size_t __len, int __advice); // Not currently defined in any Linux header //int posix_mem_offset(const void *restrict, size_t, off_t *restrict, // size_t *restrict, int *restrict); //int posix_typed_mem_get_info(int, struct posix_typed_mem_info *); //int posix_typed_mem_open(const char *, int, int); extern int shm_open (const char *__name, int __oflag, mode_t __mode); extern int shm_unlink (const char *__name); __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/random.h0000666000000000000000000000371413571573400015502 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef _SYS_RANDOM_H #define _SYS_RANDOM_H 1 #include "features.h" #include "../__fc_define_size_t.h" #include "../__fc_define_ssize_t.h" __PUSH_FC_STDLIB __BEGIN_DECLS extern ssize_t getrandom (void *__buffer, size_t __length, unsigned int __flags); extern int getentropy (void *__buffer, size_t __length); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/resource.h0000666000000000000000000000622313571573400016047 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_RESOURCE_H__ #define __FC_SYS_RESOURCE_H__ #include "../features.h" __PUSH_FC_STDLIB #include "time.h" #include "../__fc_define_id_t.h" #define PRIO_PROCESS 0 #define PRIO_PGRP 1 #define PRIO_USER 2 __BEGIN_DECLS typedef unsigned long rlim_t; struct rlimit { rlim_t rlim_cur; rlim_t rlim_max; }; struct rusage { struct timeval ru_utime; struct timeval ru_stime; }; #define RLIM_INFINITY 0xFFFFFFFFul #define RLIM_SAVED_MAX RLIM_INFINITY #define RLIM_SAVED_CUR RLIM_INFINITY #define RUSAGE_SELF 0 #define RUSAGE_CHILDREN 1 #define RLIMIT_CORE 0 #define RLIMIT_CPU 1 #define RLIMIT_DATA 2 #define RLIMIT_FSIZE 3 #define RLIMIT_NOFILE 4 #define RLIMIT_STACK 5 #define RLIMIT_AS 6 /*@ assigns \result \from which,who; */ extern int getpriority(int which, id_t who); /*@ assigns \result \from which,who,prio; */ extern int setpriority(int which, id_t who, int prio); /*@ requires valid_rlp: \valid(rlp); assigns \result, *rlp \from resource; */ extern int getrlimit(int resource, struct rlimit *rlp); /*@ requires valid_r_usage: \valid(r_usage); assigns *r_usage \from who; assigns \result \from indirect:who; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int getrusage(int who, struct rusage *r_usage); /*@ requires valid_rlp: \valid_read(rlp); assigns *rlp \from resource; assigns \result \from indirect:resource, indirect:*rlp; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int setrlimit(int resource, const struct rlimit *rlp); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/select.h0000666000000000000000000000340313571573400015474 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_SELECT_H__ #define __FC_SYS_SELECT_H__ #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "../__fc_select.h" __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/shm.h0000666000000000000000000000511713571573400015010 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_SHM_H__ #define __FC_SYS_SHM_H__ #include "../features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "../__fc_define_pid_t.h" #include "../__fc_define_size_t.h" #include "../__fc_define_time_t.h" // POSIX: "the header shall include the header." #include // The values for the constants below are based on an x86 Linux, // declared in the order given by POSIX.1-2008. #define SHM_RDONLY 010000 #define SHM_RND 020000 // TODO: parametrize the page size according to the machdep? #define __FC_PAGE_SIZE 4096 #define SHMLBA __FC_PAGE_SIZE typedef unsigned long shmatt_t; struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; pid_t shm_lpid; pid_t shm_cpid; shmatt_t shm_nattch; time_t shm_atime; time_t shm_dtime; time_t shm_ctime; }; extern void *shmat(int, const void *, int); extern int shmctl(int, int, struct shmid_ds *); extern int shmdt(const void *); extern int shmget(key_t, size_t, int); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/signal.h0000666000000000000000000000315413571573400015475 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "../signal.h" frama-c-20.0-Calcium/share/libc/sys/socket.h0000666000000000000000000004346413571573400015520 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SOCKET_H__ #define __FC_SOCKET_H__ #include "../features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "../__fc_machdep.h" #include "../errno.h" // Note: most constants used here are based on Linux, independently of the // chosen machdep. If using other OSs (e.g. MacOS), consider redefining them. #ifndef __socklen_t_defined typedef __UINT_LEAST32_T socklen_t; #define __socklen_t_defined #endif #include "../__fc_define_sa_family_t.h" #include "../__fc_define_sockaddr.h" /* Not POSIX compliant but seems needed for some functions... */ #include "../__fc_define_ssize_t.h" #include "../features.h" struct sockaddr_storage { sa_family_t ss_family; }; #include "sys/uio.h" struct cmsghdr { socklen_t cmsg_len; int cmsg_level; int cmsg_type; }; #define SCM_RIGHTS 0 struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; int msg_iovlen; void *msg_control; socklen_t msg_controllen; int msg_flags; }; // POSIX.1-2008 requires these to be defined as macros, but we have no body // for them, so we declare them as prototypes as well. #ifndef CMSG_FIRSTHDR extern struct cmsghdr *CMSG_FIRSTHDR(struct msghdr *msgh); # define CMSG_FIRSTHDR(h) CMSG_FIRSTHDR(h) #endif #ifndef CMSG_NXTHDR extern struct cmsghdr *CMSG_NXTHDR(struct msghdr *msgh, struct cmsghdr *cmsg); # define CMSG_NXTHDR(h, c) CMSG_NXTHDR(h, c) #endif #ifndef CMSG_ALIGN extern size_t CMSG_ALIGN(size_t length); # define CMSG_ALIGN(l) CMSG_ALIGN(l) #endif #ifndef CMSG_SPACE extern size_t CMSG_SPACE(size_t length); # define CMSG_SPACE(l) CMSG_SPACE(l) #endif #ifndef CMSG_LEN extern size_t CMSG_LEN(size_t length); # define CMSG_LEN(l) CMSG_LEN(l) #endif #ifndef CMSG_DATA extern unsigned char *CMSG_DATA(struct cmsghdr *cmsg); # define CMSG_DATA(c) CMSG_DATA(c) #endif /* Socket types. */ #define SOCK_STREAM 1 /* stream (connection) socket */ #define SOCK_DGRAM 2 /* datagram (conn.less) socket */ #define SOCK_RAW 3 /* raw socket */ #define SOCK_RDM 4 /* reliably-delivered message */ #define SOCK_SEQPACKET 5 /* sequential packet socket */ /* Protocol families (not described by POSIX) */ #define PF_UNSPEC 0 #define PF_LOCAL 1 #define PF_UNIX PF_LOCAL #define PF_FILE PF_LOCAL #define PF_INET 2 #define PF_AX25 3 #define PF_IPX 4 #define PF_APPLETALK 5 #define PF_NETROM 6 #define PF_BRIDGE 7 #define PF_ATMPVC 8 #define PF_X25 9 #define PF_INET6 10 #define PF_ROSE 11 #define PF_DECnet 12 #define PF_NETBEUI 13 #define PF_SECURITY 14 #define PF_KEY 15 #define PF_NETLINK 16 #define PF_ROUTE PF_NETLINK #define PF_PACKET 17 #define PF_ASH 18 #define PF_ECONET 19 #define PF_ATMSVC 20 #define PF_RDS 21 #define PF_SNA 22 #define PF_IRDA 23 #define PF_PPPOX 24 #define PF_WANPIPE 25 #define PF_LLC 26 #define PF_IB 27 #define PF_MPLS 28 #define PF_CAN 29 #define PF_TIPC 30 #define PF_BLUETOOTH 31 #define PF_IUCV 32 #define PF_RXRPC 33 #define PF_ISDN 34 #define PF_PHONET 35 #define PF_IEEE802154 36 #define PF_CAIF 37 #define PF_ALG 38 #define PF_NFC 39 #define PF_VSOCK 40 #define PF_KCM 41 #define PF_QIPCRTR 42 #define PF_MAX 43 /* Address families (only AF_INET, AF_INET6, AF_UNIX and AF_UNSPEC are described in POSIX; AF_INET6 is optional) */ #define AF_UNSPEC 0 #define AF_LOCAL PF_LOCAL #define AF_UNIX PF_UNIX #define AF_FILE PF_FILE #define AF_INET PF_INET #define AF_AX25 PF_AX25 #define AF_IPX PF_IPX #define AF_APPLETALK PF_APPLETALK #define AF_NETROM PF_NETROM #define AF_BRIDGE PF_BRIDGE #define AF_ATMPVC PF_ATMPVC #define AF_X25 PF_X25 #define AF_INET6 PF_INET6 #define AF_ROSE PF_ROSE #define AF_DECnet PF_DECnet #define AF_NETBEUI PF_NETBEUI #define AF_SECURITY PF_SECURITY #define AF_KEY PF_KEY #define AF_NETLINK PF_NETLINK #define AF_ROUTE PF_ROUTE #define AF_PACKET PF_PACKET #define AF_ASH PF_ASH #define AF_ECONET PF_ECONET #define AF_ATMSVC PF_ATMSVC #define AF_RDS PF_RDS #define AF_SNA PF_SNA #define AF_IRDA PF_IRDA #define AF_PPPOX PF_PPPOX #define AF_WANPIPE PF_WANPIPE #define AF_LLC PF_LLC #define AF_IB PF_IB #define AF_MPLS PF_MPLS #define AF_CAN PF_CAN #define AF_TIPC PF_TIPC #define AF_BLUETOOTH PF_BLUETOOTH #define AF_IUCV PF_IUCV #define AF_RXRPC PF_RXRPC #define AF_ISDN PF_ISDN #define AF_PHONET PF_PHONET #define AF_IEEE802154 PF_IEEE802154 #define AF_CAIF PF_CAIF #define AF_ALG PF_ALG #define AF_NFC PF_NFC #define AF_VSOCK PF_VSOCK #define AF_KCM PF_KCM #define AF_QIPCRTR PF_QIPCRTR #define AF_MAX PF_MAX #define SOL_SOCKET 1 #define SO_DEBUG 1 #define SO_REUSEADDR 2 #define SO_TYPE 3 #define SO_ERROR 4 #define SO_DONTROUTE 5 #define SO_BROADCAST 6 #define SO_SNDBUF 7 #define SO_RCVBUF 8 #define SO_SNDBUFFORCE 32 #define SO_RCVBUFFORCE 33 #define SO_KEEPALIVE 9 #define SO_OOBINLINE 10 #define SO_NO_CHECK 11 #define SO_PRIORITY 12 #define SO_LINGER 13 #define SO_BSDCOMPAT 14 #define SO_REUSEPORT 15 #define SO_PASSCRED 16 #define SO_PEERCRED 17 #define SO_RCVLOWAT 18 #define SO_SNDLOWAT 19 #define SO_RCVTIMEO 20 #define SO_SNDTIMEO 21 #define SO_SECURITY_AUTHENTICATION 22 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 #define SO_SECURITY_ENCRYPTION_NETWORK 24 #define SO_BINDTODEVICE 25 #define SO_ATTACH_FILTER 26 #define SO_DETACH_FILTER 27 #define SO_GET_FILTER SO_ATTACH_FILTER #define SO_PEERNAME 28 #define SO_TIMESTAMP 29 #define SCM_TIMESTAMP SO_TIMESTAMP #define SO_ACCEPTCONN 30 #define SO_PEERSEC 31 #define SO_PASSSEC 34 #define SO_TIMESTAMPNS 35 #define SCM_TIMESTAMPNS SO_TIMESTAMPNS #define SO_MARK 36 #define SO_TIMESTAMPING 37 #define SCM_TIMESTAMPING SO_TIMESTAMPING #define SO_PROTOCOL 38 #define SO_DOMAIN 39 #define SO_RXQ_OVFL 40 #define SO_WIFI_STATUS 41 #define SCM_WIFI_STATUS SO_WIFI_STATUS #define SO_PEEK_OFF 42 #define SO_NOFCS 43 #define SO_LOCK_FILTER 44 #define SO_SELECT_ERR_QUEUE 45 #define SO_BUSY_POLL 46 #define SO_MAX_PACING_RATE 47 #define SO_BPF_EXTENSIONS 48 #define SO_INCOMING_CPU 49 #define SO_ATTACH_BPF 50 #define SO_DETACH_BPF SO_DETACH_FILTER #define SO_ATTACH_REUSEPORT_CBPF 51 #define SO_ATTACH_REUSEPORT_EBPF 52 #define SO_CNX_ADVICE 53 #define SCM_TIMESTAMPING_OPT_STATS 54 #define SO_MEMINFO 55 #define SO_INCOMING_NAPI_ID 56 #define SO_COOKIE 57 #define SCM_TIMESTAMPING_PKTINFO 58 #define SO_PEERGROUPS 59 #define SOMAXCONN 128 enum __fc_shutdown { SHUT_RD, SHUT_WR, SHUT_RDWR }; // POSIX requires these SHUT_* constants to be defined as macros #define SHUT_RD SHUT_RD #define SHUT_WR SHUT_WR #define SHUT_RDWR SHUT_RDWR #ifndef __FC_MAX_OPEN_SOCKETS // arbitrary number #define __FC_MAX_OPEN_SOCKETS 1024 #endif // Allows different implementations for internal socket structures #ifndef __FC_INTERNAL_SOCKFDS_PROVIDED struct __fc_sockfds_type { int x; }; #endif //@ ghost struct __fc_sockfds_type __fc_sockfds[__FC_MAX_OPEN_SOCKETS]; /* Represents the creation of new file descriptors for sockets. */ //@ ghost extern int __fc_socket_counter __attribute__((__FRAMA_C_MODEL__)); // __fc_sockfds represents the state of open socket descriptors. //@ ghost volatile int __fc_open_sock_fds; // TODO: Model the state of some functions more precisely. /*@ requires valid_sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; assigns \result, *(((char *)addr)+(0 .. *addrlen-1)), __fc_sockfds[sockfd] \from *addr, *addrlen, __fc_sockfds[sockfd]; ensures result_error_or_valid_new_sockfd: \result == -1 || 0 <= \result < __FC_MAX_OPEN_SOCKETS; behavior addr_null: assumes addr_is_null: addr == \null; requires addrlen_should_be_null: addrlen == \null; assigns \result, __fc_sockfds[sockfd] \from __fc_sockfds[sockfd]; behavior addr_not_null: assumes addr_is_not_null: addr != \null; requires valid_addrlen: \valid(addrlen); requires addr_has_room: \valid(((char *)addr)+(0 .. *addrlen-1)); ensures initialization:addr: \initialized(((char *)addr)+(0..*addrlen-1)); disjoint behaviors; // TODO: check what to do when the buffer addr is too small */ extern int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); /*@ requires valid_sockfd: sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; requires valid_read_addr: \valid_read(((char*)addr)+(0..addrlen-1)); assigns __fc_sockfds[sockfd] \from sockfd, *addr, addrlen, __fc_sockfds[sockfd]; assigns \result \from indirect:sockfd, indirect:*addr, indirect:addrlen, indirect:__fc_sockfds[sockfd]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); /*@ // ideally, we should check whether addrlen is compatible with the kind of // socket of [sockfd] (created by calling socket()). requires valid_sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; requires valid_read_addr: \valid_read(((char*)addr)+(0 .. addrlen-1)); assigns __fc_sockfds[sockfd] \from __fc_sockfds[sockfd], indirect:sockfd, indirect:addr, indirect:*addr, indirect:addrlen; assigns \result \from indirect:__fc_sockfds[sockfd], indirect:sockfd, indirect:addr, indirect:*addr, indirect:addrlen; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); extern int getpeername(int, struct sockaddr *, socklen_t *); extern int getsockname(int, struct sockaddr *, socklen_t *); // getsockopt is incrementally specified: options which are used more often // are gradually refined; the rest are handled by behavior "other_options". // Note: this specification may be more restrictive than what the manpage says, // to allow for a more precise analysis. It should however correspond to // expected usage. /*@ requires valid_sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; requires valid_optlen: \valid(optlen); assigns ((char*)optval)[0..], \result \from indirect:sockfd, indirect:level, indirect:optname, indirect:*optlen, indirect:optval, indirect:__fc_sockfds[sockfd]; assigns *optlen \from indirect:sockfd, indirect:level, indirect:optname, *optlen, indirect:optval, indirect:__fc_sockfds[sockfd]; ensures result_ok_or_error: \result == 0 || \result == -1; behavior so_error: assumes optname_is_error: level == SOL_SOCKET && optname == SO_ERROR; requires valid_optlen: \valid(optlen); requires optlen_value: *optlen == sizeof(int); requires valid_optval: \valid((int*)optval); assigns *(int*)optval, \result \from indirect:sockfd, indirect:optlen, indirect:__fc_sockfds[sockfd]; behavior other_options: assumes optname_not_error: !(level == SOL_SOCKET && optname == SO_ERROR); requires optval_null_or_valid: optval == \null || \valid(((char*)optval)+(0..)); assigns ((char*)optval)[0..], \result \from indirect:sockfd, indirect:level, indirect:optname, indirect:*optlen, indirect:optval, indirect:__fc_sockfds[sockfd]; assigns *optlen \from indirect:sockfd, indirect:level, indirect:optname, *optlen, indirect:optval, indirect:__fc_sockfds[sockfd]; disjoint behaviors; complete behaviors; */ extern int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); /*@ requires valid_sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; assigns \result \from sockfd, __fc_sockfds[sockfd]; assigns __fc_sockfds[sockfd] \from sockfd, backlog, __fc_sockfds[sockfd]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int listen(int sockfd, int backlog); /* Flags for passing to recv() and others */ #define MSG_OOB 0x1 #define MSG_PEEK 0x2 #define MSG_DONTROUTE 0x4 #define MSG_CTRUNC 0x8 #define MSG_PROXY 0x10 #define MSG_TRUNC 0x20 #define MSG_DONTWAIT 0x40 #define MSG_EOR 0x80 #define MSG_WAITALL 0x100 #define MSG_FIN 0x200 #define MSG_SYN 0x400 #define MSG_CONFIRM 0x800 #define MSG_RST 0x1000 #define MSG_RSTERRQUEUE 0x2000 #define MSG_NOSIGNAL 0x4000 #define MSG_MORE 0x8000 #define MSG_WAITFORONE 0x10000 #define MSG_BATCH 0x40000 #define MSG_FASTOPEN 0x20000000 #define MSG_CMSG_CLOEXEC 0x40000000 /*@ requires valid_sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; requires valid_buffer_length: \valid((char *)buf+(0 .. len-1)); assigns *((char *)buf+(0 .. len-1)), __fc_sockfds[sockfd], \result \from sockfd, len, flags, __fc_sockfds[sockfd]; ensures result_error_or_received_length: \result == -1 || 0 <= \result <= len; ensures initialization: \initialized(((char *)buf+(0 .. \result-1))); */ extern ssize_t recv(int sockfd, void * buf, size_t len, int flags); extern ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); /*@ requires valid_sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; @ requires msg_control_has_room: @ \valid(&((char *)hdr->msg_control)[0..hdr->msg_controllen-1]); @ requires msg_iov_has_room: \valid(&(hdr->msg_iov[0..hdr->msg_iovlen-1])); @ requires msg_name_null_or_has_room: hdr->msg_name == \null @ || \valid(&((char *)hdr->msg_name)[0..hdr->msg_namelen-1]); @ assigns ((char *)hdr->msg_name)[0..hdr->msg_namelen-1] @ \from __fc_sockfds[sockfd]; @ assigns hdr->msg_namelen \from __fc_sockfds[sockfd]; @ assigns ((char *)hdr->msg_iov[0..hdr->msg_iovlen-1].iov_base)[0..] @ \from __fc_sockfds[sockfd]; @ assigns ((char *)hdr->msg_control)[0..hdr->msg_controllen-1] @ \from __fc_sockfds[sockfd]; @ assigns \result \from __fc_sockfds[sockfd]; @ assigns hdr->msg_controllen \from __fc_sockfds[sockfd]; @ assigns hdr->msg_flags \from __fc_sockfds[sockfd]; @ assigns __fc_sockfds[sockfd] \from __fc_sockfds[sockfd]; @ ensures result_error_or_received_length: @ \result == -1 || 0 <= \result <= hdr->msg_iovlen; */ extern ssize_t recvmsg(int sockfd, struct msghdr *hdr, int flags); /*@ requires available_sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; requires buf_len_ok: \valid_read(((char*)buf)+(0 .. len - 1)); assigns errno \from indirect:sockfd, indirect:__fc_sockfds[sockfd], indirect:((char *)buf)[0..len], flags; assigns __fc_sockfds[sockfd] \from __fc_sockfds[sockfd], ((char *)buf)[0..len], flags; assigns \result \from indirect:sockfd, indirect:__fc_sockfds[sockfd], indirect:((char*)buf)[0..len], indirect:flags; ensures error_or_chars_sent: \result == -1 || 0 <= \result <= len; */ extern ssize_t send(int sockfd, const void *buf, size_t len, int flags); extern ssize_t sendmsg(int, const struct msghdr *, int); extern ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); /*@ requires valid_sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; requires optval_null_or_has_room: optval == \null || \valid_read(((char *)optval)+(0..optlen-1)); assigns \result, __fc_sockfds[sockfd] \from __fc_sockfds[sockfd], level, optname, ((char *)optval)[0..optlen-1], optlen; ensures result_error_or_ok: \result == 0 || \result == -1; */ extern int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen); /*@ requires valid_sockfd: 0 <= sockfd < __FC_MAX_OPEN_SOCKETS; assigns \result, __fc_sockfds[sockfd] \from how, __fc_sockfds[sockfd]; ensures result_error_or_ok: \result == 0 || \result == -1; */ extern int shutdown(int sockfd, int how); extern int sockatmark(int); /*@ assigns \result \from indirect:domain, indirect:type, indirect:protocol, indirect:__fc_socket_counter; assigns __fc_socket_counter \from indirect:domain, indirect:type, indirect:protocol, __fc_socket_counter; ensures result_error_or_valid_new_sockfd: 0 <= \result < __FC_MAX_OPEN_SOCKETS || \result == -1; */ extern int socket(int domain, int type, int protocol); extern int sockatmark(int); /*@ requires valid_socket_sector: \valid(&sv[0..1]); @ assigns \result, __fc_socket_counter, sv[0..1] \from @ __fc_socket_counter; @ ensures result_error_or_ok: \result == 0 || \result == -1; @ ensures initialization:sv: \initialized(&sv[0..1]); @ ensures valid_new_sockfd:sv0: 0 <= sv[0] < __FC_MAX_OPEN_SOCKETS; @ ensures valid_new_sockfd:sv1: 0 <= sv[1] < __FC_MAX_OPEN_SOCKETS; @*/ extern int socketpair(int domain, int type, int protocol, int sv[2]); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/stat.h0000666000000000000000000000612413571573400015173 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_STAT_H #define __FC_SYS_STAT_H #include "features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "../__fc_define_stat.h" #include "../__fc_string_axiomatic.h" extern int chmod(const char *, mode_t); extern int fchmod(int, mode_t); extern int fstat(int, struct stat *); extern int lstat(const char *, struct stat *); /*@ // missing: may assign to errno: EACCES, EEXIST, ELOOP, EMLINK, // ENAMETOOLONG, ENOENT, ENOSPC, // ENOTDIR, EROFS // missing: assigns \result \from 'filesystem' requires valid_string_path: valid_read_string(path); assigns \result \from indirect:path, indirect:path[0..], indirect:mode; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int mkdir(const char *path, mode_t mode); extern int mkfifo(const char *, mode_t); extern int mknod(const char *, mode_t, dev_t); /*@ //missing: assigns \from 'filesystem' requires valid_pathname: valid_read_string(pathname); requires valid_buf: \valid(buf); assigns \result, *buf \from pathname[0..]; ensures result_ok_or_error: \result == 0 || \result == -1; ensures init_on_success:initialization:buf: \result == 0 ==> \initialized(buf); */ extern int stat(const char *pathname, struct stat *buf); /*@ //missing: assigns 'process umask' \from cmask; //missing: assigns \result \from 'old process umask' assigns \result \from indirect:cmask; */ extern mode_t umask(mode_t cmask); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/time.h0000666000000000000000000002255013571573400015157 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_TIME_H__ #define __FC_SYS_TIME_H__ #include "../features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "../__fc_define_time_t.h" #include "../__fc_define_suseconds_t.h" #include "../__fc_define_fd_set_t.h" #include "../__fc_define_timespec.h" #include "../__fc_string_axiomatic.h" struct timeval { time_t tv_sec; suseconds_t tv_usec; }; struct timezone { int tz_minuteswest; int tz_dsttime; }; /* Abstract representation of the current time. */ //@ ghost volatile unsigned int __fc_time __attribute__((FRAMA_C_MODEL)); //@ ghost extern int __fc_tz __attribute__((FRAMA_C_MODEL)); /*@ requires valid_path: valid_read_string(path); requires valid_times_or_null: \valid_read(times+(0..1)) || times == \null; assigns \result \from indirect:path[0..strlen(path)], indirect:times, indirect:times[0..1]; */ extern int utimes(const char *path, const struct timeval times[2]); /*@ assigns tv->tv_sec, tv->tv_usec \from __fc_time; @ assigns *(struct timezone *)tz \from __fc_tz; @ assigns \result \from indirect:tv, indirect:tz, *tv, *(struct timezone *)tz, __fc_tz; @ ensures result_ok_or_error: \result == 0 || \result == -1; @ behavior tv_and_tz_null: @ assumes null_tv_tz: tv == \null && tz == \null; @ assigns \result \from indirect:__fc_tz; @ @ behavior tv_not_null: @ assumes non_null_tv_null_tz: tv != \null && tz == \null; @ assigns tv->tv_sec, tv->tv_usec \from indirect:__fc_time; @ assigns \result \from indirect:*tv, indirect:__fc_tz; @ ensures initialization:tv_sec:tv_usec: @ \initialized(&tv->tv_sec) && \initialized(&tv->tv_usec); @ ensures tv_usec_bounded: 0 <= tv->tv_usec <= 999999; @ @ behavior tz_not_null: @ assumes null_tv_non_null_tz: tv == \null && tz != \null; @ assigns *(struct timezone *)tz \from __fc_tz; @ assigns \result \from indirect:*(struct timezone *)tz, indirect:__fc_tz; @ ensures initialization:tz: \initialized((struct timezone *)tz); @ @ behavior tv_and_tz_not_null: @ assumes non_null_tv_tz: tv != \null && tz != \null; @ assigns tv->tv_sec, tv->tv_usec \from indirect:__fc_time; @ assigns *(struct timezone *)tz \from __fc_tz; @ assigns \result \from indirect:*tv, indirect:*(struct timezone *)tz, indirect:__fc_tz; @ ensures initialization:tv_sec:tv_usec: @ \initialized(&tv->tv_sec) && \initialized(&tv->tv_usec); @ ensures initialization:tz: \initialized((struct timezone *)tz); @ @ complete behaviors; @ disjoint behaviors; @*/ extern int gettimeofday(struct timeval * restrict tv, void * restrict tz); /*@ requires valid_tv_or_null: \valid_read(tv) || tv == \null; requires valid_tz_or_null: \valid_read(tz) || tz == \null; assigns __fc_time, __fc_tz \from tv->tv_sec, tv->tv_usec, tz->tz_dsttime, tz->tz_minuteswest; assigns \result \from indirect:*tv, indirect:*tz; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int settimeofday(const struct timeval *tv, const struct timezone *tz); #if (defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE) >= 200112L) || \ (defined _XOPEN_SOURCE && (_XOPEN_SOURCE) >= 600) #define ITIMER_REAL 0 #define ITIMER_VIRTUAL 1 #define ITIMER_PROF 2 struct itimerval { struct timeval it_interval; /* timer interval */ struct timeval it_value; /* current value */ }; /* Abstract representation of interval timers. */ //@ ghost volatile struct itimerval __fc_itimer_real __attribute__((FRAMA_C_MODEL)); //@ ghost volatile struct itimerval __fc_itimer_virtual __attribute__((FRAMA_C_MODEL)); //@ ghost volatile struct itimerval __fc_itimer_prof __attribute__((FRAMA_C_MODEL)); // NOTE: for functions setitimer/getitimer, we do not currently model // the signals generated by the timers when they reach zero. /*@ requires valid_curr_value: \valid(curr_value); assigns \result \from indirect:which; assigns *curr_value \from __fc_itimer_real, __fc_itimer_virtual, __fc_itimer_prof; ensures initialization:curr_value: \initialized(curr_value); behavior real: assumes itimer_real: which == ITIMER_REAL; assigns \result \from \nothing; assigns *curr_value \from __fc_itimer_real; ensures result_ok: \result == 0; behavior virtual: assumes itimer_virtual: which == ITIMER_VIRTUAL; assigns \result \from \nothing; assigns *curr_value \from __fc_itimer_virtual; ensures result_ok: \result == 0; behavior prof: assumes itimer_prof: which == ITIMER_PROF; assigns \result \from \nothing; assigns *curr_value \from __fc_itimer_prof; ensures result_ok: \result == 0; behavior invalid: assumes invalid_which: which != ITIMER_REAL && which != ITIMER_VIRTUAL && which != ITIMER_PROF; assigns \result \from \nothing; ensures result_error: \result == -1; complete behaviors; disjoint behaviors; */ extern int getitimer(int which, struct itimerval *curr_value); // TODO: replace with a predicate, when Value will be able to evalute it // precisely #define __VALID_ITIMERVAL(tv) (0 <= (tv)->it_value.tv_usec <= 999999 && \ 0 <= (tv)->it_interval.tv_usec <= 999999) // Note: this specification is more strict than POSIX, since we forbid new_value // from being NULL. // Note: old_value depends on new_value because e.g. if new_value contains // an invalid tv_usec field, the function may fail. /*@ requires valid_new_value: \valid_read(new_value); requires old_value_null_or_valid: old_value == \null || \valid(old_value); assigns *old_value \from indirect:which, indirect:old_value, indirect:new_value, __fc_itimer_real, __fc_itimer_virtual, __fc_itimer_prof; assigns \result \from indirect:which, indirect:new_value, indirect:*new_value; ensures result_ok_or_error: \result == 0 || \result == -1; behavior real: assumes itimer_real_and_valid: which == ITIMER_REAL && __VALID_ITIMERVAL(new_value); assigns \result \from \nothing; assigns *old_value \from __fc_itimer_real; assigns __fc_itimer_real \from *new_value; ensures result_ok: \result == 0; ensures initialization:old_value: \initialized(old_value); behavior virtual: assumes itimer_virtual_and_valid: which == ITIMER_VIRTUAL && __VALID_ITIMERVAL(new_value); assigns \result \from \nothing; assigns *old_value \from __fc_itimer_virtual; ensures result_ok: \result == 0; ensures initialization:old_value: \initialized(old_value); behavior prof: assumes itimer_prof_and_valid: which == ITIMER_PROF && __VALID_ITIMERVAL(new_value); assigns \result \from \nothing; assigns *old_value \from __fc_itimer_prof; ensures result_ok: \result == 0; ensures initialization:old_value: \initialized(old_value); behavior invalid: assumes invalid_itimer_or_new_value: (which != ITIMER_REAL && which != ITIMER_VIRTUAL && which != ITIMER_PROF) || !__VALID_ITIMERVAL(new_value); assigns \result \from \nothing; ensures result_error: \result == -1; disjoint behaviors; */ extern int setitimer (int which, const struct itimerval *restrict new_value, struct itimerval *restrict old_value); #endif // Non-POSIX, non-C99 functions (present in Linux and most BSDs) extern void timeradd(struct timeval *a, struct timeval *b, struct timeval *res); extern void timersub(struct timeval *a, struct timeval *b, struct timeval *res); extern void timerclear(struct timeval *tvp); extern int timerisset(struct timeval *tvp); #define timercmp(a, b, _CMP) _timercmp(a, b) extern int _timercmp(struct timeval *a, struct timeval *b); // From POSIX, and for better compatibility with existing code bases: // "Inclusion of the header may make visible all symbols // from the header." #include "select.h" __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/times.h0000666000000000000000000000372113571573400015341 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_TIMES_H__ #define __FC_SYS_TIMES_H__ #include "../features.h" __PUSH_FC_STDLIB #include "../time.h" struct tms { clock_t tms_utime; clock_t tms_stime; clock_t tms_cutime; clock_t tms_cstime; }; /*@ requires valid_buffer: \valid(buffer); assigns \result, *buffer \from __fc_time; */ extern clock_t times (struct tms *buffer); __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/timex.h0000666000000000000000000000645613571573400015356 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef _SYS_TIMEX_H #define _SYS_TIMEX_H 1 #include "features.h" #include "stdint.h" #include "time.h" __PUSH_FC_STDLIB __BEGIN_DECLS #define ADJ_OFFSET 0x0001 #define ADJ_FREQUENCY 0x0002 #define ADJ_MAXERROR 0x0004 #define ADJ_ESTERROR 0x0008 #define ADJ_STATUS 0x0010 #define ADJ_TIMECONST 0x0020 #define ADJ_TICK 0x4000 #define ADJ_OFFSET_SINGLESHOT 0x8001 #define MOD_OFFSET ADJ_OFFSET #define MOD_FREQUENCY ADJ_FREQUENCY #define MOD_MAXERROR ADJ_MAXERROR #define MOD_ESTERROR ADJ_ESTERROR #define MOD_STATUS ADJ_STATUS #define MOD_TIMECONST ADJ_TIMECONST #define MOD_CLKB ADJ_TICK #define MOD_CLKA ADJ_OFFSET_SINGLESHOT #define STA_PLL 0x0001 #define STA_PPSFREQ 0x0002 #define STA_PPSTIME 0x0004 #define STA_FLL 0x0008 #define STA_INS 0x0010 #define STA_DEL 0x0020 #define STA_UNSYNC 0x0040 #define STA_FREQHOLD 0x0080 #define STA_PPSSIGNAL 0x0100 #define STA_PPSJITTER 0x0200 #define STA_PPSWANDER 0x0400 #define STA_PPSERROR 0x0800 #define STA_CLOCKERR 0x1000 #define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ STA_PPSERROR | STA_CLOCKERR) #define TIME_OK 0 #define TIME_INS 1 #define TIME_DEL 2 #define TIME_OOP 3 #define TIME_WAIT 4 #define TIME_ERROR 5 #define TIME_BAD TIME_ERROR struct timex { unsigned int modes; int64_t offset; int64_t freq; int64_t maxerror; int64_t esterror; int status; int64_t constant; int64_t precision; int64_t tolerance; struct timeval time; int64_t tick; int64_t ppsfreq; int64_t jitter; int shift; int64_t stabil; int64_t jitcnt; int64_t calcnt; int64_t errcnt; int64_t stbcnt; int tai; int32_t _padding[11]; }; extern int adjtimex(struct timex *buf); extern int ntp_adjtime(struct timex *buf); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/types.h0000666000000000000000000000504013571573400015360 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_TYPES_H__ #define __FC_SYS_TYPES_H__ #include "../features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "../__fc_machdep.h" #include "../__fc_define_id_t.h" #include "../__fc_define_pid_t.h" #include "../__fc_define_size_t.h" #include "../__fc_define_ssize_t.h" #include "../__fc_define_uid_and_gid.h" #include "../__fc_define_time_t.h" #include "../__fc_define_suseconds_t.h" #include "../__fc_define_ino_t.h" #include "../__fc_define_blkcnt_t.h" #include "../__fc_define_blksize_t.h" #include "../__fc_define_dev_t.h" #include "../__fc_define_mode_t.h" #include "../__fc_define_nlink_t.h" #include "../__fc_define_off_t.h" #include "../__fc_define_pthread_types.h" #include "../__fc_define_key_t.h" #ifndef __u_char_defined typedef unsigned long u_long; typedef unsigned int u_int; typedef unsigned short u_short; typedef unsigned char u_char; extern dev_t makedev(int maj, int min); #define __u_char_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/uio.h0000666000000000000000000000437613571573400015023 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef FC_UIO #define FC_UIO #include "../features.h" __PUSH_FC_STDLIB #include "../__fc_define_ssize_t.h" #include "../__fc_define_size_t.h" #include "../__fc_define_iovec.h" __BEGIN_DECLS /*@ requires valid_read_iov: \valid_read( &iov[0..iovcnt-1] ); // Value cannot yet interpret the precise assigns clause; we use the weaker one as a fallback. //@ assigns { ((char *) iov[i].iov_base)[0..iov[i].iov_len - 1] | integer i; 0 <= i < iovcnt }; @ assigns ((char *) iov[0..iovcnt -1].iov_base)[0..]; */ extern ssize_t readv(int fd, const struct iovec *iov, int iovcnt); extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/un.h0000666000000000000000000000376313571573400014650 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef FC_UN #define FC_UN #include "../features.h" __PUSH_FC_STDLIB __BEGIN_DECLS #include "../__fc_define_sa_family_t.h" struct sockaddr_un { sa_family_t sun_family; // Note: the length has been hard-coded to the value typically found in // Linux. Move it to the machdep to support other implementations. char sun_path[108]; /* Path name. */ }; __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/utsname.h0000666000000000000000000000403113571573400015667 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_UTSNAME_H__ #define __FC_SYS_UTSNAME_H__ #include "../features.h" __PUSH_FC_STDLIB // Arbitrary length, based on the one used in Linux #define _FC_UTSNAME_LENGTH 65 struct utsname { char sysname[_FC_UTSNAME_LENGTH]; char nodename[_FC_UTSNAME_LENGTH]; char release[_FC_UTSNAME_LENGTH]; char version[_FC_UTSNAME_LENGTH]; char machine[_FC_UTSNAME_LENGTH]; }; extern int uname (struct utsname *name); __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/sys/wait.h0000666000000000000000000001041213571573400015157 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYS_WAIT_H__ #define __FC_SYS_WAIT_H__ #include "../features.h" __PUSH_FC_STDLIB __BEGIN_DECLS // The values for the constants/macros below are based on the glibc on // an x86 Linux, declared in the order given by POSIX.1-2008. #define WNOHANG 1 #define WCONTINUED 8 #define WUNTRACED 2 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) #define WIFCONTINUED(status) ((status) == 0xffff) #define WIFEXITED(status) (((status) & 0x7f) == 0) #define WIFSIGNALED(status) (((signed char) (((status) & 0x7f) + 1) >> 1) > 0) #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) #define WSTOPSIG(status) WEXITSTATUS(status) #define WTERMSIG(status) ((status) & 0x7f) #define WEXITED 4 #define WNOWAIT 0x01000000 #define WSTOPPED 2 #include "../__fc_define_id_t.h" #include "../__fc_define_pid_t.h" #include "../__fc_define_uid_and_gid.h" #include "../signal.h" # ifndef __ENUM_IDTYPE_T # define __ENUM_IDTYPE_T 1 typedef enum __FC_IDTYPE_T { P_ALL, P_PID, P_PGID } idtype_t; #endif /*@ //missing: assigns \result \from 'child processes' //missing: terminates 'depending on child processes' //missing: may set errno to ECHILD or EINTR assigns \result \from \nothing; assigns *stat_loc \from \nothing; ensures result_ok_or_error: \result == -1 || \result >= 0; ensures initialization:stat_loc_init_on_success: \result >= 0 && stat_loc != \null ==> \initialized(stat_loc); behavior stat_loc_null: assumes stat_loc_null: stat_loc == \null; assigns \result \from \nothing; behavior stat_loc_non_null: assumes stat_loc_non_null: stat_loc != \null; requires valid_stat_loc: \valid(stat_loc); //missing: assigns *stat_loc \from 'child processes' */ extern pid_t wait(int *stat_loc); extern int waitid(idtype_t idt, id_t id, siginfo_t * sig, int options); /*@ //missing: assigns \result \from 'child processes' //missing: terminates 'depending on child processes' //missing: may set errno to ECHILD, EINTR or EINVAL assigns \result \from indirect:options; assigns *stat_loc \from indirect:options; ensures result_ok_or_error: \result == -1 || \result >= 0; ensures initialization:stat_loc_init_on_success: \result >= 0 && stat_loc != \null ==> \initialized(stat_loc); behavior stat_loc_null: assumes stat_loc_null: stat_loc == \null; assigns \result \from \nothing; behavior stat_loc_non_null: assumes stat_loc_non_null: stat_loc != \null; requires valid_stat_loc: \valid(stat_loc); //missing: assigns *stat_loc \from 'child processes' */ extern pid_t waitpid(pid_t pid, int *stat_loc, int options); #include "resource.h" // non-POSIX extern pid_t wait3(int *, int, struct rusage *); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/syslog.h0000666000000000000000000001305313571573400014721 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_SYSLOG_H #define __FC_SYSLOG_H #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_null.h" #include "stdarg.h" __BEGIN_DECLS typedef struct __fc_code { const char *c_name; int c_val; } CODE; #define LOG_PID 0x01 /* log the pid with each message */ #define LOG_CONS 0x02 /* log on the console if errors in sending */ #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ #define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ #define LOG_PERROR 0x20 /* log to stderr as well */ #define LOG_KERN (0<<3) /* kernel messages */ #define LOG_USER (1<<3) /* random user-level messages */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* security/authorization messages */ #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ #define LOG_LPR (6<<3) /* line printer subsystem */ #define LOG_NEWS (7<<3) /* network news subsystem */ #define LOG_UUCP (8<<3) /* UUCP subsystem */ #define LOG_CRON (9<<3) /* clock daemon */ #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ #define LOG_FTP (11<<3) /* ftp daemon */ /* other codes through 15 reserved for system use */ #define LOG_LOCAL0 (16<<3) /* reserved for local use */ #define LOG_LOCAL1 (17<<3) /* reserved for local use */ #define LOG_LOCAL2 (18<<3) /* reserved for local use */ #define LOG_LOCAL3 (19<<3) /* reserved for local use */ #define LOG_LOCAL4 (20<<3) /* reserved for local use */ #define LOG_LOCAL5 (21<<3) /* reserved for local use */ #define LOG_LOCAL6 (22<<3) /* reserved for local use */ #define LOG_LOCAL7 (23<<3) /* reserved for local use */ #define LOG_NFACILITIES 24 /* current number of facilities */ #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ /* facility of pri */ #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) #define LOG_PRIMASK 0x07 #define LOG_PRI(p) ((p) & LOG_PRIMASK) #define LOG_MAKEPRI(fac, pri) ((fac) | (pri)) #define INTERNAL_NOPRI 0x10 /* the "no priority" priority */ /* mark "facility" */ #define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0) CODE facilitynames[] = { { "auth", LOG_AUTH }, { "authpriv", LOG_AUTHPRIV }, { "cron", LOG_CRON }, { "daemon", LOG_DAEMON }, { "ftp", LOG_FTP }, { "kern", LOG_KERN }, { "lpr", LOG_LPR }, { "mail", LOG_MAIL }, { "mark", INTERNAL_MARK }, /* INTERNAL */ { "news", LOG_NEWS }, { "security", LOG_AUTH }, /* DEPRECATED */ { "syslog", LOG_SYSLOG }, { "user", LOG_USER }, { "uucp", LOG_UUCP }, { "local0", LOG_LOCAL0 }, { "local1", LOG_LOCAL1 }, { "local2", LOG_LOCAL2 }, { "local3", LOG_LOCAL3 }, { "local4", LOG_LOCAL4 }, { "local5", LOG_LOCAL5 }, { "local6", LOG_LOCAL6 }, { "local7", LOG_LOCAL7 }, { NULL, -1 } }; #define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ #define LOG_EMERG 0 #define LOG_ALERT 1 #define LOG_CRIT 2 #define LOG_ERR 3 #define LOG_WARNING 4 #define LOG_NOTICE 5 #define LOG_INFO 6 #define LOG_DEBUG 7 CODE prioritynames[] = { { "alert", LOG_ALERT }, { "crit", LOG_CRIT }, { "debug", LOG_DEBUG }, { "emerg", LOG_EMERG }, { "err", LOG_ERR }, { "error", LOG_ERR }, /* DEPRECATED */ { "info", LOG_INFO }, { "none", INTERNAL_NOPRI }, /* INTERNAL */ { "notice", LOG_NOTICE }, { "panic", LOG_EMERG }, /* DEPRECATED */ { "warn", LOG_WARNING }, /* DEPRECATED */ { "warning", LOG_WARNING }, { NULL, -1 } }; /*@ assigns \nothing ; */ extern void closelog(void); /*@ assigns \nothing ; */ extern void openlog(const char *, int, int); /*@ assigns \nothing ; */ extern int setlogmask(int); /*@ assigns \nothing ; */ extern void syslog(int, const char *, ...); // Not POSIX, but present in glibc /*@ assigns \nothing ; */ extern void vsyslog(int, const char *, va_list); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/termios.h0000666000000000000000000001440113571573400015061 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* POSIX header */ /* c_iflag bits */ #ifndef _TERMIOS_H #define _TERMIOS_H #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_pid_t.h" extern volatile int Frama_C_entropy_source; #define IGNBRK 0000001 #define BRKINT 0000002 #define IGNPAR 0000004 #define PARMRK 0000010 #define INPCK 0000020 #define ISTRIP 0000040 #define INLCR 0000100 #define IGNCR 0000200 #define ICRNL 0000400 #define IUCLC 0001000 #define IXON 0002000 #define IXANY 0004000 #define IXOFF 0010000 #define IMAXBEL 0020000 #define IUTF8 0040000 /* c_oflag bits */ #define OPOST 0000001 #define OLCUC 0000002 #define ONLCR 0000004 #define OCRNL 0000010 #define ONOCR 0000020 #define ONLRET 0000040 #define OFILL 0000100 #define OFDEL 0000200 #define VTDLY 0040000 #define VT0 0000000 #define VT1 0040000 /* c_cflag bit meaning */ #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 #define B110 0000003 #define B134 0000004 #define B150 0000005 #define B200 0000006 #define B300 0000007 #define B600 0000010 #define B1200 0000011 #define B1800 0000012 #define B2400 0000013 #define B4800 0000014 #define B9600 0000015 #define B19200 0000016 #define B38400 0000017 #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 #define CS7 0000040 #define CS8 0000060 #define CSTOPB 0000100 #define CREAD 0000200 #define PARENB 0000400 #define PARODD 0001000 #define HUPCL 0002000 #define CLOCAL 0004000 #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 #define B460800 0010004 #define B500000 0010005 #define B576000 0010006 #define B921600 0010007 #define B1000000 0010010 #define B1152000 0010011 #define B1500000 0010012 #define B2000000 0010013 #define B2500000 0010014 #define B3000000 0010015 #define B3500000 0010016 #define B4000000 0010017 #define __MAX_BAUD B4000000 /* c_lflag bits */ #define ISIG 0000001 #define ICANON 0000002 #define ECHO 0000010 #define ECHOE 0000020 #define ECHOK 0000040 #define ECHONL 0000100 #define NOFLSH 0000200 #define TOSTOP 0000400 #define IEXTEN 0001000 /* tcflow() and TCXONC use these */ #define TCOOFF 0 #define TCOON 1 #define TCIOFF 2 #define TCION 3 /* tcflush() and TCFLSH use these */ #define TCIFLUSH 0 #define TCOFLUSH 1 #define TCIOFLUSH 2 /* tcsetattr uses these */ #define TCSANOW 0 #define TCSADRAIN 1 #define TCSAFLUSH 2 __BEGIN_DECLS typedef unsigned int tcflag_t; typedef unsigned char cc_t; typedef unsigned int speed_t; __END_DECLS // cc_c characters #define NCCS 32 #define VINTR 0 #define VQUIT 1 #define VERASE 2 #define VKILL 3 #define VEOF 4 #define VTIME 5 #define VMIN 6 #define VSWTC 7 #define VSTART 8 #define VSTOP 9 #define VSUSP 10 #define VEOL 11 #define VREPRINT 12 #define VDISCARD 13 #define VWERASE 14 #define VLNEXT 15 #define VEOL2 16 __BEGIN_DECLS struct termios { tcflag_t c_iflag; /* input specific flags (bitmask) */ tcflag_t c_oflag; /* output specific flags (bitmask) */ tcflag_t c_cflag; /* control flags (bitmask) */ tcflag_t c_lflag; /* local flags (bitmask) */ cc_t c_cc[NCCS]; /* special characters */ }; extern speed_t cfgetispeed(const struct termios *); extern speed_t cfgetospeed(const struct termios *); extern int cfsetispeed(struct termios *, speed_t); extern int cfsetospeed(struct termios *, speed_t); extern int tcdrain(int); extern int tcflow(int, int); extern int tcflush(int, int); /*@ requires valid_termios_p: \valid(termios_p); assigns \result, *termios_p \from indirect:fd, indirect:Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; behavior ok: assumes nondet: Frama_C_entropy_source == 0; // arbitrary condition ensures initialization:termios_p: \initialized(termios_p); ensures result_ok: \result == 0; behavior error: assumes nondet: Frama_C_entropy_source != 0; // arbitrary condition ensures result_error: \result == -1; disjoint behaviors; complete behaviors; */ extern int tcgetattr(int fd, struct termios *termios_p); extern pid_t tcgetsid(int); extern int tcsendbreak(int, int); /*@ requires valid_termios_p: \valid(termios_p); assigns *termios_p \from indirect:fd, indirect:optional_actions, indirect:Frama_C_entropy_source, *termios_p; assigns Frama_C_entropy_source \from Frama_C_entropy_source; assigns \result \from indirect:fd, indirect:optional_actions, indirect:Frama_C_entropy_source, indirect:*termios_p; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int tcsetattr(int fd, int optional_actions, struct termios *termios_p); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/tgmath.h0000666000000000000000000000325313571573400014666 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.22 */ #ifndef __FC_REG_TEST #error "Frama-C: unsupported tgmath.h" #endif frama-c-20.0-Calcium/share/libc/time.c0000666000000000000000000000360313571573400014332 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #include "time.h" #include "__fc_builtin.h" __PUSH_FC_STDLIB extern char __fc_ctime[26]; extern char *ctime(const time_t *timer) { //@ assert \valid_read(timer); //@ assert \initialized(timer); Frama_C_make_unknown(__fc_ctime, 26); __fc_ctime[25] = 0; return __fc_ctime; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/time.h0000666000000000000000000003005113571573400014334 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_TIME_H #define __FC_TIME_H #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_null.h" #include "__fc_define_size_t.h" #include "__fc_define_clockid_t.h" #include "__fc_define_timer_t.h" #include "__fc_string_axiomatic.h" #include "errno.h" #include "signal.h" /* * Names of the interval timers, and structure * defining a timer setting: */ #define ITIMER_REAL 0 #define ITIMER_VIRTUAL 1 #define ITIMER_PROF 2 __BEGIN_DECLS #ifndef __clock_t_defined typedef unsigned int clock_t; #define __clock_t_defined #endif #include "__fc_define_time_t.h" // From POSIX.1-2008: "The value of CLOCKS_PER_SEC shall be 1 million on // XSI-conformant systems. [...]" #define CLOCKS_PER_SEC ((time_t)1000000) struct tm { int tm_sec; // seconds after the minute [0, 60] int tm_min; // minutes after the hour [0, 59] int tm_hour; // hours since midnight [0, 23] int tm_mday; // day of the month [1, 31] int tm_mon; // months since January [0, 11] int tm_year; // years since 1900 int tm_wday; // days since Sunday [0, 6] int tm_yday; // days since January 1 [0, 365] int tm_isdst; // Daylight Saving Time flag }; #include "__fc_define_timespec.h" struct itimerspec { struct timespec it_interval; struct timespec it_value; }; // Note: macros and specifications in this file consider that no // other clocks exist (CLOCK_*_CPUTIME_ID and Linux-specific clocks) #define CLOCK_REALTIME 666 #define CLOCK_MONOTONIC 1 #define TIMER_ABSTIME 1 //@ ghost volatile unsigned int __fc_time __attribute__((FRAMA_C_MODEL)); /*@ assigns \result \from __fc_time; */ extern clock_t clock(void); /*@ assigns \result \from time1, time0; */ extern double difftime(time_t time1, time_t time0); /*@ requires valid_timeptr: \valid(timeptr); assigns *timeptr \from *timeptr; assigns \result \from indirect:*timeptr; */ extern time_t mktime(struct tm *timeptr); /*@ assigns *timer, \result \from __fc_time; behavior null: assumes timer_null: timer == \null; assigns \result \from __fc_time; behavior not_null: assumes timer_non_null: timer != \null; requires valid_timer: \valid(timer); assigns *timer, \result \from __fc_time; ensures initialization:timer: \initialized(timer); complete behaviors; disjoint behaviors; */ extern time_t time(time_t *timer); char __fc_ctime[26]; char * const __fc_p_ctime = __fc_ctime; extern char *asctime(const struct tm *timeptr); /*@ requires valid_timer: \valid_read(timer); requires initialization:init_timer: \initialized(timer); assigns __fc_ctime[0..25] \from indirect:*timer, indirect:__fc_time; assigns \result \from indirect:*timer, indirect:__fc_time, __fc_p_ctime; ensures result_points_to_ctime: \result == __fc_p_ctime; ensures result_valid_string: valid_read_string(__fc_p_ctime); */ extern char *ctime(const time_t *timer); struct tm __fc_time_tm; struct tm * const __fc_p_time_tm = &__fc_time_tm; /*@ requires valid_timer: \valid_read(timer); assigns \result \from __fc_p_time_tm; assigns __fc_time_tm \from *timer; ensures result_null_or_internal_tm: \result == &__fc_time_tm || \result == \null ; */ extern struct tm *gmtime(const time_t *timer); /*@ requires valid_timer: \valid_read(timer); assigns \result \from __fc_p_time_tm; assigns __fc_time_tm \from *timer; ensures result_null_or_internal_tm: \result == &__fc_time_tm || \result == \null; */ extern struct tm *localtime(const time_t *timer); /*@ requires dst_has_room: \valid(s+(0 .. max-1)); requires valid_format: valid_read_string(format); requires valid_tm: \valid_read(tm); assigns s[0 .. max-1] \from indirect:max, indirect:format[0..], indirect:*tm; assigns \result \from indirect:max, indirect:format[0..], indirect:*tm; ensures result_bounded: \result <= max; */ extern size_t strftime(char * restrict s, size_t max, const char * restrict format, const struct tm * restrict tm); /* POSIX */ extern char *asctime_r(const struct tm *restrict, char *restrict); extern int clock_getres(clockid_t, struct timespec *); /*@ requires tp: \valid(tp); assigns \result, *tp, __fc_time \from __fc_time; behavior realtime_clock: assumes realtime: clk_id == CLOCK_REALTIME; ensures success: \result == 0; ensures initialization: \initialized(tp); behavior monotonic_clock: assumes monotonic: clk_id == CLOCK_MONOTONIC; #ifndef __FC_NO_MONOTONIC_CLOCK ensures success: \result == 0; ensures initialization: \initialized(tp); #else // simulates a system without monotonic clock assigns \result\from clk_id; ensures error: \result == EINVAL; #endif behavior bad_clock_id: assumes bad_id: clk_id != CLOCK_REALTIME && clk_id != CLOCK_MONOTONIC; assigns \result \from clk_id; ensures error: \result == EINVAL; complete behaviors; disjoint behaviors; */ extern int clock_gettime(clockid_t clk_id, struct timespec *tp); /*@ axiomatic nanosleep_predicates { @ predicate abs_clock_in_range{L}(clockid_t id, struct timespec *tm) @ reads __fc_time; @ @ predicate valid_clock_id{L}(clockid_t id) // id is a known clock and not @ reads __fc_time; // the CPU-time clock of the @ } // calling thread */ /*@ ghost volatile int __fc_interrupted __attribute__((FRAMA_C_MODEL)); */ /*@ // missing: may assign to errno: EINTR, EINVAL, ENOTSUP // missing: assigns \result, rmtp \from 'clock having id clock_id' requires valid_request: \valid_read(rqtp); requires initialization:initialized_request: \initialized(&rqtp->tv_sec) && \initialized(&rqtp->tv_nsec); requires valid_nanosecs: 0 <= rqtp->tv_nsec < 1000000000; requires valid_remaining_or_null: rmtp == \null || \valid(rmtp); assigns \result \from indirect:__fc_time, indirect:__fc_interrupted, indirect:clock_id, indirect:flags, indirect:rqtp, indirect:*rqtp; behavior absolute: assumes absolute_time: (flags & TIMER_ABSTIME) != 0; assumes no_einval: abs_clock_in_range(clock_id, rqtp) && valid_clock_id(clock_id); assigns \result \from indirect:__fc_time, indirect:__fc_interrupted, indirect:clock_id, indirect:rqtp, indirect:*rqtp; ensures result_ok_or_error: \result == 0 || \result == EINTR || \result == EINVAL || \result == ENOTSUP; behavior relative_interrupted: assumes relative_time: (flags & TIMER_ABSTIME) == 0; assumes interrupted: __fc_interrupted != 0; assumes no_einval: valid_clock_id(clock_id); assigns \result \from indirect:__fc_time, indirect:clock_id, indirect:rqtp, indirect:*rqtp; assigns *rmtp \from __fc_time, indirect:clock_id, indirect:rqtp, indirect:*rqtp, indirect:rmtp; ensures result_interrupted: \result == EINTR; ensures initialization:interrupted_remaining: rmtp != \null ==> \initialized(&rmtp->tv_sec) && \initialized(&rmtp->tv_nsec); ensures interrupted_remaining_decreases: rmtp != \null ==> rqtp->tv_sec * 1000000000 + rqtp->tv_nsec >= rmtp->tv_sec * 1000000000 + rmtp->tv_nsec; ensures remaining_valid: rmtp != \null ==> 0 <= rmtp->tv_nsec < 1000000000; behavior relative_no_error: assumes relative_time: (flags & TIMER_ABSTIME) == 0; assumes not_interrupted: __fc_interrupted == 0; assumes no_einval: valid_clock_id(clock_id); assigns \result \from indirect:__fc_time, indirect:clock_id, indirect:rqtp, indirect:*rqtp; ensures result_ok: \result == 0; behavior relative_invalid_clock_id: assumes relative_time: (flags & TIMER_ABSTIME) == 0; assumes not_interrupted: __fc_interrupted == 0; assumes einval: !valid_clock_id(clock_id); assigns \result \from indirect:__fc_time, indirect:clock_id, indirect:rqtp, indirect:*rqtp; ensures result_einval: \result == EINVAL; complete behaviors; disjoint behaviors; */ extern int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); extern int clock_settime(clockid_t, const struct timespec *); extern char *ctime_r(const time_t *timep, char *buf); extern struct tm *getdate(const char *string); extern struct tm *gmtime_r(const time_t *restrict timer, struct tm *restrict result); extern struct tm *localtime_r(const time_t *restrict timep, struct tm *restrict result); /*@ // missing: errno may be set to EINTR (EINVAL prevented by precondition) requires valid_request: \valid_read(rqtp); requires initialization:initialized_request: \initialized(&rqtp->tv_sec) && \initialized(&rqtp->tv_nsec); requires valid_nanosecs: 0 <= rqtp->tv_nsec < 1000000000; requires valid_remaining_or_null: rmtp == \null || \valid(rmtp); assigns \result \from indirect:__fc_time, indirect:rqtp, indirect:*rqtp; assigns *rmtp \from indirect:__fc_time, indirect:rqtp, indirect:*rqtp, indirect:rmtp; ensures result_elapsed_or_interrupted: \result == 0 || \result == -1; ensures initialization:interrupted_remaining: rmtp != \null && \result == -1 ==> \initialized(&rmtp->tv_sec) && \initialized(&rmtp->tv_nsec); ensures interrupted_remaining_decreases: rmtp != \null && \result == -1 ==> rqtp->tv_sec * 1000000000 + rqtp->tv_nsec >= rmtp->tv_sec * 1000000000 + rmtp->tv_nsec; ensures interrupted_remaining_valid: rmtp != \null && \result == -1 ==> 0 <= rmtp->tv_nsec < 1000000000; */ extern int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); //Note: uncomment functions below when the necessary types will be defined: // locale_t, timer_t //extern size_t strftime_l(char *restrict, size_t, const char *restrict, // const struct tm *restrict, locale_t); extern char *strptime(const char *restrict s, const char *restrict format, struct tm *restrict tm); extern int timer_create(clockid_t, struct sigevent *restrict, timer_t *restrict); extern int timer_delete(timer_t); extern int timer_getoverrun(timer_t); extern int timer_gettime(timer_t, struct itimerspec *); extern int timer_settime(timer_t, int, const struct itimerspec *restrict, struct itimerspec *restrict); extern int daylight; extern long timezone; extern char *tzname[2]; /*@ assigns tzname[0..1][0..] \from \nothing ;*/ extern void tzset(void); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/unistd.h0000666000000000000000000012503613571573400014714 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_UNISTD #define __FC_UNISTD #include "features.h" __PUSH_FC_STDLIB #include "__fc_string_axiomatic.h" #include "__fc_define_size_t.h" #include "__fc_define_null.h" #include "__fc_define_ssize_t.h" #include "__fc_define_uid_and_gid.h" #include "__fc_define_off_t.h" #include "__fc_define_pid_t.h" #include "__fc_define_useconds_t.h" #include "__fc_define_intptr_t.h" #include "limits.h" extern volatile int Frama_C_entropy_source; /* Values for the second argument to access. These may be OR'd together. */ #define R_OK 4 /* Test for read permission. */ #define W_OK 2 /* Test for write permission. */ #define X_OK 1 /* Test for execute permission. */ #define F_OK 0 /* Test for existence. */ /* Standard file descriptors. */ #define STDIN_FILENO 0 /* Standard input. */ #define STDOUT_FILENO 1 /* Standard output. */ #define STDERR_FILENO 2 /* Standard error output. */ #include "__fc_define_seek_macros.h" /* compatibility macros */ #ifndef __FC_NO_MONOTONIC_CLOCK /* 0 indicates that the feature is supported at compile time, but might not be supported at runtime. Frama-C can't make promises about the runtime environment. */ #define _POSIX_MONOTONIC_CLOCK 0 #endif __BEGIN_DECLS /* Values for the NAME argument to `pathconf' and `fpathconf'. */ enum __fc_pathconf_name { _PC_LINK_MAX, #define _PC_LINK_MAX _PC_LINK_MAX _PC_MAX_CANON, #define _PC_MAX_CANON _PC_MAX_CANON _PC_MAX_INPUT, #define _PC_MAX_INPUT _PC_MAX_INPUT _PC_NAME_MAX, #define _PC_NAME_MAX _PC_NAME_MAX _PC_PATH_MAX, #define _PC_PATH_MAX _PC_PATH_MAX _PC_PIPE_BUF, #define _PC_PIPE_BUF _PC_PIPE_BUF _PC_CHOWN_RESTRICTED, #define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED _PC_NO_TRUNC, #define _PC_NO_TRUNC _PC_NO_TRUNC _PC_VDISABLE, #define _PC_VDISABLE _PC_VDISABLE _PC_SYNC_IO, #define _PC_SYNC_IO _PC_SYNC_IO _PC_ASYNC_IO, #define _PC_ASYNC_IO _PC_ASYNC_IO _PC_PRIO_IO, #define _PC_PRIO_IO _PC_PRIO_IO _PC_SOCK_MAXBUF, #define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF _PC_FILESIZEBITS, #define _PC_FILESIZEBITS _PC_FILESIZEBITS _PC_REC_INCR_XFER_SIZE, #define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE _PC_REC_MAX_XFER_SIZE, #define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE _PC_REC_MIN_XFER_SIZE, #define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE _PC_REC_XFER_ALIGN, #define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN _PC_ALLOC_SIZE_MIN, #define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN _PC_SYMLINK_MAX, #define _PC_SYMLINK_MAX _PC_SYMLINK_MAX _PC_2_SYMLINKS #define _PC_2_SYMLINKS _PC_2_SYMLINKS }; /* Values for the argument to `sysconf'. */ enum __fc_sysconf_name { _SC_ARG_MAX, #define _SC_ARG_MAX _SC_ARG_MAX _SC_CHILD_MAX, #define _SC_CHILD_MAX _SC_CHILD_MAX _SC_CLK_TCK, #define _SC_CLK_TCK _SC_CLK_TCK _SC_NGROUPS_MAX, #define _SC_NGROUPS_MAX _SC_NGROUPS_MAX _SC_OPEN_MAX, #define _SC_OPEN_MAX _SC_OPEN_MAX _SC_STREAM_MAX, #define _SC_STREAM_MAX _SC_STREAM_MAX _SC_TZNAME_MAX, #define _SC_TZNAME_MAX _SC_TZNAME_MAX _SC_JOB_CONTROL, #define _SC_JOB_CONTROL _SC_JOB_CONTROL _SC_SAVED_IDS, #define _SC_SAVED_IDS _SC_SAVED_IDS _SC_REALTIME_SIGNALS, #define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS _SC_PRIORITY_SCHEDULING, #define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING _SC_TIMERS, #define _SC_TIMERS _SC_TIMERS _SC_ASYNCHRONOUS_IO, #define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO _SC_PRIORITIZED_IO, #define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO _SC_SYNCHRONIZED_IO, #define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO _SC_FSYNC, #define _SC_FSYNC _SC_FSYNC _SC_MAPPED_FILES, #define _SC_MAPPED_FILES _SC_MAPPED_FILES _SC_MEMLOCK, #define _SC_MEMLOCK _SC_MEMLOCK _SC_MEMLOCK_RANGE, #define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE _SC_MEMORY_PROTECTION, #define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION _SC_MESSAGE_PASSING, #define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING _SC_SEMAPHORES, #define _SC_SEMAPHORES _SC_SEMAPHORES _SC_SHARED_MEMORY_OBJECTS, #define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS _SC_AIO_LISTIO_MAX, #define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX _SC_AIO_MAX, #define _SC_AIO_MAX _SC_AIO_MAX _SC_AIO_PRIO_DELTA_MAX, #define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX _SC_DELAYTIMER_MAX, #define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX _SC_MQ_OPEN_MAX, #define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX _SC_MQ_PRIO_MAX, #define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX _SC_VERSION, #define _SC_VERSION _SC_VERSION _SC_PAGESIZE, #define _SC_PAGESIZE _SC_PAGESIZE #define _SC_PAGE_SIZE _SC_PAGESIZE _SC_RTSIG_MAX, #define _SC_RTSIG_MAX _SC_RTSIG_MAX _SC_SEM_NSEMS_MAX, #define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX _SC_SEM_VALUE_MAX, #define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX _SC_SIGQUEUE_MAX, #define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX _SC_TIMER_MAX, #define _SC_TIMER_MAX _SC_TIMER_MAX /* Values for the argument to `sysconf' corresponding to _POSIX2_* symbols. */ _SC_BC_BASE_MAX, #define _SC_BC_BASE_MAX _SC_BC_BASE_MAX _SC_BC_DIM_MAX, #define _SC_BC_DIM_MAX _SC_BC_DIM_MAX _SC_BC_SCALE_MAX, #define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX _SC_BC_STRING_MAX, #define _SC_BC_STRING_MAX _SC_BC_STRING_MAX _SC_COLL_WEIGHTS_MAX, #define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX _SC_EQUIV_CLASS_MAX, #define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX _SC_EXPR_NEST_MAX, #define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX _SC_LINE_MAX, #define _SC_LINE_MAX _SC_LINE_MAX _SC_RE_DUP_MAX, #define _SC_RE_DUP_MAX _SC_RE_DUP_MAX _SC_CHARCLASS_NAME_MAX, #define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX _SC_2_VERSION, #define _SC_2_VERSION _SC_2_VERSION _SC_2_C_BIND, #define _SC_2_C_BIND _SC_2_C_BIND _SC_2_C_DEV, #define _SC_2_C_DEV _SC_2_C_DEV _SC_2_FORT_DEV, #define _SC_2_FORT_DEV _SC_2_FORT_DEV _SC_2_FORT_RUN, #define _SC_2_FORT_RUN _SC_2_FORT_RUN _SC_2_SW_DEV, #define _SC_2_SW_DEV _SC_2_SW_DEV _SC_2_LOCALEDEF, #define _SC_2_LOCALEDEF _SC_2_LOCALEDEF _SC_PII, #define _SC_PII _SC_PII _SC_PII_XTI, #define _SC_PII_XTI _SC_PII_XTI _SC_PII_SOCKET, #define _SC_PII_SOCKET _SC_PII_SOCKET _SC_PII_INTERNET, #define _SC_PII_INTERNET _SC_PII_INTERNET _SC_PII_OSI, #define _SC_PII_OSI _SC_PII_OSI _SC_POLL, #define _SC_POLL _SC_POLL _SC_SELECT, #define _SC_SELECT _SC_SELECT _SC_UIO_MAXIOV, #define _SC_UIO_MAXIOV _SC_UIO_MAXIOV _SC_IOV_MAX = _SC_UIO_MAXIOV, #define _SC_IOV_MAX _SC_IOV_MAX _SC_PII_INTERNET_STREAM, #define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_DGRAM, #define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM _SC_PII_OSI_COTS, #define _SC_PII_OSI_COTS _SC_PII_OSI_COTS _SC_PII_OSI_CLTS, #define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS _SC_PII_OSI_M, #define _SC_PII_OSI_M _SC_PII_OSI_M _SC_T_IOV_MAX, #define _SC_T_IOV_MAX _SC_T_IOV_MAX /* Values according to POSIX 1003.1c (POSIX threads). */ _SC_THREADS, #define _SC_THREADS _SC_THREADS _SC_THREAD_SAFE_FUNCTIONS, #define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS _SC_GETGR_R_SIZE_MAX, #define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX, #define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX _SC_LOGIN_NAME_MAX, #define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX _SC_TTY_NAME_MAX, #define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX _SC_THREAD_DESTRUCTOR_ITERATIONS, #define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_KEYS_MAX, #define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX _SC_THREAD_STACK_MIN, #define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN _SC_THREAD_THREADS_MAX, #define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX _SC_THREAD_ATTR_STACKADDR, #define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKSIZE, #define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_PRIORITY_SCHEDULING, #define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIO_INHERIT, #define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_PROTECT, #define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT _SC_THREAD_PROCESS_SHARED, #define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED _SC_NPROCESSORS_CONF, #define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF _SC_NPROCESSORS_ONLN, #define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN _SC_PHYS_PAGES, #define _SC_PHYS_PAGES _SC_PHYS_PAGES _SC_AVPHYS_PAGES, #define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES _SC_ATEXIT_MAX, #define _SC_ATEXIT_MAX _SC_ATEXIT_MAX _SC_PASS_MAX, #define _SC_PASS_MAX _SC_PASS_MAX _SC_XOPEN_VERSION, #define _SC_XOPEN_VERSION _SC_XOPEN_VERSION _SC_XOPEN_XCU_VERSION, #define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION _SC_XOPEN_UNIX, #define _SC_XOPEN_UNIX _SC_XOPEN_UNIX _SC_XOPEN_CRYPT, #define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT _SC_XOPEN_ENH_I18N, #define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N _SC_XOPEN_SHM, #define _SC_XOPEN_SHM _SC_XOPEN_SHM _SC_2_CHAR_TERM, #define _SC_2_CHAR_TERM _SC_2_CHAR_TERM _SC_2_C_VERSION, #define _SC_2_C_VERSION _SC_2_C_VERSION _SC_2_UPE, #define _SC_2_UPE _SC_2_UPE _SC_XOPEN_XPG2, #define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2 _SC_XOPEN_XPG3, #define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3 _SC_XOPEN_XPG4, #define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4 _SC_CHAR_BIT, #define _SC_CHAR_BIT _SC_CHAR_BIT _SC_CHAR_MAX, #define _SC_CHAR_MAX _SC_CHAR_MAX _SC_CHAR_MIN, #define _SC_CHAR_MIN _SC_CHAR_MIN _SC_INT_MAX, #define _SC_INT_MAX _SC_INT_MAX _SC_INT_MIN, #define _SC_INT_MIN _SC_INT_MIN _SC_LONG_BIT, #define _SC_LONG_BIT _SC_LONG_BIT _SC_WORD_BIT, #define _SC_WORD_BIT _SC_WORD_BIT _SC_MB_LEN_MAX, #define _SC_MB_LEN_MAX _SC_MB_LEN_MAX _SC_NZERO, #define _SC_NZERO _SC_NZERO _SC_SSIZE_MAX, #define _SC_SSIZE_MAX _SC_SSIZE_MAX _SC_SCHAR_MAX, #define _SC_SCHAR_MAX _SC_SCHAR_MAX _SC_SCHAR_MIN, #define _SC_SCHAR_MIN _SC_SCHAR_MIN _SC_SHRT_MAX, #define _SC_SHRT_MAX _SC_SHRT_MAX _SC_SHRT_MIN, #define _SC_SHRT_MIN _SC_SHRT_MIN _SC_UCHAR_MAX, #define _SC_UCHAR_MAX _SC_UCHAR_MAX _SC_UINT_MAX, #define _SC_UINT_MAX _SC_UINT_MAX _SC_ULONG_MAX, #define _SC_ULONG_MAX _SC_ULONG_MAX _SC_USHRT_MAX, #define _SC_USHRT_MAX _SC_USHRT_MAX _SC_NL_ARGMAX, #define _SC_NL_ARGMAX _SC_NL_ARGMAX _SC_NL_LANGMAX, #define _SC_NL_LANGMAX _SC_NL_LANGMAX _SC_NL_MSGMAX, #define _SC_NL_MSGMAX _SC_NL_MSGMAX _SC_NL_NMAX, #define _SC_NL_NMAX _SC_NL_NMAX _SC_NL_SETMAX, #define _SC_NL_SETMAX _SC_NL_SETMAX _SC_NL_TEXTMAX, #define _SC_NL_TEXTMAX _SC_NL_TEXTMAX _SC_XBS5_ILP32_OFF32, #define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFFBIG, #define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG _SC_XBS5_LP64_OFF64, #define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64 _SC_XBS5_LPBIG_OFFBIG, #define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG _SC_XOPEN_LEGACY, #define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY _SC_XOPEN_REALTIME, #define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME_THREADS, #define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS _SC_ADVISORY_INFO, #define _SC_ADVISORY_INFO _SC_ADVISORY_INFO _SC_BARRIERS, #define _SC_BARRIERS _SC_BARRIERS _SC_BASE, #define _SC_BASE _SC_BASE _SC_C_LANG_SUPPORT, #define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT_R, #define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R _SC_CLOCK_SELECTION, #define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION _SC_CPUTIME, #define _SC_CPUTIME _SC_CPUTIME _SC_THREAD_CPUTIME, #define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME _SC_DEVICE_IO, #define _SC_DEVICE_IO _SC_DEVICE_IO _SC_DEVICE_SPECIFIC, #define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC_R, #define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R _SC_FD_MGMT, #define _SC_FD_MGMT _SC_FD_MGMT _SC_FIFO, #define _SC_FIFO _SC_FIFO _SC_PIPE, #define _SC_PIPE _SC_PIPE _SC_FILE_ATTRIBUTES, #define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES _SC_FILE_LOCKING, #define _SC_FILE_LOCKING _SC_FILE_LOCKING _SC_FILE_SYSTEM, #define _SC_FILE_SYSTEM _SC_FILE_SYSTEM _SC_MONOTONIC_CLOCK, #define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK _SC_MULTI_PROCESS, #define _SC_MULTI_PROCESS _SC_MULTI_PROCESS _SC_SINGLE_PROCESS, #define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS _SC_NETWORKING, #define _SC_NETWORKING _SC_NETWORKING _SC_READER_WRITER_LOCKS, #define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS _SC_SPIN_LOCKS, #define _SC_SPIN_LOCKS _SC_SPIN_LOCKS _SC_REGEXP, #define _SC_REGEXP _SC_REGEXP _SC_REGEX_VERSION, #define _SC_REGEX_VERSION _SC_REGEX_VERSION _SC_SHELL, #define _SC_SHELL _SC_SHELL _SC_SIGNALS, #define _SC_SIGNALS _SC_SIGNALS _SC_SPAWN, #define _SC_SPAWN _SC_SPAWN _SC_SPORADIC_SERVER, #define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER, #define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER _SC_SYSTEM_DATABASE, #define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE_R, #define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R _SC_TIMEOUTS, #define _SC_TIMEOUTS _SC_TIMEOUTS _SC_TYPED_MEMORY_OBJECTS, #define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS _SC_USER_GROUPS, #define _SC_USER_GROUPS _SC_USER_GROUPS _SC_USER_GROUPS_R, #define _SC_USER_GROUPS_R _SC_USER_GROUPS_R _SC_2_PBS, #define _SC_2_PBS _SC_2_PBS _SC_2_PBS_ACCOUNTING, #define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING _SC_2_PBS_LOCATE, #define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE _SC_2_PBS_MESSAGE, #define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE _SC_2_PBS_TRACK, #define _SC_2_PBS_TRACK _SC_2_PBS_TRACK _SC_SYMLOOP_MAX, #define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX _SC_STREAMS, #define _SC_STREAMS _SC_STREAMS _SC_2_PBS_CHECKPOINT, #define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT _SC_V6_ILP32_OFF32, #define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFFBIG, #define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG _SC_V6_LP64_OFF64, #define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64 _SC_V6_LPBIG_OFFBIG, #define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG _SC_HOST_NAME_MAX, #define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX _SC_TRACE, #define _SC_TRACE _SC_TRACE _SC_TRACE_EVENT_FILTER, #define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER _SC_TRACE_INHERIT, #define _SC_TRACE_INHERIT _SC_TRACE_INHERIT _SC_TRACE_LOG, #define _SC_TRACE_LOG _SC_TRACE_LOG _SC_LEVEL1_ICACHE_SIZE, #define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_ASSOC, #define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_LINESIZE, #define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_DCACHE_SIZE, #define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_ASSOC, #define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_LINESIZE, #define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL2_CACHE_SIZE, #define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_ASSOC, #define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_LINESIZE, #define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL3_CACHE_SIZE, #define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_ASSOC, #define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_LINESIZE, #define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL4_CACHE_SIZE, #define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_ASSOC, #define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_LINESIZE, #define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE /* Leave room here, maybe we need a few more cache levels some day. */ _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, #define _SC_IPV6 _SC_IPV6 _SC_RAW_SOCKETS, #define _SC_RAW_SOCKETS _SC_RAW_SOCKETS _SC_V7_ILP32_OFF32, #define _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFFBIG, #define _SC_V7_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG _SC_V7_LP64_OFF64, #define _SC_V7_LP64_OFF64 _SC_V7_LP64_OFF64 _SC_V7_LPBIG_OFFBIG, #define _SC_V7_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG _SC_SS_REPL_MAX, #define _SC_SS_REPL_MAX _SC_SS_REPL_MAX _SC_TRACE_EVENT_NAME_MAX, #define _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_NAME_MAX, #define _SC_TRACE_NAME_MAX _SC_TRACE_NAME_MAX _SC_TRACE_SYS_MAX, #define _SC_TRACE_SYS_MAX _SC_TRACE_SYS_MAX _SC_TRACE_USER_EVENT_MAX, #define _SC_TRACE_USER_EVENT_MAX _SC_TRACE_USER_EVENT_MAX _SC_XOPEN_STREAMS, #define _SC_XOPEN_STREAMS _SC_XOPEN_STREAMS _SC_THREAD_ROBUST_PRIO_INHERIT, #define _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_PROTECT #define _SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT }; /* Values for the NAME argument to `confstr'. */ enum __fc_confstr_name { _CS_PATH, /* The default search path. */ #define _CS_PATH _CS_PATH _CS_V6_WIDTH_RESTRICTED_ENVS, #define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS _CS_GNU_LIBC_VERSION, #define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION _CS_GNU_LIBPTHREAD_VERSION, #define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION _CS_V5_WIDTH_RESTRICTED_ENVS, #define _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS, #define _CS_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS #define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_V7_WIDTH_RESTRICTED_ENVS _CS_LFS_CFLAGS = 1000, #define _CS_LFS_CFLAGS _CS_LFS_CFLAGS _CS_LFS_LDFLAGS, #define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS _CS_LFS_LIBS, #define _CS_LFS_LIBS _CS_LFS_LIBS _CS_LFS_LINTFLAGS, #define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS _CS_LFS64_CFLAGS, #define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS _CS_LFS64_LDFLAGS, #define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS _CS_LFS64_LIBS, #define _CS_LFS64_LIBS _CS_LFS64_LIBS _CS_LFS64_LINTFLAGS, #define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, #define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS, #define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LIBS, #define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LINTFLAGS, #define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS, #define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LIBS, #define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, #define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_LP64_OFF64_CFLAGS, #define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS, #define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LIBS, #define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LINTFLAGS, #define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LIBS, #define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, #define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LIBS, #define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS, #define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LIBS, #define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LIBS, #define _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LIBS, #define _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS, #define _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LIBS, #define _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, #define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS _CS_V6_ENV, #define _CS_V6_ENV _CS_V6_ENV _CS_V7_ENV #define _CS_V7_ENV _CS_V7_ENV }; // arbitrary number #define __FC_MAX_OPEN_FILES 1024 // __fc_fds represents the state of open file descriptors. //@ ghost int __fc_fds[__FC_MAX_OPEN_FILES]; // TODO: Model the state of some functions more precisely. // TODO: define __fc_fds as volatile. /*@ // missing: may assign to errno: EACCES, ELOOP, ENAMETOOLONG, ENOENT, // ENOTDIR, EROFS, ETXTBSY // (EINVAL prevented by precondition) // missing: assigns \result \from 'filesystem, permissions' requires valid_string_path: valid_read_string(path); requires valid_amode: (amode & ~(R_OK | W_OK | X_OK)) == 0 || amode == F_OK; assigns \result \from indirect:path, indirect:path[0..], indirect:amode; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int access(const char *path, int amode); extern unsigned int alarm(unsigned int); extern int brk(void *); /*@ // missing: may assign to errno: EACCES, ELOOP, ENAMETOOLONG, ENOENT, // ENOTDIR // missing: assigns \result \from 'filesystem' requires valid_string_path: valid_read_string(path); assigns \result \from indirect:path, indirect:path[0..]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int chdir(const char *path); /*@ // missing: may assign to errno: EACCES, ELOOP, ENAMETOOLONG, ENOENT, // ENOTDIR, EPERM // missing: assigns \result \from 'filesystem, permissions' // missing: assigns 'filesystem view' \from path[0..]; requires valid_string_path: valid_read_string(path); assigns \result \from indirect:path, indirect:path[0..]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int chroot(const char *path); /*@ // missing: may assign to errno: EACCES, ELOOP, ENAMETOOLONG, ENOENT, // ENOTDIR, EROFS, EIO, EINTR, EINVAL // missing: assigns \result \from 'filesystem, permissions' // missing: assigns 'file permissions' \from owner, group; requires valid_string_path: valid_read_string(path); assigns \result \from indirect:path, indirect:path[0..], indirect:owner, indirect:group; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int chown(const char *path, uid_t owner, gid_t group); /*@ requires valid_fd: 0 <= fd < __FC_MAX_OPEN_FILES; assigns __fc_fds[fd] \from fd, __fc_fds[fd]; assigns \result \from indirect:fd, indirect:__fc_fds[fd]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int close(int fd); extern size_t confstr(int, char *, size_t); extern char *crypt(const char *, const char *); extern char *ctermid(char *); extern char *cuserid(char *s); /*@ // missing: may assign errno EBADF, EMFILE requires valid_fildes: 0 <= fildes < __FC_MAX_OPEN_FILES; assigns __fc_fds[fildes..] \from fildes; // missing: \from 'filesystem' assigns \result \from fildes; ensures result_valid_fildes_or_error: \result == -1 || fildes <= \result < __FC_MAX_OPEN_FILES; */ extern int dup(int fildes); /*@ // missing: may assign errno EBADF, EINTR, EIO requires valid_fildes: 0 <= fildes < __FC_MAX_OPEN_FILES; requires valid_fildes2: 0 <= fildes2 < __FC_MAX_OPEN_FILES; assigns __fc_fds[fildes2] \from fildes, fildes2, __fc_fds[fildes2]; assigns \result \from fildes, fildes2, __fc_fds[fildes], __fc_fds[fildes2]; ensures result_fildes2_or_error: \result == fildes2 || \result == -1; */ extern int dup2(int fildes, int fildes2); extern void encrypt(char[64], int); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_arg: valid_read_string(arg); assigns \result \from path[0..], arg[0..]; */ extern int execl(const char *path, const char *arg, ...); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_arg: valid_read_string(arg); assigns \result \from path[0..], arg[0..]; */ extern int execle(const char *path, const char *arg, ...); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_arg: valid_read_string(arg); assigns \result \from path[0..], arg[0..]; */ extern int execlp(const char *path, const char *arg, ...); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_argv0: valid_read_string(argv[0]); assigns \result \from path[0..], argv[0..]; */ extern int execv(const char *path, char *const argv[]); /*@ requires valid_path: valid_read_string(path); requires valid_argv0: valid_read_string(argv[0]); assigns \result \from path[0..], argv[0..]; */ extern int execve(const char *path, char *const argv[], char *const env[]); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_argv0: valid_read_string(argv[0]); assigns \result \from path[0..], argv[0..]; */ extern int execvp(const char *path, char *const argv[]); /*@ assigns \nothing; ensures never_terminates: \false; */ extern void _exit(int) __attribute__ ((__noreturn__)); extern int fchown(int, uid_t, gid_t); extern int fchdir(int); extern int fdatasync(int); /*@ // missing: assigns \result \from 'other processes, internal state' // missing: may assign errno EAGAIN, ENOMEM assigns \result \from \nothing; ensures result_ok_child_or_error: \result == 0 || \result > 0 || \result == -1; */ extern pid_t fork(void); extern long int fpathconf(int, int); extern int fsync(int); extern int ftruncate(int, off_t); /*@ // missing: assigns buf[0..size-1] \from 'cwd' // missing: may assign to errno: EACCES, EINVAL, ENAMETOOLONG, ENOENT, // ENOMEM, ERANGE requires valid_buf: \valid(buf + (0 .. size-1)); assigns buf[0 .. size-1], \result; assigns buf[0 .. size-1] \from indirect:buf, indirect:size; assigns \result \from buf, indirect: size; ensures result_ok_or_error: \result == \null || \result == buf; */ extern char *getcwd(char *buf, size_t size); extern int getdtablesize(void); /*@ //missing: assigns \result \from 'process effective gid' assigns \result \from \nothing; */ extern gid_t getegid(void); /*@ //missing: assigns \result \from 'process effective uid' assigns \result \from \nothing; */ extern uid_t geteuid(void); /*@ //missing: assigns \result \from 'process gid' assigns \result \from \nothing; */ extern gid_t getgid(void); extern int getgroups(int, gid_t []); extern long gethostid(void); extern volatile char __fc_hostname[HOST_NAME_MAX]; /*@ requires name_has_room: \valid(name + (0 .. len-1)); assigns \result, name[0 .. len-1] \from indirect:__fc_hostname[0 .. len], indirect:len; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int gethostname(char *name, size_t len); // Non-POSIX /*@ requires name_valid_string: valid_read_nstring(name, len); requires bounded_len: len <= HOST_NAME_MAX; assigns __fc_hostname[0 .. len] \from name[0 .. len-1], indirect:len; assigns \result \from indirect:__fc_hostname[0 .. len]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int sethostname(const char *name, size_t len); extern char *getlogin(void); extern int getlogin_r(char *, size_t); extern int getpagesize(void); extern char *getpass(const char *); /*@ //missing: assigns \result \from 'process PGID' assigns \result \from indirect:pid; */ extern pid_t getpgid(pid_t pid); /*@ //missing: assigns \result \from 'calling process PGID' assigns \result \from \nothing; */ extern pid_t getpgrp(void); /*@ //missing: assigns \result \from 'process id' assigns \result \from \nothing; */ extern pid_t getpid(void); /*@ //missing: assigns \result \from 'parent process id' assigns \result \from \nothing; */ extern pid_t getppid(void); /*@ //missing: assigns \result \from 'process sid' assigns \result \from \nothing; */ extern pid_t getsid(pid_t); /*@ //missing: assigns \result \from 'process uid' assigns \result \from \nothing; */ extern uid_t getuid(void); extern char *getwd(char *); /*@ //missing: may assign to errno: EBADF, ENOTTY (POSIX) / EINVAL (Linux) assigns \result \from indirect:fd, indirect:__fc_fds[fd]; ensures result_true_or_false: \result == 0 || \result == 1; */ extern int isatty(int fd); extern int lchown(const char *, uid_t, gid_t); extern int link(const char *, const char *); extern int lockf(int, int, off_t); /*@ //missing: may assign to errno: EBADF, EINVAL, EOVERFLOW, ESPIPE, ENXIO (Linux); requires valid_fd: 0 <= fd < __FC_MAX_OPEN_FILES; requires valid_whence: whence == SEEK_SET || whence == SEEK_CUR || whence == SEEK_END; assigns \result \from indirect:fd, indirect:__fc_fds[fd], indirect:offset, indirect:whence; assigns __fc_fds[fd] \from indirect:fd, __fc_fds[fd], indirect:offset, indirect:whence; ensures result_error_or_offset: \result == -1 || 0 <= \result; */ extern off_t lseek(int fd, off_t offset, int whence); extern int nice(int); /*@ // missing: may assign to errno: EACCES, EINVAL, ELOOP, ENOENT, ENOTDIR // missing: assigns \result \from 'file path in filesystem' requires valid_path: valid_read_string(path); assigns \result \from indirect:path[0 ..], indirect:name; */ extern long pathconf(char const *path, int name); extern int pause(void); /*@ requires valid_pipefd: \valid(pipefd+(0..1)); assigns pipefd[0..1] \from indirect:__fc_fds[0..]; assigns \result \from indirect:__fc_fds[0..]; ensures initialization:pipefd: \initialized(&pipefd[0..1]); ensures valid_fd0: 0 <= pipefd[0] < __FC_MAX_OPEN_FILES; ensures valid_fd1: 0 <= pipefd[1] < __FC_MAX_OPEN_FILES; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int pipe(int pipefd[2]); extern ssize_t pread(int, void *, size_t, off_t); extern int pthread_atfork(void (*)(void), void (*)(void), void(*)(void)); extern ssize_t pwrite(int, const void *, size_t, off_t); /*@ requires valid_fd: 0 <= fd < __FC_MAX_OPEN_FILES; requires buf_has_room: \valid((char *)buf+(0..count-1)); assigns __fc_fds[fd] \from __fc_fds[fd]; assigns \result, *((char *)buf+(0..count-1)) \from indirect:__fc_fds[fd], indirect:count; ensures result_error_or_read_length: 0 <= \result <= count || \result == -1; ensures initialization:buf: \initialized(((char*)buf)+(0..\result-1)); */ extern ssize_t read(int fd, void *buf, size_t count); extern int readlink(const char *, char *, size_t); extern int rmdir(const char *); extern void *sbrk(intptr_t); /*@ // missing: may assign errno to EINVAL or EPERM // missing: assigns 'process egid' \from gid assigns \result \from indirect:gid; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int setegid(gid_t gid); /*@ // missing: may assign errno to EINVAL or EPERM // missing: assigns 'process euid' \from uid assigns \result \from indirect:uid; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int seteuid(uid_t uid); /*@ // missing: may assign errno to EINVAL or EPERM // missing: assigns 'process gid' \from gid, 'process permissions' // missing: assigns \result \from 'process permissions' assigns \result \from indirect:gid; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int setgid(gid_t gid); /*@ // missing: may assign to errno // missing: assigns \result \from 'processes' assigns \result \from indirect:pid, indirect:pgid; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int setpgid(pid_t pid, pid_t pgid); extern pid_t setpgrp(void); /*@ // missing: may assign errno to EINVAL, EPERM or EAGAIN // missing: assigns 'process real/effective gid' \from gid // missing: assigns \result \from 'process gid and permissions' assigns \result \from indirect:rgid, indirect:egid; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int setregid(gid_t rgid, gid_t egid); /*@ // missing: may assign errno to EINVAL, EPERM or EAGAIN // missing: assigns 'process real/effective uid' \from uid // missing: assigns \result \from 'process uid and permissions' assigns \result \from indirect:ruid, indirect:euid; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int setreuid(uid_t ruid, uid_t euid); /*@ // missing: may assign errno to EPERM // missing: assigns \result, 'session, process, gid' \from 'process'; assigns \result \from \nothing; ensures result_pgid_or_error: \result == -1 || \result >= 0; */ extern pid_t setsid(void); /*@ // missing: may assign errno to EINVAL, EPERM or EAGAIN // missing: assigns 'process uid' \from uid, 'process permissions' // missing: assigns \result \from 'process permissions' assigns \result \from indirect:uid; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int setuid(uid_t uid); extern unsigned int sleep(unsigned int); extern void swab(const void *, void *, ssize_t); extern int symlink(const char *, const char *); /*@ //missing: assigns 'filesystem' \from 'filesystem' assigns \nothing; */ extern void sync(void); /*@ //missing: assigns 'filesystem', \result \from 'filesystem' //missing: may set errno to EINVAL assigns \result \from indirect:name; */ extern long int sysconf(int name); extern pid_t tcgetpgrp(int); extern int tcsetpgrp(int, pid_t); extern int truncate(const char *, off_t); extern volatile char __fc_ttyname[TTY_NAME_MAX]; volatile char *__fc_p_ttyname = __fc_ttyname; /*@ // missing: may assign to errno: EBADF, ENOTTY requires valid_fildes: 0 <= fildes < __FC_MAX_OPEN_FILES; assigns \result \from __fc_p_ttyname, indirect:fildes; ensures result_name_or_null: \result == __fc_p_ttyname || \result == \null; */ extern char *ttyname(int fildes); extern int ttyname_r(int, char *, size_t); extern useconds_t ualarm(useconds_t, useconds_t); /*@ // missing: may assign errno // missing: assigns 'filesystem' \from path[0..]; // missing: assigns \result \from 'filesystem'; requires valid_string_path: valid_read_string(path); assigns \result \from path[0..]; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int unlink(const char *path); /*@ assigns \result \from indirect:usec, indirect:Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; ensures result_ok_or_error: \result == 0 || \result == -1; */ extern int usleep(useconds_t usec); extern pid_t vfork(void); /*@ requires valid_fd: 0 <= fd < __FC_MAX_OPEN_FILES; requires buf_has_room: \valid_read(((char *)buf)+(0..count-1)); assigns __fc_fds[fd] \from indirect:fd, indirect:count, __fc_fds[fd]; assigns \result \from indirect:fd, indirect:count, indirect:__fc_fds[fd]; ensures result_error_or_written_bytes: \result == -1 || 0 <= \result <= count; */ extern ssize_t write(int fd, const void *buf, size_t count); // setgroups() is not POSIX extern int setgroups(size_t size, const gid_t *list); // The following functions are GNU extensions /*@ // missing: assigns \result, *ruid, *euid, *suid \from 'process' // missing: may assign to errno: EFAULT requires valid_ruid: \valid(ruid); requires valid_euid: \valid(suid); requires valid_suid: \valid(euid); assigns *ruid, *euid, *suid \from \nothing; assigns \result \from indirect:ruid, indirect:euid, indirect:suid; ensures initialization:result_ok_or_error: (\result == 0 && \initialized(ruid) && \initialized(euid) && \initialized(suid)) || \result == -1; */ int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); /*@ // missing: assigns 'process uid' \from ruid, euid, suid // missing: assigns \result \from 'process permissions' // missing: may assign to errno: EAGAIN, EINVAL, EPERM assigns \result \from indirect:ruid, indirect:euid, indirect:suid; ensures result_ok_or_error: \result == 0 || \result == -1; */ int setresuid(uid_t ruid, uid_t euid, uid_t suid); /*@ // missing: assigns \result, *ruid, *euid, *suid \from 'process' // missing: may assign to errno: EFAULT requires valid_rgid: \valid(rgid); requires valid_egid: \valid(sgid); requires valid_sgid: \valid(egid); assigns *rgid, *egid, *sgid \from \nothing; assigns \result \from indirect:rgid, indirect:egid, indirect:sgid; ensures initialization:result_ok_or_error: (\result == 0 && \initialized(rgid) && \initialized(egid) && \initialized(sgid)) || \result == -1; */ int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); /*@ // missing: assigns 'process gid' \from rgid, egid, sgid // missing: assigns \result \from 'process permissions' // missing: may assign to errno: EAGAIN, EINVAL, EPERM assigns \result \from indirect:rgid, indirect:egid, indirect:sgid; ensures result_ok_or_error: \result == 0 || \result == -1; */ int setresgid(gid_t rgid, gid_t egid, gid_t sgid); extern char *optarg; extern int optind, opterr, optopt; /*@ assigns \result, *optarg, optind, opterr, optopt \from argc, argv[0..argc-1], optstring[0..]; */ extern int getopt(int argc, char * const argv[], const char *optstring); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/utime.h0000666000000000000000000000363013571573400014524 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_UTIME_H #define __FC_UTIME_H #include "features.h" __PUSH_FC_STDLIB #include "sys/time.h" __BEGIN_DECLS struct utimbuf { time_t actime; /* access time */ time_t modtime; /* modification time */ }; extern int utime(const char *filename, const struct utimbuf *times); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/utmpx.h0000666000000000000000000000502313571573400014554 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifndef __FC_UTMPX #define __FC_UTMPX #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_pid_t.h" #include "sys/time.h" __BEGIN_DECLS // The sizes of arrays and values for the constants below are based on those // of the glibc, declared in the order given by POSIX.1-2008. struct utmpx { char ut_user[32]; char ut_id[4]; char ut_line[32]; char ut_host[256]; // not POSIX, but allowed by it, and present in glibc pid_t ut_pid; short ut_type; struct timeval ut_tv; }; #define EMPTY 0 #define BOOT_TIME 2 #define OLD_TIME 4 #define NEW_TIME 3 #define USER_PROCESS 7 #define INIT_PROCESS 5 #define LOGIN_PROCESS 6 #define DEAD_PROCESS 8 extern void endutxent(void); extern struct utmpx *getutxent(void); extern struct utmpx *getutxid(const struct utmpx *); extern struct utmpx *getutxline(const struct utmpx *); extern struct utmpx *pututxline(const struct utmpx *); extern void setutxent(void); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/wchar.c0000666000000000000000000000551713571573400014506 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.25 */ #include "wchar.h" __PUSH_FC_STDLIB wchar_t* wmemcpy(wchar_t *dest, const wchar_t *src, size_t n) { for (size_t i = 0; i < n; i++) { dest[i] = src[i]; } return dest; } wchar_t * wmemset(wchar_t *dest, wchar_t val, size_t len) { for (size_t i = 0; i < len; i++) { dest[i] = val; } return dest; } wchar_t* wcscpy(wchar_t *dest, const wchar_t *src) { size_t i; for (i = 0; src[i] != L'\0'; i++) dest[i] = src[i]; dest[i] = L'\0'; return dest; } size_t wcslen(const wchar_t * str) { size_t i; for (i = 0; str[i] != L'\0'; i++); return i; } wchar_t * wcsncpy(wchar_t *dest, const wchar_t *src, size_t n) { size_t i; for (i = 0; i < n; i++) { dest[i] = src[i]; if (src[i] == L'\0') break; } for (; i < n; i++) dest[i] = L'\0'; return dest; } wchar_t * wcscat(wchar_t *dest, const wchar_t *src) { size_t i; size_t n = wcslen(dest); for (i = 0; src[i] != L'\0'; i++) { dest[n+i] = src[i]; } dest[n+i] = L'\0'; return dest; } wchar_t* wcsncat(wchar_t *dest, const wchar_t *src, size_t n) { size_t dest_len = wcslen(dest); size_t i; for (i = 0 ; i < n && src[i] != L'\0' ; i++) dest[dest_len + i] = src[i]; dest[dest_len + i] = L'\0'; return dest; } __POP_FC_STDLIB frama-c-20.0-Calcium/share/libc/wchar.h0000666000000000000000000002706513571573400014515 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.25 */ #ifndef __FC_WCHAR_H #define __FC_WCHAR_H #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_wchar_t.h" #include "__fc_define_wint_t.h" #include "__fc_define_size_t.h" #include "__fc_define_file.h" #include "__fc_string_axiomatic.h" // Include to retrieve definitions such as WCHAR_MIN and WINT_MAX, // required by ISO C (and not necessarily respected by the glibc). // Note that POSIX does not specify that all symbols in can be // made visible in wchar.h, but in practice this should be fine. #include "stdint.h" // ISO C requires the tag 'struct tm' (as declared in ) to be declared. #include "time.h" #include "string.h" __BEGIN_DECLS #ifndef WEOF #define WEOF __FC_WEOF #endif /*@ requires valid: valid_read_or_empty((char*)s, (size_t)(sizeof(wchar_t)*n)) || \valid_read(((unsigned char*)s)+(0..wmemchr_off(s,c,n))); @ requires initialization: \initialized(s+(0..n - 1)) || \initialized(s+(0..wmemchr_off(s,c,n))); @ requires danglingness: non_escaping(s, (size_t)(sizeof(wchar_t)*n)) || non_escaping(s, (size_t)(sizeof(wchar_t)*(wmemchr_off(s,c,n)+1))); assigns \result \from s, indirect:s[0 .. n-1], indirect:c, indirect:n; ensures result_null_or_inside_s: \result == \null || \subset (\result, s+(0 .. n-1)); */ extern wchar_t * wmemchr(const wchar_t *s, wchar_t c, size_t n); /*@ requires valid_s1: valid_read_or_empty(s1, (size_t)(sizeof(wchar_t)*n)); requires valid_s2: valid_read_or_empty(s2, (size_t)(sizeof(wchar_t)*n)); requires initialization:s1: \initialized(s1+(0..n-1)); requires initialization:s2: \initialized(s2+(0..n-1)); requires danglingness:s1: non_escaping(s1, (size_t)(sizeof(wchar_t)*n)); requires danglingness:s2: non_escaping(s2, (size_t)(sizeof(wchar_t)*n)); assigns \result \from indirect:s1[0 .. n-1], indirect:s2[0 .. n-1], indirect:n; */ extern int wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n); /*@ requires valid_dest: valid_or_empty(dest, (size_t)(sizeof(wchar_t)*n)); requires valid_src: valid_read_or_empty(src, (size_t)(sizeof(wchar_t)*n)); requires separation:dest:src: \separated(dest+(0 .. n-1), src+(0 .. n-1)); assigns dest[0 .. n-1] \from src[0 .. n-1], indirect:src, indirect:n; assigns \result \from dest; ensures result_ptr: \result == dest; */ extern wchar_t * wmemcpy(wchar_t *restrict dest, const wchar_t *restrict src, size_t n); /*@ requires valid_src: \valid_read(src+(0..n-1)); requires valid_dest: \valid(dest+(0..n-1)); assigns dest[0 .. n-1] \from src[0 .. n-1], indirect:src, indirect:n; assigns \result \from dest; ensures result_ptr: \result == dest; */ extern wchar_t * wmemmove(wchar_t *dest, const wchar_t *src, size_t n); /*@ requires valid_wcs: \valid(wcs+(0..n-1)); assigns wcs[0 .. n-1] \from wc, indirect:n; assigns \result \from wcs; ensures result_ptr: \result == wcs; ensures initialization:wcs: \initialized(wcs + (0 .. n-1)); ensures contents_equal_wc: \subset(wcs[0 .. n-1], wc); */ extern wchar_t * wmemset(wchar_t *wcs, wchar_t wc, size_t n); /*@ requires valid_wstring_src: valid_read_wstring(src); requires valid_wstring_dest: valid_wstring(dest); requires room_for_concatenation: \valid(dest+(wcslen(dest)..wcslen(dest)+wcslen(src))); requires separation:\separated(dest+(0..wcslen(dest)+wcslen(src)),src+(0..wcslen(src))); assigns dest[0 .. ] \from dest[0 .. ], indirect:dest, src[0 .. ], indirect:src; assigns \result \from dest; ensures result_ptr: \result == dest; */ extern wchar_t * wcscat(wchar_t *restrict dest, const wchar_t *restrict src); /*@ requires valid_wstring_src: valid_read_wstring(wcs); assigns \result \from wcs, indirect:wcs[0 ..], indirect:wc; ensures result_null_or_inside_wcs: \result == \null || \subset(\result, wcs+(0..)); */ extern wchar_t * wcschr(const wchar_t *wcs, wchar_t wc); /*@ requires valid_wstring_s1: valid_read_wstring(s1); // over-strong requires valid_wstring_s2: valid_read_wstring(s2); // over-strong assigns \result \from indirect:s1[0 .. ], indirect:s2[0 .. ]; */ extern int wcscmp(const wchar_t *s1, const wchar_t *s2); /*@ requires valid_wstring_src: valid_read_wstring(src); requires room_wstring: \valid(dest+(0 .. wcslen(src))); requires separation:\separated(dest+(0..wcslen(src)),src+(0..wcslen(src))); assigns dest[0 .. wcslen(src)] \from src[0 .. wcslen(src)], indirect:src; assigns \result \from dest; ensures result_ptr: \result == dest; */ extern wchar_t * wcscpy(wchar_t *restrict dest, const wchar_t *restrict src); /*@ requires valid_wstring_wcs: valid_read_wstring(wcs); requires valid_wstring_accept: valid_read_wstring(accept); assigns \result \from indirect:wcs[0 .. ], indirect:accept[0 .. ]; */ extern size_t wcscspn(const wchar_t *wcs, const wchar_t *accept); // wcslcat is a BSD extension (non-C99, non-POSIX) /*@ requires valid_nwstring_src: valid_read_nwstring(src, n); requires valid_wstring_dest: valid_wstring(dest); requires room_for_concatenation: \valid(dest+(wcslen(dest)..wcslen(dest)+\min(wcslen(src), n))); requires separation:\separated(dest+(0..wcslen(dest)+wcslen(src)),src+(0..wcslen(src))); assigns dest[0 .. ] \from dest[0 .. ], indirect:dest, src[0 .. n-1], indirect:src, indirect:n; assigns \result \from indirect:dest[0 .. ], indirect:src[0 .. n-1], indirect:n; */ extern size_t wcslcat(wchar_t *restrict dest, const wchar_t *restrict src, size_t n); // wcslcpy is a BSD extension (non-C99, non-POSIX) /*@ requires valid_wstring_src: valid_read_wstring(src); requires room_nwstring: \valid(dest+(0 .. n)); requires separation:dest:src: \separated(dest+(0 .. n-1), src+(0 .. n-1)); assigns dest[0 .. n-1] \from src[0 .. n-1], indirect:src, indirect:n; assigns \result \from indirect:dest[0 .. n-1], indirect:dest, indirect:src[0 .. n-1], indirect:src, indirect:n; */ extern size_t wcslcpy(wchar_t *dest, const wchar_t *src, size_t n); /*@ requires valid_string_s: valid_read_wstring(s); assigns \result \from indirect:s[0 .. wcslen(s)]; ensures result_is_length: \result == wcslen(s); */ extern size_t wcslen(const wchar_t *s); /*@ requires valid_nwstring_src: valid_read_nwstring(src, n); requires valid_wstring_dest: valid_wstring(dest); requires room_for_concatenation: \valid(dest+(wcslen(dest)..wcslen(dest)+\min(wcslen(src), n))); requires separation:\separated(dest+(0..wcslen(dest)+wcslen(src)),src+(0..wcslen(src))); assigns dest[0 .. ] \from dest[0 .. ], indirect:dest, src[0 .. n-1], indirect:src, indirect:n; assigns \result \from dest; ensures result_ptr: \result == dest; */ extern wchar_t * wcsncat(wchar_t *restrict dest, const wchar_t *restrict src, size_t n); /*@ requires valid_wstring_s1: valid_read_wstring(s1); // over-strong requires valid_wstring_s2: valid_read_wstring(s2); // over-strong assigns \result \from indirect:s1[0 .. n-1], indirect:s2[0 .. n-1], indirect:n; */ extern int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n); /*@ requires valid_wstring_src: valid_read_wstring(src); requires room_nwstring: \valid(dest+(0 .. n-1)); requires separation:dest:src: \separated(dest+(0 .. n-1), src+(0 .. n-1)); assigns dest[0 .. n-1] \from src[0 .. n-1], indirect:src, indirect:n; assigns \result \from dest; ensures result_ptr: \result == dest; ensures initialization: \initialized(dest+(0 .. n-1)); */ extern wchar_t * wcsncpy(wchar_t *restrict dest, const wchar_t *restrict src, size_t n); /*@ requires valid_wstring_wcs: valid_read_wstring(wcs); requires valid_wstring_accept: valid_read_wstring(accept); assigns \result \from wcs, indirect:wcs[0 .. ], indirect:accept[0 .. ]; ensures result_null_or_inside_wcs: \result == \null || \subset (\result, wcs+(0 .. )); */ extern wchar_t * wcspbrk(const wchar_t *wcs, const wchar_t *accept); /*@ requires valid_wstring_wcs: valid_read_wstring(wcs); assigns \result \from wcs, indirect:wcs[0 .. wcslen(wcs)], indirect:wc; ensures result_null_or_inside_wcs: \result == \null || \subset (\result, wcs+(0 .. )); */ extern wchar_t * wcsrchr(const wchar_t *wcs, wchar_t wc); /*@ requires valid_wstring_wcs: valid_read_wstring(wcs); requires valid_wstring_accept: valid_read_wstring(accept); assigns \result \from indirect:wcs[0 .. wcslen(wcs)], indirect:accept[0 .. wcslen(accept)]; */ extern size_t wcsspn(const wchar_t *wcs, const wchar_t *accept); /*@ requires valid_wstring_haystack: valid_read_wstring(haystack); requires valid_wstring_needle: valid_read_wstring(needle); assigns \result \from haystack, indirect:haystack[0 .. ], indirect:needle[0 .. ]; ensures result_null_or_inside_haystack: \result == \null || \subset (\result, haystack+(0 .. )); */ extern wchar_t * wcsstr(const wchar_t *haystack, const wchar_t *needle); /*@ requires room_nwstring: \valid(ws+(0..n-1)); requires valid_stream: \valid(stream); assigns ws[0..n-1] \from indirect:n, indirect:*stream; assigns \result \from ws, indirect:n, indirect:*stream; ensures result_null_or_same: \result == \null || \result == ws; ensures terminated_string_on_success: \result != \null ==> valid_wstring(ws); */ extern wchar_t *fgetws(wchar_t * restrict ws, int n, FILE * restrict stream); /*@ // Axiomatic used by the Variadic plugin to generate specifications // for some functions, e.g. swprintf(). axiomatic wformat_length { //TODO: this logic function will be extended to handle variadic formats logic integer wformat_length{L}(wchar_t *format); } */ /* It is unclear whether these are more often in wchar.h or stdio.h */ extern int fwprintf(FILE * stream, const wchar_t * format, ...); extern int swprintf(wchar_t * ws, size_t n, const wchar_t * format, ...); extern int wprintf(const wchar_t * format, ...); extern int wscanf(const wchar_t * format, ...); extern int fwscanf(FILE * stream, const wchar_t * format, ...); extern int swscanf(const wchar_t * str, const wchar_t * format, ...); #ifndef __mbstate_t_defined typedef struct __fc_mbstate_t { int __count; char __value[4]; } mbstate_t; #define __mbstate_t_defined #endif __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc/wctype.h0000666000000000000000000000462013571573400014714 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* ISO C: 7.26 */ #ifndef __FC_WCTYPE_H #define __FC_WCTYPE_H #include "features.h" __PUSH_FC_STDLIB #include "__fc_define_wint_t.h" __BEGIN_DECLS extern int iswalnum(wint_t wc); extern int iswalpha(wint_t wc); extern int iswascii(wint_t wc); extern int iswblank(wint_t wc); extern int iswcntrl(wint_t wc); extern int iswdigit(wint_t wc); extern int iswgraph(wint_t wc); extern int iswhexnumber(wint_t wc); extern int iswideogram(wint_t wc); extern int iswlower(wint_t wc); extern int iswnumber(wint_t wc); extern int iswphonogram(wint_t wc); extern int iswprint(wint_t wc); extern int iswpunct(wint_t wc); extern int iswrune(wint_t wc); extern int iswspace(wint_t wc); extern int iswspecial(wint_t wc); extern int iswupper(wint_t wc); extern int iswxdigit(wint_t wc); __END_DECLS __POP_FC_STDLIB #endif frama-c-20.0-Calcium/share/libc.c0000666000000000000000000000312513571573400013373 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ frama-c-20.0-Calcium/share/machdep.c0000666000000000000000000002545413571573400014074 0ustar /****************************************************************************/ /* */ /* Copyright (C) 2001-2003 */ /* George C. Necula */ /* Scott McPeak */ /* Wes Weimer */ /* Ben Liblit */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* 1. Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* 2. Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the distribution. */ /* */ /* 3. The names of the contributors may not be used to endorse or */ /* promote products derived from this software without specific prior */ /* written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */ /* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */ /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */ /* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */ /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */ /* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */ /* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */ /* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* */ /* File modified by CEA (Commissariat à l'énergie atomique et aux */ /* énergies alternatives) */ /* and INRIA (Institut National de Recherche en Informatique */ /* et Automatique). */ /****************************************************************************/ #include "../config.h" #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_WCHAR_H #include #endif #define COMPILER "other" #ifdef __TURBOC__ #define LONGLONG long long #define CONST_STRING_LITERALS "false" #define VERSION __TURBOC__ #define VERSION_MAJOR 0 #define VERSION_MINOR 0 #endif #ifdef __GNUC__ #define LONGLONG long long #define CONST_STRING_LITERALS "true" #define VERSION __VERSION__ #define VERSION_MAJOR __GNUC__ #define VERSION_MINOR __GNUC_MINOR__ #undef COMPILER #define COMPILER "gcc" #endif #ifdef _MSVC #define LONGLONG __int64 #define CONST_STRING_LITERALS "false" #define VERSION "Microsoft C" #define VERSION_MAJOR (_MSC_VER / 100) #define VERSION_MINOR (_MSC_VER % 100) #undef COMPILER #define COMPILER "msvc" #endif #ifndef __TURBOC__ #ifndef __GNUC__ #ifndef _MSVC #error "Please define one of __TURBOC__ __GNUC__ _MSVC." #endif #endif #endif /* The type for the machine dependency structure is generated from the Makefile */ int main() { fprintf(stderr, "Generating machine dependency information for CIL\n"); printf("(* Generated by code in %s *)\n", __FILE__); printf("open Cil_types\n"); printf("let mach = {\n"); // printf("\t version_major = %d;\n", VERSION_MAJOR); // printf("\t version_minor = %d;\n", VERSION_MINOR); #ifdef __TURBOC__ printf("\t version = \"%d\";\n", VERSION); #else printf("\t version = \"%s\";\n", VERSION); #endif // Size of certain types printf("\t sizeof_short = %lu;\n", sizeof(short)); printf("\t sizeof_int = %lu;\n", sizeof(int)); printf("\t sizeof_long = %lu;\n", sizeof(long)); printf("\t sizeof_longlong = %lu;\n", sizeof(LONGLONG)); printf("\t sizeof_ptr = %lu;\n", sizeof(int *)); printf("\t sizeof_float = %lu;\n", sizeof(float)); printf("\t sizeof_double = %lu;\n", sizeof(double)); printf("\t sizeof_longdouble = %lu;\n", sizeof(long double)); printf("\t sizeof_void = %lu;\n", #ifdef __TURBOC__ 0 #else sizeof(void) #endif ); printf("\t sizeof_fun = %lu;\n", #ifdef __GNUC__ sizeof(main) #else 0 #endif ); // definition of size_t { printf("\t size_t = \"%s\";\n", TYPE_SIZE_T); printf("\t wchar_t = \"%s\";\n", TYPE_WCHAR_T); printf("\t ptrdiff_t = \"%s\";\n", TYPE_PTRDIFF_T); } // The alignment of a short { struct shortstruct { char c; short s; }; printf("\t alignof_short = %z;\n", (size_t)(&((struct shortstruct*)0)->s)); } // The alignment of an int { struct intstruct { char c; int i; }; printf("\t alignof_int = %z;\n", (size_t)(&((struct intstruct*)0)->i)); } // The alignment of a long { struct longstruct { char c; long l; }; printf("\t alignof_long = %z;\n", (size_t)(&((struct longstruct*)0)->l)); } // The alignment of long long { struct longlong { char c; LONGLONG ll; }; printf("\t alignof_longlong = %z;\n", (size_t)(&((struct longlong*)0)->ll)); } // The alignment of a ptr { struct ptrstruct { char c; int * p; }; printf("\t alignof_ptr = %z;\n", (size_t)(&((struct ptrstruct*)0)->p)); } // Unnamed members { struct S0 { int; // If you are reading this, it's probably because your C compiler // rejected the above. Good for you! It is not allowed by C99. // See discussion thread at: // http://lists.cs.uiuc.edu/pipermail/c-semantics/2011-August/thread.html // You can comment out this block. int f1; }; if (sizeof(struct S0) != 2*sizeof(int)) { printf("(* WARNING: This compiler handles unnamed struct members\n"); printf(" differently from Frama-C.\n"); printf(" To be analyzed correctly, your programs must *NOT* use\n"); printf(" this language extension. *)\n"); } } // long long bit-fields { struct LLS { long long int f:2; // If you are reading this, it's probably because your C compiler // rejected the above. Good for you! It is only allowed by C99 // as an extension. // You can comment out this block. } lls; if (sizeof(1 + lls.f) != sizeof(int)) { printf("(* WARNING: This compiler handles long long bit-fields\n"); printf(" differently from Frama-C.\n"); printf(" To be analyzed correctly, your programs must *NOT* use\n"); printf(" this language extension. *)\n"); } } // The alignment of a float { struct floatstruct { char c; float f; }; printf("\t alignof_float = %z;\n", (size_t)(&((struct floatstruct*)0)->f)); } // The alignment of double { struct s1 { char c; double d; }; printf("\t alignof_double = %z;\n", (size_t)(&((struct s1*)0)->d)); } // The alignment of long double { struct s1 { char c; long double ld; }; printf("\t alignof_longdouble = %z;\n", (size_t)(&((struct s1*)0)->ld)); } printf("\t alignof_str = %lu;\n", #ifdef __GNUC__ __alignof("a string") #else 0 #endif ); printf("\t alignof_fun = %lu;\n", #ifdef __GNUC__ __alignof(main) #else 0 #endif ); // The alignment of char array { struct s1 { char c; char ca[2]; }; // printf("\t alignof_char_array = %lu;\n", // (int)(&((struct s1*)0)->ca)); } /* The alignment of an __aligned__ type */ { #ifdef __TURBOC__ printf("\t alignof_aligned = 8;\n"); #else char __attribute__((aligned)) c; long double __attribute__((aligned)) ld; if (__alignof(c) != __alignof(ld)) { printf("(*__attribute__((aligned)) has a different effect \ on different types. alignments may be computed \ incorrectly.*)\n"); }; printf("\t alignof_aligned = %lu;\n",__alignof(c)); #endif } // Whether char is unsigned printf("\t char_is_unsigned = %s;\n", ((char)0xff) > 0 ? "true" : "false"); // Whether int bit-field is unsigned { union { signed int init ; struct { int width8 : 8; } sign ; } bitfield; bitfield.init=-1; printf("\t (* int_bitfield_is_unsigned = %s; *)\n", (bitfield.sign.width8 > 0 ? "true" : "false")); if (bitfield.sign.width8 > 0) { // 'int width8 : 8' is an unsigned bit-field. printf("(* WARNING: This compiler handles int bit-fields\n"); printf(" differently from Frama-C.\n"); printf(" To be analyzed correctly, your programs must *NOT* use\n"); printf(" 'int' bit-fields, but 'unsigned int' bit-fields. *)\n"); } } // Whether string literals contain constant characters puts("\t const_string_literals = " CONST_STRING_LITERALS ";"); // endianity { int e = 0x11223344; printf("\t little_endian = %s;\n", (0x44 == *(char*)&e) ? "true" : ((0x11 == *(char*)&e) ? "false" : (exit(1), "false"))); } // __builtin_val_list { #ifdef HAVE_BUILTIN_VA_LIST printf("\t has__builtin_va_list = true;\n"); #else printf("\t has__builtin_va_list = false;\n"); #endif } // __thread_is_keyword { #ifdef THREAD_IS_KEYWORD printf("\t __thread_is_keyword = true;\n"); #else printf("\t __thread_is_keyword = false;\n"); #endif } // underscore_name { #ifdef UNDERSCORE_NAME printf("\t underscore_name = true;\n"); #else printf("\t underscore_name = false;\n"); #endif } // compiler { printf("\t compiler = \"" COMPILER "\""); } printf("}\n"); exit(0); } frama-c-20.0-Calcium/share/switch-off.png0000666000000000000000000000652413571573400015103 0ustar PNG  IHDRH J>p pHYs   IDAThۏ%Uk]ӧ/s{zۉMb'DQ rd" 53g3;TG]THvjXhRfL8̟9/,,-EU4 EQyhckkWrŃNB)n-^W?x9qN)aNGՏQ)7,`g;ޔh7B؉P>1yA@Ps4SUUw_S#t:kz)]F]\p>8**Z^7$ KX'-89"ieTQrN}r 0F`d éSv|psg<_"+epR—#@ޑNEa4~QLǼ_e}X6Xb"#abA<4ߓdK`rV8gFJ%. N ]$2wi6C %+eE*eAd xVoW>"9g)mޑIspf"6&4MCJdjTQk8I,L%$WhІXaa&D'.K . k}11^nkxHN V8>СO7 TA. /PXIQt1spޫ]|Y= .c(>e!H(E)J4{)J~mNRWgG1+x(PrYфHds(M;֒66 ! iY2 |Hg$Nkkk\~Γe8(Q_BCҥHgC 9q8 8X½#^yhAi|3!m8mI'O"ִjhl {ʢ$u e:>tN3^?UUd29w@Bƈ Eӭ)fP!ƈU%7o%8eum'jEn #됓u 5w _<êr%zZ"Nw5_ .-?Z8j6f:$)KO aٰB5{d5**t4֑r@c+ۺIHi•:˛-pyB J^@&Jq8)H]H)a=ی'> "]KU 𫿎 -h)Zx/HJ)|tD"ዂfҲX-Y)8$z?m;>\| ?"̢tP* t4E ׆>$ۺɷ~6d&W.&-DRBDI@+$Cd4$t0hBkB7~^ˤd8r tRL%T>JEG,'K"YdP (c (B񑧞  U~1HcUE(i\3ACr,XڶE MtNHEJ::c7)Q Ĵ'O֙3~&Td"o[/ٗ~BghiۀΝN)xU.˒7ng},ǹ[, *,-,s5B,f*{'LP4PZY9S ^/hh)ғa9szm ԰?#;^e`#/0OI EQ͛lll? ={ d:>`_"c3㵝CN&-PNZ\Ap B< d ӊO#BԒ5j@F$<8ʼn {Y=Y=]6z_&:UXLGPY$sE5 m>lll|=bg`r`]rJ-*zI ]A܆xNSNk;^%G.Ҷ- ] amnګF$B섭ʧfS?HfDUO:+zM*Bp||qeF ;J-9L-s_kinmeʺh|BUXxuItl$'m3N9gƳ|Uuh^LxF8qUQ,t]ݻwb4SW\y̎,!ScY$'P3(Oz;ד-gmˈEQncfm93TיEj<& M>19g`0@DX\\dqqe?s v?!??{wW E2IENDB`frama-c-20.0-Calcium/share/switch-on.png0000666000000000000000000000637213571573400014746 0ustar PNG  IHDRH J>p pHYs   IDAThYdGV'{s76cch{ƃixGg/o#^xF8B4 bfd0/CnRUUUވ8<ܼYm7E#FϚ|!, "?ݻ v ! )%Dk{c=;|xm_80C}/\9jbHgEUq^83gWh@lmm}.pI#_z:'Gƀ3#٬{Kף,)Z>|o~Gܻ0p/9&in 1;8[-ߌ&1c$iEH5jjEQd1eI^ #A@$ei⽯#^(0y+گ`{wjw?$V#}18E0r4b &Z=Gg Bx,Z$h 9w1cě:o!%ypT).=so#ksr)zB:BL9XqOlzTop~eyFDY>c[M `C c Y斌2Ɛ9n6 z;Rp1CRE˔HpvJ5uhvfhg3z]lZg*,j1҂Q4BD3WO?'>dݻwq9w"T VX~}ԇn6-~t[mD@ij`e%ιڤCL"TJա,(i$!PDM^dز/rd]8Xq=a <`ww/r9,[ZguYc{6Ʉ~}tZl풵-IES tv-99l6#3P>AX4tu8}s\z ]&9y˲6߯"ш]lll`g}}@|7nE66`'<ւK򼍈.]ϲ@Th6QQpx(`bZE$ F@HPUV0+"9y1>{Ӿ=-˒,c)UU1ϱֵ N<ϗa5m0oڥkRDX>'W|fccSy*@4lj K)QdBwB… 8._7 iIENDB`frama-c-20.0-Calcium/share/theme/0000777000000000000000000000000013571573400013417 5ustar frama-c-20.0-Calcium/share/theme/colorblind/0000777000000000000000000000000013571573400015546 5ustar frama-c-20.0-Calcium/share/theme/colorblind/considered_valid.png0000666000000000000000000000034713571573400021556 0ustar PNG  IHDRh6 pHYs  tIME8nXtEXtCommentCreated with GIMPWaIDAT(ϝRA dd!('%--0 \@Ht=[*-vvD<'p'աhx5Y '.aLIENDB`frama-c-20.0-Calcium/share/theme/colorblind/fold.png0000666000000000000000000000011313571573400017173 0ustar PNG  IHDRaIDAT8c``?rIENDB`frama-c-20.0-Calcium/share/theme/colorblind/inconsistent.png0000666000000000000000000000022613571573400020774 0ustar PNG  IHDRh6 pHYs  tIME ,CtEXtCommentCreated with GIMPWIDAT(c``hmIENDB`frama-c-20.0-Calcium/share/theme/colorblind/invalid_but_dead.png0000666000000000000000000000035113571573400021530 0ustar PNG  IHDRh6 pHYs  tIME#-tEXtCommentCreated with GIMPWcIDAT(ϝR[ *d2X8K6jv$!)QG]_N{;'ñCe)3+uˈsYeCW8.)3nV9!IENDB`frama-c-20.0-Calcium/share/theme/colorblind/invalid_under_hyp.png0000666000000000000000000000034213571573400021756 0ustar PNG  IHDRh6 pHYs  tIME F4wtEXtCommentCreated with GIMPW\IDAT(ϽPA0i/- qD]6uO-=StI>/^}07ϰHΗ_~fMϞ\菽5^C!2xIENDB`frama-c-20.0-Calcium/share/theme/colorblind/never_tried.png0000666000000000000000000000025113571573400020560 0ustar PNG  IHDRh6 pHYs  tIME &"tEXtCommentCreated with GIMPW#IDAT(c` 0200XՌL0aT4 JܐyIENDB`frama-c-20.0-Calcium/share/theme/colorblind/surely_invalid.png0000666000000000000000000000035013571573400021303 0ustar PNG  IHDRh6 pHYs  tIME }T7tEXtCommentCreated with GIMPWbIDAT(ϕQ Cg~m>"⯛TH_*o *ri8zK*#}y&}Bݘܸ32nj<~|[xf6&ECIENDB`frama-c-20.0-Calcium/share/theme/colorblind/surely_valid.png0000666000000000000000000000034013571573400020753 0ustar PNG  IHDRh6 pHYs  tIME 箌tEXtCommentCreated with GIMPWZIDAT(ϕA![6A%6)qAdL;Y+j ΃|zOz 9E_s]٠X}g0$ IENDB`frama-c-20.0-Calcium/share/theme/colorblind/unfold.png0000666000000000000000000000011313571573400017536 0ustar PNG  IHDRaIDAT8c``?rIENDB`frama-c-20.0-Calcium/share/theme/colorblind/unknown.png0000666000000000000000000000033313571573400017752 0ustar PNG  IHDRh6 pHYs  tIME 7[tEXtCommentCreated with GIMPWUIDAT(ϕRA0+/mIv%-bU^84Sc)HB|f l|[Re*{K4@/,IENDB`frama-c-20.0-Calcium/share/theme/colorblind/unknown_but_dead.png0000666000000000000000000000034413571573400021603 0ustar PNG  IHDRh6 pHYs  tIME&g'tEXtCommentCreated with GIMPW^IDAT(ϭP[ kra f| >EH. I :HNMOڑ?s8 mtzYV-2PV;sIENDB`frama-c-20.0-Calcium/share/theme/colorblind/valid_but_dead.png0000666000000000000000000000034613571573400021205 0ustar PNG  IHDRh6 pHYs  tIME'mȎtEXtCommentCreated with GIMPW`IDAT(ϝQA02m C$ uo0ӥw~8TfXcIo޸џ>jC0J亼,7 6 oRIENDB`frama-c-20.0-Calcium/share/theme/colorblind/valid_under_hyp.png0000666000000000000000000000034413571573400021431 0ustar PNG  IHDRh6 pHYs  tIME %otEXtCommentCreated with GIMPW^IDAT(ϝA 1M9{JQmNL`f4 җCw'΄]-LKw٥_tpΕtLr=6j-r'.yFIENDB`frama-c-20.0-Calcium/share/theme/default/0000777000000000000000000000000013571573400015043 5ustar frama-c-20.0-Calcium/share/theme/default/considered_valid.png0000666000000000000000000000312213571573400021045 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.@2}ibuԶ(g<ǖ3<1'9~.+g+n]E7Ktn&>3FR78umG)Yd:r`r7D0t4#OےCߊ4HO2ndDZBۋEZ\;+wɅu(Rji2,BhAUDEu@]U*0U lRjrZ0M)ĨBTB{KsSi VqLUm%;y"GmAj&1uM ]DjC=bI;5T$+޼l.mOL=,⫊4,js]itj[#7+iHqg/.PW~cp3ReRu<?^˭=T|#y&rL!jIENDB`frama-c-20.0-Calcium/share/theme/default/inconsistent.png0000666000000000000000000000276413571573400020302 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.9<<P$`?5@I* 4H\\\=@H$b06 VEp\[ZE;/b*= 0,H_IENDB`frama-c-20.0-Calcium/share/theme/default/invalid_but_dead.png0000666000000000000000000000306313571573400021030 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.:hxO^@ww7JIR)s umhH{}|Hb8994KoS6 Ap}m 6 (k @+++n)llߏQI]_PV[Ae7E6u 2z5:2r94"I)bYyA +2T #ȺC,HuJ |_AΆ0] Hׇ@[v`X`XT]%dx\}F?NHX'~$Wc*b`dd|٥ΏEج.ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.*4ˬR1>G#X:;s~=Moijr:? 4/!wK)Grvfդbf#A$#;'2a~Sz 4uKN۵ غml8yX; >=GfTws![BKsy6,?\/D'9MQR[|&n}mS RCx:їQ-DE`ug]2~Yk4,G{'zh `X:iP959E 3 :^@9-'da{^` @7tLN0tO./~?*j F/Udw[̂fFߚUFdU0 $#[5Æi B/Rb$ˆ\G Xrԍσ&%8>/C3x2H*P1^v4 0Js]U+ÇUIM5dvXGprIYBכo4Ua%G7n8b]AZYY>LM180`$Yk֥.m/ڜϱI|vff:6f4CAɉIENDB`frama-c-20.0-Calcium/share/theme/default/never_tried.png0000666000000000000000000000276413571573400020070 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.<7}elQW:s1eȓWYHpr[%P_ >y{\ÞYԞM°F"x"2Hl%l4ᢻ[e2o~޼Kzp klċqss 1F@b旨ry>LGsh{{ݵ1<ÀnnQK? bCo@:jnxX/_6L~ ٨Cb7QpϒFI`6E҂!y Q [,(!ʻ+DЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.f\LkhVp&1:8hoJҍ d º0 V{z*Sf&&XR0tAq_oC//?? hBIENDB`frama-c-20.0-Calcium/share/theme/default/surely_valid.png0000666000000000000000000000306013571573400020252 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.o 1p/냤#fu eXLJN "͚ShhR1V~4q=}@*UIENDB`frama-c-20.0-Calcium/share/theme/default/unknown.png0000666000000000000000000000303013571573400017244 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.{CpJM+Na"9>/SoӰ9DvY3؍GH˱ %Z^TlyIENDB`frama-c-20.0-Calcium/share/theme/default/unknown_but_dead.png0000666000000000000000000000306713571573400021105 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.wmmmH$bn4<;;x ]>֊>< B@oo uo[|7.tk8J2"199q/?1S.iAgD.X"a&Q(T*i)i{K=PUH~b)i殹(9|>VVVfY}u -v!ql8CaA@Bj%C22 LÃU:lFRA.;%_b 4 ^!l"ְa <,˂aj9mا$py8MS. K%e%/`{yNF@L z"IENDB`frama-c-20.0-Calcium/share/theme/default/valid_but_dead.png0000666000000000000000000000307213571573400020501 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.XlAQbyyYD6BnFA w+NzlG0Ml@MsX|&VS'*&dEB\·%VgftJ`PA44vj\m㈳` @g7aܨ7a7v;CΞ\u~(T*@UUE3w$I:\<._êh4vsW^=appPa{JrܽǷwAN1ypsO$\̫;S;o2/QYDL$f^" b``@cme_g'[&ټ/]j[IENDB`frama-c-20.0-Calcium/share/theme/default/valid_under_hyp.png0000666000000000000000000000314313571573400020726 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.d %Q$lVF۝k}+FTEFRtIv%QF@04fN)/@`JU6TYȤ ddb"AR.DASA`¾+ Ȓu%'aG *FVb¢L!iIA<[KV p $PغIа,I<-8)rIFI-UM+pIENDB`frama-c-20.0-Calcium/share/theme/flat/0000777000000000000000000000000013571573400014345 5ustar frama-c-20.0-Calcium/share/theme/flat/considered_valid.png0000666000000000000000000000113113571573400020345 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<IDAT8=hAٝuowO ӜFT4 @ KERP2\alV !Q9Ñ&+ y'ٻX8͹8?@˺].lTj;[.akF&Ϟ{pAg\T8۷R2\O@2}*tw&MT` g#Nn_.y2b@i63m}g/mS 7{VRYmd"dAe&ev&dZyT2 qC%CQPGݹBSAisD@w<8[pZ{GWQs!s^?Z$IBŹ;sf(8adX}$ V)=KjSf-a1|-&7؂wqbIENDB`frama-c-20.0-Calcium/share/theme/flat/fold.png0000666000000000000000000000025113571573400015775 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<&IDAT8c`05 paFC-<IENDB`frama-c-20.0-Calcium/share/theme/flat/inconsistent.png0000666000000000000000000000047113571573400017575 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<IDAT8Kn@##(9A.,<cyJ詚Vg9/X;|"5(}2k 3sal+GeVM3bD@c3`ΐ``zX&!m61@pNZTJ<7 u;55|brjQsFXgTgn m݈9WIENDB`frama-c-20.0-Calcium/share/theme/flat/invalid_but_dead.png0000666000000000000000000000072513571573400020334 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<RIDAT8=KPFO46).ɶ$tP!*XҿIpqPD6 M8Դ4=.>7Q4s?șBHQ 9Ts jBbW| ^GtdY3. )`h"@.i!r/&d: U$P6Rz\j ̄P[ҏm" vp]Rهu+>:5v;}VnjBj?Gh_Mu]qlZ׵! Yt[RSNBݟNɨ? r]c~8ԋIENDB`frama-c-20.0-Calcium/share/theme/flat/invalid_under_hyp.png0000666000000000000000000000111613571573400020555 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<IDAT8kAtl RDĪ4-A?`,*œBo`AQKQo~^J5쬇6& {xa!R%ZQEC5_,}8mZS9a1.Fj0:4( o/1j&˭ '^'OŶݶEx6O_ Ȱ}Ӷv qmqlCx1@08y^q %*{\vI26>e&SLd%7uzn!%I=HN?JFk74Dw@? b"c֔|5UpŸ>+ n[SP޽ $aԥj>@)7zE5ߎX8 brZ|J5TStVC .7W۟ɥռd؁vU7:IENDB`frama-c-20.0-Calcium/share/theme/flat/never_tried.png0000666000000000000000000000104613571573400017362 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<IDAT81opO('`,X;#ҡI:0w@VZF W$ڕ64b4`uTB;{{zSqRkgڌL6:=X jc%ޖSgn7rrZm=׍_A3wPWv卮Z Yp؍q#%lMx2"2@ևl[;=P~9u"r ;ng*{*e3aS&!`޽X<Gfm},$a}hD4l*`F!&"(poD7p,pϗbxI߯Te/ _a~1P0O~f3TdgYփ/K>`U>d9F#8Eo#,IENDB`frama-c-20.0-Calcium/share/theme/flat/surely_invalid.png0000666000000000000000000000113113571573400020100 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<IDAT8;oA̮vׅ Q^Q"** T ҀHK(q ؂ $kdž]; cc,bF:̥L7\fmk:5]fP/6F?*_ʬx%)těW?o޳:v?ݸ] FȰ1#Lָ7WnBۻK9&S$6w>RH'+<` /e;Nu ^^)[Z/ঙ)fCh=3$#X D*v?bԶ_`0j_e{KtiWN| Ar?sTnEh[$؏uUDU(_>_.pn 1vˏX\sM̆v0 g4oxIENDB`frama-c-20.0-Calcium/share/theme/flat/surely_valid.png0000666000000000000000000000115013571573400017552 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<IDAT8KhQs&q:6F)$FWZ (B >" ] ]BJ6l*BEDڀ-6qtfua#CI݅_M8zn.Ywg\#cj0a{x4}gCQn_Dd-Vě9ޕ*#*JeۗGj;OcemRP&NۅW g}]rپ$Y.zꂸS^/MA!PUێ(Ϭ@&f]%nZl*q{wAحart zs§ɔNmionxy$(E׺+P4$SE1v0RE8ll)O]5ab<֩=G-o mZFߕYIENDB`frama-c-20.0-Calcium/share/theme/flat/unfold.png0000666000000000000000000000030513571573400016340 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<BIDAT8c`@q&$B1d@u=>$6:\@tA1N0HLHH*U8IENDB`frama-c-20.0-Calcium/share/theme/flat/unknown.png0000666000000000000000000000105413571573400016552 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<IDAT8KKQTg23Bƌۤ1,T^ ?6kt[Z*;A.Ӣ -9]II^89|WJp3wKSg;ӬLFZ'ʔ?(&)*36v=ۧ%!BE$>ŎͼB/ + U5?9F$jfi;6;tK(1˨ɑ_pǒs(,ڊwyx^<0VUQ ǜvlVrƒSM[0uqtZtAx M`V[p j2&$x${SKf3_@Hzk Y[e]ln\7“ݗz𞺕:p C+*[.Ζr3y/mŠMCx=\<(xnZIENDB`frama-c-20.0-Calcium/share/theme/flat/valid_but_dead.png0000666000000000000000000000072213571573400020002 0ustar PNG  IHDRasBIT|d pHYs.tEXtSoftwarewww.inkscape.org<OIDAT8;KP\z&(bխkApstw/X?]\]ҥKUc/QkӦqi+hL}}7g-/TexrzD1+ΙV`q+Yd9]M-WΒ;r po@֋k\ß>\q؛c-_6P:px9䪛NK 9*Hҍ,3-)w^U^` 8 Ij h(nȾH l߁m+ݗDZ4? ގ @:m..lY _}_-ROYd# bmku9e3]E+pY`KMy\ ;먡, XY^c{؅s0N?卫(IENDB`frama-c-20.0-Calcium/share/unmark.png0000666000000000000000000000172413571573400014324 0ustar PNG  IHDRa;iCCPICC ProfilexKhP)B%>ЊPi֑q"4sgM31HAZ*BPp BkQq"B7R&L*V/$rUScE4`λɮvxUA5R'}V>PeIƊmKbyo5.Fl[%Wɼdc(&;F'AA^ `36jr2NdhdeQnM<%iF~YƕkE/+ Z_5+-Ϥ?vlSCs=0sTuTeܢea+ 79Z|U ps_.?g"np)9]3;6vG+nhnR.Os'ܢH7c*pZ{{"焷{tD3ɍ{sO7Tw鳭8Ej"u`G<$xŃ2o?ڗ Ӟ{N2~q4#h;Fѿ^/4T<#QqefY(˚mBa^AO^Y.c_/{4C\OLMd<ٵH&|s/>z~q6\ k`Ҳ䍐.&\xGIBQ(bC4,Hq6,IENDB`frama-c-20.0-Calcium/src/0000777000000000000000000000000013571573400012002 5ustar frama-c-20.0-Calcium/src/kernel_internals/0000777000000000000000000000000013571573400015341 5ustar frama-c-20.0-Calcium/src/kernel_internals/parsing/0000777000000000000000000000000013571573400017004 5ustar frama-c-20.0-Calcium/src/kernel_internals/parsing/clexer.mli0000666000000000000000000000766413571573400021006 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (** The C Lexer. *) val init: filename:string -> Lexing.lexbuf val finish: unit -> unit val initial: Lexing.lexbuf -> Cparser.token (** This is the main lexing function *) val push_context: unit -> unit (** Start a context *) val add_type: string -> unit (** Add a new string as a type name *) val add_identifier: string -> unit (** Add a new string as a variable name *) val pop_context: unit -> unit (** Remove all names added in this context *) val annot_char : char ref (** The character to recognize logic formulae in comments *) val currentLoc : unit -> Cabs.cabsloc val is_c_keyword: string -> bool (** [true] if the given string is a C keyword. @since Nitrogen-20111001 *) frama-c-20.0-Calcium/src/kernel_internals/parsing/clexer.mll0000666000000000000000000007435113571573400021006 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (* FrontC -- lexical analyzer ** ** 1.0 3.22.99 Hugues Cassé First version. ** 2.0 George Necula 12/12/00: Many extensions *) { open Cparser module H = Hashtbl module E = Errorloc let currentLoc () = E.currentLoc () let one_line_ghost = ref false let is_oneline_ghost () = !one_line_ghost let enter_oneline_ghost () = one_line_ghost := true let exit_oneline_ghost () = one_line_ghost := false let ghost_code = ref false let is_ghost_code () = !ghost_code let enter_ghost_code () = ghost_code := true let exit_ghost_code () = ghost_code := false let ghost_annot = ref false let is_ghost_annot () = !ghost_annot let enter_ghost_annot () = ghost_annot := true let exit_ghost_annot () = ghost_annot := false let addComment c = Cabshelper.Comments.add (currentLoc()) c (* Some debugging support for line numbers *) let dbgToken (t: token) = if false then begin let dprintf fmt = Kernel.debug fmt in (match t with IDENT n -> dprintf "IDENT(%s)\n" n | LBRACE l -> dprintf "LBRACE(%d)\n" (fst l).Filepath.pos_lnum | RBRACE l -> dprintf "RBRACE(%d)\n" (fst l).Filepath.pos_lnum | IF l -> dprintf "IF(%d)\n" (fst l).Filepath.pos_lnum | SWITCH l -> dprintf "SWITCH(%d)\n" (fst l).Filepath.pos_lnum | RETURN l -> dprintf "RETURN(%d)\n" (fst l).Filepath.pos_lnum | _ -> ()) ; t end else t (* ** Keyword hashtable *) let lexicon = H.create 211 let init_lexicon _ = H.clear lexicon; Logic_env.reset_typenames (); Logic_env.builtin_types_as_typenames (); List.iter (fun (key, builder) -> H.add lexicon key builder) [ ("auto", fun loc -> AUTO loc); ("const", fun loc -> CONST loc); ("__const", fun loc -> CONST loc); ("__const__", fun loc -> CONST loc); ("static", fun loc -> STATIC loc); ("extern", fun loc -> EXTERN loc); ("long", fun loc -> LONG loc); ("short", fun loc -> SHORT loc); ("register", fun loc -> REGISTER loc); ("signed", fun loc -> SIGNED loc); ("__signed", fun loc -> SIGNED loc); ("unsigned", fun loc -> UNSIGNED loc); ("volatile", fun loc -> VOLATILE loc); ("__volatile", fun loc -> VOLATILE loc); (* WW: see /usr/include/sys/cdefs.h for why __signed and __volatile * are accepted GCC-isms *) ("char", fun loc -> CHAR loc); ("_Bool", fun loc -> BOOL loc); ("int", fun loc -> INT loc); ("float", fun loc -> FLOAT loc); ("double", fun loc -> DOUBLE loc); ("void", fun loc -> VOID loc); ("enum", fun loc -> ENUM loc); ("struct", fun loc -> STRUCT loc); ("typedef", fun loc -> TYPEDEF loc); ("union", fun loc -> UNION loc); ("break", fun loc -> BREAK loc); ("continue", fun loc -> CONTINUE loc); ("goto", fun loc -> GOTO loc); ("return", fun loc -> dbgToken (RETURN loc)); ("switch", fun loc -> dbgToken (SWITCH loc)); ("case", fun loc -> CASE loc); ("default", fun loc -> DEFAULT loc); ("while", fun loc -> WHILE loc); ("do", fun loc -> DO loc); ("for", fun loc -> FOR loc); ("if", fun loc -> dbgToken (IF loc)); ("else", fun _ -> ELSE); (*** Implementation specific keywords ***) ("__signed__", fun loc -> SIGNED loc); ("__inline__", fun loc -> INLINE loc); ("inline", fun loc -> INLINE loc); ("__inline", fun loc -> INLINE loc); ("_inline", fun loc -> if !Cprint.msvcMode then INLINE loc else IDENT ("_inline")); ("__attribute__", fun loc -> ATTRIBUTE loc); ("__attribute", fun loc -> ATTRIBUTE loc); ("__blockattribute__", fun _ -> BLOCKATTRIBUTE); ("__blockattribute", fun _ -> BLOCKATTRIBUTE); ("__asm__", fun loc -> ASM loc); ("asm", fun loc -> ASM loc); ("__typeof__", fun loc -> TYPEOF loc); ("__typeof", fun loc -> TYPEOF loc); ("typeof", fun loc -> TYPEOF loc); ("__alignof", fun loc -> ALIGNOF loc); ("__alignof__", fun loc -> ALIGNOF loc); ("__volatile__", fun loc -> VOLATILE loc); ("__volatile", fun loc -> VOLATILE loc); ("__FUNCTION__", fun loc -> FUNCTION__ loc); ("__func__", fun loc -> FUNCTION__ loc); (* ISO 6.4.2.2 *) ("__PRETTY_FUNCTION__", fun loc -> PRETTY_FUNCTION__ loc); ("__label__", fun _ -> LABEL__); (*** weimer: GCC arcana ***) ("__restrict", fun loc -> RESTRICT loc); ("restrict", fun loc -> RESTRICT loc); (* ("__extension__", EXTENSION); *) (**** MS VC ***) ("__int64", fun _ -> INT64 (currentLoc ())); ("__int32", fun loc -> INT loc); ("_cdecl", fun _ -> MSATTR ("_cdecl", currentLoc ())); ("__cdecl", fun _ -> MSATTR ("__cdecl", currentLoc ())); ("_stdcall", fun _ -> MSATTR ("_stdcall", currentLoc ())); ("__stdcall", fun _ -> MSATTR ("__stdcall", currentLoc ())); ("_fastcall", fun _ -> MSATTR ("_fastcall", currentLoc ())); ("__fastcall", fun _ -> MSATTR ("__fastcall", currentLoc ())); ("__w64", fun _ -> MSATTR("__w64", currentLoc ())); ("__declspec", fun loc -> DECLSPEC loc); ("__forceinline", fun loc -> INLINE loc); (* !! we turn forceinline * into inline *) ("__try", fun loc -> TRY loc); ("__except", fun loc -> EXCEPT loc); ("__finally", fun loc -> FINALLY loc); (* weimer: some files produced by 'GCC -E' expect this type to be * defined *) ("__builtin_va_list", fun _ -> NAMED_TYPE "__builtin_va_list"); ("__builtin_va_arg", fun loc -> BUILTIN_VA_ARG loc); ("__builtin_types_compatible_p", fun loc -> BUILTIN_TYPES_COMPAT loc); ("__builtin_offsetof", fun loc -> BUILTIN_OFFSETOF loc); (* On some versions of GCC __thread is a regular identifier *) ("__thread", (fun loc -> if Cil.theMachine.Cil.theMachine.Cil_types.__thread_is_keyword then THREAD loc else IDENT "__thread")); ] let is_c_keyword s = Hashtbl.mem lexicon s (* Mark an identifier as a type name. The old mapping is preserved and will * be reinstated when we exit this context *) let add_type name = (* ignore (print_string ("adding type name " ^ name ^ "\n")); *) H.add lexicon name (fun _ -> NAMED_TYPE name); Logic_env.add_typename name let context : string list list ref = ref [ [] ] let push_context _ = context := []::!context let pop_context _ = match !context with [] -> Kernel.fatal "Empty context stack" | con::sub -> (context := sub; List.iter (fun name -> (* Format.eprintf "removing lexicon for %s@." name; *) H.remove lexicon name; Logic_env.remove_typename name ) con) (* Mark an identifier as a variable name. The old mapping is preserved and * will be reinstated when we exit this context *) let add_identifier name = match !context with [] -> Kernel.fatal "Empty context stack" | con::sub -> (context := (name::con)::sub; (*Format.eprintf "adding IDENT for %s@." name;*) H.add lexicon name (fun _ -> dbgToken (IDENT name)); Logic_env.hide_typename name ) (* ** Useful primitives *) let scan_ident id = let here = currentLoc () in try (H.find lexicon id) here (* default to variable name, as opposed to type *) with Not_found -> dbgToken (IDENT id) (* ** Buffer processor *) let init ~(filename: string) : Lexing.lexbuf = init_lexicon (); (* Initialize the pointer in Errormsg *) Lexerhack.add_type := add_type; Lexerhack.push_context := push_context; Lexerhack.pop_context := pop_context; Lexerhack.add_identifier := add_identifier; E.startParsing filename let finish () = E.finishParsing (); Logic_env.reset_typenames () (*** escape character management ***) let scan_escape (char: char) : int64 = let result = match char with 'n' -> '\n' | 'r' -> '\r' | 't' -> '\t' | 'b' -> '\b' | 'f' -> '\012' (* ASCII code 12 *) | 'v' -> '\011' (* ASCII code 11 *) | 'a' -> '\007' (* ASCII code 7 *) | 'e' | 'E' -> '\027' (* ASCII code 27. This is a GCC extension *) | '\'' -> '\'' | '"'-> '"' (* '"' *) | '?' -> '?' | '(' when not !Cprint.msvcMode -> '(' | '{' when not !Cprint.msvcMode -> '{' | '[' when not !Cprint.msvcMode -> '[' | '%' when not !Cprint.msvcMode -> '%' | '\\' -> '\\' | other -> E.parse_error "Unrecognized escape sequence: \\%c" other in Int64.of_int (Char.code result) let scan_hex_escape str = let radix = Int64.of_int 16 in let the_value = ref Int64.zero in (* start at character 2 to skip the \x *) for i = 2 to (String.length str) - 1 do let thisDigit = Cabshelper.valueOfDigit (String.get str i) in (* the_value := !the_value * 16 + thisDigit *) the_value := Int64.add (Int64.mul !the_value radix) thisDigit done; !the_value let scan_oct_escape str = let radix = Int64.of_int 8 in let the_value = ref Int64.zero in (* start at character 1 to skip the \x *) for i = 1 to (String.length str) - 1 do let thisDigit = Cabshelper.valueOfDigit (String.get str i) in (* the_value := !the_value * 8 + thisDigit *) the_value := Int64.add (Int64.mul !the_value radix) thisDigit done; !the_value let lex_hex_escape remainder lexbuf = let prefix = scan_hex_escape (Lexing.lexeme lexbuf) in prefix :: remainder lexbuf let lex_oct_escape remainder lexbuf = let prefix = scan_oct_escape (Lexing.lexeme lexbuf) in prefix :: remainder lexbuf let lex_simple_escape remainder lexbuf = let lexchar = Lexing.lexeme_char lexbuf 1 in let prefix = scan_escape lexchar in prefix :: remainder lexbuf let lex_unescaped remainder lexbuf = let prefix = Int64.of_int (Char.code (Lexing.lexeme_char lexbuf 0)) in prefix :: remainder lexbuf let lex_comment remainder buffer lexbuf = let s = Lexing.lexeme lexbuf in if s = "\n" then E.newline() ; (match buffer with None -> () | Some b -> Buffer.add_string b s) ; remainder buffer lexbuf let do_lex_comment ?(first_string="") remainder lexbuf = let buffer = if Kernel.PrintComments.get () then begin let b = Buffer.create 80 in Buffer.add_string b first_string; Some b end else None in remainder buffer lexbuf ; match buffer with | Some b -> addComment (Buffer.contents b) | None -> () (* ISO standard locale-specific function to convert a wide character * into a sequence of normal characters. Here we work on strings. * We convert L"Hi" to "H\000i\000" matth: this seems unused. let wbtowc wstr = let len = String.length wstr in let dest = String.make (len * 2) '\000' in for i = 0 to len-1 do dest.[i*2] <- wstr.[i] ; done ; dest *) (* This function converts the "Hi" in L"Hi" to { L'H', L'i', L'\0' } matth: this seems unused. let wstr_to_warray wstr = let len = String.length wstr in let res = ref "{ " in for i = 0 to len-1 do res := !res ^ (Printf.sprintf "L'%c', " wstr.[i]) done ; res := !res ^ "}" ; !res *) (* Pragmas get explicit end-of-line tokens. * Elsewhere they are silently discarded as whitespace. *) let pragmaLine = ref false let annot_char = ref '@' let () = Kernel.ReadAnnot.add_set_hook (fun _ x -> (* prevent the C lexer interpretation of comments *) annot_char := if x then '@' else '\000') let annot_start_pos = ref Cabshelper.cabslu let buf = Buffer.create 1024 let save_current_pos () = annot_start_pos := currentLoc () let annot_lex initial rule lexbuf = try save_current_pos (); Buffer.clear buf; rule lexbuf with Parsing.Parse_error -> let source = Cil_datatype.Position.of_lexing_pos (Lexing.lexeme_start_p lexbuf) in Kernel.warning ~wkey:Kernel.wkey_annot_error ~source "skipping annotation"; initial lexbuf let make_annot ~one_line default lexbuf s = let start = snd !annot_start_pos in match Logic_lexer.annot (start, s) with | Some (stop, token) -> lexbuf.Lexing.lex_curr_p <- Cil_datatype.Position.to_lexing_pos stop; (* The filename has already been normalized, so we must reuse it "as is". *) E.setCurrentFile (stop.Filepath.pos_path :> string); E.setCurrentLine stop.Filepath.pos_lnum; if one_line then E.newline (); (match token with | Logic_ptree.Adecl d -> DECL d | Logic_ptree.Aspec -> SPEC (start,s) (* At this point, we only have identified a function spec. Complete parsing of the annotation will only occur in the cparser.mly rule. *) | Logic_ptree.Acode_annot (loc,a) -> CODE_ANNOT (a, loc) | Logic_ptree.Aloop_annot (loc,a) -> LOOP_ANNOT (a,loc) | Logic_ptree.Aattribute_annot (loc,a) -> ATTRIBUTE_ANNOT (a, loc) | Logic_ptree.Acustom(loc,id, a) -> CUSTOM_ANNOT(a, id, loc)) | None -> (* error occured and annotation is discarded. Find a normal token. *) default lexbuf } let decdigit = ['0'-'9'] let octdigit = ['0'-'7'] let hexdigit = ['0'-'9' 'a'-'f' 'A'-'F'] let binarydigit = ['0' '1'] let letter = ['a'- 'z' 'A'-'Z'] let usuffix = ['u' 'U'] let lsuffix = "l"|"L"|"ll"|"LL" let intsuffix = lsuffix | usuffix | usuffix lsuffix | lsuffix usuffix | usuffix ? "i64" let hexprefix = '0' ['x' 'X'] let binaryprefix = '0' ['b' 'B'] let intnum = decdigit+ intsuffix? let octnum = '0' octdigit+ intsuffix? let hexnum = hexprefix hexdigit+ intsuffix? let binarynum = binaryprefix binarydigit+ intsuffix? let exponent = ['e' 'E']['+' '-']? decdigit+ let fraction = '.' decdigit+ let decfloat = (intnum? fraction) |(intnum exponent) |(intnum? fraction exponent) | (intnum '.') | (intnum '.' exponent) let hexfraction = hexdigit* '.' hexdigit+ | hexdigit+ '.' let binexponent = ['p' 'P'] ['+' '-']? decdigit+ let hexfloat = hexprefix hexfraction binexponent | hexprefix hexdigit+ binexponent let floatsuffix = ['f' 'F' 'l' 'L'] let floatnum = (decfloat | hexfloat) floatsuffix? let ident = (letter|'_')(letter|decdigit|'_'|'$')* let blank = [' ' '\t' '\012' '\r' '\026'(*this is the plain old DOS eof char*)]+ let escape = '\\' _ let hex_escape = '\\' ['x' 'X'] hexdigit+ let oct_escape = '\\' octdigit octdigit? octdigit? (* Pragmas that are not parsed by CIL. We lex them as PRAGMA_LINE tokens *) let no_parse_pragma = "warning" | "GCC" (* Solaris-style pragmas: *) | "ident" | "section" | "option" | "asm" | "use_section" | "weak" | "redefine_extname" | "TCS_align" (* Embedded world *) | "global_register" | "location" rule initial = parse | "/*" ("" | "@{" | "@}" as suf) (* Skip special doxygen comments. Use of '@' instead of '!annot_char' is intentional *) { do_lex_comment ~first_string:suf comment lexbuf ; initial lexbuf } | "/*" ([^ '*' '\n'] as c) { if c = !annot_char then begin annot_lex initial annot_first_token lexbuf end else begin do_lex_comment ~first_string:(String.make 1 c) comment lexbuf ; initial lexbuf end } | "//" ("" | "@{" | "@}" as suf) (* See comment for "/*@{" above *) { do_lex_comment ~first_string:suf onelinecomment lexbuf ; E.newline(); if is_oneline_ghost () then begin exit_oneline_ghost (); RGHOST end else begin initial lexbuf end } | "//" ([^ '\n'] as c) { if c = !annot_char then begin annot_lex initial annot_one_line lexbuf end else begin do_lex_comment ~first_string:(String.make 1 c) onelinecomment lexbuf; E.newline(); if is_oneline_ghost () then begin exit_oneline_ghost (); RGHOST end else begin initial lexbuf end end } | blank {initial lexbuf} | '\n' { E.newline (); if !pragmaLine then begin pragmaLine := false; PRAGMA_EOL end else if is_oneline_ghost () then begin exit_oneline_ghost (); RGHOST end else begin initial lexbuf end } | '\\' '\r' * '\n' { E.newline (); initial lexbuf } | '#' { hash lexbuf} | "%:" { hash lexbuf} | "_Pragma" { PRAGMA (currentLoc ()) } | '\'' { let start = Lexing.lexeme_start_p lexbuf in let content = chr lexbuf in let last = Lexing.lexeme_end_p lexbuf in CST_CHAR (content, Cil_datatype.Location.of_lexing_loc (start,last)) } | "L'" { let start = Lexing.lexeme_start_p lexbuf in let content = chr lexbuf in let last = Lexing.lexeme_end_p lexbuf in CST_WCHAR (content, Cil_datatype.Location.of_lexing_loc (start,last)) } | '"' { let start = Lexing.lexeme_start_p lexbuf in let content = str lexbuf in let last = Lexing.lexeme_end_p lexbuf in CST_STRING (content, Cil_datatype.Location.of_lexing_loc (start,last)) } | "L\"" { let start = Lexing.lexeme_start_p lexbuf in let content = str lexbuf in let last = Lexing.lexeme_end_p lexbuf in CST_WSTRING(content, Cil_datatype.Location.of_lexing_loc (start,last)) } | floatnum {CST_FLOAT (Lexing.lexeme lexbuf, currentLoc ())} | binarynum { (* GCC Extension for binary numbers *) CST_INT (Lexing.lexeme lexbuf, currentLoc ())} | hexnum {CST_INT (Lexing.lexeme lexbuf, currentLoc ())} | octnum {CST_INT (Lexing.lexeme lexbuf, currentLoc ())} | intnum {CST_INT (Lexing.lexeme lexbuf, currentLoc ())} | "!quit!" {EOF} | "..." {ELLIPSIS} | "+=" {PLUS_EQ} | "-=" {MINUS_EQ} | "*=" {STAR_EQ} | "/=" {SLASH_EQ} | "%=" {PERCENT_EQ} | "|=" {PIPE_EQ} | "&=" {AND_EQ} | "^=" {CIRC_EQ} | "<<=" {INF_INF_EQ} | ">>=" {SUP_SUP_EQ} | "<<" {INF_INF} | ">>" {SUP_SUP} | "==" {EQ_EQ} | "!=" {EXCLAM_EQ} | "<=" {INF_EQ} | ">=" {SUP_EQ} | "=" {EQ} | "<" {INF} | ">" {SUP} | "++" {PLUS_PLUS (currentLoc ())} | "--" {MINUS_MINUS (currentLoc ())} | "->" {ARROW} | '+' {PLUS (currentLoc ())} | '-' {MINUS (currentLoc ())} | '*' { if is_ghost_code () then might_end_ghost lexbuf else STAR (currentLoc ())} | "/" ([^ '\n'] as c) { if c = !annot_char then if is_ghost_code () || is_oneline_ghost () then begin enter_ghost_annot(); annot_lex initial annot_first_token lexbuf end else E.parse_error "This kind of annotation is valid only inside ghost code" else begin lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 1; SLASH end } | '/' {SLASH} | '%' {PERCENT} | '!' {EXCLAM (currentLoc ())} | "&&" {AND_AND (currentLoc ())} | "||" {PIPE_PIPE} | '&' {AND (currentLoc ())} | '|' {PIPE} | '^' {CIRC} | '?' {QUEST} | ':' { if Cabshelper.is_attr_test () then begin Cabshelper.pop_attr_test (); COLON2 end else COLON } | '~' {TILDE (currentLoc ())} | '{' {dbgToken (LBRACE (currentLoc ()))} | '}' {dbgToken (RBRACE (currentLoc ()))} | "<%" {dbgToken (LBRACE (currentLoc ()))} | "%>" {dbgToken (RBRACE (currentLoc ()))} | '[' {LBRACKET} | ']' {RBRACKET} | "<:" {LBRACKET} | ":>" {RBRACKET} | '(' {dbgToken (LPAREN (currentLoc ())) } | ')' {RPAREN} | ';' {dbgToken (SEMICOLON (currentLoc ())) } | ',' {COMMA} | '.' {DOT} | "sizeof" {SIZEOF (currentLoc ())} | "__asm" { if !Cprint.msvcMode then MSASM (msasm lexbuf, currentLoc ()) else (ASM (currentLoc ())) } (* If we see __pragma we eat it and the matching parentheses as well *) | "__pragma" { let _ = matchingpars 0 lexbuf in initial lexbuf } (* __extension__ is a black. The parser runs into some conflicts if we let it * pass *) | "__extension__" {initial lexbuf } | ident {scan_ident (Lexing.lexeme lexbuf)} | eof { if is_oneline_ghost() then begin exit_oneline_ghost (); RGHOST end else EOF } | _ as c { if is_ghost_code() && c = '@' then initial lexbuf else E.parse_error "Invalid symbol" } and might_end_ghost = parse | '/' { exit_ghost_code(); RGHOST } | "" { STAR (currentLoc()) } and comment buffer = parse | "*/" { } | eof { E.parse_error "Unterminated C comment" } | _ { lex_comment comment buffer lexbuf } and onelinecomment buffer = parse | "*/" { if is_ghost_code () then (* end of multiline comment *) lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 2 else lex_comment onelinecomment buffer lexbuf } | '\n'|eof { } | _ { lex_comment onelinecomment buffer lexbuf } and matchingpars parsopen = parse '\n' { E.newline (); matchingpars parsopen lexbuf } | blank { matchingpars parsopen lexbuf } | '(' { matchingpars (parsopen + 1) lexbuf } | ')' { if parsopen > 1 then matchingpars (parsopen - 1) lexbuf } | "/*" { do_lex_comment comment lexbuf ; matchingpars parsopen lexbuf } | '"' { let _ = str lexbuf in matchingpars parsopen lexbuf } | _ { matchingpars parsopen lexbuf } (* # ... *) and hash = parse '\n' { E.newline (); initial lexbuf} | blank { hash lexbuf} | intnum { (* We are seeing a line number. This is the number for the * next line *) let s = Lexing.lexeme lexbuf in let lineno = try int_of_string s with Failure _ -> (* the int is too big. *) Kernel.warning "Bad line number in preprocessed file: %s" s; (-1) in E.setCurrentLine (lineno - 1); (* A file name may follow *) file lexbuf } | "line" { hash lexbuf } (* MSVC line number info *) (* For pragmas with irregular syntax, like #pragma warning, * we parse them as a whole line. *) | "pragma" blank (no_parse_pragma as pragmaName) { let here = currentLoc () in PRAGMA_LINE (pragmaName ^ pragma lexbuf, here) } | "pragma" { pragmaLine := true; PRAGMA (currentLoc ()) } | _ { endline lexbuf} and file = parse '\n' {E.newline (); initial lexbuf} | blank {file lexbuf} (* The //-ending file directive is a GCC extension that provides the CWD of the preprocessor when the file was preprocessed. *) | '"' ([^ '\012' '\t' '"']* as d) "//\"" { E.setCurrentWorkingDirectory d; endline lexbuf } | '"' ([^ '\012' '\t' '"']* as f) '"' { E.setCurrentFile f; endline lexbuf} | _ {endline lexbuf} and endline = parse '\n' { E.newline (); initial lexbuf} | eof { EOF } | _ { endline lexbuf} and pragma = parse '\n' { E.newline (); "" } | _ { let cur = Lexing.lexeme lexbuf in cur ^ (pragma lexbuf) } and str = parse '"' {[]} (* no nul terminiation in CST_STRING '"' *) | hex_escape {lex_hex_escape str lexbuf} | oct_escape {lex_oct_escape str lexbuf} | escape {lex_simple_escape str lexbuf} | eof {E.parse_error "unterminated string" } | _ {lex_unescaped str lexbuf} and chr = parse '\'' {[]} | hex_escape {lex_hex_escape chr lexbuf} | oct_escape {lex_oct_escape chr lexbuf} | escape {lex_simple_escape chr lexbuf} | eof { E.parse_error "unterminated char" } | _ {lex_unescaped chr lexbuf} and msasm = parse blank { msasm lexbuf } | '{' { msasminbrace lexbuf } | _ { let cur = Lexing.lexeme lexbuf in cur ^ (msasmnobrace lexbuf) } and msasminbrace = parse '}' { "" } | _ { let cur = Lexing.lexeme lexbuf in cur ^ (msasminbrace lexbuf) } and msasmnobrace = parse ['}' ';' '\n'] { lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 1; "" } | "__asm" { lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 5; "" } | _ { let cur = Lexing.lexeme lexbuf in cur ^ (msasmnobrace lexbuf) } and annot_first_token = parse | "ghost" { if is_oneline_ghost () then E.parse_error "nested ghost code"; Buffer.clear buf; enter_ghost_code (); LGHOST } | ' '|'@'|'\t'|'\r' as c { Buffer.add_char buf c; annot_first_token lexbuf } | '\n' { E.newline(); Buffer.add_char buf '\n'; annot_first_token lexbuf } | "" { annot_token lexbuf } and annot_token = parse | "*/" { if is_ghost_annot () then E.parse_error "Ghost multi-line annotation not terminated"; let s = Buffer.contents buf in make_annot ~one_line:false initial lexbuf s } | eof { E.parse_error "Unterminated annotation" } | '\n' {E.newline(); Buffer.add_char buf '\n'; annot_token lexbuf } | _ as c { if is_ghost_annot () && c = !annot_char then might_end_ghost_annot lexbuf else (Buffer.add_char buf c; annot_token lexbuf) } and might_end_ghost_annot = parse | '/' { exit_ghost_annot (); let s = Buffer.contents buf in make_annot ~one_line:false initial lexbuf s } | "" { Buffer.add_char buf !annot_char; annot_token lexbuf } and annot_one_line = parse | "ghost" { if is_oneline_ghost () then E.parse_error "nested ghost code"; enter_oneline_ghost (); LGHOST } | ' '|'@'|'\t'|'\r' as c { Buffer.add_char buf c; annot_one_line lexbuf } | "" { annot_one_line_logic lexbuf } and annot_one_line_logic = parse | '\n' { make_annot ~one_line:true initial lexbuf (Buffer.contents buf) } | _ as c { Buffer.add_char buf c; annot_one_line_logic lexbuf } { (* Catch the exceptions raised by the lexer itself *) let initial lexbuf = try initial lexbuf with Failure _ -> raise Parsing.Parse_error } (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_internals/parsing/cparser.mly0000666000000000000000000020214613571573400021173 0ustar /****************************************************************************/ /* */ /* Copyright (C) 2001-2003 */ /* George C. Necula */ /* Scott McPeak */ /* Wes Weimer */ /* Ben Liblit */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* 1. Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* 2. Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the distribution. */ /* */ /* 3. The names of the contributors may not be used to endorse or */ /* promote products derived from this software without specific prior */ /* written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */ /* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */ /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */ /* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */ /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */ /* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */ /* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */ /* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* */ /* File modified by CEA (Commissariat à l'énergie atomique et aux */ /* énergies alternatives) */ /* and INRIA (Institut National de Recherche en Informatique */ /* et Automatique). */ /****************************************************************************/ /* 3.22.99 Hugues Cass First version. 2.0 George Necula 12/12/00: Practically complete rewrite. */ %{ open Cabs open Cabshelper (* This function is used by the parsing engine generated by Ocamlyacc itself, and requires a string as argument. *) let parse_error msg = Errorloc.parse_error "%s" msg (* ** Expression building *) let smooth_expression lst = match lst with [] -> { expr_loc = cabslu; expr_node = NOTHING } | [expr] -> expr | _ -> let beg_loc = fst (List.hd lst).expr_loc in let end_loc = snd (Extlib.last lst).expr_loc in { expr_loc = (beg_loc,end_loc); expr_node = COMMA (lst) } let merge_string (c1,(b1,_)) (c2,(_,e2)) = c1 @ c2, (b1,e2) (* To be called only inside a grammar rule. *) let make_expr e = { expr_loc = Cil_datatype.Location.of_lexing_loc (symbol_start_pos (), symbol_end_pos ()); expr_node = e } let currentFunctionName = ref "" exception NoProto (* Go through all the parameter names and mark them as identifiers *) let rec findProto = function PROTO (d, args, _,_) when isJUSTBASE d -> List.iter (fun (_, (an, _, _, _)) -> !Lexerhack.add_identifier an) args | PROTO (d, _,_, _) -> findProto d | PARENTYPE (_, d, _) -> findProto d | PTR (_, d) -> findProto d | ARRAY (d, _, _) -> findProto d | _ -> raise NoProto and isJUSTBASE = function JUSTBASE -> true | PARENTYPE (_, d, _) -> isJUSTBASE d | _ -> false let announceFunctionName ((n, decl, _, _):name) = !Lexerhack.add_identifier n; (* Start a context that includes the parameter names and the whole body. * Will pop when we finish parsing the function body *) !Lexerhack.push_context (); (try findProto decl with NoProto -> Errorloc.parse_error "Cannot find the prototype in a function definition"); currentFunctionName := n let check_funspec_abrupt_clauses fname spec = List.iter (fun bhv -> List.iter (function | (Cil_types.Normal | Cil_types.Exits),_ -> () | (Cil_types.Breaks | Cil_types.Continues | Cil_types.Returns), {Logic_ptree.lexpr_loc = (loc,_)} -> Errorloc.parse_error ~source:loc "Specification of function %s can only contain ensures or \ exits post-conditions" fname) bhv.Logic_ptree.b_post_cond) spec.Logic_ptree.spec_behavior let applyPointer (ptspecs: attribute list list) (dt: decl_type) : decl_type = (* Outer specification first *) let rec loop = function [] -> dt | attrs :: rest -> PTR(attrs, loop rest) in loop ptspecs let doDeclaration logic_spec (loc: cabsloc) (specs: spec_elem list) (nl: init_name list) = if isTypedef specs then begin (* Tell the lexer about the new type names *) List.iter (fun ((n, _, _, _), _) -> !Lexerhack.add_type n) nl; TYPEDEF ((specs, List.map (fun (n, _) -> n) nl), loc) end else if nl = [] then ONLYTYPEDEF (specs, loc) else begin (* Tell the lexer about the new variable names *) List.iter (fun ((n, _, _, _), _) -> !Lexerhack.add_identifier n) nl; !Lexerhack.push_context (); List.iter (fun ((_,t,_,_),_) -> try findProto t with NoProto -> ()) nl; let logic_spec = match logic_spec with | None -> None | Some (loc, _ as ls) -> begin Extlib.opt_map (fun (loc', spec) -> let name = match nl with | [ (n,_,_,_),_ ] -> n | _ -> "unknown function" in check_funspec_abrupt_clauses name spec; (spec, (loc, loc'))) (Logic_lexer.spec ls) end in !Lexerhack.pop_context (); DECDEF (logic_spec, (specs, nl), loc) end let in_ghost = let ghost_me = object inherit Cabsvisit.nopCabsVisitor method! vstmt s = s.stmt_ghost <- true; Cil.DoChildren end in List.map (fun s -> ignore (Cabsvisit.visitCabsStatement ghost_me s); s) let ghost_global = ref false let doFunctionDef spec (loc: cabsloc) (lend: cabsloc) (specs: spec_elem list) (n: name) (b: block) : definition = let fname = (specs, n) in let name = match n with (n,_,_,_) -> n in Extlib.may (fun (spec, _) -> check_funspec_abrupt_clauses name spec) spec; let b = if !ghost_global then { b with bstmts = in_ghost b.bstmts } else b in FUNDEF (spec, fname, b, loc, lend) let doOldParDecl (names: string list) ((pardefs: name_group list), (isva: bool)) : single_name list * bool = let findOneName n = (* Search in pardefs for the definition for this parameter *) let rec loopGroups = function [] -> ([SpecType Tint], (n, JUSTBASE, [], cabslu)) | (specs, names) :: restgroups -> let rec loopNames = function [] -> loopGroups restgroups | ((n',_, _, _) as sn) :: _ when n' = n -> (specs, sn) | _ :: restnames -> loopNames restnames in loopNames names in loopGroups pardefs in let args = List.map findOneName names in (args, isva) let int64_to_char value = if (Int64.compare value (Int64.of_int 255) > 0) || (Int64.compare value Int64.zero < 0) then Errorloc.parse_error "integral literal 0x%Lx too big" value else Char.chr (Int64.to_int value) (* takes a not-nul-terminated list, and converts it to a string. *) let intlist_to_string (str: int64 list):string = let buffer = Buffer.create (List.length str) in let add_char c = Buffer.add_char buffer (int64_to_char c) in List.iter add_char str ; Buffer.contents buffer let fst3 (result, _, _) = result let trd3 (_, _, result) = result let fourth4 (_,_,_,result) = result (* transform: __builtin_offsetof(type, member) into : (size_t) (&(type * ) 0)->member *) let sizeofType () = let findSpecifier name = let convert_one_specifier s = if s = "int" then Cabs.Tint else if s = "unsigned" then Cabs.Tunsigned else if s = "long" then Cabs.Tlong else if s = "short" then Cabs.Tshort else if s = "char" then Cabs.Tchar else Kernel.fatal ~current:true "initCIL: cannot find the right specifier for type %s" name in let add_one_specifier s acc = (Cabs.SpecType (convert_one_specifier s)) :: acc in let specs = Str.split (Str.regexp " +") name in List.fold_right add_one_specifier specs [] in findSpecifier Cil.theMachine.Cil.theMachine.Cil_types.size_t let transformOffsetOf (speclist, dtype) member = let mk_expr e = { expr_loc = member.expr_loc; expr_node = e } in let rec addPointer = function | JUSTBASE -> PTR([], JUSTBASE) | PARENTYPE (attrs1, dtype, attrs2) -> PARENTYPE (attrs1, addPointer dtype, attrs2) | ARRAY (dtype, attrs, expr) -> ARRAY (addPointer dtype, attrs, expr) | PTR (attrs, dtype) -> PTR (attrs, addPointer dtype) | PROTO (dtype, names, gnames, variadic) -> PROTO (addPointer dtype, names, gnames,variadic) in let nullType = (speclist, addPointer dtype) in let nullExpr = mk_expr (CONSTANT (CONST_INT "0")) in let castExpr = mk_expr (CAST (nullType, SINGLE_INIT nullExpr)) in let rec replaceBase e = let node = match e.expr_node with | VARIABLE field -> MEMBEROFPTR (castExpr, field) | MEMBEROF (base, field) -> MEMBEROF (replaceBase base, field) | INDEX (base, index) -> INDEX (replaceBase base, index) | _ -> Errorloc.parse_error "malformed offset expression in __builtin_offsetof" in { e with expr_node = node } in let memberExpr = replaceBase member in let addrExpr = { memberExpr with expr_node = UNARY (ADDROF, memberExpr)} in let sizeofType = sizeofType(), JUSTBASE in { addrExpr with expr_node = CAST (sizeofType, SINGLE_INIT addrExpr)} let no_ghost_stmt s = {stmt_ghost = false ; stmt_node = s} let no_ghost = List.map no_ghost_stmt let in_block l = match l with [] -> no_ghost_stmt (NOP cabslu) | [s] -> s | _::_ -> no_ghost_stmt (BLOCK ({ blabels = []; battrs = []; bstmts = l}, get_statementloc (List.hd l), get_statementloc (Extlib.last l))) %} %token SPEC %token DECL %token CODE_ANNOT %token LOOP_ANNOT %token ATTRIBUTE_ANNOT %token CUSTOM_ANNOT %token IDENT %token CST_CHAR %token CST_WCHAR %token CST_INT %token CST_FLOAT %token NAMED_TYPE /* Each character is its own list element, and the terminating nul is not included in this list. */ %token CST_STRING %token CST_WSTRING %token EOF %token BOOL CHAR INT DOUBLE FLOAT VOID INT64 %token ENUM STRUCT TYPEDEF UNION %token SIGNED UNSIGNED LONG SHORT %token VOLATILE EXTERN STATIC CONST RESTRICT AUTO REGISTER %token THREAD %token SIZEOF ALIGNOF %token EQ PLUS_EQ MINUS_EQ STAR_EQ SLASH_EQ PERCENT_EQ %token AND_EQ PIPE_EQ CIRC_EQ INF_INF_EQ SUP_SUP_EQ %token ARROW DOT %token EQ_EQ EXCLAM_EQ INF SUP INF_EQ SUP_EQ %token PLUS MINUS STAR %token SLASH PERCENT %token TILDE AND %token PIPE CIRC %token EXCLAM AND_AND %token PIPE_PIPE %token INF_INF SUP_SUP %token PLUS_PLUS MINUS_MINUS %token RPAREN %token LPAREN RBRACE %token LBRACE %token LBRACKET RBRACKET %token COLON COLON2 %token SEMICOLON %token COMMA ELLIPSIS QUEST %token BREAK CONTINUE GOTO RETURN %token SWITCH CASE DEFAULT %token WHILE DO FOR %token IF TRY EXCEPT FINALLY %token ELSE %token ATTRIBUTE INLINE ASM TYPEOF FUNCTION__ PRETTY_FUNCTION__ %token LABEL__ %token BUILTIN_VA_ARG %token BLOCKATTRIBUTE %token BUILTIN_TYPES_COMPAT BUILTIN_OFFSETOF %token DECLSPEC %token MSASM MSATTR %token PRAGMA_LINE %token PRAGMA %token PRAGMA_EOL /*Frama-C: ghost bracketing */ %token LGHOST RGHOST /* operator precedence */ %nonassoc IF %nonassoc ELSE %right NAMED_TYPE /* We'll use this to handle redefinitions of NAMED_TYPE as variables */ %left IDENT /* Non-terminals informations */ %start interpret file %type <(bool*Cabs.definition) list> file interpret globals %type global %type attributes attributes_with_asm asmattr %type constant %type string_constant %type expression %type opt_expression %type init_expression %type comma_expression %type paren_comma_expression %type arguments %type bracket_comma_expression %type string_list %type wstring_list %type initializer_single %type <(Cabs.initwhat * Cabs.init_expression) list> initializer_list %type init_designators init_designators_opt %type decl_spec_list %type type_spec %type struct_decl_list %type old_proto_decl %type parameter_decl %type enumerator %type enum_list %type declaration function_def %type function_def_start %type type_name %type block %type block_element_list %type local_labels local_label_names %type old_parameter_list_ne %type init_declarator %type init_declarator_list %type declarator %type field_decl %type <(Cabs.name * expression option) list> field_decl_list %type direct_decl %type abs_direct_decl abs_direct_decl_opt %type abstract_decl /* (* Each element is a "* ". *) */ %type pointer pointer_opt %type cvspec %% interpret: file { $1 } file: globals EOF {$1} globals: /* empty */ { [] } | global globals { (false,$1) :: $2 } | ghost_glob_begin ghost_globals globals { $2 @ $3 } | SEMICOLON globals { $2 } ; ghost_glob_begin: | LGHOST { ghost_global:=true } ; /* Rules for global ghosts: TODO keep the ghost status! */ ghost_globals: | declaration ghost_globals { (true,$1)::$2 } | function_def ghost_globals { (true,$1)::$2 } | RGHOST { ghost_global:=false; [] } ; /*** Global Definition ***/ global: | DECL { GLOBANNOT $1 } | CUSTOM_ANNOT { let (x,y,z) = $1 in CUSTOM(x,y,z) } | declaration { $1 } | function_def { $1 } /*(* Some C header files are shared with the C++ compiler and have linkage * specification *)*/ | EXTERN string_constant declaration { LINKAGE (fst $2, (*handleLoc*) (snd $2), [ $3 ]) } | EXTERN string_constant LBRACE globals RBRACE { LINKAGE (fst $2, (*handleLoc*) (snd $2), List.map (fun (x,y) -> if x then Errorloc.parse_error "invalid ghost in extern linkage \ specification" else y) $4) } | ASM LPAREN string_constant RPAREN SEMICOLON { GLOBASM (fst $3, (*handleLoc*) $1) } | pragma { $1 } /* (* Old-style function prototype. This should be somewhere else, like in * "declaration". For now we keep it at global scope only because in local * scope it looks too much like a function call *) */ | IDENT LPAREN old_parameter_list_ne RPAREN old_pardef_list SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in (* Convert pardecl to new style *) let pardecl, isva = doOldParDecl $3 $5 in (* Make the function declarator *) doDeclaration None loc [] [(($1, PROTO(JUSTBASE, pardecl,[],isva), ["FC_OLDSTYLEPROTO",[]], loc), NO_INIT)] } | IDENT LPAREN RPAREN SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in doDeclaration None loc [] [(($1, PROTO(JUSTBASE,[],[],false), ["FC_OLDSTYLEPROTO",[]], loc), NO_INIT)] } ; id_or_typename_as_id: IDENT { $1 } | NAMED_TYPE { $1 } ; id_or_typename: id_or_typename_as_id { $1 } ; maybecomma: /* empty */ { () } | COMMA { () } ; /* *** Expressions *** */ primary_expression: /*(* 6.5.1. *)*/ | IDENT { make_expr (VARIABLE $1) } | constant { let (v,expr_loc) = $1 in { expr_loc; expr_node = CONSTANT v } } | paren_comma_expression { make_expr (PAREN (smooth_expression $1)) } | LPAREN block RPAREN { make_expr (GNU_BODY (fst3 $2)) } ; postfix_expression: /*(* 6.5.2 *)*/ | primary_expression { $1 } | postfix_expression bracket_comma_expression {make_expr (INDEX ($1, smooth_expression $2))} | postfix_expression LPAREN arguments RPAREN ghost_arguments_opt {make_expr (CALL ($1, $3, $5))} | BUILTIN_VA_ARG LPAREN expression COMMA type_name RPAREN { let b, d = $5 in let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 5, Parsing.rhs_end_pos 5) in let loc_f = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in make_expr (CALL ({ expr_loc = loc_f; expr_node = VARIABLE "__builtin_va_arg"}, [$3; { expr_loc = loc; expr_node = TYPE_SIZEOF (b, d)}],[])) } | BUILTIN_TYPES_COMPAT LPAREN type_name COMMA type_name RPAREN { let b1,d1 = $3 in let b2,d2 = $5 in let loc_f = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in let loc1 = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 3, Parsing.rhs_end_pos 3) in let loc2 = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 5, Parsing.rhs_end_pos 5) in make_expr (CALL ({expr_loc = loc_f; expr_node = VARIABLE "__builtin_types_compatible_p"}, [ { expr_loc = loc1; expr_node = TYPE_SIZEOF(b1,d1)}; { expr_loc = loc2; expr_node = TYPE_SIZEOF(b2,d2)}],[])) } | BUILTIN_OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN { transformOffsetOf $3 $5 } | postfix_expression DOT id_or_typename { make_expr (MEMBEROF ($1, $3))} | postfix_expression ARROW id_or_typename { make_expr (MEMBEROFPTR ($1, $3)) } | postfix_expression PLUS_PLUS { make_expr (UNARY (POSINCR, $1)) } | postfix_expression MINUS_MINUS { make_expr (UNARY (POSDECR, $1)) } /* (* We handle GCC constructor expressions *) */ | LPAREN type_name RPAREN LBRACE initializer_list_opt RBRACE { make_expr (CAST($2, COMPOUND_INIT $5)) } ; offsetof_member_designator: /* GCC extension for __builtin_offsetof */ | id_or_typename { make_expr (VARIABLE $1) } | offsetof_member_designator DOT IDENT { make_expr (MEMBEROF ($1, $3)) } | offsetof_member_designator bracket_comma_expression { make_expr (INDEX ($1, smooth_expression $2)) } ; unary_expression: /*(* 6.5.3 *)*/ | postfix_expression { $1 } | PLUS_PLUS unary_expression {make_expr (UNARY (PREINCR, $2))} | MINUS_MINUS unary_expression {make_expr (UNARY (PREDECR, $2))} | SIZEOF unary_expression {make_expr (EXPR_SIZEOF $2)} | SIZEOF LPAREN type_name RPAREN {let b, d = $3 in make_expr (TYPE_SIZEOF (b, d)) } | ALIGNOF unary_expression { make_expr (EXPR_ALIGNOF $2) } | ALIGNOF LPAREN type_name RPAREN {let b, d = $3 in make_expr (TYPE_ALIGNOF (b, d)) } | PLUS cast_expression { make_expr (UNARY (PLUS, $2)) } | MINUS cast_expression { make_expr (UNARY (MINUS, $2)) } | STAR cast_expression {make_expr (UNARY (MEMOF, $2)) } | AND cast_expression {make_expr (UNARY (ADDROF, $2))} | EXCLAM cast_expression { make_expr (UNARY (NOT, $2)) } | TILDE cast_expression { make_expr (UNARY (BNOT, $2)) } /* (* GCC allows to take address of a label (see COMPGOTO statement) *) */ | AND_AND id_or_typename_as_id { make_expr (LABELADDR $2) } ; cast_expression: /*(* 6.5.4 *)*/ | unary_expression { $1 } | LPAREN type_name RPAREN cast_expression { make_expr (CAST($2, SINGLE_INIT $4)) } ; multiplicative_expression: /*(* 6.5.5 *)*/ | cast_expression { $1 } | multiplicative_expression STAR cast_expression { make_expr (BINARY(MUL, $1, $3)) } | multiplicative_expression SLASH cast_expression { make_expr (BINARY(DIV, $1, $3)) } | multiplicative_expression PERCENT cast_expression { make_expr (BINARY(MOD, $1, $3)) } ; additive_expression: /*(* 6.5.6 *)*/ | multiplicative_expression { $1 } | additive_expression PLUS multiplicative_expression { make_expr (BINARY(ADD, $1, $3)) } | additive_expression MINUS multiplicative_expression { make_expr (BINARY(SUB, $1, $3)) } ; shift_expression: /*(* 6.5.7 *)*/ | additive_expression { $1 } | shift_expression INF_INF additive_expression {make_expr (BINARY(SHL, $1, $3)) } | shift_expression SUP_SUP additive_expression { make_expr (BINARY(SHR, $1, $3)) } ; relational_expression: /*(* 6.5.8 *)*/ | shift_expression { $1 } | relational_expression INF shift_expression { make_expr (BINARY(LT, $1, $3)) } | relational_expression SUP shift_expression { make_expr (BINARY(GT, $1, $3)) } | relational_expression INF_EQ shift_expression { make_expr (BINARY(LE, $1, $3)) } | relational_expression SUP_EQ shift_expression { make_expr (BINARY(GE, $1, $3)) } ; equality_expression: /*(* 6.5.9 *)*/ | relational_expression { $1 } | equality_expression EQ_EQ relational_expression { make_expr (BINARY(EQ, $1, $3)) } | equality_expression EXCLAM_EQ relational_expression { make_expr (BINARY(NE, $1, $3)) } ; bitwise_and_expression: /*(* 6.5.10 *)*/ | equality_expression { $1 } | bitwise_and_expression AND equality_expression { make_expr (BINARY(BAND, $1, $3)) } ; bitwise_xor_expression: /*(* 6.5.11 *)*/ | bitwise_and_expression { $1 } | bitwise_xor_expression CIRC bitwise_and_expression { make_expr (BINARY(XOR, $1, $3)) } ; bitwise_or_expression: /*(* 6.5.12 *)*/ | bitwise_xor_expression { $1 } | bitwise_or_expression PIPE bitwise_xor_expression { make_expr (BINARY(BOR, $1, $3)) } ; logical_and_expression: /*(* 6.5.13 *)*/ | bitwise_or_expression { $1 } | logical_and_expression AND_AND bitwise_or_expression { make_expr (BINARY(AND, $1, $3)) } ; logical_or_expression: /*(* 6.5.14 *)*/ | logical_and_expression { $1 } | logical_or_expression PIPE_PIPE logical_and_expression { make_expr (BINARY(OR, $1, $3)) } ; conditional_expression: /*(* 6.5.15 *)*/ | logical_or_expression { $1 } | logical_or_expression QUEST opt_expression COLON conditional_expression { make_expr (QUESTION ($1, $3, $5)) } ; /*(* The C spec says that left-hand sides of assignment expressions are unary * expressions. GCC allows cast expressions in there ! *)*/ assignment_expression: /*(* 6.5.16 *)*/ | conditional_expression { $1 } | cast_expression EQ assignment_expression { make_expr (BINARY(ASSIGN, $1, $3)) } | cast_expression PLUS_EQ assignment_expression { make_expr (BINARY(ADD_ASSIGN, $1, $3)) } | cast_expression MINUS_EQ assignment_expression { make_expr (BINARY(SUB_ASSIGN, $1, $3)) } | cast_expression STAR_EQ assignment_expression { make_expr (BINARY(MUL_ASSIGN, $1, $3)) } | cast_expression SLASH_EQ assignment_expression { make_expr (BINARY(DIV_ASSIGN, $1, $3)) } | cast_expression PERCENT_EQ assignment_expression { make_expr (BINARY(MOD_ASSIGN, $1, $3)) } | cast_expression AND_EQ assignment_expression { make_expr (BINARY(BAND_ASSIGN, $1, $3)) } | cast_expression PIPE_EQ assignment_expression { make_expr (BINARY(BOR_ASSIGN, $1, $3)) } | cast_expression CIRC_EQ assignment_expression { make_expr (BINARY(XOR_ASSIGN, $1, $3)) } | cast_expression INF_INF_EQ assignment_expression { make_expr (BINARY(SHL_ASSIGN, $1, $3)) } | cast_expression SUP_SUP_EQ assignment_expression { make_expr (BINARY(SHR_ASSIGN, $1, $3))} ; expression: /*(* 6.5.17 *)*/ assignment_expression { $1 } ; constant: CST_INT {CONST_INT (fst $1), snd $1} | CST_FLOAT {CONST_FLOAT (fst $1), snd $1} | CST_CHAR {CONST_CHAR (fst $1), snd $1} | CST_WCHAR {CONST_WCHAR (fst $1), snd $1} | string_constant {CONST_STRING (fst $1), snd $1} | wstring_list {CONST_WSTRING (fst $1), snd $1} ; string_constant: /* Now that we know this constant isn't part of a wstring, convert it back to a string for easy viewing. */ string_list { intlist_to_string (fst $1), snd $1 } ; string_list: one_string { fst $1, snd $1 } | string_list one_string { merge_string $1 $2 } ; wstring_list: CST_WSTRING { $1 } | wstring_list one_string { merge_string $1 $2 } | wstring_list CST_WSTRING { merge_string $1 $2 } | string_list CST_WSTRING { merge_string $1 $2 } /* If a wstring is present anywhere in the list, the whole is a wstring */ one_string: CST_STRING {$1} | FUNCTION__ {(Cabshelper.explodeStringToInts !currentFunctionName), $1} | PRETTY_FUNCTION__ {(Cabshelper.explodeStringToInts !currentFunctionName), $1} ; init_expression: expression { SINGLE_INIT $1 } | LBRACE initializer_list_opt RBRACE { COMPOUND_INIT $2} initializer_list: /* ISO 6.7.8. Allow a trailing COMMA */ initializer_single { [$1] } | initializer_single COMMA initializer_list_opt { $1 :: $3 } ; initializer_list_opt: /* empty */ { [] } | initializer_list { $1 } ; initializer_single: init_designators eq_opt init_expression { ($1, $3) } | gcc_init_designators init_expression { ($1, $2) } | init_expression { (NEXT_INIT, $1) } ; eq_opt: EQ { () } /*(* GCC allows missing = *)*/ | /*(* empty *)*/ { () } ; init_designators: DOT id_or_typename init_designators_opt { INFIELD_INIT($2, $3) } | LBRACKET expression RBRACKET init_designators_opt { ATINDEX_INIT($2, $4) } | LBRACKET expression ELLIPSIS expression RBRACKET { ATINDEXRANGE_INIT($2, $4) } ; init_designators_opt: /* empty */ { NEXT_INIT } | init_designators { $1 } ; gcc_init_designators: /*(* GCC supports these strange things *)*/ id_or_typename COLON { INFIELD_INIT($1, NEXT_INIT) } ; ghost_arguments_opt: /* empty */ { [] } | ghost_arguments { $1 } ghost_arguments: LGHOST LPAREN arguments RPAREN RGHOST { $3 } arguments: /* empty */ { [] } | comma_expression { $1 } ; opt_expression: /* empty */ {make_expr NOTHING} | comma_expression {smooth_expression $1 } ; comma_expression: expression { [$1] } | expression COMMA comma_expression { $1 :: $3 } ; comma_expression_opt: /* empty */ { make_expr NOTHING } | comma_expression { smooth_expression $1 } ; paren_comma_expression: LPAREN comma_expression RPAREN { $2 } ; bracket_comma_expression: LBRACKET comma_expression RBRACKET { $2 } ; /*** statements ***/ block: /* ISO 6.8.2 */ block_begin local_labels block_attrs block_element_list RBRACE {!Lexerhack.pop_context(); { blabels = $2; battrs = $3; bstmts = $4 }, $1, $5 } ; block_begin: LBRACE { !Lexerhack.push_context (); $1 } ; block_attrs: /* empty */ { [] } | BLOCKATTRIBUTE paren_attr_list_ne { [("__blockattribute__", $2)] } ; /* statements and declarations in a block, in any order (for C99 support) */ block_element_list: | annot_list_opt { $1 } | annot_list_opt declaration block_element_list { $1 @ no_ghost_stmt (DEFINITION($2)) :: $3 } | annot_list_opt statement block_element_list { $1 @ $2 @ $3 } | annot_list_opt pragma block_element_list { $1 @ $3 } /*(* GCC accepts a label at the end of a block *)*/ | annot_list_opt id_or_typename_as_id COLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 2, Parsing.rhs_end_pos 3) in $1 @ no_ghost [LABEL ($2, no_ghost_stmt (NOP loc), loc)] } ; annot_list_opt: /* empty */ { [] } | annot_list { $1 } ; annot_list: CODE_ANNOT annot_list_opt { no_ghost [Cabs.CODE_ANNOT $1] @ $2} | LGHOST block_element_list RGHOST annot_list_opt { (in_ghost $2) @ $4 } ; local_labels: /* empty */ { [] } | LABEL__ local_label_names SEMICOLON local_labels { $2 @ $4 } ; local_label_names: id_or_typename_as_id { [ $1 ] } | id_or_typename_as_id COMMA local_label_names { $1 :: $3 } ; annotated_statement: | statement { $1 } | annot_list statement { $1 @ $2 } ; statement: SEMICOLON { no_ghost [NOP $1] } | SPEC annotated_statement { let bs = $2 in match Logic_lexer.spec $1 with | Some (loc',spec) -> let spec = no_ghost [Cabs.CODE_SPEC (spec, (fst $1, loc'))] in spec @ $2 | None -> bs } | comma_expression SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [COMPUTATION (smooth_expression $1,loc)]} | block { let (x,y,z) = $1 in no_ghost [BLOCK (x, y, z)]} | IF paren_comma_expression annotated_statement { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [IF (smooth_expression $2, in_block $3, no_ghost_stmt (NOP loc), loc)]} | IF paren_comma_expression annotated_statement ELSE annotated_statement { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [IF (smooth_expression $2, in_block $3, in_block $5, loc)]} | SWITCH paren_comma_expression annotated_statement { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [SWITCH (smooth_expression $2, in_block $3, loc)]} | opt_loop_annotations WHILE paren_comma_expression annotated_statement { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 2, Parsing.symbol_end_pos ()) in no_ghost [WHILE ($1, smooth_expression $3, in_block $4, loc)] } | opt_loop_annotations DO annotated_statement WHILE paren_comma_expression SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 2, Parsing.symbol_end_pos ()) in no_ghost [DOWHILE ($1, smooth_expression $5, in_block $3, loc)]} | opt_loop_annotations FOR LPAREN for_clause opt_expression SEMICOLON opt_expression RPAREN annotated_statement { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 2, Parsing.symbol_end_pos ()) in no_ghost [FOR ($1, $4, $5, $7, in_block $9, loc)]} | id_or_typename_as_id COLON attribute_nocv_list annotated_statement {(* The only attribute that should appear here is "unused". For now, we drop this on the floor, since unused labels are usually removed anyways by Rmtmps. *) let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 2) in match $4 with | [] -> (* should not happen if grammar is written correctly *) parse_error "empty statement after label" | s :: others -> no_ghost [LABEL($1,s,loc)] @ others } | CASE expression COLON annotated_statement { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.rhs_end_pos 3) in no_ghost [CASE ($2, in_block $4, loc)]} | CASE expression ELLIPSIS expression COLON annotated_statement { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.rhs_end_pos 5) in no_ghost [CASERANGE ($2, $4, in_block $6, loc)]} | DEFAULT COLON annotated_statement { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos(), Parsing.symbol_end_pos ()) in no_ghost [DEFAULT (in_block $3, loc)]} | RETURN SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [RETURN ({ expr_loc = loc; expr_node = NOTHING}, loc)] } | RETURN comma_expression SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [RETURN (smooth_expression $2, loc)] } | BREAK SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [BREAK loc] } | CONTINUE SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [CONTINUE loc] } | GOTO id_or_typename_as_id SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [GOTO ($2, loc)] } | GOTO STAR comma_expression SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [COMPGOTO (smooth_expression $3, loc) ] } | ASM GOTO asmattr LPAREN asmtemplate asmoutputs RPAREN SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [ASM ($3, mk_asm_templates $5, $6, loc)] } | ASM asmattr LPAREN asmtemplate asmoutputs RPAREN SEMICOLON { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in no_ghost [ASM ($2, mk_asm_templates $4, $5, loc)] } | MSASM { no_ghost [ASM ([], [fst $1], None, snd $1)]} | TRY block EXCEPT paren_comma_expression block { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in let loc_e = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 4, Parsing.rhs_end_pos 4) in let b, _, _ = $2 in let h, _, _ = $5 in if not !Cprint.msvcMode then Errorloc.parse_error "try/except in GCC code"; no_ghost [TRY_EXCEPT (b, {expr_loc = loc_e; expr_node = COMMA $4}, h, loc)] } | TRY block FINALLY block { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos ()) in let b, _, _ = $2 in let h, _, _ = $4 in if not !Cprint.msvcMode then Errorloc.parse_error "try/finally in GCC code"; no_ghost [TRY_FINALLY (b, h, loc)] } ; opt_loop_annotations: /* epsilon */ { [] } | loop_annotations { $1 } ; loop_annotations: loop_annotation { $1 } /* Not in ACSL Grammar | loop_annotation loop_annotations { { Cil_types.invariant = $1.Cil_types.invariant @ $2.Cil_types.invariant; Cil_types.loop_assigns = $1.Cil_types.loop_assigns @ $2.Cil_types.loop_assigns ; Cil_types.variant = $1.Cil_types.variant @ $2.Cil_types.variant; Cil_types.pragma = $1.Cil_types.pragma @ $2.Cil_types.pragma } } */ ; loop_annotation: LOOP_ANNOT { fst $1 } ; for_clause: opt_expression SEMICOLON { FC_EXP $1 } | declaration { FC_DECL $1 } ; ghost_parameter_opt: /* empty */ {[]} | ghost_parameter {$1} ; ghost_parameter: LGHOST parameter_list_startscope rest_par_list RPAREN RGHOST { let (l, _) = $3 in l } ; declaration: /* ISO 6.7.*/ decl_spec_list init_declarator_list SEMICOLON { doDeclaration None ((snd $1)) (fst $1) $2 } | decl_spec_list SEMICOLON { doDeclaration None ((snd $1)) (fst $1) [] } | SPEC decl_spec_list init_declarator_list SEMICOLON { doDeclaration (Some $1) ((snd $2)) (fst $2) $3 } | SPEC decl_spec_list SEMICOLON { doDeclaration (Some $1) ((snd $2)) (fst $2) [] } ; init_declarator_list: /* ISO 6.7 */ init_declarator { [$1] } | init_declarator COMMA init_declarator_attr_list { $1 :: $3 } ; init_declarator_attr_list: init_declarator_attr { [ $1 ] } | init_declarator_attr COMMA init_declarator_attr_list { $1 :: $3 } ; init_declarator_attr: attribute_nocv_list init_declarator { let ((name, decl, attrs, loc), init) = $2 in ((name, PARENTYPE ($1,decl,[]), attrs, loc), init) } ; init_declarator: /* ISO 6.7 */ declarator { ($1, NO_INIT) } | declarator EQ init_expression { ($1, $3) } ; decl_spec_wo_type: /* ISO 6.7 */ /* ISO 6.7.1 */ | TYPEDEF { SpecTypedef, $1 } | EXTERN { SpecStorage EXTERN, $1 } | STATIC { SpecStorage STATIC, $1 } | AUTO { SpecStorage AUTO, $1 } | REGISTER { SpecStorage REGISTER, $1} /* ISO 6.7.4 */ | INLINE { SpecInline, $1 } | cvspec { $1 } | attribute_nocv { SpecAttr (fst $1), snd $1 } ; decl_spec_list: | decl_spec_wo_type decl_spec_list_opt { fst $1 :: $2, snd $1 } | type_spec decl_spec_list_opt_no_named { SpecType(fst $1) :: $2, snd $1 } decl_spec_list_no_named: | decl_spec_wo_type decl_spec_list_opt_no_named { fst $1 :: $2, snd $1 } | type_spec decl_spec_list_opt_no_named { SpecType(fst $1) :: $2, snd $1 } /* (* In most cases if we see a NAMED_TYPE we must shift it. Thus we declare * NAMED_TYPE to have right associativity *) */ decl_spec_list_opt: /* empty */ { [] } %prec NAMED_TYPE | decl_spec_list { fst $1 } ; /* (* We add this separate rule to handle the special case when an appearance * of NAMED_TYPE should not be considered as part of the specifiers but as * part of the declarator. IDENT has higher precedence than NAMED_TYPE *) */ decl_spec_list_opt_no_named: /* empty */ { [] } %prec IDENT | decl_spec_list_no_named { fst $1 } ; type_spec: /* ISO 6.7.2 */ VOID { Tvoid, $1} | CHAR { Tchar, $1 } | BOOL { Tbool, $1 } | SHORT { Tshort, $1 } | INT { Tint, $1 } | LONG { Tlong, $1 } | INT64 { Tint64, $1 } | FLOAT { Tfloat, $1 } | DOUBLE { Tdouble, $1 } | SIGNED { Tsigned, $1 } | UNSIGNED { Tunsigned, $1 } | STRUCT id_or_typename { Tstruct ($2, None, []), $1 } | STRUCT just_attributes id_or_typename { Tstruct ($3, None, $2), $1 } | STRUCT id_or_typename LBRACE struct_decl_list RBRACE { Tstruct ($2, Some $4, []), $1 } | STRUCT LBRACE struct_decl_list RBRACE { Tstruct ("", Some $3, []), $1 } | STRUCT just_attributes id_or_typename LBRACE struct_decl_list RBRACE { Tstruct ($3, Some $5, $2), $1 } | STRUCT just_attributes LBRACE struct_decl_list RBRACE { Tstruct ("", Some $4, $2), $1 } | UNION id_or_typename { Tunion ($2, None, []), $1 } | UNION id_or_typename LBRACE struct_decl_list RBRACE { Tunion ($2, Some $4, []), $1 } | UNION LBRACE struct_decl_list RBRACE { Tunion ("", Some $3, []), $1 } | UNION just_attributes id_or_typename LBRACE struct_decl_list RBRACE { Tunion ($3, Some $5, $2), $1 } | UNION just_attributes LBRACE struct_decl_list RBRACE { Tunion ("", Some $4, $2), $1 } | ENUM id_or_typename { Tenum ($2, None, []), $1 } | ENUM id_or_typename LBRACE enum_list maybecomma RBRACE { Tenum ($2, Some $4, []), $1 } | ENUM LBRACE enum_list maybecomma RBRACE { Tenum ("", Some $3, []), $1 } | ENUM just_attributes id_or_typename LBRACE enum_list maybecomma RBRACE { Tenum ($3, Some $5, $2), $1 } | ENUM just_attributes LBRACE enum_list maybecomma RBRACE { Tenum ("", Some $4, $2), $1 } | NAMED_TYPE { (Tnamed $1, Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos())) } | TYPEOF LPAREN expression RPAREN { TtypeofE $3, $1 } | TYPEOF LPAREN type_name RPAREN { let s, d = $3 in TtypeofT (s, d), $1 } ; struct_decl_list: /* (* ISO 6.7.2. Except that we allow empty structs. We * also allow missing field names. *) */ /* empty */ { [] } | decl_spec_list SEMICOLON struct_decl_list { FIELD (fst $1, [(missingFieldDecl, None)]) :: $3 } /*(* GCC allows extra semicolons *)*/ | SEMICOLON struct_decl_list { $2 } | decl_spec_list field_decl_list SEMICOLON struct_decl_list { FIELD (fst $1, $2) :: $4 } /*(* MSVC allows pragmas in strange places *)*/ | pragma struct_decl_list { $2 } ; field_decl_list: /* (* ISO 6.7.2 *) */ field_decl { [$1] } | field_decl COMMA field_decl_list { $1 :: $3 } ; field_decl: /* (* ISO 6.7.2. Except that we allow unnamed fields. *) */ | declarator { ($1, None) } | declarator COLON expression attributes { let (n,decl,al,loc) = $1 in let al' = al @ $4 in ((n,decl,al',loc), Some $3) } | COLON expression { (missingFieldDecl, Some $2) } ; enum_list: /* (* ISO 6.7.2.2 *) */ enumerator {[$1]} | enum_list COMMA enumerator {$1 @ [$3]} ; enumerator: IDENT { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (), Parsing.symbol_end_pos()) in ($1, { expr_node = NOTHING; expr_loc = loc }, loc) } | IDENT EQ expression { ($1, $3, Cil_datatype.Location.of_lexing_loc (Parsing.symbol_start_pos (),Parsing.symbol_end_pos())) } ; declarator: /* (* ISO 6.7.5. Plus Microsoft declarators.*) */ pointer_opt direct_decl attributes_with_asm { let (n, decl) = $2 in (n, applyPointer (fst $1) decl, $3, (snd $1)) } ; attributes_or_static: /* 6.7.5.2/3 */ | attributes comma_expression_opt { $1,$2 } | attribute attributes STATIC comma_expression { fst $1::$2 @ ["static",[]], smooth_expression $4 } | STATIC attributes comma_expression { ("static",[]) :: $2, smooth_expression $3 } ; direct_decl: /* (* ISO 6.7.5 *) */ /* (* We want to be able to redefine named * types as variable names *) */ | id_or_typename { ($1, JUSTBASE) } | LPAREN attributes declarator RPAREN { let (n,decl,al,_) = $3 in (n, PARENTYPE($2,decl,al)) } | direct_decl LBRACKET attributes_or_static RBRACKET { let (n, decl) = $1 in let (attrs, size) = $3 in (n, ARRAY(decl, attrs, size)) } | direct_decl LPAREN RPAREN ghost_parameter_opt { let (n,decl) = $1 in (n, PROTO(decl,[],$4,false)) } | direct_decl parameter_list_startscope rest_par_list RPAREN ghost_parameter_opt { let (n, decl) = $1 in let (params, isva) = $3 in let ghost = $5 in !Lexerhack.pop_context (); (n, PROTO(decl, params, ghost, isva)) } ; parameter_list_startscope: LPAREN { !Lexerhack.push_context () } ; rest_par_list: | parameter_decl rest_par_list1 { let (params, isva) = $2 in ($1 :: params, isva) } ; rest_par_list1: /* empty */ { ([], false) } | COMMA ELLIPSIS { ([], true) } | COMMA parameter_decl rest_par_list1 { let (params, isva) = $3 in ($2 :: params, isva) } ; parameter_decl: /* (* ISO 6.7.5 *) */ decl_spec_list declarator { (fst $1, $2) } | decl_spec_list abstract_decl { let d, a = $2 in (fst $1, ("", d, a, (*CEA*) cabslu)) } | decl_spec_list { (fst $1, ("", JUSTBASE, [], (*CEA*) cabslu)) } | LPAREN parameter_decl RPAREN { $2 } ; /* (* Old style prototypes. Like a declarator *) */ old_proto_decl: pointer_opt direct_old_proto_decl { let (n, decl, a) = $2 in (n, applyPointer (fst $1) decl, a, snd $1) } ; direct_old_proto_decl: | direct_decl LPAREN old_parameter_list_ne RPAREN old_pardef_list { let par_decl, isva = doOldParDecl $3 $5 in let n, decl = $1 in (n, PROTO(decl, par_decl, [],isva), ["FC_OLDSTYLEPROTO",[]]) } /* (* appears sometimesm but generates a shift-reduce conflict. *) | LPAREN STAR direct_decl LPAREN old_parameter_list_ne RPAREN RPAREN LPAREN RPAREN old_pardef_list { let par_decl, isva = doOldParDecl $5 $10 in let n, decl = $3 in (n, PROTO(decl, par_decl,[], isva), []) } */ ; old_parameter_list_ne: | IDENT { [$1] } | IDENT COMMA old_parameter_list_ne { $1::$3 } ; old_pardef_list: /* empty */ { ([], false) } | decl_spec_list old_pardef SEMICOLON ELLIPSIS { ([(fst $1, $2)], true) } | decl_spec_list old_pardef SEMICOLON old_pardef_list { let rest, isva = $4 in ((fst $1, $2) :: rest, isva) } ; old_pardef: declarator { [$1] } | declarator COMMA old_pardef { $1 :: $3 } ; pointer: /* (* ISO 6.7.5 *) */ STAR attributes pointer_opt { $2 :: fst $3, $1 } ; pointer_opt: /**/ { let l = Errorloc.currentLoc () in ([], l) } | pointer { $1 } ; type_name: /* (* ISO 6.7.6 *) */ decl_spec_list abstract_decl { let d, a = $2 in if a <> [] then Errorloc.parse_error "attributes in type name"; (fst $1, d) } | decl_spec_list { (fst $1, JUSTBASE) } ; abstract_decl: /* (* ISO 6.7.6. *) */ pointer_opt abs_direct_decl attributes { applyPointer (fst $1) $2, $3 } | pointer { applyPointer (fst $1) JUSTBASE, [] } ; abs_direct_decl: /* (* ISO 6.7.6. We do not support optional declarator for * functions. Plus Microsoft attributes. See the * discussion for declarator. *) */ | LPAREN attributes abstract_decl RPAREN { let d, a = $3 in PARENTYPE ($2, d, a) } | abs_direct_decl_opt LBRACKET comma_expression_opt RBRACKET { ARRAY($1, [], $3) } /*(* The next should be abs_direct_decl_opt but we get conflicts *)*/ | abs_direct_decl parameter_list_startscope rest_par_list RPAREN { let (params, isva) = $3 in !Lexerhack.pop_context (); PROTO ($1, params,[], isva) } | abs_direct_decl LPAREN RPAREN { PROTO ($1, [],[], false) } ; abs_direct_decl_opt: abs_direct_decl { $1 } | /* empty */ { JUSTBASE } ; function_def: /* (* ISO 6.9.1 *) */ SPEC function_def_start block { let (loc, specs, decl) = $2 in let spec_loc = let loc = fst $1 in Extlib.opt_map (fun (loc', spec) -> spec, (loc, loc')) (Logic_lexer.spec $1) in currentFunctionName := "<__FUNCTION__ used outside any functions>"; !Lexerhack.pop_context (); (* The context pushed by * announceFunctionName *) doFunctionDef spec_loc loc (trd3 $3) specs decl (fst3 $3) } | function_def_start block { let (loc, specs, decl) = $1 in currentFunctionName := "<__FUNCTION__ used outside any functions>"; !Lexerhack.pop_context (); (* The context pushed by * announceFunctionName *) (*OCAMLYACC BUG??? Format.printf "%a@." d_cabsloc (trd3 $2);*) doFunctionDef None ((*handleLoc*) loc) (trd3 $2) specs decl (fst3 $2) } function_def_start: /* (* ISO 6.9.1 *) */ decl_spec_list declarator { announceFunctionName $2; (fourth4 $2, fst $1, $2) } /* (* Old-style function prototype *) */ | decl_spec_list old_proto_decl { announceFunctionName $2; (snd $1, fst $1, $2) } /* (* New-style function that does not have a return type *) */ | IDENT parameter_list_startscope rest_par_list RPAREN ghost_parameter_opt { let (params, isva) = $3 in let ghost = $5 in let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in let fdec = ($1, PROTO(JUSTBASE, params, ghost, isva), [], loc) in announceFunctionName fdec; (* Default is int type *) let defSpec = [SpecType Tint] in (loc, defSpec, fdec) } /* (* No return type and old-style parameter list *) */ | IDENT LPAREN old_parameter_list_ne RPAREN old_pardef_list { (* Convert pardecl to new style *) let pardecl, isva = doOldParDecl $3 $5 in let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in (* Make the function declarator *) let fdec = ($1, PROTO(JUSTBASE, pardecl,[],isva), [], loc) in announceFunctionName fdec; (* Default is int type *) (loc, [SpecType Tint], fdec) } | IDENT LPAREN RPAREN ghost_parameter_opt { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_start_pos 1) in let fdec = ($1, PROTO(JUSTBASE,[],$4,false),[],loc) in announceFunctionName fdec; (loc, [SpecType Tint], fdec) } ; /* const/volatile as type specifier elements */ cvspec: | CONST { SpecCV(CV_CONST), $1 } | VOLATILE { SpecCV(CV_VOLATILE), $1 } | RESTRICT { SpecCV(CV_RESTRICT), $1 } | ATTRIBUTE_ANNOT { let annot, loc = $1 in SpecCV(CV_ATTRIBUTE_ANNOT annot), loc } ; /*** GCC attributes ***/ attributes: /* empty */ { []} | attribute attributes { fst $1 :: $2 } ; /* (* In some contexts we can have an inline assembly to specify the name to * be used for a global. We treat this as a name attribute *) */ attributes_with_asm: /* empty */ { [] } | attribute attributes_with_asm { fst $1 :: $2 } | ASM LPAREN string_constant RPAREN attributes { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 3, Parsing.rhs_end_pos 3) in ("__asm__", [{ expr_node = CONSTANT(CONST_STRING (fst $3)); expr_loc = loc}]) :: $5 } ; /* things like __attribute__, but no const/volatile */ attribute_nocv: ATTRIBUTE LPAREN paren_attr_list RPAREN { ("__attribute__", $3), $1 } | DECLSPEC paren_attr_list_ne { ("__declspec", $2), $1 } | MSATTR { (fst $1, []), snd $1 } /* ISO 6.7.3 */ | THREAD { ("__thread",[]), $1 } ; attribute_nocv_list: /* empty */ { []} | attribute_nocv attribute_nocv_list { fst $1 :: $2 } ; /* __attribute__ plus const/volatile */ attribute: attribute_nocv { $1 } | CONST { ("const", []), $1 } | RESTRICT { ("restrict",[]), $1 } | VOLATILE { ("volatile",[]), $1 } | ATTRIBUTE_ANNOT { let annot, loc = $1 in ("$annot:" ^ annot, []), loc } ; /* (* sm: I need something that just includes __attribute__ and nothing more, * to support them appearing between the 'struct' keyword and the type name. * Actually, a declspec can appear there as well (on MSVC) *) */ just_attribute: ATTRIBUTE LPAREN paren_attr_list RPAREN { ("__attribute__", $3) } | DECLSPEC paren_attr_list_ne { ("__declspec", $2) } ; /* this can't be empty, b/c I folded that possibility into the calling * productions to avoid some S/R conflicts */ just_attributes: just_attribute { [$1] } | just_attribute just_attributes { $1 :: $2 } ; /** (* PRAGMAS and ATTRIBUTES *) ***/ pragma: | PRAGMA PRAGMA_EOL { PRAGMA (make_expr (VARIABLE ("")), $1) } | PRAGMA attr PRAGMA_EOL { PRAGMA ($2, $1) } | PRAGMA attr SEMICOLON PRAGMA_EOL { PRAGMA ($2, $1) } | PRAGMA_LINE { PRAGMA (make_expr (VARIABLE (fst $1)), snd $1) } ; /* (* We want to allow certain strange things that occur in pragmas, so we * cannot use directly the language of expressions *) */ var_attr: | IDENT { make_expr (VARIABLE $1) } | NAMED_TYPE { make_expr (VARIABLE $1) } | DEFAULT COLON CST_INT { make_expr (VARIABLE ("default:" ^ fst $3)) } /* Const when it appears in attribute lists, is translated to aconst */ | CONST { make_expr (VARIABLE "aconst") } /*(** GCC allows this as an attribute for functions, synonym for noreturn **)*/ | VOLATILE { make_expr (VARIABLE ("__noreturn__")) } | CST_INT COLON CST_INT { make_expr (VARIABLE (fst $1 ^ ":" ^ fst $3)) } ; basic_attr: | CST_INT { make_expr (CONSTANT(CONST_INT (fst $1))) } | CST_FLOAT { make_expr (CONSTANT(CONST_FLOAT(fst $1))) } | var_attr { $1 } ; basic_attr_list_ne: basic_attr { [$1] } | basic_attr basic_attr_list_ne { $1::$2 } ; parameter_attr_list_ne: basic_attr_list_ne { $1 } | basic_attr_list_ne string_constant { $1 @ [make_expr (CONSTANT(CONST_STRING (fst $2)))] } | basic_attr_list_ne string_constant parameter_attr_list_ne { $1 @ ([make_expr (CONSTANT(CONST_STRING (fst $2)))] @ $3) } ; param_attr_list_ne: parameter_attr_list_ne { $1 } | string_constant { [make_expr (CONSTANT(CONST_STRING (fst $1)))] } ; primary_attr: basic_attr { $1 } | LPAREN attr RPAREN { $2 } | string_constant { make_expr (CONSTANT(CONST_STRING (fst $1))) } ; postfix_attr: primary_attr { $1 } | id_or_typename_as_id paren_attr_list_ne { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in make_expr (CALL({ expr_loc = loc; expr_node = VARIABLE $1}, $2,[])) } /* (* use a VARIABLE "" so that the parentheses are printed *) */ | id_or_typename_as_id LPAREN RPAREN { let loc1 = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in let loc2 = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 2, Parsing.rhs_end_pos 3) in let f = { expr_node = VARIABLE $1; expr_loc = loc1 } in let arg = { expr_node = VARIABLE ""; expr_loc = loc2 } in make_expr (CALL(f, [arg],[])) } /* (* use a VARIABLE "" so that the parameters are printed without * parentheses nor comma *) */ | basic_attr param_attr_list_ne { let loc = Cil_datatype.Location.of_lexing_loc (Parsing.rhs_start_pos 1, Parsing.rhs_end_pos 1) in make_expr (CALL({ expr_node = VARIABLE ""; expr_loc = loc}, $1::$2,[])) } | postfix_attr ARROW id_or_typename { make_expr (MEMBEROFPTR ($1, $3))} | postfix_attr DOT id_or_typename { make_expr (MEMBEROF ($1, $3)) } | postfix_attr LBRACKET attr RBRACKET { make_expr (INDEX ($1, $3)) } ; /*(* Since in attributes we use both IDENT and NAMED_TYPE as indentifiers, * that leads to conflicts for SIZEOF and ALIGNOF. In those cases we require * that their arguments be expressions, not attributes *)*/ unary_attr: postfix_attr { $1 } | SIZEOF unary_expression { make_expr (EXPR_SIZEOF $2) } | SIZEOF LPAREN type_name RPAREN {let b, d = $3 in make_expr (TYPE_SIZEOF (b, d)) } | ALIGNOF unary_expression {make_expr (EXPR_ALIGNOF $2) } | ALIGNOF LPAREN type_name RPAREN {let b, d = $3 in make_expr (TYPE_ALIGNOF (b, d)) } | PLUS cast_attr {make_expr (UNARY (PLUS, $2))} | MINUS cast_attr {make_expr (UNARY (MINUS, $2)) } | STAR cast_attr {make_expr (UNARY (MEMOF, $2)) } | AND cast_attr { make_expr (UNARY (ADDROF, $2)) } | EXCLAM cast_attr { make_expr (UNARY (NOT, $2)) } | TILDE cast_attr { make_expr (UNARY (BNOT, $2)) } ; cast_attr: unary_attr { $1 } ; multiplicative_attr: cast_attr { $1 } | multiplicative_attr STAR cast_attr {make_expr (BINARY(MUL ,$1 , $3))} | multiplicative_attr SLASH cast_attr {make_expr (BINARY(DIV ,$1 , $3))} | multiplicative_attr PERCENT cast_attr {make_expr (BINARY(MOD ,$1 , $3))} ; additive_attr: multiplicative_attr { $1 } | additive_attr PLUS multiplicative_attr {make_expr (BINARY(ADD ,$1 , $3))} | additive_attr MINUS multiplicative_attr {make_expr (BINARY(SUB ,$1 , $3))} ; shift_attr: additive_attr { $1 } | shift_attr INF_INF additive_attr {make_expr (BINARY(SHL ,$1 , $3))} | shift_attr SUP_SUP additive_attr {make_expr (BINARY(SHR ,$1 , $3))} ; relational_attr: shift_attr { $1 } | relational_attr INF shift_attr {make_expr (BINARY(LT ,$1 , $3))} | relational_attr SUP shift_attr {make_expr (BINARY(GT ,$1 , $3))} | relational_attr INF_EQ shift_attr {make_expr (BINARY(LE ,$1 , $3))} | relational_attr SUP_EQ shift_attr {make_expr (BINARY(GE ,$1 , $3))} ; equality_attr: relational_attr { $1 } | equality_attr EQ_EQ relational_attr {make_expr (BINARY(EQ ,$1 , $3))} | equality_attr EXCLAM_EQ relational_attr {make_expr (BINARY(NE ,$1 , $3))} ; bitwise_and_attr: equality_attr { $1 } | bitwise_and_attr AND equality_attr {make_expr (BINARY(BAND ,$1 , $3))} ; bitwise_xor_attr: bitwise_and_attr { $1 } | bitwise_xor_attr CIRC bitwise_and_attr {make_expr (BINARY(XOR ,$1 , $3))} ; bitwise_or_attr: bitwise_xor_attr { $1 } | bitwise_or_attr PIPE bitwise_xor_attr {make_expr (BINARY(BOR ,$1 , $3))} ; logical_and_attr: bitwise_or_attr { $1 } | logical_and_attr AND_AND bitwise_or_attr {make_expr (BINARY(AND ,$1 , $3))} ; logical_or_attr: logical_and_attr { $1 } | logical_or_attr PIPE_PIPE logical_and_attr {make_expr (BINARY(OR ,$1 , $3))} ; conditional_attr: logical_or_attr { $1 } | logical_or_attr QUEST attr_test conditional_attr COLON2 conditional_attr { make_expr (QUESTION($1, $4, $6)) } assign_attr: conditional_attr { $1 } | conditional_attr EQ conditional_attr { make_expr (BINARY(ASSIGN,$1,$3)) } /* hack to avoid shift reduce conflict in attribute parsing. */ attr_test: | /* empty */ { Cabshelper.push_attr_test () } attr: assign_attr { $1 } ; attr_list_ne: | attr { [$1] } | attr COMMA attr_list_ne { $1 :: $3 } ; attr_list: /* empty */ { [] } | attr_list_ne { $1 } ; paren_attr_list_ne: LPAREN attr_list_ne RPAREN { $2 } ; paren_attr_list: LPAREN attr_list RPAREN { $2 } ; /*** GCC ASM instructions ***/ asmattr: /* empty */ { [] } | VOLATILE asmattr { ("volatile", []) :: $2 } | CONST asmattr { ("const", []) :: $2 } ; asmtemplate: one_string { [intlist_to_string (fst $1)] } | one_string asmtemplate { intlist_to_string (fst $1) :: $2 } ; asmoutputs: /* empty */ { None } | COLON asmoperands asminputs { let (ins, (clobs,labels)) = $3 in Some {aoutputs = $2; ainputs = ins; aclobbers = clobs; alabels = labels } } ; asmoperands: /* empty */ { [] } | asmoperandsne { List.rev $1 } ; asmoperandsne: asmoperand { [$1] } | asmoperandsne COMMA asmoperand { $3 :: $1 } ; asmoperand: asmopname string_constant LPAREN expression RPAREN { ($1, fst $2, $4) } ; asminputs: /* empty */ { ([], ([],[])) } | COLON asmoperands asmclobber { ($2, $3) } ; asmopname: /* empty */ { None } | LBRACKET IDENT RBRACKET { Some $2 } ; asmclobber: /* empty */ { [],[] } | COLON asmlabels { [],$2 } | COLON asmcloberlst_ne asmlabels { $2,$3 } ; asmcloberlst_ne: string_constant { [fst $1] } | string_constant COMMA asmcloberlst_ne { fst $1 :: $3 } ; asmlabels: | /* empty */ { [] } | COLON local_label_names { $2 } %% frama-c-20.0-Calcium/src/kernel_internals/parsing/errorloc.ml0000666000000000000000000002501013571573400021163 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (* Copied and modified from [cil/src/errormsg.ml] *) (***** Handling parsing errors ********) type parseinfo = { lexbuf : Lexing.lexbuf; inchan : in_channel; mutable current_working_directory : string option; } let dummyinfo = { lexbuf = Lexing.from_string ""; inchan = stdin; current_working_directory = None; } let current = ref dummyinfo let startParsing fname = (* We only support one open file at a time *) if !current != dummyinfo then begin Kernel.fatal "[Errorloc.startParsing] supports only one open file: \ You want to open %S and %S is still open" fname (Lexing.lexeme_start_p !current.lexbuf).Lexing.pos_fname end; let inchan = try open_in_bin fname with Sys_error s -> Kernel.abort "Cannot find input file %S: %s" fname s in let lexbuf = Lexing.from_channel inchan in let filename = Filepath.normalize fname in let i = { lexbuf; inchan; current_working_directory = None } in (* Initialize lexer buffer. *) lexbuf.Lexing.lex_curr_p <- { Lexing.pos_fname = filename; Lexing.pos_lnum = 1; Lexing.pos_bol = 0; Lexing.pos_cnum = 0 }; current := i; lexbuf let finishParsing () = let i = !current in assert (i != dummyinfo); close_in i.inchan; current := dummyinfo (* Call this function to announce a new line *) let newline () = Lexing.new_line !current.lexbuf let setCurrentLine (i: int) = let pos = !current.lexbuf.Lexing.lex_curr_p in !current.lexbuf.Lexing.lex_curr_p <- { pos with Lexing.pos_lnum = i; Lexing.pos_bol = pos.Lexing.pos_cnum; } let setCurrentWorkingDirectory s = !current.current_working_directory <- Some s;; let setCurrentFile n = let base_name = !current.current_working_directory in let n = Filepath.normalize ?base_name n in let pos = !current.lexbuf.Lexing.lex_curr_p in !current.lexbuf.Lexing.lex_curr_p <- { pos with Lexing.pos_fname = n } (* Prints the [pos.pos_lnum]-th line from file [pos.pos_fname], plus up to [ctx] lines before and after [pos.pos_lnum] (if they exist), similar to 'grep -C'. The first line is numbered 1. Most exceptions are silently caught and printing is stopped if they occur. *) let pp_context_from_file ?(ctx=2) ?start_line fmt pos = try let in_ch = open_in (pos.Filepath.pos_path :> string) in try begin let first_error_line, last_error_line = match start_line with | None -> pos.Filepath.pos_lnum, pos.Filepath.pos_lnum | Some l -> min l pos.Filepath.pos_lnum, max l pos.Filepath.pos_lnum in let first_to_print = max (first_error_line-ctx) 1 in let last_to_print = last_error_line+ctx in let i = ref 1 in let error_line_len = ref 0 in try (* advance to line *) while !i < first_to_print do ignore (input_line in_ch); incr i done; (* print context before first error line *) while !i < first_error_line do let line = input_line in_ch in Format.fprintf fmt "%-6d%s\n" !i line; incr i done; (* if more than one line of context, print blank line *) if last_error_line <> first_error_line then Format.fprintf fmt "\n"; (* print error lines *) while !i <= last_error_line do let line = input_line in_ch in error_line_len := String.length line; Format.fprintf fmt "%-6d%s\n" !i line; incr i done; (* if more than one line of context, print blank line, otherwise print arrows *) if last_error_line <> first_error_line then Format.fprintf fmt "\n" else begin let cursor = String.make 6 ' ' ^ String.make !error_line_len '^' in Format.fprintf fmt "%s\n" cursor end; while !i <= last_to_print do let line = input_line in_ch in Format.fprintf fmt "%-6d%s\n" !i line; incr i done; with End_of_file -> if !i <= last_error_line then (* could not reach line, print warning *) Kernel.warning "end of file reached before line %d" last_error_line else (* context after line n, no warning *) () end; close_in in_ch with _ -> close_in_noerr in_ch with _ -> () let pretty_pos fmt pos = if pos = Cil_datatype.Position.unknown then Format.fprintf fmt "" else Format.fprintf fmt "%d:%d" pos.Filepath.pos_lnum (pos.Filepath.pos_cnum - pos.Filepath.pos_bol) let pretty_pos_between fmt (pos_start, pos_end) = if pos_start.Filepath.pos_path = pos_end.Filepath.pos_path then if pos_start.Filepath.pos_lnum = pos_end.Filepath.pos_lnum then (* single file, single line *) Format.fprintf fmt "Location: line %d, between columns %d and %d" pos_start.Filepath.pos_lnum (pos_start.Filepath.pos_cnum - pos_start.Filepath.pos_bol) (pos_end.Filepath.pos_cnum - pos_end.Filepath.pos_bol) else (* single file, multiple lines *) Format.fprintf fmt "Location: between lines %d and %d" pos_start.Filepath.pos_lnum pos_end.Filepath.pos_lnum else (* multiple files (very rare) *) Format.fprintf fmt "Location: between %a and %a" pretty_pos pos_start pretty_pos pos_end let parse_error ?(source=Cil_datatype.Position.of_lexing_pos (Lexing.lexeme_start_p !current.lexbuf)) msg = let start_pos = try Some (Parsing.symbol_start_pos ()) with | _ -> None in let pretty_token fmt token = (* prints more detailed information around the erroneous token; due to the fact that some tokens are normalized (e.g. single-line ACSL comments), we blacklist them to avoid confusing the user *) let blacklist = ["*/"] in if List.mem token blacklist then () else Format.fprintf fmt ", before or at token: %s" token in match start_pos with | None -> Pretty_utils.ksfprintf (fun str -> Kernel.feedback ~source "%s:@." str ~append:(fun fmt -> Format.fprintf fmt "%a\n" pretty_token (Lexing.lexeme !current.lexbuf); Format.fprintf fmt "%a@." (pp_context_from_file ?start_line:None ~ctx:2) source); raise (Log.AbortError "kernel")) msg | Some start_pos -> let start_pos = Cil_datatype.Position.of_lexing_pos start_pos in Pretty_utils.ksfprintf (fun str -> Kernel.feedback ~source:start_pos "%s:@." str ~append:(fun fmt -> Format.fprintf fmt "%a%a\n" pretty_pos_between (start_pos, source) pretty_token (Lexing.lexeme !current.lexbuf); Format.fprintf fmt "%a@." (pp_context_from_file ~start_line:start_pos.Filepath.pos_lnum ~ctx:2) source); raise (Log.AbortError "kernel")) msg (* More parsing support functions: line, file, char count *) let currentLoc () = let i = !current in Cil_datatype.Location.of_lexing_loc (Lexing.lexeme_start_p i.lexbuf, Lexing.lexeme_end_p i.lexbuf) (** Handling of errors during parsing *) let hadErrors = ref false let had_errors () = !hadErrors let clear_errors () = hadErrors := false let set_error (_:Log.event) = hadErrors := true let () = Kernel.register Log.Error set_error; Kernel.register Log.Failure set_error frama-c-20.0-Calcium/src/kernel_internals/parsing/errorloc.mli0000666000000000000000000001165113571573400021342 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (** The module stores the current file,line, and working directory in a hidden internal state, modified by the three following functions. *) val newline: unit -> unit (** Call this function to announce a new line *) val currentLoc: unit -> Cil_datatype.Location.t (** This function is used especially when the preprocessor has generated linemarkers in the output that let us know the current working directory at the time of preprocessing (option -fworking-directory for GNU CPP). *) val setCurrentWorkingDirectory: string -> unit val setCurrentFile: string -> unit val setCurrentLine: int -> unit (** Call this function to start parsing. *) val startParsing: string -> Lexing.lexbuf val finishParsing: unit -> unit (** Call this function to finish parsing and close the input channel *) (** prints the line identified by the position, together with [ctx] lines of context before and after. [ctx] defaults to 2. If [start_line] is specified, then all lines between [start_line] and [pos.pos_lnum] are considered part of the error. *) val pp_context_from_file: ?ctx:int -> ?start_line:int -> Format.formatter -> Filepath.position -> unit (** Parse errors are usually fatal, but their reporting is sometimes delayed until the end of the current parsing phase. Functions that intend to ultimately fail should call {!clear_errors} when they start, and check {!had_errors} when they end. *) val parse_error: ?source:Filepath.position -> ('a, Format.formatter, unit, 'b) format4 -> 'a val had_errors : unit -> bool (** Has an error been raised since the last call to {!clear_errors}? *) val clear_errors : unit -> unit frama-c-20.0-Calcium/src/kernel_internals/parsing/lexerhack.ml0000666000000000000000000000753413571573400021315 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (* We provide here a pointer to a function. It will be set by the lexer and * used by the parser. In Ocaml lexers depend on parsers, so we we have put * such functions in a separate module. *) let add_identifier: (string -> unit) ref = ref (fun _ -> Kernel.fatal "Uninitialized add_identifier") let add_type: (string -> unit) ref = ref (fun _ -> Kernel.fatal "Uninitialized add_type") let push_context: (unit -> unit) ref = ref (fun _ -> Kernel.fatal "Uninitialized push_context") let pop_context: (unit -> unit) ref = ref (fun _ -> Kernel.fatal "You called an uninitialized pop_context") frama-c-20.0-Calcium/src/kernel_internals/parsing/logic_lexer.mli0000666000000000000000000000542413571573400022010 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Lexer for logic annotations *) val token : Lexing.lexbuf -> Logic_parser.token (** For plugins that need to call functions of [Logic_parser] themselves *) val chr : Lexing.lexbuf -> string val is_acsl_keyword : string -> bool type 'a parse = Filepath.position * string -> (Filepath.position * 'a) option (** Generic type for parsing functions built on tip of the lexer. Given such a function [f], [f (pos, s)] parses [s], assuming that it starts at position [pos]. If parsing is successful, it returns the final position, and the result. If an error occurs with a warning status other than [Wabort] for [annot-error], returns [None] *) val lexpr : Logic_ptree.lexpr parse val annot : Logic_ptree.annot parse val spec : Logic_ptree.spec parse val ext_spec : Lexing.lexbuf -> Logic_ptree.ext_spec (** ACSL extension for parsing external spec file. Here, the tokens "/*" and "*/" are accepted by the lexer as unnested C comments into the external ACSL specifications. @modify Sulfur-20171101 to accept /* */ as C comments. *) frama-c-20.0-Calcium/src/kernel_internals/parsing/logic_lexer.mll0000666000000000000000000004535013571573400022015 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) { open Logic_parser open Lexing open Logic_ptree type state = Normal | Test let state_stack = Stack.create () let () = Stack.push Normal state_stack let get_state () = try Stack.top state_stack with Stack.Empty -> Normal let pop_state () = try ignore (Stack.pop state_stack) with Stack.Empty -> () exception Error of (int * int) * string let loc lexbuf = (lexeme_start lexbuf, lexeme_end lexbuf) let lex_error lexbuf s = raise (Error (loc lexbuf, "lexical error, " ^ s)) let find_utf8 = let h = Hashtbl.create 97 in List.iter (fun (i,t) -> Hashtbl.add h i t) [ Utf8_logic.forall, FORALL; Utf8_logic.exists, EXISTS; Utf8_logic.eq, EQ; Utf8_logic.neq, NE; Utf8_logic.le, LE; Utf8_logic.ge, GE; Utf8_logic.implies,IMPLIES; Utf8_logic.iff, IFF; Utf8_logic.conj, AND; Utf8_logic.disj, OR; Utf8_logic.neg, NOT; Utf8_logic.x_or, HATHAT; Utf8_logic.minus, MINUS; Utf8_logic.boolean, BOOLEAN; Utf8_logic.integer, INTEGER; Utf8_logic.real, REAL; Utf8_logic.inset, IN; Utf8_logic.pi, PI; ]; fun s -> try Hashtbl.find h s with Not_found -> IDENTIFIER s let identifier, is_acsl_keyword = let all_kw = Hashtbl.create 37 in let c_kw = Hashtbl.create 37 in let type_kw = Hashtbl.create 3 in List.iter (fun (i,t,flag) -> Hashtbl.add all_kw i t; if flag then Hashtbl.add c_kw i t ) [ "allocates", ALLOCATES, false; "assert", ASSERT, false; "assigns", ASSIGNS, false; "assumes", ASSUMES, false; "at", EXT_AT, false;(* ACSL extension for external spec file *) "axiom", AXIOM, false; "axiomatic", AXIOMATIC, false; "behavior", BEHAVIOR, false; "behaviors", BEHAVIORS, false; "_Bool", BOOL, true; "breaks", BREAKS, false; "case", CASE, true; "char", CHAR, true; "check", CHECK, false; "complete", COMPLETE, false; "const", CONST, true; "continues", CONTINUES, false; "contract", CONTRACT, false;(* ACSL extension for external spec file *) "custom", CUSTOM, false; (* ACSL extension for custom annotations *) "decreases", DECREASES, false; "disjoint", DISJOINT, false; "double", DOUBLE, true; "else", ELSE, true; "ensures", ENSURES, false ; "enum", ENUM, true; "exits", EXITS, false; "frees", FREES, false; "function", FUNCTION, false;(* ACSL extension for external spec file *) "float", FLOAT, true; "for", FOR, true; "global", GLOBAL, false; "if", IF, true; "impact", IMPACT, false; "inductive", INDUCTIVE, false; "include", INCLUDE, false;(* ACSL extension for external spec file *) "int", INT, true; "invariant", INVARIANT, false; "label", LABEL, false; "lemma", LEMMA, false; "let", EXT_LET, false;(* ACSL extension for external spec file *) "logic", LOGIC, false; "long", LONG, true; "loop", LOOP, false; "model", MODEL, false;(* ACSL extension for model fields *) "module", MODULE, false;(* ACSL extension for external spec file *) "pragma", PRAGMA, false; "predicate", PREDICATE, false; "reads", READS, true; (* treated specifically in the parser to avoid issue in volatile clause. *) "requires", REQUIRES, false; "returns", RETURNS, false; "short", SHORT, true; "signed", SIGNED, true; "sizeof", SIZEOF, true; "slice", SLICE, false; "struct", STRUCT, true; "terminates", TERMINATES, false; "type", TYPE, false; "union", UNION, true; "unsigned", UNSIGNED, true; "variant", VARIANT, false; "void", VOID, true; "volatile", VOLATILE, true; "writes", WRITES, true; (* treated specifically in the parser to avoid issue in volatile clause. *) ]; List.iter (fun (x, y) -> Hashtbl.add type_kw x y) ["integer", INTEGER; "real", REAL; "boolean", BOOLEAN; ]; (fun s -> try Hashtbl.find (if Logic_utils.is_kw_c_mode () then c_kw else all_kw) s with Not_found -> let res = if not (Logic_utils.is_kw_c_mode ()) then begin match Logic_env.extension_category s with | None -> None | Some Cil_types.Ext_contract -> Some (EXT_CONTRACT s) | Some Cil_types.Ext_global -> Some (EXT_GLOBAL s) | Some Cil_types.Ext_code_annot _ -> Some (EXT_CODE_ANNOT s) end else None in match res with | None -> if Logic_env.typename_status s then TYPENAME s else (try Hashtbl.find type_kw s with Not_found -> if Logic_utils.is_rt_type_mode () then TYPENAME s else IDENTIFIER s) | Some lex -> lex ), (fun s -> Hashtbl.mem all_kw s || Hashtbl.mem type_kw s) let bs_identifier = let h = Hashtbl.create 97 in List.iter (fun (i,t) -> Hashtbl.add h i t) [ "\\allocation", ALLOCATION; "\\allocable", ALLOCABLE; "\\automatic", AUTOMATIC; "\\at", AT; "\\base_addr", BASE_ADDR; "\\block_length", BLOCK_LENGTH; "\\dynamic", DYNAMIC; "\\empty", EMPTY; "\\exists", EXISTS; "\\false", FALSE; "\\forall", FORALL; "\\freeable", FREEABLE; "\\fresh", FRESH; "\\from", FROM; "\\initialized", INITIALIZED; "\\dangling", DANGLING; "\\in", IN; "\\inter", INTER; "\\lambda", LAMBDA; "\\let", LET; "\\nothing", NOTHING; "\\null", NULL; "\\offset", OFFSET; "\\old", OLD; "\\pi", PI; "\\register", REGISTER; "\\result", RESULT; "\\separated", SEPARATED; "\\static", STATIC; "\\true", TRUE; "\\type", BSTYPE; "\\typeof", TYPEOF; "\\unallocated", UNALLOCATED; "\\union", BSUNION; "\\valid", VALID; "\\valid_read", VALID_READ; "\\valid_index", VALID_INDEX; "\\valid_range", VALID_RANGE; "\\valid_function", VALID_FUNCTION; "\\with", WITH; ]; fun lexbuf -> let s = lexeme lexbuf in try Hashtbl.find h s with Not_found -> if Logic_env.typename_status s then TYPENAME s else IDENTIFIER s let int_of_digit chr = match chr with '0'..'9' -> (Char.code chr) - (Char.code '0') | 'a'..'f' -> (Char.code chr) - (Char.code 'a') + 10 | 'A'..'F' -> (Char.code chr) - (Char.code 'A') + 10 | _ -> assert false (* Update lexer buffer. *) let update_line_loc lexbuf line = let pos = lexbuf.Lexing.lex_curr_p in lexbuf.Lexing.lex_curr_p <- { pos with Lexing.pos_lnum = line; Lexing.pos_bol = pos.Lexing.pos_cnum; } let update_newline_loc lexbuf = update_line_loc lexbuf (lexbuf.Lexing.lex_curr_p.Lexing.pos_lnum + 1) let update_file_loc lexbuf file = let pos = lexbuf.Lexing.lex_curr_p in lexbuf.Lexing.lex_curr_p <- { pos with Lexing.pos_fname = file } let accept_c_comments_into_acsl_spec = ref false } let space = [' ' '\t' '\012' '\r' '@' ] let rB = ['0' '1'] let rD = ['0'-'9'] let rO = ['0'-'7'] let rL = ['a'-'z' 'A'-'Z' '_'] let rH = ['a'-'f' 'A'-'F' '0'-'9'] let rE = ['E''e']['+''-']? rD+ let rP = ['P''p']['+''-']? rD+ let rFS = ('f'|'F'|'l'|'L'|'d'|'D') let rIS = ('u'|'U'|'l'|'L')* let comment_line = "//" [^'\n']* (* Do not forget to update also the corresponding chr rule if you add a supported escape sequence here. *) let escape = '\\' ('\'' | '"' | '?' | '\\' | 'a' | 'b' | 'f' | 'n' | 'r' | 't' | 'v') let hex_escape = '\\' ['x' 'X'] rH+ let oct_escape = '\\' rO rO? rO? let utf8_char = ['\128'-'\254']+ rule token = parse | space+ { token lexbuf } | '\n' { update_newline_loc lexbuf; token lexbuf } | comment_line '\n' { update_newline_loc lexbuf; token lexbuf } | comment_line eof { token lexbuf } | "*/" { lex_error lexbuf "unexpected block-comment closing" } | "/*" { if !accept_c_comments_into_acsl_spec then comment lexbuf else lex_error lexbuf "unexpected block-comment opening" } | '\\' rL (rL | rD)* { bs_identifier lexbuf } | rL (rL | rD)* { let s = lexeme lexbuf in identifier s } | '0'['x''X'] rH+ rIS? { CONSTANT (IntConstant (lexeme lexbuf)) } | '0'['b''B'] rB+ rIS? { CONSTANT (IntConstant (lexeme lexbuf)) } | '0' rD+ rIS? { CONSTANT (IntConstant (lexeme lexbuf)) } | rD+ { CONSTANT10 (lexeme lexbuf) } | rD+ rIS { CONSTANT (IntConstant (lexeme lexbuf)) } | ('L'? "'" as prelude) (([^ '\\' '\'' '\n']|("\\"[^ '\n']))+ as content) "'" { let b = Buffer.create 5 in Buffer.add_string b prelude; let lbf = Lexing.from_string content in CONSTANT (IntConstant (chr b lbf ^ "'")) } (* floating-point literals, both decimal and hexadecimal *) | rD+ rE rFS? | rD* "." rD+ (rE)? rFS? | rD+ "." rD* (rE)? rFS? | '0'['x''X'] rH+ '.' rH* rP rFS? | '0'['x''X'] rH* '.' rH+ rP rFS? | '0'['x''X'] rH+ rP rFS? { CONSTANT (FloatConstant (lexeme lexbuf)) } (* hack to lex 0..3 as 0 .. 3 and not as 0. .3 *) | (rD+ as n) ".." { lexbuf.lex_curr_pos <- lexbuf.lex_curr_pos - 2; CONSTANT (IntConstant n) } | 'L'? '"' as prelude (([^ '\\' '"' '\n']|("\\"[^ '\n']))* as content) '"' { STRING_LITERAL (prelude.[0] = 'L',content) } | '#' { hash lexbuf } | "==>" { IMPLIES } | "<==>" { IFF } | "-->" { BIMPLIES } | "<-->" { BIFF } | "&&" { AND } | "||" { OR } | "!" { NOT } | "$" { DOLLAR } | "," { COMMA } | "->" { ARROW } | "?" { Stack.push Test state_stack; QUESTION } | ";" { SEMICOLON } | ":" { match get_state() with Normal -> COLON | Test -> pop_state(); COLON2 } | "::" { COLONCOLON } | "." { DOT } | ".." { DOTDOT } | "..." { DOTDOTDOT } | "-" { MINUS } | "+" { PLUS } | "*" { STAR } | "*^" { STARHAT } | "&" { AMP } | "^^" { HATHAT } | "^" { HAT } | "|" { PIPE } | "~" { TILDE } | "/" { SLASH } | "%" { PERCENT } | "<" { LT } | ">" { GT } | "<=" { LE } | ">=" { GE } | "==" { EQ } | "=" { EQUAL } | "!=" { NE } | "(" { Stack.push Normal state_stack; LPAR } | ")" { pop_state(); RPAR } | "{" { Stack.push Normal state_stack; LBRACE } | "}" { pop_state(); RBRACE } | "[" { Stack.push Normal state_stack; LSQUARE } | "]" { pop_state(); RSQUARE } | "[|" { Stack.push Normal state_stack; LSQUAREPIPE } | "|]" { pop_state(); RSQUAREPIPE } | "<<" { LTLT } | ">>" { GTGT } | utf8_char as c { find_utf8 c } | eof { EOF } | _ { lex_error lexbuf ("illegal character " ^ lexeme lexbuf) } and chr buffer = parse | hex_escape { let s = lexeme lexbuf in let real_s = String.sub s 2 (String.length s - 2) in let rec add_one_char s = let l = String.length s in if l = 0 then () else let h = int_of_digit s.[0] in let c,s = if l = 1 then (h,"") else (16*h + int_of_digit s.[1], String.sub s 2 (String.length s - 2)) in Buffer.add_char buffer (Char.chr c); add_one_char s in add_one_char real_s; chr buffer lexbuf } | oct_escape { let s = lexeme lexbuf in let real_s = String.sub s 1 (String.length s - 1) in let rec value i s = if s = "" then i else value (8*i+int_of_digit s.[0]) (String.sub s 1 (String.length s -1)) in let c = value 0 real_s in Buffer.add_char buffer (Char.chr c); chr buffer lexbuf } | escape { Buffer.add_char buffer (match (lexeme lexbuf).[1] with 'a' -> '\007' | 'b' -> '\b' | 'f' -> '\012' | 'n' -> '\n' | 'r' -> '\r' | 't' -> '\t' | 'v' -> '\011' (* no '\v' in OCaml 😞 *) | '\'' -> '\'' | '"' -> '"' | '?' -> '?' | '\\' -> '\\' | _ -> (* escape regex does not allow anything else *) assert false ); chr buffer lexbuf} | eof { Buffer.contents buffer } | _ { Buffer.add_string buffer (lexeme lexbuf); chr buffer lexbuf } and hash = parse '\n' { update_newline_loc lexbuf; token lexbuf} | [' ''\t'] { hash lexbuf} | rD+ { (* We are seeing a line number. This is the number for the * next line *) let s = Lexing.lexeme lexbuf in let lineno = try int_of_string s with Failure _ -> (* the int is too big. *) Kernel.warning ~source:(Cil_datatype.Position.of_lexing_pos lexbuf.lex_start_p) "Bad line number in preprocessed file: %s" s; (-1) in update_line_loc lexbuf (lineno - 1); (* A file name may follow *) file lexbuf } | "line" { hash lexbuf } (* MSVC line number info *) | _ { endline lexbuf} and file = parse '\n' { update_newline_loc lexbuf; token lexbuf} | [' ''\t''\r'] { file lexbuf} | '"' [^ '\012' '\t' '"']* '"' { let n = Lexing.lexeme lexbuf in let n1 = String.sub n 1 ((String.length n) - 2) in update_file_loc lexbuf n1; endline lexbuf } | _ { endline lexbuf} and endline = parse '\n' { update_newline_loc lexbuf; token lexbuf} | eof { EOF } | _ { endline lexbuf} and comment = parse '\n' { update_newline_loc lexbuf; comment lexbuf} | "*/" { token lexbuf} | eof { lex_error lexbuf "non-terminating block-comment" } | _ { comment lexbuf} { let set_initial_location dest_lexbuf src_loc = Lexing.( dest_lexbuf.lex_curr_p <- { src_loc with pos_bol = src_loc.pos_bol - src_loc.pos_cnum; pos_cnum = 0; }; ) let parse_from_location f (loc, s : Filepath.position * string) = let finally _ = Logic_utils.exit_kw_c_mode () in let output = Kernel.logwith finally ~wkey:Kernel.wkey_annot_error in let lb = from_string s in set_initial_location lb (Cil_datatype.Position.to_lexing_pos loc); try let res = f token lb in Some (Cil_datatype.Position.of_lexing_pos lb.Lexing.lex_curr_p, res) with | Failure s -> (* raised by the lexer itself, through [f] *) output ~source:(Cil_datatype.Position.of_lexing_pos lb.lex_curr_p) "lexing error: %s" s; None | Parsing.Parse_error -> output ~source:(Cil_datatype.Position.of_lexing_pos lb.lex_curr_p) "unexpected token '%s'" (Lexing.lexeme lb); None | Error (_, m) -> output ~source:(Cil_datatype.Position.of_lexing_pos lb.lex_curr_p) "%s" m; None | Logic_utils.Not_well_formed (loc, m) -> output ~source:(fst loc) "%s" m; None | Log.FeatureRequest(_,msg) -> output ~source:(Cil_datatype.Position.of_lexing_pos lb.lex_curr_p) "unimplemented ACSL feature: %s" msg; None | exn -> Kernel.fatal ~source:(Cil_datatype.Position.of_lexing_pos lb.lex_curr_p) "Unknown error (%s)" (Printexc.to_string exn) let lexpr = parse_from_location Logic_parser.lexpr_eof let annot = parse_from_location Logic_parser.annot let spec = parse_from_location Logic_parser.spec let ext_spec lexbuf = try accept_c_comments_into_acsl_spec := true ; let r = Logic_parser.ext_spec token lexbuf in accept_c_comments_into_acsl_spec := false ; r with exn -> accept_c_comments_into_acsl_spec := false ; raise exn type 'a parse = Filepath.position * string -> (Filepath.position * 'a) option let chr lexbuf = let buf = Buffer.create 16 in chr buf lexbuf } (* Local Variables: compile-command: "make -C ../../.. byte" End: *) frama-c-20.0-Calcium/src/kernel_internals/parsing/logic_parser.mly0000666000000000000000000016016713571573400022213 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* INRIA (Institut National de Recherche en Informatique et en */ /* Automatique) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* Grammar for C annotations */ %{ open Cil_types open Logic_ptree open Logic_utils let loc () = Cil_datatype.Location.of_lexing_loc (symbol_start_pos (), symbol_end_pos ()) let lexeme_start nb = Cil_datatype.Position.of_lexing_pos (Parsing.rhs_start_pos nb) let lexeme_end nb = Cil_datatype.Position.of_lexing_pos (Parsing.rhs_end_pos nb) let lexeme_loc nb = (lexeme_start nb, lexeme_end nb) let info x = { lexpr_node = x; lexpr_loc = loc () } let loc_info loc x = { lexpr_node = x; lexpr_loc = loc } let loc_start x = fst x.lexpr_loc let loc_end x = snd x.lexpr_loc (* Normalize p1 && (p2 && p3) into (p1 && p2) && p3 *) let rec pland p1 p2 = match p2.lexpr_node with | PLand (p3,p4) -> let loc = (loc_start p1, loc_end p3) in PLand(loc_info loc (pland p1 p3),p4) | _ -> PLand(p1,p2) let rec plor p1 p2 = match p2.lexpr_node with | PLor(p3,p4) -> let loc = (loc_start p1, loc_end p3) in PLor(loc_info loc (plor p1 p3),p4) | _ -> PLor(p1,p2) let clause_order i name1 name2 = raise (Not_well_formed (lexeme_loc i, "wrong order of clause in contract: " ^ name1 ^ " after " ^ name2 ^ ".")) let missing i token next_token = raise (Not_well_formed (lexeme_loc i, Format.asprintf "expecting '%s' before %s" token next_token)) type sense_of_relation = Unknown | Disequal | Less | Greater let check_empty (loc,msg) l = match l with [] -> () | _ -> raise (Not_well_formed (loc,msg)) let relation_sense rel sense = match rel, sense with | Eq, (Unknown|Greater|Less) -> sense, true | Neq, Unknown -> Disequal, false (* No chain of disequality for now*) | (Gt|Ge), (Unknown|Greater) -> Greater, true | (Lt|Le), (Unknown|Less) -> Less, true | _ -> sense, false let type_variables_stack = Stack.create () let enter_type_variables_scope l = List.iter Logic_env.add_typename l; Stack.push l type_variables_stack let exit_type_variables_scope () = let l = Stack.pop type_variables_stack in List.iter Logic_env.remove_typename l let rt_type = ref false let set_rt_type () = rt_type:= true let reset_rt_type () = rt_type:=false let is_rt_type () = !rt_type let loc_decl d = { decl_node = d; decl_loc = loc () } let concat_froms a1 a2 = let compare_pair (b1,_) (b2,_) = is_same_lexpr b1 b2 in (* NB: the following has an horrible complexity, but the order of clauses in the input is preserved. *) let concat_one acc (_,f2 as p) = try let (_,f1) = List.find (compare_pair p) acc in match (f1, f2) with | _,FromAny -> (* the new fundeps does not give more information than the one which is already present. Just ignore it. *) acc | FromAny, _ -> (* the new fundeps is strictly more precise than the old one. We replace the old dependency by the new one, but keep the location at its old place in the list. This ensures that we get the exact same clause if we try to link the original contract with its pretty-printed version. *) Extlib.replace compare_pair p acc | From _, From _ -> (* we keep the two functional dependencies, as they have to be proved separately. *) acc @ [p] with Not_found -> acc @ [p] in List.fold_left concat_one a1 a2 let concat_allocation fa1 fa2 = match fa1,fa2 with | FreeAllocAny,_ -> fa2 | _,FreeAllocAny -> fa1 | FreeAlloc(f1,a1),FreeAlloc(f2,a2) -> FreeAlloc(f2@f1,a2@a1) (* a1 represents the assigns _after_ the current clause a2. *) let concat_assigns a1 a2 = match a1,a2 with WritesAny,a -> Writes (concat_froms [] a) | Writes [], [] -> a1 | Writes [], _ | Writes _, [] -> raise ( Not_well_formed (loc(),"Mixing \\nothing and a real location")) | Writes a1, a2 -> Writes (concat_froms a2 a1) let concat_loop_assigns_allocation annots bhvs2 a2 fa2= (* NB: this is supposed to merge assigns related to named behaviors, in case of annotation like for a,b: assigns x,y; for b,c: assigns z,t; DO NOT CALL this function for loop assigns not attached to specific behaviors. *) assert (bhvs2 <> []); if fa2 == FreeAllocAny && a2 == WritesAny then annots else let split l1 l2 = let treat_one (only1,both,only2) x = if List.mem x l1 then (Extlib.filter_out (fun y -> x=y) only1,x::both,only2) else (only1,both,x::only2) in List.fold_left treat_one (l1,[],[]) l2 in let treat_one ca (bhvs2,acc) = match ca,a2,fa2 with (AAssigns(bhvs1,a1)),(Writes a2),_ -> let (only1,both,only2) = split bhvs1 bhvs2 in (match both with | [] -> bhvs2, ca::acc | _ -> let common_annot = AAssigns(both,concat_assigns a1 a2) in let annots = match only1 with | [] -> common_annot :: acc | _ -> AAssigns(only1,a1) :: common_annot :: acc in only2,annots) | (AAllocation(bhvs1,fa1)),_,(FreeAlloc _) -> let (only1,both,only2) = split bhvs1 bhvs2 in (match both with | [] -> bhvs2, ca::acc | _ -> let common_annot = AAllocation(both,concat_allocation fa1 fa2) in let annots = match only1 with | [] -> common_annot :: acc | _ -> AAllocation(only1,fa1) :: common_annot :: acc in only2,annots) | _,_,_ -> bhvs2,ca::acc in let (bhvs2, annots) = List.fold_right treat_one annots (bhvs2,[]) in match bhvs2 with | [] -> annots (* Already considered all cases. *) | _ -> let annots = if a2 <> WritesAny then AAssigns (bhvs2,a2) :: annots else annots in if fa2 <> FreeAllocAny then AAllocation (bhvs2,fa2) :: annots else annots let obsolete name ~source ~now = Kernel.warning ~source "parsing obsolete ACSL construct '%s'. '%s' should be used instead." name now let escape = let regex1 = Str.regexp "\\(\\(\\\\\\\\\\)*[^\\]\\)\\(['\"]\\)" in let regex2 = Str.regexp "\\(\\\\\\\\\\)*\\\\$" in fun str -> let str = Str.global_replace regex1 "\\1\\\\3" str in Str.global_replace regex2 "\\1\\\\" str let cv_const = Attr ("const", []) let cv_volatile = Attr ("volatile", []) %} /*****************************************************************************/ /* IMPORTANT NOTE: When you add a new token, be sure that it will be */ /* recognized by the any: rule at the end of this file. */ /* Otherwise, the token will not be usable inside a contract. */ /*****************************************************************************/ %token MODULE FUNCTION CONTRACT INCLUDE EXT_AT EXT_LET /* ACSL extension for external spec file */ %token IDENTIFIER TYPENAME %token STRING_LITERAL %token CONSTANT %token CONSTANT10 %token LPAR RPAR IF ELSE COLON COLON2 COLONCOLON DOT DOTDOT DOTDOTDOT %token INT INTEGER REAL BOOLEAN BOOL FLOAT LT GT LE GE EQ NE COMMA ARROW EQUAL %token FORALL EXISTS IFF IMPLIES AND OR NOT SEPARATED %token TRUE FALSE OLD AT RESULT %token BLOCK_LENGTH BASE_ADDR OFFSET VALID VALID_READ VALID_INDEX VALID_RANGE VALID_FUNCTION %token ALLOCATION STATIC REGISTER AUTOMATIC DYNAMIC UNALLOCATED %token ALLOCABLE FREEABLE FRESH %token DOLLAR QUESTION MINUS PLUS STAR AMP SLASH PERCENT LSQUARE RSQUARE EOF %token GLOBAL INVARIANT VARIANT DECREASES FOR LABEL ASSERT CHECK SEMICOLON NULL EMPTY %token REQUIRES ENSURES ALLOCATES FREES ASSIGNS LOOP NOTHING SLICE IMPACT PRAGMA FROM %token EXT_CODE_ANNOT EXT_GLOBAL EXT_CONTRACT %token EXITS BREAKS CONTINUES RETURNS %token VOLATILE READS WRITES %token LOGIC PREDICATE INDUCTIVE AXIOMATIC AXIOM LEMMA LBRACE RBRACE %token GHOST MODEL CASE %token VOID CHAR SIGNED UNSIGNED SHORT LONG DOUBLE STRUCT ENUM UNION %token BSUNION INTER %token TYPE BEHAVIOR BEHAVIORS ASSUMES COMPLETE DISJOINT %token TERMINATES %token BIFF BIMPLIES STARHAT HAT HATHAT PIPE TILDE GTGT LTLT %token SIZEOF LAMBDA LET %token TYPEOF BSTYPE %token WITH CONST %token INITIALIZED DANGLING %token CUSTOM %token LSQUAREPIPE RSQUAREPIPE %token IN %token PI %right prec_named %nonassoc TYPENAME %nonassoc prec_forall prec_exists prec_lambda LET %right QUESTION prec_question %left IFF %right IMPLIES %left OR %left HATHAT %left AND %left BIFF %right BIMPLIES %left PIPE %left HAT %left STARHAT %left AMP %nonassoc IN %left LT %left LTLT GTGT %left PLUS MINUS %left STAR SLASH PERCENT %right prec_cast TILDE NOT prec_unary_op %left DOT ARROW LSQUARE %type lexpr_eof %start lexpr_eof %type annot %start annot %type spec %start spec %type ext_spec %start ext_spec %% enter_kw_c_mode: /* empty */ { enter_kw_c_mode () } exit_kw_c_mode: /* empty */ { exit_kw_c_mode () } enter_rt_type: /* empty */ { if is_rt_type () then enter_rt_type_mode () } exit_rt_type: /* empty */ { if is_rt_type () then exit_rt_type_mode () } begin_rt_type: /* empty */ { set_rt_type () } end_rt_type: /* empty */ { reset_rt_type () } /*** predicates and terms ***/ lexpr_list: | /* epsilon */ { [] } | ne_lexpr_list { $1 } ; ne_lexpr_list: | lexpr { [$1] } | lexpr COMMA ne_lexpr_list { $1 :: $3 } ; lexpr_eof: | full_lexpr EOF { $1 } ; lexpr_option: | /* epsilon */ { None } | lexpr { Some $1 } ; lexpr: /* predicates */ | lexpr IMPLIES lexpr { info (PLimplies ($1, $3)) } | lexpr IFF lexpr { info (PLiff ($1, $3)) } | lexpr OR lexpr { info (plor $1 $3) } | lexpr AND lexpr { info (pland $1 $3) } | lexpr HATHAT lexpr { info (PLxor ($1, $3)) } /* terms */ | lexpr AMP lexpr { info (PLbinop ($1, Bbw_and, $3)) } | lexpr PIPE lexpr { info (PLbinop ($1, Bbw_or, $3)) } | lexpr HAT lexpr { info (PLbinop ($1, Bbw_xor, $3)) } | lexpr BIMPLIES lexpr { info (PLbinop (info (PLunop (Ubw_not, $1)), Bbw_or, $3)) } | lexpr BIFF lexpr { info (PLbinop (info (PLunop (Ubw_not, $1)), Bbw_xor, $3)) } | lexpr IN lexpr { info (PLapp ("\\subset", [], [info ((PLset [$1]));$3])) } | lexpr QUESTION lexpr COLON2 lexpr %prec prec_question { info (PLif ($1, $3, $5)) } /* both terms and predicates */ | any_identifier COLON lexpr %prec prec_named { info (PLnamed ($1, $3)) } | string COLON lexpr %prec prec_named { let (iswide,str) = $1 in if iswide then begin let l = loc () in raise (Not_well_formed(l, "Wide strings are not allowed as labels.")) end; let str = escape str in info (PLnamed (str, $3)) } | lexpr_rel { $1 } ; lexpr_rel: | lexpr_end_rel { $1 } | lexpr_inner rel_list { let rel, rhs, _, oth_rel = $2 in let loc = loc_start $1, loc_end rhs in let relation = loc_info loc (PLrel($1,rel,rhs)) in match oth_rel with None -> relation | Some oth_relation -> info (pland relation oth_relation) } ; lexpr_binder: | LET bounded_var EQUAL lexpr SEMICOLON lexpr %prec LET {info (PLlet($2,$4,$6))} | FORALL binders SEMICOLON lexpr %prec prec_forall { info (PLforall ($2, $4)) } | EXISTS binders SEMICOLON lexpr %prec prec_exists { info (PLexists ($2, $4)) } | LAMBDA binders SEMICOLON lexpr %prec prec_lambda { info (PLlambda ($2,$4)) } ; lexpr_end_rel: lexpr_inner { $1 } | lexpr_binder { $1 } | NOT lexpr_binder { info (PLnot $2) } ; rel_list: | relation lexpr_end_rel { $1, $2, fst(relation_sense $1 Unknown), None } | relation lexpr_inner rel_list { let next_rel, rhs, sense, oth_rel = $3 in let (sense, correct) = relation_sense $1 sense in if correct then let loc = loc_start $2, loc_end rhs in let my_rel = loc_info loc (PLrel($2,next_rel,rhs)) in let oth_rel = match oth_rel with None -> my_rel | Some rel -> let loc = loc_start $2, loc_end rel in loc_info loc (pland my_rel rel) in $1,$2,sense,Some oth_rel else begin let loc = lexeme_start 1, lexeme_end 3 in raise (Not_well_formed(loc,"Inconsistent relation chain.")); end } ; relation: | LT { Lt } | GT { Gt } | LE { Le } | GE { Ge } | EQ { Eq } | NE { Neq } /* C. Marche: added to produce better error messages */ | EQUAL { let l = loc () in raise (Not_well_formed(l, "Assignment operators not allowed in annotations.")) } ; lexpr_inner: | string { let (is_wide,content) = $1 in let cst = if is_wide then WStringConstant content else StringConstant content in info (PLconstant cst) } | NOT lexpr_inner { info (PLnot $2) } | TRUE { info PLtrue } | FALSE { info PLfalse } | VALID opt_label_1 LPAR lexpr RPAR { info (PLvalid ($2,$4)) } | VALID_READ opt_label_1 LPAR lexpr RPAR { info (PLvalid_read ($2,$4)) } | VALID_FUNCTION LPAR lexpr RPAR { info (PLvalid_function $3) } | VALID_INDEX opt_label_1 LPAR lexpr COMMA lexpr RPAR { let source = fst (loc ()) in obsolete ~source "\\valid_index(addr,idx)" ~now:"\\valid(addr+idx)"; info (PLvalid ($2,info (PLbinop ($4, Badd, $6)))) } | VALID_RANGE opt_label_1 LPAR lexpr COMMA lexpr COMMA lexpr RPAR { let source = fst (loc ()) in obsolete "\\valid_range(addr,min,max)" ~source ~now:"\\valid(addr+(min..max))"; info (PLvalid ($2,info (PLbinop ($4, Badd, (info (PLrange((Some $6),Some $8))))))) } | INITIALIZED opt_label_1 LPAR lexpr RPAR { info (PLinitialized ($2,$4)) } | DANGLING opt_label_1 LPAR lexpr RPAR { info (PLdangling ($2,$4)) } | FRESH opt_label_2 LPAR lexpr COMMA lexpr RPAR { info (PLfresh ($2,$4, $6)) } | BASE_ADDR opt_label_1 LPAR lexpr RPAR { info (PLbase_addr ($2,$4)) } | BLOCK_LENGTH opt_label_1 LPAR lexpr RPAR { info (PLblock_length ($2,$4)) } | OFFSET opt_label_1 LPAR lexpr RPAR { info (PLoffset ($2,$4)) } | ALLOCABLE opt_label_1 LPAR lexpr RPAR { info (PLallocable ($2,$4)) } | FREEABLE opt_label_1 LPAR lexpr RPAR { info (PLfreeable ($2,$4)) } | ALLOCATION opt_label_1 LPAR lexpr RPAR { Kernel.not_yet_implemented "\\allocation" } | AUTOMATIC { Kernel.not_yet_implemented "\\automatic" } | DYNAMIC { Kernel.not_yet_implemented "\\dynamic" } | REGISTER { Kernel.not_yet_implemented "\\register" } | STATIC { Kernel.not_yet_implemented "\\static" } | UNALLOCATED { Kernel.not_yet_implemented "\\unallocated" } | NULL { info PLnull } | constant { info (PLconstant $1) } | lexpr_inner PLUS lexpr_inner { info (PLbinop ($1, Badd, $3)) } | lexpr_inner MINUS lexpr_inner { info (PLbinop ($1, Bsub, $3)) } | lexpr_inner STAR lexpr_inner { info (PLbinop ($1, Bmul, $3)) } | lexpr_inner SLASH lexpr_inner { info (PLbinop ($1, Bdiv, $3)) } | lexpr_inner PERCENT lexpr_inner { info (PLbinop ($1, Bmod, $3)) } | lexpr_inner STARHAT lexpr_inner { info (PLrepeat ($1, $3)) } | lexpr_inner ARROW identifier_or_typename { info (PLarrow ($1, $3)) } | lexpr_inner DOT identifier_or_typename { info (PLdot ($1, $3)) } | lexpr_inner LSQUARE range RSQUARE { info (PLarrget ($1, $3)) } | lexpr_inner LSQUARE lexpr RSQUARE { info (PLarrget ($1, $3)) } | LSQUAREPIPE lexpr_list RSQUAREPIPE {info (PLlist $2) } | MINUS lexpr_inner %prec prec_unary_op { info (PLunop (Uminus, $2)) } | PLUS lexpr_inner %prec prec_unary_op { $2 } | TILDE lexpr_inner { info (PLunop (Ubw_not, $2)) } | STAR lexpr_inner %prec prec_unary_op { info (PLunop (Ustar, $2)) } | AMP lexpr_inner %prec prec_unary_op { info (PLunop (Uamp, $2)) } | SIZEOF LPAR lexpr RPAR { info (PLsizeofE $3) } | SIZEOF LPAR cast_logic_type RPAR { info (PLsizeof $3) } | OLD LPAR lexpr RPAR { info (PLold $3) } | AT LPAR lexpr COMMA label_name RPAR { info (PLat ($3, $5)) } | RESULT { info PLresult } | SEPARATED LPAR ne_lexpr_list RPAR { info (PLseparated $3) } | identifier LPAR ne_lexpr_list RPAR { info (PLapp ($1, [], $3)) } | identifier LBRACE ne_label_args RBRACE LPAR ne_lexpr_list RPAR { info (PLapp ($1, $3, $6)) } | identifier LBRACE ne_label_args RBRACE { info (PLapp ($1, $3, [])) } | identifier { info (PLvar $1) } | PI { info (PLvar "\\pi") } | lexpr_inner GTGT lexpr_inner { info (PLbinop ($1, Brshift, $3))} | lexpr_inner LTLT lexpr_inner { info (PLbinop ($1, Blshift, $3))} | LPAR lexpr RPAR { info $2.lexpr_node } | LPAR range RPAR { info $2.lexpr_node } | LPAR cast_logic_type RPAR lexpr_inner %prec prec_cast { info (PLcast ($2, $4)) } | TYPEOF LPAR lexpr RPAR { info (PLtypeof $3) } | BSTYPE LPAR type_spec RPAR { info (PLtype $3) } | BSTYPE LPAR type_spec stars RPAR { info (PLtype ($4 $3)) } /* tsets */ | EMPTY { info PLempty } | BSUNION LPAR lexpr_list RPAR { info (PLunion $3) } | INTER LPAR lexpr_list RPAR { info (PLinter $3) } | LBRACE lexpr_list RBRACE { info (PLset ($2)) } | LBRACE lexpr PIPE binders RBRACE {info (PLcomprehension ($2,$4,None)) } | LBRACE lexpr PIPE binders SEMICOLON lexpr RBRACE { info (PLcomprehension ($2,$4,Some $6)) } /* Aggregated object initialization */ | LBRACE field_init RBRACE { info (PLinitField($2)) } | LBRACE array_init RBRACE { info (PLinitIndex($2)) } | LBRACE lexpr WITH update RBRACE { List.fold_left (fun a (path,upd_val) -> info (PLupdate(a,path,upd_val))) $2 $4 } /* | LET bounded_var EQUAL lexpr SEMICOLON lexpr %prec LET {info (PLlet($2,$4,$6))}*/ ; ne_label_args: | identifier_or_typename { [ $1 ] } | identifier_or_typename COMMA ne_label_args { $1 :: $3 } string: | STRING_LITERAL { $1 } | string STRING_LITERAL { let (is_wide,prefix) = $1 in let (is_wide2,suffix) = $2 in (is_wide || is_wide2, prefix ^ suffix) } ; range: | lexpr_option DOTDOT lexpr_option { info (PLrange($1,$3)) } ; /*** Aggregated object initialization ***/ field_path_elt: | DOT identifier_or_typename { $2 } ; field_init_elt: | field_path_elt EQUAL lexpr { ($1, $3) } ; field_init: | field_init_elt { [$1] } | field_init_elt COMMA field_init { $1::$3 } ; array_path_elt: | LSQUARE lexpr RSQUARE { $2 } | LSQUARE range RSQUARE { $2 } ; array_init_elt: | array_path_elt EQUAL lexpr { ($1, $3) } array_init: | array_init_elt { [$1] } | array_init_elt COMMA array_init { $1::$3 } ; /*** Functional update ***/ update: | update_elt { [$1] } | update_elt COMMA update { $1::$3 } ; update_elt: | path EQUAL lexpr { $1, PLupdateTerm $3 } | path EQUAL LBRACE WITH update RBRACE { $1, PLupdateCont $5 } ; path: | path_elt { [$1] } | path_elt path { $1::$2 } ; path_elt: | field_path_elt { PLpathField $1 } | array_path_elt { PLpathIndex $1 } ; /*** binders ***/ binders: | binders_reentrance { let (_lt, vars) = $1 in vars } ; binders_reentrance: | decl_spec { let (lt, var) = $1 in (lt, [var]) } | binders_reentrance COMMA decl_spec { let _, vars = $1 in let (lt, var) = $3 in (lt, vars @ [ var ]) } | binders_reentrance COMMA var_spec { let last_type_spec, vars = $1 in (last_type_spec, vars @ [ let (modif, name) = $3 in (modif last_type_spec, name)]) } ; decl_spec: | type_spec var_spec { ($1, let (modif, name) = $2 in (modif $1, name)) } ; var_spec: | var_spec_bis { let (outer, inner,name) = $1 in ((fun x -> outer (inner x)), name)} | stars var_spec_bis { let (outer, inner, name) = $2 in ((fun x -> outer (inner ($1 x))), name) } ; constant: | CONSTANT { $1 } | CONSTANT10 { IntConstant $1 } ; array_size: | CONSTANT10 { ASinteger $1 } | identifier { ASidentifier $1 } | /* empty */ { ASnone } ; var_spec_bis: | identifier { ((fun x -> x),(fun x -> x), $1) } | var_spec_bis LSQUARE array_size RSQUARE { let (outer, inner, name) = $1 in (outer, (fun x -> inner (LTarray (x,$3))), name) } | LPAR var_spec RPAR { let (modif, name) = $2 in (modif, (fun x -> x), name) } | var_spec_bis LPAR abs_param_type_list RPAR { let (outer, inner,name) = $1 in let params = $3 in (outer, (fun x -> inner (LTarrow (params,x))), name) } ; abs_param_type_list: | /* empty */ { [ ] } | abs_param_list { $1 } | abs_param_list COMMA DOTDOTDOT { Kernel.not_yet_implemented "variadic C function types" } ; abs_param_list: | abs_param { [ $1 ] } | abs_param_list COMMA abs_param { $1 @ [ $3 ] } ; /* TODO: abs_param should be less restrictive than parameter since its name can be omitted */ abs_param: | logic_type { $1 } ; /*** restricted type expressions ***/ id_as_typename: | identifier { LTnamed($1, []) } ; ne_parameters: | parameter { [$1] } | parameter COMMA ne_parameters { $1 :: $3 } ; parameter: | type_spec var_spec { let (modif, name) = $2 in (modif $1, name)} | id_as_typename var_spec { let (modif, name) = $2 in (modif $1, name) } ; /*** type expressions ***/ logic_type: | type_spec abs_spec_option { $2 $1 } ; cv: CONST { cv_const } | VOLATILE { cv_volatile } ; type_spec_cv: type_spec { $1 } | cv type_spec_cv { LTattribute ($2, $1) } | type_spec_cv cv { LTattribute ($1, $2) } cast_logic_type: | type_spec_cv abs_spec_cv_option { $2 $1 } ; logic_rt_type: | id_as_typename { $1 } | begin_rt_type logic_type end_rt_type { $2 } ; abs_spec_option: | /* empty */ %prec TYPENAME { fun t -> t } | abs_spec { $1 } ; abs_spec_cv_option: | /* empty */ { fun t -> t } | abs_spec_cv { $1 } ; abs_spec: | tabs { $1 } | stars %prec TYPENAME { $1 } | stars tabs { fun t -> $2 ($1 t) } | stars abs_spec_bis %prec TYPENAME { fun t -> $2 ($1 t) } | stars abs_spec_bis tabs { fun t -> $2 ($3 ($1 t)) } | abs_spec_bis tabs { fun t -> $1 ($2 t) } | abs_spec_bis %prec TYPENAME { $1 } ; abs_spec_cv: | tabs { $1 } | stars_cv { $1 } | stars_cv tabs { fun t -> $2 ($1 t) } | stars_cv abs_spec_bis_cv { fun t -> $2 ($1 t) } | stars_cv abs_spec_bis_cv tabs { fun t -> $2 ($3 ($1 t)) } | abs_spec_bis_cv tabs { fun t -> $1 ($2 t) } | abs_spec_bis_cv { $1 } ; abs_spec_bis: | LPAR abs_spec RPAR { $2 } | abs_spec_bis LPAR abs_param_type_list RPAR { fun t -> $1 (LTarrow($3,t)) }; ; abs_spec_bis_cv: | LPAR abs_spec_cv RPAR { $2 } | abs_spec_bis_cv LPAR abs_param_type_list RPAR { fun t -> $1 (LTarrow($3,t)) }; ; stars: | STAR { fun t -> LTpointer t } | stars STAR { fun t -> (LTpointer ($1 t)) } ; stars_cv: | STAR { fun t -> LTpointer t } | STAR cv { fun t -> LTattribute ((LTpointer t), $2) } | stars_cv STAR { fun t -> (LTpointer ($1 t)) } | stars_cv STAR cv { fun t -> (LTattribute ((LTpointer ($1 t)), $3)) } ; tabs: | LSQUARE array_size RSQUARE %prec TYPENAME { fun t -> LTarray (t,$2) } | LSQUARE array_size RSQUARE tabs { fun t -> (LTarray ($4 t,$2)) } ; type_spec: | INTEGER { LTinteger } | REAL { LTreal } | BOOLEAN { LTnamed (Utf8_logic.boolean,[]) } | VOID { LTvoid } | BOOL { LTint IBool } | CHAR { LTint IChar } /** [char] */ | SIGNED CHAR { LTint ISChar } /** [signed char] */ | UNSIGNED CHAR { LTint IUChar } /** [unsigned char] */ | INT { LTint IInt } /** [int] */ | SIGNED INT { LTint IInt } /** [int] */ | UNSIGNED INT { LTint IUInt } /** [unsigned int] */ | UNSIGNED { LTint IUInt } | SHORT { LTint IShort } /** [short] */ | SIGNED SHORT { LTint IShort } /** [short] */ | UNSIGNED SHORT { LTint IUShort } /** [unsigned short] */ | LONG { LTint ILong } /** [long] */ | SIGNED LONG { LTint ILong } /** [long] */ | UNSIGNED LONG { LTint IULong } /** [unsigned long] */ | SIGNED LONG INT{ LTint ILong } /** [long] */ | LONG INT { LTint ILong } /** [long] */ | UNSIGNED LONG INT { LTint IULong } /** [unsigned long] */ | LONG LONG { LTint ILongLong } /** [long long] (or [_int64] on Microsoft Visual C) */ | SIGNED LONG LONG { LTint ILongLong } /** [long long] (or [_int64] on Microsoft Visual C) */ | UNSIGNED LONG LONG { LTint IULongLong } /** [unsigned long long] (or [unsigned _int64] on Microsoft Visual C) */ | LONG LONG INT { LTint ILongLong } /** [long long] (or [_int64] on Microsoft Visual C) */ | SIGNED LONG LONG INT { LTint ILongLong } /** [long long] (or [_int64] on Microsoft Visual C) */ | UNSIGNED LONG LONG INT { LTint IULongLong } /** [unsigned long long] (or [unsigned _int64] on Microsoft Visual C) */ | FLOAT { LTfloat FFloat } | DOUBLE { LTfloat FDouble } | LONG DOUBLE { LTfloat FLongDouble } | STRUCT exit_rt_type identifier_or_typename { LTstruct $3 } | ENUM exit_rt_type identifier_or_typename { LTenum $3 } | UNION exit_rt_type identifier_or_typename { LTunion $3 } | TYPENAME { LTnamed ($1,[]) } | TYPENAME LT enter_rt_type ne_logic_type_list GT exit_rt_type { LTnamed($1,$4) } ; ne_logic_type_list: | logic_type { [$1] } | logic_type COMMA enter_rt_type ne_logic_type_list { $1 :: $4 } ; /*** from annotations ***/ full_lexpr: | enter_kw_c_mode lexpr exit_kw_c_mode { $2 } ; full_identifier: | enter_kw_c_mode identifier exit_kw_c_mode { $2 } ; full_identifier_or_typename: | enter_kw_c_mode identifier_or_typename exit_kw_c_mode { $2 } ; full_parameters: | enter_kw_c_mode ne_parameters exit_kw_c_mode { $2 } ; full_parameter: | enter_kw_c_mode parameter exit_kw_c_mode { $2 } ; full_zones: | enter_kw_c_mode zones exit_kw_c_mode { $2 } ; full_ne_zones: | enter_kw_c_mode ne_zones exit_kw_c_mode { $2 } ; full_ne_lexpr_list: enter_kw_c_mode ne_lexpr_list exit_kw_c_mode { $2 } ; full_logic_type: | enter_kw_c_mode logic_type exit_kw_c_mode { $2 } ; full_logic_rt_type: | enter_kw_c_mode logic_rt_type exit_kw_c_mode { $2 } full_assigns: | enter_kw_c_mode assigns exit_kw_c_mode { $2 } ; /*** ACSL extension for external spec file ***/ ext_spec: | ext_global_clauses_opt ext_module_specs_opt ext_global_specs_opt EOF { (None,$1,$2)::$3 } ; ext_global_clauses_opt: | /* empty */ { [] } | ext_global_clauses { $1 } ; ext_global_clauses: | ext_global_clause { [$1] } | ext_global_clause ext_global_clauses { $1::$2 } ; ext_global_clause: | decl { Ext_decl (loc_decl $1) } | EXT_LET any_identifier EQUAL full_lexpr SEMICOLON { Ext_macro (false, $2, $4) } | GLOBAL EXT_LET any_identifier EQUAL full_lexpr SEMICOLON { Ext_macro (true, $3, $5) } | INCLUDE string SEMICOLON { let b,s = $2 in Ext_include(b,s, loc()) } ; ext_global_specs_opt: | /* empty */ { [] } | ext_global_specs { $1 } ; ext_global_specs: | ext_global_spec { [$1] } | ext_global_spec ext_global_specs { $1::$2 } ; ext_global_spec: | ext_module_markup ext_global_clauses_opt ext_module_specs { (Some $1),$2,$3 } | ext_module_markup ext_global_clauses_opt { (Some $1),$2,[] } ; ext_module_specs_opt: | /* empty */ { [] } | ext_module_specs { $1 } | ext_fun_specs { [None, $1] } | ext_fun_specs ext_module_specs { (None, $1)::$2 } ; ext_module_specs: | ext_module_spec { [$1] } | ext_module_spec ext_module_specs { $1::$2 } ; ext_module_spec: | ext_function_markup ext_function_specs_opt { (Some $1),$2 } ; ext_function_specs_opt: | /* empty */ { [] } | ext_function_specs { $1 } ; ext_function_specs: | ext_at_stmt_markup { []} | ext_function_spec { [$1] } | ext_function_spec ext_function_specs { $1::$2 } ; ext_function_spec: | ext_global_clause { Ext_glob $1 } | ext_fun_spec { $1 } ; ext_fun_specs: | ext_fun_spec { [$1] } | ext_fun_spec ext_fun_specs { $1::$2 } ; ext_fun_spec: | ext_at_stmt_markup ext_stmt_loop_spec { Ext_stmt($1,$2,loc()) } | ext_contract_markup contract { let s,pos = $2 in Ext_spec (s,pos) } ; ext_stmt_loop_spec: | annotation { $1 } | ext_contract_markup contract { let s, pos = $2 in Acode_annot (pos, AStmtSpec ([],s)) } ; ext_identifier_opt: | /* empty*/ { "" } | ext_identifier { $1 } ; ext_identifier: | any_identifier { $1 } ; ext_module_markup: | MODULE ext_identifier COLON { $2 } ; ext_function_markup: | FUNCTION ext_identifier COLON { $2, loc() } ; ext_contract_markup: | CONTRACT ext_identifier_opt COLON { $2 } ; stmt_markup: | any_identifier { $1 } | CONSTANT10 { $1 } ; stmt_markup_attr: | stmt_markup { [$1] } | stmt_markup stmt_markup_attr { $1 :: $2 } ; ext_at_stmt_markup: | EXT_AT stmt_markup_attr COLON { $2 } ; /*** function and statement contracts ***/ spec: | contract EOF { fst $1 } ; contract: | requires terminates decreases simple_clauses behaviors complete_or_disjoint { let requires=$1 in let (allocation,assigns,post_cond,extended) = $4 in let behaviors = $5 in let (completes,disjoints) = $6 in let behaviors = if requires <> [] || post_cond <> [] || allocation <> FreeAllocAny || assigns <> WritesAny || extended <> [] then (Cabshelper.mk_behavior ~requires ~post_cond ~assigns ~allocation ~extended ()) :: behaviors else if $2<>None || $3<>None || behaviors<>[] || completes<>[] ||disjoints<>[] then behaviors else raise (Not_well_formed (loc(),"Empty annotation is not allowed")) in { spec_terminates = $2; spec_variant = $3; spec_behavior = behaviors; spec_complete_behaviors = completes; spec_disjoint_behaviors = disjoints; }, loc() } | requires ne_terminates REQUIRES { clause_order 3 "requires" "terminates" } | requires terminates ne_decreases REQUIRES { clause_order 4 "requires" "decreases" } | requires terminates ne_decreases TERMINATES { clause_order 4 "terminates" "decreases" } | requires terminates decreases ne_simple_clauses REQUIRES { clause_order 5 "requires" "post-condition, assigns or allocates" } | requires terminates decreases ne_simple_clauses TERMINATES { clause_order 5 "terminates" "post-condition, assigns or allocates" } | requires terminates decreases ne_simple_clauses DECREASES { clause_order 5 "decreases" "post-condition, assigns or allocates" } | requires terminates decreases simple_clauses ne_behaviors TERMINATES { clause_order 6 "terminates" "behavior" } | requires terminates decreases simple_clauses ne_behaviors DECREASES { clause_order 6 "decreases" "behavior" } | requires terminates decreases simple_clauses behaviors ne_complete_or_disjoint REQUIRES { clause_order 7 "requires" "complete or disjoint" } | requires terminates decreases simple_clauses behaviors ne_complete_or_disjoint TERMINATES { clause_order 7 "terminates" "complete or disjoint" } | requires terminates decreases simple_clauses behaviors ne_complete_or_disjoint DECREASES { clause_order 7 "decreases" "complete or disjoint" } | requires terminates decreases simple_clauses behaviors ne_complete_or_disjoint BEHAVIOR { clause_order 7 "behavior" "complete or disjoint" } | requires terminates decreases simple_clauses behaviors ne_complete_or_disjoint ASSIGNS { clause_order 7 "assigns" "complete or disjoint" } | requires terminates decreases simple_clauses behaviors ne_complete_or_disjoint ALLOCATES { clause_order 7 "allocates" "complete or disjoint" } | requires terminates decreases simple_clauses behaviors ne_complete_or_disjoint FREES { clause_order 7 "frees" "complete or disjoint" } | requires terminates decreases simple_clauses behaviors ne_complete_or_disjoint post_cond_kind { clause_order 7 "post-condition" "complete or disjoint" } ; // use that to detect potentially missing ';' at end of clause clause_kw: | REQUIRES { "requires" } | ASSUMES {"assumes"} | ASSIGNS { "assigns" } | post_cond { snd $1 } | DECREASES { "decreases"} | BEHAVIOR { "behavior"} | ALLOCATES {"allocates"} | FREES {"frees"} | COMPLETE {"complete"} | DISJOINT {"disjoint"} /* often, we'll be in c_kw_mode, where these keywords are recognized as identifiers... */ | IDENTIFIER { $1 } | EXT_CONTRACT { $1 } | EOF { "end of annotation" } ; requires: | /* epsilon */ { [] } | ne_requires { $1 } ; ne_requires: | REQUIRES full_lexpr SEMICOLON requires { $2::$4 } | REQUIRES full_lexpr clause_kw { missing 2 ";" $3} ; terminates: | /* epsilon */ { None } | ne_terminates { Some $1 } ; ne_terminates: | TERMINATES full_lexpr SEMICOLON { $2 } | TERMINATES full_lexpr clause_kw { missing 2 ";" $3 } ; decreases: | /* epsilon */ { None } | ne_decreases { Some $1 } ; ne_decreases: | DECREASES variant SEMICOLON { $2 } | DECREASES variant clause_kw { missing 2 ";" $3 } ; variant: | full_lexpr FOR any_identifier { ($1, Some $3) } | full_lexpr { ($1, None) } ; simple_clauses: | /* epsilon */ { FreeAllocAny,WritesAny,[],[] } | ne_simple_clauses { $1 } ; allocation: | ALLOCATES full_zones { FreeAlloc([],$2) } | FREES full_zones { FreeAlloc($2,[]) } ne_simple_clauses: | post_cond_kind full_lexpr SEMICOLON simple_clauses { let allocation,assigns,post_cond,extended = $4 in allocation,assigns,(($1,$2)::post_cond),extended } | allocation SEMICOLON simple_clauses { let allocation,assigns,post_cond,extended = $3 in let a = concat_allocation allocation $1 in a,assigns,post_cond,extended } | ASSIGNS full_assigns SEMICOLON simple_clauses { let allocation,assigns,post_cond,extended = $4 in let a = concat_assigns assigns $2 in allocation,a,post_cond,extended } | EXT_CONTRACT grammar_extension SEMICOLON simple_clauses { let allocation,assigns,post_cond,extended = $4 in allocation,assigns,post_cond,($1,$2)::extended } | post_cond_kind full_lexpr clause_kw { missing 2 ";" $3 } | allocation clause_kw { missing 1 ";" $2 } | ASSIGNS full_assigns clause_kw { missing 2 ";" $3 } | EXT_CONTRACT grammar_extension clause_kw { missing 1 ";" $3 } ; grammar_extension: /* Grammar Extensibility for plugins */ | full_zones { $1 } ; post_cond_kind: | post_cond { fst $1 } ; behaviors: | /* epsilon */ { [] } | ne_behaviors { $1 } ne_behaviors: | BEHAVIOR behavior_name COLON behavior_body behaviors { let (assumes,requires,(allocation,assigns,post_cond,extended)) = $4 in let behaviors = $5 in let b = Cabshelper.mk_behavior ~name:$2 ~assumes ~requires ~post_cond ~assigns ~allocation ~extended () in b::behaviors } behavior_body: | assumes requires simple_clauses { $1,$2,$3 } | assumes ne_requires ASSUMES { clause_order 3 "assumes" "requires" } | assumes requires ne_simple_clauses ASSUMES { clause_order 4 "assumes" "assigns or post-condition" } | assumes requires ne_simple_clauses REQUIRES { clause_order 4 "requires" "assigns or post-condition" } ; assumes: | /* epsilon */ { [] } | ASSUMES full_lexpr SEMICOLON assumes { $2::$4 } | ASSUMES full_lexpr clause_kw { missing 2 ";" $3 } ; complete_or_disjoint: | /* epsilon */ { [],[] } | ne_complete_or_disjoint { $1 } ne_complete_or_disjoint: | COMPLETE BEHAVIORS behavior_name_list SEMICOLON complete_or_disjoint { let complete,disjoint = $5 in $3::complete, disjoint } | DISJOINT BEHAVIORS behavior_name_list SEMICOLON complete_or_disjoint { let complete,disjoint = $5 in complete,$3::disjoint } /* complete behaviors decreases; is valid (provided there's a behavior named decreases) */ | COMPLETE BEHAVIORS ne_behavior_name_list clause_kw { missing 3 ";" $4 } | DISJOINT BEHAVIORS ne_behavior_name_list clause_kw { missing 3 ";" $4 } ; /*** assigns and tsets ***/ assigns: | zones { List.map (fun x -> (x,FromAny)) $1 } | ne_zones FROM zones {List.map (fun x -> (x, From $3)) $1} ; zones: | ne_zones { $1 } | NOTHING { [] } ; ne_zones: | ne_lexpr_list { $1 } ; /*** annotations ***/ annot: | annotation EOF { $1 } | is_acsl_spec any EOF { Aspec } | decl_list EOF { Adecl ($1) } | CUSTOM any_identifier COLON custom_tree EOF { Acustom(loc (),$2, $4) } ; custom_tree: | TYPE type_spec { CustomType $2 } | LOGIC lexpr { CustomLexpr $2 } | any_identifier_non_logic { CustomOther($1,[]) } | any_identifier_non_logic LPAR custom_tree_list RPAR { CustomOther($1,$3) } ; custom_tree_list: | custom_tree { [$1] } | custom_tree COMMA custom_tree_list { $1::$3 } ; annotation: | loop_annotations { let (b,v,p) = $1 in (* TODO: do better, do not lose the structure ! *) let l = b@v@p in Aloop_annot (loc (), l) } | FOR ne_behavior_name_list COLON contract_or_code_annotation { $4 $2 } | pragma_or_code_annotation { Acode_annot (loc(),$1) } | pragma_or_code_annotation beg_pragma_or_code_annotation { raise (Not_well_formed (loc(), "Only one code annotation is allowed per comment")) } | full_identifier_or_typename { Aattribute_annot (loc (), $1) } ; contract_or_code_annotation: | contract { fun bhvs -> let s, pos = $1 in Acode_annot (pos, AStmtSpec (bhvs,s)) } | code_annotation { fun bhvs -> Acode_annot (loc(), ($1 bhvs)) } ; /*** loop annotations ***/ loop_annotations: | loop_annot_stack { let (i,fa,a,b,v,p, e) = $1 in let invs = List.map (fun i -> AInvariant([],true,i)) i in let ext = List.map (fun x -> AExtended([],true, x)) e in let oth = match a with | WritesAny -> b | Writes _ -> (* by definition all existing AAssigns are tied to at least one behavior. No need to merge against them. *) AAssigns ([],a)::b in let oth = match fa with | FreeAllocAny -> oth | _ -> AAllocation ([],fa)::oth in (invs@oth@ext,v,p) } ; /* TODO: gather loop assigns that are related to the same behavior */ loop_annot_stack: | loop_invariant loop_annot_opt { let (i,fa,a,b,v,p,e) = $2 in ($1::i,fa,a,b,v,p,e) } | loop_effects loop_annot_opt { let (i,fa,a,b,v,p,e) = $2 in (i,fa,concat_assigns a $1,b,v,p,e) } | loop_allocation loop_annot_opt { let (i,fa,a,b,v,p,e) = $2 in (i,concat_allocation fa $1,a,b,v,p,e) } | FOR ne_behavior_name_list COLON loop_annot_stack { let (i,fa,a,b,v,p,e) = $4 in let behav = $2 in let invs = List.map (fun i -> AInvariant(behav,true,i)) i in let ext = List.map (fun x -> AExtended(behav,true,x)) e in let oth = concat_loop_assigns_allocation b behav a fa in ([],FreeAllocAny,WritesAny,invs@ext@oth,v,p,[]) } | loop_variant loop_annot_opt { let pos,loop_variant = $1 in let (i,fa,a,b,v,p,e) = $2 in check_empty (pos,"loop invariant is not allowed after loop variant.") i ; check_empty (pos, "loop extension is not allowed after loop variant.") e; (match fa with | FreeAlloc(f,a) -> check_empty (pos,"loop frees is not allowed after loop variant.") f ; check_empty (pos,"loop allocates is not allowed after loop variant.") a | FreeAllocAny -> ()); (match a with WritesAny -> () | Writes _ -> raise (Not_well_formed (pos,"loop assigns is not allowed after loop variant."))); check_empty (pos,"loop behavior is not allowed after loop variant.") b ; check_empty (pos,"loop annotations can have at most one variant.") v ; (i,fa,a,b,AVariant loop_variant::v,p,e) } | loop_pragma loop_annot_opt { let (i,fa,a,b,v,p,e) = $2 in (i,fa,a,b,v,APragma (Loop_pragma $1)::p,e) } | loop_grammar_extension loop_annot_opt { let (i,fa,a,b,v,p,e) = $2 in (i,fa,a,b,v,p, $1::e) } ; loop_annot_opt: | /* epsilon */ { ([], FreeAllocAny, WritesAny, [], [], [], []) } | loop_annot_stack { $1 } ; loop_effects: | LOOP ASSIGNS full_assigns SEMICOLON { $3 } ; loop_allocation: | LOOP allocation SEMICOLON { $2 } ; loop_invariant: | LOOP INVARIANT full_lexpr SEMICOLON { $3 } ; loop_variant: | LOOP VARIANT variant SEMICOLON { loc(),$3 } ; /* Grammar Extensibility for plugins */ loop_grammar_extension: | LOOP EXT_CODE_ANNOT grammar_extension SEMICOLON { let open Cil_types in let ext = $2 in match Logic_env.extension_category ext with | Some (Ext_code_annot (Ext_next_loop | Ext_next_both)) -> (ext, $3) | Some (Ext_code_annot (Ext_here | Ext_next_stmt)) -> raise (Not_well_formed (lexeme_loc 2, ext ^ " is not a loop annotation extension")) | Some (Ext_contract | Ext_global) | None -> Kernel.fatal ~source:(lexeme_start 2) "%s is not a code annotation extension. Parser got wrong lexeme." ext } ; loop_pragma: | LOOP PRAGMA any_identifier full_ne_lexpr_list SEMICOLON { if $3 = "UNROLL_LOOP" || $3 = "UNROLL" then (if $3 <> "UNROLL" then Format.eprintf "Warning: use of deprecated keyword '%s'.\nShould use 'UNROLL' instead.@." $3; Unroll_specs $4) else if $3 = "WIDEN_VARIABLES" then Widen_variables $4 else if $3 = "WIDEN_HINTS" then Widen_hints $4 else raise (Not_well_formed (loc(),"Unknown loop pragma")) } ; /*** code annotations ***/ beg_pragma_or_code_annotation: | IMPACT {} | SLICE {} | FOR {} | ASSERT {} | CHECK {} | INVARIANT {} | EXT_CODE_ANNOT {} ; pragma_or_code_annotation: | slice_pragma { APragma (Slice_pragma $1) } | impact_pragma { APragma (Impact_pragma $1) } | code_annotation { $1 [] } ; code_annotation: | ASSERT full_lexpr SEMICOLON { fun bhvs -> AAssert (bhvs,Assert,$2) } | CHECK full_lexpr SEMICOLON { fun bhvs -> AAssert (bhvs,Check,$2) } | INVARIANT full_lexpr SEMICOLON { fun bhvs -> AInvariant (bhvs,false,$2) } | EXT_CODE_ANNOT grammar_extension SEMICOLON { fun bhvs -> let open Cil_types in let ext = $1 in match Logic_env.extension_category ext with | Some (Ext_code_annot (Ext_here | Ext_next_stmt | Ext_next_both)) -> Logic_ptree.AExtended(bhvs,false,(ext,$2)) | Some (Ext_code_annot Ext_next_loop) -> raise (Not_well_formed (lexeme_loc 1, ext ^ " is not a loop annotation extension. It can't be used as \ plain code annotation extension")) | Some (Ext_contract | Ext_global) | None -> Kernel.fatal ~source:(lexeme_start 1) "%s is not a code annotation extension. Parser got wrong lexeme" ext } ; slice_pragma: | SLICE PRAGMA any_identifier full_lexpr SEMICOLON { if $3 = "expr" then SPexpr $4 else raise (Not_well_formed (loc(), "Unknown slice pragma")) } | SLICE PRAGMA any_identifier SEMICOLON { if $3 = "ctrl" then SPctrl else if $3 = "stmt" then SPstmt else raise (Not_well_formed (loc(), "Unknown slice pragma")) } ; impact_pragma: | IMPACT PRAGMA any_identifier full_lexpr SEMICOLON { if $3 = "expr" then IPexpr $4 else raise (Not_well_formed (loc(), "Unknown impact pragma")) } | IMPACT PRAGMA any_identifier SEMICOLON { if $3 = "stmt" then IPstmt else raise (Not_well_formed (loc(), "Unknown impact pragma")) } ; /*** declarations and logical definitions ***/ decl_list: | decl { [loc_decl $1] } | decl decl_list { (loc_decl $1) :: $2 } decl: | GLOBAL INVARIANT any_identifier COLON full_lexpr SEMICOLON { LDinvariant ($3, $5) } | VOLATILE full_ne_zones volatile_opt SEMICOLON { LDvolatile ($2, $3) } | type_annot {LDtype_annot $1} | model_annot {LDmodel_annot $1} | logic_def { $1 } | EXT_GLOBAL grammar_extension SEMICOLON { LDextended ($1, $2) } | deprecated_logic_decl { $1 } ; volatile_opt: | /* empty */ { None, None } | READS any_identifier volatile_opt { let read,write=$3 in if read = None then (Some $2),write else (Format.eprintf "Warning: read %s ignored@." $2; $3) } | WRITES any_identifier volatile_opt { let read,write=$3 in if write = None then read,(Some $2) else (Format.eprintf "Warning: write %s ignored@." $2; $3) } ; type_annot: | TYPE INVARIANT any_identifier LPAR full_parameter RPAR EQUAL full_lexpr SEMICOLON { let typ,name = $5 in{ inv_name = $3; this_name = name; this_type = typ; inv = $8; } } ; opt_semicolon: | /* epsilon */ { } | SEMICOLON { } model_annot: | MODEL type_spec LBRACE full_parameter opt_semicolon RBRACE SEMICOLON { let typ,name = $4 in { model_for_type = $2; model_name = name; model_type = typ; } } ; poly_id_type: | full_identifier { enter_type_variables_scope []; ($1,[]) } | full_identifier LT ne_tvar_list GT { enter_type_variables_scope $3; ($1,$3) } ; /* we need to recognize the typename as soon as it has been declared, so that it can be used in data constructors in the type definition itself */ poly_id_type_add_typename: | poly_id_type { let (id,_) = $1 in Logic_env.add_typename id; $1 } ; poly_id: | poly_id_type { let (id,tvar) = $1 in (id,[],tvar) } | full_identifier LBRACE ne_label_list RBRACE { enter_type_variables_scope []; ($1,$3,[]) } | full_identifier LBRACE ne_label_list RBRACE LT ne_tvar_list GT { enter_type_variables_scope $6; $1,$3,$6 } ; opt_parameters: | /*epsilon*/ { [] } | parameters { $1 } ; parameters: | LPAR full_parameters RPAR { $2 } ; logic_def: /* logic function definition */ | LOGIC full_logic_rt_type poly_id opt_parameters EQUAL full_lexpr SEMICOLON { let (id, labels, tvars) = $3 in exit_type_variables_scope (); LDlogic_def (id, labels, tvars, $2, $4, $6) } /* predicate definition */ | PREDICATE poly_id opt_parameters EQUAL full_lexpr SEMICOLON { let (id,labels,tvars) = $2 in exit_type_variables_scope (); LDpredicate_def (id, labels, tvars, $3, $5) } /* inductive predicate definition */ | INDUCTIVE poly_id parameters LBRACE indcases RBRACE { let (id,labels,tvars) = $2 in exit_type_variables_scope (); LDinductive_def(id, labels, tvars, $3, $5) } | LEMMA poly_id COLON full_lexpr SEMICOLON { let (id,labels,tvars) = $2 in exit_type_variables_scope (); LDlemma (id, false, labels, tvars, $4) } | AXIOMATIC any_identifier LBRACE logic_decls RBRACE { LDaxiomatic($2,$4) } | TYPE poly_id_type_add_typename EQUAL typedef SEMICOLON { let (id,tvars) = $2 in exit_type_variables_scope (); LDtype(id,tvars,Some $4) } ; deprecated_logic_decl: /* OBSOLETE: logic function declaration */ | LOGIC full_logic_rt_type poly_id opt_parameters SEMICOLON { let (id, labels, tvars) = $3 in let source = fst (loc ()) in exit_type_variables_scope (); obsolete "logic declaration" ~source ~now:"an axiomatic block"; LDlogic_reads (id, labels, tvars, $2, $4, None) } /* OBSOLETE: predicate declaration */ | PREDICATE poly_id opt_parameters SEMICOLON { let (id,labels,tvars) = $2 in exit_type_variables_scope (); let source = fst (loc ()) in obsolete "logic declaration" ~source ~now:"an axiomatic block"; LDpredicate_reads (id, labels, tvars, $3, None) } /* OBSOLETE: type declaration */ | TYPE poly_id_type SEMICOLON { let (id,tvars) = $2 in Logic_env.add_typename id; exit_type_variables_scope (); let source = fst (loc ()) in obsolete "logic type declaration" ~source ~now:"an axiomatic block"; LDtype(id,tvars,None) } /* OBSOLETE: axiom */ | AXIOM poly_id COLON full_lexpr SEMICOLON { let (id,_,_) = $2 in raise (Not_well_formed (loc(),"Axiom " ^ id ^ " is declared outside of an axiomatic.")) } ; logic_decls: | /* epsilon */ { [] } | logic_decl_loc logic_decls { $1::$2 } ; logic_decl: | logic_def { $1 } /* logic function declaration */ | LOGIC full_logic_rt_type poly_id opt_parameters reads_clause SEMICOLON { let (id, labels, tvars) = $3 in exit_type_variables_scope (); LDlogic_reads (id, labels, tvars, $2, $4, $5) } /* predicate declaration */ | PREDICATE poly_id opt_parameters reads_clause SEMICOLON { let (id,labels,tvars) = $2 in exit_type_variables_scope (); LDpredicate_reads (id, labels, tvars, $3, $4) } /* type declaration */ | TYPE poly_id_type SEMICOLON { let (id,tvars) = $2 in Logic_env.add_typename id; exit_type_variables_scope (); LDtype(id,tvars,None) } /* axiom */ | AXIOM poly_id COLON full_lexpr SEMICOLON { let (id,labels,tvars) = $2 in exit_type_variables_scope (); LDlemma (id, true, labels, tvars, $4) } ; logic_decl_loc: | logic_decl { loc_decl $1 } ; reads_clause: | /* epsilon */ { None } | READS full_zones { Some $2 } ; typedef: | ne_datacons_list { TDsum $1 } | full_logic_type { TDsyn $1 } ; datacons_list: | /* epsilon */ { [] } | PIPE datacons datacons_list { $2 :: $3 } ; ne_datacons_list: | datacons datacons_list { $1 :: $2 } | PIPE datacons datacons_list { $2 :: $3 } ; datacons: | full_identifier { ($1,[]) } | full_identifier LPAR ne_type_list RPAR { ($1,$3) } ; ne_type_list: | full_logic_type { [$1] } | full_logic_type COMMA ne_type_list { $1::$3 } indcases: | /* epsilon */ { [] } | CASE poly_id COLON full_lexpr SEMICOLON indcases { let (id,labels,tvars) = $2 in exit_type_variables_scope (); (id,labels,tvars,$4)::$6 } ; ne_tvar_list: | full_identifier { [$1] } | full_identifier COMMA ne_tvar_list { $1 :: $3 } ; ne_label_list: | label_name { [$1] } | label_name COMMA ne_label_list { $1 :: $3 } ; opt_label_1: | opt_label_list { match $1 with | [] -> None | l::[] -> Some l | _ -> raise (Not_well_formed (loc(),"Only one label is allowed")) } ; opt_label_2: | opt_label_list { match $1 with | [] -> None | l1::l2::[] -> Some (l1,l2) | _::[] -> raise (Not_well_formed (loc(),"One label is missing")) | _ -> raise (Not_well_formed (loc(),"Only two labels are allowed")) } ; opt_label_list: | /* epsilon */ { [] } | LBRACE ne_label_list RBRACE { $2 } ; /* names */ label_name: | any_identifier { $1 } ; behavior_name_list: | /* epsilon */ { [] } | ne_behavior_name_list { $1 } ; ne_behavior_name_list: | behavior_name { [$1] } | behavior_name COMMA ne_behavior_name_list {$1 :: $3} ; behavior_name: | any_identifier { $1 } ; any_identifier: | identifier_or_typename { $1 } | keyword { $1 } ; any_identifier_non_logic: | identifier_or_typename { $1 } | non_logic_keyword { $1 } identifier_or_typename: /* allowed as C field names */ | TYPENAME { $1 } /* followed by the same list than 'identifier' */ | IDENTIFIER { $1 } /* token list used inside ascl clauses: */ | BEHAVIORS { "behaviors" } | LABEL { "label" } | READS { "reads" } | WRITES { "writes" } ; identifier: /* part included into 'identifier_or_typename', but duplicated to avoid parsing conflicts */ | IDENTIFIER { $1 } /* token list used inside ascl clauses: */ | BEHAVIORS { "behaviors" } | LABEL { "label" } | READS { "reads" } | WRITES { "writes" } ; bounded_var: | identifier { $1 } | TYPENAME /* Since TYPENAME cannot be accepted by lexpr rule */ { raise (Not_well_formed(loc (), "Type names are not allowed as binding variable")) } ; c_keyword: | CHAR { "char" } | BOOLEAN { "boolean" } | BOOL { "_Bool" } | CONST { "const" } | DOUBLE { "double" } | ENUM { "enum" } | ELSE { "else" } | FLOAT { "float" } | IF { "if" } | INT { "int" } | LONG { "long" } | SHORT { "short" } | SIGNED { "signed" } | SIZEOF { "sizeof" } | STATIC { "static" } | STRUCT { "struct" } | UNION { "union" } | UNSIGNED { "unsigned" } | VOID { "void" } ; acsl_c_keyword: | CASE { "case" } | FOR { "for" } | VOLATILE { "volatile" } ; post_cond: | ENSURES { Normal, "ensures" } | EXITS { Exits, "exits" } | BREAKS { Breaks, "breaks" } | CONTINUES { Continues, "continues" } | RETURNS { Returns, "returns" } ; is_acsl_spec: | post_cond { snd $1 } | EXT_CONTRACT { $1 } | ASSIGNS { "assigns" } | ALLOCATES { "allocates" } | FREES { "frees" } | BEHAVIOR { "behavior" } | REQUIRES { "requires" } | TERMINATES { "terminates" } | COMPLETE { "complete" } | DECREASES { "decreases" } | DISJOINT { "disjoint" } ; is_acsl_decl_or_code_annot: | EXT_CODE_ANNOT { $1 } | EXT_GLOBAL { $1 } | ASSUMES { "assumes" } | ASSERT { "assert" } | CHECK { "check" } | GLOBAL { "global" } | IMPACT { "impact" } | INDUCTIVE { "inductive" } | INVARIANT { "invariant" } | LEMMA { "lemma" } | LOOP { "loop" } | PRAGMA { "pragma" } | PREDICATE { "predicate" } | SLICE { "slice" } | TYPE { "type" } | MODEL { "model" } | AXIOM { "axiom" } | VARIANT { "variant" } | AXIOMATIC { "axiomatic" } ; is_acsl_other: | INTEGER { "integer" (* token that cannot be used in C fields *) } | REAL { "real" (* token that cannot be used in C fields *) } ; is_ext_spec: | CONTRACT { "contract" } | FUNCTION { "function" } | MODULE { "module" } | INCLUDE { "include" } | EXT_AT { "at" } | EXT_LET { "let" } ; keyword: | LOGIC { "logic" } | non_logic_keyword { $1 } ; non_logic_keyword: | c_keyword { $1 } | acsl_c_keyword { $1 } | is_ext_spec { $1 } | is_acsl_spec { $1 } | is_acsl_decl_or_code_annot { $1 } | is_acsl_other { $1 } | CUSTOM { "custom" (* token that cannot be used in C fields *) } ; bs_keyword: | ALLOCABLE { () } | ALLOCATION { () } | AUTOMATIC { () } | AT { () } | BASE_ADDR { () } | BLOCK_LENGTH { () } | DYNAMIC { () } | EMPTY { () } | FALSE { () } | FORALL { () } | FREEABLE { () } | FRESH { () } | FROM { () } | INTER { () } | LAMBDA { () } | LET { () } | NOTHING { () } | NULL { () } | OLD { () } | OFFSET { () } | REGISTER { () } | RESULT { () } | SEPARATED { () } | TRUE { () } | BSTYPE { () } | TYPEOF { () } | BSUNION { () } | UNALLOCATED { () } | VALID { () } | VALID_INDEX { () } | VALID_RANGE { () } | VALID_READ { () } | VALID_FUNCTION { () } | INITIALIZED { () } | DANGLING { () } | WITH { () } ; wildcard: | any_identifier { () } | bs_keyword { () } | AMP { () } | AND { () } | ARROW { () } | BIFF { () } | BIMPLIES { () } | COLON { () } | COLON2 { () } | COLONCOLON { () } | COMMA { () } | CONSTANT { () } | CONSTANT10 { () } | DOLLAR { () } | DOT { () } | DOTDOT { () } | DOTDOTDOT { () } | EQ { () } | EQUAL { () } | EXISTS { () } | GE { () } | GHOST { () } | GT { () } | GTGT { () } | HAT { () } | HATHAT { () } | IFF { () } | IMPLIES { () } | LBRACE { () } | LE { () } | LPAR { () } | LSQUARE { () } | LSQUAREPIPE { () } | LT { () } | LTLT { () } | MINUS { () } | NE { () } | NOT { () } | OR { () } | PERCENT { () } | PI { () } | PIPE { () } | PLUS { () } | QUESTION { () } | RBRACE { () } | RPAR { () } | RSQUARE { () } | RSQUAREPIPE { () } | SEMICOLON { () } | SLASH { () } | STAR { () } | STARHAT { () } | STRING_LITERAL { () } | TILDE { () } | IN { () } ; any: | wildcard { () } | wildcard any { () } ; %% (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_internals/parsing/logic_preprocess.mli0000666000000000000000000000454113571573400023055 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** adds another pre-processing step in order to expand macros in annotations. *) (** [file suffix cpp file] takes the file to preprocess, and the pre-processing directive, and returns the name of the file containing the completely pre-processed source. suffix will be appended to the name of intermediate files generated for pre-processing annotations (gcc pre-processing differs between .c and .cxx files) @raises Sys_error if the file cannot be opened. @modifies Oxygen-20120901: added suffix argument *) val file: string -> (string -> string -> string) -> string -> Datatype.Filepath.t frama-c-20.0-Calcium/src/kernel_internals/parsing/logic_preprocess.mll0000666000000000000000000004434513571573400023066 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) { open Lexing type end_of_buffer = NEWLINE | SPACE | CHAR let preprocess_buffer = Buffer.create 1024 let output_buffer = Buffer.create 1024 (* Standard prohibits the predefined macros to be subject of a #define (or #undef) directive. We thus have to filter the definition of these macros from gcc's output (gcc emits a warning otherwise). The list of predefined macros is taken from C11 standard, in the order in which they are defined in Section 6.10.8 *) let blacklisted_macros = [ (* 6.10.8.1 mandatory macros. *) "__DATE__"; "__FILE"; "__LINE__"; "__STDC__"; "__STDC_HOSTED__"; "__STDC_VERSION__"; "__TIME__"; (* 6.10.8.2 environment macros *) "__STDC_ISO_10646__"; "__STDC_MB_MIGHT_NEQ_WC__"; "__STDC_UTF_16__"; "__STDC_UTF_32__"; (* 6.10.8.3 conditional feature macros *) "__STDC_ANALYZABLE__"; "__STDC_IEC_559__"; "__STDC_IEC_559_COMPLEX__"; "__STDC_LIB_EXT1__"; "__STD_NO_ATOMICS__"; "__STD_NO_COMPLEX__"; "__STDC_NO_THREADS__"; "__STDC_NO_VLA__"; (* expanding assert, an ACSL keyword, is not a good idea. *) "assert"] let is_newline = ref CHAR let curr_file = ref "" let curr_line = ref 1 let has_annot = ref false let reset () = Buffer.clear preprocess_buffer; Buffer.clear output_buffer; is_newline := CHAR; curr_file := ""; curr_line := 1; has_annot := false let backslash = "__ANNOT_BACKSLASH__" let annot_content = "__ANNOT_CONTENT__" let re_backslash = Str.regexp_string backslash let re_annot_content = Str.regexp_string annot_content (* Delimiters for the various annotations in the preprocessing buffer. We have one delimiter for the beginning of an annotation (to discard #defines along the way), and three delimiters for the various ways an annotation can end: - on a normal line - with a newline - with a newline inside a comment (only for one-line annotations) When preprocessed annotations are inserted back in the main file, this will result in distinct translation to preserve line numbers while avoiding ill-formed annotations. *) let annot_beg = "////////////////__ANNOT_BEG__" let annot_end = "////////////////__ANNOT_END__" let annot_end_nl = "////////////////__ANNOT_END_NL__" let annot_end_comment = "////////////////__ANNOT_END_COMMENT__" let abort_preprocess reason = let source = {Cil_datatype.Position.unknown with Filepath.pos_path = Datatype.Filepath.of_string !curr_file; pos_lnum = !curr_line;} in Kernel.error ~source "Can't preprocess annotation: %s\nSome annotations will be kept as is" reason let next_preprocessed file = let content = Buffer.create 80 in let rec ignore_content () = let s = input_line file in if s <> annot_beg then ignore_content () in let rec get_annot first = let s = input_line file in if s = annot_end then false, Buffer.contents content else if s = annot_end_nl then true, Buffer.contents content else if s = annot_end_comment then begin Buffer.add_char content '\n'; false, Buffer.contents content end else begin if not first then Buffer.add_char content '\n'; Buffer.add_string content s; get_annot false end in let replace_backslash s = Str.global_replace re_backslash "\\\\" s in try ignore_content (); ignore (input_line file); (* ignore the #line directive *) let with_nl, content = get_annot true in with_nl, replace_backslash content with End_of_file -> Kernel.fatal "too few annotations in result file while pre-processing annotations" let output_result outfile preprocessed content = let rec aux = function | [] -> () | [s] -> output_string outfile s | content :: rem -> output_string outfile content; output_string outfile "/*@"; let with_nl, pp_content = next_preprocessed preprocessed in output_string outfile pp_content; output_string outfile "*/"; if with_nl then output_char outfile '\n'; aux rem in aux content let preprocess_annots suffix cpp outfile = if !has_annot then begin let debug = Kernel.debug_atleast 3 || Kernel.is_debug_key_enabled Kernel.dkey_parser in let ppname = try Extlib.temp_file_cleanup_at_exit ~debug "ppannot" suffix with Extlib.Temp_file_error s -> Kernel.abort "Could not open temporary file for logic pre-processing: %s" s in let ppfile = open_out ppname in Buffer.output_buffer ppfile preprocess_buffer; close_out ppfile; let cppname = Extlib.temp_file_cleanup_at_exit ~debug "cppannot" suffix in let res = Sys.command (cpp ppname cppname) in let result_file = if res <> 0 then begin abort_preprocess "Preprocessor call exited with an error"; if not debug then Extlib.safe_remove cppname; ppname end else cppname in let result = open_in result_file in let content = Str.split_delim re_annot_content (Buffer.contents output_buffer) in output_result outfile result content; close_in result end else begin Buffer.output_buffer outfile output_buffer end; flush outfile let add_preprocess_line_info () = Printf.bprintf preprocess_buffer "# %d %s \n" !curr_line !curr_file let make_newline () = incr curr_line let process_annot_start () = is_newline := CHAR; has_annot := true; Buffer.add_string output_buffer annot_content; Buffer.add_string preprocess_buffer annot_beg; Buffer.add_char preprocess_buffer '\n'; add_preprocess_line_info() } rule main = parse | ("#define"|"#undef") [' ''\t']* ((['a'-'z''A'-'Z''0'-'9''_'])* as m) { let blacklisted = List.mem m blacklisted_macros in if not blacklisted then Buffer.add_string preprocess_buffer (lexeme lexbuf); macro blacklisted lexbuf } | "#" [' ''\t']* "line"? [' ''\t']* (['0'-'9']+ as line) [' ''\t']* (('"' [^'"']+ '"') as file) [^'\n']* "\n" { (try curr_line := (int_of_string line) -1 with Failure _ -> curr_line:= -1); if file <> "" then curr_file := file; Buffer.add_string output_buffer (lexeme lexbuf); make_newline(); main lexbuf } | "/*@" ('{' | '}' as c) { (* Skip special doxygen comments. Use of '@' instead of !Clexer.annot_char is intentional *) Buffer.add_string output_buffer (lexeme lexbuf); comment c lexbuf;} | "/*" (_ as c) { if c = !Clexer.annot_char then begin process_annot_start (); annot lexbuf end else begin if c = '\n' then make_newline(); Buffer.add_string output_buffer (lexeme lexbuf); comment c lexbuf; end} | "//@" ('{' | '}') { (* See comments for "/*@{" above *) Buffer.add_string output_buffer (lexeme lexbuf); oneline_comment lexbuf; } | "//" (_ as c) { if c = !Clexer.annot_char then begin process_annot_start (); oneline_annot lexbuf end else if c = '\n' then begin make_newline (); Buffer.add_string output_buffer (lexeme lexbuf); main lexbuf end else begin Buffer.add_string output_buffer (lexeme lexbuf); oneline_comment lexbuf; end} | '\n' { make_newline (); Buffer.add_char output_buffer '\n'; main lexbuf } | eof { } | '"' { Buffer.add_char output_buffer '"'; c_string lexbuf } | "'" { Buffer.add_char output_buffer '\''; c_char lexbuf } | _ as c { Buffer.add_char output_buffer c; main lexbuf } and macro blacklisted = parse | "\\\n" { make_newline (); Buffer.add_char output_buffer '\n'; macro blacklisted lexbuf } (* we ignore comments in macro definition, as their expansion in ACSL annotations would lead to ill-formed ACSL. *) | "/*" { macro_comment blacklisted lexbuf } | '"' { if not blacklisted then Buffer.add_char preprocess_buffer '"'; macro_string blacklisted lexbuf } | "'" { if not blacklisted then Buffer.add_char preprocess_buffer '\''; macro_char blacklisted lexbuf } | "\n" { if not blacklisted then Buffer.add_char preprocess_buffer '\n'; make_newline (); Buffer.add_char output_buffer '\n'; main lexbuf } | _ as c { if not blacklisted then Buffer.add_char preprocess_buffer c; macro blacklisted lexbuf } and macro_comment blacklisted = parse | '\n' { make_newline (); macro_comment blacklisted lexbuf } | "*/" { macro blacklisted lexbuf } | _ { macro_comment blacklisted lexbuf } and macro_string blacklisted = parse | "\\\"" as s { if not blacklisted then Buffer.add_string preprocess_buffer s; macro_string blacklisted lexbuf } | "\\\n" { make_newline(); Buffer.add_char output_buffer '\n'; macro_string blacklisted lexbuf } | "\\\\" as s { if not blacklisted then Buffer.add_string preprocess_buffer s; macro_string blacklisted lexbuf } | "\n" { abort_preprocess "unterminated string in macro definition" } | eof { abort_preprocess "unterminated string in macro definition" } | '"' { if not blacklisted then Buffer.add_char preprocess_buffer '"'; macro blacklisted lexbuf } | _ as c { if not blacklisted then Buffer.add_char preprocess_buffer c; macro_string blacklisted lexbuf } and macro_char blacklisted = parse | "\\'" as s { if not blacklisted then Buffer.add_string preprocess_buffer s; macro_char blacklisted lexbuf } | "\\\n" { make_newline(); Buffer.add_char output_buffer '\n'; macro_char blacklisted lexbuf } | "\\\\" as s { if not blacklisted then Buffer.add_string preprocess_buffer s; macro_char blacklisted lexbuf } | "\n" { abort_preprocess "unterminated char in macro definition" } | eof { abort_preprocess "unterminated char in macro definition" } | "'" { if not blacklisted then Buffer.add_char preprocess_buffer '\''; macro blacklisted lexbuf } | _ as c { if not blacklisted then Buffer.add_char preprocess_buffer c; macro_char blacklisted lexbuf } and c_string = parse | eof { abort_preprocess "unterminated string" } | "\\\"" { Buffer.add_string output_buffer (lexeme lexbuf); c_string lexbuf } | "\"" { Buffer.add_char output_buffer '"'; main lexbuf } | '\n' { make_newline (); Buffer.add_char output_buffer '\n'; c_string lexbuf } | "\\\\" { Buffer.add_string output_buffer (lexeme lexbuf); c_string lexbuf } | _ as c { Buffer.add_char output_buffer c; c_string lexbuf } (* C syntax allows for multiple char character constants *) and c_char = parse | eof { abort_preprocess "unterminated char" } | "\\\'" { Buffer.add_string output_buffer (lexeme lexbuf); c_char lexbuf } | "'" { Buffer.add_char output_buffer '\''; main lexbuf } | '\n' { make_newline (); Buffer.add_char output_buffer '\n'; c_char lexbuf } | "\\\\" { Buffer.add_string output_buffer (lexeme lexbuf); c_char lexbuf } | _ as c { Buffer.add_char output_buffer c; c_char lexbuf } and annot = parse "*/" { if !is_newline = NEWLINE then Buffer.add_string preprocess_buffer annot_end_nl else begin Buffer.add_char preprocess_buffer '\n'; Buffer.add_string preprocess_buffer annot_end; end; Buffer.add_char preprocess_buffer '\n'; main lexbuf } | '\n' { is_newline := NEWLINE; incr curr_line; Buffer.add_char preprocess_buffer '\n'; annot lexbuf } | "//" { Buffer.add_string preprocess_buffer "//"; annot_comment lexbuf } | '@' { if !is_newline = NEWLINE then is_newline:=SPACE; Buffer.add_char preprocess_buffer '@'; annot lexbuf } | ' ' { if !is_newline = NEWLINE then is_newline:=SPACE; Buffer.add_char preprocess_buffer ' '; annot lexbuf } (* We're not respecting char count here. Maybe using '$' would do it, as cpp is likely to count it as part of an identifier, but this would imply that we can not speak about $ ident in annotations. *) | '\\' { is_newline := CHAR; Buffer.add_string preprocess_buffer backslash; annot lexbuf } | '\'' { is_newline := CHAR; Buffer.add_char preprocess_buffer '\''; char annot lexbuf } | '"' { is_newline:=CHAR; Buffer.add_char preprocess_buffer '"'; string annot lexbuf } | _ as c { is_newline := CHAR; Buffer.add_char preprocess_buffer c; annot lexbuf } and annot_comment = parse | '\n' { incr curr_line; is_newline:=NEWLINE; Buffer.add_char preprocess_buffer '\n'; annot lexbuf } | "*/" { Buffer.add_char preprocess_buffer '\n'; Buffer.add_string preprocess_buffer annot_end; Buffer.add_char preprocess_buffer '\n'; main lexbuf } | eof { abort_preprocess "eof in the middle of a comment" } | _ as c { Buffer.add_char preprocess_buffer c; annot_comment lexbuf } and char annot = parse | '\n' { incr curr_line; is_newline:=NEWLINE; Buffer.add_char preprocess_buffer '\n'; char annot lexbuf } | '\'' { is_newline:=CHAR; Buffer.add_char preprocess_buffer '\''; annot lexbuf } | "\\'" { is_newline:=CHAR; Buffer.add_string preprocess_buffer "\\'"; char annot lexbuf } | "\\\\" { is_newline:=CHAR; Buffer.add_string preprocess_buffer "\\\\"; char annot lexbuf } | eof { abort_preprocess "eof while parsing a char literal" } | _ as c { is_newline:=CHAR; Buffer.add_char preprocess_buffer c; char annot lexbuf } and string annot = parse | '\n' { incr curr_line; is_newline:=NEWLINE; Buffer.add_char preprocess_buffer '\n'; string annot lexbuf } | '"' { is_newline:=CHAR; Buffer.add_char preprocess_buffer '"'; annot lexbuf } | "\\\"" { is_newline:=CHAR; Buffer.add_string preprocess_buffer "\\\""; string annot lexbuf } | "\\\\" { is_newline:=CHAR; Buffer.add_string preprocess_buffer "\\\\"; string annot lexbuf } | eof { abort_preprocess "eof while parsing a string literal" } | _ as c { is_newline:=CHAR; Buffer.add_char preprocess_buffer c; string annot lexbuf } and comment c = parse "/" { Buffer.add_char output_buffer '/'; if c = '*' then main lexbuf else comment '/' lexbuf } | '\n' { make_newline (); Buffer.add_char output_buffer '\n'; comment '\n' lexbuf } | eof { abort_preprocess "eof while parsing C comment" } | _ as c { Buffer.add_char output_buffer c; comment c lexbuf } and oneline_annot = parse "\n"|eof { incr curr_line; Buffer.add_char preprocess_buffer '\n'; Buffer.add_string preprocess_buffer annot_end_nl; Buffer.add_char preprocess_buffer '\n'; main lexbuf } | '\\' { Buffer.add_string preprocess_buffer backslash; oneline_annot lexbuf } | '\'' { Buffer.add_char preprocess_buffer '\''; char oneline_annot lexbuf } | '"' { Buffer.add_char preprocess_buffer '"'; string oneline_annot lexbuf } | "//" { Buffer.add_string preprocess_buffer "//"; oneline_annot_comment lexbuf } | _ as c { Buffer.add_char preprocess_buffer c; oneline_annot lexbuf } and oneline_annot_comment = parse "\n"|eof { incr curr_line; Buffer.add_char preprocess_buffer '\n'; Buffer.add_string preprocess_buffer annot_end_comment; Buffer.add_char preprocess_buffer '\n'; main lexbuf } | _ as c { Buffer.add_char preprocess_buffer c; oneline_annot_comment lexbuf } and oneline_comment = parse "\n"|eof { make_newline(); Buffer.add_string output_buffer (lexeme lexbuf); main lexbuf} | _ as c { Buffer.add_char output_buffer c; oneline_comment lexbuf} { let file suffix cpp filename = reset (); let debug = Kernel.is_debug_key_enabled Kernel.dkey_parser in let inchan = open_in_bin filename in let lex = Lexing.from_channel inchan in let ppname = Extlib.temp_file_cleanup_at_exit ~debug (Filename.basename filename) ".pp" in let ppfile = open_out ppname in main lex; preprocess_annots suffix cpp ppfile; close_in inchan; close_out ppfile; Datatype.Filepath.of_string ppname } (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_internals/runtime/0000777000000000000000000000000013571573400017024 5ustar frama-c-20.0-Calcium/src/kernel_internals/runtime/boot.ml0000666000000000000000000000714113571573400020324 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Frama-C Entry Point (last linked module). @plugin development guide *) let play_analysis () = if Kernel.TypeCheck.get () then begin if Kernel.Files.get () <> [] || Kernel.TypeCheck.is_set () then begin Ast.compute (); (* Printing files before anything else (in debug mode only) *) if Kernel.debug_atleast 1 && Kernel.is_debug_key_enabled Kernel.dkey_ast then File.pretty_ast () end end; try Db.Main.apply (); Log.treat_deferred_error (); (* Printing code if required, have to be done at end *) if Kernel.PrintCode.get () then File.pretty_ast (); (* Easier to handle option -set-project-as-default at the last moment: no need to worry about nested [Project.on] *) Project.set_keep_current (Kernel.Set_project_as_default.get ()); (* unset Kernel.Set_project_as_default, but only if it set. This avoids disturbing the "set by user" flag. *) if Kernel.Set_project_as_default.get () then Kernel.Set_project_as_default.off () with Globals.No_such_entry_point msg -> Kernel.abort "%s" msg let on_from_name name f = try Project.on (Project.from_unique_name name) f () with Project.Unknown_project -> Kernel.abort "no project `%s'." name let () = Db.Main.play := play_analysis (* ************************************************************************* *) (** Booting Frama-C *) (* ************************************************************************* *) (* Main: let's go! *) let () = Cil_printer.state.Printer_api.print_cil_as_is <- Kernel.debug_atleast 1; Sys.catch_break true; let f () = ignore (Project.create "default"); let on_from_name = { Cmdline.on_from_name } in Cmdline.parse_and_boot ~on_from_name ~get_toplevel:(fun () -> !Db.Toplevel.run) ~play_analysis in Cmdline.catch_toplevel_run ~f ~at_normal_exit:Cmdline.run_normal_exit_hook ~on_error:Cmdline.run_error_exit_hook; (* Implicit exit 0 if we haven't exited yet *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_internals/runtime/config.ml.in0000666000000000000000000000747613571573400021246 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) # 24 "src/kernel_internals/runtime/config.ml.in" let version = "@VERSION@" let codename = "@VERSION_CODENAME@" let version_and_codename = version ^ " (" ^ codename ^ ")" let major_version = @MAJOR_VERSION@ let minor_version = @MINOR_VERSION@ let is_gui = ref false let ocamlc = "@OCAMLC@" let ocamlopt = "@OCAMLOPT@" let ocaml_wflags = "@WARNINGS@" let getenv_list name = let path = Sys.getenv name in Str.split (Str.regexp ":") path let add_symbolic_dir_list name = function | [d] -> Filepath.add_symbolic_dir name d | ds -> List.iteri (fun i d -> let path = Printf.sprintf "%s#%d" name (succ i) in Filepath.add_symbolic_dir path d) ds let datadir = try Sys.getenv "FRAMAC_SHARE" with Not_found -> "@FRAMAC_DATADIR@" let framac_libc = datadir ^ "/libc" let extra_datadir = try getenv_list "FRAMAC_EXTRA_SHARE" with Not_found -> [] let () = add_symbolic_dir_list "FRAMAC_EXTRA_SHARE" extra_datadir (** After so that it has the priority for pretty printing *) let () = Filepath.add_symbolic_dir "FRAMAC_SHARE" datadir let datadirs = datadir::extra_datadir let libdir = try Sys.getenv "FRAMAC_LIB" with Not_found -> "@FRAMAC_LIBDIR@" let () = Filepath.add_symbolic_dir "FRAMAC_LIB" libdir let plugin_dir = try getenv_list "FRAMAC_PLUGIN" with Not_found -> try [ Sys.getenv "FRAMAC_LIB" ^ "/plugins" ] with Not_found -> [ "@FRAMAC_PLUGINDIR@" ] let plugin_path = String.concat ":" plugin_dir let () = add_symbolic_dir_list "FRAMAC_PLUGIN" plugin_dir let default_cpp = "@FRAMAC_DEFAULT_CPP@" let default_cpp_args = " @FRAMAC_DEFAULT_CPP_ARGS@" let env_or_default f vdefault = try let env = Sys.getenv "CPP" ^ default_cpp_args in if env=default_cpp then vdefault else f env with Not_found -> vdefault let preprocessor = env_or_default (fun x -> x) default_cpp let using_default_cpp = env_or_default (fun _ -> false) true let preprocessor_is_gnu_like = env_or_default (fun _ -> false) @FRAMAC_GNU_CPP@ let preprocessor_supported_arch_options = [@DEFAULT_CPP_SUPPORTED_ARCH_OPTS@] let preprocessor_keep_comments = env_or_default (fun _ -> true) @DEFAULT_CPP_KEEP_COMMENTS@ let compilation_unit_names = [@COMPILATION_UNITS@] let library_names = [@LIBRARY_NAMES@] let dot = @OPTDOT@ frama-c-20.0-Calcium/src/kernel_internals/runtime/config.mli0000666000000000000000000001150313571573400020774 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Information about version of Frama-C. The body of this module is generated from Makefile. *) val version: string (** Frama-C Version identifier. *) val codename: string (** Frama-C version codename. @since 18.0-Argon *) val version_and_codename: string (** Frama-C version and codename. @since 18.0-Argon *) val major_version: int (** Frama-C major version number. @since 19.0-Potassium *) val minor_version: int (** Frama-C minor version number. @since 19.0-Potassium *) val is_gui: bool ref (** Is the Frama-C GUI running? @since Beryllium-20090601-beta1 *) val ocamlc: string (** Name of the bytecode compiler. @since Boron-20100401 *) val ocamlopt: string (** Name of the native compiler. @since Boron-20100401 *) val ocaml_wflags: string (** Warning flags used when compiling Frama-C. @since Chlorine-20180501 *) val datadir: string (** Directory where architecture independent files are. Main directory, use {!datadirs} for the others *) val datadirs: string list (** Directories where architecture independent files are in order of priority. @since 19.0-Potassium *) val framac_libc: string (** Directory where Frama-C libc headers are. @since 19.0-Potassium *) val libdir: string (** Directory where the Frama-C kernel library is. @since Beryllium-20090601-beta1 *) val plugin_dir: string list (** Directory where the Frama-C dynamic plug-ins are. @modify Magnesium-20151001 *) val plugin_path: string (** The coma-separated concatenation of [plugin_dir]. @since Magnesium-20151001 *) val compilation_unit_names: string list (** List of names of all kernel compilation units. @since Boron-20100401 *) val library_names: string list (** List of linked libraries. @since Magnesium-20151001 *) val preprocessor: string (** Name of the default command to call the preprocessor. If the CPP environment variable is set, use it else use the built-in default from autoconf. Usually this is "gcc -C -E -I." @since Oxygen-20120901 *) val using_default_cpp: bool (** whether the preprocessor command is the one defined at configure time or the result of taking a CPP environment variable, in case it differs from the configure-time command. @since Phosphorus-20170501-beta1 *) val preprocessor_is_gnu_like: bool (** whether the default preprocessor accepts the same options as gcc (i.e. is either gcc or clang), when this is the case, the default command line for pre-processing contains more options. @since Sodium-20150201 *) val preprocessor_supported_arch_options: string list (** architecture-related options (e.g. -m32) known to be supported by the default preprocessor. Used to match preprocessor commands to selected machdeps. @since Phosphorus-20170501-beta1 *) val preprocessor_keep_comments: bool (** [true] if the default preprocessor selected during compilation is able to keep comments (hence ACSL annotations) in its output. @since Neon-rc3 *) val dot: string option (** Dot command name. @return [None] if `dot' is not installed. @since Carbon-20101201 *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_internals/runtime/frama_c_config.ml.in0000666000000000000000000000553613571573400022711 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) # 24 "src/kernel_internals/runtime/frama_c_config.ml.in" (** This file is *not* linked in Frama-C. Instead, is it is concatenated to Config, to create a standalone executable *) let version _ = Format.printf "Frama-C %s (%s)@\n\ Environment:@\n \ FRAMAC_SHARE = %S@\n \ FRAMAC_LIB = %S@\n \ FRAMAC_PLUGIN = %S@." Config.version Config.codename Config.datadir Config.libdir Config.plugin_path ; exit 0 let options = Arg.([ "-print-share-path", Unit (fun _ -> Format.printf "%s%!" Config.datadir; exit 0), " Print the path of Frama-C share directory"; "-print-libpath", Unit (fun _ -> Format.printf "%s%!" Config.libdir; exit 0), " Print the path of Frama-C kernel library"; "-print-plugin-path", Unit (fun _ -> Format.printf "%s%!" Config.plugin_path; exit 0), " Print the path where Frama-C dynamic plug-ins are searched for"; "-print-version", Unit (fun _ -> Format.printf "%s%!" Config.version; exit 0), " Print the version number of Frama-C"; "-version", Unit version, " Display full version and configuration information" ]) let usage = "\ Usage: frama-c-config :] *) val pretty_line: t Pretty_utils.formatter (** Prints only the line of the location *) val of_lexing_loc : Lexing.position * Lexing.position -> t val to_lexing_loc : t -> Lexing.position * Lexing.position end module Localisation: Datatype.S with type t = localisation module Syntactic_scope: Datatype.S_with_collections with type t = syntactic_scope (**************************************************************************) (** {3 Cabs types} *) (**************************************************************************) module Cabs_file: S_with_pretty with type t = Cabs.file (**************************************************************************) (** {3 C types} Sorted by alphabetic order. *) (**************************************************************************) module Block: S_with_pretty with type t = block (* Blocks cannot compared or hashed, so collections are not available *) module Compinfo: S_with_collections_pretty with type t = compinfo module Enuminfo: S_with_collections_pretty with type t = enuminfo module Enumitem: S_with_collections_pretty with type t = enumitem (** @since Fluorine-20130401 *) module Wide_string: S_with_collections with type t = int64 list (** @since Oxygen-20120901 *) module Constant: S_with_collections_pretty with type t = constant (** Note that the equality is based on eid. For structural equality, use {!ExpStructEq} *) module Exp: sig include S_with_collections_pretty with type t = exp val dummy: exp (** @since Nitrogen-20111001 *) end module ExpStructEq: S_with_collections with type t = exp module Fieldinfo: S_with_collections_pretty with type t = fieldinfo module File: S with type t = file module Global: sig include S_with_collections_pretty with type t = global val loc: t -> location val attr: t -> attributes (** @since Phosphorus-20170501-beta1 *) end module Initinfo: S_with_pretty with type t = initinfo module Instr: sig include S_with_pretty with type t = instr val loc: t -> location end module Kinstr: sig include S_with_collections with type t = kinstr val kinstr_of_opt_stmt: stmt option -> kinstr (** @since Nitrogen-20111001. *) val loc: t -> location end module Label: S_with_collections_pretty with type t = label (** Note that the equality is based on eid (for sub-expressions). For structural equality, use {!LvalStructEq} *) module Lval: S_with_collections_pretty with type t = lval (** @since Oxygen-20120901 *) module LvalStructEq: S_with_collections with type t = lval (** Same remark as for Lval. For structural equality, use {!OffsetStructEq}. *) module Offset: S_with_collections_pretty with type t = offset (** @since Oxygen-20120901 *) module OffsetStructEq: S_with_collections with type t = offset module Stmt_Id: Hptmap.Id_Datatype with type t = stmt module Stmt: sig include S_with_collections_pretty with type t = stmt module Hptset: sig include Hptset.S with type elt = stmt and type 'a shape = 'a Hptmap.Shape(Stmt_Id).t val self: State.t end val loc: t -> location val pretty_sid: Format.formatter -> t -> unit (** Pretty print the sid of the statement @since Nitrogen-20111001 *) end module Attribute: S_with_collections_pretty with type t = attribute module Attributes: S_with_collections with type t = attributes (** Types, with comparison over struct done by key and unrolling of typedefs. *) module Typ: sig include S_with_collections_pretty with type t = typ val toplevel_attr: t -> attributes (** returns the attributes associated to the toplevel type, without adding attributes from compinfo, enuminfo or typeinfo. Use {!Cil.typeAttrs} to retrieve the complete set of attributes. *) end (** Types, with comparison over struct done by name and no unrolling. *) module TypByName: S_with_collections_pretty with type t = typ (** Types, with comparison over struct done by key and no unrolling @since Fluorine-20130401 *) module TypNoUnroll: S_with_collections_pretty with type t = typ module Typeinfo: S_with_collections with type t = typeinfo module Varinfo_Id: Hptmap.Id_Datatype (** @plugin development guide *) module Varinfo: sig include S_with_collections_pretty with type t = varinfo module Hptset: sig include Hptset.S with type elt = varinfo and type 'a shape = 'a Hptmap.Shape(Varinfo_Id).t val self: State.t end val dummy: t (**/**) val internal_pretty_code_ref: (Type.precedence -> Format.formatter -> t -> unit) ref end module Kf: sig include Datatype.S_with_collections with type t = kernel_function val vi: t -> varinfo val id: t -> int (**/**) val set_formal_decls: (varinfo -> varinfo list -> unit) ref (**/**) end (**************************************************************************) (** {3 ACSL types} Sorted by alphabetic order. *) (**************************************************************************) module Builtin_logic_info: S_with_collections_pretty with type t = builtin_logic_info module Code_annotation: sig include S_with_collections_pretty with type t = code_annotation val loc: t -> location option end module Funbehavior: S with type t = funbehavior module Funspec: S_with_pretty with type t = funspec (** @since Fluorine-20130401 *) module Fundec: S_with_collections_pretty with type t = fundec module Global_annotation: sig include S_with_collections_pretty with type t = global_annotation val loc: t -> location val attr: t -> attributes (** attributes tied to the global annotation. @since Phosphorus-20170501-beta1 *) end module Identified_term: S_with_collections_pretty with type t = identified_term module Logic_ctor_info: S_with_collections_pretty with type t = logic_ctor_info module Logic_info: S_with_collections_pretty with type t = logic_info (** Logic_info with structural comparison: - name of the symbol - type of arguments Note that polymorphism is ignored, in the sense that two symbols with the same name and profile except for the name of their type variables will compare unequal. @since 20.0-Calcium *) module Logic_info_structural: S_with_collections_pretty with type t = logic_info module Logic_constant: S_with_collections_pretty with type t = logic_constant module Logic_label: S_with_collections_pretty with type t = logic_label (** Logic_type. See the various [Typ*] modules for the distinction between those modules *) module Logic_type: S_with_collections_pretty with type t = logic_type module Logic_type_ByName: S_with_collections_pretty with type t = logic_type module Logic_type_NoUnroll: S_with_collections_pretty with type t = logic_type module Logic_type_info: S_with_collections_pretty with type t = logic_type_info module Logic_var: S_with_collections_pretty with type t = logic_var (** @since Oxygen-20120901 *) module Model_info: S_with_collections_pretty with type t = model_info module Term: S_with_collections_pretty with type t = term module Term_lhost: S_with_collections_pretty with type t = term_lhost module Term_offset: S_with_collections_pretty with type t = term_offset module Term_lval: S_with_collections_pretty with type t = term_lval module Logic_real: S_with_collections_pretty with type t = logic_real module Predicate: S_with_pretty with type t = predicate module Identified_predicate: S_with_collections_pretty with type t = identified_predicate (** @since Neon-20140301 *) (**************************************************************************) (** {3 Logic_ptree} Sorted by alphabetic order. *) (**************************************************************************) module Lexpr: S with type t = Logic_ptree.lexpr (** Beware: no pretty-printer is available. *) (**/**) (* ****************************************************************************) (** {2 Internal API} *) (* ****************************************************************************) (* Forward declarations from Cil *) val drop_non_logic_attributes : (attributes -> attributes) ref val constfoldtoint : (exp -> Integer.t option) ref val punrollType: (typ -> typ) ref val clear_caches: unit -> unit (**/**) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/cil_state_builder.ml0000666000000000000000000000413413571573400023522 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open State_builder open Cil_datatype module Stmt_set_ref = Set_ref(Stmt.Set) module Kinstr_hashtbl = Hashtbl(Kinstr.Hashtbl) module Stmt_hashtbl = Hashtbl(Stmt.Hashtbl) module Varinfo_hashtbl = Hashtbl(Varinfo.Hashtbl) module Exp_hashtbl = Hashtbl(Exp.Hashtbl) module Kernel_function_hashtbl = Hashtbl(Kf.Hashtbl) module Lval_hashtbl = Hashtbl(Lval.Hashtbl) (* module Code_annotation_hashtbl = State_builder.Hashtbl(Cil_datatype.Code_Annotation) *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/cil_state_builder.mli0000666000000000000000000000612213571573400023672 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Functors for building computations which use kernel datatypes. @plugin development guide *) module Stmt_set_ref(Info: State_builder.Info) : State_builder.Set_ref with type elt = Cil_types.stmt module Kinstr_hashtbl(Data:Datatype.S)(Info: State_builder.Info_with_size) : State_builder.Hashtbl with type key = Cil_types.kinstr and type data = Data.t (** @plugin development guide *) module Stmt_hashtbl(Data:Datatype.S)(Info: State_builder.Info_with_size) : State_builder.Hashtbl with type key = Cil_types.stmt and type data = Data.t module Varinfo_hashtbl(Data:Datatype.S)(Info: State_builder.Info_with_size) : State_builder.Hashtbl with type key = Cil_types.varinfo and type data = Data.t module Exp_hashtbl(Data:Datatype.S)(Info: State_builder.Info_with_size) : State_builder.Hashtbl with type key = Cil_types.exp and type data = Data.t module Lval_hashtbl(Data:Datatype.S)(Info: State_builder.Info_with_size) : State_builder.Hashtbl with type key = Cil_types.lval and type data = Data.t module Kernel_function_hashtbl (Data:Datatype.S)(Info: State_builder.Info_with_size): State_builder.Hashtbl with type key = Cil_types.kernel_function and type data = Data.t (* module Code_annotation_hashtbl (Data:Project.Datatype.S)(Info:State_builder.Info_with_size) : State_builder.Hashtbl with type key = Cil_types.code_annotation and type data = Data.t *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/file.ml0000666000000000000000000017136313571573400020775 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil open Visitor open Cil_datatype type cpp_opt_kind = Gnu | Not_gnu | Unknown let pretty_cpp_opt_kind fmt = function | Gnu -> Format.pp_print_string fmt "Gnu" | Not_gnu -> Format.pp_print_string fmt "Not_gnu" | Unknown -> Format.pp_print_string fmt "Unknown" type file = | NeedCPP of string (* filename of the [.c] to preprocess *) * string (* Preprocessor command. [filename.c -o tempfilname.i] will be appended at the end.*) * cpp_opt_kind | NoCPP of string (** filename of a preprocessed [.c] *) | External of string * string (* file * name of plug-in that handles it *) module D = Datatype.Make (struct include Datatype.Serializable_undefined type t = file let name = "File" let reprs = [ NeedCPP("", "", Unknown); NoCPP ""; External("", "") ] let structural_descr = Structural_descr.t_abstract let mem_project = Datatype.never_any_project let copy = Datatype.identity (* immutable strings *) let internal_pretty_code p_caller fmt t = let pp fmt = match t with | NoCPP s -> Format.fprintf fmt "@[File.NoCPP %S@]" (s :> string) | External (f,p) -> Format.fprintf fmt "@[File.External (%S,%S)@]" (f :> string) p | NeedCPP (a,b,c) -> Format.fprintf fmt "@[File.NeedCPP (%S,%S,%a)@]" (a :> string) b pretty_cpp_opt_kind c in Type.par p_caller Type.Call fmt pp end) include D let check_suffixes = Hashtbl.create 17 let new_file_type = Hashtbl.add check_suffixes let get_suffixes () = Hashtbl.fold (fun s _ acc -> s :: acc) check_suffixes [ ".c"; ".i"; ".h" ] let get_name = function NeedCPP (s,_,_) | NoCPP s | External (s,_) -> s (* ************************************************************************* *) (** {2 Preprocessor command} *) (* ************************************************************************* *) (* Do not trust custom command-line to be gnu like by default, but give them a chance, with a warning indicating that things may go wrong. *) let cpp_opt_kind () = if Kernel.CppGnuLike.is_set () then if Kernel.CppGnuLike.get () then Gnu else Not_gnu else Unknown (* the preprocessor command is: If the program has an explicit argument -cpp-command "XX -Y" (quotes are required by the shell) then XX -Y else use the command in [Config.preprocessor].*) let get_preprocessor_command () = let cmdline = Kernel.CppCommand.get() in if cmdline <> "" then begin (cmdline, cpp_opt_kind ()) end else begin let gnu = if Config.using_default_cpp then if Config.preprocessor_is_gnu_like then Gnu else Not_gnu else cpp_opt_kind () in Config.preprocessor, gnu end let from_filename ?cpp f = let path = Datatype.Filepath.of_string f in let cpp, is_gnu_like = let cmdline = Kernel.CppCommand.get() in if cmdline <> "" then cmdline, cpp_opt_kind () else let flags = Json_compilation_database.get_flags path in let cpp, gnu = match cpp with | None -> get_preprocessor_command () | Some cpp -> cpp, cpp_opt_kind () in (if flags = [] then cpp else cpp ^ " " ^ String.concat " " flags), gnu in if Filename.check_suffix f ".i" then begin NoCPP f end else let suf = try let suf_idx = String.rindex f '.' in String.sub f suf_idx (String.length f - suf_idx) with Not_found -> (* raised by String.rindex if '.' \notin f *) "" in if Hashtbl.mem check_suffixes suf then External (f, suf) else if cpp <> "" then begin if not Config.preprocessor_keep_comments then Kernel.warning ~once:true "Default pre-processor does not keep comments. Any ACSL annotation \ on non-pre-processed file will be discarded."; NeedCPP (f, cpp, is_gnu_like) end else Kernel.abort "No working pre-processor found. You can only analyze \ pre-processed .i files." (* ************************************************************************* *) (** {2 Internal states} *) (* ************************************************************************* *) module Files : sig val get: unit -> t list val register: t list -> unit val pre_register: t -> unit val is_computed: unit -> bool val reset: unit -> unit val pre_register_state: State.t end = struct module S = State_builder.List_ref (D) (struct let dependencies = [ Kernel.CppCommand.self; Kernel.CppExtraArgs.self; Kernel.JsonCompilationDatabase.self; Kernel.Files.self ] let name = "Files for preprocessing" end) module Pre_files = State_builder.List_ref (D) (struct let dependencies = [] let name = "Built-ins headers and source" end) let () = State_dependency_graph.add_dependencies ~from:S.self [ Ast.self; Ast.UntypedFiles.self; Cabshelper.Comments.self ] let () = State_dependency_graph.add_dependencies ~from:Pre_files.self [ Ast.self; Ast.UntypedFiles.self; Cabshelper.Comments.self; Cil.Frama_c_builtins.self ] let () = Ast.add_linked_state Cabshelper.Comments.self let pre_register_state = Pre_files.self (* Allow to register files in advance, e.g. prolog files for plugins *) let pre_register file = let prev_files = Pre_files.get () in Pre_files.set (prev_files @ [file]) let register files = if S.is_computed () then raise (Ast.Bad_Initialization "[File.register] Too many initializations"); let prev_files = S.get () in S.set (prev_files @ files); S.mark_as_computed () let get () = Pre_files.get () @ S.get () let is_computed () = S.is_computed () let reset () = let selection = State_selection.with_dependencies S.self in (* Keep built-in files set *) Project.clear ~selection () end let get_all = Files.get let pre_register = Files.pre_register (* ************************************************************************* *) (** {2 Machdep} *) (* ************************************************************************* *) (* not exported, see [pretty_machdep] below. *) let print_machdep fmt (m : Cil_types.mach) = begin let open Cil_types in Format.fprintf fmt "Machine: %s@\n" m.version ; let pp_size_error fmt v = if v < 0 then Format.pp_print_string fmt "error" else Format.fprintf fmt "%2d" v in let pp_size_bits fmt v = if v >= 0 then Format.fprintf fmt "%d bits, " (v*8) in let pp_align_error fmt v = if v < 0 then Format.pp_print_string fmt "alignof error" else Format.fprintf fmt "aligned on %d bits" (v*8) in List.iter (fun (name,size,align) -> Format.fprintf fmt " sizeof %11s = %a (%a%a)@\n" name pp_size_error size pp_size_bits size pp_align_error align) [ "short", m.sizeof_short, m.alignof_short ; "int", m.sizeof_int, m.alignof_int ; "long", m.sizeof_long, m.alignof_long ; "long long", m.sizeof_longlong, m.alignof_longlong ; "float", m.sizeof_float, m.alignof_float ; "double", m.sizeof_double, m.alignof_double ; "long double", m.sizeof_longdouble, m.alignof_longdouble ; "pointer", m.sizeof_ptr, m.alignof_ptr ; "void", m.sizeof_void, 1 ; "function", m.sizeof_fun, m.alignof_fun ; ] ; List.iter (fun (name,typeof) -> Format.fprintf fmt " typeof %11s = %s@\n" name typeof) [ "sizeof(T)", m.size_t ; "wchar_t", m.wchar_t ; "ptrdiff_t", m.ptrdiff_t ; ] ; Format.fprintf fmt " char is %s@\n" (if m.char_is_unsigned then "unsigned" else "signed"); Format.fprintf fmt " machine is %s endian@\n" (if m.little_endian then "little" else "big") ; Format.fprintf fmt " strings are %s chars@\n" (if m.const_string_literals then "const" else "writable") ; Format.fprintf fmt " assembly names %s leading '_'@\n" (if m.underscore_name then "have" else "have no") ; Format.fprintf fmt " compiler %s builtin __va_list@\n" (if m.has__builtin_va_list then "has" else "has not") ; Format.fprintf fmt " compiler %s __head as a keyword@\n" (if m.__thread_is_keyword then "uses" else "does not use") ; end module DatatypeMachdep = Datatype.Make_with_collections(struct include Datatype.Serializable_undefined let reprs = [Machdeps.x86_32] let name = "File.Machdep" type t = Cil_types.mach let compare : t -> t -> int = Transitioning.Stdlib.compare let equal : t -> t -> bool = (=) let hash : t -> int = Hashtbl.hash let copy = Datatype.identity end) let default_machdeps = [ "x86_16", Machdeps.x86_16; "x86_32", Machdeps.x86_32; "x86_64", Machdeps.x86_64; "gcc_x86_16", Machdeps.x86_16; "gcc_x86_32", Machdeps.gcc_x86_32; "gcc_x86_64", Machdeps.gcc_x86_64; "ppc_32", Machdeps.ppc_32; "msvc_x86_64", Machdeps.msvc_x86_64; ] let regexp_existing_machdep_macro = Str.regexp "-D[ ]*__FC_MACHDEP_" let existing_machdep_macro () = let extra = String.concat " " (Kernel.CppExtraArgs.get ()) in try ignore (Str.search_forward regexp_existing_machdep_macro extra 0); true with Not_found -> false let machdep_macro = function | "x86_16" -> "__FC_MACHDEP_X86_16" | "gcc_x86_16" -> "__FC_MACHDEP_GCC_X86_16" | "x86_32" -> "__FC_MACHDEP_X86_32" | "gcc_x86_32" -> "__FC_MACHDEP_GCC_X86_32" | "x86_64" -> "__FC_MACHDEP_X86_64" | "gcc_x86_64" -> "__FC_MACHDEP_GCC_X86_64" | "ppc_32" -> "__FC_MACHDEP_PPC_32" | "msvc_x86_64" -> "__FC_MACHDEP_MSVC_X86_64" | s -> let res = "__FC_MACHDEP_" ^ (String.uppercase_ascii s) in Kernel.warning ~once:true "machdep %s has no registered macro. Using %s for pre-processing" s res; res module Machdeps = State_builder.Hashtbl(Datatype.String.Hashtbl)(DatatypeMachdep) (struct let name = " File.Machdeps" let size = 5 let dependencies = [] end) let mem_machdep s = Machdeps.mem s || List.mem_assoc s default_machdeps let new_machdep s m = try let cm = Machdeps.find s in if not (cm = m) then Kernel.abort "trying to register incompatible machdeps under name `%s'" s with Not_found -> Machdeps.add s m let pretty_machdeps fmt = Machdeps.iter (fun x _ -> Format.fprintf fmt "@ %s" x); List.iter (fun (x, _) -> Format.fprintf fmt "@ %s" x) default_machdeps let machdep_help () = let m = Kernel.Machdep.get () in if m = "help" then begin Kernel.feedback "@[supported machines are%t@ (default is x86_32).@]" pretty_machdeps; raise Cmdline.Exit end else Cmdline.nop let () = Cmdline.run_after_exiting_stage machdep_help let set_machdep () = let m = Kernel.Machdep.get () in if not (mem_machdep m) then Kernel.abort "@[unsupported machine %s.@ Try one of%t.@]" m pretty_machdeps let () = Cmdline.run_after_configuring_stage set_machdep (* Local to this module. Use Cil.theMachine.theMachine outside *) let get_machdep () = let m = Kernel.Machdep.get () in try Machdeps.find m with Not_found -> try List.assoc m default_machdeps with Not_found -> (* Should not happen given the checks above *) Kernel.fatal "Machdep %s not registered" m let pretty_machdep ?fmt ?machdep () = let machine = match machdep with None -> get_machdep () | Some m -> m in match fmt with | None -> Log.print_on_output (fun fmt -> print_machdep fmt machine) | Some fmt -> print_machdep fmt machine (* ************************************************************************* *) (** {2 Initializations} *) (* ************************************************************************* *) let safe_remove_file (f : Datatype.Filepath.t) = if not (Kernel.is_debug_key_enabled Kernel.dkey_parser) then Extlib.safe_remove (f :> string) let build_cpp_cmd cmdl supp_args in_file out_file = (* using Filename.quote for filenames which contain space or shell metacharacters *) let in_file = Filename.quote in_file and out_file = Filename.quote out_file in let substitute s = match Str.matched_string s with | "%%" -> "%" | "%args" -> supp_args | "%1" | "%i" | "%input" -> in_file | "%2" | "%o" | "%output" -> out_file | s -> s (* Unrecognized parameters are left intact *) in let regexp = Str.regexp "%%\\|%[a-z0-9]+" in try ignore (Str.search_forward regexp cmdl 0); (* Try to find one match *) Str.global_substitute regexp substitute cmdl with Not_found -> Format.sprintf "%s %s -o %s %s" cmdl supp_args out_file in_file let parse_cabs = function | NoCPP f -> if not (Sys.file_exists f) then Kernel.abort "preprocessed file %S does not exist" f; let path = Datatype.Filepath.of_string f in Kernel.feedback "Parsing %a (no preprocessing)" Datatype.Filepath.pretty path; Frontc.parse (Datatype.Filepath.of_string f) () | NeedCPP (f, cmdl, is_gnu_like) -> if not (Sys.file_exists (f :> string)) then Kernel.abort "source file %S does not exist" (f :> string); let debug = Kernel.is_debug_key_enabled Kernel.dkey_parser in let add_if_gnu opt = match is_gnu_like with | Gnu -> [opt] | Not_gnu -> [] | Unknown -> Kernel.warning ~once:true "your preprocessor is not known to handle option `%s'. \ If pre-processing fails because of it, please add \ -no-cpp-frama-c-compliant option to Frama-C's command-line. \ If you do not want to see this warning again, explicitly use \ option -cpp-frama-c-compliant." opt; [opt] in let ppf = try Datatype.Filepath.of_string (Extlib.temp_file_cleanup_at_exit ~debug (Filename.basename (f :> string)) ".i") with Extlib.Temp_file_error s -> Kernel.abort "cannot create temporary file: %s" s in (* Hypothesis: the preprocessor is POSIX compliant, hence understands -I and -D. *) let include_args = if Kernel.FramaCStdLib.get () then [Config.framac_libc] else [] in let define_args = if Kernel.FramaCStdLib.get () && not (existing_machdep_macro ()) then [machdep_macro (Kernel.Machdep.get ())] else [] in let extra_args = if include_args = [] && define_args = [] then [] else add_if_gnu "-nostdinc" in let define_args = "__FRAMAC__" :: define_args in (* Hypothesis: the preprocessor does support the arch-related options tested when 'configure' was run. *) let required_cpp_arch_args = (get_machdep ()).cpp_arch_flags in let supported_cpp_arch_args, unsupported_cpp_arch_args = List.partition (fun arg -> List.mem arg Config.preprocessor_supported_arch_options) required_cpp_arch_args in if is_gnu_like = Unknown && not (Kernel.CppCommand.is_set ()) && unsupported_cpp_arch_args <> [] then Kernel.warning ~once:true "your preprocessor is not known to handle option(s) `%a', \ considered necessary for machdep `%s'. To ensure compatibility \ between your preprocessor and the machdep, consider using \ -cpp-command with the appropriate flags. \ Your preprocessor is known to support these flags: %a" (Pretty_utils.pp_list ~sep:" " Format.pp_print_string) unsupported_cpp_arch_args (Kernel.Machdep.get ()) (Pretty_utils.pp_list ~sep:" " Format.pp_print_string) Config.preprocessor_supported_arch_options; let extra_args = if Kernel.ReadAnnot.get () then if Kernel.PreprocessAnnot.is_set () then if Kernel.PreprocessAnnot.get () then "-dD" :: extra_args else extra_args else let opt = add_if_gnu "-dD" in opt @ extra_args else extra_args in let pp_str = Format.pp_print_string in let string_of_supp_args extra includes defines = Format.asprintf "%a%a%a" (Pretty_utils.pp_list ~pre:" -I" ~sep:" -I" ~empty:"" pp_str) includes (Pretty_utils.pp_list ~pre:" -D" ~sep:" -D" ~empty:"" pp_str) defines (Pretty_utils.pp_list ~pre:" " ~sep:" " ~empty:"" pp_str) extra in let supp_args = string_of_supp_args (Kernel.CppExtraArgs.get () @ extra_args @ supported_cpp_arch_args) include_args define_args in Kernel.feedback ~dkey:Kernel.dkey_pp "@{preprocessing@} with \"%s %s %s\"" cmdl supp_args f; let path = Datatype.Filepath.of_string f in Kernel.feedback "Parsing %a (with preprocessing)" Datatype.Filepath.pretty path; let cpp_command = build_cpp_cmd cmdl supp_args f (ppf :> string) in if Sys.command cpp_command <> 0 then begin safe_remove_file ppf; Kernel.abort "failed to run: %s@\n\ you may set the CPP environment variable to select the proper \ preprocessor command or use the option \"-cpp-command\"." cpp_command end; let ppf = if Kernel.ReadAnnot.get() && ((Kernel.PreprocessAnnot.is_set () && Kernel.PreprocessAnnot.get()) || (match is_gnu_like with | Gnu -> true | Not_gnu -> false | Unknown -> Kernel.warning ~once:true "trying to preprocess annotation with an unknown \ preprocessor."; true)) then begin let pp_annot_supp_args = Format.asprintf "-nostdinc %a" (Pretty_utils.pp_list ~sep:" " Format.pp_print_string) supported_cpp_arch_args in let ppf' = try Logic_preprocess.file ".c" (build_cpp_cmd cmdl pp_annot_supp_args) (ppf : Filepath.Normalized.t :> string) with Sys_error _ as e -> safe_remove_file ppf; Kernel.abort "preprocessing of annotations failed (%s)" (Printexc.to_string e) in safe_remove_file ppf ; ppf' end else ppf in let (cil,(_,defs)) = Frontc.parse ppf () in cil.fileName <- path; safe_remove_file ppf; (cil,(path,defs)) | External (f,suf) -> if not (Sys.file_exists f) then Kernel.abort "file %S does not exist." f; try let path = Datatype.Filepath.of_string f in Kernel.feedback "Parsing %a (external front-end)" Datatype.Filepath.pretty path; Hashtbl.find check_suffixes suf f with Not_found -> Kernel.abort "could not find a suitable plugin for parsing %S." f let to_cil_cabs f = try let a,c = parse_cabs f in Kernel.debug ~dkey:Kernel.dkey_file_print_one "result of parsing %s:@\n%a" (get_name f) Cil_printer.pp_file a; if Errorloc.had_errors () then raise Exit; a, c with exn when Errorloc.had_errors () -> if Kernel.Debug.get () >= 1 then raise exn else Kernel.abort "@[stopping on@ file %S@ that@ has@ errors.%t@]" (get_name f) (fun fmt -> if Filename.check_suffix (get_name f :> string) ".c" && not (Kernel.is_debug_key_enabled Kernel.dkey_pp) then Format.fprintf fmt "@ Add@ '-kernel-msg-key pp'@ \ for preprocessing command.") let () = let handle f = let preprocess = build_cpp_cmd (fst (get_preprocessor_command ())) "-nostdinc" in let ppf = try Logic_preprocess.file ".c" preprocess f with Sys_error _ as e -> Kernel.abort "preprocessing of annotations failed (%s)" (Printexc.to_string e) in let path = Datatype.Filepath.of_string f in let (cil,(_,defs)) = Frontc.parse ppf () in cil.fileName <- path; safe_remove_file ppf; (cil,(path,defs)) in new_file_type ".ci" handle (* Keep defined entry point even if not defined, and possibly other unused globals according to relevant command-line parameters. This function is meant to be passed to {!Rmtmps.removeUnused}. *) let isRoot g = let specs = Kernel.Keep_unused_specified_functions.get () in let keepTypes = Kernel.Keep_unused_types.get () in Rmtmps.isExportedRoot g || match g with | GFun({svar = v; sspec = spec},_) | GFunDecl(spec,v,_) -> Kernel.MainFunction.get_plain_string () = v.vname (* Always keep the declaration of the entry point *) || (specs && not (is_empty_funspec spec)) (* and the declarations carrying specifications according to the command line.*) | GType _ | GCompTag _ | GCompTagDecl _ | GEnumTag _ | GEnumTagDecl _ -> keepTypes | _ -> false let files_to_cabs_cil files = Kernel.feedback ~level:2 "parsing"; (* Parsing and merging must occur in the very same order. Otherwise the order of files on the command line will not be consistently handled. *) let cil_cabs = List.fold_left (fun acc f -> to_cil_cabs f :: acc) [] files in let cil_files, cabs_files = List.split cil_cabs in (* fold_left reverses the list order. This is an issue with pre-registered files. *) let cil_files = List.rev cil_files in let cabs_files = List.rev cabs_files in Ast.UntypedFiles.set cabs_files; (* Perform symbolic merge of all files *) Kernel.feedback ~level:2 "symbolic link"; let merged_file = Mergecil.merge cil_files "whole_program" in Logic_utils.complete_types merged_file; if Kernel.UnspecifiedAccess.get () then Undefined_sequence.check_sequences merged_file; merged_file, cabs_files (* "Implicit" annotations are those added by the kernel with ACSL name 'Frama_C_implicit_init'. Currently, this concerns statements that are generated to initialize local variables. *) module Implicit_annotations = State_builder.Hashtbl (Property.Hashtbl)(Datatype.List(Property)) (struct let name = "File.Implicit_annotations" let dependencies = [Annotations.code_annot_state] let size = 32 end) let () = Ast.add_linked_state Implicit_annotations.self let () = Property_status.register_property_remove_hook (fun p -> if Implicit_annotations.mem p then begin Kernel.debug ~dkey:Kernel.dkey_file_annot "Removing implicit property %a" Property.pretty p; Implicit_annotations.remove p end) let emit_status p hyps = Kernel.debug ~dkey:Kernel.dkey_file_annot "Marking implicit property %a as true" Property.pretty p; Property_status.emit Emitter.kernel ~hyps p Property_status.True let emit_all_statuses _ = Kernel.debug ~dkey:Kernel.dkey_file_annot "Marking properties"; Implicit_annotations.iter emit_status let () = Ast.apply_after_computed emit_all_statuses let add_annotation kf st a = Annotations.add_code_annot Emitter.end_user ~kf st a; (* Now check if the annotation is valid by construction (provided normalization is correct). *) match a.annot_content with | AStmtSpec ([], ({ spec_behavior = [ { b_name = "Frama_C_implicit_init" } as bhv]})) -> let props = Property.ip_post_cond_of_behavior kf (Kstmt st) [] bhv in List.iter (fun p -> Implicit_annotations.add p []) props | _ -> () let synchronize_source_annot has_new_stmt kf = match kf.fundec with | Definition (fd,_) -> let (visitor:cilVisitor) = object inherit nopCilVisitor as super val block_with_user_annots = ref None val user_annots_for_next_stmt = ref [] method! vstmt st = super#pop_stmt st; let father = super#current_stmt in super#push_stmt st; let is_in_same_block () = match !block_with_user_annots,father with | None, None -> true | Some block, Some stmt_father when block == stmt_father -> true | _, _ -> false in let is_annot_next annot = match annot.annot_content with | AStmtSpec _ | APragma (Slice_pragma SPstmt | Impact_pragma IPstmt) -> true | AExtended(_,is_loop,{ext_name}) -> (match Logic_env.extension_category ext_name with | Some (Ext_code_annot (Ext_here | Ext_next_loop)) -> false | Some (Ext_code_annot Ext_next_stmt) -> true | Some (Ext_code_annot Ext_next_both) -> not is_loop | Some (Ext_contract | Ext_global) | None -> Kernel.( warning ~wkey:wkey_acsl_extension "%s is not a code annotation extension" name); false) | AAssert _ | AInvariant _ | AVariant _ | AAssigns _ | AAllocation _ | APragma (Slice_pragma (SPctrl | SPexpr _)) | APragma (Impact_pragma (IPexpr _)) | APragma (Loop_pragma _) -> false in let synchronize_user_annot a = add_annotation kf st a in let synchronize_previous_user_annots () = if !user_annots_for_next_stmt <> [] then begin if is_in_same_block () then begin let my_annots = !user_annots_for_next_stmt in let post_action st = let treat_annot (has_annot,st) (st_ann, annot) = if is_annot_next annot then begin if has_annot || st.labels <> [] || st_ann.labels <> [] then begin st_ann.skind <- (Block (Cil.mkBlockNonScoping [st])); has_new_stmt := true; Annotations.add_code_annot Emitter.end_user ~kf st_ann annot; (true, st_ann) end else begin add_annotation kf st annot; (true,st) end end else begin add_annotation kf st annot; (true, st) end in let (_,st) = List.fold_left treat_annot (false,st) my_annots in st in block_with_user_annots:=None; user_annots_for_next_stmt:=[]; ChangeDoChildrenPost(st,post_action) end else begin Kernel.warning ~current:true ~once:true "Ignoring previous annotation relative \ to next statement effects" ; block_with_user_annots := None ; user_annots_for_next_stmt := []; DoChildren end end else begin block_with_user_annots := None ; user_annots_for_next_stmt := []; DoChildren; end in let add_user_annot_for_next_stmt st annot = if !user_annots_for_next_stmt = [] then begin block_with_user_annots := father; user_annots_for_next_stmt := [st,annot] end else if is_in_same_block () then user_annots_for_next_stmt := (st, annot)::!user_annots_for_next_stmt else begin Kernel.warning ~current:true ~once:true "Ignoring previous annotation relative to next statement \ effects"; block_with_user_annots := father; user_annots_for_next_stmt := [st, annot] ; end; ChangeTo (Cil.mkStmtOneInstr (Skip Cil_datatype.Location.unknown)) in assert (!block_with_user_annots = None || !user_annots_for_next_stmt <> []); match st.skind with | Instr (Code_annot (annot,_)) -> (* Code annotation isn't considered as a real stmt. So, previous annotations should be relative to the next stmt. Only this [annot] may be synchronised to that stmt *) if is_annot_next annot then (* Annotation relative to the effect of next statement *) add_user_annot_for_next_stmt st annot else (* Annotation relative to the current control point *) (match !user_annots_for_next_stmt with | [] -> synchronize_user_annot annot; DoChildren | _ -> (* we have an annotation relative to the next real C statement somewhere above, and we have not reached it yet. Just stack the current annotation.*) add_user_annot_for_next_stmt st annot) | Loop (annot, _, _, _, _) -> (* Synchronize previous annotations on that statement *) let res = synchronize_previous_user_annots () in (* Synchronize loop annotations on that statement *) List.iter synchronize_user_annot (List.sort (fun x y -> x.annot_id - y.annot_id) annot); res | _ -> (* Synchronize previous annotations on that statement *) synchronize_previous_user_annots () ; end in ignore (visitCilFunction visitor fd) | Declaration _ -> () let register_global = function | GFun (fundec, loc) -> let onerets = ref [] in let callback return goto = onerets := (return,goto) :: !onerets in (* ensure there is only one return *) Oneret.oneret ~callback fundec; (* Build the Control Flow Graph for all functions *) if Kernel.SimplifyCfg.get () then begin Cfg.prepareCFG ~keepSwitch:(Kernel.KeepSwitch.get ()) fundec; Cfg.clearCFGinfo fundec; Cfg.cfgFun fundec; (* prepareCFG may add additional labels that are not used in the end. *) Rmtmps.remove_unused_labels fundec; end; Globals.Functions.add (Definition(fundec,loc)); let kf = Globals.Functions.get fundec.svar in (* Finally set property-status on oneret clauses *) List.iter (fun ((sret,b,pret),gotos) -> let ipreturns = Property.ip_of_ensures kf (Kstmt sret) b (Returns,pret) in let ipgotos = List.map (fun (sgot,agot) -> Property.ip_of_code_annot_single kf sgot agot) gotos in Implicit_annotations.add ipreturns ipgotos ) !onerets ; | GFunDecl (spec, f,loc) -> (* global prototypes *) let args = try Some (Cil.getFormalsDecl f) with Not_found -> None in (* Use a copy of the spec, as the original one will be erased by AST cleanup. *) let spec = { spec with spec_variant = spec.spec_variant } in Globals.Functions.add (Declaration(spec,f,args,loc)) | GVarDecl (vi,_) when not vi.vdefined -> (* global variables declaration with no definitions *) Globals.Vars.add_decl vi | GVar (varinfo,initinfo,_) -> (* global variables definitions *) Globals.Vars.add varinfo initinfo; | GAnnot (annot,_loc) -> Annotations.add_global Emitter.end_user annot | _ -> () let computeCFG ~clear_id file = Cfg.clearFileCFG ~clear_id file; Cfg.computeFileCFG file (* Remove (inplace) annotations that are physically in the AST (and that have been moved inside kernel tables) by turning them into Skip, then remove empty statements and blocks. *) let cleanup file = let visitor = object(self) inherit Visitor.frama_c_inplace val mutable keep_stmt = Stmt.Set.empty val mutable changed = false method private remove_lexical_annotations stmt = match stmt.skind with | Instr(Code_annot(_,loc)) -> stmt.skind <- Instr(Skip(loc)) | Loop (_::_, b1,l1,s1,s2) -> stmt.skind <- Loop ([], b1, l1, s1, s2) | _ -> () method! vstmt_aux st = self#remove_lexical_annotations st; let loc = Stmt.loc st in if Annotations.has_code_annot st || st.labels <> [] || st.sattr <> [] then keep_stmt <- Stmt.Set.add st keep_stmt; match st.skind with | Block b -> (* queue is flushed afterwards*) let b' = Cil.visitCilBlock (self:>cilVisitor) b in (match b'.bstmts, b'.blocals, b'.bstatics with | [], [], [] -> changed <- true; st.skind <- (Instr (Skip loc)) | _ -> if b != b' then st.skind <- Block b'); SkipChildren | _ -> DoChildren method! vblock b = let optim b = b.bstmts <- List.filter (fun x -> not (Cil.is_skip x.skind) || Stmt.Set.mem x keep_stmt || ( changed <- true; false) (* don't try this at home, kids...*) ) b.bstmts; (* Now that annotations are in the table, we do not need to retain the block anymore. *) b.battrs <- List.filter (function | Attr(l,[]) when l = Cabs2cil.frama_c_keep_block -> false | _ -> true) b.battrs; b in (* uncomment if you don't want to consider scope of locals (see below) *) (* b.blocals <- [];*) ChangeDoChildrenPost(b,optim) method! vglob_aux = function | GFun (f,_) -> f.sspec <- Cil.empty_funspec (); (* uncomment if you dont want to treat scope of locals (see above)*) (* f.sbody.blocals <- f.slocals; *) DoChildren | GFunDecl(s,_,_) -> Logic_utils.clear_funspec s; DoChildren | GType _ | GCompTag _ | GCompTagDecl _ | GEnumTag _ | GEnumTagDecl _ | GVar _ | GVarDecl _ | GAsm _ | GPragma _ | GText _ | GAnnot _ -> SkipChildren method! vfile f = ChangeDoChildrenPost (f,fun f -> if changed then begin Cfg.clearFileCFG ~clear_id:false f; Cfg.computeFileCFG f; f end else f) end in visitFramacFileSameGlobals visitor file let print_renaming: Cil.cilVisitor = object inherit Cil.nopCilVisitor method! vvdec v = if v.vname <> v.vorig_name then begin Kernel.result ~current:true "Variable %s has been renamed to %s" v.vorig_name v.vname end; DoChildren end module Transform_before_cleanup = Hook.Build_ordered (struct module Id = Datatype.String type t = Cil_types.file end) module Transform_after_cleanup = Hook.Build_ordered (struct module Id = Datatype.String type t = Cil_types.file end) module Transform_after_parameter_change = Hook.Build_ordered (struct module Id = Datatype.String type t = State.t end) let transform_parameters = ref State.Set.empty type code_transformation_category = { name: string; before_id: Transform_before_cleanup.id; after_id: Transform_after_cleanup.id; prm_id: Transform_after_parameter_change.id } let register_code_transformation_category s = { name = s; before_id = Transform_before_cleanup.register_key s; after_id = Transform_after_cleanup.register_key s; prm_id = Transform_after_parameter_change.register_key s } let add_transform_parameter ~before ~after name f (p:(module Parameter_sig.S)) = let module P = (val p: Parameter_sig.S) in let hook self = (* hook is launched if AST already exists and the apply was triggered by the corresponding option change *) if State.equal self P.self && Ast.is_computed () then begin Kernel.feedback ~dkey:Kernel.dkey_file_transform "applying %s to current AST, after option %s changed" name.name P.option_name; f (Ast.get()); if Kernel.Check.get () then Filecheck.check_ast ("after code transformation: " ^ name.name ^ " triggered by " ^ P.option_name) end in (* P.add_set_hook must be done only once. *) if not (State.Set.mem P.self !transform_parameters) then begin transform_parameters:=State.Set.add P.self !transform_parameters; P.add_set_hook (fun _ _ -> Transform_after_parameter_change.apply P.self) end; Transform_after_parameter_change.extend name.prm_id hook; List.iter (fun b -> Transform_after_parameter_change.add_dependency name.prm_id b.prm_id) before; List.iter (fun a -> Transform_after_parameter_change.add_dependency a.prm_id name.prm_id) after module Cfg_recomputation_queue = State_builder.Set_ref(Cil_datatype.Fundec.Set) (struct let name = "File.Cfg_recomputation_queue" let dependencies = [Ast.self] end) let () = Ast.add_linked_state Cfg_recomputation_queue.self let must_recompute_cfg f = Cfg_recomputation_queue.add f let recompute_cfg _ = (* just in case f happens to modify the CFG *) Cfg_recomputation_queue.iter (fun f -> Cfg.clearCFGinfo ~clear_id:false f; Cfg.cfgFun f); Cfg_recomputation_queue.clear () let transform_and_check name is_normalized f ast = let printer = if is_normalized then Printer.pp_file else Cil_printer.pp_file in Kernel.feedback ~dkey:Kernel.dkey_file_transform "applying %s to file:@\n%a" name printer ast; f ast; recompute_cfg (); if Kernel.Check.get () then begin Filecheck.check_ast ~is_normalized ~ast ("after code transformation: " ^ name); end let add_code_transformation_before_cleanup ?(deps:(module Parameter_sig.S) list = []) ?(before=[]) ?(after=[]) name f = Transform_before_cleanup.extend name.before_id (transform_and_check name.name false f); List.iter (fun b -> Transform_before_cleanup.add_dependency name.before_id b.before_id) before; List.iter (fun a -> Transform_before_cleanup.add_dependency a.before_id name.before_id) after; List.iter (add_transform_parameter ~before ~after name f) deps let add_code_transformation_after_cleanup ?(deps:(module Parameter_sig.S) list = []) ?(before=[]) ?(after=[]) name f = Transform_after_cleanup.extend name.after_id (transform_and_check name.name true f); List.iter (fun b -> Transform_after_cleanup.add_dependency name.after_id b.after_id) before; List.iter (fun a -> Transform_after_cleanup.add_dependency a.after_id name.after_id) after; List.iter (add_transform_parameter ~before ~after name f) deps let syntactic_constant_folding ast = if Kernel.Constfold.get () then Cil.visitCilFileSameGlobals (Cil.constFoldVisitor true) ast let constfold = register_code_transformation_category "constfold" let () = let deps = [ (module Kernel.Constfold: Parameter_sig.S) ] in add_code_transformation_after_cleanup ~deps constfold syntactic_constant_folding let prepare_cil_file ast = Kernel.feedback ~level:2 "preparing the AST"; computeCFG ~clear_id:true ast; if Kernel.Check.get () then begin Filecheck.check_ast ~is_normalized:false ~ast "initial AST" end; Kernel.feedback ~level:2 "First check done"; if Kernel.Orig_name.get () then begin Cil.visitCilFileSameGlobals print_renaming ast end; Transform_before_cleanup.apply ast; (* Remove unused temp variables and globals. *) Kernel.feedback ~level:2 "cleaning unused parts"; Rmtmps.removeUnused ~isRoot ast; if Kernel.Check.get () then begin Filecheck.check_ast ~is_normalized:false ~ast "Removed temp vars" end; (try List.iter register_global ast.globals with Globals.Vars.AlreadyExists(vi,_) -> Kernel.fatal "Trying to add the same varinfo twice: %a (vid:%d)" Printer.pp_varinfo vi vi.vid); Kernel.feedback ~level:2 "register globals done"; (* NB: register_global also calls oneret, which might introduce new statements and new annotations tied to them. Since sid are set by cfg, we must compute it again before annotation synchronisation *) Cfg.clearFileCFG ~clear_id:false ast; Cfg.computeFileCFG ast; let recompute = ref false in Globals.Functions.iter (synchronize_source_annot recompute); (* We might also introduce new blocks for synchronization. *) if !recompute then begin Cfg.clearFileCFG ~clear_id:false ast; Cfg.computeFileCFG ast; end; cleanup ast; Ast.set_file ast; (* Check that normalization is correct. *) if Kernel.Check.get() then begin Filecheck.check_ast ~ast "AST after normalization"; end; Globals.Functions.iter Annotations.register_funspec; if Kernel.Check.get () then begin Filecheck.check_ast ~ast "AST after annotation registration" end; Transform_after_cleanup.apply ast; (* reset tables depending on AST in case they have been computed during the transformation. *) Ast.set_file ast let fill_built_ins () = if Cil.selfMachine_is_computed () then begin Kernel.debug "Machine is computed, just fill the built-ins"; Cil.init_builtins (); end else begin Kernel.debug "Machine is not computed, initialize everything"; Cil.initCIL (Logic_builtin.init()) (get_machdep ()); end; (* Fill logic tables with builtins *) Logic_env.Builtins.apply (); Logic_env.prepare_tables () let init_project_from_cil_file prj file = let selection = State_selection.diff State_selection.full (State_selection.list_union (List.map State_selection.with_dependencies [Cil.Builtin_functions.self; Ast.self; Files.pre_register_state])) in Project.copy ~selection prj; Project.on prj (fun file -> fill_built_ins (); prepare_cil_file file) file let files_pre_register_state = Files.pre_register_state module Global_annotation_graph = struct module Base = Graph.Imperative.Digraph.Concrete(Cil_datatype.Global) include Base include Graph.Traverse.Dfs(Base) include Graph.Topological.Make(Base) end let find_typeinfo ty = let module F = struct exception Found of global end in let globs = (Ast.get()).globals in try List.iter (fun g -> match g with | GType (ty',_) when ty == ty' -> raise (F.Found g) | GType (ty',_) when ty.tname = ty'.tname -> Kernel.fatal "Lost sharing between definition and declaration of type %s" ty.tname | _ -> ()) globs; Kernel.fatal "Reordering AST: unknown typedef for %s" ty.tname with F.Found g -> g let extract_logic_infos g = let rec aux acc = function | Dfun_or_pred (li,_) | Dinvariant (li,_) | Dtype_annot (li,_) -> li :: acc | Dvolatile _ | Dtype _ | Dlemma _ | Dmodel_annot _ | Dcustom_annot _ | Dextended _ -> acc | Daxiomatic(_,l,_,_) -> List.fold_left aux acc l in aux [] g let find_logic_info_decl li = let module F = struct exception Found of global end in let globs = (Ast.get()).globals in try List.iter (fun g -> match g with | GAnnot (ga,_) -> if List.exists (fun li' -> Logic_info.equal li li') (extract_logic_infos ga) then raise (F.Found g) | _ -> ()) globs; Kernel.fatal "Reordering AST: unknown declaration \ for logic function or predicate %s" li.l_var_info.lv_name with F.Found g -> g class reorder_ast: Visitor.frama_c_visitor = let unique_name_recursive_axiomatic = let i = ref 0 in fun () -> if !i = 0 then begin incr i; "__FC_recursive_axiomatic" end else begin let res = "__FC_recursive_axiomatic_" ^ (string_of_int !i) in incr i; res end in object(self) inherit Visitor.frama_c_inplace val mutable known_enuminfo = Enuminfo.Set.empty val mutable known_compinfo = Compinfo.Set.empty val mutable known_typeinfo = Typeinfo.Set.empty val mutable known_var = Varinfo.Set.empty val mutable known_logic_info = Logic_info.Set.empty val mutable local_logic_info = Logic_info.Set.empty (* globals that have to be declared before current declaration. *) val mutable needed_decls = [] (* global annotations are treated separately, as they need special care when revisiting their content *) val mutable needed_annots = [] val current_annot = Stack.create () val subvisit = Stack.create () val typedefs = Stack.create () val logic_info_deps = Global_annotation_graph.create () method private add_known_enuminfo ei = known_enuminfo <- Enuminfo.Set.add ei known_enuminfo method private add_known_compinfo ci = known_compinfo <- Compinfo.Set.add ci known_compinfo method private add_known_type ty = known_typeinfo <- Typeinfo.Set.add ty known_typeinfo method private add_known_var vi = known_var <- Varinfo.Set.add vi known_var method private add_known_logic_info li = known_logic_info <- Logic_info.Set.add li known_logic_info method private add_needed_decl g = needed_decls <- g :: needed_decls method private add_needed_annot g = needed_annots <- g :: needed_annots method private add_annot_depend g = try let g' = Stack.top current_annot in if g == g' then () else Global_annotation_graph.add_edge logic_info_deps g g' (* g' depends upon g *) with Stack.Empty -> Global_annotation_graph.add_vertex logic_info_deps g (* Otherwise, if we only have one annotation to take care of, the graph will be empty... *) method private add_known_annots g = let lis = extract_logic_infos g in List.iter self#add_known_logic_info lis method private clear_deps () = needed_decls <- []; needed_annots <- []; Stack.clear current_annot; Stack.clear typedefs; Global_annotation_graph.clear logic_info_deps method private make_annots g = let g = match g with | [ g ] -> g | _ -> (* We'll eventually add some globals, but the value returned by visitor itself is supposed to be a singleton. Everything is done in post-action. *) Kernel.fatal "unexpected result of visiting global when reordering" in let deps = if Global_annotation_graph.nb_vertex logic_info_deps = 0 then [] else if Global_annotation_graph.has_cycle logic_info_deps then begin (* Assumption: elements from the stdlib are not part of a cycle with others logic functions, i.e. the stdlib is well-formed. *) let entries = Global_annotation_graph.fold (fun g acc -> let stdlib = Cil.findAttribute "fc_stdlib" (Cil_datatype.Global.attr g) in let key = match stdlib with | [ AStr s ] -> s | _ -> "" in let elts = try Datatype.String.Map.find key acc with Not_found -> [] in Datatype.String.Map.add key (g::elts) acc ) logic_info_deps Datatype.String.Map.empty in Datatype.String.Map.fold (fun k l res -> let attr = if k = "" then [] else [ Attr("fc_stdlib", [AStr k])] in let entries = List.fold_left (fun acc g -> match g with GAnnot (g,_) -> g :: acc | _ -> acc) [] l in (GAnnot (Daxiomatic (unique_name_recursive_axiomatic (), entries, attr, Location.unknown), Location.unknown))::res) entries [] end else begin Global_annotation_graph.fold (fun ga acc -> ga :: acc) logic_info_deps [] end in assert (List.length deps = List.length needed_annots); match g with | GAnnot _ -> List.rev deps (** g is already in the dependencies graph. *) | _ -> List.rev (g::deps) (* TODO: add methods for uses of undeclared identifiers. Use functions that maps an identifier to its decl. Don't forget to check for cycles for TNamed and logic_info. *) method! vtype ty = (match ty with | TVoid _ | TInt _ | TFloat _ | TPtr _ | TFun _ | TBuiltin_va_list _ | TArray _ -> () | TNamed (ty,_) -> let g = find_typeinfo ty in if not (Typeinfo.Set.mem ty known_typeinfo) then begin self#add_needed_decl g; Stack.push g typedefs; Stack.push true subvisit; ignore (Visitor.visitFramacGlobal (self:>Visitor.frama_c_visitor) g); ignore (Stack.pop typedefs); ignore (Stack.pop subvisit); end else Stack.iter (fun g' -> if g == g' then Kernel.fatal "Globals' reordering failed: \ recursive definition of type %s" ty.tname) typedefs | TComp(ci,_,_) -> if not (Compinfo.Set.mem ci known_compinfo) then begin self#add_needed_decl (GCompTagDecl (ci,Location.unknown)); self#add_known_compinfo ci end | TEnum(ei,_) -> if not (Enuminfo.Set.mem ei known_enuminfo) then begin self#add_needed_decl (GEnumTagDecl (ei, Location.unknown)); self#add_known_enuminfo ei end); DoChildren method! vvrbl vi = if vi.vglob && not (Varinfo.Set.mem vi known_var) then begin if Cil.isFunctionType vi.vtype then self#add_needed_decl (GFunDecl (Cil.empty_funspec(),vi,vi.vdecl)) else self#add_needed_decl (GVarDecl (vi,vi.vdecl)); self#add_known_var vi; end; DoChildren method private logic_info_occurrence lv = if not (Logic_env.is_builtin_logic_function lv.l_var_info.lv_name) then begin let g = find_logic_info_decl lv in if not (Logic_info.Set.mem lv known_logic_info) then begin self#add_annot_depend g; Stack.push true subvisit; (* visit will also push g in needed_annot. *) ignore (Visitor.visitFramacGlobal (self:>Visitor.frama_c_visitor) g); ignore (Stack.pop subvisit) end else if List.memq g needed_annots then begin self#add_annot_depend g; end; end method private add_local_logic_info li = local_logic_info <- Logic_info.Set.add li local_logic_info method private remove_local_logic_info li = local_logic_info <- Logic_info.Set.remove li local_logic_info method private is_local_logic_info li = Logic_info.Set.mem li local_logic_info method! vlogic_var_use lv = let logic_infos = Annotations.logic_info_of_global lv.lv_name in (try self#logic_info_occurrence (List.find (fun x -> Cil_datatype.Logic_var.equal x.l_var_info lv) logic_infos) with Not_found -> ()); DoChildren method! vterm t = match t.term_node with | Tlet(li,_) -> self#add_local_logic_info li; DoChildrenPost (fun t -> self#remove_local_logic_info li; t) | _ -> DoChildren method! vpredicate_node p = match p with | Plet(li,_) -> self#add_local_logic_info li; DoChildrenPost (fun t -> self#remove_local_logic_info li; t) | _ -> DoChildren method! vlogic_info_use lv = if not (self#is_local_logic_info lv) then self#logic_info_occurrence lv; DoChildren method! vglob_aux g = let is_subvisit = try Stack.top subvisit with Stack.Empty -> false in (match g with | GType (ty,_) -> self#add_known_type ty; self#add_needed_decl g | GCompTagDecl(ci,_) | GCompTag(ci,_) -> self#add_known_compinfo ci | GEnumTagDecl(ei,_) | GEnumTag(ei,_) -> self#add_known_enuminfo ei | GVarDecl(vi,_) | GVar (vi,_,_) | GFun({svar = vi},_) | GFunDecl (_,vi,_) -> self#add_known_var vi | GAsm _ | GPragma _ | GText _ -> () | GAnnot (ga,_) -> Stack.push g current_annot; self#add_known_annots ga; Global_annotation_graph.add_vertex logic_info_deps g; self#add_needed_annot g); let post_action g = (match g with | [GAnnot _] -> ignore (Stack.pop current_annot) | _ -> ()); if is_subvisit then g (* everything will be done at toplevel *) else begin let res = List.rev_append needed_decls (self#make_annots g) in self#clear_deps (); res end in DoChildrenPost post_action end module Remove_spurious = struct type env = { typeinfos: Typeinfo.Set.t; compinfos: Compinfo.Set.t; enuminfos: Enuminfo.Set.t; varinfos: Varinfo.Set.t; logic_infos: Logic_info.Set.t; kept: global list; } let treat_one_global acc g = match g with | GType (ty,_) when Typeinfo.Set.mem ty acc.typeinfos -> acc | GType (ty,_) -> { acc with typeinfos = Typeinfo.Set.add ty acc.typeinfos; kept = g :: acc.kept } | GCompTag _ -> { acc with kept = g :: acc.kept } | GCompTagDecl(ci,_) when Compinfo.Set.mem ci acc.compinfos -> acc | GCompTagDecl(ci,_) -> { acc with compinfos = Compinfo.Set.add ci acc.compinfos; kept = g :: acc.kept } | GEnumTag _ -> { acc with kept = g :: acc.kept } | GEnumTagDecl(ei,_) when Enuminfo.Set.mem ei acc.enuminfos -> acc | GEnumTagDecl(ei,_) -> { acc with enuminfos = Enuminfo.Set.add ei acc.enuminfos; kept = g :: acc.kept } | GVarDecl(vi,_) | GFunDecl (_, vi, _) when Varinfo.Set.mem vi acc.varinfos -> acc | GVarDecl(vi,_) -> { acc with varinfos = Varinfo.Set.add vi acc.varinfos; kept = g :: acc.kept } | GVar _ | GFun _ | GFunDecl _ -> { acc with kept = g :: acc.kept } | GAsm _ | GPragma _ | GText _ -> { acc with kept = g :: acc.kept } | GAnnot (a,_) -> let lis = extract_logic_infos a in if List.exists (fun x -> Logic_info.Set.mem x acc.logic_infos) lis then acc else begin let known_li = List.fold_left (Extlib.swap Logic_info.Set.add) acc.logic_infos lis in { acc with kept = g::acc.kept; logic_infos = known_li; } end let empty = { typeinfos = Typeinfo.Set.empty; compinfos = Compinfo.Set.empty; enuminfos = Enuminfo.Set.empty; varinfos = Varinfo.Set.empty; logic_infos = Logic_info.Set.empty; kept = []; } let process file = let env = List.fold_left treat_one_global empty file.globals in file.globals <- List.rev env.kept end let reorder_custom_ast ast = Visitor.visitFramacFile (new reorder_ast) ast; Remove_spurious.process ast let reorder_ast () = reorder_custom_ast (Ast.get()) (* Fill logic tables with builtins *) let init_cil () = Cil.initCIL (Logic_builtin.init()) (get_machdep ()); Logic_env.Builtins.apply (); Logic_env.prepare_tables () let prepare_from_c_files () = init_cil (); let files = Files.get () in (* Allow pre-registration of prolog files *) let cil, cabs_files = files_to_cabs_cil files in prepare_cil_file cil; (* prepare_cil_file may call syntactic transformers, that will ultimately reset the untyped AST. Restore it here. *) Ast.UntypedFiles.set cabs_files let init_project_from_visitor ?(reorder=false) prj (vis:Visitor.frama_c_visitor) = if not (Visitor_behavior.is_copy vis#behavior) || not (Project.equal prj (Extlib.the vis#project)) then Kernel.fatal "Visitor does not copy or does not operate on correct project."; Project.on prj init_cil (); let old_ast = Ast.get () in let ast = visitFramacFileCopy vis old_ast in let finalize ast = computeCFG ~clear_id:false ast; Ast.set_file ast in let selection = State_selection.with_dependencies Ast.self in Project.on ~selection prj finalize ast; (* reorder _before_ check. *) if reorder then Project.on prj reorder_ast (); if Kernel.Check.get() then begin let name = prj.Project.name in Project.on prj (Filecheck.check_ast ~ast) ("AST of " ^ name); assert (Kernel.verify (old_ast == Ast.get()) "Creation of project %s modifies original project" name); Filecheck.check_ast ("Original AST after creation of " ^ name) end let prepare_from_visitor ?reorder prj visitor = let visitor = visitor prj in init_project_from_visitor ?reorder prj visitor let create_project_from_visitor ?reorder ?(last=true) prj_name visitor = let selection = State_selection.list_union (List.map State_selection.with_dependencies [ Kernel.Files.self; Files.pre_register_state ]) in let selection = State_selection.diff State_selection.full selection in let prj = Project.create_by_copy ~selection ~last prj_name in (* reset projectified parameters to their default values *) let temp = Project.create "File.temp" in Project.copy ~selection:(Parameter_state.get_reset_selection ()) ~src:temp prj; Project.remove ~project:temp (); prepare_from_visitor ?reorder prj visitor; prj let init_from_c_files files = (match files with [] -> () | _ :: _ -> Files.register files); prepare_from_c_files () let init_from_cmdline () = let prj1 = Project.current () in if Kernel.Copy.get () then begin let selection = State_selection.list_union (List.map State_selection.with_dependencies [ Cil.Builtin_functions.self; Logic_env.Logic_info.self; Logic_env.Logic_type_info.self; Logic_env.Logic_ctor_info.self; Ast.self ]) in Project.clear ~selection (); let prj2 = Project.create_by_copy ~last:false "debug_copy_prj" in Project.set_current prj2; end; let files = Kernel.Files.get () in if files = [] && not !Config.is_gui then Kernel.warning "no input file."; let files = List.map (fun s -> from_filename s) files in try init_from_c_files files; if Kernel.Check.get () then begin Filecheck.check_ast "Copy of original AST" end; if Kernel.Copy.get () then begin Project.on prj1 fill_built_ins (); prepare_from_visitor prj1 (fun prj -> new Visitor.frama_c_copy prj); Project.set_current prj1; end; with Ast.Bad_Initialization s -> Kernel.fatal "@[Cannot initialize from C files@ \ Kernel raised Bad_Initialization %s@]" s let init_from_cmdline = Journal.register "File.init_from_cmdline" (Datatype.func Datatype.unit Datatype.unit) init_from_cmdline let init_from_c_files = Journal.register "File.init_from_c_files" (Datatype.func (Datatype.list ty) Datatype.unit) init_from_c_files let prepare_from_c_files = Journal.register "File.prepare_from_c_files" (Datatype.func Datatype.unit Datatype.unit) prepare_from_c_files let () = Ast.set_default_initialization (fun () -> if Files.is_computed () then prepare_from_c_files () else init_from_cmdline ()) let pp_file_to fmt_opt = let pp_ast = Printer.pp_file in let ast = Ast.get () in (match fmt_opt with | None -> Kernel.CodeOutput.output (fun fmt -> pp_ast fmt ast) | Some fmt -> pp_ast fmt ast) let unjournalized_pretty prj (fmt_opt:Format.formatter option) () = Project.on prj pp_file_to fmt_opt let journalized_pretty_ast = Journal.register "File.pretty_ast" (Datatype.func3 ~label1:("prj",Some Project.current) Project.ty ~label2:("fmt",Some (fun () -> None)) (let module O = Datatype.Option(Datatype.Formatter) in O.ty) Datatype.unit Datatype.unit) unjournalized_pretty let pretty_ast ?(prj=Project.current ()) ?fmt () = journalized_pretty_ast prj fmt () let create_rebuilt_project_from_visitor ?reorder ?last ?(preprocess=false) prj_name visitor = let prj = create_project_from_visitor ?reorder ?last prj_name visitor in try let f = let name = "frama_c_project_" ^ prj_name ^ "_" in let ext = if preprocess then ".c" else ".i" in let debug = Kernel.Debug.get () > 0 in let tmp_fname = Extlib.temp_file_cleanup_at_exit ~debug name ext in tmp_fname in let cout = open_out (f :> string) in let fmt = Format.formatter_of_out_channel cout in unjournalized_pretty prj (Some fmt) (); let redo () = (* Kernel.feedback "redoing initialization on file %s" f;*) Files.reset (); init_from_c_files [ if preprocess then from_filename f else NoCPP f ] in Project.on prj redo (); prj with Extlib.Temp_file_error s | Sys_error s -> Kernel.abort "cannot create temporary file: %s" s (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/file.mli0000666000000000000000000002716713571573400021150 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Frama-c preprocessing and Cil AST initialization. *) (** Whether a given preprocessor supports gcc options used in some configurations. *) type cpp_opt_kind = Gnu | Not_gnu | Unknown (** File type, according to how it will be preprocessed. Note: [string] is used here instead of [Filepath], to preserve names given in the command line, without normalization. *) type file = | NeedCPP of string * string * cpp_opt_kind (** The first string is the filename of the [.c] to preprocess. The second one is the preprocessor command ([filename.c -o tempfilname.i] will be appended at the end).*) | NoCPP of string (** Already pre-processed file [.i] *) | External of string * string (** file that can be translated into a Cil AST through an external function, together with the recognized suffix. *) include Datatype.S with type t = file val new_file_type: string -> (string -> Cil_types.file * Cabs.file) -> unit (** [new_file_type suffix func funcname] registers a new type of files (with corresponding suffix) as recognized by Frama-C through [func]. @plugin development guide *) val new_machdep: string -> Cil_types.mach -> unit (** [new_machdep name module] registers a new machdep name as recognized by Frama-C through The usual uses is [Cmdline.run_after_loading_stage (fun () -> File.new_machdep "my_machdep" my_machdep_implem)] @since Nitrogen-20111001 @modify Fluorine-20130401 Receives the machdep (as a module) as argument @modify Sodium-20150201 Receives directly the machdep as argument @raise Invalid_argument if the given name already exists @plugin development guide *) val machdep_macro: string -> string (** [machdep_macro machine] returns the name of a macro __FC_MACHDEP_XXX so that the preprocessor can select std lib definition consistent with the selected machdep. This function will emit a warning if [machine] is not known by default by the kernel and return __FC_MACHDEP_MACHINE in that case. @since Magnesium-20151001 (exported in the API) *) type code_transformation_category (** type of registered code transformations @since Neon-20140301 *) val register_code_transformation_category: string -> code_transformation_category (** Adds a new category of code transformation *) val add_code_transformation_before_cleanup: ?deps:(module Parameter_sig.S) list -> ?before:code_transformation_category list -> ?after:code_transformation_category list -> code_transformation_category -> (Cil_types.file -> unit) -> unit (** [add_code_transformation_before_cleanup name hook] adds an hook in the corresponding category that will be called during the normalization of a linked file, before clean up and removal of temps and unused declarations. If this transformation involves changing statements of a function [f], [f] must be flagged with {!File.must_recompute_cfg}. The optional [before] (resp [after]) categories indicates that current transformation must be executed before (resp after) the corresponding ones, if they exist. In case of dependencies cycle, an arbitrary order will be chosen for the transformations involved in the cycle. The optional [deps] argument gives the list of options whose change (e.g. after a [-then]) will trigger the transformation over the already computed AST. If several transformations are triggered by the same option, their relative order is preserved. At this level, globals and ACSL annotations have not been registered. @since Neon-20140301 @plugin development guide *) val add_code_transformation_after_cleanup: ?deps:(module Parameter_sig.S) list -> ?before:code_transformation_category list -> ?after:code_transformation_category list -> code_transformation_category -> (Cil_types.file -> unit) -> unit (** Same as above, but the hook is applied after clean up. At this level, globals and ACSL annotations have been registered. If the hook adds some new globals or annotations, it must take care of adding them in the appropriate tables. Note that it is the responsibility of the hook to use {!Ast.mark_as_changed} or {!Ast.mark_as_grown} whenever it is the case. @since Neon-20140301 @plugin development guide *) val constfold: code_transformation_category (** category for syntactic constfolding (done after cleanup) @since Silicon-20161101 *) val must_recompute_cfg: Cil_types.fundec -> unit (** [must_recompute_cfg f] must be called by code transformation hooks when they modify statements in function [f]. This will trigger a recomputation of the cfg of [f] after the transformation. @since Neon-20140301 @plugin development guide *) val get_suffixes: unit -> string list (** @return the list of accepted suffixes of input source files @since Boron-20100401 *) val get_name: t -> string (** File name (not normalized). *) val get_preprocessor_command: unit -> string * cpp_opt_kind (** Return the preprocessor command to use. *) val pre_register: t -> unit (** Register some file as source file before command-line files *) val get_all: unit -> t list (** Return the list of toplevel files. *) val from_filename: ?cpp:string -> string -> t (** Build a file from its name. The optional argument is the preprocessor command. Default is [!get_preprocessor_command ()]. *) (* ************************************************************************* *) (** {2 Initializers} *) (* ************************************************************************* *) val prepare_from_c_files: unit -> unit (** Initialize the AST of the current project according to the current filename list. @raise File_types.Bad_Initialization if called more than once. *) val init_from_c_files: t list -> unit (** Initialize the cil file representation of the current project. Should be called at most once per project. @raise File_types.Bad_Initialization if called more than once. @plugin development guide *) val init_project_from_cil_file: Project.t -> Cil_types.file -> unit (** Initialize the cil file representation with the given file for the given project from the current one. Should be called at most once per project. @raise File_types.Bad_Initialization if called more than once. @plugin development guide *) val init_project_from_visitor: ?reorder:bool -> Project.t -> Visitor.frama_c_visitor -> unit (** [init_project_from_visitor prj vis] initialize the cil file representation of [prj]. [prj] must be essentially empty: it can have some options set, but not an existing cil file; [proj] is filled using [vis], which must be a copy visitor that puts its results in [prj]. if [reorder] is [true] (default is [false]) the new AST in [prj] will be reordered. @since Oxygen-20120901 @modify Fluorine-20130401 added reorder optional argument @plugin development guide *) val create_project_from_visitor: ?reorder:bool -> ?last:bool -> string -> (Project.t -> Visitor.frama_c_visitor) -> Project.t (** Return a new project with a new cil file representation by visiting the file of the current project. If [reorder] is [true], the globals in the AST of the new project are reordered (default is [false]). If [last] is [true] (by default), remember than the returned project is the last created one. The visitor is responsible to avoid sharing between old file and new file (i.e. it should use {!Cil.copy_visit} at some point). @raise File_types.Bad_Initialization if called more than once. @since Beryllium-20090601-beta1 @modify Fluorine-20130401 added [reorder] optional argument @modify Sodium-20150201 added [last] optional argument @plugin development guide *) val create_rebuilt_project_from_visitor: ?reorder:bool -> ?last:bool -> ?preprocess:bool -> string -> (Project.t -> Visitor.frama_c_visitor) -> Project.t (** Like {!create_project_from_visitor}, but the new generated cil file is generated into a temp .i or .c file according to [preprocess], then re-built by Frama-C in the returned project. For instance, use this function if the new cil file contains a constructor {!GText} as global. Note that the generation of a preprocessed C file may fail in some cases (e.g. if it includes headers already included). Thus the generated file is NOT preprocessed by default. @raise File_types.Bad_Initialization if called more than once. @since Nitrogen-20111001 @modify Fluorine-20130401 added reorder optional argument *) val prepare_cil_file: Cil_types.file -> unit val files_pre_register_state: State.t val init_from_cmdline: unit -> unit (** Initialize the cil file representation with the file given on the command line. Should be called at most once per project. @raise File_types.Bad_Initialization if called more than once. @plugin development guide *) val reorder_ast: unit -> unit (** reorder globals so that all uses of an identifier are preceded by its declaration. This may introduce new declarations in the AST. @since Oxygen-20120901 *) val reorder_custom_ast: Cil_types.file -> unit (** @since Neon-20140301 *) (* ************************************************************************* *) (** {2 Pretty printing} *) (* ************************************************************************* *) val pretty_machdep : ?fmt:Format.formatter -> ?machdep:Cil_types.mach -> unit -> unit (** Prints the associated [machdep], or the current one in current project by default. Default output formatter is [Log.print_on_output]. *) val pretty_ast : ?prj:Project.t -> ?fmt:Format.formatter -> unit -> unit (** Print the project CIL file on the given Formatter. The default project is the current one. The default formatter is [Kernel.CodeOutput.get_fmt ()]. @raise File_types.Bad_Initialization if the file is not initialized. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/filecheck.ml0000666000000000000000000015744013571573400021773 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype let is_admissible_conversion e ot nt = let ot' = Cil.typeDeepDropAllAttributes ot in let nt' = Cil.typeDeepDropAllAttributes nt in not (Cil.need_cast ot' nt') || (match e.enode, Cil.unrollType nt with | Const(CEnum { eihost = ei }), TEnum(ei',_) -> ei.ename = ei'.ename | _ -> false) let pretty_logic_var_kind fmt = function | LVGlobal -> Format.pp_print_string fmt "global logic declaration" | LVC -> Format.pp_print_string fmt "C variable" | LVFormal -> Format.pp_print_string fmt "formal parameter" | LVQuant -> Format.pp_print_string fmt "quantified variable" | LVLocal -> Format.pp_print_string fmt "local parameter" module Base_checker = struct class check ?(is_normalized=true) what : Visitor.frama_c_visitor = let check_abort fmt = Kernel.fatal ~current:true ("[AST Integrity Check]@ %s@ " ^^ fmt) what in let abort_if cond = if cond then check_abort else Pretty_utils.nullprintf in object(self) inherit Visitor.frama_c_inplace as plain val known_enuminfos = Enuminfo.Hashtbl.create 7 val known_enumitems = Enumitem.Hashtbl.create 7 val known_loop_annot_id = Hashtbl.create 7 val known_code_annot_id = Hashtbl.create 7 val known_fields = Fieldinfo.Hashtbl.create 7 val known_compinfos = Compinfo.Hashtbl.create 7 val known_stmts = Stmt.Hashtbl.create 7 val known_vars = Varinfo.Hashtbl.create 7 val known_logic_info = Logic_var.Hashtbl.create 7 val mutable local_vars = Varinfo.Set.empty val known_logic_vars = Logic_var.Hashtbl.create 7 val switch_cases = Stmt.Hashtbl.create 7 val unspecified_sequence_calls = Stack.create () val mutable labelled_stmt = [] val mutable logic_labels = [] val mutable globals_functions = Varinfo.Set.empty val mutable local_statics = Varinfo.Set.empty val mutable globals_vars = Varinfo.Set.empty val mutable return_stmt = None val quant_orig = Stack.create () val behavior_stack = Stack.create () method private push_behavior_stack () = Stack.push (Datatype.String.Set.empty) behavior_stack method private pop_behavior_stack () = ignore (Stack.pop behavior_stack) method private add_behavior_stack_name b = let current = Stack.pop behavior_stack in Stack.push (Datatype.String.Set.add b current) behavior_stack method private add_spec_behavior_names spec = List.iter (fun b -> self#add_behavior_stack_name b.b_name) spec.spec_behavior method private mem_behavior_stack_name b = try Stack.iter (fun s -> if Datatype.String.Set.mem b s then raise Exit) behavior_stack; false with Exit -> true method private remove_globals_function vi = globals_functions <- Varinfo.Set.remove vi globals_functions method private remove_globals_var vi = globals_vars <- Varinfo.Set.remove vi globals_vars method private add_local_static vi = local_statics <- Varinfo.Set.add vi local_statics method private remove_local_static vi = local_statics <- Varinfo.Set.remove vi local_statics method! venuminfo ei = Enuminfo.Hashtbl.add known_enuminfos ei ei; Cil.DoChildren method! venumitem ei = let orig = try Enuminfo.Hashtbl.find known_enuminfos ei.eihost with Not_found -> check_abort "Unknown enuminfo %s" ei.eihost.ename in if orig != ei.eihost then check_abort "Item %s is not tied correctly to its enuminfo %s" ei.einame ei.eihost.ename; Enumitem.Hashtbl.add known_enumitems ei ei; Cil.DoChildren method private remove_unspecified_sequence_calls s = Stack.iter (fun calls -> calls:= Stmt.Set.remove s !calls) unspecified_sequence_calls method! vvdec v = Kernel.debug ~dkey:Kernel.dkey_check "Declaration of %s(%d)" v.vname v.vid; if Varinfo.Hashtbl.mem known_vars v then (let v' = Varinfo.Hashtbl.find known_vars v in if v != v' then (* we can see the declaration twice (decl and def in fact) *) (check_abort "variables %s and %s have the same id (%d)" v.vname v'.vname v.vid)) else Varinfo.Hashtbl.add known_vars v v; match v.vlogic_var_assoc with | None -> Cil.DoChildren | Some ({ lv_origin = Some v'} as lv) when v == v' -> Kernel.debug ~dkey:Kernel.dkey_check "var %s(%d) has an associated %s(%d)" v.vname v.vid lv.lv_name lv.lv_id; (match lv.lv_type with | Ctype t -> if not (Cil_datatype.TypNoUnroll.equal t v.vtype) then check_abort "C variable %s and its associated variable do not have the \ same type:@\nC type is %a@\nLogic type is %a" v.vname Cil_datatype.Typ.pretty v.vtype Cil_datatype.Typ.pretty t | lt -> check_abort "Logic variable %s is associated to a C variable but has \ a purely logic type, %a@." lv.lv_name Cil_datatype.Logic_type.pretty lt); Cil.DoChildren | Some lv -> (check_abort "C variable %s is not properly referenced by its \ associated logic variable %s" v.vname lv.lv_name) method! vvrbl v = let not_shared () = check_abort "variable %s is not shared between definition and use" v.vname in let unknown () = check_abort "variable %s(%d) is not declared" v.vname v.vid in if not v.vglob || not (Ast_info.is_frama_c_builtin v.vname) then (try if Varinfo.Hashtbl.find known_vars v != v then not_shared () with Not_found -> unknown () ); Cil.DoChildren method! vquantifiers l = let orig = try Stack.top quant_orig with Stack.Empty -> check_abort "Internal error of check visitor: don't know which origin a logic \ variable should be checked against" in List.iter (fun lv -> if lv.lv_kind <> orig then check_abort "logic variable %a is flagged as %a but declared as a %a" Printer.pp_logic_var lv pretty_logic_var_kind lv.lv_kind pretty_logic_var_kind orig) l; Cil.DoChildren method! vlogic_var_decl lv = Logic_var.Hashtbl.add known_logic_vars lv lv; match lv.lv_origin with (* lvkind for purely logical variables is checked at the parent level. *) | None -> Cil.DoChildren | Some v when lv.lv_kind <> LVC -> check_abort "logic variable %a as an associated variable %a, but is not \ flagged as having a C origin" Printer.pp_logic_var lv Printer.pp_varinfo v | Some { vlogic_var_assoc = Some lv' } when lv == lv' -> ignore Visitor.(visitFramacLogicType (self:>frama_c_visitor) lv.lv_type); (* DoChildren on initialized local variables would fail, as it performs a vvrbl on the C variable, before having reached the initializer. *) Cil.SkipChildren | Some v -> check_abort "logic variable %a is not properly referenced by the original \ C variable %a" Printer.pp_logic_var lv Printer.pp_varinfo v method! vlogic_var_use v = if v.lv_name <> "\\exit_status" then begin if Logic_env.is_builtin_logic_function v.lv_name then begin match Logic_env.find_all_logic_functions v.lv_name with | [] -> check_abort "No logic variable registered for built-in %s" v.lv_name | _ :: _ as l -> if not (List.exists (fun x -> x.l_var_info == v) l) then check_abort "Built-in logic variable %s information is not shared \ between environment and use" v.lv_name end else begin let unknown () = check_abort "logic variable %s (%d) is not declared" v.lv_name v.lv_id in let not_shared () = check_abort "logic variable %s (%d) is not shared between definition and use" v.lv_name v.lv_id in try if Logic_var.Hashtbl.find known_logic_vars v != v then not_shared () with Not_found -> unknown () end end; Cil.DoChildren method! vfunc f = self#push_behavior_stack (); (* Initial AST does not have kf *) if is_normalized then begin let kf = Extlib.the self#current_kf in if not (Kernel_function.is_definition kf) then check_abort "Kernel function %a is supposed to be a prototype, but it has a body" Kernel_function.pretty kf; if Kernel_function.get_definition kf != f then check_abort "Body of %a is not shared between kernel function and AST" Kernel_function.pretty kf; return_stmt <- Some (Kernel_function.find_return kf); let spec = Annotations.funspec ~populate:false kf in self#add_spec_behavior_names spec; end else begin self#add_spec_behavior_names f.sspec; end; labelled_stmt <- []; Stmt.Hashtbl.clear known_stmts; Stmt.Hashtbl.clear switch_cases; local_vars <- Varinfo.Set.empty; List.iter (fun x -> local_vars <- Varinfo.Set.add x local_vars) f.slocals; let print_stmt fmt stmt = Format.fprintf fmt "@[%a (%d)@]" Printer.pp_stmt stmt stmt.sid in let check f = if Stmt.Hashtbl.length switch_cases <> 0 then begin Stmt.Hashtbl.iter (fun x _ -> check_abort "In function %a, statement %a \ does not appear in body of switch while porting a \ case or default label." Printer.pp_varinfo f.svar print_stmt x) switch_cases end; List.iter (fun stmt -> try let stmt' = Stmt.Hashtbl.find known_stmts stmt in if stmt' != stmt then check_abort "Label @[%a@]@ in function %a@ \ is not linked to the correct statement:@\n\ statement in AST is %a@\n\ statement referenced in goto or \\at is %a" Printer.pp_stmt {stmt with skind = Instr (Skip (Stmt.loc stmt)) } Printer.pp_varinfo f.svar print_stmt stmt' print_stmt stmt with Not_found -> check_abort "Label @[%a@]@ in function %a@ \ does not refer to an existing statement" Printer.pp_stmt {stmt with skind = Instr (Skip (Stmt.loc stmt)) } Printer.pp_varinfo f.svar) labelled_stmt; labelled_stmt <- []; (match return_stmt with | None -> () | Some _ -> (* can only happen in normalized mode. *) check_abort "Function %a does not have a return statement in its body" Kernel_function.pretty (Extlib.the self#current_kf)); let check_one_stmt stmt _ = let check_cfg_edge stmt' = try let ast_stmt = Stmt.Hashtbl.find known_stmts stmt' in if ast_stmt != stmt' then check_abort "cfg info of statement %a in function %a \ is not linked to correct statement:@\n\ statement in AST is %a@\n\ statement referenced in cfg info is %a" print_stmt stmt Printer.pp_varinfo f.svar print_stmt ast_stmt print_stmt stmt' with Not_found -> check_abort "cfg info of statement %a in function %a does not \ refer to an existing statement.@\n\ Referenced statement is %a" print_stmt stmt Printer.pp_varinfo f.svar print_stmt stmt' in List.iter check_cfg_edge stmt.succs; List.iter check_cfg_edge stmt.preds; match stmt.skind with | Return _ | Throw _ -> if stmt.succs <> [] then check_abort "return statement %a in function %a \ has successors:@\n%a" print_stmt stmt Printer.pp_varinfo f.svar (Pretty_utils.pp_list ~sep:"@\n" print_stmt) stmt.succs | Instr(Call (_, called, _, _)) when Cil.typeHasAttribute "noreturn" (Cil.typeOf called) -> if stmt.succs <> [] then check_abort "exit statement %a in function %a \ has successors:@\n%a" print_stmt stmt Printer.pp_varinfo f.svar (Pretty_utils.pp_list ~sep:"@\n" print_stmt) stmt.succs | Instr(Call (_, { enode = Lval(Var called,NoOffset)}, _, _)) when Cil.hasAttribute "noreturn" called.vattr -> if stmt.succs <> [] then check_abort "exit statement %a in function %a \ has successors:@\n%a" print_stmt stmt Printer.pp_varinfo f.svar (Pretty_utils.pp_list ~sep:"@\n" print_stmt) stmt.succs | _ -> (* unnormalized code may not contain return statement, leaving perfectly normal statements without succs. *) if is_normalized && stmt.succs = [] then check_abort "statement %a in function %a has no successor." print_stmt stmt Printer.pp_varinfo f.svar in Stmt.Hashtbl.iter check_one_stmt known_stmts; Stmt.Hashtbl.clear known_stmts; if not (Varinfo.Set.is_empty local_vars) then begin check_abort "Local variables %a of function %a are not part of any block" (Pretty_utils.pp_list ~sep:",@ " Printer.pp_varinfo) (Varinfo.Set.elements local_vars) Printer.pp_varinfo f.svar end; self#pop_behavior_stack (); f in Cil.DoChildrenPost check method private check_label s = let ok = List.exists (function Label _ -> true | _ -> false) !s.labels in if not ok then check_abort "@[Statement is referenced by \\at or goto without \ having a label:@\n%a@]" Printer.pp_stmt !s ; labelled_stmt <- !s :: labelled_stmt method private check_try_catch_decl (decl,_) = match decl with | Catch_exn(v,l) -> self#check_local_var v; List.iter (fun (v,_) -> self#check_local_var v) l | Catch_all -> () method! vstmt_aux s = Stmt.Hashtbl.add known_stmts s s; Stmt.Hashtbl.remove switch_cases s; self#push_behavior_stack (); self#remove_unspecified_sequence_calls s; if is_normalized then begin let contracts = Annotations.code_annot ~filter:Logic_utils.is_contract s in List.iter (function | {annot_content = AStmtSpec(_,spec)} -> self#add_spec_behavior_names spec | _ -> assert false (* filter should prevent anything else. *)) contracts; let kf = Extlib.the self#current_kf in let s',kf' = try Kernel_function.find_from_sid s.sid with Not_found -> check_abort "Statement %a of function %s is unknown in internal tables" Printer.pp_stmt s (Kernel_function.get_name kf) in if s != s' then check_abort "Statement %a of function %s \ is not shared with internal tables" Printer.pp_stmt s (Kernel_function.get_name kf); if kf != kf' then check_abort "Statement %a of function %s is registered with a wrong kf" Printer.pp_stmt s (Kernel_function.get_name kf); let blocks = Kernel_function.find_all_enclosing_blocks s in let b = Extlib.last blocks in let body = Kernel_function.get_definition kf in if b != body.sbody then check_abort "In function %s, statement %a is supposed to belong \ to an outermost block different from function's body" (Kernel_function.get_name kf) Printer.pp_stmt s end; let post_action s = self#pop_behavior_stack (); s in (match s.skind with | Goto (l,_) -> self#check_label l; Cil.ChangeDoChildrenPost(s,post_action) | Switch(_,_,cases,loc) -> List.iter (fun s -> Stmt.Hashtbl.add switch_cases s loc) cases; Cil.ChangeDoChildrenPost(s,post_action) | UnspecifiedSequence seq -> let calls = List.fold_left (fun acc (_,_,_,_,calls) -> List.fold_left (fun acc x -> Stmt.Set.add !x acc) acc calls) Stmt.Set.empty seq in Stack.push (ref calls) unspecified_sequence_calls; let f s = let calls = Stack.pop unspecified_sequence_calls in if Stmt.Set.is_empty !calls then post_action s else check_abort "@[Calls referenced in unspecified sequence \ are not in the AST:@[%a@]@]" (Pretty_utils.pp_list ~sep:"@ " Printer.pp_stmt) (Stmt.Set.elements !calls) in Cil.ChangeDoChildrenPost(s,f) | If (_,bt,be,_) -> begin (** Check that we have 2 successors, in the right order (then before else) *) match s.succs with | [st; se] -> begin (match bt.bstmts with | st' :: _ -> abort_if (not (st == st')) "Invalid 'then' successor for If" | _ -> ()); (match be.bstmts with | se' :: _ -> abort_if (not (se == se')) "Invalid 'else' successor for If" | _ -> ()); Cil.ChangeDoChildrenPost(s,post_action) end | l -> check_abort "If with %d successors" (List.length l) end | Loop _ -> let old_labels = logic_labels in logic_labels <- Logic_const.(loop_current_label :: loop_entry_label :: logic_labels); Cil.ChangeDoChildrenPost (s, fun s -> logic_labels <- old_labels; post_action s) | TryCatch(_,c,_) -> List.iter self#check_try_catch_decl c; Cil.ChangeDoChildrenPost(s, post_action) | Return _ -> if is_normalized then begin match return_stmt with | None -> check_abort "Found a second return statement in body of function %a" Kernel_function.pretty (Extlib.the self#current_kf) | Some s' when s != s' -> check_abort "Function %a is supposed to have as return statement %d:@\n%a@\n\ Found in its body statement %d:@\n%a@\n" Kernel_function.pretty (Extlib.the self#current_kf) s'.sid Printer.pp_stmt s' s.sid Printer.pp_stmt s | Some _ -> return_stmt <- None end; Cil.ChangeDoChildrenPost(s,post_action) | _ -> Cil.ChangeDoChildrenPost (s,post_action)); method private check_local_var v = if Varinfo.Set.mem v local_vars then begin local_vars <- Varinfo.Set.remove v local_vars; end else begin check_abort "In function %a, variable %a(%d) is supposed to be local to a block \ but not mentioned in the function's locals." Printer.pp_varinfo (Extlib.the self#current_func).svar Printer.pp_varinfo v v.vid end method private check_local_static v = let prefix fmt = Format.fprintf fmt "Local variable %a(%d) in function %a" Printer.pp_varinfo v v.vid Printer.pp_varinfo (Extlib.the self#current_func).svar in if not v.vglob then check_abort "%t is supposed to be static, but varinfo has automatic storage." prefix; if not (Cil.hasAttribute Cabs2cil.fc_local_static v.vattr) then check_abort "%t is declared as a global static." prefix; ignore (self#vvrbl v); (* Ensure that the variable was not already claimed by another block. *) if not (Cil_datatype.Varinfo.Set.mem v local_statics) then check_abort "%t is supposed to be in scope in two blocks" prefix; self#remove_local_static v (* Stack of local variables that are supposed to be initialized in each currently opened block (with [bscoping=true]), the top of the stack corresponding to the innermost block. Used to check that these variables have a Local_init instruction in the appropriate block. *) val current_block_vars = Stack.create () method! vblock b = let check_locals b = List.iter (fun v -> if v.vdefined then check_abort "Local variable %a is supposed to be defined, \ but no initializer found in the block where it is in scope" Printer.pp_varinfo v) (Stack.pop current_block_vars); b in List.iter self#check_local_var b.blocals; List.iter self#check_local_static b.bstatics; if b.bscoping then begin Stack.push b.blocals current_block_vars; Cil.DoChildrenPost check_locals end else if b.blocals <> [] then (* non-scoping block mustn't declare locals *) check_abort "Block below is declaring local variables %a, but its attributes \ indicates that it is not used as a scope boundary.@\n%a" (Pretty_utils.pp_list ~sep:", " Printer.pp_varinfo) b.blocals Printer.pp_block b else Cil.DoChildren method! vbehavior b = let vpred p = ignore Visitor.(visitFramacIdPredicate (self:>frama_c_visitor) p) in let vextend b = ignore Visitor.(visitFramacExtended (self:>frama_c_visitor) b) in List.iter vpred b.b_requires; List.iter vpred b.b_assumes; List.iter vextend b.b_extended; let old_labels = logic_labels in logic_labels <- Logic_const.post_label :: logic_labels; List.iter Extlib.(vpred $ snd) b.b_post_cond; ignore Visitor.(visitFramacAssigns (self:>frama_c_visitor) b.b_assigns); ignore Visitor.(visitFramacAllocation (self:>frama_c_visitor) b.b_allocation); logic_labels <- old_labels; Cil.SkipChildren method! vspec _ = let old_labels = logic_labels in logic_labels <- Logic_const.( init_label :: here_label :: pre_label :: old_label :: logic_labels); Cil.DoChildrenPost (fun s -> logic_labels <- old_labels; s) method! vcode_annot ca = if Hashtbl.mem known_code_annot_id ca.annot_id then begin check_abort "duplicated code annotation id: %d@\n%a@\nand@\n%a" ca.annot_id Printer.pp_code_annotation (Hashtbl.find known_code_annot_id ca.annot_id) Printer.pp_code_annotation ca end else Hashtbl.add known_code_annot_id ca.annot_id ca; let old_labels = logic_labels in let my_labels = Logic_const.([init_label; here_label; pre_label]) in let my_labels = match ca.annot_content with | AExtended (_, is_loop, {ext_name}) -> (match Logic_env.extension_category ext_name, is_loop with | Some (Ext_code_annot (Ext_next_stmt | Ext_next_both)), false -> Logic_const.post_label :: my_labels | Some (Ext_code_annot Ext_here), false -> my_labels | Some (Ext_code_annot (Ext_next_loop | Ext_next_both)), true -> Logic_const.loop_current_label :: Logic_const.loop_entry_label :: my_labels | Some (Ext_code_annot (Ext_here | Ext_next_stmt)), true -> Kernel.( warning ~wkey:wkey_acsl_extension "%s is a code annotation extension, \ but used as a loop annotation" ext_name); my_labels | Some (Ext_code_annot (Ext_next_loop)), false -> Kernel.( warning ~wkey:wkey_acsl_extension "%s is a loop annotation extension, \ but used as a code annotation" ext_name; my_labels) | (Some (Ext_contract | Ext_global) | None), _ -> Kernel.( warning ~wkey:wkey_acsl_extension "%s is not a known code annotation extension" ext_name); my_labels) | AAssert _ | AStmtSpec _ | AInvariant _ | AVariant _ | AAssigns _ | AAllocation _ | APragma _ -> my_labels in logic_labels <- my_labels @ logic_labels; (* on non-normalized code, we can't really check the scope of behavior names of statement contracts. *) if is_normalized then begin match ca.annot_content with | AAssert(bhvs,_,_) | AStmtSpec(bhvs,_) | AInvariant (bhvs,_,_) | AAssigns(bhvs,_) | AAllocation(bhvs,_) | AExtended (bhvs,_,_) -> List.iter (fun b -> if not (self#mem_behavior_stack_name b) then check_abort "code annotation %a is restricted to unknown behavior %s" Printer.pp_code_annotation ca b) bhvs | _ -> () end; Cil.DoChildrenPost (fun ca -> logic_labels <- old_labels; ca) method! voffs = function | NoOffset -> Cil.SkipChildren | Index _ -> Cil.DoChildren | Field(fi,_) -> begin try if not (fi == Fieldinfo.Hashtbl.find known_fields fi) then (check_abort "field %s of type %s(%d) is not \ shared between declaration and use" fi.fname fi.fcomp.cname fi.fcomp.ckey) with Not_found -> (check_abort "field %s of type %s(%d) is unbound in the AST" fi.fname fi.fcomp.cname fi.fcomp.ckey) end; Cil.DoChildren method! vterm_offset = function | TNoOffset -> Cil.SkipChildren | TIndex _ -> Cil.DoChildren | TModel(mi,_) -> (try let mi' = Logic_env.find_model_field mi.mi_name mi.mi_base_type in if mi' != mi then begin check_abort "model field %s of type %a is not shared \ between declaration and use" mi.mi_name Printer.pp_typ mi.mi_base_type end with Not_found -> check_abort "unknown model field %s in type %a" mi.mi_name Printer.pp_typ mi.mi_base_type); Cil.DoChildren | TField(fi,_) -> begin try if not (fi == Fieldinfo.Hashtbl.find known_fields fi) then (check_abort "field %s of type %s is not \ shared between declaration and use" fi.fname fi.fcomp.cname) with Not_found -> (check_abort "field %s of type %s(%d) is unbound in the AST" fi.fname fi.fcomp.cname fi.fcomp.ckey) end; Cil.DoChildren method! vterm_lhost = function | TResult t when is_normalized -> (* if not normalized, contracts are visited while kf is not set *) (match self#current_kf with | None -> check_abort "\\result found outside of a function contract" | Some kf -> let t1 = Kernel_function.get_return_type kf in if Cil.isVoidType t1 then check_abort "\\result found in a contract for function %a that returns void" Kernel_function.pretty kf; if not (Cil_datatype.TypNoUnroll.equal t t1) then check_abort "\\result of type %a found in a contract for function %a that \ returns %a" Cil_datatype.Typ.pretty t Kernel_function.pretty kf Cil_datatype.Typ.pretty t1 ); Cil.DoChildren | _ -> Cil.DoChildren method private check_ei: 'a. enumitem -> 'a Cil.visitAction = fun ei -> try let ei' = Enumitem.Hashtbl.find known_enumitems ei in if ei != ei' then check_abort "enumitem %s is not shared between declaration and use" ei.einame; Cil.DoChildren with Not_found -> check_abort "enumitem %s is used but not declared" ei.einame (* can't use vlogic_label, as it also visits the declared labels in Tapp and Papp. *) method private check_logic_label lab = match lab with | StmtLabel _ -> () | FormalLabel _ | BuiltinLabel _ -> let is_declared = List.exists (fun x -> Cil_datatype.Logic_label.equal x lab) logic_labels in if not is_declared then check_abort "Logic label %a is not declared in this scope" Printer.pp_logic_label lab method private check_logic_app li labs args = let expect = List.length li.l_profile in let actual = List.length args in let pred_or_func = match li.l_type with | None -> "Predicate" | Some _ -> "Logic function" in if not (expect = actual) then check_abort "%s %a expects %d arguments but is used with %d" pred_or_func Printer.pp_logic_var li.l_var_info expect actual; List.iter2 (fun lv arg -> if not (Logic_utils.is_instance_of li.l_tparams arg.term_type lv.lv_type) then check_abort "term %a has type %a, but is used as a parameter of type %a" Printer.pp_term arg Printer.pp_logic_type arg.term_type Printer.pp_logic_type lv.lv_type) li.l_profile args; let lab_declared = List.length li.l_labels in let lab_provided = List.length labs in if not (lab_declared = lab_provided) then check_abort "%s %a expects %d logic labels, but is used with %d" pred_or_func Printer.pp_logic_var li.l_var_info lab_declared lab_provided; List.iter (fun lab -> self#check_logic_label lab) labs method! vterm t = match t.term_node with | TLval lv -> (match lv with | TVar lvi, TNoOffset -> if lvi.lv_kind = LVGlobal && not (Logic_const.is_exit_status t) then begin try let li = Logic_env.find_logic_cons lvi in (match li.l_type with | None -> check_abort "Trying to use predicate %a as a term" Printer.pp_logic_var lvi | Some typ -> if not (Logic_utils.is_instance_of li.l_tparams t.term_type typ) then check_abort "%a is declared with type %a. It cannot be used as \ a term of type %a" Printer.pp_logic_var lvi Printer.pp_logic_type typ Printer.pp_logic_type t.term_type) with Not_found -> check_abort "%a is supposed to be a global logic constant, \ but cannot be found in the logic environment." Printer.pp_logic_var lvi end | _ -> ()); begin match t.term_type with | Ctype ty -> if (Cil.isVoidType ty) then check_abort "logic term with void type: %a" Printer.pp_term t; Cil.DoChildren | _ -> Cil.DoChildren end | TConst (LEnum ei) -> self#check_ei ei | Tif (_,t1,t2) -> if not (Cil_datatype.Logic_type.equal t1.term_type t2.term_type) then check_abort "Conditional operator %a@\nFirst branch has type %a@\n\ Second branch has type %a" Printer.pp_term t Printer.pp_logic_type t1.term_type Printer.pp_logic_type t2.term_type; Cil.DoChildren | Tlet(li,_) -> if li.l_var_info.lv_kind <> LVLocal then check_abort "Local logic variable %a is flagged with wrong origin" Printer.pp_logic_var li.l_var_info; Cil.DoChildren | Tlambda _ -> Stack.push LVFormal quant_orig; Cil.DoChildrenPost (fun t -> ignore (Stack.pop quant_orig); t) | Tcomprehension _ -> Stack.push LVQuant quant_orig; Cil.DoChildrenPost (fun t -> ignore (Stack.pop quant_orig); t) | Tapp(li,labs,args) -> (match li.l_type with | Some ty when Logic_utils.is_instance_of li.l_tparams t.term_type ty -> () | Some ty -> check_abort "logic function %a has return type %a, \ but application %a has type %a" Printer.pp_logic_var li.l_var_info Printer.pp_logic_type ty Printer.pp_term t Printer.pp_logic_type t.term_type | None -> check_abort "predicate %a is used as a logic function" Printer.pp_logic_var li.l_var_info); self#check_logic_app li labs args; Cil.DoChildren | Tat(_,l) | Tbase_addr(l,_) | Toffset(l,_) | Tblock_length(l,_) -> self#check_logic_label l; Cil.DoChildren | TBinOp (bop, lterm, _) -> begin match bop, Logic_utils.isLogicPointerType lterm.term_type with | (PlusA | MinusA), true -> check_abort "PlusA/MinusA operator with pointer argument @[(%a)@]" Printer.pp_logic_type lterm.term_type | (PlusPI | MinusPI), false -> check_abort "PlusPI/MinusPI with non-pointer argument @[(%a)@]" Printer.pp_logic_type lterm.term_type | _ -> Cil.DoChildren end | _ -> Cil.DoChildren method! vinitoffs = self#voffs method! vcompinfo c = Kernel.debug ~dkey:Kernel.dkey_check "Checking composite type %s(%d)" c.cname c.ckey; Compinfo.Hashtbl.add known_compinfos c c; Kernel.debug ~dkey:Kernel.dkey_check "Adding fields for type %s(%d)" c.cname c.ckey; List.iter (fun x -> Fieldinfo.Hashtbl.add known_fields x x) c.cfields; Cil.DoChildren method! vfieldinfo f = Kernel.debug ~dkey:Kernel.dkey_check "Check field %s of type %s" f.fname f.fcomp.cname; try let c = Compinfo.Hashtbl.find known_compinfos f.fcomp in if f.fcomp != c then check_abort "field %s of type %s does not refer to the appropriate compinfo node" f.fname f.fcomp.cname; Cil.DoChildren with Not_found -> check_abort "field %s belongs to an unknown type %s" f.fname f.fcomp.cname (* In non-normalized mode, we can't rely on the Globals tables used by the normal Frama-C's vglob: jump directly to vglob_aux. *) method! vglob g = if is_normalized then plain#vglob g else self#vglob_aux g method! vglob_aux g = match g with | GFunDecl(_,v,_) -> self#remove_globals_function v; if not (Cil.isFunctionType v.vtype) then check_abort "Function %a has non-function type" Printer.pp_varinfo v; if is_normalized then begin if v.vdefined && not (Kernel_function.is_definition (Globals.Functions.get v)) then check_abort "Function %s(%d) is supposed to be defined, \ but not registered as such" v.vname v.vid; if not v.vdefined && Kernel_function.is_definition (Globals.Functions.get v) then check_abort "Function %s has a registered definition, \ but is supposed to be only declared" v.vname end; (match Cil.splitFunctionType v.vtype with | (_,None,_,_) -> () | (_,Some l,_,_) -> if is_normalized then begin try let l' = Cil.getFormalsDecl v in if List.length l <> List.length l' then check_abort "prototype %s has %d arguments but is associated to \ %d formals in FormalsDecl" v.vname (List.length l) (List.length l') else let kf = Globals.Functions.get v in let l'' = Kernel_function.get_formals kf in if List.length l' <> List.length l'' then check_abort "mismatch between FormalsDecl and Globals.Functions \ on prototype %s." v.vname; if Kernel_function.is_definition kf then begin List.iter2 (fun v1 v2 -> if v1 != v2 then check_abort "formal parameters of %s are not shared \ between declaration and definition" v.vname) l' l'' end with Not_found -> check_abort "prototype %s (%d) has no associated \ parameters in FormalsDecl" v.vname v.vid end); Cil.DoChildren | GVarDecl(v,_) | GVar(v,_,_) -> if Cil.isFunctionType v.vtype then check_abort "Variable %a has function type" Printer.pp_varinfo v; self#remove_globals_var v; if (Cil.hasAttribute Cabs2cil.fc_local_static v.vattr) then self#add_local_static v; Cil.DoChildren | GFun (f,_) -> if not (Cil.isFunctionType f.svar.vtype) then check_abort "Function %a has non-function type" Printer.pp_varinfo f.svar; if not f.svar.vdefined then check_abort "Function %s has a definition, but is considered as not defined" f.svar.vname; self#remove_globals_function f.svar; if is_normalized then begin try let kf = Globals.Functions.get f.svar in if not (Kernel_function.is_definition kf) then check_abort "Function %s has a definition in the AST, but is not defined \ according to Globals.Functions" f.svar.vname; let f' = Kernel_function.get_definition kf in if f != f' then check_abort "Definition of function %s is not shared \ between AST and Globals.Functions" f.svar.vname; with Not_found -> check_abort "Function %s is present in the AST but not in Globals.Functions" f.svar.vname end; Cil.DoChildren | _ -> Cil.DoChildren method! vfile _ = let print_var_vid fmt vi = Format.fprintf fmt "%a(%d)" Printer.pp_varinfo vi vi.vid in let check_end f = if not (Cil_datatype.Varinfo.Set.is_empty globals_functions) || not (Cil_datatype.Varinfo.Set.is_empty globals_vars) then begin check_abort "Following functions and variables are present \ in global tables but not in AST:%a%a" (Pretty_utils.pp_list ~pre:"@\nFunctions:@\n" ~sep:"@ " print_var_vid) (Cil_datatype.Varinfo.Set.elements globals_functions) (Pretty_utils.pp_list ~pre:"@\nVariables:@\n" ~sep:"@ " print_var_vid) (Cil_datatype.Varinfo.Set.elements globals_vars) end; if not (Cil_datatype.Varinfo.Set.is_empty local_statics) then begin check_abort "Following variables are supposed to be local static variables, \ but haven't been found in any block:@\n%a" (Pretty_utils.pp_list ~sep:"@ " print_var_vid) (Cil_datatype.Varinfo.Set.elements local_statics) end; f in Cil.DoChildrenPost check_end method! vannotation a = match a with | Dfun_or_pred (li,_) | Dinvariant (li,_) | Dtype_annot (li,_) -> if not (List.memq li (Logic_env.find_all_logic_functions li.l_var_info.lv_name)) then check_abort "Global logic function %a information is not in the environment" Printer.pp_logic_var li.l_var_info; if li.l_var_info.lv_kind <> LVGlobal then check_abort "Global logic function %a is flagged with a wrong origin" Printer.pp_logic_var li.l_var_info; (match li.l_type, li.l_profile with | Some ty, [] -> if not (Cil_datatype.Logic_type.equal ty li.l_var_info.lv_type) then check_abort "Logic constant %a is declared with type %a, but \ its logic_var has type %a" Printer.pp_logic_var li.l_var_info Printer.pp_logic_type ty Printer.pp_logic_type li.l_var_info.lv_type | None, _ | Some _, _::_ -> ()); Cil.DoChildren | Dmodel_annot (mi, _) -> (try let mi' = Logic_env.find_model_field mi.mi_name mi.mi_base_type in if mi != mi' then check_abort "field %s of type %a is not shared between \ declaration and environment" mi.mi_name Printer.pp_typ mi.mi_base_type; with Not_found -> check_abort "field %s of type %a is not present in environment" mi.mi_name Printer.pp_typ mi.mi_base_type); Cil.DoChildren | Dlemma(_,_,labels,_,_,_,_) -> let old_labels = logic_labels in logic_labels <- labels @ logic_labels; Cil.DoChildrenPost (fun g -> logic_labels <- old_labels; g) | Dtype (t,_) -> let t' = try Logic_env.find_logic_type t.lt_name with Not_found -> check_abort "logic type %s is not present in the environment" t.lt_name in if t != t' then check_abort "Definition of logic type %s is not shared between \ AST and environment" t.lt_name; let treat_cons c = let c' = try Logic_env.find_logic_ctor c.ctor_name with Not_found -> check_abort "logic constructor %s is not present in the environment" c.ctor_name in if c != c' then check_abort "Definition of logic constructor %s is not shared between \ AST and environment" c.ctor_name in (match t.lt_def with | Some (LTsum l) -> List.iter treat_cons l | Some (LTsyn _) -> () | None -> ()); Cil.DoChildren | _ -> Cil.DoChildren method! vlogic_label = function | StmtLabel l -> self#check_label l; Cil.SkipChildren | _ -> Cil.DoChildren method! vpredicate_node = function | Papp(li,labs,args) -> (match li.l_type with | None -> () | Some _ -> check_abort "Logic function %a is used as a predicate" Printer.pp_logic_var li.l_var_info); self#check_logic_app li labs args; Cil.DoChildren | Plet(li,_) -> if li.l_var_info.lv_kind <> LVLocal then check_abort "Local logic variable %a is flagged with wrong origin" Printer.pp_logic_var li.l_var_info; Cil.DoChildren | Pforall _ | Pexists _ -> Stack.push LVQuant quant_orig; Cil.DoChildrenPost (fun p -> ignore (Stack.pop quant_orig); p) | Pat(_,l) | Pvalid_read(l,_) | Pvalid(l,_) | Pinitialized(l,_) | Pdangling(l,_) | Pallocable(l,_) | Pfreeable(l,_) -> self#check_logic_label l; Cil.DoChildren | Pfresh(l1,l2,_,_) -> self#check_logic_label l1; self#check_logic_label l2; Cil.DoChildren | _ -> Cil.DoChildren method private vinductive_case (_,labels,_,p) = let old_labels = logic_labels in logic_labels <- labels @ logic_labels; ignore (Visitor.visitFramacPredicate (self:>Visitor.frama_c_visitor) p); logic_labels <- old_labels method! vlogic_info_decl li = Logic_var.Hashtbl.add known_logic_info li.l_var_info li; List.iter (fun lv -> if lv.lv_kind <> LVFormal then check_abort "Formal parameter %a of logic function/predicate %a is \ flagged with wrong origin" Printer.pp_logic_var lv Printer.pp_logic_var li.l_var_info) li.l_profile; match li.l_body with | LBinductive l -> List.iter self#vinductive_case l; Cil.SkipChildren | _ -> let old_labels = logic_labels in logic_labels <- li.l_labels @ logic_labels; Cil.DoChildrenPost (fun li -> logic_labels <- old_labels; li) method! vlogic_info_use li = let unknown () = check_abort "logic function %s has no information" li.l_var_info.lv_name in let not_shared () = check_abort "logic function %s information is not shared between declaration and \ use" li.l_var_info.lv_name in if Logic_env.is_builtin_logic_function li.l_var_info.lv_name then begin if not (List.memq li (Logic_env.find_all_logic_functions li.l_var_info.lv_name)) then check_abort "Built-in logic function %s information is not shared \ between environment and use" li.l_var_info.lv_name end else begin try if not (li == Logic_var.Hashtbl.find known_logic_info li.l_var_info) then not_shared () with Not_found -> unknown () end; Cil.DoChildren val accept_array = Stack.create () method private accept_array = function | SizeOfE _ | AlignOfE _ | CastE _ -> true | _ -> false method! vexpr e = if Cil.typeHasAttribute "volatile" (Cil.typeOf e) then begin Kernel.warning ~wkey:Kernel.wkey_check_volatile ~current:true "Expression with volatile qualification %a" Printer.pp_exp e end; match e.enode with | Const (CEnum ei) -> self#check_ei ei | Lval lv when Cil.isArrayType (Cil.typeOfLval lv) && (Stack.is_empty accept_array || not (Stack.top accept_array)) -> check_abort "%a is an array, but used as an lval" Printer.pp_lval lv | StartOf lv when not (Cil.isArrayType (Cil.typeOfLval lv)) -> check_abort "%a is supposed to be an array, but has type %a" Printer.pp_lval lv Printer.pp_typ (Cil.typeOfLval lv) | _ -> Stack.push (self#accept_array e.enode) accept_array; Cil.ChangeDoChildrenPost (e, fun e -> ignore (Stack.pop accept_array); e) method private check_initialized_var v = let block_vars = Stack.pop current_block_vars in match List.partition (Cil_datatype.Varinfo.equal v) block_vars with | [_], block_vars -> Stack.push block_vars current_block_vars; Cil_datatype.Varinfo.Hashtbl.add known_vars v v | [], _ -> if Cil_datatype.Varinfo.Hashtbl.mem known_vars v then check_abort "Local variable %a is initialized twice" Printer.pp_varinfo v else check_abort "%a is initialized, but not marked as a local variable \ of the nearest enclosing block" Printer.pp_varinfo v | _, _ -> check_abort "Local variable %a is present several times in block's locals list" Printer.pp_varinfo v method! vinst i = let treat_call lvopt f args _loc = match f.enode with | Lval (Var f, NoOffset) -> let (treturn,targs,is_variadic,_) = Cil.splitFunctionTypeVI f in if Cil.isVoidType treturn && lvopt != None then check_abort "in call %a, assigning result of a function returning void" Printer.pp_instr i; (match lvopt with | None -> () | Some lv -> let tlv = Cil.typeOfLval lv in let tlv = Cil.type_remove_qualifier_attributes tlv in if not (Cabs2cil.allow_return_collapse ~tlv ~tf:treturn) then check_abort "in call %a, cannot implicitly cast from \ function return type %a to type of %a (%a)" Printer.pp_instr i Printer.pp_typ treturn Printer.pp_lval lv Printer.pp_typ tlv); let rec aux l1 l2 = match l1,l2 with | [],[] -> Cil.DoChildren | _::_, [] -> check_abort "call %a has too few arguments" Printer.pp_instr i | [],e::_ -> if is_variadic then Cil.DoChildren else check_abort "call %a has too many arguments, starting from %a" Printer.pp_instr i Printer.pp_exp e | (_,ty1,_)::l1,arg::l2 -> let ty2 = Cil.typeOf arg in if not (is_admissible_conversion arg ty2 ty1) then check_abort "in call %a, arg %a has type %a instead of %a" Printer.pp_instr i Printer.pp_exp arg Printer.pp_typ ty2 Printer.pp_typ ty1; aux l1 l2 in (match targs with | None -> Cil.DoChildren | Some targs -> aux targs args) | _ -> (* indirect call. Can't check coherence with a given kf *) Cil.DoChildren in match i with | Call(lvopt,f,args,loc) -> treat_call lvopt f args loc | Local_init (v, AssignInit _, _) -> self#check_initialized_var v; Cil.DoChildren | Local_init (v, ConsInit(f,args,k),loc) -> self#check_initialized_var v; Cil.treat_constructor_as_func treat_call v f args k loc | Asm(_,_,Some { asm_gotos },_) -> List.iter self#check_label asm_gotos; Cil.DoChildren | _ -> Cil.DoChildren method! vtype ty = match ty with | TArray (_, _, _, la) -> let elt, _ = Cil.splitArrayAttributes la in if elt != [] then Kernel.fatal "Element attribute on array type itself: %a" Printer.pp_attributes elt; Cil.DoChildren | TFun(rt, _, _, attrs) -> (* we do not visit parameters. This is handled elsewhere, and it is not possible to perform a sensible check for dependent types at this level, e.g. for void f(int n, int arr[10][n]); as in TFun the parameters are simple string, and not tied to the varinfo that we would like to put in scope to check that arr[10][n] is well formed. *) ignore (Cil.visitCilType (self:>Cil.cilVisitor) rt); ignore (Cil.visitCilAttributes (self:>Cil.cilVisitor) attrs); Cil.SkipChildren | _ -> Cil.DoChildren initializer let add_func kf = let vi = Kernel_function.get_vi kf in if vi.vsource then globals_functions <- Cil_datatype.Varinfo.Set.add vi globals_functions in let add_var vi _ = if vi.vsource then globals_vars <- Cil_datatype.Varinfo.Set.add vi globals_vars in Globals.Functions.iter add_func; Globals.Vars.iter add_var end end module type Extensible_checker = sig class check: ?is_normalized:bool -> string -> Visitor.frama_c_visitor end let current_checker = ref (module Base_checker: Extensible_checker) let extend_checker f = current_checker := f !current_checker let check_ast ?is_normalized ?(ast = Ast.get()) what = let module M = (val !current_checker : Extensible_checker) in Kernel.debug ~dkey:Kernel.dkey_check "Checking integrity of %s (%snormalized):@\n%a" what (if Extlib.opt_conv true is_normalized then "" else "not ") (if Extlib.opt_conv true is_normalized then Printer.pp_file else Cil_printer.pp_file) ast; Cil.visitCilFileSameGlobals (new M.check ?is_normalized what :> Cil.cilVisitor) ast (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/filecheck.mli0000666000000000000000000000504613571573400022136 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This file performs various consistency checks over a cil file. Code may vary depending on current development of the kernel and/or identified bugs. *) val check_ast: ?is_normalized:bool -> ?ast:Cil_types.file -> string -> unit (** Visits the given AST (defaults to the AST of the current project) to check whether it is consistent. Use a non-default [ast] argument at your own risks. Note that the check is only partial. @since Aluminium-20160501 @modify Silicon-20161101 adds optional ast argument *) module type Extensible_checker = sig class check: ?is_normalized:bool -> string -> Visitor.frama_c_visitor end (** Allows to register an extension to current checks. The function will be given as input the current state of the checker. @since Phosphorus-20170501-beta1 *) val extend_checker: ((module Extensible_checker) -> (module Extensible_checker)) -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/json_compilation_database.ml0000666000000000000000000002611113571573400025237 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module StringList = Datatype.List(Datatype.String) module Flags = State_builder.Hashtbl (Datatype.Filepath.Hashtbl) (StringList) (struct let name ="JsonCompilationDatabase.Flags" let dependencies = [Kernel.JsonCompilationDatabase.self] let size = 32 end) type arg_type = Path of string | Define of string | Undefine of string let whitelisted_prefixes = [Path "-I"; Path "-include"; Path "-imacros"; Define "-D"; Undefine "-U"] let string_of_arg_type = function Path s | Define s | Undefine s -> s let whitelist = List.map (fun p -> let s = string_of_arg_type p in p, Str.regexp (s ^ "\\(.*\\)") ) whitelisted_prefixes exception Found_whitelisted of arg_type * string (* Tests if any whitelisted prefix matches [s], and returns the matched suffix (s minus the prefix, which can be ""), or None if no match. *) let has_whitelisted_prefix s = try List.iter (fun (prefix, re) -> if Str.string_match re s 0 then try raise (Found_whitelisted (prefix, Str.matched_group 1 s)) with Not_found -> (* found the prefix, but with an empty suffix *) raise (Found_whitelisted (prefix, "")) ) whitelist; None with Found_whitelisted (prefix, suffix) -> Some (prefix, suffix) type arg_parser_state = Inside_quote of char | Outside_quote (** Parses a 'command' string, splitting arguments into a list of strings. Handles quoted strings containing spaces. *) let split_command_args s = let n = String.length s in let buf = Buffer.create 20 in let rec aux i prev_c state acc = if i >= n then begin if Buffer.length buf > 0 then Buffer.contents buf :: acc else acc end else let c = String.get s i in let new_state, new_acc = match state, prev_c, c with | Outside_quote, '\\', c when c = '\"' || c = '\'' -> (* escaped quote, continue with previous arg *) Buffer.add_char buf c; state, acc | Outside_quote, _, q when q = '\'' || q = '\"' -> (* continue previous arg with q *) Buffer.add_char buf q; Inside_quote q, acc | Outside_quote, _, ws when ws = ' ' || ws = '\t' -> if Buffer.length buf = 0 then (* in whitespace between args *) Outside_quote, acc else (* close previous arg and start another *) let new_arg = Buffer.contents buf in Buffer.clear buf; Outside_quote, new_arg :: acc | Outside_quote, _, _ -> (* continue previous arg with c *) Buffer.add_char buf c; Outside_quote, acc | Inside_quote q, '\\', ch when ch = q -> (* escaped quote, continue with previous arg *) Buffer.add_char buf c; state, acc | Inside_quote q, _, ch when q = ch -> (* unescaped quote, close arg and start another *) Buffer.add_char buf c; let new_arg = Buffer.contents buf in Buffer.clear buf; Outside_quote, new_arg :: acc | Inside_quote q, _, _ -> (* continue previous arg with c *) Buffer.add_char buf c; Inside_quote q, acc in aux (i+1) c new_state new_acc in let args = aux 0 ' ' Outside_quote [""] in let res = List.filter (fun s -> s <> "") args in List.rev res (** The 'arguments' given in a compile_commands.json are unescaped, but cannot be directly passed to the compiler. In particular, macro definitions and strings containing quotes need to be "re-quoted" before they are given to the preprocessor. This only needs to be applied to definitions; undefinitions (-U) never need quotes. *) let quote_define_argument arg = Format.sprintf "%S" arg let parse_entry ?(cwd=Sys.getcwd()) r = let open Yojson.Basic.Util in let filename = r |> member "file" |> to_string in let dirname = r |> member "directory" |> to_string_option |> Extlib.opt_conv "" in let path = Datatype.Filepath.of_string ~base_name:dirname filename in (* get the list of arguments, and a flag indicating if the arguments were given via 'command' or 'arguments'; the latter require quoting *) let string_option_list, requote = (* Note: the JSON Compilation Databse specification specifies that "either arguments or command is required", but does NOT specify what happens when both are present. There is a LLVM commit from 2015 (https://reviews.llvm.org/D10365) that mentions: "Arguments and Command can now be in the same compilation database for the same file. Arguments are preferred when both are present." The code below follows this behavior. *) try let args = List.map to_string (r |> member "arguments" |> to_list) in args, true with _ -> try let s = r |> member "command" |> to_string in split_command_args s, false with _ -> Kernel.abort "compilation database: expected 'arguments' or 'command'" in (* Normalize path names in include directives: first we normalize w.r.t. the file's directory (following the compilation database logic), then we relativize w.r.t. to Frama-C's PWD if possible (to avoid overly long absolute paths). *) let convert_path arg = let abs = Filepath.normalize ~base_name:dirname arg in Filepath.relativize ~base_name:cwd abs in let convert_define arg = if requote then quote_define_argument arg else arg in let process_prefix prefix suffix = match prefix with | Path s -> s ^ convert_path suffix | Define s -> s ^ convert_define suffix | Undefine s -> s ^ suffix in (* we must process the arguments in-order, since several -D and -U may exist in the command line *) (* prev is the prefix of the previous argument (if any) *) let _, res = List.fold_left (fun (prev, acc_res) arg -> match prev with | None -> begin match has_whitelisted_prefix arg with | None -> Kernel.feedback ~dkey:Kernel.dkey_compilation_db "dropping non-whitelisted argument: %s" arg; (None, acc_res) | Some (prefix, suffix) -> if suffix = "" then begin (* delay argument for next iteration *) Kernel.feedback ~dkey:Kernel.dkey_compilation_db "storing whitelisted lonely prefix: %s" arg; (Some prefix, acc_res) end else begin Kernel.feedback ~dkey:Kernel.dkey_compilation_db "adding whitelisted attached prefix: %s" arg; let new_arg = process_prefix prefix suffix in (None, new_arg :: acc_res) end end | Some prefix -> begin Kernel.feedback ~dkey:Kernel.dkey_compilation_db "adding stored prefix to suffix: %s %s" (string_of_arg_type prefix) arg; let new_arg = process_prefix prefix arg in (None, new_arg :: acc_res) end ) (None, []) string_option_list in (* Note: the same file may be compiled several times, under different (and possibly incompatible) configurations, leading to multiple occurrences in the list. Since we cannot infer which of them is the "right" one, we replace them with the latest ones found, warning the user if previous flags were different. *) let flags = List.rev res in try let previous_flags = Flags.find path in if previous_flags <> flags then let removed_flags = List.filter (fun e -> not (List.mem e previous_flags)) flags in let removed_str = if removed_flags = [] then "" else Format.asprintf "@ Old flags no longer present: %a" (Pretty_utils.pp_list ~sep:" " Format.pp_print_string) removed_flags in let added_flags = List.filter (fun e -> not (List.mem e flags)) previous_flags in let added_str = if added_flags = [] then "" else Format.asprintf "@ New flags not previously present: %a" (Pretty_utils.pp_list ~sep:" " Format.pp_print_string) added_flags in Kernel.warning ~wkey:Kernel.wkey_jcdb "@[found duplicate flags for '%a', replacing old flags.%s%s@]" Datatype.Filepath.pretty path removed_str added_str; Flags.replace path flags with | Not_found -> Flags.add path flags let get_flags f = if Kernel.JsonCompilationDatabase.get () <> "" then begin if not (Flags.is_computed ()) then begin let database = Kernel.JsonCompilationDatabase.get () in let path = if Sys.is_directory database then Filename.concat database "compile_commands.json" else database in Kernel.feedback ~dkey:Kernel.dkey_compilation_db "using compilation database: %s" path; begin try let r_list = Yojson.Basic.from_file path |> Yojson.Basic.Util.to_list in List.iter parse_entry r_list; with | Sys_error msg | Yojson.Json_error msg | Yojson.Basic.Util.Type_error (msg, _) -> Kernel.abort "could not parse compilation database: %s@ %s" database msg end; Flags.mark_as_computed () end; try let flags = Flags.find f in Kernel.feedback ~dkey:Kernel.dkey_compilation_db "flags found for '%a': %a" Datatype.Filepath.pretty f StringList.pretty flags; flags with Not_found -> Kernel.feedback ~dkey:Kernel.dkey_compilation_db "no flags found for '%a'" Datatype.Filepath.pretty f; [] end else [] frama-c-20.0-Calcium/src/kernel_services/ast_queries/json_compilation_database.mli0000666000000000000000000000353713571573400025417 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** [get_flags f] returns the preprocessing flags associated to file [f] in the JSON compilation database (when enabled), or the empty string otherwise. If not empty, the flags always start with a space. *) val get_flags : Datatype.Filepath.t -> string list frama-c-20.0-Calcium/src/kernel_services/ast_queries/logic_const.ml0000666000000000000000000003757513571573400022367 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Smart constructors for the logic. @plugin development guide *) (** {1 Identification Numbers} *) module AnnotId = State_builder.SharedCounter(struct let name = "annot_counter" end) module PredicateId = State_builder.SharedCounter(struct let name = "predicate_counter" end) module TermId = State_builder.SharedCounter(struct let name = "term_counter" end) module ExtendedId = State_builder.SharedCounter(struct let name = "extended_counter" end) let new_code_annotation annot = { annot_content = annot ; annot_id = AnnotId.next () } let fresh_code_annotation = AnnotId.next let new_predicate p = { ip_id = PredicateId.next (); ip_content = p } let fresh_predicate_id = PredicateId.next let pred_of_id_pred p = p.ip_content let refresh_predicate p = { p with ip_id = PredicateId.next () } let new_identified_term t = { it_id = TermId.next (); it_content = t } let new_acsl_extension ext_name ext_loc ext_has_status ext_kind = {ext_id = ExtendedId.next (); ext_name; ext_loc; ext_has_status; ext_kind} let fresh_term_id = TermId.next let refresh_identified_term d = new_identified_term d.it_content let refresh_identified_term_list = List.map refresh_identified_term let refresh_deps = function | FromAny -> FromAny | From l -> From(refresh_identified_term_list l) let refresh_from (a,d) = (new_identified_term a.it_content, refresh_deps d) let refresh_allocation = function | FreeAllocAny -> FreeAllocAny | FreeAlloc(f,a) -> FreeAlloc((refresh_identified_term_list f),refresh_identified_term_list a) let refresh_assigns = function | WritesAny -> WritesAny | Writes l -> Writes(List.map refresh_from l) let refresh_behavior b = { b with b_requires = List.map refresh_predicate b.b_requires; b_assumes = List.map refresh_predicate b.b_assumes; b_post_cond = List.map (fun (k,p) -> (k, refresh_predicate p)) b.b_post_cond; b_assigns = refresh_assigns b.b_assigns; b_allocation = refresh_allocation b.b_allocation; (* no need to refresh b_extended, it contains only named predicates. *) } let refresh_spec s = { spec_behavior = List.map refresh_behavior s.spec_behavior; spec_variant = s.spec_variant; spec_terminates = Extlib.opt_map refresh_predicate s.spec_terminates; spec_complete_behaviors = s.spec_complete_behaviors; spec_disjoint_behaviors = s.spec_disjoint_behaviors; } let refresh_code_annotation annot = let content = match annot.annot_content with | AAssert _ | AInvariant _ | AAllocation _ | AVariant _ | APragma _ | AExtended _ as c -> c | AStmtSpec(l,spec) -> AStmtSpec(l, refresh_spec spec) | AAssigns(l,a) -> AAssigns(l, refresh_assigns a) in new_code_annotation content (** {1 Smart constructors} *) (** {2 pre-defined logic labels} *) (* empty line for ocamldoc *) let init_label = BuiltinLabel Init let pre_label = BuiltinLabel Pre let post_label = BuiltinLabel Post let here_label = BuiltinLabel Here let old_label = BuiltinLabel Old let loop_current_label = BuiltinLabel LoopCurrent let loop_entry_label = BuiltinLabel LoopEntry (** {2 Types} *) let rec instantiate subst = function | Ltype(ty,prms) -> Ltype(ty, List.map (instantiate subst) prms) | Larrow(args,rt) -> Larrow(List.map (instantiate subst) args, instantiate subst rt) | Lvar v as ty -> (* This is an application of type parameters: no need to recursively substitute in the resulting type. *) (try List.assoc v subst with Not_found -> ty) | Ctype _ | Linteger | Lreal as ty -> ty let is_unrollable_ltdef = function | {lt_def=Some (LTsyn _)} -> true | {lt_def=Some (LTsum _)} | {lt_def=None} -> false let rec unroll_ltdef = function | Ltype ({lt_def=Some (LTsyn ty);lt_params},prms) -> let subst = try List.combine lt_params prms with Invalid_argument _ -> Kernel.fatal "Logic type used with wrong number of parameters" in unroll_ltdef (instantiate subst ty) | Ltype ({lt_def= None},_) | Ltype ({lt_def= Some (LTsum _)},_) | Linteger | Lreal | Lvar _ | Larrow _ | Ctype _ as ty -> ty let rec isLogicCType f = function | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> isLogicCType f (unroll_ltdef ty) | Ltype _ | Linteger | Lreal | Lvar _ | Larrow _ -> false | Ctype cty -> f cty let rec is_list_type = function | Ltype ({lt_name = "\\list"},[_]) -> true | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> is_list_type (unroll_ltdef ty) | _ -> false (** returns the type of elements of a list type. @raise Failure if the input type is not a list type. *) let rec type_of_list_elem ty = match ty with | Ltype ({lt_name = "\\list"},[t]) -> t | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> type_of_list_elem (unroll_ltdef ty) | _ -> failwith "not a list type" (** build the type list of [ty]. *) let make_type_list_of ty = Ltype(Logic_env.find_logic_type "\\list",[ty]) let rec is_set_type = function | Ltype ({lt_name = "set"},[_]) -> true | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> is_set_type (unroll_ltdef ty) | _ -> false (** converts a type into the corresponding set type if needed. *) let make_set_type ty = if is_set_type ty then ty else Ltype(Logic_env.find_logic_type "set",[ty]) (** [set_conversion ty1 ty2] returns a set type as soon as [ty1] and/or [ty2] is a set. Elements have type [ty1], or the type of the elements of [ty1] if it is itself a set-type ({i.e.} we do not build set of sets that way).*) let set_conversion ty1 ty2 = if is_set_type ty2 then make_set_type ty1 else ty1 (** returns the type of elements of a set type. @raise Failure if the input type is not a set type. *) let rec type_of_element ty = match ty with | Ltype ({lt_name = "set"},[t]) -> t | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> type_of_element (unroll_ltdef ty) | _ -> failwith "not a set type" (** [plain_or_set f t] applies [f] to [t] or to the type of elements of [t] if it is a set type *) let plain_or_set f = function | Ltype ({lt_name = "set"},[t]) -> f t | Ltype (tdef,_) as t when is_unrollable_ltdef tdef -> begin match unroll_ltdef t with | Ltype ({lt_name = "set"},[t]) -> f t | _ -> f t end | t -> f t let transform_element f t = set_conversion (plain_or_set f t) t let is_plain_type ty = not (is_set_type ty) let rec is_boolean_type = function | Ltype ({ lt_name = s }, []) when s = Utf8_logic.boolean -> true | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> is_boolean_type (unroll_ltdef ty) | _ -> false let boolean_type = Ltype ({ lt_name = Utf8_logic.boolean ; lt_params = [] ; lt_def = None; lt_attr = [] } , []) (** {2 Offsets} *) let rec lastTermOffset (off: term_offset) : term_offset = match off with | TNoOffset | TField(_,TNoOffset) | TIndex(_,TNoOffset) | TModel(_,TNoOffset)-> off | TField(_,off) | TIndex(_,off) | TModel(_,off) -> lastTermOffset off let rec addTermOffset (toadd: term_offset) (off: term_offset) : term_offset = match off with | TNoOffset -> toadd | TField(fid', offset) -> TField(fid', addTermOffset toadd offset) | TIndex(t, offset) -> TIndex(t, addTermOffset toadd offset) | TModel(m,offset) -> TModel(m,addTermOffset toadd offset) let addTermOffsetLval toadd (b, off) : term_lval = b, addTermOffset toadd off (** {2 Terms} *) (* empty line for ocamldoc *) (** @plugin development guide *) let term ?(loc=Cil_datatype.Location.unknown) term typ = { term_node = term; term_type = typ; term_name = []; term_loc = loc } let taddrof ?(loc=Cil_datatype.Location.unknown) lv typ = match lv with | TMem h, TNoOffset -> h | _ -> term ~loc (TAddrOf lv) typ (** range of integers *) let trange ?(loc=Cil_datatype.Location.unknown) (low,high) = term ~loc (Trange(low,high)) (Ltype(Logic_env.find_logic_type "set",[Linteger])) (** An integer constant (of type integer). *) let tinteger ?(loc=Cil_datatype.Location.unknown) i = term ~loc (TConst (Integer (Integer.of_int i,None))) Linteger (** An integer constant (of type integer) from an int64 . *) let tinteger_s64 ?(loc=Cil_datatype.Location.unknown) i64 = term ~loc (TConst (Integer (Integer.of_int64 i64,None))) Linteger let tint ?(loc=Cil_datatype.Location.unknown) i = term ~loc (TConst (Integer (i,None))) Linteger (** A real constant (of type real) from a Caml float . *) let treal ?(loc=Cil_datatype.Location.unknown) f = let s = Pretty_utils.to_string Floating_point.pretty f in let r = { r_literal = s ; r_upper = f ; r_lower = f ; r_nearest = f ; } in term ~loc (TConst (LReal r)) Lreal let treal_zero ?(loc=Cil_datatype.Location.unknown) ?(ltyp=Lreal) () = let zero = { r_nearest = 0.0 ; r_upper = 0.0 ; r_lower = 0.0 ; r_literal = "0." } in term ~loc (TConst (LReal zero)) ltyp let tstring ?(loc=Cil_datatype.Location.unknown) s = (* Cannot refer to Cil.charConstPtrType in this module... *) let typ = TPtr(TInt(IChar, [Attr("const", [])]),[]) in term ~loc (TConst (LStr s)) (Ctype typ) let tat ?(loc=Cil_datatype.Location.unknown) (t,label) = term ~loc (Tat(t,label)) t.term_type let told ?(loc=Cil_datatype.Location.unknown) t = tat ~loc (t,old_label) let tlogic_coerce ?(loc=Cil_datatype.Location.unknown) t lt = term ~loc (TLogic_coerce (lt, t)) lt let tvar ?(loc=Cil_datatype.Location.unknown) lv = term ~loc (TLval(TVar lv,TNoOffset)) lv.lv_type let tresult ?(loc=Cil_datatype.Location.unknown) typ = term ~loc (TLval(TResult typ,TNoOffset)) (Ctype typ) (* needed by Cil, upon which Logic_utils depends. TODO: some refactoring of these two files *) (** true if the given term is a lvalue denoting result or part of it *) let rec is_result t = match t.term_node with | TLval (TResult _,_) -> true | Tat(t,_) -> is_result t | _ -> false let rec is_exit_status t = match t.term_node with | TLval (TVar n,_) when n.lv_name = "\\exit_status" -> true | Tat(t,_) -> is_exit_status t | _ -> false (** {2 Predicate constructors} *) (* empty line for ocamldoc *) let unamed ?(loc=Cil_datatype.Location.unknown) p = {pred_content = p ; pred_loc = loc; pred_name = [] } let ptrue = unamed Ptrue let pfalse = unamed Pfalse let pold ?(loc=Cil_datatype.Location.unknown) p = match p.pred_content with | Ptrue | Pfalse -> p | _ -> {p with pred_content = Pat(p, old_label); pred_loc = loc} let papp ?(loc=Cil_datatype.Location.unknown) (p,lab,a) = unamed ~loc (Papp(p,lab,a)) let pand ?(loc=Cil_datatype.Location.unknown) (p1, p2) = match p1.pred_content, p2.pred_content with | Ptrue, _ -> p2 | _, Ptrue -> p1 | Pfalse, _ -> p1 | _, Pfalse -> p2 | _, _ -> unamed ~loc (Pand (p1, p2)) let por ?(loc=Cil_datatype.Location.unknown) (p1, p2) = match p1.pred_content, p2.pred_content with | Ptrue, _ -> p1 | _, Ptrue -> p2 | Pfalse, _ -> p2 | _, Pfalse -> p1 | _, _ -> unamed ~loc (Por (p1, p2)) let pxor ?(loc=Cil_datatype.Location.unknown) (p1, p2) = match p1.pred_content, p2.pred_content with | Ptrue, Ptrue -> unamed ~loc Pfalse | Ptrue, _ -> p1 | _, Ptrue -> p2 | Pfalse, _ -> p2 | _, Pfalse -> p1 | _,_ -> unamed ~loc (Pxor (p1,p2)) let pnot ?(loc=Cil_datatype.Location.unknown) p2 = match p2.pred_content with | Ptrue -> {p2 with pred_content = Pfalse; pred_loc = loc } | Pfalse -> {p2 with pred_content = Ptrue; pred_loc = loc } | Pnot p -> p | _ -> unamed ~loc (Pnot p2) let pands l = List.fold_right (fun p1 p2 -> pand (p1, p2)) l ptrue let pors l = List.fold_right (fun p1 p2 -> por (p1, p2)) l pfalse let plet ?(loc=Cil_datatype.Location.unknown) v p = match p.pred_content with | Ptrue -> p | _ -> unamed ~loc (Plet (v, p)) let pimplies ?(loc=Cil_datatype.Location.unknown) (p1,p2) = match p1.pred_content, p2.pred_content with | Ptrue, _ | _, Ptrue -> p2 | Pfalse, _ -> { pred_name = p1.pred_name; pred_loc = loc; pred_content = Ptrue } | _, _ -> unamed ~loc (Pimplies (p1, p2)) let pif ?(loc=Cil_datatype.Location.unknown) (t,p2,p3) = match (p2.pred_content, p3.pred_content) with | Ptrue, Ptrue -> ptrue | Pfalse, Pfalse -> pfalse | _,_ -> unamed ~loc (Pif (t,p2,p3)) let piff ?(loc=Cil_datatype.Location.unknown) (p2,p3) = match p2.pred_content, p3.pred_content with | Pfalse, Pfalse -> ptrue | Ptrue, _ -> p3 | _, Ptrue -> p2 | _,_ -> unamed ~loc (Piff (p2,p3)) (** @plugin development guide *) let prel ?(loc=Cil_datatype.Location.unknown) (a,b,c) = unamed ~loc (Prel(a,b,c)) let pforall ?(loc=Cil_datatype.Location.unknown) (l,p) = match l with | [] -> p | _ :: _ -> match p.pred_content with | Ptrue -> p | _ -> unamed ~loc (Pforall (l,p)) let pexists ?(loc=Cil_datatype.Location.unknown) (l,p) = match l with | [] -> p | _ :: _ -> match p.pred_content with | Pfalse -> p | _ -> unamed ~loc (Pexists (l,p)) let pfresh ?(loc=Cil_datatype.Location.unknown) (l1,l2,p,n) = unamed ~loc (Pfresh (l1,l2,p,n)) let pallocable ?(loc=Cil_datatype.Location.unknown) (l,p) = unamed ~loc (Pallocable (l,p)) let pfreeable ?(loc=Cil_datatype.Location.unknown) (l,p) = unamed ~loc (Pfreeable (l,p)) let pvalid ?(loc=Cil_datatype.Location.unknown) (l,p) = unamed ~loc (Pvalid (l,p)) let pvalid_read ?(loc=Cil_datatype.Location.unknown) (l,p) = unamed ~loc (Pvalid_read (l,p)) let pvalid_function ?(loc=Cil_datatype.Location.unknown) p = unamed ~loc (Pvalid_function p) (* the index should be an integer or a range of integers *) let pvalid_index ?(loc=Cil_datatype.Location.unknown) (l,t1,t2) = let ty1 = t1.term_type in let ty2 = t2.term_type in let t, ty =(match t1.term_node with | TStartOf lv -> TAddrOf (addTermOffsetLval (TIndex(t2,TNoOffset)) lv) | _ -> TBinOp (PlusPI, t1, t2)), set_conversion ty1 ty2 in let t = term ~loc t ty in pvalid ~loc (l,t) (* the range should be a range of integers *) let pvalid_range ?(loc=Cil_datatype.Location.unknown) (l,t1,b1,b2) = let t2 = trange ((Some b1), (Some b2)) in pvalid_index ~loc (l,t1,t2) let pat ?(loc=Cil_datatype.Location.unknown) (p,q) = unamed ~loc (Pat (p,q)) let pinitialized ?(loc=Cil_datatype.Location.unknown) (l,p) = unamed ~loc (Pinitialized (l,p)) let pdangling ?(loc=Cil_datatype.Location.unknown) (l,p) = unamed ~loc (Pdangling (l,p)) let pseparated ?(loc=Cil_datatype.Location.unknown) seps = unamed ~loc (Pseparated seps) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/logic_const.mli0000666000000000000000000003007613571573400022525 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Smart constructors for logic annotations. @plugin development guide *) open Cil_types open Cil_datatype (* ************************************************************************** *) (** {2 Nodes with a unique ID} *) (* ************************************************************************** *) (** creates a code annotation with a fresh id. *) val new_code_annotation : code_annotation_node -> code_annotation (** @return a fresh id for a code annotation. *) val fresh_code_annotation: unit -> int (** set a fresh id to an existing code annotation*) val refresh_code_annotation: code_annotation -> code_annotation (** set fresh id to properties of an existing funspec @since Sodium-20150201 *) val refresh_spec: funspec -> funspec (** creates a new identified predicate with a fresh id. *) val new_predicate: predicate -> identified_predicate (** creates a new acsl_extension with a fresh id. @plugin development guide @since Chlorine-20180501 *) val new_acsl_extension: string -> location -> bool -> acsl_extension_kind -> acsl_extension (** Gives a new id to an existing predicate. @since Oxygen-20120901 *) val refresh_predicate: identified_predicate -> identified_predicate (** @return a fresh id for predicates *) val fresh_predicate_id: unit -> int (** extract a named predicate for an identified predicate. *) val pred_of_id_pred: identified_predicate -> predicate (** creates a new identified term with a fresh id*) val new_identified_term: term -> identified_term (** Gives a new id to an existing term. @since Oxygen-20120901 *) val refresh_identified_term: identified_term -> identified_term (** @return a fresh id from an identified term*) val fresh_term_id: unit -> int (* ************************************************************************** *) (** {2 Logic labels} *) (* ************************************************************************** *) val pre_label: logic_label val post_label: logic_label val here_label: logic_label val old_label: logic_label val loop_current_label: logic_label val loop_entry_label: logic_label (** @since Sodium-20150201 *) val init_label: logic_label (* ************************************************************************** *) (** {2 Predicates} *) (* ************************************************************************** *) (** makes a predicate with no name. Default location is unknown.*) val unamed: ?loc:location -> predicate_node -> predicate (** \true *) val ptrue: predicate (** \false *) val pfalse: predicate (** \old *) val pold: ?loc:location -> predicate -> predicate (** application of predicate*) val papp: ?loc:location -> logic_info * logic_label list * term list -> predicate (** && *) val pand: ?loc:location -> predicate * predicate -> predicate (** || *) val por: ?loc:location -> predicate * predicate -> predicate (** ^^ *) val pxor: ?loc:location -> predicate * predicate -> predicate (** ! *) val pnot: ?loc:location -> predicate -> predicate (** Folds && over a list of predicates. *) val pands: predicate list -> predicate (** Folds || over a list of predicates. *) val pors: predicate list -> predicate (** local binding *) val plet: ?loc:location -> logic_info -> predicate -> predicate (** ==> *) val pimplies : ?loc:location -> predicate * predicate -> predicate (** ? : *) val pif: ?loc:location -> term * predicate * predicate -> predicate (** <==> *) val piff: ?loc:location -> predicate * predicate -> predicate (** Binary relation. @plugin development guide *) val prel: ?loc:location -> relation * term * term -> predicate (** \forall *) val pforall: ?loc:location -> quantifiers * predicate -> predicate (** \exists *) val pexists: ?loc:location -> quantifiers * predicate -> predicate (** \fresh(pt,size) *) val pfresh: ?loc:location -> logic_label * logic_label * term * term -> predicate (** \allocable *) val pallocable: ?loc:location -> logic_label * term -> predicate (** \freeable *) val pfreeable: ?loc:location -> logic_label * term -> predicate (** \valid_read *) val pvalid_read: ?loc:location -> logic_label * term -> predicate (** \valid *) val pvalid: ?loc:location -> logic_label * term -> predicate (** \valid_function *) val pvalid_function: ?loc:location -> term -> predicate (** \initialized *) val pinitialized: ?loc:location -> logic_label * term -> predicate (** \dangling *) val pdangling: ?loc:location -> logic_label * term -> predicate (** \at *) val pat: ?loc:location -> predicate * logic_label -> predicate (** \valid_index: requires index having integer type or set of integers *) val pvalid_index: ?loc:location -> logic_label * term * term -> predicate (** \valid_range: requires bounds having integer type *) val pvalid_range: ?loc:location -> logic_label * term * term * term -> predicate (** \separated *) val pseparated: ?loc:location -> term list -> predicate (* ************************************************************************** *) (** {2 Logic types} *) (* ************************************************************************** *) (** instantiate type variables in a logic type. @since 18.0-Argon moved from Logic_utils *) val instantiate : (string * logic_type) list -> logic_type -> logic_type (** @return [true] if the logic type definition can be expanded. @since 18.0-Argon *) val is_unrollable_ltdef : logic_type_info -> bool (** expands logic type definitions only. To expands both logic part and C part, uses [Logic_utils.unroll_type]. @since 18.0-Argon *) val unroll_ltdef : logic_type -> logic_type (** [isLogicType test typ] is [false] for pure logic types and the result of test for C types. *) val isLogicCType : (typ -> bool) -> logic_type -> bool (** returns [true] if the type is a list. @since Aluminium-20160501 @modify 18.0-Argon expands the logic type definition if necessary. *) val is_list_type: logic_type -> bool (** [make_type_list_of t] returns the type list<[t]>. @since Aluminium-20160501 *) val make_type_list_of: logic_type -> logic_type (** returns the type of elements of a list type. @raise Failure if the input type is not a list type. @since Aluminium-20160501 @modify 18.0-Argon expands the logic type definition if necessary. *) val type_of_list_elem: logic_type -> logic_type (** returns [true] if the type is a set. @since Neon-20140301 @modify 18.0-Argon expands the logic type definition if necessary. *) val is_set_type: logic_type -> bool (** [set_conversion ty1 ty2] returns a set type as soon as [ty1] and/or [ty2] is a set. Elements have type [ty1], or the type of the elements of [ty1] if it is itself a set-type ({i.e.} we do not build set of sets that way). @modify 18.0-Argon expands the logic type definitions if necessary. *) val set_conversion: logic_type -> logic_type -> logic_type (** converts a type into the corresponding set type if needed. Does nothing if the argument is already a set type. @modify 18.0-Argon expands the logic type definition if necessary. *) val make_set_type: logic_type -> logic_type (** returns the type of elements of a set type. @raise Failure if the input type is not a set type. @modify 18.0-Argon expands the logic type definition if necessary. *) val type_of_element: logic_type -> logic_type (** [plain_or_set f t] applies [f] to [t] or to the type of elements of [t] if it is a set type. @modify 18.0-Argon expands the logic type definition if necessary. *) val plain_or_set: (logic_type -> 'a) -> logic_type -> 'a (** [transform_element f t] is the same as [set_conversion (plain_or_set f t) t] @since Nitrogen-20111001 @modify 18.0-Argon expands the logic type definition if necessary. *) val transform_element: (logic_type -> logic_type) -> logic_type -> logic_type (** [true] if the argument is not a set type. @modify 18.0-Argon expands the logic type definition if necessary. *) val is_plain_type: logic_type -> bool (** @return true if the argument is the boolean type. @modify 18.0-Argon expands the logic type definition if necessary. *) val is_boolean_type: logic_type -> bool (** @since Sodium-20150201 @modify 18.0-Argon expands the logic type definition if necessary. *) val boolean_type: logic_type (* ************************************************************************** *) (** {1 Logic Terms} *) (* ************************************************************************** *) (** returns a anonymous term of the given type. *) val term : ?loc:Location.t -> term_node -> logic_type -> term (** & @deprecated Neon-20130301 {!Logic_utils.mk_AddrOf} is easier to use.*) val taddrof: ?loc:Location.t -> term_lval -> logic_type -> term (** [..] of integers *) val trange: ?loc:Location.t -> term option * term option -> term (** integer constant *) val tinteger: ?loc:Location.t -> int -> term (** integer constant *) val tinteger_s64: ?loc:Location.t -> int64 -> term (** integer constant @since Oxygen-20120901 *) val tint: ?loc:Location.t -> Integer.t -> term (** real constant *) val treal: ?loc:Location.t -> float -> term (** real zero *) val treal_zero: ?loc:Location.t -> ?ltyp:logic_type -> unit -> term (** string constant *) val tstring: ?loc:Location.t -> string -> term (** \at *) val tat: ?loc:Location.t -> term * logic_label -> term (** \old @since Nitrogen-20111001 *) val told: ?loc:Location.t -> term -> term (** variable *) val tvar: ?loc:Location.t -> logic_var -> term (** \result *) val tresult: ?loc:Location.t -> typ -> term (** coercion to the given logic type *) val tlogic_coerce: ?loc:Location.t -> term -> logic_type -> term (** [true] if the term is \result (potentially enclosed in \at)*) val is_result: term -> bool (** [true] if the term is \exit_status (potentially enclosed in \at) @since Nitrogen-20111001 *) val is_exit_status: term -> bool (* ************************************************************************** *) (** {1 Logic Offsets} *) (* ************************************************************************** *) (** Equivalent to [lastOffset] for terms. @since Oxygen-20120901 *) val lastTermOffset: term_offset -> term_offset (** Equivalent to [addOffset] for terms. @since Oxygen-20120901 *) val addTermOffset: term_offset -> term_offset -> term_offset (** Equivalent to [addOffsetLval] for terms. @since Oxygen-20120901 *) val addTermOffsetLval: term_offset -> term_lval -> term_lval (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/logic_env.ml0000666000000000000000000002667113571573400022024 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types let extensions = ref Datatype.String.Map.empty let is_extension s = Datatype.String.Map.mem s !extensions let extension_category s = Datatype.String.Map.find_opt s !extensions let register_extension s cat = if not (is_extension s) then extensions := Datatype.String.Map.add s cat !extensions module CurrentLoc = Cil_const.CurrentLoc let error (b,_e) fstring = Kernel.abort ~source:b ("In annotation: " ^^ fstring) module Logic_builtin = State_builder.Hashtbl (Datatype.String.Hashtbl) (Datatype.List(Cil_datatype.Builtin_logic_info)) (struct let name = "Logic_env.Logic_builtin" let dependencies = [] let size = 17 end) module Logic_info = State_builder.Hashtbl (Datatype.String.Hashtbl) (Datatype.List(Cil_datatype.Logic_info)) (struct let name = "Logic_env.Logic_info" let dependencies = [ Logic_builtin.self ] let size = 17 end) module Logic_builtin_used = State_builder.Hashtbl (Datatype.String.Hashtbl) (Datatype.List(Cil_datatype.Logic_info)) (struct let name = "Logic_env.Logic_builtin_used" let dependencies = [ Logic_builtin.self; Logic_info.self ] let size = 17 end) module Logic_type_builtin = State_builder.Hashtbl (Datatype.String.Hashtbl) (Cil_datatype.Logic_type_info) (struct let name = "Logic_env.Logic_type_builtin" let dependencies = [] let size = 17 end) let is_builtin_logic_type = Logic_type_builtin.mem module Logic_type_info = State_builder.Hashtbl (Datatype.String.Hashtbl) (Cil_datatype.Logic_type_info) (struct let name = "Logic_env.Logic_type_info" let dependencies = [ Logic_type_builtin.self ] let size = 17 end) module Logic_ctor_builtin = State_builder.Hashtbl (Datatype.String.Hashtbl) (Cil_datatype.Logic_ctor_info) (struct let name = "Logic_env.Logic_ctor_builtin" let dependencies = [] let size = 17 end) module Logic_ctor_info = State_builder.Hashtbl (Datatype.String.Hashtbl) (Cil_datatype.Logic_ctor_info) (struct let name = "Logic_env.Logic_ctor_info" let dependencies = [ Logic_ctor_builtin.self ] let size = 17 end) module Lemmas = State_builder.Hashtbl (Datatype.String.Hashtbl) (Cil_datatype.Global_annotation) (struct let name = "Logic_env.Lemmas" let dependencies = [] let size = 17 end) module Model_info = State_builder.Hashtbl (Datatype.String.Hashtbl) (Cil_datatype.Model_info) (struct let name = "Logic_env.Model_info" let dependencies = [] let size = 17 end) (* We depend from ast, but it is initialized after Logic_typing... *) let init_dependencies from = State_dependency_graph.add_dependencies ~from [ Logic_info.self; Logic_type_info.self; Logic_ctor_info.self; Lemmas.self; Model_info.self; ] let builtin_to_logic b = let params = List.map (fun (x, t) -> Cil_const.make_logic_var_formal x t) b.bl_profile in let li = Cil_const.make_logic_info b.bl_name in (* In case we have a logic constant, we might use the lv_type field as well as l_type. *) (match b.bl_type, b.bl_profile with | Some t, [] -> li.l_var_info.lv_type <- t; | None, _ | Some _, _::_ -> ()); li.l_type <- b.bl_type; li.l_tparams <- b.bl_params; li.l_profile <- params; li.l_labels <- b.bl_labels; li let is_builtin_logic_function = Logic_builtin.mem let is_logic_function s = is_builtin_logic_function s || Logic_info.mem s let find_all_logic_functions s = match Logic_info.find s with | l -> l | exception Not_found -> try let builtins = Logic_builtin.find s in let res = List.map builtin_to_logic builtins in Logic_builtin_used.add s res; Logic_info.add s res; res with Not_found -> [] let find_logic_cons vi = List.find (fun x -> Cil_datatype.Logic_var.equal x.l_var_info vi) (Logic_info.find vi.lv_name) (* add_logic_function takes as argument a function eq_logic_info which decides whether two logic_info are identical. It is intended to be Logic_utils.is_same_logic_profile, but this one can not be called from here since it will cause a circular dependency Logic_env <- Logic_utils <- Cil <- Logic_env *) let add_logic_function_gen is_same_profile li = let name = li.l_var_info.lv_name in if is_builtin_logic_function name then error (CurrentLoc.get()) "logic function or predicate %s is built-in. You cannot redefine it" name; match Logic_info.find name with | l -> List.iter (fun li' -> if is_same_profile li li' then error (CurrentLoc.get ()) "already declared logic function or predicate %s \ with same profile" name) l; Logic_info.replace name (li::l) | exception Not_found -> Logic_info.add name [li] let remove_logic_function = Logic_info.remove let remove_logic_info_gen is_same_profile li = let name = li.l_var_info.lv_name in if Logic_info.mem name then begin if is_builtin_logic_function name then Logic_info.remove name else begin let l = Logic_info.find name in let l' = List.filter (fun li' -> not (is_same_profile li li')) l in Logic_info.replace name l' end end let is_logic_type = Logic_type_info.mem let find_logic_type = Logic_type_info.find let add_logic_type t infos = if is_logic_type t (* type variables hide type definitions on their scope *) then error (CurrentLoc.get ()) "logic type %s already declared" t else Logic_type_info.add t infos let is_logic_ctor = Logic_ctor_info.mem let find_logic_ctor = Logic_ctor_info.find let add_logic_ctor c infos = if is_logic_ctor c then error (CurrentLoc.get ()) "logic constructor %s already declared" c else Logic_ctor_info.add c infos let remove_logic_ctor = Logic_ctor_info.remove let remove_logic_type s = try let info = Logic_type_info.find s in (match info.lt_def with | None | Some (LTsyn _) -> () | Some (LTsum cons) -> List.iter (fun { ctor_name } -> remove_logic_ctor ctor_name) cons); Logic_type_info.remove s with Not_found -> () let is_model_field = Model_info.mem let find_all_model_fields s = Model_info.find_all s let find_model_field s typ = let l = Model_info.find_all s in let rec find_cons typ = try List.find (fun x -> Cil_datatype.Typ.equal x.mi_base_type typ) l with Not_found as e -> (* Don't use Cil.unrollType here: unrollType will unroll until it finds something other than TNamed. We want to go step by step. *) (match typ with | TNamed(ti,_) -> find_cons ti.ttype | _ -> raise e) in find_cons typ let add_model_field m = try ignore (find_model_field m.mi_name m.mi_base_type); error (CurrentLoc.get()) "Cannot add model field %s to type %a: it already exists." m.mi_name Cil_datatype.Typ.pretty m.mi_base_type with Not_found -> Model_info.add m.mi_name m let remove_model_field = Model_info.remove let is_builtin_logic_ctor = Logic_ctor_builtin.mem let builtin_states = [ Logic_builtin.self; Logic_type_builtin.self; Logic_ctor_builtin.self ] module Builtins= struct include Hook.Make(struct end) (* ensures we do not apply the hooks twice *) module Applied = State_builder.False_ref (struct let name = "Logic_env.Builtins.Applied" let dependencies = builtin_states (* if the built-in states are not kept, hooks must be replayed. *) end) let apply () = Kernel.feedback ~level:5 "Applying logic built-ins hooks for project %s" (Project.get_name (Project.current())); if Applied.get () then Kernel.feedback ~level:5 "Already applied" else begin Applied.set true; apply () end end let prepare_tables () = Logic_ctor_info.clear (); Logic_type_info.clear (); Logic_info.clear (); Lemmas.clear (); Model_info.clear (); Logic_type_builtin.iter Logic_type_info.add; Logic_ctor_builtin.iter Logic_ctor_info.add; Logic_builtin_used.iter Logic_info.add (** C typedefs *) (** - true => identifier is a type name - false => identifier is a plain identifier *) let typenames: (string, bool) Hashtbl.t = Hashtbl.create 13 let add_typename t = Hashtbl.add typenames t true let hide_typename t = Hashtbl.add typenames t false let remove_typename t = Hashtbl.remove typenames t let reset_typenames () = Hashtbl.clear typenames let typename_status t = try Hashtbl.find typenames t with Not_found -> false let builtin_types_as_typenames () = Logic_type_builtin.iter (fun x _ -> add_typename x) let add_builtin_logic_function_gen is_same_profile bl = let name = bl.bl_name in if Logic_builtin.mem name then begin let l = Logic_builtin.find name in List.iter (fun bl' -> if is_same_profile bl bl' then error (CurrentLoc.get ()) "already declared builtin logic function or predicate \ %s with same profile" bl.bl_name) l; Logic_builtin.add name (bl::l) end else Logic_builtin.add name [bl] let add_builtin_logic_type name infos = if not (Logic_type_builtin.mem name) then begin Logic_type_builtin.add name infos; add_typename name; add_logic_type name infos end let add_builtin_logic_ctor name infos = if not (Logic_ctor_builtin.mem name) then begin Logic_ctor_builtin.add name infos; add_logic_ctor name infos end let iter_builtin_logic_function f = Logic_builtin.iter (fun _ info -> List.iter f info) let iter_builtin_logic_type f = Logic_type_builtin.iter (fun _ info -> f info) let iter_builtin_logic_ctor f = Logic_ctor_builtin.iter (fun _ info -> f info) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/logic_env.mli0000666000000000000000000001737113571573400022172 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {1 Global Logic Environment} *) open Cil_types (** {2 registered ACSL extensions } *) (** register a given name as a clause name for extended category. *) val register_extension: string -> ext_category -> unit val is_extension: string -> bool val extension_category: string -> ext_category option (** {2 Global Tables} *) module Logic_info: State_builder.Hashtbl with type key = string and type data = Cil_types.logic_info list module Logic_type_info: State_builder.Hashtbl with type key = string and type data = Cil_types.logic_type_info module Logic_ctor_info: State_builder.Hashtbl with type key = string and type data = Cil_types.logic_ctor_info (** @since Oxygen-20120901 *) module Model_info: State_builder.Hashtbl with type key = string and type data = Cil_types.model_info (** @since Oxygen-20120901 *) module Lemmas: State_builder.Hashtbl with type key = string and type data = Cil_types.global_annotation val builtin_states: State.t list (** {2 Shortcuts to the functions of the modules above} *) (** Prepare all internal tables before their uses: clear all tables except builtins. *) val prepare_tables : unit -> unit (** {3 Add an user-defined object} *) (** add_logic_function_gen takes as argument a function eq_logic_info which decides whether two logic_info are identical. It is intended to be Logic_utils.is_same_logic_profile, but this one can not be called from here since it will cause a circular dependency Logic_env <- Logic_utils <- Cil <- Logic_env. {b Do not use this function directly} unless you're really sure about what you're doing. Use {!Logic_utils.add_logic_function} instead. *) val add_logic_function_gen: (logic_info -> logic_info -> bool) -> logic_info -> unit val add_logic_type: string -> logic_type_info -> unit val add_logic_ctor: string -> logic_ctor_info -> unit (** @since Oxygen-20120901 *) val add_model_field: model_info -> unit (** {3 Add a builtin object} *) module Builtins: sig val apply: unit -> unit (** adds all requested objects in the environment. *) val extend: (unit -> unit) -> unit (** request an addition in the environment. Use one of the functions below in the body of the argument. *) end (** logic function/predicates that are effectively used in current project. *) module Logic_builtin_used: sig val add: string -> logic_info list -> unit val mem: string -> bool val iter: (string -> logic_info list -> unit) -> unit val self: State.t end (** see add_logic_function_gen above *) val add_builtin_logic_function_gen: (builtin_logic_info -> builtin_logic_info -> bool) -> builtin_logic_info -> unit val add_builtin_logic_type: string -> logic_type_info -> unit val add_builtin_logic_ctor: string -> logic_ctor_info -> unit val is_builtin_logic_function: string -> bool val is_builtin_logic_type: string -> bool val is_builtin_logic_ctor: string -> bool val iter_builtin_logic_function: (builtin_logic_info -> unit) -> unit val iter_builtin_logic_type: (logic_type_info -> unit) -> unit val iter_builtin_logic_ctor: (logic_ctor_info -> unit) -> unit (** {3 searching the environment} *) val find_all_logic_functions : string -> logic_info list (** returns all model fields of the same name. @since Oxygen-20120901 *) val find_all_model_fields: string -> model_info list (** [find_model_info field typ] returns the model field associated to [field] in type [typ]. @raise Not_found if no such type exists. @since Oxygen-20120901 *) val find_model_field: string -> typ -> model_info (** cons is a logic function with no argument. It is used as a variable, but may occasionally need to find associated logic_info. @raise Not_found if the given varinfo is not associated to a global logic constant. *) val find_logic_cons: logic_var -> logic_info val find_logic_type: string -> logic_type_info val find_logic_ctor: string -> logic_ctor_info (** {3 tests of existence} *) val is_logic_function: string -> bool val is_logic_type: string -> bool val is_logic_ctor: string -> bool (** @since Oxygen-20120901 *) val is_model_field: string -> bool (** {3 removing} *) (** removes {i all} overloaded bindings to a given symbol. *) val remove_logic_function: string -> unit (** [remove_logic_info_gen is_same_profile li] removes a specific logic info among all the overloaded ones. If the name corresponds to built-ins, all overloaded functions are removed at once (overloaded built-ins are always considered as a whole). Otherwise, does nothing if no logic info with the same profile as [li] is in the table. See {!Logic_env.add_logic_info_gen} for more information about the [is_same_profile] argument. @since Chlorine-20180501 *) val remove_logic_info_gen: (logic_info -> logic_info -> bool) -> logic_info -> unit (** [remove_logic_type s] removes the definition of logic type [s]. If [s] is a sum type, also removes the associated constructors. Does nothing in case [s] is not a known logic type. *) val remove_logic_type: string -> unit (** removes the given logic constructor. Does nothing if no such constructor exists. *) val remove_logic_ctor: string -> unit (** @since Oxygen-20120901 *) val remove_model_field: string -> unit (** {2 Typename table} *) (** marks an identifier as being a typename in the logic *) val add_typename: string -> unit (** marks temporarily a typename as being a normal identifier in the logic *) val hide_typename: string -> unit (** removes latest typename status associated to a given identifier *) val remove_typename: string -> unit (** erases all the typename status *) val reset_typenames: unit -> unit (** returns the typename status of the given identifier. *) val typename_status: string -> bool (** marks builtin logical types as logical typenames for the logic lexer. *) val builtin_types_as_typenames: unit -> unit (** {2 Internal use} *) val init_dependencies: State.t -> unit (** Used to postpone dependency of Lenv global tables wrt Cil_state, which is initialized afterwards. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/logic_typing.ml0000666000000000000000000047707613571573400022557 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil open Logic_ptree open Logic_const open Logic_utils open Format exception Backtrack let ($) = Extlib.($) let add_offset_lval = Kernel.deprecated "Logic_typing.add_offset_lval" ~now:"Logic_const.addTermOffsetLval" Logic_const.addTermOffsetLval let loc_join (b,_) (_,e) = (b,e) let unescape s = Logic_lexer.chr (Lexing.from_string s) let wcharlist_of_string s = let res = ref [] in let i = ref 0 in let rec treat_escape_octal n nb_pass = if nb_pass > 2 then res:= n::!res else if !i >= String.length s then res:= n::!res else match String.get s !i with x when '0' <= x && x <= '9' -> incr i; treat_escape_octal (Int64.add (Int64.mul (Int64.of_int 8) n) (Int64.of_int (Char.code x - Char.code '0'))) (nb_pass + 1) | _ -> res:= n::!res in let rec treat_escape_hexa n = if !i >= String.length s then res:= n::!res else match String.get s !i with x when '0' <= x && x <= '9' -> incr i; treat_escape_hexa (Int64.add (Int64.mul (Int64.of_int 16) n) (Int64.of_int (Char.code x - Char.code '0'))) | x when 'A' <= x && x <= 'F' -> incr i; treat_escape_hexa (Int64.add (Int64.mul (Int64.of_int 16) n) (Int64.of_int (Char.code x - Char.code 'A' + 10))) | x when 'a' <= x && x <= 'f' -> incr i; treat_escape_hexa (Int64.add (Int64.mul (Int64.of_int 16) n) (Int64.of_int (Char.code x - Char.code 'a' + 10))) | _ -> res:= n::!res in let treat_escape_sequence () = if !i >= String.length s then Kernel.warning ~current:true "Ill-formed escape sequence in wide string" else begin match String.get s !i with x when '0' <= x && x <= '9' -> treat_escape_octal Int64.zero 0 | 'x' -> incr i; treat_escape_hexa Int64.zero | 'a' -> incr i; res:= Int64.of_int 7::!res | 'b' -> incr i; res:= Int64.of_int 8::!res | 'f' -> incr i; res:= Int64.of_int 12::!res | 'n' -> incr i; res:= Int64.of_int (Char.code '\n') :: !res | 'r' -> incr i; res:=Int64.of_int (Char.code '\r')::!res | 't' -> incr i; res:= Int64.of_int (Char.code '\t') ::!res | '\'' -> incr i; res:=Int64.of_int (Char.code '\'')::!res | '"' -> incr i; res:= Int64.of_int (Char.code '"') ::!res | '?' -> incr i; res:= Int64.of_int (Char.code '?') ::!res | '\\' -> incr i; res:= Int64.of_int (Char.code '\\')::!res | c -> incr i; Kernel.warning ~current:true "Ill-formed escape sequence in wide string"; res:= Int64.of_int (Char.code c) :: !res end in while (!i < String.length s) do match String.get s !i with | '\\' -> incr i; treat_escape_sequence () | c -> res := Int64.of_int (Char.code c)::!res; incr i done; List.rev (!res) let type_of_list_elem t = Logic_const.type_of_list_elem (unroll_type t) let is_list_type t = Logic_const.is_list_type (unroll_type t) let type_of_set_elem t = Logic_const.type_of_element (unroll_type t) let is_set_type t = Logic_const.is_set_type (unroll_type t) let plain_mk_mem ?loc t ofs = match t.term_node with | TAddrOf lv -> Logic_const.addTermOffsetLval ofs lv | TStartOf lv -> Logic_const.addTermOffsetLval (TIndex (Cil.lzero ?loc (), ofs)) lv | _ -> TMem t, ofs let optimize_comprehension term = (* [term] is equal to {t | \subset(x, set)}. We are trying to get rid of the comprehension by lifting the operations done in [t] over it. *) let lift_operation_above_subset set x t = let loc = set.term_loc in (* Auxiliary function that maps [f] over [set], providing [set] is an lvalue. The other cases are too complex. *) let lval_term f = match set.term_node with | TLval lv -> f lv | _ -> term in let lval f typ = lval_term (fun lv -> Logic_const.term ~loc (f lv) typ) in let is_x y = Cil_datatype.Logic_var.equal x y in let set_type = make_set_type t.term_type in match t.term_node with | TLval (TVar y, TNoOffset) when is_x y -> set (* { x | \subset(x, set) } -> set *) | TLval (TVar y, o) when is_x y -> (* { x.o | \subset(x, set) } -> set.o *) lval (fun lv -> TLval (Logic_const.addTermOffsetLval o lv)) set_type | TLval (TMem { term_node = TLval (TVar y, TNoOffset)},o2) when is_x y -> (* { *(x+o2) | \subset(x, set) } -> *(set+o2) *) Logic_const.term ~loc (TLval (plain_mk_mem ~loc set o2)) set_type | TLval (TMem { term_node = TLval (TVar y, o1); term_type = ty},o2) when is_x y -> (* { (x+o1)->o2 | subset(x, set) } -> (set+o1)->o2*) lval (fun lv -> TLval (plain_mk_mem ~loc (Logic_const.term ~loc (TLval (Logic_const.addTermOffsetLval o1 lv)) (make_set_type ty)) o2)) set_type | TLval (TMem { term_node = TBinOp(op, { term_node = TLval (TVar y, o1); term_type = ty }, shift)},o2) when is_x y -> (* {(op(x+o1, shift))->o2} -> (op(set+o1, shift))->o2 *) let inner_set_type = make_set_type ty in lval (fun lv -> TLval (TMem( Logic_const.term ~loc (TBinOp( op, Logic_const.term ~loc (TLval (Logic_const.addTermOffsetLval o1 lv)) inner_set_type, shift)) inner_set_type),o2)) set_type | TUnOp (op, { term_node = TLval(TVar y,TNoOffset)}) when is_x y -> (* { op(x) | \subset(x, set) } -> op(set) *) Logic_const.term ~loc (TUnOp(op,set)) set_type | TBinOp(op,{term_node = TLval(TVar y, TNoOffset)},t2) when is_x y -> (* { op(x, t2) | \subset(x, set) } -> op(set, t2) *) Logic_const.term ~loc (TBinOp(op,set,t2)) set_type | TBinOp(op,t1,{term_node = TLval(TVar y, TNoOffset)}) when is_x y -> (* { op(t1, x) | \subset(x, set) } -> op(t1, x) *) Logic_const.term ~loc (TBinOp(op,t1,set)) set_type | TAddrOf (TVar y, o) when is_x y -> (* { &x->o | \subset(x, set) } -> &set->o *) lval_term (fun lv -> Logic_utils.mk_logic_AddrOf ~loc (Logic_const.addTermOffsetLval o lv) (Cil.typeTermOffset set.term_type o)) | TStartOf (TVar y,o) when is_x y -> (* { &x[0]->o | \subset(x, set) } -> &set[0]->o *) lval_term (fun lv -> let lv = Logic_const.addTermOffsetLval o lv in let ty = Cil.typeOfTermLval lv in Logic_utils.mk_logic_StartOf (Logic_const.term ~loc (TLval lv) ty)) | TLogic_coerce(lt,{ term_node = TLval(TVar y,TNoOffset)}) when is_x y -> (* { (lt)x | \subset(x, set) } -> (lt set)set *) { t with term_node = TLogic_coerce(Logic_const.make_set_type lt,set); term_type = Logic_const.make_set_type lt } | _ -> term in match term.term_node with | Tcomprehension (t, [x], Some { pred_content = Papp({l_var_info = {lv_name="\\subset"}},[],[elt;set]) }) -> (match elt.term_node with | TLogic_coerce (_, { term_node = TLval(TVar y, TNoOffset) }) when Cil_datatype.Logic_var.equal x y -> lift_operation_above_subset set x t | _ -> term) | _ -> term (* apply a function meant to operate on plain types to a possible set. *) let lift_set f loc = let rec aux loc = match loc.term_node with | Tcomprehension(t,q,p) -> let t' = aux t in let typ = Logic_const.make_set_type t'.term_type in { loc with term_node = Tcomprehension(t',q,p); term_type = typ} | Tunion l -> {loc with term_node = Tunion(List.map aux l)} | Tinter l -> {loc with term_node = Tinter(List.map aux l)} | Tempty_set -> loc (* coercion from a set to another set: keep the current coercion over the result of the transformation. *) | TLogic_coerce(set,t1) when is_set_type set && is_set_type t1.term_type -> let res = aux t1 in { loc with term_node = TLogic_coerce(set, res) } (* coercion from a singleton to a set: performs the transformation. *) | TLogic_coerce(oset, t1) when is_set_type oset -> let t = f t1 in let nset = make_set_type t.term_type in (* performs the coercion into a set. *) let singleton_coerce = { t with term_node = TLogic_coerce(nset, t); term_type = nset } in (* see whether we have to coerce the set type itself. *) if is_same_type oset nset then singleton_coerce else { loc with term_node = TLogic_coerce(oset, singleton_coerce) } (* if we a term of type set, try to apply f to each element of x by using a comprehension, and see whether we can get rid of said comprehension afterwards. *) | _ when is_set_type loc.term_type -> let elt_type = type_of_set_elem loc.term_type in let x = Cil_const.make_logic_var_quant "_x" elt_type in let t = Logic_const.tvar ~loc:loc.term_loc x in let sub = Logic_env.find_all_logic_functions "\\subset" in (* only one \subset function *) let sub = List.hd sub in let t2 = Logic_const.tvar ~loc:loc.term_loc x in let t2 = Logic_const.term ~loc:loc.term_loc (TLogic_coerce (loc.term_type,t2)) loc.term_type in let p = Logic_const.papp ~loc:loc.term_loc (sub, [], [t2;loc]) in let c = { loc with term_node = Tcomprehension(t,[x],Some p) } in let res = aux c in optimize_comprehension res (* plain term: apply the function directly. *) | _ -> f loc in aux loc let is_same_type t1 t2 = Cil_datatype.Logic_type.equal (Logic_utils.unroll_type t1) (Logic_utils.unroll_type t2) let type_rel = function | Eq -> Cil_types.Req | Neq -> Cil_types.Rneq | Lt -> Cil_types.Rlt | Le -> Cil_types.Rle | Gt -> Cil_types.Rgt | Ge -> Cil_types.Rge let type_binop = function | Badd -> PlusA | Bsub -> MinusA | Bmul -> Mult | Bdiv -> Div | Bmod -> Mod | Bbw_and -> BAnd | Bbw_or -> BOr | Bbw_xor -> BXor | Blshift -> Shiftlt | Brshift -> Shiftrt let binop_of_rel = function | Eq -> Cil_types.Eq | Neq -> Cil_types.Ne | Ge -> Cil_types.Ge | Gt -> Cil_types.Gt | Le -> Cil_types.Le | Lt -> Cil_types.Lt (* Logical environments *) module Lenv = struct (* locals: logic variables (e.g. quantified variables in \forall, \exists) *) module Smap = FCMap.Make(String) type t = { local_vars: Cil_types.logic_var Smap.t; local_logic_info: Cil_types.logic_info Smap.t; type_vars: Cil_types.logic_type Smap.t; logic_labels: Cil_types.logic_label Smap.t; current_logic_label: Cil_types.logic_label option; is_post_state: Cil_types.termination_kind option; is_funspec: bool; enclosing_post_state: Cil_types.termination_kind option; (* to determine in which post-state we should go in case of nested \at(\at(...,Post),Pre) *) } let string_of_current_label env = Extlib.opt_bind ( function | FormalLabel _ -> None | BuiltinLabel Init -> Some "Init" | BuiltinLabel Pre -> Some "Pre" | BuiltinLabel Old -> Some "Old" | BuiltinLabel Post -> Some "Post" | BuiltinLabel Here -> Some "Here" | BuiltinLabel LoopCurrent -> Some "LoopCurrent" | BuiltinLabel LoopEntry -> Some "LoopEntry" | StmtLabel s -> (match List.find_opt (function Label (_,_,b) -> b | _ -> false) !s.labels with | None -> None | Some (Label (lab,_,_)) -> Some lab | Some _ -> None)) env.current_logic_label let fresh_var env name kind typ = let name = let exists name = Smap.mem name env.local_vars || Smap.mem name env.local_logic_info || (Logic_env.find_all_logic_functions name <> []) in let rec aux i = if i < 0 then Kernel.fatal ~current:true "Out of indexes for temp logic var"; let name' = name ^ "_" ^ (string_of_int i) in if exists name' then aux (i+1) else name' in if exists name then aux 0 else name in Cil_const.make_logic_var_kind name kind typ let no_label env = Smap.is_empty env.logic_labels let enter_post_state env kind = let real_kind = match kind, env.enclosing_post_state with | _, None -> kind | Normal, Some kind -> kind | _, Some _ -> Kernel.fatal ~current:true "Inconsistent logic labels env stack" in { env with is_post_state = Some real_kind; enclosing_post_state = Some real_kind } let exit_post_state env = { env with is_post_state = None } let current_post_state env = env.is_post_state let add_var v var env = { env with local_vars = Smap.add v var env.local_vars } let find_var v env = Smap.find v env.local_vars let add_type_var v typ env = { env with type_vars = Smap.add v typ env.type_vars } let find_type_var v env = Smap.find v env.type_vars let add_logic_info v li env = let env = { env with local_logic_info = Smap.add v li env.local_logic_info } in add_var v li.l_var_info env let find_logic_info v env = Smap.find v env.local_logic_info (* logic labels *) let add_logic_label l lab env = { env with logic_labels = Smap.add l lab env.logic_labels } let find_logic_label l env = Smap.find l env.logic_labels let set_current_logic_label lab env = let env = { env with current_logic_label = Some lab } in match lab with BuiltinLabel Post -> enter_post_state env Normal | BuiltinLabel Here -> env | BuiltinLabel _ | FormalLabel _ | StmtLabel _ -> exit_post_state env let default_label = ref None let empty () = default_label := None; { local_vars = Smap.empty; local_logic_info = Smap.empty; type_vars = Smap.empty; logic_labels = Smap.empty; current_logic_label = None; is_post_state = None; enclosing_post_state=None; is_funspec=false } let funspec () = let empty = empty () in { empty with is_funspec = true } end let append_init_label env = Lenv.add_logic_label "Init" Logic_const.init_label env let append_here_label env = let env = Lenv.add_logic_label "Here" Logic_const.here_label env in Lenv.set_current_logic_label Logic_const.here_label env let append_pre_label env = Lenv.add_logic_label "Pre" Logic_const.pre_label env let append_old_and_post_labels env = Lenv.add_logic_label "Post" Logic_const.post_label (Lenv.add_logic_label "Old" Logic_const.old_label env) let append_loop_labels env = Lenv.add_logic_label "LoopEntry" Logic_const.loop_entry_label (Lenv.add_logic_label "LoopCurrent" Logic_const.loop_current_label env) let add_var var info env = Lenv.add_var var info env let add_result env typ = if Logic_utils.isLogicVoidType typ then env else let v = Cil_const.make_logic_var_kind "\\result" LVC typ in Lenv.add_var "\\result" v env let add_exit_status env = let v = Cil_const.make_logic_var_global "\\exit_status" Linteger in Lenv.add_var "\\exit_status" v env let enter_post_state env kind = Lenv.enter_post_state env kind let post_state_env kind typ = let env = Lenv.funspec () in let env = append_init_label env in let env = append_here_label env in let env = append_old_and_post_labels env in (* NB: this allows to have \result and Exits as termination kind *) let env = add_result env typ in let env = add_exit_status env in let env = enter_post_state env kind in env type type_namespace = Typedef | Struct | Union | Enum module Type_namespace = Datatype.Make(struct include Datatype.Serializable_undefined let reprs = [Typedef] let name = "Logic_typing.type_namespace" type t = type_namespace let compare : t -> t -> int = Transitioning.Stdlib.compare let equal : t -> t -> bool = (=) let hash : t -> int = Hashtbl.hash end) type typing_context = { is_loop: unit -> bool; anonCompFieldName : string; conditionalConversion : typ -> typ -> typ; find_macro : string -> lexpr; find_var : ?label:string -> var:string -> logic_var; find_enum_tag : string -> exp * typ; find_comp_field: compinfo -> string -> offset; find_type : type_namespace -> string -> typ; find_label : string -> stmt ref; remove_logic_function : string -> unit; remove_logic_info: logic_info -> unit; remove_logic_type: string -> unit; remove_logic_ctor: string -> unit; add_logic_function: logic_info -> unit; add_logic_type: string -> logic_type_info -> unit; add_logic_ctor: string -> logic_ctor_info -> unit; find_all_logic_functions: string -> logic_info list; find_logic_type: string -> logic_type_info; find_logic_ctor: string -> logic_ctor_info; pre_state:Lenv.t; post_state:Cil_types.termination_kind list -> Lenv.t; assigns_env:Lenv.t; silent: bool; logic_type: typing_context -> location -> Lenv.t -> Logic_ptree.logic_type -> Cil_types.logic_type ; type_predicate: typing_context -> Lenv.t -> Logic_ptree.lexpr -> predicate; type_term: typing_context -> Lenv.t -> Logic_ptree.lexpr -> term; type_assigns: typing_context -> accept_formal:bool -> Lenv.t -> Logic_ptree.assigns -> Cil_types.assigns; error: 'a 'b. location -> ('a,formatter,unit,'b) format4 -> 'a; on_error: 'a 'b. ('a -> 'b) -> (unit -> unit) -> 'a -> 'b } module Extensions = struct let typer_tbl = Hashtbl.create 5 let find_typer name = Hashtbl.find typer_tbl name let is_extension name = Hashtbl.mem typer_tbl name let register name category status typer = if is_extension name then Kernel.warning ~wkey:Kernel.wkey_acsl_extension "Trying to register ACSL extension %s twice. Ignoring second extension" name else begin Logic_env.register_extension name category; Hashtbl.add typer_tbl name (status,typer) end let typer name ~typing_context:typing_context ~loc p = try let status,typer = find_typer name in status, typer ~typing_context ~loc p with Not_found -> Kernel.fatal ~source:(fst loc) "unsupported clause of name '%s'" name end let register_behavior_extension name f = Extensions.register name Ext_contract f let register_global_extension name f = Extensions.register name Ext_global f let register_code_annot_extension name f = Extensions.register name (Ext_code_annot Ext_here) f let register_code_annot_next_stmt_extension name f = Extensions.register name (Ext_code_annot Ext_next_stmt) f let register_code_annot_next_loop_extension name f = Extensions.register name (Ext_code_annot Ext_next_loop) f let register_code_annot_next_both_extension name f = Extensions.register name (Ext_code_annot Ext_next_both) f let rec arithmetic_conversion ty1 ty2 = match unroll_type ty1, unroll_type ty2 with | Ctype ty1, Ctype ty2 -> if isIntegralType ty1 && isIntegralType ty2 then Linteger else Lreal | (Linteger, Ctype t | Ctype t, Linteger) when isIntegralType t -> Linteger | (Linteger, Ctype t | Ctype t , Linteger) when isArithmeticType t-> Lreal | (Lreal, Ctype ty | Ctype ty, Lreal) when isArithmeticType ty -> Lreal | Linteger, Linteger -> Linteger | (Lreal | Linteger) , (Lreal | Linteger) -> Lreal | Ltype ({lt_name="set"} as lt,[t1]), Ltype ({lt_name="set"},[t2]) -> Ltype(lt,[arithmetic_conversion t1 t2]) | _ -> Kernel.fatal ~current:true "arithmetic conversion between non arithmetic types %a and %a" Cil_printer.pp_logic_type ty1 Cil_printer.pp_logic_type ty2 let plain_arithmetic_type t = Cil.isLogicArithmeticType t let plain_integral_type t = Cil.isLogicIntegralType t let plain_boolean_type t = Cil.isLogicBooleanType t let plain_fun_ptr t = Cil.isLogicFunPtrType t let is_arithmetic_type = plain_or_set plain_arithmetic_type let is_integral_type = plain_or_set plain_integral_type let is_fun_ptr = plain_or_set plain_fun_ptr let rec type_of_pointed t = match unroll_type t with Ctype ty when isPointerType ty -> Ctype (Cil.typeOf_pointed ty) | Ltype ({lt_name = "set"} as lt,[t]) -> Ltype(lt,[type_of_pointed t]) | _ -> Kernel.fatal ~current:true "type %a is not a pointer type" Cil_printer.pp_logic_type t let rec ctype_of_pointed t = match unroll_type t with Ctype ty when isPointerType ty -> Cil.typeOf_pointed ty | Ltype ({lt_name = "set"},[t]) -> ctype_of_pointed t | _ -> Kernel.fatal ~current:true "type %a is not a pointer type" Cil_printer.pp_logic_type t let type_of_array_elem = plain_or_set (fun t -> match unroll_type t with Ctype ty when isArrayType ty -> Ctype (Cil.typeOf_array_elem ty) | _ -> Kernel.fatal ~current:true "type %a is not an array type" Cil_printer.pp_logic_type t) let rec ctype_of_array_elem t = match unroll_type t with | Ctype ty when isArrayType ty -> Cil.typeOf_array_elem ty | Ltype ({lt_name = "set"},[t]) -> ctype_of_array_elem t | _ -> Kernel.fatal ~current:true "type %a is not a pointer type" Cil_printer.pp_logic_type t let mk_mem ?loc t ofs = lift_set (fun t -> term ?loc (TLval (plain_mk_mem ?loc t ofs)) (type_of_pointed t.term_type)) t let is_plain_array_type t = match unroll_type t with | Ctype ct -> Cil.isArrayType ct | _ -> false let is_plain_pointer_type t = match unroll_type t with | Ctype ct -> Cil.isPointerType ct | _ -> false let is_array_type = plain_or_set is_plain_array_type let is_pointer_type = plain_or_set is_plain_pointer_type module Make (C: sig val is_loop: unit -> bool val anonCompFieldName : string val conditionalConversion : typ -> typ -> typ val find_macro : string -> lexpr val find_var : ?label:string -> var:string -> logic_var val find_enum_tag : string -> exp * typ val find_comp_field: compinfo -> string -> offset val find_type : type_namespace -> string -> typ val find_label : string -> stmt ref val remove_logic_function : string -> unit val remove_logic_info: logic_info -> unit val remove_logic_type: string -> unit val remove_logic_ctor: string -> unit val add_logic_function: logic_info -> unit val add_logic_type: string -> logic_type_info -> unit val add_logic_ctor: string -> logic_ctor_info -> unit val find_all_logic_functions: string -> logic_info list val find_logic_type: string -> logic_type_info val find_logic_ctor: string -> logic_ctor_info val integral_cast: Cil_types.typ -> Cil_types.term -> Cil_types.term val error: location -> ('a,formatter,unit, 'b) format4 -> 'a val on_error: ('a -> 'b) -> (unit -> unit) -> 'a -> 'b end) = struct let make_typing_context ~pre_state ~post_state ~assigns_env ~logic_type ~type_predicate ~type_term ~type_assigns = { silent = false; is_loop = C.is_loop; pre_state=pre_state; post_state=post_state; assigns_env=assigns_env; logic_type= logic_type; type_predicate= type_predicate; type_term= type_term; type_assigns = type_assigns; anonCompFieldName = C.anonCompFieldName; conditionalConversion = C.conditionalConversion; find_macro = C.find_macro; find_var = C.find_var; find_enum_tag = C.find_enum_tag; find_comp_field = C.find_comp_field; find_type = C.find_type ; find_label = C.find_label; remove_logic_function = C.remove_logic_function; remove_logic_info = C.remove_logic_info; remove_logic_type = C.remove_logic_type; remove_logic_ctor = C.remove_logic_ctor; add_logic_function = C.add_logic_function; add_logic_type = C.add_logic_type; add_logic_ctor = C.add_logic_ctor; find_all_logic_functions = C.find_all_logic_functions; find_logic_type = C.find_logic_type; find_logic_ctor = C.find_logic_ctor; error = C.error; on_error = C.on_error; } let rollback = Queue.create () let start_transaction () = Queue.clear rollback let finish_transaction () = Queue.clear rollback let rollback_transaction () = Queue.iter (fun f -> f()) rollback; Queue.clear rollback let add_rollback_action f x = Queue.add (fun () -> f x) rollback let add_logic_function loc li = let l = Logic_env.find_all_logic_functions li.l_var_info.lv_name in if List.exists (Logic_utils.is_same_logic_profile li) l then begin C.error loc "%s %s is already declared with the same profile" (match li.l_type with None -> "predicate" | Some _ -> "logic function") li.l_var_info.lv_name end else begin C.add_logic_function li; add_rollback_action C.remove_logic_info li end let add_logic_type loc info = try ignore (C.find_logic_type info.lt_name); C.error loc "logic type %s is already defined" info.lt_name with Not_found -> C.add_logic_type info.lt_name info; add_rollback_action C.remove_logic_type info.lt_name let check_non_void_ptr loc ty = if Logic_utils.isLogicVoidPointerType ty then C.error loc "Cannot use a pointer to void here" let check_fun_ptr loc ty = let is_fun_ptr t = match Cil.unrollType t with | TPtr(t,_) when Cil.isFunctionType t -> true | _ -> false in if not (Logic_utils.isLogicType is_fun_ptr ty) then C.error loc "expecting a function pointer, found %a" Cil_datatype.Logic_type.pretty ty let check_object_ptr loc ty = let is_object_ptr t = match Cil.unrollType t with | TPtr(t,_) when not (Cil.isFunctionType t) -> true | _ -> false in if not (Logic_utils.isLogicType is_object_ptr ty) then C.error loc "expecting a pointer to an object, found %a" Cil_datatype.Logic_type.pretty ty let check_logic_pointer ~check_non_void loc t = if Logic_utils.is_C_array t then C.error loc "In ACSL, there is no implicit conversion between \ a C array and a pointer. Either introduce an explicit \ cast or take the address of the first element of %a" Cil_printer.pp_term t; if not (isLogicPointerType t.term_type) then C.error loc "%a is not a pointer." Cil_printer.pp_term t; if check_non_void then check_non_void_ptr t.term_loc t.term_type; check_object_ptr t.term_loc t.term_type let has_field f ty = try ignore (Logic_env.find_model_field f ty); true with Not_found -> (match Cil.unrollType ty with | TComp(comp,_,_) -> List.exists (fun x -> x.fname = f) comp.cfields | _ -> false) let plain_type_of_c_field loc f ty = match Cil.unrollType ty with | TComp (comp, _, attrs) -> (try let attrs = Cil.filter_qualifier_attributes attrs in let field = C.find_comp_field comp f in let typ = Cil.typeOffset ty field in Logic_utils.offset_to_term_offset ~cast:false field, Ctype (Cil.typeAddAttributes attrs typ) with Not_found -> C.error loc "cannot find field %s" f) | _ -> C.error loc "expected a struct with field %s" f let type_of_c_field loc f = function | Ctype ty -> (try let mf = Logic_env.find_model_field f ty in TModel(mf,TNoOffset), mf.mi_field_type with Not_found -> plain_type_of_c_field loc f ty) | _ -> C.error loc "expected a struct with field %s" f let plain_type_of_field loc f ty = type_of_c_field loc f (Logic_const.unroll_ltdef ty) let type_of_field loc f ty = match Logic_const.unroll_ltdef ty with | Ltype ({lt_name = "set"} as lt,[t]) -> let offs,typ = plain_type_of_field loc f t in offs, Ltype(lt,[typ]) | t -> type_of_c_field loc f t let c_void_star = Ctype (TPtr (TVoid [], [])) (* keep in sync with fresh_type below *) let generated_var s = String.contains s '#' (* keep in sync with generated_var above*) class fresh_type_var = object(self) inherit Cil.nopCilVisitor val alpha_rename = Hashtbl.create 7 val mutable count = 0 method private fresh_s s = count <- succ count; Printf.sprintf "%s#%d" s count method! vlogic_type = function Lvar s when Hashtbl.mem alpha_rename s -> Cil.ChangeTo (Lvar (Hashtbl.find alpha_rename s)) | Lvar s -> let s' = self#fresh_s s in Hashtbl.add alpha_rename s s'; Cil.ChangeTo (Lvar s') | _ -> Cil.DoChildren method reset_count () = count <- 0 method reset () = Hashtbl.clear alpha_rename end let fresh_type = new fresh_type_var let fresh typ = visitCilLogicType (fresh_type :> cilVisitor) typ let fresh_type_var name = fresh (Lvar name) let instantiate env ty = let obj = object inherit Cil.nopCilVisitor method! vlogic_type t = match t with Lvar s when generated_var s -> (try Cil.ChangeDoChildrenPost (Lenv.find_type_var s env, fun x -> x) with Not_found -> Cil.DoChildren (* assert false *) (*FIXME: All type variables are supposed to be bound somewhere. However, there is currently no syntax to force an instantiation, e.g. for axiom foo: length(Nil) == 0; (where length takes list and Nil is list): we don't equal A nor B to C, and can't write length nor Nil) *) ) | _ -> Cil.DoChildren end in Cil.visitCilLogicType obj ty let rec c_type_of loc = function | Ctype t -> t | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> c_type_of loc (unroll_ltdef ty) | Ltype _ | Linteger | Lreal | Lvar _ | Larrow _ -> C.error loc "not a C type" let logic_type ctxt loc env t = let module C = struct end in (* force calls to go through ctxt *) let ltype t = ctxt.logic_type ctxt loc env t in let ctype t = ltype t |> c_type_of loc in match t with | LTvoid -> Ctype (TVoid []) | LTint ikind -> Ctype (TInt (ikind, [])) | LTfloat fkind -> Ctype (TFloat (fkind, [])) | LTarray (ty,length) -> let size = match length with | ASnone -> None | ASinteger s -> Some (parseIntExp ~loc s) | ASidentifier s -> let size = ctxt.type_term ctxt env {lexpr_node=PLvar(s);lexpr_loc=loc} in if size.term_type <> Linteger then ctxt.error loc "size of array must be an integral value"; try let rec size_exp size = match size.term_node with | TConst lconst -> (* the identifier was a macro to an integer *) Some (new_exp ~loc (Const (lconstant_to_constant lconst))) | TLval (TVar( {lv_kind=LVGlobal} as lvar), TNoOffset) -> begin (* logic variable, so try to unfold its definition *) match Logic_env.find_logic_cons lvar with | {l_labels=[];l_body=(LBterm term);l_profile=[]} -> size_exp term | _ -> raise Not_found end | _ -> raise Not_found in size_exp size with Not_found -> ctxt.error loc "size of array must be an integral value"; in Ctype (TArray (ctype ty, size, Cil.empty_size_cache (),[])) | LTpointer ty -> Ctype (TPtr (ctype ty, [])) | LTenum e -> (try Ctype (ctxt.find_type Enum e) with Not_found -> ctxt.error loc "no such enum %s" e) | LTstruct s -> (try Ctype (ctxt.find_type Struct s) with Not_found -> ctxt.error loc "no such struct %s" s) | LTunion u -> (try Ctype (ctxt.find_type Union u) with Not_found -> ctxt.error loc "no such union %s" u) | LTarrow (prms,rt) -> (* For now, our only function types are C function pointers. *) let prms = List.map (fun x -> "", ctype x, []) prms in let rt = ctype rt in (match prms with [] -> Ctype (TFun(rt,None,false,[])) | [(_,arg_typ,_)] when isVoidType arg_typ -> (* Same invariant as in C *) Ctype (TFun(rt,Some [],false,[])) | _ -> Ctype (TFun(rt,Some prms,false,[]))) | LTnamed (id,[]) -> (try Lenv.find_type_var id env with Not_found -> try Ctype (ctxt.find_type Typedef id) with Not_found -> try let info = ctxt.find_logic_type id in if info.lt_params <> [] then ctxt.error loc "wrong number of parameter for type %s" id else Ltype (info,[]) with Not_found -> ctxt.error loc "no such type %s" id) | LTnamed(id,l) -> (try let info = ctxt.find_logic_type id in if List.length info.lt_params <> List.length l then ctxt.error loc "wrong number of parameter for type %s" id else Ltype (info,List.map ltype l) with Not_found -> ctxt.error loc "no such type %s" id) | LTinteger -> Linteger | LTreal -> Lreal | LTattribute (ty,attr) -> (* attributes can only qualify C types *) Ctype (Cil.typeAddAttributes [attr] (ctype ty)) let mk_logic_access env t = match t.term_node with TLval _ -> t | _ -> let var = Lenv.fresh_var env "tmp" LVLocal t.term_type in let info = { l_var_info = var; l_labels = []; l_tparams = []; l_type = Some t.term_type; l_profile = []; l_body = LBterm t } in { t with term_node = Tlet(info,{ t with term_node = TLval(TVar var,TNoOffset) }) } let mk_dot env loc f_ofs f_type t = let rec t_dot_x t = match t.term_node with | TLval lv -> Logic_const.term ~loc (TLval (Logic_const.addTermOffsetLval f_ofs lv)) f_type | Tat (t1,l) -> Logic_const.term ~loc (Tat (t_dot_x t1,l)) f_type | _ -> let var = Lenv.fresh_var env "tmp" LVLocal t.term_type in let info = { l_var_info = var; l_labels = []; l_tparams = []; l_type = Some t.term_type; l_profile = []; l_body = LBterm t } in Logic_const.term ~loc (Tlet(info,{ t with term_node = TLval(TVar var,f_ofs) ; term_type = f_type })) f_type in t_dot_x t let mk_at_here idx = let rec needs_at idx = match idx.term_node with | TConst _ | TSizeOf _ | TSizeOfE _ | TSizeOfStr _ | TAlignOf _ | TAlignOfE _ | Tat _ | Ttypeof _ | Ttype _ | Tempty_set | Tbase_addr _ | Toffset _ | Tblock_length _ | Tnull -> false | TLval _ -> true | TUnOp(_,t) -> needs_at t | TBinOp(_,t1,t2) -> needs_at t1 || needs_at t2 | TCastE(_,t) -> needs_at t | TAddrOf (_,o) -> needs_at_offset o | TStartOf (_,o) -> needs_at_offset o | Tapp(_,_,l) | TDataCons(_,l) -> List.exists needs_at l | Tlambda(_,t) -> needs_at t | TUpdate(t1,o,t2) -> needs_at t1 || needs_at_offset o || needs_at t2 | Tunion l | Tinter l -> List.exists needs_at l | Tcomprehension(t,_,None) -> needs_at t | Tcomprehension(t,_,Some p) -> needs_at t || needs_at_pred p | Trange (None, None) -> false | Trange (None, Some t) | Trange(Some t, None) -> needs_at t | Trange (Some t1, Some t2) -> needs_at t1 || needs_at t2 | Tlet(_,t) -> needs_at t | Tif(t1,t2,t3) -> needs_at t1 || needs_at t2 || needs_at t3 | TLogic_coerce(_,t) -> needs_at t and needs_at_offset = function | TNoOffset -> false | TIndex (t,o) -> needs_at t || needs_at_offset o | TField(_,o) | TModel(_,o) -> needs_at_offset o and needs_at_pred p = match p.pred_content with | Pfalse | Ptrue | Pat _ -> false | Papp(_,_,t) | Pseparated t -> List.exists needs_at t | Prel(_,t1,t2) -> needs_at t1 || needs_at t2 | Pand(p1,p2) | Por(p1,p2) | Pxor(p1,p2) | Pimplies(p1,p2) | Piff(p1,p2) -> needs_at_pred p1 || needs_at_pred p2 | Pnot p | Plet (_,p) | Pforall(_,p) | Pexists(_,p) -> needs_at_pred p | Pif(t,p1,p2) -> needs_at t || needs_at_pred p1 || needs_at_pred p2 | Pvalid (_,t) | Pvalid_read (_,t) | Pvalid_function t | Pinitialized (_,t) | Pdangling (_, t) | Pallocable(_,t) | Pfreeable(_,t)-> needs_at t | Pfresh (_,_,t,n) -> (needs_at t) && (needs_at n) in if needs_at idx then tat ~loc:idx.term_loc (idx,here_label) else idx let mkAddrOfAndMark loc (b,off as lval) t = (* Mark the vaddrof flag if b is a variable *) begin match lastTermOffset off with | TNoOffset -> (match b with TVar vi -> begin match vi.lv_origin with None -> () | Some vi -> vi.vaddrof <- true end | _ -> ()) | TIndex _ -> () | TModel (mf,_) -> C.error loc "Cannot take the address of model field %s" mf.mi_name | TField(fi,_) -> fi.faddrof <- true end; Logic_utils.mk_logic_AddrOf ~loc lval t.term_type (* Compare the two types as logic types, ie by dismissing some irrelevant qualifiers and attributes *) let is_same_c_type ctyp1 ctyp2 = Cil_datatype.Logic_type.equal (Ctype ctyp1) (Ctype ctyp2) let rec c_mk_cast ?(force=false) e oldt newt = let loc = e.term_loc in if is_same_c_type oldt newt then begin if force then Logic_utils.mk_cast ~loc ~force newt e else e end else begin (* Watch out for constants *) if isPointerType newt && isLogicNull e && not (isLogicZero e) then (* \null can have any pointer type, see ACSL manual. *) (if force then Logic_const.term ~loc (TCastE (newt, e)) (Ctype newt) else { e with term_type = Ctype newt }) else if isPointerType newt && isArrayType oldt then begin if not (is_C_array e) then C.error loc "cannot cast logic array to pointer type"; let e = mk_logic_StartOf e in let oldt = Logic_utils.logicCType e.term_type in (* we have converted from array to ptr, but the pointed type might differ. Just do another round of conversion. *) c_mk_cast e oldt newt end else begin match Cil.unrollType newt, e.term_node with | TEnum (ei,[]), TConst (LEnum { eihost = ei'}) when ei.ename = ei'.ename && not force -> e | _ -> { e with term_node = (Logic_utils.mk_cast ~force newt e).term_node; term_type = Ctype newt } end end let is_same_ptr_type ctyp1 ctyp2 = (isPointerType ctyp1) && (isPointerType ctyp2) && (is_same_c_type (typeOf_pointed ctyp1) (typeOf_pointed ctyp2)) let is_same_array_type ctyp1 ctyp2 = (isArrayType ctyp1) && (isArrayType ctyp2) && (is_same_c_type (typeOf_array_elem ctyp1) (typeOf_array_elem ctyp2)) let is_same_logic_ptr_type ty1 ty2 = match (Logic_const.unroll_ltdef ty1, Logic_const.unroll_ltdef ty2) with | Ctype t1, Ctype t2 -> is_same_ptr_type t1 t2 | _ -> false let is_same_logic_array_type ty1 ty2 = match (Logic_const.unroll_ltdef ty1, Logic_const.unroll_ltdef ty2) with | Ctype t1, Ctype t2 -> is_same_array_type t1 t2 | _ -> false let is_function_pointer cty = try Cil.isFunctionType (Cil.typeOf_pointed cty) with Assert_failure _ -> false let is_compatible_funtype ty1 ty2 = if is_same_c_type ty1 ty2 then true else begin let rt1, _, variadic1, _ = Cil.splitFunctionType ty1 in let rt2, args2, _, _ = Cil.splitFunctionType ty2 in if not (is_same_c_type rt1 rt2) then false else begin (* types are not identical: they can only be compatible if args2 are not specified and variadic1 is false. *) match args2 with | Some _ -> false | None -> not variadic1 end end let is_implicit_pointer_conversion term ctyp1 ctyp2 = let same_pointed () = is_same_c_type (typeOf_pointed ctyp1) (typeOf_pointed ctyp2) in let same_array_elt () = is_same_c_type (typeOf_array_elem ctyp1) (typeOf_array_elem ctyp2) in let compatible_pointed () = same_pointed () || (isVoidPtrType ctyp2 && not (is_function_pointer ctyp1)) || (is_function_pointer ctyp2 && is_function_pointer ctyp1 && is_compatible_funtype (typeOf_pointed ctyp1) (typeOf_pointed ctyp2)) in (isArrayType ctyp1 && isArrayType ctyp2 && same_array_elt ()) || (isPointerType ctyp1 && isPointerType ctyp2 && (compatible_pointed() || isLogicNull term)) let is_enum_cst e t = match e.term_node with | TConst (LEnum ei) -> is_same_type (Ctype (TEnum (ei.eihost,[]))) t | _ -> false let logic_coerce t e = let real_type = set_conversion t e.term_type in let rec aux e = match e.term_node with | Tcomprehension(e,q,p) -> { e with term_type = real_type; term_node = Tcomprehension (aux e,q,p) } | Tunion l -> { e with term_type = real_type; term_node = Tunion (List.map aux l) } | Tinter l -> { e with term_type = real_type; term_node = Tinter (List.map aux l) } | Tempty_set -> { e with term_type = real_type } | TLogic_coerce(t2,e) when Cil.no_op_coerce t2 e -> let e = aux e in { e with term_type = real_type; term_node = TLogic_coerce(real_type,e) } | _ when Cil.isLogicArithmeticType real_type -> Logic_utils.numeric_coerce real_type e | _ -> { e with term_type = real_type; term_node = TLogic_coerce(real_type,e) } in if is_same_type e.term_type t then e else aux e let location_to_char_ptr t = let convert_one_location t = let ptd_type = type_of_pointed t.term_type in if isLogicCharType ptd_type then logic_coerce (make_set_type t.term_type) t else if isLogicVoidType ptd_type then C.error t.term_loc "can not have a set of void pointers" else let loc = t.term_loc in let sizeof = term ~loc (TSizeOf (logicCType ptd_type)) Linteger in let range = trange ~loc (Some (lzero ~loc ()), Some sizeof) in let converted_type = set_conversion (Ctype Cil.charPtrType) t.term_type in let cast = term ~loc (TCastE(Cil.charPtrType, t)) converted_type in term ~loc (TBinOp(PlusPI,cast,range)) (make_set_type converted_type) in lift_set convert_one_location t let rec mk_cast ?(explicit=false) e newt = let force = explicit in let loc = e.term_loc in let truncate_info = List.hd @@ Logic_env.find_all_logic_functions "\\truncate" in if is_same_type e.term_type newt then begin if explicit then begin match Logic_const.unroll_ltdef newt with | Ctype cnewt -> { e with term_node = TCastE(cnewt,e); term_type = newt } | _ -> e end else e end else if is_enum_cst e newt then { e with term_type = newt } else begin match (unroll_type e.term_type), (* If any, use the typedef itself in the inserted cast *) (Logic_const.unroll_ltdef newt) with | Ctype oldt, Ctype newt -> c_mk_cast ~force e oldt newt | t1, Ltype ({lt_name = name},[]) when name = Utf8_logic.boolean && is_integral_type t1 -> let t2 = Ltype (C.find_logic_type Utf8_logic.boolean,[]) in let e = mk_cast e Linteger in Logic_const.term ~loc (TBinOp(Ne,e,lzero ~loc())) t2 | t1, Linteger when Logic_const.is_boolean_type t1 && explicit -> logic_coerce Linteger e | t1, Ctype t2 when Logic_const.is_boolean_type t1 && is_integral_type newt && explicit -> Logic_const.term ~loc (TCastE (t2,e)) newt | ty1, Ltype({lt_name="set"},[ty2]) when is_pointer_type ty1 && is_plain_pointer_type ty2 && isLogicCharType (type_of_pointed ty2) -> location_to_char_ptr e | Ltype({lt_name = "set"},[_]), Ltype({lt_name="set"},[ty2]) -> let e = lift_set (fun e -> mk_cast e ty2) e in { e with term_type = make_set_type e.term_type} (* extremely dirty cast to allow Eva to understand some libc specifications *) | Ltype({lt_name = "set"},[_]), Ctype ty2 when explicit -> Logic_utils.mk_cast ~loc ty2 e | _ , Ltype({lt_name = "set"},[ ty2 ]) -> let e = mk_cast e ty2 in logic_coerce (make_set_type e.term_type) e | Linteger, Linteger | Lreal, Lreal -> e | Linteger, Ctype t when isLogicPointerType newt && isLogicNull e -> c_mk_cast ~force e intType t | Linteger, (Ctype newt) | Lreal, (Ctype newt) when explicit -> Logic_utils.mk_cast ~loc newt e | Linteger, Ctype t when isIntegralType t -> (try C.integral_cast t e with Failure s -> C.error loc "%s" s) | Linteger, Ctype _ | Lreal, Ctype _ -> C.error loc "invalid implicit cast from %a to C type %a" Cil_printer.pp_logic_type e.term_type Cil_printer.pp_logic_type newt | Ctype t, Linteger when Cil.isIntegralType t -> logic_coerce Linteger e | Ctype t, Linteger when Cil.isArithmeticType t && explicit -> Logic_const.term ~loc (Tapp(truncate_info,[], [logic_coerce Lreal e])) Linteger | Ctype t, Lreal when isArithmeticType t -> logic_coerce Lreal e | Ctype _, (Lreal | Linteger) -> C.error loc "invalid implicit cast from %a to logic type %a" Cil_printer.pp_logic_type e.term_type Cil_printer.pp_logic_type newt | Linteger, Lreal -> logic_coerce Lreal e | Lreal, Linteger when explicit -> let term_node = Tapp(truncate_info,[],[e]) in Logic_const.term ~loc term_node Linteger | Lreal, Linteger -> C.error loc "invalid cast from real to integer. \ Use conversion functions instead" | Larrow (args1,_), Larrow(args2,rt2) -> (match e.term_node with | Tlambda (prms,body) when Logic_utils.is_same_list is_same_type args1 args2 -> (* specialized coercion of the body of the lambda instead of the whole expression. *) (* Might also want to specialize when the prms type are not the same, but this implies pushing logic coercions in the body for the newly typed parameters... *) let body = mk_cast body rt2 in { e with term_node = Tlambda(prms,body); term_type = newt } | _ -> logic_coerce newt e) | Ltype _, _ | _, Ltype _ | Lvar _,_ | _,Lvar _ | Larrow _,_ | _,Larrow _ -> C.error loc "invalid cast from %a to %a" Cil_printer.pp_logic_type e.term_type Cil_printer.pp_logic_type newt end let rec c_cast_to ot nt e = if is_same_c_type ot nt then (ot, e) else begin let result = (nt, mk_cast e (Ctype nt)) in match ot, nt with | TNamed(r, _), _ -> c_cast_to r.ttype nt e | _, TNamed(r, _) -> c_cast_to ot r.ttype e | TInt(_ikindo,_), TInt(_ikindn,_) -> result | TInt _, TPtr _ -> result | TPtr _, TInt _ -> result | ((TArray (told,_,_,_) | TPtr (told,_)), (TPtr (tnew,_) | TArray(tnew,_,_,_))) when is_same_c_type told tnew -> result | (TPtr _ | TArray _), (TPtr _ | TArray _) when isLogicNull e -> result | TPtr _, TPtr _ when isVoidPtrType nt -> (nt, e) | TPtr (t1,_), TPtr (t2,_) when Cil.isFunctionType t1 && Cil.isFunctionType t2 && is_compatible_funtype t1 t2 -> result | TEnum _, TInt _ -> result | TFloat _, (TInt _|TEnum _) -> result | (TInt _|TEnum _), TFloat _ -> result | TFloat _, TFloat _ -> result | TInt _, TEnum _ -> result | TEnum _, TEnum _ -> result | TEnum _, TPtr _ -> result | TBuiltin_va_list _, (TInt _ | TPtr _) -> result | (TInt _ | TPtr _), TBuiltin_va_list _ -> Kernel.debug ~level:3 "Casting %a to __builtin_va_list" Cil_printer.pp_typ ot; result | TPtr _, TEnum _ -> Kernel.debug ~level:3 "Casting a pointer into an enumeration type"; result | (TInt _ | TEnum _ | TPtr _ ), TVoid _ -> (ot, e) | TComp (comp1, _, _), TComp (comp2, _, _) when comp1.ckey = comp2.ckey -> nt, e | _ -> Kernel.fatal ~current:true "Logic_typing.c_cast_to: %a -> %a@." Cil_printer.pp_typ ot Cil_printer.pp_typ nt end (* for overloading: raised when an arguments list does not fit a formal parameter list *) exception Not_applicable (* convert term [oterm] of type [ot] to type [nt]. when overloaded is true, raise exception Not_applicable if conversion not possible, otherwise print an error message with location [loc] *) let rec implicit_conversion ~overloaded loc oterm ot nt = match (unroll_type ot), (unroll_type nt) with | Ctype ty1, Ctype ty2 -> if is_same_c_type ty1 ty2 then ot, oterm else if (isIntegralType ty1 && isIntegralType ty2) then begin let sz1 = bitsSizeOf ty1 in let sz2 = bitsSizeOf ty2 in if (sz1 < sz2 || (sz1 = sz2 && (isSignedInteger ty1 = isSignedInteger ty2)) || is_enum_cst oterm nt) then begin let t, e = c_cast_to ty1 ty2 oterm in Ctype t,e end else if overloaded then raise Not_applicable else C.error loc "invalid implicit conversion from '%a' to '%a'" Cil_printer.pp_typ ty1 Cil_printer.pp_typ ty2 end else if is_implicit_pointer_conversion oterm ty1 ty2 || (match unrollType ty1, unrollType ty2 with | (TFloat (f1,_), TFloat (f2,_)) -> f1 <= f2 (*[BM] relies on internal representation of OCaml constant constructors.*) | _ -> false) then begin let t,e = c_cast_to ty1 ty2 oterm in Ctype t, e end else if overloaded then raise Not_applicable else if (* not overloaded: raise an error. *) isArrayType ty1 && isPointerType ty2 && is_same_c_type (typeOf_array_elem ty1) (typeOf_pointed ty2) then if Logic_utils.is_C_array oterm then C.error loc "In ACSL, there is no implicit conversion between \ a C array and a pointer. Either introduce an explicit \ cast or take the address of the first element of %a" Cil_printer.pp_term oterm else C.error loc "%a is a logic array. Only C arrays can be \ converted to pointers, and this conversion must be \ explicit (cast or take the address of the first element)" Cil_printer.pp_term oterm else C.error loc "invalid implicit conversion from '%a' to '%a'" Cil_printer.pp_typ ty1 Cil_printer.pp_typ ty2 | Ctype ty, Linteger when Cil.isIntegralType ty -> Linteger, oterm | Ctype ty, Lreal when Cil.isArithmeticType ty -> Lreal, oterm | Linteger, Lreal -> Lreal, oterm (* Integer 0 is also a valid pointer. *) | Linteger, Ctype ty when Cil.isPointerType ty && isLogicNull oterm -> nt, { oterm with term_node = TCastE(ty,oterm); term_type = nt } | Linteger, Ctype ty when Cil.isIntegralType ty -> (try nt, C.integral_cast ty oterm with Failure s -> if overloaded then raise Not_applicable else C.error loc "%s" s) | t1, Ltype ({lt_name = "set"},[t2]) when is_pointer_type t1 && is_plain_pointer_type t2 && isLogicCharType (type_of_pointed t2) -> nt, location_to_char_ptr oterm (* can convert implicitly a singleton into a set, but not the reverse. *) | Ltype (t1,l1), Ltype (t2,l2) when t1.lt_name = t2.lt_name -> (* not sure this is really what we want: can foo be implicitly converted into foo ? *) let l = List.map2 (fun x y -> fst (implicit_conversion ~overloaded loc oterm x y)) l1 l2 in Ltype(t1,l),oterm | t1, Ltype ({lt_name = "set"},[t2]) -> let typ, term = implicit_conversion ~overloaded loc oterm t1 t2 in make_set_type typ, term | Linteger, Linteger | Lreal, Lreal -> ot, oterm | Lvar s1, Lvar s2 when s1 = s2 -> ot, oterm | Larrow(args1,rt1), Larrow(args2,rt2) when List.length args1 = List.length args2 -> (* contravariance. *) let args = List.map2 (fun x y -> fst (implicit_conversion ~overloaded loc oterm x y)) args2 args1 in let rt,_ = implicit_conversion ~overloaded loc oterm rt1 rt2 in Larrow(args,rt), oterm | ((Ctype _| Linteger | Lreal | Ltype _ | Lvar _ | Larrow _), (Ctype _| Linteger | Lreal | Ltype _ | Lvar _ | Larrow _)) -> if overloaded then raise Not_applicable else C.error loc "invalid implicit conversion from %a to %a" Cil_printer.pp_logic_type ot Cil_printer.pp_logic_type nt let rec find_supertype ~overloaded loc t ot nt = match unroll_type ot, unroll_type nt with | Ctype ot, Ctype nt -> if is_same_c_type ot nt then Ctype ot else if Cil.isIntegralType ot && Cil.isIntegralType nt then Linteger else if Cil.isArithmeticType ot && Cil.isArithmeticType nt then Lreal else if is_implicit_pointer_conversion t ot nt then let res,_ = c_cast_to ot nt t in Ctype res else if overloaded then raise Not_applicable else C.error loc "incompatible types %a and %a@." Cil_printer.pp_typ ot Cil_printer.pp_typ nt | Ctype ot, (Ltype({lt_name = n},[]) as nt) when n = Utf8_logic.boolean && Cil.isIntegralType ot -> nt | Ltype({lt_name = n},[]) as ot, Ctype nt when n = Utf8_logic.boolean && Cil.isIntegralType nt -> ot | (Linteger, (Ltype({lt_name = n},[]) as t) | (Ltype({lt_name = n},[]) as t), Linteger) when n = Utf8_logic.boolean -> t | Ltype(ot,oprms), Ltype(nt,nprms) when ot == nt -> let res = List.map2 (find_supertype ~overloaded loc t) oprms nprms in Ltype(ot,res) | Ltype({lt_name = "\\list"} as lt, [t1]), Ltype({lt_name = "\\list"}, [t2]) -> let st = find_supertype ~overloaded loc t t1 t2 in Ltype(lt, [st]) | Ltype({lt_name = "set"} as set, [t1]), t2 | t1, Ltype({lt_name = "set"} as set, [t2]) -> let st = find_supertype ~overloaded loc t t1 t2 in Ltype(set, [st]) | Lvar s1, Lvar s2 when s1 = s2 -> ot | Linteger, Ctype nt when Cil.isIntegralType nt -> Linteger | Linteger, Ctype nt when Cil.isPointerType nt && isLogicNull t -> Ctype nt | Ctype ot, Linteger when Cil.isIntegralType ot -> Linteger | Ctype ot, Linteger when Cil.isPointerType ot && isLogicNull t -> Ctype ot | Linteger, Linteger -> Linteger | Linteger, Lreal -> Lreal | Linteger, Ctype nt when Cil.isArithmeticType nt -> Lreal | Ctype ot, Linteger when Cil.isArithmeticType ot -> Lreal | Lreal, Linteger -> Lreal | Lreal, Lreal -> Lreal | Lreal, Ctype nt when Cil.isArithmeticType nt -> Lreal | Ctype nt, Lreal when Cil.isArithmeticType nt -> Lreal | Larrow(oargs,oret), Larrow(nargs,nret) when List.length oargs = List.length nargs -> let ret = find_supertype ~overloaded loc t oret nret in let args = List.map2 (find_supertype ~overloaded loc t) nargs oargs in Larrow(args,ret) | (Ctype _ | Ltype _ | Lvar _ | Linteger | Lreal | Larrow _), _ -> if overloaded then raise Not_applicable else C.error loc "incompatible types %a and %a" Cil_printer.pp_logic_type ot Cil_printer.pp_logic_type nt let rec partial_unif ~overloaded loc term ot nt env = match (unroll_type ot),(unroll_type nt) with | Lvar s1, Lvar s2 -> if generated_var s1 then try let ot = Lenv.find_type_var s1 env in partial_unif ~overloaded loc term ot nt env with Not_found -> if generated_var s2 then try let nt = Lenv.find_type_var s2 env in partial_unif ~overloaded loc term ot nt env with Not_found -> if s1 < s2 then Lenv.add_type_var s2 ot env,ot,ot else if s2 < s1 then Lenv.add_type_var s1 nt env,nt,nt else env,ot,ot (* same type anyway *) else Lenv.add_type_var s1 nt env, nt, nt else if generated_var s2 then try let nt = Lenv.find_type_var s2 env in partial_unif ~overloaded loc term ot nt env with Not_found -> Lenv.add_type_var s2 ot env, ot, ot else if s1 = s2 then env, ot, ot (* same type *) else C.error loc "implicit unification of type variables %s and %s" s1 s2 | Lvar s1, _ when generated_var s1 -> (try let ot = Lenv.find_type_var s1 env in let env,ot,nt = partial_unif ~overloaded loc term ot nt env in let st = find_supertype ~overloaded loc term ot nt in let env = if is_same_type ot st then env else Lenv.add_type_var s1 st env in env, ot, st with Not_found -> Lenv.add_type_var s1 nt env, nt, nt) | _, Lvar s2 when generated_var s2 -> (try let nt = Lenv.find_type_var s2 env in let env, ot, nt = partial_unif ~overloaded loc term ot nt env in let st = find_supertype ~overloaded loc term ot nt in let env = if is_same_type nt st then env else Lenv.add_type_var s2 st env in env, ot, st with Not_found -> Lenv.add_type_var s2 ot env, ot, ot) | Ltype(t1,l1), Ltype(t2,l2) when t1.lt_name = t2.lt_name -> let env = List.fold_right2 (fun ot nt env -> let (env,_,_) = partial_unif ~overloaded loc term ot nt env in env) l1 l2 env in let l1 = List.map (instantiate env) l1 in let l2 = List.map (instantiate env) l2 in env,Ltype(t1,l1),Ltype(t2,l2) | Larrow(args1,rt1), Larrow(args2,rt2) when List.length args1 = List.length args2 -> let env = List.fold_right2 (fun ot nt env -> let env,_,_ = partial_unif ~overloaded loc term ot nt env in env) args1 args2 env in let env, _, _ = partial_unif ~overloaded loc term rt1 rt2 env in let rt1 = instantiate env rt1 in let rt2 = instantiate env rt2 in let args1 = List.map (instantiate env) args1 in let args2 = List.map (instantiate env) args2 in env, Larrow(args1,rt1), Larrow(args2,rt2) | Ltype ({lt_name = "\\list"},[t1]), Ltype ({lt_name = "\\list"},[t2]) -> let (env, ot, nt) = partial_unif ~overloaded loc term t1 t2 env in env, ot, make_type_list_of nt | t1, Ltype ({lt_name = "set"},[t2]) -> let (env, ot, nt) = partial_unif ~overloaded loc term t1 t2 env in env, ot, make_set_type nt | Ltype({lt_name = "set"}, [t1]), t2 -> let (env, ot, nt) = partial_unif ~overloaded loc term t1 t2 env in env, make_set_type ot, make_set_type nt | t1,t2 when plain_boolean_type t1 && plain_boolean_type t2 -> env,ot,nt | ((Ctype _ | Linteger | Lreal | Ltype ({lt_name = "boolean"},[])), (Ctype _ | Linteger | Lreal | Ltype ({ lt_name = "boolean"},[]))) -> env,ot,nt | (Ltype _|Larrow _|Lvar _), _ | _, (Larrow _| Ltype _|Lvar _) -> if overloaded then raise Not_applicable else C.error loc "incompatible types %a and %a" Cil_printer.pp_logic_type ot Cil_printer.pp_logic_type nt let instantiate_app ~overloaded loc oterm nt env = let ot = oterm.term_type in let env, ot, nt = partial_unif ~overloaded loc oterm ot nt env in let t,e = implicit_conversion ~overloaded loc { oterm with term_type = ot} ot nt in env, t, e let convertible (t1,t) (t2,_) = let res = try let _ = implicit_conversion ~overloaded:true Cil_datatype.Location.unknown t t1 t2 in true with Not_applicable -> false in Kernel.debug ~level:4 "Checking conversion between %a and %a: %B@." Cil_printer.pp_logic_type t1 Cil_printer.pp_logic_type t2 res; res let convertible_non_null (ty1,t as t1) (ty2,_ as t2) = match (unroll_type ty1, unroll_type ty2) with | Ctype ty1, Ctype ty2 when isPointerType ty1 && isPointerType ty2 && isLogicNull t -> isVoidPtrType ty2 | _ -> convertible t1 t2 (* TODO: filter on signatures, not on type-checked actual arguments !!!!!! *) let filter_non_minimal_arguments l ((_,_,tl,_) as p) = let rec aux acc l = match l with | [] -> p::acc | ((_,_,tl',_) as p')::r -> if List.for_all2 convertible tl tl' then if List.for_all2 convertible tl' tl then (* Both are equivalent. This might come from arbitrary conversions of null pointer. Let's see if one of the list subsumes the other without relying on null ptr. *) if not (List.for_all2 convertible_non_null tl tl') then if not (List.for_all2 convertible_non_null tl' tl) then (* Both have null pointers converted to other type. Just don't choose a representative. *) aux (p'::acc) r else (* just use tl, it has less conversion than tl'. *) aux acc r else (* tl' has less conversion than tl, we can discard the new entry *) List.rev_append acc l else (* tl subtype of tl' *) aux acc r else if List.for_all2 convertible tl' tl then (* tl' subtype of tl *) List.rev_append acc l else aux (p'::acc) r in let l = aux [] l in assert (l <> []); l let rec logic_arithmetic_promotion t = match unroll_type t with | Ctype ty when Cil.isIntegralType ty -> Linteger | Linteger -> Linteger | Lreal -> Lreal | Ctype ty -> (match Cil.unrollType ty with TFloat _ -> Lreal | _ -> Kernel.fatal ~current:true "logic arithmetic promotion on non-arithmetic type %a" Cil_printer.pp_logic_type t) | Ltype ({lt_name="set"} as lt,[t]) -> Ltype(lt,[logic_arithmetic_promotion t]) | Ltype _ | Lvar _ | Larrow _ -> Kernel.fatal ~current:true "logic arithmetic promotion on non-arithmetic type %a" Cil_printer.pp_logic_type t let rec integral_promotion t = match unroll_type t with | Ctype ty when isIntegralType ty -> Linteger | Linteger -> Linteger | Ltype ({lt_name="set"} as lt,[t]) -> Ltype(lt,[integral_promotion t]) | Ltype _ | Lreal | Lvar _ | Larrow _ | Ctype _ -> Kernel.fatal ~current:true "logic integral promotion on non-integral type %a" Cil_printer.pp_logic_type t let mk_shift loc env idx t_elt t = let idx = mk_cast idx (integral_promotion idx.term_type) in let add_offset array idx = Logic_const.term ~loc (TLval (Logic_const.addTermOffsetLval (TIndex (idx, TNoOffset)) array)) t_elt in let here_idx = mk_at_here idx in match t.term_node with | TStartOf array -> add_offset array idx | TLval array when is_array_type t.term_type -> add_offset array idx | Tlet (def, ({ term_node = TLval array} as t)) when is_array_type t.term_type -> Logic_const.term ~loc (Tlet (def, add_offset array idx)) t_elt | Tat({term_node = TStartOf (TVar { lv_origin = Some v},_ as lv)},lab) when v.vformal && lab = old_label && env.Lenv.is_funspec -> Logic_const.tat ~loc (add_offset lv here_idx,lab) | Tat({term_node = TLval (TVar { lv_origin = Some v},_ as lv)},lab) when v.vformal && lab = old_label && env.Lenv.is_funspec && is_array_type t.term_type -> Logic_const.tat ~loc (add_offset lv here_idx,lab) | _ -> let b = { term_node = TBinOp (IndexPI, t, idx); term_name = []; term_loc = loc; term_type = set_conversion t.term_type idx.term_type } in mk_mem b TNoOffset let conditional_conversion loc env rel t1 t2 = let is_rel = Extlib.has_some rel in (* a comparison is mainly a function of type 'a -> 'a -> Bool/Prop. performs the needed unifications on both sides.*) let var = fresh_type_var "cmp" in let env,_,_ = partial_unif ~overloaded:false loc t1 t1.term_type var env in let env,ty2,_ = partial_unif ~overloaded:false loc t2 t2.term_type var env in (* in case first partial unification did not instantiate all variables we do another pass on t1 with information from t2. *) let env,ty1,_ = partial_unif ~overloaded:false loc t1 t1.term_type var env in let rec aux lty1 lty2 = match (unroll_type lty1), (unroll_type lty2) with | Ctype ty1, Ctype ty2 -> if isIntegralType ty1 && isIntegralType ty2 then if is_same_type lty1 lty2 then lty1 else if (isSignedInteger ty1) <> (isSignedInteger ty2) then (* in ACSL, the comparison between 0xFFFFFFFF seen as int and unsigned int is not true: we really have to operate at the integer level. *) Linteger (* comparing an enumerated constant with a value of type enum is done on enum, not on the underlying type. *) else if is_enum_cst t1 lty2 then lty2 else if is_enum_cst t2 lty1 then lty1 else Ctype (C.conditionalConversion ty1 ty2) else if isArithmeticType ty1 && isArithmeticType ty2 then begin if is_same_type lty1 lty2 then begin if is_rel then begin let rel = Extlib.the rel in let kind = match Cil.unrollType ty1 with | TFloat (FFloat,_) -> "float" | TFloat (FDouble,_) -> "double" | TFloat (FLongDouble,_) -> "long double" | _ -> Kernel.fatal "floating point type expected" in let source = fst loc in Kernel.warning ~source ~wkey:Kernel.wkey_acsl_float_compare "comparing two %s values as real values. You might \ want to use \\%s_%s instead" kind rel kind; Lreal end else lty1 end else Lreal end else if is_same_ptr_type ty1 ty2 || is_same_array_type ty1 ty2 then Ctype (C.conditionalConversion ty1 ty2) else if (isPointerType ty1 || isArrayType ty1) && (isPointerType ty2 || isArrayType ty2) then C.error loc "types %a and %a are not convertible" Cil_printer.pp_typ ty1 Cil_printer.pp_typ ty2 else (* pointer to integer conversion *) Ctype (C.conditionalConversion ty1 ty2) | (Linteger, Ctype t | Ctype t, Linteger) when Cil.isIntegralType t -> Linteger | (Linteger, Ctype t | Ctype t, Linteger) when Cil.isArithmeticType t -> Lreal (* In ACSL, you can convert implicitely from integral to boolean => prefer boolean as common type when doing comparison. *) | Ltype({lt_name = name},[]), t when is_integral_type t && name = Utf8_logic.boolean -> Ltype(C.find_logic_type Utf8_logic.boolean,[]) | t, Ltype({lt_name = name},[]) when is_integral_type t && name = Utf8_logic.boolean -> Ltype(C.find_logic_type Utf8_logic.boolean,[]) | Lreal, Ctype ty | Ctype ty, Lreal when isArithmeticType ty -> Lreal | Ltype (s1,l1), Ltype (s2,l2) when s1.lt_name = s2.lt_name && List.for_all2 is_same_type l1 l2 -> lty1 | Lvar s1, Lvar s2 when s1 = s2 -> lty1 | Linteger, Linteger -> Linteger | (Lreal | Linteger) , (Lreal | Linteger) -> Lreal | Ltype ({lt_name = "\\list"} as lt,[t1]), Ltype({lt_name="\\list"},[t2]) -> Ltype(lt,[aux t1 t2]) | Ltype ({lt_name = "set"} as lt,[t1]), Ltype({lt_name="set"},[t2]) -> Ltype(lt,[aux t1 t2]) (* implicit conversion to set *) | Ltype ({lt_name = "set"} as lt,[t1]), t2 | t1, Ltype({lt_name="set"} as lt,[t2]) -> Ltype(lt,[aux t1 t2]) | t1, t2 when is_same_type t1 t2 -> t1 | _ -> C.error loc "types %a and %a are not convertible" Cil_printer.pp_logic_type lty1 Cil_printer.pp_logic_type lty2 in let rt = aux ty1 ty2 in env,rt,ty1,ty2 type conversion = NoConv | ArithConv | IntegralConv | PointerConv let location_set_conversion loc transform_pointer_set t ot nt env = let ot = set_conversion ot nt in if is_same_type ot nt then transform_pointer_set, ot else if is_integral_type ot && is_integral_type nt then let typ = arithmetic_conversion ot nt in IntegralConv, typ else if is_arithmetic_type ot && is_arithmetic_type nt then let typ = arithmetic_conversion ot nt in ArithConv, typ else if is_pointer_type ot && is_pointer_type nt then let typ = Ctype Cil.charPtrType in PointerConv, (if is_set_type ot then make_set_type typ else typ) else let _,_,t = partial_unif ~overloaded:false loc t ot nt env in transform_pointer_set,t let make_set_conversion conv t = match conv with | NoConv -> t | ArithConv -> logic_coerce Lreal t | IntegralConv -> logic_coerce Linteger t | PointerConv -> location_to_char_ptr t let list_conversion loc t ot nt env = if is_same_type ot nt then ot else if plain_integral_type ot && plain_integral_type nt then ot else if plain_arithmetic_type ot && plain_arithmetic_type nt then ot else let _,_,t = partial_unif ~overloaded:false loc t ot nt env in t let list_promotion typ = if plain_integral_type typ then Linteger else if plain_arithmetic_type typ then Lreal else typ let list_coercion typ t = if is_same_type typ t.term_type then t else logic_coerce typ t (* Typing terms *) let parseInt loc s = let explode s = let l = ref [] in String.iter (fun c -> l:=Int64.of_int (Char.code c) :: !l) s; List.rev !l in match String.get s 0 with | 'L' -> (* L'wide_char' *) let content = String.sub s 2 (String.length s - 3) in let tokens = explode content in let value = Cil.reduce_multichar Cil.theMachine.Cil.wcharType tokens in tinteger_s64 ~loc value | '\'' -> (* 'char' *) let content = String.sub s 1 (String.length s - 2) in let tokens = explode content in let value,_= Cil.interpret_character_constant tokens in term ~loc (TConst (constant_to_lconstant value)) Linteger | _ -> Cil.parseIntLogic ~loc s let find_logic_label loc env l = try Lenv.find_logic_label l env with Not_found -> (* look for a C label *) try let lab = C.find_label l in StmtLabel lab with Not_found -> C.error loc "logic label `%s' not found" l let find_old_label loc env = try Lenv.find_logic_label "Old" env with Not_found -> C.error loc "\\old undefined in this context" let default_inferred_label = FormalLabel "L" let find_current_label loc env = match env.Lenv.current_logic_label with | Some lab -> lab | None -> if Lenv.no_label env then begin match !Lenv.default_label with None -> let lab = default_inferred_label in Lenv.default_label := Some lab; lab | Some lab -> lab end else C.error loc "no label in the context. (\\at or explicit label missing?)" let find_current_logic_label loc env = function | None -> find_current_label loc env | Some l -> find_logic_label loc env l let check_current_label loc env = ignore (find_current_label loc env) let labels_assoc loc id env fun_labels effective_labels = match fun_labels, effective_labels with [_], [] -> [find_current_label loc env] | _ -> try List.map2 (fun _ l2 -> l2) fun_labels effective_labels with Invalid_argument _ -> C.error loc "wrong number of labels for %s" id let add_quantifiers ctxt loc ~kind q env = let (tq,env) = List.fold_left (fun (tq,env) (ty, id) -> let ty = unroll_type (logic_type ctxt loc env ty) in let v = Cil_const.make_logic_var_kind id kind ty in (v::tq, Lenv.add_var id v env)) ([],env) q in (List.rev tq,env) class rename_variable v1 v2 = object inherit Cil.nopCilVisitor method! vlogic_var_use v = if v.lv_id = v1.lv_id then ChangeTo v2 else SkipChildren end (* rename v1 into v2 in t *) let rename_variable t v1 v2 = visitCilTerm (new rename_variable v1 v2) t let find_logic_info v env = try Lenv.find_logic_info v.lv_name env with Not_found -> let l = C.find_all_logic_functions v.lv_name in (* Data constructors can not be in eta-reduced form. v must be a logic function, so that List.find can not fail here. *) List.find (fun x -> x.l_var_info.lv_id = v.lv_id) l let eta_expand loc names env v = match (unroll_type v.lv_type) with Larrow(args,rt) -> let (_,vars) = List.fold_right (fun x (i,l) -> i+1, Cil_const.make_logic_var_quant ("x_" ^ (string_of_int i)) x ::l) args (0,[]) in let args = List.map (fun x -> {term_name = []; term_loc = loc; term_node = TLval(TVar x,TNoOffset); term_type = x.lv_type; }) vars in { term_loc = loc; term_name = names; term_node = Tlambda(vars,{term_name = []; term_loc = loc; term_node = (* For now, it is not possible to have labels appended to plain variable, so we have to suppose that v has no label (this is checked when type-checking v as a variable) *) Tapp(find_logic_info v env,[],args); term_type = rt}); term_type = v.lv_type} | _ -> { term_loc = loc; term_name = names; term_node = TLval(TVar v, TNoOffset); term_type = v.lv_type } let fresh_vars known_vars v = if List.mem v.lv_name known_vars then begin let i = ref 0 in while List.mem (v.lv_name ^ "_" ^ string_of_int !i) known_vars do incr i; done; v.lv_name <- v.lv_name ^ "_" ^ string_of_int !i end let normalize_lambda_term env term = let add_binders quants term = match term.term_node, (unroll_type term.term_type) with | Tlambda(quants',term), Larrow (args,rt_typ) -> let args = List.fold_right (fun x l -> x.lv_type :: l) quants args in { term with term_node = Tlambda (quants @ quants', term); term_type = Larrow (args,rt_typ) } | Tlambda _ , _ -> Kernel.fatal ~current:true "\\lambda with a non-arrow type" | _,typ -> { term with term_node = Tlambda(quants, term); term_type = Larrow(List.map (fun x -> x.lv_type) quants,typ) } in let rec aux known_vars kont term = match term.term_node with | TLval(TVar v, TNoOffset) -> known_vars, kont (eta_expand term.term_loc term.term_name env v) | TConst _ | TLval _ | TSizeOf _ | TSizeOfE _ | TSizeOfStr _ | TAlignOf _ | TAlignOfE _ | TUnOp _ | TBinOp _ | TCastE _ | TAddrOf _ | TStartOf _ | Tapp _ | TDataCons _ | Tbase_addr _ | Toffset _ | Tblock_length _ | Tnull | TUpdate _ | Ttypeof _ | Ttype _ | Tempty_set (* [VP] I suppose that an union of functions is theoretically possible but I'm not sure that we want to lift the lambda anyway, even though this contradicts the idea that you can always replace a term by a set of terms *) | Tunion _ | Tinter _ | Tcomprehension _ | Trange _ | TLogic_coerce _ -> known_vars, kont term | Tlambda (quants,term) -> List.iter (fresh_vars known_vars) quants; let known_vars = List.fold_left (fun l x -> x.lv_name :: l) known_vars quants in aux known_vars (kont $ (add_binders quants)) term | Tif (cond, ttrue, tfalse) -> let known_vars, ttrue = aux known_vars (fun x -> x) ttrue in let known_vars, tfalse = aux known_vars (fun x -> x) tfalse in let term = match ttrue.term_node, tfalse.term_node with | Tlambda(quants1,term1), Tlambda(quants2,term2) -> assert( Kernel.verify(List.length quants1 = List.length quants2) "Branches of conditional have different number \ of \\lambda"); let term2 = List.fold_left2 rename_variable term2 quants2 quants1 in { term with term_node = Tlambda(quants1, {term with term_node = Tif(cond,term1,term2); term_type = term1.term_type}); term_type = ttrue.term_type } | Tlambda _, _ | _, Tlambda _ -> Kernel.fatal ~current:true "Branches of conditional have different number of \\lambda" | _,_ -> term in known_vars, kont term | Tat (t,lab) -> let push_at t = match t.term_node with Tlambda(quants,t) -> { term with term_node = Tlambda(quants, {t with term_node = Tat (t,lab)})} | _ -> term in aux known_vars (kont $ push_at) t | Tlet(v,body) -> fresh_vars known_vars v.l_var_info; let known_vars = v.l_var_info.lv_name :: known_vars in let push_let t = match t.term_node with Tlambda(quants, t) -> { term with term_node = Tlambda(quants, { t with term_node = Tlet(v,t) } ); } | _ -> term in aux known_vars (kont $ push_let) body in snd (aux [] (fun x -> x) term) let has_extra_offset_to_TField loc t_type = function (* used for functional update of field under anonymous type *) | PLpathField f -> let f_ofs, _ = plain_type_of_c_field loc f t_type in let result = match f_ofs with | TField (_,TNoOffset) -> false | TField _ -> true ; | _ -> assert false in result | PLpathIndex _ -> false let updated_offset_term idx_typing check_type mk_field mk_idx loc t_type = function | PLpathField f -> let f_ofs, ofs_type = plain_type_of_c_field loc f t_type in let f_ofs, ofs_type = match f_ofs with | TField (f,TNoOffset) ->( mk_field f),ofs_type | TField (f,_) -> (mk_field f), (* f is an anonymous field, find its type *) Ctype (Cil.typeOffset t_type (Field (f,NoOffset))) | _ -> assert false in f_ofs,ofs_type | PLpathIndex idx -> let idx = idx_typing idx in let ofs_type = if Cil.isArrayType t_type && check_type idx.term_type then Ctype (Cil.typeOf_array_elem t_type) else C.error loc "subscripted value is not an array" in mk_idx idx, ofs_type let normalize_updated_offset_term idx_typing env loc t normalizing_cont toff = let t_type = try Logic_utils.logicCType (Logic_utils.unroll_type t.term_type) with Failure _ -> C.error loc "Trying to update field on a non struct type %a" Cil_printer.pp_logic_type t.term_type in let mk_let_info name t t_off2 type2 = match t with | { term_node = TConst _} -> (* just a copy *) assert (t_off2 = TNoOffset) ; (fun id -> id), t, { t with term_node = t.term_node } | { term_node = TLval((TVar _,_) as lv)} -> (* just a copy *) (fun id -> id), t, { t with term_node = TLval(Logic_const.addTermOffsetLval t_off2 lv); term_type = type2} | _ -> (* to build a let *) let var = Lenv.fresh_var env name LVLocal t.term_type in let info = { l_var_info = var; l_labels = []; l_tparams = []; l_type = Some t.term_type; l_profile = []; l_body = LBterm t } in (fun body -> Tlet(info, { t with term_node = body})), { t with term_node = TLval(TVar var,TNoOffset)}, { t with term_node = TLval(TVar var,t_off2); term_type = type2} in let (toff, t_off2, opt_idx_let), ofs_type = let check_type typ = plain_integral_type typ || C.error loc "range is only allowed for last offset" and mk_field f = TField(f,TNoOffset),TField(f,TNoOffset),(fun x -> x) and mk_idx idx = let mk_idx_let, idx, idx2 = mk_let_info "idx" idx TNoOffset idx.term_type in TIndex(idx,TNoOffset),TIndex(idx2,TNoOffset),mk_idx_let in updated_offset_term idx_typing check_type mk_field mk_idx loc t_type toff in let mk_let, t, t2 = mk_let_info "tmp" t t_off2 ofs_type in let v, v_type = normalizing_cont t2 in let v = Logic_const.term ~loc v v_type in let v = mk_cast v ofs_type in let updated = mk_let (opt_idx_let (TUpdate(t,toff,v))) in updated, t.term_type let update_term_wrt_default_label t = match !Lenv.default_label with | None -> t | Some lab -> match t.term_node with | TConst _ | TLval (TVar _ ,_) | Tat _ -> t | _ -> { t with term_node = Tat(t,lab) } (* Updates recursive calls of a function that gets an implicit label during the type-checking of its body. We have to add said implicit label to the call itself to have a consistent AST, i.e. something like logic f{L}(...) = ... f{L}(...). In case of inductive predicates, the considered label is not the one given into the profile of the predicate, but the one given into the defined case, i.e. something like inductive P{...}(...) { case n{L}: .... P{L}(...) }. The visit must be done after the type-checking, as the implicit label may be added after the recursive call has been handled. *) let add_label info lab = let vis = object(self) val mutable curr_lab = lab inherit Cil.nopCilVisitor method! vterm_node t = match t with | Tapp(info',[],args) when Cil_datatype.Logic_info.equal info info' -> ChangeDoChildrenPost(Tapp(info,[curr_lab], args),Extlib.id) | _ -> DoChildren method! vpredicate_node p = match p with | Papp(info',[],args) when Cil_datatype.Logic_info.equal info info' -> ChangeDoChildrenPost (Papp(info, [curr_lab], args),Extlib.id) | _ -> DoChildren method private treat_ind_case (n,labs,t,p as ind) = match labs with | [ mylab ] -> let old = curr_lab in curr_lab <- mylab; let p' = Cil.visitCilPredicate self p in let res = if p' != p then (n, labs, t, p') else ind in curr_lab <- old; res | _ -> ind (* We do not have a context allowing to update the predicate. Implies that any recursive call is already explicitly guarded *) method! vlogic_info_decl info = match info.l_body with | LBinductive l -> let l' = Cil.mapNoCopy self#treat_ind_case l in if l != l' then info.l_body <- LBinductive l'; SkipChildren | _ -> DoChildren end in (* body will be changed in place by visitor if needed. *) ignore (Cil.visitCilLogicInfo vis info) (* In case we have added an implicit label in the environment during type-checking of the body of the logic function/predicate, we update the label list, and visit the body to ensure potential recursive calls are coherent with the declaration. *) let update_info_wrt_default_label info = match info.l_labels with | [] -> (match !Lenv.default_label with | None -> () | Some lab -> info.l_labels <- [ lab ]; add_label info lab ) | _ -> () let update_predicate_wrt_default_label p = match !Lenv.default_label with | None -> p | Some lab -> { p with pred_content = Pat(p,lab) } let update_ind_case_wrt_default_label (name, labs, tvars, p as case) = match labs, !Lenv.default_label with | [], Some lab -> (name, [lab], tvars, update_predicate_wrt_default_label p) | _ -> case type lval_mode = { accept_empty: bool; accept_formal: bool; accept_array: bool; accept_models: bool; accept_func_ptr: bool; } let lval_addressable_mode = { accept_empty = false; accept_formal = true; accept_array = true; accept_models = false; accept_func_ptr = true; } let lval_assignable_mode = { accept_empty = true; accept_formal = true; accept_array = false; accept_models = true; accept_func_ptr = false; } let is_fct_ptr lv = Cil.isLogicFunctionType (Cil.typeOfTermLval lv) let check_lval_kind m t = let rec aux t = match t.term_node with | Tempty_set -> m.accept_empty | TLval (lhost,loff) -> (not (isLogicArrayType t.term_type) || m.accept_array) && (match lhost with | TVar v -> begin match v.lv_origin with | None -> (* specific case: \exit_status is a model of the exit status of the program. *) if Logic_const.is_exit_status t then m.accept_models else false (* pure logic variable, at least as long as model variables are not supported. *) | Some v -> not v.vformal || m.accept_formal end | TResult _ -> m.accept_models | _ -> true) && (match snd (Logic_utils.remove_term_offset loff) with | TModel _ -> m.accept_models | _ -> true) | TAddrOf lv -> is_fct_ptr lv && m.accept_func_ptr | Tif (_,t1,t2) -> aux t1 && aux t2 | Tunion l | Tinter l -> List.for_all aux l | TLogic_coerce (_,t) | Tat (t, _) | Tcomprehension (t,_,_) | Tlet (_, t) -> aux t | Trange _ | TConst _ | TSizeOf _ | TSizeOfE _ | TSizeOfStr _ | TAlignOf _ | TAlignOfE _ | TUnOp (_,_) | TBinOp (_,_,_) | TCastE (_,_) | TStartOf _ | Tlambda (_,_) | TDataCons (_,_) | Tbase_addr (_,_) | Toffset (_,_) | Tblock_length (_,_) | Tnull | Tapp _ | TUpdate (_,_,_) | Ttypeof _ | Ttype _ -> false in aux t let boolean_term_to_predicate t = if Logic_utils.is_zero_comparable t then Logic_utils.scalar_term_to_predicate t else C.error t.term_loc "expecting a term that can be coerced to a boolean" let rec normalize_update_term ctxt env loc t v = let module C = struct end in function (* Transform terms like {x \with .c[idx] = v} into {x \with .c = {x.c \with [idx] = v}}. \let expressions can be introduced. *) | [] -> assert false (* parsing invariant *) | (toff::tail) as offs -> begin let t_type = try Logic_utils.logicCType (Logic_utils.unroll_type t.term_type) with Failure _ -> if ctxt.silent then raise Backtrack; ctxt.error loc "Update field on a non-struct type %a" Cil_printer.pp_logic_type t.term_type in let tail = if has_extra_offset_to_TField loc t_type toff then offs (* fields under an anonymous field are not removed *) else tail in match tail with | [] -> let toff, ofs_type = let mk_field f = TField (f, TNoOffset) and mk_idx idx = TIndex(idx,TNoOffset) and idx_typing idx = ctxt.type_term ctxt env idx in updated_offset_term idx_typing is_integral_type mk_field mk_idx loc t_type toff in let v = ctxt.type_term ctxt env v in let v = mk_cast v ofs_type in let updated = TUpdate(t,toff,v) in updated, t.term_type | toffs -> let idx_typing idx = ctxt.type_term ctxt env idx and normalizing_cont t2 = normalize_update_term ctxt env loc t2 v toffs in normalize_updated_offset_term idx_typing env loc t normalizing_cont toff end and normalize_update_cont ctxt env loc t = let module C = struct end in function | [],_ -> assert false (* parsing invariant *) | _,[] -> assert false (* parsing invariant *) | ((contoffs,PLupdateTerm v)::[]),toffs -> (* {x \with .c1 = {\with .c2 = v}} = {x \with .c1.c2 = v} *) normalize_update_term ctxt env loc t v (toffs@contoffs) | ((contoffs,PLupdateCont v)::[]),toffs -> (* {x \with .c1 = {\with .c2 = {\with...}}} = {x \with .c1.c2 = {\with...}} *) normalize_update_cont ctxt env loc t (v,(toffs@contoffs)) | (cont::conts),toff::[] -> (* {x \with .c1 = {\with .c2 = v2, ..., c22 = v22}} = {x \with .c1 = {...{x.c1 \with .c2 = v2} .. \with c22 = v22} *) let idx_typing idx = ctxt.type_term ctxt env idx in let normalizing_cont t2 = let normalize t = function | contoffs,PLupdateTerm v -> normalize_update_term ctxt env loc t v contoffs | contoffs,PLupdateCont cont -> normalize_update_cont ctxt env loc t (cont, contoffs) in let normalize_folding (tn,typ) cont = normalize (Logic_const.term ~loc tn typ) cont in List.fold_left normalize_folding (normalize t2 cont) conts in normalize_updated_offset_term idx_typing env loc t normalizing_cont toff | cont,toff::toffs -> (* {x \with .c1.c2 = {\with...}} = {x \with .c1 = { x.c1 \with .c2 = {\with...}}} *) let idx_typing idx = ctxt.type_term ctxt env idx and normalizing_cont t2 = normalize_update_cont ctxt env loc t2 (cont,toffs) in normalize_updated_offset_term idx_typing env loc t normalizing_cont toff and locations_set ctxt ~lift_set env loc l init_type = let convert_ptr, locs, typ = List.fold_left (fun (convert_ptr,locs,typ) t -> let t' = ctxt.type_term ctxt env t in if (not lift_set) && is_set_type t'.term_type then begin if ctxt.silent then raise Backtrack; ctxt.error loc "set of sets is not yet implemented" ; end; let convert_ptr, typ = location_set_conversion t'.term_loc convert_ptr t' t'.term_type typ env in assert (locs <> [] || convert_ptr = NoConv); (convert_ptr,t'::locs, typ)) (NoConv, [], init_type) l in let locs = List.rev_map (make_set_conversion convert_ptr) locs in locs,typ and lfun_app ctxt env loc f labels ttl = try let info = ctxt.find_logic_ctor f in if labels <> [] then begin if ctxt.silent then raise Backtrack; ctxt.error loc "symbol %s is a data constructor. \ It cannot have logic labels" f; end; let params = List.map fresh info.ctor_params in let env, tl = type_arguments ~overloaded:false env loc params ttl in let t = Ltype(info.ctor_type, List.map fresh_type_var info.ctor_type.lt_params) in let t = instantiate env t in TDataCons(info,tl), t with Not_found -> let info, label_assoc, tl, t = type_logic_app env loc f labels ttl in match t with | None -> if ctxt.silent then raise Backtrack; ctxt.error loc "symbol %s is a predicate, not a function" f | Some t -> Tapp(info, label_assoc, tl), t and term_node ctxt env loc pl = let term = ctxt.type_term ctxt in let term_ptr pl = let t = term env pl in check_logic_pointer ~check_non_void:false loc t; t in let predicate = ctxt.type_predicate ctxt in match pl with | PLinitIndex _ -> ctxt.error loc "unsupported aggregated array construct" | PLinitField _ -> ctxt.error loc "unsupported aggregated field construct" | PLupdate (t, toff, PLupdateCont cont) -> let t = term env t in normalize_update_cont ctxt env loc t (cont, toff) | PLupdate (t, toff, PLupdateTerm v) -> let t = term env t in normalize_update_term ctxt env loc t v toff | PLsizeof typ -> (match Logic_const.unroll_ltdef (logic_type ctxt loc env typ) with Ctype t -> TSizeOf t,Linteger | _ -> if ctxt.silent then raise Backtrack; ctxt.error loc "sizeof can only handle C types") (* NB: don't forget to add the case of literal string when they are authorized in the logic *) | PLsizeofE { lexpr_node = PLconstant (StringConstant s | WStringConstant s) } -> TSizeOfStr s, Linteger | PLsizeofE lexpr -> let t = term env lexpr in (match Logic_const.unroll_ltdef t.term_type with | Ctype _ -> TSizeOfE t, Linteger | _ -> if ctxt.silent then raise Backtrack; ctxt.error loc "sizeof can only handle C types") | PLnamed _ -> assert false (* should be captured by term *) | PLconstant (IntConstant s) -> begin match (parseInt loc s).term_node with | TConst (Integer _ as c) -> TConst c, Linteger | TConst ((LChr _) as c) -> (* a char literal has type int *) TConst c, Linteger | _ -> assert false end | PLconstant (FloatConstant str) -> TConst (Logic_utils.string_to_float_lconstant str), Lreal | PLconstant (StringConstant s) -> TConst (LStr (unescape s)), Ctype Cil.charPtrType | PLconstant (WStringConstant s) -> TConst (LWStr (wcharlist_of_string s)), Ctype (TPtr(Cil.theMachine.wcharType,[])) | PLvar x -> let old_val info = let term = TLval (TVar info, TNoOffset) in if env.Lenv.is_funspec then begin let term = match Lenv.current_post_state env with None -> term | Some _ -> (match info.lv_origin with Some v when v.vformal -> Tat(Logic_const.term ~loc term info.lv_type, find_logic_label loc env "Old") | Some _ | None -> term) in term, info.lv_type end else term, info.lv_type in begin try let def = ctxt.find_macro x in let t = term env def in t.term_node, t.term_type with Not_found -> try (* NB: In the current implementation and ACSL format, \let can not take a label parameter. If this ever change, we need to check the labelling here as well (see below for globals) *) let lv = Lenv.find_var x env in (match lv.lv_type with | Ctype (TVoid _)-> if ctxt.silent then raise Backtrack; ctxt.error (CurrentLoc.get()) "Variable %s is bound to a predicate, not a term" x | _ -> old_val lv) with Not_found -> try let label = Lenv.string_of_current_label env in let info = ctxt.find_var ?label ~var:x in (match info.lv_origin with | Some lv -> check_current_label loc env; (* access to C variable need a current label *) lv.vreferenced <- true | None -> ()); (match info.lv_type with | Ctype(TFun _ as t) -> (* function decays as a pointer *) TAddrOf (TVar info, TNoOffset), Ctype (TPtr (t,[])) | _ -> old_val info) with Not_found -> try let e,t = ctxt.find_enum_tag x in begin match e.enode with | Const c -> TConst (Logic_utils.constant_to_lconstant c), Ctype t | _ -> assert false end with Not_found -> try fresh_type#reset (); let info = ctxt.find_logic_ctor x in match info.ctor_params with [] -> TDataCons(info,[]), Ltype(info.ctor_type, List.map fresh_type_var info.ctor_type.lt_params) | _ -> ctxt.error loc "Data constructor %s needs arguments" info.ctor_name with Not_found -> (* We have a global logic variable. It may depend on a single state (multiple labels need to be explicitly instantiated and are treated as PLapp below). NB: for now, if we have a real function (with parameters other than labels) and a label, we end up with a Tapp with no argument, which is not exactly good. Either TVar should take an optional label for this particular case, or we should definitely move to partial app everywhere (since we have support for \lambda, this is not a very big step anyway) *) let make_expr f = let typ = match f.l_type, f.l_profile with | Some t, [] -> t | Some t, l -> Larrow (List.map (fun x -> x.lv_type) l, t) | None, _ -> if ctxt.silent then raise Backtrack; ctxt.error loc "%s is not a logic variable" x in let typ = fresh typ in match f.l_labels with [] -> TLval (TVar(f.l_var_info),TNoOffset), typ | [_] -> let curr = find_current_label loc env in Tapp(f,[curr],[]), typ | _ -> ctxt.error loc "%s labels must be explicitly instantiated" x in match ctxt.find_all_logic_functions x with [] -> ctxt.error loc "unbound logic variable %s" x | [f] -> make_expr f | l -> (try let f = List.find (fun info -> info.l_profile = []) l in make_expr f with Not_found -> ctxt.error loc "invalid use of overloaded function \ %s as constant" x) end | PLapp (f, labels, tl) -> let f = try (match (ctxt.find_macro f).lexpr_node with | PLvar (x) -> x | _ -> ctxt.error loc "invalid definition for macro %s" f) with Not_found -> f in let ttl = List.map (term env) tl in fresh_type#reset (); lfun_app ctxt env loc f labels ttl | PLunop (Ubw_not, t) -> let t = type_int_term ctxt env t in TUnOp (BNot, t), logic_arithmetic_promotion t.term_type | PLunop (Uminus, t) -> let t = type_num_term ctxt env t in TUnOp (Neg, t), logic_arithmetic_promotion t.term_type | PLunop (Ustar, t) -> check_current_label loc env; (* memory access need a current label to have some semantics *) let t = term env t in if isLogicPointer t then begin let t = mk_logic_pointer_or_StartOf t in check_non_void_ptr loc t.term_type; let t = mk_mem t TNoOffset in t.term_node, t.term_type end else begin ctxt.error loc "invalid type %a for `unary *'" Cil_printer.pp_logic_type t.term_type end | PLunop (Uamp, t) -> check_current_label loc env; (* &x need a current label to have some semantics *) let t = term env t in if not (check_lval_kind lval_addressable_mode t) then ctxt.error t.term_loc "not an addressable left value: %a" Cil_printer.pp_term t; let t = term_lval (mkAddrOfAndMark loc) t in t.term_node, t.term_type | PLbinop (t1, (Badd | Bsub | Bmul | Bdiv | Bmod | Bbw_and | Bbw_or | Bbw_xor | Blshift | Brshift as op), t2) -> let t1 = term env t1 in let ty1 = t1.term_type in let t2 = term env t2 in let ty2 = t2.term_type in let binop op tr = TBinOp (op, mk_cast t1 tr, mk_cast t2 tr), logic_arithmetic_promotion tr in begin match op with | Bmul | Bdiv when is_arithmetic_type ty1 && is_arithmetic_type ty2 -> binop (type_binop op) (arithmetic_conversion ty1 ty2) | Bmod when is_integral_type ty1 && is_integral_type ty2 -> binop (type_binop op) (arithmetic_conversion ty1 ty2) | Badd | Bsub when is_arithmetic_type ty1 && is_arithmetic_type ty2 -> binop (type_binop op) (arithmetic_conversion ty1 ty2) | Bbw_and | Bbw_or | Bbw_xor when is_integral_type ty1 && is_integral_type ty2 -> binop (type_binop op) (arithmetic_conversion ty1 ty2) | Bbw_xor when is_list_type ty1 && is_list_type ty2 -> fresh_type#reset (); lfun_app ctxt env loc "\\concat" [] [t1;t2] | Blshift | Brshift when is_integral_type ty1 && is_integral_type ty2 -> binop (type_binop op) (arithmetic_conversion ty1 ty2) | Badd when isLogicPointer t1 && is_integral_type ty2 -> let t1 = mk_logic_pointer_or_StartOf t1 in let ty1 = t1.term_type in (match t1.term_node with | TStartOf lv -> TAddrOf (Logic_const.addTermOffsetLval (TIndex (t2,TNoOffset)) lv) | _ -> TBinOp (PlusPI, t1, mk_cast t2 (integral_promotion ty2))), set_conversion ty1 ty2 | Badd when is_integral_type ty1 && isLogicPointer t2 -> let t2 = mk_logic_pointer_or_StartOf t2 in let ty2 = t2.term_type in assert (isLogicPointerType t2.term_type); (match t2.term_node with | TStartOf lv -> TAddrOf ( Logic_const.addTermOffsetLval (TIndex(t1,TNoOffset)) lv) | _ -> TBinOp (PlusPI, t2, mk_cast t1 (integral_promotion ty1))), set_conversion ty2 ty1 | Bsub when isLogicPointer t1 && is_integral_type ty2 -> let t1 = mk_logic_pointer_or_StartOf t1 in TBinOp (MinusPI, t1, mk_cast t2 (integral_promotion ty2)), set_conversion ty1 ty2 | Bsub when isLogicPointer t1 && isLogicPointer t2 -> let t1 = mk_logic_pointer_or_StartOf t1 in let t2 = mk_logic_pointer_or_StartOf t2 in TBinOp (MinusPP, t1, mk_cast t2 ty1), Linteger | _ -> ctxt.error loc "invalid operands to binary %a; unexpected %a and %a" Cil_printer.pp_binop (type_binop op) Cil_printer.pp_logic_type ty1 Cil_printer.pp_logic_type ty2 end | PLdot (t, f) -> let t = term env t in let f_ofs, f_type = type_of_field loc f t.term_type in let t = lift_set (mk_dot env loc f_ofs f_type) t in t.term_node, t.term_type | PLarrow (t, f) -> check_current_label loc env; (* memory access need a current label to have some semantics *) let t = term env t in if not (isLogicPointer t) then ctxt.error loc "%a is not a pointer" Cil_printer.pp_term t; let t = mk_logic_pointer_or_StartOf t in let struct_type = type_of_pointed t.term_type in let f_ofs, f_type = type_of_field loc f struct_type in (mk_mem ~loc t f_ofs).term_node, f_type | PLarrget (t1, t2) -> let t1 = term env t1 in let t2 = term env t2 in (* access to a C value (either array or pointer) *) let t'1, t'2, tres = if isLogicPointer t1 && is_integral_type t2.term_type then begin check_current_label loc env; (* memory access need a current label to have some semantics *) let t1 = mk_logic_pointer_or_StartOf t1 in check_non_void_ptr t1.term_loc t1.term_type; (t1, t2, set_conversion (type_of_pointed t1.term_type) t2.term_type) end else if is_integral_type t1.term_type && isLogicPointer t2 then begin check_current_label loc env; (* memory access need a current label to have some semantics *) let t2 = mk_logic_pointer_or_StartOf t2 in check_non_void_ptr t2.term_loc t2.term_type; (t2, t1, set_conversion (type_of_pointed t2.term_type) t1.term_type) end else if (* purely logical array access. *) isLogicArrayType t1.term_type && is_integral_type t2.term_type then mk_logic_access env t1, t2, type_of_array_elem t1.term_type else if isLogicArrayType t2.term_type && is_integral_type t1.term_type then mk_logic_access env t2, t1, type_of_array_elem t2.term_type else (* error *) if isLogicArrayType t1.term_type || isLogicArrayType t2.term_type then ctxt.error loc "subscript is not an integer range" else ctxt.error loc "subscripted value is neither array nor pointer" in let t = lift_set (mk_shift loc env t'2 tres) t'1 in t.term_node, t.term_type | PLif (t1, t2, t3) -> let t1 = type_bool_term ctxt env t1 in let t2 = term env t2 in let t3 = term env t3 in let env,ty,ty2,ty3 = conditional_conversion loc env None t2 t3 in let t2 = { t2 with term_type = instantiate env t2.term_type } in let _,t2 = implicit_conversion ~overloaded:false loc t2 t2.term_type ty2 in let t3 = { t3 with term_type = instantiate env t3.term_type } in let _,t3 = implicit_conversion ~overloaded:false loc t3 t3.term_type ty3 in Tif (t1, mk_cast t2 ty, mk_cast t3 ty), ty | PLold t -> let lab = find_old_label loc env in let env = Lenv.set_current_logic_label lab env in let t = term env t in (* could be Tat(t,lab) *) Tat (t, Logic_const.old_label), t.term_type | PLat (t, l) -> let lab = find_logic_label loc env l in let env = Lenv.set_current_logic_label lab env in let t = term env t in Tat (t, lab), t.term_type | PLbase_addr (l, t) -> (* base_addr need a current label to have some semantics *) let l = find_current_logic_label loc env l in let t = term_ptr t in let t = lift_set (fun t -> Logic_const.term (Tbase_addr (l,t)) (Ctype Cil.charPtrType)) t in t.term_node, t.term_type | PLoffset (l, t) -> (* offset need a current label to have some semantics *) let l = find_current_logic_label loc env l in let t = term_ptr t in let t = lift_set (fun t -> Logic_const.term (Toffset (l,t)) Linteger) t in t.term_node, t.term_type | PLblock_length (l, t) -> (* block_length need a current label to have some semantics *) let l = find_current_logic_label loc env l in let t = term_ptr t in let t = lift_set (fun t -> Logic_const.term (Tblock_length (l,t)) Linteger) t in t.term_node, t.term_type | PLresult -> (try let t = Lenv.find_var "\\result" env in match t.lv_type with Ctype ty -> TLval(TResult ty,TNoOffset), t.lv_type | _ -> Kernel.fatal ~current:true "\\result associated to non-C type" (* \\result is the value returned by a C function. It has always a C type *) with Not_found -> ctxt.error loc "\\result meaningless") | PLnull -> Tnull, c_void_star | PLcast (ty, t) -> let t = term env t in (* no casts of tsets in grammar *) let ct = Logic_const.unroll_ltdef (logic_type ctxt loc env ty) in let { term_node; term_type } = mk_cast ~explicit:true t ct in (term_node, term_type) | PLrel (t1, (Eq | Neq | Lt | Le | Gt | Ge as op), t2) -> let f _ op t1 t2 = (TBinOp(binop_of_rel op, t1, t2), Ltype(ctxt.find_logic_type Utf8_logic.boolean,[])) in type_relation ctxt env f t1 op t2 | PLtrue -> let ctrue = ctxt.find_logic_ctor "\\true" in TDataCons(ctrue,[]), Ltype(ctrue.ctor_type,[]) | PLfalse -> let cfalse = ctxt.find_logic_ctor "\\false" in TDataCons(cfalse,[]), Ltype(cfalse.ctor_type,[]) | PLlambda(prms,e) -> let (prms, env) = add_quantifiers ctxt loc ~kind:LVFormal prms env in let e = term env e in Tlambda(prms,e),Larrow(List.map (fun x -> x.lv_type) prms,e.term_type) | PLnot t -> let t = type_bool_term ctxt env t in TUnOp(LNot,t), Ltype (ctxt.find_logic_type Utf8_logic.boolean,[]) | PLand (t1,t2) -> let t1 = type_bool_term ctxt env t1 in let t2 = type_bool_term ctxt env t2 in TBinOp(LAnd,t1,t2), Ltype (ctxt.find_logic_type Utf8_logic.boolean,[]) | PLor (t1,t2) -> let t1 = type_bool_term ctxt env t1 in let t2 = type_bool_term ctxt env t2 in TBinOp(LOr,t1,t2), Ltype (ctxt.find_logic_type Utf8_logic.boolean,[]) | PLtypeof t1 -> let t1 = term env t1 in Ttypeof t1, Ltype (ctxt.find_logic_type "typetag",[]) | PLtype ty -> begin match logic_type ctxt loc env ty with | Ctype ty -> Ttype ty, Ltype (ctxt.find_logic_type "typetag",[]) | Linteger | Lreal | Ltype _ | Lvar _ | Larrow _ -> ctxt.error loc "cannot take type tag of logic type" end | PLlet (ident, def, body) -> let tdef = term env def in (* At least for now, the type is supposed to be fully instantiated. No generalization is needed. *) let var = Cil_const.make_logic_info_local ident in let tdef = normalize_lambda_term env tdef in let args, tdef = match tdef.term_node with | Tlambda(args,term) -> args, term | _ -> [],tdef in var.l_type <- Some tdef.term_type; var.l_var_info.lv_type <- tdef.term_type; var.l_profile <- args; var.l_body <- LBterm tdef; let env = Lenv.add_logic_info ident var env in let tbody = term env body in Tlet(var,tbody), tbody.term_type | PLcomprehension(t,quants,pred) -> let quants, env = add_quantifiers ctxt loc ~kind:LVQuant quants env in let t = term env t in if is_set_type t.term_type then begin ctxt.error loc "sets of sets are not supported yet" end else begin let pred = Extlib.opt_map (predicate env) pred in Tcomprehension(t,quants,pred), (make_set_type t.term_type) end | PLempty | PLset [] -> fresh_type#reset(); let typ = make_set_type (fresh_type_var "_") in Tempty_set,typ | PLset l -> fresh_type#reset(); let typ = make_set_type (fresh_type_var "_") in let locs,typ = locations_set ctxt ~lift_set:false env loc l typ in Tunion locs, typ | PLunion l -> fresh_type#reset(); let typ = make_set_type (fresh_type_var "_") in let locs,typ = locations_set ctxt ~lift_set:true env loc l typ in Tunion locs, typ | PLinter l -> fresh_type#reset(); let typ = make_set_type (fresh_type_var "_") in let locs,typ = locations_set ctxt ~lift_set:true env loc l typ in Tinter locs, typ | PLlist l -> fresh_type#reset(); let empty_list,typ_items = let empty_list,typ = lfun_app ctxt env loc "\\Nil" [] [] in empty_list,(type_of_list_elem typ) in let l,typ_items = List.fold_left (fun (l,typ_items) t -> let t' = term env t in let typ_items' = list_conversion t'.term_loc t' typ_items t'.term_type env in (t'::l), typ_items') ([],typ_items) l in let typ_items = list_promotion typ_items in let add_ahead (tnode, typ) e = let t' = { term_node = tnode; term_loc=loc; term_type=typ; term_name = [] } in fresh_type#reset(); lfun_app ctxt env loc "\\Cons" [] [(list_coercion typ_items e);t'] in List.fold_left add_ahead (empty_list, (make_type_list_of typ_items)) l | PLrepeat (t1,t2) -> let t1 = term env t1 in let t2 = term env t2 in fresh_type#reset (); lfun_app ctxt env loc "\\repeat" [] [t1; t2] | PLrange (t1,t2) -> (* we allow range of floats/real. *) let t1,ty1 = type_num_term_option ctxt env t1 in let t2,ty2 = type_num_term_option ctxt env t2 in (Trange(t1,t2), Ltype(ctxt.find_logic_type "set", [arithmetic_conversion ty1 ty2])) | PLvalid _ | PLvalid_read _ | PLvalid_function _ | PLfresh _ | PLallocable _ | PLfreeable _ | PLinitialized _ | PLdangling _ | PLexists _ | PLforall _ | PLimplies _ | PLiff _ | PLxor _ | PLseparated _ -> if ctxt.silent then raise Backtrack; ctxt.error loc "syntax error (expression expected but predicate found)" and type_relation: 'a. _ -> _ -> (_ -> _ -> _ -> _ -> 'a) -> _ -> _ -> _ -> 'a = fun ctxt env f t1 op t2 -> let loc1 = t1.lexpr_loc in let loc2 = t2.lexpr_loc in let loc = loc_join t1.lexpr_loc t2.lexpr_loc in let t1 = ctxt.type_term ctxt env t1 in let ty1 = t1.term_type in let t2 = ctxt.type_term ctxt env t2 in let ty2 = t2.term_type in let rel = match op with | Eq -> "eq" | Neq -> "ne" | Le -> "le" | Lt -> "lt" | Ge -> "ge" | Gt -> "gt" in let conditional_conversion t1 t2 = let env,t,ty1,ty2 = conditional_conversion loc env (Some rel) t1 t2 in let t1 = { t1 with term_type = instantiate env t1.term_type } in let _,t1 = implicit_conversion ~overloaded:false loc1 t1 t1.term_type ty1 in let t2 = { t2 with term_type = instantiate env t2.term_type } in let _,t2 = implicit_conversion ~overloaded:false loc2 t2 t2.term_type ty2 in f loc op (mk_cast t1 t) (mk_cast t2 t) in begin match op with | _ when plain_arithmetic_type ty1 && plain_arithmetic_type ty2 -> conditional_conversion t1 t2 | Eq | Neq when isLogicPointer t1 && isLogicNull t2 -> let t1 = mk_logic_pointer_or_StartOf t1 in let t2 = (* in case of a set, we perform two conversions: first from integer to pointer, then from pointer to set of pointer. *) if is_set_type t1.term_type then mk_cast t2 (type_of_set_elem t1.term_type) else t2 in f loc op t1 (mk_cast t2 t1.term_type) | Eq | Neq when isLogicPointer t2 && isLogicNull t1 -> let t2 = mk_logic_pointer_or_StartOf t2 in let t1 = if is_set_type t2.term_type then mk_cast t1 (type_of_set_elem t2.term_type) else t1 in f loc op (mk_cast t1 t2.term_type) t2 | Eq | Neq when isLogicArrayType ty1 && isLogicArrayType ty2 -> if is_same_logic_array_type ty1 ty2 then f loc op t1 t2 else ctxt.error loc "comparison of incompatible types %a and %a" Cil_printer.pp_logic_type ty1 Cil_printer.pp_logic_type ty2 | _ when isLogicPointer t1 && isLogicPointer t2 -> let t1 = mk_logic_pointer_or_StartOf t1 in let t2 = mk_logic_pointer_or_StartOf t2 in if is_same_logic_ptr_type ty1 ty2 || ((op = Eq || op = Neq) && (isLogicVoidPointerType t1.term_type || isLogicVoidPointerType t2.term_type)) then f loc op t1 t2 else if (op=Eq || op = Neq) then conditional_conversion t1 t2 else ctxt.error loc "comparison of incompatible types: %a and %a" Cil_printer.pp_logic_type t1.term_type Cil_printer.pp_logic_type t2.term_type | Eq | Neq -> conditional_conversion t1 t2 | _ -> ctxt.error loc "comparison of incompatible types: %a and %a" Cil_printer.pp_logic_type t1.term_type Cil_printer.pp_logic_type t2.term_type end and term_lval f t = let check_lval t = match t.term_node with TLval lv | TLogic_coerce(_,{term_node = TLval lv }) | Tat({term_node = TLval lv},_) -> f lv t | TStartOf lv | Tat ({term_node = TStartOf lv}, _) -> f lv t | TAddrOf lv when is_fun_ptr t.term_type -> f lv { t with term_type = type_of_pointed t.term_type; term_node = TLval lv } | _ -> C.error t.term_loc "not a left value: %a" Cil_printer.pp_term t in lift_set check_lval t and type_logic_app env loc f labels ttl = (* support for overloading *) let infos = try [Lenv.find_logic_info f env] with Not_found -> C.find_all_logic_functions f in match infos with | [] -> C.error loc "unbound function %s" f | [info] -> begin let labels = List.map (find_logic_label loc env) labels in let params = List.map (fun x -> fresh x.lv_type) info.l_profile in let env, tl = type_arguments ~overloaded:false env loc params ttl in let label_assoc = labels_assoc loc f env info.l_labels labels in match info.l_type with | Some t -> let t = fresh t in let t = instantiate env t in info, label_assoc, tl, Some t | None -> info, label_assoc, tl, None end | _ -> (* overloading *) let l = List.fold_left (fun acc info -> try let labels = List.map (find_logic_label loc env) labels in let params = List.map (fun x -> fresh x.lv_type) info.l_profile in let env, tl = type_arguments ~overloaded:true env loc params ttl in let tl = List.combine (List.map (instantiate env) params) tl in let label_assoc = labels_assoc loc f env info.l_labels labels in match info.l_type with | Some t -> let t = fresh t in let t = try instantiate env t with _ -> raise Not_applicable in (info, label_assoc, tl, Some t)::acc | None -> (info, label_assoc, tl, None)::acc with Not_applicable -> acc) [] infos in (* remove non-minimal calls *) let l = List.fold_left filter_non_minimal_arguments [] l in match l with | [] -> let tl = List.map (fun t -> t.term_type) ttl in C.error loc "no such predicate or logic function %s(%a)" f (Pretty_utils.pp_list ~sep:",@ " Cil_printer.pp_logic_type) tl | [x,y,z,t] -> (x,y,(List.map (fun (t, e) -> mk_cast e t) z),t) | _ -> let tl = List.map (fun t -> t.term_type) ttl in C.error loc "ambiguous logic call to %s(%a)" f (Pretty_utils.pp_list ~sep:",@ " Cil_printer.pp_logic_type) tl and type_int_term ctxt env t = let module C = struct end in let tt = ctxt.type_term ctxt env t in if not (plain_integral_type tt.term_type) then ctxt.error t.lexpr_loc "integer expected but %a found" Cil_printer.pp_logic_type tt.term_type; tt and type_bool_term ctxt env t = let module C = struct end in let tt = ctxt.type_term ctxt env t in if not (plain_boolean_type tt.term_type) then ctxt.error t.lexpr_loc "boolean expected but %a found" Cil_printer.pp_logic_type tt.term_type; mk_cast tt (Ltype (ctxt.find_logic_type Utf8_logic.boolean,[])) and type_num_term_option ctxt env t = let module C = struct end in match t with None -> None, Linteger (* Warning: should be an hybrid of integer and float. *) | Some t -> let t = type_num_term ctxt env t in Some t, t.term_type and type_num_term ctxt env t = let module C = struct end in let tt = ctxt.type_term ctxt env t in if not (is_arithmetic_type tt.term_type) then ctxt.error t.lexpr_loc "integer or float expected"; tt (* type_arguments checks if argument list tl is well-typed for the formal parameter list at *) and type_arguments ~overloaded env loc at tl = let rec type_list env = function | [], [] -> env, [] | et :: etl, ({term_loc=tloc} as t) :: tl -> let env, _,et' = instantiate_app ~overloaded tloc t et env in let env, l = type_list env (etl, tl) in env, et' :: l | [], _ -> if overloaded then raise Not_applicable else C.error loc "too many arguments" | _, [] -> if overloaded then raise Not_applicable else C.error loc "partial application" in let rec conversion env = function | [], [] -> [] | et::etl, ({term_loc=tloc} as t) :: tl -> let iet = instantiate env et in let _,t = implicit_conversion ~overloaded tloc t t.term_type iet in let t = if overloaded then t else mk_cast t iet in let l = conversion env (etl,tl) in t::l | _ -> assert false (* captured by first auxiliary function *) in let env, args = type_list env (at, tl) in (* perform conversion triggered by latter args over the former ones *) let res = conversion env (at,args) in env, res and boolean_to_predicate ctxt env p0 = boolean_term_to_predicate (ctxt.type_term ctxt env p0) and abstract_predicate ctxt env p0 = let loc = p0.lexpr_loc in match p0.lexpr_node with PLlambda (args,p) -> let (prms,env) = add_quantifiers ctxt loc ~kind:LVFormal args env in let other_prms, p = abstract_predicate ctxt env p in (other_prms @ prms), p | _ -> [], ctxt.type_predicate ctxt env p0 let term_lval_assignable ctxt ~accept_formal env t = let module C = struct end in let t = ctxt.type_term ctxt env t in if not (check_lval_kind { lval_assignable_mode with accept_formal } t) then ctxt.error t.term_loc "not an assignable left value: %a" Cil_printer.pp_term t; lift_set (term_lval (fun _ t -> t)) t let term ctxt env t = let module C = struct end in match t.lexpr_node with | PLnamed(name,t) -> let t = ctxt.type_term ctxt env t in { t with term_name = name :: t.term_name } | _ -> let t', ty = term_node ctxt env t.lexpr_loc t.lexpr_node in { term_node = t'; term_loc=t.lexpr_loc; term_type=ty; term_name = [] } let predicate ctxt env p0 = let module C = struct end in let loc = p0.lexpr_loc in let predicate = ctxt.type_predicate ctxt in let term = ctxt.type_term ctxt in (* Auxiliary functions for valid, valid_read, initialized, dangling, separated, freeable and allocable. For the last two predicates, don't check that the pointer is not void. *) let term_ptr ~check_non_void t = let t = term env t in check_logic_pointer ~check_non_void loc t; t in let predicate_label_ptr ~check_non_void fpred label t = let t = term_ptr ~check_non_void t in let l = find_current_logic_label loc env label in (* higher-order funs do not mix well with (optional) labels, hence the binding below. *) let loc = Some loc in fpred ?loc (l,t) in match p0.lexpr_node with | PLfalse -> unamed ~loc Pfalse | PLtrue -> unamed ~loc Ptrue | PLrel (t1, (Eq | Neq | Lt | Le | Gt | Ge as op), t2) -> let f loc op t1 t2 = prel ~loc (type_rel op, t1, t2) in type_relation ctxt env f t1 op t2 | PLand (p1, p2) -> pand ~loc (predicate env p1, predicate env p2) | PLor (p1, p2) -> por ~loc (predicate env p1, predicate env p2) | PLxor (p1, p2) -> pxor ~loc (predicate env p1, predicate env p2) | PLimplies (p1, p2) -> pimplies ~loc (predicate env p1, predicate env p2) | PLiff (p1, p2) -> piff ~loc (predicate env p1, predicate env p2) | PLnot p -> (match (predicate env p) with | {pred_content = Prel (Cil_types.Rneq, t, z)} when isLogicZero z -> prel ~loc (Cil_types.Req, t, Cil.lzero ~loc ()) | p -> pnot ~loc p) | PLapp (p, labels, tl) -> let ttl= List.map (term env) tl in let info, label_assoc, tl, t = type_logic_app env loc p labels ttl in begin match t with | Some t -> (* error loc "%s is a function, not a predicate" p *) boolean_term_to_predicate { term_loc = loc; term_node = Tapp(info, label_assoc, tl); term_type = t ; term_name = []} | None -> papp ~loc (info, label_assoc, tl) end | PLif (t, p1, p2) -> begin try let t = type_bool_term { ctxt with silent = true } env t in pif ~loc (t, predicate env p1, predicate env p2) with Backtrack -> (* p1 ? p2 : p3 is syntactic sugar for (p1 ==> p2) && (!p1 ==> p3) *) predicate env {lexpr_node = (PLand ({lexpr_node = (PLimplies (t, p1)); lexpr_loc = loc}, {lexpr_node = (PLimplies ({lexpr_node = PLnot t; lexpr_loc = loc}, p2)); lexpr_loc = loc})); lexpr_loc = loc} end | PLforall (q, p) -> let q, env' = add_quantifiers ctxt loc ~kind:LVQuant q env in pforall ~loc (q, predicate env' p) | PLexists (q, p) -> let q, env' = add_quantifiers ctxt loc ~kind:LVQuant q env in pexists ~loc (q, predicate env' p) | PLfresh (l12,t,n) -> let l1,l2= match l12 with | None -> (find_logic_label loc env "Old"),(find_current_label loc env ) | Some (l1,l2) -> (find_logic_label loc env l1),(find_logic_label loc env l2) in let tloc = t.lexpr_loc in if l1 == l2 then ctxt.error tloc "\\fresh requires two different labels"; let t = term_ptr ~check_non_void:false t in let n = term env n in pfresh ~loc (l1, l2, t, n) | PLfreeable (l, t) -> predicate_label_ptr ~check_non_void:false pfreeable l t | PLallocable (l, t) -> predicate_label_ptr ~check_non_void:false pallocable l t | PLvalid_read (l, t) -> predicate_label_ptr ~check_non_void:true pvalid_read l t | PLvalid (l,t) -> predicate_label_ptr ~check_non_void:true pvalid l t | PLvalid_function t -> let t = term env t in if isLogicPointer t then begin check_fun_ptr loc t.term_type; let t = mk_logic_pointer_or_StartOf t in pvalid_function ~loc t end else ctxt.error loc "subscripted value is neither array nor pointer" | PLinitialized (l,t) -> predicate_label_ptr ~check_non_void:true pinitialized l t | PLdangling (l,t) -> predicate_label_ptr ~check_non_void:true pdangling l t | PLold p -> let lab = find_old_label loc env in let env = Lenv.set_current_logic_label lab env in (* could be Tat(t,lab) *) pold ~loc (predicate env p) | PLat (p, l) -> let lab = find_logic_label loc env l in let env = Lenv.set_current_logic_label lab env in pat ~loc (predicate env p, lab) | PLvar x -> (try let def = ctxt.find_macro x in predicate env def with Not_found -> let make_app info = match info.l_type with | None -> let labels = match info.l_labels with [] -> [] | [_] -> [find_current_label loc env] | _ -> ctxt.error loc "%s labels must be explicitly instantiated" x in papp ~loc (info,labels,[]) | Some _ -> boolean_to_predicate ctxt env p0 in try make_app (Lenv.find_logic_info x env) with Not_found -> (try let info = List.find (fun x -> x.l_profile = []) (ctxt.find_all_logic_functions x) in make_app info with Not_found -> boolean_to_predicate ctxt env p0)) | PLlet(x,def,body) -> let typ, args, tdef = try let tdef = ctxt.type_term { ctxt with silent = true} env def in let tdef = normalize_lambda_term env tdef in (match tdef.term_node with Tlambda(args,t) -> Some t.term_type, args, LBterm t | _ -> Some tdef.term_type,[], LBterm tdef) with Backtrack -> let args, tdef = abstract_predicate ctxt env def in None, args, LBpred tdef in let var = Cil_const.make_logic_info_local x in var.l_profile <- args; var.l_var_info.lv_type <- (match typ with None -> Ctype (Cil.voidType) | Some t -> t); var.l_type <- typ; var.l_body <- tdef; let env = Lenv.add_logic_info x var env in let tbody = predicate env body in { pred_name = []; pred_loc = loc; pred_content = Plet(var,tbody) } | PLcast _ | PLblock_length _ | PLbase_addr _ | PLoffset _ | PLrepeat _ | PLlist _ | PLarrget _ | PLarrow _ | PLdot _ | PLbinop _ | PLunop _ | PLconstant _ | PLnull | PLresult | PLsizeof _ | PLsizeofE _ | PLlambda _ | PLupdate _ | PLinitIndex _ | PLinitField _ | PLtypeof _ | PLtype _ -> boolean_to_predicate ctxt env p0 | PLrange _ -> ctxt.error loc "cannot use operator .. within a predicate" | PLnamed (n, p) -> let p = predicate env p in { p with pred_name = n::p.pred_name } | PLseparated seps -> let seps = List.map (term_ptr ~check_non_void:true) seps in pseparated ~loc seps | PLcomprehension _ | PLset _ | PLunion _ | PLinter _ | PLempty -> ctxt.error loc "expecting a predicate and not tsets" let type_from ctxt ~accept_formal env (l,d) = let module C = struct end in (* Yannick: [assigns *\at(\result,Post)] should be allowed *) let tl = term_lval_assignable ctxt ~accept_formal env l in let tl = Logic_const.new_identified_term tl in match d with FromAny -> (tl,Cil_types.FromAny) | From f -> let tf = List.map (term_lval_assignable ctxt ~accept_formal:true env) f in let tf = List.map (fun td -> if Logic_utils.contains_result td then ctxt.error td.term_loc "invalid \\result in dependencies"; Logic_const.new_identified_term td) tf in (tl, Cil_types.From tf) let type_assign ctxt ~accept_formal env a = let module C = struct end in match a with WritesAny -> Cil_types.WritesAny | Writes l -> let res = List.map (type_from ctxt ~accept_formal env) l in (* we drop assigns \result; and assigns \exit_status; without from clause, as this does not convey any information. *) let res = List.filter (fun (l,f) -> not (Logic_const.is_result l.it_content || Logic_const.is_exit_status l.it_content) || f <> Cil_types.FromAny) res in Cil_types.Writes res let base_ctxt env = make_typing_context ~pre_state:env ~post_state:(fun _ -> env) ~assigns_env:env ~logic_type:logic_type ~type_predicate:predicate ~type_term:term ~type_assigns:type_assign let type_term = term let type_predicate = predicate let term env t = term (base_ctxt env) env t let predicate env t = predicate (base_ctxt env) env t let type_variant env = function | (t, None) -> (type_int_term (base_ctxt env) env t, None) | (t, r) -> (term env t, r) let id_predicate env pred = Logic_const.new_predicate (predicate env pred) let id_term_ptr env t = let loc = t.lexpr_loc in let t = term env t in check_logic_pointer ~check_non_void:false loc t; Logic_const.new_identified_term (t) let plain_logic_type loc env t = logic_type (base_ctxt env) loc env t (* For Widen_hints and Widen_variables, we check that the arguments of the pragma can be understood later. Keep this code synchronized with src/plugins/value/utils/widen.ml. *) let loop_pragma env p = let accept_int = function { term_node = TConst (Integer _)} -> true | _ -> false in let accept_var = function { term_node = TLval (TVar {lv_origin = Some _}, _)} -> true | _ -> false in (* fail when the translation of [p] does not verify the predicate [accept]*) let term_accept accept p = let t = term env p in if not (accept t) then C.error t.term_loc "invalid pragma '%a'" Cil_printer.pp_term t; t in match p with | Unroll_specs l -> Cil_types.Unroll_specs (List.map (term env) l) | Widen_variables l -> Cil_types.Widen_variables (List.map (term_accept accept_var) l) | Widen_hints l -> let accept t = accept_int t || accept_var t in Cil_types.Widen_hints (List.map (term_accept accept) l) let type_annot loc ti = let env = append_here_label (append_init_label (Lenv.empty())) in let this_type = plain_logic_type loc env ti.this_type in let v = Cil_const.make_logic_var_formal ti.this_name this_type in let env = Lenv.add_var ti.this_name v env in let body = predicate env ti.inv in let infos = Cil_const.make_logic_info ti.inv_name in infos.l_profile <- [v]; infos.l_labels <- [Logic_const.here_label]; infos.l_body <- LBpred body; add_logic_function loc infos; infos let model_annot loc ti = let env = Lenv.empty() in let model_for_type = plain_logic_type loc env ti.model_for_type |> c_type_of loc in if has_field ti.model_name model_for_type then C.error loc "Cannot add model field %s for type %a: it already exists" ti.model_name Cil_printer.pp_typ model_for_type else begin let model_type = plain_logic_type loc env ti.model_type in let infos = { mi_name = ti.model_name; mi_base_type = model_for_type; mi_field_type = model_type; mi_decl = loc; mi_attr = []; } in Logic_env.add_model_field infos; infos end let check_behavior_names loc existing_behaviors names = List.iter (fun x -> if not (List.mem x existing_behaviors) then C.error loc "reference to unknown behavior %s" x) names let check_unique_behavior_names loc old_behaviors behaviors = List.fold_left (fun names b -> let open Cil_types in if b.b_name = Cil.default_behavior_name then names else begin if (List.mem b.b_name names) then C.error loc "behavior %s already defined" b.b_name ; b.b_name::names end) old_behaviors behaviors let type_extended ~typing_context ~loc (name,ps) = let loc = match ps with | [] -> loc | p::_ -> p.lexpr_loc in if Extensions.is_extension name then let status , kind = Extensions.typer name ~typing_context ~loc ps in Logic_const.new_acsl_extension name loc status kind else C.error loc "No type-checking function registered for extension %s" name (* This module is used to sort the list of behaviors in [complete] and [disjoint] clauses, in order to remove duplicate clauses. *) module StringListSet = FCSet.Make( struct type t = string list let compare s1 s2 = Transitioning.Stdlib.(compare (List.sort compare s1) (List.sort compare s2)) end) let type_spec old_behaviors loc is_stmt_contract result env s = let env = append_here_label (append_init_label env) in let env_with_result = add_result env result in let env_with_result_and_exit_status = add_exit_status env_with_result in (* assigns_env is a bit special: - both \result and \exit_status (in a \at(_,Post) term are admissible) - Old and Post labels are admissible - Default label is Old (Assigns are evaluated in Pre-state * allocates is also using assigns_env *) let assigns_env = env_with_result_and_exit_status in let assigns_env = append_old_and_post_labels assigns_env in let old = Lenv.find_logic_label "Old" assigns_env in let assigns_env = Lenv.set_current_logic_label old assigns_env in let assigns_env = Lenv.exit_post_state (Lenv.enter_post_state assigns_env Exits) in let post_state_env k = let env = match k with | Returns -> env_with_result | Normal -> if is_stmt_contract then env else env_with_result | Exits -> add_exit_status env | Breaks | Continues -> env in Lenv.enter_post_state (append_old_and_post_labels env) k in let rec multiple_post_clauses_state_env l = match l with | [] -> env | [x] -> post_state_env x (* Usual case*) (* The two cases below are used in the ACSL importer plugin *) | (Returns|Normal)::r -> add_result (multiple_post_clauses_state_env r) result | (Exits|Breaks|Continues)::r -> Lenv.enter_post_state (multiple_post_clauses_state_env r) Exits in let spec_behavior = let spec_behavior = s.spec_behavior in if spec_behavior = [] then (* at least allocates \nothing *) [Cabshelper.mk_behavior ()] else spec_behavior in let b = List.map (fun {b_assigns= ba; b_name; b_post_cond=be; b_assumes= bas; b_allocation=bfa; b_requires=br; b_extended=bext} -> let typing_context = make_typing_context ~pre_state:env ~post_state:multiple_post_clauses_state_env ~assigns_env:assigns_env ~logic_type ~type_predicate ~type_term ~type_assigns:type_assign in let b_assumes = List.map (id_predicate env) bas in let b_requires= List.map (id_predicate env) br in let b_post_cond = List.map (fun (k,p)-> let p' = id_predicate (post_state_env k) p in (k,p')) be in let b_assigns = type_assign typing_context ~accept_formal:is_stmt_contract assigns_env ba in let b_allocation= match bfa with | FreeAllocAny -> Cil_types.FreeAllocAny | FreeAlloc(f,a) -> Cil_types.FreeAlloc((List.map (id_term_ptr env) f), List.map (id_term_ptr (post_state_env Normal)) a) in let b_extended = List.map (type_extended ~typing_context ~loc) bext in { Cil_types.b_name; b_assumes; b_requires; b_post_cond; b_assigns; b_allocation; b_extended } ) spec_behavior in let none_for_stmt_contract clause = function | None -> None | (Some _) as x -> if is_stmt_contract then C.error loc "%s clause isn't allowed into statement contract" clause; x in let v = Extlib.opt_map (type_variant env) (none_for_stmt_contract "decreases" s.spec_variant) in let t = Extlib.opt_map (id_predicate env) (none_for_stmt_contract "terminates" s.spec_terminates) in let my_names = check_unique_behavior_names loc [] b in let bnames = old_behaviors @ my_names in let expand_my_names = function | [] -> if my_names = [] then C.error loc "complete or disjoint behaviors clause in a contract with empty \ list of behavior" else my_names | l -> l in let complete = List.map expand_my_names s.spec_complete_behaviors in let disjoint = List.map expand_my_names s.spec_disjoint_behaviors in List.iter (check_behavior_names loc bnames) complete; List.iter (check_behavior_names loc bnames) disjoint; let cleanup_duplicate l = StringListSet.(elements (List.fold_left (fun acc e -> add e acc) empty l)) in let complete = cleanup_duplicate complete in let disjoint = cleanup_duplicate disjoint in { Cil_types.spec_behavior = b; spec_variant = v; spec_terminates = t; spec_complete_behaviors = complete; spec_disjoint_behaviors = disjoint; } let funspec old_behaviors vi formals typ s = let env = append_pre_label (Lenv.funspec()) in let log_return_typ = Ctype (Cil.getReturnType typ) in let env = match formals with | None -> (* This is the spec of a function declaration *) let add_formal env v = Lenv.add_var v.vname (Cil.cvar_to_lvar v) env in begin try List.fold_left add_formal env (Cil.getFormalsDecl vi) with Not_found -> env (*declaration with an empty list of argument*) end | Some formals -> let add_formal env v = Lenv.add_var v.vname (Cil.cvar_to_lvar v) env in List.fold_left add_formal env formals in type_spec old_behaviors vi.vdecl false log_return_typ env s let slice_pragma env = function SPexpr t -> Cil_types.SPexpr (term env t) | SPctrl -> Cil_types.SPctrl | SPstmt -> Cil_types.SPstmt let impact_pragma env = function IPexpr t -> Cil_types.IPexpr (term env t) | IPstmt -> Cil_types.IPstmt let code_annot_env () = let env = append_here_label (append_pre_label (append_init_label (Lenv.empty()))) in if C.is_loop () then append_loop_labels env else env let loop_annot_env () = append_loop_labels (append_here_label (append_pre_label (append_init_label (Lenv.empty())))) let assertion_kind = function Assert -> Cil_types.Assert | Check -> Cil_types.Check let code_annot loc current_behaviors current_return_type ca = let source = fst loc in let annot = match ca with | AAssert (behav,k,p) -> check_behavior_names loc current_behaviors behav; Cil_types.AAssert(behav,assertion_kind k,predicate (code_annot_env()) p) | APragma (Impact_pragma sp) -> Cil_types.APragma (Cil_types.Impact_pragma (impact_pragma (code_annot_env()) sp)) | APragma (Slice_pragma sp) -> Cil_types.APragma (Cil_types.Slice_pragma (slice_pragma (code_annot_env()) sp)) | APragma (Loop_pragma lp) -> Cil_types.APragma (Cil_types.Loop_pragma (loop_pragma (code_annot_env()) lp)) | AStmtSpec (behav,s) -> (* function behaviors and statement behaviors are not at the same level. Do not mix them in a complete or disjoint clause here. *) check_behavior_names loc current_behaviors behav; let env = append_pre_label (Lenv.empty()) in let my_spec = type_spec [] loc true current_return_type env s in ignore (check_unique_behavior_names loc current_behaviors my_spec.Cil_types.spec_behavior); Cil_types.AStmtSpec (behav,my_spec) | AVariant v -> Cil_types.AVariant (type_variant (loop_annot_env ()) v) | AInvariant (behav,f,i) -> let env = if f then loop_annot_env () else code_annot_env () in check_behavior_names loc current_behaviors behav; Cil_types.AInvariant (behav,f,predicate env i) | AAllocation (behav,fa) -> check_behavior_names loc current_behaviors behav; Cil_types.AAllocation(behav, (match fa with | FreeAllocAny -> Cil_types.FreeAllocAny | FreeAlloc(f,a) -> Cil_types.FreeAlloc((List.map (id_term_ptr (loop_annot_env())) f), List.map (id_term_ptr (loop_annot_env())) a))); | AAssigns (behav,a) -> let env = loop_annot_env () in let ctxt = base_ctxt env in Cil_types.AAssigns(behav, type_assign ctxt ~accept_formal:true env a) | AExtended (behav, is_loop, (name, _ as ext)) -> let kind = Logic_env.extension_category name in let pre_state, post_state = match kind,is_loop with | Some (Ext_code_annot Ext_here), false -> code_annot_env (), fun _ -> Lenv.empty () | Some (Ext_code_annot (Ext_next_stmt | Ext_next_both)), false -> let env = append_old_and_post_labels (code_annot_env()) in (env, function [Normal] -> env | _ -> Lenv.empty ()) | Some (Ext_code_annot (Ext_next_loop | Ext_next_both)), true -> loop_annot_env(), fun _ -> Lenv.empty () | Some (Ext_code_annot Ext_next_loop), false -> Kernel.( warning ~source ~wkey:wkey_acsl_extension "%s is a loop annotation extension, \ but used here as code annotation" name); code_annot_env (), fun _ -> Lenv.empty() | Some (Ext_code_annot (Ext_here | Ext_next_stmt)), true -> Kernel.( warning ~source ~wkey:wkey_acsl_extension "%s is a code annotation extension, \ but used here as loop annotation" name); code_annot_env (), fun _ -> Lenv.empty() | (Some (Ext_global | Ext_contract) | None),_ -> Kernel.( warning ~source ~wkey:wkey_acsl_extension "%s is not a code annotation extension" name); code_annot_env (), fun _ -> Lenv.empty() in let assigns_env = Lenv.empty() in let type_assigns = type_assign in let typing_context = make_typing_context ~pre_state ~post_state ~assigns_env ~logic_type ~type_predicate ~type_term ~type_assigns in Cil_types.AExtended (behav, is_loop, type_extended ~typing_context ~loc ext) in Logic_const.new_code_annotation annot let formals loc env p = let add_var (p,env) (t,x) = let lt = plain_logic_type loc env t in let var = Cil_const.make_logic_var_formal x lt in (var::p, Lenv.add_var x var env) in let (p,env) = List.fold_left add_var ([],env) p in List.rev p, env let init_type_variables loc l = List.fold_left (fun env x -> try ignore (Lenv.find_type_var x env); C.error loc "duplicated type variable in annotation" with Not_found -> Lenv.add_type_var x (Lvar x) env) (Lenv.empty()) l let rec is_cyclic_typedef s = function | None -> false | Some (LTsum _) -> false | Some (LTsyn typ) -> is_cyclic_typedef_aux s typ and is_cyclic_typedef_aux s = function | Ltype ({ lt_name = s'; lt_def = d },_) -> s = s' || is_cyclic_typedef s d | Larrow (prm,rt) -> List.exists (is_cyclic_typedef_aux s) prm || is_cyclic_typedef_aux s rt | _ -> false (* checks whether all the type variable contained in the return type t of a logic function are bound in a parameter's type (p being the list of formals). type-checking error otherwise *) let check_polymorphism loc ?return_type p = let obj known_vars = let update_known_vars s = known_vars:= Datatype.String.Set.add s !known_vars in object inherit Cil.nopCilVisitor method! vlogic_type = function Lvar s -> update_known_vars s; Cil.DoChildren | _ -> Cil.DoChildren end in let rt_vars = ref Datatype.String.Set.empty in let prm_vars = ref Datatype.String.Set.empty in ignore(Extlib.opt_map (Cil.visitCilLogicType (obj rt_vars)) return_type); List.iter (fun v -> ignore (Cil.visitCilLogicType (obj prm_vars) v.lv_type)) p; if not (Datatype.String.Set.subset !rt_vars !prm_vars) then C.error loc "some type variable appears only in the return type. \ All type variables need to occur also in the parameters types." let annot_env loc labels poly = let env = init_type_variables loc poly in let labels,env = List.fold_right (fun l (labs,e) -> try let _ = Lenv.find_logic_label l e in C.error loc "multiple defined label `%s'" l with Not_found -> let lab = FormalLabel l in (lab::labs,Lenv.add_logic_label l lab e)) labels ([],env) in let env = match labels with | [lab] -> (* if there is exactly one label, it is the default label *) Lenv.set_current_logic_label lab env | _ -> env in labels,env let logic_decl loc f labels poly ?return_type p = let labels,env = annot_env loc labels poly in let t = match return_type with | None -> None; | Some t -> Some (plain_logic_type loc env t) in let p, env = formals loc env p in check_polymorphism loc ?return_type:t p; let info = Cil_const.make_logic_info f in (* Should we add implicitly a default label for the declaration? *) let labels = match !Lenv.default_label with None -> labels | Some lab -> [lab] in (* Quick fix for bug 428, but this is far from perfect - Predicates still have a varinfo with Ctype Void - Polymorphism is not reflected on the lvar level. - However, such lvar should rarely if at all be seen under a Tvar. *) (match p,t with _,None -> () | [], Some t -> info.l_var_info.lv_type <- t | _,Some t -> let typ = Larrow (List.map (fun x -> x.lv_type) p,t) in info.l_var_info.lv_type <- typ); info.l_tparams <- poly; info.l_profile <- p; info.l_type <- t; info.l_labels <- labels; add_logic_function loc info; env,info let type_datacons loc env type_info (name,params) = (try let info = C.find_logic_ctor name in C.error loc "type constructor %s is already used by type %s" name info.ctor_type.lt_name with Not_found -> ()); let tparams = List.map (plain_logic_type loc env) params in let my_info = { ctor_name = name; ctor_type = type_info; ctor_params = tparams } in C.add_logic_ctor name my_info; my_info let typedef loc env my_info def = match def with | TDsum cons -> LTsum (List.map (type_datacons loc env my_info) cons) | TDsyn typ -> LTsyn (plain_logic_type loc env typ) let rec annot in_axiomatic a = let loc = a.decl_loc in Cil.CurrentLoc.set loc; match a.decl_node with | LDlogic_reads (f, labels, poly, t, p, l) -> let env,info = logic_decl loc f labels poly ~return_type:t p in info.l_body <- (match l with | Some l -> let l = List.map (fun x -> new_identified_term (update_term_wrt_default_label (term env x))) l in LBreads l | None -> LBnone); (* potential creation of label w.r.t. reads clause *) update_info_wrt_default_label info; Dfun_or_pred (info,loc) | LDpredicate_reads (f, labels, poly, p, l) -> let env,info = logic_decl loc f labels poly p in info.l_body <- (match l with | Some l -> let l = List.map (fun x -> new_identified_term (update_term_wrt_default_label (term env x))) l in LBreads l | None -> LBnone); (* potential creation of label w.r.t. reads clause *) update_info_wrt_default_label info; Dfun_or_pred (info,loc) | LDlogic_def(f, labels, poly,t,p,e) -> let env,info = logic_decl loc f labels poly ~return_type:t p in let rt = match info.l_type with | None -> assert false | Some t -> t in let e = term env e in let _,new_typ,new_term = instantiate_app ~overloaded:false loc e rt env in if is_same_type new_typ rt then begin info.l_body <- LBterm (update_term_wrt_default_label new_term); (* potential creation of label w.r.t. def *) update_info_wrt_default_label info; Dfun_or_pred (info,loc) end else C.error loc "return type of logic function %s is %a but %a was expected" f Cil_printer.pp_logic_type new_typ Cil_printer.pp_logic_type rt | LDpredicate_def (f, labels, poly, p, e) -> let env,info = logic_decl loc f labels poly p in let e = update_predicate_wrt_default_label (predicate env e) in info.l_body <- LBpred e; (* potential creation of label w.r.t. def *) update_info_wrt_default_label info; Dfun_or_pred (info,loc) | LDinductive_def (f, input_labels, poly, p, indcases) -> let _env,info = logic_decl loc f input_labels poly p in (* env is ignored: because params names are indeed useless...*) let (global_default, l) = List.fold_left (fun (global_default, acc) (id,labels,poly,e) -> Lenv.default_label := None; let labels,env = annot_env loc labels poly in let p = predicate env e in let res = update_ind_case_wrt_default_label (id, labels, poly, p) in let global_default = match global_default, !Lenv.default_label with | _, None -> global_default | Some _, _ -> global_default | None, (Some _ as lab) -> lab in (global_default, res::acc)) (!Lenv.default_label,[]) indcases in Lenv.default_label := global_default; (* After all inductive cases has been processed, we might have added an implicit label for the predicate at some point. Update the inductive cases that need it (i.e. do not define their own label(s)). *) let l = List.rev_map update_ind_case_wrt_default_label l in info.l_body <- LBinductive l; update_info_wrt_default_label info; Dfun_or_pred (info,loc) | LDaxiomatic(id,decls) -> if in_axiomatic then (* Not supported yet. See issue 43 on ACSL's github repository. *) C.error loc "Nested axiomatic. Ignoring body of %s" id else let l = List.map (annot true) decls in Daxiomatic(id,l,[],loc) | LDtype(s,l,def) -> let env = init_type_variables loc l in let my_info = { lt_name = s; lt_params = l; lt_def = None; (* will be updated later *) lt_attr = []; } in add_logic_type loc my_info; let tdef = Extlib.opt_map (typedef loc env my_info) def in if is_cyclic_typedef s tdef then C.error loc "Definition of %s is cyclic" s; my_info.lt_def <- tdef; Dtype (my_info,loc) | LDlemma (x,is_axiom, labels, poly, e) -> if Logic_env.Lemmas.mem x then begin let old_def = Logic_env.Lemmas.find x in let old_loc = Cil_datatype.Global_annotation.loc old_def in let is_axiom = match old_def with | Dlemma(_, is_axiom, _, _, _, _, _) -> is_axiom | _ -> Kernel.fatal ~current:true "Logic_env.get_lemma must return Dlemma" in C.error loc "%s is already registered as %s (%a)" x (if is_axiom then "axiom" else "lemma") Cil_datatype.Location.pretty old_loc end; let labels,env = annot_env loc labels poly in let p = predicate env e in let labels = match !Lenv.default_label with | None -> labels | Some lab -> [lab] in let def = Dlemma (x,is_axiom, labels, poly, p, [], loc) in Logic_env.Lemmas.add x def; def | LDinvariant (s, e) -> let env = append_here_label (append_init_label (Lenv.empty())) in let p = predicate env e in let li = Cil_const.make_logic_info s in li.l_labels <- [Logic_const.here_label]; li.l_body <- LBpred p; add_logic_function loc li; Dinvariant (li,loc) | LDtype_annot l -> Dtype_annot (type_annot loc l,loc) | LDmodel_annot l -> Dmodel_annot (model_annot loc l,loc); | LDvolatile (tsets, (rd_opt, wr_opt)) -> let env = Lenv.empty () in let ctxt = base_ctxt env in let tsets = List.map (term_lval_assignable ctxt ~accept_formal:false env) tsets in let checks_tsets_type fct ctyp = List.iter (fun t -> let check t = match Logic_utils.unroll_type t with | Ctype ctyp' -> Cil_datatype.Typ.equal ctyp ctyp' | _ -> false in if not (Logic_const.plain_or_set check t.term_type) then C.error t.term_loc "incompatible prototype of '%s' with %a" fct Cil_printer.pp_term t ) tsets in let prototype_error s fct = C.error loc "incompatible prototype of '%s' with volatile %s declaration" fct s in let volatile_type ret_typ arg1 error = (* note: type pointed to by arg1 may differ from the return type with respect to qualifiers *) if not (isPointerType arg1) then error (); let vol_typ = typeOf_pointed arg1 in if not (Cil.isVolatileType vol_typ && Cil_datatype.Typ.equal ret_typ (Cil.type_remove_qualifier_attributes vol_typ)) then error (); vol_typ in let checks_reads_fct fct ty = let error () = prototype_error "reads" fct in let ret,args,is_varg_arg,_attrib = if not (Cil.isFunctionType ty) then error (); Cil.splitFunctionType ty in match args with | Some [_,arg1,_] when (not (isVoidType ret || is_varg_arg)) -> (* matching prototype: T fct (volatile T *arg1) *) let vol_typ = volatile_type ret arg1 error in if Cil.isConstType vol_typ then Kernel.warning ~current:true "Access function '%s' writes to volatile const locations" fct; checks_tsets_type fct vol_typ (* tsets should have type: volatile T *) | _ -> error () in let checks_writes_fct fct ty = let error () = prototype_error "writes" fct in let ret,args,is_varg_arg,_attrib = if not (Cil.isFunctionType ty) then error (); Cil.splitFunctionType ty in match args with | Some ((_,arg1,_)::[_,arg2,_]) when (not (isVoidType ret || is_varg_arg)) && Cil_datatype.Typ.equal ret (Cil.type_remove_qualifier_attributes arg2) -> (* matching prototype: T fct (volatile T *arg1, T arg2) *) let vol_typ = volatile_type ret arg1 error in checks_tsets_type fct vol_typ (* tsets should have type: volatile T *) | _ -> error () in let get_volatile_fct checks_type = function | None -> None | Some fct -> try (match (C.find_var fct).lv_origin with | None -> raise Not_found | Some vi as vi_opt-> checks_type fct vi.vtype ; vi_opt) with Not_found -> C.error loc "cannot find function '%s' for volatile clause" fct in let tsets = List.map (Logic_const.new_identified_term) tsets in let rvi_opt = get_volatile_fct checks_reads_fct rd_opt in let wvi_opt = get_volatile_fct checks_writes_fct wr_opt in Dvolatile (tsets, rvi_opt, wvi_opt, [], loc) | LDextended (kind, content) -> let typing_context = base_ctxt (Lenv.empty ()) in let status,tcontent = Extensions.typer kind ~typing_context ~loc content in let textended = Logic_const.new_acsl_extension kind loc status tcontent in Dextended (textended, [], loc) let annot a = start_transaction (); let res = annot false a in finish_transaction (); res let annot = C.on_error annot rollback_transaction let custom _c = CustomDummy end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/logic_typing.mli0000666000000000000000000003230513571573400022706 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Logic typing and logic environment. *) open Cil_types (** Relation operators conversion @since Nitrogen-20111001 *) val type_rel: Logic_ptree.relation -> Cil_types.relation (** Arithmetic binop conversion. Addition and Subtraction are always considered as being used on integers. It is the responsibility of the user to introduce PlusPI/IndexPI, MinusPI and MinusPP where needed. @since Nitrogen-20111001 *) val type_binop: Logic_ptree.binop -> Cil_types.binop val unescape: string -> string val wcharlist_of_string: string -> int64 list val is_arithmetic_type: Cil_types.logic_type -> bool val is_integral_type: Cil_types.logic_type -> bool val is_set_type: Cil_types.logic_type -> bool val is_array_type: Cil_types.logic_type -> bool val is_pointer_type: Cil_types.logic_type -> bool (** @since Aluminium-20160501 *) val is_list_type: Cil_types.logic_type -> bool (** @since Aluminium-20160501 *) val type_of_list_elem : logic_type -> logic_type val type_of_pointed: logic_type -> logic_type val type_of_array_elem: logic_type -> logic_type val type_of_set_elem: logic_type -> logic_type val ctype_of_pointed: logic_type -> typ val ctype_of_array_elem: logic_type -> typ (** @deprecated Neon-20130301 use Logic_const.addTermOffsetLval instead *) val add_offset_lval: term_offset -> term_lval -> term_lval val arithmetic_conversion: Cil_types.logic_type -> Cil_types.logic_type -> Cil_types.logic_type (** Local logic environment *) module Lenv : sig type t val empty : unit -> t val add_var: string -> Cil_types.logic_var -> t -> t val add_type_var: string -> Cil_types.logic_type -> t -> t val add_logic_info: string -> Cil_types.logic_info -> t -> t val add_logic_label: string -> Cil_types.logic_label -> t -> t val find_var: string -> t-> Cil_types.logic_var val find_type_var: string -> t -> Cil_types.logic_type val find_logic_info: string -> t -> Cil_types.logic_info val find_logic_label: string -> t -> Cil_types.logic_label end type type_namespace = Typedef | Struct | Union | Enum (** The different namespaces a C type can belong to, used when we are searching a type by its name. *) module Type_namespace: Datatype.S with type t = type_namespace (** Functions that can be called when type-checking an extension of ACSL. *) type typing_context = { is_loop: unit -> bool; anonCompFieldName : string; conditionalConversion : typ -> typ -> typ; find_macro : string -> Logic_ptree.lexpr; find_var : ?label:string -> var:string -> logic_var; (** the label argument is a C label (obeying the restrictions of which label can be present in a \at). If present, the scope for searching local C variables is the one of the statement with the corresponding label. *) find_enum_tag : string -> exp * typ; find_comp_field: compinfo -> string -> offset; find_type : type_namespace -> string -> typ; find_label : string -> stmt ref; remove_logic_function : string -> unit; remove_logic_info: logic_info -> unit; remove_logic_type: string -> unit; remove_logic_ctor: string -> unit; add_logic_function: logic_info -> unit; add_logic_type: string -> logic_type_info -> unit; add_logic_ctor: string -> logic_ctor_info -> unit; find_all_logic_functions: string -> logic_info list; find_logic_type: string -> logic_type_info; find_logic_ctor: string -> logic_ctor_info; pre_state:Lenv.t; post_state:termination_kind list -> Lenv.t; assigns_env: Lenv.t; (**/**) silent: bool; (**/**) logic_type: typing_context -> location -> Lenv.t -> Logic_ptree.logic_type -> Cil_types.logic_type ; type_predicate: typing_context -> Lenv.t -> Logic_ptree.lexpr -> predicate; (** typechecks a predicate. Note that the first argument is itself a [typing_context], which allows for open recursion. Namely, it is possible for the extension to change the type-checking functions for the sub-nodes of the parsed tree, and not only for the toplevel [lexpr]. @plugin development guide *) type_term: typing_context -> Lenv.t -> Logic_ptree.lexpr -> term; type_assigns: typing_context -> accept_formal:bool -> Lenv.t -> Logic_ptree.assigns -> assigns; error: 'a 'b. location -> ('a,Format.formatter,unit,'b) format4 -> 'a; (** [on_error f rollback x] will attempt to evaluate [f x]. If this triggers an error while in [-continue-annot-error] mode, [rollback ()] will be executed and the exception re-raised. @since Chlorine-20180501 *) on_error: 'a 'b. ('a -> 'b) -> (unit -> unit) -> 'a -> 'b } (** [register_behavior_extension name status f] registers a typing function [f] to be used to type function contract clause with name [name]. The boolean flags specifies if the extension can be assigned a property status or not. Here is a basic example: let count = ref 0 in let foo_typer ~typing_context ~loc ps = match ps with p::[] -> Ext_preds [ (typing_context.type_predicate typing_context (typing_context.post_state [Normal]) p)]) | [] -> let id = !count in incr count; Ext_id id | _ -> typing_context.error loc "expecting a predicate after keyword FOO" let () = register_behavior_extension "FOO" false foo_typer @plugin development guide @since Carbon-20101201 @modify Silicon-20161101 change type of the function @modify 19.0-Potassium add [status] argument *) val register_behavior_extension: string -> bool -> (typing_context:typing_context -> loc:location -> Logic_ptree.lexpr list -> acsl_extension_kind) -> unit (** register an extension for global annotation. @plugin development guide @since 18.0-Argon *) val register_global_extension: string -> bool -> (typing_context:typing_context -> loc: location -> Logic_ptree.lexpr list -> acsl_extension_kind) -> unit (** register an extension for code annotation to be evaluated at _current_ program point. @plugin development guide @since 18.0-Argon *) val register_code_annot_extension: string -> bool -> (typing_context: typing_context -> loc: location -> Logic_ptree.lexpr list -> acsl_extension_kind) -> unit (** register an extension for code annotation to be evaluated for the _next_ statement. @plugin development guide @since 18.0-Argon *) val register_code_annot_next_stmt_extension: string -> bool -> (typing_context: typing_context -> loc: location -> Logic_ptree.lexpr list -> acsl_extension_kind) -> unit (** register an extension for loop annotation. @plugin development guide @since 18.0-Argon *) val register_code_annot_next_loop_extension: string -> bool -> (typing_context: typing_context -> loc: location -> Logic_ptree.lexpr list -> acsl_extension_kind) -> unit (** register an extension both for code and loop annotations. @plugin development guide @since 18.0-Argon *) val register_code_annot_next_both_extension: string -> bool -> (typing_context: typing_context -> loc: location -> Logic_ptree.lexpr list -> acsl_extension_kind) -> unit module Make (C : sig val is_loop: unit -> bool (** whether the annotation we want to type is contained in a loop. Only useful when creating objects of type [code_annotation]. *) val anonCompFieldName : string val conditionalConversion : typ -> typ -> typ val find_macro : string -> Logic_ptree.lexpr val find_var : ?label:string -> var:string -> logic_var (** see corresponding field in {!Logic_typing.typing_context}. *) val find_enum_tag : string -> exp * typ val find_type : type_namespace -> string -> typ val find_comp_field: compinfo -> string -> offset val find_label : string -> stmt ref val remove_logic_function : string -> unit val remove_logic_info: logic_info -> unit val remove_logic_type: string -> unit val remove_logic_ctor: string -> unit val add_logic_function: logic_info -> unit val add_logic_type: string -> logic_type_info -> unit val add_logic_ctor: string -> logic_ctor_info -> unit val find_all_logic_functions : string -> Cil_types.logic_info list val find_logic_type: string -> logic_type_info val find_logic_ctor: string -> logic_ctor_info (** What to do when we have a term of type Integer in a context expecting a C integral type. @raise Failure to reject such conversion @since Nitrogen-20111001 *) val integral_cast: Cil_types.typ -> Cil_types.term -> Cil_types.term (** raises an error at the given location and with the given message. @since Magnesium-20151001 *) val error: location -> ('a,Format.formatter,unit, 'b) format4 -> 'a (** see {!Logic_typing.typing_context}. *) val on_error: ('a -> 'b) -> (unit -> unit) -> 'a -> 'b end) : sig (** @since Nitrogen-20111001 *) val type_of_field: location -> string -> logic_type -> (term_offset * logic_type) (** @param explicit true if the cast is present in original source. defaults to false @since Nitrogen-20111001 @modify 19.0-Potassium introduces explicit param *) val mk_cast: ?explicit:bool -> Cil_types.term -> Cil_types.logic_type -> Cil_types.term (** type-checks a term. *) val term : Lenv.t -> Logic_ptree.lexpr -> term val predicate : Lenv.t -> Logic_ptree.lexpr -> predicate (** [code_annot loc behaviors rt annot] type-checks an in-code annotation. @param loc current location @param behaviors list of existing behaviors @param rt return type of current function @param annot the annotation *) val code_annot : Cil_types.location -> string list -> Cil_types.logic_type -> Logic_ptree.code_annot -> code_annotation val type_annot : location -> Logic_ptree.type_annot -> logic_info val model_annot : location -> Logic_ptree.model_annot -> model_info val annot : Logic_ptree.decl -> global_annotation val custom : Logic_ptree.custom_tree -> Cil_types.custom_tree (** [funspec behaviors f prms typ spec] type-checks a function contract. @param behaviors list of existing behaviors (outside of the current spec, e.g. in the spec of the corresponding declaration when type-checking the spec of a definition) @param f the function @param prms its parameters @param its type @param spec the spec to typecheck *) val funspec : string list -> varinfo -> (varinfo list) option -> typ -> Logic_ptree.spec -> funspec end (** append the Old and Post labels in the environment *) val append_old_and_post_labels: Lenv.t -> Lenv.t (** appends the Here label in the environment *) val append_here_label: Lenv.t -> Lenv.t (** appends the "Pre" label in the environment *) val append_pre_label: Lenv.t -> Lenv.t (** appends the "Init" label in the environment @since Sodium-20150201 *) val append_init_label: Lenv.t -> Lenv.t (** adds a given variable in local environment. *) val add_var: string -> logic_var -> Lenv.t -> Lenv.t (** add [\result] in the environment. *) val add_result: Lenv.t -> logic_type -> Lenv.t (** enter a given post-state. *) val enter_post_state: Lenv.t -> termination_kind -> Lenv.t (** enter a given post-state and put [\result] in the env. NB: if the kind of the post-state is neither [Normal] nor [Returns], this is not a normal ACSL environment. Use with caution. *) val post_state_env: termination_kind -> logic_type -> Lenv.t (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/logic_utils.ml0000666000000000000000000027141113571573400022366 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil open Logic_const open Cil_types exception Not_well_formed of Cil_types.location * string let rec unroll_type ?(unroll_typedef=true) = function | Ltype (tdef,_) as ty when Logic_const.is_unrollable_ltdef tdef -> unroll_type ~unroll_typedef (Logic_const.unroll_ltdef ty) | Ctype ty when unroll_typedef -> Ctype (Cil.unrollType ty) | Linteger | Lreal | Lvar _ | Larrow _ | Ctype _ | Ltype _ as ty -> ty let is_instance_of vars t1 t2 = let rec aux map t1 t2 = match (unroll_type t1, unroll_type t2) with | _, Lvar s when List.mem s vars -> if Datatype.String.Map.mem s map then Cil_datatype.Logic_type.equal t1 (Datatype.String.Map.find s map), map else true, Datatype.String.Map.add s t1 map | Ltype(ty1,prms1), Ltype(ty2,prms2) -> if Cil_datatype.Logic_type_info.equal ty1 ty2 then aux_list map prms1 prms2 else false, map | Larrow(args1,rt1), Larrow(args2,rt2) -> let flag,map as res = aux map rt1 rt2 in if flag then aux_list map args1 args2 else res | Ctype t1, Ctype t2 -> Cil_datatype.Typ.equal (Cil.typeDeepDropAllAttributes t1) (Cil.typeDeepDropAllAttributes t2), map | (Lvar _ | Ctype _ | Linteger | Lreal | Ltype _ | Larrow _), _ -> Cil_datatype.Logic_type.equal t1 t2, map and aux_list map l1 l2 = match l1, l2 with | [], [] -> true, map | [], _ | _, [] -> false, map | t1 :: tl1, t2 :: tl2 -> let flag, map as res = aux map t1 t2 in if flag then aux_list map tl1 tl2 else res in fst (aux Datatype.String.Map.empty t1 t2) (* ************************************************************************* *) (** {1 From C to logic}*) (* ************************************************************************* *) let isLogicType f t = plain_or_set (Logic_const.isLogicCType f) t (** true if the type is a C array (or a set of)*) let isLogicArrayType = isLogicType Cil.isArrayType let isLogicCharType = isLogicType Cil.isCharType let isLogicAnyCharType = isLogicType Cil.isAnyCharType let isLogicVoidType = isLogicType Cil.isVoidType let isLogicPointerType = isLogicType Cil.isPointerType let isLogicVoidPointerType = isLogicType Cil.isVoidPtrType let logicCType t = let rec logicCType = function | Ctype t -> t | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> logicCType (unroll_ltdef ty) | Lvar _ -> Cil.intType | _ -> failwith "not a C type" in plain_or_set logicCType t let plain_array_to_ptr ty = match unroll_type ty with | Ctype(TArray(ty,lo,_,attr) as tarr) -> let length_attr = match lo with | None -> [] | Some _ -> try let len = Cil.bitsSizeOf tarr in let len = try len / (Cil.bitsSizeOf ty) with Cil.SizeOfError _ -> Kernel.fatal "Inconsistent information: I know the length of \ array type %a, but not of its elements." Cil_printer.pp_typ tarr in (* Normally, overflow is checked in bitsSizeOf itself *) let la = AInt (Integer.of_int len) in [ Attr("arraylen",[la])] with Cil.SizeOfError _ -> Kernel.warning ~current:true "Cannot represent length of array as an attribute"; [] in Ctype(TPtr(ty, Cil.addAttributes length_attr attr)) | ty -> ty let array_to_ptr = plain_or_set plain_array_to_ptr let typ_to_logic_type e_typ = let ty = Cil.unrollType e_typ in if Cil.isIntegralType ty then Linteger else if Cil.isFloatingType ty then Lreal else Ctype e_typ let predicate_of_identified_predicate ip = ip.ip_content let translate_old_label s p = let get_label () = match s.labels with | [] -> s.labels <- [Label (Printf.sprintf "__sid_%d_label" s.sid, Cil_datatype.Stmt.loc s,false)] | _ -> () in let make_new_at_predicate p = get_label(); let res = pat (p, (StmtLabel (ref s))) in res.pred_content in let make_new_at_term t = get_label (); let res = tat (t, (StmtLabel (ref s))) in res.term_node in let vis = object inherit Cil.nopCilVisitor method! vpredicate_node = function | Pat(p,lab) when lab = Logic_const.old_label -> ChangeDoChildrenPost(make_new_at_predicate p, fun x -> x) | _ -> DoChildren method! vterm_node = function | Tat(t,lab) when lab = Logic_const.old_label -> ChangeDoChildrenPost(make_new_at_term t, fun x->x) | _ -> DoChildren end in Cil.visitCilPredicate vis p let rec is_C_array t = let is_C_array_lhost = function TVar { lv_origin = Some _ } -> true (* \result always refer to a C value *) | TResult _ -> true (* dereference implies an access to a C value. *) | TMem _ -> true | TVar _ -> false in isLogicArrayType t.term_type && (match t.term_node with | TStartOf (lh,_) -> is_C_array_lhost lh | TLval(lh,_) -> is_C_array_lhost lh | Tif(_,t1,t2) -> is_C_array t1 && is_C_array t2 | Tlet (_,t) -> is_C_array t | _ -> false) (* TUpdate gives back a logic array, TStartOf has pointer type anyway, other constructors are never arrays. *) (** do not use it on something which is not a C array *) let rec mk_logic_StartOf t = let my_type = array_to_ptr t.term_type in match t.term_node with TLval s -> { t with term_node = TStartOf s; term_type = my_type } | Tif(c,t1,t2) -> { t with term_node = Tif(c,mk_logic_StartOf t1, mk_logic_StartOf t2); term_type = my_type } | Tlet (body,t) -> { t with term_node = Tlet(body, mk_logic_StartOf t); term_type = my_type } | _ -> Kernel.fatal "mk_logic_StartOf given a non-C-array term" (* Make an AddrOf. Given an lval of type T will give back an expression of * type ptr(T) *) let mk_logic_AddrOf ?(loc=Cil_datatype.Location.unknown) lval typ = let lift_set typ = Logic_const.transform_element (fun typ -> (Ctype (TPtr (logicCType typ,[])))) typ in match lval with | TMem e, TNoOffset -> Logic_const.term ~loc e.term_node e.term_type | b, TIndex(z, TNoOffset) when isLogicZero z -> Logic_const.term ~loc (TStartOf (b, TNoOffset)) (lift_set typ) | _ -> Logic_const.term ~loc (TAddrOf lval) (lift_set typ) let isLogicPointer t = isLogicPointerType t.term_type || (is_C_array t) let mk_logic_pointer_or_StartOf t = if isLogicPointer t then if is_C_array t then mk_logic_StartOf t else t else Kernel.fatal ~source:(fst t.term_loc) "%a is neither a pointer nor a C array" Cil_printer.pp_term t let need_logic_cast oldt newt = not (Cil_datatype.Logic_type.equal (Ctype oldt) (Ctype newt)) (* Does the same kind of optimization than [Cil.mkCastT] for [Ctype]. *) let mk_cast ?(loc=Cil_datatype.Location.unknown) ?(force=false) newt t = let mk_cast t = (* to new type [newt] *) let typ = Cil.type_remove_attributes_for_logic_type newt in term ~loc (TCastE (typ, t)) (Ctype typ) in let rec aux1 = function | Ctype oldt -> if not (need_logic_cast oldt newt) && not force then t else begin match Cil.unrollType newt, t.term_node with | TPtr _, TCastE (_, t') -> let rec aux2 = function | Ctype typ' -> (match unrollType typ', t'.term_node with | (TPtr _ as typ''), _ -> (* Old cast can be removed...*) if need_logic_cast newt typ'' then mk_cast t' else (* In fact, both casts can be removed. *) t' | _, TConst (Integer (i,_)) when Integer.is_zero i -> mk_cast t' | _ -> mk_cast t ) | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> aux2 (unroll_ltdef ty) | _ -> mk_cast t in aux2 t'.term_type | _ -> (* Do not remove old cast because they are conversions !!! *) mk_cast t end | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> aux1 (unroll_ltdef ty) | _ -> mk_cast t in aux1 t.term_type let real_of_float s f = { r_literal = s ; r_nearest = f ; r_upper = f ; r_lower = f } let constant_to_lconstant c = match c with | CInt64(i,_,s) -> Integer (i,s) | CStr s -> LStr s | CWStr s -> LWStr s | CChr s -> LChr s | CReal (f,_,Some s) -> LReal (real_of_float s f) | CEnum e -> LEnum e | CReal (f,fkind,None) -> let s = match fkind with | FFloat -> Format.sprintf "%.8ef" f | FDouble | FLongDouble -> Format.sprintf "%.16ed" f in LReal (real_of_float s f) let lconstant_to_constant c = match c with | Integer (i,s) -> CInt64(i,Cil.intKindForValue i false,s) | LStr s -> CStr s | LWStr s -> CWStr s | LChr s -> CChr s | LReal r -> CReal (r.r_nearest,FDouble,Some r.r_literal) | LEnum e -> CEnum e let string_to_float_lconstant string = let f = snd (Floating_point.parse string) in (* If the string has suffix 'F' or 'D', then it represents a single or double constant and the nearest parsed float is exact. Otherwise, use the upper and lower float computed by [parse]. *) let l = String.length string - 1 in let last = Char.uppercase_ascii string.[l] in let exact = last = 'F' || last = 'D' in if exact then LReal (real_of_float string f.Floating_point.f_nearest) else let open Floating_point in LReal { r_nearest = f.f_nearest; r_upper = f.f_upper; r_lower = f.f_lower; r_literal = string } let numeric_coerce ltyp t = let coerce t = Logic_const.term ~loc:t.term_loc (TLogic_coerce(ltyp, t)) ltyp in let oldt = unroll_type t.term_type in if Cil_datatype.Logic_type.equal oldt ltyp then t else match t.term_node with | TLogic_coerce(t,e) when Cil.no_op_coerce t e -> coerce e | TConst(Integer(i,_)) -> (match oldt, ltyp with | Ctype (TInt(ikind,_)), Linteger when Cil.fitsInInt ikind i -> { t with term_type = Linteger } | _ -> coerce t) | TCastE(typ, ({ term_node = TConst(Integer(i,_))} as t')) -> (match unrollType typ with | TInt (ikind,_) when Cil.fitsInInt ikind i -> (match unroll_type t'.term_type with | Linteger -> t' | Ctype (TInt (ikind,_)) when Cil.fitsInInt ikind i -> { t' with term_type = Linteger } | _ -> coerce t') | _ -> coerce t) | _ -> coerce t (* Don't forget to keep is_zero_comparable and scalar_term_to_predicate in sync. *) let is_zero_comparable t = match unroll_type t.term_type with | Ctype (TInt _ | TFloat _ | TPtr _ | TArray _ | TFun _) -> true | Ctype _ -> false | Linteger | Lreal -> true | Ltype ({lt_name},[]) -> lt_name = Utf8_logic.boolean | Ltype _ -> false | Lvar _ | Larrow _ -> false let scalar_term_to_predicate t = let loc = t.term_loc in let conversion zero = prel ~loc (Cil_types.Rneq, t, zero) in let arith_conversion () = conversion (Cil.lzero ~loc ()) in let ptr_conversion () = conversion (Logic_const.term ~loc Tnull t.term_type) in match unroll_type t.term_type with | Ctype (TInt _) -> arith_conversion () | Ctype (TFloat _) -> conversion (Logic_const.treal_zero ~loc ~ltyp:t.term_type ()) | Ctype (TPtr _) -> ptr_conversion () | Ctype (TArray _) -> ptr_conversion () (* Could be transformed to \true: an array is never \null *) | Ctype (TFun _) -> ptr_conversion () (* decay as pointer *) | Linteger -> arith_conversion () | Lreal -> conversion (Logic_const.treal_zero ~loc ()) | Ltype ({lt_name = name},[]) when name = Utf8_logic.boolean -> let ctrue = Logic_env.Logic_ctor_info.find "\\true" in prel ~loc (Cil_types.Req,t, { term_node = TDataCons(ctrue,[]); term_loc = loc; term_type = Ltype(ctrue.ctor_type,[]); term_name = []; }) | Ltype _ | Lvar _ | Larrow _ | Ctype (TVoid _ | TNamed _ | TComp _ | TEnum _ | TBuiltin_va_list _) -> Kernel.fatal "Cannot convert to predicate a term of type %a" Cil_printer.pp_logic_type t.term_type let rec expr_to_term ~cast e = let e_typ = unrollType (Cil.typeOf e) in let loc = e.eloc in let result = match e.enode with | Const c -> TConst (constant_to_lconstant c) | SizeOf t -> TSizeOf t | SizeOfE e -> TSizeOfE (expr_to_term ~cast e) | SizeOfStr s -> TSizeOfStr s | StartOf lv -> TStartOf (lval_to_term_lval ~cast lv) | AddrOf lv -> TAddrOf (lval_to_term_lval ~cast lv) | CastE (ty,e) -> (mk_cast (unrollType ty) (expr_to_term ~cast e)).term_node | BinOp (op, l, r, _) -> let l' = expr_to_term_coerce ~cast l in let r' = expr_to_term_coerce ~cast r in (* type of the conversion of e in the logic. Beware that boolean operators have boolean type. *) let tcast = match op, cast with | ( Cil_types.Lt | Cil_types.Gt | Cil_types.Le | Cil_types.Ge | Cil_types.Eq | Cil_types.Ne| Cil_types.LAnd | Cil_types.LOr), _ -> Some Logic_const.boolean_type | _, true -> Some (typ_to_logic_type e_typ) | _, false -> None in let tnode = TBinOp (op,l',r') in (* if [cast], we add a cast. Otherwise, when [op] is an operator returning a boolean, we need to cast the whole expression as an integral type, because (1) the recursive subcalls expect an integer/float/pointer here, and (2) there is no implicit conversion Boolean -> integer. *) begin match tcast with | Some lt -> (mk_cast e_typ (Logic_const.term tnode lt)).term_node | None -> tnode end | UnOp (op, u, _) -> let u' = expr_to_term_coerce ~cast u in (* See comments for binop case above. *) let tcast = match op, cast with | Cil_types.LNot, _ -> Some Logic_const.boolean_type | _, true -> Some (typ_to_logic_type e_typ) | _, false -> None in let tnode = TUnOp (op, u') in begin match tcast with | Some lt -> (mk_cast e_typ (Logic_const.term tnode lt)).term_node | None -> tnode end | AlignOfE e -> TAlignOfE (expr_to_term ~cast e) | AlignOf typ -> TAlignOf typ | Lval lv -> TLval (lval_to_term_lval ~cast lv) | Info (e,_) -> (expr_to_term ~cast e).term_node in if cast then Logic_const.term ~loc result (Ctype e_typ) else match e.enode with | Const _ | Lval _ | CastE _ -> (* all immediate values keep their C type by default, and are only lifted to integer/real if needed. *) Logic_const.term ~loc result (Ctype e_typ) | _ -> Logic_const.term ~loc result (typ_to_logic_type e_typ) and expr_to_term_coerce ~cast e = let t = expr_to_term ~cast e in match Logic_const.unroll_ltdef t.term_type with | Ctype typ when Cil.isIntegralType typ || Cil.isFloatingType typ -> let ltyp = typ_to_logic_type typ in numeric_coerce ltyp t | _ -> t and lval_to_term_lval ~cast (host,offset) = host_to_term_host ~cast host, offset_to_term_offset ~cast offset and host_to_term_host ~cast = function | Var s -> TVar (Cil.cvar_to_lvar s) | Mem e -> TMem (expr_to_term ~cast e) (*no need of numeric coercion - pointer *) and offset_to_term_offset ~cast:cast = function | NoOffset -> TNoOffset | Index (e,off) -> TIndex (expr_to_term_coerce ~cast e,offset_to_term_offset ~cast off) | Field (fi,off) -> TField(fi,offset_to_term_offset ~cast off) and expr_to_predicate ~cast e = let open Cil_types in match e.enode with | BinOp ((Lt | Gt | Le | Ge | Eq | Ne as op), l, r, _) -> let tl = expr_to_term ~cast l in let tr = expr_to_term ~cast r in let rel = match op with | Lt -> Rlt | Gt -> Rgt | Le -> Rle | Ge -> Rge | Eq -> Req | Ne -> Rneq | _ -> assert false in let pred = Prel (rel, tl, tr) in Logic_const.new_predicate (Logic_const.unamed ~loc:e.eloc pred) | _ -> let t = expr_to_term ~cast e in if is_zero_comparable t then Logic_const.new_predicate (scalar_term_to_predicate t) else Kernel.fatal "Cannot convert into predicate the C expression %a" Cil_printer.pp_exp e let array_with_range arr size = let loc = arr.eloc in let arr = Cil.stripCasts arr in let typ_arr = typeOf arr in let no_cast = isAnyCharPtrType typ_arr || isAnyCharArrayType typ_arr in let char_ptr = typ_to_logic_type Cil.charPtrType in let arr = expr_to_term ~cast:true arr in let arr = if no_cast then arr else mk_cast ~loc Cil.charPtrType arr and range_end = Logic_const.term ~loc:size.term_loc (TBinOp (MinusA, size, Cil.lconstant Integer.one)) size.term_type in let range = Logic_const.trange (Some (Cil.lconstant Integer.zero), Some (range_end)) in Logic_const.term ~loc(TBinOp (PlusPI, arr, range)) char_ptr let remove_logic_coerce t = match t.term_node with | TLogic_coerce(_,t) -> t | _ -> t (* ************************************************************************* *) (** {1 Various utilities} *) (* ************************************************************************* *) let rec remove_term_offset o = match o with TNoOffset -> TNoOffset, TNoOffset | TIndex(_,TNoOffset) | TField(_,TNoOffset) | TModel(_,TNoOffset) -> TNoOffset, o | TIndex(e,o) -> let (oth,last) = remove_term_offset o in TIndex(e,oth), last | TField(f,o) -> let (oth,last) = remove_term_offset o in TField(f,oth), last | TModel(f,o) -> let oth,last = remove_term_offset o in TModel(f,oth), last let rec lval_contains_result v = match v with TResult _ -> true | TMem t -> contains_result t | TVar _ -> false and loffset_contains_result o = match o with TNoOffset -> false | TField(_,o) | TModel(_,o) -> loffset_contains_result o | TIndex(t,o) -> contains_result t || loffset_contains_result o (** @return [true] if the underlying lval contains an occurrence of \result; [false] otherwise or if the term is not an lval. *) and contains_result t = match t.term_node with TLval(v,offs) -> lval_contains_result v || loffset_contains_result offs | Tat(t,_) -> contains_result t | _ -> false (** @return the definition of a predicate. @raise Not_found if the predicate is only declared *) let get_pred_body pi = match pi.l_body with LBpred p -> p | _ -> raise Not_found let is_result = Logic_const.is_result let is_trivially_false p = match p.pred_content with Pfalse -> true | _ -> false let is_trivially_true p = match p.pred_content with Ptrue -> true | _ -> false let rec add_attribute_glob_annot a g = match g with | Dfun_or_pred ({ l_var_info },_) | Dinvariant({ l_var_info }, _) | Dtype_annot ( { l_var_info }, _) -> l_var_info.lv_attr <- Cil.addAttribute a l_var_info.lv_attr; g | Dvolatile(v,r,w,al,l) -> Dvolatile(v,r,w,Cil.addAttribute a al,l) | Daxiomatic(n,l,al,loc) -> Daxiomatic(n,List.map (add_attribute_glob_annot a) l, Cil.addAttribute a al,loc) | Dtype(ti,_) -> ti.lt_attr <- Cil.addAttribute a ti.lt_attr; g | Dlemma(n,ax,labs,t,p,al,l) -> Dlemma(n,ax,labs,t,p,Cil.addAttribute a al,l) | Dmodel_annot (mi,_) -> mi.mi_attr <- Cil.addAttribute a mi.mi_attr; g | Dcustom_annot(c,n,al,l) -> Dcustom_annot(c,n,Cil.addAttribute a al, l) | Dextended (e,al,l) -> Dextended(e,Cil.addAttribute a al,l) let is_same_list f l1 l2 = try List.for_all2 f l1 l2 with Invalid_argument _ -> false let is_same_logic_label l1 l2 = Cil_datatype.Logic_label.equal l1 l2 let compare_logic_label l1 l2 = Cil_datatype.Logic_label.compare l1 l2 let is_same_opt f x1 x2 = match x1,x2 with None, None -> true | Some x1, Some x2 -> f x1 x2 | None, _ | _, None -> false let compare_opt f x1 x2 = match x1, x2 with | None, None -> 0 | Some _, None -> 1 | None, Some _ -> -1 | Some x1, Some x2 -> f x1 x2 let is_same_c_type t1 t2 = Cil_datatype.Logic_type_ByName.equal (Ctype t1) (Ctype t2) let is_same_type t1 t2 = Cil_datatype.Logic_type_ByName.equal t1 t2 let is_same_string (s1: string) s2 = s1 = s2 let is_same_c_unop (u1: unop) u2 = u1 = u2 let is_same_c_binop (b1: binop) b2 = b1 = b2 let rec is_same_attrparam p1 p2 = match p1,p2 with | AInt i1, AInt i2 -> Integer.equal i1 i2 | AStr s1, AStr s2 -> is_same_string s1 s2 | ACons (s1, p1), ACons (s2, p2) -> is_same_string s1 s2 && is_same_list is_same_attrparam p1 p2 | ASizeOf t1, ASizeOf t2 -> is_same_c_type t1 t2 | ASizeOfE p1, ASizeOfE p2 -> is_same_attrparam p1 p2 | AAlignOf t1, AAlignOf t2 -> is_same_c_type t1 t2 | AAlignOfE p1, AAlignOfE p2 -> is_same_attrparam p1 p2 | AUnOp(u1,p1), AUnOp(u2,p2) -> is_same_c_unop u1 u2 && is_same_attrparam p1 p2 | ABinOp(b1,l1,r1), ABinOp(b2,l2,r2) -> is_same_c_binop b1 b2 && is_same_attrparam l1 l2 && is_same_attrparam r1 r2 | ADot(p1,f1), ADot(p2,f2) -> is_same_string f1 f2 && is_same_attrparam p1 p2 | AStar p1, AStar p2 -> is_same_attrparam p1 p2 | AAddrOf p1, AAddrOf p2 -> is_same_attrparam p1 p2 | AIndex(a1,i1), AIndex(a2,i2) -> is_same_attrparam a1 a2 && is_same_attrparam i1 i2 | AQuestion(q1,t1,e1), AQuestion(q2,t2,e2) -> is_same_attrparam q1 q2 && is_same_attrparam t1 t2 && is_same_attrparam e1 e2 | _ -> false let is_same_attribute a1 a2 = match a1,a2 with | Attr (s1,prm1), Attr (s2,prm2) -> is_same_string s1 s2 && is_same_list is_same_attrparam prm1 prm2 | AttrAnnot s1, AttrAnnot s2 -> is_same_string s1 s2 | _ -> false let is_same_attributes l1 l2 = is_same_list is_same_attribute l1 l2 let is_same_var v1 v2 = v1.lv_name = v2.lv_name && is_same_type v1.lv_type v2.lv_type && is_same_attributes v1.lv_attr v2.lv_attr let compare_var v1 v2 = let res = String.compare v1.lv_name v2.lv_name in if res = 0 then Cil_datatype.Logic_type_ByName.compare v1.lv_type v2.lv_type else res let is_same_logic_signature l1 l2 = l1.l_var_info.lv_name = l2.l_var_info.lv_name && is_same_opt is_same_type l1.l_type l2.l_type && is_same_list is_same_string l1.l_tparams l2.l_tparams && is_same_list is_same_var l1.l_profile l2.l_profile && is_same_list is_same_logic_label l1.l_labels l2.l_labels let compare_logic_signature l1 l2 = let res = String.compare l1.l_var_info.lv_name l2.l_var_info.lv_name in if res = 0 then let res = compare_opt Cil_datatype.Logic_type_ByName.compare l1.l_type l2.l_type in if res = 0 then let res = Extlib.list_compare String.compare l1.l_tparams l2.l_tparams in if res = 0 then let res = Extlib.list_compare compare_var l1.l_profile l2.l_profile in if res = 0 then Extlib.list_compare compare_logic_label l1.l_labels l2.l_labels else res else res else res else res let is_same_logic_profile l1 l2 = l1.l_var_info.lv_name = l2.l_var_info.lv_name && is_same_list (fun v1 v2 -> is_same_type v1.lv_type v2.lv_type) l1.l_profile l2.l_profile let is_same_builtin_profile l1 l2 = l1.bl_name = l2.bl_name && is_same_list (fun (_,t1) (_,t2) -> is_same_type t1 t2) l1.bl_profile l2.bl_profile let add_logic_function = Logic_env.add_logic_function_gen is_same_logic_profile let is_same_logic_ctor_info ci1 ci2 = ci1.ctor_name = ci2.ctor_name && ci1.ctor_type.lt_name = ci2.ctor_type.lt_name && is_same_list is_same_type ci1.ctor_params ci2.ctor_params let compare_logic_ctor_info ci1 ci2 = let res = String.compare ci1.ctor_name ci2.ctor_name in if res = 0 then let res = String.compare ci1.ctor_type.lt_name ci2.ctor_type.lt_name in if res = 0 then Extlib.list_compare Cil_datatype.Logic_type_ByName.compare ci1.ctor_params ci2.ctor_params else res else res let is_same_constant = Cil.compareConstant let is_same_pconstant c1 c2 = let open Logic_ptree in match c1, c2 with | IntConstant c1, IntConstant c2 -> c1 = c2 | IntConstant _, _ | _, IntConstant _ -> false | FloatConstant c1, FloatConstant c2 -> c1 = c2 | FloatConstant _,_ | _,FloatConstant _ -> false | StringConstant c1, StringConstant c2 -> c1 = c2 | StringConstant _,_ | _,StringConstant _ -> false | WStringConstant c1, WStringConstant c2 -> c1 = c2 let is_same_binop o1 o2 = match o1,o2 with | PlusA, PlusA | (PlusPI | IndexPI), (PlusPI | IndexPI) (* Semantically equivalent *) | MinusA, MinusA | MinusPI, MinusPI | MinusPP, MinusPP | Mult, Mult | Div, Div | Mod, Mod | Shiftlt, Shiftlt | Shiftrt, Shiftrt | Cil_types.Lt, Cil_types.Lt | Cil_types.Gt, Cil_types.Gt | Cil_types.Le, Cil_types.Le | Cil_types.Ge, Cil_types.Ge | Cil_types.Eq, Cil_types.Eq | Cil_types.Ne, Cil_types.Ne | BAnd, BAnd | BXor, BXor | BOr, BOr | LAnd, LAnd | LOr, LOr -> true | (PlusA | PlusPI | IndexPI | MinusA | MinusPI | MinusPP | Mult | Div | Mod | Shiftlt | Shiftrt | Cil_types.Lt | Cil_types.Gt | Cil_types.Le | Cil_types.Ge | Cil_types.Eq | Cil_types.Ne | BAnd | BXor | BOr | LAnd | LOr), _ -> false let _compare_c c1 c2 = match c1, c2 with | CEnum e1, CEnum e2 -> e1.einame = e2.einame && e1.eihost.ename = e2.eihost.ename && (match constFoldToInt e1.eival, constFoldToInt e2.eival with | Some i1, Some i2 -> Integer.equal i1 i2 | _ -> false) | CInt64 (i1,k1,_), CInt64(i2,k2,_) -> k1 = k2 && Integer.equal i1 i2 | CStr s1, CStr s2 -> s1 = s2 | CWStr l1, CWStr l2 -> (try List.for_all2 (fun x y -> Int64.compare x y = 0) l1 l2 with Invalid_argument _ -> false) | CChr c1, CChr c2 -> c1 = c2 | CReal(f1,k1,_), CReal(f2,k2,_) -> k1 = k2 && f1 = f2 | (CEnum _ | CInt64 _ | CStr _ | CWStr _ | CChr _ | CReal _), _ -> false let rec is_same_term t1 t2 = match t1.term_node, t2.term_node with TConst c1, TConst c2 -> Cil_datatype.Logic_constant.equal c1 c2 | TLval l1, TLval l2 -> is_same_tlval l1 l2 | TSizeOf t1, TSizeOf t2 -> Cil_datatype.TypByName.equal t1 t2 | TSizeOfE t1, TSizeOfE t2 -> is_same_term t1 t2 | TSizeOfStr s1, TSizeOfStr s2 -> s1 = s2 | TAlignOf t1, TAlignOf t2 -> Cil_datatype.TypByName.equal t1 t2 | TAlignOfE t1, TAlignOfE t2 -> is_same_term t1 t2 | TUnOp (o1,t1), TUnOp(o2,t2) -> o1 = o2 && is_same_term t1 t2 | TBinOp(o1,l1,r1), TBinOp(o2,l2,r2) -> is_same_binop o1 o2 && is_same_term l1 l2 && is_same_term r1 r2 | TCastE(typ1,t1), TCastE(typ2,t2) -> Cil_datatype.TypByName.equal typ1 typ2 && is_same_term t1 t2 | TAddrOf l1, TAddrOf l2 -> is_same_tlval l1 l2 | TStartOf l1, TStartOf l2 -> is_same_tlval l1 l2 | Tapp(f1,labels1, args1), Tapp(f2, labels2, args2) -> is_same_logic_signature f1 f2 && List.for_all2 is_same_logic_label labels1 labels2 && List.for_all2 is_same_term args1 args2 | Tif(c1,t1,e1), Tif(c2,t2,e2) -> is_same_term c1 c2 && is_same_term t1 t2 && is_same_term e1 e2 | Tbase_addr (l1,t1), Tbase_addr (l2,t2) | Tblock_length (l1,t1), Tblock_length (l2,t2) | Toffset (l1,t1), Toffset (l2,t2) | Tat(t1,l1), Tat(t2,l2) -> is_same_logic_label l1 l2 && is_same_term t1 t2 | Tnull, Tnull -> true | Tlambda (v1,t1), Tlambda(v2,t2) -> is_same_list is_same_var v1 v2 && is_same_term t1 t2 | TUpdate(t1,i1,nt1), TUpdate(t2,i2,nt2) -> is_same_term t1 t2 && is_same_offset i1 i2 && is_same_term nt1 nt2 | Ttypeof t1, Ttypeof t2 -> is_same_term t1 t2 | Ttype ty1, Ttype ty2 -> Cil_datatype.TypByName.equal ty1 ty2 | TDataCons(ci1,prms1), TDataCons(ci2,prms2) -> is_same_logic_ctor_info ci1 ci2 && is_same_list is_same_term prms1 prms2 | Tempty_set, Tempty_set -> true | (Tunion l1, Tunion l2) | (Tinter l1, Tinter l2) -> (try List.for_all2 is_same_term l1 l2 with Invalid_argument _ -> false) | Tcomprehension(e1,q1,p1), Tcomprehension(e2,q2,p2) -> is_same_term e1 e2 && is_same_list is_same_var q1 q2 && is_same_opt is_same_predicate p1 p2 | Trange(l1,h1), Trange(l2,h2) -> is_same_opt is_same_term l1 l2 && is_same_opt is_same_term h1 h2 | Tlet(d1,b1), Tlet(d2,b2) -> is_same_logic_info d1 d2 && is_same_term b1 b2 | TLogic_coerce(ty1,t1), TLogic_coerce(ty2,t2) -> is_same_type ty1 ty2 && is_same_term t1 t2 | (TConst _ | TLval _ | TSizeOf _ | TSizeOfE _ | TSizeOfStr _ | TAlignOf _ | TAlignOfE _ | TUnOp _ | TBinOp _ | TCastE _ | TAddrOf _ | TStartOf _ | Tapp _ | Tlambda _ | TDataCons _ | Tif _ | Tat _ | Tbase_addr _ | Tblock_length _ | Toffset _ | Tnull | TUpdate _ | Ttypeof _ | Ttype _ | Tcomprehension _ | Tempty_set | Tunion _ | Tinter _ | Trange _ | Tlet _ | TLogic_coerce _ ),_ -> false and is_same_logic_info l1 l2 = is_same_logic_signature l1 l2 && is_same_logic_body l1.l_body l2.l_body and is_same_logic_body b1 b2 = match b1,b2 with | LBnone, LBnone -> true | LBreads l1, LBreads l2 -> is_same_list is_same_identified_term l1 l2 | LBterm t1, LBterm t2 -> is_same_term t1 t2 | LBpred p1, LBpred p2 -> is_same_predicate p1 p2 | LBinductive l1, LBinductive l2 -> is_same_list is_same_indcase l1 l2 | (LBnone | LBinductive _ | LBpred _ | LBterm _ | LBreads _), _ -> false and is_same_indcase (id1,labs1,typs1,p1) (id2,labs2,typs2,p2) = id1 = id2 && is_same_list is_same_logic_label labs1 labs2 && is_same_list (=) typs1 typs2 && is_same_predicate p1 p2 and is_same_tlval (h1,o1) (h2,o2) = is_same_lhost h1 h2 && is_same_offset o1 o2 and is_same_lhost h1 h2 = match h1, h2 with TVar v1, TVar v2 -> is_same_var v1 v2 | TMem t1, TMem t2 -> is_same_term t1 t2 | TResult t1, TResult t2 -> Cil_datatype.TypByName.equal t1 t2 | (TVar _ | TMem _ | TResult _ ),_ -> false and is_same_offset o1 o2 = match o1, o2 with TNoOffset, TNoOffset -> true | TField (f1,o1), TField(f2,o2) -> f1.fname = f2.fname && is_same_offset o1 o2 | TModel(f1,o1), TModel(f2,o2) -> f1.mi_name = f2.mi_name && is_same_offset o1 o2 | TIndex(t1,o1), TIndex(t2,o2) -> is_same_term t1 t2 && is_same_offset o1 o2 | (TNoOffset| TField _| TIndex _ | TModel _),_ -> false and is_same_predicate_node p1 p2 = match p1, p2 with | Pfalse, Pfalse -> true | Ptrue, Ptrue -> true | Papp(i1,labels1,args1), Papp(i2,labels2,args2) -> is_same_logic_signature i1 i2 && List.for_all2 is_same_logic_label labels1 labels2 && List.for_all2 is_same_term args1 args2 | Prel(r1,lt1,rt1), Prel(r2,lt2,rt2) -> r1 = r2 && is_same_term lt1 lt2 && is_same_term rt1 rt2 | Pand(lp1,rp1), Pand(lp2,rp2) | Por(lp1,rp1), Por(lp2,rp2) | Pxor (lp1,rp1), Pxor(lp2,rp2) | Pimplies(lp1,rp1), Pimplies(lp2,rp2) | Piff(lp1,rp1), Piff(lp2,rp2) -> is_same_predicate lp1 lp2 && is_same_predicate rp1 rp2 | Pnot p1, Pnot p2 -> is_same_predicate p1 p2 | Pif (c1,t1,e1), Pif(c2,t2,e2) -> is_same_term c1 c2 && is_same_predicate t1 t2 && is_same_predicate e1 e2 | Plet (d1,p1), Plet(d2,p2) -> is_same_logic_info d1 d2 && is_same_predicate p1 p2 | Pforall(q1,p1), Pforall(q2,p2) -> is_same_list is_same_var q1 q2 && is_same_predicate p1 p2 | Pexists(q1,p1), Pexists(q2,p2) -> is_same_list is_same_var q1 q2 && is_same_predicate p1 p2 | Pat(p1,l1), Pat(p2,l2) -> is_same_logic_label l1 l2 && is_same_predicate p1 p2 | Pallocable (l1,t1), Pallocable (l2,t2) | Pfreeable (l1,t1), Pfreeable (l2,t2) | Pvalid (l1,t1), Pvalid (l2,t2) | Pvalid_read (l1,t1), Pvalid_read (l2,t2) | Pinitialized (l1,t1), Pinitialized (l2,t2) -> is_same_logic_label l1 l2 && is_same_term t1 t2 | Pvalid_function t1, Pvalid_function t2 -> is_same_term t1 t2 | Pdangling (l1,t1), Pdangling (l2,t2) -> is_same_logic_label l1 l2 && is_same_term t1 t2 | Pfresh (l1,m1,t1,n1), Pfresh (l2,m2,t2,n2) -> is_same_logic_label l1 l2 && is_same_logic_label m1 m2 && is_same_term t1 t2 && is_same_term n1 n2 | Pseparated(seps1), Pseparated(seps2) -> (try List.for_all2 is_same_term seps1 seps2 with Invalid_argument _ -> false) | (Pfalse | Ptrue | Papp _ | Prel _ | Pand _ | Por _ | Pimplies _ | Piff _ | Pnot _ | Pif _ | Plet _ | Pforall _ | Pexists _ | Pat _ | Pvalid _ | Pvalid_read _ | Pvalid_function _ | Pinitialized _ | Pdangling _ | Pfresh _ | Pallocable _ | Pfreeable _ | Pxor _ | Pseparated _ ), _ -> false and is_same_predicate pred1 pred2 = is_same_list Datatype.String.equal pred1.pred_name pred2.pred_name && is_same_predicate_node pred1.pred_content pred2.pred_content and is_same_identified_predicate p1 p2 = is_same_predicate p1.ip_content p2.ip_content and is_same_identified_term l1 l2 = is_same_term l1.it_content l2.it_content let is_same_deps z1 z2 = match (z1,z2) with (FromAny, FromAny) -> true | From loc1, From loc2 -> is_same_list is_same_identified_term loc1 loc2 | (FromAny | From _), _ -> false let is_same_from (b1,f1) (b2,f2) = is_same_identified_term b1 b2 && is_same_deps f1 f2 let is_same_assigns a1 a2 = match (a1,a2) with (WritesAny, WritesAny) -> true | Writes loc1, Writes loc2 -> is_same_list is_same_from loc1 loc2 | (WritesAny | Writes _), _ -> false let is_same_allocation a1 a2 = match (a1,a2) with (FreeAllocAny, FreeAllocAny) -> true | FreeAlloc(f1,a1), FreeAlloc(f2,a2) -> is_same_list is_same_identified_term f1 f2 && is_same_list is_same_identified_term a1 a2 | (FreeAllocAny | FreeAlloc _), _ -> false let is_same_variant (v1,o1 : Cil_types.variant) (v2,o2: Cil_types.variant) = is_same_term v1 v2 && (match o1, o2 with None, None -> true | None, _ | _, None -> false | Some o1, Some o2 -> o1 = o2) let is_same_post_cond ((k1: Cil_types.termination_kind),p1) (k2,p2) = k1 = k2 && is_same_identified_predicate p1 p2 let is_same_behavior b1 b2 = b1.b_name = b2.b_name && is_same_list is_same_identified_predicate b1.b_assumes b2.b_assumes && is_same_list is_same_identified_predicate b1.b_requires b2.b_requires && is_same_list is_same_post_cond b1.b_post_cond b2.b_post_cond && is_same_assigns b1.b_assigns b2.b_assigns let is_same_spec spec1 spec2 = is_same_list is_same_behavior spec1.spec_behavior spec2.spec_behavior && is_same_opt is_same_variant spec1.spec_variant spec2.spec_variant && is_same_opt is_same_identified_predicate spec1.spec_terminates spec2.spec_terminates && spec1.spec_complete_behaviors = spec2.spec_complete_behaviors && spec1.spec_disjoint_behaviors = spec2.spec_disjoint_behaviors let is_same_logic_type_def d1 d2 = match d1,d2 with LTsum l1, LTsum l2 -> is_same_list is_same_logic_ctor_info l1 l2 | LTsyn ty1, LTsyn ty2 -> is_same_type ty1 ty2 | (LTsyn _ | LTsum _), _ -> false let is_same_logic_type_info t1 t2 = t1.lt_name = t2.lt_name && is_same_list (=) t1.lt_params t2.lt_params && is_same_attributes t1.lt_attr t2.lt_attr && is_same_opt is_same_logic_type_def t1.lt_def t2.lt_def let is_same_loop_pragma p1 p2 = match p1,p2 with Unroll_specs l1, Unroll_specs l2 -> is_same_list is_same_term l1 l2 | Widen_hints l1, Widen_hints l2 -> is_same_list is_same_term l1 l2 | Widen_variables l1, Widen_variables l2 -> is_same_list is_same_term l1 l2 | (Unroll_specs _ | Widen_hints _ | Widen_variables _), _ -> false let is_same_slice_pragma p1 p2 = match p1,p2 with SPexpr t1, SPexpr t2 -> is_same_term t1 t2 | SPctrl, SPctrl | SPstmt, SPstmt -> true | (SPexpr _ | SPctrl | SPstmt), _ -> false let is_same_impact_pragma p1 p2 = match p1,p2 with | IPexpr t1, IPexpr t2 -> is_same_term t1 t2 | IPstmt, IPstmt -> true | (IPexpr _ | IPstmt), _ -> false let is_same_pragma p1 p2 = match p1,p2 with | Loop_pragma p1, Loop_pragma p2 -> is_same_loop_pragma p1 p2 | Slice_pragma p1, Slice_pragma p2 -> is_same_slice_pragma p1 p2 | Impact_pragma p1, Impact_pragma p2 -> is_same_impact_pragma p1 p2 | (Loop_pragma _ | Slice_pragma _ | Impact_pragma _), _ -> false let is_same_extension x1 x2 = Datatype.String.equal x1.ext_name x2.ext_name && (x1.ext_has_status = x2.ext_has_status) && match x1.ext_kind, x2.ext_kind with | Ext_id i1, Ext_id i2 -> i1 = i2 | Ext_terms t1, Ext_terms t2 -> is_same_list is_same_term t1 t2 | Ext_preds p1, Ext_preds p2 -> is_same_list is_same_predicate p1 p2 | (Ext_id _ | Ext_preds _ | Ext_terms _), _ -> false let is_same_code_annotation (ca1:code_annotation) (ca2:code_annotation) = match ca1.annot_content, ca2.annot_content with | AAssert(l1,k1,p1), AAssert(l2,k2,p2) -> is_same_list (=) l1 l2 && k1 = k2 && is_same_predicate p1 p2 | AStmtSpec (l1,s1), AStmtSpec (l2,s2) -> is_same_list (=) l1 l2 && is_same_spec s1 s2 | AInvariant(l1,b1,p1), AInvariant(l2,b2,p2) -> is_same_list (=) l1 l2 && b1 = b2 && is_same_predicate p1 p2 | AVariant v1, AVariant v2 -> is_same_variant v1 v2 | AAssigns(l1,a1), AAssigns(l2,a2) -> is_same_list (=) l1 l2 && is_same_assigns a1 a2 | AAllocation(l1,fa1), AAllocation(l2,fa2) -> is_same_list (=) l1 l2 && is_same_allocation fa1 fa2 | APragma p1, APragma p2 -> is_same_pragma p1 p2 | AExtended (l1,b1,e1), AExtended(l2,b2,e2) -> is_same_list (=) l1 l2 && ((b1:bool) = b2) && is_same_extension e1 e2 | (AAssert _ | AStmtSpec _ | AInvariant _ | AExtended _ | AVariant _ | AAssigns _ | AAllocation _ | APragma _ ), _ -> false let is_same_model_info mi1 mi2 = mi1.mi_name = mi2.mi_name && is_same_c_type mi1.mi_base_type mi2.mi_base_type && is_same_type mi1.mi_field_type mi2.mi_field_type && is_same_attributes mi1.mi_attr mi2.mi_attr let rec is_same_global_annotation ga1 ga2 = match (ga1,ga2) with | Dfun_or_pred (li1,_), Dfun_or_pred (li2,_) -> is_same_logic_info li1 li2 | Daxiomatic (id1,ga1,attr1,_), Daxiomatic (id2,ga2,attr2,_) -> id1 = id2 && is_same_list is_same_global_annotation ga1 ga2 && is_same_attributes attr1 attr2 | Dtype (t1,_), Dtype (t2,_) -> is_same_logic_type_info t1 t2 | Dlemma(n1,ax1,labs1,typs1,st1,attr1,_), Dlemma(n2,ax2,labs2,typs2,st2,attr2,_) -> is_same_string n1 n2 && ax1 = ax2 && is_same_list is_same_logic_label labs1 labs2 && is_same_list (=) typs1 typs2 && is_same_predicate st1 st2 && is_same_attributes attr1 attr2 | Dinvariant (li1,_), Dinvariant (li2,_) -> is_same_logic_info li1 li2 | Dtype_annot (li1,_), Dtype_annot (li2,_) -> is_same_logic_info li1 li2 | Dmodel_annot (li1,_), Dmodel_annot (li2,_) -> is_same_model_info li1 li2 | Dcustom_annot (c1, n1, attr1, _), Dcustom_annot (c2, n2, attr2, _) -> is_same_string n1 n2 && c1 = c2 && is_same_attributes attr1 attr2 | Dvolatile(t1,r1,w1,attr1,_), Dvolatile(t2,r2,w2,attr2,_) -> is_same_list is_same_identified_term t1 t2 && is_same_opt (fun x y -> x.vname = y.vname) r1 r2 && is_same_opt (fun x y -> x.vname = y.vname) w1 w2 && is_same_attributes attr1 attr2 | Dextended(id1,_,_), Dextended(id2,_,_) -> id1 = id2 | (Dfun_or_pred _ | Daxiomatic _ | Dtype _ | Dlemma _ | Dinvariant _ | Dtype_annot _ | Dcustom_annot _ | Dmodel_annot _ | Dvolatile _ | Dextended _), (Dfun_or_pred _ | Daxiomatic _ | Dtype _ | Dlemma _ | Dinvariant _ | Dtype_annot _ | Dcustom_annot _ | Dmodel_annot _ | Dvolatile _ | Dextended _) -> false let is_same_axiomatic ax1 ax2 = is_same_list is_same_global_annotation ax1 ax2 let is_same_pl_constant c1 c2 = let open Logic_ptree in match c1,c2 with | IntConstant s1, IntConstant s2 | FloatConstant s1, FloatConstant s2 | StringConstant s1, StringConstant s2 | WStringConstant s1, WStringConstant s2 -> s1 = s2 | (IntConstant _| FloatConstant _ | StringConstant _ | WStringConstant _), _ -> false let is_same_pl_array_size c1 c2 = let open Logic_ptree in match c1,c2 with | ASnone, ASnone -> true | ASinteger s1, ASinteger s2 | ASidentifier s1, ASidentifier s2 -> s1 = s2 | (ASnone | ASinteger _| ASidentifier _), _ -> false let rec is_same_pl_type t1 t2 = let open Logic_ptree in match t1, t2 with | LTvoid, LTvoid | LTinteger, LTinteger | LTreal, LTreal -> true | LTint k1, LTint k2 -> (match k1, k2 with | IBool, IBool | IChar, IChar | ISChar, ISChar | IUChar, IUChar | IInt, IInt | IUInt, IUInt | IShort, IShort | IUShort, IUShort | ILong, ILong | IULong, IULong | ILongLong, ILongLong | IULongLong, IULongLong -> true | (IBool | IChar | ISChar | IUChar | IInt | IUInt | IShort | IUShort | ILong | IULong | ILongLong | IULongLong), _ -> false ) | LTfloat k1, LTfloat k2 -> (match k1,k2 with | FFloat, FFloat | FDouble, FDouble | FLongDouble, FLongDouble -> true | (FFloat | FDouble | FLongDouble),_ -> false) | LTarray (t1,c1), LTarray(t2,c2) -> is_same_pl_type t1 t2 && is_same_pl_array_size c1 c2 | LTpointer t1, LTpointer t2 -> is_same_pl_type t1 t2 | LTenum s1, LTenum s2 | LTstruct s1, LTstruct s2 | LTunion s1, LTunion s2 -> s1 = s2 | LTnamed (s1,prms1), LTnamed(s2,prms2) -> s1 = s2 && is_same_list is_same_pl_type prms1 prms2 | LTarrow(prms1,t1), LTarrow(prms2,t2) -> is_same_list is_same_pl_type prms1 prms2 && is_same_pl_type t1 t2 | LTattribute(t1,attr1), LTattribute(t2,attr2) -> is_same_pl_type t1 t2 && attr1 = attr2 | (LTvoid | LTinteger | LTreal | LTint _ | LTfloat _ | LTarrow _ | LTarray _ | LTpointer _ | LTenum _ | LTunion _ | LTnamed _ | LTstruct _ | LTattribute _),_ -> false let is_same_quantifiers = is_same_list (fun (t1,x1) (t2,x2) -> x1 = x2 && is_same_pl_type t1 t2) let is_same_unop op1 op2 = let open Logic_ptree in match op1,op2 with | Uminus, Uminus | Ubw_not, Ubw_not | Ustar, Ustar | Uamp, Uamp -> true | (Uminus | Ustar | Uamp | Ubw_not), _ -> false let is_same_binop op1 op2 = let open Logic_ptree in match op1, op2 with | Badd, Badd | Bsub, Bsub | Bmul, Bmul | Bdiv, Bdiv | Bmod, Bmod | Bbw_and, Bbw_and | Bbw_or, Bbw_or | Bbw_xor, Bbw_xor | Blshift, Blshift | Brshift, Brshift -> true | (Badd | Bsub | Bmul | Bdiv | Bmod | Bbw_and | Bbw_or | Bbw_xor | Blshift | Brshift),_ -> false let is_same_relation r1 r2 = let open Logic_ptree in match r1, r2 with | Lt, Lt | Gt, Gt | Le, Le | Ge, Ge | Eq, Eq | Neq, Neq -> true | (Lt | Gt | Le | Ge | Eq | Neq), _ -> false let rec is_same_path_elt p1 p2 = let open Logic_ptree in match p1, p2 with PLpathField s1, PLpathField s2 -> s1 = s2 | PLpathIndex e1, PLpathIndex e2 -> is_same_lexpr e1 e2 | (PLpathField _ | PLpathIndex _), _ -> false and is_same_update_term t1 t2 = let open Logic_ptree in match t1, t2 with | PLupdateTerm e1, PLupdateTerm e2 -> is_same_lexpr e1 e2 | PLupdateCont l1, PLupdateCont l2 -> let is_same_elt (p1,e1) (p2,e2) = is_same_list is_same_path_elt p1 p2 && is_same_update_term e1 e2 in is_same_list is_same_elt l1 l2 | (PLupdateTerm _ | PLupdateCont _), _ -> false and is_same_lexpr l1 l2 = let open Logic_ptree in match l1.lexpr_node,l2.lexpr_node with | PLvar s1, PLvar s2 -> s1 = s2 | PLapp (s1,l1,arg1), PLapp (s2,l2,arg2) -> s1 = s2 && is_same_list (=) l1 l2 && is_same_list is_same_lexpr arg1 arg2 | PLlambda(q1,e1), PLlambda(q2,e2) | PLforall (q1,e1), PLforall(q2,e2) | PLexists(q1,e1), PLexists(q2,e2) -> is_same_quantifiers q1 q2 && is_same_lexpr e1 e2 | PLlet(x1,d1,e1), PLlet(x2,d2,e2) -> x1 = x2 && is_same_lexpr d1 d2 && is_same_lexpr e1 e2 | PLconstant c1, PLconstant c2 -> is_same_pl_constant c1 c2 | PLunop(op1,e1), PLunop(op2,e2) -> is_same_unop op1 op2 && is_same_lexpr e1 e2 | PLbinop(le1,op1,re1), PLbinop(le2,op2,re2) -> is_same_binop op1 op2 && is_same_lexpr le1 le2 && is_same_lexpr re1 re2 | PLdot(e1,f1), PLdot(e2,f2) | PLarrow(e1,f1), PLarrow(e2,f2) -> f1 = f2 && is_same_lexpr e1 e2 | PLarrget(b1,o1), PLarrget(b2,o2) -> is_same_lexpr b1 b2 && is_same_lexpr o1 o2 | PLlist l1, PLlist l2 -> is_same_list is_same_lexpr l1 l2 | PLold e1, PLold e2 -> is_same_lexpr e1 e2 | PLat (e1,s1), PLat(e2,s2) -> s1 = s2 && is_same_lexpr e1 e2 | PLresult, PLresult | PLnull, PLnull | PLfalse, PLfalse | PLtrue, PLtrue | PLempty, PLempty -> true | PLcast(t1,e1), PLcast(t2,e2) -> is_same_pl_type t1 t2 && is_same_lexpr e1 e2 | PLrange(l1,h1), PLrange(l2,h2) -> is_same_opt is_same_lexpr l1 l2 && is_same_opt is_same_lexpr h1 h2 | PLsizeof t1, PLsizeof t2 -> is_same_pl_type t1 t2 | PLsizeofE e1,PLsizeofE e2 | PLtypeof e1,PLtypeof e2-> is_same_lexpr e1 e2 | PLupdate(b1,p1,r1), PLupdate(b2,p2,r2) -> is_same_lexpr b1 b2 && is_same_list is_same_path_elt p1 p2 && is_same_update_term r1 r2 | PLinitIndex l1, PLinitIndex l2 -> let is_same_elt (i1,v1) (i2,v2) = is_same_lexpr i1 i2 && is_same_lexpr v1 v2 in is_same_list is_same_elt l1 l2 | PLinitField l1, PLinitField l2 -> let is_same_elt (s1,v1) (s2,v2) = s1 = s2 && is_same_lexpr v1 v2 in is_same_list is_same_elt l1 l2 | PLtype t1, PLtype t2 -> is_same_pl_type t1 t2 | PLrel(le1,r1,re1), PLrel(le2,r2,re2) -> is_same_relation r1 r2 && is_same_lexpr le1 le2 && is_same_lexpr re1 re2 | PLrepeat (l1, r1), PLrepeat (l2,r2) | PLand(l1,r1), PLand(l2,r2) | PLor(l1,r1), PLor(l2,r2) | PLimplies(l1,r1), PLimplies(l2,r2) | PLxor(l1,r1), PLxor(l2,r2) | PLiff(l1,r1), PLiff(l2,r2) -> is_same_lexpr l1 l2 && is_same_lexpr r1 r2 | PLnot e1, PLnot e2 -> is_same_lexpr e1 e2 | PLfresh (l1,e11,e12), PLfresh (l2,e21,e22) -> l1=l2 && is_same_lexpr e11 e21 && is_same_lexpr e12 e22 | PLallocable (l1,e1), PLallocable (l2,e2) | PLfreeable (l1,e1), PLfreeable (l2,e2) | PLvalid (l1,e1), PLvalid (l2,e2) | PLvalid_read (l1,e1), PLvalid_read (l2,e2) | PLbase_addr (l1,e1), PLbase_addr (l2,e2) | PLoffset (l1,e1), PLoffset (l2,e2) | PLblock_length (l1,e1), PLblock_length (l2,e2) | PLinitialized (l1,e1), PLinitialized (l2,e2) -> l1=l2 && is_same_lexpr e1 e2 | PLvalid_function e1, PLvalid_function e2 -> is_same_lexpr e1 e2 | PLdangling (l1,e1), PLdangling (l2,e2) -> l1=l2 && is_same_lexpr e1 e2 | PLseparated l1, PLseparated l2 -> is_same_list is_same_lexpr l1 l2 | PLif(c1,t1,e1), PLif(c2,t2,e2) -> is_same_lexpr c1 c2 && is_same_lexpr t1 t2 && is_same_lexpr e1 e2 | PLnamed(s1,e1), PLnamed(s2,e2) -> s1 = s2 && is_same_lexpr e1 e2 | PLcomprehension(e1,q1,p1), PLcomprehension(e2,q2,p2) -> is_same_lexpr e1 e2 && is_same_quantifiers q1 q2 && is_same_opt is_same_lexpr p1 p2 | PLset l1, PLset l2 | PLunion l1, PLunion l2 | PLinter l1, PLinter l2 -> is_same_list is_same_lexpr l1 l2 | (PLvar _ | PLapp _ | PLlambda _ | PLlet _ | PLconstant _ | PLunop _ | PLbinop _ | PLdot _ | PLarrow _ | PLarrget _ | PLlist _ | PLrepeat _ | PLold _ | PLat _ | PLbase_addr _ | PLblock_length _ | PLoffset _ | PLresult | PLnull | PLcast _ | PLrange _ | PLsizeof _ | PLsizeofE _ | PLtypeof _ | PLupdate _ | PLinitIndex _ | PLtype _ | PLfalse | PLtrue | PLinitField _ | PLrel _ | PLand _ | PLor _ | PLxor _ | PLimplies _ | PLiff _ | PLnot _ | PLif _ | PLforall _ | PLexists _ | PLvalid _ | PLvalid_read _ | PLvalid_function _ | PLfreeable _ | PLallocable _ | PLinitialized _ | PLdangling _ | PLseparated _ | PLfresh _ | PLnamed _ | PLcomprehension _ | PLunion _ | PLinter _ | PLset _ | PLempty ),_ -> false let hash_label l = match l with StmtLabel _ -> 0 (* We can't rely on sid at this point. *) | BuiltinLabel l -> 19 + Hashtbl.hash l | FormalLabel s -> 23 + Hashtbl.hash s exception StopRecursion of int let hash_quantifiers (acc, depth , tot) quant = if depth <= 0 then raise (StopRecursion acc); let hash_one (acc, tot) lv = if tot <= 0 then raise (StopRecursion acc); (acc + Datatype.String.hash lv.lv_name, tot - 1) in List.fold_left hash_one (acc, tot) quant let rec hash_term (acc,depth,tot) t = if tot <= 0 || depth <= 0 then raise (StopRecursion acc) else begin match t.term_node with | TConst c -> (acc + Cil_datatype.Logic_constant.hash c, tot - 1) | TLval lv -> hash_term_lval (acc+19,depth - 1,tot -1) lv | TSizeOf t -> (acc + 38 + Cil_datatype.TypByName.hash t, tot - 1) | TSizeOfE t -> hash_term (acc+57,depth -1, tot-1) t | TSizeOfStr s -> (acc + 76 + Hashtbl.hash s, tot - 1) | TAlignOf t -> (acc + 95 + Cil_datatype.TypByName.hash t, tot - 1) | TAlignOfE t -> hash_term (acc+114,depth-1,tot-1) t | TUnOp(op,t) -> hash_term (acc+133+Hashtbl.hash op,depth-1,tot-2) t | TBinOp(bop,t1,t2) -> let hash1,tot1 = hash_term (acc+152+Hashtbl.hash bop,depth-1,tot-2) t1 in hash_term (hash1,depth-1,tot1) t2 | TCastE(ty,t) -> let hash1 = Cil_datatype.TypByName.hash ty in hash_term (acc+171+hash1,depth-1,tot-2) t | TAddrOf lv -> hash_term_lval (acc+190,depth-1,tot-1) lv | TStartOf lv -> hash_term_lval (acc+209,depth-1,tot-1) lv | Tapp (li,labs,apps) -> hash_app (acc,depth,tot) li labs apps | Tlambda(quants,t) -> let hash_var (acc,tot) lv = if tot = 0 then raise (StopRecursion acc) else (acc + Hashtbl.hash lv.lv_name,tot-1) in let (acc,tot) = List.fold_left hash_var (acc+247,tot-1) quants in hash_term (acc,depth-1,tot-1) t | TDataCons(ctor,args) -> let hash = acc + 266 + Hashtbl.hash ctor.ctor_name in let hash_one_term (acc,tot) t = hash_term (acc,depth-1,tot) t in List.fold_left hash_one_term (hash,tot-1) args | Tif(t1,t2,t3) -> let hash1,tot1 = hash_term (acc+285,depth-1,tot) t1 in let hash2,tot2 = hash_term (hash1,depth-1,tot1) t2 in hash_term (hash2,depth-1,tot2) t3 | Tat(t,l) -> let hash = acc + 304 + hash_label l in hash_term (hash,depth-1,tot-2) t | Tbase_addr (l,t) -> let hash = acc + 323 + hash_label l in hash_term (hash,depth-1,tot-2) t | Tblock_length (l,t) -> let hash = acc + 342 + hash_label l in hash_term (hash,depth-1,tot-2) t | Toffset (l,t) -> let hash = acc + 351 + hash_label l in hash_term (hash,depth-1,tot-2) t | Tnull -> acc+361, tot - 1 | TUpdate(t1,off,t2) -> let hash1,tot1 = hash_term (acc+418,depth-1,tot-1) t1 in let hash2,tot2 = hash_term_offset (hash1,depth-1,tot1) off in hash_term (hash2,depth-1,tot2) t2 | Ttypeof t -> hash_term (acc+437,depth-1,tot-1) t | Ttype t -> acc + 456 + Cil_datatype.TypByName.hash t, tot - 1 | Tempty_set -> acc + 475, tot - 1 | Tunion tl -> let hash_one_term (acc,tot) t = hash_term (acc,depth-1,tot) t in List.fold_left hash_one_term (acc+494,tot-1) tl | Tinter tl -> let hash_one_term (acc,tot) t = hash_term (acc,depth-1,tot) t in List.fold_left hash_one_term (acc+513,tot-1) tl | Tcomprehension (t,quants,pred) -> (* TODO: hash predicates *) let hash_var (acc,tot) lv = if tot = 0 then raise (StopRecursion acc) else (acc + Hashtbl.hash lv.lv_name,tot-1) in let (acc,tot) = List.fold_left hash_var (acc+532,tot-1) quants in let (acc,tot) = match pred with | None -> (acc,tot-1) | Some pred -> hash_predicate (acc,depth-1,tot-1) pred in hash_term (acc,depth-1,tot-1) t | Trange(t1,t2) -> let acc = acc + 551 in let acc,tot = match t1 with None -> acc,tot - 1 | Some t -> hash_term (acc,depth-1,tot-2) t in if tot <= 0 then raise (StopRecursion acc) else (match t2 with None -> acc, tot - 1 | Some t -> hash_term (acc,depth-1,tot-1) t) | Tlet(li,t) -> hash_term (acc + 570 + Hashtbl.hash li.l_var_info.lv_name, depth-1, tot-1) t | TLogic_coerce(_,t) -> hash_term (acc + 587, depth - 1, tot - 1) t end and hash_app (acc,depth,tot) li labs apps = let hash1 = acc + 228 + Hashtbl.hash li.l_var_info.lv_name in let hash_lb (acc,tot) l = if tot = 0 then raise (StopRecursion acc) else (acc + hash_label l,tot - 1) in let hash_one_term (acc,tot) t = hash_term (acc,depth-1,tot) t in let res = List.fold_left hash_lb (hash1,tot-1) labs in List.fold_left hash_one_term res apps and hash_term_lval (acc,depth,tot) (h,o) = if depth <= 0 || tot <= 0 then raise (StopRecursion acc) else begin let hash, tot = hash_term_lhost (acc, depth-1, tot - 1) h in hash_term_offset (hash, depth-1, tot) o end and hash_term_lhost (acc,depth,tot) h = if depth<=0 || tot <= 0 then raise (StopRecursion acc) else begin match h with | TVar lv -> acc + Hashtbl.hash lv.lv_name, tot - 1 | TResult t -> acc + 19 + Cil_datatype.TypByName.hash t, tot - 2 | TMem t -> hash_term (acc+38,depth-1,tot-1) t end and hash_term_offset (acc,depth,tot) o = if depth<=0 || tot <= 0 then raise (StopRecursion acc) else begin match o with | TNoOffset -> acc, tot - 1 | TField(fi,o) -> hash_term_offset (acc+19+Hashtbl.hash fi.fname,depth-1,tot-1) o | TModel(mi,o) -> hash_term_offset (acc+31+Cil_datatype.Model_info.hash mi,depth-1,tot-1) o | TIndex (t,o) -> let hash, tot = hash_term (acc+37,depth-1,tot-1) t in hash_term_offset (hash,depth-1,tot) o end and hash_predicate (acc,depth,tot) p = if depth <= 0 || tot <= 0 then raise (StopRecursion acc) else begin match p.pred_content with | Pfalse -> (tot-1, acc + 17) | Ptrue -> (tot-1, acc + 29) | Papp (li,labs,apps) -> hash_app (acc,depth,tot) li labs apps | Pseparated l -> let hash_one (acc,tot) t = hash_term (acc,depth - 1, tot) t in List.fold_left hash_one (acc + 37,tot-1) l | Prel (rel,t1,t2) -> let acc = acc + 43 + Hashtbl.hash rel in let (acc,tot) = hash_term (acc,depth-1,tot-1) t1 in hash_term (acc,depth-1,tot-1) t2 | Pand (p1,p2) -> let (acc,tot) = hash_predicate (acc + 47, depth - 1, tot - 1) p1 in hash_predicate (acc,depth - 1, tot) p2 | Por (p1,p2) -> let (acc,tot) = hash_predicate (acc + 53, depth - 1, tot - 1) p1 in hash_predicate (acc,depth - 1, tot) p2 | Pxor (p1, p2) -> let (acc, tot) = hash_predicate (acc + 67, depth - 1, tot - 1) p1 in hash_predicate (acc, depth - 1, tot) p2 | Pimplies (p1, p2) -> let (acc, tot) = hash_predicate (acc + 79, depth - 1, tot - 1) p1 in hash_predicate (acc, depth - 1, tot) p2 | Piff (p1, p2) -> let (acc, tot) = hash_predicate (acc + 83, depth - 1, tot - 1) p1 in hash_predicate (acc, depth - 1, tot) p2 | Pnot p -> hash_predicate (acc + 97, depth - 1, tot - 1) p | Pif (t,p1,p2) -> let (acc, tot) = hash_term (acc + 103, depth - 1, tot - 1) t in let (acc, tot) = hash_predicate (acc + 113, depth - 1, tot) p1 in hash_predicate (acc + 127, depth - 1, tot) p2 | Plet (li, p) -> hash_predicate (acc + 147 + Hashtbl.hash li.l_var_info.lv_name, depth - 1, tot -1) p | Pforall (quant, p) -> let (acc, tot) = hash_predicate (acc+157, depth - 1, tot - 1) p in hash_quantifiers (acc, depth - 1, tot) quant | Pexists(quant, p) -> let (acc, tot) = hash_predicate (acc + 163, depth - 1, tot - 1) p in hash_quantifiers (acc, depth - 1, tot) quant | Pat (p, l) -> hash_predicate (acc + 173 + hash_label l, depth - 1, tot - 1) p | Pvalid_read (l, t) -> hash_term (acc + 187 + hash_label l, depth - 1, tot - 1) t | Pvalid (l, t) -> hash_term (acc + 193 + hash_label l, depth - 1, tot - 1) t | Pvalid_function t -> hash_term (acc + 203, depth - 1, tot - 1) t | Pinitialized (l, t) -> hash_term (acc + 217 + hash_label l, depth - 1, tot - 1) t | Pdangling (l, t) -> hash_term (acc + 227 + hash_label l, depth - 1, tot - 1) t | Pallocable (l, t) -> hash_term (acc + 233 + hash_label l, depth - 1, tot - 1) t | Pfreeable (l, t) -> hash_term (acc + 247 + hash_label l, depth - 1, tot - 1) t | Pfresh (l1, l2, t1, t2) -> let (acc, tot) = hash_term (acc + 259 + hash_label l1 + hash_label l2, depth - 1, tot - 2) t1 in hash_term (acc, depth-1, tot) t2 end let hash_term t = try fst (hash_term (0,10,100) t) with StopRecursion h -> h let hash_predicate p = try fst (hash_predicate (0,10,100) p) with StopRecursion h -> h let rec compare_term t1 t2 = match t1.term_node, t2.term_node with TConst c1, TConst c2 -> Cil_datatype.Logic_constant.compare c1 c2 | TConst _, _ -> 1 | _,TConst _ -> -1 | TLval l1, TLval l2 -> compare_tlval l1 l2 | TLval _, _ -> 1 | _, TLval _ -> -1 | TSizeOf t1, TSizeOf t2 -> Cil_datatype.TypByName.compare t1 t2 | TSizeOf _, _ -> 1 | _, TSizeOf _ -> -1 | TSizeOfE t1, TSizeOfE t2 -> compare_term t1 t2 | TSizeOfE _, _ -> 1 | _, TSizeOfE _ -> -1 | TSizeOfStr s1, TSizeOfStr s2 -> String.compare s1 s2 | TSizeOfStr _, _ -> 1 | _, TSizeOfStr _ -> -1 | TAlignOf t1, TAlignOf t2 -> Cil_datatype.TypByName.compare t1 t2 | TAlignOf _, _ -> 1 | _, TAlignOf _ -> -1 | TAlignOfE t1, TAlignOfE t2 -> compare_term t1 t2 | TAlignOfE _, _ -> 1 | _, TAlignOfE _ -> -1 | TUnOp (o1,t1), TUnOp(o2,t2) -> let res = Transitioning.Stdlib.compare o1 o2 in if res = 0 then compare_term t1 t2 else res | TUnOp _, _ -> 1 | _, TUnOp _ -> -1 | TBinOp(o1,l1,r1), TBinOp(o2,l2,r2) -> let res = Transitioning.Stdlib.compare o1 o2 in if res = 0 then let res = compare_term l1 l2 in if res = 0 then compare_term r1 r2 else res else res | TBinOp _, _ -> 1 | _, TBinOp _ -> -1 | TCastE(typ1,t1), TCastE(typ2,t2) -> let res = Cil_datatype.TypByName.compare typ1 typ2 in if res = 0 then compare_term t1 t2 else res | TCastE _, _ -> 1 | _, TCastE _ -> -1 | TAddrOf l1, TAddrOf l2 -> compare_tlval l1 l2 | TAddrOf _, _ -> 1 | _, TAddrOf _ -> -1 | TStartOf l1, TStartOf l2 -> compare_tlval l1 l2 | TStartOf _, _ -> 1 | _, TStartOf _ -> -1 | Tapp(f1,labels1, args1), Tapp(f2, labels2, args2) -> let res = compare_logic_signature f1 f2 in if res = 0 then let res = Extlib.list_compare compare_logic_label labels1 labels2 in if res = 0 then Extlib.list_compare compare_term args1 args2 else res else res | Tapp _, _ -> 1 | _, Tapp _ -> -1 | Tif(c1,t1,e1), Tif(c2,t2,e2) -> let res = compare_term c1 c2 in if res = 0 then let res = compare_term t1 t2 in if res = 0 then compare_term e1 e2 else res else res | Tif _, _ -> 1 | _, Tif _ -> -1 | Tbase_addr (l1,t1), Tbase_addr (l2,t2) | Tblock_length (l1,t1), Tblock_length (l2,t2) | Toffset (l1,t1), Toffset (l2,t2) | Tat(t1,l1), Tat(t2,l2) -> let res = compare_logic_label l1 l2 in if res = 0 then compare_term t1 t2 else res | Tbase_addr _, _ -> 1 | _, Tbase_addr _ -> -1 | Tblock_length _, _ -> 1 | _, Tblock_length _ -> -1 | Toffset _, _ -> 1 | _, Toffset _ -> -1 | Tat _, _ -> 1 | _, Tat _ -> -1 | Tnull, Tnull -> 0 | Tnull, _ -> 1 | _, Tnull -> -1 | Tlambda (v1,t1), Tlambda(v2,t2) -> let res = Extlib.list_compare compare_var v1 v2 in if res = 0 then compare_term t1 t2 else res | Tlambda _, _ -> 1 | _, Tlambda _ -> -1 | TUpdate(t1,i1,nt1), TUpdate(t2,i2,nt2) -> let res = compare_term t1 t2 in if res = 0 then let res = compare_offset i1 i2 in if res = 0 then compare_term nt1 nt2 else res else res | TUpdate _, _ -> 1 | _, TUpdate _ -> -1 | Ttypeof t1, Ttypeof t2 -> compare_term t1 t2 | Ttypeof _, _ -> 1 | _, Ttypeof _ -> -1 | Ttype ty1, Ttype ty2 -> Cil_datatype.TypByName.compare ty1 ty2 | Ttype _, _ -> 1 | _, Ttype _ -> -1 | TDataCons(ci1,prms1), TDataCons(ci2,prms2) -> let res = compare_logic_ctor_info ci1 ci2 in if res = 0 then Extlib.list_compare compare_term prms1 prms2 else res | TDataCons _, _ -> 1 | _, TDataCons _ -> -1 | Tempty_set, Tempty_set -> 0 | Tempty_set, _ -> 1 | _, Tempty_set -> -1 | (Tunion l1, Tunion l2) | (Tinter l1, Tinter l2) -> Extlib.list_compare compare_term l1 l2 | Tunion _, _ -> 1 | _, Tunion _ -> -1 | Tinter _, _ -> 1 | _, Tinter _ -> -1 | Tcomprehension(e1,q1,p1), Tcomprehension(e2,q2,p2) -> let res = compare_term e1 e2 in if res = 0 then let res = Extlib.list_compare compare_var q1 q2 in if res = 0 then compare_opt compare_predicate p1 p2 else res else res | Tcomprehension _, _ -> 1 | _, Tcomprehension _ -> -1 | Trange(l1,h1), Trange(l2,h2) -> let res = compare_opt compare_term l1 l2 in if res = 0 then compare_opt compare_term h1 h2 else res | Trange _, _ -> 1 | _, Trange _ -> -1 | Tlet(d1,b1), Tlet(d2,b2) -> let res = compare_logic_info d1 d2 in if res = 0 then compare_term b1 b2 else res | Tlet _, _ -> 1 | _, Tlet _ -> -1 | TLogic_coerce(ty1,t1), TLogic_coerce(ty2,t2) -> let res = Cil_datatype.Logic_type_ByName.compare ty1 ty2 in if res = 0 then compare_term t1 t2 else res and compare_logic_info l1 l2 = let res = compare_logic_signature l1 l2 in if res = 0 then compare_logic_body l1.l_body l2.l_body else res and compare_logic_body b1 b2 = match b1,b2 with | LBnone, LBnone -> 0 | LBnone, _ -> 1 | _, LBnone -> -1 | LBreads l1, LBreads l2 -> Extlib.list_compare compare_identified_term l1 l2 | LBreads _, _ -> 1 | _, LBreads _ -> -1 | LBterm t1, LBterm t2 -> compare_term t1 t2 | LBterm _, _ -> 1 | _, LBterm _ -> -1 | LBpred p1, LBpred p2 -> compare_predicate p1 p2 | LBpred _, _ -> 1 | _, LBpred _ -> -1 | LBinductive l1, LBinductive l2 -> Extlib.list_compare compare_indcase l1 l2 and compare_indcase (id1,labs1,typs1,p1) (id2,labs2,typs2,p2) = let res = String.compare id1 id2 in if res = 0 then let res = Extlib.list_compare compare_logic_label labs1 labs2 in if res = 0 then let res = Extlib.list_compare String.compare typs1 typs2 in if res = 0 then compare_predicate p1 p2 else res else res else res and compare_tlval (h1,o1) (h2,o2) = let res = compare_lhost h1 h2 in if res = 0 then compare_offset o1 o2 else res and compare_lhost h1 h2 = match h1, h2 with | TVar v1, TVar v2 -> compare_var v1 v2 | TVar _, _ -> 1 | _, TVar _ -> -1 | TMem t1, TMem t2 -> compare_term t1 t2 | TMem _, _ -> 1 | _, TMem _ -> -1 | TResult t1, TResult t2 -> Cil_datatype.TypByName.compare t1 t2 and compare_offset o1 o2 = match o1, o2 with | TNoOffset, TNoOffset -> 0 | TNoOffset, _ -> 1 | _, TNoOffset -> -1 | TField (f1,o1), TField(f2,o2) -> let res = String.compare f1.fname f2.fname in if res = 0 then compare_offset o1 o2 else res | TField _, _ -> 1 | _, TField _ -> -1 | TModel(f1,o1), TModel(f2,o2) -> let res = String.compare f1.mi_name f2.mi_name in if res = 0 then compare_offset o1 o2 else res | TModel _, _ -> 1 | _, TModel _ -> -1 | TIndex(t1,o1), TIndex(t2,o2) -> let res = compare_term t1 t2 in if res = 0 then compare_offset o1 o2 else res and compare_predicate_node p1 p2 = match p1, p2 with | Pfalse, Pfalse -> 0 | Pfalse, _ -> 1 | _, Pfalse -> -1 | Ptrue, Ptrue -> 0 | Ptrue, _ -> 1 | _, Ptrue -> -1 | Papp(i1,labels1,args1), Papp(i2,labels2,args2) -> let res = compare_logic_signature i1 i2 in if res = 0 then let res = Extlib.list_compare compare_logic_label labels1 labels2 in if res = 0 then Extlib.list_compare compare_term args1 args2 else res else res | Papp _, _ -> 1 | _, Papp _ -> -1 | Prel(r1,lt1,rt1), Prel(r2,lt2,rt2) -> let res = Transitioning.Stdlib.compare r1 r2 in if res = 0 then let res = compare_term lt1 lt2 in if res = 0 then compare_term rt1 rt2 else res else res | Prel _, _ -> 1 | _, Prel _ -> -1 | Pand(lp1,rp1), Pand(lp2,rp2) | Por(lp1,rp1), Por(lp2,rp2) | Pxor (lp1,rp1), Pxor(lp2,rp2) | Pimplies(lp1,rp1), Pimplies(lp2,rp2) | Piff(lp1,rp1), Piff(lp2,rp2) -> let res = compare_predicate lp1 lp2 in if res = 0 then compare_predicate rp1 rp2 else res | Pand _, _ -> 1 | _, Pand _ -> -1 | Por _, _ -> 1 | _, Por _ -> -1 | Pxor _, _ -> 1 | _, Pxor _ -> -1 | Pimplies _, _ -> 1 | _, Pimplies _ -> -1 | Piff _, _ -> 1 | _, Piff _ -> -1 | Pnot p1, Pnot p2 -> compare_predicate p1 p2 | Pnot _, _ -> 1 | _, Pnot _ -> -1 | Pif (c1,t1,e1), Pif(c2,t2,e2) -> let res = compare_term c1 c2 in if res = 0 then let res = compare_predicate t1 t2 in if res = 0 then compare_predicate e1 e2 else res else res | Pif _, _ -> 1 | _, Pif _ -> -1 | Plet (d1,p1), Plet(d2,p2) -> let res = compare_logic_info d1 d2 in if res = 0 then compare_predicate p1 p2 else res | Plet _, _ -> 1 | _, Plet _ -> -1 | Pforall(q1,p1), Pforall(q2,p2) | Pexists(q1,p1), Pexists(q2,p2) -> let res = Extlib.list_compare compare_var q1 q2 in if res = 0 then compare_predicate p1 p2 else res | Pforall _, _ -> 1 | _, Pforall _ -> -1 | Pexists _, _ -> 1 | _, Pexists _ -> -1 | Pat(p1,l1), Pat(p2,l2) -> let res = compare_logic_label l1 l2 in if res = 0 then compare_predicate p1 p2 else res | Pat _, _ -> 1 | _, Pat _ -> -1 | Pallocable (l1,t1), Pallocable (l2,t2) | Pfreeable (l1,t1), Pfreeable (l2,t2) | Pvalid (l1,t1), Pvalid (l2,t2) | Pvalid_read (l1,t1), Pvalid_read (l2,t2) | Pinitialized (l1,t1), Pinitialized (l2,t2) | Pdangling (l1,t1), Pdangling (l2,t2) -> let res = compare_logic_label l1 l2 in if res = 0 then compare_term t1 t2 else res | Pallocable _, _ -> 1 | _, Pallocable _ -> -1 | Pfreeable _, _ -> 1 | _, Pfreeable _ -> -1 | Pvalid _, _ -> 1 | _, Pvalid _ -> -1 | Pvalid_read _, _ -> 1 | _, Pvalid_read _ -> -1 | Pinitialized _, _ -> 1 | _, Pinitialized _ -> -1 | Pdangling _, _ -> 1 | _, Pdangling _ -> -1 | Pvalid_function t1, Pvalid_function t2 -> compare_term t1 t2 | Pvalid_function _, _ -> 1 | _, Pvalid_function _ -> -1 | Pfresh (l1,m1,t1,n1), Pfresh (l2,m2,t2,n2) -> let res = compare_logic_label l1 l2 in if res = 0 then let res = compare_logic_label m1 m2 in if res = 0 then let res = compare_term t1 t2 in if res = 0 then compare_term n1 n2 else res else res else res | Pfresh _, _ -> 1 | _, Pfresh _ -> -1 | Pseparated(seps1), Pseparated(seps2) -> Extlib.list_compare compare_term seps1 seps2 and compare_predicate pred1 pred2 = let res = Extlib.list_compare String.compare pred1.pred_name pred2.pred_name in if res = 0 then compare_predicate_node pred1.pred_content pred2.pred_content else res (* unused for now *) (* and compare_identified_predicate p1 p2 = let res = Extlib.list_compare String.compare p1.ip_name p2.ip_name in if res = 0 then compare_predicate p1.ip_content p2.ip_content else res *) and compare_identified_term l1 l2 = compare_term l1.it_content l2.it_content let get_behavior_names spec = List.fold_left (fun acc b -> b.b_name::acc) [] spec.spec_behavior let merge_allocation fa1 fa2 = if is_same_allocation fa1 fa2 then fa1 else match (fa1,fa2) with | FreeAllocAny, _ -> fa2 | _, FreeAllocAny -> fa1 | FreeAlloc([],a),FreeAlloc(f,[]) | FreeAlloc(f,[]),FreeAlloc([],a) -> FreeAlloc(f,a); | _ -> Kernel.warning ~once:true ~current:true "incompatible allocations clauses. Keeping only the first one."; fa1 let concat_allocation fa1 fa2 = if is_same_allocation fa1 fa2 then fa1 else match (fa1,fa2) with | FreeAllocAny, _ -> fa2 | _, FreeAllocAny -> fa1 | FreeAlloc(f1,a1),FreeAlloc(f2,a2) -> FreeAlloc(f1@f2,a1@a2) (* Merge two from clauses (arguments of constructor Writes). For each assigned location, find the From clauses and verify that they are equal. This avoids duplicates. Beware: this is quadratic in case of mismatch between the two assigns lists. However, in most cases the lists are the same *) let merge_assigns_list l1 l2 = (* Find [asgn] in the list of from clauses given as second argument *) let rec matches asgn = function | [] -> None, [] | (asgn', _ as hd) :: q -> if is_same_identified_term asgn asgn' then Some hd, q (* Return matching from clause *) else let r, l = matches asgn q in (* Search further on *) r, hd :: l in let rec aux l1 l2 = match l1, l2 with | [], [] -> [] (* Merge finished *) | [], _ :: _ -> aux l2 l1 (* to get the warnings on the elements of l2 *) | (asgn1, from1 as cl1) :: q1, l2 -> match matches asgn1 l2 with | None, l2 -> (* asgn1 is only in l1 *) (* Warn only if asgn1 is not \result, as \result is only useful to specify a \from clause (and is removed without one)*) if not (Logic_const.is_result asgn1.it_content) then begin let loc = asgn1.it_content.term_loc in Kernel.warning ~once:true ~source:(fst loc) "location %a is not present in all assigns clauses" Cil_printer.pp_identified_term asgn1; end; (asgn1, from1) :: aux q1 l2 | Some (asgn2, from2 as cl2), q2 -> (* asgn1 is in l1 and l2. Check the from clauses *) if is_same_deps from1 from2 || from2 = FromAny then cl1 :: aux q1 q2 else if from1 = FromAny then cl2 :: aux q1 q2 else begin let loc1 = asgn1.it_content.term_loc in let loc2 = asgn2.it_content.term_loc in Kernel.warning ~once:true ~source:(fst loc1) "@[incompatible@ from@ clauses (%a:'%a'@ and@ %a:'%a').@ \ Keeping@ only@ the first@ one.@]" Cil_printer.pp_location loc1 Cil_printer.pp_from cl1 Cil_printer.pp_location loc2 Cil_printer.pp_from cl2; cl1 :: aux q1 q2 end in aux l1 l2 let merge_assigns a1 a2 = if is_same_assigns a1 a2 then a1 else match (a1,a2) with | WritesAny, _ -> a2 | _, WritesAny -> a1 | Writes l1, Writes l2 -> Writes (merge_assigns_list l1 l2) let concat_assigns a1 a2 = match a1,a2 with | WritesAny, _ | _, WritesAny -> WritesAny | Writes l1, Writes l2 -> Writes (l1 @ l2) let merge_ip_list l1 l2 = List.fold_right (fun p acc -> if List.exists (fun x -> is_same_identified_predicate p x) acc then acc else p::acc) l1 l2 let merge_post_cond l1 l2 = List.fold_right (fun (k1,p1 as pc) acc -> if List.exists (fun (k2,p2) -> k1 = k2 && is_same_identified_predicate p1 p2) acc then acc else pc::acc) l1 l2 let pp_old_loc fmt oldloc = if Cil_datatype.Location.(equal oldloc unknown) then Format.ifprintf fmt "" else Format.fprintf fmt " (old location: %a)" Cil_datatype.Location.pretty oldloc let merge_behaviors ?(oldloc=Cil_datatype.Location.unknown) ~silent old_behaviors fresh_behaviors = old_behaviors @ (List.filter (fun b -> try let old_b = List.find (fun x -> x.b_name = b.b_name) old_behaviors in if not (is_same_behavior b old_b) then begin if not silent then Kernel.warning ~current:true "found two %s%a. Merging them%t" (if Cil.is_default_behavior b then "contracts" else "behaviors named " ^ b.b_name) pp_old_loc oldloc (fun fmt -> if Kernel.debug_atleast 1 then Format.fprintf fmt ":@ @[%a@] vs. @[%a@]" Cil_printer.pp_behavior b Cil_printer.pp_behavior old_b) ; old_b.b_assumes <- merge_ip_list old_b.b_assumes b.b_assumes; old_b.b_requires <- merge_ip_list old_b.b_requires b.b_requires; old_b.b_post_cond <- merge_post_cond old_b.b_post_cond b.b_post_cond; old_b.b_assigns <- merge_assigns old_b.b_assigns b.b_assigns; old_b.b_allocation <- merge_allocation old_b.b_allocation b.b_allocation; end ; false with Not_found -> true) fresh_behaviors) let merge_funspec ?(oldloc=Cil_datatype.Location.unknown) ?(silent_about_merging_behav=false) old_spec fresh_spec = if not (is_same_spec old_spec fresh_spec || Cil.is_empty_funspec fresh_spec) then if Cil.is_empty_funspec old_spec then begin old_spec.spec_terminates <- fresh_spec.spec_terminates; old_spec.spec_behavior <- fresh_spec.spec_behavior; old_spec.spec_complete_behaviors <- fresh_spec.spec_complete_behaviors; old_spec.spec_disjoint_behaviors <- fresh_spec.spec_disjoint_behaviors; old_spec.spec_variant <- fresh_spec.spec_variant; end else begin old_spec.spec_behavior <- merge_behaviors ~oldloc ~silent:silent_about_merging_behav old_spec.spec_behavior fresh_spec.spec_behavior ; (match old_spec.spec_variant,fresh_spec.spec_variant with | None,None -> () | Some _, None -> () | None, Some _ -> old_spec.spec_variant <- fresh_spec.spec_variant | Some _old, Some _fresh -> Kernel.warning ~current:true "found two variants for function specification%a. \ Keeping only the first one." pp_old_loc oldloc); (match old_spec.spec_terminates, fresh_spec.spec_terminates with | None, None -> () | Some p1, Some p2 when is_same_identified_predicate p1 p2 -> () | _ -> Kernel.warning ~current:true "found two different terminates clauses \ for function specification%a. Keeping only the first one" pp_old_loc oldloc); old_spec.spec_complete_behaviors <- List.fold_left (fun acc b -> if List.mem b old_spec.spec_complete_behaviors then acc else b::acc) old_spec.spec_complete_behaviors fresh_spec.spec_complete_behaviors ; old_spec.spec_disjoint_behaviors <- List.fold_left (fun acc b -> if List.mem b old_spec.spec_disjoint_behaviors then acc else b::acc) old_spec.spec_disjoint_behaviors fresh_spec.spec_disjoint_behaviors end let clear_funspec spec = let tmp = Cil.empty_funspec () in spec.spec_terminates <- tmp.spec_terminates; spec.spec_behavior <- tmp.spec_behavior; spec.spec_complete_behaviors <- tmp.spec_complete_behaviors; spec.spec_disjoint_behaviors <- tmp.spec_disjoint_behaviors; spec.spec_variant <- tmp.spec_variant let lhost_c_type thost = let extract_ctype lty = let rec get = function | Ctype typ -> Some typ | Ltype (tdef,_) as ty when is_unrollable_ltdef tdef -> get (unroll_ltdef ty) | Ltype _ | Lvar _ | Linteger | Lreal | Larrow _ -> None in match Logic_const.plain_or_set get lty with | None -> Kernel.fatal "[lhost_c_type] logic type %a does not represent a C type" Cil_datatype.Logic_type.pretty lty | Some ty -> ty in match thost with | TVar v -> extract_ctype v.lv_type | TMem t -> let ty = extract_ctype t.term_type in (match Cil.unrollType ty with | TPtr(ty, _) -> ty | _ -> assert false) | TResult ty -> ty let is_assert ca = match ca.annot_content with AAssert (_, Assert, _) -> true | _ -> false let is_check ca = match ca.annot_content with AAssert (_, Check, _) -> true | _ -> false let is_contract ca = match ca.annot_content with AStmtSpec _ -> true | _ -> false let is_stmt_invariant ca = match ca.annot_content with AInvariant(_,f,_) -> not f | _ -> false let is_loop_invariant ca = match ca.annot_content with AInvariant(_,f,_) -> f | _ -> false let is_invariant ca = match ca.annot_content with AInvariant _ -> true | _ -> false let is_variant ca = match ca.annot_content with AVariant _ -> true | _ -> false let is_allocation ca = match ca.annot_content with AAllocation _ -> true | _ -> false let is_assigns ca = match ca.annot_content with AAssigns _ -> true | _ -> false let is_pragma ca = match ca.annot_content with APragma _ -> true | _ -> false let is_loop_pragma ca = match ca.annot_content with APragma (Loop_pragma _) -> true | _ -> false let is_slice_pragma ca = match ca.annot_content with APragma (Slice_pragma _) -> true | _ -> false let is_impact_pragma ca = match ca.annot_content with APragma (Impact_pragma _) -> true | _ -> false let is_loop_extension ca = match ca.annot_content with AExtended (_,is_loop,_) -> is_loop | _ -> false let is_loop_annot s = is_loop_invariant s || is_assigns s || is_allocation s || is_variant s || is_loop_pragma s || is_loop_extension s let is_trivial_annotation a = match a.annot_content with | AAssert (_,_,a) -> is_trivially_true a | APragma _ | AStmtSpec _ | AInvariant _ | AVariant _ | AAssigns _| AAllocation _ | AExtended _ -> false let is_property_pragma = function | Loop_pragma (Unroll_specs _ | Widen_hints _ | Widen_variables _) | Slice_pragma (SPexpr _ | SPctrl | SPstmt) | Impact_pragma (IPexpr _ | IPstmt) -> false (* If at some time a pragma becomes something which should be proven, update the pragma-related code in gui/property_navigator.ml *) let extract_loop_pragma l = List.fold_right (fun ca l -> match ca.annot_content with APragma (Loop_pragma lp) -> lp::l | _ -> l) l [] let extract_contract l = List.fold_right (fun ca l -> match ca.annot_content with AStmtSpec (l1,spec) -> (l1,spec) :: l | _ -> l) l [] class complete_types = object(self) inherit Cil.nopCilVisitor method private insert_cast_app li args = let rec insert_cast typs terms (changed, args') = match typs, terms with | [], [] -> if changed then List.rev args' else args | [], rest -> if changed then List.rev args' @ rest else args | _, [] -> if changed then List.rev args' else args | { lv_type = typ } :: typs, t :: terms -> let t' = match unroll_type typ with | Ctype typ -> mk_cast typ t | _ -> t in insert_cast typs terms (changed || t != t', t' :: args') in insert_cast li.l_profile args (false, []) method private insert_cast_term t = match t.term_node with | Tapp (li, labs, args) -> let args' = self#insert_cast_app li args in { t with term_node = Tapp(li,labs,args') } | _ -> t method private insert_cast_pred p = match p.pred_content with | Papp (li, labs, args) -> let args' = self#insert_cast_app li args in { p with pred_content = Papp(li,labs,args') } | _ -> p method! vpredicate _ = DoChildrenPost self#insert_cast_pred method! vterm t = match t.term_node with | TLval (TVar v, TNoOffset) when isLogicType Cil.isCompleteType v.lv_type && not (isLogicType Cil.isCompleteType t.term_type) -> ChangeDoChildrenPost({ t with term_type = v.lv_type }, fun x -> x) | _ -> DoChildrenPost self#insert_cast_term end let complete_types f = Cil.visitCilFile (new complete_types) f (* ************************************************************************* *) (** {2 Parsing utilities} *) (* ************************************************************************* *) (** Hack to allow typedefs whose names are ACSL keywords: the state of the lexer depends on the parser rule. See logic_lexer.mll and logic_parser.mly for more details. *) (** - false => keywords are all ACSL keywords - true => only C keywords are recognized as such. (other remains plain identifiers/typenames) *) let kw_c_mode = ref false let enter_kw_c_mode () = kw_c_mode := true let exit_kw_c_mode () = kw_c_mode := false let is_kw_c_mode () = !kw_c_mode let rt_type_mode = ref false (** enter a mode where any identifier is considered a type name. Needed for for return type of a logic function, as the list of admissible variables will be known afterwards. *) let enter_rt_type_mode () = rt_type_mode:=true let exit_rt_type_mode () = rt_type_mode:=false let is_rt_type_mode () = !rt_type_mode let pointer_comparable ?loc t1 t2 = let preds = Logic_env.find_all_logic_functions "\\pointer_comparable" in let cfct_ptr = TPtr (TFun(Cil.voidType,None,false,[]),[]) in let fct_ptr = Ctype cfct_ptr in let obj_ptr = Ctype Cil.voidPtrType in let discriminate t = let loc = t.term_loc in match Logic_const.unroll_ltdef t.term_type with | Ctype ty -> (match Cil.unrollTypeDeep ty with | TPtr(TFun _,_) -> mk_cast ~loc cfct_ptr t, fct_ptr | TPtr(TVoid _,_) -> t, obj_ptr | TPtr _ | TInt _ | TFloat _ | TEnum _ -> (* Value may emit pointer_comparable alarms on anything that may be compared. We cast scalar to void* to account for this *) mk_cast ~loc Cil.voidPtrType t, obj_ptr | TVoid _ | TFun _ | TNamed _ | TComp _ | TBuiltin_va_list _ | TArray _ (* in logic array do not decay implicitly into pointers. *) -> Kernel.fatal "Trying to call \\pointer_comparable on non-pointer value" ) | _ -> Kernel.fatal "Trying to call \\pointer_comparable on non-C pointer type value" in let t1, ty1 = discriminate t1 in let t2, ty2 = discriminate t2 in let pi = try List.find (function | { l_profile = [v1; v2] } -> is_same_type v1.lv_type ty1 && is_same_type v2.lv_type ty2 | _ -> false) preds with Not_found -> Kernel.fatal "built-in predicate \\pointer_comparable not found" in Logic_const.unamed ?loc (Papp (pi, [], [t1;t2])) let is_min_max_function name li = li.l_var_info.lv_name = name && match li.l_profile with | [e] -> Cil_datatype.Logic_type.equal e.lv_type (Logic_const.make_set_type Linteger) | _ -> false let is_max_function li = is_min_max_function "\\max" li let is_min_function li = is_min_max_function "\\min" li let rec constFoldTermToInt ?(machdep=true) (e: term) : Integer.t option = match e.term_node with | TBinOp(bop, e1, e2) -> constFoldBinOpToInt ~machdep bop e1 e2 | TUnOp(unop, e) -> constFoldUnOpToInt ~machdep unop e | TConst(LChr c) -> Some (charConstToInt c) | TConst(LEnum {eival = v}) -> Cil.constFoldToInt ~machdep v | TConst (Integer (i, _)) -> Some i | TConst (LReal _ | LWStr _ | LStr _) -> None | TSizeOf typ -> constFoldSizeOfToInt ~machdep typ | TSizeOfE t -> begin match unroll_type t.term_type with | Ctype typ -> constFoldSizeOfToInt ~machdep typ | _ -> None end | TSizeOfStr s -> Some (Integer.of_int (1 + String.length s)) | TAlignOf t -> begin try Some (Integer.of_int (Cil.bytesAlignOf t)) with Cil.SizeOfError _ -> None end | TAlignOfE _ -> None (* exp case is very complex, and possibly incorrect *) | TCastE (typ, e) -> constFoldCastToInt ~machdep typ e | Toffset (_, t) -> if machdep then constFoldToffset t else None | Tif (c, e1, e2) -> begin match constFoldTermToInt ~machdep c with | None -> None | Some i -> constFoldTermToInt ~machdep (if Integer.is_zero i then e2 else e1) end | TLogic_coerce (lt, e) -> if lt = Linteger then constFoldTermToInt ~machdep e else None | Tnull -> Some Integer.zero | Tapp (li, _, [{term_node = (Tunion args | TLogic_coerce (_, {term_node = Tunion args}))}]) when is_max_function li -> constFoldMinMax ~machdep Integer.max args | Tapp (li, _, [{term_node = (Tunion args | TLogic_coerce (_, {term_node = Tunion args}))}]) when is_min_function li -> constFoldMinMax ~machdep Integer.min args | TLval _ | TAddrOf _ | TStartOf _ | Tapp _ | Tlambda _ | TDataCons _ | Tat _ | Tbase_addr _ | Tblock_length _ | TUpdate _ | Ttypeof _ | Ttype _ | Tempty_set | Tunion _ | Tinter _ | Tcomprehension _ | Trange _ | Tlet _ -> None and constFoldCastToInt ~machdep typ e = try let ik = match Cil.unrollType typ with | TInt (ik, _) -> ik | TPtr _ -> theMachine.upointKind | TEnum (ei,_) -> ei.ekind | _ -> raise Exit in match constFoldTermToInt ~machdep e with | Some i -> Some (fst (Cil.truncateInteger64 ik i)) | _ -> None with Exit -> None and constFoldSizeOfToInt ~machdep typ = if machdep then try Some (Integer.of_int (bytesSizeOf typ)) with SizeOfError _ -> None else None and constFoldUnOpToInt ~machdep unop e = let i = constFoldTermToInt ~machdep e in match i with | None -> None | Some i -> match unop with | Neg -> Some (Integer.neg i) | BNot -> Some (Integer.lognot i) | LNot -> Some (if Integer.equal i Integer.zero then Integer.one else Integer.zero) and constFoldBinOpToInt ~machdep bop e1 e2 = match constFoldTermToInt ~machdep e1, constFoldTermToInt ~machdep e2 with | Some i1, Some i2 -> begin let comp op = Some (if op i1 i2 then Integer.one else Integer.zero) in let logic op = let b1 = not (Integer.is_zero i1) and b2 = not (Integer.is_zero i2) in Some (if op b1 b2 then Integer.one else Integer.zero) in match bop with | PlusA -> Some (Integer.add i1 i2) | MinusA -> Some (Integer.sub i1 i2) | PlusPI | IndexPI | MinusPI | MinusPP -> None | Mult -> Some (Integer.mul i1 i2) | Div -> if Integer.(equal zero i2) && Integer.(is_zero (e_rem i1 i2)) then None else Some (Integer.e_div i1 i2) | Mod -> if Integer.(equal zero i2) then None else Some (Integer.e_rem i1 i2) | BAnd -> Some (Integer.logand i1 i2) | BOr -> Some (Integer.logor i1 i2) | BXor -> Some (Integer.logxor i1 i2) | Shiftlt when Integer.(ge i2 zero) -> Some (Integer.shift_left i1 i2) | Shiftrt when Integer.(ge i2 zero) -> Some (Integer.shift_right i1 i2) | Shiftlt | Shiftrt -> None | Cil_types.Eq -> comp Integer.equal | Cil_types.Ne -> comp (fun i1 i2 -> not (Integer.equal i1 i2)) | Cil_types.Le -> comp Integer.le | Cil_types.Ge -> comp Integer.ge | Cil_types.Lt -> comp Integer.lt | Cil_types.Gt -> comp Integer.gt | LAnd -> logic (&&) | LOr -> logic (||) end | None, _ | _, None -> None (* [t] is the argument of [\offset] *) and constFoldToffset t = match t.term_node with | TStartOf (TVar v, offset) | TAddrOf (TVar v, offset) -> begin try let start, _width = bitsLogicOffset v.lv_type offset in let size_char = Integer.eight in if Integer.(is_zero (e_rem start size_char)) then Some (Integer.e_div start size_char) else None (* bitfields *) with Cil.SizeOfError _ -> None end | _ -> None (* This function supposes that ~machdep is [true] *) and bitsLogicOffset ltyp off : Integer.t * Integer.t = let rec loopOff typ width start = function | TNoOffset -> start, width | TIndex(e, off) -> begin let ei = match constFoldTermToInt e with | Some i -> i | None -> raise (SizeOfError ("Index is not constant", typ)) in let typ_e = Cil.typeOf_array_elem typ in let size_e = Integer.of_int (Cil.bitsSizeOf typ_e) in loopOff typ size_e (Integer.(add start (mul ei size_e))) off end | TField(f, off) -> if f.fcomp.cstruct then begin (* Force the computation of the fields fsize_in_bits and foffset_in_bits *) ignore (Cil.bitsOffset typ (Field (f, NoOffset))); let size = Integer.of_int (Extlib.the f.fsize_in_bits) in let offset_f = Integer.of_int (Extlib.the f.foffset_in_bits) in loopOff f.ftype size (Integer.add start offset_f) off end else (* All union fields start at offset 0 *) loopOff f.ftype (Integer.of_int (Cil.bitsSizeOf f.ftype)) start off | TModel _ -> raise (SizeOfError ("bitsLogicOffset on model field", typ)) in match unroll_type ltyp with | Ctype typ -> loopOff typ Integer.zero Integer.zero off | _ -> raise (SizeOfError ("bitsLogicOffset on logic type", Cil.voidPtrType)) (* Handle \min(\union(args)) or \max(\union(args)), depending on [f] *) and constFoldMinMax ~machdep f args = match args with | [] -> None (* meaningless, cannot simplify *) | arg :: args -> let aux res t = match res, constFoldTermToInt ~machdep t with | None, _ | _, None -> None | Some i, Some i' -> Some (f i i') in List.fold_left aux (constFoldTermToInt ~machdep arg) args let rec fold_itv f b e acc = if Integer.equal b e then f acc b else fold_itv f (Integer.succ b) e (f acc b) (* Find the initializer for index [i] in [init] *) let find_init_by_index init i = let same_offset (off, _) = match off with | Index (i', NoOffset) -> Integer.equal i (Extlib.the (Cil.isInteger i')) | _ -> false in snd (List.find same_offset init) (* Find the initializer for field [f] in [init] *) let find_init_by_field init f = let same_offset (off, _) = match off with | Field (f', NoOffset) -> f == f' | _ -> false in snd (List.find same_offset init) exception CannotSimplify (* Evaluate the bounds of the range [b..e] as constants. The array being indexed has type [typ]. If [b] or [e] are not specified, use default values. *) let const_fold_trange_bounds typ b e = let extract = function None -> raise CannotSimplify | Some i -> i in let b = match b with | Some tb -> extract (constFoldTermToInt tb) | None -> Integer.zero in let e = match e with | Some te -> extract (constFoldTermToInt te) | None -> match Cil.unrollType typ with | TArray (_, Some size, _, _) -> Integer.pred (extract (Cil.isInteger size)) | _ -> raise CannotSimplify in b, e (** Find the value corresponding to the logic offset [loff] inside the initializer [init]. Zero is used as a default value when the initializer is incomplete. [loff] must have an integral type. Returns a set of values when [loff] contains ranges. *) let find_initial_value init loff = let module S = Datatype.Integer.Set in let extract = function None -> raise CannotSimplify | Some i -> i in let rec aux loff init = match loff, init with | TNoOffset, SingleInit e -> S.singleton (extract (Cil.constFoldToInt e)) | TIndex (i, loff), CompoundInit (typ, l) -> begin (* Add the initializer at offset [Index(i, loff)] to [acc]. *) let add_index acc i = let vi = try aux loff (find_init_by_index l i) with Not_found -> S.singleton Integer.zero in S.union acc vi in match i.term_node with | Tunion tl -> let conv t = extract (constFoldTermToInt t) in List.fold_left add_index S.empty (List.map conv tl) | Trange (b, e) -> let b, e = const_fold_trange_bounds typ b e in fold_itv add_index b e S.empty | _ -> let i = extract (constFoldTermToInt i) in add_index S.empty i end | TField (f, loff), CompoundInit (_, l) -> if f.fcomp.cstruct then try aux loff (find_init_by_field l f) with Not_found -> S.singleton Integer.zero else (* too complex, a value might be written through another field *) raise CannotSimplify | TNoOffset, CompoundInit _ | (TIndex _ | TField _), SingleInit _ -> assert false | TModel _, _ -> raise CannotSimplify in try match init with | None -> Some (S.singleton Integer.zero) | Some init -> Some (aux loff init) with CannotSimplify -> None (** Evaluate the given term l-value in the initial state *) let eval_term_lval global_find_init (lhost, loff) = match lhost with | TVar lvi -> begin (** See if we can evaluate the l-value using the initializer of lvi*) let off_type = Cil.typeTermOffset lvi.lv_type loff in if Logic_const.plain_or_set Cil.isLogicIntegralType off_type then match lvi.lv_origin with | Some vi when vi.vglob && Cil.typeHasQualifier "const" vi.vtype -> find_initial_value (global_find_init vi) loff | _ -> None else None end | _ -> None class simplify_const_lval global_find_init = object (self) inherit Cil.genericCilVisitor (Visitor_behavior.copy (Project.current ())) method! vterm t = match t.term_node with | TLval tlv -> begin (* simplify recursively tlv before attempting evaluation *) let tlv = Cil.visitCilTermLval (self:>Cil.cilVisitor) tlv in match eval_term_lval global_find_init tlv with | None -> Cil.SkipChildren | Some itvs -> (* Replace the value/set of values found by something that has the expected logic type (plain/Set) *) let typ = Logic_const.plain_or_set Extlib.id t.term_type in let aux i l = Logic_const.term (TConst (Integer (i,None))) typ :: l in let l = Datatype.Integer.Set.fold aux itvs [] in match l, Logic_const.is_plain_type t.term_type with | [i], true -> Cil.ChangeTo i | _, false -> Cil.ChangeTo (Logic_const.term (Tunion l) t.term_type) | _ -> Cil.SkipChildren end | _ -> Cil.DoChildren end (* ************************************************************************** *) (** {1 Deprecated} *) let instantiate = Logic_const.instantiate (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_queries/logic_utils.mli0000666000000000000000000004060213571573400022533 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Utilities for ACSL constructs. @plugin development guide *) open Cil_types (** exception raised when a parsed logic expression is syntactically not well-formed. *) exception Not_well_formed of Cil_types.location * string (** basic utilities for logic terms and predicates. See also {! Logic_const} to build terms and predicates. @plugin development guide *) (** add a logic function in the environment. See {!Logic_env.add_logic_function_gen}*) val add_logic_function : logic_info -> unit (** {2 Types} *) (** instantiate type variables in a logic type. *) val instantiate : (string * logic_type) list -> logic_type -> logic_type [@@deprecated "Use Logic_const.instantiate instead."] (** [is_instance_of poly t1 t2] returns [true] if [t1] can be derived from [t2] by instantiating some of the type variable in [poly]. @since Magnesium-20151001 *) val is_instance_of: string list -> logic_type -> logic_type -> bool (** expands logic type definitions. If the [unroll_typedef] flag is set to [true] (this is the default), C typedef will be expanded as well. *) val unroll_type : ?unroll_typedef:bool -> logic_type -> logic_type (** [isLogicType test typ] is [false] for pure logic types and the result of test for C types. In case of a set type, the function tests the element type. *) val isLogicType : (typ -> bool) -> logic_type -> bool (** {3 Predefined tests over types} *) val isLogicArrayType : logic_type -> bool (** @modify Chlorine-20180501 old behavior renamed as [isLogicAnyCharType] *) val isLogicCharType : logic_type -> bool (** @since Chlorine-20180501 *) val isLogicAnyCharType : logic_type -> bool val isLogicVoidType : logic_type -> bool val isLogicPointerType : logic_type -> bool val isLogicVoidPointerType : logic_type -> bool (** {3 Type conversions} *) (** @return the equivalent C type. @raise Failure if the type is purely logical *) val logicCType : logic_type -> typ (** transforms an array into pointer. *) val array_to_ptr : logic_type -> logic_type (** C type to logic type, with implicit conversion for arithmetic types. *) val typ_to_logic_type : typ -> logic_type (** {2 Predicates} *) (** @deprecated use Logic_const.pred_of_id_pred instead *) val predicate_of_identified_predicate: identified_predicate -> predicate [@@ deprecated "Use Logic_const.pred_of_id_pred instead"] (** transforms \old and \at(,Old) into \at(,L) for L a label pointing to the given statement, creating one if needed. *) val translate_old_label: stmt -> predicate -> predicate (** {2 Terms} *) (** [true] if the term denotes a C array. *) val is_C_array : term -> bool (** creates a TStartOf from an TLval. *) val mk_logic_StartOf : term -> term (** creates an AddrOf from a TLval. The given logic type is the type of the lval. @since Neon-20140301 *) val mk_logic_AddrOf: ?loc:Cil_types.location -> term_lval -> logic_type -> term (** [true] if the term is a pointer. *) val isLogicPointer : term -> bool (** creates either a TStartOf or the corresponding TLval. *) val mk_logic_pointer_or_StartOf : term -> term (** creates a logic cast if required, with some automatic simplifications being performed automatically. If [force] is [true], the cast will always be inserted. Otherwise (which is the default), [mk_cast typ t] will return [t] if it is already of type [typ] @modify Aluminium-20160501 added [force] optional argument *) val mk_cast: ?loc:location -> ?force:bool -> typ -> term -> term (** [array_with_range arr size] returns the logic term [array'+{0..(size-1)}], [array'] being [array] cast to a pointer to char *) val array_with_range: exp -> term -> term (** Removes TLogic_coerce at head of term. *) val remove_logic_coerce: term -> term (** [numeric_coerce typ t] returns a term with the same value as [t] and of type [typ]. [typ] which should be [Linteger] or [Lreal]. [numeric_coerce] tries to avoid unnecessary type conversions in [t]. In particular, [numeric_coerce (int)cst Linteger], where [cst] fits in int will be directly [cst], without any coercion. @since Magnesium-20151001 *) val numeric_coerce: logic_type -> term -> term (** {2 Predicates} *) (** \valid_index *) (* val mk_pvalid_index: ?loc:location -> term * term -> predicate *) (** \valid_range *) (* val mk_pvalid_range: ?loc:location -> term * term * term -> predicate *) val pointer_comparable: ?loc:location -> term -> term -> predicate (** \pointer_comparable @since Fluorine-20130401 *) (** {3 Conversion from exp to term}*) (** translates a C expression into an "equivalent" logical term. [cast] specifies how C arithmetic operators are translated. When [cast] is [true], the translation returns a logic [term] having the same semantics of the C [expr] by introducing casts (i.e. the C expr [a+b] can be translated as [(char)(((char)a)+(char)b)] to preserve the modulo feature of the C addition). Otherwise, no such casts are introduced and the C arithmetic operators are translated into perfect mathematical operators (i.e. a floating point addition is translated into an addition of [real] numbers). @plugin development guide *) val expr_to_term : cast:bool -> exp -> term (** same as {!expr_to_term}, except that if the new term has an arithmetic type, it is automatically coerced into real (or integer for integral types). @since Magnesium-20151001 *) val expr_to_term_coerce: cast:bool -> exp -> term val is_zero_comparable: term -> bool (** [true] if the given term has a type for which a comparison to 0 exists (i.e. scalar C types, logic integers and reals). @since Sulfur-20171101 *) val expr_to_predicate: cast:bool -> exp -> identified_predicate (** same as {expr_to_term}, but the result is a predicate. Expressions starting with relational operators ([==], [<=], etc) are translated directly. Otherwise, the result of [expr_to_predicate e] is the predicate [e <> 0]. @raise Fatal error if the expression is not a comparison and cannot be compared to zero. @since Sulfur-20171101 *) val scalar_term_to_predicate: term -> predicate (** Compare the given term with the constant 0 (of the appropriate type) to return the result of the comparison [e <> 0]. @raise Fatal error if the argument cannot be compared to 0 @since Sulfur-20171101 *) val lval_to_term_lval : cast:bool -> lval -> term_lval val host_to_term_host : cast:bool -> lhost -> term_lhost val offset_to_term_offset : cast:bool -> offset -> term_offset val constant_to_lconstant: constant -> logic_constant val lconstant_to_constant: logic_constant-> constant (** Parse the given string as a float logic constant, taking into account the fact that the constant may not be exactly representable. This function should only be called on strings that have been recognized by the parser as valid floats *) val string_to_float_lconstant: string -> logic_constant (** [remove_term_offset o] returns [o] without its last offset and this last offset. *) val remove_term_offset : term_offset -> term_offset * term_offset (** true if \result is included in the lval. *) val lval_contains_result : term_lhost -> bool (** true if \result is included in the offset. *) val loffset_contains_result : term_offset -> bool (** true if \result is included in the term *) val contains_result : term -> bool (** returns the body of the given predicate. @raise Not_found if the logic_info is not the definition of a predicate. *) val get_pred_body : logic_info -> predicate (** true if the term is \result or an offset of \result. *) val is_result : term -> bool val lhost_c_type : term_lhost -> typ (** {2 Predicates} *) (** [true] if the predicate is Ptrue. @since Nitrogen-20111001 *) val is_trivially_true: predicate -> bool (** [true] if the predicate is Pfalse @since Nitrogen-20111001 *) val is_trivially_false: predicate -> bool (** {2 Global annotations} *) (** add an attribute to a global annotation @since Phosphorus-20170501-beta1 *) val add_attribute_glob_annot: attribute -> global_annotation -> global_annotation (** {2 Structural equality between annotations} *) val is_same_list: ('a -> 'a -> bool) -> 'a list -> 'a list -> bool val is_same_logic_label : logic_label -> logic_label -> bool (** @since Nitrogen-20111001 *) val is_same_pconstant: Logic_ptree.constant -> Logic_ptree.constant -> bool val is_same_type : logic_type -> logic_type -> bool val is_same_var : logic_var -> logic_var -> bool val is_same_logic_signature : logic_info -> logic_info -> bool val is_same_logic_profile : logic_info -> logic_info -> bool val is_same_builtin_profile : builtin_logic_info -> builtin_logic_info -> bool val is_same_logic_ctor_info : logic_ctor_info -> logic_ctor_info -> bool (** @deprecated Nitrogen-20111001 use {!Cil.compareConstant} instead. *) val is_same_constant : constant -> constant -> bool val is_same_term : term -> term -> bool val is_same_logic_info : logic_info -> logic_info -> bool val is_same_logic_body : logic_body -> logic_body -> bool val is_same_indcase : string * logic_label list * string list * predicate -> string * logic_label list * string list * predicate -> bool val is_same_tlval : term_lval -> term_lval -> bool val is_same_lhost : term_lhost -> term_lhost -> bool val is_same_offset : term_offset -> term_offset -> bool val is_same_predicate_node : predicate_node -> predicate_node -> bool val is_same_predicate : predicate -> predicate -> bool val is_same_identified_predicate : identified_predicate -> identified_predicate -> bool val is_same_identified_term : identified_term -> identified_term -> bool val is_same_deps : deps -> deps -> bool val is_same_allocation : allocation -> allocation -> bool val is_same_assigns : assigns -> assigns -> bool val is_same_variant : variant -> variant -> bool val is_same_post_cond : termination_kind * identified_predicate -> termination_kind * identified_predicate -> bool val is_same_behavior : funbehavior -> funbehavior -> bool val is_same_spec : funspec -> funspec -> bool val is_same_logic_type_def : logic_type_def -> logic_type_def -> bool val is_same_logic_type_info : logic_type_info -> logic_type_info -> bool val is_same_loop_pragma : loop_pragma -> loop_pragma -> bool val is_same_slice_pragma : slice_pragma -> slice_pragma -> bool val is_same_impact_pragma : impact_pragma -> impact_pragma -> bool val is_same_pragma : pragma -> pragma -> bool val is_same_code_annotation : code_annotation -> code_annotation -> bool val is_same_global_annotation : global_annotation -> global_annotation -> bool val is_same_axiomatic : global_annotation list -> global_annotation list -> bool (** @since Oxygen-20120901 *) val is_same_model_info: model_info -> model_info -> bool val is_same_lexpr: Logic_ptree.lexpr -> Logic_ptree.lexpr -> bool (** hash function compatible with is_same_term *) val hash_term: term -> int (** comparison compatible with is_same_term *) val compare_term: term -> term -> int val hash_predicate: predicate -> int val compare_predicate: predicate -> predicate -> int (** {2 Merging contracts} *) val get_behavior_names : spec -> string list (** Concatenates two assigns if both are defined, returns WritesAny if one (or both) of them is WritesAny. @since Nitrogen-20111001 *) val concat_assigns: assigns -> assigns -> assigns (** merge assigns: take the one that is defined and select an arbitrary one if both are, emitting a warning unless both are syntactically the same. *) val merge_assigns : assigns -> assigns -> assigns (** Concatenates two allocation clauses if both are defined, returns FreeAllocAny if one (or both) of them is FreeAllocAny. @since Nitrogen-20111001 *) val concat_allocation: allocation -> allocation -> allocation (** merge allocation: take the one that is defined and select an arbitrary one if both are, emitting a warning unless both are syntactically the same. @since Oxygen-20120901 *) val merge_allocation : allocation -> allocation -> allocation val merge_behaviors : ?oldloc:Cil_types.location -> silent:bool -> funbehavior list -> funbehavior list -> funbehavior list (** [merge_funspec ?oldloc oldspec newspec] merges [newspec] into [oldspec]. If the funspec belongs to a kernel function, do not forget to call {!Kernel_function.set_spec} after merging. @modify 20.0-Calcium add optional parameter [oldloc]. *) val merge_funspec : ?oldloc:Cil_types.location -> ?silent_about_merging_behav:bool -> funspec -> funspec -> unit (** Reset the given funspec to empty. @since Nitrogen-20111001 *) val clear_funspec: funspec -> unit (** {2 Discriminating code_annotations} *) (** Functions below allows to test a special kind of code_annotation. Use them in conjunction with {!Annotations.get_filter} to retrieve a particular kind of annotations associated to a statement. *) val is_assert : code_annotation -> bool val is_check : code_annotation -> bool val is_contract : code_annotation -> bool val is_stmt_invariant : code_annotation -> bool val is_loop_invariant : code_annotation -> bool val is_invariant : code_annotation -> bool val is_variant : code_annotation -> bool val is_assigns : code_annotation -> bool val is_pragma : code_annotation -> bool val is_loop_pragma : code_annotation -> bool val is_slice_pragma : code_annotation -> bool val is_impact_pragma : code_annotation -> bool val is_loop_annot : code_annotation -> bool val is_trivial_annotation : code_annotation -> bool val is_property_pragma : pragma -> bool (** Should this pragma be proved by plugins *) val extract_loop_pragma : code_annotation list -> loop_pragma list val extract_contract : code_annotation list -> (string list * funspec) list (** {2 Constant folding} *) val constFoldTermToInt: ?machdep:bool -> term -> Integer.t option (** A [cilVisitor] (by copy) that simplifies expressions of the type [const int x = v], where [v] is an integer and [x] is a global variable. Requires a mapping from [varinfo] to [init option] (e.g. based on [Globals.Vars.find]). @since Silicon-20161101 *) class simplify_const_lval: (varinfo -> init option) -> Cil.cilVisitor (** {2 Type-checking hackery} *) (** give complete types to terms that refer to a variable whose type has been completed after its use in an annotation. Internal use only. @since Neon-20140301 *) val complete_types: file -> unit (** {2 Parsing hackery} *) (** Values that control the various modes of the parser and lexer for logic. Use with care. *) val kw_c_mode : bool ref val enter_kw_c_mode : unit -> unit val exit_kw_c_mode : unit -> unit val is_kw_c_mode : unit -> bool val rt_type_mode : bool ref val enter_rt_type_mode : unit -> unit val exit_rt_type_mode : unit -> unit val is_rt_type_mode : unit -> bool (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_transformations/0000777000000000000000000000000013571573400021265 5ustar frama-c-20.0-Calcium/src/kernel_services/ast_transformations/clone.ml0000666000000000000000000001043413571573400022721 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Experimental module *) let mk_new_name = let prefix = "__fc_clone_" in let counter = ref 0 in fun name -> incr counter; prefix ^ (string_of_int !counter) ^ "_" ^ name (** Returns a clone of a defined kernel function to add into the current AST *) let clone_function_definition old_kf = let visitor = new Visitor.frama_c_refresh (Project.current()) in let old_fundec = Kernel_function.get_definition old_kf in let old_loc = Kernel_function.get_location old_kf in let old_funspec = Annotations.funspec ~populate:false old_kf in visitor#set_current_kf old_kf; visitor#set_current_func old_fundec; let new_fundec = Visitor.visitFramacFunction visitor old_fundec in (* update the CFG and sallstmts field *) Cfg.clearCFGinfo ~clear_id:false new_fundec; Cfg.cfgFun new_fundec; let new_vi = new_fundec.svar in new_vi.vname <- mk_new_name old_fundec.svar.vname; let new_funspec = Visitor.visitFramacFunspec visitor old_funspec in (* Creates the kernel function for the clone function. *) let new_kf = (* NOTE: it would be better if the replace function would return the associated kernel function that is new here *) Globals.Functions.replace_by_definition new_funspec new_fundec old_loc; try Globals.Functions.get new_fundec.svar with Not_found -> Kernel.fatal "No clone kernel function for %s(%d)" new_fundec.svar.vname new_fundec.svar.vid in new_kf (** Returns a clone of a kernel function and adds it into the current AST *) let clone_defined_kernel_function old_kf = let f = Ast.get() in let new_kf = clone_function_definition old_kf in let new_fundec = Kernel_function.get_definition new_kf in let new_loc = Kernel_function.get_location new_kf in let gfun = GFun (new_fundec, new_loc) in let old_vi = Kernel_function.get_vi old_kf in let is_old_fundec fundec = Cil_datatype.Varinfo.equal fundec.svar old_vi in let is_old_gfun = function | GFun (fundec,_) -> is_old_fundec fundec | _ -> false in (* Scan the globals. Make sure this is tail recursive. *) let rec loop (acc: global list) = function | [] -> begin match f.globinit with | Some fundec when is_old_fundec fundec -> (* The clone function is the global initializer function. Adds it at the end of the list of globals. *) List.rev_append acc [gfun] | _ -> Kernel.fatal "kernel function not found for %s(%d)" old_vi.vname old_vi.vid end | g :: restg when is_old_gfun g -> List.rev_append acc (g:: gfun ::restg) | g :: restg -> loop (g::acc) restg in (* Updates the list of globals *) f.globals <- loop [] f.globals; Ast.mark_as_grown(); new_kf (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_transformations/clone.mli0000666000000000000000000000354713571573400023101 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Experimental module *) (** Returns a clone of a kernel function and adds it into the AST next to the old one *) val clone_defined_kernel_function: kernel_function -> kernel_function (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_transformations/filter.ml0000666000000000000000000011652713571573400023120 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil open Cil_types module FC_file = File (* overwritten by Cil_datatype *) open Cil_datatype open Extlib let debug fmt = Kernel.debug ~current:true ~dkey:Kernel.dkey_filter fmt module type RemoveInfo = sig type proj type fct exception EraseAssigns exception EraseAllocation val fct_info : proj -> kernel_function -> fct list val fct_name : varinfo -> fct -> string val param_visible : fct -> int -> bool val body_visible : fct -> bool val loc_var_visible : fct -> varinfo -> bool val inst_visible : fct -> stmt -> bool val label_visible : fct -> stmt -> label -> bool val annotation_visible: fct -> stmt -> code_annotation -> bool val fun_precond_visible : fct -> predicate -> bool val fun_postcond_visible : fct -> predicate -> bool val fun_variant_visible : fct -> term -> bool val fun_frees_visible : fct -> identified_term -> bool val fun_allocates_visible : fct -> identified_term -> bool val fun_assign_visible : fct -> from -> bool val fun_deps_visible : fct -> identified_term -> bool val called_info : (proj * fct) -> stmt -> (kernel_function * fct) option val res_call_visible : fct -> stmt -> bool val result_visible : kernel_function -> fct -> bool val cond_edge_visible: fct -> stmt -> bool * bool end module F (Info : RemoveInfo) : sig val build_cil_file: ?last:bool -> string -> Info.proj -> Project.t end = struct type t = (string, Cil_types.varinfo) Hashtbl.t let mk_new_stmt s kind = s.skind <- kind let mk_skip loc = Instr (Skip loc) let mk_stmt_skip st = mk_skip (Stmt.loc st) let static_from_kf kf = let res = ref [] in let vis = object inherit Visitor.frama_c_inplace method! vblock b = res := b.bstatics @ !res; DoChildren end in ignore (Visitor.visitFramacKf (vis:>Visitor.frama_c_visitor) kf); !res let make_new_kf tbl kf v = try Cil_datatype.Varinfo.Hashtbl.find tbl v with Not_found -> let fundec = match kf.fundec with | Definition(f,l) -> Definition ( { f with svar = v },l) | Declaration(_,_,arg,l) -> Declaration(Cil.empty_funspec(),v,arg,l) in let kf = { fundec = fundec; spec = Cil.empty_funspec() } in Cil_datatype.Varinfo.Hashtbl.add tbl v kf; kf let rec can_skip keep_stmts stmt = stmt.labels = [] && match stmt.skind with | Instr (Skip _) -> debug "@[Statement %d: can%s skip@]@." stmt.sid (if Stmt.Set.mem stmt keep_stmts then "'t" else ""); not (Stmt.Set.mem stmt keep_stmts) | Block b -> is_empty_block keep_stmts b | UnspecifiedSequence seq -> is_empty_unspecified_sequence keep_stmts seq | _ -> false and is_empty_block keep_stmts block = List.for_all (can_skip keep_stmts) block.bstmts and is_empty_unspecified_sequence keep_stmts seq = List.for_all ((can_skip keep_stmts) $ (fun (x,_,_,_,_)->x)) seq let rec mk_new_block keep_stmts s blk loc = (* vblock has already cleaned up the statements (removed skip, etc...), * but now the block can still be empty or include only one statement. *) match blk.bstmts with | [] | _ when is_empty_block keep_stmts blk -> (* don't care about local variables since the block is empty. *) mk_new_stmt s (mk_skip loc) | { labels = [] } as s1 :: [] -> (* one statement only, and no label *) begin match s1.skind with | Block b -> (* drop blk, but keep local declarations. *) b.blocals <- b.blocals @ blk.blocals; mk_new_block keep_stmts s b loc | UnspecifiedSequence seq when blk.blocals = [] -> mk_new_unspecified_sequence keep_stmts s seq loc | _ when blk.blocals = [] -> mk_new_stmt s s1.skind | _ -> mk_new_stmt s (Block blk) end | _ -> mk_new_stmt s (Block blk) (* same as above, but for unspecified sequences. *) and mk_new_unspecified_sequence keep_stmts s seq loc = (* vblock has already cleaned up the statements (removed skip, etc...), * but now the block can still be empty or include only one statement. *) match seq with | [] -> mk_new_stmt s (mk_skip loc) | _ when is_empty_unspecified_sequence keep_stmts seq -> mk_new_stmt s (mk_skip loc) | [stmt,_,_,_,_] -> (* one statement only *) begin if stmt.labels <> [] then s.labels <- s.labels @ stmt.labels; match stmt.skind with | UnspecifiedSequence seq -> mk_new_unspecified_sequence keep_stmts s seq loc | Block b -> mk_new_block keep_stmts s b loc | _ -> mk_new_stmt s stmt.skind end | _ -> mk_new_stmt s (UnspecifiedSequence seq) let add_label_if_needed mk_label finfo s = let rec pickLabel = function | [] -> None | Label _ as lab :: _ when Info.label_visible finfo s lab -> Some lab | _ :: rest -> pickLabel rest in match pickLabel s.labels with | Some _ -> None | None -> let label = mk_label (Cil_datatype.Stmt.loc s) in debug "add label to sid:%d : %a" s.sid Printer.pp_label label; s.labels <- label::s.labels; Some label let rm_break_cont ?(cont=true) ?(break=true) mk_label finfo blk = let change loc s = let dest = match s.succs with dest::_ -> dest | [] -> assert false in let new_l = add_label_if_needed mk_label finfo dest in mk_new_stmt s (Goto (ref dest, loc)); debug "changed break/continue into @[%a@]@." Printer.pp_stmt s; new_l in let rec rm_aux cont break s = match s.skind with | Break loc when break && Info.inst_visible finfo s -> let _ = change loc s in () | Continue loc when cont && Info.inst_visible finfo s -> let _ = change loc s in () | Instr _ | Return _ | Break _ | Continue _ | Goto _ | Throw _ -> () | If (_, bthen, belse, _) -> List.iter (rm_aux cont break) bthen.bstmts; List.iter (rm_aux cont break) belse.bstmts; | Block blk -> List.iter (rm_aux cont break) blk.bstmts | UnspecifiedSequence seq -> let blk = Cil.block_from_unspecified_sequence seq in List.iter (rm_aux cont break) blk.bstmts | Loop _ -> (* don't go inside : break and continue change meaning*) () | Switch (_, blk, _, _) -> (* if change [continue] do it, but stop changing [break] *) if cont then let break = false in List.iter (rm_aux cont break) blk.bstmts | TryFinally _ | TryExcept _ | TryCatch _ -> (* TODO ? *) () in List.iter (rm_aux cont break) blk.bstmts (** filter [params] according to [ff] input visibility. * Can be used to slice both the parameters, the call arguments, * and the param types. * Notice that this is just a filtering of the list. * It doesn't do any transformation of any kind on the element, * so at the end they are shared with the original list. * *) let filter_params finfo params = let do_param (n, new_params) var = let new_params = if not (Info.param_visible finfo n) then new_params else new_params @ [var] in (n+1, new_params) in let _, new_params = List.fold_left do_param (1, []) params in new_params let ff_var (fun_vars: t) kf finfo = let fct_var = Kernel_function.get_vi kf in let name = Info.fct_name fct_var finfo in try let ff_var = Hashtbl.find fun_vars name in debug "[ff_var] Use fct var %s:%d@." ff_var.vname ff_var.vid; ff_var with Not_found -> let ff_var = Cil.copyVarinfo fct_var name in if not (Info.result_visible kf finfo) then Cil.setReturnTypeVI ff_var Cil.voidType; (* Notice that we don't have to filter the parameter types here : * they will be update by [Cil.setFormals] later on. *) debug "[ff_var] Mem fct var %s:%d@." ff_var.vname ff_var.vid; Hashtbl.add fun_vars name ff_var; ff_var let optim_if fct keep_stmts s_orig s cond_opt bthen belse loc = let empty_then = is_empty_block keep_stmts bthen in let empty_else = is_empty_block keep_stmts belse in debug "[optim_if] @[sid:%d (orig:%d)@ \ with %s cond, %s empty then, %s empty else@]@." s.sid s_orig.sid (if cond_opt = None then "no" else "") (if empty_then then "" else "not") (if empty_else then "" else "not"); match cond_opt with | Some cond -> if empty_then && empty_else then mk_new_stmt s (mk_skip loc) else (* cond visible and something in blocks : keep if *) mk_new_stmt s (If (cond, bthen, belse, loc)) | None -> (* no cond *) let go_then, go_else = Info.cond_edge_visible fct s_orig in debug "[condition_truth_value] can go in then = %b - can go in else =%b@." go_then go_else; match go_then, empty_then, go_else, empty_else with | _, true, _, true -> (* both blocks empty -> skip *) mk_new_stmt s (mk_skip loc) | true, false, false, true -> (* else empty and always go to then -> block then *) mk_new_block keep_stmts s bthen loc | false, true, true, false -> (* then empty and always go to else -> block else *) mk_new_block keep_stmts s belse loc | false, false, true, _ -> (* always goes in the 'else' branch, * but the then branch is not empty : *) mk_new_stmt s (If (Cil.zero ~loc, bthen, belse, loc)) | true, false, false, false -> (* always goes in the 'then' branch, * but the else branch is not empty : *) mk_new_stmt s (If (Cil.one ~loc, bthen, belse, loc)) | true, true, false, false -> (* always goes in the 'then' empty branch, * but the else branch is not empty : * build (if (0) belse else empty. *) mk_new_stmt s (If (Cil.zero ~loc, belse, bthen, loc)) | true, false, true, false | false, false, false, false -> (* if both go_then and go_else are true: * can go in both branch but don't depend on cond ? * probably unreachable IF with reachable blocks by goto. * if both go_else and go_else are false: * never goes in any branch ? * both branch visible -> dummy condition *) mk_new_stmt s (If (Cil.one ~loc, bthen, belse, loc)) | true, _, true, true | false, _, false, true -> (* can go in both or no branch (see above) : empty else *) mk_new_block keep_stmts s bthen loc | true, true, true, _ | false, true, false, _ -> (* can go in both or no branch (see above) : empty then *) mk_new_block keep_stmts s belse loc let visible_lval vars_visible lval = let visitor = object inherit Visitor.frama_c_inplace method! vvrbl v = if not v.vglob then ignore (Varinfo.Hashtbl.find vars_visible v); SkipChildren end in try ignore (Cil.visitCilLval (visitor :> Cil.cilVisitor) lval); true with Not_found -> false let filter_list is_visible visit l = let build e acc = if is_visible e then (visit e)::acc else acc in List.fold_right build l [] (** This visitor is to be used to filter a function. * It does a deep copy of the source function without the invisible elements. * It also change the function declaration and filter the function calls. * * Many ideas come from [Cil.copyFunctionVisitor] but we were not able to * directly inherit from it since some processing would not have worked in our * context (like the [sid] computation for instance). * *) class filter_visitor pinfo prj = object(self) inherit Visitor.generic_frama_c_visitor (Visitor_behavior.copy prj) val mutable keep_stmts = Stmt.Set.empty val mutable fi = None val fi_table = Varinfo.Hashtbl.create 7 val spec_table = Varinfo.Hashtbl.create 7 val fun_vars: t = Hashtbl.create 7 val local_visible = Varinfo.Hashtbl.create 7 val formals_table = Varinfo.Hashtbl.create 7 val my_kf = Varinfo.Hashtbl.create 7 val lab_num = ref 0; val lab_prefix = "break_cont" method private fresh_label loc = incr lab_num; let lname = Printf.sprintf "%s_%d" lab_prefix !lab_num in Label (lname, loc, false) method private is_our_label label = match label with | Label (lname, _, false) -> let ok = try let prefix = String.sub lname 0 (String.length lab_prefix) in prefix = lab_prefix with Invalid_argument _ -> false in ok | _ -> false method private get_finfo () = Extlib.the fi method private add_stmt_keep stmt = keep_stmts <- Stmt.Set.add stmt keep_stmts (** Applied on each variable use : * must replace references to formal/local variables * and source function calls *) method! vvrbl (v: varinfo) = if v.vglob then try let v' = (Hashtbl.find fun_vars v.vname) in Cil.ChangeTo v' with Not_found -> Cil.SkipChildren else Cil.SkipChildren (*copy has already been done by default visitor*) method! vexpr e = (* We may be creating entirely new expressions through the specialization mechanism. When not performing a basic copy, refresh the ids. *) let do_post e' = if Cil_datatype.ExpStructEq.equal e e' then e' else Cil.new_exp ~loc:e.eloc e'.enode in DoChildrenPost do_post (*method vvdec _ = SkipChildren (* everything is done elsewhere *)*) method private add_formals_bindings v formals = Varinfo.Hashtbl.add formals_table v formals method private get_formals_bindings v = Varinfo.Hashtbl.find formals_table v method private filter_formals formals = let formals = filter_params (self#get_finfo ()) formals in List.map (fun v -> Varinfo.Hashtbl.add local_visible v (); let v' = Cil.copyVarinfo v v.vname in Visitor_behavior.Set.varinfo self#behavior v v'; Visitor_behavior.Set_orig.varinfo self#behavior v' v; (match v.vlogic_var_assoc, v'.vlogic_var_assoc with None, None -> () | Some lv, Some lv' -> Visitor_behavior.Set.logic_var self#behavior lv lv'; Visitor_behavior.Set_orig.logic_var self#behavior lv' lv | _ -> assert false (* copy should be faithful *)); v') formals method private filter_locals locals = let rec filter locals = match locals with | [] -> [] | var :: locals -> let visible = Info.loc_var_visible (self#get_finfo ()) var in debug "[local] %s -> %s@." var.vname (if visible then "keep" else "remove"); if visible then begin Varinfo.Hashtbl.add local_visible var (); let var' = Cil.copyVarinfo var var.vname in Visitor_behavior.Set.varinfo self#behavior var var'; Visitor_behavior.Set_orig.varinfo self#behavior var' var; (match var.vlogic_var_assoc, var'.vlogic_var_assoc with None, None -> () | Some lv, Some lv' -> Visitor_behavior.Set.logic_var self#behavior lv lv'; Visitor_behavior.Set_orig.logic_var self#behavior lv' lv | _ -> assert false (* copy should be faithful *)); var' :: (filter locals) end else filter locals in let new_locals = filter locals in new_locals method! vcode_annot v = Extlib.may Cil.CurrentLoc.set (Cil_datatype.Code_annotation.loc v); let stmt = Visitor_behavior.Get_orig.stmt self#behavior (Extlib.the self#current_stmt) in debug "[annotation] stmt %d : %a @." stmt.sid Printer.pp_code_annotation v; if Info.annotation_visible (self#get_finfo ()) stmt v then begin self#add_stmt_keep stmt; ChangeDoChildrenPost (v,Logic_const.refresh_code_annotation) end else begin debug "\t-> ignoring annotation: %a@." Printer.pp_code_annotation v; ChangeTo (Logic_const.new_code_annotation (AAssert ([], Assert, { pred_name = []; pred_loc = Cil_datatype.Location.unknown; pred_content = Ptrue}))) end method private process_call is_init_call call_stmt lval _f args loc = let finfo = self#get_finfo () in let info = (pinfo, finfo) in let called_info = Info.called_info info call_stmt in match called_info with | None -> call_stmt.skind | Some (called_kf, called_finfo) -> let var_slice = ff_var fun_vars called_kf called_finfo in let new_funcexp = new_exp ~loc (Lval (Var var_slice, NoOffset)) in let new_args = filter_params called_finfo args in let need_lval = Info.res_call_visible finfo call_stmt in let new_lval = if need_lval then lval else None in let new_call = if is_init_call then begin match lval with | None -> (* initializer takes address of variable *) if Info.param_visible called_finfo 1 then begin match new_args with | { enode = AddrOf (Var v, NoOffset) } :: args -> Local_init(v, ConsInit(var_slice,args,Constructor), loc) | _ -> assert false (* We have kept the first argument. *) end else begin (* variable is useless. *) Call(None, new_funcexp, new_args, loc) end | Some _ -> (match new_lval with | None -> Call (None, new_funcexp, new_args, loc) | Some (Var v, NoOffset) -> Local_init(v, ConsInit(var_slice, new_args, Plain_func), loc) | Some _ -> assert false (* destination must be a variable *)) end else Call (new_lval, new_funcexp, new_args, loc) in debug "[process_call] call %s@." var_slice.vname; Instr (new_call) method! vblock (b: block) = let optim b' = (* This optim must be performed after the sliced annotations have been put in the new table. Hence, we must put the action into the queue. *) Queue.add (fun () -> b'.bstmts <- List.filter (fun st -> not (Cil.is_skip st.skind) || st.labels <> [] || Annotations.has_code_annot st (*|| ((*Format.eprintf "Skipping %d@.@." st.sid;*) false)*) ) b'.bstmts) self#get_filling_actions; b' in (* b.blocals still contains original varinfos at this stage. The remaining ones will be copied later in the visit. *) b.blocals <- List.filter (Info.loc_var_visible (self#get_finfo ())) b.blocals; Cil.ChangeDoChildrenPost (b, optim) method private change_sid s = let orig = Visitor_behavior.Get_orig.stmt self#behavior s in assert (Visitor_behavior.Get.stmt self#behavior orig == s); let old = s.sid in let keep = Stmt.Set.mem s keep_stmts in keep_stmts <- Stmt.Set.remove s keep_stmts; s.sid <- Cil_const.Sid.next (); Visitor_behavior.Set.stmt self#behavior orig s; Visitor_behavior.Set_orig.stmt self#behavior s orig; if keep then self#add_stmt_keep s; debug "@[finalize sid:%d->sid:%d@]@\n@." old s.sid method private process_invisible_stmt s = let finfo = self#get_finfo () in debug "[process_invisible_stmt] does sid:%d@." s.sid; (* invisible statement : but still have to visit the children if any *) let oldskind = s.skind in let do_after s = self#change_sid s; s.skind <- oldskind; (match s.skind with | If (_,bthen,belse,loc) -> let bthen = Cil.visitCilBlock (self:>Cil.cilVisitor) bthen in let belse = Cil.visitCilBlock (self:>Cil.cilVisitor) belse in let s_orig = Visitor_behavior.Get_orig.stmt self#behavior s in optim_if finfo keep_stmts s_orig s None bthen belse loc | Switch (_exp, body, _, loc) -> (* the switch is invisible : it can be translated into a block. *) rm_break_cont ~cont:false (self#fresh_label) finfo body; let block = Cil.visitCilBlock (self:>Cil.cilVisitor) body in (mk_new_block keep_stmts s block loc) | Loop (_, body, loc, _lcont, _lbreak) -> rm_break_cont (self#fresh_label) finfo body; let bloop = Cil.visitCilBlock (self:>Cil.cilVisitor) body in mk_new_block keep_stmts s bloop loc | Block _ | UnspecifiedSequence _ -> assert false (* a block is always visible *) | TryFinally _ | TryExcept _ -> assert false (*TODO*) | Return (_,l) -> mk_new_stmt s (Return (None,l)) | Instr (Local_init (v, _, _)) -> (* The initialization of the variable is useless (e.g. because it is overwritten before being read). Just treat it as uninitialized. Note that if the variable itself is invisible, we don't have anything to do: it will not appear at all in the function. *) if Info.loc_var_visible (self#get_finfo()) v then begin let v' = Visitor_behavior.Get.varinfo self#behavior v in v'.vdefined <- false; end; mk_new_stmt s (mk_stmt_skip s) | _ -> mk_new_stmt s (mk_stmt_skip s)); debug "@[[process_invisible_stmt] gives sid:%d@ @[%a@]@]@." s.sid Printer.pp_stmt s; s in s.skind <- mk_stmt_skip s; ChangeDoChildrenPost(s, do_after) (* We always keep global variables. However there are two cases where we must remove the local static attr indicating that they in fact come from a block: - if the block in which they are in scope disappears completely, or if the enclosing function itself disappears (making the variable a good candidate to be removed altogether) - or if we make multiple copies of the enclosing functions (otherwise, we would have multiple syntactic scope for the same variable). *) method private remove_local_static_attr v = let new_v = Visitor_behavior.Get.varinfo self#behavior v in new_v.vattr <- Cil.dropAttribute Cabs2cil.fc_local_static new_v.vattr method private process_visible_stmt s = debug "[process_visible_stmt] does sid:%d@." s.sid; let finfo = self#get_finfo () in (match s.skind with | Instr (Call (lval, f, args, loc)) -> let new_call = self#process_call false s lval f args loc in mk_new_stmt s new_call | Instr (Local_init(v, ConsInit(f, args, kind), loc)) -> let new_call = Cil.treat_constructor_as_func (self#process_call true s) v f args kind loc in (match new_call with | Instr(Call _) -> (* initialization's result was found to be useless. *) v.vdefined <- false | _ -> ()); mk_new_stmt s new_call | _ -> () (* copy the statement before modifying it *) (* mk_new_stmt s [] s.skind *) ); let do_after s' = self#change_sid s'; (match s'.skind with | If (cond,bthen,belse,loc) -> let s_orig = Visitor_behavior.Get_orig.stmt self#behavior s' in optim_if finfo keep_stmts s_orig s' (Some cond) bthen belse loc | Switch (e,b,c,l) -> let c' = List.filter (not $ (can_skip keep_stmts)) c in s'.skind <- Switch(e,b,c',l) | Block b -> let loc = Stmt.loc s' in (* must be performed after the optimisation of the block itself (see comment in vblock) *) Queue.add (fun () -> if b.bstmts = [] && b.battrs = [] then begin List.iter self#remove_local_static_attr b.bstatics; s'.skind <- (Instr (Skip loc)) end) self#get_filling_actions | UnspecifiedSequence _ -> let loc = Stmt.loc s' in let visible_stmt = let info = self#get_finfo () in (fun s -> Info.inst_visible info !s) in Queue.add (fun () -> match s'.skind with | UnspecifiedSequence l -> let res = List.filter (fun (s,_,_,_,_) -> not (is_skip s.skind)) l in let res = List.map (fun (s,m,w,r,c) -> (s, List.filter (visible_lval local_visible) m, List.filter (visible_lval local_visible) w, List.filter (visible_lval local_visible) r, List.filter visible_stmt c ) ) res in (match res with [] -> s'.skind <- (Instr (Skip loc)) | _ -> s'.skind <- UnspecifiedSequence res) | _ -> ()) self#get_filling_actions | _ -> ()); debug "@[[process_visible_stmt] gives sid:%d@ @[%a@]@]@." s'.sid Printer.pp_stmt s'; s' in Cil.ChangeDoChildrenPost (s, do_after) method! vstmt_aux s = let finfo = self#get_finfo () in let rec filter_labels labels = match labels with | [] -> [] | l :: labs -> let keep = Info.label_visible finfo s l || self#is_our_label l in debug "[filter_labels] %svisible %a@." (if keep then "" else "in") Printer.pp_label l; if keep then l::(filter_labels labs) else filter_labels labs in let labels = filter_labels s.labels in s.labels <- labels; match s.skind with | Block _ | UnspecifiedSequence _ -> self#process_visible_stmt s | _ when Info.inst_visible finfo s -> self#process_visible_stmt s | _ -> self#process_invisible_stmt s method! vfunc f = debug "@[[vfunc] -> %s@\n@]@." f.svar.vname; fi <- Some (Varinfo.Hashtbl.find fi_table f.svar); (* parameters *) let new_formals = try self#get_formals_bindings f.svar (* if there was a declaration, use the already computed formals list *) with Not_found -> self#filter_formals f.sformals in (* local declarations *) let new_locals = self#filter_locals f.slocals in let new_body = Cil.visitCilBlock (self:>Cil.cilVisitor) f.sbody in f.slocals <- new_locals; f.sbody <- new_body; Queue.add (fun () -> Cil.setFormals f new_formals) self#get_filling_actions; (* clean up the environment if we have more than one copy of the function in the sliced code. *) Visitor_behavior.Reset.stmt self#behavior; keep_stmts <- Stmt.Set.empty; Varinfo.Hashtbl.clear local_visible; Varinfo.Hashtbl.add spec_table f.svar (visitCilFunspec (self:>Cil.cilVisitor) (Annotations.funspec ~populate:false (Extlib.the self#current_kf))); SkipChildren method private visit_pred p = Logic_const.new_predicate (visitCilPredicate (self:>Cil.cilVisitor) p.ip_content) method private visit_identified_term t = let t' = visitCilTerm (self:>Cil.cilVisitor) t.it_content in Logic_const.new_identified_term t' method! vfrom (b,f) = let finfo = self#get_finfo () in let from_visible t = Info.fun_deps_visible finfo t in let b = self#visit_identified_term b in let res = match f with FromAny -> b,FromAny | From l -> b, From (filter_list from_visible self#visit_identified_term l) in ChangeTo res method! vbehavior b = let finfo = self#get_finfo () in let pre_visible p = Info.fun_precond_visible finfo p.ip_content in b.b_assumes <- filter_list pre_visible self#visit_pred b.b_assumes; b.b_requires <- filter_list pre_visible self#visit_pred b.b_requires; let ensure_visible (_,p) = Info.fun_postcond_visible finfo p.ip_content in b.b_post_cond <- filter_list ensure_visible (fun (k,p) -> k,self#visit_pred p) b.b_post_cond; let allocates_visible a = Info.fun_allocates_visible finfo a in let frees_visible a = Info.fun_frees_visible finfo a in (match b.b_allocation with FreeAllocAny -> () | FreeAlloc(f,a) -> try let frees = filter_list frees_visible self#visit_identified_term f in let allocates = filter_list allocates_visible self#visit_identified_term a in b.b_allocation <- FreeAlloc (frees, allocates) with Info.EraseAllocation -> b.b_allocation <- FreeAllocAny ); let from_visible a = Info.fun_assign_visible finfo a in let from_visit a = visitCilFrom (self:>Cil.cilVisitor) a in (match b.b_assigns with WritesAny -> () | Writes l -> try let assigns = filter_list from_visible from_visit l in b.b_assigns <- Writes assigns with Info.EraseAssigns -> b.b_assigns <- WritesAny ); SkipChildren (* see the warning on [SkipChildren] in [vspec] ! *) method! vspec spec = debug "@[[vspec] for %a @\n@]@." Kernel_function.pretty (Extlib.the self#current_kf); let finfo = self#get_finfo () in let b = Cil.visitCilBehaviors (self:>Cil.cilVisitor) spec.spec_behavior in let b = List.filter (not $ Cil.is_empty_behavior) b in spec.spec_behavior <- b; let new_variant = match spec.spec_variant with | None -> None | Some (t,n) -> if Info.fun_variant_visible finfo t then Some (visitCilTerm (self:>Cil.cilVisitor) t, n) else None in spec.spec_variant <- new_variant ; let new_term = match spec.spec_terminates with | None -> None | Some p -> if Info.fun_precond_visible finfo p.ip_content then Some (self#visit_pred p) else None in spec.spec_terminates <- new_term ; spec.spec_complete_behaviors <- [] (* TODO ! *) ; spec.spec_disjoint_behaviors <- [] (* TODO ! *) ; SkipChildren (* Be very careful that we can use [SkipChildren] here only if everything that is in the new spec has been visited above. we need to put links to the appropriate copies of variables (both pure C and logical ones) *) method private build_proto finfo loc = let kf = Extlib.the self#current_kf in fi <- Some finfo; let new_var = ff_var fun_vars kf finfo in (* we're building a prototype. *) if not (Varinfo.Hashtbl.mem fi_table new_var) then begin new_var.vdefined <- false; let new_kf = make_new_kf my_kf kf new_var in Varinfo.Hashtbl.add fi_table new_var finfo; debug "@[[build_cil_proto] -> %s@\n@]@." new_var.vname; let action = let (rt,args,va,attrs) = Cil.splitFunctionType new_var.vtype in (match args with | None -> () | Some args -> let old_formals = Kernel_function.get_formals kf in let old_formals = filter_params finfo old_formals in let args = filter_params finfo args in let mytype = TFun(rt,Some args,va,attrs) in let new_formals = List.map makeFormalsVarDecl args in self#add_formals_bindings new_var new_formals; new_var.vtype <- mytype; List.iter2 (fun x y -> Visitor_behavior.Set.varinfo self#behavior x y; Visitor_behavior.Set_orig.varinfo self#behavior y x; match x.vlogic_var_assoc with None -> (); | Some lv -> let lv' = Cil.cvar_to_lvar y in Visitor_behavior.Set.logic_var self#behavior lv lv'; Visitor_behavior.Set_orig.logic_var self#behavior lv' lv) old_formals new_formals; (* adds the new parameters to the formals decl table *) Queue.add (fun () -> Cil.unsafeSetFormalsDecl new_var new_formals) self#get_filling_actions); let res = Cil.visitCilFunspec (self :> Cil.cilVisitor) (Annotations.funspec ~populate:false kf) in let action () = (* Replace the funspec copied by the default visitor, as varinfo of formals would not be taken into account correctly otherwise: everything would be mapped to the last set of formals... *) Queue.add (fun () -> new_kf.spec <- res; Annotations.register_funspec ~force:true new_kf) self#get_filling_actions in action in let orig_var = Ast_info.Function.get_vi kf.fundec in (* The first copy is also the default one for varinfo that are not handled by ff_var but directly by the visitor *) if (Visitor_behavior.Get.varinfo self#behavior orig_var) == orig_var then Visitor_behavior.Set.varinfo self#behavior orig_var new_var; (* Set the new_var as an already known one, coming from the vi associated to the current kf. *) Visitor_behavior.Set.varinfo self#behavior new_var new_var; Visitor_behavior.Set_orig.varinfo self#behavior new_var orig_var; Visitor_behavior.Set.kernel_function self#behavior kf new_kf; Visitor_behavior.Set_orig.kernel_function self#behavior new_kf kf; Queue.add (fun () -> Globals.Functions.register new_kf) self#get_filling_actions; GFunDecl (Cil.empty_funspec(), new_var, loc), action end else begin let old_finfo = Varinfo.Hashtbl.find fi_table new_var in if not (finfo = old_finfo) then Kernel.fatal "Found two distinct slices of function %a with the same name %s" Kernel_function.pretty kf new_var.vname; (* already processed: no need for more *) GFunDecl(Cil.empty_funspec(),new_var,loc), fun () -> () end method private compute_fct_prototypes (_fct_var,loc) = let finfo_list = Info.fct_info pinfo (Extlib.the self#current_kf) in debug "@[[compute_fct_prototypes] for %a (x%d)@\n@]@." Kernel_function.pretty (Extlib.the self#current_kf) (List.length finfo_list); let build_cil_proto finfo = self#build_proto finfo loc in List.map build_cil_proto finfo_list method private compute_fct_definitions f loc = let fvar = f.Cil_types.svar in let kf = Extlib.the self#current_kf in let finfo_list = Info.fct_info pinfo kf in debug "@[[compute_fct_definitions] for %a (x%d)@\n@]@." Kernel_function.pretty kf (List.length finfo_list); let do_f finfo = if not (Info.body_visible finfo) then self#build_proto finfo loc else begin let new_fct_var = ff_var fun_vars kf finfo in new_fct_var.vdefined <- true; let new_kf = make_new_kf my_kf kf new_fct_var in (* Set the new_var as an already known one, * coming from the vi associated to the current kf. *) Visitor_behavior.Set.varinfo self#behavior new_fct_var new_fct_var; Visitor_behavior.Set_orig.varinfo self#behavior new_fct_var fvar; Visitor_behavior.Set.kernel_function self#behavior kf new_kf; Visitor_behavior.Set_orig.kernel_function self#behavior new_kf kf; Queue.add (fun () -> Globals.Functions.register new_kf) self#get_filling_actions; Varinfo.Hashtbl.add fi_table new_fct_var finfo; debug "@[[build_cil_fct] -> %s@\n@]@." (Info.fct_name (Kernel_function.get_vi (Extlib.the self#current_kf)) finfo); let action () = Queue.add (fun () -> new_kf.spec <- Varinfo.Hashtbl.find spec_table new_fct_var; Annotations.register_funspec ~force:true new_kf) self#get_filling_actions in let f = Kernel_function.get_definition new_kf in (* [JS 2009/03/23] do not call self#vfunc in the assertion; otherwise does not work whenever frama-c is compiled with -no-assert *) let res = self#vfunc f in assert (res = SkipChildren); (* if this ever changes, we must do some work. *) GFun (f,loc), action end in (match List.filter Info.body_visible finfo_list with | [ _ ] -> () | [] | _ :: _ :: _ -> let vars = static_from_kf kf in List.iter self#remove_local_static_attr vars); List.map do_f finfo_list method! vglob_aux g = let post action g = List.iter (fun x -> x()) action; fi <- None; debug "[post action] done.@."; g in match g with | GFun (f, loc) -> let (new_functions,actions) = List.split (self#compute_fct_definitions f loc) in Cil.ChangeToPost (new_functions, post actions) | GFunDecl (_, v, loc) -> debug "[vglob_aux] GFunDecl %s (TFun)@." v.vname; let var_decl = (v, loc) in let (new_decls,actions) = List.split (self#compute_fct_prototypes var_decl) in Cil.ChangeToPost (new_decls, post actions) | _ -> Cil.DoChildren end let build_cil_file ?last new_proj_name pinfo = debug "[build_cil_file] in %s@." new_proj_name; let visitor = new filter_visitor pinfo in let prj = FC_file.create_project_from_visitor ?last new_proj_name visitor in debug "[build_cil_file] done.@."; prj end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_transformations/filter.mli0000666000000000000000000001413213571573400023256 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** [Filter] helps to build a new [cilfile] from an old one by removing some of * its elements. One can even build several functions from a source function * by specifying different names for each of them. * *) (** Signature of a module that decides which element of a function * have to be visible or not *) module type RemoveInfo = sig (** exception that fun_assign_visible should raise to indicate that the corresponding assigns clause should be erased entirely *) exception EraseAssigns (** exception that fun_frees_visible or fun_allocates_visible should raise to indicate that the corresponding allocation clause should be erased entirely *) exception EraseAllocation (** some type for the whole project information *) type proj (** some type for a function information *) type fct (** This function will be called for each function of the source program. * A new function will be created for each element of the returned list. *) val fct_info : proj -> kernel_function -> fct list (** useful when we want to have several functions in the result for one * source function. If it is not the case, you can return [varinfo.vname]. * It is the responsibility of the user to given different names to different * function. *) val fct_name : varinfo -> fct -> string (** tells if the n-th formal parameter is visible. *) val param_visible : fct -> int -> bool (** tells if the body of a function definition is visible. * True is most cases, but can be defined to be false when we want to export * only the declaration of a function instead of its definition *) val body_visible : fct -> bool (** tells if the local variable is visible. *) val loc_var_visible : fct -> varinfo -> bool (** tells if the statement is visible. *) val inst_visible : fct -> stmt -> bool (** tells if the label is visible. *) val label_visible : fct -> stmt -> label -> bool (** tells if the annotation, attached to the given statement is visible. *) val annotation_visible: fct -> stmt -> code_annotation -> bool val fun_precond_visible : fct -> predicate -> bool val fun_postcond_visible : fct -> predicate -> bool val fun_variant_visible : fct -> term -> bool val fun_frees_visible : fct -> identified_term -> bool val fun_allocates_visible : fct -> identified_term -> bool val fun_assign_visible : fct -> from -> bool (** true if the assigned value (first component of the from) is visible @raise EraseAssigns to indicate that the corresponding assigns clause should be erased entirely (i.e. assigns everything. If it were to just return false to all elements, this would result in assigns \nothing *) val fun_deps_visible : fct -> identified_term -> bool (** true if the corresponding functional dependency is visible. *) (** [called_info] will be called only if the call statement is visible. * If it returns [None], the source call will be visible, * else it will use the returned [fct] to know if the return value and the * arguments are visible. * The input [fct] parameter is the one of the caller function. * *) val called_info : proj * fct -> stmt -> (kernel_function * fct) option (** tells if the lvalue of the call has to be visible *) val res_call_visible : fct -> stmt -> bool (** tells if the function returns something or if the result is [void]. * Notice that if this function returns [true] the function will have the same * return type than the original function. So, if it was already [void], it * makes no difference if this function returns true or false. * * - For a defined function, this should give the same result than * [inst_visible fct_info (Kernel_function.find_return kf)]. * - [res_call_visible] must return [false] * if [result_visible] returns false on the called function. *) val result_visible : kernel_function -> fct -> bool (** [cond_edge_visible f s] implies that [s] is an 'if' in [f]. The first returned boolean indicates that the 'then' edge is useful, the second one the 'else' is. Setting one or both to true will lead to the simplification in the 'if'. *) val cond_edge_visible: fct -> stmt -> bool * bool end (** Given a module that match the module type described above, * [F.build_cil_file] initializes a new project containing the slices *) module F (Info : RemoveInfo) : sig val build_cil_file : ?last:bool -> string -> Info.proj -> Project.t end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/ast_transformations/inline.ml0000666000000000000000000005554213571573400023110 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Kernel_file = File let dkey = Kernel.register_category "inline" let wkey = Kernel.register_warn_category "inline" let () = Parameter_customize.set_group Kernel.normalisation module InlineCalls = Kernel.Kernel_function_set(struct let option_name = "-inline-calls" let module_name = "InlineCalls" let arg_name = "f1, ..., fn" let help = "inline calls to functions f1, ..., fn" end) let () = Parameter_customize.set_group Kernel.normalisation module RemoveInlined = Kernel.Kernel_function_set(struct let option_name = "-remove-inlined" let module_name = "RemoveInlined" let arg_name = "f1, ..., fn" let help = "remove inlined functions f1, ..., fn, which must have been \ given to " ^ InlineCalls.option_name ^ ". Warning: this does not check if the given functions were \ fully inlined." end) let inline_parameter_category = object method fold: 'a. (kernel_function -> 'a -> 'a) -> 'a -> 'a = fun f acc -> Globals.Functions.fold (fun kf acc -> let vi = Kernel_function.get_vi kf in match kf.fundec with | Definition _ -> if vi.vinline then f kf acc else acc | Declaration _ -> acc) acc method mem kf = Kernel_function.is_definition kf && (Kernel_function.get_vi kf).vinline end let _ = InlineCalls.Category.add "inline" [Globals.Functions.self] inline_parameter_category let _ = RemoveInlined.Category.add "inline" [Globals.Functions.self] inline_parameter_category let inline_call loc caller callee return args = let caller_fd = Kernel_function.get_definition caller in let caller_labels = ref (Kernel_function.find_all_labels caller) in let fresh_label lab = let (_,lab) = Extlib.make_unique_name (fun x -> Datatype.String.Set.mem x !caller_labels) ~sep:"_" ~start:0 lab in caller_labels:= Datatype.String.Set.add lab !caller_labels; lab in let o = object(self) inherit Visitor.frama_c_refresh (Project.current ()) method! vvdec _ = Cil.DoChildrenPost (fun vi -> Cil.refresh_local_name caller_fd vi; vi) method! vvrbl v = if v.vglob then Cil.ChangeTo (Visitor_behavior.Get_orig.varinfo self#behavior v) else Cil.DoChildren method! vterm_lval (host,offset) = match host, return with | TResult _, Some lv -> let tlv = Logic_utils.lval_to_term_lval ~cast:false lv in let offset = Visitor.visitFramacTermOffset self offset in Cil.ChangeToPost (Logic_const.addTermOffsetLval offset tlv, Extlib.id) | TResult _, None -> Kernel.fatal "inlining non-void returning function without lval to store result" | _ -> Cil.DoChildren method! vfunc _ = self#set_current_kf caller; Cil.DoChildrenPost (fun fd -> caller_fd.slocals <- caller_fd.slocals @ fd.sformals @ fd.slocals; let add_init vi arg = vi.vdefined <- true; Cil.mkStmtOneInstr ~valid_sid:true (Local_init (vi,AssignInit (SingleInit arg),loc)) in let inits = List.map2 add_init fd.sformals args in let spec = Annotations.funspec ~populate:false callee in if Cil.is_empty_funspec spec then begin fd.sbody.blocals <- fd.sformals @ fd.sbody.blocals; fd.sbody.bstmts <- inits @ fd.sbody.bstmts; end else begin (* put a statement contract on top of the function's body, but only after we have assigned the formals. Not that there is no need to rename behaviors: they will only shadow behaviors of the caller within callee's body, just as we need. *) let body = Cil.mkStmt ~valid_sid:true (Block fd.sbody) in let spec' = Visitor.visitFramacFunspec self spec in let ca = Logic_const.new_code_annotation (AStmtSpec([],spec')) in Annotations.add_code_annot Emitter.kernel ~kf:caller body ca; let new_body = Cil.mkBlock (inits @ [ body ]) in new_body.blocals <- fd.sformals; fd.sbody <- new_body end; fd) method !vstmt_aux _ = Cil.DoChildrenPost (fun stmt -> stmt.labels <- List.map (function | Label (s,l,f) -> Label (fresh_label s,l,f) | (Case _ | Default _) as lab -> lab) stmt.labels; (* Replace return by an assignment; or remove it if useless *) (match stmt.skind with | Return(exp, loc) -> let skind = match return, exp with | None, None -> Instr (Skip loc) | None, Some exp -> (* Keep the expression in case it could lead to an alarm *) (Cil.mkPureExpr ~valid_sid:true ~fundec:caller_fd exp).skind | Some ret, Some exp -> Instr (Set(ret, exp, loc)) | Some _, None -> Kernel.fatal "trying to assign the result of a void returning function" in stmt.skind <- skind | _ -> ()); stmt) (* local statics are still owned by the original function, not the inlined version. *) method! vblock b = b.bstatics <- []; Cil.DoChildren end in let callee_fd = Visitor.visitFramacFunction o (Kernel_function.get_definition callee) in callee_fd.sbody let is_variadic_function vi = match vi.vtype with | TFun(_, _, is_v, _) -> is_v | _ -> false let inliner functions_to_inline = object (self) inherit Visitor.frama_c_inplace val call_stack = Stack.create () val mutable already_visited = Cil_datatype.Kf.Set.empty val mutable block_stack = Stack.create () val mutable inlined_calls = Cil_datatype.Stmt.Set.empty method private add_inlined_call s = inlined_calls <- Cil_datatype.Stmt.Set.add s inlined_calls method private recursive_call_limit kf = let nb_calls = Stack.fold (fun res kf' -> if Cil_datatype.Kf.equal kf kf' then res + 1 else res) 0 call_stack in nb_calls >= 1 (* TODO: be more flexible. *) method! vblock b = Stack.push b block_stack; Cil.DoChildrenPost (fun b -> ignore (Stack.pop block_stack); b) (* inline the given [stmt], which must be a call, in the given [caller] *) method private inline stmt init_kind return f args = let callee = try Globals.Functions.get f with Not_found -> Kernel.fatal ~current:true "Expecting a function, got %a" Printer.pp_varinfo f in if Kernel_function.Set.mem callee functions_to_inline && not (self#recursive_call_limit callee) then begin if is_variadic_function f then begin Kernel.warning ~wkey ~current:true ~once:true "Ignoring inlining option for variadic function %a" Printer.pp_varinfo f; Cil.DoChildren end else begin Stack.push callee call_stack; let loc = Cil_datatype.Stmt.loc stmt in let needs_assign, return_aux, args = match init_kind, return with | None, Some _ -> false, return, args | None, None -> let rt, _, _,_ = Cil.splitFunctionTypeVI f in if Cil.isVoidType rt then false,return, args else begin let scope = Stack.top block_stack in let v = Cil.makeLocalVar (Extlib.the self#current_func) ~scope ~temp:true "__inline_tmp" rt in true, Some (Cil.var v), args end | Some Plain_func, Some lv -> let t = Cil.typeOfLval lv in let scope = Stack.top block_stack in let v = Cil.makeLocalVar (Extlib.the self#current_func) ~scope ~temp:true "__inline_tmp" t in true, Some (Cil.var v), args | Some Constructor, Some (Var r, NoOffset) -> (* Inlining will prevent r to be syntactically seen as initialized or const: *) r.vdefined <- false; r.vtype <- Cil.typeRemoveAttributes ["const"] r.vtype; false, None, (Cil.mkAddrOf loc (Cil.var r)) :: args | Some _, _ -> Kernel.fatal "Attempt to initialize an inexistent varinfo" in let block = inline_call (Cil_datatype.Stmt.loc stmt) (Extlib.the self#current_kf) callee return_aux args in let skind = if needs_assign then begin match return_aux, return with | Some (Var aux, NoOffset), Some (Var r, NoOffset) -> let b = Cil.mkBlockNonScoping [ Cil.mkStmt ~valid_sid:true (Block block); Cil.mkStmtOneInstr ~valid_sid:true (Local_init (r, AssignInit (SingleInit (Cil.evar ~loc aux)),loc))] in Block b | Some (Var _, NoOffset), None -> (* the auxiliary variable is just here for translating \result in case we have a function contract. However, the result of the inlined function itself is ignored by the caller. *) Block block | _ -> Kernel.fatal "Unexpected lval while translating \ return instruction of inlined function " end else Block block in stmt.skind <- skind; self#add_inlined_call stmt; let do_after stmt = ignore (Stack.pop call_stack); stmt in (* Do not visit the body if the inlining has already been done in the current kf. Otherwise, each subsequent call to a recursive inlined function would be inlined once again. *) if Cil_datatype.Kf.Set.mem callee already_visited then Cil.ChangeToPost (stmt, do_after) else Cil.DoChildrenPost do_after end end else Cil.DoChildren method !vstmt_aux stmt = match stmt.skind with | UnspecifiedSequence _ -> Cil.DoChildrenPost (fun s -> s.skind <- (match s.skind with | UnspecifiedSequence l -> (* TODO: also adds writes/reads from inlined calls. Probably requires a complete refactoring of unspecified sequences though. *) UnspecifiedSequence (List.map (fun (s,w,r,t,stmts) -> (s,w,r,t, List.filter (fun x -> not (Cil_datatype.Stmt.Set.mem !x inlined_calls)) stmts)) l) | k -> k); s) | Instr(Call(return, f, args, _)) -> (match f.enode with | Lval (Var vi, NoOffset) -> self#inline stmt None return vi args | _ -> Kernel.warning ~wkey ~current:true ~once:true "Ignoring call via function pointer"; Cil.DoChildren) | Instr(Local_init(v, ConsInit (f, args, kind), _)) -> self#inline stmt (Some kind) (Some (Cil.var v)) f args | _ -> Cil.DoChildren method! vfunc _ = Cil.DoChildrenPost (fun f -> let kf = Globals.Functions.get f.svar in already_visited <- Cil_datatype.Kf.Set.add kf functions_to_inline; f) end let remove_local_statics = object inherit Visitor.frama_c_inplace method! vblock b = b.bstatics <- List.filter (fun v -> not (Cil.hasAttribute Cabs2cil.fc_local_static v.vattr)) b.bstatics; Cil.DoChildren method! vvrbl v = v.vattr <- Cil.dropAttribute Cabs2cil.fc_local_static v.vattr; Cil.DoChildren end let remove_inlined_visitor fds_to_remove = object inherit Visitor.frama_c_inplace method! vglob_aux = function | GFun(fd, _) -> if Cil_datatype.Fundec.Set.mem fd fds_to_remove then begin List.iter (fun stmt -> Annotations.iter_code_annot (fun e annot -> Annotations.remove_code_annot e stmt annot) stmt ) fd.sallstmts; Globals.Functions.remove fd.svar; let kf = Globals.Functions.get fd.svar in List.iter (fun vi -> Globals.Vars.remove vi ) (Kernel_function.get_statics kf); Cil.ChangeTo [] end else Cil.SkipChildren | _ -> Cil.SkipChildren end let inline_calls ast = if not (InlineCalls.is_empty ()) then begin let functions = InlineCalls.get() in Visitor.visitFramacFileSameGlobals (inliner functions) ast; Cil_datatype.Kf.Set.iter (fun kf -> ignore (Visitor.visitFramacKf remove_local_statics kf)) functions; let fds_to_remove = Cil_datatype.Kf.Set.fold (fun kf acc -> if not (Cil_datatype.Kf.Set.mem kf functions) then begin Kernel.warning ~wkey:Kernel.wkey_cmdline "%s: function %a not given to %s, will not remove it" RemoveInlined.option_name Kernel_function.pretty kf InlineCalls.option_name; acc end else Cil_datatype.Fundec.Set.add (Kernel_function.get_definition kf) acc) (RemoveInlined.get ()) Cil_datatype.Fundec.Set.empty in File.reorder_custom_ast ast; Ast.mark_as_changed (); Cfg.clearFileCFG ~clear_id:false ast; Cfg.computeFileCFG ast; Visitor.visitFramacFile (remove_inlined_visitor fds_to_remove) ast; Ast.mark_as_changed (); Cfg.clearFileCFG ~clear_id:false ast; Cfg.computeFileCFG ast; Kernel.feedback ~dkey "inlining done" end let inline_transform = Kernel_file.register_code_transformation_category "inlining" let () = Kernel_file.add_code_transformation_after_cleanup ~deps:[(module InlineCalls.As_string:Parameter_sig.S)] inline_transform inline_calls (* -------------------------------------------------------------------------- *) (* Inlining of predicates and logic functions *) (* -------------------------------------------------------------------------- *) open Cil_datatype exception CannotInline type inline_env = { (** Returns true for predicate and logic functions to be inlined. Other predicates and functions are left unchanged. *) inline: logic_info -> bool; (** logic argument of the predicate -> term that replaces it, plus the label at which it must be evaluated. *) map_param: (term * logic_label) Logic_var.Map.t; (** logic label of the predicate -> label at call site *) map_label: logic_label Logic_label.Map.t; (** predicates and functions already inlined once, to prevent loops on recursive definitions *) already_seen: Logic_info.Set.t; (** current default label, Here at the beginning *) curr_label: logic_label; } (* Specification of the following inliner: the resulting term/predicate contains only Papp or Tapp nodes for which [env.inline] does not hold. Hence, an evaluation engine that understands these functions and predicates can fully evaluate the inlined predicate/term. To implement this specification, we fail eagerly when encountering a recursive definition, or a fully unknown predicate/function without a body.*) (** Visitors for inlining defined predicates and logical function *) class logic_inliner env = object (self) inherit Visitor.frama_c_copy(Project.current()) method! vlogic_label label = match Logic_label.Map.find label env.map_label with | exception Not_found -> Cil.JustCopy | x -> Cil.ChangeTo x method private inline_label l = try Logic_label.Map.find l env.map_label with Not_found -> l method private inline_labels labels = List.map self#inline_label labels method private inline_args args = let one t = Visitor.visitFramacTerm (self :> Visitor.frama_c_copy) t in List.map one args (* Builds the environnement to enter into the body of [li] with actual labels and arguments [labels] and [args] respectively. Assumes that both have already been inlined. *) method private new_env li args labels = let map_param = List.fold_left2 (fun m v t -> Logic_var.Map.add v (t, env.curr_label) m) Logic_var.Map.empty li.l_profile args in let map_label = List.fold_left2 (fun m l1 l2 -> Logic_label.Map.add l1 l2 m) Logic_label.Map.empty li.l_labels labels in { env with (* only inline and curr_label is kept *) map_param; map_label; already_seen = Logic_info.Set.add li env.already_seen; } (* 'Freeze' [off] so that its evaluation occurs at the given label. Does something only for [TIndex]. *) method private freeze_off off lbl = match off with | TNoOffset -> TNoOffset | TField (fi, o) -> TField (fi, self#freeze_off o lbl) | TModel (mi, o) -> TModel (mi, self#freeze_off o lbl) | TIndex (i, o) -> let i' = Logic_const.tat ~loc:i.term_loc (i, lbl) in TIndex (i', self#freeze_off o lbl) method private add_at t lbl = if Logic_label.equal lbl env.curr_label then t else Logic_const.tat ~loc:t.term_loc (t, lbl) method! vterm t = match t.term_node with | Tat (t', l) -> let l = self#inline_label l in let vis = new logic_inliner { env with curr_label = l } in let t' = Visitor.visitFramacTerm vis t' in Cil.ChangeTo (self#add_at t' l) | TLval (TVar v, TNoOffset) -> begin match Logic_var.Map.find v env.map_param with | exception Not_found -> Cil.JustCopy | (x, lbl) -> (* Replace [v] by [x], making sure it is evaluated at [lbl] *) Cil.ChangeTo (self#add_at x lbl) end | TLval (TVar v, off) -> begin match Logic_var.Map.find v env.map_param with | exception Not_found -> Cil.DoChildren | (x, lbl) -> match x.term_node with | TLval (h, offx) -> (* First, inline inside [off] *) let off = Visitor.visitFramacTermOffset (self :> Visitor.frama_c_copy) off in (* We need to compute [h ++ offx ++ off] with the proper labels. [h ++ offx] must be evaluated at [lbl], [off] at the current label. Thus, we build [\at (h ++ offx ++ \at(off, cur), lbl)]. *) let off' = if Logic_label.equal env.curr_label lbl then off else self#freeze_off off env.curr_label in let offx' = Logic_const.addTermOffset off' offx in let x' = {t with term_node = TLval(h, offx')} in Cil.ChangeTo (self#add_at x' lbl) | _ -> (* we cannot handle casts on aggregates, functions returning aggregates, etc, because we cannot buid the corresponding term without a TLet *) raise CannotInline end | Tapp({ l_body = LBterm body } as li, labels, args) -> begin if Logic_info.Set.mem li env.already_seen then raise CannotInline; let args = self#inline_args args in let labels = self#inline_labels labels in if env.inline li then let env = self#new_env li args labels in let vis = new logic_inliner env in Cil.ChangeTo (Visitor.visitFramacTerm vis body) else Cil.ChangeTo {t with term_node = Tapp(li, labels, args) } end | Tapp (li, _, _) when env.inline li -> raise CannotInline | _ -> Cil.DoChildren method! vpredicate p = match p.pred_content with | Pat (p', l) -> let l = self#inline_label l in let vis = new logic_inliner { env with curr_label = l } in let p' = Visitor.visitFramacPredicate vis p' in Cil.ChangeTo (Logic_const.pat ~loc:p.pred_loc (p', l)) | Papp ({ l_body = LBpred body } as li, labels, args) -> begin if Logic_info.Set.mem li env.already_seen then raise CannotInline; let args = self#inline_args args in let labels = self#inline_labels labels in if env.inline li then let env = self#new_env li args labels in let vis = new logic_inliner env in Cil.ChangeTo (Visitor.visitFramacPredicate vis body) else Cil.ChangeTo {p with pred_content = Papp(li, labels, args) } end | Papp (li, _, _) when env.inline li -> raise CannotInline | _ -> Cil.DoChildren end let inliner curr_label inline = new logic_inliner { inline; map_param = Logic_var.Map.empty; map_label = Logic_label.Map.empty; already_seen = Logic_info.Set.empty; curr_label = curr_label; } let inline_term ~inline ?(current = BuiltinLabel Here) term = let current_loc = Cil_const.CurrentLoc.get () in try Some (Visitor.visitFramacTerm (inliner current inline) term) with CannotInline -> (* The visitor changes and resets the reference to the current location. If an exception is raised during the visit, the current location must be reset by the caller. *) Cil_const.CurrentLoc.set current_loc; None let inline_predicate ~inline ?(current = BuiltinLabel Here) pred = let current_loc = Cil_const.CurrentLoc.get () in try Some (Visitor.visitFramacPredicate (inliner current inline) pred) with CannotInline -> Cil_const.CurrentLoc.set current_loc; None frama-c-20.0-Calcium/src/kernel_services/ast_transformations/inline.mli0000666000000000000000000000444713571573400023257 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types val inline_calls : file -> unit (** [inline_term ~inline term] inlines in [term] the application of predicates and logic functions for which [inline] is true. If provided, [current] is the current label of the term; it is [Here] by default. Returns [None] if the inlining of a predicate or a logic function fails, in particular when they are recursive or have no direct definitiion. *) val inline_term: inline:(logic_info -> bool) -> ?current:logic_label -> term -> term option (** Inlines predicates and logic functions in a predicate. See [inline_term] for details. *) val inline_predicate: inline:(logic_info -> bool) -> ?current:logic_label -> predicate -> predicate option frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/0000777000000000000000000000000013571573400021023 5ustar frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/cmdline.ml0000666000000000000000000010521413571573400022773 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This file implements how the command line is parsed. The parsing of the Frama-C command line is done in several stages. The first one is done when this module is loaded by caml (that is very early). At each stage [s], each option [o] put on the command line are checked again the recognized options at stage [s]. If [o] is recognized, then its associated action is performed. Otherwise [o] will be proceed by the next stage. Complexity of this algorithm is [O(2*s*o)] where [s] is the number of stages and [o] is the number of options puts on the command line options. That is quite bad and that could be improved. However it should be good enough in practice because there are not so many options put on the command line and others Frama-C algorithms take much more time. Parsing the command line option is not the more difficult/longer stuff for Frama-C ;-). *) (* ************************************************************************* *) (** {2 Global declarations} *) (* ************************************************************************* *) module type Level = sig val value_if_set: int option ref val get: unit -> int val set: int -> unit end module Make_level(X: sig val default: int end) = struct let value_if_set = ref None let get () = match !value_if_set with None -> X.default | Some x -> x let set n = value_if_set := Some n end module Debug_level = Make_level(struct let default = 0 end) module Verbose_level = Make_level(struct let default = 1 end) module Kernel_debug_level = Make_level(struct let default = 0 end) module Kernel_verbose_level = Make_level(struct let default = 1 end) let kernel_debug_atleast_ref = ref (fun n -> Kernel_debug_level.get () >= n) let kernel_verbose_atleast_ref = ref (fun n -> Kernel_verbose_level.get () >= n) module Kernel_log = Log.Register (struct let channel = Log.kernel_channel_name let label = Log.kernel_label_name let debug_atleast level = !kernel_debug_atleast_ref level let verbose_atleast level = !kernel_verbose_atleast_ref level end) let dkey = Kernel_log.register_category "cmdline" let quiet_ref = ref false let journal_enable_ref = ref !Config.is_gui let journal_isset_ref = ref false let use_obj_ref = ref true let use_type_ref = ref true let deterministic = ref false let last_project_created_by_copy = ref (fun () -> assert false) (* ************************************************************************* *) (** {2 Handling errors} *) (* ************************************************************************* *) let long_plugin_name s = if s = Log.kernel_label_name then "Frama-C" else "Plug-in " ^ s let additional_info () = if !Config.is_gui then "\nReverting to previous state.\n\ Check the Console tab for additional information." else "" let get_backtrace () = (* Get the backtrace before potentially destroying it in the handler below *) let bt = Printexc.get_backtrace () in let current_src_string = try let src = Log.get_current_source() in Format.asprintf "Current source was: %a@." Filepath.pp_pos src with Not_found -> "Current source was not set\n" in current_src_string ^ "The full backtrace is:\n" ^ bt let request_crash_report = Format.sprintf "Please report as 'crash' at http://bts.frama-c.com/.\n\ Your Frama-C version is %s.\n\ Note that a version and a backtrace alone often do not contain enough\n\ information to understand the bug. Guidelines for reporting bugs are at:\n\ http://bts.frama-c.com/dokuwiki/doku.php?id=mantis:frama-c:bug_reporting_guidelines\n" Config.version_and_codename let protect = function | Sys.Break -> "User Interruption (Ctrl-C)" ^ if Kernel_debug_level.get () > 0 then "\n" ^ get_backtrace () else "" | Sys_error s -> Printf.sprintf "System error: %s" s | Unix.Unix_error(err, a, b) -> let error = Printf.sprintf "System error: %s" (Unix.error_message err) in (match a, b with | "", "" -> error | "", t | t, "" -> Printf.sprintf "%s (%s)" error t | f, x -> Printf.sprintf "%s (%s %S)" error f x) | Log.AbortError p -> Printf.sprintf "%s aborted: invalid user input.%s" (long_plugin_name p) (additional_info ()) | Log.AbortFatal p -> let bt = get_backtrace () in Printf.sprintf "%s\n%s aborted: internal error.%s\n%s" bt (long_plugin_name p) (additional_info ()) request_crash_report | Log.FeatureRequest(p, m) -> let name = long_plugin_name p in Printf.sprintf "%s aborted: unimplemented feature.%s\n\ You may send a feature request at http://bts.frama-c.com with:\n\ '[%s] %s'." name (additional_info ()) name m | e -> let bt = get_backtrace () in Printf.sprintf "%s\nUnexpected error (%s).\n%s" bt (Printexc.to_string e) request_crash_report (* ************************************************************************* *) (** {2 Exiting Frama-C} *) (* ************************************************************************* *) module NormalExit = Hook.Make(struct end) let at_normal_exit = NormalExit.extend let run_normal_exit_hook = NormalExit.apply module ErrorExit = Hook.Build(struct type t = exn end) let at_error_exit = ErrorExit.extend let () = Log.cmdline_at_error_exit := at_error_exit let run_error_exit_hook = ErrorExit.apply let error_occurred_ref = ref None let error_occurred exn = error_occurred_ref := Some exn let () = Log.cmdline_error_occurred := error_occurred type exit = unit exception Exit let nop = () let catch_at_toplevel = function | Log.AbortError _ -> true | Log.FeatureRequest _ -> true | _ -> Kernel_debug_level.get () = 0 let exit_code = function | Log.AbortError _ -> 1 | Sys.Break -> 2 | Log.FeatureRequest _ -> 3 | Log.AbortFatal _ -> 4 | _ -> 125 let bail_out_ref = ref (fun _ -> assert false) let bail_out () = !bail_out_ref (); (* bail_out_ref must exit 0 *) Kernel_log.fatal "Cmdline.bail_out must `exit 0'." let catch_toplevel_run ~f ~at_normal_exit ~on_error = (* both functions below handle errors at exit hooks *) let run_at_normal_exit () = try at_normal_exit (); Log.clean () with exn -> Kernel_log.feedback ~level:0 "error occurring when exiting Frama-C: stopping exit procedure.\n%s@." (protect exn); exit 5 in let run_on_error exn = try on_error exn; Log.clean () with exn' -> Kernel_log.feedback ~level:0 "error occurring when handling error: stopping error handling \ procedure.\n%s@." (protect exn'); exit 6 in let cleanup () = (match !error_occurred_ref with | None -> run_at_normal_exit () | Some exn -> run_on_error exn; (* even if an error occurred somewhere, Frama-C stops with error code 0. *) exit 0; ); in let bail_out () = cleanup (); exit 0; in bail_out_ref := bail_out; try f (); (* write again on stdout *) Log.set_output ~isatty:(Unix.isatty Unix.stdout) (output_substring stdout) (fun () -> flush stdout); cleanup (); with | Exit -> bail_out () | exn when catch_at_toplevel exn -> Kernel_log.feedback ~level:0 "%s" (protect exn); run_on_error exn; exit (exit_code exn) | exn -> run_on_error exn; raise exn (* ************************************************************************* *) (** {2 Generic parsing way} *) (* ************************************************************************* *) type option_setting = | Unit of (unit -> unit) | Int of (int -> unit) | String of (string -> unit) | String_list of (string list -> unit) exception Cannot_parse of string * string let raise_error name because = raise (Cannot_parse(name, because)) let error name msg = let bin_name = Sys.argv.(0) in Kernel_log.abort "option `%s' %s.@\nuse `%s -help' for more information." name msg bin_name let all_options = match Array.to_list Sys.argv with | [] -> assert false | _binary :: l -> l let get_option_and_arg option arg = try let k = String.index option '=' in let p = succ k in String.sub option 0 k , String.sub option p (String.length option - p) , true with Not_found -> option, arg, false type then_argument = | Default | Last | Replace | Name of string let parse known_options_list then_expected options_list = let known_options = Hashtbl.create 17 in List.iter (fun (n, s) -> Hashtbl.add known_options n s) known_options_list; let parse_one_option unknown_options option arg = let option, arg, explicit = get_option_and_arg option arg in let check_string_argname () = if not explicit && (arg = "" || arg.[0] = '-') then raise_error option "requires a string as argument"; in try let setting = Hashtbl.find known_options option in let use_arg = match setting with | Unit f -> if explicit then raise_error option "does not accept any argument"; f (); false | Int f -> let n = try int_of_string arg with Failure _ -> raise_error option "requires an integer as argument" in f n; true | String f -> check_string_argname (); f arg; true | String_list f -> check_string_argname (); f (Str.split (Str.regexp "[ \t]*,[ \t]*") arg); true in unknown_options, use_arg && not explicit, true with Not_found -> let o = if explicit then option ^ "=" ^ arg else option in o :: unknown_options, false, false in let rec go unknown_options nb_used = function | [] -> unknown_options, nb_used, None | [ "-then" | "-then-last" | "-then-replace" as then_name ] when then_expected -> Kernel_log.warning "ignoring last option `%s'." then_name; unknown_options, nb_used, None | [ "-then-on" ] when then_expected -> raise_error "-then-on" "requires a string as argument." | [ option ] -> let unknown, use_arg, is_used = parse_one_option unknown_options option "" in assert (not use_arg); unknown, (if is_used then succ nb_used else nb_used), None | "-then" :: then_options when then_expected -> unknown_options, nb_used, Some (then_options, Default) | "-then-last" :: then_options when then_expected -> unknown_options, nb_used, Some (then_options, Last) | "-then-replace" :: then_options when then_expected -> unknown_options, nb_used, Some (then_options, Replace) | "-then-on" :: project_name :: then_options when then_expected -> unknown_options, nb_used, Some (then_options, Name project_name) | option :: (arg :: next_options as arg_next) -> let unknown, use_arg, is_used = parse_one_option unknown_options option arg in let next = if use_arg then next_options else arg_next in go unknown (if is_used then succ nb_used else nb_used) next in try let unknown_options, nb_used, then_options = go [] 0 options_list in List.rev unknown_options, nb_used, then_options with Cannot_parse(name, msg) -> error name msg (* ************************************************************************* *) (** {2 First parsing stage at the very beginning of the initialization step} *) (* ************************************************************************* *) let non_initial_options_ref = ref [] let () = let set_journal b = journal_enable_ref := b; journal_isset_ref := true in let first_parsing_stage () = parse [ "-journal-enable", Unit (fun () -> set_journal true); "-journal-disable", Unit (fun () -> set_journal false); "-no-obj", Unit (fun () -> use_obj_ref := false); "-no-type", Unit (fun () -> use_type_ref := false); "-quiet", Unit (fun () -> quiet_ref := true; Verbose_level.set 0; Debug_level.set 0); "-verbose", Int (fun n -> Verbose_level.set n); "-debug", Int (fun n -> Debug_level.set n); "-kernel-verbose", Int (fun n -> Kernel_verbose_level.set n); "-kernel-debug", Int (fun n -> Kernel_debug_level.set n); "-deterministic", Unit (fun () -> deterministic := true); ] false all_options in (* Only useful for the toplevel version of Frama-C, so that OCaml does not try to parse those options. *) Arg.current := Array.length Sys.argv; catch_toplevel_run ~f:(fun () -> let remaining_options, _, _ = first_parsing_stage () in non_initial_options_ref := remaining_options) ~at_normal_exit:(fun () -> ()) ~on_error:run_error_exit_hook let () = if not !use_obj_ref then use_type_ref := false; if not !use_type_ref then begin Type.no_obj (); if !journal_enable_ref then begin Kernel_log.warning "disabling journal in the 'no obj' mode"; journal_enable_ref := false end end let quiet = !quiet_ref let journal_enable = !journal_enable_ref let journal_isset = !journal_isset_ref let use_obj = !use_obj_ref let use_type = !use_type_ref let deterministic = !deterministic (* ************************************************************************* *) (** {2 Plugin} *) (* ************************************************************************* *) type cmdline_option = { oname: string; argname: string; ohelp: string; ovisible: bool; ext_help: (unit,Format.formatter,unit) format; mutable setting: option_setting } module Plugin: sig type t = private { name: string; help: string; short: string; groups: (string, cmdline_option list ref) Hashtbl.t } val all_plugins: unit -> t list val add: ?short:string -> string -> help:string -> unit val add_group: ?memo:bool -> plugin:string -> string -> string * bool val add_option: string -> group:string -> cmdline_option -> unit val add_aliases: orig:string -> string -> group:string -> string list -> cmdline_option list val replace_option_setting: string -> plugin:string -> group:string -> option_setting -> unit val find: string -> t val find_option_aliases: cmdline_option -> cmdline_option list val is_option_alias: cmdline_option -> bool end = struct type t = { name: string; help: string; short: string; groups: (string, cmdline_option list ref) Hashtbl.t } (* all the registered plug-ins indexed by their shortnames *) let plugins : (string, t) Hashtbl.t = Hashtbl.create 17 let all_plugins () = let cmp p1 p2 = Extlib.compare_ignore_case p1.name p2.name in List.sort cmp (Hashtbl.fold (fun _ p acc -> p :: acc) plugins []) let add ?short name ~help = let short = match short with None -> name | Some s -> s in if Hashtbl.mem plugins short then invalid_arg ("a plug-in " ^ short ^ " is already registered."); let groups = Hashtbl.create 7 in Hashtbl.add groups "" (ref []); Hashtbl.add plugins short { name = name; short = short; help = help; groups = groups } let find p = try Hashtbl.find plugins p with Not_found -> Kernel_log.fatal "Plug-in %s not found" p let add_group ?(memo=false) ~plugin name = let groups = (find plugin).groups in name, if Hashtbl.mem groups name then begin if not memo then Kernel_log.abort "A group of name %s already exists for plug-in %s" name plugin; false end else begin Hashtbl.add groups name (ref []); true end let find_group p g = try Hashtbl.find (find p).groups g with Not_found -> Kernel_log.fatal "Group %s not found for plug-in %s" g p module Option_names : sig val add: string -> bool -> unit val is_option_alias: string -> bool end = struct let tbl = Hashtbl.create 7 let check s = if Hashtbl.mem tbl s then invalid_arg (Format.sprintf "an option with the name %S is already registered." s) let add s b = check s; Hashtbl.add tbl s b let is_option_alias s = try Hashtbl.find tbl s with Not_found -> assert false end let add_option shortname ~group option = assert (option.oname <> ""); Option_names.add option.oname false; let g = find_group shortname group in g := option :: !g (* table name_of_the_original_option --> aliases *) let aliases_tbl = Hashtbl.create 7 let add_aliases ~orig shortname ~group names = (* mostly inline [add_option] and perform additional actions *) let options_group = find_group shortname group in let option = List.find (fun o -> o.oname = orig) !options_group in let get_one name = if name = "" then invalid_arg "empty alias name"; Option_names.add name true; let alias = { option with oname = name } in options_group := alias :: !options_group; alias in let aliases = List.map get_one names in (try let l = Hashtbl.find aliases_tbl orig in l := aliases @ !l; with Not_found -> Hashtbl.add aliases_tbl orig (ref aliases)); aliases let find_option_aliases o = try !(Hashtbl.find aliases_tbl o.oname) with Not_found -> [] let is_option_alias o = Option_names.is_option_alias o.oname let replace_option_setting option ~plugin ~group setting = if option <> "" then let options_in_group = find_group plugin group in let rec replace = function | [] -> Kernel_log.fatal "no option %s in plugin %s ((group of options %s)." option plugin group | o :: _ when o.oname = option -> o.setting <- setting | _ :: l -> replace l in replace !options_in_group end let add_plugin = Plugin.add module Group = struct type t = string let add = Plugin.add_group let default = "" let name x = x end (* ************************************************************************* *) (** {2 Parsing} *) (* ************************************************************************* *) module Make_Stage (S: sig val exclusive: bool val name: string val then_expected: bool end) = struct let nb_actions = ref 0 let is_going_to_run () = incr nb_actions module H = Hook.Make(struct end) let () = H.extend Log.treat_deferred_error let options : (string, cmdline_option) Hashtbl.t = Hashtbl.create 17 let add_for_parsing option = Hashtbl.add options option.oname option let add name plugin ?(argname="") help visible ext_help setting = (* L.debug ~level:4 "Cmdline: [%s] registers %S for stage %s." plugin name S.name;*) let help = if help = "" then "undocumented" else help in let o = { oname = name; argname = argname; ohelp = help; ext_help = ext_help; ovisible = visible; setting = setting } in add_for_parsing o; Plugin.add_option plugin o let parse options_list = Kernel_log.feedback ~dkey "parsing command line options of stage %S." S.name; let options, nb_used, then_options = parse (Hashtbl.fold (fun _ o acc -> (o.oname, o.setting) :: acc) options []) S.then_expected options_list in let nb_used = nb_used + !nb_actions in if S.exclusive && nb_used > 1 then begin Kernel_log.abort "at most one %s action must be specified." S.name; end; H.apply (); options, nb_used, then_options end module Early_Stage = Make_Stage (struct let exclusive = false let name = "early" let then_expected = false end) module Extending_Stage = Make_Stage (struct let exclusive = false let name = "extending" let then_expected = false end) module Extended_Stage = Make_Stage (struct let exclusive = false let name = "extended" let then_expected = true end) module Exiting_Stage = Make_Stage (struct let exclusive = true let name = "exiting" let then_expected = false end) module Loading_Stage = Make_Stage (struct let exclusive = true let name = "loading" let then_expected = false end) let is_going_to_load = Loading_Stage.is_going_to_run module Configuring_Stage = Make_Stage (struct let exclusive = false let name = "configuring" let then_expected = false end) let run_after_early_stage = Early_Stage.H.extend let run_during_extending_stage = Extending_Stage.H.extend let run_after_extended_stage = Extended_Stage.H.extend let run_after_exiting_stage = Exiting_Stage.H.extend let run_after_loading_stage = Loading_Stage.H.extend let run_after_configuring_stage = Configuring_Stage.H.extend module After_setting = Hook.Build(struct type t = string list end) let run_after_setting_files = After_setting.extend type stage = Early | Extending | Extended | Exiting | Loading | Configuring let add_option name ~plugin ~group stage ?argname ~help ~visible ~ext_help setting = if name <> "" then let add = match stage with | Early -> Early_Stage.add | Extending -> Extending_Stage.add | Extended -> Extended_Stage.add | Exiting -> Exiting_Stage.add | Loading -> Loading_Stage.add | Configuring -> Configuring_Stage.add in add name plugin ~group ?argname help visible ext_help setting let add_option_without_action name ~plugin ~group ?(argname="") ~help ~visible ~ext_help () = Plugin.add_option plugin ~group { oname = name; argname = argname; ohelp = help; ext_help = ext_help; ovisible = visible; setting = Unit (fun () -> assert false) } let add_aliases orig ~plugin ~group stage aliases = let l = Plugin.add_aliases ~orig plugin ~group aliases in let add = match stage with | Early -> Early_Stage.add_for_parsing | Extending -> Extending_Stage.add_for_parsing | Extended -> Extended_Stage.add_for_parsing | Exiting -> Exiting_Stage.add_for_parsing | Loading -> Loading_Stage.add_for_parsing | Configuring -> Configuring_Stage.add_for_parsing in List.iter add l let replace_option_setting = Plugin.replace_option_setting module On_Files = Hook.Build(struct type t = string list end) let use_cmdline_files = On_Files.extend let set_files used_loading l = Kernel_log.feedback ~dkey "setting files from command lines."; List.iter (fun s -> if s = "" then error "" "has no name. What do you exactly have in mind?"; if s.[0] = '-' then error s "is unknown") l; assert (Kernel_log.verify (not (On_Files.is_empty ())) "no function uses the files provided on the command line"); if List.length l > 0 then if used_loading then Kernel_log.warning "ignoring source files specified on the command line \ while loading a global initial context." else begin On_Files.apply l; After_setting.apply l end let nb_used_ref = ref 0 let nb_used_relevant = ref false let nb_given_options () = assert (Kernel_log.verify !nb_used_relevant "function `nb_given_options' called too early"); !nb_used_ref let load_all_plugins = ref (fun () -> assert false) (** execute one execution shot between 2 "-then*". @return the remaining "-then" and the associated options, if any *) let play_in_toplevel_one_shot nb_used play options = let options, nb_used_extended, then_options_extended = Extended_Stage.parse options in let options, nb_used_exiting, then_options_exiting = Exiting_Stage.parse options in assert (then_options_exiting = None); if nb_used_exiting > 0 then Kernel_log.fatal "setting an option at the exiting stage must stop Frama-C"; let options, nb_used_loading, then_options_loading = Loading_Stage.parse options in assert (then_options_loading = None); let files, nb_used_config, then_options_configuring = Configuring_Stage.parse options in assert (then_options_configuring = None); nb_used_relevant := true; nb_used_ref := nb_used + nb_used_extended + nb_used_exiting + nb_used_loading + nb_used_config ; set_files (nb_used_loading > 0) files; Kernel_log.feedback ~dkey "running plug-in mains."; play (); then_options_extended let play_in_toplevel on_from_name nb_used play options = (* [aux then_opts] handles the following "-then" options *) let rec aux current = function | None -> () | Some(options, then_argument) -> let play_on options p = p, on_from_name p (fun () -> play_in_toplevel_one_shot nb_used play options) in let last_current, then_opts = match then_argument with | Default -> current, play_in_toplevel_one_shot nb_used play options | Last -> (match !last_project_created_by_copy () with | None -> Kernel_log.abort "no known last created project." | Some p -> play_on options p) | Replace -> (match !last_project_created_by_copy () with | None -> Kernel_log.abort "no known last created project." | Some p -> play_on (("-remove-projects=-@all,+" ^ current) :: options) p) | Name p -> play_on options p in aux last_current then_opts in (* play the first shot before the first "-then" *) let then_opts = play_in_toplevel_one_shot nb_used play options in (* play the "-then" options *) aux "default" then_opts type on_from_name = { on_from_name: 'a. string -> (unit -> 'a) -> 'a } let parse_and_boot ~on_from_name ~get_toplevel ~play_analysis = let options, nb_used_early, then_options_early = Early_Stage.parse !non_initial_options_ref in assert (then_options_early = None); let options, nb_used_extending, then_options_extending = Extending_Stage.parse options in !load_all_plugins (); assert (then_options_extending = None); get_toplevel () (* the extending stage may change the toplevel: applying [get_toplevel] provides the good one. *) (fun () -> play_in_toplevel on_from_name.on_from_name (nb_used_early + nb_used_extending) play_analysis options) (* ************************************************************************* *) (** {2 Help} Implement a not very efficient algorithm but it is enough for displaying help and exiting. *) (* ************************************************************************* *) let print_helpline fmt head help ext_help = let n = max 1 (19 - String.length head) in Format.fprintf fmt "@[%s%s %t%t@]@\n" head (* let enough spaces *) (String.make n ' ') (* the description *) (fun fmt -> Format.pp_print_text fmt help) (* the extended description *) (fun fmt -> Format.fprintf fmt ext_help) (* Prints option [o], its arguments, and its aliases. If [o] is an alias itself, print nothing. [print_invisible = true] forces printing invisible options. Returns [true] iff something was printed. *) let low_print_option_help fmt print_invisible o = if Plugin.is_option_alias o then begin false end else let ty = let s = o.argname in if s = "" then match o.setting with | Unit _ -> "" | Int _ -> " " | String _ -> " " | String_list _ -> " " else " <" ^ s ^ ">" in let name = o.oname in if print_invisible || o.ovisible then begin print_helpline fmt (name ^ ty) o.ohelp o.ext_help; List.iter (fun o -> print_helpline fmt (o.oname ^ ty) ("alias for option " ^ name) "") (Plugin.find_option_aliases o) end; true let print_option_help fmt ~plugin ~group name = let p = Plugin.find plugin in let options = try Hashtbl.find p.Plugin.groups group with Not_found -> Kernel_log.fatal "[Cmdline.print_option_help] no group %s" group in (* linear search... *) let rec find_then_print = function | [] -> Kernel_log.fatal "[Cmdline.print_option_help] no option %s" name | o :: tl -> if o.oname = name then ignore (low_print_option_help fmt true o) else find_then_print tl in find_then_print !options let option_intro short = let first = if short <> "" then begin let short = "-" ^ short in Format.sprintf "Most options of the form '%s-option-name'@ and without any \ parameter@ have an opposite with the name '%s-no-option-name'.@\n@\n" short short end else "" in Format.sprintf "%sMost options of the form '-option-name' and without any parameter@ \ have an opposite with the name '-no-option-name'.@\n@\n\ Options taking a string as argument should preferably be written@ \ -option-name=\"argument\"." first (* Sorts command-line options inside a group *) let sort_cmdline_options = List.sort (fun o1 o2 -> String.compare o1.oname o2.oname) (* Sorts command-line groups inside a plugin *) let sort_groups groups = List.sort (fun (s1, _) (s2, _) -> String.compare s1 s2) (Hashtbl.fold (fun s l acc -> (s, l) :: acc) groups []) let plugin_help shortname = let p = Plugin.find shortname in if p.Plugin.name <> "" then begin assert (p.Plugin.short <> ""); Log.print_on_output (fun fmt -> Format.fprintf fmt "@[%s:@ %s@]@\n@[%s:@ %s@]@\n" "Plug-in name" p.Plugin.name "Plug-in shortname" shortname) end; Log.print_on_output (fun fmt -> Format.fprintf fmt "@[@[%s:@ %s@]@\n@\n%s@\n@\n%s:@\n@\n@[%t@]@]@?" "Description" p.Plugin.help (option_intro shortname) "***** LIST OF AVAILABLE OPTIONS" (fun fmt -> let print_options l = List.fold_left (fun b o -> let b' = low_print_option_help fmt false o in b || b') false (sort_cmdline_options l) in match sort_groups p.Plugin.groups with | [] -> () | g :: l -> let print_group newline (s, o) = if newline then Format.pp_print_newline fmt (); if s <> "" then Format.fprintf fmt "@[*** %s@]@\n@\n" (String.uppercase_ascii s); ignore (print_options !o) in print_group false g; List.iter (print_group true) l)); raise Exit let help () = Log.print_on_output begin fun fmt -> Format.fprintf fmt "\nThis is Frama-C %s\n" Config.version_and_codename ; Format.fprintf fmt "\nUsage:\n %s [options files ...]\n" Sys.argv.(0) ; let print_line fmt s = Format.(pp_print_string fmt s ; pp_print_newline fmt ()) in List.iter (print_line fmt) [ "" ; "Main Options:" ; " -help This message." ; " -version Version number only." ; " -plugins List of installed plugins." ; " -kernel-h Additional help and options." ; "" ; "Plug-in Options:" ; " - Plug-in activation." ; " --h Additional help and options." ; "" ; ] ; end ; raise Exit (** reverse dependency to dynamic.ml *) let loading_failures = Queue.create () let add_loading_failures s = Queue.add s loading_failures let list_plugins () = Log.print_on_output begin fun fmt -> List.iter (fun p -> if p.Plugin.name <> "" then print_helpline fmt (String.capitalize_ascii p.Plugin.name) (Printf.sprintf "%s (-%s-h)" p.Plugin.help p.Plugin.short) "") (Plugin.all_plugins ()) ; if not (Queue.is_empty loading_failures) then begin Kernel_log.abort "@[The following packages failed to load:@ %a@]" (Pretty_utils.pp_iter Queue.iter ~sep:",@ " Format.pp_print_string) loading_failures; end; end ; raise Exit let list_all_plugin_options ~print_invisible = Log.print_on_output begin fun fmt -> let of_name s = if s = "" then (if Unix.isatty Unix.stdout then "\x1b[31mNO NAME\x1b[0m" else "NO NAME") else s in let print_cmdline_option fmt (c:cmdline_option) = if print_invisible || c.ovisible then Format.fprintf fmt "@[Name: %s@]" c.oname else Format.ifprintf fmt "@[Name: %s@]" c.oname in let print_cmdline_option_list fmt cs = (Pretty_utils.pp_list ~pre:"@[" ~suf:"@]" ~sep:"@;" print_cmdline_option) fmt (sort_cmdline_options cs) in let print_groups fmt gs = let sorted_gs = sort_groups gs in (Pretty_utils.pp_list ~pre:"@[" ~sep:"@;" ~suf:"@]" (Pretty_utils.pp_pair ~pre:"@[" ~suf:"@]" ~sep:"@;" (fun fmt name -> Format.pp_print_string fmt (of_name name)) (fun fmt p -> print_cmdline_option_list fmt !p))) fmt sorted_gs in let print_plugin fmt p = Format.fprintf fmt "@[Name: %s@;%a@]" p.Plugin.name print_groups p.Plugin.groups in Format.fprintf fmt "%a@." (Pretty_utils.pp_list ~pre:"@[" ~suf:"@]" ~sep:"@;" print_plugin) (Plugin.all_plugins ()) end; raise Exit (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/cmdline.mli0000666000000000000000000003553513571573400023154 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Command line parsing. @plugin development guide *) (* ************************************************************************** *) (** {2 Stage configurations} (* ************************************************************************** *) Frama-C uses several stages for parsing its command line. Each of them may be customized. *) type stage = | Early (** Initial stage for very specific almost hard-coded options. Do not use it. @plugin development guide *) | Extending (** Before loading plug-ins. Run only once. @plugin development guide *) | Extended (** The stage where plug-ins are loaded. It is also the first stage each time the Frama-C main loop is run (e.g. after each "-then"). @plugin development guide *) | Exiting (** Run once when exiting Frama-C. @plugin development guide *) | Loading (** After {!Extended}, the stage where a previous Frama-C internal states is restored (e.g. the one specified by -load or by running the journal). @plugin development guide *) | Configuring (** The stage where all the parameters which were not already set may be modified to take into account cmdline options. Just after this stage, Frama-C will run the plug-in mains. @plugin development guide *) (** The different stages, from the first to be executed to the last one. @since Beryllium-20090601-beta1 *) val run_after_early_stage: (unit -> unit) -> unit (** Register an action to be executed at the end of the early stage. @plugin development guide @since Beryllium-20090901 *) val run_during_extending_stage: (unit -> unit) -> unit (** Register an action to be executed during the extending stage. @plugin development guide @since Beryllium-20090901 *) val run_after_extended_stage: (unit -> unit) -> unit (** Register an action to be executed at the end of the extended stage. @plugin development guide @since Beryllium-20090901 *) type exit (** @since Beryllium-20090901 *) val nop : exit (** @since Beryllium-20090901 @plugin development guide *) exception Exit (** @since Beryllium-20090901 @plugin development guide *) val run_after_exiting_stage: (unit -> exit) -> unit (** Register an action to be executed at the end of the exiting stage. The guarded action must finish by [exit n]. @plugin development guide @since Beryllium-20090601-beta1 *) val run_after_loading_stage: (unit -> unit) -> unit (** Register an action to be executed at the end of the loading stage. @plugin development guide @since Beryllium-20090601-beta1 *) val is_going_to_load: unit -> unit (** To be call if one action is going to run after the loading stage. It is not necessary to call this function if the running action is set by an option put on the command line. @since Beryllium-20090601-beta1 @plugin development guide *) val run_after_configuring_stage: (unit -> unit) -> unit (** Register an action to be executed at the end of the configuring stage. @plugin development guide @since Beryllium-20090601-beta1 *) val run_after_setting_files: (string list -> unit) -> unit (** Register an action to be executed just after setting the files put on the command line. The argument of the function is the list of files. @plugin development guide @since Carbon-20101201 *) val at_normal_exit: (unit -> unit) -> unit (** Register a hook executed whenever Frama-C exits without error (the exit code is 0). @since Boron-20100401 *) val at_error_exit: (exn -> unit) -> unit (** Register a hook executed whenever Frama-C exits with error (the exit code is greater than 0). The argument of the hook is the exception at the origin of the error. @since Boron-20100401 @modify Neon-20130301 add the exception as argument of the hook. *) (** Group of command line options. @since Beryllium-20090901 *) module Group : sig type t (** @since Beryllium-20090901 *) val default: t (** @since Beryllium-20090901 *) val name: t -> string (** @since Beryllium-20090901 *) (**/**) (** Kernel internals *) val add: ?memo:bool -> plugin:string -> string -> t * bool (** Add a new group of options to the given plugin. If [memo] is [true], just return the already registered group if any. If [memo] is [false], cannot add twice a group with the same name. @return the group corresponding to the given name. Also return [true] iff the group has just been created. @since Beryllium-20090901 *) (**/**) end (**/**) (* ************************************************************************** *) (* ************************************************************************** *) (** From here: functions required by Kernel Internals only! You should not use them! *) (* ************************************************************************** *) (* ************************************************************************** *) (* ************************************************************************** *) (** {2 Handle Hooks} *) (* ************************************************************************** *) val protect: exn -> string (** Messages for exceptions raised by Frama-C @since Boron-20100401 *) val catch_at_toplevel: exn -> bool (** @return true iff the given exception is caught by the Frama-C toplevel. @since Boron-20100401 *) val catch_toplevel_run: f:(unit -> unit) -> at_normal_exit:(unit -> unit) -> on_error:(exn -> unit) -> unit (** Run [f]. When done, either call [at_normal_exit] if running [f] was ok; or call [on_error] (and exits) in other cases. @modify Boron-20100401 additional arguments. They are now labelled @modify Neon-20140301 add the exception as argument of [on_error]. @modify Magnesium-20151001 Removed argument [~quit] *) val run_normal_exit_hook: unit -> unit (** Run all the hooks registered by {!at_normal_exit}. @since Boron-20100401 *) val run_error_exit_hook: exn -> unit (** Run all the hooks registered by {!at_normal_exit}. @since Boron-20100401 @modify Neon-20130301 add the exception as argument. *) val error_occurred: exn -> unit (** Remember that an error occurred. So {!run_error_exit_hook} will be called when Frama-C will exit. @since Boron-20100401 @modify Neon-20130301 add the exception as argument, fix spelling. *) val bail_out: unit -> 'a (** Stop Frama-C with exit 0. @since Boron-20100401 *) (* ************************************************************************** *) (** {2 Special functions} (* ************************************************************************** *) These functions should not be used by a standard plug-in developer. *) type on_from_name = { on_from_name: 'a. string -> (unit -> 'a) -> 'a } val parse_and_boot: on_from_name:on_from_name -> get_toplevel:(unit -> (unit -> unit) -> unit) -> play_analysis:(unit -> unit) -> unit (** Not for casual users. [parse_and_boot on_from_name get_toplevel play] performs the parsing of the command line, then play the analysis with the good toplevel provided by [get_toplevel]. [on_from_name] is [Project.on] on the project corresponding to the given (unique) name. @since Beryllium-20090901 @modify Carbon-20101201 @modify Sodium-20150201 the first argument of the first functional is no more a string option, just a string @modify Aluminium-20160501 add labels and generalize the type of [on_from_name] *) val nb_given_options: unit -> int (** Number of options provided by the user on the command line. Should not be called before the end of the command line parsing. @since Beryllium-20090601-beta1 *) val use_cmdline_files: (string list -> unit) -> unit (** What to do with the list of files put on the command lines. @since Beryllium-20090601-beta1 *) val help: unit -> exit (** Display the help of Frama-C @since Beryllium-20090601-beta1 *) val list_plugins: unit -> exit (** Display the list of installed plug-ins @since Magnesium-20151001 *) (** Display the list of all installed plug-ins and their options, in a condensed format. Used for zsh autocompletion. @since Phosphorus-20170501-beta1 *) val list_all_plugin_options : print_invisible:bool -> exit val plugin_help: string -> exit (** Display the help of the given plug-in (given by its shortname). @since Beryllium-20090601-beta1 *) val print_option_help: Format.formatter -> plugin:string -> group:Group.t -> string -> unit (** Pretty print the help of the option (given by its plug-in, its group and its name) in the provided formatter. @since Oxygen-20120901 *) val add_plugin: ?short:string -> string -> help:string -> unit (** [add_plugin ~short name ~help] adds a new plug-in recognized by the command line of Frama-C. If the shortname is not specified, then the name is used as the shortname. By convention, if the name and the shortname are equal to "", then the register "plug-in" is the Frama-C kernel itself. @raise Invalid_argument if the same shortname is registered twice @since Beryllium-20090601-beta1 *) (** @since Beryllium-20090601-beta1 *) type option_setting = | Unit of (unit -> unit) | Int of (int -> unit) | String of (string -> unit) | String_list of (string list -> unit) val add_option: string -> plugin:string -> group:Group.t -> stage -> ?argname:string -> help:string -> visible:bool -> ext_help:(unit,Format.formatter,unit) format -> option_setting -> unit (** [add_option name ~plugin stage ~argname ~help setting] adds a new option of the given [name] recognized by the command line of Frama-C. If the [name] is the empty string, nothing is done. [plugin] is the shortname of the plug-in. [argname] is the name of the argument which can be used of the description [help]. Both of them are used by the help of the registered option. If [help] is [None], then the option is not shown in the help. @since Beryllium-20090601-beta1 @modify Carbon-20101201 @modify Oxygen-20120901 change type of ~help and add ~visible. *) val add_option_without_action: string -> plugin:string -> group:Group.t -> ?argname:string -> help:string -> visible:bool -> ext_help:(unit,Format.formatter,unit) format -> unit -> unit (** Equivalent to [add_option] without option setting. Thus do not add the option to any stage of the command line... Thus should not be used by casual users ;-). @since Carbon-20101201 *) val add_aliases: string -> plugin:string -> group:Group.t -> stage -> string list -> unit (** [add_aliases orig plugin group aliases] adds a list of aliases to the given option name [orig]. @Invalid_argument if an alias name is the empty string @since Carbon-20110201 *) val replace_option_setting: string -> plugin:string -> group:Group.t -> option_setting -> unit (** Replace the previously registered option setting. @since Sodium-20150201 *) (* ************************************************************************** *) (** {2 Special parameters} (* ************************************************************************** *) Frama-c parameters depending on the command line argument and set at the very beginning of the Frama-C initialization. They should not be used directly by a standard plug-in developer. *) module Kernel_log: Log.Messages (** @since Neon-20140301 *) (** @since Fluorine-20130401 *) module type Level = sig val value_if_set: int option ref val get: unit -> int val set: int -> unit end module Debug_level: Level (** @since Fluorine-20130401 *) module Verbose_level: Level (** @since Fluorine-20130401 *) module Kernel_debug_level: Level (** @since Fluorine-20130401 *) module Kernel_verbose_level: Level (** @since Fluorine-20130401 *) val kernel_debug_atleast_ref: (int -> bool) ref (** @since Boron-20100401 *) val kernel_verbose_atleast_ref: (int -> bool) ref (** @since Boron-20100401 *) val journal_enable: bool (** @since Beryllium-20090601-beta1 *) val journal_isset: bool (** -journal-enable/disable explicitly set on the command line. @since Boron-20100401 *) val use_obj: bool (** @since Beryllium-20090601-beta1 *) val use_type: bool (** @since Beryllium-20090601-beta1 *) val quiet: bool (** Must not be used for something else that initializing values @since Beryllium-20090601-beta1 *) val deterministic: bool (** Indicates that the plugins should strive to be as deterministic as possible in their outputs. Higher memory consumption or analysis time are acceptable, as reproducibility is more important. @since Aluminium-20160501 *) val last_project_created_by_copy: (unit -> string option) ref val load_all_plugins: (unit -> unit) ref val add_loading_failures: string -> unit (** Add a package to the list of ocamlfind packages that have failed to be loaded. @since Silicon-20161101 *) (**/**) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/parameter_builder.ml0000666000000000000000000015265013571573400025054 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* all the collection's internal states that depend on the AST. Forward dependency because of linking order (see special_hooks.ml). *) let ast_dependencies: State.t list ref = ref [] let extend_ast_dependencies s = ast_dependencies := s :: !ast_dependencies module D = Datatype (* hide after applying Parameter_state.Make *) let empty_string = "" let find_kf_by_name : (string -> kernel_function) ref = Extlib.mk_fun "Parameter_builder.find_kf_by_name" let find_kf_def_by_name : (string -> kernel_function) ref = Extlib.mk_fun "Parameter_builder.find_kf_def_by_name" let find_kf_decl_by_name : (string -> kernel_function) ref = Extlib.mk_fun "Parameter_builder.find_kf_decl_by_name" let kf_category : (unit -> kernel_function Parameter_category.t) ref = Extlib.mk_fun "Parameter_builder.kf_category" let kf_def_category : (unit -> kernel_function Parameter_category.t) ref = Extlib.mk_fun "Parameter_builder.kf_def_category" let kf_decl_category : (unit -> kernel_function Parameter_category.t) ref = Extlib.mk_fun "Parameter_builder.kf_decl_category" let fundec_category : (unit -> fundec Parameter_category.t) ref = Extlib.mk_fun "Parameter_builder.fundec_category" let kf_string_category : (unit -> string Parameter_category.t) ref = Extlib.mk_fun "Parameter_builder.kf_string_category" let force_ast_compute : (unit -> unit) ref = Extlib.mk_fun "Parameter_builder.force_ast_compute" (* ************************************************************************* *) (** {2 Specific functors} *) (* ************************************************************************* *) let iter_on_this_parameter stage = match !Parameter_customize.do_iterate_ref, stage with | Some false, _ | None, (Cmdline.Early | Cmdline.Extending | Cmdline.Extended | Cmdline.Exiting | Cmdline.Loading) -> false | Some true, _ | None, Cmdline.Configuring -> true module Make (P: sig val shortname: string val parameters: (string, Typed_parameter.t list) Hashtbl.t module L: sig val abort: ('a,'b) Log.pretty_aborter val warning: 'a Log.pretty_printer end val messages_group: Cmdline.Group.t end) = struct module Build = Parameter_state.Make(P) let parameters_ref : Typed_parameter.t list ref = ref [] let parameters () = !parameters_ref let add_parameter group stage param = if iter_on_this_parameter stage then begin parameters_ref := param :: !parameters_ref; let parameter_groups = P.parameters in try let group_name = Cmdline.Group.name group in let parameters = Hashtbl.find P.parameters group_name in Hashtbl.replace parameter_groups group_name (param :: parameters) with Not_found -> assert false end (* ************************************************************************ *) (** {3 Bool} *) (* ************************************************************************ *) module Bool(X:sig include Parameter_sig.Input val default: bool end) = struct include Build (struct include Datatype.Bool include X let default () = default let functor_name = "Bool" end) let on = register_dynamic "on" D.unit D.unit (fun () -> set true) let off = register_dynamic "off" D.unit D.unit (fun () -> set false) let generic_add_option name help visible value = Cmdline.add_option name ~plugin:P.shortname ~group ~help ~visible ~ext_help:!Parameter_customize.optional_help_ref stage (Cmdline.Unit (fun () -> set value)) let negate_name name = (* do we match '-shortname-'? (one dash before, one after) *) let len = String.length P.shortname + 2 in if String.length name <= len || P.shortname = empty_string then "-no" ^ name else let bef = Str.string_before name len in if bef = "-" ^ P.shortname ^ "-" then bef ^ "no-" ^ Str.string_after name len else "-no" ^ name let negative_option_name name = let s = !Parameter_customize.negative_option_name_ref in match s with | None -> negate_name name | Some s -> assert (s <> empty_string); s let default_message opp = Format.asprintf " (set by default%s)" opp let add_option opp name = let opp_msg name = "opposite option is " ^ negative_option_name name in let help = if X.default then if X.help = empty_string then empty_string else X.help ^ if opp then default_message (", " ^ opp_msg name) else default_message empty_string else if opp then Format.asprintf "%s (%s)" X.help (opp_msg name) else X.help in generic_add_option name help is_visible true let add_negative_option name = let neg_name = negative_option_name name in let mk_help s = if is_visible then if X.default then s else s ^ default_message empty_string else empty_string in let neg_help, neg_visible = match !Parameter_customize.negative_option_name_ref, !Parameter_customize.negative_option_help_ref with | None, "" -> (* no user-specific config: no help *) empty_string, false | Some _, "" -> mk_help ("opposite of option \"" ^ name ^ "\""), is_visible | _, s -> assert (s <> empty_string); mk_help s, is_visible in generic_add_option neg_name neg_help neg_visible false; neg_name let negative_option_ref = ref None let parameter = let negative_option = match !Parameter_customize.negative_option_name_ref, stage with | Some "", _ | None, Cmdline.Exiting -> add_option false X.option_name; None | _ -> add_option true X.option_name; Some (add_negative_option X.option_name) in negative_option_ref := negative_option; let accessor = Typed_parameter.Bool ({ Typed_parameter.get = get; set = set; add_set_hook = add_set_hook; add_update_hook = add_update_hook }, negative_option) in let p = Typed_parameter.create ~name ~help:X.help ~accessor:accessor ~is_set in add_parameter !Parameter_customize.group_ref stage p; Parameter_customize.reset (); if is_dynamic then let plugin = empty_string in Dynamic.register ~plugin X.option_name Typed_parameter.ty ~journalize:false p else p let add_aliases list = add_aliases list; match !negative_option_ref with | None -> () | Some negative_option -> let negative_list = List.map negate_name list in let plugin = P.shortname in Cmdline.add_aliases negative_option ~plugin ~group stage negative_list end module False(X: Parameter_sig.Input) = Bool(struct include X let default = false end) module True(X: Parameter_sig.Input) = Bool(struct include X let default = true end) module Action(X: Parameter_sig.Input) = struct (* [JS 2011/09/29] The ugly hack seems to be required anymore neither for Value nor Wp. Maybe it is time to remove it? :-) *) (* do not save it but restore the "good" behavior when creating by copy *) let () = Parameter_customize.do_not_save () (* [JS 2011/01/19] Not saving this kind of options is a quite bad hack with several drawbacks (see Frama-C commits 2011/01/19, message of JS around 15 PM). I'm quite sure there is a better way to not display results too many times (e.g. by using the "isset" flag). That is also the origin of bug #687 *) include False(X) let () = Project.create_by_copy_hook (fun src p -> Project.copy ~selection:(State_selection.singleton Is_set.self) ~src p; let selection = State_selection.singleton self in let opt = Project.on ~selection src get () in if opt then Project.on ~selection p set true) end (* ************************************************************************ *) (** {3 Integer} *) (* ************************************************************************ *) module Int(X: sig include Parameter_sig.Input_with_arg val default: int end) = struct include Build (struct include Datatype.Int include X let default () = default let functor_name = "Int" end) let incr = let incr () = set (succ (get ())) in register_dynamic "incr" D.unit D.unit incr let add_option name = Cmdline.add_option name ~argname:X.arg_name ~help:X.help ~visible:is_visible ~ext_help:!Parameter_customize.optional_help_ref ~plugin:P.shortname ~group stage (Cmdline.Int set) let range = ref (min_int, max_int) let set_range ~min ~max = range := min, max let get_range () = !range let parameter = add_set_hook (fun _ n -> let min, max = !range in if n < min then P.L.abort "argument of %s must be at least %d." name min; if n > max then P.L.abort "argument of %s must be no more than %d." name max); let accessor = Typed_parameter.Int ({ Typed_parameter.get = get; set = set; add_set_hook = add_set_hook; add_update_hook = add_update_hook }, get_range) in let p = Typed_parameter.create ~name ~help:X.help ~accessor ~is_set:is_set in add_parameter !Parameter_customize.group_ref stage p; add_option X.option_name; Parameter_customize.reset (); if is_dynamic then let plugin = empty_string in Dynamic.register ~plugin X.option_name Typed_parameter.ty ~journalize:false p else p end module Zero(X: Parameter_sig.Input_with_arg) = Int(struct include X let default = 0 end) (* ************************************************************************ *) (** {3 String} *) (* ************************************************************************ *) module Pervasives_string = String module String (X: sig include Parameter_sig.Input_with_arg val default: string end) = struct include Build (struct include Datatype.String include X let default () = default let functor_name = "String" end) let add_option name = Cmdline.add_option name ~argname:X.arg_name ~help:X.help ~visible:is_visible ~ext_help:!Parameter_customize.optional_help_ref ~plugin:P.shortname ~group stage (Cmdline.String set) let possible_values = ref [] let set_possible_values s = possible_values := s let get_possible_values () = !possible_values let get_function_name = let allow_fundecl = !Parameter_customize.argument_may_be_fundecl_ref in fun () -> let s = get () in (* Using a parameter that is in fact a function name only makes sense if we have an AST somewhere. *) !force_ast_compute(); let possible_funcs = Parameter_customize.get_c_ified_functions s in let possible_funcs = if allow_fundecl then possible_funcs else Cil_datatype.Kf.Set.filter (fun s -> match s.fundec with | Definition _ -> true | Declaration _ -> false) possible_funcs in if Cil_datatype.Kf.Set.is_empty possible_funcs then P.L.abort "'%s' is not a %sfunction. \ Please choose a valid function name for option %s" s (if allow_fundecl then "" else "defined ") name else begin if Cil_datatype.Kf.Set.cardinal possible_funcs > 1 then P.L.warning "ambiguous function name %s for option %s. \ Choosing arbitrary function with corresponding name." s name; (Cil_datatype.Kf.vi (Cil_datatype.Kf.Set.choose possible_funcs)).vname end let get_plain_string = get let get = if !Parameter_customize.argument_is_function_name_ref then get_function_name else get let parameter = add_set_hook (fun _ s -> match !possible_values with | [] -> () | v when List.mem s v -> () | v -> P.L.abort "invalid input '%s' for option %s.@ \ Possible values are: %a" s name (Pretty_utils.pp_list ~sep:",@ " Format.pp_print_string) v); let accessor = Typed_parameter.String ({ Typed_parameter.get = get_plain_string; set = set; add_set_hook = add_set_hook; add_update_hook = add_update_hook }, get_possible_values) in let p = Typed_parameter.create ~name ~help:X.help ~accessor ~is_set in add_parameter !Parameter_customize.group_ref stage p; add_option X.option_name; Parameter_customize.reset (); if is_dynamic then let plugin = empty_string in Dynamic.register ~plugin X.option_name Typed_parameter.ty ~journalize:false p else p end module Empty_string(X: Parameter_sig.Input_with_arg) = String(struct include X let default = empty_string end) (* ************************************************************************ *) (** {3 Filepath} *) (* ************************************************************************ *) module Fc_Filepath = Filepath module Filepath (X: sig include Parameter_sig.Input_with_arg val existence : Parameter_sig.existence end) = struct exception No_file exception File_exists include Build (struct include Datatype.Filepath include X let default () = Filepath.Normalized.unknown let functor_name = "Filepath" end) let check_existence existence fp = match existence with | Parameter_sig.Indifferent -> () | Parameter_sig.Must_exist -> if not (Sys.file_exists (Filepath.Normalized.to_pretty_string fp)) then raise No_file | Parameter_sig.Must_not_exist -> if Sys.file_exists (Filepath.Normalized.to_pretty_string fp) then raise File_exists let existence = X.existence let convert f oldstr newstr = let oldfp = Filepath.Normalized.to_pretty_string oldstr in let newfp = Filepath.Normalized.to_pretty_string newstr in f oldfp newfp let set fp = check_existence existence fp ; set fp let set_str s = set (Filepath.Normalized.of_string s) let add_option name = Cmdline.add_option name ~argname:X.arg_name ~help:X.help ~visible:is_visible ~ext_help:!Parameter_customize.optional_help_ref ~plugin:P.shortname ~group stage (Cmdline.String set_str) let parameter_get fp = Filepath.Normalized.to_pretty_string (get fp) let parameter_add_set_hook f = add_set_hook (convert f) let parameter_add_update_hook f = add_update_hook (convert f) let parameter = let accessor = Typed_parameter.String ({ Typed_parameter.get = parameter_get; set = set_str; add_set_hook = parameter_add_set_hook; add_update_hook = parameter_add_update_hook }, fun () -> []) in let p = Typed_parameter.create ~name ~help:X.help ~accessor ~is_set in add_parameter !Parameter_customize.group_ref stage p; add_option X.option_name; Parameter_customize.reset (); if is_dynamic then let plugin = empty_string in Dynamic.register ~plugin X.option_name Typed_parameter.ty ~journalize:false p else p end (* ************************************************************************ *) (** {3 Collections} *) (* ************************************************************************ *) type collect_action = Add | Remove exception Cannot_build of string let cannot_build msg = raise (Cannot_build msg) let no_element_of_string msg = cannot_build msg module Make_collection (E: sig (* element in the collection *) type t val ty: t Type.t val of_string: string -> t (* may raise [Cannot_build] *) val to_string: t -> string end) (C: sig (* the collection, as a persistent datastructure *) type t val equal: t -> t -> bool val empty: t val is_empty: t -> bool val mem: E.t -> t -> bool val add: E.t -> t -> t val remove: E.t -> t -> t val iter: (E.t -> unit) -> t -> unit val fold: (E.t -> 'a -> 'a) -> t -> 'a -> 'a val of_singleton_string: string -> t (* For specific ways to parse a collection from a single string. If physically equal to [no_element_of_string], we revert back to using [E.of_string] *) val reorder: t -> t (* Used after having parsed a comma-separated string representing parameters. The add actions are done in the reverse order with respect to the list. Can be [Extlib.id] for unordered collections. *) end) (S: sig (* the collection, as a state *) include State_builder.S val memo: (unit -> C.t) -> C.t val clear: unit -> unit end) (X: (* standard option builder *) sig include Parameter_sig.Input_collection val default: C.t end) = struct type t = C.t type elt = E.t (* ********************************************************************** *) (* Categories *) (* ********************************************************************** *) type category = E.t Parameter_category.t (* the available custom categories for this option *) let available_categories : category Datatype.String.Hashtbl.t = Datatype.String.Hashtbl.create 7 module Category = struct type elt = E.t type t = category let check_category_name s = if Datatype.String.Hashtbl.mem available_categories s || Datatype.String.equal s "all" || Datatype.String.equal s "" || Datatype.String.equal s "default" then P.L.abort "invalid category name '%s'" s let use categories = List.iter (fun c -> Parameter_category.use S.self c; Datatype.String.Hashtbl.add available_categories (Parameter_category.get_name c) c) categories let unsafe_add name states accessor = let c = Parameter_category.create name E.ty ~register:false states accessor in use [ c ]; c let add name states get_values = check_category_name name; unsafe_add name states get_values let none = let o = object method fold: 'b. ('a -> 'b -> 'b) -> 'b -> 'b = (fun _ acc -> acc); method mem = fun _ -> false end in unsafe_add "" [] o let default_ref = let o = object method fold : 'b. ('a -> 'b -> 'b) -> 'b -> 'b = fun f acc -> C.fold f X.default acc method mem x = C.mem x X.default end in let c = unsafe_add "default" [] o in Datatype.String.Hashtbl.add available_categories "default" c; ref c let default () = !default_ref let set_default c = Datatype.String.Hashtbl.replace available_categories "default" c; default_ref := c let all_ref: t ref = ref none let all () = !all_ref let on_enable_all c = (* interpretation may have change: reset the state to force the interpretation again *) S.clear (); all_ref := c let enable_all_as c = use [ c ]; let all = Parameter_category.copy_and_rename "all" ~register:false c in Datatype.String.Hashtbl.add available_categories "all" all; on_enable_all all let enable_all states get_values = let all = unsafe_add "all" states get_values in on_enable_all all; all end (* ********************************************************************** *) (* Parsing *) (* ********************************************************************** *) let use_category = !Parameter_customize.use_category_ref (* parsing builds a list of triples (action, is_category?, word) *) let add_action a l = (a, false, None) :: l let add_char c = function | [] -> assert false | (a, f, None) :: l -> (* first char of a new word *) let b = Buffer.create 7 in Buffer.add_char b c; (a, f, Some b) :: l | ((_, _, Some b) :: _) as l -> (* extend the current word *) Buffer.add_char b c; l let set_category_flag = function | (a, false, None) :: l -> (a, true, None) :: l | _ -> assert false type position = | Start (* the very beginning or after a comma *) | Word of (* action already specified, word is being read *) bool (* [true] iff beginning a category with '@' is allowed *) | Escaped (* the next char is escaped in the current word *) let parse_error msg = P.L.abort "@[@[incorrect argument for option %s@ (%s).@]" X.option_name msg (* return the list of tokens, in reverse order *) let parse s = let len = Pervasives_string.length s in let rec aux acc pos i s = if i = len then acc else let next = i + 1 in let read_char_in_word f_acc new_pos = (* assume 'Add' by default *) let acc = if pos = Start then add_action Add acc else acc in aux (f_acc acc) new_pos next s in let read_std_char_in_word c = read_char_in_word (add_char c) (Word false) in let read_backslash_and_char c = (* read '\\' and [c], without considering than '\\' is the escaping character *) read_char_in_word (fun acc -> add_char c (add_char '\\' acc)) (Word false) in match Pervasives_string.get s i, pos with | '+', Start when use_category -> aux (add_action Add acc) (Word true) next s | '-', Start when use_category -> aux (add_action Remove acc) (Word true) next s | '\\', (Start | Word _) -> read_char_in_word (fun x -> x) Escaped | ',', (Start | Word _) -> read_char_in_word (fun x -> x) Start | (' ' | '\t' | '\n' | '\r'), Start -> (* ignore whitespace at beginning of words (must be escaped) *) aux acc pos next s | '@', (Start | Word true) when use_category -> read_char_in_word set_category_flag (Word false) | c, (Start | Word _) -> read_std_char_in_word c | (',' | '\\' as c), Escaped -> read_std_char_in_word c | ('+' | '-' | '@' | ' ' | '\t' | '\n' | '\r' as c), Escaped when i = 1 -> if use_category then read_std_char_in_word c else read_backslash_and_char c | c, Escaped -> read_backslash_and_char c in aux [] Start 0 s (* ********************************************************************** *) (* The parameter itself, as a special string option *) (* ********************************************************************** *) let string_of_collection c = if C.is_empty c then "" else let b = Buffer.create 17 in let first = ref true in C.iter (fun e -> let s = E.to_string e in if !first then begin if s <> "" then first := false end else Buffer.add_string b ","; Buffer.add_string b (E.to_string e)) c; Buffer.contents b (* a collection is a standard string option... *) module As_string = struct include String(struct include X let default = string_of_collection X.default end) let () = Parameter_state.collections := State.Set.add self !Parameter_state.collections let get () = (* the default string may have a custom interpretation when the category @default has been customized: in that case, interpret "@default" to get it *) if use_category && is_default () then "@default" else get () end (* ... which is cumulative, when set from the cmdline (but uniquely from this way since it is very counter-intuitive from the other ways (i.e. programmatically or the GUI). *) let () = Cmdline.replace_option_setting X.option_name ~plugin:P.shortname ~group:As_string.group (Cmdline.String (fun s -> let old = As_string.get () in As_string.set (if Datatype.String.equal old empty_string then s else old ^ "," ^ s))) (* JS personal note: I'm still not fully convinced by this cumulative semantics. *) let () = (* the typed state depends on the string representation *) State_dependency_graph.add_codependencies ~onto:S.self (As_string.self :: X.dependencies) let check_possible_value elt = let a = Category.all () in if a != Category.none && not (Parameter_category.get_mem a elt) then parse_error ("impossible value " ^ E.to_string elt) (* may be costly: use it with parsimony *) let collection_of_string ~check s = (* Format.printf "READING %s: %s@." X.option_name s;*) let tokens = parse s in (* remember: tokens are in reverse order. So handle the last one first. *) let unparsable, col = List.fold_right (fun (action, is_category, word) (unparsable, col) -> let extend = match action with | Add -> C.add | Remove -> C.remove in let word = match word with | None -> "" | Some b -> Buffer.contents b in (* Format.printf "TOKEN %s@." word;*) if is_category then try let c = Datatype.String.Hashtbl.find available_categories word in if word = "all" then match action with | Add -> unparsable, Parameter_category.get_fold c C.add C.empty | Remove -> (* -@all is always equal to the emptyset, even if there were previous elements which are now impossible *) None, C.empty else unparsable, Parameter_category.get_fold c extend col with Not_found -> parse_error ("unknown category '" ^ word ^ "'") else (* not is_category *) try if C.of_singleton_string == no_element_of_string then begin let elt = E.of_string word in unparsable, extend elt col end else begin let elts = C.of_singleton_string word in unparsable, C.fold extend elts col end with Cannot_build msg -> Some msg, col) tokens (None, C.empty) in let col = C.reorder col in (* check each element after parsing all of them, since an element may be added, then removed later (e.g +h,-@all): that has to be accepted *) if check then begin Extlib.may parse_error unparsable; C.iter check_possible_value col end; col (* ********************************************************************** *) (* Memoized access to the state *) (* ********************************************************************** *) let get_nomemo () = S.memo (fun () -> raise Not_found) let get () = let compute () = let s = As_string.get () in (*let c =*) collection_of_string ~check:true s (*in*) (*Format.printf "GET %s@." (As_string.get ()); C.iter (fun s -> Format.printf "ELT %s@." (E.to_string s)) c; c*) in S.memo compute (* ********************************************************************** *) (* Implement the state, by overseded [As_string]: not the more efficient, but the simplest way that prevent to introduce subtle bugs *) (* ********************************************************************** *) let set c = As_string.set (string_of_collection c) let unsafe_set c = As_string.unsafe_set (string_of_collection c) let convert_and_apply f = fun old new_ -> f (collection_of_string ~check:false old) (collection_of_string ~check:true new_) let add_set_hook f = As_string.add_set_hook (convert_and_apply f) let add_update_hook f = As_string.add_update_hook (convert_and_apply f) (* ********************************************************************** *) (* Implement operations *) (* ********************************************************************** *) let add e = set (C.add e (get ())) let is_empty () = C.is_empty (get ()) let iter f = C.iter f (get ()) let fold f acc = C.fold f (get ()) acc (* ********************************************************************** *) (* Re-export values *) (* ********************************************************************** *) let name = As_string.name let option_name = As_string.option_name let is_default = As_string.is_default let is_set = As_string.is_set let clear = As_string.clear let print_help = As_string.print_help let add_aliases = As_string.add_aliases let self = As_string.self let parameter = As_string.parameter let equal = C.equal let is_computed = S.is_computed let mark_as_computed = S.mark_as_computed (* [Datatype] is fully abstract from outside anyway *) module Datatype = As_string.Datatype (* cannot be called anyway since [Datatype] is abstract *) let howto_marshal _marshal _unmarshal = P.L.abort "[how_to_marshal] cannot be implemented for %s." X.option_name (* same as above *) let add_hook_on_update _ = P.L.abort "[add_hook_on_update] cannot be implemented for %s." X.option_name end module Make_set (E: Parameter_sig.String_datatype_with_collections) (X: sig include Parameter_sig.Input_collection val default: E.Set.t end): sig include Parameter_sig.Set with type elt = E.t and type t = E.Set.t module S: sig val self: State.t end (* typed state *) end = struct module C = struct include E.Set let reorder = Extlib.id let of_singleton_string = E.of_singleton_string end module S = struct include State_builder.Option_ref (E.Set) (struct let name = X.option_name ^ " set" let dependencies = X.dependencies end) let memo f = memo f (* ignore the optional argument *) end include Make_collection(E)(C)(S)(X) (* ********************************************************************** *) (* Accessors *) (* ********************************************************************** *) let mem e = E.Set.mem e (get ()) let exists f = E.Set.exists f (get ()) end module String_for_collection = struct include Datatype.String let of_string = Datatype.identity let to_string = Datatype.identity let of_singleton_string = no_element_of_string end module String_set(X: Parameter_sig.Input_with_arg) = Make_set (String_for_collection) (struct include X let dependencies = [] let default = Datatype.String.Set.empty end) module Filled_string_set (X: sig include Parameter_sig.Input_with_arg val default: Datatype.String.Set.t end) = Make_set (String_for_collection) (struct include X let dependencies = [] end) let check_function s must_exist require_fundecl no_function set = if no_function set then let specific_msg = if require_fundecl then " declaration" else "" in let error s = cannot_build (Format.asprintf "no function%s '%s'" specific_msg s) in if require_fundecl then error s else if must_exist then error s else if !Parameter_customize.is_permissive_ref then begin P.L.warning "ignoring non-existing function%s '%s'." specific_msg s; set end else error s else set module Kernel_function_string( A: sig val accept_fundecl: bool val require_fundecl: bool val must_exist: bool end) = struct include Cil_datatype.Kf let of_string s = try (if A.require_fundecl then !find_kf_decl_by_name else if A.accept_fundecl then !find_kf_by_name else !find_kf_def_by_name) s with Not_found -> cannot_build (Format.asprintf "no%s function '%s'" (if A.accept_fundecl then "" else if A.require_fundecl then " declared" else " defined") s) (* Cannot reuse any code to implement [to_string] without forward reference. Prefer small code duplication here. *) let to_string kf = match kf.fundec with | Definition(d, _) -> d.svar.vname | Declaration(_, vi, _, _) -> vi.vname let of_singleton_string s = let fcts = Parameter_customize.get_c_ified_functions s in let filter keep_def keep_decl = Set.filter (fun s -> match s.fundec with | Definition _ -> keep_def | Declaration _ -> keep_decl) in let res = if A.require_fundecl then filter false true fcts else if A.accept_fundecl then fcts else filter true false fcts in check_function s A.must_exist A.require_fundecl Set.is_empty res end module Kernel_function_set(X: Parameter_sig.Input_with_arg) = struct module A = struct let accept_fundecl = !Parameter_customize.argument_may_be_fundecl_ref let require_fundecl = !Parameter_customize.argument_must_be_fundecl_ref let must_exist = !Parameter_customize.argument_must_be_existing_fun_ref end include Make_set (Kernel_function_string(A)) (struct include X let dependencies = [] let default = Cil_datatype.Kf.Set.empty end) let () = if A.accept_fundecl then Category.enable_all_as (!kf_category ()) else if A.require_fundecl then Category.enable_all_as (!kf_decl_category ()) else Category.enable_all_as (!kf_def_category ()) let () = extend_ast_dependencies S.self end module Fundec_set(X: Parameter_sig.Input_with_arg) = struct let must_exist = !Parameter_customize.argument_must_be_existing_fun_ref let require_fundecl = !Parameter_customize.argument_must_be_fundecl_ref include Make_set (struct include Cil_datatype.Fundec let of_string s = try let kf = !find_kf_def_by_name s in match kf.fundec with | Definition (f, _) -> f | Declaration _ -> assert false with Not_found -> cannot_build (Format.asprintf "no defined function '%s'" s) let to_string f = f.svar.vname let of_singleton_string s = let fcts = Parameter_customize.get_c_ified_functions s in let defs = Cil_datatype.Kf.Set.fold (fun s acc -> match s.fundec with | Definition(f,_) -> Set.add f acc | Declaration _ -> acc) fcts Set.empty in check_function s must_exist require_fundecl Set.is_empty defs end) (struct include X let dependencies = [] let default = Cil_datatype.Fundec.Set.empty end) let () = Category.enable_all_as (!fundec_category ()) let () = extend_ast_dependencies S.self end module Make_list (E: sig include Parameter_sig.String_datatype val of_singleton_string: string -> t list end) (X: sig include Parameter_sig.Input_collection val default: E.t list end): Parameter_sig.List with type elt = E.t and type t = E.t list = struct module C = struct include Datatype.List(E) let empty = [] let is_empty l = l == [] let add (x:E.t) l = x :: l let mem = List.mem let remove x l = List.filter (fun y -> not (E.equal x y)) l let iter = List.iter let fold f l acc = List.fold_left (fun acc x -> f x acc) acc l let reorder = List.rev let of_singleton_string = E.of_singleton_string end module S = struct include State_builder.Option_ref (C) (struct let name = X.option_name ^ " list" let dependencies = X.dependencies end) let memo f = memo f (* ignore the optional argument *) end include Make_collection(E)(C)(S)(X) (* ********************************************************************** *) (* Accessors *) (* ********************************************************************** *) let append_before l = set (l @ get ()) let append_after l = set (get () @ l) end module String_list(X: Parameter_sig.Input_with_arg) = Make_list (String_for_collection) (struct include X let dependencies = [] let default = [] end) module Make_map (K: Parameter_sig.String_datatype_with_collections) (V: Parameter_sig.Value_datatype with type key = K.t) (X: sig include Parameter_sig.Input_collection val default: V.t K.Map.t end) = struct type key = K.t type value = V.t let find_ref = ref (fun _ -> assert false) let of_val ~key k ~prev v = try V.of_string ~key ~prev v with Cannot_build s -> cannot_build (Format.asprintf "@[value bound to '%s':@ %s@]" k s) module Pair = struct include Datatype.Pair(K)(Datatype.Option(V)) let of_string = let r = Str.regexp_string ":" in fun s -> match Str.bounded_split_delim r s 2 with | [] -> cannot_build ("cannot interpret '" ^ s ^ "'") | [ k ] -> let key = K.of_string k in let prev = try Some (!find_ref key) with Not_found -> None in key, of_val ~key k ~prev None | [ k; v ] -> let key = K.of_string k in let prev = try Some (!find_ref key) with Not_found -> None in key, of_val ~key k ~prev (Some v) | _ :: _ :: _ :: _ -> (* by definition of [Str.bounded_split_delim]: *) assert false let to_string (key, v) = let v = V.to_string ~key v in let delim, v = match v with | None -> "", "" | Some v -> ":", v in Format.asprintf "%s%s%s" (K.to_string key) delim v end module C = struct type t = V.t K.Map.t let equal = K.Map.equal V.equal let empty = K.Map.empty let is_empty = K.Map.is_empty let add (k, v) m = match v with | None -> (* no value associated to the key: remove the previous binding *) K.Map.remove k m | Some v -> try let old = K.Map.find k m in if V.equal old v then m else begin P.L.warning "@[option %s:@ '%a' previously bound to '%a';@ \ now bound to '%a'.@]" X.option_name K.pretty k V.pretty old V.pretty v; K.Map.add k v m end with Not_found -> K.Map.add k v m let mem (k, _v) m = K.Map.mem k m let remove (k, _v) m = K.Map.remove k m let iter f m = K.Map.iter (fun k v -> f (k, Some v)) m let fold f m acc = K.Map.fold (fun k v -> f (k, Some v)) m acc let reorder = Extlib.id exception Found of V.t let of_singleton_string = let r = Str.regexp "\\([^:]\\|^\\):\\([^:]\\|$\\)" in (* delimiter is no more than 3 characters long, the first belonging to the element before it, the third belonging to the element after it. Treats :: as part of a word to be able to handle C++ function names in a non too awkward manner. *) let split_delim d = (* handle different possible length of the delimiter *) let rbis = Str.regexp ":" in match Str.bounded_full_split rbis d 2 with | [ Str.Delim _] -> (empty_string, empty_string) | [ Str.Delim _; Str.Text t2 ] -> (empty_string, t2) | [ Str.Text t1; Str.Delim _; ] -> (t1, empty_string) | [ Str.Text t1; Str.Delim _; Str.Text t2 ] -> (t1, t2) | _ -> (* impossible case *) raise (Cannot_build ("delimiter="^d)) in let k_of_singleton_string = if (K.of_singleton_string==no_element_of_string) then (fun x -> K.Set.singleton (K.of_string x)) else K.of_singleton_string in fun s -> let (keys, value) = let get_pairing k v_opt = let keys = k_of_singleton_string k in let key = ref None in let prev = try K.Set.iter (fun k -> key := Some k; (* choose any previous value, whatever it is: don't know which clear semantics one would like *) try raise (Found (!find_ref k)) with Not_found -> ()) keys; (* assume there is always at least a key *) None with Found v -> Some v in match !key with | None -> K.Set.empty, None | Some key -> keys, of_val ~key k ~prev v_opt in match Str.bounded_full_split r s 2 with | ([] | [ Str.Text _ ]) -> (* no delimiter ':' *) get_pairing s None | [ Str.Delim d ] -> let (f,s) = split_delim d in get_pairing f (Some s) | [ Str.Delim d; Str.Text t ] -> let (f,s) = split_delim d in get_pairing f (Some (s ^ t)) | [ Str.Text t1; Str.Delim d; Str.Text t2 ] -> let (f,s) = split_delim d in get_pairing (t1 ^ f) (Some (s ^ t2)) | [ Str.Text t; Str.Delim d] -> let (f,s) = split_delim d in get_pairing (t ^ f) (Some s) | _ -> (* by definition of [Str.bounded_full_split]: *) assert false in K.Set.fold (fun key map -> add (key, value) map) keys K.Map.empty end module S = struct include State_builder.Option_ref (K.Map.Make(V)) (struct let name = X.option_name ^ " map" let dependencies = X.dependencies end) let memo f = memo f (* ignore the optional argument *) end include Make_collection(Pair)(C)(S)(X) (* ********************************************************************** *) (* Accessors *) (* ********************************************************************** *) let find k = K.Map.find k (get ()) let mem k = K.Map.mem k (get ()) let () = find_ref := (fun k -> K.Map.find k (get_nomemo ())) end module String_map (V: Parameter_sig.Value_datatype with type key = string) (X: sig include Parameter_sig.Input_with_arg val default: V.t Datatype.String.Map.t end) = Make_map (String_for_collection) (V) (struct include X let dependencies = [] end) module Kernel_function_map (V: Parameter_sig.Value_datatype with type key = kernel_function) (X: sig include Parameter_sig.Input_with_arg val default: V.t Cil_datatype.Kf.Map.t end) = struct module A = struct let accept_fundecl = !Parameter_customize.argument_may_be_fundecl_ref let require_fundecl = !Parameter_customize.argument_must_be_fundecl_ref let must_exist = !Parameter_customize.argument_must_be_existing_fun_ref end include Make_map (Kernel_function_string(A)) (V) (struct include X let dependencies = [] end) let () = extend_ast_dependencies S.self end module Make_multiple_map (K: Parameter_sig.String_datatype_with_collections) (V: Parameter_sig.Multiple_value_datatype with type key = K.t) (X: sig include Parameter_sig.Input_collection val default: V.t list K.Map.t end) = struct type key = K.t type value = V.t let find_ref = ref (fun _ -> assert false) let of_val ~key k ~prev v = try V.of_string ~key ~prev v with Cannot_build s -> cannot_build (Format.asprintf "@[value bound to '%s':@ %s@]" k s) module Pair = struct include Datatype.Pair(K)(Datatype.List(V)) let of_string = let r = Str.regexp_string ":" in fun s -> match Str.split_delim r s with | [] -> cannot_build ("cannot interpret '" ^ s ^ "'") | k :: l -> let key = K.of_string k in let prev = try Some (!find_ref key) with Not_found -> None in let l = match l with | [] -> (match of_val ~key k ~prev None with | None -> [] | Some v -> [ v ]) | _ :: _ -> List.fold_right (* preserve order *) (fun v acc -> match of_val ~key k ~prev (Some v) with | None -> acc | Some v -> v :: acc) l [] in key, l let to_string (key, l) = Format.asprintf "%s%t" (K.to_string key) (fun fmt -> let rec pp_custom_list = function | [] -> () | v :: l -> Extlib.may (fun v -> Format.fprintf fmt ":%s" v) (V.to_string ~key (Some v)); pp_custom_list l in pp_custom_list l) end module C = struct type t = V.t list K.Map.t let equal = K.Map.equal (List.for_all2 V.equal) let empty = K.Map.empty let is_empty = K.Map.is_empty let add (k, l) m = try let l' = K.Map.find k m in K.Map.add k (l @ l') m with Not_found -> K.Map.add k l m let mem (k, _) m = K.Map.mem k m let remove (k, _) m = K.Map.remove k m let iter f m = K.Map.iter (fun k l -> f (k, l)) m let fold f m acc = K.Map.fold (fun k v -> f (k, v)) m acc let reorder = Extlib.id exception Found of V.t list let of_singleton_string = let k_of_singleton_string = if (K.of_singleton_string==no_element_of_string) then (fun x -> K.Set.singleton (K.of_string x)) else K.of_singleton_string in let r = Str.regexp "[^:]:[^:]" in let split_delim d = (Pervasives_string.sub d 0 1, Pervasives_string.sub d 2 1) in let remove_none_and_rev l = List.fold_left (fun acc v -> match v with None -> acc | Some v -> v :: acc) [] l in let rec parse_values ~key k ~prev acc s = function | [] -> remove_none_and_rev (of_val ~key k ~prev (Some s) :: acc) | [Str.Text t] -> remove_none_and_rev (of_val ~key k ~prev (Some (s ^ t)) :: acc) | Str.Text t :: Str.Delim d :: l -> let (suf, pre) = split_delim d in let v = of_val ~key k ~prev (Some (s ^ t ^ suf)) in parse_values ~key k ~prev (v :: acc) pre l | Str.Delim d :: l -> let (suf,pre) = split_delim d in let v = of_val ~key k ~prev (Some (s ^ suf)) in parse_values ~key k ~prev (v :: acc) pre l | Str.Text _ :: Str.Text _ :: _ -> (* By construction, there must be a Delim between two consecutive Text in the value returned by full_split *) assert false in fun s -> let (keys, values) = let get_pairing k v l = let keys = k_of_singleton_string k in let key = ref None in let prev = try K.Set.iter (fun k -> key := Some k; (* choose any previous value, whatever it is: don't know which clear semantics one would like *) try raise (Found (!find_ref k)) with Not_found -> ()) keys; None with Found v -> Some v in match !key with | None -> K.Set.empty, [] | Some key -> keys, parse_values ~key k ~prev [] v l in match Str.full_split r s with | [] -> cannot_build ("cannot interpret '" ^ s ^ "'") | [Str.Text t] -> k_of_singleton_string t, [] | Str.Delim d :: l -> let (f,s) = split_delim d in get_pairing f s l | Str.Text t :: Str.Delim d :: l -> let (f,s) = split_delim d in get_pairing (t ^ f) s l | Str.Text _ :: Str.Text _ :: _ -> (* see above *) assert false in K.Set.fold (fun key map -> K.Map.add key values map) keys K.Map.empty end module S = struct include State_builder.Option_ref (K.Map.Make(Datatype.List(V))) (struct let name = X.option_name ^ " map" let dependencies = X.dependencies end) let memo f = memo f (* ignore the optional argument *) end include Make_collection(Pair)(C)(S)(X) (* ********************************************************************** *) (* Accessors *) (* ********************************************************************** *) let find k = K.Map.find k (get ()) let mem k = K.Map.mem k (get ()) let () = find_ref := (fun k -> K.Map.find k (get_nomemo ())) end module String_multiple_map (V: Parameter_sig.Multiple_value_datatype with type key = string) (X: sig include Parameter_sig.Input_with_arg val default: V.t list Datatype.String.Map.t end) = Make_multiple_map (String_for_collection) (V) (struct include X let dependencies = [] end) module Kernel_function_multiple_map (V: Parameter_sig.Multiple_value_datatype with type key = kernel_function) (X: sig include Parameter_sig.Input_with_arg val default: V.t list Cil_datatype.Kf.Map.t end) = struct module A = struct let accept_fundecl = !Parameter_customize.argument_may_be_fundecl_ref let require_fundecl = !Parameter_customize.argument_must_be_fundecl_ref let must_exist = !Parameter_customize.argument_must_be_existing_fun_ref end include Make_multiple_map (Kernel_function_string(A)) (V) (struct include X let dependencies = [] end) let () = extend_ast_dependencies S.self end (** Options that directly cause an output. *) module WithOutput (X: sig include Parameter_sig.Input val output_by_default: bool end) = struct (* Requested command-line option *) include False(X) (* Command-line option for output. *) let () = Parameter_customize.set_group P.messages_group module Output = Bool(struct let default = X.output_by_default let option_name = X.option_name ^ "-print" let help = "print results for option " ^ X.option_name end) (* Boolean that indicates whether the results have never been output in the current mode. As usual, change in dependencies automatically reset the value *) module ShouldOutput = State_builder.True_ref(struct let dependencies = [] (* To be filled by the user when calling the output function *) let name = X.option_name ^ "ShouldOutput" end) (* Output has been requested by the user. Set the "output should be printed" boolean to true *) let () = Output.add_set_hook (fun _ v -> if v then ShouldOutput.set true) let set_output_dependencies deps = State_dependency_graph.add_codependencies ~onto:ShouldOutput.self deps let output f = (* Output only if our two booleans are at true *) if Output.get () && ShouldOutput.get () then begin (* One output will occur, do not output anything next time (unless dependencies change, or the user requests it on the command-line) *) ShouldOutput.set false; f (); end let add_aliases list = add_aliases list; Output.add_aliases (List.map (fun alias -> alias ^ "-print") list) end end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/parameter_builder.mli0000666000000000000000000000572313571573400025223 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Functors for implementing new command line options. *) (* ************************************************************************* *) (** {2 Kernel use only} *) (* ************************************************************************* *) module Make (P: sig val shortname: string val parameters: (string, Typed_parameter.t list) Hashtbl.t module L: sig val abort: ('a,'b) Log.pretty_aborter val warning: 'a Log.pretty_printer end val messages_group: Cmdline.Group.t end): Parameter_sig.Builder (* ************************************************************************* *) (** {2 Internal use only} *) (* ************************************************************************* *) open Cil_types val find_kf_by_name: (string -> kernel_function) ref val find_kf_def_by_name: (string -> kernel_function) ref val find_kf_decl_by_name: (string -> kernel_function) ref val kf_category: (unit -> kernel_function Parameter_category.t) ref val kf_def_category: (unit -> kernel_function Parameter_category.t) ref val kf_decl_category: (unit -> kernel_function Parameter_category.t) ref val kf_string_category: (unit -> string Parameter_category.t) ref val fundec_category: (unit -> fundec Parameter_category.t) ref val force_ast_compute: (unit -> unit) ref val ast_dependencies: State.t list ref (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/parameter_category.ml0000666000000000000000000000717613571573400025245 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type 'a accessor = < fold:'acc. ('a -> 'acc -> 'acc) -> 'acc -> 'acc (* folder on elements *); mem:('a -> bool) (* mem *) > type 'a category = { name: string; ty: 'a Type.t; fold: 'b. ('a -> 'b -> 'b) -> 'b -> 'b; mem: 'a -> bool; mutable states: State.t list } type 'a t = 'a category module Categories = struct module By_name = Type.String_tbl(struct type 'a t = 'a category end) (* categories are indexed by [ty] and [name]. To be typable, the [ty] is encoded by its digest, which is a string *) let tbl : By_name.t Datatype.String.Hashtbl.t = Datatype.String.Hashtbl.create 7 let check c = try let internal = Datatype.String.Hashtbl.find tbl (Type.digest c.ty) in try ignore (By_name.find internal c.name c.ty); (* just a warning for compatibility purpose: E.g if the kernel creates a new standard category at release N, then plug-ins which already create this category at release N-1 would be warned, but still work as before. *) Cmdline.Kernel_log.warning "overriding category `%s' for type `%s'" c.name (Type.name c.ty) with | By_name.Unbound_value _ -> () | By_name.Incompatible_type _ -> assert false with Not_found -> () let add c = check c; let internal = try Datatype.String.Hashtbl.find tbl (Type.digest c.ty) with Not_found -> By_name.create 7 in By_name.add internal c.name c.ty c end let create name ty ~register states (accessor: 'a accessor) = let c = { name; ty; fold = (fun x acc -> accessor#fold x acc); mem = accessor#mem; states } in if register then Categories.add c else Categories.check c; c let copy_and_rename name ~register c = let c = { c with name } in if register then Categories.add c else Categories.check c; c let use state c = State_dependency_graph.add_codependencies ~onto:state c.states let get_name c = c.name let get_fold c = c.fold let get_mem c = c.mem (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/parameter_category.mli0000666000000000000000000000617513571573400025414 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Category for parameter collections. A category groups together a set of possible values of a given type for some parameters. It may be created once and used several times. *) type 'a t (** [\tau t] is the type of a category for the type \tau. *) type 'a accessor = < fold:'acc. ('a -> 'acc -> 'acc) -> 'acc -> 'acc (* fold on elements *); mem:('a -> bool) (* mem *) > (** Type explaining how to manipulate the elements of the category. *) val create: string -> 'a Type.t -> register:bool -> State.t list -> 'a accessor -> 'a t (** [create name ty ~register states access] creates a category of the given name for the given type. No category with such a name for the same type must be already registered. If [register], save the category for further re-use. [states] is a list of states which the category is based upon. [access] is how to manipulate this category. *) val copy_and_rename: string -> register:bool -> 'a t -> 'a t (** [copy_and_rename s ~register c] renames the category [c] into [s] and returns the new built category which is registered according to [register]. *) val use: State.t -> 'a t -> unit (** [use s c] indicates that the state [s] depends on the category [c]. *) val get_name: 'a t -> string (** Name of the category. *) val get_fold: 'a t -> ('a -> 'acc -> 'acc) -> 'acc -> 'acc (** Fold over the elements of the given category. *) val get_mem: 'a t -> 'a -> bool (** Is the given element present in the category? *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/parameter_customize.ml0000666000000000000000000001201513571573400025436 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let empty_string = "" let cmdline_stage_ref = ref Cmdline.Configuring let set_cmdline_stage s = cmdline_stage_ref := s let journalize_ref = ref true let do_not_journalize () = journalize_ref := false let negative_option_name_ref = ref None let set_negative_option_name s = negative_option_name_ref := Some s let negative_option_help_ref = ref empty_string let set_negative_option_help s = negative_option_help_ref := s let unset_option_name_ref = ref empty_string let set_unset_option_name s = unset_option_name_ref := s let unset_option_help_ref = ref empty_string let set_unset_option_help s = unset_option_help_ref := s let must_save_ref = ref true let do_not_save () = must_save_ref := false let reset_on_copy_ref = ref true let do_not_reset_on_copy () = reset_on_copy_ref := false let projectify_ref = ref true let do_not_projectify () = projectify_ref := false; do_not_save (); do_not_reset_on_copy () let empty_format = ("": (unit, Format.formatter, unit) format) let optional_help_ref = ref empty_format let set_optional_help fmt = optional_help_ref := fmt let set_optional_help fmt = Cmdline.Kernel_log.deprecated "Plugin.set_optional_help" ~now:"" set_optional_help fmt let module_name_ref = ref empty_string let set_module_name s = module_name_ref := s let argument_is_function_name_ref = ref false let argument_is_function_name () = argument_is_function_name_ref := true let argument_may_be_fundecl_ref = ref false let argument_may_be_fundecl () = argument_may_be_fundecl_ref := true let argument_must_be_fundecl_ref = ref false let argument_must_be_fundecl () = argument_must_be_fundecl_ref := true let argument_must_be_existing_fun_ref = ref false let argument_must_be_existing_fun () = argument_must_be_existing_fun_ref := true let group_ref = ref Cmdline.Group.default let set_group s = group_ref := s let do_iterate_ref = ref None let do_iterate () = do_iterate_ref := Some true let do_not_iterate () = do_iterate_ref := Some false let is_visible_ref = ref true let is_invisible () = is_visible_ref := false; do_not_iterate () let use_category_ref = ref true let no_category () = use_category_ref := false let is_permissive_ref = ref false let find_kf_by_name: (string -> Cil_types.kernel_function) ref = Extlib.mk_fun "Parameter_customize.find_kf_by_name" let plain_fct_finder s = try Cil_datatype.Kf.Set.singleton (!find_kf_by_name s) with Not_found -> Cil_datatype.Kf.Set.empty let mangling_functions = ref [plain_fct_finder] let get_c_ified_functions s = List.fold_left (fun acc f -> Cil_datatype.Kf.Set.union (f s) acc) Cil_datatype.Kf.Set.empty !mangling_functions let add_function_name_transformation f = mangling_functions := f :: !mangling_functions let reset () = cmdline_stage_ref := Cmdline.Configuring; journalize_ref := true; negative_option_name_ref := None; negative_option_help_ref := empty_string; unset_option_name_ref:= empty_string; unset_option_help_ref:= empty_string; optional_help_ref := empty_format; projectify_ref := true; must_save_ref := true; module_name_ref := empty_string; group_ref := Cmdline.Group.default; do_iterate_ref := None; is_visible_ref := true; argument_is_function_name_ref := false; argument_may_be_fundecl_ref := false; argument_must_be_fundecl_ref := false; argument_must_be_existing_fun_ref := false; reset_on_copy_ref := true; use_category_ref := true (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/parameter_customize.mli0000666000000000000000000002277513571573400025625 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Configuration of command line options. You can apply the functions below just before applying one of the functors provided by the functor {!Plugin.Register} and generating a new parameter. @plugin development guide *) val set_cmdline_stage: Cmdline.stage -> unit (** Set the stage where the option corresponding to the parameter is recognized. Default is [Cmdline.Configuring]. @since Beryllium-20090601-beta1 *) val do_not_journalize: unit -> unit (** Prevent journalization of the parameter. @since Beryllium-20090601-beta1 *) val do_not_projectify: unit -> unit (** Prevent projectification of the parameter: its state is shared by all the existing projects. Also imply {!do_not_save} and {!do_not_reset_on_copy}. @since Beryllium-20090601-beta1 *) val do_not_reset_on_copy: unit -> unit (** Prevents resetting the parameter to its default value when creating a project from a copy visitor. @since Neon-20140301 *) val do_not_save: unit -> unit (** Prevent serialization of the parameter. @since Carbon-20110201 *) val set_negative_option_name: string -> unit (** For boolean parameters, set the name of the negative option generating automatically from the positive one (the given option name). The default used value prefixes the given option name by "-no". Assume that the given string is a valid option name or empty. If it is empty, no negative option is created. @since Beryllium-20090601-beta1 @plugin development guide *) val set_negative_option_help: string -> unit (** For boolean parameters, set the help message of the negative option generating automatically. Assume that the given string is non empty. @since Beryllium-20090601-beta1 *) val set_unset_option_name: string -> unit (** For string collection parameters, set the name of an option that will remove elements from the set. There is no default value: if the this function is not called (or if it is the empty string), it will only be possible to add elements from the command line. @since Fluorine-20130401 *) val set_unset_option_help: string -> unit (** For string collection parameters, gives the help message for the corresponding unset option. Useless if [set_unset_option_name] has not been called before. No default. @since Fluorine-20130401 *) val set_optional_help: (unit, Format.formatter, unit) format -> unit (** Concatenate an additional description just after the default one. @since Beryllium-20090601-beta1 @deprecated since Oxygen-20120901: directly use the help string instead. *) val set_group: Cmdline.Group.t -> unit (** Affect a group to the parameter. @since Beryllium-20090901 *) val is_invisible: unit -> unit (** Prevent the help to list the parameter. Also imply {!do_not_iterate}. @since Carbon-20101201 @modify Nitrogen-20111001 does not appear in the help *) val argument_is_function_name: unit -> unit (** Indicate that the string argument of the parameter must be a valid function name. A valid function name is the name of a function defined in the analysed C program. Do nothing if the following applied functor has not type [String]. @since Oxygen-20120901 @modify Sodium-20150201 do nothing when applied to [String_set] or [String_list]. *) val argument_may_be_fundecl: unit -> unit (** Indicate that the argument of the parameter can match a valid function declaration (otherwise it has to match a defined functions). @since Sodium-20150201 *) val argument_must_be_fundecl: unit -> unit (** Indicate that the argument of the parameter must match a valid function declaration. @since Aluminium-20160501 *) val argument_must_be_existing_fun: unit -> unit (** Indicate that if the argument of the parameter does not match a valid function name, it raises an error whatever the value of the option -permissive is. Only meaningful for parameters that are collections of [kernel_function] or [fundec]. This flag {b does not} imply [argument_may_be_fundecl]. If the latter is unset, names of defined-only functions will raise an error as well. @since Sodium-20150201 *) val do_iterate: unit -> unit (** Ensure that {!iter_on_plugins} is applied to this parameter. By default only parameters corresponding to options registered at the {!Cmdline.Configuring} stage are iterable. @since Nitrogen-20111001 *) val do_not_iterate: unit -> unit (** Prevent {!iter_on_plugins} to be applied on the parameter. By default, only parameters corresponding to options registered at the {!Cmdline.Configuring} stage are iterable. @since Nitrogen-20111001 *) val no_category: unit -> unit (** Prevent a collection parameter to use categories and the extension '+', and '-' mechanism. In particular, you should consider this customization when the parameter is a list of '-' prefixed options to an external tool, unless you are willing to let users escape the initial '-' everytime. @since Sodium-20150201 *) val is_permissive_ref: bool ref (** if [true], less checks are performed on value of arguments. Set by {!Kernel.Permissive} option *) (* ************************************************************************* *) (** {2 Function names} *) (* ************************************************************************* *) val get_c_ified_functions: string -> Cil_datatype.Kf.Set.t (** Function names can be modified (aka mangled) from the original source to valid C identifiers. In order to allow users to use the original names on the command-line options manipulating function names, this function will return the set of function whose name correspond to the given string, possibly via a mangling operation registered with the {!add_function_name_transformation} function below. By default, no mangling function is registered, and the returned set is either empty or a singleton corresponding to the unique function with that name. Results from all registered functions are cumulative, so that a mangling function should take care of returning the empty set for names that it does not understand. @since Sodium-20150201 *) val add_function_name_transformation: (string -> Cil_datatype.Kf.Set.t) -> unit (** Adds a mangling operation to allow writing user-friendly function names on command-line. See {!get_c_ified_functions} for more information. @since Sodium-20150201 *) (**/**) (* ************************************************************************* *) (** {2 Internal kernel stuff} *) (* ************************************************************************* *) val reset: unit -> unit (** Reset all customizers to their default values. *) val set_module_name: string -> unit (** For **kernel** parameters, set the name of the module name corresponding to the parameter. Not for casual users. *) val find_kf_by_name: (string -> Cil_types.kernel_function) ref (** @since Sodium-20150201 *) (* ************************************************************************* *) (** {3 The customizers themselves} *) (* ************************************************************************* *) val cmdline_stage_ref: Cmdline.stage ref val journalize_ref: bool ref val negative_option_name_ref: string option ref val negative_option_help_ref: string ref val unset_option_name_ref: string ref val unset_option_help_ref: string ref val must_save_ref: bool ref val reset_on_copy_ref: bool ref val projectify_ref: bool ref val optional_help_ref: (unit, Format.formatter, unit) format ref val argument_is_function_name_ref: bool ref val argument_may_be_fundecl_ref: bool ref val argument_must_be_fundecl_ref: bool ref val argument_must_be_existing_fun_ref: bool ref val group_ref: Cmdline.Group.t ref val do_iterate_ref: bool option ref val is_visible_ref: bool ref val module_name_ref: string ref val use_category_ref: bool ref (**/**) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/parameter_sig.mli0000666000000000000000000005232013571573400024352 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Signatures for command line options. *) (* ************************************************************************** *) (** {2 Input signatures} One of these signatures is required to implement a new command line option. *) (* ************************************************************************** *) (** Minimal signature to implement for each parameter corresponding to an option on the command line argument. *) module type Input = sig val option_name: string (** The name of the option *) val help: string (** A description for this option (e.g. used by -help). If [help = ""], then it has the special meaning "undocumented" *) end (** Minimal signature to implement for each parameter corresponding to an option on the command line argument which requires an argument. *) module type Input_with_arg = sig include Input val arg_name: string (** A standard name for the argument which may be used in the description. If empty, a generic arg_name is generated. *) end (** Minimal signature for collections of custom datatype *) module type Input_collection = sig include Input_with_arg val dependencies: State.t list end (** Signature required to build custom collection parameters in which elements are convertible to string. @since Sodium-20150201 *) module type String_datatype = sig include Datatype.S val of_string: string -> t (** @raise Cannot_build if there is no element corresponding to the given string. *) val to_string: t -> string end (** Signature requires to build custom collection parameters in which elements are convertible to string. @since Sodium-20150201 *) module type String_datatype_with_collections = sig include Datatype.S_with_collections val of_string: string -> t (** @raise Cannot_build if there is no element corresponding to the given string. *) val of_singleton_string: string -> Set.t (** If a single string can be mapped to several elements. Can default to {!no_element_of_string} to indicate that each string [s] is mapped exactly to [of_string s]. *) val to_string: t -> string end (** Signature of the optional value associated to the key and required to build map parameters. @since Sodium-20150201 *) module type Value_datatype = sig include Datatype.S type key val of_string: key:key -> prev:t option -> string option -> t option (** [key] is the key associated to this value, while [prev] is the previous value associated to this key (if any). The optional string is [None] if there is no value associated to the key, and [Some v] (potentially [v = ""]) otherwise. @return None if there is no value to associate to the key or [Some v] otherwise. @raise Cannot_build if there is no element corresponding to the given string. *) val to_string: key:key -> t option -> string option (** [key] is the key associated to this value. The optional string is [None] if there is no value associated to the key, and [Some v] (potentially [v = ""]) otherwise. @return None if there is no value to associate to the key or [Some v] otherwise. *) end (** Signature of the optional value associated to the key and required to build multiple map parameters. Almost similar to {!Value_datatype}. @since Sodium-20150201 *) module type Multiple_value_datatype = sig include Datatype.S type key val of_string: key:key -> prev:t list option -> string option -> t option val to_string: key:key -> t option -> string option end (* ************************************************************************** *) (** {2 Output signatures} Signatures corresponding to a command line option of a specific type. *) (* ************************************************************************** *) (* ************************************************************************** *) (** {3 Generic signatures} *) (* ************************************************************************** *) (** Generic signature of a parameter, without [parameter]. *) module type S_no_parameter = sig type t (** Type of the parameter (an int, a string, etc). It is concrete for each module implementing this signature. *) val set: t -> unit (** Set the option. *) val add_set_hook: (t -> t -> unit) -> unit (** Add a hook to be called after the function {!set} is called. The first parameter of the hook is the old value of the parameter while the second one is the new value. *) val add_update_hook: (t -> t -> unit) -> unit (** Add a hook to be called when the value of the parameter changes (by calling {!set} or indirectly by the project library. The first parameter of the hook is the old value of the parameter while the second one is the new value. Note that it is **not** specified if the hook is applied just before or just after the effective change. @since Nitrogen-20111001 *) val get: unit -> t (** Option value (not necessarily set on the current command line). *) val clear: unit -> unit (** Set the option to its default value, that is the value if [set] was never called. *) val is_default: unit -> bool (** Is the option equal to its default value? *) val option_name: string (** Name of the option on the command-line @since Carbon-20110201 *) val print_help: Format.formatter -> unit (** Print the help of the parameter in the given formatter as it would be printed on the command line by --help. For invisible parameters, the string corresponds to the one returned if it would be not invisible. @since Oxygen-20120901 *) include State_builder.S val equal: t -> t -> bool val add_aliases: string list -> unit (** Add some aliases for this option. That is other option names which have exactly the same semantics that the initial option. @raise Invalid_argument if one of the strings is empty *) (**/**) val is_set: unit -> bool (** Is the function {!set} has already been called since the last call to function {!clear}? This function is for special uses and should mostly never be used. *) val unsafe_set: t -> unit (** Set but without clearing the dependencies.*) (**/**) end (** Generic signature of a parameter. *) module type S = sig include S_no_parameter val parameter: Typed_parameter.t (** @since Nitrogen-20111001 *) end (* ************************************************************************** *) (** {3 Signatures for simple datatypes} *) (* ************************************************************************** *) (** Signature for a boolean parameter. @plugin development guide *) module type Bool = sig include S with type t = bool val on: unit -> unit (** Set the boolean to [true]. *) val off: unit -> unit (** Set the boolean to [false]. *) end (** Signature for an integer parameter. @plugin development guide *) module type Int = sig include S with type t = int val incr: unit -> unit (** Increment the integer. *) val set_range: min:int -> max:int -> unit (** Set what is the possible range of values for this parameter. @since Beryllium-20090901 *) val get_range: unit -> int * int (** What is the possible range of values for this parameter. @since Beryllium-20090901 *) end (** Signature for a string parameter. *) module type String = sig include S with type t = string val set_possible_values: string list -> unit (** Set what are the acceptable values for this parameter. If the given list is empty, then all values are acceptable. @since Beryllium-20090901 *) val get_possible_values: unit -> string list (** What are the acceptable values for this parameter. If the returned list is empty, then all values are acceptable. @since Beryllium-20090901 *) val get_function_name: unit -> string (** returns the given argument only if it is a valid function name (see {!Parameter_customize.get_c_ified_functions} for more information), and abort otherwise. Requires that the AST has been computed. Default getter when {!Parameter_customize.argument_is_function_name} has been called. @since Sodium-20150201 *) val get_plain_string: unit -> string (** always return the argument, even if the argument is not a function name. @since Sodium-20150201 *) end (* ************************************************************************** *) (** {3 Custom signatures} *) (* ************************************************************************** *) (** Signature for a boolean parameter that causes something to be output. *) module type With_output = sig include Bool val set_output_dependencies: State.t list -> unit (** Set the dependencies for the output of the option. Two successive calls to [output] below will cause only one output, unless some of the supplied dependencies have changed between the two calls. *) val output: (unit -> unit) -> unit (** To be used by the plugin to output the results of the option in a controlled way. See [set_output_dependencies] details. *) end (** signature for searching files in a specific directory. *) module type Specific_dir = sig exception No_dir val force_dir: bool (** For functions below: if [force_dir] is true: if [error] is [false], then creates the directory if it does not exist (or raises No_dir if the directory cannot be created). Otherwise ([force_dir = false]), raise No_dir if [error] is [false]. @since Neon-20140301 *) val dir: ?error:bool -> unit -> string (** [dir ~error ()] returns the specific directory name, if any. Otherwise, Frama-C halts on an user error if [error] or if the behavior depends on [force_dir]. Default of [error] is [true]. @raise No_dir if there is no share directory for this plug-in and [not error] and [not force_dir]. *) val file: ?error:bool -> string -> string (** [file basename] returns the complete filename of a file stored in [dir ()]. If there is no such directory, Frama-C halts on an user error if [error] or if the behavior depends on [force_dir]. Default of [error] is [true]. @raise No_dir if there is no share directory for this plug-in and [not error] and [not force_dir]. *) module Dir_name: String (** Option [--]. *) end type existence = Must_exist | Must_not_exist | Indifferent (** signature for normalized pathnames. *) module type Filepath = sig exception No_file (** raised by {!set} if no file exists and [existence] is [Must_exist]. *) exception File_exists (** raised by {!set} if some file exists and [existence] is [Must_nos_exist]. *) val existence: existence include S with type t = Filepath.Normalized.t end (* ************************************************************************** *) (** {3 Collections} *) (* ************************************************************************** *) (** Signature for a category over a collection. @since Sodium-20150201 *) module type Collection_category = sig type elt (** Element in the category *) type t = elt Parameter_category.t val none: t (** The category '\@none' *) val default: unit -> t (** The '\@default' category. By default, it is {!none}. *) val all: unit -> t (** The '\@all' category. If this category has not been created, it is {!none}, which means 'ignored'. @since Silicon-20161101 *) val set_default: t -> unit (** Modify the '\@default' category. *) val add: string -> State.t list -> elt Parameter_category.accessor -> t (** Adds a new category for this collection with the given name, accessor and dependencies. *) val enable_all: State.t list -> elt Parameter_category.accessor -> t (** The category '\@all' is enabled in positive occurrences, with the given interpretation. In negative occurrences, it is always enabled and '-\@all' means 'empty'. *) val enable_all_as: t -> unit (** The category '\@all' is equivalent to the given category. *) end (** Common signature to all collections. @since Sodium-20150201 *) module type Collection = sig include S (** A collection is a standard command line parameter. *) type elt (** Element in the collection. *) val is_empty: unit -> bool (** Is the collection empty? *) val iter: (elt -> unit) -> unit (** Iterate over all the elements of the collection. *) val fold: (elt -> 'a -> 'a) -> 'a -> 'a (** Fold over all the elements of the collection. *) val add: elt -> unit (** Add an element to the collection *) module As_string: String (** A collection is a standard string parameter *) module Category: Collection_category with type elt = elt (** Categories for this collection. *) end (** Signature for sets as command line parameters. @since Sodium-20150201 *) module type Set = sig include Collection (** A set is a collection. *) (** {3 Additional accessors to the set.} *) val mem: elt -> bool (** Does the given element belong to the set? *) val exists: (elt -> bool) -> bool (** Is there some element satisfying the given predicate? *) end (** @modify Sodium-20150201 *) module type String_set = Set with type elt = string and type t = Datatype.String.Set.t (** Set of defined kernel functions. If you want to also include pure prototype, use {!Parameter_customize.argument_may_be_fundecl}. @since Sodium-20150201 @plugin development guide *) module type Kernel_function_set = Set with type elt = Cil_types.kernel_function and type t = Cil_datatype.Kf.Set.t (** @since Sodium-20150201 *) module type Fundec_set = Set with type elt = Cil_types.fundec and type t = Cil_datatype.Fundec.Set.t (** Signature for lists as command line parameters. @since Sodium-20150201 *) module type List = sig include Collection (** A list is a collection. *) (** {3 Additional accessors to the list.} *) val append_before: t -> unit (** append a list in front of the current state @since Neon-20140301 *) val append_after: t -> unit (** append a list at the end of the current state @since Neon-20140301 *) end (** @modify Sodium-20150201 *) module type String_list = List with type elt = string and type t = string list (** Signature for maps as command line parameters. @since Sodium-20150201 *) module type Map = sig type key (** Type of keys of the map. *) type value (** Type of the values associated to the keys. *) include Collection with type elt = key * value option (** A map is a collection in which elements are pairs [(key, value)], but some values may be missing. *) (** {3 Additional accessors to the map.} *) val find: key -> value (** Search a given key in the map. @raise Not_found if there is no such key in the map. *) val mem: key -> bool end (** Signature for multiple maps as command line parameters. Almost similar to {!Map}. @since Sodium-20150201 *) module type Multiple_map = sig type key type value include Collection with type elt = key * value list val find: key -> value list val mem: key -> bool end (* ************************************************************************** *) (** {2 All the different kinds of command line options as functors} *) (* ************************************************************************** *) (** Signatures containing the different functors which may be used to generate new command line options. @plugin development guide *) module type Builder = sig val no_element_of_string: string -> 'a (** @raise Cannot_build for any entry @since Sodium-20150201 *) module Bool(X:sig include Input val default: bool end): Bool module Action(X: Input) : Bool (** @plugin development guide *) module False(X: Input) : Bool (** @plugin development guide *) module True(X: Input) : Bool module WithOutput (X: sig include Input val output_by_default: bool end): With_output (** @plugin development guide *) module Int(X: sig include Input_with_arg val default: int end): Int (** @plugin development guide *) module Zero(X: Input_with_arg): Int (** @plugin development guide *) module String(X: sig include Input_with_arg val default: string end): String (** @plugin development guide *) module Empty_string(X: Input_with_arg): String module Fc_Filepath = Filepath module Filepath(X: sig include Input_with_arg val existence: existence end): Filepath exception Cannot_build of string module Make_set (E: sig include String_datatype_with_collections val of_singleton_string: string -> Set.t end) (X: sig include Input_collection val default: E.Set.t end): Set with type elt = E.t and type t = E.Set.t (** @plugin development guide *) module String_set(X: Input_with_arg): String_set module Filled_string_set (X: sig include Input_with_arg val default: Datatype.String.Set.t end): String_set (** @plugin development guide *) module Kernel_function_set(X: Input_with_arg): Kernel_function_set module Fundec_set(X: Input_with_arg): Fundec_set module Make_list (E: sig include String_datatype val of_singleton_string: string -> t list end) (X: sig include Input_collection val default: E.t list end): List with type elt = E.t and type t = E.t list module String_list(X: Input_with_arg): String_list (** Parameter is a map where multibindings are **not** allowed. *) module Make_map (K: String_datatype_with_collections) (V: Value_datatype with type key = K.t) (X: sig include Input_collection val default: V.t K.Map.t end): Map with type key = K.t and type value = V.t and type t = V.t K.Map.t module String_map (V: Value_datatype with type key = string) (X: sig include Input_with_arg val default: V.t Datatype.String.Map.t end): Map with type key = string and type value = V.t and type t = V.t Datatype.String.Map.t (** As for Kernel_function_set, by default keys can only be defined functions. Use {!Parameter_customize.argument_may_be_fundecl} to also include pure prototypes. *) module Kernel_function_map (V: Value_datatype with type key = Cil_types.kernel_function) (X: sig include Input_with_arg val default: V.t Cil_datatype.Kf.Map.t end): Map with type key = Cil_types.kernel_function and type value = V.t and type t = V.t Cil_datatype.Kf.Map.t (** Parameter is a map where multibindings are allowed. *) module Make_multiple_map (K: String_datatype_with_collections) (V: Multiple_value_datatype with type key = K.t) (X: sig include Input_collection val default: V.t list K.Map.t end): Multiple_map with type key = K.t and type value = V.t and type t = V.t list K.Map.t module String_multiple_map (V: Multiple_value_datatype with type key = string) (X: sig include Input_with_arg val default: V.t list Datatype.String.Map.t end): Multiple_map with type key = string and type value = V.t and type t = V.t list Datatype.String.Map.t (** As for Kernel_function_set, by default keys can only be defined functions. Use {!Parameter_customize.argument_may_be_fundecl} to also include pure prototypes. *) module Kernel_function_multiple_map (V: Multiple_value_datatype with type key = Cil_types.kernel_function) (X: sig include Input_with_arg val default: V.t list Cil_datatype.Kf.Map.t end): Multiple_map with type key = Cil_types.kernel_function and type value = V.t and type t = V.t list Cil_datatype.Kf.Map.t val parameters: unit -> Typed_parameter.t list end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/parameter_state.ml0000666000000000000000000002315513571573400024543 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************* *) (** {2 Handling group of parameters} *) (* ************************************************************************* *) let selection : (State.t * bool) list ref = ref [] let no_reset_selection: (State.t * bool) list ref = ref [] let collections: State.Set.t ref = ref State.Set.empty let get_selection_gen ?(is_set=true) selection = let l = if is_set then List.rev (List.rev_map fst selection) else List.fold_left (fun acc (x, b) -> if b then acc else x :: acc) [] selection in State_selection.of_list l let get_selection ?is_set () = get_selection_gen ?is_set !selection let get_selection_context ?is_set () = let has_dependencies s = (* each collection whose state is a string has at least 1 dependency which is its typed state. *) let degree = if State.Set.mem s !collections then 1 else 0 in State_dependency_graph.G.out_degree State_dependency_graph.graph s > degree in (* automatically select all options that have some dependencies: they have an impact on some analysis. *) let states = State_selection.fold (fun s acc -> if has_dependencies s then s :: acc else acc) (get_selection ?is_set ()) [] in State_selection.of_list states let get_reset_selection ?is_set () = let all = get_selection ?is_set () in let no_reset = get_selection_gen ?is_set !no_reset_selection in State_selection.diff all no_reset let extend_selection is_set s = selection := (s, is_set) :: !selection let extend_no_reset_selection is_set s = no_reset_selection := (s,is_set) :: !no_reset_selection (* ************************************************************************* *) (** {2 Generic implementation} *) (* ************************************************************************* *) module Make (P: sig val shortname: string end) (X: sig include Datatype.S val default: unit -> t val option_name: string val functor_name: string end) = struct let is_dynamic = true let projectify = !Parameter_customize.projectify_ref let reset_on_copy = !Parameter_customize.reset_on_copy_ref let must_save = !Parameter_customize.must_save_ref let is_visible = !Parameter_customize.is_visible_ref let module_name = !Parameter_customize.module_name_ref let group = !Parameter_customize.group_ref let stage = !Parameter_customize.cmdline_stage_ref let () = match !Parameter_customize.cmdline_stage_ref with | Cmdline.Early | Cmdline.Extending | Cmdline.Extended | Cmdline.Exiting | Cmdline.Loading -> Parameter_customize.do_not_projectify () | Cmdline.Configuring -> () (* quite an inlining of [State_builder.Ref]; but handle [projectify_ref] *) module Option_state_builder (X:sig include Datatype.S val unique_name: string val pretty_name: string val default: unit -> t end) = struct type data = X.t let create () = ref (X.default ()) let state = ref (create ()) include State_builder.Register (struct include Datatype.Ref(X) let descr = if must_save then descr else Descr.unmarshable end) (struct type t = data ref let get () = !state let create = if projectify then create else (* do an alias *) get let clear x = if projectify then x := X.default () let set x = if projectify then state := x (* else there is already an alias *) let clear_some_projects = Datatype.never_any_project end) (struct let name = X.pretty_name let unique_name = X.unique_name let dependencies = [] end) let set v = !state := v let get () = !(!state) end module Internal_state = Option_state_builder (struct include X (* Hack for the parsing of the command line: C files are recognized as an argument of the option with name '""' (empty string). *) let option_name = if X.option_name = "" then "Input C files" else X.option_name let unique_name = option_name let pretty_name = option_name end) module D = Datatype include Internal_state type t = Internal_state.data let () = extend_selection false self; if not reset_on_copy then extend_no_reset_selection false self let is_default () = X.equal (X.default ()) (Internal_state.get ()) module Is_set = Option_state_builder (struct include D.Bool let pretty_name = X.option_name ^ " is set" let unique_name = pretty_name let default () = false end) let () = State_dependency_graph.add_dependencies ~from:Is_set.self [ self ]; extend_selection true Is_set.self; if not reset_on_copy then extend_no_reset_selection true self module Set_hook = Hook.Build(struct type t = X.t * X.t end) let add_set_hook f = Set_hook.extend (fun (old, x) -> f old x) let add_update_hook f = add_set_hook f; add_hook_on_update (fun x -> let old = get () in let new_ = !x in if not (X.equal old new_) then f old new_) let gen_journalized name ty set = let name = if is_dynamic then Dynamic.Parameter.get_name X.functor_name name X.option_name else "Kernel." ^ module_name ^ "." ^ name in if !Parameter_customize.journalize_ref then Journal.register ~is_dyn:is_dynamic name (D.func ty D.unit) set else set (* like set, but do not clear the dependencies *) let unsafe_set = let set x = Is_set.set true; let old = Internal_state.get () in if not (X.equal x old) then begin Internal_state.set x; Set_hook.apply (old, x) end in gen_journalized "unsafe_set" X.ty set let force_set x = let old = Internal_state.get () in (* First clear the dependency and next apply the hooks since these hooks may set some states in the dependencies. Even do so for unprojectifed options since they actually use the project system (in a fake way, see module {!Options_state_builder}) and could have some dependencies that must be kept consistent. *) let selection = State_selection.diff (State_selection.with_dependencies self) (State_selection.singleton Is_set.self) in (try Project.clear ~selection () with Project.NoProject -> (* unprojectified early options can be set even before creating the initial project. Do nothing for these ones: consistency will be automatically ensured when creating the initial project. *) assert (not projectify)); Internal_state.set x; Set_hook.apply (old, x) let journalized_force_set = gen_journalized "set" X.ty force_set let set x = Is_set.set true; if not (X.equal x (Internal_state.get ())) then journalized_force_set x let unguarded_clear = gen_journalized "clear" D.unit (fun () -> force_set (X.default ()); Is_set.set false) let clear () = (* write this call in the journal if and only if there is something to do *) if Is_set.get () || not (is_default ()) then unguarded_clear () let equal = X.equal let register_dynamic name ty1 ty2 f = if is_dynamic then let ty = D.func ty1 ty2 in Dynamic.register ~plugin:"" (Dynamic.Parameter.get_name X.functor_name name X.option_name) ~journalize:false ty f else f let get, set, unsafe_set, clear, is_set, is_default = register_dynamic "get" D.unit X.ty Internal_state.get, register_dynamic "set" X.ty D.unit set, register_dynamic "unsafe_set" X.ty D.unit unsafe_set, register_dynamic "clear" D.unit D.unit clear, register_dynamic "is_set" D.unit D.bool Is_set.get, register_dynamic "is_default" D.unit D.bool is_default let option_name = X.option_name let add_aliases = Cmdline.add_aliases option_name ~plugin:P.shortname ~group stage let print_help fmt = Cmdline.print_option_help fmt ~plugin:P.shortname ~group option_name end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/parameter_state.mli0000666000000000000000000000651513571573400024715 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************* *) (** {2 Handling groups of parameters} *) (* ************************************************************************* *) val get_selection_context: ?is_set:bool -> unit -> State_selection.t (** Selection of all the parameters that may have an impact on some analysis. *) val get_selection: ?is_set:bool -> unit -> State_selection.t (** Selection of all the settable parameters. [is_set] is [true] by default (for backward compatibility): in such a case, for each option, the extra internal state indicating whether it is set also belongs to the selection. @plugin development guide *) val get_reset_selection: ?is_set:bool -> unit -> State_selection.t (** Selection of resettable parameters in case of copy with a visitor. Not for casual user. @since Neon-20140301 *) (**/**) (* ************************************************************************* *) (** {2 Generic implementation of command line option} *) (* ************************************************************************* *) module Make (P: sig val shortname: string end) (X:sig include Datatype.S val default: unit -> t val option_name: string val functor_name: string end): sig include Parameter_sig.S_no_parameter with type t = X.t module Is_set: State_builder.S val group: Cmdline.Group.t val stage: Cmdline.stage val is_visible: bool val is_dynamic: bool val register_dynamic: string -> 'arg Type.t -> 'ret Type.t -> ('arg -> 'ret) -> 'arg -> 'ret val gen_journalized: string -> 'arg Type.t -> ('arg -> unit) -> 'arg -> unit end (**/**) val collections: State.Set.t ref (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/typed_parameter.ml0000666000000000000000000000764113571573400024552 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type ('a, 'b) gen_accessor = { get: unit -> 'a; set: 'a -> unit; add_set_hook: ('b -> 'b -> unit) -> unit; add_update_hook: ('b -> 'b -> unit) -> unit } type 'a accessor = ('a, 'a) gen_accessor type typed_accessor = | Bool of bool accessor * string option (** the negative option, if any *) | Int of int accessor * (unit -> int * int) (** getting range *) | String of string accessor * (unit -> string list) (** possible values *) type parameter = { name: string; help: string; accessor: typed_accessor; is_set: unit -> bool } include Datatype.Make_with_collections (struct type t = parameter let name = "Parameter.t" let rehash = Datatype.identity let structural_descr = Structural_descr.t_unknown let reprs = [ { name = "bool_opt"; help = "dummy bool option"; accessor = Bool ({ get = (fun () -> false); set = (fun _ -> ()); add_set_hook = (fun _ -> ()); add_update_hook = (fun _ -> ()) }, None); is_set = fun () -> false } ] let equal = (==) let compare x y = if x == y then 0 else String.compare x.name y.name let hash x = Datatype.String.hash x.name let copy x = x (* The representation of the parameter is immutable *) let pretty fmt x = Format.pp_print_string fmt x.name let internal_pretty_code = Datatype.undefined let varname _ = assert false (* unused if internal_pretty_code undefined *) let mem_project = Datatype.never_any_project end) let parameters = Datatype.String.Hashtbl.create 97 let create ~name ~help ~accessor ~is_set = let p = { name = name; help = help; accessor = accessor; is_set = is_set } in (* parameter name unicity already checks in [Plugin]. *) assert (not (Datatype.String.Hashtbl.mem parameters name)); Datatype.String.Hashtbl.add parameters name p; p let get = Datatype.String.Hashtbl.find parameters let pretty_value fmt p = match p.accessor with | Bool(a, _) -> Format.fprintf fmt "%b" (a.get ()) | Int(a, _) -> Format.fprintf fmt "%d" (a.get ()) | String(a, _) -> Format.fprintf fmt "%s" (a.get ()) let get_value p = Format.asprintf "%a" pretty_value p (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/cmdline_parameters/typed_parameter.mli0000666000000000000000000000613213571573400024715 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Parameter settable through a command line option. This is a low level API, internally used by the kernel. As a plug-in developer, you certainly prefer to use the API of {!Plugin} instead. @since Nitrogen-20111001 *) type ('a, 'b) gen_accessor = { get: unit -> 'a; set: 'a -> unit; add_set_hook: ('b -> 'b -> unit) -> unit; add_update_hook: ('b -> 'b -> unit) -> unit } type 'a accessor = ('a, 'a) gen_accessor type typed_accessor = | Bool of bool accessor * string option (** the negative option, if any *) | Int of int accessor * (unit -> int * int) (** getting range *) | String of string accessor * (unit -> string list) (** possible values *) type parameter = private { name: string; (** Name of the option corresponding to the parameter. It is exactly the state name of the option (see {!State.get_name}). *) help: string; (** Help message *) accessor: typed_accessor; (** How to get and set the value of the parameter *) is_set: unit -> bool (** Is this option really set? *) } include Datatype.S_with_collections with type t = parameter val get: string -> t (** Get the parameter from the option name. *) val get_value: t -> string (** Get the current value of the parameter, as a string. *) (**/**) (** Not for casual users. Use API of {!Plugin} instead. *) val create: name:string -> help:string -> accessor:typed_accessor -> is_set: (unit -> bool) -> t (**/**) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/parsetree/0000777000000000000000000000000013571573400017157 5ustar frama-c-20.0-Calcium/src/kernel_services/parsetree/cabs.ml0000666000000000000000000003471413571573400020432 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (** Untyped AST. @plugin development guide **) (* ** Types *) type cabsloc = Filepath.position * Filepath.position type typeSpecifier = (* Merge all specifiers into one type *) Tvoid (* Type specifier ISO 6.7.2 *) | Tchar | Tbool | Tshort | Tint | Tlong | Tint64 | Tfloat | Tdouble | Tsigned | Tunsigned | Tnamed of string (* each of the following three kinds of specifiers contains a field * or item list iff it corresponds to a definition (as opposed to * a forward declaration or simple reference to the type); they * also have a list of __attribute__s that appeared between the * keyword and the type name (definitions only) *) | Tstruct of string * field_group list option * attribute list | Tunion of string * field_group list option * attribute list | Tenum of string * enum_item list option * attribute list | TtypeofE of expression (* GCC __typeof__ *) | TtypeofT of specifier * decl_type (* GCC __typeof__ *) and storage = NO_STORAGE | AUTO | STATIC | EXTERN | REGISTER and funspec = INLINE | VIRTUAL | EXPLICIT and cvspec = | CV_CONST | CV_VOLATILE | CV_RESTRICT | CV_ATTRIBUTE_ANNOT of string (* Type specifier elements. These appear at the start of a declaration *) (* Everywhere they appear in this file, they appear as a 'spec_elem list', *) (* which is not interpreted by cabs -- rather, this "word soup" is passed *) (* on to the compiler. Thus, we can represent e.g. 'int long float x' even *) (* though the compiler will of course choke. *) and spec_elem = SpecTypedef | SpecCV of cvspec (* const/volatile *) | SpecAttr of attribute (* __attribute__ *) | SpecStorage of storage | SpecInline | SpecType of typeSpecifier | SpecPattern of string (* specifier pattern variable *) (* decided to go ahead and replace 'spec_elem list' with specifier *) and specifier = spec_elem list (* Declarator type. They modify the base type given in the specifier. Keep * them in the order as they are printed (this means that the top level * constructor for ARRAY and PTR is the inner-level in the meaning of the * declared type) *) and decl_type = | JUSTBASE (* Prints the declared name *) | PARENTYPE of attribute list * decl_type * attribute list (* Prints "(attrs1 decl attrs2)". * attrs2 are attributes of the * declared identifier and it is as * if they appeared at the very end * of the declarator. attrs1 can * contain attributes for the * identifier or attributes for the * enclosing type. *) | ARRAY of decl_type * attribute list * expression (* Prints "decl [ attrs exp ]". * decl is never a PTR. *) | PTR of attribute list * decl_type (* Prints "* attrs decl" *) | PROTO of decl_type * single_name list * single_name list * bool (* Prints "decl (args[, ...])". * decl is never a PTR.*) (* The base type and the storage are common to all names. Each name might * contain type or storage modifiers *) (* e.g.: int x, y; *) and name_group = specifier * name list (* The optional expression is the bitfield *) and field_group = | FIELD of specifier * (name * expression option) list | TYPE_ANNOT of Logic_ptree.type_annot (* like name_group, except the declared variables are allowed to have initializers *) (* e.g.: int x=1, y=2; *) and init_name_group = specifier * init_name list (* The decl_type is in the order in which they are printed. Only the name of * the declared identifier is pulled out. The attributes are those that are * printed after the declarator *) (* e.g: in "int *x", "*x" is the declarator; "x" will be pulled out as *) (* the string, and decl_type will be PTR([], JUSTBASE) *) and name = string * decl_type * attribute list * cabsloc (* A variable declarator ("name") with an initializer *) and init_name = name * init_expression (* Single names are for declarations that cannot come in groups, like * function parameters and functions *) and single_name = specifier * name and enum_item = string * expression * cabsloc (* ** Declaration definition (at toplevel) *) and definition = FUNDEF of (Logic_ptree.spec*cabsloc) option * single_name * block * cabsloc * cabsloc | DECDEF of (Logic_ptree.spec*cabsloc) option * init_name_group * cabsloc (* global variable(s), or function prototype *) | TYPEDEF of name_group * cabsloc | ONLYTYPEDEF of specifier * cabsloc | GLOBASM of string * cabsloc | PRAGMA of expression * cabsloc | LINKAGE of string * cabsloc * definition list (* extern "C" { ... } *) | GLOBANNOT of Logic_ptree.decl list (** Logical declaration (axiom, logic, etc.)*) | CUSTOM of Logic_ptree.custom_tree * string * cabsloc (** the file name, and then the list of toplevel forms. @plugin development guide *) and file = Datatype.Filepath.t * (bool * definition) list (* ** statements *) (* A block contains a list of local label declarations ( GCC's ({ __label__ * l1, l2; ... }) ) , a list of definitions and a list of statements *) and block = { blabels: string list; battrs: attribute list; bstmts: statement list } (* GCC asm directives have lots of extra information to guide the optimizer *) and asm_details = { aoutputs: (string option * string * expression) list; (* optional name, constraints and expressions for outputs *) ainputs: (string option * string * expression) list; (* optional name, constraints and expressions for inputs *) aclobbers: string list; (* clobbered registers *) alabels: string list (* the labels for "asm goto" statements in gcc >= 4.6 *) } and raw_statement = NOP of cabsloc | COMPUTATION of expression * cabsloc | BLOCK of block * cabsloc * cabsloc | SEQUENCE of statement * statement * cabsloc | IF of expression * statement * statement * cabsloc | WHILE of loop_invariant * expression * statement * cabsloc | DOWHILE of loop_invariant * expression * statement * cabsloc | FOR of loop_invariant * for_clause * expression * expression * statement * cabsloc | BREAK of cabsloc | CONTINUE of cabsloc | RETURN of expression * cabsloc | SWITCH of expression * statement * cabsloc | CASE of expression * statement * cabsloc | CASERANGE of expression * expression * statement * cabsloc | DEFAULT of statement * cabsloc | LABEL of string * statement * cabsloc | GOTO of string * cabsloc | COMPGOTO of expression * cabsloc (* GCC's "goto *exp" *) | DEFINITION of definition (*definition or declaration of a variable or type*) | ASM of attribute list * (* typically only volatile and const *) string list * (* template *) asm_details option * (* extra details to guide GCC's optimizer *) cabsloc (* Exception mechanism *) | THROW of expression option * cabsloc (** throws the corresponding expression. [None] corresponds to re-throwing the exception currently being caught (thus is only meaningful in a catch clause). This node is not generated by the C parser, but can be used by external front-ends. *) | TRY_CATCH of statement * (single_name option * statement) list * cabsloc (** [TRY_CATCH(s,clauses,loc)] catches exceptions thrown by execution of [s], according to [clauses]. An exception [e] is caught by the first clause [(spec,(name, decl, _, _)),body] such that the type of [e] is compatible with [(spec,decl)]. [name] is then associated to a copy of [e], and [body] is executed. If the [single_name] is [None], all exceptions are caught by the corresponding clause. The corresponding [TryCatch] node in {!Cil_types.stmtkind} has a refined notion of catching that allows a clause to match for more than one type using appropriate conversions (see also {!Cil_types.catch_binder}). This node is not generated by the C parser, but can be used by external front-ends. *) (** MS SEH *) | TRY_EXCEPT of block * expression * block * cabsloc | TRY_FINALLY of block * block * cabsloc (* annotations *) | CODE_ANNOT of (Logic_ptree.code_annot * cabsloc) | CODE_SPEC of (Logic_ptree.spec * cabsloc) and statement = { mutable stmt_ghost: bool; stmt_node:raw_statement } and loop_invariant = Logic_ptree.code_annot list and for_clause = FC_EXP of expression | FC_DECL of definition (* ** Expressions *) and binary_operator = ADD | SUB | MUL | DIV | MOD | AND | OR | BAND | BOR | XOR | SHL | SHR | EQ | NE | LT | GT | LE | GE | ASSIGN | ADD_ASSIGN | SUB_ASSIGN | MUL_ASSIGN | DIV_ASSIGN | MOD_ASSIGN | BAND_ASSIGN | BOR_ASSIGN | XOR_ASSIGN | SHL_ASSIGN | SHR_ASSIGN and unary_operator = MINUS | PLUS | NOT | BNOT | MEMOF | ADDROF | PREINCR | PREDECR | POSINCR | POSDECR and expression = { expr_loc : cabsloc; expr_node: cabsexp } and cabsexp = NOTHING | UNARY of unary_operator * expression | LABELADDR of string (* GCC's && Label *) | BINARY of binary_operator * expression * expression | QUESTION of expression * expression * expression (* A CAST can actually be a constructor expression *) | CAST of (specifier * decl_type) * init_expression (* There is a special form of CALL in which the function called is __builtin_va_arg and the second argument is sizeof(T). This should be printed as just T *) | CALL of expression * expression list * expression list | COMMA of expression list | CONSTANT of constant | PAREN of expression | VARIABLE of string | EXPR_SIZEOF of expression | TYPE_SIZEOF of specifier * decl_type | EXPR_ALIGNOF of expression | TYPE_ALIGNOF of specifier * decl_type | INDEX of expression * expression | MEMBEROF of expression * string | MEMBEROFPTR of expression * string | GNU_BODY of block | EXPR_PATTERN of string (* pattern variable, and name *) and constant = | CONST_INT of string (* the textual representation *) | CONST_FLOAT of string (* the textual representation *) | CONST_CHAR of int64 list | CONST_WCHAR of int64 list | CONST_STRING of string | CONST_WSTRING of int64 list (* ww: wstrings are stored as an int64 list at this point because * we might need to feed the wide characters piece-wise into an * array initializer (e.g., wchar_t foo[] = L"E\xabcd";). If that * doesn't happen we will convert it to an (escaped) string before * passing it to Cil. *) and init_expression = | NO_INIT | SINGLE_INIT of expression | COMPOUND_INIT of (initwhat * init_expression) list and initwhat = NEXT_INIT | INFIELD_INIT of string * initwhat | ATINDEX_INIT of expression * initwhat | ATINDEXRANGE_INIT of expression * expression (* Each attribute has a name and some * optional arguments *) and attribute = string * expression list (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/parsetree/cabshelper.ml0000666000000000000000000002350013571573400021621 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) open Cabs let nextident = ref 0 let getident () = nextident := !nextident + 1; !nextident let cabslu = Cil_datatype.Location.unknown module Comments = struct module MapDest = struct include Datatype.List(Datatype.Pair(Cil_datatype.Position)(Datatype.String)) let fast_equal (_:t) (_:t) = false end module MyTable = Rangemap.Make (Cil_datatype.Position) (MapDest) module MyState = State_builder.Ref (MyTable) (struct let name = "Cabshelper.Comments" let dependencies = [ ] (* depends from File.self and Ast.self which add the dependency themselves. *) let default () = MyTable.empty end) let self = MyState.self let () = Cil.dependency_on_ast self (* What matters is the beginning of the comment. *) let add (first,last) comment = let state = MyState.get () in let acc = try MyTable.find first state with Not_found -> [] in MyState.set ((MyTable.add first ((last,comment)::acc)) state) let get (first,last) = let open Cil_datatype in Kernel.debug ~dkey:Kernel.dkey_comments "Searching for comments between positions %a and %a@." Position.pretty first Position.pretty last; if Position.equal first Position.unknown || Position.equal last Position.unknown then begin Kernel.debug ~dkey:Kernel.dkey_comments "skipping dummy position@."; [] end else let r = MyTable.fold_range (fun pos -> match Cil_datatype.Position.compare first pos with | n when n > 0 -> Rangemap.Below | 0 -> Rangemap.Match | _ -> if Cil_datatype.Position.compare pos last <= 0 then Rangemap.Match else Rangemap.Above) (fun _ comments acc -> acc @ List.rev_map snd comments) (MyState.get ()) [] in Kernel.debug ~dkey:Kernel.dkey_comments "%d results@." (List.length r); r let iter f = MyTable.iter (fun first comments -> List.iter (fun (last,comment) -> f (first,last) comment) comments) (MyState.get()) let fold f acc = MyTable.fold (fun first comments acc -> List.fold_left (fun acc (last,comment) -> f (first,last) comment acc) acc comments) (MyState.get()) acc end (*********** HELPER FUNCTIONS **********) let missingFieldDecl = (Cil.missingFieldName, JUSTBASE, [], cabslu) let rec isStatic = function [] -> false | (SpecStorage STATIC) :: _ -> true | _ :: rest -> isStatic rest let rec isExtern = function [] -> false | (SpecStorage EXTERN) :: _ -> true | _ :: rest -> isExtern rest let rec isInline = function [] -> false | SpecInline :: _ -> true | _ :: rest -> isInline rest let rec isTypedef = function [] -> false | SpecTypedef :: _ -> true | _ :: rest -> isTypedef rest let get_definitionloc (d : definition) : cabsloc = match d with | FUNDEF(_,_, _, l, _) -> l | DECDEF(_,_, l) -> l | TYPEDEF(_, l) -> l | ONLYTYPEDEF(_, l) -> l | GLOBASM(_, l) -> l | PRAGMA(_, l) -> l | LINKAGE (_, l, _) -> l | GLOBANNOT({Logic_ptree.decl_loc = l }::_) -> l | GLOBANNOT [] -> assert false | CUSTOM (_,_,l) -> l let get_statementloc (s : statement) : cabsloc = begin match s.stmt_node with | NOP(loc) -> loc | COMPUTATION(_,loc) -> loc | BLOCK(_,loc,_) -> loc | SEQUENCE(_,_,loc) -> loc | IF(_,_,_,loc) -> loc | WHILE(_,_,_,loc) -> loc | DOWHILE(_,_,_,loc) -> loc | FOR(_,_,_,_,_,loc) -> loc | BREAK(loc) -> loc | CONTINUE(loc) -> loc | RETURN(_,loc) -> loc | SWITCH(_,_,loc) -> loc | CASE(_,_,loc) -> loc | CASERANGE(_,_,_,loc) -> loc | DEFAULT(_,loc) -> loc | LABEL(_,_,loc) -> loc | GOTO(_,loc) -> loc | COMPGOTO (_, loc) -> loc | DEFINITION d -> get_definitionloc d | ASM(_,_,_,loc) -> loc | TRY_EXCEPT(_, _, _, loc) -> loc | TRY_FINALLY(_, _, loc) -> loc | (CODE_SPEC (_,l) |CODE_ANNOT (_,l)) -> l | THROW(_,l) -> l | TRY_CATCH(_,_,l) -> l end let explodeStringToInts (s: string) : int64 list = let rec allChars i acc = if i < 0 then acc else allChars (i - 1) (Int64.of_int (Char.code (String.get s i)) :: acc) in allChars (-1 + String.length s) [] let valueOfDigit chr = let int_value = match chr with '0'..'9' -> (Char.code chr) - (Char.code '0') | 'a'..'z' -> (Char.code chr) - (Char.code 'a') + 10 | 'A'..'Z' -> (Char.code chr) - (Char.code 'A') + 10 | _ -> Kernel.fatal "not a digit" in Int64.of_int int_value let d_cabsloc fmt cl = Format.fprintf fmt "%a" Filepath.pp_pos (fst cl) type attr_test = Normal | Test let state_stack = Stack.create () let () = Stack.push Normal state_stack let push_attr_test () = Stack.push Test state_stack let pop_attr_test () = ignore (Stack.pop state_stack) let is_attr_test () = Stack.top state_stack = Test let mk_behavior ?(name=Cil.default_behavior_name) ?(assumes=[]) ?(requires=[]) ?(post_cond=[]) ?(assigns=Logic_ptree.WritesAny) ?(allocation=Logic_ptree.FreeAllocAny) ?(extended=[]) () = { Logic_ptree.b_name = name; b_assumes = assumes; (* must be always empty for default_behavior_name *) b_requires = requires; b_assigns = assigns ; b_allocation = allocation ; b_post_cond = post_cond ; b_extended = extended; } let mk_asm_templates = let buf = Buffer.create 100 in let rec outer res = function | [] when res = [] && Buffer.length buf = 0 -> [""] | [] when Buffer.length buf = 0 -> List.rev res | [] -> let res = List.rev @@ Buffer.contents buf :: res in Buffer.clear buf; res | str :: tail -> tail |> outer @@ inner res str 0 and inner res template i = if i < String.length template then let c = String.get template i in Buffer.add_char buf c; if c = '\n' then if i < String.length template - 1 then match String.get template @@ i + 1 with | '\t' -> Buffer.add_char buf '\t'; let res = Buffer.contents buf :: res in Buffer.clear buf; inner res template @@ i + 2 | c -> let res = Buffer.contents buf :: res in Buffer.clear buf; Buffer.add_char buf c; inner res template @@ i + 2 else let res = Buffer.contents buf :: res in Buffer.clear buf; res else inner res template @@ i + 1 else res in outer [] (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/parsetree/cabshelper.mli0000666000000000000000000001155113571573400021775 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (** Helper functions for Cabs *) val nextident : int ref val getident : unit -> int val cabslu : Cabs.cabsloc (* List of comments together with the location where they are found. *) module Comments: sig val self: State.t (* adds a comment at a given location. *) val add: Cabs.cabsloc -> string -> unit (* gets all the comment located between the two positions. *) val get: Cabs.cabsloc -> string list (* iter over all registered comments. *) val iter: (Cabs.cabsloc -> string -> unit) -> unit (* fold over all registered comments. *) val fold: (Cabs.cabsloc -> string -> 'a -> 'a) -> 'a -> 'a end val missingFieldDecl : string * Cabs.decl_type * 'a list * Cabs.cabsloc val isStatic : Cabs.spec_elem list -> bool val isExtern : Cabs.spec_elem list -> bool val isInline : Cabs.spec_elem list -> bool val isTypedef : Cabs.spec_elem list -> bool val get_definitionloc : Cabs.definition -> Cabs.cabsloc val get_statementloc : Cabs.statement -> Cabs.cabsloc val explodeStringToInts : string -> int64 list val valueOfDigit : char -> int64 val d_cabsloc : Cabs.cabsloc Pretty_utils.formatter (* hack to avoid shift/reduce conflict is attr parsing. *) val push_attr_test: unit -> unit val pop_attr_test: unit -> unit val is_attr_test: unit -> bool val mk_behavior : ?name:string -> ?assumes:Logic_ptree.lexpr list -> ?requires:Logic_ptree.lexpr list -> ?post_cond:(Cil_types.termination_kind * Logic_ptree.lexpr) list -> ?assigns:Logic_ptree.assigns -> ?allocation:Logic_ptree.allocation -> ?extended:Logic_ptree.extension list -> unit -> Logic_ptree.behavior val mk_asm_templates : string list -> string list frama-c-20.0-Calcium/src/kernel_services/parsetree/logic_ptree.mli0000666000000000000000000004107413571573400022164 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Logic parse trees *) (** logic constants. *) type constant = IntConstant of string (** integer constant *) | FloatConstant of string (** real constant *) | StringConstant of string (** string constant *) | WStringConstant of string (** wide string constant *) (** size of logic array. *) type array_size = ASinteger of string (** integer constant *) | ASidentifier of string (** a variable or macro*) | ASnone (** none *) (** logic types. *) type logic_type = | LTvoid (** C void *) | LTinteger (** mathematical integers. *) | LTreal (** mathematical real. *) | LTint of Cil_types.ikind (** C integral type.*) | LTfloat of Cil_types.fkind (** C floating-point type *) | LTarray of logic_type * array_size (** C array *) | LTpointer of logic_type (** C pointer *) | LTenum of string (** C enum *) | LTstruct of string (** C struct *) | LTunion of string (** C union *) | LTnamed of string * logic_type list (** declared logic type. *) | LTarrow of logic_type list * logic_type | LTattribute of logic_type * Cil_types.attribute (* Only const and volatile can appear here *) type location = Cil_types.location (** quantifier-bound variables *) type quantifiers = (logic_type * string) list (** comparison operators. *) type relation = Lt | Gt | Le | Ge | Eq | Neq (** arithmetic and logic binary operators. *) type binop = Badd | Bsub | Bmul | Bdiv | Bmod | Bbw_and | Bbw_or | Bbw_xor | Blshift | Brshift (** unary operators. *) type unop = Uminus | Ustar | Uamp | Ubw_not (** logical expression. The distinction between locations, terms and predicate is done during typing. *) type lexpr = { lexpr_node : lexpr_node; (** kind of expression. *) lexpr_loc : location (** position in the source code. *) } (* PL is for Parsed Logic *) (** kind of expression. *) and path_elt = (** construct inside a functional update. *) | PLpathField of string | PLpathIndex of lexpr and update_term = | PLupdateTerm of lexpr | PLupdateCont of ((path_elt list) * update_term) list and lexpr_node = (* both terms and predicates *) | PLvar of string (** a variable *) | PLapp of string * string list * lexpr list (** an application. *) (* terms *) | PLlambda of quantifiers * lexpr (** a lambda abstraction. *) | PLlet of string * lexpr * lexpr (** local binding. *) | PLconstant of constant (** a constant. *) | PLunop of unop * lexpr (** unary operator. *) | PLbinop of lexpr * binop * lexpr (** binary operator. *) | PLdot of lexpr * string (** field access ({t a.x}) *) | PLarrow of lexpr * string (** field access ({t a->x})*) | PLarrget of lexpr * lexpr (** array access. *) | PLold of lexpr (** expression refers to pre-state of a function. *) | PLat of lexpr * string (** expression refers to a given program point. *) | PLresult (** value returned by a function. *) | PLnull (** null pointer. *) | PLcast of logic_type * lexpr (** cast. *) | PLrange of lexpr option * lexpr option (** interval of integers. *) | PLsizeof of logic_type (** sizeof a type. *) | PLsizeofE of lexpr (** sizeof the type of an expression. *) | PLupdate of lexpr * (path_elt list) * update_term (** functional update of the field of a structure. *) | PLinitIndex of (lexpr * lexpr) list (** array constructor. *) | PLinitField of (string * lexpr) list (** struct/union constructor. *) | PLtypeof of lexpr (** type tag for an expression. *) | PLtype of logic_type (** type tag for a C type. *) (* predicates *) | PLfalse (** false (either as a term or a predicate. *) | PLtrue (** true (either as a term or a predicate. *) | PLrel of lexpr * relation * lexpr (** comparison operator. *) | PLand of lexpr * lexpr (** conjunction. *) | PLor of lexpr * lexpr (** disjunction. *) | PLxor of lexpr * lexpr (** logical xor. *) | PLimplies of lexpr * lexpr (** implication. *) | PLiff of lexpr * lexpr (** equivalence. *) | PLnot of lexpr (** negation. *) | PLif of lexpr * lexpr * lexpr (** conditional operator. *) | PLforall of quantifiers * lexpr (** universal quantification. *) | PLexists of quantifiers * lexpr (** existential quantification. *) | PLbase_addr of string option * lexpr (** base address of a pointer. *) | PLoffset of string option * lexpr (** base address of a pointer. *) | PLblock_length of string option * lexpr (** length of the block pointed to by an expression. *) | PLvalid of string option * lexpr (** pointer is valid. *) | PLvalid_read of string option * lexpr (** pointer is valid for reading. *) | PLvalid_function of lexpr (** function pointer is compatible with pointed type. *) | PLallocable of string option * lexpr (** pointer is valid for malloc. *) | PLfreeable of string option * lexpr (** pointer is valid for free. *) | PLinitialized of string option * lexpr (** pointer is guaranteed to be initialized *) | PLdangling of string option * lexpr (** pointer is guaranteed to be dangling *) | PLfresh of (string * string) option * lexpr * lexpr (** expression points to a newly allocated block. *) | PLseparated of lexpr list (** separation predicate. *) | PLnamed of string * lexpr (** named expression. *) (* tsets *) | PLcomprehension of lexpr * quantifiers * lexpr option (** set of expression defined in comprehension ({t \{ e | integer i; P(i)\}})*) | PLset of lexpr list (** sets of elements. *) | PLunion of lexpr list (** union of sets. *) | PLinter of lexpr list (** intersection of sets. *) | PLempty (** empty set. *) | PLlist of lexpr list (** list of elements. *) | PLrepeat of lexpr * lexpr (** repeat a list of elements a number of times. *) type extension = string * lexpr list (** type invariant. *) type type_annot = {inv_name: string; this_type : logic_type; this_name: string; (** name of its argument. *) inv: lexpr } (** model field. *) type model_annot = {model_for_type: logic_type; model_type : logic_type; model_name: string; (** name of the model field. *) } (** Concrete type definition. *) type typedef = | TDsum of (string * logic_type list) list (** sum type, list of constructors *) | TDsyn of logic_type (** synonym of an existing type *) (** global declarations. *) type decl = { decl_node : decl_node; (** kind of declaration. *) decl_loc : location (** position in the source code. *) } and decl_node = | LDlogic_def of string * string list * string list * logic_type * (logic_type * string) list * lexpr (** [LDlogic_def(name,labels,type_params, return_type, parameters, definition)] represents the definition of a logic function [name] whose return type is [return_type] and arguments are [parameters]. Its label arguments are [labels]. Polymorphic functions have their type parameters in [type_params]. [definition] is the body of the defined function.*) | LDlogic_reads of string * string list * string list * logic_type * (logic_type * string) list * lexpr list option (** [LDlogic_reads(name,labels,type_params, return_type, parameters, reads_tsets)] represents the declaration of logic function. It has the same arguments as [LDlogic_def], except that the definition is abstracted to a set of read accesses in [read_tsets]. *) | LDtype of string * string list * typedef option (** new logic type and its parameters, optionally followed by its definition. *) | LDpredicate_reads of string * string list * string list * (logic_type * string) list * lexpr list option (** [LDpredicate_reads(name,labels,type_params, parameters, reads_tsets)] represents the declaration of a new predicate. It is similar to [LDlogic_reads] except that it has no [return_type]. *) | LDpredicate_def of string * string list * string list * (logic_type * string) list * lexpr (** [LDpredicate_def(name,labels,type_params, parameters, def)] represents the definition of a new predicate. It is similar to [LDlogic_def] except that it has no [return_type]. *) | LDinductive_def of string * string list * string list * (logic_type * string) list * (string * string list * string list * lexpr) list (** [LDinductive_def(name,labels,type_params, parameters, indcases)] represents an inductive definition of a new predicate. *) | LDlemma of string * bool * string list * string list * lexpr (** LDlemma(name,is_axiom,labels,type_params,property) represents a lemma or an axiom [name]. [is_axiom] is true for an axiom and false for a lemma. [labels] is the list of label arguments and [type_params] the list of type parameters. Last, [property] is the statement of the lemma. *) | LDaxiomatic of string * decl list (** [LDaxiomatic(id,decls)] represents a block of axiomatic definitions.*) | LDinvariant of string * lexpr (** global invariant. *) | LDtype_annot of type_annot (** type invariant. *) | LDmodel_annot of model_annot (** model field. *) | LDvolatile of lexpr list * (string option * string option) (** volatile clause read/write. *) | LDextended of extension (** extended global annotation. *) (** dependencies of an assigned location. *) and deps = | From of lexpr list (** tsets. Empty list means \nothing. *) | FromAny (** Nothing specified. Any location can be involved. *) and from = (lexpr * deps) (** zone assigned with its dependencies. *) and assigns = | WritesAny (** Nothing specified. Anything can be written. *) | Writes of from list (** list of locations that can be written. Empty list means \nothing. *) (** allocates and frees. @since Oxygen-20120901 *) and allocation = | FreeAlloc of lexpr list * lexpr list (** tsets. Empty list means \nothing. *) | FreeAllocAny (** Nothing specified. Semantics depends on where it is written. *) (** variant of a loop or a recursive function. *) and variant = lexpr * string option (** Behavior in a specification. This type shares the name of its constructors with {!Cil_types.behavior}. *) type behavior = { mutable b_name : string; (** name of the behavior. *) mutable b_requires : lexpr list; (** require clauses. *) mutable b_assumes : lexpr list; (** assume clauses. *) mutable b_post_cond : (Cil_types.termination_kind * lexpr) list; (** post-condition. *) mutable b_assigns : assigns; (** assignments. *) mutable b_allocation : allocation; (** frees, allocates. *) mutable b_extended : extension list (** extensions *) } (** Function or statement contract. This type shares the name of its constructors with {!Cil_types.spec}. *) type spec = { mutable spec_behavior : behavior list; (** behaviors *) mutable spec_variant : variant option; (** variant for recursive functions. *) mutable spec_terminates: lexpr option; (** termination condition. *) mutable spec_complete_behaviors: string list list; (** list of complete behaviors. It is possible to have more than one set of complete behaviors *) mutable spec_disjoint_behaviors: string list list; (** list of disjoint behaviors. It is possible to have more than one set of disjoint behaviors *) } (** Pragmas for the value analysis plugin of Frama-C. *) type loop_pragma = | Unroll_specs of lexpr list | Widen_hints of lexpr list | Widen_variables of lexpr list (** Pragmas for the slicing plugin of Frama-C. *) and slice_pragma = | SPexpr of lexpr | SPctrl | SPstmt (** Pragmas for the impact plugin of Frama-C. *) and impact_pragma = | IPexpr of lexpr | IPstmt (** The various kinds of pragmas. *) and pragma = | Loop_pragma of loop_pragma | Slice_pragma of slice_pragma | Impact_pragma of impact_pragma and assertion_kind = Assert | Check (** all annotations that can be found in the code. This type shares the name of its constructors with {!Cil_types.code_annotation_node}. *) type code_annot = | AAssert of string list * assertion_kind * lexpr (** assertion to be checked. The list of strings is the list of behaviors to which this assertion applies. *) | AStmtSpec of string list * spec (** statement contract (potentially restricted to some enclosing behaviors). *) | AInvariant of string list * bool * lexpr (** loop/code invariant. The list of strings is the list of behaviors to which this invariant applies. The boolean flag is true for normal loop invariants and false for invariant-as-assertions. *) | AVariant of variant (** loop variant. Note that there can be at most one variant associated to a given statement *) | AAssigns of string list * assigns (** loop assigns. (see [b_assigns] in the behaviors for other assigns). At most one clause associated to a given (statement, behavior) couple. *) | AAllocation of string list * allocation (** loop allocation clause. (see [b_allocation] in the behaviors for other allocation clauses). At most one clause associated to a given (statement, behavior) couple. @since Oxygen-20120901 when [b_allocation] has been added. *) | APragma of pragma (** pragma. *) | AExtended of string list * bool * extension (** extension in a code or loop (when boolean flag is true) annotation. @since Silicon-20161101 @modify 18.0-Argon *) (** custom trees *) type custom_tree = | CustomType of logic_type | CustomLexpr of lexpr | CustomOther of string * (custom_tree list) (** all kind of annotations*) type annot = | Adecl of decl list (** global annotation. *) | Aspec (* the real spec is parsed afterwards. See cparser.mly (grammar rules involving SPEC) for more details. *) (** function specification. *) | Acode_annot of location * code_annot (** code annotation. *) | Aloop_annot of location * code_annot list (** loop annotation. *) | Aattribute_annot of location * string (** attribute annotation. *) | Acustom of location * string * custom_tree (** ACSL extension for external spec file **) type ext_decl = | Ext_decl of decl (* decl contains a location *) | Ext_macro of bool * string * lexpr (* lexpr contains a location *) | Ext_include of bool * string * location type ext_function = | Ext_spec of spec * location (* function spec *) | Ext_stmt of string list * annot * location (* loop/code annotation. *) | Ext_glob of ext_decl type ext_module = string option * ext_decl list * ((string * location) option * ext_function list) list type ext_spec = ext_module list (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/0000777000000000000000000000000013571573400021300 5ustar frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/db.ml0000666000000000000000000011226013571573400022221 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype open Extlib type 'a how_to_journalize = | Journalize of string * 'a Type.t | Journalization_not_required | Journalization_must_not_happen of string let register how_to_journalize r f = match how_to_journalize with | Journalize (name, ty) -> r := Journal.register ("!Db." ^ name) ty f | Journalization_not_required -> r := f | Journalization_must_not_happen name -> r := Journal.never_write ("!Db." ^ name) f let register_compute name deps r f = let name = "!Db." ^ name in let f = Journal.register name (Datatype.func Datatype.unit Datatype.unit) f in let compute, self = State_builder.apply_once name deps f in r := compute; self let register_guarded_compute name is_computed r f = let name = "!Db." ^ name in let f = Journal.register name (Datatype.func Datatype.unit Datatype.unit) f in let compute () = if not (is_computed ()) then f () in r := compute module Main = struct include Hook.Make(struct end) let play = mk_fun "Main.play" end module Toplevel = struct let run = ref (fun f -> f ()) end (* ************************************************************************* *) (** {2 Inouts} *) (* ************************************************************************* *) module type INOUTKF = sig type t val self_internal: State.t ref val self_external: State.t ref val compute : (kernel_function -> unit) ref val get_internal : (kernel_function -> t) ref val get_external : (kernel_function -> t) ref val display : (Format.formatter -> kernel_function -> unit) ref val pretty : Format.formatter -> t -> unit end module type INOUT = sig include INOUTKF val statement : (stmt -> t) ref val kinstr : kinstr -> t option end (** State_builder.of outputs - over-approximation of zones written by each function. *) module Outputs = struct type t = Locations.Zone.t let self_internal = ref State.dummy let self_external = ref State.dummy let compute = mk_fun "Out.compute" let display = mk_fun "Out.display" let display_external = mk_fun "Out.display_external" let get_internal = mk_fun "Out.get_internal" let get_external = mk_fun "Out.get_external" let statement = mk_fun "Out.statement" let kinstr ki = match ki with | Kstmt s -> Some (!statement s) | Kglobal -> None let pretty = Locations.Zone.pretty end (** State_builder.of read inputs - over-approximation of locations read by each function. *) module Inputs = struct (* What about [Inputs.statement] ? *) type t = Locations.Zone.t let self_internal = ref State.dummy let self_external = ref State.dummy let self_with_formals = ref State.dummy let compute = mk_fun "Inputs.compute" let display = mk_fun "Inputs.display" let display_with_formals = mk_fun "Inputs.display_with_formals" let get_internal = mk_fun "Inputs.get_internal" let get_external = mk_fun "Inputs.get_external" let get_with_formals = mk_fun "Inputs.get_with_formals" let statement = mk_fun "Inputs.statement" let expr = mk_fun "Inputs.expr" let kinstr ki = match ki with | Kstmt s -> Some (!statement s) | Kglobal -> None let pretty = Locations.Zone.pretty end (** State_builder.of operational inputs - over-approximation of zones whose input values are read by each function, State_builder.of sure outputs - under-approximation of zones written by each function. *) module Operational_inputs = struct type t = Inout_type.t let self_internal = ref State.dummy let self_external = ref State.dummy let compute = mk_fun "Operational_inputs.compute" let display = mk_fun "Operational_inputs.display" let get_internal = mk_fun "Operational_inputs.get_internal" let get_internal_precise = ref (fun ?stmt:_ _ -> failwith ("Db.Operational_inputs.get_internal_precise not implemented")) let get_external = mk_fun "Operational_inputs.get_external" module Record_Inout_Callbacks = Hook.Build (struct type t = Value_types.callstack * Inout_type.t end) let pretty fmt x = Format.fprintf fmt "@["; Format.fprintf fmt "@[Operational inputs:@ @[%a@]@]@ " Locations.Zone.pretty (x.Inout_type.over_inputs); Format.fprintf fmt "@[Operational inputs on termination:@ @[%a@]@]@ " Locations.Zone.pretty (x.Inout_type.over_inputs_if_termination); Format.fprintf fmt "@[Sure outputs:@ @[%a@]@]" Locations.Zone.pretty (x.Inout_type.under_outputs_if_termination); Format.fprintf fmt "@]"; end (** Derefs computations *) module Derefs = struct type t = Locations.Zone.t let self_internal = ref State.dummy let self_external = ref State.dummy let compute = mk_fun "Derefs.compute" let display = mk_fun "Derefs.display" let get_internal = mk_fun "Derefs.get_internal" let get_external = mk_fun "Derefs.get_external" let statement = mk_fun "Derefs.statement" let kinstr ki = match ki with | Kstmt s -> Some (!statement s) | Kglobal -> None let pretty = Locations.Zone.pretty end (* ************************************************************************* *) (** {2 Values} *) (* ************************************************************************* *) module Value = struct type state = Cvalue.Model.t type t = Cvalue.V.t (* This function is responsible for clearing completely Value's state when the user-supplied initial state or main arguments are changed. It is set deep inside Value for technical reasons *) let initial_state_changed = mk_fun "Value.initial_state_changed" (* Arguments of the root function of the value analysis *) module ListArgs = Datatype.List(Cvalue.V) module FunArgs = State_builder.Option_ref (ListArgs) (struct let name = "Db.Value.fun_args" let dependencies = [ Ast.self; Kernel.LibEntry.self; Kernel.MainFunction.self] end) let () = Ast.add_monotonic_state FunArgs.self exception Incorrect_number_of_arguments let fun_get_args () = FunArgs.get_option () (* This function is *not* journalized *) let fun_set_args = let module L = Datatype.List(Cvalue.V) in Journal.register "(failwith \"Function cannot be journalized: \ Db.Value.fun_set_args\" : _ -> unit)" (Datatype.func L.ty Datatype.unit) (fun l -> if not (Extlib.opt_equal ListArgs.equal (Some l) (FunArgs.get_option ())) then begin !initial_state_changed (); FunArgs.set l end) let fun_use_default_args = Journal.register "Db.Value.fun_use_default_args" (Datatype.func Datatype.unit Datatype.unit) (fun () -> if FunArgs.get_option () <> None then (!initial_state_changed (); FunArgs.clear ())) (* Initial memory state of the value analysis *) module VGlobals = State_builder.Option_ref (Cvalue.Model) (struct let name = "Db.Value.Vglobals" let dependencies = [Ast.self] end) (* This function is *not* journalized *) let globals_set_initial_state = Journal.register "(failwith \"Function cannot be journalized: \ Db.Value.globals_set_initial_state\" : _ -> unit)" (Datatype.func Cvalue.Model.ty Datatype.unit) (fun state -> if not (Extlib.opt_equal Cvalue.Model.equal (Some state) (VGlobals.get_option ())) then begin !initial_state_changed (); VGlobals.set state end) let globals_use_default_initial_state = Journal.register "Db.Value.globals_use_default_initial_state" (Datatype.func Datatype.unit Datatype.unit) (fun () -> if VGlobals.get_option () <> None then (!initial_state_changed (); VGlobals.clear ())) let initial_state_only_globals = mk_fun "Value.initial_state_only_globals" let globals_state () = match VGlobals.get_option () with | Some v -> v | None -> !initial_state_only_globals () let globals_use_supplied_state () = not (VGlobals.get_option () = None) (* Do NOT add dependencies to Kernel parameters here, but at the top of Value/Value_parameters *) let dependencies = [ Ast.self; Alarms.self; Annotations.code_annot_state; FunArgs.self; VGlobals.self ] let size = 256 module States_by_callstack = Value_types.Callstack.Hashtbl.Make(Cvalue.Model) module Table_By_Callstack = Cil_state_builder.Stmt_hashtbl(States_by_callstack) (struct let name = "Db.Value.Table_By_Callstack" let size = size let dependencies = dependencies end) module Table = Cil_state_builder.Stmt_hashtbl(Cvalue.Model) (struct let name = "Db.Value.Table" let size = size let dependencies = [ Table_By_Callstack.self ] end) (* Clear Value's various caches each time [Db.Value.is_computed] is updated, including when it is set, reset, or during project change. Some operations of Value depend on -ilevel, -plevel, etc, so clearing those caches when Value ends ensures that those options will have an effect between two runs of Value. *) let () = Table_By_Callstack.add_hook_on_update (fun _ -> Cvalue.V_Offsetmap.clear_caches (); Cvalue.Model.clear_caches (); Locations.Location_Bytes.clear_caches (); Locations.Zone.clear_caches (); Function_Froms.Memory.clear_caches (); ) module AfterTable_By_Callstack = Cil_state_builder.Stmt_hashtbl(States_by_callstack) (struct let name = "Db.Value.AfterTable_By_Callstack" let size = size let dependencies = [ Table_By_Callstack.self ] end) module AfterTable = Cil_state_builder.Stmt_hashtbl(Cvalue.Model) (struct let name = "Db.Value.AfterTable" let size = size let dependencies = [ AfterTable_By_Callstack.self ] end) let self = Table_By_Callstack.self let only_self = [ self ] let mark_as_computed = Journal.register "Db.Value.mark_as_computed" (Datatype.func Datatype.unit Datatype.unit) Table_By_Callstack.mark_as_computed let is_computed () = Table_By_Callstack.is_computed () module Conditions_table = Cil_state_builder.Stmt_hashtbl (Datatype.Int) (struct let name = "Db.Value.Conditions_table" let size = 101 let dependencies = only_self end) let merge_conditions h = Cil_datatype.Stmt.Hashtbl.iter (fun stmt v -> try let old = Conditions_table.find stmt in Conditions_table.replace stmt (old lor v) with Not_found -> Conditions_table.add stmt v) h let mask_then = 1 let mask_else = 2 let condition_truth_value s = try let i = Conditions_table.find s in ((i land mask_then) <> 0, (i land mask_else) <> 0) with Not_found -> false, false module RecursiveCallsFound = State_builder.Set_ref (Kernel_function.Set) (struct let name = "Db.Value.RecursiveCallsFound" let dependencies = only_self end) let ignored_recursive_call kf = RecursiveCallsFound.mem kf let recursive_call_occurred kf = RecursiveCallsFound.add kf module Called_Functions_By_Callstack = State_builder.Hashtbl(Kernel_function.Hashtbl) (States_by_callstack) (struct let name = "Db.Value.Called_Functions_By_Callstack" let size = 11 let dependencies = only_self end) module Called_Functions_Memo = State_builder.Hashtbl(Kernel_function.Hashtbl) (Cvalue.Model) (struct let name = "Db.Value.Called_Functions_Memo" let size = 11 let dependencies = [ Called_Functions_By_Callstack.self ] end) (* let pretty_table () = Table.iter (fun k v -> Kernel.log ~kind:Log.Debug "GLOBAL TABLE at %a: %a@\n" Kinstr.pretty k Cvalue.Model.pretty v) let pretty_table_raw () = Kinstr.Hashtbl.iter (fun k v -> Kernel.log ~kind:Log.Debug "GLOBAL TABLE at %a: %a@\n" Kinstr.pretty k Cvalue.Model.pretty v) *) type callstack = (kernel_function * kinstr) list module Record_Value_Callbacks = Hook.Build (struct type t = (kernel_function * kinstr) list * (state Stmt.Hashtbl.t) Lazy.t end) module Record_Value_Callbacks_New = Hook.Build (struct type t = (kernel_function * kinstr) list * ((state Stmt.Hashtbl.t) Lazy.t * (state Stmt.Hashtbl.t) Lazy.t) Value_types.callback_result end) module Record_Value_After_Callbacks = Hook.Build (struct type t = (kernel_function * kinstr) list * (state Stmt.Hashtbl.t) Lazy.t end) module Record_Value_Superposition_Callbacks = Hook.Build (struct type t = (kernel_function * kinstr) list * (state list Stmt.Hashtbl.t) Lazy.t end) module Call_Value_Callbacks = Hook.Build (struct type t = state * (kernel_function * kinstr) list end) module Call_Type_Value_Callbacks = Hook.Build(struct type t = [`Builtin of Value_types.call_result | `Spec of funspec | `Def | `Memexec] * state * (kernel_function * kinstr) list end) ;; module Compute_Statement_Callbacks = Hook.Build (struct type t = stmt * callstack * state list end) (* -remove-redundant-alarms feature, applied at the end of an Eva analysis, fulfilled by the Scope plugin that also depends on Eva. We thus use a reference here to avoid a cyclic dependency. *) let rm_asserts = mk_fun "Value.rm_asserts" let no_results = mk_fun "Value.no_results" let update_callstack_table ~after stmt callstack v = let open Value_types in let find,add = if after then AfterTable_By_Callstack.find, AfterTable_By_Callstack.add else Table_By_Callstack.find, Table_By_Callstack.add in try let by_callstack = find stmt in begin try let o = Callstack.Hashtbl.find by_callstack callstack in Callstack.Hashtbl.replace by_callstack callstack(Cvalue.Model.join o v) with Not_found -> Callstack.Hashtbl.add by_callstack callstack v end; with Not_found -> let r = Callstack.Hashtbl.create 7 in Callstack.Hashtbl.add r callstack v; add stmt r let merge_initial_state cs state = let open Value_types in let kf = match cs with (kf, _) :: _ -> kf | _ -> assert false in let by_callstack = try Called_Functions_By_Callstack.find kf with Not_found -> let h = Callstack.Hashtbl.create 7 in Called_Functions_By_Callstack.add kf h; h in try let old = Callstack.Hashtbl.find by_callstack cs in Callstack.Hashtbl.replace by_callstack cs (Cvalue.Model.join old state) with Not_found -> Callstack.Hashtbl.add by_callstack cs state let get_initial_state kf = assert (is_computed ()); (* this assertion fails during value analysis *) try Called_Functions_Memo.find kf with Not_found -> let state = try let open Value_types in let by_callstack = Called_Functions_By_Callstack.find kf in Callstack.Hashtbl.fold (fun _cs state acc -> Cvalue.Model.join acc state) by_callstack Cvalue.Model.bottom with Not_found -> Cvalue.Model.bottom in Called_Functions_Memo.add kf state; state let get_initial_state_callstack kf = assert (is_computed ()); (* this assertion fails during value analysis *) try Some (Called_Functions_By_Callstack.find kf) with Not_found -> None let valid_behaviors = mk_fun "Value.get_valid_behaviors" let add_formals_to_state = mk_fun "add_formals_to_state" let noassert_get_stmt_state ~after s = if !no_results (Kernel_function.(get_definition (find_englobing_kf s))) then Cvalue.Model.top else let (find, add), find_by_callstack = if after then AfterTable.(find, add), AfterTable_By_Callstack.find else Table.(find, add), Table_By_Callstack.find in try find s with Not_found -> let ho = try Some (find_by_callstack s) with Not_found -> None in let state = match ho with | None -> Cvalue.Model.bottom | Some h -> Value_types.Callstack.Hashtbl.fold (fun _cs state acc -> Cvalue.Model.join acc state ) h Cvalue.Model.bottom in add s state; state let noassert_get_state ?(after=false) k = match k with | Kglobal -> globals_state () | Kstmt s -> noassert_get_stmt_state ~after s let get_stmt_state ?(after=false) s = assert (is_computed ()); (* this assertion fails during value analysis *) noassert_get_stmt_state ~after s let get_state ?(after=false) k = assert (is_computed ()); (* this assertion fails during value analysis *) noassert_get_state ~after k let get_stmt_state_callstack ~after stmt = assert (is_computed ()); (* this assertion fails during value analysis *) try Some (if after then AfterTable_By_Callstack.find stmt else Table_By_Callstack.find stmt) with Not_found -> None let fold_stmt_state_callstack f acc ~after stmt = assert (is_computed ()); (* this assertion fails during value analysis *) match get_stmt_state_callstack ~after stmt with | None -> acc | Some h -> Value_types.Callstack.Hashtbl.fold (fun _ -> f) h acc let fold_state_callstack f acc ~after ki = assert (is_computed ()); (* this assertion fails during value analysis *) match ki with | Kglobal -> f (globals_state ()) acc | Kstmt stmt -> fold_stmt_state_callstack f acc ~after stmt let is_reachable = Cvalue.Model.is_reachable exception Is_reachable let is_reachable_stmt stmt = if !no_results (Kernel_function.(get_definition (find_englobing_kf stmt))) then true else let ho = try Some (Table_By_Callstack.find stmt) with Not_found -> None in match ho with | None -> false | Some h -> try Value_types.Callstack.Hashtbl.iter (fun _cs state -> if Cvalue.Model.is_reachable state then raise Is_reachable) h; false with Is_reachable -> true let is_accessible ki = match ki with | Kglobal -> Cvalue.Model.is_reachable (globals_state ()) | Kstmt stmt -> is_reachable_stmt stmt let is_called = mk_fun "Value.is_called" let callers = mk_fun "Value.callers" let access_location = mk_fun "Value.access_location" let find state loc = Cvalue.Model.find state loc let access = mk_fun "Value.access" let access_expr = mk_fun "Value.access_expr" (** Type for a Value builtin function *) type builtin_sig = state -> (Cil_types.exp * Cvalue.V.t * Cvalue.V_Offsetmap.t) list -> Value_types.call_result exception Outside_builtin_possibilities let register_builtin = mk_fun "Value.register_builtin" let registered_builtins = mk_fun "Value.registered_builtins" let mem_builtin = mk_fun "Value.mem_builtin" let use_spec_instead_of_definition = mk_fun "Value.use_spec_instead_of_definition" let eval_lval = ref (fun ?with_alarms:_ _ -> mk_labeled_fun "Value.eval_lval") let eval_expr = ref (fun ?with_alarms:_ _ -> mk_labeled_fun "Value.eval_expr") let eval_expr_with_state = ref (fun ?with_alarms:_ _ -> mk_labeled_fun "Value.eval_expr_with_state") let reduce_by_cond = mk_fun "Value.reduce_by_cond" let find_lv_plus = mk_fun "Value.find_lv_plus" let pretty_state = Cvalue.Model.pretty let pretty = Cvalue.V.pretty let compute = mk_fun "Value.compute" let memoize = mk_fun "Value.memoize" let expr_to_kernel_function = mk_fun "Value.expr_to_kernel_function" let expr_to_kernel_function_state = mk_fun "Value.expr_to_kernel_function_state" exception Not_a_call let call_to_kernel_function call_stmt = match call_stmt.skind with | Instr (Call (_, fexp, _, _)) -> let _, called_functions = !expr_to_kernel_function ?with_alarms:None ~deps:None (Kstmt call_stmt) fexp in called_functions | Instr(Local_init(_, ConsInit(f,_,_),_)) -> Kernel_function.Hptset.singleton (Globals.Functions.get f) | _ -> raise Not_a_call let lval_to_loc_with_deps = mk_fun "Value.lval_to_loc_with_deps" let lval_to_loc_with_deps_state = mk_fun "Value.lval_to_loc_with_deps_state" let lval_to_loc = mk_fun "Value.lval_to_loc" let lval_to_offsetmap = mk_fun "Value.lval_to_offsetmap" let lval_to_offsetmap_state = mk_fun "Value.lval_to_offsetmap_state" let lval_to_loc_state = mk_fun "Value.lval_to_loc_state" let lval_to_zone = mk_fun "Value.lval_to_zone" let lval_to_zone_state = mk_fun "Value.lval_to_zone_state" let lval_to_zone_with_deps_state = mk_fun "Value.lval_to_zone_with_deps_state" let lval_to_precise_loc_state = ref (fun ?with_alarms:_ _ -> mk_labeled_fun "Value.lval_to_precise_loc") let lval_to_precise_loc_with_deps_state = mk_fun "Value.lval_to_precise_loc_with_deps_state" let assigns_inputs_to_zone = mk_fun "Value.assigns_inputs_to_zone" let assigns_outputs_to_zone = mk_fun "Value.assigns_outputs_to_zone" let assigns_outputs_to_locations = mk_fun "Value.assigns_outputs_to_locations" let verify_assigns_froms = mk_fun "Value.verify_assigns_froms" module Logic = struct let eval_predicate = ref (fun ~pre:_ ~here:_ _ -> raise (Extlib.Unregistered_function "Function 'Value.Logic.eval_predicate' not registered yet")) end exception Void_Function let find_return_loc kf = try let ki = Kernel_function.find_return kf in let lval = match ki with | { skind = Return (Some ({enode = Lval ((_ , offset) as lval)}), _) } -> assert (offset = NoOffset) ; lval | { skind = Return (None, _) } -> raise Void_Function | _ -> assert false in !lval_to_loc (Kstmt ki) ?with_alarms:None lval with Kernel_function.No_Statement -> (* [JS 2011/05/17] should be better to have another name for this exception or another one since it is possible to have no return without returning void (the case when the kf corresponds to a declaration *) raise Void_Function exception Aborted let display = mk_fun "Value.display" let emitter = ref Emitter.dummy end module From = struct exception Not_lval let access = mk_fun "From.access" let find_deps_no_transitivity = mk_fun "From.find_deps_no_transitivity" let find_deps_no_transitivity_state = mk_fun "From.find_deps_no_transitivity_state" let find_deps_term_no_transitivity_state = mk_fun "From.find_deps_term_no_transitivity_state" let compute = mk_fun "From.compute" let compute_all = mk_fun "From.compute_all" let compute_all_calldeps = mk_fun "From.compute_all_calldeps" let is_computed = mk_fun "From.is_computed" let pretty = mk_fun "From.pretty" let get = mk_fun "From.get" let self = ref State.dummy let display = mk_fun "From.display" module Record_From_Callbacks = Hook.Build (struct type t = (Kernel_function.t Stack.t) * Function_Froms.Memory.t Stmt.Hashtbl.t * (Kernel_function.t * Function_Froms.Memory.t) list Stmt.Hashtbl.t end) module Callwise = struct let iter = mk_fun "From.Callwise.iter" let find = mk_fun "From.Callwise.find" end end (* ************************************************************************* *) (** {2 PDG} *) (* ************************************************************************* *) module Pdg = struct type t = PdgTypes.Pdg.t type t_nodes_and_undef = ((PdgTypes.Node.t * Locations.Zone.t option) list * Locations.Zone.t option) exception Top = PdgTypes.Pdg.Top exception Bottom = PdgTypes.Pdg.Bottom let self = ref State.dummy let get = mk_fun "Pdg.get" let from_same_fun pdg1 pdg2 = let kf1 = PdgTypes.Pdg.get_kf pdg1 in let kf2 = PdgTypes.Pdg.get_kf pdg2 in Kernel_function.equal kf1 kf2 let node_key = mk_fun "Pdg.node_key" let find_decl_var_node = mk_fun "Pdg.find_decl_var_node" let find_input_node = mk_fun "Pdg.find_input_nodes" let find_ret_output_node = mk_fun "Pdg.find_ret_output_node" let find_output_nodes = mk_fun "Pdg.find_output_nodes" let find_all_inputs_nodes = mk_fun "Pdg.find_all_inputs_nodes" let find_stmt_and_blocks_nodes = mk_fun "Pdg.find_stmt_and_blocks_nodes" let find_simple_stmt_nodes = mk_fun "Pdg.find_simplestmt_nodes" let find_stmt_node = mk_fun "Pdg.find_stmt_node" let find_label_node = mk_fun "Pdg.find_label_node" let find_entry_point_node = mk_fun "Pdg.find_entry_point_node" let find_top_input_node = mk_fun "Pdg.find_top_input_node" let find_call_ctrl_node = mk_fun "Pdg.find_call_ctrl_node" let find_location_nodes_at_stmt = mk_fun "Pdg.find_location_nodes_at_stmt" let find_location_nodes_at_end = mk_fun "Pdg.find_location_nodes_at_end" let find_location_nodes_at_begin = mk_fun "Pdg.find_location_nodes_at_begin" let find_call_input_node = mk_fun "Pdg.find_call_input_node" let find_call_output_node = mk_fun "Pdg.find_call_output_node" let find_code_annot_nodes = mk_fun "Pdg.find_code_annot_nodes" let find_fun_precond_nodes = mk_fun "Pdg.find_fun_precond_nodes" let find_fun_postcond_nodes = mk_fun "Pdg.find_fun_postcond_nodes" let find_fun_variant_nodes = mk_fun "Pdg.find_fun_variant_nodes" let find_call_out_nodes_to_select = mk_fun "Pdg.find_call_out_nodes_to_select" let find_in_nodes_to_select_for_this_call = mk_fun "Pdg.find_in_nodes_to_select_for_this_call" let direct_dpds = mk_fun "Pdg.direct_dpds" let direct_ctrl_dpds = mk_fun "Pdg.direct_ctrl_dpds" let direct_data_dpds = mk_fun "Pdg.direct_data_dpds" let direct_addr_dpds = mk_fun "Pdg.direct_addr_dpds" let all_dpds = mk_fun "Pdg.all_dpds" let all_ctrl_dpds = mk_fun "Pdg.all_ctrl_dpds" let all_data_dpds = mk_fun "Pdg.all_data_dpds" let all_addr_dpds = mk_fun "Pdg.all_addr_dpds" let direct_uses = mk_fun "Pdg.direct_uses" let direct_ctrl_uses = mk_fun "Pdg.direct_ctrl_uses" let direct_data_uses = mk_fun "Pdg.direct_data_uses" let direct_addr_uses = mk_fun "Pdg.direct_addr_uses" let all_uses = mk_fun "Pdg.all_uses" let custom_related_nodes = mk_fun "Pdg.custom_related_nodes" let find_call_stmts = mk_fun "Pdg.find_call_stmts" let iter_nodes = mk_fun "Pdg.iter_nodes" let extract = mk_fun "Pdg.extract" let pretty = ref (fun ?bw:_ _ _ -> mk_labeled_fun "Pdg.pretty") let pretty_node = mk_fun "Pdg.pretty_node" let pretty_key = mk_fun "Pdg.pretty_key" end (* ************************************************************************* *) (** {2 Properties} *) (* ************************************************************************* *) module Properties = struct let mk_resultfun s = ref (fun ~result:_ -> failwith (Printf.sprintf "Function '%s' not registered yet" s)) module Interp = struct exception No_conversion (** Interpretation and conversions of of formulas *) let code_annot = mk_fun "Properties.Interp.code_annot" let term_lval = mk_fun "Properties.Interp.term_lval" let term = mk_fun "Properties.Interp.term" let predicate = mk_fun "Properties.Interp.predicate" let term_lval_to_lval = mk_resultfun "Properties.Interp.term_lval_to_lval" let term_to_exp = mk_resultfun "Properties.Interp.term_to_exp" let term_to_lval = mk_resultfun "Properties.Interp.term_to_lval" let loc_to_lval = mk_resultfun "Properties.Interp.loc_to_lval" (* loc_to_loc and loc_to_locs are defined in Value/Eval_logic, not in Logic_interp *) let loc_to_loc = mk_resultfun "Properties.Interp.loc_to_loc" let loc_to_loc_under_over = mk_resultfun "Properties.Interp.loc_to_loc_with_deps" let loc_to_offset = mk_resultfun "Properties.Interp.loc_to_offset" let loc_to_exp = mk_resultfun "Properties.Interp.loc_to_exp" let term_offset_to_offset = mk_resultfun "Properties.Interp.term_offset_to_offset" module To_zone : sig (** The signature of the mli is copy pasted here because of http://caml.inria.fr/mantis/view.php?id=7313 *) type t_ctx = {state_opt:bool option; ki_opt:(stmt * bool) option; kf:Kernel_function.t} val mk_ctx_func_contrat: (kernel_function -> state_opt:bool option -> t_ctx) ref (** To build an interpretation context relative to function contracts. *) val mk_ctx_stmt_contrat: (kernel_function -> stmt -> state_opt:bool option -> t_ctx) ref (** To build an interpretation context relative to statement contracts. *) val mk_ctx_stmt_annot: (kernel_function -> stmt -> t_ctx) ref (** To build an interpretation context relative to statement annotations. *) type t = {before:bool ; ki:stmt ; zone:Locations.Zone.t} type t_zone_info = (t list) option (** list of zones at some program points. * None means that the computation has failed. *) type t_decl = {var: Varinfo.Set.t ; (* related to vars of the annot *) lbl: Logic_label.Set.t} (* related to labels of the annot *) type t_pragmas = {ctrl: Stmt.Set.t ; (* related to //@ slice pragma ctrl/expr *) stmt: Stmt.Set.t} (* related to statement assign and //@ slice pragma stmt *) val from_term: (term -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the [term] relative to the [ctx] of interpretation. *) val from_terms: (term list -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the list of [terms] relative to the [ctx] of interpretation. *) val from_pred: (predicate -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the [predicate] relative to the [ctx] of interpretation. *) val from_preds: (predicate list -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the list of [predicates] relative to the [ctx] of interpretation. *) val from_zone: (identified_term -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the [zone] relative to the [ctx] of interpretation. *) val from_stmt_annot: (code_annotation -> stmt * kernel_function -> (t_zone_info * t_decl) * t_pragmas) ref (** Entry point to get zones needed to evaluate an annotation on the given stmt. *) val from_stmt_annots: ((code_annotation -> bool) option -> stmt * kernel_function -> (t_zone_info * t_decl) * t_pragmas) ref (** Entry point to get zones needed to evaluate annotations of this [stmt]. *) val from_func_annots: (((stmt -> unit) -> kernel_function -> unit) -> (code_annotation -> bool) option -> kernel_function -> (t_zone_info * t_decl) * t_pragmas) ref (** Entry point to get zones needed to evaluate annotations of this [kf]. *) val code_annot_filter: (code_annotation -> threat:bool -> user_assert:bool -> slicing_pragma:bool -> loop_inv:bool -> loop_var:bool -> others:bool -> bool) ref (** To quickly build an annotation filter *) end = struct type t_ctx = { state_opt: bool option; ki_opt: (stmt * bool) option; kf:Kernel_function.t } let mk_ctx_func_contrat = mk_fun "Interp.To_zone.mk_ctx_func_contrat" let mk_ctx_stmt_contrat = mk_fun "Interp.To_zone.mk_ctx_stmt_contrat" let mk_ctx_stmt_annot = mk_fun "Interp.To_zone.mk_ctx_stmt_annot" type t = {before:bool ; ki:stmt ; zone:Locations.Zone.t} type t_zone_info = (t list) option type t_decl = { var: Varinfo.Set.t; lbl: Logic_label.Set.t } type t_pragmas = { ctrl: Stmt.Set.t; stmt: Stmt.Set.t } let from_term = mk_fun "Interp.To_zone.from_term" let from_terms= mk_fun "Interp.To_zone.from_terms" let from_pred = mk_fun "Interp.To_zone.from_pred" let from_preds= mk_fun "Interp.To_zone.from_preds" let from_zone = mk_fun "Interp.To_zone.from_zone" let from_stmt_annot= mk_fun "Interp.To_zone.from_stmt_annot" let from_stmt_annots= mk_fun "Interp.To_zone.from_stmt_annots" let from_func_annots= mk_fun "Interp.To_zone.from_func_annots" let code_annot_filter= mk_fun "Interp.To_zone.code_annot_filter" end let to_result_from_pred = mk_fun "Properties.Interp.to_result_from_pred" end let add_assert emitter kf kinstr prop = Kernel.deprecated "Db.Properties.add_assert" ~now:"ACSL_importer plug-in" (fun () -> let interp_prop = !Interp.code_annot kf kinstr prop in Annotations.add_code_annot emitter kinstr interp_prop) () end (* ************************************************************************* *) (** {2 Others plugins} *) (* ************************************************************************* *) module Security = struct let run_whole_analysis = mk_fun "Security.run_whole_analysis" let run_ai_analysis = mk_fun "Security.run_ai_analysis" let run_slicing_analysis = mk_fun "Security.run_slicing_analysis" let self = ref State.dummy end module RteGen = struct type status_accessor = string * (kernel_function -> bool -> unit) * (kernel_function -> bool) let compute = mk_fun "RteGen.compute" let annotate_kf = mk_fun "RteGen.annotate_kf" let self = ref State.dummy let do_all_rte = mk_fun "RteGen.do_all_rte" let do_rte = mk_fun "RteGen.do_rte" let get_all_status = mk_fun "RteGen.get_all_status" let get_signedOv_status = mk_fun "RteGen.get_signedOv_status" let get_divMod_status = mk_fun "RteGen.get_divMod_status" let get_initialized_status = mk_fun "RteGen.get_initialized_status" let get_signed_downCast_status = mk_fun "RteGen.get_signed_downCast_status" let get_memAccess_status = mk_fun "RteGen.get_memAccess_status" let get_pointerCall_status = mk_fun "RteGen.get_pointerCall_status" let get_unsignedOv_status = mk_fun "RteGen.get_unsignedOv_status" let get_unsignedDownCast_status = mk_fun "RteGen.get_unsignedDownCast_status" let get_float_to_int_status = mk_fun "RteGen.get_float_to_int_status" let get_finite_float_status = mk_fun "RteGen.get_finite_float_status" let get_bool_value_status = mk_fun "RteGen.get_bool_value_status" end module PostdominatorsTypes = struct exception Top module type Sig = sig val compute: (kernel_function -> unit) ref val stmt_postdominators: (kernel_function -> stmt -> Stmt.Hptset.t) ref val is_postdominator: (kernel_function -> opening:stmt -> closing:stmt -> bool) ref val display: (unit -> unit) ref val print_dot : (string -> kernel_function -> unit) ref end end module Postdominators = struct let compute = mk_fun "Postdominators.compute" let is_postdominator : (kernel_function -> opening:stmt -> closing:stmt -> bool) ref = mk_fun "Postdominators.is_postdominator" let stmt_postdominators = mk_fun "Postdominators.stmt_postdominators" let display = mk_fun "Postdominators.display" let print_dot = mk_fun "Postdominators.print_dot" end module PostdominatorsValue = struct let compute = mk_fun "PostdominatorsValue.compute" let is_postdominator : (kernel_function -> opening:stmt -> closing:stmt -> bool) ref = mk_fun "PostdominatorsValue.is_postdominator" let stmt_postdominators = mk_fun "PostdominatorsValue.stmt_postdominators" let display = mk_fun "PostdominatorsValue.display" let print_dot = mk_fun "PostdominatorsValue.print_dot" end (* ************************************************************************* *) (** {2 GUI} *) (* ************************************************************************* *) let progress = ref (fun () -> ()) exception Cancel (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/db.mli0000666000000000000000000014566013571573400022404 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Database in which static plugins are registered. @plugin development guide *) (** Modules providing general services: - {!Dynamic}: API for plug-ins linked dynamically - {!Journal}: journalisation - {!Log}: message outputs and printers - {!Plugin}: general services for plug-ins - {!Project} and associated files: {!Kind}, {!Datatype} and {!State_builder}. Other main kernel modules: - {!Ast}: the cil AST - {!Ast_info}: syntactic value directly computed from the Cil Ast - {!File}: Cil file initialization - {!Globals}: global variables, functions and annotations - {!Annotations}: annotations associated with a statement - {!Properties_status}: status of annotations - {!Kernel_function}: C functions as seen by Frama-C - {!Stmts_graph}: the statement graph - {!Loop}: (natural) loops - {!Visitor}: frama-c visitors - {!Kernel}: general parameters of Frama-C (mostly set from the command line) *) open Cil_types open Cil_datatype (* ************************************************************************* *) (** {2 Registering} *) (* ************************************************************************* *) (** How to journalize the given function. @since Beryllium-20090601-beta1 *) type 'a how_to_journalize = | Journalize of string * 'a Type.t (** Journalize the value with the given name and type. *) | Journalization_not_required (** Journalization of this value is not required (usually because it has no effect on the Frama-C global state). *) | Journalization_must_not_happen of string (** Journalization of this value should not happen (usually because it is a low-level function: this function is always called from a journalized function). The string is the function name which is used for displaying suitable error message. *) val register: 'a how_to_journalize -> 'a ref -> 'a -> unit (** Plugins must register values with this function. *) val register_compute: string -> State.t list -> (unit -> unit) ref -> (unit -> unit) -> State.t (** @modify Boron-20100401 now return the state of the computation. *) val register_guarded_compute: string -> (unit -> bool) -> (unit -> unit) ref -> (unit -> unit) -> unit (** Frama-C main interface. @since Lithium-20081201 @plugin development guide *) module Main: sig val extend : (unit -> unit) -> unit (** Register a function to be called by the Frama-C main entry point. @plugin development guide *) val play: (unit -> unit) ref (** Run all the Frama-C analyses. This function should be called only by toplevels. @since Beryllium-20090901 *) (**/**) val apply: unit -> unit (** Not for casual user. *) (**/**) end module Toplevel: sig val run: ((unit -> unit) -> unit) ref (** Run a Frama-C toplevel playing the game given in argument (in particular, applying the argument runs the analyses). @since Beryllium-20090901 *) end (* ************************************************************************* *) (** {2 Values} *) (* ************************************************************************* *) (** The Value analysis itself. @see <../value/index.html> internal documentation. *) module Value : sig type state = Cvalue.Model.t (** Internal state of the value analysis. *) type t = Cvalue.V.t (** Internal representation of a value. *) exception Aborted val emitter: Emitter.t ref (** Emitter used by Value to emit statuses *) val self : State.t (** Internal state of the value analysis from projects viewpoint. @plugin development guide *) val mark_as_computed: unit -> unit (** Indicate that the value analysis has been done already. *) val compute : (unit -> unit) ref (** Compute the value analysis using the entry point of the current project. You may set it with {!Globals.set_entry_point}. @raise Globals.No_such_entry_point if the entry point is incorrect @raise Db.Value.Incorrect_number_of_arguments if some arguments are specified for the entry point using {!Db.Value.fun_set_args}, and an incorrect number of them is given. @plugin development guide *) val is_computed: unit -> bool (** Return [true] iff the value analysis has been done. @plugin development guide *) module Table_By_Callstack: State_builder.Hashtbl with type key = stmt and type data = state Value_types.Callstack.Hashtbl.t (** Table containing the results of the value analysis, ie. the state before the evaluation of each reachable statement. *) module AfterTable_By_Callstack: State_builder.Hashtbl with type key = stmt and type data = state Value_types.Callstack.Hashtbl.t (** Table containing the state of the value analysis after the evaluation of each reachable and evaluable statement. Filled only if [Value_parameters.ResultsAfter] is set. *) val ignored_recursive_call: kernel_function -> bool (** This functions returns true if the value analysis found and ignored a recursive call to this function during the analysis. *) val condition_truth_value: stmt -> bool * bool (** Provided [stmt] is an 'if' construct, [fst (condition_truth_value stmt)] (resp. snd) is true if and only if the condition of the 'if' has been evaluated to true (resp. false) at least once during the analysis. *) (** {3 Parameterization} *) exception Outside_builtin_possibilities (** Type for a Value builtin function *) type builtin_sig = (** Memory state at the beginning of the function *) state -> (** Args for the function: the expressions corresponding to the formals of the functions at the call site, the actual value of those formals, and a more precise view of those formals using offsetmaps (for eg. structs) *) (Cil_types.exp * Cvalue.V.t * Cvalue.V_Offsetmap.t) list -> Value_types.call_result val register_builtin: (string -> ?replace:string -> builtin_sig -> unit) ref (** [!register_builtin name ?replace f] registers an abstract function [f] to use everytime a C function named [name] is called in the program. If [replace] is supplied and option [-val-builtins-auto] is active, calls to [replace] will also be substituted by the builtin. See also option [-val-builtin] *) val registered_builtins: (unit -> (string * builtin_sig) list) ref (** Returns a list of the pairs (name, builtin_sig) registered via [register_builtin]. @since Aluminium-20160501 *) val mem_builtin: (string -> bool) ref (** returns whether there is an abstract function registered by {!register_builtin} with the given name. *) val use_spec_instead_of_definition: (kernel_function -> bool) ref (** To be called by derived analyses to determine if they must use the body of the function (if available), or only its spec. Used for value builtins, and option -val-use-spec. *) (** {4 Arguments of the main function} *) (** The functions below are related to the arguments that are passed to the function that is analysed by the value analysis. Specific arguments are set by [fun_set_args]. Arguments reset to default values when [fun_use_default_args] is called, when the ast is changed, or if the options [-libentry] or [-main] are changed. *) (** Specify the arguments to use. This function is not journalized, and will generate an error when the journal is replayed *) val fun_set_args : t list -> unit val fun_use_default_args : unit -> unit (** For this function, the result [None] means that default values are used for the arguments. *) val fun_get_args : unit -> t list option exception Incorrect_number_of_arguments (** Raised by [Db.Compute] when the arguments set by [fun_set_args] are not coherent with the prototype of the function (if there are too few or too many of them) *) (** {4 Initial state of the analysis} *) (** The functions below are related to the value of the global variables when the value analysis is started. If [globals_set_initial_state] has not been called, the given state is used. A default state (which depends on the option [-libentry]) is used when [globals_use_default_initial_state] is called, or when the ast changes. *) (** Specify the initial state to use. This function is not journalized, and will generate an error when the journal is replayed *) val globals_set_initial_state : state -> unit val globals_use_default_initial_state : unit -> unit (** Initial state used by the analysis *) val globals_state : unit -> state (** @return [true] if the initial state for globals used by the value analysis has been supplied by the user (through [globals_set_initial_state]), or [false] if it is automatically computed by the value analysis *) val globals_use_supplied_state : unit -> bool (** {3 Getters} *) (** State of the analysis at various points *) val get_initial_state : kernel_function -> state val get_initial_state_callstack : kernel_function -> state Value_types.Callstack.Hashtbl.t option val get_state : ?after:bool -> kinstr -> state (** [after] is false by default. *) val get_stmt_state_callstack: after:bool -> stmt -> state Value_types.Callstack.Hashtbl.t option val get_stmt_state : ?after:bool -> stmt -> state (** [after] is false by default. @plugin development guide *) val fold_stmt_state_callstack : (state -> 'a -> 'a) -> 'a -> after:bool -> stmt -> 'a val fold_state_callstack : (state -> 'a -> 'a) -> 'a -> after:bool -> kinstr -> 'a val find : state -> Locations.location -> t (** {3 Evaluations} *) val eval_lval : (?with_alarms:CilE.warn_mode -> Locations.Zone.t option -> state -> lval -> Locations.Zone.t option * t) ref val eval_expr : (?with_alarms:CilE.warn_mode -> state -> exp -> t) ref val eval_expr_with_state : (?with_alarms:CilE.warn_mode -> state -> exp -> state * t) ref val reduce_by_cond: (state -> exp -> bool -> state) ref val find_lv_plus : (Cvalue.Model.t -> Cil_types.exp -> (Cil_types.lval * Ival.t) list) ref (** returns the list of all decompositions of [expr] into the sum an lvalue and an interval. *) (** {3 Values and kernel functions} *) val expr_to_kernel_function : (kinstr -> ?with_alarms:CilE.warn_mode -> deps:Locations.Zone.t option -> exp -> Locations.Zone.t * Kernel_function.Hptset.t) ref val expr_to_kernel_function_state : (state -> deps:Locations.Zone.t option -> exp -> Locations.Zone.t * Kernel_function.Hptset.t) ref exception Not_a_call val call_to_kernel_function : stmt -> Kernel_function.Hptset.t (** Return the functions that can be called from this call. @raise Not_a_call if the statement is not a call. *) val valid_behaviors: (kernel_function -> state -> funbehavior list) ref val add_formals_to_state: (state -> kernel_function -> exp list -> state) ref (** [add_formals_to_state state kf exps] evaluates [exps] in [state] and binds them to the formal arguments of [kf] in the resulting state *) (** {3 Reachability} *) val is_accessible : kinstr -> bool val is_reachable : state -> bool (** @plugin development guide *) val is_reachable_stmt : stmt -> bool (** {3 About kernel functions} *) exception Void_Function val find_return_loc : kernel_function -> Locations.location (** Return the location of the returned lvalue of the given function. @raise Void_Function if the function does not return any value. *) val is_called: (kernel_function -> bool) ref val callers: (kernel_function -> (kernel_function*stmt list) list) ref (** @return the list of callers with their call sites. Each function is present only once in the list. *) (** {3 State before a kinstr} *) val access : (kinstr -> lval -> t) ref val access_expr : (kinstr -> exp -> t) ref val access_location : (kinstr -> Locations.location -> t) ref (** {3 Locations of left values} *) val lval_to_loc : (kinstr -> ?with_alarms:CilE.warn_mode -> lval -> Locations.location) ref val lval_to_loc_with_deps : (kinstr -> ?with_alarms:CilE.warn_mode -> deps:Locations.Zone.t -> lval -> Locations.Zone.t * Locations.location) ref val lval_to_loc_with_deps_state : (state -> deps:Locations.Zone.t -> lval -> Locations.Zone.t * Locations.location) ref val lval_to_loc_state : (state -> lval -> Locations.location) ref val lval_to_offsetmap : ( kinstr -> ?with_alarms:CilE.warn_mode -> lval -> Cvalue.V_Offsetmap.t option) ref val lval_to_offsetmap_state : (state -> lval -> Cvalue.V_Offsetmap.t option) ref (** @since Carbon-20110201 *) val lval_to_zone : (kinstr -> ?with_alarms:CilE.warn_mode -> lval -> Locations.Zone.t) ref val lval_to_zone_state : (state -> lval -> Locations.Zone.t) ref (** Does not emit alarms. *) val lval_to_zone_with_deps_state: (state -> for_writing:bool -> deps:Locations.Zone.t option -> lval -> Locations.Zone.t * Locations.Zone.t * bool) ref (** [lval_to_zone_with_deps_state state ~for_writing ~deps lv] computes [res_deps, zone_lv, exact], where [res_deps] are the memory zones needed to evaluate [lv] in [state] joined with [deps]. [zone_lv] contains the valid memory zones that correspond to the location that [lv] evaluates to in [state]. If [for_writing] is true, [zone_lv] is restricted to memory zones that are writable. [exact] indicates that [lv] evaluates to a valid location of cardinal at most one. *) val lval_to_precise_loc_state: (?with_alarms:CilE.warn_mode -> state -> lval -> state * Precise_locs.precise_location * typ) ref val lval_to_precise_loc_with_deps_state: (state -> deps:Locations.Zone.t option -> lval -> Locations.Zone.t * Precise_locs.precise_location) ref (** Evaluation of the [\from] clause of an [assigns] clause.*) val assigns_inputs_to_zone : (state -> assigns -> Locations.Zone.t) ref (** Evaluation of the left part of [assigns] clause (without [\from]).*) val assigns_outputs_to_zone : (state -> result:varinfo option -> assigns -> Locations.Zone.t) ref (** Evaluation of the left part of [assigns] clause (without [\from]). Each assigns term results in one location. *) val assigns_outputs_to_locations : (state -> result:varinfo option -> assigns -> Locations.location list) ref (** For internal use only. Evaluate the [assigns] clause of the given function in the given prestate, compare it with the computed froms, return warning and set statuses. *) val verify_assigns_froms : (Kernel_function.t -> pre:state -> Function_Froms.t -> unit) ref (** {3 Evaluation of logic terms and predicates} *) module Logic : sig (** The APIs of this module are not stabilized yet, and are subject to change between Frama-C versions. *) val eval_predicate: (pre:state -> here:state -> predicate -> Property_status.emitted_status) ref (** Evaluate the given predicate in the given states for the Pre and Here ACSL labels. @since Neon-20140301 *) end (** {3 Callbacks} *) type callstack = Value_types.callstack (** Actions to perform at end of each function analysis. Not compatible with option [-memexec-all] *) module Record_Value_Callbacks: Hook.Iter_hook with type param = callstack * (state Stmt.Hashtbl.t) Lazy.t module Record_Value_Superposition_Callbacks: Hook.Iter_hook with type param = callstack * (state list Stmt.Hashtbl.t) Lazy.t module Record_Value_After_Callbacks: Hook.Iter_hook with type param = callstack * (state Stmt.Hashtbl.t) Lazy.t (**/**) (* Temporary API, do not use *) module Record_Value_Callbacks_New: Hook.Iter_hook with type param = callstack * ((state Stmt.Hashtbl.t) Lazy.t (* before states *) * (state Stmt.Hashtbl.t) Lazy.t) (* after states *) Value_types.callback_result (**/**) val no_results: (fundec -> bool) ref (** Returns [true] if the user has requested that no results should be recorded for this function. If possible, hooks registered on [Record_Value_Callbacks] and [Record_Value_Callbacks_New] should not force their lazy argument *) (** Actions to perform at each treatment of a "call" statement. [state] is the state before the call. @deprecated Use Call_Type_Value_Callbacks instead. *) module Call_Value_Callbacks: Hook.Iter_hook with type param = state * callstack (** Actions to perform at each treatment of a "call" statement. [state] is the state before the call. @since Aluminium-20160501 *) module Call_Type_Value_Callbacks: Hook.Iter_hook with type param = [`Builtin of Value_types.call_result | `Spec of funspec | `Def | `Memexec] * state * callstack (** Actions to perform whenever a statement is handled. *) module Compute_Statement_Callbacks: Hook.Iter_hook with type param = stmt * callstack * state list (* -remove-redundant-alarms feature, applied at the end of an Eva analysis, fulfilled by the Scope plugin that also depends on Eva. We thus use a reference here to avoid a cyclic dependency. *) val rm_asserts: (unit -> unit) ref (** {3 Pretty printing} *) val pretty : Format.formatter -> t -> unit val pretty_state : Format.formatter -> state -> unit val display : (Format.formatter -> kernel_function -> unit) ref (**/**) (** {3 Internal use only} *) val noassert_get_state : ?after:bool -> kinstr -> state (** To be used during the value analysis itself (instead of {!get_state}). [after] is false by default. *) val recursive_call_occurred: kernel_function -> unit val merge_conditions: int Cil_datatype.Stmt.Hashtbl.t -> unit val mask_then: int val mask_else: int val initial_state_only_globals : (unit -> state) ref val update_callstack_table: after:bool -> stmt -> callstack -> state -> unit (* Merge a new state in the table indexed by callstacks. *) val memoize : (kernel_function -> unit) ref (* val compute_call : (kernel_function -> call_kinstr:kinstr -> state -> (exp*t) list -> Cvalue.V_Offsetmap.t option (** returned value of [kernel_function] *) * state) ref *) val merge_initial_state : callstack -> state -> unit (** Store an additional possible initial state for the given callstack as well as its values for actuals. *) val initial_state_changed: (unit -> unit) ref end (** Functional dependencies between function inputs and function outputs. @see <../from/index.html> internal documentation. *) module From : sig (** exception raised by [find_deps_no_transitivity_*] if the given expression is not an lvalue. @since Aluminium-20160501 *) exception Not_lval val compute_all : (unit -> unit) ref val compute_all_calldeps : (unit -> unit) ref val compute : (kernel_function -> unit) ref val is_computed: (kernel_function -> bool) ref (** Check whether the from analysis has been performed for the given function. @return true iff the analysis has been performed *) val get : (kernel_function -> Function_Froms.t) ref val access : (Locations.Zone.t -> Function_Froms.Memory.t -> Locations.Zone.t) ref val find_deps_no_transitivity : (stmt -> exp -> Locations.Zone.t) ref val find_deps_no_transitivity_state : (Value.state -> exp -> Locations.Zone.t) ref (** @raise Not_lval if the given expression is not a C lvalue. *) val find_deps_term_no_transitivity_state : (Value.state -> term -> Value_types.logic_dependencies) ref val self: State.t ref (** {3 Pretty printing} *) val pretty : (Format.formatter -> kernel_function -> unit) ref val display : (Format.formatter -> unit) ref (** {3 Callback} *) module Record_From_Callbacks: Hook.Iter_hook with type param = Kernel_function.t Stack.t * Function_Froms.Memory.t Stmt.Hashtbl.t * (Kernel_function.t * Function_Froms.Memory.t) list Stmt.Hashtbl.t (** {3 Access to callwise-stored data} *) module Callwise : sig val iter : ((kinstr -> Function_Froms.t -> unit) -> unit) ref val find : (kinstr -> Function_Froms.t) ref end end (* ************************************************************************* *) (** {2 Properties} *) (* ************************************************************************* *) (** Dealing with logical properties. @plugin development guide *) module Properties : sig (** Interpretation of logic terms. *) module Interp : sig (** {3 Parsing logic terms and annotations} *) (** For the three functions below, [env] can be used to specify which logic labels are parsed. By default, only [Here] is accepted. All the C labels inside the function are also accepted, regardless of [env]. [loc] is used as the source for the beginning of the string. All three functions may raise {!Logic_interp.Error} or {!Parsing.Parse_error}. *) val term_lval : (kernel_function -> ?loc:location -> ?env:Logic_typing.Lenv.t -> string -> Cil_types.term_lval) ref val term : (kernel_function -> ?loc:location -> ?env:Logic_typing.Lenv.t -> string -> Cil_types.term) ref val predicate : (kernel_function -> ?loc:location -> ?env:Logic_typing.Lenv.t -> string -> Cil_types.predicate) ref val code_annot : (kernel_function -> stmt -> string -> code_annotation) ref (** {3 From logic terms to C terms} *) (** Exception raised by the functions below when their given argument cannot be interpreted in the C world. @since Aluminium-20160501 *) exception No_conversion val term_lval_to_lval: (result: Cil_types.varinfo option -> term_lval -> Cil_types.lval) ref (** @raise No_conversion if the argument is not a left value. @modify Aluminium-20160501 raises a custom exn instead of generic Invalid_arg *) val term_to_lval: (result: Cil_types.varinfo option -> term -> Cil_types.lval) ref (** @raise No_conversion if the argument is not a left value. @modify Aluminium-20160501 raises a custom exn instead of generic Invalid_arg *) val term_to_exp: (result: Cil_types.varinfo option -> term -> Cil_types.exp) ref (** @raise No_conversion if the argument is not a valid expression. @modify Aluminium-20160501 raises a custom exn instead of generic Invalid_arg *) val loc_to_exp: (result: Cil_types.varinfo option -> term -> Cil_types.exp list) ref (** @return a list of C expressions. @raise No_conversion if the argument is not a valid set of expressions. @modify Aluminium-20160501 raises a custom exn instead of generic Invalid_arg *) val loc_to_lval: (result: Cil_types.varinfo option -> term -> Cil_types.lval list) ref (** @return a list of C locations. @raise No_conversion if the argument is not a valid set of left values. @modify Aluminium-20160501 raises a custom exn instead of generic Invalid_arg *) val term_offset_to_offset: (result: Cil_types.varinfo option -> term_offset -> offset) ref (** @raise No_conversion if the argument is not a valid offset. @modify Aluminium-20160501 raises a custom exn instead of generic Invalid_arg *) val loc_to_offset: (result: Cil_types.varinfo option -> term -> Cil_types.offset list) ref (** @return a list of C offset provided the term denotes locations who have all the same base address. @raise No_conversion if the given term does not match the precondition @modify Aluminium-20160501 raises a custom exn instead of generic Invalid_arg *) (** {3 From logic terms to Locations.location} *) val loc_to_loc: (result: Cil_types.varinfo option -> Value.state -> term -> Locations.location) ref (** @raise No_conversion if the translation fails. @modify Aluminium-20160501 raises a custom exn instead of generic Invalid_arg *) val loc_to_loc_under_over: (result: Cil_types.varinfo option -> Value.state -> term -> Locations.location * Locations.location * Locations.Zone.t) ref (** Same as {!loc_to_loc}, except that we return simultaneously an under-approximation of the term (first location), and an over-approximation (second location). The under-approximation is particularly useful when evaluating Tsets. The zone returned is an over-approximation of locations that have been read during evaluation. Warning: This API is not stabilized, and may change in the future. @raise No_conversion if the translation fails. @modify Aluminium-20160501 raises a custom exn instead of generic Invalid_arg *) (** {3 From logic terms to Zone.t} *) module To_zone : sig type t_ctx = {state_opt:bool option; ki_opt:(stmt * bool) option; kf:Kernel_function.t} val mk_ctx_func_contrat: (kernel_function -> state_opt:bool option -> t_ctx) ref (** To build an interpretation context relative to function contracts. *) val mk_ctx_stmt_contrat: (kernel_function -> stmt -> state_opt:bool option -> t_ctx) ref (** To build an interpretation context relative to statement contracts. *) val mk_ctx_stmt_annot: (kernel_function -> stmt -> t_ctx) ref (** To build an interpretation context relative to statement annotations. *) type t = {before:bool ; ki:stmt ; zone:Locations.Zone.t} type t_zone_info = (t list) option (** list of zones at some program points. * None means that the computation has failed. *) type t_decl = {var: Varinfo.Set.t ; (* related to vars of the annot *) lbl: Logic_label.Set.t} (* related to labels of the annot *) type t_pragmas = {ctrl: Stmt.Set.t ; (* related to //@ slice pragma ctrl/expr *) stmt: Stmt.Set.t} (* related to statement assign and //@ slice pragma stmt *) val from_term: (term -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the [term] relative to the [ctx] of interpretation. *) val from_terms: (term list -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the list of [terms] relative to the [ctx] of interpretation. *) val from_pred: (predicate -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the [predicate] relative to the [ctx] of interpretation. *) val from_preds: (predicate list -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the list of [predicates] relative to the [ctx] of interpretation. *) val from_zone: (identified_term -> t_ctx -> t_zone_info * t_decl) ref (** Entry point to get zones needed to evaluate the [zone] relative to the [ctx] of interpretation. *) val from_stmt_annot: (code_annotation -> stmt * kernel_function -> (t_zone_info * t_decl) * t_pragmas) ref (** Entry point to get zones needed to evaluate an annotation on the given stmt. *) val from_stmt_annots: ((code_annotation -> bool) option -> stmt * kernel_function -> (t_zone_info * t_decl) * t_pragmas) ref (** Entry point to get zones needed to evaluate annotations of this [stmt]. *) val from_func_annots: (((stmt -> unit) -> kernel_function -> unit) -> (code_annotation -> bool) option -> kernel_function -> (t_zone_info * t_decl) * t_pragmas) ref (** Entry point to get zones needed to evaluate annotations of this [kf]. *) val code_annot_filter: (code_annotation -> threat:bool -> user_assert:bool -> slicing_pragma:bool -> loop_inv:bool -> loop_var:bool -> others:bool -> bool) ref (** To quickly build an annotation filter *) end (** Does the interpretation of the predicate rely on the interpretation of the term result? @since Carbon-20110201 *) val to_result_from_pred: (predicate -> bool) ref end (** {3 Assertions} *) val add_assert: Emitter.t -> kernel_function -> stmt -> string -> unit (** @deprecated since Oxygen-20120901 Ask for {ACSL_importer plug-in} if you need such functionality. @modify Boron-20100401 takes as additional argument the computation which adds the assert. @modify Oxygen-20120901 replaces the State.t list by an Emitter.t *) end (* ************************************************************************* *) (** {2 Plugins} *) (* ************************************************************************* *) (** Declarations common to the various postdominators-computing modules *) module PostdominatorsTypes: sig exception Top (** Used for postdominators-related functions, when the postdominators of a statement cannot be computed. It means that there is no path from this statement to the function return. *) module type Sig = sig val compute: (kernel_function -> unit) ref val stmt_postdominators: (kernel_function -> stmt -> Stmt.Hptset.t) ref (** @raise Top (see above) *) val is_postdominator: (kernel_function -> opening:stmt -> closing:stmt -> bool) ref val display: (unit -> unit) ref val print_dot : (string -> kernel_function -> unit) ref (** Print a representation of the postdominators in a dot file whose name is [basename.function_name.dot]. *) end end (** Syntactic postdominators plugin. @see <../postdominators/index.html> internal documentation. *) module Postdominators: PostdominatorsTypes.Sig (** Postdominators using value analysis results. @see <../postdominators/index.html> internal documentation. *) module PostdominatorsValue: PostdominatorsTypes.Sig (** Runtime Error Annotation Generation plugin. @see <../rte/index.html> internal documentation. *) module RteGen : sig (** Same result as having [-rte] on the command line*) val compute : (unit -> unit) ref (** Generates RTE for a single function. Uses the status of the various RTE options do decide which kinds of annotations must be generated. *) val annotate_kf : (kernel_function -> unit) ref (** Generates all possible RTE for a given function. *) val do_all_rte : (kernel_function -> unit) ref (** Generates all possible RTE except pre-conditions for a given function. *) val do_rte : (kernel_function -> unit) ref val self: State.t ref type status_accessor = string (* name *) * (kernel_function -> bool -> unit) (* for each kf and each kind of annotation, set/unset the fact that there has been generated *) * (kernel_function -> bool) (* is this kind of annotation generated in kf? *) val get_all_status : (unit -> status_accessor list) ref val get_divMod_status : (unit -> status_accessor) ref val get_initialized_status: (unit -> status_accessor) ref val get_memAccess_status : (unit -> status_accessor) ref val get_pointerCall_status: (unit -> status_accessor) ref val get_signedOv_status : (unit -> status_accessor) ref val get_signed_downCast_status : (unit -> status_accessor) ref val get_unsignedOv_status : (unit -> status_accessor) ref val get_unsignedDownCast_status : (unit -> status_accessor) ref val get_float_to_int_status : (unit -> status_accessor) ref val get_finite_float_status : (unit -> status_accessor) ref val get_bool_value_status : (unit -> status_accessor) ref end (** Security analysis. @see <../security/index.html> internal documentation. *) module Security : sig val run_whole_analysis: (unit -> unit) ref (** Run all the security analysis. *) val run_ai_analysis: (unit -> unit) ref (** Only run the analysis by abstract interpretation. *) val run_slicing_analysis: (unit -> Project.t) ref (** Only run the security slicing pre-analysis. *) val self: State.t ref end (** Program Dependence Graph. @see <../pdg/index.html> PDG internal documentation. *) module Pdg : sig exception Bottom (** Raised by most function when the PDG is Bottom because we can hardly do nothing with it. It happens when the function is unreachable because we have no information about it. *) exception Top (** Raised by most function when the PDG is Top because we can hardly do nothing with it. It happens when we didn't manage to compute it, for instance for a variadic function. *) type t = PdgTypes.Pdg.t (** PDG type *) type t_nodes_and_undef = ((PdgTypes.Node.t * Locations.Zone.t option) list * Locations.Zone.t option) (** type for the return value of many [find_xxx] functions when the answer can be a list of [(node, z_part)] and an [undef zone]. For each node, [z_part] can specify which part of the node is used in terms of zone ([None] means all). *) val self : State.t ref (** {3 Getters} *) val get : (kernel_function -> t) ref (** Get the PDG of a function. Build it if it doesn't exist yet. *) val node_key : (PdgTypes.Node.t -> PdgIndex.Key.t) ref val from_same_fun : t -> t -> bool (** {3 Finding PDG nodes} *) val find_decl_var_node : (t -> Cil_types.varinfo -> PdgTypes.Node.t) ref (** Get the node corresponding the declaration of a local variable or a formal parameter. @raise Not_found if the variable is not declared in this function. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_ret_output_node : (t -> PdgTypes.Node.t) ref (** Get the node corresponding return stmt. @raise Not_found if the output state in unreachable @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_output_nodes : (t -> PdgIndex.Signature.out_key -> t_nodes_and_undef) ref (** Get the nodes corresponding to a call output key in the called pdg. @raise Not_found if the output state in unreachable @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_input_node : (t -> int -> PdgTypes.Node.t) ref (** Get the node corresponding to a given input (parameter). @raise Not_found if the number is not an input number. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_all_inputs_nodes : (t -> PdgTypes.Node.t list) ref (** Get the nodes corresponding to all inputs. {!node_key} can be used to know their numbers. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_stmt_node : (t -> Cil_types.stmt -> PdgTypes.Node.t) ref (** Get the node corresponding to the statement. It shouldn't be a call statement. See also {!find_simple_stmt_nodes} or {!find_call_stmts}. @raise Not_found if the given statement is unreachable. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. @raise PdgIndex.CallStatement if the given stmt is a function call. *) val find_simple_stmt_nodes : (t -> Cil_types.stmt -> PdgTypes.Node.t list) ref (** Get the nodes corresponding to the statement. It is usually composed of only one node (see {!find_stmt_node}), except for call statement. Be careful that for block statements, it only returns a node corresponding to the elementary stmt (see {!find_stmt_and_blocks_nodes} for more) @raise Not_found if the given statement is unreachable. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_label_node : (t -> Cil_types.stmt -> Cil_types.label -> PdgTypes.Node.t) ref (** Get the node corresponding to the label. @raise Not_found if the given label is not in the PDG. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_stmt_and_blocks_nodes : (t -> Cil_types.stmt -> PdgTypes.Node.t list) ref (** Get the nodes corresponding to the statement like * {!find_simple_stmt_nodes} but also add the nodes of the enclosed * statements if [stmt] contains blocks. @raise Not_found if the given statement is unreachable. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_top_input_node : (t -> PdgTypes.Node.t) ref (** @raise Not_found if there is no top input in the PDG. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_entry_point_node : (t -> PdgTypes.Node.t) ref (** Find the node that represent the entry point of the function, i.e. the higher level block. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_location_nodes_at_stmt : (t -> Cil_types.stmt -> before:bool -> Locations.Zone.t -> t_nodes_and_undef) ref (** Find the nodes that define the value of the location at the given program point. Also return a zone that might be undefined at that point. @raise Not_found if the given statement is unreachable. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_location_nodes_at_end : (t -> Locations.Zone.t -> t_nodes_and_undef) ref (** Same than {!find_location_nodes_at_stmt} for the program point located at the end of the function. @raise Not_found if the output state is unreachable. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_location_nodes_at_begin : (t -> Locations.Zone.t -> t_nodes_and_undef) ref (** Same than {!find_location_nodes_at_stmt} for the program point located at the beginning of the function. Notice that it can only find formal argument nodes. The remaining zone (implicit input) is returned as undef. @raise Not_found if the output state is unreachable. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_call_stmts: (kernel_function -> caller:kernel_function -> Cil_types.stmt list) ref (** Find the call statements to the function (can maybe be somewhere else). @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_call_ctrl_node : (t -> Cil_types.stmt -> PdgTypes.Node.t) ref (** @raise Not_found if the call is unreachable. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_call_input_node : (t -> Cil_types.stmt -> int -> PdgTypes.Node.t) ref (** @raise Not_found if the call is unreachable or has no such input. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_call_output_node : (t -> Cil_types.stmt -> PdgTypes.Node.t) ref (** @raise Not_found if the call is unreachable or has no output node. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_code_annot_nodes : (t -> Cil_types.stmt -> Cil_types.code_annotation -> PdgTypes.Node.t list * PdgTypes.Node.t list * (t_nodes_and_undef option)) ref (** The result is composed of three parts : - the first part of the result are the control dependencies nodes of the annotation, - the second part is the list of declaration nodes of the variables used in the annotation; - the third part is similar to [find_location_nodes_at_stmt] result but for all the locations needed by the annotation. When the third part is globally [None], it means that we were not able to compute this information. @raise Not_found if the statement is unreachable. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val find_fun_precond_nodes : (t -> Cil_types.predicate -> PdgTypes.Node.t list * (t_nodes_and_undef option)) ref (** Similar to [find_code_annot_nodes] (no control dependencies nodes) *) val find_fun_postcond_nodes : (t -> Cil_types.predicate -> PdgTypes.Node.t list * (t_nodes_and_undef option)) ref (** Similar to [find_fun_precond_nodes] *) val find_fun_variant_nodes : (t -> Cil_types.term -> (PdgTypes.Node.t list * t_nodes_and_undef option)) ref (** Similar to [find_fun_precond_nodes] *) (** {3 Propagation} See also [Pdg.mli] for more function that cannot be here because they use polymorphic types. **) val find_call_out_nodes_to_select : (t -> PdgTypes.NodeSet.t -> t -> Cil_types.stmt -> PdgTypes.Node.t list) ref (** [find_call_out_nodes_to_select pdg_called called_selected_nodes pdg_caller call_stmt] @return the call outputs nodes [out] such that [find_output_nodes pdg_called out_key] intersects [called_selected_nodes]. *) val find_in_nodes_to_select_for_this_call : (t -> PdgTypes.NodeSet.t -> Cil_types.stmt -> t -> PdgTypes.Node.t list) ref (** [find_in_nodes_to_select_for_this_call pdg_caller caller_selected_nodes call_stmt pdg_called] @return the called input nodes such that the corresponding nodes in the caller intersect [caller_selected_nodes] @raise Not_found if the statement is unreachable. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) (** {3 Dependencies} *) val direct_dpds : (t -> PdgTypes.Node.t -> PdgTypes.Node.t list) ref (** Get the nodes to which the given node directly depend on. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val direct_ctrl_dpds : (t -> PdgTypes.Node.t -> PdgTypes.Node.t list) ref (** Similar to {!direct_dpds}, but for control dependencies only. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val direct_data_dpds : (t -> PdgTypes.Node.t -> PdgTypes.Node.t list) ref (** Similar to {!direct_dpds}, but for data dependencies only. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val direct_addr_dpds : (t -> PdgTypes.Node.t -> PdgTypes.Node.t list) ref (** Similar to {!direct_dpds}, but for address dependencies only. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val all_dpds : (t -> PdgTypes.Node.t list -> PdgTypes.Node.t list) ref (** Transitive closure of {!direct_dpds} for all the given nodes. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val all_data_dpds : (t -> PdgTypes.Node.t list -> PdgTypes.Node.t list) ref (** Gives the data dependencies of the given nodes, and recursively, all the dependencies of those nodes (regardless to their kind). @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val all_ctrl_dpds : (t -> PdgTypes.Node.t list -> PdgTypes.Node.t list) ref (** Similar to {!all_data_dpds} for control dependencies. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val all_addr_dpds : (t -> PdgTypes.Node.t list -> PdgTypes.Node.t list) ref (** Similar to {!all_data_dpds} for address dependencies. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val direct_uses : (t -> PdgTypes.Node.t -> PdgTypes.Node.t list) ref (** build a list of all the nodes that have direct dependencies on the given node. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val direct_ctrl_uses : (t -> PdgTypes.Node.t -> PdgTypes.Node.t list) ref (** Similar to {!direct_uses}, but for control dependencies only. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val direct_data_uses : (t -> PdgTypes.Node.t -> PdgTypes.Node.t list) ref (** Similar to {!direct_uses}, but for data dependencies only. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val direct_addr_uses : (t -> PdgTypes.Node.t -> PdgTypes.Node.t list) ref (** Similar to {!direct_uses}, but for address dependencies only. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val all_uses : (t -> PdgTypes.Node.t list -> PdgTypes.Node.t list) ref (** build a list of all the nodes that have dependencies (even indirect) on the given nodes. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val custom_related_nodes : ((PdgTypes.Node.t -> PdgTypes.Node.t list) -> PdgTypes.Node.t list -> PdgTypes.Node.t list) ref (** [custom_related_nodes get_dpds node_list] build a list, starting from the node in [node_list], and recursively add the nodes given by the function [get_dpds]. For this function to work well, it is important that [get_dpds n] returns a subset of the nodes directly related to [n], ie a subset of [direct_uses] U [direct_dpds]. @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) val iter_nodes : ((PdgTypes.Node.t -> unit) -> t -> unit) ref (** apply a given function to all the PDG nodes @raise Bottom if given PDG is bottom. @raise Top if the given pdg is top. *) (** {3 Pretty printing} *) val extract : (t -> string -> unit) ref (** Pretty print pdg into a dot file. @see <../pdg/index.html> PDG internal documentation. *) val pretty_node : (bool -> Format.formatter -> PdgTypes.Node.t -> unit) ref (** Pretty print information on a node : with [short=true], only the id of the node is printed.. *) val pretty_key : (Format.formatter -> PdgIndex.Key.t -> unit) ref (** Pretty print information on a node key *) val pretty : (?bw:bool -> Format.formatter -> t -> unit) ref (** For debugging... Pretty print pdg information. Print codependencies rather than dependencies if [bw=true]. *) end (** Signature common to some Inout plugin options. The results of the computations are available on a per function basis. *) module type INOUTKF = sig type t val self_internal: State.t ref val self_external: State.t ref val compute : (kernel_function -> unit) ref val get_internal : (kernel_function -> t) ref (** Inputs/Outputs with local and formal variables *) val get_external : (kernel_function -> t) ref (** Inputs/Outputs without either local or formal variables *) (** {3 Pretty printing} *) val display : (Format.formatter -> kernel_function -> unit) ref val pretty : Format.formatter -> t -> unit end (** Signature common to inputs and outputs computations. The results are also available on a per-statement basis. *) module type INOUT = sig include INOUTKF val statement : (stmt -> t) ref val kinstr : kinstr -> t option end (** State_builder.of read inputs. That is over-approximation of zones read by each function. @see <../inout/Inputs.html> internal documentation. *) module Inputs : sig include INOUT with type t = Locations.Zone.t val expr : (stmt -> exp -> t) ref val self_with_formals: State.t ref val get_with_formals : (kernel_function -> t) ref (** Inputs with formals and without local variables *) val display_with_formals: (Format.formatter -> kernel_function -> unit) ref end (** State_builder.of outputs. That is over-approximation of zones written by each function. @see <../inout/Outputs.html> internal documentation. *) module Outputs : sig include INOUT with type t = Locations.Zone.t val display_external : (Format.formatter -> kernel_function -> unit) ref end (** State_builder.of operational inputs. That is: - over-approximation of zones whose input values are read by each function, State_builder.of sure outputs - under-approximation of zones written by each function. @see <../inout/Context.html> internal documentation. *) module Operational_inputs : sig include INOUTKF with type t = Inout_type.t val get_internal_precise: (?stmt:stmt -> kernel_function -> Inout_type.t) ref (** More precise version of [get_internal] function. If [stmt] is specified, and is a possible call to the given kernel_function, returns the operational inputs for this call (if option -inout-callwise has been set). *) (**/**) (* Internal use *) module Record_Inout_Callbacks: Hook.Iter_hook with type param = Value_types.callstack * Inout_type.t (**/**) end (**/**) (** Do not use yet. @see <../inout/Derefs.html> internal documentation. *) module Derefs : INOUT with type t = Locations.Zone.t (**/**) (** {3 GUI} *) (** This function should be called from time to time by all analysers taking time. In GUI mode, this will make the interface reactive. @plugin development guide *) val progress: (unit -> unit) ref (** This exception may be raised by {!progress} to interrupt computations. *) exception Cancel (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/dynamic.ml0000666000000000000000000004343513571573400023267 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Debugging --- *) (* -------------------------------------------------------------------------- *) module Klog = Cmdline.Kernel_log let dkey = Klog.register_category "dynlink" let error ~name ~message ~details = Klog.error "cannot load plug-in '%s': %s%t" name message (fun fmt -> if details <> "" then Format.fprintf fmt "@\nDetails: %s" details) (* -------------------------------------------------------------------------- *) (* --- Dynlink Common Interface & Dynamic Library --- *) (* -------------------------------------------------------------------------- *) exception Unloadable of string module Tbl = Type.String_tbl(struct type 'a t = 'a end) let dynlib_init = ref false let dynlib_init () = if not !dynlib_init then begin dynlib_init := true ; Transitioning.Dynlink.init () ; Dynlink.allow_unsafe_modules true ; end exception Incompatible_type = Tbl.Incompatible_type exception Unbound_value = Tbl.Unbound_value let dynlib_error name = function | Dynlink.Error e -> error ~name ~message:"cannot load module" ~details:(Dynlink.error_message e) ; | Sys_error _ as e -> error ~name ~message:"system error" ~details:(Printexc.to_string e) | Unloadable details -> error ~name ~message:"incompatible with current set-up" ~details (* the three next errors may be raised in case of incompatibilities with another plug-in *) | Incompatible_type s -> error ~name ~message:"code incompatibility" ~details:s | Unbound_value s -> error ~name ~message:"code incompatibility" ~details:("unbound value " ^ s) | Type.No_abstract_type s -> error ~name ~message:"code incompatibility" ~details:("unbound abstract type " ^ s) | Log.AbortError _ | Log.AbortFatal _ | Log.FeatureRequest _ as e -> raise e | e -> error ~name ~message:("unexpected exception: " ^ Printexc.to_string e) ~details:(Printexc.get_backtrace ()) let dynlib_module name file = Klog.feedback ~dkey "Loading module '%s' from '%s'." name file ; try dynlib_init () ; Dynlink.loadfile file ; with error -> Cmdline.add_loading_failures name; dynlib_error name error (* -------------------------------------------------------------------------- *) (* --- Utilities --- *) (* -------------------------------------------------------------------------- *) let split_word = Str.(split (regexp ":")) let split_ext p = try let k = String.rindex p '.' in let d = try String.rindex p '/' with Not_found -> 0 in (* check for '.' belonging to directory or not *) if d <= k then let n = String.length p in String.sub p 0 k , String.sub p k (n-k) else p , "" with Not_found -> p , "" let is_package = let pkg = Str.regexp "[a-z-_][a-z-_0-9]*$" in fun name -> Str.string_match pkg name 0 let is_meta = let meta = Str.regexp "META.frama-c-[a-z-_][a-z-_0-9]*$" in fun name -> Str.string_match meta name 0 let is_dir d = Sys.file_exists d && Sys.is_directory d let is_file base ext = let file = base ^ ext in if Sys.file_exists file then Some file else None let is_object base = if Dynlink.is_native then is_file base ".cmxs" else match is_file base ".cma" with | Some _ as file -> file | None -> is_file base ".cmo" (* -------------------------------------------------------------------------- *) (* --- Package Loading --- *) (* -------------------------------------------------------------------------- *) let packages = Hashtbl.create 64 let () = List.iter (fun p -> Hashtbl.add packages p ()) ("frama-c.kernel"::Config.library_names) let missing pkg = not (Hashtbl.mem packages pkg) let once pkg = if Hashtbl.mem packages pkg then false else ( Hashtbl.add packages pkg () ; true ) exception ArchiveError of string let load_archive pkg base file = let path = try Findlib.resolve_path ~base file with Not_found -> let msg = Printf.sprintf "archive '%s' not found in '%s'" file base in raise (ArchiveError msg) in dynlib_module pkg path let mem_package pkg = try ignore (Findlib.package_directory pkg) ; true with Findlib.No_such_package _ -> false let is_virtual pkg = try ignore (Findlib.package_property [] pkg "archive") ; false with Not_found -> true let load_packages pkgs = Klog.debug ~dkey "trying to load %a" (Pretty_utils.pp_list ~sep:"@, " Format.pp_print_string) pkgs; try let pkgs = List.filter missing pkgs in List.iter begin fun pkg -> if once pkg then let base = Findlib.package_directory pkg in (* The way plugins are specified in META have been normalized late. So people started to specified it in different ways: - archive(byte,plugin) - archive(byte) - archive(native,plugin) - archive(plugin) The normalized one are: - plugin(byte) - plugin(native) *) let gui = if !Config.is_gui then ["gui"] else [] in let predicates = (** The order is important for the archive cases *) if Dynlink.is_native then [ "plugin", ["native"]@gui; "archive", ["plugin"]@gui; "archive", ["native";"plugin"]@gui; ] else [ "plugin", ["byte"]@gui; "archive", ["byte";"plugin"]@gui; "archive", ["byte"]@gui; ] in let rec find_package_archives = function (* Search by priority order *) | (var,predicates)::others -> begin try Some (Findlib.package_property predicates pkg var) with Not_found -> find_package_archives others end (* Look for virtual package *) | [] -> if is_virtual pkg then None else let msg = Printf.sprintf "package '%s' doesn't contains any known \ specification for dynamic linking" pkg in raise (ArchiveError msg) in match find_package_archives predicates with | None -> (* virtual package *) () | Some archive -> let archives = split_word archive in if archives = [] then Klog.warning "no archive to load for package '%s'" pkg else List.iter (load_archive pkg base) archives end (Findlib.package_deep_ancestors (if Dynlink.is_native then [ "native" ] else [ "byte" ]) pkgs) with | Findlib.No_such_package(pkg,details) -> Cmdline.add_loading_failures pkg; Klog.error "[findlib] package '%s' not found (%s)" pkg details | Findlib.Package_loop pkg -> Cmdline.add_loading_failures pkg; Klog.error "[findlib] cyclic dependencies for package '%s'" pkg | ArchiveError msg -> Cmdline.add_loading_failures "unknown package"; Klog.error "[findlib] %s" msg (* -------------------------------------------------------------------------- *) (* --- Load Objects --- *) (* -------------------------------------------------------------------------- *) let load_path = ref [] (* initialized by load_modules *) let load_script base = Klog.feedback ~dkey "compiling script '%s.ml'" base ; let cmd = Buffer.create 80 in let fmt = Format.formatter_of_buffer cmd in begin if Dynlink.is_native then Format.fprintf fmt "%s -shared -o %s.cmxs" Config.ocamlopt base else Format.fprintf fmt "%s -c" Config.ocamlc ; Format.fprintf fmt " -g %s -warn-error a -I %s" Config.ocaml_wflags Config.libdir ; if !Config.is_gui then Format.pp_print_string fmt " -package lablgtk2" ; List.iter (fun p -> Format.fprintf fmt " -I %s" p) !load_path ; Format.fprintf fmt " %s.ml" base ; Format.pp_print_flush fmt () ; let cmd = Buffer.contents cmd in Klog.feedback ~dkey "running '%s'" cmd ; begin let res = Sys.command cmd in if res <> 0 then Klog.error "compilation of '%s.ml' failed" base else let pkg = Filename.basename base in if Dynlink.is_native then dynlib_module pkg (base ^ ".cmxs") else dynlib_module pkg (base ^ ".cmo") ; end ; let erase = Printf.sprintf "rm -f %s.cm* %s.o" base base in Klog.feedback ~dkey "running '%s'" erase ; let st = Sys.command erase in if st <> 0 then Klog.warning "Error when cleaning '%s.[o|cm*]' files" base ; end (* -------------------------------------------------------------------------- *) (* --- Command-Line Entry Points --- *) (* -------------------------------------------------------------------------- *) let set_module_load_path path = let add_dir ~user d ps = if is_dir d then d::ps else ( if user then Klog.warning "cannot load '%s' (not a directory)" d ; ps ) in Klog.debug ~dkey "plugin_dir: %s" (String.concat ":" Config.plugin_dir); load_path := List.fold_right (add_dir ~user:true) path (List.fold_right (add_dir ~user:false) (Config.libdir::Config.plugin_dir) []); let env_ocamlpath = try Str.split (Str.regexp ":") (Sys.getenv "OCAMLPATH") with Not_found -> [] in let findlib_path = String.concat ":" (!load_path@env_ocamlpath) in Klog.debug ~dkey "setting findlib path to %s" findlib_path; Findlib.init ~env_ocamlpath:findlib_path () let load_plugin_path () = let scan_directory pkgs dir = Klog.feedback ~dkey "Loading directory '%s'" dir ; try let content = Sys.readdir dir in Array.sort String.compare content ; Array.iter (fun name -> if is_meta name then (* name starts with "META.frama-c-" *) let pkg = String.sub name 5 (String.length name - 5) in pkgs := pkg :: !pkgs ) content ; with Sys_error error -> Klog.error "impossible to read '%s' (%s)" dir error in let pkgs = ref [] in List.iter (scan_directory pkgs) !load_path ; load_packages (List.rev !pkgs) let load_module m = let base,ext = split_ext m in match ext with | ".ml" -> begin (* force script compilation *) match is_file base ".ml" with | Some _ -> load_script base | None -> Klog.error "Missing source file '%s'" m end | "" | "." | ".cmo" | ".cma" | ".cmxs" -> begin (* load object or compile script or find package *) match is_object base with | Some file -> dynlib_module (Filename.basename base) file | None -> match is_file base ".ml" with | Some _ -> load_script base | None -> if is_package m && mem_package m then load_packages [m] else let fc = "frama-c-" ^ String.lowercase_ascii m in if mem_package fc then load_packages [fc] else Klog.error "package or module '%s' not found" m end | _ -> Klog.error "don't know what to do with '%s' (unexpected %s)" m ext (* ************************************************************************* *) (** {2 Registering and accessing dynamic values} *) (* ************************************************************************* *) let dynamic_values = Tbl.create 97 let comments_fordoc = Hashtbl.create 97 let register ?(comment="") ~plugin name ty ~journalize f = if Cmdline.use_type then begin Klog.debug ~level:5 "registering dynamic function %s" name; let f = if journalize then let comment fmt = Format.fprintf fmt "@[Applying@;dynamic@;functions@;%S@;of@;type@;%s@]" name (Type.name ty) in let jname = Format.fprintf Format.str_formatter "@[Dynamic.get@;~plugin:%S@;%S@;%t@]" plugin name (Type.pp_ml_name ty Type.Call); Format.flush_str_formatter () in Journal.register jname ty ~is_dyn:true ~comment f else f in let key = plugin ^ "." ^ name in Tbl.add dynamic_values key ty f; if comment <> "" then Hashtbl.add comments_fordoc key comment ; f end else f let get ~plugin name ty = if Cmdline.use_type then Tbl.find dynamic_values (plugin ^ "." ^ name) ty else failwith (Printf.sprintf "cannot access value %s in the 'no obj' mode" name) let iter f = Tbl.iter f dynamic_values let iter_comment f = Hashtbl.iter f comments_fordoc (* ************************************************************************* *) (** {2 Specialised interface for parameters} *) (* ************************************************************************* *) module Parameter = struct module type Common = sig type t val get: string -> unit -> t val set: string -> t -> unit val clear: string -> unit -> unit val is_set: string -> unit -> bool val is_default: string -> unit -> bool end let get_name functor_name fct_name option_name = Format.sprintf "Dynamic.Parameter.%s.%s %S" functor_name fct_name option_name let get_parameter option_name = get ~plugin:"" option_name Typed_parameter.ty let get_state option_name = let prm = get ~plugin:"" option_name Typed_parameter.ty in State.get prm.Typed_parameter.name let apply modname name s ty1 ty2 = get ~plugin:"" (get_name modname s name) (Datatype.func ty1 ty2) module Common(X: sig type t val modname:string val ty: t Type.t end ) = struct type t = X.t let ty = X.ty let get name = apply X.modname name "get" Datatype.unit ty let set name = apply X.modname name "set" ty Datatype.unit let clear name = apply X.modname name "clear" Datatype.unit Datatype.unit let is_set name = apply X.modname name "is_set" Datatype.unit Datatype.bool let is_default name = apply X.modname name "is_default" Datatype.unit Datatype.bool end module Bool = struct include Common (struct type t = bool let ty = Datatype.bool let modname = "Bool"end ) let on name = apply "Bool" name "on" Datatype.unit Datatype.unit let off name = apply "Bool" name "off" Datatype.unit Datatype.unit end module Int = struct include Common (struct type t = int let ty = Datatype.int let modname = "Int" end ) let incr name = apply "Int" name "incr" Datatype.unit Datatype.unit end module String = Common (struct type t = string let ty = Datatype.string let modname = "String" end) module Filepath = Common (struct type t = Datatype.Filepath.t let ty = Datatype.Filepath.ty let modname = "Filepath" end) module StringSet = struct include Common (struct include Datatype.String.Set let modname = "StringSet" end) let add name = apply "StringSet" name "add" Datatype.string Datatype.unit let remove name = apply "StringSet" name "remove" Datatype.string Datatype.unit let is_empty name = apply "StringSet" name "is_empty" Datatype.unit Datatype.bool let iter name = apply "StringSet" name "iter" (Datatype.func Datatype.string Datatype.unit) Datatype.unit end module StringList = struct include Common (struct include Datatype.List(Datatype.String) let modname = "StringList" end) let add name = apply "StringList" name "add" Datatype.string Datatype.unit let append_before name = apply "StringList" name "append_before" (Datatype.list Datatype.string) Datatype.unit let append_after name = apply "StringList" name "append_after" (Datatype.list Datatype.string) Datatype.unit let remove name = apply "StringList" name "remove" Datatype.string Datatype.unit let is_empty name = apply "StringList" name "is_empty" Datatype.unit Datatype.bool let iter name = apply "StringList" name "iter" (Datatype.func Datatype.string Datatype.unit) Datatype.unit end end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/dynamic.mli0000666000000000000000000001523213571573400023432 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Value accesses through dynamic typing. @plugin development guide *) (* ************************************************************************* *) (** {2 Registration} *) (* ************************************************************************* *) val register: ?comment:string -> plugin:string -> string -> 'a Type.t -> journalize:bool -> 'a -> 'a (** [register ~plugin name ty v] registers [v] with the name [name], the type [ty] and the plug-in [plugin]. @raise Type.AlreadyExists if [name] already exists. In other words you cannot register a value with the same name twice. @modify Boron-20100401 add the labeled argument "plugin" @modify Oxygen-20120901 add the optional labeled argument "comment" @plugin development guide *) (* ************************************************************************* *) (** {2 Access} *) (* ************************************************************************* *) exception Incompatible_type of string exception Unbound_value of string exception Unloadable of string (** Exception that a plug-in can throw if it detects that it can't be loaded. It is caught by {!Dynamic.load_module} and {!Dynamic.load_script} @since Oxygen-20120901 *) val get: plugin:string -> string -> 'a Type.t -> 'a (** [get ~plugin name ty] returns the value registered with the name [name], the type [ty] and the plug-in [plugin]. This plug-in will be loaded if required. @raise Unbound_value if the name is not registered @raise Incompatible_type if the name is not registered with a compatible type @raise Failure _ in the -no-obj mode @plugin development guide *) val iter: (string -> 'a Type.t -> 'a -> unit) -> unit val iter_comment : (string -> string -> unit) -> unit (** @since Oxygen-20120901 *) (* ************************************************************************* *) (** {2 Dedicated access to plug-in parameters} *) (* ************************************************************************* *) (** Module to use for accessing parameters of plug-ins. Assume that the plug-in is already loaded. @plugin development guide *) module Parameter : sig (** Set of common operations on parameters. *) module type Common = sig type t val get: string -> unit -> t val set: string -> t -> unit val clear: string -> unit -> unit val is_set: string -> unit -> bool val is_default: string -> unit -> bool end (** retrieve the representation of the corresponding parameter. *) val get_parameter: string -> Typed_parameter.t (** retrieve the state related to the corresponding parameter. @raise Not_found if the option does not correspond to an actual parameter @since Oxygen-20120901 *) val get_state: string -> State.t (**/**) val get_name: string -> string -> string -> string (** Not for casual users *) (**/**) (** Boolean parameters. @plugin development guide *) module Bool: sig include Common with type t = bool val on: string -> unit -> unit (** Set the parameter to [true]. *) val off : string -> unit -> unit (** Set the parameter to [false]. *) end (** Integer parameters. *) module Int : sig include Common with type t = int val incr : string -> unit -> unit end (** String parameters. *) module String : Common with type t = string (** Filepath parameters. *) module Filepath : Common with type t = Datatype.Filepath.t (** Set of string parameters. *) module StringSet : sig include Common with type t = Datatype.String.Set.t val add: string -> string -> unit val remove: string -> string -> unit val is_empty: string -> unit -> bool val iter: string -> (string -> unit) -> unit end (** List of string parameters. *) module StringList : sig include Common with type t = string list val add: string -> string -> unit val append_before: string -> string list -> unit (** @since Neon-20140301 *) val append_after: string -> string list -> unit (** @since Neon-20140301 *) val remove: string -> string -> unit val is_empty: string -> unit -> bool val iter: string -> (string -> unit) -> unit end end (* ************************************************************************* *) (** {2 Dynamically Loaded Modules} *) (* ************************************************************************* *) val load_module: string -> unit (** Load the module specification. See -load-module option. @modify Magnesium-20151001 new API. *) (** Sets the load path for modules in FRAMAC_PLUGIN, prepending it with [path]. Does not load any plugins. Must be invoked only once from boot during extending stage. @since Phosphorus-20170501-beta1. *) val set_module_load_path : string list -> unit (**/**) val load_plugin_path: unit -> unit (** Load all plugins in the path set with [set_module_load_path]. Must be invoked only once from boot during extending stage. @since Magnesium-20151001 new API. @modify Phosphorus-20170501-beta1 changed signature. *) (**/**) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/emitter.ml0000666000000000000000000005242013571573400023306 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Modules [Hashtbl] and [Kernel] are not usable here. Thus use above modules instead. *) (**************************************************************************) (** {2 Datatype} *) (**************************************************************************) type kind = Property_status | Alarm | Code_annot | Funspec | Global_annot type emitter = { name: string; kinds: kind list; tuning_parameters: Typed_parameter.t list; correctness_parameters: Typed_parameter.t list } module D = Datatype.Make_with_collections (struct type t = emitter let name = "Emitter.t" let rehash = Datatype.identity let structural_descr = Structural_descr.t_unknown let reprs = [ { name = ""; kinds = []; tuning_parameters = []; correctness_parameters = [] } ] (* does not use (==) in order to prevent unmarshalling issue + in order to be able to compare emitters coming from Usable_emitter.get *) let equal x y = Datatype.String.equal x.name y.name let compare x y = Datatype.String.compare x.name y.name let hash x = Datatype.String.hash x.name let copy x = x (* strings are immutable here *) let pretty fmt x = Format.pp_print_string fmt x.name let internal_pretty_code = Datatype.undefined let varname _ = assert false (* unused while [internal_pretty_code] unimplemented *) let mem_project = Datatype.never_any_project end) type usable_emitter = { u_id: int; u_name: string; u_kinds: kind list; mutable used: bool; mutable version: int; (* maps below associate the parameter to its value (as a string) at the time of using. *) tuning_values: string Datatype.String.Map.t; correctness_values: string Datatype.String.Map.t } let has_several_versions_ref = Extlib.mk_fun "Emitter.has_several_versions" module Usable_emitter = struct include Datatype.Make_with_collections (struct type t = usable_emitter let name = "Emitter.Usable_emitter.t" let rehash = Datatype.identity let structural_descr = Structural_descr.t_abstract let reprs = let p = Datatype.String.Map.empty in [ { u_id = -1; u_name = ""; u_kinds = [ Property_status ]; used = false; version = -1; tuning_values = p; correctness_values = p } ] let equal = ( == ) let compare x y = if x == y then 0 else Datatype.Int.compare x.u_id y.u_id let hash x = Datatype.Int.hash x.u_id let copy x = x (* strings are immutable here *) let pretty fmt x = let name = x.u_name in if !has_several_versions_ref name then Format.fprintf fmt "%s (v%d)" name x.version else Format.pp_print_string fmt name let internal_pretty_code = Datatype.undefined let varname _ = assert false (* unused while [internal_pretty_code] unimplemented *) let mem_project = Datatype.never_any_project end) let get e = let get_params map = Datatype.String.Map.fold (fun s _ acc -> Typed_parameter.get s :: acc) map [] in { name = e.u_name; kinds = e.u_kinds; correctness_parameters = get_params e.correctness_values; tuning_parameters = get_params e.tuning_values } let get_name e = e.u_name let get_unique_name e = Format.asprintf "%a" pretty e let correctness_parameters e = Datatype.String.Map.fold (fun p _ acc -> p :: acc) e.correctness_values [] let tuning_parameters e = Datatype.String.Map.fold (fun p _ acc -> p :: acc) e.tuning_values [] let pretty_parameter fmt ~tuning e s = let map = if tuning then e.tuning_values else e.correctness_values in let v = Datatype.String.Map.find s map in Format.fprintf fmt "%s %s" s v end (**************************************************************************) (** {2 Implementation for Plug-in Developers} *) (**************************************************************************) let names: unit Datatype.String.Hashtbl.t = Datatype.String.Hashtbl.create 7 let create name kinds ~correctness ~tuning = if Datatype.String.Hashtbl.mem names name then Kernel.fatal "emitter %s already exists with the same parameters" name; let e = { name = name; kinds = kinds; correctness_parameters = correctness; tuning_parameters = tuning } in Datatype.String.Hashtbl.add names name (); e let dummy = create "dummy" [] ~correctness:[] ~tuning:[] let get_name e = e.name let correctness_parameters e = List.map (fun p -> p.Typed_parameter.name) e.correctness_parameters let tuning_parameters e = List.map (fun p -> p.Typed_parameter.name) e.tuning_parameters let end_user = create "End-User" [ Property_status; Code_annot; Funspec; Global_annot ] ~correctness:[] ~tuning:[] let kernel = create "Frama-C kernel" [ Property_status; Funspec ] ~correctness:[] ~tuning:[] (**************************************************************************) (** {2 State of all known emitters} *) (**************************************************************************) module Usable_id = State_builder.SharedCounter(struct let name = "Emitter.Usable_id" end) (* For each emitter, the info required to be able to get the right usable emitter. *) module Usable_emitters_of_emitter = State_builder.Hashtbl (Datatype.String.Hashtbl) (Datatype.Pair (Datatype.Ref(Usable_emitter)) (* current usable emitter with the current parameter values *) (Datatype.Ref(Usable_emitter.Set))) (* existing usable emitters with the old parameter values *) (struct let name = "Emitter.Usable_emitters_of_emitter" let size = 7 let dependencies = [ Usable_id.self ] end) let self = Usable_emitters_of_emitter.self let has_several_versions name = try let _, set = Usable_emitters_of_emitter.find name in Usable_emitter.Set.cardinal !set > 1 with Not_found -> Kernel.fatal "Unknown emitter %s" name let () = has_several_versions_ref := has_several_versions let distinct_parameters get_them tuning e = let name = e.u_name in let values = get_them e in let get e s = Format.asprintf "%t" (fun fmt -> Usable_emitter.pretty_parameter fmt ~tuning e s) in try let _, set = Usable_emitters_of_emitter.find name in Usable_emitter.Set.fold (fun e' acc -> List.fold_left2 (fun acc s1 s2 -> if get e s1 = get e' s2 then acc else Datatype.String.Set.add s1 acc) acc values (get_them e)) !set Datatype.String.Set.empty with Not_found -> Kernel.fatal "Unknown emitter %s" name let distinct_tuning_parameters = distinct_parameters Usable_emitter.tuning_parameters true let distinct_correctness_parameters = distinct_parameters Usable_emitter.correctness_parameters false (**************************************************************************) (** {2 Kernel Internal Implementation} *) (**************************************************************************) (* set the value of a parameter of an emitter *) let update_usable_emitter tuning ~used usable_e param_name value = let id = Usable_id.next () in let name = usable_e.u_name in let kinds = usable_e.u_kinds in let add = Datatype.String.Map.add param_name value in if tuning then { u_id = id; u_name = name; u_kinds = kinds; used = used; version = -1; (* delayed *) tuning_values = add usable_e.tuning_values; correctness_values = usable_e.correctness_values } else { u_id = id; u_name = name; u_kinds = kinds; used = used; version = -1; (* delayed *) tuning_values = usable_e.tuning_values; correctness_values = add usable_e.correctness_values } exception Found of Usable_emitter.t let update_parameter tuning usable_e p = let param_name = p.Typed_parameter.name in let value = Typed_parameter.get_value p in try let _, set = Usable_emitters_of_emitter.find usable_e.u_name in try Usable_emitter.Set.iter (fun e -> let map = if tuning then e.tuning_values else e.correctness_values in let exists = try Datatype.String.equal value (Datatype.String.Map.find param_name map) with Not_found -> false in if exists then raise (Found e)) !set; (* we are setting the value of a parameter, but we are not sure yet that the corresponding usable emitter will be used *) let e = update_usable_emitter tuning ~used:false usable_e param_name value in set := Usable_emitter.Set.add e !set; e with Found e -> (* we already create an usable emitter with this value for this parameter *) e with Not_found -> (* we are creating the first usable emitter of the given name: it is going to be used *) update_usable_emitter tuning ~used:true usable_e param_name value let kinds: (kind, State.t list) Hashtbl.t = Hashtbl.create 7 let iter_on_kinds f l = List.iter (fun k -> try let states = Hashtbl.find kinds k in f states with Not_found -> ()) l let correctness_states: unit State.Hashtbl.t = State.Hashtbl.create 7 let register_correctness_parameter name emitter_name kinds = try let state = State.get name in State.Hashtbl.replace correctness_states state (); iter_on_kinds (State_dependency_graph.add_dependencies ~from:state) kinds with State.Unknown -> (* in multi-sessions mode (e.g. save/load), the state for this parameter may not exist if the plug-in which defines it is not here anymore (fix bug #2181) *) Kernel.warning ~once:true "emitter %s: correctness parameter %s does not exist anymore. Ignored." emitter_name name let parameter_hooks : (unit -> unit) Datatype.String.Hashtbl.t Typed_parameter.Hashtbl.t = Typed_parameter.Hashtbl.create 97 let register_tuning_parameter name p = let update () = try let current, set = Usable_emitters_of_emitter.find name in let c = !current in let v = c.version in let new_e = update_parameter true c p in if c.used then new_e.version <- v + 1 else begin set := Usable_emitter.Set.remove c !set; new_e.version <- v end; current := new_e with Not_found -> (* in multi-sessions mode (e.g. save/load), the emitters could exist in the previous session but not in the current one. In this case, there is nothing to do. Additionally, even if it still exists, it could be not yet restored since the project library does not ensure that it restores the table of emitters before the states of parameters. In such a case, it is also possible to do nothing since the right table in the right state is going to be restored. *) () in try let tbl = Typed_parameter.Hashtbl.find parameter_hooks p in Datatype.String.Hashtbl.replace tbl name update with Not_found -> Kernel.fatal "[Emitter] no hook table for parameter %s" p.Typed_parameter.name let () = Cmdline.run_after_extended_stage (fun () -> State_selection.Static.iter (fun s -> let tbl = Datatype.String.Hashtbl.create 7 in let p = Typed_parameter.get (State.get_name s) in Typed_parameter.Hashtbl.add parameter_hooks p tbl; let update () = Datatype.String.Hashtbl.iter (fun _ f -> f ()) tbl in match p.Typed_parameter.accessor with | Typed_parameter.Bool(a, _) -> a.Typed_parameter.add_set_hook (fun _ _ -> update ()) | Typed_parameter.Int(a, _) -> a.Typed_parameter.add_set_hook (fun _ _ -> update ()) | Typed_parameter.String(a, _) -> a.Typed_parameter.add_set_hook (fun _ _ -> update ())) (* [JS 2012/02/07] should be limited to [Option_functor.get_selection_context], but it is not possible while each plug-in (including Wp) is not projectified *) (* (Option_functor.get_selection_context ~is_set:false ()))*) (Parameter_state.get_selection ~is_set:false ())) let update_table tbl = (* remove old stuff *) Usable_emitters_of_emitter.iter (fun _ (_, all_usable_e) -> Usable_emitter.Set.iter (fun e -> (* remove dependencies corresponding to old correctness parameters *) Datatype.String.Map.iter (fun p _ -> try iter_on_kinds (State_dependency_graph.remove_dependencies ~from:(State.get p)) e.u_kinds with State.Unknown -> (* In multi-sessions mode (e.g. save/load), the state for this parameter may not exist if the plug-in which defines it is not here anymore. Nothing special to do since the dependencies have already been removed by the load mechanism when states are missing (fix bug #2181). *) ()) e.correctness_values; (* remove hooks corresponding to old tuning parameters *) Typed_parameter.Hashtbl.iter (fun _ tbl -> Datatype.String.Hashtbl.clear tbl) parameter_hooks) !all_usable_e); (* register new stuff *) Datatype.String.Hashtbl.iter (fun e_name (_, all_usable_e) -> Usable_emitter.Set.iter (fun e -> Datatype.String.Map.iter (fun p _ -> register_correctness_parameter p e.u_name e.u_kinds) e.correctness_values; Datatype.String.Map.iter (fun p _ -> try let ty_p = Typed_parameter.get p in register_tuning_parameter e_name ty_p with Not_found -> (* the parameter could not exist anymore in multi-sessions mode (e.g. save/load): just ignore it in that case *) ()) e.tuning_values) !all_usable_e) tbl let () = Usable_emitters_of_emitter.add_hook_on_update update_table let register_parameter tuning usable_e p = let usable_e = update_parameter tuning usable_e p in if tuning then register_tuning_parameter usable_e.u_name p else register_correctness_parameter p.Typed_parameter.name usable_e.u_name usable_e.u_kinds; usable_e let create_usable_emitter e = let id = Usable_id.next () in let usable_e = { u_id = id; u_name = e.name; u_kinds = e.kinds; used = true; version = -1; (* delayed *) tuning_values = Datatype.String.Map.empty; correctness_values = Datatype.String.Map.empty } in let usable_e = List.fold_left (register_parameter true) usable_e e.tuning_parameters in let usable_e = List.fold_left (register_parameter false) usable_e e.correctness_parameters in usable_e.version <- 1; usable_e let get e = let name = e.name in try let current, _ = Usable_emitters_of_emitter.find name in let c = !current in c.used <- true; c with Not_found -> let usable_e = create_usable_emitter e in Usable_emitters_of_emitter.add name (ref usable_e, ref (Usable_emitter.Set.singleton usable_e)); usable_e module ED = D (* for debugging *) module Make_table (H: Datatype.Hashtbl) (E: sig include Datatype.S_with_collections val local_clear: H.key -> 'a Hashtbl.t -> unit val usable_get: t -> Usable_emitter.t val get: t -> emitter end) (D: Datatype.S) (Info: sig include State_builder.Info_with_size val kinds: kind list end) = struct module Remove_hooks = Hook.Build(struct type t = E.t * H.key * D.t end) let add_hook_on_remove f = Remove_hooks.extend (fun (e, k, d) -> f e k d) let apply_hooks_on_remove e k d = Remove_hooks.apply (e, k, d) (* this list is computed after defining [self] *) let static_dependencies = ref [] let must_clear_all sel = List.exists (State_selection.mem sel) !static_dependencies (* [KNOWN LIMITATION] only works iff the selection contains the parameter' state. In particular, that does not work if one writes something like let selection = State_selection.only_dependencies Kernel.MainFunction.self in Project.clear ~selection () *) let must_local_clear sel = try State.Hashtbl.iter (fun s () -> if State_selection.mem sel s then raise Exit) correctness_states; true with Exit -> false let create () = H.create Info.size let state = ref (create ()) module Tbl = E.Hashtbl.Make(D) type internal_tbl = Tbl.t module H_datatype = H.Make(Tbl) (* standard projectified hashtbl, but an ad-hoc function 'clear' *) include State_builder.Register (H_datatype) (struct type t = Tbl.t H.t let create = create let clear tbl = let sel = Project.get_current_selection () in (* Kernel.feedback "SELECT: %a" State_selection.pretty sel;*) if must_clear_all sel then begin (* someone explicitly requires to fully reset the table *) Kernel.debug ~dkey:Kernel.dkey_emitter_clear "FULL CLEAR of %s in %a" Info.name Project.pretty (Project.current ()); H.clear tbl end else (* AST is unchanged *) if must_local_clear sel then begin (* one have to clear the table, but we have to keep the keys *) Kernel.debug ~dkey:Kernel.dkey_emitter_clear "LOCAL CLEAR of %s in %a" Info.name Project.pretty (Project.current ()); H.iter (fun k h -> if not (Remove_hooks.is_empty ()) then E.Hashtbl.iter (fun e x -> apply_hooks_on_remove e k x) h; E.local_clear k h) tbl; end else begin (* we have to clear only the bindings corresponding to the selected correctness parameters *) let to_be_removed = ref [] in H.iter (fun k h -> E.Hashtbl.iter (fun e x -> let is_param_selected = List.exists (fun p -> State_selection.mem sel (State.get p)) (Usable_emitter.correctness_parameters (E.usable_get e)) in if is_param_selected then to_be_removed := (k, e, x) :: !to_be_removed) h) tbl; List.iter (fun (k, e, x) -> try let h = H.find tbl k in Kernel.debug ~dkey:Kernel.dkey_emitter_clear "CLEARING binding %a of %s in %a" ED.pretty (E.get e) Info.name Project.pretty (Project.current ()); E.Hashtbl.remove h e; apply_hooks_on_remove e k x with Not_found -> assert false) !to_be_removed end let get () = !state let set x = state := x let clear_some_projects _f _h = false end) (struct include Info let unique_name = name let dependencies = self :: dependencies end) let add_kind k = try let l = Hashtbl.find kinds k in Hashtbl.replace kinds k (self :: l) with Not_found -> Hashtbl.add kinds k [ self ] (* compute which states always impact this one (i.e. [self]) *) let () = List.iter add_kind Info.kinds; let get_dependencies () = State_dependency_graph.G.fold_pred (fun s acc -> s :: acc) State_dependency_graph.graph self [] in Cmdline.run_after_early_stage (fun () -> static_dependencies := get_dependencies ()) let add key v = H.add !state key v let find key = H.find !state key let mem key = H.mem !state key let iter f = H.iter f !state let fold f acc = H.fold f !state acc let iter_sorted ~cmp f = H.iter_sorted ~cmp f !state let fold_sorted ~cmp f acc = H.fold_sorted ~cmp f !state acc let remove key = if not (Remove_hooks.is_empty ()) then begin try let tbl = find key in E.Hashtbl.iter (fun e v -> apply_hooks_on_remove e key v) tbl; with Not_found -> () end; H.remove !state key; end include D (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/emitter.mli0000666000000000000000000001467013571573400023464 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Emitter. An emitter is the Frama-C entity which is able to emit annotations and property status. Thus you have to create (at least) one of your own if you want to do such tasks. @since Nitrogen-20111001 *) (**************************************************************************) (** {2 API for Plug-ins Developers} *) (**************************************************************************) type emitter type kind = Property_status | Alarm | Code_annot | Funspec | Global_annot (** When selecting [Alarm], [Code_annot] is also automatically selected *) include Datatype.S_with_collections with type t = emitter val create: string -> kind list -> correctness:Typed_parameter.t list -> tuning:Typed_parameter.t list -> t (** [Emitter.create name kind ~correctness ~tuning] creates a new emitter with the given name. The given parameters are the ones which impact the generated annotations/status. A "correctness" parameter may fully change a generated element when its value changes (for instance, a valid status may become invalid and conversely). A "tuning" parameter may improve a generated element when its value changes (for instance, a "dont_know" status may become valid or invalid, but a valid status cannot become invalid). The given name must be unique. @raise Invalid_argument if an emitter with the given name already exist @plugin development guide *) val get_name: t -> string val correctness_parameters: t -> string list val tuning_parameters: t -> string list val end_user: t (** The special emitter corresponding to the end-user. Only the kernel should use this emitter when emitting annotations or statuses. @since Oxygen-20120901 *) val kernel: t (** The special emitter corresponding to the kernel. Only the kernel should use this emitter when emitting annotations or statuses. @since Oxygen-20120901 *) (** Usable emitters are the ones which can really emit something. *) module Usable_emitter: sig include Datatype.S_with_collections val get: t -> emitter (** Get the emitter from an usable emitter. Not so efficient. @since Oxygen-20120901 *) val get_name: t -> string val get_unique_name: t -> string val correctness_parameters: t -> string list val tuning_parameters: t -> string list val pretty_parameter: Format.formatter -> tuning:bool -> t -> string -> unit (** Pretty print the parameter (given by its name) with its value. @raise Not_found if the parameter is not one of the given emitter *) end val distinct_tuning_parameters: Usable_emitter.t -> Datatype.String.Set.t (** Return the tuning parameter which distinguishes this usable emitter from the other ones. @since Oxygen-20120901 *) val distinct_correctness_parameters: Usable_emitter.t -> Datatype.String.Set.t (** Return the correctness_parameters which distinguishes this usable emitter from the other ones. @since Oxygen-20120901 *) (* ********************************************************************** *) (** {2 Kernel Internal API} *) (* ********************************************************************** *) val get: t -> Usable_emitter.t (** Get the emitter which is really able to emit something. This function must be called at the time of the emission. No action must occur between the call to [get] and the emission (in particular no update of any parameter of the emitter. *) val self: State.t val dummy: t (** Table indexing: key -> emitter (or equivalent data) -> value. Quick access + handle cleaning in the right way (only remove relevant bindings when required. @since Oxygen-20120901 *) module Make_table (H: Datatype.Hashtbl) (E: sig include Datatype.S_with_collections val local_clear: H.key -> 'a Hashtbl.t -> unit val usable_get: t -> Usable_emitter.t val get: t -> emitter end) (D: Datatype.S) (Info: sig include State_builder.Info_with_size val kinds: kind list end) : sig type internal_tbl = D.t E.Hashtbl.t val self: State.t val add: H.key -> internal_tbl -> unit val find: H.key -> internal_tbl val mem: H.key -> bool val iter: (H.key -> internal_tbl -> unit) -> unit val fold: (H.key -> internal_tbl -> 'a -> 'a) -> 'a -> 'a val iter_sorted: cmp: (H.key -> H.key -> int) -> (H.key -> internal_tbl -> unit) -> unit val fold_sorted: cmp: (H.key -> H.key -> int) -> (H.key -> internal_tbl -> 'a -> 'a) -> 'a -> 'a val remove: H.key -> unit val add_hook_on_remove: (E.t -> H.key -> D.t -> unit) -> unit (** Register a hook to be applied whenever a binding is removed from the table. @since Fluorine-20130401 *) val apply_hooks_on_remove: E.t -> H.key -> D.t -> unit (** This function must be called on each binding which is removed from the table without directly calling the function {!remove}. @since Fluorine-20130401 *) end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/journal.ml0000666000000000000000000004201713571573400023310 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ****************************************************************************) (* ****************************************************************************) (* ****************************************************************************) (* Disclaimer ---------- This module uses very unsafe caml features (module Obj). Modify it at your own risk. Sometimes the caml type system does not help you here. Introducing a bug here may introduce some "segmentation faults" in Frama-C *) (* ****************************************************************************) (* ****************************************************************************) (* ****************************************************************************) open Cmdline.Kernel_log (** Journalization of functions *) (* ****************************************************************************) (** {2 Journal management} *) (* ****************************************************************************) (* [started] prevents journalization of function call inside another one. It is [true] iff a journalized function is being applied. *) let started = ref false module Sentences = struct type t = { sentence: Format.formatter -> unit; raise_exn: bool } let sentences : t Queue.t = Queue.create () let add print exn = Queue.add { sentence = print; raise_exn = exn } sentences let write fmt = let finally_raised = ref false in (* printing the sentences *) Queue.iter (fun s -> s.sentence fmt; finally_raised := s.raise_exn) sentences; (* if any, re-raised the exception raised by the last sentence *) Format.fprintf fmt "@[%s@]" (if !finally_raised then "raise (Exception (Printexc.to_string exn))" else "()"); (* closing the box opened when catching exception *) Queue.iter (fun s -> if s.raise_exn then Format.fprintf fmt "@]@]@]@;end") sentences let journal_copy = ref (Queue.create ()) let save () = journal_copy := Queue.copy sentences let restore () = Queue.clear sentences; Queue.transfer !journal_copy sentences end module Abstract_modules = struct let tbl: (string, string) Hashtbl.t = Hashtbl.create 7 let () = Type.add_abstract_types := Hashtbl.replace tbl let write fmt = Hashtbl.iter (fun k v -> Format.fprintf fmt "@[let module %s=@;@[Type.Abstract\ (struct let name = %S end) in@]@]@;" k v) tbl let tbl_copy = ref (Hashtbl.create 7) let save () = tbl_copy := Hashtbl.copy tbl let restore () = Hashtbl.clear tbl; Hashtbl.iter (fun k v -> Hashtbl.add tbl k v) !tbl_copy end let save () = Sentences.save (); Abstract_modules.save () let restore () = Sentences.restore (); Abstract_modules.restore () let now () = Unix.localtime (Unix.time ()) let default_filename = "frama_c_journal.ml" let filename = ref default_filename let get_session_file = ref (fun _ -> assert false) let get_name () = let f = !filename in if f == default_filename then !get_session_file f else f let set_name s = filename := s let print_header fmt = let time = now () in Format.pp_open_hvbox fmt 0; (* the outermost box *) Format.fprintf fmt "@[(* Frama-C journal generated at %02d:%02d the %02d/%02d/%d *)@]@;@;" time.Unix.tm_hour time.Unix.tm_min time.Unix.tm_mday (time.Unix.tm_mon+1) (time.Unix.tm_year + 1900); Format.fprintf fmt "@[exception Unreachable@]@;"; Format.fprintf fmt "@[exception Exception of string@]@;@;"; Format.fprintf fmt "@[[@@@@@@ warning \"-26\"]@]@;@;"; Format.fprintf fmt (* open two boxes for start *) "(* Run the user commands *)@;@[let run () =@;@[" let print_trailer fmt = Format.fprintf fmt "@[(* Main *)@]@\n"; Format.fprintf fmt "@[let main () =@;"; Format.fprintf fmt "@[@[Journal.keep_file@;\"%s\";@]@;" (get_name ()); Format.fprintf fmt "try run ()@;"; Format.fprintf fmt "@[with@;@[| Unreachable ->@ "; Format.fprintf fmt "@[Kernel.fatal@;\"Journal reaches an assumed dead code\"@;@]@]@;"; Format.fprintf fmt "@[| Exception s ->@ "; Format.fprintf fmt "@[Kernel.log@;\"Journal re-raised the exception %%S\"@;s@]@]@;"; Format.fprintf fmt "@[| exn ->@ "; Format.fprintf fmt "@[Kernel.fatal@;\"Journal raised an unexpected exception: %%s\"@;"; Format.fprintf fmt "(Printexc.to_string exn)@]@]@]@]@]@\n@\n"; Format.fprintf fmt "@[(* Registering *)@]@\n"; Format.fprintf fmt "@[let main : unit -> unit =@;@[Dynamic.register@;~plugin:%S@;\"main\"@;" (String.capitalize_ascii (Filename.basename (get_name ()))); Format.fprintf fmt "@[(Datatype.func@;Datatype.unit@;Datatype.unit)@]@;"; Format.fprintf fmt "~journalize:false@;main@]@]@\n@\n"; Format.fprintf fmt "@[(* Hooking *)@]@\n"; Format.fprintf fmt "@[let () =@;"; Format.fprintf fmt "@[Cmdline.run_after_loading_stage@;main;@]@;"; Format.fprintf fmt "@[Cmdline.is_going_to_load@;()@]@]@."; (* close the outermost box *) Format.pp_close_box fmt () let preserved_files = ref [] let keep_file s = preserved_files := s :: !preserved_files let get_filename = let cpt = ref 0 in let rec get_filename first = let name = get_name () in if (not first && Sys.file_exists name) || List.mem name !preserved_files then begin incr cpt; let suf = "_" ^ string_of_int !cpt in (try let n = Str.search_backward (Str.regexp "_[0-9]+") name (String.length name - 1) in filename := Str.string_before name n ^ suf with Not_found -> filename := name ^ suf); get_filename false end else name in fun () -> get_filename true let write () = let write fmt = print_header fmt; Abstract_modules.write fmt; Sentences.write fmt; Format.fprintf fmt "@]@]@;@;"; print_trailer fmt; Format.pp_print_flush fmt () in let error msg s = error "cannot %s journal (%s)." msg s in let filename = get_filename () in feedback "writing journal in file `%s'." filename; try let cout = open_out filename in let fmt = Format.formatter_of_out_channel cout in Format.pp_set_margin fmt 78 (* line length *); (try write fmt with Sys_error s -> error "write into" s); try close_out cout with Sys_error s -> error "close" s with Sys_error s -> error "create" s let () = (* write the journal iff it is enable and - either an error occurs; - or the user explicitly wanted it. *) if Cmdline.journal_enable then begin Cmdline.at_error_exit (fun _ -> write ()); if Cmdline.journal_isset then Cmdline.at_normal_exit write end (* ****************************************************************************) (** {2 Journalization} *) (* ****************************************************************************) module Binding: sig val add: 'a Type.t -> 'a -> string -> unit (** [add ty v var] binds the value [v] to the variable name [var]. Thus, [pp ty v] prints [var] and not use the standard pretty printer. Very useful to pretty print values with no associated pretty printer. *) exception Name_already_exists of string val add_once: 'a Type.t -> 'a -> string -> unit (** Same as function [add] above but raise the exception [Already_exists] if the binding previously exists *) val find: 'a Type.t -> 'a -> string val iter: ('a Type.t -> 'a -> string -> unit) -> unit end = struct let bindings : string Type.Obj_tbl.t = Type.Obj_tbl.create () let add ty v var = Type.Obj_tbl.add bindings ty v var (* eta-expansion required *) (* add bindings for [Format.std_formatter] and [Format.err_formatter] *) let () = add Datatype.formatter Format.std_formatter "Format.std_formatter"; add Datatype.formatter Format.err_formatter "Format.err_formatter" exception Name_already_exists of string let check_name s = let error () = Format.eprintf "[Type] A value of name %s already exists@." s; raise (Name_already_exists s) in Type.Obj_tbl.iter bindings (fun _ _ s' -> if s = s' then error ()) let add_once ty x s = check_name s; add ty x s let find ty v = Type.Obj_tbl.find bindings ty v (* eta-expansion required *) let iter f = Type.Obj_tbl.iter bindings f (* eta-expansion required *) (* predefined bindings *) let () = add Datatype.formatter Format.std_formatter "Format.std_formatter"; add Datatype.formatter Format.err_formatter "Format.err_formatter" end (* JS 2012/02/07: useful only for BM introspection testing ;-) *) module Reverse_binding = struct module Tbl = Type.String_tbl(struct type 'a t = 'a end) exception Unbound_value = Tbl.Unbound_value exception Incompatible_type = Tbl.Incompatible_type let tbl = Tbl.create 97 let fill () = Binding.iter (fun ty v name -> Tbl.add tbl name ty v) let find name ty = Tbl.find tbl name ty let iter f = Tbl.iter f tbl let pretty fmt () = iter (fun name ty v -> Format.fprintf fmt "%s --> %a@." name (Datatype.pretty ty) v) end exception Not_writable of string let never_write name f = if Cmdline.journal_enable && Cmdline.use_type then if Obj.tag (Obj.repr f) = Obj.closure_tag then Obj.magic (fun y -> if !started then Obj.magic f y else let msg = Format.asprintf "a call to the function %s has to be written in the journal, \ but this function was never journalized." name in raise (Not_writable msg)) else invalid_arg ("[Journal.never_write] " ^ name ^ " is not a closure") else f let pp (type t) (ty: t Type.t) fmt (x:t) = assert Cmdline.use_type; try Format.fprintf fmt "%s" (Binding.find ty x); with Not_found -> let pp_error msg = Format.fprintf fmt "@[(failwith @[\"%s:@ running the journal will fail.\"@])@;@]" msg in let pp = Datatype.internal_pretty_code ty in if pp == Datatype.undefined then pp_error (Format.asprintf "no printer registered for value of type %s" (Type.name ty)) else if pp == Datatype.pp_fail then pp_error (Format.asprintf "no code for pretty printer of type %s" (Type.name ty)) else pp Type.Call fmt x let gen_binding = let ids = Hashtbl.create 7 in let rec gen s = try let n = succ (Hashtbl.find ids s) in Hashtbl.replace ids s n; gen (s ^ "_" ^ string_of_int n) with Not_found -> Hashtbl.add ids s 1; s in gen let extend_continuation f_acc pp_arg opt_label opt_arg arg fmt = f_acc fmt; match opt_label, opt_arg with | None, None (* no label *) -> Format.fprintf fmt "@;%a" pp_arg arg; | None, Some _ -> assert false | Some _, Some f when f () == arg -> (* [arg] is the default value of the optional label *) () | Some l, _ (* other label *) -> Format.fprintf fmt "@;~%s:%a" l pp_arg arg (* print any comment *) let print_comment fmt pp = match pp with | None -> () | Some pp -> Format.fprintf fmt "(* %t *)@;" pp let print_sentence f_acc is_dyn comment ?value ty fmt = assert Cmdline.use_type; print_comment fmt comment; (* open a new box for the sentence *) Format.fprintf fmt "@["; (* add a let binding whenever the return type is not unit *) let is_unit = Type.equal ty Datatype.unit in if not is_unit then Format.fprintf fmt "let %t=@;" (fun fmt -> let binding = let varname = Datatype.varname ty in match varname == Datatype.undefined, value with | true, _ | _, None -> "__" (* no binding nor value: ignore the result *) | false, Some value -> (* bind to a fresh variable name *) let b = gen_binding (varname value) in Binding.add ty value b; b in Format.fprintf fmt "%s" binding; (* add the return type for dynamic application *) if is_dyn then Format.fprintf fmt "@;: %s " (Type.name ty) else Format.fprintf fmt " "); (* pretty print the sentence itself in a box *) Format.fprintf fmt "@[%t@]" f_acc; (* close the sentence *) if is_unit then Format.fprintf fmt ";@]@;" else Format.fprintf fmt "@;<1 -2>in@]@;" let add_sentence f_acc is_dyn comment ?value ty = Sentences.add (print_sentence f_acc is_dyn comment ?value ty) false let catch_exn f_acc is_dyn comment ret_ty exn = let s_exn = Printexc.to_string exn in (* [s_exn] is not necessarily a valid OCaml exception. So don't use it in OCaml code. *) let comment fmt = Format.fprintf fmt "@[exception %s@;raised on: @]%t" s_exn (fun fmt -> Extlib.may (fun f -> f fmt) comment) in let print fmt = (* open a new box for the sentence *) Format.fprintf fmt "@[begin try@;@[%t@[raise Unreachable@]@]@]@;" (print_sentence f_acc is_dyn (Some comment) ret_ty); (* two opened boxes closed at end *) Format.fprintf fmt "@[with@;@[| Unreachable as exn -> raise exn@]@;"; Format.fprintf fmt "@[| exn (* %s *) ->@;@[@[(* continuing: *)@]@;" s_exn in Sentences.add print true let rec journalize_function: 't. (Format.formatter -> unit) -> 't Type.t -> bool -> (Format.formatter -> unit) option -> 't -> 't = fun (type t) (type a) (type b) f_acc (ty: t Type.t) is_dyn comment (x:t) -> assert Cmdline.use_type; if Type.Function.is_instance_of ty then begin (* [ty] is a function type value: there exists [a] and [b] such than [t = a -> b] *) let ty: (a -> b) Type.t = Obj.magic (ty: t Type.t) in let f: a -> b = Obj.magic (x: t) in let (a: a Type.t), (b: b Type.t), opt_label = Type.Function.get_instance ty in let opt_arg = Type.Function.get_optional_argument ty in let f (y: a) : b = if !started then (* prevent journalisation if you're journalizing another function *) f y else begin try (* [started] prevents journalization of function call inside another one *) started := true; (* apply the closure [x] to its argument [y] *) let xy = f y in started := false; (* extend the continuation and continue *) let f_acc = extend_continuation f_acc (pp a) opt_label opt_arg y in journalize_function f_acc b is_dyn comment xy with | Not_writable name -> started := false; fatal "a call to the function %S cannot be written in the journal" name | exn as e -> let f_acc = extend_continuation f_acc (pp a) opt_label opt_arg y in catch_exn f_acc is_dyn comment b exn; started := false; raise e end in (* cast back the closure of type [a -> b] into [t] *) (Obj.magic (f: a -> b): t) end else begin if not !started then add_sentence f_acc is_dyn comment ~value:x ty; x end let register s ty ?comment ?(is_dyn=false) x = if Cmdline.journal_enable then begin assert Cmdline.use_type; if s = "" then abort "[Journal.register] the given name should not be \"\""; Binding.add_once ty x s; if Type.Function.is_instance_of ty then begin let f_acc fmt = pp ty fmt x in journalize_function f_acc ty is_dyn comment x end else x end else x let prevent f x = let old = !started in started := true; let res = try f x with exn -> started := old; raise exn in started := old; res (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/journal.mli0000666000000000000000000001202413571573400023454 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Journalization of functions. @plugin development guide *) (* ****************************************************************************) (** {2 Journalization} *) (* ****************************************************************************) val register: string -> 'a Type.t -> ?comment:(Format.formatter -> unit) -> ?is_dyn:bool -> 'a -> 'a (** [register name ty ~comment ~is_dyn v] journalizes the value [v] of type [ty] with the name [name]. [name] must exactly match the caml long name of the value (i.e. "List.iter" and not "iter" even though the module List is already opened). Journalisation of anonymous value is not possible. If the [comment] argument is set, the given pretty printer will be applied in an OCaml comment when the function is journalized. Set [is_dyn] to [true] to journalize a dynamic function. *) val never_write: string -> 'a -> 'a (** [never_write name f] returns a closure [g] observationally equal to [f] except that trying to write a call to [g] in the journal is an error. If [f] is not a closure, then [never_write name f] raises [Invalid_argument]. *) val prevent: ('a -> 'b) -> 'a -> 'b (** [prevent f x] applies [x] to [f] without printing anything in the journal, even if [f] is journalized. *) module Binding: sig val add: 'a Type.t -> 'a -> string -> unit (** [add ty v var] binds the value [v] to the variable name [var]. Thus, [pp ty v] prints [var] and not use the standard pretty printer. Very useful to pretty print values with no associated pretty printer. *) exception Name_already_exists of string val add_once: 'a Type.t -> 'a -> string -> unit (** Same as function [add] above but raise the exception [Already_exists] if the binding previously exists *) end (* JS 2012/02/07: useful only for BM introspection testing ;-) *) module Reverse_binding: sig (* Raised by [find] *) exception Unbound_value of string exception Incompatible_type of string val fill: unit -> unit val find: string -> 'a Type.t -> 'a val iter: (string -> 'a Type.t -> 'a -> unit) -> unit val pretty: Format.formatter -> unit -> unit end (* ****************************************************************************) (** {2 Journal management} *) (* ****************************************************************************) val get_name: unit -> string (** @return the filename which the journal will be written into. *) val set_name: string -> unit (** [set_name name] changes the filename into the journal is generated. *) val write: unit -> unit (** [write ()] writes the content of the journal into the file set by [set_name] (or in "frama_c_journal.ml" by default); without clearing the journal. *) val save: unit -> unit (** Save the current state of the journal for future restoration. @since Beryllium-20090901 *) val restore: unit -> unit (** Restore a previously saved journal. @since Beryllium-20090901 *) (* ****************************************************************************) (** {2 Internal use only} *) (* ****************************************************************************) val keep_file: string -> unit (** This function has not to be used explicitly. Only offers functions retrieving when running a journal file. *) val get_session_file: (string -> string) ref (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/kernel.ml0000666000000000000000000015104613571573400023121 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************* *) (** {2 Kernel as an almost standard plug-in} *) (* ************************************************************************* *) module CamlString = String module Fc_config = Config let () = Plugin.register_kernel () module P = Plugin.Register (struct let name = "" let shortname = "" let help = "General options provided by the Frama-C kernel" end) include (P: Plugin.S_no_log) include Cmdline.Kernel_log let dkey_alpha = register_category "alpha" let dkey_alpha_undo = register_category "alpha:undo" let dkey_asm_contracts = register_category "asm:contracts" let dkey_ast = register_category "ast" let dkey_check = register_category "check" let dkey_comments = register_category "parser:comments" let dkey_dataflow = register_category "dataflow" let dkey_dataflow_scc = register_category "dataflow:scc" let dkey_dominators = register_category "dominators" let dkey_emitter = register_category "emitter" let dkey_emitter_clear = register_category "emitter:clear" let dkey_exn_flow = register_category "exn_flow" let dkey_file_annot = register_category "file:annotation" let dkey_file_print_one = register_category "file:print-one" let dkey_file_transform = register_category "file:transformation" let dkey_filter = register_category "filter" let dkey_globals = register_category "globals" let dkey_kf_blocks = register_category "kf:blocks" let dkey_linker = register_category "linker" let dkey_linker_find = register_category "linker:find" let dkey_loops = register_category "natural-loops" let dkey_parser = register_category "parser" let dkey_rmtmps = register_category "parser:rmtmps" let dkey_referenced = register_category "parser:referenced" let dkey_pp = register_category "pp" let dkey_compilation_db = register_category "pp:compilation-db" let dkey_print_bitfields = register_category "printer:bitfields" let dkey_print_builtins = register_category "printer:builtins" let dkey_print_logic_coercions = register_category "printer:logic-coercions" let dkey_print_logic_types = register_category "printer:logic-types" let dkey_print_attrs = register_category "printer:attrs" let dkey_print_sid = register_category "printer:sid" let dkey_print_unspecified = register_category "printer:unspecified" let dkey_print_vid = register_category "printer:vid" let dkey_prop_status = register_category "prop-status" let dkey_prop_status_emit = register_category "prop-status:emit" let dkey_prop_status_merge = register_category "prop-status:merge" let dkey_prop_status_reg = register_category "prop-status:register" let dkey_prop_status_graph = register_category "prop-status:graph" let dkey_task = register_category "task" let dkey_typing_global = register_category "typing:global" let dkey_typing_init = register_category "typing:initializer" let dkey_typing_chunk = register_category "typing:chunk" let dkey_typing_cast = register_category "typing:cast" let dkey_typing_pragma = register_category "typing:pragma" let dkey_ulevel = register_category "ulevel" let dkey_visitor = register_category "visitor" let wkey_annot_error = register_warn_category "annot-error" let () = set_warn_status wkey_annot_error Log.Wabort let wkey_acsl_float_compare = register_warn_category "acsl-float-compare" let () = set_warn_status wkey_acsl_float_compare Log.Winactive let wkey_drop_unused = register_warn_category "linker:drop-conflicting-unused" let wkey_implicit_conv_void_ptr = register_warn_category "typing:implicit-conv-void-ptr" let wkey_incompatible_types_call = register_warn_category "typing:incompatible-types-call" let wkey_incompatible_pointer_types = register_warn_category "typing:incompatible-pointer-types" let wkey_int_conversion = register_warn_category "typing:int-conversion" let wkey_cert_exp_46 = register_warn_category "CERT:EXP:46" let wkey_cert_msc_38 = register_warn_category "CERT:MSC:38" let () = set_warn_status wkey_cert_msc_38 Log.Werror let wkey_cert_exp_10 = register_warn_category "CERT:EXP:10" let () = set_warn_status wkey_cert_exp_10 Log.Winactive let wkey_check_volatile = register_warn_category "check:volatile" let wkey_jcdb = register_warn_category "pp:compilation-db" let () = set_warn_status wkey_jcdb Log.Wonce let wkey_implicit_function_declaration = register_warn_category "typing:implicit-function-declaration" let wkey_no_proto = register_warn_category "typing:no-proto" let wkey_missing_spec = register_warn_category "annot:missing-spec" let wkey_decimal_float = register_warn_category "parser:decimal-float" let () = set_warn_status wkey_decimal_float Log.Wonce let wkey_acsl_extension = register_warn_category "acsl-extension" let wkey_cmdline = register_warn_category "cmdline" (* ************************************************************************* *) (** {2 Specialised functors for building kernel parameters} *) (* ************************************************************************* *) module type Input = sig include Parameter_sig.Input val module_name: string end module type Input_with_arg = sig include Parameter_sig.Input_with_arg val module_name: string end module Bool(X:sig include Input val default: bool end) = P.Bool (struct let () = Parameter_customize.set_module_name X.module_name include X end) module False(X: Input) = P.False (struct let () = Parameter_customize.set_module_name X.module_name include X end) module True(X: Input) = P.True (struct let () = Parameter_customize.set_module_name X.module_name include X end) module Int (X: sig val default: int include Input_with_arg end) = P.Int (struct let () = Parameter_customize.set_module_name X.module_name include X end) module Zero(X:Input_with_arg) = P.Zero (struct let () = Parameter_customize.set_module_name X.module_name include X end) module String (X: sig include Input_with_arg val default: string end) = P.String (struct let () = Parameter_customize.set_module_name X.module_name include X end) module String_set(X: Input_with_arg) = P.String_set (struct let () = Parameter_customize.set_module_name X.module_name include X end) module String_list(X: Input_with_arg) = P.String_list (struct let () = Parameter_customize.set_module_name X.module_name include X end) module Kernel_function_set(X: Input_with_arg) = P.Kernel_function_set (struct let () = Parameter_customize.set_module_name X.module_name include X end) (* ************************************************************************* *) (** {2 Installation Information} *) (* ************************************************************************* *) let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Exiting let () = Parameter_customize.do_not_journalize () let () = Parameter_customize.set_negative_option_name "" module GeneralHelp = False (struct let option_name = "--help" let help = "display a general help" let module_name = "GeneralHelp" end) let run_help () = if GeneralHelp.get () then Cmdline.help () else Cmdline.nop let () = Cmdline.run_after_exiting_stage run_help let () = GeneralHelp.add_aliases [ "-h"; "-help"] let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Exiting let () = Parameter_customize.do_not_journalize () let () = Parameter_customize.set_negative_option_name "" module ListPlugins = False (struct let option_name = "--list-plugins" let help = "display a general help" let module_name = "ListPlugins" end) let run_list_plugins () = if ListPlugins.get () then Cmdline.list_plugins () else Cmdline.nop let () = Cmdline.run_after_exiting_stage run_list_plugins let () = ListPlugins.add_aliases ["-plugins"; "--plugins"] let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.set_negative_option_name "" module PrintConfig = False (struct let option_name = "-print-config" let module_name = "PrintConfig" let help = "print full config information" end) let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.set_negative_option_name "" module PrintVersion = False(struct let option_name = "-print-version" let module_name = "PrintVersion" let help = "print the Frama-C version" end) let () = PrintVersion.add_aliases [ "-v"; "-version" ; "--version" ] let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.set_negative_option_name "" module PrintShare = False(struct let option_name = "-print-share-path" let module_name = "PrintShare" let help = "print the Frama-C share path" end) let () = PrintShare.add_aliases [ "-print-path" ] let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.set_negative_option_name "" module PrintLib = False(struct let option_name = "-print-lib-path" let module_name = "PrintLib" let help = "print the path of the Frama-C kernel library" end) let () = PrintLib.add_aliases [ "-print-libpath" ] let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.set_negative_option_name "" module PrintPluginPath = False (struct let option_name = "-print-plugin-path" let module_name = "PrintPluginPath" let help = "print the path where the Frama-C dynamic plug-ins are searched into" end) let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Exiting let () = Parameter_customize.set_negative_option_name "" module PrintMachdep = False (struct let module_name = "PrintMachdep" let option_name = "-print-machdep" let help = "pretty print selected machdep" end) let () = Parameter_customize.set_group help let () = Parameter_customize.set_negative_option_name "" module DumpDependencies = P.Empty_string (struct let option_name = "-dump-dependencies" let help = "" let arg_name = "" end) let () = Extlib.safe_at_exit (fun () -> if not (DumpDependencies.is_default ()) then State_dependency_graph.dump (DumpDependencies.get ())) let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Exiting let () = Parameter_customize.do_not_journalize () let () = Parameter_customize.set_negative_option_name "" module AutocompleteHelp = False (struct let option_name = "-autocomplete" let help = "displays all plugin options. Used for zsh autocompletion" let module_name = "AutocompleteHelp" end) let run_list_all_plugin_options () = if AutocompleteHelp.get () then Cmdline.list_all_plugin_options ~print_invisible:true else Cmdline.nop let () = Cmdline.run_after_exiting_stage run_list_all_plugin_options (* ************************************************************************* *) (** {2 Output Messages} *) (* ************************************************************************* *) let () = Parameter_customize.set_group messages let () = Parameter_customize.do_not_projectify () let () = Parameter_customize.do_not_journalize () let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.do_iterate () module GeneralVerbose = Int (struct let default = 1 let option_name = "-verbose" let arg_name = "n" let help = "general level of verbosity" let module_name = "GeneralVerbose" end) let () = (* line order below matters *) GeneralVerbose.set_range ~min:0 ~max:max_int; GeneralVerbose.add_set_hook (fun _ n -> Cmdline.Verbose_level.set n); match !Cmdline.Verbose_level.value_if_set with | None -> () | Some n -> GeneralVerbose.set n let () = Parameter_customize.set_group messages let () = Parameter_customize.do_not_projectify () let () = Parameter_customize.do_not_journalize () let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.do_iterate () module GeneralDebug = Zero (struct let option_name = "-debug" let arg_name = "n" let help = "general level of debug" let module_name = "GeneralDebug" end) let () = (* line order below matters *) GeneralDebug.set_range ~min:0 ~max:max_int; GeneralDebug.add_set_hook (fun old n -> if n = 0 then decr Plugin.positive_debug_ref else if old = 0 then incr Plugin.positive_debug_ref; Cmdline.Debug_level.set n); match !Cmdline.Debug_level.value_if_set with | None -> () | Some n -> GeneralDebug.set n let () = Parameter_customize.set_group messages let () = Parameter_customize.set_negative_option_name "" let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.do_iterate () let () = Parameter_customize.do_not_projectify () let () = Parameter_customize.do_not_journalize () module Quiet = Bool (struct let default = Cmdline.quiet let option_name = "-quiet" let module_name = "Quiet" let help = "sets -verbose and -debug to 0" end) let () = Quiet.add_set_hook (fun _ b -> assert b; GeneralVerbose.set 0; GeneralDebug.set 0) let () = Parameter_customize.set_group messages let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.do_not_projectify () let () = Parameter_customize.do_not_journalize () module Permissive = Bool (struct let default = !Parameter_customize.is_permissive_ref let option_name = "-permissive" let module_name = "Permissive" let help = "performs less verification on validity of command-line options" end) let () = Permissive.add_set_hook (fun _ b -> Parameter_customize.is_permissive_ref := b) let () = Parameter_customize.set_group messages let () = Parameter_customize.set_cmdline_stage Cmdline.Extended let () = Parameter_customize.do_not_journalize () let () = Parameter_customize.do_not_projectify () module Unicode = struct include True (struct let option_name = "-unicode" let module_name = "Unicode" let help = "use utf8 in messages" end) (* This function behaves nicely with the Gui, that detects if command-line arguments have been set by the user at some point. One possible improvement would be to bypass journalization entirely, but this requires an API change in Plugin *) let without_unicode f arg = let old, default = get (), not (is_set ()) in off (); let r = f arg in if default then clear () else set old; r end module UseUnicode = struct include Unicode let set = deprecated "UseUnicode.set" ~now:"Unicode.set" set let on = deprecated "UseUnicode.on" ~now:"Unicode.on" on let off = deprecated "UseUnicode.off" ~now:"Unicode.off" off let get = deprecated "UseUnicode.get" ~now:"Unicode.get" get end let () = Parameter_customize.set_group messages let () = Parameter_customize.do_not_projectify () let () = Parameter_customize.set_cmdline_stage Cmdline.Extending module TTY = True (struct let option_name = "-tty" let module_name = "TTY" let help = "use terminal capabilities for feedback (when available)" end) let () = Log.tty := TTY.get let () = Parameter_customize.set_group messages let () = Parameter_customize.do_not_projectify () module Time = P.Empty_string (struct let option_name = "-time" let arg_name = "filename" let help = "append process time and timestamp to at exit" end) let () = Parameter_customize.set_group messages let () = Parameter_customize.do_not_projectify () module SymbolicPath = String_set (* TODO: to be replaced by an hashtbl *) (struct let option_name = "-add-symbolic-path" let module_name = "SymbolicPath" let arg_name = "name_1:path_1,...,name_n:path_n" let help = "When displaying file locations, replace (absolute) path by the \ corresponding symbolic name" end) (* ************************************************************************* *) (** {2 Input / Output Source Code} *) (* ************************************************************************* *) let inout_source = add_group "Input/Output Source Code" let () = Parameter_customize.set_group inout_source module PrintCode = False (struct let module_name = "PrintCode" let option_name = "-print" let help = "pretty print original code with its comments" end) let () = Parameter_customize.set_group inout_source let () = Parameter_customize.do_not_projectify () module PrintComments = False (struct let module_name = "PrintComments" let option_name = "-keep-comments" let help = "try to keep comments in C code" end) let () = Parameter_customize.set_group inout_source let () = Parameter_customize.do_not_projectify () module PrintLibc = Bool (struct let module_name = "PrintLibc" let option_name = "-print-libc" let help = "when pretty-printing C code, keep prototypes coming \ from Frama-C standard library" let default = !Fc_config.is_gui (* always print by default on the GUI *) end) let () = Parameter_customize.set_group inout_source module PrintReturn = False (struct let module_name = "PrintReturn" let option_name = "-print-return" let help = "inline gotos to return statement" end) module CodeOutput = struct let () = Parameter_customize.set_group inout_source include P.Empty_string (struct let option_name = "-ocode" let arg_name = "filename" let help = "when printing code, redirects the output to file " end) let streams = Hashtbl.create 7 let output job = let file = get () in if file = "" then Log.print_delayed job else try let fmt = try fst (Hashtbl.find streams file) with Not_found -> let out = open_out file in let fmt = Format.formatter_of_out_channel out in Hashtbl.add streams file (fmt,out) ; fmt in job fmt with Sys_error s -> warning "Fail to open file \"%s\" for code output@\nSystem error: %s.@\n\ Code is output on stdout instead." file s ; Log.print_delayed job let close_all () = Hashtbl.iter (fun file (fmt,cout) -> try Format.pp_print_flush fmt () ; close_out cout ; with Sys_error s -> failure "Fail to close output file \"%s\"@\nSystem error: %s." file s) streams let () = Extlib.safe_at_exit close_all end let add_path s = try let n = CamlString.index s ':' in let name = CamlString.sub s 0 n in let path = CamlString.sub s (n+1) (CamlString.length s - (n+1)) in Filepath.add_symbolic_dir name path with Not_found -> warning "%s is not a valid option argument for -add-symbolic-path. \ It will be ignored" s let () = SymbolicPath.add_set_hook (fun o n -> let d = Datatype.String.Set.diff n o in Datatype.String.Set.iter add_path d) let () = Parameter_customize.set_group inout_source let () = Parameter_customize.do_not_projectify () module FloatNormal = False (struct let option_name = "-float-normal" let module_name = "FloatNormal" let help = "display floats with internal routine" end) let () = Parameter_customize.set_group inout_source let () = Parameter_customize.do_not_projectify () module FloatRelative = False (struct let option_name = "-float-relative" let module_name = "FloatRelative" let help = "display float intervals as [lower_bound ++ width]" end) let () = Parameter_customize.set_group inout_source let () = Parameter_customize.do_not_projectify () module FloatHex = False (struct let option_name = "-float-hex" let module_name = "FloatHex" let help = "display floats as hexadecimal" end) let () = Parameter_customize.set_group inout_source let () = Parameter_customize.do_not_projectify () module BigIntsHex = Int(struct let module_name = "BigIntsHex" let option_name = "-big-ints-hex" let arg_name = "max" let help = "display integers larger than using hexadecimal \ notation" let default = -1 end) (* ************************************************************************* *) (** {2 Save/Load} *) (* ************************************************************************* *) let saveload = add_group "Saving or Loading Data" let () = Parameter_customize.set_group saveload let () = Parameter_customize.do_not_projectify () module SaveState = P.Empty_string (struct let option_name = "-save" let arg_name = "filename" let help = "at exit, save the session into file " end) let () = Parameter_customize.set_group saveload let () = Parameter_customize.set_cmdline_stage Cmdline.Loading (* must be projectified: when loading, this option will be automatically reset *) (*let () = Parameter_customize.do_not_projectify ()*) module LoadState = P.Filepath (struct let option_name = "-load" let arg_name = "filename" let existence = Parameter_sig.Must_exist let help = "load a previously-saved session from file " end) let () = Parameter_customize.set_group saveload let () = Parameter_customize.set_cmdline_stage Cmdline.Extending let () = Parameter_customize.do_not_projectify () module AddPath = String_list (struct let option_name = "-add-path" let module_name = "AddPath" let arg_name = "DIR,..." let help = "Prepend directories to FRAMAC_PLUGIN for loading dynamic plug-ins" end) let () = Parameter_customize.set_group saveload let () = Parameter_customize.set_cmdline_stage Cmdline.Extending let () = Parameter_customize.do_not_projectify () module LoadModule = String_list (struct let option_name = "-load-module" let module_name = "LoadModule" let arg_name = "SPEC,..." let help = "Dynamically load plug-ins, modules and scripts. \ Each can be an OCaml source or object file, with \ or without extension, or a Findlib package. \ Loading order is preserved and \ additional dependencies can be listed in *.depend files." end) let () = LoadModule.add_aliases [ "-load-script" ] let () = Parameter_customize.set_group saveload let () = Parameter_customize.set_cmdline_stage Cmdline.Extending let () = Parameter_customize.do_not_projectify () module AutoLoadPlugins = True (struct let option_name = "-autoload-plugins" let module_name = "AutoLoadPlugins" let help = "Automatically load all plugins in FRAMAC_PLUGIN." end) let bootstrap_loader () = begin Dynamic.set_module_load_path (AddPath.get ()); if AutoLoadPlugins.get () then Dynamic.load_plugin_path () ; List.iter Dynamic.load_module (LoadModule.get()) ; end let () = Cmdline.load_all_plugins := bootstrap_loader module Journal = struct let () = Parameter_customize.set_negative_option_name "-journal-disable" let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.set_group saveload let () = Parameter_customize.do_not_projectify () module Enable = struct include Bool (struct let module_name = "Journal.Enable" let default = Cmdline.journal_enable let option_name = "-journal-enable" let help = "dump a journal while Frama-C exit" end) let is_set () = Cmdline.journal_isset end let () = Parameter_customize.set_group saveload let () = Parameter_customize.do_not_projectify () module Name = String (struct let module_name = "Journal.Name" let option_name = "-journal-name" let default = let dir = (* duplicate code from Plugin.Session *) if Session.Dir_name.is_set () then Session.Dir_name.get () else try Sys.getenv "FRAMAC_SESSION" with Not_found -> "./.frama-c" in dir ^ "/frama_c_journal.ml" let arg_name = "s" let help = "set the filename of the journal" end) let () = Name.add_set_hook (fun _ s -> Journal.set_name s); end let () = Parameter_customize.set_cmdline_stage Cmdline.Extending let () = Parameter_customize.set_group saveload let () = Parameter_customize.do_not_projectify () module Session_dir = P.Empty_string (struct let option_name = "-session" let arg_name = "" let help = "directory in which session files are searched" end) let () = Plugin.session_is_set_ref := Session_dir.is_set let () = Plugin.session_ref := Session_dir.get let () = Parameter_customize.set_cmdline_stage Cmdline.Extending let () = Parameter_customize.set_group saveload let () = Parameter_customize.do_not_projectify () module Config_dir = P.Empty_string (struct let option_name = "-config" let arg_name = "" let help = "directory in which configuration files are searched" end) let () = Plugin.config_is_set_ref := Config_dir.is_set let () = Plugin.config_ref := Config_dir.get (* ************************************************************************* *) (** {2 Parsing} *) (* ************************************************************************* *) let parsing = add_group "Parsing" let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () let () = Parameter_customize.set_cmdline_stage Cmdline.Extended module Machdep = String (struct let module_name = "Machdep" let option_name = "-machdep" let default = "x86_32" let arg_name = "machine" let help = "use as the current machine dependent configuration. \ See \"-machdep help\" for a list" end) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module ReadAnnot = True(struct let module_name = "ReadAnnot" let option_name = "-annot" let help = "read and parse annotations" end) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module PreprocessAnnot = False(struct let module_name = "PreprocessAnnot" let option_name = "-pp-annot" let help = "pre-process annotations (if they are read). Set by default if \ the pre-processor is GNU-like (see option -cpp-frama-c-compliant)" end) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module CppCommand = P.Empty_string (struct let option_name = "-cpp-command" let arg_name = "cmd" let help = " is used to build the preprocessing command.\n\ Default to $CPP environment variable or else \"gcc -C -E -I.\".\n\ If unset, the command is built as follows:\n\ CPP -o \n\ %1 and %2 can be used into CPP string to mark the position of \ and respectively" end) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () let () = Parameter_customize.no_category () module CppExtraArgs = String_list (struct let module_name = "CppExtraArgs" let option_name = "-cpp-extra-args" let arg_name = "args" let help = "additional arguments passed to the preprocessor while \ preprocessing the C code but not while preprocessing annotations" end) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module CppGnuLike = True (struct let module_name = "CppGnuLike" let option_name = "-cpp-frama-c-compliant" let help = "indicates that a custom pre-processor (see option -cpp-command) \ accepts the same set of options as GNU cpp. Set it to false if you \ have pre-processing issues with a custom pre-processor." end) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module FramaCStdLib = True (struct let module_name = "FramaCStdLib" let option_name = "-frama-c-stdlib" let help = "adds -I$FRAMAC_SHARE/libc to the options given to the cpp command. \ If -cpp-frama-c-compliant is not false, also adds -nostdinc to prevent \ inconsistent mix of system and Frama-C header files" end) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module ContinueOnAnnotError = False(struct let module_name = "ContinueOnAnnotError" let option_name = "-continue-annot-error" let help = "[DEPRECATED: Use -kernel-warn-key annot-error instead] \ When an annotation fails to type-check, emit a warning \ and discard the annotation instead of generating an error \ (errors in C are still fatal)" end) let () = ContinueOnAnnotError.add_set_hook (fun _ f -> warning ~once:true "-continue-annot-error is deprecated. \ Use -kernel-warn-key annot-error (or similar option) instead"; set_warn_status wkey_annot_error (if f then Log.Wactive else Log.Wabort)) let () = Parameter_customize.set_group parsing module Orig_name = False(struct let option_name = "-orig-name" let module_name = "Orig_name" let help = "prints a message each time a variable is renamed" end) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module ImplicitFunctionDeclaration = String(struct let option_name = "-implicit-function-declaration" let arg_name = "action" let help = "[DEPRECATED: Use \ -kernel-warn-key typing:implicit-function-declaration=error instead] \ Warn or abort when a function is called before it has been declared \ (non-C99 compliant); action must be ignore, warn, or error" let default = "warn" let module_name = "ImplicitFunctionDeclaration" end) let () = ImplicitFunctionDeclaration.set_possible_values ["ignore"; "warn"; "error"] let () = ImplicitFunctionDeclaration.add_set_hook (fun _ s -> warning ~once:true "-implicit-function-declaration is deprecated, \ use '-kernel-warn-key typing:implicit-function-declaration' \ (or similar options) instead."; let status = if s = "ignore" then Log.Winactive else if s = "warn" then Log.Wactive else if s = "error" then Log.Wabort else fatal "invalid value: %s" s in set_warn_status wkey_implicit_function_declaration status) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module WarnDecimalFloat = String(struct let option_name = "-warn-decimal-float" let arg_name = "freq" let help = "[DEPRECATED: Use -kernel-warn-key \ parser:decimal-float=active (or inactive) instead] \ Warn when floating-point constants cannot be exactly \ represented; freq must be one of none, once or all" let default = "once" let module_name = "WarnDecimalFloat" end) let () = WarnDecimalFloat.set_possible_values ["none"; "once"; "all"] let () = WarnDecimalFloat.add_set_hook (fun _ s -> let status = if s = "none" then Log.Winactive else if s = "once" then Log.Wonce else if s = "all" then Log.Wactive else fatal "invalid value: %s" s in set_warn_status wkey_decimal_float status) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module C11 = False(struct let option_name = "-c11" let help = "allow C11 constructs (experimental; partial support only)" let module_name = "C11" end) let () = Parameter_customize.set_group parsing let () = Parameter_customize.do_not_reset_on_copy () module JsonCompilationDatabase = String (struct let module_name = "JsonCompilationDatabase" let option_name = "-json-compilation-database" let default = "" let arg_name = "path" let help = "when set, preprocessing of each file will include corresponding \ flags (e.g. -I, -D) from the JSON compilation database \ specified by . If is a directory, use \ '/compile_commands.json'. Disabled by default." end) (* ************************************************************************* *) (** {2 Customizing Normalization} *) (* ************************************************************************* *) let normalisation = add_group "Customizing Normalization" let () = Parameter_customize.set_group normalisation module UnrollingLevel = Zero (struct let module_name = "UnrollingLevel" let option_name = "-ulevel" let arg_name = "l" let help = "unroll loops n times (defaults to 0) before analyzes. \ A negative value hides UNROLL loop pragmas." end) let () = Parameter_customize.set_group normalisation module UnrollingForce = Bool (struct let module_name = "UnrollingForce" let default = false let option_name = "-ulevel-force" let help = "ignore UNROLL loop pragmas disabling unrolling." end) let () = Parameter_customize.set_group normalisation let () = Parameter_customize.do_not_reset_on_copy () let () = Parameter_customize.is_invisible () module LogicalOperators = Bool (struct let module_name = "LogicalOperators" let option_name = "-keep-logical-operators" let default = false let help = " UNSUPPORTED : use it only if you really know what you are doing. \ Use logical operators (&& and ||) instead of conversion into \ conditional statements when possible." end) let () = Parameter_customize.set_group normalisation let () = Parameter_customize.do_not_reset_on_copy () module Enums = P.String (struct let option_name = "-enums" let arg_name = "repr" let default = "gcc-enums" let help = "use to decide how enumerated types should be represented. \ -enums help gives the list of available representations (default: " ^ default ^ ")" end) let enum_reprs = ["gcc-enums"; "gcc-short-enums"; "int";] let () = Enums.set_possible_values ("help"::enum_reprs) let () = Enums.add_set_hook (fun _ o -> if o = "help" then feedback "Possible enums representation are: %a" (Pretty_utils.pp_list ~sep:", " Format.pp_print_string) enum_reprs) let () = Parameter_customize.set_group normalisation module SimplifyCfg = False (struct let module_name = "SimplifyCfg" let option_name = "-simplify-cfg" let help = "remove break, continue and switch statements before analyses" end) let () = Parameter_customize.set_group normalisation module KeepSwitch = False(struct let option_name = "-keep-switch" let module_name = "KeepSwitch" let help = "keep switch statements despite -simplify-cfg" end) let () = Parameter_customize.set_group normalisation let () = Parameter_customize.set_negative_option_name "-remove-unused-specified-functions" module Keep_unused_specified_functions = True(struct let option_name = "-keep-unused-specified-functions" let module_name = "Keep_unused_specified_functions" let help = "keep specified-but-unused functions" end) let () = Parameter_customize.set_group normalisation let () = Parameter_customize.set_negative_option_name "-remove-unused-types" module Keep_unused_types = False(struct let option_name = "-keep-unused-types" let module_name = "Keep_unused_types" let help = "keep unused types (false by default)" end) let () = Parameter_customize.set_group normalisation module SimplifyTrivialLoops = True(struct let option_name = "-simplify-trivial-loops" let module_name = "SimplifyTrivialLoops" let help = "simplify trivial loops, such as do ... while(0) loops" end) let () = Parameter_customize.set_group normalisation module Constfold = False (struct let option_name = "-constfold" let module_name = "Constfold" let help = "fold all constant expressions in the code before analysis" end) let () = Parameter_customize.set_group normalisation let () = Parameter_customize.do_not_reset_on_copy () module InitializedPaddingLocals = True (struct let option_name = "-initialized-padding-locals" let module_name = "InitializedPaddingLocals" let help = "Implicit initialization of locals sets padding bits to 0. \ If false, padding bits are left uninitialized. \ Defaults to true." end) let () = Parameter_customize.set_group normalisation module AggressiveMerging = False (struct let option_name = "-aggressive-merging" let module_name = "AggressiveMerging" let help = "merge function definitions modulo renaming \ (defaults to false)" end) let () = Parameter_customize.set_group normalisation module AsmContractsGenerate = True (struct let option_name = "-asm-contracts" let module_name = "AsmContractsGenerate" let help = "generate contracts for assembly code written according \ to gcc's extended syntax" end) let () = Parameter_customize.set_group normalisation module AsmContractsAutoValidate = False (struct let option_name = "-asm-contracts-auto-validate" let module_name = "AsmContractsAutoValidate" let help = "automatically mark contracts generated from asm as valid \ (defaults to false)" end) let () = Parameter_customize.set_group normalisation module RemoveExn = False (struct let option_name = "-remove-exn" let module_name = "RemoveExn" let help = "transforms throw and try/catch statements to normal C functions. \ Disabled by default, unless input source language has \ has an exception mechanism." end) module Files = struct let () = Parameter_customize.is_invisible () let () = Parameter_customize.no_category () include String_list (struct let option_name = "" let module_name = "Files" let arg_name = "" let help = "" end) let () = Cmdline.use_cmdline_files set end let () = Parameter_customize.set_group normalisation module AllowDuplication = True(struct let option_name = "-allow-duplication" let module_name = "AllowDuplication" let help = "allow duplication of small blocks during normalization" end) let () = Parameter_customize.set_group normalisation module DoCollapseCallCast = True(struct let option_name = "-collapse-call-cast" let module_name = "DoCollapseCallCast" let help = "Allow some implicit casts between returned value of a function \ and the lvalue it is assigned to." end) let normalization_parameters () = let norm = Cmdline.Group.name normalisation in let kernel = Plugin.get_from_name "" in Hashtbl.find kernel.Plugin.p_parameters norm (* ************************************************************************* *) (** {2 Analysis Options} *) (* ************************************************************************* *) let analysis_options = add_group "Analysis Options" let () = Parameter_customize.set_group analysis_options module MainFunction = String (struct let module_name = "MainFunction" let default = "main" let option_name = "-main" let arg_name = "f" let help = "use as entry point for analysis. See \"-lib-entry\" \ if this is not for a complete application. Defaults to main" end) let () = Parameter_customize.set_group analysis_options module LibEntry = False (struct let module_name = "LibEntry" let option_name = "-lib-entry" let help ="run analysis for an incomplete application e.g. an API call. See the -main option to set the entry point" end) let () = Parameter_customize.set_group analysis_options module UnspecifiedAccess = False(struct let module_name = "UnspecifiedAccess" let option_name = "-unspecified-access" let help = "do not assume that read/write accesses occurring \ between sequence points are separated" end) let () = Parameter_customize.set_negative_option_name "-unsafe-arrays" let () = Parameter_customize.set_group analysis_options module SafeArrays = True (struct let module_name = "SafeArrays" let option_name = "-safe-arrays" let help = "for multidimensional arrays or arrays that are fields \ inside structs, assume that accesses are in bounds" end) let () = Parameter_customize.set_group analysis_options let () = Parameter_customize.do_not_reset_on_copy () module AbsoluteValidRange = struct module Info = struct let option_name = "-absolute-valid-range" let arg_name = "min-max" let help = "min and max must be integers in decimal, hexadecimal (0x, 0X), octal (0o) or binary (0b) notation and fit in 64 bits. Assume that that all absolute addresses outside of the [min-max] range are invalid. In the absence of this option, all absolute addresses are assumed to be invalid" let default = "" let module_name = "AbsoluteValidRange" end include String(Info) end (* Signed overflows are undefined behaviors. *) let () = Parameter_customize.set_group analysis_options let () = Parameter_customize.do_not_reset_on_copy () module SignedOverflow = True (struct let module_name = "SignedOverflow" let option_name = "-warn-signed-overflow" let help = "generate alarms for signed operations that overflow." end) (* Unsigned overflows are ok, but might not always be a behavior the programmer wants. *) let () = Parameter_customize.set_group analysis_options let () = Parameter_customize.do_not_reset_on_copy () module UnsignedOverflow = False (struct let module_name = "UnsignedOverflow" let option_name = "-warn-unsigned-overflow" let help = "generate alarms for unsigned operations that overflow" end) (* Left shifts on negative integers are undefined behaviors. *) let () = Parameter_customize.set_group analysis_options let () = Parameter_customize.do_not_reset_on_copy () module LeftShiftNegative = True (struct let module_name = "LeftShiftNegative" let option_name = "-warn-left-shift-negative" let help = "generate alarms for signed left shifts on negative values." end) (* Right shift on negative integers are implementation-defined behaviors. *) let () = Parameter_customize.set_group analysis_options let () = Parameter_customize.do_not_reset_on_copy () module RightShiftNegative = False (struct let module_name = "RightShiftNegative" let option_name = "-warn-right-shift-negative" let help = "generate alarms for signed right shifts on negative values." end) (* Signed downcast are implementation-defined behaviors. *) let () = Parameter_customize.set_group analysis_options let () = Parameter_customize.do_not_reset_on_copy () module SignedDowncast = False (struct let module_name = "SignedDowncast" let option_name = "-warn-signed-downcast" let help = "generate alarms when signed downcasts may exceed the \ destination range" end) (* Unsigned downcasts are ok, but might not always be a behavior the programmer wants. *) let () = Parameter_customize.set_group analysis_options let () = Parameter_customize.do_not_reset_on_copy () module UnsignedDowncast = False (struct let module_name = "UnsignedDowncast" let option_name = "-warn-unsigned-downcast" let help = "generate alarms when unsigned downcasts may exceed the \ destination range" end) (* Not finite floats are ok, but might not always be a behavior the programmer wants. *) let () = Parameter_customize.set_group analysis_options let () = Parameter_customize.do_not_reset_on_copy () module SpecialFloat = String (struct let module_name = "SpecialFloat" let option_name = "-warn-special-float" let default = "non-finite" let arg_name = "none|nan|non-finite" let help = "generate alarms when special floats are produced: \ infinite floats or NaN (by default), only on NaN or never." end) let () = SpecialFloat.set_possible_values ["none"; "nan"; "non-finite"] let () = Parameter_customize.set_group analysis_options let () = Parameter_customize.do_not_reset_on_copy () module InvalidBool = True (struct let module_name = "InvalidBool" let option_name = "-warn-invalid-bool" let help = "generate alarms when trap representations are read from \ _Bool lvalues." end) (* ************************************************************************* *) (** {2 Sequencing options} *) (* ************************************************************************* *) let seq = add_group "Sequencing Options" let () = Cmdline.add_option_without_action "-then" ~plugin:"" ~group:seq ~help:"parse options before `-then' and execute Frama-C \ accordingly, then parse options after `-then' and re-execute Frama-C" ~visible:true ~ext_help:"" () let () = Cmdline.add_option_without_action "-then-last" ~plugin:"" ~group:seq ~help:"like `-then', but the second group of actions is executed \ on the last project created by a program transformer." ~visible:true ~ext_help:"" () let () = Cmdline.add_option_without_action "-then-replace" ~plugin:"" ~group:seq ~help:"like `-then-last', but also remove the previous current project." ~visible:true ~ext_help:"" () let () = Cmdline.add_option_without_action "-then-on" ~plugin:"" ~argname:"p" ~group:seq ~help:"like `-then', but the second group of actions is executed \ on project

    " ~visible:true ~ext_help:"" () (* ************************************************************************* *) (** {2 Project-related options} *) (* ************************************************************************* *) let project = add_group "Project-related Options" let () = Parameter_customize.set_group project let () = Parameter_customize.do_not_projectify () module Set_project_as_default = False(struct let module_name = "Set_project_as_default" let option_name = "-set-project-as-default" let help = "the current project becomes the default one \ (and so future '-then' sequences are applied on it)" end) let () = Parameter_customize.set_group project let () = Parameter_customize.do_not_projectify () module Remove_projects = P.Make_set (struct include Project.Datatype let of_singleton_string = P.no_element_of_string let of_string s = try Project.from_unique_name s with Project.Unknown_project -> raise (P.Cannot_build ("no project '" ^ s ^ "'")) let to_string = Project.get_unique_name end) (struct let option_name = "-remove-projects" let arg_name = "p1, ..., pn" let help = "remove the given projects , ..., . \ @all_but_current removes all projects but the current one." let default = Project.Datatype.Set.empty let dependencies = [] end) let _ = Remove_projects.Category.enable_all [] (object method fold: 'a. (Project.t -> 'a -> 'a) -> 'a -> 'a = fun f acc -> Project.fold_on_projects (fun acc p -> f p acc) acc method mem _p = true (* impossible to build an unregistered project *) end) let _ = Remove_projects.Category.add "all_but_current" [] (object method fold: 'a. (Project.t -> 'a -> 'a) -> 'a -> 'a = fun f acc -> Project.fold_on_projects (fun acc p -> if Project.is_current p then acc else f p acc) acc method mem p = not (Project.is_current p) end) let () = Cmdline.run_after_configuring_stage (fun () -> (* clear "-remove-projects" before itering over (a copy of) its contents in order to prevent warnings about dangling pointer deletion (since it is itself projectified and so contains a pointer to the project being removed). *) let s = Remove_projects.get () in Remove_projects.clear (); Project.Datatype.Set.iter (fun project -> Project.remove ~project ()) s) (* ************************************************************************* *) (** {2 Others options} *) (* ************************************************************************* *) [@@@warning "-60"] (* Warning this three options are parsed and used directly from Cmdline *) let () = Parameter_customize.set_negative_option_name "" let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.is_invisible () module NoType = Bool (struct let module_name = "NoType" let default = not Cmdline.use_type let option_name = "-no-type" let help = "" end) let () = Parameter_customize.set_negative_option_name "" let () = Parameter_customize.set_cmdline_stage Cmdline.Early let () = Parameter_customize.is_invisible () module NoObj = Bool (struct let module_name = "NoObj" let default = not Cmdline.use_obj let option_name = "-no-obj" let help = "" end) let () = Parameter_customize.set_group project let () = Parameter_customize.set_negative_option_name "" let () = Parameter_customize.set_cmdline_stage Cmdline.Early module Deterministic = Bool (struct let module_name = "Deterministic" let default = not Cmdline.deterministic let option_name = "-deterministic" let help = "" end) [@@@warning "+60"] (* ************************************************************************* *) (** {2 Checks} *) (* ************************************************************************* *) let checks = add_group "Checks" let () = Parameter_customize.set_group checks let () = Parameter_customize.do_not_reset_on_copy () module Check = False(struct let option_name = "-check" let module_name = "Check" let help = "performs consistency checks over the Abstract Syntax \ Tree" end) let () = Parameter_customize.set_group checks module Copy = False(struct let option_name = "-copy" let module_name = "Copy" let help = "always perform a copy of the original AST before analysis begin" end) let () = Parameter_customize.set_group checks let () = Parameter_customize.set_negative_option_name "" module TypeCheck = True(struct let module_name = "TypeCheck" let option_name = "-typecheck" let help = "forces typechecking of the source files" end) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/kernel.mli0000666000000000000000000004115313571573400023267 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Provided services for kernel developers. @plugin development guide *) (* ************************************************************************* *) (** {2 Log Machinery} *) (* ************************************************************************* *) include Plugin.S (* ************************************************************************* *) (** {2 Message and warning categories} *) (* ************************************************************************* *) val dkey_alpha: category val dkey_alpha_undo: category val dkey_asm_contracts: category val dkey_ast: category val dkey_check: category val dkey_comments: category val dkey_compilation_db: category val dkey_dataflow: category val dkey_dataflow_scc: category val dkey_dominators: category val dkey_emitter: category val dkey_emitter_clear: category val dkey_exn_flow: category val dkey_file_transform: category val dkey_file_print_one: category val dkey_file_annot: category val dkey_filter: category val dkey_globals: category val dkey_kf_blocks: category val dkey_linker: category val dkey_linker_find: category val dkey_loops: category val dkey_parser: category val dkey_pp: category val dkey_print_attrs: category val dkey_print_bitfields: category val dkey_print_builtins: category val dkey_print_logic_coercions: category val dkey_print_logic_types: category val dkey_print_sid: category val dkey_print_unspecified: category val dkey_print_vid: category val dkey_prop_status: category val dkey_prop_status_emit: category val dkey_prop_status_merge: category val dkey_prop_status_graph: category val dkey_prop_status_reg: category val dkey_rmtmps: category val dkey_referenced: category val dkey_task: category val dkey_typing_global: category val dkey_typing_init: category val dkey_typing_chunk: category val dkey_typing_cast: category val dkey_typing_pragma: category val dkey_ulevel: category val dkey_visitor: category val wkey_annot_error: warn_category (** error in annotation. If only a warning, annotation will just be ignored. *) val wkey_acsl_float_compare: warn_category val wkey_drop_unused: warn_category val wkey_implicit_conv_void_ptr: warn_category val wkey_incompatible_types_call: warn_category val wkey_incompatible_pointer_types: warn_category val wkey_int_conversion: warn_category val wkey_cert_exp_46: warn_category val wkey_cert_msc_38: warn_category val wkey_cert_exp_10: warn_category val wkey_check_volatile: warn_category val wkey_jcdb: warn_category val wkey_implicit_function_declaration: warn_category val wkey_no_proto: warn_category val wkey_missing_spec: warn_category val wkey_decimal_float: warn_category val wkey_acsl_extension: warn_category val wkey_cmdline: warn_category (** Command-line related warning, e.g. for invalid options given by the user *) (* ************************************************************************* *) (** {2 Functors for late option registration} *) (** Kernel_function-related options cannot be registered in this module: They depend on [Globals], which is linked later. We provide here functors to declare them after [Globals] *) (* ************************************************************************* *) module type Input_with_arg = sig include Parameter_sig.Input_with_arg val module_name: string end module Kernel_function_set(X:Input_with_arg): Parameter_sig.Kernel_function_set (* ************************************************************************* *) (** {2 Option groups} *) (* ************************************************************************* *) val inout_source: Cmdline.Group.t val saveload: Cmdline.Group.t val parsing: Cmdline.Group.t val normalisation: Cmdline.Group.t val analysis_options: Cmdline.Group.t val seq: Cmdline.Group.t val project: Cmdline.Group.t val checks: Cmdline.Group.t (* ************************************************************************* *) (** {2 Installation Information} *) (* ************************************************************************* *) module PrintConfig: Parameter_sig.Bool (** Behavior of option "-print-config" *) module PrintVersion: Parameter_sig.Bool (** Behavior of option "-print-version" *) module PrintShare: Parameter_sig.Bool (** Behavior of option "-print-share-path" *) module PrintLib: Parameter_sig.Bool (** Behavior of option "-print-lib-path" *) module PrintPluginPath: Parameter_sig.Bool (** Behavior of option "-print-plugin-path" *) (* ************************************************************************* *) (** {2 Output Messages} *) (* ************************************************************************* *) module GeneralVerbose: Parameter_sig.Int (** Behavior of option "-verbose" *) module GeneralDebug: Parameter_sig.Int (** Behavior of option "-debug" *) module Quiet: Parameter_sig.Bool (** Behavior of option "-quiet" *) (** @plugin development guide *) module Unicode: sig include Parameter_sig.Bool val without_unicode: ('a -> 'b) -> 'a -> 'b (** Execute the given function as if the option [-unicode] was not set. *) end (** Behavior of option "-unicode". @plugin development guide *) module UseUnicode: Parameter_sig.Bool (** Behavior of option "-unicode" @deprecated since Nitrogen-20111001 use module {!Unicode} instead. *) module Time: Parameter_sig.String (** Behavior of option "-time" *) (* ************************************************************************* *) (** {2 Input / Output Source Code} *) (* ************************************************************************* *) module PrintCode : Parameter_sig.Bool (** Behavior of option "-print" *) module PrintMachdep : Parameter_sig.Bool (** Behavior of option "-print-machdep" @since Phosphorus-20170501-beta1 *) module PrintLibc: Parameter_sig.Bool (** Behavior of option "-print-libc" @since Phosphorus-20170501-beta1 *) module PrintComments: Parameter_sig.Bool (** Behavior of option "-keep-comments" *) module PrintReturn : Parameter_sig.Bool (** Behavior of option "-print-return" @since Sulfur-20171101 *) (** Behavior of option "-ocode". @plugin development guide *) module CodeOutput : sig include Parameter_sig.String val output: (Format.formatter -> unit) -> unit end (** Behavior of option "-add-symbolic-path" @since Neon-20140301 *) module SymbolicPath: Parameter_sig.String_set module FloatNormal: Parameter_sig.Bool (** Behavior of option "-float-normal" *) module FloatRelative: Parameter_sig.Bool (** Behavior of option "-float-relative" *) module FloatHex: Parameter_sig.Bool (** Behavior of option "-float-hex" *) module BigIntsHex: Parameter_sig.Int (** Behavior of option "-hexadecimal-big-integers" *) (* ************************************************************************* *) (** {2 Save/Load} *) (* ************************************************************************* *) module SaveState: Parameter_sig.String (** Behavior of option "-save" *) module LoadState: Parameter_sig.Filepath (** Behavior of option "-load" *) module LoadModule: Parameter_sig.String_list (** Behavior of option "-load-module" *) module AutoLoadPlugins: Parameter_sig.Bool (** Behavior of option "-autoload-plugins" *) (** Kernel for journalization. *) module Journal: sig module Enable: Parameter_sig.Bool (** Behavior of option "-journal-enable" *) module Name: Parameter_sig.String (** Behavior of option "-journal-name" *) end module Session_dir: Parameter_sig.String (** Directory in which session files are searched. @since Neon-20140301 *) module Config_dir: Parameter_sig.String (** Directory in which config files are searched. @since Neon-20140301 *) (* this stop special comment does not work as expected (and as explained in the OCamldoc manual, Section 15.2.2. It just skips all the rest of the file instead of skipping until the next stop comment... (**/**) *) module Set_project_as_default: Parameter_sig.Bool (** Undocumented. *) (* See (meta-)comment on the previous stop comment (**/**) *) (* ************************************************************************* *) (** {2 Customizing Normalization and parsing} *) (* ************************************************************************* *) module UnrollingLevel: Parameter_sig.Int (** Behavior of option "-ulevel" *) module UnrollingForce: Parameter_sig.Bool (** Behavior of option "-ulevel-force" @since Neon-20140301 *) (** Behavior of option "-machdep". If function [set] is called, then {!File.prepare_from_c_files} must be called for well preparing the AST. *) module Machdep: Parameter_sig.String (** Behavior of invisible option -keep-logical operator: Tries to avoid converting && and || into conditional statements. Note that this option is incompatible with many (most) plug-ins of the platform and thus should only be enabled with great care and for very specific analyses need. *) module LogicalOperators: Parameter_sig.Bool (** Behavior of option "-enums" *) module Enums: Parameter_sig.String module CppCommand: Parameter_sig.String (** Behavior of option "-cpp-command" *) module CppExtraArgs: Parameter_sig.String_list (** Behavior of option "-cpp-extra-args" *) module CppGnuLike: Parameter_sig.Bool (** Behavior of option "-cpp-frama-c-compliant" *) module FramaCStdLib: Parameter_sig.Bool (** Behavior of option "-frama-c-stdlib" *) module ReadAnnot: Parameter_sig.Bool (** Behavior of option "-read-annot" *) module PreprocessAnnot: Parameter_sig.Bool (** Behavior of option "-pp-annot" *) module ContinueOnAnnotError: Parameter_sig.Bool (** Behavior of option "-continue-annot-error" *) [@@ deprecated "Use Kernel.wkey_annot_error instead"] module SimplifyCfg: Parameter_sig.Bool (** Behavior of option "-simplify-cfg" *) module KeepSwitch: Parameter_sig.Bool (** Behavior of option "-keep-switch" *) module Keep_unused_specified_functions: Parameter_sig.Bool (** Behavior of option "-keep-unused-specified-functions". *) module Keep_unused_types: Parameter_sig.Bool (** Behavior of option "-keep-unused-types". *) module SimplifyTrivialLoops: Parameter_sig.Bool (** Behavior of option "-simplify-trivial-loops". *) module Constfold: Parameter_sig.Bool (** Behavior of option "-constfold" *) module InitializedPaddingLocals: Parameter_sig.Bool (** Behavior of option "-initialized-padding-locals" *) module AggressiveMerging: Parameter_sig.Bool (** Behavior of option "-aggressive-merging" *) module AsmContractsGenerate: Parameter_sig.Bool (** Behavior of option "-asm-contracts" *) module AsmContractsAutoValidate: Parameter_sig.Bool (** Behavior of option "-asm-contracts-auto-validate." *) module RemoveExn: Parameter_sig.Bool (** Behavior of option "-remove-exn" *) (** Analyzed files *) module Files: Parameter_sig.String_list (** List of files to analyse *) module Orig_name: Parameter_sig.Bool (** Behavior of option "-orig-name" *) val normalization_parameters: unit -> Typed_parameter.t list (** All the normalization options that influence the AST (in particular, changing one will reset the AST entirely.contents @modify Chlorine-20180501 make it non-constant *) module WarnDecimalFloat: Parameter_sig.String (** Behavior of option "-warn-decimal-float" *) [@@ deprecated "Uses kernel.wkey_decimal_float instead."] module ImplicitFunctionDeclaration: Parameter_sig.String (** Behavior of option "-implicit-function-declaration" *) [@@ deprecated "Uses kernel.wkey_implicit_function_declaration instead."] module C11: Parameter_sig.Bool (** Behavior of option "-c11" *) module JsonCompilationDatabase: Parameter_sig.String (** Behavior of option "-json-compilation-database" *) (* ************************************************************************* *) (** {3 Customizing cabs2cil options} *) (* ************************************************************************* *) module AllowDuplication: Parameter_sig.Bool (** Behavior of option "-allow-duplication". *) module DoCollapseCallCast: Parameter_sig.Bool (** Behavior of option "-collapse-call-cast". If false, the destination of a Call instruction should always have the same type as the function's return type. Where needed, CIL will insert a temporary to make this happen. If true, the destination type may differ from the return type, so there is an implicit cast. This is useful for analyses involving [malloc], because the instruction "T* x = malloc(...);" won't be broken into two instructions, so it's easy to find the allocation type. This is false by default. Set to true to replicate the behavior of CIL 1.3.5 and earlier. *) (* ************************************************************************* *) (** {2 Analysis Behavior of options} *) (* ************************************************************************* *) (** Behavior of option "-main". You should usually use {!Globals.entry_point} instead of {!MainFunction.get} since the first one handles the case where the entry point is invalid in the right way. *) module MainFunction: sig include Parameter_sig.String (** {2 Internal functions} Not for casual users. *) val unsafe_set: t -> unit end (** Behavior of option "-lib-entry". You should usually use {!Globals.entry_point} instead of {!LibEntry.get} since the first one handles the case where the entry point is invalid in the right way. *) module LibEntry: sig include Parameter_sig.Bool val unsafe_set: t -> unit (** Not for casual users. *) end module UnspecifiedAccess: Parameter_sig.Bool (** Behavior of option "-unspecified-access" *) module SafeArrays: Parameter_sig.Bool (** Behavior of option "-safe-arrays". @plugin development guide *) module SignedOverflow: Parameter_sig.Bool (** Behavior of option "-warn-signed-overflow" *) module UnsignedOverflow: Parameter_sig.Bool (** Behavior of option "-warn-unsigned-overflow" *) module LeftShiftNegative: Parameter_sig.Bool (** Behavior of option "-warn-left-shift-negative" *) module RightShiftNegative: Parameter_sig.Bool (** Behavior of option "-warn-right-shift-negative" *) module SignedDowncast: Parameter_sig.Bool (** Behavior of option "-warn-signed-downcast" *) module UnsignedDowncast: Parameter_sig.Bool (** Behavior of option "-warn-unsigned-downcast" *) module SpecialFloat: Parameter_sig.String (** Behavior of option "-warn-special-float" *) module InvalidBool: Parameter_sig.Bool (** Behavior of option "-warn-invalid-bool" *) module AbsoluteValidRange: Parameter_sig.String (** Behavior of option "-absolute-valid-range" *) (* module FloatFlushToZero: Parameter_sig.Bool (** Behavior of option "-float-flush-to-zero" *) *) (* ************************************************************************* *) (** {2 Checks} *) (* ************************************************************************* *) module Check: Parameter_sig.Bool (** Behavior of option "-check" *) module Copy: Parameter_sig.Bool (** Behavior of option "-copy" *) module TypeCheck: Parameter_sig.Bool (** Behavior of option "-typecheck" *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/log.ml0000666000000000000000000011667613571573400022434 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type kind = Result | Feedback | Debug | Warning | Error | Failure [@@@ warning "-32"] let pretty_kind fmt = function | Result -> Format.fprintf fmt "Result" | Feedback -> Format.fprintf fmt "Feedback" | Debug -> Format.fprintf fmt "Debug" | Warning -> Format.fprintf fmt "Warning" | Error -> Format.fprintf fmt "Error" | Failure -> Format.fprintf fmt "Failure" [@@@ warning "+32"] type event = { evt_kind : kind ; evt_plugin : string ; evt_category : string option; evt_source : Filepath.position option ; evt_message : string ; } let kernel_channel_name = "kernel" let kernel_label_name = "kernel" (* -------------------------------------------------------------------------- *) (* --- Exception Management --- *) (* -------------------------------------------------------------------------- *) exception FeatureRequest of string * string exception AbortError of string (* plug-in *) exception AbortFatal of string (* plug-in *) (* -------------------------------------------------------------------------- *) (* --- Terminal Management --- *) (* -------------------------------------------------------------------------- *) open Format type lock = | Ready | Locked | DelayedLock type terminal = { mutable lock : lock ; mutable isatty : bool ; mutable clean : bool ; mutable delayed : (terminal -> unit) list ; mutable output : string -> int -> int -> unit ; (* Same as Format.make_formatter *) mutable flush : unit -> unit ; (* Same as Format.make_formatter *) } let delayed_echo t = match t.lock with | Locked -> true | Ready | DelayedLock -> false let is_locked t = match t.lock with | Locked | DelayedLock -> true | Ready -> false let is_ready t = match t.lock with | Locked | DelayedLock -> false | Ready -> true let term_clean t = if t.isatty && not t.clean then begin let u = "\r\027[K" in (* TERM escape commands: "\r" is carriage return ; "\027[K" is CSI command EL 'Erase in Line' ; See https://en.wikipedia.org/wiki/ANSI_escape_code *) t.output u 0 (String.length u) ; t.clean <- true ; end let set_terminal t isatty output flush = begin (* Ensures previous terminal state is clean *) assert (is_ready t) ; term_clean t ; (* Now reconfigure the terminal *) t.isatty <- isatty ; t.output <- output ; t.flush <- flush ; t.clean <- true ; end let stdout = { lock = Ready ; clean = true ; delayed = [] ; isatty = Unix.isatty Unix.stdout ; output = output_substring stdout ; flush = (fun () -> flush stdout); } let clean () = term_clean stdout let set_output ?(isatty=false) output flush = set_terminal stdout isatty output flush (* -------------------------------------------------------------------------- *) (* --- Locked Formatter --- *) (* -------------------------------------------------------------------------- *) type delayed = | Delayed of terminal | Formatter of (string -> int -> int -> unit) * (unit -> unit) let lock_terminal t = begin if is_locked t then failwith "Console is already locked" ; term_clean t ; t.lock <- Locked ; Format.make_formatter t.output t.flush ; end let unlock_terminal t fmt = if is_ready t then failwith "Console can not be unlocked" ; begin Format.pp_print_flush fmt () ; t.lock <- Ready ; List.iter (fun job -> job t) (List.rev t.delayed) ; t.delayed <- [] ; end let print_on_output job = let fmt = lock_terminal stdout in try job fmt ; unlock_terminal stdout fmt with error -> unlock_terminal stdout fmt ; raise error (* -------------------------------------------------------------------------- *) (* --- Delayed Lock until first write --- *) (* -------------------------------------------------------------------------- *) let delayed_terminal terminal = if is_locked terminal then failwith "Console is already locked" ; terminal.lock <- DelayedLock ; let d = ref (Delayed terminal) in let d_output d text k n = match !d with | Delayed t -> t.lock <- Locked ; d := Formatter( t.output , t.flush ) ; t.output text k n | Formatter(out,_) -> out text k n in let d_flush d () = match !d with | Delayed _ -> () (* nothing to flush yet ! *) | Formatter(_,flush) -> flush () in Format.make_formatter (d_output d) (d_flush d) let print_delayed job = let fmt = delayed_terminal stdout in try job fmt ; unlock_terminal stdout fmt with error -> unlock_terminal stdout fmt ; raise error (* -------------------------------------------------------------------------- *) (* --- Echo Line(s) --- *) (* -------------------------------------------------------------------------- *) (* whenever the first line of the event shall be printed along the prefix *) let is_prefixed_event = function | { evt_category = None ; evt_source = None } -> true | _ -> false let is_single_line text = try ignore (String.index_from text 0 '\n') ; false with Not_found -> true let echo_firstline output text p q width = let t = try String.index_from text p '\n' with Not_found -> succ q in let n = min width (t-p) in output text p n let echo_newline output = output "\n" 0 1 (* output indentation unless the first line is along the prefix *) let echo_line output ~prefix text k n = if not prefix then output " " 0 2 ; output text k n let rec echo_lines ?(prefix=false) output text p q = if p <= q then let t = try String.index_from text p '\n' with Not_found -> (-1) in if t < 0 || t > q then begin (* incomplete, last line *) echo_line output ~prefix text p (q+1-p) ; echo_newline output ; end else begin (* complete line *) echo_line output ~prefix text p (t+1-p) ; echo_lines output text (t+1) q ; end (* -------------------------------------------------------------------------- *) (* --- Echo Event --- *) (* -------------------------------------------------------------------------- *) let add_source buffer = function | None -> () | Some src -> begin Buffer.add_string buffer (Filepath.Normalized.to_pretty_string src.Filepath.pos_path); Buffer.add_string buffer ":" ; Buffer.add_string buffer (string_of_int src.Filepath.pos_lnum); Buffer.add_string buffer ": " ; end let add_category buffer = function | None -> () | Some a -> Buffer.add_char buffer ':' ; Buffer.add_string buffer a let add_kind buffer = function | Result | Feedback | Debug -> () | Error -> Buffer.add_string buffer "User Error: " | Warning -> Buffer.add_string buffer "Warning: " | Failure -> Buffer.add_string buffer "Failure: " let echo_event evt terminal = begin term_clean terminal ; let buffer = Buffer.create 120 in Buffer.add_char buffer '[' ; Buffer.add_string buffer evt.evt_plugin ; add_category buffer evt.evt_category ; Buffer.add_string buffer "] " ; add_source buffer evt.evt_source ; add_kind buffer evt.evt_kind ; let prefix = Buffer.contents buffer in let header = String.length prefix in let text = evt.evt_message in let size = String.length text in let output = terminal.output in output prefix 0 header ; if header + size <= 80 && is_single_line text then begin output text 0 size ; echo_newline output ; end else begin let prefix = is_prefixed_event evt in if not prefix then echo_newline output ; echo_lines output ~prefix text 0 (String.length text - 1) ; end ; terminal.flush () ; end let do_echo terminal evt = if delayed_echo terminal then terminal.delayed <- echo_event evt :: terminal.delayed else echo_event evt terminal let do_transient terminal text p q = if p <= q && not (delayed_echo terminal) then begin term_clean terminal ; echo_firstline terminal.output text p q 80 ; if terminal.isatty then terminal.clean <- false else terminal.output "\n" 0 1 ; terminal.flush () ; end (* -------------------------------------------------------------------------- *) (* --- Source --- *) (* -------------------------------------------------------------------------- *) let source ~file ~line = Filepath.{ pos_path = file ; pos_lnum = line ; pos_bol = 0 ; pos_cnum = 0 } let current_loc = ref (fun () -> raise Not_found) let set_current_source fpos = current_loc := fpos let get_current_source () = !current_loc () let get_source current = function | None -> if current then Some (!current_loc ()) else None | Some _ as s -> s (* -------------------------------------------------------------------------- *) (* --- Channels --- *) (* -------------------------------------------------------------------------- *) type emitter = { mutable listeners : (event -> unit) list ; mutable echo : bool ; } type ontty = [ | `Message (* Normal message (default) *) | `Feedback (* Temporary visible on console, normal message otherwise *) | `Transient (* Temporary visible, only on console *) | `Silent (* Not visible on console *) ] let tty = ref (fun () -> false) type channel = { locked_buffer : Rich_text.buffer ; (* already allocated top-level buffer *) mutable stack : int ; (* number of 'stacked' buffers *) plugin : string ; emitters : emitter array ; terminal : terminal ; } type channelstate = | NotCreatedYet of emitter array | Created of channel let nth_kind = function | Result -> 0 | Feedback -> 1 | Debug -> 2 | Error -> 3 | Warning -> 4 | Failure -> 5 let all_kinds = [| Result ; Feedback ; Debug ; Error ; Warning ; Failure |] let () = Array.iteri (fun i k -> assert (i == nth_kind k)) all_kinds (* -------------------------------------------------------------------------- *) (* --- Channels --- *) (* -------------------------------------------------------------------------- *) let all_channels : (string,channelstate) Hashtbl.t = Hashtbl.create 31 let default_emitters = Array.map (fun _ -> { listeners=[] ; echo=true }) all_kinds let new_emitters () = Array.map (fun e -> { listeners = e.listeners ; echo = e.echo }) default_emitters let get_emitters plugin = try match Hashtbl.find all_channels plugin with | NotCreatedYet e -> e | Created c -> c.emitters with Not_found -> let e = new_emitters () in Hashtbl.replace all_channels plugin (NotCreatedYet e) ; e let new_channel plugin = let create_with_emitters plugin emitters = let c = { plugin = plugin ; stack = 0 ; locked_buffer = Rich_text.create () ; emitters = emitters ; terminal = stdout ; } in Hashtbl.replace all_channels plugin (Created c) ; c in try match Hashtbl.find all_channels plugin with | Created c -> c | NotCreatedYet ems -> create_with_emitters plugin ems with Not_found -> let ems = new_emitters () in create_with_emitters plugin ems (* -------------------------------------------------------------------------- *) (* --- Already emitted messages --- *) (* -------------------------------------------------------------------------- *) let check_not_yet = ref (fun _evt -> false) (* -------------------------------------------------------------------------- *) (* --- Listeners --- *) (* -------------------------------------------------------------------------- *) let do_fire e f = f e let iter_kind ?kind f ems = match kind with | None -> Array.iter f ems | Some ks -> List.iter (fun k -> f ems.(nth_kind k)) ks let iter_plugin ?plugin ?kind f = match plugin with | None -> Hashtbl.iter (fun _ s -> match s with | Created c -> iter_kind ?kind f c.emitters | NotCreatedYet ems -> iter_kind ?kind f ems) all_channels ; iter_kind ?kind f default_emitters | Some p -> iter_kind ?kind f (get_emitters p) let add_listener ?plugin ?kind demon = iter_plugin ?plugin ?kind (fun em -> em.listeners <- em.listeners @ [demon]) let set_echo ?plugin ?kind echo = iter_plugin ?plugin ?kind (fun em -> em.echo <- echo) let notify e = let es = get_emitters e.evt_plugin in List.iter (fun f -> f e) es.(nth_kind e.evt_kind).listeners (* -------------------------------------------------------------------------- *) (* --- Generic Log Routine --- *) (* -------------------------------------------------------------------------- *) let open_buffer c = if c.stack > 0 then ( c.stack <- succ c.stack ; Rich_text.create () ) else ( c.stack <- 1 ; c.locked_buffer ) let close_buffer c = if c.stack > 1 then c.stack <- pred c.stack else Rich_text.shrink c.locked_buffer let logtransient channel text = let buffer = open_buffer channel in Rich_text.kprintf (fun fmt -> try Format.pp_print_newline fmt () ; Format.pp_print_flush fmt () ; let p,q = Rich_text.trim buffer in do_transient channel.terminal (Rich_text.contents buffer) p q ; close_buffer channel with e -> close_buffer channel ; raise e ) buffer text let logwithfinal finally channel ?(fire=true) (* fire channel listeners *) ?emitwith (* additional emitter *) ?(once=false) (* log and emit only once *) ?(echo=true) (* echo on terminal *) ?(current=false) (* use current source as default *) ?source (* source location *) ?(kind=Feedback) (* message kind *) ?category (* message category *) ?append (* additional text *) text = let buffer = open_buffer channel in Format.pp_open_vbox (Rich_text.formatter buffer) 0 ; Rich_text.kprintf (fun fmt -> try (match append with None -> () | Some k -> k fmt) ; Format.pp_close_box fmt () ; Format.pp_print_newline fmt () ; Format.pp_print_flush fmt () ; let p,q = Rich_text.trim buffer in let output = if p <= q then let source = get_source current source in let message = Rich_text.range buffer p q in let event = { evt_kind = kind ; evt_plugin = channel.plugin ; evt_category = category ; evt_message = message ; evt_source = source ; } in if not once || !check_not_yet event then begin let e = channel.emitters.(nth_kind kind) in if echo && e.echo then do_echo channel.terminal event ; Extlib.may (do_fire event) emitwith; if fire then List.iter (do_fire event) e.listeners ; Some event end else None else None in close_buffer channel ; finally output with e -> close_buffer channel ; raise e ) buffer text let finally_unit _ = () let finally_raise e _ = raise e let finally_false _ = false let cmdline_error_occurred = Extlib.mk_fun "Log.cmdline_error_occurred" let cmdline_at_error_exit = Extlib.mk_fun "Log.at_error_exit" type deferred_exn = | DNo_exn | DWarn_as_error of event | DError of event | DFatal of event let deferred_exn = ref DNo_exn let unreported_error = "##unreported-error##" let unreported_event { evt_category } = match evt_category with | None -> false | Some s -> s = unreported_error (* we keep track of at most one deferred exception, ordered by seriousness (internal error > user error > warning-as-error). the rationale is that an internal error might cause subsequent errors or warning, but the reverse is not true: an deferred user error must not lead to an internal error. Should that ever happen, at the very least the code should be modified to directly [abort] instead of merely logging an [error]. *) let update_deferred_exn exn = match !deferred_exn, exn with | DNo_exn, _ -> deferred_exn := exn | DWarn_as_error _, DWarn_as_error _ -> () | DWarn_as_error _, _ -> deferred_exn := exn | DError _, (DNo_exn | DWarn_as_error _ | DError _) -> () | DError _, DFatal _ -> deferred_exn := exn | DFatal _, _ -> () let warn_event_as_error event = update_deferred_exn (DWarn_as_error event) let deferred_raise ~fatal ~unreported event msg = let channel = new_channel event.evt_plugin in let append = if unreported then None else Some (fun fmt -> Format.fprintf fmt " See above messages for more information.@\n") in let exn = if fatal then AbortFatal event.evt_plugin else AbortError event.evt_plugin in let finally = finally_raise exn in logwithfinal finally channel ?append ~kind:event.evt_kind msg let treat_deferred_error () = match !deferred_exn with | DNo_exn -> () | DWarn_as_error event -> let unreported = unreported_event event in let wkey = match event.evt_category with | None -> "" | Some s when s = unreported_error -> "" | Some s -> s in deferred_raise ~fatal:false ~unreported event "warning %s treated as deferred error." wkey | DError event -> let unreported = unreported_event event in deferred_raise ~fatal:false ~unreported event "Deferred error message was emitted during execution." | DFatal event -> let unreported = unreported_event event in deferred_raise ~fatal:true ~unreported event "Deferred internal error message was emitted during execution." (* -------------------------------------------------------------------------- *) (* --- Messages Interface --- *) (* -------------------------------------------------------------------------- *) type 'a pretty_printer = ?current:bool -> ?source:Filepath.position -> ?emitwith:(event -> unit) -> ?echo:bool -> ?once:bool -> ?append:(Format.formatter -> unit) -> ('a,formatter,unit) format -> 'a type ('a,'b) pretty_aborter = ?current:bool -> ?source:Filepath.position -> ?echo:bool -> ?append:(Format.formatter -> unit) -> ('a,formatter,unit,'b) format4 -> 'a let log_channel channel ?(kind=Result) ?current ?source ?emitwith ?echo ?once ?append text = logwithfinal finally_unit channel ?once ?echo ?emitwith ?current ?source ~kind ?append text let echo e = try match Hashtbl.find all_channels e.evt_plugin with | NotCreatedYet _ -> raise Not_found | Created c -> do_echo c.terminal e with Not_found -> let msg = Format.sprintf "[unknown channel %s]:%s" e.evt_plugin e.evt_message in failwith msg (* ------------------------------------------------------------------------- *) (* --- Plug-in Interface --- *) (* ------------------------------------------------------------------------- *) module Category_trie = struct (* No Datatype at this level for dependencies reasons *) module String_map = Map.Make(String) type 'a t = | Node of 'a option * 'a t String_map.t let empty = Node (None, String_map.empty) let rec add_structure l t = match l with | [] -> t | x :: l -> let Node (info, map) = t in let binding = try String_map.find x map with Not_found -> Node (info, String_map.empty) in let res = add_structure l binding in Node (info, String_map.add x res map) let rec add_info l ?merge info (Node (old_info, map)) = match l with | [] -> let rec aux map = String_map.map (function Node(old_info, map) -> let new_info = match old_info, merge with | None, _ | _, None -> Some info | Some old_info, Some merge -> Some (merge old_info info) in Node (new_info, aux map)) map in Node (Some info, aux map) | x :: l -> let binding = String_map.find x map in let res = add_info l info binding in Node (old_info, String_map.add x res map) let rec get l (Node(info, map)) = match l with | [] -> info | x :: l -> let binding = String_map.find x map in get l binding let fold f map acc = let rec aux suf (Node(info, map)) acc = let acc = f (List.rev suf) info acc in String_map.fold (fun s t acc -> aux (s::suf) t acc) map acc in aux [] map acc let suffixes l trie = let rec aux res suf l (Node(_,map)) = match l with | [] -> let res = (List.rev suf) :: res in String_map.fold (fun s t res -> aux res (s::suf) [] t) map res | x::l -> let t = String_map.find x map in aux res (x::suf) l t in (* Provide results in lexicographic order. *) List.rev (aux [] [] l trie) end let rec split_joker = function | [] -> [] | ["*"] -> [] | ""::w -> split_joker w | a::w -> a::split_joker w let split_category s = split_joker (String.split_on_char ':' s) let evt_category = function | { evt_category = None } -> [] | { evt_category = Some s } -> split_category s (* a is a sub-category of b *) let rec is_subcategory a b = match a,b with | _,[] -> true | [],_ -> false | a1::aw , b1::bw -> a1 = b1 && is_subcategory aw bw let merge_category l = match l with | [] -> "*" | [ s ] -> s | hd :: tl -> let b = Buffer.create 15 in Buffer.add_string b hd; List.iter (fun s -> Buffer.add_char b ':'; Buffer.add_string b s) tl; Buffer.contents b type warn_status = | Winactive | Wfeedback_once | Wfeedback | Wonce | Wactive | Werror_once | Werror | Wabort let pp_warn_status fmt s = let s = match s with | Winactive -> "inactive" | Wfeedback_once -> "feedback,once" | Wfeedback -> "feedback" | Wonce -> "once" | Wactive -> "active" | Werror_once -> "error,once" | Werror -> "error" | Wabort -> "abort" in Format.pp_print_string fmt s let merge_status old_status new_status = match old_status, new_status with | Winactive, Wactive -> Wactive | Winactive, Wonce -> Wonce | Winactive, _ -> Winactive | _ -> new_status module type Messages = sig type category type warn_category val verbose_atleast: int -> bool val debug_atleast: int -> bool val printf : ?level:int -> ?dkey:category -> ?current:bool -> ?source:Filepath.position -> ?append:(Format.formatter -> unit) -> ?header:(Format.formatter -> unit) -> ('a,formatter,unit) format -> 'a val result : ?level:int -> ?dkey:category -> 'a pretty_printer val feedback: ?ontty:ontty -> ?level:int -> ?dkey:category -> 'a pretty_printer val debug : ?level:int -> ?dkey:category -> 'a pretty_printer val warning : ?wkey: warn_category -> 'a pretty_printer val error : 'a pretty_printer val abort : ('a,'b) pretty_aborter val failure : 'a pretty_printer val fatal : ('a,'b) pretty_aborter val verify : bool -> ('a,bool) pretty_aborter val not_yet_implemented : ('a,formatter,unit,'b) format4 -> 'a val deprecated : string -> now:string -> ('a -> 'b) -> 'a -> 'b val with_result : (event option -> 'b) -> ('a,'b) pretty_aborter val with_warning : (event option -> 'b) -> ('a,'b) pretty_aborter val with_error : (event option -> 'b) -> ('a,'b) pretty_aborter val with_failure : (event option -> 'b) -> ('a,'b) pretty_aborter val log : ?kind:kind -> ?verbose:int -> ?debug:int -> 'a pretty_printer val logwith : (event option -> 'b) -> ?wkey: warn_category -> ?emitwith:(event -> unit) -> ?once:bool -> ('a,'b) pretty_aborter val register : kind -> (event -> unit) -> unit (** Very local listener. *) val register_tag_handlers : (string -> string) * (string -> string) -> unit val register_category: string -> category val pp_category: Format.formatter -> category -> unit val dkey_name: category -> string val is_registered_category: string -> bool val get_category: string -> category option val get_all_categories: unit -> category list val add_debug_keys: category -> unit val del_debug_keys: category -> unit val get_debug_keys: unit -> category list val is_debug_key_enabled: category -> bool val get_debug_keyset : unit -> category list val register_warn_category: string -> warn_category val is_warn_category: string -> bool val pp_warn_category: Format.formatter -> warn_category -> unit val pp_all_warn_categories_status: unit -> unit val wkey_name: warn_category -> string val get_warn_category: string -> warn_category option val get_all_warn_categories: unit -> warn_category list val get_all_warn_categories_status: unit -> (warn_category * warn_status) list val set_warn_status: warn_category -> warn_status -> unit val get_warn_status: warn_category -> warn_status end module Register (P : sig val channel : string val label : string val verbose_atleast : int -> bool val debug_atleast : int -> bool end) = struct include P type category = string type warn_category = string let categories = ref Category_trie.empty let register_category (s:string) = let res: category = s in let l = split_category s in categories := Category_trie.add_structure l !categories; res let pp_category fmt (cat: category) = Format.pp_print_string fmt cat let get_all_categories () = List.map merge_category (Category_trie.suffixes [] !categories) let is_registered_category s = List.mem (split_category s) (Category_trie.suffixes [] !categories) let get_category s = if is_registered_category s then Some s else None let not_registered s = failwith (s ^ " is not a registered category for " ^ label) let dkey_name s = s let wkey_name s = s let add_debug_keys s = try categories := Category_trie.add_info (split_category s) true !categories with Not_found -> not_registered s let del_debug_keys s = try categories := Category_trie.add_info (split_category s) false !categories with Not_found -> not_registered s let get_debug_keys () = let f cat info acc = match info with | None | Some false -> acc | Some true -> (merge_category cat) :: acc in Category_trie.fold f !categories [] let is_debug_key_enabled (c:category) = let s = (c:>string) in match Category_trie.get (split_category s) !categories with | None -> false | Some flag -> flag | exception Not_found -> not_registered s let has_debug_key = function | None -> true (* No key means to be displayed each time *) | Some c -> is_debug_key_enabled c let warn_categories = ref Category_trie.empty let register_warn_category s = warn_categories := Category_trie.add_structure (split_category s) !warn_categories; s let get_all_warn_categories () = List.map merge_category (Category_trie.suffixes [] !warn_categories) let get_all_warn_categories_status () = List.rev (Category_trie.fold (fun cat status l -> (merge_category cat, Extlib.opt_conv Wactive status) :: l) !warn_categories []) let is_warn_category s = List.mem (split_category s) (Category_trie.suffixes [] !warn_categories) let pp_warn_category fmt s = Format.pp_print_string fmt s let get_warn_category s = if is_warn_category s then Some s else None let wnot_registered s = failwith (s ^ " is not a registered warning category for " ^ label) let set_warn_status s status = try warn_categories := Category_trie.add_info (split_category s) ~merge:merge_status status !warn_categories with Not_found -> wnot_registered s let get_warn_status s = match Category_trie.get (split_category s) !warn_categories with | Some s -> s | None -> Wactive | exception Not_found -> wnot_registered s let channel = new_channel P.channel let internal_register_tag_handlers _c (_ope,_close) = () (* BM->LOIC: I need to keep this code around to be able to handle marks and tags correctly. Do you think we can emulate all other features of Log but without using c.buffer at all? Everything but ensure_unique_newline seems feasible. See Design.make_slash to see a useful example. let start_of_line= Printf.sprintf "\n[%s] " P.label in let length= pred (String.length start_of_line) in Format.pp_set_all_formatter_output_functions c.formatter ~out:c.term.output ~flush:c.term.flush ~newline:(fun () -> c.term.output start_of_line 0 length) ~spaces:(fun _ -> ()(*TODO:correct margin*)) ; Format.pp_set_tags c.formatter true; Format.pp_set_mark_tags c.formatter true; Format.pp_set_print_tags c.formatter false; Format.pp_set_formatter_tag_functions c.formatter {(Format.pp_get_formatter_tag_functions c.formatter ()) with Format.mark_open_tag = ope; mark_close_tag = close} *) let register_tag_handlers h = internal_register_tag_handlers channel h let to_be_log verbose debug = match verbose , debug with | 0 , 0 -> verbose_atleast 1 | v , 0 -> verbose_atleast v | 0 , d -> debug_atleast d | v , d -> verbose_atleast v || debug_atleast d let log ?(kind=Result) ?(verbose=0) ?(debug=0) ?current ?source ?emitwith ?echo ?once ?append text = if to_be_log verbose debug then logwithfinal finally_unit channel ?once ?echo ?emitwith ?current ?source ~kind ?append text else Pretty_utils.nullprintf text let result ?(level=1) ?dkey ?current ?source ?emitwith ?echo ?once ?append text = if verbose_atleast level && has_debug_key dkey then logwithfinal finally_unit channel ?once ?echo ?emitwith ?current ?source ~kind:Result ?category:dkey ?append text else Pretty_utils.nullprintf text let transient channel = channel.terminal.isatty && !tty () let feedback ?(ontty=`Message) ?(level=1) ?dkey ?current ?source ?emitwith ?echo ?once ?append text = let mode = if verbose_atleast level && has_debug_key dkey then match ontty with | `Feedback -> if transient channel then `Transient else `Message | `Transient -> if transient channel then `Transient else `Silent | `Silent -> if transient channel then `Silent else `Message | `Message -> `Message else `Silent in match mode with | `Message -> logwithfinal finally_unit channel ?once ?echo ?emitwith ?current ?source ~kind:Feedback ?category:dkey ?append text | `Transient -> logtransient channel text | `Silent -> Pretty_utils.nullprintf text let should_output_debug level dkey = match level, dkey with | None, None -> debug_atleast 1 | Some l, None -> debug_atleast l | None, Some _ -> has_debug_key dkey | Some l, Some _ -> debug_atleast l && has_debug_key dkey let debug ?level ?dkey ?current ?source ?emitwith ?echo ?once ?append text = if should_output_debug level dkey then logwithfinal finally_unit channel ?once ?echo ?emitwith ?current ?source ~kind:Debug ?category:dkey ?append text else Pretty_utils.nullprintf text let force_error = function | None -> { evt_kind = Failure; evt_plugin = channel.plugin; evt_category = Some unreported_error; evt_message = "Silent error"; evt_source = None } | Some evt -> evt let finally_user_error evt = let evt = force_error evt in update_deferred_exn (DError evt) let finally_internal_error evt = let evt = force_error evt in update_deferred_exn (DFatal evt) let error ?current ?source ?emitwith ?echo ?once ?append text = logwithfinal finally_user_error channel ?once ?echo ?emitwith ?current ?source ~kind:Error ?append text let abort ?current ?source ?echo ?append text = logwithfinal (finally_raise (AbortError P.channel)) channel ?echo ?current ?source ~kind:Error ?append text let failure ?current ?source ?emitwith ?echo ?once ?append text = logwithfinal finally_internal_error channel ?once ?echo ?emitwith ?current ?source ~kind:Failure ?append text let fatal ?current ?source ?echo ?append text = logwithfinal (finally_raise (AbortFatal P.channel)) channel ?echo ?current ?source ~kind:Failure ?append text let verify assertion ?current ?source ?echo ?append text = if assertion then Format.kfprintf (fun _ -> true) Pretty_utils.null text else logwithfinal finally_false channel ?echo ?current ?source ~kind:Failure ?append text let logwith finally ?(wkey="") ?emitwith ?once ?current ?source ?echo ?append text = let status = get_warn_status wkey in if status <> Winactive then begin let action, once_suffix = match status with | Wabort -> Some (fun _ -> abort "warning %s treated as fatal error." wkey), "" | Werror -> Some warn_event_as_error, "" | Werror_once -> Some (fun evt -> warn_event_as_error evt; set_warn_status wkey Winactive), "warn-error-once" | Wfeedback_once -> Some (fun _ -> set_warn_status wkey Winactive), "warn-feedback-once" | Wonce -> Some (fun _ -> set_warn_status wkey Winactive), "warn-once" | Wactive | Winactive | Wfeedback -> None, "" in let emitwith = match emitwith, action with | None, None -> None | Some e, None | None, Some e -> Some e | Some e1, Some e2 -> Some (fun evt -> e1 evt; e2 evt) in let kind = match status with | Wfeedback | Wfeedback_once -> Feedback | (Wactive | Werror | Wabort | Wonce | Werror_once | Winactive) -> Warning in let category = if wkey = "" then None else Some wkey in let append_once_suffix = (fun fmt -> Format.fprintf fmt "@.(%s: no further messages from category '%s' will be emitted)" once_suffix wkey) in let append = if once_suffix = "" then append else match append with | None -> Some append_once_suffix | Some app -> Some (fun fmt -> app fmt; append_once_suffix fmt) in logwithfinal finally channel ?once ?echo ?emitwith ?current ?source ~kind ?category ?append text end else Pretty_utils.with_null (fun () -> finally None) text let warning ?wkey ?current ?source ?emitwith ?echo ?once ?append text = logwith finally_unit ?wkey ?current ?source ?emitwith ?echo ?once ?append text let with_result finally ?current ?source ?echo ?append text = logwithfinal finally channel ~kind:Result ?current ?source ?echo ?append text let with_warning finally ?current ?source ?echo ?append text = logwithfinal finally channel ~kind:Warning ?current ?source ?echo ?append text let with_error finally ?current ?source ?echo ?append text = logwithfinal finally channel ~kind:Error ?current ?source ?echo ?append text let with_failure finally ?current ?source ?echo ?append text = logwithfinal finally channel ~kind:Failure ?current ?source ?echo ?append text let register kd f = let em = channel.emitters.(nth_kind kd) in em.listeners <- em.listeners @ [f] let not_yet_implemented text = let buffer = Buffer.create 80 in let finally fmt = Format.pp_print_flush fmt (); let msg = Buffer.contents buffer in raise (FeatureRequest(channel.plugin,msg)) in let fmt = Format.formatter_of_buffer buffer in Format.kfprintf finally fmt text let deprecated name ~now f x = warning ~once:true "call to deprecated function '%s'.\nShould use '%s' instead." name now ; f x let get_debug_keyset = deprecated "Log.get_debug_key_set" ~now:"Log.get_all_categories" (fun () -> get_all_categories ()) let noprint _fmt = () let spynewline bol output buffer start length = begin let ofs = start+length-1 in if 0 <= ofs && ofs < String.length buffer then bol := buffer.[ofs] = '\n' ; output buffer start length end let printf ?(level=1) ?dkey ?current ?source ?(append=noprint) ?header text = if verbose_atleast level && has_debug_key dkey then begin (* Header is a regular message *) let header = match header with None -> noprint | Some h -> h in logwithfinal finally_unit channel ~kind:Result ~fire:false ?current ?source ?category:dkey "%t" header ; let bol = ref true in let stdout = { stdout with output = spynewline bol stdout.output } in let fmt = delayed_terminal stdout in try Format.kfprintf begin fun fmt -> append fmt ; Format.pp_print_flush fmt () ; unlock_terminal stdout fmt ; if not !bol then Format.pp_print_newline fmt () ; end fmt text with error -> unlock_terminal stdout fmt ; raise error end else Pretty_utils.nullprintf text let pp_all_warn_categories_status () = let l = get_all_warn_categories_status () in let max = List.fold_left (fun m (s,_) -> max m (String.length s)) 0 l in let print_one_elt fmt (cat, status) = Format.fprintf fmt "%-*s : %a" max cat pp_warn_status status in feedback "@[Warning categories for %s are@;%a@]" label Format.(pp_print_list ~pp_sep:pp_print_cut print_one_elt) l end (* Deprecated -- backward compatibity only. *) let null = Pretty_utils.null let with_null = Pretty_utils.with_null let nullprintf = Pretty_utils.nullprintf (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/log.mli0000666000000000000000000005036113571573400022571 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Logging Services for Frama-C Kernel and Plugins. @since Beryllium-20090601-beta1 *) open Format type kind = Result | Feedback | Debug | Warning | Error | Failure (** @since Beryllium-20090601-beta1 *) type event = { evt_kind : kind ; evt_plugin : string ; evt_category : string option ; (** message or warning category *) evt_source : Filepath.position option ; evt_message : string ; } (** @since Beryllium-20090601-beta1 *) type 'a pretty_printer = ?current:bool -> ?source:Filepath.position -> ?emitwith:(event -> unit) -> ?echo:bool -> ?once:bool -> ?append:(Format.formatter -> unit) -> ('a,formatter,unit) format -> 'a (** Generic type for the various logging channels which are not aborting Frama-C. - When [current] is [false] (default for most of the channels), no location is output. When it is [true], the last registered location is used as current (see {!Cil_const.CurrentLoc}). - [source] is the location to be output. If nil, [current] is used to determine if a location should be output - [emitwith] function which is called each time an event is processed - [echo] is [true] if the event should be output somewhere in addition to [stdout] - [append] adds some actions performed on the formatter after the event has been processed. @since Beryllium-20090601-beta1 *) type ('a,'b) pretty_aborter = ?current:bool -> ?source:Filepath.position -> ?echo:bool -> ?append:(Format.formatter -> unit) -> ('a,formatter,unit,'b) format4 -> 'a (** @since Beryllium-20090601-beta1 Same as {!Log.pretty_printer} except that channels having this type denote a fatal error aborting Frama-C. *) (* -------------------------------------------------------------------------- *) (** {2 Exception Registry} @plugin development guide @since Beryllium-20090601-beta1 *) (* -------------------------------------------------------------------------- *) exception AbortError of string (** User error that prevents a plugin to terminate. Argument is the name of the plugin. @since Beryllium-20090601-beta1 *) exception AbortFatal of string (** Internal error that prevents a plugin to terminate. Argument is the name of the plugin. @since Beryllium-20090601-beta1 *) exception FeatureRequest of string * string (** Raised by [not_yet_implemented]. You may catch [FeatureRequest(p,r)] to support degenerated behavior. The responsible plugin is 'p' and the feature request is 'r'. *) (* -------------------------------------------------------------------------- *) (** {2 Option_signature.Interface} @since Beryllium-20090601-beta1 *) (* -------------------------------------------------------------------------- *) type ontty = [ | `Message (** Normal message (default) *) | `Feedback (** Temporary visible on console, normal message otherwise *) | `Transient (** Temporary visible, only on console *) | `Silent (** Not visible on console *) ] (** status of a warning category @since Chlorine-20180501 *) type warn_status = | Winactive (** nothing is emitted. *) | Wfeedback_once (** combines feedback and once. *) | Wfeedback (** emit a feedback message. *) | Wonce (** emit a warning message, but only the first time the category is encountered. *) | Wactive (** emit a warning message. *) | Werror_once (** combines once and error. *) | Werror (** emit a message. Execution continues, but exit status will not be 0 *) | Wabort (** emit a message and abort execution *) (** @since Beryllium-20090601-beta1 @plugin development guide *) module type Messages = sig type category (** category for debugging/verbose messages. Must be registered before any use. Each column in the string defines a sub-category, e.g. a:b:c defines a subcategory c of b, which is itself a subcategory of a. Enabling a category (via -plugin-msg-category) will enable all its subcategories. @since Fluorine-20130401 @modify Chlorine-20180501 categories are an abstract type of each plug-in *) type warn_category (** Same as above, but for warnings @since Chlorine-20180501 *) val verbose_atleast : int -> bool (** @since Beryllium-20090601-beta1 *) val debug_atleast : int -> bool (** @since Beryllium-20090601-beta1 *) val printf : ?level:int -> ?dkey:category -> ?current:bool -> ?source:Filepath.position -> ?append:(Format.formatter -> unit) -> ?header:(Format.formatter -> unit) -> ('a,formatter,unit) format -> 'a (** Outputs the formatted message on [stdout]. Levels and key-categories are taken into account like event messages. The header formatted message is emitted as a regular [result] message. *) val result : ?level:int -> ?dkey:category -> 'a pretty_printer (** Results of analysis. Default level is 1. @since Beryllium-20090601-beta1 @plugin development guide *) val feedback : ?ontty:ontty -> ?level:int -> ?dkey:category -> 'a pretty_printer (** Progress and feedback. Level is tested against the verbosity level. @since Beryllium-20090601-beta1 @modify Fluorine-20130401 Optional parameter [?dkey] @modify Magnesium-20151001 Optional parameter [?ontty] @plugin development guide *) val debug : ?level:int -> ?dkey:category -> 'a pretty_printer (** Debugging information dedicated to Plugin developers. Default level is 1. The debugging key is used in message headers. See also [set_debug_keys] and [set_debug_keyset]. @since Beryllium-20090601-beta1 @modify Nitrogen-20111001 Optional parameter [dkey] @plugin development guide *) val warning : ?wkey:warn_category -> 'a pretty_printer (** Hypothesis and restrictions. @since Beryllium-20090601-beta1 @plugin development guide *) val error : 'a pretty_printer (** user error: syntax/typing error, bad expected input, etc. @since Beryllium-20090601-beta1 @plugin development guide *) val abort : ('a,'b) pretty_aborter (** user error stopping the plugin. @raise AbortError with the channel name. @since Beryllium-20090601-beta1 @plugin development guide *) val failure : 'a pretty_printer (** internal error of the plug-in. @plugin development guide *) val fatal : ('a,'b) pretty_aborter (** internal error of the plug-in. @raise AbortFatal with the channel name. @since Beryllium-20090601-beta1 @plugin development guide *) val verify : bool -> ('a,bool) pretty_aborter (** If the first argument is [true], return [true] and do nothing else, otherwise, send the message on the {i fatal} channel and return [false]. The intended usage is: [assert (verify e "Bla...") ;]. @since Beryllium-20090601-beta1 @plugin development guide *) val not_yet_implemented : ('a,formatter,unit,'b) format4 -> 'a (** raises [FeatureRequest] but {i does not} send any message. If the exception is not caught, Frama-C displays a feature-request message to the user. @since Beryllium-20090901 *) val deprecated: string -> now:string -> ('a -> 'b) -> ('a -> 'b) (** [deprecated s ~now f] indicates that the use of [f] of name [s] is now deprecated. It should be replaced by [now]. @return the given function itself @since Lithium-20081201 in Extlib @since Beryllium-20090902 *) val with_result : (event option -> 'b) -> ('a,'b) pretty_aborter (** [with_result f fmt] calls [f] in the same condition as [logwith]. @since Beryllium-20090601-beta1 @modified 18.0-Argon the argument of the continuation is optionnal *) val with_warning : (event option -> 'b) -> ('a,'b) pretty_aborter (** [with_warning f fmt] calls [f] in the same condition as [logwith]. @since Beryllium-20090601-beta1 @modified 18.0-Argon the argument of the continuation is optionnal *) val with_error : (event option -> 'b) -> ('a,'b) pretty_aborter (** [with_error f fmt] calls [f] in the same condition as [logwith]. @since Beryllium-20090601-beta1 @modified 18.0-Argon the argument of the continuation is optionnal *) val with_failure : (event option -> 'b) -> ('a,'b) pretty_aborter (** [with_failure f fmt] calls [f] in the same condition as [logwith]. @since Beryllium-20090601-beta1 @modified 18.0-Argon the argument of the continuation is optionnal *) val log : ?kind:kind -> ?verbose:int -> ?debug:int -> 'a pretty_printer (** Generic log routine. The default kind is [Result]. Use cases (with [n,m > 0]): - [log ~verbose:n]: emit the message only when verbosity level is at least [n]. - [log ~debug:n]: emit the message only when debugging level is at least [n]. - [log ~verbose:n ~debug:m]: any debugging or verbosity level is sufficient. @since Beryllium-20090901 @plugin development guide *) val logwith : (event option -> 'b) -> ?wkey:warn_category -> ?emitwith:(event -> unit) -> ?once:bool -> ('a,'b) pretty_aborter (** Recommanded generic log routine using [warn_category] instead of [kind]. [logwith continuation ?wkey fmt] similar to [warning ?wkey fmt] and then calling the [continuation]. The optional continuation argument refers to the corresponding event. [None] is used iff no message is logged. In case the [wkey] is considered as a [Failure], the continution is not called. This kind of message denotes a fatal error aborting Frama-C. Notice that the [~emitwith] action is called iff a message is logged. @since 18.0-Argon *) val register : kind -> (event -> unit) -> unit (** Local registry for listeners. *) val register_tag_handlers : (string -> string) * (string -> string) -> unit (** {3 Category management} *) val register_category: string -> category (** register a new debugging/verbose category. Note: categories must be added (e.g. via [add_debug_keys]) after registration. @since Fluorine-20130401 *) val pp_category: Format.formatter -> category -> unit (** pretty-prints a category. @since Chlorine-20180501 *) val dkey_name: category -> string (** returns the category name as a string. @since 18.0-Argon *) val is_registered_category: string -> bool (** true iff the string corresponds to a registered category @since Chlorine-20180501 *) val get_category: string -> category option (** returns the corresponding registered category or [None] if no such category exists. @since Fluorine-20130401 @modify Chlorine-20180501 return an option *) val get_all_categories: unit -> category list (** returns all registered categories. *) val add_debug_keys : category -> unit (** adds categories corresponding to string (including potential subcategories) to the set of categories for which messages are to be displayed. The string must have been registered beforehand. @since Fluorine-20130401 use categories instead of plain string @modify Chlorine-20180501 accepts a string as argument. Takes care of propagating to subcategories. *) val del_debug_keys: category -> unit (** removes the given categories from the set for which messages are printed. The string must have been registered beforehand. @since Fluorine-20130401 @modify Chlorine-20180501 accepts a string category as argument, takes care of propagating to subcategories *) val get_debug_keys: unit -> category list (** Returns currently active keys @since Fluorine-20130401 @modify Chlorine-20180501 returns a list instead of a set *) val is_debug_key_enabled: category -> bool (** Returns [true] if the given category is currently active @since Fluorine-20130401 *) val get_debug_keyset : unit -> category list (** Returns currently active keys @since Nitrogen-20111001 @deprecated Fluorine-20130401 use get_debug_keys instead *) val register_warn_category: string -> warn_category val is_warn_category: string -> bool val pp_warn_category: Format.formatter -> warn_category -> unit val pp_all_warn_categories_status: unit -> unit val wkey_name: warn_category -> string (** returns the warning category name as a string. @since 18.0-Argon *) val get_warn_category: string -> warn_category option val get_all_warn_categories: unit -> warn_category list val get_all_warn_categories_status: unit -> (warn_category * warn_status) list val set_warn_status: warn_category -> warn_status -> unit val get_warn_status: warn_category -> warn_status end (** Split an event category into its constituants. @since 18.0-Argon *) val evt_category : event -> string list (** Split a category specification into its constituants. ["*"] is considered as empty, and [""] categories are skipped. @since 18.0-Argon *) val split_category : string -> string list (** Sub-category checks. [is_subcategory a b] checks whether [a] is a sub-category of [b]. Indeed, it checks whether [b] is a prefix of [a], that is, that [a] equals [b] or refines [b] with (a list of) sub-category(ies). @since 18.0-Argon *) val is_subcategory : string list -> string list -> bool (** Each plugin has its own channel to output messages. This functor should not be directly applied by plug-in developer. They should apply {!Plugin.Register} instead. @since Beryllium-20090601-beta1 *) module Register (P : sig val channel : string val label : string val verbose_atleast : int -> bool val debug_atleast : int -> bool end) : Messages (* -------------------------------------------------------------------------- *) (** {2 Echo and Notification} *) (* -------------------------------------------------------------------------- *) val set_echo : ?plugin:string -> ?kind:kind list -> bool -> unit (** Turns echo on or off. Applies to all channel unless specified, and all kind of messages unless specified. @since Beryllium-20090601-beta1 @plugin development guide *) val add_listener : ?plugin:string -> ?kind:kind list -> (event -> unit) -> unit (** Register a hook that is called each time an event is emitted. Applies to all channel unless specified, and all kind of messages unless specified. @since Beryllium-20090601-beta1 @plugin development guide *) val echo : event -> unit (** Display an event of the terminal, unless echo has been turned off. @since Beryllium-20090601-beta1 *) val notify : event -> unit (** Send an event over the associated listeners. @since Beryllium-20090601-beta1 *) (* -------------------------------------------------------------------------- *) (** {2 Channel interface} This is the {i low-level} interface to logging services. Not to be used by casual users. *) (* -------------------------------------------------------------------------- *) type channel (** @since Beryllium-20090601-beta1 *) val new_channel : string -> channel (** @since Beryllium-20090901 @plugin development guide *) val log_channel : channel -> ?kind:kind -> 'a pretty_printer (** logging function to user-created channel. @since Beryllium-20090901 @modify Chlorine-20180501 removed ~prefix @plugin development guide *) val kernel_channel_name: string (** the reserved channel name used by the Frama-C kernel. @since Beryllium-20090601-beta1 *) val kernel_label_name: string (** the reserved label name used by the Frama-C kernel. @since Beryllium-20090601-beta1 *) val source : file:Filepath.Normalized.t -> line:int -> Filepath.position (** @since Chlorine-20180501 @modify 18.0-Argon change type of [file] *) val get_current_source : unit -> Filepath.position (* -------------------------------------------------------------------------- *) (** {2 Terminal interface} This is the {i low-level} interface to logging services. Not to be used by casual users. *) (* -------------------------------------------------------------------------- *) val clean : unit -> unit (** Flushes the last transient message if necessary. *) val null : formatter [@@ deprecated "Use 'Pretty_utils.null' instead"] (** Prints nothing. @since Beryllium-20090901 @deprecated Chlorine-20180501 use {!Pretty_utils} instead. *) val nullprintf : ('a,formatter,unit) format -> 'a [@@ deprecated "Use 'Pretty_utils.nullprintf' instead"] (** Discards the message and returns unit. @since Beryllium-20090901 @deprecated Chlorine-20180501 use {!Pretty_utils} instead. *) val with_null : (unit -> 'b) -> ('a,formatter,unit,'b) format4 -> 'a [@@ deprecated "Use 'Pretty_utils.with_null' instead"] (** Discards the message and call the continuation. @since Beryllium-20090901 @deprecated Chlorine-20180501 use {!Pretty_utils} instead. *) val set_output : ?isatty:bool -> (string -> int -> int -> unit) -> (unit -> unit) -> unit (** This function has the same parameters as Format.make_formatter. @since Beryllium-20090901 @plugin development guide *) val print_on_output : (Format.formatter -> unit) -> unit (** Direct printing on output. Message echo is delayed until the output is finished. Then, the output is flushed and all pending message are echoed. Notification of listeners is not delayed, however. Can not be recursively invoked. @since Beryllium-20090901 @modify Nitrogen-20111001 signature changed @plugin development guide *) val print_delayed : (Format.formatter -> unit) -> unit (** Direct printing on output. Same as [print_on_output], except that message echo is not delayed until text material is actually written. This gives an chance for formatters to emit messages before actual pretty printing. Can not be recursively invoked. @since Beryllium-20090901 @modify Nitrogen-20111001 signature changed @plugin development guide *) (**/**) val set_current_source : (unit -> Filepath.position) -> unit (* Forward reference to the function returning the current location, used when [~current:true] is set on printers. Currently set in {Cil}. Not for the casual user. *) val check_not_yet: (event -> bool) ref (* Checks whether a message been emitted already, in which case it is not reprinted. Currently set in {Messages}. Not for the casual user. *) val tty : (unit -> bool) ref (* Callback for command-line option '-(no)-tty' *) val cmdline_error_occurred: (exn -> unit) ref val cmdline_at_error_exit: ((exn -> unit) -> unit) ref val treat_deferred_error: unit -> unit (* call this function when it is a good time to raise an exception following a delayed error or failure. Currently done: - after each command-line stage. - after each analysis step (as separated by -then and its derivatives), including the last one. *) (**/**) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/plugin.ml0000666000000000000000000006627113571573400023144 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module CamlString = String let empty_string = "" let positive_debug_ref = ref 0 let session_is_set_ref = Extlib.mk_fun "session_is_set_ref" let session_ref = Extlib.mk_fun "session_ref" let config_is_set_ref = Extlib.mk_fun "config_is_set_ref" let config_ref = Extlib.mk_fun "config_ref" (* ************************************************************************* *) (** {2 Signatures} *) (* ************************************************************************* *) module type S_no_log = sig val add_group: ?memo:bool -> string -> Cmdline.Group.t module Help: Parameter_sig.Bool module Verbose: Parameter_sig.Int module Debug: Parameter_sig.Int module Share: Parameter_sig.Specific_dir module Session: Parameter_sig.Specific_dir module Config: Parameter_sig.Specific_dir val help: Cmdline.Group.t val messages: Cmdline.Group.t val add_plugin_output_aliases: string list -> unit end module type S = sig include Log.Messages include S_no_log end module type General_services = sig include S include Parameter_sig.Builder end (* ************************************************************************* *) (** {2 Optional parameters of functors} *) (* ************************************************************************* *) let kernel = ref false let kernel_ongoing = ref false let register_kernel = let used = ref false in fun () -> if !used then invalid_arg "The Frama-C kernel should be registered only once." else begin kernel := true; used := true end let is_kernel () = !kernel let share_visible_ref = ref false let is_share_visible () = share_visible_ref := true let session_visible_ref = ref false let is_session_visible () = session_visible_ref := true let config_visible_ref = ref false let is_config_visible () = config_visible_ref := true let plugin_subpath_ref = ref None let plugin_subpath s = plugin_subpath_ref := Some s let default_msg_keys_ref = ref [] let default_msg_keys l = default_msg_keys_ref := l [@@ deprecated "Manage msg keys with Log interface"] let reset_plugin () = kernel := false; share_visible_ref := false; session_visible_ref := false; config_visible_ref := false; plugin_subpath_ref := None; default_msg_keys_ref := []; ;; (* ************************************************************************* *) (** {2 Generic functors} *) (* ************************************************************************* *) let kernel_name = "kernel" type plugin = { p_name: string; p_shortname: string; p_help: string; p_parameters: (string, Typed_parameter.t list) Hashtbl.t } let plugins: plugin list ref = ref [] let iter_on_plugins f = let cmp p1 p2 = (* the kernel is the smaller plug-in *) match p1.p_name, p2.p_name with | s1, s2 when s1 = kernel_name && s2 = kernel_name -> 0 | s1, _ when s1 = kernel_name -> -1 | _, s2 when s2 = kernel_name -> 1 | s1, s2 -> String.compare s1 s2 in List.iter f (List.sort cmp !plugins) let is_present s = List.exists (fun p -> p.p_shortname = s) !plugins let get_from_name s = List.find (fun p -> p.p_name = s) !plugins let get_from_shortname s = List.find (fun p -> p.p_shortname = s) !plugins let get s = Cmdline.Kernel_log.deprecated "Plugin.get" ~now:"Plugin.get_from_name" get_from_name s [@@ deprecated "Use Plugin.get_from_name"] (* ************************************************************************* *) (** {2 Global data structures} *) (* ************************************************************************* *) (* File formatters used by options [--log]. *) module File_formatters : sig val get : string -> Format.formatter end = struct (* File formatters must be globally defined so that if a new plugin wants to redirect output to an existing file, the same formatter must be used to avoid re-opening file descriptors and erasing data. E.g. in `frama-c -plugin1-log file.txt -then -plugin2-log file.txt`, the formatter avoids Frama-C from opening file.txt a second time, which would truncate its contents. *) let file_formatters : (string, Format.formatter) Hashtbl.t = Hashtbl.create 0 (* Opens and returns a new file formatter if the file has not been opened yet, otherwise returns the existing formatter for the file. *) let get filename = (* Note: normalized paths are not necessarily canonical, so if the command-line arguments are unusual, this may fail to detect two filenames as referring to the same file. *) let normalized_filename = Filepath.normalize filename in try Hashtbl.find file_formatters normalized_filename with | Not_found -> let oc = open_out normalized_filename in let fmt = Format.formatter_of_out_channel oc in Hashtbl.add file_formatters normalized_filename fmt; Extlib.safe_at_exit (fun () -> close_out oc); fmt end (* ************************************************************************* *) (** {2 The functor [Register]} *) (* ************************************************************************* *) module Register (P: sig val name: string (* the name is "" for the kernel *) val shortname: string val help: string end) = struct let verbose_level = ref (fun () -> 1) let debug_level = ref (fun () -> 0) (* unused by the kernel: it uses Cmdline.Kernel_log instead; see module [L] below *) module Plugin_log = Log.Register (struct let channel = P.shortname let label = P.shortname let debug_atleast level = !debug_level () >= level let verbose_atleast level = !verbose_level () >= level end) (* we can't directly make L a Log, since this would require making Plugin.Register a generative functor. Instead, we provide a minimal signature for internal usage. It can be extended as needed, provided L.category is not exported. *) module type Log_skeleton = sig val warning: 'a Log.pretty_printer val abort: ('a, 'b) Log.pretty_aborter val register_and_add: string -> unit val add_or_warn: string -> unit val del_or_warn: string -> unit val set_warn_status: string -> Log.warn_status -> unit val is_registered_category: string -> bool val pp_all_categories: unit -> unit val pp_all_warn_categories_status: unit -> unit end module Auto_log(L: Log.Messages): Log_skeleton = struct include L let register_and_add s = add_debug_keys (register_category s) let warning ?current = let wkey = None in warning ?wkey ?current let add_or_warn s = match get_category s with | Some c -> add_debug_keys c | None -> warning "Unknown message key %s" s let del_or_warn s = match get_category s with | Some c -> del_debug_keys c | None -> warning "Unknown message key %s" s let set_warn_status s status = match get_warn_category s with | Some c -> set_warn_status c status | None -> warning "Unknown warning key %s" s let pp_all_categories () = (* level 0 just in case user ask to display all categories in an otherwise quiet run *) feedback ~level:0 "@[Available message categories are:@;%a@]" Format.(pp_print_list ~pp_sep:pp_print_cut pp_category) (get_all_categories ()) end module L = (val if is_kernel () then (module Auto_log(Cmdline.Kernel_log)) else (module Auto_log(Plugin_log)) : Log_skeleton) (* Add default message keys to the instance of Log.Messages *) let () = List.iter L.register_and_add !default_msg_keys_ref let plugin = let name = if is_kernel () then kernel_name else P.name in let tbl = Hashtbl.create 17 in Hashtbl.add tbl empty_string []; { p_name = name; p_shortname = P.shortname; p_help = P.help; p_parameters = tbl } let add_group ?memo name = let parameter_groups = plugin.p_parameters in let g, new_g = Cmdline.Group.add ?memo ~plugin:P.shortname name in if new_g then Hashtbl.add parameter_groups name []; g let () = (try Cmdline.add_plugin P.name ~short:P.shortname ~help:P.help with Invalid_argument s -> L.abort "cannot register plug-in `%s': %s" P.name s); kernel_ongoing := is_kernel (); plugins := plugin :: !plugins (* ************************************************************************ *) (** {3 Generic options for each plug-in} *) (* ************************************************************************ *) let messages = add_group "Output Messages" include Parameter_builder.Make (struct let shortname = P.shortname module L = L let messages_group = messages let parameters = plugin.p_parameters end) let prefix = if P.shortname = empty_string then "-kernel-" else "-" ^ P.shortname ^ "-" let plugin_subpath = match !plugin_subpath_ref with | None -> P.shortname | Some s -> s (* ************************************************************************ *) (** {3 Specific directories} *) (* ************************************************************************ *) module Make_specific_dir (O: Parameter_sig.Input_with_arg) (D: sig val dirs: unit -> string list val visible_ref: bool val force_dir: bool end) = struct let is_visible = D.visible_ref let force_dir = D.force_dir let is_kernel = is_kernel () (* the side effect must be applied right now *) let () = Parameter_customize.set_cmdline_stage Cmdline.Extended; if is_visible then Parameter_customize.do_iterate () else Parameter_customize.is_invisible () module Dir_name = Empty_string (struct let option_name = prefix ^ O.option_name let arg_name = O.arg_name let help = if is_visible then O.help else empty_string end) exception No_dir let mk_dir d = try Extlib.mkdir ~parents:true d 0o755; L.warning "creating %s directory `%s'" O.option_name d; d with Unix.Unix_error _ -> L.warning "cannot create %s directory `%s'" O.option_name d; raise No_dir let rec get_and_check_dirs error = function | [] -> raise No_dir | d::l -> if (try Sys.is_directory d with Sys_error _ -> false) then d else get_and_check_dirs error l let get_and_check_dirs ?(error=true) = function | [] -> if error then L.abort "no %s directories to look into" O.option_name else raise No_dir | (first::_) as l -> try get_and_check_dirs error l with | No_dir when error -> L.abort "no %s directory for plug-in `%s' among %a" O.option_name P.name Pretty_utils.(pp_list ~sep:",@ " Format.pp_print_string) l | No_dir when force_dir -> (* create the parent, if it does not exist *) let p = Filename.dirname first in if not (try Sys.is_directory p with Sys_error _ -> false) then ignore (mk_dir p); mk_dir first let dir ?error () = (* get the specified dir if any *) let d = if is_visible then Dir_name.get () else empty_string in if d = empty_string then (* no specified dir: look for the default one. *) if is_kernel then get_and_check_dirs ?error (D.dirs ()) else let dirs = List.map (fun x -> x ^ "/" ^ plugin_subpath) (D.dirs ()) in get_and_check_dirs ?error dirs else get_and_check_dirs ?error [d] let file ?error f = dir ?error () ^ "/" ^ f end module Share = Make_specific_dir (struct let option_name = "share" let arg_name = "dir" let help = "set the plug-in share directory to

    \ (may be used if the plug-in is not installed at the same place as Frama-C)" end) (struct let dirs () = Config.datadirs let visible_ref = !share_visible_ref let force_dir = false end) module Session = Make_specific_dir (struct let option_name = "session" let arg_name = "dir" let help = "set the plug-in session directory to " end) (struct let dirs () = [ if !session_is_set_ref () then !session_ref () else try Sys.getenv "FRAMAC_SESSION" with Not_found -> "./.frama-c"] let visible_ref = !session_visible_ref let force_dir = true end) let () = if is_kernel () then Journal.get_session_file := Session.file ~error:false module Config = Make_specific_dir (struct let option_name = "config" let arg_name = "dir" let help = "set the plug-in config directory to \ (may be used on systems with no default user directory)" end) (struct let dirs () = [ let d, vis = if !config_is_set_ref () then !config_ref (), false else try Sys.getenv "FRAMAC_CONFIG", false with Not_found -> try Sys.getenv "USERPROFILE", false (* Win32 *) with Not_found -> (* Unix like *) try Sys.getenv "XDG_CONFIG_HOME", true with Not_found -> try Sys.getenv "HOME" ^ "/.config", true with Not_found -> ".", false in d ^ if vis then "/frama-c" else "/.frama-c" ] let visible_ref = !config_visible_ref let force_dir = true end) let help = add_group "Getting Information" let () = Parameter_customize.set_group help let () = Parameter_customize.set_cmdline_stage Cmdline.Exiting let () = if is_kernel () then Parameter_customize.set_module_name "Help" module Help = False (struct let option_name = prefix ^ "help" let help = if is_kernel () then "help of the Frama-C kernel" else "help of plug-in " ^ P.name end) let () = Cmdline.run_after_exiting_stage (fun () -> if Help.get () then Cmdline.plugin_help P.shortname else Cmdline.nop); Help.add_aliases [ prefix ^ "h" ] let output_mode modname optname = Parameter_customize.set_group messages; Parameter_customize.do_not_projectify (); Parameter_customize.do_not_journalize (); Parameter_customize.do_iterate (); if is_kernel () then begin Parameter_customize.set_cmdline_stage Cmdline.Early; Parameter_customize.set_module_name modname; "-" ^ kernel_name ^ "-" ^ optname end else begin Parameter_customize.set_cmdline_stage Cmdline.Extended; prefix ^ optname end let logfile_optname = output_mode "LogToFile" "log" module LogToFile = struct include String_map (struct include Datatype.String type key = string let of_string ~key:_ ~prev:_ s = match s with | None -> raise (Cannot_build "missing delimiter") | Some s when s = "" -> raise (Cannot_build "missing filename") | Some _ -> s let to_string ~key:_a b = b end) (struct let option_name = logfile_optname let arg_name = "K_1:file_1,..." let help = "copy log messages from " ^ (if is_kernel () then "the Frama-C kernel" else P.name) ^ " to a file. is a combination of these characters:\n\ a: ALL messages (equivalent to 'dfiruw')\n\ d: debug e: user or internal error (same as 'iu')\n\ f: feedback i: internal error\n\ r: result u: user error w: warning\n\ An empty (e.g. \":file.txt\") defaults to 'iruw'. \ One plug-in can output to several files and vice-versa." let default = Datatype.String.Map.empty end) type parse_result = | Parse_OK of Log.kind list | Parse_Error of string (*msg*) (* default kinds when none are specified *) let default_kinds_str = "erw" (* all valid characters for specifying kinds *) let valid_kinds_str = "adefiruw" (* [parse_kinds str] parses [str] to return a list of [kind]s. *) let parse_kinds str = if Str.string_match (Str.regexp ("[^" ^ valid_kinds_str ^ "]")) str 0 then Parse_Error ("invalid log kind character, must be one of: " ^ valid_kinds_str) else let str = if str = "" then default_kinds_str else str in let has_ch c = CamlString.contains str (Char.lowercase_ascii c) in let list_of_bool b e = if b then [e] else [] in let kinds = list_of_bool (has_ch 'd' || has_ch 'a') Log.Debug @ list_of_bool (has_ch 'f' || has_ch 'a') Log.Feedback @ list_of_bool (has_ch 'i' || has_ch 'a' || has_ch 'e') Log.Failure @ list_of_bool (has_ch 'r' || has_ch 'a') Log.Result @ list_of_bool (has_ch 'u' || has_ch 'a' || has_ch 'e') Log.Error @ list_of_bool (has_ch 'w' || has_ch 'a') Log.Warning in Parse_OK kinds let pp_source fmt = function | None -> () | Some src -> Format.fprintf fmt "%a:" Fc_Filepath.pp_pos src end (* Output must be synchronized with functions [prefix_*] in module Log. *) let pp_event_prefix fmt event = let pp_dkey fmt = (Pretty_utils.pp_opt ~pre:(format_of_string ":") Format.pp_print_string) fmt event.Log.evt_category in match event.Log.evt_kind with | Log.Error -> Format.fprintf fmt "[%s%t] user error:" event.Log.evt_plugin pp_dkey | Log.Warning -> Format.fprintf fmt "[%s%t] warning:" event.Log.evt_plugin pp_dkey | Log.Failure -> Format.fprintf fmt "[%s%t] failure:" event.Log.evt_plugin pp_dkey | _ -> Format.fprintf fmt "[%s%t]" event.Log.evt_plugin pp_dkey (* Note: because of the imperative nature of Log listeners, and the fact that they cannot be removed, whenever the -log option is processed again (e.g. after a -then), we must only add new entries to the list of listeners, otherwise we will duplicate the output. *) (* Also note that this code CANNOT be put inside LogToFile, because it uses Datatype. *) let add_new_listeners plugin_name old_value new_value = let new_entries = Datatype.String.Map.filter (fun k _ -> not (Datatype.String.Map.mem k old_value)) new_value in Datatype.String.Map.iter (fun kinds_str filename -> match LogToFile.parse_kinds kinds_str with | LogToFile.Parse_Error msg -> L.abort "%s" msg | LogToFile.Parse_OK kinds -> let fmt = File_formatters.get filename in Log.add_listener ~plugin:plugin_name ~kind:kinds (fun event -> Format.fprintf fmt "%a%a %s@." LogToFile.pp_source event.Log.evt_source pp_event_prefix event event.Log.evt_message); ) new_entries let () = LogToFile.add_set_hook (add_new_listeners (if is_kernel () then kernel_name else P.shortname) ) let verbose_optname = output_mode "Verbose" "verbose" module Verbose = struct include Int(struct let default = !verbose_level () let option_name = verbose_optname let arg_name = "n" let help = (if is_kernel () then "level of verbosity for the Frama-C kernel" else "level of verbosity for plug-in " ^ P.name) ^ " (default to " ^ string_of_int default ^ ")" end) let get () = if is_set () then get () else Cmdline.Verbose_level.get () let () = verbose_level := get; (* line order below matters *) set_range ~min:0 ~max:max_int; if is_kernel () then begin Cmdline.kernel_verbose_atleast_ref := (fun n -> get () >= n); match !Cmdline.Kernel_verbose_level.value_if_set with | None -> () | Some n -> set n end end let debug_optname = output_mode "Debug" "debug" module Debug = struct include Int(struct let default = !debug_level () let option_name = debug_optname let arg_name = "n" let help = (if is_kernel () then "level of debug for the Frama-C kernel" else "level of debug for plug-in " ^ P.name) ^ " (default to " ^ string_of_int default ^ ")" end) let get () = if is_set () then get () else Cmdline.Debug_level.get () let () = debug_level := get; (* line order below matters *) set_range ~min:0 ~max:max_int; add_set_hook (fun old n -> (* the level of verbose is at least the level of debug *) if n > Verbose.get () then Verbose.set n; if n = 0 then decr positive_debug_ref else if old = 0 then Transitioning.Stdlib.incr positive_debug_ref); if is_kernel () then begin Cmdline.kernel_debug_atleast_ref := (fun n -> get () >= n); match !Cmdline.Kernel_debug_level.value_if_set with | None -> () | Some n -> set n end end type action = Print_help | Change_category of (bool * string) list let warn_status_of_string = function | "inactive" | "ignore" -> Log.Winactive | "feedback" -> Log.Wfeedback | "feedback-once" -> Log.Wfeedback_once | "once" -> Log.Wonce | "active" -> Log.Wactive | "err-once" -> Log.Werror_once | "error" -> Log.Werror | "abort" -> Log.Wabort | s -> L.abort "Unknown warning category status `%s'" s let parse_warn_directives is_kernel _old_s s = let set_status c s = if is_kernel && not (L.is_registered_category c) then Cmdline.run_after_extended_stage (fun () -> L.set_warn_status c s) else L.set_warn_status c s in let directives = CamlString.split_on_char ',' s in if List.mem "help" directives then begin match directives with | [ "help" ] -> Cmdline.run_after_exiting_stage (fun () -> L.pp_all_warn_categories_status (); raise Cmdline.Exit) | _ -> L.abort "mixing help with warning categories in `%s'" s end else begin let parse_single s = match CamlString.split_on_char '=' s with | [] -> assert false (* split_on_char should return at least an element even if it is the empty string *) | [ c ] -> set_status c Log.Wactive | [ c; status ] -> set_status c (warn_status_of_string status) | _ -> L.abort "Ill-formed warn key directive `%s'" s in let non_empty s = s <> "" in List.iter parse_single (List.filter non_empty directives) end let parse_category s = let categories = CamlString.split_on_char ',' s in if List.mem "help" categories then Print_help else begin let parse_single s = match CamlString.get s 0 with | '-' -> false, CamlString.sub s 1 (CamlString.length s - 1) | '+' -> true, CamlString.sub s 1 (CamlString.length s - 1) | _ -> true, s in let non_empty s = s <> "" in Change_category (Extlib.filter_map non_empty parse_single categories) end let debug_category_optname = output_mode "Msg_key" "msg-key" module Debug_category = Empty_string(struct let option_name = debug_category_optname let arg_name="k1[,...,kn]" let help = "enables message display for categories ,...,. Use " ^ debug_category_optname ^ " help to get a list of available categories, and * to enable \ all categories" end) let () = let is_kernel = is_kernel () in Debug_category.add_set_hook (fun _ s -> match parse_category s with | Print_help -> Cmdline.run_after_exiting_stage (fun () -> L.pp_all_categories (); raise Cmdline.Exit) | Change_category l -> let add_or_del flag c () = if flag then L.add_or_warn c else L.del_or_warn c in let action (to_add, c) = (* Allow loaded modules to add categories to the kernel: Only categories that exist will be considered in the early stage where -kernel-msg-key is running. Of course, if none of the loaded modules register the given category, a warning will still be emitted. *) if is_kernel && not (L.is_registered_category c) then begin Cmdline.run_after_extended_stage (add_or_del to_add c) end else add_or_del to_add c () in List.iter action l) let warn_category_optname = output_mode "Warn_key" "warn-key" module Warn_category = Empty_string(struct let option_name = warn_category_optname let arg_name="k1[=s1][,...,kn[=sn]]" let help = "set warning status for category to ,..., to . Use " ^ warn_category_optname ^ " help to get a list of available categories, and * to enable \ all categories. Possible statuses are inactive, feedback-once, \ once, active, error-once, error, and abort. Defaults to active" end) let () = let is_kernel = is_kernel () in Warn_category.add_set_hook (parse_warn_directives is_kernel) let add_plugin_output_aliases aliases = let aliases = List.filter (fun alias -> alias <> "") aliases in let optname suffix = List.map (fun alias -> "-" ^ alias ^ suffix) aliases in Help.add_aliases (optname "-help"); Verbose.add_aliases (optname "-verbose"); Debug_category.add_aliases (optname "-msg-key"); Warn_category.add_aliases (optname "-warn-key"); LogToFile.add_aliases (optname "-log") let () = reset_plugin () include Plugin_log end (* Register *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/plugin_entry_points/plugin.mli0000666000000000000000000001607413571573400023311 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Special signature for Kernel services, whose messages are handled in an ad'hoc manner. Should not be of any use for a standard plug-in, who would rather rely on {!Plugin.S} below. @since Chlorine-20180501 @plugin development guide *) module type S_no_log = sig val add_group: ?memo:bool -> string -> Cmdline.Group.t (** Create a new group inside the plug-in. The given string must be different of all the other group names of this plug-in if [memo] is [false]. If [memo] is [true] the function will either create a fresh group or return an existing group of the same name in the same plugin. [memo] defaults to [false] @since Beryllium-20090901 *) module Help: Parameter_sig.Bool (** @deprecated since Oxygen-20120901 *) module Verbose: Parameter_sig.Int module Debug: Parameter_sig.Int (** Handle the specific `share' directory of the plug-in. @since Oxygen-20120901 *) module Share: Parameter_sig.Specific_dir (** Handle the specific `session' directory of the plug-in. @since Neon-20140301 *) module Session: Parameter_sig.Specific_dir (** Handle the specific `config' directory of the plug-in. @since Neon-20140301 *) module Config: Parameter_sig.Specific_dir val help: Cmdline.Group.t (** The group containing option -*-help. @since Boron-20100401 *) val messages: Cmdline.Group.t (** The group containing options -*-debug and -*-verbose. @since Boron-20100401 *) val add_plugin_output_aliases: string list -> unit (** Adds aliases to the options -plugin-help, -plugin-verbose, -plugin-log, -plugin-msg-key, and -plugin-warn-key. [add_plugin_output_aliases [alias]] adds the aliases -alias-help, -alias-verbose, etc. @since 18.0-Argon *) end (** Provided plug-general services for plug-ins. @since Beryllium-20090601-beta1 @modify Chlorine-20180501 removed programmatic access to [Debug_category]: managing categories is now entirely done by Log.Messages @plugin development guide *) module type S = sig include Log.Messages include S_no_log end type plugin = private { p_name: string; p_shortname: string; p_help: string; p_parameters: (string, Typed_parameter.t list) Hashtbl.t } (** Only iterable parameters (see {!do_iterate} and {!do_not_iterate}) are registered in the field [p_parameters]. @since Beryllium-20090901 *) module type General_services = sig include S include Parameter_sig.Builder end (**/**) val register_kernel: unit -> unit (** Begin to register parameters of the kernel. Not for casual users. @since Beryllium-20090601-beta1 *) (**/**) (** Functors for registering a new plug-in. It provides access to several services. @plugin development guide *) module Register (P: sig val name: string (** Name of the module. Arbitrary non-empty string. *) val shortname: string (** Prefix for plugin options. No space allowed. *) val help: string (** description of the module. Free-form text. *) end): General_services val is_share_visible: unit -> unit (** Make visible to the end-user the --share option. To be called just before applying {!Register} to create plug-in services. @since Oxygen-20120901 *) val is_session_visible: unit -> unit (** Make visible to the end-user the --session option. To be called just before applying {!Register} to create plug-in services. @since Neon-20140301 *) val is_config_visible: unit -> unit (** Make visible to the end-user the --config option. To be called just before applying {!Register} to create plug-in services. @since Neon-20140301 *) val plugin_subpath: string -> unit (** Use the given string as the sub-directory in which the plugin files will be installed (ie. [share/frama-c/plugin_subpath]...). Relevant for directories [Share], [Session] and [Config] above. @since Neon-20140301 *) val default_msg_keys: string list -> unit (** Debug message keys set by default for the plugin. @since Silicon-20161101 @deprecated since Chlorine-20180501 use directly functions from Log (add_debug_keys and del_debug_keys) to manage the default status of each category *) (* ************************************************************************* *) (** {2 Handling plugins} *) (* ************************************************************************* *) val get_from_shortname: string -> plugin (** Get a plug-in from its shortname. @since Oxygen-20120901 *) val get_from_name: string -> plugin (** Get a plug-in from its name. @since Oxygen-20120901 *) val is_present: string -> bool (** Whether a plug-in already exists. Plugins are identified by their short name. @since Magnesium-20151001 *) val get: string -> plugin [@@ deprecated "Use Plugin.get_from_name"] (** Get a plug-in from its name. @deprecated since Oxygen-20120901 *) val iter_on_plugins: (plugin -> unit) -> unit (** Iterate on each registered plug-ins. @since Beryllium-20090901 *) (**/**) (* ************************************************************************* *) (** {2 Internal kernel stuff} *) (* ************************************************************************* *) val positive_debug_ref: int ref (** @since Boron-20100401 *) val session_is_set_ref: (unit -> bool) ref val session_ref: (unit -> string) ref val config_is_set_ref: (unit -> bool) ref val config_ref: (unit -> string) ref (**/**) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/visitors/0000777000000000000000000000000013571573400017047 5ustar frama-c-20.0-Calcium/src/kernel_services/visitors/cabsvisit.ml0000666000000000000000000005367513571573400021410 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (* cabsvisit.ml *) (* tree visitor and rewriter for cabs *) open Cabs open Cabshelper open Cil type nameKind = NVar (* Variable or function prototype name *) | NFun (* A function definition name *) | NField (* The name of a field *) | NType (* The name of a type *) (* All visit methods are called in preorder! (but you can use * ChangeDoChildrenPost to change the order) *) class type cabsVisitor = object method vexpr: expression -> expression visitAction (* expressions *) method vinitexpr: init_expression -> init_expression visitAction method vstmt: statement -> statement list visitAction method vblock: block -> block visitAction method vvar: string -> string (* use of a variable * names *) method vdef: definition -> definition list visitAction method vtypespec: typeSpecifier -> typeSpecifier visitAction method vdecltype: decl_type -> decl_type visitAction (* For each declaration we call vname *) method vname: nameKind -> specifier -> name -> name visitAction method vspec: specifier -> specifier visitAction (* specifier *) method vattr: attribute -> attribute list visitAction method vEnterScope: unit -> unit method vExitScope: unit -> unit end (* a default visitor which does nothing to the tree *) class nopCabsVisitor : cabsVisitor = object method vexpr (_e:expression) = DoChildren method vinitexpr (_e:init_expression) = DoChildren method vstmt (s: statement) = CurrentLoc.set (get_statementloc s); DoChildren method vblock (_b: block) = DoChildren method vvar (s: string) = s method vdef (d: definition) = CurrentLoc.set (get_definitionloc d); DoChildren method vtypespec (_ts: typeSpecifier) = DoChildren method vdecltype (_dt: decl_type) = DoChildren method vname _k (_s:specifier) (_n: name) = DoChildren method vspec (_s:specifier) = DoChildren method vattr (_a: attribute) = DoChildren method vEnterScope () = () method vExitScope () = () end let doVisit vis startvisit children node = Cil.doVisit vis vis (fun x -> x) startvisit children node let doVisitList vis startvisit children node = Cil.doVisitList vis vis (fun x -> x) startvisit children node let rec visitCabsTypeSpecifier (vis: cabsVisitor) (ts: typeSpecifier) = doVisit vis vis#vtypespec childrenTypeSpecifier ts and childrenTypeSpecifier vis ts = let childrenFieldGroup input = match input with | FIELD (s, nel) -> let s' = visitCabsSpecifier vis s in let doOneField ((n, eo) as input) = let n' = visitCabsName vis NField s' n in let eo' = match eo with None -> None | Some e -> let e' = visitCabsExpression vis e in if e' != e then Some e' else eo in if n' != n || eo' != eo then (n', eo') else input in let nel' = mapNoCopy doOneField nel in if s' != s || nel' != nel then FIELD (s', nel') else input | TYPE_ANNOT _ -> input in match ts with Tstruct (n, Some fg, extraAttrs) -> (*(trace "sm" (dprintf "visiting struct %s\n" n));*) let fg' = mapNoCopy childrenFieldGroup fg in if fg' != fg then Tstruct( n, Some fg', extraAttrs) else ts | Tunion (n, Some fg, extraAttrs) -> let fg' = mapNoCopy childrenFieldGroup fg in if fg' != fg then Tunion( n, Some fg', extraAttrs) else ts | Tenum (n, Some ei, extraAttrs) -> let doOneEnumItem ((s, e, loc) as ei) = let e' = visitCabsExpression vis e in if e' != e then (s, e', loc) else ei in vis#vEnterScope (); let ei' = mapNoCopy doOneEnumItem ei in vis#vExitScope(); if ei' != ei then Tenum( n, Some ei', extraAttrs) else ts | TtypeofE e -> let e' = visitCabsExpression vis e in if e' != e then TtypeofE e' else ts | TtypeofT (s, dt) -> let s' = visitCabsSpecifier vis s in let dt' = visitCabsDeclType vis false dt in if s != s' || dt != dt' then TtypeofT (s', dt') else ts | ts -> ts and childrenSpecElem (vis: cabsVisitor) (se: spec_elem) : spec_elem = match se with SpecTypedef | SpecInline | SpecStorage _ | SpecPattern _ -> se | SpecCV _ -> se (* cop out *) | SpecAttr a -> begin let al' = visitCabsAttribute vis a in match al' with [a''] when a'' == a -> se | [a''] -> SpecAttr a'' | _ -> Kernel.fatal "childrenSpecElem: visitCabsAttribute returned a list" end | SpecType ts -> let ts' = visitCabsTypeSpecifier vis ts in if ts' != ts then SpecType ts' else se and visitCabsSpecifier (vis: cabsVisitor) (s: specifier) : specifier = doVisit vis vis#vspec childrenSpec s and childrenSpec vis s = mapNoCopy (childrenSpecElem vis) s and visitCabsDeclType vis (isfundef: bool) (dt: decl_type) : decl_type = doVisit vis vis#vdecltype (childrenDeclType isfundef) dt and childrenDeclType isfundef vis dt = match dt with JUSTBASE -> dt | PARENTYPE (prea, dt1, posta) -> let prea' = mapNoCopyList (visitCabsAttribute vis) prea in let dt1' = visitCabsDeclType vis isfundef dt1 in let posta'= mapNoCopyList (visitCabsAttribute vis) posta in if prea' != prea || dt1' != dt1 || posta' != posta then PARENTYPE (prea', dt1', posta') else dt | ARRAY (dt1, al, e) -> let dt1' = visitCabsDeclType vis isfundef dt1 in let al' = mapNoCopy (childrenAttribute vis) al in let e'= visitCabsExpression vis e in if dt1' != dt1 || al' != al || e' != e then ARRAY(dt1', al', e') else dt | PTR (al, dt1) -> let al' = mapNoCopy (childrenAttribute vis) al in let dt1' = visitCabsDeclType vis isfundef dt1 in if al' != al || dt1' != dt1 then PTR(al', dt1') else dt | PROTO (dt1, snl, gsnl, b) -> (* Do not propagate isfundef further *) let dt1' = visitCabsDeclType vis false dt1 in let _ = vis#vEnterScope () in let snl' = mapNoCopy (childrenSingleName vis NVar) snl in let gsnl' = mapNoCopy (childrenSingleName vis NVar) gsnl in (* Exit the scope only if not in a function definition *) let _ = if not isfundef then vis#vExitScope () in if dt1' != dt1 || snl' != snl || gsnl' != gsnl then PROTO(dt1', snl', gsnl' , b) else dt and childrenNameGroup vis (kind: nameKind) ((s, nl) as input) = let s' = visitCabsSpecifier vis s in let nl' = mapNoCopy (visitCabsName vis kind s') nl in if s' != s || nl' != nl then (s', nl') else input and visitCabsName vis (k: nameKind) (s: specifier) (n: name) : name = doVisit vis (vis#vname k s) (childrenName s k) n and childrenName (_s: specifier) (k: nameKind) vis (n: name) : name = let (sn, dt, al, loc) = n in let dt' = visitCabsDeclType vis (k = NFun) dt in let al' = mapNoCopy (childrenAttribute vis) al in if dt' != dt || al' != al then (sn, dt', al', loc) else n and childrenInitName vis (s: specifier) (inn: init_name) : init_name = let (n, ie) = inn in let n' = visitCabsName vis NVar s n in let ie' = visitCabsInitExpression vis ie in if n' != n || ie' != ie then (n', ie') else inn and childrenSingleName vis (k: nameKind) (sn: single_name) : single_name = let s, n = sn in let s' = visitCabsSpecifier vis s in let n' = visitCabsName vis k s' n in if s' != s || n' != n then (s', n') else sn and visitCabsDefinition vis (d: definition) : definition list = doVisitList vis vis#vdef childrenDefinition d and childrenDefinition vis d = match d with FUNDEF (spec,sn, b, l, lend) -> let sn' = childrenSingleName vis NFun sn in let b' = visitCabsBlock vis b in (* End the scope that was started by childrenFunctionName *) vis#vExitScope (); if sn' != sn || b' != b then FUNDEF (spec,sn', b', l, lend) else d | DECDEF (spec,(s, inl), l) -> let s' = visitCabsSpecifier vis s in let inl' = mapNoCopy (childrenInitName vis s') inl in if s' != s || inl' != inl then DECDEF (spec,(s', inl'), l) else d | TYPEDEF (ng, l) -> let ng' = childrenNameGroup vis NType ng in if ng' != ng then TYPEDEF (ng', l) else d | ONLYTYPEDEF (s, l) -> let s' = visitCabsSpecifier vis s in if s' != s then ONLYTYPEDEF (s', l) else d | GLOBASM _ -> d | PRAGMA (e, l) -> let e' = visitCabsExpression vis e in if e' != e then PRAGMA (e', l) else d | LINKAGE (n, l, dl) -> let dl' = mapNoCopyList (visitCabsDefinition vis) dl in if dl' != dl then LINKAGE (n, l, dl') else d | GLOBANNOT _ -> d | CUSTOM _ -> d and visitCabsBlock vis (b: block) : block = doVisit vis vis#vblock childrenBlock b and childrenBlock vis (b: block) : block = let _ = vis#vEnterScope () in let battrs' = mapNoCopyList (visitCabsAttribute vis) b.battrs in let bstmts' = mapNoCopyList (visitCabsStatement vis) b.bstmts in let _ = vis#vExitScope () in if battrs' != b.battrs || bstmts' != b.bstmts then { blabels = b.blabels; battrs = battrs'; bstmts = bstmts' } else b and visitCabsStatement vis (s: statement) : statement list = doVisitList vis vis#vstmt childrenStatement s and childrenStatement vis s = let ve e = visitCabsExpression vis e in let vs l s = match visitCabsStatement vis s with [s'] -> s' | sl -> { s with stmt_node = BLOCK ({blabels = []; battrs = []; bstmts = sl }, l, l(*LRICEA*))} in match s.stmt_node with NOP _ -> s | COMPUTATION (e, l) -> let e' = ve e in if e' != e then {s with stmt_node = COMPUTATION (e', l)} else s | BLOCK (b, l, l') -> let b' = visitCabsBlock vis b in if b' != b then {s with stmt_node = BLOCK (b', l, l')} else s | SEQUENCE (s1, s2, l) -> let s1' = vs l s1 in let s2' = vs l s2 in if s1' != s1 || s2' != s2 then {s with stmt_node = SEQUENCE (s1', s2', l)} else s | IF (e, s1, s2, l) -> let e' = ve e in let s1' = vs l s1 in let s2' = vs l s2 in if e' != e || s1' != s1 || s2' != s2 then {s with stmt_node = IF (e', s1', s2', l)} else s | WHILE (a, e, s1, l) -> let e' = ve e in let s1' = vs l s1 in if e' != e || s1' != s1 then {s with stmt_node = WHILE (a, e', s1', l)} else s | DOWHILE (a, e, s1, l) -> let e' = ve e in let s1' = vs l s1 in if e' != e || s1' != s1 then {s with stmt_node = DOWHILE (a, e', s1', l)} else s | FOR (a, fc1, e2, e3, s4, l) -> let _ = vis#vEnterScope () in let fc1' = match fc1 with FC_EXP e1 -> let e1' = ve e1 in if e1' != e1 then FC_EXP e1' else fc1 | FC_DECL d1 -> let d1' = match visitCabsDefinition vis d1 with [d1'] -> d1' | _ -> Kernel.fatal "visitCabs: for can have only one definition" in if d1' != d1 then FC_DECL d1' else fc1 in let e2' = ve e2 in let e3' = ve e3 in let s4' = vs l s4 in let _ = vis#vExitScope () in if fc1' != fc1 || e2' != e2 || e3' != e3 || s4' != s4 then {s with stmt_node = FOR (a, fc1', e2', e3', s4', l)} else s | BREAK _ | CONTINUE _ | GOTO _ -> s | RETURN (e, l) -> let e' = ve e in if e' != e then {s with stmt_node = RETURN (e', l)} else s | SWITCH (e, s1, l) -> let e' = ve e in let s1' = vs l s1 in if e' != e || s1' != s1 then {s with stmt_node = SWITCH (e', s1', l)} else s | CASE (e, s1, l) -> let e' = ve e in let s1' = vs l s1 in if e' != e || s1' != s1 then {s with stmt_node = CASE (e', s1', l)} else s | CASERANGE (e1, e2, s3, l) -> let e1' = ve e1 in let e2' = ve e2 in let s3' = vs l s3 in if e1' != e1 || e2' != e2 || s3' != s3 then {s with stmt_node = CASERANGE (e1', e2', s3', l)} else s | DEFAULT (s1, l) -> let s1' = vs l s1 in if s1' != s1 then {s with stmt_node = DEFAULT (s1', l)} else s | LABEL (n, s1, l) -> let s1' = vs l s1 in if s1' != s1 then {s with stmt_node = LABEL (n, s1', l)} else s | COMPGOTO (e, l) -> let e' = ve e in if e' != e then {s with stmt_node = COMPGOTO (e', l)} else s | DEFINITION d -> begin match visitCabsDefinition vis d with [d'] when d' == d -> s | [d'] -> {s with stmt_node = DEFINITION d' } | dl -> let l = get_definitionloc d in let dl' = List.map (fun d' -> {s with stmt_node = DEFINITION d'}) dl in {s with stmt_node = BLOCK ({blabels = []; battrs = []; bstmts = dl' }, l, l(*LRICEA*))} end | ASM (sl, b, details, l) -> let childrenIdentStringExp ((i,s, e) as input) = let e' = ve e in if e' != e then (i,s, e') else input in let details' = match details with | None -> details | Some { aoutputs = outl; ainputs = inl; aclobbers = clobs; alabels = labels } -> let outl' = mapNoCopy childrenIdentStringExp outl in let inl' = mapNoCopy childrenIdentStringExp inl in if outl' == outl && inl' == inl then details else Some { aoutputs = outl'; ainputs = inl'; aclobbers = clobs ; alabels = labels } in if details' != details then {s with stmt_node = ASM (sl, b, details', l)} else s | TRY_FINALLY (b1, b2, l) -> let b1' = visitCabsBlock vis b1 in let b2' = visitCabsBlock vis b2 in if b1' != b1 || b2' != b2 then {s with stmt_node = TRY_FINALLY(b1', b2', l)} else s | TRY_EXCEPT (b1, e, b2, l) -> let b1' = visitCabsBlock vis b1 in let e' = visitCabsExpression vis e in let b2' = visitCabsBlock vis b2 in if b1' != b1 || e' != e || b2' != b2 then {s with stmt_node = TRY_EXCEPT(b1', e', b2', l)} else s | THROW (e,l) -> let e' = optMapNoCopy (visitCabsExpression vis) e in if e != e' then { s with stmt_node = THROW(e',l) } else s | TRY_CATCH(t,l,loc) -> let visit_one_catch (v,s as c) = let v' = optMapNoCopy (childrenSingleName vis NVar) v in let s' = vs loc s in if v' != v || s' != s then (v,s) else c in let t' = vs loc t in let l' = mapNoCopy visit_one_catch l in if t' != t || l' != l then { s with stmt_node = TRY_CATCH(t',l',loc) } else s | CODE_ANNOT _ | CODE_SPEC _ -> s and visitCabsExpression vis (e: expression) : expression = doVisit vis vis#vexpr childrenExpression e and childrenExpression vis e = let ve e = visitCabsExpression vis e in match e.expr_node with NOTHING | LABELADDR _ -> e | UNARY (uo, e1) -> let e1' = ve e1 in if e1' != e1 then { e with expr_node = UNARY (uo, e1')} else e | BINARY (bo, e1, e2) -> let e1' = ve e1 in let e2' = ve e2 in if e1' != e1 || e2' != e2 then { e with expr_node = BINARY (bo, e1', e2')} else e | QUESTION (e1, e2, e3) -> let e1' = ve e1 in let e2' = ve e2 in let e3' = ve e3 in if e1' != e1 || e2' != e2 || e3' != e3 then { e with expr_node = QUESTION (e1', e2', e3')} else e | CAST ((s, dt), ie) -> let s' = visitCabsSpecifier vis s in let dt' = visitCabsDeclType vis false dt in let ie' = visitCabsInitExpression vis ie in if s' != s || dt' != dt || ie' != ie then { e with expr_node = CAST ((s', dt'), ie')} else e | CALL (f, el, gl) -> let f' = ve f in let el' = mapNoCopy ve el in let gl' = mapNoCopy ve gl in if f' != f || el' != el then { e with expr_node = CALL (f', el',gl')} else e | COMMA el -> let el' = mapNoCopy ve el in if el' != el then { e with expr_node = COMMA (el') } else e | CONSTANT _ -> e | PAREN e1 -> let e1' = ve e1 in if e1' != e1 then { e with expr_node = PAREN (e1') } else e | VARIABLE s -> let s' = vis#vvar s in if s' != s then { e with expr_node = VARIABLE s' } else e | EXPR_SIZEOF (e1) -> let e1' = ve e1 in if e1' != e1 then { e with expr_node = EXPR_SIZEOF (e1') } else e | TYPE_SIZEOF (s, dt) -> let s' = visitCabsSpecifier vis s in let dt' = visitCabsDeclType vis false dt in if s' != s || dt' != dt then { e with expr_node = TYPE_SIZEOF (s' ,dt') } else e | EXPR_ALIGNOF (e1) -> let e1' = ve e1 in if e1' != e1 then { e with expr_node = EXPR_ALIGNOF e1'} else e | TYPE_ALIGNOF (s, dt) -> let s' = visitCabsSpecifier vis s in let dt' = visitCabsDeclType vis false dt in if s' != s || dt' != dt then { e with expr_node = TYPE_ALIGNOF (s' ,dt')} else e | INDEX (e1, e2) -> let e1' = ve e1 in let e2' = ve e2 in if e1' != e1 || e2' != e2 then { e with expr_node = INDEX (e1', e2') } else e | MEMBEROF (e1, n) -> let e1' = ve e1 in if e1' != e1 then { e with expr_node = MEMBEROF (e1', n)} else e | MEMBEROFPTR (e1, n) -> let e1' = ve e1 in if e1' != e1 then { e with expr_node = MEMBEROFPTR (e1', n) } else e | GNU_BODY b -> let b' = visitCabsBlock vis b in if b' != b then { e with expr_node = GNU_BODY b' } else e | EXPR_PATTERN _ -> e and visitCabsInitExpression vis (ie: init_expression) : init_expression = doVisit vis vis#vinitexpr childrenInitExpression ie and childrenInitExpression vis ie = let rec childrenInitWhat iw = match iw with NEXT_INIT -> iw | INFIELD_INIT (n, iw1) -> let iw1' = childrenInitWhat iw1 in if iw1' != iw1 then INFIELD_INIT (n, iw1') else iw | ATINDEX_INIT (e, iw1) -> let e' = visitCabsExpression vis e in let iw1' = childrenInitWhat iw1 in if e' != e || iw1' != iw1 then ATINDEX_INIT (e', iw1') else iw | ATINDEXRANGE_INIT (e1, e2) -> let e1' = visitCabsExpression vis e1 in let e2' = visitCabsExpression vis e2 in if e1' != e1 || e2' != e2 then ATINDEXRANGE_INIT (e1', e2') else iw in match ie with NO_INIT -> ie | SINGLE_INIT e -> let e' = visitCabsExpression vis e in if e' != e then SINGLE_INIT e' else ie | COMPOUND_INIT il -> let childrenOne ((iw, ie) as input) = let iw' = childrenInitWhat iw in let ie' = visitCabsInitExpression vis ie in if iw' != iw || ie' != ie then (iw', ie') else input in let il' = mapNoCopy childrenOne il in if il' != il then COMPOUND_INIT il' else ie and visitCabsAttribute vis (a: attribute) : attribute list = doVisitList vis vis#vattr childrenAttribute a and childrenAttribute vis ((n, el) as input) = let el' = mapNoCopy (visitCabsExpression vis) el in if el' != el then (n, el') else input and visitCabsAttributes vis (al: attribute list) : attribute list = mapNoCopyList (visitCabsAttribute vis) al let visitCabsFile (vis: cabsVisitor) ((fname, f): file) : file = (fname, mapNoCopyList (fun ((ghost,f) as glob) -> let f' = visitCabsDefinition vis f in match f' with [f'] when f == f' -> [glob] | _ -> List.map (fun f -> (ghost, f)) f' ) f) (* end of file *) frama-c-20.0-Calcium/src/kernel_services/visitors/cabsvisit.mli0000666000000000000000000001356013571573400021546 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (* cabsvisit.mli *) (* interface for cabsvisit.ml *) open Cil type nameKind = NVar (** Variable or function prototype name *) | NFun (** Function definition name *) | NField (** The name of a field *) | NType (** The name of a type *) (* All visit methods are called in preorder! (but you can use * ChangeDoChildrenPost to change the order) *) class type cabsVisitor = object method vexpr: Cabs.expression -> Cabs.expression visitAction (* expressions *) method vinitexpr: Cabs.init_expression -> Cabs.init_expression visitAction method vstmt: Cabs.statement -> Cabs.statement list visitAction method vblock: Cabs.block -> Cabs.block visitAction method vvar: string -> string (* use of a variable * names *) method vdef: Cabs.definition -> Cabs.definition list visitAction method vtypespec: Cabs.typeSpecifier -> Cabs.typeSpecifier visitAction method vdecltype: Cabs.decl_type -> Cabs.decl_type visitAction (* For each declaration we call vname *) method vname: nameKind -> Cabs.specifier -> Cabs.name -> Cabs.name visitAction method vspec: Cabs.specifier -> Cabs.specifier visitAction (* specifier *) method vattr: Cabs.attribute -> Cabs.attribute list visitAction method vEnterScope: unit -> unit method vExitScope: unit -> unit end class nopCabsVisitor: cabsVisitor val visitCabsTypeSpecifier: cabsVisitor -> Cabs.typeSpecifier -> Cabs.typeSpecifier val visitCabsSpecifier: cabsVisitor -> Cabs.specifier -> Cabs.specifier (** Visits a decl_type. The bool argument is saying whether we are in a * function definition and thus the scope in a PROTO should extend until the * end of the function *) val visitCabsDeclType: cabsVisitor -> bool -> Cabs.decl_type -> Cabs.decl_type val visitCabsDefinition: cabsVisitor -> Cabs.definition -> Cabs.definition list val visitCabsBlock: cabsVisitor -> Cabs.block -> Cabs.block val visitCabsStatement: cabsVisitor -> Cabs.statement -> Cabs.statement list val visitCabsExpression: cabsVisitor -> Cabs.expression -> Cabs.expression val visitCabsAttributes: cabsVisitor -> Cabs.attribute list -> Cabs.attribute list val visitCabsName: cabsVisitor -> nameKind -> Cabs.specifier -> Cabs.name -> Cabs.name val visitCabsFile: cabsVisitor -> Cabs.file -> Cabs.file (* (** Set by the visitor to the current location *) val visitorLocation: Cabs.cabsloc ref *) frama-c-20.0-Calcium/src/kernel_services/visitors/visitor.ml0000666000000000000000000011163213571573400021104 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Extlib open Cil open Cil_types (* ************************************************************************* *) (** {2 Visitors} *) (* ************************************************************************* *) (** Class type for a Db-aware visitor. *) class type frama_c_visitor = object inherit cilVisitor method frama_c_plain_copy: frama_c_visitor method vstmt_aux: Cil_types.stmt -> Cil_types.stmt visitAction method vglob_aux: Cil_types.global -> Cil_types.global list visitAction method current_kf: kernel_function option (** @plugin development guide *) method set_current_kf: kernel_function -> unit method reset_current_kf: unit -> unit end (** Extension to the cil visitor that is aware of kernel function and annotation db. This is done by defining auxiliary methods that can be redefined in inherited classes, while the corresponding ones from {!Cil.cilVisitor} {b must} retain their values as defined here. Otherwise, annotations may not be visited properly. *) class internal_generic_frama_c_visitor fundec queue current_kf behavior: frama_c_visitor = object(self) inherit internal_genericCilVisitor fundec behavior queue method frama_c_plain_copy = new internal_generic_frama_c_visitor fundec queue current_kf behavior method! plain_copy_visitor = assert (self#frama_c_plain_copy#get_filling_actions == self#get_filling_actions); (self#frama_c_plain_copy :> Cil.cilVisitor) method set_current_kf kf = current_kf := Some kf method reset_current_kf () = current_kf := None method current_kf = !current_kf method! private vstmt stmt = let orig_stmt = Visitor_behavior.Get_orig.stmt self#behavior stmt in let annots = Annotations.fold_code_annot (fun e a acc -> (e, a) :: acc) orig_stmt [] in let res = self#vstmt_aux stmt in (* Annotations will be visited and more importantly added in the same order as they were in the original AST. *) let annots = List.sort (fun (_,a) (_,b) -> Cil_datatype.Code_annotation.compare a b) annots in let make_children_annot vis = let add, remove = List.fold_left (fun (add, remove) (e, x) -> let y = visitCilCodeAnnotation (vis:>cilVisitor) x in (* Given x, we compute whether it must be removed from the destination project, and whether we should add its copy y, again in the destination project. *) let is_trivial = Logic_utils.is_trivial_annotation in (* we keep [y] only if it is non-trivial (non-\true), except if [x] is already trivial itself. *) let becomes_trivial = is_trivial y && not (is_trivial x) in let curr_add, remove_curr = if Visitor_behavior.is_copy vis#behavior then (* Copy visitor. We add [y], except if trivial. No sense in removing [x], since the stmt is a new one. *) (if not becomes_trivial then [e, y] else []), false else (* Inplace visitor. We remove [x] if it becomes trivial, or if it has changed (because we need to add it back with the new content). We re-add [y] if [x] has changed and has not became trivial. Do not always remove then re-add, as this would mess up property statuses. *) (if x != y && not becomes_trivial then [e, y] else []), (x != y || becomes_trivial) in (add @ curr_add, if remove_curr then (e, x) :: remove else remove) ) ([],[]) annots in (add, remove) in let change_stmt stmt (add, remove) = if (add <> [] || remove <> []) then begin let kf = Extlib.the self#current_kf in let new_kf = Visitor_behavior.Get.kernel_function self#behavior kf in Queue.add (fun () -> List.iter (fun (e, a) -> Annotations.remove_code_annot e ~kf:new_kf stmt a) remove; List.iter (fun (e, a) -> Annotations.add_code_annot e ~kf:new_kf stmt a) add) self#get_filling_actions end in let post_action f stmt = let (add, _ as new_annots) = make_children_annot self in let stmt = f stmt in (match stmt.skind with | Block b when annots <> [] || add <> [] -> stmt.skind <- Block (Cil.block_of_transient b) | _ -> ()); change_stmt stmt new_annots; stmt in let copy stmt = change_stmt stmt(make_children_annot self#frama_c_plain_copy); stmt in let plain_post = post_action (fun x -> x) in match res with | SkipChildren -> res | JustCopy -> JustCopyPost copy | JustCopyPost f -> JustCopyPost (f $ copy) | DoChildren -> DoChildrenPost plain_post | DoChildrenPost f -> DoChildrenPost (f $ plain_post) | ChangeTo _ | ChangeToPost _ -> res | ChangeDoChildrenPost (stmt,f) -> ChangeDoChildrenPost (stmt, post_action f) method vstmt_aux _ = DoChildren method vglob_aux _ = DoChildren method private vbehavior_annot ?e b = let kf = Extlib.the self#current_kf in let treat_elt emit elt acc = match e with | None -> (emit, elt) :: acc | Some e when Emitter.equal e emit -> (emit, elt) :: acc | Some _ -> acc in let fold_elt fold = fold treat_elt kf b.b_name [] in let old_requires = fold_elt Annotations.fold_requires in let old_assumes = fold_elt Annotations.fold_assumes in let old_ensures = fold_elt Annotations.fold_ensures in let old_assigns = fold_elt Annotations.fold_assigns in let old_allocates = fold_elt Annotations.fold_allocates in let old_extended = fold_elt Annotations.fold_extended in let b' = if Visitor_behavior.is_copy self#behavior then { b with b_name = b.b_name } else b in let res = self#vbehavior b' in let new_kf = Visitor_behavior.Get.kernel_function self#behavior kf in let add_queue a = Queue.add a self#get_filling_actions in let visit_clauses vis f = (* Ensures that we have a table associated to new_kf in Annotations. *) add_queue (fun () -> ignore (Annotations.behaviors ~populate:false new_kf)); let module Fold = struct type 'a t = { apply: 'b. (Emitter.t -> 'a -> 'b -> 'b) -> Kernel_function.t -> string -> 'b -> 'b } end in let visit_elt visit e elt (f,acc) = let new_elt = visit (vis:>Cil.cilVisitor) elt in (* We'll add the elts afterwards, so as to keep lists in their original order as much as we can. see fold_elt below. *) f || new_elt != elt || new_kf != kf, (e,new_elt) :: acc in let check_elt visit e' elt acc = match e with | None -> visit_elt visit e' elt acc | Some e when Emitter.equal e e' -> visit_elt visit e' elt acc | Some _ -> acc in let fold_elt fold visit remove add append dft = let (changed, res) = fold.Fold.apply (check_elt visit) kf b'.b_name (false,[]) in if changed then begin add_queue (fun () -> fold.Fold.apply (fun e' x () -> match e with | None -> remove e' new_kf x | Some e when Emitter.equal e e' -> remove e' new_kf x | _ -> ()) new_kf b'.b_name (); List.iter (fun (e,x) -> add e new_kf b'.b_name x) res) end; List.fold_left (fun acc (_,x) -> append x acc) dft res in let req = fold_elt { Fold.apply = Annotations.fold_requires } Cil.visitCilIdPredicate Annotations.remove_requires (fun e kf behavior r -> Annotations.add_requires e kf ~behavior [r]) (fun x l -> x :: l) [] in b'.b_requires <- req; let assumes = fold_elt { Fold.apply = Annotations.fold_assumes } Cil.visitCilIdPredicate Annotations.remove_assumes (fun e kf behavior a -> Annotations.add_assumes e kf ~behavior [a]) (fun x l -> x :: l) [] in b'.b_assumes <- assumes; let visit_ensures vis (k,p as e) = let new_p = Cil.visitCilIdPredicate (vis:>Cil.cilVisitor) p in if p != new_p then (k,new_p) else e in let ensures = fold_elt { Fold.apply = Annotations.fold_ensures } visit_ensures Annotations.remove_ensures (fun e kf behavior p -> Annotations.add_ensures e kf ~behavior [p]) (fun x l -> x :: l) [] in b'.b_post_cond <- ensures; let add_assigns e kf behavior a = match a with | WritesAny -> () | _ -> Annotations.add_assigns ~keep_empty:false e kf ~behavior a in let concat_assigns new_a a = match new_a, a with | WritesAny, a | a, WritesAny -> a | Writes a1, Writes a2 -> Writes (a2 @ a1) in let a = fold_elt { Fold.apply = Annotations.fold_assigns } Cil.visitCilAssigns Annotations.remove_assigns add_assigns concat_assigns WritesAny in b'.b_assigns <- a; let concat_allocation new_a a = match new_a, a with | FreeAllocAny, a | a, FreeAllocAny -> a | FreeAlloc(a1,a2), FreeAlloc(a3,a4) -> FreeAlloc (a3@a1,a4@a2) in let a = fold_elt { Fold.apply = Annotations.fold_allocates } Cil.visitCilAllocation Annotations.remove_allocates (fun e kf behavior a -> Annotations.add_allocates e kf ~behavior a) concat_allocation FreeAllocAny in b'.b_allocation <- a; let ext = fold_elt { Fold.apply = Annotations.fold_extended } Cil.visitCilExtended Annotations.remove_extended (fun e kf behavior ex -> Annotations.add_extended e kf ~behavior ex) (fun x y -> x::y) [] in b'.b_extended <- ext; f b' in let remove_and_add get remove add fold old b = let emitter = match e with None -> Emitter.end_user | Some e -> e in let elts = get b in List.iter (fun (e,x) -> if not (List.memq x elts) then add_queue (fun () -> remove e new_kf x)) old; let module M = struct exception Found of Emitter.t end in let already_there x = fold (fun e y () -> if x == y then raise (M.Found e)) new_kf b.b_name () in List.iter (fun x -> add_queue (fun () -> try already_there x; add emitter new_kf b.b_name x with M.Found e -> (* We keep x at its right place inside b. *) remove e new_kf x; add e new_kf b.b_name x)) (List.rev elts); in let register_annots b' f = add_queue (fun () -> ignore (Annotations.behaviors ~populate:false new_kf)); remove_and_add (fun b -> b.b_requires) Annotations.remove_requires (fun e kf behavior r -> Annotations.add_requires e kf ~behavior [r]) Annotations.fold_requires old_requires b'; remove_and_add (fun b -> b.b_assumes) Annotations.remove_assumes (fun e kf behavior r -> Annotations.add_assumes e kf ~behavior [r]) Annotations.fold_assumes old_assumes b'; remove_and_add (fun b -> b.b_post_cond) Annotations.remove_ensures (fun e kf behavior r -> Annotations.add_ensures e kf ~behavior [r]) Annotations.fold_ensures old_ensures b'; remove_and_add (fun b -> match b.b_assigns with WritesAny -> [] | a -> [a]) Annotations.remove_assigns (fun e kf behavior a -> match a with | WritesAny -> () | Writes _ -> Annotations.add_assigns ~keep_empty:false e kf ~behavior a) Annotations.fold_assigns old_assigns b'; remove_and_add (fun b -> match b.b_allocation with FreeAllocAny -> [] | a -> [a]) Annotations.remove_allocates (fun e kf behavior a -> Annotations.add_allocates e kf ~behavior a) Annotations.fold_allocates old_allocates b'; remove_and_add (fun b -> b.b_extended) Annotations.remove_extended (fun e kf behavior ex -> Annotations.add_extended e kf ~behavior ex) Annotations.fold_extended old_extended b'; f b' in match res with | SkipChildren -> b | JustCopy -> visit_clauses self#plain_copy_visitor Extlib.id | JustCopyPost f -> visit_clauses self#plain_copy_visitor f | ChangeTo b -> register_annots b Extlib.id | ChangeToPost (b,f) -> register_annots b f | ChangeDoChildrenPost (b,f) -> register_annots (Cil.childrenBehavior (self:>Cil.cilVisitor) b) f | DoChildren -> visit_clauses self Extlib.id | DoChildrenPost f -> visit_clauses self f method private vfunspec_annot () = let kf = Extlib.the self#current_kf in let new_kf = Visitor_behavior.Get.kernel_function self#behavior kf in let old_behaviors = Annotations.fold_behaviors (fun e b acc -> (e,b)::acc) kf [] in let old_complete = Annotations.fold_complete (fun e c acc -> (e,c)::acc) kf [] in let old_disjoint = Annotations.fold_disjoint (fun e d acc -> (e,d)::acc) kf [] in let old_terminates = Annotations.fold_terminates (fun e t _ -> Some (e,t)) kf None in let old_decreases = Annotations.fold_decreases (fun e d _ -> Some (e,d)) kf None in let spec = { spec_behavior = snd (List.split old_behaviors); spec_complete_behaviors = snd (List.split old_complete); spec_disjoint_behaviors = snd (List.split old_disjoint); spec_terminates = (Extlib.opt_map snd) old_terminates; spec_variant = (Extlib.opt_map snd) old_decreases } in let res = self#vspec spec in let do_children () = let new_behaviors = List.rev_map (fun (e,b) -> let b' = self#vbehavior_annot ~e b in if b != b' || kf != new_kf then begin Queue.add (fun () -> Annotations.add_behaviors ~register_children:false e new_kf [b']) self#get_filling_actions; end; b') old_behaviors in let new_terminates = Extlib.opt_map (fun (e,t) -> let t' = Cil.visitCilIdPredicate (self:>Cil.cilVisitor) t in if t != t' || kf != new_kf then Queue.add (fun () -> Annotations.remove_terminates e new_kf; Annotations.add_terminates e new_kf t') self#get_filling_actions ; t') old_terminates in let new_decreases = Extlib.opt_map (fun (e,(d,s as acc)) -> let d' = Cil.visitCilTerm (self:>Cil.cilVisitor) d in if d != d' || kf != new_kf then begin let res = (d',s) in Queue.add (fun () -> Annotations.remove_decreases e new_kf; Annotations.add_decreases e new_kf res; ) self#get_filling_actions; res end else acc ) old_decreases in if kf != new_kf then begin List.iter (fun (e,c) -> Queue.add (fun () -> Annotations.add_complete e new_kf c) self#get_filling_actions) (List.rev old_complete); List.iter (fun (e,d) -> Queue.add (fun () -> Annotations.add_disjoint e new_kf d) self#get_filling_actions) (List.rev old_disjoint) end; { spec with spec_behavior = new_behaviors; spec_terminates = new_terminates; spec_variant = new_decreases } in let change_do_children spec = let new_behaviors = Cil.mapNoCopy self#vbehavior_annot spec.spec_behavior in let new_terminates = Cil.optMapNoCopy (Cil.visitCilIdPredicate (self:>Cil.cilVisitor)) spec.spec_terminates in let new_decreases = Cil.optMapNoCopy (fun (d,s as acc) -> let d' = Cil.visitCilTerm (self:>Cil.cilVisitor) d in if d != d' then (d',s) else acc) spec.spec_variant in { spec with spec_behavior = new_behaviors; spec_terminates = new_terminates; spec_variant = new_decreases } in let register_new_components new_spec = let add_spec_components () = let populate = false in let new_behaviors = Annotations.behaviors ~populate new_kf in List.iter (fun b -> if (List.for_all (fun x -> x.b_name <> b.b_name || Cil.is_empty_behavior x) new_behaviors) then begin Annotations.add_behaviors ~register_children:false Emitter.end_user new_kf [b] end) new_spec.spec_behavior; let new_complete = Annotations.complete ~populate new_kf in List.iter (fun c -> if not (List.memq c new_complete) then begin Annotations.add_complete Emitter.end_user new_kf c end) new_spec.spec_complete_behaviors; let new_disjoint = Annotations.disjoint ~populate new_kf in List.iter (fun d -> if not (List.memq d new_disjoint) then Annotations.add_disjoint Emitter.end_user new_kf d) new_spec.spec_disjoint_behaviors; let new_terminates = Annotations.terminates ~populate new_kf in (match new_terminates, new_spec.spec_terminates with | None, None -> () | Some _, None -> () | None, Some p -> Annotations.add_terminates Emitter.end_user new_kf p | Some p1, Some p2 when p1 == p2 -> () | Some p1, Some p2 -> Kernel.fatal "Visit of spec of function %a gives \ inconsistent terminates clauses@\n\ Registered @[%a@]@\nReturned @[%a@]" Kernel_function.pretty new_kf Printer.pp_identified_predicate p1 Printer.pp_identified_predicate p2); let new_decreases = Annotations.decreases ~populate new_kf in (match new_decreases, new_spec.spec_variant with | None, None -> () | Some _, None -> () | None, Some p -> Annotations.add_decreases Emitter.end_user new_kf p | Some p1, Some p2 when p1 == p2 -> () | Some p1, Some p2 -> Kernel.fatal "Visit of spec of function %a gives \ inconsistent variant clauses@\n\ Registered %d@\n%a@\nReturned %d@\n%a" Kernel_function.pretty new_kf (Obj.magic p1) Printer.pp_decreases p1 (Obj.magic p2) Printer.pp_decreases p2) in List.iter (fun (e,c) -> if not (List.memq c new_spec.spec_complete_behaviors) then Queue.add (fun () -> Annotations.remove_complete e new_kf c) self#get_filling_actions) old_complete; List.iter (fun (e,d) -> if not (List.memq d new_spec.spec_disjoint_behaviors) then Queue.add (fun () -> Annotations.remove_disjoint e new_kf d) self#get_filling_actions) old_disjoint; List.iter (fun (e,b) -> if not (List.memq b new_spec.spec_behavior) then begin Queue.add (fun () -> if List.exists (fun x -> x.b_name = b.b_name) new_spec.spec_behavior then Annotations.remove_behavior_components e new_kf b else Annotations.remove_behavior e new_kf b) self#get_filling_actions end ) old_behaviors; Extlib.may (fun (e,t) -> if not (Extlib.may_map ~dft:false (fun t' -> t == t') new_spec.spec_terminates) then Queue.add (fun () -> Annotations.remove_terminates e new_kf) self#get_filling_actions) old_terminates; Extlib.may (fun (e,d) -> if not (Extlib.may_map ~dft:false (fun d' -> d == d') new_spec.spec_variant) then Queue.add (fun () -> Annotations.remove_decreases e new_kf) self#get_filling_actions) old_decreases; Queue.add add_spec_components self#get_filling_actions; in match res with | SkipChildren -> register_new_components spec | ChangeTo spec -> register_new_components spec | ChangeToPost (spec,f) -> register_new_components spec; ignore (f spec) | JustCopy -> register_new_components (Cil.visitCilFunspec self#plain_copy_visitor spec) | JustCopyPost f -> (register_new_components (Cil.visitCilFunspec self#plain_copy_visitor spec)); ignore (f spec) | DoChildren -> ignore (do_children ()) | DoChildrenPost f -> ignore (f (do_children ())) | ChangeDoChildrenPost(spec, f) -> let res = change_do_children spec in register_new_components res; ignore (f res) method! vglob g = let fundec, has_kf = match g with | GFunDecl(_,v,_) -> let ov = Visitor_behavior.Get_orig.varinfo self#behavior v in let kf = try Globals.Functions.get ov with Not_found -> Kernel.fatal "No kernel function for %s(%d)" v.vname v.vid in (* Just make a copy of current kernel function in case it is needed *) let new_kf = Visitor_behavior.Memo.kernel_function self#behavior kf in if Visitor_behavior.is_copy self#behavior then new_kf.spec <- Cil.empty_funspec (); self#set_current_kf kf; None, true | GFun(f,_) -> let v = Visitor_behavior.Get_orig.varinfo self#behavior f.svar in let kf = try Globals.Functions.get v with Not_found -> Kernel.fatal "Visitor does not find function %s in %a" v.vname Project.pretty (Project.current ()) in let new_kf = Visitor_behavior.Memo.kernel_function self#behavior kf in if Visitor_behavior.is_copy self#behavior then new_kf.spec <- Cil.empty_funspec (); self#set_current_kf kf; Some f, true | _ -> None, false in let res = self#vglob_aux g in let make_funspec () = match g with | GFunDecl _ | GFun _ when Ast.is_def_or_last_decl g -> self#vfunspec_annot (); | _ -> () in (* NB: we'll loose track of the emitter of an annotation. Anyway, this is only used for SkipChildren and JustCopy/JustCopyPost (and for a copy visitor) If user sticks to DoChildren, s/he'll still have the proper correspondence between annotations and emitters. *) let get_spec () = match g with | GFun _ | GFunDecl _ when Ast.is_def_or_last_decl g -> let spec = Annotations.funspec ~populate:false (Extlib.the self#current_kf) in Some (Cil.visitCilFunspec self#plain_copy_visitor spec) | _ -> None in let change_glob ng spec = let cond = Visitor_behavior.is_copy self#behavior in match ng with | GVar(vi,init,_) -> if cond then Queue.add (fun () -> try Globals.Vars.add vi init with Globals.Vars.AlreadyExists (vi,_) -> Kernel.fatal "Visitor is trying to insert global variable %a that \ already exists in current project" Cil_datatype.Varinfo.pretty vi) self#get_filling_actions | GFunDecl(_,v,l) -> (match self#current_kf with | Some kf -> let new_kf = Visitor_behavior.Get.kernel_function self#behavior kf in if cond then begin Queue.add (fun () -> if Cil.hasAttribute "FC_BUILTIN" v.vattr then Cil.Frama_c_builtins.add v.vname v; if Cil_datatype.Varinfo.equal v (Kernel_function.get_vi new_kf) then begin let dft = Annotations.funspec ~populate:false new_kf in let dft = { dft with spec_behavior = dft.spec_behavior } in let spec = Extlib.opt_conv dft spec in Globals.Functions.register new_kf; Globals.Functions.replace_by_declaration spec v l; (* Format.printf "registered spec:@\n%a@." Printer.pp_funspec (Annotations.funspec ~populate:false new_kf) *) end else begin Globals.Functions.replace_by_declaration (Cil.empty_funspec()) v l end) self#get_filling_actions; if Cil_datatype.Varinfo.equal v (Kernel_function.get_vi new_kf) && Extlib.has_some spec then Queue.add (fun () -> Annotations.register_funspec ~force:true new_kf) self#get_filling_actions; end | None -> () (* User is responsible for registering the new function *) ) | GVarDecl (({vstorage=Extern} as v),_) (* when not (isFunctionType v.vtype) *) -> if cond then Queue.add (fun () -> try Globals.Vars.add_decl v with Globals.Vars.AlreadyExists (vi,_) -> Kernel.fatal "Visitor is trying to insert global variable %a that \ already exists in current project" Cil_datatype.Varinfo.pretty vi) self#get_filling_actions | GFun(f,l) -> if cond then begin match self#current_kf with | Some kf -> let new_kf = Visitor_behavior.Get.kernel_function self#behavior kf in Queue.add (fun () -> Kernel.debug ~dkey:Kernel.dkey_visitor "@[Adding definition %s (vid: %d) for project %s@\n\ body: %a@\n@]@." f.svar.vname f.svar.vid (Project.get_name (Project.current())) Printer.pp_block f.sbody; if cond && Cil.hasAttribute "FC_BUILTIN" f.svar.vattr then Cil.Frama_c_builtins.add f.svar.vname f.svar; if Cil_datatype.Varinfo.equal f.svar (Kernel_function.get_vi new_kf) then begin Globals.Functions.register new_kf; let spec = Extlib.opt_conv (Annotations.funspec ~populate:false new_kf) spec in Globals.Functions.replace_by_definition spec f l end else Globals.Functions.replace_by_definition (Cil.empty_funspec ()) f l ) self#get_filling_actions; if Cil_datatype.Varinfo.equal f.svar (Kernel_function.get_vi new_kf) && Extlib.has_some spec then Queue.add (fun () -> Annotations.register_funspec ~force:true new_kf) self#get_filling_actions; | None -> () (* User has to register the new function *) end | GAnnot (na,_) when cond -> let e = match g with | GAnnot (a,_) -> Annotations.emitter_of_global a | _ -> Emitter.end_user in Queue.add (fun () -> try (* Annotations might have already been added by the user. *) ignore (Annotations.emitter_of_global na) with Not_found -> Annotations.unsafe_add_global e na; ) self#get_filling_actions | _ -> () in let post_action g = Extlib.may self#set_current_func fundec; let spec = get_spec () in List.iter (fun g -> change_glob g spec) g; if has_kf then self#reset_current_kf(); Extlib.may (fun _ -> self#reset_current_func ()) fundec; g in let post_change_to g = List.iter (fun g -> change_glob g None) g; if has_kf then self#reset_current_kf(); g in let post_do_children f g = Extlib.may self#set_current_func fundec; make_funspec (); let res = f g in (* Spec registration is already handled at the vfunspec level. *) List.iter (fun g -> change_glob g None) res; if has_kf then self#reset_current_kf(); Extlib.may (fun _ -> self#reset_current_func ()) fundec; res in match res with | SkipChildren -> change_glob g None; if has_kf then self#reset_current_kf(); res | JustCopy -> JustCopyPost post_action | JustCopyPost f -> JustCopyPost (post_action $ f) | DoChildren -> DoChildrenPost (post_do_children Extlib.id) | DoChildrenPost f -> DoChildrenPost (post_do_children f) | ChangeTo l -> ChangeToPost (l,post_change_to) | ChangeToPost (l,f) -> ChangeToPost (l, post_change_to $ f) | ChangeDoChildrenPost (l,f) -> ChangeDoChildrenPost (l, post_do_children f) end class generic_frama_c_visitor bhv = let current_kf = ref None in let current_fundec = ref None in let queue = Queue.create () in internal_generic_frama_c_visitor current_fundec queue current_kf bhv class frama_c_copy prj = generic_frama_c_visitor (Visitor_behavior.copy prj) class frama_c_refresh prj = generic_frama_c_visitor (Visitor_behavior.refresh prj) class frama_c_inplace = generic_frama_c_visitor (Visitor_behavior.inplace()) let visitFramacFileCopy vis f = visitCilFileCopy (vis:>cilVisitor) f let visitFramacFile vis f = visitCilFile (vis:>cilVisitor) f let visitFramacFileSameGlobals vis f = visitCilFileSameGlobals (vis:>cilVisitor) f let visitFramacGlobal vis g = let g' = visitCilGlobal (vis:>cilVisitor) g in vis#fill_global_tables; g' let visitFramacFunction vis f = let orig_var = Visitor_behavior.Get_orig.varinfo vis#behavior f.svar in let old_current_kf = vis#current_kf in vis#set_current_kf (Globals.Functions.get orig_var); let f' = visitCilFunction (vis:>cilVisitor) f in vis#reset_current_kf (); Extlib.may vis#set_current_kf old_current_kf; vis#fill_global_tables; f' let visitFramacKf vis kf = let glob = Ast.def_or_last_decl (Kernel_function.get_vi kf) in ignore (visitFramacGlobal vis glob); match vis#project with | None -> kf | Some prj -> let vi = Kernel_function.get_vi kf in let vi' = Visitor_behavior.Get.varinfo vis#behavior vi in Project.on prj Globals.Functions.get vi' let visitFramacExpr vis e = let e' = visitCilExpr (vis:>cilVisitor) e in vis#fill_global_tables; e' let visitFramacLval vis l = let l' = visitCilLval (vis:>cilVisitor) l in vis#fill_global_tables; l' let visitFramacOffset vis o = let o' = visitCilOffset (vis:>cilVisitor) o in vis#fill_global_tables; o' let visitFramacInitOffset vis o = let o' = visitCilInitOffset (vis:>cilVisitor) o in vis#fill_global_tables; o' let visitFramacInstr vis i = let i' = visitCilInstr (vis:>cilVisitor) i in vis#fill_global_tables; i' let visitFramacStmt vis s = let s' = visitCilStmt (vis:>cilVisitor) s in vis#fill_global_tables; s' let visitFramacBlock vis b = let b' = visitCilBlock (vis:>cilVisitor) b in vis#fill_global_tables; b' let visitFramacType vis t = let t' = visitCilType (vis:>cilVisitor) t in vis#fill_global_tables; t' let visitFramacVarDecl vis v = let v' = visitCilVarDecl (vis:>cilVisitor) v in vis#fill_global_tables; v' let visitFramacLogicVarDecl vis v = let v' = visitCilLogicVarDecl (vis:>cilVisitor) v in vis#fill_global_tables; v' let visitFramacInit vis v o i = let i' = visitCilInit (vis:>cilVisitor) v o i in vis#fill_global_tables; i' let visitFramacAttributes vis a = let a' = visitCilAttributes (vis:>cilVisitor) a in vis#fill_global_tables; a' let visitFramacAnnotation vis a = let a' = visitCilAnnotation (vis:>cilVisitor) a in vis#fill_global_tables; a' let visitFramacCodeAnnotation vis c = let c' = visitCilCodeAnnotation (vis:>cilVisitor) c in vis#fill_global_tables; c' let visitFramacAssigns vis a = let a' = visitCilAssigns (vis:>cilVisitor) a in vis#fill_global_tables; a' let visitFramacAllocation vis a = let a' = visitCilAllocation (vis:>cilVisitor) a in vis#fill_global_tables; a' let visitFramacFrom vis a = let a' = visitCilFrom (vis:>cilVisitor) a in vis#fill_global_tables; a' let visitFramacDeps vis a = let a' = visitCilDeps (vis:>cilVisitor) a in vis#fill_global_tables; a' let visitFramacFunspec vis f = let f' = visitCilFunspec (vis:>cilVisitor) f in vis#fill_global_tables; f' let visitFramacLogicType vis l = let l' = visitCilLogicType (vis:>cilVisitor) l in vis#fill_global_tables; l' let visitFramacPredicateNode vis p = let p' = visitCilPredicateNode (vis:>cilVisitor) p in vis#fill_global_tables; p' let visitFramacPredicate vis p = let p' = visitCilPredicate (vis:>cilVisitor) p in vis#fill_global_tables; p' let visitFramacIdPredicate vis p = let p' = visitCilIdPredicate (vis:>cilVisitor) p in vis#fill_global_tables; p' let visitFramacPredicates vis p = let p' = visitCilPredicates (vis:>cilVisitor) p in vis#fill_global_tables; p' let visitFramacIdTerm vis t = let t' = visitCilIdTerm (vis:>cilVisitor) t in vis#fill_global_tables; t' let visitFramacTerm vis t = let t' = visitCilTerm (vis:>cilVisitor) t in vis#fill_global_tables; t' let visitFramacTermOffset vis t = let t' = visitCilTermOffset (vis:>cilVisitor) t in vis#fill_global_tables; t' let visitFramacTermLhost vis t = let t' = visitCilTermLhost (vis:>cilVisitor) t in vis#fill_global_tables; t' let visitFramacTermLval vis t = let t' = visitCilTermLval (vis:>cilVisitor) t in vis#fill_global_tables; t' let visitFramacLogicInfo vis l = let l' = visitCilLogicInfo (vis:>cilVisitor) l in vis#fill_global_tables; l' let visitFramacBehavior vis b = let b' = visitCilBehavior (vis:>cilVisitor) b in vis#fill_global_tables; b' let visitFramacBehaviors vis b = let b' = visitCilBehaviors (vis:>cilVisitor) b in vis#fill_global_tables; b' let visitFramacModelInfo vis m = let m' = visitCilModelInfo (vis:>cilVisitor) m in vis#fill_global_tables; m' let visitFramacExtended vis e = let e'= visitCilExtended (vis:>cilVisitor) e in vis#fill_global_tables; e' (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/visitors/visitor.mli0000666000000000000000000002207613571573400021260 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Frama-C visitors dealing with projects. *) open Cil_types (** Class type for a Db-aware visitor. This is done by defining auxiliary methods that can be redefined in inherited classes, while the corresponding ones from {!Cil.cilVisitor} {b must} retain their values as defined here. Otherwise, annotations may not be visited properly. The replaced functions are - [vstmt] (use [vstmt_aux] instead) - [vglob] (use [vglob_aux] instead) {b A few hints on how to use correctly this visitor} - when initializing a new project with it (see {!File.init_project_from_visitor}), use a visitor with copy behavior - [SkipChildren] and [ChangeTo] must be used with extreme care in a visitor with copy behavior, or some nodes may be shared between the original and the copy. - Do not erase a statement during the visit, as there might be annotations attached to it. Change it to Skip instead, the [generic_frama_c_visitor] will know what to do. - Be careful if you change the [vid] or [sid]: this must be done before anything has been attached to the corresponding variable or statement in the new project, which means - for statements, in [vstmt], for the current statement only - for variables, at their declaration point. *) class type frama_c_visitor = object inherit Cil.cilVisitor method frama_c_plain_copy: frama_c_visitor (** same as plain_copy_visitor but for frama-c specific methods *) method vstmt_aux: stmt -> stmt Cil.visitAction (** Replacement of vstmt. @plugin development guide*) method vglob_aux: global -> global list Cil.visitAction (** Replacement of vglob. @plugin development guide*) method current_kf: kernel_function option (** link to the kernel function currently being visited. {b NB:} for copy visitors, the link is to the original kf (anyway, the new kf is created only after the visit is over). @plugin development guide *) method set_current_kf: kernel_function -> unit (** Internal use only. *) method reset_current_kf: unit -> unit (** Internal use only. *) end class frama_c_inplace: frama_c_visitor (** in-place visitor; always act in the current project. @plugin development guide *) class frama_c_copy: Project.t -> frama_c_visitor (** Copying visitor. The [Project.t] argument specifies in which project the visitor creates the new values. (Technically, the method [fill_global_tables] is called inside this project.) See {!File.init_project_from_visitor} and [create_project_from_visitor] for possible uses. *) class frama_c_refresh: Project.t -> frama_c_visitor (** Similar to {!frama_c_copy}, but ids will be refreshed in the copy. @since Sodium-20150201 *) class generic_frama_c_visitor: Visitor_behavior.t -> frama_c_visitor (** Generic class that abstracts over [frama_c_inplace] and [frama_c_copy]. @plugin development guide *) (** Visit a file. This will re-cons all globals TWICE (so that it is tail-recursive). Use {!Cil.visitCilFileSameGlobals} if your visitor will not change the list of globals. *) val visitFramacFileCopy: frama_c_visitor -> file -> file (** Same thing, but the result is ignored. The given visitor must thus be an inplace visitor. Nothing is done if the visitor is a copy visitor. *) val visitFramacFile: frama_c_visitor -> file -> unit (** A visitor for the whole file that does not change the globals (but maybe changes things inside the globals). Use this function instead of {!Visitor.visitFramacFile} whenever appropriate because it is more efficient for long files. @plugin development guide *) val visitFramacFileSameGlobals: frama_c_visitor -> file -> unit (** Visit a global. {b Warning} Do not call this function during another visit using the same visitor, as it is not reentrant: the inner visit will leave the visitor in an inconsistent state for the outer visit. *) val visitFramacGlobal: frama_c_visitor -> global -> global list (** Visit a kernel_function. More precisely, the entry point for the visit will be the global corresponding to the last declaration/definition of the kf. The returned kf is the one that has the varinfo associated to the varinfo of the original kf. If this is a new kf, it is however the responsibility of the visitor to insert it in the AST at the appropriate place. @since Aluminium-20160501 *) val visitFramacKf: frama_c_visitor -> Kernel_function.t -> Kernel_function.t (** Visit a function definition. @plugin development guide *) val visitFramacFunction: frama_c_visitor -> fundec -> fundec (** Visit an expression *) val visitFramacExpr: frama_c_visitor -> exp -> exp (** Visit an lvalue *) val visitFramacLval: frama_c_visitor -> lval -> lval (** Visit an lvalue or recursive offset *) val visitFramacOffset: frama_c_visitor -> offset -> offset (** Visit an initializer offset *) val visitFramacInitOffset: frama_c_visitor -> offset -> offset (** Visit an instruction *) val visitFramacInstr: frama_c_visitor -> instr -> instr list (** Visit a statement *) val visitFramacStmt: frama_c_visitor -> stmt -> stmt (** Visit a block *) val visitFramacBlock: frama_c_visitor -> block -> block (** Visit a type *) val visitFramacType: frama_c_visitor -> typ -> typ (** Visit a variable declaration *) val visitFramacVarDecl: frama_c_visitor -> varinfo -> varinfo (** Visit a logic variable declaration @since Magnesium-20151001 *) val visitFramacLogicVarDecl: frama_c_visitor -> logic_var -> logic_var (** Visit an initializer, pass also the global to which this belongs and the * offset. *) val visitFramacInit: frama_c_visitor -> varinfo -> offset -> init -> init (** Visit a list of attributes *) val visitFramacAttributes: frama_c_visitor -> attribute list -> attribute list val visitFramacAnnotation: frama_c_visitor -> global_annotation -> global_annotation val visitFramacCodeAnnotation: frama_c_visitor -> code_annotation -> code_annotation val visitFramacAllocation: frama_c_visitor -> allocation -> allocation val visitFramacAssigns: frama_c_visitor -> assigns -> assigns val visitFramacFrom: frama_c_visitor -> from -> from val visitFramacDeps: frama_c_visitor -> deps -> deps val visitFramacFunspec: frama_c_visitor -> funspec -> funspec val visitFramacLogicType: frama_c_visitor -> logic_type -> logic_type val visitFramacPredicateNode: frama_c_visitor -> predicate_node -> predicate_node val visitFramacPredicate: frama_c_visitor -> predicate -> predicate val visitFramacIdPredicate: frama_c_visitor -> identified_predicate -> identified_predicate val visitFramacPredicates: frama_c_visitor -> identified_predicate list -> identified_predicate list (** visit identified_term. @since Oxygen-20120901 *) val visitFramacIdTerm: frama_c_visitor -> identified_term -> identified_term val visitFramacTerm: frama_c_visitor -> term -> term val visitFramacTermLval: frama_c_visitor -> term_lval -> term_lval val visitFramacTermLhost: frama_c_visitor -> term_lhost -> term_lhost val visitFramacTermOffset: frama_c_visitor -> term_offset -> term_offset val visitFramacLogicInfo: frama_c_visitor -> logic_info -> logic_info val visitFramacBehavior: frama_c_visitor -> funbehavior -> funbehavior val visitFramacBehaviors: frama_c_visitor -> funbehavior list -> funbehavior list val visitFramacModelInfo: frama_c_visitor -> model_info -> model_info val visitFramacExtended: frama_c_visitor -> acsl_extension -> acsl_extension (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/kernel_services/visitors/visitor_behavior.ml0000666000000000000000000013325013571573400022763 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type t = { (* copy mutable structure which are not shared across the AST*) cfile: file -> file; cinitinfo: initinfo -> initinfo; cblock: block -> block; cfunspec: funspec -> funspec; cfunbehavior: funbehavior -> funbehavior; cidentified_term: identified_term -> identified_term; cidentified_predicate: identified_predicate -> identified_predicate; cexpr: exp -> exp; ccode_annotation: code_annotation -> code_annotation; (* get the copy of a shared value *) get_stmt: stmt -> stmt; get_compinfo: compinfo -> compinfo; get_fieldinfo: fieldinfo -> fieldinfo; get_model_info: model_info -> model_info; get_enuminfo: enuminfo -> enuminfo; get_enumitem: enumitem -> enumitem; get_typeinfo: typeinfo -> typeinfo; get_varinfo: varinfo -> varinfo; get_logic_info: logic_info -> logic_info; get_logic_type_info: logic_type_info -> logic_type_info; get_logic_var: logic_var -> logic_var; get_kernel_function: kernel_function -> kernel_function; get_fundec: fundec -> fundec; (* get the original value tied to a copy *) get_original_stmt: stmt -> stmt; get_original_compinfo: compinfo -> compinfo; get_original_fieldinfo: fieldinfo -> fieldinfo; get_original_model_info: model_info -> model_info; get_original_enuminfo: enuminfo -> enuminfo; get_original_enumitem: enumitem -> enumitem; get_original_typeinfo: typeinfo -> typeinfo; get_original_varinfo: varinfo -> varinfo; get_original_logic_info: logic_info -> logic_info; get_original_logic_type_info: logic_type_info -> logic_type_info; get_original_logic_var: logic_var -> logic_var; get_original_kernel_function: kernel_function -> kernel_function; get_original_fundec: fundec -> fundec; (* change a binding... use with care *) set_stmt: stmt -> stmt -> unit; set_compinfo: compinfo -> compinfo -> unit; set_fieldinfo: fieldinfo -> fieldinfo -> unit; set_model_info: model_info -> model_info -> unit; set_enuminfo: enuminfo -> enuminfo -> unit; set_enumitem: enumitem -> enumitem -> unit; set_typeinfo: typeinfo -> typeinfo -> unit; set_varinfo: varinfo -> varinfo -> unit; set_logic_info: logic_info -> logic_info -> unit; set_logic_type_info: logic_type_info -> logic_type_info -> unit; set_logic_var: logic_var -> logic_var -> unit; set_kernel_function: kernel_function -> kernel_function -> unit; set_fundec: fundec -> fundec -> unit; (* change a reference... use with care *) set_orig_stmt: stmt -> stmt -> unit; set_orig_compinfo: compinfo -> compinfo -> unit; set_orig_fieldinfo: fieldinfo -> fieldinfo -> unit; set_orig_model_info: model_info -> model_info -> unit; set_orig_enuminfo: enuminfo -> enuminfo -> unit; set_orig_enumitem: enumitem -> enumitem -> unit; set_orig_typeinfo: typeinfo -> typeinfo -> unit; set_orig_varinfo: varinfo -> varinfo -> unit; set_orig_logic_info: logic_info -> logic_info -> unit; set_orig_logic_type_info: logic_type_info -> logic_type_info -> unit; set_orig_logic_var: logic_var -> logic_var -> unit; set_orig_kernel_function: kernel_function -> kernel_function -> unit; set_orig_fundec: fundec -> fundec -> unit; unset_varinfo: varinfo -> unit; unset_compinfo: compinfo -> unit; unset_enuminfo: enuminfo -> unit; unset_enumitem: enumitem -> unit; unset_typeinfo: typeinfo -> unit; unset_stmt: stmt -> unit; unset_logic_info: logic_info -> unit; unset_logic_type_info: logic_type_info -> unit; unset_fieldinfo: fieldinfo -> unit; unset_model_info: model_info -> unit; unset_logic_var: logic_var -> unit; unset_kernel_function: kernel_function -> unit; unset_fundec: fundec -> unit; unset_orig_varinfo: varinfo -> unit; unset_orig_compinfo: compinfo -> unit; unset_orig_enuminfo: enuminfo -> unit; unset_orig_enumitem: enumitem -> unit; unset_orig_typeinfo: typeinfo -> unit; unset_orig_stmt: stmt -> unit; unset_orig_logic_info: logic_info -> unit; unset_orig_logic_type_info: logic_type_info -> unit; unset_orig_fieldinfo: fieldinfo -> unit; unset_orig_model_info: model_info -> unit; unset_orig_logic_var: logic_var -> unit; unset_orig_kernel_function: kernel_function -> unit; unset_orig_fundec: fundec -> unit; (* copy fields that can referenced in other places of the AST*) memo_stmt: stmt -> stmt; memo_varinfo: varinfo -> varinfo; memo_compinfo: compinfo -> compinfo; memo_model_info: model_info -> model_info; memo_enuminfo: enuminfo -> enuminfo; memo_enumitem: enumitem -> enumitem; memo_typeinfo: typeinfo -> typeinfo; memo_logic_info: logic_info -> logic_info; memo_logic_type_info: logic_type_info -> logic_type_info; memo_fieldinfo: fieldinfo -> fieldinfo; memo_logic_var: logic_var -> logic_var; memo_kernel_function: kernel_function -> kernel_function; memo_fundec: fundec -> fundec; (* is the behavior a copy behavior *) is_copy_behavior: bool; is_fresh_behavior: bool; project: Project.t option; (* reset memoizing tables *) reset_behavior_varinfo: unit -> unit; reset_behavior_compinfo: unit -> unit; reset_behavior_enuminfo: unit -> unit; reset_behavior_enumitem: unit -> unit; reset_behavior_typeinfo: unit -> unit; reset_behavior_logic_info: unit -> unit; reset_behavior_logic_type_info: unit -> unit; reset_behavior_fieldinfo: unit -> unit; reset_behavior_model_info: unit -> unit; reset_behavior_stmt: unit -> unit; reset_logic_var: unit -> unit; reset_behavior_kernel_function: unit -> unit; reset_behavior_fundec: unit -> unit; (* iterates over tables *) iter_visitor_varinfo: (varinfo -> varinfo -> unit) -> unit; iter_visitor_compinfo: (compinfo -> compinfo -> unit) -> unit; iter_visitor_enuminfo: (enuminfo -> enuminfo -> unit) -> unit; iter_visitor_enumitem: (enumitem -> enumitem -> unit) -> unit; iter_visitor_typeinfo: (typeinfo -> typeinfo -> unit) -> unit; iter_visitor_stmt: (stmt -> stmt -> unit) -> unit; iter_visitor_logic_info: (logic_info -> logic_info -> unit) -> unit; iter_visitor_logic_type_info: (logic_type_info -> logic_type_info -> unit) -> unit; iter_visitor_fieldinfo: (fieldinfo -> fieldinfo -> unit) -> unit; iter_visitor_model_info: (model_info -> model_info -> unit) -> unit; iter_visitor_logic_var: (logic_var -> logic_var -> unit) -> unit; iter_visitor_kernel_function: (kernel_function -> kernel_function -> unit) -> unit; iter_visitor_fundec: (fundec -> fundec -> unit) -> unit; (* folds over tables *) fold_visitor_varinfo: 'a.(varinfo -> varinfo -> 'a -> 'a) -> 'a -> 'a; fold_visitor_compinfo: 'a.(compinfo -> compinfo -> 'a -> 'a) -> 'a -> 'a; fold_visitor_enuminfo: 'a.(enuminfo -> enuminfo -> 'a -> 'a) -> 'a -> 'a; fold_visitor_enumitem: 'a.(enumitem -> enumitem -> 'a -> 'a) -> 'a -> 'a; fold_visitor_typeinfo: 'a.(typeinfo -> typeinfo -> 'a -> 'a) -> 'a -> 'a; fold_visitor_stmt: 'a.(stmt -> stmt -> 'a -> 'a) -> 'a -> 'a; fold_visitor_logic_info: 'a. (logic_info -> logic_info -> 'a -> 'a) -> 'a -> 'a; fold_visitor_logic_type_info: 'a.(logic_type_info -> logic_type_info -> 'a -> 'a) -> 'a -> 'a; fold_visitor_fieldinfo: 'a.(fieldinfo -> fieldinfo -> 'a -> 'a) -> 'a -> 'a; fold_visitor_model_info: 'a. (model_info -> model_info -> 'a -> 'a) -> 'a -> 'a; fold_visitor_logic_var: 'a.(logic_var -> logic_var -> 'a -> 'a) -> 'a -> 'a; fold_visitor_kernel_function: 'a.(kernel_function -> kernel_function -> 'a -> 'a) -> 'a -> 'a; fold_visitor_fundec: 'a.(fundec -> fundec -> 'a -> 'a) -> 'a -> 'a; } let id = Extlib.id let alphabetaunit _ _ = () let alphabetabeta _ x = x let unitunit: unit -> unit = id let alphaunit _ = () let inplace () = { cfile = id; get_compinfo = id; get_fieldinfo = id; get_model_info = id; get_enuminfo = id; get_enumitem = id; get_typeinfo = id; get_varinfo = id; get_logic_var = id; get_stmt = id; get_logic_info = id; get_logic_type_info = id; get_kernel_function = id; get_fundec = id; get_original_compinfo = id; get_original_fieldinfo = id; get_original_model_info = id; get_original_enuminfo = id; get_original_enumitem = id; get_original_typeinfo = id; get_original_varinfo = id; get_original_logic_var = id; get_original_stmt = id; get_original_logic_info = id; get_original_logic_type_info = id; get_original_kernel_function = id; get_original_fundec = id; cinitinfo = id; cblock = id; cfunspec = id; cfunbehavior = id; cidentified_term = id; cidentified_predicate = id; ccode_annotation = id; cexpr = id; is_copy_behavior = false; is_fresh_behavior = false; project = None; memo_varinfo = id; memo_compinfo = id; memo_enuminfo = id; memo_enumitem = id; memo_typeinfo = id; memo_logic_info = id; memo_logic_type_info = id; memo_stmt = id; memo_fieldinfo = id; memo_model_info = id; memo_logic_var = id; memo_kernel_function = id; memo_fundec = id; set_varinfo = alphabetaunit; set_compinfo = alphabetaunit; set_enuminfo = alphabetaunit; set_enumitem = alphabetaunit; set_typeinfo = alphabetaunit; set_logic_info = alphabetaunit; set_logic_type_info = alphabetaunit; set_stmt = alphabetaunit; set_fieldinfo = alphabetaunit; set_model_info = alphabetaunit; set_logic_var = alphabetaunit; set_kernel_function = alphabetaunit; set_fundec = alphabetaunit; set_orig_varinfo = alphabetaunit; set_orig_compinfo = alphabetaunit; set_orig_enuminfo = alphabetaunit; set_orig_enumitem = alphabetaunit; set_orig_typeinfo = alphabetaunit; set_orig_logic_info = alphabetaunit; set_orig_logic_type_info = alphabetaunit; set_orig_stmt = alphabetaunit; set_orig_fieldinfo = alphabetaunit; set_orig_model_info = alphabetaunit; set_orig_logic_var = alphabetaunit; set_orig_kernel_function = alphabetaunit; set_orig_fundec = alphabetaunit; unset_varinfo = alphaunit; unset_compinfo = alphaunit; unset_enuminfo = alphaunit; unset_enumitem = alphaunit; unset_typeinfo = alphaunit; unset_logic_info = alphaunit; unset_logic_type_info = alphaunit; unset_stmt = alphaunit; unset_fieldinfo = alphaunit; unset_model_info = alphaunit; unset_logic_var = alphaunit; unset_kernel_function = alphaunit; unset_fundec = alphaunit; unset_orig_varinfo = alphaunit; unset_orig_compinfo = alphaunit; unset_orig_enuminfo = alphaunit; unset_orig_enumitem = alphaunit; unset_orig_typeinfo = alphaunit; unset_orig_logic_info = alphaunit; unset_orig_logic_type_info = alphaunit; unset_orig_stmt = alphaunit; unset_orig_fieldinfo = alphaunit; unset_orig_model_info = alphaunit; unset_orig_logic_var = alphaunit; unset_orig_kernel_function = alphaunit; unset_orig_fundec = alphaunit; reset_behavior_varinfo = unitunit; reset_behavior_compinfo = unitunit; reset_behavior_enuminfo = unitunit; reset_behavior_enumitem = unitunit; reset_behavior_typeinfo = unitunit; reset_behavior_logic_info = unitunit; reset_behavior_logic_type_info = unitunit; reset_behavior_fieldinfo = unitunit; reset_behavior_model_info = unitunit; reset_behavior_stmt = unitunit; reset_logic_var = unitunit; reset_behavior_kernel_function = unitunit; reset_behavior_fundec = unitunit; iter_visitor_varinfo = alphaunit; iter_visitor_compinfo = alphaunit; iter_visitor_enuminfo = alphaunit; iter_visitor_enumitem = alphaunit; iter_visitor_typeinfo = alphaunit; iter_visitor_stmt = alphaunit; iter_visitor_logic_info = alphaunit; iter_visitor_logic_type_info = alphaunit; iter_visitor_fieldinfo = alphaunit; iter_visitor_model_info = alphaunit; iter_visitor_logic_var = alphaunit; iter_visitor_kernel_function = alphaunit; iter_visitor_fundec = alphaunit; fold_visitor_varinfo = alphabetabeta; fold_visitor_compinfo = alphabetabeta; fold_visitor_enuminfo = alphabetabeta; fold_visitor_enumitem = alphabetabeta; fold_visitor_typeinfo = alphabetabeta; fold_visitor_stmt = alphabetabeta; fold_visitor_logic_info = alphabetabeta; fold_visitor_logic_type_info = alphabetabeta; fold_visitor_fieldinfo = alphabetabeta; fold_visitor_model_info = alphabetabeta; fold_visitor_logic_var = alphabetabeta; fold_visitor_kernel_function = alphabetabeta; fold_visitor_fundec = alphabetabeta; } let copy_visit_gen fresh prj = let varinfos = Cil_datatype.Varinfo.Hashtbl.create 103 in let compinfos = Cil_datatype.Compinfo.Hashtbl.create 17 in let enuminfos = Cil_datatype.Enuminfo.Hashtbl.create 17 in let enumitems = Cil_datatype.Enumitem.Hashtbl.create 17 in let typeinfos = Cil_datatype.Typeinfo.Hashtbl.create 17 in let logic_infos = Cil_datatype.Logic_info.Hashtbl.create 17 in let logic_type_infos = Cil_datatype.Logic_type_info.Hashtbl.create 17 in let fieldinfos = Cil_datatype.Fieldinfo.Hashtbl.create 17 in let model_infos = Cil_datatype.Model_info.Hashtbl.create 17 in let stmts = Cil_datatype.Stmt.Hashtbl.create 103 in let logic_vars = Cil_datatype.Logic_var.Hashtbl.create 17 in let kernel_functions = Cil_datatype.Kf.Hashtbl.create 17 in let fundecs = Cil_datatype.Varinfo.Hashtbl.create 17 in let orig_varinfos = Cil_datatype.Varinfo.Hashtbl.create 103 in let orig_compinfos = Cil_datatype.Compinfo.Hashtbl.create 17 in let orig_enuminfos = Cil_datatype.Enuminfo.Hashtbl.create 17 in let orig_enumitems = Cil_datatype.Enumitem.Hashtbl.create 17 in let orig_typeinfos = Cil_datatype.Typeinfo.Hashtbl.create 17 in let orig_logic_infos = Cil_datatype.Logic_info.Hashtbl.create 17 in let orig_logic_type_infos = Cil_datatype.Logic_type_info.Hashtbl.create 17 in let orig_fieldinfos = Cil_datatype.Fieldinfo.Hashtbl.create 17 in let orig_model_infos = Cil_datatype.Model_info.Hashtbl.create 17 in let orig_stmts = Cil_datatype.Stmt.Hashtbl.create 103 in let orig_logic_vars = Cil_datatype.Logic_var.Hashtbl.create 17 in let orig_kernel_functions = Cil_datatype.Kf.Hashtbl.create 17 in let orig_fundecs = Cil_datatype.Varinfo.Hashtbl.create 17 in let temp_set_logic_var x new_x = Cil_datatype.Logic_var.Hashtbl.add logic_vars x new_x in let temp_set_orig_logic_var new_x x = Cil_datatype.Logic_var.Hashtbl.add orig_logic_vars new_x x in let temp_unset_logic_var x = Cil_datatype.Logic_var.Hashtbl.remove logic_vars x in let temp_unset_orig_logic_var new_x = Cil_datatype.Logic_var.Hashtbl.remove orig_logic_vars new_x in let temp_memo_logic_var x = (* Format.printf "search for %s#%d@." x.lv_name x.lv_id;*) let res = try Cil_datatype.Logic_var.Hashtbl.find logic_vars x with Not_found -> (* Format.printf "Not found@.";*) let id = if fresh then Cil_const.new_raw_id () else x.lv_id in let new_x = { x with lv_id = id } in temp_set_logic_var x new_x; temp_set_orig_logic_var new_x x; new_x in (* Format.printf "res is %s#%d@." res.lv_name res.lv_id;*) res in let temp_set_varinfo x new_x = Cil_datatype.Varinfo.Hashtbl.add varinfos x new_x; match x.vlogic_var_assoc, new_x.vlogic_var_assoc with | None, _ | _, None -> () | Some lx, Some new_lx -> Cil_datatype.Logic_var.Hashtbl.add logic_vars lx new_lx in let temp_set_orig_varinfo new_x x = Cil_datatype.Varinfo.Hashtbl.add orig_varinfos new_x x; match new_x.vlogic_var_assoc, x.vlogic_var_assoc with | None, _ | _, None -> () | Some new_lx, Some lx -> Cil_datatype.Logic_var.Hashtbl.add orig_logic_vars new_lx lx in let temp_unset_varinfo x = Cil_datatype.Varinfo.Hashtbl.remove varinfos x; match x.vlogic_var_assoc with | None -> () | Some lx -> Cil_datatype.Logic_var.Hashtbl.remove logic_vars lx in let temp_unset_orig_varinfo new_x = Cil_datatype.Varinfo.Hashtbl.remove orig_varinfos new_x; match new_x.vlogic_var_assoc with | None -> () | Some new_lx -> Cil_datatype.Logic_var.Hashtbl.remove orig_logic_vars new_lx in let temp_memo_varinfo x = try Cil_datatype.Varinfo.Hashtbl.find varinfos x with Not_found -> let new_x = if fresh then Cil_const.copy_with_new_vid x else begin let new_x = { x with vid = x.vid } in (match x.vlogic_var_assoc with | None -> () | Some lv -> let new_lv = { lv with lv_origin = Some new_x } in new_x.vlogic_var_assoc <- Some new_lv); new_x end in temp_set_varinfo x new_x; temp_set_orig_varinfo new_x x; new_x in let temp_set_fundec f new_f = Cil_datatype.Varinfo.Hashtbl.add fundecs f.svar new_f in let temp_set_orig_fundec new_f f = Cil_datatype.Varinfo.Hashtbl.add orig_fundecs new_f.svar f in let temp_unset_fundec f = Cil_datatype.Varinfo.Hashtbl.remove fundecs f.svar in let temp_unset_orig_fundec new_f = Cil_datatype.Varinfo.Hashtbl.remove orig_fundecs new_f.svar in let temp_memo_fundec f = try Cil_datatype.Varinfo.Hashtbl.find fundecs f.svar with Not_found -> let v = temp_memo_varinfo f.svar in let new_f = { f with svar = v } in temp_set_fundec f new_f; temp_set_orig_fundec new_f f; new_f in let temp_set_kernel_function kf new_kf = Cil_datatype.Kf.Hashtbl.replace kernel_functions kf new_kf; match kf.fundec, new_kf.fundec with | Declaration(_,vi,_,_), Declaration(_,new_vi,_,_) | Declaration(_,vi,_,_), Definition({ svar = new_vi }, _) | Definition({svar = vi},_), Declaration(_,new_vi,_,_) -> temp_set_varinfo vi new_vi | Definition (fundec,_), Definition(new_fundec,_) -> temp_set_fundec fundec new_fundec in let temp_set_orig_kernel_function new_kf kf = Cil_datatype.Kf.Hashtbl.replace orig_kernel_functions new_kf kf; match new_kf.fundec, kf.fundec with | Declaration(_,new_vi,_,_), Declaration(_,vi,_,_) | Declaration(_,new_vi,_,_), Definition({ svar = vi }, _) | Definition({svar = new_vi},_), Declaration(_,vi,_,_) -> temp_set_orig_varinfo new_vi vi | Definition (new_fundec,_), Definition(fundec,_) -> temp_set_orig_fundec new_fundec fundec in let temp_unset_kernel_function kf = Cil_datatype.Kf.Hashtbl.remove kernel_functions kf; match kf.fundec with | Declaration(_,vi,_,_) -> temp_unset_varinfo vi | Definition (fundec,_) -> temp_unset_fundec fundec in let temp_unset_orig_kernel_function new_kf = Cil_datatype.Kf.Hashtbl.remove orig_kernel_functions new_kf; match new_kf.fundec with | Declaration(_,new_vi,_,_) -> temp_unset_orig_varinfo new_vi | Definition (new_fundec,_) -> temp_unset_orig_fundec new_fundec in let temp_memo_kernel_function kf = try Cil_datatype.Kf.Hashtbl.find kernel_functions kf with Not_found -> let new_kf = match kf.fundec with | Declaration (spec,vi,prms,loc) -> let new_vi = temp_memo_varinfo vi in { kf with fundec = Declaration(spec,new_vi,prms,loc) } | Definition(f,loc) -> let new_f = temp_memo_fundec f in { kf with fundec = Definition(new_f,loc) } in temp_set_kernel_function kf new_kf; temp_set_orig_kernel_function new_kf kf; new_kf in let temp_set_compinfo c new_c = Cil_datatype.Compinfo.Hashtbl.add compinfos c new_c; List.iter2 (fun f new_f -> Cil_datatype.Fieldinfo.Hashtbl.add fieldinfos f new_f) c.cfields new_c.cfields in let temp_set_orig_compinfo new_c c = Cil_datatype.Compinfo.Hashtbl.add orig_compinfos new_c c; List.iter2 (fun new_f f -> Cil_datatype.Fieldinfo.Hashtbl.add orig_fieldinfos new_f f) new_c.cfields c.cfields in let temp_unset_compinfo c = Cil_datatype.Compinfo.Hashtbl.remove compinfos c; List.iter (fun f -> Cil_datatype.Fieldinfo.Hashtbl.remove fieldinfos f) c.cfields in let temp_unset_orig_compinfo new_c = Cil_datatype.Compinfo.Hashtbl.remove orig_compinfos new_c; List.iter (fun new_f -> Cil_datatype.Fieldinfo.Hashtbl.remove orig_fieldinfos new_f) new_c.cfields in let temp_memo_compinfo c = try Cil_datatype.Compinfo.Hashtbl.find compinfos c with Not_found -> let new_c = Cil_const.copyCompInfo ~fresh c c.cname in temp_set_compinfo c new_c; temp_set_orig_compinfo new_c c; new_c in { cfile = (fun x -> { x with fileName = x.fileName }); get_compinfo = (fun x -> try Cil_datatype.Compinfo.Hashtbl.find compinfos x with Not_found -> x); get_fieldinfo = (fun x -> try Cil_datatype.Fieldinfo.Hashtbl.find fieldinfos x with Not_found -> x); get_model_info = (fun x -> try Cil_datatype.Model_info.Hashtbl.find model_infos x with Not_found -> x); get_enuminfo = (fun x -> try Cil_datatype.Enuminfo.Hashtbl.find enuminfos x with Not_found -> x); get_enumitem = (fun x -> try Cil_datatype.Enumitem.Hashtbl.find enumitems x with Not_found -> x); get_typeinfo = (fun x -> try Cil_datatype.Typeinfo.Hashtbl.find typeinfos x with Not_found -> x); get_varinfo = (fun x -> try Cil_datatype.Varinfo.Hashtbl.find varinfos x with Not_found -> x); get_stmt = (fun x -> try Cil_datatype.Stmt.Hashtbl.find stmts x with Not_found -> x); get_logic_info = (fun x -> try Cil_datatype.Logic_info.Hashtbl.find logic_infos x with Not_found -> x); get_logic_type_info = (fun x -> try Cil_datatype.Logic_type_info.Hashtbl.find logic_type_infos x with Not_found -> x); get_logic_var = (fun x -> try Cil_datatype.Logic_var.Hashtbl.find logic_vars x with Not_found -> x); get_kernel_function = (fun x -> try Cil_datatype.Kf.Hashtbl.find kernel_functions x with Not_found -> x); get_fundec = (fun x -> try Cil_datatype.Varinfo.Hashtbl.find fundecs x.svar with Not_found -> x); get_original_compinfo = (fun x -> try Cil_datatype.Compinfo.Hashtbl.find orig_compinfos x with Not_found -> x); get_original_fieldinfo = (fun x -> try Cil_datatype.Fieldinfo.Hashtbl.find orig_fieldinfos x with Not_found -> x); get_original_model_info = (fun x -> try Cil_datatype.Model_info.Hashtbl.find orig_model_infos x with Not_found -> x); get_original_enuminfo = (fun x -> try Cil_datatype.Enuminfo.Hashtbl.find orig_enuminfos x with Not_found -> x); get_original_enumitem = (fun x -> try Cil_datatype.Enumitem.Hashtbl.find orig_enumitems x with Not_found -> x); get_original_typeinfo = (fun x -> try Cil_datatype.Typeinfo.Hashtbl.find orig_typeinfos x with Not_found -> x); get_original_varinfo = (fun x -> try Cil_datatype.Varinfo.Hashtbl.find orig_varinfos x with Not_found -> x); get_original_stmt = (fun x -> try Cil_datatype.Stmt.Hashtbl.find orig_stmts x with Not_found -> x); get_original_logic_var = (fun x -> try Cil_datatype.Logic_var.Hashtbl.find orig_logic_vars x with Not_found -> x); get_original_logic_info = (fun x -> try Cil_datatype.Logic_info.Hashtbl.find orig_logic_infos x with Not_found -> x); get_original_logic_type_info = (fun x -> try Cil_datatype.Logic_type_info.Hashtbl.find orig_logic_type_infos x with Not_found -> x); get_original_kernel_function = (fun x -> try Cil_datatype.Kf.Hashtbl.find orig_kernel_functions x with Not_found -> x); get_original_fundec = (fun x -> try Cil_datatype.Varinfo.Hashtbl.find orig_fundecs x.svar with Not_found -> x); cinitinfo = (fun x -> { init = x.init }); cblock = (fun x -> { x with battrs = x.battrs }); cfunspec = (fun x -> { x with spec_behavior = x.spec_behavior}); cfunbehavior = (fun x -> { x with b_name = x.b_name}); ccode_annotation = if fresh then Logic_const.refresh_code_annotation else (fun x -> { x with annot_id = x.annot_id }); cidentified_predicate = if fresh then Logic_const.refresh_predicate else (fun x -> { x with ip_id = x.ip_id }); cidentified_term = if fresh then Logic_const.refresh_identified_term else (fun x -> { x with it_id = x.it_id}); cexpr = (fun x -> let id = if fresh then Cil_const.Eid.next () else x.eid in { x with eid = id }); is_copy_behavior = true; is_fresh_behavior = fresh; project = Some prj; reset_behavior_varinfo = (fun () -> Cil_datatype.Varinfo.Hashtbl.clear varinfos; Cil_datatype.Varinfo.Hashtbl.clear orig_varinfos); reset_behavior_compinfo = (fun () -> Cil_datatype.Compinfo.Hashtbl.clear compinfos; Cil_datatype.Compinfo.Hashtbl.clear orig_compinfos); reset_behavior_enuminfo = (fun () -> Cil_datatype.Enuminfo.Hashtbl.clear enuminfos; Cil_datatype.Enuminfo.Hashtbl.clear orig_enuminfos); reset_behavior_enumitem = (fun () -> Cil_datatype.Enumitem.Hashtbl.clear enumitems; Cil_datatype.Enumitem.Hashtbl.clear orig_enumitems); reset_behavior_typeinfo = (fun () -> Cil_datatype.Typeinfo.Hashtbl.clear typeinfos; Cil_datatype.Typeinfo.Hashtbl.clear orig_typeinfos); reset_behavior_logic_info = (fun () -> Cil_datatype.Logic_info.Hashtbl.clear logic_infos; Cil_datatype.Logic_info.Hashtbl.clear orig_logic_infos); reset_behavior_logic_type_info = (fun () -> Cil_datatype.Logic_type_info.Hashtbl.clear logic_type_infos; Cil_datatype.Logic_type_info.Hashtbl.clear orig_logic_type_infos); reset_behavior_fieldinfo = (fun () -> Cil_datatype.Fieldinfo.Hashtbl.clear fieldinfos; Cil_datatype.Fieldinfo.Hashtbl.clear orig_fieldinfos); reset_behavior_model_info = (fun () -> Cil_datatype.Model_info.Hashtbl.clear model_infos; Cil_datatype.Model_info.Hashtbl.clear orig_model_infos); reset_behavior_stmt = (fun () -> Cil_datatype.Stmt.Hashtbl.clear stmts; Cil_datatype.Stmt.Hashtbl.clear orig_stmts); reset_logic_var = (fun () -> Cil_datatype.Logic_var.Hashtbl.clear logic_vars; Cil_datatype.Logic_var.Hashtbl.clear orig_logic_vars); reset_behavior_kernel_function = (fun () -> Cil_datatype.Kf.Hashtbl.clear kernel_functions; Cil_datatype.Kf.Hashtbl.clear orig_kernel_functions); reset_behavior_fundec = (fun () -> Cil_datatype.Varinfo.Hashtbl.clear fundecs; Cil_datatype.Varinfo.Hashtbl.clear orig_fundecs); memo_varinfo = temp_memo_varinfo; memo_compinfo = temp_memo_compinfo; memo_enuminfo = (fun x -> try Cil_datatype.Enuminfo.Hashtbl.find enuminfos x with Not_found -> let new_x = { x with ename = x.ename } in Cil_datatype.Enuminfo.Hashtbl.add enuminfos x new_x; Cil_datatype.Enuminfo.Hashtbl.add orig_enuminfos new_x x; new_x); memo_enumitem = (fun x -> try Cil_datatype.Enumitem.Hashtbl.find enumitems x with Not_found -> let new_x = { x with einame = x.einame } in Cil_datatype.Enumitem.Hashtbl.add enumitems x new_x; Cil_datatype.Enumitem.Hashtbl.add orig_enumitems new_x x; new_x); memo_typeinfo = (fun x -> try Cil_datatype.Typeinfo.Hashtbl.find typeinfos x with Not_found -> let new_x = { x with tname = x.tname } in Cil_datatype.Typeinfo.Hashtbl.add typeinfos x new_x; Cil_datatype.Typeinfo.Hashtbl.add orig_typeinfos new_x x; new_x); memo_logic_info = (fun x -> try Cil_datatype.Logic_info.Hashtbl.find logic_infos x with Not_found -> let new_v = temp_memo_logic_var x.l_var_info in let new_x = { x with l_var_info = new_v } in Cil_datatype.Logic_info.Hashtbl.add logic_infos x new_x; Cil_datatype.Logic_info.Hashtbl.add orig_logic_infos new_x x; new_x); memo_logic_type_info = (fun x -> try Cil_datatype.Logic_type_info.Hashtbl.find logic_type_infos x with Not_found -> let new_x = { x with lt_name = x.lt_name } in Cil_datatype.Logic_type_info.Hashtbl.add logic_type_infos x new_x; Cil_datatype.Logic_type_info.Hashtbl.add orig_logic_type_infos new_x x; new_x); memo_stmt = (fun x -> try Cil_datatype.Stmt.Hashtbl.find stmts x with Not_found -> let sid = if fresh then Cil_const.Sid.next () else x.sid in let new_x = { x with sid = sid } in Cil_datatype.Stmt.Hashtbl.add stmts x new_x; Cil_datatype.Stmt.Hashtbl.add orig_stmts new_x x; new_x); memo_fieldinfo = (fun x -> try Cil_datatype.Fieldinfo.Hashtbl.find fieldinfos x with Not_found -> let _ = temp_memo_compinfo x.fcomp in (* memo_compinfo fills the field correspondence table as well *) let new_x = Cil_datatype.Fieldinfo.Hashtbl.find fieldinfos x in Cil_datatype.Fieldinfo.Hashtbl.add fieldinfos x new_x; Cil_datatype.Fieldinfo.Hashtbl.add orig_fieldinfos new_x x; new_x); memo_model_info = (fun x -> try Cil_datatype.Model_info.Hashtbl.find model_infos x with Not_found -> let new_x = { x with mi_name = x.mi_name } in Cil_datatype.Model_info.Hashtbl.add model_infos x new_x; Cil_datatype.Model_info.Hashtbl.add orig_model_infos new_x x; new_x ); memo_logic_var = temp_memo_logic_var; memo_kernel_function = temp_memo_kernel_function; memo_fundec = temp_memo_fundec; set_varinfo = temp_set_varinfo; set_compinfo = temp_set_compinfo; set_enuminfo = Cil_datatype.Enuminfo.Hashtbl.replace enuminfos; set_enumitem = Cil_datatype.Enumitem.Hashtbl.replace enumitems; set_typeinfo = Cil_datatype.Typeinfo.Hashtbl.replace typeinfos; set_logic_info = Cil_datatype.Logic_info.Hashtbl.replace logic_infos; set_logic_type_info = Cil_datatype.Logic_type_info.Hashtbl.replace logic_type_infos; set_stmt = Cil_datatype.Stmt.Hashtbl.replace stmts; set_fieldinfo = Cil_datatype.Fieldinfo.Hashtbl.replace fieldinfos; set_model_info = Cil_datatype.Model_info.Hashtbl.replace model_infos; set_logic_var = temp_set_logic_var; set_kernel_function = temp_set_kernel_function; set_fundec = temp_set_fundec; set_orig_varinfo = temp_set_orig_varinfo; set_orig_compinfo = temp_set_orig_compinfo; set_orig_enuminfo = Cil_datatype.Enuminfo.Hashtbl.replace orig_enuminfos; set_orig_enumitem = Cil_datatype.Enumitem.Hashtbl.replace orig_enumitems; set_orig_typeinfo = Cil_datatype.Typeinfo.Hashtbl.replace orig_typeinfos; set_orig_logic_info = Cil_datatype.Logic_info.Hashtbl.replace orig_logic_infos; set_orig_logic_type_info = Cil_datatype.Logic_type_info.Hashtbl.replace orig_logic_type_infos; set_orig_stmt = Cil_datatype.Stmt.Hashtbl.replace orig_stmts; set_orig_fieldinfo = Cil_datatype.Fieldinfo.Hashtbl.replace orig_fieldinfos; set_orig_model_info = Cil_datatype.Model_info.Hashtbl.replace orig_model_infos; set_orig_logic_var = temp_set_orig_logic_var; set_orig_kernel_function = temp_set_orig_kernel_function; set_orig_fundec = temp_set_orig_fundec; unset_varinfo = temp_unset_varinfo; unset_compinfo = temp_unset_compinfo; unset_enuminfo = Cil_datatype.Enuminfo.Hashtbl.remove enuminfos; unset_enumitem = Cil_datatype.Enumitem.Hashtbl.remove enumitems; unset_typeinfo = Cil_datatype.Typeinfo.Hashtbl.remove typeinfos; unset_logic_info = Cil_datatype.Logic_info.Hashtbl.remove logic_infos; unset_logic_type_info = Cil_datatype.Logic_type_info.Hashtbl.remove logic_type_infos; unset_stmt = Cil_datatype.Stmt.Hashtbl.remove stmts; unset_fieldinfo = Cil_datatype.Fieldinfo.Hashtbl.remove fieldinfos; unset_model_info = Cil_datatype.Model_info.Hashtbl.remove model_infos; unset_logic_var = temp_unset_logic_var; unset_kernel_function = temp_unset_kernel_function; unset_fundec = temp_unset_fundec; unset_orig_varinfo = temp_unset_orig_varinfo; unset_orig_compinfo = temp_unset_orig_compinfo; unset_orig_enuminfo = Cil_datatype.Enuminfo.Hashtbl.remove orig_enuminfos; unset_orig_enumitem = Cil_datatype.Enumitem.Hashtbl.remove orig_enumitems; unset_orig_typeinfo = Cil_datatype.Typeinfo.Hashtbl.remove orig_typeinfos; unset_orig_logic_info = Cil_datatype.Logic_info.Hashtbl.remove orig_logic_infos; unset_orig_logic_type_info = Cil_datatype.Logic_type_info.Hashtbl.remove orig_logic_type_infos; unset_orig_stmt = Cil_datatype.Stmt.Hashtbl.remove orig_stmts; unset_orig_fieldinfo = Cil_datatype.Fieldinfo.Hashtbl.remove orig_fieldinfos; unset_orig_model_info = Cil_datatype.Model_info.Hashtbl.remove orig_model_infos; unset_orig_logic_var = temp_unset_orig_logic_var; unset_orig_kernel_function = temp_unset_orig_kernel_function; unset_orig_fundec = temp_unset_orig_fundec; iter_visitor_varinfo = (fun f -> Cil_datatype.Varinfo.Hashtbl.iter f varinfos); iter_visitor_compinfo = (fun f -> Cil_datatype.Compinfo.Hashtbl.iter f compinfos); iter_visitor_enuminfo = (fun f -> Cil_datatype.Enuminfo.Hashtbl.iter f enuminfos); iter_visitor_enumitem = (fun f -> Cil_datatype.Enumitem.Hashtbl.iter f enumitems); iter_visitor_typeinfo = (fun f -> Cil_datatype.Typeinfo.Hashtbl.iter f typeinfos); iter_visitor_stmt = (fun f -> Cil_datatype.Stmt.Hashtbl.iter f stmts); iter_visitor_logic_info = (fun f -> Cil_datatype.Logic_info.Hashtbl.iter f logic_infos); iter_visitor_logic_type_info = (fun f -> Cil_datatype.Logic_type_info.Hashtbl.iter f logic_type_infos); iter_visitor_fieldinfo = (fun f -> Cil_datatype.Fieldinfo.Hashtbl.iter f fieldinfos); iter_visitor_model_info = (fun f -> Cil_datatype.Model_info.Hashtbl.iter f model_infos); iter_visitor_logic_var = (fun f -> Cil_datatype.Logic_var.Hashtbl.iter f logic_vars); iter_visitor_kernel_function = (fun f -> Cil_datatype.Kf.Hashtbl.iter f kernel_functions); iter_visitor_fundec = (fun f -> let f _ new_fundec = let old_fundec = Cil_datatype.Varinfo.Hashtbl.find orig_fundecs new_fundec.svar in f old_fundec new_fundec in Cil_datatype.Varinfo.Hashtbl.iter f fundecs); fold_visitor_varinfo = (fun f i -> Cil_datatype.Varinfo.Hashtbl.fold f varinfos i); fold_visitor_compinfo = (fun f i -> Cil_datatype.Compinfo.Hashtbl.fold f compinfos i); fold_visitor_enuminfo = (fun f i -> Cil_datatype.Enuminfo.Hashtbl.fold f enuminfos i); fold_visitor_enumitem = (fun f i -> Cil_datatype.Enumitem.Hashtbl.fold f enumitems i); fold_visitor_typeinfo = (fun f i -> Cil_datatype.Typeinfo.Hashtbl.fold f typeinfos i); fold_visitor_stmt = (fun f i -> Cil_datatype.Stmt.Hashtbl.fold f stmts i); fold_visitor_logic_info = (fun f i -> Cil_datatype.Logic_info.Hashtbl.fold f logic_infos i); fold_visitor_logic_type_info = (fun f i -> Cil_datatype.Logic_type_info.Hashtbl.fold f logic_type_infos i); fold_visitor_fieldinfo = (fun f i -> Cil_datatype.Fieldinfo.Hashtbl.fold f fieldinfos i); fold_visitor_model_info = (fun f i -> Cil_datatype.Model_info.Hashtbl.fold f model_infos i); fold_visitor_logic_var = (fun f i -> Cil_datatype.Logic_var.Hashtbl.fold f logic_vars i); fold_visitor_kernel_function = (fun f i -> Cil_datatype.Kf.Hashtbl.fold f kernel_functions i); fold_visitor_fundec = (fun f i -> let f _ new_fundec acc = let old_fundec = Cil_datatype.Varinfo.Hashtbl.find orig_fundecs new_fundec.svar in f old_fundec new_fundec acc in Cil_datatype.Varinfo.Hashtbl.fold f fundecs i); } let copy = copy_visit_gen false let refresh = copy_visit_gen true let is_copy b = b.is_copy_behavior let is_fresh b = b.is_fresh_behavior let get_project b = b.project let ccode_annotation b = b.ccode_annotation let cexpr b = b.cexpr let cidentified_predicate b = b.cidentified_predicate let cidentified_term b = b.cidentified_term let cfunbehavior b = b.cfunbehavior let cfunspec b = b.cfunspec let cblock b = b.cblock let cinitinfo b = b.cinitinfo let cfile b = b.cfile module Memo = struct let varinfo b = b.memo_varinfo let compinfo b = b.memo_compinfo let fieldinfo b = b.memo_fieldinfo let model_info b = b.memo_model_info let enuminfo b = b.memo_enuminfo let enumitem b = b.memo_enumitem let stmt b = b.memo_stmt let typeinfo b = b.memo_typeinfo let logic_info b = b.memo_logic_info let logic_type_info b = b.memo_logic_type_info let logic_var b = b.memo_logic_var let kernel_function b = b.memo_kernel_function let fundec b = b.memo_fundec end module Reset = struct let varinfo b = b.reset_behavior_varinfo () let compinfo b = b.reset_behavior_compinfo () let enuminfo b = b.reset_behavior_enuminfo () let enumitem b = b.reset_behavior_enumitem () let typeinfo b = b.reset_behavior_typeinfo () let logic_info b = b.reset_behavior_logic_info () let logic_type_info b = b.reset_behavior_logic_type_info () let fieldinfo b = b.reset_behavior_fieldinfo () let model_info b = b.reset_behavior_model_info () let stmt b = b.reset_behavior_stmt () let logic_var b = b.reset_logic_var () let kernel_function b = b.reset_behavior_kernel_function () let fundec b = b.reset_behavior_fundec () end module type Get = sig val varinfo: t -> varinfo -> varinfo val compinfo: t -> compinfo -> compinfo val enuminfo: t -> enuminfo -> enuminfo val enumitem: t -> enumitem -> enumitem val typeinfo: t -> typeinfo -> typeinfo val stmt: t -> stmt -> stmt val logic_info: t -> logic_info -> logic_info val logic_type_info: t -> logic_type_info -> logic_type_info val fieldinfo: t -> fieldinfo -> fieldinfo val model_info: t -> model_info -> model_info val logic_var: t -> logic_var -> logic_var val kernel_function: t -> kernel_function -> kernel_function val fundec: t -> fundec -> fundec end module Get = struct let varinfo b = b.get_varinfo let compinfo b = b.get_compinfo let fieldinfo b = b.get_fieldinfo let model_info b = b.get_model_info let enuminfo b = b.get_enuminfo let enumitem b = b.get_enumitem let stmt b = b.get_stmt let typeinfo b = b.get_typeinfo let logic_info b = b.get_logic_info let logic_type_info b = b.get_logic_type_info let logic_var b = b.get_logic_var let kernel_function b = b.get_kernel_function let fundec b = b.get_fundec end module Get_orig = struct let varinfo b = b.get_original_varinfo let compinfo b = b.get_original_compinfo let fieldinfo b = b.get_original_fieldinfo let model_info b = b.get_original_model_info let enuminfo b = b.get_original_enuminfo let enumitem b = b.get_original_enumitem let stmt b = b.get_original_stmt let typeinfo b = b.get_original_typeinfo let logic_info b = b.get_original_logic_info let logic_type_info b = b.get_original_logic_type_info let logic_var b = b.get_original_logic_var let kernel_function b = b.get_original_kernel_function let fundec b = b.get_original_fundec end module type Set = sig val varinfo: t -> varinfo -> varinfo -> unit val compinfo: t -> compinfo -> compinfo -> unit val enuminfo: t -> enuminfo -> enuminfo -> unit val enumitem: t -> enumitem -> enumitem -> unit val typeinfo: t -> typeinfo -> typeinfo -> unit val stmt: t -> stmt -> stmt -> unit val logic_info: t -> logic_info -> logic_info -> unit val logic_type_info: t -> logic_type_info -> logic_type_info -> unit val fieldinfo: t -> fieldinfo -> fieldinfo -> unit val model_info: t -> model_info -> model_info -> unit val logic_var: t -> logic_var -> logic_var -> unit val kernel_function: t -> kernel_function -> kernel_function -> unit val fundec: t -> fundec -> fundec -> unit end module Set = struct let varinfo b = b.set_varinfo let compinfo b = b.set_compinfo let fieldinfo b = b.set_fieldinfo let model_info b = b.set_model_info let enuminfo b = b.set_enuminfo let enumitem b = b.set_enumitem let stmt b = b.set_stmt let typeinfo b = b.set_typeinfo let logic_info b = b.set_logic_info let logic_type_info b = b.set_logic_type_info let logic_var b = b.set_logic_var let kernel_function b = b.set_kernel_function let fundec b = b.set_fundec end module Set_orig = struct let varinfo b = b.set_orig_varinfo let compinfo b = b.set_orig_compinfo let fieldinfo b = b.set_orig_fieldinfo let model_info b = b.set_model_info let enuminfo b = b.set_orig_enuminfo let enumitem b = b.set_orig_enumitem let stmt b = b.set_orig_stmt let typeinfo b = b.set_orig_typeinfo let logic_info b = b.set_orig_logic_info let logic_type_info b = b.set_orig_logic_type_info let logic_var b = b.set_orig_logic_var let kernel_function b = b.set_orig_kernel_function let fundec b = b.set_orig_fundec end module type Unset = sig val varinfo: t -> varinfo -> unit val compinfo: t -> compinfo -> unit val enuminfo: t -> enuminfo -> unit val enumitem: t -> enumitem -> unit val typeinfo: t -> typeinfo -> unit val stmt: t -> stmt -> unit val logic_info: t -> logic_info -> unit val logic_type_info: t -> logic_type_info -> unit val fieldinfo: t -> fieldinfo -> unit val model_info: t -> model_info -> unit val logic_var: t -> logic_var -> unit val kernel_function: t -> kernel_function -> unit val fundec: t -> fundec -> unit end module Unset = struct let varinfo b = b.unset_varinfo let compinfo b = b.unset_compinfo let fieldinfo b = b.unset_fieldinfo let model_info b = b.unset_model_info let enuminfo b = b.unset_enuminfo let enumitem b = b.unset_enumitem let stmt b = b.unset_stmt let typeinfo b = b.unset_typeinfo let logic_info b = b.unset_logic_info let logic_type_info b = b.unset_logic_type_info let logic_var b = b.unset_logic_var let kernel_function b = b.unset_kernel_function let fundec b = b.unset_fundec end module Unset_orig = struct let varinfo b = b.unset_orig_varinfo let compinfo b = b.unset_orig_compinfo let fieldinfo b = b.unset_orig_fieldinfo let model_info b = b.unset_model_info let enuminfo b = b.unset_orig_enuminfo let enumitem b = b.unset_orig_enumitem let stmt b = b.unset_orig_stmt let typeinfo b = b.unset_orig_typeinfo let logic_info b = b.unset_orig_logic_info let logic_type_info b = b.unset_orig_logic_type_info let logic_var b = b.unset_orig_logic_var let kernel_function b = b.unset_orig_kernel_function let fundec b = b.unset_orig_fundec end module Iter = struct let varinfo b = b.iter_visitor_varinfo let compinfo b = b.iter_visitor_compinfo let enuminfo b = b.iter_visitor_enuminfo let enumitem b = b.iter_visitor_enumitem let typeinfo b = b.iter_visitor_typeinfo let stmt b = b.iter_visitor_stmt let logic_info b = b.iter_visitor_logic_info let logic_type_info b = b.iter_visitor_logic_type_info let fieldinfo b = b.iter_visitor_fieldinfo let model_info b = b.iter_visitor_model_info let logic_var b = b.iter_visitor_logic_var let kernel_function b = b.iter_visitor_kernel_function let fundec b = b.iter_visitor_fundec end module Fold = struct let varinfo b = b.fold_visitor_varinfo let compinfo b = b.fold_visitor_compinfo let enuminfo b = b.fold_visitor_enuminfo let enumitem b = b.fold_visitor_enumitem let typeinfo b = b.fold_visitor_typeinfo let stmt b = b.fold_visitor_stmt let logic_info b = b.fold_visitor_logic_info let logic_type_info b = b.fold_visitor_logic_type_info let fieldinfo b = b.fold_visitor_fieldinfo let model_info b = b.fold_visitor_model_info let logic_var b = b.fold_visitor_logic_var let kernel_function b = b.fold_visitor_kernel_function let fundec b = b.fold_visitor_fundec end frama-c-20.0-Calcium/src/kernel_services/visitors/visitor_behavior.mli0000666000000000000000000003006113571573400023130 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Operations on visitor behaviors. @since 20.0-Calcium. *) open Cil_types type t (** How the visitor should behave in front of mutable fields: in place modification or copy of the structure. This type is abstract. Use one of the two values below in your classes. @plugin development guide *) val inplace: unit -> t (** In-place modification. Behavior of the original cil visitor. @plugin development guide *) val copy: Project.t -> t (** Makes fresh copies of the mutable structures. - preserves sharing for varinfo. - makes fresh copy of varinfo only for declarations. Variables that are only used in the visited AST are thus still shared with the original AST. This allows for instance to copy a function with its formals and local variables, and to keep the references to other globals in the function's body. @plugin development guide *) val refresh: Project.t -> t (** Makes fresh copies of the mutable structures and provides fresh id for the structures that have ids. Note that as for {!copy_visit}, only varinfo that are declared in the scope of the visit will be copied and provided with a new id. *) (** true iff the behavior provides fresh id for copied structs with id. Always [false] for an inplace visitor. *) val is_fresh: t -> bool (** true iff the behavior is a copy behavior. *) val is_copy: t -> bool val get_project: t -> Project.t option (** Reset operations on behaviors, allows to reset the tables associated to a given kind of AST elements. If you use fresh instances of visitor for each round of transformation, you should not need this module. In place modifications do not need this at all. [Reset.ast_element vis] resets the tables associated to the considered type of AST elements in [vis]. For example for {!Cil_types.varinfo}: [Reset.varinfo vis]. @since 20.0-Calcium @plugin development guide *) module Reset: sig val varinfo: t -> unit val compinfo: t -> unit val enuminfo: t -> unit val enumitem: t -> unit val typeinfo: t -> unit val stmt: t -> unit val logic_info: t -> unit val logic_type_info: t -> unit val fieldinfo: t -> unit val model_info: t -> unit val logic_var: t -> unit val kernel_function: t -> unit val fundec: t -> unit end module type Get = sig val varinfo: t -> varinfo -> varinfo val compinfo: t -> compinfo -> compinfo val enuminfo: t -> enuminfo -> enuminfo val enumitem: t -> enumitem -> enumitem val typeinfo: t -> typeinfo -> typeinfo val stmt: t -> stmt -> stmt val logic_info: t -> logic_info -> logic_info val logic_type_info: t -> logic_type_info -> logic_type_info val fieldinfo: t -> fieldinfo -> fieldinfo val model_info: t -> model_info -> model_info val logic_var: t -> logic_var -> logic_var val kernel_function: t -> kernel_function -> kernel_function val fundec: t -> fundec -> fundec end (** Get operations on behaviors, allows to get the representative of an AST element in the current state of the visitor. [Get.ast_element vis e] with [e] of type [ast_element] gets the representative of [e] in [vis]. For example for {!Cil_types.varinfo}: [Get.varinfo vis vi]. @since 20.0-Calcium @plugin development guide *) module Get: Get (** Get operations on behaviors, allows to get the original representative of an element of the {b new} AST in the curent state of the visitor. [Get_orig.ast_element vis new_e] with [new_e] of type [ast_element] gets the original representative of [new_e] in [vis]. For example for {!Cil_types.varinfo}: [Get_orig.varinfo vis new_vi]. @since 20.0-Calcium @plugin development guide *) module Get_orig: Get (** Memo operations on behaviors, allows to get a binding in the new project for the given AST element, creating one if it does not already exists. [Memo.ast_element vis e] with [e] of type [ast_element] tries to find a binding to a [e] in the new project created using [vis] in the current state, if it does not exist this binding is created. For example for {!Cil_types.varinfo}: [Memo.varinfo vis vi]. @since 20.0-Calcium @plugin development guide *) module Memo: Get module type Set = sig val varinfo: t -> varinfo -> varinfo -> unit val compinfo: t -> compinfo -> compinfo -> unit val enuminfo: t -> enuminfo -> enuminfo -> unit val enumitem: t -> enumitem -> enumitem -> unit val typeinfo: t -> typeinfo -> typeinfo -> unit val stmt: t -> stmt -> stmt -> unit val logic_info: t -> logic_info -> logic_info -> unit val logic_type_info: t -> logic_type_info -> logic_type_info -> unit val fieldinfo: t -> fieldinfo -> fieldinfo -> unit val model_info: t -> model_info -> model_info -> unit val logic_var: t -> logic_var -> logic_var -> unit val kernel_function: t -> kernel_function -> kernel_function -> unit val fundec: t -> fundec -> fundec -> unit end (** Set operations on behaviors, allows to change the representative of a given AST element in the current state of the visitor. Use with care (i.e. makes sure that the old one is not referenced anywhere in the AST, or sharing will be lost). [Set.ast_element vis e s] with [e] and [s] of type [ast_element] changes the representative of [e] to [s] in [vis]. For example, for {!Cil_types.varinfo}: [Set.varinfo vis vi new_representative]. @since 20.0-Calcium @plugin development guide *) module Set: Set (** Set operations on behaviors related to original representatives, allows to change the reference of an element of the {b new} AST in the current state of the visitor. Use with care. [Set.ast_element vis e s] with [e] and [s] of type [ast_element] changes the original representative of [e] to [s] in [vis]. For example, for {!Cil_types.varinfo}: [Set_orig.varinfo vis vi new_original_repr]. @since 20.0-Calcium *) module Set_orig: Set module type Unset = sig val varinfo: t -> varinfo -> unit val compinfo: t -> compinfo -> unit val enuminfo: t -> enuminfo -> unit val enumitem: t -> enumitem -> unit val typeinfo: t -> typeinfo -> unit val stmt: t -> stmt -> unit val logic_info: t -> logic_info -> unit val logic_type_info: t -> logic_type_info -> unit val fieldinfo: t -> fieldinfo -> unit val model_info: t -> model_info -> unit val logic_var: t -> logic_var -> unit val kernel_function: t -> kernel_function -> unit val fundec: t -> fundec -> unit end (** Operations to remove the entry associated to a given AST element in the current state of the visitor. Use with care (i.e. make sure that you will never visit again this element in the same visiting context). [Unset.ast_element vis e] with [e] of type [ast_element] removes the representative of [e] in the [ast_element] table of [vis]. For example, for {!Cil_types.varinfo}: [Unset.varinfo vis vi]. @since 20.0-Calcium *) module Unset: Unset (** Operations to remove the entry associated to a given element of the {b new} AST in the current state of the visitor. Use with care. [Unset_orig.ast_element vis e] with [e] of type [ast_element] removes the original representative of [e] in the [ast_element] table of [vis]. For example, for {!Cil_types.varinfo}: [Unset_orig.varinfo vis vi]. @since 20.0-Calcium *) module Unset_orig: Unset (** Iter operations on the table of a given type of AST elements. [Iter.ast_element vis f], iterates [f] over each pair of [ast_element] registered in [vis]. The [ast_element] in the old AST is presented to [f] first (that is, [f] looks like: [let f old_e new_e = ...]. For example for {!Cil_types.varinfo}: [Iter.varinfo vis (fun old_vi new_vi -> ())]. @since 20.0-Calcium *) module Iter: sig val varinfo: t -> (varinfo -> varinfo -> unit) -> unit val compinfo: t -> (compinfo -> compinfo -> unit) -> unit val enuminfo: t -> (enuminfo -> enuminfo -> unit) -> unit val enumitem: t -> (enumitem -> enumitem -> unit) -> unit val typeinfo: t -> (typeinfo -> typeinfo -> unit) -> unit val stmt: t -> (stmt -> stmt -> unit) -> unit val logic_info: t -> (logic_info -> logic_info -> unit) -> unit val logic_type_info: t -> (logic_type_info -> logic_type_info -> unit) -> unit val fieldinfo: t -> (fieldinfo -> fieldinfo -> unit) -> unit val model_info: t -> (model_info -> model_info -> unit) -> unit val logic_var: t -> (logic_var -> logic_var -> unit) -> unit val kernel_function: t -> (kernel_function -> kernel_function -> unit) -> unit val fundec: t -> (fundec -> fundec -> unit) -> unit end (** Fold operations on table of a given type of AST elements. [Fold.ast_element vis f], folds [f] over each pair of [ast_element] registered in [vis]. The [ast_element] in the old AST is presented to [f] first (that is, [f] looks like: [let f old_e new_e acc = ...]. For example for {!Cil_types.varinfo}: [Fold.varinfo vis (fun old_vi new_vi acc -> ... )]. @since 20.0-Calcium *) module Fold: sig val varinfo: t -> (varinfo -> varinfo -> 'a -> 'a) -> 'a -> 'a val compinfo: t -> (compinfo -> compinfo -> 'a -> 'a) -> 'a -> 'a val enuminfo: t -> (enuminfo -> enuminfo -> 'a -> 'a) -> 'a -> 'a val enumitem: t -> (enumitem -> enumitem -> 'a -> 'a) -> 'a -> 'a val typeinfo: t -> (typeinfo -> typeinfo -> 'a -> 'a) -> 'a -> 'a val stmt: t -> (stmt -> stmt -> 'a -> 'a) -> 'a -> 'a val logic_info: t -> (logic_info -> logic_info -> 'a -> 'a) -> 'a -> 'a val logic_type_info: t -> (logic_type_info -> logic_type_info -> 'a -> 'a) -> 'a -> 'a val fieldinfo: t -> (fieldinfo -> fieldinfo -> 'a -> 'a) -> 'a -> 'a val model_info: t -> (model_info -> model_info -> 'a -> 'a) -> 'a -> 'a val logic_var: t -> (logic_var -> logic_var -> 'a -> 'a) -> 'a -> 'a val kernel_function: t -> (kernel_function -> kernel_function -> 'a -> 'a) -> 'a -> 'a val fundec: t -> (fundec -> fundec -> 'a -> 'a) -> 'a -> 'a end (**/**) (** For INTERNAL USE only *) val cfile: t -> file -> file val cinitinfo: t -> initinfo -> initinfo val cblock: t -> block -> block val cfunspec: t -> funspec -> funspec val cfunbehavior: t -> funbehavior -> funbehavior val cidentified_term: t -> identified_term -> identified_term val cidentified_predicate: t -> identified_predicate -> identified_predicate val cexpr: t -> exp -> exp val ccode_annotation: t -> code_annotation -> code_annotation frama-c-20.0-Calcium/src/libraries/0000777000000000000000000000000013571573400013756 5ustar frama-c-20.0-Calcium/src/libraries/datatype/0000777000000000000000000000000013571573400015571 5ustar frama-c-20.0-Calcium/src/libraries/datatype/datatype.ml0000666000000000000000000020553713571573400017752 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ********************************************************************** *) (** {2 Type declarations} *) (* ********************************************************************** *) type 'a t = { equal: 'a -> 'a -> bool; compare: 'a -> 'a -> int; hash: 'a -> int; copy: 'a -> 'a; internal_pretty_code: Type.precedence -> Format.formatter -> 'a -> unit; pretty_code: Format.formatter -> 'a -> unit; pretty: Format.formatter -> 'a -> unit; varname: 'a -> string; mem_project: (Project_skeleton.t -> bool) -> 'a -> bool } type 'a info = 'a t module type Ty = sig type t val ty: t Type.t end module type S_no_copy = sig include Ty val name: string val descr: t Descr.t val packed_descr: Structural_descr.pack val reprs: t list val equal: t -> t -> bool val compare: t -> t -> int val hash: t -> int val pretty_code: Format.formatter -> t -> unit val internal_pretty_code: Type.precedence -> Format.formatter -> t -> unit val pretty: Format.formatter -> t -> unit val varname: t -> string val mem_project: (Project_skeleton.t -> bool) -> t -> bool end module type S = sig include S_no_copy val copy: t -> t end (* ********************************************************************** *) (** {2 Getters from a type value} *) (* ********************************************************************** *) module Infos = Type.Ty_tbl(struct type 'a t = 'a info end) let info_tbl = Infos.create 97 let internal_info s ty = try Infos.find info_tbl ty with Not_found -> Format.eprintf "Internal Datatype.info error: no %s for %S@." s (Type.name ty); assert false let equal ty = (internal_info "equal" ty).equal let compare ty = (internal_info "compare" ty).compare let hash ty = (internal_info "hash" ty).hash let copy ty = (internal_info "copy" ty).copy let internal_pretty_code ty = (internal_info "internal_pretty_code" ty).internal_pretty_code let pretty_code ty = (internal_info "pretty_code" ty).pretty_code let pretty ty = (internal_info "pretty" ty).pretty let varname ty = (internal_info "varname" ty).varname let mem_project ty = (internal_info "mem_project" ty).mem_project let info ty = internal_info "info" ty (* ********************************************************************** *) (** {2 Easy builders} *) (* ********************************************************************** *) let undefined _ = assert false let identity x = x let never_any_project _ _ = false let from_compare _ _ = assert false let from_pretty_code _ _ = assert false let pp_fail _ _ _ = assert false module type Undefined = sig val structural_descr: Structural_descr.t val equal: 'a -> 'a -> bool val compare: 'a -> 'a -> int val hash: 'a -> int val rehash: 'a -> 'a val copy: 'a -> 'a val internal_pretty_code: Type.precedence -> Format.formatter -> 'a -> unit val pretty: Format.formatter -> 'a -> unit val varname: 'a -> string val mem_project: (Project_skeleton.t -> bool) -> 'a -> bool end module Partial_undefined = struct let equal = undefined let compare = undefined let hash = undefined let copy = undefined let internal_pretty_code = undefined let pretty = undefined let varname = undefined let mem_project = undefined end module Undefined = struct include Partial_undefined let structural_descr = Structural_descr.t_unknown let rehash = undefined end module Serializable_undefined = struct include Partial_undefined let structural_descr = Structural_descr.t_abstract let rehash = identity let mem_project = never_any_project end (* ********************************************************************** *) (** {2 Generic builders} *) (* ********************************************************************** *) let valid_varname s = let r = Str.regexp "[^A-Za-z0-9_]+" in let s = Str.global_replace r "__" s in String.uncapitalize_ascii s let check f fname tname fstr = assert (if f == undefined && Type.may_use_obj () then begin Format.printf "@[Preliminary datatype check failed.@\n\ Value `%s' of type %s is required for building %s.@]@." fname tname fstr; false end else true) module Build (T: sig type t val ty: t Type.t val reprs: t list val equal: t -> t -> bool val compare: t -> t -> int val hash: t -> int val rehash: t -> t val copy: t -> t val internal_pretty_code: Type.precedence -> Format.formatter -> t -> unit val pretty: Format.formatter -> t -> unit val varname: t -> string val mem_project: (Project_skeleton.t -> bool) -> t -> bool end) = struct let name = Type.name T.ty (* let () = Format.printf "datatype %S@." name*) let equal = if T.equal == from_compare then (fun x y -> T.compare x y = 0) else T.equal let compare = T.compare let hash = T.hash let rehash = T.rehash let copy = T.copy let internal_pretty_code = T.internal_pretty_code let pretty_code = if T.internal_pretty_code == undefined then undefined else if T.internal_pretty_code == pp_fail then pp_fail Type.NoPar else fun fmt x -> (* Format.printf "pretty code %s@." name;*) let buf = Buffer.create 17 in let buffmt = Format.formatter_of_buffer buf in Format.fprintf buffmt "%a@?" (T.internal_pretty_code Type.NoPar) x; let f = Scanf.format_from_string (String.escaped (Buffer.contents buf)) "" in Format.fprintf fmt f let pretty = if T.pretty == from_pretty_code then pretty_code else T.pretty let varname = if T.varname == undefined then undefined else fun x -> valid_varname (T.varname x) let mem_project = T.mem_project let info = { equal = equal; compare = compare; hash = hash; copy = copy; internal_pretty_code = internal_pretty_code; pretty_code = pretty_code; pretty = pretty; varname = varname; mem_project = mem_project } let () = Infos.add info_tbl T.ty info let mk_full_descr d = let descr = if rehash == undefined then if Descr.is_unmarshable d then Descr.unmarshable else begin check rehash "rehash" name "descriptor"; assert false end else if rehash == identity then d else if Type.may_use_obj () then begin if Descr.is_unmarshable d then begin check undefined "structural_descr" name "descriptor"; assert false end; Descr.transform d rehash end else Descr.unmarshable in descr, Descr.pack descr let descr, packed_descr = mk_full_descr (Descr.of_type T.ty) let reprs = T.reprs (* [Type.reprs] is not usable in the "no-obj" mode *) end module type Make_input = sig type t val name: string val rehash: t -> t val structural_descr: Structural_descr.t val reprs: t list val equal: t -> t -> bool val compare: t -> t -> int val hash: t -> int val copy: t -> t val internal_pretty_code: Type.precedence -> Format.formatter -> t -> unit val pretty: Format.formatter -> t -> unit val varname: t -> string val mem_project: (Project_skeleton.t -> bool) -> t -> bool end let is_module_name s = let l = Str.split (Str.regexp "\\.") s in List.for_all (fun x -> String.length x > 0 && x.[0] = Char.uppercase_ascii x.[0]) l module Make(X: Make_input) = struct module T = struct include X let name = if is_module_name X.name then X.name ^ ".t" else X.name let ml_name = if is_module_name X.name then Some (X.name ^ ".ty") else None let ty = Type.register ~name ~ml_name X.structural_descr X.reprs end include T include Build(T) end module type Set = sig include FCSet.S include S with type t := t end module type Map = sig include FCMap.S module Key: S with type t = key module Make(Data: S) : S with type t = Data.t t end module type Hashtbl_with_descr = sig include FCHashtbl.S val structural_descr: Structural_descr.t -> Structural_descr.t end module type Hashtbl = sig include Hashtbl_with_descr val make_type: 'a Type.t -> 'a t Type.t (** @since Fluorine-20130401 *) module Key: S with type t = key module Make(Data: S) : S with type t = Data.t t end module type S_with_collections = sig include S module Set: Set with type elt = t module Map: Map with type key = t module Hashtbl: Hashtbl with type key = t end (* ****************************************************************************) (** {2 Polymorphic signature} *) (* ****************************************************************************) module type Polymorphic = sig include Type.Polymorphic module Make(T: S) : S with type t = T.t poly end (* local argument of below functors: not visible from outside *) let poly_name_ref = ref "" (* ****************************************************************************) (** {2 Polymorphic2 } *) (* ****************************************************************************) module type Polymorphic2 = sig include Type.Polymorphic2 module Make(T1: S)(T2: S) : S with type t = (T1.t, T2.t) poly end module type Polymorphic2_input = sig include Type.Polymorphic2_input val mk_equal: ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a, 'b) t -> ('a, 'b) t -> bool val mk_compare: ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('a, 'b) t -> ('a, 'b) t -> int val mk_hash: ('a -> int) -> ('b -> int) -> ('a, 'b) t -> int val map: ('a -> 'a) -> ('b -> 'b) -> ('a, 'b) t -> ('a, 'b) t val mk_internal_pretty_code: (Type.precedence -> Format.formatter -> 'a -> unit) -> (Type.precedence -> Format.formatter -> 'b -> unit) -> Type.precedence -> Format.formatter -> ('a, 'b) t -> unit val mk_pretty: (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> Format.formatter -> ('a, 'b) t -> unit val mk_varname: ('a -> string) -> ('b -> string) -> ('a, 'b) t -> string val mk_mem_project: ((Project_skeleton.t -> bool) -> 'a -> bool) -> ((Project_skeleton.t -> bool) -> 'b -> bool) -> (Project_skeleton.t -> bool) -> ('a, 'b) t -> bool end module Polymorphic2(P: Polymorphic2_input) = struct include Type.Polymorphic2(P) (* cannot declare [name] locally in instantiate since it prevents OCaml generalization *) let name = !poly_name_ref let instantiate ty1 ty2 = let res, first = instantiate ty1 ty2 in if first && name <> "" then begin let ml_name = Format.asprintf "Datatype.%s %a %a" name (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty1 (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty2 in Type.set_ml_name res (Some ml_name) end; res, first let () = poly_name_ref := "" module Make(T1: S)(T2: S) = struct module T = struct type t = (T1.t, T2.t) P.t let ty, _is_new = instantiate T1.ty T2.ty end include T include Build (struct include T let reprs = if Type.may_use_obj () then Type.reprs ty else [] let build mk f1 f2 = if mk == undefined || f1 == undefined || f2 == undefined then undefined else mk f1 f2 let compare = build P.mk_compare T1.compare T2.compare let equal = build P.mk_equal T1.equal T2.equal let hash = build P.mk_hash T1.hash T2.hash let rehash = identity let copy = let mk f1 f2 = if P.map == undefined then undefined else (* [JS 2011/05/31] No optimisation for the special case of identity, since we really want to perform a DEEP copy. *) (*if f1 == identity && f2 == identity then identity else*) P.map f1 f2 in build mk T1.copy T2.copy let internal_pretty_code = let mk f1 f2 = if f1 == pp_fail || f2 == pp_fail then pp_fail else fun p fmt x -> P.mk_internal_pretty_code f1 f2 p fmt x in build mk T1.internal_pretty_code T2.internal_pretty_code let pretty = build P.mk_pretty T1.pretty T2.pretty let varname = build P.mk_varname T1.varname T2.varname let mem_project = let mk f1 f2 = if P.mk_mem_project == undefined then undefined else if f1 == never_any_project && f2 == never_any_project then never_any_project else P.mk_mem_project f1 f2 in build mk T1.mem_project T2.mem_project end) let descr, packed_descr = mk_full_descr (Descr.of_structural ty (P.structural_descr (Descr.str T1.descr) (Descr.str T2.descr))) end end (* ****************************************************************************) (** {2 Polymorphic3 } *) (* ****************************************************************************) module type Polymorphic3 = sig include Type.Polymorphic3 module Make(T1:S)(T2:S)(T3:S) : S with type t = (T1.t, T2.t, T3.t) poly end module Polymorphic3 (P: sig include Type.Polymorphic3_input val mk_equal: ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('c -> 'c -> bool) -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> bool val mk_compare: ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('c -> 'c -> int) -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> int val mk_hash: ('a -> int) -> ('b -> int) -> ('c -> int) -> ('a, 'b, 'c) t -> int val map: ('a -> 'a) -> ('b -> 'b) -> ('c -> 'c) -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t val mk_internal_pretty_code: (Type.precedence -> Format.formatter -> 'a -> unit) -> (Type.precedence -> Format.formatter -> 'b -> unit) -> (Type.precedence -> Format.formatter -> 'c -> unit) -> Type.precedence -> Format.formatter -> ('a, 'b, 'c) t -> unit val mk_pretty: (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> (Format.formatter -> 'c -> unit) -> Format.formatter -> ('a, 'b, 'c) t -> unit val mk_varname: ('a -> string) -> ('b -> string) -> ('c -> string) -> ('a, 'b, 'c) t -> string val mk_mem_project: ((Project_skeleton.t -> bool) -> 'a -> bool) -> ((Project_skeleton.t -> bool) -> 'b -> bool) -> ((Project_skeleton.t -> bool) -> 'c -> bool) -> (Project_skeleton.t -> bool) -> ('a, 'b, 'c) t -> bool end) = struct include Type.Polymorphic3(P) (* cannot declare [name] locally in instantiate since it prevents OCaml generalization *) let name = !poly_name_ref let instantiate ty1 ty2 ty3 = let res, first = instantiate ty1 ty2 ty3 in if first && name <> "" then begin let ml_name = Format.asprintf "Datatype.%s %a %a %a" name (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty1 (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty2 (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty3 in Type.set_ml_name res (Some ml_name) end; res, first let () = poly_name_ref := "" module Make(T1: S)(T2: S)(T3: S) = struct module T = struct type t = (T1.t, T2.t, T3.t) P.t let ty, _is_new = instantiate T1.ty T2.ty T3.ty end include T include Build (struct include T let reprs = if Type.may_use_obj () then Type.reprs ty else [] let build mk f1 f2 f3 = if mk == undefined || f1 == undefined || f2 == undefined || f3 == undefined then undefined else mk f1 f2 f3 let compare = build P.mk_compare T1.compare T2.compare T3.compare let equal = build P.mk_equal T1.equal T2.equal T3.equal let hash = build P.mk_hash T1.hash T2.hash T3.hash let rehash = identity let copy = let mk f1 f2 f3 = if P.map == undefined then undefined else (* [JS 2011/05/31] No optimisation for the special case of identity, since we really want to perform a DEEP copy. *) (*if f1 == identity && f2 == identity then identity else*) P.map f1 f2 f3 in build mk T1.copy T2.copy T3.copy let internal_pretty_code = let mk f1 f2 f3 = if f1 == pp_fail || f2 == pp_fail || f3 == pp_fail then pp_fail else fun p fmt x -> P.mk_internal_pretty_code f1 f2 f3 p fmt x in build mk T1.internal_pretty_code T2.internal_pretty_code T3.internal_pretty_code let pretty = build P.mk_pretty T1.pretty T2.pretty T3.pretty let varname = build P.mk_varname T1.varname T2.varname T3.varname let mem_project = let mk f1 f2 f3 = if P.mk_mem_project == undefined then undefined else if f1 == never_any_project && f2 == never_any_project && f3 == never_any_project then never_any_project else P.mk_mem_project f1 f2 f3 in build mk T1.mem_project T2.mem_project T3.mem_project end) let descr, packed_descr = mk_full_descr (Descr.of_structural ty (P.structural_descr (Descr.str T1.descr) (Descr.str T2.descr) (Descr.str T3.descr))) end end (* ****************************************************************************) (** {2 Polymorphic4 } *) (* ****************************************************************************) module type Polymorphic4 = sig include Type.Polymorphic4 module Make(T1:S)(T2:S)(T3:S)(T4:S) : S with type t = (T1.t, T2.t, T3.t, T4.t) poly end module Polymorphic4 (P: sig include Type.Polymorphic4_input val mk_equal: ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('c -> 'c -> bool) -> ('d -> 'd -> bool) -> ('a, 'b, 'c, 'd) t -> ('a, 'b, 'c, 'd) t -> bool val mk_compare: ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('c -> 'c -> int) -> ('d -> 'd -> int) -> ('a, 'b, 'c, 'd) t -> ('a, 'b, 'c, 'd) t -> int val mk_hash: ('a -> int) -> ('b -> int) -> ('c -> int) -> ('d -> int) -> ('a, 'b, 'c, 'd) t -> int val map: ('a -> 'a) -> ('b -> 'b) -> ('c -> 'c) -> ('d -> 'd) -> ('a, 'b, 'c, 'd) t -> ('a, 'b, 'c, 'd) t val mk_internal_pretty_code: (Type.precedence -> Format.formatter -> 'a -> unit) -> (Type.precedence -> Format.formatter -> 'b -> unit) -> (Type.precedence -> Format.formatter -> 'c -> unit) -> (Type.precedence -> Format.formatter -> 'd -> unit) -> Type.precedence -> Format.formatter -> ('a, 'b, 'c, 'd) t -> unit val mk_pretty: (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> (Format.formatter -> 'c -> unit) -> (Format.formatter -> 'd -> unit) -> Format.formatter -> ('a, 'b, 'c, 'd) t -> unit val mk_varname: ('a -> string) -> ('b -> string) -> ('c -> string) -> ('d -> string) -> ('a, 'b, 'c, 'd) t -> string val mk_mem_project: ((Project_skeleton.t -> bool) -> 'a -> bool) -> ((Project_skeleton.t -> bool) -> 'b -> bool) -> ((Project_skeleton.t -> bool) -> 'c -> bool) -> ((Project_skeleton.t -> bool) -> 'd -> bool) -> (Project_skeleton.t -> bool) -> ('a, 'b, 'c, 'd) t -> bool end) = struct include Type.Polymorphic4(P) (* cannot declare [name] locally in instantiate since it prevents OCaml generalization *) let name = !poly_name_ref let instantiate ty1 ty2 ty3 ty4 = let res, first = instantiate ty1 ty2 ty3 ty4 in if first && name <> "" then begin let ml_name = Format.asprintf "Datatype.%s %a %a %a %a" name (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty1 (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty2 (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty3 (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty4 in Type.set_ml_name res (Some ml_name) end; res, first let () = poly_name_ref := "" module Make(T1: S)(T2: S)(T3: S)(T4: S) = struct module T = struct type t = (T1.t, T2.t, T3.t, T4.t) P.t let ty, _is_new = instantiate T1.ty T2.ty T3.ty T4.ty end include T include Build (struct include T let reprs = if Type.may_use_obj () then Type.reprs ty else [] let build mk f1 f2 f3 f4 = if mk == undefined || f1 == undefined || f2 == undefined || f3 == undefined || f4 == undefined then undefined else mk f1 f2 f3 f4 let compare = build P.mk_compare T1.compare T2.compare T3.compare T4.compare let equal = build P.mk_equal T1.equal T2.equal T3.equal T4.equal let hash = build P.mk_hash T1.hash T2.hash T3.hash T4.hash let rehash = identity let copy = let mk f1 f2 f3 f4 = if P.map == undefined then undefined else (* [JS 2011/05/31] No optimisation for the special case of identity, since we really want to perform a DEEP copy. *) (*if f1 == identity && f2 == identity then identity else*) P.map f1 f2 f3 f4 in build mk T1.copy T2.copy T3.copy T4.copy let internal_pretty_code = let mk f1 f2 f3 f4 = if f1 == pp_fail || f2 == pp_fail || f3 == pp_fail || f4 == pp_fail then pp_fail else fun p fmt x -> P.mk_internal_pretty_code f1 f2 f3 f4 p fmt x in build mk T1.internal_pretty_code T2.internal_pretty_code T3.internal_pretty_code T4.internal_pretty_code let pretty = build P.mk_pretty T1.pretty T2.pretty T3.pretty T4.pretty let varname = build P.mk_varname T1.varname T2.varname T3.varname T4.varname let mem_project = let mk f1 f2 f3 f4 = if P.mk_mem_project == undefined then undefined else if f1 == never_any_project && f2 == never_any_project && f3 == never_any_project && f4 == never_any_project then never_any_project else P.mk_mem_project f1 f2 f3 f4 in build mk T1.mem_project T2.mem_project T3.mem_project T4.mem_project end) let descr, packed_descr = mk_full_descr (Descr.of_structural ty (P.structural_descr (Descr.str T1.descr) (Descr.str T2.descr) (Descr.str T3.descr) (Descr.str T4.descr))) end end (* ****************************************************************************) (** {3 Pair} *) (* ****************************************************************************) let () = poly_name_ref := "pair" module Pair_arg = struct type ('a, 'b) t = 'a * 'b let module_name = "Datatype.Pair" let reprs a b = [ a, b ] let structural_descr d1 d2 = Structural_descr.t_tuple [| Structural_descr.pack d1; Structural_descr.pack d2 |] let mk_equal f1 f2 (x1,x2) (y1,y2) = f1 x1 y1 && f2 x2 y2 let mk_compare f1 f2 (x1,x2 as x) (y1,y2 as y) = if x == y then 0 else let n = f1 x1 y1 in if n = 0 then f2 x2 y2 else n let mk_hash f1 f2 (x1,x2) = f1 x1 + 1351 * f2 x2 let map f1 f2 (x1,x2) = f1 x1, f2 x2 let mk_internal_pretty_code f1 f2 p fmt (x1, x2) = let pp fmt = Format.fprintf fmt "@[%a,@;%a@]" (f1 Type.Tuple) x1 (f2 Type.Tuple) x2 in Type.par p Type.Tuple fmt pp let mk_pretty f1 f2 fmt p = Format.fprintf fmt "@[%a@]" (* Type.par put the parenthesis *) (mk_internal_pretty_code (fun _ -> f1) (fun _ -> f2) Type.Basic) p let mk_varname = undefined let mk_mem_project mem1 mem2 f (x1, x2) = mem1 f x1 && mem2 f x2 end (** warning is unsound in that case: http://caml.inria.fr/mantis/view.php?id=7314#c16232 *) [@@@ warning "-60"] module rec Pair_name: sig val name: 'a Type.t -> 'b Type.t -> string end = struct let name ty1 ty2 = let arg ty = Type.par_ty_name (fun ty -> Type.Function.is_instance_of ty || Poly_pair.is_instance_of ty) ty in arg ty1 ^ " * " ^ arg ty2 end and Poly_pair : sig include Type.Polymorphic2 with type ('a,'b) poly = 'a * 'b module Make(T1: S)(T2: S) : S with type t = (T1.t, T2.t) poly end = struct (* Split the functor argument in 2 modules such that OCaml is able to safely evaluate the recursive modules *) include Polymorphic2(struct include Pair_arg include Pair_name end) end [@@@ warning "+60"] module Pair = Poly_pair.Make let pair (type typ1) (type typ2) (ty1: typ1 Type.t) (ty2: typ2 Type.t) = let module Make(X: sig type t val ty: t Type.t end) = struct type t = X.t let ty = X.ty let name = Type.name X.ty let descr = Descr.of_type X.ty let packed_descr = Descr.pack descr let reprs = Type.reprs X.ty let equal = equal X.ty let compare = compare X.ty let hash = hash X.ty let copy = copy X.ty let internal_pretty_code = internal_pretty_code X.ty let pretty_code = pretty_code X.ty let pretty = from_pretty_code let varname = varname ty let mem_project = mem_project X.ty end in let module L = Pair (Make(struct type t = typ1 let ty = ty1 end)) (Make(struct type t = typ2 let ty = ty2 end)) in L.ty (* ****************************************************************************) (** {3 Function} *) (* ****************************************************************************) module Function (T1: sig include Ty val label: (string * (unit -> t) option) option end) (T2: Ty) = struct module T = struct type t = T1.t -> T2.t let ty, _is_new = Type.Function.instantiate ?label:T1.label T1.ty T2.ty let compare = undefined let equal = (==) let hash = undefined let rehash = undefined let copy = undefined let internal_pretty_code = undefined let pretty = undefined let varname _ = "f" let mem_project = never_any_project let reprs = if Type.may_use_obj () then Type.reprs ty else [ fun _ -> assert false ] end include T include Build(T) end let func (type typ1) (type typ2) ?label (ty1: typ1 Type.t) (ty2: typ2 Type.t) = let module L = Function (struct type t = typ1 let ty = ty1 let label = label end) (struct type t = typ2 let ty = ty2 end) in L.ty let optlabel_func lab dft = func ~label:(lab, Some dft) let func2 ?label1 ty1 ?label2 ty2 ty_ret = func ?label:label1 ty1 (func ?label:label2 ty2 ty_ret) let func3 ?label1 ty1 ?label2 ty2 ?label3 ty3 ty_ret = func2 ?label1 ty1 ?label2 ty2 (func ?label:label3 ty3 ty_ret) let func4 ?label1 ty1 ?label2 ty2 ?label3 ty3 ?label4 ty4 ty_ret = func3 ?label1 ty1 ?label2 ty2 ?label3 ty3 (func ?label:label4 ty4 ty_ret) let is_function_or_pair ty = Type.Function.is_instance_of ty || Poly_pair.is_instance_of ty (* ****************************************************************************) (** {2 Polymorphic generator} *) (* ****************************************************************************) module type Polymorphic_input = sig include Type.Polymorphic_input val mk_equal: ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val mk_compare: ('a -> 'a -> int) -> 'a t -> 'a t -> int val mk_hash: ('a -> int) -> 'a t -> int val map: ('a -> 'a) -> 'a t -> 'a t val mk_internal_pretty_code: (Type.precedence -> Format.formatter -> 'a -> unit) -> Type.precedence -> Format.formatter -> 'a t -> unit val mk_pretty: (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit val mk_varname: ('a -> string) -> 'a t -> string val mk_mem_project: ((Project_skeleton.t -> bool) -> 'a -> bool) -> (Project_skeleton.t -> bool) -> 'a t -> bool end module Polymorphic_gen(P: Polymorphic_input) = struct include Type.Polymorphic(P) (* cannot declare [name] locally in instantiate since it prevents OCaml generalization *) let name = !poly_name_ref let instantiate ty = let res, first = instantiate ty in if first && name <> "" then begin let ml_name = Format.asprintf "Datatype.%s %a" name (fun fmt ty -> Type.pp_ml_name ty Type.Call fmt) ty in Type.set_ml_name res (Some ml_name) end; res, first let () = poly_name_ref := "" module Make_gen(X: S)(R: sig val rehash: X.t poly -> X.t poly end) = struct module T = struct type t = X.t P.t let ty, _is_new = instantiate X.ty end include T include Build (struct include T let build mk f = if mk == undefined || f == undefined then undefined else mk f let compare = build P.mk_compare X.compare let equal = if P.mk_equal == from_compare then if compare == undefined then undefined else from_compare else build P.mk_equal X.equal let hash = build P.mk_hash X.hash let copy = (* issue #36: do not use [build] here in order to be able to copy an empty datastructure even if the underlying function is undefined. The potential issue would be to not have the invariant that [copy] is [undefined] as soon as the underlying [copy] is; but the kernel does not rely on this behavior for that particular function (and hopefully it will not change in the future). *) if P.map == undefined then undefined else (* [JS 2011/05/31] No optimisation for the special case of identity, since we really want to perform a DEEP copy. *) (*if f == identity then identity else*) fun x -> P.map X.copy x let rehash = R.rehash let internal_pretty_code = let mk f = if f == pp_fail then pp_fail else fun p fmt x -> P.mk_internal_pretty_code f p fmt x in build mk X.internal_pretty_code let pretty = build P.mk_pretty X.pretty let varname = build P.mk_varname X.varname let mem_project = let mk f = if P.mk_mem_project == undefined then undefined else if f == never_any_project then never_any_project else fun p x -> P.mk_mem_project f p x in build mk X.mem_project let reprs = if Type.may_use_obj () then Type.reprs ty else [] end) let descr, packed_descr = mk_full_descr (Descr.of_structural ty (P.structural_descr (Descr.str X.descr))) end end module Polymorphic(P: Polymorphic_input) = struct include Polymorphic_gen(P) module Make(X: S) = Make_gen (X) (struct let rehash = if Descr.is_unmarshable X.descr then undefined else identity end) end (* ****************************************************************************) (** {3 Reference} *) (* ****************************************************************************) let () = poly_name_ref := "t_ref" module Poly_ref = Polymorphic (struct type 'a t = 'a ref let name ty = Type.par_ty_name is_function_or_pair ty ^ " ref" let module_name = "Datatype.Ref" let reprs ty = [ ref ty ] let structural_descr = Structural_descr.t_ref let mk_equal f x y = f !x !y let mk_compare f x y = if x == y then 0 else f !x !y let mk_hash f x = f !x let map f x = ref (f !x) let mk_internal_pretty_code f p fmt x = let pp fmt = Format.fprintf fmt "@[ref@;%a@]" (f Type.Call) !x in Type.par p Type.Call fmt pp let mk_pretty f fmt x = mk_internal_pretty_code (fun _ -> f) Type.Basic fmt x let mk_varname = undefined let mk_mem_project mem f x = mem f !x end) module Ref = Poly_ref.Make let t_ref (type typ) (ty: typ Type.t) = let module L = Ref(struct type t = typ let ty = ty let name = Type.name ty let descr = Descr.of_type ty let packed_descr = Descr.pack descr let reprs = Type.reprs ty let equal = equal ty let compare = compare ty let hash = hash ty let copy = copy ty let internal_pretty_code = internal_pretty_code ty let pretty_code = pretty_code ty let pretty = from_pretty_code let varname = varname ty let mem_project = mem_project ty end) in L.ty (* ****************************************************************************) (** {3 Option} *) (* ****************************************************************************) let () = poly_name_ref := "option" module Poly_option = Polymorphic (struct type 'a t = 'a option let name ty = Type.par_ty_name is_function_or_pair ty ^ " option" let module_name = "Type.Option" let reprs ty = [ Some ty ] let structural_descr = Structural_descr.t_option let mk_equal f x y = match x, y with | None, None -> true | None, Some _ | Some _, None -> false | Some x, Some y -> f x y let mk_compare f x y = if x == y then 0 else match x, y with | None, None -> 0 | None, Some _ -> 1 | Some _, None -> -1 | Some x, Some y -> f x y let mk_hash f = function None -> 0 | Some x -> f x let map f = function None -> None | Some x -> Some (f x) let mk_internal_pretty_code f p fmt = function | None -> Format.fprintf fmt "None" | Some x -> let pp fmt = Format.fprintf fmt "@[Some@;%a@]" (f Type.Call) x in Type.par p Type.Call fmt pp let mk_pretty f fmt x = mk_internal_pretty_code (fun _ -> f) Type.Basic fmt x let mk_varname = undefined let mk_mem_project mem f = function None -> false | Some x -> mem f x end) module Option = Poly_option.Make let option (type typ) (ty: typ Type.t) = let module L = Option(struct type t = typ let ty = ty let name = Type.name ty let descr = Descr.of_type ty let packed_descr = Descr.pack descr let reprs = Type.reprs ty let equal = equal ty let compare = compare ty let hash = hash ty let copy = copy ty let internal_pretty_code = internal_pretty_code ty let pretty_code = pretty_code ty let pretty = from_pretty_code let varname = varname ty let mem_project = mem_project ty end) in L.ty (* ****************************************************************************) (** {3 List} *) (* ****************************************************************************) let () = poly_name_ref := "list" module Poly_list = Polymorphic (struct type 'a t = 'a list let name ty = Type.par_ty_name is_function_or_pair ty ^ " list" let module_name = "Datatype.List" let reprs ty = [ [ ty ] ] let structural_descr = Structural_descr.t_list let mk_equal f l1 l2 = try List.for_all2 f l1 l2 with Invalid_argument _ -> false let rec mk_compare f l1 l2 = if l1 == l2 then 0 else match l1, l2 with | [], [] -> assert false | [], _ :: _ -> -1 | _ :: _, [] -> 1 | x1 :: q1, x2 :: q2 -> let n = f x1 x2 in if n = 0 then mk_compare f q1 q2 else n exception Too_long of int (* Do not spend too much time hashing long lists... *) let mk_hash f l = try snd (List.fold_left (fun (length,acc) d -> if length > 15 then raise (Too_long acc); length+1, 257 * acc + f d) (0,1) l) with Too_long n -> n let map = List.map let mk_internal_pretty_code f p fmt l = let pp fmt = Format.fprintf fmt "@[[ %t ]@]" (fun fmt -> let rec print fmt = function | [] -> () | [ x ] -> Format.fprintf fmt "%a" (f Type.List) x | x :: l -> Format.fprintf fmt "%a;@;%a" (f Type.List) x print l in print fmt l) in Type.par p Type.Basic fmt pp (* Never enclose lists in parentheses *) let mk_pretty f fmt x = mk_internal_pretty_code (fun _ -> f) Type.Basic fmt x let mk_varname = undefined let mk_mem_project mem f = List.exists (mem f) end) module Caml_list = List module List = Poly_list.Make let list (type typ) (ty: typ Type.t) = let module L = List(struct type t = typ let ty = ty let name = Type.name ty let descr = Descr.of_type ty let packed_descr = Descr.pack descr let reprs = Type.reprs ty let equal = equal ty let compare = compare ty let hash = hash ty let copy = copy ty let internal_pretty_code = internal_pretty_code ty let pretty_code = pretty_code ty let pretty = from_pretty_code let varname = varname ty let mem_project = mem_project ty end) in L.ty (* ****************************************************************************) (** {3 Arrays} *) (* ****************************************************************************) let () = poly_name_ref := "array" module Poly_array = Polymorphic (struct type 'a t = 'a array let name ty = Type.par_ty_name is_function_or_pair ty ^ " array" let module_name = "Datatype.Array" let reprs ty = [ [| ty |] ] let structural_descr = Structural_descr.t_array exception Early_exit of int let mk_equal f a1 a2 = let size = Array.length a1 in if Array.length a2 != size then false else try for i = 0 to size - 1 do if not (f a1.(i) a2.(i)) then raise (Early_exit 0) done; true with Early_exit _ -> false ;; let mk_compare f a1 a2 = if a1 == a2 then 0 else let size1 = Array.length a1 and size2 = Array.length a2 in if size1 < size2 then -1 else if size2 > size1 then 1 else try for i = 0 to size1 do let n = f a1.(i) a2.(i) in if n != 0 then raise (Early_exit n) done; 0 with Early_exit n -> n ;; (* Do not spend too much time hashing long arrays... *) let mk_hash f a = let max = max 15 ((Array.length a) - 1) in let acc = ref 1 in for i = 0 to max do acc := 257 * !acc + f a.(i) done; !acc ;; let map = Array.map let mk_internal_pretty_code f p fmt a = let pp fmt = Format.fprintf fmt "@[[| %t |]@]" (fun fmt -> let length = Array.length a in match length with | 0 -> () | _ -> (Format.fprintf fmt "%a" (f Type.List) a.(0); for i = 1 to (length - 1) do Format.fprintf fmt ";@;%a" (f Type.List) a.(i) done)) in Type.par p Type.Basic fmt pp (* Never enclose arrays in parentheses *) let mk_pretty f fmt x = mk_internal_pretty_code (fun _ -> f) Type.Basic fmt x let mk_varname = undefined let mk_mem_project mem f a = try for i = 0 to (Array.length a - 1) do if mem f a.(i) then raise (Early_exit 0) done; false with Early_exit _ -> true end) module Array = Poly_array.Make let array (type typ) (ty: typ Type.t) = let module L = Array(struct type t = typ let ty = ty let name = Type.name ty let descr = Descr.of_type ty let packed_descr = Descr.pack descr let reprs = Type.reprs ty let equal = equal ty let compare = compare ty let hash = hash ty let copy = copy ty let internal_pretty_code = internal_pretty_code ty let pretty_code = pretty_code ty let pretty = from_pretty_code let varname = varname ty let mem_project = mem_project ty end) in L.ty (* ****************************************************************************) (** {3 Queue} *) (* ****************************************************************************) let () = poly_name_ref := "queue" module Poly_queue = Polymorphic (struct type 'a t = 'a Queue.t let name ty = Type.par_ty_name is_function_or_pair ty ^ " Queue.t" let module_name = "Datatype.Queue" let reprs x = let q = Queue.create () in Queue.add x q; [ q ] let structural_descr = Structural_descr.t_queue let mk_equal = undefined let mk_compare = undefined let mk_hash = undefined let map = undefined let mk_internal_pretty_code = undefined let mk_pretty = undefined let mk_varname = undefined let mk_mem_project mem f q = try Queue.iter (fun x -> if mem f x then raise Exit) q; false with Exit -> true end) module Queue = Poly_queue.Make let queue (type typ) (ty: typ Type.t) = let module L = Queue(struct type t = typ let ty = ty let name = Type.name ty let descr = Descr.of_type ty let packed_descr = Descr.pack descr let reprs = Type.reprs ty let equal = equal ty let compare = compare ty let hash = hash ty let copy = copy ty let internal_pretty_code = internal_pretty_code ty let pretty_code = pretty_code ty let pretty = from_pretty_code let varname = varname ty let mem_project = mem_project ty end) in L.ty (* ****************************************************************************) (** {3 Set} *) (* ****************************************************************************) module type Functor_info = sig val module_name: string end (* OCaml functors are generative *) module Set (S: FCSet.S)(E: S with type t = S.elt)(Info: Functor_info) = struct let () = check E.equal "equal" E.name Info.module_name let () = check E.compare "compare" E.name Info.module_name module P = Make (struct type t = S.t let name = Info.module_name ^ "(" ^ E.name ^ ")" let structural_descr = Structural_descr.t_set_unchanged_compares (Descr.str E.descr) open S let reprs = empty :: Caml_list.map (fun r -> singleton r) E.reprs let compare = S.compare let equal = S.equal let hash = if E.hash == undefined then undefined else (fun s -> S.fold (fun e h -> 67 * E.hash e + h) s 189) let rehash = if Descr.is_unmarshable E.descr then undefined else if Descr.is_abstract E.descr then identity else fun s -> (* The key changed, rebalance the tree *) S.fold S.add s S.empty let copy = (* [JS 2011/05/31] No optimisation for the special case of identity, since we really want to perform a DEEP copy. *) (* if E.copy == identity then identity else*) fun s -> S.fold (fun x -> S.add (E.copy x)) s S.empty let internal_pretty_code p_caller fmt s = if is_empty s then Format.fprintf fmt "%s.empty" Info.module_name else let pp fmt = if S.cardinal s = 1 then Format.fprintf fmt "@[%s.singleton@;%a@]" Info.module_name (E.internal_pretty_code Type.Call) (Caml_list.hd (S.elements s)) else Format.fprintf fmt "@[List.fold_left@;\ (fun acc s -> %s.add s acc)@;%s.empty@;%a@]" Info.module_name Info.module_name (let module L = List(E) in L.internal_pretty_code Type.Call) (S.elements s) in Type.par p_caller Type.Call fmt pp let pretty fmt s = let pp_elt pp fmt v = Format.fprintf fmt "@[%a@]" pp v in Pretty_utils.pp_iter ~pre:"@[{@ " ~sep:";@ " ~suf:"@ }@]" S.iter (pp_elt E.pretty) fmt s let varname = undefined let mem_project p s = try S.iter (fun x -> if E.mem_project p x then raise Exit) s; false with Exit -> true end) include S let () = Type.set_ml_name P.ty (Some (Info.module_name ^ ".ty")) let ty = P.ty let name = P.name let descr = P.descr let packed_descr = P.packed_descr let reprs = P.reprs let equal = P.equal let compare = P.compare let hash = P.hash let internal_pretty_code = P.internal_pretty_code let pretty_code = P.pretty_code let pretty = P.pretty let varname = P.varname let mem_project = P.mem_project let copy = P.copy end (* ****************************************************************************) (** {3 Map} *) (* ****************************************************************************) module Map (M: FCMap.S)(Key: S with type t = M.key)(Info: Functor_info) = struct let () = check Key.equal "equal" Key.name Info.module_name let () = check Key.compare "compare" Key.name Info.module_name module P_gen = Polymorphic_gen (struct type 'a t = 'a M.t let name ty = Info.module_name ^ "(" ^ Key.name ^ ", " ^ Type.name ty ^ ")" let structural_descr d = Structural_descr.t_map_unchanged_compares (Descr.str Key.descr) d let module_name = Info.module_name open M let reprs r = [ Caml_list.fold_left (fun m k -> add k r m) empty Key.reprs ] let mk_compare = M.compare let mk_equal = M.equal let mk_hash = undefined let map = M.map let mk_internal_pretty_code = undefined (*f_value p_caller fmt map = (* [JS 2011/04/01] untested code! *) let pp_empty fmt = Format.fprintf fmt "%s.empty" Info.module_name in if M.is_empty map then Type.par p_caller Type.Basic fmt pp_empty else let pp fmt = Format.fprintf fmt "@[@[let map =@;%t@;<1 -2>in@]" pp_empty; M.iter (fun k v -> Format.fprintf fmt "@[let map =@;%s.add@;@[map@;%a@;%a@]@;<1 -2>in@]" Info.module_name (Key.internal_pretty_code Type.Call) k (f_value Type.Call) v) map; Format.fprintf fmt "@[map@]@]" in Type.par p_caller Type.Call fmt pp*) let mk_pretty f_value fmt map = Format.fprintf fmt "@[{{ "; M.iter (fun k v -> Format.fprintf fmt "@[@[%a@] -> @[%a@]@];@ " Key.pretty k f_value v) map; Format.fprintf fmt " }}@]" let mk_varname _ = if Key.varname == undefined then undefined else fun _ -> Format.sprintf "%s_map" Key.name let mk_mem_project = if Key.mem_project == undefined then undefined else fun mem -> if mem == never_any_project && Key.mem_project == never_any_project then never_any_project else fun p m -> try M.iter (fun k v -> if Key.mem_project p k || mem p v then raise Exit) m; false with Exit -> true end) module P = struct include P_gen module Make(X:S) = Make_gen (X) (struct let rehash = if Descr.is_unmarshable Key.descr || Descr.is_unmarshable X.descr then undefined else if Descr.is_abstract Key.descr then identity else (* the key changed: rebuild the map *) fun m -> M.fold M.add m M.empty; end) end include M module Key = Key module Make = P.Make end (* ****************************************************************************) (** {3 Hashtbl} *) (* ****************************************************************************) (* OCaml functors are generative *) module Hashtbl (H: Hashtbl_with_descr)(Key: S with type t = H.key)(Info : Functor_info) = struct let () = check Key.equal "equal" Key.name Info.module_name let () = check Key.hash "hash" Key.name Info.module_name module P_gen = Polymorphic_gen (struct type 'a t = 'a H.t let name ty = Info.module_name ^ "(" ^ Key.name ^ ", " ^ Type.name ty ^ ")" let module_name = Info.module_name let structural_descr = H.structural_descr let reprs x = [ let h = H.create 7 in Caml_list.iter (fun k -> H.add h k x) Key.reprs; h ] let mk_compare = undefined let mk_equal = from_compare let mk_hash = undefined let map f_value tbl = (* first mapping which reverses the binding order *) let h = H.create (H.length tbl) (* may be very memory-consuming *) in H.iter (fun k v -> H.add h k (f_value v)) tbl; (* copy which reverses again the binding order: so we get the right order *) let h2 = H.create (H.length tbl) (* may be very memory-consuming *) in H.iter (fun k v -> H.add h2 k v) h; h2 let mk_internal_pretty_code = undefined let mk_pretty = from_pretty_code let mk_varname = undefined let mk_mem_project = if Key.mem_project == undefined then undefined else fun mem -> if mem == never_any_project && Key.mem_project == never_any_project then never_any_project else fun p m -> try H.iter (fun k v -> if Key.mem_project p k || mem p v then raise Exit) m; false with Exit -> true end) module P = struct include P_gen module Make(X:S) = Make_gen (X) (struct let rehash = if Descr.is_unmarshable Key.descr || Descr.is_unmarshable X.descr then undefined else if Descr.is_abstract Key.descr then identity else (* the key changed: rebuild the hashtbl *) fun h -> let h' = H.create (H.length h) in H.iter (H.add h') h; h' end) end include H let make_type (type typ) (ty: typ Type.t) = let module M = P.Make(struct type t = typ include Undefined let ty = ty let name = Type.name ty let descr = Descr.of_type ty let packed_descr = Descr.pack descr let reprs = Type.reprs ty let pretty_code = undefined end) in M.ty module Key = Key module Make = P.Make end (* ****************************************************************************) (** {3 Weak hashtbl} *) (* ****************************************************************************) module type Sub_caml_weak_hashtbl = sig type data type t val create: int -> t val add: t -> data -> unit end module Initial_caml_weak = Weak module Weak(W: Sub_caml_weak_hashtbl)(D: S with type t = W.data) = struct include Make (struct include Undefined type t = W.t let name = "Weak(" ^ D.name ^ ")" let reprs = let w = W.create 0 in Caml_list.iter (W.add w) D.reprs; [ w ] end) let () = Type.set_ml_name ty None; end module Caml_weak_hashtbl(D: S) = struct let () = check D.equal "equal" D.name "Caml_weak_hashtbl" let () = check D.compare "hash" D.name "Caml_weak_hashtbl" module W = Initial_caml_weak.Make(D) include W module Datatype = Weak(W)(D) end (* ****************************************************************************) (** {2 Simple type values} *) (* ****************************************************************************) module With_collections(X: S)(Info: Functor_info) = struct module D = X include D module Set = Set (FCSet.Make(D)) (D) (struct let module_name = Info.module_name ^ ".Set" end) module Map = Map (FCMap.Make(D)) (D) (struct let module_name = Info.module_name ^ ".Map" end) module Hashtbl = Hashtbl (struct include FCHashtbl.Make(D) (* Override "sorted" iterators by using the datatype comparison function if it has been supplied *) let iter_sorted ?cmp = match cmp with | None -> if D.compare == undefined then iter_sorted ?cmp:None else iter_sorted ~cmp:D.compare | Some cmp -> iter_sorted ~cmp let fold_sorted ?cmp = match cmp with | None -> if D.compare == undefined then fold_sorted ?cmp:None else fold_sorted ~cmp:D.compare | Some cmp -> fold_sorted ~cmp let structural_descr = Structural_descr.t_hashtbl_unchanged_hashs (Descr.str D.descr) end) (D) (struct let module_name = Info.module_name ^ ".Hashtbl" end) end module Make_with_collections(X: Make_input) = With_collections (Make(X)) (struct let module_name = String.capitalize_ascii X.name end) (* ****************************************************************************) (** {2 Predefined datatype} *) (* ****************************************************************************) module Simple_type (X: sig type t val name: string val reprs: t list val pretty: Format.formatter -> t -> unit val copy: t -> t val varname: t -> string val compare: t -> t -> int val equal: t -> t -> bool end) = struct let module_name = "Datatype." ^ String.capitalize_ascii X.name include With_collections (Make(struct type t = X.t let name = X.name let reprs = X.reprs let structural_descr = Structural_descr.t_abstract let equal = X.equal let compare = X.compare let hash = FCHashtbl.hash let rehash = identity let copy = X.copy let internal_pretty_code = if X.pretty == undefined then undefined else fun _ -> X.pretty let pretty = X.pretty let varname = X.varname let mem_project = never_any_project end)) (struct let module_name = module_name end) let () = Type.set_ml_name ty (Some ("Datatype." ^ name)) end module Unit = Simple_type (struct type t = unit let name = "unit" let reprs = [ () ] let copy = identity let compare () () = 0 let equal () () = true let pretty fmt () = Format.fprintf fmt "()" let varname = undefined end) let unit = Unit.ty module Bool = Simple_type (struct type t = bool let name = "bool" let reprs = [ true ] let copy = identity let compare : bool -> bool -> int = Transitioning.Stdlib.compare let equal : bool -> bool -> bool = (=) let pretty fmt b = Format.fprintf fmt "%B" b let varname _ = "b" end) let bool = Bool.ty module Int = struct include Simple_type (struct type t = int let name = "int" let reprs = [ 2 ] let copy = identity let compare : int -> int -> int = Transitioning.Stdlib.compare let equal : int -> int -> bool = (=) let pretty fmt n = Format.fprintf fmt "%d" n let varname _ = "n" end) let compare : int -> int -> int = Transitioning.Stdlib.compare end let int = Int.ty module Int32 = Simple_type (struct type t = int32 let name = "int32" let reprs = [ Int32.zero ] let copy = identity let compare = Int32.compare let equal : int32 -> int32 -> bool = (=) let pretty fmt n = Format.fprintf fmt "%ld" n let varname _ = "n32" end) let int32 = Int32.ty module Int64 = Simple_type (struct type t = int64 let name = "int64" let reprs = [ Int64.zero ] let copy = identity let compare = Int64.compare let equal : int64 -> int64 -> bool = (=) let pretty fmt n = Format.fprintf fmt "%Ld" n let varname _ = "n64" end) let int64 = Int64.ty module Nativeint = Simple_type (struct type t = nativeint let name = "nativeint" let reprs = [ Nativeint.zero ] let copy = identity let compare = Nativeint.compare let equal : nativeint -> nativeint -> bool = (=) let pretty fmt n = Format.fprintf fmt "%nd" n let varname _ = "native_n" end) let nativeint = Nativeint.ty module Float = Simple_type (struct type t = float let name = "float" let reprs = [ 0.1 ] let copy = identity let compare : float -> float -> int = Transitioning.Stdlib.compare let equal : float -> float -> bool = (=) let pretty fmt f = Format.fprintf fmt "%f" f let varname _ = "f" end) let float = Float.ty module Char = Simple_type (struct type t = char let name = "char" let reprs = [ ' ' ] let copy = identity let compare = Char.compare let equal : char -> char -> bool = (=) let pretty fmt c = Format.fprintf fmt "%c" c let varname _ = "c" end) let char = Char.ty module String = Simple_type (struct type t = string let name = "string" let reprs = [ "" ] let copy = Extlib.id (* immutable strings do not need copy. *) let compare = String.compare let equal : string -> string -> bool = (=) let pretty fmt s = Format.fprintf fmt "%S" s let varname _ = "s" end) let string = String.ty module Formatter = Make (struct type t = Format.formatter let name = "Datatype.Formatter" let reprs = [ Format.std_formatter ] let structural_descr = Structural_descr.t_unknown let equal = undefined let compare = undefined let hash = undefined let rehash = undefined let copy = undefined let internal_pretty_code = undefined let pretty = undefined let varname _ = "fmt" let mem_project = never_any_project end) let formatter = Formatter.ty module Integer = Make_with_collections (struct type t = Integer.t let name = "Datatype.Integer" let reprs = [ Integer.zero ] let structural_descr = Structural_descr.t_abstract let equal = Integer.equal let compare = Integer.compare let hash = Integer.hash let rehash = identity let copy = identity let internal_pretty_code par fmt n = let pp fmt = Format.fprintf fmt "Integer.of_string %S" (Integer.to_string n) in Type.par par Type.Call fmt pp (* TODO: this should take into account kernel's option -big-ints-hex *) let pretty = Integer.pretty ~hexa:false let varname _ = "integer_n" let mem_project = never_any_project end) let integer = Integer.ty module Filepath = struct include Simple_type (struct type t = Filepath.Normalized.t let name = "Filepath.Normalized" let reprs = [ Filepath.Normalized.of_string "/" ] let copy = Extlib.id (* immutable strings do not need copy. *) let compare = Filepath.Normalized.compare let equal : t -> t -> bool = (=) let pretty = Filepath.Normalized.pretty let varname _ = "p" end) let dummy = Filepath.Normalized.unknown let of_string ?base_name s = Filepath.Normalized.of_string ?base_name s let pp_abs = Filepath.Normalized.pp_abs end (* ****************************************************************************) (** {3 Triple} *) (* ****************************************************************************) let () = poly_name_ref := "triple" module Triple_arg = struct type ('a, 'b, 'c) t = 'a * 'b * 'c let module_name = "Datatype.Triple" let reprs a b c = [ a, b, c ] let structural_descr d1 d2 d3 = Structural_descr.t_tuple [| Structural_descr.pack d1; Structural_descr.pack d2; Structural_descr.pack d3 |] let mk_equal f1 f2 f3 (x1,x2,x3) (y1,y2,y3) = f1 x1 y1 && f2 x2 y2 && f3 x3 y3 let mk_compare f1 f2 f3 (x1,x2,x3 as x) (y1,y2,y3 as y) = if x == y then 0 else let n = f1 x1 y1 in if n = 0 then let n = f2 x2 y2 in if n = 0 then f3 x3 y3 else n else n let mk_hash f1 f2 f3 (x1,x2,x3) = f1 x1 + 1351 * f2 x2 + 257 * f3 x3 let map f1 f2 f3 (x1,x2,x3) = f1 x1, f2 x2, f3 x3 let mk_internal_pretty_code f1 f2 f3 p fmt (x1, x2, x3) = let pp fmt = Format.fprintf fmt "@[%a,@;%a,@;%a@]" (f1 Type.Tuple) x1 (f2 Type.Tuple) x2 (f3 Type.Tuple) x3 in Type.par p Type.Tuple fmt pp let mk_pretty f1 f2 f3 fmt p = Format.fprintf fmt "@[(%a)@]" (mk_internal_pretty_code (fun _ -> f1) (fun _ -> f2) (fun _ -> f3) Type.Basic) p let mk_varname = undefined let mk_mem_project mem1 mem2 mem3 f (x1, x2, x3) = mem1 f x1 && mem2 f x2 && mem3 f x3 end (** warning is unsound in that case: http://caml.inria.fr/mantis/view.php?id=7314#c16232 *) [@@@ warning "-60"] module rec Triple_name: sig val name: 'a Type.t -> 'b Type.t -> 'c Type.t -> string end = struct let name ty1 ty2 ty3 = let arg ty = Type.par_ty_name (fun ty -> Type.Function.is_instance_of ty || Poly_pair.is_instance_of ty || Poly_triple.is_instance_of ty) ty in arg ty1 ^ " * " ^ arg ty2 ^ " * " ^ arg ty3 end and Poly_triple : sig include Type.Polymorphic3 with type ('a,'b,'c) poly = 'a * 'b * 'c module Make(T1: S)(T2: S)(T3:S) : S with type t = (T1.t, T2.t, T3.t) poly end = (* Split the functor argument in 2 modules such that OCaml is able to safely evaluate the recursive modules *) Polymorphic3(struct include Triple_arg include Triple_name end) [@@@warning "+60"] module Triple = Poly_triple.Make let triple (type typ1) (type typ2) (type typ3) (ty1: typ1 Type.t) (ty2: typ2 Type.t) (ty3: typ3 Type.t) = let module Make(X: sig type t val ty: t Type.t end) = struct type t = X.t let ty = X.ty let name = Type.name X.ty let descr = Descr.of_type X.ty let packed_descr = Descr.pack descr let reprs = Type.reprs X.ty let equal = equal X.ty let compare = compare X.ty let hash = hash X.ty let copy = copy X.ty let internal_pretty_code = internal_pretty_code X.ty let pretty_code = pretty_code X.ty let pretty = from_pretty_code let varname = varname ty let mem_project = mem_project X.ty end in let module L = Triple (Make(struct type t = typ1 let ty = ty1 end)) (Make(struct type t = typ2 let ty = ty2 end)) (Make(struct type t = typ3 let ty = ty3 end)) in L.ty (* ****************************************************************************) (** {3 Quadruple} *) (* ****************************************************************************) let () = poly_name_ref := "quadruple" module Quadruple_arg = struct type ('a, 'b, 'c, 'd) t = 'a * 'b * 'c * 'd let module_name = "Datatype.Quadruple" let reprs a b c d = [ a, b, c, d ] let structural_descr d1 d2 d3 d4 = Structural_descr.t_tuple [| Structural_descr.pack d1; Structural_descr.pack d2; Structural_descr.pack d3; Structural_descr.pack d4 |] let mk_equal f1 f2 f3 f4 (x1,x2,x3,x4) (y1,y2,y3,y4) = f1 x1 y1 && f2 x2 y2 && f3 x3 y3 && f4 x4 y4 let mk_compare f1 f2 f3 f4 (x1,x2,x3,x4 as x) (y1,y2,y3,y4 as y) = if x == y then 0 else let n = f1 x1 y1 in if n = 0 then let n = f2 x2 y2 in if n = 0 then let n = f3 x3 y3 in if n = 0 then f4 x4 y4 else n else n else n let mk_hash f1 f2 f3 f4 (x1,x2,x3,x4) = f1 x1 + 1351 * f2 x2 + 257 * f3 x3 + 997 * f4 x4 let map f1 f2 f3 f4 (x1,x2,x3,x4) = f1 x1, f2 x2, f3 x3, f4 x4 let mk_internal_pretty_code f1 f2 f3 f4 p fmt (x1, x2, x3, x4) = let pp fmt = Format.fprintf fmt "@[%a,@;%a,@;%a,@;%a@]" (f1 Type.Tuple) x1 (f2 Type.Tuple) x2 (f3 Type.Tuple) x3 (f4 Type.Tuple) x4 in Type.par p Type.Tuple fmt pp let mk_pretty f1 f2 f3 f4 fmt p = Format.fprintf fmt "@[(%a)@]" (mk_internal_pretty_code (fun _ -> f1) (fun _ -> f2) (fun _ -> f3) (fun _ -> f4) Type.Basic) p let mk_varname = undefined let mk_mem_project mem1 mem2 mem3 mem4 f (x1, x2, x3, x4) = mem1 f x1 && mem2 f x2 && mem3 f x3 && mem4 f x4 end (** warning is unsound in that case: http://caml.inria.fr/mantis/view.php?id=7314#c16232 *) [@@@ warning "-60"] module rec Quadruple_name: sig val name: 'a Type.t -> 'b Type.t -> 'c Type.t -> 'd Type.t -> string end = struct let name ty1 ty2 ty3 ty4 = let arg ty = Type.par_ty_name (fun ty -> Type.Function.is_instance_of ty || Poly_pair.is_instance_of ty || Poly_triple.is_instance_of ty || Poly_quadruple.is_instance_of ty) ty in arg ty1 ^ " * " ^ arg ty2 ^ " * " ^ arg ty3 ^ " * " ^ arg ty4 end and Poly_quadruple : sig include Type.Polymorphic4 with type ('a,'b,'c,'d) poly = 'a * 'b * 'c * 'd module Make(T1: S)(T2: S)(T3:S)(T4:S) : S with type t = (T1.t, T2.t, T3.t, T4.t) poly end = struct (* Split the functor argument in 2 modules such that OCaml is able to safely evaluate the recursive modules *) include Polymorphic4 (struct include Quadruple_arg include Quadruple_name end) end [@@@ warning "+60"] module Quadruple = Poly_quadruple.Make let quadruple (type typ1) (type typ2) (type typ3) (type typ4) (ty1: typ1 Type.t) (ty2: typ2 Type.t) (ty3: typ3 Type.t) (ty4: typ4 Type.t) = let module Make(X: sig type t val ty: t Type.t end) = struct type t = X.t let ty = X.ty let name = Type.name X.ty let descr = Descr.of_type X.ty let packed_descr = Descr.pack descr let reprs = Type.reprs X.ty let equal = equal X.ty let compare = compare X.ty let hash = hash X.ty let copy = copy X.ty let internal_pretty_code = internal_pretty_code X.ty let pretty_code = pretty_code X.ty let pretty = from_pretty_code let varname = varname ty let mem_project = mem_project X.ty end in let module L = Quadruple (Make(struct type t = typ1 let ty = ty1 end)) (Make(struct type t = typ2 let ty = ty2 end)) (Make(struct type t = typ3 let ty = ty3 end)) (Make(struct type t = typ4 let ty = ty4 end)) in L.ty module Pair_with_collections(T1: S)(T2: S)(Info:Functor_info) = With_collections(Pair(T1)(T2))(Info) module Triple_with_collections(T1: S)(T2: S)(T3: S)(Info:Functor_info) = With_collections(Triple(T1)(T2)(T3))(Info) module Quadruple_with_collections(T1:S)(T2:S)(T3:S)(T4:S)(Info:Functor_info) = With_collections(Quadruple(T1)(T2)(T3)(T4))(Info) module Option_with_collections(T:S)(Info:Functor_info) = With_collections (Option(T))(Info) module List_with_collections(T:S)(Info:Functor_info) = With_collections (List(T))(Info) module Array_with_collections(T:S)(Info:Functor_info) = With_collections (Array(T))(Info) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/datatype/datatype.mli0000666000000000000000000005651613571573400020124 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** A datatype provides useful values for types. It is a high-level API on top of module {!Type}. @since Carbon-20101201 @plugin development guide *) (* ********************************************************************** *) (** {2 Type declarations} *) (* ********************************************************************** *) (** Values associated to each datatype. Some others are provided directly in module {!Type}. *) type 'a t = private { equal: 'a -> 'a -> bool; compare: 'a -> 'a -> int; hash: 'a -> int; copy: 'a -> 'a; internal_pretty_code: Type.precedence -> Format.formatter -> 'a -> unit; pretty_code: Format.formatter -> 'a -> unit; pretty: Format.formatter -> 'a -> unit; varname: 'a -> string; mem_project: (Project_skeleton.t -> bool) -> 'a -> bool } (** A type with its type value. *) module type Ty = sig type t val ty: t Type.t end (** All values associated to a datatype, excepted [copy]. *) module type S_no_copy = sig include Ty val name: string (** Unique name of the datatype. *) val descr: t Descr.t (** Datatype descriptor. *) val packed_descr: Structural_descr.pack (** Packed version of the descriptor. *) val reprs: t list (** List of representants of the descriptor. *) val equal: t -> t -> bool (** Equality: same spec than [Pervasives.(=)]. *) val compare: t -> t -> int (** Comparison: same spec than [Pervasives.compare]. *) val hash: t -> int (** Hash function: same spec than [Hashtbl.hash]. *) val pretty_code: Format.formatter -> t -> unit (** Pretty print each value in an ML-like style: the result must be a valid OCaml expression. Only useful for journalisation. *) val internal_pretty_code: Type.precedence -> Format.formatter -> t -> unit (** Same spec than [pretty_code], but must take care of the precedence of the context in order to put parenthesis if required. See {!Type.par}. *) val pretty: Format.formatter -> t -> unit (** Pretty print each value in an user-friendly way. *) val varname: t -> string (** A good prefix name to use for an OCaml variable of this type. Only useful for journalisation. *) val mem_project: (Project_skeleton.t -> bool) -> t -> bool (** [mem_project f x] must return [true] iff there is a value [p] of type [Project.t] in [x] such that [f p] returns [true]. *) end (** All values associated to a datatype. *) module type S = sig include S_no_copy val copy: t -> t (** Deep copy: no possible sharing between [x] and [copy x]. *) end (* ********************************************************************** *) (** {2 Getters from a type value} *) (* ********************************************************************** *) val info: 'a Type.t -> 'a t val equal: 'a Type.t -> 'a -> 'a -> bool val compare: 'a Type.t -> 'a -> 'a -> int val hash: 'a Type.t -> 'a -> int val copy: 'a Type.t -> 'a -> 'a val internal_pretty_code: 'a Type.t -> Type.precedence -> Format.formatter -> 'a -> unit val pretty_code: 'a Type.t -> Format.formatter -> 'a -> unit val pretty: 'a Type.t -> Format.formatter -> 'a -> unit val varname: 'a Type.t -> 'a -> string val mem_project: 'a Type.t -> (Project_skeleton.t -> bool) -> 'a -> bool (* ********************************************************************** *) (** {2 Easy builders} *) (* ********************************************************************** *) val undefined: 'a -> 'b (** Must be used if you don't want to implement a required function. @plugin development guide *) val identity: 'a -> 'a (** Must be used if you want to implement a required function by [fun x -> x]. Only useful for implementing [rehash] and [copy]. @plugin development guide *) val from_compare: 'a -> 'a -> bool (** Must be used for [equal] in order to implement it by [compare x y = 0] (with your own [compare] function). *) val from_pretty_code: Format.formatter -> 'a -> unit (** Must be used for [pretty] in order to implement it by [pretty_code] provided by the datatype from your own [internal_pretty_code] function. *) val never_any_project: (Project_skeleton.t -> bool) -> 'a -> bool (** Must be used for [mem_project] if values of your type does never contain any project. @plugin development guide *) val pp_fail: Type.precedence -> Format.formatter -> 'a -> unit (** Must be used for [internal_pretty_code] if this pretty-printer must fail only when called. @plugin development guide *) (** Sub-signature of {!S}. @plugin development guide *) module type Undefined = sig val structural_descr: Structural_descr.t val equal: 'a -> 'a -> bool val compare: 'a -> 'a -> int val hash: 'a -> int val rehash: 'a -> 'a val copy: 'a -> 'a val internal_pretty_code: Type.precedence -> Format.formatter -> 'a -> unit val pretty: Format.formatter -> 'a -> unit val varname: 'a -> string val mem_project: (Project_skeleton.t -> bool) -> 'a -> bool end (** Each values in these modules are undefined. The usual way to use it is: [module X: Datatype.S = struct include Undefined type t = ... let reprs = ... let name = ... let mem_project = ... (* Usually, Datatype.never_any_project *) (* define only useful functions for this datatype *) end] *) module Undefined: Undefined (** Same as {!Undefined}, but the type is supposed to be marshallable by the standard OCaml way (in particular, no hash-consing or projects inside the type). @plugin development guide *) module Serializable_undefined: Undefined (* ********************************************************************** *) (** {2 Generic builders} *) (* ********************************************************************** *) (** Input signature of {!Make} and {!Make_with_collections}. Values to implement in order to get a datatype. Feel free to use easy builders (see above) for easy implementation. *) module type Make_input = sig type t (** Type for this datatype *) val name: string (** Unique name for this datatype. If the name is a valid ocaml module name, then it must really corresponds to the module name you are defining by applying the functor. Otherwise, put the name you want as long as it does not clash with any other datatype name. *) val rehash: t -> t (** How to rehashconsed values. Must be {!identity} if you do not use hashconsing. Only useful for unmarshaling (use {!undefined} for unmarshable type). *) (** All the above operations have the same semantics than the corresponding value specified in module type {!S}. *) val structural_descr: Structural_descr.t val reprs: t list (** Must be non-empty.*) val equal: t -> t -> bool val compare: t -> t -> int val hash: t -> int val copy: t -> t val internal_pretty_code: Type.precedence -> Format.formatter -> t -> unit val pretty: Format.formatter -> t -> unit val varname: t -> string val mem_project: (Project_skeleton.t -> bool) -> t -> bool end (** Generic datatype builder. @plugin development guide *) module Make(X: Make_input): S with type t = X.t (** Additional info for building [Set], [Map] and [Hashtbl]. *) module type Functor_info = sig val module_name: string (** Must be a valid OCaml module name corresponding to the module name you are defining by applying the functor. *) end (** A standard OCaml set signature extended with datatype operations. *) module type Set = sig include FCSet.S include S with type t := t end (** A standard OCaml map signature extended with datatype operations. *) module type Map = sig include FCMap.S module Key: S with type t = key (** Datatype for the keys of the map. *) module Make(Data: S) : S with type t = Data.t t (** Build a datatype of the map according to the datatype of values in the map. *) end (** Marshallable collectors with hashtbl-like interface. *) module type Hashtbl_with_descr = sig include FCHashtbl.S val structural_descr: Structural_descr.t -> Structural_descr.t end (** A standard OCaml hashtbl signature extended with datatype operations. *) module type Hashtbl = sig include Hashtbl_with_descr val make_type: 'a Type.t -> 'a t Type.t (** @since Fluorine-20130401 *) module Key: S with type t = key (** Datatype for the keys of the hashtbl. *) module Make(Data: S) : S with type t = Data.t t (** Build a datatype of the hashtbl according to the datatype of values in the hashtbl. *) end (** A datatype for a type [t] extended with predefined set, map and hashtbl over [t]. *) module type S_with_collections = sig include S module Set: Set with type elt = t module Map: Map with type key = t module Hashtbl: Hashtbl with type key = t end (** Generic comparable datatype builder: functions [equal], [compare] and [hash] must not be {!undefined}. *) module Make_with_collections(X: Make_input): S_with_collections with type t = X.t (** Add sets, maps and hashtables modules to an existing datatype, provided the [equal], [compare] and [hash] functions are not {!undefined}. @since Oxygen-20120901 *) module With_collections(X: S)(Info: Functor_info): S_with_collections with type t = X.t (* ****************************************************************************) (** {2 Predefined datatype} *) (* ****************************************************************************) module Unit: S_with_collections with type t = unit val unit: unit Type.t (** @plugin development guide *) (** @plugin development guide *) module Bool: S_with_collections with type t = bool val bool: bool Type.t (** @plugin development guide *) (** @plugin development guide *) module Int: S_with_collections with type t = int val int: int Type.t (** @plugin development guide *) module Int32: S_with_collections with type t = int32 val int32: int32 Type.t module Int64: S_with_collections with type t = int64 val int64: int64 Type.t module Nativeint: S_with_collections with type t = nativeint val nativeint: nativeint Type.t module Float: S_with_collections with type t = float val float: float Type.t module Char: S_with_collections with type t = char val char: char Type.t (** @plugin development guide *) (** @plugin development guide *) module String: S_with_collections with type t = string val string: string Type.t (** @plugin development guide *) module Formatter: S with type t = Format.formatter val formatter: Format.formatter Type.t (* module Big_int: S_with_collections with type t = Integer.t *) (* val big_int: Big_int.t Type.t *) (** @deprecated use Integer instead. *) module Integer: S_with_collections with type t = Integer.t val integer: Integer.t Type.t (** Type-safe strings representing normalized filepaths. See module {!Filepath.Normalized}. @since 18.0-Argon *) module Filepath: sig include S_with_collections with type t = Filepath.Normalized.t val of_string: ?base_name:string -> string -> t val pp_abs: Format.formatter -> t -> unit val dummy: t end (* ****************************************************************************) (** {2 Generic functors for polymorphic types} *) (* ****************************************************************************) (** Output signature of {!Polymorphic}. *) module type Polymorphic = sig include Type.Polymorphic module Make(T: S) : S with type t = T.t poly (** Create a datatype for a monomorphic instance of the polymorphic type. *) end (** Functor for polymorphic types with only 1 type variable. @plugin development guide *) module Polymorphic (P: sig include Type.Polymorphic_input val mk_equal: ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val mk_compare: ('a -> 'a -> int) -> 'a t -> 'a t -> int val mk_hash: ('a -> int) -> 'a t -> int val map: ('a -> 'a) -> 'a t -> 'a t val mk_internal_pretty_code: (Type.precedence -> Format.formatter -> 'a -> unit) -> Type.precedence -> Format.formatter -> 'a t -> unit val mk_pretty: (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit val mk_varname: ('a -> string) -> 'a t -> string val mk_mem_project: ((Project_skeleton.t -> bool) -> 'a -> bool) -> (Project_skeleton.t -> bool) -> 'a t -> bool end) : Polymorphic with type 'a poly = 'a P.t (** Output signature of {!Polymorphic2}. *) module type Polymorphic2 = sig include Type.Polymorphic2 module Make(T1: S)(T2: S) : S with type t = (T1.t, T2.t) poly end (** Functor for polymorphic types with 2 type variables. @plugin development guide *) module Polymorphic2 (P: sig include Type.Polymorphic2_input val mk_equal: ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a, 'b) t -> ('a, 'b) t -> bool val mk_compare: ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('a, 'b) t -> ('a, 'b) t -> int val mk_hash: ('a -> int) -> ('b -> int) -> ('a, 'b) t -> int val map: ('a -> 'a) -> ('b -> 'b) -> ('a, 'b) t -> ('a, 'b) t val mk_internal_pretty_code: (Type.precedence -> Format.formatter -> 'a -> unit) -> (Type.precedence -> Format.formatter -> 'b -> unit) -> Type.precedence -> Format.formatter -> ('a, 'b) t -> unit val mk_pretty: (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> Format.formatter -> ('a, 'b) t -> unit val mk_varname: ('a -> string) -> ('b -> string) -> ('a, 'b) t -> string val mk_mem_project: ((Project_skeleton.t -> bool) -> 'a -> bool) -> ((Project_skeleton.t -> bool) -> 'b -> bool) -> (Project_skeleton.t -> bool) -> ('a, 'b) t -> bool end) : Polymorphic2 with type ('a, 'b) poly = ('a, 'b) P.t (** Output signature of {!Polymorphic3}. @since Oxygen-20120901 *) module type Polymorphic3 = sig include Type.Polymorphic3 module Make(T1:S)(T2:S)(T3:S) : S with type t = (T1.t, T2.t, T3.t) poly end (** Functor for polymorphic types with 3 type variables. @since Oxygen-20120901 @plugin development guide *) module Polymorphic3 (P: sig include Type.Polymorphic3_input val mk_equal: ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('c -> 'c -> bool) -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> bool val mk_compare: ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('c -> 'c -> int) -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> int val mk_hash: ('a -> int) -> ('b -> int) -> ('c -> int) -> ('a, 'b, 'c) t -> int val map: ('a -> 'a) -> ('b -> 'b) -> ('c -> 'c) -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t val mk_internal_pretty_code: (Type.precedence -> Format.formatter -> 'a -> unit) -> (Type.precedence -> Format.formatter -> 'b -> unit) -> (Type.precedence -> Format.formatter -> 'c -> unit) -> Type.precedence -> Format.formatter -> ('a, 'b, 'c) t -> unit val mk_pretty: (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> (Format.formatter -> 'c -> unit) -> Format.formatter -> ('a, 'b, 'c) t -> unit val mk_varname: ('a -> string) -> ('b -> string) -> ('c -> string) -> ('a, 'b, 'c) t -> string val mk_mem_project: ((Project_skeleton.t -> bool) -> 'a -> bool) -> ((Project_skeleton.t -> bool) -> 'b -> bool) -> ((Project_skeleton.t -> bool) -> 'c -> bool) -> (Project_skeleton.t -> bool) -> ('a, 'b, 'c) t -> bool end) : Polymorphic3 with type ('a, 'b, 'c) poly = ('a, 'b, 'c) P.t (** Output signature of {!Polymorphic4}. @since Oxygen-20120901 *) module type Polymorphic4 = sig include Type.Polymorphic4 module Make(T1:S)(T2:S)(T3:S)(T4:S) : S with type t = (T1.t, T2.t, T3.t, T4.t) poly end (** Functor for polymorphic types with 4 type variables. @since Oxygen-20120901 @plugin development guide *) module Polymorphic4 (P: sig include Type.Polymorphic4_input val mk_equal: ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('c -> 'c -> bool) -> ('d -> 'd -> bool) -> ('a, 'b, 'c, 'd) t -> ('a, 'b, 'c, 'd) t -> bool val mk_compare: ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('c -> 'c -> int) -> ('d -> 'd -> int) -> ('a, 'b, 'c, 'd) t -> ('a, 'b, 'c, 'd) t -> int val mk_hash: ('a -> int) -> ('b -> int) -> ('c -> int) -> ('d -> int) -> ('a, 'b, 'c, 'd) t -> int val map: ('a -> 'a) -> ('b -> 'b) -> ('c -> 'c) -> ('d -> 'd) -> ('a, 'b, 'c, 'd) t -> ('a, 'b, 'c, 'd) t val mk_internal_pretty_code: (Type.precedence -> Format.formatter -> 'a -> unit) -> (Type.precedence -> Format.formatter -> 'b -> unit) -> (Type.precedence -> Format.formatter -> 'c -> unit) -> (Type.precedence -> Format.formatter -> 'd -> unit) -> Type.precedence -> Format.formatter -> ('a, 'b, 'c, 'd) t -> unit val mk_pretty: (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> (Format.formatter -> 'c -> unit) -> (Format.formatter -> 'd -> unit) -> Format.formatter -> ('a, 'b, 'c, 'd) t -> unit val mk_varname: ('a -> string) -> ('b -> string) -> ('c -> string) -> ('d -> string) -> ('a, 'b, 'c, 'd) t -> string val mk_mem_project: ((Project_skeleton.t -> bool) -> 'a -> bool) -> ((Project_skeleton.t -> bool) -> 'b -> bool) -> ((Project_skeleton.t -> bool) -> 'c -> bool) -> ((Project_skeleton.t -> bool) -> 'd -> bool) -> (Project_skeleton.t -> bool) -> ('a, 'b, 'c, 'd) t -> bool end) : Polymorphic4 with type ('a, 'b, 'c, 'd) poly = ('a, 'b, 'c, 'd) P.t (* ****************************************************************************) (** {2 Predefined functors for polymorphic types} *) (* ****************************************************************************) module Poly_pair: Polymorphic2 with type ('a, 'b) poly = 'a * 'b (** @plugin development guide *) module Pair(T1: S)(T2: S): S with type t = T1.t * T2.t module Pair_with_collections(T1: S)(T2: S)(Info: Functor_info): S_with_collections with type t = T1.t * T2.t val pair: 'a Type.t -> 'b Type.t -> ('a * 'b) Type.t module Poly_ref: Polymorphic with type 'a poly = 'a ref (** @plugin development guide *) module Ref(T: S) : S with type t = T.t ref val t_ref: 'a Type.t -> 'a ref Type.t module Poly_option: Polymorphic with type 'a poly = 'a option module Option(T: S) : S with type t = T.t option (** @since Nitrogen-20111001 *) module Option_with_collections(T:S)(Info: Functor_info): S_with_collections with type t = T.t option val option: 'a Type.t -> 'a option Type.t module Poly_list: Polymorphic with type 'a poly = 'a list (** @plugin development guide *) module List(T: S) : S with type t = T.t list module List_with_collections(T:S)(Info:Functor_info): S_with_collections with type t = T.t list (** @since Fluorine-20130401 *) val list: 'a Type.t -> 'a list Type.t (** @plugin development guide *) module Poly_array: Polymorphic with type 'a poly = 'a array (** @since Neon-20140301 *) module Array(T: S) : S with type t = T.t array (** @since Neon-20140301 *) module Array_with_collections(T:S)(Info:Functor_info): S_with_collections with type t = T.t array (** @since Neon-20140301 *) val array: 'a Type.t -> 'a array Type.t (** @since Neon-20140301 *) module Poly_queue: Polymorphic with type 'a poly = 'a Queue.t val queue: 'a Type.t -> 'a Queue.t Type.t module Queue(T: S) : S with type t = T.t Queue.t module Triple(T1: S)(T2: S)(T3: S): S with type t = T1.t * T2.t * T3.t val triple: 'a Type.t -> 'b Type.t -> 'c Type.t -> ('a * 'b * 'c) Type.t (** @since Fluorine-20130401 *) module Triple_with_collections(T1: S)(T2: S)(T3: S)(Info: Functor_info): S_with_collections with type t = T1.t * T2.t * T3.t (** @since Nitrogen-20111001 *) module Quadruple(T1: S)(T2: S)(T3: S)(T4:S): S with type t = T1.t * T2.t * T3.t * T4.t val quadruple: 'a Type.t -> 'b Type.t -> 'c Type.t -> 'd Type.t -> ('a * 'b * 'c * 'd) Type.t (** @since Fluorine-20130401 *) (** @since Nitrogen-20111001 *) module Quadruple_with_collections (T1: S)(T2: S)(T3: S)(T4:S)(Info: Functor_info): S_with_collections with type t = T1.t * T2.t * T3.t * T4.t (** @plugin development guide *) module Function (T1: sig include S val label: (string * (unit -> t) option) option end) (T2: S) : S with type t = T1.t -> T2.t val func: ?label:string * (unit -> 'a) option -> 'a Type.t -> 'b Type.t -> ('a -> 'b) Type.t (** @plugin development guide *) val optlabel_func: string -> (unit -> 'a) -> 'a Type.t -> 'b Type.t -> ('a -> 'b) Type.t (** [optlabel_func lab dft ty1 ty2] is equivalent to [func ~label:(lab, Some dft) ty1 ty2] *) val func2: ?label1:string * (unit -> 'a) option -> 'a Type.t -> ?label2:string * (unit -> 'b) option -> 'b Type.t -> 'c Type.t -> ('a -> 'b -> 'c) Type.t (** @plugin development guide *) val func3: ?label1:string * (unit -> 'a) option -> 'a Type.t -> ?label2:string * (unit -> 'b) option -> 'b Type.t -> ?label3:string * (unit -> 'c) option -> 'c Type.t -> 'd Type.t -> ('a -> 'b -> 'c -> 'd) Type.t (** @plugin development guide *) val func4: ?label1:string * (unit -> 'a) option -> 'a Type.t -> ?label2:string * (unit -> 'b) option -> 'b Type.t -> ?label3:string * (unit -> 'c) option -> 'c Type.t -> ?label4:string * (unit -> 'd) option -> 'd Type.t -> 'e Type.t -> ('a -> 'b -> 'c -> 'd -> 'e) Type.t module Set (S: FCSet.S)(E: S with type t = S.elt)(Info : Functor_info): Set with type t = S.t and type elt = E.t module Map (M: FCMap.S)(Key: S with type t = M.key)(Info: Functor_info) : Map with type 'a t = 'a M.t and type key = M.key and module Key = Key module Hashtbl (H: Hashtbl_with_descr)(Key: S with type t = H.key)(Info : Functor_info): Hashtbl with type 'a t = 'a H.t and type key = H.key and module Key = Key module type Sub_caml_weak_hashtbl = sig type data type t val create: int -> t val add: t -> data -> unit end module Caml_weak_hashtbl(D: S): sig include Weak.S with type t = Weak.Make(D).t and type data = D.t module Datatype: S with type t = t end module Weak(W: Sub_caml_weak_hashtbl)(D: S with type t = W.data) : S with type t = W.t (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/datatype/descr.ml0000666000000000000000000001563013571573400017230 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Structural_descr (* ********************************************************************** *) (** {2 Type declaration} *) (* ********************************************************************** *) type 'a t = pack let coerce d = (d : single_pack :> Unmarshal.t) let uncheck_pack d = try unsafe_pack d with Cannot_pack -> assert false (* ********************************************************************** *) (** {2 Predefined type descriptors} *) (* ********************************************************************** *) let unmarshable = pack t_unknown let is_unmarshable x = x = unmarshable let t_unit = uncheck_pack Unmarshal.t_unit let t_int = uncheck_pack Unmarshal.t_int let t_string = uncheck_pack Unmarshal.t_string let t_float = uncheck_pack Unmarshal.t_float let t_bool = uncheck_pack Unmarshal.t_bool let t_int32 = uncheck_pack Unmarshal.t_int32 let t_int64 = uncheck_pack Unmarshal.t_int64 let t_nativeint = uncheck_pack Unmarshal.t_nativeint let is_abstract x = x = uncheck_pack Unmarshal.Abstract (* ********************************************************************** *) (** {2 Type descriptor builders} *) (* ********************************************************************** *) exception Invalid_descriptor = Cannot_pack (** {3 Builders for standard OCaml types} *) let t_record x _ = try let x = Array.map (fun x -> match x with | Nopack | Recursive _ -> raise Invalid_descriptor | Pack x -> coerce x) x in unsafe_pack (Unmarshal.t_record x) with Cannot_pack -> unmarshable let t_tuple = t_record let t_pair x y = match x, y with | (Nopack | Recursive _), _ | _, (Nopack | Recursive _) -> unmarshable | Pack x, Pack y -> uncheck_pack (Unmarshal.t_tuple [| coerce x; coerce y |]) let t_poly f = function | Nopack -> unmarshable | Recursive _ -> raise Invalid_descriptor | Pack x -> uncheck_pack (f (coerce x)) let t_list = t_poly Unmarshal.t_list let t_ref = t_poly Unmarshal.t_ref let t_option = t_poly Unmarshal.t_option let t_queue = t_poly Unmarshal.t_queue (** {3 Builders from others datatypes of the Type library} *) let of_type ty = pack (Type.structural_descr ty) let of_structural ty d = let ty_d = Type.structural_descr ty in if not (Type.may_use_obj ()) || Structural_descr.are_consistent ty_d d then pack d else invalid_arg "Descr.of_structural: inconsistent descriptor" (** {3 Builders mapping transformers of {!Unmarshal}} *) let dependent_pair a fb = match a with | Nopack -> unmarshable | Recursive _ -> raise Invalid_descriptor | Pack a -> let f x = match fb (Obj.obj x) with | Nopack | Recursive _ -> raise Invalid_descriptor | Pack b -> coerce b in uncheck_pack (Unmarshal.Structure (Unmarshal.Dependent_pair (coerce a, f))) let return d f = match d with | Nopack -> unmarshable | Recursive _ -> raise Invalid_descriptor | Pack d -> uncheck_pack (Unmarshal.Return(coerce d, (fun x -> Obj.repr (f x)))) let dynamic f = let f () = match f () with | Nopack | Recursive _ -> raise Invalid_descriptor | Pack y -> coerce y in uncheck_pack (Unmarshal.Dynamic f) module Unmarshal_tbl = Hashtbl.Make (struct type t = Unmarshal.t let equal = (==) let hash = Hashtbl.hash (* [JS 2012/07/10] what about recursive datatypes? Look like [hash] could loop... *) end) let visited = Unmarshal_tbl.create 7 let rec transform_unmarshal_structure term x = function | Unmarshal.Sum arr -> let l = ref [] in Array.iter (fun a -> Array.iteri (fun i y -> if x == y then l := (a, i) :: !l else transform_unmarshal term x y) a) arr; List.iter (fun (a, i) -> a.(i) <- term) !l | Unmarshal.Dependent_pair(d, _) | Unmarshal.Array d -> transform_unmarshal term x d and transform_unmarshal term x = function | Unmarshal.Abstract | Unmarshal.Dynamic _ -> () | Unmarshal.Structure s as y -> if not (Unmarshal_tbl.mem visited y) then begin Unmarshal_tbl.add visited y (); transform_unmarshal_structure term x s end | Unmarshal.Return(d, _) | Unmarshal.Transform(d, _) as y -> (* TODO: not possible to change the return/transform by [term] if its == to [x] (since this value is immutable). Hopefully this case should never occur. *) assert (x != y); transform_unmarshal term x d let transform descr f = match descr with | Nopack -> raise Cannot_pack | Recursive _ -> raise Invalid_descriptor | Pack d -> let d = coerce d in let term = Unmarshal.Transform(d, fun x -> Obj.repr (f (Obj.obj x))) in transform_unmarshal term d d; Unmarshal_tbl.clear visited; uncheck_pack term (* ********************************************************************** *) (** {2 Coercions} *) (* ********************************************************************** *) let str = function | Nopack -> t_unknown | Pack p -> of_pack p | Recursive _ -> raise Invalid_descriptor let pack x = x (* ********************************************************************** *) (** {2 Safe unmarshaling} *) (* ********************************************************************** *) let input_val cin = function | Nopack | Recursive _ -> invalid_arg "Descr.input_val: unmarshable value" | Pack d -> Unmarshal.input_val cin (coerce d) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/datatype/descr.mli0000666000000000000000000001344313571573400017401 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Type descriptor for safe unmarshalling. This module provides a safe API on top of modules {!Unmarshal} of {!Structural_descr}, using module {!Type}. This module offers the same power as {!Unmarshal}, but in a safe way. *) (* ********************************************************************** *) (** {2 Type declaration} *) (* ********************************************************************** *) type 'a t (** Type of a type descriptor. *) (* ********************************************************************** *) (** {2 Predefined type descriptors} *) (* ********************************************************************** *) val t_unit: unit t val t_int : int t val t_string : string t val t_float : float t val t_bool : bool t val t_int32 : int32 t val t_int64 : int64 t val t_nativeint : nativeint t val unmarshable: 'a t (** Descriptor for unmarshallable types. @since Carbon-20101201 *) val is_unmarshable: 'a t -> bool (** @since Carbon-20101201 *) val is_abstract: 'a t -> bool (** @since Neon-20140301 *) (* ********************************************************************** *) (** {2 Type descriptor builders} *) (* ********************************************************************** *) exception Invalid_descriptor (** @since Carbon-20101201 *) (** {3 Builders for standard OCaml types} *) val t_record : Structural_descr.pack array -> 'a -> 'a t (** Type descriptor for records (the length of the array must be equal to the number of fields in the record). @raise Invalid_descriptor if the descriptor cannot be built. *) val t_tuple : Structural_descr.pack array -> 'a -> 'a t (** Type descriptor for tuples of any range (the length of the array range is the range of the tuple). @raise Invalid_descriptor if the descriptor cannot be built. *) val t_pair: 'a t -> 'b t -> ('a * 'b) t (** Type descriptor for pairs (2-tuples). Safer that [t_tuple] for pairs. @raise Invalid_descriptor if the descriptor cannot be built. *) val t_list : 'a t -> 'a list t (** Type descriptor for lists. @raise Invalid_descriptor if the descriptor cannot be built. *) val t_ref : 'a t -> 'a ref t (** Type descriptor for references. @raise Invalid_descriptor if the descriptor cannot be built. *) val t_option : 'a t -> 'a option t (** Type descriptor for options. @raise Invalid_descriptor if the descriptor cannot be built. *) val t_queue: 'a t -> 'a Queue.t t (** Type descriptor for queues. @raise Invalid_descriptor if the descriptor cannot be built. *) (** {3 Builders from others datatypes of the Type library} *) val of_type: 'a Type.t -> 'a t (** Type descriptor from the type value. @since Carbon-20101201 *) val of_structural: 'a Type.t -> Structural_descr.t -> 'a t (** Type descriptor from the structural descriptor. The given type value ensures safety. @since Carbon-20101201 *) (** {3 Builders mapping {!Unmarshal}'s transformers} *) val dependent_pair: 'a t -> ('a -> 'b t) -> ('a * 'b) t (** Similar to {!Unmarshal.Dependent_pair}, but safe. @raise Invalid_descriptor if the descriptor cannot be built. *) val transform: 'a t -> ('a -> 'a) -> 'a t (** Similar to {!Unmarshal.Transform}, but safe. @raise Invalid_descriptor if the given descriptor is incorrect. *) val return: 'a t -> (unit -> 'a) -> 'a t (** Similar to {!Unmarshal.Return}, but safe. @raise Invalid_descriptor if the descriptor cannot be built. *) val dynamic: (unit -> 'a t) -> 'a t (** Similar to {!Unmarshal.Dynamic}. @raise Invalid_descriptor if the descriptor cannot be built. *) (* ********************************************************************** *) (** {2 Coercions} *) (* ********************************************************************** *) val str: 'a t -> Structural_descr.t (** @raise Invalid_descriptor if the given descriptor is incorrect. @since Carbon-20101201 *) val pack: 'a t -> Structural_descr.pack (** @since Carbon-20101201 *) (* ********************************************************************** *) (** {2 Safe unmarshaling} *) (* ********************************************************************** *) val input_val: in_channel -> 'a t -> 'a (** @since Carbon-20101201 *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/datatype/structural_descr.ml0000666000000000000000000003146413571573400021523 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ********************************************************************** *) (** {2 Type declarations} *) (* ********************************************************************** *) type single_pack = Unmarshal.t type t = Unknown | Abstract | Structure of structure | T_pack of single_pack and structure = Sum of pack array array | Array of pack and pack = Nopack | Pack of single_pack | Recursive of recursive and recursive = t ref (* ********************************************************************** *) (** {2 Injection into Unmarshal} *) (* ********************************************************************** *) module Recursive = struct let create () = ref Unknown let update x t = x := t (* internals *) module Tbl = Hashtbl.Make (struct type t = recursive let equal = (==) let hash = Hashtbl.hash end) let positions = Tbl.create 7 let arrays = Tbl.create 7 let add_position r i j = Tbl.add positions r (i, j) let add_array a = Tbl.iter (fun r p -> Tbl.add arrays r (a, p)) positions; Tbl.clear positions let finalize t u = (* there are not so many mutually recursive values: linear time is ok *) Tbl.iter (fun r (a, (i, j)) -> if !r == t then a.(i).(j) <- u) arrays; Tbl.clear arrays end exception Cannot_pack let pack_to_unmarshal i j = function | Nopack -> raise Cannot_pack | Pack d -> d | Recursive r -> Recursive.add_position r i j; Unmarshal.Abstract (* will be updated later *) let structure_to_unmarshal = function | Sum arr -> let a = Array.mapi (fun i -> Array.mapi (pack_to_unmarshal i)) arr in Recursive.add_array a; Unmarshal.Sum a | Array d -> Unmarshal.Array (pack_to_unmarshal 0 0 d) let to_unmarshal = function | Unknown -> raise Cannot_pack | Abstract -> Unmarshal.Abstract | Structure s as x -> let y = Unmarshal.Structure (structure_to_unmarshal s) in Recursive.finalize x y; y | T_pack p -> p let pack d = try Pack (to_unmarshal d) with Cannot_pack -> Nopack let pack_from_unmarshal d = Pack d let unsafe_pack = pack_from_unmarshal let of_pack p = T_pack p let structure_from_unmarshal = function | Unmarshal.Sum arr -> Sum (Array.map (Array.map pack_from_unmarshal) arr) | Unmarshal.Dependent_pair _ -> assert false (* not structural *) | Unmarshal.Array d -> Array (pack_from_unmarshal d) let from_unmarshal = function | Unmarshal.Abstract -> Abstract | Unmarshal.Structure s -> Structure (structure_from_unmarshal s) | Unmarshal.Transform _ | Unmarshal.Return _ | Unmarshal.Dynamic _ -> assert false (* not structural *) let recursive_pack r = Recursive r (* ********************************************************************** *) (** {2 Predefined values} *) (* ********************************************************************** *) let p_abstract = unsafe_pack Unmarshal.Abstract let p_unit = unsafe_pack Unmarshal.t_unit let p_int = unsafe_pack Unmarshal.t_int let p_string = unsafe_pack Unmarshal.t_string let p_float = unsafe_pack Unmarshal.t_float let p_bool = unsafe_pack Unmarshal.t_bool let p_int32 = unsafe_pack Unmarshal.t_int32 let p_int64 = unsafe_pack Unmarshal.t_int64 let p_nativeint = unsafe_pack Unmarshal.t_nativeint let t_abstract = Abstract let t_unknown = Unknown let t_unit = from_unmarshal Unmarshal.t_unit let t_int = from_unmarshal Unmarshal.t_int let t_string = from_unmarshal Unmarshal.t_string let t_float = from_unmarshal Unmarshal.t_float let t_bool = from_unmarshal Unmarshal.t_bool let t_int32 = from_unmarshal Unmarshal.t_int32 let t_int64 = from_unmarshal Unmarshal.t_int64 let t_nativeint = from_unmarshal Unmarshal.t_nativeint let poly f = function | Abstract -> Abstract | Unknown -> Unknown | Structure _ | T_pack _ as a -> try from_unmarshal (f (to_unmarshal a)) with Cannot_pack -> Unknown (* would be better to put it in Extlib, but no access to this library here *) let array_for_all f a = try Array.iter (fun x -> if not (f x) then raise Exit) a; true with Exit -> false let is_abstract_array a = array_for_all (fun x -> x = Pack Unmarshal.Abstract) a let poly_arr f a = if is_abstract_array a then Abstract else try let d = f (Array.mapi (pack_to_unmarshal 0) a) in from_unmarshal d with Cannot_pack -> Unknown let t_record = poly_arr Unmarshal.t_record let t_tuple = poly_arr Unmarshal.t_tuple let t_list = poly Unmarshal.t_list let t_ref = poly Unmarshal.t_ref let t_option = poly Unmarshal.t_option let t_array = poly Unmarshal.t_array let t_queue = poly Unmarshal.t_queue let t_set_unchanged_compares = poly Unmarshal.t_set_unchangedcompares let poly2 f a b = match a, b with | Abstract, Abstract -> Abstract | _, _ -> (* no special case for [Unknown]: sometimes, even if one part of the container is unknown, it can be unmarshaled. *) try from_unmarshal (f (to_unmarshal a) (to_unmarshal b)) with Cannot_pack -> Unknown let t_map_unchanged_compares = poly2 Unmarshal.t_map_unchangedcompares let t_hashtbl_unchanged_hashs = poly2 (Unmarshal.t_hashtbl_unchangedhashs) let t_sum a = if array_for_all (is_abstract_array) a then Abstract else Structure (Sum a) (* ********************************************************************** *) (** {2 Internals} *) (* ********************************************************************** *) (* ********************************************************************** *) (* {3 cleanup} *) (* ********************************************************************** *) module Unmarshal_tbl = Hashtbl.Make (struct type t = Unmarshal.t let equal = (==) let hash = Hashtbl.hash end) let unmarshal_visited = Unmarshal_tbl.create 7 module Tbl = Hashtbl.Make (struct type u = t type t = u let equal = (==) let hash = Hashtbl.hash end) let visited = Tbl.create 7 let rec cleanup_unmarshal_structure = function | Unmarshal.Sum arr -> Unmarshal.Sum (Array.map (Array.map cleanup_unmarshal) arr) | Unmarshal.Array p -> Unmarshal.Array (cleanup_unmarshal p) | Unmarshal.Dependent_pair _ -> assert false and cleanup_unmarshal = function | Unmarshal.Abstract as x -> x | Unmarshal.Transform(x, _) | Unmarshal.Return(x, _) -> cleanup_unmarshal x | Unmarshal.Structure s as x -> if Unmarshal_tbl.mem unmarshal_visited x then Unmarshal.Abstract (* not so good, but so much simpler *) else begin Unmarshal_tbl.add unmarshal_visited x (); Unmarshal.Structure (cleanup_unmarshal_structure s) end | Unmarshal.Dynamic _ -> assert false let rec cleanup_pack = function | Nopack as x -> x | Recursive r -> let x = ref Unknown in Tbl.add visited !r x; Recursive x | Pack p -> Pack (cleanup_unmarshal p) and cleanup_structure = function | Sum arr -> Sum (Array.map (Array.map cleanup_pack) arr) | Array p -> Array (cleanup_pack p) and cleanup_aux = function | Unknown | Abstract as x -> x | Structure s as x -> let x' = Structure (cleanup_structure s) in (try let r = Tbl.find visited x in r := x' with Not_found -> ()); x' | T_pack p -> T_pack (cleanup_unmarshal p) let cleanup x = assert (Unmarshal_tbl.length unmarshal_visited = 0 && Tbl.length visited = 0); let x = cleanup_aux x in Unmarshal_tbl.clear unmarshal_visited; Tbl.clear visited; x (* ********************************************************************** *) (* {3 are_consistent} *) (* ********************************************************************** *) let unmarshal_consistent_visited = Unmarshal_tbl.create 7 let consistent_visited = Tbl.create 7 let rec are_consistent_unmarshal_structures s1 s2 = match s1, s2 with | Unmarshal.Sum arr1, Unmarshal.Sum arr2 -> (try for i = 0 to Array.length arr1 - 1 do let arr1_i = arr1.(i) in for j = 0 to Array.length arr1_i - 1 do if not (are_consistent_unmarshal arr1_i.(j) arr2.(i).(j)) then raise Exit done done; true with Invalid_argument _ | Exit -> false) | Unmarshal.Array d1, Unmarshal.Array d2 | Unmarshal.Dependent_pair(d1, _), Unmarshal.Dependent_pair(d2, _) | Unmarshal.Dependent_pair(d1, _), Unmarshal.Sum [| [| d2; _ |] |] | Unmarshal.Sum [| [| d1; _ |] |], Unmarshal.Dependent_pair(d2, _) -> are_consistent_unmarshal d1 d2 | Unmarshal.Sum _, Unmarshal.Array _ | Unmarshal.Array _, Unmarshal.Sum _ | (Unmarshal.Array _ | Unmarshal.Sum _), Unmarshal.Dependent_pair _ | Unmarshal.Dependent_pair _, (Unmarshal.Array _ | Unmarshal.Sum _) -> false and are_consistent_unmarshal d1 d2 = match d1, d2 with | Unmarshal.Abstract, Unmarshal.Abstract | Unmarshal.Dynamic _, _ | _, Unmarshal.Dynamic _ -> true | Unmarshal.Return(d1, _), d2 | d1, Unmarshal.Return(d2, _) | Unmarshal.Transform(d1, _), d2 | d1, Unmarshal.Transform(d2, _) -> are_consistent_unmarshal d1 d2 | Unmarshal.Structure s1, Unmarshal.Structure s2 -> (try let d2' = Unmarshal_tbl.find unmarshal_consistent_visited d1 in d2 == d2' with Not_found -> (* Keep already visited terms in order to prevent looping when visiting recursive terms. However, remove them from the table after visiting in order to not pollute it when visiting cousins: fixed bts #1277. Would be better to use a persistent table instead of a mutable one, but not possible to provide a (terminating) comparison. *) Unmarshal_tbl.add unmarshal_consistent_visited d1 d2; let b = are_consistent_unmarshal_structures s1 s2 in Unmarshal_tbl.remove unmarshal_consistent_visited d1; b) | Unmarshal.Abstract, Unmarshal.Structure _ -> true (* we provide a more precise version: accept it *) | _, _ -> false let are_consistent_pack p1 p2 = match p1, p2 with | Nopack, Nopack -> true | Pack s1, Pack s2 -> are_consistent_unmarshal s1 s2 | Recursive _, _ | _, Recursive _ -> invalid_arg "unbound recursive structural descriptors" | Nopack, Pack _ | Pack _, Nopack -> false let rec are_consistent_structures s1 s2 = match s1, s2 with | Sum arr1, Sum arr2 -> (try for i = 0 to Array.length arr1 - 1 do let arr1_i = arr1.(i) in for j = 0 to Array.length arr1_i - 1 do if not (are_consistent_pack arr1_i.(j) arr2.(i).(j)) then raise Exit done done; true with Invalid_argument _ | Exit -> false) | Array d1, Array d2 -> are_consistent_pack d1 d2 | Sum _, Array _ | Array _, Sum _ -> false and are_consistent_aux d1 d2 = match d1, d2 with | Unknown, Unknown | Abstract, Abstract -> true | Structure s1, Structure s2 -> (try let d2' = Tbl.find consistent_visited d1 in d2 == d2' with Not_found -> Tbl.add consistent_visited d1 d2; are_consistent_structures s1 s2) | d, T_pack s | T_pack s, d -> are_consistent_unmarshal (to_unmarshal d) s | Abstract, Structure _ -> true (* we provide a more precise version: accept it *) | Structure _, Abstract -> false | _, _ -> false let are_consistent d1 d2 = assert (Unmarshal_tbl.length unmarshal_consistent_visited = 0 && Tbl.length consistent_visited = 0); let b = are_consistent_aux d1 d2 in Unmarshal_tbl.clear unmarshal_consistent_visited; Tbl.clear consistent_visited; b (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/datatype/structural_descr.mli0000666000000000000000000001504013571573400021664 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Internal representations of OCaml type as first class values. These values are called structural descriptors. @since Carbon-20101201 *) (* ********************************************************************** *) (** {2 Type declarations} *) (* ********************************************************************** *) (** Type used for handling (possibly mutually) recursive structural descriptors. See module {!Recursive}. *) type recursive type single_pack = private Unmarshal.t (** Structural descriptor used inside structures. @modify Nitrogen-20111001 this type is now private. Use smart constructors instead. *) type pack = private | Nopack (** Was impossible to build a pack. *) | Pack of single_pack (** A standard pack. *) | Recursive of recursive (** Pack for a recursive descriptor. See module {!Recursive}. *) (** Type of internal representations of OCaml type. Example: the structural descriptor of [A | B of int * bool | C of string] is [Structure (Sum [| [| p_int; p_bool |]; [| p_string |] |])]. Ok, in this case, just [Abstract] is valid too. *) type t = private | Unknown (** Use it either for unmarshable types or if you don't know its internal representation. In any case, values of types with this descriptor will never be written on disk. *) | Abstract (** The data is marshable as an usual OCaml value. No specific processing will be applied on any part of such a data. *) | Structure of structure (** Provide a description of the representation of data. @plugin development guide *) | T_pack of single_pack (** Internal use only. Do not use it outside the library *) (** Description with details. *) and structure = private | Sum of pack array array (** [Sum c] describes a non-array type where [c] is an array describing the non-constant constructors of the type being described (in the order of their declarations in that type). Each element of this latter array is an array of [t] that describes (in order) the fields of the corresponding constructor. @plugin development guide *) | Array of pack (** The data is an array of values of the same type, each value being described by the pack. *) (* ********************************************************************** *) (** {2 Pack builders} *) (* ********************************************************************** *) val pack: t -> pack (** Pack a structural descriptor in order to embed it inside another one. @plugin development guide *) val recursive_pack: recursive -> pack (** Pack a recursive descriptor. @since Nitrogen-20111001 *) (** Use this module for handling a (possibly recursive) structural descriptor [d]. Call [Recursive.create ()] (returning [r]) before building [d]. Build [d] and use [Recursive r] in places where [d] should be put. Call [Recursive.update r d] after building [d]. Here is an example for [type t = A | B of t]: [let r = Recursive.create () in let d = Structure (Sum [| [| Recursive r |] |]) in Recursive.update r d] *) module Recursive: sig val create: unit -> recursive val update: recursive -> t -> unit end (* ********************************************************************** *) (** {2 Predefined descriptors} *) (* ********************************************************************** *) val t_unknown: t (** @since Neon-20140301 *) val t_abstract: t (** @since Neon-20140301 *) val t_unit : t val t_int : t val t_string : t val t_float : t val t_bool : t val t_int32 : t val t_int64 : t val t_nativeint : t val t_record : pack array -> t val t_tuple : pack array -> t val t_list : t -> t val t_ref : t -> t val t_option : t -> t val t_array : t -> t val t_queue: t -> t val t_sum: pack array array -> t (** @since Neon-20140301 *) (** Use the functions below only if the compare/hash functions cannot change by marshalling. *) val t_set_unchanged_compares: t -> t val t_map_unchanged_compares: t -> t -> t val t_hashtbl_unchanged_hashs: t -> t -> t (** Packed versions of predefined descriptors. *) val p_abstract: pack (** Equivalent to [pack Abstract] *) val p_unit : pack val p_int : pack (** @plugin development guide *) val p_string : pack val p_float : pack val p_bool : pack val p_int32 : pack val p_int64 : pack val p_nativeint : pack (* ********************************************************************** *) (** {2 Internals} These values must be used only inside the Type library. *) (* ********************************************************************** *) exception Cannot_pack val unsafe_pack: Unmarshal.t -> pack (** @raise Cannot_pack if packing failed. *) val of_pack: single_pack -> t val cleanup: t -> t val are_consistent: t -> t -> bool (** Not symmetrical: check that the second argument is a correct refinement of the first one. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/datatype/type.ml0000666000000000000000000006063413571573400017115 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ****************************************************************************) (* ****************************************************************************) (* ****************************************************************************) (* Disclaimer ---------- This module uses very unsafe caml features (module Obj). Modify it at your own risk. Sometimes the caml type system does not help you here. Introducing a bug here may introduce some "segmentation faults" in Frama-C *) let use_obj = ref true let no_obj () = use_obj := false let may_use_obj () = !use_obj (* ****************************************************************************) (* ****************************************************************************) (* ****************************************************************************) (** Precedences used for generating the minimal number of parenthesis in combination with function {!par} below. *) type precedence = | Basic | Call | Tuple | List | NoPar (* p1 <= p2 *) let lower_prec p1 p2 = match p1, p2 with | NoPar, _ | _, Basic -> true | x, y when x = y -> true | List, (Tuple | Call) | Tuple, Call -> true | _, _ -> false let par p_caller p_callee fmt pp = (* if p_callee <= p_caller then parenthesis else no parenthesis *) if lower_prec p_callee p_caller then Format.fprintf fmt "(%t)" pp else Format.fprintf fmt "%t" pp type concrete_repr = { mutable name: string; digest: Digest.t; structural_descr: Structural_descr.t; mutable abstract: bool; mutable pp_ml_name: precedence -> Format.formatter -> unit } (* phantom type *) type 'a t = concrete_repr type 'a ty = 'a t (* non-phantom type: the type variable is used here *) type 'a full_t = { ty: 'a t; reprs: 'a list } (* ****************************************************************************) (** {2 Type values are comparable} *) (* ****************************************************************************) module Comparable = struct let equal x y = x.digest = y.digest let compare x y = String.compare x.digest y.digest let hash x = Hashtbl.hash x.digest end include Comparable module Tbl = Hashtbl.Make(struct type t = concrete_repr include Comparable end) (* ****************************************************************************) (** {2 Global useful values} *) (* ****************************************************************************) let types : (string (* name *), Obj.t full_t) Hashtbl.t = Hashtbl.create 97 let embedded_types: concrete_repr Tbl.t = Tbl.create 7 let dummy = { name = ""; digest = ""; structural_descr = Structural_descr.t_unknown; abstract = false; pp_ml_name = fun _ _ -> assert false } (* ****************************************************************************) (** {2 Main functions} *) (* ****************************************************************************) let mk_dyn_pp name = function | None -> let pp fmt = let plugin_name = match Str.split (Str.regexp_string ".") name with | [] -> None | p :: _ -> Some p in match plugin_name with | None -> Format.fprintf fmt "(failwith \"%s is not a printable type name\")" name | Some p -> Format.fprintf fmt "%s.ty" p in (fun p fmt -> par p Basic fmt pp) | Some s -> let prec = try ignore (Str.search_forward (Str.regexp " ") name 0); Call with Not_found -> Basic in fun p fmt -> par p prec fmt (fun fmt -> Format.fprintf fmt "%s" s) exception AlreadyExists of string let register ?(closure=false) ~name ~ml_name structural_descr reprs = let error () = invalid_arg ("Type.register: invalid reprs for type " ^ name) in (* Format.printf "type %S@." name;*) match reprs with | [] -> error () | r :: _ when Obj.tag (Obj.repr r) = Obj.closure_tag && not closure -> (* all the representants have the same types: thus that is correct to check only the first one *) error () | _ -> if Hashtbl.mem types name then raise (AlreadyExists name); let pp_ml_name = mk_dyn_pp name ml_name in let digest = match structural_descr with | Structural_descr.Unknown -> (* unserializable type: weakest digest *) Digest.string name | _ -> let key = name, Structural_descr.cleanup structural_descr, reprs in Digest.string (Marshal.to_string key []) in let ty = { name = name; digest = digest; structural_descr = structural_descr; abstract = false; pp_ml_name = pp_ml_name } in let full_ty = { ty = ty; reprs = List.map Obj.repr reprs } in if !use_obj then Hashtbl.add types name full_ty; ty let add_abstract_types = ref (fun _ _ -> ()) exception No_abstract_type of string module Abstract(T: sig val name: string end) = struct type t let ty = if !use_obj then try (Hashtbl.find types T.name).ty with Not_found -> raise (No_abstract_type T.name) else failwith "Cannot call `Type.Abstract' in `no obj' mode" let () = let p = match Str.split (Str.regexp_string ".") T.name with | [] -> failwith "name as argument of `Type.Abstract' must be a valid OCaml \ type name" | p :: _ -> p in !add_abstract_types p T.name end let name ty = ty.name let structural_descr ty = ty.structural_descr let digest ty = ty.digest let pp_ml_name ty = ty.pp_ml_name let ml_name ty = Format.asprintf "%t" (ty.pp_ml_name Basic) let unsafe_reprs ty = (Hashtbl.find types ty.name).reprs let reprs ty = if !use_obj then let l = try unsafe_reprs ty with Not_found -> assert false in List.map Obj.obj l else [] let set_ml_name ty ml_name = let pp = mk_dyn_pp ty.name ml_name in ty.pp_ml_name <- pp let set_name ty name = let full_ty = try Hashtbl.find types ty.name with Not_found -> assert false in Hashtbl.remove types ty.name; ty.name <- name; Hashtbl.add types name full_ty let rec get_embedded_type_names ty = let sub_ty = try Tbl.find_all embedded_types ty with Not_found -> [] in let sub_ty_names = List.fold_left (fun acc ty -> get_embedded_type_names ty @ acc) [] sub_ty in ty.name :: sub_ty_names (* ****************************************************************************) (** {2 Polymorphic type values} *) (* ****************************************************************************) module type Polymorphic_input = sig val name: 'a t -> string val module_name: string val structural_descr: Structural_descr.t -> Structural_descr.t type 'a t val reprs: 'a -> 'a t list end module type Polymorphic = sig type 'a poly val instantiate: 'a t -> 'a poly t * bool val is_instance_of: 'a t -> bool val get_instance: 'a poly t -> 'a t end module Polymorphic(T: Polymorphic_input) = struct module Tbl = struct let memo : concrete_repr Tbl.t = Tbl.create 17 let instances: concrete_repr Tbl.t = Tbl.create 17 let add instance ty = Tbl.add memo instance ty; Tbl.add instances ty instance; Tbl.add embedded_types ty instance let find = Tbl.find memo let find_instance = Tbl.find instances let mem_instance = Tbl.mem memo end type 'a poly = 'a T.t let ml_name from_ty = Format.asprintf "%s.instantiate %t" T.module_name (from_ty.pp_ml_name Call) let instantiate (ty:'a t) = if !use_obj then try Tbl.find ty, false with Not_found -> let repr = register ~name:(T.name ty) ~ml_name:(Some (ml_name ty)) (T.structural_descr ty.structural_descr) (List.fold_left (fun acc ty -> T.reprs ty @ acc) [] (unsafe_reprs ty)) in Tbl.add ty repr; repr, true else dummy, false let is_instance_of = Tbl.mem_instance let get_instance (type a) (ty:a poly t) = try Tbl.find_instance ty with Not_found -> (* static typing ensures than [ty] has already been instantiated. *) assert false end module type Polymorphic2_input = sig val name: 'a t -> 'b t -> string val module_name: string val structural_descr: Structural_descr.t -> Structural_descr.t -> Structural_descr.t type ('a, 'b) t val reprs: 'a -> 'b -> ('a, 'b) t list end module type Polymorphic2 = sig type ('a, 'b) poly val instantiate: 'a t -> 'b t -> ('a, 'b) poly t * bool val is_instance_of: 'a t -> bool val get_instance: ('a, 'b) poly t -> 'a t * 'b t end module Concrete_pair = Hashtbl.Make (struct type t = concrete_repr * concrete_repr let hash (x,y) = Hashtbl.hash (hash x, hash y) let equal (x1,y1) (x2,y2) = equal x1 x2 && equal y1 y2 end) module Polymorphic2(T: Polymorphic2_input) = struct type ('a, 'b) poly = ('a, 'b) T.t let memo_tbl : concrete_repr Concrete_pair.t = Concrete_pair.create 17 let instances : (concrete_repr * concrete_repr) Tbl.t = Tbl.create 17 let ml_name from_ty1 from_ty2 = Format.asprintf "%s.instantiate %t %t" T.module_name (from_ty1.pp_ml_name Call) (from_ty2.pp_ml_name Call) let instantiate a b = if !use_obj then let key = a, b in try Concrete_pair.find memo_tbl key, false with Not_found -> let reprs = List.fold_left (fun acc r1 -> List.fold_left (fun acc r2 -> T.reprs r1 r2 @ acc) acc (unsafe_reprs b)) [] (unsafe_reprs a) in let ty = register ~name:(T.name a b) ~ml_name:(Some (ml_name a b)) (T.structural_descr a.structural_descr b.structural_descr) reprs in Concrete_pair.add memo_tbl key ty; Tbl.add instances ty key; Tbl.add embedded_types ty a; Tbl.add embedded_types ty b; ty, true else dummy, false let is_instance_of ty = Tbl.mem instances ty let get_instance (type a) (type b) (ty:(a, b) poly t) = try Tbl.find instances ty with Not_found -> (* static typing ensures than [ty] has already been instantiated. *) assert false end (* ****************************************************************************) (** {2 Functional types} *) (* ****************************************************************************) let par_ty_name test ty = if test ty then Format.sprintf "(%s)" ty.name else Format.sprintf "%s" ty.name module Function = struct type ('a, 'b) poly = 'a -> 'b type instance = { arg: concrete_repr; ret: concrete_repr; label: string option } module Memo = Hashtbl.Make (struct type t = instance let hash x = Hashtbl.hash (hash x.arg, hash x.ret, x.label) let equal x y = equal x.arg y.arg && equal x.ret y.ret && x.label = y.label end) let memo_tbl : concrete_repr Memo.t = Memo.create 17 let instances : (instance * Obj.t (* default value of the optional label *) option) Tbl.t = Tbl.create 17 let is_instance_of ty = Tbl.mem instances ty let get_instance (type a) (type b) (ty:(a, b) poly t) = try let instance, _ = Tbl.find instances ty in instance.arg, instance.ret, instance.label with Not_found -> (* static typing ensures than [ty] has already been instantiated. *) assert false let get_optional_argument (type a) (type b) (ty:(a, b) poly t) = if !use_obj then try match Tbl.find instances ty with | _, None -> None | _, Some o -> Some (Obj.obj o : unit -> 'b) with Not_found -> (* static typing ensures than [ty] has already been instantiated. *) assert false else invalid_arg "cannot call `Type.get_optional_argument in the 'no obj' mode" let name label ty1 ty2 = (match label with None -> "" | Some l -> "~" ^ l ^ ":") ^ par_ty_name is_instance_of ty1 ^ " -> " ^ name ty2 let ml_name label ty1 ty2 = Format.asprintf "Datatype.func%s %t %t" (match label with None -> "" | Some l -> " ~label:(" ^ l ^ ", None)") (ty1.pp_ml_name Call) (ty2.pp_ml_name Call) let instantiate ?label (a:'a) (b:'b t): ('a, 'b) poly t * bool = if !use_obj then let l, o = match label with | None -> None, None | Some (l, None) -> Some l, None | Some (l, Some o) -> Some l , Some (Obj.repr o) in let key = { arg = a; ret = b; label = l } in try Memo.find memo_tbl key, false with Not_found -> let ty = (* Do not inline [Types.repr b] in the closure below because caml is not able to marshal the closure. Sadly don't know exactly why. Seem to have some value tagged as abstract in the closure environment. *) register ~closure:true ~name:(name l a b) ~ml_name:(Some (ml_name l a b)) Structural_descr.t_unknown (List.map (fun r _ -> r) (unsafe_reprs b)) in Memo.add memo_tbl key ty; Tbl.add instances ty (key, o); Tbl.add embedded_types ty a; Tbl.add embedded_types ty b; ty, true else dummy, false end (* ****************************************************************************) (** {2 Polymorphic3} *) (* ****************************************************************************) module type Polymorphic3_input = sig val name: 'a t -> 'b t -> 'c t -> string val module_name: string val structural_descr: Structural_descr.t -> Structural_descr.t -> Structural_descr.t -> Structural_descr.t type ('a, 'b, 'c) t val reprs: 'a -> 'b -> 'c -> ('a, 'b, 'c) t list end module type Polymorphic3 = sig type ('a, 'b, 'c) poly val instantiate: 'a t -> 'b t -> 'c t -> ('a, 'b, 'c) poly t * bool val is_instance_of: 'a t -> bool val get_instance: ('a, 'b, 'c) poly t -> 'a t * 'b t * 'c t end module Concrete_triple = Hashtbl.Make (struct type t = concrete_repr * concrete_repr * concrete_repr let hash (x,y,z) = Hashtbl.hash (hash x, hash y, hash z) let equal (x1,y1,z1) (x2,y2,z2) = equal x1 x2 && equal y1 y2 && equal z1 z2 end) module Polymorphic3(T:Polymorphic3_input) = struct type ('a, 'b, 'c) poly = ('a, 'b, 'c) T.t let memo_tbl: concrete_repr Concrete_triple.t = Concrete_triple.create 17 let instances : (concrete_repr * concrete_repr * concrete_repr) Tbl.t = Tbl.create 17 let ml_name from_ty1 from_ty2 from_ty3 = Format.asprintf "%s.instantiate %t %t %t" T.module_name (from_ty1.pp_ml_name Call) (from_ty2.pp_ml_name Call) (from_ty3.pp_ml_name Call) let instantiate a b c = if !use_obj then let key = a, b, c in try Concrete_triple.find memo_tbl key, false with Not_found -> let reprs = List.fold_left (fun acc r1 -> List.fold_left (fun acc r2 -> List.fold_left (fun acc r3 -> T.reprs r1 r2 r3 @ acc) acc (unsafe_reprs c)) acc (unsafe_reprs b)) [] (unsafe_reprs a) in let ty = register ~name:(T.name a b c) ~ml_name:(Some (ml_name a b c)) (T.structural_descr a.structural_descr b.structural_descr c.structural_descr) reprs in Concrete_triple.add memo_tbl key ty; Tbl.add instances ty key; Tbl.add embedded_types ty a; Tbl.add embedded_types ty b; Tbl.add embedded_types ty c; ty, true else dummy, false let is_instance_of ty = Tbl.mem instances ty let get_instance (type a) (type b) (type c) (ty:(a, b, c) poly t) = try Tbl.find instances ty with Not_found -> (* static typing ensures than [ty] has already been instantiated. *) assert false end (* ****************************************************************************) (** {2 Polymorphic4} *) (* ****************************************************************************) module type Polymorphic4_input = sig val name: 'a t -> 'b t -> 'c t -> 'd t -> string val module_name: string val structural_descr: Structural_descr.t -> Structural_descr.t -> Structural_descr.t -> Structural_descr.t -> Structural_descr.t type ('a, 'b, 'c, 'd) t val reprs: 'a -> 'b -> 'c -> 'd -> ('a, 'b, 'c, 'd) t list end module type Polymorphic4 = sig type ('a, 'b, 'c, 'd) poly val instantiate: 'a t -> 'b t -> 'c t -> 'd t -> ('a, 'b, 'c, 'd) poly t * bool val is_instance_of: 'a t -> bool val get_instance: ('a, 'b, 'c, 'd) poly t -> 'a t * 'b t * 'c t * 'd t end module Concrete_quadruple = Hashtbl.Make (struct type t = concrete_repr * concrete_repr * concrete_repr * concrete_repr let hash (x,y,z,t) = Hashtbl.hash (hash x, hash y, hash z, hash t) let equal (x1,y1,z1,t1) (x2,y2,z2,t2) = equal x1 x2 && equal y1 y2 && equal z1 z2 && equal t1 t2 end) module Polymorphic4(T:Polymorphic4_input) = struct type ('a, 'b, 'c, 'd) poly = ('a, 'b, 'c, 'd) T.t let memo_tbl : concrete_repr Concrete_quadruple.t = Concrete_quadruple.create 17 let instances : (concrete_repr * concrete_repr * concrete_repr * concrete_repr) Tbl.t = Tbl.create 17 let ml_name from_ty1 from_ty2 from_ty3 from_ty4 = Format.asprintf "%s.instantiate %t %t %t %t" T.module_name (from_ty1.pp_ml_name Call) (from_ty2.pp_ml_name Call) (from_ty3.pp_ml_name Call) (from_ty4.pp_ml_name Call) let instantiate a b c d = if !use_obj then let key = a, b, c, d in try Concrete_quadruple.find memo_tbl key, false with Not_found -> let reprs = List.fold_left (fun acc r1 -> List.fold_left (fun acc r2 -> List.fold_left (fun acc r3 -> List.fold_left (fun acc r4 -> T.reprs r1 r2 r3 r4 @ acc) acc (unsafe_reprs d)) acc (unsafe_reprs c)) acc (unsafe_reprs b)) [] (unsafe_reprs a) in let ty = register ~name:(T.name a b c d) ~ml_name:(Some (ml_name a b c d)) (T.structural_descr a.structural_descr b.structural_descr c.structural_descr d.structural_descr) reprs in Concrete_quadruple.add memo_tbl key ty; Tbl.add instances ty key; Tbl.add embedded_types ty a; Tbl.add embedded_types ty b; Tbl.add embedded_types ty c; Tbl.add embedded_types ty d; ty, true else dummy, false let is_instance_of ty = Tbl.mem instances ty let get_instance (type a) (type b) (type c) (type d) (ty:(a, b, c, d) poly t) = try Tbl.find instances ty with Not_found -> (* static typing ensures than [ty] has already been instantiated. *) assert false end (* ****************************************************************************) (** {2 Heterogeneous Tables} *) (* ****************************************************************************) module Ty_tbl(Info: sig type 'a t end) = struct type t = Obj.t Tbl.t let create x = Tbl.create x let add (type a) tbl (ty:a ty) (x:a Info.t) = Tbl.add tbl ty (Obj.repr x) let find (type a) tbl (ty:a ty) = (Obj.obj (Tbl.find tbl ty) : a Info.t) end module Obj_tbl: sig type 'a t val create: unit -> 'a t val add: 'a t -> 'b ty -> 'b -> 'a -> unit val find: 'a t -> 'b ty -> 'b -> 'a val mem: 'a t -> 'b ty -> 'b -> bool val iter: 'b t -> ('a ty -> 'a -> 'b -> unit) -> unit end = struct module O = Hashtbl.Make(struct type t = Obj.t let equal = (==) let hash x = if !use_obj then (* 0 is correct; trying to do a bit better... *) let tag = Obj.tag x in if tag = 0 then 0 else if tag = Obj.closure_tag then (* Buggy code with OCaml 4.01, deactivated for now (* assumes that the first word of a closure does not change in any way (even by Gc.compact invocation). *) Obj.magic (Obj.field x 0)*) (* to be tested (suggested by Damien D.): add a 'xor 0' *) (* Obj.magic (Obj.field x 0)*) 0 else Hashtbl.hash x else 0 end) type 'a t = 'a O.t Tbl.t let create () = Tbl.create 7 let add tbl ty k v = if !use_obj then let tytbl = try Tbl.find tbl ty with Not_found -> let tytbl = O.create 7 in Tbl.add tbl ty tytbl; tytbl in O.replace tytbl (Obj.repr k) v let find tbl ty k = if !use_obj then O.find (Tbl.find tbl ty) (Obj.repr k) else invalid_arg "cannot call function 'find' in the 'no obj' mode" let mem tbl ty k = try let objs = Tbl.find tbl ty in assert !use_obj; O.mem objs (Obj.repr k) with Not_found -> false let iter tbl f = Tbl.iter (fun ty objs -> O.iter (fun o v -> f ty (Obj.obj o) v) objs) tbl end module type Heterogeneous_table = sig type key type 'a info type t val create: int -> t val add: t -> key -> 'a ty -> 'a info -> unit exception Unbound_value of string exception Incompatible_type of string val find: t -> key -> 'a ty -> 'a info val iter: (key -> 'a ty -> 'a info -> unit) -> t -> unit val fold: (key -> 'a ty -> 'a info -> 'b -> 'b) -> t -> 'b -> 'b end module Make_tbl (Key: sig include Hashtbl.HashedType val to_string: t -> string end) (Info: sig type 'a t end) = struct type key = Key.t type 'a info = 'a Info.t type data = { ty: concrete_repr; o: Obj.t } module H = Hashtbl.Make(Key) type t = data H.t exception Incompatible_type of string let create x = H.create x let add tbl s ty x = if !use_obj then begin let name = Key.to_string s in if H.mem tbl s then raise (AlreadyExists name); H.add tbl s { ty = ty; o = Obj.repr x } end exception Unbound_value of string let type_error s ty_name ty_name' = raise (Incompatible_type (Format.sprintf "%s has type %s but is used with type %s" s ty_name' ty_name)) let find tbl s ty = if !use_obj then let name = Key.to_string s in let data = try H.find tbl s with Not_found -> raise (Unbound_value name) in if ty.digest <> data.ty.digest then type_error name ty.name data.ty.name; Obj.obj data.o else invalid_arg "cannot call function 'find' in the 'no obj' mode" let iter f tbl = if !use_obj then H.iter (fun k v -> f k v.ty (Obj.obj v.o)) tbl else invalid_arg "cannot call function 'iter' in the 'no obj' mode" let fold f tbl acc = if !use_obj then H.fold (fun k v acc -> f k v.ty (Obj.obj v.o) acc) tbl acc else invalid_arg "cannot call function 'fold' in the 'no obj' mode" end module String_tbl = Make_tbl (struct type t = string let hash x = Hashtbl.hash x let equal : string -> string -> bool = (=) let to_string x = x end) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/datatype/type.mli0000666000000000000000000003537113571573400017266 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Type value. A type value is a value representing a static ML monomorphic type. This API is quite low level. Prefer to use module {!Datatype} instead whenever possible. @plugin development guide *) (* ****************************************************************************) (** {2 Type declaration} *) (* ****************************************************************************) type 'a t (** Type of type values. For each monomorphic type [ty], a value of type [ty t] dynamically represents the type [ty]. Such a value is called a type value and should be unique for each static monomorphic type. @plugin development guide *) type 'a ty = 'a t (* ****************************************************************************) (** {2 Pretty printing materials} *) (* ****************************************************************************) (** Precedences used for generating the minimal number of parenthesis in combination with function {!par} below. *) type precedence = | Basic (** @plugin development guide *) | Call (** @plugin development guide *) | Tuple | List | NoPar (** [par context myself fmt pp] puts parenthesis around the verbatim prints by [pp] according to the precedence [myself] of the verbatim and to the precedence [context] of the caller of the pretty printer. [fmt] is the output formatter. The typical use is the following: [let pretty_print p_caller fmt x = let pp fmt = Format.fprintf "..." ... x ... in let myself = Call in par p_caller myself fmt pp] @plugin development guide *) val par: precedence -> precedence -> Format.formatter -> (Format.formatter -> unit) -> unit (** [par_ty_name f ty] puts parenthesis around the name of the [ty] iff [f ty] is [true]. @since Carbon-20101201 *) val par_ty_name: ('a t -> bool) -> 'a t -> string (* ****************************************************************************) (** {2 Constructor and getters} *) (* ****************************************************************************) exception AlreadyExists of string (** May be raised by {!register}. @plugin development guide *) val register: ?closure:bool -> name:string -> ml_name:string option -> Structural_descr.t -> 'a list -> 'a t (** [register ?closure ~name ~ml_name descr reprs] registers a new type value. Should not be used directly. Use one of functors of module {!Datatype} instead. [closure] is true iff the type is a function type. [name] is the name of the type. Must be a valid OCaml type name (eventually prefixed by a module path). [ml_name] is the OCaml name of the registered type value. @raise AlreadyExists if the given name is already used by another type. @raise Invalid_argument if [reprs] is the empty list @modify Boron-20100401 request a list of representant, not only a single one @modify Carbon-20101201 [value_name] is now [ml_name]. Must provide a structural descriptor. Argument [pp] does not exist anymore. *) exception No_abstract_type of string (** Apply this functor to access to the abstract type of the given name. @raise No_abstract_type if no such abstract type was registered. @since Nitrogen-20111001 @plugin development guide *) module Abstract(T: sig val name: string end): sig type t val ty: t ty end val name: 'a t -> string (** @plugin development name *) val structural_descr: 'a t -> Structural_descr.t val reprs: 'a t -> 'a list (** Not usable in the "no-obj" mode *) val digest: 'a t -> Digest.t val get_embedded_type_names: 'a t -> string list (** Get the list of names containing in the type represented by the given type value. For instance [get_embedded_type_names (Datatype.func Datatype.unit (Datatype.list Datatype.int))] returns [ "unit -> int list"; "unit"; "int list"; "int" ]. @since Oxygen-20120901 *) val ml_name: 'a t -> string val pp_ml_name: 'a t -> precedence -> Format.formatter -> unit val set_ml_name: 'a t -> string option -> unit val set_name: 'a t -> string -> unit (** @since Neon-20140301 *) (* ****************************************************************************) (** {2 Type values are comparable} *) (* ****************************************************************************) val equal: 'a t -> 'b t -> bool val compare: 'a t -> 'b t -> int val hash: 'a t -> int (* ****************************************************************************) (** {2 Polymorphic type values} Functors for handling polymorphic type: one type value must be registered for each monomorphic instance of a polymorphic type. *) (* ****************************************************************************) module type Polymorphic_input = sig val name: 'a t -> string (** How to build a name for each monomorphic instance of the type value from the underlying type. *) val module_name: string (** The name of the built module. *) val structural_descr: Structural_descr.t -> Structural_descr.t (** How to build the structural descriptor for each monomorphic instance. @since Carbon-20101201 *) type 'a t (** Static polymorphic type corresponding to its dynamic counterpart to register. *) val reprs: 'a -> 'a t list (** How to make the representant of each monomorphic instance of the polymorphic type value from an underlying representant. *) end (** For a polymorphic type value with one type variable, you must use an implementation of this signature. *) module type Polymorphic = sig type 'a poly (** Type of the polymorphic type (for instance ['a list]). It must be instantiated before used. See function [instantiate] below. *) val instantiate: 'a t -> 'a poly t * bool (** @return the monomorphic instantiation of the polymorph type with the given type value. For instance, if ['a poly = 'a list], then [instantiate int] returns the type value [int list]. *) val is_instance_of: 'a t -> bool (** @return [true] iff the given type value has been created from function [instantiate] above. For instance, [is_instance_of (instantiate int)] always returns [true] but [is_instance_of int] always returns [false]. *) val get_instance: 'a poly t -> 'a t (** [get_instance ty] returns the type value used to create the given monomorphic instantiation. *) end (** Generic implementation of polymorphic type value. *) module Polymorphic(T:Polymorphic_input) : Polymorphic with type 'a poly = 'a T.t (** See module {!Polymorphic_input}: very same functions with one additional argument corresponding to the second type variable. *) module type Polymorphic2_input = sig val name: 'a t -> 'b t -> string val module_name: string val structural_descr: Structural_descr.t -> Structural_descr.t -> Structural_descr.t type ('a, 'b) t val reprs: 'a -> 'b -> ('a, 'b) t list end (** Same as {!Polymorphic} for polymorphic types with two type variables. *) module type Polymorphic2 = sig type ('a, 'b) poly val instantiate: 'a t -> 'b t -> ('a, 'b) poly t * bool val is_instance_of: 'a t -> bool val get_instance: ('a, 'b) poly t -> 'a t * 'b t end (** Generic implementation of polymorphic type value with two type variables. *) module Polymorphic2(T:Polymorphic2_input) : Polymorphic2 with type ('a, 'b) poly = ('a, 'b) T.t (** Instance of {!Polymorphic2} for functions: same signature than {!Polymorphic2} with possibility to specify a label for the function parameter. *) module Function : sig type ('a, 'b) poly = 'a -> 'b val instantiate: ?label:(string * (unit -> 'a) option) -> 'a t -> 'b t -> ('a -> 'b) t * bool (** Possibility to add a label for the parameter. - [~label:(p,None)] for a mandatory labeled parameter [p]; - [~label:(p,Some f)] for an optional labeled parameter [p], with default value [f ()]. *) val is_instance_of: 'a t -> bool val get_instance: ('a -> 'b) t -> 'a t * 'b t * string option val get_optional_argument: ('a -> 'b) t -> (unit -> 'a) option end (** See module {!Polymorphic_input}: very same functions with two additional arguments corresponding to the second and third type variables. @since Oxygen-20120901 *) module type Polymorphic3_input = sig val name: 'a t -> 'b t -> 'c t -> string val module_name: string val structural_descr: Structural_descr.t -> Structural_descr.t -> Structural_descr.t -> Structural_descr.t type ('a, 'b, 'c) t val reprs: 'a -> 'b -> 'c -> ('a, 'b, 'c) t list end (** Same as {!Polymorphic} for polymorphic types with three type variables. @since Oxygen-20120901 *) module type Polymorphic3 = sig type ('a, 'b, 'c) poly val instantiate: 'a t -> 'b t -> 'c t -> ('a, 'b, 'c) poly t * bool val is_instance_of: 'a t -> bool val get_instance: ('a, 'b, 'c) poly t -> 'a t * 'b t * 'c t end (** Generic implementation of polymorphic type value with three type variables. @since Oxygen-20120901 *) module Polymorphic3(T:Polymorphic3_input) : Polymorphic3 with type ('a, 'b, 'c) poly = ('a, 'b, 'c) T.t (** See module {!Polymorphic_input}: very same functions with three additional arguments corresponding to the additional type variables. @since Oxygen-20120901 *) module type Polymorphic4_input = sig val name: 'a t -> 'b t -> 'c t -> 'd t -> string val module_name: string val structural_descr: Structural_descr.t -> Structural_descr.t -> Structural_descr.t -> Structural_descr.t -> Structural_descr.t type ('a, 'b, 'c, 'd) t val reprs: 'a -> 'b -> 'c -> 'd -> ('a, 'b, 'c, 'd) t list end (** Same as {!Polymorphic} for polymorphic types with four type variables. @since Oxygen-20120901 *) module type Polymorphic4 = sig type ('a, 'b, 'c, 'd) poly val instantiate: 'a t -> 'b t -> 'c t -> 'd t -> ('a, 'b, 'c, 'd) poly t * bool val is_instance_of: 'a t -> bool val get_instance: ('a, 'b, 'c, 'd) poly t -> 'a t * 'b t * 'c t * 'd t end (** Generic implementation of polymorphic type value with four type variables. @since Oxygen-20120901 *) module Polymorphic4(T:Polymorphic4_input) : Polymorphic4 with type ('a, 'b, 'c, 'd) poly = ('a, 'b, 'c, 'd) T.t (* ****************************************************************************) (** {2 Heterogeneous Tables} These tables are safe to use but nevertheless not for casual users. *) (* ****************************************************************************) (** @since Carbon-20101201 *) module type Heterogeneous_table = sig type key (** @since Carbon-20101201 *) type 'a info type t (** Type of heterogeneous (hash)tables indexed by values of type Key.t. Type values ensure type safety. *) val create: int -> t (** [create n] creates a new table of initial size [n]. *) val add: t -> key -> 'a ty -> 'a info -> unit (** [add tbl s ty v] binds [s] to the value [v] in the table [tbl]. If the returned value is a closure whose the type of one of its argument was dynamically registered, then it may raise [Incompatible_Type]. @raise AlreadyExists if [s] is already bound in [tbl]. @modify Nitrogen-20111001 returns [unit] now. *) exception Unbound_value of string exception Incompatible_type of string val find: t -> key -> 'a ty -> 'a info (** [find tbl s ty] returns the binding of [s] in the table [tbl]. @raise Unbound_value if [s] is not bound in [tbl]. @raise Incompatible_Type if [ty] was not the type value used to add the binding of [s] in [tbl]. *) val iter: (key -> 'a ty -> 'a info -> unit) -> t -> unit (** @since Oxygen-20120901 *) val fold: (key -> 'a ty -> 'a info -> 'b -> 'b) -> t -> 'b -> 'b (** @since Fluorine-20130401 *) end (** Build an heterogeneous table associating keys to info. Not efficient for types registered without ml name. @since Carbon-20101201 *) module Make_tbl (Key: sig include Hashtbl.HashedType val to_string: t -> string end) (Info: sig type 'a t end) : Heterogeneous_table with type key = Key.t and type 'a info = 'a Info.t (** Heterogeneous tables indexed by string. *) module String_tbl(Info: sig type 'a t end) : Heterogeneous_table with type key = string and type 'a info = 'a Info.t (** Heterogeneous tables indexed by type value. Roughly the same signature that [Hashtbl.S]. *) module Ty_tbl(Info: sig type 'a t end) : sig type t val create: int -> t val add: t -> 'b ty -> 'b Info.t -> unit val find: t -> 'b ty -> 'b Info.t end (** Heterogeneous table for the keys, but polymorphic for the values. *) module Obj_tbl: sig type 'a t val create: unit -> 'a t val add: 'a t -> 'b ty -> 'b -> 'a -> unit val find: 'a t -> 'b ty -> 'b -> 'a val mem: 'a t -> 'b ty -> 'b -> bool val iter: 'b t -> ('a ty -> 'a -> 'b -> unit) -> unit end (**/**) (* ****************************************************************************) (** {2 Internal API} *) (* ****************************************************************************) val no_obj: unit -> unit (** Deactivate all the black magic. Roughly, in this mode, nothing is done by this module. *) val may_use_obj: unit -> bool (** Internal use only. Please, do not use it yourself. *) val add_abstract_types: (string -> string -> unit) ref (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/datatype/unmarshal.ml0000666000000000000000000006127313571573400020126 0ustar (**************************************************************************) (* *) (* Copyright (C) 2009-2012 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* * Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* * Redistributions in binary form must reproduce the above *) (* copyright notice, this list of conditions and the following *) (* disclaimer in the documentation and/or other materials provided *) (* with the distribution. *) (* * Neither the name of the nor the names of its *) (* contributors may be used to endorse or promote products derived *) (* from this software without specific prior written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY ''AS IS'' AND ANY *) (* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *) (* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *) (* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE *) (* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *) (* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *) (* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *) (* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *) (* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *) (* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *) (* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *) (* DAMAGE. *) (* *) (**************************************************************************) (* caml_unmarshal by Ineffable Casters *) (* Version big-marshal. Patch by TrustInSoft. See - https://github.com/ocaml/ocaml/pull/224 - https://github.com/TrustInSoft/tis-interpreter/blob/master/src/libraries/datatype/unmarshal.ml *) (* Warning: If you are new to OCaml, don't take this as an example of good code. *) type t = | Abstract | Structure of structure | Transform of t * (Obj.t -> Obj.t) | Return of t * (unit -> Obj.t) | Dynamic of (unit -> t) and structure = | Sum of t array array | Dependent_pair of t * (Obj.t -> t) | Array of t ;; let arch_sixtyfour = Sys.word_size = 64;; let arch_bigendian = (Obj.magic [| 0x00002600 |] : string).[1] <> 'L';; let arch_float_endianness = (Obj.magic 1.23530711838574823e-307 : string).[1];; let ill_formed reason = let msg = "input_value: ill-formed message" in failwith (if false(*debug*) then Printf.sprintf "%s (%s)" msg reason else msg) let zeroword = Obj.field (Obj.repr 0L) 0;; let null = zeroword;; let id x = x;; (* Functions for deserializers. *) let getword ch = let c3 = Char.code (input_char ch) in let c2 = Char.code (input_char ch) in let c1 = Char.code (input_char ch) in let c0 = Char.code (input_char ch) in Int32.logor (Int32.shift_left (Int32.of_int c3) 24) (Int32.of_int ((c2 lsl 16) lor (c1 lsl 8) lor c0)) ;; let read8s ch = let c = Char.code (input_char ch) in if c < 128 then c else c lor (-1 lsl 8) ;; let read16s ch = let c1 = Char.code (input_char ch) in let c0 = Char.code (input_char ch) in let c1x = if c1 < 128 then c1 else c1 lor (-1 lsl 8) in (c1x lsl 8) lor c0 ;; let read32s ch = let c3 = Char.code (input_char ch) in let c2 = Char.code (input_char ch) in let c1 = Char.code (input_char ch) in let c0 = Char.code (input_char ch) in let c3x = if c3 < 128 then c3 else c3 lor (-1 lsl 8) in (c3x lsl 24) lor (c2 lsl 16) lor (c1 lsl 8) lor c0 ;; let read64s = if arch_sixtyfour then begin fun ch -> let c7 = Char.code (input_char ch) in let c6 = Char.code (input_char ch) in let c5 = Char.code (input_char ch) in let c4 = Char.code (input_char ch) in let c3 = Char.code (input_char ch) in let c2 = Char.code (input_char ch) in let c1 = Char.code (input_char ch) in let c0 = Char.code (input_char ch) in (c7 lsl 56) lor (c6 lsl 48) lor (c5 lsl 40) lor (c4 lsl 32) lor (c3 lsl 24) lor (c2 lsl 16) lor (c1 lsl 8) lor c0 end else begin fun _ -> failwith "input_value: integer too large" end ;; let read8u ch = Char.code (input_char ch);; let read16u ch = let c1 = Char.code (input_char ch) in let c0 = Char.code (input_char ch) in (c1 lsl 8) lor c0 ;; let read32u ch = let c3 = Char.code (input_char ch) in let c2 = Char.code (input_char ch) in let c1 = Char.code (input_char ch) in let c0 = Char.code (input_char ch) in (c3 lsl 24) lor (c2 lsl 16) lor (c1 lsl 8) lor c0 ;; let read64u = read64s;; let readheader32 ch = let c3 = Char.code (input_char ch) in let c2 = Char.code (input_char ch) in let c1 = Char.code (input_char ch) in let c0 = Char.code (input_char ch) in (* fst: read32u masked by 0xFF snd: read32u shifted right by 10 (Wosize_hd) *) (c0, (c1 lsr 2) lor (c2 lsl 6) lor (c3 lsl 14)) ;; let readheader64 = if arch_sixtyfour then begin fun ch -> let c7 = Char.code (input_char ch) in let c6 = Char.code (input_char ch) in let c5 = Char.code (input_char ch) in let c4 = Char.code (input_char ch) in let c3 = Char.code (input_char ch) in let c2 = Char.code (input_char ch) in let c1 = Char.code (input_char ch) in let c0 = Char.code (input_char ch) in (* fst: read64u masked by 0xFF snd: read64u shifted right by 10 (Wosize_hd) *) (c0, (c1 lsr 2) lor (c2 lsl 6) lor (c3 lsl 14) lor (c4 lsl 22) lor (c5 lsl 30) lor (c6 lsl 38) lor (c7 lsl 46)) end else begin fun _ -> failwith "input_value: data block too large" end ;; let readblock ch dest ofs len = unsafe_really_input ch (Obj.obj dest : bytes) ofs len ;; let readblock_rev ch dest ofs len = for i = len - 1 + ofs downto ofs do Bytes.unsafe_set (Obj.obj dest : bytes) i (input_char ch); done ;; (* Auxiliary functions for handling floats. *) let readfloat_same ch v i = readblock ch v (i * 8) 8;; let readfloat_reverse ch v i = readblock_rev ch v (i * 8) 8;; let readfloat_little = match arch_float_endianness with | '1' -> readfloat_same | '6' -> readfloat_reverse | '5' -> begin fun ch v i -> readblock ch v (i * 8 + 4) 4; readblock ch v (i * 8) 4; end | _ -> fun _ch _v _i -> failwith "input_value: non-standard floats" ;; let readfloat_big = match arch_float_endianness with | '1' -> readfloat_reverse | '6' -> readfloat_same | '5' -> begin fun ch v i -> readblock_rev ch v (i * 8) 4; readblock_rev ch v (i * 8 + 4) 4; end | _ -> fun _ch _v _i -> failwith "input_value: non-standard floats" ;; (* Auxiliary functions for handling closures. *) (* Not used by Frama-C, causing problems with ARM, see: http://lists.gforge.inria.fr/pipermail/frama-c-discuss/2013-August/003702.html let (code_area_start, cksum) = let s = Marshal.to_string id [Marshal.Closures] in let cksum = String.sub s 0x1E 16 in let c0 = Char.code s.[0x1D] in let c1 = Char.code s.[0x1C] in let c2 = Char.code s.[0x1B] in let c3 = Char.code s.[0x1A] in let ofs = Int32.logor (Int32.shift_left (Int32.of_int c3) 24) (Int32.of_int ((c2 lsl 16) lor (c1 lsl 8) lor c0)) in let start = Obj.add_offset (Obj.field (Obj.repr id) 0) (Int32.neg ofs) in (start, cksum) ;; *) let check_const ch s = try for i = 0 to String.length s - 1 do if input_char ch <> s.[i] then raise Exit done; false with Exit -> true ;; (* Auxiliary functions for handling Custom blocks. *) let buflen = 100;; let buf = Bytes.create buflen;; let bufs = ref [];; let read_customident ch = let rec loop i = let c = input_char ch in if c = '\000' then begin if !bufs = [] then Bytes.sub buf 0 i else begin let res = Bytes.concat Bytes.empty (List.rev (Bytes.sub buf 0 i :: !bufs)) in bufs := []; res end end else if i >= buflen then begin assert (i = buflen); bufs := Bytes.copy buf :: !bufs; loop 0 end else begin Bytes.set buf i c; loop (i + 1) end in loop 0 |> Bytes.to_string ;; let custom_table = (Hashtbl.create 13 : (string, in_channel -> Obj.t) Hashtbl.t) ;; let register_custom id f = Hashtbl.add custom_table id f;; let read_custom ch id = try (Hashtbl.find custom_table id) ch with Not_found -> failwith ("input_value: unknown custom data type: " ^ id) ;; (* Large arrays. *) (* Wish there were a way to do it conditionally on Sys.word_size *) module LA = struct type 'a t = 'a array array;; let inner_sz_log = 21;; let inner_sz = 1 lsl inner_sz_log;; let mask = inner_sz - 1;; let make size init : _ t = let outer_sz = size / inner_sz + 1 in let res = Array.make outer_sz [| |] in let rec loop sz i = if sz > inner_sz then begin res.(i) <- Array.make inner_sz init; loop (sz - inner_sz) (i + 1); end else begin res.(i) <- Array.make sz init; end in loop size 0; res ;; let get a i = a.(i asr inner_sz_log).(i land mask);; let set a i v = a.(i asr inner_sz_log).(i land mask) <- v;; end (* Main function. *) type frame = { st_ty : t; st_ctr : int; st_constr : int; mutable st_cur : int; st_obj : Obj.t; };; let rec get_field_type t tag i prev = match t with | Abstract -> Abstract | Structure (Sum a) -> a.(tag).(i) | Structure (Dependent_pair(a, _f)) when i = 0 -> a | Structure (Dependent_pair(_a, f)) when i = 1 -> f prev | Structure (Dependent_pair(_a, _f)) -> assert false | Structure (Array a) -> a | Transform (t1, _) -> get_field_type t1 tag i prev | Return (t1, _) -> get_field_type t1 tag i prev | Dynamic _ -> assert false ;; let rec do_transform t v = match t with | Abstract | Structure _ -> v | Transform (t1, f) -> f (do_transform t1 v) | Return (t1, f) -> ignore (do_transform t1 v); f () | Dynamic _ -> assert false ;; let rec get_structure t context = match t with | Abstract | Structure _ -> (t, context) | Transform (t1, _) -> get_structure t1 true | Return (t1, _) -> get_structure t1 false | Dynamic _ -> assert false ;; (* let intext_magic_number_small = "\x84\x95\xA6\xBE";; let intext_magic_number_big = "\x84\x95\xA6\xBF";; *) let input_val ch t = set_binary_mode_in ch true; let num_objects = if check_const ch "\x84\x95\xA6" then failwith "input_value: bad object"; let last_char = input_char ch in match last_char with | '\xBF' -> (* See https://github.com/ocaml/ocaml/blob/c065a0995c0a18fcc2430977dbc887766b6ffe45/byterun/extern.c#L626 https://github.com/ocaml/ocaml/blob/e2d0a13165b31cb06d4a7bdba3847198b32e1bd4/byterun/caml/intext.h#L43 *) if check_const ch "\x00\x00\x00\x00" then failwith "input_value: bad object (reserved bytes should be 0)"; ignore (read64s ch); (* block_len *) let n = read64u ch in ignore (read64s ch); (* size_64 *) n | '\xBE' -> ignore (getword ch); (* block_len *) let n = read32u ch in ignore (getword ch); (* size_32 *) ignore (getword ch); (* size_64 *) n | _ -> failwith "input_value: bad object" in let tbl = LA.make num_objects null in let patch = LA.make num_objects [] in let ctr = ref 0 in let rec intern_rec stk t = let read_ch () = let code = read8u ch in match code with | 0x00 (* CODE_INT8 *) -> let v = Obj.repr (read8s ch) in return stk (do_transform t v) | 0x01 (* CODE_INT16 *) -> let v = Obj.repr (read16s ch) in return stk (do_transform t v) | 0x02 (* CODE_INT32 *) -> let v = Obj.repr (read32s ch) in return stk (do_transform t v) | 0x03 (* CODE_INT64 *) -> if arch_sixtyfour then begin let v = Obj.repr (read64s ch) in return stk (do_transform t v) end else begin failwith "input_value: integer too large" end | 0x04 (* CODE_SHARED8 *) -> let ofs = read8u ch in read_shared stk ofs | 0x05 (* CODE_SHARED16 *) -> let ofs = read16u ch in read_shared stk ofs | 0x06 (* CODE_SHARED32 *) -> let ofs = read32u ch in read_shared stk ofs | 0x14 (* CODE_SHARED64 *) -> let ofs = read64u ch in read_shared stk ofs | 0x08 (* CODE_BLOCK32 *) -> let (tag, size) = readheader32 ch in read_block stk t tag size | 0x13 (* CODE_BLOCK64 *) -> let (tag, size) = readheader64 ch in read_block stk t tag size | 0x09 (* CODE_STRING8 *) -> let len = read8u ch in read_string stk t len | 0x0A (* CODE_STRING32 *) -> let len = read32u ch in read_string stk t len | 0x15 (* CODE_STRING64 *) -> let len = read64u ch in read_string stk t len | 0x0C (* CODE_DOUBLE_LITTLE *) -> read_double stk t readfloat_little | 0x0B (* CODE_DOUBLE_BIG *) -> read_double stk t readfloat_big | 0x0E (* CODE_DOUBLE_ARRAY8_LITTLE *) -> let len = read8u ch in read_double_array stk t len readfloat_little | 0x0D (* CODE_DOUBLE_ARRAY8_BIG *) -> let len = read8u ch in read_double_array stk t len readfloat_big | 0x07 (* CODE_DOUBLE_ARRAY32_LITTLE *) -> let len = read32u ch in read_double_array stk t len readfloat_little | 0x0F (* CODE_DOUBLE_ARRAY32_BIG *) -> let len = read32u ch in read_double_array stk t len readfloat_big | 0x17 (* CODE_DOUBLE_ARRAY64_LITTLE *) -> let len = read64u ch in read_double_array stk t len readfloat_little | 0x16 (* CODE_DOUBLE_ARRAY64_BIG *) -> let len = read64u ch in read_double_array stk t len readfloat_big | 0x10 (* CODE_CODEPOINTER *) -> assert false (* NOT USED BY Frama-C let ofs = getword ch in check_const ch cksum "input_value: code mismatch"; let offset_pointer = Obj.add_offset code_area_start ofs in return stk (do_transform t offset_pointer) *) | 0x11 (* CODE_INFIXPOINTER *) -> let ofs = getword ch in let clos = intern_rec [] t in return stk (Obj.add_offset (Obj.repr clos) ofs) | 0x12 | 0x19 (* CODE_CUSTOM (deprecated) or CODE_CUSTOM_FIXED *) -> let id = read_customident ch in let v = read_custom ch id in let dest = !ctr in ctr := dest + 1; return_block stk t v dest | 0x18 (* CODE_CUSTOM_LEN *) -> let id = read_customident ch in (* Note: CODE_CUSTOM_FIXED and CODE_CUSTOM_LEN has the length of the payload statically computable, but contrary to the C code, we don't check that the size matches. *) let _sz_32 = read32u ch in let _sz_64 = read64u ch in let v = read_custom ch id in let dest = !ctr in ctr := dest + 1; return_block stk t v dest | _ when code >= 0x80 (* PREFIX_SMALL_BLOCK *) -> let tag = code land 0xF in let size = (code lsr 4) land 0x7 in read_block stk t tag size | _ when code >= 0x40 (* PREFIX_SMALL_INT *) -> let v = Obj.repr (code land 0x3F) in return stk (do_transform t v) | _ when code >= 0x20 (* PREFIX_SMALL_STRING *) -> let len = code land 0x1F in read_string stk t len | _ -> ill_formed (Printf.sprintf "code 0x%x" code) in match t with | Dynamic f -> intern_rec stk (f ()) | Abstract | Structure (Array _ | Sum _ | Dependent_pair _) | Transform _ | Return _ -> read_ch () and read_block stk t tag size = (* read one block of the given tag and size *) let (t1, alloc) = get_structure t true in begin match t1 with | Abstract -> () | Structure (Dependent_pair(_, _)) -> if tag >= 1 || size != 2 then begin ill_formed "dep pair" end | Structure (Sum a) -> if tag >= Array.length a || size != Array.length a.(tag) then begin let s = Format.sprintf "structure sum tag=%d size=%d len=%d len-tag=%d" tag size (Array.length a) (Array.length a.(tag)) in ill_formed s end | Structure (Array _) -> () | _ -> assert false end; let v = if alloc then Obj.new_block tag size else Obj.repr size in if size > 0 then begin let fr = { st_ty = t; st_ctr = !ctr; st_constr = tag; st_cur = 0; st_obj = v; } in let t2 = get_field_type t tag 0 (Obj.repr 0) in ctr := !ctr + 1; intern_rec (fr :: stk) t2 end else begin return stk (do_transform t v) end and read_string stk t len = let v = Obj.repr (Bytes.create len) in readblock ch v 0 len; let dest = !ctr in ctr := dest + 1; return_block stk t v dest and read_double stk t readfloat = let v = Obj.dup (Obj.repr 1.0) in readfloat ch v 0; let dest = !ctr in ctr := dest + 1; return_block stk t v dest and read_double_array stk t len readfloat = let v = Obj.repr (Array.make len 0.0) in for i = 0 to len - 1 do readfloat ch v i done; let dest = !ctr in ctr := dest + 1; return_block stk t v dest and read_shared stk ofs = if ofs <= 0 || ofs > !ctr then begin ill_formed "shared" end; let v = LA.get tbl (!ctr - ofs) in if v == null then begin match stk with | [] -> assert false | f :: _ -> let p = LA.get patch (!ctr - ofs) in LA.set patch (!ctr - ofs) ((f.st_ctr, f.st_cur) :: p); return stk null end else begin return stk v end and return stk v = match stk with | [] -> Obj.obj v | f :: stk1 -> let sz = if Obj.is_int f.st_obj then (Obj.obj f.st_obj : int) else begin Obj.set_field f.st_obj f.st_cur v; Obj.size f.st_obj end in f.st_cur <- f.st_cur + 1; if f.st_cur >= sz then return_block stk1 f.st_ty f.st_obj f.st_ctr else intern_rec stk (get_field_type f.st_ty f.st_constr f.st_cur v) and return_block stk t v dest = (* call alloc, patch, and return *) let res = do_transform t v in LA.set tbl dest res; let f (ix, ofs) = Obj.set_field (LA.get tbl ix) ofs res in List.iter f (LA.get patch dest); LA.set patch dest []; return stk res in intern_rec [] t ;; (* Functions for handling Int32, Int64, and Nativeint custom blocks. *) let readint64_little32 ch = let result = Obj.dup (Obj.repr 0L) in readblock_rev ch result 4 8; result ;; let readint64_big32 ch = let result = Obj.dup (Obj.repr 0L) in readblock ch result 4 8; result ;; let readint64_little64 ch = let result = Obj.dup (Obj.repr 0L) in readblock_rev ch result 8 8; result ;; let readint64_big64 ch = let result = Obj.dup (Obj.repr 0L) in readblock ch result 8 8; result ;; register_custom "_j" (if arch_bigendian then if arch_sixtyfour then readint64_big64 else readint64_big32 else if arch_sixtyfour then readint64_little64 else readint64_little32 ) ;; let readint32_little32 ch = let result = Obj.dup (Obj.repr 0l) in readblock_rev ch result 4 4; result ;; let readint32_big32 ch = let result = Obj.dup (Obj.repr 0l) in readblock ch result 4 4; result ;; let readint32_little64 ch = let result = Obj.dup (Obj.repr 0l) in readblock_rev ch result 8 4; result ;; let readint32_big64 ch = let result = Obj.dup (Obj.repr 0l) in readblock ch result 8 4; result ;; register_custom "_i" (if arch_bigendian then if arch_sixtyfour then readint32_big64 else readint32_big32 else if arch_sixtyfour then readint32_little64 else readint32_little32 ) ;; let readnativeint_little32 ch = let code = read8u ch in let result = Obj.dup (Obj.repr 0n) in if code = 1 then (readblock_rev ch result 4 4; result) else if code = 2 then failwith "input_value: native integer value too large" else failwith "input_value: ill-formed native integer" ;; let readnativeint_big32 ch = let code = read8u ch in let result = Obj.dup (Obj.repr 0n) in if code = 1 then (readblock ch result 4 4; result) else if code = 2 then failwith "input_value: native integer value too large" else failwith "input_value: ill-formed native integer" ;; let readnativeint_little64 ch = let code = read8u ch in let result = Obj.dup (Obj.repr 0n) in if code = 1 then (readblock_rev ch result 8 4; result) else if code = 2 then (readblock_rev ch result 8 8; result) else failwith "input_value: ill-formed native integer" ;; let readnativeint_big64 ch = let code = read8u ch in let result = Obj.dup (Obj.repr 0n) in if code = 1 then (readblock ch result 12 4; result) else if code = 2 then (readblock ch result 8 8; result) else failwith "input_value: ill-formed native integer" ;; register_custom "_n" (if arch_bigendian then if arch_sixtyfour then readnativeint_big64 else readnativeint_big32 else if arch_sixtyfour then readnativeint_little64 else readnativeint_little32 ) ;; let ge_ocaml ~major ?(minor=0) ?(rev=0) () = let test x y z = x > major || (x = major && (y > minor || y = minor && z >= rev)) in Scanf.sscanf Sys.ocaml_version "%d.%d.%d" test let ge_ocaml_4 = ge_ocaml ~major:4 () let ge_ocaml_403 = ge_ocaml ~major:4 ~minor:3 () let t_unit = Abstract;; let t_int = Abstract;; let t_string = Abstract;; let t_float = Abstract;; let t_bool = Abstract;; let t_int32 = Abstract;; let t_int64 = Abstract;; let t_nativeint = Abstract;; let t_record args = Structure (Sum [| args |]);; let t_tuple = t_record;; let t_list a = let rec x = Structure (Sum [| [| a; x |] |]) in x;; let t_ref a = t_record [| a |];; let t_option = t_ref;; let t_array a = Structure (Array a) let t_queue a = if ge_ocaml_403 then (* queue cells are only a list-like structure, but there is no distinguishable difference at this level. *) t_record [| t_int; t_list a; t_list a |] else t_record [| t_int; t_list a |] (**** Hash tables ****) type ('a, 'b) _caml_hashtable = { mutable size: int; (* number of elements *) mutable data: ('a, 'b) _bucketlist array } (* the buckets *) and ('a, 'b) _caml_hashtable_4_ = { mutable _size: int; (* number of entries *) mutable _data: ('a, 'b) _bucketlist array; (* the buckets *) mutable _seed: int; (* for randomization *) _initial_size: int; (* initial array size *) } and ('a, 'b) _bucketlist = Empty | Cons of 'a * 'b * ('a, 'b) _bucketlist let t_hashtbl bucket = if not (ge_ocaml_4) then t_record [| Abstract ; t_array bucket |] else t_record [| Abstract ; t_array bucket; Abstract; Abstract |] (* version 1: loading keys do not change their hash value *) let t_hashtbl_unchangedhashs key value = let rec bucket = Structure (Sum [| [| key; value; bucket |] |]) in t_hashtbl bucket (* version 2: keys change hash value in the unmarshalling+transformation *) let t_hashtbl_changedhashs create add key value = Dynamic (fun () -> let new_hashtbl = create 27 in let return_new_hashtbl () = Obj.repr new_hashtbl in let rec bucket = Transform (Structure (Sum [| [| key; value; bucket |] |]), fun cell -> ( match Obj.obj cell with Empty -> () | Cons (k, v, _) -> add new_hashtbl k v); Obj.repr Empty ) in Return (t_hashtbl bucket, return_new_hashtbl)) (**** Sets ****) type elt type _caml_set = Empty | Node of _caml_set * elt * _caml_set * int let t_set_unchangedcompares t_elt = let rec t_set = Structure (Sum [| [| t_set; t_elt; t_set; Abstract |] |] ) in t_set (**** Maps ****) type key type 'a _caml_map = Empty | Node of 'a _caml_map * key * 'a * 'a _caml_map * int let t_map_unchangedcompares t_key t_elt = let rec t_map = Structure (Sum [| [| t_map; t_key; t_elt; t_map; Abstract |] |] ) in t_map frama-c-20.0-Calcium/src/libraries/datatype/unmarshal.mli0000666000000000000000000001721413571573400020273 0ustar (**************************************************************************) (* *) (* Copyright (C) 2009-2012 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* * Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* * Redistributions in binary form must reproduce the above *) (* copyright notice, this list of conditions and the following *) (* disclaimer in the documentation and/or other materials provided *) (* with the distribution. *) (* * Neither the name of the nor the names of its *) (* contributors may be used to endorse or promote products derived *) (* from this software without specific prior written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY ''AS IS'' AND ANY *) (* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *) (* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *) (* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE *) (* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *) (* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *) (* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *) (* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *) (* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *) (* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *) (* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *) (* DAMAGE. *) (* *) (**************************************************************************) (* caml_unmarshal by Ineffable Casters *) (* Version 3.11.2.0 *) (** Provides a function [input_val], similar in functionality to the standard library function [Marshal.from_channel]. The main difference with [Marshal.from_channel] is that [input_val] is able to apply transformation functions on the values on the fly as they are read from the input channel. Because it has an abstract representation of the type, [input_val] is able to catch some inconsistencies that [Marshal.from_channel] cannot. It is therefore "more" type-safe, but only if it is always used in conditions where the static type attributed to the result by the type-checker agrees with the representation of the type passed as second argument to [input_val]. No such verification is done by this module (this would require changes to the compiler). The sanity checks are not the primary purpose of [input_val], and it is possible for a bug where the representation of a value of the wrong type is passed to [input_val] to go undetected, just as this can happen with [Marshal.from_channel]. *) type t = | Abstract | Structure of structure | Transform of t * (Obj.t -> Obj.t) | Return of t * (unit -> Obj.t) | Dynamic of (unit -> t) and structure = | Sum of t array array | Dependent_pair of t * (Obj.t -> t) | Array of t (** Type [t] is used to describe the type of the data to be read and the transformations to be applied to the data. [Abstract] is used to input a value without any checking or transformation (as [Marshal.from_channel] does). In this case, you don't need to provide a precise description of the representation of the data. [Structure a] is used to provide a description of the representation of the data, along with optional transformation functions for parts of the data. [a] can be: - [Array(t)], indicating that the data is an array of values of the same type, each value being described by [t]. - [Sum(c)] for describing a non-array type where [c] is an array describing the non-constant constructors of the type being described (in the order of their declarations in that type). Each element of this latter array is an array of [t] that describes (in order) the fields of the corresponding constructor. - [Dependent_pair(e,f)] for instructing the unmarshaler to reconstruct the first component of a pair first, using [e] as its description, and to apply function [f] to this value in order to get the description of the pair's second component. The shape of [a] must match the shape of the representation of the type of the data being imported, or [input_val] may report an error when the data doesn't match the description. [Transform (u, f)] is used to specify a transformation function on the data described by [u]. [input_val] will read and rebuild the data as described by [u], then call [f] on that data and return the result returned by [f]. [Return (u, f)] is the same as [Transform], except that the data is not rebuilt, and [()] is passed to [f] instead of the data. This is to be used when the transformation functions of [u] rebuild the data by side effects and the version rebuilt by [input_val] is irrelevant. [Dynamic f] is used to build a new description on the fly when a new data of the current type is encountered. *) val input_val : in_channel -> t -> 'a (** [input_val c t] Read a value from the input channel [c], applying the transformations described by [t]. *) val null : Obj.t (** recursive values cannot be completely formed at the time they are passed to their transformation function. When traversing a recursive value, the transformation function must check the fields for physical equality to [null] (with the function [==]) and avoid using any field that is equal to [null]. *) val id : Obj.t -> Obj.t (** Use this function when you don't want to change the value unmarshaled by input_val. You can also use your own identity function, but using this one is more efficient. *) (** {2 Convenience functions for describing transformations.} *) val t_unit : t val t_int : t val t_string : t val t_float : t val t_bool : t val t_int32 : t val t_int64 : t val t_nativeint : t val t_record : t array -> t val t_tuple : t array -> t val t_list : t -> t val t_ref : t -> t val t_option : t -> t val t_array : t -> t val t_queue: t -> t val t_hashtbl_unchangedhashs :t -> t -> t val t_hashtbl_changedhashs : (int -> 'table) -> ('table -> 'key -> 'value -> unit) -> t -> t -> t val t_set_unchangedcompares : t -> t val t_map_unchangedcompares : t -> t -> t (** {2 Functions for writing deserializers.} *) val register_custom : string -> (in_channel -> Obj.t) -> unit val arch_sixtyfour : bool val arch_bigendian : bool val getword : in_channel -> Int32.t val read8s : in_channel -> int val read16s : in_channel -> int val read32s : in_channel -> int val read64s : in_channel -> int val read8u : in_channel -> int val read16u : in_channel -> int val read32u : in_channel -> int val read64u : in_channel -> int val readblock : in_channel -> Obj.t -> int -> int -> unit val readblock_rev : in_channel -> Obj.t -> int -> int -> unit frama-c-20.0-Calcium/src/libraries/datatype/unmarshal_hashtbl_test.ml0000666000000000000000000001156613571573400022672 0ustar (**************************************************************************) (* *) (* Copyright (C) 2009-2012 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* * Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* * Redistributions in binary form must reproduce the above *) (* copyright notice, this list of conditions and the following *) (* disclaimer in the documentation and/or other materials provided *) (* with the distribution. *) (* * Neither the name of the nor the names of its *) (* contributors may be used to endorse or promote products derived *) (* from this software without specific prior written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY ''AS IS'' AND ANY *) (* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *) (* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *) (* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE *) (* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *) (* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *) (* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *) (* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *) (* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *) (* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *) (* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *) (* DAMAGE. *) (* *) (**************************************************************************) open Unmarshal let l = [ 512; 35; 62; 512; 42; 62; 17 ] let t_renumber_int = let tbl = Hashtbl.create 42 in let count = ref 0 in let f x = match ((Obj.magic x) : int ) with | x -> let result = try Hashtbl.find tbl x with Not_found -> let c = !count in count := succ c; Hashtbl.add tbl x c; c in Obj.repr (result : int ) in Transform (t_option t_int, f) let t_l = t_list t_renumber_int let () = let oc = open_out_bin "test-file" in Marshal.to_channel oc l []; close_out oc; let ic = open_in_bin "test-file" in let result = input_val ic t_l in close_in ic; List.iter (print_int ) result; print_endline "fin test1" let l = [ Some 512; Some 35; Some 62; Some 512; Some 42; Some 62; Some 17 ] let t_renumber_intopt = let tbl = Hashtbl.create 42 in let count = ref 0 in let f x = match ((Obj.magic x) : int option) with None -> assert false | Some x -> let result = try Hashtbl.find tbl x with Not_found -> let c = !count in count := succ c; Hashtbl.add tbl x c; c in Obj.repr (Some(result) : int option) in Transform (t_option t_int, f) let t_l = t_list t_renumber_intopt let () = let oc = open_out_bin "test-file" in Marshal.to_channel oc l []; close_out oc; let ic = open_in_bin "test-file" in let result = input_val ic t_l in close_in ic; List.iter (function None -> () | (Some(i)) -> print_int i) result; print_endline "fin test2" let h = Hashtbl.create 12;; let () = Hashtbl.add h 34 "s34"; Hashtbl.add h 63 "s63" let t_h1 = t_hashtbl_changedhashs Hashtbl.create Hashtbl.add t_renumber_int Abstract let () = let oc = open_out_bin "test-file" in Marshal.to_channel oc h []; close_out oc; let ic = open_in_bin "test-file" in let result = input_val ic t_h1 in close_in ic; Hashtbl.iter (fun k v -> Format.printf "%d %s@." k v) result; print_endline "fin test3" let t_h2 = t_hashtbl_unchangedhashs t_int Abstract let () = let oc = open_out_bin "test-file" in Marshal.to_channel oc h []; close_out oc; let ic = open_in_bin "test-file" in let result = input_val ic t_h2 in close_in ic; Hashtbl.iter (fun k v -> Format.printf "%d %s@." k v) result; print_endline "fin test4" frama-c-20.0-Calcium/src/libraries/datatype/unmarshal_test.ml0000666000000000000000000002011713571573400021155 0ustar (**************************************************************************) (* *) (* Copyright (C) 2009-2012 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* * Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* * Redistributions in binary form must reproduce the above *) (* copyright notice, this list of conditions and the following *) (* disclaimer in the documentation and/or other materials provided *) (* with the distribution. *) (* * Neither the name of the nor the names of its *) (* contributors may be used to endorse or promote products derived *) (* from this software without specific prior written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY ''AS IS'' AND ANY *) (* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *) (* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *) (* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE *) (* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *) (* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *) (* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *) (* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *) (* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *) (* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *) (* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *) (* DAMAGE. *) (* *) (**************************************************************************) (* caml_unmarshal by Ineffable Casters *) (* Version 3.11.1.8 *) (* Basic testing only. *) open Printf;; open Unmarshal;; (* 0. Identification. *) printf "Testing: ";; if arch_sixtyfour then printf "64-bit " else printf "32-bit " ;; if arch_bigendian then printf "big-endian " else printf "little-endian " ;; match (Obj.magic 1.23530711838574823e-307 : string).[1] with | '1' -> printf "(floats are little-endian)...\n" | '6' -> printf "(floats are big-endian)...\n" | '5' -> printf "(floats are ARM-style mixed-endian)...\n" | _ -> printf "(floats have unknown endianness)...\n" ;; flush stdout;; (* 1. Testing without transformation function. *) let wrt v t = let oc = open_out_bin "test-file" in Marshal.to_channel oc v [Marshal.Closures]; close_out oc; let ic = open_in_bin "test-file" in let result = input_val ic t in close_in ic; result ;; let wr v = wrt v Abstract;; let check cond msg = if not cond then failwith (sprintf "test failed (%s)" msg) ;; let counter = ref 0;; let test v = incr counter; check (wr v = v) (sprintf "wr%d" !counter); ;; (* SMALL_INT, INT8, INT16, INT32, INT64 *) for i = -130 to 130 do test i; done;; for i = -32780 to -32750 do test i; done;; for i = 32750 to -32780 do test i; done;; test (-1_000_000);; test 1_000_000_000;; test (1 lsl 60);; test (-1 lsl 60);; test max_int;; test min_int;; (* SMALL_STRING, STRING8, STRING32 *) test "short";; for i = 0 to 40 do test (String.create i) done;; for i = 250 to 260 do test (String.create i) done;; test (String.create 1255);; (* DOUBLE_*, DOUBLE_ARRAY8_*, DOUBLE_ARRAY32_* *) test 0.0;; test 1.0;; test infinity;; test (-. infinity);; test 1.234e-225;; for i = 0 to 300 do test (Array.init i float_of_int) done;; (* SMALL_BLOCK, BLOCK32 *) test [1; 2; 3];; type t0 = | C01 of int | C02 of int * int | C03 of int * int * int | C04 of int * int * int * int | C05 of int * int * int * int * int | C06 of int * int * int * int * int * int | C07 of int * int * int * int * int * int * int | C08 of int | C09 of int * int * int * int * int * int * int | C10 of int * int * int * int * int * int | C11 of int * int * int * int * int | C12 of int * int * int * int | C13 of int * int * int | C14 of int * int | C15 of int | C16 of int * int * int * int * int * int * int * int ;; test [ C01 (1); C02 (1, 2); C03 (1, 2, 3); C04 (1, 2, 3, 4); C05 (1, 2, 3, 4, 5); C06 (1, 2, 3, 4, 5, 6); C07 (1, 2, 3, 4, 5, 6, 7); C08 (1); C09 (1, 2, 3, 4, 5, 6, 7); C10 (1, 2, 3, 4, 5, 6); C11 (1, 2, 3, 4, 5); C12 (1, 2, 3, 4); C13 (1, 2, 3); C14 (1, 2); C15 (1); C16 (1, 2, 3, 4, 5, 6, 7, 8); ];; type t1 = | A | B of int | C of float | D of bool | E | F | G | H | I | J ;; test [A; B 10; C 100.; D false; E; F; G; H; I];; (* SHARED8 *) let rec l = J :: I :: H :: G :: F :: E :: D true :: C 1e100 :: B (-1000) :: A :: l in let v = wr l in for i = 0 to 9; do check (List.nth l i = List.nth v i) "share1"; check (List.nth v i == List.nth v (i + 10)) "share2"; done;; let a = ref 0;; let b = ref 1;; let x = Array.make 1_000_000 a;; for i = 1 to 499_999 do x.(2 * i) <- b done;; let v = (wr x : int ref array);; check (v.(0) == v.(1)) "share3";; check (v.(1) == v.(999_999)) "share4";; check (v.(2) == v.(400_000)) "share5";; check (v.(2) == v.(999_998)) "share6";; (* SHARED8, SHARED16, SHARED32 *) for i = 1 to 499_999 do x.(2 * i) <- ref i done;; let v = (wr x : int ref array);; v.(0) := -1;; for i = 1 to 499_999 do check (!(v.(2 * i)) = i) "share7"; check (v.(2 * i + 1) == v.(0)) "share8"; done;; (* CODEPOINTER *) let raw_value x = let result = Obj.dup (Obj.repr 0L) in let foo = (Obj.obj result : Int64.t) in Obj.set_field result 1 (Obj.repr x); foo ;; let value_raw x = Obj.field (Obj.repr x) 1;; let x = fun x -> (x + 1);; let v = (wr x : int -> int);; check (v 0 = 1) "code1";; let x = let a = 1 in let b = 2 in fun x -> (x + a, x + b) ;; let v = (wr x : int -> int * int);; check (fst (v 10) = 11) "code2";; check (snd (v 10) = 12) "code3";; (* INFIXPOINTER *) let rec f x = if x = 0 then g x else x + 10 and g x = if x <> 0 then f x else x + 20 ;; let v = (wr f : int -> int);; check (v 0 = 20) "infix0";; check (v 5 = 15) "infix1";; let w = (wr g : int -> int);; check (w 0 = 20) "infix2";; check (w 5 = 15) "infix3";; (* CUSTOM *) test 0l;; test 1l;; test 0x7FFFFFFFl;; test 0x80000000l;; test 0L;; test (-1L);; test 0x7fffffffffffffffL;; test 0x8000000000000000L;; test 0n;; test 1n;; test 10n;; test 0x7fffffffn;; test 0x80000000n;; (* 2. Testing with transformation functions. *) let v = [1; 2; 3; 4; 5; 12847];; let double x = let x = (Obj.obj x : int) in Obj.repr (x + x);; let t_list2 = t_list (Transform (t_int, double));; let test v = incr counter; let w = wrt v t_list2 in let f x y = check (x + x = y) (sprintf "list2-%d" !counter) in List.iter2 f v w; ;; test v;; let t_list3 = t_list (Return (t_int, fun () -> (Obj.repr 1)));; let test v ty = incr counter; let w = wrt v ty in let f x y = check (1 = y) (sprintf "list3-%d" !counter) in List.iter2 f v w; ;; test v t_list3;; let t_list4 = Dynamic (fun () -> t_list3);; test v t_list4;; (* 3. Testing multi-allocated constructors. *) type t = A of int * int | B of int let l = [ A (3, 4); B 5 ] let t_l = t_list (Structure (Sum [| [| Abstract; Abstract |]; [| Abstract |] |]));; let test v ty = incr counter; let w = wrt v ty in check (v = w) (sprintf "list3-%d" !counter) ;; test l t_l;; (* 4. Conclusion. *) printf "All tests passed.\n";; frama-c-20.0-Calcium/src/libraries/datatype/unmarshal_z.ml0000666000000000000000000000531713571573400020454 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** unmarshal zarith custom blocks *) open Unmarshal;; let readz ch = let sign = read8u ch in let charlen = read32u ch in let str = Bytes.create charlen in readblock ch (Obj.repr str) 0 charlen; (* My beautiful string reversing code; now useless :( let max = pred charlen in for i = 0 to (pred max) / 2 do let c = str.[i] in str.[i] <- str.[max - i] ; str.[max - i] <- c done; *) let n = Z.of_bits (Bytes.to_string str) in let z = if sign = 0 then n else Z.neg n in Obj.repr z ;; register_custom "_z" readz;; (* #load "zarith.cma" ;; let f = open_out "test" ;; let i = ref (-10000000000000000L) ;; while !i <= 10000000000000000L do output_value f (Z.of_int64 (!i)) ; i := Int64.add !i 100000000000L ; done ;; ocamlc -custom zarith.cma unmarshal.ml unz.ml *) (* let f = open_in "test" ;; let i = ref (-10000000000000000L) ;; while !i <= 10000000000000000L do let z = input_val f Abstract in let r = Z.to_int64 z in if (r <> !i) then begin Format.printf "read: %Ld expected: %Ld@." r !i; assert false end; i := Int64.add !i 100000000000L ; done ;; *) frama-c-20.0-Calcium/src/libraries/datatype/unmarshal_z.mli0000666000000000000000000000316013571573400020617 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Nothing is exported. *) frama-c-20.0-Calcium/src/libraries/project/0000777000000000000000000000000013571573400015424 5ustar frama-c-20.0-Calcium/src/libraries/project/project.ml0000666000000000000000000007313113571573400017431 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************** *) (** {2 Project skeleton} *) (* ************************************************************************** *) open Project_skeleton open Output (* re-exporting record fields *) type project = t = private { pid : int; mutable name : string; mutable unique_name : string } let rehash_ref = ref (fun _ -> assert false) module D = Datatype.Make_with_collections (struct type t = project let name = "Project" let structural_descr = Structural_descr.t_record [| Structural_descr.p_int; Structural_descr.p_string; Structural_descr.p_string |] let reprs = [ dummy ] let equal = (==) let compare p1 p2 = Datatype.Int.compare p1.pid p2.pid let hash p = p.pid let rehash x = !rehash_ref x let copy = Datatype.undefined let internal_pretty_code p_caller fmt p = let pp f = Format.fprintf f "@[Project.from_unique_name@;%S@]" p.unique_name in Type.par p_caller Type.Call fmt pp let pretty fmt p = Format.fprintf fmt "project %S" p.unique_name let varname p = "p_" ^ p.name let mem_project f x = f x end) include (D: Datatype.S_no_copy with type t = Project_skeleton.t) module Project_tbl = Hashtbl.Make(D) (* ************************************************************************** *) (** {2 States operations} *) (* ************************************************************************** *) let current_selection = ref State_selection.empty let get_current_selection () = !current_selection module States_operations = struct module H = Hashtbl open State module Hashtbl = H let iter f x = current_selection := State_selection.full; State_dependency_graph.G.iter_vertex (fun s -> f s x) State_dependency_graph.graph let iter_on_selection ?(iter=State_selection.iter) ?(selection=State_selection.full) f x = current_selection := selection; iter (fun s -> f s x) selection let fold_on_selection ?(selection=State_selection.full) f x = current_selection := selection; State_selection.fold (fun s -> f s x) selection let create = iter (fun s -> (private_ops s).create) let remove = iter (fun s -> (private_ops s).remove) let clean = iter (fun s -> (private_ops s).clean) let commit ?selection = iter_on_selection ?selection (fun s -> (private_ops s).commit) let update ?selection = (* since the developer may add hooks on update which may depend on each others, iterating in the dependencies order is required. *) iter_on_selection ~iter:State_selection.iter_in_order ?selection (fun s -> (private_ops s).update) let clear ?(selection=State_selection.full) p = debug ~dkey ~level:2 "clearing following selection:@. @[%a@]@.%a" State_selection.pretty_witness selection State_selection.pretty selection; let clear s = (private_ops s).clear in if State_selection.is_full selection then iter clear p (* clearing the static states also clears the dynamic ones *) else begin current_selection := selection; State_selection.iter (fun s -> clear s p) selection end let clear_some_projects ?selection f p = let states_to_clear = fold_on_selection ?selection (fun s p acc -> let is_cleared = (private_ops s).clear_some_projects f p in if is_cleared then State_selection.union (State_selection.with_dependencies s) acc else acc) p State_selection.empty in if not (State_selection.is_empty states_to_clear) then begin warning "clearing dangling project pointers in project %S" p.unique_name; debug ~dkey ~once:true ~append:(fun fmt -> Format.fprintf fmt "@]") "@[the involved states are:%t" (fun fmt -> iter_on_selection ~selection:states_to_clear (fun s () -> Format.fprintf fmt "@ %S" (get_name s)) ()) end let copy ?selection src = iter_on_selection ?selection (fun s -> (private_ops s).copy src) let serialize ?selection p = fold_on_selection ?selection (fun s p acc -> (get_unique_name s, (private_ops s).serialize p) :: acc) p [] let unserialize ?selection dst loaded_states = let pp_err fmt n msg_sing msg_plural = if n > 0 then begin warning ~once:true fmt n (if n = 1 then "" else "s") (if n = 1 then msg_sing else msg_plural) end in let tbl = Hashtbl.create 97 in List.iter (fun (k, v) -> Hashtbl.add tbl k v) loaded_states; let invalid_on_disk = State.Hashtbl.create 7 in iter_on_selection ?selection (fun s () -> try let n = get_unique_name s in let d = Hashtbl.find tbl n in (try (private_ops s).unserialize dst d; (* do not remove if [State.Incompatible_datatype] occurs *) Hashtbl.remove tbl n with | Not_found -> fatal "unexpected 'Not_found' when unserializing; \ possibly an issue with a hook" | State.Incompatible_datatype _ -> (* datatype of [s] on disk is incompatible with the one in RAM: as [dst] is a new project, [s] is already equal to its default value. However must clear the dependencies for consistency, but it is doable only when all states are loaded. *) State.Hashtbl.add invalid_on_disk s ()) with Not_found -> (* [s] is in RAM but not on disk: silently ignore it! Furthermore, all the dependencies of [s] are consistent with this default value. So no need to clear them. Whenever the value of [s] in [dst] changes, the dependencies will be cleared (if required by the user). *) ()) (); (* warns for the saved states that cannot be loaded (either they are not in RAM or they are incompatible). *) let nb_ignored = Hashtbl.fold (fun _ s n -> if s.on_disk_saved then succ n else n) tbl 0 in pp_err "%d state%s in saved file ignored. \ %s this Frama-C configuration." nb_ignored "It is invalid in" "They are invalid in"; if debug_atleast 1 then Hashtbl.iter (fun k s -> if s.on_disk_saved then debug ~dkey "ignoring state %s" k) tbl; (* after loading, reset dependencies of incompatible states *) let to_be_cleared = State.Hashtbl.fold (fun s () -> State_selection.union (State_selection.only_dependencies s)) invalid_on_disk State_selection.empty in let nb_cleared = State_selection.cardinal to_be_cleared in if nb_cleared > 0 then begin pp_err "%d state%s in memory reset to their default value. \ %s this Frama_C configuration." nb_cleared "It is inconsistent in" "They are inconsistent in"; clear ~selection:to_be_cleared dst end end let guarded_feedback selection level fmt_msg = if verbose_atleast level then if State_selection.is_full selection then feedback ~dkey ~level fmt_msg else let n = State_selection.cardinal selection in if n = 0 then Pretty_utils.nullprintf fmt_msg else let states fmt = if n > 1 then Format.fprintf fmt " (for %d states)" n else Format.fprintf fmt " (for 1 state)" in feedback ~dkey ~level ~append:states fmt_msg; else Pretty_utils.nullprintf fmt_msg let dft_sel () = State_selection.full module Q = Qstack.Make(struct type t = project let equal = equal end) let projects = Q.create () (* The stack of projects. *) let current () = Q.top projects let is_current p = equal p (current ()) let last_created_by_copy_ref: t option ref = ref None let () = Cmdline.last_project_created_by_copy := (fun () -> match !last_created_by_copy_ref with | None -> None | Some p -> Some p.unique_name) let iter_on_projects f = Q.iter f projects let fold_on_projects f acc = Q.fold f acc projects let find_all name = Q.filter (fun p -> p.name = name) projects exception Unknown_project let from_unique_name uname = try Q.find (fun p -> p.unique_name = uname) projects with Not_found -> raise Unknown_project module Mem = struct let mem s = try ignore (from_unique_name s); true with Unknown_project -> false end module Setter = Make_setter(Mem) let unjournalized_set_name p s = feedback ~dkey ~level:2 "renaming project %S to %S" p.unique_name s; Setter.set_name p s let set_name = Journal.register "Project.set_name" (Datatype.func2 ty Datatype.string Datatype.unit) unjournalized_set_name module Create_Hook = Hook.Build(struct type t = project end) let register_create_hook = Create_Hook.extend let force_create name = feedback ~dkey ~level:2 "creating project %S" name; let p = Setter.make name in feedback ~dkey ~level:3 "its unique name is %S" p.unique_name; Q.add_at_end p projects; States_operations.create p; Create_Hook.apply p; p let journalized_create = Journal.register "Project.create" (Datatype.func Datatype.string ty) force_create (* do not journalise the first call to [create] *) let create = let first = ref true in fun name -> let p = if !first then force_create name else journalized_create name in first := false; p let get_name p = p.name let get_unique_name p = p.unique_name exception NoProject = Q.Empty module Set_Current_Hook_User = Hook.Build (struct type t = project end) module Set_Current_Hook = Hook.Build(struct type t = project end) let register_after_set_current_hook ~user_only = if user_only then Set_Current_Hook_User.extend else Set_Current_Hook.extend let unjournalized_set_current = let apply_hook = ref false in fun on selection p -> if not (Q.mem p projects) then invalid_arg ("Project.set_current: " ^ p.unique_name ^ " does not exist"); let old = current () in States_operations.commit ~selection old; (try Q.move_at_top p projects with Invalid_argument _ -> assert false); let level = if on then 3 else 2 in guarded_feedback selection level "%S is now the current project" p.unique_name; assert (equal p (current ())); States_operations.update ~selection p; (* do not apply hook if an hook calls [set_current] *) if not !apply_hook then begin apply_hook := true; if not on then Set_Current_Hook_User.apply old; Set_Current_Hook.apply old; apply_hook := false end let journalized_set_current = let lbl = Datatype.optlabel_func in Journal.register "Project.set_current" (lbl "on" (fun () -> false) Datatype.bool (lbl "selection" dft_sel State_selection.ty (Datatype.func ty Datatype.unit))) unjournalized_set_current let set_current ?(on=false) ?(selection=State_selection.full) p = if not (equal p (current ())) then journalized_set_current on selection p let set_current_as_last_created () = Extlib.may (fun p -> set_current p) !last_created_by_copy_ref (** Indicates if we should keep [p] as the current project when calling {!on p}. *) let keep_current: bool ref = ref false let unjournalized_set_keep_current b = keep_current := b let set_keep_current = Journal.register "Project.set_keep_current" (Datatype.func Datatype.bool Datatype.unit) unjournalized_set_keep_current let on ?selection p f x = let old_current = current () in if old_current == p then f x else let set p = set_current ~on:true ?selection p in let rec set_to_old old = if not !keep_current then try (* if someone asks for keeping [p] as current during the execution of [f], do not restore [old_current] at the end. *) set old with Invalid_argument _ -> (* the old current project has been remove: replace it by the previous one, if any *) if Q.length projects < 2 then warning "cannot restore project '%s'. Keep '%s' as default project." old_current.unique_name (current ()).unique_name else set_to_old (Q.nth 1 projects) in let go () = set p; let r = f x in set_to_old old_current; r in if debug_atleast 1 then go () else begin try go () with e -> set_to_old old_current; raise e end (* [set_current] must never be called internally. *) module Hide_set_current = struct let set_current () = assert false end open Hide_set_current (* Silence warning on unused and unexported functions *) let () = if false then set_current () exception Cannot_remove of string module Before_remove = Hook.Build(struct type t = project end) let register_before_remove_hook = Before_remove.extend let unjournalized_remove project = feedback ~dkey ~level:2 "removing project %S" project.unique_name; if Q.length projects = 1 then raise (Cannot_remove project.unique_name); Before_remove.apply project; States_operations.remove project; let old_current = current () in Q.remove project projects; if equal project old_current then begin (* we removed the current project. So there is a new current project and we have to update the local states according to it. *) let c = current () in States_operations.update c; Set_Current_Hook_User.apply c end; (* if we removed the last created_by_copy project, there is no last one *) Extlib.may (fun p -> if equal project p then last_created_by_copy_ref := None) !last_created_by_copy_ref; (* clear all the states of other projects referring to the delete project *) Q.iter (States_operations.clear_some_projects (equal project)) projects (* Gc.major ()*) let journalized_remove = Journal.register "Project.remove" (Datatype.optlabel_func "project" current ty (Datatype.func Datatype.unit Datatype.unit)) (fun project () -> unjournalized_remove project) let remove ?(project=current()) () = journalized_remove project () let remove_all () = feedback ~dkey ~level:2 "removing all existing projects"; try iter_on_projects Before_remove.apply; States_operations.clean (); Q.clear projects; last_created_by_copy_ref := None; Gc.full_major () with NoProject -> () let journalized_copy = let lbl = Datatype.optlabel_func in Journal.register "Project.copy" (lbl "selection" dft_sel State_selection.ty (lbl "src" current ty (Datatype.func ty Datatype.unit))) (fun selection src dst -> guarded_feedback selection 2 "copying project from %S to %S" src.unique_name dst.unique_name; States_operations.commit ~selection src; States_operations.copy ~selection src dst) let copy ?(selection=State_selection.full) ?(src=current()) dst = journalized_copy selection src dst module Before_Clear_Hook = Hook.Build(struct type t = project end) let register_todo_before_clear = Before_Clear_Hook.extend module After_Clear_Hook = Hook.Build(struct type t = project end) let register_todo_after_clear = After_Clear_Hook.extend let journalized_clear = let lbl = Datatype.optlabel_func in Journal.register "Project.clear" (lbl "selection" dft_sel State_selection.ty (lbl "project" current ty (Datatype.func Datatype.unit Datatype.unit))) (fun selection project () -> guarded_feedback selection 2 "clearing project %S" project.unique_name; Before_Clear_Hook.apply project; States_operations.clear ~selection project; After_Clear_Hook.apply project; (*Gc.major ()*)) let clear ?(selection=State_selection.full) ?(project=current()) () = journalized_clear selection project () let unjournalized_clear_all () = Q.iter States_operations.clear projects; Gc.full_major () let clear_all = Journal.register "Project.clear_all" (Datatype.func Datatype.unit Datatype.unit) unjournalized_clear_all (* ************************************************************************** *) (* Save/load *) (* ************************************************************************** *) exception IOError = Sys_error module Before_load = Hook.Make(struct end) let register_before_load_hook = Before_load.extend module After_load = Hook.Make(struct end) let register_after_load_hook = After_load.extend module After_global_load = Hook.Make(struct end) let register_after_global_load_hook = After_global_load.extend let magic = 9 (* magic number *) let save_projects selection projects filename = if Cmdline.use_obj then begin let cout = open_out_bin filename in output_value cout Config.version; output_value cout magic; output_value cout !Graph.Blocks.cpt_vertex; let states : (t * (string * State.state_on_disk) list) list = Q.fold (fun acc p -> (* project + serialized version of all its states *) (p, States_operations.serialize ~selection p) :: acc) [] projects in (* projects are stored on disk from the current one to the last project. !last_created_by_copy_ref must be saved at the same time to share the project on disk *) output_value cout (List.rev states, !last_created_by_copy_ref); close_out cout; end else abort "saving a file is not supported in the 'no obj' mode" let unjournalized_save selection project filename = guarded_feedback selection 2 "saving project %S into file %S" project.unique_name filename; save_projects selection (Q.singleton project) filename let journalized_save = let lbl = Datatype.optlabel_func in Journal.register "Project.save" (lbl "selection" dft_sel State_selection.ty (lbl "project" current ty (Datatype.func Datatype.string Datatype.unit))) unjournalized_save let save ?(selection=State_selection.full) ?(project=current()) filename = journalized_save selection project filename let unjournalized_save_all selection filename = guarded_feedback selection 2 "saving the current session into file %S" filename; save_projects selection projects filename let journalized_save_all = let lbl = Datatype.optlabel_func in Journal.register "Project.save_all" (lbl "selection" dft_sel State_selection.ty (Datatype.func Datatype.string Datatype.unit)) unjournalized_save_all let save_all ?(selection=State_selection.full) filename = journalized_save_all selection filename module Descr = struct let project_under_copy_ref: project option ref = ref None (* The project which is currently copying. Only set by [create_by_copy]. In this case, there is no possible dangling project pointers (projects at saving time and at loading time are the same). Furthermore, we have to merge pre-existing projects and loaded projects, except the project under copy. *) module Rehash = Hashtbl.Make (struct type t = project let hash p = Hashtbl.hash p.pid let equal x y = match !project_under_copy_ref with | Some p when p.pid <> x.pid && p.pid <> y.pid -> (* Merge projects on disk with pre-existing projects, except the project under copy; so don't use (==) in this context. *) x.pid = y.pid | None | Some _ -> (* In all other cases, don't merge. (==) ensures that there is no sharing between a pre-existing project and a project on disk. Great! *) x == y end) let rehash_cache : project Rehash.t = Rehash.create 7 let existing_projects : unit Project_tbl.t = Project_tbl.create 7 let rehash p = (* Format.printf "REHASHING %S (%d;%x)@." p.unique_name p.pid (Extlib.address_of_value p);*) try Rehash.find rehash_cache p with Not_found -> let v = create p.name (* real name set when loading the key project *) in Rehash.add rehash_cache p v; v let () = rehash_ref := rehash let init project_under_copy = assert (Rehash.length rehash_cache = 0 && Project_tbl.length existing_projects = 0); project_under_copy_ref := project_under_copy; Q.fold (fun acc p -> Project_tbl.add existing_projects p (); p :: acc) [] projects let finalize loaded_states selection = (match !project_under_copy_ref with | None -> List.iter (fun ( (p, _)) -> States_operations.clear_some_projects ~selection (fun p -> not (Project_tbl.mem existing_projects p)) p) loaded_states | Some _ -> ()); Rehash.clear rehash_cache; Project_tbl.clear existing_projects let global_state name selection = let state_on_disk s = (* Format.printf "State %S@." s;*) let descr = try State.get_descr (State.get s) with State.Unknown -> Structural_descr.p_unit (* dummy value *) in Descr.t_record [| descr; Structural_descr.p_bool; Structural_descr.p_bool; Structural_descr.p_string |] State.dummy_state_on_disk in let tbl_on_disk = Descr.dependent_pair Descr.t_string state_on_disk in let one_state = let unmarshal_states p = Descr.dynamic (fun () -> (* Local states must be up-to-date according to [p] when unmarshalling states of [p] *) unjournalized_set_current true selection p; Before_load.apply (); Descr.t_list tbl_on_disk) in Descr.dependent_pair descr unmarshal_states in let final_one_state = Descr.transform one_state (fun (p, s as c) -> (* if we provide an explicit name different of the current one, rename project [p] *) (match name with Some s when s <> p.name -> set_name p s | _ -> ()); Project_tbl.add existing_projects p (); (* At this point, the local states are always up-to-date according to the current project, since we load first the old current project *) States_operations.unserialize ~selection p s; After_load.apply (); c) in Descr.t_pair (Descr.t_list final_one_state) (Descr.t_option D.descr) (* the last saved project *) let input_val = Descr.input_val end let load_projects ~project_under_copy selection ?name filename = if Cmdline.use_obj then begin let cin = open_in_bin filename in let gen_read f cin = try f cin with | End_of_file -> close_in cin; abort "unexpected end of file while loading '%s'" filename | Failure s -> close_in cin; raise (IOError s) in let read = gen_read input_value in let check_magic cin to_string current = let old = read cin in if old <> current then begin close_in cin; let s = Format.sprintf "project saved with an incompatible version (old: %S,current: %S)" (to_string old) (to_string current) in raise (IOError s) end in check_magic cin (fun x -> x) Config.version; check_magic cin (fun n -> "magic number " ^ string_of_int n) magic; let ocamlgraph_counter = read cin in let pre_existing_projects = Descr.init project_under_copy in let loaded_states, last_created = gen_read (fun c -> Descr.input_val c (Descr.global_state name selection)) cin in close_in cin; last_created_by_copy_ref := last_created; Descr.finalize loaded_states selection; Graph.Blocks.after_unserialization ocamlgraph_counter; (* [set_current] done when unmarshalling and hooks may reorder projects: rebuild it in the good order *) let last = current () in Q.clear projects; let loaded_projects = List.fold_right (fun (p, _) acc -> Q.add p projects; p :: acc) loaded_states [] in List.iter (fun p -> Q.add p projects) pre_existing_projects; (* We have to restore all the local states if the last loaded project is not the good current one. The trick is to call [set_current] on [current ()], but we ensure that this operation **does** something (that is not the case by default) by putting [last] as current project temporarily. *) let true_current = current () in Q.add last projects; unjournalized_set_current true selection true_current; Q.remove last projects; After_global_load.apply (); loaded_projects end else abort "loading a file is not supported in the 'no obj' mode" let unjournalized_load ~project_under_copy selection name filename = guarded_feedback selection 2 "loading the project saved in file %S" filename; match load_projects ~project_under_copy selection ?name filename with | [ p ] -> p | [] | _ :: _ :: _ -> assert false let journalized_load = let lbl = Datatype.optlabel_func in Journal.register "Project.load" (lbl "selection" dft_sel State_selection.ty (lbl "name" (fun () -> None) (Datatype.option Datatype.string) (Datatype.func Datatype.string ty))) (unjournalized_load ~project_under_copy:None) let load ?(selection=State_selection.full) ?name filename = journalized_load selection name filename let unjournalized_load_all selection filename = remove_all (); guarded_feedback selection 2 "loading the session saved in file %S" filename; try ignore (load_projects ~project_under_copy:None selection filename) with IOError _ as e -> unjournalized_set_current false selection (create "default"); raise e let journalized_load_all = let lbl = Datatype.optlabel_func in Journal.register "Project.load_all" (lbl "selection" dft_sel State_selection.ty (Datatype.func Datatype.string Datatype.unit)) unjournalized_load_all let load_all ?(selection=State_selection.full) filename = journalized_load_all selection filename module Create_by_copy_hook = Hook.Build(struct type t = project * project end) let create_by_copy_hook f = Create_by_copy_hook.extend (fun (src, dst) -> f src dst) let unjournalized_create_by_copy selection src last name = guarded_feedback selection 2 "creating project %S by copying project %S" name (src.unique_name); let filename = try Extlib.temp_file_cleanup_at_exit "frama_c_create_by_copy" ".sav" with Extlib.Temp_file_error s -> abort "cannot create temporary file: %s" s in save ~selection ~project:src filename; try let prj = unjournalized_load ~project_under_copy:(Some src) selection (Some name) filename in Extlib.safe_remove filename; if last then last_created_by_copy_ref := Some prj; Create_by_copy_hook.apply (src, prj); prj with e -> Extlib.safe_remove filename; raise e let journalized_create_by_copy = let lbl = Datatype.optlabel_func in Journal.register "Project.create_by_copy" (lbl "selection" dft_sel State_selection.ty (lbl "src" current ty (Datatype.func2 ~label1:("last", None) Datatype.bool Datatype.string ty))) unjournalized_create_by_copy let create_by_copy ?(selection=State_selection.full) ?(src=current()) ~last name = journalized_create_by_copy selection src last name (* ************************************************************************** *) (** {2 Undoing} *) (* ************************************************************************** *) module Undo = struct let short_filename = "frama_c_undo_restore" let filename = ref "" let clear_breakpoint () = Extlib.safe_remove !filename let restore () = if Cmdline.use_obj then begin try Journal.prevent load_all !filename; Journal.restore (); clear_breakpoint () with IOError s -> feedback ~dkey "cannot restore the last breakpoint: %S" s; clear_breakpoint () end let breakpoint () = if Cmdline.use_obj then begin clear_breakpoint (); filename := (try Extlib.temp_file_cleanup_at_exit short_filename ".sav" with Extlib.Temp_file_error s -> abort "cannot create temporary file: %s" s); Journal.prevent save_all !filename; Journal.save () end end (* Exporting Datatype for an easy external use *) module Datatype = D (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/project.mli0000666000000000000000000003253013571573400017600 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Projects management. A project groups together all the internal states of Frama-C. An internal state is roughly the result of a computation which depends of an AST. It is possible to have many projects at the same time. For registering a new state in the Frama-C projects, apply the functor {!State_builder.Register}. @plugin development guide *) (* ************************************************************************* *) (** {2 Types for project} *) (* ************************************************************************* *) include Datatype.S_no_copy with type t = Project_skeleton.t module Datatype: Datatype.S_with_collections with type t = Project_skeleton.t (* re-exporting record fields *) type project = Project_skeleton.t = private { pid : int; mutable name : string; mutable unique_name : string } (** Type of a project. *) (* ************************************************************************* *) (** {2 Operations on all projects} *) (* ************************************************************************* *) val create: string -> t (** Create a new project with the given name and attach it after the existing projects (so the current project, if existing, is unchanged). The given name may be already used by another project. If there is no other project, then the new one is the current one. *) val register_create_hook: (t -> unit) -> unit (** [register_create_hook f] adds a hook on function [create]: each time a new project [p] is created, [f p] is applied. The order in which hooks are applied is the same than the order in which hooks are registered. *) exception NoProject (** May be raised by [current]. *) val current: unit -> t (** The current project. @raise NoProject if there is no project. @plugin development guide *) val is_current: t -> bool (** Check whether the given project is the current one or not. *) val iter_on_projects: (t -> unit) -> unit (** iteration on project starting with the current one. *) val fold_on_projects: ('a -> t -> 'a) -> 'a -> 'a (** folding on project starting with the current one. @since Boron-20100401 *) val find_all: string -> t list (** Find all projects with the given name. *) val clear_all: unit -> unit (** Clear all the projects: all the internal states of all the projects are now empty (wrt the action registered with {!register_todo_after_global_clear} and {!register_todo_after_clear}. *) (* ************************************************************************* *) (** {2 Operations on one project} Most operations have one additional selection as argument. If it is specified, the operation is only applied on the states of the given selection on the given project. Beware that the project may become inconsistent if your selection is incorrect. *) (* ************************************************************************* *) val get_name: t -> string (** Project name. Two projects may have the same name. *) val get_unique_name: t -> string (** @return a project name based on {!name} but different of each others [unique_name]. *) val set_name: t -> string -> unit (** Set the name of the given project. @since Boron-20100401 *) exception Unknown_project val from_unique_name: string -> t (** Return a project based on {!unique_name}. @raise Unknown_project if no project has this unique name. @modify Sodium-20150201 *) val set_current: ?on:bool -> ?selection:State_selection.t -> t -> unit (** Set the current project with the given one. The flag [on] is not for casual users. @raise Invalid_argument if the given project does not exist anymore. @plugin development guide *) val register_after_set_current_hook: user_only:bool -> (t -> unit) -> unit (** [register_after_set_current_hook f] adds a hook on function {!set_current}. The project given as argument to [f] is the old current project. - If [user_only] is [true], then each time {!set_current} is directly called by an user of this library, [f ()] is applied. - If [user_only] is [false], then each time {!set_current} is applied (even indirectly through {!Project.on}), [f ()] is applied. The order in which each hook is applied is unspecified. *) val on: ?selection:State_selection.t -> t -> ('a -> 'b) -> 'a -> 'b (** [on p f x] sets the current project to [p], computes [f x] then restores the current project. You should use this function if you use a project different of [current ()]. @modify Carbon-20101201 replace the optional arguments [only] and [except] by a single one [selection]. @plugin development guide *) val set_keep_current: bool -> unit (** [set_keep_current b] keeps the current project forever (even after the end of the current {!on}) iff [b] is [true]. @since Aluminium-20160501 *) (**/**) val set_current_as_last_created: unit -> unit (**/**) val copy: ?selection:State_selection.t -> ?src:t -> t -> unit (** Copy a project into another one. Default project for [src] is [current ()]. Replace the destination by [src]. For each state to copy, the function [copy] given at state registration time must be fully implemented. @modify Carbon-20101201 replace the optional arguments [only] and [except] by a single one [selection]. *) val create_by_copy: ?selection:State_selection.t -> ?src:t -> last:bool -> string -> t (** Return a new project with the given name by copying some states from the project [src]. All the other states are initialized with their default values. Use the save/load mechanism for copying. Thus it does not require that the copy function of the copied state is implemented. All the hooks applied when loading a project are applied (see {!load}). If [last], then remember that the returned project is the last created one (see {!last_created_by_copy}). @modify Carbon-20101201 replace the optional arguments [only] and [except] by a single one [selection]. @modify Sodium-20150201 add the labeled argument [last]. *) val create_by_copy_hook: (t -> t -> unit) -> unit (** Register a hook to call at the end of {!create_by_copy}. The first argument of the registered function is the copy source while the second one is the created project. *) val clear: ?selection:State_selection.t -> ?project:t -> unit -> unit (** Clear the given project. Default project is [current ()]. All the internal states of the given project are now empty (wrt the action registered with {!register_todo_on_clear}). @modify Carbon-20101201 replace the optional arguments [only] and [except] by a single one [selection]. @plugin development guide *) val register_todo_before_clear: (t -> unit) -> unit (** Register an action performed just before clearing a project. @since Boron-20100401 *) val register_todo_after_clear: (t -> unit) -> unit (** Register an action performed just after clearing a project. @since Boron-20100401 *) exception Cannot_remove of string (** Raised by [remove] *) val remove: ?project:t -> unit -> unit (** Default project is [current ()]. If the current project is removed, then the new current project is the previous current project if it still exists (and so on). @raise Cannot_remove if there is only one project. *) val register_before_remove_hook: (t -> unit) -> unit (** [register_before_remove_hook f] adds a hook called just before removing a project. @since Beryllium-20090902 *) (* ************************************************************************* *) (** {3 Inputs/Outputs} *) (* ************************************************************************* *) exception IOError of string val save: ?selection:State_selection.t -> ?project:t -> string -> unit (** Save a given project in a file. Default project is [current ()]. @raise IOError if the project cannot be saved. @modify Carbon-20101201 replace the optional arguments [only] and [except] by a single one [selection]. @plugin development guide *) val load: ?selection:State_selection.t -> ?name:string -> string -> t (** Load a file into a new project given by its name. More precisely, [load only except name file]: {ol {- creates a new project;} {- performs all the registered [before_load] actions;} {- loads the (specified) states of the project according to its description; and} {- performs all the registered [after_load] actions.} } @raise IOError if the project cannot be loaded @return the new project containing the loaded data. @modify Carbon-20101201 replace the optional arguments [only] and [except] by a single one [selection]. @plugin development guide *) val save_all: ?selection:State_selection.t -> string -> unit (** Save all the projects in a file. @modify Carbon-20101201 replace the optional arguments [only] and [except] by a single one [selection]. @raise IOError a project cannot be saved. *) val load_all: ?selection:State_selection.t -> string -> unit (** First remove all the existing project, then load all the projects from a file. For each project to load, the specification is the same than {!Project.load}. Furthermore, after loading, all the hooks registered by [register_after_set_current_hook] are applied. @modify Carbon-20101201 replace the optional arguments [only] and [except] by a single one [selection]. @raise IOError if a project cannot be loaded. *) val register_before_load_hook: (unit -> unit) -> unit (** [register_before_load_hook f] adds a hook called just before loading **each project** (more precisely, the project exists and but is empty while the hook is applied): if [n] projects are on disk, the same hook will be called [n] times (one call by project). Besides, for each project, the order in which the hooks are applied is the same than the order in which hooks are registered. *) val register_after_load_hook: (unit -> unit) -> unit (** [register_after_load_hook f] adds a hook called just after loading **each project**: if [n] projects are on disk, the same hook will be called [n] times (one call by project). Besides, for each project, the order in which the hooks are applied is the same than the order in which hooks are registered. *) val register_after_global_load_hook: (unit -> unit) -> unit (** [register_after_load_hook f] adds a hook called just after loading **all projects**. [f] must not set the current project. @since Boron-20100401 *) (* ************************************************************************* *) (** {3 Handling the selection} *) (* ************************************************************************* *) val get_current_selection: unit -> State_selection.t (** If an operation on a project is ongoing, then [get_current_selection ()] returns the selection which is applied on. The behaviour is unspecified if this function is called when no operation depending on a selection is ongoing. *) (* ************************************************************************* *) (** {2 Projects are comparable values} *) (* ************************************************************************* *) val compare: t -> t -> int val equal: t -> t -> bool val hash: t -> int (* ************************************************************************* *) (** {2 Undoing} *) (* ************************************************************************* *) module Undo: sig val breakpoint: unit -> unit val restore: unit -> unit val clear_breakpoint: unit -> unit end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/project_skeleton.ml0000666000000000000000000000545413571573400021340 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************** *) (** {2 Logging machinery} *) (* ************************************************************************** *) module Output = struct include Cmdline.Kernel_log let dkey = register_category "project" end (* ************************************************************************** *) (** {2 Type declaration} *) (* ************************************************************************** *) type t = { pid: int; mutable name: string; mutable unique_name: string } type project = t (* ************************************************************************** *) (** {2 Constructor} *) (* ************************************************************************** *) let dummy = { pid = 0; name = ""; unique_name = ""} module Make_setter(X: sig val mem: string -> bool end) = struct let make_unique_name s = snd (Extlib.make_unique_name X.mem ~sep:" " s) let make = let pid = ref 0 in fun name -> incr pid; { pid = !pid; name = name; unique_name = make_unique_name name } let set_name p s = p.unique_name <- make_unique_name s; p.name <- s end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/project_skeleton.mli0000666000000000000000000000602113571573400021500 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module should not be used outside of the Project library. @since Carbon-20101201 *) (* ************************************************************************** *) (** {2 Logging machinery} *) (* ************************************************************************** *) (** @since Carbon-20101201 *) module Output : sig include Log.Messages val dkey: category (** @since Fluorine-20130401 *) end (* ************************************************************************** *) (** {2 Type declaration} *) (* ************************************************************************** *) type t = private { pid: int; mutable name: string; mutable unique_name: string } (** @since Carbon-20101201 @plugin development guide *) type project = t (** @since Carbon-20101201 *) (* ************************************************************************** *) (** {2 Constructor} *) (* ************************************************************************** *) val dummy: t (** @since Carbon-20101201 *) (** @since Carbon-20101201 *) module Make_setter(X: sig val mem: string -> bool end) : sig val make_unique_name: string -> string (** @return a fresh name from the given string according to [X.mem]. @since Nitrogen-20111001 *) val make: string -> t (** @since Carbon-20101201 *) val set_name: t -> string -> unit (** @since Carbon-20101201 *) end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state.ml0000666000000000000000000001610713571573400017103 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Project_skeleton (* ************************************************************************** *) (** {2 Type declarations} *) (* ************************************************************************** *) type state_on_disk = { on_disk_value: Obj.t; on_disk_computed: bool; on_disk_saved: bool; on_disk_digest: Digest.t } type private_ops = { mutable descr: Structural_descr.pack; create: t -> unit; remove: t -> unit; mutable clear: t -> unit; mutable clear_some_projects: (t -> bool) -> t -> bool; copy: t -> t -> unit; commit: t -> unit; update: t -> unit; on_update: (unit -> unit) -> unit; clean: unit -> unit; serialize: t -> state_on_disk; unserialize: t -> state_on_disk -> unit } type state = { unique_name: string; mutable name: string; private_ops: private_ops } module type Local = sig type t val create: unit -> t val clear: t -> unit val get: unit -> t val set: t -> unit val clear_some_projects: (Project_skeleton.t -> bool) -> t -> bool end (* ************************************************************************** *) (** {2 Datatype} *) (* ************************************************************************** *) let never_called _ = assert false let dummy_private_ops () = { descr = Descr.pack Descr.unmarshable; create = never_called; remove = never_called; clear = never_called; clear_some_projects = never_called; copy = never_called; commit = never_called; update = never_called; on_update = never_called; serialize = never_called; unserialize = never_called; clean = never_called } let dummy_state_on_disk = { on_disk_value = Obj.repr (); on_disk_computed = false; on_disk_saved = false; on_disk_digest = "" } let dummy_unique_name = "" let dummy = { name = ""; unique_name = dummy_unique_name; private_ops = dummy_private_ops () } include Datatype.Make_with_collections (struct type t = state let name = "State" let structural_descr = Structural_descr.t_unknown let reprs = [ dummy ] let compare x y = if x == y then 0 else String.compare x.unique_name y.unique_name let equal = (==) let hash x = Hashtbl.hash x.unique_name let copy = Datatype.undefined let rehash = Datatype.undefined let internal_pretty_code p_caller fmt s = let pp fmt = Format.fprintf fmt "@[State.get@;%S@]" s.unique_name in Type.par p_caller Type.Call fmt pp let pretty fmt s = Format.fprintf fmt "state %S" s.unique_name let varname = Datatype.undefined let mem_project = Datatype.never_any_project end) let is_dummy = equal dummy (* ************************************************************************** *) (** {2 Getters} *) (* ************************************************************************** *) exception Incompatible_datatype of string let get_name s = s.name let get_unique_name s = s.unique_name let private_ops s = s.private_ops let get_descr s = s.private_ops.descr let set_name s n = s.name <- n let add_hook_on_update s f = s.private_ops.on_update f (* ************************************************************************** *) (** {2 States are comparable values} *) (* ************************************************************************** *) (* ************************************************************************** *) (** {2 Internals} All this stuff should not be used outside of the Project library.*) (* ************************************************************************** *) (* ************************************************************************** *) (** {3 Managing the set of known states} *) (* ************************************************************************** *) let states : t Datatype.String.Hashtbl.t = Datatype.String.Hashtbl.create 997 exception Unknown let get s = try Datatype.String.Hashtbl.find states s with Not_found -> raise Unknown let delete s = let uname = s.unique_name in assert (Datatype.String.Hashtbl.mem states uname); Datatype.String.Hashtbl.remove states uname let add s = let uname = s.unique_name in assert (Project_skeleton.Output.verify (not (Datatype.String.Hashtbl.mem states uname)) "state %S already exists." uname); assert (Project_skeleton.Output.verify (uname <> "") "state should have a non-empty name"); Datatype.String.Hashtbl.add states uname s let unique_name_from_name = let module M = Project_skeleton.Make_setter (struct let mem s = Datatype.String.Hashtbl.mem states s end) in M.make_unique_name (* ************************************************************************** *) (** {3 State generators} *) (* ************************************************************************** *) let create ~descr ~create ~remove ~clear ~clear_some_projects ~copy ~commit ~update ~on_update ~clean ~serialize ~unserialize ~unique_name ~name = let ops = { descr = descr; create = create; remove = remove; clear = clear; clear_some_projects = clear_some_projects; copy = copy; commit = commit; update = update; on_update = on_update; clean = clean; serialize = serialize; unserialize = unserialize } in let self = { name = name; unique_name = unique_name; private_ops = ops } in add self; self (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state.mli0000666000000000000000000001566213571573400017261 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** A state is a project-compliant mutable value. @since Carbon-20101201 @plugin development guide *) open Project_skeleton (* ************************************************************************** *) (** {2 Type declarations} *) (* ************************************************************************** *) include Datatype.S_with_collections (** Operations on the local state required for registering a new state via {!State_builder.Register}. The local state is the mutable value which you would like to be project-compliant. *) module type Local = sig type t (** Type of the state to register. *) val create: unit -> t (** How to create a new fresh state which must be equal to the initial state: that is, if you never change the state, [create ()] and [get ()] must be equal (see invariant 1 below). *) val clear: t -> unit (** How to clear a state. After clearing, the state should be observationally the same that after its creation (see invariant 2 below). *) val get: unit -> t (** How to access to the current state. Be aware of invariants 3 and 4 below. *) val set: t -> unit (** How to change the current state. Be aware of invariants 3 and 4 below. *) (** The four following invariants must hold. {ol {- [create ()] returns a fresh value} {- forall [(p:t)] [copy p] returns a fresh value} {- forall [(p:t)], [create () = (clear p; set p; get ())]} {- forall [(p1:t),(p2:t)] such that [p1 != p2], [(set p1; get ()) != s2]} } *) val clear_some_projects: (Project_skeleton.t -> bool) -> t -> bool (** [clear_if_project f x] must clear any value [v] of type project of [x] such that [f v] is [true]. Of course, if the type [t] does not contain any object of type [project], this function should do nothing and safely returns [fun _ -> false]. @return [true] iff at least one element of [x] has been cleared. @since Boron-20100401 *) end (* ************************************************************************** *) (** {2 Getters and setters} *) (* ************************************************************************** *) val get_name: t -> string (** Name of a state. @since Carbon-20101201 *) val set_name: t -> string -> unit (** Set the name of the given state. @since Carbon-20101201 *) val get_unique_name: t -> string (** Unique name of a state. @since Carbon-20101201 *) val unique_name_from_name: string -> string (** @return a fresh unique state name from the given name. @since Nitrogen-20111001 *) val dummy: t (** A dummy state. @since Carbon-20101201 @plugin development guide *) val dummy_unique_name: string val is_dummy: t -> bool (** @return true if the given state is {!dummy}. @since Carbon-20101201 *) exception Unknown val get: string -> t (** @return the state corresponding to the given unique name. @raise Unknown if there is no such state. @since Carbon-20101201 *) val get_descr: t -> Structural_descr.pack (** @since Carbon-20101201 *) val add_hook_on_update: t -> (unit -> unit) -> unit (** Add an hook which is applied each time the project library changes the local value of the state. @since Nitrogen-20111001 *) (* ************************************************************************** *) (** {2 Internals} All this stuff should not be used outside of the Project library.*) (* ************************************************************************** *) (** @since Carbon-20101201 *) type state_on_disk = { on_disk_value: Obj.t; on_disk_computed: bool; on_disk_saved: bool; on_disk_digest: Digest.t } (** @since Carbon-20101201 *) type private_ops = private { mutable descr: Structural_descr.pack; create: project -> unit; remove: project -> unit; mutable clear: project -> unit; mutable clear_some_projects: (project -> bool) -> project -> bool; copy: project -> project -> unit; commit: project -> unit; update: project -> unit; on_update: (unit -> unit) -> unit; clean: unit -> unit; serialize: project -> state_on_disk; unserialize: project -> state_on_disk -> unit (** @raise Incompatible_datatype if [state_on_disk] is not compatible with the datatype expected by Frama-C's state *) } exception Incompatible_datatype of string val dummy_state_on_disk: state_on_disk val private_ops: t -> private_ops (** @since Carbon-20101201 *) (* ************************************************************************** *) (** {3 State generators} *) (* ************************************************************************** *) val create: descr:Structural_descr.pack -> create:(project -> unit) -> remove:(project -> unit) -> clear:(project -> unit) -> clear_some_projects:((project -> bool) -> project -> bool) -> copy:(project -> project -> unit) -> commit:(project -> unit) -> update:(project -> unit) -> on_update:((unit -> unit) -> unit) -> clean:(unit -> unit) -> serialize:(project -> state_on_disk) -> unserialize:(project -> state_on_disk -> unit) -> unique_name:string -> name:string -> t (** @since Carbon-20101201 @modify Nitrogen-20111001 add the [on_update] argument *) val delete: t -> unit (** @since Carbon-20101201 *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state_builder.ml0000666000000000000000000007306213571573400020614 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Project_skeleton.Output (* ************************************************************************* *) (** {3 Signatures} *) (* ************************************************************************* *) module type Info = sig val name: string val dependencies : State.t list end module type Info_with_size = sig include Info val size: int end module type S = sig val self: State.t val name: string val mark_as_computed: ?project:Project.t -> unit -> unit val is_computed: ?project:Project.t -> unit -> bool module Datatype: Datatype.S val add_hook_on_update: (Datatype.t -> unit) -> unit val howto_marshal: (Datatype.t -> 'a) -> ('a -> Datatype.t) -> unit end (* ************************************************************************* *) (** {3 Proxies} *) (* ************************************************************************* *) module Proxy = struct type kind = Backward | Forward | Both type t = { state: State.t; kind: kind } let get p = p.state let extend_state states k s = let add_deps () = State_dependency_graph.add_dependencies ~from:s states in let add_codeps () = State_dependency_graph.add_codependencies ~onto:s states in match k with | Backward -> add_deps () | Forward -> add_codeps () | Both -> add_deps (); add_codeps () let extend states p = extend_state states p.kind p.state let do_nothing _ = () let do_nothing_2 _ _ = () open State let create name kind states = let s = State.create ~descr:Structural_descr.p_abstract ~create:do_nothing ~remove:do_nothing ~clear:do_nothing ~clean:do_nothing ~clear_some_projects:(fun _ _ -> false) ~copy:do_nothing_2 ~commit:do_nothing ~update:do_nothing ~on_update:do_nothing ~serialize: (fun _ -> { on_disk_value = Obj.repr (); on_disk_computed = false; on_disk_saved = false; on_disk_digest = Type.digest Datatype.unit }) ~unserialize:do_nothing_2 ~unique_name:(State.unique_name_from_name name) ~name in State_dependency_graph.add_state s []; extend_state states kind s; { state = s; kind = kind } end (* ************************************************************************* *) (** {3 Register} *) (* ************************************************************************* *) module States = struct module S = Type.String_tbl(struct type 'a t = Project.t -> 'a * bool end) let states = S.create 997 let add k ty v = S.add states k ty v let find ?(prj=Project.current ()) k ty = S.find states k ty prj let iter ?(prj=Project.current ()) f = S.iter (fun name ty get -> let s, b = get prj in f name ty s b) states let fold ?(prj=Project.current ()) f acc = S.fold (fun name ty get acc -> let s, b = get prj in f name ty s b acc) states acc end module FCDatatype = Datatype module Register (D: Datatype.S) (Local_state: State.Local with type t = D.t) (Info: sig include Info val unique_name: string end) : S with module Datatype = D = struct let internal_name = ref "" let debug ~level op_name p = debug ~dkey ~level "%s %S (project %s)" op_name !internal_name (Project.get_unique_name p) module Datatype = D module Tbl = Hashtbl.Make(Project) include Info type t = { mutable state: Local_state.t; mutable computed: bool } (* Project --> plugin state. *) let tbl : t Tbl.t = Tbl.create 7 let find p = Tbl.find tbl p let mem p = Tbl.mem tbl p let add p s = Tbl.replace tbl p { state = s; computed = false } let remove p = assert (mem p); Tbl.remove tbl p let commit p = if Project.is_current p then try let v = find p in v.state <- Local_state.get () with Not_found -> fatal "state %S not associated with project %S; program will fail" name (Project.get_unique_name p) module Update_hook = Hook.Build(Datatype) let add_hook_on_update = Update_hook.extend let update_with ~force p s = if Project.is_current p || force then begin debug ~level:8 "updating" p; Update_hook.apply s; Local_state.set s end let update p = update_with ~force:false p (find p).state let change ~force p x = let v = find p in v.state <- x.state; v.computed <- x.computed; update_with ~force p v.state let clean () = (* Format.printf "cleaning %s@." !internal_name;*) Local_state.set (Local_state.create ()); Tbl.clear tbl let create = let first = ref true in fun p -> assert (not (mem p)); (* For efficiency purpose, do not create the initial project twice: directly get it *) let mk () = if !first then begin first := false; Local_state.get () end else begin debug ~level:4 "creating" p; let s = Local_state.create () in update_with ~force:false p s; s end in let s = mk () in add p s let clear p = debug ~level:4 "clearing" p; let v = find p in Local_state.clear v.state; v.computed <- false; update_with ~force:false p v.state let clear_some_projects f p = assert (not (f p)); let has_cleared = Local_state.clear_some_projects f (find p).state in if has_cleared then debug ~level:4 "erasing dangling project pointers" p; has_cleared let copy src dst = debug ~level:4 ("copying to " ^ Project.get_unique_name dst) src; let v = find src in if Datatype.copy == FCDatatype.undefined then abort "cannot copy project: unimplemented `copy' function in datatype \ `%s' for state `%s'" Datatype.name !internal_name; change ~force:false dst { v with state = Datatype.copy v.state } (* ******* TOUCH THE FOLLOWING AT YOUR OWN RISK: DANGEROUS CODE ******** *) let must_save = ref (not (Descr.is_unmarshable Datatype.descr)) let marshal : (Datatype.t -> Obj.t) ref = ref Obj.repr let unmarshal : (Obj.t -> Datatype.t) ref = ref Obj.obj let howto_marshal (go_in:Datatype.t -> 'a) (go_out:'a -> Datatype.t) = must_save := true; marshal := (fun x -> Obj.repr (go_in x)); unmarshal := fun x -> go_out (Obj.obj x) let serialize p = assert Cmdline.use_obj; commit p; let v = find p in let obj = if !must_save then begin debug ~level:4 "serializing" p; !marshal v.state end else Obj.repr () in { State.on_disk_value = obj; on_disk_computed = v.computed; on_disk_saved = !must_save; on_disk_digest = Type.digest Datatype.ty } let unserialize p new_s = assert Cmdline.use_obj; if Type.digest Datatype.ty = new_s.State.on_disk_digest then begin let s, computed = if !must_save && new_s.State.on_disk_saved then begin debug ~level:4 "unserializing" p; !unmarshal new_s.State.on_disk_value, new_s.State.on_disk_computed end else (* invariant: the found state is equal to the default one since it has been just created. Do not call Local_state.create to don't break sharing *) try (find p).state, false with Not_found -> fatal "unknown project '%s' in state '%s'" (Project.get_unique_name p) !internal_name in change ~force:true p { state = s; computed = computed }; end else begin clear p; raise (State.Incompatible_datatype !internal_name) end (* ********************************************************************* *) let mark_as_computed ?(project=(Project.current ())) () = (find project).computed <- true let is_computed ?(project=(Project.current ())) () = (find project).computed let self = let descr = if !must_save then Descr.pack Datatype.descr else Structural_descr.p_unit in State.create (* we will marshal the value [()] if the state is unmarshable *) ~descr ~create ~remove ~clear ~clear_some_projects ~copy ~commit ~update ~on_update:(fun f -> Update_hook.extend (fun _ -> f ())) ~serialize ~unserialize ~clean ~unique_name ~name:Info.name let name = State.get_name self let () = internal_name := State.get_unique_name self; (* register this state in the static graph and in projects *) State_dependency_graph.add_state self dependencies; States.add Info.name D.ty (fun p -> let s = Tbl.find tbl p in s.state, s.computed); Project.iter_on_projects create end (* ************************************************************************* *) (** {3 References} *) (* ************************************************************************* *) module type Ref = sig include S type data val set: data -> unit val get: unit -> data val clear: unit -> unit end module Ref (Data: Datatype.S) (Info: sig include Info val default: unit -> Data.t end) = struct type data = Data.t let create () = ref (Info.default ()) let state = ref (create ()) include Register (Datatype.Ref(Data)) (struct type t = data ref let create = create let clear tbl = tbl := Info.default () let get () = !state let set x = state := x let clear_some_projects f x = if Data.mem_project f !x then begin clear x; true end else false end) (struct include Info let unique_name = name end) let set v = !state := v let get () = !(!state) let clear () = !state := Info.default () end module type Option_ref = sig include Ref val memo: ?change:(data -> data) -> (unit -> data) -> data val map: (data -> data) -> data option val may: (data -> unit) -> unit val get_option : unit -> data option end module Option_ref(Data:Datatype.S)(Info: Info) = struct type data = Data.t let create () = ref None let state = ref (create ()) module D = Datatype.Ref(Datatype.Option(Data)) include Register (D) (struct type t = data option ref let create = create let clear tbl = tbl := None let get () = !state let set x = state := x let clear_some_projects f x = if D.mem_project f x then begin clear x; true end else false end) (struct include Info let unique_name = name end) let set v = !state := Some v let get () = match !(!state) with None -> raise Not_found | Some v -> v let get_option () = !(!state) let clear () = !state := None let memo ?change f = try let old = get () in Extlib.may_map ~dft:old (fun f -> let v = f old in set v; v) change with Not_found -> let data = f () in set data; data let map f = Extlib.opt_map f !(!state) let may f = Extlib.may f !(!state) end module type List_ref = sig type data_in_list include Ref val add: data_in_list -> unit val iter: (data_in_list -> unit) -> unit val fold_left: ('a -> data_in_list -> 'a) -> 'a -> 'a end module List_ref(Data:Datatype.S)(Info:Info) = struct type data_in_list = Data.t include Ref(Datatype.List(Data))(struct include Info let default () = [] end) let add d = set (d::get()) let iter f = List.iter f (get ()) let fold_left f acc = List.fold_left f acc (get ()) end module Int_ref(Info: sig include Info val default: unit -> int end) = Ref(Datatype.Int)(Info) module Zero_ref(Info: Info ) = Int_ref(struct include Info let default () = 0 end) module Bool_ref(Info: sig include Info val default: unit -> bool end) = Ref(Datatype.Bool)(struct include Info let default = Info.default end) module False_ref(Info:Info) = Bool_ref(struct include Info let default () = false end) module True_ref(Info:Info) = Bool_ref(struct include Info let default () = true end) module Float_ref(Info: sig include Info val default: unit -> float end) = Ref(Datatype.Float)(Info) (* ************************************************************************* *) (** {3 References on a set} *) (* ************************************************************************* *) module type Set_ref = sig include Ref type elt val add: elt -> unit val remove: elt -> unit val is_empty: unit -> bool val mem: elt -> bool val fold: (elt -> 'a -> 'a) -> 'a -> 'a val iter: (elt -> unit) -> unit end module Set_ref(S: Datatype.Set)(Info: Info) = struct include Ref(S)(struct include Info let default () = S.empty end) type elt = S.elt let apply f = f (get ()) let is_empty () = apply S.is_empty let add x = set (apply (S.add x)) let remove x = set (apply (S.remove x)) let mem x = apply (S.mem x) let fold f = apply (S.fold f) let iter f = apply (S.iter f) end (* ************************************************************************* *) (** {3 Hashtbl} *) (* ************************************************************************* *) module type Hashtbl = sig include S type key type data val replace: key -> data -> unit val add: key -> data -> unit val clear: unit -> unit val length: unit -> int val iter: (key -> data -> unit) -> unit val iter_sorted: ?cmp:(key -> key -> int) -> (key -> data -> unit) -> unit val fold: (key -> data -> 'a -> 'a) -> 'a -> 'a val fold_sorted: ?cmp:(key -> key -> int) -> (key -> data -> 'a -> 'a) -> 'a -> 'a val memo: ?change:(data -> data) -> (key -> data) -> key -> data val find: key -> data val find_all: key -> data list val mem: key -> bool val remove: key -> unit end module Hashtbl (H: Datatype.Hashtbl) (Data: Datatype.S) (Info: Info_with_size) = struct type key = H.key type data = Data.t let create () = H.create Info.size let state = ref (create ()) module D = H.Make(Data) include Register (D) (struct type t = data H.t let create = create let clear = H.clear let get () = !state let set x = state := x let clear_some_projects f h = (* Format.printf "%S: %S %S@." Info.name H.Key.name Data.name;*) let x = if D.mem_project == Datatype.never_any_project then false else (* [TODO] BUG: if [Data.mem_project f v] returns [true] and there are several bindings for the key [k] of [v] (and [v] is not the last added binding) *) let found = H.fold (fun k v l -> if H.Key.mem_project f k || Data.mem_project f v then k :: l else l) h [] in List.iter (H.remove h) found; found <> [] in (* Format.printf "DONE@.";*) x end) (struct include Info let unique_name = name end) let clear () = H.clear !state let length () = H.length !state let replace key v = H.replace !state key v let add key v = H.add !state key v let find key = H.find !state key let find_all key = H.find_all !state key let mem key = H.mem !state key let remove key = H.remove !state key let iter f = H.iter f !state let iter_sorted ?cmp f = H.iter_sorted ?cmp f !state let fold f acc = H.fold f !state acc let fold_sorted ?cmp f acc = H.fold_sorted ?cmp f !state acc let memo ?change f key = try let old = find key in Extlib.may_map ~dft:old (fun f -> let v = f old in replace key v; v) change with Not_found -> let data = f key in replace key data; data end module Int_hashtbl = Hashtbl(Datatype.Int.Hashtbl) (* ************************************************************************* *) (** {3 Weak Hashtbl} *) (* ************************************************************************* *) module type Weak_hashtbl = sig include S type data val merge: data -> data val add: data -> unit val clear: unit -> unit val count: unit -> int val iter: (data -> unit) -> unit val fold: (data -> 'a -> 'a) -> 'a -> 'a val find: data -> data val find_all: data -> data list val mem: data -> bool val remove: data -> unit end module type Sub_caml_weak_hashtbl = sig include Datatype.Sub_caml_weak_hashtbl val clear: t -> unit val merge: t -> data -> data val add: t -> data -> unit val count: t -> int val iter: (data->unit) -> t -> unit val fold: (data->'a->'a) -> t -> 'a -> 'a val find: t -> data -> data val find_all: t -> data -> data list val mem: t -> data -> bool val remove: t -> data -> unit end module Weak_hashtbl (W: Sub_caml_weak_hashtbl) (Data: Datatype.S with type t = W.data) (Info: Info_with_size) = struct type data = W.data let create () = W.create Info.size let state = ref (create ()) include Register (Datatype.Weak(W)(Data)) (struct type t = W.t let create = create let clear = W.clear let get () = !state let set x = state := x let clear_some_projects f h = if Data.mem_project == Datatype.never_any_project then false else let found = W.fold (fun k l -> if Data.mem_project f k then k :: l else l) h [] in List.iter (W.remove h) found; found <> [] end) (struct include Info let unique_name = name end) let merge k = W.merge !state k let add k = W.add !state k let clear () = W.clear !state let count () = W.count !state let iter f = W.iter f !state let fold f acc = W.fold f !state acc let find k = W.find !state k let find_all k = W.find_all !state k let mem k = W.mem !state k let remove k = W.remove !state k end module Caml_weak_hashtbl(Data: Datatype.S) = Weak_hashtbl(Weak.Make(Data))(Data) module Hashconsing_tbl_weak (Data: sig include Datatype.S val equal_internal: t -> t -> bool val hash_internal: t -> int val initial_values: t list end) (Info: Info_with_size) = struct (* OCaml module typing requires to name this module. Too bad :-( *) module W = struct include Weak.Make (struct include Data let equal = Data.equal_internal let hash = Data.hash_internal end) let add_initial_values h = (* Format.printf "adding initial values for %s@." Info.name;*) List.iter (fun vi -> let _r = merge h vi in (* (* Check that we do not add the value twice, which is probably a bug in the calling interface *) assert (r == vi) *) ()) Data.initial_values let create size = let h = create size in add_initial_values h; h let clear t = clear t; add_initial_values t (* let merge = let c = ref 0 in fun h x -> incr c; if (!c land 4095 = 0) then begin Gc.full_major (); let length, n, sum, small, med, large = stats h in Format.printf "%s length %d, n %d, sum %d, small %d, med %d, large %d@." Info.name length n sum small med large end; merge h x *) end include Weak_hashtbl(W)(Data)(Info) end module Hashconsing_tbl_not_weak (Data: sig include Datatype.S val equal_internal: t -> t -> bool val hash_internal: t -> int val initial_values: t list end) (Info: Info_with_size) = struct (* OCaml module typing requires to name this module. Too bad :-( *) module W = struct module HW = FCHashtbl.Make (struct include Data let equal = Data.equal_internal let hash = Data.hash_internal end) type data = Data.t type t = data HW.t let merge h v = try HW.find h v with Not_found -> HW.add h v v; v let count = HW.length let add_initial_values h = List.iter (fun vi -> let _r = merge h vi in ()) Data.initial_values let create size = let h = HW.create size in add_initial_values h; h let clear t = HW.clear t; add_initial_values t let fold f = HW.fold_sorted (fun v _ acc -> f v acc) let iter f = HW.iter_sorted (fun v _ -> f v) let mem = HW.mem let find_all = HW.find_all let find = HW.find let remove = HW.remove let add h v = HW.replace h v v end include Weak_hashtbl(W)(Data)(Info) end module type Hashconsing_tbl = functor (Data: sig include Datatype.S val equal_internal: t -> t -> bool val hash_internal: t -> int val initial_values: t list end) -> functor (Info: Info_with_size) -> Weak_hashtbl with type data = Data.t module Hashconsing_tbl = (val if Cmdline.deterministic then (module Hashconsing_tbl_not_weak: Hashconsing_tbl) else (module Hashconsing_tbl_weak: Hashconsing_tbl)) (* ************************************************************************* *) (** {3 Counters} *) (* ************************************************************************* *) module type Counter = sig val next : unit -> int val get: unit -> int val self: State.t end (* Create a fresh, shared reference among projects. The projectification is only required for correct marshalling. *) module SharedCounter(Info : sig val name : string end) = struct let cpt = ref 0 module Cpt = Register (struct include Datatype.Int let descr = Descr.transform Descr.t_int (fun n -> cpt := Extlib.max_cpt n !cpt; !cpt) end) (struct type t = int let create () = !cpt let clear _ = () let get () = !cpt let set _ = () let clear_some_projects _ _ = false end) (struct let name = Info.name let unique_name = Info.name let dependencies = [] end) let next () = incr cpt ; !cpt let get () = !cpt let self = Cpt.self end module Counter(Info : sig val name : string end) = struct let create () = ref 0 let cpt = ref (create ()) module Cpt = Register (struct include Datatype.Ref(Datatype.Int) let descr = Descr.transform (Descr.t_ref Descr.t_int) (fun n -> let r = !cpt in r := Extlib.max_cpt !n !r; r) end) (struct type t = int ref let create = create let clear x = x := 0 let get () = !cpt let set x = cpt := x let clear_some_projects _ _ = false end) (struct let name = Info.name let unique_name = Info.name let dependencies = [] end) let next () = incr !cpt ; !(!cpt) let get () = !(!cpt) let self = Cpt.self end (* ************************************************************************* *) (** {3 Queue} *) (* ************************************************************************* *) module type Queue = sig type elt val self: State.t val add: elt -> unit val iter: (elt -> unit) -> unit val is_empty: unit -> bool end module Queue(Data: Datatype.S)(Info: Info) = struct type elt = Data.t let state = ref (Queue.create ()) include Register (Datatype.Queue(Data)) (struct type t = elt Queue.t let create = Queue.create let clear = Queue.clear let get () = !state let set x = state := x let clear_some_projects f q = if Data.mem_project == Datatype.never_any_project then false else (* cannot remove a single element from a queue *) try Queue.iter (fun x -> if Data.mem_project f x then raise Exit) q; false with Exit -> clear q; true end) (struct include Info let unique_name = name end) let add x = Queue.add x !state let iter f = Queue.iter f !state let is_empty () = Queue.is_empty !state end (* ************************************************************************* *) (** {3 Arrays} *) (* ************************************************************************* *) module type Array = sig type elt val length: unit -> int val set_length: int -> unit val get: int -> elt val set: int -> elt -> unit val iter : (elt -> unit) -> unit val iteri : (int -> elt -> unit) -> unit val fold_left: ('a -> elt -> 'a) -> 'a -> 'a val fold_right: (elt -> 'a -> 'a) -> 'a -> 'a end module Array(Data: Datatype.S)(Info: sig include Info val default: Data.t end)= struct type elt = Data.t let state = ref (Array.make 0 Info.default) include Register (Datatype.Array(Data)) (struct type t = elt array let create () = Array.make 0 Info.default let clear v = Array.iteri (fun i _ -> v.(i) <- Info.default) v let get () = !state let set x = state := x let clear_some_projects f q = if Data.mem_project == Datatype.never_any_project then false else let removed = ref false in Array.iteri (fun i x -> if Data.mem_project f x then begin !state.(i) <- Info.default; removed := true; end ) q; !removed end) (struct include Info let unique_name = name end) let length () = Array.length !state let set_length i = state := Array.make i Info.default let get i = !state.(i) let set i v = !state.(i) <- v let iter f = Array.iter f !state let iteri f = Array.iteri f !state let fold_left f acc = Array.fold_left f acc !state let fold_right f acc = Array.fold_right f !state acc end (* ************************************************************************* *) (** {3 Apply Once} *) (* ************************************************************************* *) let apply_once name dep f = let module First = True_ref (struct let dependencies = dep let name = name end) in (fun () -> if First.get () then begin First.set false; try f (); if First.get () then First.set false (* assert (verify (First.get () = false) "%s is supposed to be applied once, but resets itself its status" name) *) with exn -> First.set true; raise exn end), First.self (* ****************************************************************************) (** {3 Generic hashconsing} *) (* ****************************************************************************) module type Hashcons = sig type elt include Datatype.S_with_collections val hashcons: elt -> t val get: t -> elt val id: t -> int val self: State.t end module Hashcons (Data: Datatype.S) (Info: sig include Info val initial_values: Data.t list end) = struct type elt = Data.t type hashconsed = { key : Data.t; id : int; } let rehash_ref = ref (fun _ -> assert false) module D = Datatype.Make_with_collections (struct include Datatype.Serializable_undefined type t = hashconsed let name = "Hashconsed(" ^ Data.name ^ "," ^ Info.name ^ ")" let reprs = [ { key = List.hd Data.reprs; id = 0 } ] let structural_descr = Structural_descr.t_record [| Data.packed_descr; Structural_descr.p_int |] let equal = ( == ) let compare { id = t1 } { id = t2 } = Datatype.Int.compare t1 t2 let pretty fmt { key } = Data.pretty fmt key let hash { id } = id let copy c = c let rehash x = !rehash_ref x end) include D let counter = ref 0 (* Only used for the initial values, that must be all different. *) let unsafe_hashcons key = let r = { key; id = !counter } in incr counter; r module HashConsTbl = Hashconsing_tbl (struct include D let hash_internal a = Data.hash a.key let equal_internal a b = Data.equal a.key b.key let initial_values = (* Ensures that the initial values are all different. *) let uniq_values = List.sort_uniq Data.compare Info.initial_values in List.map unsafe_hashcons uniq_values end) (struct let name = "Hashconstable(" ^ Data.name ^ "," ^ Info.name ^ ")" let dependencies = Info.dependencies let size = 128 end) let self = HashConsTbl.self let hashcons key = let hashed_atom = { key; id = !counter } in let hashconsed_atom = HashConsTbl.merge hashed_atom in if hashconsed_atom.id = !counter then (* Fresh new atom. this counter id is used. *) incr counter; hashconsed_atom let () = rehash_ref := fun x -> hashcons x.key let get { key } = key let id { id } = id end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state_builder.mli0000666000000000000000000004575213571573400020772 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** State builders. Provide ways to implement signature [State_builder.S]. Depending on the builder, also provide some additional useful information. @plugin development guide *) (* ************************************************************************* *) (* ************************************************************************* *) (** {2 Low-level Builder} *) (* ************************************************************************* *) (* ************************************************************************* *) (** Additional information required by {!State_builder.Register}. *) module type Info = sig val name: string (** Name of the internal state. *) val dependencies : State.t list (** Dependencies of this internal state. *) end module type Info_with_size = sig include Info val size: int (** Initial size for the hash table. *) end (** Output signature of {!State_builder.Register}. *) module type S = sig val self: State.t (** The kind of the registered state. *) val name: string val mark_as_computed: ?project:Project.t -> unit -> unit (** Indicate that the registered state will not change again for the given project (default is [current ()]). *) val is_computed: ?project:Project.t -> unit -> bool (** Returns [true] iff the registered state will not change again for the given project (default is [current ()]). *) (** Exportation of some inputs (easier use of [State_builder.Register]). *) module Datatype: Datatype.S val add_hook_on_update: (Datatype.t -> unit) -> unit (** Add an hook which is applied each time (just before) the project library changes the local value of the state. @since Nitrogen-20111001 *) val howto_marshal: (Datatype.t -> 'a) -> ('a -> Datatype.t) -> unit (** [howto_marshal marshal unmarshal] registers a custom couple of functions [(marshal, unmarshal)] to be used for serialization. Default functions are identities. In particular, this function must be used if [Datatype.t] is not marshallable and [do_not_save] is not called. @since Boron-20100401 *) end (** [Register(Datatype)(State)(Info)] registers a new state. [Datatype] represents the datatype of a state, [Local_state] explains how to deal with the client-side state and [Info] are additional required information. @plugin development guide *) module Register (Datatype: Datatype.S) (Local_state: State.Local with type t = Datatype.t) (Info: sig include Info val unique_name: string end) : S with module Datatype = Datatype (* ************************************************************************* *) (* ************************************************************************* *) (** {2 High-level Builders} *) (* ************************************************************************* *) (* ************************************************************************* *) (* ************************************************************************* *) (** {3 References} *) (* ************************************************************************* *) (** Output signature of [Ref]. *) module type Ref = sig include S type data (** Type of the referenced value. *) val set: data -> unit (** Change the referenced value. *) val get: unit -> data (** Get the referenced value. *) val clear: unit -> unit (** Reset the reference to its default value. *) end (** @plugin development guide *) module Ref (Data:Datatype.S) (Info:sig include Info val default: unit -> Data.t end) : Ref with type data = Data.t (** Output signature of [Option_ref]. Note that [get] will raise [Not_found] if the stored data is [None]. Use [get_option] if you want to have access to the option. *) module type Option_ref = sig include Ref val memo: ?change:(data -> data) -> (unit -> data) -> data (** Memoization. Compute on need the stored value. If the data is already computed (i.e. is not [None]), it is possible to change with [change]. *) val map: (data -> data) -> data option val may: (data -> unit) -> unit val get_option : unit -> data option (** @since Beryllium-20090901 *) end (** Build a reference on an option. *) module Option_ref(Data:Datatype.S)(Info: Info) : Option_ref with type data = Data.t (** Output signature of [ListRef]. @since Boron-20100401 *) module type List_ref = sig type data_in_list include Ref val add: data_in_list -> unit (** @since Nitrogen-20111001 *) val iter: (data_in_list -> unit) -> unit val fold_left: ('a -> data_in_list -> 'a) -> 'a -> 'a end (** Build a reference on a list. @since Boron-20100401 *) module List_ref(Data:Datatype.S)(Info: Info) : List_ref with type data = Data.t list and type data_in_list = Data.t (** Build a reference on an integer. @since Carbon-20101201 *) module Int_ref(Info:sig include Info val default: unit -> int end) : Ref with type data = int (** Build a reference on an integer, initialized with [0]. @since Carbon-20101201 *) module Zero_ref(Info:Info) : Ref with type data = int (** Build a reference on a boolean. @since Oxygen-20120901 *) module Bool_ref(Info:sig include Info val default: unit -> bool end) : Ref with type data = bool (** Build a reference on a boolean, initialized with [false]. @since Carbon-20101201 *) module False_ref(Info:Info): Ref with type data = bool (** Build a reference on a boolean, initialized with [true]. @since Carbon-20101201 *) module True_ref(Info:Info): Ref with type data = bool (** Build a reference on a float. @since Oxygen-20120901 *) module Float_ref(Info:sig include Info val default: unit -> float end) : Ref with type data = float (* ************************************************************************* *) (** {3 Weak Hashtbl} *) (* ************************************************************************* *) (** Output signature of builders of hashtables. @since Boron-20100401 *) module type Weak_hashtbl = sig include S (** Hashtbl are a standard computation. BUT it is INCORRECT to use projectified hashtables if keys have a custom [rehash] function (see {!Project.DATATYPE_OUTPUT.rehash}) *) type data (** @since Boron-20100401 *) val merge: data -> data (** [merge x] returns an instance of [x] found in the table if any, or else adds [x] and return [x]. @since Boron-20100401 *) val add: data -> unit (** [add x] adds [x] to the table. If there is already an instance of [x], it is unspecified which one will be returned by subsequent calls to [find] and [merge]. @since Boron-20100401 *) val clear: unit -> unit (** Clear the table. @since Boron-20100401 *) val count: unit -> int (** Length of the table. @since Boron-20100401 *) val iter: (data -> unit) -> unit (** @since Boron-20100401 *) val fold: (data -> 'a -> 'a) -> 'a -> 'a (** @since Boron-20100401 *) val find: data -> data (** [find x] returns an instance of [x] found in table. @Raise Not_found if there is no such element. @since Boron-20100401 *) val find_all: data -> data list (** [find_all x] returns a list of all the instances of [x] found in t. @since Boron-20100401 *) val mem: data -> bool (** [mem x] returns [true] if there is at least one instance of [x] in the table, [false] otherwise. @since Boron-20100401 *) val remove: data -> unit (** [remove x] removes from the table one instance of [x]. Does nothing if there is no instance of [x]. @since Boron-20100401 *) end (** Build a weak hashtbl over a datatype [Data] from a reference implementation [W]. @since Boron-20100401 *) module Weak_hashtbl (W: Weak.S)(Data: Datatype.S with type t = W.data)(Info: Info_with_size) : Weak_hashtbl with type data = W.data (** Build a weak hashtbl over a datatype [Data] by using [Weak.Make] provided by the OCaml standard library. Note that the table is not saved on disk. @since Boron-20100401 *) module Caml_weak_hashtbl(Data: Datatype.S)(Info: Info_with_size) : Weak_hashtbl with type data = Data.t (** Signature for the creation of projectified hashconsing tables.. @since Aluminium-20160501 *) module type Hashconsing_tbl = functor (Data: sig include Datatype.S (** The hashconsed datatype *) val equal_internal: t -> t -> bool (** Equality on the datatype internally used by the built table. *) val hash_internal: t -> int (** Hash function for datatype internally used by the built table. *) val initial_values: t list (** Pre-existing values stored in the built table and shared by all existing projects. *) end) -> functor (Info: Info_with_size) -> Weak_hashtbl with type data = Data.t (** Weak hashtbl dedicated to hashconsing. Note that the resulting table is not saved on disk. @since Boron-20100401 @modify Aluminium-20160501, renamed *) module Hashconsing_tbl_weak: Hashconsing_tbl (** Hash table for hashconsing, but the internal table is _not_ weak (it is a regular hash table). This module should be used only in case perfect reproducibility matters, as the table will never be emptied by the GC. @since Aluminium-20160501 *) module Hashconsing_tbl_not_weak: Hashconsing_tbl (** Weak or non-weak hashconsing tables, depending on variable {!Cmdline.deterministic}. @since Aluminium-20160501 *) module Hashconsing_tbl: Hashconsing_tbl (* ************************************************************************* *) (** {3 Hashtables} IMPORTANT: that is INCORRECT to use projectified hashtables if keys have a custom [rehash] function (see {!Project.DATATYPE_OUTPUT.rehash}) *) (* ************************************************************************* *) (** Output signature of builders of hashtables. *) module type Hashtbl = sig include S (** Hashtbl are a standard computation. BUT that is INCORRECT to use projectified hashtables if keys have a custom [rehash] function (see {!Project.DATATYPE_OUTPUT.rehash}) *) type key type data val replace: key -> data -> unit (** Add a new binding. The previous one is removed. *) val add: key -> data -> unit (** Add a new binding. The previous one is only hidden. *) val clear: unit -> unit (** Clear the table. *) val length: unit -> int (** Length of the table. *) val iter: (key -> data -> unit) -> unit val iter_sorted: ?cmp:(key -> key -> int) -> (key -> data -> unit) -> unit val fold: (key -> data -> 'a -> 'a) -> 'a -> 'a val fold_sorted: ?cmp:(key -> key -> int) -> (key -> data -> 'a -> 'a) -> 'a -> 'a val memo: ?change:(data -> data) -> (key -> data) -> key -> data (** Memoization. Compute on need the data associated to a given key using the given function. If the data is already computed, it is possible to change with [change]. *) val find: key -> data (** Return the current binding of the given key. @raise Not_found if the key is not in the table. *) val find_all: key -> data list (** Return the list of all data associated with the given key. *) val mem: key -> bool val remove: key -> unit end (** @plugin development guide *) module Hashtbl (H: Datatype.Hashtbl (** hashtable implementation *)) (Data: Datatype.S (** datatype for values stored in the table *)) (Info: Info_with_size) : Hashtbl with type key = H.key and type data = Data.t and module Datatype = H.Make(Data) module Int_hashtbl(Data: Datatype.S)(Info:Info_with_size): Hashtbl with type key = int and type data = Data.t (* ************************************************************************* *) (** {3 References on a set} *) (* ************************************************************************* *) (** Output signature of builders of references on a set. *) module type Set_ref = sig include Ref type elt val add: elt -> unit val remove: elt -> unit (** @since Neon-20140301 *) val is_empty: unit -> bool val mem: elt -> bool val fold: (elt -> 'a -> 'a) -> 'a -> 'a val iter: (elt -> unit) -> unit end module Set_ref(S: Datatype.Set)(Info: Info) : Set_ref with type elt = S.elt and type data = S.t (* ************************************************************************* *) (** {3 Queue} *) (* ************************************************************************* *) module type Queue = sig type elt val self: State.t val add: elt -> unit val iter: (elt -> unit) -> unit val is_empty: unit -> bool end module Queue(Data: Datatype.S)(Info: Info) : Queue with type elt = Data.t (* ************************************************************************* *) (** {3 Array} *) (* ************************************************************************* *) module type Array = sig type elt val length: unit -> int val set_length: int -> unit val get: int -> elt val set: int -> elt -> unit val iter : (elt -> unit) -> unit val iteri : (int -> elt -> unit) -> unit val fold_left: ('a -> elt -> 'a) -> 'a -> 'a val fold_right: (elt -> 'a -> 'a) -> 'a -> 'a end module Array(Data: Datatype.S)(Info: sig include Info val default: Data.t end) : Array with type elt = Data.t (* ************************************************************************* *) (** {3 Proxies} *) (* ************************************************************************* *) (** State proxy. A proxy is a state which does not correspond to any useful mutable value. Its goal is only to reduce the number of dependencies between groups of states. @since Carbon-20101201 *) module Proxy : sig type t (** Proxy type. *) type kind = | Backward (** All states in the proxy depend on it. *) | Forward (** The proxy depends on all states inside. *) | Both (** States in the proxy and the proxy itself are mutually dependent. *) val create: string -> kind -> State.t list -> t (** [create s k sk l] creates a new proxy with the given name, kinds and states inside it. *) val extend: State.t list -> t -> unit (** Add some states in the given proxy. *) val get: t -> State.t (** Getting the state corresponding to a proxy. *) end (* ************************************************************************* *) (** {3 Counters} *) (* ************************************************************************* *) module type Counter = sig val next : unit -> int (** Increments the counter and returns a fresh value *) val get: unit -> int (** @return the current value of the counter, without incrementing it. @since Fluorine-20130401 *) val self: State.t (** @since Oxygen-20120901 *) end (** Creates a counter that is shared among all projects, but which is marshalling-compliant. @since Carbon-20101201 *) module SharedCounter(Info : sig val name : string end) : Counter (** Creates a projectified counter. That starts at 0 @since Nitrogen-20111001 *) module Counter(Info : sig val name : string end) : Counter (* ****************************************************************************) (** {2 Generic functor to hashcons an arbitrary type } *) (* ****************************************************************************) (** Output signature of [Hashcons] below. *) module type Hashcons = sig type elt (** The type of the elements that are hash-consed *) include Datatype.S_with_collections (** hashconsed version of {!elt} *) val hashcons: elt -> t (** Injection as an hashconsed value. *) val get: t -> elt (** Projection out of hashconsing. *) val id: t -> int (** Id of an hashconsed value. Unique: [id x = id y] is equivalent to equality on {!elt}. *) val self: State.t end (** Hashconsed version of an arbitrary datatype *) module Hashcons (Data: Datatype.S) (Info: sig include Info val initial_values: Data.t list (** List of values created at compile-time, that must be shared between all instances of Frama-C. *) end) : Hashcons with type elt = Data.t (* ************************************************************************* *) (** {3 Useful operations} *) (* ************************************************************************* *) val apply_once: string -> State.t list -> (unit -> unit) -> (unit -> unit) * State.t (** [apply_once name dep f] returns a closure applying [f] only once and the state internally used. [name] and [dep] are respectively the name and the dependencies of the local state created by this function. Should be used partially applied. If [f] raises an exception, then it is considered as not applied. *) (** @since Fluorine-20130401 *) module States: sig val iter: ?prj:Project.t -> (string -> 'a Type.t -> 'a -> bool -> unit) -> unit (** iterates a function [f] over all registered states. Arguments of [f] are its name, its type value, its value for the given project ([Project.current ()] by default) and a boolean which indicates if it is already computed. @since Fluorine-20130401 *) val fold: ?prj:Project.t -> (string -> 'a Type.t -> 'a -> bool -> 'acc -> 'acc) -> 'acc -> 'acc (** As iter, but for folding. @since Fluorine-20130401*) val find: ?prj:Project.t -> string -> 'a Type.t -> 'a * bool (** @return the value of a state given by its name (and if it is computed), in the given project ([Project.current ()] by default) *) end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state_dependency_graph.ml0000666000000000000000000000776313571573400022472 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type S = sig module G: Graph.Sig.G with type V.t = State.t and type E.t = State.t * State.t val graph: G.t val add_dependencies: from:State.t -> State.t list -> unit val add_codependencies: onto:State.t -> State.t list -> unit val remove_dependencies: from:State.t -> State.t list -> unit val remove_codependencies: onto:State.t -> State.t list -> unit end module type Attributes = sig open Graph.Graphviz val graph_attributes: 'a -> DotAttributes.graph list val default_vertex_attributes: 'a -> DotAttributes.vertex list val vertex_name : State.t -> string val vertex_attributes: State.t -> DotAttributes.vertex list val default_edge_attributes: 'a -> DotAttributes.edge list val edge_attributes: State.t * State.t -> DotAttributes.edge list val get_subgraph : State.t -> DotAttributes.subgraph option end module Dependency_graph = Graph.Imperative.Digraph.ConcreteBidirectional(State) module Static = struct module G = Dependency_graph let graph = Dependency_graph.create ~size:7 () let add_vertex graph v = assert (not (State.is_dummy v)); Dependency_graph.add_vertex graph v let add_edge graph v1 v2 = assert (Dependency_graph.(mem_vertex graph v1 && mem_vertex graph v2)); Dependency_graph.add_edge graph v1 v2 let add_dependencies ~from deps = List.iter (add_edge graph from) deps let add_codependencies ~onto codeps = List.iter (fun c -> add_edge graph c onto) codeps let remove_dependencies ~from deps = List.iter (Dependency_graph.remove_edge graph from) deps let remove_codependencies ~onto codeps = List.iter (fun c -> Dependency_graph.remove_edge graph c onto) codeps let add_state v deps = add_vertex graph v; add_codependencies ~onto:v deps end include Static module Attributes = struct let vertex_name s = "\"" ^ State.get_unique_name s ^ "\"" let graph_attributes _ = [ `Ratio (`Float 0.25) ] let default_vertex_attributes _ = [] let vertex_attributes s = [ `Label (String.escaped (State.get_name s)) ] let default_edge_attributes _ = [] let edge_attributes _ = [] let get_subgraph _ = None end module Dot(A:Attributes) = struct module D = Graph.Graphviz.Dot(struct include A include Dependency_graph end) let dump filename = let cout = open_out filename in D.output_graph cout graph; close_out cout end include Dot(Attributes) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state_dependency_graph.mli0000666000000000000000000000673313571573400022637 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** State Dependency Graph. @since Carbon-20101201 *) (** {2 Signatures} *) (** Signature of a State Dependency Graph. It is compatible with the signature of OcamlGraph imperative graph [Graph.Sig.I]. @since Carbon-20101201 *) module type S = sig module G: Graph.Sig.G with type V.t = State.t and type E.t = State.t * State.t val graph: G.t val add_dependencies: from:State.t -> State.t list -> unit (** Add an edge in [graph] from the state [from] to each state of the list. @since Carbon-20101201 *) val add_codependencies: onto:State.t -> State.t list -> unit (** Add an edge in [graph] from each state of the list to the state [onto]. @since Carbon-20101201 *) val remove_dependencies: from:State.t -> State.t list -> unit (** Remove an edge in [graph] from the given state to each state of the list. @since Fluorine-20130401 *) val remove_codependencies: onto:State.t -> State.t list -> unit (** Remove an edge in [graph] from each state of the list to the state [onto]. @since Oxygen-20120901 *) end (** Signature required by [Graph.GraphViZ.Dot]. See the OcamlGraph's documentation for additional details. @since Carbon-20101201 *) module type Attributes = sig open Graph.Graphviz val graph_attributes: 'a -> DotAttributes.graph list val default_vertex_attributes: 'a -> DotAttributes.vertex list val vertex_name : State.t -> string val vertex_attributes: State.t -> DotAttributes.vertex list val default_edge_attributes: 'a -> DotAttributes.edge list val edge_attributes: State.t * State.t -> DotAttributes.edge list val get_subgraph : State.t -> DotAttributes.subgraph option end include S val add_state: State.t -> State.t list -> unit module Attributes: Attributes module Dot(A: Attributes) : sig val dump: string -> unit end val dump: string -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state_selection.ml0000666000000000000000000002272613571573400021154 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Selection = Graph.Persistent.Digraph.ConcreteBidirectional(State) (* Set of the states in a selection *) type concrete_state_selection = | Full | Subset of Selection.t (* Reification of the atomic operations that are used to create a selection *) type witness = | WAll | WEmpty | WSingleton of State.t | WOfStateList of State.t list | WDependencies of State.t | WStrictDependencies of State.t | WCoDependencies of State.t | WStrictCoDependencies of State.t | WUnion of witness * witness | WDiff of witness * witness | WOfList of witness list let rec pretty_witness fmt = function | WAll -> Format.pp_print_string fmt "*" | WEmpty -> Format.pp_print_string fmt "<>" | WSingleton s -> pretty_state fmt s | WOfStateList l -> Pretty_utils.pp_list ~pre:"[@[" ~suf:"@]]" ~sep:",@ " pretty_state fmt l | WDependencies s -> Format.fprintf fmt "Deps(%a)" pretty_state s | WStrictDependencies s -> Format.fprintf fmt "StrictDeps(%a)" pretty_state s | WCoDependencies s -> Format.fprintf fmt "CoDeps(%a)" pretty_state s | WStrictCoDependencies s -> Format.fprintf fmt "StrictCoDeps(%a)" pretty_state s | WUnion (w1, w2) -> Format.fprintf fmt "@[Union(%a,@ %a)@]" pretty_witness w1 pretty_witness w2 | WDiff (w1, w2) -> Format.fprintf fmt "@[Diff(%a,@ %a)@]" pretty_witness w1 pretty_witness w2 | WOfList l -> Pretty_utils.pp_list ~pre:"[@[" ~suf:"@]]" ~sep:",@ " pretty_witness fmt l and pretty_state fmt s = Format.pp_print_string fmt (State.get_name s) type state_selection = concrete_state_selection * witness let empty = Subset Selection.empty, WEmpty let full = Full, WAll let singleton s = Subset (Selection.add_vertex Selection.empty s), WSingleton s let of_list l = Subset (List.fold_left Selection.add_vertex Selection.empty l), WOfStateList l let is_empty (sel, _) = sel = Subset Selection.empty let is_full (sel, _) = sel = Full let mem (sel, _) s = match sel with | Full -> true | Subset sel -> Selection.mem_vertex sel s include Datatype.Make (struct include Datatype.Undefined type t = state_selection let name = "State_selection" let reprs = [ full; empty; singleton State.dummy ] let internal_pretty_code p_caller fmt (s, _) = match s with | Full -> Format.fprintf fmt "@[State_selection.full@]" | Subset sel -> match Selection.fold_vertex (fun s acc -> s :: acc) sel [] with | [] -> Format.fprintf fmt "@[State_selection.empty@]" | [ s ] -> let pp fmt = Format.fprintf fmt "@[State_selection.singleton@;%a@]" (State.internal_pretty_code Type.Call) s in Type.par p_caller Type.Call fmt pp | l -> let module D = Datatype.List(State) in let pp fmt = Format.fprintf fmt "@[State_selection.of_list@;%a@]" (D.internal_pretty_code Type.Call) l in Type.par p_caller Type.Call fmt pp end) module type S = sig val with_dependencies: State.t -> t val only_dependencies: State.t -> t val with_codependencies: State.t -> t val only_codependencies: State.t -> t val union: t -> t -> t val list_union: t list -> t val diff: t -> t -> t val cardinal: t -> int val to_list: t -> State.t list val pretty: Format.formatter -> t -> unit val pretty_witness: Format.formatter -> t -> unit val iter_succ: (State.t -> unit) -> t -> State.t -> unit val fold_succ: (State.t -> 'a -> 'a) -> t -> State.t -> 'a -> 'a val iter: (State.t -> unit) -> t -> unit val fold: (State.t -> 'a -> 'a) -> t -> 'a -> 'a val iter_in_order: (State.t -> unit) -> t -> unit val fold_in_order: (State.t -> 'a -> 'a) -> t -> 'a -> 'a end module Static = struct let transitive_closure next_vertices s = let rec visit acc v = next_vertices (fun v' acc -> let e = v, v' in if Selection.mem_edge_e acc e then acc else visit (Selection.add_edge_e acc e) v') State_dependency_graph.graph v acc in (* add [s] in the selection even if it has no ingoing/outgoing edges *) visit (Selection.add_vertex Selection.empty s) s let with_dependencies s = Subset (transitive_closure State_dependency_graph.G.fold_succ s), WDependencies s let with_codependencies s = Subset (transitive_closure State_dependency_graph.G.fold_pred s), WCoDependencies s let only_dependencies s = let g = transitive_closure State_dependency_graph.G.fold_succ s in Subset (Selection.remove_vertex g s), WStrictDependencies s let only_codependencies s = let g = transitive_closure State_dependency_graph.G.fold_pred s in Subset (Selection.remove_vertex g s), WStrictCoDependencies s let diff (sel1, w1) (sel2, w2 as selw2) = let sel = match sel1, sel2 with | _, Full -> Subset Selection.empty | Full, _sel2 when is_empty selw2 -> Full | Full, Subset sel2 -> let selection = State_dependency_graph.G.fold_vertex (fun v acc -> if Selection.mem_vertex sel2 v then acc else Selection.add_vertex acc v) State_dependency_graph.graph Selection.empty in let sel = State_dependency_graph.G.fold_edges (fun v1 v2 acc -> if Selection.mem_vertex sel2 v1 || Selection.mem_vertex sel2 v2 then acc else Selection.add_edge acc v1 v2) State_dependency_graph.graph selection in Subset sel | Subset sel1, Subset sel2 -> Subset (Selection.fold_vertex (fun v acc -> Selection.remove_vertex acc v) sel2 sel1) in sel, WDiff (w1, w2) module Operations = Graph.Oper.P(Selection) let union (sel1, w1) (sel2, w2) = let sel = match sel1, sel2 with | Full, _ | _, Full -> Full | Subset sel1, Subset sel2 -> Subset (Operations.union sel1 sel2) in sel, WUnion (w1, w2) let list_union l = let sel, _ = List.fold_left union empty l in let w = WOfList (List.map snd l) in sel, w let cardinal (sel, _) = match sel with | Full -> State_dependency_graph.G.nb_vertex State_dependency_graph.graph | Subset sel -> Selection.nb_vertex sel let iter_succ f (sel, _) v = match sel with | Full -> State_dependency_graph.G.iter_succ f State_dependency_graph.graph v | Subset sel -> Selection.iter_succ f sel v let fold_succ f (sel, _) v acc = match sel with | Full -> State_dependency_graph.G.fold_succ f State_dependency_graph.graph v acc | Subset sel -> Selection.fold_succ f sel v acc let iter f (sel, _) = match sel with | Full -> State_dependency_graph.G.iter_vertex f State_dependency_graph.graph | Subset sel -> Selection.iter_vertex f sel let fold f (sel, _) acc = match sel with | Full -> State_dependency_graph.G.fold_vertex f State_dependency_graph.graph acc | Subset sel -> Selection.fold_vertex f sel acc let to_list s = fold (fun s acc -> s :: acc) s [] module TG = State_topological.Make(State_dependency_graph.G) module TS = State_topological.Make(Selection) let iter_in_order f (sel, _) = match sel with | Full -> TG.iter f State_dependency_graph.graph | Subset sel -> TS.iter f sel let fold_in_order f (sel, _) acc = match sel with | Full -> TG.fold f State_dependency_graph.graph acc | Subset sel -> TS.fold f sel acc let pretty fmt sel = Format.fprintf fmt "contents of the selection:@\n"; let mem s = State_dependency_graph.G.mem_vertex State_dependency_graph.graph s in iter_in_order (fun s -> Format.fprintf fmt "\t state %S%s@\n" (State.get_unique_name s) (if mem s then "" else "(\"" ^ State.get_name s ^ "\")")) sel; Format.pp_print_flush fmt () let pretty_witness fmt (_, w) = pretty_witness fmt w end include Static (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state_selection.mli0000666000000000000000000001567213571573400021327 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** A state selection is a set of states with operations for easy handling of state dependencies. @since Carbon-20101201 @plugin development guide *) (* ************************************************************************** *) (** {2 Type declarations} *) (* ************************************************************************** *) type t (** Type of a state selection. @since Carbon-20101201 @plugin development guide *) val ty: t Type.t (** Type value representing {!t}. @since Carbon-20101201 *) (* ************************************************************************** *) (** {2 Generic Builders} *) (* ************************************************************************** *) val empty: t (** The empty selection. @since Carbon-20101201 *) val full: t (** The selection containing all the states. @since Carbon-20101201 *) val singleton: State.t -> t (** The selection containing only the given state. @since Carbon-20101201 *) val of_list: State.t list -> t (** The selection containing only the given list of states. @since Carbon-20101201 *) (* ************************************************************************** *) (** {2 Generic Getters} *) (* ************************************************************************** *) val is_empty: t -> bool (** @return [true] iff the selection is empty. @since Carbon-20101201 *) val is_full: t -> bool (** @return [true] iff the selection contains all the states. @since Carbon-20101201 *) val mem: t -> State.t -> bool (* ************************************************************************** *) (** {2 Specific selections} *) (* ************************************************************************** *) (** Operations over selections which depend on a State Dependency Graph implementation. @since Carbon-20101201 *) module type S = sig (* ************************************************************************ *) (** {2 Builders from dependencies} *) (* ************************************************************************ *) val with_dependencies: State.t -> t (** The selection containing the given state and all its dependencies. @since Carbon-20101201 @plugin development guide *) val only_dependencies: State.t -> t (** The selection containing all the dependencies of the given state (but not this state itself). @since Carbon-20101201 @plugin development guide *) val with_codependencies: State.t -> t (** The selection containing the given state and all its co-dependencies. @since Carbon-20101201 *) val only_codependencies: State.t -> t (** The selection containing all the co-dependencies of the given state (but not this state itself). @since Carbon-20101201 *) (* ************************************************************************ *) (** {2 Builders by operations over sets} *) (* ************************************************************************ *) val union: t -> t -> t (** Union of two selections. @since Carbon-20101201 *) val list_union: t list -> t (** Union of an arbitrary number of selection (0 gives an empty selection) @since Oxygen-20120901 *) val diff: t -> t -> t (** Difference between two selections. @since Carbon-20101201 *) (* ************************************************************************ *) (** {2 Specific Getters} *) (* ************************************************************************ *) val cardinal: t -> int (** Size of a selection. @since Carbon-20101201 *) val to_list: t -> State.t list (** Convert a selection into a list of states. @since Fluorine-20130401 *) val pretty: Format.formatter -> t -> unit (** Display a selection. @since Carbon-20101201 *) val pretty_witness: Format.formatter -> t -> unit (** Display a selection in a more concise form. (Using the atomic operations that were used to create it.) @since Aluminium-20160501 *) (** {3 Iterators} *) val iter_succ: (State.t -> unit) -> t -> State.t -> unit (** Iterate over the successor of a state in a selection. The order is unspecified. @since Carbon-20101201 *) val fold_succ: (State.t -> 'a -> 'a) -> t -> State.t -> 'a -> 'a (** Iterate over the successor of a state in a selection. The order is unspecified. @since Carbon-20101201 *) val iter: (State.t -> unit) -> t -> unit (** Iterate over a selection. The order is unspecified. @since Carbon-20101201 *) val fold: (State.t -> 'a -> 'a) -> t -> 'a -> 'a (** Fold over a selection. The order is unspecified. @since Carbon-20101201 *) val iter_in_order: (State.t -> unit) -> t -> unit (** Iterate over a selection in a topological ordering compliant with the State Dependency Graph. Less efficient that {!iter}. @since Carbon-20101201 *) val fold_in_order: (State.t -> 'a -> 'a) -> t -> 'a -> 'a (** Fold over a selection in a topological ordering compliant with the State Dependency Graph. Less efficient that {!iter}. @since Carbon-20101201 *) end (** Operations over selections which depend on {!State_dependency_graph.graph}. @since Carbon-20101201 @deprecated Oxygen-20120901 directly use equivalent top-level function instead. *) module Static: S include S (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state_topological.ml0000666000000000000000000000605213571573400021475 0ustar (**************************************************************************) (* *) (* Ocamlgraph: a generic graph library for ocaml *) (* Copyright (C) 2004-2012 *) (* Sylvain Conchon, Jean-Christophe Filliâtre and Julien Signoles *) (* *) (* This library is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Library General Public *) (* License version 2.1, as published by the Free Software Foundation. *) (* *) (* This library is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU Library General Public License version 2.1 for more *) (* details (enclosed in the file licenses/LGPLv2.1). *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) module type G = sig type t val iter_vertex : (State.t -> unit) -> t -> unit val iter_succ : (State.t -> unit) -> t -> State.t -> unit val in_degree : t -> State.t -> int end module Make(G: G) = struct module H = State.Hashtbl let fold f g acc = let degree = H.create 997 in let todo = Queue.create () in let push x = H.remove degree x; Queue.push x todo in let rec walk acc = if Queue.is_empty todo then (* let's find any node of minimal degree *) let min = H.fold (fun v d acc -> match acc with | None -> Some (v, d) | Some(_, min) -> if d < min then Some (v, d) else acc) degree None in match min with | None -> acc | Some(v, _) -> push v; walk acc else let v = Queue.pop todo in let acc = f v acc in G.iter_succ (fun x-> try let d = H.find degree x in if d = 1 then push x else H.replace degree x (d-1) with Not_found -> (* [x] already visited *) ()) g v; walk acc in G.iter_vertex (fun v -> let d = G.in_degree g v in if d = 0 then Queue.push v todo else H.add degree v d) g; walk acc let iter f g = fold (fun v () -> f v) g () end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/project/state_topological.mli0000666000000000000000000000565113571573400021652 0ustar (**************************************************************************) (* *) (* Ocamlgraph: a generic graph library for ocaml *) (* Copyright (C) 2004-2012 *) (* Sylvain Conchon, Jean-Christophe Filliâtre and Julien Signoles *) (* *) (* This library is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Library General Public *) (* License version 2.1, as published by the Free Software Foundation. *) (* *) (* This library is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *) (* *) (* See the GNU Library General Public License version 2.1 for more *) (* details (enclosed in the file licenses/LGPLv2.1). *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (** Topological ordering over states. This functor provides functions which allow iterating over a state graph in topological order. That is the module [Topological] from OcamlGraph, but it takes into account state clusters. *) (** Minimal graph signature to provide. Sub-signature of {!Sig.G}. *) module type G = sig type t val iter_vertex : (State.t -> unit) -> t -> unit val iter_succ : (State.t -> unit) -> t -> State.t -> unit val in_degree : t -> State.t -> int end (** Functor providing topological iterators over a graph. *) module Make(G: G) : sig val fold : (State.t -> 'a -> 'a) -> G.t -> 'a -> 'a (** [fold action g seed] allows iterating over the graph [g] in topological order. [action node accu] is called repeatedly, where [node] is the node being visited, and [accu] is the result of the [action]'s previous invocation, if any, and [seed] otherwise. If [g] contains cycles, the order is unspecified inside the cycles and every node in the cycles will be presented exactly once. *) val iter : (State.t -> unit) -> G.t -> unit (** [iter action] calls [action node] repeatedly. Nodes are (again) presented to [action] in topological order. The order is the same as for [fold]. *) end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/stdlib/0000777000000000000000000000000013571573400015237 5ustar frama-c-20.0-Calcium/src/libraries/stdlib/FCBuffer.ml0000666000000000000000000002316713571573400017224 0ustar (*****************************************************************************) (* *) (* This file was originally part of Objective Caml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright (C) 1996 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* This file is distributed under the terms of the GNU Library General *) (* Public License version 2, with the special exception on linking *) (* described below. See the GNU Library General Public License version *) (* 2 for more details (enclosed in the file licenses/LGPLv2). *) (* *) (* As a special exception to the GNU Library General Public License, *) (* you may link, statically or dynamically, a "work that uses the Library" *) (* with a publicly distributed version of the Library to *) (* produce an executable file containing portions of the Library, and *) (* distribute that executable file under terms of your choice, without *) (* any of the additional requirements listed in clause 6 of the GNU *) (* Library General Public License. *) (* By "a publicly distributed version of the Library", *) (* we mean either the unmodified Library as *) (* distributed by INRIA, or a modified version of the Library that is *) (* distributed under the conditions defined in clause 2 of the GNU *) (* Library General Public License. This exception does not however *) (* invalidate any other reasons why the executable file might be *) (* covered by the GNU Library General Public License. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (*****************************************************************************) (* Extensible buffers *) type t = {mutable buffer : bytes; mutable position : int; mutable length : int; initial_buffer : bytes} let create n = let n = if n < 1 then 1 else n in let n = if n > Sys.max_string_length then Sys.max_string_length else n in let s = Bytes.create n in {buffer = s; position = 0; length = n; initial_buffer = s} let contents b = Bytes.sub_string b.buffer 0 b.position let to_bytes b = Bytes.sub b.buffer 0 b.position let sub b ofs len = if ofs < 0 || len < 0 || ofs > b.position - len then invalid_arg "Buffer.sub" else Bytes.sub_string b.buffer ofs len ;; let sub_bytes b ofs len = if ofs < 0 || len < 0 || ofs > b.position - len then invalid_arg "Buffer.sub_bytes" else Bytes.sub b.buffer ofs len ;; let blit src srcoff dst dstoff len = if len < 0 || srcoff < 0 || srcoff > src.position - len || dstoff < 0 || dstoff > (Bytes.length dst) - len then invalid_arg "Buffer.blit" else Bytes.unsafe_blit src.buffer srcoff dst dstoff len ;; (* [calc_size cur_len req_len] computes the new size for a buffer having [cur_len] bytes, to ensure that it can contain at least [req_len] bytes. Used by [add_*] and [blit_*] functions. Raise [Failure] if the new size is too large. *) let calc_size cur_len req_len = let new_len = ref cur_len in while req_len > !new_len do new_len := 2 * !new_len done; if !new_len > Sys.max_string_length then begin if req_len <= Sys.max_string_length then new_len := Sys.max_string_length else failwith "Buffer.add: cannot grow buffer" end; !new_len (* [resize_aux b len] resizes buffer [b] to ensure it may contain at least [len] bytes. *) let resize_aux b len = let new_len = calc_size b.length len in let new_buffer = Bytes.create new_len in b.buffer <- new_buffer; b.length <- new_len let resize b len = let old_buffer = b.buffer in resize_aux b len; (* PR#6148: let's keep using [blit] rather than [unsafe_blit] in this tricky function that is slow anyway. *) Bytes.blit old_buffer 0 b.buffer 0 b.position let blit_substring_aux src srclen srcoff dst dstoff len = if len < 0 || srcoff < 0 || srcoff > srclen - len || dstoff < 0 || dstoff > dst.position then invalid_arg "Buffer.blit_*/add_*" else let new_pos = dstoff + len in let new_len = calc_size dst.length new_pos in if new_len > dst.length then begin let old_buffer = dst.buffer in resize_aux dst new_len; (* dst points to a new buffer now *) Bytes.blit old_buffer 0 dst.buffer 0 dstoff; Bytes.blit_string src srcoff dst.buffer dstoff len; end else Bytes.blit_string src srcoff dst.buffer dstoff len; if new_pos > dst.position then dst.position <- new_pos ;; let blit_buffer src srcoff dst dstoff len = blit_substring_aux (Bytes.unsafe_to_string src.buffer) src.position srcoff dst dstoff len let blit_substring src srcoff dst dstoff len = blit_substring_aux src (String.length src) srcoff dst dstoff len let blit_subbytes src srcoff dst dstoff len = blit_substring_aux (Bytes.unsafe_to_string src) (Bytes.length src) srcoff dst dstoff len let nth b ofs = if ofs < 0 || ofs >= b.position then invalid_arg "Buffer.nth" else Bytes.unsafe_get b.buffer ofs ;; let length b = b.position let clear b = b.position <- 0 let reset b = b.position <- 0; b.buffer <- b.initial_buffer; b.length <- Bytes.length b.buffer let truncate b c = if c < 0 then invalid_arg "Buffer.truncate" else if b.position > c then b.position <- c let add_char b c = let pos = b.position in if pos >= b.length then resize b (pos + 1); Bytes.unsafe_set b.buffer pos c; b.position <- pos + 1 let add_substring b s offset len = if offset < 0 || len < 0 || offset + len > String.length s then invalid_arg "Buffer.add_substring/add_subbytes"; blit_substring_aux s (String.length s) offset b b.position len let add_subbytes b s offset len = add_substring b (Bytes.unsafe_to_string s) offset len let add_string b s = let len = String.length s in blit_substring_aux s len 0 b b.position len let add_bytes b s = add_string b (Bytes.unsafe_to_string s) let add_buffer b bs = add_subbytes b bs.buffer 0 bs.position (* read up to [len] bytes from [ic] into [b]. *) let rec add_channel_rec b ic len = if len > 0 then ( let n = input ic b.buffer b.position len in b.position <- b.position + n; if n = 0 then raise End_of_file else add_channel_rec b ic (len-n) (* n <= len *) ) let add_channel b ic len = if len < 0 || len > Sys.max_string_length then (* PR#5004 *) invalid_arg "Buffer.add_channel"; if b.position + len > b.length then resize b (b.position + len); add_channel_rec b ic len let output_buffer oc b = output oc b.buffer 0 b.position let closing = function | '(' -> ')' | '{' -> '}' | _ -> assert false;; (* opening and closing: open and close characters, typically ( and ) k: balance of opening and closing chars s: the string where we are searching start: the index where we start the search. *) let advance_to_closing opening closing k s start = let rec advance k i lim = if i >= lim then raise Not_found else if s.[i] = opening then advance (k + 1) (i + 1) lim else if s.[i] = closing then if k = 0 then i else advance (k - 1) (i + 1) lim else advance k (i + 1) lim in advance k start (String.length s);; let advance_to_non_alpha s start = let rec advance i lim = if i >= lim then lim else match s.[i] with | 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' -> advance (i + 1) lim | _ -> i in advance start (String.length s);; (* We are just at the beginning of an ident in s, starting at start. *) let find_ident s start lim = if start >= lim then raise Not_found else match s.[start] with (* Parenthesized ident ? *) | '(' | '{' as c -> let new_start = start + 1 in let stop = advance_to_closing c (closing c) 0 s new_start in String.sub s new_start (stop - start - 1), stop + 1 (* Regular ident *) | _ -> let stop = advance_to_non_alpha s (start + 1) in String.sub s start (stop - start), stop;; (* Substitute $ident, $(ident), or ${ident} in s, according to the function mapping f. *) let add_substitute b f s = let lim = String.length s in let rec subst previous i = if i < lim then begin match s.[i] with | '$' as current when previous = '\\' -> add_char b current; subst ' ' (i + 1) | '$' -> let j = i + 1 in let ident, next_i = find_ident s j lim in add_string b (f ident); subst ' ' next_i | current when previous == '\\' -> add_char b '\\'; add_char b current; subst ' ' (i + 1) | '\\' as current -> subst current (i + 1) | current -> add_char b current; subst current (i + 1) end else if previous = '\\' then add_char b previous in subst ' ' 0;; frama-c-20.0-Calcium/src/libraries/stdlib/FCBuffer.mli0000666000000000000000000002133313571573400017366 0ustar (*****************************************************************************) (* *) (* This file was originally part of Objective Caml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright (C) 1996 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* This file is distributed under the terms of the GNU Library General *) (* Public License version 2, with the special exception on linking *) (* described below. See the GNU Library General Public License version *) (* 2 for more details (enclosed in the file licenses/LGPLv2). *) (* *) (* As a special exception to the GNU Library General Public License, *) (* you may link, statically or dynamically, a "work that uses the Library" *) (* with a publicly distributed version of the Library to *) (* produce an executable file containing portions of the Library, and *) (* distribute that executable file under terms of your choice, without *) (* any of the additional requirements listed in clause 6 of the GNU *) (* Library General Public License. *) (* By "a publicly distributed version of the Library", *) (* we mean either the unmodified Library as *) (* distributed by INRIA, or a modified version of the Library that is *) (* distributed under the conditions defined in clause 2 of the GNU *) (* Library General Public License. This exception does not however *) (* invalidate any other reasons why the executable file might be *) (* covered by the GNU Library General Public License. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (*****************************************************************************) (** Extensible buffers. This module implements buffers that automatically expand as necessary. It provides accumulative concatenation of strings in quasi-linear time (instead of quadratic time when strings are concatenated pairwise). *) type t (** The abstract type of buffers. *) val create : int -> t (** [create n] returns a fresh buffer, initially empty. The [n] parameter is the initial size of the internal byte sequence that holds the buffer contents. That byte sequence is automatically reallocated when more than [n] characters are stored in the buffer, but shrinks back to [n] characters when [reset] is called. For best performance, [n] should be of the same order of magnitude as the number of characters that are expected to be stored in the buffer (for instance, 80 for a buffer that holds one output line). Nothing bad will happen if the buffer grows beyond that limit, however. In doubt, take [n = 16] for instance. If [n] is not between 1 and {!Sys.max_string_length}, it will be clipped to that interval. *) val contents : t -> string (** Return a copy of the current contents of the buffer. The buffer itself is unchanged. *) val to_bytes : t -> bytes (** Return a copy of the current contents of the buffer. The buffer itself is unchanged. @since 4.02 *) val sub : t -> int -> int -> string (** [Buffer.sub b off len] returns (a copy of) the bytes from the current contents of the buffer [b] starting at offset [off] of length [len] bytes. May raise [Invalid_argument] if out of bounds request. The buffer itself is unaffected. *) val sub_bytes : t -> int -> int -> bytes (** Same as [sub] but return a byte sequence instead of a string. @since 4.05 *) val blit : t -> int -> bytes -> int -> int -> unit (** [Buffer.blit src srcoff dst dstoff len] copies [len] characters from the current contents of the buffer [src], starting at offset [srcoff] to [dst], starting at character [dstoff]. Raise [Invalid_argument] if [srcoff] and [len] do not designate a valid range of [src], or if [dstoff] and [len] do not designate a valid range of [dst]. @since 3.11.2 *) val blit_buffer : t -> int -> t -> int -> int -> unit (** Similar to [blit], but copies to a buffer, and allows the destination buffer to grow, that is, [dstoff + len] can be larger than the length of [dst]. However, there cannot be any holes, i.e. [dstoff] must be smaller than the original length of [dst]. @since 4.05 *) val blit_substring : string -> int -> t -> int -> int -> unit (** Same as [blit_buffer], but copies from a string to a buffer. @since 4.05 *) val blit_subbytes : bytes -> int -> t -> int -> int -> unit (** Same as [blit_buffer], but copies from bytes to a buffer. @since 4.05 *) val nth : t -> int -> char (** get the n-th character of the buffer. Raise [Invalid_argument] if index out of bounds *) val length : t -> int (** Return the number of characters currently contained in the buffer. *) val clear : t -> unit (** Empty the buffer. *) val reset : t -> unit (** Empty the buffer and deallocate the internal byte sequence holding the buffer contents, replacing it with the initial internal byte sequence of length [n] that was allocated by {!Buffer.create} [n]. For long-lived buffers that may have grown a lot, [reset] allows faster reclamation of the space used by the buffer. *) val truncate : t -> int -> unit (** [truncate b c] truncates the length of [b] to be no larger than [c]. Does nothing if the length of [b] is already smaller than or equal [c]. In particular, it does not change the size of the underlying buffer. Raise [Invalid_argument] if [c < 0]. @since 4.05 *) val add_char : t -> char -> unit (** [add_char b c] appends the character [c] at the end of the buffer [b]. *) val add_string : t -> string -> unit (** [add_string b s] appends the string [s] at the end of the buffer [b]. *) val add_bytes : t -> bytes -> unit (** [add_string b s] appends the string [s] at the end of the buffer [b]. @since 4.02 *) val add_substring : t -> string -> int -> int -> unit (** [add_substring b s ofs len] takes [len] characters from offset [ofs] in string [s] and appends them at the end of the buffer [b]. *) val add_subbytes : t -> bytes -> int -> int -> unit (** [add_substring b s ofs len] takes [len] characters from offset [ofs] in byte sequence [s] and appends them at the end of the buffer [b]. @since 4.02 *) val add_substitute : t -> (string -> string) -> string -> unit (** [add_substitute b f s] appends the string pattern [s] at the end of the buffer [b] with substitution. The substitution process looks for variables into the pattern and substitutes each variable name by its value, as obtained by applying the mapping [f] to the variable name. Inside the string pattern, a variable name immediately follows a non-escaped [$] character and is one of the following: - a non empty sequence of alphanumeric or [_] characters, - an arbitrary sequence of characters enclosed by a pair of matching parentheses or curly brackets. An escaped [$] character is a [$] that immediately follows a backslash character; it then stands for a plain [$]. Raise [Not_found] if the closing character of a parenthesized variable cannot be found. *) val add_buffer : t -> t -> unit (** [add_buffer b1 b2] appends the current contents of buffer [b2] at the end of buffer [b1]. [b2] is not modified. *) val add_channel : t -> in_channel -> int -> unit (** [add_channel b ic n] reads at most [n] characters from the input channel [ic] and stores them at the end of buffer [b]. Raise [End_of_file] if the channel contains fewer than [n] characters. In this case the characters are still added to the buffer, so as to avoid loss of data. *) val output_buffer : out_channel -> t -> unit (** [output_buffer oc b] writes the current contents of buffer [b] on the output channel [oc]. *) frama-c-20.0-Calcium/src/libraries/stdlib/FCHashtbl.ml0000666000000000000000000000774413571573400017403 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type S = sig include Hashtbl.S val iter_sorted: ?cmp:(key -> key -> int) -> (key -> 'a -> unit) -> 'a t -> unit val fold_sorted: ?cmp:(key -> key -> int) -> (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val iter_sorted_by_entry: cmp:((key * 'a) -> (key * 'a) -> int) -> (key -> 'a -> unit) -> 'a t -> unit val fold_sorted_by_entry: cmp:((key * 'a) -> (key * 'a) -> int) -> (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val iter_sorted_by_value: cmp:('a -> 'a -> int) -> (key -> 'a -> unit) -> 'a t -> unit val fold_sorted_by_value: cmp:('a -> 'a -> int) -> (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val find_opt: 'a t -> key -> 'a option val find_def: 'a t -> key -> 'a -> 'a val memo: 'a t -> key -> (key -> 'a) -> 'a end let hash = Hashtbl.hash let hash_param = Hashtbl.hash_param module Make(H: Hashtbl.HashedType) : S with type key = H.t = struct include Hashtbl.Make(H) let fold_sorted ?(cmp=Transitioning.Stdlib.compare) f h acc = let module Aux = struct type t = key let compare = cmp end in let module M = FCMap.Make(Aux) in let add k v m = try let l = v :: M.find k m in M.add k l m with Not_found -> M.add k [v] m in let map = fold add h M.empty in let fold_k k l acc = List.fold_left (fun acc v -> f k v acc) acc (List.rev l) in M.fold fold_k map acc let iter_sorted ?cmp f h = fold_sorted ?cmp (fun k v () -> f k v) h () let fold_sorted_by_entry (type value) ~cmp f h acc = let module Aux = struct type t = (key*value) let compare = cmp end in let module S = FCSet.Make(Aux) in let add k v s = S.add (k,v) s in let set = fold add h S.empty in S.fold (fun (k,v) -> f k v) set acc let iter_sorted_by_entry ~cmp f h = fold_sorted_by_entry ~cmp (fun k v () -> f k v) h () let fold_sorted_by_value ~cmp f h acc = fold_sorted_by_entry ~cmp:(fun (_ka,va) (_kb,vb) -> cmp va vb) f h acc let iter_sorted_by_value ~cmp f h = iter_sorted_by_entry ~cmp:(fun (_ka,va) (_kb,vb) -> cmp va vb) f h let find_opt h k = match find h k with | exception Not_found -> None | v -> Some v let find_def h k v = match find h k with | exception Not_found -> v | v -> v let memo tbl k f = try find tbl k with Not_found -> let v = f k in add tbl k v; v end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/stdlib/FCHashtbl.mli0000666000000000000000000000744213571573400017547 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Extension of OCaml's [Hashtbl] module. *) (* No need to expand OCaml's [Hashtbl.S] here: we do not provide an alternative implementation of [Hashtbl]. Hence, we will always be compatible with the stdlib. *) module type S = sig include Hashtbl.S val iter_sorted: ?cmp:(key -> key -> int) -> (key -> 'a -> unit) -> 'a t -> unit (** Iter on the hashtbl, but respecting the order on keys induced by [cmp]. Use [Pervasives.compare] if [cmp] not given. If the table contains several bindings for the same key, they are passed to [f] in reverse order of introduction, that is, the most recent binding is passed first. *) val fold_sorted: ?cmp:(key -> key -> int) -> (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b (** Fold on the hashtbl, but respecting the order on keys induced by [cmp]. Use [Pervasives.compare] if [cmp] not given. If the table contains several bindings for the same key, they are passed to [f] in reverse order of introduction, that is, the most recent binding is passed first. *) val iter_sorted_by_entry: cmp:((key * 'a) -> (key * 'a) -> int) -> (key -> 'a -> unit) -> 'a t -> unit val fold_sorted_by_entry: cmp:((key * 'a) -> (key * 'a) -> int) -> (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b (** Iter or fold on the hashtable, respecting the order on entries given by [cmp]. The table may contains several bindings for the same key. *) val iter_sorted_by_value: cmp:('a -> 'a -> int) -> (key -> 'a -> unit) -> 'a t -> unit val fold_sorted_by_value: cmp:('a -> 'a -> int) -> (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b (** Iter or fold on the hashtable, respecting the order on entries given by [cmp]. The relative order for entries whose values is equal according to cmp, is not specified. *) val find_opt: 'a t -> key -> 'a option val find_def: 'a t -> key -> 'a -> 'a val memo: 'a t -> key -> (key -> 'a) -> 'a (** [memo tbl k f] returns the binding of [k] in [tbl]. If there is no binding, add the binding [f k] associated to [k] in [tbl] and return it. @since Chlorine-20180501 *) end module Make(H: Hashtbl.HashedType) : S with type key = H.t val hash : 'a -> int val hash_param : int -> int -> 'a -> int frama-c-20.0-Calcium/src/libraries/stdlib/FCMap.ml0000666000000000000000000001021213571573400016513 0ustar (*****************************************************************************) (* *) (* This file was originally part of Objective Caml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright (C) 1996 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* This file is distributed under the terms of the GNU Library General *) (* Public License version 2, with the special exception on linking *) (* described below. See the GNU Library General Public License version *) (* 2 for more details (enclosed in the file licenses/LGPLv2). *) (* *) (* As a special exception to the GNU Library General Public License, *) (* you may link, statically or dynamically, a "work that uses the Library" *) (* with a publicly distributed version of the Library to *) (* produce an executable file containing portions of the Library, and *) (* distribute that executable file under terms of your choice, without *) (* any of the additional requirements listed in clause 6 of the GNU *) (* Library General Public License. *) (* By "a publicly distributed version of the Library", *) (* we mean either the unmodified Library as *) (* distributed by INRIA, or a modified version of the Library that is *) (* distributed under the conditions defined in clause 2 of the GNU *) (* Library General Public License. This exception does not however *) (* invalidate any other reasons why the executable file might be *) (* covered by the GNU Library General Public License. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (*****************************************************************************) module type S = sig type key type +'a t val empty: 'a t val is_empty: 'a t -> bool val mem: key -> 'a t -> bool val add: key -> 'a -> 'a t -> 'a t val singleton: key -> 'a -> 'a t val remove: key -> 'a t -> 'a t val merge: (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t val compare: ('a -> 'a -> int) -> 'a t -> 'a t -> int val equal: ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val iter: (key -> 'a -> unit) -> 'a t -> unit val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val for_all: (key -> 'a -> bool) -> 'a t -> bool val exists: (key -> 'a -> bool) -> 'a t -> bool val filter: (key -> 'a -> bool) -> 'a t -> 'a t val partition: (key -> 'a -> bool) -> 'a t -> 'a t * 'a t val cardinal: 'a t -> int val bindings: 'a t -> (key * 'a) list val min_binding: 'a t -> (key * 'a) val max_binding: 'a t -> (key * 'a) val choose: 'a t -> (key * 'a) val split: key -> 'a t -> 'a t * 'a option * 'a t val find: key -> 'a t -> 'a val find_opt: key -> 'a t -> 'a option val map: ('a -> 'b) -> 'a t -> 'b t val mapi: (key -> 'a -> 'b) -> 'a t -> 'b t end module Make(X: Map.OrderedType) = struct include Map.Make(X) let find_opt k m = match find k m with | exception Not_found -> None | v -> Some v end frama-c-20.0-Calcium/src/libraries/stdlib/FCMap.mli0000666000000000000000000002125013571573400016670 0ustar (*****************************************************************************) (* *) (* This file was originally part of Objective Caml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright (C) 1996 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* This file is distributed under the terms of the GNU Library General *) (* Public License version 2, with the special exception on linking *) (* described below. See the GNU Library General Public License version *) (* 2 for more details (enclosed in the file licenses/LGPLv2). *) (* *) (* As a special exception to the GNU Library General Public License, *) (* you may link, statically or dynamically, a "work that uses the Library" *) (* with a publicly distributed version of the Library to *) (* produce an executable file containing portions of the Library, and *) (* distribute that executable file under terms of your choice, without *) (* any of the additional requirements listed in clause 6 of the GNU *) (* Library General Public License. *) (* By "a publicly distributed version of the Library", *) (* we mean either the unmodified Library as *) (* distributed by INRIA, or a modified version of the Library that is *) (* distributed under the conditions defined in clause 2 of the GNU *) (* Library General Public License. This exception does not however *) (* invalidate any other reasons why the executable file might be *) (* covered by the GNU Library General Public License. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (*****************************************************************************) (** Association tables over ordered types. This signatures is a partial copy of the signature of [Map.S] of OCaml's standard library, which we extend with some new functions. *) module type S = sig type key (** The type of the map keys. *) type (+'a) t (** The type of maps from type [key] to type ['a]. *) val empty: 'a t (** The empty map. *) val is_empty: 'a t -> bool (** Test whether a map is empty or not. *) val mem: key -> 'a t -> bool (** [mem x m] returns [true] if [m] contains a binding for [x], and [false] otherwise. *) val add: key -> 'a -> 'a t -> 'a t (** [add x y m] returns a map containing the same bindings as [m], plus a binding of [x] to [y]. If [x] was already bound in [m], its previous binding disappears. *) val singleton: key -> 'a -> 'a t (** [singleton x y] returns the one-element map that contains a binding [y] for [x]. @since 3.12.0 *) val remove: key -> 'a t -> 'a t (** [remove x m] returns a map containing the same bindings as [m], except for [x] which is unbound in the returned map. *) val merge: (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t (** [merge f m1 m2] computes a map whose keys is a subset of keys of [m1] and of [m2]. The presence of each such binding, and the corresponding value, is determined with the function [f]. @since 3.12.0 *) val compare: ('a -> 'a -> int) -> 'a t -> 'a t -> int (** Total ordering between maps. The first argument is a total ordering used to compare data associated with equal keys in the two maps. *) val equal: ('a -> 'a -> bool) -> 'a t -> 'a t -> bool (** [equal cmp m1 m2] tests whether the maps [m1] and [m2] are equal, that is, contain equal keys and associate them with equal data. [cmp] is the equality predicate used to compare the data associated with the keys. *) val iter: (key -> 'a -> unit) -> 'a t -> unit (** [iter f m] applies [f] to all bindings in map [m]. [f] receives the key as first argument, and the associated value as second argument. The bindings are passed to [f] in increasing order with respect to the ordering over the type of the keys. *) val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b (** [fold f m a] computes [(f kN dN ... (f k1 d1 a)...)], where [k1 ... kN] are the keys of all bindings in [m] (in increasing order), and [d1 ... dN] are the associated data. *) val for_all: (key -> 'a -> bool) -> 'a t -> bool (** [for_all p m] checks if all the bindings of the map satisfy the predicate [p]. @since 3.12.0 *) val exists: (key -> 'a -> bool) -> 'a t -> bool (** [exists p m] checks if at least one binding of the map satisfy the predicate [p]. @since 3.12.0 *) val filter: (key -> 'a -> bool) -> 'a t -> 'a t (** [filter p m] returns the map with all the bindings in [m] that satisfy predicate [p]. @since 3.12.0 *) val partition: (key -> 'a -> bool) -> 'a t -> 'a t * 'a t (** [partition p m] returns a pair of maps [(m1, m2)], where [m1] contains all the bindings of [s] that satisfy the predicate [p], and [m2] is the map with all the bindings of [s] that do not satisfy [p]. @since 3.12.0 *) val cardinal: 'a t -> int (** Return the number of bindings of a map. @since 3.12.0 *) val bindings: 'a t -> (key * 'a) list (** Return the list of all bindings of the given map. The returned list is sorted in increasing order with respect to the ordering [Ord.compare], where [Ord] is the argument given to {!Map.Make}. @since 3.12.0 *) val min_binding: 'a t -> (key * 'a) (** Return the smallest binding of the given map (with respect to the [Ord.compare] ordering), or raise [Not_found] if the map is empty. @since 3.12.0 *) val max_binding: 'a t -> (key * 'a) (** Same as {!min_binding}, but returns the largest binding of the given map. @since 3.12.0 *) val choose: 'a t -> (key * 'a) (** Return one binding of the given map, or raise [Not_found] if the map is empty. Which binding is chosen is unspecified, but equal bindings will be chosen for equal maps. @since 3.12.0 *) val split: key -> 'a t -> 'a t * 'a option * 'a t (** [split x m] returns a triple [(l, data, r)], where [l] is the map with all the bindings of [m] whose key is strictly less than [x]; [r] is the map with all the bindings of [m] whose key is strictly greater than [x]; [data] is [None] if [m] contains no binding for [x], or [Some v] if [m] binds [v] to [x]. @since 3.12.0 *) val find: key -> 'a t -> 'a (** [find x m] returns the current binding of [x] in [m], or raises [Not_found] if no such binding exists. *) val find_opt: key -> 'a t -> 'a option (** [find x m] returns the current binding of [x] in [m], or return [None] if no such binding exists. *) val map: ('a -> 'b) -> 'a t -> 'b t (** [map f m] returns a map with same domain as [m], where the associated value [a] of all bindings of [m] has been replaced by the result of the application of [f] to [a]. The bindings are passed to [f] in increasing order with respect to the ordering over the type of the keys. *) val mapi: (key -> 'a -> 'b) -> 'a t -> 'b t (** Same as {!map}, but the function receives as arguments both the key and the associated value for each binding of the map. *) end module Make (Ord : Map.OrderedType) : S with type key = Ord.t (** Functor building an implementation of the map structure given a totally ordered type. *) frama-c-20.0-Calcium/src/libraries/stdlib/FCSet.ml0000666000000000000000000003751213571573400016545 0ustar (*****************************************************************************) (* *) (* This file was originally part of Objective Caml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright (C) 1996 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* This file is distributed under the terms of the GNU Library General *) (* Public License version 2, with the special exception on linking *) (* described below. See the GNU Library General Public License version *) (* 2 for more details (enclosed in the file licenses/LGPLv2). *) (* *) (* As a special exception to the GNU Library General Public License, *) (* you may link, statically or dynamically, a "work that uses the Library" *) (* with a publicly distributed version of the Library to *) (* produce an executable file containing portions of the Library, and *) (* distribute that executable file under terms of your choice, without *) (* any of the additional requirements listed in clause 6 of the GNU *) (* Library General Public License. *) (* By "a publicly distributed version of the Library", *) (* we mean either the unmodified Library as *) (* distributed by INRIA, or a modified version of the Library that is *) (* distributed under the conditions defined in clause 2 of the GNU *) (* Library General Public License. This exception does not however *) (* invalidate any other reasons why the executable file might be *) (* covered by the GNU Library General Public License. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (*****************************************************************************) module type S_Basic_Compare = sig type elt type t val empty: t val is_empty: t -> bool val mem: elt -> t -> bool val add: elt -> t -> t val singleton: elt -> t val remove: elt -> t -> t val union: t -> t -> t val inter: t -> t -> t val diff: t -> t -> t val compare: t -> t -> int val equal: t -> t -> bool val subset: t -> t -> bool val iter: (elt -> unit) -> t -> unit val fold: (elt -> 'a -> 'a) -> t -> 'a -> 'a val for_all: (elt -> bool) -> t -> bool val exists: (elt -> bool) -> t -> bool val filter: (elt -> bool) -> t -> t val partition: (elt -> bool) -> t -> t * t val cardinal: t -> int val elements: t -> elt list val choose: t -> elt val find: elt -> t -> elt val of_list: elt list -> t end module type S = sig include S_Basic_Compare val min_elt: t -> elt val max_elt: t -> elt val split: elt -> t -> t * bool * t val nearest_elt_le: elt -> t -> elt val nearest_elt_ge: elt -> t -> elt end module Make(Ord: Set.OrderedType) = struct type elt = Ord.t type t = Empty | Node of t * elt * t * int (* Sets are represented by balanced binary trees (the heights of the children differ by at most 2 *) let height = function Empty -> 0 | Node(_, _, _, h) -> h (* Creates a new node with left son l, value v and right son r. We must have all elements of l < v < all elements of r. l and r must be balanced and | height l - height r | <= 2. Inline expansion of height for better speed. *) let create l v r = let hl = match l with Empty -> 0 | Node(_,_,_,h) -> h in let hr = match r with Empty -> 0 | Node(_,_,_,h) -> h in Node(l, v, r, (if hl >= hr then hl + 1 else hr + 1)) (* Same as create, but performs one step of rebalancing if necessary. Assumes l and r balanced and | height l - height r | <= 3. Inline expansion of create for better speed in the most frequent case where no rebalancing is required. *) let bal l v r = let hl = match l with Empty -> 0 | Node(_,_,_,h) -> h in let hr = match r with Empty -> 0 | Node(_,_,_,h) -> h in if hl > hr + 2 then begin match l with Empty -> invalid_arg "Set.bal" | Node(ll, lv, lr, _) -> if height ll >= height lr then create ll lv (create lr v r) else begin match lr with Empty -> invalid_arg "Set.bal" | Node(lrl, lrv, lrr, _)-> create (create ll lv lrl) lrv (create lrr v r) end end else if hr > hl + 2 then begin match r with Empty -> invalid_arg "Set.bal" | Node(rl, rv, rr, _) -> if height rr >= height rl then create (create l v rl) rv rr else begin match rl with Empty -> invalid_arg "Set.bal" | Node(rll, rlv, rlr, _) -> create (create l v rll) rlv (create rlr rv rr) end end else Node(l, v, r, (if hl >= hr then hl + 1 else hr + 1)) (* Insertion of one element *) let rec add x = function Empty -> Node(Empty, x, Empty, 1) | Node(l, v, r, _) as t -> let c = Ord.compare x v in if c = 0 then t else if c < 0 then bal (add x l) v r else bal l v (add x r) let singleton x = Node(Empty, x, Empty, 1) (* Beware: those two functions assume that the added v is *strictly* smaller (or bigger) than all the present elements in the tree; it does not test for equality with the current min (or max) element. Indeed, they are only used during the "join" operation which respects this precondition. *) let rec add_min_element v = function | Empty -> singleton v | Node (l, x, r, _) -> bal (add_min_element v l) x r let rec add_max_element v = function | Empty -> singleton v | Node (l, x, r, _) -> bal l x (add_max_element v r) (* Same as create and bal, but no assumptions are made on the relative heights of l and r. *) let rec join l v r = match (l, r) with (Empty, _) -> add_min_element v r | (_, Empty) -> add_max_element v l | (Node(ll, lv, lr, lh), Node(rl, rv, rr, rh)) -> if lh > rh + 2 then bal ll lv (join lr v r) else if rh > lh + 2 then bal (join l v rl) rv rr else create l v r (* Smallest and greatest element of a set *) let rec min_elt = function Empty -> raise Not_found | Node(Empty, v, _, _) -> v | Node(l, _, _, _) -> min_elt l let rec max_elt = function Empty -> raise Not_found | Node(_, v, Empty, _) -> v | Node(_, _, r, _) -> max_elt r (* Remove the smallest element of the given set *) let rec remove_min_elt = function Empty -> invalid_arg "Set.remove_min_elt" | Node(Empty, _, r, _) -> r | Node(l, v, r, _) -> bal (remove_min_elt l) v r (* Merge two trees l and r into one. All elements of l must precede the elements of r. Assume | height l - height r | <= 2. *) let merge t1 t2 = match (t1, t2) with (Empty, t) -> t | (t, Empty) -> t | (_, _) -> bal t1 (min_elt t2) (remove_min_elt t2) (* Merge two trees l and r into one. All elements of l must precede the elements of r. No assumption on the heights of l and r. *) let concat t1 t2 = match (t1, t2) with (Empty, t) -> t | (t, Empty) -> t | (_, _) -> join t1 (min_elt t2) (remove_min_elt t2) (* Splitting. split x s returns a triple (l, present, r) where - l is the set of elements of s that are < x - r is the set of elements of s that are > x - present is false if s contains no element equal to x, or true if s contains an element equal to x. *) let rec split x = function Empty -> (Empty, false, Empty) | Node(l, v, r, _) -> let c = Ord.compare x v in if c = 0 then (l, true, r) else if c < 0 then let (ll, pres, rl) = split x l in (ll, pres, join rl v r) else let (lr, pres, rr) = split x r in (join l v lr, pres, rr) (* Implementation of the set operations *) let empty = Empty let is_empty = function Empty -> true | _ -> false let rec mem x = function Empty -> false | Node(l, v, r, _) -> let c = Ord.compare x v in c = 0 || mem x (if c < 0 then l else r) let rec remove x = function Empty -> Empty | Node(l, v, r, _) -> let c = Ord.compare x v in if c = 0 then merge l r else if c < 0 then bal (remove x l) v r else bal l v (remove x r) let rec union s1 s2 = match (s1, s2) with (Empty, t2) -> t2 | (t1, Empty) -> t1 | (Node(l1, v1, r1, h1), Node(l2, v2, r2, h2)) -> if h1 >= h2 then if h2 = 1 then add v2 s1 else begin let (l2, _, r2) = split v1 s2 in join (union l1 l2) v1 (union r1 r2) end else if h1 = 1 then add v1 s2 else begin let (l1, _, r1) = split v2 s1 in join (union l1 l2) v2 (union r1 r2) end let rec inter s1 s2 = match (s1, s2) with (Empty, _) -> Empty | (_, Empty) -> Empty | (Node(l1, v1, r1, _), t2) -> match split v1 t2 with (l2, false, r2) -> concat (inter l1 l2) (inter r1 r2) | (l2, true, r2) -> join (inter l1 l2) v1 (inter r1 r2) let rec diff s1 s2 = match (s1, s2) with (Empty, _) -> Empty | (t1, Empty) -> t1 | (Node(l1, v1, r1, _), t2) -> match split v1 t2 with (l2, false, r2) -> join (diff l1 l2) v1 (diff r1 r2) | (l2, true, r2) -> concat (diff l1 l2) (diff r1 r2) type enumeration = End | More of elt * t * enumeration let rec cons_enum s e = match s with Empty -> e | Node(l, v, r, _) -> cons_enum l (More(v, r, e)) let rec compare_aux e1 e2 = match (e1, e2) with (End, End) -> 0 | (End, _) -> -1 | (_, End) -> 1 | (More(v1, r1, e1), More(v2, r2, e2)) -> let c = Ord.compare v1 v2 in if c <> 0 then c else compare_aux (cons_enum r1 e1) (cons_enum r2 e2) let compare s1 s2 = compare_aux (cons_enum s1 End) (cons_enum s2 End) let equal s1 s2 = compare s1 s2 = 0 let rec subset s1 s2 = match (s1, s2) with Empty, _ -> true | _, Empty -> false | Node (l1, v1, r1, _), (Node (l2, v2, r2, _) as t2) -> let c = Ord.compare v1 v2 in if c = 0 then subset l1 l2 && subset r1 r2 else if c < 0 then subset (Node (l1, v1, Empty, 0)) l2 && subset r1 t2 else subset (Node (Empty, v1, r1, 0)) r2 && subset l1 t2 let rec iter f = function Empty -> () | Node(l, v, r, _) -> iter f l; f v; iter f r let rec fold f s accu = match s with Empty -> accu | Node(l, v, r, _) -> fold f r (f v (fold f l accu)) let rec for_all p = function Empty -> true | Node(l, v, r, _) -> p v && for_all p l && for_all p r let rec exists p = function Empty -> false | Node(l, v, r, _) -> p v || exists p l || exists p r let rec filter p = function Empty -> Empty | Node(l, v, r, _) -> (* call [p] in the expected left-to-right order *) let l' = filter p l in let pv = p v in let r' = filter p r in if pv then join l' v r' else concat l' r' let rec partition p = function Empty -> (Empty, Empty) | Node(l, v, r, _) -> (* call [p] in the expected left-to-right order *) let (lt, lf) = partition p l in let pv = p v in let (rt, rf) = partition p r in if pv then (join lt v rt, concat lf rf) else (concat lt rt, join lf v rf) let rec cardinal = function Empty -> 0 | Node(l, _, r, _) -> cardinal l + 1 + cardinal r let rec elements_aux accu = function Empty -> accu | Node(l, v, r, _) -> elements_aux (v :: elements_aux accu r) l let elements s = elements_aux [] s let choose = min_elt let rec find x = function Empty -> raise Not_found | Node(l, v, r, _) -> let c = Ord.compare x v in if c = 0 then v else find x (if c < 0 then l else r) (* Auxiliary function for function {!of_list} below *) let sort_unique l = let l = List.sort Ord.compare l in let rec remove_duplicates l = match l with | [_] | [] -> l | e1 :: (e2 :: _ as q) -> if Ord.compare e1 e2 = 0 then remove_duplicates q else let q' = remove_duplicates q in if q' == q then l else e1 :: q' in remove_duplicates l let of_sorted_list l = let rec sub n l = match n, l with | 0, l -> Empty, l | 1, x0 :: l -> Node (Empty, x0, Empty, 1), l | 2, x0 :: x1 :: l -> Node (Node(Empty, x0, Empty, 1), x1, Empty, 2), l | 3, x0 :: x1 :: x2 :: l -> Node (Node(Empty, x0, Empty, 1), x1, Node(Empty, x2, Empty, 1), 2), l | n, l -> let nl = n / 2 in let left, l = sub nl l in match l with | [] -> assert false | mid :: l -> let right, l = sub (n - nl - 1) l in create left mid right, l in fst (sub (List.length l) l) let of_list l = match l with | [] -> empty | [x0] -> singleton x0 | [x0; x1] -> add x1 (singleton x0) | [x0; x1; x2] -> add x2 (add x1 (singleton x0)) | [x0; x1; x2; x3] -> add x3 (add x2 (add x1 (singleton x0))) | [x0; x1; x2; x3; x4] -> add x4 (add x3 (add x2 (add x1 (singleton x0)))) | _ -> of_sorted_list (sort_unique l) let rec nearest_elt_le x = function | Empty -> raise Not_found | Node(l, v, r, _) -> let c = Ord.compare x v in if c = 0 then v else if c < 0 then nearest_elt_le x l else let rec nearest w x = function Empty -> w | Node(l, v, r, _) -> let c = Ord.compare x v in if c = 0 then v else if c < 0 then nearest w x l else nearest v x r in nearest v x r let rec nearest_elt_ge x = function | Empty -> raise Not_found | Node(l, v, r, _) -> let c = Ord.compare x v in if c = 0 then v else if c < 0 then let rec nearest w x = function Empty -> w | Node(l, v, r, _) -> let c = Ord.compare x v in if c = 0 then v else if c < 0 then nearest v x l else nearest w x r in nearest v x l else nearest_elt_ge x r end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/stdlib/FCSet.mli0000666000000000000000000002055413571573400016714 0ustar (*****************************************************************************) (* *) (* This file was originally part of Objective Caml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright (C) 1996 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* This file is distributed under the terms of the GNU Library General *) (* Public License version 2, with the special exception on linking *) (* described below. See the GNU Library General Public License version *) (* 2 for more details (enclosed in the file licenses/LGPLv2). *) (* *) (* As a special exception to the GNU Library General Public License, *) (* you may link, statically or dynamically, a "work that uses the Library" *) (* with a publicly distributed version of the Library to *) (* produce an executable file containing portions of the Library, and *) (* distribute that executable file under terms of your choice, without *) (* any of the additional requirements listed in clause 6 of the GNU *) (* Library General Public License. *) (* By "a publicly distributed version of the Library", *) (* we mean either the unmodified Library as *) (* distributed by INRIA, or a modified version of the Library that is *) (* distributed under the conditions defined in clause 2 of the GNU *) (* Library General Public License. This exception does not however *) (* invalidate any other reasons why the executable file might be *) (* covered by the GNU Library General Public License. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (*****************************************************************************) (** Sets over ordered types. This signatures is a partial copy of the signature of OCaml's [Set.S], which we extend with new operations. *) module type S_Basic_Compare = sig type elt (** The type of the set elements. *) type t (** The type of sets. *) val empty: t (** The empty set. *) val is_empty: t -> bool (** Test whether a set is empty or not. *) val mem: elt -> t -> bool (** [mem x s] tests whether [x] belongs to the set [s]. *) val add: elt -> t -> t (** [add x s] returns a set containing all elements of [s], plus [x]. If [x] was already in [s], [s] is returned unchanged. *) val singleton: elt -> t (** [singleton x] returns the one-element set containing only [x]. *) val remove: elt -> t -> t (** [remove x s] returns a set containing all elements of [s], except [x]. If [x] was not in [s], [s] is returned unchanged. *) val union: t -> t -> t (** Set union. *) val inter: t -> t -> t (** Set intersection. *) (** Set difference. *) val diff: t -> t -> t val compare: t -> t -> int (** Total ordering between sets. Can be used as the ordering function for doing sets of sets. *) val equal: t -> t -> bool (** [equal s1 s2] tests whether the sets [s1] and [s2] are equal, that is, contain equal elements. *) val subset: t -> t -> bool (** [subset s1 s2] tests whether the set [s1] is a subset of the set [s2]. *) val iter: (elt -> unit) -> t -> unit (** [iter f s] applies [f] in turn to all elements of [s]. The elements of [s] are presented to [f] in increasing order with respect to the ordering over the type of the elements. *) val fold: (elt -> 'a -> 'a) -> t -> 'a -> 'a (** [fold f s a] computes [(f xN ... (f x2 (f x1 a))...)], where [x1 ... xN] are the elements of [s], in increasing order. *) val for_all: (elt -> bool) -> t -> bool (** [for_all p s] checks if all elements of the set satisfy the predicate [p]. *) val exists: (elt -> bool) -> t -> bool (** [exists p s] checks if at least one element of the set satisfies the predicate [p]. *) val filter: (elt -> bool) -> t -> t (** [filter p s] returns the set of all elements in [s] that satisfy predicate [p]. *) val partition: (elt -> bool) -> t -> t * t (** [partition p s] returns a pair of sets [(s1, s2)], where [s1] is the set of all the elements of [s] that satisfy the predicate [p], and [s2] is the set of all the elements of [s] that do not satisfy [p]. *) val cardinal: t -> int (** Return the number of elements of a set. *) val elements: t -> elt list (** Return the list of all elements of the given set. The returned list is sorted in increasing order with respect to the ordering [Ord.compare], where [Ord] is the argument given to {!Set.Make}. *) val choose: t -> elt (** Return one element of the given set, or raise [Not_found] if the set is empty. Which element is chosen is unspecified, but equal elements will be chosen for equal sets. *) val find: elt -> t -> elt (** [find x s] returns the element of [s] equal to [x] (according to [Ord.compare]), or raise [Not_found] if no such element exists. @since 4.01.0 *) val of_list: elt list -> t (** [of_list l] creates a set from a list of elements. This is usually more efficient than folding [add] over the list, except perhaps for lists with many duplicated elements. @since 4.02.0 *) end (** Standard operations on sets. This signature does not assume any particular property on the [compare] function used to compare elements, except that it implements a total order. These are the functions that make sense for an usage of [Set] where only the algorithmic complexity is interesting to the user. *) module type S = sig include S_Basic_Compare val min_elt: t -> elt (** Return the smallest element of the given set (with respect to the [Ord.compare] ordering), or raise [Not_found] if the set is empty. *) val max_elt: t -> elt (** Same as {min_elt}, but returns the largest element of the given set. *) val split: elt -> t -> t * bool * t (** [split x s] returns a triple [(l, present, r)], where [l] is the set of elements of [s] that are strictly less than [x]; [r] is the set of elements of [s] that are strictly greater than [x]; [present] is [false] if [s] contains no element equal to [x], or [true] if [s] contains an element equal to [x]. *) (* Frama-C- additions *) val nearest_elt_le: elt -> t -> elt (** [nearest_elt_le v s] returns the largest element of [s] that is smaller or equal to [v]. @raise Not_found if no such element exists. *) val nearest_elt_ge: elt -> t -> elt (** [nearest_elt_ge v s] returns the smallest element of [s] that is bigger or equal to [v]. @raise Not_found if no such element exists. *) end (** Output signature of the functor {!FCSet.Make}. This signature add functions that assume that the [compare] function between elements implements a specific order. In this case, the layout of the tree might be interesting to the user. *) module Make (Ord : Set.OrderedType) : S with type elt = Ord.t (** Functor building an implementation of the set structure given a totally ordered type. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/stdlib/extlib.ml0000666000000000000000000003634013571573400017066 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let nop _ = () external id: 'a -> 'a = "%identity" let adapt_filename f = let change_suffix ext = try Filename.chop_extension f ^ ext with Invalid_argument _ -> f ^ ext in change_suffix (if Dynlink.is_native then ".cmxs" else ".cmo") (* [max_cpt t1 t2] returns the maximum of [t1] and [t2] wrt the total ordering induced by tags creation. This ordering is defined as follows: forall tags t1 t2, t1 <= t2 iff t1 is before t2 in the finite sequence [0; 1; ..; max_int; min_int; min_int-1; -1] *) let max_cpt c1 c2 = max (c1 + min_int) (c2 + min_int) - min_int let number_to_color n = let color = ref 0 in let number = ref n in for _i = 0 to 7 do color := (!color lsl 1) + (if !number land 1 <> 0 then 1 else 0) + (if !number land 2 <> 0 then 256 else 0) + (if !number land 4 <> 0 then 65536 else 0); number := !number lsr 3 done; !color (* ************************************************************************* *) (** {2 Function builders} *) (* ************************************************************************* *) exception Unregistered_function of string let mk_labeled_fun s = raise (Unregistered_function (Printf.sprintf "Function '%s' not registered yet" s)) let mk_fun s = ref (fun _ -> mk_labeled_fun s) (* ************************************************************************* *) (** {2 Function combinators} *) (* ************************************************************************* *) let ($) f g x = f (g x) let swap f x y = f y x let uncurry f x = f (fst x) (snd x) let iter_uncurry2 iter f v = iter (fun a b -> f (a, b)) v (* ************************************************************************* *) (** {2 Lists} *) (* ************************************************************************* *) let as_singleton = function | [a] -> a | _ -> invalid_arg "Extlib.as_singleton" let rec last = function | [] -> invalid_arg "Extlib.last" | [a] -> a | _ :: l -> last l let filter_out f ls = List.filter (fun x -> not (f x)) ls let replace cmp x l = let rec aux = function | [] -> [x] | y::l -> if cmp x y then x::l else y :: aux l in aux l let filter_map filter f l = let rec aux = function [] -> [] | x::tl -> if filter x then f x :: aux tl else aux tl in aux l let filter_map' f filter l= let rec aux = function | [] -> [] | x::tl -> let x' = f x in if filter x' then x' :: aux tl else aux tl in aux l let rec filter_map_opt f = function | [] -> [] | x::tl -> match f x with | None -> filter_map_opt f tl | Some x' -> x' :: filter_map_opt f tl let rec fold_map f acc = function | [] -> acc, [] | x::tl -> let (acc,x) = f acc x in let (acc,tl) = fold_map f acc tl in (acc,x::tl) let rec fold_map_opt f acc = function | [] -> acc, [] | x::tl -> match f acc x with | acc, None -> fold_map_opt f acc tl | acc, Some x -> let (acc,tl) = fold_map_opt f acc tl in (acc,x::tl) let product_fold f acc e1 e2 = List.fold_left (fun acc e1 -> List.fold_left (fun acc e2 -> f acc e1 e2) acc e2) acc e1 let product f e1 e2 = product_fold (fun acc e1 e2 -> f e1 e2 ::acc) [] e1 e2 let find_index f l = let rec aux i = function [] -> raise Not_found | x::l -> if f x then i else aux (i+1) l in aux 0 l let rec list_compare cmp_elt l1 l2 = if l1 == l2 then 0 else match l1, l2 with | [], [] -> assert false (* included in l1 == l2 above *) | [], _ :: _ -> -1 | _ :: _, [] -> 1 | v1::r1, v2::r2 -> let c = cmp_elt v1 v2 in if c = 0 then list_compare cmp_elt r1 r2 else c let list_of_opt = function | None -> [] | Some x -> [x] let opt_of_list = function | [] -> None | [a] -> Some a | _ -> raise (Invalid_argument "Extlib.opt_of_list") let rec find_opt f = function | [] -> raise Not_found | e :: q -> match f e with | None -> find_opt f q | Some v -> v let iteri f l = let i = ref 0 in List.iter (fun x -> f !i x; incr i) l let mapi f l = let res = snd (List.fold_left (fun (i,acc) x -> (i+1,f i x :: acc)) (0,[]) l) in List.rev res let sort_unique cmp l = List.sort_uniq cmp l let subsets k l = let rec aux k l len = if k = 0 then [[]] else if len < k then [] else if len = k then [l] else match l with | h :: t -> let l1 = List.map (fun sl -> h :: sl) (aux (k-1) t (len-1)) in let l2 = aux k t (len-1) in l1 @ l2 | [] -> assert false in aux k l (List.length l) let list_first_n n l = let rec aux acc n = function | h :: t when n > 0 -> aux (h :: acc) (n-1) t | _ -> acc in List.rev (aux [] n l) let rec list_remove_first_n n = function | _h :: t when n > 0 -> list_remove_first_n (n-1) t | l -> l let list_slice ?(first = 0) ?last l = let len = lazy (List.length l) in let normalize i = (* normalize negative values *) if i >= 0 then i else let n = Lazy.force len in if i + n >= 0 then i + n else 0 in (* Remove first elements *) let first = normalize first in let l = list_remove_first_n first l in (* Remove last elements *) match last with | None -> l | Some n -> list_first_n (normalize n - first) l (* ************************************************************************* *) (** {2 Arrays} *) (* ************************************************************************* *) let array_exists f a = try for i = 0 to Array.length a - 1 do if f a.(i) then raise Exit done; false with Exit -> true let array_existsi f a = try for i = 0 to Array.length a - 1 do if f i a.(i) then raise Exit done; false with Exit -> true (* ************************************************************************* *) (** {2 Options} *) (* ************************************************************************* *) let has_some = function None -> false | Some _ -> true let may f = function | None -> () | Some x -> f x (** [may_map f ?dft x] applies [f] to the value of [x] if exists. Otherwise returns the default value [dft]. Assume that either [x] or [dft] is defined. *) let may_map f ?dft x = match x, dft with | None, None -> assert false | None, Some dft -> dft | Some x, _ -> f x let opt_map f = function | None -> None | Some x -> Some (f x) let opt_conv default = function | None -> default | Some x -> x let opt_if b v = if b then None else Some v let opt_fold f o b = match o with | None -> b | Some a -> f a b let merge_opt f k o1 o2 = match o1,o2 with | None, None -> None | Some x, None | None, Some x -> Some x | Some x1, Some x2 -> Some (f k x1 x2) let opt_bind f = function | None -> None | Some x -> f x let opt_filter f = function | None -> None | (Some x) as o -> if f x then o else None let the ?exn = function | None -> begin match exn with | None -> invalid_arg "Extlib.the" | Some exn -> raise exn end | Some x -> x let find_or_none f v = try Some(f v) with Not_found -> None let opt_equal f v1 v2 = match v1, v2 with | None, None -> true | Some _, None | None, Some _ -> false | Some v1, Some v2 -> f v1 v2 let opt_compare f v1 v2 = match v1, v2 with | None, None -> 0 | Some _, None -> 1 | None, Some _ -> -1 | Some v1, Some v2 -> f v1 v2 let opt_hash hash v = match v with | None -> 31179 | Some v -> hash v (* ************************************************************************* *) (** Booleans *) (* ************************************************************************* *) let xor x y = if x then not y else y (* ************************************************************************* *) (** {2 Performance} *) (* ************************************************************************* *) (* replace "noalloc" with [@@noalloc] for OCaml version >= 4.03.0 *) [@@@ warning "-3"] external address_of_value: 'a -> int = "address_of_value" "noalloc" [@@@ warning "+3"] (* ************************************************************************* *) (** {2 Exception catcher} *) (* ************************************************************************* *) let try_finally ~finally f x = let r = try f x with e -> finally () ; raise e in finally () ; r (* ************************************************************************* *) (** System commands *) (* ************************************************************************* *) (*[LC] due to Unix.exec calls, at_exit might be cloned into child process and executed when they are canceled early. The alternative, such as registering an daemon that raises an exception, hence interrupting the process, might not work: child processes still need to run some daemons, such as [flush_all] which is registered by default. *) let rec mkdir ?(parents=false) name perm = try Unix.mkdir name perm with | Unix.Unix_error (Unix.ENOENT,_,_) when parents -> let parent_name = Filename.dirname name in if name <> parent_name then begin mkdir ~parents parent_name perm; Unix.mkdir name perm end | e -> raise e let pid = Unix.getpid () let safe_at_exit f = at_exit begin fun () -> let child = Unix.getpid () in if child = pid then f () end let safe_remove f = try Unix.unlink f with Unix.Unix_error _ -> () let rec safe_remove_dir d = try Array.iter (fun a -> let f = Printf.sprintf "%s/%s" d a in if Sys.is_directory f then safe_remove_dir f else safe_remove f ) (Sys.readdir d) ; Unix.rmdir d with Unix.Unix_error _ | Sys_error _ -> () let cleanup_at_exit f = safe_at_exit (fun () -> safe_remove f) exception Temp_file_error of string let temp_file_cleanup_at_exit ?(debug=false) s1 s2 = let file, out = try Filename.open_temp_file s1 s2 with Sys_error s -> raise (Temp_file_error s) in (try close_out out with Unix.Unix_error _ -> ()); safe_at_exit begin fun () -> if debug then begin if Sys.file_exists file then Format.printf "[extlib] Debug: not removing file %s@." file; end else safe_remove file end ; file let temp_dir_cleanup_at_exit ?(debug=false) base = let rec try_dir_cleanup_at_exit limit base = let file = Filename.temp_file base ".tmp" in let dir = Filename.chop_extension file ^ ".dir" in safe_remove file; try Unix.mkdir dir 0o700 ; safe_at_exit begin fun () -> if debug then begin if Sys.file_exists dir then Format.printf "[extlib] Debug: not removing dir %s@." dir; end else safe_remove_dir dir end ; dir with Unix.Unix_error(err,_,_) -> if limit < 0 then raise (Temp_file_error (Unix.error_message err)) else try_dir_cleanup_at_exit (pred limit) base in try_dir_cleanup_at_exit 10 base (* replace "noalloc" with [@@noalloc] for OCaml version >= 4.03.0 *) [@@@ warning "-3"] external usleep: int -> unit = "ml_usleep" "noalloc" (* In ../utils/c_bindings.c ; man usleep for details. *) (* ************************************************************************* *) (** Strings *) (* ************************************************************************* *) external compare_strings: string -> string -> int -> bool = "compare_strings" "noalloc" [@@@ warning "+3"] let string_prefix ?(strict=false) prefix s = let add = if strict then 1 else 0 in String.length s >= String.length prefix + add && compare_strings prefix s (String.length prefix) let string_del_prefix ?(strict=false) prefix s = if string_prefix ~strict prefix s then Some (String.sub s (String.length prefix) (String.length s - String.length prefix)) else None let string_suffix ?(strict=false) suffix s = let len = String.length s in let suf_len = String.length suffix in let strict_len = if strict then suf_len + 1 else suf_len in len >= strict_len && compare_strings suffix (String.sub s (len - suf_len) suf_len) suf_len let string_del_suffix ?(strict=false) suffix s = if string_suffix ~strict suffix s then Some (String.sub s 0 (String.length s - String.length suffix)) else None let string_split s i = let s1 = String.sub s 0 i in let s2 = String.sub s (i+1) (String.length s - i -1) in (s1,s2) let make_unique_name mem ?(sep=" ") ?(start=2) from = let rec build base id = let fullname = base ^ sep ^ string_of_int id in if mem fullname then build base (succ id) else id,fullname in if mem from then build from start else (0,from) let strip_underscore s = let l = String.length s in let rec start i = if i >= l then l else if s.[i] = '_' then start (i + 1) else i in let st = start 0 in if st = l then "" else begin let rec finish i = (* We know that we will stop at >= st >= 0 *) if s.[i] = '_' then finish (i - 1) else i in let fin = finish (l - 1) in String.sub s st (fin - st + 1) end let html_escape s = let buf = Buffer.create (String.length s) in String.iter (function | '<' -> Buffer.add_string buf "<" | '>' -> Buffer.add_string buf ">" | '&' -> Buffer.add_string buf "&" | c -> Buffer.add_char buf c ) s ; Buffer.contents buf (* ************************************************************************* *) (** Comparison functions *) (* ************************************************************************* *) external compare_basic: 'a -> 'a -> int = "%compare" let compare_ignore_case s1 s2 = String.compare (String.lowercase_ascii s1) (String.lowercase_ascii s2) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/stdlib/extlib.mli0000666000000000000000000004027113571573400017235 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Useful operations. This module does not depend of any of frama-c module. *) val nop: 'a -> unit (** Do nothing. *) external id: 'a -> 'a = "%identity" (** identity function. @since Oxygen-20120901 *) val adapt_filename: string -> string (** Ensure that the given filename has the extension "cmo" in bytecode and "cmxs" in native *) val max_cpt: int -> int -> int (** [max_cpt t1 t2] returns the maximum of [t1] and [t2] wrt the total ordering induced by tags creation. This ordering is defined as follows: forall tags t1 t2, t1 <= t2 iff t1 is before t2 in the finite sequence [0; 1; ..; max_int; min_int; min_int-1; -1] *) val number_to_color: int -> int (* ************************************************************************* *) (** {2 Function builders} *) (* ************************************************************************* *) exception Unregistered_function of string (** Never catch it yourself: let the kernel do the job. @since Oxygen-20120901 *) val mk_labeled_fun: string -> 'a (** To be used to initialized a reference over a labeled function. @since Oxygen-20120901 @raise Unregistered_function when not properly initialized *) val mk_fun: string -> ('a -> 'b) ref (** Build a reference to an uninitialized function @raise Unregistered_function when not properly initialized *) (* ************************************************************************* *) (** {2 Function combinators} *) (* ************************************************************************* *) val ($) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c (** Composition. *) val swap: ('a -> 'b -> 'c) -> 'b -> 'a -> 'c (** Swap arguments. *) val uncurry: ('a -> 'b -> 'c) -> ('a * 'b) -> 'c val iter_uncurry2: (('a -> 'b -> unit) -> 'c -> unit) -> (('a * 'b -> unit) -> 'c -> unit) (* ************************************************************************* *) (** {2 Lists} *) (* ************************************************************************* *) val as_singleton: 'a list -> 'a (** returns the unique element of a singleton list. @raise Invalid_argument on a non singleton list. *) val last: 'a list -> 'a (** returns the last element of a list. @raise Invalid_argument on an empty list @since Nitrogen-20111001 *) val filter_out: ('a -> bool) -> 'a list -> 'a list (** Filter out elements that pass the test *) val replace: ('a -> 'a -> bool) -> 'a -> 'a list -> 'a list (** [replace cmp x l] replaces the first element [y] of [l] such that [cmp x y] is true by [x]. If no such element exists, [x] is added at the tail of [l]. @since Neon-20140301 *) val filter_map: ('a -> bool) -> ('a -> 'b) -> 'a list -> 'b list val filter_map': ('a -> 'b) -> ('b -> bool) -> 'a list -> 'b list val filter_map_opt: ('a -> 'b option) -> 'a list -> 'b list (** Combines [filter] and [map]. *) val fold_map: ('a -> 'b -> 'a * 'c) -> 'a -> 'b list -> 'a * 'c list (** Combines [fold_left] and [map] *) val fold_map_opt: ('a -> 'b -> 'a * 'c option) -> 'a -> 'b list -> 'a * 'c list (** Combines [filter] [fold_left] and [map] *) val product_fold: ('a -> 'b -> 'c -> 'a) -> 'a -> 'b list -> 'c list -> 'a (** [product f acc l1 l2] is similar to [fold_left f acc l12] with l12 the list of all pairs of an elt of [l1] and an elt of [l2] *) val product: ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list (** [product f l1 l2] applies [f] to all the pairs of an elt of [l1] and an element of [l2]. *) val find_index: ('a -> bool) -> 'a list -> int (** returns the index (starting at 0) of the first element verifying the condition @raise Not_found if no element in the list matches the condition *) val list_compare : ('a -> 'a -> int) -> 'a list -> 'a list -> int (** Generic list comparison function, where the elements are compared with the specified function @since Boron-20100401 *) val list_of_opt: 'a option -> 'a list (** converts an option into a list with 0 or 1 elt. @since Carbon-20111201-beta2 *) val opt_of_list: 'a list -> 'a option (** converts a list with 0 or 1 element into an option. @raise Invalid_argument on lists with more than one argument @since Oxygen-20120901 *) val find_opt : ('a -> 'b option) -> 'a list -> 'b [@@deprecated "Use List.find_opt instead."] (** [find_option p l] returns the value [p e], [e] being the first element of [l] such that [p e] is not [None]. Raise [Not_found] if there is no such value the list l. @since Nitrogen-20111001 @deprecated 18.0-Argon use [List.find_opt] instead *) val iteri: (int -> 'a -> unit) -> 'a list -> unit (** Same as iter, but the function to be applied take also as argument the index of the element (starting from 0). Tail-recursive @since Nitrogen-20111001 *) val mapi: (int -> 'a -> 'b) -> 'a list -> 'b list (** Same as map, but the function to be applied take also as argument the index of the element (starting from 0). Tail-recursive @since Oxygen-20120901 *) val sort_unique: ('a -> 'a -> int) -> 'a list -> 'a list (** Same as List.sort , but also remove duplicates. @deprecated use List.sort_uniq instead *) val subsets: int -> 'a list -> 'a list list (** [subsets k l] computes the combinations of [k] elements from list [l]. E.g. subsets 2 [1;2;3;4] = [[1;2];[1;3];[1;4];[2;3];[2;4];[3;4]]. This function preserves the order of the elements in [l] when computing the sublists. [l] should not contain duplicates. @since Aluminium-20160501 *) val list_first_n : int -> 'a list -> 'a list (** [list_first_n n l] returns the first [n] elements of the list. Tail recursive. It returns an empty list if [n] is nonpositive and the whole list if [n] is greater than [List.length l]. It is equivalent to [list_slice ~last:n l]. *) val list_slice: ?first:int -> ?last:int -> 'a list -> 'a list (** [list_slice ?first ?last l] is equivalent to Python's slice operator (l[first:last]): returns the range of the list between [first] (inclusive) and [last] (exclusive), starting from 0. If omitted, [first] defaults to 0 and [last] to [List.length l]. Negative indices are allowed, and count from the end of the list. [list_slice] never raises exceptions: out-of-bounds arguments are clipped, and inverted ranges result in empty lists. @since 18.0-Argon *) (* ************************************************************************* *) (** {2 Arrays} *) (* ************************************************************************* *) val array_exists: ('a -> bool) -> 'a array -> bool val array_existsi: (int -> 'a -> bool) -> 'a array -> bool (* ************************************************************************* *) (** {2 Options} *) (* ************************************************************************* *) (** [true] iff its argument is [Some x] @since Nitrogen-20111001 *) val has_some: 'a option -> bool val may: ('a -> unit) -> 'a option -> unit (** [may f v] applies [f] to [x] if [v = Some(x)] *) val opt_conv: 'a -> 'a option -> 'a (** [opt_conv default v] returns [default] if [v] is [None] and [a] if [v] is [Some a] *) val opt_if: bool -> 'a -> 'a option (** [opt_if cond v] returns [Some v] if [cond] is [true] and [None] otherwise *) val may_map: ('a -> 'b) -> ?dft:'b -> 'a option -> 'b (** [may_map f ?dft x] applies [f] to the value of [x] if exists. Otherwise returns the default value [dft]. Assume that either [x] or [dft] is defined. *) val opt_map: ('a -> 'b) -> 'a option -> 'b option val opt_fold: ('a -> 'b -> 'b) -> 'a option -> 'b -> 'b (** @since Oxygen-20120901 *) (** [merge f k a b] returns - [None] if both [a] and [b] are [None] - [Some a'] (resp. [b'] if [b] (resp [a]) is [None] and [a] (resp. [b]) is [Some] - [f k a' b'] if both [a] and [b] are [Some] It is mainly intended to be used with Map.merge @since Oxygen-20120901 *) val merge_opt: ('a -> 'b -> 'b -> 'b) -> 'a -> 'b option -> 'b option -> 'b option (** [opt_bind f x] returns [None] if [x] is [None] and [f y] if is [Some y] (monadic bind) @since Nitrogen-20111001 *) val opt_bind: ('a -> 'b option) -> 'a option -> 'b option val opt_filter: ('a -> bool) -> 'a option -> 'a option val the: ?exn:exn -> 'a option -> 'a (** @raise Exn if the value is [None] and [exn] is specified. @raise Invalid_argument if the value is [None] and [exn] is not specified. @return v if the value is [Some v]. @modify Magnesium-20151001 add optional argument [exn] @plugin development guide *) val find_or_none: ('a -> 'b) -> 'a -> 'b option val opt_equal : ('a -> 'a -> bool) -> 'a option -> 'a option -> bool val opt_compare : ('a -> 'a -> int) -> 'a option -> 'a option -> int (** @since Boron-20100401 *) val opt_hash: ('a -> int) -> 'a option -> int (** @since Sodium-20150201 *) (* ************************************************************************* *) (** {2 Booleans} *) (* ************************************************************************* *) val xor: bool -> bool -> bool (** exclusive-or. @since Oxygen-20120901 *) (* ************************************************************************* *) (** {2 Strings} *) (* ************************************************************************* *) val string_prefix: ?strict:bool -> string -> string -> bool (** [string_prefix ~strict p s] returns [true] if and only if [p] is a prefix of the string [s]. If [strict] is true, the prefix must be strict (that is, [s] must moreover be strictly longer than [p]. [strict] is false by default. @since Boron-20100401 *) val string_del_prefix: ?strict:bool -> string -> string -> string option (** [string_del_prefix ~strict p s] returns [None] if [p] is not a prefix of [s] and Some [s1] iff [s=p^s1]. @since Oxygen-20120901 *) val string_suffix: ?strict:bool -> string -> string -> bool (** [string_suffix ~strict suf s] returns [true] iff [suf] is a suffix of string [s]. [strict], which defaults to [false], indicates whether [s] should be strictly longer than [p]. @since Aluminium-20160501 *) val string_del_suffix: ?strict:bool -> string -> string -> string option (** [string_del_suffix ~strict suf s] returns [Some s1] when [s = s1 ^ suf] and None of [suf] is not a suffix of [s]. @since Aluminium-20160501 *) val string_split: string -> int -> string * string (** [string_split s i] returns the beginning of [s] up to char [i-1] and the end of [s] starting from char [i+1] @raise Invalid_argument if [i] is not in the range [[0,(length s -1)]] @since Oxygen-20120901 *) val make_unique_name: (string -> bool) -> ?sep:string -> ?start:int -> string -> int*string (** [make_unique_name mem s] returns [(0, s)] when [(mem s)=false] otherwise returns [(n,new_string)] such that [new_string] is derived from [(s,sep,start)] and [(mem new_string)=false] and [n<>0] @since Oxygen-20120901 *) val strip_underscore: string -> string (** remove underscores at the beginning and end of a string. If a string is composed solely of underscores, return the empty string @since 18.0-Argon *) val html_escape: string -> string (* ************************************************************************* *) (** {2 Performance} *) (* ************************************************************************* *) (* replace "noalloc" with [@@noalloc] for OCaml version >= 4.03.0 *) [@@@ warning "-3"] external address_of_value: 'a -> int = "address_of_value" "noalloc" [@@@ warning "+3"] (* ************************************************************************* *) (** {2 Exception catcher} *) (* ************************************************************************* *) val try_finally: finally:(unit -> unit) -> ('a -> 'b) -> 'a -> 'b (* ************************************************************************* *) (** System commands *) (* ************************************************************************* *) val mkdir : ?parents:bool -> string -> Unix.file_perm -> unit (** [mkdir ?parents name perm] creates directory [name] with permission [perm]. If [parents] is true, recursively create parent directories if needed. [parents] defaults to false. Note that this function may create some of the parent directories and then fail to create the children, e.g. if [perm] does not allow user execution of the created directory. This will leave the filesystem in a modified state before raising an exception. @raise Unix.Unix_error if cannot create [name] or its parents. @since 19.0-Potassium *) val safe_at_exit : (unit -> unit) -> unit (** Register function to call with [Pervasives.at_exit], but only for non-child process (fork). The order of execution is preserved {i wrt} ordinary calls to [Pervasives.at_exit]. *) val cleanup_at_exit: string -> unit (** [cleanup_at_exit file] indicates that [file] must be removed when the program exits (except if exit is caused by a signal). If [file] does not exist, nothing happens. *) exception Temp_file_error of string val temp_file_cleanup_at_exit: ?debug:bool -> string -> string -> string (** Similar to [Filename.temp_file] except that the temporary file will be deleted at the end of the execution (see above), unless [debug] is set to true, in which case a message with the name of the kept file will be printed. @raise Temp_file_error if the temp file cannot be created. @modify Nitrogen-20111001 may now raise Temp_file_error @modify Oxygen-20120901 optional debug argument *) val temp_dir_cleanup_at_exit: ?debug:bool -> string -> string (** @raise Temp_file_error if the temp dir cannot be created. @modify Nitrogen-20111001 may now raise Temp_file_error @modify Neon-20130301 add optional debug flag *) val safe_remove: string -> unit (** Tries to delete a file and never fails. *) val safe_remove_dir: string -> unit val usleep: int -> unit (** Unix function that sleep for [n] microseconds. See [man usleep] for details. Should not be used under Win32. *) (* ************************************************************************* *) (** Comparison functions *) (* ************************************************************************* *) (** Use this function instead of [Pervasives.compare], as this makes it easier to find incorrect uses of the latter *) external compare_basic: 'a -> 'a -> int = "%compare" (** Case-insensitive string comparison. Only ISO-8859-1 accents are handled. @since Silicon-20161101 *) val compare_ignore_case: string -> string -> int (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/stdlib/integer.ml0000666000000000000000000001611113571573400017226 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type t = Z.t let equal = Z.equal let compare = Z.compare let two_power_of_int k = Z.shift_left Z.one k let two_power n = let k = Z.to_int n in if k > 1024 then raise Z.Overflow else two_power_of_int k let power_int_positive_int = Big_int_Z.power_int_positive_int let popcount = Z.popcount let zero = Z.zero let one = Z.one let minus_one = Z.minus_one let two = Z.of_int 2 let four = Z.of_int 4 let eight = Z.of_int 8 let sixteen = Z.of_int 16 let thirtytwo = Z.of_int 32 let onethousand = Z.of_int 1000 let billion_one = Z.of_int 1_000_000_001 let two_power_32 = two_power_of_int 32 let two_power_60 = two_power_of_int 60 let two_power_64 = two_power_of_int 64 let is_zero v = Z.equal v Z.zero let add = Z.add let sub = Z.sub let succ = Z.succ let pred = Z.pred let neg = Z.neg let mul = Z.mul let e_div = Z.ediv let e_rem = Z.erem let e_div_rem = Z.ediv_rem let c_div = Z.div let c_rem = Z.rem let c_div_rem = Z.div_rem let abs = Z.abs let hash = Z.hash let shift_left x y = Z.shift_left x (Z.to_int y) let shift_right x y = Z.shift_right x (Z.to_int y) let shift_right_logical x y = (* no meaning for negative value of x *) if (Z.lt x Z.zero) then raise (Invalid_argument "Integer.shift_right_logical") else Z.shift_right x (Z.to_int y) let logand = Z.logand let lognot = Z.lognot let logor = Z.logor let logxor = Z.logxor let le a b = Z.compare a b <= 0 let ge a b = Z.compare a b >= 0 let lt a b = Z.compare a b < 0 let gt a b = Z.compare a b > 0 let of_int = Z.of_int let of_int64 = Z.of_int64 let of_int32 = Z.of_int32 let to_int = Z.to_int let to_int64 = Z.to_int64 let to_int32 = Z.to_int32 let of_string = Z.of_string let to_string = Z.to_string let of_float = Z.of_float let to_float = Z.to_float let max_int64 = of_int64 Int64.max_int let min_int64 = of_int64 Int64.min_int let bdigits = [| "0000" ; (* 0 *) "0001" ; (* 1 *) "0010" ; (* 2 *) "0011" ; (* 3 *) "0100" ; (* 4 *) "0101" ; (* 5 *) "0110" ; (* 6 *) "0111" ; (* 7 *) "1000" ; (* 8 *) "1001" ; (* 9 *) "1010" ; (* 10 *) "1011" ; (* 11 *) "1100" ; (* 12 *) "1101" ; (* 13 *) "1110" ; (* 14 *) "1111" ; (* 15 *) |] let pp_bin_pos fmt r = Format.pp_print_string fmt bdigits.(r) let pp_bin_neg fmt r = Format.pp_print_string fmt bdigits.(15-r) let pp_hex_pos fmt r = Format.fprintf fmt "%04X" r let pp_hex_neg fmt r = Format.fprintf fmt "%04X" (0xFFFF-r) let bmask_bin = Z.of_int 0xF (* 4 bits mask *) let bmask_hex = Z.of_int 0xFFFF (* 64 bits mask *) type digits = { nbits : int ; (* max number of bits *) bsize : int ; (* bits in each bloc *) bmask : Z.t ; (* block mask, must be (1 << bsize) - 1 *) sep : string ; pp : Format.formatter -> int -> unit ; (* print one block *) } let rec pp_digits d fmt n v = if gt v zero || n < d.nbits then begin let r = Z.to_int (Z.logand v d.bmask) in let k = d.bsize in pp_digits d fmt (n + k) (Z.shift_right_trunc v k) ; if gt v d.bmask || (n + k) < d.nbits then Format.pp_print_string fmt d.sep ; d.pp fmt r ; end let pp_bin ?(nbits=1) ?(sep="") fmt v = let nbits = if nbits <= 0 then 1 else nbits in if le zero v then ( Format.pp_print_string fmt "0b" ; pp_digits { nbits ; sep ; bsize=4 ; bmask = bmask_bin ; pp = pp_bin_pos } fmt 0 v ) else ( Format.pp_print_string fmt "1b" ; pp_digits { nbits ; sep ; bsize=4 ; bmask = bmask_bin ; pp = pp_bin_neg } fmt 0 (Z.lognot v) ) let pp_hex ?(nbits=1) ?(sep="") fmt v = let nbits = if nbits <= 0 then 1 else nbits in if le zero v then ( Format.pp_print_string fmt "0x" ; pp_digits { nbits ; sep ; bsize=16 ; bmask = bmask_hex ; pp = pp_hex_pos } fmt 0 v ) else ( Format.pp_print_string fmt "1x" ; pp_digits { nbits ; sep ; bsize=16 ; bmask = bmask_hex ; pp = pp_hex_neg } fmt 0 (Z.lognot v) ) let pretty ?(hexa=false) fmt v = let rec aux v = if gt v two_power_60 then let quo, rem = Z.ediv_rem v two_power_60 in aux quo; Format.fprintf fmt "%015LX" (to_int64 rem) else Format.fprintf fmt "%LX" (to_int64 v) in if hexa then if equal v zero then Format.pp_print_string fmt "0" else if gt v zero then (Format.pp_print_string fmt "0x"; aux v) else (Format.pp_print_string fmt "-0x"; aux (Z.neg v)) else Format.pp_print_string fmt (to_string v) let is_one v = equal one v let cast ~size ~signed ~value = if (not signed) then let factor = two_power size in logand value (pred factor) else let mask = two_power (sub size one) in let p_mask = pred mask in if equal (logand mask value) zero then logand value p_mask else logor (lognot p_mask) value let length u v = succ (sub v u) let extract_bits ~start ~stop v = assert (ge start zero && ge stop start); (*Format.printf "%a[%a..%a]@\n" pretty v pretty start pretty stop;*) let r = Z.extract v (to_int start) (to_int (length start stop)) in (*Format.printf "%a[%a..%a]=%a@\n" pretty v pretty start pretty stop pretty r;*) r let is_even v = is_zero (logand one v) let pgcd u v = if is_zero v then abs u (* Zarith raises an exception on zero arguments *) else if is_zero u then abs v else Z.gcd u v let ppcm u v = if u = zero || v = zero then zero else Z.lcm u v let min = Z.min let max = Z.max let round_down_to_zero v modu = mul (e_div v modu) modu let round_up_to_r ~min:m ~r ~modu = add (add (round_down_to_zero (pred (sub m r)) modu) r) modu let round_down_to_r ~max:m ~r ~modu = add (round_down_to_zero (sub m r) modu) r frama-c-20.0-Calcium/src/libraries/stdlib/integer.mli0000666000000000000000000001341313571573400017401 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Extension of [Big_int] compatible with [Zarith]. @since Nitrogen-20111001 *) type t = Z.t val equal : t -> t -> bool val compare : t -> t -> int val le : t -> t -> bool val ge : t -> t -> bool val lt : t -> t -> bool val gt : t -> t -> bool val add : t -> t -> t val sub : t -> t -> t val mul : t -> t -> t val shift_left : t -> t -> t (** @raise Invalid_argument if second argument (count) is negative *) val shift_right : t -> t -> t (** @raise Invalid_argument if second argument (count) is negative *) val shift_right_logical : t -> t -> t (** @raise Invalid_argument if any argument is negative *) val logand : t -> t -> t val logor : t -> t -> t val logxor : t -> t -> t val lognot : t -> t val min : t -> t -> t val max : t -> t -> t val e_div : t -> t -> t (** Euclidean division (that returns a positive rem). Implemented by [Z.ediv] Equivalent to C division if both operands are positive. Equivalent to a floored division if b > 0 (rounds downwards), otherwise rounds upwards. Note: it is possible that e_div (-a) b <> e_div a (-b). *) val e_rem : t -> t -> t (** Remainder of the Euclidean division (always positive). Implemented by [Z.erem] *) val e_div_rem: t -> t -> (t * t) (** [e_div_rem a b] returns [(e_div a b, e_rem a b)]. Implemented by [Z.ediv_rem] *) val c_div : t -> t -> t (** Truncated division towards 0 (like in C99). Implemented by [Z.div] *) val c_rem : t -> t -> t (** Remainder of the truncated division towards 0 (like in C99). Implemented by [Z.rem] *) val c_div_rem : t -> t -> t * t (** [c_div_rem a b] returns [(c_div a b, c_rem a b)]. Implemented by [Z.div_rem] *) val pgcd : t -> t -> t (** [pgcd v 0 == pgcd 0 v == abs v]. Result is always positive *) val ppcm : t -> t -> t (** [ppcm v 0 == ppcm 0 v == 0]. Result is always positive *) val cast: size:t -> signed:bool -> value:t -> t val abs : t -> t val neg : t -> t val succ : t -> t val pred : t -> t val is_zero : t -> bool val is_one : t -> bool val is_even : t -> bool val zero : t val one : t val two : t val four : t val eight : t val sixteen : t val thirtytwo : t val onethousand : t val billion_one : t val minus_one : t val max_int64 : t val min_int64 : t val two_power_32 : t val two_power_64 : t val length : t -> t -> t (** b - a + 1 *) val of_int : int -> t val of_int64 : Int64.t -> t val of_int32 : Int32.t -> t val to_int : t -> int (** @raise Z.Overflow if too big *) val to_int64 : t -> int64 (** @raise Z.Overflow if too big *) val to_int32 : t -> int32 (** @raise Z.Overflow if too big *) val to_float : t -> float val of_float : float -> t val round_up_to_r : min:t -> r:t -> modu:t -> t (** [round_up_to_r m r modu] is the smallest number [n] such that [n]>=[m] and [n] = [r] modulo [modu] *) val round_down_to_r : max:t -> r:t -> modu:t -> t (** [round_down_to_r m r modu] is the largest number [n] such that [n]<=[m] and [n] = [r] modulo [modu] *) val two_power : t -> t (** Computes [2^n] @raise Z.Overflow for exponents greater than 1024 *) val two_power_of_int : int -> t (** Computes [2^n] *) val power_int_positive_int: int -> int -> t (** Exponentiation *) val extract_bits : start:t -> stop:t -> t -> t val popcount: t -> int val hash : t -> int val to_string : t -> string val of_string : string -> t (** @raise Invalid_argument when the string cannot be parsed. *) val pretty : ?hexa:bool -> t Pretty_utils.formatter val pp_bin : ?nbits:int -> ?sep:string -> t Pretty_utils.formatter (** Print binary format. Digits are output by blocs of 4 bits separated by [~sep] with at least [~nbits] total bits. If [nbits] is non positive, it will be ignored. Positive values are prefixed with ["0b"] and negative values are printed as their 2-complement ([lnot]) with prefix ["1b"]. *) val pp_hex : ?nbits:int -> ?sep:string -> t Pretty_utils.formatter (** Print hexadecimal format. Digits are output by blocs of 16 bits (4 hex digits) separated by [~sep] with at least [~nbits] total bits. If [nbits] is non positive, it will be ignored. Positive values are preffixed with ["0x"] and negative values are printed as their 2-complement ([lnot]) with prefix ["1x"]. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/stdlib/transitioning.ml.in0000666000000000000000000001161013571573400021065 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Stdlib = struct (* Pervasives/Stdlib functions *) let compare = compare let succ = succ let incr = incr let min = min let max = max let min_int = min_int let max_int = max_int end [@@@ warning "-3"] module Dynlink = struct let init = @DYNLINK_INIT@ end module Float = struct let max_float = @FLOAT_MAX_FLOAT@ end module Format = struct type stag = Format.@FORMAT_STAG@ let string_of_stag s = @FORMAT_STRING_OF_STAG@ let stag_of_string s = @FORMAT_STAG_OF_STRING@ type formatter_stag_functions = { mark_open_stag : stag -> string; mark_close_stag : stag -> string; print_open_stag : stag -> unit; print_close_stag : stag -> unit; } let pp_set_formatter_stag_functions fmt set_formatter_stag_functions = Format.pp_set_formatter_@FORMAT_STAG@_functions fmt { Format.mark_open_@FORMAT_STAG@ = set_formatter_stag_functions.mark_open_stag; Format.mark_close_@FORMAT_STAG@ = set_formatter_stag_functions.mark_close_stag; Format.print_open_@FORMAT_STAG@ = set_formatter_stag_functions.print_open_stag; Format.print_close_@FORMAT_STAG@ = set_formatter_stag_functions.print_close_stag; } let pp_get_formatter_stag_functions fmt () = let st = Format.pp_get_formatter_@FORMAT_STAG@_functions fmt () in { mark_open_stag = st.Format.mark_open_@FORMAT_STAG@; mark_close_stag = st.Format.mark_close_@FORMAT_STAG@; print_open_stag = st.Format.print_open_@FORMAT_STAG@; print_close_stag = st.Format.print_close_@FORMAT_STAG@; } let pp_open_stag fmt s = Format.pp_open_@FORMAT_STAG@ fmt s let pp_close_stag fmt () = Format.pp_close_@FORMAT_STAG@ fmt () end module Q = struct let round_to_float x exact = let m = Z.to_int64 x in (* Unless the fractional part is exactly 0, round m to an odd integer *) let m = if exact then m else Int64.logor m 1L in (* Then convert m to float, with the current rounding mode. *) Int64.to_float m let to_float x = match Q.classify x with | Q.ZERO -> 0.0 | Q.INF -> infinity | Q.MINF -> neg_infinity | Q.UNDEF -> nan | Q.NZERO -> let p = x.Q.num and q = x.Q.den in let np = Z.numbits p and nq = Z.numbits q in if np <= 53 && nq <= 53 then (* p and q convert to floats exactly; use FP division to get the correctly-rounded result. *) Int64.to_float (Z.to_int64 p) /. Int64.to_float (Z.to_int64 q) else begin (* |p| is in [2^(np-1), 2^np) q is in [2^(nq-1), 2^nq) hence |p/q| is in (2^(np-nq-1), 2^(np-nq+1)). We define n such that |p/q*2^n| is in [2^54, 2^56). >= 2^54 so that the round to odd technique applies. < 2^56 so that the integral part is representable as an int64. *) let n = 55 - (np - nq) in (* Scaling p/q by 2^n *) let (p', q') = if n >= 0 then (Z.shift_left p n, q) else (p, Z.shift_left q (-n)) in (* Euclidean division of p' by q' *) let (quo, rem) = Z.ediv_rem p' q' in (* quo is the integral part of p/q*2^n rem/q' is the fractional part. *) (* Round quo to float *) let f = round_to_float quo (Z.sign rem = 0) in (* Apply exponent *) ldexp f (-n) end end frama-c-20.0-Calcium/src/libraries/stdlib/transitioning.mli0000666000000000000000000000630213571573400020633 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This file contains functions that uses features that are deprecated in current OCaml version, but whose replacing feature is not available in the oldest OCaml version officially supported by Frama-C. Be sure to update it when support for a given version is dropped. Functions are grouped according to the module of the stdlib they emulate. The mentioned OCaml version indicate when the function was introduced in the stdlib (i.e. when Frama-C requires a version higher than that, it can safely be removed from Transitioning). *) (** {1 OCaml} *) (** 4.08 *) module Stdlib: sig val compare: 'a -> 'a -> int val succ: int -> int val incr: int ref -> unit val min: 'a -> 'a -> 'a val max: 'a -> 'a -> 'a val min_int: int val max_int: int end (** 4.08 *) module Dynlink: sig val init: unit -> unit end (** 4.07 *) module Float: sig val max_float: float end (** 4.08 *) module Format: sig type stag val string_of_stag: stag -> string val stag_of_string: string -> stag type formatter_stag_functions = { mark_open_stag : stag -> string; mark_close_stag : stag -> string; print_open_stag : stag -> unit; print_close_stag : stag -> unit; } val pp_set_formatter_stag_functions: Format.formatter -> formatter_stag_functions -> unit val pp_get_formatter_stag_functions: Format.formatter -> unit -> formatter_stag_functions val pp_open_stag : Format.formatter -> stag -> unit val pp_close_stag : Format.formatter -> unit -> unit end (** {1 Zarith} *) (** Function [Q.to_float] was introduced in Zarith 1.5 *) module Q: sig val to_float : Q.t -> float end frama-c-20.0-Calcium/src/libraries/utils/0000777000000000000000000000000013571573400015116 5ustar frama-c-20.0-Calcium/src/libraries/utils/bag.ml0000666000000000000000000001321413571573400016202 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ------------------------------------------------------------------------ *) (* --- List with constant-time concat --- *) (* ------------------------------------------------------------------------ *) type 'a t = | Empty | Elt of 'a | Add of 'a * 'a t | App of 'a t * 'a | List of 'a list | Concat of 'a t * 'a t let empty = Empty let elt x = Elt x let length t = let rec scan n = function | Empty -> n | Elt _ -> succ n | Add(_,t) | App(t,_) -> scan (succ n) t | List xs -> n + List.length xs | Concat(a,b) -> scan (scan n a) b in scan 0 t let add x = function | Empty -> Elt x | t -> Add(x,t) let append t x = match t with | Empty -> Elt x | t -> App(t,x) let list = function | [] -> Empty | [x] -> Elt x | xs -> List xs let concat a b = match a,b with | Empty,c | c,Empty -> c | Elt x,t -> Add(x,t) | t,Elt x -> App(t,x) | Concat(a,b),c -> Concat(a,Concat(b,c)) (* 1-time optim *) | _ -> Concat(a,b) let rec ulist = function | [] -> Empty | x::xs -> concat x (ulist xs) let rec map f = function | Empty -> Empty | Elt x -> Elt (f x) | Add(x,t) -> Add(f x,map f t) | App(t,x) -> App(map f t,f x) | List xs -> List(List.map f xs) | Concat(a,b) -> Concat(map f a,map f b) let rec umap f = function | Empty -> Empty | Elt x -> f x | Add(x,t) -> concat (f x) (umap f t) | App(t,x) -> concat (umap f t) (f x) | List xs -> umap_list f xs | Concat(a,b) -> concat (umap f a) (umap f b) and umap_list f = function | [] -> Empty | x::xs -> concat (f x) (umap_list f xs) let rec iter f = function | Empty -> () | Elt x -> f x | Add(x,t) -> f x ; iter f t | App(t,x) -> iter f t ; f x | List xs -> List.iter f xs | Concat(a,b) -> iter f a ; iter f b let rec fold_left f w = function | Empty -> w | Elt x -> f w x | Add(x,t) -> fold_left f (f w x) t | App(t,x) -> f (fold_left f w t) x | List xs -> List.fold_left f w xs | Concat(a,b) -> fold_left f (fold_left f w a) b let rec fold_right f t w = match t with | Empty -> w | Elt x -> f x w | Add(x,t) -> f x (fold_right f t w) | App(t,x) -> fold_right f t (f x w) | List xs -> List.fold_right f xs w | Concat(a,b) -> fold_right f a (fold_right f b w) let rec filter f = function | Empty -> Empty | Elt x as e -> if f x then e else Empty | Add(x,ts) -> if f x then add x (filter f ts) else filter f ts | App(ts,x) -> let ts = filter f ts in if f x then append ts x else ts | List xs -> list (List.filter f xs) | Concat(a,b) -> concat (filter f a) (filter f b) let rec partition f = function | Empty -> Empty , Empty | Elt x as e -> if f x then e,Empty else Empty,e | Add(x,ts) -> let pos,neg = partition f ts in if f x then add x pos , neg else pos , add x neg | App(ts,x) -> let ok = f x in let pos,neg = partition f ts in if ok then append pos x , neg else pos , append neg x | List xs -> let pos,neg = List.partition f xs in list pos , list neg | Concat(a,b) -> let apos,aneg = partition f a in let bpos,bneg = partition f b in concat apos bpos , concat aneg bneg let rec is_empty = function | Empty | List [] -> true | Add _ | App _ | Elt _ | List _ -> false | Concat(a,b) -> is_empty a && is_empty b let rec singleton = function | Elt x | List [x] -> Some x | Empty | List _ -> None | Add(x,t) | App(t,x) -> if is_empty t then Some x else None | Concat(a,b) -> match singleton a with | Some x -> if is_empty b then Some x else None | None -> if is_empty a then singleton b else None let rec collect t xs = match t with | Elt x -> x :: xs | Empty -> xs | Add(x,t) -> x :: collect t xs | App(t,x) -> collect t (x::xs) | List ys -> ys @ xs | Concat(a,b) -> collect a (collect b xs) let elements t = collect t [] let rec sort cmp = function | Empty -> [] | Elt x -> [x] | Add(x,t) -> List.merge cmp [x] (sort cmp t) | App(t,x) -> List.merge cmp (sort cmp t) [x] | List ys -> List.stable_sort cmp ys | Concat(a,b) -> List.merge cmp (sort cmp a) (sort cmp b) frama-c-20.0-Calcium/src/libraries/utils/bag.mli0000666000000000000000000000530013571573400016350 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** List with constant-time concat operation. @since Carbon-20101201 *) type 'a t val empty : 'a t val elt : 'a -> 'a t val add : 'a -> 'a t -> 'a t val append : 'a t -> 'a -> 'a t val list : 'a list -> 'a t val ulist : 'a t list -> 'a t val concat : 'a t -> 'a t -> 'a t val map : ('a -> 'b) -> 'a t -> 'b t val umap : ('a -> 'b t) -> 'a t -> 'b t val iter : ('a -> unit) -> 'a t -> unit val fold_left : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b val fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b val filter : ('a -> bool) -> 'a t -> 'a t val partition : ('a -> bool) -> 'a t -> 'a t * 'a t val length : 'a t -> int val is_empty : 'a t -> bool val singleton : 'a t -> 'a option val elements : 'a t -> 'a list (** Might have [n^2] complexity in worst cases. It might be better to use a Vector to reach linear complexity. *) val sort : ('a -> 'a -> int) -> 'a t -> 'a list (** The returned list preserves duplicates and order of equals elements. Uses Merge Sort (from standard List module), but might have [n^2] complexity in worst cases. It might be better to use a Vector to reach linear complexity. *) frama-c-20.0-Calcium/src/libraries/utils/binary_cache.ml0000666000000000000000000003211713571573400020063 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let memory_footprint_var_name = "FRAMA_C_MEMORY_FOOTPRINT" let memory_footprint = let error () = Cmdline.Kernel_log.error "@[Bad value for environment variable@ %s.@ Expected value: \ integer between@ 1 and 10.@ Using@ default value@ of 2.@]" memory_footprint_var_name; 2 in try let i = int_of_string (Sys.getenv memory_footprint_var_name) in if i <= 0 || i > 10 then error () else i with | Not_found -> 2 | Failure _ -> error () let cache_size = 1 lsl (8 + memory_footprint) (** The caches of this module are lazy, for two reasons: - some caches are never used, because the function that created them is never called. This typically happens for functors implementing generic datastructures, where not all functions are used in every module (but every function with a static cache creates its cache nevertheless) - Caches must be cleared as soon as some states change, in order to remain coherent (for example, when the current project changes). When setting multiple command-line options, the caches may be cleared after each option. When caches are big, this becomes very time-consuming. To avoid this, the functions [clear] do nothing when the caches have not been forced yet. (This is not perfect: once a lazy cache has been forced, each 'clear' operation becomes costly again.) *) let (!!) = Lazy.force module type Cacheable = sig type t val hash : t -> int val sentinel : t val equal : t -> t -> bool end module type Result = sig type t val sentinel : t end module Array_2 = struct type ('a, 'b) t let (clear : ('a, 'b) t -> 'a -> 'b -> unit) = fun t a b -> let t = Obj.repr t in let size2 = Obj.size t in let i = ref 0 in while (!i < size2) do let base = !i in Obj.set_field t (base) (Obj.repr a); Obj.set_field t (base+1) (Obj.repr b); i := base + 2; done let (make : int -> 'a -> 'b -> ('a, 'b) t) = fun size a b -> let size2 = 2 * size in let t = Obj.obj (Obj.new_block 0 size2) in clear t a b; t let (set : ('a, 'b) t -> int -> 'a -> 'b -> unit) = fun t i a b -> let t = Obj.repr t in let base = 2 * i in Obj.set_field t (base) (Obj.repr a); Obj.set_field t (base+1) (Obj.repr b) let (get0 : ('a, 'b) t -> int -> 'a) = fun t i -> let t = Obj.repr t in let base = 2 * i in Obj.obj (Obj.field t (base)) let (get1 : ('a, 'b) t -> int -> 'b) = fun t i -> let t = Obj.repr t in let base = 2 * i in Obj.obj (Obj.field t (base+1)) end module Array_3 = struct type ('a, 'b, 'c) t let (clear : ('a, 'b, 'c) t -> 'a -> 'b -> 'c -> unit) = fun t a b c -> let t = Obj.repr t in let size3 = Obj.size t in let i = ref 0 in while (!i < size3) do let base = !i in Obj.set_field t (base) (Obj.repr a); Obj.set_field t (base+1) (Obj.repr b); Obj.set_field t (base+2) (Obj.repr c); i := base + 3; done let (make : int -> 'a -> 'b -> 'c -> ('a, 'b, 'c) t) = fun size a b c -> let size3 = 3 * size in let t = Obj.obj (Obj.new_block 0 size3) in clear t a b c; t let (set : ('a, 'b, 'c) t -> int -> 'a -> 'b -> 'c -> unit) = fun t i a b c -> let t = Obj.repr t in let base = 3 * i in Obj.set_field t (base) (Obj.repr a); Obj.set_field t (base+1) (Obj.repr b); Obj.set_field t (base+2) (Obj.repr c) let (get0 : ('a, 'b, 'c) t -> int -> 'a) = fun t i -> let t = Obj.repr t in let base = 3 * i in Obj.obj (Obj.field t (base)) let (get1 : ('a, 'b, 'c) t -> int -> 'b) = fun t i -> let t = Obj.repr t in let base = 3 * i in Obj.obj (Obj.field t (base+1)) let (get2 : ('a, 'b, 'c) t -> int -> 'c) = fun t i -> let t = Obj.repr t in let base = 3 * i in Obj.obj (Obj.field t (base+2)) end module Array_4 = struct type ('a, 'b, 'c, 'd) t let (clear : ('a , 'b , 'c , 'd) t -> 'a -> 'b -> 'c -> 'd -> unit) = fun t a b c d -> let t = Obj.repr t in let size4 = Obj.size t in let i = ref 0 in while (!i < size4) do let base = !i in Obj.set_field t (base) (Obj.repr a); Obj.set_field t (base+1) (Obj.repr b); Obj.set_field t (base+2) (Obj.repr c); Obj.set_field t (base+3) (Obj.repr d); i := base + 7; done let (make : int -> 'a -> 'b -> 'c -> 'd -> ('a , 'b , 'c , 'd) t) = fun size a b c d -> let size4 = 4 * size in let t = Obj.obj (Obj.new_block 0 size4) in clear t a b c d; t let (set : ('a, 'b, 'c, 'd) t -> int -> 'a -> 'b -> 'c -> 'd -> unit) = fun t i a b c d -> let t = Obj.repr t in let base = 4 * i in Obj.set_field t (base) (Obj.repr a); Obj.set_field t (base+1) (Obj.repr b); Obj.set_field t (base+2) (Obj.repr c); Obj.set_field t (base+3) (Obj.repr d); ;; let (get0 : ('a, 'b, 'c, 'd) t -> int -> 'a) = fun t i -> let t = Obj.repr t in let base = 4 * i in Obj.obj (Obj.field t (base)) let (get1 : ('a, 'b, 'c, 'd) t -> int -> 'b) = fun t i -> let t = Obj.repr t in let base = 4 * i in Obj.obj (Obj.field t (base+1)) let (get2 : ('a, 'b, 'c, 'd) t -> int -> 'c) = fun t i -> let t = Obj.repr t in let base = 4 * i in Obj.obj (Obj.field t (base+2)) let (get3 : ('a, 'b, 'c, 'd) t -> int -> 'd) = fun t i -> let t = Obj.repr t in let base = 4 * i in Obj.obj (Obj.field t (base+3)) end module Symmetric_Binary (H: Cacheable) (R: Result) = struct let size = cache_size let cache = lazy (Array_3.make size H.sentinel H.sentinel R.sentinel) let mask = pred size let clear () = if Lazy.is_val cache then Array_3.clear !!cache H.sentinel H.sentinel R.sentinel let hash = H.hash let merge f a0 a1 = let a0', a1', h0, h1 = let h0 = hash a0 in let h1 = hash a1 in if h0 < h1 then a0, a1, h0, h1 else a1, a0, h1, h0 in let has = h1 lsl 5 - h1 + h0 in let has = has land mask in if H.equal (Array_3.get0 !!cache has) a0' && H.equal (Array_3.get1 !!cache has) a1' then begin (* Format.printf "Cache O@."; *) Array_3.get2 !!cache has end else let result = f a0 a1 in (* Format.printf "Cache N@."; *) Array_3.set !!cache has a0' a1' result; result end module Arity_One (H: Cacheable) (R: Result) = struct let size = cache_size let cache = lazy (Array_2.make size H.sentinel R.sentinel) let mask = pred size let clear () = if Lazy.is_val cache then Array_2.clear !!cache H.sentinel R.sentinel let merge f a0 = let h0 = H.hash a0 in let has = h0 land mask in if H.equal (Array_2.get0 !!cache has) a0 then begin (* Format.printf "Cache O@."; *) Array_2.get1 !!cache has end else let result = f a0 in (* Format.printf "Cache N@."; *) Array_2.set !!cache has a0 result; result end module Arity_Two (H0: Cacheable) (H1: Cacheable) (R: Result) = struct let size = cache_size let cache = lazy (Array_3.make size H0.sentinel H1.sentinel R.sentinel) let mask = pred size let clear () = if Lazy.is_val cache then Array_3.clear !!cache H0.sentinel H1.sentinel R.sentinel let merge f a0 a1 = let h0 = H0.hash a0 in let h1 = H1.hash a1 in let has = h1 lsl 5 - h1 + h0 in let has = has land mask in if H0.equal (Array_3.get0 !!cache has) a0 && H1.equal (Array_3.get1 !!cache has) a1 then begin (* Format.printf "Cache O@."; *) Array_3.get2 !!cache has end else let result = f a0 a1 in (* Format.printf "Cache N@."; *) Array_3.set !!cache has a0 a1 result; result end module Arity_Three (H0: Cacheable) (H1: Cacheable) (H2: Cacheable) (R: Result) = struct let size = cache_size let cache = lazy (Array_4.make size H0.sentinel H1.sentinel H2.sentinel R.sentinel) let mask = pred size let clear () = if Lazy.is_val cache then Array_4.clear !!cache H0.sentinel H1.sentinel H2.sentinel R.sentinel let merge f a0 a1 a2 = let h0 = H0.hash a0 in let h1 = H1.hash a1 in let h2 = H2.hash a2 in let has = h0 + 117 * h1 + 2375 * h2 in let has = has land mask in if H0.equal (Array_4.get0 !!cache has) a0 && H1.equal (Array_4.get1 !!cache has) a1 && H2.equal (Array_4.get2 !!cache has) a2 then begin (* Format.printf "Cache O@."; *) Array_4.get3 !!cache has end else let result = f a0 a1 a2 in (* Format.printf "Cache N@."; *) Array_4.set !!cache has a0 a1 a2 result; result end module Array_Bit = struct let make size = let size = (size + 7) lsr 3 in Bytes.make size (char_of_int 0) let get s i = let c = i lsr 3 in let b = 1 lsl (i land 7) in (Char.code (Bytes.get s c)) land b <> 0 let set s i v = let c = i lsr 3 in let b = 1 lsl (i land 7) in let oldcontents = Char.code (Bytes.get s c) in let newcontents = if v then b lor oldcontents else let mask = lnot b in oldcontents land mask in Bytes.set s c (Char.chr newcontents) let clear s = let zero = char_of_int 0 in Bytes.fill s 0 (Bytes.length s) zero end module Binary_Predicate (H0: Cacheable) (H1: Cacheable) = struct let size = cache_size let cache = lazy (Array_2.make size H0.sentinel H1.sentinel) let result = lazy (Array_Bit.make size) let mask = pred size let clear () = if Lazy.is_val cache then Array_2.clear !!cache H0.sentinel H1.sentinel; if Lazy.is_val result then Array_Bit.clear !!result let merge f a0 a1 = let has = let h0 = H0.hash a0 in let h1 = H1.hash a1 in 599 * h0 + h1 in let has = has land mask in if H0.equal (Array_2.get0 !!cache has) a0 && H1.equal (Array_2.get1 !!cache has) a1 then begin (* Format.printf "Cache O@."; *) Array_Bit.get !!result has end else let r = f a0 a1 in (* Format.printf "Cache N@."; *) Array_2.set !!cache has a0 a1; Array_Bit.set !!result has r; r end module Symmetric_Binary_Predicate (H0: Cacheable) = struct let size = cache_size let cache = lazy (Array_2.make size H0.sentinel H0.sentinel) let result = lazy (Array_Bit.make size) let mask = pred size let clear () = if Lazy.is_val cache then Array_2.clear !!cache H0.sentinel H0.sentinel; if Lazy.is_val result then Array_Bit.clear !!result let hash = H0.hash let merge f a0 a1 = let a0, a1, h0, h1 = let h0 = hash a0 in let h1 = hash a1 in if h0 < h1 then a0, a1, h0, h1 else a1, a0, h1, h0 in let has = h1 lsl 5 - h1 + h0 in let has = has land mask in if H0.equal (Array_2.get0 !!cache has) a0 && H0.equal (Array_2.get1 !!cache has) a1 then begin (* Format.printf "Cache O@."; *) Array_Bit.get !!result has end else let r = f a0 a1 in (* Format.printf "Cache N@."; *) Array_2.set !!cache has a0 a1; Array_Bit.set !!result has r; r end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/binary_cache.mli0000666000000000000000000000605513571573400020236 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Very low-level abstract functorial caches. Do not use them unless you understand what happens in this module, and do not forget that those caches are not aware of projects. *) val memory_footprint_var_name: string val cache_size: int (** Size of the caches. Controlled by environment variable [memory_footprint_var_name]. *) module type Cacheable = sig type t val hash : t -> int val sentinel : t val equal : t -> t -> bool end module type Result = sig type t val sentinel : t end module Symmetric_Binary(H : Cacheable)(R : Result): sig val clear : unit -> unit val merge : (H.t -> H.t -> R.t) -> H.t -> H.t -> R.t end module Binary_Predicate(H0 : Cacheable)(H1 : Cacheable): sig val clear : unit -> unit val merge : (H0.t -> H1.t -> bool) -> H0.t -> H1.t -> bool end module Symmetric_Binary_Predicate(H0 : Cacheable): sig val clear : unit -> unit val merge : (H0.t -> H0.t -> bool) -> H0.t -> H0.t -> bool end module Arity_One(H : Cacheable)(R : Result): sig val clear : unit -> unit val merge : (H.t -> R.t) -> H.t -> R.t end module Arity_Two(H0 : Cacheable)(H1 : Cacheable)(R : Result): sig val clear : unit -> unit val merge : (H0.t -> H1.t -> R.t) -> H0.t -> H1.t -> R.t end module Arity_Three(H0 : Cacheable)(H1 : Cacheable)(H2 : Cacheable)(R : Result): sig val clear : unit -> unit val merge : (H0.t -> H1.t -> H2.t -> R.t) -> H0.t -> H1.t -> H2.t -> R.t end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/bitvector.ml0000666000000000000000000002457413571573400017465 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ------------------------------------------------------------------------ *) (* --- Bit Vector Library --- *) (* ------------------------------------------------------------------------ *) (* Notes: - Bits are counted from 0, in string order, then from least to most significant. For instance the value of bit 11 is tested with (s.[1] land (1 lsl 3) == 0) - Strings can store more bits than the bitvector they represent; for instance a bitvector of size 11 is stored in a 2-bytes string. We (currently) do not store the actual size of the bitvector, which has to be provided in some informations (such as concat). We rely on the invariant that the extra bits are set to 0 (this is important e.g. for equality testing). An alternative design could have been not to explicitly ignore these extra bits in operations that are sensitive to them, but this seems more error-prone. *) type t = bytes let max_size = 1 lsl 20 let ( <-< ) a b = char_of_int (((int_of_char a) lsl b) land 255);; let ( >-> ) a b = char_of_int ((int_of_char a) lsr b);; let ( ||| ) a b = char_of_int ((int_of_char a) lor (int_of_char b));; let ( &&& ) a m = char_of_int ((int_of_char a) land m);; (* Imperatively unset the extra trailing bits *) let clean_trail size bv = let last = (size + 7) / 8 - 1 in assert (last < Bytes.length bv); let r = size land 7 in if r > 0 then (let mask = 1 lsl r - 1 in Bytes.set bv last (Bytes.get bv last &&& mask)) ; for i = last + 1 to Bytes.length bv - 1 do Bytes.set bv i '\000' ; done ; bv ;; let capacity s = Bytes.length s * 8 let create n = let s = (n + 7) lsr 3 in (* rounded-up division *) if s > max_size then raise (Invalid_argument "Bitvector.create") ; Bytes.make s '\000' let resize n s = let u = create n in Bytes.blit s 0 u 0 (min (Bytes.length s) (Bytes.length u)) ; clean_trail n u let create_set n = let s = (n + 7) lsr 3 in (* rounded-up division *) if s > max_size then raise (Invalid_argument "Bitvector.create") ; let copy = Bytes.make s (char_of_int 255) in let r = n land 7 in (* Set only the last r bits in the last byte. *) if r != 0 then Bytes.set copy (s-1) (char_of_int ((1 lsl r) - 1)); copy ;; let pp_bits fmt x = for k=7 downto 0 do Format.pp_print_char fmt (if x land (1 lsl k) > 0 then '1' else '0') done let pp_elts fmt x = for k=0 to 7 do Format.pp_print_char fmt (if x land (1 lsl k) > 0 then '1' else '0') done let pretty fmt s = for i=0 to Bytes.length s - 1 do if i > 0 then Format.pp_print_space fmt () ; pp_elts fmt (int_of_char (Bytes.get s i)) ; done let is_empty s = try for i=0 to Bytes.length s - 1 do if Bytes.get s i <> '\000' then raise Exit ; done ; true with Exit -> false let set s k = let p = k lsr 3 in if p >= Bytes.length s then raise (Invalid_argument "Bitvector.set") ; let r = k land 7 in let b = int_of_char (Bytes.get s p) lor (1 lsl r) in Bytes.set s p (char_of_int b) let clear s k = let p = k lsr 3 in if p >= Bytes.length s then raise (Invalid_argument "Bitvector.clear") ; let r = k land 7 in let b = int_of_char (Bytes.get s p) land (lnot (1 lsl r)) in Bytes.set s p (char_of_int b) let mem s k = let p = k lsr 3 in if p >= Bytes.length s then raise (Invalid_argument "Bitvector.mem") ; let r = k land 7 in int_of_char (Bytes.get s p) land (1 lsl r) <> 0 let once s k = let p = k lsr 3 in if p >= Bytes.length s then raise (Invalid_argument "Bitvector.once") ; let r = k land 7 in let b0 = int_of_char (Bytes.get s p) in let b1 = b0 lor (1 lsl r) in if b0 = b1 then false else (Bytes.set s p (char_of_int b1); true) let bnot size s = let len = (size + 7) / 8 in let copy = Bytes.make (Bytes.length s) '\000' in for i = 0 to len-1 do Bytes.set copy i (char_of_int ((lnot (int_of_char (Bytes.get s i))) land 255)) done; clean_trail size copy ;; (* Internal; this function does not clean the trail for operations that do not need it. *) let bitwise_bop bop a b = assert ((Bytes.length a) = (Bytes.length b)); let copy = Bytes.make (Bytes.length a) '\000' in for i = 0 to (Bytes.length a) - 1 do Bytes.set copy i (char_of_int (255 land (bop (int_of_char (Bytes.get a i)) (int_of_char (Bytes.get b i))))); done; copy let band _ = bitwise_bop (land);; let bor _ = bitwise_bop (lor);; let bxor _ = bitwise_bop (lxor);; let beq size a b = let bv = bitwise_bop (fun x y -> lnot (x lxor y)) a b in clean_trail size bv ;; let bitwise_op2 size op2 a b = let len = Bytes.length a in assert (len = (Bytes.length b)); let copy = Bytes.make len '\000' in for i = 0 to len - 1 do Bytes.set copy i (char_of_int (255 land (op2 (int_of_char (Bytes.get a i)) (int_of_char (Bytes.get b i))))) done; clean_trail size copy ;; let bitwise_op3 size op3 a b c = let len = Bytes.length a in assert (len = (Bytes.length b)); assert (len = (Bytes.length c)); let copy = Bytes.make len '\000' in for i = 0 to len - 1 do Bytes.set copy i (char_of_int (255 land (op3 (int_of_char (Bytes.get a i)) (int_of_char (Bytes.get b i)) (int_of_char (Bytes.get c i))))); done; clean_trail size copy ;; let bitwise_op4 size op4 a b c d = let len = Bytes.length a in assert (len = (Bytes.length b)); assert (len = (Bytes.length c)); assert (len = (Bytes.length d)); let copy = Bytes.make len '\000' in for i = 0 to len - 1 do Bytes.set copy i (char_of_int (255 land (op4 (int_of_char (Bytes.get a i)) (int_of_char (Bytes.get b i)) (int_of_char (Bytes.get c i)) (int_of_char (Bytes.get d i))))); done; clean_trail size copy ;; let equal = (=);; (* String equality. *) let compare = Transitioning.Stdlib.compare let hash = Hashtbl.hash let concat bv1 size1 bv2 size2 = let len1 = size1 / 8 in let str1 = (size1 + 7) / 8 in let str2 = (size2 + 7) / 8 in assert (str1 <= Bytes.length bv1); assert (str2 <= Bytes.length bv2); let newlen = (size1 + size2 + 7) / 8 in let copy = Bytes.create newlen in Bytes.blit bv1 0 copy 0 len1 ; let fst_bits = size1 land 7 in let snd_bits = 8 - fst_bits in (* Byte-aligned case. *) if fst_bits = 0 then (Bytes.blit bv2 0 copy len1 str2; copy) (* Not aligned. *) else let rec loop prev_byte i = let j = len1 + i in if i <= str2 - 1 then (Bytes.set copy j (prev_byte ||| (Bytes.get bv2 i <-< fst_bits)); loop (Bytes.get bv2 i >-> snd_bits) (i+1)) else if j < newlen then Bytes.set copy j (Bytes.get bv2 (str2-1) >-> snd_bits) else () in loop (Bytes.get bv1 len1) 0; clean_trail (size1+size2) copy;; let iter_true f s = for p = 0 to Bytes.length s - 1 do let x = int_of_char (Bytes.get s p) in if x <> 0 then let q = p lsl 3 in for r = 0 to 7 do if x land (1 lsl r) <> 0 then f (q+r) done done let fold_true f init s = let r = ref init in iter_true (fun i -> r := f !r i) s; !r exception Result of int let find_next_true s k = let p = k lsr 3 in if p >= Bytes.length s then raise Not_found; let x = int_of_char (Bytes.get s p) in let r = k land 7 in try begin for r' = r to 7 do if x land (1 lsl r') <> 0 then raise (Result ((p lsl 3) lor r')) done; for p' = (p+1) to (Bytes.length s - 1) do let x = int_of_char (Bytes.get s p') in if x <> 0 then for r' = 0 to 7 do if x land (1 lsl r') <> 0 then raise (Result ((p' lsl 3) lor r')) done done; raise Not_found end with Result res -> res ;; let low = [| 0b00000001 ; (* 0: bits 0..0 *) 0b00000011 ; (* 1: bits 0..1 *) 0b00000111 ; (* 2: bits 0..2 *) 0b00001111 ; (* 3: bits 0..3 *) 0b00011111 ; (* 4: bits 0..4 *) 0b00111111 ; (* 5: bits 0..5 *) 0b01111111 ; (* 6: bits 0..6 *) |] let high = [| 0b11111110 ; (* 0: bits 1..7 *) 0b11111100 ; (* 1: bits 2..7 *) 0b11111000 ; (* 2: bits 3..7 *) 0b11110000 ; (* 3: bits 4..7 *) 0b11100000 ; (* 4: bits 5..7 *) 0b11000000 ; (* 5: bits 6..7 *) 0b10000000 ; (* 6: bits 7..7 *) |] let set_range s a b = if b-a < 8 then for i=a to b do set s i done else let p = let i = a land 7 in let p0 = a lsr 3 in if i=0 then p0 else (* Sets bits i..7 of p0 *) let x = int_of_char (Bytes.get s p0) lor high.(i-1) in Bytes.set s p0 (char_of_int x) ; succ p0 in let q = let j = b land 7 in let q0 = b lsr 3 in if j=7 then q0 else (* Sets bits 0..j of q0 *) let x = int_of_char (Bytes.get s q0) lor low.(j) in Bytes.set s q0 (char_of_int x) ; pred q0 in for i=p to q do Bytes.set s i '\255' done ;; frama-c-20.0-Calcium/src/libraries/utils/bitvector.mli0000666000000000000000000001006013571573400017617 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ------------------------------------------------------------------------ *) (** Bitvectors. @since Carbon-20101201 *) (* ------------------------------------------------------------------------ *) type t val create : int -> t (** Create a vector of [n] bits, with all bits unset. *) val create_set : int -> t (** Create a vector of [n] bits, with all bits set.*) val capacity : t -> int (** Maximum number of bits in the bitvector. *) val resize : int -> t -> t (** A copy of the bitvector up-to or down-to [n] bits. Extra bits up to final bitvector capacity are set to zero. *) val mem : t -> int -> bool val set : t -> int -> unit val clear : t -> int -> unit val once : t -> int -> bool (** return [true] if unset, then set the bit. *) val set_range : t -> int -> int -> unit val is_empty : t -> bool val equal: t -> t -> bool val compare: t -> t -> int val hash: t -> int (** {2 Bitwise Binary Operations} The first argument is the size of the vectors. *) val bnot: int -> t -> t val band: int -> t -> t -> t val bor: int -> t -> t -> t val bxor: int -> t -> t -> t (* bitwise difference *) val beq: int -> t -> t -> t (* bitwise equivalence/equality *) (** {2 Generic Bitwise Operations}. Prefer using these rather than create intermediary bitvectors. *) val bitwise_op2: int -> (int -> int -> int) -> t -> t -> t val bitwise_op3: int -> (int -> int -> int -> int) -> t -> t -> t -> t val bitwise_op4: int -> (int -> int -> int -> int -> int) -> t -> t -> t -> t -> t (** {2 Sized Concatenation} *) val concat: t -> int -> t -> int -> t (** [concat b1 s1 b2 s2] concatenates the [s1] first bits of [b1] with the [s2] first bits of [b2]. *) (** {2 Misc} *) val iter_true : (int -> unit) -> t -> unit (** Iterates on all indexes of the bitvector with their bit set. *) val fold_true : ('a -> int -> 'a) -> 'a -> t -> 'a (** Iterates on all indexes of the bitvector with their bit set. *) val find_next_true: t -> int -> int (** [find_next_true i a] returns the first index greater or equal to [i] with its bit set. To find the first true element, call [find_next_true -1 a]. If no next true element exists, or [i] is larger than the array, then raise [Not_found]. *) val pretty : Format.formatter -> t -> unit (** Bit vector, as blocs of 8-bits separated by space, first bits to last bits from left to right. *) val pp_bits : Format.formatter -> int -> unit (** 0b... format, for bytes only, most significant bits on left. *) frama-c-20.0-Calcium/src/libraries/utils/c_bindings.c0000666000000000000000000001626713571573400017375 0ustar /**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ #ifdef _WIN32 /* Must be the first included header */ #include "windows.h" #endif #include "caml/mlvalues.h" #include "caml/alloc.h" #include "caml/fail.h" #include #include #include #include #include // Some BSD flavors do not implement all of C99 #if defined(__NetBSD__) # include # define FE_DOWNWARD FP_RM # define FE_UPWARD FP_RP # define FE_TONEAREST FP_RN # define FE_TOWARDZERO FP_RZ # define fegetround() fpgetround() # define fesetround(RM) fpsetround(RM) #else # include #endif #include #include // Must be synchronized with Floating_point.c_rounding_mode typedef enum { FE_ToNearest, FE_Upward, FE_Downward, FE_TowardZero } c_rounding_mode_t; value c_round(value d) { return caml_copy_double(round(Double_val(d))); } value c_trunc(value d) { return caml_copy_double(trunc(Double_val(d))); } /* NOTE: The single-precision functions below (expf, logf, etc.) need the 'volatile' modifier due to odd behaviors detected in Ubuntu 12.04 (precise32), with gcc 4.6.3 and glibc 2.15. In those machines, the absence of volatile leads gcc to optimize the call to a double-precision result and, despite the use of 'float' and casts (which should force the result to be truncated to 32 bits), the 64-bit result is propagated back to OCaml, leading to non-zero bits beyond the 32-bit range, which cause FRange.check_representability to fail, leading to errors in tests/float/math_builtins.c. This behavior has not been observed in more recent distributions. */ value c_expf(value d) { float f = Double_val(d); volatile float res = expf(f); // see remarks above return caml_copy_double(res); } value c_logf(value d) { float f = Double_val(d); volatile float res = logf(f); // see remarks above return caml_copy_double(res); } value c_log10f(value d) { float f = Double_val(d); volatile float res = log10f(f); // see remarks above return caml_copy_double(res); } value c_powf(value x, value y) { float fx = Double_val(x); float fy = Double_val(y); volatile float res = powf(fx, fy); // see remarks above return caml_copy_double(res); } value c_sqrtf(value d) { float f = Double_val(d); volatile float res = sqrtf(f); // see remarks above return caml_copy_double(res); } value c_fmodf(value x, value y) { float fx = Double_val(x); float fy = Double_val(y); volatile float res = fmodf(fx, fy); // see remarks above return caml_copy_double(res); } value c_cosf(value x) { float f = Double_val(x); volatile float res = cosf(f); // see remarks above return caml_copy_double(res); } value c_sinf(value x) { float f = Double_val(x); volatile float res = sinf(f); // see remarks above return caml_copy_double(res); } value c_atan2f(value x, value y) { float fx = Double_val(x); float fy = Double_val(y); volatile float res = atan2f(fx, fy); // see remarks above return caml_copy_double(res); } value compare_strings(value v1, value v2, value vlen) { if (memcmp(String_val(v1), String_val(v2), Long_val(vlen)) == 0) return Val_true; else return Val_false; } value address_of_value(value v) { return (Val_long(((unsigned long)v)/sizeof(long))); } value round_to_float(value d) { float f = Double_val(d); return caml_copy_double(f); } value set_round_downward(value dummy) { fesetround(FE_DOWNWARD); return Val_unit; } value set_round_upward(value dummy) { fesetround(FE_UPWARD); return Val_unit; } value set_round_nearest_even(value dummy) { fesetround(FE_TONEAREST); return Val_unit; } value set_round_toward_zero(value dummy) { fesetround(FE_TOWARDZERO); return Val_unit; } value get_rounding_mode(value dummy) { switch (fegetround()) { case FE_TONEAREST: return Val_int(FE_ToNearest); case FE_DOWNWARD: return Val_int(FE_Downward); case FE_UPWARD: return Val_int(FE_Upward); case FE_TOWARDZERO: return Val_int(FE_TowardZero); } caml_failwith("illegal rounding mode (should never happen)"); } value set_rounding_mode(value rm) { int new_rm; switch (Int_val(rm)) { case FE_ToNearest: new_rm = FE_TONEAREST; break; case FE_Downward: new_rm = FE_DOWNWARD; break; case FE_Upward: new_rm = FE_UPWARD; break; case FE_TowardZero: new_rm = FE_TOWARDZERO; break; default: caml_invalid_argument("set_rounding_mode"); } fesetround(new_rm); return Val_unit; } value float_compare_total(value x, value y) { union { double d; int64_t i; } ux, uy; ux.d = Double_val(x); uy.d = Double_val(y); if (ux.i == uy.i) return Val_int(0); ux.i = ux.i ^ (((uint64_t)(ux.i >> 63))>>1); uy.i = uy.i ^ (((uint64_t)(uy.i >> 63))>>1); if (ux.i < uy.i) return Val_int(-1); else return Val_int(1); } value float_is_negative(value v) { union { double d; uint64_t i; } uv; uv.d = Double_val(v); return (Val_int((int)((uv.i) >> 63))); } /* Some compilers apply the C90 standard strictly and do not prototype strtof() although it is available in the C library. */ float strtof(const char *, char **); value single_precision_of_string(value str) { const char *s = (const char *)str; const char *s_end = s + caml_string_length(str); char *end; float f = strtof(s, &end); if (end != s_end) { // Because strtof does not consider optional floating-point suffixes // (f, F, l, L), we have to test if they are the cause of the difference, // and if so, ignore it. if (end + 1 != s_end || (*end != 'f' && *end != 'F' && *end != 'l' && *end == 'L')) { caml_failwith("single_precision_of_string"); } } double d = f; return caml_copy_double(d); } value ml_usleep(value v) { usleep( Int_val(v) ); return Val_unit ; } frama-c-20.0-Calcium/src/libraries/utils/cilconfig.ml0000666000000000000000000002313113571573400017405 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) module H = Hashtbl (************************************************************************ Configuration ************************************************************************) let absoluteFilename (fname: string) = if Filename.is_relative fname then Filename.concat (Sys.getcwd ()) fname else fname (** The configuration data can be of several types **) type configData = ConfInt of int | ConfBool of bool | ConfFloat of float | ConfString of string | ConfList of configData list (* Store here window configuration file *) let configurationData: (string, configData) H.t = H.create 13 let clearConfiguration () = H.clear configurationData let setConfiguration (key: string) (c: configData) = H.replace configurationData key c let findConfiguration (key: string) : configData = H.find configurationData key let findConfigurationInt (key: string) : int = match findConfiguration key with ConfInt i -> i | _ -> Kernel.warning "Configuration %s is not an integer" key; raise Not_found let findConfigurationFloat (key: string) : float = match findConfiguration key with ConfFloat i -> i | _ -> Kernel.warning "Configuration %s is not a float" key; raise Not_found let useConfigurationInt (key: string) (f: int -> unit) = try f (findConfigurationInt key) with Not_found -> () let useConfigurationFloat (key: string) (f: float -> unit) = try f (findConfigurationFloat key) with Not_found -> () let findConfigurationString (key: string) : string = match findConfiguration key with ConfString s -> s | _ -> Kernel.warning "Configuration %s is not a string" key; raise Not_found let useConfigurationString (key: string) (f: string -> unit) = try f (findConfigurationString key) with Not_found -> () let findConfigurationBool (key: string) : bool = match findConfiguration key with ConfBool b -> b | _ -> Kernel.warning "Configuration %s is not a boolean" key; raise Not_found let useConfigurationBool (key: string) (f: bool -> unit) = try f (findConfigurationBool key) with Not_found -> () let findConfigurationList (key: string) : configData list = match findConfiguration key with ConfList l -> l | _ -> Kernel.warning "Configuration %s is not a list" key; raise Not_found let useConfigurationList (key: string) (f: configData list -> unit) = try f (findConfigurationList key) with Not_found -> () let saveConfiguration (fname: string) = (** Convert configuration data to a string, for saving externally *) let configToString (c: configData) : string = let buff = Buffer.create 80 in let rec loop (c: configData) : unit = match c with ConfInt i -> Buffer.add_char buff 'i'; Buffer.add_string buff (string_of_int i); Buffer.add_char buff ';' | ConfBool b -> Buffer.add_char buff 'b'; Buffer.add_string buff (string_of_bool b); Buffer.add_char buff ';' | ConfFloat f -> Buffer.add_char buff 'f'; Buffer.add_string buff (string_of_float f); Buffer.add_char buff ';' | ConfString s -> if String.contains s '"' then Kernel.fatal "Guilib: configuration string contains quotes"; Buffer.add_char buff '"'; Buffer.add_string buff s; Buffer.add_char buff '"'; (* '"' *) | ConfList l -> Buffer.add_char buff '['; List.iter loop l; Buffer.add_char buff ']' in loop c; Buffer.contents buff in try let oc = open_out fname in Kernel.debug "Saving configuration to %s@." (absoluteFilename fname); H.iter (fun k c -> output_string oc (k ^ "\n"); output_string oc ((configToString c) ^ "\n")) configurationData; close_out oc with _ -> Kernel.warning "Cannot open configuration file %s\n" fname (** Make some regular expressions early *) let intRegexp = Str.regexp "i\\([^;]+\\);" let floatRegexp = Str.regexp "f\\([^;]+\\);" let boolRegexp = Str.regexp "b\\(\\(true\\)\\|\\(false\\)\\);" let stringRegexp = Str.regexp "\"\\([^\"]*\\)\"" let loadConfiguration (fname: string) : unit = H.clear configurationData; let stringToConfig (s: string) : configData = let idx = ref 0 in (** the current index *) let l = String.length s in let rec getOne () : configData = if !idx >= l then raise Not_found; if Str.string_match intRegexp s !idx then begin idx := Str.match_end (); let p = Str.matched_group 1 s in (try ConfInt (int_of_string p) with Failure _ -> Kernel.warning "Invalid integer configuration element %s" p; raise Not_found) end else if Str.string_match floatRegexp s !idx then begin idx := Str.match_end (); let p = Str.matched_group 1 s in (try ConfFloat (float_of_string p) with Failure _ -> Kernel.warning "Invalid float configuration element %s" p; raise Not_found) end else if Str.string_match boolRegexp s !idx then begin idx := Str.match_end (); ConfBool (bool_of_string (Str.matched_group 1 s)) end else if Str.string_match stringRegexp s !idx then begin idx := Str.match_end (); ConfString (Str.matched_group 1 s) end else if String.get s !idx = '[' then begin (* We are starting a list *) incr idx; let rec loop (acc: configData list) : configData list = if !idx >= l then begin Kernel.warning "Non-terminated list in configuration %s" s; raise Not_found end; if String.get s !idx = ']' then begin incr idx; List.rev acc end else loop (getOne () :: acc) in ConfList (loop []) end else begin Kernel.warning "Bad configuration element in a list: %s" (String.sub s !idx (l - !idx)); raise Not_found end in getOne () in (try let ic = open_in fname in Kernel.debug "Loading configuration from %s@." (absoluteFilename fname); (try while true do let k = input_line ic in let s = input_line ic in try let c = stringToConfig s in setConfiguration k c with Not_found -> () done with End_of_file -> ()); close_in ic; with _ -> () (* no file, ignore *)); () (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/cilconfig.mli0000666000000000000000000001201413571573400017554 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (** Reading and storing configuration files from the filesystem. Currently only used in Frama-C's GUI.*) (************************************************************************ *) (** {2 Configuration} *) (* ************************************************************************) (** The configuration data can be of several types **) type configData = ConfInt of int | ConfBool of bool | ConfFloat of float | ConfString of string | ConfList of configData list (** Load the configuration from a file *) val loadConfiguration: string -> unit (** Save the configuration in a file. Overwrites the previous values *) val saveConfiguration: string -> unit (** Clear all configuration data *) val clearConfiguration: unit -> unit (** Set a configuration element, with a key. Overwrites the previous values *) val setConfiguration: string -> configData -> unit (** Find a configuration elements, given a key. Raises Not_found if it cannot * find it *) val findConfiguration: string -> configData (** Like findConfiguration but extracts the integer *) val findConfigurationInt: string -> int (** Looks for an integer configuration element, and if it is found, it uses * the given function. Otherwise, does nothing *) val useConfigurationInt: string -> (int -> unit) -> unit val findConfigurationFloat: string -> float val useConfigurationFloat: string -> (float -> unit) -> unit val findConfigurationBool: string -> bool val useConfigurationBool: string -> (bool -> unit) -> unit val findConfigurationString: string -> string val useConfigurationString: string -> (string -> unit) -> unit val findConfigurationList: string -> configData list val useConfigurationList: string -> (configData list -> unit) -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/command.ml0000666000000000000000000002167113571573400017075 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let safe_close_out outc = try close_out outc with Sys_error _ -> () let safe_close_in inc = try close_in inc with Sys_error _ -> () (* -------------------------------------------------------------------------- *) (* --- File Utilities --- *) (* -------------------------------------------------------------------------- *) let filename parent child = Filename.concat parent child let pp_to_file f pp = let cout = open_out f in let fout = Format.formatter_of_out_channel cout in try pp fout ; Format.pp_print_flush fout () ; safe_close_out cout with err -> Format.pp_print_flush fout () ; safe_close_out cout ; raise err let pp_from_file fmt file = let cin = open_in file in try while true do !Db.progress () ; let line = input_line cin in Format.pp_print_string fmt line ; Format.pp_print_newline fmt () ; done with | End_of_file -> close_in cin | err -> close_in cin ; raise err let rec bincopy buffer cin cout = let s = Bytes.length buffer in let n = input cin buffer 0 s in if n > 0 then ( output cout buffer 0 n ; bincopy buffer cin cout ) else ( flush cout ) let on_inc file job = let inc = open_in file in let finally () = safe_close_in inc in Extlib.try_finally ~finally job inc let on_out file job = let out = open_out file in let finally () = safe_close_out out in Extlib.try_finally ~finally job out let copy src tgt = on_inc src (fun inc -> on_out tgt (fun out -> bincopy (Bytes.create 2048) inc out)) let read_file file job = let inc = open_in file in let finally () = safe_close_in inc in Extlib.try_finally ~finally job inc let read_lines file job = read_file file (fun inc -> try while true do job (input_line inc) ; done with End_of_file -> ()) let write_file file job = assert (file <> ""); let out = open_out file in let finally () = flush out; safe_close_out out in Extlib.try_finally ~finally job out let print_file file job = write_file file (fun out -> let fmt = Format.formatter_of_out_channel out in let finally () = Format.pp_print_flush fmt () in Extlib.try_finally ~finally job fmt) (* -------------------------------------------------------------------------- *) (* --- Timing --- *) (* -------------------------------------------------------------------------- *) type timer = float ref type 'a result = Result of 'a | Error of exn let dt_max tm dt = match tm with Some r when dt > !r -> r := dt | _ -> () let dt_add tm dt = match tm with Some r -> r := !r +. dt | _ -> () let return = function Result x -> x | Error e -> raise e let catch f x = try Result(f x) with e -> Error e let time ?rmax ?radd job data = begin let t0 = Sys.time () in let re = catch job data in let t1 = Sys.time () in let dt = t1 -. t0 in dt_max rmax dt ; dt_add radd dt ; return re ; end (* -------------------------------------------------------------------------- *) (* --- Process --- *) (* -------------------------------------------------------------------------- *) type process_result = Not_ready of (unit -> unit) | Result of Unix.process_status let _pp_status fmt = function | Unix.WEXITED s -> Format.fprintf fmt "exit[%d]" s | Unix.WSIGNALED s -> Format.fprintf fmt "sig[%d]" s | Unix.WSTOPPED s -> Format.fprintf fmt "stop[%d]" s let full_command cmd args ~stdin ~stdout ~stderr = let pid = Unix.create_process cmd (Array.concat [[|cmd|];args]) stdin stdout stderr in let _,status = Unix.waitpid [Unix.WUNTRACED] pid in status let full_command_async cmd args ~stdin ~stdout ~stderr = let pid = Unix.create_process cmd (Array.concat [[|cmd|];args]) stdin stdout stderr in let last_result= ref(Not_ready (fun () -> Unix.kill pid Sys.sigkill)) in (fun () -> match !last_result with | Result _ as r -> r | Not_ready _ as r -> let child_id,status = Unix.waitpid [Unix.WNOHANG; Unix.WUNTRACED] pid in if child_id = 0 then r else (last_result := Result status; !last_result)) let flush b f = match b with | None -> () | Some b -> try read_lines f (fun line -> Buffer.add_string b line ; Buffer.add_char b '\n') ; with Sys_error _ -> () (*[LC] return the cancel function *) let cancelable_at_exit job = let later = ref (Some job) in Extlib.safe_at_exit (fun () -> match !later with None -> () | Some job -> job ()) ; fun () -> later := None let command_generic ~async ?stdout ?stderr cmd args = let inf,inc = Filename.open_temp_file ~mode:[Open_binary;Open_rdonly; Open_trunc; Open_creat; Open_nonblock ] "in_" ".tmp" in let outf,outc = Filename.open_temp_file ~mode:[Open_binary;Open_wronly; Open_trunc; Open_creat] "out_" ".tmp" in let errf,errc = Filename.open_temp_file ~mode:[Open_binary;Open_wronly; Open_trunc; Open_creat] "out_" ".tmp" in let delete () = begin Extlib.safe_remove inf; Extlib.safe_remove outf; Extlib.safe_remove errf; end in let deleted = cancelable_at_exit delete in let pid = Unix.create_process cmd (Array.append [|cmd|] args) (Unix.descr_of_out_channel inc) (Unix.descr_of_out_channel outc) (Unix.descr_of_out_channel errc) in let killed = cancelable_at_exit begin fun () -> Unix.kill pid Sys.sigkill; Unix.(try ignore (waitpid [] pid) with Unix_error _ -> ()) ; end in safe_close_out inc; safe_close_out outc; safe_close_out errc; let kill () = Unix.kill pid Sys.sigkill in let last_result= ref (Not_ready kill) in let wait_flags = if async then [Unix.WNOHANG; Unix.WUNTRACED] else [Unix.WUNTRACED] in begin fun () -> match !last_result with | Result _p as r -> r | Not_ready _ as r -> let child_id,status = Unix.waitpid wait_flags pid in if child_id = 0 then (assert async;r) else begin let result = Result status in flush stdout outf ; flush stderr errf ; delete () ; deleted () ; killed () ; result end end let command_async ?stdout ?stderr cmd args = command_generic ~async:true ?stdout ?stderr cmd args let command ?(timeout=0) ?stdout ?stderr cmd args = if !Config.is_gui || timeout > 0 then let f = command_generic ~async:true ?stdout ?stderr cmd args in let res = ref(Unix.WEXITED 99) in let ftimeout = float_of_int timeout in let start = ref (Unix.gettimeofday ()) in let running () = match f () with | Not_ready terminate -> begin try !Db.progress () ; if timeout > 0 && Unix.gettimeofday () -. !start > ftimeout then raise Db.Cancel ; true with Db.Cancel as e -> terminate (); raise e end | Result r -> res := r; false in while running () do Extlib.usleep 100000 (* 0.1s *) done ; !res else let f = command_generic ~async:false ?stdout ?stderr cmd args in match f () with | Result r -> r | Not_ready _ -> assert false (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/command.mli0000666000000000000000000001355313571573400017246 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Useful high-level system operations. *) (* ************************************************************************* *) (** {2 File Utilities} *) (* ************************************************************************* *) val filename : string -> string -> string val pp_to_file : string -> (Format.formatter -> unit) -> unit (** [pp_to_file file pp] runs [pp] on a formatter that writes into [file]. The formatter is always properly flushed and closed on return. Exceptions in [pp] are re-raised after closing. *) val pp_from_file : Format.formatter -> string -> unit (** [pp_from_file fmt file] dumps the content of [file] into the [fmt]. Exceptions in [pp] are re-raised after closing. *) val bincopy : bytes -> in_channel -> out_channel -> unit (** [copy buffer cin cout] reads [cin] until end-of-file and copy it in [cout]. [buffer] is a temporary string used during the copy. Recommended size is [2048]. @modify Silicon-20161101 [buffer] has now type [bytes] instead of [string] *) val copy : string -> string -> unit (** [copy source target] copies source file to target file using [bincopy]. *) val read_file : string -> (in_channel -> 'a) -> 'a (** Properly close the channel and re-raise exceptions *) val read_lines : string -> (string -> unit) -> unit (** Iter over all text lines in the file *) val write_file : string -> (out_channel -> 'a) -> 'a (** Properly close the channel and re-raise exceptions *) val print_file : string -> (Format.formatter -> 'a) -> 'a (** Properly flush and close the channel and re-raise exceptions *) (* ************************************************************************* *) (** {2 Timing Utility} *) (* ************************************************************************* *) type timer = float ref type 'a result = Result of 'a | Error of exn val catch : ('a -> 'b) -> 'a -> 'b result val return : 'a result -> 'a val time : ?rmax:timer -> ?radd:timer -> ('a -> 'b) -> 'a -> 'b (** Compute the elapsed time with [Sys.time]. The [rmax] timer is maximized and the [radd] timer is cumulated. Computed result is returned, or exception is re-raised. *) (* ************************************************************************* *) (** {2 System commands} *) (* ************************************************************************* *) val full_command : string -> string array -> stdin:Unix.file_descr -> stdout:Unix.file_descr -> stderr:Unix.file_descr -> Unix.process_status (** Same arguments as {Unix.create_process} but returns only when execution is complete. @raise Sys_error when a system error occurs *) type process_result = | Not_ready of (unit -> unit) | Result of Unix.process_status (** [Not_ready f] means that the child process is not yet finished and may be terminated manually with [f ()]. *) val full_command_async : string -> string array -> stdin:Unix.file_descr -> stdout:Unix.file_descr -> stderr:Unix.file_descr -> (unit -> process_result) (** Same arguments as {Unix.create_process}. @return a function to call to check if the process execution is complete. You must call this function until it returns a Result to prevent Zombie processes. @raise Sys_error when a system error occurs *) val command_async : ?stdout:Buffer.t -> ?stderr:Buffer.t -> string -> string array -> (unit -> process_result) (** Same arguments as {Unix.create_process}. @return a function to call to check if the process execution is complete. You must call this function until it returns a Result to prevent Zombie processes. When this function returns a Result, the stdout and stderr of the child process will be filled into the arguments buffer. @raise Sys_error when a system error occurs *) val command : ?timeout:int -> ?stdout:Buffer.t -> ?stderr:Buffer.t -> string -> string array -> Unix.process_status (** Same arguments as {Unix.create_process}. When this function returns, the stdout and stderr of the child process will be filled into the arguments buffer. @raise Sys_error when a system error occurs @raise Db.Cancel when the computation is interrupted or on timeout *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/dotgraph.ml0000666000000000000000000003135613571573400017270 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Attributes and Such --- *) (* -------------------------------------------------------------------------- *) type attr = [ | `LR | `TB | `Label of string | `Color of string | `Fillcolor of string | `Shape of string | `Style of string | `Circle | `Box | `Oval | `Point | `Dotted | `Filled | `ArrowBoth | `ArrowBack | `ArrowForward | `ArrowHead of string | `ArrowTail of string | `Attr of string * string ] let attr = function | `LR -> "rankdir" , "LR" | `TB -> "rankdir" , "TB" | `Label txt -> "label" , txt | `Color c -> "color" , c | `Fillcolor c -> "fillcolor" , c | `Shape sh -> "shape" , sh | `Style sty -> "style" , sty | `Box -> "shape" , "box" | `Oval -> "shape" , "oval" | `Point -> "shape" , "point" | `Circle -> "shape" , "circle" | `Filled -> "style" , "filled" | `Dotted -> "style" , "dotted" | `ArrowBoth -> "dir" , "both" | `ArrowBack -> "dir" , "back" | `ArrowForward -> "dir" , "forward" | `ArrowHead sh -> "arrowhead" , sh | `ArrowTail sh -> "arrowtail" , sh | `Attr(name,value) -> name , value let pp_attr fmt (a : attr) = let name,value = attr a in Format.fprintf fmt "%s=%S" name value let pp_attributes fmt = function | [] -> () | p::ps -> begin Format.fprintf fmt "@ %a" pp_attr p ; List.iter (fun p -> Format.fprintf fmt ",@ %a" pp_attr p) ps ; end (* -------------------------------------------------------------------------- *) (* --- Dot Output --- *) (* -------------------------------------------------------------------------- *) type dot = { file : string ; queue : (unit -> unit) Queue.t ; mutable indent : string ; mutable id : int ; mutable fmt : Format.formatter ; mutable out : out_channel option ; } let open_dot ?(name="G") ?(attr=[]) ?(file) () = let file = match file with None -> name ^ ".dot" | Some f -> f in let out = open_out file in let fmt = Format.formatter_of_out_channel out in begin Format.fprintf fmt "digraph %S {@\n" name ; List.iter (fun p -> Format.fprintf fmt " %a ;@\n" pp_attr p ) attr ; Format.pp_print_flush fmt () ; { file ; fmt ; queue = Queue.create () ; indent = " " ; out = Some out ; id = 0 } end let flush dot = match dot.out with | Some out -> Format.pp_print_flush dot.fmt () ; flush out | None -> () let basename f = if Filename.check_suffix f ".dot" then Filename.chop_suffix f ".dot" else f let installed = ref None let is_dot_installed () = match !installed with | Some s -> s | None -> let s = (Sys.command "dot -V" = 0) in installed := Some s ; s let close dot = match dot.out with | None -> () | Some out -> begin Format.fprintf dot.fmt "}@." ; dot.fmt <- Format.err_formatter ; Pervasives.flush out ; close_out out ; dot.out <- None ; end let layout ?(force=false) ?(target="pdf") ?(engine="dot") ?output dot = begin if dot.out <> None then raise (Invalid_argument "DotGraph: not closed") ; let input = dot.file in let output = match output with Some f -> f | None -> Printf.sprintf "%s.%s" (basename dot.file) target in let cmd = Printf.sprintf "dot -K%s -T%s %s -o %s" engine target input output in let status = Sys.command cmd in if status=0 then output else if force then let msg = Printf.sprintf "dot failed with status %d" status in raise (Invalid_argument msg) else dot.file end let printf dot msg = Format.fprintf dot.fmt msg let println dot msg = Format.kfprintf (fun fmt -> Format.pp_print_newline fmt ()) dot.fmt msg let push dot f = Queue.push f dot.queue let pop_all dot = while not (Queue.is_empty dot.queue) do (Queue.pop dot.queue) () done (* -------------------------------------------------------------------------- *) (* --- Nodes and Edges --- *) (* -------------------------------------------------------------------------- *) type node = string let fresh ?(prefix="_") dot = let k = dot.id in dot.id <- succ k ; Printf.sprintf "%s%03d" prefix k let pp_node = Format.pp_print_string let pp_edge fmt (a,b) = Format.fprintf fmt "%s -> %s" a b let pp_stmt dot pp stmt attr = Format.fprintf dot.fmt "%s@[@[%a [%a@]@ ]@];@." dot.indent pp stmt pp_attributes attr let inode dot ?prefix ?id attr = let a = match id with Some a -> a | None -> fresh ?prefix dot in pp_stmt dot pp_node a attr ; a let node_default dot attr = pp_stmt dot pp_node "node" attr let edge_default dot attr = pp_stmt dot pp_node "edge" attr let node dot id attr = ignore (inode dot ~id attr) let edge dot a b attr = if attr = [] then Format.fprintf dot.fmt "%s%a ;@." dot.indent pp_edge (a,b) else pp_stmt dot pp_edge (a,b) attr let link dot ps attr = let rec walk dot attr p = function | q :: ps -> edge dot p q attr ; walk dot attr q ps | [] -> () in match ps with | p :: ps -> walk dot attr p ps | [] -> () (* -------------------------------------------------------------------------- *) (* --- Clustering --- *) (* -------------------------------------------------------------------------- *) let rank dot nodes = begin Format.fprintf dot.fmt "%s@[{ rank=same;" dot.indent ; List.iter (Format.fprintf dot.fmt "@ %s;") nodes ; Format.fprintf dot.fmt "@ }@]@\n" ; end let subgraph dot ?(cluster=true) attr content = begin let k = dot.id in dot.id <- succ k ; let indent = dot.indent in Format.fprintf dot.fmt "%ssubgraph %s%d {@\n" indent (if cluster then "cluster" else "g") k ; List.iter (fun a -> Format.fprintf dot.fmt "%s %a;@\n" indent pp_attr a) attr ; dot.indent <- indent ^ " " ; content () ; dot.indent <- indent ; Format.fprintf dot.fmt "%s}@\n" indent ; end type record = [ | `Empty | `Hbox of record list | `Vbox of record list | `Label of string | `Port of string * link list * string ] and link = string * attr list * node let port a b = if b <> "" then Printf.sprintf "%s:%s" a b else a module Record = struct let hbox = function `Empty -> [] | `Hbox hs -> hs | h -> [h] let vbox = function `Empty -> [] | `Vbox vs -> vs | v -> [v] let (<->) a b = `Vbox (vbox a @ vbox b) let (<|>) a b = `Hbox (hbox a @ hbox b) let link ?(anchor="") ?(attr=[]) node : link = anchor,attr,node let label ?(port="") ?(link=[]) txt : record = if port="" && link=[] then `Label txt else `Port(port,link,txt) end type env = { buffer : Buffer.t ; mutable links : (string * (string * attr list * node) list) list ; mutable port : int ; } let rec mk_record env hv = function | `Empty -> () | `Label txt -> Buffer.add_string env.buffer txt | `Port(port,links,txt) -> if links <> [] then let port = if port = "" then let p = env.port in env.port <- succ p ; Printf.sprintf "_p%d" p else port in env.links <- (port,links) :: env.links ; Printf.bprintf env.buffer "<%s> %s" port txt | `Hbox rs -> mk_box env hv true rs | `Vbox rs -> mk_box env hv false rs and mk_box env hv hb = function | [] -> () | r::rs -> begin let buffer = env.buffer in let boxed = hv <> hb in let hv = not hv in if boxed then Buffer.add_char buffer '{' ; mk_record env hv r ; List.iter (fun r -> Buffer.add_char buffer '|' ; mk_record env hv r ) rs ; if boxed then Buffer.add_char buffer '}' ; end let irecord dot ?prefix ?id ?(rounded=false) ?(attr=[]) (box : record) = let shape = if rounded then "Mrecord" else "record" in let env = { buffer = Buffer.create 80 ; links = [] ; port = 1 } in mk_record env true box ; let label = Buffer.contents env.buffer in let node = inode dot ?prefix ?id (`Shape shape :: `Label label :: attr) in List.iter (fun (name,links) -> List.iter (fun (anchor,attr,target) -> edge dot (port (port node name) anchor) target attr ) links ) env.links ; node let record dot node ?rounded ?attr box = ignore (irecord dot ~id:node ?rounded ?attr box) (* -------------------------------------------------------------------------- *) (* --- Indexing --- *) (* -------------------------------------------------------------------------- *) module type Map = sig type key type 'a t val empty : 'a t val find : key -> 'a t -> 'a val add : key -> 'a -> 'a t -> 'a t end let kp = ref 0 module Node(M : Map) = struct type t = M.key let kid = ref 0 let prefix = ref None let skip _ _ = () let once = ref skip let index : node M.t ref = ref M.empty let get_prefix () = match !prefix with Some p -> p | None -> let k = !kp in incr kp ; let p = if k < 26 then String.make 1 (char_of_int (int_of_char 'A' + k)) else Printf.sprintf "A%d_" k in prefix := Some p ; p let get a = try M.find a !index with Not_found -> let k = !kid in incr kid ; let prefix = get_prefix () in let node = Printf.sprintf "%s%03d" prefix k in index := M.add a node !index ; !once a node ; node let node dot a attr = node dot (get a) attr let inode dot a attr = inode dot ~id:(get a) attr let record dot a ?rounded ?attr box = record dot (get a) ?rounded ?attr box let irecord dot a ?rounded ?attr box = irecord dot ~id:(get a) ?rounded ?attr box let prefix p = prefix := Some p let once f = once := f let push dot f = once (fun a n -> push dot (fun () -> f a n)) let clear () = index := M.empty ; kid := 0 ; once skip end (* -------------------------------------------------------------------------- *) (* --- Decorator --- *) (* -------------------------------------------------------------------------- *) type buffer = { label : Buffer.t ; mutable attributes : attr list ; } let apply_label buffer = function | `Label txt -> let buf = buffer.label in Buffer.add_string buf txt ; true | _ -> false let apply buffer a = if not (apply_label buffer a) then let name = fst (attr a) in let filter name a = fst (attr a) <> name in buffer.attributes <- a :: List.filter (filter name) buffer.attributes let add_attr buffer a = List.iter (apply buffer) a let buffer attr = let buffer = { label = Buffer.create 20 ; attributes = [] } in add_attr buffer attr ; buffer let add_char buffer = Buffer.add_char buffer.label let add_label buffer = Buffer.add_string buffer.label let bprintf buffer msg = let fmt = Format.formatter_of_buffer buffer.label in Format.kfprintf (fun fmt -> Format.pp_print_flush fmt ()) fmt msg let attributes buffer = let label = Buffer.contents buffer.label in `Label label :: List.rev buffer.attributes let add_options buffer options = List.iter (fun (b,a) -> if b then add_attr buffer a) options let decorate attr options = let buffer = buffer attr in add_options buffer options ; attributes buffer (* -------------------------------------------------------------------------- *) frama-c-20.0-Calcium/src/libraries/utils/dotgraph.mli0000666000000000000000000002223513571573400017435 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Helper for Printing Dot-graphs. This module provides smart-constructors for constructing Dot input files. Basically, a [dot] object is a buffer to a [] on disk where smart constructors write Dot statements. Once the [] has been created, it is possible to layout it by running the [dot] command with various engines. Typically, let say you have a graph with nodes of type [M.elt] with [M : Map.S] and assumes the graph is stored as a map [graph : M.elt list M.t] with [roots : M.elt list] then you can use: {[ let module G = Dotgraph in let module N = G.Node(M) in begin let dot = G.open_dot ~name:"mygraph" () in (* For each generated node, declare it and link to its children. *) N.push dot (fun a -> let na = N.inode dot a in try List.iter (fun b -> G.link dot na (N.get b)) (M.find a graph) with Not_found -> ()) ; (* Starts by emitting roots *) List.iter (fun r -> ignore (N.get r)) roots ; (* Proceeds to the traversal *) G.pop_all dot ; (* You may then complete your graph with other decorations after the traversal... *) G.close dot ; (* Now call the layout engine, if installed. *) G.layout dot ~format:"pdf" () ; end ]} *) open Pretty_utils (** {1 Attributes} *) type attr = [ | `LR | `TB | `Label of string | `Color of string | `Fillcolor of string | `Shape of string | `Style of string | `Circle | `Box | `Oval | `Point | `Dotted | `Filled | `ArrowBoth | `ArrowBack | `ArrowForward | `ArrowHead of string | `ArrowTail of string | `Attr of string * string ] val pp_attr : Format.formatter -> attr -> unit (** {1 Dot Ouput} *) type dot (** Buffer to a [dot] file with a graph environment (nodes, edges, etc.) *) val open_dot : ?name:string -> ?attr:attr list -> ?file:string -> unit -> dot val close : dot -> unit val is_dot_installed : unit -> bool (** Memoized *) val layout : ?force:bool -> ?target:string -> ?engine:string -> ?output:string -> dot -> string (** Invoke [dot] command (if installed) with specified target and engine. Defaults are [~force:false], [~target:"pdf"], [~engine:"dot"]. The [dot] buffer must be {i closed} before being laid out, although you can invoke several layouts. Output is stored in [~output] or in a filename derived from the one of [dot]. The function returns the generated output file. @raise Invalid_argument if [dot] buffer is not closed, or when [dot] command fails and [~force:true] (not by default). *) val printf : dot -> ('a,Format.formatter,unit,unit) format4 -> 'a (** Low-level routine to directly write material in the [dot] file *) val println : dot -> ('a,Format.formatter,unit,unit) format4 -> 'a (** Low-level routine to directly write material with an end-of-line (["\n"]) in the [dot] file *) val flush : dot -> unit (** Flushes the [dot] file buffer to disk. *) (** {1 Nodes and Edges} *) type node (** Set default node attributes *) val node_default : dot -> attr list -> unit (** Set default edge attributes *) val edge_default : dot -> attr list -> unit (** Create a fresh node identifier *) val fresh : ?prefix:string -> dot -> node val pp_node : node formatter val pp_edge : (node * node) formatter (** [a -> b] *) (** Set attributes to node *) val node : dot -> node -> attr list -> unit (** Create an edge with attributes *) val edge : dot -> node -> node -> attr list -> unit (** Link the node sequence with attributed edges *) val link : dot -> node list -> attr list -> unit (** Combinaison of [fresh] and [node] *) val inode : dot -> ?prefix:string -> ?id:node -> attr list -> node (** {1 Clustering} *) val rank : dot -> node list -> unit (** Layout nodes at the same rank *) val subgraph : dot -> ?cluster:bool -> attr list -> (unit -> unit) -> unit (** The continuation shall add the graph content in the [dot] file. Clustering is true by default *) type record = [ | `Empty | `Hbox of record list | `Vbox of record list | `Label of string | `Port of string * link list * string (** Port with output edges to other nodes. Use [Record.link] and [Record.label] smart-constructors to create complex ports. *) ] and link = string * attr list * node (** Complex node layout. Smart constructors to create records. *) module Record : sig val (<->) : record -> record -> record val (<|>) : record -> record -> record val link : ?anchor:string -> ?attr:attr list -> node -> link val label : ?port:string -> ?link:link list -> string -> record end (** Create a port to a node, and returns the associated pseudo-node so you can link an edge to it. *) val port : node -> string -> node (** Define the node to be a record *) val record : dot -> node -> ?rounded:bool -> ?attr:attr list -> record -> unit (** Create a new node from a record (combines [fresh] and [record]) *) val irecord : dot -> ?prefix:string -> ?id:node -> ?rounded:bool -> ?attr:attr list -> record -> node (** {1 Node Indexing} *) module type Map = sig type key type 'a t val empty : 'a t val find : key -> 'a t -> 'a val add : key -> 'a -> 'a t -> 'a t end (** Lazily associates a node to any element. *) module Node(M : Map) : sig type t = M.key val get : t -> node val node : dot -> t -> attr list -> unit val inode : dot -> t -> attr list -> node val record : dot -> t -> ?rounded:bool -> ?attr:attr list -> record -> unit val irecord : dot -> t -> ?rounded:bool -> ?attr:attr list -> record -> node val clear : unit -> unit (** Executes the callback {i once} for all created nodes. Any previously registered callback by [once] or [push] is replaced by the new one. {b Warning:} the callback is executed as soon as [get] is called for the first time, possibly interfering with your current output on a [dot] buffer. To insert additional Dot material with a callback, use [push] instead. *) val once : (t -> node -> unit) -> unit (** Pushes the callback {i once} for all created nodes. You must call [pop_call] at some point to flush them. Any previsously registred callback by [once] or [push] is replaced by the new one. *) val push : dot -> (t -> node -> unit) -> unit (** Set node prefix. Otherwize, some default one is created for each functor application. *) val prefix : string -> unit end (** Register a continuation to be executed later. *) val push : dot -> (unit -> unit) -> unit (** Flushes all pending continuations. *) val pop_all : dot -> unit (** {1 Decorator} *) (** A text buffer to compose labels and attributes. You can add text and attributes to the buffer, and finally flush it by calling [attributes]. A single [`Label] attribute is finally emitted with all the added text (if non-empty). *) type buffer (** Create a buffer initialized with the given attributes. *) val buffer : attr list -> buffer (** Add text material to buffer label. *) val bprintf : buffer -> ('a,Format.formatter,unit,unit) format4 -> 'a val add_char : buffer -> char -> unit val add_label : buffer -> string -> unit (** Add attributes to the buffer. *) val add_attr : buffer -> attr list -> unit (** Only add attributes with a [true] boolean flag *) val add_options : buffer -> (bool * attr list) list -> unit (** Flushes the buffer into a list of attributes *) val attributes : buffer -> attr list (** Concat the attributes with flagged ones *) val decorate : attr list -> ( bool * attr list ) list -> attr list frama-c-20.0-Calcium/src/libraries/utils/escape.ml0000666000000000000000000001311113571573400016705 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (** OCaml types used to represent wide characters and strings *) type wchar = int64 type wstring = wchar list let escape_char_internal maybe_trigraph = function | '\007' -> maybe_trigraph := false; "\\a" | '\b' -> maybe_trigraph := false; "\\b" | '\t' -> maybe_trigraph := false; "\\t" | '\n' -> maybe_trigraph := false; "\\n" | '\011' -> maybe_trigraph := false; "\\v" | '\012' -> maybe_trigraph := false; "\\f" | '\r' -> maybe_trigraph := false; "\\r" | '"' -> maybe_trigraph := false; "\\\"" | '\'' -> maybe_trigraph := false; "\\'" | '\\' -> maybe_trigraph := false; "\\\\" | '?' -> let s = if !maybe_trigraph then "\\?" else "?" in maybe_trigraph := true; s | ' ' .. '~' as printable -> maybe_trigraph := false; String.make 1 printable | unprintable -> maybe_trigraph := false; Printf.sprintf "\\%03o" (Char.code unprintable) let escape_char c = let r = ref false in escape_char_internal r c let escape_string str = let length = String.length str in let buffer = Buffer.create length in let maybe_trigraph = ref false in for index = 0 to length - 1 do Buffer.add_string buffer (escape_char_internal maybe_trigraph (String.get str index)) done; Buffer.contents buffer (* a wide char represented as an int64 *) let escape_wchar = (* limit checks whether upper > probe *) let limit upper probe = (Int64.to_float (Int64.sub upper probe)) > 0.5 in let fits_byte = limit (Int64.of_int 0x100) in let fits_octal_escape = limit (Int64.of_int 0o1000) in let fits_universal_4 = limit (Int64.of_int 0x10000) in let fits_universal_8 = limit (Int64.of_string "0x100000000") in fun charcode -> if fits_byte charcode then escape_char (Char.chr (Int64.to_int charcode)) else if fits_octal_escape charcode then Printf.sprintf "\\%03Lo" charcode else if fits_universal_4 charcode then Printf.sprintf "\\u%04Lx" charcode else if fits_universal_8 charcode then Printf.sprintf "\\u%04Lx" charcode else invalid_arg "Cprint.escape_string_intlist" (* a wide string represented as a list of int64s *) let escape_wstring (str : int64 list) = let length = List.length str in let buffer = Buffer.create length in let append charcode = let addition = escape_wchar charcode in Buffer.add_string buffer addition in List.iter append str; Buffer.contents buffer frama-c-20.0-Calcium/src/libraries/utils/escape.mli0000666000000000000000000001222713571573400017065 0ustar (****************************************************************************) (* *) (* Copyright (C) 2001-2003 *) (* George C. Necula *) (* Scott McPeak *) (* Wes Weimer *) (* Ben Liblit *) (* All rights reserved. *) (* *) (* Redistribution and use in source and binary forms, with or without *) (* modification, are permitted provided that the following conditions *) (* are met: *) (* *) (* 1. Redistributions of source code must retain the above copyright *) (* notice, this list of conditions and the following disclaimer. *) (* *) (* 2. Redistributions in binary form must reproduce the above copyright *) (* notice, this list of conditions and the following disclaimer in the *) (* documentation and/or other materials provided with the distribution. *) (* *) (* 3. The names of the contributors may not be used to endorse or *) (* promote products derived from this software without specific prior *) (* written permission. *) (* *) (* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *) (* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *) (* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *) (* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *) (* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *) (* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *) (* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *) (* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *) (* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *) (* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *) (* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *) (* POSSIBILITY OF SUCH DAMAGE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives) *) (* and INRIA (Institut National de Recherche en Informatique *) (* et Automatique). *) (****************************************************************************) (* * * Copyright (c) 2003, * Ben Liblit * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. The names of the contributors may not be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *) (* * Character and string escaping utilities *) (** OCaml types used to represent wide characters and strings *) type wchar = int64 type wstring = wchar list (** escape various constructs in accordance with C lexical rules *) val escape_char : char -> string val escape_string : string -> string val escape_wchar : wchar -> string val escape_wstring : wstring -> string frama-c-20.0-Calcium/src/libraries/utils/filepath.ml0000666000000000000000000002114513571573400017247 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type path = { hash : int ; path_name : string ; base_name : string ; (* Filename.basename *) dir : path option ; (* path whose path_name is Filename.dirname *) mutable symbolic_name : string option ; (* Symbolic name *) } let dummy = { path_name = ""; hash = 0; base_name = "."; dir = None; symbolic_name = None } (* re_drive and re_root match drive expressions to deal with non-Cygwin Windows-like paths (e.g. with MinGW) *) let re_drive = Str.regexp "[A-Za-z]:" let re_path = Str.regexp "[/\\\\]" let re_root = Str.regexp "/\\|\\([A-Za-z]:\\\\\\)\\|\\([A-Za-z]:/\\)" (* -------------------------------------------------------------------------- *) (* --- Path Indexing --- *) (* -------------------------------------------------------------------------- *) (* Can not use Weak, since the internal [path] representation is not returned. Can not use a weak-cache because each minor GC may empty the cache (see #191). *) module HPath = struct module H = Hashtbl.Make (struct type t = path let hash p = p.hash let equal p q = p.path_name = q.path_name end) let find = H.find let create = H.create let merge h p = try H.find h p with Not_found -> H.add h p p ; p end let hcons = HPath.create 128 let cache = Array.make 256 None let root path_name = HPath.merge hcons { dummy with path_name ; hash = Hashtbl.hash path_name } let make dir base_name = let path_name = Printf.sprintf "%s/%s" dir.path_name base_name in let hash = Hashtbl.hash path_name in HPath.merge hcons { dummy with path_name; hash; base_name = base_name; dir = Some dir } let getdir path = match path.dir with | None -> dummy (* the parent of the root directory is itself *) | Some d -> d let rec norm path = function | [] -> path | ".."::ps -> norm (getdir path) ps | "."::ps -> norm path ps | p::ps -> norm (make path p) ps let insert base path_name = let full_path_name = (* if a is provided while a is already absolute (and thus matches [re_root]) then the is not taken into account *) if Str.string_match re_root path_name 0 then path_name else base.path_name ^ "/" ^ path_name in let hash = Hashtbl.hash full_path_name in match Array.get cache (hash land 255) with | Some (pn, p) when full_path_name = pn -> p | _ -> let p = { dummy with path_name = full_path_name; hash } in try HPath.find hcons p with Not_found -> let base = (* if a is provided while a is already absolute (and thus matches [re_root]) then the is not taken into account *) if Str.string_match re_root path_name 0 then root (String.sub path_name 0 (Str.group_end 0 - 1)) else base in let name_parts = Str.split re_path path_name in (* Windows paths may start with ':'. If so, remove it *) let parts = if List.length name_parts > 0 && Str.string_match re_drive (List.nth name_parts 0) 0 then List.tl name_parts else name_parts in let path = norm base parts in Array.set cache (hash land 255) (Some (path_name, path)); path let cwd = insert dummy (Sys.getcwd()) let normalize ?base_name path_name = if path_name = "" then "" else let base = match base_name with | None -> cwd | Some b -> insert cwd b in let norm_path_name = (insert base path_name).path_name in if norm_path_name = "" then "/" else norm_path_name (* -------------------------------------------------------------------------- *) (* --- Symboling Names --- *) (* -------------------------------------------------------------------------- *) let add_symbolic_dir name dir = (insert cwd dir).symbolic_name <- Some name let rec add_path buffer path = let open Buffer in match path.symbolic_name with | None -> begin match path.dir with | None -> add_string buffer path.path_name | Some d -> if d != cwd (* hconsed *) then ( add_path buffer d ; add_char buffer '/' ) ; add_string buffer path.base_name end | Some sn -> add_string buffer sn let rec skip_dot file_name = if Extlib.string_prefix "./" file_name then skip_dot (String.sub file_name 2 (String.length file_name - 2)) else file_name let pretty file_name = if Filename.is_relative file_name then skip_dot file_name else let path = insert cwd file_name in let file_name = path.path_name in let cwd_name = cwd.path_name in if Extlib.string_prefix ~strict:true cwd_name file_name then let n = 1 + String.length cwd_name in String.sub file_name n (String.length file_name - n) else let buffer = Buffer.create 80 in add_path buffer path ; Buffer.contents buffer (* -------------------------------------------------------------------------- *) (* --- Relative Paths --- *) (* -------------------------------------------------------------------------- *) let relativize ?base_name file_name = let file_name = (insert cwd file_name).path_name in let base_name = match base_name with | None -> cwd.path_name | Some b -> (insert cwd b).path_name in if base_name = file_name then "." else let base_name = base_name ^ Filename.dir_sep in if Extlib.string_prefix base_name file_name then let n = String.length base_name in let file_name = String.sub file_name n (String.length file_name - n) in if file_name = "" then "." else file_name else file_name let is_relative ?base_name file_name = let file_name = (insert cwd file_name).path_name in let base_name = match base_name with | None -> cwd.path_name | Some b -> (insert cwd b).path_name in base_name = file_name || Extlib.string_prefix (base_name ^ Filename.dir_sep) file_name (* -------------------------------------------------------------------------- *) (* --- Normalized Typed Module --- *) (* -------------------------------------------------------------------------- *) module Normalized = struct type t = string let of_string ?base_name s = normalize ?base_name s let to_pretty_string s = pretty s let equal : t -> t -> bool = (=) let compare = String.compare let compare_pretty ?(case_sensitive=false) s1 s2 = let s1 = pretty s1 in let s2 = pretty s2 in if case_sensitive then String.compare s1 s2 else Extlib.compare_ignore_case s1 s2 let pretty fmt p = Format.fprintf fmt "%s" (pretty p) let pp_abs fmt p = Format.fprintf fmt "%s" p let unknown = normalize "" let is_unknown fp = equal fp unknown end type position = { pos_path : Normalized.t; pos_lnum : int; pos_bol : int; pos_cnum : int; } let pp_pos fmt pos = Format.fprintf fmt "%a:%d" Normalized.pretty pos.pos_path pos.pos_lnum (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/filepath.mli0000666000000000000000000001423413571573400017421 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Functions manipulating filepaths. In these functions, references to the current working directory refer to the result given by function Sys.getcwd. NOTE: Prefer using the [Normalized] module whenever possible. *) (** Returns an absolute path leading to the given file. The result is similar to [realpath --no-symlinks]. Some special behaviors include: - [normalize ""] (empty string) returns "" (realpath returns an error); - [normalize] preserves multiple sequential '/' characters, unlike [realpath]; - non-existing directories in [realpath] may lead to ENOTDIR errors, but [normalize] may accept them. @modify Aluminium-20160501 optional base_name. *) val normalize: ?base_name:string -> string -> string (** [relativize base_name file_name] returns a relative path name of [file_name] w.r.t. [base_name], if [base_name] is a prefix of [file]; otherwise, returns [file_name] unchanged. The default base name is the current working directory name. @since Aluminium-20160501 *) val relativize: ?base_name:string -> string -> string (** returns true if the file is relative to [base] (that is, it is prefixed by [base_name]), or to the current working directory if no base is specified. @since Aluminium-20160501 *) val is_relative: ?base_name:string -> string -> bool (** DEPRECATED: use [Normalized.to_pretty_string] instead. Pretty-print a path according to these rules: - relative filenames are kept, except for leading './', which are stripped; - absolute filenames are relativized if their prefix is included in the current working directory; also, symbolic names are resolved, i.e. the result may be prefixed by known aliases (e.g. FRAMAC_SHARE). See {!add_symbolic_dir} for more details. Therefore, the result of this function may not designate a valid name in the filesystem. @since Neon-20140301 @deprecated since 18.0-Argon *) val pretty: string -> string [@@deprecated "Use Filepath.Normalized.to_pretty_string instead."] (** [add_symbolic_dir name dir] indicates that the (absolute) path [dir] must be replaced by [name] when pretty-printing paths. This alias ensures that system-dependent paths such as FRAMAC_SHARE are printed identically in different machines. *) val add_symbolic_dir: string -> string -> unit (** The [Normalized] module is simply a wrapper that ensures that paths are always normalized. Used by [Datatype.Filepath]. @since 18.0-Argon *) module Normalized: sig (** The normalized (absolute) path. *) type t = private string (** [of_string s] converts [s] into a normalized path. @raise Invalid_argument if [s] is the empty string. *) val of_string: ?base_name:string -> string -> t (** [to_pretty_string p] returns [p] prettified, that is, a relative path-like string. Note that this prettified string may contain symbolic dirs and is thus is not a path. See [pretty] for details about usage. *) val to_pretty_string: t -> string val equal: t -> t -> bool (** Compares normalized paths *) val compare: t -> t -> int (** Compares prettified (i.e. relative) paths, with or without case sensitivity (by default, [case_sensitive = false]). *) val compare_pretty : ?case_sensitive:bool -> t -> t -> int (** Pretty-print a path according to these rules: - relative filenames are kept, except for leading './', which are stripped; - absolute filenames are relativized if their prefix is included in the current working directory; also, symbolic names are resolved, i.e. the result may be prefixed by known aliases (e.g. FRAMAC_SHARE). See {!add_symbolic_dir} for more details. Therefore, the result of this function may not designate a valid name in the filesystem and must ONLY be used to pretty-print information; it must NEVER to be converted back to a filepath later. *) val pretty: Format.formatter -> t -> unit (** Pretty-prints the normalized (absolute) path. *) val pp_abs: Format.formatter -> t -> unit (** Unknown filepath, used as 'dummy' for [Datatype.Filepath]. *) val unknown: t (** @since 20.0-Calcium *) val is_unknown: t -> bool end (** Describes a position in a source file. @since 18.0-Argon *) type position = { pos_path : Normalized.t; pos_lnum : int; pos_bol : int; pos_cnum : int; } (** Pretty-prints a position, in the format file:line. @since 18.0-Argon *) val pp_pos : Format.formatter -> position -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/floating_point.ml0000666000000000000000000003713713571573400020477 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type c_rounding_mode = FE_ToNearest | FE_Upward | FE_Downward | FE_TowardZero let string_of_c_rounding_mode = function | FE_ToNearest -> "FE_NEAREST" | FE_Upward -> "FE_UPWARD" | FE_Downward -> "FE_DOWNWARD" | FE_TowardZero -> "FE_TOWARDZERO" (* replace "noalloc" with [@@noalloc] for OCaml version >= 4.03.0 *) [@@@ warning "-3"] external set_round_downward: unit -> unit = "set_round_downward" "noalloc" external set_round_upward: unit -> unit = "set_round_upward" "noalloc" external set_round_nearest_even: unit -> unit = "set_round_nearest_even" "noalloc" external set_round_toward_zero : unit -> unit = "set_round_toward_zero" "noalloc" external get_rounding_mode: unit -> c_rounding_mode = "get_rounding_mode" "noalloc" external set_rounding_mode: c_rounding_mode -> unit = "set_rounding_mode" "noalloc" [@@@ warning "+3"] external round_to_single_precision_float: float -> float = "round_to_float" external sys_single_precision_of_string: string -> float = "single_precision_of_string" (* TODO two functions above: declare "float", must have separate version for bytecode, see OCaml manual *) let max_single_precision_float = Int32.float_of_bits 0x7f7fffffl let most_negative_single_precision_float = -. max_single_precision_float type parsed_float = { f_nearest : float ; f_lower : float ; f_upper : float ; } let inf ~man_size ~max_exp = let biggest_not_inf = ldexp (2.0 -. ldexp 1.0 (~- man_size)) max_exp in { f_lower = biggest_not_inf ; f_nearest = infinity ; f_upper = infinity ; } (* [s = num * 2^exp / den] hold *) let make_float ~num ~den ~exp ~man_size ~min_exp ~max_exp = assert (Integer.gt num Integer.zero); assert (Integer.gt den Integer.zero); (* Format.printf "make_float: num den exp:@\n%a@\n@\n%a@\n@\n%d@.min_exp:%d max_exp:%d@." Datatype.Integer.pretty num Datatype.Integer.pretty den exp min_exp max_exp; *) let size_bi = Integer.of_int man_size in let ssize_bi = Integer.of_int (succ man_size) in let min_exp = min_exp - man_size in let den = ref den in let exp = ref exp in while Integer.ge num (Integer.shift_left !den ssize_bi) || !exp < min_exp do den := Integer.shift_left !den Integer.one; incr exp done; let den = !den in let shifted_den = Integer.shift_left den size_bi in let num = ref num in while Integer.lt !num shifted_den && !exp > min_exp do num := Integer.shift_left !num Integer.one; decr exp done; let num = !num in let exp = !exp in (* Format.printf "make_float2: num den exp:@\n%a@\n@\n%a@\n@\n%d@." Datatype.Integer.pretty num Datatype.Integer.pretty den exp; *) if exp > max_exp - man_size then inf ~man_size ~max_exp else let man,rem = Integer.e_div_rem num den in let rem2 = (* twice the remainder *) Integer.shift_left rem Integer.one in let man = Integer.to_int64 man in (* Format.printf "pre-round: num den man rem:@\n%a@\n@\n%a@\n@\n%Ld@\n@\n%a@." Datatype.Integer.pretty num Datatype.Integer.pretty den man Datatype.Integer.pretty rem; *) let lowb = ldexp (Int64.to_float man) exp in if Integer.is_zero rem2 then { f_lower = lowb ; f_nearest = lowb ; f_upper = lowb ; } else let upb = ldexp (Int64.to_float (Int64.succ man)) exp in if Integer.lt rem2 den || (Integer.equal rem2 den && (Int64.logand man Int64.one) = 0L) then { f_lower = lowb ; f_nearest = lowb ; f_upper = upb ; } else { f_lower = lowb ; f_nearest = upb ; f_upper = upb ; } let reg_exp = "[eE][+]?\\(-?[0-9]+\\)" let reg_dot = "[.]" let reg_numopt = "\\([0-9]*\\)" let reg_num = "\\([0-9]+\\)" let numdotfrac = Str.regexp (reg_numopt ^ reg_dot ^ reg_numopt) let numdotfracexp = Str.regexp (reg_numopt ^ reg_dot ^ reg_numopt ^ reg_exp) let numexp = Str.regexp (reg_num ^ reg_exp) exception Shortcut of parsed_float let zero = { f_lower = 0.0 ; f_nearest = 0.0 ; f_upper = 0.0 } (* [man_size] is the size of the mantissa, [min_exp] the frontier exponent between normalized and denormalized numbers *) let parse_float ~man_size ~min_exp ~max_exp s = (* Format.printf "parse: %s@." s; *) let match_exp group = let s = Str.matched_group group s in try int_of_string s with Failure _ -> (* Format.printf "Error in exponent: %s@." s; *) if s.[0] = '-' then raise (Shortcut { f_lower = 0.0 ; f_nearest = 0.0 ; f_upper = ldexp 1.0 (min_exp - man_size) ; }) else raise (Shortcut (inf ~man_size ~max_exp)) in try (* At the end of the function, [s = num * 2^exp / den] *) let num, den, exp = if Str.string_match numdotfracexp s 0 then let n = Str.matched_group 1 s in let frac = Str.matched_group 2 s in let len_frac = String.length frac in let num = Integer.of_string (n ^ frac) in let den = Integer.power_int_positive_int 5 len_frac in if Integer.is_zero num then raise (Shortcut zero); let exp10 = match_exp 3 in if exp10 >= 0 then Integer.mul num (Integer.power_int_positive_int 5 exp10), den, exp10 - len_frac else num, Integer.mul den (Integer.power_int_positive_int 5 (~- exp10)), exp10 - len_frac else if Str.string_match numdotfrac s 0 then let n = Str.matched_group 1 s in let frac = Str.matched_group 2 s in let len_frac = String.length frac in Integer.of_string (n ^ frac), Integer.power_int_positive_int 5 len_frac, ~- len_frac else if Str.string_match numexp s 0 then let n = Str.matched_group 1 s in let num = Integer.of_string n in if Integer.is_zero num then raise (Shortcut zero); let exp10 = match_exp 2 in if exp10 >= 0 then Integer.mul num (Integer.power_int_positive_int 5 exp10), Integer.one, exp10 else num, (Integer.power_int_positive_int 5 (~- exp10)), exp10 else (Format.printf "Could not parse floating point number %S@." s; assert false) in if Integer.is_zero num then zero else make_float ~num ~den ~exp ~man_size ~min_exp ~max_exp with Shortcut r -> r let is_hex s = let l = String.length s in l >= 2 && s.[0] = '0' && (s.[1] = 'x' || s.[1] = 'X') let opp_parse_float f = { f_lower = -. f.f_upper ; f_nearest = -. f.f_nearest ; f_upper = -. f.f_lower } let rec single_precision_of_string s = if s.[0] = '-' then opp_parse_float (single_precision_of_string (String.sub s 1 (String.length s - 1))) else if is_hex s then try let f = sys_single_precision_of_string s in { f_lower = f ; f_nearest = f ; f_upper = f } with Failure _ -> Kernel.fatal "could not parse single-precision float string: %s" s else (* decimal *) parse_float ~man_size:23 ~min_exp:(-126) ~max_exp:127 s (* May raise Failure("float_of_string"). *) let rec double_precision_of_string s = if s.[0] = '-' then opp_parse_float (double_precision_of_string (String.sub s 1 (String.length s - 1))) else if is_hex s then let f = float_of_string s in { f_lower = f ; f_nearest = f ; f_upper = f } else (* decimal *) parse_float ~man_size:52 ~min_exp:(-1022) ~max_exp:1023 s let parse_kind kind string = match kind with | Cil_types.FFloat -> single_precision_of_string string | Cil_types.FDouble | Cil_types.FLongDouble -> double_precision_of_string string let parse string = let l = String.length string - 1 in if l < 0 then Kernel.fatal ~current:true "Parsing an empty string as a floating-point constant." else let last = Char.uppercase_ascii string.[l] in let suffix, kind = match last with | 'F' -> true, Cil_types.FFloat | 'D' -> true, Cil_types.FDouble | 'L' -> true, Cil_types.FLongDouble | _ -> false, Cil_types.FDouble in let baseint = if suffix then String.sub string 0 l else string in try let basefloat = parse_kind kind baseint in kind, basefloat with Failure _ -> (* should never happen, suffix already stripped *) Kernel.fatal ~current:true "Unexpected error parsing floating-point constant: %s." string let pretty_normal ~use_hex fmt f = let double_norm = Int64.shift_left 1L 52 in let double_mask = Int64.pred double_norm in let i = Int64.bits_of_float f in let s = 0L <> (Int64.logand Int64.min_int i) in let i = Int64.logand Int64.max_int i in let exp = Int64.to_int (Int64.shift_right_logical i 52) in let man = Int64.logand i double_mask in let s = if s then "-" else "" in if exp = 2047 then begin if man = 0L then Format.fprintf fmt "%sinf" s else Format.fprintf fmt "NaN" end else let firstdigit, exp = if exp <> 0 then 1, (exp - 1023) else 0, -1022 in if not use_hex then begin let firstdigit, man, exp = if 0 < exp && exp <= 12 then begin Int64.to_int (Int64.shift_right_logical (Int64.logor man double_norm) (52 - exp)), Int64.logand (Int64.shift_left man exp) double_mask, 0 end else firstdigit, man, exp in let d = Int64.float_of_bits (Int64.logor 0x3ff0000000000000L man) in let d, re = if d >= 1.5 then d -. 1.5, 5000000000000000L else d -. 1.0, 0L in let d = d *. 1e16 in let decdigits = Int64.add re (Int64.of_float d) in if exp = 0 || (firstdigit = 0 && decdigits = 0L && exp = -1022) then Format.fprintf fmt "%s%d.%016Ld" s firstdigit decdigits else Format.fprintf fmt "%s%d.%016Ld*2^%d" s firstdigit decdigits exp end else Format.fprintf fmt "%s0x%d.%013Lxp%d" s firstdigit man exp let pretty fmt f = let use_hex = Kernel.FloatHex.get() in (* should always arrive here with nearest_even *) if get_rounding_mode () <> FE_ToNearest then begin Kernel.failure "pretty: rounding mode (%s) <> FE_TONEAREST" (string_of_c_rounding_mode (get_rounding_mode ())); set_round_nearest_even(); end; if use_hex || (Kernel.FloatNormal.get ()) then pretty_normal ~use_hex fmt f else begin let r = Format.sprintf "%.*g" 12 f in if (String.contains r '.' || String.contains r 'e' || String.contains r 'E') || (match classify_float f with | FP_normal | FP_subnormal | FP_zero -> false | FP_infinite | FP_nan -> true) then Format.pp_print_string fmt r else Format.fprintf fmt "%s." r end type sign = Neg | Pos exception Float_Non_representable_as_Int64 of sign (* If the argument [x] is not in the range [min_64_float, 2*max_64_float], raise Float_Non_representable_as_Int64. This is the most reasonable as a floating-point number may represent an exponentially large integer. *) let truncate_to_integer = let min_64_float = -9.22337203685477581e+18 (* Int64.to_float (-0x8000000000000000L) *) in let max_64_float = 9.22337203685477478e+18 (* let open Int64 in float_of_bits (pred (bits_of_float (to_float max_int))) *) in fun x -> let max_64_float = Extlib.id max_64_float in if x < min_64_float then raise (Float_Non_representable_as_Int64 Neg); if x > (max_64_float +. max_64_float) then raise (Float_Non_representable_as_Int64 Pos); if x <= max_64_float then Integer.of_int64 (Int64.of_float x) else Integer.add (Integer.of_int64 (Int64.of_float (x +. min_64_float))) (Integer.two_power_of_int 63) let bits_of_max_double = Integer.of_int64 (Int64.bits_of_float max_float) let bits_of_most_negative_double = Integer.of_int64 (Int64.bits_of_float (-. max_float)) (** See e.g. http://www.h-schmidt.net/FloatConverter/IEEE754.html *) let bits_of_max_float = Integer.of_int64 0x7F7FFFFFL let bits_of_most_negative_float = let v = Int64.of_int32 0xFF7FFFFFl in(* cast to int32 to get negative value *) Integer.of_int64 v external fround: float -> float = "c_round" external trunc: float -> float = "c_trunc" (** Single-precision (32-bit) functions. We round the result computed as a double, since float32 functions are rarely precise. *) external expf: float -> float = "c_expf" external logf: float -> float = "c_logf" external log10f: float -> float = "c_log10f" external powf: float -> float -> float = "c_powf" external sqrtf: float -> float = "c_sqrtf" external fmodf: float -> float -> float = "c_fmodf" external cosf: float -> float = "c_cosf" external sinf: float -> float = "c_sinf" external atan2f: float -> float -> float = "c_atan2f" (** C math-like functions *) let isnan f = match classify_float f with | FP_nan -> true | _ -> false let isfinite f = match classify_float f with | FP_nan | FP_infinite -> false | _ -> true let min_denormal = Int64.float_of_bits 1L let neg_min_denormal = -. min_denormal let min_single_precision_denormal = Int32.float_of_bits 1l let neg_min_single_precision_denormal = -. min_single_precision_denormal (* auxiliary functions for nextafter/nextafterf *) let min_denormal_float ~is_f32 = if is_f32 then min_single_precision_denormal else min_denormal let nextafter_aux ~is_f32 fincr fdecr x y = if x = y (* includes cases "(0.0, -0.0) => -0.0" and its symmetric *) then y else if isnan x || isnan y then nan else if x = 0.0 (* or -0.0 *) then if x < y then min_denormal_float is_f32 else -. (min_denormal_float is_f32) (* the following conditions might be simpler if we had unsigned ints (uint32/uint64) *) else if x = neg_infinity (* && y = neg_infinity *) then fdecr x else if (x < y && x > 0.0) || (x > y && x < 0.0) then fincr x else fdecr x let incr_f64 f = Int64.float_of_bits (Int64.succ (Int64.bits_of_float f)) let decr_f64 f = if f = infinity then max_float else Int64.float_of_bits (Int64.pred (Int64.bits_of_float f)) let incr_f32 f = if f = neg_infinity then most_negative_single_precision_float else Int32.float_of_bits (Int32.succ (Int32.bits_of_float f)) let decr_f32 f = if f = infinity then max_single_precision_float else Int32.float_of_bits (Int32.pred (Int32.bits_of_float f)) let nextafter x y = nextafter_aux ~is_f32:false incr_f64 decr_f64 x y let nextafterf x y = nextafter_aux ~is_f32:true incr_f32 decr_f32 x y (* Local Variables: compile-command: "make -C ../../.. byte" End: *) frama-c-20.0-Calcium/src/libraries/utils/floating_point.mli0000666000000000000000000001177713571573400020652 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Floating-point operations. *) (** Rounding modes defined in the C99 standard. *) type c_rounding_mode = FE_ToNearest | FE_Upward | FE_Downward | FE_TowardZero val string_of_c_rounding_mode : c_rounding_mode -> string (* replace "noalloc" with [@@noalloc] for OCaml version >= 4.03.0 *) [@@@ warning "-3"] external set_round_downward : unit -> unit = "set_round_downward" "noalloc" external set_round_upward : unit -> unit = "set_round_upward" "noalloc" external set_round_nearest_even : unit -> unit = "set_round_nearest_even" "noalloc" external set_round_toward_zero : unit -> unit = "set_round_toward_zero" "noalloc" external get_rounding_mode: unit -> c_rounding_mode = "get_rounding_mode" "noalloc" external set_rounding_mode: c_rounding_mode -> unit = "set_rounding_mode" "noalloc" [@@@ warning "+3"] external round_to_single_precision_float: float -> float = "round_to_float" val max_single_precision_float: float val most_negative_single_precision_float: float val min_denormal: float val neg_min_denormal: float val min_single_precision_denormal: float val neg_min_single_precision_denormal: float external sys_single_precision_of_string: string -> float = "single_precision_of_string" (** If [s] is parsed as [(n, l, u)], then [n] is the nearest approximation of [s] with the desired precision. Moreover, [l] and [u] are the most precise float such that [l <= s <= u], again with this precision. Consistent with [logic_real] definition in Cil_types. *) type parsed_float = { f_nearest : float ; f_lower : float ; f_upper : float ; } (** [parse s] parses [s] and returns the parsed float and its kind (single, double or long double precision) according to its suffix, if any. Strings with no suffix are parsed as double. *) val parse: string -> Cil_types.fkind * parsed_float val pretty_normal : use_hex : bool -> Format.formatter -> float -> unit val pretty : Format.formatter -> float -> unit type sign = Neg | Pos exception Float_Non_representable_as_Int64 of sign val truncate_to_integer: float -> Integer.t (** Raises [Float_Non_representable_as_Int64] if the float value cannot be represented as an Int64 or as an unsigned Int64. *) (** binary representation of -DBL_MAX and DBL_MAX as 64 bits signed integers *) val bits_of_max_double : Integer.t val bits_of_most_negative_double : Integer.t (** binary representation of -FLT_MAX and FLT_MAX as 32 bits signed integers *) val bits_of_max_float : Integer.t val bits_of_most_negative_float : Integer.t (** Rounds to nearest integer, away from zero (like round() in C). *) external fround: float -> float = "c_round" (** Rounds to integer, toward zero (like trunc() in C). *) external trunc: float -> float = "c_trunc" (** Single-precision (32-bit) floating-point wrappers *) external expf: float -> float = "c_expf" external logf: float -> float = "c_logf" external log10f: float -> float = "c_log10f" external powf: float -> float -> float = "c_powf" external sqrtf: float -> float = "c_sqrtf" external fmodf: float -> float -> float = "c_fmodf" external cosf: float -> float = "c_cosf" external sinf: float -> float = "c_sinf" external atan2f: float -> float -> float = "c_atan2f" (** Auxiliary functions similar to the ones in the C math library *) val isnan : float -> bool val isfinite : float -> bool val nextafter : float -> float -> float val nextafterf : float -> float -> float (* Local Variables: compile-command: "make -C ../../.. byte" End: *) frama-c-20.0-Calcium/src/libraries/utils/hook.ml0000666000000000000000000001336713571573400016422 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type S = sig type param type result val extend: (param -> result) -> unit val extend_once: (param -> result) -> unit val apply: param -> result val is_empty: unit -> bool val clear: unit -> unit val length: unit -> int end module type Comparable = sig type t val equal: t -> t -> bool val hash: t -> int val compare: t -> t -> int end module type S_ordered = sig include S type key type id (** identifier of the hook *) val register_key: key -> id val extend: id -> (param->result)->unit val extend_once: id -> (param->result) -> unit val add_dependency: id -> id -> unit end module type Iter_hook = S with type result = unit let add_once v queue = let already = Queue.fold (fun b v' -> b || v' == v) false queue in if not already then Queue.add v queue module Build(P:sig type t end): Iter_hook with type param = P.t = struct type param = P.t type result = unit let hooks = Queue.create () let extend f = Queue.add f hooks let extend_once f = add_once f hooks let apply arg = Queue.iter (fun f -> f arg) hooks (* [JS 06 October 2008] the following code iter in reverse order without changing the order of the queue itself. let list = ref [] in Queue.iter (fun f -> list := f :: !list) hooks; List.iter (fun f -> f arg) !list *) let is_empty () = Queue.is_empty hooks let clear () = Queue.clear hooks let length () = Queue.length hooks end module Fold(P:sig type t end): S with type param=P.t and type result = P.t = struct type param = P.t type result = P.t let hooks = Queue.create () let extend f = Queue.add f hooks let extend_once f = add_once f hooks let apply arg = Queue.fold (fun arg f -> f arg) arg hooks let is_empty () = Queue.is_empty hooks let clear () = Queue.clear hooks let length () = Queue.length hooks end module Make(X:sig end) = Build(struct type t = unit end) module Make_graph (P: sig module Id:Comparable type param type result end) = struct type key = P.Id.t type param = P.param type result = P.result module Nodes = struct type t = key * (param -> result) Queue.t let equal (id1,_) (id2,_) = P.Id.equal id1 id2 let hash (id,_) = P.Id.hash id let compare (id1,_) (id2,_) = P.Id.compare id1 id2 end module Hooks = Graph.Imperative.Digraph.Concrete(Nodes) type id = Hooks.V.t let hooks = Hooks.create () (* No find in OCamlgraph API... *) let find_vertex v1 = let module F = struct exception Found of Nodes.t end in try Hooks.iter_vertex (fun v2 -> if Nodes.equal v1 v2 then raise (F.Found v2)) hooks; raise Not_found with F.Found v -> v let register_key k = let empty_node = k, Queue.create() in try find_vertex empty_node with Not_found -> Hooks.add_vertex hooks empty_node; empty_node module Apply = Graph.Topological.Make_stable(Hooks) let extend (_,q) f = Queue.add f q let extend_once (_,q) f = add_once f q let add_dependency v1 v2 = Hooks.add_edge hooks v1 v2 let empty_nodes () = let module F = struct exception Full end in let empty_node (_,q) = if not (Queue.is_empty q) then raise F.Full in try Hooks.iter_vertex empty_node hooks; true with F.Full -> false let is_empty () = Hooks.is_empty hooks || empty_nodes () let clear () = Hooks.clear hooks let length () = Hooks.fold_vertex (fun (_,q) l -> Queue.length q + l) hooks 0 end module Build_ordered (P: sig module Id:Comparable type t end): S_ordered with type key = P.Id.t and type param = P.t and type result = unit = struct include Make_graph( struct module Id = P.Id type param = P.t type result = unit end) let apply v = let apply_queue (_,q) = Queue.iter (fun f -> f v) q in Apply.iter apply_queue hooks end module Make_ordered(P: sig module Id:Comparable end) = Build_ordered(struct include P type t = unit end) module Fold_ordered(P: sig module Id:Comparable type t end) = struct include Make_graph( struct module Id = P.Id type param = P.t type result = P.t end) let apply v = let apply_queue (_,q) v = Queue.fold (fun v f -> f v) v q in Apply.fold apply_queue hooks v end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/hook.mli0000666000000000000000000001052713571573400016566 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Hook builder. A hook is a bunch of functions which can be extended and applied at any program point. *) (** Output signature. *) module type S = sig type param (** Type of the parameter of the functions registered in the hook. *) type result (** Type of the result of the functions. result can be unit (for iterative hooks) or param (for folding hooks) *) val extend: (param -> result) -> unit (** Add a new function to the hook. @modify Oxygen-20120901 no more [once] optional arg (see [extend_once]) *) val extend_once: (param -> result) -> unit (** Same as [extend], but the hook is added only if it is not already present; the comparison is made using [(==)] @since Oxygen-20120901 *) val apply: param -> result (** Apply all the functions of the hook on the given parameter. These functions are applied from the least recently entered to the most recently entered.*) val is_empty: unit -> bool (** Is no function already registered in the hook? *) val clear: unit -> unit (** Clear the hook. *) val length: unit -> int (** Number of registered functions. *) end module type Comparable = sig type t val equal: t -> t -> bool val hash: t -> int val compare: t -> t -> int end (** hook with a notion of priority. @since Neon-20140301 *) module type S_ordered = sig include S type key type id val register_key: key -> id val extend: id -> (param->result)->unit val extend_once: id -> (param->result) -> unit val add_dependency: id -> id -> unit (** [add_dependency hook1 hook2] indicates that [hook1] must be executed before [hook2]. In case of a cycle, all hooks will be executed, but an arbitrary order will be chosen among the elements of the cycle. *) end module type Iter_hook = S with type result = unit (** Make a new empty hook from a given type of parameters. *) module Build(P:sig type t end) : Iter_hook with type param = P.t (** Make a new empty hook from [unit]. *) module Make(X:sig end) : S with type param = unit and type result = unit module Fold(P: sig type t end): S with type param = P.t and type result = P.t (** @since Neon-20140301 *) module Build_ordered (P: sig module Id:Comparable type t end): S_ordered with type key = P.Id.t and type param = P.t and type result = unit (** @since Neon-20140301 *) module Make_ordered(P:sig module Id:Comparable end): S_ordered with type key = P.Id.t and type param = unit and type result = unit (** @since Neon-20140301 *) module Fold_ordered(P: sig module Id:Comparable type t end): S_ordered with type key = P.Id.t and type param = P.t and type result = P.t (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/hptmap.ml0000666000000000000000000013767713571573400016766 0ustar (**************************************************************************) (* *) (* This file was originally part of Menhir *) (* *) (* François Pottier and Yann Régis-Gianas, INRIA Rocquencourt *) (* *) (* Copyright 2005 Institut National de Recherche en Informatique et *) (* en Automatique. All rights reserved. This file is distributed *) (* under the terms of the Q Public License version 1.0, with the *) (* change described in the file licenses/Q_MODIFIED_LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* Set to true to see which caches are created *) let debug_cache = false type prefix = int * int let sentinel_prefix = (-1) , (-1) module Big_Endian = struct type mask = int (* The ``relevant'' bits in an integer [i] are those which are found (strictly) to the left of the single one bit in the mask [m]. We keep these bits, and set all others to 0. Okasaki uses a different convention, which allows big-endian Patricia trees to masquerade as binary search trees. This feature does not seem to be useful here. *) let mask i m = i land (lnot (2*m-1)) (* The smaller [m] is, the more bits are relevant. *) let shorter (m:int) (n:int) = m > n (* Returns a mask for the highest bit differing between [p0] and [p1]. *) let branching_bit p0 p1 = (* We want to compute the leftmost bit set in [v]; let's call it [i]. *) let v = p0 lxor p1 in (* Set all bits to the right of [i] in [v]; note that [i] is already set. *) let v = v lor (v lsr 1) in (* Now the 2 bits starting from [i] are set: [v] is 0-011?-?. *) let v = v lor (v lsr 2) in (* Now the 4 bits starting from [i] are set: [v] is 0-01111?-?. Etc. *) let v = v lor (v lsr 4) in let v = v lor (v lsr 8) in let v = v lor (v lsr 16) in let v = if Sys.int_size > 32 then v lor (v lsr 32) else v in (* All bits at the right of [i] are set: [v] is 0-011-1. Gets the highest bit set in [v]. *) (succ v) lsr 1 end (*i ------------------------------------------------------------------------ i*) (*s \mysection{Patricia-tree-based maps} *) module Tag_comp : sig type t val get_tag : t -> int val get_comp : t -> bool val encode : int -> bool -> t val pretty: Format.formatter -> t -> unit end = struct type t = int let get_tag x = x land max_int let get_comp x = x < 0 let encode tag comp = if comp then tag lor min_int else tag let pretty fmt x = Format.fprintf fmt "%x" x end type tag = Tag_comp.t module Comp_unused = struct let e = false let f _ _ = false let compose _ _ = false end type ('key, 'value) tree = | Empty | Leaf of 'key * 'value * tag | Branch of int (** prefix *) * Big_Endian.mask * ('key, 'value) tree * ('key, 'value) tree * tag let id tr = match tr with | Empty -> 0 | Leaf (_, _, tag) | Branch (_, _, _, _, tag) -> Tag_comp.get_tag tag let hash_generic = id module type Id_Datatype = sig include Datatype.S val id: t -> int end module type V = sig include Datatype.S val pretty_debug: t Pretty_utils.formatter end module Shape(Key: Id_Datatype) = struct type 'b t = (Key.t, 'b) tree let compare_v cmp t1 t2 = match t1, t2 with | Empty, Empty -> 0 | Empty, _ -> -1 | _, Empty -> 1 | Leaf (k1,x1,_), Leaf (k2,x2,_) -> let c = Key.compare k1 k2 in if c <> 0 then c else cmp x1 x2 | Leaf _, Branch _ -> -1 | Branch _, Leaf _ -> 1 | Branch (_p1,_m1,_l1,_r1,t1), Branch (_p2,_m2,_l2,_r2,t2) -> let t1 = Tag_comp.get_tag t1 in let t2 = Tag_comp.get_tag t2 in Datatype.Int.compare t1 t2 (* Taken and adapted from JCF code for the implementation without tag *) (*let c = Datatype.Int.compare p1 p2 in if c <> 0 then c else let c = Big_endian.compare m1 m2 in if c <> 0 then c else let c = compare l1 l2 in if c <> 0 then c else compare r1 r2 *) let compare = if Key.compare == Datatype.undefined then begin Cmdline.Kernel_log.debug "%s shape, missing comparison function" (Type.name Key.ty); Datatype.undefined end else compare_v let rec iter f htr = match htr with | Empty -> () | Leaf (key, data, _) -> f key data | Branch (_, _, tree0, tree1, _tl) -> iter f tree0; iter f tree1 let pretty pretty_value fmt tree = Pretty_utils.pp_iter2 ~pre:"@[{[ " ~suf:" ]}@]" ~sep:"@ " ~between:" -> " iter Key.pretty (fun fmt v -> Format.fprintf fmt "@[%a@]" pretty_value v) fmt tree let hash = hash_generic let equal = ( == ) end module Make (Key: Id_Datatype) (V : V) (Compositional_bool : sig val e: bool val f : Key.t -> V.t -> bool val compose : bool -> bool -> bool end) (Initial_Values: sig val v : (Key.t * V.t) list list end) (Datatype_deps: sig val l : State.t list end) = struct type key = Key.t type v = V.t module Shape = Shape(Key) type 'a shape = 'a Shape.t type prefix = int * int (* A tree is either empty, or a leaf node, containing both the integer key and a piece of data, or a binary node. Each binary node carries two integers. The first one is the longest common prefix of all keys in this sub-tree. The second integer is the branching bit. It is an integer with a single one bit (i.e. a power of 2), which describes the bit being tested at this node. *) type t = (Key.t, V.t) tree type hptmap = t (* Alias needed later *) let rec pretty_debug fmt = function | Empty -> Format.fprintf fmt "Empty" | Leaf (k, v, comp) as t -> Format.fprintf fmt "L@[@[(A %x, T %a)@]@ @[(AK %x)%a@]@ @[ -> (AV %x)@]@ @[%a@]@]" (Extlib.address_of_value t) Tag_comp.pretty comp (Extlib.address_of_value k) Key.pretty k (Extlib.address_of_value v) V.pretty_debug v | Branch (prefix, mask, t1, t2, tag) as t -> Format.fprintf fmt "B@[@[(A %x, T %a, P %x, M %x)@]@ @[%a@]@ @[ %a@]@]" (Extlib.address_of_value t) Tag_comp.pretty tag prefix mask pretty_debug t1 pretty_debug t2 let compare = if V.compare == Datatype.undefined then begin Cmdline.Kernel_log.debug "(%s, %s) ptmap, missing comparison function" (Type.name Key.ty) (Type.name V.ty); Datatype.undefined end else Shape.compare V.compare let compositional_bool t = match t with Empty -> Compositional_bool.e | Leaf (_,_,tc) | Branch (_,_,_,_,tc) -> Tag_comp.get_comp tc let rec min_binding t = match t with Empty -> raise Not_found | Branch (_,_,left,_,_) -> min_binding left | Leaf (key, data, _) -> key, data let rec max_binding t = match t with Empty -> raise Not_found | Branch (_,_,_,right,_) -> max_binding right | Leaf (key, data, _) -> key, data let iter = Shape.iter let pretty = Shape.pretty V.pretty let empty = Empty (* Tags must be > 0, as we use 0 for the id of Empty. *) let current_tag_before_initial_values = 1 let current_tag = ref current_tag_before_initial_values let initial_values = let tc k v = let b = Compositional_bool.f k v in let tag = !current_tag in incr current_tag; Tag_comp.encode tag b in List.map (function [k,v] -> Leaf (k, v, tc k v) | [] -> Empty | _ -> assert false) Initial_Values.v let rehash_ref = ref (fun _ -> assert false) module D = Datatype.Make_with_collections (struct type t = hptmap let name = "(" ^ Key.name ^ ", " ^ V.name ^ ") ptmap" open Structural_descr let r = Recursive.create () let structural_descr = if Descr.is_unmarshable Key.descr || Descr.is_unmarshable V.descr then t_unknown else t_sum [| [| Key.packed_descr; V.packed_descr; p_abstract |]; [| p_abstract; p_abstract; recursive_pack r; recursive_pack r; p_abstract |] |] let () = Recursive.update r structural_descr let reprs = [ Empty ] let equal = ( == ) let compare = compare let hash = hash_generic let rehash = if Descr.is_unmarshable Key.descr || Descr.is_unmarshable V.descr then Datatype.undefined else fun x -> !rehash_ref x let copy = Datatype.undefined let internal_pretty_code = Datatype.pp_fail let pretty = pretty let varname = Datatype.undefined let mem_project = Datatype.never_any_project end) let () = Type.set_ml_name D.ty None include (D: Datatype.S_with_collections with type t := t) module PatriciaHashconsTbl = State_builder.Hashconsing_tbl (struct include D (* At this stage, the root of the tree is _not_ hashconsed. The functions below cannot rely on the tags for it, only for the subtrees. *) let hash_internal tr = match tr with | Empty -> 37 | Leaf (k, v, _) -> Key.id k + 547 * V.hash v | Branch(p,m,l,r, _tag) -> m + 3 * p + 2017 * (hash_generic l) + (hash_generic r) (* here, only one of the arguments is hash-consed *) let equal_internal htr1 htr2 = match htr1, htr2 with | Empty, Empty -> true | Leaf(k1, v1, _), Leaf(k2, v2, _) -> Key.equal k1 k2 && V.equal v1 v2 | Branch(p1,m1,l1,r1,_), Branch(p2,m2,l2,r2,_) -> p1 = p2 && m1 = m2 && l1 == l2 && r1 == r2 | _,_ -> false let equal_internal = equal_internal let hash_internal = hash_internal let initial_values = initial_values end) (struct let name = Type.name ty ^ " hashconsing table" let dependencies = Datatype_deps.l let size = 137 end) let self = PatriciaHashconsTbl.self let id = hash_generic let wrap_Leaf k v = (* The test k < p+m and the implementation of [highest_bit] do not work with negative keys. *) assert (Key.id k >= 0); let b = Compositional_bool.f k v in let tag = !current_tag in let new_tr = Leaf (k, v, Tag_comp.encode tag b) in let result = PatriciaHashconsTbl.merge new_tr in if result == new_tr then current_tag := (succ tag) land max_int ; result let wrap_Branch p m l r = let b = Compositional_bool.compose (compositional_bool l) (compositional_bool r) in let tag = !current_tag in let new_tr = Branch (p, m, l, r, Tag_comp.encode tag b) in let result = PatriciaHashconsTbl.merge new_tr in if result == new_tr then current_tag := (succ tag) land max_int ; result (* This reference will contain a list of functions that will clear all the transient caches used in this module *) let clear_caches = ref [] (* The auxiliary function [match_prefix] tells whether a given key has a given prefix. More specifically, [match_prefix k p m] returns [true] if and only if the key [k] has prefix [p] up to bit [m]. Throughout our implementation of Patricia trees, prefixes are assumed to be in normal form, i.e. their irrelevant bits are set to some predictable value. Formally, we assume [Big_Endian.mask p m] equals [p] whenever [p] is a prefix with [m] relevant bits. This allows implementing [match_prefix] using only one call to [Big_Endian.mask]. On the other hand, this requires normalizing prefixes, as done e.g. in [join] below, where [Big_Endian.mask p0 m] has to be used instead of [p0]. *) let match_prefix k p m = Big_Endian.mask k m = p (* [find k m] looks up the value associated to the key [k] in the map [m], and raises [Not_found] if no value is bound to [k]. This implementation takes branches \emph{without} checking whether the key matches the prefix found at the current node. This means that a query for a non-existent key shall be detected only when finally reaching a leaf, rather than higher up in the tree. This strategy is better when (most) queries are expected to be successful. *) let find key htr = let id = Key.id key in let rec find htr = match htr with | Empty -> raise Not_found | Leaf (key', data, _) -> if Key.equal key key' then data else raise Not_found | Branch (_, mask, tree0, tree1, _) -> find (if (id land mask) = 0 then tree0 else tree1) in find htr (* Similar to [find], but checks the prefix found at the current node *) let find_check_missing key htr = let id = Key.id key in let rec find htr = match htr with | Empty -> raise Not_found | Leaf (key', data, _) -> if Key.equal key key' then data else raise Not_found | Branch (prefix, mask, tree0, tree1, _) -> if match_prefix id prefix mask then find (if (id land mask) = 0 then tree0 else tree1) else raise Not_found in find htr let find_key key htr = let id = Key.id key in let rec find htr = match htr with | Empty -> raise Not_found | Leaf (key', _, _) -> if Key.equal key key' then key' else raise Not_found | Branch (prefix, mask, tree0, tree1, _) -> if match_prefix id prefix mask then find (if (id land mask) = 0 then tree0 else tree1) else raise Not_found in find htr let mem key htr = let id = Key.id key in let rec find htr = match htr with | Empty -> false | Leaf (key', _, _) -> Key.equal key key' | Branch (prefix, mask, tree0, tree1, _) -> if match_prefix id prefix mask then find (if (id land mask) = 0 then tree0 else tree1) else false in find htr (* The auxiliary function [join] merges two trees in the simple case where their prefixes disagree. Assume $t_0$ and $t_1$ are non-empty trees, with longest common prefixes $p_0$ and $p_1$, respectively. Further, suppose that $p_0$ and $p_1$ disagree, that is, neither prefix is contained in the other. Then, no matter how large $t_0$ and $t_1$ are, we can merge them simply by creating a new [Branch] node that has $t_0$ and $t_1$ as children! *) let join p0 t0 p1 t1 = (* Computes a mask for the highest bit differing between [p0] and [p1]. *) let m = Big_Endian.branching_bit p0 p1 in let p = Big_Endian.mask p0 (* for instance *) m in if (p0 land m) = 0 then wrap_Branch p m t0 t1 else wrap_Branch p m t1 t0 let pretty_prefix (p,m) fmt tree = let prettykv fmt k v = Format.fprintf fmt "[@[%a@] -> @[%a@]@]@ " Key.pretty k V.pretty v in let rec pretty_prefix_aux tree = match tree with Empty -> () | Leaf (k,v,_) -> if match_prefix (Key.id k) p m then prettykv fmt k v | Branch(p1,m1,l,r,_) -> if m1 <= m then begin if match_prefix p1 p m then iter (prettykv fmt) tree; end else if p land m1 = 0 then pretty_prefix_aux l else pretty_prefix_aux r in Format.fprintf fmt "@[[["; pretty_prefix_aux tree; Format.fprintf fmt "]]@]" type subtree = t exception Found_prefix of prefix * subtree * subtree let rec comp_prefixes t1 t2 = assert (t1 != t2); let all_comp = compositional_bool t1 && compositional_bool t2 in match t1, t2 with Leaf (k1, _v1, _), Leaf (k2, _v2, _) -> if Key.equal k1 k2 && all_comp then begin (* Format.printf "PREF leaves:@."; prettykv Format.std_formatter k1 _v1; prettykv Format.std_formatter k1 _v2; *) raise (Found_prefix((Key.id k1, -1), t1, t2)) end | Branch (p1, m1, l1, r1, _), Branch (p2, m2, l2, r2, _) -> if (p1 = p2) && (m1 = m2) then begin if all_comp then begin (* Format.printf "PREF subtree:@."; pretty Format.std_formatter t1; pretty Format.std_formatter t2; *) raise (Found_prefix((p1 ,m1), t1, t2)); end; let go_left = l1 != l2 in if go_left then begin let go_right = r1 != r2 in if go_right then comp_prefixes r1 r2; comp_prefixes l1 l2; end else begin assert (r1 != r2); comp_prefixes r1 r2; end end else if (Big_Endian.shorter m1 m2) && (match_prefix p2 p1 m1) then let sub1 = if (p2 land m1) = 0 then l1 else r1 in if sub1 != t2 then comp_prefixes sub1 t2 else if (Big_Endian.shorter m2 m1) && (match_prefix p1 p2 m2) then let sub2 = if (p1 land m2) = 0 then l2 else r2 in if sub2 != t1 then comp_prefixes t1 sub2 | _, _ -> () let rec find_prefix t (p, m as prefix) = match t with Empty -> None | Leaf (k, _, c) -> if Key.id k = p && m = -1 && (Tag_comp.get_comp c) then Some t else None | Branch (p1, m1, l, r, tc) -> if p1 = p && m1 = m then (if Tag_comp.get_comp tc then Some t else None) else if Big_Endian.shorter m m1 then None else if match_prefix p p1 m1 then find_prefix (if p land m1 = 0 then l else r) prefix else None let hash_subtree = hash let equal_subtree = equal exception Unchanged let add k d m = let id = Key.id k in let rec add t = match t with | Empty -> wrap_Leaf k d | Leaf (k0, d0, _) -> if Key.equal k k0 then if d == d0 then raise Unchanged else wrap_Leaf k d else join id (wrap_Leaf k d) (Key.id k0) t | Branch (p, m, t0, t1, _) -> if match_prefix id p m then if (id land m) = 0 then wrap_Branch p m (add t0) t1 else wrap_Branch p m t0 (add t1) else join id (wrap_Leaf k d) p t in try add m with Unchanged -> m let replace f k m = let id = Key.id k in let replace_empty () = match f None with | None -> raise Unchanged | Some d -> wrap_Leaf k d in let rec add t = match t with | Empty -> replace_empty () | Leaf (k0, d0, _) -> if Key.equal k k0 then match f (Some d0) with | None -> Empty | Some d -> if d == d0 then raise Unchanged else wrap_Leaf k d else let new_leaf = replace_empty () in join id new_leaf (Key.id k0) t | Branch (p, m, t0, t1, _) -> if match_prefix id p m then if (id land m) = 0 then wrap_Branch p m (add t0) t1 else wrap_Branch p m t0 (add t1) else let new_leaf = replace_empty () in join id new_leaf p t in try add m with Unchanged -> m let singleton k d = wrap_Leaf k d let is_singleton htr = match htr with | Leaf (k, d, _) -> Some (k, d) | Empty | Branch _ -> None let on_singleton f htr = match htr with | Leaf (k, d, _) -> f k d | Empty | Branch _ -> false let is_empty htr = match htr with | Empty -> true | Leaf _ | Branch _ -> false let rec cardinal htr = match htr with | Empty -> 0 | Leaf _ -> 1 | Branch (_, _, t0, t1, _) -> cardinal t0 + cardinal t1 let remove key m = let id = Key.id key in let rec remove htr = match htr with | Empty -> raise Not_found | Leaf (key', _, _) -> if Key.equal key key' then Empty else raise Not_found | Branch (prefix, mask, tree0, tree1, _) -> if match_prefix id prefix mask then if (id land mask) = 0 then let rtree0 = remove tree0 in match rtree0 with | Empty -> tree1 | _ -> if rtree0 == tree0 then htr else wrap_Branch prefix mask rtree0 tree1 else let rtree1 = remove tree1 in match rtree1 with | Empty -> tree0 | _ -> if rtree1 == tree1 then htr else wrap_Branch prefix mask tree0 rtree1 else raise Not_found in try remove m with Not_found -> m (* (** [find_and_remove k m] looks up the value [v] associated to the key [k] in the map [m], and raises [Not_found] if no value is bound to [k]. The call returns the value [v], together with the map [m] deprived from the binding from [k] to [v]. *) let find_and_remove key htr = let id = Key.id key in let rec find_and_remove htr = match htr with | Empty -> raise Not_found | Leaf (key', data, _) -> if Key.equal key key' then data, Empty else raise Not_found | Branch (prefix, mask, tree0, tree1, _) -> if (id land mask) = 0 then match find_and_remove tree0 with | data, Empty -> data, tree1 | data, tree0 -> data, (wrap_Branch prefix mask tree0 tree1) else match find_and_remove tree1 with | data, Empty -> data, tree0 | data, tree1 -> data, (wrap_Branch prefix mask tree0 tree1) in find_and_remove htr *) let rec fold f m accu = match m with | Empty -> accu | Leaf (key, data, _) -> f key data accu | Branch (_, _, tree0, tree1, _) -> fold f tree1 (fold f tree0 accu) let rec fold_rev f m accu = match m with | Empty -> accu | Leaf (key, data, _) -> f key data accu | Branch (_, _, tree0, tree1, _) -> fold_rev f tree0 (fold_rev f tree1 accu) let rehash_node = function | Empty -> Empty | Leaf (k, v, _) -> wrap_Leaf k v | Branch (p,m,l,r,_) -> if Descr.is_abstract Key.descr then (* The keys id have not been modified during de-marshalling. The shapes of [l] and [r] are compatible, just merge them. *) wrap_Branch p m l r else (* The ids may have been modified, the trees can overlap. Rebuild everything from scratch. *) fold add l r let () = rehash_ref := rehash_node let rec for_all f m = match m with | Empty -> true | Leaf (key, data, _) -> f key data | Branch (_, _, tree0, tree1, _) -> for_all f tree0 && for_all f tree1 let rec exists f m = match m with | Empty -> false | Leaf (key, data, _) -> f key data | Branch (_, _, tree0, tree1, _) -> exists f tree0 || exists f tree1 let rec map f htr = match htr with | Empty -> Empty | Leaf (key, data, _) -> let data' = f data in if data == data' then htr else wrap_Leaf key data' | Branch (p, m, tree0, tree1, _) -> let tree0' = map f tree0 in let tree1' = map f tree1 in if tree0' == tree0 && tree1' == tree1 then htr else wrap_Branch p m tree0' tree1' let rec map' f htr = match htr with | Empty -> Empty | Leaf (key, data, _) -> begin match f key data with | Some data' -> if data == data' then htr else wrap_Leaf key data' | None -> Empty end | Branch (p, m, tree0, tree1, _) -> let tree0' = map' f tree0 and tree1' = map' f tree1 in if tree0' == tree0 && tree1' == tree1 then htr else if tree0' == Empty then tree1' else if tree1' == Empty then tree0' else wrap_Branch p m tree0' tree1' let rec filter f htr = match htr with | Empty -> Empty | Leaf (key, _data, _) -> if f key then htr else Empty | Branch (p, m, tree0, tree1, _) -> let tree0' = filter f tree0 and tree1' = filter f tree1 in if tree0' == tree0 && tree1' == tree1 then htr else if tree0' == Empty then tree1' else if tree1' == Empty then tree0' else wrap_Branch p m tree0' tree1' (** [endo_map] is similar to [map], but attempts to physically share its result with its input. This saves memory when [f] is the identity function. *) let rec endo_map f tree = match tree with | Empty -> tree | Leaf (key, data, _) -> let data' = f key data in if data == data' then tree else wrap_Leaf key data' | Branch (p, m, tree0, tree1, _) -> let tree0' = endo_map f tree0 in let tree1' = endo_map f tree1 in if (tree0' == tree0) && (tree1' == tree1) then tree else wrap_Branch p m tree0' tree1' let rec from_shape f = function | Empty -> Empty | Leaf (key, value, _) -> wrap_Leaf key (f key value) | Branch (p, m, t1, t2, _) -> wrap_Branch p m (from_shape f t1) (from_shape f t2) let rec from_shape_id = function | Empty -> Empty | Leaf (key, value, _) -> wrap_Leaf key value | Branch (p, m, t1, t2, _) as t -> let t1' = from_shape_id t1 in let t2' = from_shape_id t2 in if (t1' == t1) && (t2' == t2) then t else wrap_Branch p m t1' t2' module Cacheable = struct type t = hptmap let hash = hash let sentinel = Empty let equal = (==) end module R = struct type t = hptmap let sentinel = Empty end module type I = sig val clear : unit -> unit val merge : (Cacheable.t -> Cacheable.t -> R.t) -> Cacheable.t -> Cacheable.t -> Cacheable.t end (* A (too ?) generic merge. *) let generic_merge ~(cache: Hptmap_sig.cache_type) ~(symmetric: bool) ~(idempotent: bool) ~(increasing: bool) ~(decide_both: key -> v -> t -> v -> t -> t) ~(decide_left: t -> t) ~(decide_right: t -> t) = (* Cache of the merges, depending on [cache] and [symmetric].*) let cache_merge = match cache with | Hptmap_sig.NoCache -> (fun f x y -> f x y) | Hptmap_sig.PersistentCache _name | Hptmap_sig.TemporaryCache _name -> if debug_cache then Format.eprintf "CACHE generic_merge %s@." _name; let module Cache = (val if symmetric then (module Binary_cache.Symmetric_Binary (Cacheable) (R) : I) else (module Binary_cache.Arity_Two (Cacheable) (Cacheable) (R) : I) : I) in if cache = Hptmap_sig.PersistentCache _name then clear_caches := Cache.clear :: !clear_caches; Cache.merge in (* Rewrap of branches. The initials branches and tree are provided in order to avoid the wrapping if the two branches have not been modified. If the merge is increasing, we don't need to test whether the branches are not empty. *) let rewrap p m u orig_u v orig_v orig_tree = if u == orig_u && v == orig_v then orig_tree else wrap_Branch p m u v in let rewrap = if increasing then rewrap else fun p m u orig_u v orig_v orig_tree -> if u == Empty then v else if v == Empty then u else rewrap p m u orig_u v orig_v orig_tree in (* Join two distinct branches. If the merge is increasing, we don't need to test their emptiness. *) let rejoin = if increasing then join else fun p u q v -> if u == Empty then v else if v == Empty then u else join p u q v in (* Called when one of the trees is a leaf [leaf] binding [key] to [data]; the other side is [tree]. [right] is true if the leaf come from the right tree. *) let merge_leaf right = (* [decide_leaf] and [decide_tree] are the actions to perform respectively on the [leaf] and on the [tree] when they are disjoint. If the merge is not symmetric, they depend on the side the leaf comes froms, and similarly for [decide_both] and [cache]. *) let decide_leaf = if right then decide_right else decide_left and decide_tree = if right then decide_left else decide_right and decide_both = if right || symmetric then decide_both else fun k v1 t1 v2 t2 -> decide_both k v2 t2 v1 t1 and cache = if right && not symmetric then fun f s t -> cache_merge (fun t s -> f s t) t s else cache_merge in (* Reminder: [leaf] bind [key] to [data]. *) fun key data leaf tree -> let k_id = Key.id key in let rec merge_leaf tree = cache add leaf tree and add leaf tree = match tree with | Empty -> decide_leaf leaf | Leaf (key', data', _) -> if idempotent && leaf == tree then leaf else if Key.equal key key' then decide_both key data' tree data leaf else let tree' = decide_tree tree and leaf' = decide_leaf leaf in rejoin k_id leaf' (Key.id key') tree' | Branch (p, m, t0, t1, _) -> if match_prefix k_id p m then if (k_id land m) = 0 then let t0' = merge_leaf t0 and t1' = decide_tree t1 in rewrap p m t0' t0 t1' t1 tree else let t1' = merge_leaf t1 and t0' = decide_tree t0 in rewrap p m t0' t0 t1' t1 tree else let tree' = decide_tree tree and leaf' = decide_leaf leaf in rejoin k_id leaf' p tree' in merge_leaf tree in let merge_right_leaf = merge_leaf true and merge_left_leaf = merge_leaf false in let rec merge s t = if idempotent && s == t then s else match s, t with | Empty, Empty -> Empty | Empty, _ -> decide_right t | _, Empty -> decide_left s | Leaf (key, v, _), _ -> merge_left_leaf key v s t | _, Leaf (key, v, _) -> merge_right_leaf key v t s | Branch (p, m, s0, s1, _), Branch (q, n, t0, t1, _) -> let descend = fun s t -> merge_branches s (p, m, s0, s1) t (q, n, t0, t1) in cache_merge descend s t (* Called for the recursive descend in two trees. [s] is [Branch (p, m, s0, s1)] and [t] is [Branch (q, n, t0, t1)]. *) and merge_branches s (p, m, s0, s1) t (q, n, t0, t1) = if (p = q) && (m = n) then (* The trees have the same prefix. Merge their sub-trees. *) let u0 = merge s0 t0 and u1 = merge s1 t1 in rewrap p m u0 s0 u1 s1 s else if (Big_Endian.shorter m n) && (match_prefix q p m) then (* [q] contains [p]. Merge [t] with a sub-tree of [s]. *) if (q land m) = 0 then let s0_t = merge s0 t in let s1_e = decide_left s1 in rewrap p m s0_t s0 s1_e s1 s else let s0_e = decide_left s0 in let s1_t = merge s1 t in rewrap p m s0_e s0 s1_t s1 s else if (Big_Endian.shorter n m) && (match_prefix p q n) then (* [p] contains [q]. Merge [s] with a sub-tree of [t]. *) if (p land n) = 0 then let s_t0 = merge s t0 in let e_t1 = decide_right t1 in rewrap q n s_t0 t0 e_t1 t1 t else let s_t1 = merge s t1 in let e_t0 = decide_right t0 in rewrap q n e_t0 t0 s_t1 t1 t else (* The prefixes disagree. *) let u0 = decide_left s and u1 = decide_right t in rejoin p u0 q u1 in merge type empty_action = Neutral | Absorbing | Traversing of (key -> v -> v option) let merge = (* Called when one of the tree is empty *) let decide_none = function | Neutral -> fun t -> t | Absorbing -> fun _ -> Empty | Traversing f -> fun t -> map' f t (* TODO: add a cache? *) in fun ~cache ~symmetric ~idempotent ~decide_both ~decide_left ~decide_right -> let decide_both key value leaf value' leaf' = match decide_both key value value' with | Some v -> if v == value then leaf else if v == value' then leaf' else wrap_Leaf key v | None -> Empty in generic_merge ~cache ~symmetric ~idempotent ~increasing:false ~decide_both ~decide_left:(decide_none decide_left) ~decide_right:(decide_none decide_right) let generic_join ~cache ~symmetric ~idempotent ~decide = let decide_both key value leaf value' leaf' = let v = decide key (Some value) (Some value') in if v == value then leaf else if v == value' then leaf' else wrap_Leaf key v and decide_right = endo_map (fun k v -> decide k None (Some v)) and decide_left = endo_map (fun k v -> decide k (Some v) None) in generic_merge ~cache ~symmetric ~idempotent ~increasing:true ~decide_both ~decide_left ~decide_right let join ~cache ~symmetric ~idempotent ~decide = let decide_both key value leaf value' leaf' = let v = decide key value value' in if v == value then leaf else if v == value' then leaf' else wrap_Leaf key v and decide_none = fun t -> t in generic_merge ~cache ~symmetric ~idempotent ~increasing:true ~decide_both ~decide_left:decide_none ~decide_right:decide_none let inter ~cache ~symmetric ~idempotent ~decide = let decide_both key value leaf value' leaf' = match decide key value value' with | Some v -> if v == value then leaf else if v == value' then leaf' else wrap_Leaf key v | None -> Empty and decide_none = fun _ -> Empty in generic_merge ~cache ~symmetric ~idempotent ~increasing:false ~decide_both ~decide_left:decide_none ~decide_right:decide_none (* Merge between a map and a shape. Can be an intersection (inter=true) or a difference (inter=false). *) let merge_with_shape ~inter = (* Match a map with an empty shape. *) let decide_empty_shape = if inter then fun _ -> Empty else fun t -> t in let extract_leaf key map = try wrap_Leaf key (find key map) with Not_found -> Empty in (* Match a map with a leaf shape: for intersection, only keep the leaf (if it belongs to the map); for a difference, remove the leaf. *) let decide_leaf_shape = if inter then extract_leaf else remove in let rec merge shape map = match shape, map with | Empty, _ -> decide_empty_shape map | _, Empty -> map | _, Leaf (key, _, _) -> if inter = mem key shape then map else Empty | Leaf (key, _, _), _ -> decide_leaf_shape key map | Branch (p, m, s0, s1, _), Branch (q, n, t0, t1, _) -> let rewrap p m u0 u1 = if t0 == u0 && t1 == u1 then map else if u0 == Empty then u1 else if u1 == Empty then u0 else wrap_Branch p m u0 u1 in if (p = q) && (m = n) then (* The trees have the same prefix. Merge their sub-trees. *) let u0 = merge s0 t0 and u1 = merge s1 t1 in rewrap p m u0 u1 else if (Big_Endian.shorter m n) && (match_prefix q p m) then (* [q] contains [p]. Merge [map] with a sub-tree of [shape]. *) if (q land m) = 0 then merge s0 map else merge s1 map else if (Big_Endian.shorter n m) && (match_prefix p q n) then (* [p] contains [q]. Merge [shape] with a sub-tree of [map]. The other sub-tree of [map] matches an empty shape. *) if (p land n) = 0 then rewrap q n (merge shape t0) (decide_empty_shape t1) else rewrap q n (decide_empty_shape t0) (merge shape t1) else (* The prefixes disagree: [map] matches an empty shape. *) decide_empty_shape map in merge let inter_with_shape shape map = merge_with_shape ~inter:true shape map let diff_with_shape shape map = merge_with_shape ~inter:false shape map let fold2_join_heterogeneous (type arg) (type result) ~cache ~empty_left ~empty_right ~both ~join ~empty = let cache_merge = match cache with | Hptmap_sig.NoCache -> (fun f x y -> f x y) | Hptmap_sig.PersistentCache _name | Hptmap_sig.TemporaryCache _name -> if debug_cache then Format.eprintf "CACHE fold2_join_heterogeneous %s@." _name; let module Arg = struct type t = (Key.t, arg) tree let hash : t -> int = hash_generic let sentinel : t = Empty let equal : t -> t -> bool = (==) end in let module Result = struct type t = result let sentinel : t = empty end in let module Cache = Binary_cache.Arity_Two(Cacheable)(Arg)(Result) in (match cache with | Hptmap_sig.PersistentCache _ -> clear_caches := Cache.clear :: !clear_caches | _ -> ()); Cache.merge in let rec compute s t = cache_merge aux s t and aux s t = match s, t with | Empty, Empty -> empty | Empty, t -> empty_left t | s, Empty -> empty_right s | Leaf (ks, vs, _), Leaf (kt, vt, _) -> if Key.equal ks kt then both ks vs vt else join (empty_left t) (empty_right s) | Branch (p, m, s0, s1, _), Leaf(kt, _, _) -> let k_id = Key.id kt in if match_prefix k_id p m then if (k_id land m) = 0 then join (compute s0 t) (empty_right s1) else join (compute s1 t) (empty_right s0) else join (empty_right s) (empty_left t) | Leaf (ks, _, _), Branch(q, n, t0, t1, _) -> let k_id = Key.id ks in if match_prefix k_id q n then if (k_id land n) = 0 then join (compute s t0) (empty_left t1) else join (compute s t1) (empty_left t0) else join (empty_right s) (empty_left t) | Branch(p, m, s0, s1, _), Branch(q, n, t0, t1, _) -> if (p = q) && (m = n) then (* The trees have the same prefix. recurse on the sub-trees *) join (compute s0 t0) (compute s1 t1) else if (Big_Endian.shorter m n) && (match_prefix q p m) then (* [q] contains [p]. Merge [t] with a sub-tree of [s]. *) if (q land m) = 0 then join (compute s0 t) (empty_right s1) else join (compute s1 t) (empty_right s0) else if (Big_Endian.shorter n m) && (match_prefix p q n) then (* [p] contains [q]. Merge [s] with a sub-tree of [t]. *) if (p land n) = 0 then join (compute s t0) (empty_left t1) else join (compute s t1) (empty_left t0) else (* The prefixes disagree. *) join (empty_right s) (empty_left t) in fun s t -> compute s t type decide_fast = Done | Unknown let make_predicate cache_merge exn ~decide_fast ~decide_fst ~decide_snd ~decide_both = let rec aux s t = if decide_fast s t = Unknown then match s, t with | Empty, _ -> iter decide_snd t | (Leaf _ | Branch _), Empty -> iter decide_fst s | Leaf(k1, v1, _), Leaf(k2, v2, _) -> if Key.id k1 = Key.id k2 then decide_both v1 v2 else begin decide_fst k1 v1; decide_snd k2 v2; end | Leaf(key, _value, _), Branch(p,m,l,r,_) -> let i = Key.id key in if i < p+m then begin aux s l; aux Empty r; end else begin aux Empty l; aux s r; end | Branch (p,m,l,r,_) , Leaf(key, _value, _) -> let i = Key.id key in if i < p+m then begin aux l t; aux r Empty; end else begin aux l Empty; aux r t; end | Branch _, Branch _ -> (* Beware that [cache_merge compute] may swap the order of its arguments compared to [aux]. Do not use the result of the match in [aux] directly inside [compute]. *) let compute s t = match s, t with | Branch(p, m, s0, s1, _), Branch(q, n, t0, t1, _) -> begin try if (p = q) && (m = n) then begin (*The trees have the same prefix. Compare their sub-trees.*) aux s0 t0; aux s1 t1 end else if (Big_Endian.shorter m n) && (match_prefix q p m) then (* [q] contains [p]. Compare [t] with a sub-tree of [s]. *) if (q land m) = 0 then begin aux s0 t; aux s1 Empty; end else begin aux s0 Empty; aux s1 t end else if (Big_Endian.shorter n m) && (match_prefix p q n) then (* [p] contains [q]. Compare [s] with a sub-tree of [t]. *) if (p land n) = 0 then begin aux s t0; aux Empty t1 end else begin aux s t1; aux Empty t0 end else begin (* The prefixes disagree. *) aux s Empty; aux Empty t; end; true with e when e = exn -> false | _ -> assert false end | _ -> assert false (* Branch/Branch comparison *) in let result = cache_merge compute s t in if not result then raise exn in aux let generic_predicate exn ~cache ~decide_fast ~decide_fst ~decide_snd ~decide_both = if debug_cache then Format.eprintf "CACHE generic_predicate %s@." (fst cache); let module Cache = Binary_cache.Binary_Predicate(Cacheable)(Cacheable) in clear_caches := Cache.clear :: !clear_caches; make_predicate Cache.merge exn ~decide_fast ~decide_fst ~decide_snd ~decide_both let generic_symmetric_predicate exn ~decide_fast ~decide_one ~decide_both = if debug_cache then Format.eprintf "CACHE generic_symmetric_predicate@."; let module Cache = Binary_cache.Symmetric_Binary_Predicate(Cacheable) in clear_caches := Cache.clear :: !clear_caches; make_predicate Cache.merge exn ~decide_fast ~decide_fst:decide_one ~decide_snd:decide_one ~decide_both type predicate_type = ExistentialPredicate | UniversalPredicate type predicate_result = PTrue | PFalse | PUnknown let decide_fast_intersection s t = match s, t with | Empty, _ | _, Empty -> PFalse | _ -> if s == t then PTrue else PUnknown let decide_fast_inclusion s t = if s == t || s == Empty then PTrue else PUnknown let make_binary_predicate cache_merge pt ~decide_fast ~decide_fst ~decide_snd ~decide_both = (** We cannot use [&&] and [||] under another name, as functions are not lazy in OCaml. Instead, we defer the evaluation of the right part by calling a function. Due to typing issues, we must actually define two functions... *) let comb1, comb2 = match pt with | UniversalPredicate -> let f b f v1 v2 = b && f v1 v2 in f, f | ExistentialPredicate -> let f b f v1 v2 = b || f v1 v2 in f, f in let rec aux s t = match s, t with | Empty, Empty -> (match pt with | ExistentialPredicate -> false | UniversalPredicate -> true) | Leaf (key, data, _), Empty -> decide_fst key data | Empty, Leaf (key, data, _) -> decide_snd key data | Empty, Branch (_, _, tl, tr, _) -> comb1 (aux' Empty tl) aux' Empty tr | Branch (_, _, tl, tr, _), Empty -> comb1 (aux' tl Empty) aux' tr Empty | Leaf(k1, v1, _), Leaf(k2, v2, _) -> if Key.id k1 = Key.id k2 then decide_both k1 v1 v2 else comb2 (decide_fst k1 v1) decide_snd k2 v2 | Leaf(key, _value, _), Branch(p,m,l,r,_) -> let i = Key.id key in if i < p+m then comb1 (aux' Empty r) aux' s l else comb1 (aux' Empty l) aux' s r | Branch (p,m,l,r,_) , Leaf(key, _value, _) -> let i = Key.id key in if i < p+m then comb1 (aux' r Empty) aux' l t else comb1 (aux' l Empty) aux' r t | Branch(p, m, s0, s1, _), Branch(q, n, t0, t1, _) -> if (p = q) && (m = n) then (*The trees have the same prefix. Compare their sub-trees.*) comb1 (aux' s0 t0) aux' s1 t1 else if (Big_Endian.shorter m n) && (match_prefix q p m) then (* [q] contains [p]. Compare [t] with a sub-tree of [s]. *) if (q land m) = 0 then comb1 (aux' s1 Empty) aux' s0 t else comb1 (aux' s0 Empty) aux' s1 t else if (Big_Endian.shorter n m) && (match_prefix p q n) then (* [p] contains [q]. Compare [s] with a sub-tree of [t]. *) if (p land n) = 0 then comb1 (aux' s t0) aux' Empty t1 else comb1 (aux' s t1) aux' Empty t0 else (* The prefixes disagree. *) comb1 (aux' s Empty) aux' Empty t and aux' s t = match decide_fast s t with | PFalse -> false | PTrue -> true | PUnknown -> cache_merge aux s t in aux' let binary_predicate ct pt ~decide_fast ~decide_fst ~decide_snd ~decide_both = let cache_merge = match ct with | Hptmap_sig.NoCache -> (fun f x y -> f x y) | Hptmap_sig.PersistentCache _name | Hptmap_sig.TemporaryCache _name -> if debug_cache then Format.eprintf "CACHE binary_predicate %s@." _name; let module Cache = Binary_cache.Binary_Predicate(Cacheable)(Cacheable) in (match ct with | Hptmap_sig.PersistentCache _ -> clear_caches := Cache.clear :: !clear_caches | _ -> ()); Cache.merge in make_binary_predicate cache_merge pt ~decide_fast ~decide_fst ~decide_snd ~decide_both let symmetric_binary_predicate ct pt ~decide_fast ~decide_one ~decide_both = let cache_merge = match ct with | Hptmap_sig.NoCache -> (fun f x y -> f x y) | Hptmap_sig.PersistentCache _name | Hptmap_sig.TemporaryCache _name -> if debug_cache then Format.eprintf "CACHE symmetric_binary_predicate %s@." _name; let module Cache = Binary_cache.Symmetric_Binary_Predicate(Cacheable) in (match ct with | Hptmap_sig.PersistentCache _ -> clear_caches := Cache.clear :: !clear_caches | _ -> ()); Cache.merge in make_binary_predicate cache_merge pt ~decide_fast ~decide_fst:decide_one ~decide_snd:decide_one ~decide_both let cached_fold ~cache_name ~temporary ~f ~joiner ~empty = if debug_cache then Format.eprintf "CACHE cached_fold %s@." cache_name; let cache_size = Binary_cache.cache_size in let cache = Array.make cache_size (Empty, empty) in let hash t = abs (hash t mod cache_size) in let reset () = Array.fill cache 0 cache_size (Empty, empty) in if not temporary then clear_caches := reset :: !clear_caches; fun m -> let rec traverse t = let mem result = cache.(hash t) <- (t, result); result in let find () = let t', r = cache.(hash t) in if equal t t' then r else raise Not_found in match t with | Empty -> empty | Leaf(key, value, _) -> (try find () with Not_found -> mem (f key value) ) | Branch(_p, _m, s0, s1, _) -> try find () with Not_found -> let result0 = traverse s0 in let result1 = traverse s1 in mem (joiner result0 result1) in traverse m let cached_map ~cache ~temporary ~f = let _name, cache = cache in let table = Hashtbl.create cache in if not temporary then clear_caches := (fun () -> Hashtbl.clear table) :: !clear_caches; let counter = ref 0 in fun m -> let rec traverse t = match t with Empty -> empty | Leaf(key, value, _) -> wrap_Leaf key (f key value) | Branch(p, m, s0, s1, _) -> try let result = Hashtbl.find table t in (* Format.printf "find %s %d@." name !counter; *) result with Not_found -> let result0 = traverse s0 in let result1 = traverse s1 in let result = wrap_Branch p m result0 result1 in incr counter; if !counter >= cache then begin (* Format.printf "Clearing %s fold table@." name;*) Hashtbl.clear table; counter := 0; end; (* Format.printf "add %s %d@." name !counter; *) Hashtbl.add table t result; result in traverse m let shape x = ((x : t) :> V.t shape) let clear_caches () = List.iter (fun f -> f ()) !clear_caches end (* Local Variables: compile-command: "make -C .." End: *) frama-c-20.0-Calcium/src/libraries/utils/hptmap.mli0000666000000000000000000001003413571573400017110 0ustar (**************************************************************************) (* *) (* This file was originally part of Menhir *) (* *) (* François Pottier and Yann Régis-Gianas, INRIA Rocquencourt *) (* *) (* Copyright 2005 Institut National de Recherche en Informatique et *) (* en Automatique. All rights reserved. This file is distributed *) (* under the terms of the Q Public License version 1.0, with the *) (* change described in the file licenses/Q_MODIFIED_LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (** Efficient maps from hash-consed trees to values, implemented as Patricia trees. *) (** This implementation of big-endian Patricia trees follows Chris Okasaki's paper at the 1998 ML Workshop in Baltimore. Maps are implemented on top of Patricia trees. A tree is big-endian if it expects the key's most significant bits to be tested first. *) (**/**) (* Undocumented. Needed for advanced users only *) type prefix val sentinel_prefix : prefix (**/**) type tag (** Type of the keys of the map. *) module type Id_Datatype = sig include Datatype.S val id: t -> int (** Identity of a key. Must verify [id k >= 0] and [equal k1 k2 ==> id k1 = id k2] *) end (** Values stored in the map *) module type V = sig include Datatype.S val pretty_debug: t Pretty_utils.formatter end (** This functor exports the {i shape} of the maps indexed by keys [Key]. Those shapes can be used by various functions to efficiently build new maps whose shape are already known. *) module Shape (Key : Id_Datatype): sig type 'value t val compare: ('value -> 'value -> int) -> 'value t -> 'value t -> int val equal : 'value t -> 'value t -> bool val pretty: 'value Pretty_utils.formatter -> 'value t Pretty_utils.formatter val hash: 'value t -> int val iter: (Key.t -> 'value -> unit) -> 'value t -> unit end module Make (Key : Id_Datatype) (V : V) (Compositional_bool : sig (** A boolean information is maintained for each tree, by composing the boolean on the subtrees and the value information present on each leaf. See {!Comp_unused} for a default implementation. *) val e: bool (** Value for the empty tree *) val f : Key.t -> V.t -> bool (** Value for a leaf *) val compose : bool -> bool -> bool (** Composition of the values of two subtrees *) end) (Initial_Values : sig val v : (Key.t*V.t) list list (** List of the maps that must be shared between all instances of Frama-C (the maps being described by the list of their elements). Must include all maps that are exported at Caml link-time when the functor is applied. This usually includes at least the empty map, hence [v] nearly always contains [[]]. *) end) (Datatype_deps: sig val l : State.t list (** Dependencies of the hash-consing table. The table will be cleared whenever one of those dependencies is cleared. *) end) : Hptmap_sig.S with type key = Key.t and type v = V.t and type 'a shape = 'a Shape(Key).t and type prefix = prefix (** Default implementation for the [Compositional_bool] argument of the functor {!Make}. To be used when no interesting compositional bit can be computed. *) module Comp_unused : sig val e : bool val f : 'a -> 'b -> bool val compose : bool -> bool -> bool end (* Local Variables: compile-command: "make -C .." End: *) frama-c-20.0-Calcium/src/libraries/utils/hptmap_sig.mli0000666000000000000000000003476013571573400017766 0ustar (**************************************************************************) (* *) (* This file was originally part of Menhir *) (* *) (* François Pottier and Yann Régis-Gianas, INRIA Rocquencourt *) (* *) (* Copyright 2005 Institut National de Recherche en Informatique et *) (* en Automatique. All rights reserved. This file is distributed *) (* under the terms of the Q Public License version 1.0, with the *) (* change described in the file licenses/Q_MODIFIED_LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (** Signature for the {!Hptmap} module *) (** Some functions of this module may optionally use internal caches. It is the responsibility of the use to choose whether or not to use a cache, and whether this cache will be garbage-collectable by OCaml. *) type cache_type = | NoCache (** The results of the function will not be cached. *) | PersistentCache of string (** The results of the function will be cached, and the function that uses the cache is a permanent closure (at the toplevel of an OCaml module).*) | TemporaryCache of string (** The results of the function will be cached, but the function itself is a local function which is garbage-collectable. *) (** Signature for hptmaps from hash-consed trees to values *) module type S = sig type key (** type of the keys *) type v (** type of the values *) type 'a shape type prefix include Datatype.S_with_collections (** Bijective function. The ids are positive. *) val id: t -> int val self : State.t val empty : t (** the empty map *) val is_empty : t -> bool (** [is_empty m] returns [true] if and only if the map [m] defines no bindings at all. *) val add : key -> v -> t -> t (** [add k d m] returns a map whose bindings are all bindings in [m], plus a binding of the key [k] to the datum [d]. If a binding already exists for [k], it is overridden. *) val replace : (v option -> v option) -> key -> t -> t (** [replace f k m] returns a map whose bindings are all bindings in [m], except for the key [k] which is: - removed from the map if [f o] = None - bound to v' if [f o] = Some v' where [o] is (Some v) if [k] is bound to [v] in [m], or None if [k] is not bound in [m]. *) val find : key -> t -> v val find_check_missing: key -> t -> v (** Both [find key m] and [find_check_missing key m] return the value bound to [key] in [m], or raise [Not_found] is [key] is unbound. [find] is optimised for the case where [key] is bound in [m], whereas [find_check_missing] is more efficient for the cases where [m] is big and [key] is missing. *) val find_key : key -> t -> key (** This function is useful where there are multiple distinct keys that are equal for [Key.equal]. *) val remove : key -> t -> t (** [remove k m] returns the map [m] deprived from any binding involving [k]. *) val mem : key -> t -> bool (** [mem k m] returns true if [k] is bound in [m], and false otherwise. *) val iter : (key -> v -> unit) -> t -> unit (** [iter f m] applies [f] to all bindings of the map [m]. *) val map : (v -> v) -> t -> t (** [map f m] returns the map obtained by composing the map [m] with the function [f]; that is, the map $k\mapsto f(m(k))$. *) val map': (key -> v -> v option) -> t -> t (** Same as [map], except if [f k v] returns [None]. In this case, [k] is not bound in the resulting map. *) val filter: (key -> bool) -> t -> t (** [filter f t] keep only the bindings of [m] whose key verify [f]. *) val fold : (key -> v -> 'b -> 'b) -> t -> 'b -> 'b (** [fold f m seed] invokes [f k d accu], in turn, for each binding from key [k] to datum [d] in the map [m]. Keys are presented to [f] in increasing order according to the map's ordering. The initial value of [accu] is [seed]; then, at each new call, its value is the value returned by the previous invocation of [f]. The value returned by [fold] is the final value of [accu]. *) val fold_rev : (key -> v -> 'b -> 'b) -> t -> 'b -> 'b (** [fold_rev] performs exactly the same job as [fold], but presents keys to [f] in the opposite order. *) val for_all: (key -> v -> bool) -> t -> bool (** [for_all p m] returns true if all the bindings of the map [m] satisfy the predicate [p]. *) val exists: (key -> v -> bool) -> t -> bool (** [for_all p m] returns true if at least one binding of the map [m] satisfies the predicate [p]. *) type empty_action = Neutral | Absorbing | Traversing of (key -> v -> v option) val merge : cache:cache_type -> symmetric:bool -> idempotent:bool -> decide_both:(key -> v -> v -> v option) -> decide_left:empty_action -> decide_right:empty_action -> t -> t -> t (** Merge of two trees, parameterized by a merge function. If [symmetric] holds, the function must verify [merge x y = merge y x]. If [idempotent] holds, the function must verify [merge x x = x]. For each key [k] present in both trees, and bound to [v1] and [v2] in the left and the right tree respectively, [decide_both k v1 v2] is called. If the decide function returns [None], the key will not be in the resulting map; otherwise, the new value computed will be bound to [k]. The [decide_left] action is performed to the left subtree [t] when a right subtree is empty (and conversely for the [decide_right] action when a left subtree is empty): - Neutral returns the subtree [t] unchanged; - Absorbing returns the empty tree; - (Traversing f) applies the function [f] to each binding of the remaining subtree [t] (see [map']). The results of the function may be cached, depending on [cache]. If a cache is used, then the merge functions must be pure. *) val generic_join : cache:cache_type -> symmetric:bool -> idempotent:bool -> decide:(key -> v option -> v option -> v) -> t -> t -> t (** Merge of two trees, parameterized by the [decide] function. If [symmetric] holds, the function must verify [decide key v1 v2 = decide key v2 v1]. If [idempotent] holds, the function must verify [decide k (Some x) (Some x) = x]. *) val join : cache:cache_type -> symmetric:bool -> idempotent:bool -> decide:(key -> v -> v -> v) -> t -> t -> t (** Same as [generic_merge], but we assume that [decide key None (Some v) = decide key (Some v) None = v] holds. *) val inter : cache:cache_type -> symmetric:bool -> idempotent:bool -> decide:(key -> v -> v -> v option) -> t -> t -> t (** Intersection of two trees, parameterized by the [decide] function. If the [decide] function returns [None], the key will not be in the resulting map. Keys present in only one map are similarly unmapped in the result. *) val inter_with_shape: 'a shape -> t -> t (** [inter_with_shape s m] keeps only the elements of [m] that are also bound in the map [s]. No caching is used, but this function is more efficient than successive calls to {!remove} or {!add} to build the resulting map. *) val diff_with_shape: 'a shape -> t -> t (** [diff_with_shape s m] keeps only the elements of [m] that are not bound in the map [s]. No caching is used, but this function is more efficient than successive calls to {!remove} or {!add} to build the resulting map. *) (** {2 Binary predicates} *) type decide_fast = Done | Unknown (** Shortcut for functions that decide whether a predicate holds on a tree. [Done] means that the function returns its default value, which is usually [unit]. [Unknown] means that the evaluation must continue in the subtrees. *) val generic_predicate : exn -> cache:(string * 'a) -> decide_fast:(t -> t -> decide_fast) -> decide_fst:(key -> v -> unit) -> decide_snd:(key -> v -> unit) -> decide_both:(v -> v -> unit) -> t -> t -> unit (** [generic_is_included e (cache_name, cache_size) ~decide_fast ~decide_fst ~decide_snd ~decide_both t1 t2] decides whether some relation holds between [t1] and [t2]. All [decide] functions must raise [e] when the relation does not hold, and do nothing otherwise. [decide_fst] (resp. [decide_snd]) is called when one key is present only in [t1] (resp. [t2]). [decide_both] is called when a key is present in both trees. [decide_fast] is called on entire keys. As its name implies, it must be fast; in doubt, returning [Unknown] is always correct. Raising [e] means that the relation does not hold. Returning [Done] means that the relation holds. The computation of this relation cached. [cache_name] is used to identify the cache when debugging. [cache_size] is currently unused. *) (** Existential ([||]) or universal ([&&]) predicates. *) type predicate_type = ExistentialPredicate | UniversalPredicate (** Does the given predicate hold or not. [PUnknown] indicates that the result is uncertain, and that the more aggressive analysis should be used. *) type predicate_result = PTrue | PFalse | PUnknown val binary_predicate: cache_type -> predicate_type -> decide_fast:(t -> t -> predicate_result) -> decide_fst:(key -> v -> bool) -> decide_snd:(key -> v -> bool) -> decide_both:(key -> v -> v -> bool) -> t -> t -> bool (** Same functionality as [generic_predicate] but with a different signature. All decision functions return a boolean that are combined differently depending on whether the predicate is existential or universal. *) val generic_symmetric_predicate : exn -> decide_fast:(t -> t -> decide_fast) -> decide_one:(key -> v -> unit) -> decide_both:(v -> v -> unit) -> t -> t -> unit (** Same as [generic_predicate], but for a symmetric relation. [decide_fst] and [decide_snd] are thus merged into [decide_one]. *) val symmetric_binary_predicate: cache_type -> predicate_type -> decide_fast:(t -> t -> predicate_result) -> decide_one:(key -> v -> bool) -> decide_both:(key -> v -> v -> bool) -> t -> t -> bool (** Same as [binary_predicate], but for a symmetric relation. [decide_fst] and [decide_snd] are thus merged into [decide_one]. *) val decide_fast_inclusion: t -> t -> predicate_result (** Function suitable for the [decide_fast] argument of [binary_predicate], when testing for inclusion of the first map into the second. If the two arguments are equal, or the first one is empty, the relation holds. *) val decide_fast_intersection: t -> t -> predicate_result (** Function suitable for the [decide_fast] argument of [symmetric_binary_predicate] when testing for a non-empty intersection between two maps. If one map is empty, the intersection is empty. Otherwise, if the two maps are equal, the intersection is non-empty. *) val cached_fold : cache_name:string -> temporary:bool -> f:(key -> v -> 'b) -> joiner:('b -> 'b -> 'b) -> empty:'b -> t -> 'b val cached_map : cache:string * int -> temporary:bool -> f:(key -> v -> v) -> t -> t val singleton: key -> v -> t (** [singleton k d] returns a map whose only binding is from [k] to [d]. *) val is_singleton: t -> (key * v) option (** [is_singleton m] returns [Some (k, d)] if [m] is a singleton map that maps [k] to [d]. Otherwise, it returns [None]. *) val on_singleton: (key -> v -> bool) -> t -> bool (** [on_singleton f m] returns [f k d] if [m] is a singleton map that maps [k] to [d]. Otherwise, it returns false. *) val cardinal: t -> int (** [cardinal m] returns [m]'s cardinal, that is, the number of keys it binds, or, in other words, its domain's cardinal. *) val min_binding: t -> key * v val max_binding: t -> key * v val compositional_bool: t -> bool (** Value of the compositional boolean associated to the tree, as computed by the {!Compositional_bool} argument of the functor. *) val clear_caches: unit -> unit (** Clear all the persistent caches used internally by the functions of this module. Those caches are not project-aware, so this function must be called at least each time a project switch occurs. *) val from_shape: (key -> 'a -> v) -> 'a shape -> t (** Build an entire map from another map indexed by the same keys. More efficient than just performing successive {!add} the elements of the other map *) val from_shape_id: v shape -> t (** Same as [from_shape (fun _ v -> v)]. *) val shape: t -> v shape (** Export the map as a value suitable for functions {!inter_with_shape} and {!from_shape} *) val fold2_join_heterogeneous: cache:cache_type -> empty_left:('a shape -> 'b) -> empty_right:(t -> 'b) -> both:(key -> v -> 'a -> 'b) -> join:('b -> 'b -> 'b) -> empty:'b -> t -> 'a shape -> 'b (** [fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty m1 m2] iterates simultaneously on [m1] and [m2]. If a subtree [t] is present in [m1] but not in [m2] (resp. in [m2] but not in [m1]), [empty_right t] (resp. [empty_left t]) is called. If a key [k] is present in both trees, and bound to [v1] and [v2] respectively, [both k v1 v2] is called. If both trees are empty, [empty] is returned. The values of type ['b] returned by the auxiliary functions are merged using [join], which is called in an unspecified order. The results of the function may be cached, depending on [cache]. *) (**/**) (* Undocumented. *) val pretty_debug: Format.formatter -> t -> unit (* Prefixes. *) val comp_prefixes : t -> t -> unit val pretty_prefix : prefix -> Format.formatter -> t -> unit type subtree exception Found_prefix of prefix * subtree * subtree val find_prefix : t -> prefix -> subtree option val hash_subtree : subtree -> int val equal_subtree : subtree -> subtree -> bool end frama-c-20.0-Calcium/src/libraries/utils/hptset.ml0000666000000000000000000001467413571573400016773 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type S = sig include Datatype.S_with_collections include FCSet.S_Basic_Compare with type t := t val contains_single_elt: t -> elt option val intersects: t -> t -> bool type action = Neutral | Absorbing | Traversing of (elt -> bool) val merge : cache:Hptmap_sig.cache_type -> symmetric:bool -> idempotent:bool -> decide_both:(elt -> bool) -> decide_left:action -> decide_right:action -> t -> t -> t type 'a shape val shape: t -> unit shape val from_shape: 'a shape -> t val fold2_join_heterogeneous: cache:Hptmap_sig.cache_type -> empty_left:('a shape -> 'b) -> empty_right:(t -> 'b) -> both:(elt -> 'a -> 'b) -> join:('b -> 'b -> 'b) -> empty:'b -> t -> 'a shape -> 'b val clear_caches: unit -> unit val pretty_debug: t Pretty_utils.formatter end module Make(X: Hptmap.Id_Datatype) (Initial_Values : sig val v : X.t list list end) (Datatype_deps: sig val l : State.t list end) : sig include S with type elt = X.t and type 'a shape = 'a Hptmap.Shape(X).t val self : State.t end = struct type elt = X.t module M = Hptmap.Make (X) (struct include Datatype.Unit let pretty_debug = pretty end) (Hptmap.Comp_unused) (struct let v = List.map (List.map (fun k -> k, ())) Initial_Values.v end) (Datatype_deps) include M let add k s = add k () s let iter f s = iter (fun x () -> f x) s let fold f s = fold (fun x () -> f x) s let elements s = fold (fun h t -> h::t) s [] let contains_single_elt s = match is_singleton s with Some (k, _v) -> Some k | None -> None let choose s = fst (min_binding s) let partition f s = fold (fun x (w, wo) -> if f x then add x w, wo else w, add x wo) s (empty, empty) let mem x s = try find x s; true with Not_found -> false let find x s = find_key x s let inter = let name = Format.sprintf "Hptset(%s).inter" X.name in inter ~cache:(Hptmap_sig.PersistentCache name) ~symmetric:true ~idempotent:true ~decide:(fun _ () () -> Some ()) (* Test that implementation of function inter in Hptmap is correct *) let _test_inter s1 s2 = let i1 = fold (fun x acc -> if mem x s1 then add x acc else acc) s2 empty in let i2 = inter s1 s2 in if not (i1 == i2) then Cmdline.Kernel_log.error "%a@./@.%a@.->@.%a@./@.%a" pretty_debug s1 pretty_debug s2 pretty_debug i1 pretty_debug i2; i1 let union = let name = Format.sprintf "Hptset(%s).union" X.name in join ~cache:(Hptmap_sig.PersistentCache name) ~decide:(fun _ () () -> ()) ~symmetric:true ~idempotent:true let singleton x = add x empty let exists f s = exists (fun k () -> f k) s let for_all f s = for_all (fun k () -> f k) s let subset = let name = Format.sprintf "Hptset(%s).subset" X.name in binary_predicate (Hptmap_sig.PersistentCache name) UniversalPredicate ~decide_fast:decide_fast_inclusion ~decide_fst:(fun _ () -> false) ~decide_snd:(fun _ () -> true) ~decide_both:(fun _ () () -> true) let pretty = if X.pretty == Datatype.undefined then Datatype.undefined else Pretty_utils.pp_iter ~pre:"@[{" ~sep:",@ " ~suf:"}@]" iter X.pretty let intersects = let name = Format.asprintf "Hptset(%s).intersects" X.name in symmetric_binary_predicate (Hptmap_sig.PersistentCache name) ExistentialPredicate ~decide_fast:decide_fast_intersection ~decide_one:(fun _ () -> false) ~decide_both:(fun _ () () -> true) let of_list l = List.fold_left (fun acc key -> add key acc) empty l type action = Neutral | Absorbing | Traversing of (elt -> bool) let translate_action = function | Neutral -> M.Neutral | Absorbing -> M.Absorbing | Traversing f -> M.Traversing (fun k () -> if f k then Some () else None) let merge ~cache ~symmetric ~idempotent ~decide_both ~decide_left ~decide_right = let decide_both = fun k () () -> if decide_both k then Some () else None and decide_left = translate_action decide_left and decide_right = translate_action decide_right in merge ~cache ~symmetric ~idempotent ~decide_both ~decide_left ~decide_right let diff = let name = Format.sprintf "Hptset(%s).diff" X.name in merge ~cache:(Hptmap_sig.PersistentCache name) ~symmetric:false ~idempotent:false ~decide_both:(fun _ -> false) ~decide_left:Neutral ~decide_right:Absorbing let from_shape m = from_shape (fun _ _ -> ()) m (* Partial application is needed because of caches *) let fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty = let both k () v = both k v in fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/hptset.mli0000666000000000000000000000677413571573400017146 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Sets over ordered types. This module implements the set data structure. All operations over sets are purely applicative (no side-effects). *) (** Output signature of the functor {!Set.Make}. *) module type S = sig include Datatype.S_with_collections include FCSet.S_Basic_Compare with type t := t (** The datatype of sets. *) val contains_single_elt: t -> elt option val intersects: t -> t -> bool (** [intersects s1 s2] returns [true] if and only if [s1] and [s2] have an element in common *) type action = Neutral | Absorbing | Traversing of (elt -> bool) val merge : cache:Hptmap_sig.cache_type -> symmetric:bool -> idempotent:bool -> decide_both:(elt -> bool) -> decide_left:action -> decide_right:action -> t -> t -> t type 'a shape (** Shape of the set, ie. the unique shape of its OCaml value. *) val shape: t -> unit shape (** Export the shape of the set. *) val from_shape: 'a shape -> t (** Build a set from another [elt]-indexed map or set. *) val fold2_join_heterogeneous: cache:Hptmap_sig.cache_type -> empty_left:('a shape -> 'b) -> empty_right:(t -> 'b) -> both:(elt -> 'a -> 'b) -> join:('b -> 'b -> 'b) -> empty:'b -> t -> 'a shape -> 'b (** Clear all the caches used internally by the functions of this module. Those caches are not project-aware, so this function must be called at least each a project switch occurs. *) val clear_caches: unit -> unit val pretty_debug: t Pretty_utils.formatter end module Make(X: Hptmap.Id_Datatype) (Initial_Values : sig val v : X.t list list end) (Datatype_deps: sig val l : State.t list end) : sig include S with type elt = X.t and type 'a shape = 'a Hptmap.Shape(X).t val self : State.t end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/indexer.ml0000666000000000000000000001317413571573400017114 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Index of items --- *) (* -------------------------------------------------------------------------- *) module type Elt = sig type t val compare : t -> t -> int end module Make(E : Elt) = struct type t = | Empty | Node of int * t * E.t * t (* -------------------------------------------------------------------------- *) (* --- Access --- *) (* -------------------------------------------------------------------------- *) let size = function Empty -> 0 | Node(n,_,_,_) -> n let is_empty = function Empty -> true | Node _ -> false let rec lookup n a = function | Empty -> raise Not_found | Node(_,p,e,q) -> let cmp = E.compare a e in if cmp < 0 then lookup n a p else if cmp > 0 then lookup (n+size p+1) a q else n + size p let index = lookup 0 let rindex e t = try index e t with Not_found -> (-1) let rec mem a = function | Empty -> false | Node(_,p,e,q) -> let cmp = E.compare a e in if cmp < 0 then mem a p else if cmp > 0 then mem a q else true let rec get k = function | Empty -> raise Not_found | Node(_,p,e,q) -> let n = size p in if k < n then get k p else if k > n then get (k-n-1) q else e let rec iter f = function | Empty -> () | Node(_,p,e,q) -> iter f p ; f e ; iter f q let rec walk n f = function | Empty -> () | Node(_,p,e,q) -> let m = n + size p in walk n f p ; f m e ; walk (m+1) f q let iteri = walk 0 (* -------------------------------------------------------------------------- *) (* --- Constructors --- *) (* -------------------------------------------------------------------------- *) let empty = Empty let node p e q = Node(size p + size q + 1,p,e,q) (*TODO: can be better *) let rec balance p e q = match p , q with | Node(_,p1,x,p2) , _ when size q < size p1 -> node p1 x (balance p2 e q) | _ , Node(_,q1,y,q2) when size p < size q2 -> node (balance p e q1) y q2 | _ -> node p e q (* -------------------------------------------------------------------------- *) (* --- Add,Remove --- *) (* -------------------------------------------------------------------------- *) let rec add a = function | Empty -> Node(1,Empty,a,Empty) | Node(n,p,e,q) -> let cmp = E.compare a e in if cmp < 0 then balance (add a p) e q else if cmp > 0 then balance p e (add a q) else Node(n,p,a,q) (* requires x r | Node(n,p1,x,p2) , Node(m,q1,y,q2) -> if n >= m then balance p1 x (join p2 q) else balance (join p q1) y q2 let rec remove a = function | Empty -> Empty | Node(_,p,e,q) -> let cmp = E.compare a e in if cmp < 0 then balance (remove a p) e q else if cmp > 0 then balance p e (remove a q) else join p q let rec filter f = function | Empty -> Empty | Node(_,p,e,q) -> let p = filter f p in let q = filter f q in if f e then balance p e q else join p q (* -------------------------------------------------------------------------- *) (* --- Update --- *) (* -------------------------------------------------------------------------- *) let update x y t = match x , y with | None , None -> (* identify *) 0,-1,t | Some x , None -> (* remove x *) let i = rindex x t in if i < 0 then 0,-1,t else i,size t-1,remove x t | None , Some y -> (* add y *) let t = add y t in let j = index y t in j , size t-1 , t | Some x , Some y -> let i = rindex x t in if i < 0 then let t = add y t in let j = rindex y t in j , size t-1 , t else let t = add y (remove x t) in let j = rindex y t in min i j , max i j , t end frama-c-20.0-Calcium/src/libraries/utils/indexer.mli0000666000000000000000000000515713571573400017267 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Indexer implements ordered collection of items with random access. It is suitable for building fast access operations in GUI tree and list widgets. *) module type Elt = sig type t val compare : t -> t -> int end module Make(E : Elt) : sig type t val size : t -> int (** Number of elements in the collection. Constant time. *) val mem : E.t -> t -> bool (** Log complexity. *) val get : int -> t -> E.t (** raises Not_found. Log complexity. *) val index : E.t -> t -> int (** raise Not_found. Log complexity. *) val is_empty : t -> bool val empty : t val add : E.t -> t -> t (** Log complexity. *) val remove : E.t -> t -> t (** Log complexity. *) val filter : (E.t -> bool) -> t -> t (** Linear. *) val update : E.t option -> E.t option -> t -> int * int * t (** [update x y t] replaces [x] by [y] and returns the range [a..b] of modified indices. Log complexity. *) val iter : (E.t -> unit) -> t -> unit (** Linear. *) val iteri : (int -> E.t -> unit) -> t -> unit (** Linear. *) end frama-c-20.0-Calcium/src/libraries/utils/json.mli0000666000000000000000000001216313571573400016575 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Json Library Remarks: - UTF-8 escaping is not supported; - Parsers are less {i strict} than Json format; - Printers are supposed to {i strictly} conforms to Json format; - [Number] can be used to encode non OCaml-primitive numbers, for instance Zarith. *) (** Json Objects Same type than [Yojson.Basic.json] *) type json = [ `Assoc of (string * json) list | `Bool of bool | `Float of float | `Int of int | `List of json list | `Null | `String of string ] type t = json val equal : t -> t -> bool (** Pervasives *) val compare : t -> t -> int (** Pervasives *) val pp : Format.formatter -> t -> unit val pp_dump : Format.formatter -> t -> unit (** without formatting *) exception Error of Filepath.Normalized.t * int * string (** file, line, message *) (** {2 Constructors} *) val of_bool : bool -> t val of_int : int -> t val of_string : string -> t val of_float : float -> t val of_list : t list -> t val of_array : t array -> t val of_fields : (string * t) list -> t (** {2 Parsers} Parsing raise [Error] in case of error. *) val load_lexbuf : Lexing.lexbuf -> t (** Consumes the entire buffer. *) val load_channel : ?file:string -> in_channel -> t (** Parses the stream until EOF. *) val load_string : string -> t (** Parses the Json in the string. *) val load_file : string -> t (** May also raise system exception. *) (** {2 Printers} Printers use formatting unless [~pretty:false]. *) val save_string : ?pretty:bool -> t -> string val save_buffer : ?pretty:bool -> Buffer.t -> t -> unit val save_channel : ?pretty:bool -> out_channel -> t -> unit val save_formatter : ?pretty:bool -> Format.formatter -> t -> unit val save_file : ?pretty:bool -> string -> t -> unit (** {2 Accessors} Accessors raise exception [Invalid_argument] in case of wrong format. *) val bool : t -> bool (** Extract [True] and [False] only. @raise Invalid_argument when the conversion fails. *) val int : t -> int (** Convert [Null], [Int], [Float], [Number] and [String] to an [int]. Floats are truncated with [int_of_float] and [Null] to 0. @raise Invalid_argument when the conversion fails. *) val string : t -> string (** Convert [Null], [Int], [Float], [Number] and [String] to a [string]. Floats are truncated with [string_of_float] and [Null] to [""]. @raise Invalid_argument when the conversion fails. *) val float : t -> float (** Convert [Null], [Int], [Float], [Number] and [String] to [float] and [Null] to [0.0]. @raise Invalid_argument when the conversion fails. *) val array : t -> t array (** Extract the array of an [Array] object. [Null] is considered an empty array. @raise Invalid_argument if the object is not an array. *) val list : t -> t list (** Extract the list of an [Array] object. [Null] is considered an empty list. @raise Invalid_argument if the object is not a list. *) val assoc : t -> (string * t) list (** Extract the list of an [Assoc] object. [Null] is considered an empty assoc. @raise Invalid_argument if the object is not a list. *) val fold : (string -> t -> 'a -> 'a) -> t -> 'a -> 'a (** Fold over all fields of the object. [Null] is considered an empty object. Typical usage is [fold M.add t M.empty] where [M=Map.Make(String)]. @raise Invalid_argument if the object is not an [Assoc] or [Null] object. *) val field : string -> t -> t (** Lookup a field in an object. [Null] is considered an empty object. @raise Not_found if the field is absent from the object. @raise Invalid_argument if the object is not an [Assoc] or [Null] object. *) frama-c-20.0-Calcium/src/libraries/utils/json.mll0000666000000000000000000002244113571573400016600 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Json Parser/Lexer --- *) (* -------------------------------------------------------------------------- *) { type json = [ `Assoc of (string * json) list | `Bool of bool | `Float of float | `Int of int | `List of json list | `Null | `String of string ] type t = json let equal = (=) let compare = Transitioning.Stdlib.compare type token = EOF | TRUE | FALSE | NULL | KEY of char | STR of string | INT of string | DEC of string } rule token = parse '\n' { Lexing.new_line lexbuf ; token lexbuf } | [ ' ' '\t' '\r' ] { token lexbuf } | '"' { let buffer = Buffer.create 80 in string buffer lexbuf ; STR(Buffer.contents buffer) } | '-'? [ '0'-'9' ]+ { INT(Lexing.lexeme lexbuf) } | '-'? [ '0'-'9' ]* '.' ['0'-'9']* ( ['e' 'E'] ['-' '+']? ['0'-'9']+ )? { DEC(Lexing.lexeme lexbuf) } | [ '[' ']' '{' '}' ':' ',' ] as c { KEY c } | "true" { TRUE } | "false" { FALSE } | "null" { NULL } | eof { EOF } | _ { failwith "un-recognised token" } and string buffer = parse | '"' { () } | "\\\\" { Buffer.add_char buffer '\\' ; string buffer lexbuf } | "\\n" { Buffer.add_char buffer '\n' ; string buffer lexbuf } | "\\t" { Buffer.add_char buffer '\t' ; string buffer lexbuf } | "\\r" { Buffer.add_char buffer '\r' ; string buffer lexbuf } | "\\\"" { Buffer.add_char buffer '"' ; string buffer lexbuf } | '\n' | eof { failwith "non-terminated string" } | _ as c { Buffer.add_char buffer c ; string buffer lexbuf } { type input = { lexbuf : Lexing.lexbuf ; mutable token : token ; } let skip input = if input.token <> EOF then input.token <- token input.lexbuf (* Termination hints: - unless EOF, parse_value always eat a token - parse_array always eat a token or call parse_value with non-EOF input - parse_object always eat a token - parse_entry always eat a token or call parse_value with non-EOF input *) let rec parse_value input = match input.token with | EOF -> `Null | TRUE -> skip input ; `Bool true | FALSE -> skip input ; `Bool false | NULL -> skip input ; `Null | STR a -> skip input ; `String a | INT a -> skip input ; (try `Int(int_of_string a) with _ -> `String a) | DEC a -> skip input ; (try `Float(float_of_string a) with _ -> `String a) | KEY '[' -> skip input ; `List (parse_array [] input) | KEY '{' -> skip input ; `Assoc (parse_object [] input) | _ -> failwith "unexpected token" and parse_array es input = match input.token with | EOF -> failwith "non-terminated array" | KEY ']' -> skip input ; List.rev es | KEY ',' -> skip input ; parse_array es input | _ -> let e = parse_value input in parse_array (e::es) input and parse_object es input = match input.token with | EOF -> failwith "non-terminated record" | KEY '}' -> skip input ; List.rev es | KEY ',' -> skip input ; parse_object es input | STR a -> skip input ; let e = parse_entry a input in parse_object (e::es) input | _ -> failwith "missing name" and parse_entry a input = match input.token with | EOF -> failwith "non-terminated record" | KEY ':' -> skip input ; parse_entry a input | _ -> a , parse_value input let parse_file input = let content = parse_value input in if input.token <> EOF then failwith "unexpected end-of-file" ; content exception Error of Filepath.Normalized.t * int * string let error lexbuf msg = let open Lexing in let position = Lexing.lexeme_start_p lexbuf in let token = Lexing.lexeme lexbuf in let path = Filepath.Normalized.of_string position.pos_fname in Error(path,position.pos_lnum, Printf.sprintf "%s (at %S)" msg token) let load_lexbuf lexbuf = try let token = token lexbuf in parse_file { lexbuf ; token } with Failure msg -> raise (error lexbuf msg) let load_string text = load_lexbuf (Lexing.from_string text) let load_channel ?file inc = let lexbuf = Lexing.from_channel inc in begin match file with | None -> () | Some pos_fname -> let open Lexing in lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with pos_fname } end ; load_lexbuf lexbuf let load_file file = let inc = open_in file in try let content = load_channel ~file inc in close_in inc ; content with e -> close_in inc ; raise e let rec pp fmt v = let open Format in match v with | `Null -> pp_print_string fmt "null" | `Bool b -> pp_print_bool fmt b | `String s -> fprintf fmt "%S" s | `Int a -> pp_print_int fmt a | `Float f -> pp_print_float fmt f | `List [] -> pp_print_string fmt "[]" | `List (e::es) -> Format.fprintf fmt "@[[ %a" pp e ; List.iter (fun e -> Format.fprintf fmt ",@ %a" pp e) es ; Format.fprintf fmt " ]@]" | `Assoc [] -> pp_print_string fmt "{}" | `Assoc (e::es) -> Format.fprintf fmt "@[{ %a" pp_entry e ; List.iter (fun e -> Format.fprintf fmt ",@ %a" pp_entry e) es ; Format.fprintf fmt " }@]" and pp_entry fmt (a,v) = Format.fprintf fmt "@[%S: %a@]" a pp v let dump_string f s = let quote = "\"" in f quote ; f (String.escaped s) ; f quote let rec dump f = function | `Null -> f "null" | `Bool true -> f "true" | `Bool false -> f "false" | `String s -> dump_string f s | `Int a -> f (string_of_int a) | `Float x -> f (string_of_float x) | `List [] -> f "[]" | `List (e::es) -> f "[" ; dump f e ; List.iter (fun e -> f "," ; dump f e) es ; f "]" | `Assoc [] -> f "{}" | `Assoc (e::es) -> f "{" ; dump_entry f e ; List.iter (fun e -> f "," ; dump_entry f e) es ; f "}" and dump_entry f (a,v) = dump_string f a ; f ":" ; dump f v let pp_dump fmt v = dump (Format.pp_print_string fmt) v let save_buffer ?(pretty=true) buffer v = if pretty then Format.fprintf (Format.formatter_of_buffer buffer) "@[%a@]@." pp v else (dump (Buffer.add_string buffer) v ; Buffer.add_char buffer '\n' ) let save_string ?(pretty=true) v = let buffer = Buffer.create 80 in save_buffer ~pretty buffer v ; Buffer.contents buffer let save_channel ?(pretty=true) out v = if pretty then Format.fprintf (Format.formatter_of_out_channel out) "@[%a@]@." pp v else (dump (output_string out) v ; output_char out '\n' ; flush out) let save_formatter ?(pretty=true) fmt v = if pretty then pp fmt v else pp_dump fmt v let save_file ?(pretty=true) file v = let out = open_out file in try save_channel ~pretty out v ; close_out out with e -> close_out out ; raise e let invalid name = raise (Invalid_argument ("Json." ^ name)) let bool = function | `Bool b -> b | _ -> invalid "bool" let int = function | `Null -> 0 | `Int n -> n | `Float f -> (try int_of_float f with _ -> invalid "int") | _ -> invalid "int" let float = function | `Null -> 0.0 | `Float f -> f | `Int n -> (try float_of_int n with _ -> invalid "float") | _ -> invalid "float" let string = function | `Null -> "" | `Int n -> string_of_int n | `Float f -> string_of_float f | `String s -> s | _ -> invalid "string" let list = function | `Null -> [] | `List es -> es | _ -> invalid "list" let array = function | `Null -> [| |] | `List es -> Array.of_list es | _ -> invalid "array" let assoc = function | `Null -> [] | `Assoc fs -> fs | _ -> invalid "assoc" let field f = function | `Null -> raise Not_found | `Assoc fs -> List.assoc f fs | _ -> invalid "field" let fold f v w = match v with | `Null -> w | `Assoc fs -> List.fold_left (fun w (e,v) -> f e v w) w fs | _ -> invalid "fold" let of_bool b = `Bool b let of_int k = `Int k let of_string s = `String s let of_float f = `Float f let of_list xs = `List xs let of_array xs = `List (Array.to_list xs) let of_fields m = `Assoc m } frama-c-20.0-Calcium/src/libraries/utils/markdown.ml0000666000000000000000000003511413571573400017276 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type align = Left | Center | Right type href = | URL of string | Page of string | Section of string * string type inline = | Plain of string | Emph of string | Bold of string | Inline_code of string | Link of text * href (** [Link(text,url)] *) | Image of string * string (** [Image(alt,location)] *) and text = inline list type block_element = | Text of text (** single paragraph of text. *) | Block_quote of element list | UL of block list | OL of block list | DL of (text * text) list (** definition list *) | EL of (string option * text) list (** example list *) | Code_block of string * string list and block = block_element list and table = { caption: text option; header: (text * align) list; content: text list list; } and element = | Comment of string (** markdown comment, printed *) | Block of block | Table of table | Raw of string list (** Each element of the list is printed as-is on its own line. A blank line separates the [Raw] node from the next one. *) | H1 of text * string option | H2 of text * string option | H3 of text * string option | H4 of text * string option | H5 of text * string option | H6 of text * string option and elements = element list type pandoc_markdown = { title: text; authors: text list; date: text; elements: elements } let glue ?sep ls = match sep , ls with | (None | Some []) , _ -> List.concat ls | _ , [] -> [] | _ , [l] -> l | Some s , ls -> (* tailrec *) let rec aux sep w = function | [] -> List.rev w | [e] -> List.rev_append w e | e::el -> aux sep (List.rev_append sep (List.rev_append e w)) el in aux s [] ls (* -------------------------------------------------------------------------- *) (* --- Formatting --- *) (* -------------------------------------------------------------------------- *) let plain s = [ Plain s ] let emph s = [ Emph s ] let bold s = [ Bold s ] let code s = [ Inline_code s ] let format txt = Format.kasprintf plain txt let image ~alt ~file = [Image(alt,file)] let href ?text href = let txt = match text with Some txt -> txt | None -> let tt = match href with URL u -> u | Page p -> p | Section(_,s) -> s in [Inline_code tt] in [Link(txt, href)] let url ?text addr = href ?text (URL addr) let link ?text ?page ?name () = href ?text @@ match page, name with | None, None -> Page "" | Some p, None -> Page p | None, Some a -> Section("",a) | Some p, Some a -> Section(p,a) let codeblock ?(lang="") content = let buffer = Buffer.create 120 in let fmt = Format.formatter_of_buffer buffer in Format.pp_open_hvbox fmt 0 ; Format.kfprintf (fun fmt -> Format.pp_close_box fmt () ; Format.pp_print_flush fmt () ; let code = Buffer.contents buffer |> String.trim in let lines = String.split_on_char '\n' code in [Code_block(lang,lines)] ) fmt content let text text = [Text text] let list items = [UL items] let enum items = [OL items] let description items = [DL items] let par text = [Block [Text text]] let block b = [Block b] (* -------------------------------------------------------------------------- *) (* --- Sectioning --- *) (* -------------------------------------------------------------------------- *) let rawfile filename = let chan = open_in filename in let res = ref [] in try while true do res := input_line chan :: !res; done; assert false with End_of_file -> close_in chan; [Raw (List.rev !res)] let label m = let buffer = Buffer.create (String.length m) in let lowercase = Char.lowercase_ascii in let dash = ref false in let emit c = if !dash then (Buffer.add_char buffer '-' ; dash := false) ; Buffer.add_char buffer c in String.iter (function | '0'..'9' as c -> emit c | 'a'..'z' as c -> emit c | 'A'..'Z' as c -> emit (lowercase c) | '.' | '_' as c -> emit c | ' ' | '\t' | '\n' | '-' -> dash := (Buffer.length buffer > 0) | _ -> ()) m ; Buffer.contents buffer let section ?name ~title elements = let anchor = label @@ match name with Some n -> n | None -> title in (H1 ([Plain title], Some anchor)) :: elements let subsections header body = let body = List.map (function | H1(t,h) -> H2(t,h) | H2(t,h) -> H3(t,h) | H3(t,h) -> H4(t,h) | H4(t,h) -> H5(t,h) | e -> e) (List.concat body) in header @ body let mk_date = function | Some d -> d | None -> let tm = Unix.gmtime (Unix.time()) in format "%d-%02d-%02d" (1900 + tm.Unix.tm_year) (1 + tm.Unix.tm_mon) tm.Unix.tm_mday let pandoc ?(title=[Plain ""]) ?(authors=[]) ?date elements = { title; authors; date = mk_date date ; elements } (* -------------------------------------------------------------------------- *) (* --- Printers --- *) (* -------------------------------------------------------------------------- *) let relativize page target = let page_dir = String.split_on_char '/' page in let target_dir = String.split_on_char '/' target in let go_up l = List.map (fun _ -> "..") l in let rec remove_common l1 l2 = match l1 with | [] -> assert false (* split on char is always non-empty *) | [_f1] -> l2 | d1 :: p1 -> match l2 with | [] -> assert false | [_f2 ] -> (* it's the length of the argument to go_up that matters, not its exact content *) go_up p1 @ l2 | d2 :: p2 when d2 = d1 -> remove_common p1 p2 | _ -> go_up p1 @ l2 in let relative = remove_common page_dir target_dir in String.concat "/" relative let pp_href ?(page="") fmt = function | URL s -> Format.pp_print_string fmt s | Page s -> Format.pp_print_string fmt (relativize page s) | Section (p,s) -> Format.fprintf fmt "%s#%s" (relativize page p) (label s) let rec pp_inline ?page fmt = function | Plain s -> Format.pp_print_string fmt s | Emph s -> Format.fprintf fmt "_%s_" (String.trim s) | Bold s -> Format.fprintf fmt "**%s**" (String.trim s) | Inline_code s -> Format.fprintf fmt "`%s`" (String.trim s) | Link (text,url) -> Format.fprintf fmt "@[[%a](%a)@]@ " (pp_text ?page) text (pp_href ?page) url | Image (alt,url) -> Format.fprintf fmt "@[![%s](%s)@]@ " alt url and pp_text ?page fmt l = match l with | [] -> () | [ elt ] -> pp_inline ?page fmt elt | elt :: text -> (* tailrec *) pp_inline ?page fmt elt ; Format.pp_print_space fmt () ; pp_text ?page fmt text let pp_lab fmt = function | None -> () | Some lab -> Format.fprintf fmt " {#%s}" lab let test_size ?page txt = let pp_text fmt = pp_text ?page fmt in String.length (Format.asprintf "%a" pp_text txt) let pp_dashes fmt size = let dashes = String.make (size + 2) '-' in Format.fprintf fmt "%s+" dashes let pp_sep_line fmt sizes = Format.fprintf fmt "@[+"; List.iter (pp_dashes fmt) sizes; Format.fprintf fmt "@]@\n" let pp_header ?page fmt (t,_) size = let real_size = test_size ?page t in let spaces = String.make (size - real_size) ' ' in Format.fprintf fmt " %a%s |" (pp_text ?page) t spaces let pp_headers ?page fmt l sizes = Format.fprintf fmt "@[|"; List.iter2 (pp_header ?page fmt) l sizes; Format.fprintf fmt "@]@\n" let compute_sizes headers contents = let check_line i m line = try max m (test_size (List.nth line i) + 2) with Failure _ -> m in let column_size (i,l) (h,_) = let max = List.fold_left (check_line i) (test_size h) contents in (i+1, max :: l) in let (_,sizes) = List.fold_left column_size (0,[]) headers in List.rev sizes let pp_align fmt align size = let sep = String.make size '=' in match align with | (_,Left) -> Format.fprintf fmt ":%s=+" sep | (_,Center) -> Format.fprintf fmt ":%s:+" sep | (_,Right) -> Format.fprintf fmt "%s=:+" sep let pp_aligns fmt headers sizes = Format.fprintf fmt "@[+"; List.iter2 (pp_align fmt) headers sizes; Format.fprintf fmt "@]@\n" let pp_table_cell ?page fmt size t = let real_size = test_size t in let spaces = String.make (size - real_size) ' ' in Format.fprintf fmt " %a%s |" (pp_text ?page) t spaces let pp_table_line ?page fmt sizes l = Format.fprintf fmt "@[|"; List.iter2 (pp_table_cell ?page fmt) sizes l; Format.fprintf fmt "@]@\n"; pp_sep_line fmt sizes let pp_table_content ?page fmt l sizes = Format.fprintf fmt "@["; List.iter (pp_table_line ?page fmt sizes) l; Format.fprintf fmt "@]" let pp_table_caption ?page fmt = function None -> () | Some t -> Format.fprintf fmt "@[Table: %a@]@\n@\n" (pp_text ?page) t [@@@ warning "-32"] let pp_table_extended ?page fmt { caption; header; content } = begin pp_table_caption ?page fmt caption; let sizes = compute_sizes header content in pp_sep_line fmt sizes; pp_headers ?page fmt header sizes; pp_aligns fmt header sizes; pp_table_content ?page fmt content sizes; end [@@@ warning "+32"] let pp_table_inlined ?page fmt { caption; header; content } = begin pp_table_caption ?page fmt caption; let pp = pp_text ?page in Format.fprintf fmt "@[@["; List.iter (function (h,_) -> Format.fprintf fmt "| %a " pp h) header; Format.fprintf fmt "|@]@\n@["; List.iter (fun (h,align) -> let dash h k = String.make (max 3 (test_size ?page h + k)) '-' in match align with | Left -> Format.fprintf fmt "|:%s" (dash h 1) | Right -> Format.fprintf fmt "|%s:" (dash h 1) | Center -> Format.fprintf fmt "|:%s:" (dash h 0) ) header; Format.fprintf fmt "|@]@\n" ; List.iter (fun row -> Format.fprintf fmt "@[" ; List.iter (fun col -> Format.fprintf fmt "| %a " pp col) row ; Format.fprintf fmt "|@]@\n" ; ) content ; Format.fprintf fmt "@]" ; end let rec pp_block_element ?page fmt e = let pp_text fmt = pp_text ?page fmt in match e with | Text t -> Format.fprintf fmt "@[%a@]@\n" pp_text t | Block_quote l -> pp_quote ?page fmt l | UL l -> pp_list "*" ?page fmt l | OL l -> pp_list "#." ?page fmt l | DL l -> List.iter (fun (term,def) -> Format.fprintf fmt "@[%a@]@\n@\n@[: %a@]@\n@\n" pp_text term pp_text def) l | EL l -> List.iter (fun (lab,txt) -> match lab with | None -> Format.fprintf fmt "@[(@@) %a@]@\n" pp_text txt | Some s -> Format.fprintf fmt "@[(@@%s) %a@]@\n" s pp_text txt) l | Code_block (language, lines) -> Format.fprintf fmt "@[```%s@]@\n" language; List.iter (fun line -> Format.fprintf fmt "@[%s@]@\n" line) lines; Format.fprintf fmt "```@\n" and pp_list ?page prefix fmt l = List.iter (fun item -> Format.fprintf fmt "@[@[%s %a@]@]" prefix (pp_block ?page) item) l and pp_block ?page fmt l = match l with | [ elt ] -> pp_block_element ?page fmt elt | _ -> Format.fprintf fmt "%a@\n" (Format.pp_print_list ~pp_sep:Format.pp_force_newline (pp_block_element ?page)) l and pp_quote ?page fmt l = List.iter (fun elt -> Format.fprintf fmt "@[> %a@]" (pp_element ?page) elt) l and pp_element ?page fmt e = let pp_text fmt = pp_text ?page fmt in match e with | Block b -> Format.fprintf fmt "@[%a@]" (pp_block ?page) b | Raw l -> Format.( fprintf fmt "%a" (pp_print_list ~pp_sep:pp_force_newline pp_print_string) l) | Comment s -> Format.fprintf fmt "@[@[@]" Format.pp_print_text s | Table table -> pp_table_inlined ?page fmt table (* pp_table_extended ?page fmt table *) | H1(t,lab) -> Format.fprintf fmt "@[# %a%a@]" pp_text t pp_lab lab | H2(t,lab) -> Format.fprintf fmt "@[## %a%a@]" pp_text t pp_lab lab | H3(t,lab) -> Format.fprintf fmt "@[### %a%a@]" pp_text t pp_lab lab | H4(t,lab) -> Format.fprintf fmt "@[#### %a%a@]" pp_text t pp_lab lab | H5(t,lab) -> Format.fprintf fmt "@[##### %a%a@]" pp_text t pp_lab lab | H6(t,lab) -> Format.fprintf fmt "@[###### %a%a@]" pp_text t pp_lab lab and pp_elements ?page fmt l = let pp_sep fmt () = Format.pp_print_newline fmt (); Format.pp_print_newline fmt () in Format.pp_print_list ~pp_sep (pp_element ?page) fmt l let pp_authors ?page fmt l = List.iter (fun t -> Format.fprintf fmt "@[- %a@]@\n" (pp_text ?page) t) l let pp_pandoc ?page fmt { title; authors; date; elements } = Format.fprintf fmt "@["; if title <> [] || authors <> [] || date <> [] then begin Format.fprintf fmt "@[---@]@\n"; Format.fprintf fmt "@[title: %a@]@\n" (pp_text ?page) title; Format.fprintf fmt "@[author:@]@\n%a" (pp_authors ?page) authors; Format.fprintf fmt "@[date: %a@]@\n" (pp_text ?page) date; Format.fprintf fmt "@[...@]@\n"; Format.pp_print_newline fmt (); end; pp_elements ?page fmt elements; Format.fprintf fmt "@]%!" (* -------------------------------------------------------------------------- *) frama-c-20.0-Calcium/src/libraries/utils/markdown.mli0000666000000000000000000001636713571573400017460 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {2 Markdown Document} Structured representation of Markdown content. *) (** Table columns alignment *) type align = Left | Center | Right (** Local refs and URLs *) type href = | URL of string (** URL href is printed as it is. *) | Page of string (** URL relative to a common root. During pretty-printing, if given the path of the current document, the string will be modified accordingly. For instance, when writing to [foo/bar.md], [Page "foo/bla.md"] will be output as [(bla.md)]. *) | Section of string * string (** URL of an anchor within a [Page], see above. *) type inline = | Plain of string (** Printed as it is *) | Emph of string (** Printed as ["_……_"] *) | Bold of string (** Printed as ["**……**"] *) | Inline_code of string (** Printed as ["`……`"] *) | Link of text * href (** Hyperlink with text and URL *) | Image of string * string (** [Image(alt,path)] with alternative text and image file *) and text = inline list (** Inline elements separated by spaces *) type block_element = | Text of text (** Single paragraph of text. *) | Block_quote of element list | UL of block list | OL of block list | DL of (text * text) list (** definition list *) | EL of (string option * text) list (** example list *) | Code_block of string * string list and block = block_element list and table = { caption: text option; header: (text * align) list; content: text list list; } and element = | Comment of string (** markdown comment, printed *) | Block of block | Table of table | Raw of string list (** Each element of the list is printed as-is on its own line. A blank line separates the [Raw] node from the next one. *) | H1 of text * string option | H2 of text * string option | H3 of text * string option | H4 of text * string option | H5 of text * string option | H6 of text * string option and elements = element list type pandoc_markdown = { title: text; authors: text list; date: text; elements: elements } (** {2 Formatting Utilities} Remark: [text] values are list of [inline] values, hence you may combined with the [(@)] operator or with the [glue ?sep] utility function (see below). *) (** Plain markdown *) val plain: string -> text (** Emph text *) val emph: string -> text (** Bold text *) val bold: string -> text (** Inline code *) val code: string -> text (** Image *) val image: alt:string -> file:string -> text (** Href link *) val href: ?text:text -> href -> text (** Local links *) val link: ?text:text -> ?page:string -> ?name:string -> unit -> text (** URL links *) val url: ?text:text -> string -> text (** Plain markdown content of the formatted string *) val format: ('a, Format.formatter, unit, text) format4 -> 'a (** {2 Blocks Utilities} Remark: [block] values are list of [block_element] values, hence you may combined with the [(@)] operator or with the [glue ?sep] utility function (see below). *) (** Text Block *) val text : text -> block (** Itemized list *) val list : block list -> block (** Enumerated list *) val enum : block list -> block (** Description list *) val description : (text * text) list -> block (** [codeblock lang "...."] returns a [Code_block] for [code], written in [lang] with the given formatted content. The code block content placed inside an englobing hv-box, trimed and finally splitted into lines. *) val codeblock : ?lang:string -> ('a,Format.formatter,unit,block) format4 -> 'a (** {2 Document Elements} Remark: [elements] values are list of [element] values, hence you may combined with the [(@)] operator or with the [glue ?sep] utility function (see below). *) (** Single Paragraph element *) val par : text -> elements (** Block element *) val block : block -> elements (** Get the content of a file as raw markdown. @raise Sys_error if there's no such file. *) val rawfile: string -> elements (** {2 Document Structure} *) (** Creates a document from a list of elements and optional metadatas. Defaults are: - title: empty - authors: empty list - date: current day, in ISO format *) val pandoc: ?title:text -> ?authors: text list -> ?date: text -> elements -> pandoc_markdown (** Adds a [H1] header with the given [title] on top of the given elements. If name is not explicitly provided, the header will have as associated anchor [id title] *) val section: ?name:string -> title:string -> elements -> elements (** [subsections header body] returns a list of [element]s where the [body]'s headers have been increased by one (i.e. [H1] becomes [H2]). [H5] stays at [H5], though. *) val subsections: elements -> elements list -> elements (** {2 Other Utilities} *) (** Glue fragments, typically used for combining [text], [block] and [elements]. Default separator is empty. The function is tail-recursive. *) val glue: ?sep:'a list -> 'a list list -> 'a list (** Transforms a string into an anchor name, roughly following pandoc's conventions. This function is automatically used by pretty-printers and smart constructors to normalize section names and local links. *) val label: string -> string (** {2 Pretty-printers} *) val pp_inline: ?page:string -> Format.formatter -> inline -> unit val pp_text: ?page:string -> Format.formatter -> text -> unit val pp_block_element: ?page:string -> Format.formatter -> block_element -> unit val pp_block: ?page:string -> Format.formatter -> block -> unit val pp_element: ?page:string -> Format.formatter -> element -> unit val pp_elements: ?page:string -> Format.formatter -> elements -> unit val pp_pandoc: ?page:string -> Format.formatter -> pandoc_markdown -> unit frama-c-20.0-Calcium/src/libraries/utils/pretty_utils.ml0000666000000000000000000001746413571573400020233 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let null = Format.make_formatter (fun _ _ _ -> ()) (fun _ -> ()) let with_null k msg = Format.kfprintf (fun _ -> k ()) null msg let nullprintf msg = Format.ifprintf null msg let ksfprintf f fmt = let b = Buffer.create 20 in let return fmt = Format.pp_print_flush fmt (); f (Buffer.contents b) in Format.kfprintf return (Format.formatter_of_buffer b) fmt let sfprintf = Format.asprintf let to_string ?margin pp x = let b = Buffer.create 20 in let f = Format.formatter_of_buffer b in Extlib.may (Format.pp_set_margin f) margin; pp f x ; Format.pp_print_flush f () ; Buffer.contents b let rec pp_print_string_fill out s = if String.contains s ' ' then begin let i = String.index s ' ' in let l = String.length s in let s1 = String.sub s 0 i in let s2 = String.sub s (i+1) (l - i - 1) in Format.fprintf out "%s@ %a" s1 pp_print_string_fill s2 end else Format.pp_print_string out s type sformat = (unit,Format.formatter,unit) format type 'a formatter = Format.formatter -> 'a -> unit type ('a,'b) formatter2 = Format.formatter -> 'a -> 'b -> unit let pp_list ?(pre=format_of_string "@[") ?(sep=format_of_string "@,") ?(last=sep) ?(suf=format_of_string "@]") ?(empty=format_of_string "") pp_elt f l = let rec aux f = function | [] -> assert false | [ e ] -> Format.fprintf f "%a" pp_elt e | [ e1; e2 ] -> Format.fprintf f "%a%(%)%a" pp_elt e1 last pp_elt e2 | e :: l -> Format.fprintf f "%a%(%)%a" pp_elt e sep aux l in match l with | [] -> Format.fprintf f "%(%)" empty | _ :: _ as l -> Format.fprintf f "%(%)%a%(%)" pre aux l suf let pp_array ?(pre=format_of_string "@[") ?(sep=format_of_string "") ?(suf=format_of_string "@]") ?(empty=format_of_string "") pp_elt f xs = match xs with | [| |] -> Format.fprintf f "%(%)" empty | xs -> begin Format.fprintf f pre ; pp_elt f 0 xs.(0) ; for i = 1 to Array.length xs - 1 do Format.fprintf f sep ; pp_elt f i xs.(i) ; done ; Format.fprintf f suf ; end let pp_iter ?(pre=format_of_string "@[") ?(sep=format_of_string "") ?(suf=format_of_string "@]") iter pp fmt v = let need_sep = ref false in Format.fprintf fmt pre; iter (fun v -> if !need_sep then Format.fprintf fmt sep else need_sep := true; pp fmt v; ) v; Format.fprintf fmt suf; ;; let pp_iter2 ?(pre=format_of_string "@[") ?(sep=format_of_string "") ?(suf=format_of_string "@]") ?(between=format_of_string "@ ") iter pp_key pp_v fmt v = let need_sep = ref false in Format.fprintf fmt pre; iter (fun key v -> if !need_sep then Format.fprintf fmt sep else need_sep := true; Format.fprintf fmt "%a%(%)%a" pp_key key between pp_v v ) v; Format.fprintf fmt suf; ;; let pp_opt ?(pre=format_of_string "@[") ?(suf=format_of_string "@]") ?(none=format_of_string "") pp_elt f = function | None -> Format.fprintf f "%(%)" none | Some v -> Format.fprintf f "%(%)%a%(%)" pre pp_elt v suf let pp_cond ?(pr_false=format_of_string "") cond f pr_true = Format.fprintf f "%(%)" (if cond then pr_true else pr_false) let pp_pair ?(pre=format_of_string "@[") ?(sep=format_of_string ",@,") ?(suf=format_of_string "@]") pp_a pp_b fmt (a, b) = Format.fprintf fmt "%(%)%a%(%)%a%(%)" pre pp_a a sep pp_b b suf let escape_underscores = Str.global_replace (Str.regexp_string "_") "__" let pp_flowlist ?(left=format_of_string "(") ?(sep=format_of_string ",") ?(right=format_of_string ")") f out = function | [] -> Format.fprintf out "%(%)%(%)" left right | x::xs -> begin Format.fprintf out "@[%(%)%a" left f x ; List.iter (fun x -> Format.fprintf out "%(%)@,%a" sep f x) xs ; Format.fprintf out "%(%)@]" right ; end let pp_blocklist ?(left=format_of_string "{") ?(right=format_of_string "}") f out = function | [] -> Format.fprintf out "%(%)%(%)" left right | xs -> Format.fprintf out "@[%(%)@[" left ; List.iter (fun x -> Format.fprintf out "@ %a" f x) xs ; Format.fprintf out "@]@ %(%)@]" right let pp_open_block out msg = Format.fprintf out ("@[@[" ^^ msg) let pp_close_block out msg = Format.fprintf out ("@]@ " ^^ msg ^^ "@]") let pp_trail pp fmt x = begin Format.fprintf fmt "@[(**" ; let out newlined fmt s k n = for i=k to k+n-1 do if !newlined then ( Format.fprintf fmt "@\n * " ; newlined := false ) ; if s.[i] = '\n' then newlined := true else Format.pp_print_char fmt s.[i] done in let nwl = ref true in let ftt = Format.make_formatter (out nwl fmt) (fun () -> ()) in pp ftt x ; Format.pp_print_flush ftt () ; Format.fprintf fmt "@\n **)@]" ; end (* -------------------------------------------------------------------------- *) (* --- Margins --- *) (* -------------------------------------------------------------------------- *) type marger = int ref let marger () = ref 0 let add_margin marger ?(margin=0) ?(min=0) ?(max=80) text = let size = String.length text + margin in let n = Transitioning.Stdlib.min max (Transitioning.Stdlib.max min size) in if n > !marger then marger := n type align = [ `Center | `Left | `Right ] let pp_margin ?(align=`Center) ?(pp=Format.pp_print_string) marger fmt text = let n = String.length text in let m = !marger in if n > m then if m < 8 then pp fmt (String.sub text 0 m) else pp fmt (String.sub text 0 (m-3) ^ "...") else let space fmt s = if s > 0 then Format.pp_print_string fmt (String.make s ' ') in let w = m-n in match align with | `Center -> let l = w / 2 in let r = w - l in space fmt l ; pp fmt text ; space fmt r ; | `Left -> pp fmt text ; space fmt w | `Right -> space fmt w ; pp fmt text let pp_items ?align ?margin ?min ?max ~title ~iter ?pp_title ~pp_item fmt = let m = marger () in iter (fun e -> add_margin m ?margin ?min ?max (title e)) ; let pp = pp_margin ?align ?pp:pp_title m in iter (pp_item pp fmt) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/pretty_utils.mli0000666000000000000000000002545313571573400020401 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Pretty-printer utilities. @plugin development guide *) (* ********************************************************************** *) (** {2 null formatters} *) (* ********************************************************************** *) val null : Format.formatter (** Prints nothing. @since Beryllium-20090901 *) val nullprintf : ('a,Format.formatter,unit) format -> 'a (** Discards the message and returns unit. @since Beryllium-20090901 *) val with_null : (unit -> 'b) -> ('a,Format.formatter,unit,'b) format4 -> 'a (** Discards the message and call the continuation. @since Beryllium-20090901 *) (* ********************************************************************** *) (** {2 pretty-printing to a string} *) (* ********************************************************************** *) val sfprintf: ('a,Format.formatter,unit,string) format4 -> 'a (** Equivalent to Format.asprintf. Used for compatibility with OCaml < 4.01. @deprecated Silicon-20161101 use Format.asprintf *) val ksfprintf: (string -> 'b) -> ('a, Format.formatter, unit, 'b) format4 -> 'a (** similar to Format.kfprintf, but the continuation is given the result string instead of a formatter. @since Magnesium-20151001 *) val to_string: ?margin:int -> (Format.formatter -> 'a -> unit) -> 'a -> string (** pretty-prints the supplied value into a string. [margin] is the maximal width of the box before a line-break is inserted. See {!Format.set_margin} *) (** {2 separators} *) val pp_print_string_fill : Format.formatter -> string -> unit (** transforms every space in a string in breakable spaces.*) val escape_underscores : string -> string (* ********************************************************************** *) (** {2 pretty printers for standard types} *) (* ********************************************************************** *) type sformat = (unit,Format.formatter,unit) format type 'a formatter = Format.formatter -> 'a -> unit type ('a,'b) formatter2 = Format.formatter -> 'a -> 'b -> unit val pp_list: ?pre:sformat -> ?sep:sformat -> ?last:sformat -> ?suf:sformat -> ?empty:sformat -> 'a formatter -> 'a list formatter (** pretty prints a list. The optional arguments stands for - the prefix to output before a non-empty list (default: open a box) - the separator between two elements (default: nothing) - the last separator to be put just before the last element (default:sep) - the suffix to output after a non-empty list (default: close box) - what to print if the list is empty (default: nothing) @modify Silicon-20161101 new optional argument [empty] *) val pp_array: ?pre:sformat -> ?sep:sformat -> ?suf:sformat -> ?empty:sformat -> (int,'a) formatter2 -> 'a array formatter (** pretty prints an array. The optional arguments stands for - the prefix to output before a non-empty array (default: open a box) - the separator between two elements (default: nothing) - the suffix to output after a non-empty array (default: close box) - what to print if the array is empty (default: nothing) @modify Silicon-20161101 new optional argument [empty] *) val pp_iter: ?pre:sformat -> ?sep:sformat -> ?suf:sformat -> (('a -> unit) -> 'b -> unit) -> 'a formatter -> 'b formatter (** pretty prints any structure using an iterator on it. The argument [pre] (resp. [suf]) is output before (resp. after) the iterator is started (resp. has ended). The optional argument [sep] is output between two calls to the ['a formatter]. Default: open a box for [pre], close a box for [suf], nothing for [sep]. *) val pp_iter2: ?pre:sformat -> ?sep:sformat -> ?suf:sformat -> ?between:sformat -> (('key -> 'v -> unit) -> 'a -> unit) -> 'key formatter -> 'v formatter -> 'a formatter (** pretty prints any map-like structure using an iterator on it. The argument [pre] (resp. [suf]) is output before (resp. after) the iterator is started (resp. has ended). The optional argument [sep] is output between two calls to the ['a formatter]. The optional argument [between] is output between the key and the value. Default: open a box for [pre], close a box for [suf], nothing for [sep], break-space for [between]. *) val pp_opt: ?pre:sformat -> ?suf:sformat -> ?none:sformat -> 'a formatter -> 'a option formatter (** pretty-prints an optional value. Prefix and suffix default to "@[" and "@]" respectively. If the value is [None], pretty-print using [none]. @modify Silicon-20161101 new optional argument [none] *) val pp_cond: ?pr_false:sformat -> bool -> sformat formatter (** [pp_cond cond f s] pretty-prints [s] if cond is [true] and the optional pr_false, which defaults to nothing, otherwise *) val pp_pair: ?pre:sformat -> ?sep:sformat -> ?suf:sformat -> 'a formatter -> 'b formatter -> ('a * 'b) formatter (** [pp_pair ?pre ?sep ?suf pp_a pp_b (a,b)] pretty prints the pair [(a,b)], using the pretty printers [pp_a] and [pp_b], with optional prefix/separator/suffix, whose default values are: - pre: open a box - sep: print a comma character - suf: close a box. @since Magnesium-20151001 *) val pp_flowlist: ?left:sformat -> ?sep:sformat -> ?right:sformat -> 'a formatter -> 'a list formatter val pp_blocklist: ?left:sformat -> ?right:sformat -> 'a formatter -> 'a list formatter val pp_open_block : Format.formatter -> ('a,Format.formatter,unit) format -> 'a val pp_close_block : Format.formatter -> ('a,Format.formatter,unit) format -> 'a val pp_trail : 'a formatter -> 'a formatter (** pretty-prints its contents inside an '(** ... **)' horizontal block trailed with '*' *) (* ********************************************************************** *) (** {2 Description Lists (margins)} *) (* ********************************************************************** *) type align = [`Center | `Left | `Right] val pp_items : ?align:align -> ?margin:int -> ?min:int -> ?max:int -> title:('a -> string) -> iter:(('a -> unit) -> unit) -> ?pp_title:string formatter -> pp_item:(string formatter -> 'a formatter) -> Format.formatter -> unit (** Prints a collection of elements, with the possibility of aligning {i titles} with each others. The collection of ['a] to print is provided by iterator [~iter] which is called twice: one for computing the maximal size of {i titles}, obtained {i via} function [~title] for each item. The second pass pretty-print each item using [~pp_item pp] where the passed [pp] printer can be used to pretty-print titles with alignment. A typical usage for printing [values], a list of [(string*int)] items: {[ pp_items ~title:(fun (a,_) -> a) ~iter:(fun f -> List.iter f values) ~pp_title:(fun fmt a -> Format.fprintf fmt "%s:" a) ~pp_item:(fun pp fmt (a,n) -> Format.fprintf fmt "%a %d@\n" pp a n) fmt ]} Alignment of titles can be centered, right or left justified. This is rendered by adding spaces around each title. A min and max size can also be specified and a margin can be added to all title sizes. Titles will be truncated if necessary. The pretty-printer for titles will render each (possibly truncated) title with [~pp_title]. Surrounding spaces are {i not} printed via [~pp_title]. The (optional) parameters have the following meaning: - [?align] alignment mode (default is [`Center]) - [?margin] is added to text size (default [0]) - [?min] minimum size ([~margin] included, default [0]) - [?max] maximum size ([~margin] included, default [80]) - [~title] returns the {i title} for each element (only size is relevant) - [~iter] iterate over the elements to be printed - [?pp_title] pretty-printer used to the (possibly truncated) title (default is [Format.pp_print_string]) - [~pp_item] pretty-printer to print each element. There is also a low-level API to this feature, provided by {!marger}, {!pp_margin} and {!add_margin} below. *) type marger (** Margin accumulator (low-level API to [pp_items]). *) val marger : unit -> marger (** Create an empty marger *) val add_margin : marger -> ?margin:int -> ?min:int -> ?max:int -> string -> unit (** Updates the marger with new text dimension. The marger width is updated with the width of the provided text. The optional parameters are used to adjust the text width as follows: - [?margin] is added to text size (default [0]) - [?min] minimum size ([~margin] included, default [0]) - [?max] maximum size ([~margin] included, default [80]) *) val pp_margin : ?align:align -> ?pp:string formatter -> marger -> string formatter (** Prints a text with margins {i wrt} to marger. If the text does not fit the marger, it would be truncated and/or ellipsed. - [?align] alignment mode (default is [`Center]) - [?pp] pretty-printer used to the (possibly truncated) title (default is [Format.pp_print_string]) Typical usage: {[ begin (* first, collect title margins *) let m = marger () in List.iter (fun (a,_) -> add_margin m ~margins:2 a) data ; (* second, print aligned data *) List.iter (fun (a,d) -> Format.printf "[%a] %s@\n" (pp_margin m) a d) data ; end ]} *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/qstack.ml0000666000000000000000000001036113571573400016737 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type DATA = sig type t val equal: t -> t -> bool end module Make(D: DATA) = struct type t = { mutable first: D.t list; mutable last: D.t list } exception Empty let create () = { first = []; last = [] } let is_empty t = t.first = [] && t.last = [] let clear t = t.first <- []; t.last <- [] let add x t = t.first <- x :: t.first let add_at_end x t = t.last <- x :: t.last let singleton x = let q = create () in add x q; q let transfer t = assert (t.first = []); List.iter (fun x -> add x t) t.last; t.last <- [] let top t = match t.first, t.last with | [], [] -> raise Empty | [], _ :: _ -> transfer t; (match t.first with | [] -> assert false | x :: _ -> x) | x :: _, _ -> x let mem x t = let list_mem x = List.exists (D.equal x) in list_mem x t.first || list_mem x t.last let filter f t = let l = List.find_all f t.last in List.fold_right (fun x acc -> if f x then x :: acc else acc) t.first l let find f t = try List.find f t.last with Not_found -> List.find f (List.rev t.first) (* the returned boolean is a flag which is [true] when removing occurs. *) let remove_from_list x = let rec aux acc = function | [] -> List.rev acc, false | y :: l when D.equal x y -> List.rev acc @ l, true | y :: l -> aux (y :: acc) l in aux [] let remove_with_flag x t = let first, b = remove_from_list x t.first in if b then begin t.first <- first; b end else let last, b = remove_from_list x t.last in t.last <- last; b let remove x t = ignore (remove_with_flag x t) let move_at_top x t = if not (remove_with_flag x t) then invalid_arg "Qstack.move_at_top"; add x t let move_at_end x t = if not (remove_with_flag x t) then invalid_arg "Qstack.move_at_end"; add_at_end x t let iter f t = List.iter f t.first; List.fold_right (fun p () -> f p) t.last () let map f t = t.first <- List.map f t.first; t.last <- List.rev_map (fun p -> f p) t.last let fold f acc t = let acc = List.fold_left f acc t.first in List.fold_right (fun x acc -> f acc x) t.last acc let length t = List.length t.first + List.length t.last let nth n t = try List.nth t.first n with Failure _ -> try List.nth (List.rev t.last) (n - List.length t.first) with Failure s -> invalid_arg s let idx x t = let i = ref 0 in try iter (fun e -> if D.equal e x then raise Exit; incr i) t; raise Not_found with Exit -> !i end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/qstack.mli0000666000000000000000000001105213571573400017106 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Mutable stack in which it is possible to add data at the end (like a queue) and to handle non top elements. Current implementation is double linked list. *) module type DATA = sig type t val equal: t -> t -> bool end module Make(D: DATA) : sig type t exception Empty val create: unit -> t (** Create a new empty stack. *) val singleton: D.t -> t (** Create a new qstack with a single element. @since Boron-20100401 *) val is_empty: t -> bool (** Test whether the stack is empty or not. *) val clear: t -> unit (** Remove all the elements of a stack. *) val add: D.t -> t -> unit (** Add at the beginning of the stack. Complexity: O(1). *) val add_at_end: D.t -> t -> unit (** Add at the end of the stack. Complexity: O(1). *) val top: t -> D.t (** Return the top element of the stack. Raise [Empty] if the stack is empty. Complexity: amortized O(1). *) val mem: D.t -> t -> bool (** Return [true] if the data exists in the stack and [false] otherwise. Complexity: O(n). *) val filter: (D.t -> bool) -> t -> D.t list (** Return all data of the stack satisfying the specified predicate. The order of the data in the input stack is preserved. Not tail recursive. *) val find: (D.t -> bool) -> t -> D.t (** Return the first data of the stack satisfying the specified predicate. @raise Not_found if there is no such data in the stack *) val remove: D.t -> t -> unit (** Remove an element from the stack. Complexity: O(n). *) val move_at_top: D.t -> t -> unit (** Move the element [x] at the top of the stack [s]. Complexity: O(n). @raise Invalid_argument if [not (mem x s)]. *) val move_at_end: D.t -> t -> unit (** Move the element [x] at the end of the stack [s]. Complexity: O(n). @raise Invalid_argument if [not (mem x s)]. @since Beryllium-20090901 *) val iter: (D.t -> unit) -> t -> unit (** Iter on all the elements from the top to the end of the stack. Not tail recursive. *) val map: (D.t -> D.t) -> t -> unit (** Replace in-place all the elements of the stack by mapping the old one. Not tail recursive. @since Beryllium-20090901 *) val fold: ('a -> D.t -> 'a) -> 'a -> t -> 'a (** Fold on all the elements from the top to the end of the stack. Not tail recursive. *) val nth: int -> t -> D.t (** @return the n-th element of the stack, if any. @raise Invalid_argument if there is not enough element in the stack. @since Beryllium-20090901 *) val length: t -> int (** @return the length of the stack @since Beryllium-20090901 *) val idx: D.t -> t -> int (** @return the index of the element in the stack @raise Not_found if the element is not in the stack This function is not tail recursive @since Beryllium-20090901 *) end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/rangemap.ml0000666000000000000000000004452013571573400017247 0ustar (*****************************************************************************) (* *) (* This file was originally part of Objective Caml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright (C) 1996 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* This file is distributed under the terms of the GNU Library General *) (* Public License version 2, with the special exception on linking *) (* described below. See the GNU Library General Public License version *) (* 2 for more details (enclosed in the file licenses/LGPLv2). *) (* *) (* As a special exception to the GNU Library General Public License, *) (* you may link, statically or dynamically, a "work that uses the Library" *) (* with a publicly distributed version of the Library to *) (* produce an executable file containing portions of the Library, and *) (* distribute that executable file under terms of your choice, without *) (* any of the additional requirements listed in clause 6 of the GNU *) (* Library General Public License. *) (* By "a publicly distributed version of the Library", *) (* we mean either the unmodified Library as *) (* distributed by INRIA, or a modified version of the Library that is *) (* distributed under the conditions defined in clause 2 of the GNU *) (* Library General Public License. This exception does not however *) (* invalidate any other reasons why the executable file might be *) (* covered by the GNU Library General Public License. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (*****************************************************************************) type fuzzy_order = Above | Below | Match module type S = sig type key type value type rangemap include Datatype.S with type t = rangemap val create : t -> key -> value -> t -> t val empty: t val is_empty: t -> bool val add: key -> value -> t -> t val singleton: key -> value -> t val find: key -> t -> value val remove: key -> t -> t val mem: key -> t -> bool val iter: (key -> value -> unit) -> t -> unit val map: (value -> value) -> t -> t val mapi: (key -> value -> value) -> t -> t val mapii: (key -> value -> key*value) -> t -> t val fold: (key -> value -> 'a -> 'a) -> t -> 'a -> 'a val for_all: (key -> value -> bool) -> t -> bool val exists: (key -> value -> bool) -> t -> bool val filter: (key -> value -> bool) -> t -> t val partition: (key -> value -> bool) -> t -> t * t val cardinal: t -> int val bindings: t -> (key * value) list val min_binding: t -> (key * value) val max_binding: t -> (key * value) val choose: t -> (key * value) val merge: (key -> value option -> value option -> value option) -> t -> t -> t val for_all2: (key -> value option -> value option -> bool) -> t -> t -> bool val exists2: (key -> value option -> value option -> bool) -> t -> t -> bool val iter2: (key -> value option -> value option -> unit) -> t -> t -> unit val fold2: (key -> value option -> value option -> 'a -> 'a) -> t -> t -> 'a -> 'a end module type Value = sig include Datatype.S val fast_equal: t -> t -> bool end module Make(Ord: Datatype.S)(Value: Value) = struct type key = Ord.t type value = Value.t type rangemap = | Empty | Node of rangemap * key * Value.t * rangemap * int * int (* the last two are height and hash in this order *) let height = function | Empty -> 0 | Node(_,_,_,_,h,_) -> h let hash = function | Empty -> 0 | Node(_,_,_,_,_,h) -> h let create l x d r = let x_h = Ord.hash x in let d_h = Value.hash d in let hl = height l and hr = height r in let hashl = hash l and hashr = hash r in let hashbinding = 31 * x_h + d_h in let hashtree = hashl lxor hashbinding lxor hashr in Node(l, x, d, r, (if hl >= hr then hl + 1 else hr + 1), hashtree) let bal l x d r = let hl = match l with Empty -> 0 | Node(_,_,_,_,h,_) -> h in let hr = match r with Empty -> 0 | Node(_,_,_,_,h,_) -> h in if hl > hr + 2 then begin match l with Empty -> invalid_arg "Rangemap.bal" | Node(ll, lv, ld, lr, _, _) -> if height ll >= height lr then create ll lv ld (create lr x d r) else begin match lr with Empty -> invalid_arg "Rangemap.bal" | Node(lrl, lrv, lrd, lrr, _, _)-> create (create ll lv ld lrl) lrv lrd (create lrr x d r) end end else if hr > hl + 2 then begin match r with Empty -> invalid_arg "Rangemap.bal" | Node(rl, rv, rd, rr, _, _) -> if height rr >= height rl then create (create l x d rl) rv rd rr else begin match rl with Empty -> invalid_arg "Rangemap.bal" | Node(rll, rlv, rld, rlr, _, _) -> create (create l x d rll) rlv rld (create rlr rv rd rr) end end else create l x d r let empty = Empty let is_empty = function Empty -> true | _ -> false let singleton x v = create Empty x v Empty let rec add x data = function Empty -> create Empty x data Empty | Node(l, v, d, r, _, _) as node -> let c = Ord.compare x v in if c = 0 then if Value.fast_equal d data then node else create l x data r else if c < 0 then bal (add x data l) v d r else bal l v d (add x data r) let rec find x = function | Empty -> raise Not_found | Node(l, v, d, r, _, _) -> let c = Ord.compare x v in if c = 0 then d else find x (if c < 0 then l else r) let rec mem x = function | Empty -> false | Node(l, v, _d, r, _, _) -> let c = Ord.compare x v in c = 0 || mem x (if c < 0 then l else r) let rec max_binding = function | Empty -> raise Not_found | Node(_l, x, d, Empty, _, _) -> (x, d) | Node(_l, _x, _d, r, _, _) -> max_binding r let rec min_binding = function | Empty -> raise Not_found | Node(Empty, x, d, _r, _, _) -> (x, d) | Node(l, _x, _d, _r, _, _) -> min_binding l let choose = min_binding let rec remove_min_binding = function | Empty -> invalid_arg "Rangemap.remove_min_elt" | Node(Empty, _x, _d, r, _, _) -> r | Node(l, x, d, r, _, _) -> bal (remove_min_binding l) x d r let merge t1 t2 = match (t1, t2) with | (Empty, t) -> t | (t, Empty) -> t | (_, _) -> let (x, d) = min_binding t2 in bal t1 x d (remove_min_binding t2) let rec remove x = function | Empty -> Empty | Node(l, v, d, r, _, _h) -> let c = Ord.compare x v in if c = 0 then merge l r else if c < 0 then bal (remove x l) v d r else bal l v d (remove x r) let rec iter f = function | Empty -> () | Node(l, v, d, r, _, _) -> iter f l; f v d; iter f r let rec map f = function | Empty -> Empty | Node(l, v, d, r, _, _h) -> create (map f l) v (f d) (map f r) let rec mapi f = function | Empty -> Empty | Node(l, v, d, r, _, _h) -> create (mapi f l) v (f v d) (mapi f r) let rec mapii f = function | Empty -> Empty | Node(l, v, d, r, _, _) -> let new_v, new_d = f v d in create (mapii f l) new_v new_d (mapii f r) let rec fold f m accu = match m with | Empty -> accu | Node(l, v, d, r, _, _) -> fold f r (f v d (fold f l accu)) let rec for_all p = function Empty -> true | Node(l, v, d, r, _, _) -> p v d && for_all p l && for_all p r let rec exists p = function Empty -> false | Node(l, v, d, r, _, _) -> p v d || exists p l || exists p r let filter p s = let rec filt accu = function | Empty -> accu | Node(l, v, d, r, _, _) -> filt (filt (if p v d then add v d accu else accu) l) r in filt Empty s let partition p s = let rec part (t, f as accu) = function | Empty -> accu | Node(l, v, d, r, _, _) -> part (part (if p v d then (add v d t, f) else (t, add v d f)) l) r in part (Empty, Empty) s (* Same as create and bal, but no assumptions are made on the relative heights of l and r. *) let rec join l v d r = match (l, r) with (Empty, _) -> add v d r | (_, Empty) -> add v d l | (Node(ll, lv, ld, lr, lh, _), Node(rl, rv, rd, rr, rh, _)) -> if lh > rh + 2 then bal ll lv ld (join lr v d r) else if rh > lh + 2 then bal (join l v d rl) rv rd rr else create l v d r (* Merge two trees l and r into one. All elements of l must precede the elements of r. No assumption on the heights of l and r. *) let concat t1 t2 = match (t1, t2) with (Empty, t) -> t | (t, Empty) -> t | (_, _) -> let (x, d) = min_binding t2 in join t1 x d (remove_min_binding t2) let concat_or_join t1 v d t2 = match d with | Some d -> join t1 v d t2 | None -> concat t1 t2 let rec split x = function Empty -> (Empty, None, Empty) | Node(l, v, d, r, _, _) -> let c = Ord.compare x v in if c = 0 then (l, Some d, r) else if c < 0 then let (ll, pres, rl) = split x l in (ll, pres, join rl v d r) else let (lr, pres, rr) = split x r in (join l v d lr, pres, rr) let rec merge f s1 s2 = match (s1, s2) with (Empty, Empty) -> Empty | (Node (l1, v1, d1, r1, h1, _), _) when h1 >= height s2 -> let (l2, d2, r2) = split v1 s2 in concat_or_join (merge f l1 l2) v1 (f v1 (Some d1) d2) (merge f r1 r2) | (_, Node (l2, v2, d2, r2, _h2, _)) -> let (l1, d1, r1) = split v2 s1 in concat_or_join (merge f l1 l2) v2 (f v2 d1 (Some d2)) (merge f r1 r2) | _ -> assert false type enumeration = End | More of key * Value.t * rangemap * enumeration let rec cons_enum m e = match m with | Empty -> e | Node(l, v, d, r, _, _) -> cons_enum l (More(v, d, r, e)) let compare m1 m2 = let rec compare_aux e1 e2 = match (e1, e2) with | (End, End) -> 0 | (End, _) -> -1 | (_, End) -> 1 | (More(v1, d1, r1, e1), More(v2, d2, r2, e2)) -> let c = Ord.compare v1 v2 in if c <> 0 then c else let c = Value.compare d1 d2 in if c <> 0 then c else compare_aux (cons_enum r1 e1) (cons_enum r2 e2) in compare_aux (cons_enum m1 End) (cons_enum m2 End) let equal m1 m2 = let rec equal_aux e1 e2 = match (e1, e2) with | (End, End) -> true | (End, _) -> false | (_, End) -> false | (More(v1, d1, r1, e1), More(v2, d2, r2, e2)) -> Ord.equal v1 v2 && Value.equal d1 d2 && equal_aux (cons_enum r1 e1) (cons_enum r2 e2) in equal_aux (cons_enum m1 End) (cons_enum m2 End) let fold2 f m1 m2 r = let rec aux e1 e2 r = match e1, e2 with | (End, End) -> r | (End, More (k, v, t, e)) -> f k None (Some v) (aux End (cons_enum t e) r) | (More (k, v, t, e), End) -> f k (Some v) None (aux (cons_enum t e) End r) | (More (k1, v1, t1, e1'), More (k2, v2, t2, e2')) -> let c = Ord.compare k1 k2 in if c = 0 then f k1 (Some v1) (Some v2) (aux (cons_enum t1 e1') (cons_enum t2 e2') r) else if c < 0 then f k1 (Some v1) None (aux (cons_enum t1 e1') e2 r) else f k2 (Some v2) None (aux e1 (cons_enum t2 e2') r) in aux (cons_enum m1 End) (cons_enum m2 End) r (* iter2, exists2 and for_all2 are essentially the same implementation as fold2 with the appropriate default value and operator, but we cannot use fold, as ";", "||" and "&&" are lazy... *) let iter2 f m1 m2 = let rec aux e1 e2 = match e1, e2 with | (End, End) -> () | (End, More (k, v, t, e)) -> f k None (Some v); aux End (cons_enum t e) | (More (k, v, t, e), End) -> f k (Some v) None; aux (cons_enum t e) End | (More (k1, v1, t1, e1'), More (k2, v2, t2, e2')) -> let c = Ord.compare k1 k2 in if c = 0 then ( f k1 (Some v1) (Some v2); aux (cons_enum t1 e1') (cons_enum t2 e2') ) else if c < 0 then ( f k1 (Some v1) None; aux (cons_enum t1 e1') e2 ) else ( f k2 (Some v2) None; aux e1 (cons_enum t2 e2') ) in aux (cons_enum m1 End) (cons_enum m2 End) let exists2 f m1 m2 = let rec aux e1 e2 = match e1, e2 with | (End, End) -> false | (End, More (k, v, t, e)) -> f k None (Some v) || aux End (cons_enum t e) | (More (k, v, t, e), End) -> f k (Some v) None || aux (cons_enum t e) End | (More (k1, v1, t1, e1'), More (k2, v2, t2, e2')) -> let c = Ord.compare k1 k2 in if c = 0 then f k1 (Some v1) (Some v2) || aux (cons_enum t1 e1') (cons_enum t2 e2') else if c < 0 then f k1 (Some v1) None || aux (cons_enum t1 e1') e2 else f k2 (Some v2) None || aux e1 (cons_enum t2 e2') in aux (cons_enum m1 End) (cons_enum m2 End) let for_all2 f m1 m2 = let rec aux e1 e2 = match e1, e2 with | (End, End) -> true | (End, More (k, v, t, e)) -> f k None (Some v) && aux End (cons_enum t e) | (More (k, v, t, e), End) -> f k (Some v) None && aux (cons_enum t e) End | (More (k1, v1, t1, e1'), More (k2, v2, t2, e2')) -> let c = Ord.compare k1 k2 in if c = 0 then f k1 (Some v1) (Some v2) && aux (cons_enum t1 e1') (cons_enum t2 e2') else if c < 0 then f k1 (Some v1) None && aux (cons_enum t1 e1') e2 else f k2 (Some v2) None && aux e1 (cons_enum t2 e2') in aux (cons_enum m1 End) (cons_enum m2 End) let rec cardinal = function | Empty -> 0 | Node(l, _, _, r, _, _) -> cardinal l + 1 + cardinal r let rec bindings_aux accu = function | Empty -> accu | Node(l, v, d, r, _, _) -> bindings_aux ((v, d) :: bindings_aux accu r) l let bindings s = bindings_aux [] s let rec fold_range o f m accu = match m with | Empty -> accu | Node(l, v, d, r, _, _) -> let compar = o v in let accu1 = match compar with | Match | Above -> fold_range o f l accu | Below -> accu in let accu2 = match compar with | Match -> f v d accu1 | Above | Below -> accu1 in match compar with | Match | Below -> fold_range o f r accu2 | Above -> accu2 let cons k v l = (k,v) :: l let concerned_intervals fuzzy_order i m = fold_range (fuzzy_order i) cons m [] let remove_whole fuzzy_order i m = fold_range (fuzzy_order i) (fun k _v acc -> remove k acc) m m let add_whole fuzzy_order i v m = let removed = remove_whole fuzzy_order i m in add i v removed exception Empty_rangemap (* This is actually a copy of [min_binding], but raises [Empty_rangemap] instead of [Not_found]... *) let rec lowest_binding m = match m with | Node(Empty,k,v,_,_, _) -> k,v | Node(t,_,_,_,_, _) -> lowest_binding t | Empty -> raise Empty_rangemap exception No_such_binding let rec lowest_binding_above o m = match m with | Node(l,k,v,r,_, _) -> if o k then begin try lowest_binding_above o l with No_such_binding -> k,v end else lowest_binding_above o r | Empty -> raise No_such_binding include Datatype.Make (struct type t = rangemap let name = "(" ^ Ord.name ^ ", " ^ Value.name ^ ") rangemap" open Structural_descr let r = Recursive.create () let structural_descr = t_sum [| [| recursive_pack r; Ord.packed_descr; Value.packed_descr; recursive_pack r; p_int; p_int |] |] let () = Recursive.update r structural_descr let reprs = List.fold_left (fun acc k -> List.fold_left (fun acc v -> (Node(Empty, k, v, Empty, 0, 0)) :: acc) acc Value.reprs) [ Empty ] Ord.reprs let equal = equal let compare = compare let hash = hash let rehash = Datatype.identity let copy = if Ord.copy == Datatype.undefined || Value.copy == Datatype.undefined then Datatype.undefined else let rec aux = function | Empty -> Empty | Node (l,x,d,r,_,_) -> let l = aux l in let x = Ord.copy x in let d = Value.copy d in let r = aux r in create l x d r in aux let internal_pretty_code = Datatype.undefined let pretty = Datatype.undefined let varname = Datatype.undefined let mem_project = if Ord.mem_project == Datatype.never_any_project && Value.mem_project == Datatype.never_any_project then Datatype.never_any_project else (fun s -> exists (fun k v -> Ord.mem_project s k || Value.mem_project s v)) end) let () = Type.set_ml_name ty None end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/rangemap.mli0000666000000000000000000002473613571573400017427 0ustar (*****************************************************************************) (* *) (* This file was originally part of Objective Caml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright (C) 1996 INRIA *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* All rights reserved. *) (* *) (* This file is distributed under the terms of the GNU Library General *) (* Public License version 2, with the special exception on linking *) (* described below. See the GNU Library General Public License version *) (* 2 for more details (enclosed in the file licenses/LGPLv2). *) (* *) (* As a special exception to the GNU Library General Public License, *) (* you may link, statically or dynamically, a "work that uses the Library" *) (* with a publicly distributed version of the Library to *) (* produce an executable file containing portions of the Library, and *) (* distribute that executable file under terms of your choice, without *) (* any of the additional requirements listed in clause 6 of the GNU *) (* Library General Public License. *) (* By "a publicly distributed version of the Library", *) (* we mean either the unmodified Library as *) (* distributed by INRIA, or a modified version of the Library that is *) (* distributed under the conditions defined in clause 2 of the GNU *) (* Library General Public License. This exception does not however *) (* invalidate any other reasons why the executable file might be *) (* covered by the GNU Library General Public License. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (*****************************************************************************) (** Association tables over ordered types. This module implements applicative association tables, also known as finite maps or dictionaries, given a total ordering function over the keys. All operations over maps are purely applicative (no side-effects). The implementation uses balanced binary trees, and therefore searching and insertion take time logarithmic in the size of the map. Compared to Ocaml's standard library, this implementation caches at each node the hash of the tree (which is computed in an associative manner), and contains some functions not yet present in the caml implementation. *) module type S = sig type key (** The type of the map keys. *) type value type rangemap (** The type of maps from type [key] to type [value]. *) include Datatype.S with type t = rangemap val create : t -> key -> value -> t -> t val empty: t (** The empty map. *) val is_empty: t -> bool (** Test whether a map is empty or not. *) val add: key -> value -> t -> t (** [add x y m] returns a map containing the same bindings as [m], plus a binding of [x] to [y]. If [x] was already bound in [m], its previous binding disappears. *) val singleton: key -> value -> t (** [singleton x y] returns the one-element map that contains a binding [y] for [x]. *) val find: key -> t -> value (** [find x m] returns the current binding of [x] in [m], or raises [Not_found] if no such binding exists. *) val remove: key -> t -> t (** [remove x m] returns a map containing the same bindings as [m], except for [x] which is unbound in the returned map. *) val mem: key -> t -> bool (** [mem x m] returns [true] if [m] contains a binding for [x], and [false] otherwise. *) val iter: (key -> value -> unit) -> t -> unit (** [iter f m] applies [f] to all bindings in map [m]. [f] receives the key as first argument, and the associated value as second argument. The bindings are passed to [f] in increasing order with respect to the ordering over the type of the keys. Only current bindings are presented to [f]: bindings hidden by more recent bindings are not passed to [f]. *) val map: (value -> value) -> t -> t (** [map f m] returns a map with same domain as [m], where the associated value [a] of all bindings of [m] has been replaced by the result of the application of [f] to [a]. The bindings are passed to [f] in increasing order with respect to the ordering over the type of the keys. *) val mapi: (key -> value -> value) -> t -> t (** Same as {!Map.S.map}, but the function receives as arguments both the key and the associated value for each binding of the map. *) val mapii: (key -> value -> key*value) -> t -> t (** Same as {!Map.S.mapi}, but the function also returns a new key. the modification applied on the keys must be compatible with the order on the keys. *) val fold: (key -> value -> 'a -> 'a) -> t -> 'a -> 'a (** [fold f m a] computes [(f kN dN ... (f k1 d1 a)...)], where [k1 ... kN] are the keys of all bindings in [m] (in increasing order), and [d1 ... dN] are the associated data. *) val for_all: (key -> value -> bool) -> t -> bool (** [for_all p m] checks if all the bindings of the map satisfy the predicate [p]. *) val exists: (key -> value -> bool) -> t -> bool (** [exists p m] checks if at least one binding of the map satisfy the predicate [p]. *) val filter: (key -> value -> bool) -> t -> t (** [filter p m] returns the map with all the bindings in [m] that satisfy predicate [p]. *) val partition: (key -> value -> bool) -> t -> t * t (** [partition p m] returns a pair of maps [(m1, m2)], where [m1] contains all the bindings of [s] that satisfy the predicate [p], and [m2] is the map with all the bindings of [s] that do not satisfy [p]. *) val cardinal: t -> int (** Return the number of bindings of a map. *) val bindings: t -> (key * value) list (** Return the list of all bindings of the given map. The returned list is sorted in increasing order with respect to the ordering on keys *) val min_binding: t -> (key * value) (** Return the smallest binding of the given map (with respect to the [Ord.compare] ordering), or raise [Not_found] if the map is empty. *) val max_binding: t -> (key * value) (** Same as {!Map.S.min_binding}, but returns the largest binding of the given map. *) val choose: t -> (key * value) (** Return one binding of the given map, or raise [Not_found] if the map is empty. Which binding is chosen is unspecified, but equal bindings will be chosen for equal maps. *) val merge: (key -> value option -> value option -> value option) -> t -> t -> t (** [merge f m1 m2] computes a map whose keys is a subset of keys of [m1] and of [m2]. The presence of each such binding, and the corresponding value, is determined with the function [f]. *) val for_all2: (key -> value option -> value option -> bool) -> t -> t -> bool (** [for_all2 f m1 m2] returns true if and only if [f k v1 v2] holds for each [k] present in either [m1] and [m2], [v_i] being [Some (find k m_i)] if [k] is in [m_i], and [None] otherwise (for [i=1] or [i=2]) *) val exists2: (key -> value option -> value option -> bool) -> t -> t -> bool (** [exists2 f m1 m2] returns true if and only there exists [k] present in [m1] or [m2] such that [f k v1 v2] holds, [v_i] being [Some (find k m_i)] if [k] is in [m_i], and [None] otherwise (for [i=1] or [i=2]) *) val iter2: (key -> value option -> value option -> unit) -> t -> t -> unit (** [iter2 f m1 m2] computes [f k v1 v2] for each [k] present in either [m1] or [m2] (the [k] being presented in ascending order), [v_i] being [Some (find k m_i)] if [k] is in [m_i], and [None] otherwise (for [i=1] or [i=2]) *) val fold2: (key -> value option -> value option -> 'a -> 'a) -> t -> t -> 'a -> 'a (** [fold2 f m1 m2 v] computes [(f k_N v1_N v2_N... (f k_1 v1_1 v2_1 a)...)] where [k_1 ... k_N] are all the keys of all the bindings in either [m1] or [m2] (in increasing order), [vi_j] being [Some (find k_j m_i)] if [k_j] is in [m_i], and [None] otherwise (for [i=1] or [i=2]) *) end type fuzzy_order = Above | Below | Match (** Datatype with a function that approximately equality in a constant-time way. *) module type Value = sig include Datatype.S (** [fast_equal] is used to reduce memory allocation in some cases. It is valid to always return [false]; the only constraint is that [true] must not be returned if [equal] returns [false]. *) val fast_equal: t -> t -> bool end (** Extension of the above signature, with specific functions acting on range of values *) module Make (Ord : Datatype.S) (Value : Value): sig include S with type key = Ord.t and type value = Value.t val fold_range: (key -> fuzzy_order) -> (key -> Value.t -> 'a -> 'a) -> t -> 'a -> 'a val height: t -> int val concerned_intervals: (key -> key -> fuzzy_order) -> key -> t -> (key*Value.t) list (** Intervals that match the given key. The resulting list is sorted in decreasing order. *) exception Empty_rangemap val lowest_binding : t -> key * Value.t exception No_such_binding val lowest_binding_above : (key -> bool) -> t -> key * Value.t val add_whole : (key -> key -> fuzzy_order) -> key -> Value.t -> t -> t val remove_whole : (key -> key -> fuzzy_order) -> key -> t -> t end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/rgmap.ml0000666000000000000000000001141613571573400016561 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type 'a entry = int * int * 'a (* Entries are stored in slices of increasing width. In a given slice, all entries have the same width, hence a total order is available for each slice. Lookup for any entry applying to some range inside a given slice only needs to check for subset _vs_ disjoint ranges. This can be implemented by a comparison order over ranges making included ranges equal: if two ranges are not included one in the other, they can be ordered. Finding entries covering a range in the entire map can then be performed by looking for the first applying entry in increasing width. The global complexity for lookup is around [log(n)^2], whereas insertion is only [log(n)]. To evaluate complexity, take for instance the full binary tree of integers in range [0..n], with [n=2^N]. Consider one entry for each node of the tree, ranging all the integers it contains. There are [N] slices, with slice [i] having [2^(N-i)] entries of width [2^i]. Lookup in each slice has logarithmic time, ie. [n-i]. Hence, global lookup has complexity [N^2]. *) module Wmap = Map.Make (struct type t = int let compare (a:t) (b:t) = Transitioning.Stdlib.compare a b end) module Rmap = Map.Make (struct type t = int * int (* makes included ranges equal *) let compare (a,b:t) (c,d:t) = (* Six cases to consider: 1. [a;b;c;d] -1 2. [a;c;b;d] -1 3. [a;c;d;b] =0 4. [c;a;b;d] =0 5. [c;a;d;b] +1 6. [c;d;a;b] +1 *) if a < c then (* 1-2-3 *) if b < d then (* 1-2 *) -1 else (* 3 *) 0 else if c < a then (* 4-5-6 *) if d < b then (* 5-6 *) 1 else (* 4 *) 0 else (* have a=c ; then b <= d -> 4, and d <= b -> 3 *) 0 end) type 'a t = 'a entry Rmap.t Wmap.t let range (p,q,_) = (p,q) let width (p,q,_) = q-p (* interval width minus one *) let empty = Wmap.empty let add ?(overlap=false) entry rmap = let w = width entry in if 0 <= w then let rg = range entry in let offsets = try let m = Wmap.find w rmap in if overlap && w > 1 then let (a,b) = rg in Rmap.remove (a,a) (Rmap.remove (b,b) m) else m with Not_found -> Rmap.empty in Wmap.add w (Rmap.add rg entry offsets) rmap else rmap exception Found ;; let find a b rmap = let rg = a,b in let width = b-a in let found = ref None in begin try Wmap.iter (fun w offsets -> if width <= w then try found := Some (Rmap.find rg offsets) ; raise Found with Not_found -> ()) rmap with Found -> () end ; match !found with | None -> raise Not_found | Some entry -> entry let find_all a b rmap = let rg = a,b in let width = b-a in let found = ref [] in begin try Wmap.iter (fun w offsets -> if width <= w then try let e = Rmap.find rg offsets in found := e :: !found with Not_found -> ()) rmap with Found -> () end ; List.rev !found let iter f rmap = Wmap.iter (fun _ ofs -> Rmap.iter (fun _ e -> f e) ofs) rmap frama-c-20.0-Calcium/src/libraries/utils/rgmap.mli0000666000000000000000000000671713571573400016742 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Associative maps for _ranges_ to _values_ with overlapping. The maps register a collection of entries, and looks for all entries containing some specified range. For instance, this data structure is well suited to attach tags to AST-nodes in GUI, where each node is associated to buffer offset ranges. When several entries cover a range, precedence goes to the tightest ones. When overlapping entries with the same width applies, the result of lookup is not specified. Remark that for AST-based ranges, overlapping ranges are always included one in the order. Current implementation has average [log(n)] complexity for adding [n] entries, and [log(n)^2] for lookup ranges, which is far from better than current implementation used in [Pretty_source] for instance. *) type 'a t (** The type of range maps, containing of collection of ['a entry]. *) type 'a entry = int * int * 'a (** Entry [(a,b,v)] maps range [a..b] (both included) to value [v] in the map. *) val empty : 'a t (** The empty map. *) val add : ?overlap:bool -> 'a entry -> 'a t -> 'a t (** Returns a new map with the added entry. When [~overlap:true] is specified, overlapping entries with the same width are removed first, avoiding under-specified results. It is safe to ignore this attribute for AST-based maps. *) val find : int -> int -> 'a t -> 'a entry (** Find the tightest entry containing the specified range. @raise Not_found if no entry applies *) val find_all : int -> int -> 'a t -> 'a entry list (** Find all entries containing the specified range. Returns the empty list is none applies. When overlapping entries with the same width are present in the map, only one for each width is returned. *) val iter : ('a entry -> unit) -> 'a t -> unit (** Iter over all entries present in the map. Entries are present in increasing order of width. *) frama-c-20.0-Calcium/src/libraries/utils/rich_text.ml0000666000000000000000000002211013571573400017435 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Rich Messages --- *) (* -------------------------------------------------------------------------- *) type tag = { p : int ; (* first position *) q : int ; (* last position (excluded) *) tag : Transitioning.Format.stag ; children : tag list ; } type message = string * tag list let size (text,_) = String.length text let char_at (text,_) k = String.get text k let string (text,_) = text let substring (text,_) k n = String.sub text k n let rec lookup acc k = function | [] -> acc | { p ; q ; tag ; children } :: tags -> if k < p then lookup acc k tags else if q < k then acc else lookup ((tag,p,q+1-p)::acc) k children let tags_at (_,tags) k = lookup [] k tags type env = { text : string ; output : (string -> int -> int -> unit) option ; open_tag : (Transitioning.Format.stag -> int -> int -> unit) option ; close_tag : (Transitioning.Format.stag -> int -> int -> unit) option ; } let signal f tag p q = match f with None -> () | Some f -> f tag p (q+1-p) let rec aux env p q = function | [] -> signal env.output env.text p q | { tag ; p=tp ; q=tq ; children } :: tags -> if q < tp then signal env.output env.text p q else if tq < q then aux env p q tags else begin if tp>p then signal env.output env.text p (tp-p) ; signal env.open_tag tag tp tq ; aux env tp tq children ; signal env.close_tag tag tp tq ; aux env (succ tq) q tags ; end let visit ?output ?open_tag ?close_tag (text , tags) = aux { text ; output ; open_tag ; close_tag } 0 (String.length text) tags let rec output_vbox fmt text k n = if n>0 then let p = try String.index_from text k '\n' with Not_found -> (-1) in if p < 0 || p >= k + n then Format.pp_print_string fmt (String.sub text k n) else begin Format.pp_print_string fmt (String.sub text k (p-k)) ; Format.pp_print_newline fmt () ; output_vbox fmt text (p+1) (n-p+k-1) ; end let output_fmt fmt text k n = Format.pp_print_string fmt (String.sub text k n) let open_tag fmt tag _k _n = Transitioning.Format.pp_open_stag fmt tag let close_tag fmt _tag _k _n = Transitioning.Format.pp_close_stag fmt () let pretty ?vbox fmt message = let open_tag = open_tag fmt in let close_tag = close_tag fmt in match vbox with | None -> visit ~output:(output_fmt fmt) ~open_tag ~close_tag message | Some n -> begin Format.pp_open_vbox fmt n ; visit ~output:(output_vbox fmt) ~open_tag ~close_tag message ; Format.pp_close_box fmt () ; end (* -------------------------------------------------------------------------- *) (* --- Extended Buffer with Tags --- *) (* -------------------------------------------------------------------------- *) let min_buffer = 128 (* initial size of buffer *) let max_buffer = 2097152 (* maximal size of buffer *) let tgr_buffer = 3145728 (* elasticity (internal overhead) *) type buffer = { mutable formatter : Format.formatter ; (* formatter on self (recursive) *) mutable content : FCBuffer.t ; mutable revtags : tag list ; (* in reverse order *) mutable stack : (int * tag list) list ; (* opened tag positions *) } let is_blank = function | ' ' | '\t' | '\r' | '\n' -> true | _ -> false let trim_begin buffer = let rec lookup_fwd text k n = if k < n && is_blank (FCBuffer.nth text k) then lookup_fwd text (succ k) n else k in lookup_fwd buffer.content 0 (FCBuffer.length buffer.content) let trim_end buffer = let rec lookup_bwd text k = if k >= 0 && is_blank (FCBuffer.nth text k) then lookup_bwd text (pred k) else k in lookup_bwd buffer.content (pred (FCBuffer.length buffer.content)) let shrink buffer = if FCBuffer.length buffer.content > min_buffer then FCBuffer.reset buffer.content let truncate_text buffer size = if FCBuffer.length buffer.content > size then begin let p = trim_begin buffer in let q = trim_end buffer in let n = q+1-p in if n <= 0 then shrink buffer else if n <= size then FCBuffer.blit_buffer buffer.content p buffer.content 0 n else begin let n_left = size / 2 - 3 in let n_right = size - n_left - 5 in if p > 0 then FCBuffer.blit_buffer buffer.content p buffer.content 0 n_left ; FCBuffer.blit_substring "[...]" 0 buffer.content n_left 5 ; FCBuffer.blit_buffer buffer.content (q-n_right+1) buffer.content (n_left + 5) n_right ; FCBuffer.truncate buffer.content size ; end end (* All text added shall go through this function *) let append buffer s k n = FCBuffer.add_substring buffer.content s k n ; if FCBuffer.length buffer.content > tgr_buffer then truncate_text buffer max_buffer let push_tag buffer _tag = let p = FCBuffer.length buffer.content in buffer.stack <- ( p , buffer.revtags ) :: buffer.stack ; buffer.revtags <- [] let pop_tag buffer tag = match buffer.stack with | [] -> () | (p,tags)::stack -> let q = FCBuffer.length buffer.content in buffer.stack <- stack ; let children = List.rev buffer.revtags in buffer.revtags <- { p ; q ; tag ; children } :: tags let no_mark _tag = "" (* -------------------------------------------------------------------------- *) (* --- External API --- *) (* -------------------------------------------------------------------------- *) let create ?indent ?margin () = let buffer = { formatter = Format.err_formatter ; content = FCBuffer.create min_buffer ; revtags = [] ; stack = [] ; } in let fmt = Format.make_formatter (append buffer) (fun () -> ()) in buffer.formatter <- fmt ; begin match indent , margin with | None , None -> () | Some k , None -> let m = Format.pp_get_margin fmt () in Format.pp_set_max_indent fmt (max 0 (min k m)) | None , Some m -> Format.pp_set_margin fmt (max 0 m) ; let k = Format.pp_get_max_indent fmt () in if k < m-10 then Format.pp_set_max_indent fmt (max 0 (m-10)) | Some k , Some m -> Format.pp_set_margin fmt (max 0 m) ; Format.pp_set_max_indent fmt (max 0 (min k (m-10))) end ; let open Format in Transitioning.Format.pp_set_formatter_stag_functions fmt { Transitioning.Format.print_open_stag = push_tag buffer ; print_close_stag = pop_tag buffer ; mark_open_stag = no_mark ; mark_close_stag = no_mark ; } ; pp_set_print_tags fmt true ; pp_set_mark_tags fmt false ; buffer let trim buffer = truncate_text buffer max_buffer ; let p = trim_begin buffer in let q = trim_end buffer in p , q let contents buffer = truncate_text buffer max_buffer ; FCBuffer.contents buffer.content let message buffer = ( FCBuffer.contents buffer.content , List.rev buffer.revtags ) let sub buffer p n = FCBuffer.sub buffer.content p n let range buffer p q = FCBuffer.sub buffer.content p (q+1-p) let add_char buffer c = Format.pp_print_char buffer.formatter c let add_string buffer s = Format.pp_print_string buffer.formatter s let add_substring buffer s k n = Format.pp_print_string buffer.formatter (String.sub s k n) let formatter buffer = buffer.formatter let bprintf buffer text = Format.fprintf buffer.formatter text let kprintf kjob buffer text = Format.kfprintf kjob buffer.formatter text (* -------------------------------------------------------------------------- *) frama-c-20.0-Calcium/src/libraries/utils/rich_text.mli0000666000000000000000000001143713571573400017620 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Text with Tags *) (* -------------------------------------------------------------------------- *) type message (** Message with tags *) val size : message -> int val char_at : message -> int -> char val string : message -> string val substring : message -> int -> int -> string val tags_at : message -> int -> (Transitioning.Format.stag * int * int) list (** Returns the list of tags at the given position. Inner tags come first, outer tags last. *) val visit : ?output:(string -> int -> int -> unit) -> ?open_tag:(Transitioning.Format.stag -> int -> int -> unit) -> ?close_tag:(Transitioning.Format.stag -> int -> int -> unit) -> message -> unit (** Visit the message, with depth-first recursion on tags. All methods are called with text or tag, position and length. *) val pretty : ?vbox:int -> Format.formatter -> message -> unit (** Pretty-print the message onto the given formatter, with the tags. The original message has been {i already} laidout with respect to horizontal and vertical boxes, and this layout will be output as-it-is into the formatter. Here, you have two different strategies to render the message properly. If [~vbox] is specified, a vertical box is opened around the message, and newlines are emitted with a ["@\n"] and the given indentation. Otherwise, no box is used and newlines are emitted as ["\n"], which only makes sense if there is no current indentation in the output formatter. *) (* -------------------------------------------------------------------------- *) (** Message Buffer *) (* -------------------------------------------------------------------------- *) (** Buffer for creating messages. The buffer grows on demand, but is protected against huge mesages. Maximal size is around 2 billions ASCII characters, which sould be enough to store more than 25kloc source text. *) type buffer (** Create a buffer. The right-margin is set to [~margin] and maximum indentation to [~indent]. Default values are those of [Format.make_formatter], which are [~indent:68] and [~margin:78] in OCaml 4.05. *) val create : ?indent:int -> ?margin:int -> unit -> buffer val message : buffer -> message (** Buffer contents, with its formatting tags. *) val add_char : buffer -> char -> unit (** Buffer-like *) val add_string : buffer -> string -> unit (** Buffer-like *) val add_substring : buffer -> string -> int -> int -> unit (** Buffer-like *) val formatter : buffer -> Format.formatter val bprintf : buffer -> ('a,Format.formatter,unit) format -> 'a val kprintf : (Format.formatter -> 'a) -> buffer -> ('b,Format.formatter,unit,'a) format4 -> 'b (** Similar to [Buffer.contents] *) val contents : buffer -> string (** Similar to [Buffer.sub] *) val sub : buffer -> int -> int -> string (** Sub-string with range. [range b p q] is [sub b p (q+1-p)] *) val range : buffer -> int -> int -> string (** Range of non-blank leading and trailing characters. *) val trim : buffer -> int * int (** Resize the buffer to roughly fit its actual content. *) val shrink : buffer -> unit (* -------------------------------------------------------------------------- *) frama-c-20.0-Calcium/src/libraries/utils/sanitizer.ml0000666000000000000000000000714013571573400017462 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Sanitizer --- *) (* -------------------------------------------------------------------------- *) (* Keeps only alphanumerical characters, remove consecutive, trailing and leading `_` *) type state = START | SEP | CHAR | TRUNCATE type buffer = { content : Buffer.t ; truncate : int ; mutable lastsep : int ; mutable state : state ; } let create ?(truncate=false) n = { content = Buffer.create n ; truncate = if truncate then n else max_int ; lastsep = 0 ; state = START ; } let clear buffer = begin Buffer.clear buffer.content ; buffer.state <- START ; buffer.lastsep <- 0 ; end let add_sep buffer = if buffer.state = CHAR then let offset = Buffer.length buffer.content in if offset < buffer.truncate then begin buffer.state <- SEP ; buffer.lastsep <- offset ; end else begin buffer.state <- TRUNCATE ; (* TODO [OCaml 4.05] Buffer.truncate buffer.content buffer.lastsep ; *) end let add_char buffer = function | ('a'..'z' | 'A'..'Z' | '0'..'9') as c -> begin match buffer.state with | START -> Buffer.add_char buffer.content c ; buffer.state <- CHAR | SEP -> Buffer.add_char buffer.content '_' ; Buffer.add_char buffer.content c ; buffer.state <- CHAR | CHAR -> Buffer.add_char buffer.content c | TRUNCATE -> () end | '_' | '-' | ' ' | '\t' | ',' | ';' | '.' | '/' | '\\' | ':' -> add_sep buffer | _ -> () let add_string buffer s = String.iter (add_char buffer) s let rec add_list buffer = function | [] -> () | p::ps -> add_string buffer p ; add_sep buffer ; add_list buffer ps let contents buffer = (* TODO [OCaml 4.05] simply buffer contents if using Buffer.truncate *) let s = Buffer.contents buffer.content in if buffer.state = TRUNCATE then String.sub s 0 buffer.lastsep else s frama-c-20.0-Calcium/src/libraries/utils/sanitizer.mli0000666000000000000000000000410213571573400017626 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {2 Sanitizer} Keeps only alpha-numerical characters. Separator ['_'] is allowed, but leading, trailing and consecutive separators are removed. *) type buffer val create : ?truncate:bool -> int -> buffer val clear : buffer -> unit val add_sep : buffer -> unit (** Adds ['_'] character *) val add_char : buffer -> char -> unit val add_string : buffer -> string -> unit val add_list : buffer -> string list -> unit (** Separated with ['_'] *) val contents : buffer -> string frama-c-20.0-Calcium/src/libraries/utils/task.ml0000666000000000000000000003706513571573400016425 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Error Messages --- *) (* -------------------------------------------------------------------------- *) let error = function | Failure msg -> msg | Sys_error msg -> msg | Unix.Unix_error(e,_,"") -> Unix.error_message e | Unix.Unix_error(e,_,p) -> Printf.sprintf "%s (%s)" (Unix.error_message e) p | exn -> Printexc.to_string exn (* ------------------------------------------------------------------------ *) (* --- High Level Interface to Command --- *) (* ------------------------------------------------------------------------ *) type 'a status = | Timeout of int | Canceled | Result of 'a | Failed of exn let map f = function | Timeout n -> Timeout n | Canceled -> Canceled | Result x -> Result (f x) | Failed e -> Failed e let pretty pp fmt = function | Timeout _ -> Format.pp_print_string fmt "timeout" | Canceled -> Format.pp_print_string fmt "canceled" | Result x -> Format.fprintf fmt "result %a" pp x | Failed (Failure msg) -> Format.fprintf fmt "failed (%s)" msg | Failed e -> Format.fprintf fmt "failed (%s)" (Printexc.to_string e) (* -------------------------------------------------------------------------- *) (* --- Monadic Engine --- *) (* -------------------------------------------------------------------------- *) type coin = Coin | Kill type 'a async = | Yield | Wait of int | Return of 'a module Monad : sig type 'a t val unit : 'a -> 'a t val bind : 'a t -> ('a -> 'b t) -> 'b t val progress : 'a t -> 'a t val cancel : 'a t -> 'a t val yield : (coin -> 'a t) -> 'a t val async : (coin -> 'a async) -> 'a t val wait : 'a t -> 'a val finished : 'a t -> 'a option val waiting : 'a t -> bool end = struct type 'a t = | UNIT of 'a | WAIT of int * (coin -> 'a t) | YIELD of (coin -> 'a t) let unit a = UNIT a let rec bind m f = match m with | UNIT a -> f a | WAIT(d,m) -> WAIT (d, fun c -> bind (m c) f) | YIELD m -> YIELD (fun c -> bind (m c) f) let put c m = match m with | UNIT _ -> m | WAIT(_,f) | YIELD f -> f c let progress m = put Coin m let cancel m = put Kill m let yield f = YIELD f let rec ping f coin = match f coin with | Wait d -> WAIT(d,ping f) | Yield -> YIELD(ping f) | Return a -> UNIT a let async f = YIELD (ping f) let rec wait = function | UNIT a -> a | YIELD f -> !Db.progress() ; wait (f Coin) | WAIT(ms,f) -> !Db.progress() ; Extlib.usleep ms ; wait (f Coin) let finished = function UNIT a -> Some a | YIELD _ | WAIT _ -> None let waiting = function UNIT _ -> false | YIELD _ | WAIT _ -> true end (* ------------------------------------------------------------------------ *) (* --- Monadic Constructors --- *) (* ------------------------------------------------------------------------ *) type 'a task = 'a status Monad.t let wait = Monad.wait let status = Monad.unit let return r = Monad.unit (Result r) let raised e = Monad.unit (Failed e) let canceled () = Monad.unit Canceled (* unit is necessary for generalizing the type *) let failed text = let buffer = Buffer.create 80 in Format.kfprintf (fun fmt -> Format.pp_print_flush fmt () ; Monad.unit (Failed(Failure (Buffer.contents buffer)))) (Format.formatter_of_buffer buffer) text let bind = Monad.bind let async = Monad.async let sequence a k = Monad.bind a (function | Result r -> k r | Failed e -> Monad.unit (Failed e) | Timeout n -> Monad.unit (Timeout n) | Canceled -> Monad.unit Canceled) let nop = return () let nof _ = () let later ?(canceled=nof) f x = Monad.yield begin fun coin -> try match coin with | Coin -> f x | Kill -> canceled x ; Monad.unit Canceled with e -> raised e end let call ?(canceled=nof) f x = Monad.yield begin fun coin -> try match coin with | Coin -> return (f x) | Kill -> canceled x ; Monad.unit Canceled with e -> raised e end let todo ?canceled f = later ?canceled f () let job t = sequence t (fun _ -> nop) let finally t cb = Monad.bind t (fun s -> cb s ; Monad.unit s) let callback t cb = Monad.bind t (fun s -> cb s ; nop) let (>>>) = Monad.bind let (>>=) = sequence let (>>?) = finally let (>>!) = callback (* ------------------------------------------------------------------------ *) (* --- Critical Sections --- *) (* ------------------------------------------------------------------------ *) type mutex = bool ref let mutex () = ref false let rec lock m = if !m then later lock m else (m := true ; return ()) let unlock m = if not !m then (invalid_arg "Invalid lock on mutex") else m := false let sync m t = lock m >>= t >>? fun _ -> unlock m (* ------------------------------------------------------------------------ *) (* --- System Commands --- *) (* ------------------------------------------------------------------------ *) type cmd = { name : string ; timed : bool ; timeout : int ; time_start : float ; time_stop : float ; mutable time_killed : bool ; chrono : float ref option ; async : (unit -> Command.process_result) ; } let set_chrono cmd = match cmd.chrono with | None -> () | Some r -> r := max !r (Unix.gettimeofday () -. cmd.time_start) let set_time cmd t = match cmd.chrono with | None -> () | Some r -> r := max !r t let start_command ~timeout ?time ?stdout ?stderr cmd args = begin Kernel.debug ~dkey:Kernel.dkey_task "execute task '@[%t'@]" (fun fmt -> Format.pp_print_string fmt cmd ; Array.iter (fun c -> Format.fprintf fmt "@ %s" c) args) ; let timed = timeout > 0 || time <> None in let time_start = if timed then Unix.gettimeofday () else 0.0 in let time_stop = if timeout > 0 then time_start +. float_of_int timeout else 0.0 in let async = Command.command_async ?stdout ?stderr cmd args in { name = cmd ; timed = timed ; timeout = timeout ; time_start = time_start ; time_stop = time_stop ; time_killed = false ; chrono = time ; async = async ; } end let ping_command cmd coin = try match cmd.async () with | Command.Not_ready kill -> if coin = Kill then (kill () ; Wait 100) else let time_now = if cmd.timed then Unix.gettimeofday () else 0.0 in if cmd.timeout > 0 && time_now > cmd.time_stop then begin set_time cmd (time_now -. cmd.time_start) ; Kernel.debug ~dkey:Kernel.dkey_task "timeout '%s'" cmd.name ; cmd.time_killed <- true ; kill () ; end ; Wait 100 | Command.Result (Unix.WEXITED s|Unix.WSIGNALED s|Unix.WSTOPPED s) when cmd.time_killed -> set_chrono cmd ; Kernel.debug ~dkey:Kernel.dkey_task "timeout '%s' [%d]" cmd.name s ; Return (Timeout cmd.timeout) | Command.Result (Unix.WEXITED s) -> set_chrono cmd ; Kernel.debug ~dkey:Kernel.dkey_task "exit '%s' [%d]" cmd.name s ; Return (Result s) | Command.Result (Unix.WSIGNALED s|Unix.WSTOPPED s) -> set_chrono cmd ; Kernel.debug ~dkey:Kernel.dkey_task "signal '%s' [%d]" cmd.name s ; Return Canceled with e -> set_chrono cmd ; Kernel.debug ~dkey:Kernel.dkey_task "failure '%s' [%s]" cmd.name (Printexc.to_string e) ; Return (Failed e) let command ?(timeout=0) ?time ?stdout ?stderr cmd args = todo begin fun () -> let cmd = start_command ~timeout ?time ?stdout ?stderr cmd args in Monad.async (ping_command cmd) end (* ------------------------------------------------------------------------ *) (* --- Shared Tasks --- *) (* ------------------------------------------------------------------------ *) type 'a shared = { descr : string ; retry : bool ; mutable builder : (unit -> 'a task) ; mutable shared : 'a task ; mutable clients : int ; } let shared ~descr ~retry builder = { descr ; retry ; builder ; shared = todo builder ; clients = 0 } let retry_shared sh = function | Failed _ -> sh.retry | Timeout _ | Canceled -> true | Result _ -> false let ping_shared sh = function | Coin -> begin match Monad.finished sh.shared with | Some r -> if retry_shared sh r then sh.shared <- todo sh.builder ; Return r | None -> sh.shared <- Monad.progress sh.shared ; Yield end | Kill -> if sh.clients > 1 then begin sh.clients <- pred sh.clients ; Return Canceled end else ( if sh.clients = 1 then begin sh.clients <- 0 ; sh.shared <- Monad.cancel sh.shared ; end ; Yield ) let share sh = todo begin fun () -> sh.clients <- succ sh.clients ; Monad.async (ping_shared sh) end (* -------------------------------------------------------------------------- *) (* --- IDLE --- *) (* -------------------------------------------------------------------------- *) let on_idle = ref (fun f -> try while f () do Extlib.usleep 50000 (* wait for 50ms *) done with Db.Cancel -> ()) (* -------------------------------------------------------------------------- *) (* --- Task thread --- *) (* -------------------------------------------------------------------------- *) type thread = { mutable task : unit task ; mutable lock : bool ; } let thread task = { task = (task >>= fun _ -> nop) ; lock = false } let cancel th = th.task <- Monad.cancel th.task let progress th = th.lock || begin try th.lock <- true ; let t = Monad.progress th.task in th.task <- t ; th.lock <- false ; Monad.waiting t with e -> th.lock <- false ; raise e end let is_running th = th.lock || Monad.waiting th.task let run th = !on_idle (fun () -> (progress th)) (* -------------------------------------------------------------------------- *) (* --- Task Pool --- *) (* -------------------------------------------------------------------------- *) type pool = thread list ref let pool () = ref [] let add p t = let ps = List.filter is_running !p in p := if is_running t then t :: ps else ps let iter f p = p := List.filter (fun t -> f t ; is_running t) !p let flush p = p := List.filter is_running !p let size p = flush p ; List.length !p (* -------------------------------------------------------------------------- *) (* --- Task Server --- *) (* -------------------------------------------------------------------------- *) type callbacks = (unit -> unit) list (* Invariant: terminated + (length running) + Sum ( length queue.(i) ) == scheduled *) type server = { queue : thread Queue.t array ; mutable scheduled : int ; mutable terminated : int ; mutable running : thread list ; mutable procs : int ; mutable waiting : bool ; mutable wait : callbacks ; mutable activity : callbacks ; mutable start : callbacks ; mutable stop : callbacks ; } let fire callbacks = List.iter (fun f -> f ()) callbacks let server ?(stages=1) ?(procs=4) () = { queue = Array.init stages (fun _ -> Queue.create ()) ; running = [] ; procs = procs ; scheduled = 0 ; terminated = 0 ; activity = [] ; start = [] ; stop = [] ; wait = [] ; waiting = false ; } let set_procs s p = s.procs <- p let on_server_activity s cb = s.activity <- s.activity @ [cb] let on_server_wait s cb = s.wait <- s.wait @ [cb] let on_server_start s cb = s.start <- s.start @ [cb] let on_server_stop s cb = s.stop <- s.stop @ [cb] let cancel_all server = begin Array.iter (Queue.iter cancel) server.queue ; List.iter cancel server.running ; end let spawn server ?pool ?(stage=0) thread = begin (match pool with None -> () | Some pool -> add pool thread) ; Queue.push thread server.queue.(stage) ; (* queue(i) ++ *) server.scheduled <- succ server.scheduled ; (* scheduled ++ *) server.waiting <- false ; end (* invariant holds *) let scheduled s = s.scheduled let terminated s = s.terminated let waiting s = if s.waiting || s.running = [] then None else Some (List.length s.running) let is_empty server = try Array.iter (fun q -> if not (Queue.is_empty q) then raise Exit) server.queue ; true with Exit -> false let schedule server q = try while List.length server.running < server.procs do let task = Queue.take q in (* queue ++ *) if progress task then server.running <- task :: server.running (* running++ => invariant holds *) else server.terminated <- succ server.terminated (* terminated++ => invariant holds *) done with Queue.Empty -> () let rec run_server server () = begin server.running <- List.filter (fun task -> if progress task then true else ( (* running -- ; terminated ++ => invariant preserved *) server.terminated <- succ server.terminated ; false ) ) server.running ; Array.iter (schedule server) server.queue ; try !Db.progress () ; fire server.activity ; if server.running <> [] then begin if not server.waiting && is_empty server then begin fire server.wait ; server.waiting <- true ; end ; true end else begin fire server.stop ; server.scheduled <- 0 ; server.terminated <- 0 ; false end with _ -> (* Db.Cancel ... *) cancel_all server ; run_server server () end let launch server = if server.scheduled > server.terminated then ( fire server.start ; !on_idle (run_server server) ) frama-c-20.0-Calcium/src/libraries/utils/task.mli0000666000000000000000000002376313571573400016576 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** High Level Interface to Command. @since Carbon-20101201 *) (* ************************************************************************* *) (** {2 Task} *) (* ************************************************************************* *) type 'a task type 'a status = | Timeout of int | Canceled | Result of 'a | Failed of exn val error : exn -> string (** Extract error message form exception *) val wait : 'a task -> 'a status (** Blocks until termination. *) val map : ('a -> 'b) -> 'a status -> 'b status val pretty : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a status -> unit (* ************************************************************************* *) (** {2 Monadic Constructors} *) (* ************************************************************************* *) val nop : unit task (** The task that immediately returns unit *) val return : 'a -> 'a task (** The task that immediately returns a result *) val raised : exn -> 'a task (** The task that immediately fails with an exception *) val canceled : unit -> 'a task (** The task that is immediately canceled *) val failed : ('a,Format.formatter,unit,'b task) format4 -> 'a (** The task that immediately fails by raising a [Failure] exception. Typically: [[let exit d : 'a task = failed "exit status %d" k]] *) val call : ?canceled:('a -> unit) -> ('a -> 'b) -> 'a -> 'b task (** The task that, when started, invokes a function and immediately returns the result. *) val later : ?canceled:('a -> unit) -> ('a -> 'b task) -> 'a -> 'b task (** The task that, when started, compute a task to continue with. *) val todo : ?canceled:(unit -> unit) -> (unit -> 'a task) -> 'a task (** Specialized version of [later]. *) val status : 'a status -> 'a task (** The task that immediately finishes with provided status *) val bind : 'a task -> ('a status -> 'b task) -> 'b task (** [bind t k] first runs [t]. Then, when [t] exit with status [s], it starts task [k s]. Remark: If [t] was cancelled, [k s] is still evaluated, but immediately canceled as well. This allows [finally]-like behaviors to be implemented. To evaluate [k r] only when [t] terminates normally, make use of the [sequence] operator. *) val sequence : 'a task -> ('a -> 'b task) -> 'b task (** [sequence t k] first runs [t]. If [t] terminates with [Result r], then task [k r] is started. Otherwise, failure or cancelation of [t] is returned. *) val job : 'a task -> unit task val finally : 'a task -> ('a status -> unit) -> 'a task (** [finally t cb] runs task [t] and {i always} calls [cb s] when [t] exits with status [s]. Then [s] is returned. If the callback [cb] raises an exception, the returned status is emitted. *) val callback : 'a task -> ('a status -> unit) -> unit task (** Same as [finally] but the status of the task is discarded. *) type 'a async = | Yield (** give up the control *) | Wait of int (** wait for the number of milliseconds *) | Return of 'a (** return a value *) type coin = | Coin (** continue to work *) | Kill (** stop the computation *) val async : (coin -> 'a status async) -> 'a task (** low level command for managing ressource with active wait *) val (>>>) : 'a task -> ('a status -> 'b task) -> 'b task (** [bind] infix. *) val (>>=) : 'a task -> ('a -> 'b task) -> 'b task (** [sequence] infix. *) val (>>?) : 'a task -> ('a status -> unit) -> 'a task (** [finally] infix. *) val (>>!) : 'a task -> ('a status -> unit) -> unit task (** [callback] infix. *) (* ************************************************************************* *) (** {2 Synchronous Command} *) (* ************************************************************************* *) type mutex val mutex : unit -> mutex val sync : mutex -> (unit -> 'a task) -> 'a task (** Schedules a task such that only one can run simultaneously for a given mutex. *) (* ************************************************************************* *) (** {2 System Command} *) (* ************************************************************************* *) val command : ?timeout:int -> ?time:float ref -> ?stdout:Buffer.t -> ?stderr:Buffer.t -> string -> string array -> int task (** Immediately launch a system-process. Default timeout is [0], which means no-timeout at all. Standard outputs are discarded unless optional buffers are provided. To make the task start later, simply use [todo (command ...)]. *) (* ************************************************************************* *) (** {2 Shared Tasks} When two tasks [A] and [B] share a common sub-task [S], cancelling [A] will make [B] fail either. To prevent this, it is necessary to make [S] {i shareable} and to use two distinct {i instances} of [S] in [A] and [B]. Shared tasks manage the number of their instance and actually run or cancel a unique task on demand. In particular, shared tasks can be canceled and re-started later. @since Oxygen-20120901 *) (* ************************************************************************* *) type 'a shared (** Shareable tasks. *) val shared : descr:string -> retry:bool -> (unit -> 'a task) -> 'a shared (** Build a shareable task. The build function is called whenever a new instance is required but no shared instance task is actually running. Interrupted tasks (by Cancel or Timeout) are retried for further instances. If the task failed, it can be re-launch if [retry] is [true]. Otherwise, further instances will return [Failed] status. *) val share : 'a shared -> 'a task (** New instance of shared task. *) (* ************************************************************************* *) (** {2 Task Thread} *) (* ************************************************************************* *) type thread val thread : 'a task -> thread val cancel : thread -> unit val progress : thread -> bool (** Make the thread progress and return [true] if still running *) val is_running : thread -> bool (** Don't make the thread progress, just returns [true] if not terminated or not started yet *) val run : thread -> unit (** Runs one single task in the background. Typically using [on_idle]. *) (* ************************************************************************* *) (** {2 Task Pool} *) (* ************************************************************************* *) type pool val pool : unit -> pool val add : pool -> thread -> unit (** Auto-flush *) val iter : (thread -> unit) -> pool -> unit (** Auto-flush *) val flush : pool -> unit (** Clean all terminated tasks *) val size : pool -> int (** Auto-flush. Number of living tasks *) (* ************************************************************************* *) (** {2 Task Server} *) (* ************************************************************************* *) type server val server : ?stages:int -> ?procs:int -> unit -> server (** Creates a server of commands. @param stages number of queues in the server. Stage 0 tasks are issued first. Default is 1. @param procs maximum number of running tasks. Default is 4. *) val spawn : server -> ?pool:pool -> ?stage:int -> thread -> unit (** Schedules a task on the server. The task is not immediately started. *) val launch : server -> unit (** Starts the server if not running yet *) val cancel_all : server -> unit (** Cancel all scheduled tasks *) val set_procs : server -> int -> unit (** Adjusts the maximum number of running process. *) val on_server_activity : server -> (unit -> unit) -> unit (** Idle server callback *) val on_server_start : server -> (unit -> unit) -> unit (** On-start server callback *) val on_server_stop : server -> (unit -> unit) -> unit (** On-stop server callback *) val on_server_wait : server -> (unit -> unit) -> unit (** On-wait server callback (all tasks are scheduled) *) val scheduled : server -> int (** Number of scheduled process *) val terminated : server -> int (** Number of terminated process *) val waiting : server -> int option (** All task scheduled and server is waiting for termination *) (* ************************************************************************* *) (** {2 GUI Configuration} *) (* ************************************************************************* *) val on_idle : ((unit -> bool) -> unit) ref (** Typically modified by GUI. [!on_idle f] should repeatedly calls [f] until it returns [false]. Default implementation rely on [Unix.sleep 1] and [Db.progress]. See also [Gtk_helper] module implementation. *) frama-c-20.0-Calcium/src/libraries/utils/unicode.ml0000666000000000000000000000377513571573400017112 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let inset_string () = if Kernel.Unicode.get () then Utf8_logic.inset else "IN" let emptyset_string () = if Kernel.Unicode.get () then Utf8_logic.emptyset else "EMPTY_SET" let union_string () = if Kernel.Unicode.get () then Utf8_logic.union else "U" let top_string () = if Kernel.Unicode.get () then Utf8_logic.top else "TOP" let bottom_string () = if Kernel.Unicode.get () then Utf8_logic.bottom else "BOTTOM" frama-c-20.0-Calcium/src/libraries/utils/unicode.mli0000666000000000000000000000344113571573400017251 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Handling unicode string. *) val inset_string : unit -> string val emptyset_string : unit -> string val top_string: unit -> string val bottom_string: unit -> string val union_string: unit -> string frama-c-20.0-Calcium/src/libraries/utils/utf8_logic.ml0000666000000000000000000000646713571573400017530 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let from_unichar n = let rec log64 n = if n = 0 then 0 else 1 + log64 (n lsr 5) in let utf8_storage_len n = if n < 0x80 then 1 else log64 (n lsr 1) in (* this function is not exported, so it's OK to do a few 'unsafe' things *) let write_unichar s ~pos c = let len = utf8_storage_len c in if len = 1 then Bytes.unsafe_set s pos (Char.unsafe_chr c) else begin Bytes.unsafe_set s pos (Char.unsafe_chr (((1 lsl len - 1) lsl (8-len)) lor (c lsr ((len-1)*6)))); for i = 1 to len-1 do Bytes.unsafe_set s (pos+i) (Char.unsafe_chr (((c lsr ((len-1-i)*6)) land 0x3f) lor 0x80)) done ; end ; len in let s = Bytes.create 6 in let len = write_unichar s ~pos:0 n in Bytes.sub s 0 len |> Bytes.to_string let forall = from_unichar 0x2200 let exists = from_unichar 0x2203 let eq = from_unichar (*0x2263*) (*0x2250*) 0x2261 let neq = from_unichar 0x2262 let le = from_unichar 0x2264 let ge = from_unichar 0x2265 let minus = from_unichar 0x2212 let implies = from_unichar 0x21D2 let iff = from_unichar 0x21D4 let conj = from_unichar 0x2227 let disj = from_unichar 0x2228 let neg = from_unichar 0x00AC let x_or = from_unichar 0x22BB let inset = from_unichar 0x2208 let emptyset = from_unichar 0x2205 let top = from_unichar 0x22A4 let bottom = from_unichar 0x22A5 let union = from_unichar 0x222A let boolean = from_unichar 0x1D539 let integer = from_unichar 0x2124 let real = from_unichar 0x211D let pi = from_unichar 0x3C0 (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/utf8_logic.mli0000666000000000000000000000434413571573400017671 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** UTF-8 string for logic symbols. *) val forall : string val exists : string val eq : string val neq : string val le : string val ge : string val implies : string val iff : string val conj : string val disj : string val neg : string val x_or : string val inset : string val emptyset : string val top: string val bottom:string val union:string val minus: string val boolean: string val integer: string val real: string val pi: string (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/libraries/utils/vector.ml0000666000000000000000000001014613571573400016754 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Extensible Array --- *) (* -------------------------------------------------------------------------- *) type 'a t = { dumb : 'a ; mutable elt : 'a array ; mutable top : int ; } let create () = { dumb = Obj.magic (ref ()) ; top = 0 ; (* Invariant top <= length elt *) elt = [| |] ; (* Invariant elt.(k) == dump for top <= k *) } (* Requires n > length elt *) let do_grow w n = begin let elt = Array.make n w.dumb in Array.blit w.elt 0 elt 0 w.top ; w.elt <- elt ; end (* Requires 0 <= n < length elt *) let do_shrink w n = begin w.elt <- Array.sub w.elt 0 n ; if n < w.top then w.top <- n ; end let resize w n = let m = Array.length w.elt in if 0 <= n && n < m then do_shrink w n else if n > m then do_grow w n let shrink w = resize w w.top let size w = w.top let length w = w.top let capacity w = Array.length w.elt let get w k = if 0 <= k && k < w.top then w.elt.(k) else raise Not_found let set w k e = if 0 <= k && k < w.top then w.elt.(k) <- e else raise Not_found let addi w e = let k = w.top in let s = Array.length w.elt in if s <= k then do_grow w (max 1 (2*s)) ; w.top <- succ w.top ; w.elt.(k) <- e ; k let add w e = ignore (addi w e) let clear w = begin w.top <- 0 ; Array.fill w.elt 0 (Array.length w.elt) w.dumb ; end let iter f w = for k = 0 to w.top - 1 do f w.elt.(k) done let iteri f w = for k = 0 to w.top - 1 do f k w.elt.(k) done let map f w = { dumb = Obj.magic w.dumb ; top = w.top ; elt = Array.init w.top (fun i -> f w.elt.(i)) ; } let mapi f w = { dumb = Obj.magic w.dumb ; top = w.top ; elt = Array.init w.top (fun i -> f i w.elt.(i)) ; } let find w ?default ?(exn=Not_found) k = if 0 <= k && k < w.top then w.elt.(k) else match default with | None -> raise exn | Some e -> e let update w ?default k e = let exn = Invalid_argument "Vector.update" in if k < 0 then raise exn ; if k >= w.top then begin let n = succ k in let s = Array.length w.elt in if s <= k then do_grow w (max n (2*s)) ; if k > w.top then begin match default with | None -> raise exn | Some e -> Array.fill w.elt w.top (k-w.top) e ; end ; w.top <- n ; end ; w.elt.(k) <- e let of_array e = { dumb = Obj.magic (ref ()) ; elt = Array.copy e ; top = Array.length e ; } let to_array w = Array.sub w.elt 0 w.top frama-c-20.0-Calcium/src/libraries/utils/vector.mli0000666000000000000000000000654613571573400017136 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Extensible Arrays *) (* -------------------------------------------------------------------------- *) type 'a t val create : unit -> 'a t val length : 'a t -> int val size : 'a t -> int (** Same as [length] *) val get : 'a t -> int -> 'a (** Raise [Not_found] if out-of-bounds. *) val set : 'a t -> int -> 'a -> unit (** Raise [Not_found] if out-of-bounds. *) val add : 'a t -> 'a -> unit (** Element will be added at index [size]. After addition, it is at index [size-1]. *) val addi : 'a t -> 'a -> int (** Return index of added (last) element. *) val clear : 'a t -> unit (** Do not modify actual capacity. *) val iter : ('a -> unit) -> 'a t -> unit val iteri : (int -> 'a -> unit) -> 'a t -> unit val map : ('a -> 'b) -> 'a t -> 'b t (** Result is shrunk. *) val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t (** Result is shrunk. *) val find : 'a t -> ?default:'a -> ?exn:exn -> int -> 'a (** Default exception is [Not_found]. If a [default] value is provided, no exception is raised. *) val update : 'a t -> ?default:'a -> int -> 'a -> unit (** Set value at index. If the updated index is greater of equal to the vector size, empty cells are inserted with the default value. @raise Invalid_argument if the index is negative or when it exceeds the the vector size but the default value is not provided. *) val to_array : 'a t -> 'a array (** Makes a copy. *) val of_array : 'a array -> 'a t (** Makes a copy. *) (** Low-level interface. Internal capacity. *) val capacity : 'a t -> int (** Low-level interface. Sets internal capacity. Extra elements are removed. *) val resize : 'a t -> int -> unit (** Low-level interface. Sets capacity to content. *) val shrink : 'a t -> unit frama-c-20.0-Calcium/src/libraries/utils/wto.ml0000666000000000000000000002323013571573400016261 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Each component of the graph is either an individual node of the graph (without) self loop, or a strongly connected component where a node is designed as the head of the component and the remaining nodes are given by a list of components topologically ordered. *) type 'n component = | Component of 'n * 'n partition (** A strongly connected component, described by its head node and the remaining sub-components topologically ordered *) | Node of 'n (** A single node without self loop *) (** A list of strongly connected components, sorted topologically *) and 'n partition = 'n component list let fold_heads f acc l = let rec partition acc l = List.fold_left component acc l and component acc = function | Node _ -> acc | Component (h,l) -> partition (f acc h) l in partition acc l let flatten wto = let rec f acc = function | [] -> acc | Node v :: l -> f (v :: acc) l | Component (v,w) :: l -> f (f (v :: acc) w) l in List.rev (f [] wto) [@@@ warning "-42"] (* Bourdoncle's WTO algorithm builds on Tarjan's SCC algorithm. In Tarjan: - We visit every node once, starting from root, by following the successors; this creates a spanning tree of the graph. SCCs are subtrees of this spanning tree, whose root is the head of the SCC (although in non-natural SCCs, it is possible to enter into a SCC without going through the head). - This spanning tree is obtained using DFS. What DFS guarantees is that there is no path from a child c of a node n to other children of n, provided that there is no path from c to an ancestor of n. Thus when we visit other children of n, we know that they are no path to them from the descendants of c. - We assign consecutive numbers to each node in the order in which they have been visited. As the iteration is depth-first search, this gives a depth-first numbering (DFN). - Each time we visit a node n, we push it on a stack. After the visit, n is popped, unless a path exists from n to an element earlier on the stack. So the stack contains elements currently visited or that belongs to a non-trivial scc. Moreover, they are in topological order. About the proof of Tarjan: http://ls2-www.cs.uni-dortmund.de/~wegener/papers/connected.pdf *) module Make(N:sig type t (* = int *) val equal: t -> t -> bool val hash: t -> int val pretty: Format.formatter -> t -> unit (* val succ: t -> t list *) end) = struct let rec equal_component (x:N.t component) (y:N.t component) = match x,y with | Node x, Node y -> N.equal x y | Component (x,cx), Component (y,cy) -> N.equal x y && equal_partition cx cy | _ -> false and equal_partition x y = (try List.for_all2 equal_component x y with Invalid_argument _ -> false) let rec pretty_partition fmt part = List.iter (fun x -> Format.fprintf fmt "@ %a" pretty_component x) part and pretty_component fmt : N.t component -> unit = function | Node n -> N.pretty fmt n | Component(head,part) -> Format.fprintf fmt "@[(%a%a)@]" N.pretty head pretty_partition part module DFN = Hashtbl.Make(N);; type level = int (** Status of a visited vertex during the algorithm. *) type status = | Invisible (** The vertex have already been added into the partition and is hidden until the end of the search. *) | Parent of level (** The vertex have been visited and given a [level]. For the algorithm, this implies that there is a path between this vertex and the current vertex. *) (** Result of one [visit] *) type loop = | NoLoop (** The vertex is not in a loop *) | Loop of N.t * level (** The vertex is inside at least one loop, and level is the smallest level of all these loops *) let min_loop x y = match x, y with | NoLoop, z | z, NoLoop -> z | Loop(_,xi), Loop(_,yi) -> if xi <= yi then x else y type state = { dfn: status DFN.t; (* Mapping from nodes to its dfn, depth-first numbering. Note that we replaced the DFN=0 test by presence in the Hashtable. *) mutable num: level; (* Number of visited nodes. *) succs: N.t -> (N.t list); (* Successors transition. *) stack: N.t Stack.t } (** Visit [vertex], and all the vertices reachable from [vertex] which have not been explored yet (this is a depth-first search). Also gives [partition], which is the partition built so far Returns a pair (loop,partition) where - [loop] tells whether we are in a loop or not and gives the vertex of this loop with the lowest level. This vertex is also the deepest in the stack and the neareast vertex from the root that is below [vertex] in the spanning tree built by the DFS); - [partition] is returned completed. *) let rec visit ~pref state vertex partition = match DFN.find state.dfn vertex with (* The vertex is already in the partition *) | Invisible -> NoLoop, partition (* skip it *) (* The vertex have been visited but is not yet in the partition *) | Parent i -> Loop (vertex,i), partition (* we are in a loop *) (* The vertex have not been visited yet *) | exception Not_found -> (* Put the current vertex into the stack *) Stack.push vertex state.stack; (* Number it and mark it as visited *) let n = state.num + 1 in state.num <- n; DFN.replace state.dfn vertex (Parent n); (* Visit all its successors *) let succs = state.succs vertex in let (loop,partition) = List.fold_left (fun (loop,partition) succ -> let (loop',partition) = visit ~pref state succ partition in let loop = min_loop loop loop' in (loop,partition) ) (NoLoop,partition) succs in match loop with (* We are not in a loop. Add the vertex to the partition *) | NoLoop -> let _ = Stack.pop state.stack in DFN.replace state.dfn vertex Invisible; (NoLoop,Node(vertex)::partition) (* We are in a loop and the current vertex is the head of this loop *) | Loop(head,_) when N.equal head vertex -> (* Unmark all vertices in the loop, and, if pref is given, try to return a better head *) let rec reset_SCC best_head = (** pop until vertex *) let element = Stack.pop state.stack in DFN.remove state.dfn element; if not (N.equal element vertex) then begin let best_head = match pref with (** the strict is important because we are conservative *) | Some cmp when cmp best_head element < 0 -> element | _ -> best_head in reset_SCC best_head end else best_head in let best_head = reset_SCC vertex in let vertex, succs = if N.equal best_head vertex then vertex,succs else best_head, state.succs best_head in (* Makes [vertex] invisible in the subsequents visits. *) DFN.replace state.dfn vertex Invisible; (* Restart the component analysis *) let component = List.fold_left (fun component succ -> let (loop,component) = visit ~pref state succ component in (* Since we reset the component we should have no loop *) assert (loop = NoLoop); component ) [] succs in (NoLoop,Component(vertex,component)::partition) | _ -> (* [vertex] is part of a strongly connected component but is not the head. Do not update partition; the vertex will be added during the second visit of the SCC. *) (loop,partition) type pref = N.t -> N.t -> int let partition ?pref ~init ~succs = let state = {dfn = DFN.create 17; num = 0; succs; stack = Stack.create () } in let loop,component = visit ~pref state init [] in assert (loop = NoLoop); component end frama-c-20.0-Calcium/src/libraries/utils/wto.mli0000666000000000000000000000664713571573400016447 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Weak topological orderings (WTOs) are a hierarchical decomposition of the a graph where each layer is topologically ordered and strongly connected components are aggregated and ordered recursively. This is a very convenient representation to describe an evaluation order to reach a fixpoint. *) (** Each component of the graph is either an individual node of the graph (without) self loop, or a strongly connected component where a node is designed as the head of the component and the remaining nodes are given by a list of components topologically ordered. *) type 'n component = | Component of 'n * 'n partition (** A strongly connected component, described by its head node and the remaining sub-components topologically ordered *) | Node of 'n (** A single node without self loop *) (** A list of strongly connected components, sorted topologically *) and 'n partition = 'n component list val flatten: 'n partition -> 'n list val fold_heads: ('a -> 'n -> 'a) -> 'a -> 'n partition -> 'a (** This functor provides the partitioning algorithm constructing a WTO. *) module Make(Node:sig type t val equal: t -> t -> bool val hash: t -> int val pretty: Format.formatter -> t -> unit end):sig type pref = Node.t -> Node.t -> int (** partial order of preference for the choice of the head of a loop *) (** Implements Bourdoncle "Efficient chaotic iteration strategies with widenings" algorithm to compute a WTO. *) val partition: ?pref:pref -> init:Node.t -> succs:(Node.t -> Node.t list) -> Node.t partition val pretty_partition: Format.formatter -> Node.t partition -> unit val pretty_component: Format.formatter -> Node.t component -> unit val equal_component: Node.t component -> Node.t component -> bool val equal_partition: Node.t partition -> Node.t partition -> bool end frama-c-20.0-Calcium/src/plugins/0000777000000000000000000000000013571573400013463 5ustar frama-c-20.0-Calcium/src/plugins/aorai/0000777000000000000000000000000013571573400014556 5ustar frama-c-20.0-Calcium/src/plugins/aorai/Aorai.mli0000666000000000000000000000376113571573400016323 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: Ltl_to_acsl.mli,v 1.3 2008-10-10 16:03:25 uid588 Exp $ *) (** Aorai plugin (AKA Ltl_to_acsl). No function is directly exported: they are registered in {!Db.Aorai}. *) frama-c-20.0-Calcium/src/plugins/aorai/Makefile.in0000666000000000000000000001067713571573400016636 0ustar ########################################################################## # # # This file is part of Aorai plug-in of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # INRIA (Institut National de Recherche en Informatique et en # # Automatique) # # INSA (Institut National des Sciences Appliquees) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Makefile for compiling Aorai independently of Frama-C. # # To be used independently of Frama-C, a version of Frama-C compatible with # Aorai has to be properly installed as long as the Aorai-specific stuff. # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif PLUGIN_DIR ?=. PLUGIN_ENABLE:=@ENABLE_AORAI@ PLUGIN_NAME:=Aorai PLUGIN_GENERATED:= $(addprefix ${PLUGIN_DIR}/, \ promelalexer_withexps.ml promelaparser_withexps.ml \ promelaparser_withexps.mli \ promelalexer.ml promelaparser.ml promelaparser.mli \ ltllexer.ml ltlparser.ml ltlparser.mli \ yalexer.ml yaparser.ml yaparser.mli) PLUGIN_CMO:= bool3 \ aorai_option \ path_analysis \ promelaoutput \ logic_simplification \ data_for_aorai \ aorai_utils \ ltl_output \ utils_parser \ ltlparser \ ltllexer \ yaparser \ yalexer \ promelaparser \ promelalexer \ promelaparser_withexps \ promelalexer_withexps \ aorai_dataflow \ aorai_visitors \ aorai_register PLUGIN_CMI:= ltlast promelaast PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure PLUGIN_HAS_EXT_DOC:=no # [JS 2010/07/28] was 'yes' # but prevent 'make src-distrib to work # if ltltoba is not present, do not attempt to run any test. ifneq (@HAS_LTLTOBA@,yes) PLUGIN_NO_TEST:=yes PLUGIN_NO_DEFAULT_TEST:=yes endif PLUGIN_TESTS_DIRS:=aorai PLUGIN_TESTS_LIB:=$(PLUGIN_DIR)/tests/aorai/Aorai_test.ml $(PLUGIN_DIR)/tests/aorai/name_projects.ml include $(FRAMAC_SHARE)/Makefile.dynamic ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) AORAI_WP_SHARE=-aorai-test-wp-share $(FRAMAC_ROOT_SRCDIR)/src/plugins/wp/share else CONFIG_STATUS_DIR=. AORAI_WP_SHARE= endif $(Aorai_DIR)/tests/ptests_config: $(Aorai_DIR)/tests/test_config_prove $(Aorai_DIR)/tests/test_config_prove: \ $(Aorai_DIR)/tests/test_config_prove.in $(Aorai_DIR)/Makefile $(PRINT_MAKING) $@ $(RM) $@ $(SED) -e 's!@AORAI_WP_SHARE@!$(AORAI_WP_SHARE)!' $< > $@ $(CHMOD_RO) $@ Aorai_DEFAULT_TESTS: $(Aorai_DIR)/tests/aorai/Aorai_test.cmxs $(Aorai_DIR)/tests/aorai/Aorai_test.cmo $(Aorai_DIR)/tests/aorai/name_projects.cmxs $(Aorai_DIR)/tests/aorai/name_projects.cmo # Regenerating the Makefile on need $(Aorai_DIR)/Makefile: $(Aorai_DIR)/Makefile.in \ $(CONFIG_STATUS_DIR)/config.status cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ headers:: $(SED) -e 's/This file is/Files in this archive are/' \ $(FRAMAC_SRC)/headers/open-source/INSA_INRIA_LGPL \ > $(FRAMAC_SRC)/doc/aorai/example/LICENSE frama-c-20.0-Calcium/src/plugins/aorai/aorai_dataflow.ml0000666000000000000000000011334513571573400020073 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Overapproximation of the states that can be attained at each statement, together with actions that have been performed. *) open Dataflow2 open Data_for_aorai open Promelaast open Cil_types let forward_dkey = Aorai_option.register_category "dataflow:forward" let backward_dkey = Aorai_option.register_category "dataflow:backward" let set_of_map map = Data_for_aorai.Aorai_state.Map.fold (fun state _ acc -> Data_for_aorai.Aorai_state.Set.add state acc) map Data_for_aorai.Aorai_state.Set.empty let filter_state set map = Data_for_aorai.Aorai_state.Map.filter (fun state _ -> Data_for_aorai.Aorai_state.Set.mem state set) map let compose_range loc b r1 r2 = match r1, r2 with | Fixed c1, Fixed c2 -> Fixed (c1 + c2) | Fixed c, Interval(min,max) | Interval(min,max), Fixed c -> Interval (c+min,c+max) | Fixed c, Bounded(min,max) | Bounded(min,max), Fixed c -> let max = Logic_const.term (TBinOp(PlusA,max, Logic_const.tinteger c)) Linteger in Bounded(c+min,max) | Fixed c1, Unbounded min | Unbounded min, Fixed c1 -> Unbounded (min+c1) | Interval(min1,max1), Interval(min2,max2) -> Interval(min1+min2,max1+max2) (* NB: in the bounded case, we could check if upper bound of interval is less then lower bound of bounded to keep bounded. *) | Interval(min1,_), Bounded(min2,_) | Bounded(min2,_), Interval(min1,_) | Interval(min1,_), Unbounded min2 | Unbounded min2, Interval (min1,_) | Bounded(min1, _), Bounded (min2, _) | Unbounded min1, Unbounded min2 | Bounded(min1,_), Unbounded min2 | Unbounded min1, Bounded(min2,_) -> if Cil.isLogicZero b then Data_for_aorai.absolute_range loc (min1 + min2) else Unbounded (min1 + min2) let fail_on_both k elt1 elt2 = match elt1, elt2 with | None, None -> None | Some v, None | None, Some v -> Some v | Some _, Some _ -> Aorai_option.fatal "found a binding in both action and parameters table for %a" Printer.pp_term k let compose_bindings map1 loc vals map = let vals = Cil_datatype.Term.Map.fold (fun base intv vals -> let vals' = if Cil.isLogicZero base then Cil_datatype.Term.Map.add base intv Cil_datatype.Term.Map.empty else try let orig_base = Cil_datatype.Term.Map.find base map1 in Cil_datatype.Term.Map.fold (fun base intv' map -> let intv' = compose_range loc base intv' intv in Cil_datatype.Term.Map.add base intv' map ) orig_base Cil_datatype.Term.Map.empty with Not_found -> Cil_datatype.Term.Map.add base intv Cil_datatype.Term.Map.empty in Cil_datatype.Term.Map.merge (Extlib.merge_opt (Data_for_aorai.merge_range loc)) vals' vals ) vals Cil_datatype.Term.Map.empty in try let vals' = Cil_datatype.Term.Map.find loc map in let vals' = Cil_datatype.Term.Map.merge (Extlib.merge_opt (Data_for_aorai.merge_range loc)) vals' vals in Cil_datatype.Term.Map.add loc vals' map with Not_found -> Cil_datatype.Term.Map.add loc vals map let compose_actions ?(args=Cil_datatype.Term.Map.empty) (fst,_,map1) (_,last,map2) = let map_args = Cil_datatype.Term.Map.merge fail_on_both map1 args in let map = Cil_datatype.Term.Map.fold (compose_bindings map_args) map2 Cil_datatype.Term.Map.empty in (fst,last, Cil_datatype.Term.Map.fold (fun elt bind map -> if Cil_datatype.Term.Map.mem elt map2 then map else Cil_datatype.Term.Map.add elt bind map) map1 map) let compose_states ?(args=Cil_datatype.Term.Map.empty) start_state end_state = let treat_one_curr_state stop bindings acc = try let new_states = Data_for_aorai.Aorai_state.Map.find stop end_state in let composed_actions = Data_for_aorai.Aorai_state.Map.map (fun elt -> compose_actions ~args bindings elt) new_states in let merge_stop_state _ (fst1, last1, map1) (fst2, last2, map2) = (Data_for_aorai.Aorai_state.Set.union fst1 fst2, Data_for_aorai.Aorai_state.Set.union last1 last2, Data_for_aorai.merge_bindings map1 map2) in Data_for_aorai.Aorai_state.Map.merge (Extlib.merge_opt merge_stop_state) composed_actions acc with Not_found -> acc in let treat_one_start_state start curr_states acc = let trans_state = Data_for_aorai.Aorai_state.Map.fold treat_one_curr_state curr_states Data_for_aorai.Aorai_state.Map.empty in if Data_for_aorai.Aorai_state.Map.is_empty trans_state then acc else Data_for_aorai.Aorai_state.Map.add start trans_state acc in Data_for_aorai.Aorai_state.Map.fold treat_one_start_state start_state Data_for_aorai.Aorai_state.Map.empty module Call_state = State_builder.Hashtbl (Cil_datatype.Stmt.Hashtbl) (Case_state) (struct let name = "Data_for_aorai.Call_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_call_state stmt state = let real_state = try let loop = Kernel_function.find_enclosing_loop (Kernel_function.find_englobing_kf stmt) stmt in try let init_state = Data_for_aorai.get_loop_init_state loop in compose_states init_state state with Not_found -> Aorai_option.fatal "Cannot find state at loop entry when analyzing statement \ inside loop body" with Not_found -> state in let change old_state = Data_for_aorai.merge_state old_state real_state in let set _ = real_state in ignore (Call_state.memo ~change set stmt) module Return_state = State_builder.Hashtbl (Cil_datatype.Stmt.Hashtbl) (Case_state) (struct let name = "Data_for_aorai.Return_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_return_state stmt state = let change old_state = Data_for_aorai.merge_state old_state state in let set _ = state in ignore (Return_state.memo ~change set stmt) module type Init = sig val kf: Kernel_function.t val stack: (Kernel_function.t * bool ref) list (* call stack. flag is set to true for the topmost function of each recursion. *) val initial_state: Data_for_aorai.state * Cil_datatype.Stmt.Set.t end let compute_func = ref (fun _ _ _ _ -> Aorai_option.fatal "Aorai_dataflow.compute_func not properly initialized") let extract_current_states s = Data_for_aorai.Aorai_state.Map.fold (fun _ tbl acc -> Data_for_aorai.Aorai_state.Map.fold (fun s _ acc -> Data_for_aorai.Aorai_state.Set.add s acc) tbl acc) s Data_for_aorai.Aorai_state.Set.empty let add_or_merge state (fst, last, bindings as elt) tbl = try let (old_fst, old_last, old_bindings) = Data_for_aorai.Aorai_state.Map.find state tbl in let merged_fst = Data_for_aorai.Aorai_state.Set.union old_fst fst in let merged_last = Data_for_aorai.Aorai_state.Set.union old_last last in let merged_bindings = Data_for_aorai.merge_bindings old_bindings bindings in Data_for_aorai.Aorai_state.Map.add state (merged_fst, merged_last, merged_bindings) tbl with Not_found -> Data_for_aorai.Aorai_state.Map.add state elt tbl let actions_to_range l = let add_single_action t b off acc = let binding = Cil_datatype.Term.Map.add b off Cil_datatype.Term.Map.empty in Cil_datatype.Term.Map.add t binding acc in let treat_one_action acc = function | Counter_init lv -> let t = Data_for_aorai.tlval lv in add_single_action t (Cil.lzero()) (Fixed 1) acc | Counter_incr lv -> let t = Data_for_aorai.tlval lv in add_single_action t t (Fixed 1) acc | Pebble_init(_,_,c) -> (* TODO: put post-conds on pebble sets *) let t = Logic_const.tvar c in add_single_action t t (Fixed 1) acc | Pebble_move _ -> acc (* TODO: put post-conds on pebble sets *) | Copy_value (lv,t) -> let loc = Data_for_aorai.tlval lv in add_single_action loc t (Fixed 0) acc in List.fold_left treat_one_action Cil_datatype.Term.Map.empty l let make_start_transition ?(is_main=false) kf init_states = let auto = Data_for_aorai.getAutomata () in let is_crossable = if is_main then Aorai_utils.isCrossableAtInit else (fun trans kf -> Aorai_utils.isCrossable trans kf Promelaast.Call) in let treat_one_state state acc = let my_trans = Path_analysis.get_transitions_of_state state auto in let treat_one_trans acc trans = if is_crossable trans kf then begin let (_,action) = trans.cross in let bindings = actions_to_range action in let fst_set = Data_for_aorai.Aorai_state.Set.singleton trans.stop in let last_set = Data_for_aorai.Aorai_state.Set.singleton state in add_or_merge trans.stop (fst_set, last_set, bindings) acc end else acc in let possible_states = List.fold_left treat_one_trans Data_for_aorai.Aorai_state.Map.empty my_trans in if Data_for_aorai.Aorai_state.Map.is_empty possible_states then acc else Data_for_aorai.Aorai_state.Map.add state possible_states acc in let res = Data_for_aorai.Aorai_state.Set.fold treat_one_state init_states Data_for_aorai.Aorai_state.Map.empty in res let make_return_transition kf state = let s = Kernel_function.find_return kf in set_return_state s state; let auto = Data_for_aorai.getAutomata () in let treat_one_state state bindings acc = let my_trans = Path_analysis.get_transitions_of_state state auto in let last = Data_for_aorai.Aorai_state.Set.singleton state in let treat_one_trans acc trans = if Aorai_utils.isCrossable trans kf Promelaast.Return then begin let (_,action) = trans.cross in let my_bindings = actions_to_range action in let new_bindings = compose_actions bindings (last, last, my_bindings) in add_or_merge trans.stop new_bindings acc end else acc in List.fold_left treat_one_trans acc my_trans in let treat_one_path start_state curr_state acc = let res = Data_for_aorai.Aorai_state.Map.fold treat_one_state curr_state Data_for_aorai.Aorai_state.Map.empty in if Data_for_aorai.Aorai_state.Map.is_empty res then acc else Data_for_aorai.Aorai_state.Map.add start_state res acc in Data_for_aorai.Aorai_state.Map.fold treat_one_path state Data_for_aorai.Aorai_state.Map.empty let create_loop_init state = let res = Aorai_state.Map.fold (fun _ s acc -> Aorai_state.Map.fold (fun final (_,pre_final,_) acc -> let map = try Aorai_state.Map.find final acc with Not_found -> Aorai_state.Map.empty in let (init,last,actions) = try Aorai_state.Map.find final map with Not_found -> (Aorai_state.Set.empty,Aorai_state.Set.empty, Cil_datatype.Term.Map.empty) in let map = Aorai_state.Map.add final (Aorai_state.Set.union pre_final init, Aorai_state.Set.union pre_final last, actions) map in Aorai_state.Map.add final map acc) s acc) state Aorai_state.Map.empty in Aorai_option.debug ~dkey:forward_dkey "@[State at loop entry@\n%a@]" Data_for_aorai.pretty_state res; res module Computer(I: Init) = struct let name = "Aorai forward analysis" let debug = false (* We keep track of the loops that we have entered, since we distinguish states at loop initialization from states during loop itself: when combining predecessors, we must know where we come from. *) type data = (Data_for_aorai.state * Cil_datatype.Stmt.Set.t) type t = data let copy = Extlib.id let pretty fmt (s,_) = Data_for_aorai.pretty_state fmt s (* we do not propagate inside the loop the actions made before, to obtain more precise loop assigns. This is merged back in doEdge when we exit the loop. *) let computeFirstPredecessor stmt (s,loops as res) = match stmt.skind with | Loop _ -> Data_for_aorai.set_loop_init_state stmt s; create_loop_init s, Cil_datatype.Stmt.Set.add stmt loops | _ -> res let combinePredecessors stmt ~old (cur,loops) = let (old,_) = old in (* we don't care about loops in old state: it has already been handled *) let is_loop = match stmt.skind with | Loop _ -> true | _ -> false in Aorai_option.debug ~dkey:forward_dkey "Combining state (loop is %B)@\n @[%a@]@\nwith state@\n @[%a@]" is_loop Data_for_aorai.pretty_state old Data_for_aorai.pretty_state cur; if Data_for_aorai.included_state cur old then begin Aorai_option.debug ~dkey:forward_dkey "Included"; if is_loop && Cil_datatype.Stmt.Set.mem stmt loops && Data_for_aorai.Aorai_state.Map.is_empty (Data_for_aorai.get_loop_invariant_state stmt) then Data_for_aorai.set_loop_invariant_state stmt cur; None end else begin let res = if is_loop then begin (* set_loop implicitly merges states when needed. However, we still have to distinguish whether we are already in the loop or at the initial stage. *) if Cil_datatype.Stmt.Set.mem stmt loops then begin Data_for_aorai.set_loop_invariant_state stmt cur; Data_for_aorai.get_loop_invariant_state stmt end else begin Data_for_aorai.set_loop_init_state stmt cur; create_loop_init (Data_for_aorai.get_loop_init_state stmt) end end else begin Data_for_aorai.merge_state old cur end in Aorai_option.debug ~dkey:forward_dkey "Merged state is@\n @[%a@]" Data_for_aorai.pretty_state res; let loops = if is_loop then Cil_datatype.Stmt.Set.add stmt loops else loops in Some (res,loops) end let do_call s f args (state,loops as d) = let kf = Globals.Functions.get f in if Data_for_aorai.isIgnoredFunction (Kernel_function.get_name kf) then d (* we simply skip ignored functions. *) else begin set_call_state s state; Aorai_option.debug ~dkey:forward_dkey "Call to %a from state:@\n @[%a@]" Kernel_function.pretty kf Data_for_aorai.pretty_state state; let prms = Kernel_function.get_formals (Globals.Functions.get f) in let rec bind acc prms args = match prms, args with (* in case of variadics, we can have more args than prms *) | [],_ -> acc | _,[] -> Aorai_option.fatal "too few arguments in call to %a" Printer.pp_varinfo f | p::prms, a::args -> let lv = Logic_const.tvar (Cil.cvar_to_lvar p) in let la = Logic_utils.expr_to_term ~cast:false a in let value = Cil_datatype.Term.Map.add la (Fixed 0) Cil_datatype.Term.Map.empty in let acc = Cil_datatype.Term.Map.add lv value acc in bind acc prms args in let args = bind Cil_datatype.Term.Map.empty prms args in let init_states = extract_current_states state in let init_trans = make_start_transition kf init_states in let end_state = !compute_func I.stack (Kstmt s) kf init_trans in let new_state = compose_states ~args state end_state in Aorai_option.debug ~dkey:forward_dkey "At end of call:@\n @[%a@]" Data_for_aorai.pretty_state new_state; (new_state,loops) end let doInstr s i d = match i with | Call (_,{ enode = Lval(Var v,NoOffset) },args,_) -> do_call s v args d | Call (_,e,_,_) -> Aorai_option.not_yet_implemented "Indirect call to %a is not handled yet" Printer.pp_exp e | Local_init (v, ConsInit(f,args,kind),_) -> let args = match kind with | Plain_func -> args | Constructor -> Cil.mkAddrOfVi v :: args in do_call s f args d | Local_init (_, AssignInit _, _) | Set _ | Asm _ | Skip _ | Code_annot _ -> d let doGuard _ _ _ = (GDefault, GDefault) let doStmt _ (state,_) = if Data_for_aorai.Aorai_state.Map.is_empty state then (* Statement is not conforming to the automaton. It must be on a dead path for the whole program to match the spec. *) SDone else SDefault let edge_exits_loop kf s1 s2 = try let loop = Kernel_function.find_enclosing_loop kf s1 in not (Cil_datatype.Stmt.equal loop s2) && (match loop.skind with | Loop(_,b,_,_,_) -> List.exists (fun b' -> Cil_datatype.Block.equal b b') (Kernel_function.blocks_closed_by_edge s1 s2) | _ -> false) with Not_found -> false let doEdge s1 s2 (state,loops as t) = let kf = Kernel_function.find_englobing_kf s1 in if edge_exits_loop kf s1 s2 then begin let loop = Kernel_function.find_enclosing_loop kf s1 in let pre_state = Data_for_aorai.get_loop_init_state loop in let propagate = compose_states pre_state state in Aorai_option.debug ~dkey:forward_dkey "@[Exiting from loop:@\nInit state is@\n%a@\nCurrent state is@\n%a@\n\ Propagated state is@\n%a@\n@]" Data_for_aorai.pretty_state pre_state Data_for_aorai.pretty_state state Data_for_aorai.pretty_state propagate; propagate,loops end else t module StmtStartData = Dataflow2.StartData(struct type t = data let size = 17 end) let () = let start = Kernel_function.find_first_stmt I.kf in StmtStartData.add start I.initial_state end let compute_func_aux stack call_site kf init_state = if Data_for_aorai.isIgnoredFunction (Kernel_function.get_name kf) then Aorai_option.fatal "compute_func on function %a which is ignored by Aorai" Kernel_function.pretty kf else if List.mem_assq kf stack then begin (* Recursive call: we assume all possible paths can be taken *) let flag = List.assq kf stack in flag := true; Data_for_aorai.set_kf_init_state kf init_state; let end_state = try Data_for_aorai.get_kf_return_state kf with Not_found -> Data_for_aorai.Aorai_state.Map.empty in end_state end else begin let module Init = struct let kf = kf let stack = (kf, ref false) :: stack let initial_state = match Kernel_function.find_first_stmt kf with | { skind = Loop _ } as stmt -> Data_for_aorai.set_loop_init_state stmt init_state; (* we are directly entering the loop *) create_loop_init init_state, Cil_datatype.Stmt.Set.singleton stmt | _ -> init_state, Cil_datatype.Stmt.Set.empty end in let module Compute = Computer (Init) in let module Dataflow = Forwards(Compute) in Aorai_option.debug ~dkey:forward_dkey "Call to %a, Initial state is:@\n @[%a@]" Kernel_function.pretty kf Data_for_aorai.pretty_state init_state; Data_for_aorai.set_kf_init_state kf init_state; if Kernel_function.is_definition kf then begin let start = Kernel_function.find_first_stmt kf in (match start.skind with (* If the first statement itself is a loop, sets the appropriate table, as this won't be done in Computer (technically, there is not firstPredecessor in this particular case) *) | Loop _ -> Data_for_aorai.set_loop_init_state start init_state | _ -> ()); Dataflow.compute [Kernel_function.find_first_stmt kf] end; let end_state = if Kernel_function.is_definition kf then begin try Compute.StmtStartData.find (Kernel_function.find_return kf) with Not_found -> let source = match call_site with | Kglobal -> None | Kstmt _ -> Some (fst (Cil_datatype.Kinstr.loc call_site)) in Aorai_option.warning ?source "Call to %a does not follow automaton's specification. \ This path is assumed to be dead" Kernel_function.pretty kf; (Data_for_aorai.Aorai_state.Map.empty, Cil_datatype.Stmt.Set.empty) end else (* we assume a declared function does not make any call. *) (init_state, Cil_datatype.Stmt.Set.empty) in let trans_state = make_return_transition kf (fst end_state) in let (my_kf, flag) = List.hd Init.stack in assert (kf == my_kf); if !flag then begin let curr_end = try Data_for_aorai.get_kf_return_state kf with Not_found -> Data_for_aorai.Aorai_state.Map.empty in Data_for_aorai.set_kf_return_state kf trans_state; if Data_for_aorai.included_state trans_state curr_end then curr_end else (* See if we've reached a fixpoint *) let init_state = Data_for_aorai.get_kf_init_state kf in !compute_func stack call_site kf init_state end else begin Data_for_aorai.set_kf_return_state kf trans_state; trans_state end end let () = compute_func := compute_func_aux let compute_forward () = let kf = Globals.Functions.find_by_name (Kernel.MainFunction.get()) in if Data_for_aorai.isIgnoredFunction (Kernel_function.get_name kf) then Aorai_option.abort "Main function %a is ignored by Aorai" Kernel_function.pretty kf; let (states,_) = Data_for_aorai.getAutomata () in let start = List.fold_left (fun acc s -> match s.Promelaast.init with | Bool3.True -> Data_for_aorai.Aorai_state.Set.add s acc | _ -> acc) Data_for_aorai.Aorai_state.Set.empty states in let start_state = make_start_transition ~is_main:true kf start in ignore (compute_func_aux [] Kglobal kf start_state) module type Reachable_end_states = sig val kf: Kernel_function.t val stack: Kernel_function.t list val end_state: Data_for_aorai.state end module Pre_state = Kernel_function.Make_Table (Data_for_aorai.Case_state) (struct let name = "Aorai_dataflow.Pre_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_kf_init_state kf state = let change old_state = Data_for_aorai.merge_state old_state state in let set _ = state in let state = (Pre_state.memo ~change set kf) in Aorai_option.debug ~dkey:backward_dkey "Call to %a, pre-state after backward analysis:@\n @[%a@]" Kernel_function.pretty kf Data_for_aorai.pretty_state state; module Post_state = Kernel_function.Make_Table (Data_for_aorai.Case_state) (struct let name = "Aorai_dataflow.Post_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_kf_return_state kf state = let change old_state = Data_for_aorai.merge_state old_state state in let set _ = state in ignore (Post_state.memo ~change set kf) module Init_loop_state = State_builder.Hashtbl (Cil_datatype.Stmt.Hashtbl) (Data_for_aorai.Case_state) (struct let name = "Aorai_dataflow.Init_loop_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_init_loop_state stmt state = let change old_state = Data_for_aorai.merge_state old_state state in let set _ = state in ignore (Init_loop_state.memo ~change set stmt) module Invariant_loop_state = State_builder.Hashtbl (Cil_datatype.Stmt.Hashtbl) (Data_for_aorai.Case_state) (struct let name = "Aorai_dataflow.Invariant_loop_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_invariant_loop_state stmt state = let change old_state = Data_for_aorai.merge_state old_state state in let set _ = state in ignore (Invariant_loop_state.memo ~change set stmt) let backward_analysis = ref (fun _ _ _ -> Aorai_option.fatal "Aorai_dataflow.backward_analysis not properly initialized") module Backwards_computer (Reach: Reachable_end_states) = struct let name = "Aorai backward computation" let debug = false type t = Data_for_aorai.state let pretty = Data_for_aorai.pretty_state let funcExitData = Data_for_aorai.Aorai_state.Map.empty let combineStmtStartData s ~old st = Aorai_option.debug ~dkey:backward_dkey "Statement %d:@\n%a@\nOld state is@\n%a@\nNew state is@\n%a" s.sid Cil_datatype.Stmt.pretty s Data_for_aorai.pretty_state old Data_for_aorai.pretty_state st; if Data_for_aorai.included_state st old then begin Aorai_option.debug ~dkey:backward_dkey "Included"; None end else begin Aorai_option.debug ~dkey:backward_dkey "Continuing with:@\n%a" Data_for_aorai.pretty_state st; Some st end let combineSuccessors = Data_for_aorai.merge_state let doStmt s = match s.skind with | Return _ -> Dataflow2.Done Reach.end_state | _ -> Dataflow2.Default let do_call s f state = let kf = Globals.Functions.get f in if Data_for_aorai.isIgnoredFunction (Kernel_function.get_name kf) then Dataflow2.Default (* we simply skip ignored functions. *) else begin try let call_state = Call_state.find s in let treat_one_state state map acc = let current_states = set_of_map map in let before_state = !backward_analysis Reach.stack kf current_states in let possible_states = set_of_map before_state in let call_map = Data_for_aorai.Aorai_state.Map.find state call_state in Aorai_option.debug ~dkey:backward_dkey "Stmt %d - %a@\nPossible states@\n%a" s.sid Cil_datatype.Stmt.pretty s (Data_for_aorai.pretty_end_state state) call_map; let call_map = filter_state possible_states call_map in Aorai_option.debug ~dkey:backward_dkey "Filtered states@\n%a" (Data_for_aorai.pretty_end_state state) call_map; if Data_for_aorai.Aorai_state.Map.is_empty call_map then acc else Data_for_aorai.Aorai_state.Map.add state call_map acc in let before_state = Data_for_aorai.Aorai_state.Map.fold treat_one_state state Data_for_aorai.Aorai_state.Map.empty in Done before_state with Not_found -> (* Not attained by forward analysis: this code is dead anyway. *) Done Data_for_aorai.Aorai_state.Map.empty end let doInstr s instr state = match instr with | Call (_,{ enode = Lval(Var f,NoOffset) },_,_) -> do_call s f state | Call (_,e,_,_) -> Aorai_option.not_yet_implemented "Indirect call to %a is not handled yet" Printer.pp_exp e | Local_init (_,ConsInit(f,_,_),_) -> do_call s f state | Local_init (_,AssignInit _,_) | Set _ | Asm _ | Skip _ | Code_annot _ -> Dataflow2.Default let filterStmt _ _ = true module StmtStartData = Dataflow2.StartData (struct type t = Data_for_aorai.state let size = 17 end) let () = if Kernel_function.is_definition Reach.kf then begin let (all_stmts,_) = Dataflow2.find_stmts (Kernel_function.get_definition Reach.kf) in List.iter (fun s -> StmtStartData.add s Data_for_aorai.Aorai_state.Map.empty) all_stmts; end end let filter_possible_states kf states = let post_state = Data_for_aorai.get_kf_return_state kf in let treat_one_state state post_state acc = let post_state = filter_state states post_state in if Data_for_aorai.Aorai_state.Map.is_empty post_state then acc else Data_for_aorai.Aorai_state.Map.add state post_state acc in Data_for_aorai.Aorai_state.Map.fold treat_one_state post_state Data_for_aorai.Aorai_state.Map.empty let filter_return_states kf states = let end_state = Return_state.find (Kernel_function.find_return kf) in let auto = Data_for_aorai.getAutomata () in let is_possible_state start_state state _ = try let trans = Path_analysis.get_transitions_of_state state auto in let return_states = Data_for_aorai.Aorai_state.Map.find start_state states in let crossable tr = Aorai_utils.isCrossable tr kf Promelaast.Return && Data_for_aorai.Aorai_state.Map.mem tr.stop return_states in List.exists crossable trans with Not_found -> false in let filter_possible_states state map = Data_for_aorai.Aorai_state.Map.filter (is_possible_state state) map in let treat_one_state state map acc = let res = filter_possible_states state map in if Data_for_aorai.Aorai_state.Map.is_empty res then acc else Data_for_aorai.Aorai_state.Map.add state res acc in let res = Data_for_aorai.Aorai_state.Map.fold treat_one_state end_state Data_for_aorai.Aorai_state.Map.empty in if Data_for_aorai.Aorai_state.Map.is_empty res && not (Data_for_aorai.Aorai_state.Map.is_empty end_state) then (* Do not emit warning if forward computation already decided that the call was not conforming to the spec. *) Aorai_option.warning ~current:true "Call to %a not conforming to automaton (post-cond). \ Assuming it is on a dead path" Kernel_function.pretty kf; res let filter_loop_init_states old_map restrict_map = let treat_one_state state old_states acc = try let restrict_states = Data_for_aorai.Aorai_state.Map.find state restrict_map in let old_states = filter_state (set_of_map restrict_states) old_states in if Data_for_aorai.Aorai_state.Map.is_empty old_states then acc else Data_for_aorai.Aorai_state.Map.add state old_states acc with Not_found -> acc (* not accessible in any case *) in Data_for_aorai.Aorai_state.Map.fold treat_one_state old_map Data_for_aorai.Aorai_state.Map.empty let filter_loop_invariant_states old_map restrict_map = let acceptable_states = Data_for_aorai.Aorai_state.Map.fold (fun _ s acc -> Data_for_aorai.Aorai_state.Set.union (set_of_map s) acc) restrict_map Data_for_aorai.Aorai_state.Set.empty in let treat_one_state state old_states acc = if Data_for_aorai.Aorai_state.Set.mem state acceptable_states then begin let old_states = filter_state acceptable_states old_states in if Data_for_aorai.Aorai_state.Map.is_empty old_states then acc else Data_for_aorai.Aorai_state.Map.add state old_states acc end else acc in Data_for_aorai.Aorai_state.Map.fold treat_one_state old_map Data_for_aorai.Aorai_state.Map.empty let filter_init_state restrict initial map acc = try let restrict_map = Data_for_aorai.Aorai_state.Map.find initial restrict in let map = Data_for_aorai.Aorai_state.Map.filter (fun state _ -> Data_for_aorai.Aorai_state.Map.mem state restrict_map) map in if Data_for_aorai.Aorai_state.Map.is_empty map then acc else Data_for_aorai.Aorai_state.Map.add initial map acc with Not_found -> acc let backward_analysis_aux stack kf ret_state = if (Data_for_aorai.isIgnoredFunction (Kernel_function.get_name kf)) then Aorai_option.fatal "Call backward analysis on ignored function %a" Kernel_function.pretty kf else if List.memq kf stack then begin (* recursive function: just attempt to filter wrt attainable current states *) let kf_post_state = filter_possible_states kf ret_state in set_kf_return_state kf kf_post_state; let before_state = Data_for_aorai.get_kf_init_state kf in let before_state = Data_for_aorai.Aorai_state.Map.filter (fun s _ -> Data_for_aorai.Aorai_state.Map.mem s kf_post_state) before_state in set_kf_init_state kf before_state; before_state end else begin let kf_post_state = filter_possible_states kf ret_state in set_kf_return_state kf kf_post_state; let end_state = filter_return_states kf kf_post_state in let module Computer = Backwards_computer (struct let stack = kf :: stack let kf = kf let end_state = end_state end) in let module Compute = Dataflow2.Backwards(Computer) in let (all_stmts,sink_stmts) = Dataflow2.find_stmts (Kernel_function.get_definition kf) in Compute.compute sink_stmts; let restrict_state = try Computer.StmtStartData.find (Kernel_function.find_first_stmt kf) with Not_found -> Data_for_aorai.Aorai_state.Map.empty in let before_state = Data_for_aorai.get_kf_init_state kf in let new_state = Data_for_aorai.Aorai_state.Map.fold (filter_init_state restrict_state) before_state Data_for_aorai.Aorai_state.Map.empty in if Data_for_aorai.Aorai_state.Map.is_empty new_state && not (Data_for_aorai.Aorai_state.Map.is_empty before_state) then begin Aorai_option.warning ~current:true "Call to %a not conforming to automaton (pre-cond). \ Assuming it is on a dead path" Kernel_function.pretty kf; end; set_kf_init_state kf new_state; let treat_one_loop s = try let states = Computer.StmtStartData.find s in (try let init = Data_for_aorai.get_loop_init_state s in let init = filter_loop_init_states init states in set_init_loop_state s init; with Not_found -> ()); (try let inv = Data_for_aorai.get_loop_invariant_state s in let inv = filter_loop_invariant_states inv states in set_invariant_loop_state s inv with Not_found -> ()) with Not_found -> Aorai_option.warning ~source:(fst (Cil_datatype.Stmt.loc s)) "Statement %a@ not conforming to automaton. \ Assuming it is on a dead path" Printer.pp_stmt s in let visit = object inherit Visitor.frama_c_inplace method! vstmt_aux s = match s.skind with | Loop _ -> treat_one_loop s; Cil.DoChildren | _ -> Cil.DoChildren end in let visit_stmt s = ignore (Visitor.visitFramacStmt visit s) in List.iter visit_stmt all_stmts; before_state end let () = backward_analysis := backward_analysis_aux let compute_backward () = let kf = Globals.Functions.find_by_name (Kernel.MainFunction.get()) in if Data_for_aorai.isIgnoredFunction (Kernel_function.get_name kf) then Aorai_option.abort "Main function %a is ignored by Aorai" Kernel_function.pretty kf; let final_state = Data_for_aorai.get_kf_return_state kf in let accepted_states = Data_for_aorai.Aorai_state.Map.fold (fun _ map acc -> Data_for_aorai.Aorai_state.Set.union (set_of_map map) acc) final_state Data_for_aorai.Aorai_state.Set.empty in ignore (backward_analysis_aux [] kf accepted_states); Pre_state.iter Data_for_aorai.replace_kf_init_state; Post_state.iter Data_for_aorai.replace_kf_return_state; Init_loop_state.iter Data_for_aorai.replace_loop_init_state; Invariant_loop_state.iter Data_for_aorai.replace_loop_invariant_state let compute () = compute_forward (); Aorai_option.debug ~dkey:forward_dkey "After forward analysis"; Data_for_aorai.debug_computed_state (); compute_backward (); Aorai_option.debug ~dkey:backward_dkey "After backward analysis"; Data_for_aorai.debug_computed_state ~dkey:backward_dkey(); (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/aorai_dataflow.mli0000666000000000000000000000364213571573400020242 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Compute the set of possible state at each function call and return. *) val compute: unit -> unit frama-c-20.0-Calcium/src/plugins/aorai/aorai_option.ml0000666000000000000000000001356413571573400017604 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "aorai" let shortname = "aorai" let help = "verification of behavioral properties (experimental)" end) module Ltl_File = Empty_string (struct let option_name = "-aorai-ltl" let arg_name = "" let help = "specifies file name for LTL property" end) module To_Buchi = Empty_string (struct let option_name = "-aorai-to-buchi" let arg_name = "f" let help = "only generates the buchi automata (in Promela language) in file " end) module Buchi = Empty_string (struct let option_name = "-aorai-buchi" let arg_name = "f" let help = "considers the property described by the buchi automata \ (in Promela language) from file ." end) module Ya = Empty_string (struct let option_name = "-aorai-automata" let arg_name = "f" let help = "considers the property described by the ya automata \ (in Ya language) from file ." end) module Output_Spec = False(struct let option_name = "-aorai-show-op-spec" let help = "displays computed pre and post-condition of each operation" end) module Output_C_File = Empty_string (struct let option_name = "-aorai-output-c-file" let arg_name = "" let help = "specifies generated file name for annotated C code" end) module Dot = False(struct let option_name = "-aorai-dot" let help = "generates a dot file of the Buchi automata" end) module DotSeparatedLabels = False(struct let option_name = "-aorai-dot-sep-labels" let help = "tells dot to not output guards directly over the edges" end) module AbstractInterpretation = False(struct let option_name = "-aorai-simple-AI" let help = "use simple abstract interpretation" end) module AbstractInterpretationOff = False(struct let option_name = "-aorai-AI-off" let help = "does not use abstract interpretation" end) let () = Parameter_customize.set_negative_option_name "-aorai-spec-off" module Axiomatization = True(struct let option_name = "-aorai-spec-on" let help = "if set, does not axiomatize automata" end) module ConsiderAcceptance = False(struct let option_name = "-aorai-acceptance" let help = "if set, considers acceptation states" end) let () = Parameter_customize.set_negative_option_name "-aorai-raw-auto" module AutomataSimplification= True (struct let option_name = "-aorai-simplified-auto" let help = "If set, does not simplify automata" end) module Test = Zero(struct let option_name = "-aorai-test" let arg_name = "" let help = "Testing mode (0 = no test)" end) module AddingOperationNameAndStatusInSpecification = False (struct let option_name = "-aorai-add-oper" let help = "Adding current operation name (and statut) in pre/post \ conditions" end) module Deterministic= State_builder.Ref (Datatype.Bool) (struct let name = "Aorai_option.Deterministic" let dependencies = [] let default () = false end) let is_on () = not (Ltl_File.is_default () && To_Buchi.is_default () && Buchi.is_default () && Ya.is_default () ) let promela_file () = if Buchi.get () = "" then To_Buchi.get () else Buchi.get () let advance_abstract_interpretation () = not (AbstractInterpretationOff.get ()) && not (AbstractInterpretation.get ()) let emitter = Emitter.create "Aorai" [ Emitter.Code_annot; Emitter.Funspec; Emitter.Global_annot ] ~correctness: [ Ltl_File.parameter; To_Buchi.parameter; Buchi.parameter; Ya.parameter; Axiomatization.parameter; ConsiderAcceptance.parameter; AutomataSimplification.parameter ] ~tuning: [ AbstractInterpretation.parameter; AddingOperationNameAndStatusInSpecification.parameter ] (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/aorai_option.mli0000666000000000000000000000550113571573400017745 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module Ltl_File: Parameter_sig.String module To_Buchi: Parameter_sig.String module Buchi: Parameter_sig.String module Ya: Parameter_sig.String module Output_Spec: Parameter_sig.Bool module Output_C_File: Parameter_sig.String module Dot: Parameter_sig.Bool module DotSeparatedLabels: Parameter_sig.Bool module AbstractInterpretation: Parameter_sig.Bool module Axiomatization: Parameter_sig.Bool module ConsiderAcceptance: Parameter_sig.Bool module AutomataSimplification: Parameter_sig.Bool module Test: Parameter_sig.Int module AddingOperationNameAndStatusInSpecification: Parameter_sig.Bool (** [true] if the user declares that its ya automaton is deterministic. *) module Deterministic: State_builder.Ref with type data = bool val is_on : unit -> bool val promela_file: unit -> string val advance_abstract_interpretation: unit -> bool val emitter: Emitter.t (** The emitter which emits Aorai annotations. @since Oxygen-20120901 *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/aorai_register.ml0000666000000000000000000003623413571573400020117 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Logic_ptree open Promelaast (* [VP] Need to get rid of those global references at some point. *) let promela_file = ref "" let ya_file = ref "" let c_file = ref "" let output_c_file = ref "" let ltl_tmp_file = ref "" let ltl_file = ref "" let dot_file = ref "" let generatesCFile = ref true let ltl2ba_params = " -l -p -o " let ltl_to_promela = Hashtbl.create 7 let set_ltl_correspondence h = Hashtbl.clear ltl_to_promela; Hashtbl.iter (fun x y -> Hashtbl.add ltl_to_promela x y) h let convert_ltl_exprs t = let rec convert_cond cond = match cond with POr(c1,c2) -> POr (convert_cond c1, convert_cond c2) | PAnd(c1,c2) -> PAnd(convert_cond c1, convert_cond c2) | PNot c -> PNot (convert_cond c) | PCall _ | PReturn _ | PTrue | PFalse -> cond | PRel(Neq,PVar x,PCst _) -> (try let (rel,t1,t2) = Hashtbl.find ltl_to_promela x in PRel(rel,t1,t2) with Not_found -> cond) | PRel _ -> cond in let rec convert_seq_elt e = { e with condition = Extlib.opt_map convert_cond e.condition; nested = convert_seq e.nested; } and convert_seq s = List.map convert_seq_elt s in let convert_parsed c = match c with Seq l -> Seq (convert_seq l) | Otherwise -> Otherwise in let convert_trans t = { t with cross = convert_parsed t.cross } in List.map convert_trans t (* Promela file *) let syntax_error loc msg = Aorai_option.abort "File %S, line %d, characters %d-%d:@\nSyntax error: %s" (Filepath.Normalized.to_pretty_string (Datatype.Filepath.of_string (fst loc).Lexing.pos_fname)) (fst loc).Lexing.pos_lnum ((fst loc).Lexing.pos_cnum - (fst loc).Lexing.pos_bol) ((snd loc).Lexing.pos_cnum - (fst loc).Lexing.pos_bol) msg let ltl_to_ltlLight f_ltl f_out = try let c = open_in f_ltl in let (ltl_form,exprs) = Ltllexer.parse c in close_in c; Ltl_output.output ltl_form f_out; set_ltl_correspondence exprs with | Not_found -> Aorai_option.abort "Unknown LTL file %s" f_ltl | Ltllexer.Error (loc,msg) -> syntax_error loc msg let load_ya_file f = try let c = open_in f in let automata = Yalexer.parse c in close_in c; Data_for_aorai.setAutomata automata; with | Not_found -> Aorai_option.abort "Unknown Ya file %s" f | Yalexer.Error (loc,msg) -> syntax_error loc msg let load_promela_file f = try let c = open_in f in let (s,t) = Promelalexer.parse c in let t = convert_ltl_exprs t in close_in c; Data_for_aorai.setAutomata (s,t); with | Not_found -> Aorai_option.abort "Unknown Promela file %s" f | Promelalexer.Error(loc,msg) -> syntax_error loc msg let load_promela_file_withexps f = try let c = open_in f in let automata = Promelalexer_withexps.parse c in close_in c; Data_for_aorai.setAutomata automata; with | Not_found -> Aorai_option.abort "Unknown Promela file %s" f | Promelalexer_withexps.Error(loc,msg) -> syntax_error loc msg let display_status () = if Aorai_option.verbose_atleast 2 then begin Aorai_option.feedback "\n" ; Aorai_option.feedback "C file: '%s'\n" !c_file ; Aorai_option.feedback "Entry point: '%a'\n" Kernel_function.pretty (fst (Globals.entry_point())) ; Aorai_option.feedback "LTL property: '%s'\n" !ltl_file ; Aorai_option.feedback "Files to generate: '%s' (Annotated code)\n" (if !generatesCFile then !output_c_file else "(none)"); if Aorai_option.Dot.get () then Aorai_option.feedback "Dot file: '%s'\n" !dot_file; Aorai_option.feedback "Tmp files: '%s' (Light LTL file)\n" !ltl_tmp_file ; Aorai_option.feedback " '%s' (Promela file)\n" !promela_file ; Aorai_option.feedback "\n" end let init_file_names () = (* Intermediate functions for error display or fresh name of file generation *) let err= ref false in let dispErr mesg f = Aorai_option.error "Error. File '%s' %s.\n" f mesg; err:=true in let freshname pre suf = let rec fn p s n = if not (Sys.file_exists (p^(string_of_int n)^s)) then (p^(string_of_int n)^s) else fn p s (n+1) in let name = if not (Sys.file_exists (pre^suf)) then pre^suf else fn pre suf 0 in name in (* c_file name is given and has to point out a valid file. *) c_file := (match Kernel.Files.get () with | [] -> "dummy.i" | f :: _ -> f); if (!c_file="") then dispErr ": invalid C file name" !c_file; if (not (Sys.file_exists !c_file)) then dispErr "not found" !c_file; (* The output C file has to be a valid file name if it is used. *) output_c_file := (Aorai_option.Output_C_File.get ()) ; if (!output_c_file="") then output_c_file:=freshname ((Filename.chop_extension !c_file)^"_annot") ".c"; (* else if Sys.file_exists !output_c_file then dispErr "already exists" !output_c_file; *) if Aorai_option.Dot.get () then dot_file:=freshname (Filename.chop_extension !c_file) ".dot"; if Aorai_option.Ya.get () = "" then if Aorai_option.Buchi.get () = "" then begin (* ltl_file name is given and has to point out a valid file. *) ltl_file := Aorai_option.Ltl_File.get (); if (!ltl_file="") then dispErr ": invalid LTL file name" !ltl_file; if (not (Sys.file_exists !ltl_file)) then dispErr "not found" !ltl_file; (* The LTL file is always used. *) (* The promela file can be given or not. *) if Aorai_option.To_Buchi.get () <> "" then begin ltl_tmp_file:= freshname (Filename.chop_extension (Aorai_option.promela_file ())) ".ltl"; promela_file:= Aorai_option.promela_file (); Extlib.cleanup_at_exit !ltl_tmp_file end else begin ltl_tmp_file:= (try Extlib.temp_file_cleanup_at_exit (Filename.basename !c_file) ".ltl" with Extlib.Temp_file_error s -> Aorai_option.abort "cannot create temporary file: %s" s); promela_file:= freshname (Filename.chop_extension !ltl_tmp_file) ".promela"; Extlib.cleanup_at_exit !promela_file; end end else begin if Aorai_option.To_Buchi.get () <> "" && Aorai_option.Ltl_File.get () <> "" then begin Aorai_option.error "Error. '-buchi' option is incompatible with '-to-buchi' and '-ltl' \ options."; err:=true end; (* The promela file is used only if the process does not terminate after LTL generation. *) promela_file := Aorai_option.promela_file (); end else begin ya_file := Aorai_option.Ya.get (); if (!ya_file="") then dispErr ": invalid Ya file name" !ya_file; if (not (Sys.file_exists !ya_file)) then dispErr "not found" !ya_file end; display_status (); !err let init_test () = match Aorai_option.Test.get () with | 1 -> generatesCFile := false; | _ -> generatesCFile := true let printverb s = Aorai_option.feedback ~level:2 "%s" s let output () = (* Dot file *) if (Aorai_option.Dot.get()) then begin Promelaoutput.output_dot_automata (Data_for_aorai.getAutomata ()) !dot_file; printverb "Generating dot file : done\n" end; (* C file *) if (not !generatesCFile) then printverb "C file generation : skipped\n" else begin let cout = open_out !output_c_file in let fmt = Format.formatter_of_out_channel cout in Kernel.Unicode.without_unicode (fun () -> File.pretty_ast ~fmt (); close_out cout; printverb "C file generation : done\n"; ) () end; printverb "Finished.\n"; (* Some test traces. *) Data_for_aorai.debug_computed_state (); if !generatesCFile then Kernel.Files.set [!output_c_file] let work () = let file = Ast.get () in Aorai_utils.initFile file; printverb "C file loading : done\n"; if Aorai_option.Ya.get () = "" then if Aorai_option.Buchi.get () = "" then begin ltl_to_ltlLight !ltl_file !ltl_tmp_file; printverb "LTL loading : done\n"; let cmd = Format.sprintf "ltl2ba %s -F %s > %s" ltl2ba_params !ltl_tmp_file !promela_file in if Sys.command cmd <> 0 then Aorai_option.abort "failed to run: %s" cmd ; printverb "LTL ~> Promela (ltl2ba): done\n" end; if Aorai_option.To_Buchi.get () <> "" then printverb ("Finished.\nGenerated file: '"^(!promela_file)^"'\n") else begin (* Step 3 : Loading promela_file and checking the consistency between informations from C code and LTL property *) (* Such as functions name and global variables. *) if Aorai_option.Buchi.get () <> "" then load_promela_file_withexps !promela_file else if Aorai_option.Ya.get () <> "" then load_ya_file !ya_file else load_promela_file !promela_file; printverb "Loading promela : done\n"; (* Computing the list of ignored functions *) (* Aorai_visitors.compute_ignored_functions file; *) (* Promelaoutput.print_raw_automata (Data_for_aorai.getAutomata()); *) (* Data_for_aorai.debug_ltl_expressions (); *) (*let _ = Path_analysis.test (Data_for_aorai.getAutomata())in*) let root = fst (Globals.entry_point ()) in if (Aorai_option.Axiomatization.get()) then begin (* Step 5 : incrementing pre/post conditions with states and transitions information *) printverb "Refining pre/post : \n"; Aorai_dataflow.compute (); (* Step 6 : Removing transitions never crossed *) let automaton_has_states = if (Aorai_option.AutomataSimplification.get()) then begin printverb "Removing unused trans : done\n"; try Data_for_aorai.removeUnusedTransitionsAndStates (); true with Data_for_aorai.Empty_automaton -> Aorai_option.warning "No state of the automaton is reachable. \ Program and specification are incompatible, \ instrumentation will not be generated."; false end else (printverb "Removing unused trans : skipped\n"; true) in if automaton_has_states then begin (* Step 7 : Labeling abstract file *) (* Finally the information is added into the Cil automata. *) Aorai_utils.initGlobals root (Aorai_option.Axiomatization.get()); Aorai_visitors.add_sync_with_buch file; Aorai_visitors.add_pre_post_from_buch file (Aorai_option.advance_abstract_interpretation ()); printverb "Annotation of Cil : done\n"; end end else begin (* Step 4': Computing the set of possible pre-states and post-states of each function *) (* And so for pre/post transitions *) printverb "Abstracting pre/post : skipped\n"; (* Step 5': incrementing pre/post conditions with states and transitions information *) printverb "Refining pre/post : skipped\n"; (* Step 6 : Removing transitions never crossed *) printverb "Removing unused trans : skipped\n"; (* Step 7 : Labeling abstract file *) (* Finally the information is added into the Cil automata. *) Aorai_utils.initGlobals root (Aorai_option.Axiomatization.get()); Aorai_visitors.add_sync_with_buch file; printverb "Annotation of Cil : partial\n" end; (* Step 8 : clearing tables whose information has been invalidated by our transformations. *) Cfg.clearFileCFG ~clear_id:false file; Cfg.computeFileCFG file; Ast.clear_last_decl (); if Kernel.Check.get() then Filecheck.check_ast "aorai"; let prj = File.create_project_from_visitor "aorai" (fun prj -> new Visitor.frama_c_copy prj) in Project.copy ~selection:(Parameter_state.get_selection ()) prj; Project.on prj output () end let run () = Aorai_option.result "Welcome to the Aorai plugin@."; init_test (); (* Step 1 : Capture files names *) let error_status = init_file_names () in (* Treatment is done only if parameters are valid *) if error_status then Aorai_option.error "Generation stopped." else (* Step 2 : Work in our own project, initialized by a copy of the main one. *) let work_prj = File.create_project_from_visitor ~last:false "aorai_tmp" (fun prj -> new Visitor.frama_c_copy prj) in Project.copy ~selection:(Parameter_state.get_selection ()) work_prj; Project.on work_prj work (); Project.remove ~project:work_prj () (* Plugin registration *) let run = Dynamic.register ~plugin:"Aorai" "run" (Datatype.func Datatype.unit Datatype.unit) ~journalize:true run let run, _ = State_builder.apply_once "Aorai" (let module O = Aorai_option in [ O.Ltl_File.self; O.To_Buchi.self; O.Buchi.self; O.Ya.self; O.Axiomatization.self; O.ConsiderAcceptance.self; O.AutomataSimplification.self; O.AbstractInterpretation.self; O.AddingOperationNameAndStatusInSpecification.self ]) run let main () = if Aorai_option.is_on () then run () let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/aorai_utils.ml0000666000000000000000000022165613571573400017437 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil open Logic_const open Logic_utils open Data_for_aorai open Cil_types open Cil_datatype open Promelaast open Bool3 let func_body_dkey = Aorai_option.register_category "func-body" let action_dkey = Aorai_option.register_category "action" let rename_pred v1 v2 p = let r = object inherit Visitor.frama_c_copy (Project.current()) method! vlogic_var_use v = if Cil_datatype.Logic_var.equal v v1 then Cil.ChangeTo v2 else Cil.JustCopy end in Visitor.visitFramacPredicate r p (** Given a transition a function name and a function status (call or return) it returns if the cross condition can be satisfied with only function status. *) let isCrossable tr func st = let rec isCross p = match p with | TOr (c1, c2) -> bool3or (isCross c1) (isCross c2) | TAnd (c1, c2) -> bool3and (isCross c1) (isCross c2) | TNot c1 -> bool3not (isCross c1) | TCall (kf,None) when Kernel_function.equal func kf && st=Call -> True | TCall (kf, Some _) when Kernel_function.equal func kf && st=Call -> Undefined | TCall _ -> False | TReturn kf when Kernel_function.equal func kf && st=Return -> True | TReturn _ -> False | TTrue -> True | TFalse -> False | TRel _ -> Undefined in let cond,_ = tr.cross in let res = isCross cond <> False in Aorai_option.debug ~level:2 "Function %a %s-state, \ transition %s -> %s is%s possible" Kernel_function.pretty func (if st=Call then "pre" else "post") tr.start.Promelaast.name tr.stop.Promelaast.name (if res then "" else " NOT"); res (** Returns the lval associated to the curState generated variable *) let state_lval () = Cil.var (get_varinfo curState) (* ************************************************************************* *) let find_enum, set_enum = let module H = State_builder.Int_hashtbl (Cil_datatype.Enumitem) (struct let name = "ltl_states_enum" let size = 17 let dependencies = (* TODO: projectify the automata and depend on it. *) [ Ast.self; Aorai_option.Ltl_File.self; Aorai_option.Buchi.self; Aorai_option.Ya.self ] end) in (fun n -> try H.find n with Not_found -> Aorai_option.fatal "Could not find the enum item corresponding to a state"), (List.iter (fun (n,item) -> H.add n item)) (* ************************************************************************* *) (** Given a transition a function name and a function status (call or return) it returns if the cross condition can be satisfied with only function status. *) let isCrossableAtInit tr func = (* When in doubt, return true anyway. More clever plug-ins will take care of analysing the instrumented code if needed. *) let eval_term_at_init t = if Kernel.LibEntry.get() then t else begin let bool_res test = if test then Cil.lconstant Integer.one else Cil.lzero () in let bool3_res dft test = match test with | True -> bool_res true | False -> bool_res false | Undefined -> dft in let is_true t = match t with | TConst(Integer(i,_)) -> Bool3.bool3_of_bool (not (Integer.is_zero i)) | TConst(LChr c) -> Bool3.bool3_of_bool (not (Char.code c <> 0)) | TConst(LReal r) -> Bool3.bool3_of_bool (not (r.r_nearest <> 0.)) | TConst(LStr _ | LWStr _) -> Bool3.True | _ -> Bool3.Undefined in let rec aux t = match t.term_node with | TConst (LEnum ei) -> aux (Logic_utils.expr_to_term ~cast:false ei.eival) | TLval lv -> (match aux_lv lv with | Some t -> t | None -> t) | TUnOp(op,t1) -> let t1 = aux t1 in (match op,t1.term_node with | Neg, TConst(Integer(i,_)) -> { t with term_node = TConst(Integer(Integer.neg i,None)) } | Neg, TConst(LReal r) -> let f = ~-. (r.r_nearest) in let r = { r_literal = string_of_float f ; r_nearest = f ; r_upper = ~-. (r.r_lower) ; r_lower = ~-. (r.r_upper) ; } in { t with term_node = TConst(LReal r) } | LNot, t1 -> bool3_res t (is_true t1) | _ -> t) | TBinOp(op,t1,t2) -> let t1 = aux t1 in let t2 = aux t2 in let rec comparison comp t1 t2 = match t1.term_node,t2.term_node with | TConst (Integer(i1,_)), TConst (Integer(i2,_)) -> bool_res (comp (Integer.compare i1 i2)) | TConst (LChr c1), TConst (LChr c2) -> bool_res (comp (Char.compare c1 c2)) | TConst(LReal r1), TConst (LReal r2) -> bool_res (comp (compare r1.r_nearest r2.r_nearest)) | TCastE(ty1,t1), TCastE(ty2,t2) when Cil_datatype.Typ.equal ty1 ty2 -> comparison comp t1 t2 | _ -> t in (match op, t1.term_node, t2.term_node with | PlusA, TConst(Integer(i1,_)), TConst(Integer(i2,_)) -> { t with term_node = TConst(Integer(Integer.add i1 i2,None))} | MinusA, TConst(Integer(i1,_)), TConst(Integer(i2,_)) -> { t with term_node = TConst(Integer(Integer.sub i1 i2,None)) } | Mult, TConst(Integer(i1,_)), TConst(Integer(i2,_)) -> { t with term_node = TConst(Integer(Integer.mul i1 i2,None)) } | Div, TConst(Integer(i1,_)), TConst(Integer(i2,_)) -> (try { t with term_node = TConst(Integer(Integer.c_div i1 i2,None)) } with Division_by_zero -> t) | Mod, TConst(Integer(i1,_)), TConst(Integer(i2,_)) -> (try { t with term_node = TConst(Integer(Integer.c_rem i1 i2,None)) } with Division_by_zero -> t) | Shiftlt, TConst(Integer(i1,_)), TConst(Integer(i2,_)) -> { t with term_node = TConst(Integer(Integer.shift_left i1 i2,None)) } | Shiftrt, TConst(Integer(i1,_)), TConst(Integer(i2,_)) -> { t with term_node = TConst(Integer(Integer.shift_right i1 i2,None)) } | Lt, _, _ -> comparison ((<) 0) t1 t2 | Gt, _, _ -> comparison ((>) 0) t1 t2 | Le, _, _ -> comparison ((<=) 0) t1 t2 | Ge, _, _ -> comparison ((>=) 0) t1 t2 | Eq, _, _ -> comparison ((=) 0) t1 t2 | Ne, _, _ -> comparison ((<>) 0) t1 t2 | LAnd, t1, t2 -> bool3_res t (Bool3.bool3and (is_true t1) (is_true t2)) | LOr, t1, t2 -> bool3_res t (Bool3.bool3or (is_true t1) (is_true t2)) | _ -> t) | TCastE(ty,t1) -> let t1 = aux t1 in (match t1.term_type with Ctype ty1 when Cil_datatype.Typ.equal ty ty1 -> t1 | _ -> { t with term_node = TCastE(ty,t1) }) | _ -> t and aux_lv (base,off) = match base with | TVar v -> (try Extlib.opt_bind (fun v -> let init = Globals.Vars.find v in let init = match init.Cil_types.init with None -> Cil.makeZeroInit ~loc:v.vdecl v.vtype | Some i -> i in aux_init off init) v.lv_origin with Not_found -> None) | TMem t -> (match (aux t).term_node with | TAddrOf lv -> aux_lv (Logic_const.addTermOffsetLval off lv) | _ -> None) | TResult _ -> None and aux_init off initinfo = match off, initinfo with | TNoOffset, SingleInit e -> Some (aux (Logic_utils.expr_to_term ~cast:false e)) | TIndex(t,oth), CompoundInit (ct,initl) -> (match (aux t).term_node with | TConst(Integer(i1,_)) -> Cil.foldLeftCompound ~implicit:true ~doinit: (fun o i _ t -> match o with | Index({ enode = Const(CInt64(i2,_,_))},_) when Integer.equal i1 i2 -> aux_init oth i | _ -> t) ~ct ~initl ~acc:None | _ -> None) | TField(f1,oth), CompoundInit(ct,initl) -> Cil.foldLeftCompound ~implicit:true ~doinit: (fun o i _ t -> match o with | Field(f2,_) when Cil_datatype.Fieldinfo.equal f1 f2 -> aux_init oth i | _ -> t) ~ct ~initl ~acc:None | _ -> None in aux t end in let eval_rel_at_init rel t1 t2 = let t1 = eval_term_at_init (Cil.constFoldTerm true t1) in let t2 = eval_term_at_init (Cil.constFoldTerm true t2) in let comp = match rel with | Req -> ((=) 0) | Rneq -> ((<>) 0) | Rge -> ((>=) 0) | Rgt -> ((>) 0) | Rle -> ((<=) 0) | Rlt -> ((<) 0) in let rec comparison t1 t2 = match t1.term_node,t2.term_node with | TConst (Integer(i1,_)), TConst (Integer(i2,_)) -> Bool3.bool3_of_bool (comp (Integer.compare i1 i2)) | TConst (LChr c1), TConst (LChr c2) -> Bool3.bool3_of_bool (comp (Char.compare c1 c2)) | TConst(LReal r1), TConst (LReal r2) -> Bool3.bool3_of_bool (comp (compare r1.r_nearest r2.r_nearest)) | TCastE(ty1,t1), TCastE(ty2,t2) when Cil_datatype.Typ.equal ty1 ty2 -> comparison t1 t2 | _ -> Bool3.Undefined in comparison t1 t2 in let rec isCross = function | TOr (c1, c2) -> Bool3.bool3or (isCross c1) (isCross c2) | TAnd (c1, c2) -> Bool3.bool3and (isCross c1) (isCross c2) | TNot (c1) -> Bool3.bool3not (isCross c1) | TCall (s,None) -> Bool3.bool3_of_bool (Kernel_function.equal s func) | TCall (s, Some _) when Kernel_function.equal s func -> Undefined | TCall _ -> Bool3.False | TReturn _ -> Bool3.False | TTrue -> Bool3.True | TFalse -> Bool3.False | TRel(rel,t1,t2) -> eval_rel_at_init rel t1 t2 in let (cond,_) = tr.cross in match isCross cond with | Bool3.True | Bool3.Undefined -> true | Bool3.False -> false (* ************************************************************************* *) (** {b Expressions management} *) (** Returns an int constant expression which represents the given int value. *) let mk_int_exp value = new_exp ~loc:Cil_datatype.Location.unknown (Const(CInt64(Integer.of_int value,IInt,Some(string_of_int value)))) (** This function rewrites a cross condition into an ACSL expression. Moreover, by giving current operation name and its status (call or return) the generation simplifies the generated expression. *) let crosscond_to_pred cross curr_f curr_status = let check_current_event f status pred = if Kernel_function.equal curr_f f && curr_status = status then pred else (Bool3.False, pfalse) in let rec convert = function (* Lazy evaluation of logic operators if the result can be statically computed *) | TOr (c1, c2) -> (*BinOp(LOr,convert c1,convert c2,Cil.intType)*) begin let (c1_val,c1_pred) = convert c1 in match c1_val with | Bool3.True -> (c1_val,c1_pred) | Bool3.False -> convert c2 | Undefined -> let (c2_val,c2_pred) = convert c2 in match c2_val with | Bool3.True -> (c2_val,c2_pred) | Bool3.False -> (c1_val,c1_pred) | Undefined -> (Undefined,Logic_const.por(c1_pred, c2_pred)) end | TAnd (c1, c2) -> (*BinOp(LAnd,convert c1,convert c2,Cil.intType)*) begin let (c1_val,c1_pred) = convert c1 in match c1_val with | Bool3.True -> convert c2 | Bool3.False -> (c1_val,c1_pred) | Undefined -> let (c2_val,c2_pred) = convert c2 in match c2_val with | Bool3.True -> (c1_val,c1_pred) | Bool3.False -> (c2_val,c2_pred) | Undefined -> (Undefined,Logic_const.pand(c1_pred, c2_pred)) end | TNot (c1) -> (*UnOp(LNot,convert c1,Cil.intType)*) begin let (c1_val,c1_pred) = convert c1 in match c1_val with | Bool3.True -> (Bool3.False,pfalse) | Bool3.False -> (Bool3.True,ptrue) | Undefined -> (c1_val,Logic_const.pnot(c1_pred)) end | TCall (f,b) -> let pred = match b with None -> Bool3.True, ptrue | Some b -> (Bool3.Undefined, Logic_const.pands (List.map Logic_const.pred_of_id_pred b.b_assumes)) in check_current_event f Promelaast.Call pred | TReturn f -> check_current_event f Promelaast.Return (Bool3.True, ptrue) (* Other expressions are left unchanged *) | TTrue -> (Bool3.True, ptrue) | TFalse -> (Bool3.False, pfalse) | TRel(rel,t1,t2) -> (Bool3.Undefined, Logic_const.prel (rel,t1,t2)) in snd (convert cross) (* Translate a term into the correct expression at the location in argument. Be careful if you wish to re-use this function elsewhere, some cases are not treated generically. Used in crosscond_to_exp. *) let rec term_to_exp t res = let loc = t.term_loc in match t.term_node with | TConst (Integer (value,repr)) -> Cil.kinteger64 ~loc ?repr value | TConst (LStr str) -> new_exp loc (Const (CStr str)) | TConst (LWStr l) -> new_exp loc (Const (CWStr l)) | TConst (LChr c) -> new_exp loc (Const (CChr c)) | TConst (LReal l_real) -> (* r_nearest is by definition in double precision. *) new_exp loc (Const (CReal (l_real.r_nearest, FDouble, None))) | TConst (LEnum e) -> new_exp loc (Const (CEnum e)) | TLval tlval -> new_exp loc (Lval (tlval_to_lval tlval res)) | TSizeOf ty -> new_exp loc (SizeOf ty) | TSizeOfE t -> new_exp loc (SizeOfE(term_to_exp t res)) | TSizeOfStr s -> new_exp loc (SizeOfStr s) | TAlignOf ty -> new_exp loc (AlignOf ty) | TAlignOfE t -> new_exp loc (AlignOfE (term_to_exp t res)) | TUnOp (unop, t) -> new_exp loc (UnOp (unop, term_to_exp t res, Cil.intType)) | TBinOp (binop, t1, t2)-> new_exp loc (BinOp(binop, term_to_exp t1 res, term_to_exp t2 res, Cil.intType)) | TCastE (ty, t) -> new_exp loc (CastE (ty, term_to_exp t res)) | TAddrOf tlval -> new_exp loc (AddrOf (tlval_to_lval tlval res)) | TStartOf tlval -> new_exp loc (StartOf (tlval_to_lval tlval res)) | TLogic_coerce (_,t) -> term_to_exp t res | _ -> Aorai_option.fatal "Term %a cannot be transformed into exp." Printer.pp_term t and tlval_to_lval (tlhost, toffset) res = let rec t_to_loffset t_offset = match t_offset with TNoOffset -> NoOffset | TField (f_i,t_off) -> Field(f_i, t_to_loffset t_off) | TIndex (t, t_off) -> Index (term_to_exp t res, t_to_loffset t_off) | TModel _ -> Aorai_option.fatal "TModel cannot be treated as exp." in match tlhost with | TVar l_var -> let v_info = begin match l_var.lv_origin with | Some vinfo -> vinfo | None -> Aorai_option.fatal "TVar not coming from a C Variable" end in (Var v_info, t_to_loffset toffset) |TMem t -> mkMem (term_to_exp t res) (t_to_loffset toffset) |TResult _ -> (match res with | Some res -> Var res, t_to_loffset toffset (* This should not happen, as we always pass a real variable when generating body for a post-function when the original function has a non-void result. pre-functions and functions that return void should not see \result. *) | None -> Aorai_option.fatal "Unexpected \\result") (* Translate the cross condition of an automaton edge to an expression. Used in mk_stmt. *) let crosscond_to_exp curr_f curr_status loc (cond,_) res = let check_current_event f status = if Kernel_function.equal curr_f f && curr_status = status then Cil.one loc else Cil.zero loc in let rel_convert = function | Rlt -> Lt | Rgt -> Gt | Rle -> Le | Rge -> Ge | Req -> Eq | Rneq -> Ne in let rec expnode_convert = function | TOr (c1, c2) -> let e1 = expnode_convert c1 in (match Cil.isInteger e1 with | None -> Cil.mkBinOp loc LOr e1 (expnode_convert c2) | Some i when Integer.is_zero i -> expnode_convert c2 | Some _ -> e1) | TAnd (c1, c2) -> let e1 = expnode_convert c1 in (match Cil.isInteger e1 with | None -> Cil.mkBinOp loc LAnd e1 (expnode_convert c2) | Some i when Integer.is_zero i -> e1 | Some _ -> expnode_convert c2) | TNot (c1) -> let e1 = expnode_convert c1 in (match Cil.isInteger e1 with | None -> Cil.new_exp loc (UnOp(LNot, e1,Cil.intType)) | Some i when Integer.is_zero i -> Cil.one loc | Some _ -> Cil.zero loc) | TCall (f,_) -> check_current_event f Promelaast.Call | TReturn f -> check_current_event f Promelaast.Return | TTrue -> (Cil.one loc) | TFalse -> (Cil.zero loc) | TRel(rel,t1,t2) -> Cil.mkBinOp loc (rel_convert rel) (term_to_exp t1 res) (term_to_exp t2 res) in expnode_convert cond (* ************************************************************************* *) (** {b Globals management} *) (** Local copy of the file pointer *) let file = ref Cil.dummyFile (** Copy the file pointer locally in the class in order to ease globals management and initializes some tables. *) let initFile f = file := f; Data_for_aorai.setCData (); (* Adding C variables into our hashtable *) Globals.Vars.iter (fun vi _ -> set_varinfo vi.vname vi); Globals.Functions.iter (fun kf -> let fname = Kernel_function.get_name kf in List.iter (fun vi -> set_paraminfo fname vi.vname vi) (Kernel_function.get_formals kf); if not (Data_for_aorai.isIgnoredFunction fname) then begin try let ret = Kernel_function.find_return kf in match ret.skind with | Cil_types.Return (Some e,_) -> (match e.enode with | Lval (Var vi,NoOffset) -> set_returninfo fname vi (* Add the vi of return stmt *) | _ -> () (* function without returned value *)) | _ -> () (* function without returned value *) with Kernel_function.No_Statement -> Aorai_option.fatal "Don't know what to do with a function declaration" end) (** List of globals awaiting for adding into C file globals *) let globals_queue = ref [] (** Flush all queued globals declarations into C file globals. *) let flush_globals () = let before, after = List.fold_left (fun (b,a) elem -> match elem with | GFun(f,loc) as func -> (* [VP] if address of function is taken, it might be used in a global initializer: keep a declaration at this point to ensure ending up with a compilable C file in the end... *) let b = if f.svar.vaddrof then GFunDecl(Cil.empty_funspec(),f.svar,loc) :: b else b in b, func :: a | other -> other :: b, a) ([], []) !file.globals in !file.globals <- List.rev before @ List.rev !globals_queue @ List.rev after; Kernel_function.clear_sid_info (); globals_queue := [] let mk_global glob = globals_queue := glob :: !globals_queue (* Utilities for global variables *) let mk_global_c_initialized_vars name ty ini= let vi = (Cil.makeGlobalVar name ty) in vi.vghost<-true; mk_global (GVar(vi,ini,vi.vdecl)); Globals.Vars.add vi ini; set_varinfo name vi let mk_global_var_init vi ini = vi.vghost<-true; mk_global (GVar(vi,ini,vi.vdecl)); Globals.Vars.add vi ini; set_varinfo vi.vname vi let mk_global_var vi = let ini = {Cil_types.init=Some(Cil.makeZeroInit ~loc:(CurrentLoc.get()) vi.vtype)} in mk_global_var_init vi ini let mk_global_c_var_init name init = let ty = Cil.typeOf init in let vi = Cil.makeGlobalVar name ty in vi.vghost <- true; let ini = { Cil_types.init = Some(SingleInit init) } in mk_global(GVar(vi,ini,vi.vdecl)); Globals.Vars.add vi ini; set_varinfo name vi let mk_int_const value = new_exp ~loc:(CurrentLoc.get()) (Const( CInt64( Integer.of_int (value), IInt, Some(string_of_int(value)) ))) (* Utilities for global enumerations *) let mk_global_c_enum_type_tagged name elements_l = let einfo = { eorig_name = name; ename = name; eitems = []; eattr = []; ereferenced = true; ekind = IInt; } in let l = List.map (fun (e,i) -> { eiorig_name = e; einame = e; eival = mk_int_const i; eiloc = Location.unknown; eihost = einfo}) elements_l in einfo.eitems <- l; set_usedinfo name einfo; mk_global (GEnumTag(einfo, Location.unknown)); einfo let mk_global_c_enum_type name elements = let _,elements = List.fold_left (fun (i,l) x -> (i+1,(x,i)::l)) (0,[]) elements in (* no need to rev the list, as the elements got their value already *) ignore (mk_global_c_enum_type_tagged name elements) let mk_global_c_initialized_enum name name_enuminfo ini = mk_global_c_initialized_vars name (TEnum(get_usedinfo name_enuminfo,[])) ini (* ************************************************************************* *) (** {b Terms management / computation} *) (** Return an integer constant term from the given value. *) let mk_int_term value = Cil.lconstant (Integer.of_int value) (** Return an integer constant term with the 0 value. @deprecated use directly Cil.lzero *) let zero_term() = Cil.lzero () let one_term () = Cil.lconstant Integer.one (** Returns a term representing the variable associated to the given varinfo *) let mk_term_from_vi vi = Logic_const.term (TLval((Logic_utils.lval_to_term_lval ~cast:true (Cil.var vi)))) (Ctype Cil.intType) (** Given an lval term 'host' and an integer value 'off', it returns a lval term host[off]. *) let mk_offseted_array host off = Logic_const.term (TLval(Logic_const.addTermOffsetLval (TIndex(mk_int_term (off),TNoOffset)) host)) (Ctype Cil.intType) let int2enumstate nums = let enum = find_enum nums in Logic_const.term (TConst (LEnum enum)) (Ctype (TEnum (enum.eihost,[]))) let int2enumstate_exp loc nums = new_exp loc (Const (CEnum (find_enum nums))) (** Given an lval term 'host' and an integer value 'off', it returns a lval term host[off]. *) let mk_offseted_array_states_as_enum host off = let enum = find_enum off in Logic_const.term (TLval (Logic_const.addTermOffsetLval (TIndex(Logic_const.term (TConst(LEnum enum)) (Ctype (TEnum (enum.eihost,[]))), TNoOffset)) host)) (Ctype Cil.intType) (** Returns a lval term associated to the curState generated variable. *) let host_state_term() = lval_to_term_lval ~cast:true (state_lval()) (* (** Returns a lval term associated to the curStateOld generated variable. *) let host_stateOld_term () = lval_to_term_lval ~cast:true (Cil.var (get_varinfo curStateOld)) (** Returns a lval term associated to the curTrans generated variable. *) let host_trans_term () = lval_to_term_lval ~cast:true (Cil.var (get_varinfo curTrans)) *) let state_term () = Logic_const.tvar (Cil.cvar_to_lvar (get_varinfo curState)) (* let stateOld_term () = Logic_const.tvar (Cil.cvar_to_lvar (get_varinfo curStateOld)) let trans_term () = Logic_const.tvar (Cil.cvar_to_lvar (get_varinfo curTrans)) *) (* Utilities for generation of predicates / statements / expression describing states' status. *) let is_state_pred state = if Aorai_option.Deterministic.get () then Logic_const.prel (Req,state_term(),int2enumstate state.nums) else Logic_const.prel (Req,one_term(), Logic_const.tvar (Data_for_aorai.get_state_logic_var state)) let is_state_stmt (state,copy) loc = if Aorai_option.Deterministic.get () then mkStmtOneInstr ~ghost:true (Set (Cil.var copy, int2enumstate_exp loc state.nums, loc)) else mkStmtOneInstr ~ghost:true (Set (Cil.var copy, Cil.one loc, loc)) let is_state_exp state loc = if Aorai_option.Deterministic.get () then Cil.mkBinOp loc Eq (int2enumstate_exp loc state.nums) (Cil.evar ~loc (Data_for_aorai.get_varinfo curState)) else Cil.mkBinOp loc Eq (Cil.evar (Data_for_aorai.get_state_var state)) (Cil.one loc) let is_out_of_state_pred state = if Aorai_option.Deterministic.get () then Logic_const.prel (Rneq,state_term(),int2enumstate state.nums) else Logic_const.prel (Req,zero_term(), Logic_const.tvar (Data_for_aorai.get_state_logic_var state)) (* In the deterministic case, we only assign the unique state variable to a specific enumerated constant. Non-deterministic automata on the other hand, need to have the corresponding state variable explicitly set to 0. *) let is_out_of_state_stmt (_,copy) loc = if Aorai_option.Deterministic.get () then Aorai_option.fatal "Deterministic automaton sync functions can't have out-of-state stmt. \ Maybe this should use `is_out_of_state_exp' instead." else mkStmtOneInstr ~ghost:true (Set(Cil.var copy , mk_int_exp 0 , loc )) let is_out_of_state_exp state loc = if Aorai_option.Deterministic.get () then Cil.mkBinOp loc Ne (int2enumstate_exp loc state.nums) (evar ~loc (Data_for_aorai.get_varinfo curState)) else Cil.mkBinOp loc Eq (Cil.evar (Data_for_aorai.get_state_var state)) (mk_int_exp 0) (* Utilities for other globals *) let mk_global_comment txt = mk_global (GText (txt)) (* ************************************************************************* *) (** {b Initialization management / computation} *) let mk_global_states_init root = let (states,_ as auto) = Data_for_aorai.getAutomata () in let states = List.sort Data_for_aorai.Aorai_state.compare states in let is_possible_init state = state.Promelaast.init = Bool3.True && (let trans = Path_analysis.get_transitions_of_state state auto in List.exists (fun tr -> isCrossableAtInit tr root) trans) in List.iter (fun state -> let init = if is_possible_init state then mk_int_exp 1 else mk_int_exp 0 in let init = SingleInit init in let var = Data_for_aorai.get_state_var state in mk_global_var_init var { Cil_types.init = Some init}) states let func_to_init name = {Cil_types.init= Some(SingleInit( new_exp ~loc:(CurrentLoc.get()) (Const(func_to_cenum (name)))))} let funcStatus_to_init st = {Cil_types.init=Some(SingleInit(new_exp ~loc:(CurrentLoc.get()) (Const(op_status_to_cenum (st)))))} class visit_decl_loops_init () = object(self) inherit Visitor.frama_c_inplace method! vstmt_aux stmt = begin match stmt.skind with | Loop _ -> let scope = Kernel_function.find_enclosing_block stmt in let f = Extlib.the self#current_func in let name = Data_for_aorai.loopInit ^ "_" ^ (string_of_int stmt.sid) in let typ = Cil.typeAddAttributes [Attr (Cil.frama_c_ghost_formal,[])] Cil.intType in let var = Cil.makeLocalVar ~ghost:true f ~scope name typ in Data_for_aorai.set_varinfo name var | _ -> () end; Cil.DoChildren end let mk_decl_loops_init () = let visitor = new visit_decl_loops_init () in Cil.visitCilFile (visitor :> Cil.cilVisitor) !file let change_vars subst subst_res kf label pred = let add_label t = ChangeDoChildrenPost(t,fun t -> tat(t,label)) in let visitor = object inherit Visitor.frama_c_copy (Project.current()) method! vterm t = match t.term_node with TLval (TVar { lv_origin = Some v},_) when v.vglob -> add_label t | TLval (TMem _,_) -> add_label t | _ -> DoChildren method! vterm_lhost = function | TResult ty -> (match kf with None -> Aorai_option.fatal "found \\result without being at a Return event" | Some kf -> (try ChangeTo (TVar (Kernel_function.Hashtbl.find subst_res kf)) with Not_found -> let new_lv = Cil_const.make_logic_var_quant ("__retres_" ^ (Kernel_function.get_name kf)) (Ctype ty) in Kernel_function.Hashtbl.add subst_res kf new_lv; ChangeTo (TVar new_lv))) | TMem _ | TVar _ -> DoChildren method! vlogic_var_use lv = match lv.lv_origin with | Some v when not v.vglob -> (try ChangeTo (Cil_datatype.Logic_var.Hashtbl.find subst lv) with Not_found -> let new_lv = Cil_const.make_logic_var_quant lv.lv_name lv.lv_type in Cil_datatype.Logic_var.Hashtbl.add subst lv new_lv; ChangeTo new_lv) | Some _ | None -> DoChildren end in Visitor.visitFramacPredicateNode visitor pred let pred_of_condition subst subst_res label cond = let mk_func_event f = let op = tat (mk_term_from_vi (get_varinfo curOp),label) in (* [VP] TODO: change int to appropriate enum type. Also true elsewhere. *) let f = term (TConst (constant_to_lconstant (func_to_cenum f))) (Ctype (func_enum_type ())) in prel (Req,op,f) in let mk_func_status f status = let curr = tat (mk_term_from_vi (get_varinfo curOpStatus),label) in let call = term (TConst (constant_to_lconstant (op_status_to_cenum status))) (Ctype (status_enum_type())) in Logic_const.pand (mk_func_event f, prel(Req,curr,call)) in let mk_func_start f = mk_func_status f Promelaast.Call in let mk_func_return f = mk_func_status f Promelaast.Return in let rec aux kf is_or = function | TOr(c1,c2) -> let kf, c1 = aux kf true c1 in let kf, c2 = aux kf true c2 in kf, Logic_const.por (c1, c2) | TAnd(c1,c2) -> let kf, c1 = aux kf false c1 in let kf, c2 = aux kf false c2 in kf, Logic_const.pand (c1, c2) | TNot c -> let kf, c = aux kf (not is_or) c in kf, Logic_const.pnot c | TCall (s,b) -> let pred = mk_func_start (Kernel_function.get_name s) in let pred = match b with | None -> pred | Some b -> Logic_const.pands (pred :: (List.map Logic_const.pred_of_id_pred b.b_assumes)) in kf, pred | TReturn s -> let kf = if is_or then kf else Some s in kf, mk_func_return (Kernel_function.get_name s) | TTrue -> kf, ptrue | TFalse -> kf, pfalse | TRel(rel,t1,t2) -> kf, unamed (change_vars subst subst_res kf label (prel (rel,t1,t2)).pred_content) in snd (aux None true cond) let mk_deterministic_lemma () = let automaton = Data_for_aorai.getAutomata () in let make_one_lemma state = let label = Cil_types.FormalLabel "L" in let disjoint_guards acc trans1 trans2 = if trans1.numt <= trans2.numt then acc (* don't need to repeat the same condition twice*) else let subst = Cil_datatype.Logic_var.Hashtbl.create 5 in let subst_res = Kernel_function.Hashtbl.create 5 in let guard1 = pred_of_condition subst subst_res label (fst trans1.cross) in let guard2 = pred_of_condition subst subst_res label (fst trans2.cross) in let pred = Logic_const.pnot (Logic_const.pand (guard1, guard2)) in let quants = Cil_datatype.Logic_var.Hashtbl.fold (fun _ lv acc -> lv :: acc) subst [] in let quants = Kernel_function.Hashtbl.fold (fun _ lv acc -> lv :: acc) subst_res quants in (* [VP] far from perfect, but should give oracles for regression tests that stay relatively stable across vid changes. *) let quants = List.sort (fun v1 v2 -> String.compare v1.lv_name v2.lv_name) quants in Logic_const.pand (acc, (pforall (quants, pred))) in let trans = Path_analysis.get_transitions_of_state state automaton in let prop = Extlib.product_fold disjoint_guards ptrue trans trans in let name = state.Promelaast.name ^ "_deterministic_trans" in let lemma = Dlemma (name, false, [label],[],prop,[],Cil_datatype.Location.unknown) in Annotations.add_global Aorai_option.emitter lemma in List.iter make_one_lemma (fst automaton) let make_enum_states () = let state_list =fst (Data_for_aorai.getAutomata()) in let state_list = List.map (fun x -> (x.Promelaast.name, x.Promelaast.nums)) state_list in let state_list = if not (Aorai_option.Deterministic.get ()) then state_list else (*[VP] Strictly speaking this is not needed, but Jessie tends to consider that a value of enum type can only be one of the tags, so that we must add this dummy state that is always a possible value, even when a contract concludes that curState is none of the others. Note that ISO C does not impose this limitation to values of enum types. *) (get_fresh "aorai_reject_state", -2)::state_list in let enum = mk_global_c_enum_type_tagged states state_list in let mapping = List.map (fun (name,id) -> let item = List.find (fun y -> y.einame = name) enum.eitems in (id, item)) state_list in set_enum mapping let getInitialState () = let loc = Cil_datatype.Location.unknown in let states = fst (Data_for_aorai.getAutomata()) in let s = List.find (fun x -> x.Promelaast.init = Bool3.True) states in Cil.new_exp ~loc (Const (CEnum (find_enum s.nums))) (** This function computes all newly introduced globals (variables, enumeration structure, invariants, etc. *) let initGlobals root complete = mk_global_comment "//****************"; mk_global_comment "//* BEGIN Primitives generated for LTL verification"; mk_global_comment "//* "; mk_global_comment "//* "; mk_global_comment "//* Some constants"; if Aorai_option.Deterministic.get () then make_enum_states (); (* non deterministic mode uses one variable for each possible state *) mk_global_c_enum_type listOp (List.map (fun e -> func_to_op_func e) (getFunctions_from_c() @ getIgnoredFunctions())); mk_global_c_initialized_enum curOp listOp (func_to_init (Kernel_function.get_name root)); mk_global_c_enum_type listStatus (callStatus::[termStatus]); mk_global_c_initialized_enum curOpStatus listStatus (funcStatus_to_init Promelaast.Call); mk_global_comment "//* "; mk_global_comment "//* States and Trans Variables"; if Aorai_option.Deterministic.get () then mk_global_c_var_init curState (getInitialState()) else mk_global_states_init root; if complete then begin mk_global_comment "//* "; mk_global_comment "//* Loops management"; mk_decl_loops_init (); end; mk_global_comment "//* "; mk_global_comment "//****************** "; mk_global_comment "//* Auxiliary variables used in transition conditions"; mk_global_comment "//*"; List.iter mk_global_var (Data_for_aorai.aux_variables()); if Aorai_option.Deterministic.get () then begin (* must flush now previous globals which are used in the lemmas in order to be able to put these last ones in the right places in the AST. *) flush_globals (); mk_deterministic_lemma (); end; (match Data_for_aorai.abstract_logic_info () with | [] -> () | l -> let annot = Daxiomatic ("Aorai_pebble_axiomatic", List.map (fun li -> Dfun_or_pred(li,Cil_datatype.Location.unknown)) l, [], Cil_datatype.Location.unknown) in Annotations.add_global Aorai_option.emitter annot); mk_global_comment "//* "; mk_global_comment "//* END Primitives generated for LTL verification"; mk_global_comment "//****************"; flush_globals () (* ************************************************************************* *) (** {b Pre/post management} *) let automaton_locations loc = let auto_state = if Aorai_option.Deterministic.get () then [ Logic_const.new_identified_term (state_term()), FromAny ] else List.map (fun state -> Logic_const.new_identified_term (Logic_const.tvar (Data_for_aorai.get_state_logic_var state)), FromAny) (fst (Data_for_aorai.getAutomata())) in (Logic_const.new_identified_term (Logic_const.tvar ~loc (Data_for_aorai.get_logic_var Data_for_aorai.curOpStatus)), FromAny) :: (Logic_const.new_identified_term (Logic_const.tvar ~loc (Data_for_aorai.get_logic_var Data_for_aorai.curOp)), FromAny) :: auto_state let automaton_assigns loc = Writes (automaton_locations loc) let aorai_assigns state loc = let merged_states = Aorai_state.Map.fold (fun _ state acc -> Data_for_aorai.merge_end_state state acc) state Aorai_state.Map.empty in let bindings = Aorai_state.Map.fold (fun _ (_,_,b) acc -> Data_for_aorai.merge_bindings b acc) merged_states Cil_datatype.Term.Map.empty in let elements = Cil_datatype.Term.Map.fold (fun t _ acc -> (Logic_const.new_identified_term t,FromAny)::acc) bindings [] in Writes (automaton_locations loc @ elements) let action_assigns trans = let add_if_needed v lv (known_vars, assigns as acc) = if Cil_datatype.Varinfo.Set.mem v known_vars then acc else Cil_datatype.Varinfo.Set.add v known_vars, (Logic_const.new_identified_term lv, FromAny)::assigns in let treat_one_action acc = function | Counter_init (host,off) | Counter_incr (host,off) | Copy_value ((host,off),_) -> let my_var = match host with | TVar ({ lv_origin = Some v}) -> v | _ -> Aorai_option.fatal "Auxiliary variable is not a C global" in let my_off = match off with | TNoOffset -> TNoOffset | TIndex _ -> TIndex(Logic_const.trange (None,None), TNoOffset) | TField _ | TModel _ -> Aorai_option.fatal "Unexpected offset in auxiliary variable" in add_if_needed my_var (Logic_const.term (TLval(host,my_off)) (Cil.typeOfTermLval (host,my_off))) acc | Pebble_init(_,v,c) -> let cc = Extlib.the c.lv_origin in let cv = Extlib.the v.lv_origin in add_if_needed cv (Logic_const.tvar v) (add_if_needed cc (Logic_const.tvar c) acc) | Pebble_move(_,v1,_,v2) -> let cv1 = Extlib.the v1.lv_origin in let cv2 = Extlib.the v2.lv_origin in add_if_needed cv1 (Logic_const.tvar v1) (add_if_needed cv2 (Logic_const.tvar v2) acc) in let empty = (Cil_datatype.Varinfo.Set.empty,[]) in let empty_pebble = match trans.start.multi_state, trans.stop.multi_state with | Some(_,aux), None -> let caux = Extlib.the aux.lv_origin in add_if_needed caux (Logic_const.tvar aux) empty | _ -> empty in let _,res = List.fold_left treat_one_action empty_pebble (snd trans.cross) in Writes res let get_reachable_trans state st auto current_state = match st with | Promelaast.Call -> (try let reach = Data_for_aorai.Aorai_state.Map.find state current_state in let treat_one_state end_state _ l = Path_analysis.get_edges state end_state auto @ l in Data_for_aorai.Aorai_state.Map.fold treat_one_state reach [] with Not_found -> []) | Promelaast.Return -> let treat_one_state end_state (_,last,_) l = if Data_for_aorai.Aorai_state.Set.mem state last then Path_analysis.get_edges state end_state auto @ l else l in let treat_one_start _ map l = Data_for_aorai.Aorai_state.Map.fold treat_one_state map l in Data_for_aorai.Aorai_state.Map.fold treat_one_start current_state [] let get_reachable_trans_to state st auto current_state = match st with | Promelaast.Call -> let treat_one_start start map acc = if Data_for_aorai.Aorai_state.Map.mem state map then Path_analysis.get_edges start state auto @ acc else acc in Data_for_aorai.Aorai_state.Map.fold treat_one_start current_state [] | Promelaast.Return -> let treat_one_state _ map acc = try let (_,last,_) = Data_for_aorai.Aorai_state.Map.find state map in Data_for_aorai.Aorai_state.Set.fold (fun start acc -> Path_analysis.get_edges start state auto @ acc) last acc with Not_found -> acc in Data_for_aorai.Aorai_state.Map.fold treat_one_state current_state [] (* force that we have a crossable transition for each state in which the automaton might be at current event. *) let force_transition loc f st current_state = let (states, _ as auto) = Data_for_aorai.getAutomata () in (* We iterate aux on all the states, to get - the predicate indicating in which states the automaton cannot possibly be before the transition (because we can't fire a transition from there). - the predicate indicating in which states the automaton might be, outside of the reject state - a list of predicate indicating for each possible state which condition must hold to have at least one possible transition. *) let aux (impossible_states,possible_states,has_crossable_trans) state = let reachable_trans = get_reachable_trans state st auto current_state in (* we inspect each transition originating from state, and maintain the following information: - a typed condition indicating under which condition a transition can be crossed from the current state - a flag indicating whether a transition that does not lead to a reject state can be crossed. *) let add_one_trans (has_crossable_trans, crossable_non_reject) trans = let has_crossable_trans = Logic_simplification.tor has_crossable_trans (fst trans.cross) in let crossable_non_reject = crossable_non_reject || (isCrossable trans f st && not (Data_for_aorai.is_reject_state trans.stop)) in has_crossable_trans, crossable_non_reject in let cond, crossable_non_reject = List.fold_left add_one_trans (Promelaast.TFalse, false) reachable_trans in let cond = fst (Logic_simplification.simplifyCond cond) in let cond = crosscond_to_pred cond f st in let start = is_state_pred state in if Logic_utils.is_trivially_false cond then begin (* no transition can be crossed. *) let not_start = is_out_of_state_pred state in Logic_const.pand ~loc (impossible_states,not_start), possible_states, has_crossable_trans end else begin (* we may cross a transition. Now check whether we have some condition to check for that. *) let has_crossable_trans = if Logic_utils.is_trivially_true cond then has_crossable_trans else Logic_const.new_predicate (pimplies ~loc (start,cond)) :: has_crossable_trans in let possible_states = (* reject_state must not be the only possible state *) match st with | Promelaast.Return -> if Data_for_aorai.is_reject_state state then possible_states else Logic_const.por ~loc (possible_states,start) | Promelaast.Call -> if crossable_non_reject then Logic_const.por ~loc (possible_states, start) else possible_states in impossible_states, possible_states, has_crossable_trans end in let impossible_states, possible_states, crossable_trans = List.fold_left aux (ptrue, pfalse,[]) states in let states = if Aorai_option.Deterministic.get() then possible_states (* We're always in exactly one state, among the possible ones, no need to list the impossible ones. *) else (* requires that the cells for impossible states be '0' *) Logic_const.pand ~loc (possible_states, impossible_states) in Logic_const.new_predicate states :: (List.rev crossable_trans) let partition_action trans = let add_state t st map = let old = try Cil_datatype.Term_lval.Map.find t map with Not_found -> Data_for_aorai.Aorai_state.Set.empty in let new_set = Data_for_aorai.Aorai_state.Set.add st old in Cil_datatype.Term_lval.Map.add t new_set map in let treat_one_action st acc = function | Counter_init t | Counter_incr t | Copy_value (t,_) -> add_state t st acc | Pebble_init _ | Pebble_move _ -> acc (* moving pebbles can occur at the same time (but not for same pebbles) *) in let treat_one_trans acc tr = List.fold_left (treat_one_action tr.start) acc (snd tr.cross) in List.fold_left treat_one_trans Cil_datatype.Term_lval.Map.empty trans (* TODO: this must be refined to take pebbles into account: in that case, disjointedness condition is on pebble set for each state. *) let disjoint_states loc _ states precond = let states = Data_for_aorai.Aorai_state.Set.elements states in let rec product acc l = match l with | [] -> acc | hd::tl -> let pairs = List.map (fun x -> (hd,x)) tl in product (pairs @ acc) tl in let disjoint = product [] states in List.fold_left (fun acc (st1, st2) -> Logic_const.new_predicate (Logic_const.por ~loc (is_out_of_state_pred st1,is_out_of_state_pred st2)) :: acc) precond disjoint (* forces that parent states of a state with action are mutually exclusive, at least at pebble level. *) let incompatible_states loc st current_state = let (states,_ as auto) = Data_for_aorai.getAutomata () in let aux precond state = let trans = get_reachable_trans_to state st auto current_state in let actions = partition_action trans in Cil_datatype.Term_lval.Map.fold (disjoint_states loc) actions precond in List.fold_left aux [] states let auto_func_preconditions loc f st current_state = force_transition loc f st current_state @ incompatible_states loc st current_state let find_pebble_origin lab actions = let rec aux = function | [] -> Aorai_option.fatal "Transition to multi-state has no pebble action" | Pebble_init (_,_,count) :: _ -> Logic_const.term (TLval (TVar count, TNoOffset)) (Logic_const.make_set_type count.lv_type) | Pebble_move (_,_,set,_) :: _-> Data_for_aorai.pebble_set_at set lab | _ :: tl -> aux tl in aux actions let mk_sub ~loc pebble_set v = let sub = List.hd (Logic_env.find_all_logic_functions "\\subset") in Logic_const.papp ~loc (sub,[], [Logic_const.term ~loc (TLval (TVar v,TNoOffset)) pebble_set.term_type; pebble_set]) let pebble_guard ~loc pebble_set aux_var guard = let v = Cil_const.make_logic_var_quant aux_var.lv_name aux_var.lv_type in let g = rename_pred aux_var v guard in let g = Logic_const.pand ~loc (mk_sub ~loc pebble_set v, g) in Logic_const.pexists ~loc ([v], g) let pebble_guard_neg ~loc pebble_set aux_var guard = let v = Cil_const.make_logic_var_quant aux_var.lv_name aux_var.lv_type in let g = rename_pred aux_var v guard in let g = Logic_const.pimplies ~loc (mk_sub ~loc pebble_set v, Logic_const.pnot ~loc g) in Logic_const.pforall ~loc ([v], g) let pebble_post ~loc pebble_set aux_var guard = let v = Cil_const.make_logic_var_quant aux_var.lv_name aux_var.lv_type in let g = rename_pred aux_var v guard in let g = Logic_const.pimplies ~loc (mk_sub ~loc pebble_set v, g) in Logic_const.pforall ~loc ([v], g) (* behavior is the list of all behaviors related to the given state, trans the list of potentially active transitions ending in this state. If the state is a multi-state, we have one behavior whose assumes is the disjunction of these assumes *) let add_behavior_pebble_actions ~loc f st behaviors state trans = match state.multi_state with | None -> behaviors | Some (set,aux) -> let name = Printf.sprintf "pebble_%s" state.name in let assumes = List.fold_left (fun acc b -> let assumes = List.map pred_of_id_pred b.b_assumes in Logic_const.por ~loc (acc, Logic_const.pands assumes)) pfalse behaviors in let assumes = [ Logic_const.new_predicate assumes ] in let set = Data_for_aorai.pebble_set_at set Logic_const.here_label in let treat_action guard res action = match action with | Copy_value _ | Counter_incr _ | Counter_init _ -> res | Pebble_init (_,_,v) -> let a = Cil_const.make_logic_var_quant aux.lv_name aux.lv_type in let guard = rename_pred aux a guard in let guard = Logic_const.pand ~loc (Logic_const.prel ~loc (Req,Logic_const.tvar a,Logic_const.tvar v), guard) in Logic_const.term ~loc (Tcomprehension (Logic_const.tvar a,[a], Some guard)) set.term_type :: res | Pebble_move(_,_,s1,_) -> let a = Cil_const.make_logic_var_quant aux.lv_name aux.lv_type in let guard = rename_pred aux a guard in let in_s = mk_sub ~loc (Data_for_aorai.pebble_set_at s1 Logic_const.pre_label) a in let guard = Logic_const.pand ~loc (in_s,guard) in Logic_const.term ~loc (Tcomprehension (Logic_const.tvar a,[a], Some guard)) set.term_type :: res in let treat_one_trans acc tr = let guard = crosscond_to_pred (fst tr.cross) f st in let guard = Logic_const.pold guard in List.fold_left (treat_action guard) acc (snd tr.cross) in let res = List.fold_left treat_one_trans [] trans in let res = Logic_const.term (Tunion res) set.term_type in let post_cond = [ Normal, Logic_const.new_predicate (Logic_const.prel (Req,set,res))] in Cil.mk_behavior ~name ~assumes ~post_cond () :: behaviors let mk_action ~loc a = let term_lval lv = Logic_const.term ~loc (TLval lv) (Cil.typeOfTermLval lv) in match a with | Counter_init lv -> [Logic_const.prel ~loc (Req, term_lval lv, Logic_const.tinteger ~loc 1)] | Counter_incr lv -> [Logic_const.prel ~loc (Req, term_lval lv, Logic_const.term ~loc (TBinOp (PlusA, Logic_const.told ~loc (term_lval lv), Logic_const.tinteger ~loc 1)) (Cil.typeOfTermLval lv))] | Pebble_init _ | Pebble_move _ -> [] (* Treated elsewhere *) | Copy_value (lv,t) -> [Logic_const.prel ~loc (Req, term_lval lv, Logic_const.told t)] let is_reachable state status = let treat_one_state _ map = Data_for_aorai.Aorai_state.Map.mem state map in Data_for_aorai.Aorai_state.Map.exists treat_one_state status let concat_assigns a1 a2 = match a1,a2 with | WritesAny, _ -> a2 | _, WritesAny -> a1 | Writes l1, Writes l2 -> Writes (List.fold_left (fun acc (loc,_ as elt) -> if List.exists (fun (x,_) -> Cil_datatype.Term.equal x.it_content loc.it_content) l2 then acc else elt :: acc) l2 l1) let get_accessible_transitions auto state status = let treat_one_state curr_state (_,last,_) acc = if Data_for_aorai.Aorai_state.equal curr_state state then Data_for_aorai.Aorai_state.Set.union last acc else acc in let treat_start_state _ map acc = Data_for_aorai.Aorai_state.Map.fold treat_one_state map acc in let previous_set = Data_for_aorai.Aorai_state.Map.fold treat_start_state status Data_for_aorai.Aorai_state.Set.empty in Data_for_aorai.Aorai_state.Set.fold (fun s acc -> Path_analysis.get_edges s state auto @ acc) previous_set [] (* Assumes that we don't have a multi-state here. pebbles are handled elsewhere *) let mk_unchanged_aux_vars trans = let my_aux_vars = Cil_datatype.Term_lval.Set.empty in let add_one_action acc = function | Counter_init lv | Counter_incr lv | Copy_value (lv,_) -> Cil_datatype.Term_lval.Set.add lv acc | Pebble_init _ | Pebble_move _ -> acc in let add_one_trans acc tr = let (_,actions) = tr.cross in List.fold_left add_one_action acc actions in let my_aux_vars = List.fold_left add_one_trans my_aux_vars trans in let treat_lval lv acc = let t = Data_for_aorai.tlval lv in let ot = Logic_const.told t in let p = Logic_const.prel (Req,t,ot) in (Normal, Logic_const.new_predicate p) :: acc in Cil_datatype.Term_lval.Set.fold treat_lval my_aux_vars [] let mk_behavior ~loc auto kf e status state = Aorai_option.debug "analysis of state %s (%d)" state.Promelaast.name state.nums; if is_reachable state status then begin Aorai_option.debug "state %s is reachable" state.Promelaast.name; let my_trans = get_accessible_transitions auto state status in let rec treat_trans ((in_assumes, out_assumes, assigns, action_bhvs) as acc) l = match l with | [] -> acc | trans :: tl -> let consider, others = List.partition (fun x -> x.start.nums = trans.start.nums) tl in let start = is_state_pred trans.start in let not_start = is_out_of_state_pred trans.start in let in_guard, out_guard, assigns, my_action_bhvs = List.fold_left (fun (in_guard, out_guard, all_assigns, action_bhvs) trans -> Aorai_option.debug "examining transition %d" trans.numt; let (cond,actions) = trans.cross in Aorai_option.debug "transition %d is active" trans.numt; let guard = crosscond_to_pred cond kf e in let my_in_guard,my_out_guard = match state.multi_state with | None -> guard, Logic_const.pnot ~loc guard | Some (_,aux) -> let set = find_pebble_origin Logic_const.here_label actions in pebble_guard ~loc set aux guard, pebble_guard_neg ~loc set aux guard in let out_guard = Logic_const.pand ~loc (out_guard, my_out_guard) in let in_guard, all_assigns, action_bhvs = match actions with | [] -> (Logic_const.por ~loc (in_guard,my_in_guard), all_assigns, action_bhvs) | _ -> let name = Printf.sprintf "buch_state_%s_in_%d" state.name (List.length action_bhvs) in Aorai_option.debug "Name is %s" name; let assumes = [ Logic_const.new_predicate (Logic_const.pand ~loc (start,my_in_guard)) ] in let post_cond = Normal, Logic_const.new_predicate (is_state_pred state) in let treat_one_action acc a = let posts = mk_action ~loc a in match state.multi_state with | None -> acc @ List.map (fun x -> (Normal, Logic_const.new_predicate x)) posts | Some (_,aux) -> let set = find_pebble_origin Logic_const.pre_label actions in acc @ List.map (fun x -> (Normal, Logic_const.new_predicate (pebble_post ~loc set aux x))) posts in let post_cond = List.fold_left treat_one_action [post_cond] actions in let assigns = action_assigns trans in let all_assigns = concat_assigns assigns all_assigns in let bhv = Cil.mk_behavior ~name ~assumes ~post_cond () in in_guard, all_assigns, bhv :: action_bhvs in in_guard, out_guard, all_assigns, action_bhvs) (pfalse,ptrue,assigns, action_bhvs) (trans::consider) in treat_trans (Logic_const.por ~loc (in_assumes, (Logic_const.pand ~loc (start, in_guard))), Logic_const.pand ~loc (out_assumes, (Logic_const.por ~loc (not_start, out_guard))), assigns, my_action_bhvs ) others in let my_trans = List.filter (fun x -> isCrossable x kf e) my_trans in let in_assumes, out_assumes, assigns, action_behaviors = treat_trans (pfalse, ptrue, WritesAny, []) my_trans in let behaviors = if Logic_utils.is_trivially_false in_assumes then action_behaviors else begin let behavior_in = Cil.mk_behavior ~name:(Printf.sprintf "buch_state_%s_in" state.Promelaast.name) ~assumes:[Logic_const.new_predicate in_assumes] ~post_cond: [Normal, Logic_const.new_predicate (is_state_pred state)] () in behavior_in :: action_behaviors end in let behaviors = add_behavior_pebble_actions ~loc kf e behaviors state my_trans in let behaviors = if Logic_utils.is_trivially_false out_assumes then behaviors else begin let post_cond = match state.multi_state with | None -> mk_unchanged_aux_vars my_trans | Some (set,_) -> let set = Data_for_aorai.pebble_set_at set Logic_const.here_label in [Normal, Logic_const.new_predicate (Logic_const.prel ~loc (Req,set, Logic_const.term ~loc Tempty_set set.term_type))] in let post_cond = (Normal, (Logic_const.new_predicate (is_out_of_state_pred state))) :: post_cond in let behavior_out = Cil.mk_behavior ~name:(Printf.sprintf "buch_state_%s_out" state.Promelaast.name) ~assumes:[Logic_const.new_predicate out_assumes] ~post_cond () in behavior_out :: behaviors end in assigns, behaviors end else begin Aorai_option.debug "state %s is not reachable" state.Promelaast.name; (* We know that we'll never end up in this state. *) let name = Printf.sprintf "buch_state_%s_out" state.Promelaast.name in let post_cond = match state.multi_state with | None -> [] | Some (set,_) -> let set = Data_for_aorai.pebble_set_at set Logic_const.here_label in [Normal, Logic_const.new_predicate (Logic_const.prel ~loc (Req,set, Logic_const.term ~loc Tempty_set set.term_type))] in let post_cond = (Normal, Logic_const.new_predicate (is_out_of_state_pred state)) ::post_cond in WritesAny,[mk_behavior ~name ~post_cond ()] end let auto_func_behaviors loc f st state = let call_or_ret = match st with | Promelaast.Call -> "call" | Promelaast.Return -> "return" in Aorai_option.debug "func behavior for %a (%s)" Kernel_function.pretty f call_or_ret; let (states, _) as auto = Data_for_aorai.getAutomata() in (* requires is not needed for pre_func, as it is enforced by the requires of the original C function itself (and the call to pre_func by definition the first instruction of the function). *) let post_cond = let called_pre = Logic_const.new_predicate (Logic_const.prel ~loc (Req, Logic_const.tvar ~loc (Data_for_aorai.get_logic_var Data_for_aorai.curOpStatus), (Logic_const.term (TConst (constant_to_lconstant (Data_for_aorai.op_status_to_cenum st))) (Ctype Cil.intType)))) in let called_pre_2 = Logic_const.new_predicate (Logic_const.prel ~loc (Req, Logic_const.tvar ~loc (Data_for_aorai.get_logic_var Data_for_aorai.curOp), (Logic_const.term (TConst((constant_to_lconstant (Data_for_aorai.func_to_cenum (Kernel_function.get_name f))))) (Ctype Cil.intType)))) in (* let old_pred = Aorai_utils.mk_old_state_pred loc in *) [(Normal, called_pre); (Normal, called_pre_2)] in let requires = if st = Promelaast.Call then [] else auto_func_preconditions loc f st state in let mk_behavior (assigns, behaviors) status = let new_assigns, new_behaviors = mk_behavior ~loc auto f st state status in concat_assigns new_assigns assigns, new_behaviors @ behaviors in let assigns = automaton_assigns loc in let assigns, behaviors = (List.fold_left mk_behavior (assigns,[]) states) in let global_behavior = Cil.mk_behavior ~requires ~post_cond ~assigns () in (* Keep behaviors ordered according to the states they describe *) global_behavior :: (List.rev behaviors) let act_convert loc (_,act) res = let treat_one_act = function | Counter_init t_lval -> Cil.mkStmtOneInstr ~ghost:true (Set (tlval_to_lval t_lval res, Cil.one loc, loc)) | Counter_incr t_lval -> let my_lval = tlval_to_lval t_lval res in Cil.mkStmtOneInstr ~ghost:true (Set (my_lval, (Cil.mkBinOp loc PlusA (Cil.new_exp loc (Lval my_lval)) (Cil.one loc)), loc)) | Copy_value (t_lval, t) -> Cil.mkStmtOneInstr ~ghost:true (Set (tlval_to_lval t_lval res, term_to_exp t res, loc)) | _ -> Aorai_option.fatal "Peebles not treated yet." (* TODO : Treat peebles. *) in List.map treat_one_act act let copy_stmt s = let vis = new Visitor.frama_c_refresh (Project.current()) in Visitor.visitFramacStmt vis s (* mk_stmt loc (states, tr) f fst status state Generates the statement updating the variable representing the state argument. If state is reachable, generates a "If then else" statement, else it is just an assignment. Used in auto_func_block. *) let mk_stmt loc (states, tr) f fst status ((st,_) as state) res = if is_reachable st status then begin let useful_trans = get_accessible_transitions (states,tr) st status in let exp_from_trans,stmt_from_action = List.split (List.map (function trans -> (Cil.mkBinOp loc LAnd (is_state_exp trans.start loc) (crosscond_to_exp f fst loc trans.cross res)), (act_convert loc trans.cross res) ) useful_trans ) in let mkIfStmt exp1 block1 block2 = Cil.mkStmt ~ghost:true (If (exp1, block1, block2, loc)) in let if_cond = List.fold_left (fun acc exp -> Cil.mkBinOp loc LOr exp acc) (List.hd exp_from_trans) (List.tl exp_from_trans) in let then_stmt = is_state_stmt state loc in let else_stmt = if Aorai_option.Deterministic.get () then [] else [is_out_of_state_stmt state loc] in if Aorai_option.Deterministic.get () then List.fold_left2 (fun acc cond stmt_act -> [mkIfStmt cond (mkBlock (copy_stmt then_stmt :: stmt_act)) (mkBlock acc)]) else_stmt (List.rev exp_from_trans) (List.rev stmt_from_action) else List.fold_left2 (fun acc cond stmt_act -> if stmt_act = [] then acc else (mkIfStmt cond (mkBlock stmt_act) (mkBlock []))::acc) [mkIfStmt if_cond (mkBlock [then_stmt]) (mkBlock else_stmt)] (List.rev exp_from_trans) (List.rev stmt_from_action) end else if Aorai_option.Deterministic.get () then [] else [is_out_of_state_stmt state loc] let auto_func_block loc f st status res = let dkey = func_body_dkey in let call_or_ret = match st with | Promelaast.Call -> "call" | Promelaast.Return -> "return" in Aorai_option.debug ~dkey "func code for %a (%s)" Kernel_function.pretty f call_or_ret; let (states, _) as auto = Data_for_aorai.getAutomata() in (* For the following tests, we need a copy of every state. *) let copies, local_var = if Aorai_option.Deterministic.get () then begin let orig = Data_for_aorai.get_varinfo curState in let copy = Cil.copyVarinfo orig (orig.vname ^ "_tmp") in List.map (fun st -> (st, copy)) states, [copy] end else begin let bindings = List.map (fun st -> let state_var = Data_for_aorai.get_state_var st in (st,Cil.copyVarinfo state_var (state_var.vname ^ "_tmp") )) states in bindings, snd (List.split bindings) end in let equalsStmt lval exp = (* assignment *) Cil.mkStmtOneInstr ~ghost:true (Set (lval, exp, loc)) in let stmt_begin_list = [ (* First statement : what is the current status : called or return ? *) equalsStmt (Cil.var (Data_for_aorai.get_varinfo Data_for_aorai.curOpStatus)) (* current status... *) (Cil.new_exp loc (Const (Data_for_aorai.op_status_to_cenum st))); (* ... equals to what it is *) (* Second statement : what is the current operation, i.e. which function ? *) equalsStmt (Cil.var (Data_for_aorai.get_varinfo Data_for_aorai.curOp)) (* current operation ... *) (Cil.new_exp loc (Const (Data_for_aorai.func_to_cenum (Kernel_function.get_name f)))) (* ...equals to what it is *) ] in (* As we work on copies, they need to be set to their actual values *) let copies_update = if Aorai_option.Deterministic.get () then let orig = Data_for_aorai.get_varinfo curState in [ equalsStmt (Cil.var (List.hd local_var)) (Cil.evar ~loc orig) ] else List.map (fun (st,copy) -> equalsStmt (Cil.var copy) (Cil.evar ~loc (Data_for_aorai.get_state_var st))) copies in (* For each state, we have to generate the statement that will update its copy. *) let main_stmt = List.fold_left (fun acc state -> (mk_stmt loc auto f st status state res)@acc ) [] copies in (* Finally, we replace the state var values by the ones computed in copies. *) let stvar_update = if Aorai_option.Deterministic.get () then let orig = Data_for_aorai.get_varinfo curState in [ equalsStmt (Cil.var orig) (Cil.evar (List.hd local_var))] else List.map (fun (state,copy) -> equalsStmt (Cil.var (Data_for_aorai.get_state_var state)) (Cil.evar ~loc copy)) copies in let ret = [ Cil.mkStmt ~ghost:true (Cil_types.Return(None,loc)) ] in let res_block = (Cil.mkBlock ( stmt_begin_list @ copies_update @ main_stmt @ stvar_update @ ret)) in res_block.blocals <- local_var; Aorai_option.debug ~dkey "Generated body is:@\n%a" Printer.pp_block res_block; res_block,local_var let get_preds_wrt_params_reachable_states state f status = let auto = Data_for_aorai.getAutomata () in let treat_one_trans acc tr = Logic_simplification.tor acc (fst tr.cross) in let find_trans state prev tr = Path_analysis.get_edges prev state auto @ tr in let treat_one_state state (_,last,_) acc = let my_trans = Data_for_aorai.Aorai_state.Set.fold (find_trans state) last [] in let cond = List.fold_left treat_one_trans TFalse my_trans in let (_,dnf) = Logic_simplification.simplifyCond cond in let cond = Logic_simplification.simplifyDNFwrtCtx dnf f status in let pred = crosscond_to_pred cond f status in Logic_const.pand (acc, pimplies (is_state_pred state, pred)) in Data_for_aorai.Aorai_state.Map.fold treat_one_state state ptrue let get_preds_wrt_params_reachable_states state f status = let merge_reachable_state _ = Data_for_aorai.merge_end_state in let reachable_states = Data_for_aorai.Aorai_state.Map.fold merge_reachable_state state Data_for_aorai.Aorai_state.Map.empty in get_preds_wrt_params_reachable_states reachable_states f status let get_preds_pre_wrt_params f = let pre = Data_for_aorai.get_kf_init_state f in get_preds_wrt_params_reachable_states pre f Promelaast.Call let get_preds_post_bc_wrt_params f = let post = Data_for_aorai.get_kf_return_state f in get_preds_wrt_params_reachable_states post f Promelaast.Return let treat_val loc base range pred = let add term = if Cil.isLogicZero base then term else Logic_const.term (TBinOp (PlusA, Logic_const.tat (base,Logic_const.pre_label), term)) Linteger in let add_cst i = add (Logic_const.tinteger i) in let res = match range with | Fixed i -> Logic_const.prel (Req,loc, add_cst i) | Interval(min,max) -> let min = Logic_const.prel (Rle, add_cst min, loc) in let max = Logic_const.prel (Rle, loc, add_cst max) in Logic_const.pand (min,max) | Bounded (min,max) -> let min = Logic_const.prel (Rle, add_cst min, loc) in let max = Logic_const.prel (Rle, loc, add max) in Logic_const.pand (min,max) | Unbounded min -> Logic_const.prel (Rle, add_cst min, loc) in Aorai_option.debug ~dkey:action_dkey "Action predicate: %a" Printer.pp_predicate res; Logic_const.por(pred,res) let possible_states_preds state = let treat_one_state start map acc = let make_possible_state state _ acc = Logic_const.por (acc,is_state_pred state) in let possible_states = Data_for_aorai.Aorai_state.Map.fold make_possible_state map pfalse in Logic_const.pimplies (Logic_const.pat (is_state_pred start,Logic_const.pre_label), possible_states) :: acc in Data_for_aorai.Aorai_state.Map.fold treat_one_state state [] let update_to_pred ~start ~pre_state ~post_state location bindings = let loc = Cil_datatype.Location.unknown in let intv = Cil_datatype.Term.Map.fold (treat_val location) bindings Logic_const.pfalse in let pred = match post_state.multi_state with | None -> intv | Some(set,aux) -> (* [VP 2011-09-05] In fact, not all the pebble come from the considered pre-state. Will this lead to too strong post-conditions? *) let set = Data_for_aorai.pebble_set_at set Logic_const.here_label in pebble_post ~loc set aux intv in let guard = Logic_const.pand ~loc (Logic_const.pat ~loc (is_state_pred pre_state, start), is_state_pred post_state) in Logic_const.pimplies ~loc (guard, pred) let action_to_pred ~start ~pre_state ~post_state bindings = let treat_one_loc loc vals acc = update_to_pred ~start ~pre_state ~post_state loc vals :: acc in Cil_datatype.Term.Map.fold treat_one_loc bindings [] let all_actions_preds start state = let treat_current_state pre_state post_state (_,_,bindings) acc = let my_bindings = action_to_pred ~start ~pre_state ~post_state bindings in my_bindings @ acc in let treat_start_state pre_state map acc = Data_for_aorai.Aorai_state.Map.fold (treat_current_state pre_state) map acc in Data_for_aorai.Aorai_state.Map.fold treat_start_state state [] (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/aorai_utils.mli0000666000000000000000000002051013571573400017572 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Promelaast (** Given a transition a function and a function status (call or return) it returns if the cross condition can be satisfied with only function status. *) val isCrossable: (typed_condition * action) trans -> kernel_function -> funcStatus -> bool (** Given a transition and the main entry point it returns if the cross condition can be satisfied at the beginning of the program. *) val isCrossableAtInit: (typed_condition * action) trans -> kernel_function -> bool (** This function rewrites a cross condition into an ACSL expression. Moreover, by giving current operation name and its status (call or return) the generation simplifies the generated expression. *) val crosscond_to_pred: typed_condition -> kernel_function -> funcStatus -> predicate (** {b Globals management} *) (** Copy the file pointer locally in the class in order to easiest globals management and initializes some tables. *) val initFile : Cil_types.file -> unit (** Given the name of the main function, this function computes all newly introduced globals (variables, enumeration structure, invariants, etc.) *) val initGlobals : Cil_types.kernel_function -> bool -> unit (* ************************************************************************* *) (** {b Pre/post management} *) (**{b Pre and post condition of C functions} In our point of view, the pre or the post condition of a C function are defined by the set of states authorized just before/after the call, as such as the set of crossable transitions. The following functions generates abstract pre and post-conditions by using only informations deduced from the buchi automata. *) (** base lhost corresponding to curState. *) val host_state_term: unit -> Cil_types.term_lval (** Returns the predicate saying that automaton is in corresponding state. *) val is_state_pred: state -> predicate (** Returns the statement saying the state is affected *) val is_state_stmt: state * Cil_types.varinfo -> location -> Cil_types.stmt (** Returns the boolean expression saying the state is affected *) val is_state_exp: state -> location -> Cil_types.exp (** Returns the predicate saying that automaton is NOT in corresponding state. *) val is_out_of_state_pred: state -> predicate (** Returns the statement saying the automaton is not in the corresponding state. @raise AbortFatal in the deterministic case, as such an assignment is meaningless in this context: we only assign the state variable to be in the (unique by definition) state currently active *) val is_out_of_state_stmt: state * Cil_types.varinfo -> location -> Cil_types.stmt (** Returns the expression testing that automaton is NOT in the corresponding state.*) val is_out_of_state_exp: state -> location -> Cil_types.exp (** returns assigns clause corresponding to updating automaton's state, and assigning auxiliary variable depending on the possible transitions made in the function. @since Nitrogen-20111001 @since Neon-20140301 adds kf argument *) val aorai_assigns: Data_for_aorai.state -> Cil_types.location -> Cil_types.assigns (** returns the list of predicates expressing that for each current state the automaton currently is in, there is at least one transition that is crossed. *) val force_transition: Cil_types.location -> kernel_function -> Promelaast.funcStatus -> Data_for_aorai.state -> Cil_types.identified_predicate list (** return list of preconditions for the given auxiliary function (f_pre_func or f_post_func). *) val auto_func_preconditions: Cil_types.location -> kernel_function -> Promelaast.funcStatus -> Data_for_aorai.state -> Cil_types.identified_predicate list (** auto_func_behaviors f st (st_status, tr_status) generates behaviors corresponding to the transitions authorized by tr_status for function f in status st @since Nitrogen-20111001 *) val auto_func_behaviors: Cil_types.location -> kernel_function -> Promelaast.funcStatus -> Data_for_aorai.state -> Cil_types.funbehavior list (** [auto_func_block loc f status st res] generates the body of pre & post functions. res must be [None] for a pre-function and [Some v] for a post-func where [v] is the formal corresponding to the value returned by the original function. If the original function returns [Void], [res] must be [None]. It also returns the local variables list declared in the body. *) val auto_func_block: Cil_types.location -> kernel_function -> Promelaast.funcStatus -> Data_for_aorai.state -> Cil_types.varinfo option -> Cil_types.block * Cil_types.varinfo list val get_preds_pre_wrt_params : kernel_function -> predicate val get_preds_post_bc_wrt_params : kernel_function -> predicate (** Returns a list of predicate giving for each possible start state the disjunction of possible current states *) val possible_states_preds: Data_for_aorai.state -> predicate list (** Possible values of the given auxiliary variable under the current path, [start]ing from the given point @since Neon-20140301 add logic_label argument *) val update_to_pred: start: Cil_types.logic_label -> pre_state:Promelaast.state -> post_state:Promelaast.state -> Cil_types.term -> Data_for_aorai.Intervals.t -> predicate (** for a given starting and ending state, returns the post-conditions related to the possible values of the auxiliary variables at current point the function, guarded by the fact that we have followed this path, from the given program point @modify Neon-20130301 add logic_label argument *) val action_to_pred: start:Cil_types.logic_label -> pre_state:Promelaast.state -> post_state:Promelaast.state -> Data_for_aorai.Vals.t -> predicate list (** All actions that might have been performed on aux variables from the given program point, guarded by the path followed. @modify Neon-20140301 add logic_label argument *) val all_actions_preds: Cil_types.logic_label -> Data_for_aorai.state -> predicate list (** Return an integer constant term with the 0 value. *) val zero_term : unit -> Cil_types.term (** Given an lval term 'host' and an integer value 'off', it returns a lval term host[off]. *) val mk_offseted_array : Cil_types.term_lval -> int -> Cil_types.term val mk_offseted_array_states_as_enum : Cil_types.term_lval -> int -> Cil_types.term (** Returns a term representing the given logic variable (usually a fresh quantified variable). *) val mk_term_from_vi : Cil_types.varinfo -> Cil_types.term val make_enum_states: unit -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/aorai_visitors.ml0000666000000000000000000012441113571573400020150 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Promelaast open Extlib open Logic_const open Cil_types open Cil (**************************************************************************) let dkey = Aorai_option.register_category "action" let get_acceptance_pred () = let (st,_) = Data_for_aorai.getAutomata () in List.fold_left (fun acc s -> match s.acceptation with Bool3.True -> Logic_const.por (acc, Aorai_utils.is_state_pred s) | Bool3.False | Bool3.Undefined -> acc) Logic_const.pfalse st let get_call_name exp = match exp.enode with | Const(CStr(s)) -> s | Lval(Var(vi),NoOffset) -> vi.vname | _ -> Aorai_option.not_yet_implemented "At this time, only explicit calls are allowed by the Aorai plugin." (****************************************************************************) (* The instrumentation is done in two passes: 1) creating auxiliary functions for each non-ignored C function, that update automaton's state when entering and exiting the function 2) generating specifications for all the functions. We maintain tables from aux to orig so that the second visitor knows which is which. Note that this tables are cleared after each visit, and thus need not be projectified. *) (* the various kinds of auxiliary functions. *) type func_auto_mode = Not_auto_func (* original C function. *) | Pre_func of kernel_function (* Pre_func f denotes a function updating the automaton when f is called. *) | Post_func of kernel_function (* Post_func f denotes a function updating the automaton when returning from f. *) (* table from auxiliary functions to the corresponding original one. *) let func_orig_table = Cil_datatype.Varinfo.Hashtbl.create 17 let kind_of_func vi = try Cil_datatype.Varinfo.Hashtbl.find func_orig_table vi with Not_found -> Not_auto_func (* The following functions will be used to generate C code for pre & post functions. *) let mk_auto_fct_block kf status auto_state res = let loc = Kernel_function.get_location kf in Aorai_utils.auto_func_block loc kf status auto_state res let mk_pre_fct_block kf = mk_auto_fct_block kf Promelaast.Call (Data_for_aorai.get_kf_init_state kf) None let mk_post_fct_block kf res = mk_auto_fct_block kf Promelaast.Return (Data_for_aorai.get_kf_return_state kf) res (** This visitor adds an auxiliary function for each C function which takes care of setting the automaton in a correct state before calling the original one, and replaces each occurrence of the original function by the auxiliary one. It also takes care of changing the automaton at function's return. *) class visit_adding_code_for_synchronisation = object (self) inherit Visitor.frama_c_inplace val aux_post_table = Kernel_function.Hashtbl.create 17 method! vglob_aux g = match g with | GFun (fundec,loc) -> let kf = Extlib.the self#current_kf in let vi = Kernel_function.get_vi kf in let vi_pre = Cil_const.copy_with_new_vid vi in vi_pre.vname <- Data_for_aorai.get_fresh (vi_pre.vname ^ "_pre_func"); vi_pre.vdefined <- true; vi_pre.vghost <- true; Cil_datatype.Varinfo.Hashtbl.add func_orig_table vi_pre (Pre_func kf); (* TODO: - what about protos that have no specified args (NB: cannot be identified here because of implem of Kernel_function). - what about varargs? *) let (rettype,args,varargs,_) = Cil.splitFunctionTypeVI vi_pre in vi_pre.vtype <- TFun(Cil.voidType, args, varargs,[]); vi_pre.vattr <- []; (* in particular get rid of __no_return if set in vi*) let arg = if Cil.isVoidType rettype then [] else ["res",rettype,[]] in let vi_post = Cil.makeGlobalVar ~ghost:true (Data_for_aorai.get_fresh (vi.vname ^ "_post_func")) (TFun(voidType,Some arg,false,[])) in Kernel_function.Hashtbl.add aux_post_table kf vi_post; Cil_datatype.Varinfo.Hashtbl.add func_orig_table vi_post (Post_func kf); let fun_dec_pre = Cil.emptyFunctionFromVI vi_pre in let fun_dec_post = Cil.emptyFunctionFromVI vi_post in (* For a future analysis of function arguments, we have to update the function's formals. Search for LBLsformals. *) Cil.setFunctionTypeMakeFormals fun_dec_pre (TFun(Cil.voidType, args, varargs,[])); Cil.setFunctionTypeMakeFormals fun_dec_post (TFun(voidType,Some arg,false,[])); (* We will now fill the function with the result of the automaton's analysis. *) let pre_block,pre_locals = mk_pre_fct_block kf in let post_block,post_locals = mk_post_fct_block kf (Extlib.opt_of_list fun_dec_post.sformals) in fun_dec_pre.slocals <- pre_locals; fun_dec_pre.sbody <- pre_block; fun_dec_pre.svar.vdefined <- true; fun_dec_post.slocals <- post_locals; fun_dec_post.sbody <- post_block; fun_dec_post.svar.vdefined <- true; let globs = [ GFun(fun_dec_pre,loc); GFun(fun_dec_post,loc);] in fundec.sbody.bstmts <- Cil.mkStmtOneInstr ~ghost:true (Call(None,Cil.evar ~loc vi_pre, List.map (fun x -> Cil.evar ~loc x) (Kernel_function.get_formals kf), loc)) :: fundec.sbody.bstmts; Globals.Functions.replace_by_definition (Cil.empty_funspec()) fun_dec_pre loc; Globals.Functions.replace_by_definition (Cil.empty_funspec()) fun_dec_post loc; (* Finally, we update the CFG for the new fundec *) let keepSwitch = Kernel.KeepSwitch.get() in Cfg.prepareCFG ~keepSwitch fun_dec_pre; Cfg.cfgFun fun_dec_pre; Cfg.prepareCFG ~keepSwitch fun_dec_post; Cfg.cfgFun fun_dec_post; ChangeDoChildrenPost([g], fun x -> globs @ x) | _ -> DoChildren method! vstmt_aux stmt = match stmt.skind with | Return (res,loc) -> let kf = Extlib.the self#current_kf in let vi = Kernel_function.get_vi kf in let current_function = vi.vname in if not (Data_for_aorai.isIgnoredFunction current_function) then begin let args = match res with | None -> [] | Some exp -> [Cil.copy_exp exp] in let aux_vi = try Kernel_function.Hashtbl.find aux_post_table kf with Not_found -> Aorai_option.fatal "Function %a has no associated post_func" Kernel_function.pretty kf in let call = mkStmtOneInstr ~ghost:true (Call (None,Cil.evar ~loc aux_vi,args,loc)) in let new_return = mkStmt ~valid_sid:true stmt.skind in let new_stmts = [call; new_return] in stmt.skind<-Block(Cil.mkBlock(new_stmts)) end; SkipChildren | _ -> DoChildren end (*********************************************************************) (* update from formals of original C function to one of the auxiliary function (f_aux or f_pre) *) class change_formals old_kf new_kf = let old_formals = Kernel_function.get_formals old_kf in let new_formals = Kernel_function.get_formals new_kf in let formals = List.combine old_formals new_formals in object inherit Visitor.frama_c_inplace method! vlogic_var_use lv = match lv.lv_origin with | None -> SkipChildren | Some vi -> try let vi'= List.assq vi formals in ChangeTo (Cil.cvar_to_lvar vi') with Not_found -> SkipChildren method! vvrbl vi = try let vi' = List.assq vi formals in ChangeTo vi' with Not_found -> SkipChildren end (* update \result to param of f_post when it exists. Must not be called if f_post has no parameter (original f returns void). *) class change_result new_kf = let v = List.hd (Kernel_function.get_formals new_kf) in object inherit Visitor.frama_c_inplace method! vterm_lhost lh = match lh with TResult _ -> ChangeTo (TVar (Cil.cvar_to_lvar v)) | _ -> DoChildren end let post_treatment_loops = Hashtbl.create 97 let update_loop_assigns kf stmt state vi code_annot = let loc = Cil_datatype.Stmt.loc stmt in let assigns = Aorai_utils.aorai_assigns state loc in let assigns = Logic_utils.concat_assigns (Writes [Logic_const.new_identified_term (Logic_const.tvar ~loc vi), From []]) assigns in let new_assigns = match code_annot.annot_content with | AAssigns (bhvs,old_assigns) -> Logic_const.new_code_annotation (AAssigns (bhvs, Logic_utils.concat_assigns old_assigns assigns)) | _ -> Aorai_option.fatal "Expecting an assigns clause here" in Annotations.add_code_annot Aorai_option.emitter ~kf stmt new_assigns let get_action_post_cond kf ?init_trans return_states = let to_consider pre_state int_states = match init_trans with | None -> true | Some init_trans -> try let possible_states = Data_for_aorai.Aorai_state.Map.find pre_state init_trans in not (Data_for_aorai.Aorai_state.Set.is_empty (Data_for_aorai.Aorai_state.Set.inter int_states possible_states)) with Not_found -> false in let treat_one_path pre_state post_state (int_states,_,bindings) acc = if to_consider pre_state int_states then begin let start = Logic_const.pre_label in let post_conds = Aorai_utils.action_to_pred ~start ~pre_state ~post_state bindings in Aorai_option.debug ~dkey "Getting action post-conditions for %a, from state %s to state %s@\n%a" Kernel_function.pretty kf pre_state.Promelaast.name post_state.Promelaast.name (Pretty_utils.pp_list ~sep:"@\n" Printer.pp_predicate) post_conds; post_conds @ acc end else acc in let treat_one_pre_state pre_state map acc = Data_for_aorai.Aorai_state.Map.fold (treat_one_path pre_state) map acc in let post_cond = Data_for_aorai.Aorai_state.Map.fold treat_one_pre_state return_states [] in List.map (fun post_cond -> (Normal, Logic_const.new_predicate post_cond)) post_cond let make_zero_one_choice reachable_states = let treat_one_state state _ acc = (Logic_const.por (Aorai_utils.is_state_pred state, Aorai_utils.is_out_of_state_pred state)) :: acc in Data_for_aorai.Aorai_state.Map.fold treat_one_state reachable_states [] let needs_zero_one_choice states = let needs_choice = try ignore (Data_for_aorai.Aorai_state.Map.fold (fun _ _ flag -> if flag then raise Exit else true) states false); false with Exit -> true in if needs_choice then List.map Logic_const.new_predicate (make_zero_one_choice states) else [] let pred_reachable reachable_states = let treat_one_state (nb, reachable, unreachable) state = if Data_for_aorai.Aorai_state.Map.mem state reachable_states then (nb+1, Logic_const.por (reachable, Aorai_utils.is_state_pred state), unreachable) else (nb, reachable, Logic_const.pand (unreachable, Aorai_utils.is_out_of_state_pred state)) in let (states,_) = Data_for_aorai.getAutomata () in let (nb, reachable, unreachable) = List.fold_left treat_one_state (0,pfalse,ptrue) states in (nb > 1, reachable, unreachable) let possible_start kf (start,int) = let auto = Data_for_aorai.getAutomata () in let trans = Path_analysis.get_edges start int auto in let treat_one_trans cond tr = Logic_const.por (cond, Aorai_utils.crosscond_to_pred (fst tr.cross) kf Promelaast.Call) in let cond = List.fold_left treat_one_trans Logic_const.pfalse trans in Logic_const.pand (Aorai_utils.is_state_pred start, cond) let neg_trans kf trans = let auto = Data_for_aorai.getAutomata () in let rec aux l acc = match l with | [] -> acc | (start,stop) :: l -> let same_start, rest = List.fold_left (fun (same_start, rest) (start', stop' as elt) -> if Data_for_aorai.Aorai_state.equal start start' then stop' :: same_start, rest else same_start, elt :: rest) ([stop],[]) l in let cond = List.fold_left (fun cond stop -> let trans = Path_analysis.get_edges start stop auto in List.fold_left (fun cond tr -> Logic_simplification.tand cond (Logic_simplification.tnot (fst tr.cross))) cond trans) TTrue same_start in let cond = fst (Logic_simplification.simplifyCond cond) in let cond = Aorai_utils.crosscond_to_pred cond kf Promelaast.Call in let cond = Logic_const.por (Aorai_utils.is_out_of_state_pred start, cond) in aux rest (Logic_const.pand (acc,cond)) in aux trans Logic_const.ptrue let get_unchanged_aux_var loc current_state = let partition_action state (_,_,map) (actions,possible_states) = let possible_states = Data_for_aorai.Aorai_state.Set.add state possible_states in let treat_one_action t _ acc = let states = try Cil_datatype.Term.Map.find t acc with Not_found -> Data_for_aorai.Aorai_state.Set.empty in Cil_datatype.Term.Map.add t (Data_for_aorai.Aorai_state.Set.add state states) acc in let actions = Cil_datatype.Term.Map.fold treat_one_action map actions in (actions,possible_states) in let treat_one_action pre_hyp possible_states t action_states acc = if not (Data_for_aorai.Aorai_state.Set.is_empty (Data_for_aorai.Aorai_state.Set.diff possible_states action_states)) then begin let post_hyp = Data_for_aorai.Aorai_state.Set.fold (fun st acc -> Logic_const.pand ~loc (acc,Aorai_utils.is_out_of_state_pred st)) action_states Logic_const.ptrue in let pred = Logic_const.new_predicate (Logic_const.pimplies ~loc (pre_hyp, Logic_const.pimplies ~loc (post_hyp, Logic_const.prel ~loc (Req,t,Logic_const.told ~loc t)))) in (Normal,pred) :: acc end else acc (* all possible states will update this lval, no need to make a special case here. *) in let treat_one_pre_state start map acc = let pre_hyp = Logic_const.pold ~loc (Aorai_utils.is_state_pred start) in let actions_map, possible_states = Data_for_aorai.Aorai_state.Map.fold partition_action map (Cil_datatype.Term.Map.empty, Data_for_aorai.Aorai_state.Set.empty) in Cil_datatype.Term.Map.fold (treat_one_action pre_hyp possible_states) actions_map acc in Data_for_aorai.Aorai_state.Map.fold treat_one_pre_state current_state [] (** This visitor adds a specification to each function and to each loop, according to specifications stored into Data_for_aorai. *) class visit_adding_pre_post_from_buch treatloops = let predicate_to_invariant kf stmt pred = Annotations.add_code_annot Aorai_option.emitter ~kf stmt (Logic_const.new_code_annotation (AInvariant([],true,pred))); in let all_possible_states state = let treat_one_state _ = Data_for_aorai.merge_end_state in Data_for_aorai.Aorai_state.Map.fold treat_one_state state Data_for_aorai.Aorai_state.Map.empty in let condition_to_invariant kf possible_states stmt = (* Checks whether we have at least two possible automaton's states in the invariant. *) let has_multiple_choice = try ignore (Data_for_aorai.Aorai_state.Map.fold (fun _ _ b -> if b then raise Exit else true) possible_states false); false with Exit -> true in let treat_one_state s = if Data_for_aorai.Aorai_state.Map.mem s possible_states then begin if has_multiple_choice then begin let pred = Logic_const.por (Aorai_utils.is_state_pred s, Aorai_utils.is_out_of_state_pred s) in predicate_to_invariant kf stmt pred end else begin (* We can only be in one state. Since we must be in at least one state, the invariant is quite simple. *) predicate_to_invariant kf stmt (Aorai_utils.is_state_pred s) end end else begin let pred = Aorai_utils.is_out_of_state_pred s in predicate_to_invariant kf stmt pred end in let (states,_) = Data_for_aorai.getAutomata () in List.iter treat_one_state states; if has_multiple_choice then begin let add_possible_state state _ acc = if Data_for_aorai.is_reject_state state then acc else Logic_const.por (acc,Aorai_utils.is_state_pred state) in let pred = Data_for_aorai.Aorai_state.Map.fold add_possible_state possible_states Logic_const.pfalse in predicate_to_invariant kf stmt pred end in let impossible_states_preds start possible_states my_state = let treat_one_start_state state start_state end_states acc = if not (Data_for_aorai.Aorai_state.Map.mem state end_states) then Logic_const.pimplies (Logic_const.pat(Aorai_utils.is_state_pred start_state, start), Aorai_utils.is_out_of_state_pred state) :: acc else acc in let treat_one_state state _ acc = Data_for_aorai.Aorai_state.Map.fold (treat_one_start_state state) my_state acc in Data_for_aorai.Aorai_state.Map.fold treat_one_state possible_states [] in let impossible_states_preds_inv start possible_states my_state = let treat_one_start_state state start_state end_states acc = if Data_for_aorai.Aorai_state.Map.mem state end_states then Logic_const.pand (acc, Logic_const.pat(Aorai_utils.is_out_of_state_pred start_state, start)) else acc in let treat_one_state state _ acc = let out_states = Data_for_aorai.Aorai_state.Map.fold (treat_one_start_state state) my_state Logic_const.ptrue in if Data_for_aorai.Aorai_state.Map.cardinal my_state = 1 && not (Logic_utils.is_trivially_true out_states) then acc (* we only have a single entry state: we can't possibly be out of it, or another annotation above is invalid. No need to put an implication with a false lhs. *) else Logic_const.pimplies (out_states, Aorai_utils.is_out_of_state_pred state) ::acc in Data_for_aorai.Aorai_state.Map.fold treat_one_state possible_states [] in let partition_pre_state map = let (states,_) = Data_for_aorai.getAutomata () in let is_equiv st1 st2 = let check_one _ o1 o2 = match o1, o2 with | None, None | Some _, Some _ -> Some () | None, Some _ | Some _, None -> raise Not_found in try ignore (Data_for_aorai.Aorai_state.Map.merge check_one st1 st2); true with Not_found -> false in let find_equivs (start,state, end_states) equivs = let rec aux = function | [] -> [[start,state],end_states] | (equiv_class,end_states2 as infos) :: l -> if is_equiv end_states end_states2 then ((start, state) :: equiv_class, end_states2) :: l else infos :: aux l in aux equivs in let filter equivs state = let check_one_state start end_states equivs = let end_states = Data_for_aorai.Aorai_state.Map.filter (fun _ (int_states,_,_) -> Data_for_aorai.Aorai_state.Set.mem state int_states) end_states in if Data_for_aorai.Aorai_state.Map.is_empty end_states then equivs else find_equivs (start, state, end_states) equivs in Data_for_aorai.Aorai_state.Map.fold check_one_state map equivs in let res = List.fold_left filter [] states in List.map fst res in let update_assigns loc kf ki spec = let update_assigns bhv = (* NB: The assigns for a statement contract is a bit overapproximated, (includes assigns of the whole function), but we don't really have a better information at this point. *) let assigns = Aorai_utils.aorai_assigns (Data_for_aorai.get_kf_return_state kf) loc in match ki with | Kstmt stmt -> (* stmt contract *) if bhv.b_assigns <> WritesAny then begin let bhv_aorai = Cil.mk_behavior ~name:bhv.b_name ~assigns () in let spec = Cil.empty_funspec () in spec.spec_behavior <- [ bhv_aorai ]; let ca = Logic_const.new_code_annotation (AStmtSpec ([],spec)) in Annotations.add_code_annot Aorai_option.emitter ~kf stmt ca end | Kglobal -> (* function contract *) Annotations.add_assigns ~keep_empty:true Aorai_option.emitter kf ~behavior:bhv.b_name assigns; in List.iter update_assigns spec.spec_behavior in let mk_auto_fct_spec kf status auto_state = let loc = Kernel_function.get_location kf in Aorai_utils.auto_func_behaviors loc kf status auto_state in let mk_pre_fct_spec kf = mk_auto_fct_spec kf Promelaast.Call (Data_for_aorai.get_kf_init_state kf) in let mk_post_fct_spec kf = mk_auto_fct_spec kf Promelaast.Return (Data_for_aorai.get_kf_return_state kf) in let needs_post kf = let loc = Kernel_function.get_location kf in let return_state = Data_for_aorai.get_kf_return_state kf in let possible_states = Data_for_aorai.Aorai_state.Map.fold (fun _ map acc -> Data_for_aorai.Aorai_state.Map.fold (fun st _ acc -> Data_for_aorai.Aorai_state.Set.add st acc) map acc) return_state Data_for_aorai.Aorai_state.Set.empty in let action_post = get_unchanged_aux_var loc return_state in if Data_for_aorai.Aorai_state.Set.exists Data_for_aorai.is_reject_state possible_states then (* We must ensure that there is at least one active state beside the rejection state *) let cond = Data_for_aorai.Aorai_state.Set.fold (fun st acc -> if Data_for_aorai.is_reject_state st then acc else Logic_const.por (Aorai_utils.is_state_pred st,acc)) possible_states Logic_const.pfalse in (Normal,Logic_const.new_predicate cond) :: action_post else action_post in let mk_post kf = let return_state = Data_for_aorai.get_kf_return_state kf in (* + Post-condition registration *) (* If several states are associated to the same post-condition, then their specification is factorised. *) let equivs = partition_pre_state return_state in let bhvs = match equivs with | [ e ] -> (* we just have one possible case, no need to generate assumes and a negative behavior *) let name = "Buchi_property_behavior" in let s = fst (List.hd e) in let reachable_states = Data_for_aorai.Aorai_state.Map.find s return_state in let (multi_choice, reachable, unreachable) = pred_reachable reachable_states in let post_cond = Normal, Logic_const.new_predicate reachable in let post_cond = if Aorai_option.Deterministic.get () then [post_cond] else [Normal, Logic_const.new_predicate unreachable; post_cond] in let post_cond = if multi_choice && not (Aorai_option.Deterministic.get ()) then begin let preds = make_zero_one_choice reachable_states in List.fold_left (fun acc p -> (Normal, Logic_const.new_predicate p) :: acc) post_cond preds end else post_cond in let infos = Aorai_utils.get_preds_post_bc_wrt_params kf in let post_cond = if Logic_utils.is_trivially_true infos then post_cond else (Normal, Logic_const.new_predicate infos) :: post_cond in let post_cond = post_cond @ get_action_post_cond kf return_state in [Cil.mk_behavior ~name ~post_cond ()] | _ -> let _,bhvs = List.fold_left (fun (i,acc) equiv -> let (case_start, case_int) = List.hd equiv in let assumes_l = List.map (possible_start kf) equiv in let name = "Buchi_behavior_in_" ^ (string_of_int i) in let assumes = [Logic_const.new_predicate (Logic_const.pors assumes_l)] in let reachable_states = Data_for_aorai.Aorai_state.Map.find case_start return_state in let reachable_states = Data_for_aorai.Aorai_state.Map.filter (fun _ (int,_,_) -> Data_for_aorai.Aorai_state.Set.mem case_int int) reachable_states in let (multi_choice, reachable, _) = pred_reachable reachable_states in let post_cond = [Normal, Logic_const.new_predicate reachable] in let post_cond = if multi_choice && not (Aorai_option.Deterministic.get()) then begin let preds = make_zero_one_choice reachable_states in List.fold_left (fun acc p -> (Normal, Logic_const.new_predicate p) :: acc) post_cond preds end else post_cond in let infos = Aorai_utils.get_preds_post_bc_wrt_params kf in let post_cond = if Logic_utils.is_trivially_true infos then post_cond else (Normal, Logic_const.new_predicate infos) :: post_cond in let init_trans = List.fold_left (fun acc (start, int) -> let set = try Data_for_aorai.Aorai_state.Map.find start acc with Not_found -> Data_for_aorai.Aorai_state.Set.empty in Data_for_aorai.Aorai_state.Map.add start (Data_for_aorai.Aorai_state.Set.add int set) acc) Data_for_aorai.Aorai_state.Map.empty equiv in let post_cond = post_cond @ (get_action_post_cond kf ~init_trans return_state) in (i+1, Cil.mk_behavior ~name ~assumes ~post_cond () :: acc)) (0,[]) equivs in if Aorai_option.Deterministic.get () then bhvs else begin (* post-conditions for state in which we are not at the end of the functions. They have to be grouped differently than positive information because of non-determinism (if two non-equivalent states are active when entering the function and activate the same state at exit) *) let aux (i,bhvs) state = let name = "Buchi_behavior_out_" ^ (string_of_int i) in let select_equivalence_class equiv = let (start, int) = List.hd equiv in try let map = Data_for_aorai.Aorai_state.Map.find start return_state in let (int_states, _,_) = Data_for_aorai.Aorai_state.Map.find state map in Data_for_aorai.Aorai_state.Set.mem int int_states with Not_found -> false in let my_trans = List.fold_left (fun acc equiv -> if select_equivalence_class equiv then acc @ equiv else acc) [] equivs in let assumes = neg_trans kf my_trans in if Logic_utils.is_trivially_false assumes then (i+1,bhvs) else let p = Aorai_utils.is_out_of_state_pred state in let post_cond = [Normal, Logic_const.new_predicate p] in let bhv = if Logic_utils.is_trivially_true assumes then Cil.mk_behavior ~name ~post_cond () else begin let assumes = [Logic_const.new_predicate assumes] in Cil.mk_behavior ~name ~assumes ~post_cond () end in (i+1,bhv :: bhvs) in let (states,_) = Data_for_aorai.getAutomata () in List.rev (snd (List.fold_left aux (0,bhvs) states)) end in (* If this is the main function, we should exit in at least one acceptance state. *) let bhvs = if Aorai_option.ConsiderAcceptance.get () && Datatype.String.equal (Kernel_function.get_name kf) (Kernel.MainFunction.get()) then let accept = Logic_const.new_predicate (get_acceptance_pred()) in let post_cond = [Normal, accept] in let name = "aorai_acceptance" in Cil.mk_behavior ~name ~post_cond () :: bhvs else bhvs in if Aorai_option.AddingOperationNameAndStatusInSpecification.get() then begin let called_post = Logic_const.new_predicate (Logic_const.prel (Req , Logic_const.tvar (Data_for_aorai.get_logic_var Data_for_aorai.curOpStatus), Logic_const.term (TConst (Logic_utils.constant_to_lconstant (Data_for_aorai.op_status_to_cenum Promelaast.Return))) (Ctype Cil.intType))) in let called_post_2 = Logic_const.new_predicate (Logic_const.prel (Req, Logic_const.tvar (Data_for_aorai.get_logic_var Data_for_aorai.curOp), Logic_const.term (TConst (Logic_utils.constant_to_lconstant (Data_for_aorai.func_to_cenum (Kernel_function.get_name kf)))) (Ctype Cil.intType))) in let name = "Buchi_property_behavior_function_states" in let post_cond = [Normal, called_post; Normal, called_post_2] in Cil.mk_behavior ~name ~post_cond () :: bhvs end else bhvs in object(self) inherit Visitor.frama_c_inplace (* We have to update assigns whenever a call occurs in the scope of a statement contract (function always update the automaton's state, so assigns there have to be changed anyway.) *) val has_call = Stack.create () method private enter_block () = Stack.push (ref false) has_call method private call () = Stack.iter (fun x -> x := true) has_call method private leave_block () = !(Stack.pop has_call) method! vfunc f = let my_kf = Extlib.the self#current_kf in let vi = Kernel_function.get_vi my_kf in let spec = Annotations.funspec my_kf in let loc = Kernel_function.get_location my_kf in (match kind_of_func vi with | Pre_func _ | Post_func _ -> () | Not_auto_func -> (* Normal C function *) let bhvs = mk_post my_kf in let my_state = Data_for_aorai.get_kf_init_state my_kf in let requires = needs_zero_one_choice my_state in let requires = Aorai_utils.auto_func_preconditions loc my_kf Promelaast.Call my_state @ requires in let post_cond = needs_post my_kf in match Cil.find_default_behavior spec with | Some b -> let behavior = b.b_name in Annotations.add_requires Aorai_option.emitter my_kf ~behavior requires; Annotations.add_ensures Aorai_option.emitter my_kf ~behavior post_cond; Annotations.add_behaviors Aorai_option.emitter my_kf bhvs | None -> let bhv = Cil.mk_behavior ~requires ~post_cond () in Annotations.add_behaviors Aorai_option.emitter my_kf (bhv :: bhvs)); let after f = update_assigns f.svar.vdecl my_kf Kglobal spec; f in ChangeDoChildrenPost(f,after) method! vglob_aux g = match g with | GFun(f,_) -> let my_kf = Extlib.the self#current_kf in (* don't use get_spec, as we'd generate default assigns, while we'll fill the spec just below. *) let vi = Kernel_function.get_vi my_kf in (match kind_of_func vi with | Pre_func kf -> (* must advance the automaton according to current call. *) let bhvs = mk_pre_fct_spec kf in let vis = new change_formals kf my_kf in let bhvs = Visitor.visitFramacBehaviors vis bhvs in Annotations.add_behaviors Aorai_option.emitter my_kf bhvs; f.sbody <- Visitor.visitFramacBlock vis f.sbody; SkipChildren | Post_func kf -> (* must advance the automaton according to return event. *) let (rt, _, _, _) = Cil.splitFunctionTypeVI (Kernel_function.get_vi kf) in let bhvs = mk_post_fct_spec kf in let bhvs = (* if return type is not void, convert \result in the formal arg of current kf. Otherwise, there's no conversion to do. *) if Cil.isVoidType rt then bhvs else (Visitor.visitFramacBehaviors (new change_result my_kf) (* LBLsformals : change_result must not be called if f_post has no arguments, ie no formals for a function declaration. That's why we had to update sformals. *) bhvs;) in Annotations.add_behaviors Aorai_option.emitter my_kf bhvs; SkipChildren | Not_auto_func -> DoChildren (* they are not considered here. *)) | _ -> DoChildren; method! vstmt_aux stmt = let kf = Extlib.the self#current_kf in let treat_loop body_ref stmt = let init_state = Data_for_aorai.get_loop_init_state stmt in let inv_state = Data_for_aorai.get_loop_invariant_state stmt in let possible_states = Data_for_aorai.merge_end_state (all_possible_states init_state) (all_possible_states inv_state) in let loop_assigns = Annotations.code_annot ~filter:Logic_utils.is_assigns stmt in (* varinfo of the init_var associated to this loop *) let vi_init = Data_for_aorai.get_varinfo (Data_for_aorai.loopInit ^ "_" ^ string_of_int stmt.sid) in (* 1) The associated init variable is set to 0 in first position (or in second position if the first stmt is a if)*) let loc = Cil_datatype.Stmt.loc stmt in let stmt_varset = Cil.mkStmtOneInstr ~ghost:true ~valid_sid:true (Set((Var vi_init,NoOffset), Cil.zero ~loc, loc)) in begin (* Function adapted from the cil printer *) try let rec skipEmpty = function [] -> [] | {skind=Instr (Skip _);labels=[]} :: rest -> skipEmpty rest | x -> x in match skipEmpty !body_ref.bstmts with | {skind=If(_,tb,fb,_)} as head:: _ -> begin match skipEmpty tb.bstmts, skipEmpty fb.bstmts with | _, {skind=Break _}:: _ | _, {skind=Goto _} :: _ | {skind=Goto _} :: _, _ | {skind=Break _} :: _, _ -> !body_ref.bstmts <- head :: stmt_varset :: List.tl !body_ref.bstmts | _ -> raise Not_found end | _ -> raise Not_found with Not_found -> !body_ref.bstmts<-stmt_varset::!body_ref.bstmts end; (* 2) The associated init variable is set to 1 before the loop *) let new_loop = mkStmt ~valid_sid:true stmt.skind in let stmt_varset = Cil.mkStmtOneInstr ~ghost:true ~valid_sid:true (Set((Var(vi_init),NoOffset), Cil.one ~loc, loc)) in let block = mkBlock [stmt_varset;new_loop] in stmt.skind<-Block(block); (* Overcome WP limitation wrt LoopEntry. See bug 1353 *) new_loop.labels <- [ Label ("aorai_loop_" ^ string_of_int stmt.sid, Cil_datatype.Stmt.loc stmt, false)]; let loop_entry_label = StmtLabel (ref new_loop) in (* 3) Generation of the loop invariant *) let mk_imply operator predicate = pimplies (prel(operator, Aorai_utils.mk_term_from_vi vi_init, Aorai_utils.zero_term()), predicate) in (* The loop invariant is : (Global invariant) // all never reached state are set to zero & (Init => Pre1) // external pre-condition & (not Init => Post2) // internal post-condition & counter_invariant // values of counters. (init: fresh variable which indicates if the iteration is the first one). *) condition_to_invariant kf possible_states new_loop; let init_preds = impossible_states_preds Logic_const.pre_label possible_states init_state in let treat_init_pred pred = let pred = mk_imply Rneq pred in predicate_to_invariant kf new_loop pred in List.iter treat_init_pred init_preds; let invariant_preds = impossible_states_preds_inv loop_entry_label possible_states inv_state in let treat_inv_pred pred = let pred = mk_imply Req pred in predicate_to_invariant kf new_loop pred in List.iter treat_inv_pred invariant_preds; let action_inv_preds = Aorai_utils.all_actions_preds loop_entry_label inv_state in List.iter (predicate_to_invariant kf new_loop) action_inv_preds; List.iter (update_loop_assigns kf new_loop inv_state (Cil.cvar_to_lvar vi_init)) loop_assigns; (* 4) Keeping in mind to preserve old annotations after visitor end *) Hashtbl.add post_treatment_loops (ref stmt) (ref new_loop); (* 5) Updated stmt is returned *) stmt in self#enter_block (); let after s = if self#leave_block () then let annots = Annotations.code_annot stmt in let _, specs = List.split (Logic_utils.extract_contract annots) in List.iter (update_assigns (Cil_datatype.Stmt.loc stmt) (Extlib.the self#current_kf) (Kstmt stmt)) specs; s else s in if treatloops then match stmt.skind with | Loop (_,block,_,_,_) -> ChangeDoChildrenPost(stmt, after $ (treat_loop (ref block))) | _ -> ChangeDoChildrenPost(stmt, after) else ChangeDoChildrenPost(stmt,after) method! vinst = function | Call _ | Local_init (_, ConsInit _, _) -> self#call (); DoChildren | _ -> DoChildren end let add_pre_post_from_buch file treatloops = let visitor = new visit_adding_pre_post_from_buch treatloops in Cil.visitCilFile (visitor :> Cil.cilVisitor) file; (* Transfer previous annotation on the new loop statement. Variant clause has to be preserved at the end of the annotation.*) Hashtbl.iter (fun old_stmt new_stmt -> let new_s = !new_stmt in let old_s = !old_stmt in let kf = Kernel_function.find_englobing_kf old_s in (* Erasing annotations from the old statement before attaching them with the new one *) let annots = Annotations.fold_code_annot (fun e a acc -> Annotations.remove_code_annot e ~kf old_s a; if (Logic_utils.is_assigns a) then acc else (e, a) :: acc) old_s []; in List.iter (fun (e, a) -> Annotations.add_code_annot e ~kf new_s a) annots) post_treatment_loops let add_sync_with_buch file = let visitor = new visit_adding_code_for_synchronisation in Cil.visitCilFile (visitor :> Cil.cilVisitor) file (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/bool3.ml0000666000000000000000000000453313571573400016133 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type t = | True | False | Undefined let bool3and c1 c2 = match c1, c2 with | True, True -> True | _, False | False, _ -> False | Undefined, _ | _, Undefined -> Undefined let bool3or c1 c2 = match c1, c2 with | True, _ | _, True -> True | _, Undefined | Undefined, _ -> Undefined | False, False -> False let bool3not c = match c with | True -> False | False -> True | Undefined -> Undefined let bool3_of_bool b = if b then True else False (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/bool3.mli0000666000000000000000000000401413571573400016276 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type t = | True | False | Undefined val bool3and: t -> t -> t val bool3or: t -> t -> t val bool3not: t -> t val bool3_of_bool: bool -> t (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/configure0000777000000000000000000027763013571573400016504 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS LTLTOBA HAS_LTLTOBA ENABLE_AORAI ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_aorai ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-aorai support for Aorai plug-in (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-aorai was given. if test "${enable_aorai+set}" = set; then : enableval=$enable_aorai; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "aorai is not available" "$LINENO" 5 fi FORCE_AORAI=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_AORAI ENABLE_AORAI=$ENABLE NAME_AORAI=aorai if test "$default" = "no" -a "$FORCE" = "no"; then INFO_AORAI=" (not available by default)" fi echo "aorai... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) USE_LTLTOBA=$USE_LTLTOBA" "aorai if test "$ENABLE_AORAI" != "no"; then # ltl2ba library for file in ltl2ba; do HAS_LTLTOBA= # Extract the first word of "$file", so it can be a program name with args. set dummy $file; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAS_LTLTOBA+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAS_LTLTOBA"; then ac_cv_prog_HAS_LTLTOBA="$HAS_LTLTOBA" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAS_LTLTOBA="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAS_LTLTOBA" && ac_cv_prog_HAS_LTLTOBA="no" fi fi HAS_LTLTOBA=$ac_cv_prog_HAS_LTLTOBA if test -n "$HAS_LTLTOBA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_LTLTOBA" >&5 $as_echo "$HAS_LTLTOBA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$HAS_LTLTOBA" = "yes"; then SELECTED_VAR=$file break; fi done fi if test -n "$REQUIRE_LTLTOBA" -o -n "$USE_LTLTOBA" -o "$no" = "yes"; then if test "$HAS_LTLTOBA" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ltl2ba not found." >&5 $as_echo "$as_me: WARNING: ltl2ba not found." >&2;} reason="ltl2ba missing" for p in $REQUIRE_LTLTOBA; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ ltl2ba\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_LTLTOBA; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ ltl2ba\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done else LTLTOBA=ltl2ba fi fi # First, initialize some variables for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` TODOLIST=$TODOLIST" "$plugin eval MARK_$plugin= eval REMEMBER_$plugin= fi done # main call compute_dependency ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi frama-c-20.0-Calcium/src/plugins/aorai/configure.ac0000666000000000000000000000465313571573400017054 0ustar ########################################################################## # # # This file is part of Aorai plug-in of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # INRIA (Institut National de Recherche en Informatique et en # # Automatique) # # INSA (Institut National des Sciences Appliquees) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)] ) check_plugin(aorai,PLUGIN_RELATIVE_PATH(plugin_file),[support for Aorai plug-in],yes) plugin_use_external(aorai,ltltoba) if test "$ENABLE_AORAI" != "no"; then # ltl2ba library configure_tool([LTLTOBA],[ltl2ba],[ltl2ba not found.],no) fi check_plugin_dependencies write_plugin_config(Makefile) frama-c-20.0-Calcium/src/plugins/aorai/data_for_aorai.ml0000666000000000000000000024062613571573400020054 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Logic_ptree open Cil open Cil_types open Promelaast open Logic_simplification exception Empty_automaton module Aorai_state = Datatype.Make_with_collections( struct type t = Promelaast.state let structural_descr = Structural_descr.t_abstract let reprs = [ { nums = -1; name = ""; multi_state = None; acceptation = Bool3.False; init = Bool3.False } ] let name = "Aorai_state" let equal x y = Datatype.Int.equal x.nums y.nums let hash x = x.nums let rehash = Datatype.identity let compare x y = Datatype.Int.compare x.nums y.nums let copy = Datatype.identity let internal_pretty_code = Datatype.undefined let pretty fmt x = Format.fprintf fmt "state_%d" x.nums let varname _ = assert false (* unused while internal_pretty_code is undefined *) let mem_project = Datatype.never_any_project end ) module Aorai_typed_trans = Datatype.Make_with_collections( struct let name = "Aorai_typed_trans" type t = (Promelaast.typed_condition * Promelaast.action) Promelaast.trans let structural_descr = Structural_descr.t_abstract let reprs = [ { numt = -1; start = List.hd (Aorai_state.reprs); stop = List.hd (Aorai_state.reprs); cross = (TTrue,[]); } ] let equal x y = Datatype.Int.equal x.numt y.numt let hash x = x.numt let rehash = Datatype.identity let compare x y = Datatype.Int.compare x.numt y.numt let copy = Datatype.identity let internal_pretty_code = Datatype.undefined let pretty = Promelaoutput.print_transition let varname _ = assert false let mem_project = Datatype.never_any_project end) module State_var = State_builder.Hashtbl (Aorai_state.Hashtbl) (Cil_datatype.Varinfo) (struct let name = "Data_for_aorai.State_var" let dependencies = [ Ast.self; Aorai_option.Ya.self ] let size = 7 end) let get_state_var = let add_var state = Cil.makeVarinfo true false state.name Cil.intType in State_var.memo add_var let get_state_logic_var state = Cil.cvar_to_lvar (get_state_var state) module Max_value_counter = State_builder.Hashtbl (Cil_datatype.Term.Hashtbl) (Cil_datatype.Term) (struct let name = "Data_for_aorai.Max_value_counter" let dependencies = [ Ast.self; Aorai_option.Ya.self ] let size = 7 end) let find_max_value t = try Some (Max_value_counter.find t) with Not_found -> None let raise_error msg = Aorai_option.fatal "Aorai plugin internal error. \nStatus : %s.\n" msg;; (* Format.printf "Aorai plugin internal error. \nStatus : %s.\n" msg; *) (* assert false *) let por t1 t2 = match t1,t2 with PTrue,_ | _,PTrue -> PTrue | PFalse,t | t,PFalse -> t | _,_ -> POr(t1,t2) let pand t1 t2 = match t1,t2 with PTrue,t | t,PTrue -> t | PFalse,_ | _,PFalse -> PFalse | _,_ -> PAnd(t1,t2) let pnot t = match t with PTrue -> PFalse | PFalse -> PTrue | PNot t -> t | _ -> PNot t let rec is_same_expression e1 e2 = match e1,e2 with | PVar x, PVar y -> x = y | PVar _,_ | _,PVar _ -> false | PCst cst1, PCst cst2 -> Logic_utils.is_same_pconstant cst1 cst2 | PCst _,_ | _,PCst _ -> false | PPrm (f1,x1), PPrm(f2,x2) -> f1 = x1 && f2 = x2 | PPrm _,_ | _,PPrm _ -> false | PBinop(b1,l1,r1), PBinop(b2,l2,r2) -> b1 = b2 && is_same_expression l1 l2 && is_same_expression r1 r2 | PBinop _, _ | _, PBinop _ -> false | PUnop(u1,e1), PUnop(u2,e2) -> u1 = u2 && is_same_expression e1 e2 | PUnop _,_ | _,PUnop _ -> false | PArrget(a1,i1), PArrget(a2,i2) -> is_same_expression a1 a2 && is_same_expression i1 i2 | PArrget _,_ | _,PArrget _ -> false | PField(e1,f1), PField(e2,f2) -> f1 = f2 && is_same_expression e1 e2 | PField _,_ | _,PField _ -> false | PArrow(e1,f1), PArrow(e2,f2) -> f1 = f2 && is_same_expression e1 e2 let declared_logics = Hashtbl.create 97 let add_logic name log_info = Hashtbl.replace declared_logics name log_info let get_logic name = try Hashtbl.find declared_logics name with Not_found -> raise_error ("Logic function '"^name^"' not declared in hashtbl") let declared_predicates = Hashtbl.create 97 let add_predicate name pred_info = Hashtbl.replace declared_predicates name pred_info let get_predicate name = try Hashtbl.find declared_predicates name with Not_found -> raise_error ("Predicate '"^name^"' not declared in hashtbl") (* ************************************************************************* *) (* Some constant names used for generation *) (* Logic variables *) let transStart = "aorai_Trans_Start" (* OK *) let transStop = "aorai_Trans_Stop" (* OK *) let transCond = "aorai_Trans_Cond" (* OK *) let transCondP = "aorai_Trans_Cond_param" (* OK *) let loopInit = "aorai_Loop_Init" (* OK *) (* C variables *) let curState = "aorai_CurStates" (* OK *) let curStateOld = "aorai_CurStates_old" (* OK *) let curTrans = "aorai_CurTrans" (* OK *) (*let curTransTmp = "aorai_CurTrans_tmp" (* OK *)*) let curOp = "aorai_CurOperation" (* OK *) let curOpStatus = "aorai_CurOpStatus" (* OK *) let acceptSt = "aorai_AcceptStates" (* TODO *) (* C constants #define *) let nbOp = "aorai_NbOper" (* Deprecated ? *) let nbAcceptSt = "aorai_NbAcceptStates" (* Deprecated ? *) let nbTrans = "aorai_NbTrans" (* Deprecated ? *) (* C Macros *) let macro_ligth = "aorai_Macro_Prop_St_Tr_Without_Conds" (* Deprecated ? *) let macro_full = "aorai_Macro_Prop_St_Tr" (* Deprecated ? *) let macro_pure = "aorai_Macro_Op_without_sub_call" (* Deprecated ? *) (* C enumeration *) let listOp = "aorai_ListOper" (* OK *) let listStatus = "aorai_OpStatusList" (* OK *) let callStatus = "aorai_Called" (* OK *) let termStatus = "aorai_Terminated" (* OK *) let states = "aorai_States" (* OK *) (* C function *) let buch_sync = "Aorai_Sync" (* Deprecated ? *) (* ************************************************************************* *) (* Buchi automata as stored after parsing *) let automata = ref ([],[]) (* Each transition with a parametrized cross condition (call param access or return value access) has its parametrized part stored in this array. *) let cond_of_parametrizedTransitions = ref (Array.make (1) [[]]) (* List of variables name observed in the C file *) let variables_from_c = ref [] (* List of functions name observed in the C file *) let functions_from_c = ref [] (* List of functions call observed in the C file without declaration *) let ignored_functions = ref [] (** Return the buchi automata as stored after parsing *) let getAutomata () = !automata (** Return the number of transitions of the automata *) let getNumberOfTransitions () = List.length (snd !automata) (** Return the number of states of the automata *) let getNumberOfStates () = List.length (fst !automata) let is_c_global name = try ignore (Globals.Vars.find_from_astinfo name VGlobal); true with Not_found -> try ignore (Globals.Functions.find_by_name name); true with Not_found -> false let get_fresh = let used_names = Hashtbl.create 5 in fun name -> if Clexer.is_c_keyword name || Logic_lexer.is_acsl_keyword name || is_c_global name || Hashtbl.mem used_names name then begin let i = ref (try Hashtbl.find used_names name with Not_found -> 0) in let proposed_name () = name ^ "_" ^ string_of_int !i in while is_c_global (proposed_name()) do incr i done; Hashtbl.replace used_names name (!i+1); proposed_name () end else begin Hashtbl.add used_names name 0; name end module AuxVariables = State_builder.List_ref (Cil_datatype.Varinfo) (struct let name = "Data_for_aorai.AuxVariables" let dependencies = [ Aorai_option.Ltl_File.self; Aorai_option.Buchi.self; Aorai_option.Ya.self; Ast.self ] end) module AbstractLogicInfo = State_builder.List_ref (Cil_datatype.Logic_info) (struct let name = "Data_for_aorai.AbstractLogicInfo" let dependencies = [ Aorai_option.Ltl_File.self; Aorai_option.Buchi.self; Aorai_option.Ya.self; Ast.self ] end) class change_var vi1 vi2 = object inherit Visitor.frama_c_copy (Project.current ()) method! vlogic_var_use vi = if Cil_datatype.Logic_var.equal vi1 vi then ChangeTo vi2 else SkipChildren end let change_var_term vi1 vi2 t = Visitor.visitFramacTerm (new change_var vi1 vi2) t let update_condition vi1 vi2 cond = let rec aux e = match e with | TOr (e1,e2) -> TOr(aux e1, aux e2) | TAnd (e1,e2) -> TAnd(aux e1, aux e2) | TNot e -> TNot (aux e) | TCall _ | TReturn _ | TTrue | TFalse -> e | TRel(rel,t1,t2) -> TRel(rel,change_var_term vi1 vi2 t1,change_var_term vi1 vi2 t2) in aux cond let pebble_set_at li lab = assert (li.l_profile = []); let labels = List.map (fun _ -> lab) li.l_labels in Logic_const.term (Tapp (li,labels,[])) (Extlib.the li.l_type) let memo_multi_state st = match st.multi_state with | None -> let aux = Cil.makeGlobalVar (get_fresh "aorai_aux") Cil.intType in let laux = Cil.cvar_to_lvar aux in let set = Cil_const.make_logic_info (get_fresh (st.name ^ "_pebble")) in let typ = Logic_const.make_set_type (Ctype Cil.intType) in set.l_var_info.lv_type <- typ; set.l_labels <- [FormalLabel "L"]; set.l_type <- Some typ; set.l_body <- LBreads [ Logic_const.new_identified_term (Logic_const.tvar laux) ]; let multi_state = set,laux in st.multi_state <- Some multi_state; multi_state | Some multi_state -> multi_state let change_bound_var st1 st2 cond = if Extlib.has_some st1.multi_state then begin let (_,idx1) = Extlib.the st1.multi_state in let (_,idx2) = memo_multi_state st2 in update_condition idx1 idx2 cond end else cond let add_aux_variable vi = AuxVariables.add vi let aux_variables = AuxVariables.get let abstract_logic_info = AbstractLogicInfo.get module StateIndex = State_builder.Counter(struct let name = "Data_for_aorai.StateIndex" end) module TransIndex = State_builder.Counter(struct let name = "Data_for_aorai.TransIndex" end) let new_state name = { name = get_fresh name; acceptation = Bool3.False; init = Bool3.False; nums = StateIndex.next(); multi_state = None } let new_intermediate_state () = new_state "aorai_intermediate_state" let new_trans start stop cond = { start = start; stop = stop; cross = cond; numt = TransIndex.next () } let check_states s = let states,trans = getAutomata() in let max = getNumberOfStates () in List.iter (fun x -> if x.nums >= max then Aorai_option.fatal "%s: State %d found while max id is supposed to be %d" s x.nums max) states; List.iter (fun x -> try let y = List.find (fun y -> x.nums = y.nums && not (x==y)) states in Aorai_option.fatal "%s: State %s and %s share same id %d" s x.name y.name x.nums with Not_found -> () ) states; List.iter (fun x -> if not (List.memq x.start states) then Aorai_option.fatal "%s: Start state %d of transition %d is not among known states" s x.start.nums x.numt; if not (List.memq x.stop states) then Aorai_option.fatal "%s: End state %d of transition %d is not among known states" s x.start.nums x.numt;) trans let cst_one = PCst (Logic_ptree.IntConstant "1") let cst_zero = PCst (Logic_ptree.IntConstant "0") let is_cst_zero e = match e with | PCst(IntConstant "0") -> true | _ -> false let is_cst_one e = match e with PCst (IntConstant "1") -> true | _ -> false let is_single elt = match elt.min_rep, elt.max_rep with | Some min, Some max -> is_cst_one min && is_cst_one max | _ -> false (* Epsilon transitions will account for the possibility of not entering a repeated sequence at all. They will be normalized after the entire automaton is processed by adding direct transitions from the starting state to the children of the end state. *) type eps_trans = Normal of typed_condition * action | Epsilon of typed_condition * action let print_epsilon_trans fmt = function | Normal (c,a) -> Format.fprintf fmt "%a%a" Promelaoutput.print_condition c Promelaoutput.print_action a | Epsilon (c,a) -> Format.fprintf fmt "epsilon-trans:@\n%a%a" Promelaoutput.print_condition c Promelaoutput.print_action a type current_event = | ECall of kernel_function * Cil_types.logic_var Cil_datatype.Varinfo.Hashtbl.t * eps_trans Promelaast.trans | EReturn of kernel_function | ECOR of kernel_function | ENone (* None found yet *) | EMulti (* multiple event possible. repr of the stack does not take into account this particular event. *) let add_current_event event env cond = let is_empty tbl = Cil_datatype.Varinfo.Hashtbl.length tbl = 0 in match env with [] -> assert false | old_event :: tl -> match event, old_event with | ENone, _ -> env, cond | _, ENone -> event::tl, cond | ECall (kf1,_,_), ECall (kf2,_,_) when Kernel_function.equal kf1 kf2 -> env, cond | ECall (kf1,tbl1,_), ECall (kf2,tbl2,_)-> (* ltl2buchi generates such inconsistent guards, but luckily does not speak about formals. In this case, we just return False with an empty event. If this situation occurs in an handwritten automaton that uses formals we simply reject it. *) if is_empty tbl1 && is_empty tbl2 then ENone::tl, TFalse else Aorai_option.abort "specification is inconsistent: two call events for distinct \ functions %a and %a at the same time." Kernel_function.pretty kf1 Kernel_function.pretty kf2 | ECall (_,_,_), EMulti -> event::tl, cond | ECall (kf1,tbl1,_), EReturn kf2 -> if is_empty tbl1 then ENone::tl, TFalse else Aorai_option.abort "specification is inconsistent: trying to call %a and \ return from %a at the same time." Kernel_function.pretty kf1 Kernel_function.pretty kf2 | ECall(kf1,_,_), ECOR kf2 when Kernel_function.equal kf1 kf2 -> event::tl, cond | ECall (kf1,tbl1,_), ECOR kf2 -> if is_empty tbl1 then ENone::tl, TFalse else Aorai_option.abort "specification is inconsistent: trying to call %a and \ call or return from %a at the same time." Kernel_function.pretty kf1 Kernel_function.pretty kf2 | EReturn kf1, ECall(kf2,tbl2,_) -> if is_empty tbl2 then ENone::tl, TFalse else Aorai_option.abort "specification is inconsistent: trying to call %a and \ return from %a at the same time." Kernel_function.pretty kf2 Kernel_function.pretty kf1 | EReturn kf1, (ECOR kf2 | EReturn kf2) when Kernel_function.equal kf1 kf2 -> event::tl, cond | EReturn _, EReturn _ -> ENone::tl, TFalse | EReturn _, ECOR _ -> ENone::tl, TFalse | EReturn _, EMulti -> ENone::tl, TFalse | (EMulti | ECOR _), _ -> assert false (* These are compound event. They cannot be found as individual ones*) let merge_current_event env1 env2 cond1 cond2 = assert (List.tl env1 == List.tl env2); let old_env = List.tl env2 in match (List.hd env1, List.hd env2) with | ENone, _ -> env2, tor cond1 cond2 | _, ENone -> env1, tor cond1 cond2 | ECall(kf1,_,_), ECall(kf2,_,_) when Kernel_function.equal kf1 kf2 -> env2, tor cond1 cond2 | ECall _, ECall _ -> EMulti::old_env, tor cond1 cond2 | ECall _, EMulti -> env2, tor cond1 cond2 | ECall (kf1,_,_), ECOR kf2 when Kernel_function.equal kf1 kf2 -> env2, tor cond1 cond2 | ECall (kf1,_,_), EReturn kf2 when Kernel_function.equal kf1 kf2 -> ECOR kf1 :: old_env, tor cond1 cond2 | ECall _, (ECOR _ | EReturn _) -> EMulti :: old_env, tor cond1 cond2 | EReturn kf1, ECall (kf2,_,_) when Kernel_function.equal kf1 kf2 -> ECOR kf1 :: old_env, tor cond1 cond2 | EReturn _, ECall _ -> EMulti :: old_env, tor cond1 cond2 | EReturn kf1, EReturn kf2 when Kernel_function.equal kf1 kf2 -> env2, tor cond1 cond2 | EReturn _, EReturn _ -> EMulti :: old_env, tor cond1 cond2 | EReturn _, EMulti -> env2, tor cond1 cond2 | EReturn kf1, ECOR kf2 when Kernel_function.equal kf1 kf2 -> env2, tor cond1 cond2 | EReturn _, ECOR _ -> EMulti :: old_env, tor cond1 cond2 | ECOR kf1, (ECall(kf2,_,_) | EReturn kf2 | ECOR kf2) when Kernel_function.equal kf1 kf2 -> env1, tor cond1 cond2 | ECOR _, (ECall _ | EReturn _ | ECOR _) -> EMulti :: old_env, tor cond1 cond2 | ECOR _, EMulti -> env2, tor cond1 cond2 | EMulti, (ECall _ | EReturn _ | ECOR _) -> env1, tor cond1 cond2 | EMulti, EMulti -> EMulti::old_env, tor cond1 cond2 let get_bindings st my_var = let my_lval = TVar my_var, TNoOffset in match st with None -> my_lval | Some st -> let (_,idx) = memo_multi_state st in Logic_const.addTermOffsetLval (TIndex (Logic_const.tvar idx,TNoOffset)) my_lval let get_bindings_term st my_var typ = Logic_const.term (TLval (get_bindings st my_var)) typ let memo_aux_variable tr counter used_prms vi = try let my_var = Cil_datatype.Varinfo.Hashtbl.find used_prms vi in get_bindings_term counter my_var (Ctype vi.vtype) with Not_found -> let my_type = match counter with | None -> vi.vtype | Some _ -> TArray(vi.vtype,None,{scache=Not_Computed},[]) in let my_var = Cil.makeGlobalVar (get_fresh ("aorai_" ^ vi.vname)) my_type in add_aux_variable my_var; let my_lvar = Cil.cvar_to_lvar my_var in Cil_datatype.Varinfo.Hashtbl.add used_prms vi my_lvar; (match tr.cross with | Normal (cond,action) -> let st = Extlib.opt_map (fun _ -> tr.stop) counter in let loc = get_bindings st my_lvar in let copy = Copy_value (loc,Logic_const.tvar (Cil.cvar_to_lvar vi)) in tr.cross <- Normal(cond,copy::action) | Epsilon _ -> Aorai_option.fatal "Epsilon transition used as Call event" ); get_bindings_term counter my_lvar (Ctype vi.vtype) let check_one top info counter s = match info with | ECall (kf,used_prms,tr) -> (try let vi = Globals.Vars.find_from_astinfo s (VFormal kf) in if top then Some (Logic_const.tvar (Cil.cvar_to_lvar vi)) else Some (memo_aux_variable tr counter used_prms vi) with Not_found -> None) | EReturn kf when top && ( Datatype.String.equal s "return" || Datatype.String.equal s "\\result") -> let rt = Kernel_function.get_return_type kf in if Cil.isVoidType rt then Aorai_option.abort "%a returns void. \\result is meaningless in this context" Kernel_function.pretty kf; Some (Logic_const.term (TLval (TResult rt,TNoOffset)) (Ctype rt)) | ECOR _ | EReturn _ | EMulti | ENone -> None let find_in_env env counter s = let current, stack = match env with | current::stack -> current, stack | [] -> Aorai_option.fatal "Empty type-checking environment" in match check_one true current counter s with Some lv -> lv | None -> let module M = struct exception Found of term end in (try List.iter (fun x -> match check_one false x counter s with None -> () | Some lv -> raise (M.Found lv)) stack; let vi = Globals.Vars.find_from_astinfo s VGlobal in Logic_const.tvar (Cil.cvar_to_lvar vi) with M.Found lv -> lv | Not_found -> Aorai_option.abort "Unknown variable %s" s) let find_prm_in_env env ?tr counter f x = let kf = try Globals.Functions.find_by_name f with Not_found -> Aorai_option.abort "Unknown function %s" f in if Datatype.String.equal x "return" || Datatype.String.equal x "\\result" then begin (* Return event *) let rt = Kernel_function.get_return_type kf in if Cil.isVoidType rt then Aorai_option.abort "%a returns void. %s().%s is meaningless in this context" Kernel_function.pretty kf f x; let env,cond = add_current_event (EReturn kf) env (TReturn kf) in env, Logic_const.term (TLval (TResult rt,TNoOffset)) (Ctype rt), cond end else begin (* Complete Call followed by Return event *) let rec treat_env top = function | ECall(kf',_,_) as event :: _ when Kernel_function.equal kf kf'-> (match check_one top event counter x with Some lv -> env, lv, TTrue | None -> Aorai_option.abort "Function %s has no parameter %s" f x) | (ENone | EReturn _ | EMulti | ECOR _ | ECall _ ) :: tl -> treat_env false tl | [] -> let env, cond = match tr with None -> Aorai_option.abort "Function %s is not in the call stack. \ Cannot use its parameter %s here" f x | Some tr -> add_current_event (ECall (kf, Cil_datatype.Varinfo.Hashtbl.create 3, tr)) env (TCall (kf,None)) in let vi = try Globals.Vars.find_from_astinfo x (VFormal kf) with Not_found -> Aorai_option.abort "Function %s has no parameter %s" f x in (* By definition, we are at the call event: no need to store it in an aux variable or array here. *) env, Logic_const.tvar (Cil.cvar_to_lvar vi), cond in treat_env true env end module C_logic_env = struct let anonCompFieldName = Cabs2cil.anonCompFieldName let conditionalConversion = Cabs2cil.logicConditionalConversion let is_loop () = false let find_macro _ = raise Not_found let find_var ?label:_ ~var:_ = raise Not_found let find_enum_tag _ = raise Not_found (*let find_comp_type ~kind:_ _ = raise Not_found*) let find_comp_field info s = let field = Cil.getCompField info s in Field(field,NoOffset) let find_type _ = raise Not_found let find_label _ = raise Not_found include Logic_env let add_logic_function = add_logic_function_gen Logic_utils.is_same_logic_profile let remove_logic_info = remove_logic_info_gen Logic_utils.is_same_logic_profile let integral_cast ty t = Aorai_option.abort "term %a has type %a, but %a is expected." Printer.pp_term t Printer.pp_logic_type Linteger Printer.pp_typ ty let error (source,_) msg = Aorai_option.abort ~source msg (* we never attempt to recover on an error. *) let on_error f _ x = f x end module LTyping = Logic_typing.Make(C_logic_env) let type_expr env ?tr ?current e = let loc = Cil_datatype.Location.unknown in let rec aux env cond e = match e with PVar s -> let var = find_in_env env current s in env, var, cond | PPrm(f,x) -> find_prm_in_env env ?tr current f x | PCst (Logic_ptree.IntConstant s) -> let e = Cil.parseIntLogic ~loc s in env, e, cond | PCst (Logic_ptree.FloatConstant str) -> let c = Logic_utils.string_to_float_lconstant str in env, Logic_const.term (TConst c) Lreal, cond | PCst (Logic_ptree.StringConstant s) -> let t = Logic_const.term (TConst(LStr (Logic_typing.unescape s))) (Ctype Cil.charPtrType) in env,t,cond | PCst (Logic_ptree.WStringConstant s) -> let t = Logic_const.term (TConst (LWStr (Logic_typing.wcharlist_of_string s))) (Ctype (TPtr(Cil.theMachine.wcharType,[]))) in env,t,cond | PBinop(bop,e1,e2) -> let op = Logic_typing.type_binop bop in let env,e1,cond = aux env cond e1 in let env,e2,cond = aux env cond e2 in let t1 = e1.term_type in let t2 = e2.term_type in let t = if Logic_typing.is_arithmetic_type t1 && Logic_typing.is_arithmetic_type t2 then let t = Logic_typing.arithmetic_conversion t1 t2 in Logic_const.term (TBinOp (op,LTyping.mk_cast e1 t,LTyping.mk_cast e2 t)) t else (match bop with | Logic_ptree.Badd when Logic_typing.is_integral_type t2 && Logic_utils.isLogicPointerType t1 -> Logic_const.term (TBinOp (PlusPI,e1,e2)) t1 | Logic_ptree.Bsub when Logic_typing.is_integral_type t2 && Logic_utils.isLogicPointerType t1 -> Logic_const.term (TBinOp (MinusPI,e1,e2)) t1 | Logic_ptree.Badd when Logic_typing.is_integral_type t1 && Logic_utils.isLogicPointerType t2 -> Logic_const.term (TBinOp (PlusPI,e2,e1)) t2 | Logic_ptree.Bsub when Logic_typing.is_integral_type t1 && Logic_utils.isLogicPointerType t2 -> Logic_const.term (TBinOp (MinusPI,e2,e1)) t2 | Logic_ptree.Bsub when Logic_utils.isLogicPointerType t1 && Logic_utils.isLogicPointerType t2 -> Logic_const.term (TBinOp (MinusPP,e1,LTyping.mk_cast e2 t1)) Linteger | _ -> Aorai_option.abort "Invalid operands for binary operator %a: \ unexpected %a and %a" Printer.pp_binop op Printer.pp_term e1 Printer.pp_term e2) in env, t, cond | PUnop(Logic_ptree.Uminus,e) -> let env,t,cond = aux env cond e in if Logic_typing.is_arithmetic_type t.term_type then env,Logic_const.term (TUnOp (Neg,t)) Linteger,cond else Aorai_option.abort "Invalid operand for unary -: unexpected %a" Printer.pp_term t | PUnop(Logic_ptree.Ubw_not,e) -> let env,t,cond = aux env cond e in if Logic_typing.is_arithmetic_type t.term_type then env,Logic_const.term (TUnOp (BNot,t)) Linteger,cond else Aorai_option.abort "Invalid operand for bitwise not: unexpected %a" Printer.pp_term t | PUnop(Logic_ptree.Uamp,e) -> let env, t, cond = aux env cond e in let ptr = try Ctype (TPtr (Logic_utils.logicCType t.term_type,[])) with Failure _ -> Aorai_option.abort "Cannot take address: not a C type(%a): %a" Printer.pp_logic_type t.term_type Printer.pp_term t in (match t.term_node with | TLval v | TStartOf v -> env, Logic_const.taddrof v ptr, cond | _ -> Aorai_option.abort "Cannot take address: not an lvalue %a" Printer.pp_term t ) | PUnop (Logic_ptree.Ustar,e) -> let env, t, cond = aux env cond e in if Logic_utils.isLogicPointerType t.term_type then env, Logic_const.term (TLval (TMem t, TNoOffset)) (Logic_typing.type_of_pointed t.term_type), cond else Aorai_option.abort "Cannot dereference term %a" Printer.pp_term t | PArrget(e1,e2) -> let env, t1, cond = aux env cond e1 in let env, t2, cond = aux env cond e2 in let t = if Logic_utils.isLogicPointerType t1.term_type && Logic_typing.is_integral_type t2.term_type then Logic_const.term (TBinOp (IndexPI,t1,t2)) (Logic_typing.type_of_pointed t1.term_type) else if Logic_utils.isLogicPointerType t2.term_type && Logic_typing.is_integral_type t1.term_type then Logic_const.term (TBinOp (IndexPI,t2,t1)) (Logic_typing.type_of_pointed t2.term_type) else if Logic_utils.isLogicArrayType t1.term_type && Logic_typing.is_integral_type t2.term_type then (match t1.term_node with | TStartOf lv | TLval lv -> Logic_const.term (TLval (Logic_const.addTermOffsetLval (TIndex (t2, TNoOffset)) lv)) (Logic_typing.type_of_array_elem t1.term_type) | _ -> Aorai_option.fatal "Unsupported operation: %a[%a]" Printer.pp_term t1 Printer.pp_term t2) else if Logic_utils.isLogicArrayType t2.term_type && Logic_typing.is_integral_type t1.term_type then (match t2.term_node with | TStartOf lv | TLval lv -> Logic_const.term (TLval (Logic_const.addTermOffsetLval (TIndex (t1, TNoOffset)) lv)) (Logic_typing.type_of_array_elem t2.term_type) | _ -> Aorai_option.fatal "Unsupported operation: %a[%a]" Printer.pp_term t1 Printer.pp_term t2) else Aorai_option.abort "Subscripted value is neither array nor pointer: %a[%a]" Printer.pp_term t1 Printer.pp_term t2 in env, t, cond | PField(e,s) -> let env, t, cond = aux env cond e in (match t.term_node with | TLval lv -> let off, ty = LTyping.type_of_field loc s t.term_type in let lv = Logic_const.addTermOffsetLval off lv in env, Logic_const.term (TLval lv) ty, cond | _ -> Aorai_option.fatal "Unsupported operation: %a.%s" Printer.pp_term t s) | PArrow(e,s) -> let env, t, cond = aux env cond e in if Logic_utils.isLogicPointerType t.term_type then begin let off, ty = LTyping.type_of_field loc s (Logic_typing.type_of_pointed t.term_type) in let lv = Logic_const.addTermOffsetLval off (TMem t,TNoOffset) in env, Logic_const.term (TLval lv) ty, cond end else Aorai_option.abort "base term is not a pointer in %a -> %s" Printer.pp_term t s in aux env TTrue e let type_cond needs_pebble env tr cond = let current = if needs_pebble then Some tr.stop else None in let rec aux pos env = function | PRel(rel,e1,e2) -> let env, e1, c1 = type_expr env ~tr ?current e1 in let env, e2, c2 = type_expr env ~tr ?current e2 in let call_cond = if pos then tand c1 c2 else tor (tnot c1) (tnot c2) in let rel = TRel(Logic_typing.type_rel rel,e1,e2) in let cond = if pos then tand call_cond rel else tor call_cond rel in env, cond | PTrue -> env, TTrue | PFalse -> env, TFalse | POr(c1,c2) -> let env1, c1 = aux pos env c1 in let env2, c2 = aux pos env c2 in merge_current_event env1 env2 c1 c2 | PAnd(c1,c2) -> let env, c1 = aux pos env c1 in let env, c2 = aux pos env c2 in env, TAnd(c1,c2) | PNot c -> let env, c = aux (not pos) env c in env, TNot c | PCall (s,b) -> let kf = try Globals.Functions.find_by_name s with Not_found -> Aorai_option.abort "No such function: %s" s in let b = Extlib.opt_map (fun b -> let bhvs = Annotations.behaviors ~populate:false kf in try List.find (fun x -> x.b_name = b) bhvs with Not_found -> Aorai_option.abort "Function %a has no behavior named %s" Kernel_function.pretty kf b) b in if pos then add_current_event (ECall (kf, Cil_datatype.Varinfo.Hashtbl.create 3, tr)) env (TCall (kf,b)) else env, TCall (kf,b) | PReturn s -> let kf = try Globals.Functions.find_by_name s with Not_found -> Aorai_option.abort "No such function %s" s in if pos then add_current_event (EReturn kf) env (TReturn kf) else env, TReturn kf in aux true (ENone::env) cond module Reject_state = State_builder.Option_ref(Aorai_state) (struct let name = "Data_for_aorai.Reject_state" let dependencies = [ Ast.self; Aorai_option.Ltl_File.self; Aorai_option.Buchi.self; Aorai_option.Ya.self] end) let get_reject_state () = let create () = new_state "aorai_reject" in Reject_state.memo create let add_if_needed states st = if List.for_all (fun x -> not (Aorai_state.equal x st)) states then st::states else states let rec type_seq default_state tr env needs_pebble curr_start curr_end seq = let loc = Cil_datatype.Location.unknown in match seq with | [] -> (* We identify start and end. *) (env, [], [], curr_end, curr_end) | elt :: seq -> let is_single_trans = match elt.min_rep, elt.max_rep with | Some min, Some max -> is_cst_one min && is_cst_one max | None, _ | _, None -> false in let is_opt = match elt.min_rep with | Some min -> is_cst_zero min | None-> true in let might_be_zero = is_opt || (match Extlib.the elt.min_rep with PCst _ -> false | _ -> true) in let at_most_one = is_opt && match elt.max_rep with | None -> false | Some max -> is_cst_one max in let has_loop = not at_most_one && not is_single_trans in let needs_counter = match elt.min_rep, elt.max_rep with | None, None -> false | Some min, None -> not (is_cst_zero min || is_cst_one min) | None, Some max -> not (is_cst_one max) | Some min, Some max -> not (is_cst_zero min || is_cst_one min) || not (is_cst_one max) in let fixed_number_of_loop = match elt.min_rep, elt.max_rep with | _, None -> false | None, Some max -> not (is_cst_zero max) | Some min, Some max -> is_same_expression min max in let my_end = match seq with [] when not (curr_end.nums = tr.stop.nums) || is_single_trans || at_most_one -> curr_end | _ -> new_intermediate_state () in Aorai_option.debug "Examining single elt:@\n%s -> %s:@[%a@]" curr_start.name my_end.name Promelaoutput.print_seq_elt elt; let guard_exit_loop env current counter = if is_opt then TTrue else let e = Extlib.the elt.min_rep in let _,e,_ = type_expr env ?current e in (* If we have done at least the lower bound of cycles, we can exit the loop. *) TRel(Cil_types.Rle,e,counter) in let guard_loop env current counter = match elt.max_rep with | None -> (* We're using an int: adds an (somewhat artificial) requirements that the counter itself does not overflow... *) let i = Cil.max_signed_number (Cil.bitsSizeOf Cil.intType) in let e = Logic_const.tint ~loc i in TRel(Cil_types.Rlt, counter, e) | Some e -> let _,e,_ = type_expr env ?current e in Max_value_counter.replace counter e; (* The counter is incremented after the test: it must be strictly less than the upper bound to enter a new cycle. *) TRel(Cil_types.Rlt, counter, e) in let env,inner_states, inner_trans, inner_start, inner_end = match elt.condition with | None -> assert (elt.nested <> []); (* we don't have a completely empty condition. *) type_seq default_state tr env needs_pebble curr_start my_end elt.nested | Some cond -> let seq_start = match elt.nested with [] -> my_end | _ -> new_intermediate_state () in let trans_start = new_trans curr_start seq_start (Normal (TTrue,[])) in let inner_env, cond = type_cond needs_pebble env trans_start cond in let (env,states, seq_transitions, seq_end) = match elt.nested with | [] -> inner_env, [], [], my_end | _ -> let intermediate = new_intermediate_state () in let (env, states, transitions, _, seq_end) = type_seq default_state tr inner_env needs_pebble seq_start intermediate elt.nested in env, states, transitions, seq_end in let states = add_if_needed states curr_start in let transitions = trans_start :: seq_transitions in (match trans_start.cross with | Normal (conds,action) -> trans_start.cross <- Normal(tand cond conds,action) | Epsilon _ -> Aorai_option.fatal "Transition guard translated as epsilon transition"); let states = add_if_needed states seq_start in (match env with | [] | (ENone | ECall _) :: _ -> (env, states, transitions, curr_start, seq_end) | EReturn kf1 :: ECall (kf2,_,_) :: tl when Kernel_function.equal kf1 kf2 -> (tl, states, transitions, curr_start, seq_end) | (EReturn _ | ECOR _ ) :: _ -> (* If there is as mismatch (e.g. Call f; Return g), it will be caught later. There are legitimate situations for this pattern however (if the sequence itself occurs in a non-empty context in particular) *) (env, states, transitions, curr_start, seq_end) | EMulti :: env -> (env, states, transitions, curr_start, seq_end)) in let loop_end = if has_loop then new_intermediate_state () else inner_end in let (_,oth_states,oth_trans,oth_start,_) = type_seq default_state tr env needs_pebble loop_end curr_end seq in let trans = inner_trans @ oth_trans in let states = List.fold_left add_if_needed oth_states inner_states in let auto = (inner_states,inner_trans) in if at_most_one then begin (* Just adds an epsilon transition from start to end *) let opt = new_trans curr_start oth_start (Epsilon (TTrue,[])) in env, states, opt::trans, curr_start, curr_end end else if has_loop then begin (* TODO: makes it an integer *) let counter = let ty = if needs_pebble then Cil_types.TArray (Cil.intType,None,{scache=Not_Computed},[]) else Cil.intType in (* We won't always need a counter *) lazy ( let vi = Cil.makeGlobalVar (get_fresh "aorai_counter") ty in add_aux_variable vi; vi ) in let make_counter st = let vi = Lazy.force counter in let base = TVar (Cil.cvar_to_lvar vi), TNoOffset in if needs_pebble then let (_,idx) = memo_multi_state st in Logic_const.addTermOffsetLval (TIndex (Logic_const.tvar idx,TNoOffset)) base else base in let make_counter_term st = Logic_const.term (TLval (make_counter st)) (Ctype Cil.intType) in Aorai_option.debug "Inner start is %s; Inner end is %s" inner_start.name inner_end.name; let treat_state (states, oth_trans) st = let trans = Path_analysis.get_transitions_of_state st auto in if st.nums = inner_start.nums then begin let loop_trans = if needs_counter then begin List.fold_left (fun acc tr -> let init_action = Counter_init (make_counter tr.stop) in let init_cross = match tr.cross with | Normal (cond, actions) -> Normal(cond, init_action :: actions) | Epsilon(cond, actions) -> Epsilon(cond, init_action :: actions) in Aorai_option.debug "New init trans %s -> %s: %a" st.name tr.stop.name print_epsilon_trans init_cross; let init_trans = new_trans st tr.stop init_cross in if at_most_one then init_trans :: acc else begin let st = if needs_pebble then Some curr_start else None in let loop_cond = if needs_counter then guard_loop env st (make_counter_term curr_start) else TTrue in let loop_action = if needs_counter then begin let counter = make_counter curr_start in [ Counter_incr counter ] end else [] in let loop_cross = match tr.cross with | Normal(cond, actions) -> Normal(tand loop_cond cond, loop_action @ actions) | Epsilon(cond, actions) -> Epsilon(tand loop_cond cond, loop_action @ actions) in Aorai_option.debug "New loop trans %s -> %s: %a" inner_end.name tr.stop.name print_epsilon_trans loop_cross; let loop_trans = new_trans inner_end tr.stop loop_cross in init_trans :: loop_trans :: acc end) oth_trans trans end else oth_trans in let trans = if might_be_zero then begin (* We can bypass the inner transition altogether *) let zero_cond = if is_opt then TTrue else let current = if needs_pebble then Some curr_start else None in let _,t,_ = type_expr env ?current (Extlib.the elt.min_rep) in TRel (Cil_types.Req, t, Logic_const.tinteger ~loc 0) in let no_seq = new_trans st oth_start (Epsilon (zero_cond,[])) in no_seq :: loop_trans end else loop_trans in states, trans end else if st.nums = inner_end.nums then begin (* adds conditions on counter if needed *) let st = if needs_pebble then Some curr_end else None in let min_cond = if needs_counter then guard_exit_loop env st (make_counter_term curr_end) else TTrue in let min_cond = Epsilon (min_cond,[]) in Aorai_option.debug "New exit trans %s -> %s: %a" inner_end.name oth_start.name print_epsilon_trans min_cond; let exit_trans = new_trans inner_end oth_start min_cond in let trans = exit_trans :: trans @ oth_trans in states, trans end else begin (* inner state: add a rejection state for consistency purposes iff we don't have a constant number of repetition (i.e. cut out branches where automaton wrongly start a new step) and don't have an otherwise branch in the original automaton. *) if fixed_number_of_loop || default_state then states, trans @ oth_trans else begin let cond = List.fold_left (fun acc tr -> match tr.cross with | Normal (cond,_) | Epsilon (cond,_) -> let cond = change_bound_var tr.stop st cond in tor acc cond) TFalse trans in let (cond,_) = Logic_simplification.simplifyCond cond in let cond = tnot cond in (match cond with TFalse -> states, trans @ oth_trans | _ -> let reject = get_reject_state () in let states = add_if_needed states reject in let trans = new_trans st reject (Normal(cond,[])) :: trans in states, trans @ oth_trans ) end end in let states, trans = List.fold_left treat_state (* inner transition gets added in treat_state *) (states, oth_trans) inner_states in env, states, trans, curr_start, curr_end end else env, states, trans, curr_start, curr_end let single_path (states,transitions as auto) tr = Aorai_option.Deterministic.get () || (let init = Path_analysis.get_init_states auto in match init with | [ st ] -> let auto = (states, List.filter (fun x -> x.numt <> tr.numt) transitions) in Path_analysis.at_most_one_path auto st tr.start | _ -> false) let find_otherwise_trans auto st = let trans = Path_analysis.get_transitions_of_state st auto in try let tr = List.find (fun x -> x.cross = Otherwise) trans in Some tr.stop with Not_found -> None let type_trans auto env tr = let needs_pebble = not (single_path auto tr) in let has_siblings = match Path_analysis.get_transitions_of_state tr.start auto with | [] -> Aorai_option.fatal "Ill-formed automaton" (* at least tr should be there *) | [ _ ] -> false (* We only have one sequence to exit from there anyway *) | _::_::_ -> true in Aorai_option.debug "Analyzing transition %s -> %s: %a (needs pebble: %B)" tr.start.name tr.stop.name Promelaoutput.print_parsed tr.cross needs_pebble; match tr.cross with | Seq seq -> let default_state = find_otherwise_trans auto tr.start in let has_default_state = Extlib.has_some default_state in let _,states, transitions,_,_ = type_seq has_default_state tr env needs_pebble tr.start tr.stop seq in let (states, transitions) = if List.exists (fun st -> st.multi_state <> None) states then begin (* We have introduced some multi-state somewhere, we have to introduce pebbles and propagate them from state to state. *) let start = tr.start in let count = (* TODO: make it an integer. *) Cil.makeGlobalVar (get_fresh ("aorai_cnt_" ^ start.name)) Cil.intType in add_aux_variable count; let transitions = List.map (fun trans -> match trans.cross with | Epsilon _ -> trans | Normal(cond,actions) -> let (dest,d_aux) = memo_multi_state tr.stop in let actions = if tr.start.nums <> start.nums then begin let src,s_aux = memo_multi_state tr.start in Pebble_move(dest,d_aux,src,s_aux) :: actions end else begin let v = Cil.cvar_to_lvar count in let incr = Counter_incr (TVar v, TNoOffset) in let init = Pebble_init (dest, d_aux, v) in init::incr::actions end in { trans with cross = Normal(cond, actions) }) transitions in states, transitions end else states, transitions in (* For each intermediate state, add a transition to either the default state or a rejection state (in which we will stay until the end of the execution, while another branch might succeed in an acceptance state. )*) let needs_default = has_siblings && match transitions with | [] | [ _ ] -> false | _::_::_ -> true in Aorai_option.debug "Resulting transitions:@\n%a" (Pretty_utils.pp_list ~sep:"@\n" (fun fmt tr -> Format.fprintf fmt "%s -> %s:@[%a@]" tr.start.name tr.stop.name print_epsilon_trans tr.cross)) transitions; states, transitions, needs_default | Otherwise -> [],[], false (* treated directly by type_seq *) let add_reject_trans auto intermediate_states = let treat_one_state (states, trans) st = let my_trans = Path_analysis.get_transitions_of_state st auto in let reject_state = get_reject_state () in let states = add_if_needed states reject_state in let cond = List.fold_left (fun acc tr -> let cond,_ = tr.cross in let cond = change_bound_var tr.stop st cond in tor cond acc) TFalse my_trans in let cond = fst (Logic_simplification.simplifyCond (tnot cond)) in match cond with TFalse -> states,trans | _ -> Aorai_option.debug "Adding default transition %s -> %s: %a" st.name reject_state.name Promelaoutput.print_condition cond; states, new_trans st reject_state (cond,[]) :: trans in List.fold_left treat_one_state auto intermediate_states let propagate_epsilon_transitions (states, _ as auto) = let rec transitive_closure start (conds,actions) known_states curr = let known_states = curr :: known_states in let trans = Path_analysis.get_transitions_of_state curr auto in List.fold_left (fun acc tr -> match tr.cross with | Epsilon (cond,my_actions) -> Aorai_option.debug "Treating epsilon trans %s -> %s" curr.name tr.stop.name; if List.exists (fun st -> st.nums = tr.stop.nums) known_states then acc else transitive_closure start (tand cond conds, my_actions @ actions) known_states tr.stop @ acc | Normal (cond, action) -> Aorai_option.debug "Adding transition %s -> %s from epsilon trans" start.name tr.stop.name; new_trans start tr.stop (tand cond conds,action @ actions) ::acc) [] trans in let treat_one_state acc st = acc @ transitive_closure st (TTrue,[]) [] st in let trans = List.fold_left treat_one_state [] states in (states, trans) let add_default_trans (states, transitions as auto) otherwise = let add_one_trans acc tr = let st = tr.start in let my_trans = Path_analysis.get_transitions_of_state st auto in Aorai_option.debug "Considering new otherwise transition: %s -> %s" st.name tr.stop.name; let cond = List.fold_left (fun acc c -> let (cond,_) = c.cross in Aorai_option.debug "considering trans %s -> %s: %a" c.start.name c.stop.name Promelaoutput.print_condition cond; let neg = tnot cond in Aorai_option.debug "negation: %a" Promelaoutput.print_condition neg; Aorai_option.debug "acc: %a" Promelaoutput.print_condition acc; let res = tand acc (tnot cond) in Aorai_option.debug "partial result: %a" Promelaoutput.print_condition res; res ) TTrue my_trans in Aorai_option.debug "resulting transition: %a" Promelaoutput.print_condition cond; let cond,_ = Logic_simplification.simplifyCond cond in let new_trans = new_trans st tr.stop (cond,[]) in new_trans::acc in let transitions = List.fold_left add_one_trans transitions otherwise in states, transitions let type_cond_auto (st,tr as auto) = let otherwise = List.filter (fun t -> t.cross = Otherwise) tr in let add_if_needed acc st = if List.memq st acc then acc else st::acc in let type_trans (states,transitions,add_reject) tr = let (intermediate_states, trans, needs_reject) = type_trans auto [] tr in Aorai_option.debug "Considering parsed transition %s -> %s" tr.start.name tr.stop.name; Aorai_option.debug "Resulting transitions:@\n%a@\nEnd of transitions" (Pretty_utils.pp_list ~sep:"@\n" (fun fmt tr -> Format.fprintf fmt "%s -> %s: %a" tr.start.name tr.stop.name print_epsilon_trans tr.cross)) trans; let add_reject = if needs_reject then (List.filter (fun x -> not (Aorai_state.equal tr.start x || Aorai_state.equal tr.stop x)) intermediate_states) @ add_reject else add_reject in (List.fold_left add_if_needed states intermediate_states, transitions @ trans, add_reject) in let (states, trans, add_reject) = List.fold_left type_trans (st,[],[]) tr in let auto = propagate_epsilon_transitions (states, trans) in let auto = add_reject_trans auto add_reject in let (states, transitions as auto) = add_default_trans auto otherwise in (* nums (and in the past numt) are used as indices in arrays. Therefore, we must ensure that we use consecutive numbers starting from 0, or we'll have needlessly long arrays. *) let (states, transitions as auto) = match Reject_state.get_option () with | Some state -> (states, (new_trans state state (TTrue,[])):: transitions) | None -> auto in if Aorai_option.debug_atleast 1 then Promelaoutput.output_dot_automata auto "aorai_debug_typed.dot"; let (_,trans) = List.fold_left (fun (i,l as acc) t -> let cond, action = t.cross in let cond = fst (Logic_simplification.simplifyCond cond) in match cond with TFalse -> acc | _ -> (i+1,{ t with cross = (cond,action); numt = i } :: l)) (0,[]) transitions in let _, states = List.fold_left (fun (i,l as acc) s -> if List.exists (fun t -> t.start.nums = s.nums || t.stop.nums = s.nums) trans then begin s.nums <- i; (i+1, s :: l) end else acc) (0,[]) states in (List.rev states, List.rev trans) (** Stores the buchi automaton and its variables and functions as it is returned by the parsing *) let setAutomata auto = let auto = type_cond_auto auto in automata:=auto; check_states "typed automata"; if Aorai_option.debug_atleast 1 then Promelaoutput.output_dot_automata auto "aorai_debug_reduced.dot"; if (Array.length !cond_of_parametrizedTransitions) < (getNumberOfTransitions ()) then (* all transitions have a true parameterized guard, i.e. [[]] *) cond_of_parametrizedTransitions := Array.make (getNumberOfTransitions ()) [[]] let getState num = List.find (fun st -> st.nums = num) (fst !automata) let getStateName num = (getState num).name let getTransition num = List.find (fun trans -> trans.numt = num) (snd !automata) (** Initializes some tables according to data from Cil AST. *) let setCData () = let (f_decl,f_def) = Globals.Functions.fold (fun f (lf_decl,lf_def) -> let name = (Kernel_function.get_name f) in match f.fundec with | Definition _ -> (lf_decl,name::lf_def) | Declaration _ -> (name::lf_decl,lf_def)) ([],[]) in functions_from_c:=f_def; ignored_functions:=f_decl; variables_from_c:= Globals.Vars.fold (fun v _ lv -> Format.asprintf "%a" Cil_datatype.Varinfo.pretty v :: lv) [] (** Return the list of all function name observed in the C file, except ignored functions. *) let getFunctions_from_c () = (!functions_from_c) (** Return the list of all variables name observed in the C file. *) let getVariables_from_c () = (!variables_from_c) (** Return the list of names of all ignored functions. A function is ignored if it is used in C file and if its declaration is unavailable. *) let getIgnoredFunctions () = (!ignored_functions) (** Return the list of names of all ignored functions. A function is ignored if it is used in C file and if its declaration is unavailable. *) let addIgnoredFunction fname = ignored_functions:=fname::(!ignored_functions) (** Return true if and only if the given string fname denotes an ignored function. *) let isIgnoredFunction fname = List.exists (fun s -> (String.compare fname s)=0) (!ignored_functions) let is_reject_state state = match Reject_state.get_option () with None -> false | Some state' -> Aorai_state.equal state state' (* ************************************************************************* *) (* Table giving the varinfo structure associated to a given variable name *) (* In practice it contains all variables (from promela and globals from C file) and only variables *) let varinfos = Hashtbl.create 97 let paraminfos = Hashtbl.create 97 (* Add a new variable into the association table name -> varinfo *) let set_varinfo name vi = Hashtbl.add varinfos name vi (* Given a variable name, it returns its associated varinfo. If the variable is not found then an error message is print and an assert false is raised. *) let get_varinfo name = try Hashtbl.find varinfos name with Not_found -> raise_error ("Variable not declared ("^name^")") let get_logic_var name = let vi = get_varinfo name in Cil.cvar_to_lvar vi (* Same as get_varinfo, but the result is an option. Hence, if the variable is not found then None is return. *) let get_varinfo_option name = try Some(Hashtbl.find varinfos name) with | Not_found -> None (* Add a new param into the association table (funcname,paramname) -> varinfo *) let set_paraminfo funcname paramname vi = (* Aorai_option.log "Adding %s(...,%s,...) " funcname paramname; *) Hashtbl.add paraminfos (funcname,paramname) vi (* Given a function name and a param name, it returns the varinfo associated to the given param. If the variable is not found then an error message is print and an assert false is raised. *) let get_paraminfo funcname paramname = try Hashtbl.find paraminfos (funcname,paramname) with Not_found -> raise_error ("Parameter '"^paramname^"' not declared for function '"^funcname^"'.") (* Add a new param into the association table funcname -> varinfo *) let set_returninfo funcname vi = (* Aorai_option.log "Adding return %s(...) " funcname ; *) Hashtbl.add paraminfos (funcname,"\\return") vi (* Given a function name, it returns the varinfo associated to the given param. If the variable is not found then an error message is print and an assert false is raised. *) let get_returninfo funcname = try Hashtbl.find paraminfos (funcname,"\\return") with Not_found -> raise_error ("Return varinfo not declared for function '"^funcname^"'.") type range = | Fixed of int (** constant value *) | Interval of int * int (** range of values *) | Bounded of int * term (** range bounded by a logic term (depending on program parameter). *) | Unbounded of int (** only the lower bound is known, there is no upper bound *) module Range = Datatype.Make_with_collections (struct type t = range let name = "Data_for_aorai.Range" let rehash = Datatype.identity let structural_descr = Structural_descr.t_abstract let reprs = Fixed 0 :: Interval (0,1) :: Unbounded 0 :: List.map (fun x -> Bounded (0,x)) Cil_datatype.Term.reprs let equal = Datatype.from_compare let compare x y = match x,y with | Fixed c1, Fixed c2 -> Datatype.Int.compare c1 c2 | Fixed _, _ -> 1 | _, Fixed _ -> -1 | Interval (min1,max1), Interval(min2, max2) -> let c1 = Datatype.Int.compare min1 min2 in if c1 = 0 then Datatype.Int.compare max1 max2 else c1 | Interval _, _ -> 1 | _,Interval _ -> -1 | Bounded (min1,max1), Bounded(min2,max2) -> let c1 = Datatype.Int.compare min1 min2 in if c1 = 0 then Cil_datatype.Term.compare max1 max2 else c1 | Bounded _, _ -> 1 | _, Bounded _ -> -1 | Unbounded c1, Unbounded c2 -> Datatype.Int.compare c1 c2 let hash = function | Fixed c1 -> 2 * c1 | Interval(c1,c2) -> 3 * (c1 + c2) | Bounded (c1,c2) -> 5 * (c1 + Cil_datatype.Term.hash c2) | Unbounded c1 -> 7 * c1 let copy = function | Fixed c1 -> Fixed (Datatype.Int.copy c1) | Interval(c1,c2) -> Interval(Datatype.Int.copy c1, Datatype.Int.copy c2) | Bounded(c1,c2) -> Bounded(Datatype.Int.copy c1, Cil_datatype.Term.copy c2) | Unbounded c1 -> Unbounded (Datatype.Int.copy c1) let internal_pretty_code _ = Datatype.from_pretty_code let pretty fmt = function | Fixed c1 -> Format.fprintf fmt "%d" c1 | Interval (c1,c2) -> Format.fprintf fmt "@[<2>[%d..@;%d]@]" c1 c2 | Bounded(c1,c2) -> Format.fprintf fmt "@[<2>[%d..@;%a]@]" c1 Cil_datatype.Term.pretty c2 | Unbounded c1 -> Format.fprintf fmt "[%d..]" c1 let varname _ = "r" let mem_project = Datatype.never_any_project end) module Intervals = Cil_datatype.Term.Map.Make(Range) module Vals = Cil_datatype.Term.Map.Make(Intervals) (* If we have a bound for the number of iteration, the counter cannot grow more than bound (we go to a rejection state otherwise). *) let absolute_range loc min = let max = find_max_value loc in match max with | Some { term_node = TConst(Integer (t,_)) } -> Interval(min,Integer.to_int t) | Some x -> Bounded (min, Logic_const.term x.term_node x.term_type) | None -> Unbounded min let merge_range loc base r1 r2 = match r1,r2 with | Fixed c1, Fixed c2 when Datatype.Int.compare c1 c2 = 0 -> r1 | Fixed c1, Fixed c2 -> let min, max = if Datatype.Int.compare c1 c2 <= 0 then c1,c2 else c2,c1 in Interval (min,max) | Fixed c1, Interval(min,max) -> let min = if Datatype.Int.compare c1 min <= 0 then c1 else min in let max = if Datatype.Int.compare max c1 <= 0 then c1 else max in Interval (min,max) | Fixed c1, Bounded(min,_) -> let min = if Datatype.Int.compare c1 min <= 0 then c1 else min in Unbounded min | Fixed c1, Unbounded min -> let min = if Datatype.Int.compare c1 min <= 0 then c1 else min in Unbounded min | Interval(min,max), Fixed c -> if Datatype.Int.compare c min < 0 || Datatype.Int.compare c max > 0 then begin let min = if Datatype.Int.compare c min < 0 then c else min in if Cil.isLogicZero base then absolute_range loc min else Unbounded min end else r1 | Interval(min1,max1), Interval(min2,max2) -> if Datatype.Int.compare min2 min1 < 0 || Datatype.Int.compare max2 max1 > 0 then begin let min = if Datatype.Int.compare min2 min1 < 0 then min2 else min1 in if Cil.isLogicZero base then absolute_range loc min else Unbounded min end else r1 | Interval(min1,_), (Bounded(min2,_) | Unbounded min2)-> let min = if Datatype.Int.compare min1 min2 <= 0 then min1 else min2 in Unbounded min | Bounded(min1,max1), Bounded(min2,max2) when Cil_datatype.Term.equal max1 max2 -> let min = if Datatype.Int.compare min2 min1 < 0 then min2 else min1 in Bounded(min,max1) | Bounded(min1,_), (Fixed min2 | Interval(min2,_) | Bounded (min2,_) | Unbounded min2) -> let min = if Datatype.Int.compare min2 min1 < 0 then min2 else min1 in Unbounded min | Unbounded min1, (Fixed min2 | Interval(min2,_) | Bounded (min2,_) | Unbounded min2) -> let min = if Datatype.Int.compare min2 min1 < 0 then min2 else min1 in Unbounded min let tlval lv = Logic_const.term (TLval lv) (Cil.typeOfTermLval lv) let included_range range1 range2 = match range1, range2 with | Fixed c1, Fixed c2 -> Datatype.Int.equal c1 c2 | Fixed c, Interval(l,h) -> Datatype.Int.compare l c <= 0 && Datatype.Int.compare c h <= 0 | Fixed _, Bounded _ -> false | Fixed c1, Unbounded c2 -> Datatype.Int.compare c1 c2 >= 0 | Interval (l1,h1), Interval(l2,h2) -> Datatype.Int.compare l1 l2 >= 0 && Datatype.Int.compare h1 h2 <= 0 | Interval (l1,_), Unbounded l2 -> Datatype.Int.compare l1 l2 >= 0 | Interval _, (Fixed _ | Bounded _ ) -> false | Bounded _, (Fixed _ | Interval _) -> false | Bounded(l1,h1), Bounded(l2,h2) -> Datatype.Int.compare l1 l2 >= 0 && Cil_datatype.Term.equal h1 h2 | Bounded(l1,_), Unbounded l2 -> Datatype.Int.compare l1 l2 <= 0 | Unbounded l1, Unbounded l2 -> Datatype.Int.compare l1 l2 <= 0 | Unbounded _, (Fixed _ | Interval _ | Bounded _) -> false let unchanged loc = Cil_datatype.Term.Map.add loc (Fixed 0) Cil_datatype.Term.Map.empty let merge_bindings tbl1 tbl2 = let merge_range loc = Extlib.merge_opt (merge_range loc) in let merge_vals loc tbl1 tbl2 = match tbl1, tbl2 with | None, None -> None | Some tbl, None | None, Some tbl -> Some (Cil_datatype.Term.Map.merge (merge_range loc) tbl (unchanged loc)) | Some tbl1, Some tbl2 -> Some (Cil_datatype.Term.Map.merge (merge_range loc) tbl1 tbl2) in Cil_datatype.Term.Map.merge merge_vals tbl1 tbl2 module End_state = Aorai_state.Map.Make(Datatype.Triple(Aorai_state.Set)(Aorai_state.Set)(Vals)) type end_state = End_state.t (** The data associated to each statement: We have a mapping from each possible state at the entrance to the function (before actual transition) to the current state possibles, associated to any action that has occurred on that path. *) module Case_state = Aorai_state.Map.Make(End_state) type state = Case_state.t let pretty_end_state start fmt tbl = Aorai_state.Map.iter (fun stop (fst,last, actions) -> Format.fprintf fmt "Possible path from %s to %s@\n Initial trans:@\n" start.Promelaast.name stop.Promelaast.name; Aorai_state.Set.iter (fun state -> Format.fprintf fmt " %s -> %s@\n" start.Promelaast.name state.Promelaast.name) fst; Format.fprintf fmt " Final trans:@\n"; Aorai_state.Set.iter (fun state -> Format.fprintf fmt " %s -> %s@\n" state.Promelaast.name stop.Promelaast.name) last; Format.fprintf fmt " Related actions:@\n"; Cil_datatype.Term.Map.iter (fun loc tbl -> Cil_datatype.Term.Map.iter (fun base itv -> Format.fprintf fmt " %a <- %a + %a@\n" Cil_datatype.Term.pretty loc Cil_datatype.Term.pretty base Range.pretty itv) tbl) actions) tbl let pretty_state fmt cases = Aorai_state.Map.iter (fun start tbl -> pretty_end_state start fmt tbl) cases let included_state tbl1 tbl2 = try Aorai_state.Map.iter (fun s1 tbl1 -> let tbl2 = Aorai_state.Map.find s1 tbl2 in Aorai_state.Map.iter (fun s2 (fst1, last1, tbl1) -> let (fst2, last2, tbl2) = Aorai_state.Map.find s2 tbl2 in if not (Aorai_state.Set.subset fst1 fst2) || not (Aorai_state.Set.subset last1 last2) then raise Not_found; Cil_datatype.Term.Map.iter (fun base bindings1 -> let bindings2 = Cil_datatype.Term.Map.find base tbl2 in Cil_datatype.Term.Map.iter (fun loc range1 -> let range2 = Cil_datatype.Term.Map.find loc bindings2 in if not (included_range range1 range2) then raise Not_found) bindings1) tbl1) tbl1) tbl1; true with Not_found -> false let merge_end_state tbl1 tbl2 = let merge_stop_state _ (fst1, last1, tbl1) (fst2, last2, tbl2) = let fst = Aorai_state.Set.union fst1 fst2 in let last = Aorai_state.Set.union last1 last2 in let tbl = merge_bindings tbl1 tbl2 in (fst, last, tbl) in Aorai_state.Map.merge (Extlib.merge_opt merge_stop_state) tbl1 tbl2 let merge_state tbl1 tbl2 = let merge_state _ = merge_end_state in Aorai_state.Map.merge (Extlib.merge_opt merge_state) tbl1 tbl2 module Pre_state = Kernel_function.Make_Table (Case_state) (struct let name = "Data_for_aorai.Pre_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_kf_init_state kf state = let change old_state = merge_state old_state state in let set _ = state in ignore (Pre_state.memo ~change set kf) let dkey = Aorai_option.register_category "dataflow" let replace_kf_init_state kf state = Aorai_option.debug ~dkey "Replacing pre-state of %a:@\n @[%a@]" Kernel_function.pretty kf pretty_state state; Pre_state.replace kf state let get_kf_init_state kf = try Pre_state.find kf with Not_found -> Aorai_state.Map.empty module Post_state = Kernel_function.Make_Table (Case_state) (struct let name = "Data_for_aorai.Post_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_kf_return_state kf state = let change old_state = merge_state old_state state in let set _ = state in ignore (Post_state.memo ~change set kf) let replace_kf_return_state = Post_state.replace let get_kf_return_state kf = try Post_state.find kf with Not_found -> Aorai_state.Map.empty module Loop_init_state = State_builder.Hashtbl (Cil_datatype.Stmt.Hashtbl) (Case_state) (struct let name = "Data_for_aorai.Loop_init_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_loop_init_state stmt state = let change old_state = merge_state old_state state in let set _ = state in ignore (Loop_init_state.memo ~change set stmt) let replace_loop_init_state = Loop_init_state.replace let get_loop_init_state stmt = try Loop_init_state.find stmt with Not_found -> Aorai_state.Map.empty module Loop_invariant_state = State_builder.Hashtbl (Cil_datatype.Stmt.Hashtbl) (Case_state) (struct let name = "Data_for_aorai.Loop_invariant_state" let dependencies = [ Ast.self; Aorai_option.Ya.self; Aorai_option.Ltl_File.self; Aorai_option.To_Buchi.self; Aorai_option.Deterministic.self ] let size = 17 end) let set_loop_invariant_state stmt state = let change old_state = merge_state old_state state in let set _ = state in ignore (Loop_invariant_state.memo ~change set stmt) let replace_loop_invariant_state = Loop_invariant_state.replace let get_loop_invariant_state stmt = try Loop_invariant_state.find stmt with Not_found -> Aorai_state.Map.empty let pretty_pre_state fmt = Pre_state.iter (fun kf state -> Format.fprintf fmt "Function %a:@\n @[%a@]@\n" Kernel_function.pretty kf pretty_state state) let pretty_post_state fmt = Post_state.iter (fun kf state -> Format.fprintf fmt "Function %a:@\n @[%a@]@\n" Kernel_function.pretty kf pretty_state state) let pretty_loop_init fmt = Loop_init_state.iter (fun stmt state -> let kf = Kernel_function.find_englobing_kf stmt in Format.fprintf fmt "Function %a, sid %d:@\n @[%a@]@\n" Kernel_function.pretty kf stmt.sid pretty_state state) let pretty_loop_invariant fmt = Loop_invariant_state.iter (fun stmt state -> let kf = Kernel_function.find_englobing_kf stmt in Format.fprintf fmt "Function %a, sid %d:@\n @[%a@]@\n" Kernel_function.pretty kf stmt.sid pretty_state state) let debug_computed_state ?(dkey=dkey) () = Aorai_option.debug ~dkey "Computed state:@\nPre-states:@\n @[%t@]@\nPost-states:@\n @[%t@]@\n\ Loop init:@\n @[%t@]@\nLoop invariants:@\n @[%t@]" pretty_pre_state pretty_post_state pretty_loop_init pretty_loop_invariant (* ************************************************************************* *) let removeUnusedTransitionsAndStates () = (* Step 1 : computation of reached states and crossed transitions *) let treat_one_state state map set = Aorai_state.Map.fold (fun state (fst, last, _) set -> Aorai_state.Set.add state (Aorai_state.Set.union last (Aorai_state.Set.union fst set))) map (Aorai_state.Set.add state set) in let reached _ state set = Aorai_state.Map.fold treat_one_state state set in let init = Path_analysis.get_init_states (getAutomata ()) in let reached_states = Pre_state.fold reached (Aorai_state.Set.of_list init) in let reached_states = Post_state.fold reached reached_states in let reached_states = Loop_init_state.fold reached reached_states in let reached_states = Loop_invariant_state.fold reached reached_states in if Aorai_state.Set.is_empty reached_states then raise Empty_automaton; (* Step 2 : computation of translation tables *) let state_list = List.sort (fun x y -> Datatype.String.compare x.Promelaast.name y.Promelaast.name) (Aorai_state.Set.elements reached_states) in let (_, translate_table) = List.fold_left (fun (i,map) x -> let map = Aorai_state.Map.add x { x with nums = i } map in (i+1,map)) (0,Aorai_state.Map.empty) state_list in let new_state s = Aorai_state.Map.find s translate_table in let (_, trans_list) = List.fold_left (fun (i,list as acc) trans -> try let new_start = new_state trans.start in let new_stop = new_state trans.stop in (i+1, { trans with start = new_start; stop = new_stop; numt = i } :: list) with Not_found -> acc) (0,[]) (snd (getAutomata())) in let state_list = List.map new_state state_list in Reject_state.may (fun reject_state -> try let new_reject = Aorai_state.Map.find reject_state translate_table in Reject_state.set new_reject with Not_found -> Reject_state.clear ()); (* Step 3 : rewriting stored information *) automata:= (state_list,trans_list); check_states "reduced automata"; let rewrite_state state = let rewrite_set set = Aorai_state.Set.fold (fun s set -> Aorai_state.Set.add (new_state s) set) set Aorai_state.Set.empty in let rewrite_bindings (fst_states, last_states, bindings) = (rewrite_set fst_states, rewrite_set last_states, bindings) in let rewrite_curr_state s bindings acc = let new_s = new_state s in let bindings = rewrite_bindings bindings in Aorai_state.Map.add new_s bindings acc in let rewrite_one_state s map acc = let new_s = new_state s in let new_map = Aorai_state.Map.fold rewrite_curr_state map Aorai_state.Map.empty in Aorai_state.Map.add new_s new_map acc in Aorai_state.Map.fold rewrite_one_state state Aorai_state.Map.empty in Pre_state.iter (fun kf state -> Pre_state.replace kf (rewrite_state state)); Post_state.iter (fun kf state -> Post_state.replace kf (rewrite_state state)); Loop_init_state.iter (fun s state -> Loop_init_state.replace s (rewrite_state state)); Loop_invariant_state.iter (fun s state -> Loop_invariant_state.replace s (rewrite_state state)) (* ************************************************************************* *) (* Given the name of a function, it return the name of the associated element in the operation list. *) let func_to_op_func f = "op_"^f let used_enuminfo = Hashtbl.create 2 let set_usedinfo name einfo = Hashtbl.add used_enuminfo name einfo let get_usedinfo name = try Hashtbl.find used_enuminfo name with Not_found -> raise_error ("Incomplete enum information.") let get_cenum_option name = let opnamed = func_to_op_func name in Hashtbl.fold (fun _ ei value -> match value with | Some(_) as r -> r (* Already found *) | None -> let rec search = function | {einame = n} as ei ::_ when n=name -> Some(CEnum ei) | {einame = n} as ei ::_ when n=opnamed -> Some(CEnum ei) | _::l -> search l | [] -> None in search ei.eitems ) used_enuminfo None let func_enum_type () = try TEnum(Hashtbl.find used_enuminfo listOp,[]) with Not_found -> Aorai_option.fatal "Enum type indicating current function (%s) is unknown" listOp let status_enum_type () = try TEnum(Hashtbl.find used_enuminfo listStatus,[]) with Not_found -> Aorai_option.fatal "Enum type indicating current event (%s) is unknown" listStatus let func_to_cenum func = try let ei = Hashtbl.find used_enuminfo listOp in let name = func_to_op_func func in let rec search = function | {einame = n} as ei ::_ when n=name -> CEnum ei | _::l -> search l | [] -> raise_error ("Operation '"^name^"' not found in operations enumeration") in search ei.eitems (* CEnum(ex,s,ei)*) with Not_found -> raise_error ("Operation not found") let op_status_to_cenum status = try let ei = Hashtbl.find used_enuminfo listStatus in let name = if status = Promelaast.Call then callStatus else termStatus in let rec search = function | {einame=n} as ei ::_ when n=name -> CEnum ei | _::l -> search l | [] -> raise_error ("Status not found") in search ei.eitems with Not_found -> raise_error ("Status not found") (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/data_for_aorai.mli0000666000000000000000000003752313571573400020225 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Promelaast (** Module of data management used in all the plugin Aorai. Operations are mainly accessors for data. The use of this module is mainly done through the ltl_utils module. *) (** raised when simplifications make the resulting automaton empty, meaning that the code and the property do not match. *) exception Empty_automaton (* ************************************************************************* *) (** {2 LTL/Promela primitives} *) (* ************************************************************************* *) (** Here are some operations used for generation of LTL AST or Promela AST. *) module Aorai_state: Datatype.S_with_collections with type t = Promelaast.state module Aorai_typed_trans: Datatype.S_with_collections with type t = (Promelaast.typed_condition * Promelaast.action) Promelaast.trans (** Initializes some tables according to data from Cil AST. *) val setCData : unit -> unit (** *) val add_logic : string -> Cil_types.logic_info -> unit (** *) val get_logic : string -> Cil_types.logic_info (** *) val add_predicate : string -> Cil_types.logic_info -> unit (** *) val get_predicate : string -> Cil_types.logic_info (** Given a logic info representing a set of pebbles and a label, returns the term corresponding to evaluating the set at the label. *) val pebble_set_at: Cil_types.logic_info -> Cil_types.logic_label -> Cil_types.term (** Global auxiliary variables generated during type-checking of transitions *) val aux_variables: unit -> Cil_types.varinfo list (** Global logic info generated during type-checking (mostly encoding of ghost variables having a logic type) *) val abstract_logic_info: unit -> Cil_types.logic_info list (** {2 Smart constructors for conditions} *) (**/**) val pand: condition -> condition -> condition val por: condition -> condition -> condition val pnot: condition -> condition val cst_one: expression val cst_zero: expression (** {2 Utilities for parsed_conditions } *) (** [true] iff the expression is 1 *) val is_cst_one: expression -> bool val is_cst_zero: expression -> bool (** [true] if the element is not repeating itself ([min_rep = max_rep = 1]) *) val is_single: seq_elt -> bool (* ************************************************************************* *) (**{b Constants} Some constant names used for generation. *) (** Returns a string guaranteed not to clash with C/ACSL keywords or an existing global. @since Nitrogen-20111001 *) val get_fresh: string -> string (* Logic variables *) (** Name of TransStart logic generated variable *) val transStart : string (** Name of transStop logic generated variable *) val transStop : string (** Name of transCond logic generated variable *) val transCond : string (** Name of transCondP logic generated variable *) val transCondP : string (** Name of the fresh loopInit logic generated variable *) val loopInit : string (** C variables *) (** Name of curOp C generated variable (Name of the current operation) *) val curOp : string (** Name of curOpStatus C generated variable (Status Return or Call of the current operation) *) val curOpStatus : string (** Name of curState C generated variable (Table of states that can be synchronized with the program) *) val curState : string (** Name of curStateOld C generated variable (Last value of curState) *) val curStateOld : string (** Name of curTrans C generated variable (Last transitions that can be crossed) *) val curTrans : string (*val curTransTmp : string DEPRECATED *) (** Name of acceptSt C generated variable (List of acceptation States) *) val acceptSt : string (* C constants #define -- DEPRECATED ?*) (** DEPRECATED ?*) val nbOp : string (** DEPRECATED ?*) val nbAcceptSt : string (** DEPRECATED ?*) val nbTrans : string (* C Macros *) (** DEPRECATED ?*) val macro_ligth : string (** DEPRECATED ?*) val macro_full : string (** DEPRECATED ?*) val macro_pure : string (** returns the C variable associated to a given state (non-deterministic mode only). *) val get_state_var: state -> varinfo (** returns the logic variable associated to a given state. (non-deterministic mode only). *) val get_state_logic_var: state -> logic_var (* C enumeration *) (** Name of listOp C generated enumeration (List of operation names prefixed with 'op_') *) val listOp : string (** Name of listStatus C generated enumeration (Status are Call or Return) *) val listStatus : string (** Name of callStatus C generated enumeration (Name of the Call status) *) val callStatus : string (** Name of termStatus C generated enumeration (Name of the return status) *) val termStatus : string (** Name of the enum type representing states *) val states : string (* C function -- DEPRECATED *) (** DEPRECATED ?*) val buch_sync : string (* ************************************************************************* *) (**{b Buchi automata management}*) val new_state: string -> state val new_trans: state -> state -> 'a -> 'a trans (** Return the buchi automata as stored after parsing *) val getAutomata : unit -> Promelaast.typed_automaton (** Type-checks the parsed automaton and stores the result. This might introduce new global variables in case of sequences. *) val setAutomata: Promelaast.parsed_automaton -> unit (** return the number of transitions of the automata *) val getNumberOfTransitions : unit -> int (** return the number of states of the automata *) val getNumberOfStates : unit -> int (** Return the list of all function name observed in the C file. *) val getFunctions_from_c : unit -> string list (** Return the list of all variables name observed in the C file. *) val getVariables_from_c : unit -> string list (** Return the list of names of all ignored functions. A function is ignored if it is used in C file and if its declaration is unavailable. *) val getIgnoredFunctions : unit -> string list (** Return the list of names of all ignored functions. A function is ignored if it is used in C file and if its declaration is unavailable. *) val addIgnoredFunction : string -> unit (** Return true if and only if the given string fname denotes an ignored function. *) val isIgnoredFunction : string -> bool (** returns the state of given index. @since Nitrogen-20111001 *) val getState: int -> Promelaast.state val getStateName : int -> string (** [true] iff the given state is the rejection state for automaton with sequences. *) val is_reject_state: state -> bool (** returns the transition having the corresponding id. @raise Not_found if this is not the case. *) val getTransition: int -> (Promelaast.typed_condition * Promelaast.action) Promelaast.trans (* ************************************************************************* *) (**{b Variables information} Usually it seems very useful to access to varinfo structure of a variable by using only its name. These functions allow that. In practice it contains all variables (from promela and globals from C file) and only variables. *) (** Add a new variable into the association table name -> varinfo *) val set_varinfo : string -> Cil_types.varinfo -> unit (** Given a variable name, it returns its associated varinfo. If the variable is not found then an error message is print and an assert false is raised. *) val get_varinfo : string -> Cil_types.varinfo (** Same as get_varinfo, but the result is an option. Hence, if the variable is not found then None is return. *) val get_varinfo_option : string -> Cil_types.varinfo option (** get the logic variable corresponding to its C counterpart. @since Nitrogen-20111001 *) val get_logic_var: string -> Cil_types.logic_var (** Add a new param into the association table (funcname,paramname) -> varinfo *) val set_paraminfo : string -> string -> Cil_types.varinfo -> unit (** Given a function name and a param name, it returns the varinfo associated to the given param. If the variable is not found then an error message is print and an assert false is raised. *) val get_paraminfo : string -> string -> Cil_types.varinfo (** Add a new param into the association table (funcname,paramname) -> varinfo *) val set_returninfo : string -> Cil_types.varinfo -> unit (** Given a function name and a param name, it returns the varinfo associated to the given param. If the variable is not found then an error message is print and an assert false is raised. *) val get_returninfo : string -> Cil_types.varinfo (** Given the representation of an auxiliary counter (found in a {!Promelaast.Counter_incr}), returns the maximal value that it can take according to the automaton. *) val find_max_value: Cil_types.term -> Cil_types.term option (** information we have about the range of values that an auxiliary variable can take. *) type range = | Fixed of int (** constant value *) | Interval of int * int (** range of values *) | Bounded of int * Cil_types.term (** range bounded by a logic term (depending on program parameter). *) | Unbounded of int (** only the lower bound is known, there is no upper bound *) module Range: Datatype.S_with_collections with type t = range module Intervals: Datatype.S with type t = range Cil_datatype.Term.Map.t module Vals: Datatype.S with type t = Intervals.t Cil_datatype.Term.Map.t (** Given a term and a minimal value, returns the absolute range of variation of the corresponding auxiliary variable, depending on its usage in the instrumentation of the code. *) val absolute_range: Cil_types.term -> int -> Range.t (** Given an auxiliary variable, a base for its variations and two ranges of variations, returns a range that encompasses both. *) val merge_range: Cil_types.term -> Cil_types.term -> Range.t -> Range.t -> Range.t (** {2 Dataflow analysis} *) val tlval: Cil_types.term_lval -> Cil_types.term (** The propagated state: Mapping from possible start states to reachable states, with - set of states for the initial transition leading to the corresponding reachable state. - set of states for the last transition. - possible values for intermediate variables. *) type end_state = (Aorai_state.Set.t * Aorai_state.Set.t * Vals.t) Aorai_state.Map.t module Case_state: Datatype.S with type t = end_state Aorai_state.Map.t type state = Case_state.t val pretty_end_state: Aorai_state.t -> Format.formatter -> end_state -> unit val pretty_state: Format.formatter -> state -> unit (** [included_state st1 st2] is [true] iff [st1] is included in [st2], i.e: - possible start states of [st1] are included in [st2] - for each possible start state, reachable states in [st1] are included in the one of [st2] - for each possible path in [st1], range of possible values for intermediate variables are included in the corresponding one in [st2]. *) val included_state: state -> state -> bool (** merges two sets of possible bindings for aux variables *) val merge_bindings: Vals.t -> Vals.t -> Vals.t val merge_end_state: end_state -> end_state -> end_state (** Merges two state: union of possible start states, of possible paths, and merge of ranges of possible values. *) val merge_state: state -> state -> state (** Register a new init state for kernel function. If there is already an init state registered, the new one is merged with the old. *) val set_kf_init_state: Kernel_function.t -> state -> unit (** Register a new end state for kernel function. If there is already an end state registered, the new one is merged with the old. *) val set_kf_return_state: Kernel_function.t -> state -> unit (** sets the initial state when entering a loop (merging it if a state is already present. *) val set_loop_init_state: Cil_types.stmt -> state -> unit (** sets the invariant of a loop. *) val set_loop_invariant_state: Cil_types.stmt -> state -> unit val replace_kf_init_state: Kernel_function.t -> state -> unit val replace_kf_return_state: Kernel_function.t -> state -> unit val replace_loop_init_state: Cil_types.stmt -> state -> unit val replace_loop_invariant_state: Cil_types.stmt -> state -> unit val get_kf_init_state: Kernel_function.t -> state val get_kf_return_state: Kernel_function.t -> state val get_loop_init_state: Cil_types.stmt -> state val get_loop_invariant_state: Cil_types.stmt -> state val debug_computed_state: ?dkey:Aorai_option.category -> unit -> unit (** Pretty-prints all computed states. Default key is dataflow. *) (* ************************************************************************* *) (**{b Enumeration management}*) (** Given the name of an enumeration element, this function returns the associated cenum structure. This function is not efficient. Thus if the enumeration is known it is recommended to use one of the following functions.*) val get_cenum_option : string -> Cil_types.constant option val func_enum_type: unit -> Cil_types.typ val status_enum_type: unit -> Cil_types.typ (** Given the name of a C operation, this function returns the associated cenum structure. *) val func_to_cenum : string -> Cil_types.constant (** Given the name of a C operation status (Call or Return), this function returns the associated cenum structure. *) val op_status_to_cenum : Promelaast.funcStatus -> Cil_types.constant (** Given the name of a function, it return the name of the associated element in the operation list. *) val func_to_op_func : string -> string (** These functions are direct accesses to the table memorizing the enuminfo data associated to the name of an enumeration structure, from which cenum info are computed.*) val set_usedinfo : string -> Cil_types.enuminfo -> unit (** These functions are direct accesses to the table memorizing the enuminfo data associated to the name of an enumeration structure, from which cenum info are computed.*) val get_usedinfo : string -> Cil_types.enuminfo (** Simplify the automaton by removing transitions and states that are never active during an execution of the program. @raise Empty_automaton if the simplification result in an empty automaton. *) val removeUnusedTransitionsAndStates : unit -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/logic_simplification.ml0000666000000000000000000004214413571573400021304 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Promelaast let pretty_clause fmt l = Format.fprintf fmt "@[<2>[%a@]]@\n" (Pretty_utils.pp_list ~sep:",@ " Promelaoutput.print_condition) l let pretty_dnf fmt l = Format.fprintf fmt "@[<2>[%a@]]@\n" (Pretty_utils.pp_list pretty_clause) l let opposite_rel = function | Rlt -> Rge | Rgt -> Rle | Rge -> Rlt | Rle -> Rgt | Req -> Rneq | Rneq -> Req let rec condToDNF cond = (*Typing : condition --> list of list of terms (disjunction of conjunction of terms) DNF(term) = {{term}} DNF(a or b) = DNF(a) \/ DNF(b) DNF(a and b) = Composition (DNF(a),DNF(b)) DNF(not a) = tmp = DNF(a) composition (tmp) negation of each term *) match cond with | TOr (c1, c2) -> (condToDNF c1)@(condToDNF c2) | TAnd (c1, c2) -> let d1,d2=(condToDNF c1), (condToDNF c2) in List.rev (List.fold_left (fun lclause clauses1 -> (List.map (fun clauses2 -> clauses1@clauses2) d2) @ lclause ) [] d1) | TNot (c) -> begin match c with | TOr (c1, c2) -> condToDNF (TAnd(TNot(c1),TNot(c2))) | TAnd (c1, c2) -> condToDNF (TOr (TNot(c1),TNot(c2))) | TNot (c1) -> condToDNF c1 | TTrue -> condToDNF TFalse | TFalse -> condToDNF TTrue | TRel(rel,t1,t2) -> [[TRel(opposite_rel rel,t1,t2)]] | _ as t -> [[TNot(t)]] end | TTrue -> [[TTrue]] | TFalse -> [] | _ as t -> [[t]] let removeTerm term lterm = List.fold_left (fun treated t -> match term,t with | TCall (kf1,None), TCall (kf2,_) | TReturn kf1, TReturn kf2 when Kernel_function.equal kf1 kf2 -> treated | TCall(kf1,Some b1), TCall(kf2, Some b2) when Kernel_function.equal kf1 kf2 && Datatype.String.equal b1.b_name b2.b_name -> treated | _ -> t::treated) [] lterm (** Given a list of terms (representing a conjunction), if a positive call or return is present, then all negative ones are obvious and removed *) let positiveCallOrRet clause = try (* Step 1: find a positive information TCall or TReturn. *) let positive, computePositive= List.fold_left (fun (positive,treated as res) term -> match term with | TCall (kf1,None) -> begin match positive with | None -> (Some term, term::treated) | Some (TCall (kf2,None)) -> if Kernel_function.equal kf1 kf2 then res else raise Exit | Some (TReturn _) -> raise Exit | Some(TCall (kf2,Some _) as term2) -> if Kernel_function.equal kf1 kf2 then Some term, term :: removeTerm term2 treated else raise Exit | _ -> Aorai_option.fatal "inconsistent environment in positiveCallOrRet" end | TCall (kf1, Some b1) -> begin match positive with | None -> (Some term, term::treated) | Some (TCall (kf2,None)) -> if Kernel_function.equal kf1 kf2 then res else raise Exit | Some (TReturn _) -> raise Exit | Some(TCall (kf2,Some b2)) -> if Kernel_function.equal kf1 kf2 then if Datatype.String.equal b1.b_name b2.b_name then res else positive, term :: treated else raise Exit | _ -> Aorai_option.fatal "inconsistent environment in positiveCallOrRet" end | TReturn kf1 -> begin match positive with | None -> (Some term, term::treated) | Some (TReturn kf2) -> if Kernel_function.equal kf1 kf2 then res else raise Exit | Some (TCall _) -> raise Exit | _ -> Aorai_option.fatal "inconsistent environment in positiveCallOrRet" end | _ -> positive, term::treated ) (None, []) clause in let computePositive = List.rev computePositive in (* Step 2 : Remove negatives not enough expressive *) match positive with | None -> computePositive | Some (TCall (kf1,None)) -> List.rev (List.fold_left (fun treated term -> match term with | TNot(TCall (kf2,_)) -> if Kernel_function.equal kf1 kf2 then raise Exit (* Positive information more specific than negative *) else treated | TNot(TReturn _) -> treated | _ -> term::treated ) [] computePositive) | Some (TCall (kf1, Some b1)) -> List.rev (List.fold_left (fun treated term -> match term with | TNot(TCall (kf2,None)) -> if Kernel_function.equal kf1 kf2 then raise Exit (* Positive information more specific than negative *) else treated | TNot(TCall(kf2, Some b2)) -> if Kernel_function.equal kf1 kf2 then if Datatype.String.equal b1.b_name b2.b_name then raise Exit else term :: treated else treated | TNot(TReturn _) -> treated | _ -> term::treated ) [] computePositive) | Some (TReturn kf1) -> List.rev (List.fold_left (fun treated term -> match term with | TNot(TCall _) -> treated | TNot(TReturn kf2) -> (* Two opposite information *) if Kernel_function.equal kf1 kf2 then raise Exit else treated | _ -> term::treated ) [] computePositive) | _ -> Aorai_option.fatal "inconsistent environment in positiveCallOrRet" with Exit -> [TFalse] (* contradictory requirements for current event. *) let rel_are_equals (rel1,t11,t12) (rel2,t21,t22) = rel1 = rel2 && Logic_utils.is_same_term t11 t21 && Logic_utils.is_same_term t12 t22 let swap_rel (rel,t1,t2) = let rel = match rel with | Rlt -> Rgt | Rle -> Rge | Rge -> Rle | Rgt -> Rlt | Req -> Req | Rneq -> Rneq in (rel,t2,t1) let contradict_rel r1 (rel2,t21,t22) = rel_are_equals r1 (opposite_rel rel2, t21,t22) || rel_are_equals (swap_rel r1) (opposite_rel rel2, t21, t22) let rec termsAreEqual term1 term2 = match term1,term2 with | TTrue,TTrue | TFalse,TFalse -> true | TCall (a,None), TCall (b,None) | TReturn a, TReturn b -> Kernel_function.equal a b | TCall (f1,Some b1), TCall(f2, Some b2) -> Kernel_function.equal f1 f2 && Datatype.String.equal b1.b_name b2.b_name | TNot(TRel(rel1,t11,t12)), TRel(rel2,t21,t22) | TRel(rel1,t11,t12), TNot(TRel(rel2,t21,t22)) -> contradict_rel (rel1,t11,t12) (rel2,t21,t22) | TNot(a),TNot(b) -> termsAreEqual a b | TRel(rel1,t11,t12), TRel(rel2,t21,t22) -> rel_are_equals (rel1,t11,t12) (rel2,t21,t22) | _ -> false let negative_term term = match term with | TNot(c) -> c | TCall _ | TReturn _ | TRel _ -> TNot term | TTrue -> TFalse | TFalse -> TTrue | TAnd (_,_) | TOr (_,_) -> Aorai_option.fatal "not a term of DNF clause" (** Simplify redundant relations. *) let simplify clause = try List.rev (List.fold_left (fun clause term -> match term with | TTrue | TNot(TFalse) -> clause | TFalse | TNot(TTrue) -> raise Exit | _ -> if List.exists (termsAreEqual (negative_term term)) clause then raise Exit; if List.exists (termsAreEqual term) clause then clause else term :: clause) [] clause) with Exit -> [TFalse] (** true iff clause1 <: clause2*) let clausesAreSubSetEq clause1 clause2 = (List.for_all (fun t1 ->List.exists ( fun t2 -> termsAreEqual t1 t2) clause2) clause1) (** true iff clause1 <: clause2 and clause2 <: clause1 *) let clausesAreEqual clause1 clause2 = clausesAreSubSetEq clause1 clause2 && clausesAreSubSetEq clause2 clause1 (** return the clauses list named lclauses without any clause c such as cl <: c *) let removeClause lclauses cl = List.filter (fun c -> not (clausesAreSubSetEq cl c)) lclauses (* Obvious version. *) let negativeClause clause = List.map negative_term clause let simplifyClauses clauses = try List.rev (List.fold_left (fun acc c -> (* If 2 clauses are C and not C then their disjunction implies true *) if List.exists (clausesAreEqual (negativeClause c)) acc then raise Exit (* If an observed clause c2 is included inside the current clause then the current is not added *) else if (List.exists (fun c2 -> clausesAreSubSetEq c2 c) acc) then acc (* If the current clause is included inside an observed clause c2 then the current is added and c2 is removed *) else if (List.exists (fun c2 -> clausesAreSubSetEq c c2) acc) then c::(removeClause acc c) (* If no simplification then c is add to the list *) else c::acc ) [] clauses) with Exit -> [[]] let tor t1 t2 = match t1,t2 with TTrue,_ | _,TTrue -> TTrue | TFalse,t | t,TFalse -> t | _,_ -> TOr(t1,t2) let tand t1 t2 = match t1,t2 with TTrue,t | t,TTrue -> t | TFalse,_ | _,TFalse -> TFalse | _,_ -> TAnd(t1,t2) let has_result t = let module M = struct exception Has_result end in let vis = object inherit Visitor.frama_c_inplace method! vterm_lhost = function | TResult _ -> raise M.Has_result | _ -> Cil.DoChildren end in try ignore (Visitor.visitFramacTerm vis t); false with M.Has_result -> true let rec tnot t = match t with | TTrue -> TFalse | TFalse -> TTrue | TNot t -> t (* If relation uses \result, keep information about which function is returning close to it. *) | TAnd ((TReturn _ as t1), (TRel (_,op1,op2) as t2)) when has_result op1 || has_result op2 -> TOr (tnot t1, TAnd (t1, tnot t2)) | TAnd (t1,t2) -> TOr(tnot t1, tnot t2) | TOr (t1,t2) -> TAnd(tnot t1, tnot t2) | TRel(rel,t1,t2) -> TRel(opposite_rel rel, t1, t2) | TCall _ | TReturn _ -> TNot t let tands l = List.fold_right tand l TTrue let tors l = List.fold_right tor l TFalse (** Given a DNF condition, it returns a condition in Promelaast.condition form. WARNING : empty lists not supported *) let dnfToCond d = tors (List.map tands d) let simplClause clause dnf = match clause with | [] | [TTrue] | [TNot TFalse]-> [[]] | [TFalse] | [TNot TTrue] -> dnf | _ -> clause :: dnf (** Given a condition, this function does some logical simplifications. It returns both the simplified condition and a disjunction of conjunctions of parametrized call or return. *) let simplifyCond condition = Aorai_option.debug "initial condition: %a" Promelaoutput.print_condition condition; (* Step 1 : Condition is translate into Disjunctive Normal Form *) let res1 = condToDNF condition in Aorai_option.debug "initial dnf: %a" pretty_dnf res1; (* Step 2 : Positive Call/Ret are used to simplify negative ones *) let res = List.rev (List.fold_left (fun lclauses clause -> simplClause (positiveCallOrRet clause) lclauses) [] res1) in Aorai_option.debug "after step 2: %a" pretty_dnf res; (* Step 3 : simplification between exprs inside a clause *) let res = List.rev (List.fold_left (fun lclauses clause -> simplClause (simplify clause) lclauses) [] res) in Aorai_option.debug "after step 3: %a" pretty_dnf res; (* Step 4 : simplification between clauses *) let res = simplifyClauses res in Aorai_option.debug "after step 4: %a" pretty_dnf res; ((dnfToCond res), res) (** Given a list of transitions, this function returns the same list of transition with simplifyCond done on its cross condition *) let simplifyTrans transl = List.fold_left (fun (ltr,lpcond) tr -> let (crossCond , pcond ) = simplifyCond (tr.cross) in (* pcond stands for parametrized condition : disjunction of conjunctions of parametrized call/return *) let tr'={ start = tr.start ; stop = tr.stop ; cross = crossCond ; numt = tr.numt } in Aorai_option.debug "condition is %a, dnf is %a" Promelaoutput.print_condition crossCond pretty_dnf pcond; if tr'.cross <> TFalse then (tr'::ltr,pcond::lpcond) else (ltr,lpcond) ) ([],[]) (List.rev transl) (** Given a DNF condition, it returns the same condition simplified according to the context (function name and status). Hence, the returned condition is without any Call/Return stmts. *) let simplifyDNFwrtCtx dnf kf1 status = Aorai_option.debug "Before simplification: %a" pretty_dnf dnf; let rec simplCondition c = match c with | TCall (kf2, None) -> if Kernel_function.equal kf1 kf2 && status = Promelaast.Call then TTrue else TFalse | TCall (kf2, Some _) -> if Kernel_function.equal kf1 kf2 && status = Promelaast.Call then c else TFalse | TReturn kf2 -> if Kernel_function.equal kf1 kf2 && status = Promelaast.Return then TTrue else TFalse | TNot c -> tnot (simplCondition c) | TAnd(c1,c2) -> tand (simplCondition c1) (simplCondition c2) | TOr (c1,c2) -> tor (simplCondition c1) (simplCondition c2) | TTrue | TFalse | TRel _ -> c in let simplCNFwrtCtx cnf = tands (List.map simplCondition cnf) in let res = tors (List.map simplCNFwrtCtx dnf) in Aorai_option.debug "After simplification: %a" Promelaoutput.print_condition res; res (* Tests : Working : ========== simplifyCond(PAnd(POr(PTrue,PIndexedExp("a")),PNot(PAnd(PFalse,PIndexedExp("b")))));; - : condition = PTrue simplifyCond(POr(PAnd(PNot(PIndexedExp("b")),POr(PTrue,PIndexedExp("a"))),PAnd(PIndexedExp("a"),PNot(PFalse))));; - : condition = POr (PIndexedExp "a", PNot (PIndexedExp "b")) simplifyCond(PAnd(PAnd(PCall("a"),PIndexedExp "a"),PAnd(PNot(PCall("a")),PNot(PIndexedExp "a"))));; - : condition = PFalse simplifyCond(PAnd(PIndexedExp "a",PNot(PIndexedExp "a")));; - : condition = PFalse simplifyCond(PAnd(PCall("a"),PCall("a")));; - : condition = PCall "a" simplifyCond(PAnd(PIndexedExp("a"),PNot(PIndexedExp("a"))));; - : condition = PFalse simplifyCond(POr(PCall("a"),PNot(PCall("a"))));; - : condition = PTrue simplifyCond(PAnd(POr(PCall("a"),PCall("b")),POr(PNot(PCall("a")),PCall("b")))) ;; - : condition = PCall "b" simplifyCond(POr (PCall "b", PCall "b"));; - : condition = PCall "b" Simplifications to be done : ========================= *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/logic_simplification.mli0000666000000000000000000000605113571573400021452 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Basic simplification over {!Promelaast.typed_condition} *) open Promelaast (** {2 smart constructors for typed conditions} *) val tand: typed_condition -> typed_condition -> typed_condition val tor: typed_condition -> typed_condition -> typed_condition val tnot: typed_condition -> typed_condition (** {2 simplifications} *) (** Given a condition, this function does some logical simplifications and returns an equivalent DNF form together with the simplified version *) val simplifyCond: Promelaast.typed_condition -> Promelaast.typed_condition *(Promelaast.typed_condition list list) (** Given a transition list, this function returns the same transition list with simplifyCond done on each cross condition. Uncrossable transition are removed. *) val simplifyTrans: Promelaast.typed_condition Promelaast.trans list -> (Promelaast.typed_condition Promelaast.trans list)* (Promelaast.typed_condition list list list) val dnfToCond : (Promelaast.typed_condition list list) -> Promelaast.typed_condition val simplifyDNFwrtCtx : Promelaast.typed_condition list list -> Cil_types.kernel_function -> Promelaast.funcStatus -> Promelaast.typed_condition (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/ltl_output.ml0000666000000000000000000000641213571573400017326 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Format open Ltlast let out_fmt=ref (formatter_of_out_channel stdout) let rec ltl_form_to_string = function | LNext (f) -> "X("^(ltl_form_to_string f)^")" | LUntil (f1,f2) -> "("^(ltl_form_to_string f1)^" U "^(ltl_form_to_string f2)^")" | LFatally (f) -> "<>("^(ltl_form_to_string f)^")" | LGlobally (f) -> "[]("^(ltl_form_to_string f)^")" | LRelease (f1,f2) -> "("^(ltl_form_to_string f1)^" V "^(ltl_form_to_string f2)^")" | LNot (f) -> "!("^(ltl_form_to_string f)^")" | LAnd (f1,f2) -> "("^(ltl_form_to_string f1)^" && "^(ltl_form_to_string f2)^")" | LOr (f1,f2) -> "("^(ltl_form_to_string f1)^" || "^(ltl_form_to_string f2)^")" | LImplies (f1,f2) -> "("^(ltl_form_to_string f1)^" -> "^(ltl_form_to_string f2)^")" | LIff (f1,f2) -> "("^(ltl_form_to_string f1)^" <-> "^(ltl_form_to_string f2)^")" | LTrue -> "1" | LFalse -> "0" | LCall (s) -> "callof_"^s | LReturn (s) -> "returnof_"^s | LCallOrReturn (s) -> "callorreturnof_"^s | LIdent (s) -> s let output ltl_form file = let c = open_out file in out_fmt:=formatter_of_out_channel c ; fprintf !out_fmt "%s\n\n" (ltl_form_to_string ltl_form); fprintf !out_fmt "@?"; (* Flush du flux *) close_out c; out_fmt:=formatter_of_out_channel stdout (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/ltl_output.mli0000666000000000000000000000375613571573400017507 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: ltl_output.mli,v 1.2 2008-10-02 13:33:29 uid588 Exp $ *) val output : Ltlast.formula -> string -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/ltlast.mli0000666000000000000000000000675613571573400016602 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: ltlast.mli,v 1.3 2008-10-13 09:21:24 uid588 Exp $ *) (** The abstract tree of LTL formula. Such tree is used by ltl parser/lexer before its translation into Buchi automata by the LTL2BA external tool. *) (** LTL formula parsed abstract syntax trees *) type formula = | LNext of formula (** 'Next' temporal operator *) | LUntil of formula * formula (** 'Until' temporal operator *) | LFatally of formula (** 'Fatally' temporal operator *) | LGlobally of formula (** 'Globally' temporal operator *) | LRelease of formula * formula (** 'Release' temporal operator (reminder: f1 R f2 <=> !(!f1 U !f2)) *) | LNot of formula (** 'not' logic operator *) | LAnd of formula * formula (** 'and' logic operator *) | LOr of formula * formula (** 'or' logic operator *) | LImplies of formula * formula (** '=>' logic operator *) | LIff of formula * formula (** '<=>' logic operator *) | LTrue (** 'true' logic constant *) | LFalse (** 'false' logic constant *) | LCall of string (** Logic predicate. The String has to be the name of an operation from C program *) | LReturn of string (** Logic predicate. The String has to be the name of an operation from C program *) | LCallOrReturn of string (** Logic predicate. The String has to be the name of an operation from C program *) | LIdent of string (** Logic expression. The String is the name of a fresh variable defined by the expression and used to be in conformance with the input syntax of LTL2BA tool. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/ltllexer.mll0000666000000000000000000001255213571573400017124 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: ltllexer.mll,v 1.2 2008-10-02 13:33:29 uid588 Exp $ *) (* from http://www.ltl2dstar.de/down/ltl2dstar-0.4.2.zip *) { open Ltlparser open Lexing let loc lexbuf = (lexeme_start_p lexbuf, lexeme_end_p lexbuf) (*let lex_error lexbuf s = ()*) (* Creport.raise_located (loc lexbuf) (AnyMessage ("lexical error: " ^ s)) *) let buf = Buffer.create 1024 let newline lexbuf = let pos = lexbuf.lex_curr_p in lexbuf.lex_curr_p <- { pos with pos_lnum = pos.pos_lnum + 1; pos_bol = pos.pos_cnum } (* Update the current location with file name and line number. *) (* let update_loc lexbuf file line absolute chars = let pos = lexbuf.lex_curr_p in let new_file = match file with | None -> pos.pos_fname | Some s -> s in lexbuf.lex_curr_p <- { pos with pos_fname = new_file; pos_lnum = if absolute then line else pos.pos_lnum + line; pos_bol = pos.pos_cnum - chars; } *) exception Error of (Lexing.position * Lexing.position) * string let raise_located loc e = raise (Error (loc, e)) } let rD = ['0'-'9'] let rL = ['a'-'z' 'A'-'Z' '_'] rule token = parse | "true" { LTL_TRUE } | "false" { LTL_FALSE } | '(' { LTL_LPAREN } | ')' { LTL_RPAREN } (* Logic operators *) | "=>" { LTL_IMPLIES } | "<=>" { LTL_LEFT_RIGHT_ARROW } | "||" { LTL_OR } | "&&" { LTL_AND } | '!' { LTL_NOT } | "_G_" { LTL_GLOBALLY } | "_F_" { LTL_FATALLY } | "_U_" { LTL_UNTIL } | "_R_" { LTL_RELEASE } | "_X_" { LTL_NEXT } (* Logic relations *) | "==" { LTL_EQ } | "<" { LTL_LT } | ">" { LTL_GT } | "<=" { LTL_LE } | ">=" { LTL_GE } | "!=" { LTL_NEQ } (* Arithmetic relations *) | '+' { LTL_PLUS } | '-' { LTL_MINUS } | '/' { LTL_DIV } | '*' { LTL_STAR } | '%' { LTL_MODULO} (* Access *) | "->" { LTL_RIGHT_ARROW } | '.' { LTL_DOT } | '[' { LTL_LEFT_SQUARE} | ']' { LTL_RIGHT_SQUARE} | '&' { LTL_ADRESSE } | "CALL" { LTL_CALL } | "RETURN" { LTL_RETURN } | "CALL_OR_RETURN" { LTL_CALL_OR_RETURN } (* Comments *) | "/*" { comment lexbuf; token lexbuf } | "//" [^ '\n']* '\n' { newline lexbuf; token lexbuf } (* Spaces *) | [' ' '\t' '\012' '\r']+ { token lexbuf } | '\n' { newline lexbuf; token lexbuf } (* Variables and constants *) | rD+ | '-' rD+ { LTL_INT (lexeme lexbuf) } | rL (rL | rD)* { LTL_LABEL (lexeme lexbuf) } (* Others *) | eof { EOF } | _ { raise_located (loc lexbuf) (Format.sprintf "Illegal_character %s\n" (lexeme lexbuf)) } and comment = parse | "*/" { () } | eof { raise_located (loc lexbuf) "Unterminated_comment\n" } | '\n' { newline lexbuf; comment lexbuf } | _ { comment lexbuf } { let parse c = let lb = from_channel c in try Ltlparser.ltl token lb with Parsing.Parse_error | Invalid_argument _ -> raise_located (loc lb) "Syntax error" } frama-c-20.0-Calcium/src/plugins/aorai/ltlparser.mly0000666000000000000000000001445013571573400017315 0ustar /**************************************************************************/ /* */ /* This file is part of Aorai plug-in of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* INRIA (Institut National de Recherche en Informatique et en */ /* Automatique) */ /* INSA (Institut National des Sciences Appliquees) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* $Id: ltlparser.mly,v 1.3 2009-02-13 07:59:29 uid562 Exp $ */ /* Originated from http://www.ltl2dstar.de/down/ltl2dstar-0.4.2.zip */ %{ open Promelaast open Logic_ptree let observed_expressions=Hashtbl.create 97 let ident_count=ref 0 let get_fresh_ident () = ident_count:=!ident_count+1; ("buchfreshident"^(string_of_int !ident_count)) %} %token LTL_TRUE LTL_FALSE LTL_LPAREN LTL_RPAREN /* Logic operators */ %token LTL_OR LTL_IMPLIES LTL_LEFT_RIGHT_ARROW %token LTL_AND %token LTL_NOT %token LTL_GLOBALLY LTL_FATALLY LTL_UNTIL LTL_RELEASE LTL_NEXT %right LTL_OR LTL_IMPLIES LTL_LEFT_RIGHT_ARROW %right LTL_AND %nonassoc LTL_NOT %right LTL_GLOBALLY LTL_FATALLY LTL_UNTIL LTL_RELEASE LTL_NEXT /* Logic relations */ %token LTL_EQ LTL_LT LTL_GT LTL_LE LTL_GE LTL_NEQ %right LTL_EQ LTL_LT LTL_GT LTL_LE LTL_GE LTL_NEQ /* Arithmetic relations */ %token LTL_PLUS LTL_MINUS %token LTL_DIV LTL_STAR LTL_MODULO %right LTL_PLUS LTL_MINUS LTL_DIV LTL_STAR LTL_MODULO /* Access */ %token LTL_RIGHT_ARROW LTL_DOT LTL_LEFT_SQUARE LTL_RIGHT_SQUARE LTL_ADRESSE %token LTL_CALL LTL_RETURN LTL_CALL_OR_RETURN /* Variables and constants */ %token LTL_INT %token LTL_LABEL /* Others */ %token EOF %type <(Ltlast.formula * (string, (Logic_ptree.relation * Promelaast.expression * Promelaast.expression)) Hashtbl.t)> ltl %start ltl %% ltl : formula EOF {($1,observed_expressions)} ; formula : LTL_TRUE {Ltlast.LTrue} | LTL_FALSE {Ltlast.LFalse} | LTL_LPAREN formula LTL_RPAREN { $2 } | LTL_GLOBALLY formula { Ltlast.LGlobally($2) } | LTL_FATALLY formula { Ltlast.LFatally($2) } | formula LTL_UNTIL formula { Ltlast.LUntil($1,$3) } | formula LTL_RELEASE formula { Ltlast.LRelease($1,$3) } | LTL_NEXT formula { Ltlast.LNext($2) } | formula LTL_OR formula { Ltlast.LOr($1,$3) } | formula LTL_AND formula { Ltlast.LAnd($1,$3) } | LTL_NOT formula { Ltlast.LNot($2) } | formula LTL_IMPLIES formula { Ltlast.LImplies($1,$3) } | formula LTL_LEFT_RIGHT_ARROW formula { Ltlast.LIff($1,$3) } | LTL_CALL LTL_LPAREN LTL_LABEL LTL_RPAREN { Ltlast.LCall($3)} | LTL_RETURN LTL_LPAREN LTL_LABEL LTL_RPAREN { Ltlast.LReturn($3)} | LTL_CALL_OR_RETURN LTL_LPAREN LTL_LABEL LTL_RPAREN { Ltlast.LCallOrReturn($3)} /* returns a string identifer associated, through observed_expressions table, to the represented expression */ | logic_relation { let id = get_fresh_ident () in Hashtbl.add observed_expressions id $1; Ltlast.LIdent(id) } ; logic_relation : arith_relation LTL_EQ arith_relation { Eq, $1 , $3} | arith_relation LTL_LT arith_relation { Lt, $1, $3 } | arith_relation LTL_GT arith_relation { Gt, $1, $3 } | arith_relation LTL_LE arith_relation { Le, $1, $3 } | arith_relation LTL_GE arith_relation { Ge, $1, $3 } | arith_relation LTL_NEQ arith_relation { Neq, $1, $3 } | arith_relation { Neq, $1, PCst (IntConstant "0") } ; arith_relation : arith_relation_mul LTL_PLUS arith_relation { PBinop(Badd,$1,$3) } | arith_relation_mul LTL_MINUS arith_relation { PBinop(Bsub,$1,$3) } | arith_relation_mul { $1 } ; arith_relation_mul : arith_relation_mul LTL_DIV access_or_const { PBinop(Bdiv,$1,$3) } | arith_relation_mul LTL_STAR access_or_const { PBinop(Bmul,$1,$3) } | arith_relation_mul LTL_MODULO access_or_const { PBinop(Bmod,$1,$3)} | access_or_const { $1 } ; /* returns a Lval exp or a Const exp*/ access_or_const : LTL_INT { PCst (IntConstant $1) } | LTL_MINUS LTL_INT { PUnop (Uminus,PCst (IntConstant $2)) } | access { $1 } | LTL_LPAREN arith_relation LTL_RPAREN { $2 } ; /* returns a lval */ access : access LTL_RIGHT_ARROW LTL_LABEL { PField (PUnop(Ustar,$1),$3) } | access LTL_DOT LTL_LABEL { PField($1,$3) } | access_array {$1} access_array : access_array LTL_LEFT_SQUARE access_or_const LTL_RIGHT_SQUARE { PArrget($1,$3) } | access_leaf {$1} access_leaf : LTL_ADRESSE access { PUnop (Uamp,$2) } | LTL_STAR access { PUnop (Ustar, $2 ) } | LTL_LABEL { PVar $1 } | LTL_LPAREN access LTL_RPAREN { $2 } ; frama-c-20.0-Calcium/src/plugins/aorai/path_analysis.ml0000666000000000000000000001433113571573400017751 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Promelaast (*open Graph.Pack.Digraph let st_array = ref (Array.make 1 (V.create 0)) ;; let auto2digraph (stl,trl) = Aorai_option.feedback "auto2digraph:" ; let digraph = create () in st_array:= Array.make (List.length stl) (V.create 0); Aorai_option.feedback " array : ok\n" ; let _ = List.iter (fun st -> (!st_array).(st.nums)<-(V.create st.nums); add_vertex digraph (!st_array).(st.nums) ) stl in Aorai_option.feedback " array remplissage : ok\n" ; List.iter (fun tr -> add_edge digraph (V.create tr.start.nums) (V.create tr.stop.nums)) trl; digraph ;; let existing_path auto st1 st2 = Aorai_option.feedback "existing path ..\n" ; let digraph = auto2digraph auto in let start = (!st_array).(st1.nums) in let stop = (!st_array).(st2.nums) in Aorai_option.feedback "%s" ("test : Etats choisis ("^(string_of_int (V.label start))^","^(string_of_int (V.label stop))^")\n") ; display_with_gv digraph; Aorai_option.feedback " affichage : ok\n" ; Aorai_option.feedback "shortest path : " ; let path=shortest_path digraph start stop in Aorai_option.feedback "done.\n" ; path ;; let test (stl,trl) = let st2 = List.hd stl in let st1 = List.hd (List.tl stl) in let _ = existing_path (stl,trl) st1 st2 in Aorai_option.feedback "Fini.\n" ; () ;; *) let voisins (_,trans_l) st = List.fold_left (fun vl tr -> if tr.start.nums=st.nums then (tr.stop,1)::vl else vl) [] trans_l let empty () = [] ;; let is_empty heap = (List.length heap)=0 ;; let add (length,(st,path)) heap = (length,(st,path))::heap ;; let extract_min heap = let (min,h) = List.fold_left (fun ((lmin,min),h) (lcur,cur) -> if lmin<=lcur then ((lmin,min),(lcur,cur)::h) else ((lcur,cur),(lmin,min)::h) ) ((List.hd heap),[]) (List.tl heap) in (min,h) (* Source : wikipedia*) (* l'adjacence est donnee sous la forme d'une fonction : adj v est la liste des voisins de v, avec leur distance ; la fonction suivante cherche le plus court chemin de v1 a v2 *) let dijkstra (adj: 'a -> ('a * int) list) (v1:'a) (v2:'a) = let visited = Hashtbl.create 97 in let rec loop h = if is_empty h then raise Not_found; let (w,(v,p)),h = extract_min h in if v = v2 then List.rev p, w else let h = if not (Hashtbl.mem visited v) then begin Hashtbl.add visited v (); List.fold_left (fun h (e,d) -> add (w+d, (e, e::p)) h) h (adj v) end else h in loop h in loop (add (0,(v1,[])) (empty())) let existing_path (stl,_ as auto) stn1 stn2 = let st1 = ref (List.hd stl) in let st2 = ref (List.hd stl) in List.iter (fun st -> if st.nums=stn1 then st1:=st; if st.nums=stn2 then st2:=st; ) stl; try let _ = dijkstra (voisins auto) !st1 !st2 in true with | Not_found -> false ;; (** since Nitrogen-20111001 *) let get_transitions_of_state st (_,tr) = List.fold_left (fun acc tr -> if tr.start.nums = st.nums then tr::acc else acc) [] tr let get_transitions_to_state st (_,tr) = List.fold_left (fun acc tr -> if tr.stop.nums = st.nums then tr::acc else acc) [] tr let get_edges st1 st2 (_,tr) = List.find_all (fun tr -> tr.start.nums = st1.nums && tr.stop.nums = st2.nums) tr let get_init_states (st,_) = List.filter (fun x -> x.init = Bool3.True) st let at_most_one_path (states,transitions as auto) st1 st2 = try let path,_ = dijkstra (voisins auto) st1 st2 in match path with | [] | [ _ ] -> true | x::y::_ -> let (trans1,trans2) = List.partition (fun t -> t.start.nums = x.nums && t.stop.nums = y.nums) transitions in let transitions = (List.tl trans1) @ trans2 in let auto = states, transitions in ignore (dijkstra (voisins auto) st1 st2); false with Not_found -> true let test (stl,_ as auto) = let st2 = List.hd stl in let st1 = List.hd (List.tl stl) in Aorai_option.feedback "test : Etats choisis (%d,%d)" st1.nums st2.nums; let (res,_) = dijkstra (voisins auto) st1 st2 in Aorai_option.feedback "Fini.@\n%a" (Pretty_utils.pp_list ~pre:"@[[" ~sep:",@ " ~suf:"@]]" (fun fmt st -> Format.fprintf fmt "%d" st.nums)) res (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/promelaast.mli0000666000000000000000000001523613571573400017437 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** The abstract tree of promela representation. Such tree is used by promela parser/lexer before its translation into Data_for_aorai module. *) type expression = | PVar of string | PPrm of string * string (* f().N *) | PCst of Logic_ptree.constant | PBinop of Logic_ptree.binop * expression * expression | PUnop of Logic_ptree.unop * expression | PArrget of expression * expression | PField of expression * string | PArrow of expression * string type condition = | PRel of Logic_ptree.relation * expression * expression | PTrue | PFalse | POr of condition * condition | PAnd of condition * condition | PNot of condition | PCall of string * string option (** Call might be done in a given behavior *) | PReturn of string and seq_elt = { condition: condition option; nested: sequence; min_rep: expression option; max_rep: expression option; } and sequence = seq_elt list (** Promela parsed abstract syntax trees. Either a sequence of event or the otherwise keyword. A single condition is expressed with a singleton having an empty nested sequence and min_rep and max_rep being equal to one. *) type parsed_condition = Seq of sequence | Otherwise type typed_condition = | TOr of typed_condition * typed_condition (** Logical OR *) | TAnd of typed_condition * typed_condition (** Logical AND *) | TNot of typed_condition (** Logical NOT *) | TCall of Cil_types.kernel_function * Cil_types.funbehavior option (** Predicate modelling the call of an operation *) | TReturn of Cil_types.kernel_function (** Predicate modelling the return of an operation *) | TTrue (** Logical constant TRUE *) | TFalse (** Logical constant FALSE *) | TRel of Cil_types.relation * Cil_types.term * Cil_types.term (** Condition. If one of the terms contains TResult, TRel is in conjunction with exactly one TReturn event, and the TResult is tied to the corresponding value. *) type single_action = | Counter_init of Cil_types.term_lval | Counter_incr of Cil_types.term_lval | Pebble_init of Cil_types.logic_info * Cil_types.logic_var * Cil_types.logic_var (** adds a new pebble. [Pebble_init(set,aux,count)] indicates that pebble [count] is put in [set] whose content is governed by C variable [aux]. *) | Pebble_move of Cil_types.logic_info * Cil_types.logic_var * Cil_types.logic_info * Cil_types.logic_var (** [Pebble_move(new_set,new_aux,old_set,old_aux)] moves pebbles from [old_set] to [new_set], governed by the corresponding aux variables. *) | Copy_value of Cil_types.term_lval * Cil_types.term (** copy the current value of the given term into the given location so that it can be accessed by a later state. *) (** Additional actions to perform when crossing a transition. There is at most one Pebble_* action for each transition, and each transition leading to a state with multi-state has such an action. *) type action = single_action list (** Internal representation of a State from the Buchi automata. *) type state = { name : string (** State name *); mutable acceptation : Bool3.t (** True iff state is an acceptation state *); mutable init : Bool3.t (** True iff state is an initial state *); mutable nums : int; (** Numerical ID of the state *) mutable multi_state: (Cil_types.logic_info * Cil_types.logic_var) option (** Translation of some sequences might lead to some kind of pebble automaton, where we need to distinguish various branches. This is done by having a set of pebbles instead of just a zero/one switch to know if we are in the given state. The guards apply to each active pebble and are thus of the form \forall integer x; in(x,multi_state) ==> guard. multi_state is the first lvar of the pair, x is the second *) } (** Internal representation of a transition from the Buchi automata. *) type 'condition trans = { start : state ; (** Starting state of the transition *) stop : state ; (** Ending state of the transition *) mutable cross : 'condition ; (** Cross condition of the transition *) mutable numt : int (** Numerical ID of the transition *) } (** Internal representation of a Buchi automata : a list of states and a list of transitions.*) type 'condition automaton = (state list) * ('condition trans list) type parsed_automaton = parsed_condition automaton type typed_automaton = (typed_condition * action) automaton (** An operation can have two status: currently calling or returning. *) type funcStatus = | Call | Return (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/promelalexer.mll0000666000000000000000000001355013571573400017767 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: promelalexer.mll,v 1.2 2008-10-02 13:33:29 uid588 Exp $ *) (* from http://www.ltl2dstar.de/down/ltl2dstar-0.4.2.zip *) { open Promelaparser open Lexing exception Error of (Lexing.position * Lexing.position) * string let loc lexbuf = (lexeme_start_p lexbuf, lexeme_end_p lexbuf) let raise_located loc e = raise (Error (loc, e)) let buf = Buffer.create 1024 let newline lexbuf = let pos = lexbuf.lex_curr_p in lexbuf.lex_curr_p <- { pos with pos_lnum = pos.pos_lnum + 1; pos_bol = pos.pos_cnum } } let rD = ['0'-'9'] let rL = ['a'-'z' 'A'-'Z' '_'] rule token = parse | "true" { PROMELA_TRUE } | "never" { PROMELA_NEVER } | "if" { PROMELA_IF } | "fi" { PROMELA_FI } | "goto" { PROMELA_GOTO } | "skip" { PROMELA_SKIP } | "::" { PROMELA_DOUBLE_COLON } | ':' { PROMELA_COLON } | ';' { PROMELA_SEMICOLON } | '(' { PROMELA_LPAREN } | ')' { PROMELA_RPAREN } | '{' { PROMELA_LBRACE } | '}' { PROMELA_RBRACE } | "->" { PROMELA_RIGHT_ARROW } | "false" { PROMELA_FALSE } | "||" { PROMELA_OR } | "&&" { PROMELA_AND } | '!' { PROMELA_NOT } | [' ' '\t' '\012' '\r']+ { token lexbuf } | '\n' { newline lexbuf; token lexbuf } | "/*" { comment lexbuf; token lexbuf } | "//" [^ '\n']* '\n' { newline lexbuf; token lexbuf } | "callof_" rL* (rL | rD)* { let s=(lexeme lexbuf) in let s=String.sub s 7 ((String.length s)-7) in PROMELA_CALLOF s } | "returnof_" rL* (rL | rD)* { let s=(lexeme lexbuf) in let s=String.sub s 9 ((String.length s)-9) in PROMELA_RETURNOF s } | "callorreturnof_" rL* (rL | rD)* { let s=(lexeme lexbuf) in let s=String.sub s 15 ((String.length s)-15) in PROMELA_CALLORRETURNOF s } | "callof_" { raise_located (loc lexbuf) "Illegal function name in Promela file." } | "returnof_" { raise_located (loc lexbuf) "Illegal function name in Promela file." } | "callorreturnof_" { raise_located (loc lexbuf) "Illegal function name in Promela file." } | rL (rL | rD)* { let s = lexeme lexbuf in PROMELA_LABEL s } | eof { EOF } | "1" { PROMELA_TRUE } | _ { Aorai_option.error "Illegal_character : '%s'\n" (lexeme lexbuf); raise Parsing.Parse_error} and comment = parse | "*/" { () } | eof { Aorai_option.error "Unterminated_comment\n" (*lex_error lexbuf "Unterminated_comment"*) } | '\n' { newline lexbuf; comment lexbuf } | _ { comment lexbuf } { let parse c = let lb = from_channel c in try Promelaparser.promela token lb with Parsing.Parse_error | Invalid_argument _ -> let (a,b)=(loc lb) in Aorai_option.error "Syntax error (l%d c%d -> l%dc%d)" a.pos_lnum (a.pos_cnum-a.pos_bol) b.pos_lnum (b.pos_cnum-b.pos_bol); (* Format.print_string "Syntax error (" ; *) (* Format.print_string "l" ; *) (* Format.print_int a.pos_lnum ; *) (* Format.print_string "c" ; *) (* Format.print_int (a.pos_cnum-a.pos_bol) ;*) (* Format.print_string " -> l" ; *) (* Format.print_int b.pos_lnum ; *) (* Format.print_string "c" ; *) (* Format.print_int (b.pos_cnum-b.pos_bol) ;*) (* Format.print_string ")\n" ; *) raise_located (loc lb) "Syntax error" } frama-c-20.0-Calcium/src/plugins/aorai/promelalexer_withexps.mll0000666000000000000000000001542413571573400021724 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: promelalexer_withexps.mll,v 1.2 2008-10-02 13:33:29 uid588 Exp $ *) (* from http://www.ltl2dstar.de/down/ltl2dstar-0.4.2.zip *) { open Promelaparser_withexps open Lexing exception Error of (Lexing.position * Lexing.position) * string let loc lexbuf = (lexeme_start_p lexbuf, lexeme_end_p lexbuf) let raise_located loc e = raise (Error (loc, e)) let buf = Buffer.create 1024 let newline lexbuf = let pos = lexbuf.lex_curr_p in lexbuf.lex_curr_p <- { pos with pos_lnum = pos.pos_lnum + 1; pos_bol = pos.pos_cnum } } let rD = ['0'-'9'] let rL = ['a'-'z' 'A'-'Z' '_'] rule token = parse | "true" { PROMELA_TRUE } | "never" { PROMELA_NEVER } | "if" { PROMELA_IF } | "fi" { PROMELA_FI } | "goto" { PROMELA_GOTO } | "skip" { PROMELA_SKIP } | "::" { PROMELA_DOUBLE_COLON } | ':' { PROMELA_COLON } | ';' { PROMELA_SEMICOLON } | "()" { PROMELA_FUNC } | '(' { PROMELA_LPAREN } | ')' { PROMELA_RPAREN } | '{' { PROMELA_LBRACE } | '}' { PROMELA_RBRACE } | "->" { PROMELA_RIGHT_ARROW } | "false" { PROMELA_FALSE } | "||" { PROMELA_OR } | "&&" { PROMELA_AND } | '!' { PROMELA_NOT } | [' ' '\t' '\012' '\r']+ { token lexbuf } | '\n' { newline lexbuf; token lexbuf } | "/*" { comment lexbuf; token lexbuf } | "//" [^ '\n']* '\n' { newline lexbuf; token lexbuf } | "callof_" rL* (rL | rD)* { let s=(lexeme lexbuf) in let s=String.sub s 7 ((String.length s)-7) in PROMELA_CALLOF s } | "returnof_" rL* (rL | rD)* { let s=(lexeme lexbuf) in let s=String.sub s 9 ((String.length s)-9) in PROMELA_RETURNOF s } | "callorreturnof_" rL* (rL | rD)* { let s=(lexeme lexbuf) in let s=String.sub s 15 ((String.length s)-15) in PROMELA_CALLORRETURNOF s } | "callof_" { raise_located (loc lexbuf) "Illegal function name in Promela file." } | "returnof_" { raise_located (loc lexbuf) "Illegal function name in Promela file." } | "callorreturnof_" { raise_located (loc lexbuf) "Illegal function name in Promela file." } | rD+ | '-' rD+ { PROMELA_INT (lexeme lexbuf) } (* Logic relations *) | "==" { PROMELA_EQ } | "<" { PROMELA_LT } | ">" { PROMELA_GT } | "<=" { PROMELA_LE } | ">=" { PROMELA_GE } | "!=" { PROMELA_NEQ } (* Arithmetic relations *) | '+' { PROMELA_PLUS } | '-' { PROMELA_MINUS } | '/' { PROMELA_DIV } | '*' { PROMELA_STAR } | '%' { PROMELA_MODULO} (* Access *) (* | "->" { LTL_RIGHT_ARROW }*) | '.' { PROMELA_DOT } | '[' { PROMELA_LEFT_SQUARE} | ']' { PROMELA_RIGHT_SQUARE} (* | '&' { PROMELA_ADRESSE }*) | rL (rL | rD)* { let s = lexeme lexbuf in PROMELA_LABEL s } | eof { EOF } | "1" { PROMELA_TRUE } | _ { Aorai_option.error "Illegal_character : '%s'\n" (lexeme lexbuf); raise Parsing.Parse_error} and comment = parse | "*/" { () } | eof { Aorai_option.warning "Unterminated_comment\n" (*lex_error lexbuf "Unterminated_comment"*) } | '\n' { newline lexbuf; comment lexbuf } | _ { comment lexbuf } { let parse c = let lb = from_channel c in try Promelaparser_withexps.promela token lb with Parsing.Parse_error | Invalid_argument _ -> let (a,b)=(loc lb) in Aorai_option.error "Syntax error (l%d c%d -> l%dc%d)" a.pos_lnum (a.pos_cnum-a.pos_bol) b.pos_lnum (b.pos_cnum-b.pos_bol); (* Format.print_string "Syntax error (" ; *) (* Format.print_string "l" ; *) (* Format.print_int a.pos_lnum ; *) (* Format.print_string "c" ; *) (* Format.print_int (a.pos_cnum-a.pos_bol) ;*) (* Format.print_string " -> l" ; *) (* Format.print_int b.pos_lnum ; *) (* Format.print_string "c" ; *) (* Format.print_int (b.pos_cnum-b.pos_bol) ;*) (* Format.print_string ")\n" ; *) raise_located (loc lb) "Syntax error" } frama-c-20.0-Calcium/src/plugins/aorai/promelaoutput.ml0000666000000000000000000002360213571573400020033 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Logic_ptree open Aorai_option open Promelaast open Bool3 open Format let string_of_unop = function | Uminus -> "-" | Ustar -> "*" | Uamp -> "&" | Ubw_not -> "~" let rec print_parsed_expression fmt = function | PVar s -> Format.fprintf fmt "%s" s | PPrm (f,s) -> Format.fprintf fmt "%s().%s" f s | PCst (IntConstant s) -> Format.fprintf fmt "%s" s | PCst (FloatConstant s) -> Format.fprintf fmt "%s" s | PCst (StringConstant s) -> Format.fprintf fmt "%S" s | PCst (WStringConstant s) -> Format.fprintf fmt "%S" s | PBinop(bop,e1,e2) -> Format.fprintf fmt "(@[%a@])@ %a@ (@[%a@])" print_parsed_expression e1 Printer.pp_binop (Logic_typing.type_binop bop) print_parsed_expression e2 | PUnop(uop,e) -> Format.fprintf fmt "%s@;(@[%a@])" (string_of_unop uop) print_parsed_expression e | PArrget(e1,e2) -> Format.fprintf fmt "%a@;[@(%a@]]" print_parsed_expression e1 print_parsed_expression e2 | PField(e,s) -> Format.fprintf fmt "%a.%s" print_parsed_expression e s | PArrow(e,s) -> Format.fprintf fmt "%a->%s" print_parsed_expression e s let rec print_parsed_condition fmt = function | PRel(rel,e1,e2) -> Format.fprintf fmt "%a %a@ %a" print_parsed_expression e1 Printer.pp_relation (Logic_typing.type_rel rel) print_parsed_expression e2 | PTrue -> Format.pp_print_string fmt "true" | PFalse -> Format.pp_print_string fmt "false" | POr(e1,e2) -> Format.fprintf fmt "(@[%a@])@ or@ (@[%a@])" print_parsed_condition e1 print_parsed_condition e2 | PAnd(e1,e2) -> Format.fprintf fmt "(@[%a@])@ and@ (@[%a@])" print_parsed_condition e1 print_parsed_condition e2 | PNot c -> Format.fprintf fmt "not(@[%a@])" print_parsed_condition c | PCall (s,None) -> Format.fprintf fmt "CALL(%s)" s | PCall (s, Some b) -> Format.fprintf fmt "CALL(%s::%s)" s b | PReturn s -> Format.fprintf fmt "RETURN(%s)" s let rec print_seq_elt fmt elt = Format.fprintf fmt "(%a%a){@[%a,%a@]}" (Pretty_utils.pp_opt print_parsed_condition) elt.condition print_sequence elt.nested (Pretty_utils.pp_opt print_parsed_expression) elt.min_rep (Pretty_utils.pp_opt print_parsed_expression) elt.max_rep and print_sequence fmt l = Pretty_utils.pp_list ~pre:"[@[" ~sep:";@ " ~suf:"@]]" print_seq_elt fmt l let print_parsed fmt = function | Seq l -> print_sequence fmt l | Otherwise -> Format.pp_print_string fmt "Otherwise" let rec print_condition fmt = function | TCall (kf,None) -> Format.fprintf fmt "Call(%a)" Kernel_function.pretty kf | TCall (kf, Some b) -> Format.fprintf fmt "Call(%a::%s)" Kernel_function.pretty kf b.Cil_types.b_name | TReturn kf -> Format.fprintf fmt "Return(%a)" Kernel_function.pretty kf | TOr (c1,c2) -> Format.fprintf fmt "@[(@[<2>%a@])@]@ or@ @[(@[<2>%a@])@]" print_condition c1 print_condition c2 | TAnd (c1,c2) -> Format.fprintf fmt "@[(@[<2>%a@])@]@ and@ @[(@[<2>%a@])@]" print_condition c1 print_condition c2 | TNot c -> Format.fprintf fmt "@[@[not(%a@])@]" print_condition c | TTrue -> Format.pp_print_string fmt "True" | TFalse -> Format.pp_print_string fmt "False" | TRel(rel,exp1,exp2) -> (* \result will be printed as such, not as f().return *) Format.fprintf fmt "@[(%a)@]@ %a@ @[(%a)@]" Printer.pp_term exp1 Printer.pp_relation rel Printer.pp_term exp2 let print_one_action fmt = function | Counter_init lv -> Format.fprintf fmt "@[%a <- 1@]" Printer.pp_term_lval lv | Counter_incr lv -> Format.fprintf fmt "@[%a <- @[%a@ +@ 1@]@]" Printer.pp_term_lval lv Printer.pp_term_lval lv | Pebble_init (set,_,v) -> Format.fprintf fmt "@[%a <- {@[ %a @]}@]" Printer.pp_logic_var set.l_var_info Printer.pp_logic_var v | Pebble_move(s1,_,s2,_) -> Format.fprintf fmt "@[%a <- %a@]" Printer.pp_logic_var s1.l_var_info Printer.pp_logic_var s2.l_var_info | Copy_value(lv,v) -> Format.fprintf fmt "@[%a <- %a@]" Printer.pp_term_lval lv Printer.pp_term v let print_action fmt l = Pretty_utils.pp_list ~sep:"@\n" print_one_action fmt l (* Use well-parenthesized combination of escape_newline/normal_newline*) let escape_newline fmt = let funcs = Format.pp_get_formatter_out_functions fmt () in let has_printed = ref false in let out_newline () = if !has_printed then funcs.Format.out_string " \\\n" 0 3 else funcs.Format.out_newline () in let out_string s b l = if String.contains (String.sub s b l) '"' then has_printed:=not !has_printed; funcs.Format.out_string s b l in Format.pp_set_formatter_out_functions fmt { funcs with Format.out_newline; out_string }; funcs let print_full_transition fmt (cond,action) = Format.fprintf fmt "%a@\n%a" print_condition cond print_action action let trans_label num = "tr"^string_of_int(num) let print_trans fmt trans = Format.fprintf fmt "@[<2>%s:@ %a@]" (trans_label trans.numt) print_full_transition trans.cross let state_label num = "st"^string_of_int(num) let print_state_label fmt st = Format.fprintf fmt "@[<2>%s:@ %s@]" (state_label st.nums) st.name let print_bool3 fmt b = Format.pp_print_string fmt (match b with | True -> "True" | False -> "False" | Undefined -> "Undef") let print_transition fmt tr = Format.fprintf fmt "@[<2>{@ %d:@ %s@ {%a}@ %s@]}" tr.numt tr.start.name print_full_transition tr.cross tr.stop.name let print_transitionl fmt trl = Format.fprintf fmt "@[<2>Transitions:@\n%a@]" (Pretty_utils.pp_list ~sep:"@\n" ~suf:"@\n" print_transition) trl let print_state fmt st = Format.fprintf fmt "@[<2>%s@ (acc=%a;@ init=%a;@ num=%d)@]" st.name print_bool3 st.acceptation print_bool3 st.init st.nums let print_statel fmt stl = Format.fprintf fmt "@[<2>States:@\n%a@]" (Pretty_utils.pp_list ~sep:"@\n" ~suf:"@\n" print_state) stl let print_raw_automata fmt (stl,trl) = Format.fprintf fmt "@[<2>Automaton:@\n%a%a@]" print_statel stl print_transitionl trl let dot_state out st = let shape = if st.init = Bool3.True && st.acceptation=Bool3.True then "doubleoctagon" else if st.acceptation=Bool3.True then "octagon" else if st.init=Bool3.True then "doublecircle" else "circle" in Format.fprintf out "\"%a\" [shape = %s];@\n" print_state_label st shape let dot_trans out tr = let print_label fmt tr = if DotSeparatedLabels.get () then Format.pp_print_int fmt tr.numt else print_trans fmt tr in Format.fprintf out "\"%a\"@ ->@ \"%a\"@ [label = @[\"%a\"@]];@\n" print_state_label tr.start print_state_label tr.stop print_label tr let output_dot_automata (states_l,trans_l) fichier = let cout = open_out fichier in let fmt = formatter_of_out_channel cout in let output_functions = escape_newline fmt in let one_line_comment s = let l = String.length s in let fill = if l >= 75 then 0 else 75 - l in let spaces = String.make fill ' ' in Format.fprintf fmt "@[/* %s%s*/@\n@]" s spaces in one_line_comment "File generated by Aorai LTL2ACSL Plug-in"; one_line_comment ""; one_line_comment "Usage of dot files '.dot' :"; one_line_comment " dot -T > "; one_line_comment ""; one_line_comment " Allowed types : canon,dot,xdot,fig,gd,gd2,"; one_line_comment " gif,hpgl,imap,cmap,ismap,jpg,jpeg,mif,mp,pcl,pic,plain,"; one_line_comment " plain-ext,png,ps,ps2,svg,svgz,vrml,vtx,wbmp"; one_line_comment ""; one_line_comment " Example with postscript file :"; one_line_comment " dot property.dot -Tps > property.ps"; Format.fprintf fmt "@[<2>@\ndigraph %s {@\n@\n%a@\n%a@\n%t}@\n@]" (Filename.chop_extension (Filename.basename fichier)) (Pretty_utils.pp_list dot_state) states_l (Pretty_utils.pp_list dot_trans) trans_l (fun fmt -> if DotSeparatedLabels.get () then (Format.fprintf fmt "/* guards of transitions */@\ncomment=\"%a\";@\n" (Pretty_utils.pp_list ~sep:"@\n" print_trans) trans_l)); Format.pp_set_formatter_out_functions fmt output_functions; close_out cout (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/promelaoutput.mli0000666000000000000000000000562513571573400020211 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val print_raw_automata : Format.formatter -> Promelaast.typed_automaton -> unit val print_parsed_expression: Format.formatter -> Promelaast.expression -> unit val print_parsed_condition: Format.formatter -> Promelaast.condition -> unit val print_seq_elt: Format.formatter -> Promelaast.seq_elt -> unit val print_sequence: Format.formatter -> Promelaast.sequence -> unit val print_parsed: Format.formatter -> Promelaast.parsed_condition -> unit val print_condition: Format.formatter -> Promelaast.typed_condition -> unit val print_action: Format.formatter -> Promelaast.action -> unit val print_transition: Format.formatter -> (Promelaast.typed_condition * Promelaast.action) Promelaast.trans -> unit val print_transitionl: Format.formatter -> (Promelaast.typed_condition * Promelaast.action) Promelaast.trans list -> unit val print_state : Format.formatter -> Promelaast.state -> unit val print_statel : Format.formatter -> Promelaast.state list -> unit val output_dot_automata : Promelaast.typed_automaton -> string -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/aorai/promelaparser.mly0000666000000000000000000002046013571573400020157 0ustar /**************************************************************************/ /* */ /* This file is part of Aorai plug-in of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* INRIA (Institut National de Recherche en Informatique et en */ /* Automatique) */ /* INSA (Institut National des Sciences Appliquees) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* $Id: promelaparser.mly,v 1.2 2008-10-02 13:33:29 uid588 Exp $ */ /* Originated from http://www.ltl2dstar.de/down/ltl2dstar-0.4.2.zip */ %{ open Promelaast open Bool3 let observed_states=Hashtbl.create 1 let to_seq c = [{ condition = Some c; nested = []; min_rep = Some (PCst (Logic_ptree.IntConstant "1")); max_rep = Some (PCst (Logic_ptree.IntConstant "1")); }] %} %token PROMELA_OR %token PROMELA_AND %token PROMELA_NOT PROMELA_TRUE PROMELA_FALSE %right PROMELA_OR %right PROMELA_AND %nonassoc PROMELA_NOT PROMELA_TRUE PROMELA_FALSE %token PROMELA_NEVER PROMELA_IF PROMELA_FI PROMELA_GOTO PROMELA_SKIP %token PROMELA_LABEL %token PROMELA_COLON PROMELA_SEMICOLON PROMELA_DOUBLE_COLON %token PROMELA_LBRACE PROMELA_RBRACE PROMELA_LPAREN %token PROMELA_RPAREN PROMELA_RIGHT_ARROW %token PROMELA_TRUE PROMELA_FALSE %token PROMELA_CALLOF PROMELA_RETURNOF PROMELA_CALLORRETURNOF %token EOF %type promela %start promela %% promela : PROMELA_NEVER PROMELA_LBRACE states PROMELA_RBRACE EOF { let states= Hashtbl.fold (fun _ st l -> if st.acceptation=Undefined || st.init=Undefined then begin Aorai_option.abort "Error: the state %s is used but never defined" st.name; end; st::l ) observed_states [] in (states , $3) } | PROMELA_NEVER PROMELA_LBRACE states PROMELA_SEMICOLON PROMELA_RBRACE EOF { let states= Hashtbl.fold (fun _ st l -> if st.acceptation=Undefined || st.init=Undefined then begin Aorai_option.abort "Error: the state %s is used but never defined" st.name; end; st::l ) observed_states [] in (states , $3) } ; states : states PROMELA_SEMICOLON state { $1@$3 } | state { $1 } ; state : state_labels state_body { let (stl,trans)=$1 in let (trl,force_final)=$2 in if force_final then begin List.iter (fun s -> try (Hashtbl.find observed_states s.name).acceptation <- True with | Not_found -> assert false (* This state has to be in the hashtable -- by construction *) ) stl end; if trl=[] then trans else let tr_list= List.fold_left (fun l1 (cr,stop_st) -> List.fold_left (fun l2 st -> {start=st;stop=stop_st;cross=Seq (to_seq cr);numt=(-1)}::l2 ) l1 stl ) [] trl in (List.rev tr_list)@trans } ; state_labels : label state_labels { let (stl1,trl1)=$1 in let (stl2,trl2)=$2 in (stl1@stl2,trl1@trl2) } | label { $1 } ; label : PROMELA_LABEL PROMELA_COLON { begin (* Step 0 : trans is the set of new transitions and old is the description of the current state *) let trans = ref [] in (* Promela Label is a state. According to its name, we will try to give him its properties (init / accept) *) (* Firstly, if this state is still referenced, then we get it back. Else, we make a new "empty" state *) let old= try Hashtbl.find observed_states $1 with | Not_found -> let s = Data_for_aorai.new_state $1 in Hashtbl.add observed_states $1 s; s in (* Step 1 : setting up the acceptance status *) (* Default status : Non acceptation state *) old.acceptation <- False; (* Accept_all state means acceptance state with a reflexive transition without cross condition *) (* This case is not exclusive with the following. Acceptation status is set in this last. *) if (String.length $1>=10) && (String.compare (String.sub $1 0 10) "accept_all")=0 then trans:= {start=old;stop=old;cross=Seq (to_seq PTrue);numt=(-1)} :: !trans; (* If the name includes accept then this state is an acceptation one. *) if (String.length $1>=7) && (String.compare (String.sub $1 0 7) "accept_")=0 then old.acceptation <- True; (* Step 2 : setting up the init status *) (* If the state name ended with "_init" then it is an initial state. Else, it is not. *) if (String.length $1>=5) && (String.compare (String.sub $1 ((String.length $1)-5) 5) "_init" ) = 0 then old.init <- True else old.init <- False; ([old],!trans) end } ; state_body : PROMELA_IF transitions PROMELA_FI { ($2,false) } | PROMELA_SKIP { ([],false) } | PROMELA_FALSE { ([],true) } | PROMELA_IF PROMELA_DOUBLE_COLON PROMELA_FALSE PROMELA_FI { ([],true) } ; transitions : transitions transition { $1@[$2] } | transition { [$1] } ; transition : PROMELA_DOUBLE_COLON guard PROMELA_RIGHT_ARROW PROMELA_GOTO PROMELA_LABEL { let s= try Hashtbl.find observed_states $5 with Not_found -> let r = Data_for_aorai.new_state $5 in Hashtbl.add observed_states $5 r; r in ($2,s) } ; guard : PROMELA_CALLORRETURNOF { POr(PCall ($1,None), PReturn $1) } | PROMELA_CALLOF { PCall ($1,None) } | PROMELA_RETURNOF { PReturn $1 } | PROMELA_TRUE { PTrue } | PROMELA_FALSE { PFalse } | PROMELA_NOT guard { PNot $2 } | guard PROMELA_AND guard { PAnd ($1,$3) } | guard PROMELA_OR guard { POr ($1,$3) } | PROMELA_LPAREN guard PROMELA_RPAREN { $2 } | PROMELA_LABEL { PRel (Logic_ptree.Neq,PVar $1,PCst(Logic_ptree.IntConstant "0")) } ; frama-c-20.0-Calcium/src/plugins/aorai/promelaparser_withexps.mly0000666000000000000000000002511513571573400022114 0ustar /**************************************************************************/ /* */ /* This file is part of Aorai plug-in of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* INRIA (Institut National de Recherche en Informatique et en */ /* Automatique) */ /* INSA (Institut National des Sciences Appliquees) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* $Id: promelaparser_withexps.mly,v 1.2 2008-10-02 13:33:29 uid588 Exp $ */ /* Originated from http://www.ltl2dstar.de/down/ltl2dstar-0.4.2.zip */ %{ open Logic_ptree open Promelaast open Bool3 let observed_states=Hashtbl.create 1 let to_seq c = [{ condition = Some c; nested = []; min_rep = Some (PCst (IntConstant "1")); max_rep = Some (PCst (IntConstant "1")); }] %} %token PROMELA_OR %token PROMELA_AND %token PROMELA_NOT PROMELA_TRUE PROMELA_FALSE %right PROMELA_OR %right PROMELA_AND %nonassoc PROMELA_NOT PROMELA_TRUE PROMELA_FALSE %token PROMELA_NEVER PROMELA_IF PROMELA_FI PROMELA_GOTO PROMELA_SKIP %token PROMELA_LABEL %token PROMELA_INT %token PROMELA_COLON PROMELA_SEMICOLON PROMELA_DOUBLE_COLON %token PROMELA_LBRACE PROMELA_RBRACE PROMELA_LPAREN %token PROMELA_RPAREN PROMELA_RIGHT_ARROW %token PROMELA_TRUE PROMELA_FALSE /* Logic relations */ %token PROMELA_EQ PROMELA_LT PROMELA_GT PROMELA_LE PROMELA_GE PROMELA_NEQ %right PROMELA_EQ PROMELA_LT PROMELA_GT PROMELA_LE PROMELA_GE PROMELA_NEQ /* Arithmetic relations */ %token PROMELA_PLUS PROMELA_MINUS %token PROMELA_DIV PROMELA_STAR PROMELA_MODULO %right PROMELA_PLUS PROMELA_MINUS PROMELA_DIV PROMELA_STAR PROMELA_MODULO /* Access */ %token PROMELA_DOT PROMELA_LEFT_SQUARE PROMELA_RIGHT_SQUARE %token PROMELA_CALLOF PROMELA_RETURNOF PROMELA_CALLORRETURNOF %token EOF %token PROMELA_FUNC %type promela %start promela %% promela : PROMELA_NEVER PROMELA_LBRACE states PROMELA_RBRACE EOF { let states= Hashtbl.fold (fun _ st l -> if st.acceptation=Undefined || st.init=Undefined then begin Format.print_string ("Error: the state '"^(st.name)^"' is used but never defined.\n"); exit 1 end; st::l ) observed_states [] in (states , $3) } | PROMELA_NEVER PROMELA_LBRACE states PROMELA_SEMICOLON PROMELA_RBRACE EOF { let states= Hashtbl.fold (fun _ st l -> if st.acceptation=Undefined || st.init=Undefined then begin Aorai_option.abort "Error: state %s is used bug never defined" st.name end; st::l ) observed_states [] in (states , $3) } ; states : states PROMELA_SEMICOLON state { $1@$3 } | state { $1 } ; state : state_labels state_body { let (stl,trans)=$1 in let (trl,force_final)=$2 in if force_final then begin List.iter (fun s -> try (Hashtbl.find observed_states s.name).acceptation <- True with | Not_found -> assert false (* This state has to be in the hashtable -- by construction *) ) stl end; if trl=[] then trans else let tr_list= List.fold_left (fun l1 (cr,stop_st) -> List.fold_left (fun l2 st -> {start=st;stop=stop_st;cross=Seq (to_seq cr);numt=(-1)}::l2 ) l1 stl ) [] trl in (List.rev tr_list)@trans } ; state_labels : label state_labels { let (stl1,trl1)=$1 in let (stl2,trl2)=$2 in (stl1@stl2,trl1@trl2) } | label { $1 } ; label : PROMELA_LABEL PROMELA_COLON { begin (* Step 0 : trans is the set of new transitions and old is the description of the current state *) let trans = ref [] in (* Promela Label is a state. According to its name, we will try to give him its properties (init / accept) *) (* Firstly, if this state is still referenced, then we get it back. Else, we make a new "empty" state *) let old= try Hashtbl.find observed_states $1 with | Not_found -> let s = Data_for_aorai.new_state $1 in Hashtbl.add observed_states $1 s; s in (* Step 1 : setting up the acceptance status *) (* Default status : Non acceptation state *) old.acceptation <- False; (* Accept_all state means acceptance state with a reflexive transition without cross condition *) (* This case is not exclusive with the following. Acceptation status is set in this last. *) if (String.length $1>=10) && (String.compare (String.sub $1 0 10) "accept_all")=0 then trans:= {start=old;stop=old;cross=Seq (to_seq PTrue);numt=(-1)}::!trans; (* If the name includes accept then this state is an acceptation one. *) if (String.length $1>=7) && (String.compare (String.sub $1 0 7) "accept_")=0 then old.acceptation <- True; (* Step 2 : setting up the init status *) (* If the state name ended with "_init" then it is an initial state. Else, it is not. *) if (String.length $1>=5) && (String.compare (String.sub $1 ((String.length $1)-5) 5) "_init" ) = 0 then old.init <- True else old.init <- False; ([old],!trans) end } ; state_body : PROMELA_IF transitions PROMELA_FI { ($2,false) } | PROMELA_SKIP { ([],false) } | PROMELA_FALSE { ([],true) } | PROMELA_IF PROMELA_DOUBLE_COLON PROMELA_FALSE PROMELA_FI { ([],true) } ; transitions : transitions transition { $1@[$2] } | transition { [$1] } ; transition : PROMELA_DOUBLE_COLON guard PROMELA_RIGHT_ARROW PROMELA_GOTO PROMELA_LABEL { let s= try Hashtbl.find observed_states $5 with Not_found -> let r = Data_for_aorai.new_state $5 in Hashtbl.add observed_states $5 r; r in ($2,s) } ; guard : PROMELA_CALLORRETURNOF { POr(PCall ($1,None), PReturn $1) } | PROMELA_CALLOF { PCall ($1,None) } | PROMELA_RETURNOF { PReturn $1 } | PROMELA_TRUE { PTrue } | PROMELA_FALSE { PFalse } | PROMELA_NOT guard { PNot $2 } | guard PROMELA_AND guard { PAnd ($1,$3) } | guard PROMELA_OR guard { POr ($1,$3) } | PROMELA_LPAREN guard PROMELA_RPAREN { $2 } | logic_relation { $1 } ; logic_relation : arith_relation PROMELA_EQ arith_relation { PRel(Eq, $1, $3) } | arith_relation PROMELA_LT arith_relation { PRel(Lt, $1, $3) } | arith_relation PROMELA_GT arith_relation { PRel(Gt, $1, $3) } | arith_relation PROMELA_LE arith_relation { PRel(Le, $1, $3) } | arith_relation PROMELA_GE arith_relation { PRel(Ge, $1, $3) } | arith_relation PROMELA_NEQ arith_relation { PRel(Neq,$1, $3) } | arith_relation { PRel(Neq,$1, PCst(IntConstant "0")) } ; /* returns a Cil_types.exp expression */ arith_relation : arith_relation_mul PROMELA_PLUS arith_relation { PBinop(Badd, $1 , $3)} | arith_relation_mul PROMELA_MINUS arith_relation { PBinop(Bsub,$1,$3) } | arith_relation_mul { $1 } ; arith_relation_mul : arith_relation_mul PROMELA_DIV access_or_const { PBinop(Bdiv,$1,$3) } | arith_relation_mul PROMELA_STAR access_or_const { PBinop(Bmul,$1,$3) } | arith_relation_mul PROMELA_MODULO access_or_const { PBinop(Bmod,$1,$3) } | access_or_const { $1 } ; access_or_const : PROMELA_INT { PCst(IntConstant $1) } | PROMELA_MINUS PROMELA_INT { PUnop (Uminus, PCst (IntConstant $2)) } | access { $1 } | PROMELA_LPAREN arith_relation PROMELA_RPAREN { $2 } ; access : access PROMELA_DOT PROMELA_LABEL { PField ($1,$3) } | access_array {$1} access_array : access_array PROMELA_LEFT_SQUARE access_or_const PROMELA_RIGHT_SQUARE { PArrget($1,$3) } | access_leaf {$1} access_leaf : PROMELA_STAR access { PUnop(Ustar,$2) } | PROMELA_LABEL PROMELA_FUNC PROMELA_DOT PROMELA_LABEL { PPrm($1,$4) } | PROMELA_LABEL { PVar $1 } | PROMELA_LPAREN access PROMELA_RPAREN { $2 } ; frama-c-20.0-Calcium/src/plugins/aorai/tests/0000777000000000000000000000000013571573400015720 5ustar frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/0000777000000000000000000000000013571573400017013 5ustar frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/Aorai_test.ml0000666000000000000000000000602213571573400021437 0ustar (* Small script to test that the code generated by aorai can be parsed again * by frama-c. *) open Kernel module StdString = String include Plugin.Register (struct let name = "aorai testing module" let shortname = "aorai-test" let help = "utility script for aorai regtests" end) module TestNumber = Zero (struct let option_name = "-aorai-test-number" let help = "test number when multiple tests are run over the same file" let arg_name = "n" end) module InternalWpShare = Empty_string( struct let option_name = "-aorai-test-wp-share" let help = "use custom wp share dir (when in internal plugin mode)" let arg_name = "dir" end) module ProveAuxSpec = False( struct let option_name = "-aorai-test-prove-aux-spec" let help = "use WP + alt-ergo to prove that generated spec and body \ of auxiliary automata functions match" end) let ok = ref false let is_suffix suf str = let lsuf = StdString.length suf in let lstr = StdString.length str in if lstr <= lsuf then false else let estr = StdString.sub str (lstr - lsuf) lsuf in estr = suf let extend () = let myrun = let run = !Db.Toplevel.run in fun f -> let my_project = Project.create "Reparsing" in let wp_compute_kf = Dynamic.get ~plugin:"Wp" "wp_compute_kf" Datatype.( func3 (option Kernel_function.ty) (list string) (list string) unit) in let check_auto_func kf = let name = Kernel_function.get_name kf in if Kernel_function.is_definition kf && (is_suffix "_pre_func" name || is_suffix "_post_func" name) then wp_compute_kf (Some kf) [] [] in run f; let tmpfile = Filename.get_temp_dir_name () ^ "/aorai_" ^ (Filename.chop_extension (Filename.basename (List.hd (Kernel.Files.get())))) ^ "_" ^ (string_of_int (TestNumber.get ())) ^ ".i" in let () = Extlib.safe_at_exit (fun () -> if Debug.get () >= 1 || not !ok then result "Keeping temp file %s" tmpfile else Extlib.safe_remove tmpfile) in let chan = open_out tmpfile in let fmt = Format.formatter_of_out_channel chan in File.pretty_ast ~prj:(Project.from_unique_name "aorai") ~fmt (); close_out chan; let selection = State_selection.of_list [ InternalWpShare.self; ProveAuxSpec.self ] in Project.copy ~selection my_project; Project.set_current my_project; Files.append_after [ tmpfile ]; Constfold.off (); Ast.compute(); if ProveAuxSpec.get () then begin let wp_share = InternalWpShare.get() in if wp_share <> "" then Dynamic.Parameter.String.set "-wp-share" wp_share; Dynamic.Parameter.Int.set "-wp-verbose" 0; Globals.Functions.iter check_auto_func; end; File.pretty_ast (); ok:=true (* no error, we can erase the file *) in Db.Toplevel.run := myrun let () = extend () frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/assigns.c0000666000000000000000000000120613571573400020625 0ustar /* run.config* EXECNOW: make -s @PTEST_DIR@/name_projects.cmxs OPT: -aorai-automata tests/aorai/assigns.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ OPT: -aorai-automata tests/aorai/assigns_det.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ OPT: -aorai-automata tests/aorai/assigns.ya -load-module @PTEST_DIR@/name_projects -aorai-test 1 -then -print */ int X; void f(void) { X++; } /*@ assigns X; behavior foo: assigns X; */ int main () { //@ assigns X; X++; //@ assigns X; f(); return X; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/assigns.ya0000666000000000000000000000023713571573400021017 0ustar %init: S1; %accept: S2; S1: { CALL(main) } -> Sf; Sf: { CALL(f) } -> S_in_f; S_in_f: { RETURN(f) } -> in_main; in_main: { RETURN(main) } -> S2; S2: -> S2;frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/assigns_det.ya0000666000000000000000000000025713571573400021655 0ustar %init: S1; %accept: S2; %deterministic; S1: { CALL(main) } -> Sf; Sf: { CALL(f) } -> S_in_f; S_in_f: { RETURN(f) } -> in_main; in_main: { RETURN(main) } -> S2; S2: -> S2;frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/bts1289-2.ya0000666000000000000000000000016113571573400020617 0ustar %init: init; %accept: S; init: { CALL(main) } -> S; S: { a() } -> T | { RETURN(main) } -> S; T: { a() } -> S; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/bts1289.i0000666000000000000000000000064213571573400020303 0ustar /* run.config* OPT: -aorai-automata tests/aorai/bts1289.ya -load-module tests/aorai/Aorai_test.cmxs -aorai-test 1 -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ OPT: -aorai-automata tests/aorai/bts1289-2.ya -load-module tests/aorai/Aorai_test.cmxs -aorai-test 1 -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ void a(void) {} void main(void) { //@ loop assigns i; for (int i=0; i<10; ++i) a(); } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/bts1289.ya0000666000000000000000000000010213571573400020453 0ustar %init: S; %accept: S; S: { CALL(a) } -> T; T: { CALL(a) } -> S; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/call_tree.c0000666000000000000000000000026013571573400021107 0ustar /* run.config* DONTRUN: small example related to U3CAT's WP2 */ int x; void f(void) { x = 2; } void g(void) { x++; } int main() { if (!x) { f(); } g(); return 0; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/call_tree.ltl0000666000000000000000000000020413571573400021456 0ustar CALL(main) && _X_ ((x == 0 && CALL(f) && _X_ (RETURN(f) && _X_ (CALL(g) && _X_ RETURN(g)))) || (x!=0 && (CALL(g) && _X_ RETURN(g))))frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/declared_function.i0000666000000000000000000000032613571573400022636 0ustar /* run.config* OPT: -aorai-automata @PTEST_DIR@/@PTEST_NAME@.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int f(void); void main(void) { f(); } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/declared_function.ya0000666000000000000000000000016013571573400023013 0ustar %init : I; %deterministic; I : { f().return == 0} -> I | { f().return == 1 + 2 } -> I | other -> I ; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/deterministic.i0000666000000000000000000000057013571573400022032 0ustar /* run.config* OPT: -aorai-automata tests/aorai/deterministic.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int X; int Y; void g(int x) { Y=x; } int f(int x) { X=x; g(X); X++; g(X); return 0; } int real_main (int c) { if (c) f(4); return 0; } int main (int c) { return real_main(c); } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/deterministic.ya0000666000000000000000000000054313571573400022213 0ustar %init: Si; %accept: Sf; %deterministic; Si: { CALL(main) } -> S0; S0: { real_main().c == 0 } -> S2 | { real_main().c != 0 } -> S1; S1: { f().x == 4 } -> S3 | { f().return == 0 && X == 5 } -> S2; S2: { RETURN(real_main) } -> Sf; S3: { g().x == 4 } -> S4 | { g().x == 5 } -> S5; S4: { RETURN(g) } -> S3; S5: { RETURN(g) } -> S1; Sf: -> Sf;frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/formals.i0000666000000000000000000000037313571573400020633 0ustar /* run.config* OPT: -aorai-automata tests/aorai/formals.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int f(int x) { return x; } int g(int y) { return y; } int main() { f(1); g(2); } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/formals.ya0000666000000000000000000000025413571573400021012 0ustar %init: init; %accept: OK; %deterministic; init: { CALL(main) } -> main; main: { [f{{x==1}}(){{ x == 1}};g(){{y==2}}] } -> OK | { f{{x==3}}(){{x==3}} } -> OK; OK: -> OK; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/generate_assigns_bts1290.i0000666000000000000000000000040313571573400023667 0ustar /* run.config* OPT: -aorai-automata tests/aorai/generate_assigns_bts1290.ya -load-module tests/aorai/Aorai_test.cmxs -aorai-test 1 -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ void main(void) { //@ loop assigns i; for (int i=0; i<10; ++i) ; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/generate_assigns_bts1290.ya0000666000000000000000000000004113571573400024046 0ustar %init: S; %accept: S; S: -> S; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/goto.c0000666000000000000000000000112013571573400020121 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/goto.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int status=0; int rr=1; //@ global invariant inv : 0<=rr<=5000; /*@ requires rr<5000; @ behavior j : @ ensures rr<5001; */ void opa() { rr++; } void opb () { status=1; } void opc () { rr=60000; } int main(){ if (rr<5000) goto L; opc(); L4: goto L5; L: opa(); goto L2; opc(); L6: return 1; L3: goto L4; opc(); goto L2; L2 : goto L3; L5: opb(); goto L6; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/goto.ltl0000666000000000000000000000016313571573400020500 0ustar CALL(main) && _X_ (CALL(opa) && _X_ (!RETURN(opb) && _X_ (!CALL(opa) && _X_ (RETURN(opb) && _X_ (RETURN(main)))))) frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/hoare_seq.i0000666000000000000000000000050313571573400021131 0ustar /* run.config* OPT: -aorai-automata tests/aorai/hoare_seq.ya -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ void f(void) { } /*@ behavior bhv: assumes c > 0; ensures \result == 0; */ int main(int c) { if (c <= 0) { f (); } return 0; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/hoare_seq.ya0000666000000000000000000000017113571573400021313 0ustar %init: S0; %accept: Sf; S0: { main::bhv() } -> Sf | { main {{ c <= 0 }} (f()) {{ \result == 0 }} } -> Sf; Sf: -> Sf; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/incorrect.i0000666000000000000000000000033713571573400021160 0ustar /* run.config* OPT: -aorai-automata @PTEST_DIR@/@PTEST_NAME@.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int f(void); int main(void) { return f(); } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/incorrect.ya0000666000000000000000000000010613571573400021333 0ustar %init: s0; %accept: OK; %deterministic; s0: { f() } -> OK; OK: -> OK;frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/loop_bts1050.i0000666000000000000000000000054413571573400021317 0ustar /* run.config* OPT: -aorai-automata tests/aorai/loop_bts1050.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-acceptance -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ void f(){}; void g(){}; int main(int c){ if (c<0){ c = 0;} if (c>0){ c = 5;} while (c){ f(); g(); c--; } return 0; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/loop_bts1050.ya0000666000000000000000000000012213571573400021470 0ustar %init : S0; %accept : Sf; S0 : {[ main( [ f(); g() ]{0,5} ) ]} -> Sf; Sf: -> Sf; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/monostate.i0000666000000000000000000000034213571573400021175 0ustar /* run.config OPT: -aorai-automata @PTEST_DIR@/@PTEST_NAME@.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ void f(void) {} void main(void) { while (1) f(); } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/monostate.ya0000666000000000000000000000013513571573400021356 0ustar %init : Init; %deterministic; %accept: Init; Init : { main() } -> Init | other -> Init ; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/name_projects.ml0000666000000000000000000000023213571573400022173 0ustar let run () = let print_one p = Kernel.feedback "Found %a" Project.pretty p in Project.iter_on_projects print_one let () = Cmdline.at_normal_exit run frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/not_prm.i0000666000000000000000000000033513571573400020644 0ustar /* run.config* OPT: -aorai-automata tests/aorai/not_prm.ya -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test -main f -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int f(int x) { return x; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/not_prm.ya0000666000000000000000000000007713571573400021030 0ustar %init: S0; %accept: Sf; S0: { !f().x < 4 } -> Sf; Sf: -> Sf; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/0000777000000000000000000000000013571573400020260 5ustar frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/assigns.0.res.oracle0000666000000000000000000001473113571573400024052 0ustar [kernel] Parsing tests/aorai/assigns.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_assigns_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_f = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int X; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 1; */ /*@ ghost int S2 = 0; */ /*@ ghost int S_in_f = 0; */ /*@ ghost int Sf = 0; */ /*@ ghost int in_main = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S_in_f_in: assumes 1 ≡ Sf; ensures 1 ≡ S_in_f; behavior buch_state_S_in_f_out: assumes 0 ≡ Sf; ensures 0 ≡ S_in_f; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_in_main_out: ensures 0 ≡ in_main; @/ void f_pre_func(void) { int S1_tmp; int S2_tmp; int S_in_f_tmp; int Sf_tmp; int in_main_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S1_tmp = S1; S2_tmp = S2; S_in_f_tmp = S_in_f; Sf_tmp = Sf; in_main_tmp = in_main; in_main_tmp = 0; Sf_tmp = 0; if (Sf == 1) S_in_f_tmp = 1; else S_in_f_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S_in_f = S_in_f_tmp; Sf = Sf_tmp; in_main = in_main_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S_in_f ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ Sf ∧ 0 ≡ in_main; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S_in_f_out: ensures 0 ≡ S_in_f; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_in_main_in: assumes 1 ≡ S_in_f; ensures 1 ≡ in_main; behavior buch_state_in_main_out: assumes 0 ≡ S_in_f; ensures 0 ≡ in_main; @/ void f_post_func(void) { int S1_tmp; int S2_tmp; int S_in_f_tmp; int Sf_tmp; int in_main_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S1_tmp = S1; S2_tmp = S2; S_in_f_tmp = S_in_f; Sf_tmp = Sf; in_main_tmp = in_main; if (S_in_f == 1) in_main_tmp = 1; else in_main_tmp = 0; Sf_tmp = 0; S_in_f_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S_in_f = S_in_f_tmp; Sf = Sf_tmp; in_main = in_main_tmp; return; } */ /*@ requires 1 ≡ Sf ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S_in_f ∧ 0 ≡ in_main; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S_in_f ∧ 0 ≡ Sf; ensures 1 ≡ in_main; */ void f(void) { /*@ ghost f_pre_func(); */ X ++; /*@ ghost f_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S_in_f_out: ensures 0 ≡ S_in_f; behavior buch_state_Sf_in: assumes 1 ≡ S1; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ S1; ensures 0 ≡ Sf; behavior buch_state_in_main_out: ensures 0 ≡ in_main; @/ void main_pre_func(void) { int S1_tmp; int S2_tmp; int S_in_f_tmp; int Sf_tmp; int in_main_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S_in_f_tmp = S_in_f; Sf_tmp = Sf; in_main_tmp = in_main; in_main_tmp = 0; if (S1 == 1) Sf_tmp = 1; else Sf_tmp = 0; S_in_f_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S_in_f = S_in_f_tmp; Sf = Sf_tmp; in_main = in_main_tmp; return; } */ /*@ ghost /@ requires 1 ≡ in_main ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S_in_f ∧ 0 ≡ Sf; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ in_main; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ in_main; ensures 0 ≡ S2; behavior buch_state_S_in_f_out: ensures 0 ≡ S_in_f; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_in_main_out: ensures 0 ≡ in_main; @/ void main_post_func(int res) { int S1_tmp; int S2_tmp; int S_in_f_tmp; int Sf_tmp; int in_main_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S_in_f_tmp = S_in_f; Sf_tmp = Sf; in_main_tmp = in_main; in_main_tmp = 0; Sf_tmp = 0; S_in_f_tmp = 0; if (in_main == 1) S2_tmp = 1; else S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S_in_f = S_in_f_tmp; Sf = Sf_tmp; in_main = in_main_tmp; return; } */ /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S_in_f ∧ 0 ≡ Sf ∧ 0 ≡ in_main; assigns X, aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior foo: assigns X, aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S_in_f ∧ 0 ≡ Sf ∧ 0 ≡ in_main; ensures 1 ≡ S2; */ int main(void) { /*@ ghost main_pre_func(); */ /*@ assigns X; */ X ++; /*@ assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main, X; */ f(); /*@ ghost main_post_func(X); */ return X; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/assigns.1.res.oracle0000666000000000000000000001335013571573400024047 0ustar [kernel] Parsing tests/aorai/assigns.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_assigns_1.i (no preprocessing) /* Generated by Frama-C */ enum aorai_States { aorai_reject_state = -2, S1 = 0, S2 = 1, S_in_f = 2, Sf = 3, in_main = 4 }; enum aorai_ListOper { op_f = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ lemma in_main_deterministic_trans{L}: \true; */ /*@ lemma Sf_deterministic_trans{L}: \true; */ /*@ lemma S_in_f_deterministic_trans{L}: \true; */ /*@ lemma S2_deterministic_trans{L}: \true; */ /*@ lemma S1_deterministic_trans{L}: \true; */ int X; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int aorai_CurStates = S1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S_in_f_in: assumes aorai_CurStates ≡ Sf; ensures aorai_CurStates ≡ S_in_f; behavior buch_state_S_in_f_out: assumes aorai_CurStates ≢ Sf; ensures aorai_CurStates ≢ S_in_f; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_in_main_out: ensures aorai_CurStates ≢ in_main; @/ void f_pre_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (3 == aorai_CurStates) aorai_CurStates_tmp = S_in_f; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ S_in_f; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S_in_f_out: ensures aorai_CurStates ≢ S_in_f; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_in_main_in: assumes aorai_CurStates ≡ S_in_f; ensures aorai_CurStates ≡ in_main; behavior buch_state_in_main_out: assumes aorai_CurStates ≢ S_in_f; ensures aorai_CurStates ≢ in_main; @/ void f_post_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (2 == aorai_CurStates) aorai_CurStates_tmp = in_main; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ Sf; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ in_main; */ void f(void) { /*@ ghost f_pre_func(); */ X ++; /*@ ghost f_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S_in_f_out: ensures aorai_CurStates ≢ S_in_f; behavior buch_state_Sf_in: assumes aorai_CurStates ≡ S1; ensures aorai_CurStates ≡ Sf; behavior buch_state_Sf_out: assumes aorai_CurStates ≢ S1; ensures aorai_CurStates ≢ Sf; behavior buch_state_in_main_out: ensures aorai_CurStates ≢ in_main; @/ void main_pre_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (0 == aorai_CurStates) aorai_CurStates_tmp = Sf; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ in_main; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_in: assumes aorai_CurStates ≡ in_main; ensures aorai_CurStates ≡ S2; behavior buch_state_S2_out: assumes aorai_CurStates ≢ in_main; ensures aorai_CurStates ≢ S2; behavior buch_state_S_in_f_out: ensures aorai_CurStates ≢ S_in_f; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_in_main_out: ensures aorai_CurStates ≢ in_main; @/ void main_post_func(int res) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (4 == aorai_CurStates) aorai_CurStates_tmp = S2; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ S1; assigns X, aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior foo: assigns X, aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ S2; */ int main(void) { /*@ ghost main_pre_func(); */ /*@ assigns X; */ X ++; /*@ assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates, X; */ f(); /*@ ghost main_post_func(X); */ return X; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/assigns.2.res.oracle0000666000000000000000000000057013571573400024050 0ustar [kernel] Parsing tests/aorai/assigns.c (with preprocessing) [aorai] Welcome to the Aorai plugin /* Generated by Frama-C */ int X; void f(void) { X ++; return; } /*@ assigns X; behavior foo: assigns X; */ int main(void) { /*@ assigns X; */ X ++; /*@ assigns X; */ f(); return X; } [kernel] Found project "default" [kernel] Found project "aorai" frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/bts1289.0.res.oracle0000666000000000000000000000567413571573400023525 0ustar [kernel] Parsing tests/aorai/bts1289.i (no preprocessing) [aorai] Welcome to the Aorai plugin [aorai] Warning: Call to main does not follow automaton's specification. This path is assumed to be dead [kernel] Parsing /tmp/aorai_bts1289_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_a = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, S; behavior buch_state_S_out: ensures 0 ≡ S; @/ void a_pre_func(void) { int S_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_a; S_tmp = S; S_tmp = 0; S = S_tmp; return; } */ /*@ ghost /@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, S; behavior buch_state_S_out: ensures 0 ≡ S; @/ void a_post_func(void) { int S_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_a; S_tmp = S; S_tmp = 0; S = S_tmp; return; } */ /*@ requires \false; behavior Buchi_behavior_out_0: ensures 0 ≡ S; */ void a(void) { /*@ ghost a_pre_func(); */ /*@ ghost a_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S; behavior buch_state_S_out: ensures 0 ≡ S; @/ void main_pre_func(void) { int S_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S_tmp = S; S_tmp = 0; S = S_tmp; return; } */ /*@ ghost /@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S; behavior buch_state_S_out: ensures 0 ≡ S; @/ void main_post_func(void) { int S_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S_tmp = S; S_tmp = 0; S = S_tmp; return; } */ /*@ requires \false; behavior Buchi_behavior_out_0: ensures 0 ≡ S; */ void main(void) { /*@ ghost int aorai_Loop_Init_4; */ /*@ ghost main_pre_func(); */ int i = 0; /*@ ghost aorai_Loop_Init_4 = 1; */ aorai_loop_4: /*@ loop invariant Aorai: 0 ≡ S; loop assigns i, aorai_Loop_Init_4, aorai_CurOpStatus, aorai_CurOperation, S; loop assigns aorai_Loop_Init_4 \from \nothing; */ while (i < 10) { /*@ ghost aorai_Loop_Init_4 = 0; */ a(); i ++; } /*@ ghost main_post_func(); */ return; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/bts1289.1.res.oracle0000666000000000000000000002272613571573400023523 0ustar [kernel] Parsing tests/aorai/bts1289.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_bts1289_1.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_a = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S = 0; */ /*@ ghost int T = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int init = 1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; behavior buch_state_S_out: ensures 0 ≡ S; behavior buch_state_T_out: ensures 0 ≡ T; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S; ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ T; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ T; ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_init_out: ensures 0 ≡ init; @/ void a_pre_func(void) { int S_tmp; int T_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_a; S_tmp = S; T_tmp = T; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; init_tmp = init; init_tmp = 0; if (T == 1) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; if (S == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; T_tmp = 0; S_tmp = 0; S = S_tmp; T = T_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; init = init_tmp; return; } */ /*@ ghost /@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S ∧ 0 ≡ T ∧ 0 ≡ init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; behavior buch_state_S_in: assumes 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ aorai_intermediate_state_0; ensures 0 ≡ S; behavior buch_state_T_in: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ T; behavior buch_state_T_out: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ T; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_init_out: ensures 0 ≡ init; @/ void a_post_func(void) { int S_tmp; int T_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_a; S_tmp = S; T_tmp = T; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; init_tmp = init; init_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) T_tmp = 1; else T_tmp = 0; if (aorai_intermediate_state_0 == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; T = T_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; init = init_tmp; return; } */ /*@ requires (1 ≡ S ∨ 1 ≡ T) ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ init; requires 1 ≡ T ∨ 0 ≡ T; requires 1 ≡ S ∨ 0 ≡ S; behavior Buchi_behavior_in_0: assumes 1 ≡ S; ensures 1 ≡ T; behavior Buchi_behavior_in_1: assumes 1 ≡ T; ensures 1 ≡ S; behavior Buchi_behavior_out_0: assumes 0 ≡ T; ensures 0 ≡ S; behavior Buchi_behavior_out_1: assumes 0 ≡ S; ensures 0 ≡ T; behavior Buchi_behavior_out_2: ensures 0 ≡ aorai_intermediate_state; behavior Buchi_behavior_out_3: ensures 0 ≡ aorai_intermediate_state_0; behavior Buchi_behavior_out_4: ensures 0 ≡ init; */ void a(void) { /*@ ghost a_pre_func(); */ /*@ ghost a_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; behavior buch_state_S_in: assumes 1 ≡ init; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ init; ensures 0 ≡ S; behavior buch_state_T_out: ensures 0 ≡ T; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_init_out: ensures 0 ≡ init; @/ void main_pre_func(void) { int S_tmp; int T_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S_tmp = S; T_tmp = T; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; init_tmp = init; init_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; T_tmp = 0; if (init == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; T = T_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; init = init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S ∧ 0 ≡ T ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; behavior buch_state_S_in: assumes 1 ≡ S; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ S; ensures 0 ≡ S; behavior buch_state_T_out: ensures 0 ≡ T; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_init_out: ensures 0 ≡ init; @/ void main_post_func(void) { int S_tmp; int T_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S_tmp = S; T_tmp = T; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; init_tmp = init; init_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; T_tmp = 0; if (S == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; T = T_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; init = init_tmp; return; } */ /*@ requires 1 ≡ init ∧ 0 ≡ S ∧ 0 ≡ T ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0; behavior Buchi_property_behavior: ensures 0 ≡ T ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ init; ensures 1 ≡ S; */ void main(void) { /*@ ghost int aorai_Loop_Init_4; */ /*@ ghost main_pre_func(); */ int i = 0; /*@ ghost aorai_Loop_Init_4 = 1; */ aorai_loop_4: /*@ loop invariant Aorai: 1 ≡ S ∨ 0 ≡ S; loop invariant Aorai: 1 ≡ T ∨ 0 ≡ T; loop invariant Aorai: 0 ≡ aorai_intermediate_state; loop invariant Aorai: 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: 0 ≡ init; loop invariant Aorai: 1 ≡ S ∨ 1 ≡ T; loop invariant Aorai: aorai_Loop_Init_4 ≢ 0 ⇒ \at(1 ≡ init,Pre) ⇒ 0 ≡ T; loop assigns i, aorai_Loop_Init_4, aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; loop assigns aorai_Loop_Init_4 \from \nothing; */ while (i < 10) { /*@ ghost aorai_Loop_Init_4 = 0; */ a(); i ++; } /*@ ghost main_post_func(); */ return; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/declared_function.res.oracle0000666000000000000000000000657313571573400025722 0ustar [kernel] Parsing tests/aorai/declared_function.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_declared_function_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_States { aorai_reject_state = -2, I = 0 }; enum aorai_ListOper { op_f = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int f(void); /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ lemma I_deterministic_trans{L}: (∀ int __retres_f; ¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ __retres_f ≡ 0 ∧ (¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated) ∨ (\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ __retres_f ≢ 1 + 2 ∧ __retres_f ≢ 0)))) ∧ (∀ int __retres_f; ¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ __retres_f ≡ 1 + 2 ∧ (¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated) ∨ (\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ __retres_f ≢ 1 + 2 ∧ __retres_f ≢ 0)))) ∧ (∀ int __retres_f; ¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ __retres_f ≡ 1 + 2 ∧ \at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ __retres_f ≡ 0)); */ /*@ ghost int aorai_CurStates = I; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_I_in: assumes aorai_CurStates ≡ I; ensures aorai_CurStates ≡ I; behavior buch_state_I_out: assumes aorai_CurStates ≢ I; ensures aorai_CurStates ≢ I; @/ void main_pre_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (0 == aorai_CurStates) aorai_CurStates_tmp = I; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ I; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_I_in: assumes aorai_CurStates ≡ I; ensures aorai_CurStates ≡ I; behavior buch_state_I_out: assumes aorai_CurStates ≢ I; ensures aorai_CurStates ≢ I; @/ void main_post_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (0 == aorai_CurStates) aorai_CurStates_tmp = I; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ I; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ I; */ void main(void) { /*@ ghost main_pre_func(); */ f(); /*@ ghost main_post_func(); */ return; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/deterministic.res.oracle0000666000000000000000000003435513571573400025114 0ustar [kernel] Parsing tests/aorai/deterministic.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_deterministic_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_States { aorai_reject_state = -2, S0 = 0, S1 = 1, S2 = 2, S3 = 3, S4 = 4, S5 = 5, Sf = 6, Si = 7 }; enum aorai_ListOper { op_f = 3, op_g = 2, op_main = 1, op_real_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ lemma Si_deterministic_trans{L}: \true; */ /*@ lemma Sf_deterministic_trans{L}: \true; */ /*@ lemma S5_deterministic_trans{L}: \true; */ /*@ lemma S4_deterministic_trans{L}: \true; */ /*@ lemma S2_deterministic_trans{L}: \true; */ int X; int Y; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ lemma S3_deterministic_trans{L}: ∀ int x; ¬(\at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ x ≡ 5 ∧ \at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ x ≡ 4); */ /*@ lemma S1_deterministic_trans{L}: ∀ int __retres_f, int x; ¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ __retres_f ≡ 0 ∧ \at(X,L) ≡ 5 ∧ \at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ x ≡ 4); */ /*@ lemma S0_deterministic_trans{L}: ∀ int c; ¬(\at(aorai_CurOperation,L) ≡ op_real_main ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ c ≢ 0 ∧ \at(aorai_CurOperation,L) ≡ op_real_main ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ c ≡ 0); */ /*@ ghost int aorai_CurStates = Si; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_in: assumes aorai_CurStates ≡ S3 ∧ x ≡ 4; ensures aorai_CurStates ≡ S4; behavior buch_state_S4_out: assumes aorai_CurStates ≢ S3 ∨ ¬(x ≡ 4); ensures aorai_CurStates ≢ S4; behavior buch_state_S5_in: assumes aorai_CurStates ≡ S3 ∧ x ≡ 5; ensures aorai_CurStates ≡ S5; behavior buch_state_S5_out: assumes aorai_CurStates ≢ S3 ∨ ¬(x ≡ 5); ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; @/ void g_pre_func(int x) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; aorai_CurStates_tmp = aorai_CurStates; if (3 == aorai_CurStates) if (x == 5) aorai_CurStates_tmp = S5; if (3 == aorai_CurStates) if (x == 4) aorai_CurStates_tmp = S4; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ S4 ∨ aorai_CurStates ≡ S5; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_in: assumes aorai_CurStates ≡ S5; ensures aorai_CurStates ≡ S1; behavior buch_state_S1_out: assumes aorai_CurStates ≢ S5; ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_in: assumes aorai_CurStates ≡ S4; ensures aorai_CurStates ≡ S3; behavior buch_state_S3_out: assumes aorai_CurStates ≢ S4; ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; @/ void g_post_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; aorai_CurStates_tmp = aorai_CurStates; if (4 == aorai_CurStates) aorai_CurStates_tmp = S3; if (5 == aorai_CurStates) aorai_CurStates_tmp = S1; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ S3; requires aorai_CurStates ≡ S3 ⇒ x ≡ 5 ∨ x ≡ 4; behavior Buchi_behavior_in_1: assumes aorai_CurStates ≡ S3 ∧ x ≡ 5; ensures aorai_CurStates ≡ S1; behavior Buchi_behavior_in_0: assumes aorai_CurStates ≡ S3 ∧ x ≡ 4; ensures aorai_CurStates ≡ S3; */ void g(int x) { /*@ ghost g_pre_func(x); */ Y = x; /*@ ghost g_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_in: assumes aorai_CurStates ≡ S1 ∧ x ≡ 4; ensures aorai_CurStates ≡ S3; behavior buch_state_S3_out: assumes aorai_CurStates ≢ S1 ∨ ¬(x ≡ 4); ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; @/ void f_pre_func(int x) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (1 == aorai_CurStates) if (x == 4) aorai_CurStates_tmp = S3; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ S1; requires aorai_CurStates ≡ S1 ⇒ res ≡ 0 ∧ X ≡ 5; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_in: assumes aorai_CurStates ≡ S1 ∧ res ≡ 0 ∧ X ≡ 5; ensures aorai_CurStates ≡ S2; behavior buch_state_S2_out: assumes aorai_CurStates ≢ S1 ∨ ¬(res ≡ 0 ∧ X ≡ 5); ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; @/ void f_post_func(int res) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (1 == aorai_CurStates) if (res == 0) if (X == 5) aorai_CurStates_tmp = S2; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ S1; requires aorai_CurStates ≡ S1 ⇒ x ≡ 4; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ S2 ⇒ \result ≡ 0 ∧ X ≡ 5; ensures aorai_CurStates ≡ S2; */ int f(int x) { int __retres; /*@ ghost f_pre_func(x); */ X = x; g(X); X ++; g(X); __retres = 0; /*@ ghost f_post_func(__retres); */ return __retres; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_real_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_in: assumes aorai_CurStates ≡ S0 ∧ c ≢ 0; ensures aorai_CurStates ≡ S1; behavior buch_state_S1_out: assumes aorai_CurStates ≢ S0 ∨ c ≡ 0; ensures aorai_CurStates ≢ S1; behavior buch_state_S2_in: assumes aorai_CurStates ≡ S0 ∧ c ≡ 0; ensures aorai_CurStates ≡ S2; behavior buch_state_S2_out: assumes aorai_CurStates ≢ S0 ∨ ¬(c ≡ 0); ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; @/ void real_main_pre_func(int c) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_real_main; aorai_CurStates_tmp = aorai_CurStates; if (0 == aorai_CurStates) if (c == 0) aorai_CurStates_tmp = S2; if (0 == aorai_CurStates) if (c != 0) aorai_CurStates_tmp = S1; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_real_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_in: assumes aorai_CurStates ≡ S2; ensures aorai_CurStates ≡ Sf; behavior buch_state_Sf_out: assumes aorai_CurStates ≢ S2; ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; @/ void real_main_post_func(int res) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_real_main; aorai_CurStates_tmp = aorai_CurStates; if (2 == aorai_CurStates) aorai_CurStates_tmp = Sf; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ S0; requires aorai_CurStates ≡ S0 ⇒ c ≡ 0 ∨ c ≢ 0; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ Sf; */ int real_main(int c) { int __retres; /*@ ghost real_main_pre_func(c); */ if (c) f(4); __retres = 0; /*@ ghost real_main_post_func(__retres); */ return __retres; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_in: assumes aorai_CurStates ≡ Si; ensures aorai_CurStates ≡ S0; behavior buch_state_S0_out: assumes aorai_CurStates ≢ Si; ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; @/ void main_pre_func(int c) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (7 == aorai_CurStates) aorai_CurStates_tmp = S0; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ Sf; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_in: assumes aorai_CurStates ≡ Sf; ensures aorai_CurStates ≡ Sf; behavior buch_state_Sf_out: assumes aorai_CurStates ≢ Sf; ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; @/ void main_post_func(int res) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (6 == aorai_CurStates) aorai_CurStates_tmp = Sf; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ Si; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ Sf; */ int main(int c) { int tmp; /*@ ghost main_pre_func(c); */ tmp = real_main(c); /*@ ghost main_post_func(tmp); */ return tmp; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/formals.res.oracle0000666000000000000000000005101513571573400023704 0ustar [kernel] Parsing tests/aorai/formals.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_formals_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_States { aorai_reject_state = -2, OK = 0, aorai_intermediate_state = 1, aorai_intermediate_state_0 = 2, aorai_intermediate_state_1 = 3, aorai_intermediate_state_2 = 4, aorai_reject = 5, init = 6, main_0 = 7 }; enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ lemma init_deterministic_trans{L}: \true; */ /*@ lemma aorai_reject_deterministic_trans{L}: \true; */ /*@ lemma OK_deterministic_trans{L}: \true; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ lemma main_0_deterministic_trans{L}: ∀ int x; ¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ x ≡ 3 ∧ \at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ x ≡ 1); */ /*@ lemma aorai_intermediate_state_0_deterministic_trans{L}: ¬(\at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ ¬(\at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called)); */ /*@ ghost int aorai_CurStates = init; */ /*@ ghost int aorai_x_0 = 0; */ /*@ lemma aorai_intermediate_state_2_deterministic_trans{L}: ¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ \at(aorai_x_0,L) ≡ 3 ∧ (¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated) ∨ \at(aorai_x_0,L) ≢ 3)); */ /*@ ghost int aorai_y = 0; */ /*@ lemma aorai_intermediate_state_1_deterministic_trans{L}: ¬(\at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ \at(aorai_y,L) ≡ 2 ∧ (¬(\at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated) ∨ \at(aorai_y,L) ≢ 2)); */ /*@ ghost int aorai_x = 0; */ /*@ lemma aorai_intermediate_state_deterministic_trans{L}: ¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ \at(aorai_x,L) ≡ 1 ∧ (¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated) ∨ \at(aorai_x,L) ≢ 1)); */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_x_0, aorai_x, aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_out: ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_in_0: assumes aorai_CurStates ≡ main_0 ∧ x ≡ 1; ensures aorai_CurStates ≡ aorai_intermediate_state; ensures aorai_x ≡ \old(x); behavior buch_state_aorai_intermediate_state_out: assumes aorai_CurStates ≢ main_0 ∨ ¬(x ≡ 1); ensures aorai_CurStates ≢ aorai_intermediate_state; ensures aorai_x ≡ \old(aorai_x); behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in_0: assumes aorai_CurStates ≡ main_0 ∧ x ≡ 3; ensures aorai_CurStates ≡ aorai_intermediate_state_2; ensures aorai_x_0 ≡ \old(x); behavior buch_state_aorai_intermediate_state_2_out: assumes aorai_CurStates ≢ main_0 ∨ ¬(x ≡ 3); ensures aorai_CurStates ≢ aorai_intermediate_state_2; ensures aorai_x_0 ≡ \old(aorai_x_0); behavior buch_state_aorai_reject_out: ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; @/ void f_pre_func(int x) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (7 == aorai_CurStates) if (x == 3) { aorai_CurStates_tmp = aorai_intermediate_state_2; aorai_x_0 = x; } if (7 == aorai_CurStates) if (x == 1) { aorai_CurStates_tmp = aorai_intermediate_state; aorai_x = x; } aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ aorai_intermediate_state ∨ aorai_CurStates ≡ aorai_intermediate_state_2; requires aorai_CurStates ≡ aorai_intermediate_state ⇒ aorai_x ≢ 1 ∨ aorai_x ≡ 1; requires aorai_CurStates ≡ aorai_intermediate_state_2 ⇒ aorai_x_0 ≢ 3 ∨ aorai_x_0 ≡ 3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_in: assumes aorai_CurStates ≡ aorai_intermediate_state_2 ∧ aorai_x_0 ≡ 3; ensures aorai_CurStates ≡ OK; behavior buch_state_OK_out: assumes aorai_CurStates ≢ aorai_intermediate_state_2 ∨ ¬(aorai_x_0 ≡ 3); ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes aorai_CurStates ≡ aorai_intermediate_state ∧ aorai_x ≡ 1; ensures aorai_CurStates ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes aorai_CurStates ≢ aorai_intermediate_state ∨ ¬(aorai_x ≡ 1); ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes (aorai_CurStates ≡ aorai_intermediate_state_2 ∧ aorai_x_0 ≢ 3) ∨ (aorai_CurStates ≡ aorai_intermediate_state ∧ aorai_x ≢ 1); ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes (aorai_CurStates ≢ aorai_intermediate_state_2 ∨ ¬(aorai_x_0 ≢ 3)) ∧ (aorai_CurStates ≢ aorai_intermediate_state ∨ ¬(aorai_x ≢ 1)); ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; @/ void f_post_func(int res) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (4 == aorai_CurStates) { if (aorai_x_0 != 3) aorai_CurStates_tmp = aorai_reject; else goto _LAND; } else { _LAND: ; if (1 == aorai_CurStates) if (aorai_x != 1) aorai_CurStates_tmp = aorai_reject; } if (1 == aorai_CurStates) if (aorai_x == 1) aorai_CurStates_tmp = aorai_intermediate_state_0; if (4 == aorai_CurStates) if (aorai_x_0 == 3) aorai_CurStates_tmp = OK; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ main_0; requires aorai_CurStates ≡ main_0 ⇒ x ≡ 3 ∨ x ≡ 1; ensures aorai_CurStates ≡ aorai_intermediate_state_0 ∨ aorai_CurStates ≡ OK; ensures \old(aorai_CurStates ≡ main_0) ⇒ aorai_CurStates ≢ OK ∧ aorai_CurStates ≢ aorai_reject ⇒ aorai_x_0 ≡ \old(aorai_x_0); ensures \old(aorai_CurStates ≡ main_0) ⇒ aorai_CurStates ≢ aorai_intermediate_state_0 ∧ aorai_CurStates ≢ aorai_reject ⇒ aorai_x ≡ \old(aorai_x); behavior Buchi_behavior_in_1: assumes aorai_CurStates ≡ main_0 ∧ x ≡ 3; ensures (aorai_CurStates ≡ OK ⇒ aorai_x_0 ≡ 3) ∧ (aorai_CurStates ≡ aorai_intermediate_state_0 ⇒ aorai_x ≡ 1) ∧ (aorai_CurStates ≡ aorai_reject ⇒ aorai_x_0 ≢ 3 ∨ aorai_x ≢ 1); ensures aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_reject; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x_0 ≡ \at(x,Pre) + 0 ∨ aorai_x_0 ≡ \at(aorai_x_0,Pre) + 0; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x ≡ \at(x,Pre) + 0 ∨ aorai_x ≡ \at(aorai_x,Pre) + 0; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_x_0 ≡ \at(x,Pre) + 0; behavior Buchi_behavior_in_0: assumes aorai_CurStates ≡ main_0 ∧ x ≡ 1; ensures (aorai_CurStates ≡ OK ⇒ aorai_x_0 ≡ 3) ∧ (aorai_CurStates ≡ aorai_intermediate_state_0 ⇒ aorai_x ≡ 1) ∧ (aorai_CurStates ≡ aorai_reject ⇒ aorai_x_0 ≢ 3 ∨ aorai_x ≢ 1); ensures aorai_CurStates ≡ aorai_intermediate_state_0 ∨ aorai_CurStates ≡ aorai_reject; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x_0 ≡ \at(x,Pre) + 0 ∨ aorai_x_0 ≡ \at(aorai_x_0,Pre) + 0; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x ≡ \at(x,Pre) + 0 ∨ aorai_x ≡ \at(aorai_x,Pre) + 0; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_intermediate_state_0 ⇒ aorai_x ≡ \at(x,Pre) + 0; */ int f(int x) { /*@ ghost f_pre_func(x); */ /*@ ghost f_post_func(x); */ return x; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_y, aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_in: assumes aorai_CurStates ≡ OK; ensures aorai_CurStates ≡ OK; behavior buch_state_OK_out: assumes aorai_CurStates ≢ OK; ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in_0: assumes aorai_CurStates ≡ aorai_intermediate_state_0; ensures aorai_CurStates ≡ aorai_intermediate_state_1; ensures aorai_y ≡ \old(y); behavior buch_state_aorai_intermediate_state_1_out: assumes aorai_CurStates ≢ aorai_intermediate_state_0; ensures aorai_CurStates ≢ aorai_intermediate_state_1; ensures aorai_y ≡ \old(aorai_y); behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes aorai_CurStates ≡ aorai_reject; ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes aorai_CurStates ≢ aorai_reject; ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; @/ void g_pre_func(int y) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; aorai_CurStates_tmp = aorai_CurStates; if (5 == aorai_CurStates) aorai_CurStates_tmp = aorai_reject; if (2 == aorai_CurStates) { aorai_CurStates_tmp = aorai_intermediate_state_1; aorai_y = y; } if (0 == aorai_CurStates) aorai_CurStates_tmp = OK; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_intermediate_state_1; requires aorai_CurStates ≡ aorai_intermediate_state_1 ⇒ aorai_y ≢ 2 ∨ aorai_y ≡ 2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_in: assumes (aorai_CurStates ≡ aorai_intermediate_state_1 ∧ aorai_y ≡ 2) ∨ aorai_CurStates ≡ OK; ensures aorai_CurStates ≡ OK; behavior buch_state_OK_out: assumes (aorai_CurStates ≢ aorai_intermediate_state_1 ∨ ¬(aorai_y ≡ 2)) ∧ aorai_CurStates ≢ OK; ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes aorai_CurStates ≡ aorai_reject ∨ (aorai_CurStates ≡ aorai_intermediate_state_1 ∧ aorai_y ≢ 2); ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes aorai_CurStates ≢ aorai_reject ∧ (aorai_CurStates ≢ aorai_intermediate_state_1 ∨ ¬(aorai_y ≢ 2)); ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; @/ void g_post_func(int res) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; aorai_CurStates_tmp = aorai_CurStates; if (5 == aorai_CurStates) aorai_CurStates_tmp = aorai_reject; else if (3 == aorai_CurStates) if (aorai_y != 2) aorai_CurStates_tmp = aorai_reject; if (3 == aorai_CurStates) { if (aorai_y == 2) aorai_CurStates_tmp = OK; else goto _LAND; } else { _LAND: ; if (0 == aorai_CurStates) aorai_CurStates_tmp = OK; } aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_intermediate_state_0; requires aorai_CurStates ≡ aorai_reject ∨ aorai_CurStates ≢ aorai_reject; requires aorai_CurStates ≡ aorai_intermediate_state_0 ∨ aorai_CurStates ≢ aorai_intermediate_state_0; requires aorai_CurStates ≡ OK ∨ aorai_CurStates ≢ OK; ensures aorai_CurStates ≡ OK; behavior Buchi_behavior_in_2: assumes aorai_CurStates ≡ aorai_reject; ensures aorai_CurStates ≡ aorai_reject; behavior Buchi_behavior_in_1: assumes aorai_CurStates ≡ aorai_intermediate_state_0; ensures aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_reject; ensures \at(aorai_CurStates ≡ aorai_intermediate_state_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_y ≡ \at(y,Pre) + 0; ensures \at(aorai_CurStates ≡ aorai_intermediate_state_0,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_y ≡ \at(y,Pre) + 0; behavior Buchi_behavior_in_0: assumes aorai_CurStates ≡ OK; ensures aorai_CurStates ≡ OK; */ int g(int y) { /*@ ghost g_pre_func(y); */ /*@ ghost g_post_func(y); */ return y; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_out: ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_out: ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_in: assumes aorai_CurStates ≡ init; ensures aorai_CurStates ≡ main_0; behavior buch_state_main_0_out: assumes aorai_CurStates ≢ init; ensures aorai_CurStates ≢ main_0; @/ void main_pre_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (6 == aorai_CurStates) aorai_CurStates_tmp = main_0; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires aorai_CurStates ≡ OK; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_in: assumes aorai_CurStates ≡ OK; ensures aorai_CurStates ≡ OK; behavior buch_state_OK_out: assumes aorai_CurStates ≢ OK; ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes aorai_CurStates ≡ aorai_reject; ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes aorai_CurStates ≢ aorai_reject; ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; @/ void main_post_func(int res) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (5 == aorai_CurStates) aorai_CurStates_tmp = aorai_reject; if (0 == aorai_CurStates) aorai_CurStates_tmp = OK; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires aorai_CurStates ≡ init; ensures aorai_CurStates ≡ OK; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_reject; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x_0 ≡ \at(1,Pre) + 0 ∨ aorai_x_0 ≡ \at(aorai_x_0,Pre) + 0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_y ≡ \at(2,Pre) + 0 ∨ aorai_y ≡ \at(aorai_y,Pre) + 0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x ≡ \at(1,Pre) + 0 ∨ aorai_x ≡ \at(aorai_x,Pre) + 0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_x_0 ≡ \at(1,Pre) + 0 ∨ aorai_x_0 ≡ \at(aorai_x_0,Pre) + 0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_y ≡ \at(2,Pre) + 0 ∨ aorai_y ≡ \at(aorai_y,Pre) + 0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_x ≡ \at(1,Pre) + 0 ∨ aorai_x ≡ \at(aorai_x,Pre) + 0; */ int main(void) { int __retres; /*@ ghost main_pre_func(); */ f(1); g(2); __retres = 0; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/generate_assigns_bts1290.res.oracle0000666000000000000000000000423213571573400026745 0ustar [kernel] Parsing tests/aorai/generate_assigns_bts1290.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_generate_assigns_bts1290_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S = 1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S; behavior buch_state_S_in: assumes 1 ≡ S; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ S; ensures 0 ≡ S; @/ void main_pre_func(void) { int S_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S_tmp = S; if (S == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S; behavior buch_state_S_in: assumes 1 ≡ S; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ S; ensures 0 ≡ S; @/ void main_post_func(void) { int S_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S_tmp = S; if (S == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; return; } */ /*@ requires 1 ≡ S; behavior Buchi_property_behavior: ensures \true; ensures 1 ≡ S; */ void main(void) { /*@ ghost int aorai_Loop_Init_2; */ /*@ ghost main_pre_func(); */ int i = 0; /*@ ghost aorai_Loop_Init_2 = 1; */ aorai_loop_2: /*@ loop invariant Aorai: 1 ≡ S; loop assigns i, aorai_Loop_Init_2, aorai_CurOpStatus, aorai_CurOperation, S; loop assigns aorai_Loop_Init_2 \from \nothing; */ while (i < 10) { /*@ ghost aorai_Loop_Init_2 = 0; */ i ++; } /*@ ghost main_post_func(); */ return; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/goto.res.oracle0000666000000000000000000004500713571573400023215 0ustar [kernel] Parsing tests/aorai/goto.c (with preprocessing) [aorai] Welcome to the Aorai plugin [aorai] tests/aorai/goto.c:28: Warning: Call to opc does not follow automaton's specification. This path is assumed to be dead [kernel] Parsing /tmp/aorai_goto_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_main = 3, op_opa = 2, op_opb = 1, op_opc = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 5000; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_S4 = 0; */ /*@ ghost int accept_S5 = 0; */ /*@ ghost int accept_S6 = 0; */ /*@ ghost int accept_all = 0; */ /*@ ghost int accept_init = 1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opa_pre_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; if (accept_S2 == 1) accept_S3_tmp = 1; else accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S3 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_in: assumes 1 ≡ accept_S3; ensures 1 ≡ accept_S4; behavior buch_state_accept_S4_out: assumes 0 ≡ accept_S3; ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opa_post_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; if (accept_S3 == 1) accept_S4_tmp = 1; else accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; requires rr < 5000; behavior j: ensures rr < 5001; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S4; */ void opa(void) { /*@ ghost opa_pre_func(); */ rr ++; /*@ ghost opa_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_in: assumes 1 ≡ accept_S4; ensures 1 ≡ accept_S5; behavior buch_state_accept_S5_out: assumes 0 ≡ accept_S4; ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opb_pre_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; if (accept_S4 == 1) accept_S5_tmp = 1; else accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S5 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_in: assumes 1 ≡ accept_S5; ensures 1 ≡ accept_S6; behavior buch_state_accept_S6_out: assumes 0 ≡ accept_S5; ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opb_post_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; if (accept_S5 == 1) accept_S6_tmp = 1; else accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_S4 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S6; */ void opb(void) { /*@ ghost opb_pre_func(); */ status = 1; /*@ ghost opb_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opc_pre_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opc; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opc_post_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opc; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires \false; behavior Buchi_behavior_out_0: ensures 0 ≡ accept_S2; behavior Buchi_behavior_out_1: ensures 0 ≡ accept_S3; behavior Buchi_behavior_out_2: ensures 0 ≡ accept_S4; behavior Buchi_behavior_out_3: ensures 0 ≡ accept_S5; behavior Buchi_behavior_out_4: ensures 0 ≡ accept_S6; behavior Buchi_behavior_out_5: ensures 0 ≡ accept_all; behavior Buchi_behavior_out_6: ensures 0 ≡ accept_init; */ void opc(void) { /*@ ghost opc_pre_func(); */ rr = 60000; /*@ ghost opc_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_init; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_init; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void main_pre_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_init == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S6 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_in: assumes 1 ≡ accept_S6; ensures 1 ≡ accept_all; behavior buch_state_accept_all_out: assumes 0 ≡ accept_S6; ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void main_post_func(int res) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S6 == 1) accept_all_tmp = 1; else accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_init ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all; behavior aorai_acceptance: ensures 1 ≡ accept_S2 ∨ 1 ≡ accept_S3 ∨ 1 ≡ accept_S4 ∨ 1 ≡ accept_S5 ∨ 1 ≡ accept_S6 ∨ 1 ≡ accept_all ∨ 1 ≡ accept_init; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_all; */ int main(void) { int __retres; /*@ ghost main_pre_func(); */ if (rr < 5000) goto L; opc(); L4: goto L5; L: opa(); goto L2; opc(); L6: __retres = 1; goto return_label; L3: goto L4; opc(); goto L2; L2: goto L3; L5: opb(); goto L6; return_label: { /*@ ghost main_post_func(__retres); */ return __retres; } } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/hoare_seq.res.oracle0000666000000000000000000003540713571573400024216 0ustar [kernel] Parsing tests/aorai/hoare_seq.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_hoare_seq_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_f = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int aorai_intermediate_state_1 = 0; */ /*@ ghost int aorai_intermediate_state_2 = 0; */ /*@ ghost int aorai_reject = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_reject; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in: assumes 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_1_out: assumes 0 ≡ aorai_intermediate_state_0; ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_reject; @/ void f_pre_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_reject_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_reject_tmp = aorai_reject; if (aorai_intermediate_state == 1) aorai_reject_tmp = 1; else aorai_reject_tmp = 0; aorai_intermediate_state_2_tmp = 0; if (aorai_intermediate_state_0 == 1) aorai_intermediate_state_1_tmp = 1; else aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_reject = aorai_reject_tmp; return; } */ /*@ ghost /@ requires 1 ≡ aorai_intermediate_state_1 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_reject; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in: assumes 1 ≡ aorai_intermediate_state_1; ensures 1 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_2_out: assumes 0 ≡ aorai_intermediate_state_1; ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes 1 ≡ aorai_reject; ensures 1 ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes 0 ≡ aorai_reject; ensures 0 ≡ aorai_reject; @/ void f_post_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_reject_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_reject_tmp = aorai_reject; if (aorai_reject == 1) aorai_reject_tmp = 1; else aorai_reject_tmp = 0; if (aorai_intermediate_state_1 == 1) aorai_intermediate_state_2_tmp = 1; else aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_reject = aorai_reject_tmp; return; } */ /*@ requires 1 ≡ aorai_intermediate_state_0 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_reject; requires 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_2; behavior Buchi_behavior_in_0: assumes 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ aorai_intermediate_state_2; behavior Buchi_behavior_in_1: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_reject; behavior Buchi_behavior_out_0: ensures 0 ≡ S0; behavior Buchi_behavior_out_1: ensures 0 ≡ Sf; behavior Buchi_behavior_out_2: ensures 0 ≡ aorai_intermediate_state; behavior Buchi_behavior_out_3: ensures 0 ≡ aorai_intermediate_state_0; behavior Buchi_behavior_out_4: ensures 0 ≡ aorai_intermediate_state_1; behavior Buchi_behavior_out_5: assumes 0 ≡ aorai_intermediate_state_0; ensures 0 ≡ aorai_intermediate_state_2; behavior Buchi_behavior_out_6: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_reject; */ void f(void) { /*@ ghost f_pre_func(); */ /*@ ghost f_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_reject; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0 ∧ c > 0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0 ∨ ¬(c > 0); ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ S0 ∧ c ≤ 0; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ S0 ∨ ¬(c ≤ 0); ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_reject_out: ensures 0 ≡ aorai_reject; @/ void main_pre_func(int c) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_reject_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_reject_tmp = aorai_reject; aorai_reject_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; if (S0 == 1) if (c <= 0) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; else aorai_intermediate_state_0_tmp = 0; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_reject = aorai_reject_tmp; return; } */ /*@ ghost /@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0 ∨ 1 ≡ aorai_intermediate_state_2) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1; requires 1 ≡ aorai_intermediate_state_2 ⇒ res ≢ 0 ∨ res ≡ 0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_reject; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes (1 ≡ aorai_intermediate_state_2 ∧ res ≡ 0) ∨ 1 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes (0 ≡ aorai_intermediate_state_2 ∨ ¬(res ≡ 0)) ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes 1 ≡ aorai_reject ∨ (1 ≡ aorai_intermediate_state_2 ∧ res ≢ 0) ∨ 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes 0 ≡ aorai_reject ∧ (0 ≡ aorai_intermediate_state_2 ∨ res ≡ 0) ∧ 0 ≡ aorai_intermediate_state_0; ensures 0 ≡ aorai_reject; @/ void main_post_func(int res) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_reject_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_reject_tmp = aorai_reject; if (aorai_intermediate_state_0 == 1) aorai_reject_tmp = 1; else if (aorai_intermediate_state_2 == 1) { if (res != 0) aorai_reject_tmp = 1; else goto _LAND; } else { _LAND: ; if (aorai_reject == 1) aorai_reject_tmp = 1; else aorai_reject_tmp = 0; } aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) Sf_tmp = 1; else if (aorai_intermediate_state_2 == 1) if (res == 0) Sf_tmp = 1; else Sf_tmp = 0; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_reject = aorai_reject_tmp; return; } */ /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_reject; requires 1 ≡ S0 ⇒ c ≤ 0 ∨ c > 0; ensures 1 ≡ Sf; behavior bhv: assumes c > 0; ensures \result ≡ 0; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 1 ≡ Sf ∨ 0 ≡ Sf; ensures 1 ≡ aorai_reject ∨ 0 ≡ aorai_reject; ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2; ensures 1 ≡ Sf ∨ 1 ≡ aorai_reject; */ int main(int c) { int __retres; /*@ ghost main_pre_func(c); */ if (c <= 0) f(); __retres = 0; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/incorrect.res.oracle0000666000000000000000000000354713571573400024240 0ustar [kernel] Parsing tests/aorai/incorrect.i (no preprocessing) [aorai] Welcome to the Aorai plugin [aorai] Warning: Call to main does not follow automaton's specification. This path is assumed to be dead [kernel] Parsing /tmp/aorai_incorrect_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_States { aorai_reject_state = -2, s0 = 0 }; enum aorai_ListOper { op_f = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ lemma s0_deterministic_trans{L}: \true; */ int f(void); /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int aorai_CurStates = s0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_s0_out: ensures aorai_CurStates ≢ s0; @/ void main_pre_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_s0_out: ensures aorai_CurStates ≢ s0; @/ void main_post_func(int res) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires \false; */ int main(void) { int tmp; /*@ ghost main_pre_func(); */ tmp = f(); /*@ ghost main_post_func(tmp); */ return tmp; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/loop_bts1050.res.oracle0000666000000000000000000005300713571573400024373 0ustar [kernel] Parsing tests/aorai/loop_bts1050.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_loop_bts1050_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int aorai_intermediate_state_1 = 0; */ /*@ ghost int aorai_intermediate_state_2 = 0; */ /*@ ghost int aorai_intermediate_state_3 = 0; */ /*@ ghost int aorai_counter = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_counter, aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in_0: assumes 1 ≡ aorai_intermediate_state_0 ∧ aorai_counter < 5; ensures 1 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ \old(aorai_counter) + 1; behavior buch_state_aorai_intermediate_state_1_in_1: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ 1; behavior buch_state_aorai_intermediate_state_1_out: assumes (0 ≡ aorai_intermediate_state_0 ∨ ¬(aorai_counter < 5)) ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ \old(aorai_counter); behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void f_pre_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; if (aorai_intermediate_state_0 == 1) if (aorai_counter < 5) aorai_counter ++; if (aorai_intermediate_state == 1) aorai_counter = 1; if (aorai_intermediate_state == 1) aorai_intermediate_state_1_tmp = 1; else if (aorai_intermediate_state_0 == 1) if (aorai_counter < 5) aorai_intermediate_state_1_tmp = 1; else aorai_intermediate_state_1_tmp = 0; else aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ ghost /@ requires 1 ≡ aorai_intermediate_state_1 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in: assumes 1 ≡ aorai_intermediate_state_1; ensures 1 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_2_out: assumes 0 ≡ aorai_intermediate_state_1; ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void f_post_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; if (aorai_intermediate_state_1 == 1) aorai_intermediate_state_2_tmp = 1; else aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; requires 1 ≡ aorai_intermediate_state_0 ⇒ aorai_counter < 5; requires 0 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_2; ensures \at(1 ≡ aorai_intermediate_state_0,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ \at(aorai_counter,Pre) + 1; ensures \at(1 ≡ aorai_intermediate_state,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ 1; */ void f(void) { /*@ ghost f_pre_func(); */ /*@ ghost f_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_in: assumes 1 ≡ aorai_intermediate_state_2; ensures 1 ≡ aorai_intermediate_state_3; behavior buch_state_aorai_intermediate_state_3_out: assumes 0 ≡ aorai_intermediate_state_2; ensures 0 ≡ aorai_intermediate_state_3; @/ void g_pre_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; if (aorai_intermediate_state_2 == 1) aorai_intermediate_state_3_tmp = 1; else aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ ghost /@ requires 1 ≡ aorai_intermediate_state_3 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ aorai_intermediate_state_3; ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void g_post_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; if (aorai_intermediate_state_3 == 1) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ requires 1 ≡ aorai_intermediate_state_2 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; */ void g(void) { /*@ ghost g_pre_func(); */ /*@ ghost g_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0; ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void main_pre_func(int c) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ ghost /@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ aorai_intermediate_state_0 ∨ 1 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void main_post_func(int res) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) Sf_tmp = 1; else if (aorai_intermediate_state_0 == 1) Sf_tmp = 1; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ Sf; ensures \at(1 ≡ S0,Pre) ∧ 1 ≡ Sf ⇒ (1 ≤ aorai_counter ≤ 5) ∨ aorai_counter ≡ \at(aorai_counter,Pre) + 0; */ int main(int c) { /*@ ghost int aorai_Loop_Init_13; */ int __retres; /*@ ghost main_pre_func(c); */ if (c < 0) c = 0; if (c > 0) c = 5; /*@ ghost aorai_Loop_Init_13 = 1; */ aorai_loop_13: /*@ loop invariant Aorai: 0 ≡ S0; loop invariant Aorai: 0 ≡ Sf; loop invariant Aorai: 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; loop invariant Aorai: 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: 0 ≡ aorai_intermediate_state_1; loop invariant Aorai: 0 ≡ aorai_intermediate_state_2; loop invariant Aorai: 0 ≡ aorai_intermediate_state_3; loop invariant Aorai: 1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0; loop invariant Aorai: aorai_Loop_Init_13 ≢ 0 ⇒ \at(1 ≡ S0,Pre) ⇒ 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: aorai_Loop_Init_13 ≡ 0 ⇒ 0 ≡ aorai_intermediate_state; loop invariant Aorai: \at(1 ≡ aorai_intermediate_state,aorai_loop_13) ∧ 1 ≡ aorai_intermediate_state_0 ⇒ 1 ≤ aorai_counter ≤ 5; */ while (c) { /*@ ghost aorai_Loop_Init_13 = 0; */ f(); g(); c --; } __retres = 0; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/monostate.res.oracle0000666000000000000000000001354213571573400024255 0ustar [kernel] Parsing tests/aorai/monostate.i (no preprocessing) [aorai] Welcome to the Aorai plugin [aorai] Warning: Call to main does not follow automaton's specification. This path is assumed to be dead [aorai] tests/aorai/monostate.i:8: Warning: Call to main not conforming to automaton (pre-cond). Assuming it is on a dead path [kernel] Parsing /tmp/aorai_monostate_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_States { aorai_reject_state = -2, Init = 0, aorai_intermediate_state = 1, aorai_reject = 2 }; enum aorai_ListOper { op_f = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ lemma aorai_reject_deterministic_trans{L}: \true; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ lemma aorai_intermediate_state_deterministic_trans{L}: ¬(\at(aorai_CurOperation,L) ≡ op_main ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ ¬(\at(aorai_CurOperation,L) ≡ op_main ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated)); */ /*@ lemma Init_deterministic_trans{L}: ¬(\at(aorai_CurOperation,L) ≡ op_main ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ ¬(\at(aorai_CurOperation,L) ≡ op_main ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called)); */ /*@ ghost int aorai_CurStates = Init; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_Init_out: ensures aorai_CurStates ≢ Init; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_reject_in: assumes aorai_CurStates ≡ aorai_reject ∨ aorai_CurStates ≡ aorai_intermediate_state; ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes aorai_CurStates ≢ aorai_reject ∧ aorai_CurStates ≢ aorai_intermediate_state; ensures aorai_CurStates ≢ aorai_reject; @/ void f_pre_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (2 == aorai_CurStates) aorai_CurStates_tmp = aorai_reject; else if (1 == aorai_CurStates) aorai_CurStates_tmp = aorai_reject; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_Init_out: ensures aorai_CurStates ≢ Init; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_reject_in: assumes aorai_CurStates ≡ aorai_reject; ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes aorai_CurStates ≢ aorai_reject; ensures aorai_CurStates ≢ aorai_reject; @/ void f_post_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (2 == aorai_CurStates) aorai_CurStates_tmp = aorai_reject; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires \false; requires aorai_CurStates ≡ aorai_reject ∨ aorai_CurStates ≢ aorai_reject; requires aorai_CurStates ≡ aorai_intermediate_state ∨ aorai_CurStates ≢ aorai_intermediate_state; ensures \false; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ aorai_reject; */ void f(void) { /*@ ghost f_pre_func(); */ /*@ ghost f_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_Init_out: ensures aorai_CurStates ≢ Init; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_reject_out: ensures aorai_CurStates ≢ aorai_reject; @/ void main_pre_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ ghost /@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_Init_out: ensures aorai_CurStates ≢ Init; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_reject_out: ensures aorai_CurStates ≢ aorai_reject; @/ void main_post_func(void) { int aorai_CurStates_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; aorai_CurStates = aorai_CurStates_tmp; return; } */ /*@ requires \false; */ void main(void) { /*@ ghost int aorai_Loop_Init_3; */ /*@ ghost main_pre_func(); */ /*@ ghost aorai_Loop_Init_3 = 1; */ aorai_loop_3: /*@ loop invariant Aorai: aorai_CurStates ≢ Init; loop invariant Aorai: aorai_CurStates ≢ aorai_intermediate_state; loop invariant Aorai: aorai_CurStates ≢ aorai_reject; */ while (1) { /*@ ghost aorai_Loop_Init_3 = 0; */ f(); } /*@ ghost main_post_func(); */ return; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/not_prm.res.oracle0000666000000000000000000000435713571573400023726 0ustar [kernel] Parsing tests/aorai/not_prm.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_not_prm_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_f = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_f; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ S0 ∧ x ≥ 4; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ S0 ∨ ¬(x ≥ 4); ensures 0 ≡ Sf; @/ void f_pre_func(int x) { int S0_tmp; int Sf_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; if (S0 == 1) if (x >= 4) Sf_tmp = 1; else Sf_tmp = 0; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; return; } */ /*@ ghost /@ requires 1 ≡ Sf ∧ 0 ≡ S0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ Sf; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ Sf; ensures 0 ≡ Sf; @/ void f_post_func(int res) { int S0_tmp; int Sf_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; if (Sf == 1) Sf_tmp = 1; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; return; } */ /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf; requires 1 ≡ S0 ⇒ x ≥ 4; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 0 ≡ S0; ensures 1 ≡ Sf; */ int f(int x) { /*@ ghost f_pre_func(x); */ /*@ ghost f_post_func(x); */ return x; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/other.res.oracle0000666000000000000000000004427213571573400023371 0ustar [kernel] Parsing tests/aorai/other.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_other_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int x = 0; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int init = 1; */ /*@ ghost int last = 0; */ /*@ ghost int step1 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; @/ void f_pre_func(void) { int init_tmp; int last_tmp; int step1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 3 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; @/ void f_post_func(void) { int init_tmp; int last_tmp; int step1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } */ /*@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 3 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4; requires 1 ≡ step1 ∨ 0 ≡ step1; requires 1 ≡ last ∨ 0 ≡ last; requires 1 ≡ init ∨ 0 ≡ init; behavior Buchi_behavior_in_0: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures (1 ≡ init ⇒ x ≡ 4 ∨ x ≢ 3) ∧ (1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3)) ∧ (1 ≡ step1 ⇒ x ≢ 4 ∨ x ≡ 3); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ init ∨ 1 ≡ step1; behavior Buchi_behavior_in_1: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures (1 ≡ init ⇒ x ≡ 4 ∨ x ≢ 3) ∧ (1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3)) ∧ (1 ≡ step1 ⇒ x ≢ 4 ∨ x ≡ 3); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; behavior Buchi_behavior_in_2: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures (1 ≡ init ⇒ x ≡ 4 ∨ x ≢ 3) ∧ (1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3)) ∧ (1 ≡ step1 ⇒ x ≢ 4 ∨ x ≡ 3); ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ last ∨ 1 ≡ step1; behavior Buchi_behavior_out_0: assumes (0 ≡ last ∨ (x ≡ 3 ∧ x ≢ 4)) ∧ (0 ≡ step1 ∨ x ≢ 4) ∧ (0 ≡ init ∨ x ≡ 3); ensures 0 ≡ init; behavior Buchi_behavior_out_1: assumes 0 ≡ step1 ∧ (0 ≡ init ∨ x ≢ 3) ∧ (0 ≡ last ∨ (x ≢ 3 ∧ x ≡ 4)); ensures 0 ≡ last; behavior Buchi_behavior_out_2: assumes 0 ≡ last ∧ 0 ≡ init ∧ 0 ≡ step1; ensures 0 ≡ step1; */ void f(void) { /*@ ghost f_pre_func(); */ x = 3; /*@ ghost f_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; @/ void g_pre_func(void) { int init_tmp; int last_tmp; int step1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 3 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; @/ void g_post_func(void) { int init_tmp; int last_tmp; int step1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } */ /*@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 3 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4; requires 1 ≡ step1 ∨ 0 ≡ step1; requires 1 ≡ last ∨ 0 ≡ last; requires 1 ≡ init ∨ 0 ≡ init; behavior Buchi_behavior_in_0: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures (1 ≡ init ⇒ x ≡ 4 ∨ x ≢ 3) ∧ (1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3)) ∧ (1 ≡ step1 ⇒ x ≢ 4 ∨ x ≡ 3); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ init ∨ 1 ≡ step1; behavior Buchi_behavior_in_1: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures (1 ≡ init ⇒ x ≡ 4 ∨ x ≢ 3) ∧ (1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3)) ∧ (1 ≡ step1 ⇒ x ≢ 4 ∨ x ≡ 3); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; behavior Buchi_behavior_in_2: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures (1 ≡ init ⇒ x ≡ 4 ∨ x ≢ 3) ∧ (1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3)) ∧ (1 ≡ step1 ⇒ x ≢ 4 ∨ x ≡ 3); ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ last ∨ 1 ≡ step1; behavior Buchi_behavior_out_0: assumes (0 ≡ last ∨ (x ≡ 3 ∧ x ≢ 4)) ∧ (0 ≡ step1 ∨ x ≢ 4) ∧ (0 ≡ init ∨ x ≡ 3); ensures 0 ≡ init; behavior Buchi_behavior_out_1: assumes 0 ≡ step1 ∧ (0 ≡ init ∨ x ≢ 3) ∧ (0 ≡ last ∨ (x ≢ 3 ∧ x ≡ 4)); ensures 0 ≡ last; behavior Buchi_behavior_out_2: assumes 0 ≡ last ∧ 0 ≡ init ∧ 0 ≡ step1; ensures 0 ≡ step1; */ void g(void) { /*@ ghost g_pre_func(); */ x = 4; /*@ ghost g_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes 1 ≡ init ∧ x ≢ 3; ensures 1 ≡ init; behavior buch_state_init_out: assumes 0 ≡ init ∨ ¬(x ≢ 3); ensures 0 ≡ init; behavior buch_state_last_out: ensures 0 ≡ last; behavior buch_state_step1_out: ensures 0 ≡ step1; @/ void main_pre_func(void) { int init_tmp; int last_tmp; int step1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; init_tmp = init; last_tmp = last; step1_tmp = step1; step1_tmp = 0; last_tmp = 0; if (init == 1) if (x != 3) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 3 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; @/ void main_post_func(int res) { int init_tmp; int last_tmp; int step1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } */ /*@ requires 1 ≡ init ∧ 0 ≡ last ∧ 0 ≡ step1; requires 1 ≡ init ⇒ x ≢ 3; behavior aorai_acceptance: ensures 1 ≡ last; behavior Buchi_property_behavior: ensures (1 ≡ init ⇒ x ≡ 4 ∨ x ≢ 3) ∧ (1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3)) ∧ (1 ≡ step1 ⇒ x ≢ 4 ∨ x ≡ 3); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures \true; ensures 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; */ int main(void) { /*@ ghost main_pre_func(); */ f(); g(); f(); g(); /*@ ghost main_post_func(x); */ return x; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/seq.res.oracle0000666000000000000000000005212613571573400023035 0ustar [kernel] Parsing tests/aorai/seq.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_seq_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int aorai_intermediate_state_1 = 0; */ /*@ ghost int aorai_intermediate_state_2 = 0; */ /*@ ghost int aorai_intermediate_state_3 = 0; */ /*@ ghost int aorai_counter = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_1_out: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void f_pre_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; if (aorai_intermediate_state == 1) aorai_intermediate_state_1_tmp = 1; else aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ ghost /@ requires 1 ≡ aorai_intermediate_state_1 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ aorai_intermediate_state_1; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ aorai_intermediate_state_1; ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void f_post_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; if (aorai_intermediate_state_1 == 1) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ requires 1 ≡ aorai_intermediate_state ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; */ void f(void) { /*@ ghost f_pre_func(); */ /*@ ghost f_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_counter, aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_in_0: assumes 1 ≡ aorai_intermediate_state_2 ∧ aorai_counter < 2; ensures 1 ≡ aorai_intermediate_state_3; ensures aorai_counter ≡ \old(aorai_counter) + 1; behavior buch_state_aorai_intermediate_state_3_in_1: assumes 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ aorai_intermediate_state_3; ensures aorai_counter ≡ 1; behavior buch_state_aorai_intermediate_state_3_in_2: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_3; ensures aorai_counter ≡ 1; behavior buch_state_aorai_intermediate_state_3_out: assumes (0 ≡ aorai_intermediate_state_2 ∨ ¬(aorai_counter < 2)) ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_intermediate_state_3; ensures aorai_counter ≡ \old(aorai_counter); @/ void g_pre_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; if (aorai_intermediate_state_2 == 1) if (aorai_counter < 2) aorai_counter ++; if (aorai_intermediate_state_0 == 1) aorai_counter = 1; if (aorai_intermediate_state == 1) aorai_counter = 1; if (aorai_intermediate_state == 1) aorai_intermediate_state_3_tmp = 1; else if (aorai_intermediate_state_0 == 1) aorai_intermediate_state_3_tmp = 1; else if (aorai_intermediate_state_2 == 1) if (aorai_counter < 2) aorai_intermediate_state_3_tmp = 1; else aorai_intermediate_state_3_tmp = 0; else aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ ghost /@ requires 1 ≡ aorai_intermediate_state_3 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in: assumes 1 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_2_out: assumes 0 ≡ aorai_intermediate_state_3; ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void g_post_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; if (aorai_intermediate_state_3 == 1) aorai_intermediate_state_2_tmp = 1; else aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0 ∨ 1 ≡ aorai_intermediate_state_2) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; requires 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter < 2; requires 0 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state_2; requires 0 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state_0; requires 0 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_2; requires 1 ≡ aorai_intermediate_state_2 ∨ 0 ≡ aorai_intermediate_state_2; requires 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_2; ensures \at(1 ≡ aorai_intermediate_state_2,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ \at(aorai_counter,Pre) + 1; ensures \at(1 ≡ aorai_intermediate_state_0,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ 1; ensures \at(1 ≡ aorai_intermediate_state,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ 1; */ void g(void) { /*@ ghost g_pre_func(); */ /*@ ghost g_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0; ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void main_pre_func(int c) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ ghost /@ requires 1 ≡ aorai_intermediate_state_2 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; requires 1 ≡ aorai_intermediate_state_2 ⇒ 1 ≤ aorai_counter; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ aorai_intermediate_state_2 ∧ 1 ≤ aorai_counter; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ aorai_intermediate_state_2 ∨ ¬(1 ≤ aorai_counter); ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void main_post_func(int res) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state_2 == 1) if (1 <= aorai_counter) Sf_tmp = 1; else Sf_tmp = 0; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 1 ≡ Sf ⇒ 1 ≤ aorai_counter; ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ Sf; ensures \at(1 ≡ S0,Pre) ∧ 1 ≡ Sf ⇒ 1 ≤ aorai_counter ≤ 2; */ int main(int c) { int __retres; /*@ ghost main_pre_func(c); */ if (c) f(); g(); if (c) g(); __retres = 0; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/seq_loop.res.oracle0000666000000000000000000005421413571573400024066 0ustar [kernel] Parsing tests/aorai/seq_loop.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_seq_loop_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int aorai_intermediate_state_1 = 0; */ /*@ ghost int aorai_intermediate_state_2 = 0; */ /*@ ghost int aorai_intermediate_state_3 = 0; */ /*@ ghost int aorai_counter = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_counter, aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in_0: assumes 1 ≡ aorai_intermediate_state_0 ∧ aorai_counter < 5; ensures 1 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ \old(aorai_counter) + 1; behavior buch_state_aorai_intermediate_state_1_in_1: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ 1; behavior buch_state_aorai_intermediate_state_1_out: assumes (0 ≡ aorai_intermediate_state_0 ∨ ¬(aorai_counter < 5)) ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ \old(aorai_counter); behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void f_pre_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; if (aorai_intermediate_state_0 == 1) if (aorai_counter < 5) aorai_counter ++; if (aorai_intermediate_state == 1) aorai_counter = 1; if (aorai_intermediate_state == 1) aorai_intermediate_state_1_tmp = 1; else if (aorai_intermediate_state_0 == 1) if (aorai_counter < 5) aorai_intermediate_state_1_tmp = 1; else aorai_intermediate_state_1_tmp = 0; else aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ ghost /@ requires 1 ≡ aorai_intermediate_state_1 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in: assumes 1 ≡ aorai_intermediate_state_1; ensures 1 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_2_out: assumes 0 ≡ aorai_intermediate_state_1; ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void f_post_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; if (aorai_intermediate_state_1 == 1) aorai_intermediate_state_2_tmp = 1; else aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; requires 1 ≡ aorai_intermediate_state_0 ⇒ aorai_counter < 5; requires 0 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_2; ensures \at(1 ≡ aorai_intermediate_state_0,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ \at(aorai_counter,Pre) + 1; ensures \at(1 ≡ aorai_intermediate_state,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ 1; */ void f(void) { /*@ ghost f_pre_func(); */ /*@ ghost f_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_in: assumes 1 ≡ aorai_intermediate_state_2; ensures 1 ≡ aorai_intermediate_state_3; behavior buch_state_aorai_intermediate_state_3_out: assumes 0 ≡ aorai_intermediate_state_2; ensures 0 ≡ aorai_intermediate_state_3; @/ void g_pre_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; if (aorai_intermediate_state_2 == 1) aorai_intermediate_state_3_tmp = 1; else aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ ghost /@ requires 1 ≡ aorai_intermediate_state_3 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ aorai_intermediate_state_3; ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void g_post_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; if (aorai_intermediate_state_3 == 1) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ requires 1 ≡ aorai_intermediate_state_2 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; */ void g(void) { /*@ ghost g_pre_func(); */ /*@ ghost g_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0; ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void main_pre_func(int c) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ ghost /@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ aorai_intermediate_state_0 ∨ 1 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; @/ void main_post_func(int res) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; int aorai_intermediate_state_0_tmp; int aorai_intermediate_state_1_tmp; int aorai_intermediate_state_2_tmp; int aorai_intermediate_state_3_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) Sf_tmp = 1; else if (aorai_intermediate_state_0 == 1) Sf_tmp = 1; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } */ /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3, aorai_counter; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ Sf; ensures \at(1 ≡ S0,Pre) ∧ 1 ≡ Sf ⇒ (1 ≤ aorai_counter ≤ 5) ∨ aorai_counter ≡ \at(aorai_counter,Pre) + 0; */ int main(int c) { /*@ ghost int aorai_Loop_Init_14; */ int __retres; /*@ ghost main_pre_func(c); */ if (c < 0) c = 0; if (c > 5) c = 5; /*@ assert 0 ≤ c ≤ 5; */ ; /*@ ghost aorai_Loop_Init_14 = 1; */ aorai_loop_14: /*@ loop invariant Aorai: 0 ≡ S0; loop invariant Aorai: 0 ≡ Sf; loop invariant Aorai: 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; loop invariant Aorai: 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: 0 ≡ aorai_intermediate_state_1; loop invariant Aorai: 0 ≡ aorai_intermediate_state_2; loop invariant Aorai: 0 ≡ aorai_intermediate_state_3; loop invariant Aorai: 1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0; loop invariant Aorai: aorai_Loop_Init_14 ≢ 0 ⇒ \at(1 ≡ S0,Pre) ⇒ 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: aorai_Loop_Init_14 ≡ 0 ⇒ 0 ≡ aorai_intermediate_state; loop invariant Aorai: \at(1 ≡ aorai_intermediate_state,aorai_loop_14) ∧ 1 ≡ aorai_intermediate_state_0 ⇒ 1 ≤ aorai_counter ≤ 5; loop assigns c, aorai_Loop_Init_14, aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3, aorai_counter; loop assigns aorai_Loop_Init_14 \from \nothing; */ while (c) { /*@ ghost aorai_Loop_Init_14 = 0; */ f(); g(); c --; } __retres = 0; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/single_call.res.oracle0000666000000000000000000000625613571573400024524 0ustar [kernel] Parsing tests/aorai/single_call.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_single_call_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0; ensures 0 ≡ aorai_intermediate_state; @/ void main_pre_func(void) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; return; } */ /*@ ghost /@ requires 1 ≡ aorai_intermediate_state ∧ 0 ≡ S0 ∧ 0 ≡ Sf; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; @/ void main_post_func(int res) { int S0_tmp; int Sf_tmp; int aorai_intermediate_state_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) Sf_tmp = 1; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; return; } */ /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; */ int main(void) { int __retres; /*@ ghost main_pre_func(); */ __retres = 0; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_acces_params.res.oracle0000666000000000000000000002415413571573400025725 0ustar [kernel] Parsing tests/aorai/test_acces_params.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_acces_params_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_main = 2, op_opa = 1, op_opb = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 5000; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int S2 = 0; */ /*@ ghost int S3 = 0; */ /*@ ghost int S4 = 0; */ /*@ ghost int SF = 0; */ /*@ ghost int mainst = 1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S1 ∧ i ≥ 0; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S1 ∨ ¬(i ≥ 0); ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_out: ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; @/ void opa_pre_func(int i, int j) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int SF_tmp; int mainst_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; SF_tmp = 0; S4_tmp = 0; S3_tmp = 0; if (S1 == 1) if (i >= 0) S2_tmp = 1; else S2_tmp = 0; else S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S2 ∧ 0 ≡ S1 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ SF ∧ 0 ≡ mainst; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_in: assumes 1 ≡ S2; ensures 1 ≡ S3; behavior buch_state_S3_out: assumes 0 ≡ S2; ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_out: ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; @/ void opa_post_func(void) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int SF_tmp; int mainst_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; SF_tmp = 0; S4_tmp = 0; if (S2 == 1) S3_tmp = 1; else S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } */ /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ SF ∧ 0 ≡ mainst; requires 1 ≡ S1 ⇒ i ≥ 0; requires rr < 5000; behavior j: ensures rr < 5001; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S4 ∧ 0 ≡ SF ∧ 0 ≡ mainst; ensures 1 ≡ S3; */ void opa(int i, int j) { /*@ ghost opa_pre_func(i,j); */ rr = i + j; /*@ ghost opa_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_in: assumes 1 ≡ S3; ensures 1 ≡ S4; behavior buch_state_S4_out: assumes 0 ≡ S3; ensures 0 ≡ S4; behavior buch_state_SF_out: ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; @/ void opb_pre_func(void) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int SF_tmp; int mainst_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; SF_tmp = 0; if (S3 == 1) S4_tmp = 1; else S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S4 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ SF ∧ 0 ≡ mainst; requires 1 ≡ S4 ⇒ res > 0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_in: assumes 1 ≡ S4 ∧ res > 0; ensures 1 ≡ SF; behavior buch_state_SF_out: assumes 0 ≡ S4 ∨ ¬(res > 0); ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; @/ void opb_post_func(int res) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int SF_tmp; int mainst_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; if (S4 == 1) if (res > 0) SF_tmp = 1; else SF_tmp = 0; else SF_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } */ /*@ requires 1 ≡ S3 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S4 ∧ 0 ≡ SF ∧ 0 ≡ mainst; behavior Buchi_property_behavior: ensures 1 ≡ SF ⇒ \result > 0; ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ mainst; ensures 1 ≡ SF; */ int opb(void) { int __retres; /*@ ghost opb_pre_func(); */ status = 1; __retres = status * 3; /*@ ghost opb_post_func(__retres); */ return __retres; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_in: assumes 1 ≡ mainst; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ mainst; ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_out: ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; @/ void main_pre_func(void) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int SF_tmp; int mainst_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; SF_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; if (mainst == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } */ /*@ ghost /@ requires 1 ≡ SF ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ mainst; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_in: assumes 1 ≡ SF; ensures 1 ≡ SF; behavior buch_state_SF_out: assumes 0 ≡ SF; ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; @/ void main_post_func(int res) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int SF_tmp; int mainst_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; if (SF == 1) SF_tmp = 1; else SF_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } */ /*@ requires 1 ≡ mainst ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ SF; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ mainst; ensures 1 ≡ SF; */ int main(void) { int __retres; /*@ ghost main_pre_func(); */ if (rr < 5000) opa(rr,300); rr = opb(); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_acces_params2.res.oracle0000666000000000000000000003377513571573400026020 0ustar [kernel] Parsing tests/aorai/test_acces_params2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_acces_params2_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_main = 3, op_opa = 2, op_opb = 1, op_opc = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 5000; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 1; */ /*@ ghost int S2 = 0; */ /*@ ghost int S3 = 0; */ /*@ ghost int S4 = 0; */ /*@ ghost int S5 = 0; */ /*@ ghost int S6 = 0; */ /*@ ghost int S7 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_in: assumes 1 ≡ S2 ∧ r ≥ 0; ensures 1 ≡ S3; behavior buch_state_S3_out: assumes 0 ≡ S2 ∨ ¬(r ≥ 0); ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; @/ void opa_pre_func(int r) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int S5_tmp; int S6_tmp; int S7_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; if (S2 == 1) if (r >= 0) S3_tmp = 1; else S3_tmp = 0; else S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S3 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; requires 1 ≡ S3 ⇒ res ≤ 5000; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_in: assumes 1 ≡ S3 ∧ res ≤ 5000; ensures 1 ≡ S4; behavior buch_state_S4_out: assumes 0 ≡ S3 ∨ ¬(res ≤ 5000); ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; @/ void opa_post_func(int res) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int S5_tmp; int S6_tmp; int S7_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; if (S3 == 1) if (res <= 5000) S4_tmp = 1; else S4_tmp = 0; else S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } */ /*@ requires 1 ≡ S2 ∧ 0 ≡ S1 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; requires 1 ≡ S2 ⇒ r ≥ 0; requires r < 5000; behavior j: ensures \result ≡ \old(r) + 1; behavior Buchi_property_behavior: ensures 1 ≡ S4 ⇒ \result ≤ 5000; ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; ensures 1 ≡ S4; */ int opa(int r) { int __retres; /*@ ghost opa_pre_func(r); */ __retres = r + 1; /*@ ghost opa_post_func(__retres); */ return __retres; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_in: assumes 1 ≡ S4; ensures 1 ≡ S5; behavior buch_state_S5_out: assumes 0 ≡ S4; ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; @/ void opb_pre_func(void) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int S5_tmp; int S6_tmp; int S7_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; if (S4 == 1) S5_tmp = 1; else S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S5 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S6 ∧ 0 ≡ S7; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_in: assumes 1 ≡ S5; ensures 1 ≡ S6; behavior buch_state_S6_out: assumes 0 ≡ S5; ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; @/ void opb_post_func(void) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int S5_tmp; int S6_tmp; int S7_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; if (S5 == 1) S6_tmp = 1; else S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } */ /*@ requires 1 ≡ S4 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; requires rr ≥ 1 ∧ rr ≤ 5000; behavior f: ensures rr ≥ 3 ∧ rr ≤ 5000; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S7; ensures 1 ≡ S6; */ void opb(void) { /*@ ghost opb_pre_func(); */ if (rr < 4998) rr += 2; /*@ ghost opb_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; @/ void opc_pre_func(void) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int S5_tmp; int S6_tmp; int S7_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opc; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } */ /*@ ghost /@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; @/ void opc_post_func(void) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int S5_tmp; int S6_tmp; int S7_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opc; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } */ /*@ requires \false; behavior d: ensures rr ≡ 600; behavior Buchi_behavior_out_0: ensures 0 ≡ S1; behavior Buchi_behavior_out_1: ensures 0 ≡ S2; behavior Buchi_behavior_out_2: ensures 0 ≡ S3; behavior Buchi_behavior_out_3: ensures 0 ≡ S4; behavior Buchi_behavior_out_4: ensures 0 ≡ S5; behavior Buchi_behavior_out_5: ensures 0 ≡ S6; behavior Buchi_behavior_out_6: ensures 0 ≡ S7; */ void opc(void) { /*@ ghost opc_pre_func(); */ rr = 600; /*@ ghost opc_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S1; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S1; ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; @/ void main_pre_func(void) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int S5_tmp; int S6_tmp; int S7_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; if (S1 == 1) S2_tmp = 1; else S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S6 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S7; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_in: assumes 1 ≡ S6; ensures 1 ≡ S7; behavior buch_state_S7_out: assumes 0 ≡ S6; ensures 0 ≡ S7; @/ void main_post_func(int res) { int S1_tmp; int S2_tmp; int S3_tmp; int S4_tmp; int S5_tmp; int S6_tmp; int S7_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; if (S6 == 1) S7_tmp = 1; else S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } */ /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; requires rr ≡ 1; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S6; ensures 1 ≡ S7; */ int main(void) { int __retres; /*@ ghost main_pre_func(); */ if (rr < 5000) rr = opa(rr); opb(); goto L6; opc(); L6: __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_boucle.res.oracle0000666000000000000000000002222713571573400024554 0ustar [kernel] Parsing tests/aorai/test_boucle.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/aorai/test_boucle.c:16: Warning: Calling undeclared function call_to_an_undefined_function. Old style K&R code? [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_call_to_an_undefined_function = 3, op_a = 2, op_b = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; extern int call_to_an_undefined_function(void); /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S1; @/ void a_pre_func(void) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_a; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_S2 == 1) accept_S1_tmp = 1; else if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; @/ void a_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_a; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; requires \true; ensures 0 ≤ \result ≤ 1; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures 1 ≡ accept_S1; */ int a(void) { int __retres; /*@ ghost a_pre_func(); */ __retres = 1; /*@ ghost a_post_func(__retres); */ return __retres; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_b; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; @/ void b_pre_func(void) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_b; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_b; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; @/ void b_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_b; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; requires \true; ensures 1 ≤ \result ≤ 2; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures 1 ≡ T0_S2; */ int b(void) { int __retres; /*@ ghost b_pre_func(); */ call_to_an_undefined_function(); __retres = 2; /*@ ghost b_post_func(__retres); */ return __retres; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; @/ void main_pre_func(void) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; @/ void main_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1; requires \true; ensures 0 ≤ \result ≤ 1; behavior aorai_acceptance: ensures 1 ≡ accept_S1; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures 1 ≡ accept_S1; */ int main(void) { /*@ ghost int aorai_Loop_Init_7; */ int tmp_1; /*@ ghost main_pre_func(); */ int x = a(); /*@ ghost aorai_Loop_Init_7 = 1; */ aorai_loop_7: /*@ loop invariant i: 0 ≤ x ≤ 11; loop invariant Aorai: 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; loop invariant Aorai: 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; loop invariant Aorai: aorai_Loop_Init_7 ≢ 0 ⇒ \at(1 ≡ T0_init,Pre) ⇒ 0 ≡ T0_S2; loop invariant Aorai: aorai_Loop_Init_7 ≡ 0 ⇒ 0 ≡ accept_S1; */ while (x < 10) { /*@ ghost aorai_Loop_Init_7 = 0; */ { int tmp_0; tmp_0 = b(); x += tmp_0; } } tmp_1 = a(); /*@ ghost main_post_func(tmp_1); */ return tmp_1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_boucle1.res.oracle0000666000000000000000000003314413571573400024635 0ustar [kernel] Parsing tests/aorai/test_boucle1.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle1_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_commit_trans = 2, op_init_trans = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int cpt = 3; /*@ global invariant inv_cpt: 0 ≤ cpt ≤ 3; */ int status = 0; /*@ global invariant inv_status: 0 ≤ status ≤ 1; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_S4 = 0; */ /*@ ghost int accept_init = 1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_commit_trans; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S4; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S4; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void commit_trans_pre_func(void) { int accept_S1_tmp; int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_commit_trans; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_S4 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_commit_trans; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void commit_trans_post_func(int res) { int accept_S1_tmp; int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_commit_trans; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_S4 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_init; requires \true; behavior a: ensures 0 ≤ \result ≤ 1; behavior Buchi_property_behavior: ensures 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S2; */ int commit_trans(void) { int __retres; /*@ ghost commit_trans_pre_func(); */ __retres = 1; /*@ ghost commit_trans_post_func(__retres); */ return __retres; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_init_trans; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void init_trans_pre_func(void) { int accept_S1_tmp; int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_init_trans; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; requires 1 ≡ accept_S2 ⇒ status ≢ 0 ∨ status ≡ 0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_init_trans; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∧ status ≡ 0; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∨ ¬(status ≡ 0); ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_in: assumes 1 ≡ accept_S2 ∧ status ≢ 0; ensures 1 ≡ accept_S4; behavior buch_state_accept_S4_out: assumes 0 ≡ accept_S2 ∨ status ≡ 0; ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void init_trans_post_func(int res) { int accept_S1_tmp; int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_init_trans; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S2 == 1) if (status != 0) accept_S4_tmp = 1; else accept_S4_tmp = 0; else accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_S2 == 1) if (status == 0) accept_S2_tmp = 1; else accept_S2_tmp = 0; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; requires \true; behavior a: ensures 0 ≤ \result ≤ 1; behavior Buchi_property_behavior: ensures (1 ≡ accept_S2 ⇒ status ≡ 0) ∧ (1 ≡ accept_S4 ⇒ status ≢ 0); ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 1 ≡ accept_S4 ∨ 0 ≡ accept_S4; ensures 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S2 ∨ 1 ≡ accept_S4; */ int init_trans(void) { int __retres; /*@ ghost init_trans_pre_func(); */ __retres = 1; /*@ ghost init_trans_post_func(__retres); */ return __retres; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_init; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_init; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void main_pre_func(void) { int accept_S1_tmp; int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_init == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void main_post_func(int res) { int accept_S1_tmp; int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; if (accept_S2 == 1) accept_S3_tmp = 1; else accept_S3_tmp = 0; if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4; requires \true; behavior a: ensures 0 ≤ \result ≤ 1; behavior aorai_acceptance: ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2 ∨ 1 ≡ accept_S3 ∨ 1 ≡ accept_S4 ∨ 1 ≡ accept_init; behavior Buchi_property_behavior: ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 1 ≡ accept_S3 ∨ 0 ≡ accept_S3; ensures 0 ≡ accept_S4 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2 ∨ 1 ≡ accept_S3; */ int main(void) { /*@ ghost int aorai_Loop_Init_7; */ int __retres; /*@ ghost main_pre_func(); */ cpt = 3; status = 0; /*@ ghost aorai_Loop_Init_7 = 1; */ aorai_loop_7: /*@ loop invariant i: 0 ≤ status ≤ 1 ∧ 0 ≤ cpt ≤ 3 ∧ (cpt ≡ 0 ⇒ status ≡ 0); loop invariant Aorai: 0 ≡ accept_S1; loop invariant Aorai: 1 ≡ accept_S2; loop invariant Aorai: 0 ≡ accept_S3; loop invariant Aorai: 0 ≡ accept_S4; loop invariant Aorai: 0 ≡ accept_init; */ while (cpt > 0) { /*@ ghost aorai_Loop_Init_7 = 0; */ status = init_trans(); if (status) { status = commit_trans(); if (status) goto label_ok; } cpt --; } __retres = 0; goto return_label; label_ok: __retres = 1; return_label: { /*@ ghost main_post_func(__retres); */ return __retres; } } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_boucle2.res.oracle0000666000000000000000000003237713571573400024645 0ustar [kernel] Parsing tests/aorai/test_boucle2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle2_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_main = 2, op_opa = 1, op_opb = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 50; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_S4 = 0; */ /*@ ghost int accept_S5 = 0; */ /*@ ghost int accept_all = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void opa_pre_func(void) { int T0_S2_tmp; int T0_init_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_in: assumes 1 ≡ T0_S2 ∧ rr ≡ 51; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ T0_S2 ∨ ¬(rr ≡ 51); ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void opa_post_func(void) { int T0_S2_tmp; int T0_init_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; if (T0_S2 == 1) if (rr == 51) accept_S3_tmp = 1; else accept_S3_tmp = 0; else accept_S3_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } */ /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; requires rr < 50; behavior j: ensures rr < 51; behavior Buchi_property_behavior: ensures 1 ≡ accept_S3 ⇒ rr ≡ 51; ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S3 ∨ 0 ≡ accept_S3; ensures 0 ≡ T0_init ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S3; */ void opa(void) { /*@ ghost opa_pre_func(); */ rr ++; /*@ ghost opa_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_in: assumes 1 ≡ accept_S3; ensures 1 ≡ accept_S4; behavior buch_state_accept_S4_out: assumes 0 ≡ accept_S3; ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void opb_pre_func(void) { int T0_S2_tmp; int T0_init_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S5_tmp = 0; if (accept_S3 == 1) accept_S4_tmp = 1; else accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S4 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_in: assumes 1 ≡ accept_S4; ensures 1 ≡ accept_S5; behavior buch_state_accept_S5_out: assumes 0 ≡ accept_S4; ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void opb_post_func(void) { int T0_S2_tmp; int T0_init_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; if (accept_S4 == 1) accept_S5_tmp = 1; else accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } */ /*@ requires 1 ≡ accept_S3 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_all; ensures 1 ≡ accept_S5; */ void opb(void) { /*@ ghost opb_pre_func(); */ status = 1; /*@ ghost opb_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void main_pre_func(void) { int T0_S2_tmp; int T0_init_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; if (T0_init == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S5 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_in: assumes 1 ≡ accept_S5; ensures 1 ≡ accept_all; behavior buch_state_accept_all_out: assumes 0 ≡ accept_S5; ensures 0 ≡ accept_all; @/ void main_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; if (accept_S5 == 1) accept_all_tmp = 1; else accept_all_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; behavior aorai_acceptance: ensures 1 ≡ accept_S3 ∨ 1 ≡ accept_S4 ∨ 1 ≡ accept_S5 ∨ 1 ≡ accept_all; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5; ensures 1 ≡ accept_all; */ int main(void) { /*@ ghost int aorai_Loop_Init_7; */ int __retres; /*@ ghost main_pre_func(); */ /*@ ghost aorai_Loop_Init_7 = 1; */ aorai_loop_7: /*@ loop invariant 0 ≤ rr ≤ 50; loop invariant Aorai: 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ accept_S3 ∨ 0 ≡ accept_S3; loop invariant Aorai: 0 ≡ accept_S4; loop invariant Aorai: 0 ≡ accept_S5; loop invariant Aorai: 0 ≡ accept_all; loop invariant Aorai: 1 ≡ T0_S2 ∨ 1 ≡ accept_S3; loop invariant Aorai: aorai_Loop_Init_7 ≢ 0 ⇒ \at(1 ≡ T0_init,Pre) ⇒ 0 ≡ accept_S3; */ while (rr < 50) { /*@ ghost aorai_Loop_Init_7 = 0; */ opa(); } opb(); /*@ ghost int tmp = 1; */ /*@ ghost tmp = 0; */ __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_boucle3.res.oracle0000666000000000000000000003062613571573400024641 0ustar [kernel] Parsing tests/aorai/test_boucle3.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle3_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_main = 2, op_opa = 1, op_opb = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 50; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S4 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int T1_S2 = 0; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_all = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_in: assumes 1 ≡ T0_S4; ensures 1 ≡ T0_S4; behavior buch_state_T0_S4_out: assumes 0 ≡ T0_S4; ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_in: assumes 1 ≡ T1_S2; ensures 1 ≡ T1_S2; behavior buch_state_T1_S2_out: assumes 0 ≡ T1_S2; ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void opa_pre_func(void) { int T0_S4_tmp; int T0_init_tmp; int T1_S2_tmp; int accept_S3_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S3_tmp = 0; if (T1_S2 == 1) T1_S2_tmp = 1; else T1_S2_tmp = 0; T0_init_tmp = 0; if (T0_S4 == 1) T0_S4_tmp = 1; else T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } */ /*@ ghost /@ requires (1 ≡ T0_S4 ∨ 1 ≡ T1_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_in: assumes 1 ≡ T0_S4; ensures 1 ≡ T0_S4; behavior buch_state_T0_S4_out: assumes 0 ≡ T0_S4; ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_in: assumes 1 ≡ T1_S2; ensures 1 ≡ T1_S2; behavior buch_state_T1_S2_out: assumes 0 ≡ T1_S2; ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void opa_post_func(void) { int T0_S4_tmp; int T0_init_tmp; int T1_S2_tmp; int accept_S3_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S3_tmp = 0; if (T1_S2 == 1) T1_S2_tmp = 1; else T1_S2_tmp = 0; T0_init_tmp = 0; if (T0_S4 == 1) T0_S4_tmp = 1; else T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } */ /*@ requires (1 ≡ T0_S4 ∨ 1 ≡ T1_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; requires 1 ≡ T1_S2 ∨ 0 ≡ T1_S2; requires 1 ≡ T0_S4 ∨ 0 ≡ T0_S4; requires rr < 50; behavior j: ensures rr < 51; behavior Buchi_behavior_in_0: assumes 1 ≡ T0_S4; ensures 1 ≡ T0_S4; behavior Buchi_behavior_in_1: assumes 1 ≡ T1_S2; ensures 1 ≡ T1_S2; behavior Buchi_behavior_out_0: assumes 0 ≡ T0_S4; ensures 0 ≡ T0_S4; behavior Buchi_behavior_out_1: ensures 0 ≡ T0_init; behavior Buchi_behavior_out_2: assumes 0 ≡ T1_S2; ensures 0 ≡ T1_S2; behavior Buchi_behavior_out_3: ensures 0 ≡ accept_S3; behavior Buchi_behavior_out_4: ensures 0 ≡ accept_all; */ void opa(void) { /*@ ghost opa_pre_func(); */ rr ++; /*@ ghost opa_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_out: ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_out: ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_in: assumes 1 ≡ T1_S2 ∧ rr ≡ 51; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ T1_S2 ∨ ¬(rr ≡ 51); ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void opb_pre_func(void) { int T0_S4_tmp; int T0_init_tmp; int T1_S2_tmp; int accept_S3_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; if (T1_S2 == 1) if (rr == 51) accept_S3_tmp = 1; else accept_S3_tmp = 0; else accept_S3_tmp = 0; T1_S2_tmp = 0; T0_init_tmp = 0; T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S3 ∧ 0 ≡ T0_S4 ∧ 0 ≡ T0_init ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_in: assumes 1 ≡ accept_S3; ensures 1 ≡ T0_S4; behavior buch_state_T0_S4_out: assumes 0 ≡ accept_S3; ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_out: ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void opb_post_func(void) { int T0_S4_tmp; int T0_init_tmp; int T1_S2_tmp; int accept_S3_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S3_tmp = 0; T1_S2_tmp = 0; T0_init_tmp = 0; if (accept_S3 == 1) T0_S4_tmp = 1; else T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } */ /*@ requires 1 ≡ T1_S2 ∧ 0 ≡ T0_S4 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; requires 1 ≡ T1_S2 ⇒ rr ≡ 51; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; ensures 1 ≡ T0_S4; */ void opb(void) { /*@ ghost opb_pre_func(); */ status = 1; /*@ ghost opb_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_out: ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T1_S2; behavior buch_state_T1_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; @/ void main_pre_func(void) { int T0_S4_tmp; int T0_init_tmp; int T1_S2_tmp; int accept_S3_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S3_tmp = 0; if (T0_init == 1) T1_S2_tmp = 1; else T1_S2_tmp = 0; T0_init_tmp = 0; T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T0_S4 ∧ 0 ≡ T0_init ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_in: assumes 1 ≡ T0_S4; ensures 1 ≡ T0_S4; behavior buch_state_T0_S4_out: assumes 0 ≡ T0_S4; ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_out: ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_in: assumes 1 ≡ T0_S4; ensures 1 ≡ accept_all; behavior buch_state_accept_all_out: assumes 0 ≡ T0_S4; ensures 0 ≡ accept_all; @/ void main_post_func(int res) { int T0_S4_tmp; int T0_init_tmp; int T1_S2_tmp; int accept_S3_tmp; int accept_all_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; if (T0_S4 == 1) accept_all_tmp = 1; else accept_all_tmp = 0; accept_S3_tmp = 0; T1_S2_tmp = 0; T0_init_tmp = 0; if (T0_S4 == 1) T0_S4_tmp = 1; else T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S4 ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; behavior aorai_acceptance: ensures 1 ≡ accept_S3 ∨ 1 ≡ accept_all; behavior Buchi_property_behavior: ensures 1 ≡ T0_S4 ∨ 0 ≡ T0_S4; ensures 1 ≡ accept_all ∨ 0 ≡ accept_all; ensures 0 ≡ T0_init ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_S3; ensures 1 ≡ T0_S4 ∨ 1 ≡ accept_all; */ int main(void) { /*@ ghost int aorai_Loop_Init_15; */ /*@ ghost int aorai_Loop_Init_7; */ int __retres; /*@ ghost main_pre_func(); */ /*@ ghost aorai_Loop_Init_7 = 1; */ aorai_loop_7: /*@ loop invariant 0 ≤ rr ≤ 50; loop invariant Aorai: 0 ≡ T0_S4; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ T1_S2; loop invariant Aorai: 0 ≡ accept_S3; loop invariant Aorai: 0 ≡ accept_all; */ while (rr < 50) { /*@ ghost aorai_Loop_Init_7 = 0; */ opa(); } opb(); rr = 0; /*@ ghost aorai_Loop_Init_15 = 1; */ aorai_loop_15: /*@ loop invariant Aorai: 1 ≡ T0_S4; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 0 ≡ T1_S2; loop invariant Aorai: 0 ≡ accept_S3; loop invariant Aorai: 0 ≡ accept_all; */ while (rr < 50) { /*@ ghost aorai_Loop_Init_15 = 0; */ opa(); } __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_boucle_rechercheTableau.res.oracle0000666000000000000000000002250313571573400030057 0ustar [kernel] Parsing tests/aorai/test_boucle_rechercheTableau.c (with preprocessing) [kernel] tests/aorai/test_boucle_rechercheTableau.c:17: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [kernel] tests/aorai/test_boucle_rechercheTableau.c:7: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle_rechercheTableau_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_foo = 2, op_isPresent = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int End = 0; */ /*@ ghost int Idle = 1; */ /*@ ghost int WillDoFoo = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void isPresent_pre_func(int *t, int max, int val) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; requires 1 ≡ Idle ⇒ res ≡ -1 ∨ res ≢ -1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ Idle ∧ res ≢ -1; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ Idle ∨ ¬(res ≢ -1); ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_in: assumes 1 ≡ Idle ∧ res ≡ -1; ensures 1 ≡ WillDoFoo; behavior buch_state_WillDoFoo_out: assumes 0 ≡ Idle ∨ ¬(res ≡ -1); ensures 0 ≡ WillDoFoo; @/ void isPresent_post_func(int res) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; if (Idle == 1) if (res == -1) WillDoFoo_tmp = 1; else WillDoFoo_tmp = 0; else WillDoFoo_tmp = 0; Idle_tmp = 0; if (Idle == 1) if (res != -1) End_tmp = 1; else End_tmp = 0; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; requires \valid(t + (0 .. max)); requires max ≥ 0; ensures (0 ≤ \result ≤ \old(max)) ∨ \result ≡ -1; ensures 0 ≤ \result ≤ \old(max) ⇒ *(\old(t) + \result) ≡ \old(val); ensures \result ≡ -1 ⇒ (∀ ℤ j; 0 ≤ j ≤ \old(max) ⇒ *(\old(t) + j) ≢ \old(val)); behavior Buchi_property_behavior: ensures (1 ≡ End ⇒ \result ≢ -1) ∧ (1 ≡ WillDoFoo ⇒ \result ≡ -1); ensures 1 ≡ End ∨ 0 ≡ End; ensures 1 ≡ WillDoFoo ∨ 0 ≡ WillDoFoo; ensures 0 ≡ Idle; ensures 1 ≡ End ∨ 1 ≡ WillDoFoo; */ int isPresent(int *t, int max, int val) { /*@ ghost int aorai_Loop_Init_2; */ int __retres; /*@ ghost isPresent_pre_func(t,max,val); */ int i = 0; /*@ ghost aorai_Loop_Init_2 = 1; */ aorai_loop_2: /*@ loop invariant inv: 0 ≤ i ≤ max ∧ \valid(t + (0 .. max)) ∧ max ≥ 0 ∧ (∀ ℤ j; 0 ≤ j ≤ i - 1 ⇒ *(t + j) ≢ val); loop invariant Aorai: 0 ≡ End; loop invariant Aorai: 1 ≡ Idle; loop invariant Aorai: 0 ≡ WillDoFoo; loop variant (v: max - i); */ while (1) { if (i < max) { if (! (*(t + i) != val)) break; } else break; /*@ ghost aorai_Loop_Init_2 = 0; */ i ++; } if (*(t + i) == val) { __retres = i; goto return_label; } __retres = -1; return_label: { /*@ ghost isPresent_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ WillDoFoo; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ WillDoFoo; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void foo_pre_func(void) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (WillDoFoo == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void foo_post_func(void) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ WillDoFoo ∧ 0 ≡ End ∧ 0 ≡ Idle; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ void foo(void) { /*@ ghost foo_pre_func(); */ /*@ ghost foo_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void main_pre_func(int argc, char **argv) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void main_post_func(int res) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; behavior aorai_acceptance: ensures 1 ≡ End; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ int main(int argc, char **argv) { int __retres; /*@ ghost main_pre_func(argc,argv); */ int tab[4] = {10, 20, 33, 15}; int r = isPresent(tab,3,33); if (r == -1) foo(); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_factorial.res.oracle0000666000000000000000000002720613571573400025251 0ustar [kernel] Parsing tests/aorai/test_factorial.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_factorial_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_decode_int = 2, op_factorial = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost int accept_init = 1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_decode_int; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void decode_int_pre_func(char *s) { int accept_S1_tmp; int accept_S2_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_decode_int; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_decode_int; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void decode_int_post_func(int res) { int accept_S1_tmp; int accept_S2_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_decode_int; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S1 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_init; behavior Buchi_property_behavior: ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ accept_init; ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int decode_int(char *s) { /*@ ghost int aorai_Loop_Init_5; */ int __retres; char c; /*@ ghost decode_int_pre_func(s); */ int intmax = ~ (1 << (sizeof(int) * (unsigned int)8 - (unsigned int)1)); int cutlim = intmax % 10; int cutoff = intmax / 10; int value = 0; /*@ ghost aorai_Loop_Init_5 = 1; */ aorai_loop_5: /*@ loop invariant Aorai: 1 ≡ accept_S1; loop invariant Aorai: 0 ≡ accept_S2; loop invariant Aorai: 0 ≡ accept_init; */ while (1) { { char *tmp; /*@ ghost aorai_Loop_Init_5 = 0; */ tmp = s; s ++; c = *tmp; if (! c) break; { int v = 0; switch ((int)c) { case '0': v = 0; break; case '1': v = 1; break; case '2': v = 2; break; case '3': v = 3; break; case '4': v = 4; break; case '5': v = 5; break; case '6': v = 6; break; case '7': v = 7; break; case '8': v = 8; break; case '9': v = 9; break; default: __retres = -1; goto return_label; } if (value > cutoff) { __retres = -1; goto return_label; } else if (value == cutoff) if (v > cutlim) { __retres = -1; goto return_label; } value = value * 10 + v; } } } __retres = value; return_label: { /*@ ghost decode_int_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_factorial; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1; ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void factorial_pre_func(int value) { int accept_S1_tmp; int accept_S2_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_factorial; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S1 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires (1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_factorial; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1; ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void factorial_post_func(int res) { int accept_S1_tmp; int accept_S2_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_factorial; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S1 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires (1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ accept_init; requires 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 0 ≤ value ≤ 12; decreases value; ensures \result ≥ 1; behavior Buchi_property_behavior: ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ accept_init; ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int factorial(int value) { int tmp_0; /*@ ghost factorial_pre_func(value); */ if (value > 0) { int tmp; tmp = factorial(value - 1); tmp_0 = tmp * value; } else tmp_0 = 1; /*@ ghost factorial_post_func(tmp_0); */ return tmp_0; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_init; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void main_pre_func(int argc, char **argv) { int accept_S1_tmp; int accept_S2_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S2_tmp = 0; if (accept_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void main_post_func(int res) { int accept_S1_tmp; int accept_S2_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S1 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; requires argc ≡ 2; ensures \result ≡ 0 ∨ \result ≡ 1; behavior Buchi_property_behavior: ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ accept_init; ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int main(int argc, char **argv) { int __retres; int value; /*@ ghost main_pre_func(argc,argv); */ if (argc != 2) { __retres = 1; goto return_label; } else { value = decode_int(*(argv + 1)); if (value < 0) { __retres = 1; goto return_label; } else if (value > 12) { __retres = 1; goto return_label; } } factorial(value); __retres = 0; return_label: { /*@ ghost main_post_func(__retres); */ return __retres; } } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_factorial2.res.oracle0000666000000000000000000002400213571573400025322 0ustar [kernel] Parsing tests/aorai/test_factorial2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_factorial2_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_decode_int = 2, op_factorial = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int S2 = 0; */ /*@ ghost int main_0 = 1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_decode_int; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void decode_int_pre_func(char *s) { int S1_tmp; int S2_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_decode_int; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; S2_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ main_0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_decode_int; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S1 ∧ 1 ≢ 0; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S1 ∨ 1 ≡ 0; ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void decode_int_post_func(int res) { int S1_tmp; int S2_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_decode_int; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) S2_tmp = 1; else S2_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } */ /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ main_0; behavior Buchi_property_behavior: ensures 1 ≡ S2 ⇒ 1 ≢ 0; ensures 1 ≡ S1 ∨ 0 ≡ S1; ensures 1 ≡ S2 ∨ 0 ≡ S2; ensures 0 ≡ main_0; ensures 1 ≡ S1 ∨ 1 ≡ S2; */ int decode_int(char *s) { /*@ ghost int aorai_Loop_Init_5; */ int __retres; char c; /*@ ghost decode_int_pre_func(s); */ int intmax = ~ (1 << (sizeof(int) * (unsigned int)8 - (unsigned int)1)); int cutlim = intmax % 10; int cutoff = intmax / 10; int value = 0; /*@ ghost aorai_Loop_Init_5 = 1; */ aorai_loop_5: /*@ loop invariant Aorai: 1 ≡ S1; loop invariant Aorai: 0 ≡ S2; loop invariant Aorai: 0 ≡ main_0; */ while (1) { { char *tmp; /*@ ghost aorai_Loop_Init_5 = 0; */ tmp = s; s ++; c = *tmp; if (! c) break; { int v = 0; switch ((int)c) { case '0': v = 0; break; case '1': v = 1; break; case '2': v = 2; break; case '3': v = 3; break; case '4': v = 4; break; case '5': v = 5; break; case '6': v = 6; break; case '7': v = 7; break; case '8': v = 8; break; case '9': v = 9; break; default: __retres = -1; goto return_label; } if (value > cutoff) { __retres = -1; goto return_label; } else if (value == cutoff) if (v > cutlim) { __retres = -1; goto return_label; } value = value * 10 + v; } } } __retres = value; return_label: { /*@ ghost decode_int_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_factorial; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S2 ∨ (1 ≡ S1 ∧ 1 ≢ 0); ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S2 ∧ (0 ≡ S1 ∨ 1 ≡ 0); ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void factorial_pre_func(int value) { int S1_tmp; int S2_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_factorial; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) S2_tmp = 1; else if (S2 == 1) S2_tmp = 1; else S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } */ /*@ ghost /@ requires (1 ≡ S1 ∨ 1 ≡ S2) ∧ 0 ≡ main_0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_factorial; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ S2 ∨ 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S2 ∧ 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S2 ∨ (1 ≡ S1 ∧ 1 ≢ 0); ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S2 ∧ (0 ≡ S1 ∨ 1 ≡ 0); ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void factorial_post_func(int res) { int S1_tmp; int S2_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_factorial; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) S2_tmp = 1; else if (S2 == 1) S2_tmp = 1; else S2_tmp = 0; if (S1 == 1) S1_tmp = 1; else if (S2 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } */ /*@ requires (1 ≡ S1 ∨ 1 ≡ S2) ∧ 0 ≡ main_0; requires 1 ≡ S1 ⇒ 1 ≢ 0; requires 1 ≡ S2 ∨ 0 ≡ S2; requires 1 ≡ S1 ∨ 0 ≡ S1; requires 0 ≤ value ≤ 12; decreases value; ensures \result ≥ 1; behavior Buchi_property_behavior: ensures 1 ≡ S1 ∨ 0 ≡ S1; ensures 1 ≡ S2 ∨ 0 ≡ S2; ensures 0 ≡ main_0; ensures 1 ≡ S1 ∨ 1 ≡ S2; */ int factorial(int value) { int tmp_0; /*@ ghost factorial_pre_func(value); */ if (value > 0) { int tmp; tmp = factorial(value - 1); tmp_0 = tmp * value; } else tmp_0 = 1; /*@ ghost factorial_post_func(tmp_0); */ return tmp_0; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ main_0; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ main_0; ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void main_pre_func(int argc, char **argv) { int S1_tmp; int S2_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; S2_tmp = 0; if (main_0 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ main_0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S1 ∧ 1 ≢ 0; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S1 ∨ 1 ≡ 0; ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void main_post_func(int res) { int S1_tmp; int S2_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) S2_tmp = 1; else S2_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } */ /*@ requires 1 ≡ main_0 ∧ 0 ≡ S1 ∧ 0 ≡ S2; requires argc ≡ 2; ensures \result ≡ 0 ∨ \result ≡ 1; behavior Buchi_property_behavior: ensures 1 ≡ S2 ⇒ 1 ≢ 0; ensures 1 ≡ S1 ∨ 0 ≡ S1; ensures 1 ≡ S2 ∨ 0 ≡ S2; ensures 0 ≡ main_0; ensures 1 ≡ S1 ∨ 1 ≡ S2; */ int main(int argc, char **argv) { int __retres; int value; /*@ ghost main_pre_func(argc,argv); */ if (argc != 2) { __retres = 1; goto return_label; } else { value = decode_int(*(argv + 1)); if (value < 0) { __retres = 1; goto return_label; } else if (value > 12) { __retres = 1; goto return_label; } } factorial(value); __retres = 0; return_label: { /*@ ghost main_post_func(__retres); */ return __retres; } } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_recursion1.res.oracle0000666000000000000000000002407213571573400025375 0ustar [kernel] Parsing tests/aorai/test_recursion1.c (with preprocessing) [kernel] tests/aorai/test_recursion1.c:21: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [kernel] tests/aorai/test_recursion1.c:42: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [kernel] tests/aorai/test_recursion1.c:54: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion1_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ axiomatic string_len { logic ℤ string_len{L}(char *s) ; axiom strlen0{L}: ∀ char *s; \valid(s) ⇒ string_len(s) ≥ 0; axiom strlen1{L}: ∀ char *s; \valid(s) ∧ *(s + 0) ≡ '\000' ⇒ string_len(s) ≡ 0; axiom strlen2{L}: ∀ char *s; \valid(s) ⇒ *(s + string_len(s)) ≡ '\000'; axiom strlen3{L}: ∀ char *s; \valid(s) ∧ *(s + 0) ≢ '\000' ⇒ string_len(s) ≡ 1 + string_len(s + 1) ∧ \valid(s + 1); axiom strlen4{L}: ∀ char *s; \valid(s) ⇒ (∀ ℤ i; 0 ≤ i < string_len(s) ⇒ *(s + i) ≢ '\000'); } */ /*@ predicate valid_string{L}(char *s) = \valid(s) ∧ \valid(s + (0 .. string_len(s))); */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; @/ void countOne_pre_func(char *argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; @/ void countOne_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; requires valid_string(argv); ensures \result ≡ string_len(\old(argv)); behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures 1 ≡ T0_S2; */ int countOne(char *argv) { int __retres; int tmp; /*@ ghost countOne_pre_func(argv); */ int r = 0; if ((int)*(argv + 0) == 0) { __retres = 0; goto return_label; } r ++; tmp = countOne(argv + 1); r += tmp; __retres = r; return_label: { /*@ ghost countOne_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; @/ void count_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S1; @/ void count_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; requires argc > 0 ∧ \valid(argv) ∧ \valid(argv + (0 .. argc)) ∧ (∀ ℤ i; 0 ≤ i < argc ⇒ valid_string(*(argv + i))); ensures \result ≥ 0; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures 1 ≡ accept_S1; */ int count(int argc, char **argv) { /*@ ghost count_pre_func(argc,argv); */ int s = countOne(*(argv + 0)); if (argc > 1) { int tmp_0; tmp_0 = count(argc - 1,argv + 1); s += tmp_0; } /*@ ghost count_post_func(s); */ return s; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; @/ void main_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; @/ void main_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1; requires argc ≥ 0 ∧ (argc > 0 ⇒ \valid(argv)) ∧ \valid(argv + (0 .. argc)) ∧ (∀ ℤ i; 0 ≤ i < argc ⇒ valid_string(*(argv + i))); ensures \result ≡ 1; behavior aorai_acceptance: ensures 1 ≡ accept_S1; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; /*@ ghost main_pre_func(argc,argv); */ int somme = 0; if (argc > 0) somme = count(argc,argv); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_recursion2.0.res.oracle0000666000000000000000000002657113571573400025542 0ustar [kernel] Parsing tests/aorai/test_recursion2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion2_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_main = 1, op_sumOne = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ axiomatic string_len { logic ℤ string_len{L}(char *s) ; axiom strlen0{L}: ∀ char *s; \valid(s) ⇒ string_len(s) ≥ 0; axiom strlen1{L}: ∀ char *s; \valid(s) ∧ *(s + 0) ≡ '\000' ⇒ string_len(s) ≡ 0; axiom strlen2{L}: ∀ char *s; \valid(s) ⇒ *(s + string_len(s)) ≡ '\000'; axiom strlen3{L}: ∀ char *s; \valid(s) ∧ *(s + 0) ≢ '\000' ⇒ string_len(s) ≡ 1 + string_len(s + 1) ∧ \valid(s + 1); axiom strlen4{L}: ∀ char *s; \valid(s) ⇒ (∀ ℤ i; 0 ≤ i < string_len(s) ⇒ *(s + i) ≢ '\000'); } */ /*@ predicate valid_string{L}(char *s) = \valid(s) ∧ \valid(s + (0 .. string_len(s))); */ /*@ axiomatic sum_tab { logic ℤ sum_tab{L}(char *t, ℤ l, ℤ i) ; axiom sum_tab0{L}: ∀ char *t, ℤ l; \valid(t + (0 .. l)) ⇒ sum_tab(t, l, 0) ≡ *(t + 0); axiom sum_tabi{L}: ∀ char *t, ℤ l, ℤ i; \valid(t + (0 .. l)) ∧ 0 < i ≤ l ⇒ sum_tab(t, l, i) ≡ sum_tab(t, l, i - 1) + *(t + i); axiom sum_tabn{L}: ∀ char *t, ℤ l; \valid(t + (0 .. l)) ∧ l > 0 ∧ l ≡ string_len(t) ⇒ sum_tab(t, l, l) ≡ sum_tab(t, l, l - 1); } */ int global_argc = 0; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int T1 = 0; */ /*@ ghost int accept_T2 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_in: assumes (1 ≡ T1 ∧ global_argc > 0) ∨ 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes (0 ≡ T1 ∨ ¬(global_argc > 0)) ∧ 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_out: ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void count_pre_func(char *argv) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; T1_tmp = 0; T0_init_tmp = 0; if (S1 == 1) S1_tmp = 1; else if (T1 == 1) if (global_argc > 0) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_out: ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void count_post_func(int res) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; T1_tmp = 0; T0_init_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ requires (1 ≡ S1 ∨ 1 ≡ T1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; requires 1 ≡ T1 ⇒ global_argc > 0; requires 1 ≡ T1 ∨ 0 ≡ T1; requires 1 ≡ S1 ∨ 0 ≡ S1; requires valid_string(argv); ensures \result ≡ string_len(\old(argv)); behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; ensures 1 ≡ S1; */ int count(char *argv) { int __retres; int tmp; /*@ ghost count_pre_func(argv); */ if ((int)*(argv + 0) == 0) { __retres = 0; goto return_label; } tmp = count(argv + 1); __retres = 1 + tmp; return_label: { /*@ ghost count_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_sumOne; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ S1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ S1; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void sumOne_pre_func(char *t, int length) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_sumOne; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (S1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T1 ∧ 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_sumOne; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T1; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void sumOne_post_func(int res) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_sumOne; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (T1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ requires 1 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; requires valid_string(t) ∧ length ≥ 0 ∧ length ≡ string_len(t); ensures \result ≡ sum_tab(\old(t), \old(length), \old(length)); behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures 1 ≡ T1; */ int sumOne(char *t, int length) { /*@ ghost int aorai_Loop_Init_11; */ /*@ ghost sumOne_pre_func(t,length); */ int sum = 0; int i = 0; i = 0; /*@ ghost aorai_Loop_Init_11 = 1; */ aorai_loop_11: /*@ loop invariant ranges: 0 ≤ i ≤ length; loop invariant sumValue0: i ≡ 0 ⇒ sum ≡ 0; loop invariant sumValuei: i > 0 ⇒ sum ≡ sum_tab(t, length, i - 1); loop invariant Aorai: 0 ≡ S1; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ T1; loop invariant Aorai: 0 ≡ accept_T2; */ while (i < length) { /*@ ghost aorai_Loop_Init_11 = 0; */ sum += (int)*(t + i); i ++; } /*@ ghost sumOne_post_func(sum); */ return sum; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T0_init; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T0_init; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void main_pre_func(int argc, char **argv) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (T0_init == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T1 ∧ 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T1; ensures 0 ≡ T1; behavior buch_state_accept_T2_in: assumes 1 ≡ T1; ensures 1 ≡ accept_T2; behavior buch_state_accept_T2_out: assumes 0 ≡ T1; ensures 0 ≡ accept_T2; @/ void main_post_func(int res) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; if (T1 == 1) accept_T2_tmp = 1; else accept_T2_tmp = 0; if (T1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ S1 ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; requires argc ≥ 0 ∧ (argc > 0 ⇒ \valid(argv) ∧ valid_string(*(argv + 0))); ensures \result ≡ 1; behavior aorai_acceptance: ensures 1 ≡ accept_T2; behavior Buchi_property_behavior: ensures 1 ≡ T1 ∨ 0 ≡ T1; ensures 1 ≡ accept_T2 ∨ 0 ≡ accept_T2; ensures 0 ≡ S1 ∧ 0 ≡ T0_init; ensures 1 ≡ T1 ∨ 1 ≡ accept_T2; */ int main(int argc, char **argv) { int __retres; int length; /*@ ghost main_pre_func(argc,argv); */ int sum = 0; global_argc = argc; if (argc > 0) { length = count(*(argv + 0)); sum = sumOne(*(argv + 0),length); } __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_recursion2.1.res.oracle0000666000000000000000000002677313571573400025547 0ustar [kernel] Parsing tests/aorai/test_recursion2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion2_1.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_main = 1, op_sumOne = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ axiomatic string_len { logic ℤ string_len{L}(char *s) ; axiom strlen0{L}: ∀ char *s; \valid(s) ⇒ string_len(s) ≥ 0; axiom strlen1{L}: ∀ char *s; \valid(s) ∧ *(s + 0) ≡ '\000' ⇒ string_len(s) ≡ 0; axiom strlen2{L}: ∀ char *s; \valid(s) ⇒ *(s + string_len(s)) ≡ '\000'; axiom strlen3{L}: ∀ char *s; \valid(s) ∧ *(s + 0) ≢ '\000' ⇒ string_len(s) ≡ 1 + string_len(s + 1) ∧ \valid(s + 1); axiom strlen4{L}: ∀ char *s; \valid(s) ⇒ (∀ ℤ i; 0 ≤ i < string_len(s) ⇒ *(s + i) ≢ '\000'); } */ /*@ predicate valid_string{L}(char *s) = \valid(s) ∧ \valid(s + (0 .. string_len(s))); */ /*@ axiomatic sum_tab { logic ℤ sum_tab{L}(char *t, ℤ l, ℤ i) ; axiom sum_tab0{L}: ∀ char *t, ℤ l; \valid(t + (0 .. l)) ⇒ sum_tab(t, l, 0) ≡ *(t + 0); axiom sum_tabi{L}: ∀ char *t, ℤ l, ℤ i; \valid(t + (0 .. l)) ∧ 0 < i ≤ l ⇒ sum_tab(t, l, i) ≡ sum_tab(t, l, i - 1) + *(t + i); axiom sum_tabn{L}: ∀ char *t, ℤ l; \valid(t + (0 .. l)) ∧ l > 0 ∧ l ≡ string_len(t) ⇒ sum_tab(t, l, l) ≡ sum_tab(t, l, l - 1); } */ int global_argc = 0; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int T1 = 0; */ /*@ ghost int accept_T2 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_in: assumes (1 ≡ T1 ∧ global_argc > 0) ∨ 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes (0 ≡ T1 ∨ ¬(global_argc > 0)) ∧ 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_out: ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void count_pre_func(char *argv) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; T1_tmp = 0; T0_init_tmp = 0; if (S1 == 1) S1_tmp = 1; else if (T1 == 1) if (global_argc > 0) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_out: ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void count_post_func(int res) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; T1_tmp = 0; T0_init_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ requires (1 ≡ S1 ∨ 1 ≡ T1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; requires 1 ≡ T1 ⇒ global_argc > 0; requires 1 ≡ T1 ∨ 0 ≡ T1; requires 1 ≡ S1 ∨ 0 ≡ S1; requires valid_string(argv); ensures \result ≡ string_len(\old(argv)); behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; ensures 1 ≡ S1; */ int count(char *argv) { int __retres; int tmp; /*@ ghost count_pre_func(argv); */ if ((int)*(argv + 0) == 0) { __retres = 0; goto return_label; } tmp = count(argv + 1); __retres = 1 + tmp; return_label: { /*@ ghost count_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_sumOne; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ S1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ S1; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void sumOne_pre_func(char *t, int length) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_sumOne; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (S1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T1 ∧ 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_sumOne; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T1; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void sumOne_post_func(int res) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_sumOne; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (T1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ requires 1 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; requires valid_string(t) ∧ length ≥ 0 ∧ length ≡ string_len(t); ensures \result ≡ sum_tab(\old(t), \old(length), \old(length)); behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures 1 ≡ T1; */ int sumOne(char *t, int length) { /*@ ghost int aorai_Loop_Init_11; */ /*@ ghost sumOne_pre_func(t,length); */ int sum = 0; int i = 0; i = 0; /*@ ghost aorai_Loop_Init_11 = 1; */ aorai_loop_11: /*@ loop invariant ranges: 0 ≤ i ≤ length; loop invariant sumValue0: i ≡ 0 ⇒ sum ≡ 0; loop invariant sumValuei: i > 0 ⇒ sum ≡ sum_tab(t, length, i - 1); loop invariant Aorai: 0 ≡ S1; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ T1; loop invariant Aorai: 0 ≡ accept_T2; */ while (i < length) { /*@ ghost aorai_Loop_Init_11 = 0; */ sum += (int)*(t + i); i ++; } /*@ ghost sumOne_post_func(sum); */ return sum; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T0_init; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T0_init; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; @/ void main_pre_func(int argc, char **argv) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (T0_init == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T1 ∧ 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T1; ensures 0 ≡ T1; behavior buch_state_accept_T2_in: assumes 1 ≡ T1 ∧ res ≡ 1; ensures 1 ≡ accept_T2; behavior buch_state_accept_T2_out: assumes 0 ≡ T1 ∨ ¬(res ≡ 1); ensures 0 ≡ accept_T2; @/ void main_post_func(int res) { int S1_tmp; int T0_init_tmp; int T1_tmp; int accept_T2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; if (T1 == 1) if (res == 1) accept_T2_tmp = 1; else accept_T2_tmp = 0; else accept_T2_tmp = 0; if (T1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ S1 ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; requires argc ≥ 0 ∧ (argc > 0 ⇒ \valid(argv) ∧ valid_string(*(argv + 0))); ensures \result ≡ 1; behavior aorai_acceptance: ensures 1 ≡ accept_T2; behavior Buchi_property_behavior: ensures 1 ≡ accept_T2 ⇒ \result ≡ 1; ensures 1 ≡ T1 ∨ 0 ≡ T1; ensures 1 ≡ accept_T2 ∨ 0 ≡ accept_T2; ensures 0 ≡ S1 ∧ 0 ≡ T0_init; ensures 1 ≡ T1 ∨ 1 ≡ accept_T2; */ int main(int argc, char **argv) { int __retres; int length; /*@ ghost main_pre_func(argc,argv); */ int sum = 0; global_argc = argc; if (argc > 0) { length = count(*(argv + 0)); sum = sumOne(*(argv + 0),length); } __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_recursion4.res.oracle0000666000000000000000000002215513571573400025400 0ustar [kernel] Parsing tests/aorai/test_recursion4.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion4_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_foo = 2, op_isPresent = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; #pragma JessieIntegerModel(math) /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int End = 0; */ /*@ ghost int Idle = 1; */ /*@ ghost int WillDoFoo = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void isPresent_pre_func(int *t, int size, int val) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires 1 ≡ End ∨ 1 ≡ Idle ∨ 1 ≡ WillDoFoo; requires 1 ≡ End ⇒ res ≢ -1; requires 1 ≡ Idle ⇒ res ≡ -1 ∨ res ≢ -1; requires 1 ≡ WillDoFoo ⇒ res ≡ -1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes (1 ≡ Idle ∧ res ≢ -1) ∨ (1 ≡ End ∧ res ≢ -1); ensures 1 ≡ End; behavior buch_state_End_out: assumes (0 ≡ Idle ∨ ¬(res ≢ -1)) ∧ (0 ≡ End ∨ ¬(res ≢ -1)); ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_in: assumes (1 ≡ WillDoFoo ∧ res ≡ -1) ∨ (1 ≡ Idle ∧ res ≡ -1); ensures 1 ≡ WillDoFoo; behavior buch_state_WillDoFoo_out: assumes (0 ≡ WillDoFoo ∨ ¬(res ≡ -1)) ∧ (0 ≡ Idle ∨ ¬(res ≡ -1)); ensures 0 ≡ WillDoFoo; @/ void isPresent_post_func(int res) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; if (Idle == 1) { if (res == -1) WillDoFoo_tmp = 1; else goto _LAND; } else { _LAND: ; if (WillDoFoo == 1) if (res == -1) WillDoFoo_tmp = 1; else WillDoFoo_tmp = 0; else WillDoFoo_tmp = 0; } Idle_tmp = 0; if (End == 1) { if (res != -1) End_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (Idle == 1) if (res != -1) End_tmp = 1; else End_tmp = 0; else End_tmp = 0; } End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; requires \valid(t + (0 .. size - 1)); requires size ≥ 0; decreases size; ensures -1 ≤ \result < \old(size); behavior found: ensures 0 ≤ \result ⇒ *(\old(t) + \result) ≡ \old(val); behavior notIn: ensures \result ≡ -1 ⇒ (∀ ℤ i; 0 ≤ i < \old(size) ⇒ *(\old(t) + i) ≢ \old(val)); behavior Buchi_property_behavior: ensures (1 ≡ End ⇒ \result ≢ -1) ∧ (1 ≡ WillDoFoo ⇒ \result ≡ -1); ensures 1 ≡ End ∨ 0 ≡ End; ensures 1 ≡ WillDoFoo ∨ 0 ≡ WillDoFoo; ensures 0 ≡ Idle; ensures 1 ≡ End ∨ 1 ≡ WillDoFoo; */ int isPresent(int *t, int size, int val) { int __retres; int tmp; /*@ ghost isPresent_pre_func(t,size,val); */ if (size == 0) { __retres = -1; goto return_label; } if (*(t + 0) == val) { __retres = 0; goto return_label; } tmp = isPresent(t + 1,size - 1,val); int r = 1 + tmp; if (r == 0) r = -1; __retres = r; return_label: { /*@ ghost isPresent_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ WillDoFoo; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ WillDoFoo; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void foo_pre_func(void) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (WillDoFoo == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void foo_post_func(void) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ WillDoFoo ∧ 0 ≡ End ∧ 0 ≡ Idle; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ void foo(void) { /*@ ghost foo_pre_func(); */ /*@ ghost foo_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void main_pre_func(int argc, char **argv) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void main_post_func(int res) { int End_tmp; int Idle_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; behavior aorai_acceptance: ensures 1 ≡ End; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ int main(int argc, char **argv) { int __retres; /*@ ghost main_pre_func(argc,argv); */ int tab[4] = {10, 20, 33, 15}; int r = isPresent(tab,4,33); if (r == -1) foo(); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_recursion5.res.oracle0000666000000000000000000003541313571573400025402 0ustar [kernel] Parsing tests/aorai/test_recursion5.c (with preprocessing) [kernel] tests/aorai/test_recursion5.c:12: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [kernel] tests/aorai/test_recursion5.c:28: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion5_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_foo = 3, op_isPresent = 2, op_isPresentRec = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int End = 0; */ /*@ ghost int Idle = 1; */ /*@ ghost int IgnoreFoo = 0; */ /*@ ghost int WillDoFoo = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_isPresentRec; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void isPresentRec_pre_func(int *t, int i, int max, int val) { int End_tmp; int Idle_tmp; int IgnoreFoo_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_isPresentRec; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires (1 ≡ Idle ∨ 1 ≡ IgnoreFoo ∨ 1 ≡ WillDoFoo) ∧ 0 ≡ End; requires 1 ≡ Idle ⇒ res ≡ -1 ∨ res ≢ -1; requires 1 ≡ IgnoreFoo ⇒ res ≢ -1; requires 1 ≡ WillDoFoo ⇒ res ≡ -1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_isPresentRec; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_in: assumes (1 ≡ IgnoreFoo ∧ res ≢ -1) ∨ (1 ≡ Idle ∧ res ≢ -1); ensures 1 ≡ IgnoreFoo; behavior buch_state_IgnoreFoo_out: assumes (0 ≡ IgnoreFoo ∨ ¬(res ≢ -1)) ∧ (0 ≡ Idle ∨ ¬(res ≢ -1)); ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_in: assumes (1 ≡ WillDoFoo ∧ res ≡ -1) ∨ (1 ≡ Idle ∧ res ≡ -1); ensures 1 ≡ WillDoFoo; behavior buch_state_WillDoFoo_out: assumes (0 ≡ WillDoFoo ∨ ¬(res ≡ -1)) ∧ (0 ≡ Idle ∨ ¬(res ≡ -1)); ensures 0 ≡ WillDoFoo; @/ void isPresentRec_post_func(int res) { int End_tmp; int Idle_tmp; int IgnoreFoo_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_isPresentRec; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; if (Idle == 1) { if (res == -1) WillDoFoo_tmp = 1; else goto _LAND; } else { _LAND: ; if (WillDoFoo == 1) if (res == -1) WillDoFoo_tmp = 1; else WillDoFoo_tmp = 0; else WillDoFoo_tmp = 0; } if (Idle == 1) { if (res != -1) IgnoreFoo_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (IgnoreFoo == 1) if (res != -1) IgnoreFoo_tmp = 1; else IgnoreFoo_tmp = 0; else IgnoreFoo_tmp = 0; } Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; requires \valid(t + (0 .. max)); requires max ≥ 0; requires 0 ≤ i ≤ max; decreases max - i; ensures (\old(i) ≤ \result ≤ \old(max)) ∨ \result ≡ -1; ensures \old(i) ≤ \result ≤ \old(max) ⇒ *(\old(t) + \result) ≡ \old(val); ensures \result ≡ -1 ⇒ (∀ ℤ j; \old(i) ≤ j ≤ \old(max) ⇒ *(\old(t) + j) ≢ \old(val)); behavior Buchi_property_behavior: ensures (1 ≡ IgnoreFoo ⇒ \result ≢ -1) ∧ (1 ≡ WillDoFoo ⇒ \result ≡ -1); ensures 1 ≡ IgnoreFoo ∨ 0 ≡ IgnoreFoo; ensures 1 ≡ WillDoFoo ∨ 0 ≡ WillDoFoo; ensures 0 ≡ End ∧ 0 ≡ Idle; ensures 1 ≡ IgnoreFoo ∨ 1 ≡ WillDoFoo; */ int isPresentRec(int *t, int i, int max, int val) { int __retres; int tmp; /*@ ghost isPresentRec_pre_func(t,i,max,val); */ if (*(t + i) == val) { __retres = i; goto return_label; } if (max == i) { __retres = -1; goto return_label; } tmp = isPresentRec(t,i + 1,max,val); __retres = tmp; return_label: { /*@ ghost isPresentRec_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void isPresent_pre_func(int *t, int max, int val) { int End_tmp; int Idle_tmp; int IgnoreFoo_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires (1 ≡ IgnoreFoo ∨ 1 ≡ WillDoFoo) ∧ 0 ≡ End ∧ 0 ≡ Idle; requires 1 ≡ IgnoreFoo ⇒ res ≢ -1; requires 1 ≡ WillDoFoo ⇒ res ≡ -1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ IgnoreFoo ∧ res ≢ -1; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ IgnoreFoo ∨ ¬(res ≢ -1); ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_in: assumes 1 ≡ WillDoFoo ∧ res ≡ -1; ensures 1 ≡ WillDoFoo; behavior buch_state_WillDoFoo_out: assumes 0 ≡ WillDoFoo ∨ ¬(res ≡ -1); ensures 0 ≡ WillDoFoo; @/ void isPresent_post_func(int res) { int End_tmp; int Idle_tmp; int IgnoreFoo_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; if (WillDoFoo == 1) if (res == -1) WillDoFoo_tmp = 1; else WillDoFoo_tmp = 0; else WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; Idle_tmp = 0; if (IgnoreFoo == 1) if (res != -1) End_tmp = 1; else End_tmp = 0; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; requires \valid(t + (0 .. max)); requires max ≥ 0; ensures (0 ≤ \result ≤ \old(max)) ∨ \result ≡ -1; ensures 0 ≤ \result ≤ \old(max) ⇒ *(\old(t) + \result) ≡ \old(val); ensures \result ≡ -1 ⇒ (∀ ℤ i; 0 ≤ i ≤ \old(max) ⇒ *(\old(t) + i) ≢ \old(val)); behavior Buchi_property_behavior: ensures (1 ≡ End ⇒ \result ≢ -1) ∧ (1 ≡ WillDoFoo ⇒ \result ≡ -1); ensures 1 ≡ End ∨ 0 ≡ End; ensures 1 ≡ WillDoFoo ∨ 0 ≡ WillDoFoo; ensures 0 ≡ Idle ∧ 0 ≡ IgnoreFoo; ensures 1 ≡ End ∨ 1 ≡ WillDoFoo; */ int isPresent(int *t, int max, int val) { int tmp; /*@ ghost isPresent_pre_func(t,max,val); */ tmp = isPresentRec(t,0,max,val); /*@ ghost isPresent_post_func(tmp); */ return tmp; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ WillDoFoo; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ WillDoFoo; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void foo_pre_func(void) { int End_tmp; int Idle_tmp; int IgnoreFoo_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; Idle_tmp = 0; if (WillDoFoo == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void foo_post_func(void) { int End_tmp; int Idle_tmp; int IgnoreFoo_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ WillDoFoo ∧ 0 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ IgnoreFoo; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ void foo(void) { /*@ ghost foo_pre_func(); */ /*@ ghost foo_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void main_pre_func(int argc, char **argv) { int End_tmp; int Idle_tmp; int IgnoreFoo_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ ghost /@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; @/ void main_post_func(int res) { int End_tmp; int Idle_tmp; int IgnoreFoo_tmp; int WillDoFoo_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } */ /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; behavior aorai_acceptance: ensures 1 ≡ End; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ int main(int argc, char **argv) { int __retres; /*@ ghost main_pre_func(argc,argv); */ int tab[4] = {10, 20, 33, 15}; int r = isPresent(tab,3,33); if (r == -1) foo(); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_struct.res.oracle0000666000000000000000000001161713571573400024630 0ustar [kernel] Parsing tests/aorai/test_struct.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_struct_0.i (no preprocessing) /* Generated by Frama-C */ struct People { int Age ; char Gender ; }; enum aorai_ListOper { op_increment = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; struct People nobody; int myAge = 0; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int main_0 = 1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_increment; assigns aorai_CurOpStatus, aorai_CurOperation, S1, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1 ∧ nobody.Age ≡ 1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1 ∨ ¬(nobody.Age ≡ 1); ensures 0 ≡ S1; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void increment_pre_func(void) { int S1_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_increment; S1_tmp = S1; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) if (nobody.Age == 1) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; main_0 = main_0_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S1 ∧ 0 ≡ main_0; requires 1 ≡ S1 ⇒ nobody.Age ≡ 1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_increment; assigns aorai_CurOpStatus, aorai_CurOperation, S1, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1 ∧ nobody.Age ≡ 1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1 ∨ ¬(nobody.Age ≡ 1); ensures 0 ≡ S1; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void increment_post_func(void) { int S1_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_increment; S1_tmp = S1; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) if (nobody.Age == 1) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; main_0 = main_0_tmp; return; } */ /*@ requires 1 ≡ S1 ∧ 0 ≡ main_0; requires 1 ≡ S1 ⇒ nobody.Age ≡ 1; behavior Buchi_property_behavior: ensures 1 ≡ S1 ⇒ nobody.Age ≡ 1; ensures 0 ≡ main_0; ensures 1 ≡ S1; */ void increment(void) { /*@ ghost increment_pre_func(); */ (nobody.Age) ++; myAge ++; /*@ ghost increment_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, main_0; behavior buch_state_S1_in: assumes 1 ≡ main_0 ∧ nobody.Age ≡ 0; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ main_0 ∨ ¬(nobody.Age ≡ 0); ensures 0 ≡ S1; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void main_pre_func(void) { int S1_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; main_0_tmp = main_0; main_0_tmp = 0; if (main_0 == 1) if (nobody.Age == 0) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; main_0 = main_0_tmp; return; } */ /*@ ghost /@ requires 1 ≡ S1 ∧ 0 ≡ main_0; requires 1 ≡ S1 ⇒ nobody.Age ≡ 1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1 ∧ nobody.Age ≡ 1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1 ∨ ¬(nobody.Age ≡ 1); ensures 0 ≡ S1; behavior buch_state_main_0_out: ensures 0 ≡ main_0; @/ void main_post_func(int res) { int S1_tmp; int main_0_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) if (nobody.Age == 1) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; main_0 = main_0_tmp; return; } */ /*@ requires 1 ≡ main_0 ∧ 0 ≡ S1; requires 1 ≡ main_0 ⇒ nobody.Age ≡ 0; behavior aorai_acceptance: ensures 1 ≡ S1 ∨ 1 ≡ main_0; behavior Buchi_property_behavior: ensures 1 ≡ S1 ⇒ nobody.Age ≡ 1; ensures 0 ≡ main_0; ensures 1 ≡ S1; */ int main(void) { int __retres; /*@ ghost main_pre_func(); */ nobody.Age = 0; increment(); __retres = 0; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_switch2.res.oracle0000666000000000000000000004500313571573400024663 0ustar [kernel] Parsing tests/aorai/test_switch2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [aorai] tests/aorai/test_switch2.c:34: Warning: Call to opc not conforming to automaton (post-cond). Assuming it is on a dead path [aorai] tests/aorai/test_switch2.c:23: Warning: Call to opc not conforming to automaton (pre-cond). Assuming it is on a dead path [kernel] Parsing /tmp/aorai_test_switch2_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_main = 3, op_opa = 2, op_opb = 1, op_opc = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 50; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_S4 = 0; */ /*@ ghost int accept_S5 = 0; */ /*@ ghost int accept_S6 = 0; */ /*@ ghost int accept_all = 0; */ /*@ ghost int accept_init = 1; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opa_pre_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; if (accept_S2 == 1) accept_S3_tmp = 1; else accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S3 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_in: assumes 1 ≡ accept_S3; ensures 1 ≡ accept_S4; behavior buch_state_accept_S4_out: assumes 0 ≡ accept_S3; ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opa_post_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; if (accept_S3 == 1) accept_S4_tmp = 1; else accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; requires rr < 50; behavior j: ensures rr < 51; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S4; */ void opa(void) { /*@ ghost opa_pre_func(); */ rr ++; /*@ ghost opa_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_in: assumes 1 ≡ accept_S4; ensures 1 ≡ accept_S5; behavior buch_state_accept_S5_out: assumes 0 ≡ accept_S4; ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opb_pre_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; if (accept_S4 == 1) accept_S5_tmp = 1; else accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S5 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_in: assumes 1 ≡ accept_S5; ensures 1 ≡ accept_S6; behavior buch_state_accept_S6_out: assumes 0 ≡ accept_S5; ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opb_post_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; if (accept_S5 == 1) accept_S6_tmp = 1; else accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_S4 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S6; */ void opb(void) { /*@ ghost opb_pre_func(); */ status = 1; /*@ ghost opb_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opc_pre_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opc; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void opc_post_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opc; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires \false; behavior Buchi_behavior_out_0: ensures 0 ≡ accept_S2; behavior Buchi_behavior_out_1: ensures 0 ≡ accept_S3; behavior Buchi_behavior_out_2: ensures 0 ≡ accept_S4; behavior Buchi_behavior_out_3: ensures 0 ≡ accept_S5; behavior Buchi_behavior_out_4: ensures 0 ≡ accept_S6; behavior Buchi_behavior_out_5: ensures 0 ≡ accept_all; behavior Buchi_behavior_out_6: ensures 0 ≡ accept_init; */ void opc(void) { /*@ ghost opc_pre_func(); */ rr = 9000; /*@ ghost opc_post_func(); */ return; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_init; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_init; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void main_pre_func(void) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_init == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S6 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_in: assumes 1 ≡ accept_S6; ensures 1 ≡ accept_all; behavior buch_state_accept_all_out: assumes 0 ≡ accept_S6; ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; @/ void main_post_func(int res) { int accept_S2_tmp; int accept_S3_tmp; int accept_S4_tmp; int accept_S5_tmp; int accept_S6_tmp; int accept_all_tmp; int accept_init_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S6 == 1) accept_all_tmp = 1; else accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } */ /*@ requires 1 ≡ accept_init ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all; behavior aorai_acceptance: ensures 1 ≡ accept_S2 ∨ 1 ≡ accept_S3 ∨ 1 ≡ accept_S4 ∨ 1 ≡ accept_S5 ∨ 1 ≡ accept_S6 ∨ 1 ≡ accept_all ∨ 1 ≡ accept_init; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_all; */ int main(void) { int __retres; /*@ ghost main_pre_func(); */ switch (rr) { case 1: opa(); break; case 3: opa(); default: opc(); } opb(); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_switch3.res.oracle0000666000000000000000000002651713571573400024675 0ustar [kernel] Parsing tests/aorai/test_switch3.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_switch3_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void countOne_pre_func(char *argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else if (accept_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void countOne_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; requires 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2; */ int countOne(char *argv) { /*@ ghost countOne_pre_func(argv); */ int r = 0; switch ((int)*(argv + 0)) { int tmp; case 0: r = 0; break; case 1: case 2: case 3: default: r ++; tmp = countOne(argv + 1); r += tmp; } /*@ ghost countOne_post_func(r); */ return r; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S2; @/ void count_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ ghost /@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S2; @/ void count_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (T0_S2 == 1) accept_S1_tmp = 1; else if (accept_S1 == 1) accept_S1_tmp = 1; else if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int count(int argc, char **argv) { int __retres; /*@ ghost count_pre_func(argc,argv); */ if (argc > 0) { int tmp; int tmp_0; tmp = countOne(*(argv + 0)); tmp_0 = count(argc - 1,argv + 1); __retres = tmp + tmp_0; goto return_label; } __retres = 0; return_label: { /*@ ghost count_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void main_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_init == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void main_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; behavior aorai_acceptance: ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; int somme; /*@ ghost main_pre_func(argc,argv); */ somme = count(argc,argv); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_switch3_et_recursion.res.oracle0000666000000000000000000002113113571573400027441 0ustar [kernel] Parsing tests/aorai/test_switch3_et_recursion.c (with preprocessing) [aorai] Welcome to the Aorai plugin [aorai] tests/aorai/test_switch3_et_recursion.c:26: Warning: Call to countOne does not follow automaton's specification. This path is assumed to be dead [kernel] Parsing /tmp/aorai_test_switch3_et_recursion_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; @/ void countOne_pre_func(char *argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ ghost /@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; @/ void countOne_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; behavior Buchi_behavior_out_0: ensures 0 ≡ T0_S2; behavior Buchi_behavior_out_1: ensures 0 ≡ T0_init; behavior Buchi_behavior_out_2: ensures 0 ≡ accept_S1; */ int countOne(char *argv) { /*@ ghost countOne_pre_func(argv); */ int r = 0; switch ((int)*(argv + 0)) { int tmp; case 0: r = 0; case 1: case 2: case 3: default: r ++; tmp = countOne(argv + 1); r += tmp; } /*@ ghost countOne_post_func(r); */ return r; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; @/ void count_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S1; @/ void count_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures 1 ≡ accept_S1; */ int count(int argc, char **argv) { int __retres; /*@ ghost count_pre_func(argc,argv); */ if (argc > 0) { int tmp; int tmp_0; tmp = countOne(*(argv + 0)); tmp_0 = count(argc - 1,argv + 1); __retres = tmp + tmp_0; goto return_label; } __retres = 0; return_label: { /*@ ghost count_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; @/ void main_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; @/ void main_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1; behavior aorai_acceptance: ensures 1 ≡ accept_S1; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; int somme; /*@ ghost main_pre_func(argc,argv); */ somme = count(argc,argv); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_switch3_if.res.oracle0000666000000000000000000002642713571573400025353 0ustar [kernel] Parsing tests/aorai/test_switch3_if.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_switch3_if_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void countOne_pre_func(char *argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else if (accept_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void countOne_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; requires 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2; */ int countOne(char *argv) { /*@ ghost countOne_pre_func(argv); */ int r = 0; if ((int)*(argv + 0) != 0) { int tmp; r ++; tmp = countOne(argv + 1); r += tmp; } /*@ ghost countOne_post_func(r); */ return r; } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S2; @/ void count_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ ghost /@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S2; @/ void count_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (T0_S2 == 1) accept_S1_tmp = 1; else if (accept_S1 == 1) accept_S1_tmp = 1; else if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int count(int argc, char **argv) { int __retres; /*@ ghost count_pre_func(argc,argv); */ if (argc > 0) { int tmp; int tmp_0; tmp = countOne(*(argv + 0)); tmp_0 = count(argc - 1,argv + 1); __retres = tmp + tmp_0; goto return_label; } __retres = 0; return_label: { /*@ ghost count_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void main_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_init == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void main_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; behavior aorai_acceptance: ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; int somme; /*@ ghost main_pre_func(argc,argv); */ somme = count(argc,argv); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle/test_switch3_return.res.oracle0000666000000000000000000002667213571573400026276 0ustar [kernel] Parsing tests/aorai/test_switch3_return.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_switch3_return_0.i (no preprocessing) /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void countOne_pre_func(char *argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else if (accept_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void countOne_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; requires 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2; */ int countOne(char *argv) { int __retres; /*@ ghost countOne_pre_func(argv); */ int r = 0; switch ((int)*(argv + 0)) { int tmp; case 0: __retres = 0; goto return_label; case 1: case 2: case 3: default: r ++; tmp = countOne(argv + 1); r += tmp; } __retres = r; return_label: { /*@ ghost countOne_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S2; @/ void count_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ ghost /@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S2; @/ void count_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (T0_S2 == 1) accept_S1_tmp = 1; else if (accept_S1 == 1) accept_S1_tmp = 1; else if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int count(int argc, char **argv) { int __retres; /*@ ghost count_pre_func(argc,argv); */ if (argc > 0) { int tmp; int tmp_0; tmp = countOne(*(argv + 0)); tmp_0 = count(argc - 1,argv + 1); __retres = tmp + tmp_0; goto return_label; } __retres = 0; return_label: { /*@ ghost count_post_func(__retres); */ return __retres; } } /*@ ghost /@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void main_pre_func(int argc, char **argv) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_init == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ ghost /@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; @/ void main_post_func(int res) { int T0_S2_tmp; int T0_init_tmp; int accept_S1_tmp; int accept_S2_tmp; aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } */ /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; behavior aorai_acceptance: ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; int somme; /*@ ghost main_pre_func(argc,argv); */ somme = count(argc,argv); __retres = 1; /*@ ghost main_post_func(__retres); */ return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/0000777000000000000000000000000013571573400021473 5ustar frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/assigns.0.res.oracle0000666000000000000000000002562513571573400025271 0ustar [kernel] Parsing tests/aorai/assigns.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_assigns0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_in_main_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_in_main_in_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S_in_f_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_S_in_f_in_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_in_main_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_S_in_f_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_in_main_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S_in_f_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S_in_f_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_in_main_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Sf_in_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_f = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int X; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 1; */ /*@ ghost int S2 = 0; */ /*@ ghost int S_in_f = 0; */ /*@ ghost int Sf = 0; */ /*@ ghost int in_main = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S_in_f_in: assumes 1 ≡ Sf; ensures 1 ≡ S_in_f; behavior buch_state_S_in_f_out: assumes 0 ≡ Sf; ensures 0 ≡ S_in_f; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_in_main_out: ensures 0 ≡ in_main; */ void f_pre_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S_in_f_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int in_main_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S1_tmp = S1; S2_tmp = S2; S_in_f_tmp = S_in_f; Sf_tmp = Sf; in_main_tmp = in_main; in_main_tmp = 0; Sf_tmp = 0; if (Sf == 1) S_in_f_tmp = 1; else S_in_f_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S_in_f = S_in_f_tmp; Sf = Sf_tmp; in_main = in_main_tmp; return; } /*@ requires 1 ≡ S_in_f ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ Sf ∧ 0 ≡ in_main; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S_in_f_out: ensures 0 ≡ S_in_f; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_in_main_in: assumes 1 ≡ S_in_f; ensures 1 ≡ in_main; behavior buch_state_in_main_out: assumes 0 ≡ S_in_f; ensures 0 ≡ in_main; */ void f_post_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S_in_f_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int in_main_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S1_tmp = S1; S2_tmp = S2; S_in_f_tmp = S_in_f; Sf_tmp = Sf; in_main_tmp = in_main; if (S_in_f == 1) in_main_tmp = 1; else in_main_tmp = 0; Sf_tmp = 0; S_in_f_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S_in_f = S_in_f_tmp; Sf = Sf_tmp; in_main = in_main_tmp; return; } /*@ requires 1 ≡ Sf ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S_in_f ∧ 0 ≡ in_main; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S_in_f ∧ 0 ≡ Sf; ensures 1 ≡ in_main; */ void f(void) { f_pre_func(); X ++; f_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S_in_f_out: ensures 0 ≡ S_in_f; behavior buch_state_Sf_in: assumes 1 ≡ S1; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ S1; ensures 0 ≡ Sf; behavior buch_state_in_main_out: ensures 0 ≡ in_main; */ void main_pre_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S_in_f_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int in_main_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S_in_f_tmp = S_in_f; Sf_tmp = Sf; in_main_tmp = in_main; in_main_tmp = 0; if (S1 == 1) Sf_tmp = 1; else Sf_tmp = 0; S_in_f_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S_in_f = S_in_f_tmp; Sf = Sf_tmp; in_main = in_main_tmp; return; } /*@ requires 1 ≡ in_main ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S_in_f ∧ 0 ≡ Sf; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ in_main; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ in_main; ensures 0 ≡ S2; behavior buch_state_S_in_f_out: ensures 0 ≡ S_in_f; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_in_main_out: ensures 0 ≡ in_main; */ void main_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S_in_f_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int in_main_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S_in_f_tmp = S_in_f; Sf_tmp = Sf; in_main_tmp = in_main; in_main_tmp = 0; Sf_tmp = 0; S_in_f_tmp = 0; if (in_main == 1) S2_tmp = 1; else S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S_in_f = S_in_f_tmp; Sf = Sf_tmp; in_main = in_main_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S_in_f ∧ 0 ≡ Sf ∧ 0 ≡ in_main; assigns X, aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior foo: assigns X, aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S_in_f ∧ 0 ≡ Sf ∧ 0 ≡ in_main; ensures 1 ≡ S2; */ int main(void) { main_pre_func(); /*@ assigns X; */ X ++; /*@ assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S_in_f, Sf, in_main, X; */ f(); main_post_func(X); return X; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/assigns.1.res.oracle0000666000000000000000000001636013571573400025266 0ustar [kernel] Parsing tests/aorai/assigns.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_assigns1.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_in_main_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S_in_f_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid /* Generated by Frama-C */ enum aorai_States { aorai_reject_state = -2, S1 = 0, S2 = 1, S_in_f = 2, Sf = 3, in_main = 4 }; enum aorai_ListOper { op_f = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ lemma in_main_deterministic_trans{L}: \true; */ /*@ lemma Sf_deterministic_trans{L}: \true; */ /*@ lemma S_in_f_deterministic_trans{L}: \true; */ /*@ lemma S2_deterministic_trans{L}: \true; */ /*@ lemma S1_deterministic_trans{L}: \true; */ int X; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int aorai_CurStates = S1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S_in_f_in: assumes aorai_CurStates ≡ Sf; ensures aorai_CurStates ≡ S_in_f; behavior buch_state_S_in_f_out: assumes aorai_CurStates ≢ Sf; ensures aorai_CurStates ≢ S_in_f; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_in_main_out: ensures aorai_CurStates ≢ in_main; */ void f_pre_func(void) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (3 == aorai_CurStates) aorai_CurStates_tmp = S_in_f; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ S_in_f; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S_in_f_out: ensures aorai_CurStates ≢ S_in_f; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_in_main_in: assumes aorai_CurStates ≡ S_in_f; ensures aorai_CurStates ≡ in_main; behavior buch_state_in_main_out: assumes aorai_CurStates ≢ S_in_f; ensures aorai_CurStates ≢ in_main; */ void f_post_func(void) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (2 == aorai_CurStates) aorai_CurStates_tmp = in_main; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ Sf; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ in_main; */ void f(void) { f_pre_func(); X ++; f_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S_in_f_out: ensures aorai_CurStates ≢ S_in_f; behavior buch_state_Sf_in: assumes aorai_CurStates ≡ S1; ensures aorai_CurStates ≡ Sf; behavior buch_state_Sf_out: assumes aorai_CurStates ≢ S1; ensures aorai_CurStates ≢ Sf; behavior buch_state_in_main_out: ensures aorai_CurStates ≢ in_main; */ void main_pre_func(void) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (0 == aorai_CurStates) aorai_CurStates_tmp = Sf; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ in_main; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_in: assumes aorai_CurStates ≡ in_main; ensures aorai_CurStates ≡ S2; behavior buch_state_S2_out: assumes aorai_CurStates ≢ in_main; ensures aorai_CurStates ≢ S2; behavior buch_state_S_in_f_out: ensures aorai_CurStates ≢ S_in_f; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_in_main_out: ensures aorai_CurStates ≢ in_main; */ void main_post_func(int res) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (4 == aorai_CurStates) aorai_CurStates_tmp = S2; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ S1; assigns X, aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior foo: assigns X, aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ S2; */ int main(void) { main_pre_func(); /*@ assigns X; */ X ++; /*@ assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates, X; */ f(); main_post_func(X); return X; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/assigns.2.res.oracle0000666000000000000000000000057013571573400025263 0ustar [kernel] Parsing tests/aorai/assigns.c (with preprocessing) [aorai] Welcome to the Aorai plugin /* Generated by Frama-C */ int X; void f(void) { X ++; return; } /*@ assigns X; behavior foo: assigns X; */ int main(void) { /*@ assigns X; */ X ++; /*@ assigns X; */ f(); return X; } [kernel] Found project "default" [kernel] Found project "aorai" frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/bts1289.0.res.oracle0000666000000000000000000000546013571573400024731 0ustar [kernel] Parsing tests/aorai/bts1289.i (no preprocessing) [aorai] Welcome to the Aorai plugin [aorai] warning: Call to main does not follow automaton's specification. This path is assumed to be dead [kernel] Parsing /tmp/aorai_bts12890.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_a_post_func_assign : Valid [wp] [Qed] Goal typed_a_post_func_post_2 : Valid [wp] [Qed] Goal typed_a_post_func_post : Valid [wp] [Qed] Goal typed_a_pre_func_assign : Valid [wp] [Qed] Goal typed_a_pre_func_post_2 : Valid [wp] [Qed] Goal typed_a_pre_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_a = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation; */ void a_pre_func(void) { aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_a; return; } /*@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation; */ void a_post_func(void) { aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_a; return; } /*@ requires \false; */ void a(void) { a_pre_func(); a_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation; */ void main_pre_func(void) { aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; return; } /*@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation; */ void main_post_func(void) { aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; return; } /*@ requires \false; */ void main(void) { int aorai_Loop_Init_16; int i; main_pre_func(); i = 0; /*@ ghost aorai_Loop_Init_16 = 1; */ aorai_loop_16: /*@ loop assigns i, aorai_Loop_Init_16, aorai_CurOpStatus, aorai_CurOperation; loop assigns aorai_Loop_Init_16 \from \nothing; */ while (1) { if (! (i < 10)) goto while_0_break; /*@ ghost aorai_Loop_Init_16 = 0; */ a(); i ++; } while_0_break: ; main_post_func(); return; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/bts1289.1.res.oracle0000666000000000000000000003457713571573400024745 0ustar [kernel] Parsing tests/aorai/bts1289.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_bts12891.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_a_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_a_post_func_post_2 : Valid [wp] [Qed] Goal typed_a_post_func_post : Valid [wp] [Qed] Goal typed_a_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_S_in_post : Valid [wp] [Qed] Goal typed_a_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_T_out_post : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_T_in_post : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_S_out_post : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_a_pre_func_post_2 : Valid [wp] [Qed] Goal typed_a_pre_func_post : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_T_out_post : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_S_out_post : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_aorai_intermediate_state_0_in_post : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_aorai_intermediate_state_in_post : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_0_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_a = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S = 0; */ /*@ ghost int T = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int init = 1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; behavior buch_state_S_out: ensures 0 ≡ S; behavior buch_state_T_out: ensures 0 ≡ T; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S; ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ T; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ T; ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_init_out: ensures 0 ≡ init; */ void a_pre_func(void) { /*@ ghost int S_tmp; */ /*@ ghost int T_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_a; S_tmp = S; T_tmp = T; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; init_tmp = init; init_tmp = 0; if (T == 1) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; if (S == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; T_tmp = 0; S_tmp = 0; S = S_tmp; T = T_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; init = init_tmp; return; } /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S ∧ 0 ≡ T ∧ 0 ≡ init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; behavior buch_state_S_in: assumes 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ aorai_intermediate_state_0; ensures 0 ≡ S; behavior buch_state_T_in: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ T; behavior buch_state_T_out: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ T; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_init_out: ensures 0 ≡ init; */ void a_post_func(void) { /*@ ghost int S_tmp; */ /*@ ghost int T_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_a; S_tmp = S; T_tmp = T; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; init_tmp = init; init_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) T_tmp = 1; else T_tmp = 0; if (aorai_intermediate_state_0 == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; T = T_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; init = init_tmp; return; } /*@ requires (1 ≡ S ∨ 1 ≡ T) ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ init; requires 1 ≡ T ∨ 0 ≡ T; requires 1 ≡ S ∨ 0 ≡ S; behavior Buchi_behavior_in_0: assumes 1 ≡ S; ensures 1 ≡ T; behavior Buchi_behavior_in_1: assumes 1 ≡ T; ensures 1 ≡ S; behavior Buchi_behavior_out_0: assumes 0 ≡ T; ensures 0 ≡ S; behavior Buchi_behavior_out_1: assumes 0 ≡ S; ensures 0 ≡ T; behavior Buchi_behavior_out_2: ensures 0 ≡ aorai_intermediate_state; behavior Buchi_behavior_out_3: ensures 0 ≡ aorai_intermediate_state_0; behavior Buchi_behavior_out_4: ensures 0 ≡ init; */ void a(void) { a_pre_func(); a_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; behavior buch_state_S_in: assumes 1 ≡ init; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ init; ensures 0 ≡ S; behavior buch_state_T_out: ensures 0 ≡ T; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_init_out: ensures 0 ≡ init; */ void main_pre_func(void) { /*@ ghost int S_tmp; */ /*@ ghost int T_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S_tmp = S; T_tmp = T; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; init_tmp = init; init_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; T_tmp = 0; if (init == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; T = T_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; init = init_tmp; return; } /*@ requires 1 ≡ S ∧ 0 ≡ T ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; behavior buch_state_S_in: assumes 1 ≡ S; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ S; ensures 0 ≡ S; behavior buch_state_T_out: ensures 0 ≡ T; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_init_out: ensures 0 ≡ init; */ void main_post_func(void) { /*@ ghost int S_tmp; */ /*@ ghost int T_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S_tmp = S; T_tmp = T; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; init_tmp = init; init_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; T_tmp = 0; if (S == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; T = T_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; init = init_tmp; return; } /*@ requires 1 ≡ init ∧ 0 ≡ S ∧ 0 ≡ T ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0; behavior Buchi_property_behavior: ensures 0 ≡ T ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ init; ensures 1 ≡ S; */ void main(void) { int aorai_Loop_Init_16; int i; main_pre_func(); i = 0; /*@ ghost aorai_Loop_Init_16 = 1; */ aorai_loop_16: /*@ loop invariant Aorai: 1 ≡ S ∨ 0 ≡ S; loop invariant Aorai: 1 ≡ T ∨ 0 ≡ T; loop invariant Aorai: 0 ≡ aorai_intermediate_state; loop invariant Aorai: 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: 0 ≡ init; loop invariant Aorai: 1 ≡ S ∨ 1 ≡ T; loop invariant Aorai: aorai_Loop_Init_16 ≢ 0 ⇒ \at(1 ≡ init,Pre) ⇒ 0 ≡ T; loop assigns i, aorai_Loop_Init_16, aorai_CurOpStatus, aorai_CurOperation, S, T, aorai_intermediate_state, aorai_intermediate_state_0, init; loop assigns aorai_Loop_Init_16 \from \nothing; */ while (1) { if (! (i < 10)) goto while_0_break; /*@ ghost aorai_Loop_Init_16 = 0; */ a(); i ++; } while_0_break: ; main_post_func(); return; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/deterministic.res.oracle0000666000000000000000000004434413571573400026326 0ustar [kernel] Parsing tests/aorai/deterministic.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_deterministic0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S5_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Si_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_g_post_func_post_2 : Valid [wp] [Qed] Goal typed_g_post_func_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part3 : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_S0_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_S2_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_S1_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_S3_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_Sf_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_Si_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_g_pre_func_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S5_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Si_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_real_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_real_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_real_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_real_main_post_func_post : Valid [wp] [Qed] Goal typed_real_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_real_main_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_real_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_real_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_real_main_post_func_buch_state_S5_out_post : Valid [wp] [Qed] Goal typed_real_main_post_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_real_main_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_real_main_post_func_buch_state_Si_out_post : Valid [wp] [Qed] Goal typed_real_main_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_real_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_real_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_real_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_real_main_pre_func_post : Valid [wp] [Qed] Goal typed_real_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_real_main_pre_func_assign_part3 : Valid /* Generated by Frama-C */ enum aorai_States { aorai_reject_state = -2, S0 = 0, S1 = 1, S2 = 2, S3 = 3, S4 = 4, S5 = 5, Sf = 6, Si = 7 }; enum aorai_ListOper { op_f = 3, op_g = 2, op_main = 1, op_real_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ lemma Si_deterministic_trans{L}: \true; */ /*@ lemma Sf_deterministic_trans{L}: \true; */ /*@ lemma S5_deterministic_trans{L}: \true; */ /*@ lemma S4_deterministic_trans{L}: \true; */ /*@ lemma S2_deterministic_trans{L}: \true; */ int X; int Y; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ lemma S3_deterministic_trans{L}: ∀ int x; ¬(\at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ x ≡ 5 ∧ \at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ x ≡ 4); */ /*@ lemma S1_deterministic_trans{L}: ∀ int __retres_f, int x; ¬(\at(X,L) ≡ 5 ∧ \at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ __retres_f ≡ 0 ∧ \at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ x ≡ 4); */ /*@ lemma S0_deterministic_trans{L}: ∀ int c; ¬(\at(aorai_CurOperation,L) ≡ op_real_main ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ c ≢ 0 ∧ \at(aorai_CurOperation,L) ≡ op_real_main ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ c ≡ 0); */ /*@ ghost int aorai_CurStates = Si; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_in: assumes aorai_CurStates ≡ S3 ∧ x ≡ 4; ensures aorai_CurStates ≡ S4; behavior buch_state_S4_out: assumes aorai_CurStates ≢ S3 ∨ ¬(x ≡ 4); ensures aorai_CurStates ≢ S4; behavior buch_state_S5_in: assumes aorai_CurStates ≡ S3 ∧ x ≡ 5; ensures aorai_CurStates ≡ S5; behavior buch_state_S5_out: assumes aorai_CurStates ≢ S3 ∨ ¬(x ≡ 5); ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; */ void g_pre_func(int x) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; aorai_CurStates_tmp = aorai_CurStates; if (3 == aorai_CurStates) if (x == 5) aorai_CurStates_tmp = S5; if (3 == aorai_CurStates) if (x == 4) aorai_CurStates_tmp = S4; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ S4 ∨ aorai_CurStates ≡ S5; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_in: assumes aorai_CurStates ≡ S5; ensures aorai_CurStates ≡ S1; behavior buch_state_S1_out: assumes aorai_CurStates ≢ S5; ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_in: assumes aorai_CurStates ≡ S4; ensures aorai_CurStates ≡ S3; behavior buch_state_S3_out: assumes aorai_CurStates ≢ S4; ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; */ void g_post_func(void) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; aorai_CurStates_tmp = aorai_CurStates; if (4 == aorai_CurStates) aorai_CurStates_tmp = S3; if (5 == aorai_CurStates) aorai_CurStates_tmp = S1; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ S3; requires aorai_CurStates ≡ S3 ⇒ x ≡ 4 ∨ x ≡ 5; behavior Buchi_behavior_in_1: assumes aorai_CurStates ≡ S3 ∧ x ≡ 5; ensures aorai_CurStates ≡ S1; behavior Buchi_behavior_in_0: assumes aorai_CurStates ≡ S3 ∧ x ≡ 4; ensures aorai_CurStates ≡ S3; */ void g(int x) { g_pre_func(x); Y = x; g_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_in: assumes aorai_CurStates ≡ S1 ∧ x ≡ 4; ensures aorai_CurStates ≡ S3; behavior buch_state_S3_out: assumes aorai_CurStates ≢ S1 ∨ ¬(x ≡ 4); ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; */ void f_pre_func(int x) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (1 == aorai_CurStates) if (x == 4) aorai_CurStates_tmp = S3; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ S1; requires aorai_CurStates ≡ S1 ⇒ res ≡ 0 ∧ X ≡ 5; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_in: assumes aorai_CurStates ≡ S1 ∧ X ≡ 5 ∧ res ≡ 0; ensures aorai_CurStates ≡ S2; behavior buch_state_S2_out: assumes aorai_CurStates ≢ S1 ∨ ¬(X ≡ 5 ∧ res ≡ 0); ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; */ void f_post_func(int res) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (1 == aorai_CurStates) if (X == 5) if (res == 0) aorai_CurStates_tmp = S2; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ S1; requires aorai_CurStates ≡ S1 ⇒ x ≡ 4; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ S2 ⇒ \result ≡ 0 ∧ X ≡ 5; ensures aorai_CurStates ≡ S2; */ int f(int x) { int __retres; f_pre_func(x); X = x; g(X); X ++; g(X); __retres = 0; f_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_real_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_in: assumes aorai_CurStates ≡ S0 ∧ c ≢ 0; ensures aorai_CurStates ≡ S1; behavior buch_state_S1_out: assumes aorai_CurStates ≢ S0 ∨ c ≡ 0; ensures aorai_CurStates ≢ S1; behavior buch_state_S2_in: assumes aorai_CurStates ≡ S0 ∧ c ≡ 0; ensures aorai_CurStates ≡ S2; behavior buch_state_S2_out: assumes aorai_CurStates ≢ S0 ∨ ¬(c ≡ 0); ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; */ void real_main_pre_func(int c) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_real_main; aorai_CurStates_tmp = aorai_CurStates; if (0 == aorai_CurStates) if (c == 0) aorai_CurStates_tmp = S2; if (0 == aorai_CurStates) if (c != 0) aorai_CurStates_tmp = S1; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_real_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_in: assumes aorai_CurStates ≡ S2; ensures aorai_CurStates ≡ Sf; behavior buch_state_Sf_out: assumes aorai_CurStates ≢ S2; ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; */ void real_main_post_func(int res) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_real_main; aorai_CurStates_tmp = aorai_CurStates; if (2 == aorai_CurStates) aorai_CurStates_tmp = Sf; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ S0; requires aorai_CurStates ≡ S0 ⇒ c ≢ 0 ∨ c ≡ 0; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ Sf; */ int real_main(int c) { int __retres; real_main_pre_func(c); if (c) f(4); __retres = 0; real_main_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_in: assumes aorai_CurStates ≡ Si; ensures aorai_CurStates ≡ S0; behavior buch_state_S0_out: assumes aorai_CurStates ≢ Si; ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_out: ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; */ void main_pre_func(int c) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (7 == aorai_CurStates) aorai_CurStates_tmp = S0; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ Sf; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_S0_out: ensures aorai_CurStates ≢ S0; behavior buch_state_S1_out: ensures aorai_CurStates ≢ S1; behavior buch_state_S2_out: ensures aorai_CurStates ≢ S2; behavior buch_state_S3_out: ensures aorai_CurStates ≢ S3; behavior buch_state_S4_out: ensures aorai_CurStates ≢ S4; behavior buch_state_S5_out: ensures aorai_CurStates ≢ S5; behavior buch_state_Sf_in: assumes aorai_CurStates ≡ Sf; ensures aorai_CurStates ≡ Sf; behavior buch_state_Sf_out: assumes aorai_CurStates ≢ Sf; ensures aorai_CurStates ≢ Sf; behavior buch_state_Si_out: ensures aorai_CurStates ≢ Si; */ void main_post_func(int res) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (6 == aorai_CurStates) aorai_CurStates_tmp = Sf; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ Si; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ Sf; */ int main(int c) { int tmp; main_pre_func(c); tmp = real_main(c); main_post_func(tmp); return tmp; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/formals.res.oracle0000666000000000000000000006164713571573400025133 0ustar [kernel] Parsing tests/aorai/formals.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_formals0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part7 : Valid [wp] [Alt-Ergo] Goal typed_f_post_func_buch_state_OK_out_post : Valid [wp] [Alt-Ergo] Goal typed_f_post_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Alt-Ergo] Goal typed_f_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Alt-Ergo] Goal typed_f_post_func_buch_state_main_0_out_post : Valid [wp] [Alt-Ergo] Goal typed_f_post_func_buch_state_init_out_post : Valid [wp] [Alt-Ergo] Goal typed_f_post_func_buch_state_aorai_reject_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_in_0_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_out_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_2_in_0_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_2_out_post_2 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_g_post_func_post_2 : Valid [wp] [Qed] Goal typed_g_post_func_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_OK_out_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part7 : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_reject_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_init_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_g_pre_func_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_OK_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_OK_in_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_1_in_0_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_1_out_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_reject_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_reject_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_OK_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_1_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_0_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_OK_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_reject_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_reject_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_2_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_main_0_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid /* Generated by Frama-C */ enum aorai_States { aorai_reject_state = -2, OK = 0, aorai_intermediate_state = 1, aorai_intermediate_state_0 = 2, aorai_intermediate_state_1 = 3, aorai_intermediate_state_2 = 4, aorai_reject = 5, init = 6, main_0 = 7 }; enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ lemma init_deterministic_trans{L}: \true; */ /*@ lemma aorai_reject_deterministic_trans{L}: \true; */ /*@ lemma OK_deterministic_trans{L}: \true; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ lemma main_0_deterministic_trans{L}: ∀ int x; ¬(x ≡ 3 ∧ \at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ x ≡ 1 ∧ \at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called); */ /*@ lemma aorai_intermediate_state_0_deterministic_trans{L}: ¬(\at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called ∧ ¬(\at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Called)); */ /*@ ghost int aorai_CurStates = init; */ /*@ ghost int aorai_x_0 = 0; */ /*@ lemma aorai_intermediate_state_2_deterministic_trans{L}: ¬(\at(aorai_x_0,L) ≡ 3 ∧ \at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ (¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated) ∨ \at(aorai_x_0,L) ≢ 3)); */ /*@ ghost int aorai_y = 0; */ /*@ lemma aorai_intermediate_state_1_deterministic_trans{L}: ¬(\at(aorai_y,L) ≡ 2 ∧ \at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ (¬(\at(aorai_CurOperation,L) ≡ op_g ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated) ∨ \at(aorai_y,L) ≢ 2)); */ /*@ ghost int aorai_x = 0; */ /*@ lemma aorai_intermediate_state_deterministic_trans{L}: ¬(\at(aorai_x,L) ≡ 1 ∧ \at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated ∧ (¬(\at(aorai_CurOperation,L) ≡ op_f ∧ \at(aorai_CurOpStatus,L) ≡ aorai_Terminated) ∨ \at(aorai_x,L) ≢ 1)); */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_x_0, aorai_x, aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_out: ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_in_0: assumes aorai_CurStates ≡ main_0 ∧ x ≡ 1; ensures aorai_CurStates ≡ aorai_intermediate_state; ensures aorai_x ≡ \old(x); behavior buch_state_aorai_intermediate_state_out: assumes aorai_CurStates ≢ main_0 ∨ ¬(x ≡ 1); ensures aorai_CurStates ≢ aorai_intermediate_state; ensures aorai_x ≡ \old(aorai_x); behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in_0: assumes aorai_CurStates ≡ main_0 ∧ x ≡ 3; ensures aorai_CurStates ≡ aorai_intermediate_state_2; ensures aorai_x_0 ≡ \old(x); behavior buch_state_aorai_intermediate_state_2_out: assumes aorai_CurStates ≢ main_0 ∨ ¬(x ≡ 3); ensures aorai_CurStates ≢ aorai_intermediate_state_2; ensures aorai_x_0 ≡ \old(aorai_x_0); behavior buch_state_aorai_reject_out: ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; */ void f_pre_func(int x) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (7 == aorai_CurStates) if (x == 3) { aorai_CurStates_tmp = aorai_intermediate_state_2; aorai_x_0 = x; } if (7 == aorai_CurStates) if (x == 1) { aorai_CurStates_tmp = aorai_intermediate_state; aorai_x = x; } aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ aorai_intermediate_state ∨ aorai_CurStates ≡ aorai_intermediate_state_2; requires aorai_CurStates ≡ aorai_intermediate_state ⇒ aorai_x ≡ 1 ∨ aorai_x ≢ 1; requires aorai_CurStates ≡ aorai_intermediate_state_2 ⇒ aorai_x_0 ≡ 3 ∨ aorai_x_0 ≢ 3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_in: assumes aorai_CurStates ≡ aorai_intermediate_state_2 ∧ aorai_x_0 ≡ 3; ensures aorai_CurStates ≡ OK; behavior buch_state_OK_out: assumes aorai_CurStates ≢ aorai_intermediate_state_2 ∨ ¬(aorai_x_0 ≡ 3); ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes aorai_CurStates ≡ aorai_intermediate_state ∧ aorai_x ≡ 1; ensures aorai_CurStates ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes aorai_CurStates ≢ aorai_intermediate_state ∨ ¬(aorai_x ≡ 1); ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes (aorai_CurStates ≡ aorai_intermediate_state_2 ∧ aorai_x_0 ≢ 3) ∨ (aorai_CurStates ≡ aorai_intermediate_state ∧ aorai_x ≢ 1); ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes (aorai_CurStates ≢ aorai_intermediate_state_2 ∨ ¬(aorai_x_0 ≢ 3)) ∧ (aorai_CurStates ≢ aorai_intermediate_state ∨ ¬(aorai_x ≢ 1)); ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; */ void f_post_func(int res) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; aorai_CurStates_tmp = aorai_CurStates; if (4 == aorai_CurStates) { if (aorai_x_0 != 3) aorai_CurStates_tmp = aorai_reject; else goto _LAND; } else { _LAND: ; if (1 == aorai_CurStates) if (aorai_x != 1) aorai_CurStates_tmp = aorai_reject; } if (1 == aorai_CurStates) if (aorai_x == 1) aorai_CurStates_tmp = aorai_intermediate_state_0; if (4 == aorai_CurStates) if (aorai_x_0 == 3) aorai_CurStates_tmp = OK; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ main_0; requires aorai_CurStates ≡ main_0 ⇒ x ≡ 1 ∨ x ≡ 3; ensures aorai_CurStates ≡ aorai_intermediate_state_0 ∨ aorai_CurStates ≡ OK; ensures \old(aorai_CurStates ≡ main_0) ⇒ aorai_CurStates ≢ OK ∧ aorai_CurStates ≢ aorai_reject ⇒ aorai_x_0 ≡ \old(aorai_x_0); ensures \old(aorai_CurStates ≡ main_0) ⇒ aorai_CurStates ≢ aorai_intermediate_state_0 ∧ aorai_CurStates ≢ aorai_reject ⇒ aorai_x ≡ \old(aorai_x); behavior Buchi_behavior_in_1: assumes aorai_CurStates ≡ main_0 ∧ x ≡ 3; ensures (aorai_CurStates ≡ OK ⇒ aorai_x_0 ≡ 3) ∧ (aorai_CurStates ≡ aorai_intermediate_state_0 ⇒ aorai_x ≡ 1) ∧ (aorai_CurStates ≡ aorai_reject ⇒ aorai_x ≢ 1 ∨ aorai_x_0 ≢ 3); ensures aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_reject; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x_0 ≡ \at(x,Pre)+0 ∨ aorai_x_0 ≡ \at(aorai_x_0,Pre)+0; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x ≡ \at(x,Pre)+0 ∨ aorai_x ≡ \at(aorai_x,Pre)+0; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_x_0 ≡ \at(x,Pre)+0; behavior Buchi_behavior_in_0: assumes aorai_CurStates ≡ main_0 ∧ x ≡ 1; ensures (aorai_CurStates ≡ OK ⇒ aorai_x_0 ≡ 3) ∧ (aorai_CurStates ≡ aorai_intermediate_state_0 ⇒ aorai_x ≡ 1) ∧ (aorai_CurStates ≡ aorai_reject ⇒ aorai_x ≢ 1 ∨ aorai_x_0 ≢ 3); ensures aorai_CurStates ≡ aorai_intermediate_state_0 ∨ aorai_CurStates ≡ aorai_reject; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x_0 ≡ \at(x,Pre)+0 ∨ aorai_x_0 ≡ \at(aorai_x_0,Pre)+0; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x ≡ \at(x,Pre)+0 ∨ aorai_x ≡ \at(aorai_x,Pre)+0; ensures \at(aorai_CurStates ≡ main_0,Pre) ∧ aorai_CurStates ≡ aorai_intermediate_state_0 ⇒ aorai_x ≡ \at(x,Pre)+0; */ int f(int x) { f_pre_func(x); f_post_func(x); return x; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_y, aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_in: assumes aorai_CurStates ≡ OK; ensures aorai_CurStates ≡ OK; behavior buch_state_OK_out: assumes aorai_CurStates ≢ OK; ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in_0: assumes aorai_CurStates ≡ aorai_intermediate_state_0; ensures aorai_CurStates ≡ aorai_intermediate_state_1; ensures aorai_y ≡ \old(y); behavior buch_state_aorai_intermediate_state_1_out: assumes aorai_CurStates ≢ aorai_intermediate_state_0; ensures aorai_CurStates ≢ aorai_intermediate_state_1; ensures aorai_y ≡ \old(aorai_y); behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes aorai_CurStates ≡ aorai_reject; ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes aorai_CurStates ≢ aorai_reject; ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; */ void g_pre_func(int y) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; aorai_CurStates_tmp = aorai_CurStates; if (5 == aorai_CurStates) aorai_CurStates_tmp = aorai_reject; if (2 == aorai_CurStates) { aorai_CurStates_tmp = aorai_intermediate_state_1; aorai_y = y; } if (0 == aorai_CurStates) aorai_CurStates_tmp = OK; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_intermediate_state_1; requires aorai_CurStates ≡ aorai_intermediate_state_1 ⇒ aorai_y ≡ 2 ∨ aorai_y ≢ 2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_in: assumes (aorai_CurStates ≡ aorai_intermediate_state_1 ∧ aorai_y ≡ 2) ∨ aorai_CurStates ≡ OK; ensures aorai_CurStates ≡ OK; behavior buch_state_OK_out: assumes (aorai_CurStates ≢ aorai_intermediate_state_1 ∨ ¬(aorai_y ≡ 2)) ∧ aorai_CurStates ≢ OK; ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes aorai_CurStates ≡ aorai_reject ∨ (aorai_CurStates ≡ aorai_intermediate_state_1 ∧ aorai_y ≢ 2); ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes aorai_CurStates ≢ aorai_reject ∧ (aorai_CurStates ≢ aorai_intermediate_state_1 ∨ ¬(aorai_y ≢ 2)); ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; */ void g_post_func(int res) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; aorai_CurStates_tmp = aorai_CurStates; if (5 == aorai_CurStates) aorai_CurStates_tmp = aorai_reject; else if (3 == aorai_CurStates) if (aorai_y != 2) aorai_CurStates_tmp = aorai_reject; if (3 == aorai_CurStates) { if (aorai_y == 2) aorai_CurStates_tmp = OK; else goto _LAND; } else { _LAND: ; if (0 == aorai_CurStates) aorai_CurStates_tmp = OK; } aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_intermediate_state_0; requires aorai_CurStates ≡ aorai_reject ∨ aorai_CurStates ≢ aorai_reject; requires aorai_CurStates ≡ aorai_intermediate_state_0 ∨ aorai_CurStates ≢ aorai_intermediate_state_0; requires aorai_CurStates ≡ OK ∨ aorai_CurStates ≢ OK; ensures aorai_CurStates ≡ OK; behavior Buchi_behavior_in_2: assumes aorai_CurStates ≡ aorai_reject; ensures aorai_CurStates ≡ aorai_reject; behavior Buchi_behavior_in_1: assumes aorai_CurStates ≡ aorai_intermediate_state_0; ensures aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_reject; ensures \at(aorai_CurStates ≡ aorai_intermediate_state_0,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_y ≡ \at(y,Pre)+0; ensures \at(aorai_CurStates ≡ aorai_intermediate_state_0,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_y ≡ \at(y,Pre)+0; behavior Buchi_behavior_in_0: assumes aorai_CurStates ≡ OK; ensures aorai_CurStates ≡ OK; */ int g(int y) { g_pre_func(y); g_post_func(y); return y; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_out: ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_out: ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_in: assumes aorai_CurStates ≡ init; ensures aorai_CurStates ≡ main_0; behavior buch_state_main_0_out: assumes aorai_CurStates ≢ init; ensures aorai_CurStates ≢ main_0; */ void main_pre_func(void) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (6 == aorai_CurStates) aorai_CurStates_tmp = main_0; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ OK; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, aorai_CurStates; behavior buch_state_OK_in: assumes aorai_CurStates ≡ OK; ensures aorai_CurStates ≡ OK; behavior buch_state_OK_out: assumes aorai_CurStates ≢ OK; ensures aorai_CurStates ≢ OK; behavior buch_state_aorai_intermediate_state_out: ensures aorai_CurStates ≢ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures aorai_CurStates ≢ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures aorai_CurStates ≢ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures aorai_CurStates ≢ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes aorai_CurStates ≡ aorai_reject; ensures aorai_CurStates ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes aorai_CurStates ≢ aorai_reject; ensures aorai_CurStates ≢ aorai_reject; behavior buch_state_init_out: ensures aorai_CurStates ≢ init; behavior buch_state_main_0_out: ensures aorai_CurStates ≢ main_0; */ void main_post_func(int res) { /*@ ghost int aorai_CurStates_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; aorai_CurStates_tmp = aorai_CurStates; if (5 == aorai_CurStates) aorai_CurStates_tmp = aorai_reject; if (0 == aorai_CurStates) aorai_CurStates_tmp = OK; aorai_CurStates_tmp = aorai_CurStates; return; } /*@ requires aorai_CurStates ≡ init; ensures aorai_CurStates ≡ OK; behavior Buchi_property_behavior: ensures aorai_CurStates ≡ OK ∨ aorai_CurStates ≡ aorai_reject; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x_0 ≡ \at(1,Pre)+0 ∨ aorai_x_0 ≡ \at(aorai_x_0,Pre)+0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_y ≡ \at(2,Pre)+0 ∨ aorai_y ≡ \at(aorai_y,Pre)+0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ aorai_reject ⇒ aorai_x ≡ \at(1,Pre)+0 ∨ aorai_x ≡ \at(aorai_x,Pre)+0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_x_0 ≡ \at(1,Pre)+0 ∨ aorai_x_0 ≡ \at(aorai_x_0,Pre)+0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_y ≡ \at(2,Pre)+0 ∨ aorai_y ≡ \at(aorai_y,Pre)+0; ensures \at(aorai_CurStates ≡ init,Pre) ∧ aorai_CurStates ≡ OK ⇒ aorai_x ≡ \at(1,Pre)+0 ∨ aorai_x ≡ \at(aorai_x,Pre)+0; */ int main(void) { int __retres; main_pre_func(); f(1); g(2); __retres = 0; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/generate_assigns_bts1290.res.oracle0000666000000000000000000000605013571573400030160 0ustar [kernel] Parsing tests/aorai/generate_assigns_bts1290.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_generate_assigns_bts12900.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S = 1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S; behavior buch_state_S_in: assumes 1 ≡ S; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ S; ensures 0 ≡ S; */ void main_pre_func(void) { /*@ ghost int S_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S_tmp = S; if (S == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; return; } /*@ requires 1 ≡ S; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S; behavior buch_state_S_in: assumes 1 ≡ S; ensures 1 ≡ S; behavior buch_state_S_out: assumes 0 ≡ S; ensures 0 ≡ S; */ void main_post_func(void) { /*@ ghost int S_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S_tmp = S; if (S == 1) S_tmp = 1; else S_tmp = 0; S = S_tmp; return; } /*@ requires 1 ≡ S; behavior Buchi_property_behavior: ensures \true; ensures 1 ≡ S; */ void main(void) { int aorai_Loop_Init_11; int i; main_pre_func(); i = 0; /*@ ghost aorai_Loop_Init_11 = 1; */ aorai_loop_11: /*@ loop invariant Aorai: 1 ≡ S; loop assigns i, aorai_Loop_Init_11, aorai_CurOpStatus, aorai_CurOperation, S; loop assigns aorai_Loop_Init_11 \from \nothing; */ while (1) { if (! (i < 10)) goto while_0_break; /*@ ghost aorai_Loop_Init_11 = 0; */ i ++; } while_0_break: ; main_post_func(); return; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/goto.res.oracle0000666000000000000000000007501613571573400024433 0ustar [kernel] Parsing tests/aorai/goto.c (with preprocessing) [aorai] Welcome to the Aorai plugin tests/aorai/goto.c:28:[aorai] warning: Call to opc does not follow automaton's specification. This path is assumed to be dead [kernel] Parsing /tmp/aorai_goto0.i (no preprocessing) /tmp/aorai_goto0.i:4:[wp] warning: Global invariant not handled yet ('inv' ignored) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_all_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_post_func_post_2 : Valid [wp] [Qed] Goal typed_opa_post_func_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S4_in_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_all_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_opa_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opa_pre_func_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S3_in_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_post_func_post_2 : Valid [wp] [Qed] Goal typed_opb_post_func_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S6_in_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opb_pre_func_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S5_in_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opc_post_func_post_2 : Valid [wp] [Qed] Goal typed_opc_post_func_post : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S5_out_post : Valid [wp] Computing [200 goals...] [wp] [Qed] Goal typed_opc_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opc_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opc_pre_func_post : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S6_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_main = 3, op_opa = 2, op_opb = 1, op_opc = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 5000; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_S4 = 0; */ /*@ ghost int accept_S5 = 0; */ /*@ ghost int accept_S6 = 0; */ /*@ ghost int accept_all = 0; */ /*@ ghost int accept_init = 1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opa_pre_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; if (accept_S2 == 1) accept_S3_tmp = 1; else accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S3 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_in: assumes 1 ≡ accept_S3; ensures 1 ≡ accept_S4; behavior buch_state_accept_S4_out: assumes 0 ≡ accept_S3; ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opa_post_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; if (accept_S3 == 1) accept_S4_tmp = 1; else accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; requires rr < 5000; behavior j: ensures rr < 5001; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S4; */ void opa(void) { opa_pre_func(); rr ++; opa_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_in: assumes 1 ≡ accept_S4; ensures 1 ≡ accept_S5; behavior buch_state_accept_S5_out: assumes 0 ≡ accept_S4; ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opb_pre_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; if (accept_S4 == 1) accept_S5_tmp = 1; else accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S5 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_in: assumes 1 ≡ accept_S5; ensures 1 ≡ accept_S6; behavior buch_state_accept_S6_out: assumes 0 ≡ accept_S5; ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opb_post_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; if (accept_S5 == 1) accept_S6_tmp = 1; else accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S4 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S6; */ void opb(void) { opb_pre_func(); status = 1; opb_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opc_pre_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opc; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opc_post_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opc; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires \false; behavior Buchi_behavior_out_0: ensures 0 ≡ accept_S2; behavior Buchi_behavior_out_1: ensures 0 ≡ accept_S3; behavior Buchi_behavior_out_2: ensures 0 ≡ accept_S4; behavior Buchi_behavior_out_3: ensures 0 ≡ accept_S5; behavior Buchi_behavior_out_4: ensures 0 ≡ accept_S6; behavior Buchi_behavior_out_5: ensures 0 ≡ accept_all; behavior Buchi_behavior_out_6: ensures 0 ≡ accept_init; */ void opc(void) { opc_pre_func(); rr = 60000; opc_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_init; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_init; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void main_pre_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_init == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S6 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_in: assumes 1 ≡ accept_S6; ensures 1 ≡ accept_all; behavior buch_state_accept_all_out: assumes 0 ≡ accept_S6; ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void main_post_func(int res) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S6 == 1) accept_all_tmp = 1; else accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_init ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all; behavior aorai_acceptance: ensures 1 ≡ accept_S2 ∨ 1 ≡ accept_S3 ∨ 1 ≡ accept_S4 ∨ 1 ≡ accept_S5 ∨ 1 ≡ accept_S6 ∨ 1 ≡ accept_all ∨ 1 ≡ accept_init; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_all; */ int main(void) { int __retres; main_pre_func(); if (rr < 5000) goto L; opc(); L4: goto L5; L: opa(); goto L2; opc(); L6: __retres = 1; goto return_label; L3: goto L4; opc(); goto L2; L2: goto L3; L5: opb(); goto L6; return_label: main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/hoare_seq.res.oracle0000666000000000000000000005333113571573400025425 0ustar [kernel] Parsing tests/aorai/hoare_seq.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_hoare_seq0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part17 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_reject_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_reject_in_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_2_in_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part16 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_in_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_reject_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_reject_in_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part18 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part17 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part21 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part20 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part19 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_0_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_reject_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_reject_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_2_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_1_out____ : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part17 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part16 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_0_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_reject_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_f = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int aorai_intermediate_state_1 = 0; */ /*@ ghost int aorai_intermediate_state_2 = 0; */ /*@ ghost int aorai_reject = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_reject; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in: assumes 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_1_out: assumes 0 ≡ aorai_intermediate_state_0; ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_reject; */ void f_pre_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_reject_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_reject_tmp = aorai_reject; if (aorai_intermediate_state == 1) aorai_reject_tmp = 1; else aorai_reject_tmp = 0; aorai_intermediate_state_2_tmp = 0; if (aorai_intermediate_state_0 == 1) aorai_intermediate_state_1_tmp = 1; else aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_reject = aorai_reject_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_1 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_reject; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in: assumes 1 ≡ aorai_intermediate_state_1; ensures 1 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_2_out: assumes 0 ≡ aorai_intermediate_state_1; ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes 1 ≡ aorai_reject; ensures 1 ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes 0 ≡ aorai_reject; ensures 0 ≡ aorai_reject; */ void f_post_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_reject_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_reject_tmp = aorai_reject; if (aorai_reject == 1) aorai_reject_tmp = 1; else aorai_reject_tmp = 0; if (aorai_intermediate_state_1 == 1) aorai_intermediate_state_2_tmp = 1; else aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_reject = aorai_reject_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_0 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_reject; requires 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_2; behavior Buchi_behavior_in_0: assumes 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ aorai_intermediate_state_2; behavior Buchi_behavior_in_1: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_reject; behavior Buchi_behavior_out_0: ensures 0 ≡ S0; behavior Buchi_behavior_out_1: ensures 0 ≡ Sf; behavior Buchi_behavior_out_2: ensures 0 ≡ aorai_intermediate_state; behavior Buchi_behavior_out_3: ensures 0 ≡ aorai_intermediate_state_0; behavior Buchi_behavior_out_4: ensures 0 ≡ aorai_intermediate_state_1; behavior Buchi_behavior_out_5: assumes 0 ≡ aorai_intermediate_state_0; ensures 0 ≡ aorai_intermediate_state_2; behavior Buchi_behavior_out_6: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_reject; */ void f(void) { f_pre_func(); f_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_reject; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0 ∧ c > 0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0 ∨ ¬(c > 0); ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ S0 ∧ c ≤ 0; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ S0 ∨ ¬(c ≤ 0); ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_reject_out: ensures 0 ≡ aorai_reject; */ void main_pre_func(int c) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_reject_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_reject_tmp = aorai_reject; aorai_reject_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; if (S0 == 1) if (c <= 0) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; else aorai_intermediate_state_0_tmp = 0; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_reject = aorai_reject_tmp; return; } /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0 ∨ 1 ≡ aorai_intermediate_state_2) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1; requires 1 ≡ aorai_intermediate_state_2 ⇒ res ≡ 0 ∨ res ≢ 0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_reject; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes (1 ≡ aorai_intermediate_state_2 ∧ res ≡ 0) ∨ 1 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes (0 ≡ aorai_intermediate_state_2 ∨ ¬(res ≡ 0)) ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_reject_in: assumes 1 ≡ aorai_reject ∨ (1 ≡ aorai_intermediate_state_2 ∧ res ≢ 0) ∨ 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ aorai_reject; behavior buch_state_aorai_reject_out: assumes 0 ≡ aorai_reject ∧ (0 ≡ aorai_intermediate_state_2 ∨ res ≡ 0) ∧ 0 ≡ aorai_intermediate_state_0; ensures 0 ≡ aorai_reject; */ void main_post_func(int res) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_reject_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_reject_tmp = aorai_reject; if (aorai_intermediate_state_0 == 1) aorai_reject_tmp = 1; else if (aorai_intermediate_state_2 == 1) { if (res != 0) aorai_reject_tmp = 1; else goto _LAND; } else { _LAND: ; if (aorai_reject == 1) aorai_reject_tmp = 1; else aorai_reject_tmp = 0; } aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) Sf_tmp = 1; else if (aorai_intermediate_state_2 == 1) if (res == 0) Sf_tmp = 1; else Sf_tmp = 0; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_reject = aorai_reject_tmp; return; } /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_reject; requires 1 ≡ S0 ⇒ c > 0 ∨ c ≤ 0; ensures 1 ≡ Sf; behavior bhv: assumes c > 0; ensures \result ≡ 0; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 1 ≡ Sf ∨ 0 ≡ Sf; ensures 1 ≡ aorai_reject ∨ 0 ≡ aorai_reject; ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2; ensures 1 ≡ Sf ∨ 1 ≡ aorai_reject; */ int main(int c) { int __retres; main_pre_func(c); if (c <= 0) f(); __retres = 0; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/loop_bts1050.res.oracle0000666000000000000000000007661413571573400025617 0ustar [kernel] Parsing tests/aorai/loop_bts1050.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_loop_bts10500.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_2_in_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part18 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part17 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part16 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_in_1_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_in_1_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_out_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_g_post_func_post_2 : Valid [wp] [Qed] Goal typed_g_post_func_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_0_in_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_g_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_g_pre_func_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_in_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part17 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_0_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_3_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_2_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_1_out____ : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_3_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int aorai_intermediate_state_1 = 0; */ /*@ ghost int aorai_intermediate_state_2 = 0; */ /*@ ghost int aorai_intermediate_state_3 = 0; */ /*@ ghost int aorai_counter = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_counter, aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in_0: assumes 1 ≡ aorai_intermediate_state_0 ∧ aorai_counter < 5; ensures 1 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ \old(aorai_counter)+1; behavior buch_state_aorai_intermediate_state_1_in_1: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ 1; behavior buch_state_aorai_intermediate_state_1_out: assumes (0 ≡ aorai_intermediate_state_0 ∨ ¬(aorai_counter < 5)) ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ \old(aorai_counter); behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void f_pre_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; if (aorai_intermediate_state_0 == 1) if (aorai_counter < 5) aorai_counter ++; if (aorai_intermediate_state == 1) aorai_counter = 1; if (aorai_intermediate_state == 1) aorai_intermediate_state_1_tmp = 1; else if (aorai_intermediate_state_0 == 1) if (aorai_counter < 5) aorai_intermediate_state_1_tmp = 1; else aorai_intermediate_state_1_tmp = 0; else aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_1 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in: assumes 1 ≡ aorai_intermediate_state_1; ensures 1 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_2_out: assumes 0 ≡ aorai_intermediate_state_1; ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void f_post_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; if (aorai_intermediate_state_1 == 1) aorai_intermediate_state_2_tmp = 1; else aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; requires 1 ≡ aorai_intermediate_state_0 ⇒ aorai_counter < 5; requires 0 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_2; ensures \at(1 ≡ aorai_intermediate_state_0,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ \at(aorai_counter,Pre)+1; ensures \at(1 ≡ aorai_intermediate_state,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ 1; */ void f(void) { f_pre_func(); f_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_in: assumes 1 ≡ aorai_intermediate_state_2; ensures 1 ≡ aorai_intermediate_state_3; behavior buch_state_aorai_intermediate_state_3_out: assumes 0 ≡ aorai_intermediate_state_2; ensures 0 ≡ aorai_intermediate_state_3; */ void g_pre_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; if (aorai_intermediate_state_2 == 1) aorai_intermediate_state_3_tmp = 1; else aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_3 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ aorai_intermediate_state_3; ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void g_post_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; if (aorai_intermediate_state_3 == 1) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_2 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; */ void g(void) { g_pre_func(); g_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0; ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void main_pre_func(int c) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ aorai_intermediate_state_0 ∨ 1 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void main_post_func(int res) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) Sf_tmp = 1; else if (aorai_intermediate_state_0 == 1) Sf_tmp = 1; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ Sf; ensures \at(1 ≡ S0,Pre) ∧ 1 ≡ Sf ⇒ (1 ≤ aorai_counter ≤ 5) ∨ aorai_counter ≡ \at(aorai_counter,Pre)+0; */ int main(int c) { int aorai_Loop_Init_37; int __retres; main_pre_func(c); if (c < 0) c = 0; if (c > 0) c = 5; /*@ ghost aorai_Loop_Init_37 = 1; */ aorai_loop_37: /*@ loop invariant Aorai: 0 ≡ S0; loop invariant Aorai: 0 ≡ Sf; loop invariant Aorai: 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; loop invariant Aorai: 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: 0 ≡ aorai_intermediate_state_1; loop invariant Aorai: 0 ≡ aorai_intermediate_state_2; loop invariant Aorai: 0 ≡ aorai_intermediate_state_3; loop invariant Aorai: 1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0; loop invariant Aorai: aorai_Loop_Init_37 ≢ 0 ⇒ \at(1 ≡ S0,Pre) ⇒ 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: aorai_Loop_Init_37 ≡ 0 ⇒ 0 ≡ aorai_intermediate_state; loop invariant Aorai: \at(1 ≡ aorai_intermediate_state,aorai_loop_37) ∧ 1 ≡ aorai_intermediate_state_0 ⇒ 1 ≤ aorai_counter ≤ 5; */ while (1) { if (! c) goto while_0_break; /*@ ghost aorai_Loop_Init_37 = 0; */ f(); g(); c --; } while_0_break: ; __retres = 0; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/not_prm.res.oracle0000666000000000000000000000663513571573400025142 0ustar [kernel] Parsing tests/aorai/not_prm.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_not_prm0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Sf_in_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_Sf_in_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_S0_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_f = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_f; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ S0 ∧ x ≥ 4; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ S0 ∨ ¬(x ≥ 4); ensures 0 ≡ Sf; */ void f_pre_func(int x) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; if (S0 == 1) if (x >= 4) Sf_tmp = 1; else Sf_tmp = 0; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; return; } /*@ requires 1 ≡ Sf ∧ 0 ≡ S0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ Sf; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ Sf; ensures 0 ≡ Sf; */ void f_post_func(int res) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; if (Sf == 1) Sf_tmp = 1; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; return; } /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf; requires 1 ≡ S0 ⇒ x ≥ 4; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 0 ≡ S0; ensures 1 ≡ Sf; */ int f(int x) { f_pre_func(x); f_post_func(x); return x; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/other.res.oracle0000666000000000000000000006267613571573400024614 0ustar [kernel] Parsing tests/aorai/other.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_other0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_init_in_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part17 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_last_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_last_in_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_step1_out_post : Valid [wp] [Alt-Ergo] Goal typed_f_post_func_buch_state_step1_in_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_init_in_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part16 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_step1_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_last_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_last_in_post : Valid [wp] [Alt-Ergo] Goal typed_f_pre_func_buch_state_step1_in_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_g_post_func_post_2 : Valid [wp] [Qed] Goal typed_g_post_func_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_init_in_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part17 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_last_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_last_in_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_step1_out_post : Valid [wp] [Alt-Ergo] Goal typed_g_post_func_buch_state_step1_in_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_g_pre_func_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_init_in_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part16 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_step1_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_last_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_last_in_post : Valid [wp] [Alt-Ergo] Goal typed_g_pre_func_buch_state_step1_in_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_init_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part17 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_last_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_last_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_step1_out_post : Valid [wp] [Alt-Ergo] Goal typed_main_post_func_buch_state_step1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_init_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_step1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_last_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int x = 0; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int init = 1; */ /*@ ghost int last = 0; */ /*@ ghost int step1 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; */ void f_pre_func(void) { /*@ ghost int init_tmp; */ /*@ ghost int last_tmp; */ /*@ ghost int step1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } /*@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; */ void f_post_func(void) { /*@ ghost int init_tmp; */ /*@ ghost int last_tmp; */ /*@ ghost int step1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } /*@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 3; requires 1 ≡ step1 ∨ 0 ≡ step1; requires 1 ≡ last ∨ 0 ≡ last; requires 1 ≡ init ∨ 0 ≡ init; behavior Buchi_behavior_in_0: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures (1 ≡ init ⇒ x ≢ 3 ∨ x ≡ 4) ∧ (1 ≡ last ⇒ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4) ∧ (1 ≡ step1 ⇒ x ≡ 3 ∨ x ≢ 4); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ init ∨ 1 ≡ step1; behavior Buchi_behavior_in_1: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures (1 ≡ init ⇒ x ≢ 3 ∨ x ≡ 4) ∧ (1 ≡ last ⇒ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4) ∧ (1 ≡ step1 ⇒ x ≡ 3 ∨ x ≢ 4); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; behavior Buchi_behavior_in_2: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures (1 ≡ init ⇒ x ≢ 3 ∨ x ≡ 4) ∧ (1 ≡ last ⇒ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4) ∧ (1 ≡ step1 ⇒ x ≡ 3 ∨ x ≢ 4); ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ last ∨ 1 ≡ step1; behavior Buchi_behavior_out_0: assumes (0 ≡ last ∨ (x ≡ 3 ∧ x ≢ 4)) ∧ (0 ≡ step1 ∨ x ≢ 4) ∧ (0 ≡ init ∨ x ≡ 3); ensures 0 ≡ init; behavior Buchi_behavior_out_1: assumes 0 ≡ step1 ∧ (0 ≡ init ∨ x ≢ 3) ∧ (0 ≡ last ∨ (x ≢ 3 ∧ x ≡ 4)); ensures 0 ≡ last; behavior Buchi_behavior_out_2: assumes 0 ≡ last ∧ 0 ≡ init ∧ 0 ≡ step1; ensures 0 ≡ step1; */ void f(void) { f_pre_func(); x = 3; f_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; */ void g_pre_func(void) { /*@ ghost int init_tmp; */ /*@ ghost int last_tmp; */ /*@ ghost int step1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } /*@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; */ void g_post_func(void) { /*@ ghost int init_tmp; */ /*@ ghost int last_tmp; */ /*@ ghost int step1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } /*@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 3; requires 1 ≡ step1 ∨ 0 ≡ step1; requires 1 ≡ last ∨ 0 ≡ last; requires 1 ≡ init ∨ 0 ≡ init; behavior Buchi_behavior_in_0: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures (1 ≡ init ⇒ x ≢ 3 ∨ x ≡ 4) ∧ (1 ≡ last ⇒ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4) ∧ (1 ≡ step1 ⇒ x ≡ 3 ∨ x ≢ 4); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ init ∨ 1 ≡ step1; behavior Buchi_behavior_in_1: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures (1 ≡ init ⇒ x ≢ 3 ∨ x ≡ 4) ∧ (1 ≡ last ⇒ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4) ∧ (1 ≡ step1 ⇒ x ≡ 3 ∨ x ≢ 4); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; behavior Buchi_behavior_in_2: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures (1 ≡ init ⇒ x ≢ 3 ∨ x ≡ 4) ∧ (1 ≡ last ⇒ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4) ∧ (1 ≡ step1 ⇒ x ≡ 3 ∨ x ≢ 4); ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures 1 ≡ last ∨ 1 ≡ step1; behavior Buchi_behavior_out_0: assumes (0 ≡ last ∨ (x ≡ 3 ∧ x ≢ 4)) ∧ (0 ≡ step1 ∨ x ≢ 4) ∧ (0 ≡ init ∨ x ≡ 3); ensures 0 ≡ init; behavior Buchi_behavior_out_1: assumes 0 ≡ step1 ∧ (0 ≡ init ∨ x ≢ 3) ∧ (0 ≡ last ∨ (x ≢ 3 ∧ x ≡ 4)); ensures 0 ≡ last; behavior Buchi_behavior_out_2: assumes 0 ≡ last ∧ 0 ≡ init ∧ 0 ≡ step1; ensures 0 ≡ step1; */ void g(void) { g_pre_func(); x = 4; g_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes 1 ≡ init ∧ x ≢ 3; ensures 1 ≡ init; behavior buch_state_init_out: assumes 0 ≡ init ∨ ¬(x ≢ 3); ensures 0 ≡ init; behavior buch_state_last_out: ensures 0 ≡ last; behavior buch_state_step1_out: ensures 0 ≡ step1; */ void main_pre_func(void) { /*@ ghost int init_tmp; */ /*@ ghost int last_tmp; */ /*@ ghost int step1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; init_tmp = init; last_tmp = last; step1_tmp = step1; step1_tmp = 0; last_tmp = 0; if (init == 1) if (x != 3) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } /*@ requires 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; requires 1 ≡ last ⇒ x ≡ 4 ∨ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, init, last, step1; behavior buch_state_init_in: assumes (1 ≡ last ∧ x ≡ 4) ∨ (1 ≡ init ∧ x ≢ 3); ensures 1 ≡ init; behavior buch_state_init_out: assumes (0 ≡ last ∨ ¬(x ≡ 4)) ∧ (0 ≡ init ∨ ¬(x ≢ 3)); ensures 0 ≡ init; behavior buch_state_last_in: assumes (1 ≡ step1 ∧ x ≡ 4) ∨ (1 ≡ last ∧ x ≢ 4 ∧ x ≢ 3); ensures 1 ≡ last; behavior buch_state_last_out: assumes (0 ≡ step1 ∨ ¬(x ≡ 4)) ∧ (0 ≡ last ∨ ¬(x ≢ 4 ∧ x ≢ 3)); ensures 0 ≡ last; behavior buch_state_step1_in: assumes (1 ≡ step1 ∧ x ≢ 4) ∨ (1 ≡ last ∧ x ≡ 3) ∨ (1 ≡ init ∧ x ≡ 3); ensures 1 ≡ step1; behavior buch_state_step1_out: assumes (0 ≡ step1 ∨ ¬(x ≢ 4)) ∧ (0 ≡ last ∨ ¬(x ≡ 3)) ∧ (0 ≡ init ∨ ¬(x ≡ 3)); ensures 0 ≡ step1; */ void main_post_func(int res) { /*@ ghost int init_tmp; */ /*@ ghost int last_tmp; */ /*@ ghost int step1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; init_tmp = init; last_tmp = last; step1_tmp = step1; if (init == 1) { if (x == 3) step1_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (last == 1) { if (x == 3) step1_tmp = 1; else goto _LAND; } else { _LAND: ; if (step1 == 1) if (x != 4) step1_tmp = 1; else step1_tmp = 0; else step1_tmp = 0; } } if (last == 1) { if (x != 4) { if (x != 3) last_tmp = 1; else goto _LAND_1; } else goto _LAND_1; } else { _LAND_1: ; if (step1 == 1) if (x == 4) last_tmp = 1; else last_tmp = 0; else last_tmp = 0; } if (init == 1) { if (x != 3) init_tmp = 1; else goto _LAND_2; } else { _LAND_2: ; if (last == 1) if (x == 4) init_tmp = 1; else init_tmp = 0; else init_tmp = 0; } init = init_tmp; last = last_tmp; step1 = step1_tmp; return; } /*@ requires 1 ≡ init ∧ 0 ≡ last ∧ 0 ≡ step1; requires 1 ≡ init ⇒ x ≢ 3; behavior aorai_acceptance: ensures 1 ≡ last; behavior Buchi_property_behavior: ensures (1 ≡ init ⇒ x ≢ 3 ∨ x ≡ 4) ∧ (1 ≡ last ⇒ (x ≢ 4 ∧ x ≢ 3) ∨ x ≡ 4) ∧ (1 ≡ step1 ⇒ x ≡ 3 ∨ x ≢ 4); ensures 1 ≡ init ∨ 0 ≡ init; ensures 1 ≡ last ∨ 0 ≡ last; ensures 1 ≡ step1 ∨ 0 ≡ step1; ensures \true; ensures 1 ≡ init ∨ 1 ≡ last ∨ 1 ≡ step1; */ int main(void) { main_pre_func(); f(); g(); f(); g(); main_post_func(x); return x; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/seq.res.oracle0000666000000000000000000007610213571573400024250 0ustar [kernel] Parsing tests/aorai/seq.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_seq0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_0_in_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_in_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_g_post_func_post_2 : Valid [wp] [Qed] Goal typed_g_post_func_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_2_in_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_g_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_g_pre_func_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part18 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part17 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part16 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part19 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_in_1_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_in_1_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_in_2_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_in_2_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_out_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part17 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_0_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_3_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_2_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_1_out____ : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_3_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int aorai_intermediate_state_1 = 0; */ /*@ ghost int aorai_intermediate_state_2 = 0; */ /*@ ghost int aorai_intermediate_state_3 = 0; */ /*@ ghost int aorai_counter = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_1_out: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void f_pre_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; if (aorai_intermediate_state == 1) aorai_intermediate_state_1_tmp = 1; else aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_1 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ aorai_intermediate_state_1; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ aorai_intermediate_state_1; ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void f_post_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; if (aorai_intermediate_state_1 == 1) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; */ void f(void) { f_pre_func(); f_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_counter, aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_in_0: assumes 1 ≡ aorai_intermediate_state_2 ∧ aorai_counter < 2; ensures 1 ≡ aorai_intermediate_state_3; ensures aorai_counter ≡ \old(aorai_counter)+1; behavior buch_state_aorai_intermediate_state_3_in_1: assumes 1 ≡ aorai_intermediate_state_0; ensures 1 ≡ aorai_intermediate_state_3; ensures aorai_counter ≡ 1; behavior buch_state_aorai_intermediate_state_3_in_2: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_3; ensures aorai_counter ≡ 1; behavior buch_state_aorai_intermediate_state_3_out: assumes (0 ≡ aorai_intermediate_state_2 ∨ ¬(aorai_counter < 2)) ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_intermediate_state_3; ensures aorai_counter ≡ \old(aorai_counter); */ void g_pre_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; if (aorai_intermediate_state_2 == 1) if (aorai_counter < 2) aorai_counter ++; if (aorai_intermediate_state_0 == 1) aorai_counter = 1; if (aorai_intermediate_state == 1) aorai_counter = 1; if (aorai_intermediate_state == 1) aorai_intermediate_state_3_tmp = 1; else if (aorai_intermediate_state_0 == 1) aorai_intermediate_state_3_tmp = 1; else if (aorai_intermediate_state_2 == 1) if (aorai_counter < 2) aorai_intermediate_state_3_tmp = 1; else aorai_intermediate_state_3_tmp = 0; else aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_3 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in: assumes 1 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_2_out: assumes 0 ≡ aorai_intermediate_state_3; ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void g_post_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; if (aorai_intermediate_state_3 == 1) aorai_intermediate_state_2_tmp = 1; else aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0 ∨ 1 ≡ aorai_intermediate_state_2) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; requires 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter < 2; requires 0 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state_2; requires 0 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state_0; requires 0 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_2; requires 1 ≡ aorai_intermediate_state_2 ∨ 0 ≡ aorai_intermediate_state_2; requires 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_2; ensures \at(1 ≡ aorai_intermediate_state_2,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ \at(aorai_counter,Pre)+1; ensures \at(1 ≡ aorai_intermediate_state_0,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ 1; ensures \at(1 ≡ aorai_intermediate_state,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ 1; */ void g(void) { g_pre_func(); g_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0; ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void main_pre_func(int c) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_2 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; requires 1 ≡ aorai_intermediate_state_2 ⇒ 1 ≤ aorai_counter; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ aorai_intermediate_state_2 ∧ 1 ≤ aorai_counter; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ aorai_intermediate_state_2 ∨ ¬(1 ≤ aorai_counter); ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void main_post_func(int res) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state_2 == 1) if (1 <= aorai_counter) Sf_tmp = 1; else Sf_tmp = 0; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 1 ≡ Sf ⇒ 1 ≤ aorai_counter; ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ Sf; ensures \at(1 ≡ S0,Pre) ∧ 1 ≡ Sf ⇒ 1 ≤ aorai_counter ≤ 2; */ int main(int c) { int __retres; main_pre_func(c); if (c) f(); g(); if (c) g(); __retres = 0; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/seq_loop.res.oracle0000666000000000000000000010003513571573400025272 0ustar [kernel] Parsing tests/aorai/seq_loop.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_seq_loop0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_f_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_post_func_post_2 : Valid [wp] [Qed] Goal typed_f_post_func_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_f_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_2_in_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_f_post_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_f_pre_func_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_post : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part18 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part17 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part16 : Valid [wp] [Qed] Goal typed_f_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_in_1_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_in_1_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_out_post_2 : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_f_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_g_post_func_post_2 : Valid [wp] [Qed] Goal typed_g_post_func_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_g_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_g_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_0_in_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_g_post_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_g_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_g_pre_func_post_2 : Valid [wp] [Qed] Goal typed_g_pre_func_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_in_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_g_pre_func_buch_state_aorai_intermediate_state_3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part17 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_0_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_3_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_2_out____ : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_1_out____ : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_3_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_f = 2, op_g = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ghost int aorai_intermediate_state_0 = 0; */ /*@ ghost int aorai_intermediate_state_1 = 0; */ /*@ ghost int aorai_intermediate_state_2 = 0; */ /*@ ghost int aorai_intermediate_state_3 = 0; */ /*@ ghost int aorai_counter = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_f; assigns aorai_counter, aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_in_0: assumes 1 ≡ aorai_intermediate_state_0 ∧ aorai_counter < 5; ensures 1 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ \old(aorai_counter)+1; behavior buch_state_aorai_intermediate_state_1_in_1: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ 1; behavior buch_state_aorai_intermediate_state_1_out: assumes (0 ≡ aorai_intermediate_state_0 ∨ ¬(aorai_counter < 5)) ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ aorai_intermediate_state_1; ensures aorai_counter ≡ \old(aorai_counter); behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void f_pre_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; if (aorai_intermediate_state_0 == 1) if (aorai_counter < 5) aorai_counter ++; if (aorai_intermediate_state == 1) aorai_counter = 1; if (aorai_intermediate_state == 1) aorai_intermediate_state_1_tmp = 1; else if (aorai_intermediate_state_0 == 1) if (aorai_counter < 5) aorai_intermediate_state_1_tmp = 1; else aorai_intermediate_state_1_tmp = 0; else aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_1 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_f; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_in: assumes 1 ≡ aorai_intermediate_state_1; ensures 1 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_2_out: assumes 0 ≡ aorai_intermediate_state_1; ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void f_post_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_f; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; if (aorai_intermediate_state_1 == 1) aorai_intermediate_state_2_tmp = 1; else aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; requires 1 ≡ aorai_intermediate_state_0 ⇒ aorai_counter < 5; requires 0 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; requires 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_2; ensures \at(1 ≡ aorai_intermediate_state_0,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ \at(aorai_counter,Pre)+1; ensures \at(1 ≡ aorai_intermediate_state,Pre) ∧ 1 ≡ aorai_intermediate_state_2 ⇒ aorai_counter ≡ 1; */ void f(void) { f_pre_func(); f_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_in: assumes 1 ≡ aorai_intermediate_state_2; ensures 1 ≡ aorai_intermediate_state_3; behavior buch_state_aorai_intermediate_state_3_out: assumes 0 ≡ aorai_intermediate_state_2; ensures 0 ≡ aorai_intermediate_state_3; */ void g_pre_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; if (aorai_intermediate_state_2 == 1) aorai_intermediate_state_3_tmp = 1; else aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_3 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_g; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_in: assumes 1 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_0_out: assumes 0 ≡ aorai_intermediate_state_3; ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void g_post_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_g; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; if (aorai_intermediate_state_3 == 1) aorai_intermediate_state_0_tmp = 1; else aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state_2 ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_3; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ aorai_intermediate_state_0; */ void g(void) { g_pre_func(); g_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0; ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void main_pre_func(int c) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires (1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0) ∧ 0 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ aorai_intermediate_state_0 ∨ 1 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state; ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_0_out: ensures 0 ≡ aorai_intermediate_state_0; behavior buch_state_aorai_intermediate_state_1_out: ensures 0 ≡ aorai_intermediate_state_1; behavior buch_state_aorai_intermediate_state_2_out: ensures 0 ≡ aorai_intermediate_state_2; behavior buch_state_aorai_intermediate_state_3_out: ensures 0 ≡ aorai_intermediate_state_3; */ void main_post_func(int res) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ /*@ ghost int aorai_intermediate_state_0_tmp; */ /*@ ghost int aorai_intermediate_state_1_tmp; */ /*@ ghost int aorai_intermediate_state_2_tmp; */ /*@ ghost int aorai_intermediate_state_3_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_0_tmp = aorai_intermediate_state_0; aorai_intermediate_state_1_tmp = aorai_intermediate_state_1; aorai_intermediate_state_2_tmp = aorai_intermediate_state_2; aorai_intermediate_state_3_tmp = aorai_intermediate_state_3; aorai_intermediate_state_3_tmp = 0; aorai_intermediate_state_2_tmp = 0; aorai_intermediate_state_1_tmp = 0; aorai_intermediate_state_0_tmp = 0; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) Sf_tmp = 1; else if (aorai_intermediate_state_0 == 1) Sf_tmp = 1; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; aorai_intermediate_state_0 = aorai_intermediate_state_0_tmp; aorai_intermediate_state_1 = aorai_intermediate_state_1_tmp; aorai_intermediate_state_2 = aorai_intermediate_state_2_tmp; aorai_intermediate_state_3 = aorai_intermediate_state_3_tmp; return; } /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3, aorai_counter; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state ∧ 0 ≡ aorai_intermediate_state_0 ∧ 0 ≡ aorai_intermediate_state_1 ∧ 0 ≡ aorai_intermediate_state_2 ∧ 0 ≡ aorai_intermediate_state_3; ensures 1 ≡ Sf; ensures \at(1 ≡ S0,Pre) ∧ 1 ≡ Sf ⇒ (1 ≤ aorai_counter ≤ 5) ∨ aorai_counter ≡ \at(aorai_counter,Pre)+0; */ int main(int c) { int aorai_Loop_Init_39; int __retres; main_pre_func(c); if (c < 0) c = 0; if (c > 5) c = 5; /*@ assert 0 ≤ c ≤ 5; */ ; /*@ ghost aorai_Loop_Init_39 = 1; */ aorai_loop_39: /*@ loop invariant Aorai: 0 ≡ S0; loop invariant Aorai: 0 ≡ Sf; loop invariant Aorai: 1 ≡ aorai_intermediate_state ∨ 0 ≡ aorai_intermediate_state; loop invariant Aorai: 1 ≡ aorai_intermediate_state_0 ∨ 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: 0 ≡ aorai_intermediate_state_1; loop invariant Aorai: 0 ≡ aorai_intermediate_state_2; loop invariant Aorai: 0 ≡ aorai_intermediate_state_3; loop invariant Aorai: 1 ≡ aorai_intermediate_state ∨ 1 ≡ aorai_intermediate_state_0; loop invariant Aorai: aorai_Loop_Init_39 ≢ 0 ⇒ \at(1 ≡ S0,Pre) ⇒ 0 ≡ aorai_intermediate_state_0; loop invariant Aorai: aorai_Loop_Init_39 ≡ 0 ⇒ 0 ≡ aorai_intermediate_state; loop invariant Aorai: \at(1 ≡ aorai_intermediate_state,aorai_loop_39) ∧ 1 ≡ aorai_intermediate_state_0 ⇒ 1 ≤ aorai_counter ≤ 5; loop assigns c, aorai_Loop_Init_39, aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state, aorai_intermediate_state_0, aorai_intermediate_state_1, aorai_intermediate_state_2, aorai_intermediate_state_3, aorai_counter; loop assigns aorai_Loop_Init_39 \from \nothing; */ while (1) { if (! c) goto while_0_break; /*@ ghost aorai_Loop_Init_39 = 0; */ f(); g(); c --; } while_0_break: ; __retres = 0; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/single_call.res.oracle0000666000000000000000000001143013571573400025725 0ustar [kernel] Parsing tests/aorai/single_call.i (no preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_single_call0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_aorai_intermediate_state_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Sf_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_aorai_intermediate_state_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S0 = 1; */ /*@ ghost int Sf = 0; */ /*@ ghost int aorai_intermediate_state = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_out: ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_in: assumes 1 ≡ S0; ensures 1 ≡ aorai_intermediate_state; behavior buch_state_aorai_intermediate_state_out: assumes 0 ≡ S0; ensures 0 ≡ aorai_intermediate_state; */ void main_pre_func(void) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; if (S0 == 1) aorai_intermediate_state_tmp = 1; else aorai_intermediate_state_tmp = 0; Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; return; } /*@ requires 1 ≡ aorai_intermediate_state ∧ 0 ≡ S0 ∧ 0 ≡ Sf; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S0, Sf, aorai_intermediate_state; behavior buch_state_S0_out: ensures 0 ≡ S0; behavior buch_state_Sf_in: assumes 1 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; behavior buch_state_Sf_out: assumes 0 ≡ aorai_intermediate_state; ensures 0 ≡ Sf; behavior buch_state_aorai_intermediate_state_out: ensures 0 ≡ aorai_intermediate_state; */ void main_post_func(int res) { /*@ ghost int S0_tmp; */ /*@ ghost int Sf_tmp; */ /*@ ghost int aorai_intermediate_state_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S0_tmp = S0; Sf_tmp = Sf; aorai_intermediate_state_tmp = aorai_intermediate_state; aorai_intermediate_state_tmp = 0; if (aorai_intermediate_state == 1) Sf_tmp = 1; else Sf_tmp = 0; S0_tmp = 0; S0 = S0_tmp; Sf = Sf_tmp; aorai_intermediate_state = aorai_intermediate_state_tmp; return; } /*@ requires 1 ≡ S0 ∧ 0 ≡ Sf ∧ 0 ≡ aorai_intermediate_state; behavior aorai_acceptance: ensures 1 ≡ Sf; behavior Buchi_property_behavior: ensures 0 ≡ S0 ∧ 0 ≡ aorai_intermediate_state; ensures 1 ≡ Sf; */ int main(void) { int __retres; main_pre_func(); __retres = 0; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_acces_params.res.oracle0000666000000000000000000004412513571573400027140 0ustar [kernel] Parsing tests/aorai/test_acces_params.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_acces_params0.i (no preprocessing) /tmp/aorai_test_acces_params0.i:4:[wp] warning: Global invariant not handled yet ('inv' ignored) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_mainst_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_SF_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_SF_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_mainst_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_SF_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_post_func_post_2 : Valid [wp] [Qed] Goal typed_opa_post_func_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S3_in_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_mainst_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_SF_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opa_pre_func_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S2_in_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_mainst_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_SF_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S4_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_opb_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_post_func_post_2 : Valid [wp] [Qed] Goal typed_opb_post_func_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_mainst_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_SF_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_SF_in_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opb_pre_func_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S4_in_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_mainst_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_SF_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_main = 2, op_opa = 1, op_opb = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 5000; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int S2 = 0; */ /*@ ghost int S3 = 0; */ /*@ ghost int S4 = 0; */ /*@ ghost int SF = 0; */ /*@ ghost int mainst = 1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S1 ∧ i ≥ 0; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S1 ∨ ¬(i ≥ 0); ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_out: ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; */ void opa_pre_func(int i, int j) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int SF_tmp; */ /*@ ghost int mainst_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; SF_tmp = 0; S4_tmp = 0; S3_tmp = 0; if (S1 == 1) if (i >= 0) S2_tmp = 1; else S2_tmp = 0; else S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } /*@ requires 1 ≡ S2 ∧ 0 ≡ S1 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ SF ∧ 0 ≡ mainst; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_in: assumes 1 ≡ S2; ensures 1 ≡ S3; behavior buch_state_S3_out: assumes 0 ≡ S2; ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_out: ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; */ void opa_post_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int SF_tmp; */ /*@ ghost int mainst_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; SF_tmp = 0; S4_tmp = 0; if (S2 == 1) S3_tmp = 1; else S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ SF ∧ 0 ≡ mainst; requires 1 ≡ S1 ⇒ i ≥ 0; requires rr < 5000; behavior j: ensures rr < 5001; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S4 ∧ 0 ≡ SF ∧ 0 ≡ mainst; ensures 1 ≡ S3; */ void opa(int i, int j) { opa_pre_func(i,j); rr = i + j; opa_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_in: assumes 1 ≡ S3; ensures 1 ≡ S4; behavior buch_state_S4_out: assumes 0 ≡ S3; ensures 0 ≡ S4; behavior buch_state_SF_out: ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; */ void opb_pre_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int SF_tmp; */ /*@ ghost int mainst_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; SF_tmp = 0; if (S3 == 1) S4_tmp = 1; else S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } /*@ requires 1 ≡ S4 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ SF ∧ 0 ≡ mainst; requires 1 ≡ S4 ⇒ res > 0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_in: assumes 1 ≡ S4 ∧ res > 0; ensures 1 ≡ SF; behavior buch_state_SF_out: assumes 0 ≡ S4 ∨ ¬(res > 0); ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; */ void opb_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int SF_tmp; */ /*@ ghost int mainst_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; if (S4 == 1) if (res > 0) SF_tmp = 1; else SF_tmp = 0; else SF_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } /*@ requires 1 ≡ S3 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S4 ∧ 0 ≡ SF ∧ 0 ≡ mainst; behavior Buchi_property_behavior: ensures 1 ≡ SF ⇒ \result > 0; ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ mainst; ensures 1 ≡ SF; */ int opb(void) { int __retres; opb_pre_func(); status = 1; __retres = status * 3; opb_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_in: assumes 1 ≡ mainst; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ mainst; ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_out: ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; */ void main_pre_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int SF_tmp; */ /*@ ghost int mainst_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; SF_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; if (mainst == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } /*@ requires 1 ≡ SF ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ mainst; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, SF, mainst; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_SF_in: assumes 1 ≡ SF; ensures 1 ≡ SF; behavior buch_state_SF_out: assumes 0 ≡ SF; ensures 0 ≡ SF; behavior buch_state_mainst_out: ensures 0 ≡ mainst; */ void main_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int SF_tmp; */ /*@ ghost int mainst_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; SF_tmp = SF; mainst_tmp = mainst; mainst_tmp = 0; if (SF == 1) SF_tmp = 1; else SF_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; SF = SF_tmp; mainst = mainst_tmp; return; } /*@ requires 1 ≡ mainst ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ SF; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ mainst; ensures 1 ≡ SF; */ int main(void) { int __retres; main_pre_func(); if (rr < 5000) opa(rr,300); rr = opb(); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_acces_params2.res.oracle0000666000000000000000000006335413571573400027227 0ustar [kernel] Parsing tests/aorai/test_acces_params2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_acces_params20.i (no preprocessing) /tmp/aorai_test_acces_params20.i:3:[wp] warning: Global invariant not handled yet ('inv' ignored) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S6_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S5_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S7_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S7_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S2_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S6_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S5_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S7_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_post_func_post_2 : Valid [wp] [Qed] Goal typed_opa_post_func_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part17 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S4_in_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S7_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S6_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_S5_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_opa_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opa_pre_func_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part16 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S5_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S3_in_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S7_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_S6_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_post_func_post_2 : Valid [wp] [Qed] Goal typed_opb_post_func_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S6_in_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S5_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S7_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_S6_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opb_pre_func_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S6_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S5_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S5_in_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_S7_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opc_post_func_post_2 : Valid [wp] [Qed] Goal typed_opc_post_func_post : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_S7_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_S6_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_S5_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_S4_out_post : Valid [wp] Computing [200 goals...] [wp] [Qed] Goal typed_opc_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opc_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opc_pre_func_post : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_S4_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_S3_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_S7_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_S6_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_S5_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_main = 3, op_opa = 2, op_opb = 1, op_opc = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 5000; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 1; */ /*@ ghost int S2 = 0; */ /*@ ghost int S3 = 0; */ /*@ ghost int S4 = 0; */ /*@ ghost int S5 = 0; */ /*@ ghost int S6 = 0; */ /*@ ghost int S7 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_in: assumes 1 ≡ S2 ∧ r ≥ 0; ensures 1 ≡ S3; behavior buch_state_S3_out: assumes 0 ≡ S2 ∨ ¬(r ≥ 0); ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; */ void opa_pre_func(int r) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int S5_tmp; */ /*@ ghost int S6_tmp; */ /*@ ghost int S7_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; if (S2 == 1) if (r >= 0) S3_tmp = 1; else S3_tmp = 0; else S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } /*@ requires 1 ≡ S3 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; requires 1 ≡ S3 ⇒ res ≤ 5000; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_in: assumes 1 ≡ S3 ∧ res ≤ 5000; ensures 1 ≡ S4; behavior buch_state_S4_out: assumes 0 ≡ S3 ∨ ¬(res ≤ 5000); ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; */ void opa_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int S5_tmp; */ /*@ ghost int S6_tmp; */ /*@ ghost int S7_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; if (S3 == 1) if (res <= 5000) S4_tmp = 1; else S4_tmp = 0; else S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } /*@ requires 1 ≡ S2 ∧ 0 ≡ S1 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; requires 1 ≡ S2 ⇒ r ≥ 0; requires r < 5000; behavior j: ensures \result ≡ \old(r)+1; behavior Buchi_property_behavior: ensures 1 ≡ S4 ⇒ \result ≤ 5000; ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; ensures 1 ≡ S4; */ int opa(int r) { int __retres; opa_pre_func(r); __retres = r + 1; opa_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_in: assumes 1 ≡ S4; ensures 1 ≡ S5; behavior buch_state_S5_out: assumes 0 ≡ S4; ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; */ void opb_pre_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int S5_tmp; */ /*@ ghost int S6_tmp; */ /*@ ghost int S7_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; if (S4 == 1) S5_tmp = 1; else S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } /*@ requires 1 ≡ S5 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S6 ∧ 0 ≡ S7; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_in: assumes 1 ≡ S5; ensures 1 ≡ S6; behavior buch_state_S6_out: assumes 0 ≡ S5; ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; */ void opb_post_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int S5_tmp; */ /*@ ghost int S6_tmp; */ /*@ ghost int S7_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; if (S5 == 1) S6_tmp = 1; else S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } /*@ requires 1 ≡ S4 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; requires rr ≥ 1 ∧ rr ≤ 5000; behavior f: ensures rr ≥ 3 ∧ rr ≤ 5000; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S7; ensures 1 ≡ S6; */ void opb(void) { opb_pre_func(); if (rr < 4998) rr += 2; opb_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; */ void opc_pre_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int S5_tmp; */ /*@ ghost int S6_tmp; */ /*@ ghost int S7_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opc; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } /*@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; */ void opc_post_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int S5_tmp; */ /*@ ghost int S6_tmp; */ /*@ ghost int S7_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opc; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } /*@ requires \false; behavior d: ensures rr ≡ 600; behavior Buchi_behavior_out_0: ensures 0 ≡ S1; behavior Buchi_behavior_out_1: ensures 0 ≡ S2; behavior Buchi_behavior_out_2: ensures 0 ≡ S3; behavior Buchi_behavior_out_3: ensures 0 ≡ S4; behavior Buchi_behavior_out_4: ensures 0 ≡ S5; behavior Buchi_behavior_out_5: ensures 0 ≡ S6; behavior Buchi_behavior_out_6: ensures 0 ≡ S7; */ void opc(void) { opc_pre_func(); rr = 600; opc_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S1; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S1; ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_out: ensures 0 ≡ S7; */ void main_pre_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int S5_tmp; */ /*@ ghost int S6_tmp; */ /*@ ghost int S7_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; if (S1 == 1) S2_tmp = 1; else S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } /*@ requires 1 ≡ S6 ∧ 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S7; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, S3, S4, S5, S6, S7; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_S3_out: ensures 0 ≡ S3; behavior buch_state_S4_out: ensures 0 ≡ S4; behavior buch_state_S5_out: ensures 0 ≡ S5; behavior buch_state_S6_out: ensures 0 ≡ S6; behavior buch_state_S7_in: assumes 1 ≡ S6; ensures 1 ≡ S7; behavior buch_state_S7_out: assumes 0 ≡ S6; ensures 0 ≡ S7; */ void main_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int S3_tmp; */ /*@ ghost int S4_tmp; */ /*@ ghost int S5_tmp; */ /*@ ghost int S6_tmp; */ /*@ ghost int S7_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; S3_tmp = S3; S4_tmp = S4; S5_tmp = S5; S6_tmp = S6; S7_tmp = S7; if (S6 == 1) S7_tmp = 1; else S7_tmp = 0; S6_tmp = 0; S5_tmp = 0; S4_tmp = 0; S3_tmp = 0; S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; S3 = S3_tmp; S4 = S4_tmp; S5 = S5_tmp; S6 = S6_tmp; S7 = S7_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S6 ∧ 0 ≡ S7; requires rr ≡ 1; behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ S3 ∧ 0 ≡ S4 ∧ 0 ≡ S5 ∧ 0 ≡ S6; ensures 1 ≡ S7; */ int main(void) { int __retres; main_pre_func(); if (rr < 5000) rr = opa(rr); opb(); goto L6; opc(); L6: __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_boucle.res.oracle0000666000000000000000000003323213571573400025765 0ustar [kernel] Parsing tests/aorai/test_boucle.c (with preprocessing) tests/aorai/test_boucle.c:16:[kernel] warning: Calling undeclared function call_to_an_undefined_function. Old style K&R code? [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_a_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_a_post_func_post_2 : Valid [wp] [Qed] Goal typed_a_post_func_post : Valid [wp] [Qed] Goal typed_a_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_a_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_a_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_a_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_a_pre_func_post_2 : Valid [wp] [Qed] Goal typed_a_pre_func_post : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_a_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_a_pre_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_b_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_b_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_b_post_func_post_2 : Valid [wp] [Qed] Goal typed_b_post_func_post : Valid [wp] [Qed] Goal typed_b_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_b_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_b_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_b_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_b_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_b_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_b_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_b_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_b_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_b_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_b_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_b_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_b_pre_func_post_2 : Valid [wp] [Qed] Goal typed_b_pre_func_post : Valid [wp] [Qed] Goal typed_b_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_b_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_b_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_b_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_b_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_b_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_b_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_b_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_b_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_b_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_a = 2, op_b = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; extern int call_to_an_undefined_function(); /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S1; */ void a_pre_func(void) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_a; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_S2 == 1) accept_S1_tmp = 1; else if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_a; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; */ void a_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_a; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; requires \true; ensures 0 ≤ \result ≤ 1; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures 1 ≡ accept_S1; */ int a(void) { int __retres; a_pre_func(); __retres = 1; a_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_b; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; */ void b_pre_func(void) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_b; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_b; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; */ void b_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_b; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; requires \true; ensures 1 ≤ \result ≤ 2; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures 1 ≡ T0_S2; */ int b(void) { int __retres; b_pre_func(); call_to_an_undefined_function(); __retres = 2; b_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; */ void main_pre_func(void) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; */ void main_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1; requires \true; ensures 0 ≤ \result ≤ 1; behavior aorai_acceptance: ensures 1 ≡ accept_S1; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures 1 ≡ accept_S1; */ int main(void) { int aorai_Loop_Init_26; int x; int tmp_1; main_pre_func(); x = a(); /*@ ghost aorai_Loop_Init_26 = 1; */ aorai_loop_26: /*@ loop invariant i: 0 ≤ x ≤ 11; loop invariant Aorai: 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; loop invariant Aorai: 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; loop invariant Aorai: aorai_Loop_Init_26 ≢ 0 ⇒ \at(1 ≡ T0_init,Pre) ⇒ 0 ≡ T0_S2; loop invariant Aorai: aorai_Loop_Init_26 ≡ 0 ⇒ 0 ≡ accept_S1; */ while (1) { if (! (x < 10)) goto while_0_break; /*@ ghost aorai_Loop_Init_26 = 0; */ { int tmp_0; tmp_0 = b(); x += tmp_0; } } while_0_break: ; tmp_1 = a(); main_post_func(tmp_1); return tmp_1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_boucle1.res.oracle0000666000000000000000000005356613571573400026062 0ustar [kernel] Parsing tests/aorai/test_boucle1.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle10.i (no preprocessing) /tmp/aorai_test_boucle10.i:3:[wp] warning: Global invariant not handled yet ('inv_cpt' ignored) /tmp/aorai_test_boucle10.i:6:[wp] warning: Global invariant not handled yet ('inv_status' ignored) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_commit_trans_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_post_2 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_post : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_commit_trans_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_commit_trans_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_commit_trans_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_commit_trans_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_commit_trans_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_post_2 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_post : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_commit_trans_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_init_trans_post_func_post_2 : Valid [wp] [Qed] Goal typed_init_trans_post_func_post : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_init_trans_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_init_trans_post_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_init_trans_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_init_trans_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_init_trans_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_init_trans_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_init_trans_post_func_buch_state_accept_S4_in_post : Valid [wp] [Qed] Goal typed_init_trans_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_post_2 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_post : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_init_trans_pre_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_init_trans_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_init_trans_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_init_trans_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_init_trans_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_init_trans_pre_func_buch_state_accept_S3_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S3_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S3_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_commit_trans = 2, op_init_trans = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int cpt = 3; /*@ global invariant inv_cpt: 0 ≤ cpt ≤ 3; */ int status = 0; /*@ global invariant inv_status: 0 ≤ status ≤ 1; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_S4 = 0; */ /*@ ghost int accept_init = 1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_commit_trans; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S4; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S4; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void commit_trans_pre_func(void) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_commit_trans; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_S4 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_commit_trans; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void commit_trans_post_func(int res) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_commit_trans; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S4 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_init; requires \true; behavior a: ensures 0 ≤ \result ≤ 1; behavior Buchi_property_behavior: ensures 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S2; */ int commit_trans(void) { int __retres; commit_trans_pre_func(); __retres = 1; commit_trans_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_init_trans; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void init_trans_pre_func(void) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_init_trans; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; requires 1 ≡ accept_S2 ⇒ status ≡ 0 ∨ status ≢ 0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_init_trans; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∧ status ≡ 0; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∨ ¬(status ≡ 0); ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_in: assumes 1 ≡ accept_S2 ∧ status ≢ 0; ensures 1 ≡ accept_S4; behavior buch_state_accept_S4_out: assumes 0 ≡ accept_S2 ∨ status ≡ 0; ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void init_trans_post_func(int res) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_init_trans; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S2 == 1) if (status != 0) accept_S4_tmp = 1; else accept_S4_tmp = 0; else accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_S2 == 1) if (status == 0) accept_S2_tmp = 1; else accept_S2_tmp = 0; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; requires \true; behavior a: ensures 0 ≤ \result ≤ 1; behavior Buchi_property_behavior: ensures (1 ≡ accept_S2 ⇒ status ≡ 0) ∧ (1 ≡ accept_S4 ⇒ status ≢ 0); ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 1 ≡ accept_S4 ∨ 0 ≡ accept_S4; ensures 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S2 ∨ 1 ≡ accept_S4; */ int init_trans(void) { int __retres; init_trans_pre_func(); __retres = 1; init_trans_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_init; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_init; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void main_pre_func(void) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_init == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_S3, accept_S4, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void main_post_func(int res) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S4_tmp = 0; if (accept_S2 == 1) accept_S3_tmp = 1; else accept_S3_tmp = 0; if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4; requires \true; behavior a: ensures 0 ≤ \result ≤ 1; behavior aorai_acceptance: ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2 ∨ 1 ≡ accept_S3 ∨ 1 ≡ accept_S4 ∨ 1 ≡ accept_init; behavior Buchi_property_behavior: ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 1 ≡ accept_S3 ∨ 0 ≡ accept_S3; ensures 0 ≡ accept_S4 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2 ∨ 1 ≡ accept_S3; */ int main(void) { int aorai_Loop_Init_32; int __retres; main_pre_func(); cpt = 3; status = 0; /*@ ghost aorai_Loop_Init_32 = 1; */ aorai_loop_32: /*@ loop invariant i: 0 ≤ status ≤ 1 ∧ 0 ≤ cpt ≤ 3 ∧ (cpt ≡ 0 ⇒ status ≡ 0); loop invariant Aorai: 0 ≡ accept_S1; loop invariant Aorai: 1 ≡ accept_S2; loop invariant Aorai: 0 ≡ accept_S3; loop invariant Aorai: 0 ≡ accept_S4; loop invariant Aorai: 0 ≡ accept_init; */ while (1) { if (! (cpt > 0)) goto while_0_break; /*@ ghost aorai_Loop_Init_32 = 0; */ status = init_trans(); if (status) { status = commit_trans(); if (status) goto label_ok; } cpt --; } while_0_break: ; __retres = 0; goto return_label; label_ok: __retres = 1; return_label: main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_boucle2.res.oracle0000666000000000000000000005317013571573400026052 0ustar [kernel] Parsing tests/aorai/test_boucle2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle20.i (no preprocessing) /tmp/aorai_test_boucle20.i:4:[wp] warning: Global invariant not handled yet ('inv' ignored) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_all_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_post_func_post_2 : Valid [wp] [Qed] Goal typed_opa_post_func_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S3_in_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opa_pre_func_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S5_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_opb_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_post_func_post_2 : Valid [wp] [Qed] Goal typed_opb_post_func_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S5_in_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opb_pre_func_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S4_in_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S5_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_main = 2, op_opa = 1, op_opb = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 50; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_S4 = 0; */ /*@ ghost int accept_S5 = 0; */ /*@ ghost int accept_all = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void opa_pre_func(void) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_in: assumes 1 ≡ T0_S2 ∧ rr ≡ 51; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ T0_S2 ∨ ¬(rr ≡ 51); ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void opa_post_func(void) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; if (T0_S2 == 1) if (rr == 51) accept_S3_tmp = 1; else accept_S3_tmp = 0; else accept_S3_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; requires rr < 50; behavior j: ensures rr < 51; behavior Buchi_property_behavior: ensures 1 ≡ accept_S3 ⇒ rr ≡ 51; ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S3 ∨ 0 ≡ accept_S3; ensures 0 ≡ T0_init ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S3; */ void opa(void) { opa_pre_func(); rr ++; opa_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_in: assumes 1 ≡ accept_S3; ensures 1 ≡ accept_S4; behavior buch_state_accept_S4_out: assumes 0 ≡ accept_S3; ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void opb_pre_func(void) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S5_tmp = 0; if (accept_S3 == 1) accept_S4_tmp = 1; else accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ accept_S4 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_in: assumes 1 ≡ accept_S4; ensures 1 ≡ accept_S5; behavior buch_state_accept_S5_out: assumes 0 ≡ accept_S4; ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void opb_post_func(void) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; if (accept_S4 == 1) accept_S5_tmp = 1; else accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ accept_S3 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_all; ensures 1 ≡ accept_S5; */ void opb(void) { opb_pre_func(); status = 1; opb_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void main_pre_func(void) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; if (T0_init == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ accept_S5 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S3, accept_S4, accept_S5, accept_all; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_all_in: assumes 1 ≡ accept_S5; ensures 1 ≡ accept_all; behavior buch_state_accept_all_out: assumes 0 ≡ accept_S5; ensures 0 ≡ accept_all; */ void main_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_all_tmp = accept_all; if (accept_S5 == 1) accept_all_tmp = 1; else accept_all_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all; behavior aorai_acceptance: ensures 1 ≡ accept_S3 ∨ 1 ≡ accept_S4 ∨ 1 ≡ accept_S5 ∨ 1 ≡ accept_all; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5; ensures 1 ≡ accept_all; */ int main(void) { int aorai_Loop_Init_26; int __retres; /*@ ghost int tmp; */ main_pre_func(); /*@ ghost aorai_Loop_Init_26 = 1; */ aorai_loop_26: /*@ loop invariant 0 ≤ rr ≤ 50; loop invariant Aorai: 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ accept_S3 ∨ 0 ≡ accept_S3; loop invariant Aorai: 0 ≡ accept_S4; loop invariant Aorai: 0 ≡ accept_S5; loop invariant Aorai: 0 ≡ accept_all; loop invariant Aorai: 1 ≡ T0_S2 ∨ 1 ≡ accept_S3; loop invariant Aorai: aorai_Loop_Init_26 ≢ 0 ⇒ \at(1 ≡ T0_init,Pre) ⇒ 0 ≡ accept_S3; */ while (1) { if (! (rr < 50)) goto while_0_break; /*@ ghost aorai_Loop_Init_26 = 0; */ opa(); } while_0_break: ; opb(); /*@ ghost tmp = 1; */ /*@ ghost tmp = 0; */ __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_boucle3.res.oracle0000666000000000000000000004760313571573400026057 0ustar [kernel] Parsing tests/aorai/test_boucle3.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle30.i (no preprocessing) /tmp/aorai_test_boucle30.i:4:[wp] warning: Global invariant not handled yet ('inv' ignored) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S4_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T1_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S4_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_all_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T1_S2_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S4_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T1_S2_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_post_func_post_2 : Valid [wp] [Qed] Goal typed_opa_post_func_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_T0_S4_in_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_T1_S2_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_T1_S2_in_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_T0_S4_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opa_pre_func_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_T0_S4_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_T0_S4_in_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_T1_S2_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_T1_S2_in_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_all_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_opb_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_post_func_post_2 : Valid [wp] [Qed] Goal typed_opb_post_func_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_T0_S4_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_T0_S4_in_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_T1_S2_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opb_pre_func_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_T0_S4_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S3_in_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_T1_S2_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_main = 2, op_opa = 1, op_opb = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 50; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S4 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int T1_S2 = 0; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_all = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_in: assumes 1 ≡ T0_S4; ensures 1 ≡ T0_S4; behavior buch_state_T0_S4_out: assumes 0 ≡ T0_S4; ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_in: assumes 1 ≡ T1_S2; ensures 1 ≡ T1_S2; behavior buch_state_T1_S2_out: assumes 0 ≡ T1_S2; ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void opa_pre_func(void) { /*@ ghost int T0_S4_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S3_tmp = 0; if (T1_S2 == 1) T1_S2_tmp = 1; else T1_S2_tmp = 0; T0_init_tmp = 0; if (T0_S4 == 1) T0_S4_tmp = 1; else T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } /*@ requires (1 ≡ T0_S4 ∨ 1 ≡ T1_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_in: assumes 1 ≡ T0_S4; ensures 1 ≡ T0_S4; behavior buch_state_T0_S4_out: assumes 0 ≡ T0_S4; ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_in: assumes 1 ≡ T1_S2; ensures 1 ≡ T1_S2; behavior buch_state_T1_S2_out: assumes 0 ≡ T1_S2; ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void opa_post_func(void) { /*@ ghost int T0_S4_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S3_tmp = 0; if (T1_S2 == 1) T1_S2_tmp = 1; else T1_S2_tmp = 0; T0_init_tmp = 0; if (T0_S4 == 1) T0_S4_tmp = 1; else T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } /*@ requires (1 ≡ T0_S4 ∨ 1 ≡ T1_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; requires 1 ≡ T1_S2 ∨ 0 ≡ T1_S2; requires 1 ≡ T0_S4 ∨ 0 ≡ T0_S4; requires rr < 50; behavior j: ensures rr < 51; behavior Buchi_behavior_in_0: assumes 1 ≡ T0_S4; ensures 1 ≡ T0_S4; behavior Buchi_behavior_in_1: assumes 1 ≡ T1_S2; ensures 1 ≡ T1_S2; behavior Buchi_behavior_out_0: assumes 0 ≡ T0_S4; ensures 0 ≡ T0_S4; behavior Buchi_behavior_out_1: ensures 0 ≡ T0_init; behavior Buchi_behavior_out_2: assumes 0 ≡ T1_S2; ensures 0 ≡ T1_S2; behavior Buchi_behavior_out_3: ensures 0 ≡ accept_S3; behavior Buchi_behavior_out_4: ensures 0 ≡ accept_all; */ void opa(void) { opa_pre_func(); rr ++; opa_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_out: ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_out: ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_in: assumes 1 ≡ T1_S2 ∧ rr ≡ 51; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ T1_S2 ∨ ¬(rr ≡ 51); ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void opb_pre_func(void) { /*@ ghost int T0_S4_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; if (T1_S2 == 1) if (rr == 51) accept_S3_tmp = 1; else accept_S3_tmp = 0; else accept_S3_tmp = 0; T1_S2_tmp = 0; T0_init_tmp = 0; T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ accept_S3 ∧ 0 ≡ T0_S4 ∧ 0 ≡ T0_init ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_in: assumes 1 ≡ accept_S3; ensures 1 ≡ T0_S4; behavior buch_state_T0_S4_out: assumes 0 ≡ accept_S3; ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_out: ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void opb_post_func(void) { /*@ ghost int T0_S4_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S3_tmp = 0; T1_S2_tmp = 0; T0_init_tmp = 0; if (accept_S3 == 1) T0_S4_tmp = 1; else T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ T1_S2 ∧ 0 ≡ T0_S4 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; requires 1 ≡ T1_S2 ⇒ rr ≡ 51; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; ensures 1 ≡ T0_S4; */ void opb(void) { opb_pre_func(); status = 1; opb_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_out: ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T1_S2; behavior buch_state_T1_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; */ void main_pre_func(void) { /*@ ghost int T0_S4_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; accept_all_tmp = 0; accept_S3_tmp = 0; if (T0_init == 1) T1_S2_tmp = 1; else T1_S2_tmp = 0; T0_init_tmp = 0; T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ T0_S4 ∧ 0 ≡ T0_init ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S4, T0_init, T1_S2, accept_S3, accept_all; behavior buch_state_T0_S4_in: assumes 1 ≡ T0_S4; ensures 1 ≡ T0_S4; behavior buch_state_T0_S4_out: assumes 0 ≡ T0_S4; ensures 0 ≡ T0_S4; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_S2_out: ensures 0 ≡ T1_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_all_in: assumes 1 ≡ T0_S4; ensures 1 ≡ accept_all; behavior buch_state_accept_all_out: assumes 0 ≡ T0_S4; ensures 0 ≡ accept_all; */ void main_post_func(int res) { /*@ ghost int T0_S4_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_all_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S4_tmp = T0_S4; T0_init_tmp = T0_init; T1_S2_tmp = T1_S2; accept_S3_tmp = accept_S3; accept_all_tmp = accept_all; if (T0_S4 == 1) accept_all_tmp = 1; else accept_all_tmp = 0; accept_S3_tmp = 0; T1_S2_tmp = 0; T0_init_tmp = 0; if (T0_S4 == 1) T0_S4_tmp = 1; else T0_S4_tmp = 0; T0_S4 = T0_S4_tmp; T0_init = T0_init_tmp; T1_S2 = T1_S2_tmp; accept_S3 = accept_S3_tmp; accept_all = accept_all_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S4 ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_all; behavior aorai_acceptance: ensures 1 ≡ accept_S3 ∨ 1 ≡ accept_all; behavior Buchi_property_behavior: ensures 1 ≡ T0_S4 ∨ 0 ≡ T0_S4; ensures 1 ≡ accept_all ∨ 0 ≡ accept_all; ensures 0 ≡ T0_init ∧ 0 ≡ T1_S2 ∧ 0 ≡ accept_S3; ensures 1 ≡ T0_S4 ∨ 1 ≡ accept_all; */ int main(void) { int aorai_Loop_Init_41; int aorai_Loop_Init_31; int __retres; main_pre_func(); /*@ ghost aorai_Loop_Init_31 = 1; */ aorai_loop_31: /*@ loop invariant 0 ≤ rr ≤ 50; loop invariant Aorai: 0 ≡ T0_S4; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ T1_S2; loop invariant Aorai: 0 ≡ accept_S3; loop invariant Aorai: 0 ≡ accept_all; */ while (1) { if (! (rr < 50)) goto while_0_break; /*@ ghost aorai_Loop_Init_31 = 0; */ opa(); } while_0_break: ; opb(); rr = 0; /*@ ghost aorai_Loop_Init_41 = 1; */ aorai_loop_41: /*@ loop invariant Aorai: 1 ≡ T0_S4; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 0 ≡ T1_S2; loop invariant Aorai: 0 ≡ accept_S3; loop invariant Aorai: 0 ≡ accept_all; */ while (1) { if (! (rr < 50)) goto while_1_break; /*@ ghost aorai_Loop_Init_41 = 0; */ opa(); } while_1_break: ; __retres = 1; main_post_func(__retres); return __retres; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_boucle_rechercheTableau.res.oracleframa-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_boucle_rechercheTableau.res.ora0000666000000000000000000003451713571573400030616 0ustar [kernel] Parsing tests/aorai/test_boucle_rechercheTableau.c (with preprocessing) tests/aorai/test_boucle_rechercheTableau.c:17:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. tests/aorai/test_boucle_rechercheTableau.c:7:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_boucle_rechercheTableau0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_foo_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_foo_post_func_post_2 : Valid [wp] [Qed] Goal typed_foo_post_func_post : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_foo_pre_func_post_2 : Valid [wp] [Qed] Goal typed_foo_pre_func_post : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_isPresent_post_func_post_2 : Valid [wp] [Qed] Goal typed_isPresent_post_func_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_WillDoFoo_in_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_post_2 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_Idle_in_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Idle_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_WillDoFoo_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_foo = 2, op_isPresent = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int End = 0; */ /*@ ghost int Idle = 1; */ /*@ ghost int WillDoFoo = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void isPresent_pre_func(int *t, int max, int val) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; requires 1 ≡ Idle ⇒ res ≢ -1 ∨ res ≡ -1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ Idle ∧ res ≢ -1; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ Idle ∨ ¬(res ≢ -1); ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_in: assumes 1 ≡ Idle ∧ res ≡ -1; ensures 1 ≡ WillDoFoo; behavior buch_state_WillDoFoo_out: assumes 0 ≡ Idle ∨ ¬(res ≡ -1); ensures 0 ≡ WillDoFoo; */ void isPresent_post_func(int res) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; if (Idle == 1) if (res == -1) WillDoFoo_tmp = 1; else WillDoFoo_tmp = 0; else WillDoFoo_tmp = 0; Idle_tmp = 0; if (Idle == 1) if (res != -1) End_tmp = 1; else End_tmp = 0; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; requires \valid(t+(0 .. max)); requires max ≥ 0; ensures (0 ≤ \result ≤ \old(max)) ∨ \result ≡ -1; ensures 0 ≤ \result ≤ \old(max) ⇒ *(\old(t)+\result) ≡ \old(val); ensures \result ≡ -1 ⇒ (∀ ℤ j; 0 ≤ j ≤ \old(max) ⇒ *(\old(t)+j) ≢ \old(val)); behavior Buchi_property_behavior: ensures (1 ≡ End ⇒ \result ≢ -1) ∧ (1 ≡ WillDoFoo ⇒ \result ≡ -1); ensures 1 ≡ End ∨ 0 ≡ End; ensures 1 ≡ WillDoFoo ∨ 0 ≡ WillDoFoo; ensures 0 ≡ Idle; ensures 1 ≡ End ∨ 1 ≡ WillDoFoo; */ int isPresent(int *t, int max, int val) { int aorai_Loop_Init_32; int __retres; int i; isPresent_pre_func(t,max,val); i = 0; /*@ ghost aorai_Loop_Init_32 = 1; */ aorai_loop_32: /*@ loop invariant inv: 0 ≤ i ≤ max ∧ \valid(t+(0 .. max)) ∧ max ≥ 0 ∧ (∀ ℤ j; 0 ≤ j ≤ i-1 ⇒ *(t+j) ≢ val); loop invariant Aorai: 0 ≡ End; loop invariant Aorai: 1 ≡ Idle; loop invariant Aorai: 0 ≡ WillDoFoo; loop variant (v: max-i); */ while (1) { if (i < max) { if (! (*(t + i) != val)) goto while_0_break; } else goto while_0_break; /*@ ghost aorai_Loop_Init_32 = 0; */ i ++; } while_0_break: ; if (*(t + i) == val) { __retres = i; goto return_label; } __retres = -1; return_label: isPresent_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ WillDoFoo; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ WillDoFoo; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void foo_pre_func(void) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (WillDoFoo == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void foo_post_func(void) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ WillDoFoo ∧ 0 ≡ End ∧ 0 ≡ Idle; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ void foo(void) { foo_pre_func(); foo_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void main_pre_func(int argc, char **argv) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void main_post_func(int res) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; behavior aorai_acceptance: ensures 1 ≡ End; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ int main(int argc, char **argv) { int __retres; int tab[4]; int r; main_pre_func(argc,argv); tab[0] = 10; tab[1] = 20; tab[2] = 33; tab[3] = 15; r = isPresent(tab,3,33); if (r == -1) foo(); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_factorial.res.oracle0000666000000000000000000004272413571573400026466 0ustar [kernel] Parsing tests/aorai/test_factorial.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_factorial0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_decode_int_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_decode_int_post_func_post_2 : Valid [wp] [Qed] Goal typed_decode_int_post_func_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part9 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_post_2 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_factorial_post_func_post_2 : Valid [wp] [Qed] Goal typed_factorial_post_func_post : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_factorial_pre_func_post_2 : Valid [wp] [Qed] Goal typed_factorial_pre_func_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_factorial_pre_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_factorial_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part9 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_init_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_decode_int = 2, op_factorial = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost int accept_init = 1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_decode_int; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void decode_int_pre_func(char *s) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_decode_int; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_decode_int; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void decode_int_post_func(int res) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_decode_int; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S1 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_init; behavior Buchi_property_behavior: ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ accept_init; ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int decode_int(char *s) { int aorai_Loop_Init_81; int __retres; int intmax; int cutlim; int cutoff; int value; char c; decode_int_pre_func(s); intmax = ~ (1 << (sizeof(int) * (unsigned int)8 - (unsigned int)1)); cutlim = intmax % 10; cutoff = intmax / 10; value = 0; /*@ ghost aorai_Loop_Init_81 = 1; */ aorai_loop_81: /*@ loop invariant Aorai: 1 ≡ accept_S1; loop invariant Aorai: 0 ≡ accept_S2; loop invariant Aorai: 0 ≡ accept_init; */ while (1) { { char *tmp; /*@ ghost aorai_Loop_Init_81 = 0; */ tmp = s; s ++; c = *tmp; if (! c) goto while_0_break; { int v; v = 0; switch ((int)c) { case '0': v = 0; goto switch_1_break; case '1': v = 1; goto switch_1_break; case '2': v = 2; goto switch_1_break; case '3': v = 3; goto switch_1_break; case '4': v = 4; goto switch_1_break; case '5': v = 5; goto switch_1_break; case '6': v = 6; goto switch_1_break; case '7': v = 7; goto switch_1_break; case '8': v = 8; goto switch_1_break; case '9': v = 9; goto switch_1_break; default: ; __retres = -1; goto return_label; } switch_1_break: ; if (value > cutoff) { __retres = -1; goto return_label; } else if (value == cutoff) if (v > cutlim) { __retres = -1; goto return_label; } value = value * 10 + v; } } } while_0_break: ; __retres = value; return_label: decode_int_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_factorial; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1; ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void factorial_pre_func(int value) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_factorial; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S1 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } /*@ requires (1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_factorial; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1; ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void factorial_post_func(int res) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_factorial; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S1 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } /*@ requires (1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ accept_init; requires 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 0 ≤ value ≤ 12; decreases value; ensures \result ≥ 1; behavior Buchi_property_behavior: ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ accept_init; ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int factorial(int value) { int tmp_0; factorial_pre_func(value); if (value > 0) { int tmp; tmp = factorial(value - 1); tmp_0 = tmp * value; } else tmp_0 = 1; factorial_post_func(tmp_0); return tmp_0; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_init; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void main_pre_func(int argc, char **argv) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_S2_tmp = 0; if (accept_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S1, accept_S2, accept_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S2; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void main_post_func(int res) { /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S1 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; requires argc ≡ 2; ensures \result ≡ 0 ∨ \result ≡ 1; behavior Buchi_property_behavior: ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ accept_init; ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int main(int argc, char **argv) { int __retres; int value; main_pre_func(argc,argv); if (argc != 2) { __retres = 1; goto return_label; } else { value = decode_int(*(argv + 1)); if (value < 0) { __retres = 1; goto return_label; } else if (value > 12) { __retres = 1; goto return_label; } } factorial(value); __retres = 0; return_label: main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_factorial2.res.oracle0000666000000000000000000003724513571573400026552 0ustar [kernel] Parsing tests/aorai/test_factorial2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_factorial20.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_decode_int_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_decode_int_post_func_post_2 : Valid [wp] [Qed] Goal typed_decode_int_post_func_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part9 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_decode_int_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_S2_in_post : Valid [wp] [Qed] Goal typed_decode_int_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_post_2 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_decode_int_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_decode_int_pre_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_factorial_post_func_post_2 : Valid [wp] [Qed] Goal typed_factorial_post_func_post : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_S2_in_post : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_factorial_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_factorial_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_factorial_pre_func_post_2 : Valid [wp] [Qed] Goal typed_factorial_pre_func_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_factorial_pre_func_buch_state_S2_in_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_factorial_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_factorial_pre_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_factorial_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part9 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_main_0_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_decode_int = 2, op_factorial = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int S2 = 0; */ /*@ ghost int main_0 = 1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_decode_int; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void decode_int_pre_func(char *s) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_decode_int; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; S2_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ main_0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_decode_int; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S1 ∧ 1 ≢ 0; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S1 ∨ 1 ≡ 0; ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void decode_int_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_decode_int; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) S2_tmp = 1; else S2_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ main_0; behavior Buchi_property_behavior: ensures 1 ≡ S2 ⇒ 1 ≢ 0; ensures 1 ≡ S1 ∨ 0 ≡ S1; ensures 1 ≡ S2 ∨ 0 ≡ S2; ensures 0 ≡ main_0; ensures 1 ≡ S1 ∨ 1 ≡ S2; */ int decode_int(char *s) { int aorai_Loop_Init_81; int __retres; int intmax; int cutlim; int cutoff; int value; char c; decode_int_pre_func(s); intmax = ~ (1 << (sizeof(int) * (unsigned int)8 - (unsigned int)1)); cutlim = intmax % 10; cutoff = intmax / 10; value = 0; /*@ ghost aorai_Loop_Init_81 = 1; */ aorai_loop_81: /*@ loop invariant Aorai: 1 ≡ S1; loop invariant Aorai: 0 ≡ S2; loop invariant Aorai: 0 ≡ main_0; */ while (1) { { char *tmp; /*@ ghost aorai_Loop_Init_81 = 0; */ tmp = s; s ++; c = *tmp; if (! c) goto while_0_break; { int v; v = 0; switch ((int)c) { case '0': v = 0; goto switch_1_break; case '1': v = 1; goto switch_1_break; case '2': v = 2; goto switch_1_break; case '3': v = 3; goto switch_1_break; case '4': v = 4; goto switch_1_break; case '5': v = 5; goto switch_1_break; case '6': v = 6; goto switch_1_break; case '7': v = 7; goto switch_1_break; case '8': v = 8; goto switch_1_break; case '9': v = 9; goto switch_1_break; default: ; __retres = -1; goto return_label; } switch_1_break: ; if (value > cutoff) { __retres = -1; goto return_label; } else if (value == cutoff) if (v > cutlim) { __retres = -1; goto return_label; } value = value * 10 + v; } } } while_0_break: ; __retres = value; return_label: decode_int_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_factorial; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S2 ∨ (1 ≡ S1 ∧ 1 ≢ 0); ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S2 ∧ (0 ≡ S1 ∨ 1 ≡ 0); ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void factorial_pre_func(int value) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_factorial; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) S2_tmp = 1; else if (S2 == 1) S2_tmp = 1; else S2_tmp = 0; S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } /*@ requires (1 ≡ S1 ∨ 1 ≡ S2) ∧ 0 ≡ main_0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_factorial; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ S2 ∨ 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S2 ∧ 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S2 ∨ (1 ≡ S1 ∧ 1 ≢ 0); ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S2 ∧ (0 ≡ S1 ∨ 1 ≡ 0); ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void factorial_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_factorial; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) S2_tmp = 1; else if (S2 == 1) S2_tmp = 1; else S2_tmp = 0; if (S1 == 1) S1_tmp = 1; else if (S2 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } /*@ requires (1 ≡ S1 ∨ 1 ≡ S2) ∧ 0 ≡ main_0; requires 1 ≡ S1 ⇒ 1 ≢ 0; requires 1 ≡ S2 ∨ 0 ≡ S2; requires 1 ≡ S1 ∨ 0 ≡ S1; requires 0 ≤ value ≤ 12; decreases value; ensures \result ≥ 1; behavior Buchi_property_behavior: ensures 1 ≡ S1 ∨ 0 ≡ S1; ensures 1 ≡ S2 ∨ 0 ≡ S2; ensures 0 ≡ main_0; ensures 1 ≡ S1 ∨ 1 ≡ S2; */ int factorial(int value) { int tmp_0; factorial_pre_func(value); if (value > 0) { int tmp; tmp = factorial(value - 1); tmp_0 = tmp * value; } else tmp_0 = 1; factorial_post_func(tmp_0); return tmp_0; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ main_0; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ main_0; ensures 0 ≡ S1; behavior buch_state_S2_out: ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void main_pre_func(int argc, char **argv) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; S2_tmp = 0; if (main_0 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ S2 ∧ 0 ≡ main_0; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, S2, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_S2_in: assumes 1 ≡ S1 ∧ 1 ≢ 0; ensures 1 ≡ S2; behavior buch_state_S2_out: assumes 0 ≡ S1 ∨ 1 ≡ 0; ensures 0 ≡ S2; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void main_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int S2_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; S2_tmp = S2; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) S2_tmp = 1; else S2_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; S2 = S2_tmp; main_0 = main_0_tmp; return; } /*@ requires 1 ≡ main_0 ∧ 0 ≡ S1 ∧ 0 ≡ S2; requires argc ≡ 2; ensures \result ≡ 0 ∨ \result ≡ 1; behavior Buchi_property_behavior: ensures 1 ≡ S2 ⇒ 1 ≢ 0; ensures 1 ≡ S1 ∨ 0 ≡ S1; ensures 1 ≡ S2 ∨ 0 ≡ S2; ensures 0 ≡ main_0; ensures 1 ≡ S1 ∨ 1 ≡ S2; */ int main(int argc, char **argv) { int __retres; int value; main_pre_func(argc,argv); if (argc != 2) { __retres = 1; goto return_label; } else { value = decode_int(*(argv + 1)); if (value < 0) { __retres = 1; goto return_label; } else if (value > 12) { __retres = 1; goto return_label; } } factorial(value); __retres = 0; return_label: main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_recursion1.res.oracle0000666000000000000000000003571013571573400026611 0ustar [kernel] Parsing tests/aorai/test_recursion1.c (with preprocessing) tests/aorai/test_recursion1.c:21:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. tests/aorai/test_recursion1.c:42:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. tests/aorai/test_recursion1.c:54:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion10.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: No definition for 'string_len' interpreted as reads nothing [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_countOne_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_countOne_post_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_post_func_post : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_count_post_func_post_2 : Valid [wp] [Qed] Goal typed_count_post_func_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_count_pre_func_post_2 : Valid [wp] [Qed] Goal typed_count_pre_func_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part9 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ axiomatic string_len { logic ℤ string_len{L}(char *s) ; axiom strlen0{L}: ∀ char *s; \valid{L}(s) ⇒ string_len{L}(s) ≥ 0; axiom strlen1{L}: ∀ char *s; \valid{L}(s) ∧ *(s+0) ≡ '\000' ⇒ string_len{L}(s) ≡ 0; axiom strlen2{L}: ∀ char *s; \valid{L}(s) ⇒ *(s+string_len{L}(s)) ≡ '\000'; axiom strlen3{L}: ∀ char *s; \valid{L}(s) ∧ *(s+0) ≢ '\000' ⇒ string_len{L}(s) ≡ 1+string_len{L}(s+1) ∧ \valid{L}(s+1); axiom strlen4{L}: ∀ char *s; \valid{L}(s) ⇒ (∀ ℤ i; 0 ≤ i < string_len{L}(s) ⇒ *(s+i) ≢ '\000'); } */ /*@ predicate valid_string{L}(char *s) = \valid{L}(s) ∧ \valid{L}(s+(0 .. string_len{L}(s))); */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; */ void countOne_pre_func(char *argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; */ void countOne_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; requires valid_string(argv); ensures \result ≡ string_len(\old(argv)); behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures 1 ≡ T0_S2; */ int countOne(char *argv) { int __retres; int r; int tmp; countOne_pre_func(argv); r = 0; if ((int)*(argv + 0) == 0) { __retres = 0; goto return_label; } r ++; tmp = countOne(argv + 1); r += tmp; __retres = r; return_label: countOne_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; */ void count_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S1; */ void count_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; requires argc > 0 ∧ \valid(argv) ∧ \valid(argv+(0 .. argc)) ∧ (∀ ℤ i; 0 ≤ i < argc ⇒ valid_string(*(argv+i))); ensures \result ≥ 0; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures 1 ≡ accept_S1; */ int count(int argc, char **argv) { int s; count_pre_func(argc,argv); s = countOne(*(argv + 0)); if (argc > 1) { int tmp_0; tmp_0 = count(argc - 1,argv + 1); s += tmp_0; } count_post_func(s); return s; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; */ void main_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; */ void main_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1; requires argc ≥ 0 ∧ (argc > 0 ⇒ \valid(argv)) ∧ \valid(argv+(0 .. argc)) ∧ (∀ ℤ i; 0 ≤ i < argc ⇒ valid_string(*(argv+i))); ensures \result ≡ 1; behavior aorai_acceptance: ensures 1 ≡ accept_S1; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; int somme; main_pre_func(argc,argv); somme = 0; if (argc > 0) somme = count(argc,argv); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_recursion2.0.res.oracle0000666000000000000000000004317713571573400026756 0ustar [kernel] Parsing tests/aorai/test_recursion2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion20.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: No definition for 'string_len' interpreted as reads nothing [wp] warning: No definition for 'sum_tab' interpreted as reads nothing [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_count_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_post_func_post_2 : Valid [wp] [Qed] Goal typed_count_post_func_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_pre_func_post_2 : Valid [wp] [Qed] Goal typed_count_pre_func_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T1_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_T2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part9 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_sumOne_post_func_post_2 : Valid [wp] [Qed] Goal typed_sumOne_post_func_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_T1_in_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_accept_T2_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_sumOne_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_post_2 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part9 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_T1_in_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_T0_init_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_main = 1, op_sumOne = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ axiomatic string_len { logic ℤ string_len{L}(char *s) ; axiom strlen0{L}: ∀ char *s; \valid{L}(s) ⇒ string_len{L}(s) ≥ 0; axiom strlen1{L}: ∀ char *s; \valid{L}(s) ∧ *(s+0) ≡ '\000' ⇒ string_len{L}(s) ≡ 0; axiom strlen2{L}: ∀ char *s; \valid{L}(s) ⇒ *(s+string_len{L}(s)) ≡ '\000'; axiom strlen3{L}: ∀ char *s; \valid{L}(s) ∧ *(s+0) ≢ '\000' ⇒ string_len{L}(s) ≡ 1+string_len{L}(s+1) ∧ \valid{L}(s+1); axiom strlen4{L}: ∀ char *s; \valid{L}(s) ⇒ (∀ ℤ i; 0 ≤ i < string_len{L}(s) ⇒ *(s+i) ≢ '\000'); } */ /*@ predicate valid_string{L}(char *s) = \valid{L}(s) ∧ \valid{L}(s+(0 .. string_len{L}(s))); */ /*@ axiomatic sum_tab { logic ℤ sum_tab{L}(char *t, ℤ l, ℤ i) ; axiom sum_tab0{L}: ∀ char *t, ℤ l; \valid{L}(t+(0 .. l)) ⇒ sum_tab{L}(t, l, 0) ≡ *(t+0); axiom sum_tabi{L}: ∀ char *t, ℤ l, ℤ i; \valid{L}(t+(0 .. l)) ∧ 0 < i ≤ l ⇒ sum_tab{L}(t, l, i) ≡ sum_tab{L}(t, l, i-1)+*(t+i); axiom sum_tabn{L}: ∀ char *t, ℤ l; \valid{L}(t+(0 .. l)) ∧ l > 0 ∧ l ≡ string_len{L}(t) ⇒ sum_tab{L}(t, l, l) ≡ sum_tab{L}(t, l, l-1); } */ int global_argc = 0; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int T1 = 0; */ /*@ ghost int accept_T2 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_in: assumes (1 ≡ T1 ∧ global_argc > 0) ∨ 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes (0 ≡ T1 ∨ ¬(global_argc > 0)) ∧ 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_out: ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void count_pre_func(char *argv) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; T1_tmp = 0; T0_init_tmp = 0; if (S1 == 1) S1_tmp = 1; else if (T1 == 1) if (global_argc > 0) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_out: ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void count_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; T1_tmp = 0; T0_init_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires (1 ≡ S1 ∨ 1 ≡ T1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; requires 1 ≡ T1 ⇒ global_argc > 0; requires 1 ≡ T1 ∨ 0 ≡ T1; requires 1 ≡ S1 ∨ 0 ≡ S1; requires valid_string(argv); ensures \result ≡ string_len(\old(argv)); behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; ensures 1 ≡ S1; */ int count(char *argv) { int __retres; int tmp; count_pre_func(argv); if ((int)*(argv + 0) == 0) { __retres = 0; goto return_label; } tmp = count(argv + 1); __retres = 1 + tmp; return_label: count_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_sumOne; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ S1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ S1; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void sumOne_pre_func(char *t, int length) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_sumOne; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (S1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ T1 ∧ 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_sumOne; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T1; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void sumOne_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_sumOne; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (T1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; requires valid_string(t) ∧ length ≥ 0 ∧ length ≡ string_len(t); ensures \result ≡ sum_tab(\old(t), \old(length), \old(length)); behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures 1 ≡ T1; */ int sumOne(char *t, int length) { int aorai_Loop_Init_42; int sum; int i; sumOne_pre_func(t,length); sum = 0; i = 0; i = 0; /*@ ghost aorai_Loop_Init_42 = 1; */ aorai_loop_42: /*@ loop invariant ranges: 0 ≤ i ≤ length; loop invariant sumValue0: i ≡ 0 ⇒ sum ≡ 0; loop invariant sumValuei: i > 0 ⇒ sum ≡ sum_tab(t, length, i-1); loop invariant Aorai: 0 ≡ S1; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ T1; loop invariant Aorai: 0 ≡ accept_T2; */ while (1) { if (! (i < length)) goto while_0_break; /*@ ghost aorai_Loop_Init_42 = 0; */ sum += (int)*(t + i); i ++; } while_0_break: ; sumOne_post_func(sum); return sum; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T0_init; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T0_init; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void main_pre_func(int argc, char **argv) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (T0_init == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ T1 ∧ 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T1; ensures 0 ≡ T1; behavior buch_state_accept_T2_in: assumes 1 ≡ T1; ensures 1 ≡ accept_T2; behavior buch_state_accept_T2_out: assumes 0 ≡ T1; ensures 0 ≡ accept_T2; */ void main_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; if (T1 == 1) accept_T2_tmp = 1; else accept_T2_tmp = 0; if (T1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ S1 ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; requires argc ≥ 0 ∧ (argc > 0 ⇒ \valid(argv) ∧ valid_string(*(argv+0))); ensures \result ≡ 1; behavior aorai_acceptance: ensures 1 ≡ accept_T2; behavior Buchi_property_behavior: ensures 1 ≡ T1 ∨ 0 ≡ T1; ensures 1 ≡ accept_T2 ∨ 0 ≡ accept_T2; ensures 0 ≡ S1 ∧ 0 ≡ T0_init; ensures 1 ≡ T1 ∨ 1 ≡ accept_T2; */ int main(int argc, char **argv) { int __retres; int sum; int length; main_pre_func(argc,argv); sum = 0; global_argc = argc; if (argc > 0) { length = count(*(argv + 0)); sum = sumOne(*(argv + 0),length); } __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_recursion2.1.res.oracle0000666000000000000000000004347013571573400026753 0ustar [kernel] Parsing tests/aorai/test_recursion2.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion21.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: No definition for 'string_len' interpreted as reads nothing [wp] warning: No definition for 'sum_tab' interpreted as reads nothing [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_count_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_post_func_post_2 : Valid [wp] [Qed] Goal typed_count_post_func_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_pre_func_post_2 : Valid [wp] [Qed] Goal typed_count_pre_func_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_T2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part9 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_sumOne_post_func_post_2 : Valid [wp] [Qed] Goal typed_sumOne_post_func_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_sumOne_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_T1_in_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_sumOne_post_func_buch_state_accept_T2_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_sumOne_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_post_2 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part9 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_accept_T2_out_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_T1_out_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_T1_in_post : Valid [wp] [Qed] Goal typed_sumOne_pre_func_buch_state_T0_init_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_main = 1, op_sumOne = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ axiomatic string_len { logic ℤ string_len{L}(char *s) ; axiom strlen0{L}: ∀ char *s; \valid{L}(s) ⇒ string_len{L}(s) ≥ 0; axiom strlen1{L}: ∀ char *s; \valid{L}(s) ∧ *(s+0) ≡ '\000' ⇒ string_len{L}(s) ≡ 0; axiom strlen2{L}: ∀ char *s; \valid{L}(s) ⇒ *(s+string_len{L}(s)) ≡ '\000'; axiom strlen3{L}: ∀ char *s; \valid{L}(s) ∧ *(s+0) ≢ '\000' ⇒ string_len{L}(s) ≡ 1+string_len{L}(s+1) ∧ \valid{L}(s+1); axiom strlen4{L}: ∀ char *s; \valid{L}(s) ⇒ (∀ ℤ i; 0 ≤ i < string_len{L}(s) ⇒ *(s+i) ≢ '\000'); } */ /*@ predicate valid_string{L}(char *s) = \valid{L}(s) ∧ \valid{L}(s+(0 .. string_len{L}(s))); */ /*@ axiomatic sum_tab { logic ℤ sum_tab{L}(char *t, ℤ l, ℤ i) ; axiom sum_tab0{L}: ∀ char *t, ℤ l; \valid{L}(t+(0 .. l)) ⇒ sum_tab{L}(t, l, 0) ≡ *(t+0); axiom sum_tabi{L}: ∀ char *t, ℤ l, ℤ i; \valid{L}(t+(0 .. l)) ∧ 0 < i ≤ l ⇒ sum_tab{L}(t, l, i) ≡ sum_tab{L}(t, l, i-1)+*(t+i); axiom sum_tabn{L}: ∀ char *t, ℤ l; \valid{L}(t+(0 .. l)) ∧ l > 0 ∧ l ≡ string_len{L}(t) ⇒ sum_tab{L}(t, l, l) ≡ sum_tab{L}(t, l, l-1); } */ int global_argc = 0; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int T1 = 0; */ /*@ ghost int accept_T2 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_in: assumes (1 ≡ T1 ∧ global_argc > 0) ∨ 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes (0 ≡ T1 ∨ ¬(global_argc > 0)) ∧ 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_out: ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void count_pre_func(char *argv) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; T1_tmp = 0; T0_init_tmp = 0; if (S1 == 1) S1_tmp = 1; else if (T1 == 1) if (global_argc > 0) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_in: assumes 1 ≡ S1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1; ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_out: ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void count_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; T1_tmp = 0; T0_init_tmp = 0; if (S1 == 1) S1_tmp = 1; else S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires (1 ≡ S1 ∨ 1 ≡ T1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; requires 1 ≡ T1 ⇒ global_argc > 0; requires 1 ≡ T1 ∨ 0 ≡ T1; requires 1 ≡ S1 ∨ 0 ≡ S1; requires valid_string(argv); ensures \result ≡ string_len(\old(argv)); behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; ensures 1 ≡ S1; */ int count(char *argv) { int __retres; int tmp; count_pre_func(argv); if ((int)*(argv + 0) == 0) { __retres = 0; goto return_label; } tmp = count(argv + 1); __retres = 1 + tmp; return_label: count_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_sumOne; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ S1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ S1; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void sumOne_pre_func(char *t, int length) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_sumOne; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (S1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ T1 ∧ 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_sumOne; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T1; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void sumOne_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_sumOne; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (T1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; requires valid_string(t) ∧ length ≥ 0 ∧ length ≡ string_len(t); ensures \result ≡ sum_tab(\old(t), \old(length), \old(length)); behavior Buchi_property_behavior: ensures 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures 1 ≡ T1; */ int sumOne(char *t, int length) { int aorai_Loop_Init_42; int sum; int i; sumOne_pre_func(t,length); sum = 0; i = 0; i = 0; /*@ ghost aorai_Loop_Init_42 = 1; */ aorai_loop_42: /*@ loop invariant ranges: 0 ≤ i ≤ length; loop invariant sumValue0: i ≡ 0 ⇒ sum ≡ 0; loop invariant sumValuei: i > 0 ⇒ sum ≡ sum_tab(t, length, i-1); loop invariant Aorai: 0 ≡ S1; loop invariant Aorai: 0 ≡ T0_init; loop invariant Aorai: 1 ≡ T1; loop invariant Aorai: 0 ≡ accept_T2; */ while (1) { if (! (i < length)) goto while_0_break; /*@ ghost aorai_Loop_Init_42 = 0; */ sum += (int)*(t + i); i ++; } while_0_break: ; sumOne_post_func(sum); return sum; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T0_init; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T0_init; ensures 0 ≡ T1; behavior buch_state_accept_T2_out: ensures 0 ≡ accept_T2; */ void main_pre_func(int argc, char **argv) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; accept_T2_tmp = 0; if (T0_init == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ T1 ∧ 0 ≡ S1 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_T2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, T0_init, T1, accept_T2; behavior buch_state_S1_out: ensures 0 ≡ S1; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_T1_in: assumes 1 ≡ T1; ensures 1 ≡ T1; behavior buch_state_T1_out: assumes 0 ≡ T1; ensures 0 ≡ T1; behavior buch_state_accept_T2_in: assumes 1 ≡ T1 ∧ res ≡ 1; ensures 1 ≡ accept_T2; behavior buch_state_accept_T2_out: assumes 0 ≡ T1 ∨ ¬(res ≡ 1); ensures 0 ≡ accept_T2; */ void main_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int T1_tmp; */ /*@ ghost int accept_T2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; T0_init_tmp = T0_init; T1_tmp = T1; accept_T2_tmp = accept_T2; if (T1 == 1) if (res == 1) accept_T2_tmp = 1; else accept_T2_tmp = 0; else accept_T2_tmp = 0; if (T1 == 1) T1_tmp = 1; else T1_tmp = 0; T0_init_tmp = 0; S1_tmp = 0; S1 = S1_tmp; T0_init = T0_init_tmp; T1 = T1_tmp; accept_T2 = accept_T2_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ S1 ∧ 0 ≡ T1 ∧ 0 ≡ accept_T2; requires argc ≥ 0 ∧ (argc > 0 ⇒ \valid(argv) ∧ valid_string(*(argv+0))); ensures \result ≡ 1; behavior aorai_acceptance: ensures 1 ≡ accept_T2; behavior Buchi_property_behavior: ensures 1 ≡ accept_T2 ⇒ \result ≡ 1; ensures 1 ≡ T1 ∨ 0 ≡ T1; ensures 1 ≡ accept_T2 ∨ 0 ≡ accept_T2; ensures 0 ≡ S1 ∧ 0 ≡ T0_init; ensures 1 ≡ T1 ∨ 1 ≡ accept_T2; */ int main(int argc, char **argv) { int __retres; int sum; int length; main_pre_func(argc,argv); sum = 0; global_argc = argc; if (argc > 0) { length = count(*(argv + 0)); sum = sumOne(*(argv + 0),length); } __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_recursion4.res.oracle0000666000000000000000000003425113571573400026613 0ustar [kernel] Parsing tests/aorai/test_recursion4.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion40.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_foo_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_foo_post_func_post_2 : Valid [wp] [Qed] Goal typed_foo_post_func_post : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_foo_pre_func_post_2 : Valid [wp] [Qed] Goal typed_foo_pre_func_post : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_isPresent_post_func_post_2 : Valid [wp] [Qed] Goal typed_isPresent_post_func_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_WillDoFoo_in_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_post_2 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_Idle_in_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Idle_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_WillDoFoo_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_foo = 2, op_isPresent = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; #pragma JessieIntegerModel(math) /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int End = 0; */ /*@ ghost int Idle = 1; */ /*@ ghost int WillDoFoo = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void isPresent_pre_func(int *t, int size, int val) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ End ∨ 1 ≡ Idle ∨ 1 ≡ WillDoFoo; requires 1 ≡ End ⇒ res ≢ -1; requires 1 ≡ Idle ⇒ res ≢ -1 ∨ res ≡ -1; requires 1 ≡ WillDoFoo ⇒ res ≡ -1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes (1 ≡ Idle ∧ res ≢ -1) ∨ (1 ≡ End ∧ res ≢ -1); ensures 1 ≡ End; behavior buch_state_End_out: assumes (0 ≡ Idle ∨ ¬(res ≢ -1)) ∧ (0 ≡ End ∨ ¬(res ≢ -1)); ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_in: assumes (1 ≡ WillDoFoo ∧ res ≡ -1) ∨ (1 ≡ Idle ∧ res ≡ -1); ensures 1 ≡ WillDoFoo; behavior buch_state_WillDoFoo_out: assumes (0 ≡ WillDoFoo ∨ ¬(res ≡ -1)) ∧ (0 ≡ Idle ∨ ¬(res ≡ -1)); ensures 0 ≡ WillDoFoo; */ void isPresent_post_func(int res) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; if (Idle == 1) { if (res == -1) WillDoFoo_tmp = 1; else goto _LAND; } else { _LAND: ; if (WillDoFoo == 1) if (res == -1) WillDoFoo_tmp = 1; else WillDoFoo_tmp = 0; else WillDoFoo_tmp = 0; } Idle_tmp = 0; if (End == 1) { if (res != -1) End_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (Idle == 1) if (res != -1) End_tmp = 1; else End_tmp = 0; else End_tmp = 0; } End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; requires \valid(t+(0 .. size-1)); requires size ≥ 0; decreases size; ensures -1 ≤ \result < \old(size); behavior found: ensures 0 ≤ \result ⇒ *(\old(t)+\result) ≡ \old(val); behavior notIn: ensures \result ≡ -1 ⇒ (∀ ℤ i; 0 ≤ i < \old(size) ⇒ *(\old(t)+i) ≢ \old(val)); behavior Buchi_property_behavior: ensures (1 ≡ End ⇒ \result ≢ -1) ∧ (1 ≡ WillDoFoo ⇒ \result ≡ -1); ensures 1 ≡ End ∨ 0 ≡ End; ensures 1 ≡ WillDoFoo ∨ 0 ≡ WillDoFoo; ensures 0 ≡ Idle; ensures 1 ≡ End ∨ 1 ≡ WillDoFoo; */ int isPresent(int *t, int size, int val) { int __retres; int r; int tmp; isPresent_pre_func(t,size,val); if (size == 0) { __retres = -1; goto return_label; } if (*(t + 0) == val) { __retres = 0; goto return_label; } tmp = isPresent(t + 1,size - 1,val); r = 1 + tmp; if (r == 0) r = -1; __retres = r; return_label: isPresent_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ WillDoFoo; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ WillDoFoo; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void foo_pre_func(void) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (WillDoFoo == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void foo_post_func(void) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ WillDoFoo ∧ 0 ≡ End ∧ 0 ≡ Idle; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ void foo(void) { foo_pre_func(); foo_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void main_pre_func(int argc, char **argv) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void main_post_func(int res) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ WillDoFoo; behavior aorai_acceptance: ensures 1 ≡ End; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ int main(int argc, char **argv) { int __retres; int tab[4]; int r; main_pre_func(argc,argv); tab[0] = 10; tab[1] = 20; tab[2] = 33; tab[3] = 15; r = isPresent(tab,4,33); if (r == -1) foo(); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_recursion5.res.oracle0000666000000000000000000005660613571573400026624 0ustar [kernel] Parsing tests/aorai/test_recursion5.c (with preprocessing) tests/aorai/test_recursion5.c:12:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. tests/aorai/test_recursion5.c:28:[kernel] warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_recursion50.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_foo_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_foo_post_func_post_2 : Valid [wp] [Qed] Goal typed_foo_post_func_post : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_foo_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_IgnoreFoo_out_post : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_foo_post_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_foo_pre_func_post_2 : Valid [wp] [Qed] Goal typed_foo_pre_func_post : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part9 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_foo_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_IgnoreFoo_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_foo_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_post_2 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_post : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_buch_state_IgnoreFoo_in_post : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_buch_state_WillDoFoo_in_post : Valid [wp] [Qed] Goal typed_isPresentRec_post_func_buch_state_IgnoreFoo_out_post : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_post_2 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_post : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_assign_part9 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_buch_state_IgnoreFoo_out_post : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_isPresentRec_pre_func_buch_state_Idle_in_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_isPresent_post_func_post_2 : Valid [wp] [Qed] Goal typed_isPresent_post_func_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_isPresent_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_WillDoFoo_in_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_IgnoreFoo_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_isPresent_post_func_buch_state_WillDoFoo_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_isPresent_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_post_2 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part9 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_IgnoreFoo_out_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_isPresent_pre_func_buch_state_Idle_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_IgnoreFoo_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_End_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_End_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part9 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_WillDoFoo_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_IgnoreFoo_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Idle_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_Idle_in_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_foo = 3, op_isPresent = 2, op_isPresentRec = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int End = 0; */ /*@ ghost int Idle = 1; */ /*@ ghost int IgnoreFoo = 0; */ /*@ ghost int WillDoFoo = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_isPresentRec; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void isPresentRec_pre_func(int *t, int i, int max, int val) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int IgnoreFoo_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_isPresentRec; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires (1 ≡ Idle ∨ 1 ≡ IgnoreFoo ∨ 1 ≡ WillDoFoo) ∧ 0 ≡ End; requires 1 ≡ Idle ⇒ res ≢ -1 ∨ res ≡ -1; requires 1 ≡ IgnoreFoo ⇒ res ≢ -1; requires 1 ≡ WillDoFoo ⇒ res ≡ -1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_isPresentRec; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_in: assumes (1 ≡ IgnoreFoo ∧ res ≢ -1) ∨ (1 ≡ Idle ∧ res ≢ -1); ensures 1 ≡ IgnoreFoo; behavior buch_state_IgnoreFoo_out: assumes (0 ≡ IgnoreFoo ∨ ¬(res ≢ -1)) ∧ (0 ≡ Idle ∨ ¬(res ≢ -1)); ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_in: assumes (1 ≡ WillDoFoo ∧ res ≡ -1) ∨ (1 ≡ Idle ∧ res ≡ -1); ensures 1 ≡ WillDoFoo; behavior buch_state_WillDoFoo_out: assumes (0 ≡ WillDoFoo ∨ ¬(res ≡ -1)) ∧ (0 ≡ Idle ∨ ¬(res ≡ -1)); ensures 0 ≡ WillDoFoo; */ void isPresentRec_post_func(int res) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int IgnoreFoo_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_isPresentRec; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; if (Idle == 1) { if (res == -1) WillDoFoo_tmp = 1; else goto _LAND; } else { _LAND: ; if (WillDoFoo == 1) if (res == -1) WillDoFoo_tmp = 1; else WillDoFoo_tmp = 0; else WillDoFoo_tmp = 0; } if (Idle == 1) { if (res != -1) IgnoreFoo_tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (IgnoreFoo == 1) if (res != -1) IgnoreFoo_tmp = 1; else IgnoreFoo_tmp = 0; else IgnoreFoo_tmp = 0; } Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; requires \valid(t+(0 .. max)); requires max ≥ 0; requires 0 ≤ i ≤ max; decreases max-i; ensures (\old(i) ≤ \result ≤ \old(max)) ∨ \result ≡ -1; ensures \old(i) ≤ \result ≤ \old(max) ⇒ *(\old(t)+\result) ≡ \old(val); ensures \result ≡ -1 ⇒ (∀ ℤ j; \old(i) ≤ j ≤ \old(max) ⇒ *(\old(t)+j) ≢ \old(val)); behavior Buchi_property_behavior: ensures (1 ≡ IgnoreFoo ⇒ \result ≢ -1) ∧ (1 ≡ WillDoFoo ⇒ \result ≡ -1); ensures 1 ≡ IgnoreFoo ∨ 0 ≡ IgnoreFoo; ensures 1 ≡ WillDoFoo ∨ 0 ≡ WillDoFoo; ensures 0 ≡ End ∧ 0 ≡ Idle; ensures 1 ≡ IgnoreFoo ∨ 1 ≡ WillDoFoo; */ int isPresentRec(int *t, int i, int max, int val) { int __retres; int tmp; isPresentRec_pre_func(t,i,max,val); if (*(t + i) == val) { __retres = i; goto return_label; } if (max == i) { __retres = -1; goto return_label; } tmp = isPresentRec(t,i + 1,max,val); __retres = tmp; return_label: isPresentRec_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void isPresent_pre_func(int *t, int max, int val) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int IgnoreFoo_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires (1 ≡ IgnoreFoo ∨ 1 ≡ WillDoFoo) ∧ 0 ≡ End ∧ 0 ≡ Idle; requires 1 ≡ IgnoreFoo ⇒ res ≢ -1; requires 1 ≡ WillDoFoo ⇒ res ≡ -1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_isPresent; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ IgnoreFoo ∧ res ≢ -1; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ IgnoreFoo ∨ ¬(res ≢ -1); ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_in: assumes 1 ≡ WillDoFoo ∧ res ≡ -1; ensures 1 ≡ WillDoFoo; behavior buch_state_WillDoFoo_out: assumes 0 ≡ WillDoFoo ∨ ¬(res ≡ -1); ensures 0 ≡ WillDoFoo; */ void isPresent_post_func(int res) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int IgnoreFoo_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_isPresent; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; if (WillDoFoo == 1) if (res == -1) WillDoFoo_tmp = 1; else WillDoFoo_tmp = 0; else WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; Idle_tmp = 0; if (IgnoreFoo == 1) if (res != -1) End_tmp = 1; else End_tmp = 0; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; requires \valid(t+(0 .. max)); requires max ≥ 0; ensures (0 ≤ \result ≤ \old(max)) ∨ \result ≡ -1; ensures 0 ≤ \result ≤ \old(max) ⇒ *(\old(t)+\result) ≡ \old(val); ensures \result ≡ -1 ⇒ (∀ ℤ i; 0 ≤ i ≤ \old(max) ⇒ *(\old(t)+i) ≢ \old(val)); behavior Buchi_property_behavior: ensures (1 ≡ End ⇒ \result ≢ -1) ∧ (1 ≡ WillDoFoo ⇒ \result ≡ -1); ensures 1 ≡ End ∨ 0 ≡ End; ensures 1 ≡ WillDoFoo ∨ 0 ≡ WillDoFoo; ensures 0 ≡ Idle ∧ 0 ≡ IgnoreFoo; ensures 1 ≡ End ∨ 1 ≡ WillDoFoo; */ int isPresent(int *t, int max, int val) { int tmp; isPresent_pre_func(t,max,val); tmp = isPresentRec(t,0,max,val); isPresent_post_func(tmp); return tmp; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ WillDoFoo; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ WillDoFoo; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void foo_pre_func(void) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int IgnoreFoo_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; Idle_tmp = 0; if (WillDoFoo == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_foo; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void foo_post_func(void) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int IgnoreFoo_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_foo; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ WillDoFoo ∧ 0 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ IgnoreFoo; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ void foo(void) { foo_pre_func(); foo_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_out: ensures 0 ≡ End; behavior buch_state_Idle_in: assumes 1 ≡ Idle; ensures 1 ≡ Idle; behavior buch_state_Idle_out: assumes 0 ≡ Idle; ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void main_pre_func(int argc, char **argv) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int IgnoreFoo_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; if (Idle == 1) Idle_tmp = 1; else Idle_tmp = 0; End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ End ∧ 0 ≡ Idle ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, End, Idle, IgnoreFoo, WillDoFoo; behavior buch_state_End_in: assumes 1 ≡ End; ensures 1 ≡ End; behavior buch_state_End_out: assumes 0 ≡ End; ensures 0 ≡ End; behavior buch_state_Idle_out: ensures 0 ≡ Idle; behavior buch_state_IgnoreFoo_out: ensures 0 ≡ IgnoreFoo; behavior buch_state_WillDoFoo_out: ensures 0 ≡ WillDoFoo; */ void main_post_func(int res) { /*@ ghost int End_tmp; */ /*@ ghost int Idle_tmp; */ /*@ ghost int IgnoreFoo_tmp; */ /*@ ghost int WillDoFoo_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; End_tmp = End; Idle_tmp = Idle; IgnoreFoo_tmp = IgnoreFoo; WillDoFoo_tmp = WillDoFoo; WillDoFoo_tmp = 0; IgnoreFoo_tmp = 0; Idle_tmp = 0; if (End == 1) End_tmp = 1; else End_tmp = 0; End = End_tmp; Idle = Idle_tmp; IgnoreFoo = IgnoreFoo_tmp; WillDoFoo = WillDoFoo_tmp; return; } /*@ requires 1 ≡ Idle ∧ 0 ≡ End ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; behavior aorai_acceptance: ensures 1 ≡ End; behavior Buchi_property_behavior: ensures 0 ≡ Idle ∧ 0 ≡ IgnoreFoo ∧ 0 ≡ WillDoFoo; ensures 1 ≡ End; */ int main(int argc, char **argv) { int __retres; int tab[4]; int r; main_pre_func(argc,argv); tab[0] = 10; tab[1] = 20; tab[2] = 33; tab[3] = 15; r = isPresent(tab,3,33); if (r == -1) foo(); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_struct.res.oracle0000666000000000000000000001703413571573400026042 0ustar [kernel] Parsing tests/aorai/test_struct.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_struct0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_increment_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_increment_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_increment_post_func_post_2 : Valid [wp] [Qed] Goal typed_increment_post_func_post : Valid [wp] [Qed] Goal typed_increment_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_increment_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_increment_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_increment_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_increment_post_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_increment_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_increment_post_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_increment_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_increment_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_increment_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_increment_pre_func_post_2 : Valid [wp] [Qed] Goal typed_increment_pre_func_post : Valid [wp] [Qed] Goal typed_increment_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_increment_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_increment_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_increment_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_increment_pre_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_increment_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_increment_pre_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_S1_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_main_0_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_S1_in_post : Valid /* Generated by Frama-C */ struct People { int Age ; char Gender ; }; enum aorai_ListOper { op_increment = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; struct People nobody; int myAge = 0; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int S1 = 0; */ /*@ ghost int main_0 = 1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_increment; assigns aorai_CurOpStatus, aorai_CurOperation, S1, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1 ∧ nobody.Age ≡ 1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1 ∨ ¬(nobody.Age ≡ 1); ensures 0 ≡ S1; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void increment_pre_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_increment; S1_tmp = S1; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) if (nobody.Age == 1) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; main_0 = main_0_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ main_0; requires 1 ≡ S1 ⇒ nobody.Age ≡ 1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_increment; assigns aorai_CurOpStatus, aorai_CurOperation, S1, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1 ∧ nobody.Age ≡ 1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1 ∨ ¬(nobody.Age ≡ 1); ensures 0 ≡ S1; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void increment_post_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_increment; S1_tmp = S1; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) if (nobody.Age == 1) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; main_0 = main_0_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ main_0; requires 1 ≡ S1 ⇒ nobody.Age ≡ 1; behavior Buchi_property_behavior: ensures 1 ≡ S1 ⇒ nobody.Age ≡ 1; ensures 0 ≡ main_0; ensures 1 ≡ S1; */ void increment(void) { increment_pre_func(); (nobody.Age) ++; myAge ++; increment_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, main_0; behavior buch_state_S1_in: assumes 1 ≡ main_0 ∧ nobody.Age ≡ 0; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ main_0 ∨ ¬(nobody.Age ≡ 0); ensures 0 ≡ S1; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void main_pre_func(void) { /*@ ghost int S1_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; S1_tmp = S1; main_0_tmp = main_0; main_0_tmp = 0; if (main_0 == 1) if (nobody.Age == 0) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; main_0 = main_0_tmp; return; } /*@ requires 1 ≡ S1 ∧ 0 ≡ main_0; requires 1 ≡ S1 ⇒ nobody.Age ≡ 1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, S1, main_0; behavior buch_state_S1_in: assumes 1 ≡ S1 ∧ nobody.Age ≡ 1; ensures 1 ≡ S1; behavior buch_state_S1_out: assumes 0 ≡ S1 ∨ ¬(nobody.Age ≡ 1); ensures 0 ≡ S1; behavior buch_state_main_0_out: ensures 0 ≡ main_0; */ void main_post_func(int res) { /*@ ghost int S1_tmp; */ /*@ ghost int main_0_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; S1_tmp = S1; main_0_tmp = main_0; main_0_tmp = 0; if (S1 == 1) if (nobody.Age == 1) S1_tmp = 1; else S1_tmp = 0; else S1_tmp = 0; S1 = S1_tmp; main_0 = main_0_tmp; return; } /*@ requires 1 ≡ main_0 ∧ 0 ≡ S1; requires 1 ≡ main_0 ⇒ nobody.Age ≡ 0; behavior aorai_acceptance: ensures 1 ≡ S1 ∨ 1 ≡ main_0; behavior Buchi_property_behavior: ensures 1 ≡ S1 ⇒ nobody.Age ≡ 1; ensures 0 ≡ main_0; ensures 1 ≡ S1; */ int main(void) { int __retres; main_pre_func(); nobody.Age = 0; increment(); __retres = 0; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_switch2.res.oracle0000666000000000000000000007515413571573400026110 0ustar [kernel] Parsing tests/aorai/test_switch2.c (with preprocessing) [aorai] Welcome to the Aorai plugin tests/aorai/test_switch2.c:34:[aorai] warning: Call to opc not conforming to automaton (post-cond). Assuming it is on a dead path tests/aorai/test_switch2.c:23:[aorai] warning: Call to opc not conforming to automaton (pre-cond). Assuming it is on a dead path [kernel] Parsing /tmp/aorai_test_switch20.i (no preprocessing) /tmp/aorai_test_switch20.i:4:[wp] warning: Global invariant not handled yet ('inv' ignored) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_all_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_post_func_post_2 : Valid [wp] [Qed] Goal typed_opa_post_func_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_opa_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_S4_in_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opa_post_func_buch_state_accept_all_out_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_opa_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opa_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opa_pre_func_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S3_in_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opa_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_post_func_post_2 : Valid [wp] [Qed] Goal typed_opb_post_func_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part16 : Valid [wp] [Qed] Goal typed_opb_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S6_in_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opb_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opb_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opb_pre_func_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_assign_part15 : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_S5_in_post : Valid [wp] [Qed] Goal typed_opb_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_opc_post_func_post_2 : Valid [wp] [Qed] Goal typed_opc_post_func_post : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S6_out_post : Valid [wp] [Qed] Goal typed_opc_post_func_buch_state_accept_S5_out_post : Valid [wp] Computing [200 goals...] [wp] [Qed] Goal typed_opc_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_opc_pre_func_post_2 : Valid [wp] [Qed] Goal typed_opc_pre_func_post : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part14 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part13 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part12 : Valid [wp] [Qed] Goal typed_opc_pre_func_assign_part11 : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S5_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S4_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S3_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_init_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_all_out_post : Valid [wp] [Qed] Goal typed_opc_pre_func_buch_state_accept_S6_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_main = 3, op_opa = 2, op_opb = 1, op_opc = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; int status = 0; int rr = 1; /*@ global invariant inv: 0 ≤ rr ≤ 50; */ /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int accept_S2 = 0; */ /*@ ghost int accept_S3 = 0; */ /*@ ghost int accept_S4 = 0; */ /*@ ghost int accept_S5 = 0; */ /*@ ghost int accept_S6 = 0; */ /*@ ghost int accept_all = 0; */ /*@ ghost int accept_init = 1; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_in: assumes 1 ≡ accept_S2; ensures 1 ≡ accept_S3; behavior buch_state_accept_S3_out: assumes 0 ≡ accept_S2; ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opa_pre_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opa; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; if (accept_S2 == 1) accept_S3_tmp = 1; else accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S3 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opa; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_in: assumes 1 ≡ accept_S3; ensures 1 ≡ accept_S4; behavior buch_state_accept_S4_out: assumes 0 ≡ accept_S3; ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opa_post_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opa; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; if (accept_S3 == 1) accept_S4_tmp = 1; else accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; requires rr < 50; behavior j: ensures rr < 51; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S4; */ void opa(void) { opa_pre_func(); rr ++; opa_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_in: assumes 1 ≡ accept_S4; ensures 1 ≡ accept_S5; behavior buch_state_accept_S5_out: assumes 0 ≡ accept_S4; ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opb_pre_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opb; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; if (accept_S4 == 1) accept_S5_tmp = 1; else accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S5 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opb; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_in: assumes 1 ≡ accept_S5; ensures 1 ≡ accept_S6; behavior buch_state_accept_S6_out: assumes 0 ≡ accept_S5; ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opb_post_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opb; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; if (accept_S5 == 1) accept_S6_tmp = 1; else accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S4 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures 1 ≡ accept_S6; */ void opb(void) { opb_pre_func(); status = 1; opb_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opc_pre_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_opc; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_opc; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void opc_post_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_opc; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires \false; behavior Buchi_behavior_out_0: ensures 0 ≡ accept_S2; behavior Buchi_behavior_out_1: ensures 0 ≡ accept_S3; behavior Buchi_behavior_out_2: ensures 0 ≡ accept_S4; behavior Buchi_behavior_out_3: ensures 0 ≡ accept_S5; behavior Buchi_behavior_out_4: ensures 0 ≡ accept_S6; behavior Buchi_behavior_out_5: ensures 0 ≡ accept_all; behavior Buchi_behavior_out_6: ensures 0 ≡ accept_init; */ void opc(void) { opc_pre_func(); rr = 9000; opc_post_func(); return; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_init; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_init; ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_out: ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void main_pre_func(void) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; if (accept_init == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_S6 ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_all ∧ 0 ≡ accept_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, accept_S2, accept_S3, accept_S4, accept_S5, accept_S6, accept_all, accept_init; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; behavior buch_state_accept_S3_out: ensures 0 ≡ accept_S3; behavior buch_state_accept_S4_out: ensures 0 ≡ accept_S4; behavior buch_state_accept_S5_out: ensures 0 ≡ accept_S5; behavior buch_state_accept_S6_out: ensures 0 ≡ accept_S6; behavior buch_state_accept_all_in: assumes 1 ≡ accept_S6; ensures 1 ≡ accept_all; behavior buch_state_accept_all_out: assumes 0 ≡ accept_S6; ensures 0 ≡ accept_all; behavior buch_state_accept_init_out: ensures 0 ≡ accept_init; */ void main_post_func(int res) { /*@ ghost int accept_S2_tmp; */ /*@ ghost int accept_S3_tmp; */ /*@ ghost int accept_S4_tmp; */ /*@ ghost int accept_S5_tmp; */ /*@ ghost int accept_S6_tmp; */ /*@ ghost int accept_all_tmp; */ /*@ ghost int accept_init_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; accept_S2_tmp = accept_S2; accept_S3_tmp = accept_S3; accept_S4_tmp = accept_S4; accept_S5_tmp = accept_S5; accept_S6_tmp = accept_S6; accept_all_tmp = accept_all; accept_init_tmp = accept_init; accept_init_tmp = 0; if (accept_S6 == 1) accept_all_tmp = 1; else accept_all_tmp = 0; accept_S6_tmp = 0; accept_S5_tmp = 0; accept_S4_tmp = 0; accept_S3_tmp = 0; accept_S2_tmp = 0; accept_S2 = accept_S2_tmp; accept_S3 = accept_S3_tmp; accept_S4 = accept_S4_tmp; accept_S5 = accept_S5_tmp; accept_S6 = accept_S6_tmp; accept_all = accept_all_tmp; accept_init = accept_init_tmp; return; } /*@ requires 1 ≡ accept_init ∧ 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_all; behavior aorai_acceptance: ensures 1 ≡ accept_S2 ∨ 1 ≡ accept_S3 ∨ 1 ≡ accept_S4 ∨ 1 ≡ accept_S5 ∨ 1 ≡ accept_S6 ∨ 1 ≡ accept_all ∨ 1 ≡ accept_init; behavior Buchi_property_behavior: ensures 0 ≡ accept_S2 ∧ 0 ≡ accept_S3 ∧ 0 ≡ accept_S4 ∧ 0 ≡ accept_S5 ∧ 0 ≡ accept_S6 ∧ 0 ≡ accept_init; ensures 1 ≡ accept_all; */ int main(void) { int __retres; main_pre_func(); switch (rr) { case 1: opa(); goto switch_0_break; case 3: opa(); default: ; opc(); } switch_0_break: ; opb(); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_switch3.res.oracle0000666000000000000000000004420313571573400026100 0ustar [kernel] Parsing tests/aorai/test_switch3.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_switch30.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_countOne_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_countOne_post_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_post_func_post : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_post_func_post_2 : Valid [wp] [Qed] Goal typed_count_post_func_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_pre_func_post_2 : Valid [wp] [Qed] Goal typed_count_pre_func_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_in_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void countOne_pre_func(char *argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else if (accept_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void countOne_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; requires 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2; */ int countOne(char *argv) { int r; countOne_pre_func(argv); r = 0; switch ((int)*(argv + 0)) { int tmp; case 0: r = 0; goto switch_0_break; case 1: case 2: case 3: default: ; r ++; tmp = countOne(argv + 1); r += tmp; } switch_0_break: ; countOne_post_func(r); return r; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S2; */ void count_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S2; */ void count_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (T0_S2 == 1) accept_S1_tmp = 1; else if (accept_S1 == 1) accept_S1_tmp = 1; else if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int count(int argc, char **argv) { int __retres; count_pre_func(argc,argv); if (argc > 0) { int tmp; int tmp_0; tmp = countOne(*(argv + 0)); tmp_0 = count(argc - 1,argv + 1); __retres = tmp + tmp_0; goto return_label; } __retres = 0; return_label: count_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void main_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_init == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void main_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; behavior aorai_acceptance: ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; int somme; main_pre_func(argc,argv); somme = count(argc,argv); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_switch3_et_recursion.res.oracle0000666000000000000000000003232713571573400030665 0ustar [kernel] Parsing tests/aorai/test_switch3_et_recursion.c (with preprocessing) [aorai] Welcome to the Aorai plugin tests/aorai/test_switch3_et_recursion.c:26:[aorai] warning: Call to countOne does not follow automaton's specification. This path is assumed to be dead [kernel] Parsing /tmp/aorai_test_switch3_et_recursion0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_countOne_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_countOne_post_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_post_func_post : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_count_post_func_post_2 : Valid [wp] [Qed] Goal typed_count_post_func_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_count_pre_func_post_2 : Valid [wp] [Qed] Goal typed_count_pre_func_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part9 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part8 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part2 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part1 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part6 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part5 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part4 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part3 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part7 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; */ void countOne_pre_func(char *argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires \false; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; */ void countOne_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; behavior Buchi_behavior_out_0: ensures 0 ≡ T0_S2; behavior Buchi_behavior_out_1: ensures 0 ≡ T0_init; behavior Buchi_behavior_out_2: ensures 0 ≡ accept_S1; */ int countOne(char *argv) { int r; countOne_pre_func(argv); r = 0; switch ((int)*(argv + 0)) { int tmp; case 0: r = 0; case 1: case 2: case 3: default: ; r ++; tmp = countOne(argv + 1); r += tmp; } countOne_post_func(r); return r; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; */ void count_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S1; */ void count_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; behavior Buchi_property_behavior: ensures 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures 1 ≡ accept_S1; */ int count(int argc, char **argv) { int __retres; count_pre_func(argc,argv); if (argc > 0) { int tmp; int tmp_0; tmp = countOne(*(argv + 0)); tmp_0 = count(argc - 1,argv + 1); __retres = tmp + tmp_0; goto return_label; } __retres = 0; return_label: count_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_out: ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; */ void main_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; */ void main_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1; behavior aorai_acceptance: ensures 1 ≡ accept_S1; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; int somme; main_pre_func(argc,argv); somme = count(argc,argv); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_switch3_if.res.oracle0000666000000000000000000004404313571573400026560 0ustar [kernel] Parsing tests/aorai/test_switch3_if.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_switch3_if0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_countOne_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_countOne_post_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_post_func_post : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_post_func_post_2 : Valid [wp] [Qed] Goal typed_count_post_func_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_pre_func_post_2 : Valid [wp] [Qed] Goal typed_count_pre_func_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_in_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void countOne_pre_func(char *argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else if (accept_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void countOne_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; requires 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2; */ int countOne(char *argv) { int r; countOne_pre_func(argv); r = 0; if ((int)*(argv + 0) != 0) { int tmp; r ++; tmp = countOne(argv + 1); r += tmp; } countOne_post_func(r); return r; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S2; */ void count_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S2; */ void count_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (T0_S2 == 1) accept_S1_tmp = 1; else if (accept_S1 == 1) accept_S1_tmp = 1; else if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int count(int argc, char **argv) { int __retres; count_pre_func(argc,argv); if (argc > 0) { int tmp; int tmp_0; tmp = countOne(*(argv + 0)); tmp_0 = count(argc - 1,argv + 1); __retres = tmp + tmp_0; goto return_label; } __retres = 0; return_label: count_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void main_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_init == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void main_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; behavior aorai_acceptance: ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; int somme; main_pre_func(argc,argv); somme = count(argc,argv); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/oracle_prove/test_switch3_return.res.oracle0000666000000000000000000004427613571573400027511 0ustar [kernel] Parsing tests/aorai/test_switch3_return.c (with preprocessing) [aorai] Welcome to the Aorai plugin [kernel] Parsing /tmp/aorai_test_switch3_return0.i (no preprocessing) [wp] Collecting axiomatic usage [wp] warning: Missing RTE guards [wp] [Qed] Goal typed_countOne_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_countOne_post_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_post_func_post : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_countOne_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_countOne_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post_2 : Valid [wp] [Qed] Goal typed_countOne_pre_func_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_countOne_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_countOne_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_post_func_post_2 : Valid [wp] [Qed] Goal typed_count_post_func_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part14 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part13 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part12 : Valid [wp] [Qed] Goal typed_count_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_count_post_func_assign_part15 : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_post_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_count_pre_func_post_2 : Valid [wp] [Qed] Goal typed_count_pre_func_post : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_count_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_count_pre_func_buch_state_accept_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_post_func_post_2 : Valid [wp] [Qed] Goal typed_main_post_func_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_post_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_main_post_func_assign_part11 : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_out_post : Valid [wp] [Qed] Goal typed_main_post_func_buch_state_accept_S1_in_post : Valid [wp] Computing [100 goals...] [wp] [Qed] Goal typed_main_pre_func_assign_part02 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part01 : Valid [wp] [Qed] Goal typed_main_pre_func_post_2 : Valid [wp] [Qed] Goal typed_main_pre_func_post : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part06 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part05 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part04 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part03 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part10 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part09 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part08 : Valid [wp] [Qed] Goal typed_main_pre_func_assign_part07 : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_init_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_T0_S2_in_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S2_out_post : Valid [wp] [Qed] Goal typed_main_pre_func_buch_state_accept_S1_out_post : Valid /* Generated by Frama-C */ enum aorai_ListOper { op_count = 2, op_countOne = 1, op_main = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; /*@ ghost enum aorai_ListOper aorai_CurOperation = op_main; */ /*@ ghost enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; */ /*@ ghost int T0_S2 = 0; */ /*@ ghost int T0_init = 1; */ /*@ ghost int accept_S1 = 0; */ /*@ ghost int accept_S2 = 0; */ /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void countOne_pre_func(char *argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else if (accept_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires 1 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_countOne; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void countOne_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_countOne; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_S2 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S1; requires 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 0 ≡ T0_init ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2; */ int countOne(char *argv) { int __retres; int r; countOne_pre_func(argv); r = 0; switch ((int)*(argv + 0)) { int tmp; case 0: __retres = 0; goto return_label; case 1: case 2: case 3: default: ; r ++; tmp = countOne(argv + 1); r += tmp; } __retres = r; return_label: countOne_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_out: ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ T0_S2; ensures 0 ≡ accept_S2; */ void count_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2) ∧ 0 ≡ T0_init; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_count; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_in: assumes 1 ≡ accept_S2 ∨ 1 ≡ T0_S2; ensures 1 ≡ accept_S2; behavior buch_state_accept_S2_out: assumes 0 ≡ accept_S2 ∧ 0 ≡ T0_S2; ensures 0 ≡ accept_S2; */ void count_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_count; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; if (T0_S2 == 1) accept_S2_tmp = 1; else if (accept_S2 == 1) accept_S2_tmp = 1; else accept_S2_tmp = 0; if (T0_S2 == 1) accept_S1_tmp = 1; else if (accept_S1 == 1) accept_S1_tmp = 1; else if (accept_S2 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires (1 ≡ T0_S2 ∨ 1 ≡ accept_S1) ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; requires 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; requires 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 1 ≡ accept_S2 ∨ 0 ≡ accept_S2; ensures 0 ≡ T0_init; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; */ int count(int argc, char **argv) { int __retres; count_pre_func(argc,argv); if (argc > 0) { int tmp; int tmp_0; tmp = countOne(*(argv + 0)); tmp_0 = count(argc - 1,argv + 1); __retres = tmp + tmp_0; goto return_label; } __retres = 0; return_label: count_post_func(__retres); return __retres; } /*@ ensures aorai_CurOpStatus ≡ aorai_Called; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ T0_init; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ T0_init; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ T0_init; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ T0_init; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void main_pre_func(int argc, char **argv) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Called; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (T0_init == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (T0_init == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires 1 ≡ accept_S1 ∧ 0 ≡ T0_S2 ∧ 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures aorai_CurOpStatus ≡ aorai_Terminated; ensures aorai_CurOperation ≡ op_main; assigns aorai_CurOpStatus, aorai_CurOperation, T0_S2, T0_init, accept_S1, accept_S2; behavior buch_state_T0_S2_in: assumes 1 ≡ accept_S1; ensures 1 ≡ T0_S2; behavior buch_state_T0_S2_out: assumes 0 ≡ accept_S1; ensures 0 ≡ T0_S2; behavior buch_state_T0_init_out: ensures 0 ≡ T0_init; behavior buch_state_accept_S1_in: assumes 1 ≡ accept_S1; ensures 1 ≡ accept_S1; behavior buch_state_accept_S1_out: assumes 0 ≡ accept_S1; ensures 0 ≡ accept_S1; behavior buch_state_accept_S2_out: ensures 0 ≡ accept_S2; */ void main_post_func(int res) { /*@ ghost int T0_S2_tmp; */ /*@ ghost int T0_init_tmp; */ /*@ ghost int accept_S1_tmp; */ /*@ ghost int accept_S2_tmp; */ aorai_CurOpStatus = aorai_Terminated; aorai_CurOperation = op_main; T0_S2_tmp = T0_S2; T0_init_tmp = T0_init; accept_S1_tmp = accept_S1; accept_S2_tmp = accept_S2; accept_S2_tmp = 0; if (accept_S1 == 1) accept_S1_tmp = 1; else accept_S1_tmp = 0; T0_init_tmp = 0; if (accept_S1 == 1) T0_S2_tmp = 1; else T0_S2_tmp = 0; T0_S2 = T0_S2_tmp; T0_init = T0_init_tmp; accept_S1 = accept_S1_tmp; accept_S2 = accept_S2_tmp; return; } /*@ requires 1 ≡ T0_init ∧ 0 ≡ T0_S2 ∧ 0 ≡ accept_S1 ∧ 0 ≡ accept_S2; behavior aorai_acceptance: ensures 1 ≡ accept_S1 ∨ 1 ≡ accept_S2; behavior Buchi_property_behavior: ensures 1 ≡ T0_S2 ∨ 0 ≡ T0_S2; ensures 1 ≡ accept_S1 ∨ 0 ≡ accept_S1; ensures 0 ≡ T0_init ∧ 0 ≡ accept_S2; ensures 1 ≡ T0_S2 ∨ 1 ≡ accept_S1; */ int main(int argc, char **argv) { int __retres; int somme; main_pre_func(argc,argv); somme = count(argc,argv); __retres = 1; main_post_func(__retres); return __retres; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/other.c0000666000000000000000000000045513571573400020304 0ustar /* run.config* OPT: -aorai-automata tests/aorai/other.ya -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int x=0; void f (void) { x=3; } void g (void) { x=4; } int main () { f(); g(); f(); g(); return x; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/other.ya0000666000000000000000000000032113571573400020463 0ustar %init: init; %accept: last; init: { x == 3 } -> step1 | other -> init; step1: { x == 4 } -> last | other -> step1 ; last: { x == 3 } -> step1 | { x == 4 } -> init | other -> last ;frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/result_prove/0000777000000000000000000000000013571573400021544 5ustar frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/result_prove/.empty0000666000000000000000000000000013571573400022671 0ustar frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/seq.i0000666000000000000000000000043113571573400017753 0ustar /* run.config* OPT: -aorai-automata tests/aorai/seq.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-acceptance -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ void f() { } void g() { } int main(int c) { if (c) f(); g(); if (c) g(); return 0; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/seq.ya0000666000000000000000000000011613571573400020134 0ustar %init: S0; %accept: Sf; S0: { [ main( f()?; g(){1,2}) ] } -> Sf; Sf: -> Sf; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/seq_loop.i0000666000000000000000000000063213571573400021007 0ustar /* run.config* OPT: -aorai-automata tests/aorai/seq_loop.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-acceptance -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ void f() {} void g() {} //@ assigns \nothing; int main(int c) { if (c<0) { c = 0; } if (c>5) { c = 5; } /*@ assert 0<=c<=5; */ /*@ loop assigns c; */ while (c) { f(); g(); c--; } return 0; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/seq_loop.ya0000666000000000000000000000011213571573400021161 0ustar %init: S0; %accept: Sf; S0: { [main([f();g()]{0,5})] } -> Sf; Sf: -> Sf; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/single_call.i0000666000000000000000000000032013571573400021434 0ustar /* run.config* OPT: -aorai-automata tests/aorai/single_call.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-acceptance -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int main () {} frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/single_call.ya0000666000000000000000000000007313571573400021622 0ustar %init: S0; %accept: Sf; S0: { [main()] } -> Sf; Sf: -> Sf;frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_acces_params.c0000666000000000000000000000072013571573400022636 0ustar /* run.config* OPT: -aorai-automata tests/aorai/test_acces_params.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int status=0; int rr=1; //@ global invariant inv : 0<=rr<=5000; /*@ requires rr<5000; @ behavior j : @ ensures rr<5001; */ void opa(int i, int j) { rr=i+j; } int opb () { status=1; return status*3; } int main(){ if (rr<5000) opa(rr,300); rr=opb(); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_acces_params.ya0000666000000000000000000000041613571573400023027 0ustar %init: mainst; %accept: SF; mainst : { CALL(main) } -> S1 ; S1 : { opa().i>=0 } -> S2 ; S2 : { !CALL(opb) } -> S3 ; S3 : { !CALL(opa) } -> S4 ; S4 : { opb().return>0 } -> SF ; SF : { RETURN(main) } -> SF ; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_acces_params2.c0000666000000000000000000000117013571573400022720 0ustar /* run.config* OPT: -aorai-automata tests/aorai/test_acces_params2.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int rr=1; //@ global invariant inv:0<=rr<=5000; /*@ requires r<5000; @ behavior j : @ ensures \result==r+1; */ int opa(int r) {return r+1;} /*@ requires rr>=1 && rr <=5000; @behavior f: @ ensures rr>=3 && rr<=5000; */ void opb () {if(rr<4998) {rr+=2;}} /*@ behavior d: @ ensures rr==600; */ void opc () {rr=600;} /*@ requires rr==1; */ int main() { if (rr<5000) rr=opa(rr); opb(); goto L6; opc(); L6: return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_acces_params2.ya0000666000000000000000000000043613571573400023113 0ustar %init: S1; %accept: S1, S2, S3, S4, S5, S6, S7; S1 : { CALL(main) } -> S2 ; S2 : { opa().r>=0 } -> S3 ; S3 : { opa().return<=5000 } -> S4 ; S4 : { !RETURN(opa) } -> S5 ; S5 : { RETURN(opb) } -> S6 ; S6 : { RETURN(main) } -> S7 ; S7 : -> S7 ; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_boucle.c0000666000000000000000000000105013571573400021463 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_boucle.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /*@ requires \true; @ ensures 0<=\result<=1; */ int a() { return 1; } /*@ requires \true; @ ensures 1<=\result<=2; */ int b() { call_to_an_undefined_function(); return 2; } /*@ requires \true; @ ensures 0<=\result<=1; */ int main(){ int x=a(); /*@ loop invariant i : @ 0<=x<=11; */ while (x<10) { x+=b(); } return a(); } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_boucle.ltl0000666000000000000000000000005713571573400022042 0ustar _G_(CALL(b) => (CALL_OR_RETURN(b) _U_ CALL(a)))frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_boucle1.c0000666000000000000000000000156213571573400021554 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_boucle1.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int cpt=3; //@ global invariant inv_cpt : 0<=cpt<=3; int status=0; //@ global invariant inv_status : 0<=status<=1; /*@ requires \true; @ behavior a : @ ensures 0<=\result<=1; */ int commit_trans() { return 1; } /*@ requires \true; @ behavior a : @ ensures 0<=\result<=1; */ int init_trans() { return 1; } /*@ requires \true; @ behavior a : @ ensures 0<=\result<=1; */ int main(){ cpt=3; status=0; /*@ loop invariant i : @ 0<=status<=1 @ && 0<=cpt<=3 @ && (cpt==0 ==> status==0); */ while (cpt>0) { status=init_trans(); if (status && (status=commit_trans())) goto label_ok; cpt--; } return 0; label_ok: return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_boucle1.ltl0000666000000000000000000000030013571573400022112 0ustar _G_( RETURN(main) || (((_X_ CALL(commit_trans)) => (RETURN(init_trans) && status) ) && ((RETURN(init_trans) && status) => (_X_ CALL(commit_trans)) ) ) ) frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_boucle2.c0000666000000000000000000000101013571573400021541 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_boucle2.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int status=0; int rr=1; //@ global invariant inv : 0<=rr<=50; /*@ requires rr<50; @ behavior j : @ ensures rr<51; */ void opa() { rr++; } void opb () { status=1; } int main(){ /*@ loop invariant 0<=rr<=50; */ while (rr<50) { opa(); } opb(); //@ ghost int tmp = 1; //@ ghost tmp=0; return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_boucle2.ltl0000666000000000000000000000025713571573400022126 0ustar CALL(main) && _X_ (CALL_OR_RETURN(opa) _U_ (rr==51 && _X_ ( !CALL_OR_RETURN(opa) && _X_ ( RETURN(opb) && _X_ (RETURN(main)))))) frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_boucle3.c0000666000000000000000000000100613571573400021547 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_boucle3.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int status=0; int rr=1; //@ global invariant inv : 0<=rr<=50; /*@ requires rr<50; @ behavior j : @ ensures rr<51; */ void opa() { rr++; } void opb () { status=1; } int main(){ /*@ loop invariant 0<=rr<=50; */ while (rr<50) { opa(); } opb(); rr=0; while (rr<50) { opa(); } return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_boucle3.ltl0000666000000000000000000000025713571573400022127 0ustar CALL(main) && _X_ (CALL_OR_RETURN(opa) _U_ (rr==51 && !CALL_OR_RETURN(opa) && _X_ ( RETURN(opb) && _X_ ((!RETURN(opb)) _U_ RETURN(main))))) frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_boucle_rechercheTableau.c0000666000000000000000000000163213571573400024777 0ustar /* run.config* OPT: -aorai-automata tests/aorai/test_boucle_rechercheTableau.ya -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /*@ requires \valid_range(t,0,max); @ requires max>=0; @ ensures 0<=\result<=max || \result==-1 ; @ ensures 0<=\result<=max ==> t[\result]==val; @ ensures \result==-1 ==> (\forall integer j; 0<=j<=max ==> t[j]!=val); */ int isPresent(int t[], int max, int val) { int i=0; /*@ loop invariant inv : @ 0<=i<=max @ && \valid_range(t,0,max) @ && max>=0 @ && (\forall integer j; 0<=j<=i-1 ==> t[j]!=val); @ loop variant v : max-i ; */ while (i WillDoFoo | { isPresent().return!=-1 } -> End | { ! RETURN(isPresent) } -> Idle ; WillDoFoo : { CALL(foo) } -> End; End : { !CALL(foo) } -> End; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_factorial.c0000666000000000000000000000342513571573400022166 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_factorial.ltl -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /* make -f test_factorial_annot.makefile goals frama-c -jessie-analysis tests/aorai/test_factorial.c -jessie-int-model exact -jessie-gui frama-c tests/aorai/test_factorial.c -ltl tests/aorai/test_factorial.ltl -ltl-dot frama-c -jessie-analysis tests/aorai/test_factorial_annot.c -jessie-int-model exact -jessie-gui */ /* @ requires \string_len(s) >= 0; * @ ensures \result >= -1; */ int decode_int(char *s) { int intmax = ~ (1 << (sizeof(int) * 8 - 1)); int cutlim = intmax % 10; int cutoff = intmax / 10; int value = 0; char c; /* Decode number */ while (c = *s++) { int v = 0; switch(c) { case '0': v = 0; break; case '1': v = 1; break; case '2': v = 2; break; case '3': v = 3; break; case '4': v = 4; break; case '5': v = 5; break; case '6': v = 6; break; case '7': v = 7; break; case '8': v = 8; break; case '9': v = 9; break; default: return -1; } if ((value > cutoff) || (value == cutoff && v > cutlim)) return -1; value = value * 10 + v; } return value; } /*@ requires 0 <= value <= 12; @ decreases value; @ ensures \result >= 1; */ int factorial(int value) { return value > 0 ? factorial(value - 1) * value : 1; } /*@ requires argc==2; @ ensures \result == 0 || \result == 1; */ int main(int argc, char** argv) { int value; if ((argc != 2) || /* bad argument number */ ((value = decode_int(argv[1])) < 0) || /* decoding error */ (value > 12)) /* not in range */ return 1; factorial(value); //printf("%d! = %d\n", value, factorial(value)); return 0; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_factorial.ltl0000666000000000000000000000007713571573400022537 0ustar _G_ ( CALL(factorial) => _X_ (CALL_OR_RETURN(factorial)) ) frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_factorial.ya0000666000000000000000000000045113571573400022351 0ustar %init: main; %accept: main, S1, S2; main : { !CALL(factorial) } -> S1 | -> S2 ; S1 : { !CALL(factorial) } -> S1 | { 1 } -> S2 ; S2 : {!CALL(factorial) && COR(factorial) } -> S1 | { COR(factorial) } -> S2 ; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_factorial2.c0000666000000000000000000000271713571573400022253 0ustar /* run.config* OPT: -aorai-automata tests/aorai/test_factorial.ya -aorai-test 1 -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /* @ requires \string_len(s) >= 0; * @ ensures \result >= -1; */ int decode_int(char *s) { int intmax = ~ (1 << (sizeof(int) * 8 - 1)); int cutlim = intmax % 10; int cutoff = intmax / 10; int value = 0; char c; /* Decode number */ while (c = *s++) { int v = 0; switch(c) { case '0': v = 0; break; case '1': v = 1; break; case '2': v = 2; break; case '3': v = 3; break; case '4': v = 4; break; case '5': v = 5; break; case '6': v = 6; break; case '7': v = 7; break; case '8': v = 8; break; case '9': v = 9; break; default: return -1; } if ((value > cutoff) || (value == cutoff && v > cutlim)) return -1; value = value * 10 + v; } return value; } /*@ requires 0 <= value <= 12; @ decreases value; @ ensures \result >= 1; */ int factorial(int value) { return value > 0 ? factorial(value - 1) * value : 1; } /*@ requires argc==2; @ ensures \result == 0 || \result == 1; */ int main(int argc, char** argv) { int value; if ((argc != 2) || /* bad argument number */ ((value = decode_int(argv[1])) < 0) || /* decoding error */ (value > 12)) /* not in range */ return 1; factorial(value); //printf("%d! = %d\n", value, factorial(value)); return 0; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_recursion1.c0000666000000000000000000000376413571573400022322 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_recursion1.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /* Calcul de la longueur cumulee des chaines de caracteres prises en parametre */ //======================== // Chaines de caracteres //---------------------- /*@ axiomatic string_len { logic integer string_len{L}(char *s); axiom strlen0{L}: \forall char *s ; \valid(s) ==> string_len(s)>=0; axiom strlen1{L}: \forall char *s ; \valid(s) && s[0]=='\0' ==> string_len(s)==0 ; axiom strlen2{L}: \forall char *s ; \valid(s) ==> s[string_len(s)]=='\0' ; axiom strlen3{L}: \forall char *s ; \valid(s) && s[0]!='\0' ==> string_len(s)==1+string_len(s+1) && \valid(s+1) ; axiom strlen4{L}: \forall char *s ; \valid(s) ==> \forall integer i ; 0<=i s[i]!='\0' ; } */ //@ predicate valid_string{L}(char *s) = \valid(s) && \valid_range(s,0,string_len(s)) ; //======================== /* Calcul de la longueur d'une chaine */ /*@ requires valid_string(argv); @ ensures \result==string_len(argv); */ int countOne(char* argv) { int r=0; if(argv[0]==0) return 0; r++; r+=countOne(argv+1); return r; } /* Somme de chacune des longueurs */ /*@ requires argc>0 && \valid(argv) && \valid_range(argv,0,argc) && (\forall integer i; 0<=i valid_string(argv[i])); @ ensures \result>=0; */ int count(int argc, char** argv) { // printf(" --> '%s'\n",argv[0]); int s=countOne(argv[0]); if (argc>1) s+=count(argc-1,argv+1); return s; } /*@ requires argc>=0 && (argc>0 ==> \valid(argv)) && \valid_range(argv,0,argc) && (\forall integer i; 0<=i valid_string(argv[i])); @ ensures \result==1; */ int main(int argc, char** argv) { int somme=0; if (argc>0) somme=count(argc,argv); // printf("Longueur cumulee des params = %d\n",somme); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_recursion1.ltl0000666000000000000000000000012713571573400022661 0ustar _G_ ( CALL(count) => _X_ (CALL_OR_RETURN(countOne) _U_ (RETURN(count))) ) frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_recursion2.c0000666000000000000000000000560713571573400022321 0ustar /* run.config* OPT: -aorai-buchi tests/aorai/test_recursion2.promela -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ OPT: -aorai-buchi tests/aorai/test_recursion3.promela -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /* Calcul de la longueur cumulee des chaines de caracteres prises en parametre */ //======================== // Strings //-------- // /*@ axiomatic string_len { logic integer string_len{L}(char *s); axiom strlen0{L}: \forall char *s ; \valid(s) ==> string_len(s)>=0; axiom strlen1{L}: \forall char *s ; \valid(s) && s[0]=='\0' ==> string_len(s)==0 ; axiom strlen2{L}: \forall char *s ; \valid(s) ==> s[string_len(s)]=='\0' ; axiom strlen3{L}: \forall char *s ; \valid(s) && s[0]!='\0' ==> string_len(s)==1+string_len(s+1) && \valid(s+1) ; axiom strlen4{L}: \forall char *s ; \valid(s) ==> \forall integer i ; 0<=i s[i]!='\0' ; } */ /*@ predicate valid_string{L}(char *s) = \valid(s) && \valid(s+(0 .. string_len(s))) ; */ // // //======================== // Sum of a tab //------------- // /*@ axiomatic sum_tab { logic integer sum_tab{L}(char *t,integer l,integer i); axiom sum_tab0{L}: \forall char *t, integer l ; \valid(t + (0 .. l)) ==> sum_tab(t,l,0)==t[0]; axiom sum_tabi{L}: \forall char *t, integer l, integer i ; \valid(t + (0 .. l)) && 0 sum_tab(t,l,i)==sum_tab(t,l,i-1)+t[i]; axiom sum_tabn{L}: \forall char *t, integer l ; \valid(t + (0 .. l)) && l>0 && l==string_len(t) ==> sum_tab(t,l,l)==sum_tab(t,l,l-1); } */ // //======================== int global_argc=0; /* Calcul de la longueur d'une chaine */ /*@ requires valid_string(argv); @ ensures \result==string_len(argv); */ int count(char* argv) { if(argv[0]==0) return 0; return 1+count(argv+1); } /*@ requires valid_string(t) && length>=0 && length==string_len(t); @ ensures \result==sum_tab(t,length,length); */ int sumOne(char* t, int length) { // printf(" --> t : '%s' / length : %d\n",t,length); int sum=0; int i=0; //printf(" ----> c = '%d'\n",t[i]); /*@ loop invariant ranges: 0<=i<=length; @ loop invariant sumValue0: i==0 ==> sum==0; @ loop invariant sumValuei: i>0 ==> sum==sum_tab(t,length,i-1); */ for(i=0;i c = '%d'\n",t[i]); sum+=t[i]; } return sum; } /*@ requires argc>=0 && (argc>0 ==> \valid(argv) && valid_string(argv[0])); @ ensures \result==1; */ int main(int argc, char** argv) { int sum=0; int length; global_argc=argc; if (argc>0) { length=count(argv[0]); sum=sumOne(argv[0],length); } //printf("Somme cumulee du premier param = %d\n",sum); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_recursion2.promela0000666000000000000000000000064113571573400023527 0ustar never { /* []((callof_count -> X((callorreturnof_count U callof_sumOne)))) */ T0_init: if :: (global_argc>0 && callof_count) -> goto S1 :: (!callof_count) -> goto T1 fi; T1: if :: (!callorreturnof_count) -> goto T1 :: (returnof_main) -> goto accept_T2 :: (global_argc>0 && callof_count) -> goto S1 fi; S1: if :: (callorreturnof_count) -> goto S1 :: (callof_sumOne) -> goto T1 fi; accept_T2: skip; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_recursion3.promela0000666000000000000000000000064713571573400023536 0ustar never { /* []((callof_count -> X((callorreturnof_count U callof_sumOne)))) */ T0_init: if :: (global_argc>0 && count().argv!=0) -> goto S1 :: (!callof_count) -> goto T1 fi; T1: if :: (!callorreturnof_count) -> goto T1 :: (main().return==1) -> goto accept_T2 :: (global_argc>0 && callof_count) -> goto S1 fi; S1: if :: (callorreturnof_count) -> goto S1 :: (callof_sumOne) -> goto T1 fi; accept_T2: skip; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_recursion4.c0000666000000000000000000000146113571573400022315 0ustar /* run.config* OPT: -aorai-automata tests/aorai/test_recursion4.ya -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ # pragma JessieIntegerModel(math) /*@ requires \valid(t+(0..size-1)); @ requires size>=0; @ decreases size; @ ensures -1<=\result t[\result]==val; @ behavior notIn : @ ensures \result==-1 ==> (\forall integer i; 0<=i t[i]!=val); */ int isPresent(int t[], int size, int val) { if(size==0) return -1; if(t[0]==val) return 0; int r=1+isPresent(t+1, size-1, val); if (r==0) r=-1; return r; } void foo(){} int main(int argc, char** argv) { int tab[]={10,20,33,15}; int r=isPresent(tab, 4, 33); if (r==-1) foo(); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_recursion4.ya0000666000000000000000000000057613571573400022512 0ustar %init: Idle; %accept: End; Idle : { isPresent().return==-1 } -> WillDoFoo | { isPresent().return!=-1 } -> End | { ! RETURN(isPresent) } -> Idle ; WillDoFoo : { isPresent().return==-1 } -> WillDoFoo | { CALL(foo) } -> End; End : { !CALL(foo) && (!RETURN(isPresent) || isPresent().return!=-1) } -> End; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_recursion5.c0000666000000000000000000000252613571573400022321 0ustar /* run.config* OPT: -aorai-automata tests/aorai/test_recursion5.ya -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ //frama-c t2.c -aorai-automata t2.ya -aorai-dot -aorai-show-op-spec -aorai-output-c-file t2_annot.c //frama-c -jessie t2_annot.c -jessie-why-opt="-fast-wp" //#include /*@ requires \valid_range(t,0,max); @ requires max>=0; @ requires 0<=i<=max; @ decreases max-i; @ ensures i<=\result<=max || \result==-1 ; @ ensures i<=\result<=max ==> t[\result]==val; @ ensures \result==-1 ==> (\forall integer j; i<=j<=max ==> t[j]!=val); */ int isPresentRec(int t[], int i, int max, int val) { // printf("t : %d | s : %d | v : %d\n",t[0],size,val); if(t[i]==val) return i; if(max==i) return -1; // 1 de plus que max return isPresentRec(t, i+1, max, val); } /*@ requires \valid_range(t,0,max); @ requires max>=0; @ ensures 0<=\result<=max || \result==-1 ; @ ensures 0<=\result<=max ==> t[\result]==val; @ ensures \result==-1 ==> (\forall integer i; 0<=i<=max ==> t[i]!=val); */ int isPresent(int t[], int max, int val) { return isPresentRec(t, 0, max, val); } void foo(){} int main(int argc, char** argv) { int tab[]={10,20,33,15}; int r=isPresent(tab, 3, 33); if (r==-1) foo(); // printf("Résultat = %d\n",r); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_recursion5.ya0000666000000000000000000000104713571573400022505 0ustar %init: Idle; %accept: End; Idle : { isPresentRec().return==-1 } -> WillDoFoo | { isPresentRec().return!=-1 } -> IgnoreFoo | { ! RETURN(isPresentRec) } -> Idle ; IgnoreFoo : { isPresentRec().return!=-1 } -> IgnoreFoo | { isPresent().return!=-1 } -> End ; WillDoFoo : { isPresentRec().return==-1 } -> WillDoFoo | { isPresent().return==-1 } -> WillDoFoo | { CALL(foo) } -> End; End : { !CALL(foo) && !RETURN(isPresent) && !RETURN(isPresentRec) } -> End; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_struct.c0000666000000000000000000000061013571573400021537 0ustar /* run.config* OPT: -aorai-automata tests/aorai/test_struct.ya -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ struct People{ int Age; char Gender; }; struct People nobody; int myAge=0; void increment(){ nobody.Age++; myAge++; } int main() { nobody.Age=0; increment(); return 0; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_struct.ya0000666000000000000000000000016213571573400021730 0ustar %init: main; %accept: main, S1; main : { nobody.Age == 0 } -> S1 ; S1 : { nobody.Age == 1 } -> S1 ; frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_switch2.c0000666000000000000000000000102313571573400021575 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_switch2.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ int status=0; int rr=1; //@ global invariant inv : 0<=rr<=50; /*@ requires rr<50; @ behavior j : @ ensures rr<51; */ void opa() { rr++; } void opb () { status=1; } void opc() { rr=9000; } int main(){ switch (rr) { case 1 : opa(); break; case 3 : opa(); default : opc(); } opb(); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_switch2.ltl0000666000000000000000000000016313571573400022152 0ustar CALL(main) && _X_ (CALL(opa) && _X_ (!RETURN(opb) && _X_ (!CALL(opa) && _X_ (RETURN(opb) && _X_ (RETURN(main)))))) frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_switch3.c0000666000000000000000000000133413571573400021603 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_switch3.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /* Calcul de la longueur cumulee des chaines de caracteres prises en parametre */ /* Calcul de la longueur d'une chaine */ int countOne(char* argv) { int r=0; switch (argv[0]) { case 0: r=0; break; case 1: case 2: case 3: default: r++; r+=countOne(argv+1); } return r; } /* Somme de chacune des longueurs */ int count(int argc, char** argv) { if (argc>0) return countOne(argv[0])+count(argc-1,argv+1); return 0; } int main(int argc, char** argv) { int somme; somme=count(argc,argv); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_switch3.ltl0000666000000000000000000000013713571573400022154 0ustar _G_ ( CALL(count) => _X_ (CALL_OR_RETURN(countOne) _U_ (CALL_OR_RETURN(count))) ) frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_switch3_et_recursion.c0000666000000000000000000000160213571573400024362 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_switch3_et_recursion.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /* Calcul de la longueur cumulee des chaines de caracteres prises en parametre */ /* Calcul de la longueur d'une chaine */ int countOne(char* argv) { int r=0; switch (argv[0]) { case 0: r=0; // ICI il n'y a pas de break. C'est un bug, mais c'est un test ;) case 1: case 2: case 3: default: r++; r+=countOne(argv+1); } return r; } /* Somme de chacune des longueurs */ int count(int argc, char** argv) { // printf(" --> '%s'\n",argv[0]); if (argc>0) return countOne(argv[0])+count(argc-1,argv+1); return 0; } int main(int argc, char** argv) { int somme; somme=count(argc,argv); // printf("Longueur cumulee des params = %d\n",somme); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_switch3_et_recursion.ltl0000666000000000000000000000012713571573400024734 0ustar _G_ ( CALL(count) => _X_ (CALL_OR_RETURN(countOne) _U_ (RETURN(count))) ) frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_switch3_if.c0000666000000000000000000000123513571573400022261 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_switch3.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /* Calcul de la longueur cumulee des chaines de caracteres prises en parametre */ /* Calcul de la longueur d'une chaine */ int countOne(char* argv) { int r=0; if (argv[0]!=0) { r++; r+=countOne(argv+1); } return r; } /* Somme de chacune des longueurs */ int count(int argc, char** argv) { if (argc>0) return countOne(argv[0])+count(argc-1,argv+1); return 0; } int main(int argc, char** argv) { int somme; somme=count(argc,argv); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/aorai/test_switch3_return.c0000666000000000000000000000133213571573400023200 0ustar /* run.config* OPT: -aorai-ltl tests/aorai/test_switch3.ltl -aorai-test 1 -aorai-acceptance -load-module tests/aorai/Aorai_test.cmxs -aorai-test-number @PTEST_NUMBER@ @PROVE_OPTIONS@ */ /* Calcul de la longueur cumulee des chaines de caracteres prises en parametre */ /* Calcul de la longueur d'une chaine */ int countOne(char* argv) { int r=0; switch (argv[0]) { case 0: return 0; case 1: case 2: case 3: default: r++; r+=countOne(argv+1); } return r; } /* Somme de chacune des longueurs */ int count(int argc, char** argv) { if (argc>0) return countOne(argv[0])+count(argc-1,argv+1); return 0; } int main(int argc, char** argv) { int somme; somme=count(argc,argv); return 1; } frama-c-20.0-Calcium/src/plugins/aorai/tests/test_config0000666000000000000000000000002513571573400020144 0ustar MACRO: PROVE_OPTIONS frama-c-20.0-Calcium/src/plugins/aorai/tests/test_config_prove.in0000666000000000000000000000010113571573400021757 0ustar MACRO: PROVE_OPTIONS @AORAI_WP_SHARE@ -aorai-test-prove-aux-spec frama-c-20.0-Calcium/src/plugins/aorai/utils_parser.ml0000666000000000000000000000773613571573400017641 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let rec get_last_field my_field my_offset = match my_offset with | Cil_types.NoOffset -> my_field | Cil_types.Field(fieldinfo,the_offset) -> get_last_field fieldinfo the_offset | _ -> Aorai_option.fatal "NOT YET IMPLEMENTED : struct with array access." let rec add_offset father_offset new_offset = match father_offset with | Cil_types.NoOffset -> new_offset | Cil_types.Field(_,the_offset) -> (Cil.addOffset father_offset (add_offset the_offset new_offset)) | _ -> Aorai_option.fatal "NOT YET IMPLEMENTED : struct with array access." let rec get_field_info_from_name my_list name = if(List.length my_list <> 0) then begin let my_field = List.hd my_list in if(my_field.Cil_types.fname = name) then my_field else get_field_info_from_name (List.tl my_list) name end else Aorai_option.fatal "no field found with name :%s" name let get_new_offset my_host my_offset name= match my_host with | Cil_types.Var(var) -> let var_info = var in (* if my_offset is null no need to search the last field *) (* else we need to have the last *) let my_comp = if (my_offset = Cil_types.NoOffset) then match var_info.Cil_types.vtype with | Cil_types.TComp(mc,_,_) -> mc | _ -> assert false (*Cil_types.TComp(my_comp,_,_) = var_info.Cil_types.vtype in*) else begin let get_field_from_offset my_offset = begin match my_offset with | Cil_types.Field(fieldinfo,_) -> fieldinfo | _ -> Aorai_option.fatal "support only struct no array with struct" end in let field_info = get_field_from_offset my_offset in let last_field_offset = get_last_field field_info my_offset in (* last field in offset but not the field we want, for that we search in*) let mc = last_field_offset.Cil_types.fcomp in mc end in let field_info = get_field_info_from_name my_comp.Cil_types.cfields name in Cil_types.Field(field_info,Cil_types.NoOffset) | _ -> Aorai_option.fatal "NOT YET IMPLEMENTED : mem is not supported" frama-c-20.0-Calcium/src/plugins/aorai/yalexer.mll0000666000000000000000000001134313571573400016737 0ustar (**************************************************************************) (* *) (* This file is part of Aorai plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* INRIA (Institut National de Recherche en Informatique et en *) (* Automatique) *) (* INSA (Institut National des Sciences Appliquees) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* File yalexer.mll *) { open Yaparser open Lexing exception Eof let new_line lexbuf = let lcp = lexbuf.lex_curr_p in lexbuf.lex_curr_p <- { lcp with pos_lnum = lcp.pos_lnum + 1; pos_bol = lcp.pos_cnum; } ;; exception Error of (Lexing.position * Lexing.position) * string let loc lexbuf = (lexeme_start_p lexbuf, lexeme_end_p lexbuf) let raise_located loc e = raise (Error (loc, e)) } let num = ['0'-'9'] let alpha = ['a'-'z' 'A'-'Z'] let ident = alpha (num | alpha | '_')* let string = ([^ '"' '\\']|'\\'_)* rule token = parse [' ' '\t' ] { token lexbuf } (* skip blanks *) | '\n' { new_line lexbuf; token lexbuf } | ['0'-'9']+ as lxm { INT(lxm) } | "CALL" { CALL_OF } | "RETURN" { RETURN_OF } | "COR" { CALLORRETURN_OF } | "other" { OTHERWISE } | "true" { TRUE } | "false" { FALSE } | "\\result" as lxm { IDENTIFIER(lxm) } | ident as lxm { IDENTIFIER(lxm) } | ',' { COMMA } | '+' { PLUS } | '-' { MINUS } | '*' { STAR } | '/' { SLASH } | '%' { PERCENT } | '(' { LPAREN } | ')' { RPAREN } | '[' { LSQUARE } | ']' { RSQUARE } | '{' { LCURLY } | '}' { RCURLY } | "{{" { LBRACELBRACE } | "}}" { RBRACERBRACE } | '.' { DOT } | "->" { RARROW } | '&' { AMP } | '|' { PIPE } | "&&" { AND } | "||" { OR } | '!' { NOT } | "<" { LT } | ">" { GT } | "<=" { LE } | ">=" { GE } | "==" { EQ } | "!=" { NEQ } | ';' { SEMI_COLON } | ':' { COLON } | "::" { COLUMNCOLUMN } | '^' { CARET } | '?' { QUESTION } | eof { EOF } | _ { raise_located (loc lexbuf) "Unknown token" } { let parse c = let lb = from_channel c in try Yaparser.main token lb with Parsing.Parse_error | Invalid_argument _ -> (* [VP]: Does not contain more information than what is in the exn. *) (*let (a,b)=(loc lb) in Format.print_string "Syntax error (" ; Format.print_string "l" ; Format.print_int a.pos_lnum ; Format.print_string "c" ; Format.print_int (a.pos_cnum-a.pos_bol) ; Format.print_string " -> l" ; Format.print_int b.pos_lnum ; Format.print_string "c" ; Format.print_int (b.pos_cnum-b.pos_bol) ; Format.print_string ")\n" ; *) raise_located (loc lb) "Syntax error" } frama-c-20.0-Calcium/src/plugins/aorai/yaparser.mly0000666000000000000000000002610313571573400017131 0ustar /**************************************************************************/ /* */ /* This file is part of Aorai plug-in of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* INRIA (Institut National de Recherche en Informatique et en */ /* Automatique) */ /* INSA (Institut National des Sciences Appliquees) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /* $Id: promelaparser_withexps.mly,v 1.2 2008-10-02 13:33:29 uid588 Exp $ */ /* Originated from http://www.ltl2dstar.de/down/ltl2dstar-0.4.2.zip */ %{ open Logic_ptree open Promelaast open Bool3 let to_seq c = [{ condition = Some c; nested = []; min_rep = Some Data_for_aorai.cst_one; max_rep = Some Data_for_aorai.cst_one; }] let is_no_repet (min,max) = let is_one c = Extlib.may_map Data_for_aorai.is_cst_one ~dft:false c in is_one min && is_one max let observed_states = Hashtbl.create 1 let prefetched_states = Hashtbl.create 1 let fetch_and_create_state name = Hashtbl.remove prefetched_states name ; try Hashtbl.find observed_states name with Not_found -> let s = Data_for_aorai.new_state name in Hashtbl.add observed_states name s; s ;; let prefetch_and_create_state name = if (Hashtbl.mem prefetched_states name) || not (Hashtbl.mem observed_states name) then begin let s= fetch_and_create_state name in Hashtbl.add prefetched_states name name; s end else (fetch_and_create_state name) ;; type pre_cond = Behavior of string | Pre of Promelaast.condition %} %token CALL_OF RETURN_OF CALLORRETURN_OF %token IDENTIFIER %token INT %token LCURLY RCURLY LPAREN RPAREN LSQUARE RSQUARE LBRACELBRACE RBRACERBRACE %token RARROW %token TRUE FALSE %token NOT DOT AMP %token COLON SEMI_COLON COMMA PIPE CARET QUESTION COMMA COLUMNCOLUMN %token EQ LT GT LE GE NEQ PLUS MINUS SLASH STAR PERCENT OR AND %token OTHERWISE %token EOF %nonassoc highest %left LPAREN RPAREN %left LCURLY %right EQ LT GT LE GE NEQ PLUS MINUS SLASH STAR PERCENT OR AND /* [VP] priorities taken from cparser.mly */ %left LSQUARE RSQUARE %left DOT %nonassoc NOT TRUE FALSE %nonassoc QUESTION %right SEMICOLON %nonassoc lowest %type main %start main %% main : options states { List.iter (fun(key, ids) -> match key with "init" -> List.iter (fun id -> try (Hashtbl.find observed_states id).init <- True with Not_found -> Aorai_option.abort "Error: no state '%s'\n" id) ids | "accept" -> List.iter (fun id -> try (Hashtbl.find observed_states id).acceptation <- True with Not_found -> Aorai_option.abort "no state '%s'\n" id) ids | "deterministic" -> Aorai_option.Deterministic.set true; | oth -> Aorai_option.abort "unknown option '%s'\n" oth ) $1; let states= Hashtbl.fold (fun _ st l -> if st.acceptation=Undefined || st.init=Undefined then begin Aorai_option.abort "Error: the state '%s' is used but never defined.\n" st.name end; st::l) observed_states [] in (try Hashtbl.iter (fun _ st -> if st.init=True then raise Exit) observed_states; Aorai_option.abort "Automaton does not declare an initial state" with Exit -> ()); if Hashtbl.length prefetched_states >0 then begin let r = Hashtbl.fold (fun s n _ -> s^"Error: the state '"^n^"' is used but never defined.\n") prefetched_states "" in Aorai_option.abort "%s" r end; (states, $2) } ; options : options option { $1@[$2] } | option { [$1] } ; option : PERCENT IDENTIFIER opt_identifiers SEMI_COLON { ($2, $3) } ; opt_identifiers : /* empty */ { [] } | COLON id_list { $2 } ; id_list : id_list COMMA IDENTIFIER { $1@[$3] } | IDENTIFIER { [$1] } ; states : states state { $1@$2 } | state { $1 } ; state : IDENTIFIER COLON transitions SEMI_COLON { let start_state = fetch_and_create_state $1 in let (_, transitions) = List.fold_left (fun (otherwise, transitions) (cross,stop_state) -> if otherwise then Aorai_option.abort "'other' directive in definition of %s \ transitions is not the last one" start_state.name else begin let trans = { start=start_state; stop=stop_state; cross=cross; numt=(-1) }::transitions in let otherwise = match cross with | Otherwise -> true | Seq _ -> false in otherwise, trans end) (false,[]) $3 in List.rev transitions } transitions /*=> [transition; ...] */ : transitions PIPE transition { $1@[$3] } | transition { [$1] } ; transition: /*=> (guard, state) */ | LCURLY seq_elt RCURLY RARROW IDENTIFIER { (Seq $2, prefetch_and_create_state $5) } | OTHERWISE RARROW IDENTIFIER {(Otherwise, prefetch_and_create_state $3) } | RARROW IDENTIFIER { (Seq (to_seq PTrue), prefetch_and_create_state $2) } ; non_empty_seq: | seq_elt { $1 } | seq_elt SEMI_COLON seq { $1 @ $3 } ; seq: | /* epsilon */ { [] } | non_empty_seq { $1 } ; guard: | single_cond { to_seq $1 } | LSQUARE non_empty_seq RSQUARE { $2 } | IDENTIFIER pre_cond LPAREN seq RPAREN post_cond { let pre_cond = match $2 with | Behavior b -> PCall($1,Some b) | Pre c -> PAnd (PCall($1,None), c) in let post_cond = match $6 with | None -> PReturn $1 | Some c -> PAnd (PReturn $1,c) in (to_seq pre_cond) @ $4 @ to_seq post_cond } | IDENTIFIER LPAREN non_empty_seq RPAREN post_cond { let post_cond = match $5 with | None -> PReturn $1 | Some c -> PAnd (PReturn $1,c) in (to_seq (PCall ($1, None))) @ $3 @ to_seq post_cond } | IDENTIFIER LPAREN RPAREN post_cond { let post_cond = match $4 with | None -> PReturn $1 | Some c -> PAnd (PReturn $1,c) in (to_seq (PCall ($1, None))) @ to_seq post_cond } ; pre_cond: | COLUMNCOLUMN IDENTIFIER { Behavior $2 } | LBRACELBRACE single_cond RBRACERBRACE { Pre $2 } ; post_cond: | /* epsilon */ { None } | LBRACELBRACE single_cond RBRACERBRACE { Some $2 } ; seq_elt: | guard repetition { let min, max = $2 in match $1 with | [ s ] when Data_for_aorai.is_single s -> [ { s with min_rep = min; max_rep = max } ] | l -> if is_no_repet (min,max) then l (* [ a; [b;c]; d] is equivalent to [a;b;c;d] *) else [ { condition = None; nested = l; min_rep = min; max_rep = max } ] } ; repetition: | /* empty */ %prec highest { Some Data_for_aorai.cst_one, Some Data_for_aorai.cst_one } | PLUS { Some Data_for_aorai.cst_one, None} | STAR { None, None } | QUESTION { None, Some Data_for_aorai.cst_one } | LCURLY arith_relation COMMA arith_relation RCURLY { Some $2, Some $4 } | LCURLY arith_relation RCURLY { Some $2, Some $2 } | LCURLY arith_relation COMMA RCURLY { Some $2, None } | LCURLY COMMA arith_relation RCURLY { None, Some $3 } single_cond: | CALLORRETURN_OF LPAREN IDENTIFIER RPAREN { POr (PCall ($3,None), PReturn $3) } | CALL_OF LPAREN IDENTIFIER RPAREN { PCall ($3,None) } | RETURN_OF LPAREN IDENTIFIER RPAREN { PReturn $3 } | TRUE { PTrue } | FALSE { PFalse } | NOT single_cond { PNot $2 } | single_cond AND single_cond { PAnd ($1,$3) } | single_cond OR single_cond { POr ($1,$3) } | LPAREN single_cond RPAREN { $2 } | logic_relation { $1 } ; logic_relation : arith_relation EQ arith_relation { PRel(Eq, $1, $3) } | arith_relation LT arith_relation { PRel(Lt, $1, $3) } | arith_relation GT arith_relation { PRel(Gt, $1, $3) } | arith_relation LE arith_relation { PRel(Le, $1, $3) } | arith_relation GE arith_relation { PRel(Ge, $1, $3) } | arith_relation NEQ arith_relation { PRel(Neq, $1, $3) } | arith_relation %prec TRUE { PRel (Neq, $1, PCst(IntConstant "0")) } ; arith_relation : arith_relation_mul PLUS arith_relation { PBinop(Badd,$1,$3) } | arith_relation_mul MINUS arith_relation { PBinop(Bsub,$1,$3) } | arith_relation_mul %prec highest { $1 } ; arith_relation_mul : arith_relation_mul SLASH access_or_const { PBinop(Bdiv,$1,$3) } | arith_relation_mul STAR access_or_const { PBinop(Bmul, $1, $3) } | arith_relation_mul PERCENT access_or_const { PBinop(Bmod, $1, $3) } | arith_relation_bw %prec highest { $1 } ; arith_relation_bw : access_or_const %prec highest { $1 } | arith_relation_bw AMP access_or_const { PBinop(Bbw_and,$1,$3) } | arith_relation_bw PIPE access_or_const { PBinop(Bbw_or,$1,$3) } | arith_relation_bw CARET access_or_const { PBinop(Bbw_xor,$1,$3) } /* returns a Lval exp or a Const exp*/ access_or_const : INT { PCst (IntConstant $1) } | MINUS INT { PUnop (Uminus, PCst (IntConstant $2)) } | access %prec TRUE { $1 } | LPAREN arith_relation RPAREN { $2 } ; /* returns a lval */ access : access DOT IDENTIFIER { PField($1,$3) } | access LSQUARE access_or_const RSQUARE { PArrget($1,$3) } | access_leaf {$1} ; access_leaf : STAR access { PUnop (Ustar,$2) } | IDENTIFIER LPAREN RPAREN DOT IDENTIFIER { PPrm($1,$5) } | IDENTIFIER { PVar $1 } | LPAREN access RPAREN { $2 } ; frama-c-20.0-Calcium/src/plugins/callgraph/0000777000000000000000000000000013571573400015420 5ustar frama-c-20.0-Calcium/src/plugins/callgraph/Callgraph.mli0000666000000000000000000000422513571573400020023 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Callgraph plugin. *) module Options: sig module Filename: Parameter_sig.String module Service_roots: Parameter_sig.Kernel_function_set module Uncalled: Parameter_sig.Bool module Uncalled_leaf: Parameter_sig.Bool module Services: Parameter_sig.Bool end module Cg: module type of Cg (** The callgraph itself *) module Services: module type of Services (** The graph of services built on top of the callgraph *) module Uses: module type of Uses (** Several useful functions over the callgraph *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/callgraph_api.mli0000666000000000000000000000534213571573400020715 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Callgraph API *) module type Graph = sig module G: Graph.Sig.G (** The underlying graph datastructure *) val compute: unit -> unit (** Compute the graph *) val get: unit -> G.t (** Get the graph from the AST. *) module Subgraph: sig val get: unit -> G.t end (** Subgraph of [get ()] wrt [Options.Roots.get ()] *) val dump: unit -> unit (** Dump the (possibly sub-)graph in the file of the corresponding command line argument. *) val is_computed: unit -> bool (** Is the graph already built? *) val self: State.t end (** Signature for a callgraph. Each edge is labeled by the callsite. Its source is the caller, while the destination is the callee. *) module type S = Graph with type G.V.t = Kernel_function.t and type G.E.label = Cil_types.stmt (** Signature for a graph of services *) module type Services = sig include Graph with type G.V.t = Kernel_function.t Service_graph.vertex and type G.E.label = Service_graph.edge val entry_point: unit -> G.V.t option val is_root: Kernel_function.t -> bool end (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/cg.ml0000666000000000000000000002323213571573400016345 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* Kernel functions with a custom function [compare] independent of vids. So the callgraph and its iterations are independent from the vids generator and is only dependent of the analyzed program itself. *) module Kf_sorted = struct type t = Kernel_function.t let equal = Kernel_function.equal let hash kf = Hashtbl.hash (Kernel_function.get_name kf) let compare kf1 kf2 = if kf1 == kf2 then 0 else let res = String.compare (Kernel_function.get_name kf1) (Kernel_function.get_name kf2) in if res <> 0 then res else (* Backup solution, will compare underlying varinfos ids *) Kernel_function.compare kf1 kf2 end module G = Graph.Imperative.Digraph.ConcreteBidirectionalLabeled (Kf_sorted) (struct include Cil_datatype.Stmt let default = Cil.dummyStmt end) module D = Datatype.Make(struct type t = G.t let name = "Callgraph.Cg" let reprs = [ G.create () ] include Datatype.Serializable_undefined let mem_project = Datatype.never_any_project end) (* State for the callgraph *) module State = State_builder.Option_ref (D) (struct let name = "Callgraph.Cg" let dependencies = [ Db.Value.self; Globals.Functions.self ] end) let self = State.self let is_computed () = State.is_computed () (** @return the list of functions which address is taken.*) let get_pointed_kfs = (* memoized result *) let res = ref None in fun () -> let compute () = if Options.Function_pointers.get () then let l = ref [] in let o = object inherit Visitor.frama_c_inplace method !vexpr e = match e.enode with | AddrOf (Var vi, NoOffset) when Cil.isFunctionType vi.vtype -> (* function pointer *) let kf = try Globals.Functions.get vi with Not_found -> assert false in l := kf :: !l; Cil.SkipChildren | _ -> Cil.DoChildren end in Visitor.visitFramacFileSameGlobals o (Ast.get ()); !l else (* ignore function pointers when the option is off *) [] in match !res with | None -> let l = compute () in State.mark_as_computed (); res := Some l; l | Some l -> l let is_entry_point kf = try let main, _ = Globals.entry_point () in Kernel_function.equal kf main with Globals.No_such_entry_point _ -> false (* complexity = O(number of statements); approximate function pointers to the set of functions which address is taken *) let syntactic_compute g = let o = object (self) inherit Visitor.frama_c_inplace (* add only-declared functions into the graph *) method !vvdec vi = try let kf = Globals.Functions.get vi in if Kernel_function.is_definition kf then Cil.DoChildren else begin G.add_vertex g kf; Cil.SkipChildren end with Not_found -> Cil.SkipChildren (* add defined functions into the graph *) method !vfunc _f = G.add_vertex g (Extlib.the self#current_kf); Cil.DoChildren (* add edges from callers to callees into the graph *) method !vinst = function | Call(_, { enode = Lval(Var vi, NoOffset) }, _, _) -> (* direct function call *) let callee = try Globals.Functions.get vi with Not_found -> assert false in let caller = Extlib.the self#current_kf in G.add_edge_e g (caller, Extlib.the self#current_stmt, callee); Cil.SkipChildren | Call _ -> (* call via a function pointer: add an edge from each function which the address is taken to this callee. *) let pointed = get_pointed_kfs () in let caller = Extlib.the self#current_kf in List.iter (fun callee -> G.add_edge_e g (caller, Extlib.the self#current_stmt, callee)) pointed; Cil.SkipChildren | Local_init (_,ConsInit(v,_,_),_) -> let callee = try Globals.Functions.get v with Not_found -> assert false in let caller = Extlib.the self#current_kf in G.add_edge_e g (caller, Extlib.the self#current_stmt, callee); Cil.SkipChildren | Local_init (_, AssignInit _, _) | Set _ | Skip _ | Asm _ | Code_annot _ -> (* skip children for efficiency *) Cil.SkipChildren (* for efficiency purpose, skip many items *) method !vexpr _ = Cil.SkipChildren method !vtype _ = Cil.SkipChildren method !vannotation _ = Cil.SkipChildren method !vcode_annot _ = Cil.SkipChildren method !vbehavior _ = Cil.SkipChildren end in Visitor.visitFramacFileSameGlobals o (Ast.get ()); (* now remove the potential irrelevant nodes wrt selected options *) if not (Options.Uncalled.get () && Options.Uncalled_leaf.get ()) then G.iter_vertex (fun kf -> let has_pred = try G.iter_pred (fun _ -> raise Exit) g kf; false with Exit -> true in if not (has_pred (* no caller *) || is_entry_point kf) then let must_kept = Options.Uncalled.get () (* uncalled functions must be kept *) && (Options.Uncalled_leaf.get () (* uncalled leaf must be kept *) || Kernel_function.is_definition kf (* [kf] is a leaf *)) in if not must_kept then G.remove_vertex g kf) g (* complexity = O(number of function calls); approximate function pointers as computed by [Value]. *) let semantic_compute g = Globals.Functions.iter (fun kf -> let callers = !Db.Value.callers kf in let must_add = callers <> [] (* the function is called *) || is_entry_point kf || (Options.Uncalled.get () (* uncalled functions must be added *) && (Options.Uncalled_leaf.get () (* uncalled leaf must be added *) || Kernel_function.is_definition kf) (* [kf] is not a leaf *)) in if must_add then begin G.add_vertex g kf; List.iter (fun (caller, callsites) -> List.iter (fun stmt -> G.add_edge_e g (caller, stmt, kf)) callsites) callers end) let compute () = let g = G.create () in (* optimize with [Value] when either it is already computed or someone requires it anyway *) if Dynamic.Parameter.Bool.get "-eva" () then begin !Db.Value.compute (); semantic_compute g end else (if Db.Value.is_computed () then semantic_compute else syntactic_compute) g; g let get () = State.memo compute let compute () = ignore (compute ()) module Graphviz_attributes = struct include G (* We rewrite [iter_edges_e] so that multiple calls to the same function from the same caller do not give rise to multi-edges. *) let iter_edges_e iter g = let aux_e v = (* This comparison function ignores the statement (as we want to coalesce all call sites together). The first element of the triple is always [v], so it can also be ignored. *) let comp_e (_, _, kf1) (_, _, kf2) = Kf_sorted.compare kf1 kf2 in let uniq_e = List.sort_uniq comp_e (G.succ_e g v) in List.iter iter uniq_e in G.iter_vertex aux_e g let graph_attributes _ = [ `Ratio (`Float 0.5) ] let vertex_name = Kernel_function.get_name let vertex_attributes kf = [ `Style (if Kernel_function.is_definition kf then `Bold else `Dotted) ] let edge_attributes _ = [] let default_vertex_attributes _ = [] let default_edge_attributes _ = [] let get_subgraph _ = None end module Subgraph = Subgraph.Make (G) (D) (struct let self = State.self let name = State.name let get = get let vertex kf = kf end) let dump () = let module GV = Graph.Graphviz.Dot(Graphviz_attributes) in let g = Subgraph.get () in Options.dump GV.output_graph g include Journalize.Make (struct let name = "Cg" let dump = dump let compute = compute type t = G.t let ty = D.ty let get = get end) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/cg.mli0000666000000000000000000000346713571573400016526 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Callgraph_api.S module Graphviz_attributes: Graph.Graphviz.GraphWithDotAttrs with type t = G.t and type V.t = Kernel_function.t and type E.t = G.E.t (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/cg_viewer.ml0000666000000000000000000002275013571573400017732 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Dgraph let ($) f x = f x type service_id = int module Service_view = DGraphContainer.Make(Services.Graphviz_attributes) class ['v, 'e, 'c] services_view view = object (self) val services: (service_id, bool ref * Services.G.V.t DGraphViewItem.view_item list ref) Hashtbl.t = Hashtbl.create 10 method is_root (n:'v DGraphViewItem.view_item) = n#item.Service_graph.is_root method is_deployed id = try !(fst (Hashtbl.find services id)) with Not_found -> assert false method edge_kind (e: 'e DGraphViewItem.view_item) = Services.G.E.label e#item method deploy node = assert (self#is_root node); let service = self#service node in let deployed, nodes = Hashtbl.find services service in assert (not !deployed); deployed := true; (* iterating on nodes of the current service *) List.iter (fun n -> n#compute (); if not (self#is_root n) then n#show (); view#iter_succ_e (fun e -> match self#edge_kind e with | Service_graph.Inter_functions | Service_graph.Both -> e#compute (); e#show () | Service_graph.Inter_services -> e#hide ()) n) !nodes method undeploy node = assert (self#is_root node); let service = self#service node in let deployed, nodes = Hashtbl.find services service in assert !deployed; deployed := false; (* iterating on nodes of the current service *) List.iter (fun n -> if not (self#is_root n) then n#hide (); view#iter_succ_e (fun e -> match self#edge_kind e with | Service_graph.Inter_services | Service_graph.Both -> e#show () | Service_graph.Inter_functions -> e#hide ()) n) !nodes method service n = Kernel_function.get_id n#item.Service_graph.root.Service_graph.node initializer let add_in_service n s = try let _, nodes = Hashtbl.find services s in nodes := n :: !nodes with Not_found -> Hashtbl.add services s (ref false, ref [ n ]) in let connect_trigger_to_node n = let callback = function | `BUTTON_PRESS _ -> if self#is_deployed (self#service n) then self#undeploy n else self#deploy n; false | _ -> false in n#connect_event ~callback in view#iter_nodes (fun n -> add_in_service n (self#service n); if self#is_root n then connect_trigger_to_node n else n#hide ()); view#iter_edges_e (fun e -> match self#edge_kind e with | Service_graph.Inter_services | Service_graph.Both -> e#show () | Service_graph.Inter_functions -> e#hide ()) end (* Constructor copied from dGraphView *) let services_view model = let delay_node v = not v.Service_graph.is_root in let delay_edge e = match Services.G.E.label e with | Service_graph.Inter_services | Service_graph.Both -> false | Service_graph.Inter_functions -> true in let view = Service_view.GView.view ~aa:true ~delay_node ~delay_edge model in view#set_zoom_padding 0.025; (* not very nice *) ignore (new services_view view); view#connect_highlighting_event (); ignore $ view#set_center_scroll_region true; view let make_service_view ~packing () = let _, view = Service_view.from_graph_with_commands ~packing ?root:(Services.entry_point ()) ~mk_global_view:services_view (Services.Subgraph.get ()) in view module Cg_view = DGraphContainer.Make(Cg.Graphviz_attributes) let make_cg_view ?root ~packing (): Cg_view.view_container = let _, view = Cg_view.from_graph_with_commands ~packing ?root (Cg.Subgraph.get ()) in view (* note: root is only used when services are not computed *) let make_graph_view ?root services ~packing () = if services then (make_service_view ~packing () :> unit>) else (make_cg_view ?root ~packing () :> unit >) let has_entry_point () = try ignore (Globals.entry_point ()); true with Globals.No_such_entry_point _ -> false let can_show_service_graph () = has_entry_point () && Options.Service_roots.is_empty () let get_current_function () = match History.get_current () with | Some (History.Global (Cil_types.GFunDecl (_, vi, _))) | Some (History.Global (Cil_types.GFun ({Cil_types.svar = vi}, _))) -> let kf = try Globals.Functions.get vi with Not_found -> Options.fatal "no kf for %a" Printer.pp_varinfo vi in if Kernel_function.is_definition kf then Some kf else None | Some (History.Localizable l) -> Pretty_source.kf_of_localizable l | _ -> None let warn_degrade reason = GToolbox.message_box ~title:"Warning" ("Services cannot be displayed due to " ^ reason ^ ".\n\ View degraded to non-service graph.\n\ (use -cg-no-services to avoid this warning)") exception Found_vertex of bool let main (window: Design.main_window_extension_points) = ignore ((window#menu_manager ())#add_plugin [ Menu_manager.menubar "Show entire callgraph" (Menu_manager.Unit_callback (fun () -> (* note: if there is no entry point, or if the set of service roots is not empty, we must 'degrade' the view and show a non-service graph *) let services, warn = if Options.Services.get () then let degrade = not (can_show_service_graph ()) in not degrade, degrade else false, false in try (* display the callgraph through its dot output *) Service_graph.frama_c_display true; Dgraph_helper.graph_window ~parent:window#main_window ~title:"Callgraph" (make_graph_view services); if warn then warn_degrade (if not (has_entry_point ()) then "absence of entry point" else "set of service roots being non-empty") with ex -> GToolbox.message_box ~title:"Error" ("Error loading callgraph: " ^ (Printexc.to_string ex)) )); Menu_manager.menubar "Show callgraph from current function" ~sensitive:(fun () -> get_current_function () <> None) (Menu_manager.Unit_callback (fun () -> match get_current_function () with | None -> GToolbox.message_box ~title:"Error" "Error: no current function" | Some kf -> try (* save old value, to restore it later *) let old_roots = Options.Roots.get () in Options.Roots.set (Kernel_function.Set.singleton kf); let services, warn = if Options.Services.get () && can_show_service_graph () then begin ignore (Services.Subgraph.get ()); (* compute subgraph *) let is_root = Services.is_root kf in is_root, not is_root end else false, false in Service_graph.frama_c_display true; Dgraph_helper.graph_window ~parent:window#main_window ~title:"Callgraph" (make_graph_view ~root:kf services); (* restore old value *) Options.Roots.set old_roots; if warn then warn_degrade "node not being a service root" with ex -> GToolbox.message_box ~title:"Error" ("Error loading callgraph: " ^ (Printexc.to_string ex)) )) ]) let () = Design.register_extension main (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/journalize.ml0000666000000000000000000000420413571573400020134 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Make (C: sig val name: string val dump: unit -> unit val compute: unit -> unit type t val ty: t Type.t val get: unit -> t end) = struct let name = "Callgraph." ^ C.name let unit_unit = Datatype.func Datatype.unit Datatype.unit let dump = Journal.register (name ^ ".dump") unit_unit C.dump let compute = Journal.register (name ^ ".compute") unit_unit C.compute let get = Journal.register (name ^ ".get") (Datatype.func Datatype.unit C.ty) C.get end (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/journalize.mli0000666000000000000000000000366413571573400020316 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Journalize the API of a callgraph *) module Make (C: sig val name: string val dump: unit -> unit val compute: unit -> unit type t val ty: t Type.t val get: unit -> t end): sig val dump: unit -> unit val compute: unit -> unit val get: unit -> C.t end (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/options.ml0000666000000000000000000001010713571573400017444 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let name = "callgraph" include Plugin.Register (struct let name = name let shortname = "cg" let help = "automatically compute the callgraph of the program. \ Using Eva might improve the precision of this plug-in" end) module Filename = Empty_string (struct let option_name = "-cg" let arg_name = "filename" let help = "dump the callgraph to the file \ in dot format" end) module Services = True (struct let option_name = "-cg-services" let help = "compute and display services (groups of related \ functions which seem to provide common functionalities) \ from the callgraph" end) module Roots = Kernel_function_set (struct let option_name = "-cg-roots" let arg_name = "" let help = "if not empty, display only the functions of the callgraph \ reachable from the given functions" end) module Service_roots = Kernel_function_set (struct let option_name = "-cg-service-roots" let arg_name = "" let help = "when computing callgraph services (see " ^ Services.option_name ^ "), use the given functions (and their immediate children) \ as service roots. If none, use the main function if any; \ else use every uncalled function" end) module Function_pointers = True (struct let option_name = "-cg-function-pointers" let help = "when Eva has not been computed, safely over-approximate \ callees in presence of function pointers; \ always done when Eva has been previously computed." end) module Uncalled = True (struct let option_name = "-cg-uncalled" let help = "add the uncalled functions to the callgraph \ (the main function is always added anyway)" end) module Uncalled_leaf = False (struct let option_name = "-cg-uncalled-leaf" let help = "add to the callgraph the uncalled functions that, \ themselves, do not call any function" end) let dump output g = let file = Filename.get () in feedback ~level:2 "dumping the graph into file %s" file; try let cout = open_out file in output cout g; close_out cout with e -> error "error while dumping the syntactic callgraph: %s" (Printexc.to_string e) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/options.mli0000666000000000000000000000413713571573400017623 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S val name: string module Filename: Parameter_sig.String module Roots: Parameter_sig.Kernel_function_set module Service_roots: Parameter_sig.Kernel_function_set module Function_pointers: Parameter_sig.Bool module Uncalled: Parameter_sig.Bool module Uncalled_leaf: Parameter_sig.Bool module Services: Parameter_sig.Bool val dump: (out_channel -> 'a -> unit) -> 'a -> unit (** dump the given value into [Filename.get ()] by using [output] *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/register.ml0000666000000000000000000000361413571573400017602 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let main () = if Options.Filename.get () <> "" then if Options.Services.get () then begin if not (Services.is_computed ()) then Services.dump () end else if not (Cg.is_computed ()) then Cg.dump () let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/services.ml0000666000000000000000000001060213571573400017574 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let initial_service_roots cg = let roots = Options.Service_roots.get () in let roots = if Kernel_function.Set.is_empty roots then (* if possible, use the main function as initial root *) try Kernel_function.Set.singleton (fst (Globals.entry_point ())) with Globals.No_such_entry_point _ -> (* otherwise use every uncalled function *) Cg.G.fold_vertex (fun v set -> if Cg.G.in_degree cg v = 0 then Kernel_function.Set.add v set else set) cg Kernel_function.Set.empty else roots in (* Add the callees of initial roots as roots *) Kernel_function.Set.fold (fun v set -> Cg.G.fold_succ Kernel_function.Set.add cg v set) roots roots (* Intermediate module because of Ocaml: "The parameter cannot be eliminated in the result type. Please bind the argument to a module identifier." *) module G_for_S = struct let datatype_name = "Callgraph.Cg" module V = struct include Cg.G.V let id = Kernel_function.get_id let name = Kernel_function.get_name let attributes = Cg.Graphviz_attributes.vertex_attributes let entry_point () = try Some (fst (Globals.entry_point ())) with Globals.No_such_entry_point _ -> None end include (Cg.G: Graph.Sig.G with module V := V and type t = Cg.G.t) end module S = Service_graph.Make(G_for_S) module G = S.Service_graph module Graphviz_attributes = S.TP let entry_point = S.entry_point let is_root kf = (S.vertex kf).Service_graph.is_root module State = State_builder.Option_ref (S.Service_graph.Datatype) (struct let name = "Callgraph.Services" let dependencies = [ Cg.self; Kernel.MainFunction.self ] end) (* eta-expansion required to mask optional argument [?project] *) let is_computed () = State.is_computed () let self = State.self let compute () = let cg = Cg.get () in let isr = initial_service_roots cg in let isr_names = Kernel_function.Set.fold (fun kf acc -> Datatype.String.Set.add (Kernel_function.get_name kf) acc) isr Datatype.String.Set.empty in let sg = S.compute cg isr_names in State.mark_as_computed (); sg let get () = State.memo compute let compute () = ignore (compute ()) module Subgraph = Subgraph.Make (G) (S.Service_graph.Datatype) (struct let self = State.self let name = State.name let get = get let vertex = S.vertex end) let dump () = let sg = Subgraph.get () in Service_graph.frama_c_display false; Options.dump S.output_graph sg include Journalize.Make (struct let name = "Services" let dump = dump let compute = compute type t = S.Service_graph.t let ty = S.Service_graph.Datatype.ty let get = get end) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/services.mli0000666000000000000000000000352613571573400017754 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Callgraph_api.Services module Graphviz_attributes: Graph.Graphviz.GraphWithDotAttrs with type t = G.t and type V.t = Kernel_function.t Service_graph.vertex and type E.t = G.E.t (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/subgraph.ml0000666000000000000000000000622313571573400017570 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Make (G: sig include Graph.Sig.G val create: ?size:int -> unit -> t val add_edge_e: t -> E.t -> unit end) (D: Datatype.S with type t = G.t) (Info: sig val self: State.t val name: string val get: unit -> G.t val vertex: Kernel_function.t -> G.V.t end) = struct module S = State_builder.Option_ref (Datatype.Option(D)) (* none if no root is specified *) (struct let name = "Subgraph of " ^ Info.name let dependencies = [ Info.self; Options.Roots.self ] end) let self = S.self let compute = let module HNodes = Hashtbl.Make(G.V) in fun () -> let g = Info.get () in let roots = Options.Roots.get () in if Kernel_function.Set.is_empty roots then None else let subg = G.create () in let visited = HNodes.create 17 in let rec add_component v = (* iter over the connected component of [v] for adding every edge to the subgraph *) if not (HNodes.mem visited v) then begin HNodes.add visited v (); G.iter_succ_e (fun e -> G.add_edge_e subg e; add_component (G.E.dst e)) g v end in Kernel_function.Set.iter (fun kf -> add_component (Info.vertex kf)) roots; Some subg let get () = match S.memo compute with | None -> Info.get () (* when no root is specified, use the whole graph *) | Some g -> g end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/subgraph.mli0000666000000000000000000000421013571573400017733 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Subgraph from a given vertex *) module Make (G: sig (** Graph datastructure *) include Graph.Sig.G val create: ?size:int -> unit -> t val add_edge_e: t -> E.t -> unit end) (D: Datatype.S with type t = G.t (** Graph datatype *)) (Info: sig (** additional information *) val self: State.t val name: string (** name of the state *) val get: unit -> G.t val vertex: Kernel_function.t -> G.V.t end) : sig val get: unit -> G.t val self: State.t end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/uses.ml0000666000000000000000000001133013571573400016727 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************** *) (* Topological iterators *) (* ************************************************************************** *) module Make (G:Graph.Sig.G with type V.t = Kernel_function.t) (N:sig val name: string end) = struct (* Topological iterations are memoized in order to improve efficiency when calling them several times. This has been proved to have a significant impact in practice. *) module S = State_builder.Queue (Kernel_function) (struct let name = "Callgraph.Uses" ^ N.name let dependencies = [ Cg.self ] end) module T = Graph.Topological.Make_stable(G) let iter g f = (* Warns if [-cg-no-function-pointers] is in effect, which may lead to unsound analyses for the users of the callgraph. *) if not (Options.Function_pointers.get ()) then Options.warning ~once:true "using callgraph while option %s is unset, \ result may be unsound" Options.Function_pointers.name; if S.is_empty () then T.iter S.add g; S.iter f end let iter_in_order = let module I = Make(Cg.G)(struct let name = "iter_in_order" end) in fun f -> I.iter (Cg.get ()) f let iter_in_rev_order = let module I = Make (struct include Cg.G (* inverse operations over successors required by [Graph.Topological.G] *) let iter_succ = iter_pred let in_degree = out_degree end) (struct let name = "iter_in_rev_order" end) in fun f -> I.iter (Cg.get ()) f let iter_on_aux iter_dir f kf = let cg = Cg.get () in if Cg.G.mem_vertex cg kf then let visited = Kernel_function.Hashtbl.create 17 in let rec aux kf = iter_dir (fun kf' -> if not (Kernel_function.Hashtbl.mem visited kf') then begin f kf'; Kernel_function.Hashtbl.add visited kf' (); aux kf' end) cg kf in aux kf let iter_on_callers = iter_on_aux Cg.G.iter_pred let iter_on_callees = iter_on_aux Cg.G.iter_succ let is_local_or_formal_of_caller v kf = try iter_on_callers (fun caller -> if Base.is_formal_or_local v (Kernel_function.get_definition caller) then raise Exit) kf; false with Exit -> true let accept_base ~with_formals ~with_locals kf v = let open Cil_types in Base.is_global v || (match with_formals, with_locals, kf.fundec with | false, false, _ | false, _, Declaration _ -> false | true, false, Definition (fundec,_) -> Base.is_formal v fundec | false, true, Definition (fundec, _) -> Base.is_local v fundec | true, true, Definition (fundec, _) -> Base.is_formal_or_local v fundec | true , _, Declaration (_, vd, _, _) -> Base.is_formal_of_prototype v vd) || is_local_or_formal_of_caller v kf let nb_calls () = let g = Cg.get () in (* [g] contains bidirectional edges (from caller to callee and conversely). Conseqently each function call is counted twice. *) Cg.G.nb_edges g / 2 (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/callgraph/uses.mli0000666000000000000000000000610713571573400017106 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val iter_in_order: (Kernel_function.t -> unit) -> unit (** Iterate over all the functions, in the callgraph order, i.e. from callers to callees. In case of cycles (mutual recursive functions), the order is unspecified. *) val iter_in_rev_order: (Kernel_function.t -> unit) -> unit (** Iterate over all the functions, in the callgraph reverse order, i.e. from callees to callers. In case of cycles (mutual recursive functions), the order is unspecified. *) val iter_on_callers : (Kernel_function.t -> unit) -> Kernel_function.t -> unit (** Iterate over all the callers of a given function in a (reverse) depth-first way. Do nothing if the function is not in the callgraph. *) val iter_on_callees : (Kernel_function.t -> unit) -> Kernel_function.t -> unit (** Iterate over all the callees of a given function in a (reverse) depth-first way. Do nothing if the function is not in the callgraph. *) val accept_base : with_formals:bool -> with_locals:bool -> Kernel_function.t -> Base.t -> bool (** [accept_base formals locals kf b] returns [true] if and only if [b] is - a global - a formal or local of one of the callers of [kf] - a formal or local of [kf] and the corresponding argument is [true]. *) val nb_calls: unit -> int (** @return the number of function calls in the whole callgraph. It is not (necessarily) equal to the number of graph edges (depending on the underlying graph datastructure) *) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/constant_propagation/0000777000000000000000000000000013571573400017717 5ustar frama-c-20.0-Calcium/src/plugins/constant_propagation/Constant_Propagation.mli0000666000000000000000000000442413571573400024562 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: Constant_Propagation.mli,v 1.6 2008-04-01 09:25:20 uid568 Exp $ *) (** Constant propagation analysis. *) module Api : sig val get : Cil_datatype.Fundec.Set.t -> cast_intro:bool -> Project.t (** Propagate constant into the functions given by name. note: the propagation is performed into all functions when the set is empty; and casts can be introduced when [cast_intro] is true. *) val compute: unit -> unit (** Propagate constant into the functions given by the parameters (in the same way that {!get}. Then pretty print the resulting program. @since Beryllium-20090901 *) val self: State.t (** Internal state of the constant propagation plugin. *) end frama-c-20.0-Calcium/src/plugins/constant_propagation/api.ml0000666000000000000000000004025113571573400021024 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module FC_file = File open Cil_datatype exception Cannot_expand exception Cannot_change (* Build the term [p+i], assuming that [p] has pointer type *) let plus_pi ~loc p i = if Integer.(equal zero i) then p else Cil.mkBinOp ~loc PlusPI p (Cil.kinteger64 ~loc i) (** This visitor also performs a deep copy. *) class propagate project fnames ~cast_intro = object(self) inherit Visitor.frama_c_copy project (* Variables which have already been declared earlier in the list of globals. Varinfos of the old project. *) val mutable known_globals = Varinfo.Set.empty (* Variables whose declaration must be put before the global we are visiting. Reset before each global. Varinfos of the _new_ project. *) val mutable must_add_decl = Varinfo.Set.empty method! vstmt_aux s= (* Do not propagate on 'return' statements: one invariant of the AST is that they must be of the form 'return v;' where 'v' is a variable *) match s.skind with | Return _ -> Cil.JustCopy | _ -> Cil.DoChildren method! vfunc fundec = if Cil_datatype.Fundec.Set.is_empty fnames || Cil_datatype.Fundec.Set.mem fundec fnames then begin PropagationParameters.feedback ~level:2 "propagated constant in function %s" (fundec.svar.vname); Cil.DoChildren end else Cil.JustCopy method private add_decl_non_source_var vi = PropagationParameters.debug ~level:2 "Need to declare %a earlier" Printer.pp_varinfo vi; let vi' = Visitor.visitFramacVarDecl (self :> Visitor.frama_c_visitor) vi in must_add_decl <- Varinfo.Set.add vi' must_add_decl; known_globals <- Varinfo.Set.add vi known_globals; if Cil.isFunctionType vi.vtype then begin let kf = Globals.Functions.get vi in let new_kf = Visitor_behavior.Memo.kernel_function self#behavior kf in Queue.add (fun () -> Globals.Functions.register new_kf) self#get_filling_actions; end (* introduce a new cast from [oldt] to [newt] or do not expand [e] *) method private add_cast ~ignore_const_cast ~oldt ~newt e = (* strip the superfluous 'const' attribute (see bts #1787) on pointed values. *) let oldt, newt = if ignore_const_cast then match Cil.unrollType oldt, Cil.unrollType newt with | TPtr(typ, attrs), TPtr(typ', attrs') -> let drop_const ty = Cil.typeRemoveAttributes ["const"] ty in TPtr(drop_const typ, attrs), TPtr(drop_const typ', attrs') | _ -> oldt, newt else oldt, newt in let exp = Cil.mkCastT e oldt newt in if cast_intro then exp else match exp.enode with | CastE _ -> if exp == e (* older cast, no new cast added *) then exp else begin (* without [cast_intro], introducing such a cast is not allowed: do not expand [e] *) PropagationParameters.debug ~level:2 "Need a cast introduction (force using -scf-allow-cast option)"; raise Cannot_expand end | _ -> (* remember the change done by [mkCastT] (if any). note that [mkCastT] make some modifications, even if it does not introduce a new cast. *) exp (* Make sure that [expr] is in the original project. *) method private propagated expr ~ignore_const_cast = PropagationParameters.debug ~level:2 "Replacing %s%a?" (if ignore_const_cast then "(without const* cast) " else "") Printer.pp_exp expr; try let loc = expr.eloc in let typ = Cil.typeOf expr in let typ_e = Cil.unrollType typ in begin match typ_e with | (TInt _ | TFloat _ | TPtr _ | TEnum _) -> () | _ -> raise Cannot_expand end; let ki = match self#current_stmt with | None -> raise Cannot_change | Some s -> Kstmt s in let evaled = !Db.Value.access_expr ki expr in let b, m = Cvalue.V.find_lonely_binding evaled in let can_replace vi = (* can replace the current expr by [vi] iff (1) it is a source var, or expansion of non-source var is allowed. *) (vi.vsource || PropagationParameters.ExpandLogicContext.get ()) && (* (2) [vi] is bound in this function *) (vi.vglob || Extlib.may_map (Kernel_function.is_formal_or_local vi) ~dft:false self#current_kf) in let change_to = match b with | Base.Var(vi, _) | Base.Allocated (vi, _, _) when not (Base.is_weak b) && can_replace vi -> if vi.vglob && not (Varinfo.Set.mem vi known_globals) then self#add_decl_non_source_var vi; PropagationParameters.debug "Trying replacing %a from a pointer value {&%a + %a}" Printer.pp_exp expr Base.pretty b Ival.pretty m; let offset = Ival.project_int m in (* these are bytes *) let expr' = try if not (Cil.isPointerType typ_e) then raise Bit_utils.NoMatchingOffset; let typ_pointed = Cil.unrollType (Cil.typeOf_pointed typ_e) in if Cil.isVoidType typ_pointed then raise Bit_utils.NoMatchingOffset; let offset = Integer.mul offset Integer.eight in let m = Bit_utils.MatchType typ_pointed in let off, _ = Bit_utils.(find_offset vi.vtype ~offset m) in Cil.mkAddrOrStartOf ~loc (Var vi, off) with Bit_utils.NoMatchingOffset -> (* Build [((char* )&t[idx])+rem] when vi is an array, or [(char* )(&vi+idx)+rem] otherwise. Automatically simplify when [idx] or [rem] is zero. *) let array, idx, rem = let array, sizeof_pointed = let array = Cil.isArrayType vi.vtype in let size = if array then Bit_utils.osizeof_pointed vi.vtype else Bit_utils.osizeof vi.vtype in array, Int_Base.project size in let div,rem = Integer.e_div_rem offset sizeof_pointed in array,div,rem in let expr' = if array then let off_idx = if Integer.is_zero idx then NoOffset else Index (Cil.kinteger64 ~loc idx, NoOffset) in Cil.mkAddrOrStartOf ~loc (Var vi, off_idx) else let start = Cil.mkAddrOrStartOf ~loc (Var vi, NoOffset) in plus_pi ~loc start idx in if Integer.is_zero rem then expr' else plus_pi ~loc (self#add_cast ~ignore_const_cast:false ~oldt:(Cil.typeOf expr') ~newt:Cil.charPtrType expr') rem in (* preserve typing: propagating constant could change the type of the expression. We have to put back the original type. *) self#add_cast ~ignore_const_cast ~oldt:(Cil.typeOf expr') ~newt:typ expr' | Base.Null -> let const_integer m ikind = try let v = Ival.project_int m in if not (Cil.fitsInInt ikind v) then PropagationParameters.error "Constant found by Value (%a) \ does not fit inside type %a. Please report" Abstract_interp.Int.pretty v Printer.pp_typ typ; Cil.kinteger64 ~loc ~kind:ikind v with Ival.Not_Singleton_Int -> raise Cannot_expand and const_float m fkind = try let f = Ival.project_float m in let f = Fval.(F.to_float (project_float f)) in Cil.kfloat ~loc:expr.eloc fkind f with Fval.Not_Singleton_Float-> raise Cannot_expand in (match typ_e with | TFloat (fkind, _) -> const_float m fkind | TInt (ikind, _) | TEnum ({ ekind = ikind}, _) -> const_integer m ikind | _ -> raise Cannot_expand) | Base.String _ | Base.Var _ | Base.Allocated _ | Base.CLogic_Var _ -> raise Cannot_change in PropagationParameters.debug "Replacing %a with %a" Printer.pp_exp expr Printer.pp_exp change_to; Some change_to with | Cannot_change -> None | Not_found | Cannot_expand | Cil.Not_representable | Abstract_interp.Error_Top as e -> PropagationParameters.debug "Replacement failed %s" (Printexc.to_string e); None method! vexpr expr = (* nothing is done for [expr] already being a constant *) match expr.enode with | Const (_) -> Cil.DoChildren | _ -> begin (* Start by trying to constant-propagate all of [expr]. Casts are allowed only if -scf-allow-cast is set *) match self#propagated expr ~ignore_const_cast:false with | Some expr' -> Cil.ChangeDoChildrenPost (expr', fun x -> x) | None -> begin (* Global constant propagation of [expr] failed. We try a special const-folding, AND simplify the sub-expressions in all cases *) match expr.enode with | Lval (Mem exp_mem, off) -> begin (* [expr] is a Mem. Try to see if we can propagate [exp_mem] into something simpler, because the result will be of the form [Var _, offs'], which can be simplified under a [Mem]. This time, we ignore const-related casts when simplifying [exp_mem], because they will disappear when the l-value is dereferenced. *) match self#propagated exp_mem ~ignore_const_cast:true with | Some exp_mem' -> let lv = Cil.new_exp expr.eloc (Lval (Cil.mkMem exp_mem' off)) in Cil.ChangeDoChildrenPost (lv, fun x -> x) | None -> Cil.DoChildren end | _ -> Cil.DoChildren end end method! vvdec v = if v.vglob then begin known_globals <- Varinfo.Set.add v known_globals; end; Cil.DoChildren method! vglob_aux g = must_add_decl <- Varinfo.Set.empty; (* Check if [g] has already been declared earlier, due to being used in some earlier values. If so, we will skip [g]. We do this check now and not in [add_decls], because [self#vvdec] will mark g as known. *) let g_is_known = match g with | GVarDecl (vi, _) | GFunDecl (_, vi, _) -> Varinfo.Set.mem vi known_globals | _ -> false in let add_decls l = (* Do not re-add a declaration for g if it is known. *) let l = if g_is_known then [] else l in (* Add declarations for the globals that are referenced in g's propagated value. *) Varinfo.Set.fold (fun vi l -> PropagationParameters.feedback ~level:2 "Adding declaration of global %a" Printer.pp_varinfo vi; let g' = if Cil.isFunctionType vi.vtype then GFunDecl(Cil.empty_funspec(), vi, vi.vdecl) else GVarDecl(vi, vi.vdecl) in g' ::l) must_add_decl l in Cil.DoChildrenPost add_decls method! vlval lv = let simplify (host,offs as lv) = match host with | Mem e -> Cil.mkMem e offs (* canonize in case the propagation simplified [lv] *) | Var _ -> lv in Cil.ChangeDoChildrenPost(lv, simplify) end module Result_pair = Datatype.Pair_with_collections(Cil_datatype.Fundec.Set)(Datatype.Bool) (struct let module_name = "Constant_propagation.Register.Result_pair.t" end) module Result = State_builder.Hashtbl (Datatype.Hashtbl (Result_pair.Hashtbl) (Result_pair) (struct let module_name = "Semantical constant propagation" end)) (Project.Datatype) (struct let size = 7 let name = "Semantical constant propagation" let dependencies = [ Db.Value.self; PropagationParameters.CastIntro.self; PropagationParameters.Project_name.self ] end) let selection_command_line_option = State_selection.singleton PropagationParameters.SemanticConstFolding.self let journalized_get = let get fnames cast_intro = Result.memo (fun _ -> !Db.Value.compute (); let fresh_project = FC_file.create_project_from_visitor (PropagationParameters.Project_name.get ()) (fun prj -> new propagate prj fnames cast_intro) in let ctx = Parameter_state.get_selection_context () in let ctx = State_selection.diff ctx selection_command_line_option in Project.copy ~selection:ctx fresh_project; fresh_project) (fnames, cast_intro) in Journal.register "Constant_Propagation.get" (Datatype.func2 Cil_datatype.Fundec.Set.ty ~label2:("cast_intro",None) Datatype.bool Project.ty) get (* add labels *) let get fnames ~cast_intro = journalized_get fnames cast_intro (** Constant Propagation *) let compute () = PropagationParameters.feedback "beginning constant propagation"; let fnames = PropagationParameters.SemanticConstFold.get () in let cast_intro = PropagationParameters.CastIntro.get () in let propagated = get fnames cast_intro in if PropagationParameters.SemanticConstFolding.get () then FC_file.pretty_ast ~prj:propagated (); let project_name = Project.get_unique_name propagated in PropagationParameters.feedback "@[constant propagation done%t@]" (fun fmt -> if project_name <> PropagationParameters.Project_name.get () then Format.fprintf fmt ",@ result is in project@ `%s`" project_name) let compute, self = let name = "Constant_Propagation.compute" in let journalized_compute = Journal.register name (Datatype.func Datatype.unit Datatype.unit) compute in let deps = [ PropagationParameters.SemanticConstFold.self; PropagationParameters.SemanticConstFolding.self; Result.self ] in State_builder.apply_once name deps journalized_compute let main () = let force_semantic_folding = PropagationParameters.SemanticConstFolding.get () || not (Cil_datatype.Fundec.Set.is_empty (PropagationParameters.SemanticConstFold.get ())) in (* must called the function stored in [Db] for journalisation purpose *) if force_semantic_folding then compute () let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/constant_propagation/api.mli0000666000000000000000000000416713571573400021203 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val get : Cil_datatype.Fundec.Set.t -> cast_intro:bool -> Project.t (** Propagate constant into the functions given by name. note: the propagation is performed into all functions when the set is empty; and casts can be introduced when [cast_intro] is true. *) val compute: unit -> unit (** Propagate constant into the functions given by the parameters (in the same way that {!get}. Then pretty print the resulting program. @since Beryllium-20090901 *) val self: State.t (** Internal state of the constant propagation plugin. *) frama-c-20.0-Calcium/src/plugins/constant_propagation/propagationParameters.ml0000666000000000000000000000621213571573400024621 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Constant Propagation *) include Plugin.Register (struct let name = "semantic constant folding" let shortname = "scf" let help = "propagates constants semantically" end) module SemanticConstFolding = False (struct let option_name = "-scf" let help = "pretty print a version of the source code where each constant expression is replaced by its value" end) let () = SemanticConstFolding.add_aliases ["-semantic-const-folding"] module SemanticConstFold = Fundec_set (struct let option_name = "-scf-fct" let arg_name = "f1, ..., fn" let help = "propagate constants only into functions f1,...,fn" end) let () = SemanticConstFold.add_aliases ["-semantic-const-fold"] module CastIntro = False (struct let option_name = "-scf-allow-cast" let help = "replace expressions by constants even when doing so \ requires a pointer cast" end) let () = CastIntro.add_aliases ["-cast-from-constant"] module ExpandLogicContext = False (struct let option_name = "-scf-logic" let help = "replace values from logical context and create corresponding variables (HIGHLY EXPERIMENTAL)" end) let () = ExpandLogicContext.add_aliases ["-semantic-const-fold-logic"] module Project_name = String (struct let option_name = "-scf-project-name" let default = "propagated" let arg_name = "" let help = "name of the generated project (default is `propagated`)" end) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/constant_propagation/propagationParameters.mli0000666000000000000000000000361413571573400024775 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module SemanticConstFolding: Parameter_sig.Bool module SemanticConstFold: Parameter_sig.Fundec_set module CastIntro: Parameter_sig.Bool module ExpandLogicContext: Parameter_sig.Bool module Project_name: Parameter_sig.String include Log.Messages (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/0000777000000000000000000000000013571573400014627 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/E_ACSL.mli0000666000000000000000000000435313571573400016325 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** E-ACSL. *) open Cil_types module Error: sig exception Typing_error of string exception Not_yet of string end module Translate: sig exception No_simple_translation of term val term_to_exp: typ option -> term -> exp (** @raise New_typing_error when the given term cannot be typed (something wrong happened with this term) @raise Not_yet when the given term contains an unsupported construct. @raise No_simple_translation when the given term cannot be translated into a single expression. *) end (** No function is directly exported: they are dynamically registered. *) (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/Makefile.in0000666000000000000000000003114713571573400016702 0ustar ########################################################################## # # # This file is part of the Frama-C's E-ACSL plug-in. # # # # Copyright (C) 2012-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ####################### # Frama-C Environment # ####################### # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ################### # Plug-in sources # ################### # libraries SRC_LIBRARIES:= \ error \ builtins \ functions \ misc \ gmp_types \ varname SRC_LIBRARIES:=$(addprefix src/libraries/, $(SRC_LIBRARIES)) # analyses SRC_ANALYSES:= \ rte \ literal_strings \ mmodel_analysis \ exit_points \ lscope \ interval \ typing SRC_ANALYSES:=$(addprefix src/analyses/, $(SRC_ANALYSES)) # project initializer SRC_PROJECT_INITIALIZER:= \ keep_status \ prepare_ast \ dup_functions SRC_PROJECT_INITIALIZER:=\ $(addprefix src/project_initializer/, $(SRC_PROJECT_INITIALIZER)) # code generator SRC_CODE_GENERATOR:= \ gmp \ label \ env \ rational \ loops \ quantif \ at_with_lscope \ mmodel_translate \ logic_functions \ translate \ temporal \ visit SRC_CODE_GENERATOR:=$(addprefix src/code_generator/, $(SRC_CODE_GENERATOR)) ######################### # Plug-in configuration # ######################### PLUGIN_DIR ?=. PLUGIN_EXTRA_DIRS:=\ src \ src/libraries \ src/analyses \ src/project_initializer \ src/code_generator PLUGIN_ENABLE:=@ENABLE_E_ACSL@ PLUGIN_DYNAMIC:=@DYNAMIC_E_ACSL@ PLUGIN_NAME:=E_ACSL PLUGIN_CMO:= src/local_config \ src/options \ $(SRC_LIBRARIES) \ $(SRC_ANALYSES) \ $(SRC_PROJECT_INITIALIZER) \ $(SRC_CODE_GENERATOR) \ src/main PLUGIN_HAS_MLI:=yes PLUGIN_DISTRIBUTED:=yes # We "save" this variable so that it can be used once PLUGIN_DIR has been reset EACSL_PLUGIN_DIR:=$(PLUGIN_DIR) # Suppress a spurious warning with OCaml >= 4.04.0 $(EACSL_PLUGIN_DIR)/src/analyses/mmodel_analysis.cmo \ $(EACSL_PLUGIN_DIR)/src/analyses/mmodel_analysis.cmi: E_ACSL_BFLAGS+= -w -60 $(EACSL_PLUGIN_DIR)/src/analyses/mmodel_analysis.cmx: E_ACSL_OFLAGS+= -w -60 ############### # Local Flags # ############### # Do not edit the line below: it is automatically set by 'make e-acsl-distrib' IS_DISTRIBUTED:=no ####################### # Local configuration # ####################### PLUGIN_GENERATED:= $(EACSL_PLUGIN_DIR)/src/local_config.ml VERSION_FILE=$(FRAMAC_ROOT_SRCDIR)/VERSION ################ # Version # ################ EACSL_VERSION:=$(shell sed -e 's/\\(.*\\)/\\1/' $(VERSION_FILE)) $(EACSL_PLUGIN_DIR)/src/local_config.ml: $(EACSL_PLUGIN_DIR)/Makefile.in $(VERSION_FILE) $(PRINT_MAKING) $@ $(RM) $@ $(ECHO) "(* This file was automatically generated from $<. Don't edit it. *)" >> $@ $(ECHO) "let version = \""$(EACSL_VERSION)"\"" >> $@ $(CHMOD_RO) $@ ########### # Testing # ########### ifeq (@MAY_RUN_TESTS@,yes) -include in_frama_ci PLUGIN_TESTS_DIRS := \ examples \ bts \ constructs \ arith \ memory \ gmp-only \ full-mmodel \ format \ temporal \ special # [JS 2019/02/26] deactivate tests 'builtin' as long as setjmp/longjmp is not # supported. # builtin PLUGIN_TESTS_LIB := $(EACSL_PLUGIN_DIR)/tests/print.ml DEV= ifeq ("$(DEV)","yes") EACSL_TEST_CONFIG=dev else EACSL_TEST_CONFIG:=ci endif PLUGIN_PTESTS_OPTS:=-config $(EACSL_TEST_CONFIG) E_ACSL_TESTS E_ACSL_DEFAULT_TESTS: \ $(EACSL_PLUGIN_DIR)/tests/ptests_config \ $(EACSL_PLUGIN_DIR)/tests/test_config_$(EACSL_TEST_CONFIG) \ $(EACSL_PLUGIN_DIR)/tests/print.cmxs \ $(EACSL_PLUGIN_DIR)/tests/print.cmo $(EACSL_PLUGIN_DIR)/tests/test_config_ci: \ $(EACSL_PLUGIN_DIR)/tests/test_config_ci.in \ $(EACSL_PLUGIN_DIR)/Makefile $(PRINT_MAKING) $@ $(SED) -e "s|@SEDCMD@|`which sed `|g" $< > $@ $(EACSL_PLUGIN_DIR)/tests/test_config_dev: \ $(EACSL_PLUGIN_DIR)/tests/test_config_dev.in \ $(EACSL_PLUGIN_DIR)/Makefile $(PRINT_MAKING) $@ $(SED) -e "s|@SEDCMD@|`which sed `|g" $< > $@ tests:: $(EACSL_PLUGIN_DIR)/tests/ptests_config clean:: for d in $(E_ACSL_EXTRA_DIRS); do \ $(RM) $$d/*~; \ done $(PRINT_RM) cleaning generated test files $(RM) $(E_ACSL_DIR)/tests/*.cm* $(E_ACSL_DIR)/tests/*.o $(RM) $(E_ACSL_DIR)/tests/test_config_ci \ $(E_ACSL_DIR)/tests/test_config_dev $(RM) $(foreach dir, $(PLUGIN_TESTS_DIRS), tests/$(dir)/result/*) endif ################################################ # Third-party C libraries # ################################################ EACSL_LIBDIR := $(EACSL_PLUGIN_DIR)/lib ############ # DLMALLOC # ############ EACSL_DLMALLOC_REL_DIR := contrib/libdlmalloc EACSL_DLMALLOC_DIR := $(EACSL_PLUGIN_DIR)/$(EACSL_DLMALLOC_REL_DIR) EACSL_DLMALLOC_LIBNAME = libeacsl-dlmalloc.a EACSL_DLMALLOC_LIB = $(EACSL_LIBDIR)/$(EACSL_DLMALLOC_LIBNAME) EACSL_DLMALLOC_SRC = $(EACSL_DLMALLOC_DIR)/dlmalloc.c EACSL_DLMALLOC_OBJ = dlmalloc.o EACSL_DLMALLOC_FLAGS = \ -DHAVE_MORECORE=0 \ -DHAVE_MMAP=1 \ -DNO_MALLINFO=1 \ -DNO_MALLOC_STATS=1 \ -DMSPACES=1 \ -DONLY_MSPACES \ -DMALLOC_ALIGNMENT=32 \ -DMSPACE_PREFIX="__e_acsl_" $(EACSL_DLMALLOC_LIB): $(EACSL_DLMALLOC_SRC) $(MKDIR) $(EACSL_LIBDIR) echo 'CC $<' $(CC) $< -c -O2 -g3 -o$(EACSL_DLMALLOC_OBJ) $(EACSL_DLMALLOC_FLAGS) echo 'AR $@' $(AR) crus $@ $(EACSL_DLMALLOC_OBJ) echo 'RANLIB $@' ranlib $@ all:: $(EACSL_DLMALLOC_LIB) clean:: $(RM) $(EACSL_DLMALLOC_LIB) ############ # Cleaning # ############ EACSL_CLEANFILES = doc/doxygen/doxygen.cfg \ Makefile config.log config.status configure .depend autom4te.cache/* \ META.frama-c-e_acsl Makefile.plugin.generated src/local_config.ml top/* e-acsl-distclean:: clean $(PRINT_RM) generated project files $(RM) $(addprefix $(E_ACSL_DIR)/, $(EACSL_CLEANFILES)) ################################ # Building source distribution # ################################ EACSL_CONTRIB_FILES = \ $(EACSL_DLMALLOC_REL_DIR)/dlmalloc.c EACSL_MANUAL_FILES = doc/manuals/*.pdf EACSL_DOC_FILES = \ doc/doxygen/doxygen.cfg.in \ doc/Changelog \ man/e-acsl-gcc.sh.1 EACSL_TEST_FILES = \ tests/test_config_dev.in \ tests/test_config_ci.in \ tests/gmp-only/test_config_ci \ tests/gmp-only/test_config_dev \ tests/full-mmodel/test_config_ci \ tests/full-mmodel/test_config_dev \ tests/builtin/test_config_ci \ tests/builtin/test_config_dev \ tests/temporal/test_config_ci \ tests/temporal/test_config_dev \ tests/format/test_config_ci \ tests/format/test_config_dev \ tests/print.ml # Test files without header management EACSL_DISTRIB_TESTS = \ $(foreach dir, $(addprefix tests/,$(PLUGIN_TESTS_DIRS)), \ $(dir)/*.[ich] \ $(dir)/test_config \ $(dir)/oracle_ci/*.c \ $(dir)/oracle_ci/*.oracle \ ) EACSL_RTL_FILES = $(EACSL_RTL_SRC) EACSL_SCRIPT_FILES = scripts/e-acsl-gcc.sh EACSL_LICENSE_FILES = \ license/CEA_LGPL license/SPARETIMELABS \ license/headache_config.txt license/LGPLv2.1 EACSL_MISC_FILES = \ configure.ac Makefile.in INSTALL README EACSL_SHARE_FILES = share/e-acsl/*.[ch] share/e-acsl/*/*.[ch] EACSL_DISTRIB_EXTERNAL =\ $(EACSL_SHARE_FILES) \ $(EACSL_MISC_FILES) \ $(EACSL_DOC_FILES) \ $(EACSL_TEST_FILES) \ $(EACSL_RTL_FILES) \ $(EACSL_SCRIPT_FILES) \ $(EACSL_LICENSE_FILES) \ $(EACSL_CONTRIB_FILES) PLUGIN_DISTRIB_EXTERNAL:= $(EACSL_DISTRIB_EXTERNAL) # Files of `DISTRIB_FILES` without header and not listed in file # `headers/header_specs.txt`. PLUGIN_HEADER_EXCEPTIONS:= # Files that are not listed in `DISTRIB_FILES` # and dedicated to distributed tests PLUGIN_DISTRIB_TESTS:= $(EACSL_DISTRIB_TESTS) ########## # Header # ########## ifneq ("$(FRAMAC_INTERNAL)","yes") EACSL_SPARETIMELABS=$(EACSL_PLUGIN_DIR)/share/e-acsl/e_acsl_printf.h EACSL_SHARE_BARE= share/e-acsl/*.[ch] share/e-acsl/*/*.[ch] EACSL_SHARE=$(addprefix $(EACSL_PLUGIN_DIR)/, $(EACSL_SHARE_BARE)) EACSL_CEA_SHARE=$(filter-out $(EACSL_SPARETIMELABS), $(wildcard $(EACSL_SHARE))) EACSL_CEA_LGPL_BARE= src/*.ml src/*/*.ml src/*.mli src/*/*.mli \ E_ACSL.mli \ Makefile.in configure.ac \ scripts/*.sh \ tests/print.ml \ man/e-acsl-gcc.sh.1 EACSL_CEA_LGPL=$(addprefix $(EACSL_PLUGIN_DIR)/, $(EACSL_CEA_LGPL_BARE)) \ $(EACSL_CEA_SHARE) # valid values: open-source, close-source EACSL_HEADERS?=open-source headers:: @echo "Applying $(EACSL_HEADERS) headers..." headache -c $(EACSL_PLUGIN_DIR)/license/headache_config.txt \ -h $(EACSL_PLUGIN_DIR)/headers/$(EACSL_HEADERS)/CEA_LGPL_OR_PROPRIETARY.E_ACSL \ $(EACSL_CEA_LGPL) headache -c $(EACSL_PLUGIN_DIR)/license/headache_config.txt \ -h $(EACSL_PLUGIN_DIR)/headers/$(EACSL_HEADERS)/MODIFIED_SPARETIMELABS \ $(EACSL_SPARETIMELABS) headache -c $(EACSL_PLUGIN_DIR)/license/headache_config.txt \ -h $(EACSL_PLUGIN_DIR)/headers/$(EACSL_HEADERS)/MODIFIED_DLMALLOC \ $(EACSL_PLUGIN_DIR)/contrib/libdlmalloc/dlmalloc.c endif ################ # Generic part # ################ include $(FRAMAC_SHARE)/Makefile.dynamic ########### # Install # ########### EACSL_INSTALL_MANUAL_FILES=$(wildcard $(addprefix $(EACSL_PLUGIN_DIR)/, $(EACSL_MANUAL_FILES))) install:: $(PRINT_INSTALL) E-ACSL share files $(MKDIR) $(FRAMAC_DATADIR)/e-acsl $(CP) $(E_ACSL_DIR)/share/e-acsl/*.[ch] $(FRAMAC_DATADIR)/e-acsl $(MKDIR) $(FRAMAC_DATADIR)/e-acsl/bittree_model \ $(FRAMAC_DATADIR)/e-acsl/segment_model $(CP) $(E_ACSL_DIR)/share/e-acsl/bittree_model/* \ $(FRAMAC_DATADIR)/e-acsl/bittree_model $(CP) $(E_ACSL_DIR)/share/e-acsl/segment_model/* \ $(FRAMAC_DATADIR)/e-acsl/segment_model # manuals are not present in standard distribution. # Don't fail because of that. ifneq ("$(EACSL_INSTALL_MANUAL_FILES)","") $(PRINT_INSTALL) E-ACSL manuals $(MKDIR) $(FRAMAC_DATADIR)/manuals $(CP) $(EACSL_INSTALL_MANUAL_FILES) $(FRAMAC_DATADIR)/manuals; endif $(PRINT_INSTALL) E-ACSL libraries $(MKDIR) $(LIBDIR) $(CP) $(EACSL_LIBDIR)/libeacsl-*.a $(LIBDIR) $(PRINT_INSTALL) E-ACSL scripts $(MKDIR) $(BINDIR) $(CP) $(E_ACSL_DIR)/scripts/e-acsl-gcc.sh $(BINDIR)/ $(PRINT_INSTALL) E-ACSL man pages $(MKDIR) $(MANDIR)/man1 $(CP) $(E_ACSL_DIR)/man/e-acsl-gcc.sh.1 $(MANDIR)/man1/ uninstall:: $(PRINT_RM) E-ACSL share files $(RM) -r $(FRAMAC_DATADIR)/e-acsl $(PRINT_RM) E-ACSL manuals $(RM) $(FRAMAC_DATADIR)/manuals/*.pdf $(PRINT_RM) E-ACSL libraries $(RM) $(LIBDIR)/libeacsl-*.a $(PRINT_RM) E-ACSL scripts $(RM) $(BINDIR)/e-acsl-gcc.sh $(PRINT_RM) E-ACSL man pages $(RM) $(MANDIR)/man1/e-acsl-gcc.sh.1 ##################################### # Regenerating the Makefile on need # ##################################### ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR:=$(FRAMAC_SRC) CONFIG_STATUS_DIR_DEP:= else CONFIG_STATUS_DIR:=$(E_ACSL_DIR) CONFIG_STATUS_DIR_DEP:=$(CONFIG_STATUS_DIR)/config.status endif $(E_ACSL_DIR)/Makefile: $(E_ACSL_DIR)/Makefile.in $(CONFIG_STATUS_DIR_DEP) cd $(CONFIG_STATUS_DIR) && ./config.status ##################################### # Doxygen # ##################################### DOXYGEN = @DOXYGEN@ doxygen: if ! test $(DOXYGEN) = "no"; then \ $(DOXYGEN) $(E_ACSL_DIR)/doc/doxygen/doxygen.cfg ; \ else \ echo "Warning: Skip doxygen documentation: \ Doxygen executable not found."; \ fi doc:: doxygen clean:: $(PRINT_RM) generated documentation $(RM) $(E_ACSL_DIR)/doc/doxygen/html/* $(RM) $(E_ACSL_DIR)/doc/code/* $(RM) $(E_ACSL_DIR)/doc/doxygen/warn.log frama-c-20.0-Calcium/src/plugins/e-acsl/README0000666000000000000000000000725313571573400015516 0ustar ------ README ------ =============================================================================== SUMMARY =============================================================================== 0) Summary 1) What Is 2) Simple usage 3) Examples 5) Compatibility with previous releases 6) Have Fun with E-ACSL! =============================================================================== WHAT IS =============================================================================== This package contains the Frama-C's E-ACSL plug-in. It takes as input an annotated C program and returns the same program in which annotations have been converted into C code dedicated to runtime assertion checking: this code fails at runtime if the annotation is violated at runtime. Annotations must be written in a subset of ACSL (ANSI/ISO C Specification Language), namely E-ACSL (Executable ANSI/ISO C Specification Language). E-ACSL is fully described in file doc/manuals/e-acsl.pdf. This plug-in is still in a preliminary state: some parts of E-ACSL are not yet implemented. What is supported is described in file doc/manuals/e-acsl-implementation.pdf. Please read file INSTALL for details about the installation procedure of this plug-in and consult http://frama-c.com and http://frama-c.com/acsl for information about Frama-C and ACSL. The user manual is available at: http://frama-c.com/download/e-acsl/e-acsl-manual.pdf =============================================================================== SIMPLE USAGE =============================================================================== E-ACSL comes with a convenient script e-acsl-gcc.sh. The standard use is the following: $ e-acsl-gcc.sh -c Here the only options is -c in order to compile the generated file which contains the inline monitor from the input files. It outputs three binaries ./a.out, ./a.out.frama-c and ./a.out.e-acsl. The first one is the binary produced by gcc from the input files, the second one is the binary produced by gcc with the file generated by Frama-C from the input files, but without monitoring any annotation. The third one is the binary produced by gcc with the file generated by Frama-C from the input files, and monitoring the annotations. Its execution behaves in the same way than the two other files, except that it fails if an annotation is violated. Please refer to the user manual for details about e-acsl-gcc.sh. =============================================================================== EXAMPLES =============================================================================== 1) Consider the following C program: int main(void) { /*@ assert \true; */ return 0; } Since the assertion is always true, the generated code behaves in the same way that just returning 0: $ e-acsl-gcc.sh -c true.i $ ./a.out.e-acsl $ echo $? 0 Now consider the following C program: // false.i int main(void) { int x = 0; /*@ assert x+1 == 0; */ return 0; } Since the assertion is always false, the generated code fails at runtime: $ e-acsl-gcc.sh -c false.i $ ./a.out.e-acsl Assertion failed at line 4. The failing predicate is: x + 1 == 0. $ echo $? 1 More advanced examples are available in the user manual and in the plug-in directory tests/e-acsl-runtime. =============================================================================== COMPATIBILITY WITH PREVIOUS RELEASES =============================================================================== Changes are documented in a textual way in file Changelog. =============================================================================== HAVE FUN WITH E-ACSL! =============================================================================== frama-c-20.0-Calcium/src/plugins/e-acsl/configure0000777000000000000000000053021013571573400016537 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='MAY_RUN_TESTS LTLIBOBJS LIBOBJS HAVE_DOT DOXYGEN EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC UNAME ENABLE_E_ACSL ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_e_acsl ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-e_acsl support for E-ACSL plug-in (default: yes) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-e_acsl was given. if test "${enable_e_acsl+set}" = set; then : enableval=$enable_e_acsl; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "e_acsl is not available" "$LINENO" 5 fi FORCE_E_ACSL=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_E_ACSL ENABLE_E_ACSL=$ENABLE NAME_E_ACSL=e_acsl if test "$default" = "no" -a "$FORCE" = "no"; then INFO_E_ACSL=" (not available by default)" fi echo "e_acsl... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_RTEGEN=$REQUIRE_RTEGEN" "e_acsl REQUIRED_E_ACSL=$REQUIRED_E_ACSL" "rtegen # E-ACSL only works on Linux as of now. Disable it on Mac OS and Windows # Extract the first word of "uname", so it can be a program name with args. set dummy uname; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_UNAME+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$UNAME"; then ac_cv_prog_UNAME="$UNAME" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_UNAME="uname" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_UNAME" && ac_cv_prog_UNAME="no" fi fi UNAME=$ac_cv_prog_UNAME if test -n "$UNAME"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNAME" >&5 $as_echo "$UNAME" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$UNAME" = "no"; then if test "FORCE_E_ACSL" = "yes"; then as_fn_error $? "e_acsl requested but Not on a POSIX platform." "$LINENO" 5; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: e_acsl disabled because Not on a POSIX platform." >&5 $as_echo "$as_me: WARNING: e_acsl disabled because Not on a POSIX platform." >&2;}; ENABLE_E_ACSL=no; INFO_E_ACSL=", Not on a POSIX platform." fi fi HOST_OS=$($UNAME -s) case $HOST_OS in Darwin | Linux | DragonFly | FreeBSD | NetBSD | OpenBSD) # BSDs haven't really be tested, but it should at least compile fine ;; *) if test "FORCE_E_ACSL" = "yes"; then as_fn_error $? "e_acsl requested but unsupported system $HOST_OS" "$LINENO" 5; else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: e_acsl disabled because unsupported system $HOST_OS" >&5 $as_echo "$as_me: WARNING: e_acsl disabled because unsupported system $HOST_OS" >&2;}; ENABLE_E_ACSL=no; INFO_E_ACSL=", unsupported system $HOST_OS" fi ;; esac # First, initialize some variables for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` TODOLIST=$TODOLIST" "$plugin eval MARK_$plugin= eval REMEMBER_$plugin= fi done # main call compute_dependency ############################### # C specific stuff for E-ACSL # ############################### MAY_RUN_TESTS=yes # C compiler and stdio.h ######################### ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdio.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" if test "x$ac_cv_header_stdio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDIO_H 1 _ACEOF HAVE_STDIO_H=yes fi done # not sure it can actually happen: # looks like configure stops on error if no C compiler detected if test -z $HAVE_STDIO_H; then MAY_RUN_TESTS=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: stdio.h missing: non-regression tests unavailable." >&5 $as_echo "$as_me: WARNING: stdio.h missing: non-regression tests unavailable." >&2;} fi # Doxygen ######### # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DOXYGEN"; then ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DOXYGEN="doxygen" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_DOXYGEN" && ac_cv_prog_DOXYGEN="no" fi fi DOXYGEN=$ac_cv_prog_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_DOT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_DOT"; then ac_cv_prog_HAVE_DOT="$HAVE_DOT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_DOT="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_DOT" && ac_cv_prog_HAVE_DOT="no" fi fi HAVE_DOT=$ac_cv_prog_HAVE_DOT if test -n "$HAVE_DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DOT" >&5 $as_echo "$HAVE_DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ac_config_files="$ac_config_files doc/doxygen/doxygen.cfg" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "doc/doxygen/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES doc/doxygen/doxygen.cfg" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "default":C) ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "doc/doxygen/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES doc/doxygen/doxygen.cfg" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "default":C) ;; "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ############################### # Configure contrib libraries # ############################### frama-c-20.0-Calcium/src/plugins/e-acsl/configure.ac0000666000000000000000000000671413571573400017125 0ustar ########################################################################## # # # This file is part of the Frama-C's E-ACSL plug-in. # # # # Copyright (C) 2012-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # E-ACSL as a standard Frama-C plug-in # ######################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)]) check_plugin(e_acsl,PLUGIN_RELATIVE_PATH(plugin_file), [support for E-ACSL plug-in],yes) plugin_require(e_acsl,rtegen) # E-ACSL only works on Linux as of now. Disable it on Mac OS and Windows AC_CHECK_PROG(UNAME,uname,uname,no) if test "$UNAME" = "no"; then plugin_disable(e_acsl,[Not on a POSIX platform.]) fi HOST_OS=$($UNAME -s) case $HOST_OS in Darwin | Linux | DragonFly | FreeBSD | NetBSD | OpenBSD) # BSDs haven't really be tested, but it should at least compile fine ;; *) plugin_disable(e_acsl,[unsupported system $HOST_OS]) ;; esac check_plugin_dependencies ############################### # C specific stuff for E-ACSL # ############################### MAY_RUN_TESTS=yes # C compiler and stdio.h ######################### AC_CHECK_HEADERS([stdio.h],[HAVE_STDIO_H=yes],) # not sure it can actually happen: # looks like configure stops on error if no C compiler detected if test -z $HAVE_STDIO_H; then MAY_RUN_TESTS=no AC_MSG_WARN([stdio.h missing: non-regression tests unavailable.]) fi # Doxygen ######### AC_CHECK_PROG(DOXYGEN,doxygen,doxygen,no) AC_CHECK_PROG(HAVE_DOT,dot,yes,no) AC_OUTPUT(PLUGIN_RELATIVE_PATH(doc/doxygen/doxygen.cfg), [ ]) ####################### # Generating Makefile # ####################### AC_SUBST(MAY_RUN_TESTS) write_plugin_config(Makefile) ############################### # Configure contrib libraries # ############################### m4_ifndef([plugin_dir], [ m4_define([plugin_dir],[./]) ]) frama-c-20.0-Calcium/src/plugins/e-acsl/contrib/0000777000000000000000000000000013571573400016267 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/contrib/libdlmalloc/0000777000000000000000000000000013571573400020545 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/contrib/libdlmalloc/dlmalloc.c0000666000000000000000000067126013571573400022514 0ustar /**************************************************************************/ /* */ /* This is a version (aka dlmalloc) of malloc/free/realloc written by */ /* Doug Lea and released to the public domain, as explained at */ /* http://creativecommons.org/publicdomain/zero/1.0/ Send questions, */ /* comments, complaints, performance data, etc to dl@cs.oswego.edu */ /* */ /* Version 2.8.6 Wed Aug 29 06:57:58 2012 Doug Lea */ /* Note: There may be an updated version of this malloc obtainable at */ /* ftp://gee.cs.oswego.edu/pub/misc/malloc.c */ /* Check before installing! */ /* */ /* File modified by CEA (Commissariat à l'énergie atomique et aux */ /* énergies alternatives). */ /* */ /**************************************************************************/ /* This file has been modified by CEA for use together with Runtime Library of the E-ACSL plugin of Frama-C. The changes introduced by CEA are limited to the following modifications: * Added declaration/definition of mspace_least_addr function * Added functionality to modify prefix of `mspace_...` functions. */ /* Quickstart This library is all in one file to simplify the most common usage: ftp it, compile it (-O3), and link it into another program. All of the compile-time options default to reasonable values for use on most platforms. You might later want to step through various compile-time and dynamic tuning options. For convenience, an include file for code using this malloc is at: ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.6.h You don't really need this .h file unless you call functions not defined in your system include files. The .h file contains only the excerpts from this file needed for using this malloc on ANSI C/C++ systems, so long as you haven't changed compile-time options about naming and tuning parameters. If you do, then you can create your own malloc.h that does include all settings by cutting at the point indicated below. Note that you may already by default be using a C library containing a malloc that is based on some version of this malloc (for example in linux). You might still want to use the one in this file to customize settings or to avoid overheads associated with library versions. * Vital statistics: Supported pointer/size_t representation: 4 or 8 bytes size_t MUST be an unsigned type of the same width as pointers. (If you are using an ancient system that declares size_t as a signed type, or need it to be a different width than pointers, you can use a previous release of this malloc (e.g. 2.7.2) supporting these.) Alignment: 8 bytes (minimum) This suffices for nearly all current machines and C compilers. However, you can define MALLOC_ALIGNMENT to be wider than this if necessary (up to 128bytes), at the expense of using more space. Minimum overhead per allocated chunk: 4 or 8 bytes (if 4byte sizes) 8 or 16 bytes (if 8byte sizes) Each malloced chunk has a hidden word of overhead holding size and status information, and additional cross-check word if FOOTERS is defined. Minimum allocated size: 4-byte ptrs: 16 bytes (including overhead) 8-byte ptrs: 32 bytes (including overhead) Even a request for zero bytes (i.e., malloc(0)) returns a pointer to something of the minimum allocatable size. The maximum overhead wastage (i.e., number of extra bytes allocated than were requested in malloc) is less than or equal to the minimum size, except for requests >= mmap_threshold that are serviced via mmap(), where the worst case wastage is about 32 bytes plus the remainder from a system page (the minimal mmap unit); typically 4096 or 8192 bytes. Security: static-safe; optionally more or less The "security" of malloc refers to the ability of malicious code to accentuate the effects of errors (for example, freeing space that is not currently malloc'ed or overwriting past the ends of chunks) in code that calls malloc. This malloc guarantees not to modify any memory locations below the base of heap, i.e., static variables, even in the presence of usage errors. The routines additionally detect most improper frees and reallocs. All this holds as long as the static bookkeeping for malloc itself is not corrupted by some other means. This is only one aspect of security -- these checks do not, and cannot, detect all possible programming errors. If FOOTERS is defined nonzero, then each allocated chunk carries an additional check word to verify that it was malloced from its space. These check words are the same within each execution of a program using malloc, but differ across executions, so externally crafted fake chunks cannot be freed. This improves security by rejecting frees/reallocs that could corrupt heap memory, in addition to the checks preventing writes to statics that are always on. This may further improve security at the expense of time and space overhead. (Note that FOOTERS may also be worth using with MSPACES.) By default detected errors cause the program to abort (calling "abort()"). You can override this to instead proceed past errors by defining PROCEED_ON_ERROR. In this case, a bad free has no effect, and a malloc that encounters a bad address caused by user overwrites will ignore the bad address by dropping pointers and indices to all known memory. This may be appropriate for programs that should continue if at all possible in the face of programming errors, although they may run out of memory because dropped memory is never reclaimed. If you don't like either of these options, you can define CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything else. And if if you are sure that your program using malloc has no errors or vulnerabilities, you can define INSECURE to 1, which might (or might not) provide a small performance improvement. It is also possible to limit the maximum total allocatable space, using malloc_set_footprint_limit. This is not designed as a security feature in itself (calls to set limits are not screened or privileged), but may be useful as one aspect of a secure implementation. Thread-safety: NOT thread-safe unless USE_LOCKS defined non-zero When USE_LOCKS is defined, each public call to malloc, free, etc is surrounded with a lock. By default, this uses a plain pthread mutex, win32 critical section, or a spin-lock if if available for the platform and not disabled by setting USE_SPIN_LOCKS=0. However, if USE_RECURSIVE_LOCKS is defined, recursive versions are used instead (which are not required for base functionality but may be needed in layered extensions). Using a global lock is not especially fast, and can be a major bottleneck. It is designed only to provide minimal protection in concurrent environments, and to provide a basis for extensions. If you are using malloc in a concurrent program, consider instead using nedmalloc (http://www.nedprod.com/programs/portable/nedmalloc/) or ptmalloc (See http://www.malloc.de), which are derived from versions of this malloc. System requirements: Any combination of MORECORE and/or MMAP/MUNMAP This malloc can use unix sbrk or any emulation (invoked using the CALL_MORECORE macro) and/or mmap/munmap or any emulation (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system memory. On most unix systems, it tends to work best if both MORECORE and MMAP are enabled. On Win32, it uses emulations based on VirtualAlloc. It also uses common C library functions like memset. Compliance: I believe it is compliant with the Single Unix Specification (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably others as well. * Overview of algorithms This is not the fastest, most space-conserving, most portable, or most tunable malloc ever written. However it is among the fastest while also being among the most space-conserving, portable and tunable. Consistent balance across these factors results in a good general-purpose allocator for malloc-intensive programs. In most ways, this malloc is a best-fit allocator. Generally, it chooses the best-fitting existing chunk for a request, with ties broken in approximately least-recently-used order. (This strategy normally maintains low fragmentation.) However, for requests less than 256bytes, it deviates from best-fit when there is not an exactly fitting available chunk by preferring to use space adjacent to that used for the previous small request, as well as by breaking ties in approximately most-recently-used order. (These enhance locality of series of small allocations.) And for very large requests (>= 256Kb by default), it relies on system memory mapping facilities, if supported. (This helps avoid carrying around and possibly fragmenting memory used only for large chunks.) All operations (except malloc_stats and mallinfo) have execution times that are bounded by a constant factor of the number of bits in a size_t, not counting any clearing in calloc or copying in realloc, or actions surrounding MORECORE and MMAP that have times proportional to the number of non-contiguous regions returned by system allocation routines, which is often just 1. In real-time applications, you can optionally suppress segment traversals using NO_SEGMENT_TRAVERSAL, which assures bounded execution even when system allocators return non-contiguous spaces, at the typical expense of carrying around more memory and increased fragmentation. The implementation is not very modular and seriously overuses macros. Perhaps someday all C compilers will do as good a job inlining modular code as can now be done by brute-force expansion, but now, enough of them seem not to. Some compilers issue a lot of warnings about code that is dead/unreachable only on some platforms, and also about intentional uses of negation on unsigned types. All known cases of each can be ignored. For a longer but out of date high-level description, see http://gee.cs.oswego.edu/dl/html/malloc.html * MSPACES If MSPACES is defined, then in addition to malloc, free, etc., this file also defines mspace_malloc, mspace_free, etc. These are versions of malloc routines that take an "mspace" argument obtained using create_mspace, to control all internal bookkeeping. If ONLY_MSPACES is defined, only these versions are compiled. So if you would like to use this allocator for only some allocations, and your system malloc for others, you can compile with ONLY_MSPACES and then do something like... static mspace mymspace = create_mspace(0,0); // for example #define mymalloc(bytes) mspace_malloc(mymspace, bytes) (Note: If you only need one instance of an mspace, you can instead use "USE_DL_PREFIX" to relabel the global malloc.) You can similarly create thread-local allocators by storing mspaces as thread-locals. For example: static __thread mspace tlms = 0; void* tlmalloc(size_t bytes) { if (tlms == 0) tlms = create_mspace(0, 0); return mspace_malloc(tlms, bytes); } void tlfree(void* mem) { mspace_free(tlms, mem); } Unless FOOTERS is defined, each mspace is completely independent. You cannot allocate from one and free to another (although conformance is only weakly checked, so usage errors are not always caught). If FOOTERS is defined, then each chunk carries around a tag indicating its originating mspace, and frees are directed to their originating spaces. Normally, this requires use of locks. ------------------------- Compile-time options --------------------------- Be careful in setting #define values for numerical constants of type size_t. On some systems, literal values are not automatically extended to size_t precision unless they are explicitly casted. You can also use the symbolic values MAX_SIZE_T, SIZE_T_ONE, etc below. WIN32 default: defined if _WIN32 defined Defining WIN32 sets up defaults for MS environment and compilers. Otherwise defaults are for unix. Beware that there seem to be some cases where this malloc might not be a pure drop-in replacement for Win32 malloc: Random-looking failures from Win32 GDI API's (eg; SetDIBits()) may be due to bugs in some video driver implementations when pixel buffers are malloc()ed, and the region spans more than one VirtualAlloc()ed region. Because dlmalloc uses a small (64Kb) default granularity, pixel buffers may straddle virtual allocation regions more often than when using the Microsoft allocator. You can avoid this by using VirtualAlloc() and VirtualFree() for all pixel buffers rather than using malloc(). If this is not possible, recompile this malloc with a larger DEFAULT_GRANULARITY. Note: in cases where MSC and gcc (cygwin) are known to differ on WIN32, conditions use _MSC_VER to distinguish them. DLMALLOC_EXPORT default: extern Defines how public APIs are declared. If you want to export via a Windows DLL, you might define this as #define DLMALLOC_EXPORT extern __declspec(dllexport) If you want a POSIX ELF shared object, you might use #define DLMALLOC_EXPORT extern __attribute__((visibility("default"))) MALLOC_ALIGNMENT default: (size_t)(2 * sizeof(void *)) Controls the minimum alignment for malloc'ed chunks. It must be a power of two and at least 8, even on machines for which smaller alignments would suffice. It may be defined as larger than this though. Note however that code and data structures are optimized for the case of 8-byte alignment. MSPACES default: 0 (false) If true, compile in support for independent allocation spaces. This is only supported if HAVE_MMAP is true. ONLY_MSPACES default: 0 (false) If true, only compile in mspace versions, not regular versions. USE_LOCKS default: 0 (false) Causes each call to each public routine to be surrounded with pthread or WIN32 mutex lock/unlock. (If set true, this can be overridden on a per-mspace basis for mspace versions.) If set to a non-zero value other than 1, locks are used, but their implementation is left out, so lock functions must be supplied manually, as described below. USE_SPIN_LOCKS default: 1 iff USE_LOCKS and spin locks available If true, uses custom spin locks for locking. This is currently supported only gcc >= 4.1, older gccs on x86 platforms, and recent MS compilers. Otherwise, posix locks or win32 critical sections are used. USE_RECURSIVE_LOCKS default: not defined If defined nonzero, uses recursive (aka reentrant) locks, otherwise uses plain mutexes. This is not required for malloc proper, but may be needed for layered allocators such as nedmalloc. LOCK_AT_FORK default: not defined If defined nonzero, performs pthread_atfork upon initialization to initialize child lock while holding parent lock. The implementation assumes that pthread locks (not custom locks) are being used. In other cases, you may need to customize the implementation. FOOTERS default: 0 If true, provide extra checking and dispatching by placing information in the footers of allocated chunks. This adds space and time overhead. INSECURE default: 0 If true, omit checks for usage errors and heap space overwrites. USE_DL_PREFIX default: NOT defined Causes compiler to prefix all public routines with the string 'dl'. This can be useful when you only want to use this malloc in one part of a program, using your regular system malloc elsewhere. MALLOC_INSPECT_ALL default: NOT defined If defined, compiles malloc_inspect_all and mspace_inspect_all, that perform traversal of all heap space. Unless access to these functions is otherwise restricted, you probably do not want to include them in secure implementations. ABORT default: defined as abort() Defines how to abort on failed checks. On most systems, a failed check cannot die with an "assert" or even print an informative message, because the underlying print routines in turn call malloc, which will fail again. Generally, the best policy is to simply call abort(). It's not very useful to do more than this because many errors due to overwriting will show up as address faults (null, odd addresses etc) rather than malloc-triggered checks, so will also abort. Also, most compilers know that abort() does not return, so can better optimize code conditionally calling it. PROCEED_ON_ERROR default: defined as 0 (false) Controls whether detected bad addresses cause them to bypassed rather than aborting. If set, detected bad arguments to free and realloc are ignored. And all bookkeeping information is zeroed out upon a detected overwrite of freed heap space, thus losing the ability to ever return it from malloc again, but enabling the application to proceed. If PROCEED_ON_ERROR is defined, the static variable malloc_corruption_error_count is compiled in and can be examined to see if errors have occurred. This option generates slower code than the default abort policy. DEBUG default: NOT defined The DEBUG setting is mainly intended for people trying to modify this code or diagnose problems when porting to new platforms. However, it may also be able to better isolate user errors than just using runtime checks. The assertions in the check routines spell out in more detail the assumptions and invariants underlying the algorithms. The checking is fairly extensive, and will slow down execution noticeably. Calling malloc_stats or mallinfo with DEBUG set will attempt to check every non-mmapped allocated and free chunk in the course of computing the summaries. ABORT_ON_ASSERT_FAILURE default: defined as 1 (true) Debugging assertion failures can be nearly impossible if your version of the assert macro causes malloc to be called, which will lead to a cascade of further failures, blowing the runtime stack. ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(), which will usually make debugging easier. MALLOC_FAILURE_ACTION default: sets errno to ENOMEM, or no-op on win32 The action to take before "return 0" when malloc fails to be able to return memory because there is none available. HAVE_MORECORE default: 1 (true) unless win32 or ONLY_MSPACES True if this system supports sbrk or an emulation of it. MORECORE default: sbrk The name of the sbrk-style system routine to call to obtain more memory. See below for guidance on writing custom MORECORE functions. The type of the argument to sbrk/MORECORE varies across systems. It cannot be size_t, because it supports negative arguments, so it is normally the signed type of the same width as size_t (sometimes declared as "intptr_t"). It doesn't much matter though. Internally, we only call it with arguments less than half the max value of a size_t, which should work across all reasonable possibilities, although sometimes generating compiler warnings. MORECORE_CONTIGUOUS default: 1 (true) if HAVE_MORECORE If true, take advantage of fact that consecutive calls to MORECORE with positive arguments always return contiguous increasing addresses. This is true of unix sbrk. It does not hurt too much to set it true anyway, since malloc copes with non-contiguities. Setting it false when definitely non-contiguous saves time and possibly wasted space it would take to discover this though. MORECORE_CANNOT_TRIM default: NOT defined True if MORECORE cannot release space back to the system when given negative arguments. This is generally necessary only if you are using a hand-crafted MORECORE function that cannot handle negative arguments. NO_SEGMENT_TRAVERSAL default: 0 If non-zero, suppresses traversals of memory segments returned by either MORECORE or CALL_MMAP. This disables merging of segments that are contiguous, and selectively releasing them to the OS if unused, but bounds execution times. HAVE_MMAP default: 1 (true) True if this system supports mmap or an emulation of it. If so, and HAVE_MORECORE is not true, MMAP is used for all system allocation. If set and HAVE_MORECORE is true as well, MMAP is primarily used to directly allocate very large blocks. It is also used as a backup strategy in cases where MORECORE fails to provide space from system. Note: A single call to MUNMAP is assumed to be able to unmap memory that may have be allocated using multiple calls to MMAP, so long as they are adjacent. HAVE_MREMAP default: 1 on linux, else 0 If true realloc() uses mremap() to re-allocate large blocks and extend or shrink allocation spaces. MMAP_CLEARS default: 1 except on WINCE. True if mmap clears memory so calloc doesn't need to. This is true for standard unix mmap using /dev/zero and on WIN32 except for WINCE. USE_BUILTIN_FFS default: 0 (i.e., not used) Causes malloc to use the builtin ffs() function to compute indices. Some compilers may recognize and intrinsify ffs to be faster than the supplied C version. Also, the case of x86 using gcc is special-cased to an asm instruction, so is already as fast as it can be, and so this setting has no effect. Similarly for Win32 under recent MS compilers. (On most x86s, the asm version is only slightly faster than the C version.) malloc_getpagesize default: derive from system includes, or 4096. The system page size. To the extent possible, this malloc manages memory from the system in page-size units. This may be (and usually is) a function rather than a constant. This is ignored if WIN32, where page size is determined using getSystemInfo during initialization. USE_DEV_RANDOM default: 0 (i.e., not used) Causes malloc to use /dev/random to initialize secure magic seed for stamping footers. Otherwise, the current time is used. NO_MALLINFO default: 0 If defined, don't compile "mallinfo". This can be a simple way of dealing with mismatches between system declarations and those in this file. MALLINFO_FIELD_TYPE default: size_t The type of the fields in the mallinfo struct. This was originally defined as "int" in SVID etc, but is more usefully defined as size_t. The value is used only if HAVE_USR_INCLUDE_MALLOC_H is not set NO_MALLOC_STATS default: 0 If defined, don't compile "malloc_stats". This avoids calls to fprintf and bringing in stdio dependencies you might not want. REALLOC_ZERO_BYTES_FREES default: not defined This should be set if a call to realloc with zero bytes should be the same as a call to free. Some people think it should. Otherwise, since this malloc returns a unique pointer for malloc(0), so does realloc(p, 0). LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H, LACKS_ERRNO_H LACKS_STDLIB_H LACKS_SCHED_H LACKS_TIME_H default: NOT defined unless on WIN32 Define these if your system does not have these header files. You might need to manually insert some of the declarations they provide. DEFAULT_GRANULARITY default: page size if MORECORE_CONTIGUOUS, system_info.dwAllocationGranularity in WIN32, otherwise 64K. Also settable using mallopt(M_GRANULARITY, x) The unit for allocating and deallocating memory from the system. On most systems with contiguous MORECORE, there is no reason to make this more than a page. However, systems with MMAP tend to either require or encourage larger granularities. You can increase this value to prevent system allocation functions to be called so often, especially if they are slow. The value must be at least one page and must be a power of two. Setting to 0 causes initialization to either page size or win32 region size. (Note: In previous versions of malloc, the equivalent of this option was called "TOP_PAD") DEFAULT_TRIM_THRESHOLD default: 2MB Also settable using mallopt(M_TRIM_THRESHOLD, x) The maximum amount of unused top-most memory to keep before releasing via malloc_trim in free(). Automatic trimming is mainly useful in long-lived programs using contiguous MORECORE. Because trimming via sbrk can be slow on some systems, and can sometimes be wasteful (in cases where programs immediately afterward allocate more large chunks) the value should be high enough so that your overall system performance would improve by releasing this much memory. As a rough guide, you might set to a value close to the average size of a process (program) running on your system. Releasing this much memory would allow such a process to run in memory. Generally, it is worth tuning trim thresholds when a program undergoes phases where several large chunks are allocated and released in ways that can reuse each other's storage, perhaps mixed with phases where there are no such chunks at all. The trim value must be greater than page size to have any useful effect. To disable trimming completely, you can set to MAX_SIZE_T. Note that the trick some people use of mallocing a huge space and then freeing it at program startup, in an attempt to reserve system memory, doesn't have the intended effect under automatic trimming, since that memory will immediately be returned to the system. DEFAULT_MMAP_THRESHOLD default: 256K Also settable using mallopt(M_MMAP_THRESHOLD, x) The request size threshold for using MMAP to directly service a request. Requests of at least this size that cannot be allocated using already-existing space will be serviced via mmap. (If enough normal freed space already exists it is used instead.) Using mmap segregates relatively large chunks of memory so that they can be individually obtained and released from the host system. A request serviced through mmap is never reused by any other request (at least not directly; the system may just so happen to remap successive requests to the same locations). Segregating space in this way has the benefits that: Mmapped space can always be individually released back to the system, which helps keep the system level memory demands of a long-lived program low. Also, mapped memory doesn't become `locked' between other chunks, as can happen with normally allocated chunks, which means that even trimming via malloc_trim would not release them. However, it has the disadvantage that the space cannot be reclaimed, consolidated, and then used to service later requests, as happens with normal chunks. The advantages of mmap nearly always outweigh disadvantages for "large" chunks, but the value of "large" may vary across systems. The default is an empirically derived value that works well in most systems. You can disable mmap by setting to MAX_SIZE_T. MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP The number of consolidated frees between checks to release unused segments when freeing. When using non-contiguous segments, especially with multiple mspaces, checking only for topmost space doesn't always suffice to trigger trimming. To compensate for this, free() will, with a period of MAX_RELEASE_CHECK_RATE (or the current number of segments, if greater) try to release unused segments to the OS when freeing chunks that result in consolidation. The best value for this parameter is a compromise between slowing down frees with relatively costly checks that rarely trigger versus holding on to unused memory. To effectively disable, set to MAX_SIZE_T. This may lead to a very slight speed improvement at the expense of carrying around more memory. */ /* Version identifier to allow people to support multiple versions */ #ifndef DLMALLOC_VERSION #define DLMALLOC_VERSION 20806 #endif /* DLMALLOC_VERSION */ #ifndef DLMALLOC_EXPORT #define DLMALLOC_EXPORT extern #endif #ifndef WIN32 #ifdef _WIN32 #define WIN32 1 #endif /* _WIN32 */ #ifdef _WIN32_WCE #define LACKS_FCNTL_H #define WIN32 1 #endif /* _WIN32_WCE */ #endif /* WIN32 */ #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include #include #define HAVE_MMAP 1 #define HAVE_MORECORE 0 #define LACKS_UNISTD_H #define LACKS_SYS_PARAM_H #define LACKS_SYS_MMAN_H #define LACKS_STRING_H #define LACKS_STRINGS_H #define LACKS_SYS_TYPES_H #define LACKS_ERRNO_H #define LACKS_SCHED_H #ifndef MALLOC_FAILURE_ACTION #define MALLOC_FAILURE_ACTION #endif /* MALLOC_FAILURE_ACTION */ #ifndef MMAP_CLEARS #ifdef _WIN32_WCE /* WINCE reportedly does not clear */ #define MMAP_CLEARS 0 #else #define MMAP_CLEARS 1 #endif /* _WIN32_WCE */ #endif /*MMAP_CLEARS */ #endif /* WIN32 */ #if defined(DARWIN) || defined(_DARWIN) /* Mac OSX docs advise not to use sbrk; it seems better to use mmap */ #ifndef HAVE_MORECORE #define HAVE_MORECORE 0 #define HAVE_MMAP 1 /* OSX allocators provide 16 byte alignment */ #ifndef MALLOC_ALIGNMENT #define MALLOC_ALIGNMENT ((size_t)16U) #endif #endif /* HAVE_MORECORE */ #endif /* DARWIN */ #ifndef LACKS_SYS_TYPES_H #include /* For size_t */ #endif /* LACKS_SYS_TYPES_H */ /* The maximum possible size_t value has all bits set */ #define MAX_SIZE_T (~(size_t)0) #ifndef USE_LOCKS /* ensure true if spin or recursive locks set */ #if ((defined(USE_SPIN_LOCKS) && USE_SPIN_LOCKS != 0) || \ (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0)) #then #define USE_LOCKS 1 #else #define USE_LOCKS 0 #endif #endif /* USE_LOCKS */ #if USE_LOCKS /* Spin locks for gcc >= 4.1, older gcc on x86, MSC >= 1310 */ #if ((defined(__GNUC__) && \ ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) || \ defined(__i386__) || defined(__x86_64__))) || \ (defined(_MSC_VER) && _MSC_VER>=1310)) #ifndef USE_SPIN_LOCKS #define USE_SPIN_LOCKS 1 #endif /* USE_SPIN_LOCKS */ #elif USE_SPIN_LOCKS #error "USE_SPIN_LOCKS defined without implementation" #endif /* ... locks available... */ #elif !defined(USE_SPIN_LOCKS) #define USE_SPIN_LOCKS 0 #endif /* USE_LOCKS */ #ifndef ONLY_MSPACES #define ONLY_MSPACES 0 #endif /* ONLY_MSPACES */ #ifndef MSPACES #if ONLY_MSPACES #define MSPACES 1 #else /* ONLY_MSPACES */ #define MSPACES 0 #endif /* ONLY_MSPACES */ #endif /* MSPACES */ #ifndef MALLOC_ALIGNMENT #define MALLOC_ALIGNMENT ((size_t)(2 * sizeof(void *))) #endif /* MALLOC_ALIGNMENT */ #ifndef FOOTERS #define FOOTERS 0 #endif /* FOOTERS */ #ifndef ABORT #define ABORT abort() #endif /* ABORT */ #ifndef ABORT_ON_ASSERT_FAILURE #define ABORT_ON_ASSERT_FAILURE 1 #endif /* ABORT_ON_ASSERT_FAILURE */ #ifndef PROCEED_ON_ERROR #define PROCEED_ON_ERROR 0 #endif /* PROCEED_ON_ERROR */ #ifndef INSECURE #define INSECURE 0 #endif /* INSECURE */ #ifndef MALLOC_INSPECT_ALL #define MALLOC_INSPECT_ALL 0 #endif /* MALLOC_INSPECT_ALL */ #ifndef HAVE_MMAP #define HAVE_MMAP 1 #endif /* HAVE_MMAP */ #ifndef MMAP_CLEARS #define MMAP_CLEARS 1 #endif /* MMAP_CLEARS */ #ifndef HAVE_MREMAP #ifdef linux #define HAVE_MREMAP 1 #define _GNU_SOURCE /* Turns on mremap() definition */ #else /* linux */ #define HAVE_MREMAP 0 #endif /* linux */ #endif /* HAVE_MREMAP */ #ifndef MALLOC_FAILURE_ACTION #define MALLOC_FAILURE_ACTION errno = ENOMEM; #endif /* MALLOC_FAILURE_ACTION */ #ifndef HAVE_MORECORE #if ONLY_MSPACES #define HAVE_MORECORE 0 #else /* ONLY_MSPACES */ #define HAVE_MORECORE 1 #endif /* ONLY_MSPACES */ #endif /* HAVE_MORECORE */ #if !HAVE_MORECORE #define MORECORE_CONTIGUOUS 0 #else /* !HAVE_MORECORE */ #define MORECORE_DEFAULT sbrk #ifndef MORECORE_CONTIGUOUS #define MORECORE_CONTIGUOUS 1 #endif /* MORECORE_CONTIGUOUS */ #endif /* HAVE_MORECORE */ #ifndef DEFAULT_GRANULARITY #if (MORECORE_CONTIGUOUS || defined(WIN32)) #define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ #else /* MORECORE_CONTIGUOUS */ #define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U) #endif /* MORECORE_CONTIGUOUS */ #endif /* DEFAULT_GRANULARITY */ #ifndef DEFAULT_TRIM_THRESHOLD #ifndef MORECORE_CANNOT_TRIM #define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) #else /* MORECORE_CANNOT_TRIM */ #define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T #endif /* MORECORE_CANNOT_TRIM */ #endif /* DEFAULT_TRIM_THRESHOLD */ #ifndef DEFAULT_MMAP_THRESHOLD #if HAVE_MMAP #define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) #else /* HAVE_MMAP */ #define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T #endif /* HAVE_MMAP */ #endif /* DEFAULT_MMAP_THRESHOLD */ #ifndef MAX_RELEASE_CHECK_RATE #if HAVE_MMAP #define MAX_RELEASE_CHECK_RATE 4095 #else #define MAX_RELEASE_CHECK_RATE MAX_SIZE_T #endif /* HAVE_MMAP */ #endif /* MAX_RELEASE_CHECK_RATE */ #ifndef USE_BUILTIN_FFS #define USE_BUILTIN_FFS 0 #endif /* USE_BUILTIN_FFS */ #ifndef USE_DEV_RANDOM #define USE_DEV_RANDOM 0 #endif /* USE_DEV_RANDOM */ #ifndef NO_MALLINFO #define NO_MALLINFO 0 #endif /* NO_MALLINFO */ #ifndef MALLINFO_FIELD_TYPE #define MALLINFO_FIELD_TYPE size_t #endif /* MALLINFO_FIELD_TYPE */ #ifndef NO_MALLOC_STATS #define NO_MALLOC_STATS 0 #endif /* NO_MALLOC_STATS */ #ifndef NO_SEGMENT_TRAVERSAL #define NO_SEGMENT_TRAVERSAL 0 #endif /* NO_SEGMENT_TRAVERSAL */ /* mallopt tuning options. SVID/XPG defines four standard parameter numbers for mallopt, normally defined in malloc.h. None of these are used in this malloc, so setting them has no effect. But this malloc does support the following options. */ #define M_TRIM_THRESHOLD (-1) #define M_GRANULARITY (-2) #define M_MMAP_THRESHOLD (-3) /* ------------------------ Mallinfo declarations ------------------------ */ #if !NO_MALLINFO /* This version of malloc supports the standard SVID/XPG mallinfo routine that returns a struct containing usage properties and statistics. It should work on any system that has a /usr/include/malloc.h defining struct mallinfo. The main declaration needed is the mallinfo struct that is returned (by-copy) by mallinfo(). The malloinfo struct contains a bunch of fields that are not even meaningful in this version of malloc. These fields are are instead filled by mallinfo() with other numbers that might be of interest. HAVE_USR_INCLUDE_MALLOC_H should be set if you have a /usr/include/malloc.h file that includes a declaration of struct mallinfo. If so, it is included; else a compliant version is declared below. These must be precisely the same for mallinfo() to work. The original SVID version of this struct, defined on most systems with mallinfo, declares all fields as ints. But some others define as unsigned long. If your system defines the fields using a type of different width than listed here, you MUST #include your system version and #define HAVE_USR_INCLUDE_MALLOC_H. */ /* #define HAVE_USR_INCLUDE_MALLOC_H */ #ifdef HAVE_USR_INCLUDE_MALLOC_H #include "/usr/include/malloc.h" #else /* HAVE_USR_INCLUDE_MALLOC_H */ #ifndef STRUCT_MALLINFO_DECLARED /* HP-UX (and others?) redefines mallinfo unless _STRUCT_MALLINFO is defined */ #define _STRUCT_MALLINFO #define STRUCT_MALLINFO_DECLARED 1 struct mallinfo { MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ MALLINFO_FIELD_TYPE smblks; /* always 0 */ MALLINFO_FIELD_TYPE hblks; /* always 0 */ MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ MALLINFO_FIELD_TYPE fordblks; /* total free space */ MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ }; #endif /* STRUCT_MALLINFO_DECLARED */ #endif /* HAVE_USR_INCLUDE_MALLOC_H */ #endif /* NO_MALLINFO */ /* Try to persuade compilers to inline. The most critical functions for inlining are defined as macros, so these aren't used for them. */ #ifndef FORCEINLINE #if defined(__GNUC__) #define FORCEINLINE __inline __attribute__ ((always_inline)) #elif defined(_MSC_VER) #define FORCEINLINE __forceinline #endif #endif #ifndef NOINLINE #if defined(__GNUC__) #define NOINLINE __attribute__ ((noinline)) #elif defined(_MSC_VER) #define NOINLINE __declspec(noinline) #else #define NOINLINE #endif #endif #ifdef __cplusplus extern "C" { #ifndef FORCEINLINE #define FORCEINLINE inline #endif #endif /* __cplusplus */ #ifndef FORCEINLINE #define FORCEINLINE #endif # define preconcat(x,y) x ## y # define concat(x,y) preconcat(x,y) #ifdef MSPACE_PREFIX #define mspace_prefix(f) concat(MSPACE_PREFIX,f) #define mspace_malloc mspace_prefix(mspace_malloc) #define mspace_free mspace_prefix(mspace_free) #define mspace_calloc mspace_prefix(mspace_calloc) #define mspace_realloc mspace_prefix(mspace_realloc) #define mspace_realloc_in_place mspace_prefix(mspace_realloc_in_place) #define mspace_memalign mspace_prefix(mspace_memalign) #define mspace_aligned_alloc mspace_prefix(mspace_aligned_alloc) #define mspace_posix_memalign mspace_prefix(mspace_posix_memalign) #define mspace_independent_calloc mspace_prefix(mspace_independent_calloc) #define mspace_independent_comalloc mspace_prefix(mspace_independent_comalloc) #define mspace_bulk_free mspace_prefix(mspace_bulk_free) #define mspace_usable_size mspace_prefix(mspace_usable_size) #define mspace_malloc_stats mspace_prefix(mspace_malloc_stats) #define mspace_trim mspace_prefix(mspace_trim) #define mspace_footprint mspace_prefix(mspace_footprint) #define mspace_max_footprint mspace_prefix(mspace_max_footprint) #define mspace_footprint_limit mspace_prefix(mspace_footprint_limit) #define mspace_set_footprint_limit mspace_prefix(mspace_set_footprint_limit) #define mspace_inspect_all mspace_prefix(mspace_inspect_all) #define create_mspace mspace_prefix(create_mspace) #define create_mspace_with_base mspace_prefix(create_mspace_with_base) #define destroy_mspace mspace_prefix(destroy_mspace) #define mspace_least_addr mspace_prefix(mspace_least_addr) #define mspace_mallopt mspace_prefix(mspace_mallopt) #define mspace_track_large_chunks mspace_prefix(mspace_track_large_chunks) #endif #if !ONLY_MSPACES /* ------------------- Declarations of public routines ------------------- */ #ifndef USE_DL_PREFIX #define dlcalloc calloc #define dlfree free #define dlmalloc malloc #define dlmemalign memalign #define dlposix_memalign posix_memalign #define dlaligned_alloc aligned_alloc #define dlrealloc realloc #define dlrealloc_in_place realloc_in_place #define dlvalloc valloc #define dlpvalloc pvalloc #define dlmallinfo mallinfo #define dlmallopt mallopt #define dlmalloc_trim malloc_trim #define dlmalloc_stats malloc_stats #define dlmalloc_usable_size malloc_usable_size #define dlmalloc_footprint malloc_footprint #define dlmalloc_max_footprint malloc_max_footprint #define dlmalloc_footprint_limit malloc_footprint_limit #define dlmalloc_set_footprint_limit malloc_set_footprint_limit #define dlmalloc_inspect_all malloc_inspect_all #define dlindependent_calloc independent_calloc #define dlindependent_comalloc independent_comalloc #define dlbulk_free bulk_free #endif /* USE_DL_PREFIX */ /* malloc(size_t n) Returns a pointer to a newly allocated chunk of at least n bytes, or null if no space is available, in which case errno is set to ENOMEM on ANSI C systems. If n is zero, malloc returns a minimum-sized chunk. (The minimum size is 16 bytes on most 32bit systems, and 32 bytes on 64bit systems.) Note that size_t is an unsigned type, so calls with arguments that would be negative if signed are interpreted as requests for huge amounts of space, which will often fail. The maximum supported value of n differs across systems, but is in all cases less than the maximum representable value of a size_t. */ DLMALLOC_EXPORT void* dlmalloc(size_t); /* free(void* p) Releases the chunk of memory pointed to by p, that had been previously allocated using malloc or a related routine such as realloc. It has no effect if p is null. If p was not malloced or already freed, free(p) will by default cause the current program to abort. */ DLMALLOC_EXPORT void dlfree(void*); /* calloc(size_t n_elements, size_t element_size); Returns a pointer to n_elements * element_size bytes, with all locations set to zero. */ DLMALLOC_EXPORT void* dlcalloc(size_t, size_t); /* realloc(void* p, size_t n) Returns a pointer to a chunk of size n that contains the same data as does chunk p up to the minimum of (n, p's size) bytes, or null if no space is available. The returned pointer may or may not be the same as p. The algorithm prefers extending p in most cases when possible, otherwise it employs the equivalent of a malloc-copy-free sequence. If p is null, realloc is equivalent to malloc. If space is not available, realloc returns null, errno is set (if on ANSI) and p is NOT freed. if n is for fewer bytes than already held by p, the newly unused space is lopped off and freed if possible. realloc with a size argument of zero (re)allocates a minimum-sized chunk. The old unix realloc convention of allowing the last-free'd chunk to be used as an argument to realloc is not supported. */ DLMALLOC_EXPORT void* dlrealloc(void*, size_t); /* realloc_in_place(void* p, size_t n) Resizes the space allocated for p to size n, only if this can be done without moving p (i.e., only if there is adjacent space available if n is greater than p's current allocated size, or n is less than or equal to p's size). This may be used instead of plain realloc if an alternative allocation strategy is needed upon failure to expand space; for example, reallocation of a buffer that must be memory-aligned or cleared. You can use realloc_in_place to trigger these alternatives only when needed. Returns p if successful; otherwise null. */ DLMALLOC_EXPORT void* dlrealloc_in_place(void*, size_t); /* memalign(size_t alignment, size_t n); Returns a pointer to a newly allocated chunk of n bytes, aligned in accord with the alignment argument. The alignment argument should be a power of two. If the argument is not a power of two, the nearest greater power is used. 8-byte alignment is guaranteed by normal malloc calls, so don't bother calling memalign with an argument of 8 or less. Overreliance on memalign is a sure way to fragment space. */ DLMALLOC_EXPORT void* dlmemalign(size_t, size_t); /* int posix_memalign(void** pp, size_t alignment, size_t n); Allocates a chunk of n bytes, aligned in accord with the alignment argument. Differs from memalign only in that it (1) assigns the allocated memory to *pp rather than returning it, (2) fails and returns EINVAL if the alignment is not a power of two (3) fails and returns ENOMEM if memory cannot be allocated. */ DLMALLOC_EXPORT int dlposix_memalign(void**, size_t, size_t); /* aligned_alloc(size_t alignment, size_t size); The function aligned_alloc() is the same as memalign(), except for the added restriction that size should be a multiple of alignment. */ DLMALLOC_EXPORT void *dlaligned_alloc(size_t alignment, size_t size); /* valloc(size_t n); Equivalent to memalign(pagesize, n), where pagesize is the page size of the system. If the pagesize is unknown, 4096 is used. */ DLMALLOC_EXPORT void* dlvalloc(size_t); /* mallopt(int parameter_number, int parameter_value) Sets tunable parameters The format is to provide a (parameter-number, parameter-value) pair. mallopt then sets the corresponding parameter to the argument value if it can (i.e., so long as the value is meaningful), and returns 1 if successful else 0. To workaround the fact that mallopt is specified to use int, not size_t parameters, the value -1 is specially treated as the maximum unsigned size_t value. SVID/XPG/ANSI defines four standard param numbers for mallopt, normally defined in malloc.h. None of these are use in this malloc, so setting them has no effect. But this malloc also supports other options in mallopt. See below for details. Briefly, supported parameters are as follows (listed defaults are for "typical" configurations). Symbol param # default allowed param values M_TRIM_THRESHOLD -1 2*1024*1024 any (-1 disables) M_GRANULARITY -2 page size any power of 2 >= page size M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support) */ DLMALLOC_EXPORT int dlmallopt(int, int); /* malloc_footprint(); Returns the number of bytes obtained from the system. The total number of bytes allocated by malloc, realloc etc., is less than this value. Unlike mallinfo, this function returns only a precomputed result, so can be called frequently to monitor memory consumption. Even if locks are otherwise defined, this function does not use them, so results might not be up to date. */ DLMALLOC_EXPORT size_t dlmalloc_footprint(void); /* malloc_max_footprint(); Returns the maximum number of bytes obtained from the system. This value will be greater than current footprint if deallocated space has been reclaimed by the system. The peak number of bytes allocated by malloc, realloc etc., is less than this value. Unlike mallinfo, this function returns only a precomputed result, so can be called frequently to monitor memory consumption. Even if locks are otherwise defined, this function does not use them, so results might not be up to date. */ DLMALLOC_EXPORT size_t dlmalloc_max_footprint(void); /* malloc_footprint_limit(); Returns the number of bytes that the heap is allowed to obtain from the system, returning the last value returned by malloc_set_footprint_limit, or the maximum size_t value if never set. The returned value reflects a permission. There is no guarantee that this number of bytes can actually be obtained from the system. */ DLMALLOC_EXPORT size_t dlmalloc_footprint_limit(); /* malloc_set_footprint_limit(); Sets the maximum number of bytes to obtain from the system, causing failure returns from malloc and related functions upon attempts to exceed this value. The argument value may be subject to page rounding to an enforceable limit; this actual value is returned. Using an argument of the maximum possible size_t effectively disables checks. If the argument is less than or equal to the current malloc_footprint, then all future allocations that require additional system memory will fail. However, invocation cannot retroactively deallocate existing used memory. */ DLMALLOC_EXPORT size_t dlmalloc_set_footprint_limit(size_t bytes); #if MALLOC_INSPECT_ALL /* malloc_inspect_all(void(*handler)(void *start, void *end, size_t used_bytes, void* callback_arg), void* arg); Traverses the heap and calls the given handler for each managed region, skipping all bytes that are (or may be) used for bookkeeping purposes. Traversal does not include include chunks that have been directly memory mapped. Each reported region begins at the start address, and continues up to but not including the end address. The first used_bytes of the region contain allocated data. If used_bytes is zero, the region is unallocated. The handler is invoked with the given callback argument. If locks are defined, they are held during the entire traversal. It is a bad idea to invoke other malloc functions from within the handler. For example, to count the number of in-use chunks with size greater than 1000, you could write: static int count = 0; void count_chunks(void* start, void* end, size_t used, void* arg) { if (used >= 1000) ++count; } then: malloc_inspect_all(count_chunks, NULL); malloc_inspect_all is compiled only if MALLOC_INSPECT_ALL is defined. */ DLMALLOC_EXPORT void dlmalloc_inspect_all(void(*handler)(void*, void *, size_t, void*), void* arg); #endif /* MALLOC_INSPECT_ALL */ #if !NO_MALLINFO /* mallinfo() Returns (by copy) a struct containing various summary statistics: arena: current total non-mmapped bytes allocated from system ordblks: the number of free chunks smblks: always zero. hblks: current number of mmapped regions hblkhd: total bytes held in mmapped regions usmblks: the maximum total allocated space. This will be greater than current total if trimming has occurred. fsmblks: always zero uordblks: current total allocated space (normal or mmapped) fordblks: total free space keepcost: the maximum number of bytes that could ideally be released back to system via malloc_trim. ("ideally" means that it ignores page restrictions etc.) Because these fields are ints, but internal bookkeeping may be kept as longs, the reported values may wrap around zero and thus be inaccurate. */ DLMALLOC_EXPORT struct mallinfo dlmallinfo(void); #endif /* NO_MALLINFO */ /* independent_calloc(size_t n_elements, size_t element_size, void* chunks[]); independent_calloc is similar to calloc, but instead of returning a single cleared space, it returns an array of pointers to n_elements independent elements that can hold contents of size elem_size, each of which starts out cleared, and can be independently freed, realloc'ed etc. The elements are guaranteed to be adjacently allocated (this is not guaranteed to occur with multiple callocs or mallocs), which may also improve cache locality in some applications. The "chunks" argument is optional (i.e., may be null, which is probably the most typical usage). If it is null, the returned array is itself dynamically allocated and should also be freed when it is no longer needed. Otherwise, the chunks array must be of at least n_elements in length. It is filled in with the pointers to the chunks. In either case, independent_calloc returns this pointer array, or null if the allocation failed. If n_elements is zero and "chunks" is null, it returns a chunk representing an array with zero elements (which should be freed if not wanted). Each element must be freed when it is no longer needed. This can be done all at once using bulk_free. independent_calloc simplifies and speeds up implementations of many kinds of pools. It may also be useful when constructing large data structures that initially have a fixed number of fixed-sized nodes, but the number is not known at compile time, and some of the nodes may later need to be freed. For example: struct Node { int item; struct Node* next; }; struct Node* build_list() { struct Node** pool; int n = read_number_of_nodes_needed(); if (n <= 0) return 0; pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0); if (pool == 0) die(); // organize into a linked list... struct Node* first = pool[0]; for (i = 0; i < n-1; ++i) pool[i]->next = pool[i+1]; free(pool); // Can now free the array (or not, if it is needed later) return first; } */ DLMALLOC_EXPORT void** dlindependent_calloc(size_t, size_t, void**); /* independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]); independent_comalloc allocates, all at once, a set of n_elements chunks with sizes indicated in the "sizes" array. It returns an array of pointers to these elements, each of which can be independently freed, realloc'ed etc. The elements are guaranteed to be adjacently allocated (this is not guaranteed to occur with multiple callocs or mallocs), which may also improve cache locality in some applications. The "chunks" argument is optional (i.e., may be null). If it is null the returned array is itself dynamically allocated and should also be freed when it is no longer needed. Otherwise, the chunks array must be of at least n_elements in length. It is filled in with the pointers to the chunks. In either case, independent_comalloc returns this pointer array, or null if the allocation failed. If n_elements is zero and chunks is null, it returns a chunk representing an array with zero elements (which should be freed if not wanted). Each element must be freed when it is no longer needed. This can be done all at once using bulk_free. independent_comallac differs from independent_calloc in that each element may have a different size, and also that it does not automatically clear elements. independent_comalloc can be used to speed up allocation in cases where several structs or objects must always be allocated at the same time. For example: struct Head { ... } struct Foot { ... } void send_message(char* msg) { int msglen = strlen(msg); size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) }; void* chunks[3]; if (independent_comalloc(3, sizes, chunks) == 0) die(); struct Head* head = (struct Head*)(chunks[0]); char* body = (char*)(chunks[1]); struct Foot* foot = (struct Foot*)(chunks[2]); // ... } In general though, independent_comalloc is worth using only for larger values of n_elements. For small values, you probably won't detect enough difference from series of malloc calls to bother. Overuse of independent_comalloc can increase overall memory usage, since it cannot reuse existing noncontiguous small chunks that might be available for some of the elements. */ DLMALLOC_EXPORT void** dlindependent_comalloc(size_t, size_t*, void**); /* bulk_free(void* array[], size_t n_elements) Frees and clears (sets to null) each non-null pointer in the given array. This is likely to be faster than freeing them one-by-one. If footers are used, pointers that have been allocated in different mspaces are not freed or cleared, and the count of all such pointers is returned. For large arrays of pointers with poor locality, it may be worthwhile to sort this array before calling bulk_free. */ DLMALLOC_EXPORT size_t dlbulk_free(void**, size_t n_elements); /* pvalloc(size_t n); Equivalent to valloc(minimum-page-that-holds(n)), that is, round up n to nearest pagesize. */ DLMALLOC_EXPORT void* dlpvalloc(size_t); /* malloc_trim(size_t pad); If possible, gives memory back to the system (via negative arguments to sbrk) if there is unused memory at the `high' end of the malloc pool or in unused MMAP segments. You can call this after freeing large blocks of memory to potentially reduce the system-level memory requirements of a program. However, it cannot guarantee to reduce memory. Under some allocation patterns, some large free blocks of memory will be locked between two used chunks, so they cannot be given back to the system. The `pad' argument to malloc_trim represents the amount of free trailing space to leave untrimmed. If this argument is zero, only the minimum amount of memory to maintain internal data structures will be left. Non-zero arguments can be supplied to maintain enough trailing space to service future expected allocations without having to re-obtain memory from the system. Malloc_trim returns 1 if it actually released any memory, else 0. */ DLMALLOC_EXPORT int dlmalloc_trim(size_t); /* malloc_stats(); Prints on stderr the amount of space obtained from the system (both via sbrk and mmap), the maximum amount (which may be more than current if malloc_trim and/or munmap got called), and the current number of bytes allocated via malloc (or realloc, etc) but not yet freed. Note that this is the number of bytes allocated, not the number requested. It will be larger than the number requested because of alignment and bookkeeping overhead. Because it includes alignment wastage as being in use, this figure may be greater than zero even when no user-level chunks are allocated. The reported current and maximum system memory can be inaccurate if a program makes other calls to system memory allocation functions (normally sbrk) outside of malloc. malloc_stats prints only the most commonly interesting statistics. More information can be obtained by calling mallinfo. */ DLMALLOC_EXPORT void dlmalloc_stats(void); /* malloc_usable_size(void* p); Returns the number of bytes you can actually use in an allocated chunk, which may be more than you requested (although often not) due to alignment and minimum size constraints. You can use this many bytes without worrying about overwriting other allocated objects. This is not a particularly great programming practice. malloc_usable_size can be more useful in debugging and assertions, for example: p = malloc(n); assert(malloc_usable_size(p) >= 256); */ size_t dlmalloc_usable_size(void*); #endif /* ONLY_MSPACES */ #if MSPACES /* mspace is an opaque type representing an independent region of space that supports mspace_malloc, etc. */ typedef void* mspace; /* create_mspace creates and returns a new independent space with the given initial capacity, or, if 0, the default granularity size. It returns null if there is no system memory available to create the space. If argument locked is non-zero, the space uses a separate lock to control access. The capacity of the space will grow dynamically as needed to service mspace_malloc requests. You can control the sizes of incremental increases of this space by compiling with a different DEFAULT_GRANULARITY or dynamically setting with mallopt(M_GRANULARITY, value). */ DLMALLOC_EXPORT mspace create_mspace(size_t capacity, int locked); /* destroy_mspace destroys the given space, and attempts to return all of its memory back to the system, returning the total number of bytes freed. After destruction, the results of access to all memory used by the space become undefined. */ DLMALLOC_EXPORT size_t destroy_mspace(mspace msp); /* create_mspace_with_base uses the memory supplied as the initial base of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this space is used for bookkeeping, so the capacity must be at least this large. (Otherwise 0 is returned.) When this initial space is exhausted, additional memory will be obtained from the system. Destroying this space will deallocate all additionally allocated space (if possible) but not the initial base. */ DLMALLOC_EXPORT mspace create_mspace_with_base(void* base, size_t capacity, int locked); /* mspace_track_large_chunks controls whether requests for large chunks are allocated in their own untracked mmapped regions, separate from others in this mspace. By default large chunks are not tracked, which reduces fragmentation. However, such chunks are not necessarily released to the system upon destroy_mspace. Enabling tracking by setting to true may increase fragmentation, but avoids leakage when relying on destroy_mspace to release all memory allocated using this space. The function returns the previous setting. */ DLMALLOC_EXPORT int mspace_track_large_chunks(mspace msp, int enable); /* mspace_malloc behaves as malloc, but operates within the given space. */ DLMALLOC_EXPORT void* mspace_malloc(mspace msp, size_t bytes); /* mspace_free behaves as free, but operates within the given space. If compiled with FOOTERS==1, mspace_free is not actually needed. free may be called instead of mspace_free because freed chunks from any space are handled by their originating spaces. */ DLMALLOC_EXPORT void mspace_free(mspace msp, void* mem); /* mspace_realloc behaves as realloc, but operates within the given space. If compiled with FOOTERS==1, mspace_realloc is not actually needed. realloc may be called instead of mspace_realloc because realloced chunks from any space are handled by their originating spaces. */ DLMALLOC_EXPORT void* mspace_realloc(mspace msp, void* mem, size_t newsize); /* mspace_calloc behaves as calloc, but operates within the given space. */ DLMALLOC_EXPORT void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size); /* mspace_memalign behaves as memalign, but operates within the given space. */ DLMALLOC_EXPORT void* mspace_memalign(mspace msp, size_t alignment, size_t bytes); /* mspace_aligned_alloc behaves as aligned_alloc, but operates within the given space. */ DLMALLOC_EXPORT void* mspace_aligned_alloc(mspace msp, size_t alignment, size_t bytes); /* mspace_posix_memalign behaves as posix_memalign, but operates within the given space. */ DLMALLOC_EXPORT int mspace_posix_memalign(mspace msp, void **pp, size_t alignment, size_t bytes); /* mspace_independent_calloc behaves as independent_calloc, but operates within the given space. */ DLMALLOC_EXPORT void** mspace_independent_calloc(mspace msp, size_t n_elements, size_t elem_size, void* chunks[]); /* mspace_independent_comalloc behaves as independent_comalloc, but operates within the given space. */ DLMALLOC_EXPORT void** mspace_independent_comalloc(mspace msp, size_t n_elements, size_t sizes[], void* chunks[]); /* mspace_footprint() returns the number of bytes obtained from the system for this space. */ DLMALLOC_EXPORT size_t mspace_footprint(mspace msp); /* mspace_max_footprint() returns the peak number of bytes obtained from the system for this space. */ DLMALLOC_EXPORT size_t mspace_max_footprint(mspace msp); /* Return least address of this mspace */ DLMALLOC_EXPORT void* mspace_least_addr(mspace); #if !NO_MALLINFO /* mspace_mallinfo behaves as mallinfo, but reports properties of the given space. */ DLMALLOC_EXPORT struct mallinfo mspace_mallinfo(mspace msp); #endif /* NO_MALLINFO */ /* malloc_usable_size(void* p) behaves the same as malloc_usable_size; */ DLMALLOC_EXPORT size_t mspace_usable_size(const void* mem); /* mspace_malloc_stats behaves as malloc_stats, but reports properties of the given space. */ DLMALLOC_EXPORT void mspace_malloc_stats(mspace msp); /* mspace_trim behaves as malloc_trim, but operates within the given space. */ DLMALLOC_EXPORT int mspace_trim(mspace msp, size_t pad); /* An alias for mallopt. */ DLMALLOC_EXPORT int mspace_mallopt(int, int); #endif /* MSPACES */ #ifdef __cplusplus } /* end of extern "C" */ #endif /* __cplusplus */ /* ======================================================================== To make a fully customizable malloc.h header file, cut everything above this line, put into file malloc.h, edit to suit, and #include it on the next line, as well as in programs that use this malloc. ======================================================================== */ /* #include "malloc.h" */ /*------------------------------ internal #includes ---------------------- */ #ifdef _MSC_VER #pragma warning( disable : 4146 ) /* no "unsigned" warnings */ #endif /* _MSC_VER */ #if !NO_MALLOC_STATS #include /* for printing in malloc_stats */ #endif /* NO_MALLOC_STATS */ #ifndef LACKS_ERRNO_H #include /* for MALLOC_FAILURE_ACTION */ #endif /* LACKS_ERRNO_H */ #ifdef DEBUG #if ABORT_ON_ASSERT_FAILURE #undef assert #define assert(x) if(!(x)) ABORT #else /* ABORT_ON_ASSERT_FAILURE */ #include #endif /* ABORT_ON_ASSERT_FAILURE */ #else /* DEBUG */ #ifndef assert #define assert(x) #endif #define DEBUG 0 #endif /* DEBUG */ #if !defined(WIN32) && !defined(LACKS_TIME_H) #include /* for magic initialization */ #endif /* WIN32 */ #ifndef LACKS_STDLIB_H #include /* for abort() */ #endif /* LACKS_STDLIB_H */ #ifndef LACKS_STRING_H #include /* for memset etc */ #endif /* LACKS_STRING_H */ #if USE_BUILTIN_FFS #ifndef LACKS_STRINGS_H #include /* for ffs */ #endif /* LACKS_STRINGS_H */ #endif /* USE_BUILTIN_FFS */ #if HAVE_MMAP #ifndef LACKS_SYS_MMAN_H /* On some versions of linux, mremap decl in mman.h needs __USE_GNU set */ #if (defined(linux) && !defined(__USE_GNU)) #define __USE_GNU 1 #include /* for mmap */ #undef __USE_GNU #else #include /* for mmap */ #endif /* linux */ #endif /* LACKS_SYS_MMAN_H */ #ifndef LACKS_FCNTL_H #include #endif /* LACKS_FCNTL_H */ #endif /* HAVE_MMAP */ #ifndef LACKS_UNISTD_H #include /* for sbrk, sysconf */ #else /* LACKS_UNISTD_H */ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) extern void* sbrk(ptrdiff_t); #endif /* FreeBSD etc */ #endif /* LACKS_UNISTD_H */ /* Declarations for locking */ #if USE_LOCKS #ifndef WIN32 #if defined (__SVR4) && defined (__sun) /* solaris */ #include #elif !defined(LACKS_SCHED_H) #include #endif /* solaris or LACKS_SCHED_H */ #if (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0) || !USE_SPIN_LOCKS #include #endif /* USE_RECURSIVE_LOCKS ... */ #elif defined(_MSC_VER) #ifndef _M_AMD64 /* These are already defined on AMD64 builds */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ LONG __cdecl _InterlockedCompareExchange(LONG volatile *Dest, LONG Exchange, LONG Comp); LONG __cdecl _InterlockedExchange(LONG volatile *Target, LONG Value); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _M_AMD64 */ #pragma intrinsic (_InterlockedCompareExchange) #pragma intrinsic (_InterlockedExchange) #define interlockedcompareexchange _InterlockedCompareExchange #define interlockedexchange _InterlockedExchange #elif defined(WIN32) && defined(__GNUC__) #define interlockedcompareexchange(a, b, c) __sync_val_compare_and_swap(a, c, b) #define interlockedexchange __sync_lock_test_and_set #endif /* Win32 */ #else /* USE_LOCKS */ #endif /* USE_LOCKS */ #ifndef LOCK_AT_FORK #define LOCK_AT_FORK 0 #endif /* Declarations for bit scanning on win32 */ #if defined(_MSC_VER) && _MSC_VER>=1300 #ifndef BitScanForward /* Try to avoid pulling in WinNT.h */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ unsigned char _BitScanForward(unsigned long *index, unsigned long mask); unsigned char _BitScanReverse(unsigned long *index, unsigned long mask); #ifdef __cplusplus } #endif /* __cplusplus */ #define BitScanForward _BitScanForward #define BitScanReverse _BitScanReverse #pragma intrinsic(_BitScanForward) #pragma intrinsic(_BitScanReverse) #endif /* BitScanForward */ #endif /* defined(_MSC_VER) && _MSC_VER>=1300 */ #ifndef WIN32 #ifndef malloc_getpagesize # ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ # ifndef _SC_PAGE_SIZE # define _SC_PAGE_SIZE _SC_PAGESIZE # endif # endif # ifdef _SC_PAGE_SIZE # define malloc_getpagesize sysconf(_SC_PAGE_SIZE) # else # if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE) extern size_t getpagesize(); # define malloc_getpagesize getpagesize() # else # ifdef WIN32 /* use supplied emulation of getpagesize */ # define malloc_getpagesize getpagesize() # else # ifndef LACKS_SYS_PARAM_H # include # endif # ifdef EXEC_PAGESIZE # define malloc_getpagesize EXEC_PAGESIZE # else # ifdef NBPG # ifndef CLSIZE # define malloc_getpagesize NBPG # else # define malloc_getpagesize (NBPG * CLSIZE) # endif # else # ifdef NBPC # define malloc_getpagesize NBPC # else # ifdef PAGESIZE # define malloc_getpagesize PAGESIZE # else /* just guess */ # define malloc_getpagesize ((size_t)4096U) # endif # endif # endif # endif # endif # endif # endif #endif #endif /* ------------------- size_t and alignment properties -------------------- */ /* The byte and bit size of a size_t */ #define SIZE_T_SIZE (sizeof(size_t)) #define SIZE_T_BITSIZE (sizeof(size_t) << 3) /* Some constants coerced to size_t */ /* Annoying but necessary to avoid errors on some platforms */ #define SIZE_T_ZERO ((size_t)0) #define SIZE_T_ONE ((size_t)1) #define SIZE_T_TWO ((size_t)2) #define SIZE_T_FOUR ((size_t)4) #define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) #define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) #define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) #define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) /* The bit mask value corresponding to MALLOC_ALIGNMENT */ #define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) /* True if address a has acceptable alignment */ #define is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) /* the number of bytes to offset an address to align it */ #define align_offset(A)\ ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\ ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK)) /* -------------------------- MMAP preliminaries ------------------------- */ /* If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and checks to fail so compiler optimizer can delete code rather than using so many "#if"s. */ /* MORECORE and MMAP must return MFAIL on failure */ #define MFAIL ((void*)(MAX_SIZE_T)) #define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ #if HAVE_MMAP #ifndef WIN32 #define MUNMAP_DEFAULT(a, s) munmap((a), (s)) #define MMAP_PROT (PROT_READ|PROT_WRITE) #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) #define MAP_ANONYMOUS MAP_ANON #endif /* MAP_ANON */ #ifdef MAP_ANONYMOUS #define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS) #define MMAP_DEFAULT(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0) #else /* MAP_ANONYMOUS */ /* Nearly all versions of mmap support MAP_ANONYMOUS, so the following is unlikely to be needed, but is supplied just in case. */ #define MMAP_FLAGS (MAP_PRIVATE) static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ #define MMAP_DEFAULT(s) ((dev_zero_fd < 0) ? \ (dev_zero_fd = open("/dev/zero", O_RDWR), \ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) #endif /* MAP_ANONYMOUS */ #define DIRECT_MMAP_DEFAULT(s) MMAP_DEFAULT(s) #else /* WIN32 */ /* Win32 MMAP via VirtualAlloc */ static FORCEINLINE void* win32mmap(size_t size) { void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); return (ptr != 0)? ptr: MFAIL; } /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ static FORCEINLINE void* win32direct_mmap(size_t size) { void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, PAGE_READWRITE); return (ptr != 0)? ptr: MFAIL; } /* This function supports releasing coalesed segments */ static FORCEINLINE int win32munmap(void* ptr, size_t size) { MEMORY_BASIC_INFORMATION minfo; char* cptr = (char*)ptr; while (size) { if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0) return -1; if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr || minfo.State != MEM_COMMIT || minfo.RegionSize > size) return -1; if (VirtualFree(cptr, 0, MEM_RELEASE) == 0) return -1; cptr += minfo.RegionSize; size -= minfo.RegionSize; } return 0; } #define MMAP_DEFAULT(s) win32mmap(s) #define MUNMAP_DEFAULT(a, s) win32munmap((a), (s)) #define DIRECT_MMAP_DEFAULT(s) win32direct_mmap(s) #endif /* WIN32 */ #endif /* HAVE_MMAP */ #if HAVE_MREMAP #ifndef WIN32 #define MREMAP_DEFAULT(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv)) #endif /* WIN32 */ #endif /* HAVE_MREMAP */ /** * Define CALL_MORECORE */ #if HAVE_MORECORE #ifdef MORECORE #define CALL_MORECORE(S) MORECORE(S) #else /* MORECORE */ #define CALL_MORECORE(S) MORECORE_DEFAULT(S) #endif /* MORECORE */ #else /* HAVE_MORECORE */ #define CALL_MORECORE(S) MFAIL #endif /* HAVE_MORECORE */ /** * Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP */ #if HAVE_MMAP #define USE_MMAP_BIT (SIZE_T_ONE) #ifdef MMAP #define CALL_MMAP(s) MMAP(s) #else /* MMAP */ #define CALL_MMAP(s) MMAP_DEFAULT(s) #endif /* MMAP */ #ifdef MUNMAP #define CALL_MUNMAP(a, s) MUNMAP((a), (s)) #else /* MUNMAP */ #define CALL_MUNMAP(a, s) MUNMAP_DEFAULT((a), (s)) #endif /* MUNMAP */ #ifdef DIRECT_MMAP #define CALL_DIRECT_MMAP(s) DIRECT_MMAP(s) #else /* DIRECT_MMAP */ #define CALL_DIRECT_MMAP(s) DIRECT_MMAP_DEFAULT(s) #endif /* DIRECT_MMAP */ #else /* HAVE_MMAP */ #define USE_MMAP_BIT (SIZE_T_ZERO) #define MMAP(s) MFAIL #define MUNMAP(a, s) (-1) #define DIRECT_MMAP(s) MFAIL #define CALL_DIRECT_MMAP(s) DIRECT_MMAP(s) #define CALL_MMAP(s) MMAP(s) #define CALL_MUNMAP(a, s) MUNMAP((a), (s)) #endif /* HAVE_MMAP */ /** * Define CALL_MREMAP */ #if HAVE_MMAP && HAVE_MREMAP #ifdef MREMAP #define CALL_MREMAP(addr, osz, nsz, mv) MREMAP((addr), (osz), (nsz), (mv)) #else /* MREMAP */ #define CALL_MREMAP(addr, osz, nsz, mv) MREMAP_DEFAULT((addr), (osz), (nsz), (mv)) #endif /* MREMAP */ #else /* HAVE_MMAP && HAVE_MREMAP */ #define CALL_MREMAP(addr, osz, nsz, mv) MFAIL #endif /* HAVE_MMAP && HAVE_MREMAP */ /* mstate bit set if continguous morecore disabled or failed */ #define USE_NONCONTIGUOUS_BIT (4U) /* segment bit set in create_mspace_with_base */ #define EXTERN_BIT (8U) /* --------------------------- Lock preliminaries ------------------------ */ /* When locks are defined, there is one global lock, plus one per-mspace lock. The global lock_ensures that mparams.magic and other unique mparams values are initialized only once. It also protects sequences of calls to MORECORE. In many cases sys_alloc requires two calls, that should not be interleaved with calls by other threads. This does not protect against direct calls to MORECORE by other threads not using this lock, so there is still code to cope the best we can on interference. Per-mspace locks surround calls to malloc, free, etc. By default, locks are simple non-reentrant mutexes. Because lock-protected regions generally have bounded times, it is OK to use the supplied simple spinlocks. Spinlocks are likely to improve performance for lightly contended applications, but worsen performance under heavy contention. If USE_LOCKS is > 1, the definitions of lock routines here are bypassed, in which case you will need to define the type MLOCK_T, and at least INITIAL_LOCK, DESTROY_LOCK, ACQUIRE_LOCK, RELEASE_LOCK and TRY_LOCK. You must also declare a static MLOCK_T malloc_global_mutex = { initialization values };. */ #if !USE_LOCKS #define USE_LOCK_BIT (0U) #define INITIAL_LOCK(l) (0) #define DESTROY_LOCK(l) (0) #define ACQUIRE_MALLOC_GLOBAL_LOCK() #define RELEASE_MALLOC_GLOBAL_LOCK() #else #if USE_LOCKS > 1 /* ----------------------- User-defined locks ------------------------ */ /* Define your own lock implementation here */ /* #define INITIAL_LOCK(lk) ... */ /* #define DESTROY_LOCK(lk) ... */ /* #define ACQUIRE_LOCK(lk) ... */ /* #define RELEASE_LOCK(lk) ... */ /* #define TRY_LOCK(lk) ... */ /* static MLOCK_T malloc_global_mutex = ... */ #elif USE_SPIN_LOCKS /* First, define CAS_LOCK and CLEAR_LOCK on ints */ /* Note CAS_LOCK defined to return 0 on success */ #if defined(__GNUC__)&& (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) #define CAS_LOCK(sl) __sync_lock_test_and_set(sl, 1) #define CLEAR_LOCK(sl) __sync_lock_release(sl) #elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) /* Custom spin locks for older gcc on x86 */ static FORCEINLINE int x86_cas_lock(int *sl) { int ret; int val = 1; int cmp = 0; __asm__ __volatile__ ("lock; cmpxchgl %1, %2" : "=a" (ret) : "r" (val), "m" (*(sl)), "0"(cmp) : "memory", "cc"); return ret; } static FORCEINLINE void x86_clear_lock(int* sl) { assert(*sl != 0); int prev = 0; int ret; __asm__ __volatile__ ("lock; xchgl %0, %1" : "=r" (ret) : "m" (*(sl)), "0"(prev) : "memory"); } #define CAS_LOCK(sl) x86_cas_lock(sl) #define CLEAR_LOCK(sl) x86_clear_lock(sl) #else /* Win32 MSC */ #define CAS_LOCK(sl) interlockedexchange(sl, (LONG)1) #define CLEAR_LOCK(sl) interlockedexchange (sl, (LONG)0) #endif /* ... gcc spins locks ... */ /* How to yield for a spin lock */ #define SPINS_PER_YIELD 63 #if defined(_MSC_VER) #define SLEEP_EX_DURATION 50 /* delay for yield/sleep */ #define SPIN_LOCK_YIELD SleepEx(SLEEP_EX_DURATION, FALSE) #elif defined (__SVR4) && defined (__sun) /* solaris */ #define SPIN_LOCK_YIELD thr_yield(); #elif !defined(LACKS_SCHED_H) #define SPIN_LOCK_YIELD sched_yield(); #else #define SPIN_LOCK_YIELD #endif /* ... yield ... */ #if !defined(USE_RECURSIVE_LOCKS) || USE_RECURSIVE_LOCKS == 0 /* Plain spin locks use single word (embedded in malloc_states) */ static int spin_acquire_lock(int *sl) { int spins = 0; while (*(volatile int *)sl != 0 || CAS_LOCK(sl)) { if ((++spins & SPINS_PER_YIELD) == 0) { SPIN_LOCK_YIELD; } } return 0; } #define MLOCK_T int #define TRY_LOCK(sl) !CAS_LOCK(sl) #define RELEASE_LOCK(sl) CLEAR_LOCK(sl) #define ACQUIRE_LOCK(sl) (CAS_LOCK(sl)? spin_acquire_lock(sl) : 0) #define INITIAL_LOCK(sl) (*sl = 0) #define DESTROY_LOCK(sl) (0) static MLOCK_T malloc_global_mutex = 0; #else /* USE_RECURSIVE_LOCKS */ /* types for lock owners */ #ifdef WIN32 #define THREAD_ID_T DWORD #define CURRENT_THREAD GetCurrentThreadId() #define EQ_OWNER(X,Y) ((X) == (Y)) #else /* Note: the following assume that pthread_t is a type that can be initialized to (casted) zero. If this is not the case, you will need to somehow redefine these or not use spin locks. */ #define THREAD_ID_T pthread_t #define CURRENT_THREAD pthread_self() #define EQ_OWNER(X,Y) pthread_equal(X, Y) #endif struct malloc_recursive_lock { int sl; unsigned int c; THREAD_ID_T threadid; }; #define MLOCK_T struct malloc_recursive_lock static MLOCK_T malloc_global_mutex = { 0, 0, (THREAD_ID_T)0}; static FORCEINLINE void recursive_release_lock(MLOCK_T *lk) { assert(lk->sl != 0); if (--lk->c == 0) { CLEAR_LOCK(&lk->sl); } } static FORCEINLINE int recursive_acquire_lock(MLOCK_T *lk) { THREAD_ID_T mythreadid = CURRENT_THREAD; int spins = 0; for (;;) { if (*((volatile int *)(&lk->sl)) == 0) { if (!CAS_LOCK(&lk->sl)) { lk->threadid = mythreadid; lk->c = 1; return 0; } } else if (EQ_OWNER(lk->threadid, mythreadid)) { ++lk->c; return 0; } if ((++spins & SPINS_PER_YIELD) == 0) { SPIN_LOCK_YIELD; } } } static FORCEINLINE int recursive_try_lock(MLOCK_T *lk) { THREAD_ID_T mythreadid = CURRENT_THREAD; if (*((volatile int *)(&lk->sl)) == 0) { if (!CAS_LOCK(&lk->sl)) { lk->threadid = mythreadid; lk->c = 1; return 1; } } else if (EQ_OWNER(lk->threadid, mythreadid)) { ++lk->c; return 1; } return 0; } #define RELEASE_LOCK(lk) recursive_release_lock(lk) #define TRY_LOCK(lk) recursive_try_lock(lk) #define ACQUIRE_LOCK(lk) recursive_acquire_lock(lk) #define INITIAL_LOCK(lk) ((lk)->threadid = (THREAD_ID_T)0, (lk)->sl = 0, (lk)->c = 0) #define DESTROY_LOCK(lk) (0) #endif /* USE_RECURSIVE_LOCKS */ #elif defined(WIN32) /* Win32 critical sections */ #define MLOCK_T CRITICAL_SECTION #define ACQUIRE_LOCK(lk) (EnterCriticalSection(lk), 0) #define RELEASE_LOCK(lk) LeaveCriticalSection(lk) #define TRY_LOCK(lk) TryEnterCriticalSection(lk) #define INITIAL_LOCK(lk) (!InitializeCriticalSectionAndSpinCount((lk), 0x80000000|4000)) #define DESTROY_LOCK(lk) (DeleteCriticalSection(lk), 0) #define NEED_GLOBAL_LOCK_INIT static MLOCK_T malloc_global_mutex; static volatile LONG malloc_global_mutex_status; /* Use spin loop to initialize global lock */ static void init_malloc_global_mutex() { for (;;) { long stat = malloc_global_mutex_status; if (stat > 0) return; /* transition to < 0 while initializing, then to > 0) */ if (stat == 0 && interlockedcompareexchange(&malloc_global_mutex_status, (LONG)-1, (LONG)0) == 0) { InitializeCriticalSection(&malloc_global_mutex); interlockedexchange(&malloc_global_mutex_status, (LONG)1); return; } SleepEx(0, FALSE); } } #else /* pthreads-based locks */ #define MLOCK_T pthread_mutex_t #define ACQUIRE_LOCK(lk) pthread_mutex_lock(lk) #define RELEASE_LOCK(lk) pthread_mutex_unlock(lk) #define TRY_LOCK(lk) (!pthread_mutex_trylock(lk)) #define INITIAL_LOCK(lk) pthread_init_lock(lk) #define DESTROY_LOCK(lk) pthread_mutex_destroy(lk) #if defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0 && defined(linux) && !defined(PTHREAD_MUTEX_RECURSIVE) /* Cope with old-style linux recursive lock initialization by adding */ /* skipped internal declaration from pthread.h */ extern int pthread_mutexattr_setkind_np __P ((pthread_mutexattr_t *__attr, int __kind)); #define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP #define pthread_mutexattr_settype(x,y) pthread_mutexattr_setkind_np(x,y) #endif /* USE_RECURSIVE_LOCKS ... */ static MLOCK_T malloc_global_mutex = PTHREAD_MUTEX_INITIALIZER; static int pthread_init_lock (MLOCK_T *lk) { pthread_mutexattr_t attr; if (pthread_mutexattr_init(&attr)) return 1; #if defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0 if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE)) return 1; #endif if (pthread_mutex_init(lk, &attr)) return 1; if (pthread_mutexattr_destroy(&attr)) return 1; return 0; } #endif /* ... lock types ... */ /* Common code for all lock types */ #define USE_LOCK_BIT (2U) #ifndef ACQUIRE_MALLOC_GLOBAL_LOCK #define ACQUIRE_MALLOC_GLOBAL_LOCK() ACQUIRE_LOCK(&malloc_global_mutex); #endif #ifndef RELEASE_MALLOC_GLOBAL_LOCK #define RELEASE_MALLOC_GLOBAL_LOCK() RELEASE_LOCK(&malloc_global_mutex); #endif #endif /* USE_LOCKS */ /* ----------------------- Chunk representations ------------------------ */ /* (The following includes lightly edited explanations by Colin Plumb.) The malloc_chunk declaration below is misleading (but accurate and necessary). It declares a "view" into memory allowing access to necessary fields at known offsets from a given base. Chunks of memory are maintained using a `boundary tag' method as originally described by Knuth. (See the paper by Paul Wilson ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such techniques.) Sizes of free chunks are stored both in the front of each chunk and at the end. This makes consolidating fragmented chunks into bigger chunks fast. The head fields also hold bits representing whether chunks are free or in use. Here are some pictures to make it clearer. They are "exploded" to show that the state of a chunk can be thought of as extending from the high 31 bits of the head field of its header through the prev_foot and PINUSE_BIT bit of the following chunk header. A chunk that's in use looks like: chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Size of previous chunk (if P = 0) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P| | Size of this chunk 1| +-+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +- -+ | | +- -+ | : +- size - sizeof(size_t) available payload bytes -+ : | chunk-> +- -+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1| | Size of next chunk (may or may not be in use) | +-+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ And if it's free, it looks like this: chunk-> +- -+ | User payload (must be in use, or we would have merged!) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P| | Size of this chunk 0| +-+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Prev pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | : +- size - sizeof(struct chunk) unused bytes -+ : | chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Size of this chunk | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| | Size of next chunk (must be in use, or we would have merged)| +-+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | : +- User payload -+ : | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| +-+ Note that since we always merge adjacent free chunks, the chunks adjacent to a free chunk must be in use. Given a pointer to a chunk (which can be derived trivially from the payload pointer) we can, in O(1) time, find out whether the adjacent chunks are free, and if so, unlink them from the lists that they are on and merge them with the current chunk. Chunks always begin on even word boundaries, so the mem portion (which is returned to the user) is also on an even word boundary, and thus at least double-word aligned. The P (PINUSE_BIT) bit, stored in the unused low-order bit of the chunk size (which is always a multiple of two words), is an in-use bit for the *previous* chunk. If that bit is *clear*, then the word before the current chunk size contains the previous chunk size, and can be used to find the front of the previous chunk. The very first chunk allocated always has this bit set, preventing access to non-existent (or non-owned) memory. If pinuse is set for any given chunk, then you CANNOT determine the size of the previous chunk, and might even get a memory addressing fault when trying to do so. The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of the chunk size redundantly records whether the current chunk is inuse (unless the chunk is mmapped). This redundancy enables usage checks within free and realloc, and reduces indirection when freeing and consolidating chunks. Each freshly allocated chunk must have both cinuse and pinuse set. That is, each allocated chunk borders either a previously allocated and still in-use chunk, or the base of its memory arena. This is ensured by making all allocations from the `lowest' part of any found chunk. Further, no free chunk physically borders another one, so each free chunk is known to be preceded and followed by either inuse chunks or the ends of memory. Note that the `foot' of the current chunk is actually represented as the prev_foot of the NEXT chunk. This makes it easier to deal with alignments etc but can be very confusing when trying to extend or adapt this code. The exceptions to all this are 1. The special chunk `top' is the top-most available chunk (i.e., the one bordering the end of available memory). It is treated specially. Top is never included in any bin, is used only if no other chunk is available, and is released back to the system if it is very large (see M_TRIM_THRESHOLD). In effect, the top chunk is treated as larger (and thus less well fitting) than any other available chunk. The top chunk doesn't update its trailing size field since there is no next contiguous chunk that would have to index off it. However, space is still allocated for it (TOP_FOOT_SIZE) to enable separation or merging when space is extended. 3. Chunks allocated via mmap, have both cinuse and pinuse bits cleared in their head fields. Because they are allocated one-by-one, each must carry its own prev_foot field, which is also used to hold the offset this chunk has within its mmapped region, which is needed to preserve alignment. Each mmapped chunk is trailed by the first two fields of a fake next-chunk for sake of usage checks. */ struct malloc_chunk { size_t prev_foot; /* Size of previous chunk (if free). */ size_t head; /* Size and inuse bits. */ struct malloc_chunk* fd; /* double links -- used only if free. */ struct malloc_chunk* bk; }; typedef struct malloc_chunk mchunk; typedef struct malloc_chunk* mchunkptr; typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */ typedef unsigned int bindex_t; /* Described below */ typedef unsigned int binmap_t; /* Described below */ typedef unsigned int flag_t; /* The type of various bit flag sets */ /* ------------------- Chunks sizes and alignments ----------------------- */ #define MCHUNK_SIZE (sizeof(mchunk)) #if FOOTERS #define CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) #else /* FOOTERS */ #define CHUNK_OVERHEAD (SIZE_T_SIZE) #endif /* FOOTERS */ /* MMapped chunks need a second word of overhead ... */ #define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) /* ... and additional padding for fake next-chunk at foot */ #define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) /* The smallest size we can malloc is an aligned minimal chunk */ #define MIN_CHUNK_SIZE\ ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) /* conversion from malloc headers to user pointers, and back */ #define chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) #define mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) /* chunk associated with aligned address A */ #define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A))) /* Bounds on request (not chunk) sizes. */ #define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) #define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) /* pad request bytes into a usable size */ #define pad_request(req) \ (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) /* pad request, checking for minimum (but not maximum) */ #define request2size(req) \ (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) /* ------------------ Operations on head and foot fields ----------------- */ /* The head field of a chunk is or'ed with PINUSE_BIT when previous adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in use, unless mmapped, in which case both bits are cleared. FLAG4_BIT is not used by this malloc, but might be useful in extensions. */ #define PINUSE_BIT (SIZE_T_ONE) #define CINUSE_BIT (SIZE_T_TWO) #define FLAG4_BIT (SIZE_T_FOUR) #define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) #define FLAG_BITS (PINUSE_BIT|CINUSE_BIT|FLAG4_BIT) /* Head value for fenceposts */ #define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) /* extraction of fields from head words */ #define cinuse(p) ((p)->head & CINUSE_BIT) #define pinuse(p) ((p)->head & PINUSE_BIT) #define flag4inuse(p) ((p)->head & FLAG4_BIT) #define is_inuse(p) (((p)->head & INUSE_BITS) != PINUSE_BIT) #define is_mmapped(p) (((p)->head & INUSE_BITS) == 0) #define chunksize(p) ((p)->head & ~(FLAG_BITS)) #define clear_pinuse(p) ((p)->head &= ~PINUSE_BIT) #define set_flag4(p) ((p)->head |= FLAG4_BIT) #define clear_flag4(p) ((p)->head &= ~FLAG4_BIT) /* Treat space at ptr +/- offset as a chunk */ #define chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) #define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s))) /* Ptr to next or previous physical malloc_chunk. */ #define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~FLAG_BITS))) #define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) /* extract next chunk's pinuse bit */ #define next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT) /* Get/set size at footer */ #define get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot) #define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) /* Set size, pinuse bit, and foot */ #define set_size_and_pinuse_of_free_chunk(p, s)\ ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) /* Set size, pinuse bit, foot, and clear next pinuse */ #define set_free_with_pinuse(p, s, n)\ (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) /* Get the internal overhead associated with chunk p */ #define overhead_for(p)\ (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) /* Return true if malloced space is not necessarily cleared */ #if MMAP_CLEARS #define calloc_must_clear(p) (!is_mmapped(p)) #else /* MMAP_CLEARS */ #define calloc_must_clear(p) (1) #endif /* MMAP_CLEARS */ /* ---------------------- Overlaid data structures ----------------------- */ /* When chunks are not in use, they are treated as nodes of either lists or trees. "Small" chunks are stored in circular doubly-linked lists, and look like this: chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Size of previous chunk | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ `head:' | Size of chunk, in bytes |P| mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Forward pointer to next chunk in list | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Back pointer to previous chunk in list | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unused space (may be 0 bytes long) . . . . | nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ `foot:' | Size of chunk, in bytes | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Larger chunks are kept in a form of bitwise digital trees (aka tries) keyed on chunksizes. Because malloc_tree_chunks are only for free chunks greater than 256 bytes, their size doesn't impose any constraints on user chunk sizes. Each node looks like: chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Size of previous chunk | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ `head:' | Size of chunk, in bytes |P| mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Forward pointer to next chunk of same size | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Back pointer to previous chunk of same size | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Pointer to left child (child[0]) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Pointer to right child (child[1]) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Pointer to parent | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | bin index of this chunk | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unused space . . | nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ `foot:' | Size of chunk, in bytes | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Each tree holding treenodes is a tree of unique chunk sizes. Chunks of the same size are arranged in a circularly-linked list, with only the oldest chunk (the next to be used, in our FIFO ordering) actually in the tree. (Tree members are distinguished by a non-null parent pointer.) If a chunk with the same size an an existing node is inserted, it is linked off the existing node using pointers that work in the same way as fd/bk pointers of small chunks. Each tree contains a power of 2 sized range of chunk sizes (the smallest is 0x100 <= x < 0x180), which is is divided in half at each tree level, with the chunks in the smaller half of the range (0x100 <= x < 0x140 for the top nose) in the left subtree and the larger half (0x140 <= x < 0x180) in the right subtree. This is, of course, done by inspecting individual bits. Using these rules, each node's left subtree contains all smaller sizes than its right subtree. However, the node at the root of each subtree has no particular ordering relationship to either. (The dividing line between the subtree sizes is based on trie relation.) If we remove the last chunk of a given size from the interior of the tree, we need to replace it with a leaf node. The tree ordering rules permit a node to be replaced by any leaf below it. The smallest chunk in a tree (a common operation in a best-fit allocator) can be found by walking a path to the leftmost leaf in the tree. Unlike a usual binary tree, where we follow left child pointers until we reach a null, here we follow the right child pointer any time the left one is null, until we reach a leaf with both child pointers null. The smallest chunk in the tree will be somewhere along that path. The worst case number of steps to add, find, or remove a node is bounded by the number of bits differentiating chunks within bins. Under current bin calculations, this ranges from 6 up to 21 (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case is of course much better. */ struct malloc_tree_chunk { /* The first four fields must be compatible with malloc_chunk */ size_t prev_foot; size_t head; struct malloc_tree_chunk* fd; struct malloc_tree_chunk* bk; struct malloc_tree_chunk* child[2]; struct malloc_tree_chunk* parent; bindex_t index; }; typedef struct malloc_tree_chunk tchunk; typedef struct malloc_tree_chunk* tchunkptr; typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */ /* A little helper macro for trees */ #define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) /* ----------------------------- Segments -------------------------------- */ /* Each malloc space may include non-contiguous segments, held in a list headed by an embedded malloc_segment record representing the top-most space. Segments also include flags holding properties of the space. Large chunks that are directly allocated by mmap are not included in this list. They are instead independently created and destroyed without otherwise keeping track of them. Segment management mainly comes into play for spaces allocated by MMAP. Any call to MMAP might or might not return memory that is adjacent to an existing segment. MORECORE normally contiguously extends the current space, so this space is almost always adjacent, which is simpler and faster to deal with. (This is why MORECORE is used preferentially to MMAP when both are available -- see sys_alloc.) When allocating using MMAP, we don't use any of the hinting mechanisms (inconsistently) supported in various implementations of unix mmap, or distinguish reserving from committing memory. Instead, we just ask for space, and exploit contiguity when we get it. It is probably possible to do better than this on some systems, but no general scheme seems to be significantly better. Management entails a simpler variant of the consolidation scheme used for chunks to reduce fragmentation -- new adjacent memory is normally prepended or appended to an existing segment. However, there are limitations compared to chunk consolidation that mostly reflect the fact that segment processing is relatively infrequent (occurring only when getting memory from system) and that we don't expect to have huge numbers of segments: * Segments are not indexed, so traversal requires linear scans. (It would be possible to index these, but is not worth the extra overhead and complexity for most programs on most platforms.) * New segments are only appended to old ones when holding top-most memory; if they cannot be prepended to others, they are held in different segments. Except for the top-most segment of an mstate, each segment record is kept at the tail of its segment. Segments are added by pushing segment records onto the list headed by &mstate.seg for the containing mstate. Segment flags control allocation/merge/deallocation policies: * If EXTERN_BIT set, then we did not allocate this segment, and so should not try to deallocate or merge with others. (This currently holds only for the initial segment passed into create_mspace_with_base.) * If USE_MMAP_BIT set, the segment may be merged with other surrounding mmapped segments and trimmed/de-allocated using munmap. * If neither bit is set, then the segment was obtained using MORECORE so can be merged with surrounding MORECORE'd segments and deallocated/trimmed using MORECORE with negative arguments. */ struct malloc_segment { char* base; /* base address */ size_t size; /* allocated size */ struct malloc_segment* next; /* ptr to next segment */ flag_t sflags; /* mmap and extern flag */ }; #define is_mmapped_segment(S) ((S)->sflags & USE_MMAP_BIT) #define is_extern_segment(S) ((S)->sflags & EXTERN_BIT) typedef struct malloc_segment msegment; typedef struct malloc_segment* msegmentptr; /* ---------------------------- malloc_state ----------------------------- */ /* A malloc_state holds all of the bookkeeping for a space. The main fields are: Top The topmost chunk of the currently active segment. Its size is cached in topsize. The actual size of topmost space is topsize+TOP_FOOT_SIZE, which includes space reserved for adding fenceposts and segment records if necessary when getting more space from the system. The size at which to autotrim top is cached from mparams in trim_check, except that it is disabled if an autotrim fails. Designated victim (dv) This is the preferred chunk for servicing small requests that don't have exact fits. It is normally the chunk split off most recently to service another small request. Its size is cached in dvsize. The link fields of this chunk are not maintained since it is not kept in a bin. SmallBins An array of bin headers for free chunks. These bins hold chunks with sizes less than MIN_LARGE_SIZE bytes. Each bin contains chunks of all the same size, spaced 8 bytes apart. To simplify use in double-linked lists, each bin header acts as a malloc_chunk pointing to the real first node, if it exists (else pointing to itself). This avoids special-casing for headers. But to avoid waste, we allocate only the fd/bk pointers of bins, and then use repositioning tricks to treat these as the fields of a chunk. TreeBins Treebins are pointers to the roots of trees holding a range of sizes. There are 2 equally spaced treebins for each power of two from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything larger. Bin maps There is one bit map for small bins ("smallmap") and one for treebins ("treemap). Each bin sets its bit when non-empty, and clears the bit when empty. Bit operations are then used to avoid bin-by-bin searching -- nearly all "search" is done without ever looking at bins that won't be selected. The bit maps conservatively use 32 bits per map word, even if on 64bit system. For a good description of some of the bit-based techniques used here, see Henry S. Warren Jr's book "Hacker's Delight" (and supplement at http://hackersdelight.org/). Many of these are intended to reduce the branchiness of paths through malloc etc, as well as to reduce the number of memory locations read or written. Segments A list of segments headed by an embedded malloc_segment record representing the initial space. Address check support The least_addr field is the least address ever obtained from MORECORE or MMAP. Attempted frees and reallocs of any address less than this are trapped (unless INSECURE is defined). Magic tag A cross-check field that should always hold same value as mparams.magic. Max allowed footprint The maximum allowed bytes to allocate from system (zero means no limit) Flags Bits recording whether to use MMAP, locks, or contiguous MORECORE Statistics Each space keeps track of current and maximum system memory obtained via MORECORE or MMAP. Trim support Fields holding the amount of unused topmost memory that should trigger trimming, and a counter to force periodic scanning to release unused non-topmost segments. Locking If USE_LOCKS is defined, the "mutex" lock is acquired and released around every public call using this mspace. Extension support A void* pointer and a size_t field that can be used to help implement extensions to this malloc. */ /* Bin types, widths and sizes */ #define NSMALLBINS (32U) #define NTREEBINS (32U) #define SMALLBIN_SHIFT (3U) #define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) #define TREEBIN_SHIFT (8U) #define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) #define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) #define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) struct malloc_state { binmap_t smallmap; binmap_t treemap; size_t dvsize; size_t topsize; char* least_addr; mchunkptr dv; mchunkptr top; size_t trim_check; size_t release_checks; size_t magic; mchunkptr smallbins[(NSMALLBINS+1)*2]; tbinptr treebins[NTREEBINS]; size_t footprint; size_t max_footprint; size_t footprint_limit; /* zero means no limit */ flag_t mflags; #if USE_LOCKS MLOCK_T mutex; /* locate lock among fields that rarely change */ #endif /* USE_LOCKS */ msegment seg; void* extp; /* Unused but available for extensions */ size_t exts; }; typedef struct malloc_state* mstate; /* ------------- Global malloc_state and malloc_params ------------------- */ /* malloc_params holds global properties, including those that can be dynamically set using mallopt. There is a single instance, mparams, initialized in init_mparams. Note that the non-zeroness of "magic" also serves as an initialization flag. */ struct malloc_params { size_t magic; size_t page_size; size_t granularity; size_t mmap_threshold; size_t trim_threshold; flag_t default_mflags; }; static struct malloc_params mparams; /* Ensure mparams initialized */ #define ensure_initialization() (void)(mparams.magic != 0 || init_mparams()) #if !ONLY_MSPACES /* The global malloc_state used for all non-"mspace" calls */ static struct malloc_state _gm_; #define gm (&_gm_) #define is_global(M) ((M) == &_gm_) #endif /* !ONLY_MSPACES */ #define is_initialized(M) ((M)->top != 0) /* -------------------------- system alloc setup ------------------------- */ /* Operations on mflags */ #define use_lock(M) ((M)->mflags & USE_LOCK_BIT) #define enable_lock(M) ((M)->mflags |= USE_LOCK_BIT) #if USE_LOCKS #define disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT) #else #define disable_lock(M) #endif #define use_mmap(M) ((M)->mflags & USE_MMAP_BIT) #define enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT) #if HAVE_MMAP #define disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT) #else #define disable_mmap(M) #endif #define use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT) #define disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT) #define set_lock(M,L)\ ((M)->mflags = (L)?\ ((M)->mflags | USE_LOCK_BIT) :\ ((M)->mflags & ~USE_LOCK_BIT)) /* page-align a size */ #define page_align(S)\ (((S) + (mparams.page_size - SIZE_T_ONE)) & ~(mparams.page_size - SIZE_T_ONE)) /* granularity-align a size */ #define granularity_align(S)\ (((S) + (mparams.granularity - SIZE_T_ONE))\ & ~(mparams.granularity - SIZE_T_ONE)) /* For mmap, use granularity alignment on windows, else page-align */ #ifdef WIN32 #define mmap_align(S) granularity_align(S) #else #define mmap_align(S) page_align(S) #endif /* For sys_alloc, enough padding to ensure can malloc request on success */ #define SYS_ALLOC_PADDING (TOP_FOOT_SIZE + MALLOC_ALIGNMENT) #define is_page_aligned(S)\ (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) #define is_granularity_aligned(S)\ (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) /* True if segment S holds address A */ #define segment_holds(S, A)\ ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) /* Return segment holding given address */ static msegmentptr segment_holding(mstate m, char* addr) { msegmentptr sp = &m->seg; for (;;) { if (addr >= sp->base && addr < sp->base + sp->size) return sp; if ((sp = sp->next) == 0) return 0; } } /* Return true if segment contains a segment link */ static int has_segment_link(mstate m, msegmentptr ss) { msegmentptr sp = &m->seg; for (;;) { if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size) return 1; if ((sp = sp->next) == 0) return 0; } } #ifndef MORECORE_CANNOT_TRIM #define should_trim(M,s) ((s) > (M)->trim_check) #else /* MORECORE_CANNOT_TRIM */ #define should_trim(M,s) (0) #endif /* MORECORE_CANNOT_TRIM */ /* TOP_FOOT_SIZE is padding at the end of a segment, including space that may be needed to place segment records and fenceposts when new noncontiguous segments are added. */ #define TOP_FOOT_SIZE\ (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) /* ------------------------------- Hooks -------------------------------- */ /* PREACTION should be defined to return 0 on success, and nonzero on failure. If you are not using locking, you can redefine these to do anything you like. */ #if USE_LOCKS #define PREACTION(M) ((use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0) #define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); } #else /* USE_LOCKS */ #ifndef PREACTION #define PREACTION(M) (0) #endif /* PREACTION */ #ifndef POSTACTION #define POSTACTION(M) #endif /* POSTACTION */ #endif /* USE_LOCKS */ /* CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses. USAGE_ERROR_ACTION is triggered on detected bad frees and reallocs. The argument p is an address that might have triggered the fault. It is ignored by the two predefined actions, but might be useful in custom actions that try to help diagnose errors. */ #if PROCEED_ON_ERROR /* A count of the number of corruption errors causing resets */ int malloc_corruption_error_count; /* default corruption action */ static void reset_on_error(mstate m); #define CORRUPTION_ERROR_ACTION(m) reset_on_error(m) #define USAGE_ERROR_ACTION(m, p) #else /* PROCEED_ON_ERROR */ #ifndef CORRUPTION_ERROR_ACTION #define CORRUPTION_ERROR_ACTION(m) ABORT #endif /* CORRUPTION_ERROR_ACTION */ #ifndef USAGE_ERROR_ACTION #define USAGE_ERROR_ACTION(m,p) ABORT #endif /* USAGE_ERROR_ACTION */ #endif /* PROCEED_ON_ERROR */ /* -------------------------- Debugging setup ---------------------------- */ #if ! DEBUG #define check_free_chunk(M,P) #define check_inuse_chunk(M,P) #define check_malloced_chunk(M,P,N) #define check_mmapped_chunk(M,P) #define check_malloc_state(M) #define check_top_chunk(M,P) #else /* DEBUG */ #define check_free_chunk(M,P) do_check_free_chunk(M,P) #define check_inuse_chunk(M,P) do_check_inuse_chunk(M,P) #define check_top_chunk(M,P) do_check_top_chunk(M,P) #define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N) #define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P) #define check_malloc_state(M) do_check_malloc_state(M) static void do_check_any_chunk(mstate m, mchunkptr p); static void do_check_top_chunk(mstate m, mchunkptr p); static void do_check_mmapped_chunk(mstate m, mchunkptr p); static void do_check_inuse_chunk(mstate m, mchunkptr p); static void do_check_free_chunk(mstate m, mchunkptr p); static void do_check_malloced_chunk(mstate m, void* mem, size_t s); static void do_check_tree(mstate m, tchunkptr t); static void do_check_treebin(mstate m, bindex_t i); static void do_check_smallbin(mstate m, bindex_t i); static void do_check_malloc_state(mstate m); static int bin_find(mstate m, mchunkptr x); static size_t traverse_and_check(mstate m); #endif /* DEBUG */ /* ---------------------------- Indexing Bins ---------------------------- */ #define is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) #define small_index(s) (bindex_t)((s) >> SMALLBIN_SHIFT) #define small_index2size(i) ((i) << SMALLBIN_SHIFT) #define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) /* addressing by index. See above about smallbin repositioning */ #define smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1]))) #define treebin_at(M,i) (&((M)->treebins[i])) /* assign tree index for size S to variable I. Use x86 asm if possible */ #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #define compute_tree_index(S, I)\ {\ unsigned int X = S >> TREEBIN_SHIFT;\ if (X == 0)\ I = 0;\ else if (X > 0xFFFF)\ I = NTREEBINS-1;\ else {\ unsigned int K = (unsigned) sizeof(X)*__CHAR_BIT__ - 1 - (unsigned) __builtin_clz(X); \ I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\ }\ } #elif defined (__INTEL_COMPILER) #define compute_tree_index(S, I)\ {\ size_t X = S >> TREEBIN_SHIFT;\ if (X == 0)\ I = 0;\ else if (X > 0xFFFF)\ I = NTREEBINS-1;\ else {\ unsigned int K = _bit_scan_reverse (X); \ I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\ }\ } #elif defined(_MSC_VER) && _MSC_VER>=1300 #define compute_tree_index(S, I)\ {\ size_t X = S >> TREEBIN_SHIFT;\ if (X == 0)\ I = 0;\ else if (X > 0xFFFF)\ I = NTREEBINS-1;\ else {\ unsigned int K;\ _BitScanReverse((DWORD *) &K, (DWORD) X);\ I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\ }\ } #else /* GNUC */ #define compute_tree_index(S, I)\ {\ size_t X = S >> TREEBIN_SHIFT;\ if (X == 0)\ I = 0;\ else if (X > 0xFFFF)\ I = NTREEBINS-1;\ else {\ unsigned int Y = (unsigned int)X;\ unsigned int N = ((Y - 0x100) >> 16) & 8;\ unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\ N += K;\ N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\ K = 14 - N + ((Y <<= K) >> 15);\ I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\ }\ } #endif /* GNUC */ /* Bit representing maximum resolved size in a treebin at i */ #define bit_for_tree_index(i) \ (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) /* Shift placing maximum resolved bit in a treebin at i as sign bit */ #define leftshift_for_tree_index(i) \ ((i == NTREEBINS-1)? 0 : \ ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2))) /* The size of the smallest chunk held in bin with index i */ #define minsize_for_tree_index(i) \ ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \ (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1))) /* ------------------------ Operations on bin maps ----------------------- */ /* bit corresponding to given index */ #define idx2bit(i) ((binmap_t)(1) << (i)) /* Mark/Clear bits with given index */ #define mark_smallmap(M,i) ((M)->smallmap |= idx2bit(i)) #define clear_smallmap(M,i) ((M)->smallmap &= ~idx2bit(i)) #define smallmap_is_marked(M,i) ((M)->smallmap & idx2bit(i)) #define mark_treemap(M,i) ((M)->treemap |= idx2bit(i)) #define clear_treemap(M,i) ((M)->treemap &= ~idx2bit(i)) #define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i)) /* isolate the least set bit of a bitmap */ #define least_bit(x) ((x) & -(x)) /* mask with all bits to left of least bit of x on */ #define left_bits(x) ((x<<1) | -(x<<1)) /* mask with all bits to left of or equal to least bit of x on */ #define same_or_left_bits(x) ((x) | -(x)) /* index corresponding to given bit. Use x86 asm if possible */ #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #define compute_bit2idx(X, I)\ {\ unsigned int J;\ J = __builtin_ctz(X); \ I = (bindex_t)J;\ } #elif defined (__INTEL_COMPILER) #define compute_bit2idx(X, I)\ {\ unsigned int J;\ J = _bit_scan_forward (X); \ I = (bindex_t)J;\ } #elif defined(_MSC_VER) && _MSC_VER>=1300 #define compute_bit2idx(X, I)\ {\ unsigned int J;\ _BitScanForward((DWORD *) &J, X);\ I = (bindex_t)J;\ } #elif USE_BUILTIN_FFS #define compute_bit2idx(X, I) I = ffs(X)-1 #else #define compute_bit2idx(X, I)\ {\ unsigned int Y = X - 1;\ unsigned int K = Y >> (16-4) & 16;\ unsigned int N = K; Y >>= K;\ N += K = Y >> (8-3) & 8; Y >>= K;\ N += K = Y >> (4-2) & 4; Y >>= K;\ N += K = Y >> (2-1) & 2; Y >>= K;\ N += K = Y >> (1-0) & 1; Y >>= K;\ I = (bindex_t)(N + Y);\ } #endif /* GNUC */ /* ----------------------- Runtime Check Support ------------------------- */ /* For security, the main invariant is that malloc/free/etc never writes to a static address other than malloc_state, unless static malloc_state itself has been corrupted, which cannot occur via malloc (because of these checks). In essence this means that we believe all pointers, sizes, maps etc held in malloc_state, but check all of those linked or offsetted from other embedded data structures. These checks are interspersed with main code in a way that tends to minimize their run-time cost. When FOOTERS is defined, in addition to range checking, we also verify footer fields of inuse chunks, which can be used guarantee that the mstate controlling malloc/free is intact. This is a streamlined version of the approach described by William Robertson et al in "Run-time Detection of Heap-based Overflows" LISA'03 http://www.usenix.org/events/lisa03/tech/robertson.html The footer of an inuse chunk holds the xor of its mstate and a random seed, that is checked upon calls to free() and realloc(). This is (probabalistically) unguessable from outside the program, but can be computed by any code successfully malloc'ing any chunk, so does not itself provide protection against code that has already broken security through some other means. Unlike Robertson et al, we always dynamically check addresses of all offset chunks (previous, next, etc). This turns out to be cheaper than relying on hashes. */ #if !INSECURE /* Check if address a is at least as high as any from MORECORE or MMAP */ #define ok_address(M, a) ((char*)(a) >= (M)->least_addr) /* Check if address of next chunk n is higher than base chunk p */ #define ok_next(p, n) ((char*)(p) < (char*)(n)) /* Check if p has inuse status */ #define ok_inuse(p) is_inuse(p) /* Check if p has its pinuse bit on */ #define ok_pinuse(p) pinuse(p) #else /* !INSECURE */ #define ok_address(M, a) (1) #define ok_next(b, n) (1) #define ok_inuse(p) (1) #define ok_pinuse(p) (1) #endif /* !INSECURE */ #if (FOOTERS && !INSECURE) /* Check if (alleged) mstate m has expected magic field */ #define ok_magic(M) ((M)->magic == mparams.magic) #else /* (FOOTERS && !INSECURE) */ #define ok_magic(M) (1) #endif /* (FOOTERS && !INSECURE) */ /* In gcc, use __builtin_expect to minimize impact of checks */ #if !INSECURE #if defined(__GNUC__) && __GNUC__ >= 3 #define RTCHECK(e) __builtin_expect(e, 1) #else /* GNUC */ #define RTCHECK(e) (e) #endif /* GNUC */ #else /* !INSECURE */ #define RTCHECK(e) (1) #endif /* !INSECURE */ /* macros to set up inuse chunks with or without footers */ #if !FOOTERS #define mark_inuse_foot(M,p,s) /* Macros for setting head/foot of non-mmapped chunks */ /* Set cinuse bit and pinuse bit of next chunk */ #define set_inuse(M,p,s)\ ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT) /* Set cinuse and pinuse of this chunk and pinuse of next chunk */ #define set_inuse_and_pinuse(M,p,s)\ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT) /* Set size, cinuse and pinuse bit of this chunk */ #define set_size_and_pinuse_of_inuse_chunk(M, p, s)\ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) #else /* FOOTERS */ /* Set foot of inuse chunk to be xor of mstate and seed */ #define mark_inuse_foot(M,p,s)\ (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic)) #define get_mstate_for(p)\ ((mstate)(((mchunkptr)((char*)(p) +\ (chunksize(p))))->prev_foot ^ mparams.magic)) #define set_inuse(M,p,s)\ ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\ (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \ mark_inuse_foot(M,p,s)) #define set_inuse_and_pinuse(M,p,s)\ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\ mark_inuse_foot(M,p,s)) #define set_size_and_pinuse_of_inuse_chunk(M, p, s)\ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\ mark_inuse_foot(M, p, s)) #endif /* !FOOTERS */ /* ---------------------------- setting mparams -------------------------- */ #if LOCK_AT_FORK static void pre_fork(void) { ACQUIRE_LOCK(&(gm)->mutex); } static void post_fork_parent(void) { RELEASE_LOCK(&(gm)->mutex); } static void post_fork_child(void) { INITIAL_LOCK(&(gm)->mutex); } #endif /* LOCK_AT_FORK */ /* Initialize mparams */ static int init_mparams(void) { #ifdef NEED_GLOBAL_LOCK_INIT if (malloc_global_mutex_status <= 0) init_malloc_global_mutex(); #endif ACQUIRE_MALLOC_GLOBAL_LOCK(); if (mparams.magic == 0) { size_t magic; size_t psize; size_t gsize; #ifndef WIN32 psize = malloc_getpagesize; gsize = ((DEFAULT_GRANULARITY != 0)? DEFAULT_GRANULARITY : psize); #else /* WIN32 */ { SYSTEM_INFO system_info; GetSystemInfo(&system_info); psize = system_info.dwPageSize; gsize = ((DEFAULT_GRANULARITY != 0)? DEFAULT_GRANULARITY : system_info.dwAllocationGranularity); } #endif /* WIN32 */ /* Sanity-check configuration: size_t must be unsigned and as wide as pointer type. ints must be at least 4 bytes. alignment must be at least 8. Alignment, min chunk size, and page size must all be powers of 2. */ if ((sizeof(size_t) != sizeof(char*)) || (MAX_SIZE_T < MIN_CHUNK_SIZE) || (sizeof(int) < 4) || (MALLOC_ALIGNMENT < (size_t)8U) || ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) || ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) || ((gsize & (gsize-SIZE_T_ONE)) != 0) || ((psize & (psize-SIZE_T_ONE)) != 0)) ABORT; mparams.granularity = gsize; mparams.page_size = psize; mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD; mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD; #if MORECORE_CONTIGUOUS mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT; #else /* MORECORE_CONTIGUOUS */ mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT; #endif /* MORECORE_CONTIGUOUS */ #if !ONLY_MSPACES /* Set up lock for main malloc area */ gm->mflags = mparams.default_mflags; (void)INITIAL_LOCK(&gm->mutex); #endif #if LOCK_AT_FORK pthread_atfork(&pre_fork, &post_fork_parent, &post_fork_child); #endif { #if USE_DEV_RANDOM int fd; unsigned char buf[sizeof(size_t)]; /* Try to use /dev/urandom, else fall back on using time */ if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 && read(fd, buf, sizeof(buf)) == sizeof(buf)) { magic = *((size_t *) buf); close(fd); } else #endif /* USE_DEV_RANDOM */ #ifdef WIN32 magic = (size_t)(GetTickCount() ^ (size_t)0x55555555U); #elif defined(LACKS_TIME_H) magic = (size_t)&magic ^ (size_t)0x55555555U; #else magic = (size_t)(time(0) ^ (size_t)0x55555555U); #endif magic |= (size_t)8U; /* ensure nonzero */ magic &= ~(size_t)7U; /* improve chances of fault for bad values */ /* Until memory modes commonly available, use volatile-write */ (*(volatile size_t *)(&(mparams.magic))) = magic; } } RELEASE_MALLOC_GLOBAL_LOCK(); return 1; } /* support for mallopt */ static int change_mparam(int param_number, int value) { size_t val; ensure_initialization(); val = (value == -1)? MAX_SIZE_T : (size_t)value; switch(param_number) { case M_TRIM_THRESHOLD: mparams.trim_threshold = val; return 1; case M_GRANULARITY: if (val >= mparams.page_size && ((val & (val-1)) == 0)) { mparams.granularity = val; return 1; } else return 0; case M_MMAP_THRESHOLD: mparams.mmap_threshold = val; return 1; default: return 0; } } #if DEBUG /* ------------------------- Debugging Support --------------------------- */ /* Check properties of any chunk, whether free, inuse, mmapped etc */ static void do_check_any_chunk(mstate m, mchunkptr p) { assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); assert(ok_address(m, p)); } /* Check properties of top chunk */ static void do_check_top_chunk(mstate m, mchunkptr p) { msegmentptr sp = segment_holding(m, (char*)p); size_t sz = p->head & ~INUSE_BITS; /* third-lowest bit can be set! */ assert(sp != 0); assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); assert(ok_address(m, p)); assert(sz == m->topsize); assert(sz > 0); assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE); assert(pinuse(p)); assert(!pinuse(chunk_plus_offset(p, sz))); } /* Check properties of (inuse) mmapped chunks */ static void do_check_mmapped_chunk(mstate m, mchunkptr p) { size_t sz = chunksize(p); size_t len = (sz + (p->prev_foot) + MMAP_FOOT_PAD); assert(is_mmapped(p)); assert(use_mmap(m)); assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); assert(ok_address(m, p)); assert(!is_small(sz)); assert((len & (mparams.page_size-SIZE_T_ONE)) == 0); assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD); assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0); } /* Check properties of inuse chunks */ static void do_check_inuse_chunk(mstate m, mchunkptr p) { do_check_any_chunk(m, p); assert(is_inuse(p)); assert(next_pinuse(p)); /* If not pinuse and not mmapped, previous chunk has OK offset */ assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p); if (is_mmapped(p)) do_check_mmapped_chunk(m, p); } /* Check properties of free chunks */ static void do_check_free_chunk(mstate m, mchunkptr p) { size_t sz = chunksize(p); mchunkptr next = chunk_plus_offset(p, sz); do_check_any_chunk(m, p); assert(!is_inuse(p)); assert(!next_pinuse(p)); assert (!is_mmapped(p)); if (p != m->dv && p != m->top) { if (sz >= MIN_CHUNK_SIZE) { assert((sz & CHUNK_ALIGN_MASK) == 0); assert(is_aligned(chunk2mem(p))); assert(next->prev_foot == sz); assert(pinuse(p)); assert (next == m->top || is_inuse(next)); assert(p->fd->bk == p); assert(p->bk->fd == p); } else /* markers are always of size SIZE_T_SIZE */ assert(sz == SIZE_T_SIZE); } } /* Check properties of malloced chunks at the point they are malloced */ static void do_check_malloced_chunk(mstate m, void* mem, size_t s) { if (mem != 0) { mchunkptr p = mem2chunk(mem); size_t sz = p->head & ~INUSE_BITS; do_check_inuse_chunk(m, p); assert((sz & CHUNK_ALIGN_MASK) == 0); assert(sz >= MIN_CHUNK_SIZE); assert(sz >= s); /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */ assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE)); } } /* Check a tree and its subtrees. */ static void do_check_tree(mstate m, tchunkptr t) { tchunkptr head = 0; tchunkptr u = t; bindex_t tindex = t->index; size_t tsize = chunksize(t); bindex_t idx; compute_tree_index(tsize, idx); assert(tindex == idx); assert(tsize >= MIN_LARGE_SIZE); assert(tsize >= minsize_for_tree_index(idx)); assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1)))); do { /* traverse through chain of same-sized nodes */ do_check_any_chunk(m, ((mchunkptr)u)); assert(u->index == tindex); assert(chunksize(u) == tsize); assert(!is_inuse(u)); assert(!next_pinuse(u)); assert(u->fd->bk == u); assert(u->bk->fd == u); if (u->parent == 0) { assert(u->child[0] == 0); assert(u->child[1] == 0); } else { assert(head == 0); /* only one node on chain has parent */ head = u; assert(u->parent != u); assert (u->parent->child[0] == u || u->parent->child[1] == u || *((tbinptr*)(u->parent)) == u); if (u->child[0] != 0) { assert(u->child[0]->parent == u); assert(u->child[0] != u); do_check_tree(m, u->child[0]); } if (u->child[1] != 0) { assert(u->child[1]->parent == u); assert(u->child[1] != u); do_check_tree(m, u->child[1]); } if (u->child[0] != 0 && u->child[1] != 0) { assert(chunksize(u->child[0]) < chunksize(u->child[1])); } } u = u->fd; } while (u != t); assert(head != 0); } /* Check all the chunks in a treebin. */ static void do_check_treebin(mstate m, bindex_t i) { tbinptr* tb = treebin_at(m, i); tchunkptr t = *tb; int empty = (m->treemap & (1U << i)) == 0; if (t == 0) assert(empty); if (!empty) do_check_tree(m, t); } /* Check all the chunks in a smallbin. */ static void do_check_smallbin(mstate m, bindex_t i) { sbinptr b = smallbin_at(m, i); mchunkptr p = b->bk; unsigned int empty = (m->smallmap & (1U << i)) == 0; if (p == b) assert(empty); if (!empty) { for (; p != b; p = p->bk) { size_t size = chunksize(p); mchunkptr q; /* each chunk claims to be free */ do_check_free_chunk(m, p); /* chunk belongs in bin */ assert(small_index(size) == i); assert(p->bk == b || chunksize(p->bk) == chunksize(p)); /* chunk is followed by an inuse chunk */ q = next_chunk(p); if (q->head != FENCEPOST_HEAD) do_check_inuse_chunk(m, q); } } } /* Find x in a bin. Used in other check functions. */ static int bin_find(mstate m, mchunkptr x) { size_t size = chunksize(x); if (is_small(size)) { bindex_t sidx = small_index(size); sbinptr b = smallbin_at(m, sidx); if (smallmap_is_marked(m, sidx)) { mchunkptr p = b; do { if (p == x) return 1; } while ((p = p->fd) != b); } } else { bindex_t tidx; compute_tree_index(size, tidx); if (treemap_is_marked(m, tidx)) { tchunkptr t = *treebin_at(m, tidx); size_t sizebits = size << leftshift_for_tree_index(tidx); while (t != 0 && chunksize(t) != size) { t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; sizebits <<= 1; } if (t != 0) { tchunkptr u = t; do { if (u == (tchunkptr)x) return 1; } while ((u = u->fd) != t); } } } return 0; } /* Traverse each chunk and check it; return total */ static size_t traverse_and_check(mstate m) { size_t sum = 0; if (is_initialized(m)) { msegmentptr s = &m->seg; sum += m->topsize + TOP_FOOT_SIZE; while (s != 0) { mchunkptr q = align_as_chunk(s->base); mchunkptr lastq = 0; assert(pinuse(q)); while (segment_holds(s, q) && q != m->top && q->head != FENCEPOST_HEAD) { sum += chunksize(q); if (is_inuse(q)) { assert(!bin_find(m, q)); do_check_inuse_chunk(m, q); } else { assert(q == m->dv || bin_find(m, q)); assert(lastq == 0 || is_inuse(lastq)); /* Not 2 consecutive free */ do_check_free_chunk(m, q); } lastq = q; q = next_chunk(q); } s = s->next; } } return sum; } /* Check all properties of malloc_state. */ static void do_check_malloc_state(mstate m) { bindex_t i; size_t total; /* check bins */ for (i = 0; i < NSMALLBINS; ++i) do_check_smallbin(m, i); for (i = 0; i < NTREEBINS; ++i) do_check_treebin(m, i); if (m->dvsize != 0) { /* check dv chunk */ do_check_any_chunk(m, m->dv); assert(m->dvsize == chunksize(m->dv)); assert(m->dvsize >= MIN_CHUNK_SIZE); assert(bin_find(m, m->dv) == 0); } if (m->top != 0) { /* check top chunk */ do_check_top_chunk(m, m->top); /*assert(m->topsize == chunksize(m->top)); redundant */ assert(m->topsize > 0); assert(bin_find(m, m->top) == 0); } total = traverse_and_check(m); assert(total <= m->footprint); assert(m->footprint <= m->max_footprint); } #endif /* DEBUG */ /* ----------------------------- statistics ------------------------------ */ #if !NO_MALLINFO static struct mallinfo internal_mallinfo(mstate m) { struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ensure_initialization(); if (!PREACTION(m)) { check_malloc_state(m); if (is_initialized(m)) { size_t nfree = SIZE_T_ONE; /* top always free */ size_t mfree = m->topsize + TOP_FOOT_SIZE; size_t sum = mfree; msegmentptr s = &m->seg; while (s != 0) { mchunkptr q = align_as_chunk(s->base); while (segment_holds(s, q) && q != m->top && q->head != FENCEPOST_HEAD) { size_t sz = chunksize(q); sum += sz; if (!is_inuse(q)) { mfree += sz; ++nfree; } q = next_chunk(q); } s = s->next; } nm.arena = sum; nm.ordblks = nfree; nm.hblkhd = m->footprint - sum; nm.usmblks = m->max_footprint; nm.uordblks = m->footprint - mfree; nm.fordblks = mfree; nm.keepcost = m->topsize; } POSTACTION(m); } return nm; } #endif /* !NO_MALLINFO */ #if !NO_MALLOC_STATS static void internal_malloc_stats(mstate m) { ensure_initialization(); if (!PREACTION(m)) { size_t maxfp = 0; size_t fp = 0; size_t used = 0; check_malloc_state(m); if (is_initialized(m)) { msegmentptr s = &m->seg; maxfp = m->max_footprint; fp = m->footprint; used = fp - (m->topsize + TOP_FOOT_SIZE); while (s != 0) { mchunkptr q = align_as_chunk(s->base); while (segment_holds(s, q) && q != m->top && q->head != FENCEPOST_HEAD) { if (!is_inuse(q)) used -= chunksize(q); q = next_chunk(q); } s = s->next; } } POSTACTION(m); /* drop lock */ fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp)); fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp)); fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used)); } } #endif /* NO_MALLOC_STATS */ /* ----------------------- Operations on smallbins ----------------------- */ /* Various forms of linking and unlinking are defined as macros. Even the ones for trees, which are very long but have very short typical paths. This is ugly but reduces reliance on inlining support of compilers. */ /* Link a free chunk into a smallbin */ #define insert_small_chunk(M, P, S) {\ bindex_t I = small_index(S);\ mchunkptr B = smallbin_at(M, I);\ mchunkptr F = B;\ assert(S >= MIN_CHUNK_SIZE);\ if (!smallmap_is_marked(M, I))\ mark_smallmap(M, I);\ else if (RTCHECK(ok_address(M, B->fd)))\ F = B->fd;\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ B->fd = P;\ F->bk = P;\ P->fd = F;\ P->bk = B;\ } /* Unlink a chunk from a smallbin */ #define unlink_small_chunk(M, P, S) {\ mchunkptr F = P->fd;\ mchunkptr B = P->bk;\ bindex_t I = small_index(S);\ assert(P != B);\ assert(P != F);\ assert(chunksize(P) == small_index2size(I));\ if (RTCHECK(F == smallbin_at(M,I) || (ok_address(M, F) && F->bk == P))) { \ if (B == F) {\ clear_smallmap(M, I);\ }\ else if (RTCHECK(B == smallbin_at(M,I) ||\ (ok_address(M, B) && B->fd == P))) {\ F->bk = B;\ B->fd = F;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ } /* Unlink the first chunk from a smallbin */ #define unlink_first_small_chunk(M, B, P, I) {\ mchunkptr F = P->fd;\ assert(P != B);\ assert(P != F);\ assert(chunksize(P) == small_index2size(I));\ if (B == F) {\ clear_smallmap(M, I);\ }\ else if (RTCHECK(ok_address(M, F) && F->bk == P)) {\ F->bk = B;\ B->fd = F;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ } /* Replace dv node, binning the old one */ /* Used only when dvsize known to be small */ #define replace_dv(M, P, S) {\ size_t DVS = M->dvsize;\ assert(is_small(DVS));\ if (DVS != 0) {\ mchunkptr DV = M->dv;\ insert_small_chunk(M, DV, DVS);\ }\ M->dvsize = S;\ M->dv = P;\ } /* ------------------------- Operations on trees ------------------------- */ /* Insert chunk into tree */ #define insert_large_chunk(M, X, S) {\ tbinptr* H;\ bindex_t I;\ compute_tree_index(S, I);\ H = treebin_at(M, I);\ X->index = I;\ X->child[0] = X->child[1] = 0;\ if (!treemap_is_marked(M, I)) {\ mark_treemap(M, I);\ *H = X;\ X->parent = (tchunkptr)H;\ X->fd = X->bk = X;\ }\ else {\ tchunkptr T = *H;\ size_t K = S << leftshift_for_tree_index(I);\ for (;;) {\ if (chunksize(T) != S) {\ tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\ K <<= 1;\ if (*C != 0)\ T = *C;\ else if (RTCHECK(ok_address(M, C))) {\ *C = X;\ X->parent = T;\ X->fd = X->bk = X;\ break;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ break;\ }\ }\ else {\ tchunkptr F = T->fd;\ if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\ T->fd = F->bk = X;\ X->fd = F;\ X->bk = T;\ X->parent = 0;\ break;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ break;\ }\ }\ }\ }\ } /* Unlink steps: 1. If x is a chained node, unlink it from its same-sized fd/bk links and choose its bk node as its replacement. 2. If x was the last node of its size, but not a leaf node, it must be replaced with a leaf node (not merely one with an open left or right), to make sure that lefts and rights of descendents correspond properly to bit masks. We use the rightmost descendent of x. We could use any other leaf, but this is easy to locate and tends to counteract removal of leftmosts elsewhere, and so keeps paths shorter than minimally guaranteed. This doesn't loop much because on average a node in a tree is near the bottom. 3. If x is the base of a chain (i.e., has parent links) relink x's parent and children to x's replacement (or null if none). */ #define unlink_large_chunk(M, X) {\ tchunkptr XP = X->parent;\ tchunkptr R;\ if (X->bk != X) {\ tchunkptr F = X->fd;\ R = X->bk;\ if (RTCHECK(ok_address(M, F) && F->bk == X && R->fd == X)) {\ F->bk = R;\ R->fd = F;\ }\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ }\ else {\ tchunkptr* RP;\ if (((R = *(RP = &(X->child[1]))) != 0) ||\ ((R = *(RP = &(X->child[0]))) != 0)) {\ tchunkptr* CP;\ while ((*(CP = &(R->child[1])) != 0) ||\ (*(CP = &(R->child[0])) != 0)) {\ R = *(RP = CP);\ }\ if (RTCHECK(ok_address(M, RP)))\ *RP = 0;\ else {\ CORRUPTION_ERROR_ACTION(M);\ }\ }\ }\ if (XP != 0) {\ tbinptr* H = treebin_at(M, X->index);\ if (X == *H) {\ if ((*H = R) == 0) \ clear_treemap(M, X->index);\ }\ else if (RTCHECK(ok_address(M, XP))) {\ if (XP->child[0] == X) \ XP->child[0] = R;\ else \ XP->child[1] = R;\ }\ else\ CORRUPTION_ERROR_ACTION(M);\ if (R != 0) {\ if (RTCHECK(ok_address(M, R))) {\ tchunkptr C0, C1;\ R->parent = XP;\ if ((C0 = X->child[0]) != 0) {\ if (RTCHECK(ok_address(M, C0))) {\ R->child[0] = C0;\ C0->parent = R;\ }\ else\ CORRUPTION_ERROR_ACTION(M);\ }\ if ((C1 = X->child[1]) != 0) {\ if (RTCHECK(ok_address(M, C1))) {\ R->child[1] = C1;\ C1->parent = R;\ }\ else\ CORRUPTION_ERROR_ACTION(M);\ }\ }\ else\ CORRUPTION_ERROR_ACTION(M);\ }\ }\ } /* Relays to large vs small bin operations */ #define insert_chunk(M, P, S)\ if (is_small(S)) insert_small_chunk(M, P, S)\ else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); } #define unlink_chunk(M, P, S)\ if (is_small(S)) unlink_small_chunk(M, P, S)\ else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); } /* Relays to internal calls to malloc/free from realloc, memalign etc */ #if ONLY_MSPACES #define internal_malloc(m, b) mspace_malloc(m, b) #define internal_free(m, mem) mspace_free(m,mem); #else /* ONLY_MSPACES */ #if MSPACES #define internal_malloc(m, b)\ ((m == gm)? dlmalloc(b) : mspace_malloc(m, b)) #define internal_free(m, mem)\ if (m == gm) dlfree(mem); else mspace_free(m,mem); #else /* MSPACES */ #define internal_malloc(m, b) dlmalloc(b) #define internal_free(m, mem) dlfree(mem) #endif /* MSPACES */ #endif /* ONLY_MSPACES */ /* ----------------------- Direct-mmapping chunks ----------------------- */ /* Directly mmapped chunks are set up with an offset to the start of the mmapped region stored in the prev_foot field of the chunk. This allows reconstruction of the required argument to MUNMAP when freed, and also allows adjustment of the returned chunk to meet alignment requirements (especially in memalign). */ /* Malloc using mmap */ static void* mmap_alloc(mstate m, size_t nb) { size_t mmsize = mmap_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); if (m->footprint_limit != 0) { size_t fp = m->footprint + mmsize; if (fp <= m->footprint || fp > m->footprint_limit) return 0; } if (mmsize > nb) { /* Check for wrap around 0 */ char* mm = (char*)(CALL_DIRECT_MMAP(mmsize)); if (mm != CMFAIL) { size_t offset = align_offset(chunk2mem(mm)); size_t psize = mmsize - offset - MMAP_FOOT_PAD; mchunkptr p = (mchunkptr)(mm + offset); p->prev_foot = offset; p->head = psize; mark_inuse_foot(m, p, psize); chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD; chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0; if (m->least_addr == 0 || mm < m->least_addr) m->least_addr = mm; if ((m->footprint += mmsize) > m->max_footprint) m->max_footprint = m->footprint; assert(is_aligned(chunk2mem(p))); check_mmapped_chunk(m, p); return chunk2mem(p); } } return 0; } /* Realloc using mmap */ static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb, int flags) { size_t oldsize = chunksize(oldp); (void)flags; /* placate people compiling -Wunused */ if (is_small(nb)) /* Can't shrink mmap regions below small size */ return 0; /* Keep old chunk if big enough but not too big */ if (oldsize >= nb + SIZE_T_SIZE && (oldsize - nb) <= (mparams.granularity << 1)) return oldp; else { size_t offset = oldp->prev_foot; size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD; size_t newmmsize = mmap_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); char* cp = (char*)CALL_MREMAP((char*)oldp - offset, oldmmsize, newmmsize, flags); if (cp != CMFAIL) { mchunkptr newp = (mchunkptr)(cp + offset); size_t psize = newmmsize - offset - MMAP_FOOT_PAD; newp->head = psize; mark_inuse_foot(m, newp, psize); chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD; chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0; if (cp < m->least_addr) m->least_addr = cp; if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint) m->max_footprint = m->footprint; check_mmapped_chunk(m, newp); return newp; } } return 0; } /* -------------------------- mspace management -------------------------- */ /* Initialize top chunk and its size */ static void init_top(mstate m, mchunkptr p, size_t psize) { /* Ensure alignment */ size_t offset = align_offset(chunk2mem(p)); p = (mchunkptr)((char*)p + offset); psize -= offset; m->top = p; m->topsize = psize; p->head = psize | PINUSE_BIT; /* set size of fake trailing chunk holding overhead space only once */ chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; m->trim_check = mparams.trim_threshold; /* reset on each update */ } /* Initialize bins for a new mstate that is otherwise zeroed out */ static void init_bins(mstate m) { /* Establish circular links for smallbins */ bindex_t i; for (i = 0; i < NSMALLBINS; ++i) { sbinptr bin = smallbin_at(m,i); bin->fd = bin->bk = bin; } } #if PROCEED_ON_ERROR /* default corruption action */ static void reset_on_error(mstate m) { int i; ++malloc_corruption_error_count; /* Reinitialize fields to forget about all memory */ m->smallmap = m->treemap = 0; m->dvsize = m->topsize = 0; m->seg.base = 0; m->seg.size = 0; m->seg.next = 0; m->top = m->dv = 0; for (i = 0; i < NTREEBINS; ++i) *treebin_at(m, i) = 0; init_bins(m); } #endif /* PROCEED_ON_ERROR */ /* Allocate chunk and prepend remainder with chunk in successor base. */ static void* prepend_alloc(mstate m, char* newbase, char* oldbase, size_t nb) { mchunkptr p = align_as_chunk(newbase); mchunkptr oldfirst = align_as_chunk(oldbase); size_t psize = (char*)oldfirst - (char*)p; mchunkptr q = chunk_plus_offset(p, nb); size_t qsize = psize - nb; set_size_and_pinuse_of_inuse_chunk(m, p, nb); assert((char*)oldfirst > (char*)q); assert(pinuse(oldfirst)); assert(qsize >= MIN_CHUNK_SIZE); /* consolidate remainder with first chunk of old base */ if (oldfirst == m->top) { size_t tsize = m->topsize += qsize; m->top = q; q->head = tsize | PINUSE_BIT; check_top_chunk(m, q); } else if (oldfirst == m->dv) { size_t dsize = m->dvsize += qsize; m->dv = q; set_size_and_pinuse_of_free_chunk(q, dsize); } else { if (!is_inuse(oldfirst)) { size_t nsize = chunksize(oldfirst); unlink_chunk(m, oldfirst, nsize); oldfirst = chunk_plus_offset(oldfirst, nsize); qsize += nsize; } set_free_with_pinuse(q, qsize, oldfirst); insert_chunk(m, q, qsize); check_free_chunk(m, q); } check_malloced_chunk(m, chunk2mem(p), nb); return chunk2mem(p); } /* Add a segment to hold a new noncontiguous region */ static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) { /* Determine locations and sizes of segment, fenceposts, old top */ char* old_top = (char*)m->top; msegmentptr oldsp = segment_holding(m, old_top); char* old_end = oldsp->base + oldsp->size; size_t ssize = pad_request(sizeof(struct malloc_segment)); char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK); size_t offset = align_offset(chunk2mem(rawsp)); char* asp = rawsp + offset; char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp; mchunkptr sp = (mchunkptr)csp; msegmentptr ss = (msegmentptr)(chunk2mem(sp)); mchunkptr tnext = chunk_plus_offset(sp, ssize); mchunkptr p = tnext; int nfences = 0; /* reset top to new space */ init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); /* Set up segment record */ assert(is_aligned(ss)); set_size_and_pinuse_of_inuse_chunk(m, sp, ssize); *ss = m->seg; /* Push current record */ m->seg.base = tbase; m->seg.size = tsize; m->seg.sflags = mmapped; m->seg.next = ss; /* Insert trailing fenceposts */ for (;;) { mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); p->head = FENCEPOST_HEAD; ++nfences; if ((char*)(&(nextp->head)) < old_end) p = nextp; else break; } assert(nfences >= 2); /* Insert the rest of old top into a bin as an ordinary free chunk */ if (csp != old_top) { mchunkptr q = (mchunkptr)old_top; size_t psize = csp - old_top; mchunkptr tn = chunk_plus_offset(q, psize); set_free_with_pinuse(q, psize, tn); insert_chunk(m, q, psize); } check_top_chunk(m, m->top); } /* -------------------------- System allocation -------------------------- */ /* Get memory from system using MORECORE or MMAP */ static void* sys_alloc(mstate m, size_t nb) { char* tbase = CMFAIL; size_t tsize = 0; flag_t mmap_flag = 0; size_t asize; /* allocation size */ ensure_initialization(); /* Directly map large chunks, but only if already initialized */ if (use_mmap(m) && nb >= mparams.mmap_threshold && m->topsize != 0) { void* mem = mmap_alloc(m, nb); if (mem != 0) return mem; } asize = granularity_align(nb + SYS_ALLOC_PADDING); if (asize <= nb) return 0; /* wraparound */ if (m->footprint_limit != 0) { size_t fp = m->footprint + asize; if (fp <= m->footprint || fp > m->footprint_limit) return 0; } /* Try getting memory in any of three ways (in most-preferred to least-preferred order): 1. A call to MORECORE that can normally contiguously extend memory. (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or or main space is mmapped or a previous contiguous call failed) 2. A call to MMAP new space (disabled if not HAVE_MMAP). Note that under the default settings, if MORECORE is unable to fulfill a request, and HAVE_MMAP is true, then mmap is used as a noncontiguous system allocator. This is a useful backup strategy for systems with holes in address spaces -- in this case sbrk cannot contiguously expand the heap, but mmap may be able to find space. 3. A call to MORECORE that cannot usually contiguously extend memory. (disabled if not HAVE_MORECORE) In all cases, we need to request enough bytes from system to ensure we can malloc nb bytes upon success, so pad with enough space for top_foot, plus alignment-pad to make sure we don't lose bytes if not on boundary, and round this up to a granularity unit. */ if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) { char* br = CMFAIL; size_t ssize = asize; /* sbrk call size */ msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top); ACQUIRE_MALLOC_GLOBAL_LOCK(); if (ss == 0) { /* First time through or recovery */ char* base = (char*)CALL_MORECORE(0); if (base != CMFAIL) { size_t fp; /* Adjust to end on a page boundary */ if (!is_page_aligned(base)) ssize += (page_align((size_t)base) - (size_t)base); fp = m->footprint + ssize; /* recheck limits */ if (ssize > nb && ssize < HALF_MAX_SIZE_T && (m->footprint_limit == 0 || (fp > m->footprint && fp <= m->footprint_limit)) && (br = (char*)(CALL_MORECORE(ssize))) == base) { tbase = base; tsize = ssize; } } } else { /* Subtract out existing available top space from MORECORE request. */ ssize = granularity_align(nb - m->topsize + SYS_ALLOC_PADDING); /* Use mem here only if it did continuously extend old space */ if (ssize < HALF_MAX_SIZE_T && (br = (char*)(CALL_MORECORE(ssize))) == ss->base+ss->size) { tbase = br; tsize = ssize; } } if (tbase == CMFAIL) { /* Cope with partial failure */ if (br != CMFAIL) { /* Try to use/extend the space we did get */ if (ssize < HALF_MAX_SIZE_T && ssize < nb + SYS_ALLOC_PADDING) { size_t esize = granularity_align(nb + SYS_ALLOC_PADDING - ssize); if (esize < HALF_MAX_SIZE_T) { char* end = (char*)CALL_MORECORE(esize); if (end != CMFAIL) ssize += esize; else { /* Can't use; try to release */ (void) CALL_MORECORE(-ssize); br = CMFAIL; } } } } if (br != CMFAIL) { /* Use the space we did get */ tbase = br; tsize = ssize; } else disable_contiguous(m); /* Don't try contiguous path in the future */ } RELEASE_MALLOC_GLOBAL_LOCK(); } if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */ char* mp = (char*)(CALL_MMAP(asize)); if (mp != CMFAIL) { tbase = mp; tsize = asize; mmap_flag = USE_MMAP_BIT; } } if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */ if (asize < HALF_MAX_SIZE_T) { char* br = CMFAIL; char* end = CMFAIL; ACQUIRE_MALLOC_GLOBAL_LOCK(); br = (char*)(CALL_MORECORE(asize)); end = (char*)(CALL_MORECORE(0)); RELEASE_MALLOC_GLOBAL_LOCK(); if (br != CMFAIL && end != CMFAIL && br < end) { size_t ssize = end - br; if (ssize > nb + TOP_FOOT_SIZE) { tbase = br; tsize = ssize; } } } } if (tbase != CMFAIL) { if ((m->footprint += tsize) > m->max_footprint) m->max_footprint = m->footprint; if (!is_initialized(m)) { /* first-time initialization */ if (m->least_addr == 0 || tbase < m->least_addr) m->least_addr = tbase; m->seg.base = tbase; m->seg.size = tsize; m->seg.sflags = mmap_flag; m->magic = mparams.magic; m->release_checks = MAX_RELEASE_CHECK_RATE; init_bins(m); #if !ONLY_MSPACES if (is_global(m)) init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); else #endif { /* Offset top by embedded malloc_state */ mchunkptr mn = next_chunk(mem2chunk(m)); init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE); } } else { /* Try to merge with an existing segment */ msegmentptr sp = &m->seg; /* Only consider most recent segment if traversal suppressed */ while (sp != 0 && tbase != sp->base + sp->size) sp = (NO_SEGMENT_TRAVERSAL) ? 0 : sp->next; if (sp != 0 && !is_extern_segment(sp) && (sp->sflags & USE_MMAP_BIT) == mmap_flag && segment_holds(sp, m->top)) { /* append */ sp->size += tsize; init_top(m, m->top, m->topsize + tsize); } else { if (tbase < m->least_addr) m->least_addr = tbase; sp = &m->seg; while (sp != 0 && sp->base != tbase + tsize) sp = (NO_SEGMENT_TRAVERSAL) ? 0 : sp->next; if (sp != 0 && !is_extern_segment(sp) && (sp->sflags & USE_MMAP_BIT) == mmap_flag) { char* oldbase = sp->base; sp->base = tbase; sp->size += tsize; return prepend_alloc(m, tbase, oldbase, nb); } else add_segment(m, tbase, tsize, mmap_flag); } } if (nb < m->topsize) { /* Allocate from new or extended top space */ size_t rsize = m->topsize -= nb; mchunkptr p = m->top; mchunkptr r = m->top = chunk_plus_offset(p, nb); r->head = rsize | PINUSE_BIT; set_size_and_pinuse_of_inuse_chunk(m, p, nb); check_top_chunk(m, m->top); check_malloced_chunk(m, chunk2mem(p), nb); return chunk2mem(p); } } MALLOC_FAILURE_ACTION; return 0; } /* ----------------------- system deallocation -------------------------- */ /* Unmap and unlink any mmapped segments that don't contain used chunks */ static size_t release_unused_segments(mstate m) { size_t released = 0; int nsegs = 0; msegmentptr pred = &m->seg; msegmentptr sp = pred->next; while (sp != 0) { char* base = sp->base; size_t size = sp->size; msegmentptr next = sp->next; ++nsegs; if (is_mmapped_segment(sp) && !is_extern_segment(sp)) { mchunkptr p = align_as_chunk(base); size_t psize = chunksize(p); /* Can unmap if first chunk holds entire segment and not pinned */ if (!is_inuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) { tchunkptr tp = (tchunkptr)p; assert(segment_holds(sp, (char*)sp)); if (p == m->dv) { m->dv = 0; m->dvsize = 0; } else { unlink_large_chunk(m, tp); } if (CALL_MUNMAP(base, size) == 0) { released += size; m->footprint -= size; /* unlink obsoleted record */ sp = pred; sp->next = next; } else { /* back out if cannot unmap */ insert_large_chunk(m, tp, psize); } } } if (NO_SEGMENT_TRAVERSAL) /* scan only first segment */ break; pred = sp; sp = next; } /* Reset check counter */ m->release_checks = (((size_t) nsegs > (size_t) MAX_RELEASE_CHECK_RATE)? (size_t) nsegs : (size_t) MAX_RELEASE_CHECK_RATE); return released; } static int sys_trim(mstate m, size_t pad) { size_t released = 0; ensure_initialization(); if (pad < MAX_REQUEST && is_initialized(m)) { pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */ if (m->topsize > pad) { /* Shrink top space in granularity-size units, keeping at least one */ size_t unit = mparams.granularity; size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit - SIZE_T_ONE) * unit; msegmentptr sp = segment_holding(m, (char*)m->top); if (!is_extern_segment(sp)) { if (is_mmapped_segment(sp)) { if (HAVE_MMAP && sp->size >= extra && !has_segment_link(m, sp)) { /* can't shrink if pinned */ size_t newsize = sp->size - extra; (void)newsize; /* placate people compiling -Wunused-variable */ /* Prefer mremap, fall back to munmap */ if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) || (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { released = extra; } } } else if (HAVE_MORECORE) { if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */ extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit; ACQUIRE_MALLOC_GLOBAL_LOCK(); { /* Make sure end of memory is where we last set it. */ char* old_br = (char*)(CALL_MORECORE(0)); if (old_br == sp->base + sp->size) { char* rel_br = (char*)(CALL_MORECORE(-extra)); char* new_br = (char*)(CALL_MORECORE(0)); if (rel_br != CMFAIL && new_br < old_br) released = old_br - new_br; } } RELEASE_MALLOC_GLOBAL_LOCK(); } } if (released != 0) { sp->size -= released; m->footprint -= released; init_top(m, m->top, m->topsize - released); check_top_chunk(m, m->top); } } /* Unmap any unused mmapped segments */ if (HAVE_MMAP) released += release_unused_segments(m); /* On failure, disable autotrim to avoid repeated failed future calls */ if (released == 0 && m->topsize > m->trim_check) m->trim_check = MAX_SIZE_T; } return (released != 0)? 1 : 0; } /* Consolidate and bin a chunk. Differs from exported versions of free mainly in that the chunk need not be marked as inuse. */ static void dispose_chunk(mstate m, mchunkptr p, size_t psize) { mchunkptr next = chunk_plus_offset(p, psize); if (!pinuse(p)) { mchunkptr prev; size_t prevsize = p->prev_foot; if (is_mmapped(p)) { psize += prevsize + MMAP_FOOT_PAD; if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) m->footprint -= psize; return; } prev = chunk_minus_offset(p, prevsize); psize += prevsize; p = prev; if (RTCHECK(ok_address(m, prev))) { /* consolidate backward */ if (p != m->dv) { unlink_chunk(m, p, prevsize); } else if ((next->head & INUSE_BITS) == INUSE_BITS) { m->dvsize = psize; set_free_with_pinuse(p, psize, next); return; } } else { CORRUPTION_ERROR_ACTION(m); return; } } if (RTCHECK(ok_address(m, next))) { if (!cinuse(next)) { /* consolidate forward */ if (next == m->top) { size_t tsize = m->topsize += psize; m->top = p; p->head = tsize | PINUSE_BIT; if (p == m->dv) { m->dv = 0; m->dvsize = 0; } return; } else if (next == m->dv) { size_t dsize = m->dvsize += psize; m->dv = p; set_size_and_pinuse_of_free_chunk(p, dsize); return; } else { size_t nsize = chunksize(next); psize += nsize; unlink_chunk(m, next, nsize); set_size_and_pinuse_of_free_chunk(p, psize); if (p == m->dv) { m->dvsize = psize; return; } } } else { set_free_with_pinuse(p, psize, next); } insert_chunk(m, p, psize); } else { CORRUPTION_ERROR_ACTION(m); } } /* ---------------------------- malloc --------------------------- */ /* allocate a large request from the best fitting chunk in a treebin */ static void* tmalloc_large(mstate m, size_t nb) { tchunkptr v = 0; size_t rsize = -nb; /* Unsigned negation */ tchunkptr t; bindex_t idx; compute_tree_index(nb, idx); if ((t = *treebin_at(m, idx)) != 0) { /* Traverse tree for this bin looking for node with size == nb */ size_t sizebits = nb << leftshift_for_tree_index(idx); tchunkptr rst = 0; /* The deepest untaken right subtree */ for (;;) { tchunkptr rt; size_t trem = chunksize(t) - nb; if (trem < rsize) { v = t; if ((rsize = trem) == 0) break; } rt = t->child[1]; t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; if (rt != 0 && rt != t) rst = rt; if (t == 0) { t = rst; /* set t to least subtree holding sizes > nb */ break; } sizebits <<= 1; } } if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */ binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap; if (leftbits != 0) { bindex_t i; binmap_t leastbit = least_bit(leftbits); compute_bit2idx(leastbit, i); t = *treebin_at(m, i); } } while (t != 0) { /* find smallest of tree or subtree */ size_t trem = chunksize(t) - nb; if (trem < rsize) { rsize = trem; v = t; } t = leftmost_child(t); } /* If dv is a better fit, return 0 so malloc will use it */ if (v != 0 && rsize < (size_t)(m->dvsize - nb)) { if (RTCHECK(ok_address(m, v))) { /* split */ mchunkptr r = chunk_plus_offset(v, nb); assert(chunksize(v) == rsize + nb); if (RTCHECK(ok_next(v, r))) { unlink_large_chunk(m, v); if (rsize < MIN_CHUNK_SIZE) set_inuse_and_pinuse(m, v, (rsize + nb)); else { set_size_and_pinuse_of_inuse_chunk(m, v, nb); set_size_and_pinuse_of_free_chunk(r, rsize); insert_chunk(m, r, rsize); } return chunk2mem(v); } } CORRUPTION_ERROR_ACTION(m); } return 0; } /* allocate a small request from the best fitting chunk in a treebin */ static void* tmalloc_small(mstate m, size_t nb) { tchunkptr t, v; size_t rsize; bindex_t i; binmap_t leastbit = least_bit(m->treemap); compute_bit2idx(leastbit, i); v = t = *treebin_at(m, i); rsize = chunksize(t) - nb; while ((t = leftmost_child(t)) != 0) { size_t trem = chunksize(t) - nb; if (trem < rsize) { rsize = trem; v = t; } } if (RTCHECK(ok_address(m, v))) { mchunkptr r = chunk_plus_offset(v, nb); assert(chunksize(v) == rsize + nb); if (RTCHECK(ok_next(v, r))) { unlink_large_chunk(m, v); if (rsize < MIN_CHUNK_SIZE) set_inuse_and_pinuse(m, v, (rsize + nb)); else { set_size_and_pinuse_of_inuse_chunk(m, v, nb); set_size_and_pinuse_of_free_chunk(r, rsize); replace_dv(m, r, rsize); } return chunk2mem(v); } } CORRUPTION_ERROR_ACTION(m); return 0; } #if !ONLY_MSPACES void* dlmalloc(size_t bytes) { /* Basic algorithm: If a small request (< 256 bytes minus per-chunk overhead): 1. If one exists, use a remainderless chunk in associated smallbin. (Remainderless means that there are too few excess bytes to represent as a chunk.) 2. If it is big enough, use the dv chunk, which is normally the chunk adjacent to the one used for the most recent small request. 3. If one exists, split the smallest available chunk in a bin, saving remainder in dv. 4. If it is big enough, use the top chunk. 5. If available, get memory from system and use it Otherwise, for a large request: 1. Find the smallest available binned chunk that fits, and use it if it is better fitting than dv chunk, splitting if necessary. 2. If better fitting than any binned chunk, use the dv chunk. 3. If it is big enough, use the top chunk. 4. If request size >= mmap threshold, try to directly mmap this chunk. 5. If available, get memory from system and use it The ugly goto's here ensure that postaction occurs along all paths. */ #if USE_LOCKS ensure_initialization(); /* initialize in sys_alloc if not using locks */ #endif if (!PREACTION(gm)) { void* mem; size_t nb; if (bytes <= MAX_SMALL_REQUEST) { bindex_t idx; binmap_t smallbits; nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); idx = small_index(nb); smallbits = gm->smallmap >> idx; if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ mchunkptr b, p; idx += ~smallbits & 1; /* Uses next bin if idx empty */ b = smallbin_at(gm, idx); p = b->fd; assert(chunksize(p) == small_index2size(idx)); unlink_first_small_chunk(gm, b, p, idx); set_inuse_and_pinuse(gm, p, small_index2size(idx)); mem = chunk2mem(p); check_malloced_chunk(gm, mem, nb); goto postaction; } else if (nb > gm->dvsize) { if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ mchunkptr b, p, r; size_t rsize; bindex_t i; binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); binmap_t leastbit = least_bit(leftbits); compute_bit2idx(leastbit, i); b = smallbin_at(gm, i); p = b->fd; assert(chunksize(p) == small_index2size(i)); unlink_first_small_chunk(gm, b, p, i); rsize = small_index2size(i) - nb; /* Fit here cannot be remainderless if 4byte sizes */ if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) set_inuse_and_pinuse(gm, p, small_index2size(i)); else { set_size_and_pinuse_of_inuse_chunk(gm, p, nb); r = chunk_plus_offset(p, nb); set_size_and_pinuse_of_free_chunk(r, rsize); replace_dv(gm, r, rsize); } mem = chunk2mem(p); check_malloced_chunk(gm, mem, nb); goto postaction; } else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) { check_malloced_chunk(gm, mem, nb); goto postaction; } } } else if (bytes >= MAX_REQUEST) nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ else { nb = pad_request(bytes); if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) { check_malloced_chunk(gm, mem, nb); goto postaction; } } if (nb <= gm->dvsize) { size_t rsize = gm->dvsize - nb; mchunkptr p = gm->dv; if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ mchunkptr r = gm->dv = chunk_plus_offset(p, nb); gm->dvsize = rsize; set_size_and_pinuse_of_free_chunk(r, rsize); set_size_and_pinuse_of_inuse_chunk(gm, p, nb); } else { /* exhaust dv */ size_t dvs = gm->dvsize; gm->dvsize = 0; gm->dv = 0; set_inuse_and_pinuse(gm, p, dvs); } mem = chunk2mem(p); check_malloced_chunk(gm, mem, nb); goto postaction; } else if (nb < gm->topsize) { /* Split top */ size_t rsize = gm->topsize -= nb; mchunkptr p = gm->top; mchunkptr r = gm->top = chunk_plus_offset(p, nb); r->head = rsize | PINUSE_BIT; set_size_and_pinuse_of_inuse_chunk(gm, p, nb); mem = chunk2mem(p); check_top_chunk(gm, gm->top); check_malloced_chunk(gm, mem, nb); goto postaction; } mem = sys_alloc(gm, nb); postaction: POSTACTION(gm); return mem; } return 0; } /* ---------------------------- free --------------------------- */ void dlfree(void* mem) { /* Consolidate freed chunks with preceeding or succeeding bordering free chunks, if they exist, and then place in a bin. Intermixed with special cases for top, dv, mmapped chunks, and usage errors. */ if (mem != 0) { mchunkptr p = mem2chunk(mem); #if FOOTERS mstate fm = get_mstate_for(p); if (!ok_magic(fm)) { USAGE_ERROR_ACTION(fm, p); return; } #else /* FOOTERS */ #define fm gm #endif /* FOOTERS */ if (!PREACTION(fm)) { check_inuse_chunk(fm, p); if (RTCHECK(ok_address(fm, p) && ok_inuse(p))) { size_t psize = chunksize(p); mchunkptr next = chunk_plus_offset(p, psize); if (!pinuse(p)) { size_t prevsize = p->prev_foot; if (is_mmapped(p)) { psize += prevsize + MMAP_FOOT_PAD; if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) fm->footprint -= psize; goto postaction; } else { mchunkptr prev = chunk_minus_offset(p, prevsize); psize += prevsize; p = prev; if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ if (p != fm->dv) { unlink_chunk(fm, p, prevsize); } else if ((next->head & INUSE_BITS) == INUSE_BITS) { fm->dvsize = psize; set_free_with_pinuse(p, psize, next); goto postaction; } } else goto erroraction; } } if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { if (!cinuse(next)) { /* consolidate forward */ if (next == fm->top) { size_t tsize = fm->topsize += psize; fm->top = p; p->head = tsize | PINUSE_BIT; if (p == fm->dv) { fm->dv = 0; fm->dvsize = 0; } if (should_trim(fm, tsize)) sys_trim(fm, 0); goto postaction; } else if (next == fm->dv) { size_t dsize = fm->dvsize += psize; fm->dv = p; set_size_and_pinuse_of_free_chunk(p, dsize); goto postaction; } else { size_t nsize = chunksize(next); psize += nsize; unlink_chunk(fm, next, nsize); set_size_and_pinuse_of_free_chunk(p, psize); if (p == fm->dv) { fm->dvsize = psize; goto postaction; } } } else set_free_with_pinuse(p, psize, next); if (is_small(psize)) { insert_small_chunk(fm, p, psize); check_free_chunk(fm, p); } else { tchunkptr tp = (tchunkptr)p; insert_large_chunk(fm, tp, psize); check_free_chunk(fm, p); if (--fm->release_checks == 0) release_unused_segments(fm); } goto postaction; } } erroraction: USAGE_ERROR_ACTION(fm, p); postaction: POSTACTION(fm); } } #if !FOOTERS #undef fm #endif /* FOOTERS */ } void* dlcalloc(size_t n_elements, size_t elem_size) { void* mem; size_t req = 0; if (n_elements != 0) { req = n_elements * elem_size; if (((n_elements | elem_size) & ~(size_t)0xffff) && (req / n_elements != elem_size)) req = MAX_SIZE_T; /* force downstream failure on overflow */ } mem = dlmalloc(req); if (mem != 0 && calloc_must_clear(mem2chunk(mem))) memset(mem, 0, req); return mem; } #endif /* !ONLY_MSPACES */ /* ------------ Internal support for realloc, memalign, etc -------------- */ /* Try to realloc; only in-place unless can_move true */ static mchunkptr try_realloc_chunk(mstate m, mchunkptr p, size_t nb, int can_move) { mchunkptr newp = 0; size_t oldsize = chunksize(p); mchunkptr next = chunk_plus_offset(p, oldsize); if (RTCHECK(ok_address(m, p) && ok_inuse(p) && ok_next(p, next) && ok_pinuse(next))) { if (is_mmapped(p)) { newp = mmap_resize(m, p, nb, can_move); } else if (oldsize >= nb) { /* already big enough */ size_t rsize = oldsize - nb; if (rsize >= MIN_CHUNK_SIZE) { /* split off remainder */ mchunkptr r = chunk_plus_offset(p, nb); set_inuse(m, p, nb); set_inuse(m, r, rsize); dispose_chunk(m, r, rsize); } newp = p; } else if (next == m->top) { /* extend into top */ if (oldsize + m->topsize > nb) { size_t newsize = oldsize + m->topsize; size_t newtopsize = newsize - nb; mchunkptr newtop = chunk_plus_offset(p, nb); set_inuse(m, p, nb); newtop->head = newtopsize |PINUSE_BIT; m->top = newtop; m->topsize = newtopsize; newp = p; } } else if (next == m->dv) { /* extend into dv */ size_t dvs = m->dvsize; if (oldsize + dvs >= nb) { size_t dsize = oldsize + dvs - nb; if (dsize >= MIN_CHUNK_SIZE) { mchunkptr r = chunk_plus_offset(p, nb); mchunkptr n = chunk_plus_offset(r, dsize); set_inuse(m, p, nb); set_size_and_pinuse_of_free_chunk(r, dsize); clear_pinuse(n); m->dvsize = dsize; m->dv = r; } else { /* exhaust dv */ size_t newsize = oldsize + dvs; set_inuse(m, p, newsize); m->dvsize = 0; m->dv = 0; } newp = p; } } else if (!cinuse(next)) { /* extend into next free chunk */ size_t nextsize = chunksize(next); if (oldsize + nextsize >= nb) { size_t rsize = oldsize + nextsize - nb; unlink_chunk(m, next, nextsize); if (rsize < MIN_CHUNK_SIZE) { size_t newsize = oldsize + nextsize; set_inuse(m, p, newsize); } else { mchunkptr r = chunk_plus_offset(p, nb); set_inuse(m, p, nb); set_inuse(m, r, rsize); dispose_chunk(m, r, rsize); } newp = p; } } } else { USAGE_ERROR_ACTION(m, chunk2mem(p)); } return newp; } static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { void* mem = 0; if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ alignment = MIN_CHUNK_SIZE; if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */ size_t a = MALLOC_ALIGNMENT << 1; while (a < alignment) a <<= 1; alignment = a; } if (bytes >= MAX_REQUEST - alignment) { if (m != 0) { /* Test isn't needed but avoids compiler warning */ MALLOC_FAILURE_ACTION; } } else { size_t nb = request2size(bytes); size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD; mem = internal_malloc(m, req); if (mem != 0) { mchunkptr p = mem2chunk(mem); if (PREACTION(m)) return 0; if ((((size_t)(mem)) & (alignment - 1)) != 0) { /* misaligned */ /* Find an aligned spot inside chunk. Since we need to give back leading space in a chunk of at least MIN_CHUNK_SIZE, if the first calculation places us at a spot with less than MIN_CHUNK_SIZE leader, we can move to the next aligned spot. We've allocated enough total room so that this is always possible. */ char* br = (char*)mem2chunk((size_t)(((size_t)((char*)mem + alignment - SIZE_T_ONE)) & -alignment)); char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)? br : br+alignment; mchunkptr newp = (mchunkptr)pos; size_t leadsize = pos - (char*)(p); size_t newsize = chunksize(p) - leadsize; if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */ newp->prev_foot = p->prev_foot + leadsize; newp->head = newsize; } else { /* Otherwise, give back leader, use the rest */ set_inuse(m, newp, newsize); set_inuse(m, p, leadsize); dispose_chunk(m, p, leadsize); } p = newp; } /* Give back spare room at the end */ if (!is_mmapped(p)) { size_t size = chunksize(p); if (size > nb + MIN_CHUNK_SIZE) { size_t remainder_size = size - nb; mchunkptr remainder = chunk_plus_offset(p, nb); set_inuse(m, p, nb); set_inuse(m, remainder, remainder_size); dispose_chunk(m, remainder, remainder_size); } } mem = chunk2mem(p); assert (chunksize(p) >= nb); assert(((size_t)mem & (alignment - 1)) == 0); check_inuse_chunk(m, p); POSTACTION(m); } } return mem; } /* Common support for independent_X routines, handling all of the combinations that can result. The opts arg has: bit 0 set if all elements are same size (using sizes[0]) bit 1 set if elements should be zeroed */ static void** ialloc(mstate m, size_t n_elements, size_t* sizes, int opts, void* chunks[]) { size_t element_size; /* chunksize of each element, if all same */ size_t contents_size; /* total size of elements */ size_t array_size; /* request size of pointer array */ void* mem; /* malloced aggregate space */ mchunkptr p; /* corresponding chunk */ size_t remainder_size; /* remaining bytes while splitting */ void** marray; /* either "chunks" or malloced ptr array */ mchunkptr array_chunk; /* chunk for malloced ptr array */ flag_t was_enabled; /* to disable mmap */ size_t size; size_t i; ensure_initialization(); /* compute array length, if needed */ if (chunks != 0) { if (n_elements == 0) return chunks; /* nothing to do */ marray = chunks; array_size = 0; } else { /* if empty req, must still return chunk representing empty array */ if (n_elements == 0) return (void**)internal_malloc(m, 0); marray = 0; array_size = request2size(n_elements * (sizeof(void*))); } /* compute total element size */ if (opts & 0x1) { /* all-same-size */ element_size = request2size(*sizes); contents_size = n_elements * element_size; } else { /* add up all the sizes */ element_size = 0; contents_size = 0; for (i = 0; i != n_elements; ++i) contents_size += request2size(sizes[i]); } size = contents_size + array_size; /* Allocate the aggregate chunk. First disable direct-mmapping so malloc won't use it, since we would not be able to later free/realloc space internal to a segregated mmap region. */ was_enabled = use_mmap(m); disable_mmap(m); mem = internal_malloc(m, size - CHUNK_OVERHEAD); if (was_enabled) enable_mmap(m); if (mem == 0) return 0; if (PREACTION(m)) return 0; p = mem2chunk(mem); remainder_size = chunksize(p); assert(!is_mmapped(p)); if (opts & 0x2) { /* optionally clear the elements */ memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size); } /* If not provided, allocate the pointer array as final part of chunk */ if (marray == 0) { size_t array_chunk_size; array_chunk = chunk_plus_offset(p, contents_size); array_chunk_size = remainder_size - contents_size; marray = (void**) (chunk2mem(array_chunk)); set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size); remainder_size = contents_size; } /* split out elements */ for (i = 0; ; ++i) { marray[i] = chunk2mem(p); if (i != n_elements-1) { if (element_size != 0) size = element_size; else size = request2size(sizes[i]); remainder_size -= size; set_size_and_pinuse_of_inuse_chunk(m, p, size); p = chunk_plus_offset(p, size); } else { /* the final element absorbs any overallocation slop */ set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size); break; } } #if DEBUG if (marray != chunks) { /* final element must have exactly exhausted chunk */ if (element_size != 0) { assert(remainder_size == element_size); } else { assert(remainder_size == request2size(sizes[i])); } check_inuse_chunk(m, mem2chunk(marray)); } for (i = 0; i != n_elements; ++i) check_inuse_chunk(m, mem2chunk(marray[i])); #endif /* DEBUG */ POSTACTION(m); return marray; } /* Try to free all pointers in the given array. Note: this could be made faster, by delaying consolidation, at the price of disabling some user integrity checks, We still optimize some consolidations by combining adjacent chunks before freeing, which will occur often if allocated with ialloc or the array is sorted. */ static size_t internal_bulk_free(mstate m, void* array[], size_t nelem) { size_t unfreed = 0; if (!PREACTION(m)) { void** a; void** fence = &(array[nelem]); for (a = array; a != fence; ++a) { void* mem = *a; if (mem != 0) { mchunkptr p = mem2chunk(mem); size_t psize = chunksize(p); #if FOOTERS if (get_mstate_for(p) != m) { ++unfreed; continue; } #endif check_inuse_chunk(m, p); *a = 0; if (RTCHECK(ok_address(m, p) && ok_inuse(p))) { void ** b = a + 1; /* try to merge with next chunk */ mchunkptr next = next_chunk(p); if (b != fence && *b == chunk2mem(next)) { size_t newsize = chunksize(next) + psize; set_inuse(m, p, newsize); *b = chunk2mem(p); } else dispose_chunk(m, p, psize); } else { CORRUPTION_ERROR_ACTION(m); break; } } } if (should_trim(m, m->topsize)) sys_trim(m, 0); POSTACTION(m); } return unfreed; } /* Traversal */ #if MALLOC_INSPECT_ALL static void internal_inspect_all(mstate m, void(*handler)(void *start, void *end, size_t used_bytes, void* callback_arg), void* arg) { if (is_initialized(m)) { mchunkptr top = m->top; msegmentptr s; for (s = &m->seg; s != 0; s = s->next) { mchunkptr q = align_as_chunk(s->base); while (segment_holds(s, q) && q->head != FENCEPOST_HEAD) { mchunkptr next = next_chunk(q); size_t sz = chunksize(q); size_t used; void* start; if (is_inuse(q)) { used = sz - CHUNK_OVERHEAD; /* must not be mmapped */ start = chunk2mem(q); } else { used = 0; if (is_small(sz)) { /* offset by possible bookkeeping */ start = (void*)((char*)q + sizeof(struct malloc_chunk)); } else { start = (void*)((char*)q + sizeof(struct malloc_tree_chunk)); } } if (start < (void*)next) /* skip if all space is bookkeeping */ handler(start, next, used, arg); if (q == top) break; q = next; } } } } #endif /* MALLOC_INSPECT_ALL */ /* ------------------ Exported realloc, memalign, etc -------------------- */ #if !ONLY_MSPACES void* dlrealloc(void* oldmem, size_t bytes) { void* mem = 0; if (oldmem == 0) { mem = dlmalloc(bytes); } else if (bytes >= MAX_REQUEST) { MALLOC_FAILURE_ACTION; } #ifdef REALLOC_ZERO_BYTES_FREES else if (bytes == 0) { dlfree(oldmem); } #endif /* REALLOC_ZERO_BYTES_FREES */ else { size_t nb = request2size(bytes); mchunkptr oldp = mem2chunk(oldmem); #if ! FOOTERS mstate m = gm; #else /* FOOTERS */ mstate m = get_mstate_for(oldp); if (!ok_magic(m)) { USAGE_ERROR_ACTION(m, oldmem); return 0; } #endif /* FOOTERS */ if (!PREACTION(m)) { mchunkptr newp = try_realloc_chunk(m, oldp, nb, 1); POSTACTION(m); if (newp != 0) { check_inuse_chunk(m, newp); mem = chunk2mem(newp); } else { mem = internal_malloc(m, bytes); if (mem != 0) { size_t oc = chunksize(oldp) - overhead_for(oldp); memcpy(mem, oldmem, (oc < bytes)? oc : bytes); internal_free(m, oldmem); } } } } return mem; } void* dlrealloc_in_place(void* oldmem, size_t bytes) { void* mem = 0; if (oldmem != 0) { if (bytes >= MAX_REQUEST) { MALLOC_FAILURE_ACTION; } else { size_t nb = request2size(bytes); mchunkptr oldp = mem2chunk(oldmem); #if ! FOOTERS mstate m = gm; #else /* FOOTERS */ mstate m = get_mstate_for(oldp); if (!ok_magic(m)) { USAGE_ERROR_ACTION(m, oldmem); return 0; } #endif /* FOOTERS */ if (!PREACTION(m)) { mchunkptr newp = try_realloc_chunk(m, oldp, nb, 0); POSTACTION(m); if (newp == oldp) { check_inuse_chunk(m, newp); mem = oldmem; } } } } return mem; } void* dlmemalign(size_t alignment, size_t bytes) { if (alignment <= MALLOC_ALIGNMENT) { return dlmalloc(bytes); } return internal_memalign(gm, alignment, bytes); } void* dlaligned_alloc(size_t alignment, size_t size) { if (size % alignment) return NULL; return dlmemalign(alignment, size); } int dlposix_memalign(void** pp, size_t alignment, size_t bytes) { void* mem = 0; if (alignment == MALLOC_ALIGNMENT) mem = dlmalloc(bytes); else { size_t d = alignment / sizeof(void*); size_t r = alignment % sizeof(void*); if (r != 0 || d == 0 || (d & (d-SIZE_T_ONE)) != 0) return EINVAL; else if (bytes <= MAX_REQUEST - alignment) { if (alignment < MIN_CHUNK_SIZE) alignment = MIN_CHUNK_SIZE; mem = internal_memalign(gm, alignment, bytes); } } if (mem == 0) return ENOMEM; else { *pp = mem; return 0; } } void* dlvalloc(size_t bytes) { size_t pagesz; ensure_initialization(); pagesz = mparams.page_size; return dlmemalign(pagesz, bytes); } void* dlpvalloc(size_t bytes) { size_t pagesz; ensure_initialization(); pagesz = mparams.page_size; return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE)); } void** dlindependent_calloc(size_t n_elements, size_t elem_size, void* chunks[]) { size_t sz = elem_size; /* serves as 1-element array */ return ialloc(gm, n_elements, &sz, 3, chunks); } void** dlindependent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]) { return ialloc(gm, n_elements, sizes, 0, chunks); } size_t dlbulk_free(void* array[], size_t nelem) { return internal_bulk_free(gm, array, nelem); } #if MALLOC_INSPECT_ALL void dlmalloc_inspect_all(void(*handler)(void *start, void *end, size_t used_bytes, void* callback_arg), void* arg) { ensure_initialization(); if (!PREACTION(gm)) { internal_inspect_all(gm, handler, arg); POSTACTION(gm); } } #endif /* MALLOC_INSPECT_ALL */ int dlmalloc_trim(size_t pad) { int result = 0; ensure_initialization(); if (!PREACTION(gm)) { result = sys_trim(gm, pad); POSTACTION(gm); } return result; } size_t dlmalloc_footprint(void) { return gm->footprint; } size_t dlmalloc_max_footprint(void) { return gm->max_footprint; } size_t dlmalloc_footprint_limit(void) { size_t maf = gm->footprint_limit; return maf == 0 ? MAX_SIZE_T : maf; } size_t dlmalloc_set_footprint_limit(size_t bytes) { size_t result; /* invert sense of 0 */ if (bytes == 0) result = granularity_align(1); /* Use minimal size */ if (bytes == MAX_SIZE_T) result = 0; /* disable */ else result = granularity_align(bytes); return gm->footprint_limit = result; } #if !NO_MALLINFO struct mallinfo dlmallinfo(void) { return internal_mallinfo(gm); } #endif /* NO_MALLINFO */ #if !NO_MALLOC_STATS void dlmalloc_stats() { internal_malloc_stats(gm); } #endif /* NO_MALLOC_STATS */ int dlmallopt(int param_number, int value) { return change_mparam(param_number, value); } size_t dlmalloc_usable_size(void* mem) { if (mem != 0) { mchunkptr p = mem2chunk(mem); if (is_inuse(p)) return chunksize(p) - overhead_for(p); } return 0; } #endif /* !ONLY_MSPACES */ /* ----------------------------- user mspaces ---------------------------- */ #if MSPACES static mstate init_user_mstate(char* tbase, size_t tsize) { size_t msize = pad_request(sizeof(struct malloc_state)); mchunkptr mn; mchunkptr msp = align_as_chunk(tbase); mstate m = (mstate)(chunk2mem(msp)); memset(m, 0, msize); (void)INITIAL_LOCK(&m->mutex); msp->head = (msize|INUSE_BITS); m->seg.base = m->least_addr = tbase; m->seg.size = m->footprint = m->max_footprint = tsize; m->magic = mparams.magic; m->release_checks = MAX_RELEASE_CHECK_RATE; m->mflags = mparams.default_mflags; m->extp = 0; m->exts = 0; disable_contiguous(m); init_bins(m); mn = next_chunk(mem2chunk(m)); init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE); check_top_chunk(m, m->top); return m; } mspace create_mspace(size_t capacity, int locked) { mstate m = 0; size_t msize; ensure_initialization(); msize = pad_request(sizeof(struct malloc_state)); if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { size_t rs = ((capacity == 0)? mparams.granularity : (capacity + TOP_FOOT_SIZE + msize)); size_t tsize = granularity_align(rs); char* tbase = (char*)(CALL_MMAP(tsize)); if (tbase != CMFAIL) { m = init_user_mstate(tbase, tsize); m->seg.sflags = USE_MMAP_BIT; set_lock(m, locked); } } return (mspace)m; } mspace create_mspace_with_base(void* base, size_t capacity, int locked) { mstate m = 0; size_t msize; ensure_initialization(); msize = pad_request(sizeof(struct malloc_state)); if (capacity > msize + TOP_FOOT_SIZE && capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { m = init_user_mstate((char*)base, capacity); m->seg.sflags = EXTERN_BIT; set_lock(m, locked); } return (mspace)m; } int mspace_track_large_chunks(mspace msp, int enable) { int ret = 0; mstate ms = (mstate)msp; if (!PREACTION(ms)) { if (!use_mmap(ms)) { ret = 1; } if (!enable) { enable_mmap(ms); } else { disable_mmap(ms); } POSTACTION(ms); } return ret; } size_t destroy_mspace(mspace msp) { size_t freed = 0; mstate ms = (mstate)msp; if (ok_magic(ms)) { msegmentptr sp = &ms->seg; (void)DESTROY_LOCK(&ms->mutex); /* destroy before unmapped */ while (sp != 0) { char* base = sp->base; size_t size = sp->size; flag_t flag = sp->sflags; (void)base; /* placate people compiling -Wunused-variable */ sp = sp->next; if ((flag & USE_MMAP_BIT) && !(flag & EXTERN_BIT) && CALL_MUNMAP(base, size) == 0) freed += size; } } else { USAGE_ERROR_ACTION(ms,ms); } return freed; } /* mspace versions of routines are near-clones of the global versions. This is not so nice but better than the alternatives. */ void* mspace_malloc(mspace msp, size_t bytes) { mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } if (!PREACTION(ms)) { void* mem; size_t nb; if (bytes <= MAX_SMALL_REQUEST) { bindex_t idx; binmap_t smallbits; nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); idx = small_index(nb); smallbits = ms->smallmap >> idx; if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ mchunkptr b, p; idx += ~smallbits & 1; /* Uses next bin if idx empty */ b = smallbin_at(ms, idx); p = b->fd; assert(chunksize(p) == small_index2size(idx)); unlink_first_small_chunk(ms, b, p, idx); set_inuse_and_pinuse(ms, p, small_index2size(idx)); mem = chunk2mem(p); check_malloced_chunk(ms, mem, nb); goto postaction; } else if (nb > ms->dvsize) { if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ mchunkptr b, p, r; size_t rsize; bindex_t i; binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); binmap_t leastbit = least_bit(leftbits); compute_bit2idx(leastbit, i); b = smallbin_at(ms, i); p = b->fd; assert(chunksize(p) == small_index2size(i)); unlink_first_small_chunk(ms, b, p, i); rsize = small_index2size(i) - nb; /* Fit here cannot be remainderless if 4byte sizes */ if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) set_inuse_and_pinuse(ms, p, small_index2size(i)); else { set_size_and_pinuse_of_inuse_chunk(ms, p, nb); r = chunk_plus_offset(p, nb); set_size_and_pinuse_of_free_chunk(r, rsize); replace_dv(ms, r, rsize); } mem = chunk2mem(p); check_malloced_chunk(ms, mem, nb); goto postaction; } else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) { check_malloced_chunk(ms, mem, nb); goto postaction; } } } else if (bytes >= MAX_REQUEST) nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ else { nb = pad_request(bytes); if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { check_malloced_chunk(ms, mem, nb); goto postaction; } } if (nb <= ms->dvsize) { size_t rsize = ms->dvsize - nb; mchunkptr p = ms->dv; if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ mchunkptr r = ms->dv = chunk_plus_offset(p, nb); ms->dvsize = rsize; set_size_and_pinuse_of_free_chunk(r, rsize); set_size_and_pinuse_of_inuse_chunk(ms, p, nb); } else { /* exhaust dv */ size_t dvs = ms->dvsize; ms->dvsize = 0; ms->dv = 0; set_inuse_and_pinuse(ms, p, dvs); } mem = chunk2mem(p); check_malloced_chunk(ms, mem, nb); goto postaction; } else if (nb < ms->topsize) { /* Split top */ size_t rsize = ms->topsize -= nb; mchunkptr p = ms->top; mchunkptr r = ms->top = chunk_plus_offset(p, nb); r->head = rsize | PINUSE_BIT; set_size_and_pinuse_of_inuse_chunk(ms, p, nb); mem = chunk2mem(p); check_top_chunk(ms, ms->top); check_malloced_chunk(ms, mem, nb); goto postaction; } mem = sys_alloc(ms, nb); postaction: POSTACTION(ms); return mem; } return 0; } void mspace_free(mspace msp, void* mem) { if (mem != 0) { mchunkptr p = mem2chunk(mem); #if FOOTERS mstate fm = get_mstate_for(p); (void)msp; /* placate people compiling -Wunused */ #else /* FOOTERS */ mstate fm = (mstate)msp; #endif /* FOOTERS */ if (!ok_magic(fm)) { USAGE_ERROR_ACTION(fm, p); return; } if (!PREACTION(fm)) { check_inuse_chunk(fm, p); if (RTCHECK(ok_address(fm, p) && ok_inuse(p))) { size_t psize = chunksize(p); mchunkptr next = chunk_plus_offset(p, psize); if (!pinuse(p)) { size_t prevsize = p->prev_foot; if (is_mmapped(p)) { psize += prevsize + MMAP_FOOT_PAD; if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) fm->footprint -= psize; goto postaction; } else { mchunkptr prev = chunk_minus_offset(p, prevsize); psize += prevsize; p = prev; if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ if (p != fm->dv) { unlink_chunk(fm, p, prevsize); } else if ((next->head & INUSE_BITS) == INUSE_BITS) { fm->dvsize = psize; set_free_with_pinuse(p, psize, next); goto postaction; } } else goto erroraction; } } if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { if (!cinuse(next)) { /* consolidate forward */ if (next == fm->top) { size_t tsize = fm->topsize += psize; fm->top = p; p->head = tsize | PINUSE_BIT; if (p == fm->dv) { fm->dv = 0; fm->dvsize = 0; } if (should_trim(fm, tsize)) sys_trim(fm, 0); goto postaction; } else if (next == fm->dv) { size_t dsize = fm->dvsize += psize; fm->dv = p; set_size_and_pinuse_of_free_chunk(p, dsize); goto postaction; } else { size_t nsize = chunksize(next); psize += nsize; unlink_chunk(fm, next, nsize); set_size_and_pinuse_of_free_chunk(p, psize); if (p == fm->dv) { fm->dvsize = psize; goto postaction; } } } else set_free_with_pinuse(p, psize, next); if (is_small(psize)) { insert_small_chunk(fm, p, psize); check_free_chunk(fm, p); } else { tchunkptr tp = (tchunkptr)p; insert_large_chunk(fm, tp, psize); check_free_chunk(fm, p); if (--fm->release_checks == 0) release_unused_segments(fm); } goto postaction; } } erroraction: USAGE_ERROR_ACTION(fm, p); postaction: POSTACTION(fm); } } } void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) { void* mem; size_t req = 0; mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } if (n_elements != 0) { req = n_elements * elem_size; if (((n_elements | elem_size) & ~(size_t)0xffff) && (req / n_elements != elem_size)) req = MAX_SIZE_T; /* force downstream failure on overflow */ } mem = internal_malloc(ms, req); if (mem != 0 && calloc_must_clear(mem2chunk(mem))) memset(mem, 0, req); return mem; } void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) { void* mem = 0; if (oldmem == 0) { mem = mspace_malloc(msp, bytes); } else if (bytes >= MAX_REQUEST) { MALLOC_FAILURE_ACTION; } #ifdef REALLOC_ZERO_BYTES_FREES else if (bytes == 0) { mspace_free(msp, oldmem); } #endif /* REALLOC_ZERO_BYTES_FREES */ else { size_t nb = request2size(bytes); mchunkptr oldp = mem2chunk(oldmem); #if ! FOOTERS mstate m = (mstate)msp; #else /* FOOTERS */ mstate m = get_mstate_for(oldp); if (!ok_magic(m)) { USAGE_ERROR_ACTION(m, oldmem); return 0; } #endif /* FOOTERS */ if (!PREACTION(m)) { mchunkptr newp = try_realloc_chunk(m, oldp, nb, 1); POSTACTION(m); if (newp != 0) { check_inuse_chunk(m, newp); mem = chunk2mem(newp); } else { mem = mspace_malloc(m, bytes); if (mem != 0) { size_t oc = chunksize(oldp) - overhead_for(oldp); memcpy(mem, oldmem, (oc < bytes)? oc : bytes); mspace_free(m, oldmem); } } } } return mem; } void* mspace_realloc_in_place(mspace msp, void* oldmem, size_t bytes) { void* mem = 0; if (oldmem != 0) { if (bytes >= MAX_REQUEST) { MALLOC_FAILURE_ACTION; } else { size_t nb = request2size(bytes); mchunkptr oldp = mem2chunk(oldmem); #if ! FOOTERS mstate m = (mstate)msp; #else /* FOOTERS */ mstate m = get_mstate_for(oldp); (void)msp; /* placate people compiling -Wunused */ if (!ok_magic(m)) { USAGE_ERROR_ACTION(m, oldmem); return 0; } #endif /* FOOTERS */ if (!PREACTION(m)) { mchunkptr newp = try_realloc_chunk(m, oldp, nb, 0); POSTACTION(m); if (newp == oldp) { check_inuse_chunk(m, newp); mem = oldmem; } } } } return mem; } void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) { mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } if (alignment <= MALLOC_ALIGNMENT) return mspace_malloc(msp, bytes); return internal_memalign(ms, alignment, bytes); } void* mspace_aligned_alloc(mspace msp, size_t alignment, size_t bytes) { if (bytes % alignment) return NULL; return mspace_memalign(msp, alignment, bytes); } int mspace_posix_memalign(mspace msp, void **memptr, size_t alignment, size_t bytes) { if (bytes == 0) { *memptr = NULL; return 0; } void *res = mspace_memalign(msp, alignment, bytes); if (res) { *memptr = res; return 0; } return 1; } void** mspace_independent_calloc(mspace msp, size_t n_elements, size_t elem_size, void* chunks[]) { size_t sz = elem_size; /* serves as 1-element array */ mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } return ialloc(ms, n_elements, &sz, 3, chunks); } void** mspace_independent_comalloc(mspace msp, size_t n_elements, size_t sizes[], void* chunks[]) { mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); return 0; } return ialloc(ms, n_elements, sizes, 0, chunks); } size_t mspace_bulk_free(mspace msp, void* array[], size_t nelem) { return internal_bulk_free((mstate)msp, array, nelem); } #if MALLOC_INSPECT_ALL void mspace_inspect_all(mspace msp, void(*handler)(void *start, void *end, size_t used_bytes, void* callback_arg), void* arg) { mstate ms = (mstate)msp; if (ok_magic(ms)) { if (!PREACTION(ms)) { internal_inspect_all(ms, handler, arg); POSTACTION(ms); } } else { USAGE_ERROR_ACTION(ms,ms); } } #endif /* MALLOC_INSPECT_ALL */ int mspace_trim(mspace msp, size_t pad) { int result = 0; mstate ms = (mstate)msp; if (ok_magic(ms)) { if (!PREACTION(ms)) { result = sys_trim(ms, pad); POSTACTION(ms); } } else { USAGE_ERROR_ACTION(ms,ms); } return result; } #if !NO_MALLOC_STATS void mspace_malloc_stats(mspace msp) { mstate ms = (mstate)msp; if (ok_magic(ms)) { internal_malloc_stats(ms); } else { USAGE_ERROR_ACTION(ms,ms); } } #endif /* NO_MALLOC_STATS */ void* mspace_least_addr(mspace msp) { mstate ms = (mstate)msp; return (void*)ms->least_addr; } size_t mspace_footprint(mspace msp) { size_t result = 0; mstate ms = (mstate)msp; if (ok_magic(ms)) { result = ms->footprint; } else { USAGE_ERROR_ACTION(ms,ms); } return result; } size_t mspace_max_footprint(mspace msp) { size_t result = 0; mstate ms = (mstate)msp; if (ok_magic(ms)) { result = ms->max_footprint; } else { USAGE_ERROR_ACTION(ms,ms); } return result; } size_t mspace_footprint_limit(mspace msp) { size_t result = 0; mstate ms = (mstate)msp; if (ok_magic(ms)) { size_t maf = ms->footprint_limit; result = (maf == 0) ? MAX_SIZE_T : maf; } else { USAGE_ERROR_ACTION(ms,ms); } return result; } size_t mspace_set_footprint_limit(mspace msp, size_t bytes) { size_t result = 0; mstate ms = (mstate)msp; if (ok_magic(ms)) { if (bytes == 0) result = granularity_align(1); /* Use minimal size */ if (bytes == MAX_SIZE_T) result = 0; /* disable */ else result = granularity_align(bytes); ms->footprint_limit = result; } else { USAGE_ERROR_ACTION(ms,ms); } return result; } #if !NO_MALLINFO struct mallinfo mspace_mallinfo(mspace msp) { mstate ms = (mstate)msp; if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms,ms); } return internal_mallinfo(ms); } #endif /* NO_MALLINFO */ size_t mspace_usable_size(const void* mem) { if (mem != 0) { mchunkptr p = mem2chunk(mem); if (is_inuse(p)) return chunksize(p) - overhead_for(p); } return 0; } int mspace_mallopt(int param_number, int value) { return change_mparam(param_number, value); } #endif /* MSPACES */ /* -------------------- Alternative MORECORE functions ------------------- */ /* Guidelines for creating a custom version of MORECORE: * For best performance, MORECORE should allocate in multiples of pagesize. * MORECORE may allocate more memory than requested. (Or even less, but this will usually result in a malloc failure.) * MORECORE must not allocate memory when given argument zero, but instead return one past the end address of memory from previous nonzero call. * For best performance, consecutive calls to MORECORE with positive arguments should return increasing addresses, indicating that space has been contiguously extended. * Even though consecutive calls to MORECORE need not return contiguous addresses, it must be OK for malloc'ed chunks to span multiple regions in those cases where they do happen to be contiguous. * MORECORE need not handle negative arguments -- it may instead just return MFAIL when given negative arguments. Negative arguments are always multiples of pagesize. MORECORE must not misinterpret negative args as large positive unsigned args. You can suppress all such calls from even occurring by defining MORECORE_CANNOT_TRIM, As an example alternative MORECORE, here is a custom allocator kindly contributed for pre-OSX macOS. It uses virtually but not necessarily physically contiguous non-paged memory (locked in, present and won't get swapped out). You can use it by uncommenting this section, adding some #includes, and setting up the appropriate defines above: #define MORECORE osMoreCore There is also a shutdown routine that should somehow be called for cleanup upon program exit. #define MAX_POOL_ENTRIES 100 #define MINIMUM_MORECORE_SIZE (64 * 1024U) static int next_os_pool; void *our_os_pools[MAX_POOL_ENTRIES]; void *osMoreCore(int size) { void *ptr = 0; static void *sbrk_top = 0; if (size > 0) { if (size < MINIMUM_MORECORE_SIZE) size = MINIMUM_MORECORE_SIZE; if (CurrentExecutionLevel() == kTaskLevel) ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0); if (ptr == 0) { return (void *) MFAIL; } // save ptrs so they can be freed during cleanup our_os_pools[next_os_pool] = ptr; next_os_pool++; ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK); sbrk_top = (char *) ptr + size; return ptr; } else if (size < 0) { // we don't currently support shrink behavior return (void *) MFAIL; } else { return sbrk_top; } } // cleanup any allocated memory pools // called as last thing before shutting down driver void osCleanupMem(void) { void **ptr; for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++) if (*ptr) { PoolDeallocate(*ptr); *ptr = 0; } } */ /* ----------------------------------------------------------------------- History: v2.8.6 Wed Aug 29 06:57:58 2012 Doug Lea * fix bad comparison in dlposix_memalign * don't reuse adjusted asize in sys_alloc * add LOCK_AT_FORK -- thanks to Kirill Artamonov for the suggestion * reduce compiler warnings -- thanks to all who reported/suggested these v2.8.5 Sun May 22 10:26:02 2011 Doug Lea (dl at gee) * Always perform unlink checks unless INSECURE * Add posix_memalign. * Improve realloc to expand in more cases; expose realloc_in_place. Thanks to Peter Buhr for the suggestion. * Add footprint_limit, inspect_all, bulk_free. Thanks to Barry Hayes and others for the suggestions. * Internal refactorings to avoid calls while holding locks * Use non-reentrant locks by default. Thanks to Roland McGrath for the suggestion. * Small fixes to mspace_destroy, reset_on_error. * Various configuration extensions/changes. Thanks to all who contributed these. V2.8.4a Thu Apr 28 14:39:43 2011 (dl at gee.cs.oswego.edu) * Update Creative Commons URL V2.8.4 Wed May 27 09:56:23 2009 Doug Lea (dl at gee) * Use zeros instead of prev foot for is_mmapped * Add mspace_track_large_chunks; thanks to Jean Brouwers * Fix set_inuse in internal_realloc; thanks to Jean Brouwers * Fix insufficient sys_alloc padding when using 16byte alignment * Fix bad error check in mspace_footprint * Adaptations for ptmalloc; thanks to Wolfram Gloger. * Reentrant spin locks; thanks to Earl Chew and others * Win32 improvements; thanks to Niall Douglas and Earl Chew * Add NO_SEGMENT_TRAVERSAL and MAX_RELEASE_CHECK_RATE options * Extension hook in malloc_state * Various small adjustments to reduce warnings on some compilers * Various configuration extensions/changes for more platforms. Thanks to all who contributed these. V2.8.3 Thu Sep 22 11:16:32 2005 Doug Lea (dl at gee) * Add max_footprint functions * Ensure all appropriate literals are size_t * Fix conditional compilation problem for some #define settings * Avoid concatenating segments with the one provided in create_mspace_with_base * Rename some variables to avoid compiler shadowing warnings * Use explicit lock initialization. * Better handling of sbrk interference. * Simplify and fix segment insertion, trimming and mspace_destroy * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x * Thanks especially to Dennis Flanagan for help on these. V2.8.2 Sun Jun 12 16:01:10 2005 Doug Lea (dl at gee) * Fix memalign brace error. V2.8.1 Wed Jun 8 16:11:46 2005 Doug Lea (dl at gee) * Fix improper #endif nesting in C++ * Add explicit casts needed for C++ V2.8.0 Mon May 30 14:09:02 2005 Doug Lea (dl at gee) * Use trees for large bins * Support mspaces * Use segments to unify sbrk-based and mmap-based system allocation, removing need for emulation on most platforms without sbrk. * Default safety checks * Optional footer checks. Thanks to William Robertson for the idea. * Internal code refactoring * Incorporate suggestions and platform-specific changes. Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas, Aaron Bachmann, Emery Berger, and others. * Speed up non-fastbin processing enough to remove fastbins. * Remove useless cfree() to avoid conflicts with other apps. * Remove internal memcpy, memset. Compilers handle builtins better. * Remove some options that no one ever used and rename others. V2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee) * Fix malloc_state bitmap array misdeclaration V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee) * Allow tuning of FIRST_SORTED_BIN_SIZE * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte. * Better detection and support for non-contiguousness of MORECORE. Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger * Bypass most of malloc if no frees. Thanks To Emery Berger. * Fix freeing of old top non-contiguous chunk im sysmalloc. * Raised default trim and map thresholds to 256K. * Fix mmap-related #defines. Thanks to Lubos Lunak. * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield. * Branch-free bin calculation * Default trim and mmap thresholds now 256K. V2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee) * Introduce independent_comalloc and independent_calloc. Thanks to Michael Pachos for motivation and help. * Make optional .h file available * Allow > 2GB requests on 32bit systems. * new WIN32 sbrk, mmap, munmap, lock code from . Thanks also to Andreas Mueller , and Anonymous. * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for helping test this.) * memalign: check alignment arg * realloc: don't try to shift chunks backwards, since this leads to more fragmentation in some programs and doesn't seem to help in any others. * Collect all cases in malloc requiring system memory into sysmalloc * Use mmap as backup to sbrk * Place all internal state in malloc_state * Introduce fastbins (although similar to 2.5.1) * Many minor tunings and cosmetic improvements * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS Thanks to Tony E. Bennett and others. * Include errno.h to support default failure action. V2.6.6 Sun Dec 5 07:42:19 1999 Doug Lea (dl at gee) * return null for negative arguments * Added Several WIN32 cleanups from Martin C. Fong * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h' (e.g. WIN32 platforms) * Cleanup header file inclusion for WIN32 platforms * Cleanup code to avoid Microsoft Visual C++ compiler complaints * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing memory allocation routines * Set 'malloc_getpagesize' for WIN32 platforms (needs more work) * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to usage of 'assert' in non-WIN32 code * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to avoid infinite loop * Always call 'fREe()' rather than 'free()' V2.6.5 Wed Jun 17 15:57:31 1998 Doug Lea (dl at gee) * Fixed ordering problem with boundary-stamping V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee) * Added pvalloc, as recommended by H.J. Liu * Added 64bit pointer support mainly from Wolfram Gloger * Added anonymously donated WIN32 sbrk emulation * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen * malloc_extend_top: fix mask error that caused wastage after foreign sbrks * Add linux mremap support code from HJ Liu V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee) * Integrated most documentation with the code. * Add support for mmap, with help from Wolfram Gloger (Gloger@lrz.uni-muenchen.de). * Use last_remainder in more cases. * Pack bins using idea from colin@nyx10.cs.du.edu * Use ordered bins instead of best-fit threshhold * Eliminate block-local decls to simplify tracing and debugging. * Support another case of realloc via move into top * Fix error occuring when initial sbrk_base not word-aligned. * Rely on page size for units instead of SBRK_UNIT to avoid surprises about sbrk alignment conventions. * Add mallinfo, mallopt. Thanks to Raymond Nijssen (raymond@es.ele.tue.nl) for the suggestion. * Add `pad' argument to malloc_trim and top_pad mallopt parameter. * More precautions for cases where other routines call sbrk, courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de). * Added macros etc., allowing use in linux libc from H.J. Lu (hjl@gnu.ai.mit.edu) * Inverted this history list V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee) * Re-tuned and fixed to behave more nicely with V2.6.0 changes. * Removed all preallocation code since under current scheme the work required to undo bad preallocations exceeds the work saved in good cases for most test programs. * No longer use return list or unconsolidated bins since no scheme using them consistently outperforms those that don't given above changes. * Use best fit for very large chunks to prevent some worst-cases. * Added some support for debugging V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee) * Removed footers when chunks are in use. Thanks to Paul Wilson (wilson@cs.texas.edu) for the suggestion. V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee) * Added malloc_trim, with help from Wolfram Gloger (wmglo@Dent.MED.Uni-Muenchen.DE). V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g) V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g) * realloc: try to expand in both directions * malloc: swap order of clean-bin strategy; * realloc: only conditionally expand backwards * Try not to scavenge used bins * Use bin counts as a guide to preallocation * Occasionally bin return list chunks in first scan * Add a few optimizations from colin@nyx10.cs.du.edu V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g) * faster bin computation & slightly different binning * merged all consolidations to one part of malloc proper (eliminating old malloc_find_space & malloc_clean_bin) * Scan 2 returns chunks (not just 1) * Propagate failure in realloc if malloc returns 0 * Add stuff to allow compilation on non-ANSI compilers from kpv@research.att.com V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu) * removed potential for odd address access in prev_chunk * removed dependency on getpagesize.h * misc cosmetics and a bit more internal documentation * anticosmetics: mangled names in macros to evade debugger strangeness * tested on sparc, hp-700, dec-mips, rs6000 with gcc & native cc (hp, dec only) allowing Detlefs & Zorn comparison study (in SIGPLAN Notices.) Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu) * Based loosely on libg++-1.2X malloc. (It retains some of the overall structure of old version, but most details differ.) */ frama-c-20.0-Calcium/src/plugins/e-acsl/doc/0000777000000000000000000000000013571573400015374 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/doc/Changelog0000666000000000000000000004032013571573400017205 0ustar ############################################################################### # Preliminary notes: # # ------------------ # # Mark "-": change with an impact for users (and possibly developers). # # Mark "o": change with an impact for developers only. # # Mark "+": change for Frama-C-commits audience (not in html version) # # Mark "*": bug fixed. # # Mark "!": change that can break compatibility with existing development. # # '#nnn' : BTS entry #nnn # # '#!nnn' : BTS private entry #nnn # # For compatibility with old change log formats: # # '#?nnn' : OLD-BTS entry #nnn # ############################################################################### # Categories: # E-ACSL monitor generation # runtime C runtime library (and memory model) # e-acsl-gcc launcher e-acsl-gcc.sh # Makefile Makefile # configure configure ############################################################################### ############################ Plugin E-ACSL 20.0 (Calcium) ############################ - E-ACSL [2019/08/28] Support of rational numbers and operations. -! E-ACSL [2019/08/28] Deactivate the unsound support of real numbers (that are not rationals). They were previously unsoundly converted to floating point numbers. ############################## Plugin E-ACSL 19.0 (Potassium) ############################## - E-ACSL [2019/04/29] Support for logic functions and predicates without labels. - runtime [2019/02/26] The behavior of __e_acsl_assert now depends on the runtime value of the global variable __e_acsl_sound_verdict: if 0, it means that its verdict is possibly incorrect. - E-ACSL [2019/02/26] New option -e-acsl-instrument to instrument only a specified set of functions. It may lead to incorrect verdicts. - E-ACSL [2019/02/19] New option -e-acsl-functions to monitor only annotations in a white list of functions. -* runtime [2019/02/04] Fix initialization of the E-ACSL runtime in presence of multiple calls to its initializer (for instance, if the main is a recursive function). -* runtime [2019/01/02] Fix overlap of TLS with other memory segments for large memory spaces. - E-ACSL [2018/11/15] Predicates with empty quantifications directly generate \true or \false instead of nested loops. ########################## Plugin E-ACSL 18.0 (Argon) ########################## -* E-ACSL [2018/11/13] Fix typing bug in quantifications when the guards of the quantifier variable cannot be represented into its type. -* runtime [2018/11/13] Fix bug #!2405 about memory initialization in presence of GCC constructors. -* E-ACSL [2018/10/23] Fix bug #2406 about monitoring of variables with incomplete types. -* E-ACSL [2018/10/04] Fix bug #2386 about incorrect typing when performing pointer subtraction. -* E-ACSL [2018/10/04] Support for \at on purely logic variables. Fix bug #1762 about out-of-scope variables when using \old. -* E-ACSL [2018/10/02] Fix bug #2305 about taking the address of a bitfield. - E-ACSL [2018/09/18] Support for ranges in memory builtins (\valid, \initialized, etc). ############################### Plugin E-ACSL Chlorine-20180501 ############################### - E-ACSL [2018/03/30] Support for let binding. - E-ACSL [2018/02/21] New option -e-acsl-replace-libc-functions to replace a few libc functions by built-ins that efficiently detects when they are incorrectly called. - E-ACSL [2018/02/21] New option -e-acsl-validate-format-strings to detect format string errors in printf-like functions. -* E-ACSL [2018/02/21] Correct support of variable-length array (fix bug #1834). -* runtime [2018/02/16] Function __e_acsl_offset now returns size_t. -* E-ACSL [2018/02/07] Fix incorrect typing in presence of comparison operators (may only be visible when directly analyzing the E-ACSL's generated code with Frama-C without pretty-printing it). -* runtime [2018/01/30] E-ACSL aborted when run on a machine with a low hard limit on the stack size. -* E-ACSL [2018/01/08] Fix a crash when translating a postcondition that should generate a local variable (bts #2339). -* e-acsl-gcc [2017/11/28] Several files may be given to e-acsl-gcc.sh (as specified). -* E-ACSL [2017/11/27] Fix 'segmentation fault' of the generated monitor whenever the main has a precondition depending on the memory model. -* E-ACSL [2017/11/27] Restore behavior of option -e-acsl-valid broken since Phosphorus (included). ############################# Plugin E-ACSL Sulfur-20171101 ############################# -* E-ACSL [2017/10/25] Fix bug #2303 about unnamed formals in annotated functions. - e-acsl-gcc [2017/06/10] Add --free-valid-address option to e-acsl.gcc.sh. - e-acsl-gcc [2017/05/29] Add --fail-with-code option to e-acsl.gcc.sh. - e-acsl-gcc [2017/05/19] Add --temporal option to e-acsl.gcc.sh. - E-ACSL [2017/05/19] New detection of temporal errors in E-ACSL through -e-acsl-temporal-validity (disabled by default). - e-acsl-gcc [2017/03/26] Add --weak-validity option to e-acsl.gcc.sh. - e-acsl-gcc [2017/03/26] Add --rt-verbose option to e-acsl.gcc.sh. - e-acsl-gcc [2017/03/26] Add --keep-going option to e-acsl.gcc.sh allowing a program to continue execution after an assertion failure. - e-acsl-gcc [2017/03/26] Add --stack-size and --heap-size options to e-acsl-gcc.sh allowing to change the default sizes of the respective shadow spaces. ################################# Plugin E-ACSL Phosphorus-20170515 ################################# - runtime [2017/03/29] The (much more efficient) shadow memory model is now used by default. -* runtime [2017/03/28] Fix backtrace when the failed instrumented programs do not require memory model. -! e-acsl-gcc [2017/03/19] Remove --print|-p option from e-acsl-gcc.sh - e-acsl-gcc [2017/03/16] Add --check option to e-acsl-gcc.sh which allows to check the integrity of the generated AST before instrumentation. -! e-acsl-gcc [2017/03/03] Remove precond rte option from e-acsl-gss.sh. -* E-ACSL [2017/03/02] Fix bts #1740 about incorrect monitoring of memory properties when early exiting a block through goto, break or continue. -* E-ACSL [2017/03/01] Correct support of stdin, stdout and stderr in annotations. -* E-ACSL [2017/02/24] Fix crash with casts from non-integral terms to integral types (bts #2284). -* E-ACSL [2017/02/17] Fix bug with goto which points to a labeled statement which must be instrumented. -* E-ACSL [2017/01/23] Fix bug #2252 about pointer arithmetic with negative offsets. -* E-ACSL [2017/01/23] Fix bug with typing of unary and binary operations in a few cases: the generated code might have overflowed. ######################### Plugin E-ACSL 0.8 Silicon ######################### -* e-acsl-gcc [2016/11/07] Added --rte-select feature to e-acsl-gcc.sh. -* e-acsl-gcc [2016/08/02] Added --rt-debug feature to e-acsl-gcc.sh. --enable-optimized-rtl configure option removed -* configure [2016/08/02] Added --enable-optimized-rtl option to configure -* e-acsl-gcc [2016/08/02] Removed --production|-P, --no-stdlib|-N and --debug-log|-D options of e-acsl-gcc.sh. -* E-ACSL [2016/07/21] Enable reporting of stack traces during assertion failures in instrumented programs. -* e-acsl-gcc [2016/07/13] Add an e-acsl-gcc.sh option (--print--models) allowing to print the names of the supported memory models. -* E-ACSL [2016/07/01] Add monitoring support for aligned memory allocation via posix_memalign and aligned alloc functions. -* runtime [2016/07/01] Add local version of GMP library customized for use with E-ACSL runtime library. -* runtime [2016/07/01] Add custom implementation of malloc for use with E-ACSL runtime library (via jemalloc library). - E-ACSL [2016/05/31] New option -e-acsl-builtins which allows to declare pure C functions which can be used in logic function application. - E-ACSL [2016/05/23] Re-implementation of the type system which improves the efficiency of the generated code over integers. -* E-ACSL [2016/05/23] Fix bug #2191 about complicate structs and literate string. -* e-acsl-gcc [2016/05/22] Add an e-acsl-gcc.sh option (--rte|-a) allowing to annotate the source program with memory-safety assertions prior to instrumentation. -* E-ACSL [2016/05/23] Fix bug #1395 about recursive functions. -* Makefile [2016/04/07] Fix 'make install' when executed within Frama-C. -* runtime [2016/03/31] Improve performance of Patricia Trie memory model. -* Makefile [2016/02/25] Fix 'make clean' in tests. -* runtime [2016/01/15] Fix several bugs related to incorrect partial initialization of tracked memory blocks in the E-ACSL memory model library. ########################### Plugin E-ACSL 0.6 Magnesium ########################### -* e-acsl-gcc [2016/01/22] Add an e-acsl-gcc.sh option allowing to skip compilation of original sources. -* Makefile [2016/01/15] Fix installation with custom --prefix. -* runtime [2016/01/05] Fix bug in the memory model that caused the tracked size of heap memory be computed incorrectly. - e-acsl-gcc [2015/12/15] Add a convenience script e-acsl-gcc.sh for small runs of the E-ACSL plugin. -* E-ACSL [2015/12/08] Fix bug #1817 about incorrect initialization of literal strings in global arrays with compound initializers. -* runtime [2015/11/06] Fix a crash occuring when using a recent libc while GMP headers provided by E-ACSL are used. ######################## Plugin E-ACSL 0.5 Sodium ######################## - E-ACSL [2015/06/01] Support of \freeable. Thus illegal calls to free (e.g. double free) are detected. -* E-ACSL [2015/05/28] Fix types of \block_length and \offset. - E-ACSL [2015/05/27] Search .h in the E-ACSL memory model by default (easier to use declarations like __memory_size). - E-ACSL [2015/05/27] Compatibility with new Frama-C Sodium option -frama-c-stdlib. -* E-ACSL [2015/04/28] Fix bug when using fopen. -* E-ACSL [2015/03/06] Fix bugs #1636 and #1837 about scoping of literal strings. o E-ACSL [2014/12/17] Export a minimal API for other plug-ins. -* E-ACSL [2014/10/27] Add a missing cast when translating an integral type used in a floating point/real context in an annotation. ######################## Plugin E-ACSL 0.4.1 Neon ######################## -* E-ACSL [2014/08/05] Fix bug #1838 about memset. -* E-ACSL [2014/08/05] Fix bug #1818 about initialization of globals. -* E-ACSL [2014/08/04] Fix bug #1696 by clarifying the manual. -* E-ACSL [2014/08/04] Fix bug #1831 about argc and argv. -* E-ACSL [2014/07/19] Fix bug #1836 about one-off error when computing the block which a pointer points to. -* E-ACSL [2014/07/08] Fix bug #1695 about using some part of the (Frama-C) libc which prevents linking of the generated C code. -* E-ACSL [2014/05/21] Fix bug #1782 about incorrect URL in the documentation. - E-ACSL [2014/03/27] Remove spurious warnings when using type real numbers. -* E-ACSL [2014/03/26] Fix bug #1692 about wrong localisation of some messages. - E-ACSL [2014/03/26] Remove a spurious warning when an annotated function is first declared, then defined. -* E-ACSL [2014/03/26] Fix bug #1717 about instrumentation of labeled statements. -* E-ACSL [2014/03/25] Fix bug #1716 with annotations in while(1). -* E-ACSL [2014/03/25] Fix bug #1715 about -e-acsl-full-mmodel which generates incorrect code. -* E-ACSL [2014/03/17] Fix bug #1700 about non-ISO empty struct. ############################### Plugin E-ACSL 0.4 Neon_20140301 ############################### -* E-ACSL [2014/01/28] Fix bug #1634 occuring in presence of static addresses. -* E-ACSL [2013/09/26] Fix incorrectness which may occur in presence of aliasing. -* E-ACSL [2013/09/25] Some loop invariants were tagged as "assertions". ################################### Plugin E-ACSL 0.3 Fluorine_20130601 ################################### - E-ACSL [2013/09/18] More precise message for unsupported contract clauses. - E-ACSL [2013/09/18] Use GMP still less often. -* E-ACSL [2013/09/18] Fix bug which may occur with divisions and modulos. - runtime [2013/09/10] Improve ACSL contracts of the E-ACSL C library. - E-ACSL [2013/09/06] Support of loop invariants. -* E-ACSL [2013/09/04] Fix bug when monitored global variables have initializers (bts #1478). -* E-ACSL [2013/09/04] Fix bug when mixing -e-acsl-prepare and running E-ACSL in another project (bts #!1473). -* E-ACSL [2013/06/26] Fix crash with typedef on pointer types. - E-ACSL [2013/06/21] Fewer unknown locations. -* E-ACSL [2013/06/18] Fix bug when generating RTEs on the E-ACSL generated project. -* E-ACSL [2013/05/30] Fix -e-acsl-debug n, with n >= 2. ################################### Plugin E-ACSL 0.2 Fluorine_20130401 ################################### - E-ACSL [2013/01/09] New option -e-acsl-valid. By default, valid annotation are not translated anymore. -* E-ACSL [2013/01/09] Fix bug when translating a postcondition of a function where the init state is the same than the final state (bts #!1300). - E-ACSL [2013/01/09] Support of undefined function with a contract. - E-ACSL [2012/12/20] Support of ghost variables and statements. -* E-ACSL [2012/12/13] Fix bug with complex term left-values. - E-ACSL [2012/11/27] Support of \valid_read. - E-ACSL [2012/11/27] Prevent runtime errors in annotations, except uninitialized variables. - E-ACSL [2012/11/19] Support of floats in annotations. Approximate reals by floats. - E-ACSL [2012/10/25] Support of \valid. - E-ACSL [2012/10/25] Support of \initialized. - E-ACSL [2012/10/25] Support of \block_length. - E-ACSL [2012/10/25] Support of \offset. - E-ACSL [2012/10/25] Support of \base_addr. -* E-ACSL [2012/09/13] Fix bug with very long ACSL integer constants. - E-ACSL [2012/06/27] Continue to convert the other pre/post-conditions even if one fails. - runtime [2012/04/27] Improve ACSL spec of E-ACSL' C library. -* Makefile [2012/01/27] Fix compilation bug when configuring with --enable-external. - E-ACSL [2012/01/25] Nicer generated variable names. -* E-ACSL [2012/01/24] Fix bug with lazy operators in term position. -* E-ACSL [2012/01/24] Fix bug with boolean. -* E-ACSL [2012/01/24] Fix bug with negation and GMP integers. -* E-ACSL [2012/01/24] Fix bug with conditional and GMP integers. - runtime [2012/01/24] Function e_acsl_assert now consistent with standard assert. - E-ACSL [2012/01/23] Support of bitwise complementation. - E-ACSL [2012/01/20] Use GMP arithmetics only when required (i.e. mostly never in practice). ################################### Plugin E-ACSL 0.1 Nitrogen_20111001 ################################### - E-ACSL [2012/01/06] First public release. ################################### frama-c-20.0-Calcium/src/plugins/e-acsl/doc/doxygen/0000777000000000000000000000000013571573400017051 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/doc/doxygen/doxygen.cfg.in0000666000000000000000000013674213571573400021631 0ustar # Doxyfile 1.4.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "E-ACSL Runtime Library" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 0.0.6 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = @abs_top_builddir@/doc/doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, # Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, # Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, # Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, # Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = ../.. # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. INHERIT_DOCS = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. #SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources # only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 0 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is YES. SHOW_DIRECTORIES = NO # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from the # version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the progam writes to standard output # is used as the file version. See the manual for examples. #FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. #WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = @abs_top_srcdir@/doc/doxygen/warn.log #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @abs_top_srcdir@/share/e-acsl \ @abs_top_srcdir@/share/e-acsl/segment_model \ @abs_top_srcdir@/share/e-acsl/bittree_model # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm FILE_PATTERNS = *.h *.c # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = YES # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = NO # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. #USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 4 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = clang:: #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = letter # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_PREDEFINED tags. EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = __attribute__(x)= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = YES # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = NO # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = @HAVE_DOT@ # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = NO # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies #GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = NO # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO frama-c-20.0-Calcium/src/plugins/e-acsl/license/0000777000000000000000000000000013571573400016251 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/license/CEA_LGPL0000666000000000000000000000122613571573400017403 0ustar This file is part of the Frama-C's E-ACSL plug-in. Copyright (C) 2012-2018 CEA (Commissariat à l'énergie atomique et aux énergies alternatives) you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. See the GNU Lesser General Public License version 2.1 for more details (enclosed in the file license/LGPLv2.1). frama-c-20.0-Calcium/src/plugins/e-acsl/license/LGPLv2.10000666000000000000000000005747613571573400017364 0ustar GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS frama-c-20.0-Calcium/src/plugins/e-acsl/license/SPARETIMELABS0000666000000000000000000000275213571573400020175 0ustar Copyright (c) 2004,2012 Kustaa Nyholm / SpareTimeLabs All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Kustaa Nyholm or SpareTimeLabs nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. frama-c-20.0-Calcium/src/plugins/e-acsl/license/headache_config.txt0000666000000000000000000000707113571573400022066 0ustar ################## # Objective Caml # ################## | ".*\.mly" -> frame open:"/*" line:"*" close:"*/" | ".*\.ml[il4]?.*" -> frame open:"(*" line:"*" close:"*)" ############ # C source # ############ | ".*\.h" -> frame open:"/*" line:"*" close:"*/" | ".*\.i" -> frame open:"/*" line:"*" close:"*/" | ".*\.c" -> frame open:"/*" line:"*" close:"*/" | ".*\.ast" -> frame open:"//" line:" " close:" " | ".*\.cc" -> frame open:"/*" line:"*" close:"*/" ####### # Asm # ####### | ".*\.S" -> frame open:"/*" line:"*" close:"*/" ############# # Configure # ############# | ".*config\.h\.in" -> frame open:"/*" line:"*" close:"*/" | ".*configure\..*" -> frame open:"#" line:"#" close:"#" ############ # Makefile # ############ | ".*Make.*" -> frame open:"#" line:"#" close:"#" | ".*\.mk" -> frame open:"#" line:"#" close:"#" ################# # Shell scripts # ################# #note: the skip directive requires a filename starting by ".*" ??? | "autocomplete_frama-c" -> frame open: "#" line: "#" close: "#" | "_frama-c" -> frame open: "#" line: "#" close: "#" | ".*_frama-c" -> skip match:"#compdef.*" | ".*\.sh" -> frame open:"#" line:"#" close:"#" | ".*\.sh" -> skip match:"#!.*" | "frama-c" -> frame open:"#" line:"#" close:"#" | ".*frama-c" -> skip match:"#!.*" | "frama-c-config" -> frame open:"#" line:"#" close:"#" | ".*frama-c-config" -> skip match:"#!.*" | "frama-c-script" -> frame open:"#" line:"#" close:"#" | ".*frama-c-script" -> skip match:"#!.*" | "frama-c-gui" -> frame open:"#" line:"#" close:"#" | ".*frama-c-gui" -> skip match:"#!.*" | "frama-c-gui.byte" -> frame open:"#" line:"#" close:"#" | ".*frama-c-gui.byte" -> skip match:"#!.*" | "frama-c.byte" -> frame open:"#" line:"#" close:"#" | ".*frama-c.byte" -> skip match:"#!.*" | "frama-c.top" -> frame open:"#" line:"#" close:"#" | ".*frama-c.top" -> skip match:"#!.*" ################ # Perl scripts # ################ | ".*\.perl" -> frame open:"#" line:"#" close:"#" | "flamegraph.pl" -> frame open:"#" line:"#" close:"#" | ".*flamegraph.pl" -> skip match:"#!.*" ######################### # MS-Windows Resources # ######################### | ".*\.rc" -> frame open:"#" line:"#" close:"#" ############# # man pages # ############# | ".*\.[1-9]" -> frame open:".\\\"" line: "-" close:"" ############# # Why files # ############# | ".*\.why" -> frame open: "(*" line: "*" close: "*)" | ".*\.why\.src" -> frame open: "(*" line: "*" close: "*)" ############# # Alt-Ergo files # ############# | ".*\.mlw" -> frame open: "(*" line: "*" close: "*)" ############# # Coq files # ############# | ".*\.v" -> frame open: "(*" line: "*" close: "*)" ############# # WP files # ############# | ".*\.driver" -> frame open: "/*" line: "*" close: "*/" ##################### # Why3 driver files # ##################### | ".*\.drv" -> frame open: "(*" line: "*" close: "*)" ######## # HTML # ######## | ".*\.htm.*" -> frame open: "" ####### # DTD # ####### | ".*\.dtd" -> frame open: "" ####### # XSL # ####### | ".*\.xsl" -> frame open: "" ####### # CSS # ####### | ".*\.css" -> frame open: "/*" line: "*" close: "*/" # plug-in's ocamldoc introductions | "intro_.*\.txt" -> frame open: "#*" line: "*" close: "#" ########## # PROLOG # ########## | ".*\.pl" -> frame open: "%" line: "%" close: "%" ############## # Emacs Lisp # ############## | ".*\.el" -> frame open: ";" line: ";" close:";" ############## # Misc files # ############## | "make_release" -> frame open:"#" line:"#" close:"#" | "FAQ" -> frame open:"#" line:"#" close:"#" frama-c-20.0-Calcium/src/plugins/e-acsl/man/0000777000000000000000000000000013571573400015402 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/man/e-acsl-gcc.sh.10000666000000000000000000002161213571573400017775 0ustar .\"------------------------------------------------------------------------ .\" .\" This file is part of the Frama-C's E-ACSL plug-in. .\" .\" Copyright (C) 2012-2019 .\" CEA (Commissariat à l'énergie atomique et aux énergies .\" alternatives) .\" .\" you can redistribute it and/or modify it under the terms of the GNU .\" Lesser General Public License as published by the Free Software .\" Foundation, version 2.1. .\" .\" It is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU Lesser General Public License for more details. .\" .\" See the GNU Lesser General Public License version 2.1 .\" for more details (enclosed in the file licenses/LGPLv2.1). .\" .\"------------------------------------------------------------------------ .TH E-ACSL-GCC.SH 1 2016-02-02 .SH NAME .B e-acsl-gcc.sh \- instrument and compile C files with E-ACSL .SH SYNOPSIS .B e-acsl-gcc.sh [ .I options ] .I files .SH DESCRIPTION .B e-acsl-gcc.sh is a convenience wrapper for instrumentation of C programs using the \fBE-ACSL\fP \fBFrama-C\fP plugin and their subsequent compilation using the GNU compiler collection (\fBGCC\fP). .SH OPTIONS .TP .B -h, --help show a help page. .TP .B -c, --compile compile the generated and the original (supplied) sources. By default no compilation is performed. .TP .B -D, --rt-debug enable runtime debug features, i.e., compile unoptimized executable with assertions and extra checks. .TP .B --no-trace disable stack trace reporting in debug mode .TP .B -V, --rt-verbose output extra messages when executing generated code .TP .B -X, --instrumented-only do not compile original code. Has effect only in the presence of the \fI-c\fP flag. .TP .B -C, --compile-only compile the input files as if they were generated by \fBE-ACSL\fP. .TP .B -d, --debug=\fI pass a value to the \fBFrama-C\fP -\fIdebug\fP option. By default the -\fIdebug\fP flag is unused. .TP .B -v, --verbose=\fI pass a value to the \fBFrama-C\fP -\fIverbose\fP option. By default the -\fIverbose\fP flag is unused. .TP .B --check check integrity of the generated AST (mostly useful for developers). .TP .B -o, --ocode=\fI output the \fBE-ACSL\fP instrumented code to \fI\fP. Defaults to \fIa.out.frama.c\fP. .TP .B -O, --oexec=\fI output the code compiled from the uninstrumented sources to \fI\fP. The executable compiled from the files generated by \fBE-ACSL\fP is appended the \fI.e.acsl\fP suffix. Unless specified, the names of the executables generated from the original and the modified programs are \fIa.out\fP and \fIa.out.e-acsl\fP respectively. .TP .B --oexec-e-acsl=\fI name of the executable file generated from the \fBE-ACSL\fP-instrumented file. Unless specified, the executable is named as inidicated by the \fB--oexec\fP option. .TP .B -f, --frama-c-only run input source files through \fBFrama-C\fP without \fBE-ACSL\fP instrumentations. .TP .B -E, --extra-cpp-args=\fI pass additional arguments to the \fBFrama-C\fP pre-processor. .TP .B -L, --frama-c-stdlib use the \fBFrama-C\fP standard library instead of a system-wide one. .TP .B -M, --full-mmodel maximize memory-related instrumentation. .TP .B --temporal enable checking for temporal memory errors in \\\fBvalid\fP and \\\fBvalid_read\fP predicates. .TP .B --weak-validity enable notion of weak validity. By default expression \fB(p+i)\fP, where \fBp\fP is a pointer and \fBi\fP is an integer offset is deemed valid if both addresses \fBp\fP and \fB(p+i)\fP belong to the same allocated block. With weak validity \fB(p+i)\fP is valid if the memory location which address is given by expression \fB(p+i)\fP is allocated. .TP .B --validate-format-strings enable built-in detection of format-string vulnerabilities. .TP .B --libc-replacements replace some of the unsafe LIBC functions (e.g., strcpy, memcpy) with RTL alternatives that include internal runtime error checking. .TP .B -g, --gmp always use GMP integers instead of C integral types. By default the GMP integers are used on as-needed basis. .TP .B -l, --ld-flags=\fI pass the specified flags to the linker. .TP .B -e, --cpp-flags=\fI pass the specified flags to the pre-processor at compile-time. For instrumentation-time pre-processor flags see \fB--extra-cpp-args\fP option. .TP .B -q, --quiet suppress any output except for errors and warnings. .TP .B -s, --logfile=\fI redirect all output to a given file. .TP .B -F, --frama-c-extra=\fI pass an extra option to a \fBFrama-C\fP invocation. .TP .B -a, --rte=\fI annotate a source program with assertions using a run of an RTE plugin prior to E-ACSL. \fIOPTSTRING\fP is a comma-separated string that specifies the types of generated assertions. Valid arguments are: \fIsigned-overflow\fP \- signed integer overflows. \fIunsigned-overflow\fP \- unsigned integer overflows. \fIsigned-downcast\fP \- signed downcast exceeding destination range. \fIunsigned-downcast\fP \- unsigned downcast exceeding destination range. \fImem\fP \- pointer or array accesses. \fIfloat-to-int\fP \- casts from floating-point to integer. \fIdiv\fP \- division by zero. \fIshift\fP \- left and right shifts by a value out of bounds. \fpointer-call\fP \- annotate functions calls through pointers. \fIall\fP \- all of the above. .TP .B -A, --rte-select=\fI restrict annotations to a given list of functions. \fIOPTSTRING\fP is a comma-separated string comprising function names. .TP .B --stack-size=\fI set the size (in MB) of the stack shadow space .TP .B --heap-size=\fI set the size (in MB) of the heap shadow space .TP .B -k, --keep-going continue execution after an assertion failure .TP .B --free-valid-address trigger failure if a NULL-pointer is used as an input to free function .TP .B --fail-with-code=\fI on assertion failure exit with the given integer code intead of raising an abort signal .TP .B --external-assert=\fI the filename that contains your own implementation of __e_acsl_assert .TP .B -m, --memory-model=\fI memory model (i.e., a runtime library for checking memory related annotations) to be linked against the instrumented file. Valid arguments are: \fIbittree\fP \- memory modelling using a Patricia trie. \fIsegment\fP \- shadow based segment model. By default the Patricia trie memory model is used. .TP .B --print-mmodels print the names of the supported memory models .TP .B -I, --frama-c=\fI the name of the \fBFrama-C\fP executable. By default the first \fIframa-c\fP executable found in the system path is used. .TP .B --e-acsl-share=\fI the name of the \fBE-ACSL\fP share directory. If not provided, it is computed from your setting. .TP .B -G, --gcc=\fI the name of the \fBGCC\fP executable. By default the first \fIgcc\fP executable found in the system path is used. .TP .B --then separate with a \fB-then\fP the first \fBFrama-C\fP options from the actual launch of the \fBE-ACSL\fP plugin. Prepends \fB-e-acsl-prepare\fP to the list of options passed to \fBFrama-C\fP. .TP .B --e-acsl-extra=\fI add \fI\fP to the list of options that will be given to the \fBE-ACSL\fP analysis. Only useful when \fB--then\fP is in use, in which case \fI\fP will be placed after the \fB-then\fP on \fBFrama-C\fP's command-line. Otherwise, equivalent to \fB--frama-c-extra\fP .SH EXIT STATUS .TP .B 0 successful execution .TP .B 1 invalid user input .TP .B \fBFrama-C\fP or \fBGCC\fP error code instrumentation- or compile-time error .SH EXAMPLES .B e-acsl-gcc.sh foo.c instrument foo.c and output the instrumented code to \fIa.out.frama.c\fP. .B e-acsl-gcc.sh -P -c -ogen_foo.c -Ofoo foo.c instrument \fIfoo.c\fP, output the instrumented code to \fIgen_foo.c\fP and compile \fIfoo.c\fP into \fIfoo\fP and \fIgen_foo.c\fP into \fIfoo.e-acsl\fP. The \fB-P\fP option specifies that the instrumentation should omit debug functionality. .B e-acsl-gcc.sh --memory-model=bittree -C gen_foo.c assume \fIgen_foo.c\fP has been instrumented by \fBE-ACSL\fP and compile it into \fIa.out.e-acsl\fP using \fBbittree\fP memory model. .SH SEE ALSO \fBgcc\fP(1), \fBcpp\fP(1), \fBld\fP(1), \fBframa-c\fP(1) frama-c-20.0-Calcium/src/plugins/e-acsl/scripts/0000777000000000000000000000000013571573400016316 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/scripts/e-acsl-gcc.sh0000777000000000000000000006357413571573400020572 0ustar #!/bin/sh -e ########################################################################## # # # This file is part of the Frama-C's E-ACSL plug-in. # # # # Copyright (C) 2012-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Convenience wrapper for small runs of E-ACSL Frama-C plugin # Print a message to STDERR and exit. If the second argument (exit code) # is provided and it is '0' then do nothing. error () { if [ -z "$2" ] || ! [ "$2" = 0 ]; then echo "e-acsl-gcc: fatal error: $1" 1>&2 exit 1; fi } # Check if a given executable name can be found by in the PATH has_tool() { which "$@" >/dev/null 2>&1 && return 0 || return 1 } # Check if a given executable name is indeed an executable or can be found # in the $PATH. Abort the execution if not. check_tool() { { has_tool "$1" || test -e "$1"; } || error "No executable $1 found"; } # Check whether getopt utility supports long options check_getopt() { local out="$(getopt -l "ab:,cd" -o "x:,y" -- --ab 1 -x 1 --cd -y \ | sed "s/[ \']//g")" error "system getopt has no support for long option processing" $? if ! [ "$out" = "--ab1-x1--cd-y--" ]; then error "unexpected output of system getopt" 1 fi } # Check if $1 is positive integer and whether $1 is greater than $2 # Returns $1 is the above holds, otherwise return # '-' if $1 is not a positive integer # '<' if $1 is a positive integer but it is less than $2 # NB: No checking is done for $2 is_number() { local n="$1" local lim="$2" if [ "$n" -eq "$n" ] 2>/dev/null; then if [ "$n" -lt "$lim" ]; then echo '<' else echo $n fi else echo '-' fi } # Portable realpath using pwd realpath() { if [ -e "$1" ]; then if [ -d "$1" ]; then (cd "$1" && pwd) else local name=$(basename "$1") local dir=$(cd $(dirname "$1") && pwd) echo $dir/$name fi return 0 else echo "realpath: no such file or directory: '$1'" 1>&2 return 1 fi } # Split a comma-separated string into a space-separated string, remove # all duplicates and trailing, leading or multiple spaces tokenize() { echo -n "$@" \ | sed -e 's/\s//g' -e 's/,/ /g' -e 's/\s\+/\n/g' \ | sort -u \ | tr '\n' ' ' \ | sed 's/\s*$//' } # Given a token (first argument) and a list (remaining arguments) # evaluate to true if the token is in the list, and to false otherwise has_token() { local token="$1" local opt shift for opt in $@; do [ "$opt" = "$token" ] && return 0 done return 1 } # Filter out a token given by the first argument from the list of tokens # given by the remaining arguments shift_token() { local token="$1" shift for opt in $@; do [ "$opt" = "$token" ] && true || echo $opt done } # Generate option string for RTE plugin based on the value given via --rte # and --rte-select flags rte_options() { # Frama-C assertions local fc_options="signed-overflow unsigned-overflow \ signed-downcast unsigned-downcast" # RTE assertions local rte_options="div float-to-int mem pointer-call shift \ trivial-annotations" # RTE assertions which are negated in all cases except when # explicitly specified # Option supported by RTE but unsupported in E-ACSL, should # always be negated local rte_options_unsupported="" local rte_options_explicit="trivial-annotations" local generated="-rte" # Generated Frama-C options # Clean-up option strings local full_options="$fc_options $rte_options" local input_asserts="$(tokenize "$1")" local fselect="$2" # If there is 'all' keyword found enable all assertions if has_token all $input_asserts; then asserts="$full_options" for opt in $rte_options_explicit; do if ! has_token $opt $input_asserts; then asserts="$(shift_token $opt $asserts)" fi done else asserts="$input_asserts" fi if [ -n "$asserts" ]; then # Check input options local opt for opt in $asserts; do # Check whether a given input option exists, i.e., found in $full_options if ! has_token $opt $full_options; then echo "$opt" return 1 fi done local prefix # Generate assertion options for Frama-C (i.e., -warn-* or -no-warn-*) for opt in $fc_options; do has_token $opt $asserts && prefix="-warn" || prefix="-no-warn" generated="$generated $prefix-$opt" done # Generate assertion options for RTE (i.e., -rte-* or -rte-no-*) for opt in $rte_options $rte_options_unsupported; do has_token $opt $asserts && prefix="-rte" || prefix="-rte-no" generated="$generated $prefix-$opt" done # Pass -rte-select option of RTE if [ -n "$fselect" ]; then fselect="$(echo $fselect | sed 's/\s//g')" generated="$generated -rte-select=$fselect" fi echo $generated -then fi return 0 } # Output -D flags enabling a given E_ACSL memory model mmodel_features() { local model="$1" # Memory model case $model in bittree) flags="-DE_ACSL_BITTREE_MMODEL" ;; segment) flags="-DE_ACSL_SEGMENT_MMODEL" ;; *) error "Memory model '$model' is not available in this distribution" ;; esac # Temporal analysis if [ -n "$OPTION_TEMPORAL" ]; then flags="$flags -DE_ACSL_TEMPORAL" fi # Trigger failures in assertions if [ -n "$OPTION_KEEP_GOING" ]; then flags="$flags -DE_ACSL_NO_ASSERT_FAIL" fi # Enable debug mode if [ -n "$OPTION_RT_DEBUG" ]; then flags="$flags -DE_ACSL_DEBUG" fi # Set stack shadow size if [ -n "$OPTION_STACK_SIZE" ]; then flags="$flags -DE_ACSL_STACK_SIZE=$OPTION_STACK_SIZE" fi # Set heap shadow size if [ -n "$OPTION_HEAP_SIZE" ]; then flags="$flags -DE_ACSL_HEAP_SIZE=$OPTION_HEAP_SIZE" fi # Set runtime verosity flags if [ -n "$OPTION_RT_VERBOSE" ]; then flags="$flags -DE_ACSL_VERBOSE -DE_ACSL_DEBUG_VERBOSE" fi if [ -n "$OPTION_FAIL_WITH_CODE" ]; then flags="$flags -DE_ACSL_FAIL_EXITCODE=$OPTION_FAIL_WITH_CODE " fi if [ -n "$OPTION_WEAK_VALIDITY" ]; then flags="$flags -DE_ACSL_WEAK_VALIDITY" fi if [ -n "$OPTION_FREE_VALID_ADDRESS" ]; then flags="$flags -DE_ACSL_FREE_VALID_ADDRESS" fi if [ -n "$OPTION_EXTERNAL_ASSERT" ]; then flags="$flags -DE_ACSL_EXTERNAL_ASSERT" fi if [ -n "$OPTION_NO_TRACE" ]; then flags="$flags -DE_ACSL_NO_TRACE" fi if [ -n "$OPTION_VALIDATE_FORMAT_STRINGS" ]; then flags="$flags -DE_ACSL_VALIDATE_FORMAT_STRINGS" fi echo $flags } # Check if system getopt supports long option processing check_getopt; # Getopt options LONGOPTIONS="help,compile,compile-only,debug:,ocode:,oexec:,verbose:, frama-c-only,extra-cpp-args:,frama-c-stdlib,full-mmodel,gmp,quiet,logfile:, ld-flags:,cpp-flags:,frama-c-extra:,memory-model:,keep-going, frama-c:,gcc:,e-acsl-share:,instrumented-only,rte:,oexec-e-acsl:, print-mmodels,rt-debug,rte-select:,then,e-acsl-extra:,check,fail-with-code:, temporal,weak-validity,stack-size:,heap-size:,rt-verbose,free-valid-address, external-assert:,validate-format-strings,no-trace,libc-replacements" SHORTOPTIONS="h,c,C,d:,D,o:,O:,v:,f,E:,L,M,l:,e:,g,q,s:,F:,m:,I:,G:,X,a:,T,k,V" # Prefix for an error message due to wrong arguments ERROR="ERROR parsing arguments:" # Variables holding getopt options OPTION_CFLAGS= # Compiler flags OPTION_CPPFLAGS= # Preprocessor flags OPTION_LDFLAGS= # Linker flags OPTION_FRAMAC="frama-c" # Frama-C executable name OPTION_CC="gcc" # GCC executable name OPTION_ECHO="set -x" # Echo executed commands to STDOUT OPTION_INSTRUMENT=1 # Perform E-ACSL instrumentation OPTION_DEBUG= # Set Frama-C debug flag OPTION_VERBOSE= # Set Frama-C verbose flag OPTION_COMPILE= # Compile instrumented program OPTION_RT_DEBUG= # Enable runtime debug features OPTION_RT_VERBOSE= # Set runtime verbosity level OPTION_OUTPUT_CODE="a.out.frama.c" # Name of the translated file OPTION_OUTPUT_EXEC="a.out" # Generated executable name OPTION_EACSL_OUTPUT_EXEC="" # Name of E-ACSL executable OPTION_EACSL="-e-acsl" # Specifies E-ACSL run OPTION_FRAMA_STDLIB="-no-frama-c-stdlib" # Use Frama-C stdlib OPTION_FULL_MMODEL= # Instrument as much as possible OPTION_GMP= # Use GMP integers everywhere OPTION_EACSL_MMODELS="segment" # Memory model used OPTION_EACSL_SHARE= # Custom E-ACSL share directory OPTION_INSTRUMENTED_ONLY= # Do not compile original code OPTION_TEMPORAL= # Enable temporal analysis OPTION_WEAK_VALIDITY= # Use notion of weak validity OPTION_RTE= # Enable assertion generation OPTION_FAIL_WITH_CODE= # Exit status code for failures OPTION_CHECK= # Check AST integrity OPTION_NO_TRACE= # Disable trace in debug mode OPTION_FRAMAC_CPP_EXTRA= # Extra CPP flags for Frama-C OPTION_FREE_VALID_ADDRESS= # Fail if NULL is used as input to free OPTION_VALIDATE_FORMAT_STRINGS= # Runtime format string validation OPTION_LIBC_REPLACEMENTS= # Replace libc functions with RTL definitions OPTION_RTE_SELECT= # Generate assertions for these functions only OPTION_THEN= # Adds -then in front of -e-acsl in FC command. OPTION_STACK_SIZE=32 # Size of a heap shadow space (in MB) OPTION_HEAP_SIZE=128 # Size of a stack shadow space (in MB) OPTION_KEEP_GOING= # Report failing assertions but do not abort execution OPTION_EXTERNAL_ASSERT="" # Use custom definition of assert function SUPPORTED_MMODELS="bittree,segment" # Supported memory model names MIN_STACK=16 # Minimal size of a tracked program stack MIN_HEAP=64 # Minimal size of a tracked program heap manpage() { printf "e-acsl-gcc.sh - instrument and compile C files with E-ACSL Usage: e-acsl-gcc.sh [options] files Options: -h show this help page -c compile instrumented code -C assume that the input files have already been instrumented -l pass additional options to the linker -e pass additional options to the prepreprocessor -E pass additional arguments to the Frama-C preprocessor -F pass additional options to the Frama-C command line -p output the generated code to STDOUT -o output the generated code to [a.out.frama.c] -O output the generated executables to [a.out, a.out.e-acsl] -M maximize memory-related instrumentation -g always use GMP integers instead of C integral types -q suppress any output except for errors and warnings -s redirect all output to -I specify Frama-C executable [frama-c] -G specify C compiler executable [gcc] Notes: This help page shows only basic options. See man (1) e-acsl-gcc.sh for full up-to-date documentation.\n" exit 1 } # Base dir of this script BASEDIR="$(realpath `dirname $0`)" # Directory with contrib libraries of E-ACSL LIBDIR="$BASEDIR/../lib" # Run getopt ARGS=`getopt -n "$ERROR" -l "$LONGOPTIONS" -o "$SHORTOPTIONS" -- "$@"` # Print and exit if getopt fails if [ $? != 0 ]; then exit 1; fi # Set all options in $@ before -- and other after eval set -- "$ARGS" # Switch statements for other options for i in $@ do case "$i" in # Do compile instrumented code --help|-h) shift; manpage; ;; # Do not echo commands to STDOUT # Set log and debug flags to minimal verbosity levels --quiet|-q) shift; OPTION_ECHO= OPTION_DEBUG="-e-acsl-debug 0" OPTION_VERBOSE="-e-acsl-verbose 0" ;; # Redirect all output to a given file --logfile|-s) shift; exec > $1 exec 2> $1 shift; ;; # Enable runtime debug features, i.e., compile unoptimized executable # with assertions, extra checks and other debug features --rt-debug|-D) shift OPTION_RT_DEBUG=1 OPTION_CHECK=1 ;; --rt-verbose|-V) shift; OPTION_RT_VERBOSE=1 ;; # Pass an option to a Frama-C invocation --frama-c-extra|-F) shift; FRAMAC_FLAGS="$FRAMAC_FLAGS $1" shift; ;; # Do compile instrumented code --compile|-c) shift; OPTION_COMPILE=1 ;; # Set Frama-C debug flag --debug|-d) shift; if [ "$1" -eq "$1" ] 2>/dev/null; then OPTION_DEBUG="-e-acsl-debug $1" else error "-d|--debug option requires integer argument" fi shift; ;; # Set Frama-C verbose flag --verbose|-v) shift; if [ "$1" -eq "$1" ] 2>/dev/null; then OPTION_VERBOSE="-e-acsl-verbose $1" else error "-v|--verbose option requires integer argument" fi shift; ;; # Specify the name of the default source file where instrumented # code is to be written --ocode|-o) shift; OPTION_OUTPUT_CODE="$1" shift ;; # Specify the base name of the executable generated from the # instrumented and non-instrumented sources. --oexec|-O) shift; OPTION_OUTPUT_EXEC="$1" shift ;; # Specify the output name of the E-ACSL generated executable --oexec-e-acsl) shift; OPTION_EACSL_OUTPUT_EXEC="$1" shift; ;; # Additional CPP arguments --extra-cpp-args|-E) shift; OPTION_FRAMAC_CPP_EXTRA="$OPTION_FRAMAC_CPP_EXTRA $1" shift; ;; # Additional flags passed to the linker --ld-flags|-l) shift; OPTION_LDFLAGS="$OPTION_LDFLAGS $1" shift; ;; # Additional flags passed to the pre-processor (compile-time) --cpp-flags|-e) shift; OPTION_CPPFLAGS="$OPTION_CPPFLAGS $1" shift; ;; # Do not perform the instrumentation, only compile the provided sources # This option assumes that the source files provided at input have # already been instrumented --compile-only|-C) shift; OPTION_INSTRUMENT= OPTION_COMPILE="1" ;; # Run only Frama-C related instrumentation --frama-c-only|-f) shift; OPTION_EACSL= ;; # Do not compile original source file --instrumented-only|-X) shift; OPTION_INSTRUMENTED_ONLY=1 ;; # Do use Frama-C stdlib, which is the default behaviour of Frama-C --frama-c-stdlib|-L) shift; OPTION_FRAMA_STDLIB="-frama-c-stdlib" ;; # Use as much memory-related instrumentation as possible -M|--full-mmodel) shift; OPTION_FULL_MMODEL="-e-acsl-full-mmodel" ;; # Use GMP everywhere -g|--gmp) shift; OPTION_GMP="-e-acsl-gmp-only" ;; # Supply Frama-C executable name -I|--frama-c) shift; OPTION_FRAMAC="$(which $1)" shift; ;; # Supply GCC executable name -G|--gcc) shift; OPTION_CC="$(which $1)" shift; ;; # Specify EACSL_SHARE directory (where C runtime library lives) by hand # rather than compute it --e-acsl-share) shift; OPTION_EACSL_SHARE="$1" shift; ;; # Runtime assertion generation --rte|-a) shift; OPTION_RTE="$1" shift; ;; # Runtime assertion generation for given functions only --rte-select|-A) shift; OPTION_RTE_SELECT="$1" shift; ;; # Check AST integrity (mostly for developers of E-ACSL) --check) OPTION_CHECK=1 FRAMAC_FLAGS="-check $FRAMAC_FLAGS" shift; ;; # Enable instrumentations of temporal validity analysis -T|--temporal) shift; OPTION_TEMPORAL=-e-acsl-temporal-validity ;; # A memory model (or models) to link against -m|--memory-model) shift; # Convert comma-separated string into white-space separated string OPTION_EACSL_MMODELS="`echo $1 | sed -s 's/,/ /g'`" shift; ;; # Print names of the supported memody models. --print-mmodels) shift; echo $SUPPORTED_MMODELS exit 0 ;; # Separate extra Frama-C flags from e-acsl launch with -then. --then) shift; OPTION_THEN=-then FRAMAC_FLAGS="-e-acsl-prepare $FRAMAC_FLAGS" ;; # Extra E-ACSL options --e-acsl-extra) shift; OPTION_EACSL="$1 $OPTION_EACSL" shift; ;; # Report failing assertions but do not abort execution -k|--keep-going) shift; OPTION_KEEP_GOING=1 ;; # Exit with a given code on assertion failure instead of raising abort --fail-with-code) shift; if [ "$1" -eq "$1" ] 2>/dev/null; then OPTION_FAIL_WITH_CODE="$1" else error "--fail-with-code option requires integer argument" fi shift; ;; # Use notion of weak validity --free-valid-address) shift; OPTION_FREE_VALID_ADDRESS=1 ;; # Use notion of weak validity --weak-validity) shift; OPTION_WEAK_VALIDITY=1 ;; # Set heap shadow size --heap-size) shift; zone_size="$(is_number "$1" $MIN_HEAP)" case $zone_size in '-') error "invalid number: '$1'" ;; '<') error "heap limit less than minimal size [$MIN_HEAP"] ;; *) OPTION_HEAP_SIZE=$zone_size ;; esac; shift; ;; # Set stack shadow size --stack-size) shift; zone_size="$(is_number "$1" $MIN_STACK)" case $zone_size in '-') error "invalid number: '$1'" ;; '<') error "stack limit less than minimal size [$MIN_STACK"] ;; *) OPTION_STACK_SIZE=$zone_size ;; esac; shift; ;; # Custom runtime assert function --external-assert) shift; OPTION_EXTERNAL_ASSERT="$1" shift; ;; # Check output format functions --validate-format-strings) shift; OPTION_VALIDATE_FORMAT_STRINGS="-e-acsl-validate-format-strings" ;; # Replace some unsafe libc functions (such as strcpy, strcat) with # RTL definitions and internal error checking --libc-replacements) shift; OPTION_LIBC_REPLACEMENTS="-e-acsl-replace-libc-functions" ;; # Disable trace in debug mode --no-trace) shift OPTION_NO_TRACE=1 ;; esac done shift; # Bail if no files to translate are given if [ -z "$1" ]; then error "no input files"; fi # Check Frama-C and GCC executable names check_tool "$OPTION_FRAMAC" check_tool "$OPTION_CC" # Frama-C directories FRAMAC="$OPTION_FRAMAC" : ${FRAMAC_SHARE:="`$FRAMAC -print-share-path`"} : ${FRAMAC_PLUGIN:="`$FRAMAC -print-plugin-path`"} # Check if this is a development or an installed version if [ -f "$BASEDIR/../E_ACSL.mli" ]; then # Development version DEVELOPMENT="$(realpath "$BASEDIR/..")" # Check if the project has been built, as if this is a non-installed # version that has not been built Frama-C will fallback to an installed one # for instrumentation but still use local RTL error "Plugin in $DEVELOPMENT not compiled" \ `test -f "$DEVELOPMENT/META.frama-c-e_acsl" -o \ -f "$FRAMAC_PLUGIN/META.frama-c-e_acsl"; echo $?` EACSL_SHARE="$DEVELOPMENT/share/e-acsl" # Add the project directory to FRAMAC_PLUGINS, # otherwise Frama-C uses an installed version if test -f "$DEVELOPMENT/META.frama-c-e_acsl"; then FRAMAC_FLAGS="-add-path=$DEVELOPMENT/top -add-path=$DEVELOPMENT $FRAMAC_FLAGS"; fi else # Installed version. FRAMAC_SHARE should not be used here as Frama-C # and E-ACSL may not be installed to the same location EACSL_SHARE="$BASEDIR/../share/frama-c/e-acsl/" fi # Architecture-dependent flags. Since by default Frama-C uses 32-bit # architecture we need to make sure that same architecture is used for # instrumentation and for compilation. MACHDEPFLAGS="`getconf LONG_BIT`" # Check if getconf gives out the value accepted by Frama-C/GCC echo "$MACHDEPFLAGS" | grep '16\|32\|64' 2>&1 >/dev/null \ || error "$MACHDEPFLAGS-bit architecture not supported" # -machdep option sent to Frama-C MACHDEP="-machdep gcc_x86_$MACHDEPFLAGS" # Macro for correct preprocessing of Frama-C generated code CPPMACHDEP="-D__FC_MACHDEP_X86_$MACHDEPFLAGS" # GCC machine option GCCMACHDEP="-m$MACHDEPFLAGS" # RTE flags RTE_FLAGS="$(rte_options "$OPTION_RTE" "$OPTION_RTE_SELECT")" error "Invalid argument $1 to --rte|-a option" $? # Frama-C and related flags # Additional flags passed to Frama-C preprocessor via `-cpp-extra-args` # -std=c99 -D_DEFAULT_SOURCE: use C99 + default features. This is important # in OSX which by default enables `blocks` unsupported by Frama-C # -D__NO_CTYPE: prevent `isupper` (and similar functions) from being used as # macros, otherwise E-ACSL cannot track them at runtime FRAMAC_CPP_EXTRA="\ -std=c99 -D_DEFAULT_SOURCE -D__NO_CTYPE $CPPMACHDEP\ $OPTION_FRAMAC_CPP_EXTRA" EACSL_MMODEL="$OPTION_EACSL_MMODEL" # Re-set EACSL_SHARE directory is it has been given by the user if [ -n "$OPTION_EACSL_SHARE" ]; then EACSL_SHARE="$OPTION_EACSL_SHARE" fi if [ -n "$OPTION_THEN" ]; then FRAMAC_FLAGS="-e-acsl-share=$EACSL_SHARE $FRAMAC_FLAGS"; fi # Select optimization flags for both instrumented and noon-instrumented code # compilation if [ -n "$OPTION_RT_DEBUG" ]; then OPT_CFLAGS="-g3 -O0 -fno-omit-frame-pointer" else OPT_CFLAGS="-g -O2" fi # Gcc and related flags CC="$OPTION_CC" CFLAGS="$OPTION_CFLAGS -std=c99 $GCCMACHDEP $OPT_CFLAGS -fno-builtin -fno-merge-constants -Wall \ -Wno-long-long \ -Wno-attributes \ -Wno-nonnull \ -Wno-undef \ -Wno-unused \ -Wno-unused-function \ -Wno-unused-result \ -Wno-unused-value \ -Wno-unused-function \ -Wno-unused-variable \ -Wno-unused-but-set-variable \ -Wno-implicit-function-declaration \ -Wno-empty-body" # Disable extra warning for clang if [ "`basename $CC`" = 'clang' ]; then CFLAGS="-Wno-unknown-warning-option \ -Wno-extra-semi \ -Wno-tautological-compare \ -Wno-gnu-empty-struct \ -Wno-incompatible-pointer-types-discards-qualifiers" fi CPPFLAGS="$OPTION_CPPFLAGS" LDFLAGS="$OPTION_LDFLAGS" # Extra Frama-C Flags E-ACSL needs FRAMAC_FLAGS="$FRAMAC_FLAGS -variadic-no-translation" # C, CPP and LD flags for compilation of E-ACSL-generated sources EACSL_CFLAGS="$OPTION_EXTERNAL_ASSERT" EACSL_CPPFLAGS="-I$EACSL_SHARE" EACSL_LDFLAGS="$LIBDIR/libeacsl-dlmalloc.a -lgmp -lm" # Output file names OUTPUT_CODE="$OPTION_OUTPUT_CODE" # E-ACSL instrumented source OUTPUT_EXEC="$OPTION_OUTPUT_EXEC" # Output name of the original executable # Output name of E-ACSL-modified executable if [ -z "$OPTION_EACSL_OUTPUT_EXEC" ]; then EACSL_OUTPUT_EXEC="$OPTION_OUTPUT_EXEC.e-acsl" else EACSL_OUTPUT_EXEC="$OPTION_EACSL_OUTPUT_EXEC" fi # Build E-ACSL plugin argument string if [ -n "$OPTION_EACSL" ]; then EACSL_FLAGS=" $OPTION_THEN $OPTION_EACSL $OPTION_GMP $OPTION_LIBC_REPLACEMENTS $OPTION_FULL_MMODEL $OPTION_TEMPORAL $OPTION_VERBOSE $OPTION_DEBUG $OPTION_VALIDATE_FORMAT_STRINGS -e-acsl-share="$EACSL_SHARE" -then-last" fi # Instrument if [ -n "$OPTION_INSTRUMENT" ]; then ($OPTION_ECHO; \ $FRAMAC \ $FRAMAC_FLAGS \ $MACHDEP \ -cpp-extra-args="$FRAMAC_CPP_EXTRA" \ $OPTION_FRAMA_STDLIB \ "$@" \ $RTE_FLAGS \ $EACSL_FLAGS \ -print -ocode "$OPTION_OUTPUT_CODE"); error "aborted by Frama-C" $?; fi # Compile if [ -n "$OPTION_COMPILE" ]; then # Compile original source code # $OPTION_INSTRUMENT is set -- both, instrumented and original, sources are # available. Do compile the original program unless instructed to not do so # by a user if [ -n "$OPTION_INSTRUMENT" ]; then if [ -z "$OPTION_INSTRUMENTED_ONLY" ]; then ($OPTION_ECHO; $CC $CPPFLAGS $CFLAGS "$@" -o "$OUTPUT_EXEC" $LDFLAGS); error "fail to compile/link un-instrumented code" $?; fi # If $OPTION_INSTRUMENT is unset then the sources are assumed to be already # instrumented, so skip compilation of the original files else OUTPUT_CODE="$@" fi # Compile and link E-ACSL-instrumented file with all models specified for model in $OPTION_EACSL_MMODELS; do # If multiple models are specified then the generated executable # is appended a '-MODEL' suffix, where MODEL is the name of the memory # model used if ! [ "`echo $OPTION_EACSL_MMODELS | wc -w`" = 1 ]; then OUTPUT_EXEC="$EACSL_OUTPUT_EXEC-$model" else OUTPUT_EXEC="$EACSL_OUTPUT_EXEC" fi # RTL sources EACSL_RTL="$EACSL_SHARE/e_acsl_rtl.c" EACSL_MMODEL_FEATURES="$(mmodel_features $model)" ($OPTION_ECHO; $CC \ $EACSL_MMODEL_FEATURES \ $CFLAGS $CPPFLAGS \ $EACSL_CFLAGS $EACSL_CPPFLAGS \ -o "$OUTPUT_EXEC" \ $OUTPUT_CODE \ $EACSL_RTL \ $LDFLAGS \ $EACSL_LDFLAGS) error "fail to compile/link instrumented code" $? done fi exit 0; frama-c-20.0-Calcium/src/plugins/e-acsl/share/0000777000000000000000000000000013571573400015731 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/0000777000000000000000000000000013571573400017075 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/bittree_model/0000777000000000000000000000000013571573400021713 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/bittree_model/e_acsl_bittree.h0000666000000000000000000003561213571573400025037 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_bittree.h * \brief Patricia Trie API Implementation ***************************************************************************/ #ifndef E_ACSL_BITTREE #define E_ACSL_BITTREE #define WORDBITS __WORDSIZE static size_t mask(size_t, size_t); #if WORDBITS == 16 static const size_t Tmasks[] = { 0x0,0x8000,0xc000,0xe000,0xf000,0xf800,0xfc00,0xfe00,0xff00,0xff80,0xffc0, 0xffe0,0xfff0,0xfff8,0xfffc,0xfffe,0xffff}; static const int Teq[] = {0,-1,3,-3,6,-5,7,-7,12,-9,11,-11,14,-13,15,16,-16}; static const int Tneq[] = {0,0,1,-2,2,-4,5,-6,4,-8,9,-10,10,-12,13,-14,-15}; #elif WORDBITS == 32 static const size_t Tmasks[] = { 0x0,0x80000000,0xc0000000,0xe0000000,0xf0000000,0xf8000000,0xfc000000, 0xfe000000,0xff000000,0xff800000,0xffc00000,0xffe00000,0xfff00000,0xfff80000, 0xfffc0000,0xfffe0000,0xffff0000,0xffff8000,0xffffc000,0xffffe000,0xfffff000, 0xfffff800,0xfffffc00,0xfffffe00,0xffffff00,0xffffff80,0xffffffc0,0xffffffe0, 0xfffffff0,0xfffffff8,0xfffffffc,0xfffffffe,0xffffffff}; static const int Teq[] = { 0,-1,3,-3,6,-5,7,-7,12,-9,11,-11,14,-13,15,-15,24,-17,19,-19,22, -21,23,-23,28,-25,27,-27,30,-29,31,32,-32 }; static const int Tneq[] = { 0,0,1,-2,2,-4,5,-6,4,-8,9,-10,10,-12,13,-14,8,-16,17,-18,18,-20,21,-22,20, -24,25,-26,26,-28,29,-30,-31 }; #else /* WORDBITS == 64 */ static const size_t Tmasks[] = { 0x0,0x8000000000000000,0xc000000000000000,0xe000000000000000,0xf000000000000000, 0xf800000000000000,0xfc00000000000000,0xfe00000000000000,0xff00000000000000, 0xff80000000000000,0xffc0000000000000,0xffe0000000000000,0xfff0000000000000, 0xfff8000000000000,0xfffc000000000000,0xfffe000000000000,0xffff000000000000, 0xffff800000000000,0xffffc00000000000,0xffffe00000000000,0xfffff00000000000, 0xfffff80000000000,0xfffffc0000000000,0xfffffe0000000000,0xffffff0000000000, 0xffffff8000000000,0xffffffc000000000,0xffffffe000000000,0xfffffff000000000, 0xfffffff800000000,0xfffffffc00000000,0xfffffffe00000000,0xffffffff00000000, 0xffffffff80000000,0xffffffffc0000000,0xffffffffe0000000,0xfffffffff0000000, 0xfffffffff8000000,0xfffffffffc000000,0xfffffffffe000000,0xffffffffff000000, 0xffffffffff800000,0xffffffffffc00000,0xffffffffffe00000,0xfffffffffff00000, 0xfffffffffff80000,0xfffffffffffc0000,0xfffffffffffe0000,0xffffffffffff0000, 0xffffffffffff8000,0xffffffffffffc000,0xffffffffffffe000,0xfffffffffffff000, 0xfffffffffffff800,0xfffffffffffffc00,0xfffffffffffffe00,0xffffffffffffff00, 0xffffffffffffff80,0xffffffffffffffc0,0xffffffffffffffe0,0xfffffffffffffff0, 0xfffffffffffffff8,0xfffffffffffffffc,0xfffffffffffffffe,0xffffffffffffffff}; static const int Teq[] = { 0,-1,3,-3,6,-5,7,-7,12,-9,11,-11,14,-13,15,-15,24,-17,19,-19,22,-21,23,-23, 28,-25,27,-27,30,-29,31,-31,48,-33,35,-35,38,-37,39,-39,44,-41,43,-43,46, -45,47,-47,56,-49,51,-51,54,-53,55,-55,60,-57,59,-59,62,-61,63,64,-64 }; static const int Tneq[] = { 0,0,1,-2,2,-4,5,-6,4,-8,9,-10,10,-12,13,-14,8,-16,17,-18,18,-20,21,-22,20, -24,25,-26,26,-28,29,-30,16,-32,33,-34,34,-36,37,-38,36,-40,41,-42,42,-44, 45,-46,40,-48,49,-50,50,-52,53,-54,52,-56,57,-58,58,-60,61,-62,-63 }; #endif /*! \brief Root node of the bitree */ static bt_node * bt_root = NULL; /* common prefix of two addresses */ /*@ assigns \nothing; @ ensures \forall int i; 0 <= i <= WORDBITS ==> (Tmasks[i] & a) == (Tmasks[i] & b) ==> \result >= Tmasks[i]; @ ensures (a & \result) == (b & \result); @ ensures \exists int i; 0 <= i <= WORDBITS && \result == Tmasks[i]; @*/ static size_t mask(size_t a, size_t b) { size_t nxor = ~(a ^ b), ret; int i = WORDBITS/2; /* dichotomic search, starting in the middle */ /*cpt_mask++;*/ /* if the current mask matches we use transition from Teq, else from Tneq we stop as soon as i is negative, meaning that we found the mask a negative element i from Teq or Tneq means stop and return Tmasks[-i] */ /*@ loop invariant -WORDBITS <= i <= WORDBITS; @ loop assigns i; @*/ while(i > 0) { //@ assert 0 < i <= WORDBITS; //@ assert \valid(Tmasks+i); if (nxor >= Tmasks[i]) //@ assert \valid(Teq+i); i = Teq[i]; else //@ assert \valid(Tneq+i); i = Tneq[i]; } //@ assert -WORDBITS <= i <= 0; ret = Tmasks[-i]; DASSERT ((a & ret) == (b & ret)); return ret; } /* called from bt_remove */ /* the block we are looking for has to be in the tree */ /*@ requires \valid(ptr); @ requires \valid(bt_root); @ assigns \nothing; @ ensures \valid(\result); @ ensures \result->leaf == ptr; @*/ static bt_node * bt_get_leaf_from_block (bt_block * ptr) { bt_node * curr = bt_root; DASSERT(bt_root != NULL); DASSERT(ptr != NULL); /*@ loop assigns curr; @*/ while(!curr->is_leaf) { // the prefix is consistent DASSERT((curr->addr & curr->mask) == (ptr->ptr & curr->mask)); // two children DASSERT(curr->left != NULL && curr->right != NULL); // the prefix of one child is consistent if((curr->right->addr & curr->right->mask) == (ptr->ptr & curr->right->mask)) curr = curr->right; else if((curr->left->addr & curr->left->mask) == (ptr->ptr & curr->left->mask)) curr = curr->left; else vassert(0, "Unreachable", NULL); } DASSERT(curr->is_leaf); DASSERT(curr->leaf == ptr); return curr; } /* remove the block from the structure */ /* the block we are looking for has to be in the tree */ /*@ requires \valid(ptr); @*/ static void bt_remove (bt_block * ptr) { bt_node * leaf_to_delete = bt_get_leaf_from_block (ptr); DASSERT(leaf_to_delete->leaf == ptr); if(leaf_to_delete->parent == NULL) // the leaf is the root bt_root = NULL; else { bt_node * sibling, * parent; parent = leaf_to_delete->parent; sibling = (leaf_to_delete == parent->left) ? parent->right : parent->left; DASSERT(sibling != NULL); // copying all sibling's fields into the parent's parent->is_leaf = sibling->is_leaf; parent->addr = sibling->addr; parent->mask = sibling->mask; parent->left = sibling->left; parent->right = sibling->right; parent->leaf = sibling->leaf; if(!sibling->is_leaf) { sibling->left->parent = parent; sibling->right->parent = parent; } private_free(sibling); /* necessary ? -- begin */ if(parent->parent != NULL) { parent->parent->mask = mask(parent->parent->left->addr & parent->parent->left->mask, parent->parent->right->addr & parent->parent->right->mask); } /* necessary ? -- end */ } private_free(leaf_to_delete); } /* called from bt_insert */ /* the returned node will be the sibling of the soon to be added node */ /*@ requires \valid(ptr); @ requires \valid(bt_root); @ assigns \nothing; @ ensures \valid(\result); @*/ static bt_node * bt_most_similar_node (bt_block * ptr) { bt_node * curr = bt_root; size_t left_prefix, right_prefix; DASSERT(ptr != NULL); DASSERT(bt_root != NULL); while(1) { if(curr->is_leaf) return curr; DASSERT(curr->left != NULL && curr->right != NULL); left_prefix = mask(curr->left->addr & curr->left->mask, ptr->ptr); right_prefix = mask(curr->right->addr & curr->right->mask, ptr->ptr); if(left_prefix > right_prefix) curr = curr->left; else if(right_prefix > left_prefix) curr = curr->right; else return curr; } } /* add a block in the structure */ /*@ requires \valid(ptr); @*/ static void bt_insert (bt_block * ptr) { bt_node * new_leaf; DASSERT(ptr != NULL); new_leaf = private_malloc(sizeof(bt_node)); DASSERT(new_leaf != NULL); new_leaf->is_leaf = 1; new_leaf->addr = ptr->ptr; new_leaf->mask = Tmasks[WORDBITS]; /* ~0ul */ new_leaf->left = NULL; new_leaf->right = NULL; new_leaf->parent = NULL; new_leaf->leaf = ptr; if(bt_root == NULL) bt_root = new_leaf; else { bt_node * sibling = bt_most_similar_node (ptr), * parent, * aux; DASSERT(sibling != NULL); parent = private_malloc(sizeof(bt_node)); DASSERT(parent != NULL); parent->is_leaf = 0; parent->addr = sibling->addr & new_leaf->addr; /*parent->mask = mask(sibling->addr & sibling->mask, ptr->ptr);*/ parent->leaf = NULL; if(new_leaf->addr <= sibling->addr) { parent->left = new_leaf; parent->right = sibling; } else { parent->left = sibling; parent->right = new_leaf; } new_leaf->parent = parent; if(sibling == bt_root) { parent->parent = NULL; parent->mask = mask(sibling->addr & sibling->mask, ptr->ptr); bt_root = parent; } else { if (sibling->parent->left == sibling) sibling->parent->left = parent; else sibling->parent->right = parent; parent->parent = sibling->parent; /* necessary ? -- begin */ aux = parent; aux->mask = mask(aux->left->addr & aux->left->mask, aux->right->addr & aux->right->mask); /* necessary ? -- end */ } sibling->parent = parent; if(!sibling->is_leaf) sibling->mask = mask(sibling->left->addr & sibling->left->mask, sibling->right->addr & sibling->right->mask); DASSERT((parent->left == sibling && parent->right == new_leaf) || (parent->left == new_leaf && parent->right == sibling)); } } /* return the block B such as: begin addr of B == ptr if such a block exists, return NULL otherwise */ /*@ assigns \nothing; @ ensures \valid(\result); @ ensures \result == \null || \result->ptr == (size_t)ptr; @*/ static bt_block * bt_lookup (void * ptr) { bt_node * tmp = bt_root; DASSERT(bt_root != NULL); DASSERT(ptr != NULL); /*@ loop assigns tmp; @*/ while(!tmp->is_leaf) { // if the ptr we are looking for does not share the prefix of tmp if((tmp->addr & tmp->mask) != ((size_t)ptr & tmp->mask)) return NULL; // two children DASSERT(tmp->left != NULL && tmp->right != NULL); // the prefix of one child is consistent if((tmp->right->addr & tmp->right->mask) == ((size_t)ptr & tmp->right->mask)) tmp = tmp->right; else if((tmp->left->addr & tmp->left->mask) == ((size_t)ptr & tmp->left->mask)) tmp = tmp->left; else return NULL; } if(tmp->leaf->ptr != (size_t)ptr) return NULL; return tmp->leaf; } /* return the block B containing ptr, such as : begin addr of B <= ptr < (begin addr + size) of B or NULL if such a block does not exist */ static bt_block * bt_find (void * ptr) { bt_node * tmp = bt_root; if(bt_root == NULL || ptr == NULL) return NULL; bt_node * other_choice = NULL; while(1) { if(tmp->is_leaf) { /* tmp cannot contain ptr because its begin addr is higher */ if(tmp->addr > (size_t)ptr) return NULL; /* tmp->addr <= ptr, tmp may contain ptr ptr is contained if tmp is large enough (begin addr + size) */ else if((size_t)ptr < tmp->leaf->size + tmp->addr || (tmp->leaf->size == 0 && (size_t)ptr == tmp->leaf->ptr)) return tmp->leaf; /* tmp->addr <= ptr, but tmp->addr is not large enough */ else return NULL; } DASSERT(tmp->left != NULL && tmp->right != NULL); /* the right child has the highest address, so we test it first */ if(((size_t)tmp->right->addr & tmp->right->mask) <= ((size_t)ptr & tmp->right->mask)) { other_choice = tmp->left; tmp = tmp->right; } else if(((size_t)tmp->left->addr & tmp->left->mask) <= ((size_t)ptr & tmp->left->mask)) tmp = tmp->left; else { if(other_choice == NULL) return NULL; else { tmp = other_choice; other_choice = NULL; } } } } /*******************/ /* CLEAN */ /*******************/ /* erase information about initialization of a block */ static void bt_clean_block_init (bt_block * ptr) { if(ptr->init_ptr != NULL) { private_free(ptr->init_ptr); ptr->init_ptr = NULL; } ptr->init_bytes = 0; } /* erase all information about a block */ static void bt_clean_block (bt_block * ptr) { if(ptr) { bt_clean_block_init(ptr); private_free(ptr); } } /* called from bt_clean */ /* recursively erase the content of the structure */ static void bt_clean_rec (bt_node * ptr) { if(ptr == NULL) return; else if(ptr->is_leaf) { bt_clean_block(ptr->leaf); ptr->leaf = NULL; } else { bt_clean_rec(ptr->left); bt_clean_rec(ptr->right); ptr->left = ptr->right = NULL; } private_free(ptr); } /* erase the content of the structure */ static void bt_clean () { bt_clean_rec(bt_root); bt_root = NULL; } /*********************/ /* DEBUG */ /*********************/ #ifdef E_ACSL_DEBUG static void bt_print_block(bt_block * ptr) { if (ptr != NULL) { DLOG("%a; %lu Bytes; %slitteral; [init] : %d ", (char*)ptr->ptr, ptr->size, ptr->is_readonly ? "" : "not ", ptr->init_bytes); if(ptr->init_ptr != NULL) { unsigned i; for(i = 0; i < ptr->size/8; i++) DLOG("%b ", ptr->init_ptr[i]); } DLOG("\n"); } } static void bt_print_node(bt_node * ptr, int depth) { int i; if(ptr == NULL) return; for(i = 0; i < depth; i++) DLOG(" "); if(ptr->is_leaf) bt_print_block(ptr->leaf); else { DLOG("%p -- %p\n", (void*)ptr->mask, (void*)ptr->addr); bt_print_node(ptr->left, depth+1); bt_print_node(ptr->right, depth+1); } } static void bt_print_tree() { DLOG("------------DEBUG\n"); bt_print_node(bt_root, 0); DLOG("-----------------\n"); } #endif #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/bittree_model/e_acsl_bittree_api.h0000666000000000000000000001003013571573400025653 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_bittree_api.h * \brief Patricia Trie API ***************************************************************************/ #ifndef E_ACSL_BITTREE_API #define E_ACSL_BITTREE_API /*! \brief Structure representing an allocated memory block */ struct bt_block { size_t ptr; //!< Base address size_t size; //!< Block length (in bytes) unsigned char * init_ptr; //!< Per-bit initialization size_t init_bytes; //!< Number of initialized bytes within a block int is_readonly; //!< True if a block is marked read-only int is_freeable; //!< True if a block can be de-allocated using `free` #ifdef E_ACSL_DEBUG size_t line; //!< Line number where this block was recorded char* file; //!< File name where this block was recorded #endif #ifdef E_ACSL_TEMPORAL uint32_t timestamp; //!< Temporal timestamp of a block's creation void *temporal_shadow; //!< Temporal shadow for storing referent numbers #endif }; typedef struct bt_block bt_block; /*! \brief Structure representing a bittree node */ struct bt_node { int is_leaf; size_t addr, mask; struct bt_node * left, * right, * parent; bt_block * leaf; }; typedef struct bt_node bt_node; /*! \brief Remove a block from the structure */ static void bt_remove(bt_block *b); /*! \brief Add a block to the structure */ static void bt_insert(bt_block *b); /*! \brief Look-up a memory block by its base address NB: The function assumes that such a block exists. */ static bt_block * bt_lookup(void *ptr); /*! \brief Find a memory block containing a given memory address * * Return block B such that: * `\base_addr(B->ptr) <= ptr < (\base_addr(B->ptr) + size)` * or NULL if such a block does not exist. */ static bt_block * bt_find(void *ptr); /*! \brief Erase the contents of the structure */ static void bt_clean(void); /*! \brief Erase information about a block's initialization */ static void bt_clean_block_init(bt_block *b); /*! \brief Erase all information about a given block */ static void bt_clean_block(bt_block *b); #ifdef E_ACSL_DEBUG /*! \brief Print information about a given block */ static void bt_print_block(bt_block *b); /*! \brief Recursively print the contents of the bittree starting from a * given node */ /*@ assigns \nothing; */ static void bt_print_node(bt_node * ptr, int depth); /*! \brief Print the contents of the entire bittree */ /*@ assigns \nothing; */ static void bt_print(); #endif #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/bittree_model/e_acsl_bittree_mmodel.c0000666000000000000000000005341413571573400026367 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_bittree_mmodel.c * \brief Implementation of E-ACSL public API using a memory model based * on Patricia Trie. See e_acsl.h for details. ***************************************************************************/ # include "e_acsl_bittree_api.h" # include "e_acsl_bittree.h" static inline int allocated(uintptr_t addr, long size, uintptr_t base_ptr); static inline int writeable(uintptr_t addr, long size, uintptr_t base_ptr); /* Public API {{{ */ /* Debug */ #ifdef E_ACSL_DEBUG # define bt_print_block export_alias(bt_print_block) # define bt_print_tree export_alias(bt_print_tree) # define block_info export_alias(block_info) # define store_block_debug export_alias(store_block_debug) # define delete_block_debug export_alias(delete_block_debug) #endif /* }}} */ #define E_ACSL_MMODEL_DESC "patricia trie" /* Assertions in debug mode */ #ifdef E_ACSL_DEBUG /* Assert that memory block [_addr, _addr + _size] is allocated */ # define DVALIDATE_ALLOCATED(_addr, _size, _base) \ vassert(allocated((uintptr_t)_addr, _size, (uintptr_t)_base), \ "Operation on unallocated block [%a + %lu] with base %a\n", \ _addr, _size, _base); /* Assert that memory block [_addr, _addr + _size] is allocated * and can be written to */ # define DVALIDATE_WRITEABLE(_addr, _size, _base) \ vassert(writeable((uintptr_t)_addr, _size, (uintptr_t)_base), \ "Operation on unallocated block [%a + %lu] with base %a\n", \ _addr, _size, _base); #else #define DVALIDATE_ALLOCATED(_ptr, _size, _base) #define DVALIDATE_WRITEABLE(_ptr, _size, _base) #endif /**************************/ /* SUPPORT {{{ */ /**************************/ static const int nbr_bits_to_1[256] = { 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3, 3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4, 3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4, 4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5, 3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6, 6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5, 4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8 }; /* given the size of the memory block (_size) return (or rather evaluate to) * size in bytes required to represent its partial initialization */ #define needed_bytes(_size) \ ((_size % 8) == 0 ? (_size/8) : (_size/8 + 1)) /* }}} */ /**************************/ /* LOCATION (DEBUG MODE) {{{ */ /**************************/ #ifdef E_ACSL_DEBUG /* Notion of current location for debugging purposes */ static struct current_location { int line; char *file; } cloc = { 0, "undefined" }; #define update_cloc(_file, _line) { cloc.line = _line; cloc.file = _file; } #endif /* }}} */ /**************************/ /* INITIALIZATION {{{ */ /**************************/ /* mark the size bytes of ptr as initialized */ void initialize (void * ptr, size_t size) { bt_block * tmp; if(!ptr) return; tmp = bt_find(ptr); if(tmp == NULL) return; /* already fully initialized, do nothing */ if(tmp->init_bytes == tmp->size) return; /* fully uninitialized */ if(tmp->init_bytes == 0) { int nb = needed_bytes(tmp->size); tmp->init_ptr = private_malloc(nb); memset(tmp->init_ptr, 0, nb); } /* partial initialization is kept via a character array accessible via the * tmp->init_ptr. This is such that a N-th bit of tmp->init_ptr tracks * initialization of the N-th byte of the memory block tracked by tmp. * * The following sets individual bits in tmp->init_ptr that track * initialization of `size' bytes starting from `ptr'. */ unsigned i; for(i = 0; i < size; i++) { /* byte-offset within the block, i.e., mark `offset' byte as initialized */ size_t offset = (uintptr_t)ptr - tmp->ptr + i; /* byte offset within tmp->init_ptr, i.e., a byte containing the bit to be toggled */ int byte = offset/8; /* bit-offset within the above byte, i.e., bit to be toggled */ int bit = offset%8; if (!checkbit(bit, tmp->init_ptr[byte])) { /* if bit is unset ... */ setbit(bit, tmp->init_ptr[byte]); /* ... set the bit ... */ tmp->init_bytes++; /* ... and increment initialized bytes count */ } } /* now fully initialized */ if(tmp->init_bytes == tmp->size) { private_free(tmp->init_ptr); tmp->init_ptr = NULL; } } /* mark all bytes of ptr as initialized */ void full_init (void * ptr) { bt_block * tmp; if (ptr == NULL) return; tmp = bt_lookup(ptr); if (tmp == NULL) return; if (tmp->init_ptr != NULL) { private_free(tmp->init_ptr); tmp->init_ptr = NULL; } tmp->init_bytes = tmp->size; } /* mark a block as read-only */ void mark_readonly(void * ptr) { bt_block * tmp; if (ptr == NULL) return; tmp = bt_lookup(ptr); if (tmp == NULL) return; tmp->is_readonly = 1; } /* }}} */ /**************************/ /* PREDICATES {{{ */ /**************************/ int freeable(void* ptr) { bt_block * tmp; if(ptr == NULL) return 0; tmp = bt_lookup(ptr); if(tmp == NULL) return 0; return tmp->is_freeable; } /* return whether the size bytes of ptr are initialized */ int initialized(void * ptr, size_t size) { unsigned i; bt_block * tmp = bt_find(ptr); if(tmp == NULL) return 0; /* fully uninitialized */ if(tmp->init_bytes == 0) return 0; /* fully initialized */ if(tmp->init_bytes == tmp->size) return 1; /* see implementation of function `initialize` for details */ for(i = 0; i < size; i++) { size_t offset = (uintptr_t)ptr - tmp->ptr + i; int byte = offset/8; int bit = offset%8; if (!checkbit(bit, tmp->init_ptr[byte])) return 0; } return 1; } /** \brief \return the length (in bytes) of the block containing ptr */ size_t block_length(void* ptr) { bt_block * blk = bt_find(ptr); /* Hard failure when un-allocated memory is used */ vassert(blk != NULL, "\\block_length of unallocated memory", NULL); return blk->size; } /** \brief check whether a memory block containing address given via `ptr` of length `size` and with base address `ptr_base` belongs to tracked allocation and return corresponding `bt_block` if so. Return NULL otherwise. */ static bt_block* lookup_allocated(void* ptr, size_t size, void *ptr_base) { bt_block * blk = bt_find(ptr); if (blk == NULL) return NULL; #ifndef E_ACSL_WEAK_VALIDITY bt_block * blk_base = bt_find(ptr_base); if (blk_base == NULL || blk->ptr != blk_base->ptr) return NULL; #endif return (blk->size - ((size_t)ptr - blk->ptr) >= size) ? blk : NULL; } /** \brief same as ::lookup_allocated but return either `1` or `0` depending on whether the memory block described by this function's arguments is allocated or not. NOTE: Should have same signature in all models. */ static inline int allocated(uintptr_t addr, long size, uintptr_t base) { return lookup_allocated((void*)addr, size, (void*)base) == NULL ? 0 : 1; } /** \brief Return 1 if a given memory location is read-only and 0 otherwise */ static int readonly (void *ptr) { bt_block * blk = bt_find(ptr); vassert(blk != NULL, "Readonly on unallocated memory", NULL); return blk->is_readonly; } /** \brief same as ::allocated but returns `0` if the memory block described by the arguments cannot be written to */ static inline int writeable(uintptr_t addr, long size, uintptr_t base_ptr) { return allocated(addr, size, base_ptr) && !readonly((void*)addr); } /* return whether the size bytes of ptr are readable/writable */ int valid(void* ptr, size_t size, void *ptr_base, void *addrof_base) { bt_block * blk = lookup_allocated(ptr, size, ptr_base); return blk != NULL && !blk->is_readonly #ifdef E_ACSL_TEMPORAL && temporal_valid(ptr_base, addrof_base) #endif ; } /* return whether the size bytes of ptr are readable */ int valid_read(void* ptr, size_t size, void *ptr_base, void *addrof_base) { bt_block * blk = lookup_allocated(ptr, size, ptr_base); return blk != NULL #ifdef E_ACSL_TEMPORAL && temporal_valid(ptr_base, addrof_base) #endif ; } /* return the base address of the block containing ptr */ void* base_addr(void* ptr) { bt_block * tmp = bt_find(ptr); vassert(tmp != NULL, "\\base_addr of unallocated memory", NULL); return (void*)tmp->ptr; } /* return the offset of `ptr` within its block */ size_t offset(void* ptr) { bt_block * tmp = bt_find(ptr); vassert(tmp != NULL, "\\offset of unallocated memory", NULL); return ((uintptr_t)ptr - tmp->ptr); } /* }}} */ /**************************/ /* ALLOCATION {{{ */ /**************************/ /* STACK ALLOCATION {{{ */ /* store the block of size bytes starting at ptr, the new block is returned. * Warning: the return type is implicitly (bt_block*). */ void* store_block(void *ptr, size_t size) { #ifdef E_ACSL_DEBUG if (ptr == NULL) vabort("Attempt to record NULL block"); else { char *check = (char*)ptr; bt_block *exitsing_block = bt_find(ptr); if (exitsing_block) { vabort("\nRecording %a [%lu] at %s:%d failed." " Overlapping block %a [%lu] found at %s:%d\n", ptr, size, cloc.file, cloc.line, base_addr(check), block_length(check), exitsing_block->file, exitsing_block->line); } check += size - 1; exitsing_block = bt_find(check); if (exitsing_block) { vabort("\nRecording %a [%lu] at %d failed." " Overlapping block %a [%lu] found at %s:%d\n", ptr, size, cloc.file, cloc.line, base_addr(check), block_length(check), exitsing_block->file, exitsing_block->line); } } #endif bt_block *tmp = NULL; if (ptr) { tmp = private_malloc(sizeof(bt_block)); tmp->ptr = (uintptr_t)ptr; tmp->size = size; tmp->init_ptr = NULL; tmp->init_bytes = 0; tmp->is_readonly = 0; tmp->is_freeable = 0; bt_insert(tmp); #ifdef E_ACSL_DEBUG tmp->line = 0; tmp->file = "undefined"; #endif #ifdef E_ACSL_TEMPORAL tmp->timestamp = NEW_TEMPORAL_TIMESTAMP(); tmp->temporal_shadow = (size >= sizeof(void*)) ? private_malloc(size) : NULL; #endif } return tmp; } /* Track a heap block. This is a wrapper for all memory allocation functions that create new bittree nodes. It applies to all memory allocating functions but realloc that modifies nodes rather than create them */ static void *store_freeable_block(void *ptr, size_t size, int init_bytes) { bt_block *blk = NULL; if (ptr) { blk = store_block(ptr, size); blk->is_freeable = 1; update_heap_allocation(size); if (init_bytes) blk->init_bytes = size; } return blk; } /* remove the block starting at ptr */ void delete_block(void *ptr) { #ifdef E_ACSL_DEBUG /* Make sure the recorded block is not NULL */ if (!ptr) vabort("Attempt to delete NULL block"); #endif if (ptr != NULL) { bt_block *tmp = bt_lookup(ptr); #ifdef E_ACSL_DEBUG /* Make sure the removed block exists in the tracked allocation */ if (!tmp) vabort("Attempt to delete untracked block"); #endif if (tmp) { bt_clean_block_init(tmp); #ifdef E_ACSL_TEMPORAL private_free(tmp->temporal_shadow); #endif bt_remove(tmp); private_free(tmp); } } } void* store_block_duplicate(void* ptr, size_t size) { bt_block * tmp = NULL; if (ptr != NULL) { bt_block * tmp = bt_lookup(ptr); if (tmp) { #ifdef E_ACSL_DEBUG /* Make sure that duplicate block, if so is of the same length */ if (tmp->size != size) vabort("Attempt to store duplicate block of different length"); #endif delete_block(ptr); } store_block(ptr, size); } return tmp; } /* }}} */ /* HEAP ALLOCATION {{{ */ /*! \brief Replacement for `malloc` with memory tracking */ void* malloc(size_t size) { if (size == 0) return NULL; void *res = public_malloc(size); store_freeable_block(res, size, 0); return res; } /*! \brief Replacement for `calloc` with memory tracking */ void* calloc(size_t nbr_block, size_t size_block) { /* FIXME: Need an integer overflow check here */ size_t size = nbr_block * size_block; if (size == 0) return NULL; void *res = public_calloc(nbr_block, size_block); store_freeable_block(res, size, 1); return res; } /*! \brief Replacement for `aligned_alloc` with memory tracking */ void *aligned_alloc(size_t alignment, size_t size) { /* Check if: - size and alignment are greater than zero - alignment is a power of 2 - size is a multiple of alignment */ if (!size || !alignment || !powof2(alignment) || (size%alignment)) return NULL; void *res = public_aligned_alloc(alignment, size); store_freeable_block(res, size, 0); return res; } /*! \brief Replacement for `posix_memalign` with memory tracking */ int posix_memalign(void **memptr, size_t alignment, size_t size) { /* Check if: * - size and alignment are greater than zero * - alignment is a power of 2 and a multiple of sizeof(void*) */ if (!size || !alignment || !powof2(alignment) || alignment%sizeof(void*)) return -1; /* Make sure that the first argument to posix memalign is indeed allocated */ DVALIDATE_WRITEABLE(memptr, sizeof(void*), memptr); int res = public_posix_memalign(memptr, alignment, size); if (!res) store_freeable_block(*memptr, size, 0); return res; } /*! \brief Replacement for `realloc` with memory tracking */ void* realloc(void *ptr, size_t size) { bt_block * tmp; void * new_ptr; /* ptr is NULL - malloc */ if(ptr == NULL) return malloc(size); /* size is zero - free */ if(size == 0) { free(ptr); return NULL; } tmp = bt_lookup(ptr); DASSERT(tmp != NULL); new_ptr = public_realloc((void*)tmp->ptr, size); if (new_ptr == NULL) return NULL; /* update the heap allocation size to `size - tmp->size` while keeping constant the number of allocated blocks */ update_heap_allocation(size); update_heap_allocation(-tmp->size); /* realloc changes start address -- re-enter the element */ if (tmp->ptr != (uintptr_t)new_ptr) { bt_remove(tmp); tmp->ptr = (uintptr_t)new_ptr; bt_insert(tmp); } /* uninitialized, do nothing */ if(tmp->init_bytes == 0) ; /* already fully initialized block */ else if (tmp->init_bytes == tmp->size) { /* realloc smaller block */ if (size <= tmp->size) { /* adjust new size, allocation not necessary */ tmp->init_bytes = size; /* realloc larger block */ } else { /* size of tmp->init_ptr in the new block */ int nb = needed_bytes(size); /* number of bits that need to be set in tmp->init_ptr */ int nb_old = needed_bytes(tmp->size); /* allocate memory to store partial initialization */ tmp->init_ptr = private_calloc(1, nb); /* carry out initialization of the old block */ setbits(tmp->size, tmp->init_ptr); } } else { /* contains initialized and uninitialized parts */ int nb = needed_bytes(size); int nb_old = needed_bytes(tmp->size); int i; /* increase container with init data */ tmp->init_ptr = private_realloc(tmp->init_ptr, nb); for (i = nb_old; i < nb; i++) tmp->init_ptr[i] = 0; tmp->init_bytes = 0; for (i = 0; i < nb; i++) tmp->init_bytes += nbr_bits_to_1[tmp->init_ptr[i]]; if (tmp->init_bytes == size || tmp->init_bytes == 0) { private_free(tmp->init_ptr); tmp->init_ptr = NULL; } } tmp->size = size; tmp->is_freeable = 1; return (void*)tmp->ptr; } /*! \brief Replacement for `free` with memory tracking */ void free(void *ptr) { if (ptr == NULL) { /* Fail if instructed to treat NULL input to free as invalid. */ #ifdef E_ACSL_FREE_VALID_ADDRESS vabort("NULL pointer in free\n"); #endif return; } bt_block *res = bt_lookup(ptr); if (!res) { vabort("Not a start of block (%a) in free\n", ptr); } else { update_heap_allocation(-res->size); public_free(ptr); bt_clean_block_init(res); bt_remove(res); } } /* }}} */ /* }}} */ /******************************/ /* PROGRAM INITIALIZATION {{{ */ /******************************/ /* erase the content of the abstract structure */ void memory_clean() { bt_clean(); report_heap_leaks(); } /* POSIX-compliant array of character pointers to the environment strings. */ extern char **environ; /* add `argv` to the memory model */ static void argv_alloca(int *argc_ref, char *** argv_ref) { /* Track a top-level containers */ store_block((void*)argc_ref, sizeof(int)); store_block((void*)argv_ref, sizeof(char**)); int argc = *argc_ref; char** argv = *argv_ref; /* Track argv */ size_t argvlen = (argc + 1)*sizeof(char*); store_block(argv, argvlen); initialize(argv, (argc + 1)*sizeof(char*)); while (*argv) { size_t arglen = strlen(*argv) + 1; store_block(*argv, arglen); initialize(*argv, arglen); argv++; } #ifdef E_ACSL_TEMPORAL /* Fill temporal shadow */ int i; argv = *argv_ref; temporal_store_nblock(argv_ref, *argv_ref); for (i = 0; i < argc; i++) temporal_store_nblock(argv + i, *(argv+i)); #endif while (*environ) { size_t envlen = strlen(*environ) + 1; store_block(*environ, envlen); initialize(*environ, envlen); environ++; } } void memory_init(int *argc_ref, char ***argv_ref, size_t ptr_size) { describe_run(); /* Mspace sizes here are not that relevant as there is no shadowing and mspaces will grow automatically */ make_memory_spaces(MB_SZ(64), MB_SZ(64)); arch_assert(ptr_size); initialize_report_file(argc_ref, argv_ref); /* Tracking program arguments */ if (argc_ref) argv_alloca(argc_ref, argv_ref); /* Tracking safe locations */ collect_safe_locations(); int i; for (i = 0; i < safe_location_counter; i++) { void *addr = (void*)safe_locations[i].address; uintptr_t len = safe_locations[i].length; store_block(addr, len); if (safe_locations[i].is_initialized) initialize(addr, len); } init_infinity_values(); } /* }}} */ /******************************/ /* DEBUG PRINT {{{ */ /******************************/ #ifdef E_ACSL_DEBUG /* Debug version of store block with location tracking. This function is aimed * at manual debugging. While there is no easy way of traking file/line numbers * recorded memory blocks with the use of the following macros placed after the * declaration of __e_acsl_store_block: * * #define __e_acsl_store_block(...) \ * __e_acsl_store_block_debug(__FILE__, __LINE__, __VA_ARGS__) * * The above macros with rewrite of instances of __e_acsl_store_block generating * origin information of tracked memory blocks. */ void* store_block_debug(char *file, int line, void* ptr, size_t size) { update_cloc(file, line); bt_block * res = store_block(ptr, size); if (res) { res->line = line; res->file = file; } return res; } void delete_block_debug(char *file, int line, void* ptr) { update_cloc(file, line); bt_block * tmp = bt_lookup(ptr); if (!tmp) { vabort("Block with base address %a not found in the memory model at %s:%d", ptr, file, line); } delete_block(ptr); } /* Debug print of block information */ void block_info(char *p) { bt_block * res = bt_find(p); if (res) { DLOG(" << %a >> %a [%lu] => %lu \n", p, base_addr(p), offset(p), block_length(p)); } else { DLOG(" << %a >> not allocated\n", p); } } #endif /* }}} */ /* Local operations on temporal timestamps {{{ */ /* Remaining functionality (shared between all models) is located in e_acsl_temporal.h */ #ifdef E_ACSL_TEMPORAL static uint32_t origin_timestamp(void *ptr) { bt_block * blk = bt_find(ptr); return blk != NULL ? blk->timestamp : INVALID_TEMPORAL_TIMESTAMP; } static uintptr_t temporal_referent_shadow(void *ptr) { bt_block *blk = bt_find(ptr); vassert(blk != NULL, "referent timestamp on unallocated memory address %a", (uintptr_t)ptr); vassert(blk->temporal_shadow != NULL, "no temporal shadow of block with base address", (uintptr_t)blk->ptr); return (uintptr_t)blk->temporal_shadow + offset(ptr); } static uint32_t referent_timestamp(void *ptr) { bt_block * blk = bt_find(ptr); if (blk != NULL) return *((uint32_t*)temporal_referent_shadow(ptr)); else return INVALID_TEMPORAL_TIMESTAMP; } static void store_temporal_referent(void *ptr, uint32_t ref) { uint32_t *shadow = (uint32_t*)temporal_referent_shadow(ptr); *shadow = ref; } #endif /* }}} */ frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl.h0000666000000000000000000005453713571573400020512 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl.h * \brief Public C API of E-ACSL Runtime Library * * Functions and variables with non-static linkage used for instrumentation. ***************************************************************************/ #ifndef E_ACSL_MMODEL_H #define E_ACSL_MMODEL_H #include #include #include "e_acsl_alias.h" /************************************************************************/ /*** API Prefixes {{{ ***/ /************************************************************************/ /* Assert */ #define sound_verdict export_alias(sound_verdict) #define assert export_alias(assert) /* Tracking */ #define delete_block export_alias(delete_block) #define store_block export_alias(store_block) #define store_block_duplicate export_alias(store_block_duplicate) /* Predicates */ #define offset export_alias(offset) #define base_addr export_alias(base_addr) #define block_length export_alias(block_length) #define valid_read export_alias(valid_read) #define valid export_alias(valid) #define initialized export_alias(initialized) #define freeable export_alias(freeable) /* Block initialization */ #define mark_readonly export_alias(mark_readonly) #define initialize export_alias(initialize) #define full_init export_alias(full_init) /* Libc drop-in replacements */ #define builtin_strlen export_alias(builtin_strlen) #define builtin_strcpy export_alias(builtin_strcpy) #define builtin_strncpy export_alias(builtin_strncpy) #define builtin_strcat export_alias(builtin_strcat) #define builtin_strncat export_alias(builtin_strncat) #define builtin_strncat export_alias(builtin_strncat) #define builtin_strcmp export_alias(builtin_strcmp) #define builtin_strncmp export_alias(builtin_strncmp) #define builtin_memcpy export_alias(builtin_memcpy) #define builtin_memset export_alias(builtin_memset) #define builtin_memcmp export_alias(builtin_memcmp) #define builtin_memmove export_alias(builtin_memmove) /* stdio.h replacement functions */ #define builtin_printf export_alias(builtin_printf) #define builtin_fprintf export_alias(builtin_fprintf) #define builtin_dprintf export_alias(builtin_dprintf) #define builtin_sprintf export_alias(builtin_sprintf) #define builtin_snprintf export_alias(builtin_snprintf) #define builtin_syslog export_alias(builtin_syslog) /* Memory state initialization */ #define memory_clean export_alias(memory_clean) #define mspaces_init export_alias(mspaces_init) #define memory_init export_alias(memory_init) /* Heap size */ #define heap_allocation_size export_alias(heap_allocation_size) #define get_heap_allocation_size export_alias(get_heap_allocation_size) /* Temporal analysis */ /* No need to encapsulate via ifdef: using these extra definitions does not hurt, otherwise need to pass additional parameters to frama-c */ #define temporal_store_nblock export_alias(temporal_store_nblock) #define temporal_store_nreferent export_alias(temporal_store_nreferent) #define temporal_save_nblock_parameter export_alias(temporal_save_nblock_parameter) #define temporal_save_nreferent_parameter export_alias(temporal_save_nreferent_parameter) #define temporal_save_copy_parameter export_alias(temporal_save_copy_parameter) #define temporal_pull_parameter export_alias(temporal_pull_parameter) #define temporal_save_return export_alias(temporal_save_return) #define temporal_reset_parameters export_alias(temporal_reset_parameters) #define temporal_pull_return export_alias(temporal_pull_return) #define temporal_reset_return export_alias(temporal_reset_return) #define temporal_memcpy export_alias(temporal_memcpy) #define temporal_memset export_alias(temporal_memset) /* Infinity values for floating point types */ #define math_HUGE_VAL export_alias(math_HUGE_VAL) #define math_HUGE_VALF export_alias(math_HUGE_VALF) #define math_INFINITY export_alias(math_INFINITY) #define floating_point_exception export_alias(floating_point_exception) /* }}} */ /************************************************************************/ /*** Assertion {{{ ***/ /************************************************************************/ /*! \brief Runtime assertion verifying a given predicate * \param pred integer code of a predicate * \param kind C string representing a kind an annotation (e.g., "Assertion") * \param fct * \param pred_txt stringified predicate * \param line line of predicate placement in the un-instrumented file */ /*@ requires pred != 0; @ assigns \nothing; */ void assert(int pred, char *kind, char *fct, char *pred_txt, int line) __attribute__((FC_BUILTIN)); /* }}} */ /************************************************************************/ /*** Dynamic memory allocation {{{ ***/ /************************************************************************/ /*! \brief Drop-in replacement for \p malloc with memory tracking enabled. * For further information, see \p malloc(3). */ void * malloc(size_t size) __attribute__((FC_BUILTIN)); /*! \brief Drop-in replacement for \p calloc with memory tracking enabled. * For further information, see \p calloc(3). */ void * calloc(size_t nbr_elt, size_t size_elt) __attribute__((FC_BUILTIN)); /*! \brief Drop-in replacement for \p realloc with memory tracking enabled. * For further information, see realloc(3) */ void * realloc(void * ptr, size_t size) __attribute__((FC_BUILTIN)); /*! \brief Drop-in replacement for \p free with memory tracking enabled. * For further information, see \p free(3). */ void free(void * ptr) __attribute__((FC_BUILTIN)); /*! \brief Allocate `size` bytes of memory such that the allocation's base * address is an even multiple of alignment. * * \param alignment - should be the power of two * \param size - should be the multiple of alignment * \return - pointer to the allocated memory if the restrictions placed on size * and alignment parameters hold. NULL is returned otherwise. */ void *aligned_alloc(size_t alignment, size_t size) __attribute__((FC_BUILTIN)); /*! \brief Allocate size bytes and place the address of the allocated memory in * `*memptr`. The address of the allocated memory will be a multiple of * `alignment`, which must be a power of two and a multiple of `sizeof(void*)`. * If size is 0, then the value placed in *memptr is NULL. */ int posix_memalign(void **memptr, size_t alignment, size_t size) __attribute__((FC_BUILTIN)); /* }}} */ /************************************************************************/ /*** Memory tracking {{{ ***/ /************************************************************************/ /*! \brief Initialize memory locations. */ void mspaces_init() __attribute__((FC_BUILTIN)); /*! \brief Initialize memory tracking state. * Called before any other statement in \p main */ /*@ assigns \nothing; */ void memory_init(int *argc_ref, char ***argv, size_t ptr_size) __attribute__((FC_BUILTIN)); /*! \brief Clean-up memory tracking state before a program's termination. */ /*@ assigns \nothing; */ void memory_clean(void) __attribute__((FC_BUILTIN)); /*! \brief Store stack or globally-allocated memory block * starting at an address given by \p ptr. * * \param ptr base address of the tracked memory block * \param size size of the tracked block in bytes */ /*@ ensures \result == ptr; @ assigns \result \from *(((char*)ptr)+(0..size-1)), ptr, size; */ void * store_block(void * ptr, size_t size) __attribute__((FC_BUILTIN)); /*! \brief Same as `store_block`, but first check * checks whether a block with a base address given by `ptr` exists in the * tracked allocation and remove it before storing a new block. * * \param ptr base address of the tracked memory block * \param size size of the tracked block in bytes */ /*@ ensures \result == ptr; @ assigns \result \from *(((char*)ptr)+(0..size-1)), ptr, size; */ void * store_block_duplicate(void * ptr, size_t size) __attribute__((FC_BUILTIN)); /*! \brief Remove a memory block which base address is \p ptr from tracking. */ /*@ assigns \nothing; */ void delete_block(void * ptr) __attribute__((FC_BUILTIN)); /*! \brief Mark the \p size bytes starting at an address given by \p ptr as * initialized. */ /*@ assigns \nothing; */ void initialize(void * ptr, size_t size) __attribute__((FC_BUILTIN)); /*! \brief Mark all bytes belonging to a memory block which start address is * given by \p ptr as initialized. */ /*@ assigns \nothing; */ void full_init(void * ptr) __attribute__((FC_BUILTIN)); /*! \brief Mark a memory block which start address is given by \p ptr as * read-only. */ /*@ assigns \nothing; */ void mark_readonly(void * ptr) __attribute__((FC_BUILTIN)); /*! \brief A variable holding a byte size of tracked heap allocation. */ extern size_t heap_allocation_size; /*@ predicate diffSize{L1,L2}(integer i) = \at(heap_allocation_size, L1) - \at(heap_allocation_size, L2) == i; */ /*! \brief Return the cumulative size (in bytes) of tracked heap allocation. */ /*@ assigns \result \from heap_allocation_size; */ size_t get_heap_allocation_size(void) __attribute__((FC_BUILTIN)); /* }}} */ /************************************************************************/ /*** E-ACSL predicates {{{ ***/ /************************************************************************/ /*!\brief Implementation of the \b \\freeable predicate of E-ACSL. * * Evaluate to a non-zero value if \p ptr points to a start address of * a block allocated via \p malloc, \p calloc or \p realloc. */ /*@ assigns \result \from ptr; */ int freeable(void * ptr) __attribute__((FC_BUILTIN)); /*! \brief Implementation of the \b \\valid predicate of E-ACSL. * * \\valid evaluates an expression of the form `p+i`, where `p` is a pointer * and `i` is an integer offset and returns `true` if both `p` and `p+i` belong * to the same allocated memory block. * * @param ptr - memory address under question * @param size - the byte-length (starting from `ptr`) of the memory area which * needs to be valid * @param base - if `ptr` can be represented by the expression `p+i` then * `base` refers to `p` * @param addrof_base - if `ptr` can be represented by the expression `p+i` * then `addrof_base` refers to `&p`. For the cases when the address of `p` * cannot be taken (e.g., address of a static array or a constant value * casted to a pointer) then `addrof_base` is zero. * * @returns * `true` if regions `[ptr, ptr + size]` and `[base, base + size]` are * writable and lie within the same memory block and `false` otherwise. * If `weak validity` is used (see macro `E_ACSL_WEAK_VALIDITY`) * then only region `[ptr, ptr + size]` should lie within the same block * and be writable. */ /*@ assigns \result \from *(((char*)ptr)+(0..size-1)), ptr, size; @ behavior valid: @ assumes \valid(((char *)ptr)+(0..size-1)); @ assumes @ size <= 0 || @ ! \separated(((char *)ptr)+(0..size-1), @ ((char *)\base_addr(base))+(0..\block_length(base)-1)); @ ensures \result == 1; @ behavior invalid_ptr: @ assumes ! \valid(((char *)ptr)+(0..size-1)); @ ensures \result == 0; @ behavior separated_ptr: @ assumes size > 0; @ assumes \separated(((char *)ptr)+(0..size-1), @ ((char *)\base_addr(base))+(0..\block_length(base)-1)); @ ensures \result == 0; @ complete behaviors; @ disjoint behaviors; @ */ int valid(void * ptr, size_t size, void *base, void *addrof_base) __attribute__((FC_BUILTIN)); /*! \brief Implementation of the \b \\valid_read predicate of E-ACSL. * * Same as ::valid except the checked memory locations are only * required to be allocated. */ /*@ assigns \result \from *(((char*)ptr)+(0..size-1)), ptr, size; @ behavior valid: @ assumes \valid_read(((char *)ptr)+(0..size-1)); @ assumes @ size <= 0 || @ ! \separated(((char *)ptr)+(0..size-1), @ ((char *)\base_addr(base))+(0..\block_length(base)-1)); @ ensures \result == 1; @ behavior invalid_ptr: @ assumes ! \valid_read(((char *)ptr)+(0..size-1)); @ ensures \result == 0; @ behavior separated_ptr: @ assumes size > 0; @ assumes \separated(((char *)ptr)+(0..size-1), @ ((char *)\base_addr(base))+(0..\block_length(base)-1)); @ ensures \result == 0; @ complete behaviors; @ disjoint behaviors; @ */ int valid_read(void * ptr, size_t size, void *base, void *addrof_base) __attribute__((FC_BUILTIN)); /*! \brief Implementation of the \b \\base_addr predicate of E-ACSL. * Return the base address of the memory block containing an address given * by \p ptr */ /*@ ensures \result == \base_addr(ptr); @ assigns \result \from ptr; */ void * base_addr(void * ptr) __attribute__((FC_BUILTIN)); /*! \brief Implementation of the \b \\block_length predicate of E-ACSL. * Return the byte length of the memory block of the block containing a memory * address given by \p ptr */ /*@ ensures \result == \block_length(ptr); @ assigns \result \from ptr; */ size_t block_length(void * ptr) __attribute__((FC_BUILTIN)); /*! \brief Implementation of the \b \\offset predicate of E-ACSL. * Return the byte offset of address given by \p ptr within a memory blocks * it belongs to */ /*@ ensures \result == \offset(ptr); @ assigns \result \from ptr; */ size_t offset(void * ptr) __attribute__((FC_BUILTIN)); /*! \brief Implementation of the \b \\initialized predicate of E-ACSL. * Return a non-zero value if \p size bytes starting from an address given by * \p ptr are initialized and zero otherwise. */ /*@ assigns \result \from *(((char*)ptr)+(0..size-1)), ptr, size; @ behavior initialized: @ assumes \initialized(((char *)ptr)+(0..size-1)); @ ensures \result == 1; @ behavior uninitialized: @ assumes ! \initialized(((char *)ptr)+(0..size-1)); @ ensures \result == 0; @ complete behaviors; @ disjoint behaviors; @ */ int initialized(void * ptr, size_t size) __attribute__((FC_BUILTIN)); /* }}} */ /************************************************************************/ /*** Drop-in replacement functions {{{ ***/ /************************************************************************/ /*@ assigns dest[0..] \from src[0..]; @ assigns \result \from dest; @ ensures \result == dest; */ char *builtin_strcpy(char *dest, const char *src) __attribute__((FC_BUILTIN)); /*@ assigns dest[0..n - 1] \from src[0..n-1]; @ assigns \result \from dest; @ ensures \result == dest; */ char *builtin_strncpy(char *dest, const char *src, size_t n) __attribute__((FC_BUILTIN)); /*@ assigns \result \from s[0..]; */ size_t builtin_strlen(const char *s) __attribute__((FC_BUILTIN)); /*@ assigns dest[..] \from src[0..]; @ assigns \result \from dest; @ ensures \result == dest; */ char *builtin_strcat(char *dest, const char *src) __attribute__((FC_BUILTIN)); /*@ assigns dest[..] \from src[0..n]; @ assigns \result \from dest; @ ensures \result == dest; */ char *builtin_strncat(char *dest, const char *src, size_t n) __attribute__((FC_BUILTIN)); /*@ assigns \result \from s1[0..], s2[0..]; */ int builtin_strcmp(const char *s1, const char *s2) __attribute__((FC_BUILTIN)); /*@ assigns \result \from s1[0..n-1], s2[0..n-1]; */ int builtin_strncmp(const char *s1, const char *s2, size_t n) __attribute__((FC_BUILTIN)); /*@ assigns ((char*)dest)[0..n-1] \from ((char*)src)[0..n-1]; @ assigns \result \from dest; @ ensures \result == dest; */ void *builtin_memcpy(void *dest, const void *src, size_t n) __attribute__((FC_BUILTIN)); /*@ assigns ((char*)s)[0..n-1] \from c; @ assigns \result \from s; @ ensures \result == s; */ void *builtin_memset(void *s, int c, size_t n) __attribute__((FC_BUILTIN)); /*@ assigns ((char*)dest)[0..n-1] \from ((char*)src)[0..n-1]; @ assigns \result \from dest; @ ensures \result == dest; */ void *builtin_memmove(void *dest, const void *src, size_t n) __attribute__((FC_BUILTIN)); /*@ assigns \result \from ((char*)s1)[0..n-1], ((char*)s2)[0..n-1]; */ int builtin_memcmp(const void *s1, const void *s2, size_t n) __attribute__((FC_BUILTIN)); /* }}} */ /************************************************************************/ /*** Format functions {{{ ***/ /************************************************************************/ /** \brief `printf` with error checking. */ int builtin_printf(const char *fmtdesc, const char *fmt, ...) __attribute__((FC_BUILTIN)); /** \brief `fprintf` with error checking. */ int builtin_fprintf(const char *fmtdesc, FILE *stream, const char *fmt, ...) __attribute__((FC_BUILTIN)); /** \brief `dprintf` with error checking. */ int builtin_dprintf(const char *fmtdesc, int fd, const char *fmt, ...) __attribute__((FC_BUILTIN)); /** \brief `sprintf` with error checking. */ int builtin_sprintf(const char *fmtdesc, char *str, const char *fmt, ...) __attribute__((FC_BUILTIN)); /** \brief `snprintf` with error checking. */ int builtin_snprintf (const char *fmtdesc, char *str, size_t size, const char *fmt, ...) __attribute__((FC_BUILTIN)); /** \brief `syslog` with error checking. */ int builtin_syslog(const char *fmtdesc, int priority, const char *fmt, ...) __attribute__((FC_BUILTIN)); /* }}} */ /************************************************************************/ /*** Machine-dependent infinity values for flating points {{{ ***/ /************************************************************************/ /* Positive infinity for doubles: same as HUGE_VAL */ extern double math_HUGE_VAL __attribute__((FC_BUILTIN)); /* Positive infinity for floats: same as HUGE_VALF */ extern float math_HUGE_VALF __attribute__((FC_BUILTIN)); /* Representation of infinity value for doubles: same as INFINITY */ extern double math_INFINITY __attribute__((FC_BUILTIN)); /* Check for floating point exception at a given execution point */ extern void floating_point_exception(const char *s) __attribute__((FC_BUILTIN)); /* }}} */ /************************************************************************/ /*** Temporal analysis {{{ ***/ /************************************************************************/ /*! \brief Take origin number of a memory block containing `block_addr` and * store it as a referent number of a pointer given by `ptr_addr`. */ /*@ assigns \nothing; */ void temporal_store_nblock(void *ptr_addr, void *block_addr) __attribute__((FC_BUILTIN)); /*! \brief Same as `temporal_store_nblock` but take a referent * number of `block_addr` instead */ /*@ assigns \nothing; */ void temporal_store_nreferent(void *ptr_addr, void *block_addr) __attribute__((FC_BUILTIN)); /*! \brief store struct { .ptr = ptr, .temporal_flow = TReferentN } * in the global parameter array. */ /*@ assigns \nothing; */ void temporal_save_nreferent_parameter(void *ptr, unsigned int param) __attribute__((FC_BUILTIN)); /*! \brief store struct { .ptr = ptr, .temporal_flow = TBlockN } * in the global parameter array. */ /*@ assigns \nothing; */ void temporal_save_nblock_parameter(void *ptr, unsigned int param) __attribute__((FC_BUILTIN)); /*! \brief store struct { .ptr = ptr, .temporal_flow = TCopy } in the global * parameter array. */ /*@ assigns \nothing; */ void temporal_save_copy_parameter(void *ptr, unsigned int param) __attribute__((FC_BUILTIN)); /*! \brief Assign a referent number of `ptr` based on the record in the global * parameter array at index `param`. */ /*@ assigns \nothing; */ void temporal_pull_parameter(void *ptr, unsigned int param, size_t size) __attribute__((FC_BUILTIN)); /*! \brief Nullify global parameter array */ /*@ assigns \nothing; */ void temporal_reset_parameters() __attribute__((FC_BUILTIN)); /*! \brief Save temporal referent number of `ptr` in a placeholder variable * tracking the referent number of a function's return. */ /*@ assigns \nothing; */ void temporal_save_return(void *ptr) __attribute__((FC_BUILTIN)); /*! \brief Take a temporal referent stored in the placeholder tracking return * values as a temporal referent number of `ptr`. */ /*@ assigns \nothing; */ void temporal_pull_return(void *ptr) __attribute__((FC_BUILTIN)); /*! \brief Nullify a placeholder variable tracking the referent number of a * function's return. */ /*@ assigns \nothing; */ void temporal_reset_return() __attribute__((FC_BUILTIN)); /*! \brief Copy temporal shadow data from [src, src + size] to * [dest, dest + size]. Counterpart of the memcpy function */ /*@ assigns \nothing; */ void temporal_memcpy(void *dest, void *src, size_t size) __attribute__((FC_BUILTIN)); /*! \brief Set temporal shadow data from [src, src + size] to 0. * Counterpart of memset the function */ /*@ assigns \nothing; */ void temporal_memset(void *dest, int n, size_t size) __attribute__((FC_BUILTIN)); /* }}} */ #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_alias.h0000666000000000000000000000414213571573400021646 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_alias.h * * \brief Function aliasing ***************************************************************************/ #ifndef E_ACSL_ALIAS_H #define E_ACSL_ALIAS_H /* Concatenation of 2 tokens */ # define preconcat(x,y) x ## y # define concat(x,y) preconcat(x,y) /** Prefix of public functions */ # define export_prefix __e_acsl_ /** Add public prefix to an identifier */ # define export_alias(_n) concat(export_prefix, _n) #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_assert.h0000666000000000000000000001224613571573400022062 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_assert.h * \brief E-ACSL assertions and abort statements. ***************************************************************************/ #ifndef E_ACSL_ASSERT_H #define E_ACSL_ASSERT_H #include #include #include #include "e_acsl_alias.h" #include "e_acsl_printf.h" #include "e_acsl_string.h" #include "e_acsl_trace.h" #define runtime_assert export_alias(assert) #define runtime_sound_verdict export_alias(sound_verdict) /*! \brief Drop-in replacement for abort function */ #define runtime_abort() exec_abort(__LINE__, __FILE__) /*! \brief Output a message to error stream using printf-like format string * and abort the execution. * * This is a wrapper for \p eprintf combined with \p abort */ static void vabort(char *fmt, ...); /*! \brief Assert with printf-like error message support */ #define vassert(expr, fmt, ...) \ vassert_fail(expr, __LINE__, __FILE__, fmt, __VA_ARGS__) /* This ::exec_abort replaces `abort` via a macro at the top of this file */ static void exec_abort(int line, const char *file) { #ifdef E_ACSL_DEBUG #ifndef E_ACSL_NO_TRACE trace(); #endif #endif raise(SIGABRT); } /*! \brief Print a message to stderr and abort the execution */ static void vabort(char *fmt, ...) { va_list va; sigset_t defer_abrt; sigemptyset(&defer_abrt); sigaddset(&defer_abrt,SIGABRT); sigprocmask(SIG_BLOCK,&defer_abrt,NULL); va_start(va,fmt); _format(NULL,_charc_stderr,fmt,va); va_end(va); sigprocmask(SIG_UNBLOCK,&defer_abrt,NULL); runtime_abort(); } static void vassert_fail(int expr, int line, char *file, char *fmt, ...) { if (!expr) { char *afmt = "%s at %s:%d\n"; char buf [strlen(fmt) + strlen(afmt) + PATH_MAX + 11]; rtl_sprintf(buf, afmt, fmt, file, line); fmt = buf; va_list va; va_start(va,fmt); _format(NULL,_charc_stderr,fmt,va); va_end(va); runtime_abort(); } } #ifdef E_ACSL_NO_ASSERT_FAIL # define E_ACSL_ASSERT_NO_FAIL_DESC "pass through" #else # define E_ACSL_ASSERT_NO_FAIL_DESC "abort" #endif /*! E-ACSL instrumentation automatically sets this global to 0 if its verdict becomes unsound. TODO: may only happen for annotations containing memory-related properties. For arithmetic properties, the verdict is always sound (?). */ int runtime_sound_verdict = 1; #ifndef E_ACSL_EXTERNAL_ASSERT /*! \brief Default implementation of E-ACSL runtime assertions */ void runtime_assert(int predicate, char *kind, char *fct, char *pred_txt, int line) { if (runtime_sound_verdict) { if (! predicate) { STDERR("%s failed at line %d (function %s).\n" "The failing predicate is:\n%s.\n", kind, line, fct, pred_txt); #ifndef E_ACSL_NO_ASSERT_FAIL /* Do fail on assertions */ #ifdef E_ACSL_FAIL_EXITCODE /* Fail by exit with a given code */ exit(E_ACSL_FAIL_EXITCODE); #else runtime_abort(); /* Raise abort signal */ #endif #endif } } else STDERR("warning: no sound verdict (guess: %s) at line %d " "(function %s).\nThe considered predicate is:\n%s.\n", predicate ? "ok" : "FAIL", line, fct, pred_txt); } #endif /* Instances of assertions shared accross different memory models */ /*! \brief Abort the execution if the size of the pointer computed during * instrumentation (\p _ptr_sz) does not match the size of the pointer used * by a compiler (\p void*) */ #define arch_assert(_ptr_sz) \ vassert(_ptr_sz == sizeof(void*), \ "Mismatch of instrumentation- and compile-time pointer sizes: " \ "%lu vs %lu\n", _ptr_sz, sizeof(void*)) #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_bits.h0000666000000000000000000001667713571573400021536 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_bits.h * \brief Bit-level manipulations and endianness checks. * * Should be included after e_acsl_printf.h and e_acsl_string.h headers. * * FIXME: Present implementation is built for little-endian byte order. That * is, the implementation assumes that least significant bytes are stored at * the highest memory addresses. In future support for big-endian/PDP byte * orders should also be provided. * * CAUTION: As per above FIXME notice, all examples, macros and functions * assume little-endian byte order. ***************************************************************************/ #ifndef E_ACSL_BITS_H #define E_ACSL_BITS_H #include #include /* Check if we have little-endian and abort the execution otherwise. */ #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ # error "Big-endian byte order is unsupported" #elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__ # error "PDP-endian byte order is unsupported" #elif __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ # error "Unknown byte order" #endif /* Bit-level manipulations {{{ */ /* 64-bit type with all bits set to ones */ #define ONE UINT64_MAX /* 64-bit type with all bits set to zeroes */ #define ZERO (~ONE) /* Set a given bit in a number to '1' (least-significant bit is at index zero). * Example: * int x = 0; // x => 0000 0000 ... * bitset(0, x) // x => 1000 0000 ... * bitset(7, x) // x => 1000 0001 ... */ #define setbit(_bit,_number) (_number |= 1 << _bit) /* Same as bitset but the `_bit` bit is cleared (i.e., set of zero) */ #define clearbit(_bit, _number) (_number &= ~(1 << _bit)) /* Evaluate to a non-zero value if a given bit in a number is set to 1. * int x = 1; // x => 1000 0000 ... * checkbit(0, x) // 1 * checkbit(1, x) // 0 */ #define checkbit(_bit, _number) ((_number >> _bit) & 1) /* Toggle a given bit. * Example: * int x = 4; // x => 0010 0000 ... * togglebit(3, x); // x => 0000 0000 ... * togglebit(3, x); // x => 0010 0000 ... */ #define togglebit(_bit, _number) (_number ^= 1 << _bit) /* Set a given bit to a specified value (e.g., 0 or 1). */ #define changebit(_bit, _val, _number) \ (_number ^= (-_val ^ _number) & (1 << _bit)) /* Set up to 64 bits from left to right to ones. * Example: * int x = 0; // x => 00000000 00000000 ... * setbits64(11, x) // => 11111111 11100000 ... * setbits64(64, x) // => behaviour undefined */ #define setbits64(_bits, _number) (_number |= ~(ONE << _bits)) /* Set up to 64 bits from left to right to ones skiping `_skip` leftmost bits * Example: * int x = 0; // x => 00000000 00000000 ... * setbits64(11, x, 2) // => 00111111 11111000 ... * setbits64(64, x, 2) // => behaviour undefined */ #define setbits64_skip(_bits, _number, _skip) \ (_number |= ~(ONE << _bits) << _skip) /* Evaluate to 1 if up to 64 bits from left to right in `_number` are set: * Example: * int x = 31; // x => 11111000 00000000 ... * checkbits64(4, x) // => 1 * checkbits64(5, x) // => 1 * checkbits64(6, x) // => 0 * checkbits64(64, x) // => behaviour undefined */ #define checkbits64(_bits, _number) \ ((_number & ~(ONE << _bits)) == (~(ONE << _bits))) /* Same as checkbits64 but with skipping `_skip` leftmost bits * Example: * int x = 124; // x => 00111100 00000000 ... * checkbits64_skip(3, x, 2) // => 1 * checkbits64_skip(4, x, 2) // => 1 * checkbits64_skip(5, x, 2) // => 0 * checkbits64_skip(3, x, 1) // => 0 * checkbits64_skip(64, x, 0) // => behaviour undefined */ #define checkbits64_skip(_bits, _number, _skip) \ ((_number & ~(ONE << _bits) << _skip) == (~(ONE << _bits) << _skip)) /* Same as `setbits64' but clear the bits (set to zeroes). */ #define clearbits64(_bits, _number) (_number &= ONE << _bits) /* Set `_bits' bits from right to the left starting from a 64-bit boundary. * Example: * long x = 0; // x => ... 00000000 00000000 00000000 00000000 * setbits64_right(10, x) // x => ... 00000000 00000000 00000011 11111111 */ #define setbits64_right(_bits, _number) (_number |= ~(ONE >> _bits)) /* Same as setbits64_right but clears bits (sets to zeroes) */ #define clearbits64_right(_bits, _number) (_number &= ONE >> _bits) /* Set `size' bits starting from an address given by `ptr' to ones. * Example: * char a[4]; * memset(a,0,4); // => 00000000 00000000 00000000 00000000 * setbits(&a, 11); // => 11111111 11100000 00000000 00000000 */ static inline void setbits(size_t size, void *ptr) { size_t i; int64_t *lp = (int64_t*)ptr; for (i = 0; i < size/64; i++) *(lp+i) |= ONE; setbits64(size%64, *(lp+i)); } /* Same as `setbits' but clear the bits (set to zeroes). */ static inline void clearbits(size_t size, void *ptr) { size_t i; int64_t *lp = (int64_t*)ptr; for (i = 0; i < size/64; i++) *(lp+i) &= ZERO; clearbits64(size%64, *(lp+i)); } /* Same as `setbits' but clear the bits (set to zeroes). */ static inline int checkbits(size_t size, void *ptr) { size_t i; int64_t *lp = (int64_t*)ptr; for (i = 0; i < size/64; i++) { if (*(lp+i) != ONE) return 0; } return checkbits64(size%64, *(lp+i)); } /* Same as `setbits' but set the bits from right to left * Example: * char a[4]; * memset(a,0,4); // => 00000000 00000000 00000000 00000000 * setbits_right(&a, 11); // => 00000000 00000000 00000111 11111111 */ static inline void setbits_right(size_t size, void *ptr) { size_t i = 0; int64_t *lp = (int64_t*)ptr - 1; for (i = 0; i < size/64; i++) *(lp-i) |= ONE; setbits64_right(size%64, *(lp-i)); } /* Same as `setbits_right' but clear the bits (set to zeroes). */ static inline void clearbits_right(size_t size, void *ptr) { size_t i = 0; int64_t *lp = (int64_t*)ptr - 1; for (i = 0; i < size/64; i++) *(lp-i) &= ZERO; clearbits64_right(size%64, *(lp-i)); } /* }}} */ #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_debug.h0000666000000000000000000001023013571573400021636 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_debug.h * \brief Debug-level functions and macros ***************************************************************************/ #ifndef E_ACSL_DEBUG_H #define E_ACSL_DEBUG_H static void vabort(char *fmt, ...); /* Stringification macros {{{ */ #ifndef E_ACSL_STRINGIFICATION #define E_ACSL_STRINGIFICATION # define STRINGIFY(x) #x # define TOSTRING(x) STRINGIFY(x) # define __AT__ __FILE__ ":" TOSTRING(__LINE__) #endif /* }}} */ /** Debugging support {{{ * Enabled in the presence of the E_ACSL_DEBUG macro */ #ifdef E_ACSL_DEBUG #include #include #include #include "e_acsl_printf.h" #include "e_acsl_string.h" #include "e_acsl_trace.h" #include "e_acsl_assert.h" #define E_ACSL_DEBUG_DESC "debug" /* Default location of the E_ACSL log file */ #ifndef E_ACSL_DEBUG_LOG # define E_ACSL_DEBUG_LOG - #endif /*! \brief Name of the debug log file */ static const char *dlog_name = TOSTRING(E_ACSL_DEBUG_LOG); /*! \brief File descriptor associated with the debug log file */ static int dlog_fd = -1; /*! \brief Output a message to a log file */ #define DLOG(...) rtl_dprintf(dlog_fd, __VA_ARGS__) #ifdef E_ACSL_DEBUG_VERBOSE # define DVLOG(...) rtl_dprintf(dlog_fd, __VA_ARGS__) #else # define DVLOG(...) #endif /*! \brief Debug-time assertion based on assert (see e_acsl_assert.h) */ #define DASSERT(_e) vassert(_e,"",NULL) /*! \brief Debug-time assertion based on vassert (see e_acsl_assert.h) */ #define DVASSERT(_expr, _fmt, ...) vassert(_expr, _fmt, __VA_ARGS__) /*! \brief Initialize debug report file: * - open file descriptor * - add program arguments to the log */ static void initialize_report_file(int *argc, char ***argv) { /* Redirect the log to stderr is just set to be defined or set to '-' */ if (!strcmp(dlog_name, "-") || !strcmp(dlog_name, "1")) { dlog_fd = 2; } else { dlog_fd = open(dlog_name, O_WRONLY | O_CREAT | O_TRUNC |O_NONBLOCK | O_NOCTTY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); } if (dlog_fd == -1) vabort("Cannot open file descriptor for %s\n", dlog_name); } static int debug_stop_number = 0; int getchar(void); #define DSTOP { \ DLOG(" << ***** " "Debug Stop %d in '%s' at %s:%d" " ***** >> ", \ ++debug_stop_number, __func__, __FILE__, __LINE__); \ getchar(); \ } #else # define E_ACSL_DEBUG_DESC "production" # define DSTOP # define initialize_report_file(...) # define DLOG(...) # define DVLOG(...) # define DASSERT(_e) # define DVASSERT(_expr, _fmt, ...) #endif #endif // }}} frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_floating_point.h0000666000000000000000000001021613571573400023570 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_floating_point.h * \brief Functionality related to processing of floating point values ***************************************************************************/ #ifndef E_ACSL_FLOATING_POINT_H #define E_ACSL_FLOATING_POINT_H #include "e_acsl.h" #include #include #include /* Below variables hold infinity values for floating points defined in math.h. Most of them are defined as macros that expand to built-in function calls. As such, they cannot be used in E-ACSL specifications directly. To solve the issue this header provides alternative definitions prefixed __e_acsl_math_. For instance, if a call to `pow` overflows it returns `HUGE_VAL`. To make sure that the result of pow does not overflow one can use the following contract: extern double __e_acsl_math_HUGE_VAL; //@ ensures \result != __e_acsl_math_HUGE_VAL; double pow(double, double); */ /** \brief Positive infinity for doubles: same as HUGE_VAL */ double math_HUGE_VAL = 0.0; /** \brief Positive infinity for floats: same as HUGE_VALF */ float math_HUGE_VALF = 0.0; /** \brief Representation of infinity value for doubles: same as INFINITY */ double math_INFINITY = 0.0; /* FIXME: An additional variable that should be added to this list is long double math_HUGE_VALL; That represents positive infinity for long doubles. However, long doubles are unsupported Value plug-in analysis who start throwing errors once test suite is ran. */ static void init_infinity_values() { /* Initialize E-ACSL infinity values */ math_HUGE_VAL = HUGE_VAL; math_HUGE_VALF = HUGE_VALF; math_INFINITY = INFINITY; /* Clear exceptions buffers */ feclearexcept(FE_ALL_EXCEPT); } void floating_point_exception(const char *exp) { int except = fetestexcept(FE_ALL_EXCEPT); char *resp = NULL; if (except) { if (fetestexcept(FE_DIVBYZERO)) resp = "Division by zero"; else if (fetestexcept(FE_INEXACT)) resp = "Rounded result of an operation is not equal to the infinite precision result"; else if (fetestexcept(FE_INVALID)) resp = "Result of a floating-point operation is not well-defined"; else if (fetestexcept(FE_OVERFLOW)) resp = "Floating-point overflow"; else if (fetestexcept(FE_UNDERFLOW)) resp = "Floating-point underflow"; } if (resp) { rtl_printf("Execution of the statement `%s` leads to a floating point exception\n", exp); rtl_printf("Exception: %s\n", resp); } feclearexcept(FE_ALL_EXCEPT); } #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_format.h0000666000000000000000000011313613571573400022051 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_format.h * \brief Validating format strings with respect to arguments and their types * * Detection of format string vulnerabilities and other violations * related to improper use of formats in printf-like functions are addressed * as follows. Each call to a format function `f` (e.g. printf) * is replaced by a call to an analysis function `f'`. The signature of `f'` is * similar to that of `f'` except it has an additional argument. This argument * is a literal string where each character describes the type of a variadic * argument in the original call to `f`. * * For instance: * `printf("Str=%s, Int=%d ", str, num);` * is replaced by * `__e_acsl_builtin_printf("sd", "Str=%s, Int=%d", str, num);` * Note the first argument "sd". It indicates that `printf` was invoked * with two variadic arguments of types `char*` (specified via 's') * and `int` (`d`). Such single-character types are further called * |abbreviated| types. See ::abbr2str function for details. * * Execution of __e_acsl_builtin_printf checks that * - format string is a NUL-terminated C string * - all directives in the format string are well-formed (as per C99 standard) * - each formatting directive has a corresponding variadic argument. * Excessive arguments (for which there are no directives) are allowed * but otherwise ignored. * - the types of variadic arguments provided via a call match the types * expected by the respective format directives. This check includes checking * for signedness. For instance, * __e_acsl_builtin_printf("d", "%u", n); * will abort because the formatting directive expects its argument to be an * unsigned integer, whereas `n` is a signed integer (indicated by "d") in * the first argument to `__e_acsl_builtin_printf`. Bear in mind though that * char, short, and float types are the subjects to default promotions. That * is, `char` and `short` are promoted to `int` and `float` is promoted to * double. Frama-C enforces such promotions by adding explicit casts. * - variadic arguments corresponding to `%s` conversion specifiers describe * valid C strings (NUL-terminated arrays of characters belonging to program * allocation) * - variadic arguments corresponding to `%n` conversion specifiers describe * valid integer pointers * Execution of __e_acsl_builtin_dprintf additionally checks that * - the file descriptor designated for writing is open * Execution of __e_acsl_builtin_fprintf additionally checks that * - the stream designated for writing is valid * Execution of __e_acsl_builtin_sprintf and __e_acsl_builtin_sprintf * additionally check that * - memory buffers designated for writing are allocated, writable and provide * sufficient space for storing the results ***************************************************************************/ #ifndef E_ACSL_FORMAT_H #define E_ACSL_FORMAT_H #ifndef E_ACSL_VALIDATE_FORMAT_STRINGS # define E_ACSL_FORMAT_VALIDITY_DESC "disabled" #else # define E_ACSL_FORMAT_VALIDITY_DESC "enabled" #include #include #include #include #include #include #define FMT_ERROR "Format error: " #define INT_ERROR "Internal error: " /* Check whether a value is unsigned or not. Watch out for integer promotions. */ #define UNSIGNED(n) (n >= 0 && ~n >= 0) /* Abbreviated types {{{ */ /* An abbreviated type is a character that describes a given primitive or a pointer type that may be expected by a formatting directive of a function such as `printf`. Correspondance between abbreviated and actual types is given via macro ::abbreviated_types. Abbreviated type values are ad-hoc with one convention: any given signed integral (or integral pointer type) is given by a lower-case letter, whereas an unsigned type is given by the same but upper-case letter. For instance, 'd' corresponds to `int` and 'D' corresponds to `unsigned int`. Similarly, 'i' corresponds to `int*` and `I` corresponds to `unsigned int*`. NOTE: Abbreviated types are generated by the instrumentation engine (see definition of the `get_printf_argument_str` in `functions.ml`). It is therefore important that the types as they are used by this file and by `functions.ml` are in sync */ #define abbreviated_types \ typedef_abbreviated('c', char, IChar) \ typedef_abbreviated('C', unsigned char, IUChar) \ typedef_abbreviated('h', short, IShort) \ typedef_abbreviated('H', unsigned short, IUShort) \ typedef_abbreviated('d', int, IInt) \ typedef_abbreviated('D', unsigned int, IUInt) \ typedef_abbreviated('l', long, ILong) \ typedef_abbreviated('L', unsigned long, IULong) \ typedef_abbreviated('r', long long, ILongLong) \ typedef_abbreviated('R', unsigned long long, IULongLong) \ typedef_abbreviated('f', float, FFloat) \ typedef_abbreviated('e', double, FDouble) \ typedef_abbreviated('E', long double, FLongDouble) \ typedef_abbreviated('s', char*, PChar) \ typedef_abbreviated('S', unsigned char*, PUChar) \ typedef_abbreviated('q', short*, PShort) \ typedef_abbreviated('Q', unsigned short*, PUShort) \ typedef_abbreviated('i', int*, PInt) \ typedef_abbreviated('I', unsigned int*, PUInt) \ typedef_abbreviated('z', long*, PLong) \ typedef_abbreviated('Z', unsigned long*, PULong) \ typedef_abbreviated('w', long long*, PLongLong) \ typedef_abbreviated('W', unsigned long long*, PULongLong) \ typedef_abbreviated('p', void*, PVoid) /* Define abbreviated types as enum so they can be referred to as aliases */ typedef enum { #define typedef_abbreviated(type,val,alias) alias = type, abbreviated_types #undef typedef_abbreviated } abbrev_t; /** \brief Return a C-string representation of a given abbreviated type */ static const char* abbr2str(abbrev_t type) { switch(type) { #define typedef_abbreviated(type,val,alias) case type: return #val; abbreviated_types #undef typedef_abbreviated } return '\0'; } /** \brief Return a byte-size of a given abbreviated type */ static int abbr2size(abbrev_t type) { switch(type) { #define typedef_abbreviated(type,val,alias) case type: return sizeof(val); abbreviated_types #undef typedef_abbreviated } return 0; } /** \brief Some format directives expect typedefs rather than actual types. For instance '%jd' expects `intmax_t`. The instrumentation engine "unrolls" types, that is, we will be given an actual primitive type instead (say long). While we cannot reason about typedefs dynamically we infer types corresponding to typedefs based on their size and sign. The following function establishes some loose correspondence between sizes and signs and abbreviated integer types corresponding to these sizes and signs */ static abbrev_t size2abbri(int size, int sign) { if (size <= sizeof(int)) return sign ? IInt : IUInt; else if (size == sizeof(long int)) return sign ? ILong : IULong; else if (size == sizeof(long long int)) return sign ? ILongLong : IULongLong; vabort(INT_ERROR "integral type corresponding to size %d unknown", size); return '\0'; } /** \brief Same as above but for floating point types */ static abbrev_t size2abbrf(int size) { if (size == sizeof(float)) return FFloat; else if (size == sizeof(double)) return FDouble; else if (size == sizeof(long double)) return FLongDouble; vabort (INT_ERROR "floating point type corresponding to size %d unknown", size); return '\0'; } /* Partial mapping of primitive abreviated type to a pointer of the same type, e.g., 'd' (int) -> 's' (*) */ static char abbr2ptr(char c) { switch(c) { case IInt: return PInt; case IUInt: return PUInt; case ILong: return PLong; case IULong: return PULong; case ILongLong: return PLongLong; case IULongLong: return PULongLong; default: vabort(INT_ERROR "Unexpected abbreviated type %c\n", c); } return '\0'; } /* }}} */ /* Format string character classes {{{ */ /* Length modifier characters */ const char *length_chars = "hljztL"; /* Flag characters */ const char *flag_chars = "-+ #0'"; /* Conversion specifier characters. '%' is treated specially */ const char *specifier_chars = "diouxXfFeEgGaAcspn"; /* Period character */ const char *period_chars = "."; /* Character map allowing to quickly identify the class of a character (above). Do not use this map directly, use one of the below macros. */ char format_char_map[256]; #define specifier_id 's' #define length_id 'l' #define flag_id 'f' #define period_id 'r' #define is_specifier_char(_c) (format_char_map[(int)_c] == specifier_id) #define is_flag_char(_c) (format_char_map[(int)_c] == flag_id) #define is_length_char(_c) (format_char_map[(int)_c] == length_id) #define is_period_char(_c) (format_char_map[(int)_c] == period_id) static void set_format_char_map() { int init_idx = (int)'\0'; int init_char = 'i'; if (format_char_map[init_idx] != init_char) { memset(format_char_map, 0, 256); int i; for(i = 0; i < strlen(specifier_chars); i++) format_char_map[(int)specifier_chars[i]] = specifier_id; for(i = 0; i < strlen(length_chars); i++) format_char_map[(int)length_chars[i]] = length_id; for(i = 0; i < strlen(flag_chars); i++) format_char_map[(int)flag_chars[i]] = flag_id; for(i = 0; i < strlen(period_chars); i++) format_char_map[(int)period_chars[i]] = period_id; format_char_map[init_idx] = init_char; } } /* }}} */ /* Argument specification {{{ */ typedef struct { char *format; /* Pointer to the complete format string */ char directive [16]; /* Directive string */ struct arg { int index; /* Argument index this specification refers to */ _Bool expl; /* Set to 1 if the argument has been numbered via $ */ } arg; struct flags { /* Flags */ _Bool specified; /* set if any of the below flags are set */ _Bool minus; /* - */ _Bool plus; /* + */ _Bool space; /* ' ' */ _Bool hash; /* # */ _Bool zero; /* 0 */ _Bool apostroph; /* ' */ } flags; int field_width; /* Field width, INT_MIN if not given, -1 if '*' */ int precision; /* Format precision, INT_MIN if not given, -1 if '*' */ struct length { /* Length Modifier */ int bytes; /* Number of bytes inferred from length modifier */ char mod; /* Modifier character (such as 'l' or 'h') */ _Bool extended; /* Set if modifier is repeated (e.g., 'll' or 'hh') */ } length; char specifier; /* Format specifier character */ } format_directive; /* }}} */ /* Debug print {{{ */ static void print_directive(format_directive *dir, char *rem) { rtl_printf(" Format: %s\n", dir->format); rtl_printf(" Specifier: %c\n", dir->specifier); rtl_printf(" Arg: \n"); rtl_printf(" Index: $d\n", dir->arg.index); rtl_printf(" Explicit: $d\n", dir->arg.expl); rtl_printf(" Precision: .%d\n", dir->precision); rtl_printf(" Field width: %d\n", dir->field_width); rtl_printf(" Length: \n"); rtl_printf(" Modifier: %c \n", dir->length.mod); rtl_printf(" Bytes: %d \n", dir->length.bytes); rtl_printf(" Extended: %d \n", dir->length.extended); rtl_printf(" Flags: <"); #define print_format_flag(_f,_s) if (dir->flags._f) rtl_printf(_s) print_format_flag(plus,"+"); print_format_flag(minus, "-"); print_format_flag(space, " "); print_format_flag(hash,"#"); print_format_flag(apostroph,"'"); print_format_flag(zero,"0"); #undef print_format_flag rtl_printf(">\n"); rtl_printf(" Remainder: \"%s\"\n", rem); } /* }}} */ /* Fetch format argument number {{{ Most format specifications allow for argument numbers to be specified. E.g., printf("%2$*1$d", width, num); The above will first print num and then width. Even though this is not in C99, we allow that as many `printf` implementations have this extension. The feature comes from the Single UNIX Specification. This function assumes that *(fmt-1) is '%' */ static char *fetch_format_argno(char *fmt, format_directive *dir, format_directive *prev, int ind) { int argno = 0; char *ret = fmt; /* If *fmt is a non-zero digit then it is either an argument number (if followed by '$') or a field width. */ if (*ret != '0') { while (isdigit(*ret)) { argno = argno * 10 + (*ret - '0'); ret++; } } else { /* The only case when zero is found is when it is a flag, just return. */ return ret; } /* If '$' is found then it was an argument number, save its index */ if (*ret == '$') { dir->arg.index = argno - 1; dir->arg.expl = 1; ret++; /* ... do nothing otherwise but revert back to original format as some characters may have been fetched */ } else { dir->arg.index = ind; dir->arg.expl = 0; ret = fmt; } /* make sure that numbered and non-numbered directives are not mixed */ if (prev && prev->arg.expl != dir->arg.expl) vabort(FMT_ERROR "\"%s\": numbered and non-numbered directives cannot be mixed\n", dir->format); return ret; } /* }}} */ /* Fetch format flags {{{ */ /* Assumes that `fmt` is a format string returned by ::fetch_format_argno */ static char *fetch_format_flags(char *fmt, format_directive *dir) { #define set_format_flag(_f) \ if (!dir->flags._f) \ { dir->flags._f = 1; } \ else \ { vabort(FMT_ERROR "flag %s has already been set", #_f); } while (is_flag_char(*fmt)) { dir->flags.specified = 1; switch(*fmt) { case '#': set_format_flag(hash); break; case '-': set_format_flag(minus); break; case '+': set_format_flag(plus); break; case ' ': set_format_flag(space); break; case '\'': set_format_flag(apostroph); break; case '0': set_format_flag(zero); break; } fmt++; } #undef set_format_flag return fmt; } /* }}} */ /* Fetch field width {{{ */ /* Assumes that `fmt` is a format string returned by ::fetch_format_flags */ static char *fetch_format_field_width(char *fmt, format_directive *dir) { dir->field_width = INT_MIN; /* Field width is either an asterisk ... */ int len = 0; if (*fmt == '*') { dir->field_width = -1; fmt++; } else { /* ... or a positive decimal integer */ if (isdigit(*fmt)) { if (*fmt == '0') { vabort(FMT_ERROR "field width in format cannot start with zero (%s)\n", dir->format); }; while (isdigit(*fmt)) { len = len * 10 + (*fmt - '0'); fmt++; } dir->field_width = len; } } return fmt; } /* }}} */ /* Fetch format precision {{{ */ /* Assumes that `fmt` is a format string returned by ::fetch_format_field_width */ static char *fetch_format_precision(char *fmt, format_directive *dir) { /* Precision is given in the form '.' optionally followed by either '*' or a digit string. */ dir->precision = INT_MIN; if (is_period_char(*fmt)) { fmt++; if (*fmt == '*') { dir->precision = -1; fmt++; } else { dir->precision = 0; while (isdigit(*fmt)) { dir->precision = dir->precision * 10 + (*fmt - '0'); fmt++; } } } return fmt; } /* }}} */ /* Fetch format length modifier and format specifier {{{ */ /* Assumes that `fmt` is a format string returned by ::fetch_format_precision */ static char *fetch_format_length(char *fmt, format_directive *dir) { dir->length.bytes = 0; dir->length.mod = '\0'; dir->length.extended = 0; switch(*fmt) { case 'h': { if (*(fmt + 1) == 'h') { dir->length.bytes = sizeof(char); dir->length.extended = 1; fmt++; } else dir->length.bytes = sizeof(short); break; } case 'l': { if (*(fmt + 1) == 'l') { dir->length.bytes = sizeof(long long); dir->length.extended = 1; fmt++; } else dir->length.bytes = sizeof(long); break; } case 'j': dir->length.bytes = sizeof(intmax_t); break; case 'z': dir->length.bytes = sizeof(size_t); break; case 't': dir->length.bytes = sizeof(ptrdiff_t); break; case 'L': dir->length.bytes = sizeof(long double); break; } /* Make sure that the length modifier (if there is one) belongs to a right character class */ vassert(dir->length.mod == '\0' || is_length_char(dir->length.mod), INT_ERROR "Bad length modifier: '%c'\n", dir->length.mod); if (dir->length.bytes) { dir->length.mod = *fmt; fmt++; } /* fmt now points to a conversion specifier, get it. */ dir->specifier = *fmt; /* Detect specifying length modifiers twice. This is purely for better error reporting. Even if there is no this check, the one below detects it, but with a different error message. */ if ( dir->specifier ) /* which has been fetched at the start matches the one we have arrived at */ if (!is_specifier_char(dir->specifier)) { if (dir->specifier == '%') vabort(FMT_ERROR "in directive '%s'." "the complete conversion specification for '%%' is '%%%%'\n", dir->format); else vabort(FMT_ERROR "illegal format specifier '%c'\n", dir->specifier); } return ++fmt; } /* }}} */ /* Parse format string {{{ */ /* Parse format string into a NULL-terminated array of directives */ static format_directive ** get_format_directives(char *fmt) { /* Count the number of formatting directives in the format string by counting '%' occurrences. Yes, it may give more specifications than needed (e.g., "%%") but allocating space for a few extra pointers does not hurt considering that in order to do that properly we need to parse format string twice. */ int sz = charcount(fmt, '%') + 1; format_directive ** directives = private_malloc(sizeof(format_directive *) * sz); char *format_string = fmt; /* Nullify all pointers to make sure there is no leftover rubbish */ int i; for (i = 0; i < sz; i++) directives[i] = NULL; /* Set character map so format characters can be recognized */ set_format_char_map(); char ch; i = 0; format_directive *prev = NULL; while ((ch = *fmt++) != '\0') { if (ch == '%') { /* Do not take into account '%%' specification. It has no corresponding arguments, flags or any other attributes. */ if (*fmt == '%') { ++fmt; continue; } /* Allocate space for `format_directive` to hold the result of parsing */ format_directive *dir = private_calloc(1, sizeof(format_directive)); /* Parse format string */ dir->format = format_string; char *fmt_start = fmt - 1; fmt = fetch_format_argno(fmt, dir, prev, i); fmt = fetch_format_flags(fmt, dir); fmt = fetch_format_field_width(fmt, dir); fmt = fetch_format_precision(fmt, dir); fmt = fetch_format_length(fmt, dir); /* Save format string in the dir struct. Rather ugly but the RTL printf library has no `snprintf` or extensions allowing to print `N` characters. */ ptrdiff_t fmt_len = fmt - fmt_start; ptrdiff_t max_len = sizeof(dir->directive) - 1; int len = max_len > fmt_len ? fmt_len : max_len; strncpy(dir->directive, fmt_start, len); dir->directive[len+1] = '\0'; /* Save the directive */ directives[i++] = dir; prev = dir; /* print_directive(dir, fmt); */ } } return directives; } static void release_directives(const char *fmt, format_directive ** dirs) { int formats = charcount(fmt, '%') + 1; int i; for (i = 0; i < formats; i++) private_free(dirs[i]); private_free(dirs); } /* }}} */ /* Format string validation (well-formedness) {{{ */ static inline void validate_application(format_directive *dir, char *allowed, char* kind, char *desc) { vassert(strchr(allowed, dir->specifier) != '\0', FMT_ERROR "wrong application of %s [%s] to format specifier [%c]\n", desc, kind, dir->specifier); } /** \brief Check that a given format specifier are used with right flags, precision, field width, and length modifier. */ static void validate_applications(format_directive *dir) { /* ==== Flags ==== */ char *desc = "flag"; /* ' flag separates thousands by commas. It is applicable only to i, d, u, f, F, g, or G conversion specifiers. For other specifiers its behaviour is undefined. */ if (dir->flags.apostroph) validate_application(dir, "idufFgG", "\\", desc); /* # flag converts a value to an alternative form. It is applicable only to x, X, a, A, e, E, f, F, g, and G conversion specifiers. */ if (dir->flags.hash) validate_application(dir, "oxXaAeEfFgG", "#", desc); /* 0 flag pads values with zeroes. It is applicable only to d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversion specifiers */ if (dir->flags.zero) validate_application(dir, "diouxXaAeEfFgG", "0", desc); /* No flags should be used if 'n' specifier is given */ if (dir->flags.specified && dir->specifier == 'n') vabort(FMT_ERROR "one of more flags with [n] specifier", NULL); /* ==== Precision ==== */ desc = "precision"; /* Precision gives the minimum number of digits to appear for the d, i, o, u, x, and X conversion specifiers; the number of digits to appear after the period character for the a, A, e, E, f, and F conversion specifiers; the maximum number of significant digits for the g and G conversion specifiers; or the maximum number of bytes to be printed from a string in the s and S conversion specifiers. */ if (dir->precision != INT_MIN) validate_application(dir, "diouxXaAeEfFgGs", ".", desc); /* ==== Field width ==== */ desc = "field width"; if (dir->specifier == 'n' && dir->field_width != INT_MIN) vabort(FMT_ERROR "field width used with [n] specifier", NULL); /* ==== Length modifiers ==== */ desc = "length modifier"; /* Most length modifiers (all except 'L') apply to d, i, o, u, x, or X conversion specifiers. 'L' applies to a, A, e, E, f, F, g, or G. */ if (dir->length.mod != '\0') { /* Make sure the length specifier is one of the allowed ones */ vassert(is_length_char(dir->length.mod), FMT_ERROR "bad length specifier [%c]\n", dir->length.mod); /* Conver length modifier to a string */ char lm_kind[3]; int i = 0; lm_kind[i++] = dir->length.mod; if (dir->length.extended) lm_kind[i++] = dir->length.mod; lm_kind[i++] = '\0'; switch (dir->length.mod) { case 'l': if (!dir->length.extended) { validate_application(dir, "diouxXncsfFeEgGaA", lm_kind, desc); break; } /* No need to look whether 'h' is extended, both 'h' and 'hh' are only applicable to [diouxXn] */ case 'h': case 'j': case 'z': case 't': validate_application(dir, "diouxXn", lm_kind, desc); break; case 'L': validate_application(dir, "aAeEfFgG", lm_kind, desc); break; default: vabort(INT_ERROR "unexpected length modifier %c\n", lm_kind); } } } /* }}} */ /* Format validation (arguments) {{{ */ /** \brief d, i, o, u, x and X format specifiers expect either `int` or `unsigned int`. This, however, can be changed using length modifiers. For instance, "%d" expects `int`, "%ld" expects `long`. The following function computes an integer type that a format expects using length modifiers and format specifiers. */ static abbrev_t infer_integral_abbr(format_directive *dir, int sgn) { switch(dir->length.mod) { case 'l': /* expects long long or long */ return (dir->length.extended) ? (sgn ? ILongLong : IULongLong) : (sgn ? ILong : IULong); case 'h': /* short/char: promoted to int */ return IInt; case 'j': /* intmax_t */ return size2abbri(sizeof(intmax_t), sgn); case 'z': /* size_t */ return size2abbri(sizeof(size_t), sgn); case 't': /* ptrdiff_t */ return size2abbri(sizeof(ptrdiff_t), sgn); case '\0': return (sgn ? IInt : IUInt); } vabort(INT_ERROR "unexpected length modifier: '%c'\n", dir->length.mod); return '\0'; } /** \brief Same as above but for 'n' conversion specifier. */ static abbrev_t infer_n_abbr(format_directive *dir) { char c; switch(dir->length.mod) { case 'h': return dir->length.extended ? PChar : PShort; case 'l': return dir->length.extended ? PLongLong : PLong; case 'j': /* intmax_t: signed type */ c = size2abbri(sizeof(intmax_t), 1); return abbr2ptr(c); case 'z': /* size_t: unsigned type */ c = size2abbri(sizeof(size_t), 0); return abbr2ptr(c); case 't': /* ptrdiff_t: signed type */ c = size2abbri(sizeof(ptrdiff_t), 1); return abbr2ptr(c); case '\0': return PInt; default: vabort(INT_ERROR "unexpected length modifier '%c'\n", dir->length.mod); } return '\0'; } /** \brief Check that a given abbreviated type (`expected_t`) matches the abbreviated type in the format description (`fmtdesc`) and abort the execution if it is not so. This function expects that the index given via the format directive `dir` is less than or equal to the length of `fmtdesc`, i.e., there is an actual argument that corresponds to `dir`. */ static void validate_format_type (abbrev_t expected_t, const char *fmtdesc, format_directive *dir, const char *func) { abbrev_t actual_t = fmtdesc[dir->arg.index]; if (actual_t != expected_t) { vabort("%s: directive %d ('%s') expects argument of type '%s'" " but the corresponding argument has type '%s'\n", func, dir->arg.index + 1, dir->directive, abbr2str(expected_t), abbr2str(actual_t)); } } /** \brief Validate that a C string used with 's' modifier belongs to allocation and has a NUL-terminator. Takes precision into account. @param s - address of the string @param dir - formatting directive @param func - name of the function (e.g., printf) @param wide - if set to a true value then the string should be treated as a wide string (wchar_t*) */ static long validate_format_string_argument (char *s, format_directive *dir, const char *func, int wide) { int limit = (dir->precision >= 0) ? dir->precision : -1; long size = (wide) ? valid_nwstring((wchar_t*)s, limit, 0) : valid_nstring(s, limit, 0); switch(size) { case -1: vabort ("%s: attempt to access unallocated memory via directive %d ('%s')\n", func, dir->arg.index + 1, dir->directive); case -2: vabort(INT_ERROR "%s: writeable check unexpectedly failed in directive %d ('%s')\n", func, dir->arg.index + 1, dir->directive); case -3: vabort("%s: attempt to access partially unallocated memory " "via directive %d ('%s')\n", func, dir->arg.index + 1, dir->directive); case -4: vabort("%s: unterminated string in directive %d ('%s')\n", func, dir->arg.index + 1, dir->directive); } return size; } /** \brief Check that a buffer of a given length overlaps with the memory space of a formatting directive argument. */ static void validate_overlapping_buffer(char *buffer, size_t buf_sz, void *arg, size_t arg_sz, const char *func, format_directive *dir) { if (buffer) { if (!disjoint_spaces((uintptr_t)buffer, buf_sz, (uintptr_t)arg, arg_sz)) vabort("%s: output buffer overlaps with argument %d (%s)\n", func, dir->arg.index + 1, dir->directive); } } /** \brief Main format validation function that parses the format string and validates each format directive against the provided format description. If any of the requirements are violated the the program is aborted. @param fmtdesc - format description, a C string of abbreviated types that describes the types of actual argument a call to a formatting function has been made with @param fmt - format string @param ap - va_list of arguments to a formatting function @param func - symbolic name of a formatting function used @param buffer - buffer to write (in case of sprintf/snprintf, NULL otherwise) @param buffer - buffer limit */ static void validate_format (const char *fmtdesc, const char *fmt, va_list ap, const char *func, char *buffer, size_t buf_size) { /* Check that format string is valid first */ if (valid_string((char*)fmt, 0) < 0) vabort("%s: invalid format string (unallocated or unterminated)\n", func); /* Parse format string and generate format directives */ format_directive ** dirs = get_format_directives((char*)fmt); format_directive ** dirs_c = dirs; /* extra alias for passing it to `free` */ /* Track addresses of variadic arguments */ int arglen = strlen(fmtdesc); /* number of variadic arguments */ void *args[arglen]; int i; for (int i = 0; i < arglen; i++) args[i] = va_arg(ap, void*); va_end(ap); /* Validate each generated directive */ while (*dirs) { format_directive *dir = *dirs; validate_applications(dir); /* Check that the directive is well formed */ int argno = dir->arg.index; /* Make sure there is a sufficient number of arguments provided: for each format directive in the format string there should be a corresponding argument except for literal directive `%%` */ if (argno >= arglen) vabort("%s: directive %d (%s) in format \"%s\" has no argument\n", func, dir->arg.index + 1, dir->directive, dir->format); /* Shortcut for `validate_format_type` function */ #define validate_type(_t) validate_format_type(_t, fmtdesc, dir, func) uintptr_t addr = (uintptr_t)args[argno]; /* Address of the argument */ char expected_t; /* Placeholder for the type expected by the directive */ switch(dir->specifier) { case 'd': /* signed integer */ case 'i': expected_t = infer_integral_abbr(dir, 1); validate_type(expected_t); break; case 'o': /* unsigned integer */ case 'u': case 'x': case 'X': expected_t = infer_integral_abbr(dir, 0); validate_type(expected_t); break; case 'f': case 'F': /* double */ case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': /* All floating point modifiers (aAeEfFgG) expect doubles except for the case when 'L' length modifier is given in which case it expects long double. Any other length modifier leads to an undefined behaviour. Checking that does not happen is done in ::validate_applications */ expected_t = (dir->length.mod == 'L') ? FLongDouble : FDouble; validate_type(expected_t); break; case 'c': /* character */ /* On all occasions 'c' expects an `int`. This is because `char` is always promoted. However, in case `l` length modifier is specified (i.e., "%lc") then it expects an argument be of type `wint_t` and can either be signed or unsigned. So let's compute it! */ if (dir->length.mod == 'l') { wint_t wi = 1; int sign = UNSIGNED(wi); expected_t = size2abbri(sizeof(wint_t), !sign); } else expected_t = IInt; validate_type(expected_t); break; case 's': { /* character string */ int wide = (dir->length.mod == 'l'); if (wide) { /* same as with %lc, compute sign of wchar_t */ wchar_t wi = 1; int sign = UNSIGNED(wi); expected_t = size2abbri(sizeof(wint_t), !sign); expected_t = abbr2ptr(expected_t); } else expected_t = PChar; validate_type(expected_t); /* Check that a string is valid */ int asz = validate_format_string_argument((char*)addr, dir, func, wide); validate_overlapping_buffer (buffer, buf_size, (void*)addr, asz, func, dir); break; } case 'p': validate_type(PVoid); if (!allocated(addr, 1, addr)) vabort("%s: argument %d of directive %s not allocated\n", func, argno + 1, dir->directive); validate_overlapping_buffer (buffer, buf_size, (void*)addr, 1, func, dir); break; case 'n': { expected_t = infer_n_abbr(dir); validate_type(expected_t); /* 'n' modifier writes the number of bytes corresponding to characters written by a function so far to a pointer of an integral type. Make sure that the provided pointer corresponds to writeable memory. */ int size = dir->length.bytes == 0 ? sizeof(int) : dir->length.bytes; if (!writeable(addr, size, addr)) vabort("%s: argument %d of directive %s not allocated or writeable\n", func, argno, dir->directive); validate_overlapping_buffer (buffer, buf_size, (void*)addr, size, func, dir); break; } default: vabort(INT_ERROR "Unexpected format specifier '%c'\n", dir->specifier); } dirs++; #undef validate_type } release_directives(fmt, dirs_c); } /* }}} */ /* Printf and friends {{{ */ int builtin_printf(const char *fmtdesc, const char *fmt, ...) { va_list ap; va_start(ap, fmt); validate_format(fmtdesc, fmt, ap, "printf", NULL, 0); va_start(ap, fmt); return vprintf(fmt, ap); } int builtin_fprintf(const char *fmtdesc, FILE *stream, const char *fmt, ...) { va_list ap; va_start(ap, fmt); /* First check that stream belongs to allocated space */ if (!allocated((uintptr_t)stream, 1, (uintptr_t)stream)) vabort("fprintf: attempt to write to an invalid stream\n", NULL); /* Check if stream is a valid stream and that is open */ int fd = fileno(stream); if (fd == -1) vabort("fprintf: attempt to write to an invalid stream\n", NULL); /* Since we have a file descriptor check if it is open. This may not be really necessary since `fileno` should be able to tell us that. Does not hurt though. That's a fast check. It should be noted that `fileno` is a POSIX function and not in the C99 standard. */ if (fcntl(fd, F_GETFD) == -1) vabort("fprintf: attempt to write to a closed stream\n", NULL); validate_format(fmtdesc, fmt, ap, "fprintf", NULL, 0); va_start(ap, fmt); return vfprintf(stream, fmt, ap); } int builtin_dprintf(const char *fmtdesc, int fd, const char *fmt, ...) { va_list ap; va_start(ap, fmt); /* Make sure that the designated file descriptor is open */ if (fcntl(fd, F_GETFD) == -1) vabort("dprintf: attempt to write to a closed file descriptor %d\n", fd); validate_format(fmtdesc, fmt, ap, "dprintf", NULL, 0); va_start(ap, fmt); return vdprintf(fd, fmt, ap); } int builtin_sprintf(const char *fmtdesc, char *buffer, const char *fmt, ...) { va_list ap; /* Make sure that the buffer has sufficient space to store the result of the function. Luckily this can be accomplished via `snprintf(buf, n, mfmt,...)` that can take `NULL` and `0` as its first two arguments (nothing is printed) but still returns the number of characters that would have been printed if both `buf` and `n` were sufficiently large. This behaviour is C99-compliant and described in par. 7.19.6.5 of the C99 standard */ va_start(ap, fmt); int len = vsnprintf(NULL, 0, fmt, ap); if (!writeable((uintptr_t)buffer, len + 1, (uintptr_t)buffer)) vabort("sprintf: output buffer is unallocated or has insufficient length " "to store %d characters or not writeable\n", len + 1); va_start(ap, fmt); validate_format(fmtdesc, fmt, ap, "sprintf", buffer, len + 1); va_start(ap, fmt); return vsprintf(buffer, fmt, ap); } int builtin_snprintf(const char *fmtdesc, char *buffer, size_t size, const char *fmt, ...) { va_list ap; va_start(ap, fmt); validate_format(fmtdesc, fmt, ap, "snprintf", buffer, size); /* Check that the input buffer is large enough. However, if there are zero characters to write, it does not matter */ if (size > 0 && !writeable((uintptr_t)buffer, size, (uintptr_t)buffer)) vabort("sprintf: output buffer is unallocated or has insufficient length " "to store %d characters and \0 terminator or not writeable\n", size); va_start(ap, fmt); return vsnprintf(buffer, size, fmt, ap); } int builtin_syslog(const char *fmtdesc, int priority, const char *fmt, ...) { va_list ap; va_start(ap, fmt); validate_format(fmtdesc, fmt, ap, "syslog", NULL, 0); va_start(ap, fmt); return vsyslog(priority, fmt, ap); } /* }}} */ #endif /* E_ACSL_VALIDATE_FORMAT_STRINGS */ #endif /* E_ACSL_FORMAT_H */ frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_gmp_api.h0000666000000000000000000002217313571573400022175 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_gmp.h * \brief Prototypes of functions belonging to GNU Multiple * Precision Arithmetic Library (GMP) used within E-ACSL ***************************************************************************/ /******************/ /* GMP prototypes */ /******************/ #ifndef E_ACSL_GMP_API_H #define E_ACSL_GMP_API_H #include "stdlib.h" #include "e_acsl_alias.h" #define mpz_struct export_alias(mpz_struct) #define mpz_t export_alias(mpz_t) #define mpq_struct export_alias(mpq_struct) #define mpq_t export_alias(mpq_t) struct mpz_struct { int _mp_alloc; int _mp_size; unsigned long *_mp_d; }; typedef struct mpz_struct mpz_struct; typedef mpz_struct (__attribute__((__FC_BUILTIN__)) mpz_t)[1]; struct mpq_struct { mpz_struct _mp_num; mpz_struct _mp_den; }; typedef struct mpq_struct mpq_struct; typedef mpq_struct (__attribute__((__FC_BUILTIN__)) mpq_t)[1]; /****************/ /* Initializers */ /****************/ /*@ ghost extern int __e_acsl_init; */ /*@ requires ! \initialized(z); @ ensures \valid(z); @ allocates z; @ assigns *z \from __e_acsl_init; */ extern void __gmpz_init(mpz_t z) __attribute__((FC_BUILTIN)); /*@ requires ! \initialized(q); @ ensures \valid(q); @ allocates q; @ assigns *q \from __e_acsl_init; */ extern void __gmpq_init(mpq_t q) __attribute__((FC_BUILTIN)); /*@ requires \valid_read(z_orig); @ requires ! \initialized(z); @ allocates z; @ ensures \valid(z); // @ ensures z->n == z_orig->n; @ assigns *z \from *z_orig; */ extern void __gmpz_init_set(mpz_t z, const mpz_t z_orig) __attribute__((FC_BUILTIN)); /*@ requires ! \initialized(z); @ allocates z; @ ensures \valid(z); @ ensures \initialized(z); // @ ensures z->n == n; @ assigns *z \from n; */ extern void __gmpz_init_set_ui(mpz_t z, unsigned long int n) __attribute__((FC_BUILTIN)); /*@ requires ! \initialized(z); @ allocates z; @ ensures \valid(z); @ ensures \initialized(z); // @ ensures z->n == n; @ assigns *z \from n; */ extern void __gmpz_init_set_si(mpz_t z, signed long int n) __attribute__((FC_BUILTIN)); /*@ requires ! \initialized(z); @ allocates z; @ ensures \valid(z); @ ensures \initialized(z); @ assigns *z \from str[0..],base; @ assigns \result \from str[0..],base; */ extern int __gmpz_init_set_str(mpz_t z, const char *str, int base) __attribute__((FC_BUILTIN)); /*@ requires ! \initialized(z); @ allocates z; @ ensures \valid(z); @ ensures \initialized(z); @ assigns *z \from base; */ extern void __gmpz_import (mpz_t z, size_t, int, size_t, int, size_t, const void *base) __attribute__((FC_BUILTIN)); /***************/ /* Assignments */ /***************/ /*@ requires \valid_read(z_orig); @ requires \valid(z); // @ ensures z->n == z_orig->n; @ assigns *z \from *z_orig; */ extern void __gmpz_set(mpz_t z, const mpz_t z_orig) __attribute__((FC_BUILTIN)); /*@ requires \valid_read(q_orig); @ requires \valid(q); @ assigns *q \from *q_orig; */ extern void __gmpq_set(mpq_t q, const mpq_t q_orig) __attribute__((FC_BUILTIN)); /*@ requires \valid(q); @ assigns *q \from d; */ extern void __gmpq_set_d(mpq_t q, double d) __attribute__((FC_BUILTIN)); /*@ requires \valid(q); @ assigns *q \from n; */ extern void __gmpq_set_si(mpq_t q, signed long int n) __attribute__((FC_BUILTIN)); /*@ allocates q; @ ensures \valid(q); @ ensures \initialized(q); @ assigns *q \from str[0..],base; @ assigns \result \from str[0..],base; */ extern int __gmpq_set_str(mpq_t q, const char *str, int base) __attribute__((FC_BUILTIN)); /*@ requires \valid(z); // @ ensures z->n == n; @ assigns *z \from n; */ extern void __gmpz_set_ui(mpz_t z, unsigned long int n) __attribute__((FC_BUILTIN)); /*@ requires \valid(z); // @ ensures z->n == n; @ assigns *z \from n; */ extern void __gmpz_set_si(mpz_t z, signed long int n) __attribute__((FC_BUILTIN)); /*************/ /* Finalizer */ /*************/ /*@ requires \valid(x); // @ frees x; @ assigns *x \from *x; */ extern void __gmpz_clear(mpz_t x) __attribute__((FC_BUILTIN)); /*@ requires \valid(x); // @ frees x; @ assigns *x \from *x; */ extern void __gmpq_clear(mpq_t x) __attribute__((FC_BUILTIN)); /********************/ /* Logical operator */ /********************/ /*@ requires \valid_read(z1); @ requires \valid_read(z2); @ assigns \result \from *z1, *z2; */ extern int __gmpz_cmp(const mpz_t z1, const mpz_t z2) __attribute__((FC_BUILTIN)); /*@ requires \valid_read(q1); @ requires \valid_read(q2); @ assigns \result \from *q1, *q2; */ extern int __gmpq_cmp(const mpq_t q1, const mpq_t q2) __attribute__((FC_BUILTIN)); /************************/ /* Arithmetic operators */ /************************/ /*@ requires \valid(z1); @ requires \valid_read(z2); @ assigns *z1 \from *z2; */ extern void __gmpz_neg(mpz_t z1, const mpz_t z2) __attribute__((FC_BUILTIN)); /*@ requires \valid(z1); @ requires \valid_read(z2); @ requires \valid_read(z3); @ assigns *z1 \from *z2, *z3; */ extern void __gmpz_add(mpz_t z1, const mpz_t z2, const mpz_t z3) __attribute__((FC_BUILTIN)); /*@ requires \valid(q1); @ requires \valid_read(q2); @ requires \valid_read(q3); @ assigns *q1 \from *q2, *q3; */ extern void __gmpq_add(mpq_t q1, const mpq_t q2, const mpq_t q3) __attribute__((FC_BUILTIN)); /*@ requires \valid(z1); @ requires \valid_read(z2); @ requires \valid_read(z3); @ assigns *z1 \from *z2, *z3; */ extern void __gmpz_sub(mpz_t z1, const mpz_t z2, const mpz_t z3) __attribute__((FC_BUILTIN)); /*@ requires \valid(q1); @ requires \valid_read(q2); @ requires \valid_read(q3); @ assigns *q1 \from *q2, *q3; */ extern void __gmpq_sub(mpq_t q1, const mpq_t q2, const mpq_t q3) __attribute__((FC_BUILTIN)); /*@ requires \valid(z1); @ requires \valid_read(z2); @ requires \valid_read(z3); @ assigns *z1 \from *z2, *z3; */ extern void __gmpz_mul(mpz_t z1, const mpz_t z2, const mpz_t z3) __attribute__((FC_BUILTIN)); /*@ requires \valid(q1); @ requires \valid_read(q2); @ requires \valid_read(q3); @ assigns *q1 \from *q2, *q3; */ extern void __gmpq_mul(mpq_t q1, const mpq_t q2, const mpq_t q3) __attribute__((FC_BUILTIN)); /*@ requires \valid(z1); @ requires \valid_read(z2); @ requires \valid_read(z3); @ assigns *z1 \from *z2, *z3; */ extern void __gmpz_tdiv_q(mpz_t z1, const mpz_t z2, const mpz_t z3) __attribute__((FC_BUILTIN)); /*@ requires \valid(z1); @ requires \valid_read(z2); @ requires \valid_read(z3); @ assigns *z1 \from *z2, *z3; */ extern void __gmpz_tdiv_r(mpz_t z1, const mpz_t z2, const mpz_t z3) __attribute__((FC_BUILTIN)); /*@ requires \valid(q1); @ requires \valid_read(q2); @ requires \valid_read(q3); @ assigns *q1 \from *q2, *q3; */ extern void __gmpq_div(mpq_t q1, const mpq_t q2, const mpq_t q3) __attribute__((FC_BUILTIN)); /*********************/ /* Bitwise operators */ /*********************/ /*@ requires \valid(z1); @ requires \valid_read(z2); @ assigns *z1 \from *z2; @ assigns \result \from *z1,*z2; */ extern int __gmpz_com(mpz_t z1, const mpz_t z2) __attribute__((FC_BUILTIN)); /************************/ /* Coercions to C types */ /************************/ /*@ requires \valid_read(z); @ assigns \result \from *z; */ extern long __gmpz_get_si(const mpz_t z) __attribute__((FC_BUILTIN)); /*@ requires \valid_read(q); @ assigns \result \from *q; */ extern double __gmpq_get_d(const mpq_t q) __attribute__((FC_BUILTIN)); /*@ requires \valid_read(z); @ assigns \result \from *z; */ extern unsigned long __gmpz_get_ui(const mpz_t z) __attribute__((FC_BUILTIN)); #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_leak.h0000666000000000000000000000573513571573400021502 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_leak.h * * \brief Functionality to report/track memory leaks. Shared between models ***************************************************************************/ #ifndef E_ACSL_HEAP_LEAK_H #define E_ACSL_HEAP_LEAK_H #include "e_acsl.h" /* Variable tracking byte-count of user-allocated heap memory. Visible externally via __e_acsl_ prefix */ size_t heap_allocation_size = 0; /* Variable tracking count of heap memory blocks */ static size_t heap_allocated_blocks = 0; /* Return the number of bytes in heap application allocation */ size_t get_heap_allocation_size(void) { return heap_allocation_size; } /* Return the number of blocks in heap application allocation */ static inline size_t get_heap_allocated_blocks(void) { return heap_allocated_blocks; } /* Update heap allocation stats */ static void update_heap_allocation(long size) { heap_allocation_size += size; if (size > 0) heap_allocated_blocks++; else if (size < 0) heap_allocated_blocks--; } static void report_heap_leaks() { #if defined(E_ACSL_VERBOSE) || defined(E_ACSL_DEBUG) size_t size = get_heap_allocation_size(); size_t blocks = get_heap_allocated_blocks(); if (size) { rtl_printf(" *** WARNING: Leaked %lu bytes of heap memory in %ld block%s\n", size, blocks, (blocks == 1) ? "" : "s"); } #endif } #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_libc_replacements.h0000666000000000000000000002672413571573400024242 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_libc_replacements.h * \brief Drop-in replacements for C library functions ***************************************************************************/ #ifndef E_ACSL_LIBC_REPLACEMENTS_H #define E_ACSL_LIBC_REPLACEMENTS_H /************************************************************************/ /*** Support functionality {{{ ***/ /************************************************************************/ /* *** String validation {{{ */ /*! \brief Determine if `s` describes a C string up to length `n`. @return the index of `\0` character (i.e., the length of the string) if `s` is a valid pointer of byte-size `len`, and - `n` is negative and there is `\0` between `s` and the end of the block `s` points to. - `n` is positive and there is `\0` at index `i` (`i` < `n`) and `s+i` belongs to the same block as `s`. @return `n` if there is no `\0` between `s` and `s+n-1` but both `s` and `s+n-1` belong to the same block. @return -1 if `s` does not belong to tracked allocation @return -2 if `wrtbl` is set to a non-zero value and `s` is read-only @return -3 if there is no `\0` between `s` and the end of its block and `s+n-1` is unallocated or belongs to a different block. @return -4 if `n` is negative and `s` is not NUL-terminated */ static long valid_nstring(char *s, long n, int wrtbl) { if (n == 0) return n; int alc = allocated((uintptr_t)s, 1, (uintptr_t)s); if (alc) { if (wrtbl && readonly(s)) return -2; /* Not writeable */ long size = block_length(s) - offset(s); long i; for (i = 0; i < size; i++) { if (s[i] == '\0' || n == i) return i; } if (n == size) return n; if (n > size) return -3; /* Insufficient length */ return -4; /* Not NUL-terminated */ } return -1 /* Not allocated */; } /*!\brief Same as ::valid_nstring but for wide characters. This function is very similar to ::valid_nstring. It is possible make it more concise (say define it as a macro with types provided explicitly) yet it is left this way for readibility reasons. */ static long valid_nwstring(wchar_t *s, long n, int wrtbl) { if (n == 0) return n; int alc = allocated((uintptr_t)s, 1, (uintptr_t)s); if (alc) { if (wrtbl && readonly(s)) return -2; /* Not writeable */ long size = (block_length(s) - offset(s))/sizeof(wchar_t); long i; for (i = 0; i < size; i++) { if (s[i] == L'\0' || n == i) return i; } if (n == size) return n; if (n > size) return -3; /* Insufficient length */ return -4; /* Not NUL-terminated */ } return -1 /* Not allocated */; } /*! \brief Same as ::valid_nstring but check a NUL-terminated string */ static long inline valid_string(char *s, int wrtbl) { return valid_nstring(s, -1, wrtbl); } /*! \brief same as ::valid_string but for wide characters */ static long inline valid_wstring(wchar_t *s, int wrtbl) { return valid_nwstring(s, -1, wrtbl); } static long validate_string (char *s, long n, int wrtbl, const char *fun, const char *desc) { long size = valid_nstring(s, n, wrtbl); switch(size) { case -1: vabort("%s: %sstring unallocated\n", fun, desc); case -2: vabort("%s: %sstring is not writable\n", fun, desc); case -3: vabort("%s: %sstring has insufficient length\n", fun, desc); case -4: vabort("%s: %sstring not NUL-terminated\n", fun, desc); } /* at this point negative return values should have been handled */ vassert(size >= 0, "unexpected return value of %d\n", size); return size; } static inline long validate_writeable_string (char *s, long n, const char *fun, const char *desc) { return validate_string(s, n, 1, fun, desc); } static inline long validate_allocated_string (char *s, long n, const char *fun, const char *desc) { return validate_string(s, n, 0, fun, desc); } /* }}} */ /* *** Memory spaces {{{ */ /** \brief Return a true value if memory spaces given by intervals [s1, s1 + s1_sz] and [s2, s2 + s2_sz] are disjoint */ static inline int disjoint_spaces (uintptr_t s1, size_t s1_sz, uintptr_t s2, size_t s2_sz) { return s1 + s1_sz <= s2 || s2 + s2_sz <= s1; } static inline void validate_allocated_space (void *p, size_t sz, const char *func, const char *space) { if (!allocated((uintptr_t)p, sz, (uintptr_t)p)) { vabort("%s: unallocated (or insufficient) space in %s\n", func, space); } } static inline void validate_writeable_space(void *p, size_t sz, const char *func, const char *space) { if (!writeable((uintptr_t)p, sz, (uintptr_t)p)) { if (writeable((uintptr_t)p, 1, (uintptr_t)p)) { vabort("%s: insufficient space in %s, " "at least %lu bytes required\n", func, space, sz); } else { vabort("%s: %s space unallocated or cannot be written\n", func, space); } } } static inline void validate_overlapping_spaces (uintptr_t s1, size_t s1_sz, uintptr_t s2, size_t s2_sz, const char *func) { if (!disjoint_spaces(s1, s1_sz, s2, s2_sz)) vabort("%s: overlapping memory areas\n", func); } /* }}} */ /* }}} */ /************************************************************************/ /*** strlen/strcpy/strcat/strcmp {{{ ***/ /************************************************************************/ /* drop-in replacement for `strlen` */ size_t builtin_strlen(const char *s) { return validate_allocated_string((char*)s, -1, "strlen", "input "); } /* drop-in replacement for `strcpy` */ char *builtin_strcpy(char *dest, const char *src) { // `src` string should be a valid NUL-terminated C string size_t size = validate_allocated_string((char*)src, -1, "strlen", "source string "); /* `dest` should be writable and at least `size + 1` bytes long to accommodate the NUL-terminator */ validate_writeable_space(dest, size + 1, "strlen", "destination string"); /* source and destination strings should not overlap */ validate_overlapping_spaces ((uintptr_t)dest, size + 1, (uintptr_t)src, size + 1, "strcpy"); return strcpy(dest, src); } /* drop-in replacement for `strncpy` */ char *builtin_strncpy(char *dest, const char *src, size_t n) { /* `src` should be a valid string up to `nth` character */ validate_allocated_string((char*)src, n, "strncpy", "source string "); /* `dest` should be allocated and writeable up to `nth` character */ validate_writeable_space(dest, n, "strncpy", "destination string "); /* source and destination strings should not overlap */ validate_overlapping_spaces((uintptr_t)dest, n, (uintptr_t)src, n, "strncpy"); return strncpy(dest, src, n); } /* drop-in replacement for `strcmp` */ int builtin_strcmp(const char *s1, const char *s2) { /* both strings should be valid NUL-terminated strings */ validate_allocated_string((char*)s1, -1, "strcmp", "string 1 "); validate_allocated_string((char*)s2, -1, "strcmp", "string 2 "); return strcmp(s1, s2); } /* drop-in replacement for `strcmp` */ int builtin_strncmp(const char *s1, const char *s2, size_t n) { /* both strings should be valid up to nth character */ validate_allocated_string((char*)s1, n, "strncmp", "string 1 "); validate_allocated_string((char*)s2, n, "strncmp", "string 2 "); return strncmp(s1, s2, n); } /* drop-in replacement for `strcat` */ char *builtin_strcat(char *dest, const char *src) { long src_sz = validate_allocated_string((char*)src, -1, "strcat", "source string "); long dest_sz = validate_writeable_string((char*)dest, -1, "strcat", "destination string "); size_t avail_sz = block_length(dest) - offset(dest); if (!(avail_sz >= src_sz + dest_sz + 1)) { vabort("strcat: insufficient space in destination string, " "available: %lu bytes, requires at least %lu bytes\n", avail_sz, src_sz + dest_sz + 1); } validate_overlapping_spaces ((uintptr_t)src, src_sz + 1, (uintptr_t)dest, dest_sz + 1, "strcat"); return strcat(dest, src); } /* drop-in replacement for `strncat` */ char *builtin_strncat(char *dest, const char *src, size_t n) { validate_allocated_string((char*)src, n, "strncat", "source string "); long dest_sz = validate_writeable_string((char*)dest, -1, "strcat", "destination string "); size_t avail_sz = block_length(dest) - offset(dest); if (!(avail_sz >= n + dest_sz + 1)) { vabort("strncat: insufficient space in destination string, " "available: %lu bytes, requires at least %lu bytes\n", avail_sz, n + dest_sz + 1); } validate_overlapping_spaces ((uintptr_t)src, n, (uintptr_t)dest, dest_sz, "strcat"); return strncat(dest, src, n); } /* }}} */ /************************************************************************/ /*** memcpy/memcmp/memset/memmove {{{ ***/ /************************************************************************/ /* drop-in replacement for `memcpy` */ void *builtin_memcpy(void *dest, const void *src, size_t n) { validate_allocated_space((void*)src, n, "memcpy", "source space "); validate_writeable_space((void*)dest, n, "memcpy", "destination space "); validate_overlapping_spaces((uintptr_t)src, n, (uintptr_t)dest, n, "memcpy"); return memcpy(dest, src, n); } /* drop-in replacement for `memset` */ void *builtin_memset(void *s, int c, size_t n) { validate_writeable_space((void*)s, n, "memset", "space "); return memset(s, c, n); } /* drop-in replacement for `memcmp` */ int builtin_memcmp(const void *s1, const void *s2, size_t n) { validate_allocated_space((void*)s1, n, "memcmp", "space 1 "); validate_allocated_space((void*)s2, n, "memcmp", "space 1 "); validate_overlapping_spaces((uintptr_t)s1, n, (uintptr_t)s2, n, "memcpy"); return memcmp(s1, s2, n); } /* drop-in replacement for `memmove` */ void *builtin_memmove(void *dest, const void *src, size_t n) { validate_allocated_space((void*)src, n, "memcmp", "source space "); validate_writeable_space((void*)dest, n, "memcmp", "destination space "); return memmove(dest, src, n); } /* }}} */ #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_malloc.h0000666000000000000000000001520413571573400022025 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_malloc.h * * \brief E-ACSL memory allocation bindings. ***************************************************************************/ #ifndef E_ACSL_MALLOC_H #define E_ACSL_MALLOC_H #include #include /* Memory allocated for internal use of RTL and for the use by the application * is split into two mspaces (memory spaces). Memory allocation itself is * delegated to a slightly customised version of dlmalloc shipped with the * RTL. The overall pattern is as follows: * mspace space = create_mspace(capacity, locks); * char *p = mspace_malloc(space, size); */ /* Block size units in bytes */ #define KB (1024) //!< Bytes in a kilobyte #define MB (1024*KB) //!< Bytes in a megabyte #define GB (1024*MB) //!< Bytes in a gigabyte #define KB_SZ(_s) (_s/KB) //!< Convert bytes to kilobytes #define MB_SZ(_s) (_s/MB) //!< Convert bytes to megabytes #define GB_SZ(_s) (_s/GB) //!< Convert bytes to gigabytes typedef void* mspace; static struct memory_spaces { mspace rtl_mspace; /* `private` (RTL) mspace */ mspace heap_mspace; /* `public` (application) mspace */ uintptr_t heap_start; /* least address in application mspace */ uintptr_t heap_end; /* greatest address in application mspace */ uintptr_t heap_mspace_least; /* Initial least address in heap mspace */ } mem_spaces; /* While it is possible to generate prefixes using an extra level of * indirection with macro definitions it is probably best not to do it, * becomes barely readable ...*/ /* Mspace allocators {{{ */ extern mspace __e_acsl_create_mspace(size_t, int); extern size_t __e_acsl_destroy_mspace(mspace); extern void* __e_acsl_mspace_malloc(mspace, size_t); extern void __e_acsl_mspace_free(mspace, void*); extern void* __e_acsl_mspace_calloc(mspace msp, size_t, size_t); extern void* __e_acsl_mspace_realloc(mspace msp, void*, size_t); extern void* __e_acsl_mspace_aligned_alloc(mspace, size_t, size_t); extern int __e_acsl_mspace_posix_memalign(mspace, void **, size_t, size_t); extern void* __e_acsl_mspace_least_addr(mspace); #define create_mspace __e_acsl_create_mspace #define destroy_mspace __e_acsl_destroy_mspace #define mspace_least_addr __e_acsl_mspace_least_addr #define mspace_malloc __e_acsl_mspace_malloc #define mspace_free __e_acsl_mspace_free #define mspace_calloc __e_acsl_mspace_calloc #define mspace_realloc __e_acsl_mspace_realloc #define mspace_posix_memalign __e_acsl_mspace_posix_memalign #define mspace_aligned_alloc __e_acsl_mspace_aligned_alloc /* }}} */ /* Public allocators used within RTL to override standard allocation {{{ */ /* Shortcuts for public allocation functions */ # define public_malloc(...) mspace_malloc(mem_spaces.heap_mspace, __VA_ARGS__) # define public_realloc(...) mspace_realloc(mem_spaces.heap_mspace, __VA_ARGS__) # define public_calloc(...) mspace_calloc(mem_spaces.heap_mspace, __VA_ARGS__) # define public_free(...) mspace_free(mem_spaces.heap_mspace, __VA_ARGS__) # define public_aligned_alloc(...) mspace_aligned_alloc(mem_spaces.heap_mspace, __VA_ARGS__) # define public_posix_memalign(...) mspace_posix_memalign(mem_spaces.heap_mspace, __VA_ARGS__) /* }}} */ /* Private allocators usable within RTL and GMP {{{ */ void * __e_acsl_private_malloc(size_t sz) { return mspace_malloc(mem_spaces.rtl_mspace, sz); } void *__e_acsl_private_calloc(size_t nmemb, size_t sz) { return mspace_calloc(mem_spaces.rtl_mspace, nmemb, sz); } void *__e_acsl_private_realloc(void *p, size_t sz) { return mspace_realloc(mem_spaces.rtl_mspace, p, sz); } void __e_acsl_private_free(void *p) { mspace_free(mem_spaces.rtl_mspace, p); } #define private_malloc __e_acsl_private_malloc #define private_calloc __e_acsl_private_calloc #define private_realloc __e_acsl_private_realloc #define private_free __e_acsl_private_free /* }}} */ /* \brief Create two memory spaces, one for RTL and the other for application memory. This function *SHOULD* be called before any allocations are made otherwise execution fails */ static void make_memory_spaces(size_t rtl_size, size_t heap_size) { mem_spaces.rtl_mspace = create_mspace(rtl_size, 0); mem_spaces.heap_mspace = create_mspace(heap_size, 0); /* Do not use `mspace_least_addr` here, as it returns the address of the mspace header. */ mem_spaces.heap_start = (uintptr_t)mspace_malloc(mem_spaces.heap_mspace,1); mem_spaces.heap_end = mem_spaces.heap_start + heap_size; /* Save initial least address of heap memspace. This address is used later to check whether memspace has been moved. */ mem_spaces.heap_mspace_least = (uintptr_t)mspace_least_addr(mem_spaces.heap_mspace); } static void destroy_memory_spaces() { destroy_mspace(mem_spaces.rtl_mspace); destroy_mspace(mem_spaces.heap_mspace); } /* \return a true value if x is a power of 2 and false otherwise */ static int powof2(size_t x) { while (((x & 1) == 0) && x > 1) /* while x is even and > 1 */ x >>= 1; return (x == 1); } #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_printf.h0000666000000000000000000003053513571573400022064 0ustar /****************************************************************************/ /* */ /* Copyright (c) 2004,2012 Kustaa Nyholm / SpareTimeLabs */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in the */ /* documentation and/or other materials provided with the distribution. */ /* */ /* Neither the name of the Kustaa Nyholm or SpareTimeLabs nor the names */ /* of its contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /* File modified by CEA (Commissariat à l'énergie atomique et aux */ /* énergies alternatives). */ /* */ /****************************************************************************/ /*! *********************************************************************** * \file e_acsl_printf.h * \brief Malloc and stdio free implementation printf. * * Supported format strings: * - Flag characters: * - 0 - the following value will be is zero-padded. * * - Field width: * - Optional positive decimal integer following flag characters. * * - Length modifier: * - l - the following integer conversion corresponds to a long int or * unsigned long int argument. * * - Standard conversion specifiers: * - d - signed integers. * - u - unsigned integers. * - f - floating point numbers. Floating point numbers do not support * - precision specification. * - x,X - hexadecimal numbers. * - p - void pointers. * * - Non-standard conversion specifiers: * - a - memory-address. * - b, B - print field width bits of a number left-to-right (b) or * right-to-left (B). Unless specified field-width of 8 is used. Bits * over a 64-bit boundary are ignored. * - v, V - print first field width bits of a memory region given by a * void pointer left-to-right (v) or right-to-left (V). Unless specified * field-width of 8 is used. ***************************************************************************/ #ifndef E_ACSL_PRINTF_H #define E_ACSL_PRINTF_H #include #include #include #include "e_acsl_alias.h" /* ****************** */ /* Public API */ /* ****************** */ /* Replacement for printf with support for the above specifiers */ static int rtl_printf(char *fmt, ...); /* Same as printf but write to a string buffer */ static int rtl_sprintf(char* s, char *fmt, ...); /* Same as printf but write to the error stream. */ static int rtl_eprintf(char *fmt, ...); /* Same as printf but write to a file descriptor. */ static int rtl_dprintf(int fd, char *fmt, ...); /* ****************** */ /* Implementation */ /* ****************** */ typedef void (*putcf) (void*,char); /* Unsigned long integers to string conversion (%u) */ static void uli2a(unsigned long int num, unsigned int base, int uc,char * bf) { int n=0; unsigned long int d=1; while (num/d >= base) d*=base; while (d!=0) { int dgt = num / d; num%=d; d/=base; if (n || dgt>0|| d==0) { *bf++ = dgt+(dgt<10 ? '0' : (uc ? 'A' : 'a')-10); ++n; } } *bf=0; } /* Unsigned pointer-wide integers to memory address conversion (%a) */ static void addr2a(uintptr_t addr, char * bf) { *bf++ = '0'; *bf++ = 'x'; unsigned int digits = 1; int n=0; unsigned long int d=1; while (addr/d >= 10) { d*=10; digits++; } unsigned int ctr = 0; while (d!=0) { ctr++; int dgt = addr / d; addr%=d; d/=10; if (n || dgt>0|| d==0) { *bf++ = dgt+(dgt<10 ? '0' : 'a' - 10); ++n; } if (--digits%5 == 0 && d != 0) *bf++ = '-'; } *bf=0; } /* Pointer to string conversion (%p) */ static void ptr2a(void *p, char *bf) { *bf++ = '0'; *bf++ = 'x'; uli2a((intptr_t)p,16,0,bf); } /* Signed long integer to string conversion (%ld) */ static void li2a (long num, char * bf) { if (num<0) { num=-num; *bf++ = '-'; } uli2a(num,10,0,bf); } /* Signed integer to string conversion (%d) */ static void ui2a(unsigned int num, unsigned int base, int uc,char * bf) { int n=0; unsigned int d=1; while (num/d >= base) d*=base; while (d!=0) { int dgt = num / d; num%= d; d/=base; if (n || dgt>0 || d==0) { *bf++ = dgt+(dgt<10 ? '0' : (uc ? 'A' : 'a')-10); ++n; } } *bf=0; } /* Integer bit-fields to string conversion (%b, %B) */ static void bits2a(long int v, int size, char *bf, int l2r) { int i; if (l2r) { for(i = 0; i < size; i++) { *bf++ = '0' + ((v >> i) & 1); if (i && i+1 < size && (i+1)%8 == 0) *bf++ = ' '; } } else { for(i = size - 1; i >= 0; i--) { *bf++ = '0' + ((v >> i) & 1); if (i && i+1 < size && i%4 == 0) *bf++ = ' '; } } *bf=0; } /* Pointer bit-fields to string conversion (%v, %V) */ static void pbits2a(void *p, int size, char *bf, int l2r) { char *v = (char*)p; int i; if (l2r) { for(i = 0; i < size; i++) { *bf++ = '0' + ((v[i/8] >> i%8) & 1); if (i && i+1 < size && (i+1)%4 == 0) *bf++ = ' '; } } else { for(i = size - 1; i >= 0; i--) { *bf++ = '0' + ((v[i/8] >> i%8) & 1); if (i && i+1 < size && i%4 == 0) *bf++ = ' '; } } *bf=0; } /* Signed integer to string (%d) */ static void i2a (int num, char * bf) { if (num<0) { num=-num; *bf++ = '-'; } ui2a(num,10,0,bf); } /* Char to int conversion */ static int a2d(char ch) { if (ch>='0' && ch<='9') return ch-'0'; else if (ch>='a' && ch<='f') return ch-'a'+10; else if (ch>='A' && ch<='F') return ch-'A'+10; else return -1; } static char a2i(char ch, char** src, int base, int* nump) { char* p= *src; int num=0; int digit; while ((digit=a2d(ch))>=0) { if (digit>base) break; num=num*base+digit; ch=*p++; } *src=p; *nump=num; return ch; } static void putchw(void* putp, putcf putf, int n, char z, char* bf) { char fc=z? '0' : ' '; char ch; char* p=bf; while (*p++ && n > 0) n--; while (n-- > 0) putf(putp,fc); while ((ch= *bf++)) putf(putp,ch); } static void putcp(void* p,char c) { *(*((char**)p))++ = c; } static void _format(void* putp, putcf putf, char *fmt, va_list va) { char bf[256]; char ch; while ((ch=*(fmt++))) { if (ch!='%') // if not '%' print character as is putf(putp,ch); else { // otherwise do the print based on the format following '%' char lz=0; char lng=0; // long (i.e., 'l' specifier) int w=0; ch=*(fmt++); if (ch=='0') { // '0' specifier - padding with zeroes ch=*(fmt++); lz=1; } if (ch>='0' && ch<='9') { ch=a2i(ch,&fmt,10,&w); } if (ch=='l') { ch=*(fmt++); lng=1; } switch (ch) { case 0: break; case 'u': { if (lng) uli2a(va_arg(va, unsigned long int),10,0,bf); else ui2a(va_arg(va, unsigned int),10,0,bf); putchw(putp,putf,w,lz,bf); break; } case 'd': { if (lng) li2a(va_arg(va, unsigned long int),bf); else i2a(va_arg(va, int),bf); putchw(putp,putf,w,lz,bf); break; } case 'p': ptr2a(va_arg(va, void*), bf); putchw(putp,putf,w,lz,bf); break; case 'a': addr2a(va_arg(va, uintptr_t), bf); putchw(putp,putf,w,lz,bf); break; case 'b': bits2a(va_arg(va, long), w > 64 ? 64 : w ? w : 8, bf, 1); putchw(putp,putf,0,0,bf); break; case 'B': bits2a(va_arg(va, long), w > 64 ? 64 : w ? w : 8, bf, 0); putchw(putp,putf,0,0,bf); break; case 'v': pbits2a(va_arg(va, void*), w ? w : 8, bf, 1); putchw(putp,putf,0,0,bf); break; case 'V': pbits2a(va_arg(va, void*), w ? w : 8, bf, 0); putchw(putp,putf,0,0,bf); break; case 'x': case 'X': if (lng) uli2a(va_arg(va, unsigned long int),16,(ch=='X'),bf); else ui2a(va_arg(va, unsigned int),16,(ch=='X'),bf); putchw(putp,putf,w,lz,bf); break; case 'f' : { double num = va_arg(va, double); int ord = (int)num; i2a(ord,bf); putchw(putp,putf,w,lz,bf); putf(putp,'.'); num = num - ord; num *= 1000; ord = (int)num; i2a(ord,bf); putchw(putp,putf,w,lz,bf); break; } case 'c' : putf(putp,(char)(va_arg(va, int))); break; case 's' : putchw(putp,putf,w,0,va_arg(va, char*)); break; case '%' : putf(putp,ch); default: break; } } } } static void _charc_stdout (void* p, char c) { write(1,&c,1); } static void _charc_stderr (void* p, char c) { write(2,&c,1); } static void _charc_file (void* p, char c) { write((size_t)p,&c,1); } static void _charc_literal (void* p, char c) { switch(c) { case '\r': write((size_t)p,"\\r",2); break; case '\f': write((size_t)p,"\\f",2); break; case '\b': write((size_t)p,"\\b",2); break; case '\a': write((size_t)p,"\\a",2); break; case '\n': write((size_t)p,"\\n",2); break; case '\t': write((size_t)p,"\\t",2); break; case '\0': write((size_t)p,"\\0",2); break; default: write((size_t)p,&c,1); } } static int rtl_printf(char *fmt, ...) { va_list va; va_start(va,fmt); _format(NULL,_charc_stdout,fmt,va); va_end(va); return 1; } static int rtl_eprintf(char *fmt, ...) { va_list va; va_start(va,fmt); _format(NULL,_charc_stderr,fmt,va); va_end(va); return 1; } static int rtl_dprintf(int fd, char *fmt, ...) { va_list va; va_start(va,fmt); intptr_t fd_long = fd; _format((void*)fd_long,_charc_file,fmt,va); va_end(va); return 1; } static int rtl_sprintf(char* s, char *fmt, ...) { va_list va; va_start(va,fmt); _format(&s,putcp,fmt,va); putcp(&s,0); va_end(va); return 1; } #define STDOUT(...) rtl_printf(__VA_ARGS__) #define STDERR(...) rtl_eprintf(__VA_ARGS__) #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_rtl.c0000666000000000000000000001512113571573400021350 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_rtl.c * \brief RTL configuration and assembly ***************************************************************************/ /* Get default definitions and macros e.g., PATH_MAX */ #ifndef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 #endif #include "e_acsl_alias.h" #include "e_acsl_malloc.h" #include "e_acsl_string.h" #include "e_acsl_bits.h" #include "e_acsl_printf.h" #include "e_acsl_debug.h" #include "e_acsl_shexec.h" #include "e_acsl_trace.h" #include "e_acsl_assert.h" #include "e_acsl_floating_point.h" #include "e_acsl_safe_locations.h" #include "e_acsl_temporal_timestamp.h" #include "e_acsl.h" /* Memory model settings * Memory model: * E_ACSL_BITTREE_MMODEL - use Patricia-trie (tree-based) memory model, or * E_ACSL_SEGMENT_MMODEL - use segment-based (shadow) memory model * Verbosity level: * E_ACSL_VERBOSE - put an executable in verbose mode that * prints extra messages (unset by default) * Debug Features: * E_ACSL_DEBUG - enable debug features in RTL (unset by default) * E_ACSL_DEBUG_VERBOSE - verbose debug output (via DVLOG macro) * E_ACSL_DEBUG_LOG - name of the log file where debug messages are * output. The file name should be unquoted string with '-' * (set by default) indicating a standard stream * Validity: * E_ACSL_WEAK_VALIDITY - use notion of weak validity * Given an expression `(p+i)`, where `p` is a pointer and `i` is an * integer offset weak validity indicates that `(p+i)` is valid if it * belongs to memory allocation. In strong validity `(p+i)` is valid * iff both `p` and `(p+i)` belong to memory allocation and to the same * memory block. * Temporal analysis: * E_ACSL_TEMPORAL - enable temporal analysis in RTL * Assertions: * E_ACSL_NO_ASSERT_FAIL - do not issue abort signal of E-ACSL * assertion failure * E_ACSL_FAIL_EXITCODE - do not issue abort signal but exit with a * given code * Shadow spaces (only for segment model): * E_ACSL_STACK_SIZE - size (in MB) of the tracked program stack * E_ACSL_HEAP_SIZE - size (in MB) of the tracked program heap * String functions: * E_ACSL_NO_COMPILER_BUILTINS - if undefined (default) then use * compiler builtin string functions (e.g., memset -> __builtin_memset) * Behaviour of assert: * E_ACSL_EXTERNAL_ASSERT - if this macro is defined then function * `__e_acsl_assert` is excluded from compilation. This is to allow * providing alternative definitions of assertions by users. * Memory deallocation: * E_ACSL_FREE_VALID_ADDRESS -- Clause 7.20.3.2 of C99 standard states * that NULL is a valid input to free: * "The free function causes the space pointed to by ptr [its argument] * to be deallocated, that is, made available for further allocation. * If ptr is a null pointer, no action occurs." * Yet, some tools insist that it is a bug. For instance, there is a * bunch of test cases in Toyota ITC Benchmarks. To make such tools * happy the following option is introduced. By default it should be * undefined (disabled) though. */ /* Functionality tracking leaks is shared between models */ #include "e_acsl_leak.h" /* Print a header indicating current configuration of a run to STDIN. */ static void describe_run(); /* Select memory model, either segment-based or bittree-based model should be defined */ #if defined E_ACSL_SEGMENT_MMODEL # include "segment_model/e_acsl_segment_mmodel.c" #elif defined E_ACSL_BITTREE_MMODEL # include "bittree_model/e_acsl_bittree_mmodel.c" #else # error "No E-ACSL memory model defined. Aborting compilation" #endif /* Headers containing implementation of functions belonging to the E-ACSL external API shared across different memory models */ #include "e_acsl_libc_replacements.h" /* */ #include "e_acsl_format.h" /* format functions with error checking */ #include "e_acsl_temporal.h" /* temporal analysis */ #ifdef E_ACSL_WEAK_VALIDITY # define E_ACSL_VALIDITY_DESC "weak" #else # define E_ACSL_VALIDITY_DESC "strong" #endif /* Print basic configuration before each run */ static void describe_run() { #if defined(E_ACSL_VERBOSE) rtl_printf("/* ========================================================= */\n"); rtl_printf(" * E-ACSL instrumented run\n" ); rtl_printf(" * Memory tracking: %s\n", E_ACSL_MMODEL_DESC); #ifdef E_ACSL_SEGMENT_MMODEL rtl_printf(" * Heap %d MB\n", E_ACSL_HEAP_SIZE); rtl_printf(" * Stack %d MB\n", E_ACSL_STACK_SIZE); #endif rtl_printf(" * Temporal checks: %s\n", E_ACSL_TEMPORAL_DESC); rtl_printf(" * Execution mode: %s\n", E_ACSL_DEBUG_DESC); rtl_printf(" * Assertions mode: %s\n", E_ACSL_ASSERT_NO_FAIL_DESC); rtl_printf(" * Validity notion: %s\n", E_ACSL_VALIDITY_DESC); rtl_printf(" * Format Checks: %s\n", E_ACSL_FORMAT_VALIDITY_DESC); rtl_printf("/* ========================================================= */\n"); #endif } frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_safe_locations.h0000666000000000000000000000660513571573400023554 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_malloc.h * * \brief E-ACSL memory allocation bindings. ***************************************************************************/ /* Declaration of memory locations considered safe before a program starts. * Most of these should be declared somewhere in start procedures of c * and gcc libraries. One example of a safe location is errno. */ #ifndef E_ACSL_SAFE_LOCATIONS_H #define E_ACSL_SAFE_LOCATIONS_H #include #include #include /* Simple representation of a safe location */ struct memory_location { uintptr_t address; /* Address */ uintptr_t length; /* Byte-length */ int is_initialized; /* Notion of initialization */ }; typedef struct memory_location memory_location; /* An array storing safe locations up to `safe_location_counter` position. * This array should be initialized via a below function called * `collect_safe_locations`. */ static memory_location safe_locations [16]; static int safe_location_counter = 0; #define add_safe_location(_addr,_len,_init) { \ safe_locations[safe_location_counter].address = _addr; \ safe_locations[safe_location_counter].length = _len; \ safe_location_counter++; \ } #ifdef errno #undef errno extern __thread int errno; #endif extern FILE *stdin; /* Standard input stream. */ extern FILE *stdout; /* Standard output stream. */ extern FILE *stderr; /* Standard error output stream. */ static void collect_safe_locations() { /* Tracking of errno and standard streams */ add_safe_location((uintptr_t)&errno, sizeof(int), "errno"); add_safe_location((uintptr_t)stdout, sizeof(FILE), "stdout"); add_safe_location((uintptr_t)stderr, sizeof(FILE), "stderr"); add_safe_location((uintptr_t)stdin, sizeof(FILE), "stdin"); } #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_shexec.h0000666000000000000000000002057713571573400022046 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_shexec.h * \brief Interface for running shell commands ***************************************************************************/ #ifndef E_ACSL_SHEXEC_H #define E_ACSL_SHEXEC_H #include #include #include #include #include #include "e_acsl_string.h" /*! \class ipr_t * \brief Result struct for `shexec` function -- execute a command in the * shell via fork/exec and return results */ typedef struct { /** \brief resulting STDERR stream as \p const \p char* */ char *stderrs; /** \brief Supplied STDIN stream as \p const \p char* */ char *stdins; /** \brief resulting STDOUT stream as \p const \p char* */ char *stdouts; /** \brief Exit status of a program */ int exit_status; /** \brief ID of a child process this command has been executed in */ pid_t pid; /** \brief Set to non-zero if child process is interrupted via a signal */ int signaled; /** \brief If \p signalled is set, \p signo is set to the number of signal * that interrupted execution of a child process */ int signo; /** \brief A command to execute. Needs to be NULL terminated */ char **argv; /** \brief ARGV */ /** \brief Message if the command has failed to run */ char *error; } ipr_t; /* \brief Read characters from a buffer associated with a file descriptor into * a C string * * Read a string from a buffer associated with a file descriptor by allocating * a string of an initial size and increasing the size of a buffer with * realloc. This is for the cases when we can not quickly seek through the * file and identify the size of a buffer associated with a file descriptor * * \param fd - file descriptor to read from * \param bufsize - the number of characters we read a t a time * * \return NUL-terminated C string on success * \return NULL on failure */ static char* fd_read (int fd, short bufsize) { /* Read `buffer_size` chars at a time */ short buffer_size = bufsize*sizeof(char); /* Size of the fetched string */ int size = buffer_size; /* Buffer where for read data */ char *buffer = (char*)private_malloc(size); /* The number of read bytes */ short fetched = 0; int rd = 0; /* Count of fetched characters */ /* Each time the pointer is moved by `size - buffer_size`. * This is because initially the size of `buffer` is `buffer_size`. */ while ((fetched = read(fd, buffer + size - buffer_size, buffer_size))) { rd += fetched; if (fetched != -1) { size += fetched*sizeof(char); buffer = private_realloc(buffer, size + 1); } else { return NULL; } } buffer[rd] = '\0'; return buffer; } /* Execute a command in the shell and place results to data */ static ipr_t* __shexec (ipr_t *data) { int outfd[2], errfd[2], infd[2]; int oldstdout, oldstderr, oldstdin; if (pipe(infd)) /* From where parent is going to read */ data->error = nstrdup("Can not create a pipe for STDIN"); if (pipe(outfd)) /* From where parent is going to read */ data->error = nstrdup("Can not create a pipe for STDOUT"); if (pipe(errfd)) /* From where parent is going to read */ data->error = nstrdup("Can not create a pipe for STDERR"); /* Immediately return if reading from one of the STD pipes failed */ if (data->error) return data; /* Save stdin, stdout and stderr */ oldstdin = dup(0); oldstdout = dup(1); oldstderr = dup(2); /* Close stdin, stdout and stderr */ close(0); close(1); close(2); dup2(infd[0], 0); /* Make the read end of infd as STDIN */ dup2(outfd[1],1); /* Make the write end of outfd as STDOUT */ dup2(errfd[1],2); /* Make the write end of outfd as STDERR */ pid_t pid = fork(); if(!pid) { /* Close the streams as they are not required for a child */ close(infd[0]); close(outfd[0]); close(errfd[0]); close(infd[1]); close(outfd[1]); close(errfd[1]); execvp(data->argv[0],data->argv); if (errno) { data->error = nstrdup("Failed to execute:\n "); char **arg = data->argv - 1; while(*++arg) data->error = sappend(*arg, data->error, " "); } } else { close(0); close(1); close(2); dup2(oldstdin, 0); dup2(oldstdout,1); dup2(oldstderr,2); close(outfd[1]); close(errfd[1]); close(infd[0]); /* If data->stdin string is supplied, write that string to the child's stdin first */ if (data->stdins) /* Return NULL if write fails */ if (write(infd[1], data->stdins, strlen(data->stdins)) == -1) return NULL; /* Read from child's stdout and stderr */ data->stdouts = fd_read(outfd[0], 256); if (!data->stdouts) data->error = nstrdup("Error reading from STDOUT pipe"); data->stderrs = fd_read(errfd[0], 256); if (!data->stderrs) data->error = nstrdup("Error reading from STDERR pipe"); /* Close file descriptors that are still open */ close(outfd[0]); /* read end of STDOUT */ close(errfd[0]); /* read end of STDERR */ close(infd[1]); /* write end of STDIN */ int status; waitpid(pid, &status, 0); /* wait for the child to finish */ data->exit_status = WEXITSTATUS(status); /* exit status */ data->pid = pid; /* process number */ data->signaled = WIFSIGNALED(status); /* signal caught */ data->signo = WTERMSIG(status); /* signal number caught */ return data; } return NULL; } /* \brief Deallocate an `ipr_t` structure returned by `shexec` */ static void free_ipr (ipr_t* ipr) { if (ipr) { if (ipr->stdouts) private_free(ipr->stdouts); if (ipr->stderrs) private_free(ipr->stderrs); if (ipr->error) private_free(ipr->error); if (ipr->stdins) private_free(ipr->stdins); private_free(ipr); } } /* \brief Execute a command given via parameter `data` in the current shell * and return the dynamically allocated struct `ipr_t` which captures the * results of the command's execution. * * \param data - command to execute. `data` is expected to be a NULL-terminated * array of C strings. * \param sin - if not NULL, a C string given via `sin` is supplied as standard * input to the executed command. * \return - heap-allocated struct `ipr_t` which describes the output of the * executed command. Deallocation of this struct must be performed via the * `free_ipr` function. */ static ipr_t* shexec (char **data, const char *sin) { /* Allocate and initialise the `ipr_t` struct to store the results * of the command execution */ ipr_t *ipr = (ipr_t*)private_malloc(sizeof(ipr_t)); ipr->stderrs = NULL; ipr->stdouts = NULL; ipr->stdins = nstrdup(sin); ipr->argv = data; ipr->exit_status = 0; ipr->pid = 0; ipr->signaled = 0; /* Run the command returning a pointer to `ipr_t` */ return __shexec(ipr); } #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_string.h0000666000000000000000000001261013571573400022062 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_string.h * \brief Replacement of system-wide \p header for use with E-ACSL * runtime library. * * Intended use: * - For the case when the sources are compiled using GCC prefer \p __builtin_ * versions of some of the string.h functions (e.g., \p memset). This is * mostly because the GCC builtins are on average faster. * - For the case it is not GCC system-wide versions should be used. This * and the above options require \p E_ACSL_BUILTINS macro to be defined * at compile-time. * - For the case when the analysed program contains customised definitions * of string.h functions use GLIBC-based implementations. ***************************************************************************/ #ifndef E_ACSL_STD_STRING_H #define E_ACSL_STD_STRING_H #ifndef E_ACSL_NO_COMPILER_BUILTINS # define memset __builtin_memset # define memcmp __builtin_memcmp # define memcpy __builtin_memcpy # define memmove __builtin_memmove # define strncat __builtin_strncat # define strcat __builtin_strcat # define strlen __builtin_strlen # define strcmp __builtin_strcmp # define strncmp __builtin_strncmp # define strcpy __builtin_strcpy # define strncpy __builtin_strncpy # define strchr __builtin_strchr #else # include #endif #include #include "e_acsl_malloc.h" /* \brief Local version of `strcat` */ static char *nstrcat(char *dest, const char *src) { memcpy(dest + strlen(dest), src, strlen(src) + 1); return dest; } /* \brief Local version of `strdup` */ static char *nstrdup(const char *s) { if (s) { size_t len = strlen(s) + 1; void *n = private_malloc(len); return (n == NULL) ? NULL : (char*)memcpy(n, s, len); } return NULL; } /* \brief Append `src` to `dest` by re-allocating `dest`. * * `sappend` assumes that `dest` is either NULL (in which case it is * allocated on the heap) or a heap-allocated C string that can be passed * as an input to realloc. If `delim` and `dest` are not NULLs them string * `delim` is appended to `dest` before `src` * * \return Result of concatenation of `dest` and `src` */ static char *sappend(char *dest, const char *src, const char *delim) { if (!dest && src) dest = nstrdup(src); else if (src && dest) { size_t ldelim = delim ? strlen(delim) : 0; size_t len = strlen(src) + strlen(dest) + 1; if (ldelim) len += ldelim; dest = private_realloc(dest, len); if (ldelim) dest = nstrcat(dest, delim); dest = nstrcat(dest, src); } return dest; } /** \brief Return 0 if C string `str` ends with string `pat` and a non-zero * value otherwise. The function assumes that both, `str` and `path` are valid, * NUL-terminated C strings. If any of the input strings are NULLs, a non-zero * value is returned. */ static int endswith(char *str, char *pat) { if (str && pat) { size_t slen = strlen(str); size_t plen = strlen(pat); if (slen >= plen) { str += slen - plen; return strncmp(str, pat, plen); } } return 1; } #define ZERO_BLOCK_SIZE 1024 static unsigned char zeroblock [ZERO_BLOCK_SIZE]; /** \brief Return a non-zero value if `size` bytes past address `p` are * nullified and zero otherwise. */ static int zeroed_out(const void *p, size_t size) { size_t lim = size/ZERO_BLOCK_SIZE, rem = size%ZERO_BLOCK_SIZE; unsigned char *pc = (unsigned char *)p; size_t i; for (i = 0; i < lim; i++) { if (memcmp(pc, &zeroblock, ZERO_BLOCK_SIZE)) return 0; pc += ZERO_BLOCK_SIZE; } return !memcmp(pc, &zeroblock, rem); } /** \brief Count the number of occurrences of char `c` in a string `s` */ static int charcount(const char *s, char c) { int count = 0; while ((s = strchr(s,c)) != NULL) { count++; s++; } return count; } #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_temporal.h0000666000000000000000000001453413571573400022406 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_temporal.h * \brief Implementation of the tenporal API shared by all models ***************************************************************************/ #ifndef E_ACSL_TEMPORAL_H #define E_ACSL_TEMPORAL_H #include "e_acsl_temporal_timestamp.h" #ifdef E_ACSL_TEMPORAL #define E_ACSL_TEMPORAL_DESC "enabled" /* Temporal timestamp retrieval [forward declarations] {{{ */ /*! \brief Return origin time stamp associated with a memory block containing * address given by `ptr`. `0` indicates an invalid timestamp, i.e., timestamp * of a memory block which does not exist. */ static uint32_t origin_timestamp(void *ptr); /*! \brief Return address of referent shadow */ static uintptr_t temporal_referent_shadow(void *addr); /*! \brief Return referent time stamp associated with a pointer which address * is given by `ptr`. This function expects that `ptr` is allocated and at * least `sizeof(uintptr_t)` bytes long */ uint32_t referent_timestamp(void *ptr); /*! \brief Store a referent number `ref` in the shadow of `ptr` */ void store_temporal_referent(void *ptr, uint32_t ref); /* }}} */ /* Temporal store {{{ */ void temporal_store_nblock(void *lhs, void *rhs) { store_temporal_referent(lhs, origin_timestamp(rhs)); } void temporal_store_nreferent(void *lhs, void *rhs) { store_temporal_referent(lhs, referent_timestamp(rhs)); } /* }}} */ /* Memcpy/memset {{{ */ void temporal_memcpy(void *dest, void *src, size_t size) { /* Memcpy is only relevant for pointers here, so if there is a * copy under a pointer's size then there no point in copying memory*/ if (size >= sizeof(void*)) { DVALIDATE_ALLOCATED(src, size, src); DVALIDATE_WRITEABLE(dest, size, dest); void *dest_shadow = (void *)temporal_referent_shadow(dest); void *src_shadow = (void *)temporal_referent_shadow(src); memcpy(dest_shadow, src_shadow, size); } } void temporal_memset(void *dest, int c, size_t size) { DVALIDATE_WRITEABLE(dest, size, dest); void *dest_shadow = (void *)temporal_referent_shadow(dest); memset(dest_shadow, 0, size); } /* }}} */ /* Function parameters {{{ */ void temporal_save_nblock_parameter(void *ptr, unsigned int param) { parameter_referents[param].ptr = ptr; parameter_referents[param].temporal_flow = TBlockN; } void temporal_save_nreferent_parameter(void *ptr, unsigned int param) { parameter_referents[param].ptr = ptr; parameter_referents[param].temporal_flow = TReferentN; } void temporal_save_copy_parameter(void *ptr, unsigned int param) { parameter_referents[param].ptr = ptr; parameter_referents[param].temporal_flow = TCopy; } void temporal_pull_parameter(void *ptr, unsigned int param, size_t size) { struct temporal_parameter *tpar = ¶meter_referents[param]; switch(tpar->temporal_flow) { case TBlockN: store_temporal_referent(ptr, origin_timestamp(tpar->ptr)); break; case TReferentN: store_temporal_referent(ptr, referent_timestamp(tpar->ptr)); break; case TCopy: temporal_memcpy(ptr, tpar->ptr, size); break; default: vassert(0, "Unreachable", NULL); } } void temporal_reset_parameters() { reset_parameter_referents(); } /* }}} */ /* Return values {{{ */ void temporal_save_return(void *ptr) { return_referent = (ptr, sizeof(void*)) ? referent_timestamp(ptr) : 0; } void temporal_pull_return(void *ptr) { store_temporal_referent(ptr, return_referent); } void temporal_reset_return() { return_referent = 0; } /* }}} */ /* Temporal valid {{{ */ int temporal_valid(void *ptr, void *addr_of_ptr) { /* Could check for NULL, but since temporal_valid if ran by `valid`, this * has been already checked. * FIXME: If the address of pointer and the pointer itself reference the same * address the access is deemed temporally valid by default. * One issue associated with such checking is the case when a pointer points * to itself. One way to address such issue is to mark pointers, arrays and * integers differently. Here one can use the "readonly" bit to mark * something which does not need to be checked (e.g. arrays) and then * recognise this mark. Blocks can be recognised as readonly by using range * checking. For instance if some existing block belongs to a text segment * then it is readonly. */ if (addr_of_ptr && (uintptr_t)ptr != (uintptr_t)addr_of_ptr) { /* The case where there is an actual pointer pointing to some memory * chunk, otherwise temporal valid holds trivially since the block points * to itself */ uint32_t stored_referent = referent_timestamp(addr_of_ptr); uint32_t actual_referent = origin_timestamp(ptr); return stored_referent == actual_referent; } return 1; } /* }}} */ #else # define E_ACSL_TEMPORAL_DESC "disabled" #endif #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_temporal_timestamp.h0000666000000000000000000000666613571573400024500 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_temporal_timestamp.h * \brief Generating temporal timestamps ***************************************************************************/ #ifndef E_ACSL_TEMPORAL_TIMESTAMP_H /*{{{*/ #define E_ACSL_TEMPORAL_TIMESTAMP_H #include #ifdef E_ACSL_TEMPORAL /*{{{*/ /*! Temporal time stamp generator variable * Time stamp is generated by incrementing `temporal_timestamp` variable. * Value distribution is as follows: * `0` - invalid time stamp, i.e., a pointer carrying the referent of 0 does * not point to anything * `1` - timestamp associated with global variables, i.e., each global variable * has allocation time stamp of '1' * `>1` - heap or stack blocks allocated during a program's execution */ static uint32_t temporal_timestamp = 2; #define INVALID_TEMPORAL_TIMESTAMP 0 #define GLOBAL_TEMPORAL_TIMESTAMP 1 #define NEW_TEMPORAL_TIMESTAMP() (++temporal_timestamp) /*! Maximal number of parameters a function can accept * [ C99, 5.2.4.1 Translation Limits ] */ #define MAX_PARAMETERS 127 struct temporal_parameter { void *ptr; /* Number all members such that there is no `0` which potentially corresponds to an invalid number */ enum { TBlockN = 10, TReferentN = 20, TCopy = 30 } temporal_flow; }; typedef struct temporal_parameter temporal_parameter; /*! \brief External array used to transfer parameters from one function * to another. * * WARNING! NOT thread-safe! A better way would probably have it as * __thread so it is local to every thread. */ static temporal_parameter parameter_referents[MAX_PARAMETERS]; static uint32_t return_referent; #define reset_parameter_referents() \ memset(parameter_referents, 0, sizeof(parameter_referents)) #endif /*}}} E_ACSL_TEMPORAL */ #endif /*}}} E_ACSL_TEMPORAL_TIMESTAMP */ frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/e_acsl_trace.h0000666000000000000000000001021613571573400021652 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_trace.h * \brief Interface for producing backtrace. Requires GLIBC. ***************************************************************************/ #ifndef E_ACSL_TRACE_H #define E_ACSL_TRACE_H #include #include #include "e_acsl_printf.h" #include "e_acsl_shexec.h" extern void *__libc_stack_end; struct frame_layout { void *next; void *return_address; }; /* The following implementation of malloc-free backtrace [native_backtrace] is mostly taken from Glibc-2.22 (see file debug/backtrace.c) */ static int native_backtrace (void **array, int size) { struct frame_layout *current; void *top_frame, *top_stack; int cnt = 0; top_frame = __builtin_frame_address(0); /* Some notion of current stack. Need not be exactly the top of the stack, just something somewhere in the current frame. */ top_stack = ({ char __csf; &__csf; }); /* We skip the call to this function, it makes no sense to record it. */ current = ((struct frame_layout *) top_frame); while (cnt < size) { /* Assume that the stack grows downwards */ if ((void *) current < top_stack || !((void *) current < __libc_stack_end)) /* This means the address is out of range. Note that for the toplevel we see a frame pointer with value NULL which clearly is out of range. */ break; array[cnt++] = current->return_address; current = ((struct frame_layout *) (current->next)); } return cnt; } static void trace() { # ifdef __linux__ int size = 24; void **bb = private_malloc(sizeof(void*)*size); native_backtrace(bb, size); char executable [PATH_MAX]; rtl_sprintf(executable, "/proc/%d/exe", getpid()); STDOUT("/** Backtrace **************************/\n"); int counter = 0; while (*bb) { char *addr = (char*)private_malloc(21); rtl_sprintf(addr,"%p", *bb); char *ar[] = { "addr2line", "-f", "-p", "-C", "-s", "-e", executable, addr, NULL}; ipr_t *ipr = shexec(ar, NULL); char *prefix = (counter) ? " - " : ""; if (ipr) { char *outs = (char*)ipr->stdouts; if (outs) { outs[strlen(outs)-1] = '\0'; if (strlen(outs) && endswith(outs, "??:0") && endswith(outs, "??:?")) { STDOUT("%s%s\n", prefix, outs); } } else { char *errs = (char*)ipr->stderrs; if (errs) { STDOUT("%s\n", errs); } } } bb++; counter++; } STDOUT("/***************************************/\n"); # endif /* __linux__ */ } #endif frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/segment_model/0000777000000000000000000000000013571573400021717 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/segment_model/e_acsl_segment_mmodel.c0000666000000000000000000002356513571573400026403 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_segment_mmodel.c * \brief Implementation of E-ACSL public API for a segment (shadow) memory * model. See e_acsl.h for details. ***************************************************************************/ #include #include #include "e_acsl_shadow_layout.h" #include "e_acsl_segment_tracking.h" #define E_ACSL_MMODEL_DESC "shadow memory" void * store_block(void *ptr, size_t size) { /* Only stack-global memory blocks are recorded explicitly via this function. Heap blocks should be tracked internally using memory allocation functions such as malloc or calloc. */ shadow_alloca(ptr, size); return ptr; } void delete_block(void *ptr) { /* Block deletion should be performed on stack/global addresses only, * heap blocks should be deallocated manually via free/cfree/realloc. */ shadow_freea(ptr); } void * store_block_duplicate(void *ptr, size_t size) { if (allocated((uintptr_t)ptr, size, (uintptr_t)ptr)) delete_block(ptr); shadow_alloca(ptr, size); return ptr; } /*! \brief Initialize a chunk of memory given by its start address (`addr`) * and byte length (`n`). */ void initialize(void *ptr, size_t n) { TRY_SEGMENT( (uintptr_t)ptr, initialize_heap_region((uintptr_t)ptr, n), initialize_static_region((uintptr_t)ptr, n) ) } void full_init(void *ptr) { initialize(ptr, _block_length(ptr)); } void mark_readonly(void *ptr) { mark_readonly_region((uintptr_t)ptr, _block_length(ptr)); } /* ********************** */ /* E-ACSL annotations {{{ */ /* ********************** */ int valid(void *ptr, size_t size, void *ptr_base, void *addrof_base) { return allocated((uintptr_t)ptr, size, (uintptr_t)ptr_base) && !readonly(ptr) #ifdef E_ACSL_TEMPORAL && temporal_valid(ptr_base, addrof_base) #endif ; } int valid_read(void *ptr, size_t size, void *ptr_base, void *addrof_base) { return allocated((uintptr_t)ptr, size, (uintptr_t)ptr_base) #ifdef E_ACSL_TEMPORAL && temporal_valid(ptr_base, addrof_base) #endif ; } /*! NB: The implementation for this function can also be specified via \p _base_addr macro that will eventually call ::TRY_SEGMENT. The following implementation is preferred for performance reasons. */ void * base_addr(void *ptr) { TRY_SEGMENT(ptr, return (void*)heap_info((uintptr_t)ptr, 'B'), return (void*)static_info((uintptr_t)ptr, 'B')); return NULL; } /*! NB: Implementation of the following function can also be specified via \p _block_length macro. A more direct approach via ::TRY_SEGMENT is preferred for performance reasons. */ size_t block_length(void *ptr) { TRY_SEGMENT(ptr, return heap_info((uintptr_t)ptr, 'L'), return static_info((uintptr_t)ptr, 'L')) return 0; } size_t offset(void *ptr) { TRY_SEGMENT(ptr, return heap_info((uintptr_t)ptr, 'O'), return static_info((uintptr_t)ptr, 'O')); return 0; } int initialized(void *ptr, size_t size) { uintptr_t addr = (uintptr_t)ptr; TRY_SEGMENT_WEAK(addr, return heap_initialized(addr, size), return static_initialized(addr, size)); return 0; } /* }}} */ /* Track program arguments (ARGC/ARGV) {{{ */ /* POSIX-compliant array of character pointers to the environment strings. */ extern char ** environ; static void argv_alloca(int *argc_ref, char *** argv_ref) { /* Track a top-level containers */ shadow_alloca((void*)argc_ref, sizeof(int)); shadow_alloca((void*)argv_ref, sizeof(char**)); int argc = *argc_ref; char** argv = *argv_ref; /* Track argv */ size_t argvlen = (argc + 1)*sizeof(char*); shadow_alloca(argv, argvlen); initialize_static_region((uintptr_t)argv, (argc + 1)*sizeof(char*)); /* Track argument strings */ while (*argv) { /* Account for `\0` when copying C strings */ size_t arglen = strlen(*argv) + 1; #ifdef E_ACSL_TEMPORAL /* Move `argv` strings to heap. This is because they are allocated sparcely and there is no way to align they (if they are small), so there may no be sufficient space for storing origin time stamps. Generally speaking, this is not the best of ideas, more of a temporary fix to avoid various range comparisons. A different approach is therefore more than welcome. */ *argv = shadow_copy(*argv, arglen, 1); /* TODO: These heap allocations are never freed in fact. Not super important, but for completeness purposes it may be feasible to define a buffer of implicitly allocated memory locations which need to be freed before a program exists. */ #else shadow_alloca(*argv, arglen); initialize_static_region((uintptr_t)*argv, arglen); #endif argv++; } #ifdef E_ACSL_TEMPORAL /* Fill temporal shadow */ int i; argv = *argv_ref; temporal_store_nblock(argv_ref, *argv_ref); for (i = 0; i < argc; i++) temporal_store_nblock(argv + i, *(argv+i)); #endif while (*environ) { size_t envlen = strlen(*environ) + 1; #ifdef E_ACSL_TEMPORAL *environ = shadow_copy(*environ, envlen, 1); #else shadow_alloca(*environ, envlen); initialize_static_region((uintptr_t)*environ, envlen); #endif environ++; } } /* }}} */ /* Program initialization {{{ */ extern int main(void); void mspaces_init() { /* [already_run] avoids reentrancy issue (see Gitlab issue #83), e.g. in presence of a GCC's constructors that invokes malloc possibly several times before calling main. */ static char already_run = 0; if (! already_run) { describe_run(); make_memory_spaces(64*MB, get_heap_size()); /* Allocate and log shadow memory layout of the execution. Case of the heap, globals and tls. */ init_shadow_layout_heap_global_tls(); already_run = 1; } } void memory_init(int *argc_ref, char *** argv_ref, size_t ptr_size) { /* [already_run] avoids reentrancy issue (see Gitlab issue #83), e.g. in presence of a recursive call to 'main' */ static char already_run = 0; if (! already_run) { mspaces_init(); /* Verify that the given size of a pointer matches the one in the present architecture. This is a guard against Frama-C instrumentations using architectures different to the given one. */ arch_assert(ptr_size); /* Initialize report file with debug logs (only in debug mode). */ initialize_report_file(argc_ref, argv_ref); /* Lift stack limit to account for extra stack memory overhead. */ increase_stack_limit(get_stack_size()*2); /* Allocate and log shadow memory layout of the execution. Case of stack. */ init_shadow_layout_stack(argc_ref, argv_ref); //DEBUG_PRINT_LAYOUT; /* Make sure the layout holds */ DVALIDATE_SHADOW_LAYOUT; /* Track program arguments. */ if (argc_ref && argv_ref) argv_alloca(argc_ref, argv_ref); /* Track main function */ shadow_alloca(&main, sizeof(&main)); initialize_static_region((uintptr_t)&main, sizeof(&main)); /* Tracking safe locations */ collect_safe_locations(); int i; for (i = 0; i < safe_location_counter; i++) { void *addr = (void*)safe_locations[i].address; uintptr_t len = safe_locations[i].length; shadow_alloca(addr, len); if (safe_locations[i].is_initialized) initialize(addr, len); } init_infinity_values(); already_run = 1; } } void memory_clean(void) { clean_shadow_layout(); report_heap_leaks(); } /* }}} */ /* Local operations on temporal timestamps {{{ */ /* Remaining functionality (shared between all models) is located in e_acsl_temporal.h */ #ifdef E_ACSL_TEMPORAL static uintptr_t temporal_referent_shadow(void *addr) { TRY_SEGMENT(addr, return TEMPORAL_HEAP_SHADOW(addr), return TEMPORAL_SECONDARY_STATIC_SHADOW(addr)); return 0; } static uint32_t origin_timestamp(void *ptr) { TRY_SEGMENT_WEAK(ptr, return heap_origin_timestamp((uintptr_t)ptr), return static_origin_timestamp((uintptr_t)ptr)); return INVALID_TEMPORAL_TIMESTAMP; } static uint32_t referent_timestamp(void *ptr) { TRY_SEGMENT(ptr, return heap_referent_timestamp((uintptr_t)ptr), return static_referent_timestamp((uintptr_t)ptr)); return INVALID_TEMPORAL_TIMESTAMP; } static void store_temporal_referent(void *ptr, uint32_t ref) { TRY_SEGMENT(ptr, heap_store_temporal_referent((uintptr_t)ptr, ref), static_store_temporal_referent((uintptr_t)ptr,ref)); } #endif /* }}} */ frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/segment_model/e_acsl_segment_tracking.h0000666000000000000000000016410113571573400026725 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_segment_tracking.h * \brief Core functionality of the segment-based memory model ***************************************************************************/ /* Segment settings and shadow values interpretation {{{ */ /* This file implements segment-based and offset-based shadow memory models * (shadow encodings) (see draft of the PLDI'17 paper). * * IMPORTANT: While the implementation of the offset-based encoding mostly * follows the description given by the paper, there are differences in the * segment-based encoding for tracking heap memory. Some of these differences * are as follows: * 1) Size of a heap segment is increased to 32 bytes * 2) Heap meta-segments are no longer used, segment-based representation of * a heap block considers only block segments, such that: * - Lowest `intptr_t` bytes of each shadow segment tracking an application * block store the base address of that block; * - `intptr_t` bytes of the first segment following the initial `intptr_t` * bytes store the length of the block. Note, the length is only stored * by the first segment. * 3) Per-byte initialization of application bytes is tracked via a disjoint * shadow region, which maps one bit of shadow memory to a byte of * application memory. Comments within this file often refer to a shadow * region tracking application blocks by segments as to `block shadow`, * and to the region tracking initialization as to `init shadow`. */ /*! @brief Byte size of a heap segment. * This size is potentially used as an argument to `memalign`. * It SHOULD be a multiple of 2 and a multiple of a pointer size. * * \b FIXME: in the current implementation there might be issues with segment * size greater than 64 bytes. This is because presently some initialization * functionality relies on the fact that initialization per segment can be set * and/or evaluated using an 8-byte bitmask. */ #define HEAP_SEGMENT 32 /*! \brief Size (in bytes) of a long block on the stack. */ #define LONG_BLOCK 8 /*! \brief Bit offset in a primary shadow byte that represents initialization. */ #define INIT_BIT 0 /*! \brief Bit offset in a primary shadow byte that represents read-only or * read-write access. * * This is such that the value of 1 is read-only, and 0 is read/write */ #define READONLY_BIT 1 /*! \brief Evaluate to a non-zero value if the size of a memory * block indicates that it is a long one */ #define IS_LONG_BLOCK(_size) (_size > LONG_BLOCK) /*! \brief Offset within a long block that identifies the portion of the block * that does not have a corresponding shadow and reuse the shadow of a previous * segment. * E.g., given a long block of 11 bytes the boundary is 8. Then, bytes [0,7] of * the block are shadowed (storing block offset and size) and bytes 8-10 are * not. This is because 3 bytes are not sufficient to store size and offset. * These remaining bytes reuse the shadow of [0,7]. */ #define LONG_BLOCK_BOUNDARY(_size) (_size - _size%LONG_BLOCK) /*! \brief Primary shadow of a long block consists of a 8-byte segment + a * remainder. For instance, a 18-byte block is represented by two 8-byte * segments + 2 bytes. Each byte of a segment stores an offset in the secondary * shadow. The offsets for each such segment can be expressed using the * following number obtained by compressing all eight bytes with offsets set * into a single block. */ #define LONG_BLOCK_MASK 15913703276567643328UL /*! \brief 6 higher bytes of a memory cell on stack that belongs to a long * memory block store offsets relative to meta-data in the secondary shadow. The * offsets start with the below number. E.g., if the bits store 51, then the * offset at which to read meta-data is (51 - 48). */ #define LONG_BLOCK_INDEX_START 48 /*! \brief Decrease _n to be a multiple of _m */ #define ALIGN_LEFT(_n, _m) (_n - _n%_m) /*! \brief Increase _n to be a multiple of _m */ #define ALIGN_RIGHT(_n, _m) (_n + ((_n%_m) ? (_m - _n%_m) : 0)) /*! \brief Heap shadow address aligned at a segment boundary */ #define ALIGNED_HEAP_SHADOW(_addr) \ HEAP_SHADOW(ALIGN_LEFT(_addr,HEAP_SEGMENT)) /* \brief Maximal size_t value that does not cause overflow via addition * when segment size is added. */ static const size_t max_allocated = ALIGN_LEFT(SIZE_MAX,HEAP_SEGMENT); /* \brief Return actual allocation size which takes into account aligned * allocation. In the present implementation it is the requested size of * a heap block aligned at a segment boundary */ #define ALLOC_SIZE(_s) \ (_s < max_allocated ? ALIGN_RIGHT(_s, HEAP_SEGMENT) : 0) /** \brief Evaluate to `true` if address _addr belongs to a memory block * with base address _base and length _length */ #define BELONGS(_addr, _base, _length) \ (_addr >= _base && _addr < _base + _length) /*! \brief For short blocks numbers 1 to 36 represent lengths and offsets, * such that: * - 0 -> length 0, offset 0 * - 1 -> length 1, offset 0, * - 2 -> length 2, offset 0, * - 3 -> length 2, offset 1 and so on. * * The below data is used to identify lengths and offsets: * Given x is a number from [1, 36] range: * - short_lengths[x] -> length of a block * - short_offsets[x] -> offset within a block */ static const char short_lengths[] = { 0, 1, 2,2, 3,3,3, 4,4,4,4, 5,5,5,5,5, 6,6,6,6,6,6, 7,7,7,7,7,7,7, 8,8,8,8,8,8,8,8 }; static const char short_offsets[] = { 0, 0, 0,1, 0,1,2, 0,1,2,3, 0,1,2,3,4, 0,1,2,3,4,5, 0,1,2,3,4,5,6, 0,1,2,3,4,5,6,7 }; /*! \brief Mask for marking a heap segment as initialized. * For instance, let `uintptr_t *p' point to the start of a heap segment * in the heap shadow, then 'p[1] | heap_init_mask` sets initialization bits. * NOTE: This approach cannot deal with segments larger than 64 bits. */ static const uint64_t heap_init_mask = ~(ONE << HEAP_SEGMENT); /*! \brief Masks for checking of initialization of global/stack allocated blocks. * A byte allocated globally or on stack is deemed initialized if its * least significant bit is set to `1' and uninitialized otherwise. * The binary representation is then as follows (assuming the leftmost * bit is the least significant one): * * 00000000 00000000 00000000 00000000 ... (0) * 10000000 00000000 00000000 00000000 ... (1) * 10000000 10000000 00000000 00000000 ... (257) * 10000000 10000000 10000000 00000000 ... (65793) * 10000000 10000000 10000000 10000000 ... (16843009) * ... * * For instance, mark first X bytes of a number N as initialised: * N |= static_init_masks[X] */ static const uint64_t static_init_masks [] = { 0, /* 0 bytes */ 1, /* 1 byte */ 257, /* 2 bytes */ 65793, /* 3 bytes */ 16843009, /* 4 bytes */ 4311810305, /* 5 bytes */ 1103823438081, /* 6 bytes */ 282578800148737, /* 7 bytes */ 72340172838076673 /* 8 bytes */ }; /*! \brief Bit masks for setting read-only (second least significant) bits. * Binary representation (assuming the least significant bit is the * leftmost bit) is follows: * * 00000000 00000000 00000000 00000000 ... (0) * 01000000 00000000 00000000 00000000 ... (2) * 01000000 01000000 00000000 00000000 ... (514) * 01000000 01000000 01000000 00000000 ... (131586) * 01000000 01000000 01000000 01000000 ... (33686018) * ... * * For instance, mark first X bytes of a number N as read-only: * N |= static_readonly_masks[X] */ static const uint64_t static_readonly_masks [] = { 0, /* 0 bytes */ 2, /* 1 byte */ 514, /* 2 bytes */ 131586, /* 3 bytes */ 33686018, /* 4 bytes */ 8623620610, /* 5 bytes */ 2207646876162, /* 6 bytes */ 565157600297474, /* 7 bytes */ 144680345676153346 /* 8 bytes */ }; /* }}} */ /* Runtime assertions (debug mode) {{{ */ #ifdef E_ACSL_DEBUG #define DVALIDATE_ALIGNMENT(_addr) \ DVASSERT(((uintptr_t)_addr) % HEAP_SEGMENT == 0, \ "Heap base address %a is unaligned", _addr) #define DVALIDATE_MEMORY_INIT \ DVASSERT(mem_layout.is_initialized != 0, "Un-initialized shadow layout", NULL) /* Debug function making sure that the order of program segments is as expected * and that the program and the shadow segments used do not overlap. */ static void validate_shadow_layout() { /* Check that the struct holding memory layout is marked as initialized. */ DVALIDATE_MEMORY_INIT; /* Each segment has 3 partitions: - application memory - primary/secondary shadows */ int num_partitions = sizeof(mem_partitions)/sizeof(memory_partition*); int num_seg_in_part = 3; #ifdef E_ACSL_TEMPORAL num_seg_in_part = 5; #endif int num_segments = num_partitions*num_seg_in_part; uintptr_t segments[num_segments][2]; size_t i; for (i = 0; i < num_partitions; i++) { memory_partition *p = mem_partitions[i]; segments[num_seg_in_part*i][0] = p->application.start; segments[num_seg_in_part*i][1] = p->application.end; segments[num_seg_in_part*i+1][0] = p->primary.start; segments[num_seg_in_part*i+1][1] = p->primary.end; segments[num_seg_in_part*i+2][0] = p->secondary.start; segments[num_seg_in_part*i+2][1] = p->secondary.end; #ifdef E_ACSL_TEMPORAL segments[num_seg_in_part*i+3][0] = p->temporal_primary.start; segments[num_seg_in_part*i+3][1] = p->temporal_primary.end; segments[num_seg_in_part*i+4][0] = p->temporal_secondary.start; segments[num_seg_in_part*i+4][1] = p->temporal_secondary.end; #endif } /* Make sure all segments (shadow or otherwise) are disjoint */ size_t j; for (int i = 0; i < num_segments; i++) { uintptr_t *src = segments[i]; DVASSERT(src[0] < src[1], "Segment start is greater than segment end %lu < %lu\n", src[0], src[1]); for (j = 0; j < num_segments; j++) { if (i != j) { uintptr_t *dest = segments[j]; DVASSERT(src[1] < dest[0] || src[0] > dest[1], "Segment [%lu, %lu] overlaps with segment [%lu, %lu]", src[0], src[1], dest[0], dest[1]); } } } } /* Assert that memory layout has been initialized and all segments appear * in the expected order */ # define DVALIDATE_SHADOW_LAYOUT validate_shadow_layout() /* Assert that boundaries of a block [_addr, _addr+_size] are within a segment * given by `_s`. `_s` is either HEAP, STACK, TLS, GLOBAL or STATIC. */ #define DVALIDATE_IS_ON(_addr, _size, _s) \ DVASSERT(IS_ON_##_s(_addr), "Address %a not on %s", _addr, #_s); \ DVASSERT(IS_ON_##_s(_addr+_size), "Address %a not on %s", _addr+_size, #_s) /* Assert that [_addr, _addr+_size] are within heap segment */ #define DVALIDATE_IS_ON_HEAP(_addr, _size) \ DVALIDATE_IS_ON(_addr, _size, HEAP) /* Assert that [_addr, _addr+_size] are within stack segment */ #define DVALIDATE_IS_ON_STACK(_addr, _size) \ DVALIDATE_IS_ON(_addr, _size, STACK) /* Assert that [_addr, _addr+_size] are within global segment */ #define DVALIDATE_IS_ON_GLOBAL(_addr, _size) \ DVALIDATE_IS_ON(_addr, _size, GLOBAL) /* Assert that [_addr, _addr+_size] are within TLS segment */ #define DVALIDATE_IS_ON_TLS(_addr, _size) \ DVALIDATE_IS_ON(_addr, _size, TLS) /* Assert that [_addr, _addr+_size] are within stack, global or TLS segments */ #define DVALIDATE_IS_ON_STATIC(_addr, _size) \ DVALIDATE_IS_ON(_addr, _size, STATIC) /* Assert that `_addr` is on heap and it is the base address of an allocated * heap memory block */ #define DVALIDATE_FREEABLE(_addr) \ DVASSERT(IS_ON_HEAP(_addr), "Expected heap location: %a\n", _addr); \ DVASSERT(_addr == _base_addr(_addr), \ "Expected base address, i.e., %a, not %a\n", _base_addr(_addr), _addr); /* Assert that a memory block [_addr, _addr + _size] is allocated on a * program's heap */ # define DVALIDATE_HEAP_ACCESS(_addr, _size) \ DVASSERT(IS_ON_HEAP(_addr), "Expected heap location: %a\n", _addr); \ DVASSERT(heap_allocated((uintptr_t)_addr, _size, (uintptr_t)_addr), \ "Operation on unallocated heap block [%a + %lu]\n", _addr, _size) /* Assert that every location belonging to the range [_addr, _addr + _size] is * - belongs to a tracked static region (i.e., stack, TLS or global) * - not allocated */ # define DVALIDATE_HEAP_FREE(_addr, _size) { \ uintptr_t i, a = (uintptr_t)_addr; \ for (i = 0; i < _size; i++) { \ DVASSERT(IS_ON_HEAP(a + i), "Expected heap location: %a\n", a + i); \ DVASSERT(!heap_allocated(a + i, 1, a + i), \ "Expected heap unallocated location: [%a + %lu]\n", a, i); \ } \ } /* Assert that memory block [_addr, _addr + _size] is allocated on stack, TLS * or globally */ # define DVALIDATE_STATIC_ACCESS(_addr, _size) \ DVASSERT(IS_ON_STATIC(_addr), \ "Expected static location: [%a + %lu], \n", _addr, _size); \ DVASSERT(static_allocated((uintptr_t)_addr, _size,(uintptr_t)_addr), \ "Operation on unallocated static block [%a + %lu]\n", _addr, _size) /* Same as ::DVALIDATE_STATIC_LOCATION but for a single memory location */ # define DVALIDATE_STATIC_LOCATION(_addr) \ DVASSERT(IS_ON_STATIC(_addr), \ "Expected static location: %a\n", _addr); \ DVASSERT(static_allocated_one((uintptr_t)_addr), \ "Operation on unallocated static block [%a]\n", _addr) /* Assert that every location belonging to the range [_addr, _addr + _size] is * - belongs to a tracked static region (i.e., stack, TLS or global) * - not allocated */ # define DVALIDATE_STATIC_FREE(_addr, _size) { \ uintptr_t i, a = (uintptr_t)_addr; \ for (i = 0; i < _size; i++) { \ DVASSERT(IS_ON_STATIC(a + i), \ "Expected static location in freea: %a\n", a + i); \ DVASSERT(!static_allocated_one(a + i), \ "Expected static unallocated location in freea: [%a + %lu]\n", a, i); \ } \ } /* Assert that neither of `_len - 1` addresses immediately preceding `_addr` * are base addresses of some other block and that `_len` addresses past * `_addr` are free */ #define DVALIDATE_STATIC_SUFFICIENTLY_ALIGNED(_addr, _len) { \ int _i; \ for (_i = 0; _i < _len; _i++) { \ uintptr_t _prev = _addr - _i; \ if (static_allocated_one(_prev)) { \ vassert(_base_addr(_prev) != _prev, \ "Potential backward overlap of: \n previous block [%a]\n" \ " with allocated block [%a]\n", _prev, _addr); \ } \ uintptr_t _next = _addr + _i; \ vassert(!static_allocated_one(_next), \ "Potential forward overlap of:\n following block location [%a]\n" \ " with allocated block [%a]\n", _next, _addr); \ } \ } /* Assert that a memory block [_addr, _addr + _size] is nullified */ # define DVALIDATE_NULLIFIED(_addr, _size) \ DVASSERT(zeroed_out((void *)_addr, _size), \ "Block [%a, %a+%lu] not nullified", _addr, _addr, _size) /* Assert that memory block [_addr, _addr + _size] is allocated */ # define DVALIDATE_ALLOCATED(_addr, _size, _base) \ vassert(allocated((uintptr_t)_addr, _size, (uintptr_t)_base), \ "Operation on unallocated block [%a + %lu] with base %a\n", \ _addr, _size, _base); /* Assert that memory block [_addr, _addr + _size] is allocated * and can be written to */ # define DVALIDATE_WRITEABLE(_addr, _size, _base) \ vassert(writeable((uintptr_t)_addr, _size, (uintptr_t)_base), \ "Operation on unallocated block [%a + %lu] with base %a\n", \ _addr, _size, _base); #else /*! \cond exclude from doxygen */ # define DVALIDATE_MEMORY_INIT # define DVALIDATE_SHADOW_LAYOUT # define DVALIDATE_HEAP_ACCESS # define DVALIDATE_STATIC_ACCESS # define DVALIDATE_STATIC_LOCATION # define DVALIDATE_ALIGNMENT # define DVALIDATE_NULLIFIED # define DVALIDATE_IS_ON # define DVALIDATE_IS_ON_HEAP # define DVALIDATE_IS_ON_STACK # define DVALIDATE_IS_ON_GLOBAL # define DVALIDATE_IS_ON_TLS # define DVALIDATE_IS_ON_STATIC # define DVALIDATE_FREEABLE # define DVALIDATE_STATIC_FREE # define DVALIDATE_HEAP_FREE # define DVALIDATE_ALLOCATED # define DVALIDATE_WRITEABLE # define DVALIDATE_STATIC_SUFFICIENTLY_ALIGNED /*! \endcond */ #endif /* }}} */ /* E-ACSL predicates {{{ */ /* See definitions for documentation */ static void *shadow_copy(const void *ptr, size_t size, int init); static uintptr_t heap_info(uintptr_t addr, char type); static uintptr_t static_info(uintptr_t addr, char type); static int heap_allocated(uintptr_t addr, size_t size, uintptr_t base_ptr); static int static_allocated(uintptr_t addr, long size, uintptr_t base_ptr); static int allocated(uintptr_t addr, long size, uintptr_t base_ptr); static int writeable(uintptr_t addr, long size, uintptr_t base_ptr); static int readonly (void *ptr); /*! \brief Quick test to check if a static location belongs to allocation. * This macro really belongs where static_allocated is defined, but * since it is used across this whole file it needs to be defined here. */ #define static_allocated_one(_addr) \ (*((unsigned char*)PRIMARY_SHADOW(_addr))) /*! \brief Shortcut for executing statements based on the segment a given * address belongs to. * \param intptr_t _addr - a memory address * \param code_block _heap_stmt - code executed if `_addr` is a heap address * \param code_block _static_stmt - code executed if `_addr` is a static address */ #define TRY_SEGMENT_WEAK(_addr, _heap_stmt, _static_stmt) \ if (IS_ON_HEAP(_addr)) { \ _heap_stmt; \ } else if (IS_ON_STATIC(_addr)) { \ _static_stmt; \ } /*! \brief Same as TRY_SEGMENT but performs additional checks aborting the * execution if the given address is `NULL` or does not belong to known * segments. Note that `NULL` also does not belong to any of the tracked * segments but it is treated separately for debugging purposes. * * The \b WEAK notion refers to the behaviour where no action is performed if * the given address does not belong to any of the known segments. */ #define TRY_SEGMENT(_addr, _heap_stmt, _static_stmt) { \ TRY_SEGMENT_WEAK(_addr, _heap_stmt, _static_stmt) \ else { \ vassert(0, "Use of invalid address %a in %s\n", _addr, __func__); \ } \ } /*! \brief Wrapper around ::heap_info and ::static_info functions that * dispatches one of the above functions based on the type of supplied memory * address (`addr`) (static, global, tls or heap). For the case when the * supplied address does not belong to the track segments 0 is returned. * * \param uintptr_t addr - a memory address * \param char p - predicate type. See ::static_info for further details. */ static uintptr_t predicate(uintptr_t addr, char p) { TRY_SEGMENT( addr, return heap_info((uintptr_t)addr, p), return static_info((uintptr_t)addr, p)); return 0; } /*! \brief Return the byte length of the memory block containing `_addr` */ #define _block_length(_addr) predicate((uintptr_t)_addr, 'L') /*! \brief Return the base address of the memory block containing `_addr` */ #define _base_addr(_addr) predicate((uintptr_t)_addr, 'B') /* }}} */ /* Static allocation {{{ */ /** The below numbers identify offset "bases" for short block lengths. * An offset base is a number (a code) that represents the length of a * short block with a byte offset of `0`. * For instance, for a block of 4 bytes its offset base if 7, that is * length 4, offset 0 => 7, * length 4, offset 1 => 8, * length 4, offset 2 => 9, * length 4, offset 3 => 10, * and then for a block of 5 bytes its base offset if 11 etc. */ static const char short_offsets_base [] = { 0, 1, 2, 4, 7, 11, 16, 22, 29 }; /** Shadow masks for setting values of short blocks */ static const uint64_t short_shadow_masks[] = { 0UL, 4UL, 3080UL, 1578000UL, 673456156UL, 258640982060UL, 92703853921344UL, 31644393008028760UL, 10415850140873816180UL }; /*! \brief Record allocation of a given memory block and update shadows * using offset-based encoding. * * \param ptr - pointer to a base memory address of the stack memory block. * \param size - size of the stack memory block. */ static void shadow_alloca(void *ptr, size_t size) { DVALIDATE_IS_ON_STATIC(ptr, size); #ifdef E_ACSL_TEMPORAL /* Make sure that during temporal analysis there is * sufficient space to store an origin timestamp. * NOTE: This does not apply to globals, because all the globals * have the timestamp of `1`. */ if (!IS_ON_GLOBAL(ptr)) { DVALIDATE_STATIC_SUFFICIENTLY_ALIGNED((uintptr_t)ptr, 4); } #endif unsigned char *prim_shadow = (unsigned char*)PRIMARY_SHADOW(ptr); uint64_t *prim_shadow_alt = (uint64_t *)PRIMARY_SHADOW(ptr); unsigned int *sec_shadow = (unsigned int*)SECONDARY_SHADOW(ptr); /* Make sure shadows are nullified */ DVALIDATE_NULLIFIED(prim_shadow, size); DVALIDATE_NULLIFIED(sec_shadow, size); /* Flip read-only bit for zero-size blocks. That is, physically it exists * but one cannot write to it. Further, the flipped read-only bit will also * identify such block as allocated */ if (!size) setbit(READONLY_BIT, prim_shadow[0]); unsigned int i, j = 0, k = 0; if (IS_LONG_BLOCK(size)) { /* Long blocks */ unsigned int i, j = 0, k = 0; int boundary = LONG_BLOCK_BOUNDARY(size); for (i = 0; i < boundary; i += LONG_BLOCK) { /* Set-up a secondary shadow segment */ sec_shadow[j++] = size; sec_shadow[j++] = i; /* Set primary shadow offsets */ prim_shadow_alt[k++] = LONG_BLOCK_MASK; } /* Write out the remainder */ for (i = boundary; i < size; i++) { unsigned char offset = i%LONG_BLOCK + LONG_BLOCK_INDEX_START + LONG_BLOCK; prim_shadow[i] = (offset << 2); } } else { /* Short blocks */ for (i = 0; i < size; i++) { unsigned char code = short_offsets_base[size] + i; prim_shadow[i] = (code << 2); } } #ifdef E_ACSL_TEMPORAL /*{{{*/ /* Store a temporal origin timestamp in the first 4 bytes of a temporal * shadow. This, however applies only to TLS of stack blocks. Global blocks * are never deallocated, an origin time stamp of any global block is given * via `GLOBAL_TEMPORAL_TIMESTAMP` */ if (!IS_ON_GLOBAL(ptr)) { uint32_t* temporal_shadow = (uint32_t*)TEMPORAL_PRIMARY_STATIC_SHADOW(ptr); *temporal_shadow = NEW_TEMPORAL_TIMESTAMP(); } #endif /*}}} E_ACSL_TEMPORAL*/ } /* }}} */ /* Deletion of static blocks {{{ */ /*! \brief Nullifies shadow regions of a memory block given by its address. * \param ptr - base memory address of the stack memory block. */ void shadow_freea(void *ptr) { DVALIDATE_STATIC_LOCATION(ptr); DASSERT(ptr == (void*)_base_addr(ptr)); size_t size = _block_length(ptr); memset((void*)PRIMARY_SHADOW(ptr), 0, size); memset((void*)SECONDARY_SHADOW(ptr), 0, size); #ifdef E_ACSL_TEMPORAL /*{{{*/ memset((void*)TEMPORAL_PRIMARY_STATIC_SHADOW(ptr), 0, size); memset((void*)TEMPORAL_SECONDARY_STATIC_SHADOW(ptr), 0, size); #endif /*}}} E_ACSL_TEMPORAL*/ } /* }}} */ /* Static querying {{{ */ /*! \brief Return a non-zero value if a memory region of length `size` * starting at address `addr` belongs to a tracked stack, tls or * global memory block and 0 otherwise. * This function is only safe if applied to a tls, stack or global address. * Explanations regarding the third argument - `base_ptr` - are given * via inline documentation of function ::heap_allocated */ static int static_allocated(uintptr_t addr, long size, uintptr_t base_ptr) { unsigned char *prim_shadow = (unsigned char*)PRIMARY_SHADOW(addr); /* Unless the address belongs to tracked allocation 0 is returned */ if (prim_shadow[0]) { unsigned int code = (prim_shadow[0] >> 2); unsigned int long_block = (code >= LONG_BLOCK_INDEX_START); size_t length, offset; if (long_block) { offset = code - LONG_BLOCK_INDEX_START; unsigned int *sec_shadow = (unsigned int*)SECONDARY_SHADOW(addr - offset) ; length = sec_shadow[0]; offset = sec_shadow[1] + offset; } else { offset = short_offsets[code]; length = short_lengths[code]; } #ifndef E_ACSL_WEAK_VALIDITY if (addr != base_ptr) { return BELONGS(base_ptr, addr - offset, length) && offset + size <= length; } #endif return offset + size <= length; } return 0; } /*! \brief Return a non-zero value if a statically allocated memory block * starting at `addr` of length `size` is fully initialized (i.e., each of * its cells is initialized). */ static int static_initialized(uintptr_t addr, long size) { /* Return 0 right away if the address does not belong to * static allocation */ if (!static_allocated(addr, size, addr)) return 0; DVALIDATE_STATIC_ACCESS(addr, size); int result = 1; uint64_t *shadow = (uint64_t*)PRIMARY_SHADOW(addr); while (size > 0) { int rem = (size >= ULONG_BYTES) ? ULONG_BYTES : size; uint64_t mask = static_init_masks[rem]; size -= ULONG_BYTES; /* Note that most of the blocks checked for initialization will be smaller * than 64 bits, therefore in most cases it is more efficient to complete * the loop rather than do a test and return if the result is false */ result = result && (((*shadow) & mask) == mask); shadow++; } return result; } /*! \brief Checking whether a globally allocated memory block containing an * address _addr has read-only access. Note, this is light checking that * relies on the fact that a single block cannot contain read/write and * read-only parts, that is to check whether the block has read-only access it * is sufficient to check any of its bytes. */ #define global_readonly(_addr) \ checkbit(READONLY_BIT, (*(char*)PRIMARY_GLOBAL_SHADOW(addr))) /*! \brief Querying information about a specific global or stack memory address * (based on the value of parameter `global'). The return value is interpreted * based on the second argument that specifies parameters of the query: * * - 'B' - return the base address of the memory block `addr` belongs to or `0` * if `addr` lies outside of tracked allocation. * - 'O' - return the offset of `addr` within its memory block or `0` * if `addr` lies outside of tracked allocation. * - 'L' - return the size in bytes of the memory block `addr` belongs to or `0` * if `addr` lies outside of tracked allocation. * * NB: One should make sure that a given address is allocated before querying. * That is, for the cases when addr does not refer to an allocated memory * address belonging to static allocation the return value for this function is * unspecified. */ static uintptr_t static_info(uintptr_t addr, char type) { DVALIDATE_STATIC_LOCATION(addr); unsigned char *prim_shadow = (unsigned char*)PRIMARY_SHADOW(addr); /* Unless the address belongs to tracked allocation 0 is returned */ if (prim_shadow[0]) { unsigned int code = (prim_shadow[0] >> 2); unsigned int long_block = (code >= LONG_BLOCK_INDEX_START); if (long_block) { unsigned int offset = code - LONG_BLOCK_INDEX_START; unsigned int *sec_shadow = (unsigned int*)SECONDARY_SHADOW(addr - offset) ; switch(type) { case 'B': /* Base address */ return addr - offset - sec_shadow[1]; case 'O': /* Offset */ return sec_shadow[1] + offset; case 'L': /* Length */ return sec_shadow[0]; default: DASSERT(0 && "Unknown static query type"); } } else { switch(type) { case 'B': /* Base address */ return addr - short_offsets[code]; case 'O': /* Offset */ return short_offsets[code]; case 'L': /* Length */ return short_lengths[code]; default: DASSERT(0 && "Unknown static query type"); } } } return 0; } #ifdef E_ACSL_TEMPORAL /*{{{*/ /*! Return either an origin (if `origin` is non-zero) or referent timestamp * associated with a static address `addr` */ static uint32_t static_temporal_info(uintptr_t addr, int origin) { /* NOTE: No checking for allocated blocks, since an invalid timestamp is zero and ununsed memory is nullified then an invalid timestamp is also returned for allocated memory */ if (origin) { int allocated = static_allocated_one(addr); if (allocated && !IS_ON_GLOBAL(addr)) { uintptr_t base = static_info(addr, 'B'); return *((uint32_t*)TEMPORAL_PRIMARY_STATIC_SHADOW(base)); } else if (allocated && IS_ON_GLOBAL(addr)) { return GLOBAL_TEMPORAL_TIMESTAMP; } else { return INVALID_TEMPORAL_TIMESTAMP; } } else { return *((uint32_t*)TEMPORAL_SECONDARY_STATIC_SHADOW(addr)); } } #define static_origin_timestamp(_ptr) static_temporal_info((uintptr_t)(_ptr),1) #define static_referent_timestamp(_ptr) static_temporal_info((uintptr_t)(_ptr),0) /*! Store a referent time stamp associated with a static pointer. * Origin timestamps are generated via `shadow_alloca` */ static void static_store_temporal_referent(uintptr_t addr, uint32_t ref) { DVALIDATE_STATIC_ACCESS(addr, PTR_SZ); *((uint32_t*)TEMPORAL_SECONDARY_STATIC_SHADOW(addr)) = ref; } #endif/*}}} E_ACSL_TEMPORAL*/ /* }}} */ /* Static initialization {{{ */ /*! \brief The following function marks n bytes starting from the address * given by addr as initialized. `size` equating to zero indicates that the * whole block should be marked as initialized. */ static void initialize_static_region(uintptr_t addr, long size) { DVALIDATE_STATIC_ACCESS(addr, size); DVASSERT(!(addr - _base_addr(addr) + size > _block_length(addr)), "Attempt to initialize %lu bytes past block boundaries\n" "starting at %a with block length %lu at base address %a\n", size, addr, _block_length(addr), _base_addr(addr)); /* Below code marks `size` bytes following `addr` in the stack shadow as * initialized. That is, least significant bits of all 9 bytes following * `addr` should be flipped to ones. While this is a common pattern in this * program, here are some explanations. * * Here we grab a shadow region and initialize 8 (::ULONG_SIZE) bits at a * time using masks stored in ::static_init_masks. This few lines below are * better explained using an example. Let's say we need to mark 9 bytes as * initialized starting from some address `addr`. * * In order to do that we first grab a shadow region storing it in `shadow`. * For the first 8 bytes we grab a mask stored at ::static_init_masks[8]: * `10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000` * That is, `*shadow |= static_init_masks[8]` sets 8 lowest significant bits * of the 8 bytes following *shadow to ones. * * After that we need to mark the remaining 1 bite as initialized. For that * we grab mask ::static_init_masks[1]: * `10000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000` * That is, `*shadow |= static_init_masks[1]` will set only the least * significant bit in *shadow. */ uint64_t *shadow = (uint64_t*)PRIMARY_SHADOW(addr); while (size > 0) { int rem = (size >= ULONG_BYTES) ? ULONG_BYTES : size; size -= ULONG_BYTES; *shadow |= static_init_masks[rem]; shadow++; } } /* }}} */ /* Read-only {{{ */ /*! \brief Mark n bytes starting from the address given by `ptr` as initialized. * NOTE: This function has many similarities with ::initialize_static_region * The functionality, however is preferred to be kept separate * because the ::mark_readonly should operate only on the global shadow. */ static void mark_readonly_region (uintptr_t addr, long size) { /* Since read-only blocks can only be stored in the globals segments (e.g., * TEXT), this function required ptr carry a global address. */ DASSERT(IS_ON_GLOBAL(addr)); DASSERT(static_allocated_one(addr)); DVASSERT(!(addr - _base_addr(addr) + size > _block_length(addr)), "Attempt to mark read-only %lu bytes past block boundaries\n" "starting at %a with block length %lu at base address %a\n", size, addr, _block_length(addr), _base_addr(addr)); /* See comments in ::initialize_static_region for details */ uint64_t *shadow = (uint64_t*)PRIMARY_GLOBAL_SHADOW(addr); while (size > 0) { int rem = (size >= ULONG_BYTES) ? ULONG_BYTES : size; size -= ULONG_BYTES; *shadow |= static_readonly_masks[rem]; shadow++; } } /* }}} */ /* Heap allocation {{{ (malloc/calloc) */ /*! \brief Create a heap shadow for an allocated memory block starting at `ptr` * and of length `size`. Optionally mark it as initialized if `init` * evaluates to a non-zero value. * \b NOTE: This function assumes that `ptr` is a base address of a * heap-allocated memory block, such that HEAP_SEGMENT bytes preceding `ptr` * correspond to `unusable space`. * \b WARNING: Current implementation assumes that the size of a heap segment * does not exceed 64 bytes. */ static void set_heap_segment(void *ptr, size_t size, size_t alloc_size, size_t init, const char *function) { /* Make sure that heap memspace has not been moved. This is likely if a really large chunk has been requested to be allocated. */ vassert(mem_spaces.heap_mspace_least == (uintptr_t)mspace_least_addr(mem_spaces.heap_mspace), "Exceeded heap allocation limit of %luMB -- heap memory space moved. \n", E_ACSL_HEAP_SIZE); /* Similar check, make sure that allocated space does not exceed given allocation limit for mspace */ uintptr_t max_addr = (uintptr_t)ptr + alloc_size; vassert(mem_spaces.heap_end > max_addr, "Exceeded heap allocation limit of %luMB\n", E_ACSL_HEAP_SIZE); DVALIDATE_MEMORY_INIT; /* Ensure the shadowed block in on the tracked heap portion */ DVALIDATE_IS_ON_HEAP(((uintptr_t)ptr) - HEAP_SEGMENT, size); DVALIDATE_ALIGNMENT(ptr); /* Make sure alignment is right */ update_heap_allocation(size); /* Adjust tracked allocation size */ /* Get aligned size of the block, i.e., an actual size of the * allocated block */ unsigned char *shadow = (unsigned char*)HEAP_SHADOW(ptr); /* Make sure shadow is nullified before setting it */ DVALIDATE_NULLIFIED(shadow, alloc_size); /* The overall number of block segments in a tracked memory block */ size_t segments = alloc_size/HEAP_SEGMENT; uintptr_t *segment = (uintptr_t*)(shadow); segment[1] = size; #ifdef E_ACSL_TEMPORAL /*{{{*/ /* 4 bytes following a block's length store an origin timestamp */ segment[2] = NEW_TEMPORAL_TIMESTAMP(); #endif /*}}} E_ACSL_TEMPORAL*/ int i; /* Write the offsets per segment */ for (i = 0; i < segments; i++) { segment = (uintptr_t*)(shadow + i*HEAP_SEGMENT); *segment = (uintptr_t)ptr; } /* If init is a non-zero value then mark all allocated bytes as initialized */ if (init) { memset((void*)HEAP_INIT_SHADOW(ptr), (unsigned int)ONE, alloc_size/8); } } extern int MSPACES_INIT; /*! \brief Replacement for a malloc function that additionally tracks the * allocated memory block. * * NOTE: This malloc returns a `NULL` pointer if the requested size is `0`. * Such behaviour is compliant with the C99 standard, however it differs from * the behaviour of the GLIBC malloc, which returns a zero-size block instead. * The standard indicates that a return value for a zero-sized allocation * is implementation specific: * "If the size of the space requested is zero, the behaviour is * implementation-defined: either a null pointer is returned, or the * behaviour is as if the size were some non-zero value, except that the * returned pointer shall not be used to access an object." */ void* malloc(size_t size) { size_t alloc_size = ALLOC_SIZE(size); /* Return NULL if the size is too large to be aligned */ char* res; if (alloc_size) { mspaces_init(); res = (char*)public_malloc(alloc_size); } else res = NULL; if (res) { /* Make sure there is sufficient room in shadow */ set_heap_segment(res, size, alloc_size, 0, "malloc"); } return res; } /*! \brief Replacement for `calloc` that enables memory tracking */ void* calloc(size_t nmemb, size_t size) { /* Since both `nmemb` and `size` are both of size `size_t` the multiplication * of the arguments (which gives the actual allocation size) might lead to an * integer overflow. The below code checks for an overflow and sets the * `alloc_size` (argument a memory allocation function) to zero. */ size = (size && nmemb > SIZE_MAX/size) ? 0 : nmemb*size; size_t alloc_size = ALLOC_SIZE(size); /* Since aligned size is required by the model do the allocation through * `malloc` and nullify the memory space by hand */ char* res; if (size) { mspaces_init(); res = (char*)public_malloc(alloc_size); } else res = NULL; if (res) { /* Make sure there is sufficient room in shadow */ memset(res, 0, size); set_heap_segment(res, size, alloc_size, 1, "calloc"); } return res; } /** \brief Return shadowed copy of a memory chunk on a program's heap using. * If `init` parameter is set to a non-zero value the memory occupied by the * resulting block is set to be initialized and uninitialized otherwise. */ static void *shadow_copy(const void *ptr, size_t size, int init) { char *ret = (init) ? calloc(1, size) : malloc(size); vassert(ret != NULL, "Shadow copy failed\n", NULL); /* Shadow copy is internal, therefore heap status should not be updated. Since it is set via `set_heap_segment`, it needs to be reverted back. */ update_heap_allocation(-size); return memcpy(ret, ptr, size); } /* }}} */ /* Heap deallocation (free) {{{ */ /*! \brief Remove a memory block with base address given by `ptr` from tracking. * This function effectively nullifies block shadow tracking an application * block. * * NOTE: ::unset_heap_segment assumes that `ptr` is a base address of an * allocated heap memory block, i.e., `freeable(ptr)` evaluates to true. * * \param ptr - base address of the memory block to be removed from tracking * \param init - if evaluated to a non-zero value then initialization shadow * of the memory block with base address `ptr` is nullified as well. * \param function - name of the de-allocation function (e.g., `free` or `cfree`) */ static void unset_heap_segment(void *ptr, int init, const char *function) { DVALIDATE_MEMORY_INIT; DVALIDATE_FREEABLE(((uintptr_t)ptr)); /* Base address of shadow block */ uintptr_t *base_shadow = (uintptr_t*)HEAP_SHADOW(ptr); /* Physical allocation size */ size_t alloc_size = ALLOC_SIZE(base_shadow[1]); /* Actual block length */ size_t length = base_shadow[1]; /* Nullify shadow block */ memset(base_shadow, ZERO, alloc_size); /* Adjust tracked allocation size */ heap_allocation_size -= length; #ifdef E_ACSL_TEMPORAL /*{{{*/ /* Nullify temporal shadow */ uintptr_t *t_base_shadow = (uintptr_t*)TEMPORAL_HEAP_SHADOW(ptr); memset(t_base_shadow, ZERO, alloc_size); #endif /*}}} E_ACSL_TEMPORAL*/ /* Nullify init shadow */ if (init) { memset((void*)HEAP_INIT_SHADOW(ptr), 0, alloc_size/8); } } /*! \brief Replacement for `free` with memory tracking */ void free(void *ptr) { if (ptr == NULL) { /* Fail if instructed to treat NULL input to free as invalid. */ #ifdef E_ACSL_FREE_VALID_ADDRESS vabort("NULL pointer in free\n"); #endif return; } if (ptr != NULL) { /* NULL is a valid behaviour */ if (freeable(ptr)) { unset_heap_segment(ptr, 1, "free"); public_free(ptr); } else { vabort("Not a start of block (%a) in free\n", ptr); } } } /* }}} */ /* Heap reallocation (realloc) {{{ */ void* realloc(void *ptr, size_t size) { char *res = NULL; /* Resulting pointer */ /* If the pointer is NULL then realloc is equivalent to malloc(size) */ if (ptr == NULL) return malloc(size); /* If the pointer is not NULL and the size is zero then realloc is * equivalent to free(ptr) */ else if (ptr != NULL && size == 0) { free(ptr); } else { if (freeable(ptr)) { /* ... and can be used as an input to `free` */ size_t alloc_size = ALLOC_SIZE(size); res = public_realloc(ptr, alloc_size); DVALIDATE_ALIGNMENT(res); /* realloc succeeds, otherwise nothing needs to be done */ if (res != NULL) { size_t alloc_size = ALLOC_SIZE(size); size_t old_size = _block_length(ptr); size_t old_alloc_size = ALLOC_SIZE(old_size); /* Nullify old representation */ unset_heap_segment(ptr, 0, "realloc"); /* Set up new block shadow */ set_heap_segment(res, size, alloc_size, 0, "realloc"); /* Move init shadow */ unsigned char* old_init_shadow = (unsigned char*)HEAP_INIT_SHADOW(ptr); unsigned char* new_init_shadow = (unsigned char*)HEAP_INIT_SHADOW(res); /* If realloc truncates allocation in the old init shadow it is first * needed to clear the old init shadow from the boundary of the old * shadow block to the size of the new allocation */ if (old_size > size) { clearbits_right( old_alloc_size - size, old_init_shadow + old_alloc_size/8); } /* Now init shadow can be moved (if needed), keep in mind that * segment base addresses are aligned at a boundary of something * divisible by 8, so instead of moving actual bits here the * segments are moved to avoid dealing with bit-level operations * on incomplete bytes. */ if (res != ptr) { size_t copy_size = (old_size > size) ? alloc_size : old_alloc_size; memcpy(new_init_shadow, old_init_shadow, copy_size); memset(old_init_shadow, 0, copy_size); } } } else { vabort("Not a start of block (%a) in realloc\n", ptr); } } return res; } /* }}} */ /* Heap aligned allocation (aligned_alloc) {{{ */ /*! \brief Replacement for `aligned_alloc` with memory tracking */ void *aligned_alloc(size_t alignment, size_t size) { /* Check if: * - size and alignment are greater than zero * - alignment is a power of 2 * - size is a multiple of alignment */ if (!size || !alignment || !powof2(alignment) || (size%alignment)) return NULL; char *res = public_aligned_alloc(alignment, size); if (res) { set_heap_segment(res, size, ALLOC_SIZE(size), 0, "aligned_alloc"); } return (void*)res; } /* }}} */ /* Heap aligned allocation (posix_memalign) {{{ */ /*! \brief Replacement for `posix_memalign` with memory tracking */ int posix_memalign(void **memptr, size_t alignment, size_t size) { /* Check if: * - size and alignment are greater than zero * - alignment is a power of 2 and a multiple of sizeof(void*) */ if (!size || !alignment || !powof2(alignment) || alignment%sizeof(void*)) return -1; /* Make sure that the first argument to posix memalign is indeed allocated */ vassert(allocated((uintptr_t)memptr, sizeof(void*), (uintptr_t)memptr), "\\invalid memptr in posix_memalign", NULL); int res = public_posix_memalign(memptr, alignment, size); if (!res) { set_heap_segment(*memptr, size, ALLOC_SIZE(size), 0, "posix_memalign"); } return res; } /* }}} */ /* Heap querying {{{ */ /*! \brief Return a non-zero value if a memory region of length `size` * starting at address `addr` belongs to an allocated (tracked) heap memory * block and a 0 otherwise. Note, this function is only safe if applied to a * heap address. * * Note the third argument `base_ptr` that represents the base of a pointer, i.e., * `addr` of the form `base_ptr + i`, where `i` is some integer index. * ::heap_allocated also returns zero if `base_ptr` and `addr` belong to different * memory blocks, or if `base_ptr` lies within unallocated region. The intention * here is to be able to detect dereferencing of an allocated memory block through * a pointer to a different block. Consider, for instance, some pointer `p` that * points to a memory block `B`, and an index `i`, such that `p+i` references a * memory location belonging to a different memory block (say `C`). From a * low-level viewpoint, dereferencing `p+i` is safe (since it belongs to a properly * allocated block). From our perspective, however, dereference of `p+i` is * only legal if both `p` and `p+i` point to the same block. */ static int heap_allocated(uintptr_t addr, size_t size, uintptr_t base_ptr) { /* Base address of the shadow segment the address belongs to */ uintptr_t *shadow = (uintptr_t*)HEAP_SHADOW(addr - addr%HEAP_SEGMENT); /* Non-zero if the segment belongs to heap allocation */ if (shadow[0]) { uintptr_t *base_shadow = (uintptr_t*)HEAP_SHADOW(base_ptr - base_ptr%HEAP_SEGMENT); uintptr_t *first_segment = (uintptr_t*)HEAP_SHADOW(shadow[0]); /* shadow[0] - base address of the tracked block * fist_segment[1] - length (i.e., location in the first segment * after base address) * offset is the difference between the address and base address (shadow[0]) * Then an address belongs to heap allocation if * offset + size <= length * * Additionally, if strong validity is enforced * (i.e., E_ACSL_WEAK_VALIDITY macro undefined) make sure that both * `addr` and `base_ptr` belong to the same block. */ #ifndef E_ACSL_WEAK_VALIDITY return base_shadow[0] == shadow[0] && (addr - shadow[0]) + size <= first_segment[1]; #else return (addr - shadow[0]) + size <= first_segment[1]; #endif } return 0; } /*! \brief Return a non-zero value if a given address is a base address of a * heap-allocated memory block that `addr` belongs to. * * As some of the other functions, \b \\freeable can be expressed using * ::IS_ON_HEAP, ::heap_allocated and ::_base_addr. Here direct * implementation is preferred for performance reasons. */ int freeable(void *ptr) { /* + */ uintptr_t addr = (uintptr_t)ptr; /* Address is not on the program's heap, so cannot be freed */ if (!IS_ON_HEAP(addr)) return 0; /* Address of the shadow segment the address belongs to */ uintptr_t *shadow = (uintptr_t*)ALIGNED_HEAP_SHADOW(addr); /* Non-zero if the segment belongs to heap allocation with *shadow * capturing the base address of the tracked block */ if (*shadow) { /* Block is freeable if `addr` is the base address of its block */ return (uintptr_t)*shadow == addr; } return 0; } /*! \brief Querying information about a specific heap memory address. * This function is similar to ::static_info except it returns data * associated with dynamically allocated memory. * See in-line documentation for ::static_info for further details. */ static uintptr_t heap_info(uintptr_t addr, char type) { /* Ensure that `addr` is an allocated location on a program's heap */ DVALIDATE_HEAP_ACCESS(addr, 1); /* Base address of the shadow segment the address belongs to. * First `sizeof(uintptr_t)` bytes of each segment store application-level * base address of the tracked block */ uintptr_t *aligned_shadow = (uintptr_t*)ALIGNED_HEAP_SHADOW(addr); switch(type) { case 'B': /* Base address */ return *aligned_shadow; case 'L': { /* Block length */ /* Pointer to the first-segment in the shadow block */ uintptr_t *base_segment = (uintptr_t*)HEAP_SHADOW(*aligned_shadow); /* Length of the stored block is captured in `sizeof(uintptr_t)` bytes * past `sizeof(uintptr_t)` tracking the base address */ return base_segment[1]; } case 'O': /* Offset of a given address within its block. This is the difference * between the input address and the base address of the block. */ return addr - *aligned_shadow; default: DASSERT(0 && "Unknown heap query type"); } return 0; } /*! \brief Implementation of the \b \\initialized predicate for heap-allocated * memory. NB: If `addr` does not belong to an allocated heap block this * function returns 0. */ static int heap_initialized(uintptr_t addr, long len) { /* Base address of a shadow segment addr belongs to */ unsigned char *shadow = (unsigned char*)(HEAP_INIT_SHADOW(addr)); /* See comments in the `initialize_heap_region` function for more details */ unsigned skip = (addr - HEAP_START)%8; unsigned set; if (skip) { set = 8 - skip; set = (len > set) ? set : len; len -= set; unsigned char mask = 0; setbits64_skip(set,mask,skip); if (*shadow != mask) return 0; } if (len > 0) return checkbits(len, shadow); return 1; } /* }}} */ /* Heap temporal querying {{{*/ #ifdef E_ACSL_TEMPORAL static uint32_t heap_temporal_info(uintptr_t addr, int origin) { /* NOTE: No checking for allocated blocks, since an invalid timestamp is zero and unused memory is nullified then an invalid timestamp is also returned for allocated memory */ if (origin) { uintptr_t *aligned_shadow = (uintptr_t*)ALIGNED_HEAP_SHADOW(addr); uintptr_t *base_shadow = (uintptr_t*)HEAP_SHADOW(*aligned_shadow); return (uint32_t)base_shadow[2]; } else { return *((uint32_t*)TEMPORAL_HEAP_SHADOW(addr)); } } #define heap_origin_timestamp(_ptr) heap_temporal_info((uintptr_t)(_ptr),1) #define heap_referent_timestamp(_ptr) heap_temporal_info((uintptr_t)(_ptr),0) static void heap_store_temporal_referent(uintptr_t addr, uint32_t ref) { DVALIDATE_HEAP_ACCESS(addr, PTR_SZ); uint32_t *temporal_shadow = (uint32_t*)TEMPORAL_HEAP_SHADOW(addr); *temporal_shadow = ref; } #endif/*}}} E_ACSL_TEMPORAL*/ /* Heap initialization {{{ */ /*! \brief Mark n bytes on the heap starting from address addr as initialized */ static void initialize_heap_region(uintptr_t addr, long len) { DVALIDATE_HEAP_ACCESS(addr, len); DVASSERT(!(addr - _base_addr(addr) + len > _block_length(addr)), "Attempt to initialize %lu bytes past block boundaries\n" "starting at %a with block length %lu at base address %a\n", len, addr, _block_length(addr), _base_addr(addr)); /* Address within init shadow tracking initialization */ unsigned char *shadow = (unsigned char*)(HEAP_INIT_SHADOW(addr)); /* First check whether the address in the init shadow is divisible by 8 * (i.e., located on a byte boundary) */ /* Leading bits in `*shadow` byte which do not need to be set * (i.e., skipped) */ short skip = (addr - HEAP_START)%8; if (skip) { /* The remaining bits in the shadow byte */ short set = 8 - skip; /* The length of initialized region can be short (shorter then the * above remainder). Adjust the number of bits to set accordingly. */ set = (len > set) ? set : len; len -= set; setbits64_skip(set, *shadow, skip); /* Move to the next location if there are more bits to set */ shadow++; } if (len > 0) { /* Set the remaining bits. Note `shadow` is now aligned at a byte * boundary, thus one can set `len` bits starting with address given by * `shadow` */ setbits(len, shadow); } } /* }}} */ /* Any allocation {{{ */ /*! \brief Amalgamation of ::heap_allocated and ::static_allocated */ static int allocated(uintptr_t addr, long size, uintptr_t base) { TRY_SEGMENT_WEAK(addr, return heap_allocated(addr, size, base), return static_allocated(addr, size, base)); if (!IS_ON_VALID(addr)) return 0; return 0; } /** \brief Return 1 if a given memory location is read-only and 0 otherwise */ static inline int readonly (void *ptr) { uintptr_t addr = (uintptr_t)ptr; return IS_ON_GLOBAL(addr) && global_readonly(addr) ? 1 : 0; } static inline int writeable(uintptr_t addr, long size, uintptr_t base_ptr) { return allocated(addr, size, base_ptr) && !readonly((void*)addr); } /* }}} */ /* Internal state print (debug mode) {{{ */ #ifdef E_ACSL_DEBUG /* ! \brief Print human-readable representation of a byte in a primary * shadow */ static void printbyte(unsigned char c, char buf[]) { if (c >> 2 < LONG_BLOCK_INDEX_START) { rtl_sprintf(buf, "PRIMARY: I{%u} RO{%u} OF{%2u} => %u[%u]", checkbit(INIT_BIT,c), checkbit(READONLY_BIT,c), c >> 2, short_lengths[c >> 2], short_offsets[c >> 2]); } else { rtl_sprintf(buf, "SECONDARY: I{%u} RO{%u} OF{%u} => %4u", checkbit(INIT_BIT,c), checkbit(READONLY_BIT,c), (c >> 2), (c >> 2) - LONG_BLOCK_INDEX_START); } } /*! \brief Print human-readable (well, ish) representation of a memory block * using primary and secondary shadows. */ static void print_static_shadows(uintptr_t addr, size_t size) { char prim_buf[256]; char sec_buf[256]; unsigned char *prim_shadow = (unsigned char*)PRIMARY_SHADOW(addr); unsigned int *sec_shadow = (unsigned int*)SECONDARY_SHADOW(addr); int i, j = 0; for (i = 0; i < size; i++) { sec_buf[0] = '\0'; printbyte(prim_shadow[i], prim_buf); if (IS_LONG_BLOCK(size) && (i%LONG_BLOCK) == 0) { j += 2; if (i < LONG_BLOCK_BOUNDARY(size)) { rtl_sprintf(sec_buf, " %a SZ{%u} OF{%u}", &sec_shadow[j], sec_shadow[j-2], sec_shadow[j-1]); } if (i) { DLOG("---------------------------------------------\n"); } } DLOG("| [%2d] %a | %s || %s\n", i, &prim_shadow[i], prim_buf, sec_buf); } #ifdef E_ACSL_TEMPORAL /* {{{ */ uint32_t* origin_shadow = (uint32_t*)TEMPORAL_PRIMARY_STATIC_SHADOW(addr); uint32_t* ref_shadow = (uint32_t*)TEMPORAL_SECONDARY_STATIC_SHADOW(addr); DLOG(" | > Blk ID: %u\n", i, *origin_shadow); for (i = 0; i < size; i+=PTR_SZ) DLOG(" | > Ref ID[%u]: %u\n", i/8, *(ref_shadow + 1)); #endif /*}}} E_ACSL_TEMPORAL*/ } /*! \brief Print human-readable representation of a heap shadow region for a * memory block of length `size` starting at address `addr`. This function * assumes that `addr` is the base address of the memory block. */ static void print_heap_shadows(uintptr_t addr) { unsigned char *block_shadow = (unsigned char*)HEAP_SHADOW(addr); unsigned char *init_shadow = (unsigned char*)HEAP_INIT_SHADOW(addr); size_t length = (size_t)((uintptr_t*)(block_shadow))[1]; size_t alloc_size = ALLOC_SIZE(length); size_t segments = alloc_size/HEAP_SEGMENT; uintptr_t *segment = (uintptr_t*)(block_shadow); DLOG(" | === Block Shadow ======================================\n"); DLOG(" | Access addr: %a\n", addr); DLOG(" | Block Shadow: %a\n", block_shadow); DLOG(" | Init Shadow: %a\n", init_shadow); DLOG(" | Segments: %lu\n", segments); DLOG(" | Actual size: %lu bytes\n", alloc_size); DLOG(" | Tracked Length: %lu bytes\n", length); if (zeroed_out(block_shadow, alloc_size)) DLOG(" | << Nullified >> \n"); #ifdef E_ACSL_TEMPORAL /*{{{*/ DLOG(" | Origin TS: %u\n", (uint32_t)segment[2]); #endif /*}}}*/ size_t i; for (i = 0; i < segments; i++) { segment = (uintptr_t*)(block_shadow + i*HEAP_SEGMENT); DLOG(" | Segment: %lu, Base: %a \n", i, *segment); } DLOG(" | Initialization: \n | "); for (i = 0; i < alloc_size/8; i++) { if (i > 0 && (i*8)%HEAP_SEGMENT == 0) DLOG("\n | "); DLOG("%8b ", init_shadow[i], init_shadow[i]); } DLOG("\n"); } static void print_shadows(uintptr_t addr, size_t size) { if (IS_ON_STATIC(addr)) print_static_shadows(addr, size); else if (IS_ON_HEAP(addr)) print_heap_shadows(addr); } static void print_memory_segment(struct memory_segment *p, char *lab, int off) { DLOG(" %s: %lu MB [%lu, %lu]", lab, MB_SZ(p->size), p->start, p->end); if (off) DLOG("{ Offset: %ld }", p->shadow_offset); DLOG("\n"); } static void print_memory_partition(struct memory_partition *p) { print_memory_segment(&p->application, "Application", 0); print_memory_segment(&p->primary, "Primary ", 1); print_memory_segment(&p->secondary, "Secondary ", 1); #ifdef E_ACSL_TEMPORAL print_memory_segment(&p->temporal_primary, "Temporal Primary ", 1); print_memory_segment(&p->temporal_secondary, "Temporal Secondary ", 1); #endif } static void print_shadow_layout() { DLOG(">>> HEAP ---------------------\n"); print_memory_partition(&mem_layout.heap); DLOG(">>> STACK --------------------\n"); print_memory_partition(&mem_layout.stack); DLOG(">>> GLOBAL -------------------\n"); print_memory_partition(&mem_layout.global); DLOG(">>> TLS ----------------------\n"); print_memory_partition(&mem_layout.tls); DLOG(">>> --------------------------\n"); } /*! \brief Output the shadow segment the address belongs to */ static const char* which_segment(uintptr_t addr) { const char *loc = NULL; if (IS_ON_STACK(addr)) loc = "stack"; else if (IS_ON_HEAP(addr)) loc = "heap"; else if (IS_ON_GLOBAL(addr)) loc = "global"; else if (IS_ON_TLS(addr)) loc = "TLS"; else loc = "untracked"; return loc; } /* NOTE: Above functions are designed to be used only through the following * macros or debug functions included/defined based on the value of the * E_ACSL_DEBUG macro. */ /*! \brief Print program layout. This function outputs start/end addresses of * various program segments, their shadow counterparts and sizes of shadow * regions used. */ #define DEBUG_PRINT_LAYOUT print_shadow_layout() void ___e_acsl_debug_print_layout() { DEBUG_PRINT_LAYOUT; } /*! \brief Print the shadow segment address addr belongs to */ #define DEBUG_PRINT_SEGMENT(_addr) which_segment(_addr) void ___e_acsl_debug_print_segment(uintptr_t addr) { DEBUG_PRINT_SEGMENT(addr); } /*! \brief Print human-readable representation of a shadow region corresponding * to a memory address addr. The second argument (size) if the size of the * shadow region to be printed. Normally addr argument is a base address of a * memory block and size is its length. */ #define DEBUG_PRINT_SHADOW(addr, size) \ print_shadows((uintptr_t)addr, (size_t)size) void ___e_acsl_debug_print_shadow(uintptr_t addr, size_t size) { DEBUG_PRINT_SHADOW(addr, size); } #else /* \cond exclude from doxygen */ #define DEBUG_PRINT_SHADOW(addr, size) #define DEBUG_PRINT_LAYOUT #define DEBUG_PRINT_SEGMENT(addr) /* \endcond */ #endif /* }}} */ frama-c-20.0-Calcium/src/plugins/e-acsl/share/e-acsl/segment_model/e_acsl_shadow_layout.h0000666000000000000000000006177213571573400026275 0ustar /**************************************************************************/ /* */ /* This file is part of the Frama-C's E-ACSL plug-in. */ /* */ /* Copyright (C) 2012-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ /*! *********************************************************************** * \file e_acsl_shadow_layout.h * \brief Setup for memory tracking using shadowing ***************************************************************************/ /* Default size of a program's heap tracked via shadow memory */ #ifndef E_ACSL_HEAP_SIZE #define E_ACSL_HEAP_SIZE 512 #endif /* Default size of a program's stack tracked via shadow memory */ #ifndef E_ACSL_STACK_SIZE #define E_ACSL_STACK_SIZE 64 #endif /* Symbols exported by the linker script */ /*!\brief The first address past the end of the text segment. */ extern char etext; /*!\brief The first address past the end of the initialized data segment. */ extern char edata; /*!\brief The first address past the end of the uninitialized data segment. */ extern char end; /*!\brief The first address of a program. */ extern char __executable_start; /* \cond */ void *sbrk(intptr_t increment); char *strerror(int errnum); /* MAP_ANONYMOUS is a mmap flag indicating that the contents of allocated blocks * should be nullified. Set value from , if MAP_ANONYMOUS is * undefined */ #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS 0x20 #endif /* \endcond */ /*! \brief Byte-width of a pointer */ #define PTR_SZ sizeof(uintptr_t) /*! \brief Byte-width of the largest integer type usable with bitwise * operators */ #define ULONG_BYTES 8 /*! \brief Bit-width of the largest integer type usable with bitwise * operators */ #define ULONG_BITS 64 /** Hardcoded sizes of tracked program segments {{{ */ /*! \brief Size of a program's heap */ #define PGM_HEAP_SIZE (E_ACSL_HEAP_SIZE * MB) /*! \brief Size of a program's Thread-local storage (TLS). Standard streams stdin, stdout and stderr are put here. Some libraries such as libxml use it quite a lot: it may occur that the given size is not enough, in which case it MUST be increased. */ #ifndef PGM_TLS_SIZE #define PGM_TLS_SIZE (64 * MB) #endif /*! \brief Mspace padding used by shadow segments. This is to make sure that * some allocation which exceeds the size of an initial memspace does not * move the mspace somewhere else. 512KB is a bit of an overkill, but should * not hurt too much in general unless memory space is really a constraint */ #define SHADOW_SEGMENT_PADDING (512*KB) /* }}} */ /** Thread-local storage information {{{ */ /*! Thread-local storage (TLS) keeps track of copies of per-thread variables. * Even though at the present stage RTL of E-ACSL is not thread-safe, some * of the variables (for instance ::errno) are allocated there. In X86 TLS * is typically located somewhere below the program's stack but above mmap * areas. TLS is typically separated into two sections: .tdata and .tbss. * Similar to globals using .data and .bss, .tdata keeps track of initialized * thread-local variables, while .tbss holds uninitialized ones. * * Start and end addresses of TLS are obtained by taking addresses of * initialized and uninitialized variables in TLS (::id_tdata and ::id_tss) * and adding fixed amount of shadow space around them. Visually it looks * as follows: * * end TLS address (&id_tdata + TLS_SHADOW_SIZE/2) * id_tdata address * ... * id_tbss address * start TLS address (&id_bss - TLS_SHADOW_SIZE/2) * * HOWEVER problems can occur if PGM_TLS_SIZE is too big: * see get_tls_start for details. */ /*! \brief Return byte-size of the TLS segment */ static size_t get_tls_size() { return PGM_TLS_SIZE; } static __thread int id_tdata = 1; static __thread int id_tbss; /* }}} */ /** Program stack information {{{ */ extern char ** environ; /*! \brief Set a new soft stack limit * \param size - new stack size in bytes */ static size_t increase_stack_limit(const size_t size) { rlim_t stacksz = (rlim_t)size; struct rlimit rl; int result = getrlimit(RLIMIT_STACK, &rl); if (result == 0) { if (rl.rlim_cur < stacksz) { if (stacksz>rl.rlim_max) stacksz = rl.rlim_max; rl.rlim_cur = stacksz; result = setrlimit(RLIMIT_STACK, &rl); if (result != 0) { vabort("setrlimit: %s \n", strerror(errno)); } } } else { vabort("getrlimit: %s \n", strerror(errno)); } return (size_t)stacksz; } /*! \brief Return byte-size of a program's stack. The return value is the soft * stack limit, i.e., it can be programmatically increased at runtime. */ static size_t get_default_stack_size() { struct rlimit rlim; vassert(!getrlimit(RLIMIT_STACK, &rlim), "Cannot detect program's stack size", NULL); return rlim.rlim_cur; } static size_t get_stack_size() { #ifndef E_ACSL_STACK_SIZE return get_default_stack_size(); #else return increase_stack_limit(E_ACSL_STACK_SIZE*MB); #endif } /*! \brief Return greatest (known) address on a program's stack. * This function presently determines the address using the address of the * last string in `environ`. That is, it assumes that argc and argv are * stored below environ, which holds for GCC/Glibc but is not necessarily * true for some other compilers/libraries. */ static uintptr_t get_stack_start(int *argc_ref, char *** argv_ref) { char **env = environ; while (env[1]) env++; uintptr_t addr = (uintptr_t)*env + strlen(*env); /* When returning the end stack address we need to make sure that * ::ULONG_BITS past that address are actually writeable. This is * to be able to set initialization and read-only bits ::ULONG_BITS * at a time. If not respected, this may cause a segfault in * ::argv_alloca. */ uintptr_t stack_end = addr + ULONG_BITS; uintptr_t stack_start = stack_end - get_stack_size(); return stack_start; } /* }}} */ /** Program heap information {{{ */ /*! \brief Return the start address of a program's heap. */ static uintptr_t get_heap_start() { return mem_spaces.heap_start; } /*! \brief Return the tracked size of a program's heap. */ static size_t get_heap_size() { return PGM_HEAP_SIZE; } /*! \brief Return the size of a secondary shadow region tracking * initialization (i.e., init shadow). */ static size_t get_heap_init_size() { return get_heap_size()/8; } /** }}} */ /** Program global information {{{ */ /*! \brief Return the start address of a segment holding globals (generally * BSS and Data segments). */ static uintptr_t get_global_start() { return (uintptr_t)&__executable_start; } /*! \brief Return byte-size of global segment */ static size_t get_global_size() { return ((uintptr_t)&end - get_global_start()); } /** }}} */ /** Shadow Layout {{{ */ /***************************************************************************** * Memory Layout ************************************************************* ***************************************************************************** ----------------------------------------> Max address Kernel Space ----------------------------------------> Non-canonical address space (only in 64-bit) ----------------------------------------> Environment variables [ GLIBC extension ] -----------------------------------------> Program arguments [ argc, argv ] -----------------------------------------> Stack End Stack [ Grows downwards ] -----------------------------------------> Thread-local storage (TLS) [ TDATA and TBSS ] -----------------------------------------> Shadow memory [ Heap, Stack, Global, TLS ] -----------------------------------------> Object mappings -----------------------------------------> -----------------------------------------> Heap [ Grows upwards^ ] -----------------------------------------> Heap Start [Initial Brk] BSS Segment [ Uninitialised Globals ] -----------------------------------------> Data Segment [ Initialised Globals ] -----------------------------------------> ROData [ Potentially ] -----------------------------------------> Text Segment [ Constants ] -----------------------------------------> NULL (0) ***************************************************************************** NOTE: Above memory layout scheme generally applies to Linux Kernel/gcc/glibc. It is also an approximation slanted towards 64-bit virtual process layout. In reality layouts may vary. Also, with mmap allocations heap does not necessarily grows from program break upwards. Typically mmap will allocate memory somewhere closer to stack. */ /* Struct representing a contigous memory region. Effectively this describes * a memory segment, such as heap, stack or segments in the shadow memory * used to track them. */ struct memory_segment { const char *name; //!< Symbolic name size_t size; //!< Byte-size uintptr_t start; //!< Least address uintptr_t end; //!< Greatest address mspace mspace; // !< Mspace used for the partition /* The following are only set if the segment is a shadow segment */ struct memory_segment *parent; //!< Pointer to the tracked segment size_t shadow_ratio; //!< Ratio of shadow to application memory /*!< Offset between the start of the tracked segment and the start of this segment */ intptr_t shadow_offset; }; typedef struct memory_segment memory_segment; /* Struct representing a memory segment along with information about its * shadow spaces. */ struct memory_partition { memory_segment application; /* Application memory segment */ memory_segment primary; /* Primary shadow segment */ memory_segment secondary; /* Secondary shadow segment */ #ifdef E_ACSL_TEMPORAL memory_segment temporal_primary; /* Primary temporal shadow segment */ memory_segment temporal_secondary; /* Secondary temporal shadow segment */ #endif }; typedef struct memory_partition memory_partition; /* Struct representing memory layout of a program consisting of heap, stack, global and tls segments */ struct memory_layout { memory_partition heap; memory_partition stack; memory_partition global; memory_partition tls; int is_initialized; }; /*! \brief Full program memory layout. */ static struct memory_layout mem_layout; /*! \brief Array of used partitions */ static memory_partition *mem_partitions [] = { &mem_layout.heap, &mem_layout.stack, &mem_layout.global, &mem_layout.tls }; /*! \brief Initialize an application memory segment. * * \param seg - pointer to a segment to initialize * \param start - least address in an application's segment * \param size - size in bytes * \param name - segment name * \param msp - mspace used for this segment (defined only for heap) */ static void set_application_segment(memory_segment *seg, uintptr_t start, size_t size, const char *name, mspace msp) { seg->name = name; seg->start = start; seg->size = size; seg->end = seg->start + seg->size; seg->mspace = msp; seg->parent = NULL; seg->shadow_ratio = 0; seg->shadow_offset = 0; } /*! \brief Set a shadow memory segment * * \param seg - pointer to a segment to initialize * \param parent - pointer to the segment ::seg tracks. Should be initialized * \param ratio - ratio of shadow to application memory * \param name - symbolic name of the segment */ static void set_shadow_segment(memory_segment *seg, memory_segment *parent, size_t ratio, const char *name) { seg->parent = parent; seg->name = name; seg->shadow_ratio = ratio; seg->size = parent->size/seg->shadow_ratio; seg->mspace = create_mspace(seg->size + SHADOW_SEGMENT_PADDING, 0); seg->start = (uintptr_t)mspace_malloc(seg->mspace,1); seg->end = seg->start + seg->size; seg->shadow_offset = parent->start - seg->start; } /*! \brief Initialize memory layout, i.e., determine bounds of program segments, * allocate shadow memory spaces and compute offsets. This function populates * global struct ::memory_layout holding that information with data. Case of the stack. */ static void init_shadow_layout_stack(int *argc_ref, char ***argv_ref) { memory_partition *pstack = &mem_layout.stack; set_application_segment(&pstack->application, get_stack_start(argc_ref, argv_ref), get_stack_size(), "stack", NULL); /* Changes of the ratio in the following will require changes in get_tls_start */ set_shadow_segment(&pstack->primary, &pstack->application, 1, "stack_primary"); set_shadow_segment(&pstack->secondary, &pstack->application, 1, "stack_secondary"); #ifdef E_ACSL_TEMPORAL set_shadow_segment(&pstack->temporal_primary, &pstack->application, 1, "temporal_stack_primary"); set_shadow_segment(&pstack->temporal_secondary, &pstack->application, 1, "temporal_stack_secondary"); #endif mem_layout.is_initialized = 1; } /*! \brief Return start address of a program's TLS */ static uintptr_t get_tls_start() { size_t tls_size = get_tls_size(); uintptr_t data = (uintptr_t)&id_tdata, bss = (uintptr_t)&id_tbss; /* It could happen that the shadow allocated before bss is too big. Indeed allocating PGM_TLS_SIZE/2 could cause an overlap with the other shadow segments AND heap.application (in case the latter is too big too). In such cases, take the smallest available address (the max used +1). */ uintptr_t tls_start_half = (data > bss ? bss : data) - tls_size/2; memory_partition pheap = mem_layout.heap, pglobal = mem_layout.global; uintptr_t max_shadow = pheap.primary.end; max_shadow = pheap.secondary.end > max_shadow ? pheap.secondary.end : max_shadow; max_shadow = pglobal.primary.end > max_shadow ? pglobal.primary.end : max_shadow; max_shadow = pglobal.secondary.end > max_shadow ? pglobal.secondary.end : max_shadow; max_shadow = pheap.application.end > max_shadow ? pheap.application.end : max_shadow; /* Shadow stacks are not yet allocated at his point since init_shadow_layout_stack is called after init_shadow_layout_heap_global_tls (for reasons related to memory initialization in presence of things like GCC constructors). We must leave sufficient space for them. */ max_shadow = max_shadow + 2*get_stack_size() + /* One for primary, one for secondary. If ratio is changed in init_shadow_layout_stack then update required here. TODO: if stack too big ==> problem */ 1; return tls_start_half > max_shadow ? tls_start_half : max_shadow; } /*! \brief Initialize memory layout, i.e., determine bounds of program segments, * allocate shadow memory spaces and compute offsets. This function populates * global struct ::memory_layout holding that information with data. Case of the heap, globals and tls. */ static void init_shadow_layout_heap_global_tls() { memory_partition *pheap = &mem_layout.heap; set_application_segment(&pheap->application, get_heap_start(), get_heap_size(), "heap", mem_spaces.heap_mspace); set_shadow_segment(&pheap->primary, &pheap->application, 1, "heap_primary"); set_shadow_segment(&pheap->secondary, &pheap->application, 8, "heap_secondary"); #ifdef E_ACSL_TEMPORAL set_shadow_segment(&pheap->temporal_primary, &pheap->application, 1, "temporal_heap_primary"); set_shadow_segment(&pheap->temporal_secondary, &pheap->application, 1, "temporal_heap_secondary"); #endif memory_partition *pglobal = &mem_layout.global; set_application_segment(&pglobal->application, get_global_start(), get_global_size(), "global", NULL); set_shadow_segment(&pglobal->primary, &pglobal->application, 1, "global_primary"); set_shadow_segment(&pglobal->secondary, &pglobal->application, 1, "global_secondary"); #ifdef E_ACSL_TEMPORAL set_shadow_segment(&pglobal->temporal_primary, &pglobal->application, 1, "temporal_global_primary"); set_shadow_segment(&pglobal->temporal_secondary, &pglobal->application, 1, "temporal_global_secondary"); #endif memory_partition *ptls = &mem_layout.tls; set_application_segment(&ptls->application, get_tls_start(), get_tls_size(), "tls", NULL); set_shadow_segment(&ptls->primary, &ptls->application, 1, "tls_primary"); set_shadow_segment(&ptls->secondary, &ptls->application, 1, "tls_secondary"); #ifdef E_ACSL_TEMPORAL set_shadow_segment(&ptls->temporal_primary, &ptls->application, 1, "temporal_tls_primary"); set_shadow_segment(&ptls->temporal_secondary, &ptls->application, 1, "temporal_tls_secondary"); #endif mem_layout.is_initialized = 1; } /*! \brief Deallocate shadow regions used by runtime analysis */ static void clean_shadow_layout() { if (mem_layout.is_initialized) { int i; for (i = 0; i < sizeof(mem_partitions)/sizeof(memory_partition*); i++) { if (mem_partitions[i]->primary.mspace) destroy_mspace(mem_partitions[i]->primary.mspace); if (mem_partitions[i]->secondary.mspace) destroy_mspace(mem_partitions[i]->secondary.mspace); } } } /* }}} */ /** Shadow access {{{ * * Shadow displacement offsets are stored using signed integers. * Displacement offset between an application memory space Ma and a shadow * memory space Ms is computed by [min(Ma) - min(Ms)], where min(Ma) and min(Ms) * denote least addresses in application and shadow spaces Ma and Ms respectively. * * Correspondense between a shadow address S and an application address A * using a displacement offset OFF is therefore as follows: * OFF = A - S * S = A - OFF * A = S + OFF * * Conversions between application-space and shadow memory addresses * are given by following macros. */ #define heap_primary_offset mem_layout.heap.primary.shadow_offset #define heap_secondary_offset mem_layout.heap.secondary.shadow_offset #define stack_primary_offset mem_layout.stack.primary.shadow_offset #define stack_secondary_offset mem_layout.stack.secondary.shadow_offset #define global_primary_offset mem_layout.global.primary.shadow_offset #define global_secondary_offset mem_layout.global.secondary.shadow_offset #define tls_primary_offset mem_layout.tls.primary.shadow_offset #define tls_secondary_offset mem_layout.tls.secondary.shadow_offset /*! \brief Compute a shadow address using displacement offset * @param _addr - an application space address * @param _offset - a shadow displacement offset */ #define SHADOW_ACCESS(_addr,_offset) \ ((intptr_t)((intptr_t)_addr - (intptr_t)_offset)) /*! \brief Same as SHADOW_ACCESS but with an additional scale factor given via * _scale argument. Scale factor describes ratio of application to shadow bytes, * for instance if one bit shadow memory is used to track one byte of * application memory then the scale factor is 8. * Here, scale factor is the ration of application to shadow memory. */ #define SCALED_SHADOW_ACCESS(_addr, _start, _offset, _scale) \ (((uintptr_t)_start - _offset) + \ ((uintptr_t)_addr - (uintptr_t)_start)/_scale) /*! \brief Convert a heap address into its shadow counterpart */ #define HEAP_SHADOW(_addr) \ SHADOW_ACCESS(_addr, heap_primary_offset) /*! \brief Convert a heap address into its init shadow counterpart */ #define HEAP_INIT_SHADOW(_addr) \ SCALED_SHADOW_ACCESS(_addr, \ mem_layout.heap.application.start, \ mem_layout.heap.secondary.shadow_offset, \ mem_layout.heap.secondary.shadow_ratio) #define HEAP_START mem_layout.heap.application.start /*! \brief Convert a stack address into its primary shadow counterpart */ #define PRIMARY_STACK_SHADOW(_addr) \ SHADOW_ACCESS(_addr, stack_primary_offset) /*! \brief Convert a stack address into its secondary shadow counterpart */ #define SECONDARY_STACK_SHADOW(_addr) \ SHADOW_ACCESS(_addr, stack_secondary_offset) /*! \brief Convert a global address into its primary shadow counterpart */ #define PRIMARY_GLOBAL_SHADOW(_addr) \ SHADOW_ACCESS(_addr, global_primary_offset) /*! \brief Convert a global address into its secondary shadow counterpart */ #define SECONDARY_GLOBAL_SHADOW(_addr) \ SHADOW_ACCESS(_addr, global_secondary_offset) /*! \brief Convert a TLS address into its primary shadow counterpart */ #define PRIMARY_TLS_SHADOW(_addr) \ SHADOW_ACCESS(_addr, tls_primary_offset) /*! \brief Convert a TLS address into its secondary shadow counterpart */ #define SECONDARY_TLS_SHADOW(_addr) \ SHADOW_ACCESS(_addr, tls_secondary_offset) /* \brief Compute a primary or a secondary shadow address (based on the value of * parameter `_region`) of an address tracked via an offset-based encoding. * For an untracked address `0` is returned. */ #define SHADOW_REGION_ADDRESS(_addr, _region) \ (IS_ON_STACK(_addr) ? _region##_STACK_SHADOW(_addr) : \ IS_ON_GLOBAL(_addr) ? _region##_GLOBAL_SHADOW(_addr) : \ IS_ON_TLS(_addr) ? _region##_TLS_SHADOW(_addr) : 0) /*! \brief Primary shadow address of a non-dynamic region */ #define PRIMARY_SHADOW(_addr) SHADOW_REGION_ADDRESS(_addr, PRIMARY) /*! \brief Secondary shadow address of a non-dynamic region */ #define SECONDARY_SHADOW(_addr) SHADOW_REGION_ADDRESS(_addr, SECONDARY) /* }}} */ /** Memory segment ranges {{{ */ /*! \brief Evaluate to a true value if address _addr resides within a given * memory segment. * \param _addr - a memory address * \param _seg - a memory segment (one of the structs within ::mem_layout) */ #define IS_ON(_addr,_seg) ( \ ((uintptr_t)_addr) >= _seg.start && \ ((uintptr_t)_addr) <= _seg.end \ ) /*! \brief Evaluate to true if `_addr` is a heap address */ #define IS_ON_HEAP(_addr) IS_ON(_addr, mem_layout.heap.application) /*! \brief Evaluate to true if `_addr` is a stack address */ #define IS_ON_STACK(_addr) IS_ON(_addr, mem_layout.stack.application) /*! \brief Evaluate to true if `_addr` is a global address */ #define IS_ON_GLOBAL(_addr) IS_ON(_addr, mem_layout.global.application) /*! \brief Evaluate to true if _addr is a TLS address */ #define IS_ON_TLS(_addr) IS_ON(_addr, mem_layout.tls.application) /*! \brief Shortcut for evaluating an address via ::IS_ON_STACK, * ::IS_ON_GLOBAL or ::IS_ON_TLS */ #define IS_ON_STATIC(_addr) \ (IS_ON_STACK(_addr) || IS_ON_GLOBAL(_addr) || IS_ON_TLS(_addr)) /*! \brief Evaluate to a true value if a given address belongs to tracked * allocation (i.e., found within tls, stack, heap or globally) */ #define IS_ON_VALID(_addr) \ (IS_ON_STACK(_addr) || IS_ON_HEAP(_addr) || \ IS_ON_GLOBAL(_addr) || IS_ON_TLS(_addr)) /* }}} */ #ifdef E_ACSL_TEMPORAL /* {{{ */ /*! \brief Convert a heap address into its shadow counterpart */ #define TEMPORAL_HEAP_SHADOW(_addr) \ SHADOW_ACCESS(_addr, mem_layout.heap.temporal_primary.shadow_offset) /*! \brief Convert a stack address into its primary temporal shadow counterpart */ #define TEMPORAL_PRIMARY_STACK_SHADOW(_addr) \ SHADOW_ACCESS(_addr, mem_layout.stack.temporal_primary.shadow_offset) /*! \brief Convert a stack address into its secondary temporal shadow counterpart */ #define TEMPORAL_SECONDARY_STACK_SHADOW(_addr) \ SHADOW_ACCESS(_addr, mem_layout.stack.temporal_secondary.shadow_offset) /*! \brief Convert a global address into its primary temporal shadow counterpart */ #define TEMPORAL_PRIMARY_GLOBAL_SHADOW(_addr) \ SHADOW_ACCESS(_addr, mem_layout.global.temporal_primary.shadow_offset) /*! \brief Convert a global address into its primary temporal shadow counterpart */ #define TEMPORAL_SECONDARY_GLOBAL_SHADOW(_addr) \ SHADOW_ACCESS(_addr, mem_layout.global.temporal_secondary.shadow_offset) /*! \brief Convert a TLS address into its primary temporal shadow counterpart */ #define TEMPORAL_PRIMARY_TLS_SHADOW(_addr) \ SHADOW_ACCESS(_addr, mem_layout.tls.temporal_primary.shadow_offset) /*! \brief Convert a TLS address into its secondary temporal shadow counterpart */ #define TEMPORAL_SECONDARY_TLS_SHADOW(_addr) \ SHADOW_ACCESS(_addr, mem_layout.tls.temporal_secondary.shadow_offset) /*! \brief Temporal primary shadow address of a non-dynamic region */ #define TEMPORAL_PRIMARY_STATIC_SHADOW(_addr) \ SHADOW_REGION_ADDRESS(_addr, TEMPORAL_PRIMARY) /*! \brief Temporal secondary shadow address of a non-dynamic region */ #define TEMPORAL_SECONDARY_STATIC_SHADOW(_addr) \ SHADOW_REGION_ADDRESS(_addr, TEMPORAL_SECONDARY) #endif /* }}} */ frama-c-20.0-Calcium/src/plugins/e-acsl/src/0000777000000000000000000000000013571573400015416 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/0000777000000000000000000000000013571573400017235 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/exit_points.ml0000666000000000000000000001333213571573400022136 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype module Build_env(X: sig type t end): sig val add: stmt -> X.t -> unit val find: stmt -> X.t (* may raise [Not_found] *) val get_all: stmt -> X.t list val is_empty: unit -> bool val clear: unit -> unit end = struct let tbl = Stmt.Hashtbl.create 17 let add = Stmt.Hashtbl.add tbl let find stmt = Stmt.Hashtbl.find tbl stmt let get_all stmt = try Stmt.Hashtbl.find_all tbl stmt with Not_found -> [] let is_empty () = Stmt.Hashtbl.length tbl = 0 let clear () = Stmt.Hashtbl.clear tbl end (* Mapping of statements to local variables available within that statement's scope. The mappings of this structure are used to determine variables which need to be removed before goto jumps. Generally, if some goto (with scope variables are given by set G') jumps to a labeled statement with scope variables given by set L', then the goto exists the scopes of variables given via set G' \ L'. Consequently, if those variables are tracked, they need to be removed from tracking. *) module SLocals = Build_env(struct type t = Varinfo.Set.t end) (* Statement to statement mapping indicating source/destination of a jump. For instance, break statements are mapped to switches or loops they jump out from and goto statements are mapped to their labeled statements. Notably, such information does not really be computed for gotos (since they already capture references to labelled statements they jumps to). Nevertheless it is done for consistency, so all required information is stored uniformly. *) module Exits = Build_env(struct type t = stmt end) (* Map labelled statements back to gotos which lead to them *) module LJumps = Build_env(struct type t = stmt end) let clear () = SLocals.clear (); Exits.clear (); LJumps.clear () let is_empty () = SLocals.is_empty () && Exits.is_empty () && LJumps.is_empty () let delete_vars stmt = match stmt.skind with | Goto _ | Break _ | Continue _ -> (try Varinfo.Set.diff (SLocals.find stmt) (SLocals.find (Exits.find stmt)) with Not_found -> Varinfo.Set.empty) | _ -> Varinfo.Set.empty let store_vars stmt = let gotos = LJumps.get_all stmt in List.fold_left (fun acc goto -> try Varinfo.Set.union acc (Varinfo.Set.diff (SLocals.find stmt) (SLocals.find goto)) with Not_found -> assert false) Varinfo.Set.empty gotos let unify_sets = List.fold_left (fun acc v -> Varinfo.Set.union v acc) Varinfo.Set.empty class jump_context = object (_) inherit Visitor.frama_c_inplace val mutable locals = [] (* Maintained list of local variables within the scope of a currently visited statement. Variables within a single scope are given by a single set *) val jumps = Stack.create () (* Stack of entered switches and loops *) method !vblock blk = (* Filter out variables which definitions appear later in the code *) let vardefs = List.filter (fun vi -> not vi.vdefined) blk.blocals in locals <- Varinfo.Set.of_list vardefs :: locals; Cil.DoChildrenPost (fun blk -> locals <- List.tl locals; blk) method !vstmt stmt = let add_labels stmt = match stmt.labels with | [] -> () | _ :: _ -> SLocals.add stmt (unify_sets locals) in match stmt.skind with | Loop _ | Switch _ -> SLocals.add stmt (unify_sets locals); Stack.push stmt jumps; Cil.DoChildrenPost (fun st -> ignore(Stack.pop jumps); st) | Break _ | Continue _ -> Exits.add stmt (Stack.top jumps); SLocals.add stmt (unify_sets locals); Cil.DoChildren | Goto(sref, _) -> SLocals.add stmt (unify_sets locals); Exits.add stmt !sref; LJumps.add !sref stmt; Cil.DoChildren | Instr(Local_init (vi, _, _)) -> locals <- (Varinfo.Set.add vi (List.hd locals)) :: List.tl locals; add_labels stmt; Cil.DoChildren | Instr _ | Return _ | If _ | Block _ | UnspecifiedSequence _ | Throw _ | TryCatch _ | TryFinally _ | TryExcept _ -> add_labels stmt; Cil.DoChildren end let generate fct = assert (is_empty ()); ignore (Cil.visitCilFunction (new jump_context :> Cil.cilVisitor) fct) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/exit_points.mli0000666000000000000000000000531113571573400022305 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** E-ACSL tracks a local variable by injecting: - a call to [__e_acsl_store_block] at the beginning of its scope, and - a call to [__e_acsl_delete_block] at the end of the scope. This is not always sufficient to track variables because execution may exit a scope early (for instance via a goto or a break statement). This module computes program points at which extra `delete_block` statements need to be added to handle such early scope exits. *) open Cil_types open Cil_datatype val generate: fundec -> unit (** Visit a function and populate data structures used to compute exit points *) val clear: unit -> unit (** Clear all gathered data *) val delete_vars: stmt -> Varinfo.Set.t (** Given a statement which potentially leads to an early scope exit (such as goto, break or continue) return the list of local variables which need to be removed from tracking before that statement is executed. Before calling this function [generate] need to be executed. *) val store_vars: stmt -> Varinfo.Set.t (** Compute variables that should be re-recorded before a labelled statement to which some goto jumps *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/interval.ml0000666000000000000000000004774713571573400021436 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* Implements Figure 3 of J. Signoles' JFLA'15 paper "Rester statique pour devenir plus rapide, plus précis et plus mince". Also implements a support for real numbers. *) (* ********************************************************************* *) (* Basic datatypes and operations *) (* ********************************************************************* *) type ival = | Ival of Ival.t | Float of fkind * float option (* a float constant, if any *) | Rational | Real | Nan module D = Datatype.Make_with_collections (struct type t = ival let name = "E_ACSL.Interval.t" let reprs = [ Float (FFloat, Some 0.); Rational; Real; Nan ] include Datatype.Undefined let compare i1 i2 = if i1 == i2 then 0 else match i1, i2 with | Ival i1, Ival i2 -> Ival.compare i1 i2 | Float (k1, f1), Float (k2, f2) -> (* faster to compare a kind than a float *) let n = Transitioning.Stdlib.compare k1 k2 in if n = 0 then Transitioning.Stdlib.compare f1 f2 else n | Ival _, (Float _ | Rational | Real | Nan) | Float _, (Rational | Real | Nan) | Rational, (Real | Nan) | Real, Nan -> -1 | Nan, (Ival _ | Float _ | Rational | Real) | Real, (Ival _ | Float _ | Rational) | Rational, (Ival _ | Float _) | Float _, Ival _ -> 1 | Rational, Rational | Real, Real | Nan, Nan -> assert false let equal = Datatype.from_compare let hash = function | Ival i -> 7 * Ival.hash i | Float(k, f) -> 17 * Hashtbl.hash f + 97 * Hashtbl.hash k | Rational -> 787 | Real -> 1011 | Nan -> 1277 let pretty fmt = function | Ival i -> Ival.pretty fmt i | Float(_, Some f) -> Format.pp_print_float fmt f | Float(FFloat, None) -> Format.pp_print_string fmt "float" | Float(FDouble, None) -> Format.pp_print_string fmt "double" | Float(FLongDouble, None) -> Format.pp_print_string fmt "long double" | Rational -> Format.pp_print_string fmt "Rational" | Real -> Format.pp_print_string fmt "Real" | Nan -> Format.pp_print_string fmt "NaN" end) let is_included i1 i2 = match i1, i2 with | Ival i1, Ival i2 -> Ival.is_included i1 i2 | Float(k1, f1), Float(k2, f2) -> Transitioning.Stdlib.compare k1 k2 <= 0 && (match f1, f2 with | None, None | Some _, None -> true | None, Some _ -> false | Some f1, Some f2 -> f1 = f2) | (Ival _ | Float _ | Rational), (Rational | Real) | Real, Real | Nan, Nan -> true (* floats and integer are not comparable: *) | Ival _, Float _ | Float _, Ival _ (* nan is comparable to noone, but itself: *) | (Ival _ | Float _ | Rational | Real), Nan | Nan, (Ival _ | Float _ | Rational | Real) (* cases for reals and rationals: *) | Real, (Ival _ | Float _ | Rational) | Rational, (Ival _ | Float _) -> false let lift_unop f = function | Ival iv -> Ival (f iv) | Float _ -> (* any unary operator over a float generates a rational TODO: actually, certainly possible to generate a float *) Rational | Rational | Real | Nan as i -> i let lift_binop ~safe_float f i1 i2 = match i1, i2 with | Ival iv, i when Ival.is_bottom iv -> i | i, Ival iv when Ival.is_bottom iv -> i | Ival i1, Ival i2 -> Ival (f i1 i2) | Float(k1, _), Float(k2, _) when safe_float -> let k = if Transitioning.Stdlib.compare k1 k2 >= 0 then k1 else k2 in Float(k, None (* lost value, if any before *)) | Ival iv, Float(k, _) | Float(k, _), Ival iv -> if safe_float then match Ival.min_and_max iv with | None, None -> (* unbounded integers *) Rational | Some min, Some max -> (* if the interval of integers fits into the float types, then return this float type; otherwise return Rational *) (try let to_float n = Int64.to_float (Integer.to_int64 n) in let mini, maxi = to_float min, to_float max in let minf, maxf = match k with | FFloat -> Floating_point.most_negative_single_precision_float, Floating_point.max_single_precision_float | FDouble -> -. Transitioning.Float.max_float, Transitioning.Float.max_float | FLongDouble -> raise Exit in if mini >= minf && maxi <= maxf then Float(k, None) else Rational with Z.Overflow | Exit -> Rational) | None, Some _ | Some _, None -> assert false else Rational (* sound over-approximation *) | (Ival _ | Float _ | Rational), (Float _ | Rational) | Rational, Ival _ -> Rational | (Ival _ | Float _ | Rational | Real), Real | Real, (Ival _ | Float _ | Rational) -> Real | (Ival _ | Float _ | Rational | Real | Nan), Nan | Nan, (Ival _ | Float _ | Rational | Real) -> Nan let join = lift_binop ~safe_float:true Ival.join (* TODO: soundness of any downcast is not checked *) let cast ~src ~dst = match src, dst with | Ival i1, Ival i2 -> Ival (Ival.meet i1 i2) | _, Float(_, Some _) -> assert false | Rational, Real | Float _, (Rational | Real) -> src | _, _ -> (* No need to optimize the other cases: if someone writes a cast (in particular, from integer to float/real or conversely), it is certainly on purpose . *) dst (* ********************************************************************* *) (* constructors and destructors *) (* ********************************************************************* *) let extract_ival = function | Ival iv -> iv | Float _ | Rational | Real | Nan -> assert false let bottom = Ival Ival.bottom let top_ival = Ival (Ival.inject_range None None) let singleton n = Ival (Ival.inject_singleton n) let singleton_of_int n = singleton (Integer.of_int n) let ival min max = Ival (Ival.inject_range (Some min) (Some max)) let interv_of_unknown_block = (* since we have no idea of the size of this block, we take the largest possible one which is unfortunately quite large *) lazy (ival Integer.zero (Bit_utils.max_byte_address ())) (* ********************************************************************* *) (* main algorithm *) (* ********************************************************************* *) (* The boolean indicates whether we have real numbers *) let rec interv_of_typ ty = match Cil.unrollType ty with | TInt (k,_) as ty -> let n = Cil.bitsSizeOf ty in let l, u = if Cil.isSigned k then Cil.min_signed_number n, Cil.max_signed_number n else Integer.zero, Cil.max_unsigned_number n in ival l u | TEnum(enuminfo, _) -> interv_of_typ (TInt(enuminfo.ekind, [])) | _ when Gmp_types.Z.is_t ty -> top_ival | TFloat (k, _) -> Float(k, None) | _ when Gmp_types.Q.is_t ty -> Rational (* only rationals are implemented *) | TVoid _ | TPtr _ | TArray _ | TFun _ | TComp _ | TBuiltin_va_list _ -> Nan | TNamed _ -> assert false let interv_of_logic_typ = function | Ctype ty -> interv_of_typ ty | Linteger -> top_ival | Lreal -> Real | Ltype _ -> Error.not_yet "user-defined logic type" | Lvar _ -> Error.not_yet "type variable" | Larrow _ -> Nan let ikind_of_ival iv = if Ival.is_bottom iv then IInt else match Ival.min_and_max iv with | Some l, Some u -> let is_pos = Integer.ge l Integer.zero in let lkind = Cil.intKindForValue l is_pos in let ukind = Cil.intKindForValue u is_pos in (* kind corresponding to the interval *) let kind = if Cil.intTypeIncluded lkind ukind then ukind else lkind in (* convert the kind to [IInt] whenever smaller. *) if Cil.intTypeIncluded kind IInt then IInt else kind | None, None -> raise Cil.Not_representable (* GMP *) (* TODO: do not raise an exception, but returns a value instead *) | None, Some _ | Some _, None -> Kernel.fatal ~current:true "unexpected ival: %a" Ival.pretty iv (* function call profiles (intervals for their formal parameters) *) module Profile = struct include Datatype.List_with_collections (D) (struct let module_name = "E_ACSL.Interval.Logic_function_env.Profile" end) let is_included p1 p2 = List.for_all2 is_included p1 p2 end (* Imperative environments *) module rec Env: sig val clear: unit -> unit val add: Cil_types.logic_var -> ival -> unit val find: Cil_types.logic_var -> ival val remove: Cil_types.logic_var -> unit val replace: Cil_types.logic_var -> ival -> unit end = struct open Cil_datatype let tbl: ival Logic_var.Hashtbl.t = Logic_var.Hashtbl.create 7 (* TODO: when adding, also join with the old value (if any). Would certainly be the correct way to handle a \let in a recursive logic functions (if the \let body depends on one formal) *) let add = Logic_var.Hashtbl.add tbl let remove = Logic_var.Hashtbl.remove tbl let replace = Logic_var.Hashtbl.replace tbl let find = Logic_var.Hashtbl.find tbl let clear () = Logic_var.Hashtbl.clear tbl; Logic_function_env.clear () end (* Environment for handling logic functions *) and Logic_function_env: sig val widen: infer:(term -> ival) -> term -> ival -> bool * ival val clear: unit -> unit end = struct (* The environment associates to each term (denoting a logic function application) a profile, i.e. the list of intervals for its formal parameters. It helps to type these applications. For each pair of function name and profile, an interval containing the result is also stored. It helps to generate the function definitions for each logic function (for each function, one definition per profile) . *) module Terms = Hashtbl.Make (struct type t = term let equal = (==) let hash = Cil_datatype.Term.hash end) module LF = Datatype.Pair_with_collections (Datatype.String) (Profile) (struct let module_name = "E_ACSL.Interval.Logic_function_env.LF" end) let terms: Profile.t Terms.t = Terms.create 7 let named_profiles = LF.Hashtbl.create 7 let clear () = Terms.clear terms; LF.Hashtbl.clear named_profiles let interv_of_typ_containing_interv = function | Float _ | Rational | Real | Nan as x -> x | Ival i -> try let kind = ikind_of_ival i in interv_of_typ (TInt(kind, [])) with Cil.Not_representable -> top_ival let rec map3 f l1 l2 l3 = match l1, l2, l3 with | [], [], [] -> [] | x1 :: l1, x2 :: l2, x3 :: l3 -> f x1 x2 x3 :: map3 f l1 l2 l3 | _, _, _ -> invalid_arg "E_ACSL.Interval.map3" let extract_profile ~infer old_profile t = match t.term_node with | Tapp(li, _, args) -> let old_profile = match old_profile with | None -> List.map (fun _ -> bottom) li.l_profile | Some p -> p in li.l_var_info.lv_name, map3 (fun param old_i arg -> let i = infer arg in (* over-approximation of the interval to reach the fixpoint faster, and to generate fewer specialized functions *) let larger_i = interv_of_typ_containing_interv i in (* merge the old profile and the new one *) let new_i = join larger_i old_i in Env.add param new_i; new_i) li.l_profile old_profile args | _ -> assert false let widen_one_callsite ~infer old_profile t i = let (_, p as named_p) = extract_profile ~infer old_profile t in try let old_i = LF.Hashtbl.find named_profiles named_p in if is_included i old_i then true, p, old_i (* fixpoint reached *) else begin let j = join i old_i in LF.Hashtbl.replace named_profiles named_p j; false, p, j end with Not_found -> LF.Hashtbl.add named_profiles named_p i; false, p, i let widen ~infer t i = try let old_p = Terms.find terms t in let is_included, new_p, i = widen_one_callsite ~infer (Some old_p) t i in if Profile.is_included new_p old_p then is_included, i else begin Terms.replace terms t new_p; false, i end with Not_found -> let is_included, p, i = widen_one_callsite ~infer None t i in Terms.add terms t p; is_included, i end (* ********************************************************************* *) (* Main algorithm *) (* ********************************************************************* *) let infer_sizeof ty = try singleton_of_int (Cil.bytesSizeOf ty) with Cil.SizeOfError _ -> interv_of_typ Cil.theMachine.Cil.typeOfSizeOf let infer_alignof ty = singleton_of_int (Cil.bytesAlignOf ty) let rec infer t = let get_cty t = match t.term_type with Ctype ty -> ty | _ -> assert false in match t.term_node with | TConst (Integer (n, _)) -> singleton n | TConst (LChr c) -> let n = Cil.charConstToInt c in singleton n | TConst (LEnum enumitem) -> let rec find_idx n = function | [] -> assert false | ei :: l -> if ei == enumitem then n else find_idx (n + 1) l in let n = Integer.of_int (find_idx 0 enumitem.eihost.eitems) in singleton n | TLval lv -> infer_term_lval lv | TSizeOf ty -> infer_sizeof ty | TSizeOfE t -> infer_sizeof (get_cty t) | TSizeOfStr str -> singleton_of_int (String.length str + 1 (* '\0' *)) | TAlignOf ty -> infer_alignof ty | TAlignOfE t -> infer_alignof (get_cty t) | TUnOp (Neg, t) -> let i = infer t in lift_unop Ival.neg_int i | TUnOp (BNot, t) -> let i = infer t in lift_unop Ival.bitwise_signed_not i | TUnOp (LNot, _) | TBinOp ((Lt | Gt | Le | Ge | Eq | Ne | LAnd | LOr), _, _) -> Ival Ival.zero_or_one | TBinOp (PlusA, t1, t2) -> let i1 = infer t1 in let i2 = infer t2 in lift_binop ~safe_float:false Ival.add_int i1 i2 | TBinOp (MinusA, t1, t2) -> let i1 = infer t1 in let i2 = infer t2 in lift_binop ~safe_float:false Ival.sub_int i1 i2 | TBinOp (Mult, t1, t2) -> let i1 = infer t1 in let i2 = infer t2 in lift_binop ~safe_float:false Ival.mul i1 i2 | TBinOp (Div, t1, t2) -> let i1 = infer t1 in let i2 = infer t2 in lift_binop ~safe_float:false Ival.div i1 i2 | TBinOp (Mod, t1, t2) -> let i1 = infer t1 in let i2 = infer t2 in lift_binop ~safe_float:false Ival.c_rem i1 i2 | TBinOp (Shiftlt , _, _) -> Error.not_yet "right shift" | TBinOp (Shiftrt , _, _) -> Error.not_yet "left shift" | TBinOp (BAnd, _, _) -> Error.not_yet "bitwise and" | TBinOp (BXor, t1, t2) -> let i1 = infer t1 in let i2 = infer t2 in lift_binop ~safe_float:false Ival.bitwise_xor i1 i2 | TBinOp (BOr, t1, t2) -> let i1 = infer t1 in let i2 = infer t2 in lift_binop ~safe_float:false Ival.bitwise_or i1 i2 | TCastE (ty, t) -> let src = infer t in let dst = interv_of_typ ty in cast ~src ~dst | Tif (_, t2, t3) -> let i2 = infer t2 in let i3 = infer t3 in join i2 i3 | Tat (t, _) -> infer t | TBinOp (MinusPP, t, _) -> (match Cil.unrollType (get_cty t) with | TArray(_, _, { scache = Computed n (* size in bits *) }, _) -> (* the second argument must be in the same block than [t]. Consequently the result of the difference belongs to [0; \block_length(t)] *) let nb_bytes = if n mod 8 = 0 then n / 8 else n / 8 + 1 in ival Integer.zero (Integer.of_int nb_bytes) | TArray _ | TPtr _ -> Lazy.force interv_of_unknown_block | _ -> assert false) | Tblock_length (_, t) | Toffset(_, t) -> (match Cil.unrollType (get_cty t) with | TArray(_, _, { scache = Computed n (* size in bits *) }, _) -> let nb_bytes = if n mod 8 = 0 then n / 8 else n / 8 + 1 in singleton_of_int nb_bytes | TArray _ | TPtr _ -> Lazy.force interv_of_unknown_block | _ -> assert false) | Tnull -> singleton_of_int 0 | TLogic_coerce (_, t) -> infer t | Tapp (li, _, _args) -> (match li.l_body with | LBpred _ -> Ival Ival.zero_or_one | LBterm t' -> let rec fixpoint i = let is_included, new_i = Logic_function_env.widen ~infer t i in if is_included then begin List.iter (fun lv -> Env.remove lv) li.l_profile; new_i end else let i = infer t' in List.iter (fun lv -> Env.remove lv) li.l_profile; fixpoint i in fixpoint bottom | LBnone | LBreads _ -> (match li.l_type with | None -> assert false | Some ret_type -> interv_of_logic_typ ret_type) | LBinductive _ -> Error.not_yet "logic functions inductively defined") | Tunion _ -> Error.not_yet "tset union" | Tinter _ -> Error.not_yet "tset intersection" | Tcomprehension (_,_,_) -> Error.not_yet "tset comprehension" | Trange(Some n1, Some n2) -> let i1 = infer n1 in let i2 = infer n2 in join i1 i2 | Trange(None, _) | Trange(_, None) -> Options.abort "unbounded ranges are not part of E-ACSl" | Tlet (li, t) -> let li_t = Misc.term_of_li li in let li_v = li.l_var_info in let i1 = infer li_t in Env.add li_v i1; let i2 = infer t in Env.remove li_v; i2 | TConst (LReal lr) -> if lr.r_lower = lr.r_upper then Float(FDouble, Some lr.r_nearest) else Rational | TConst (LStr _ | LWStr _) | TBinOp (PlusPI,_,_) | TBinOp (IndexPI,_,_) | TBinOp (MinusPI,_,_) | TAddrOf _ | TStartOf _ | Tlambda (_,_) | TDataCons (_,_) | Tbase_addr (_,_) | TUpdate (_,_,_) | Ttypeof _ | Ttype _ | Tempty_set -> Nan and infer_term_lval (host, offset as tlv) = match offset with | TNoOffset -> infer_term_host host | _ -> let ty = Logic_utils.logicCType (Cil.typeOfTermLval tlv) in interv_of_typ ty and infer_term_host thost = match thost with | TVar v -> (try Env.find v with Not_found -> match v.lv_type with | Linteger -> top_ival | Ctype (TFloat(fk, _)) -> Float(fk, None) | Lreal -> Real | Ctype _ -> interv_of_typ (Logic_utils.logicCType v.lv_type) | Ltype _ | Lvar _ | Larrow _ -> Options.fatal "unexpected logic type") | TResult ty -> interv_of_typ ty | TMem t -> let ty = Logic_utils.logicCType t.term_type in match Cil.unrollType ty with | TPtr(ty, _) | TArray(ty, _, _, _) -> interv_of_typ ty | _ -> Options.fatal "unexpected type %a for term %a" Printer.pp_typ ty Printer.pp_term t include D (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/interval.mli0000666000000000000000000001130713571573400021566 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Interval inference for terms. Compute the smallest interval that contains all the possible values of a given integer term. The interval of C variables is directly inferred from their C type. The interval of logic variables must be registered from outside before computing the interval of a term containing such variables (see module {!Interval.Env}). It implements Figure 3 of J. Signoles' JFLA'15 paper "Rester statique pour devenir plus rapide, plus précis et plus mince". Also implements a partial support for real numbers. Example: consider a variable [x] of type [int] on a (strange) architecture in which values of type [int] belongs to the interval \[-128;127\] and a logic variable [y] which was registered in the environment with an interval \[-32;31\]. Then here are the intervals computed from the term [1+(x+1)/(y-64)]: 1. x in \[128;127\]; 2. x+1 in \[129;128\]; 3. y in \[-32;31\]; 4. y-64 in \[-96;-33\]; 5. (x+1)/(y-64) in \[-3;3\]; 6. 1+(x+1)/(y-64) in \[-2;4\] Note: this is a partial wrapper on top of [Ival.t], to which most functions are delegated. *) (* ************************************************************************** *) (** {3 Useful operations on intervals} *) (* ************************************************************************** *) type ival = | Ival of Ival.t | Float of Cil_types.fkind * float option | Rational | Real | Nan include Datatype.S_with_collections with type t = ival val is_included: t -> t -> bool val join: t -> t -> t val top_ival: t val ival: Integer.t -> Integer.t -> t (** assume [Ival _] as argument *) val extract_ival: t -> Ival.t val ikind_of_ival: Ival.t -> Cil_types.ikind (** @return the smallest ikind that contains the given interval. @raise Cil.Not_representable if the given interval does not fit into any C integral type. *) val interv_of_typ: Cil_types.typ -> t (** @return the smallest interval which contains the given C type. @raise Is_a_real if the given type is a float type. @raise Not_a_number if the given type does not represent any number. *) (* ************************************************************************** *) (** {3 Environment for interval computations} *) (* ************************************************************************** *) (** Environment which maps logic variables to intervals. This environment must be extended from outside. *) module Env: sig val clear: unit -> unit val add: Cil_types.logic_var -> t -> unit val remove: Cil_types.logic_var -> unit val replace: Cil_types.logic_var -> t -> unit end (* ************************************************************************** *) (** {3 Inference system} *) (* ************************************************************************** *) val infer: Cil_types.term -> t (** [infer t] infers the smallest possible integer interval which the values of the term can fit in. @raise Is_a_real if the term is either a float or a real. @raise Not_a_number if the term does not represent any number. *) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/literal_strings.ml0000666000000000000000000000400413571573400022772 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types let strings : varinfo Datatype.String.Hashtbl.t = Datatype.String.Hashtbl.create 16 let reset () = Datatype.String.Hashtbl.clear strings let is_empty () = Datatype.String.Hashtbl.length strings = 0 let add = Datatype.String.Hashtbl.add strings let find = Datatype.String.Hashtbl.find strings let fold f = Datatype.String.Hashtbl.fold_sorted f strings (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/literal_strings.mli0000666000000000000000000000364413571573400023154 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Associate literal strings to fresh varinfo. *) open Cil_types val reset: unit -> unit (** Must be called to redo the analysis *) val is_empty: unit -> bool val add: string -> varinfo -> unit val find: string -> varinfo val fold: (string -> varinfo -> 'a -> 'a) -> 'a -> 'a (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/lscope.ml0000666000000000000000000000527313571573400021063 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type lscope_var = | Lvs_let of logic_var * term | Lvs_quantif of term * relation * logic_var * relation * term | Lvs_formal of logic_var * logic_info | Lvs_global of logic_var * term type t = lscope_var list (* The logic scope is usually small, so a list is fine instead of a Map *) let empty = [] let is_empty = function [] -> true | _ :: _ -> false let add lscope_var t = lscope_var :: t let get_all t = List.rev t let exists lv t = let is_lv = function | Lvs_let(lv', _) | Lvs_quantif(_, _, lv', _, _) | Lvs_formal(lv', _) | Lvs_global(lv', _) -> Cil_datatype.Logic_var.equal lv lv' in List.exists is_lv t exception Lscope_used let is_used lscope pot = let o = object inherit Visitor.frama_c_inplace method !vlogic_var_use lv = match lv.lv_origin with | Some _ -> Cil.SkipChildren | None -> if exists lv lscope then raise Lscope_used else Cil.SkipChildren end in try (match pot with | Misc.PoT_pred p -> ignore (Visitor.visitFramacPredicate o p) | Misc.PoT_term t -> ignore (Visitor.visitFramacTerm o t)); false with Lscope_used -> trueframa-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/lscope.mli0000666000000000000000000000521013571573400021223 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* Handle the logic scope of a term. We define the logic scope of a term [t] to be the set of PURELY logic variables that are visible by [t]. *) type lscope_var = | Lvs_let of logic_var * term (* the expression to which the lv is binded *) | Lvs_quantif of term * relation * logic_var * relation * term | Lvs_formal of logic_var * logic_info (* the logic definition *) | Lvs_global of logic_var * term (* same as Lvs_let *) type t val empty: t (* Create an empty logic scope. *) val is_empty: t -> bool (* Check whether the given logic scope is empty. *) val add: lscope_var -> t -> t (* Return a new logic scope in which the given [lscope_var] has been added. *) val get_all: t -> lscope_var list (* Return the list of [lscope_var] of the given logic scope. The first element is the first [lscope_var] that was added to [t], the second element is the second [lscope_var] that was added to [t], an so on. *) val is_used: t -> Misc.pred_or_term -> bool (* [is_used lscope pot] returns [true] iff [pot] uses a variable from [lscope]. *)frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/mmodel_analysis.ml0000666000000000000000000007106013571573400022753 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype module Dataflow = Dataflow2 let must_never_monitor vi = (* E-ACSL, please do not monitor yourself! *) Functions.RTL.is_rtl_name vi.vname || (* extern ghost variables are usually used (by the Frama-C libc) to represent some internal invisible states in ACSL specifications. They do not correspond to something concrete *) (vi.vghost && vi.vstorage = Extern) || (* incomplete types cannot be properly monitored. See BTS #2406. *) not (Cil.isCompleteType vi.vtype) (* ********************************************************************** *) (* Backward dataflow analysis to compute a sound over-approximation of what left-values must be tracked by the memory model library *) (* ********************************************************************** *) let dkey = Options.dkey_analysis module Env: sig val has_heap_allocations: unit -> bool val check_heap_allocations: kernel_function -> unit val default_varinfos: Varinfo.Hptset.t option -> Varinfo.Hptset.t val apply: (kernel_function -> 'a) -> kernel_function -> 'a val clear: unit -> unit val add: kernel_function -> Varinfo.Hptset.t option Stmt.Hashtbl.t -> unit val add_init: kernel_function -> Varinfo.Hptset.t option -> unit val mem_init: kernel_function -> Varinfo.Hptset.t option -> bool val find: kernel_function -> Varinfo.Hptset.t option Stmt.Hashtbl.t module StartData: Dataflow.StmtStartData with type data = Varinfo.Hptset.t option val is_consolidated: unit -> bool val consolidate: Varinfo.Hptset.t -> unit val consolidated_mem: varinfo -> bool val is_empty: unit -> bool end = struct let heap_allocation_ref = ref false let has_heap_allocations () = !heap_allocation_ref let check_heap_allocations kf = (* a function with no definition potentially allocates memory *) heap_allocation_ref := !heap_allocation_ref || not (Kernel_function.is_definition kf) let current_kf = ref None let default_varinfos = function None -> Varinfo.Hptset.empty | Some s -> s let apply f kf = let old = !current_kf in current_kf := Some kf; let res = f kf in current_kf := old; res let tbl = Kernel_function.Hashtbl.create 7 let add = Kernel_function.Hashtbl.add tbl let find = Kernel_function.Hashtbl.find tbl module S = Set.Make(Datatype.Option(Varinfo.Hptset)) let tbl_init = Kernel_function.Hashtbl.create 7 let add_init kf init = let set = try Kernel_function.Hashtbl.find tbl_init kf with Not_found -> S.empty in let set = S.add init set in Kernel_function.Hashtbl.replace tbl_init kf set let mem_init kf init = try let set = Kernel_function.Hashtbl.find tbl_init kf in S.mem init set with Not_found -> false module StartData = struct type data = Varinfo.Hptset.t option let apply f = try let kf = Extlib.opt_conv (Kernel_function.dummy()) !current_kf in let h = Kernel_function.Hashtbl.find tbl kf in f h with Not_found -> assert false let clear () = apply Stmt.Hashtbl.clear let mem k = apply Stmt.Hashtbl.mem k let find k = apply Stmt.Hashtbl.find k let replace k v = apply Stmt.Hashtbl.replace k v let add k v = apply Stmt.Hashtbl.add k v let iter f = apply (Stmt.Hashtbl.iter f) let length () = apply Stmt.Hashtbl.length end (* TODO: instead of this costly consolidation, why do not take the state of the entry point of the function? *) let consolidated_set = ref Varinfo.Hptset.empty let is_consolidated_ref = ref false let consolidate set = let set = Varinfo.Hptset.union set !consolidated_set in consolidated_set := set let consolidated_mem v = is_consolidated_ref := true; Varinfo.Hptset.mem v !consolidated_set let is_consolidated () = !is_consolidated_ref let is_empty () = try Kernel_function.Hashtbl.iter (fun _ h -> Stmt.Hashtbl.iter (fun _ set -> match set with | None -> () | Some s -> if not (Varinfo.Hptset.is_empty s) then raise Exit) h) tbl; true with Exit -> false let clear () = Kernel_function.Hashtbl.clear tbl; consolidated_set := Varinfo.Hptset.empty; is_consolidated_ref := false; heap_allocation_ref := false end let reset () = Options.feedback ~dkey ~level:2 "clearing environment."; Env.clear () module rec Transfer : Dataflow.BackwardsTransfer with type t = Varinfo.Hptset.t option = struct let name = "E_ACSL.Pre_analysis" let debug = false type t = Varinfo.Hptset.t option module StmtStartData = Env.StartData let pretty fmt state = match state with | None -> Format.fprintf fmt "None" | Some s -> Format.fprintf fmt "%a" Varinfo.Hptset.pretty s (** The data at function exit. Used for statements with no successors. This is usually bottom, since we'll also use doStmt on Return statements. *) let funcExitData = None (** When the analysis reaches the start of a block, combine the old data with the one we have just computed. Return None if the combination is the same as the old data, otherwise return the combination. In the latter case, the predecessors of the statement are put on the working list. *) let combineStmtStartData stmt ~old state = match stmt.skind, old, state with | _, _, None -> assert false | _, None, Some _ -> Some state (* [old] already included in [state] *) | Return _, Some old, Some new_ -> Some (Some (Varinfo.Hptset.union old new_)) | _, Some old, Some new_ -> if Varinfo.Hptset.equal old new_ then None else Some (Some (Varinfo.Hptset.union old new_)) (** Take the data from two successors and combine it *) let combineSuccessors s1 s2 = Some (Varinfo.Hptset.union (Env.default_varinfos s1) (Env.default_varinfos s2)) let is_ptr_or_array ty = Cil.isPointerType ty || Cil.isArrayType ty let is_ptr_or_array_exp e = let ty = Cil.typeOf e in is_ptr_or_array ty let may_alias li = match li.l_var_info.lv_type with | Ctype ty -> is_ptr_or_array ty | Linteger | Lreal -> false | Ltype _ -> Error.not_yet "user defined type" | Lvar _ -> Error.not_yet "named type" | Larrow _ -> Error.not_yet "functional type" let rec base_addr_node = function | Lval lv | AddrOf lv | StartOf lv -> (match lv with | Var vi, _ -> Some vi | Mem e, _ -> base_addr e) | BinOp((PlusPI | IndexPI | MinusPI), e1, e2, _) -> if is_ptr_or_array_exp e1 then base_addr e1 else begin assert (is_ptr_or_array_exp e2); base_addr e2 end | Info(e, _) | CastE(_, e) -> base_addr e | BinOp((MinusPP | PlusA | MinusA | Mult | Div | Mod |Shiftlt | Shiftrt | Lt | Gt | Le | Ge | Eq | Ne | BAnd | BXor | BOr | LAnd | LOr), _, _, _) | UnOp _ | Const _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> None and base_addr e = base_addr_node e.enode let extend_to_expr always state lhost e = let add_vi state vi = if is_ptr_or_array_exp e && (always || Varinfo.Hptset.mem vi state) then begin match base_addr e with | None -> state | Some vi_e -> if must_never_monitor vi then state else begin Options.feedback ~level:4 ~dkey "monitoring %a from %a." Printer.pp_varinfo vi_e Printer.pp_lval (lhost, NoOffset); Varinfo.Hptset.add vi_e state end end else state in match lhost with | Var vi -> add_vi state vi | Mem e -> match base_addr e with | None -> state | Some vi -> add_vi state vi (* if [e] contains a pointer left-value, then also monitor the host *) let rec extend_from_addr state lv e = match e.enode with | Lval(lhost, _) -> if is_ptr_or_array_exp e then extend_to_expr true state lhost (Cil.new_exp ~loc:e.eloc (Lval lv)), true else state, false | AddrOf(lhost, _) -> extend_to_expr true state lhost (Cil.new_exp ~loc:e.eloc (Lval lv)), true | BinOp((PlusPI | IndexPI | MinusPI), e1, e2, _) -> if is_ptr_or_array_exp e1 then extend_from_addr state lv e1 else begin assert (is_ptr_or_array_exp e2); extend_from_addr state lv e2 end | CastE(_, e) | Info(e, _) -> extend_from_addr state lv e | _ -> state, false let handle_assignment state (lhost, _ as lv) e = (* if [e] is a pointer left-value, then also monitor the host *) let state, always = extend_from_addr state lv e in extend_to_expr always state lhost e let rec register_term_lval kf varinfos (thost, _) = let add_vi kf vi = Options.feedback ~level:4 ~dkey "monitoring %a from annotation of %a." Printer.pp_varinfo vi Kernel_function.pretty kf; Varinfo.Hptset.add vi varinfos in match thost with | TVar { lv_origin = None } -> varinfos | TVar { lv_origin = Some vi } -> add_vi kf vi | TResult _ -> add_vi kf (Misc.result_vi kf) | TMem t -> register_term kf varinfos t and register_term kf varinfos term = match term.term_node with | TLval tlv | TAddrOf tlv | TStartOf tlv -> register_term_lval kf varinfos tlv | TCastE(_, t) | Tat(t, _) -> register_term kf varinfos t | Tlet(li, t) -> if may_alias li then Error.not_yet "let-binding on array or pointer" else begin let varinfos = register_term kf varinfos t in register_body kf varinfos li.l_body end | Tif(_, t1, t2) -> let varinfos = register_term kf varinfos t1 in register_term kf varinfos t2 | TBinOp((PlusPI | IndexPI | MinusPI), t1, t2) -> (match t1.term_type with | Ctype ty when is_ptr_or_array ty -> register_term kf varinfos t1 | _ -> match t2.term_type with | Ctype ty when is_ptr_or_array ty -> register_term kf varinfos t2 | _ -> if Misc.is_set_of_ptr_or_array t1.term_type || Misc.is_set_of_ptr_or_array t2.term_type then (* Occurs for example from: \valid(&multi_dynamic[2..4][1..7]) where multi_dynamic has been dynamically allocated *) let varinfos = register_term kf varinfos t1 in register_term kf varinfos t2 else assert false) | TConst _ | TSizeOf _ | TSizeOfE _ | TSizeOfStr _ | TAlignOf _ | TAlignOfE _ | Tnull | Ttype _ | TUnOp _ | TBinOp _ -> varinfos | Tlambda(_, _) -> Error.not_yet "lambda function" | Tapp(_, _, _) -> Error.not_yet "function application" | TDataCons _ -> Error.not_yet "data constructor" | Tbase_addr _ -> Error.not_yet "\\base_addr" | Toffset _ -> Error.not_yet "\\offset" | Tblock_length _ -> Error.not_yet "\\block_length" | TLogic_coerce(_, t) -> register_term kf varinfos t | TUpdate _ -> Error.not_yet "functional update" | Ttypeof _ -> Error.not_yet "typeof" | Tempty_set -> Error.not_yet "empty set" | Tunion _ -> Error.not_yet "set union" | Tinter _ -> Error.not_yet "set intersection" | Tcomprehension _ -> Error.not_yet "set comprehension" | Trange(Some t1, Some t2) -> let varinfos = register_term kf varinfos t1 in register_term kf varinfos t2 | Trange(None, _) | Trange(_, None) -> Options.abort "unbounded ranges are not part of E-ACSL" and register_body kf varinfos = function | LBnone | LBreads _ -> varinfos | LBterm t -> register_term kf varinfos t | LBpred _ -> Options.fatal "unexpected predicate" | LBinductive _ -> Error.not_yet "inductive definitions" let register_object kf state_ref = object inherit Visitor.frama_c_inplace method !vpredicate_node = function | Pvalid(_, t) | Pvalid_read(_, t) | Pvalid_function t | Pinitialized(_, t) | Pfreeable(_, t) -> (* Options.feedback "REGISTER %a" Cil.d_term t;*) state_ref := register_term kf !state_ref t; Cil.DoChildren | Pallocable _ -> Error.not_yet "\\allocable" | Pfresh _ -> Error.not_yet "\\fresh" | Pseparated _ -> Error.not_yet "\\separated" | Pdangling _ -> Error.not_yet "\\dangling" | Ptrue | Pfalse | Papp _ | Prel _ | Pand _ | Por _ | Pxor _ | Pimplies _ | Piff _ | Pnot _ | Pif _ | Pforall _ | Pexists _ | Pat _ -> Cil.DoChildren | Plet(li, _) -> if may_alias li then Error.not_yet "let-binding on array or pointer" else begin state_ref := register_term kf !state_ref (Misc.term_of_li li); Cil.DoChildren end method !vterm term = match term.term_node with | Tbase_addr(_, t) | Toffset(_, t) | Tblock_length(_, t) | Tlet(_, t) -> state_ref := register_term kf !state_ref t; Cil.DoChildren | TConst _ | TSizeOf _ | TSizeOfStr _ | TAlignOf _ | Tnull | Ttype _ | Tempty_set -> (* no left-value inside inside: skip for efficiency *) Cil.SkipChildren | TUnOp _ | TBinOp _ | Ttypeof _ | TSizeOfE _ | TLval _ | TAlignOfE _ | TCastE _ | TAddrOf _ | TStartOf _ | Tapp _ | Tlambda _ | TDataCons _ | Tif _ | Tat _ | TUpdate _ | Tunion _ | Tinter _ | Tcomprehension _ | Trange _ | TLogic_coerce _ -> (* potential sub-term inside *) Cil.DoChildren method !vlogic_label _ = Cil.SkipChildren method !vterm_lhost = function | TMem t -> (* potential RTE *) state_ref := register_term kf !state_ref t; Cil.DoChildren | TVar _ | TResult _ -> Cil.SkipChildren end let register_predicate kf pred state = let state_ref = ref state in Error.handle (fun () -> ignore (Visitor.visitFramacIdPredicate (register_object kf state_ref) pred)) (); !state_ref let register_code_annot kf a state = let state_ref = ref state in Error.handle (fun () -> ignore (Visitor.visitFramacCodeAnnotation (register_object kf state_ref) a)) (); !state_ref let rec do_init vi init state = match init with | SingleInit e -> handle_assignment state (Var vi, NoOffset) e | CompoundInit(_, l) -> List.fold_left (fun state (_, init) -> do_init vi init state) state l let register_initializers state = let do_one vi init state = match init.init with | None -> state | Some init -> do_init vi init state in Globals.Vars.fold_in_file_rev_order do_one state (* below: compatibility with Fluorine *) (* let l = Globals.Vars.fold_in_file_order (fun v i l -> (v, i) :: l) [] in List.fold_left (fun state (v, i) -> do_one v i state) state l*) (** The (backwards) transfer function for a branch. The [(Cil.CurrentLoc.get ())] is set before calling this. If it returns None, then we have some default handling. Otherwise, the returned data is the data before the branch (not considering the exception handlers) *) let doStmt stmt = let _, kf = Kernel_function.find_from_sid stmt.sid in let is_first = try Stmt.equal stmt (Kernel_function.find_first_stmt kf) with Kernel_function.No_Statement -> assert false in let is_last = try Stmt.equal stmt (Kernel_function.find_return kf) with Kernel_function.No_Statement -> assert false in Dataflow.Post (fun state -> let state = Env.default_varinfos state in let state = if Functions.check kf then let state = if (is_first || is_last) && Functions.RTL.is_generated_kf kf then Annotations.fold_behaviors (fun _ bhv s -> let handle_annot test f s = if test then f (fun _ p s -> register_predicate kf p s) kf bhv.b_name s else s in let s = handle_annot is_first Annotations.fold_requires s in let s = handle_annot is_first Annotations.fold_assumes s in handle_annot is_last (fun f -> Annotations.fold_ensures (fun e (_, p) -> f e p)) s) kf state else state in let state = Annotations.fold_code_annot (fun _ -> register_code_annot kf) stmt state in if stmt.ghost then let rtes = Rte.stmt kf stmt in List.fold_left (fun state a -> register_code_annot kf a state) state rtes else state else (* not (Options.Functions.check kf): do not monitor [kf] *) state in let state = (* take initializers into account *) if is_first then let main, lib = Globals.entry_point () in if Kernel_function.equal kf main && not lib then register_initializers state else state else state in Some state) let do_call res f args state = let kf = Globals.Functions.get f in Env.check_heap_allocations kf; let params = Globals.Functions.get_params kf in let state = if Kernel_function.is_definition kf then try (* compute the initial state of the called function *) let init = List.fold_left2 (fun acc p a -> match base_addr a with | None -> acc | Some vi -> if Varinfo.Hptset.mem vi state then Varinfo.Hptset.add p acc else acc) state params args in let init = match res with | None -> init | Some lv -> match base_addr_node (Lval lv) with | None -> init | Some vi -> if Varinfo.Hptset.mem vi state then Varinfo.Hptset.add (Misc.result_vi kf) init else init in let state = Compute.get ~init kf in (* compute the resulting state by keeping arguments whenever the corresponding formals must be kept *) List.fold_left2 (fun acc p a -> match base_addr a with | None -> acc | Some vi -> if Varinfo.Hptset.mem p state then Varinfo.Hptset.add vi acc else acc) state params args with Invalid_argument _ -> Options.warning ~current:true "ignoring effect of variadic function %a" Kernel_function.pretty kf; state else state in let state = match res, Kernel_function.is_definition kf with | None, _ | _, false -> state | Some (lhost, _), true -> (* add the result if \result must be kept after calling the kf *) let vi = Misc.result_vi kf in if Varinfo.Hptset.mem vi state then match lhost with | Var vi -> Varinfo.Hptset.add vi state | Mem e -> match base_addr e with | None -> state | Some vi -> Varinfo.Hptset.add vi state else state in Dataflow.Done (Some state) (** The (backwards) transfer function for an instruction. The [(Cil.CurrentLoc.get ())] is set before calling this. If it returns None, then we have some default handling. Otherwise, the returned data is the data before the branch (not considering the exception handlers) *) let doInstr _stmt instr state = let state = Env.default_varinfos state in match instr with | Set(lv, e, _) -> let state = handle_assignment state lv e in Dataflow.Done (Some state) | Local_init(v,AssignInit i,_) -> let state = do_init v i state in Dataflow.Done (Some state) | Local_init(v,ConsInit(f,args,Constructor),_) -> do_call None f (Cil.mkAddrOfVi v :: args) state | Local_init(v,ConsInit(f,args,Plain_func),_) -> do_call (Some (Cil.var v)) f args state | Call(result, f_exp, l, _) -> (match f_exp.enode with | Lval(Var vi, NoOffset) -> do_call result vi l state | _ -> Options.warning ~current:true "function pointers may introduce too limited instrumentation."; (* imprecise function call: keep each argument *) Dataflow.Done (Some (List.fold_left (fun acc e -> match base_addr e with | None -> acc | Some vi -> Varinfo.Hptset.add vi acc) state l))) | Asm _ -> Error.not_yet "asm" | Skip _ | Code_annot _ -> Dataflow.Default (** Whether to put this statement in the worklist. This is called when a block would normally be put in the worklist. *) let filterStmt _predecessor _block = true end and Compute: sig val get: ?init:Varinfo.Hptset.t -> kernel_function -> Varinfo.Hptset.t end = struct module D = Dataflow.Backwards(Transfer) let compute init_set kf = Options.feedback ~dkey ~level:2 "entering in function %a." Kernel_function.pretty kf; assert (not (Misc.is_library_loc (Kernel_function.get_location kf))); let tbl, is_init = try Env.find kf, true with Not_found -> Stmt.Hashtbl.create 17, false in (* Options.feedback "ANALYSING %a" Kernel_function.pretty kf;*) if not is_init then Env.add kf tbl; (try let fundec = Kernel_function.get_definition kf in let stmts, returns = Dataflow.find_stmts fundec in if is_init then Extlib.may (fun set -> List.iter (fun s -> let old = try Extlib.the (Stmt.Hashtbl.find tbl s) with Not_found -> assert false in Stmt.Hashtbl.replace tbl s (Some (Varinfo.Hptset.union set old))) returns) init_set else begin List.iter (fun s -> Stmt.Hashtbl.add tbl s None) stmts; Extlib.may (fun set -> List.iter (fun s -> Stmt.Hashtbl.replace tbl s (Some set)) returns) init_set end; D.compute stmts with Kernel_function.No_Definition | Kernel_function.No_Statement -> ()); Options.feedback ~dkey ~level:2 "function %a done." Kernel_function.pretty kf; tbl let get ?init kf = if Misc.is_library_loc (Kernel_function.get_location kf) then Varinfo.Hptset.empty else try let stmt = Kernel_function.find_first_stmt kf in (* Options.feedback "GETTING %a" Kernel_function.pretty kf;*) let tbl = if Env.mem_init kf init then try Env.find kf with Not_found -> assert false else begin (* WARN: potentially incorrect in case of recursive call *) Env.add_init kf init; Env.apply (compute init) kf end in try let set = Stmt.Hashtbl.find tbl stmt in Env.default_varinfos set with Not_found -> Options.fatal "[pre_analysis] stmt never analyzed: %a" Printer.pp_stmt stmt with Kernel_function.No_Statement -> Varinfo.Hptset.empty end let consolidated_must_model_vi vi = if Env.is_consolidated () then Env.consolidated_mem vi else begin Options.feedback ~level:2 "performing pre-analysis for minimal memory \ instrumentation."; (try let main, _ = Globals.entry_point () in let set = Compute.get main in Env.consolidate set with Globals.No_such_entry_point s -> Options.warning ~once:true "%s@ \ @[The generated program may miss memory instrumentation@ \ if there are memory-related annotations.@]" s); Options.feedback ~level:2 "pre-analysis done."; Env.consolidated_mem vi end let must_model_vi bhv ?kf ?stmt vi = let vi = match bhv with | None -> vi | Some bhv -> Visitor_behavior.Get_orig.varinfo bhv vi in let _kf = match kf, stmt with | None, None | Some _, _ -> kf | None, Some stmt -> Some (Kernel_function.find_englobing_kf stmt) in (* [JS 2013/05/07] that is unsound to take the env from the given stmt in presence of aliasing with an address (see tests address.i). TODO: could be optimized though *) consolidated_must_model_vi vi (* match stmt, kf with | None, _ -> consolidated_must_model_vi vi | Some _, None -> assert false | Some stmt, Some kf -> if not (Env.is_consolidated ()) then ignore (consolidated_must_model_vi vi); try let tbl = Env.find kf in try let set = Stmt.Hashtbl.find tbl stmt in Varinfo.Hptset.mem vi (Env.default_varinfos set) with Not_found -> (* new statement *) consolidated_must_model_vi vi with Not_found -> (* [kf] is dead code *) false *) let rec apply_on_vi_base_from_lval f bhv ?kf ?stmt = function | Var vi, _ -> f bhv ?kf ?stmt vi | Mem e, _ -> apply_on_vi_base_from_exp f bhv ?kf ?stmt e and apply_on_vi_base_from_exp f bhv ?kf ?stmt e = match e.enode with | Lval lv | AddrOf lv | StartOf lv -> apply_on_vi_base_from_lval f bhv ?kf ?stmt lv | BinOp((PlusPI | IndexPI | MinusPI), e1, _, _) -> apply_on_vi_base_from_exp f bhv ?kf ?stmt e1 | BinOp(MinusPP, e1, e2, _) -> apply_on_vi_base_from_exp f bhv ?kf ?stmt e1 || apply_on_vi_base_from_exp f bhv ?kf ?stmt e2 | Info(e, _) | CastE(_, e) -> apply_on_vi_base_from_exp f bhv ?kf ?stmt e | BinOp((PlusA | MinusA | Mult | Div | Mod |Shiftlt | Shiftrt | Lt | Gt | Le | Ge | Eq | Ne | BAnd | BXor | BOr | LAnd | LOr), _, _, _) | Const _ -> (* possible in case of static address *) false | UnOp _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> Options.fatal "[pre_analysis] unexpected expression %a" Exp.pretty e let must_model_lval = apply_on_vi_base_from_lval must_model_vi let must_model_exp = apply_on_vi_base_from_exp must_model_vi let must_never_monitor_lval bhv ?kf ?stmt lv = apply_on_vi_base_from_lval (fun _bhv ?kf:_ ?stmt:_ vi -> must_never_monitor vi) bhv ?kf ?stmt lv let must_never_monitor_exp bhv ?kf ?stmt lv = apply_on_vi_base_from_exp (fun _bhv ?kf:_ ?stmt:_ vi -> must_never_monitor vi) bhv ?kf ?stmt lv (* ************************************************************************** *) (** {1 Public API} *) (* ************************************************************************** *) let must_model_vi ?bhv ?kf ?stmt vi = not (must_never_monitor vi) && (Options.Full_mmodel.get () || Error.generic_handle (must_model_vi bhv ?kf ?stmt) false vi) let must_model_lval ?bhv ?kf ?stmt lv = not (must_never_monitor_lval bhv ?kf ?stmt lv) && (Options.Full_mmodel.get () || Error.generic_handle (must_model_lval bhv ?kf ?stmt) false lv) let must_model_exp ?bhv ?kf ?stmt exp = not (must_never_monitor_exp bhv ?kf ?stmt exp) && (Options.Full_mmodel.get () || Error.generic_handle (must_model_exp bhv ?kf ?stmt) false exp) let use_model () = not (Env.is_empty ()) || Options.Full_mmodel.get () || Env.has_heap_allocations () (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/mmodel_analysis.mli0000666000000000000000000000512713571573400023125 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Compute a sound over-approximation of what left-values must be tracked by the memory model library *) val reset: unit -> unit (** Must be called to redo the analysis *) val use_model: unit -> bool (** Is one variable monitored (at least)? *) val must_model_vi: ?bhv:Visitor_behavior.t -> ?kf:kernel_function -> ?stmt:stmt -> varinfo -> bool (** [must_model_vi ?kf ?stmt vi] returns [true] if the varinfo [vi] at the given [stmt] in the given function [kf] must be tracked by the memory model library. If behavior [bhv] is specified then assume that [vi] is part of the new project generated by the given copy behavior [bhv] *) val must_model_lval: ?bhv:Visitor_behavior.t -> ?kf:kernel_function -> ?stmt:stmt -> lval -> bool (** Same as {!must_model_vi}, for left-values *) val must_model_exp: ?bhv:Visitor_behavior.t -> ?kf:kernel_function -> ?stmt:stmt -> exp -> bool (** Same as {!must_model_vi}, for expressions *) (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/rte.ml0000666000000000000000000000641413571573400020366 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************** *) (** {2 Generic code} *) (* ************************************************************************** *) let apply_rte f x = let signed = Kernel.SignedOverflow.get () in let unsigned = Kernel.UnsignedOverflow.get () in Kernel.SignedOverflow.off (); Kernel.UnsignedOverflow.off (); let finally () = Kernel.SignedOverflow.set signed; Kernel.UnsignedOverflow.set unsigned in Extlib.try_finally ~finally f x let warn_rte warn exn = if warn then Options.warning "@[@[cannot run RTE:@ %s.@]@ \ Ignoring potential runtime errors in annotations." (Printexc.to_string exn) (* ************************************************************************** *) (** {2 Exported code} *) (* ************************************************************************** *) open Cil_datatype let stmt ?(warn=true) = try let f = Dynamic.get ~plugin:"RteGen" "stmt_annotations" (Datatype.func2 Kernel_function.ty Stmt.ty (let module L = Datatype.List(Code_annotation) in L.ty)) in (fun x y -> apply_rte (f x) y) with Failure _ | Dynamic.Unbound_value _ | Dynamic.Incompatible_type _ as exn -> warn_rte warn exn; fun _ _ -> [] let exp ?(warn=true) = try let f = Dynamic.get ~plugin:"RteGen" "exp_annotations" (Datatype.func3 Kernel_function.ty Stmt.ty Exp.ty (let module L = Datatype.List(Code_annotation) in L.ty)) in (fun x y z -> apply_rte (f x y) z) with Failure _ | Dynamic.Unbound_value _ | Dynamic.Incompatible_type _ as exn -> warn_rte warn exn; fun _ _ _ -> [] (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/rte.mli0000666000000000000000000000372213571573400020536 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Accessing the RTE plug-in easily. *) open Cil_types val stmt: ?warn:bool -> kernel_function -> stmt -> code_annotation list (** RTEs of a given stmt, as a list of code annotations. *) val exp: ?warn:bool -> kernel_function -> stmt -> exp -> code_annotation list (** RTEs of a given exp, as a list of code annotations. *) (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/typing.ml0000666000000000000000000006534313571573400021114 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* Implement Figure 4 of J. Signoles' JFLA'15 paper "Rester statique pour devenir plus rapide, plus précis et plus mince". *) let dkey = Options.dkey_typing let compute_quantif_guards_ref : (predicate -> logic_var list -> predicate -> (term * relation * logic_var * relation * term) list) ref = Extlib.mk_fun "compute_quantif_guards_ref" (******************************************************************************) (** Datatype and constructor *) (******************************************************************************) type number_ty = | C_integer of ikind | C_float of fkind | Gmpz | Rational | Real | Nan let ikind ik = C_integer ik let c_int = ikind IInt let gmpz = Gmpz let fkind fk = C_float fk let rational = Rational let nan = Nan module D = Datatype.Make_with_collections (struct type t = number_ty let name = "E_ACSL.Typing.t" let reprs = [ Gmpz; Real; Nan; c_int ] include Datatype.Undefined let compare ty1 ty2 = if ty1 == ty2 then 0 else match ty1, ty2 with | C_integer i1, C_integer i2 -> if i1 = i2 then 0 else if Cil.intTypeIncluded i1 i2 then -1 else 1 | C_float f1, C_float f2 -> Transitioning.Stdlib.compare f1 f2 | (C_integer _ | C_float _ | Gmpz | Rational | Real), Nan | (C_integer _ | C_float _ | Gmpz | Rational ), Real | (C_integer _ | C_float _ | Gmpz), Rational | (C_integer _ | C_float _), Gmpz | C_integer _, C_float _ -> -1 | (C_float _ | Gmpz | Rational | Real | Nan), C_integer _ | (Gmpz | Rational | Real | Nan), C_float _ | (Rational | Real | Nan), Gmpz | (Real | Nan), Rational | Nan, Real -> 1 | Gmpz, Gmpz | Rational, Rational | Real, Real | Nan, Nan -> assert false let equal = Datatype.from_compare let hash = function | C_integer ik -> 7 * Hashtbl.hash ik | C_float fk -> 97 * Hashtbl.hash fk | Gmpz -> 787 | Rational -> 907 | Real -> 1011 | Nan -> 1277 let pretty fmt = function | C_integer k -> Printer.pp_ikind fmt k | C_float k -> Printer.pp_fkind fmt k | Gmpz -> Format.pp_print_string fmt "Gmpz" | Rational -> Format.pp_print_string fmt "Rational" | Real -> Format.pp_print_string fmt "Real" | Nan -> Format.pp_print_string fmt "Nan" end) (******************************************************************************) (** Basic operations *) (******************************************************************************) let join_cty ty1 ty2 = let ty = Cil.arithmeticConversion ty1 ty2 in match ty with | TInt(i, _) -> C_integer i | TFloat(f, _) -> C_float f | _ -> Options.fatal "[typing] join failure: unexpected result %a" Printer.pp_typ ty let join ty1 ty2 = if ty1 == ty2 then ty1 else match ty1, ty2 with | Nan, Nan | Real, Real | Rational, Rational | Gmpz, Gmpz -> assert false | Nan, (C_integer _ | C_float _ | Gmpz | Rational | Real as ty) | (C_integer _ | C_float _ | Gmpz | Rational | Real as ty), Nan -> Options.fatal "[typing] join failure: number %a and nan" D.pretty ty | Real, (C_integer _ | C_float _ | Gmpz | Rational) | (C_integer _ | C_float _ | Rational | Gmpz), Real -> Real | Rational, (C_integer _ | C_float _ | Gmpz) | (C_integer _ | C_float _ | Gmpz), Rational | C_float _, Gmpz | Gmpz, C_float _ -> Rational | Gmpz, C_integer _ | C_integer _, Gmpz -> Gmpz | C_float f1, C_float f2 -> join_cty (TFloat(f1, [])) (TFloat(f2, [])) | C_float f, C_integer n | C_integer n, C_float f -> join_cty (TFloat(f, [])) (TInt(n, [])) | C_integer i1, C_integer i2 -> if Options.Gmp_only.get () then Gmpz else join_cty (TInt(i1, [])) (TInt(i2, [])) exception Not_a_number let typ_of_number_ty = function | C_integer ik -> TInt(ik, []) | C_float fk -> TFloat(fk, []) | Gmpz -> Gmp_types.Z.t () (* for the time being, no reals but rationals instead *) | Rational -> Gmp_types.Q.t () | Real -> Error.not_yet "real number type" | Nan -> raise Not_a_number let typ_of_lty = function | Ctype cty -> cty | Linteger -> Gmp_types.Z.t () | Lreal -> Error.not_yet "real type" | Ltype _ | Lvar _ | Larrow _ -> Options.fatal "unexpected logic type" (******************************************************************************) (** Memoization *) (******************************************************************************) type computed_info = { ty: D.t; (* type required for the term *) op: D.t; (* type required for the operation *) cast: D.t option; (* if not [None], type of the context which the term must be casted to. If [None], no cast needed. *) } (* Memoization module which retrieves the computed info of some terms. If the info is already computed for a term, it is never recomputed *) module Memo: sig val memo: (term -> computed_info) -> term -> computed_info val get: term -> computed_info val clear: unit -> unit end = struct module H = Hashtbl.Make(struct type t = term (* the comparison over terms is the physical equality. It cannot be the structural one (given by [Cil_datatype.Term.equal]) because the very same term can be used in 2 different contexts which lead to different casts. By construction, there are no physically equal terms in the AST built by Cil. Consequently the memoisation should be fully useless. However the translation of E-ACSL guarded quantification generates new terms (see module {!Quantif}) which must be typed. The term corresponding to the bound variable [x] is actually used twice: once in the guard and once for encoding [x+1] when incrementing it. The memoization is only useful here and indeed prevent the generation of one extra variable in some cases. *) let equal (t1:term) t2 = t1 == t2 let hash = Cil_datatype.Term.hash end) let tbl = H.create 97 let get t = try H.find tbl t with Not_found -> Options.fatal "[typing] type of term '%a' was never computed." Printer.pp_term t let memo f t = try H.find tbl t with Not_found -> let x = f t in H.add tbl t x; x let clear () = H.clear tbl end (******************************************************************************) (** {2 Coercion rules} *) (******************************************************************************) (* Compute the smallest type (bigger than [int]) which can contain the whole interval. It is the \theta operator of the JFLA's paper. *) let ty_of_interv ?ctx = function | Interval.Float(fk, _) -> C_float fk | Interval.Rational -> Rational | Interval.Real -> Real | Interval.Nan -> Nan | Interval.Ival iv -> try let kind = Interval.ikind_of_ival iv in (match ctx with | None | Some (Gmpz | Nan) -> C_integer kind | Some (C_integer ik as ctx) -> (* return [ctx] type for types smaller than int to prevent superfluous casts in the generated code *) if Cil.intTypeIncluded kind ik then ctx else C_integer kind | Some (C_float _ | Rational | Real as ty) -> ty) with Cil.Not_representable -> match ctx with | None | Some(C_integer _ | Gmpz | Nan) -> Gmpz | Some (C_float _ | Rational) -> Rational | Some Real -> Real (* compute a new {!computed_info} by coercing the given type [ty] to the given context [ctx]. [op] is the type for the operator. *) let coerce ~arith_operand ~ctx ~op ty = if D.compare ty ctx = 1 then (* type larger than the expected context, so we must introduce an explicit cast *) { ty; op; cast = Some ctx } else (* only add an explicit cast if the context is [Gmp] and [ty] is not; or if the term corresponding to [ty] is an operand of an arithmetic operation which must be explicitly coerced in order to force the operation to be of the expected type. *) if (ctx = Gmpz && ty <> Gmpz) || arith_operand then { ty; op; cast = Some ctx } else { ty; op; cast = None } let number_ty_of_typ ty = match Cil.unrollType ty with | TInt(ik, _) | TEnum({ ekind = ik }, _) -> C_integer ik | TFloat(fk, _) -> C_float fk | TVoid _ | TPtr _ | TArray _ | TFun _ | TComp _ | TBuiltin_va_list _ -> Nan | TNamed _ -> assert false let ty_of_logic_ty ?term lty = let get_ty = function | Linteger -> Gmpz | Ctype ty -> number_ty_of_typ ty | Lreal -> Real | Larrow _ -> Nan | Ltype _ -> Error.not_yet "user-defined logic type" | Lvar _ -> Error.not_yet "type variable" in match term with | None -> get_ty lty | Some t -> if Options.Gmp_only.get () && lty = Linteger then Gmpz else let i = Interval.infer t in ty_of_interv i (******************************************************************************) (** {2 Type system} *) (******************************************************************************) (* generate a context [c]. Take --e-acsl-gmp-only into account iff [use_gmp_opt] is true. *) let mk_ctx ~use_gmp_opt = function | C_integer _ as c -> if use_gmp_opt && Options.Gmp_only.get () then Gmpz else c | C_float _ | Gmpz | Rational | Real | Nan as c -> c (* the number_ty corresponding to [t] whenever use as an offset. In that case, it cannot be a GMP, so it must be coerced to an integral type in that case *) let type_offset t = let i = Interval.infer t in match ty_of_interv i with | Gmpz -> C_integer ILongLong (* largest possible type *) | ty -> ty let type_letin li li_t = let i = Interval.infer li_t in Interval.Env.add li.l_var_info i (* type the term [t] in a context [ctx] by taking --e-acsl-gmp-only into account iff [use_gmp_opt] is true. *) let rec type_term ~use_gmp_opt ?(arith_operand=false) ?ctx t = let ctx = Extlib.opt_map (mk_ctx ~use_gmp_opt) ctx in let dup ty = ty, ty in let compute_ctx ?ctx i = (* in order to get a minimal amount of generated casts for operators, the result is typed in the given context [ctx], but not the operands. This function returns a tuple (ctx_of_result, ctx_of_operands) *) match ctx with | None -> (* no context: factorize *) dup (mk_ctx ~use_gmp_opt:true (ty_of_interv i)) | Some ctx -> mk_ctx ~use_gmp_opt:true (ty_of_interv ~ctx i), mk_ctx ~use_gmp_opt:true (ty_of_interv i) in let infer t = Cil.CurrentLoc.set t.term_loc; (* this pattern matching implements the formal rules of the JFLA's paper (and of course also covers the missing cases). Also enforce the invariant that every subterm is typed, even if it is not an integer. *) match t.term_node with | TConst (Integer _ | LChr _ | LEnum _ | LReal _) | TSizeOf _ | TSizeOfStr _ | TAlignOf _ -> let i = Interval.infer t in let ty = ty_of_interv ?ctx i in dup ty | TLval tlv -> let i = Interval.infer t in let ty = ty_of_interv ?ctx i in type_term_lval tlv; dup ty | Toffset(_, t') | Tblock_length(_, t') | TSizeOfE t' | TAlignOfE t' -> let i = Interval.infer t in (* [t'] must be typed, but it is a pointer *) ignore (type_term ~use_gmp_opt:true ~ctx:Nan t'); let ty = ty_of_interv ?ctx i in dup ty | TBinOp (MinusPP, t1, t2) -> let i = Interval.infer t in (* [t1] and [t2] must be typed, but they are pointers *) ignore (type_term ~use_gmp_opt:true ~ctx:Nan t1); ignore (type_term ~use_gmp_opt:true ~ctx:Nan t2); let ty = ty_of_interv ?ctx i in dup ty | TUnOp (unop, t') -> let i = Interval.infer t in let i' = Interval.infer t' in let ctx_res, ctx = compute_ctx ?ctx (Interval.join i i') in ignore (type_term ~use_gmp_opt:true ~arith_operand:true ~ctx t'); (match unop with | LNot -> c_int, ctx_res (* converted into [t == 0] in case of GMP *) | Neg | BNot -> dup ctx_res) | TBinOp ((PlusA | MinusA | Mult | Div | Mod | Shiftlt | Shiftrt), t1, t2) -> let i = Interval.infer t in let i1 = Interval.infer t1 in let i2 = Interval.infer t2 in let ctx_res, ctx = compute_ctx ?ctx (Interval.join i (Interval.join i1 i2)) in (* it is enough to explicitly coerce when required one operand to [ctx] (through [arith_operand]) in order to force the type of the operation. Heuristic: coerce the operand which is not a lval in order to lower the number of explicit casts *) let rec cast_first t1 t2 = match t1.term_node with | TLval _ -> false | TLogic_coerce(_, t) -> cast_first t t2 | _ -> true in let cast_first = cast_first t1 t2 in ignore (type_term ~use_gmp_opt:true ~arith_operand:cast_first ~ctx t1); ignore (type_term ~use_gmp_opt:true ~arith_operand:(not cast_first) ~ctx t2); dup ctx_res | TBinOp ((Lt | Gt | Le | Ge | Eq | Ne), t1, t2) -> assert (match ctx with None -> true | Some c -> D.compare c c_int >= 0); let i1 = Interval.infer t1 in let i2 = Interval.infer t2 in let ctx = mk_ctx ~use_gmp_opt:true (ty_of_interv ?ctx (Interval.join i1 i2)) in ignore (type_term ~use_gmp_opt:true ~ctx t1); ignore (type_term ~use_gmp_opt:true ~ctx t2); let ty = match ctx with | Nan -> c_int | Real | Rational | Gmpz | C_float _ | C_integer _ -> ctx in c_int, ty | TBinOp ((LAnd | LOr), t1, t2) -> let i1 = Interval.infer t1 in let i2 = Interval.infer t2 in let ty = ty_of_interv ?ctx (Interval.join i1 i2) in (* both operands fit in an int. *) ignore (type_term ~use_gmp_opt:true ~ctx:c_int t1); ignore (type_term ~use_gmp_opt:true ~ctx:c_int t2); dup ty | TBinOp (BAnd, _, _) -> Error.not_yet "bitwise and" | TBinOp (BXor, _, _) -> Error.not_yet "bitwise xor" | TBinOp (BOr, _, _) -> Error.not_yet "bitwise or" | TCastE(_, t') -> (* compute the smallest interval from the whole term [t] *) let i = Interval.infer t in (* nothing more to do: [i] is already more precise than what we could infer from the arguments of the cast. *) let ctx = ty_of_interv ?ctx i in ignore (type_term ~use_gmp_opt:true ~ctx t'); dup ctx | Tif (t1, t2, t3) -> let ctx1 = mk_ctx ~use_gmp_opt:false c_int (* an int must be generated *) in ignore (type_term ~use_gmp_opt:false ~ctx:ctx1 t1); let i = Interval.infer t in let i2 = Interval.infer t2 in let i3 = Interval.infer t3 in let ctx = ty_of_interv ?ctx (Interval.join i (Interval.join i2 i3)) in let ctx = mk_ctx ~use_gmp_opt:true ctx in ignore (type_term ~use_gmp_opt:true ~ctx t2); ignore (type_term ~use_gmp_opt:true ~ctx t3); dup ctx | Tat (t, _) | TLogic_coerce (_, t) -> dup (type_term ~use_gmp_opt ~arith_operand ?ctx t).ty | TAddrOf tlv | TStartOf tlv -> (* it is a pointer, but subterms must be typed. *) type_term_lval tlv; dup Nan | Tbase_addr (_, t) -> (* it is a pointer, but subterms must be typed. *) ignore (type_term ~use_gmp_opt:true ~ctx:Nan t); dup Nan | TBinOp ((PlusPI | IndexPI | MinusPI), t1, t2) -> (* both [t1] and [t2] must be typed. *) ignore (type_term ~use_gmp_opt:true ~ctx:Nan t1); let ctx = type_offset t2 in ignore (type_term ~use_gmp_opt:false ~ctx t2); dup Nan | Tapp(li, _, args) -> if Builtins.mem li.l_var_info.lv_name then let typ_arg lvi arg = (* a built-in is a C function, so the context is necessarily a C type. *) let ctx = ty_of_logic_ty lvi.lv_type in ignore (type_term ~use_gmp_opt:false ~ctx arg) in List.iter2 typ_arg li.l_profile args; (* [li.l_type is [None] for predicate only: not possible here. Thus using [Extlib.the] is fine *) dup (ty_of_logic_ty (Extlib.the li.l_type)) else begin (* TODO: what if the type of the parameter is smaller than the infered type of the argument? For now, it is silently ignored (both statically and at runtime)... *) List.iter (fun arg -> ignore (type_term ~use_gmp_opt:true arg)) args; (* TODO: recursive call in arguments of function call *) match li.l_body with | LBpred _ -> (* possible to have an [LBpred] here because we transformed [Papp] into [Tapp] *) dup c_int | LBterm _ -> begin match li.l_type with | None -> assert false | Some lty -> (* TODO: what if the function returns a real? *) let ty = ty_of_logic_ty ~term:t lty in dup ty end | LBnone -> Error.not_yet "logic functions with no definition nor reads clause" | LBreads _ -> Error.not_yet "logic functions performing read accesses" | LBinductive _ -> Error.not_yet "logic functions inductively defined" end | Tunion _ -> Error.not_yet "tset union" | Tinter _ -> Error.not_yet "tset intersection" | Tcomprehension (_,_,_) -> Error.not_yet "tset comprehension" | Trange(None, _) | Trange(_, None) -> Options.abort "unbounded ranges are not part of E-ACSl" | Trange(Some n1, Some n2) -> ignore (type_term ~use_gmp_opt n1); ignore (type_term ~use_gmp_opt n2); let i = Interval.infer t in let ty = ty_of_interv ?ctx i in dup ty | Tlet(li, t) -> let li_t = Misc.term_of_li li in type_letin li li_t; ignore (type_term ~use_gmp_opt:true li_t); dup (type_term ~use_gmp_opt:true ?ctx t).ty | Tlambda (_,_) -> Error.not_yet "lambda" | TDataCons (_,_) -> Error.not_yet "datacons" | TUpdate (_,_,_) -> Error.not_yet "update" | Tnull | TConst (LStr _ | LWStr _) | Ttypeof _ | Ttype _ | Tempty_set -> dup Nan in Memo.memo (fun t -> let ty, op = infer t in match ctx with | None -> { ty; op; cast = None } | Some ctx -> coerce ~arith_operand ~ctx ~op ty) t and type_term_lval (host, offset) = type_term_lhost host; type_term_offset offset and type_term_lhost = function | TVar _ | TResult _ -> () | TMem t -> ignore (type_term ~use_gmp_opt:false ~ctx:Nan t) and type_term_offset = function | TNoOffset -> () | TField(_, toff) | TModel(_, toff) -> type_term_offset toff | TIndex(t, toff) -> let ctx = type_offset t in ignore (type_term ~use_gmp_opt:false ~ctx t); type_term_offset toff let rec type_predicate p = Cil.CurrentLoc.set p.pred_loc; (* this pattern matching also follows the formal rules of the JFLA's paper *) let op = match p.pred_content with | Pfalse | Ptrue -> c_int | Papp(li, _, _) -> begin match li.l_body with | LBpred _ -> (* No need to type subpredicates since Papp will be transformed into Tapp in Translate: a retyping is done there *) c_int | LBnone -> (* Eg: \is_finite *) Error.not_yet "predicate with no definition nor reads clause" | LBreads _ | LBterm _ | LBinductive _ -> Options.fatal "unexpected logic definition" end | Pseparated _ -> Error.not_yet "\\separated" | Pdangling _ -> Error.not_yet "\\dangling" | Prel(_, t1, t2) -> let i1 = Interval.infer t1 in let i2 = Interval.infer t2 in let i = Interval.join i1 i2 in let ctx = mk_ctx ~use_gmp_opt:true (ty_of_interv ~ctx:c_int i) in ignore (type_term ~use_gmp_opt:true ~ctx t1); ignore (type_term ~use_gmp_opt:true ~ctx t2); (match ctx with | Nan -> c_int | Real | Rational | Gmpz | C_float _ | C_integer _ -> ctx) | Pand(p1, p2) | Por(p1, p2) | Pxor(p1, p2) | Pimplies(p1, p2) | Piff(p1, p2) -> ignore (type_predicate p1); ignore (type_predicate p2); c_int | Pnot p -> ignore (type_predicate p); c_int | Pif(t, p1, p2) -> let ctx = mk_ctx ~use_gmp_opt:false c_int in ignore (type_term ~use_gmp_opt:false ~ctx t); ignore (type_predicate p1); ignore (type_predicate p2); c_int | Plet(li, p) -> let li_t = Misc.term_of_li li in type_letin li li_t; ignore (type_term ~use_gmp_opt:true li_t); (type_predicate p).ty | Pforall(bounded_vars, { pred_content = Pimplies(hyps, goal) }) | Pexists(bounded_vars, { pred_content = Pand(hyps, goal) }) -> let guards = !compute_quantif_guards_ref p bounded_vars hyps in let iv_plus_one iv = Interval.Ival (Ival.add_singleton_int Integer.one iv) in List.iter (fun (t1, r1, x, r2, t2) -> let i1 = Interval.infer t1 in let i1 = match r1, i1 with | Rlt, Interval.Ival iv -> iv_plus_one iv | Rle, _ -> i1 | _ -> assert false in let i2 = Interval.infer t2 in (* add one to [i2], since we increment the loop counter one more time before going outside the loop. *) let i2 = match r2, i2 with | Rlt, _ -> i2 | Rle, Interval.Ival iv -> iv_plus_one iv | _ -> assert false in let i = Interval.join i1 i2 in let ctx = match x.lv_type with | Linteger -> mk_ctx ~use_gmp_opt:true (ty_of_interv ~ctx:Gmpz i) | Ctype ty -> (match Cil.unrollType ty with | TInt(ik, _) -> mk_ctx ~use_gmp_opt:true (C_integer ik) | ty -> Options.fatal "unexpected type %a for quantified variable %a" Printer.pp_typ ty Printer.pp_logic_var x) | lty -> Options.fatal "unexpected type %a for quantified variable %a" Printer.pp_logic_type lty Printer.pp_logic_var x in (* forcing when typing bounds prevents to generate an extra useless GMP variable when --e-acsl-gmp-only *) ignore (type_term ~use_gmp_opt:false ~ctx t1); ignore (type_term ~use_gmp_opt:false ~ctx t2); (* if we must generate GMP code, degrade the interval in order to guarantee that [x] will be a GMP when typing the goal *) let i = match ctx with | C_integer _ -> i | Gmpz -> Interval.top_ival (* [ -\infty; +\infty ] *) | C_float _ | Rational | Real | Nan -> Options.fatal "unexpected quantification over %a" D.pretty ctx in Interval.Env.add x i) guards; (type_predicate goal).ty | Pinitialized(_, t) | Pfreeable(_, t) | Pallocable(_, t) | Pvalid(_, t) | Pvalid_read(_, t) | Pvalid_function t -> ignore (type_term ~use_gmp_opt:false ~ctx:Nan t); c_int | Pforall _ -> Error.not_yet "unguarded \\forall quantification" | Pexists _ -> Error.not_yet "unguarded \\exists quantification" | Pat(p, _) -> (type_predicate p).ty | Pfresh _ -> Error.not_yet "\\fresh" in coerce ~arith_operand:false ~ctx:c_int ~op c_int let type_term ~use_gmp_opt ?ctx t = Options.feedback ~dkey ~level:4 "typing term '%a' in ctx '%a'." Printer.pp_term t (Pretty_utils.pp_opt D.pretty) ctx; ignore (type_term ~use_gmp_opt ?ctx t) let type_named_predicate ?(must_clear=true) p = Options.feedback ~dkey ~level:3 "typing predicate '%a'." Printer.pp_predicate p; if must_clear then begin Interval.Env.clear (); Memo.clear () end; ignore (type_predicate p) let unsafe_set t ?ctx ty = let ctx = match ctx with None -> ty | Some ctx -> ctx in let mk _ = coerce ~arith_operand:false ~ctx ~op:ty ty in ignore (Memo.memo mk t) (******************************************************************************) (** {2 Getters} *) (******************************************************************************) let get_number_ty t = (Memo.get t).ty let get_integer_op t = (Memo.get t).op let get_integer_op_of_predicate p = (type_predicate p).op (* {!typ_of_integer}, but handle the not-integer cases. *) let extract_typ t ty = try typ_of_number_ty ty with Not_a_number -> match t.term_type with | Ctype _ as lty -> Logic_utils.logicCType lty | Linteger | Lreal -> Options.fatal "unexpected context NaN for term %a" Printer.pp_term t | Ltype _ -> Error.not_yet "unsupported logic type: user-defined type" | Lvar _ -> Error.not_yet "unsupported logic type: type variable" | Larrow _ -> Error.not_yet "unsupported logic type: type arrow" let get_typ t = let info = Memo.get t in extract_typ t info.ty let get_op t = let info = Memo.get t in extract_typ t info.op let get_cast t = let info = Memo.get t in try Extlib.opt_map typ_of_number_ty info.cast with Not_a_number -> None let get_cast_of_predicate p = let info = type_predicate p in try Extlib.opt_map typ_of_number_ty info.cast with Not_a_number -> assert false let clear = Memo.clear module Datatype = D (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/analyses/typing.mli0000666000000000000000000001607413571573400021262 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Type system which computes the smallest C type that may contain all the possible values of a given integer term or predicate. Also compute the required casts. It is based on interval inference of module {!Interval}. It implement Figure 4 of J. Signoles' JFLA'15 paper "Rester statique pour devenir plus rapide, plus précis et plus mince". Example: consider a variable [x] of type [int] and a variable [y] of type char on a (strange) architecture in which values of type [int] belongs to the interval [[-128;127]] and values of type [char] belongs to the interval [[-32;31]], while there are no other integral types. Then here are some information computed from the term [1+(x+1)/(y-64)] by the type system: 1. [x+1] must be a GMP (because of the potential overflow) 2. consequently [x], which is an [int], must be coerced into a GMP and the same for the number 1 in this addition. 3. [y-64] can be computed in an [int] (because the result belongs to the interval [[-96;-33]]). 4. [(x+1)/(y-64)] must be a GMP operation because the numerator is a GMP (see 1.). Consequently [y-64] must be coerced into a GMP too. However, the result belongs to the interval [[-3;3]] and thus can be safely coerced to an [int]. 5. Consequently the addition of the toplevel term [1+(x+1)/(y-64)] can safely be computed in [int]: its result belongs to [[-2;4]]. *) open Cil_types (******************************************************************************) (** {2 Datatypes} *) (******************************************************************************) (** Possible types infered by the system. *) type number_ty = private | C_integer of ikind | C_float of fkind | Gmpz | Rational | Real | Nan module Datatype: Datatype.S_with_collections with type t = number_ty (** {3 Smart constructors} *) val c_int: number_ty val ikind: ikind -> number_ty val fkind: fkind -> number_ty val gmpz: number_ty val rational: number_ty val nan: number_ty (** {3 Useful operations over {!number_ty}} *) exception Not_a_number val typ_of_number_ty: number_ty -> typ (** @return the C type corresponding to an {!number_ty}. That is [Gmp.z_t ()] for [Gmpz], [Real.t ()] for [Real] and [TInt(ik, [[]])] for [Ctype ik]. @raise Not_a_number in case of [Nan]. *) val number_ty_of_typ: typ -> number_ty (** Reverse of [typ_of_number_ty] *) val join: number_ty -> number_ty -> number_ty (** {!number_ty} is a join-semi-lattice if you do not consider [Other]. If there is no [Other] in argument, this function computes the join of this semi-lattice. If one of the argument is {!Other}, the function assumes that the other argument is also {!Other}. In this case, the result is [Other]. *) (******************************************************************************) (** {2 Typing} *) (******************************************************************************) val type_term: use_gmp_opt:bool -> ?ctx:number_ty -> term -> unit (** Compute the type of each subterm of the given term in the given context. If [use_gmp_opt] is false, then the conversion to the given context is done even if -e-acsl-gmp-only is set. *) val type_named_predicate: ?must_clear:bool -> predicate -> unit (** Compute the type of each term of the given predicate. Set {!must_clear} to false in order to not reset the environment. *) val clear: unit -> unit (** Remove all the previously computed types. *) (** {3 Getters} Below, the functions assume that either {!type_term} or {!type_named_predicate} has been previously computed for the given term or predicate. *) val get_number_ty: term -> number_ty (** @return the infered type for the given term. *) val get_integer_op: term -> number_ty (** @return the infered type for the top operation of the given term. It is meaningless to call this function over a non-arithmetical/logical operator. *) val get_integer_op_of_predicate: predicate -> number_ty (** @return the infered type for the top operation of the given predicate. *) val get_typ: term -> typ (** Get the type which the given term must be generated to. *) val get_op: term -> typ (** Get the type which the operation on top of the given term must be generated to. *) val get_cast: term -> typ option (** Get the type which the given term must be converted to (if any). *) val get_cast_of_predicate: predicate -> typ option (** Like {!get_cast}, but for predicates. *) val unsafe_set: term -> ?ctx:number_ty -> number_ty -> unit (** Register that the given term has the given type in the given context (if any). No verification is done. *) (*****************************************************************************) (** {2 Typing/types-related utils} *) (*****************************************************************************) val ty_of_interv: ?ctx:number_ty -> Interval.t -> number_ty (* Compute the smallest type (bigger than [int]) which can contain the whole interval. It is the \theta operator of the JFLA's paper. *) val typ_of_lty: logic_type -> typ (** @return the C type that correponds to the given logic type. *) (******************************************************************************) (** {2 Internal stuff} *) (******************************************************************************) val compute_quantif_guards_ref : (predicate -> logic_var list -> predicate -> (term * relation * logic_var * relation * term) list) ref (** Forward reference. *) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/0000777000000000000000000000000013571573400020376 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/at_with_lscope.ml0000666000000000000000000003406713571573400023746 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (**************************************************************************) (********************** Forward references ********************************) (**************************************************************************) let predicate_to_exp_ref : (kernel_function -> Env.t -> predicate -> exp * Env.t) ref = Extlib.mk_fun "named_predicate_to_exp_ref" let term_to_exp_ref : (kernel_function -> Env.t -> term -> exp * Env.t) ref = Extlib.mk_fun "term_to_exp_ref" (*****************************************************************************) (**************************** Handling memory ********************************) (*****************************************************************************) (* Remove all the bindings for [kf]. [Cil_datatype.Kf.Hashtbl] does not provide the [remove_all] function. Thus we need to keep calling [remove] until all entries are removed. *) let rec remove_all tbl kf = if Cil_datatype.Kf.Hashtbl.mem tbl kf then begin Cil_datatype.Kf.Hashtbl.remove tbl kf; remove_all tbl kf end module Malloc = struct let tbl = Cil_datatype.Kf.Hashtbl.create 7 let add kf stmt = Cil_datatype.Kf.Hashtbl.add tbl kf stmt let find_all kf = Cil_datatype.Kf.Hashtbl.find_all tbl kf let remove_all kf = remove_all tbl kf end module Free = struct let tbl = Cil_datatype.Kf.Hashtbl.create 7 let add kf stmt = Cil_datatype.Kf.Hashtbl.add tbl kf stmt let find_all kf = Cil_datatype.Kf.Hashtbl.find_all tbl kf let remove_all kf = remove_all tbl kf end (**************************************************************************) (*************************** Translation **********************************) (**************************************************************************) (* Builds the terms [t_size] and [t_shifted] from each [Lvs_quantif(tmin, lv, tmax)] from [lscope] where [t_size = tmax - tmin + (-1|0|1)] depending on whether the inequalities are strict or large and [t_shifted = lv - tmin + (-1|0)] (so that we start indexing at 0) *) let rec sizes_and_shifts_from_quantifs ~loc kf lscope sizes_and_shifts = match lscope with | [] -> sizes_and_shifts | Lscope.Lvs_quantif(tmin, _, _, _, tmax) ::_ when Misc.term_has_lv_from_vi tmin || Misc.term_has_lv_from_vi tmax -> Error.not_yet "\\at with logic variable linked to C variable" | Lscope.Lvs_quantif(tmin, rel1, lv, rel2, tmax) :: lscope' -> let t_size = Logic_const.term ~loc (TBinOp(MinusA, tmax, tmin)) Linteger in let t_size = match rel1, rel2 with | Rle, Rle -> Logic_const.term ~loc (TBinOp(PlusA, t_size, Cil.lone ~loc ())) Linteger | Rlt, Rle | Rle, Rlt -> t_size | Rlt, Rlt -> Logic_const.term ~loc (TBinOp(MinusA, t_size, Cil.lone ~loc ())) Linteger | _ -> Options.fatal "Unexpected comparison operator" in let iv = Interval.(extract_ival (infer t_size)) in (* The EXACT amount of memory that is needed can be known at runtime. This is because the tightest bounds for the variables can be known at runtime. Example: In the following predicate [\exists integer u; 9 <= u <= 13 && \forall integer v; -5 < v <= (u <= 11 ? u + 6 : u - 9) ==> \at(u + v > 0, K)] the upper bound [M] for [v] depends on [u]. In chronological order, [M] equals to 15, 16, 17, 3 and 4. Thus the tightest upper bound for [v] is [max(M)=17]. HOWEVER, computing that exact information requires extra nested loops, prior to the [malloc] stmts, that will try all the possible values of the variables involved in the bounds. Instead of sacrificing time over memory (by performing these extra computations), we consider that sacrificing memory over time is more beneficial. In particular, though we may allocate more memory than needed, the number of reads/writes into it is the same in both cases. Conclusion: over-approximate [t_size] *) let t_size = match Ival.min_and_max iv with | _, Some max -> Logic_const.tint ~loc max | _, None -> Error.not_yet "\\at on purely logic variables and with quantifier that uses \ too complex bound (E-ACSL cannot infer a finite upper bound to it)" in (* Index *) let t_lv = Logic_const.tvar ~loc lv in let t_shifted = match rel1 with | Rle -> Logic_const.term ~loc (TBinOp(MinusA, t_lv, tmin)) Linteger | Rlt -> let t = Logic_const.term ~loc (TBinOp(MinusA, t_lv, tmin)) Linteger in Logic_const.term ~loc (TBinOp(MinusA, t, Cil.lone ~loc())) Linteger | _ -> Options.fatal "Unexpected comparison operator" in (* Returning *) let sizes_and_shifts = (t_size, t_shifted) :: sizes_and_shifts in sizes_and_shifts_from_quantifs ~loc kf lscope' sizes_and_shifts | (Lscope.Lvs_let(_, t) | Lscope.Lvs_global(_, t)) :: _ when Misc.term_has_lv_from_vi t -> Error.not_yet "\\at with logic variable linked to C variable" | Lscope.Lvs_let _ :: lscope' -> sizes_and_shifts_from_quantifs ~loc kf lscope' sizes_and_shifts | Lscope.Lvs_formal _ :: _ -> Error.not_yet "\\at using formal variable of a logic function" | Lscope.Lvs_global _ :: _ -> Error.not_yet "\\at using global logic variable" let size_from_sizes_and_shifts ~loc = function | [] -> (* No quantified variable. But still need to allocate [1*sizeof(_)] amount of memory to store purely logic variables that are NOT quantified (example: from \let). *) Cil.lone ~loc () | (size, _) :: sizes_and_shifts -> List.fold_left (fun t_size (t_s, _) -> Logic_const.term ~loc (TBinOp(Mult, t_size, t_s)) Linteger) size sizes_and_shifts (* Build the left-value corresponding to [*(at + index)]. *) let lval_at_index ~loc kf env (e_at, vi_at, t_index) = Typing.type_term ~use_gmp_opt:false ~ctx:Typing.c_int t_index; let term_to_exp = !term_to_exp_ref in let e_index, env = term_to_exp kf env t_index in let e_index = Cil.constFold false e_index in let e_addr = Cil.new_exp ~loc (BinOp(PlusPI, e_at, e_index, vi_at.vtype)) in let lval_at_index = Mem e_addr, NoOffset in lval_at_index, env (* Associate to each possible tuple of quantifiers a unique index from the set {n | 0 <= n < n_max}. That index will serve to identify the memory location where the evaluation of the term/predicate is stored for the given tuple of quantifier. The following gives the smallest set of such indexes (hence we use the smallest amount of memory in some respect): To (t_shifted_n, t_shifted_n-1, ..., t_shifted_1) where 0 <= t_shifted_i < beta_i corresponds: \sum_{i=1}^n( t_shifted_i * \pi_{j=1}^{i-1}(beta_j) ) *) let index_from_sizes_and_shifts ~loc sizes_and_shifts = let product terms = List.fold_left (fun product t -> Logic_const.term ~loc (TBinOp(Mult, product, t)) Linteger) (Cil.lone ~loc ()) terms in let sum, _ = List.fold_left (fun (index, sizes) (t_size, t_shifted) -> let pi_beta_j = product sizes in let bi_mult_pi_beta_j = Logic_const.term ~loc (TBinOp(Mult, t_shifted, pi_beta_j)) Linteger in let sum = Logic_const.term ~loc (TBinOp(PlusA, bi_mult_pi_beta_j, index)) Linteger in sum, t_size :: sizes) (Cil.lzero ~loc (), []) sizes_and_shifts in sum let put_block_at_label env block label = let stmt = Label.get_stmt (Env.get_visitor env) label in let env_ref = ref env in let o = object inherit Visitor.frama_c_inplace method !vstmt_aux stmt = assert (!env_ref == env); env_ref := Env.extend_stmt_in_place env stmt ~label block; Cil.ChangeTo stmt end in let bhv = Env.get_behavior env in ignore(Visitor.visitFramacStmt o (Visitor_behavior.Get.stmt bhv stmt)); !env_ref let to_exp ~loc kf env pot label = let term_to_exp = !term_to_exp_ref in let lscope_vars = Lscope.get_all (Env.Logic_scope.get env) in let sizes_and_shifts = sizes_and_shifts_from_quantifs ~loc kf lscope_vars [] in (* Creating the pointer *) let ty = match pot with | Misc.PoT_pred _ -> Cil.intType | Misc.PoT_term t -> begin match Typing.get_number_ty t with | Typing.(C_integer _ | C_float _ | Nan) -> Typing.get_typ t | Typing.(Rational | Real) -> Error.not_yet "\\at on purely logic variables and over real type" | Typing.Gmpz -> Error.not_yet "\\at on purely logic variables and over gmp type" end in let ty_ptr = TPtr(ty, []) in let vi_at, e_at, env = Env.new_var ~loc ~name:"at" ~scope:Varname.Function env None ty_ptr (fun vi e -> (* Handle [malloc] and [free] stmts *) let lty_sizeof = Ctype Cil.(theMachine.typeOfSizeOf) in let t_sizeof = Logic_const.term ~loc (TSizeOf ty) lty_sizeof in let t_size = size_from_sizes_and_shifts ~loc sizes_and_shifts in let t_size = Logic_const.term ~loc (TBinOp(Mult, t_sizeof, t_size)) lty_sizeof in Typing.type_term ~use_gmp_opt:false t_size; let malloc_stmt = match Typing.get_number_ty t_size with | Typing.C_integer IInt -> let e_size, _ = term_to_exp kf env t_size in let e_size = Cil.constFold false e_size in let malloc_stmt = Misc.mk_call ~loc ~result:(Cil.var vi) "malloc" [e_size] in malloc_stmt | Typing.(C_integer _ | C_float _ | Gmpz) -> Error.not_yet "\\at on purely logic variables that needs to allocate \ too much memory (bigger than int_max bytes)" | Typing.(Rational | Real | Nan) -> Error.not_yet "quantification over non-integer type" in let free_stmt = Misc.mk_call ~loc "free" [e] in (* The list of stmts returned by the current closure are inserted LOCALLY to the block where the new var is FIRST used, whatever scope is indicated to [Env.new_var]. Thus we need to add [malloc] and [free] through dedicated functions. *) Malloc.add kf malloc_stmt; Free.add kf free_stmt; []) in (* Index *) let t_index = index_from_sizes_and_shifts ~loc sizes_and_shifts in (* Innermost block *) let mk_innermost_block env = let term_to_exp = !term_to_exp_ref in let named_predicate_to_exp = !predicate_to_exp_ref in match pot with | Misc.PoT_pred p -> let env = Env.push env in let lval, env = lval_at_index ~loc kf env (e_at, vi_at, t_index) in let e, env = named_predicate_to_exp kf env p in let e = Cil.constFold false e in let storing_stmt = Cil.mkStmtOneInstr ~valid_sid:true (Set(lval, e, loc)) in let block, env = Env.pop_and_get env storing_stmt ~global_clear:false Env.After in (* We CANNOT return [block.bstmts] because it does NOT contain variable declarations. *) [ Cil.mkStmt ~valid_sid:true (Block block) ], env | Misc.PoT_term t -> begin match Typing.get_number_ty t with | Typing.(C_integer _ | C_float _ | Nan) -> let env = Env.push env in let lval, env = lval_at_index ~loc kf env (e_at, vi_at, t_index) in let e, env = term_to_exp kf env t in let e = Cil.constFold false e in let storing_stmt = Cil.mkStmtOneInstr ~valid_sid:true (Set(lval, e, loc)) in let block, env = Env.pop_and_get env storing_stmt ~global_clear:false Env.After in (* We CANNOT return [block.bstmts] because it does NOT contain variable declarations. *) [ Cil.mkStmt ~valid_sid:true (Block block) ], env | Typing.(Rational | Real) -> Error.not_yet "\\at on purely logic variables and over real type" | Typing.Gmpz -> Error.not_yet "\\at on purely logic variables and over gmp type" end in (* Storing loops *) let lscope_vars = Lscope.get_all (Env.Logic_scope.get env) in let env = Env.push env in let storing_loops_stmts, env = Loops.mk_nested_loops ~loc mk_innermost_block kf env lscope_vars in let storing_loops_block = Cil.mkBlock storing_loops_stmts in let storing_loops_block, env = Env.pop_and_get env (Cil.mkStmt ~valid_sid:true (Block storing_loops_block)) ~global_clear:false Env.After in (* Put at label *) let env = put_block_at_label env storing_loops_block label in (* Returning *) let lval_at_index, env = lval_at_index ~loc kf env (e_at, vi_at, t_index) in let e = Cil.new_exp ~loc (Lval lval_at_index) in e, env (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/at_with_lscope.mli0000666000000000000000000000662413571573400024115 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype (* Convert \at on terms or predicates in which we can find purely logic variable. *) (**************************************************************************) (*************************** Translation **********************************) (**************************************************************************) val to_exp: loc:Location.t -> kernel_function -> Env.t -> Misc.pred_or_term -> logic_label -> exp * Env.t (*****************************************************************************) (**************************** Handling memory ********************************) (*****************************************************************************) (* The different possible evaluations of the [\at] under study are stored in a memory location that needs to be alloted then freed. This part is designed for that purpose. *) module Malloc: sig val find_all: kernel_function -> stmt list (* Return the list of [malloc] stmts that need to be inserted into [kf]. *) val remove_all: kernel_function -> unit (* Remove all [malloc] stmts for [kf] from the internal table. *) end module Free: sig val find_all: kernel_function -> stmt list (* Return the list of [free] stmts that need to be inserted into [kf]. *) val remove_all: kernel_function -> unit (* Remove all [free] stmts for [kf] from the internal table. *) end (**************************************************************************) (********************** Forward references ********************************) (**************************************************************************) val predicate_to_exp_ref: (kernel_function -> Env.t -> predicate -> exp * Env.t) ref val term_to_exp_ref: (kernel_function -> Env.t -> term -> exp * Env.t) ref (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/env.ml0000666000000000000000000004114113571573400021521 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module E_acsl_label = Label open Cil_types open Cil_datatype type localized_scope = | LGlobal | LFunction of kernel_function | LLocal_block of kernel_function type mp_tbl = { new_exps: (varinfo * exp) Term.Map.t; (* generated mp variables as exp from terms *) clear_stmts: stmt list; (* stmts freeing the memory before exiting the block *) } type block_info = { new_block_vars: varinfo list; (* generated variables local to the block *) new_stmts: stmt list; (* generated stmts to put at the beginning of the block *) pre_stmts: stmt list; (* stmts already inserted into the current stmt, but which should be before [new_stmts]. *) post_stmts: stmt list; } type local_env = { block_info: block_info; mp_tbl: mp_tbl; rte: bool } type t = { visitor: Visitor.frama_c_visitor; lscope: Lscope.t; lscope_reset: bool; annotation_kind: Misc.annotation_kind; new_global_vars: (varinfo * localized_scope) list; (* generated variables. The scope indicates the level where the variable should be added. *) global_mp_tbl: mp_tbl; env_stack: local_env list; var_mapping: Varinfo.t Stack.t Logic_var.Map.t; (* records of C bindings for logic vars *) loop_invariants: predicate list list; (* list of loop invariants for each currently visited loops *) cpt: int; (* counter used when generating variables *) } let empty_block = { new_block_vars = []; new_stmts = []; pre_stmts = []; post_stmts = [] } let empty_mp_tbl = { new_exps = Term.Map.empty; clear_stmts = [] } let empty_local_env = { block_info = empty_block; mp_tbl = empty_mp_tbl; rte = true } let dummy = { visitor = new Visitor.generic_frama_c_visitor (Visitor_behavior.inplace ()); lscope = Lscope.empty; lscope_reset = true; annotation_kind = Misc.Assertion; new_global_vars = []; global_mp_tbl = empty_mp_tbl; env_stack = []; var_mapping = Logic_var.Map.empty; loop_invariants = []; cpt = 0; } let empty v = { visitor = v; lscope = Lscope.empty; lscope_reset = true; annotation_kind = Misc.Assertion; new_global_vars = []; global_mp_tbl = empty_mp_tbl; env_stack = []; var_mapping = Logic_var.Map.empty; loop_invariants = []; cpt = 0 } let top env = match env.env_stack with | [] -> Options.fatal "Empty environment. That is unexpected." | hd :: tl -> hd, tl let has_no_new_stmt env = let local, _ = top env in local.block_info = empty_block let current_kf env = let v = env.visitor in match v#current_kf with | None -> None | Some kf -> Some (Visitor_behavior.Get.kernel_function v#behavior kf) let set_current_kf env kf = let v = env.visitor in v#set_current_kf kf let get_visitor env = env.visitor let get_behavior env = env.visitor#behavior (* ************************************************************************** *) (** {2 Loop invariants} *) (* ************************************************************************** *) let push_loop env = { env with loop_invariants = [] :: env.loop_invariants } let add_loop_invariant env inv = match env.loop_invariants with | [] -> assert false | invs :: tl -> { env with loop_invariants = (inv :: invs) :: tl } let pop_loop env = match env.loop_invariants with | [] -> assert false | invs :: tl -> invs, { env with loop_invariants = tl } (* ************************************************************************** *) (** {2 RTEs} *) (* ************************************************************************** *) let rte env b = let local_env, tl_env = top env in { env with env_stack = { local_env with rte = b } :: tl_env } let generate_rte env = let local_env, _ = top env in local_env.rte (* ************************************************************************** *) (* eta-expansion required for typing generalisation *) let acc_list_rev acc l = List.fold_left (fun acc x -> x :: acc) acc l let do_new_var ~loc ?(scope=Varname.Block) ?(name="") env t ty mk_stmts = let local_env, tl_env = top env in let local_block = local_env.block_info in let is_z_t = Gmp_types.Z.is_t ty in if is_z_t then Gmp_types.Z.is_now_referenced (); let is_q_t = Gmp_types.Q.is_t ty in if is_q_t then Gmp_types.Q.is_now_referenced (); let n = succ env.cpt in let v = Cil.makeVarinfo ~source:true false (* is a global? *) false (* is a formal? *) ~referenced:true (Varname.get ~scope (Functions.RTL.mk_gen_name name)) ty in v.vreferenced <- true; let lscope = match scope with | Varname.Global -> LGlobal | Varname.Function -> LFunction (Extlib.the (current_kf env)) | Varname.Block -> LLocal_block (Extlib.the (current_kf env)) in (* Options.feedback "new variable %a (global? %b)" Varinfo.pretty v global;*) let e = Cil.evar v in let stmts = mk_stmts v e in let new_stmts = acc_list_rev local_block.new_stmts stmts in let new_block_vars = match scope with | Varname.Global | Varname.Function -> local_block.new_block_vars | Varname.Block -> v :: local_block.new_block_vars in let new_block = { new_block_vars = new_block_vars; new_stmts = new_stmts; pre_stmts = local_block.pre_stmts; post_stmts = local_block.post_stmts } in v, e, if is_z_t || is_q_t then begin let extend_tbl tbl = (* Options.feedback "memoizing %a for term %a" Varinfo.pretty v (fun fmt t -> match t with None -> Format.fprintf fmt "NONE" | Some t -> Term.pretty fmt t) t;*) { clear_stmts = Gmp.clear ~loc e :: tbl.clear_stmts; new_exps = match t with | None -> tbl.new_exps | Some t -> Term.Map.add t (v, e) tbl.new_exps } in match scope with | Varname.Global | Varname.Function -> let local_env = { local_env with block_info = new_block } in (* also memoize the new variable, but must never be used *) { env with cpt = n; new_global_vars = (v, lscope) :: env.new_global_vars; global_mp_tbl = extend_tbl env.global_mp_tbl; env_stack = local_env :: tl_env } | Varname.Block -> let local_env = { block_info = new_block; mp_tbl = extend_tbl local_env.mp_tbl; rte = false (* must be already checked by mk_stmts *) } in { env with cpt = n; env_stack = local_env :: tl_env; new_global_vars = (v, lscope) :: env.new_global_vars } end else let new_global_vars = (v, lscope) :: env.new_global_vars in let local_env = { local_env with block_info = new_block; rte = false (* must be already checked by mk_stmts *) } in { env with new_global_vars = new_global_vars; cpt = n; env_stack = local_env :: tl_env } exception No_term let new_var ~loc ?(scope=Varname.Block) ?name env t ty mk_stmts = let local_env, _ = top env in let memo tbl = try match t with | None -> raise No_term | Some t -> let v, e = Term.Map.find t tbl.new_exps in if Typ.equal ty v.vtype then v, e, env else raise No_term with Not_found | No_term -> do_new_var ~loc ~scope ?name env t ty mk_stmts in match scope with | Varname.Global | Varname.Function -> memo env.global_mp_tbl | Varname.Block -> memo local_env.mp_tbl let new_var_and_mpz_init ~loc ?scope ?name env t mk_stmts = new_var ~loc ?scope ?name env t (Gmp_types.Z.t ()) (fun v e -> Gmp.init ~loc e :: mk_stmts v e) module Logic_binding = struct let add_binding env logic_v vi = try let varinfos = Logic_var.Map.find logic_v env.var_mapping in Stack.push vi varinfos; env with Not_found | Stack.Empty -> let varinfos = Stack.create () in Stack.push vi varinfos; let var_mapping = Logic_var.Map.add logic_v varinfos env.var_mapping in { env with var_mapping = var_mapping } let add ?ty env logic_v = let ty = match ty with | Some ty -> ty | None -> match logic_v.lv_type with | Ctype ty -> ty | Linteger -> Gmp_types.Z.t () | Ltype _ as ty when Logic_const.is_boolean_type ty -> Cil.charType | Ltype _ | Lvar _ | Lreal | Larrow _ as lty -> let msg = Format.asprintf "logic variable of type %a" Logic_type.pretty lty in Error.not_yet msg in let v, e, env = new_var ~loc:Location.unknown env ~name:logic_v.lv_name None ty (fun _ _ -> []) in v, e, add_binding env logic_v v let get env logic_v = try let varinfos = Logic_var.Map.find logic_v env.var_mapping in Stack.top varinfos with Not_found | Stack.Empty -> assert false let remove env logic_v = try let varinfos = Logic_var.Map.find logic_v env.var_mapping in ignore (Stack.pop varinfos) with Not_found | Stack.Empty -> assert false end module Logic_scope = struct let get env = env.lscope let extend env lvs = { env with lscope = Lscope.add lvs env.lscope } let set_reset env bool = { env with lscope_reset = bool } let get_reset env = env.lscope_reset let reset env = if env.lscope_reset then { env with lscope = Lscope.empty } else env end let emitter = Emitter.create "E_ACSL" [ Emitter.Code_annot ] ~correctness:[ Options.Gmp_only.parameter ] ~tuning:[] let add_assert env stmt annot = match current_kf env with | None -> assert false | Some kf -> Queue.add (fun () -> Annotations.add_assert emitter ~kf stmt annot) env.visitor#get_filling_actions let add_stmt ?(post=false) ?before env stmt = if not post then Extlib.may (fun old -> E_acsl_label.move env.visitor ~old stmt) before; let local_env, tl = top env in let block = local_env.block_info in let block = if post then { block with post_stmts = stmt :: block.post_stmts } else { block with new_stmts = stmt :: block.new_stmts } in let local_env = { local_env with block_info = block } in { env with env_stack = local_env :: tl } let extend_stmt_in_place env stmt ~label block = let new_stmt = Cil.mkStmt ~valid_sid:true (Block block) in let sk = stmt.skind in stmt.skind <- Block (Cil.mkBlock [ new_stmt; Cil.mkStmt ~valid_sid:true sk ]); let pre = match label with | BuiltinLabel(Here | Post) -> true | BuiltinLabel(Old | Pre | LoopEntry | LoopCurrent | Init) | FormalLabel _ | StmtLabel _ -> false in if pre then let local_env, tl_env = top env in let b_info = local_env.block_info in let b_info = { b_info with pre_stmts = new_stmt :: b_info.pre_stmts } in { env with env_stack = { local_env with block_info = b_info } :: tl_env } else env let push env = (* Options.feedback "push (was %d)" (List.length env.env_stack);*) { env with env_stack = empty_local_env :: env.env_stack } let pop env = (* Options.feedback "pop";*) let _, tl = top env in { env with env_stack = tl } let transfer ~from env = match from.env_stack, env.env_stack with | { block_info = from_blk } :: _, ({ block_info = env_blk } as local) :: tl -> let new_blk = { new_block_vars = from_blk.new_block_vars @ env_blk.new_block_vars; new_stmts = from_blk.new_stmts @ env_blk.new_stmts; pre_stmts = from_blk.pre_stmts @ env_blk.pre_stmts; post_stmts = from_blk.post_stmts @ env_blk.post_stmts } in { env with env_stack = { local with block_info = new_blk } :: tl } | _, _ -> assert false type where = Before | Middle | After let pop_and_get ?(split=false) env stmt ~global_clear where = let split = split && stmt.labels = [] in (* Options.feedback "pop_and_get from %a (%b)" Printer.pp_stmt stmt split;*) let local_env, tl = top env in let clear = if global_clear then begin Varname.clear_locals (); env.global_mp_tbl.clear_stmts @ local_env.mp_tbl.clear_stmts end else local_env.mp_tbl.clear_stmts in (* Options.feedback "clearing %d mpz (global_clear: %b)" (List.length clear) global_clear;*) let block = local_env.block_info in let b = let pre_stmts, stmt = let rec extract stmt acc = function | [] -> acc, stmt | _ :: tl -> match stmt.skind with | Block { bstmts = [ fst; snd ] } -> extract snd (fst :: acc) tl | _ -> Kernel.fatal "experting a block containing 2 statements instead of %a" Printer.pp_stmt stmt in extract stmt [] block.pre_stmts in let new_s = block.new_stmts in let cat stmt l = match stmt.skind with | Instr(Skip _) -> l | _ -> stmt :: l in let stmts = match where with | Before -> cat stmt (acc_list_rev (List.rev clear) new_s) | Middle -> acc_list_rev (cat stmt (List.rev clear)) new_s | After -> (* if [split], do not put the given [stmt] in the generated block *) let stmts = if split then [] else cat stmt [] in acc_list_rev (acc_list_rev stmts clear) new_s in Cil.mkBlock (acc_list_rev stmts pre_stmts) in b.blocals <- acc_list_rev b.blocals block.new_block_vars; let b = (* blocks with local cannot be transient (see doc in cil.ml), while transient blocks prevent the E-ACSL labeling strategy from working properly: no transient block in that cases. *) if b.blocals = [] && stmt.labels = [] then Cil.transient_block b else b in let final_blk = (* if [split], put the generated code in a distinct sub-block and add the given [stmt] afterwards. This way, we have the guarantee that the final block does not contain any local, so may be transient. *) if split then match stmt.skind with | Instr (Skip _) -> b | _ -> let sblock = Cil.mkStmt ~valid_sid:true (Block b) in Cil.transient_block (Cil.mkBlock [ sblock; stmt ]) else b in (* remove superfluous brackets inside the generated block *) let final_blk = Cil.flatten_transient_sub_blocks final_blk in (* remove the non-scoping mark of the outermost block *) let final_blk = Cil.block_of_transient final_blk in (* add post-block statements *) final_blk.bstmts <- final_blk.bstmts @ block.post_stmts; final_blk, { env with env_stack = tl } let get_generated_variables env = List.rev env.new_global_vars let annotation_kind env = env.annotation_kind let set_annotation_kind env k = { env with annotation_kind = k } module Context = struct let ctx = ref [] let save env = ctx := env.new_global_vars let restore env = if !ctx <> [] then begin let vars = env.new_global_vars in let env = { env with new_global_vars = List.filter (fun (v, scope) -> (match scope with | LGlobal | LFunction _ -> true | LLocal_block _ -> false) && List.for_all (fun (v', _) -> v != v') vars) !ctx @ vars } in ctx := []; env end else env end (* debugging purpose *) let pretty fmt env = let local_env, _ = top env in Format.fprintf fmt "local new_stmts %t" (fun fmt -> List.iter (fun s -> Printer.pp_stmt fmt s) local_env.block_info.new_stmts) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/env.mli0000666000000000000000000001634413571573400021701 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Environments. Environments handle all the new C constructs (variables, statements and annotations. *) type t val dummy: t val empty: Visitor.frama_c_visitor -> t val has_no_new_stmt: t -> bool (** Assume that a local context has been previously pushed. @return true iff the given env does not contain any new statement. *) type localized_scope = | LGlobal | LFunction of kernel_function | LLocal_block of kernel_function val new_var: loc:location -> ?scope:Varname.scope -> ?name:string -> t -> term option -> typ -> (varinfo -> exp (* the var as exp *) -> stmt list) -> varinfo * exp * t (** [new_var env t ty mk_stmts] extends [env] with a fresh variable of type [ty] corresponding to [t]. [scope] is the scope of the new variable (default is [Block]). @return this variable as both a C variable and a C expression already initialized by applying it to [mk_stmts]. *) val new_var_and_mpz_init: loc:location -> ?scope:Varname.scope -> ?name:string -> t -> term option -> (varinfo -> exp (* the var as exp *) -> stmt list) -> varinfo * exp * t (** Same as [new_var], but dedicated to mpz_t variables initialized by {!Mpz.init}. *) module Logic_binding: sig val add: ?ty:typ -> t -> logic_var -> varinfo * exp * t (* Add a new C binding to the list of bindings for the logic variable. *) val add_binding: t -> logic_var -> varinfo -> t (* [add_binding env lv vi] defines [vi] as the latest C binding for [lv]. *) val get: t -> logic_var -> varinfo (* Return the latest C binding. *) val remove: t -> logic_var -> unit (* Remove the latest C binding. *) end val add_assert: t -> stmt -> predicate -> unit (** [add_assert env s p] associates the assertion [p] to the statement [s] in the environment [env]. *) val add_stmt: ?post:bool -> ?before:stmt -> t -> stmt -> t (** [add_stmt env s] extends [env] with the new statement [s]. [before] may define which stmt the new one is included before. This is to say that any labels attached to [before] are moved to [stmt]. [post] indicates that [stmt] should be added after the target statement. *) val extend_stmt_in_place: t -> stmt -> label:logic_label -> block -> t (** [extend_stmt_in_place env stmt ~label b] modifies [stmt] in place in order to add the given [block]. If [label] is [Here] or [Post], then this block is guaranteed to be at the first place of the resulting [stmt] whatever modification will be done by the visitor later. *) val push: t -> t (** Push a new local context in the environment *) type where = Before | Middle | After val pop_and_get: ?split:bool -> t -> stmt -> global_clear:bool -> where -> block * t (** Pop the last local context and get back the corresponding new block containing the given [stmt] at the given place ([Before] is before the code corresponding to annotations, [After] is after this code and [Middle] is between the stmt corresponding to annotations and the ones for freeing the memory. When [where] is [After], set [split] to true in order to generate one block which contains exactly 2 stmt: one for [stmt] and one sub-block for the generated stmts. *) val pop: t -> t (** Pop the last local context (ignore the corresponding new block if any *) val transfer: from:t -> t -> t (** Pop the last local context of [from] and push it into the other env. *) val get_generated_variables: t -> (varinfo * localized_scope) list (** All the new variables local to the visited function. *) val get_visitor: t -> Visitor.generic_frama_c_visitor val get_behavior: t -> Visitor_behavior.t val current_kf: t -> kernel_function option (** Kernel function currently visited in the new project. *) module Logic_scope: sig val get: t -> Lscope.t (** Return the logic scope associated to the environment. *) val extend: t -> Lscope.lscope_var -> t (** Add a new logic variable with its associated information in the logic scope of the environment. *) val reset: t -> t (** Return a new environment in which the logic scope is reset iff [set_reset _ true] has been called beforehand. Do nothing otherwise. *) val set_reset: t -> bool -> t (** Setter of the information indicating whether the logic scope should be reset at next call to [reset]. *) val get_reset: t -> bool (** Getter of the information indicating whether the logic scope should be reset at next call to [reset]. *) end val set_current_kf: t -> kernel_function -> unit (* Set current kf of the environment *) (* ************************************************************************** *) (** {2 Current annotation kind} *) (* ************************************************************************** *) val annotation_kind: t -> Misc.annotation_kind val set_annotation_kind: t -> Misc.annotation_kind -> t (* ************************************************************************** *) (** {2 Loop invariants} *) (* ************************************************************************** *) val push_loop: t -> t val add_loop_invariant: t -> predicate -> t val pop_loop: t -> predicate list * t (* ************************************************************************** *) (** {2 RTEs} *) (* ************************************************************************** *) val rte: t -> bool -> t val generate_rte: t -> bool (* ************************************************************************** *) (** {2 Context for error handling} *) (* ************************************************************************** *) module Context: sig val save: t -> unit val restore: t -> t end val pretty: Format.formatter -> t -> unit (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/gmp.ml0000666000000000000000000001143213571573400021514 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (**************************************************************************) (************************* Calls to builtins ******************************) (**************************************************************************) let apply_on_var ~loc funname e = let prefix = let ty = Cil.typeOf e in if Gmp_types.Z.is_t ty then "__gmpz_" else if Gmp_types.Q.is_t ty then "__gmpq_" else assert false in Misc.mk_call ~loc (prefix ^ funname) [ e ] let init ~loc e = apply_on_var "init" ~loc e let clear ~loc e = apply_on_var "clear" ~loc e exception Longlong of ikind let get_set_suffix_and_arg e = let ty = Cil.typeOf e in if Gmp_types.Z.is_t ty || Gmp_types.Q.is_t ty then "", [ e ] else match Cil.unrollType ty with | TInt(IChar, _) -> (if Cil.theMachine.Cil.theMachine.char_is_unsigned then "_ui" else "_si"), [ e ] | TInt((IBool | IUChar | IUInt | IUShort | IULong), _) -> "_ui", [ e ] | TInt((ISChar | IShort | IInt | ILong), _) -> "_si", [ e ] | TInt((ILongLong | IULongLong as ikind), _) -> raise (Longlong ikind) | TPtr(TInt(IChar, _), _) -> "_str", (* decimal base for the number given as string *) [ e; Cil.integer ~loc:e.eloc 10 ] | TFloat((FDouble | FFloat), _) -> (* FFloat is a strict subset of FDouble (modulo exceptional numbers) Hence, calling [set_d] for both of them is sound. HOWEVER: the machdep MUST NOT be vulnerable to double rounding [TODO] check the statement above *) "_d", [ e ] | TFloat(FLongDouble, _) -> Error.not_yet "creating gmp from long double" | _ -> assert false let generic_affect ~loc fname lv ev e = let ty = Cil.typeOf ev in if Gmp_types.Z.is_t ty || Gmp_types.Q.is_t ty then begin let suf, args = get_set_suffix_and_arg e in Misc.mk_call ~loc (fname ^ suf) (ev :: args) end else Cil.mkStmtOneInstr ~valid_sid:true (Set(lv, e, e.eloc)) let init_set ~loc lv ev e = let fname = let ty = Cil.typeOf ev in if Gmp_types.Z.is_t ty then "__gmpz_init_set" else if Gmp_types.Q.is_t ty then Options.fatal "no __gmpq_init_set: init then set separately" else "" in try generic_affect ~loc fname lv ev e with | Longlong IULongLong -> (match e.enode with | Lval elv -> assert (Gmp_types.Z.is_t (Cil.typeOf ev)); let call = Misc.mk_call ~loc "__gmpz_import" [ ev; Cil.one ~loc; Cil.one ~loc; Cil.sizeOf ~loc (TInt(IULongLong, [])); Cil.zero ~loc; Cil.zero ~loc; Cil.mkAddrOf ~loc elv ] in Cil.mkStmt ~valid_sid:true (Block (Cil.mkBlock [ init ~loc ev; call ])) | _ -> Error.not_yet "unsigned long long expression requiring GMP") | Longlong ILongLong -> Error.not_yet "long long requiring GMP" let affect ~loc lv ev e = let fname = let ty = Cil.typeOf ev in if Gmp_types.Z.is_t ty then "__gmpz_set" else if Gmp_types.Q.is_t ty then "__gmpq_set" else "" in try generic_affect ~loc fname lv ev e with Longlong _ -> Error.not_yet "quantification over long long and requiring GMP" (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/gmp.mli0000666000000000000000000000453713571573400021675 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Calls to the GMP's API. *) open Cil_types val init: loc:location -> exp -> stmt (** build stmt [mpz_init(v)] or [mpq_init(v)] depending on typ of [v] *) val init_set: loc:location -> lval -> exp -> exp -> stmt (** [init_set x_as_lv x_as_exp e] builds stmt [x = e] or [mpz_init_set*(v, e)] or [mpq_init_set*(v, e)] with the good function 'set' according to the type of [e] *) val clear: loc:location -> exp -> stmt (** build stmt [mpz_clear(v)] or [mpq_clear(v)] depending on typ of [v] *) val affect: loc:location -> lval -> exp -> exp -> stmt (** [affect x_as_lv x_as_exp e] builds stmt [x = e] or [mpz_set*(e)] or [mpq_set*(e)] with the good function 'set' according to the type of [e] *) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/label.ml0000666000000000000000000000767113571573400022022 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* The keys are the stmts which were previously labeled, whereas the associated values are the new stmts containing the same labels. *) module Labeled_stmts = Cil_state_builder.Stmt_hashtbl (Cil_datatype.Stmt) (struct let size = 7 let dependencies = [] (* delayed *) let name = "E-ACSL.Labels" end) let self = Labeled_stmts.self let new_labeled_stmt stmt = try Labeled_stmts.find stmt with Not_found -> stmt let move (vis:Visitor.generic_frama_c_visitor) ~old new_stmt = let labels = old.labels in match labels with | [] -> () | _ :: _ -> old.labels <- []; new_stmt.labels <- labels @ new_stmt.labels; let old = Visitor_behavior.Get_orig.stmt vis#behavior old in Labeled_stmts.add old new_stmt; (* update the gotos of the function jumping to one of the labels *) let o orig_stmt = object inherit Visitor.frama_c_inplace (* invariant of this method: [s = Visitor_behavior.Memo.stmt vis#behavior orig_stmt] *) method !vstmt_aux s = match s.skind, orig_stmt.skind with | Goto(s_ref, _), Goto(orig_ref, _) -> if Cil_datatype.Stmt.equal !orig_ref old && s_ref != orig_ref then (* Forward goto: it has already been visited. We must update the reference. *) s_ref := new_stmt; Cil.SkipChildren | _ -> Cil.DoChildren (* improve efficiency: skip children which cannot contain any label *) method !vinst _ = Cil.SkipChildren method !vexpr _ = Cil.SkipChildren method !vlval _ = Cil.SkipChildren end in let f = Extlib.the vis#current_func in let mv_labels s = ignore (Visitor.visitFramacStmt (o s) (Visitor_behavior.Memo.stmt vis#behavior s)) in List.iter mv_labels f.sallstmts let get_stmt vis = function | StmtLabel { contents = stmt } -> stmt | BuiltinLabel Here -> (match vis#current_stmt with | None -> Error.not_yet "label \"Here\" in function contract" | Some s -> s) | BuiltinLabel(Old | Pre) -> (try Kernel_function.find_first_stmt (Extlib.the vis#current_kf) with Kernel_function.No_Statement -> assert false) | BuiltinLabel(Post) -> (try Kernel_function.find_return (Extlib.the vis#current_kf) with Kernel_function.No_Statement -> assert false) | BuiltinLabel _ | FormalLabel _ -> assert false (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/label.mli0000666000000000000000000000420213571573400022156 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types val move: Visitor.generic_frama_c_visitor -> old:stmt -> stmt -> unit (** Move all labels of the [old] stmt onto the new [stmt]. Both stmts must be in the new project. *) val get_stmt: Visitor.generic_frama_c_visitor -> logic_label -> stmt (** @return the statement where the logic label points to. *) val new_labeled_stmt: stmt -> stmt (** @return the labeled stmt to use instead of the given one (which previously contained a label *) val self: State.t (** Internal state *) (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/logic_functions.ml0000666000000000000000000003315713571573400024126 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype (**************************************************************************) (********************** Forward references ********************************) (**************************************************************************) let named_predicate_to_exp_ref : (kernel_function -> Env.t -> predicate -> exp * Env.t) ref = Extlib.mk_fun "named_predicate_to_exp_ref" let term_to_exp_ref : (kernel_function -> Env.t -> term -> exp * Env.t) ref = Extlib.mk_fun "term_to_exp_ref" (*****************************************************************************) (************************** Auxiliary functions* ****************************) (*****************************************************************************) (* @return true iff the result of the function is provided by reference as the first extra argument at each call *) let result_as_extra_argument = Gmp_types.Z.is_t (* TODO: to be extended to any compound type? E.g. returning a struct is not good practice... *) (*****************************************************************************) (****************** Generation of function bodies ****************************) (*****************************************************************************) (* Generate the block of code containing the statement assigning [e] to [ret_vi] (the result). *) let generate_return_block ~loc env ret_vi e = match e.enode with | Lval (Var _, NoOffset) -> (* the returned value is a variable: Cil invariant preserved; no need of [ret_vi] *) let return_retres = Cil.mkStmt ~valid_sid:true (Return (Some e, loc)) in let b, env = Env.pop_and_get env return_retres ~global_clear:false Env.After in b.blocals <- b.blocals; b.bscoping <- true; b, env | _ -> (* the returned value is _not_ a variable: restore the invariant *) let init = AssignInit (SingleInit e) in let set = Cil.mkStmtOneInstr ~valid_sid:true (Local_init (ret_vi, init, loc)) in let return = Cil.mkStmt ~valid_sid:true (Return (Some (Cil.evar ~loc ret_vi), loc)) in let b, env = Env.pop_and_get env set ~global_clear:false Env.Middle in ret_vi.vdefined <- true; b.blocals <- ret_vi :: b.blocals; b.bstmts <- b.bstmts @ [ return ]; b.bscoping <- true; b, env (* Generate the function's body for predicates. *) let pred_to_block ~loc kf env ret_vi p = Typing.type_named_predicate ~must_clear:false p; let e, env = !named_predicate_to_exp_ref kf env p in (* for predicate, since the result is either 0 or 1, return it directly (it cannot be provided as extra argument *) generate_return_block ~loc env ret_vi e (* Generate the function's body for terms. *) let term_to_block ~loc kf env ret_ty ret_vi t = Typing.type_term ~use_gmp_opt:false ~ctx:(Typing.number_ty_of_typ ret_ty) t; let e, env = !term_to_exp_ref kf env t in if Cil.isVoidType ret_ty then (* if the function's result is a GMP, it is the first parameter of the function (by reference). *) let set = let lv_star_ret = Cil.mkMem ~addr:(Cil.evar ~loc ret_vi) ~off:NoOffset in let star_ret = Cil.new_exp ~loc (Lval lv_star_ret) in Gmp.init_set ~loc lv_star_ret star_ret e in let return_void = Cil.mkStmt ~valid_sid:true (Return (None, loc)) in let b, env = Env.pop_and_get env set ~global_clear:false Env.Middle in b.bstmts <- b.bstmts @ [ return_void ]; b.bscoping <- true; b, env else generate_return_block ~loc env ret_vi e let generate_body ~loc kf env ret_ty ret_vi = function | LBnone | LBreads _ -> Options.abort "logic function or predicate without explicit definition are not part of \ E-ACSL" | LBterm t -> term_to_block ~loc kf env ret_ty ret_vi t | LBpred p -> pred_to_block ~loc kf env ret_vi p | LBinductive _ -> Error.not_yet "inductive definition" (* Generate a kernel function from a given logic info [li] *) let generate_kf ~loc fname env ret_ty params_ty li = (* build the formal parameters *) let params, params_ty = List.fold_right2 (fun lvi pty (params, params_ty) -> let ty = match pty with | Typing.Gmpz -> (* GMP's integer are arrays: consider them as pointers in function's parameters *) Gmp_types.Z.t_as_ptr () | Typing.C_integer ik -> TInt(ik, []) | Typing.C_float ik -> TFloat(ik, []) (* for the time being, no reals but rationals instead *) | Typing.Rational -> Gmp_types.Q.t () | Typing.Real -> Error.not_yet "real number" | Typing.Nan -> Typing.typ_of_lty lvi.lv_type in (* build the formals: cannot use [Cil.makeFormal] since the function does not yet exist *) let vi = Cil.makeVarinfo false true lvi.lv_name ty in vi :: params, (lvi.lv_name, ty, []) :: params_ty) li.l_profile params_ty ([], []) in (* build the varinfo storing the result *) let ret_vi, ret_ty, params_with_ret, params_ty_with_ret = let vname = "__retres" in if result_as_extra_argument ret_ty then let ret_ty_ptr = TPtr(ret_ty, []) (* call by reference *) in let vname = vname ^ "_arg" in let vi = Cil.makeVarinfo false true vname ret_ty_ptr in vi, Cil.voidType, vi :: params, (vname, ret_ty_ptr, []) :: params_ty else Cil.makeVarinfo false false vname ret_ty, ret_ty, params, params_ty in (* build the function's varinfo *) let vi = Cil.makeGlobalVar fname (TFun (ret_ty, Some params_ty_with_ret, false, li.l_var_info.lv_attr)) in vi.vdefined <- true; (* create the fundec *) let fundec = { svar = vi; sformals = params_with_ret; slocals = []; (* filled later to break mutual dependencies between creating this list and creating the kf *) smaxid = 0; sbody = Cil.mkBlock []; (* filled later; same as above *) smaxstmtid = None; sallstmts = []; sspec = Cil.empty_funspec () } in Cil.setMaxId fundec; let spec = Cil.empty_funspec () in Queue.add (fun () -> Globals.Functions.replace_by_definition spec fundec loc) (Env.get_visitor env)#get_filling_actions; (* create the kernel function itself *) let kf = { fundec = Definition(fundec, loc); spec } in (* closure generating the function's body. Delay its generation after filling the memoisation table (for termination of recursive function calls) *) let gen_body () = let env = Env.push env in let old_kf = Extlib.the (Env.current_kf env) in Env.set_current_kf env kf; (* fill the typing environment with the function's parameters before generating the code (code generation invokes typing) *) let env = let add env lvi vi = let i = Interval.interv_of_typ vi.vtype in Interval.Env.add lvi i; Env.Logic_binding.add_binding env lvi vi in List.fold_left2 add env li.l_profile params in let b, env = generate_body ~loc kf env ret_ty ret_vi li.l_body in fundec.sbody <- b; (* add the generated variables in the necessary lists *) (* TODO: factorized the code below that add the generated vars with method [add_generated_variables_in_function] in the main visitor *) let vars = let l = Env.get_generated_variables env in if ret_vi.vdefined then (ret_vi, Env.LFunction kf) :: l else l in let locals, blocks = List.fold_left (fun (local_vars, block_vars as acc) (v, scope) -> match scope with | Env.LFunction kf' when Kernel_function.equal kf kf' -> v :: local_vars, block_vars | Env.LLocal_block kf' when Kernel_function.equal kf kf' -> v :: local_vars, block_vars | _ -> acc) (fundec.slocals, fundec.sbody.blocals) vars in fundec.slocals <- locals; fundec.sbody.blocals <- blocks; List.iter (fun lvi -> Interval.Env.remove lvi; ignore (Env.Logic_binding.remove env lvi)) li.l_profile; Env.set_current_kf env (Visitor_behavior.Get_orig.kernel_function (Env.get_behavior env) old_kf) in vi, kf, gen_body (**************************************************************************) (***************************** Memoization ********************************) (**************************************************************************) module Params_ty = Datatype.List_with_collections (Typing.Datatype) (struct let module_name = "E_ACSL.Logic_functions.Params_ty" end) (* for each logic_info, associate its possible profiles, i.e. the types of its parameters + the generated varinfo for the function *) let memo_tbl: kernel_function Params_ty.Hashtbl.t Logic_info.Hashtbl.t = Logic_info.Hashtbl.create 7 let reset () = Logic_info.Hashtbl.clear memo_tbl let add_generated_functions globals = let rec aux acc = function | [] -> acc | GAnnot(Dfun_or_pred(li, loc), _) as g :: l -> let acc = g :: acc in (try (* add the declarations close to its corresponding logic function or predicate *) let params = Logic_info.Hashtbl.find memo_tbl li in let add_fundecl kf acc = GFunDecl(Cil.empty_funspec (), Kernel_function.get_vi kf, loc) :: acc in aux (Params_ty.Hashtbl.fold (fun _ -> add_fundecl) params acc) l with Not_found -> aux acc l) | g :: l -> aux (g :: acc) l in let rev_globals = aux [] globals in (* add the definitions at the end of [globals] *) let add_fundec kf globals = let fundec = try Kernel_function.get_definition kf with Kernel_function.No_Definition -> assert false in GFun(fundec, Location.unknown) :: globals in let rev_globals = Logic_info.Hashtbl.fold (fun _ -> Params_ty.Hashtbl.fold (fun _ -> add_fundec)) memo_tbl rev_globals in List.rev rev_globals let tapp_to_exp ~loc fname env t li params_ty args = let ret_ty = Typing.get_typ t in let gen tbl = let vi, kf, gen_body = generate_kf fname ~loc env ret_ty params_ty li in Params_ty.Hashtbl.add tbl params_ty kf; vi, gen_body in (* memoise the function's varinfo *) let fvi, gen_body = try let h = Logic_info.Hashtbl.find memo_tbl li in try let kf = Params_ty.Hashtbl.find h params_ty in Kernel_function.get_vi kf, (fun () -> ()) (* body generation already planified *) with Not_found -> gen h with Not_found -> let h = Params_ty.Hashtbl.create 7 in Logic_info.Hashtbl.add memo_tbl li h; gen h in (* the generation of the function body must be performed after memoizing the kernel function in order to handle recursive calls in finite time :-) *) gen_body (); (* create the function call for the tapp *) let mkcall vi = let mk_args types args = match types (* generated by E-ACSL: no need to unroll *) with | TFun(_, Some params, _, _) -> (* additional casts are necessary whenever the argument is GMP and the parameter is a (small) integralType: after handling the context in [Translate] through [add_cast], the GMP has been translated into a [long] (that is what provided the GMP API). This [long] must now be translated to the parameter's type. It cannot be done before since the exact type of the parameter is only computed when the function is generated *) List.map2 (fun (_, newt, _) e -> Cil.mkCast ~force:false ~newt ~e) params args | _ -> assert false in if result_as_extra_argument ret_ty then let args = mk_args fvi.vtype (Cil.mkAddrOf ~loc (Cil.var vi) :: args) in Call(None, Cil.evar fvi, args, loc) else let args = mk_args fvi.vtype args in Call(Some (Cil.var vi), Cil.evar fvi, args, loc) in (* generate the varinfo storing the result of the call *) Env.new_var ~loc ~name:li.l_var_info.lv_name env (Some t) ret_ty (fun vi _ -> [ Cil.mkStmtOneInstr ~valid_sid:true (mkcall vi) ]) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/logic_functions.mli0000666000000000000000000000606313571573400024273 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Generate C implementations of user-defined logic functions. A logic function can have multiple C implementations depending on the types computed for its arguments. Eg: Consider the following definition: [integer g(integer x) = x] with the following calls: [g(5)] and [g(10*INT_MAX)] They will respectively generate the C prototypes [int g_1(int)] and [long g_2(long)] *) (**************************************************************************) (************** Logic functions without labels ****************************) (**************************************************************************) val reset: unit -> unit val tapp_to_exp: loc:location -> string -> Env.t -> term -> logic_info -> Typing.number_ty list -> exp list -> varinfo * exp * Env.t val add_generated_functions: global list -> global list (* @return the input list of globals in which the generated functions have been inserted at the right places (both their declaration and their definition) *) (**************************************************************************) (********************** Forward references ********************************) (**************************************************************************) val named_predicate_to_exp_ref: (kernel_function -> Env.t -> predicate -> exp * Env.t) ref val term_to_exp_ref: (kernel_function -> Env.t -> term -> exp * Env.t) ref (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/loops.ml0000666000000000000000000003057613571573400022077 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil open Cil_types (**************************************************************************) (********************** Forward references ********************************) (**************************************************************************) let translate_named_predicate_ref : (kernel_function -> Env.t -> predicate -> Env.t) ref = Extlib.mk_fun "translate_named_predicate_ref" let named_predicate_ref : (kernel_function -> Env.t -> predicate -> exp * Env.t) ref = Extlib.mk_fun "named_predicate_ref" let term_to_exp_ref : (kernel_function -> Env.t -> term -> exp * Env.t) ref = Extlib.mk_fun "term_to_exp_ref" (**************************************************************************) (************************* Loop invariants ********************************) (**************************************************************************) module Loop_invariants_actions = Hook.Make(struct end) let apply_after_transformation prj = Project.on prj Loop_invariants_actions.apply () let mv_invariants env ~old stmt = Options.feedback ~current:true ~level:3 "keep loop invariants attached to its loop"; match Env.current_kf env with | None -> assert false | Some kf -> let filter _ ca = match ca.annot_content with | AInvariant(_, b, _) -> b | _ -> false in let l = Annotations.code_annot_emitter ~filter stmt in if l != [] then Loop_invariants_actions.extend (fun () -> List.iter (fun (ca, e) -> Annotations.remove_code_annot e ~kf old ca; Annotations.add_code_annot e ~kf stmt ca) l) let preserve_invariant prj env kf stmt = match stmt.skind with | Loop(_, ({ bstmts = stmts } as blk), loc, cont, break) -> let rec handle_invariants (stmts, env, _ as acc) = function | [] -> (* empty loop body: no need to verify the invariant twice *) acc | [ last ] -> let invariants, env = Env.pop_loop env in let env = Env.push env in let env = let translate_named_predicate = !translate_named_predicate_ref in Project.on prj (List.fold_left (translate_named_predicate kf) env) invariants in let blk, env = Env.pop_and_get env last ~global_clear:false Env.Before in Misc.mk_block prj last blk :: stmts, env, invariants != [] | s :: tl -> handle_invariants (s :: stmts, env, false) tl in let env = Env.set_annotation_kind env Misc.Invariant in let stmts, env, has_loop = handle_invariants ([], env, false) stmts in let new_blk = { blk with bstmts = List.rev stmts } in { stmt with skind = Loop([], new_blk, loc, cont, break) }, env, has_loop | _ -> stmt, env, false (**************************************************************************) (**************************** Nested loops ********************************) (**************************************************************************) (* It could happen that the bounds provided for a quantifier [lv] are bigger than its type. [bounds_for_small_type] handles such cases and provides smaller bounds whenever possible. Let B be the inferred interval and R the range of [lv.typ] - Case 1: B \subseteq R Example: [\forall unsigned char c; 4 <= c <= 100 ==> 0 <= c <= 255] Return: B - Case 2: B \not\subseteq R and the bounds of B are inferred exactly Example: [\forall unsigned char c; 4 <= c <= 300 ==> 0 <= c <= 255] Return: B \intersect R - Case 3: B \not\subseteq R and the bounds of B are NOT inferred exactly Example: [\let m = n > 0 ? 4 : 341; \forall char u; 1 < u < m ==> u > 0] Return: R with a guard guaranteeing that [lv] does not overflow *) let bounds_for_small_type ~loc (t1, lv, t2) = match lv.lv_type with | Ltype _ | Lvar _ | Lreal | Larrow _ -> Options.abort "quantification over non-integer type is not part of E-ACSL" | Linteger -> t1, t2, None | Ctype ty -> let iv1 = Interval.(extract_ival (infer t1)) in let iv2 = Interval.(extract_ival (infer t2)) in (* Ival.join is NOT correct here: Eg: (Ival.join [-3..-3] [300..300]) gives {-3, 300} but NOT [-3..300] *) let iv = Ival.inject_range (Ival.min_int iv1) (Ival.max_int iv2) in let ity = Interval.extract_ival (Interval.interv_of_typ ty) in if Ival.is_included iv ity then (* case 1 *) t1, t2, None else if Ival.is_singleton_int iv1 && Ival.is_singleton_int iv2 then begin (* case 2 *) let i = Ival.meet iv ity in (* now we potentially have a better interval for [lv] ==> update the binding *) Interval.Env.replace lv (Interval.Ival i); (* the smaller bounds *) let min, max = Misc.finite_min_and_max i in let t1 = Logic_const.tint ~loc min in let t2 = Logic_const.tint ~loc max in let ctx = Typing.number_ty_of_typ ty in (* we are assured that we will not have a GMP, once again because we intersected with [ity] *) Typing.type_term ~use_gmp_opt:false ~ctx t1; Typing.type_term ~use_gmp_opt:false ~ctx t2; t1, t2, None end else (* case 3 *) let min, max = Misc.finite_min_and_max ity in let guard_lower = Logic_const.tint ~loc min in let guard_upper = Logic_const.tint ~loc max in let lv_term = Logic_const.tvar ~loc lv in let guard_lower = Logic_const.prel ~loc (Rle, guard_lower, lv_term) in let guard_upper = Logic_const.prel ~loc (Rle, lv_term, guard_upper) in let guard = Logic_const.pand ~loc (guard_lower, guard_upper) in t1, t2, Some guard let rec mk_nested_loops ~loc mk_innermost_block kf env lscope_vars = let term_to_exp = !term_to_exp_ref in match lscope_vars with | [] -> mk_innermost_block env | Lscope.Lvs_quantif(t1, rel1, logic_x, rel2, t2) :: lscope_vars' -> let t1, t2, guard_for_small_type_opt = bounds_for_small_type ~loc (t1, logic_x, t2) in let ctx = let ty1 = Typing.get_number_ty t1 in let ty2 = Typing.get_number_ty t2 in Typing.join ty1 ty2 in let t_plus_one ?ty t = (* whenever provided, [ty] is known to be the type of the result *) let tone = Cil.lone ~loc () in let res = Logic_const.term ~loc (TBinOp(PlusA, t, tone)) Linteger in Extlib.may (fun ty -> Typing.unsafe_set tone ~ctx:ty ctx; Typing.unsafe_set t ~ctx:ty ctx; Typing.unsafe_set res ty) ty; res in let t1 = match rel1 with | Rlt -> let t = t_plus_one t1 in Typing.type_term ~use_gmp_opt:false ~ctx t; t | Rle -> t1 | Rgt | Rge | Req | Rneq -> assert false in let t2_one, bop2 = match rel2 with | Rlt -> t2, Lt | Rle -> (* we increment the loop counter one more time (at the end of the loop). Thus to prevent overflow, check the type of [t2+1] instead of [t2]. *) t_plus_one t2, Le | Rgt | Rge | Req | Rneq -> assert false in Typing.type_term ~use_gmp_opt:false ~ctx t2_one; let ctx_one = let ty1 = Typing.get_number_ty t1 in let ty2 = Typing.get_number_ty t2_one in Typing.join ty1 ty2 in let ty = try Typing.typ_of_number_ty ctx_one with Typing.Not_a_number -> assert false in (* loop counter corresponding to the quantified variable *) let var_x, x, env = Env.Logic_binding.add ~ty env logic_x in let lv_x = var var_x in let env = match ctx_one with | Typing.C_integer _ -> env | Typing.Gmpz -> Env.add_stmt env (Gmp.init ~loc x) | Typing.(C_float _ | Rational | Real | Nan) -> assert false in (* build the inner loops and loop body *) let body, env = mk_nested_loops ~loc mk_innermost_block kf env lscope_vars' in (* initialize the loop counter to [t1] *) let e1, env = term_to_exp kf (Env.push env) t1 in let init_blk, env = Env.pop_and_get env (Gmp.affect ~loc:e1.eloc lv_x x e1) ~global_clear:false Env.Middle in (* generate the guard [x bop t2] *) let block_to_stmt b = mkStmt ~valid_sid:true (Block b) in let tlv = Logic_const.tvar ~loc logic_x in let guard = (* must copy [t2] to force being typed again *) Logic_const.term ~loc (TBinOp(bop2, tlv, { t2 with term_node = t2.term_node } )) Linteger in Typing.type_term ~use_gmp_opt:false ~ctx:Typing.c_int guard; let guard_exp, env = term_to_exp kf (Env.push env) guard in let break_stmt = mkStmt ~valid_sid:true (Break guard_exp.eloc) in let guard_blk, env = Env.pop_and_get env (mkStmt ~valid_sid:true (If( guard_exp, mkBlock [ mkEmptyStmt ~loc () ], mkBlock [ break_stmt ], guard_exp.eloc))) ~global_clear:false Env.Middle in let guard = block_to_stmt guard_blk in (* increment the loop counter [x++]; previous typing ensures that [x++] fits type [ty] *) let tlv_one = t_plus_one ~ty:ctx_one tlv in let incr, env = term_to_exp kf (Env.push env) tlv_one in let next_blk, env = Env.pop_and_get env (Gmp.affect ~loc:incr.eloc lv_x x incr) ~global_clear:false Env.Middle in (* generate the whole loop *) let next = block_to_stmt next_blk in let stmts, env = match guard_for_small_type_opt with | None -> guard :: body @ [ next ], env | Some p -> let e, env = !named_predicate_ref kf (Env.push env) p in let stmt, env = Misc.mk_e_acsl_guard ~reverse:true Misc.RTE kf e p, env in let b, env = Env.pop_and_get env stmt ~global_clear:false Env.After in let guard_for_small_type = Cil.mkStmt ~valid_sid:true (Block b) in guard_for_small_type :: guard :: body @ [ next ], env in let start = block_to_stmt init_blk in let stmt = mkStmt ~valid_sid:true (Loop( [], mkBlock stmts, loc, None, Some break_stmt)) in (* remove logic binding before returning *) Env.Logic_binding.remove env logic_x; [ start ; stmt ], env | Lscope.Lvs_let(lv, t) :: lscope_vars' -> let ty = Typing.get_typ t in let vi_of_lv, exp_of_lv, env = Env.Logic_binding.add ~ty env lv in let e, env = term_to_exp kf env t in let ty = Cil.typeOf e in let init_set = if Gmp_types.Q.is_t ty then Rational.init_set else Gmp.init_set in let let_stmt = init_set ~loc (Cil.var vi_of_lv) exp_of_lv e in let stmts, env = mk_nested_loops ~loc mk_innermost_block kf env lscope_vars' in (* remove the logic binding now that the block is constructed *) Env.Logic_binding.remove env lv; (* return *) let_stmt :: stmts, env | Lscope.Lvs_formal _ :: _ -> Error.not_yet "creating nested loops from formal variable of a logic function" | Lscope.Lvs_global _ :: _ -> Error.not_yet "creating nested loops from global logic variable" (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/loops.mli0000666000000000000000000000731413571573400022242 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Loop specific actions. *) open Cil_types (**************************************************************************) (************************* Loop invariants ********************************) (**************************************************************************) val apply_after_transformation: Project.t -> unit val mv_invariants: Env.t -> old:stmt -> stmt -> unit (** Transfer the loop invariants from the [old] loop to the new one. Both statements must be loops. *) val preserve_invariant: Project.t -> Env.t -> Kernel_function.t -> stmt -> stmt * Env.t * bool (** modify the given stmt loop to insert the code which preserves its loop invariants. Also return the modify environment and a boolean which indicates whether the annotations corresponding to the loop invariant must be moved from the new statement to the old one. *) (**************************************************************************) (**************************** Nested loops ********************************) (**************************************************************************) val mk_nested_loops: loc:location -> (Env.t -> stmt list * Env.t) -> kernel_function -> Env.t -> Lscope.lscope_var list -> stmt list * Env.t (** [mk_nested_loops ~loc mk_innermost_block kf env lvars] creates nested loops (with the proper statements for initializing the loop counters) from the list of logic variables [lvars]. Quantified variables create loops while let-bindings simply create new variables. The [mk_innermost_block] closure creates the statements of the innermost block. *) (**************************************************************************) (********************** Forward references ********************************) (**************************************************************************) val translate_named_predicate_ref: (kernel_function -> Env.t -> predicate -> Env.t) ref val named_predicate_ref: (kernel_function -> Env.t -> predicate -> exp * Env.t) ref val term_to_exp_ref: (kernel_function -> Env.t -> term -> exp * Env.t) ref (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/mmodel_translate.ml0000666000000000000000000003621513571573400024271 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (**************************************************************************) (********************** Forward references ********************************) (**************************************************************************) let predicate_to_exp_ref : (kernel_function -> Env.t -> predicate -> exp * Env.t) ref = Extlib.mk_fun "named_predicate_to_exp_ref" let term_to_exp_ref : (kernel_function -> Env.t -> term -> exp * Env.t) ref = Extlib.mk_fun "term_to_exp_ref" (*****************************************************************************) (****************************** Ranges Elimination ***************************) (*****************************************************************************) (* We call Range Elimination the operation through which ranges are substituted by universally quantified logic variables. Example: [\valid(&t[(n-1)..(n+2)][1][0..1])] can be soundly transformed into [\forall integer q1; n-1 <= q1 <= n+2 ==> \forall integer q2; 0 <= q2 <= 1 ==> \valid(&t[q1][1][q2])] However, the substitution can be unsound, in which case [Range_elimination_exception] must be raised. Example: [\valid(&t[(0..2)==(0..2) ? 0 : 1])] is equivalent to [\valid(&t[0])] since [==] refers to set equality when applied on ranges. But Range Elimination will give a predicate equivalent to [\valid(&t[1])] since [\forall 0 <= q1,q2 <= 2: q1==q2] is false. Hence [Range_elimination_exception] must be raised. *) exception Range_elimination_exception (* Takes a [toffset] and checks whether it contains an index that is a set *) let rec has_set_as_index = function | TNoOffset -> false | TIndex(t, toffset) -> Logic_const.is_set_type t.term_type || has_set_as_index toffset | TModel(_, toffset) | TField(_, toffset) -> has_set_as_index toffset (* Performs Range Elimination on index [TIndex(term, offset)]. Term part. Raises [Range_elimination_exception] if whether the operation is unsound or if we don't support the construction yet. *) let eliminate_ranges_from_index_of_term ~loc t = match t.term_node with | Trange(Some n1, Some n2) -> let name = Varname.get ~scope:Varname.Block "range" in let lv = Cil_const.make_logic_var_kind name LVQuant Linteger in let tlv = Logic_const.tvar ~loc lv in tlv, (n1, lv, n2) | _ -> raise Range_elimination_exception (* Performs Range Elimination on index [TIndex(term, offset)]. Offset part. Raises [Range_elimination_exception], through [eliminate_ranges_from_ index_of_term], if whether the operation is unsound or if we don't support the construction yet. *) let rec eliminate_ranges_from_index_of_toffset ~loc toffset quantifiers = match toffset with | TIndex(t, toffset') -> if Misc.is_range_free t then let toffset', quantifiers' = eliminate_ranges_from_index_of_toffset ~loc toffset' quantifiers in TIndex(t, toffset'), quantifiers' else (* Attempt Range Elimination on [t] *) let t1, quantifiers1 = eliminate_ranges_from_index_of_term ~loc t in let toffset2, quantifiers2 = eliminate_ranges_from_index_of_toffset ~loc toffset' quantifiers in let toffset3 = TIndex(t1, toffset2) in toffset3, quantifiers1 :: quantifiers2 | TNoOffset -> toffset, quantifiers | TModel _ -> Error.not_yet "range elimination on TModel" | TField _ -> Error.not_yet "range elimination on TField" (*****************************************************************************) (********************** Calls without Range Elimination **********************) (************** \base_addr, \block_length, \offset, \freeable ****************) (*****************************************************************************) (* \base_addr, \block_length, \offset and \freeable *) let call ~loc kf name ctx env t = assert (name = "base_addr" || name = "block_length" || name = "offset" || name ="freeable"); let e, env = !term_to_exp_ref kf (Env.rte env true) t in let _, res, env = Env.new_var ~loc ~name env None ctx (fun v _ -> let name = Functions.RTL.mk_api_name name in [ Misc.mk_call ~loc ~result:(Cil.var v) name [ e ] ]) in res, env (*****************************************************************************) (************************* Calls with Range Elimination **********************) (********************** \initialized, \valid, \valid_read ********************) (*****************************************************************************) (* Take the term [size] that has been typed into GMP and return an expression of type [size_t]. The case where [!(0 <= size < SIZE_MAX)] is an UB ==> guard against it. *) let gmp_to_sizet ~loc kf env size p = let sizet = Cil.(theMachine.typeOfSizeOf) in (* The guard *) let sizet_max = Logic_const.tint ~loc (Cil.max_unsigned_number (Cil.bitsSizeOf sizet)) in let guard_upper = Logic_const.prel ~loc (Rlt, size, sizet_max) in let guard_lower = Logic_const.prel ~loc (Rle, Cil.lzero ~loc (), size) in let guard = Logic_const.pand ~loc (guard_lower, guard_upper) in Typing.type_named_predicate ~must_clear:false guard; let guard, env = !predicate_to_exp_ref kf env guard in (* Translate term [size] into an exp of type [size_t] *) let size, env = !term_to_exp_ref kf env size in let _, e, env = Env.new_var ~loc ~name:"size" env None sizet (fun vi _ -> [ Misc.mk_e_acsl_guard ~reverse:true Misc.RTE kf guard p; Misc.mk_call ~loc ~result:(Cil.var vi) "__gmpz_get_ui" [ size ] ]) in e, env (* Call to [__e_acsl_] for terms of the form [ptr + r] when [ = valid or initialized or valid_read] and where [ptr] is an address and [r] a range offset *) let call_memory_block ~loc kf name ctx env ptr r p = let n1, n2 = match r.term_node with | Trange(Some n1, Some n2) -> n1, n2 | Trange(None, _) | Trange(_, None) -> Options.abort "unbounded ranges are not part of E-ACSL" | _ -> assert false in (* s *) let ty = match Cil.unrollType (Misc.cty ptr.term_type) with | TPtr(ty, _) | TArray(ty, _, _, _) -> ty | _ -> assert false in let s = Logic_const.term ~loc (TSizeOf ty) Linteger in (* ptr *) let typ_charptr = Cil.charPtrType in let ptr = Logic_const.term ~loc (TBinOp( PlusPI, Logic_utils.mk_cast ~loc ~force:false typ_charptr ptr, Logic_const.term ~loc (TBinOp(Mult, s, n1)) Linteger)) (Ctype typ_charptr) in Typing.type_term ~use_gmp_opt:false ~ctx:Typing.nan ptr; let term_to_exp = !term_to_exp_ref in let ptr, env = term_to_exp kf (Env.rte env true) ptr in (* size *) let size_term = (* Since [s] and [n1] have been typed through [ptr], we need to clone them in order to force retyping *) let s = { s with term_node = s.term_node } in let n1 = { n1 with term_node = n1.term_node } in Logic_const.term ~loc (TBinOp( Mult, s, Logic_const.term ~loc (TBinOp(MinusA, n2, n1)) Linteger)) Linteger in Typing.type_term ~use_gmp_opt:false size_term; let size, env = match Typing.get_number_ty size_term with | Typing.Gmpz -> gmp_to_sizet ~loc kf env size_term p | Typing.(C_integer _ | C_float _) -> let size, env = term_to_exp kf env size_term in Cil.constFold false size, env | Typing.(Rational | Real | Nan) -> assert false in (* base and base_addr *) let base, _ = Misc.ptr_index ~loc ptr in let base_addr = match base.enode with | AddrOf _ | Const _ -> Cil.zero ~loc | Lval lv | StartOf lv -> Cil.mkAddrOrStartOf ~loc lv | _ -> assert false in (* generating env *) let _, e, env = Env.new_var ~loc ~name env None ctx (fun v _ -> let fname = Functions.RTL.mk_api_name name in let args = match name with | "valid" | "valid_read" -> [ ptr; size; base; base_addr ] | "initialized" -> [ ptr; size ] | _ -> Error.not_yet ("builtin " ^ name) in [ Misc.mk_call ~loc ~result:(Cil.var v) fname args ]) in e, env (* [call_with_ranges] handles ranges in [t] when calling builtin [name]. It only supports the following cases for the time being: A: [\builtin(ptr+r)] where [ptr] is an address and [r] a range or [\builtin(t[r])] or [\builtin(t[i_1]...[i_n])] where [t] is dynamically allocated and all the indexes are integers, except the last one which is a range The generated code is a SINGLE call to the corresponding E-ACSL builtin B: [\builtin(t[i_1]...[i_n])] where [t] is NOT dynamically allocated and the indexes are integers or ranges The generated code is a SET OF calls to the corresponding E-ACSL builtin C: Any other use of ranges/No range Call [call_default] which performs the translation for range free terms, and raises Not_yet if it ever encounters a range. Example for case: A: [\valid(&t[3..5])] Contiguous locations -> a single call to [__e_acsl_valid] B: [\valid(&t[4][3..5][2])] NON-contiguous locations -> multiple calls (3) to [__e_acsl_valid] *) let call_with_ranges ~loc kf name ctx env t p call_default = if Misc.is_bitfield_pointers t.term_type then Error.not_yet "bitfield pointer"; match t.term_node with | TBinOp((PlusPI | IndexPI), ptr, ({ term_node = Trange _ } as r)) -> if Misc.is_set_of_ptr_or_array ptr.term_type then Error.not_yet "arithmetic over set of pointers or arrays" else (* Case A *) call_memory_block ~loc kf name ctx env ptr r p | TAddrOf(TVar lv, TIndex({ term_node = Trange _ } as r, TNoOffset)) -> (* Case A *) assert (Logic_const.is_set_type t.term_type); let lty_noset = Logic_const.type_of_element t.term_type in let ptr = Logic_const.taddrof ~loc (TVar lv, TNoOffset) lty_noset in call_memory_block ~loc kf name ctx env ptr r p | TAddrOf(TVar ({ lv_type = Ctype (TArray _) } as lv), toffset) -> if has_set_as_index toffset then (* Case B *) try let toffset', quantifiers = eliminate_ranges_from_index_of_toffset ~loc toffset [] in let lty_noset = if Logic_const.is_set_type t.term_type then Logic_const.type_of_element t.term_type else t.term_type in let t' = Logic_const.taddrof ~loc (TVar lv, toffset') lty_noset in let p_quantified = (* [loc] prevents a type error with eta-expansion and label *) let loc = Some loc in let call f = f ?loc (Logic_const.here_label, t') in match name with | "valid" -> call Logic_const.pvalid | "initialized" -> call Logic_const.pinitialized | "valid_read" -> call Logic_const.pvalid_read | _ -> Options.fatal "[call_with_ranges] unexpected builtin" in let p_quantified = List.fold_left (fun p (tmin, lv, tmax) -> (* \forall integer tlv; tmin <= tlv <= tmax ==> p *) let tlv = Logic_const.tvar ~loc lv in let lower_bound = Logic_const.prel ~loc (Rle, tmin, tlv) in let upper_bound = Logic_const.prel ~loc (Rle, tlv, tmax) in let bound = Logic_const.pand ~loc (lower_bound, upper_bound) in let bound_imp_p = Logic_const.pimplies ~loc (bound, p) in Logic_const.pforall ~loc ([lv], bound_imp_p)) p_quantified quantifiers in Typing.type_named_predicate ~must_clear:true p_quantified; !predicate_to_exp_ref kf env p_quantified with Range_elimination_exception -> (* Case C *) call_default ~loc kf name ctx env t else (* Case C *) call_default ~loc kf name ctx env t | _ -> (* Case C *) call_default ~loc kf name ctx env t (* \initialized *) let call_with_size ~loc kf name ctx env t p = assert (name = "initialized"); let call_for_unsupported_constructs ~loc kf name ctx env t = let term_to_exp = !term_to_exp_ref in let e, env = term_to_exp kf (Env.rte env true) t in let _, res, env = Env.new_var ~loc ~name env None ctx (fun v _ -> let ty = Misc.cty t.term_type in let sizeof = Misc.mk_ptr_sizeof ty loc in let fname = Functions.RTL.mk_api_name name in [ Misc.mk_call ~loc ~result:(Cil.var v) fname [ e; sizeof ] ]) in res, env in call_with_ranges ~loc kf name ctx env t p call_for_unsupported_constructs (* \valid and \valid_read *) let call_valid ~loc kf name ctx env t p = assert (name = "valid" || name = "valid_read"); let call_for_unsupported_constructs ~loc kf name ctx env t = let term_to_exp = !term_to_exp_ref in let e, env = term_to_exp kf (Env.rte env true) t in let base, _ = Misc.ptr_index ~loc e in let base_addr = match base.enode with | AddrOf _ | Const _ -> Cil.zero ~loc | Lval lv | StartOf lv -> Cil.mkAddrOrStartOf ~loc lv | _ -> assert false in let _, res, env = Env.new_var ~loc ~name env None ctx (fun v _ -> let ty = Misc.cty t.term_type in let sizeof = Misc.mk_ptr_sizeof ty loc in let fname = Functions.RTL.mk_api_name name in let args = [ e; sizeof; base; base_addr ] in [ Misc.mk_call ~loc ~result:(Cil.var v) fname args ]) in res, env in call_with_ranges ~loc kf name ctx env t p call_for_unsupported_constructs frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/mmodel_translate.mli0000666000000000000000000000630713571573400024441 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* Create calls to a few memory builtins. Partial support for ranges is provided. *) val call: loc:location -> kernel_function -> string -> typ -> Env.t -> term -> exp * Env.t (* [call ~loc kf name ctx env t] creates a call to the E-ACSL memory builtin identified by [name] which only requires a single argument, namely the pointer under study. The supported builtins are: [base_addr], [block_length], [offset] and [freeable]. *) val call_with_size: loc:location -> kernel_function -> string -> typ -> Env.t -> term -> predicate -> exp * Env.t (* [call_with_size ~loc kf name ctx env t p] creates a call to the E-ACSL memory builtin identified by [name] which requires two arguments, namely the pointer under study and a size in bytes. The only supported builtin is: [initialized]. [t] can denote ranges of memory locations. [p] is the predicate under testing. *) val call_valid: loc:location -> kernel_function -> string -> typ -> Env.t -> term -> predicate -> exp * Env.t (* [call_valid ~loc kf name ctx env t p] creates a call to the E-ACSL memory builtin [valid] or [valid_read] according to [name]. [t] can denote ranges of memory locations. [p] is the predicate under testing. *) (**************************************************************************) (********************** Forward references ********************************) (**************************************************************************) val predicate_to_exp_ref: (kernel_function -> Env.t -> predicate -> exp * Env.t) ref val term_to_exp_ref: (kernel_function -> Env.t -> term -> exp * Env.t) refframa-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/quantif.ml0000666000000000000000000002271613571573400022407 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil open Cil_datatype let predicate_to_exp_ref : (kernel_function -> Env.t -> predicate -> exp * Env.t) ref = Extlib.mk_fun "named_predicate_to_exp_ref" let compute_quantif_guards quantif bounded_vars hyps = let error msg pp x = let msg1 = Format.asprintf msg pp x in let msg2 = Format.asprintf "@[ in quantification@ %a@]" Printer.pp_predicate quantif in Error.untypable (msg1 ^ msg2) in let rec left_term acc vars left_bound t = match t.term_node with | TLogic_coerce(_, t) -> left_term acc vars left_bound t | TLval(TVar x, TNoOffset) -> (* check if [x] is the correct variable *) let v, vars = match vars with | [] -> error "@[too much constraint(s)%a@]" (fun _ () -> ()) () | v :: tl -> match v.lv_type with | Ctype ty when isIntegralType ty -> v, tl | Linteger -> v, tl | Ltype _ as ty when Logic_const.is_boolean_type ty -> v, tl | Ctype _ | Ltype _ | Lvar _ | Lreal | Larrow _ -> error "@[non integer variable %a@]" Printer.pp_logic_var v in if Logic_var.equal x v then acc, Some (left_bound, x), vars else error "@[invalid binder %a@]" Printer.pp_term t | _ -> error "@[invalid binder %a@]" Printer.pp_term t in let rec parse acc vars p = match p.pred_content with | Pand(p, { pred_content = Prel((Rlt | Rle) as r, t1, t2) }) -> (* && is left-associative in the AST *) let acc, partial, vars = parse acc vars p in (match partial with | None -> (* left part of a new constraint: the searched variable is [t2] *) left_term acc vars (t1, r) t2 | Some ((t_left, r_left), v) -> (* right part of an existing constraint: the variable is [t1] *) let rec right_term t = match t.term_node with | TLogic_coerce(_, t) -> right_term t | TLval(TVar x, TNoOffset) -> if Logic_var.equal x v then (* new full constraint found *) (t_left, r_left, x, r, t2) :: acc, None, vars else error "@[invalid binder %a@]" Printer.pp_term t | _ -> error "@[invalid binder %a@]" Printer.pp_term t in right_term t1) | Prel((Rlt | Rle) as r, t1, t2) -> (* left-most predicate: the searched variable is [t2] *) left_term acc vars (t1, r) t2 | _ -> error "@[invalid guard %a@]" Printer.pp_predicate p in let acc, partial, vars = parse [] bounded_vars hyps in (match partial with | None -> () | Some(_, x) -> error "@[missing upper-bound for variable %a@]" Printer.pp_logic_var x); (match vars with | [] -> () | _ :: _ -> let msg = Format.asprintf "@[unguarded variable%s %tin quantification@ %a@]" (if List.length vars = 1 then "" else "s") (fun fmt -> List.iter (fun v -> Format.fprintf fmt "@[%a @]" Printer.pp_logic_var v) vars) Printer.pp_predicate quantif in Error.untypable msg); List.rev acc (* It could happen that the bounds provided for a quantified [lv] are empty in the sense that [min <= lv <= max] but [min > max]. In such cases, \true (or \false depending on the quantification) should be generated instead of nested loops. [has_empty_quantif_with_false_negative] partially detects such cases: Case 1: an empty quantification was detected for sure, return true. Case 2: we don't know, return false. *) let rec has_empty_quantif_with_false_negative = function | [] -> (* case 2 *) false | (t1, rel1, _, rel2, t2) :: guards -> let iv1 = Interval.(extract_ival (infer t1)) in let iv2 = Interval.(extract_ival (infer t2)) in let lower_bound, _ = Ival.min_and_max iv1 in let _, upper_bound = Ival.min_and_max iv2 in match lower_bound, upper_bound with | Some lower_bound, Some upper_bound -> let res = match rel1, rel2 with | Rle, Rle -> lower_bound > upper_bound | Rle, Rlt | Rlt, Rle -> lower_bound >= upper_bound | Rlt, Rlt -> lower_bound >= Z.sub upper_bound Z.one | _ -> assert false in res (* case 1 *) || has_empty_quantif_with_false_negative guards | None, _ | _, None -> has_empty_quantif_with_false_negative guards let () = Typing.compute_quantif_guards_ref := compute_quantif_guards module Label_ids = State_builder.Counter(struct let name = "E_ACSL.Label_ids" end) let convert kf env loc is_forall p bounded_vars hyps goal = (* part depending on the kind of quantifications (either universal or existential) *) let init_val, found_val, mk_guard = let z = zero ~loc in let o = one ~loc in if is_forall then o, z, (fun x -> x) else z, o, (fun e -> new_exp ~loc:e.eloc (UnOp(LNot, e, intType))) in (* universal quantification over integers (or a subtype of integer) *) let guards = compute_quantif_guards p bounded_vars hyps in match has_empty_quantif_with_false_negative guards, is_forall with | true, true -> Cil.one ~loc, env | true, false -> Cil.zero ~loc, env | false, _ -> begin (* transform [guards] into [lscope_var list], and update logic scope in the process *) let lvs_guards, env = List.fold_right (fun (t1, rel1, lv, rel2, t2) (lvs_guards, env) -> let lvs = Lscope.Lvs_quantif(t1, rel1, lv, rel2, t2) in let env = Env.Logic_scope.extend env lvs in lvs :: lvs_guards, env) guards ([], env) in let var_res, res, env = (* variable storing the result of the quantifier *) let name = if is_forall then "forall" else "exists" in Env.new_var ~loc ~name env None intType (fun v _ -> let lv = var v in [ mkStmtOneInstr ~valid_sid:true (Set(lv, init_val, loc)) ]) in let end_loop_ref = ref dummyStmt in (* innermost block *) let mk_innermost_block env = (* innermost loop body: store the result in [res] and go out according to evaluation of the goal *) let named_predicate_to_exp = !predicate_to_exp_ref in let test, env = named_predicate_to_exp kf (Env.push env) goal in let then_block = mkBlock [ mkEmptyStmt ~loc () ] in let else_block = (* use a 'goto', not a simple 'break' in order to handle 'forall' with multiple binders (leading to imbricated loops) *) mkBlock [ mkStmtOneInstr ~valid_sid:true (Set(var var_res, found_val, loc)); mkStmt ~valid_sid:true (Goto(end_loop_ref, loc)) ] in let blk, env = Env.pop_and_get env (mkStmt ~valid_sid:true (If(mk_guard test, then_block, else_block, loc))) ~global_clear:false Env.After in let blk = Cil.flatten_transient_sub_blocks blk in [ mkStmt ~valid_sid:true (Block blk) ], env in let stmts, env = Loops.mk_nested_loops ~loc mk_innermost_block kf env lvs_guards in let env = Env.add_stmt env (mkStmt ~valid_sid:true (Block (mkBlock stmts))) in (* where to jump to go out of the loop *) let end_loop = mkEmptyStmt ~loc () in let label_name = "e_acsl_end_loop" ^ string_of_int (Label_ids.next ()) in let label = Label(label_name, loc, false) in end_loop.labels <- label :: end_loop.labels; end_loop_ref := end_loop; let env = Env.add_stmt env end_loop in res, env end let quantif_to_exp kf env p = let loc = p.pred_loc in match p.pred_content with | Pforall(bounded_vars, { pred_content = Pimplies(hyps, goal) }) -> convert kf env loc true p bounded_vars hyps goal | Pforall _ -> Error.not_yet "unguarded \\forall quantification" | Pexists(bounded_vars, { pred_content = Pand(hyps, goal) }) -> convert kf env loc false p bounded_vars hyps goal | Pexists _ -> Error.not_yet "unguarded \\exists quantification" | _ -> assert false (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/quantif.mli0000666000000000000000000000410613571573400022551 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Convert quantifiers. *) open Cil_types val quantif_to_exp: kernel_function -> Env.t -> predicate -> exp * Env.t (** The given predicate must be a quantification. *) (* ***********************************************************************) (** {2 Forward references} *) (* ***********************************************************************) val predicate_to_exp_ref: (kernel_function -> Env.t -> predicate -> exp * Env.t) ref (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/rational.ml0000666000000000000000000002044013571573400022541 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* No init_set for GMPQ: init then set separately *) let init_set ~loc lval vi_e e = Cil.mkStmt ~valid_sid:true (Block (Cil.mkBlock [ Gmp.init ~loc vi_e ; Gmp.affect ~loc lval vi_e e ])) let create ~loc ?name e env t_opt = let ty = Cil.typeOf e in if Gmp_types.Z.is_t ty then (* GMPQ has no builtin for creating Q from Z. Hence: 1) Get the MPZ as a string: gmZ_get_str 2) Set the MPQ with that string: gmpQ_set_str *) Error.not_yet "reals: creating Q from Z" else if Gmp_types.Q.is_t ty then e, env else let _, e, env = Env.new_var ~loc ?name env t_opt (Gmp_types.Q.t ()) (fun vi vi_e -> [ Gmp.init ~loc vi_e ; Gmp.affect ~loc (Cil.var vi) vi_e e ]) in e, env exception Not_a_decimal of string exception Is_a_float (* The possible float suffixes (ISO C 6.4.4.2) are lLfF. dD is a GNU extension accepted by Frama-C (only!) in the logic *) let float_suffixes = [ 'f'; 'F'; 'l'; 'L'; 'd'; 'D' ] (* Computes the fractional representation of a decimal number. Does NOT perform reduction. Example: [dec_to_frac "43.567"] evaluates to ["43567/1000"] Complexity: Linear Original Author: Frédéric Recoules It iterates **once** over [str] during which three cases are distinguished, example for "43.567": Case1: pre: no '.' has been found yet ==> copy current char into buf buf: | 4 | | | | | | | | | | | | | 4 | 3 | | | | | | | | | | | Case2: mid: current char is '.' ==> put "/1" into buf at [(length str) - 1] buf: | 4 | 3 | | | | / | 1 | | | | | | Case3: post: a '.' was found ==> put current char in numerator AND '0' in den buf: | 4 | 3 | 5 | | | / | 1 | 0 | | | | | | 4 | 3 | 5 | 6 | | / | 1 | 0 | 0 | | | | | 4 | 3 | 5 | 6 | 7 | / | 1 | 0 | 0 | 0 | | | *) let decimal_to_fractional str = let rec post str len buf len' i = if i = len then Bytes.sub_string buf 0 len' else match String.unsafe_get str i with | c when '0' <= c && c <= '9' -> Bytes.unsafe_set buf (i - 1) c; Bytes.unsafe_set buf len' '0'; post str len buf (len' + 1) (i + 1) | c when List.mem c float_suffixes -> (* [JS] a suffix denoting a C type is possible *) assert (i = len - 1); raise Is_a_float | _ -> raise (Not_a_decimal str) in let mid buf len = Bytes.unsafe_set buf (len - 1) '/'; Bytes.unsafe_set buf len '1' in let rec pre str len buf i = if i = len then str else match String.unsafe_get str i with | '.' -> mid buf len; post str len buf (len + 1) (i + 1) | c when '0' <= c && c <= '9' -> Bytes.unsafe_set buf i c; pre str len buf (i + 1) | c when List.mem c float_suffixes -> (* [JS] a suffix denoting a C type is possible *) assert (i = len - 1); raise Is_a_float | _ -> raise (Not_a_decimal str) in let strlen = String.length str in let buflen = (* The fractional representation is at most twice as lengthy as the decimal one. *) 2 * strlen in try pre str strlen (Bytes.create buflen) 0 with Is_a_float -> str (* just left it unchanged *) (* ACSL considers strings written in decimal expansion to be reals. Yet GMPQ considers them to be double: they MUST be converted into fractional representation. *) let normalize_str str = try decimal_to_fractional str with Invalid_argument _ -> Error.not_yet "number not written in decimal expansion" let cast_to_z ~loc:_ ?name:_ e _env = assert (Gmp_types.Q.is_t (Cil.typeOf e)); Error.not_yet "reals: cast from R to Z" let add_cast ~loc ?name e env ty = (* TODO: The best solution would actually be to directly write all the needed functions as C builtins then just call them here depending on the situation at hand. *) assert (Gmp_types.Q.is_t (Cil.typeOf e)); let get_double e env = let _, e, env = Env.new_var ~loc ?name env None Cil.doubleType (fun v _ -> [ Misc.mk_call ~loc ~result:(Cil.var v) "__gmpq_get_d" [ e ] ]) in e, env in match Cil.unrollType ty with | TFloat(FLongDouble, _) -> (* The biggest floating-point type we can extract from GMPQ is double *) Error.not_yet "R to long double" | TFloat(FDouble, _) -> get_double e env | TFloat(FFloat, _) -> (* No "get_float" in GMPQ, but fortunately, [float] \subset [double]. HOWEVER: going through double as intermediate step might be unsound since it could cause double rounding. See: [Boldo2013, Sec 2.2] https://hal.inria.fr/hal-00777639/document *) let e, env = get_double e env in Options.warning ~once:true "R to float: double rounding might cause unsoundness"; Cil.mkCastT ~force:false ~e ~oldt:Cil.doubleType ~newt:ty, env | TInt(IULongLong, _) -> (* The biggest C integer type we can extract from GMP is ulong *) Error.not_yet "R to unsigned long long" | TInt _ -> (* 1) Cast R to Z using cast_to_z 2) Extract ulong from Z 3) Potentially cast ulong to ty *) Error.not_yet "R to Int" | _ -> Error.not_yet "R to " let cmp ~loc bop e1 e2 env t_opt = let fname = "__gmpq_cmp" in let name = Misc.name_of_binop bop in let e1, env = create ~loc e1 env None (* TODO: t1_opt could be provided *) in let e2, env = create ~loc e2 env None (* TODO: t2_opt could be provided *) in let _, e, env = Env.new_var ~loc env t_opt ~name Cil.intType (fun v _ -> [ Misc.mk_call ~loc ~result:(Cil.var v) fname [ e1; e2 ] ]) in Cil.new_exp ~loc (BinOp(bop, e, Cil.zero ~loc, Cil.intType)), env let new_var_and_init ~loc ?scope ?name env t_opt mk_stmts = Env.new_var ~loc ?scope ?name env t_opt (Gmp_types.Q.t ()) (fun v e -> Gmp.init ~loc e :: mk_stmts v e) let name_arith_bop = function | PlusA -> "__gmpq_add" | MinusA -> "__gmpq_sub" | Mult -> "__gmpq_mul" | Div -> "__gmpq_div" | Mod | Lt | Gt | Le | Ge | Eq | Ne | BAnd | BXor | BOr | LAnd | LOr | Shiftlt | Shiftrt | PlusPI | IndexPI | MinusPI | MinusPP -> assert false let binop ~loc bop e1 e2 env t_opt = let name = name_arith_bop bop in let e1, env = create ~loc e1 env None (* TODO: t1_opt could be provided *) in let e2, env = create ~loc e2 env None (* TODO: t2_opt could be provided *) in let mk_stmts _ e = [ Misc.mk_call ~loc name [ e; e1; e2 ] ] in let name = Misc.name_of_binop bop in let _, e, env = new_var_and_init ~loc ~name env t_opt mk_stmts in e, env (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/rational.mli0000666000000000000000000000622713571573400022721 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Generation of rational numbers. *) open Cil_types val create: loc:location -> ?name:string -> exp -> Env.t -> term option -> exp * Env.t (** Create a real *) val init_set: loc:location -> lval -> exp -> exp -> stmt (** [init_set lval lval_as_exp exp] sets [lval] to [exp] while guranteeing that [lval] is properly initialized wrt the underlying real library. *) val normalize_str: string -> string (** Normalize the string so that it fits the representation used by the underlying real library. For example, "0.1" is a real number in ACSL whereas it is considered as a double by `libgmp` because it is written in decimal expansion. In order to make `libgmp` consider it to be a rational, it must be converted into "1/10". *) val cast_to_z: loc:location -> ?name:string -> exp -> Env.t -> exp * Env.t (** Assumes that the given exp is of real type and casts it into Z *) val add_cast: loc:location -> ?name:string -> exp -> Env.t -> typ -> exp * Env.t (** Assumes that the given exp is of real type and casts it into the given typ *) val binop: loc:location -> binop -> exp -> exp -> Env.t -> term option -> exp * Env.t (** Applies [binop] to the given expressions. The optional term indicates whether the comparison has a correspondance in the logic. *) val cmp: loc:location -> binop -> exp -> exp -> Env.t -> term option -> exp * Env.t (** Compares two expressions according to the given [binop]. The optional term indicates whether the comparison has a correspondance in the logic. *) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/temporal.ml0000666000000000000000000005255213571573400022564 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Detailed description of transformations implemented in this file is presented in Sections 2 and 3 of the RV'17 paper "Runtime Detection of Temporal Memory Errors" by K. Vorobyov, N. Kosmatov, J Signoles and A. Jakobsson. *) module RTL = Functions.RTL module Libc = Functions.Libc open Cil_types open Cil_datatype let generate = ref false let enable param = generate := param let is_enabled () = !generate (* ************************************************************************** *) (* Types {{{ *) (* ************************************************************************** *) (* Type of identifier tracked by a LHS referent number *) type flow = | Direct (* take origin number of RHS *) | Indirect (* take referent number of RHS *) | Copy (* Copy shadow from RHS to LHS *) (* }}} *) (* ************************************************************************** *) (* Miscellaneous {{{ *) (* ************************************************************************** *) (* Shortcuts for SA in Mmodel_analysis *) let must_model_exp exp env = let kf, bhv = Extlib.the (Env.current_kf env), Env.get_behavior env in Mmodel_analysis.must_model_exp ~bhv ~kf exp let must_model_lval lv env = let kf, bhv = Extlib.the (Env.current_kf env), Env.get_behavior env in Mmodel_analysis.must_model_lval ~bhv ~kf lv let must_model_vi vi env = let kf, bhv = Extlib.the (Env.current_kf env), Env.get_behavior env in Mmodel_analysis.must_model_vi ~bhv ~kf vi (* }}} *) (* ************************************************************************* *) (* Generate analysis function calls {{{ *) (* ************************************************************************** *) module Mk: sig (* Generate either - [store_nblock(lhs, rhs)], or - [store_nreferent(lhs, rhs)] function call based on the value of [flow] *) val store_reference: loc:location -> flow -> lval -> exp -> stmt (* Generate a [save_*_parameter] call *) val save_param: loc:location -> flow -> exp -> int -> stmt (* Generate [pull_parameter] call *) val pull_param: loc:location -> varinfo -> int -> stmt (* Generate [(save|pull)_return(lhs, param_no)] call *) val handle_return_referent: save:bool -> loc:location -> exp -> stmt (* Generate [reset_return()] call *) val reset_return_referent: loc:location -> stmt (* Generate [memcpy(lhs, rhs, size)] function call assuming that [lhs = rhs] represents an assignment of struct to a struct, that is, both sides are left values and we need to use addressof for both sides *) val temporal_memcpy_struct: loc:location -> lval -> exp -> stmt end = struct let store_reference ~loc flow lhs rhs = let fname = match flow with | Direct -> "store_nblock" | Indirect -> "store_nreferent" | Copy -> Options.fatal "Copy flow type in store_reference" in let fname = RTL.mk_temporal_name fname in Misc.mk_call ~loc fname [ Cil.mkAddrOf ~loc lhs; rhs ] let save_param ~loc flow lhs pos = let infix = match flow with | Direct -> "nblock" | Indirect -> "nreferent" | Copy -> "copy" in let fname = "save_" ^ infix ^ "_parameter" in let fname = RTL.mk_temporal_name fname in Misc.mk_call ~loc fname [ lhs ; Cil.integer ~loc pos ] let pull_param ~loc vi pos = let exp = Cil.mkAddrOfVi vi in let fname = RTL.mk_temporal_name "pull_parameter" in let sz = Cil.kinteger ~loc IULong (Cil.bytesSizeOf vi.vtype) in Misc.mk_call ~loc fname [ exp ; Cil.integer ~loc pos ; sz ] let handle_return_referent ~save ~loc lhs = let fname = match save with | true -> "save_return" | false -> "pull_return" in (* TODO: Returning structs is unsupported so far *) (match (Cil.typeOf lhs) with | TPtr _ -> () | _ -> Error.not_yet "Struct in return"); Misc.mk_call ~loc (RTL.mk_temporal_name fname) [ lhs ] let reset_return_referent ~loc = Misc.mk_call ~loc (RTL.mk_temporal_name "reset_return") [] let temporal_memcpy_struct ~loc lhs rhs = let fname = RTL.mk_temporal_name "memcpy" in let size = Cil.sizeOf ~loc (Cil.typeOfLval lhs) in Misc.mk_call ~loc fname [ Cil.mkAddrOf ~loc lhs; rhs; size ] end (* }}} *) (* ************************************************************************** *) (* Handle assignments {{{ *) (* ************************************************************************** *) (* Given an lvalue [lhs] representing LHS of an assignment, and an expression [rhs] representing its RHS compute triple (l,r,f), such that: - lval [l] and exp [r] are addresses of a pointer and a memory block, and - flow [f] indicates how to update the meta-data of [l] using information stored by [r]. The values of [f] indicate the following + Direct - referent number of [l] is assigned the referent number of [r] + Indirect - referent number of [l] is assigned the origin number of [r] + Copy - metadata of [r] is copied to metadata of [l] *) let assign ?(ltype) lhs rhs loc = (* Do not use [Extlib.opt_conv] here, application of the [None] part should not be evaluated at this point, as otherwise it will lead to an exception via [Cil.typeOfLval] later *) let ltype = match ltype with | Some l -> l | None -> (Cil.typeOfLval lhs) in match Cil.unrollType ltype with | TPtr _ -> let base, _ = Misc.ptr_index rhs in let rhs, flow = (match base.enode with | AddrOf _ | StartOf _ -> rhs, Direct (* Unary operator describes !, ~ or -: treat it same as Const since it implies integer or logical operations. This case is rare but happens: for instance in Gap SPEC CPU benchmark the returned pointer is assigned -1 (for whatever bizarre reason) *) | Const _ | UnOp _ -> base, Direct (* Special case for literal strings which E-ACSL rewrites into global variables: take the origin number of a string *) | Lval(Var vi, _) when RTL.is_generated_name vi.vname -> base, Direct (* Lvalue of a pointer type can be a cast of an integral type, for instance for the case when address is taken by value (shown via the following example). uintptr_t addr = ...; char *p = (char* )addr; If this is the case then the analysis takes the value of a variable. *) | Lval lv -> if Cil.isPointerType (Cil.unrollType (Cil.typeOfLval lv)) then Cil.mkAddrOf ~loc lv, Indirect else rhs, Direct (* Binary operation which yields an integer (or FP) type. Since LHS is of pointer type we assume that the whole integer expression computes to an address for which there is no outer container, so the only thing to do is to take origin number *) | BinOp(op, _, _, _) -> (* At this point [ptr_index] should have split pointer arithmetic into base pointer and index so there should be no pointer arithmetic operations there. The following bit is to make sure of it. *) (match op with | MinusPI | PlusPI | IndexPI -> assert false | _ -> ()); base, Direct | _ -> assert false) in Some (lhs, rhs, flow) | TNamed _ -> assert false | TInt _ | TFloat _ | TEnum _ -> None | TComp _ -> let rhs = match rhs.enode with | AddrOf _ -> rhs | Lval lv -> Cil.mkAddrOf ~loc lv | Const _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ | UnOp _ | BinOp _ | CastE _ | StartOf _ | Info _ -> Options.abort "unsupported RHS %a" Printer.pp_exp rhs in Some (lhs, rhs, Copy) (* va_list is a builtin type, we assume it has no pointers here and treat it as a "big" integer rather than a struct *) | TBuiltin_va_list _ -> None | TArray _ -> Some (lhs, rhs, Direct) (* void type should not happen as we are dealing with assignments *) | TVoid _ -> Options.fatal "Void type in assignment" | TFun _ -> Options.fatal "TFun type in assignment" (* Generate a statement tracking temporal metadata associated with assignment [lhs] = [rhs], where lhs is a left value and [rhs] is an expression. *) let mk_stmt_from_assign loc lhs rhs = let fn (lhs, rhs, flow) = match flow with | Direct | Indirect -> Mk.store_reference ~loc flow lhs rhs | Copy -> Mk.temporal_memcpy_struct ~loc lhs rhs in Extlib.opt_map fn (assign lhs rhs loc) (* }}} *) (* ************************************************************************** *) (* Handle Set instructions {{{ *) (* ************************************************************************** *) (* Top-level handler for Set instructions *) let set_instr ?(post=false) current_stmt loc lhs rhs env = if must_model_lval lhs env then Extlib.may_map (fun stmt -> Env.add_stmt ~before:current_stmt ~post env stmt) ~dft:env (mk_stmt_from_assign loc lhs rhs) else env (* }}} *) (* ************************************************************************** *) (* Handle Call instructions {{{ *) (* ************************************************************************** *) module Function_call: sig (* Top-level handler for Call instructions *) val instr: stmt -> lval option -> exp -> exp list -> location -> Env.t -> Env.t end = struct (* Track function arguments: export referents of arguments to a global structure so they can be retrieved once that function is called *) let save_params current_stmt loc args env = let (env, _) = List.fold_left (fun (env, index) param -> let lv = Mem(param), NoOffset in let ltype = Cil.typeOf param in let vals = assign ~ltype lv param loc in Extlib.may_map (fun (_, rhs, flow) -> let env = if must_model_exp param env then let stmt = Mk.save_param ~loc flow rhs index in Env.add_stmt ~before:current_stmt ~post:false env stmt else env in (env, index+1)) ~dft:(env, index+1) vals) (env, 0) args in env (* Update local environment with a statement tracking temporal metadata associated with assignment [ret] = [func(args)]. *) let call_with_ret ?(alloc=false) current_stmt loc ret env = let rhs = Cil.new_exp ~loc (Lval ret) in let vals = assign ret rhs loc in (* Track referent numbers of assignments via function calls. Library functions (i.e., with no source code available) that return values are considered to be functions that allocate memory. They are considered so because they need to be handled exactly as memory allocating functions, that is, the referent of the returned pointer is assigned the origin number associated with the return value. For instance, for some [p = call();] [store_nblock( *p,..)] is appended. Note that for this we need [Direct] flow and also dereference the pointer to get its number. This is done in the following statement (where variable [alloc] indicates whether a function is a memory-allocating function or not). Alternatively, if a function does not allocate memory and its body has been instrumented, then information about referent numbers should be stored in the internal data structure and it is retrieved using [pull_return] added via a call to [Mk.handle_return_referent] *) Extlib.may_map (fun (lhs, rhs, flow) -> let flow, rhs = match flow with | Indirect when alloc -> Direct, (Misc.mk_deref ~loc rhs) | _ -> flow, rhs in let stmt = if alloc then Mk.store_reference ~loc flow lhs rhs else Mk.handle_return_referent ~save:false ~loc (Cil.mkAddrOf ~loc lhs) in Env.add_stmt ~before:current_stmt ~post:true env stmt) ~dft:env vals (* Update local environment with a statement tracking temporal metadata associated with memcpy/memset call *) let call_memxxx current_stmt loc args fexp env = if Libc.is_memcpy fexp || Libc.is_memset fexp then let name = match fexp.enode with | Lval(Var vi, _) -> vi.vname | _ -> Options.fatal "[Temporal.call_memxxx] not a left-value" in let stmt = Misc.mk_call ~loc (RTL.mk_temporal_name name) args in Env.add_stmt ~before:current_stmt ~post:false env stmt else env let instr current_stmt ret fexp args loc env = (* Add function calls to reset_parameters and reset_return before each function call regardless. They are not really required, as if the instrumentation is correct then the right parameters will be saved and the right parameter will be pulled at runtime. In practice, however, it makes sense to make this somewhat-debug-level-call. In production mode the implementation of the function should be empty and compiler should be able to optimize that code out. *) let name = (RTL.mk_temporal_name "reset_parameters") in let stmt = Misc.mk_call ~loc name [] in let env = Env.add_stmt ~before:current_stmt ~post:false env stmt in let stmt = Mk.reset_return_referent ~loc in let env = Env.add_stmt ~before:current_stmt ~post:false env stmt in (* Push parameters with either a call to a function pointer or a function definition otherwise there is no point. *) let has_def = Functions.has_fundef fexp in let env = if Cil.isFunctionType (Cil.typeOf fexp) || has_def then save_params current_stmt loc args env else env in (* Handle special cases of memcpy/memset *) let env = call_memxxx current_stmt loc args fexp env in (* Memory allocating functions have no definitions so below expression should capture them *) let alloc = not has_def in Extlib.may_map (fun lhs -> if must_model_lval lhs env then call_with_ret ~alloc current_stmt loc lhs env else env) ~dft:env ret end (* }}} *) (* ************************************************************************** *) (* Handle Local_init instructions {{{ *) (* ************************************************************************** *) module Local_init: sig (* Top-level handler for Local_init instructions *) val instr: stmt -> varinfo -> local_init -> location -> Env.t -> Env.t end = struct let rec handle_init current_stmt offset loc vi init env = match init with | SingleInit exp -> set_instr ~post:true current_stmt loc (Var vi, offset) exp env | CompoundInit(_, inits) -> List.fold_left (fun acc (off, init) -> handle_init current_stmt (Cil.addOffset off offset) loc vi init acc) env inits let instr current_stmt vi li loc env = if must_model_vi vi env then match li with | AssignInit init -> handle_init current_stmt NoOffset loc vi init env | ConsInit(fexp, args, _) -> let ret = Some (Cil.var vi) in let fexp = Cil.evar ~loc fexp in Function_call.instr current_stmt ret fexp args loc env else env end (* }}} *) (* ************************************************************************** *) (* Track function arguments {{{ *) (* ************************************************************************** *) (* Update local environment with a statement tracking temporal metadata associated with adding a function argument to a stack frame *) let track_argument ?(typ) param index env = let typ = Extlib.opt_conv param.vtype typ in match Cil.unrollType typ with | TPtr _ | TComp _ -> let stmt = Mk.pull_param ~loc:Location.unknown param index in Env.add_stmt ~post:false env stmt | TInt _ | TFloat _ | TEnum _ | TBuiltin_va_list _ -> env | TNamed _ -> assert false | TVoid _ |TArray _ | TFun _ -> Options.fatal "Failed to handle function parameter" (* }}} *) (* ************************************************************************** *) (* Handle return statements {{{ *) (* ************************************************************************** *) (* Update local environment [env] with statements tracking return value of a function. *) let handle_return_stmt loc ret env = match ret.enode with | Lval lv -> if Cil.isPointerType (Cil.typeOfLval lv) then let exp = Cil.mkAddrOf ~loc lv in let stmt = Mk.handle_return_referent ~loc ~save:true exp in Env.add_stmt ~post:false env stmt else env | _ -> Options.fatal "Something other than Lval in return" let handle_return_stmt loc ret env = if must_model_exp ret env then handle_return_stmt loc ret env else env (* }}} *) (* ************************************************************************** *) (* Handle instructions {{{ *) (* ************************************************************************** *) (* Update local environment [env] with statements tracking instruction [instr] *) let handle_instruction current_stmt instr env = match instr with | Set(lv, exp, loc) -> set_instr current_stmt loc lv exp env | Call(ret, fexp, args, loc) -> Function_call.instr current_stmt ret fexp args loc env | Local_init(vi, li, loc) -> Local_init.instr current_stmt vi li loc env | Asm _ -> Options.warning ~once:true ~current:true "@[Analysis is\ potentially incorrect in presence of assembly code.@]"; env | Skip _ | Code_annot _ -> env (* }}} *) (* ************************************************************************** *) (* Initialization of globals {{{ *) (* ************************************************************************** *) (* Provided that [vi] is a global variable initialized by the initializer [init] at offset [off] return [Some stmt], where [stmt] is a statement tracking that initialization. If [init] does not need to be tracked than the return value is [None] *) let mk_global_init ~loc vi off init env = let exp = match init with | SingleInit e -> e (* Compound initializers should have been thrown away at this point *) | _ -> Options.fatal "Unexpected ComppoundInit in global initializer" in (* Initializer expression can be a literal string, so look up the corresponding variable which that literal string has been converted to *) let exp = try let rec get_string e = match e.enode with | Const(CStr str) -> str | CastE(_, exp) -> get_string exp | _ -> raise Not_found in let str = get_string exp in Cil.evar ~loc (Literal_strings.find str) with (* Not a literal string: just use the expression at hand *) Not_found -> exp in (* The input [vi] is from the old project, so get the corresponding variable from the new one, otherwise AST integrity is violated *) let vi = Visitor_behavior.Get.varinfo (Env.get_behavior env) vi in let lv = Var vi, off in mk_stmt_from_assign loc lv exp (* }}} *) (* ************************************************************************** *) (* Public API {{{ *) (* ************************************************************************** *) let handle_function_parameters kf env = if is_enabled () then let env, _ = List.fold_left (fun (env, index) param -> let param = Visitor_behavior.Get.varinfo (Env.get_behavior env) param in let env = if Mmodel_analysis.must_model_vi ~kf param then track_argument param index env else env in env, index + 1) (env, 0) (Kernel_function.get_formals kf) in env else env let handle_stmt stmt env = if is_enabled () then begin match stmt.skind with | Instr instr -> handle_instruction stmt instr env | Return(ret, loc) -> Extlib.may_map (fun ret -> handle_return_stmt loc ret env) ~dft:env ret | Goto _ | Break _ | Continue _ | If _ | Switch _ | Loop _ | Block _ | UnspecifiedSequence _ | Throw _ | TryCatch _ | TryFinally _ | TryExcept _ -> env end else env let generate_global_init vi off init env = if is_enabled () then mk_global_init ~loc:vi.vdecl vi off init env else None (* }}} *) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/temporal.mli0000666000000000000000000000512613571573400022730 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Transformations to detect temporal memory errors (e.g., dereference of stale pointers). *) val enable: bool -> unit (** Enable/disable temporal transformations *) val is_enabled: unit -> bool (** Return a boolean value indicating whether temporal analysis is enabled *) val handle_function_parameters: Cil_types.kernel_function -> Env.t -> Env.t (** [handle_function_parameters kf env] updates the local environment [env], according to the parameters of [kf], with statements allowing to track referent numbers across function calls. *) val handle_stmt: Cil_types.stmt -> Env.t -> Env.t (** Update local environment ([Env.t]) with statements tracking temporal properties of memory blocks *) val generate_global_init: Cil_types.varinfo -> Cil_types.offset -> Cil_types.init -> Env.t -> Cil_types.stmt option (** Generate [Some s], where [s] is a statement tracking global initializer or [None] if there is no need to track it *) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/translate.ml0000666000000000000000000012061613571573400022733 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module E_acsl_label = Label open Cil_types open Cil_datatype let dkey = Options.dkey_translation let not_yet env s = Env.Context.save env; Error.not_yet s let handle_error f env = let env = Error.handle f env in Env.Context.restore env (* internal to [named_predicate_to_exp] but put it outside in order to not add extra tedious parameter. It is [true] iff we are currently visiting \valid. *) let is_visiting_valid = ref false (* ************************************************************************** *) (* Transforming terms and predicates into C expressions (if any) *) (* ************************************************************************** *) let relation_to_binop = function | Rlt -> Lt | Rgt -> Gt | Rle -> Le | Rge -> Ge | Req -> Eq | Rneq -> Ne let name_of_mpz_arith_bop = function | PlusA -> "__gmpz_add" | MinusA -> "__gmpz_sub" | Mult -> "__gmpz_mul" | Div -> "__gmpz_tdiv_q" | Mod -> "__gmpz_tdiv_r" | Lt | Gt | Le | Ge | Eq | Ne | BAnd | BXor | BOr | LAnd | LOr | Shiftlt | Shiftrt | PlusPI | IndexPI | MinusPI | MinusPP -> assert false (* Type of a string that represents a number. Used when a string is required to encode a constant number because it is not representable in any C type *) type strnum = | Str_Z (* integers *) | Str_R (* reals *) | C_number (* integers and floats included *) (* convert [e] in a way that it is compatible with the given typing context. *) let add_cast ~loc ?name env ctx strnum t_opt e = let mk_mpz e = let _, e, env = Env.new_var ~loc ?name env t_opt (Gmp_types.Z.t ()) (fun lv v -> [ Gmp.init_set ~loc (Cil.var lv) v e ]) in e, env in let e, env = match strnum with | Str_Z -> mk_mpz e | Str_R -> Rational.create ~loc ?name e env t_opt | C_number -> e, env in match ctx with | None -> e, env | Some ctx -> let ty = Cil.typeOf e in match Gmp_types.Z.is_t ty, Gmp_types.Z.is_t ctx with | true, true -> (* Z --> Z *) e, env | false, true -> if Gmp_types.Q.is_t ty then (* R --> Z *) Rational.cast_to_z ~loc ?name e env else (* C integer --> Z *) let e = if not (Cil.isIntegralType ty) && strnum = C_number then (* special case for \null that must be casted to long: it is the only non integral value that can be seen as an integer, while the type system infers that it is C-representable (see tests/runtime/null.i) *) Cil.mkCast e Cil.longType (* \null *) else e in mk_mpz e | _, false -> if Gmp_types.Q.is_t ctx then if Gmp_types.Q.is_t (Cil.typeOf e) then (* R --> R *) e, env else (* C integer or Z --> R *) Rational.create ~loc ?name e env t_opt else if Gmp_types.Z.is_t ty || strnum = Str_Z then (* Z --> C type or the integer is represented by a string: anyway, it fits into a C integer: convert it *) let fname, new_ty = if Cil.isSignedInteger ctx then "__gmpz_get_si", Cil.longType else "__gmpz_get_ui", Cil.ulongType in let _, e, env = Env.new_var ~loc ?name env None new_ty (fun v _ -> [ Misc.mk_call ~loc ~result:(Cil.var v) fname [ e ] ]) in e, env else if Gmp_types.Q.is_t ty || strnum = Str_R then (* R --> C type or the real is represented by a string *) Rational.add_cast ~loc ?name e env ctx else (* C type --> another C type *) Cil.mkCastT ~force:false ~e ~oldt:ty ~newt:ctx, env let constant_to_exp ~loc t c = let mk_real s = let s = Rational.normalize_str s in Cil.mkString ~loc s, Str_R in match c with | Integer(n, _repr) -> let ity = Typing.get_number_ty t in (match ity with | Typing.Nan -> assert false | Typing.Real -> Error.not_yet "real number constant" | Typing.Rational -> mk_real (Integer.to_string n) | Typing.Gmpz -> (* too large integer *) Cil.mkString ~loc (Integer.to_string n), Str_Z | Typing.C_float fkind -> Cil.kfloat ~loc fkind (Int64.to_float (Integer.to_int64 n)), C_number | Typing.C_integer kind -> let cast = Typing.get_cast t in match cast, kind with | Some ty, (ILongLong | IULongLong) when Gmp_types.Z.is_t ty -> (* too large integer *) Cil.mkString ~loc (Integer.to_string n), Str_Z | Some ty, _ when Gmp_types.Q.is_t ty -> mk_real (Integer.to_string n) | (None | Some _), _ -> (* do not keep the initial string representation because the generated constant must reflect its type computed by the type system. For instance, when translating [INT_MAX+1], we must generate a [long long] addition and so [1LL]. If we keep the initial string representation, the kind would be ignored in the generated code and so [1] would be generated. *) Cil.kinteger64 ~loc ~kind n, C_number) | LStr s -> Cil.new_exp ~loc (Const (CStr s)), C_number | LWStr s -> Cil.new_exp ~loc (Const (CWStr s)), C_number | LChr c -> Cil.new_exp ~loc (Const (CChr c)), C_number | LReal lr -> if lr.r_lower = lr.r_upper then Cil.kfloat ~loc FDouble lr.r_nearest, C_number else mk_real lr.r_literal | LEnum e -> Cil.new_exp ~loc (Const (CEnum e)), C_number let conditional_to_exp ?(name="if") loc t_opt e1 (e2, env2) (e3, env3) = let env = Env.pop (Env.pop env3) in match e1.enode with | Const(CInt64(n, _, _)) when Integer.is_zero n -> e3, Env.transfer ~from:env3 env | Const(CInt64(n, _, _)) when Integer.is_one n -> e2, Env.transfer ~from:env2 env | _ -> let ty = match t_opt with | None (* predicate *) -> Cil.intType | Some t -> Typing.get_typ t in let _, e, env = Env.new_var ~loc ~name env t_opt ty (fun v ev -> let lv = Cil.var v in let ty = Cil.typeOf ev in let init_set = assert (not (Gmp_types.Q.is_t ty)); Gmp.init_set in let affect e = init_set ~loc lv ev e in let then_block, _ = let s = affect e2 in Env.pop_and_get env2 s ~global_clear:false Env.Middle in let else_block, _ = let s = affect e3 in Env.pop_and_get env3 s ~global_clear:false Env.Middle in [ Cil.mkStmt ~valid_sid:true (If(e1, then_block, else_block, loc)) ]) in e, env let rec thost_to_host kf env th = match th with | TVar { lv_origin = Some v } -> let v' = Visitor_behavior.Get.varinfo (Env.get_behavior env) v in Var v', env, v.vname | TVar ({ lv_origin = None } as logic_v) -> let v' = Env.Logic_binding.get env logic_v in Var v', env, logic_v.lv_name | TResult _typ -> let vis = Env.get_visitor env in let kf = Extlib.the vis#current_kf in let lhost = Misc.result_lhost kf in (match lhost with | Var v -> let v' = Visitor_behavior.Get.varinfo (Env.get_behavior env) v in Var v', env, "result" | _ -> assert false) | TMem t -> let e, env = term_to_exp kf env t in Mem e, env, "" and toffset_to_offset ?loc kf env = function | TNoOffset -> NoOffset, env | TField(f, offset) -> let offset, env = toffset_to_offset ?loc kf env offset in Field(f, offset), env | TIndex(t, offset) -> let e, env = term_to_exp kf env t in let offset, env = toffset_to_offset kf env offset in Index(e, offset), env | TModel _ -> not_yet env "model" and tlval_to_lval kf env (host, offset) = let host, env, name = thost_to_host kf env host in let offset, env = toffset_to_offset kf env offset in let name = match offset with NoOffset -> name | Field _ | Index _ -> "" in (host, offset), env, name (* the returned boolean says that the expression is an mpz_string; the returned string is the name of the generated variable corresponding to the term. *) and context_insensitive_term_to_exp kf env t = let loc = t.term_loc in match t.term_node with | TConst c -> let c, strnum = constant_to_exp ~loc t c in c, env, strnum, "" | TLval lv -> let lv, env, name = tlval_to_lval kf env lv in Cil.new_exp ~loc (Lval lv), env, C_number, name | TSizeOf ty -> Cil.sizeOf ~loc ty, env, C_number, "sizeof" | TSizeOfE t -> let e, env = term_to_exp kf env t in Cil.sizeOf ~loc (Cil.typeOf e), env, C_number, "sizeof" | TSizeOfStr s -> Cil.new_exp ~loc (SizeOfStr s), env, C_number, "sizeofstr" | TAlignOf ty -> Cil.new_exp ~loc (AlignOf ty), env, C_number, "alignof" | TAlignOfE t -> let e, env = term_to_exp kf env t in Cil.new_exp ~loc (AlignOfE e), env, C_number, "alignof" | TUnOp(Neg | BNot as op, t') -> let ty = Typing.get_typ t in let e, env = term_to_exp kf env t' in if Gmp_types.Z.is_t ty then let name, vname = match op with | Neg -> "__gmpz_neg", "neg" | BNot -> "__gmpz_com", "bnot" | LNot -> assert false in let _, e, env = Env.new_var_and_mpz_init ~loc env ~name:vname (Some t) (fun _ ev -> [ Misc.mk_call ~loc name [ ev; e ] ]) in e, env, C_number, "" else if Gmp_types.Q.is_t ty then not_yet env "reals: Neg | BNot" else Cil.new_exp ~loc (UnOp(op, e, ty)), env, C_number, "" | TUnOp(LNot, t) -> let ty = Typing.get_op t in if Gmp_types.Z.is_t ty then (* [!t] is converted into [t == 0] *) let zero = Logic_const.tinteger 0 in let ctx = Typing.get_number_ty t in Typing.type_term ~use_gmp_opt:true ~ctx zero; let e, env = comparison_to_exp kf ~loc ~name:"not" env Typing.gmpz Eq t zero (Some t) in e, env, C_number, "" else begin assert (Cil.isIntegralType ty); let e, env = term_to_exp kf env t in Cil.new_exp ~loc (UnOp(LNot, e, Cil.intType)), env, C_number, "" end | TBinOp(PlusA | MinusA | Mult as bop, t1, t2) -> let ty = Typing.get_typ t in let e1, env = term_to_exp kf env t1 in let e2, env = term_to_exp kf env t2 in if Gmp_types.Z.is_t ty then let name = name_of_mpz_arith_bop bop in let mk_stmts _ e = [ Misc.mk_call ~loc name [ e; e1; e2 ] ] in let name = Misc.name_of_binop bop in let _, e, env = Env.new_var_and_mpz_init ~loc ~name env (Some t) mk_stmts in e, env, C_number, "" else if Gmp_types.Q.is_t ty then let e, env = Rational.binop ~loc bop e1 e2 env (Some t) in e, env, C_number, "" else begin assert (Logic_typing.is_integral_type t.term_type); Cil.new_exp ~loc (BinOp(bop, e1, e2, ty)), env, C_number, "" end | TBinOp(Div | Mod as bop, t1, t2) -> let ty = Typing.get_typ t in let e1, env = term_to_exp kf env t1 in let e2, env = term_to_exp kf env t2 in if Gmp_types.Z.is_t ty then (* TODO: preventing division by zero should not be required anymore. RTE should do this automatically. *) let ctx = Typing.get_number_ty t in let t = Some t in let name = name_of_mpz_arith_bop bop in (* [TODO] can now do better since the type system got some info about possible values of [t2] *) (* guarding divisions and modulos *) let zero = Logic_const.tinteger 0 in Typing.type_term ~use_gmp_opt:true ~ctx zero; (* do not generate [e2] from [t2] twice *) let guard, env = let name = Misc.name_of_binop bop ^ "_guard" in comparison_to_exp ~loc kf env Typing.gmpz ~e1:e2 ~name Eq t2 zero t in let mk_stmts _v e = assert (Gmp_types.Z.is_t ty); let vis = Env.get_visitor env in let kf = Extlib.the vis#current_kf in let cond = Misc.mk_e_acsl_guard (Env.annotation_kind env) kf guard (Logic_const.prel ~loc (Req, t2, zero)) in Env.add_assert env cond (Logic_const.prel (Rneq, t2, zero)); let instr = Misc.mk_call ~loc name [ e; e1; e2 ] in [ cond; instr ] in let name = Misc.name_of_binop bop in let _, e, env = Env.new_var_and_mpz_init ~loc ~name env t mk_stmts in e, env, C_number, "" else if Gmp_types.Q.is_t ty then let e, env = Rational.binop ~loc bop e1 e2 env (Some t) in e, env, C_number, "" else begin assert (Logic_typing.is_integral_type t.term_type); (* no guard required since RTEs are generated separately *) Cil.new_exp ~loc (BinOp(bop, e1, e2, ty)), env, C_number, "" end | TBinOp(Lt | Gt | Le | Ge | Eq | Ne as bop, t1, t2) -> (* comparison operators *) let ity = Typing.get_integer_op t in let e, env = comparison_to_exp ~loc kf env ity bop t1 t2 (Some t) in e, env, C_number, "" | TBinOp((Shiftlt | Shiftrt), _, _) -> (* left/right shift *) not_yet env "left/right shift" | TBinOp(LOr, t1, t2) -> (* t1 || t2 <==> if t1 then true else t2 *) let e1, env1 = term_to_exp kf (Env.rte env true) t1 in let env' = Env.push env1 in let res2 = term_to_exp kf (Env.push env') t2 in let e, env = conditional_to_exp ~name:"or" loc (Some t) e1 (Cil.one loc, env') res2 in e, env, C_number, "" | TBinOp(LAnd, t1, t2) -> (* t1 && t2 <==> if t1 then t2 else false *) let e1, env1 = term_to_exp kf (Env.rte env true) t1 in let _, env2 as res2 = term_to_exp kf (Env.push env1) t2 in let env3 = Env.push env2 in let e, env = conditional_to_exp ~name:"and" loc (Some t) e1 res2 (Cil.zero loc, env3) in e, env, C_number, "" | TBinOp((BOr | BXor | BAnd), _, _) -> (* other logic/arith operators *) not_yet env "missing binary bitwise operator" | TBinOp(PlusPI | IndexPI | MinusPI as bop, t1, t2) -> if Misc.is_set_of_ptr_or_array t1.term_type || Misc.is_set_of_ptr_or_array t2.term_type then (* case of arithmetic over set of pointers (due to use of ranges) should have already been handled in [mmodel_call_with_ranges] *) assert false; (* binary operation over pointers *) let ty = match t1.term_type with | Ctype ty -> ty | _ -> assert false in let e1, env = term_to_exp kf env t1 in let e2, env = term_to_exp kf env t2 in Cil.new_exp ~loc (BinOp(bop, e1, e2, ty)), env, C_number, "" | TBinOp(MinusPP, t1, t2) -> begin match Typing.get_number_ty t with | Typing.C_integer _ -> let e1, env = term_to_exp kf env t1 in let e2, env = term_to_exp kf env t2 in let ty = Typing.get_typ t in Cil.new_exp ~loc (BinOp(MinusPP, e1, e2, ty)), env, C_number, "" | Typing.Gmpz -> not_yet env "pointer subtraction resulting in gmp" | Typing.(C_float _ | Rational | Real | Nan) -> assert false end | TCastE(ty, t') -> let e, env = term_to_exp kf env t' in let e, env = add_cast ~loc ~name:"cast" env (Some ty) C_number (Some t) e in e, env, C_number, "" | TLogic_coerce _ -> assert false (* handle in [term_to_exp] *) | TAddrOf lv -> let lv, env, _ = tlval_to_lval kf env lv in Cil.mkAddrOf ~loc lv, env, C_number, "addrof" | TStartOf lv -> let lv, env, _ = tlval_to_lval kf env lv in Cil.mkAddrOrStartOf ~loc lv, env, C_number, "startof" | Tapp(li, [], targs) -> let fname = li.l_var_info.lv_name in (* build the varinfo (as an expression) which stores the result of the function call. *) let _, e, env = if Builtins.mem li.l_var_info.lv_name then (* E-ACSL built-in function call *) let args, env = try List.fold_right (fun targ (l, env) -> let e, env = term_to_exp kf env targ in e :: l, env) targs ([], env) with Invalid_argument _ -> Options.fatal "[Tapp] unexpected number of arguments when calling %s" fname in Env.new_var ~loc ~name:(fname ^ "_app") env (Some t) (Misc.cty (Extlib.the li.l_type)) (fun vi _ -> [ Misc.mk_call ~loc ~result:(Cil.var vi) fname args ]) else (* build the arguments and compute the integer_ty of the parameters *) let params_ty, args, env = List.fold_right (fun targ (params_ty, args, env) -> let e, env = term_to_exp kf env targ in let param_ty = Typing.get_number_ty targ in let e, env = try let ty = Typing.typ_of_number_ty param_ty in add_cast loc env (Some ty) C_number (Some targ) e with Typing.Not_a_number -> e, env in param_ty :: params_ty, e :: args, env) targs ([], [], env) in let gen_fname = Varname.get ~scope:Varname.Global (Functions.RTL.mk_gen_name fname) in Logic_functions.tapp_to_exp ~loc gen_fname env t li params_ty args in e, env, C_number, "app" | Tapp(_, _ :: _, _) -> not_yet env "logic functions with labels" | Tlambda _ -> not_yet env "functional" | TDataCons _ -> not_yet env "constructor" | Tif(t1, t2, t3) -> let e1, env1 = term_to_exp kf (Env.rte env true) t1 in let (_, env2 as res2) = term_to_exp kf (Env.push env1) t2 in let res3 = term_to_exp kf (Env.push env2) t3 in let e, env = conditional_to_exp loc (Some t) e1 res2 res3 in e, env, C_number, "" | Tat(t, BuiltinLabel Here) -> let e, env = term_to_exp kf env t in e, env, C_number, "" | Tat(t', label) -> let lscope = Env.Logic_scope.get env in let pot = Misc.PoT_term t' in if Lscope.is_used lscope pot then let e, env = At_with_lscope.to_exp ~loc kf env pot label in e, env, C_number, "" else let e, env = term_to_exp kf (Env.push env) t' in let e, env, sty = at_to_exp_no_lscope env (Some t) label e in e, env, sty, "" | Tbase_addr(BuiltinLabel Here, t) -> let name = "base_addr" in let e, env = Mmodel_translate.call ~loc kf name Cil.voidPtrType env t in e, env, C_number, name | Tbase_addr _ -> not_yet env "labeled \\base_addr" | Toffset(BuiltinLabel Here, t) -> let size_t = Cil.theMachine.Cil.typeOfSizeOf in let name = "offset" in let e, env = Mmodel_translate.call ~loc kf name size_t env t in e, env, C_number, name | Toffset _ -> not_yet env "labeled \\offset" | Tblock_length(BuiltinLabel Here, t) -> let size_t = Cil.theMachine.Cil.typeOfSizeOf in let name = "block_length" in let e, env = Mmodel_translate.call ~loc kf name size_t env t in e, env, C_number, name | Tblock_length _ -> not_yet env "labeled \\block_length" | Tnull -> Cil.mkCast (Cil.zero ~loc) (TPtr(TVoid [], [])), env, C_number, "null" | TUpdate _ -> not_yet env "functional update" | Ttypeof _ -> not_yet env "typeof" | Ttype _ -> not_yet env "C type" | Tempty_set -> not_yet env "empty tset" | Tunion _ -> not_yet env "union of tsets" | Tinter _ -> not_yet env "intersection of tsets" | Tcomprehension _ -> not_yet env "tset comprehension" | Trange _ -> not_yet env "range" | Tlet(li, t) -> let lvs = Lscope.Lvs_let(li.l_var_info, Misc.term_of_li li) in let env = Env.Logic_scope.extend env lvs in let env = env_of_li li kf env loc in let e, env = term_to_exp kf env t in Interval.Env.remove li.l_var_info; e, env, C_number, "" (* Convert an ACSL term into a corresponding C expression (if any) in the given environment. Also extend this environment in order to include the generating constructs. *) and term_to_exp kf env t = let generate_rte = Env.generate_rte env in Options.feedback ~dkey ~level:4 "translating term %a (rte? %b)" Printer.pp_term t generate_rte; let env = Env.rte env false in let t = match t.term_node with TLogic_coerce(_, t) -> t | _ -> t in let e, env, sty, name = context_insensitive_term_to_exp kf env t in let env = if generate_rte then translate_rte kf env e else env in let cast = Typing.get_cast t in let name = if name = "" then None else Some name in add_cast ~loc:t.term_loc ?name env cast sty (Some t) e (* generate the C code equivalent to [t1 bop t2]. *) and comparison_to_exp ~loc ?e1 kf env ity bop ?(name = Misc.name_of_binop bop) t1 t2 t_opt = let e1, env = match e1 with | None -> let e1, env = term_to_exp kf env t1 in e1, env | Some e1 -> e1, env in let e2, env = term_to_exp kf env t2 in match ity with | Typing.C_integer _ | Typing.C_float _ | Typing.Nan -> Cil.mkBinOp ~loc bop e1 e2, env | Typing.Gmpz -> let _, e, env = Env.new_var ~loc env t_opt ~name Cil.intType (fun v _ -> [ Misc.mk_call ~loc ~result:(Cil.var v) "__gmpz_cmp" [ e1; e2 ] ]) in Cil.new_exp ~loc (BinOp(bop, e, Cil.zero ~loc, Cil.intType)), env | Typing.Rational -> Rational.cmp ~loc bop e1 e2 env t_opt | Typing.Real -> Error.not_yet "comparison involving real numbers" and at_to_exp_no_lscope env t_opt label e = let stmt = E_acsl_label.get_stmt (Env.get_visitor env) label in (* generate a new variable denoting [\at(t',label)]. That is this variable which is the resulting expression. ACSL typing rule ensures that the type of this variable is the same as the one of [e]. *) let loc = Stmt.loc stmt in let res_v, res, new_env = Env.new_var ~loc ~name:"at" ~scope:Varname.Function env t_opt (Cil.typeOf e) (fun _ _ -> []) in let env_ref = ref new_env in (* visitor modifying in place the labeled statement in order to store [e] in the resulting variable at this location (which is the only correct one). *) let o = object inherit Visitor.frama_c_inplace method !vstmt_aux stmt = (* either a standard C affectation or a call to an initializer according to the type of [e] *) let ty = Cil.typeOf e in let init_set = if Gmp_types.Q.is_t ty then Rational.init_set else Gmp.init_set in let new_stmt = init_set ~loc (Cil.var res_v) res e in assert (!env_ref == new_env); (* generate the new block of code for the labeled statement and the corresponding environment *) let block, new_env = Env.pop_and_get new_env new_stmt ~global_clear:false Env.Middle in env_ref := Env.extend_stmt_in_place new_env stmt ~label block; Cil.ChangeTo stmt end in let bhv = Env.get_behavior new_env in let new_stmt = Visitor.visitFramacStmt o (Visitor_behavior.Get.stmt bhv stmt) in Visitor_behavior.Set.stmt bhv stmt new_stmt; res, !env_ref, C_number and env_of_li li kf env loc = let t = Misc.term_of_li li in let ty = Typing.get_typ t in let vi, vi_e, env = Env.Logic_binding.add ~ty env li.l_var_info in let e, env = term_to_exp kf env t in let stmt = match Typing.get_number_ty t with | Typing.(C_integer _ | C_float _ | Nan) -> Cil.mkStmtOneInstr (Set (Cil.var vi, e, loc)) | Typing.Gmpz -> Gmp.init_set ~loc (Cil.var vi) vi_e e | Typing.Rational -> Rational.init_set ~loc (Cil.var vi) vi_e e | Typing.Real -> Error.not_yet "real number" in Env.add_stmt env stmt (* Convert an ACSL named predicate into a corresponding C expression (if any) in the given environment. Also extend this environment which includes the generating constructs. *) and named_predicate_content_to_exp ?name kf env p = let loc = p.pred_loc in match p.pred_content with | Pfalse -> Cil.zero ~loc, env | Ptrue -> Cil.one ~loc, env | Papp(li, labels, args) -> (* Simply use the implementation of Tapp(li, labels, args). To achieve this, we create a clone of [li] for which the type is transformed from [None] (type of predicates) to [Some int] (type as a term). *) let prj = Project.current () in let o = object inherit Visitor.frama_c_copy prj end in let li = Visitor.visitFramacLogicInfo o li in let lty = Ctype Cil.intType in li.l_type <- Some lty; let tapp = Logic_const.term ~loc (Tapp(li, labels, args)) lty in Typing.type_term ~use_gmp_opt:false ~ctx:Typing.c_int tapp; let e, env = term_to_exp kf env tapp in e, env | Pseparated _ -> not_yet env "\\separated" | Pdangling _ -> not_yet env "\\dangling" | Pvalid_function _ -> not_yet env "\\valid_function" | Prel(rel, t1, t2) -> let ity = Typing.get_integer_op_of_predicate p in comparison_to_exp ~loc kf env ity (relation_to_binop rel) t1 t2 None | Pand(p1, p2) -> (* p1 && p2 <==> if p1 then p2 else false *) let e1, env1 = named_predicate_to_exp kf (Env.rte env true) p1 in let _, env2 as res2 = named_predicate_to_exp kf (Env.push env1) p2 in let env3 = Env.push env2 in let name = match name with None -> "and" | Some n -> n in conditional_to_exp ~name loc None e1 res2 (Cil.zero loc, env3) | Por(p1, p2) -> (* p1 || p2 <==> if p1 then true else p2 *) let e1, env1 = named_predicate_to_exp kf (Env.rte env true) p1 in let env' = Env.push env1 in let res2 = named_predicate_to_exp kf (Env.push env') p2 in let name = match name with None -> "or" | Some n -> n in conditional_to_exp ~name loc None e1 (Cil.one loc, env') res2 | Pxor _ -> not_yet env "xor" | Pimplies(p1, p2) -> (* (p1 ==> p2) <==> !p1 || p2 *) named_predicate_to_exp ~name:"implies" kf env (Logic_const.por ~loc ((Logic_const.pnot ~loc p1), p2)) | Piff(p1, p2) -> (* (p1 <==> p2) <==> (p1 ==> p2 && p2 ==> p1) *) named_predicate_to_exp ~name:"equiv" kf env (Logic_const.pand ~loc (Logic_const.pimplies ~loc (p1, p2), Logic_const.pimplies ~loc (p2, p1))) | Pnot p -> let e, env = named_predicate_to_exp kf env p in Cil.new_exp ~loc (UnOp(LNot, e, Cil.intType)), env | Pif(t, p2, p3) -> let e1, env1 = term_to_exp kf (Env.rte env true) t in let (_, env2 as res2) = named_predicate_to_exp kf (Env.push env1) p2 in let res3 = named_predicate_to_exp kf (Env.push env2) p3 in conditional_to_exp loc None e1 res2 res3 | Plet(li, p) -> let lvs = Lscope.Lvs_let(li.l_var_info, Misc.term_of_li li) in let env = Env.Logic_scope.extend env lvs in let env = env_of_li li kf env loc in let e, env = named_predicate_to_exp kf env p in Interval.Env.remove li.l_var_info; e, env | Pforall _ | Pexists _ -> Quantif.quantif_to_exp kf env p | Pat(p, BuiltinLabel Here) -> named_predicate_to_exp kf env p | Pat(p', label) -> let lscope = Env.Logic_scope.get env in let pot = Misc.PoT_pred p' in if Lscope.is_used lscope pot then At_with_lscope.to_exp ~loc kf env pot label else begin (* convert [t'] to [e] in a separated local env *) let e, env = named_predicate_to_exp kf (Env.push env) p' in let e, env, sty = at_to_exp_no_lscope env None label e in assert (sty = C_number); e, env end | Pvalid_read(BuiltinLabel Here as llabel, t) as pc | (Pvalid(BuiltinLabel Here as llabel, t) as pc) -> let call_valid t = let name = match pc with | Pvalid _ -> "valid" | Pvalid_read _ -> "valid_read" | _ -> assert false in Mmodel_translate.call_valid ~loc kf name Cil.intType env t in if !is_visiting_valid then begin (* we already transformed \valid(t) into \initialized(&t) && \valid(t): now convert this right-most valid. *) is_visiting_valid := false; call_valid t p end else begin match t.term_node, t.term_type with | TLval tlv, Ctype ty -> let init = Logic_const.pinitialized ~loc (llabel, Misc.term_addr_of ~loc tlv ty) in Typing.type_named_predicate ~must_clear:false init; let p = Logic_const.pand ~loc (init, p) in is_visiting_valid := true; named_predicate_to_exp kf env p | _ -> call_valid t p end | Pvalid _ -> not_yet env "labeled \\valid" | Pvalid_read _ -> not_yet env "labeled \\valid_read" | Pinitialized(BuiltinLabel Here, t) -> (match t.term_node with (* optimisation when we know that the initialisation is ok *) | TAddrOf (TResult _, TNoOffset) -> Cil.one ~loc, env | TAddrOf (TVar { lv_origin = Some vi }, TNoOffset) when vi.vformal || vi.vglob || Functions.RTL.is_generated_name vi.vname -> Cil.one ~loc, env | _ -> Mmodel_translate.call_with_size ~loc kf "initialized" Cil.intType env t p) | Pinitialized _ -> not_yet env "labeled \\initialized" | Pallocable _ -> not_yet env "\\allocate" | Pfreeable(BuiltinLabel Here, t) -> Mmodel_translate.call ~loc kf "freeable" Cil.intType env t | Pfreeable _ -> not_yet env "labeled \\freeable" | Pfresh _ -> not_yet env "\\fresh" and named_predicate_to_exp ?name kf ?rte env p = let rte = match rte with None -> Env.generate_rte env | Some b -> b in let env = Env.rte env false in let e, env = named_predicate_content_to_exp ?name kf env p in let env = if rte then translate_rte kf env e else env in let cast = Typing.get_cast_of_predicate p in add_cast ~loc:p.pred_loc ?name env cast C_number None e and translate_rte_annots: 'a. (Format.formatter -> 'a -> unit) -> 'a -> kernel_function -> Env.t -> code_annotation list -> Env.t = fun pp elt kf env l -> let old_valid = !is_visiting_valid in let old_kind = Env.annotation_kind env in let env = Env.set_annotation_kind env Misc.RTE in let env = List.fold_left (fun env a -> match a.annot_content with | AAssert(_, _, p) -> handle_error (fun env -> Options.feedback ~dkey ~level:4 "prevent RTE from %a" pp elt; (* The logic scope MUST NOT be reset here since we still might be in the middle of the translation of the original predicate. *) let lscope_reset_old = Env.Logic_scope.get_reset env in let env = Env.Logic_scope.set_reset env false in let env = translate_named_predicate kf (Env.rte env false) p in let env = Env.Logic_scope.set_reset env lscope_reset_old in env) env | _ -> assert false) env l in is_visiting_valid := old_valid; Env.set_annotation_kind env old_kind and translate_rte kf env e = let stmt = Cil.mkStmtOneInstr ~valid_sid:true (Skip e.eloc) in let l = Rte.exp kf stmt e in translate_rte_annots Printer.pp_exp e kf env l and translate_named_predicate kf env p = Options.feedback ~dkey ~level:3 "translating predicate %a" Printer.pp_predicate p; let rte = Env.generate_rte env in Typing.type_named_predicate ~must_clear:rte p; let e, env = named_predicate_to_exp kf ~rte env p in assert (Typ.equal (Cil.typeOf e) Cil.intType); let env = Env.Logic_scope.reset env in Env.add_stmt env (Misc.mk_e_acsl_guard ~reverse:true (Env.annotation_kind env) kf e p) let named_predicate_to_exp ?name kf env p = named_predicate_to_exp ?name kf env p (* forget optional argument ?rte *) let () = Loops.term_to_exp_ref := term_to_exp; Loops.translate_named_predicate_ref := translate_named_predicate; Loops.named_predicate_ref := named_predicate_to_exp; Quantif.predicate_to_exp_ref := named_predicate_to_exp; At_with_lscope.term_to_exp_ref := term_to_exp; At_with_lscope.predicate_to_exp_ref := named_predicate_to_exp; Mmodel_translate.term_to_exp_ref := term_to_exp; Mmodel_translate.predicate_to_exp_ref := named_predicate_to_exp; Logic_functions.term_to_exp_ref := term_to_exp; Logic_functions.named_predicate_to_exp_ref := named_predicate_to_exp (* This function is used by Guillaume. However, it is correct to use it only in specific contexts. *) let predicate_to_exp kf p = Typing.type_named_predicate ~must_clear:true p; let empty_env = Env.empty (new Visitor.frama_c_copy Project_skeleton.dummy) in let e, _ = named_predicate_to_exp kf empty_env p in assert (Typ.equal (Cil.typeOf e) Cil.intType); e exception No_simple_translation of term (* This function is used by plug-in [Cfp]. *) let term_to_exp typ t = (* infer a context from the given [typ] whenever possible *) let ctx_of_typ ty = if Gmp_types.Z.is_t ty then Typing.gmpz else if Gmp_types.Q.is_t ty then Typing.rational else match ty with | TInt(ik, _) -> Typing.ikind ik | TFloat(fk, _) -> Typing.fkind fk | _ -> Typing.nan in let ctx = Extlib.opt_map ctx_of_typ typ in Typing.type_term ~use_gmp_opt:true ?ctx t; let env = Env.empty (new Visitor.frama_c_copy Project_skeleton.dummy) in let env = Env.push env in let env = Env.rte env false in let e, env = try term_to_exp (Kernel_function.dummy ()) env t with Misc.Unregistered_library_function _ -> raise (No_simple_translation t) in if not (Env.has_no_new_stmt env) then raise (No_simple_translation t); e (* ************************************************************************** *) (* [translate_*] translates a given ACSL annotation into the corresponding C statement (if any) for runtime assertion checking. IMPORTANT: the order of translation of pre-/post-spec must be consistent with the pushes done in [Keep_status] *) (* ************************************************************************** *) let assumes_predicate bhv = List.fold_left (fun acc p -> let loc = p.ip_content.pred_loc in Logic_const.pand ~loc (acc, Logic_const.unamed ~loc p.ip_content.pred_content)) Logic_const.ptrue bhv.b_assumes let translate_preconditions kf env behaviors = let env = Env.set_annotation_kind env Misc.Precondition in let do_behavior env b = let assumes_pred = assumes_predicate b in List.fold_left (fun env p -> let do_it env = if Keep_status.must_translate kf Keep_status.K_Requires then let loc = p.ip_content.pred_loc in let p = Logic_const.pimplies ~loc (assumes_pred, Logic_const.unamed ~loc p.ip_content.pred_content) in translate_named_predicate kf env p else env in handle_error do_it env) env b.b_requires in List.fold_left do_behavior env behaviors let translate_postconditions kf env behaviors = let env = Env.set_annotation_kind env Misc.Postcondition in (* generate one guard by postcondition of each behavior *) let do_behavior env b = let env = handle_error (fun env -> (* test ordering does matter for keeping statuses consistent *) if b.b_assigns <> WritesAny && Keep_status.must_translate kf Keep_status.K_Assigns then not_yet env "assigns clause in behavior"; (* ignore b.b_extended since we never translate them *) env) env in let assumes_pred = assumes_predicate b in List.fold_left (fun env (t, p) -> if Keep_status.must_translate kf Keep_status.K_Ensures then let do_it env = match t with | Normal -> let loc = p.ip_content.pred_loc in let p = p.ip_content in let p = Logic_const.pimplies ~loc (Logic_const.pold ~loc assumes_pred, Logic_const.unamed ~loc p.pred_content) in translate_named_predicate kf env p | Exits | Breaks | Continues | Returns -> not_yet env "abnormal termination case in behavior" in handle_error do_it env else env) env b.b_post_cond in (* fix ordering of behaviors' iterations *) let bhvs = List.sort (fun b1 b2 -> String.compare b1.b_name b2.b_name) behaviors in List.fold_left do_behavior env bhvs let translate_pre_spec kf env spec = let unsupported f x = ignore (handle_error (fun env -> f x; env) env) in let convert_unsupported_clauses env = unsupported (Extlib.may (fun _ -> if Keep_status.must_translate kf Keep_status.K_Decreases then not_yet env "variant clause")) spec.spec_variant; (* TODO: spec.spec_terminates is not part of the E-ACSL subset *) unsupported (Extlib.may (fun _ -> if Keep_status.must_translate kf Keep_status.K_Terminates then not_yet env "terminates clause")) spec.spec_terminates; (match spec.spec_complete_behaviors with | [] -> () | l -> unsupported (List.iter (fun _ -> if Keep_status.must_translate kf Keep_status.K_Complete then not_yet env "complete behaviors")) l); (match spec.spec_disjoint_behaviors with | [] -> () | l -> unsupported (List.iter (fun _ -> if Keep_status.must_translate kf Keep_status.K_Disjoint then not_yet env "disjoint behaviors")) l); env in let env = convert_unsupported_clauses env in handle_error (fun env -> translate_preconditions kf env spec.spec_behavior) env let translate_post_spec kf env spec = handle_error (fun env -> translate_postconditions kf env spec.spec_behavior) env let translate_pre_code_annotation kf env annot = let convert env = match annot.annot_content with | AAssert(l, _, p) -> if Keep_status.must_translate kf Keep_status.K_Assert then let env = Env.set_annotation_kind env Misc.Assertion in if l <> [] then not_yet env "@[assertion applied only on some behaviors@]"; translate_named_predicate kf env p else env | AStmtSpec(l, spec) -> if l <> [] then not_yet env "@[statement contract applied only on some behaviors@]"; translate_pre_spec kf env spec ; | AInvariant(l, loop_invariant, p) -> if Keep_status.must_translate kf Keep_status.K_Invariant then let env = Env.set_annotation_kind env Misc.Invariant in if l <> [] then not_yet env "@[invariant applied only on some behaviors@]"; let env = translate_named_predicate kf env p in if loop_invariant then Env.add_loop_invariant env p else env else env | AVariant _ -> if Keep_status.must_translate kf Keep_status.K_Variant then not_yet env "variant" else env | AAssigns _ -> (* TODO: it is not a precondition *) if Keep_status.must_translate kf Keep_status.K_Assigns then not_yet env "assigns" else env | AAllocation _ -> if Keep_status.must_translate kf Keep_status.K_Allocation then not_yet env "allocation" else env | APragma _ -> not_yet env "pragma" | AExtended _ -> env (* never translate extensions. *) in handle_error convert env let translate_post_code_annotation kf env annot = let convert env = match annot.annot_content with | AStmtSpec(_, spec) -> translate_post_spec kf env spec | AAssert _ | AInvariant _ | AVariant _ | AAssigns _ | AAllocation _ | APragma _ | AExtended _ -> env in handle_error convert env (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/translate.mli0000666000000000000000000000502313571573400023076 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** [translate_*] translates a given ACSL annotation into the corresponding C statement (if any) for runtime assertion checking. This C statements are part of the resulting environment. *) val translate_pre_spec: kernel_function -> Env.t -> funspec -> Env.t val translate_post_spec: kernel_function -> Env.t -> funspec -> Env.t val translate_pre_code_annotation: kernel_function -> Env.t -> code_annotation -> Env.t val translate_post_code_annotation: kernel_function -> Env.t -> code_annotation -> Env.t val translate_named_predicate: kernel_function -> Env.t -> predicate -> Env.t val translate_rte_annots: (Format.formatter -> 'a -> unit) -> 'a -> kernel_function -> Env.t -> code_annotation list -> Env.t exception No_simple_translation of term val term_to_exp: typ option -> term -> exp val predicate_to_exp: kernel_function -> predicate -> exp (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/visit.ml0000666000000000000000000012121513571573400022070 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Libc = Functions.Libc module RTL = Functions.RTL module E_acsl_label = Label open Cil_types open Cil_datatype let dkey = Options.dkey_translation (* ************************************************************************** *) (* Visitor *) (* ************************************************************************** *) (* local references to the below visitor and to [do_visit] *) let function_env = ref Env.dummy let dft_funspec = Cil.empty_funspec () let funspec = ref dft_funspec (* extend the environment with statements which allocate/deallocate memory blocks *) module Memory: sig val store: ?before:stmt -> Env.t -> kernel_function -> varinfo list -> Env.t val duplicate_store: ?before:stmt -> Env.t -> kernel_function -> Varinfo.Set.t -> Env.t val delete_from_list: ?before:stmt -> Env.t -> kernel_function -> varinfo list -> Env.t val delete_from_set: ?before:stmt -> Env.t -> kernel_function -> Varinfo.Set.t -> Env.t end = struct let tracking_stmt ?before fold mk_stmt env kf vars = if Functions.instrument kf then fold (fun vi env -> if Mmodel_analysis.must_model_vi ~kf vi then let vi = Visitor_behavior.Get.varinfo (Env.get_behavior env) vi in Env.add_stmt ?before env (mk_stmt vi) else env) vars env else env let store ?before env kf vars = tracking_stmt ?before List.fold_right (* small list *) Misc.mk_store_stmt env kf vars let duplicate_store ?before env kf vars = tracking_stmt ?before Varinfo.Set.fold Misc.mk_duplicate_store_stmt env kf vars let delete_from_list ?before env kf vars = tracking_stmt ?before List.fold_right (* small list *) Misc.mk_delete_stmt env kf vars let delete_from_set ?before env kf vars = tracking_stmt ?before Varinfo.Set.fold Misc.mk_delete_stmt env kf vars end (* Observation of literal strings in C expressions *) module Literal_observer: sig val exp: Env.t -> exp -> exp * Env.t (* replace the given exp by an observed variable if it is a literal string *) val exp_in_depth: Env.t -> exp -> exp * Env.t (* replace any sub-expression of the given exp that is a literal string by an observed variable *) end = struct let literal loc env s = try let vi = Literal_strings.find s in (* if the literal string was already created, just get it. *) Cil.evar ~loc vi, env with Not_found -> (* never seen this string before: replace it by a new global var *) let vi, exp, env = Env.new_var ~loc ~scope:Varname.Global ~name:"literal_string" env None Cil.charPtrType (fun _ _ -> [] (* done in the initializer, see {!vglob_aux} *)) in Literal_strings.add s vi; exp, env let exp env e = match e.enode with (* the guard below could be optimized: if no annotation **depends on this string**, then it is not required to monitor it. (currently, the guard says: "no annotation uses the memory model" *) | Const (CStr s) when Mmodel_analysis.use_model () -> literal e.eloc env s | _ -> e, env let exp_in_depth env e = let env_ref = ref env in let o = object inherit Cil.genericCilVisitor (Visitor_behavior.copy (Project.current ())) method !vexpr e = match e.enode with (* the guard below could be optimized: if no annotation **depends on this string**, then it is not required to monitor it. (currently, the guard says: "no annotation uses the memory model" *) | Const (CStr s) when Mmodel_analysis.use_model () -> let e, env = literal e.eloc !env_ref s in env_ref := env; Cil.ChangeTo e | _ -> Cil.DoChildren end in let e = Cil.visitCilExpr o e in e, !env_ref end (* Observation of global variables. *) module Global_observer: sig val function_name: string (* name of the function in which [mk_init] generates the code *) val reset: unit -> unit val is_empty: unit -> bool val add: varinfo -> unit (* observes the given variable if necessary *) val add_initializer: varinfo -> offset -> init -> unit (* add the initializer for the given observed variable *) val mk_init: Visitor_behavior.t -> Env.t -> varinfo * fundec * Env.t (* generates a new C function containing the observers for global variable declaration and initialization *) val mk_delete: Visitor_behavior.t -> stmt list -> stmt list (* generates the observers for global variable de-allocation *) end = struct let function_name = RTL.mk_api_name "globals_init" (* Hashtable mapping global variables (as Cil_type.varinfo) to their initializers (if any). NOTE: here, varinfos as keys belong to the original project while values belong to the new one *) let tbl : (offset (* compound initializers *) * init) list ref Varinfo.Hashtbl.t = Varinfo.Hashtbl.create 7 let reset () = Varinfo.Hashtbl.reset tbl let is_empty () = Varinfo.Hashtbl.length tbl = 0 let add vi = if Mmodel_analysis.must_model_vi vi then Varinfo.Hashtbl.replace tbl vi (ref []) let add_initializer vi offset init = if Mmodel_analysis.must_model_vi vi then try let l = Varinfo.Hashtbl.find tbl vi in l := (offset, init) :: !l with Not_found -> assert false let rec literal_in_initializer env = function | SingleInit exp -> snd (Literal_observer.exp_in_depth env exp) | CompoundInit (_, l) -> List.fold_left (fun env (_, i) -> literal_in_initializer env i) env l let mk_init bhv env = (* Create [__e_acsl_globals_init] function with definition for initialization of global variables *) let vi = Cil.makeGlobalVar ~source:true function_name (TFun(Cil.voidType, Some [], false, [])) in vi.vdefined <- true; (* There is no contract associated with the function *) let spec = Cil.empty_funspec () in (* Create function definition which no stmt yet: they will be added afterwards *) let blk = Cil.mkBlock [] in let fundec = { svar = vi; sformals = []; slocals = []; smaxid = 0; sbody = blk; smaxstmtid = None; sallstmts = []; sspec = spec } in let fct = Definition(fundec, Location.unknown) in (* Create and register [__e_acsl_globals_init] as kernel function *) let kf = { fundec = fct; spec = spec } in Globals.Functions.register kf; Globals.Functions.replace_by_definition spec fundec Location.unknown; (* Now generate the statements. The generation is done only now because it depends on the local variable [already_run] whose generation required the existence of [fundec] *) let env = Env.push env in (* 2-stage observation of initializers: temporal analysis must be performed after generating observers of **all** globals *) let env, stmts = Varinfo.Hashtbl.fold_sorted (fun old_vi l stmts -> let new_vi = Visitor_behavior.Get.varinfo bhv old_vi in List.fold_left (fun (env, stmts) (off, init) -> let env = literal_in_initializer env init in let stmt = Temporal.generate_global_init new_vi off init env in env, match stmt with None -> stmts | Some stmt -> stmt :: stmts) stmts !l) tbl (env, []) in (* allocation and initialization of globals *) let stmts = Varinfo.Hashtbl.fold_sorted (fun old_vi _ stmts -> let new_vi = Visitor_behavior.Get.varinfo bhv old_vi in (* a global is both allocated and initialized *) Misc.mk_store_stmt new_vi :: Misc.mk_initialize ~loc:Location.unknown (Cil.var new_vi) :: stmts) tbl stmts in (* literal strings allocations and initializations *) let stmts = Literal_strings.fold (fun s vi stmts -> let loc = Location.unknown in let e = Cil.new_exp ~loc:loc (Const (CStr s)) in let str_size = Cil.new_exp loc (SizeOfStr s) in Cil.mkStmtOneInstr ~valid_sid:true (Set(Cil.var vi, e, loc)) :: Misc.mk_store_stmt ~str_size vi :: Misc.mk_full_init_stmt ~addr:false vi :: Misc.mk_mark_readonly vi :: stmts) stmts in (* Create a new code block with generated statements *) let (b, env), stmts = match stmts with | [] -> assert false | stmt :: stmts -> Env.pop_and_get env stmt ~global_clear:true Env.Before, stmts in let stmts = Cil.mkStmt ~valid_sid:true (Block b) :: stmts in (* Prevent multiple calls to globals_init *) let loc = Location.unknown in let vi_already_run = Cil.makeLocalVar fundec (RTL.mk_api_name "already_run") (TInt(IChar, [])) in vi_already_run.vdefined <- true; vi_already_run.vreferenced <- true; vi_already_run.vstorage <- Static; let init = AssignInit (SingleInit (Cil.zero ~loc)) in let init_stmt = Cil.mkStmtOneInstr ~valid_sid:true (Local_init (vi_already_run, init, loc)) in let already_run = Cil.mkStmtOneInstr ~valid_sid:true (Set (Cil.var vi_already_run, Cil.one ~loc, loc)) in let stmts = already_run :: stmts in let guard = Cil.mkStmt ~valid_sid:true (If (Cil.evar vi_already_run, Cil.mkBlock [], Cil.mkBlock stmts, loc)) in let return = Cil.mkStmt ~valid_sid:true (Return (None, loc)) in let stmts = [ init_stmt; guard; return ] in blk.bstmts <- stmts; vi, fundec, env let mk_delete bhv stmts = Varinfo.Hashtbl.fold_sorted (fun old_vi _l acc -> let new_vi = Visitor_behavior.Get.varinfo bhv old_vi in Misc.mk_delete_stmt new_vi :: acc) tbl stmts end (* the main visitor performing e-acsl checking and C code generator *) class e_acsl_visitor prj generate = object (self) inherit Visitor.generic_frama_c_visitor (if generate then Visitor_behavior.copy prj else Visitor_behavior.inplace ()) val mutable main_fct = None (* fundec of the main entry point, in the new project [prj]. [None] while the global corresponding to this fundec has not been visited *) val mutable is_initializer = false (* Global flag set to [true] if a currently visited node belongs to a global initializer and set to [false] otherwise *) method private reset_env () = function_env := Env.empty (self :> Visitor.frama_c_visitor) method !vfile _f = (* copy the options used during the visit in the new project: it is the right place to do this: it is still before visiting, but after that the visitor internals reset all of them :-(. *) let cur = Project.current () in let selection = State_selection.of_list [ Options.Gmp_only.self; Options.Check.self; Options.Full_mmodel.self; Kernel.SignedOverflow.self; Kernel.UnsignedOverflow.self; Kernel.SignedDowncast.self; Kernel.UnsignedDowncast.self; Kernel.Machdep.self ] in if generate then Project.copy ~selection ~src:cur prj; Cil.DoChildrenPost (fun f -> (* extend [main] with forward initialization and put it at end *) if generate then begin if not (Global_observer.is_empty () && Literal_strings.is_empty ()) then begin let build_initializer () = Options.feedback ~dkey ~level:2 "building global initializer."; let vi, fundec, env = Global_observer.mk_init self#behavior !function_env in function_env := env; let cil_fct = GFun(fundec, Location.unknown) in if Mmodel_analysis.use_model () then match main_fct with | Some main -> let exp = Cil.evar ~loc:Location.unknown vi in (* Create [__e_acsl_globals_init();] call *) let stmt = Cil.mkStmtOneInstr ~valid_sid:true (Call(None, exp, [], Location.unknown)) in vi.vreferenced <- true; (* insert [__e_acsl_globals_init ();] as first statement of [main] *) main.sbody.bstmts <- stmt :: main.sbody.bstmts; let new_globals = List.fold_right (fun g acc -> match g with | GFun({ svar = vi }, _) when Varinfo.equal vi main.svar -> acc | _ -> g :: acc) f.globals [ cil_fct; GFun(main, Location.unknown) ] in (* add the literal string varinfos as the very first globals *) let new_globals = Literal_strings.fold (fun _ vi l -> GVar(vi, { init = None }, Location.unknown) :: l) new_globals in f.globals <- new_globals | None -> Kernel.warning "@[no entry point specified:@ \ you must call function `%s' and `__e_acsl_memory_clean by yourself.@]" Global_observer.function_name; f.globals <- f.globals @ [ cil_fct ] in Project.on prj build_initializer () end; (* must_init *) (* Add a call to [__e_acsl_memory_init] that initializes memory storage and potentially records program arguments. Parameters to [__e_acsl_memory_init] are addresses of program arguments or NULLs if [main] is declared without arguments. *) let build_mmodel_initializer () = let loc = Location.unknown in let nulls = [ Cil.zero loc ; Cil.zero loc ] in let handle_main main = let args = (* record arguments only if the second has a pointer type, so a argument strings can be recorded. This is sufficient to capture C99 compliant arguments and GCC extensions with environ. *) match main.sformals with | [] -> (* no arguments to main given *) nulls | _argc :: argv :: _ when Cil.isPointerType argv.vtype -> (* grab addresses of arguments for a call to the main initialization function, i.e., [__e_acsl_memory_init] *) List.map Cil.mkAddrOfVi main.sformals; | _ :: _ -> (* some non-standard arguments. *) nulls in let ptr_size = Cil.sizeOf loc Cil.voidPtrType in let args = args @ [ ptr_size ] in let name = RTL.mk_api_name "memory_init" in let init = Misc.mk_call loc name args in main.sbody.bstmts <- init :: main.sbody.bstmts in Extlib.may handle_main main_fct in Project.on prj (fun () -> f.globals <- Logic_functions.add_generated_functions f.globals; build_mmodel_initializer ()) (); (* reset copied states at the end to be observationally equivalent to a standard visitor. *) Project.clear ~selection ~project:prj (); end; (* generate *) f) method !vglob_aux = function | GVarDecl(vi, _) | GVar(vi, _, _) | GFunDecl(_, vi, _) | GFun({ svar = vi }, _) when Misc.is_library_loc vi.vdecl || Builtins.mem vi.vname -> if generate then Cil.JustCopyPost (fun l -> let new_vi = Visitor_behavior.Get.varinfo self#behavior vi in if Misc.is_library_loc vi.vdecl then Misc.register_library_function new_vi; if Builtins.mem vi.vname then Builtins.update vi.vname new_vi; l) else begin Misc.register_library_function vi; Cil.SkipChildren end | GVarDecl(vi, _) | GVar(vi, _, _) | GFun({ svar = vi }, _) when Cil.is_builtin vi -> if generate then Cil.JustCopy else Cil.SkipChildren | g when Misc.is_library_loc (Global.loc g) -> if generate then Cil.JustCopy else Cil.SkipChildren | g -> let unghost_vi vi = vi.vghost <- false ; vi.vtype <- match vi.vtype with | TFun(res, Some l, va, attr) -> let retype (n, t, a) = (n, t, Cil.dropAttribute Cil.frama_c_ghost_formal a) in TFun(res, Some (List.map retype l), va, attr) | _ -> vi.vtype in let do_it = function | GVar(vi, _, _) -> unghost_vi vi | GFun({ svar = vi } as fundec, _) -> unghost_vi vi ; Builtins.update vi.vname vi; (* remember that we have to remove the main later (see method [vfile]); do not use the [vorig_name] since both [main] and [__e_acsl_main] have the same [vorig_name]. *) if vi.vname = Kernel.MainFunction.get () then main_fct <- Some fundec | GVarDecl(vi, _) | GFunDecl(_, vi, _) -> (* do not convert extern ghost variables, because they can't be linked, see bts #1392 *) if vi.vstorage <> Extern then unghost_vi vi | _ -> () in (match g with | GVar(vi, _, _) | GVarDecl(vi, _) | GFun({ svar = vi }, _) (* Track function addresses but the main function that is tracked internally via RTL *) when vi.vorig_name <> Kernel.MainFunction.get () -> (* Make a unique mapping for each global variable omitting initializers. Initializers (used to capture literal strings) are added to [global_vars] via the [vinit] visitor method (see comments below). *) Global_observer.add (Visitor_behavior.Get_orig.varinfo self#behavior vi) | _ -> ()); if generate then Cil.DoChildrenPost(fun g -> List.iter do_it g; g) else Cil.DoChildren (* Add mappings from global variables to their initializers in [global_vars]. Note that the below function captures only [SingleInit]s. All compound initializers containing SingleInits (except for empty compound initializers) are unrapped and thrown away. *) method !vinit vi off _ = if generate then if Mmodel_analysis.must_model_vi vi then begin is_initializer <- vi.vglob; Cil.DoChildrenPost (fun i -> (match is_initializer with | true -> (match i with | CompoundInit(_,[]) -> (* Case of an empty CompoundInit, treat it as if there were no initializer at all *) () | CompoundInit(_,_) | SingleInit _ -> (* TODO: [off] should be the one of the new project while it is from the old project *) Global_observer.add_initializer vi off i) | false-> ()); is_initializer <- false; i) end else Cil.JustCopy else Cil.SkipChildren method !vvdec vi = (try let old_vi = Visitor_behavior.Get_orig.varinfo self#behavior vi in let old_kf = Globals.Functions.get old_vi in funspec := Cil.visitCilFunspec (self :> Cil.cilVisitor) (Annotations.funspec old_kf) with Not_found -> ()); Cil.SkipChildren method private add_generated_variables_in_function f = assert generate; let vars = Env.get_generated_variables !function_env in self#reset_env (); let locals, blocks = List.fold_left (fun (local_vars, block_vars as acc) (v, scope) -> match scope with (* TODO: [kf] assumed to be consistent. Should be asserted. *) | Env.LFunction _kf -> v :: local_vars, v :: block_vars | Env.LLocal_block _kf -> v :: local_vars, block_vars | _ -> acc) (f.slocals, f.sbody.blocals) vars in f.slocals <- locals; f.sbody.blocals <- blocks (* Memory management for \at on purely logic variables: Put [malloc] stmts at proper locations *) method private insert_malloc_and_free_stmts kf f = let malloc_stmts = At_with_lscope.Malloc.find_all kf in let fstmts = malloc_stmts @ f.sbody.bstmts in f.sbody.bstmts <- fstmts; (* Now that [malloc] stmts for [kf] have been inserted, there is no more need to keep the corresponding entries in the table managing them. *) At_with_lscope.Malloc.remove_all kf method !vfunc f = if generate then begin let kf = Extlib.the self#current_kf in if Functions.instrument kf then Exit_points.generate f; Options.feedback ~dkey ~level:2 "entering in function %a." Kernel_function.pretty kf; let unghost_formal vi = vi.vghost <- false ; vi.vattr <- Cil.dropAttribute Cil.frama_c_ghost_formal vi.vattr in List.iter (fun vi -> vi.vghost <- false) f.slocals; List.iter unghost_formal f.sformals; Cil.DoChildrenPost (fun f -> Exit_points.clear (); self#add_generated_variables_in_function f; self#insert_malloc_and_free_stmts kf f; Options.feedback ~dkey ~level:2 "function %a done." Kernel_function.pretty kf; f) end else Cil.DoChildren method private is_return old_kf stmt = let old_ret = try Kernel_function.find_return old_kf with Kernel_function.No_Statement -> assert false in Stmt.equal stmt (Visitor_behavior.Get.stmt self#behavior old_ret) method private is_first_stmt old_kf stmt = try Stmt.equal (Visitor_behavior.Get_orig.stmt self#behavior stmt) (Kernel_function.find_first_stmt old_kf) with Kernel_function.No_Statement -> assert false method private is_main old_kf = try let main, _ = Globals.entry_point () in Kernel_function.equal old_kf main with Globals.No_such_entry_point _s -> (* [JS 2013/05/21] already a warning in pre-analysis *) (* Options.warning ~once:true "%s@ \ @[The generated program may be incomplete.@]" s;*) false method !vstmt_aux stmt = Options.debug ~level:4 "proceeding stmt (sid %d) %a@." stmt.sid Stmt.pretty stmt; let kf = Extlib.the self#current_kf in let is_main = self#is_main kf in let env = Env.push !function_env in let env = match stmt.skind with | Loop _ -> Env.push_loop env | _ -> env in let env = if self#is_first_stmt kf stmt then (* JS: should be done in the new project? *) let env = if generate && not is_main then let env = Memory.store env kf (Kernel_function.get_formals kf) in Temporal.handle_function_parameters kf env else env in (* translate the precondition of the function *) if Functions.check kf then Project.on prj (Translate.translate_pre_spec kf env) !funspec else env else env in let env, new_annots = if Functions.check kf then Annotations.fold_code_annot (fun _ old_a (env, new_annots) -> let a = (* [VP] Don't use Visitor here, as it will fill the queue in the middle of the computation... *) Cil.visitCilCodeAnnotation (self :> Cil.cilVisitor) old_a in let env = Project.on prj (Translate.translate_pre_code_annotation kf env) a in env, a :: new_annots) (Visitor_behavior.Get_orig.stmt self#behavior stmt) (env, []) else env, [] in (* Add [__e_acsl_store_duplicate] calls for local variables which * declarations are bypassed by gotos. Note: should be done before * [vinst] method (which adds initializers) is executed, otherwise * init calls appear before store calls. *) let duplicates = Exit_points.store_vars stmt in let env = if generate then Memory.duplicate_store ~before:stmt env kf duplicates else env in function_env := env; let mk_block stmt = (* be careful: since this function is called in a post action, [env] has been modified from the time where pre actions have been executed. Use [function_env] to get it back. *) let env = !function_env in let env = if generate then (* Add temporal analysis instrumentations *) let env = Temporal.handle_stmt stmt env in (* Add initialization statements and store_block statements stemming from Local_init *) self#handle_instructions stmt env kf else env in let new_stmt, env, must_mv = if Functions.check kf then let env = (* handle ghost statement *) if stmt.ghost then begin stmt.ghost <- false; (* translate potential RTEs of ghost code *) let rtes = Rte.stmt ~warn:false kf stmt in Translate.translate_rte_annots Printer.pp_stmt stmt kf env rtes end else env in (* handle loop invariants *) let new_stmt, env, must_mv = Loops.preserve_invariant prj env kf stmt in let orig = Visitor_behavior.Get_orig.stmt self#behavior stmt in Visitor_behavior.Set_orig.stmt self#behavior new_stmt orig; Visitor_behavior.Set.stmt self#behavior orig new_stmt; new_stmt, env, must_mv else stmt, env, false in let mk_post_env env = (* [fold_right] to preserve order of generation of pre_conditions *) Project.on prj (List.fold_right (fun a env -> Translate.translate_post_code_annotation kf env a) new_annots) env in let new_stmt, env = (* Remove local variables which scopes ended via goto/break/continue. *) let del_vars = Exit_points.delete_vars stmt in let env = if generate then Memory.delete_from_set ~before:stmt env kf del_vars else env in if self#is_return kf stmt then let env = if Functions.check kf then (* must generate the post_block before including [stmt] (the 'return') since no code is executed after it. However, since this statement is pure (Cil invariant), that is semantically correct. *) (* [JS 2019/2/19] TODO: what about the other ways of early exiting a block? *) let env = mk_post_env env in (* also handle the postcondition of the function and clear the env *) Project.on prj (Translate.translate_post_spec kf env) !funspec else env in (* de-allocating memory previously allocating by the kf *) (* JS: should be done in the new project? *) if generate then (* Remove recorded function arguments *) let fargs = Kernel_function.get_formals kf in let env = if generate then Memory.delete_from_list env kf fargs else env in let b, env = Env.pop_and_get env new_stmt ~global_clear:true Env.After in if is_main && Mmodel_analysis.use_model () then begin let stmts = b.bstmts in let l = List.rev stmts in let mclean = (RTL.mk_api_name "memory_clean") in match l with | [] -> assert false (* at least the 'return' stmt *) | ret :: l -> let loc = Stmt.loc stmt in let delete_stmts = Global_observer.mk_delete self#behavior [ Misc.mk_call ~loc mclean []; ret ] in b.bstmts <- List.rev l @ delete_stmts end; let new_stmt = Misc.mk_block prj stmt b in if not (Cil_datatype.Stmt.equal stmt new_stmt) then begin (* move the labels of the return to the new block in order to evaluate the postcondition when jumping to them. *) E_acsl_label.move (self :> Visitor.generic_frama_c_visitor) stmt new_stmt end; new_stmt, env else stmt, env else (* i.e. not (is_return stmt) *) if generate then begin (* must generate [pre_block] which includes [stmt] before generating [post_block] *) let pre_block, env = Env.pop_and_get ~split:true env new_stmt ~global_clear:false Env.After in let env = (* if [kf] is not monitored, do not translate any postcondition, but still push an empty environment consumed by [Env.pop_and_get] below. This [Env.pop_and_get] call is always required in order to generate the code not directly related to the annotations of the current stmt in anycase. *) if Functions.check kf then mk_post_env (Env.push env) else Env.push env in let post_block, env = Env.pop_and_get env (Misc.mk_block prj new_stmt pre_block) ~global_clear:false Env.Before in let post_block = if post_block.blocals = [] && new_stmt.labels = [] then Cil.transient_block post_block else post_block in let res = Misc.mk_block prj new_stmt post_block in if not (Cil_datatype.Stmt.equal new_stmt res) then E_acsl_label.move (self :> Visitor.generic_frama_c_visitor) new_stmt res; let orig = Visitor_behavior.Get_orig.stmt self#behavior stmt in Visitor_behavior.Set.stmt self#behavior orig res; Visitor_behavior.Set_orig.stmt self#behavior res orig; res, env end else stmt, env in if must_mv then Loops.mv_invariants env ~old:new_stmt stmt; function_env := env; Options.debug ~level:4 "@[new stmt (from sid %d):@ %a@]" stmt.sid Printer.pp_stmt new_stmt; if generate then new_stmt else stmt in Cil.ChangeDoChildrenPost(stmt, mk_block) method private handle_instructions stmt env kf = let add_initializer loc ?vi lv ?(post=false) stmt env kf = assert generate; if Functions.instrument kf then let may_safely_ignore = function | Var vi, NoOffset -> vi.vglob || vi.vformal | _ -> false in let must_model = Mmodel_analysis.must_model_lval ~stmt ~kf lv in if not (may_safely_ignore lv) && must_model then let before = Cil.mkStmt stmt.skind in let new_stmt = (* Bitfields are not yet supported ==> no initializer. A not_yet will be raised in [Translate]. *) if Cil.isBitfield lv then Project.on prj Cil.mkEmptyStmt () else Project.on prj (Misc.mk_initialize ~loc) lv in let env = Env.add_stmt ~post ~before env new_stmt in let env = match vi with | None -> env | Some vi -> let new_stmt = Project.on prj Misc.mk_store_stmt vi in Env.add_stmt ~post ~before env new_stmt in env else env else env in let check_formats = Options.Validate_format_strings.get () in let replace_libc_fn = Options.Replace_libc_functions.get () in match stmt.skind with | Instr(Set(lv, _, loc)) -> add_initializer loc lv stmt env kf | Instr(Local_init(vi, init, loc)) -> let lv = (Var vi, NoOffset) in let env = add_initializer loc ~vi lv ~post:true stmt env kf in (* Handle variable-length array allocation via [__fc_vla_alloc]. Here each instance of [__fc_vla_alloc] is rewritten to [alloca] (that is used to implement VLA) and further a custom call to [store_block] tracking VLA allocation is issued. *) (* KV: Do not add handling [alloca] allocation here (or anywhere else for that matter). Handling of [alloca] should be implemented in Frama-C (eventually). This is such that each call to [alloca] becomes [__fc_vla_alloc]. It is already handled using the code below. *) (match init with | ConsInit (fvi, sz :: _, _) when Libc.is_vla_alloc_name fvi.vname -> fvi.vname <- Libc.actual_alloca; (* Since we need to pass [vi] by value cannot use [Misc.mk_store_stmt] here. Do it manually. *) let sname = RTL.mk_api_name "store_block" in let store = Misc.mk_call ~loc sname [ Cil.evar vi ; sz ] in Env.add_stmt ~post:true env store (* Rewrite format functions (e.g., [printf]). See some comments below *) | ConsInit (fvi, args, knd) when check_formats && Libc.is_printf_name fvi.vname -> let name = RTL.get_rtl_replacement_name fvi.vname in let new_vi = Misc.get_lib_fun_vi name in let fmt = Libc.get_printf_argument_str ~loc fvi.vname args in stmt.skind <- Instr(Local_init(vi, ConsInit(new_vi, fmt :: args, knd), loc)); env (* Rewrite names of functions for which we have alternative definitions in the RTL. *) | ConsInit (fvi, _, _) when replace_libc_fn && RTL.has_rtl_replacement fvi.vname -> fvi.vname <- RTL.get_rtl_replacement_name fvi.vname; env | _ -> env) | Instr(Call (result, exp, args, loc)) -> (* Rewrite names of functions for which we have alternative definitions in the RTL. *) (match exp.enode with | Lval(Var vi, _) when replace_libc_fn && RTL.has_rtl_replacement vi.vname -> vi.vname <- RTL.get_rtl_replacement_name vi.vname | Lval(Var vi , _) when Libc.is_vla_free_name vi.vname -> (* Handle variable-length array allocation via [__fc_vla_free]. Rewrite its name to [delete_block]. The rest is in place. *) vi.vname <- RTL.mk_api_name "delete_block" | Lval(Var vi, _) when check_formats && Libc.is_printf_name vi.vname -> (* Rewrite names of format functions (such as printf). This case differs from the above because argument list of format functions is extended with an argument describing actual variadic arguments *) (* Replacement name, e.g., [printf] -> [__e_acsl_builtin_printf] *) let name = RTL.get_rtl_replacement_name vi.vname in (* Variadic arguments descriptor *) let fmt = Libc.get_printf_argument_str ~loc vi.vname args in (* get the name of the library function we need. Cannot just rewrite the name as AST check will then fail *) let vi = Misc.get_lib_fun_vi name in stmt.skind <- Instr(Call (result, Cil.evar vi, fmt :: args, loc)) | _ -> ()); (* Add statement tracking initialization of return values of function calls *) (match result with | Some lv when not (RTL.is_generated_kf kf) -> add_initializer loc lv ~post:false stmt env kf | _ -> env) | _ -> env method !vblock blk = let handle_memory new_blk = let kf = Extlib.the self#current_kf in let free_stmts = At_with_lscope.Free.find_all kf in match new_blk.blocals, free_stmts with | [], [] -> new_blk | [], _ :: _ | _ :: _, [] | _ :: _, _ :: _ -> let add_locals stmts = if Functions.instrument kf then List.fold_left (fun acc vi -> if Mmodel_analysis.must_model_vi ~bhv:self#behavior ~kf vi then Misc.mk_delete_stmt vi :: acc else acc) stmts new_blk.blocals else stmts in let rec insert_in_innermost_last_block blk = function | { skind = Return _ } as ret :: ((potential_clean :: tl) as l) -> (* keep the return (enclosed in a generated block) at the end; preceded by clean if any *) let init, tl = if self#is_main kf && Mmodel_analysis.use_model () then free_stmts @ [ potential_clean; ret ], tl else free_stmts @ [ ret ], l in (* Now that [free] stmts for [kf] have been inserted, there is no more need to keep the corresponding entries in the table managing them. *) At_with_lscope.Free.remove_all kf; blk.bstmts <- List.fold_left (fun acc v -> v :: acc) (add_locals init) tl | { skind = Block b } :: _ -> insert_in_innermost_last_block b (List.rev b.bstmts) | l -> blk.bstmts <- List.fold_left (fun acc v -> v :: acc) (add_locals []) l in insert_in_innermost_last_block new_blk (List.rev new_blk.bstmts); if Functions.instrument kf then new_blk.bstmts <- List.fold_left (fun acc vi -> if Mmodel_analysis.must_model_vi vi && not vi.vdefined then let vi = Visitor_behavior.Get.varinfo self#behavior vi in Misc.mk_store_stmt vi :: acc else acc) new_blk.bstmts blk.blocals; new_blk in if generate then Cil.DoChildrenPost handle_memory else Cil.DoChildren (* Processing expressions for the purpose of replacing literal strings found in the code with variables generated by E-ACSL. *) method !vexpr _ = if generate then begin match is_initializer with (* Do not touch global initializers because they accept only constants *) | true -> Cil.DoChildren (* Replace literal strings elsewhere *) | false -> Cil.DoChildrenPost (fun e -> let e, env = Literal_observer.exp !function_env e in function_env := env; e) end else Cil.SkipChildren initializer Misc.reset (); Logic_functions.reset (); Literal_strings.reset (); Global_observer.reset (); Keep_status.before_translation (); self#reset_env () end let do_visit ?(prj=Project.current ()) generate = (* The main visitor proceeds by tracking declarations belonging to the E-ACSL runtime library and then using these declarations to generate statements used in instrumentation. The following code reorders AST so declarations belonging to E-ACSL library appear atop of any location requiring instrumentation. *) Misc.reorder_ast (); Options.feedback ~level:2 "%s annotations in %a." (if generate then "translating" else "checking") Project.pretty prj; let vis = Extlib.try_finally ~finally:Typing.clear (new e_acsl_visitor prj) generate in (* explicit type annotation in order to check that no new method is introduced by error *) (vis : Visitor.frama_c_visitor) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/code_generator/visit.mli0000666000000000000000000000332313571573400022240 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val do_visit: ?prj:Project.t -> bool -> Visitor.frama_c_visitor (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/0000777000000000000000000000000013571573400017372 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/builtins.ml0000666000000000000000000000740113571573400021557 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* store the E-ACSL built-ins by associating a varinfo to its name. *) let tbl : varinfo ref Datatype.String.Hashtbl.t = Datatype.String.Hashtbl.create 7 let mem = Datatype.String.Hashtbl.mem tbl let find s = !(Datatype.String.Hashtbl.find tbl s) (* the initial varinfos in the table belong to the original project. At the time of code generation, we need to update them to the ones of the new project. *) let update s vi = try let vref = Datatype.String.Hashtbl.find tbl s in vref := vi with Not_found -> () (* add [vi] in the built-in table if it is an E-ACSL built-in that is not [already] registered. *) let add_builtin vi already = if not already then let bl_name = vi.vname in if Options.Builtins.mem bl_name then match Cil.unrollType vi.vtype with | TFun(ret_typ, param_typs, _, _) -> let bl_type = match Cil.unrollType ret_typ with | TVoid _ -> Options.fatal "Expecting a non-void return type for the E-ACSL built-in %s" bl_name | _ -> Some (Ctype ret_typ) in let bl_profile = match param_typs with | None -> [] | Some l -> List.map (fun (name, ty, _) -> (name, Ctype ty)) l in let bli = { bl_name; bl_labels = []; bl_params = []; bl_type; bl_profile } in (* add the built-in locally as an E-ACSL built-in, but also as a new Frama-C built-in. This way, the annotated C code will be parsed when using it *) Logic_builtin.add bli; Datatype.String.Hashtbl.add tbl bl_name (ref vi) | _ -> Options.fatal "Expecting a function type for the E-ACSL built-in %s" bl_name let init () = Datatype.String.Hashtbl.clear tbl; if not (Options.Builtins.is_empty ()) then (* every time a new global is visited by [Cabs2cil], check if we must add it as a new E-ACSL built-in *) Cabs2cil.register_new_global_hook add_builtin (* Initialization of the database must be done before anything else, but parsing the command line *) let () = Cmdline.run_after_configuring_stage init (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/builtins.mli0000666000000000000000000000407013571573400021727 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** E-ACSL built-in database. *) val mem: string -> bool (** @return true iff the given function name is an E-ACSL built-in *) val find: string -> Cil_types.varinfo (** Get the varinfo corresponding to the given E-ACSL built-in name. @raise Not_found if it is not a built-in *) val update: string -> Cil_types.varinfo -> unit (** If the given name is an E-ACSL built-in, change its old varinfo by the given new one. *) (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/error.ml0000666000000000000000000000540113571573400021055 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) exception Typing_error of string let untypable s = raise (Typing_error s) exception Not_yet of string let not_yet s = raise (Not_yet s) module Nb_typing = State_builder.Ref (Datatype.Int) (struct let name = "E_ACSL.Error.Nb_typing" let default () = 0 let dependencies = [ Ast.self ] end) let nb_untypable = Nb_typing.get module Nb_not_yet = State_builder.Ref (Datatype.Int) (struct let name = "E_ACSL.Error.Nb_not_yet" let default () = 0 let dependencies = [ Ast.self ] end) let nb_not_yet = Nb_not_yet.get let generic_handle f res x = try f x with | Typing_error s -> let msg = Format.sprintf "@[invalid E-ACSL construct@ `%s'.@]" s in Options.warning ~once:true ~current:true "@[%s@ Ignoring annotation.@]" msg; Nb_typing.set (Nb_typing.get () + 1); res | Not_yet s -> let msg = Format.sprintf "@[E-ACSL construct@ `%s'@ is not yet supported.@]" s in Options.warning ~once:true ~current:true "@[%s@ Ignoring annotation.@]" msg; Nb_not_yet.set (Nb_not_yet.get () + 1); res let handle f x = generic_handle f x x (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/error.mli0000666000000000000000000000457213571573400021236 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Handling errors. *) exception Typing_error of string exception Not_yet of string val untypable: string -> 'a (** Type error built from the given argument. *) val not_yet: string -> 'a (** Not_yet_implemented error built from the given argument. *) val handle: ('a -> 'a) -> 'a -> 'a (** Run the closure with the given argument and handle potential errors. Return the provide argument in case of errors. *) val generic_handle: ('a -> 'b) -> 'b -> 'a -> 'b (** Run the closure with the given argument and handle potential errors. Return the additional argument in case of errors. *) val nb_untypable: unit -> int (** Number of untypable annotations. *) val nb_not_yet: unit -> int (** Number of not-yet-supported annotations. *) (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/functions.ml0000666000000000000000000002214213571573400021735 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* ************************************************************************** *) (* Misc functions *) (* ************************************************************************** *) (* return true if the string s starts with prefix p and false otherwise *) let startswith p s = let lp = String.length p in if lp <= String.length s then p = String.sub s 0 lp else false (* if string s is prefixed with string p, then return s without p, otherwise * return s as is *) let strip_prefix p s = let lp = String.length p in if startswith p s then String.sub s lp (String.length s - lp) else s (* True if a named function has a definition and false otherwise *) let has_fundef exp = match exp.enode with | Lval(Var vi, _) -> let kf = try Globals.Functions.get vi with Not_found -> Options.fatal "[has_fundef] not a function" in Kernel_function.is_definition kf | Lval _ (* function pointer *) -> false | _ -> Options.fatal "[has_fundef] not a left-value: '%a'" Printer.pp_exp exp (* ************************************************************************** *) (* RTL functions *) (* ************************************************************************** *) module RTL = struct (* prefix of all functions/variables from the public E-ACSL API *) let e_acsl_api_prefix = "__e_acsl_" (* prefix of temporal analysis functions of the public E-ACSL API *) let e_acsl_temporal_prefix = e_acsl_api_prefix ^ "temporal_" (* prefix of all builtin functions/variables from the public E-ACSL API, Builtin functions replace original calls in programs. *) let e_acsl_builtin_prefix = e_acsl_api_prefix ^ "builtin_" (* prefix of functions/variables generated by E-ACSL *) let e_acsl_gen_prefix = "__gen_e_acsl_" (* prefix of literal strings generated by E-ACSL *) let e_acsl_lit_string_prefix = e_acsl_gen_prefix ^ "literal_string" let mk_api_name fname = e_acsl_api_prefix ^ fname let mk_temporal_name fname = e_acsl_temporal_prefix ^ fname let mk_gen_name name = e_acsl_gen_prefix ^ name let get_original_name kf = strip_prefix e_acsl_gen_prefix (Kernel_function.get_name kf) let is_generated_name name = startswith e_acsl_gen_prefix name let is_generated_kf kf = is_generated_name (Kernel_function.get_name kf) let is_rtl_name name = startswith e_acsl_api_prefix name let is_generated_literal_string_name name = startswith e_acsl_lit_string_prefix name let get_rtl_replacement_name fn = e_acsl_builtin_prefix ^ fn let has_rtl_replacement = function | "strcpy" | "strncpy" | "strlen" | "strcat" | "strncat" | "strcmp" | "strncmp" | "memcpy" | "memset" | "memcmp" | "memmove" -> true | _ -> false end (* ************************************************************************** *) (* Libc functions *) (* ************************************************************************** *) module Libc = struct let is_dyn_alloc_name name = name = "malloc" || name = "realloc" || name = "calloc" let is_dyn_free_name name = name = "free" || name = "cfree" let is_vla_alloc_name name = name = "__fc_vla_alloc" let is_vla_free_name name = name = "__fc_vla_free" let actual_alloca = "__builtin_alloca" let is_alloca_name name = name = "alloca" || name = actual_alloca let is_memcpy_name name = name = "memcpy" let is_memset_name name = name = "memset" let apply_fn f exp = match exp.enode with | Lval(Var vi, _) -> f vi.vname | Lval _ (* function pointer *) -> false | _ -> Options.fatal "[Functions.Rtl.apply_fn] not a left-value" let is_dyn_alloc exp = apply_fn is_dyn_alloc_name exp let is_dyn_free exp = apply_fn is_dyn_free_name exp let is_vla_alloc exp = apply_fn is_vla_alloc_name exp let is_vla_free exp = apply_fn is_vla_free_name exp let is_alloca exp = apply_fn is_alloca_name exp let is_memcpy exp = apply_fn is_memcpy_name exp let is_memset exp = apply_fn is_memset_name exp let printf_fmt_position = function | "printf" -> 1 | "syslog" | "dprintf" | "fprintf" | "sprintf" -> 2 | "snprintf" -> 3 | _ -> 0 let is_printf_name name = printf_fmt_position name <> 0 let is_printf exp = apply_fn is_printf_name exp let get_printf_argument_str ~loc fn args = assert (is_printf_name fn); (* drop first n elements from a list *) let rec drop n l = assert (n >= 0); if n > 0 then let l = match l with _ :: e -> e | [] -> [] in drop (n-1) l else l in (* get a character representing an integer type *) let get_ikind_str = function | IInt -> "d" (* [int] *) | IUInt -> "D" (* [unsigned int] *) | ILong -> "l" (* [long] *) | IULong -> "L" (* [unsigned long] *) | ILongLong -> "r" (* [long long] *) | IULongLong -> "R" (* [unsigned long long] *) (* _Bool, char and short (either signed or unsigned are promoted to int) *) | IBool | IChar | ISChar | IUChar | IShort | IUShort -> "d" in (* get a character representing a floating point type *) let get_fkind_str = function (* Format-based functions expect only double-precision floats. Single-precision floating points are promoted to doubles so this case should never happen in fact. *) | FFloat -> assert false (* "f" *) (* [float] *) | FDouble -> "e" (* [float/double] *) | FLongDouble -> "E" (* [long double] *) in (* get a character representing a pointer type *) let get_pkind_str ty = match ty with | TInt(IChar,_) | TInt(ISChar,_) -> "s" (* [char*] *) | TInt(IUChar,_) -> "S" (* [unsigned char*] *) | TInt(IShort,_) -> "q" (* [short*] *) | TInt(IUShort,_) -> "Q" (* [unsigned short*] *) | TInt(IInt,_) -> "i" (* [int*] *) | TInt(IUInt,_) -> "I" (* [unsigned int*] *) | TInt(ILong,_) -> "z" (* [long int*] *) | TInt(IULong,_) -> "Z" (* [unsigned long int*] *) | TInt(ILongLong,_) -> "w" (* [long int*] *) | TInt(IULongLong,_) -> "W" (* [unsigned long int*] *) | TVoid _ -> "p" (* [void*] *) | _ -> Options.fatal "Unexpected argument type in printf: %a @." Printer.pp_typ ty in let exps = drop (printf_fmt_position fn) args in let param_str = List.fold_right (fun exp acc -> match Cil.unrollType (Cil.typeOf exp) with | TInt(k, _) -> get_ikind_str k ^ acc | TFloat(k, _) -> get_fkind_str k ^ acc | TPtr(ty, _) -> get_pkind_str (Cil.unrollType ty) ^ acc | TVoid _ | TArray _ | TFun _ | TNamed _ | TComp _ | TEnum _ | TBuiltin_va_list _ -> assert false) exps "" in Cil.mkString ~loc param_str end let check kf = (* [kf] is monitored iff all functions must be monitored or [kf] belongs to the white list *) Options.Functions.is_empty () || Options.Functions.mem kf || (* also check if [kf] is a duplicate of a monitored function *) let s = RTL.get_original_name kf in try let gen_kf = Globals.Functions.find_by_name s in Options.Functions.mem gen_kf with Not_found -> false let instrument kf = (* [kf] is monitored iff all functions must be monitored or [kf] belongs to the white list *) Options.Instrument.is_empty () || (Options.Instrument.mem kf && (not (RTL.is_generated_kf kf) || (* all duplicates belong to [Options.Instrument]. For them, look for their original version. *) let s = RTL.get_original_name kf in try let gen_kf = Globals.Functions.find_by_name s in Options.Instrument.mem gen_kf with Not_found -> false)) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/functions.mli0000666000000000000000000001704313571573400022112 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types val has_fundef: exp -> bool (** @return [true] if a function whose name is given via [exp] is defined and [false] otherwise *) val check: kernel_function -> bool (** @return [true] iff code must be generated for annotations of the given function. *) val instrument: kernel_function -> bool (** @return [true] iff the given function must be instrumented. *) (* ************************************************************************** *) (** {2 RTL} Operations on function belonging to the runtime library of E-ACSL *) (* ************************************************************************** *) module RTL: sig val mk_api_name: string -> string (** Prefix a name (of a variable or a function) with a string that identifies it as belonging to the public API of E-ACSL runtime library *) val mk_temporal_name: string -> string (** Prefix a name (of a variable or a function) with a string that identifies it as belonging to the public API of E-ACSL runtime library dealing with temporal analysis. *) val mk_gen_name: string -> string (** Prefix a name (of a variable or a function) with a string indicating that this name has been generated during instrumentation phase. *) val is_generated_name: string -> bool (** @return [true] if the prefix of the given name indicates that it has been generated by E-ACSL instrumentation (see [mk_gen_name] function). *) val is_generated_kf: kernel_function -> bool (** Same as [is_generated_name] but for kernel functions *) val is_rtl_name: string -> bool (** @return [true] if the prefix of the given name indicates that it belongs to the public API of the E-ACSL Runtime Library *) val is_generated_literal_string_name: string -> bool (** Same as [is_generated_name] but indicates that the name represents a local variable that replaced a literal string. *) val get_original_name: kernel_function -> string (** Retrieve the name of the kernel function and strip prefix that indicates that it has been generated by the instrumentation. *) val get_rtl_replacement_name: string -> string (** Given the name of C library function return the name of the RTL function that potentially replaces it. *) val has_rtl_replacement: string -> bool (** Given the name of C library function return true if there is a drop-in replacement function for it in the RTL. *) end (* Rtl *) (* ************************************************************************** *) (** {2 Libc} Operations on functions belonging to standard library *) (* ************************************************************************** *) module Libc: sig val is_memcpy: exp -> bool (** Return [true] if [exp] captures a function name that matches [memcpy] or an equivalent function *) val is_memcpy_name: string -> bool (** Same as [is_memcpy] but for strings *) val is_memset: exp -> bool (** Return [true] if [exp] captures a function name that matches [memset] or an equivalent function *) val is_memset_name: string -> bool (** Same as [is_memset] but for strings *) val is_dyn_alloc: exp -> bool (** Return [true] if [exp] captures a function name that matches a function that dynamically allocates memory such as [malloc] or [calloc] *) val is_dyn_alloc_name: string -> bool (** Same as [is_dyn_alloc] but for strings *) val is_dyn_free: exp -> bool (** Return [true] if [exp] captures a function name that matches a function that dynamically deallocates memory (e.g., [free]) *) val is_dyn_free_name: string -> bool (** Same as [is_dyn_free] but for strings *) val is_vla_free: exp -> bool (** Return [true] if [exp] captures a function name that matches a function that allocates memory for a variable-size array. *) val is_vla_free_name: string -> bool (** Return [true] if [string] captures a function name that matches a function that deallocates memory for a variable-size array. *) val is_vla_alloc: exp -> bool (** Return [true] if [exp] captures a function name that matches a function that deallocates memory for a variable-size array. *) val is_vla_alloc_name: string -> bool (** Same as [is_dyn_alloc] but for strings *) val is_alloca: exp -> bool (** Return [true] if [exp] captures a function name that matches a function that allocates memory on stack. *) val is_alloca_name: string -> bool (** Same as [is_alloca] but for strings *) val is_printf: exp -> bool (** Return [true] if [exp] captures a function name that matches a printf-like function such as [printf], [fprintf], [dprintf] etc. *) val is_printf_name: string -> bool (** Same as [is_printf] but for strings *) val printf_fmt_position: string -> int (** Given the name of a printf-like function (as determined by [is_printf_name]) return the number of arguments preceding its variadic arguments. *) val get_printf_argument_str: loc:location -> string -> exp list -> exp (** Given the name of a printf-like function and the list of its variadic arguments return a literal string expression where each character describes the type of an argument from a list. Such characters are also called abbreviated types. Conversion between abbreviated and C types characters is as follows: - "b" -> [_Bool] - "c" -> [signed char] - "C" -> [unsigned char] - "d" -> [int] - "D" -> [unsigned int] - "h" -> [short] - "H" -> [unsigned short] - "l" -> [long] - "L" -> [unsigned long] - "r" -> [long long] - "R" -> [unsigned long long] - "f" -> [float] - "e" -> [double] - "E" -> [long double] - "s" -> [char*] - "i" -> [int*] - "p" -> [void*] *) val actual_alloca: string (** The name of an actual [alloca] function used at link-time. In GCC/Clang [alloca] is typically implemented via [__builtin_alloca] *) end (* Libc *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/gmp_types.ml0000666000000000000000000001032413571573400021733 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** GMP Values. *) open Cil_types (**************************************************************************) (***************************** GMP types***********************************) (**************************************************************************) let mk_dummy_type_info_ref () = ref { torig_name = ""; tname = ""; ttype = TVoid []; treferenced = false } module type S = sig val t: unit -> typ val t_as_ptr: unit -> typ val is_now_referenced: unit -> unit val is_t: typ -> bool end module Make(X: sig end) = struct let t_torig_ref = mk_dummy_type_info_ref () let t_struct_torig_ref = mk_dummy_type_info_ref () let set_t ty = t_torig_ref := ty let set_t_struct ty = t_struct_torig_ref := ty let is_now_referenced () = !t_torig_ref.treferenced <- true let t () = TNamed(!t_torig_ref, []) (* create a unique shared representation in order to use [==] in [is_t] *) let t_as_ptr_info = lazy { torig_name = ""; tname = !t_struct_torig_ref.tname ^ " *"; ttype = TArray( TNamed(!t_struct_torig_ref, []), Some (Cil.one ~loc:Cil_datatype.Location.unknown), {scache = Not_Computed}, []); treferenced = true; } let t_as_ptr () = TNamed (Lazy.force t_as_ptr_info, []) let is_t ty = match ty with | TNamed(tinfo, []) -> tinfo == !t_torig_ref || tinfo == Lazy.force t_as_ptr_info | _ -> false end module Z = Make(struct end) module Q = Make(struct end) (**************************************************************************) (******************* Initialization of mpz and mpq types ******************) (**************************************************************************) let init () = Options.feedback ~level:2 "initializing GMP types."; let set_mp_t = object (self) inherit Cil.nopCilVisitor (* exit after having initialized the 4 values (for Z.t and Q.t) *) val mutable visited = 0 method private set f info = f info; if visited = 3 then raise Exit else begin visited <- visited + 1; Cil.SkipChildren end method !vglob = function | GType({ torig_name = name } as info, _) -> if name = "__e_acsl_mpz_t" then self#set Z.set_t info else if name = "__e_acsl_mpz_struct" then self#set Z.set_t_struct info else if name = "__e_acsl_mpq_t" then self#set Q.set_t info else if name = "__e_acsl_mpq_struct" then self#set Q.set_t_struct info else Cil.SkipChildren | _ -> Cil.SkipChildren end in try Cil.visitCilFileSameGlobals set_mp_t (Ast.get ()) with Exit -> () frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/gmp_types.mli0000666000000000000000000000470013571573400022105 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** GMP Values. *) open Cil_types val init: unit -> unit (** Must be called before any use of GMP *) (**************************************************************************) (******************************** Types ***********************************) (**************************************************************************) (** Signature of a GMP type *) module type S = sig val t: unit -> typ (** @return the GMP type *) val t_as_ptr: unit -> typ (** type equivalent to [t] but seen as a pointer *) val is_now_referenced: unit -> unit (** Call this function when using this type for the first time. *) val is_t: typ -> bool (** @return true iff the given type is equivalent to the GMP type. *) end (** Representation of the unbounded integer type at runtime *) module Z: S (** Representation of the rational type at runtime *) module Q: S frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/misc.ml0000666000000000000000000002640013571573400020661 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module RTL = Functions.RTL open Cil_types open Cil_datatype (* ************************************************************************** *) (** {2 Handling the E-ACSL's C-libraries, part I} *) (* ************************************************************************** *) let library_files () = List.map (fun d -> Options.Share.file ~error:true d) [ "e_acsl_gmp_api.h"; "e_acsl.h" ] let normalized_library_files = lazy (List.map Datatype.Filepath.of_string (library_files ())) let is_library_loc (loc, _) = List.mem loc.Filepath.pos_path (Lazy.force normalized_library_files) let library_functions = Datatype.String.Hashtbl.create 17 let register_library_function vi = Datatype.String.Hashtbl.add library_functions vi.vname vi let reset () = Datatype.String.Hashtbl.clear library_functions (* ************************************************************************** *) (** {2 Builders} *) (* ************************************************************************** *) exception Unregistered_library_function of string let get_lib_fun_vi fname = try Datatype.String.Hashtbl.find library_functions fname with Not_found -> try Builtins.find fname with Not_found -> (* should not happen in normal mode, but could be raised when E-ACSL is used as a library *) raise (Unregistered_library_function fname) let mk_call ~loc ?result fname args = let vi = get_lib_fun_vi fname in let f = Cil.evar ~loc vi in vi.vreferenced <- true; let make_args args ty_params = List.map2 (fun (_, ty, _) arg -> let e = match ty, Cil.unrollType (Cil.typeOf arg), arg.enode with | TPtr _, TArray _, Lval lv -> Cil.new_exp ~loc (StartOf lv) | TPtr _, TArray _, _ -> assert false | _, _, _ -> arg in Cil.mkCast ~force:false ~newt:ty ~e) ty_params args in let args = match vi.vtype with | TFun(_, Some params, _, _) -> make_args args params | TFun(_, None, _, _) -> [] | _ -> assert false in Cil.mkStmtOneInstr ~valid_sid:true (Call(result, f, args, loc)) let mk_deref ~loc lv = Cil.new_exp ~loc (Lval(Mem(lv), NoOffset)) type annotation_kind = | Assertion | Precondition | Postcondition | Invariant | RTE let kind_to_string loc k = Cil.mkString ~loc (match k with | Assertion -> "Assertion" | Precondition -> "Precondition" | Postcondition -> "Postcondition" | Invariant -> "Invariant" | RTE -> "RTE") (* Build a C conditional doing a runtime assertion check. *) let mk_e_acsl_guard ?(reverse=false) kind kf e p = let loc = p.pred_loc in let msg = Kernel.Unicode.without_unicode (Format.asprintf "%a@?" Printer.pp_predicate) p in let line = (fst loc).Filepath.pos_lnum in let e = if reverse then e else Cil.new_exp ~loc:e.eloc (UnOp(LNot, e, Cil.intType)) in mk_call ~loc (RTL.mk_api_name "assert") [ e; kind_to_string loc kind; Cil.mkString ~loc (RTL.get_original_name kf); Cil.mkString ~loc msg; Cil.integer loc line ] let mk_block prj stmt b = let mk b = match b.bstmts with | [] -> (match stmt.skind with | Instr(Skip _) -> stmt | _ -> assert false) | [ s ] -> s | _ :: _ -> Cil.mkStmt ~valid_sid:true (Block b) in Project.on prj mk b (* ************************************************************************** *) (** {2 Handling \result} *) (* ************************************************************************** *) let result_lhost kf = let stmt = try Kernel_function.find_return kf with Kernel_function.No_Statement -> assert false in match stmt.skind with | Return(Some { enode = Lval (lhost, NoOffset) }, _) -> lhost | _ -> assert false let result_vi kf = match result_lhost kf with | Var vi -> vi | Mem _ -> assert false (* ************************************************************************** *) (** {2 Handling the E-ACSL's C-libraries, part II} *) (* ************************************************************************** *) let mk_full_init_stmt ?(addr=true) vi = let loc = vi.vdecl in let mk = mk_call ~loc (RTL.mk_api_name "full_init") in match addr, Cil.unrollType vi.vtype with | _, TArray(_,Some _, _, _) | false, _ -> mk [ Cil.evar ~loc vi ] | _ -> mk [ Cil.mkAddrOfVi vi ] let mk_initialize ~loc (host, offset as lv) = match host, offset with | Var _, NoOffset -> mk_call ~loc (RTL.mk_api_name "full_init") [ Cil.mkAddrOf ~loc lv ] | _ -> let typ = Cil.typeOfLval lv in mk_call ~loc (RTL.mk_api_name "initialize") [ Cil.mkAddrOf ~loc lv; Cil.new_exp loc (SizeOf typ) ] let mk_named_store_stmt name ?str_size vi = let ty = Cil.unrollType vi.vtype in let loc = vi.vdecl in let store = mk_call ~loc (RTL.mk_api_name name) in match ty, str_size with | TArray(_, Some _,_,_), None -> store [ Cil.evar ~loc vi ; Cil.sizeOf ~loc ty ] | TPtr(TInt(IChar, _), _), Some size -> store [ Cil.evar ~loc vi ; size ] | _, None -> store [ Cil.mkAddrOfVi vi ; Cil.sizeOf ~loc ty ] | _, Some _ -> assert false let mk_store_stmt ?str_size vi = mk_named_store_stmt "store_block" ?str_size vi let mk_duplicate_store_stmt ?str_size vi = mk_named_store_stmt "store_block_duplicate" ?str_size vi let mk_delete_stmt vi = let loc = vi.vdecl in let mk = mk_call ~loc (RTL.mk_api_name "delete_block") in match Cil.unrollType vi.vtype with | TArray(_, Some _, _, _) -> mk [ Cil.evar ~loc vi ] | _ -> mk [ Cil.mkAddrOfVi vi ] let mk_mark_readonly vi = let loc = vi.vdecl in mk_call ~loc (RTL.mk_api_name "mark_readonly") [ Cil.evar ~loc vi ] (* ************************************************************************** *) (** {2 Other stuff} *) (* ************************************************************************** *) let term_addr_of ~loc tlv ty = Logic_const.taddrof ~loc tlv (Ctype (TPtr(ty, []))) let reorder_ast () = let ast = Ast.get() in let is_from_library = function | GType(ti, _) when ti.tname = "size_t" || ti.tname = "FILE" || RTL.is_rtl_name ti.tname -> true | GCompTag (ci, _) when RTL.is_rtl_name ci.cname -> true | GFunDecl(_, _, loc) | GVarDecl(_, loc) when is_library_loc loc -> true | _ -> false in let rtl, other = List.partition is_from_library ast.globals in ast.globals <- rtl @ other let cty = function | Ctype ty -> ty | lty -> Options.fatal "Expecting a C type. Got %a" Printer.pp_logic_type lty let rec ptr_index ?(loc=Location.unknown) ?(index=(Cil.zero loc)) exp = let arith_op = function | MinusPI -> MinusA | PlusPI -> PlusA | IndexPI -> PlusA | _ -> assert false in match exp.enode with | BinOp(op, lhs, rhs, _) -> (match op with (* Pointer arithmetic: split pointer and integer parts *) | MinusPI | PlusPI | IndexPI -> let index = Cil.mkBinOp exp.eloc (arith_op op) index rhs in ptr_index ~index lhs (* Other arithmetic: treat the whole expression as pointer address *) | MinusPP | PlusA | MinusA | Mult | Div | Mod | BAnd | BXor | BOr | Shiftlt | Shiftrt | Lt | Gt | Le | Ge | Eq | Ne | LAnd | LOr -> (exp, index)) | CastE _ -> ptr_index ~loc ~index (Cil.stripCasts exp) | Info (exp, _) -> ptr_index ~loc ~index exp | Const _ | StartOf _ | AddrOf _ | Lval _ | UnOp _ -> (exp, index) | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> assert false (* TODO: should not be in this file *) let term_of_li li = match li.l_body with | LBterm t -> t | LBnone | LBreads _ | LBpred _ | LBinductive _ -> Options.fatal "li.l_body does not match LBterm(t) in Misc.term_of_li" let is_set_of_ptr_or_array lty = if Logic_const.is_set_type lty then let lty = Logic_const.type_of_element lty in Logic_utils.isLogicPointerType lty || Logic_utils.isLogicArrayType lty else false exception Range_found_exception let is_range_free t = try let has_range_visitor = object inherit Visitor.frama_c_inplace method !vterm t = match t.term_node with | Trange _ -> raise Range_found_exception | _ -> Cil.DoChildren end in ignore (Visitor.visitFramacTerm has_range_visitor t); true with Range_found_exception -> false let is_bitfield_pointers lty = let is_bitfield_pointer = function | Ctype typ -> begin match Cil.unrollType typ with | TPtr(typ, _) -> let attrs = Cil.typeAttrs typ in Cil.hasAttribute Cil.bitfield_attribute_name attrs | _ -> false end | Ltype _ | Lvar _ | Linteger | Lreal | Larrow _ -> false in if Logic_const.is_set_type lty then is_bitfield_pointer (Logic_const.type_of_element lty) else is_bitfield_pointer lty exception Lv_from_vi_found let term_has_lv_from_vi t = try let o = object inherit Visitor.frama_c_inplace method !vlogic_var_use lv = match lv.lv_origin with | None -> Cil.DoChildren | Some _ -> raise Lv_from_vi_found end in ignore (Visitor.visitFramacTerm o t); false with Lv_from_vi_found -> true type pred_or_term = PoT_pred of predicate | PoT_term of term let mk_ptr_sizeof typ loc = match Cil.unrollType typ with | TPtr (t', _) -> Cil.new_exp ~loc (SizeOf t') | _ -> assert false let finite_min_and_max i = match Ival.min_and_max i with | Some min, Some max -> min, max | None, _ | _, None -> assert false let name_of_binop = function | Lt -> "lt" | Gt -> "gt" | Le -> "le" | Ge -> "ge" | Eq -> "eq" | Ne -> "ne" | LOr -> "or" | LAnd -> "and" | BOr -> "bor" | BXor -> "bxor" | BAnd -> "band" | Shiftrt -> "shiftr" | Shiftlt -> "shiftl" | Mod -> "mod" | Div -> "div" | Mult -> "mul" | PlusA -> "add" | MinusA -> "sub" | MinusPP | MinusPI | IndexPI | PlusPI -> assert false (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/misc.mli0000666000000000000000000001307313571573400021034 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Utilities for E-ACSL. *) open Cil_types open Cil_datatype (* ************************************************************************** *) (** {2 Builders} *) (* ************************************************************************** *) exception Unregistered_library_function of string val get_lib_fun_vi: string -> varinfo (** Return varinfo corresponding to a name of a given library function *) val mk_call: loc:Location.t -> ?result:lval -> string -> exp list -> stmt (** Call an E-ACSL library function or an E-ACSL built-in. @raise Unregistered_library_function if the given string does not represent such a function or if these functions were never registered (only possible when using E-ACSL through its API. *) val mk_deref: loc:Location.t -> exp -> exp (** Make a dereference of an expression *) type annotation_kind = | Assertion | Precondition | Postcondition | Invariant | RTE val mk_e_acsl_guard: ?reverse:bool -> annotation_kind -> kernel_function -> exp -> predicate -> stmt val mk_block: Project.t -> stmt -> block -> stmt (* ************************************************************************** *) (** {2 Handling \result} *) (* ************************************************************************** *) val result_lhost: kernel_function -> lhost (** @return the lhost corresponding to \result in the given function *) val result_vi: kernel_function -> varinfo (** @return the varinfo corresponding to \result in the given function *) (* ************************************************************************** *) (** {2 Handling the E-ACSL's C-libraries} *) (* ************************************************************************** *) val library_files: unit -> string list val is_library_loc: location -> bool val register_library_function: varinfo -> unit val reset: unit -> unit val mk_store_stmt: ?str_size:exp -> varinfo -> stmt val mk_duplicate_store_stmt: ?str_size:exp -> varinfo -> stmt val mk_delete_stmt: varinfo -> stmt val mk_full_init_stmt: ?addr:bool -> varinfo -> stmt val mk_initialize: loc:location -> lval -> stmt val mk_mark_readonly: varinfo -> stmt (* ************************************************************************** *) (** {2 Other stuff} *) (* ************************************************************************** *) val term_addr_of: loc:location -> term_lval -> typ -> term val reorder_ast: unit -> unit (* Reorder current AST by bringing all global declarations belonging to the * E-ACSL runtime library and their dependencies (e.g., typedef size_t) to * the very top of the file. *) val cty: logic_type -> typ (** Assume that the logic type is indeed a C type. Just return it. *) val ptr_index: ?loc:location -> ?index:exp -> exp -> Cil_types.exp * Cil_types.exp (** Split pointer-arithmetic expression of the type `p + i` into its pointer and integer parts. *) val term_of_li: logic_info -> term (** [term_of_li li] assumes that [li.l_body] matches [LBterm t] and returns [t]. *) val is_set_of_ptr_or_array: logic_type -> bool (** Checks whether the given logic type is a set of pointers. *) val is_range_free: term -> bool (** Returns [true] iff the given term does not contain any range. *) val is_bitfield_pointers: logic_type -> bool (** Returns [true] iff the given logic type is a bitfield pointer or a set of bitfield pointers. *) val term_has_lv_from_vi: term -> bool (** Return [true] iff the given term contains a variables that originates from a C varinfo, that is a non-purely logic variable. *) type pred_or_term = PoT_pred of predicate | PoT_term of term val mk_ptr_sizeof: typ -> location -> exp (** [mk_ptr_sizeof ptr_typ loc] takes the pointer typ [ptr_typ] that points to a [typ] typ and returns [sizeof(typ)]. *) val name_of_binop: binop -> string (** Returns the name of the given binop as a string *) val finite_min_and_max: Ival.t -> Integer.t * Integer.t (** [finite_min_and_max i] takes the finite ival [i] and returns its bounds *) (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/varname.ml0000666000000000000000000000406413571573400021361 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type scope = | Global | Function | Block module H = Datatype.String.Hashtbl let tbl = H.create 7 let globals = H.create 7 let get ~scope s = let _, u = Extlib.make_unique_name (fun s -> H.mem tbl s || H.mem globals s) ~sep:"_" s in let add = match scope with | Global -> H.add globals | Function | Block -> H.add tbl in add u (); u let clear_locals () = H.clear tbl (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/libraries/varname.mli0000666000000000000000000000374313571573400021535 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Variable name generator wrt a lexical scope. *) type scope = | Global | Function | Block val get: scope:scope -> string -> string (** @return a fresh variable name for the given scope wrt the given name. *) val clear_locals: unit -> unit (** Reset the generator for variables that are local to a block or a function. *) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/local_config.mli0000666000000000000000000000323613571573400020544 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val version: string (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/main.ml0000666000000000000000000002276613571573400016711 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let check () = Visitor.visitFramacFileSameGlobals (Visit.do_visit false) (Ast.get ()); let t = Error.nb_untypable () in let n = Error.nb_not_yet () in let print msg n = Options.result "@[%d annotation%s %s ignored,@ being %s.@]" n (if n > 1 then "s" else "") (if n > 1 then "were" else "was") msg in print "untypable" t; print "unsupported" n; n + t = 0 let check = Dynamic.register ~plugin:"e-acsl" ~journalize:true "check" (Datatype.func Datatype.unit Datatype.bool) check type extended_project = | To_be_extended | Already_extended of Project.t option (* None = keep the current project *) let extended_ast_project: extended_project ref = ref To_be_extended let unmemoized_extend_ast () = let extend () = let share = Options.Share.dir ~error:true () in Options.feedback ~level:3 "setting kernel options for E-ACSL."; Kernel.CppExtraArgs.add (Format.asprintf " -DE_ACSL_MACHDEP=%s -I%s/memory_model" (Kernel.Machdep.get ()) share); Kernel.Keep_unused_specified_functions.off (); if Plugin.is_present "variadic-translation" then Dynamic.Parameter.Bool.off "-variadic-translation" (); let ppc, ppk = File.get_preprocessor_command () in let register s = File.pre_register (File.NeedCPP (s, ppc ^ Format.asprintf " -I%s" share, ppk)) in List.iter register (Misc.library_files ()) in if Ast.is_computed () then begin (* do not modify the existing project: work on a copy. Must also extend the current AST with the E-ACSL's library files. *) Options.feedback ~level:2 "AST already computed: \ E-ACSL is going to work on a copy."; let name = Project.get_name (Project.current ()) in let tmpfile = Extlib.temp_file_cleanup_at_exit ("e_acsl_" ^ name) ".i" in let cout = open_out tmpfile in let fmt = Format.formatter_of_out_channel cout in File.pretty_ast ~fmt (); let selection = State_selection.diff State_selection.full (State_selection.with_dependencies Ast.self) in let prj = Project.create_by_copy ~last:false ~selection (Format.asprintf "%s for E-ACSL" name) in Project.on prj (fun () -> Kernel.Files.set [ tmpfile ]; extend ()) (); Some prj end else begin extend (); None end let extend_ast () = match !extended_ast_project with | To_be_extended -> let prj = unmemoized_extend_ast () in extended_ast_project := Already_extended prj; (match prj with | None -> Project.current () | Some prj -> prj) | Already_extended None -> Project.current () | Already_extended(Some prj) -> prj let apply_on_e_acsl_ast f x = let tmp_prj = extend_ast () in let res = Project.on tmp_prj f x in (match !extended_ast_project with | To_be_extended -> assert false | Already_extended None -> () | Already_extended (Some prj) -> assert (Project.equal prj tmp_prj); extended_ast_project := To_be_extended; if Options.Debug.get () = 0 then Project.remove ~project:tmp_prj ()); res module Resulting_projects = State_builder.Hashtbl (Datatype.String.Hashtbl) (Project.Datatype) (struct let name = "E-ACSL resulting projects" let size = 7 let dependencies = Ast.self :: Options.parameter_states end) let () = State_dependency_graph.add_dependencies ~from:Resulting_projects.self [ Label.self ] let generate_code = Resulting_projects.memo (fun name -> apply_on_e_acsl_ast (fun () -> Options.feedback "beginning translation."; Temporal.enable (Options.Temporal_validity.get ()); let prepared_prj = Prepare_ast.prepare () in let res = Project.on prepared_prj (fun () -> let dup_prj = Dup_functions.dup () in let res = Project.on dup_prj (fun () -> Gmp_types.init (); Mmodel_analysis.reset (); let visit prj = Visit.do_visit ~prj true in let prj = File.create_project_from_visitor name visit in Loops.apply_after_transformation prj; (* remove the RTE's results computed from E-ACSL: their are partial and associated with the wrong kernel function (the one of the old project). *) let selection = State_selection.with_dependencies !Db.RteGen.self in Project.clear ~selection ~project:prj (); Resulting_projects.mark_as_computed (); let selection = State_selection.singleton Kernel.Files.self in Project.copy ~selection prj; prj) () in if Options.Debug.get () = 0 then Project.remove ~project:dup_prj (); res) () in if Options.Debug.get () = 0 then begin Project.remove ~project:prepared_prj (); end; Options.feedback "translation done in project \"%s\"." (Options.Project_name.get ()); res) ()) let generate_code = Dynamic.register ~plugin:"E_ACSL" ~journalize:true "generate_code" (Datatype.func Datatype.string Project.ty) generate_code let predicate_to_exp = Dynamic.register ~plugin:"E_ACSL" ~journalize:false "predicate_to_exp" (Datatype.func2 Kernel_function.ty Cil_datatype.Predicate.ty Cil_datatype.Exp.ty) Translate.predicate_to_exp let add_e_acsl_library _files = if Options.must_visit () || Options.Prepare.get () then ignore (extend_ast ()) (* extending the AST as soon as possible reduce the amount of time the AST is duplicated: - that is faster - locations are better (indicate an existing file, and not a temp file) *) let () = Cmdline.run_after_configuring_stage add_e_acsl_library (* The Frama-C standard library contains specific built-in variables prefixed by "__fc_" and declared as extern: they prevent the generated code to be linked. This modification of the default printer replaces them by their original version from the stdlib. For instance, [__fc_stdout] is replaced by [stdout]. That is very hackish since it modifies the default Frama-C printer. TODO: should be done by the Frama-C default printer at some points. *) let change_printer = (* not projectified on purpose: this printer change is common to each project. *) let first = ref true in fun () -> if !first then begin first := false; let r = Str.regexp "^__fc_" in let module Printer_class(X: Printer.PrinterClass) = struct class printer = object inherit X.printer as super method !varinfo fmt vi = if vi.Cil_types.vghost || vi.Cil_types.vstorage <> Cil_types.Extern then super#varinfo fmt vi else let s = Str.replace_first r "" vi.Cil_types.vname in Format.fprintf fmt "%s" s end end in Printer.update_printer (module Printer_class: Printer.PrinterExtension) end let main () = Keep_status.clear (); if Options.Run.get () then begin change_printer (); ignore (generate_code (Options.Project_name.get ())) end else if Options.Check.get () then apply_on_e_acsl_ast (fun () -> Gmp_types.init (); ignore (check ())) () let () = Db.Main.extend main (* Local Variables: compile-command: "make -C .." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/options.ml0000666000000000000000000001236113571573400017446 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let () = Plugin.is_share_visible () module P = Plugin.Register (struct let name = "E-ACSL" let shortname = "e-acsl" let help = "Executable ANSI/ISO C Specification Language --- runtime \ assertion checker generator" end) module PP = P (* [PP] required to avoid an ocamldoc error in OCaml 4.02 *) include PP module Check = False (struct let option_name = "-e-acsl-check" let help = "only type check E-ACSL annotated program" end) module Run = False (struct let option_name = "-e-acsl" let help = "generate a new project where E-ACSL annotations are \ translated to executable C code" end) module Project_name = String (struct let option_name = "-e-acsl-project" let help = "the name of the generated project is \ (default to \"e-acsl\")" let default = "e-acsl" let arg_name = "prj" end) module Valid = False (struct let option_name = "-e-acsl-valid" let help = "translate annotation which have been proven valid" end) module Prepare = False (struct let option_name = "-e-acsl-prepare" let help = "prepare the AST to be directly usable by E-ACSL" end) module Gmp_only = False (struct let option_name = "-e-acsl-gmp-only" let help = "always use GMP integers instead of C integral types" end) module Temporal_validity = False (struct let option_name = "-e-acsl-temporal-validity" let help = "enable temporal analysis in valid annotations" end) module Validate_format_strings = False (struct let option_name = "-e-acsl-validate-format-strings" let help = "enable runtime validation of stdio.h format functions" end) module Replace_libc_functions = False (struct let option_name = "-e-acsl-replace-libc-functions" let help = "replace some libc functions (such as strcpy) with built-in\ RTL alternatives" end) module Full_mmodel = False (struct let option_name = "-e-acsl-full-mmodel" let help = "maximal memory-related instrumentation" end) module Builtins = String_set (struct let option_name = "-e-acsl-builtins" let arg_name = "" let help = "C functions which can be used in the E-ACSL specifications" end) module Functions = Kernel_function_set (struct let option_name = "-e-acsl-functions" let arg_name = "f1, ..., fn" let help = "only annotations in functions f1, ..., fn are checked at \ runtime" end) module Instrument = Kernel_function_set (struct let option_name = "-e-acsl-instrument" let arg_name = "f1, ..., fn" let help = "only instrument functions f1, ..., fn. \ Be aware that runtime verdicts may become partial." end) let () = Parameter_customize.set_group help module Version = False (struct let option_name = "-e-acsl-version" let help = "version of plug-in E-ACSL" end) let version () = if Version.get () then begin Log.print_on_output (fun fmt -> Format.fprintf fmt "Version of plug-in E-ACSL: %s@?" Local_config.version); raise Cmdline.Exit end let () = Cmdline.run_after_configuring_stage version let parameter_states = [ Valid.self; Gmp_only.self; Full_mmodel.self; Builtins.self; Temporal_validity.self; Validate_format_strings.self; Functions.self; Instrument.self ] let must_visit () = Run.get () || Check.get () let dkey_analysis = register_category "analysis" let dkey_dup = register_category "duplication" let dkey_translation = register_category "translation" let dkey_typing = register_category "typing" (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/options.mli0000666000000000000000000000462413571573400017622 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S (** implementation of Log.S for E-ACSL *) module Check: Parameter_sig.Bool module Run: Parameter_sig.Bool module Valid: Parameter_sig.Bool module Prepare: Parameter_sig.Bool module Gmp_only: Parameter_sig.Bool module Full_mmodel: Parameter_sig.Bool module Project_name: Parameter_sig.String module Builtins: Parameter_sig.String_set module Temporal_validity: Parameter_sig.Bool module Validate_format_strings: Parameter_sig.Bool module Replace_libc_functions: Parameter_sig.Bool module Functions: Parameter_sig.Kernel_function_set module Instrument: Parameter_sig.Kernel_function_set val parameter_states: State.t list val must_visit: unit -> bool val dkey_analysis: category val dkey_dup: category val dkey_translation: category val dkey_typing: category (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/project_initializer/0000777000000000000000000000000013571573400021467 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/src/project_initializer/dup_functions.ml0000666000000000000000000003507613571573400024714 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types let dkey = Options.dkey_dup (* ********************************************************************** *) (* Environment *) (* ********************************************************************** *) let fct_tbl: unit Kernel_function.Hashtbl.t = Kernel_function.Hashtbl.create 7 let actions = Queue.create () module Global: sig val add_logic_info: logic_info -> unit val mem_logic_info: logic_info -> bool val reset: unit -> unit end = struct let tbl = Cil_datatype.Logic_info.Hashtbl.create 7 let add_logic_info x = Cil_datatype.Logic_info.Hashtbl.add tbl x () let mem_logic_info x = Cil_datatype.Logic_info.Hashtbl.mem tbl x let reset () = Cil_datatype.Logic_info.Hashtbl.clear tbl end let reset () = Kernel_function.Hashtbl.clear fct_tbl; Global.reset (); Queue.clear actions (* ********************************************************************** *) (* Duplicating functions *) (* ********************************************************************** *) let dup_funspec tbl bhv spec = (* Options.feedback "DUP SPEC %a" Cil.d_funspec spec;*) let o = object inherit Cil.genericCilVisitor bhv val already_visited = Cil_datatype.Logic_var.Hashtbl.create 7 method !vlogic_info_use li = if Global.mem_logic_info li then Cil.ChangeDoChildrenPost ({ li with l_var_info = li.l_var_info } (* force a copy *), Visitor_behavior.Get.logic_info bhv) else Cil.JustCopy method !vterm_offset _ = Cil.DoChildrenPost (function (* no way to directly visit fieldinfo and model_info uses *) | TField(fi, off) -> TField(Visitor_behavior.Get.fieldinfo bhv fi, off) | TModel(mi, off) -> TModel(Visitor_behavior.Get.model_info bhv mi, off) | off -> off) method !vlogic_var_use orig_lvi = match orig_lvi.lv_origin with | None -> Cil.JustCopy | Some vi -> try let new_lvi = Cil_datatype.Logic_var.Hashtbl.find already_visited orig_lvi in Cil.ChangeTo new_lvi with Not_found -> Cil.ChangeDoChildrenPost ({ orig_lvi with lv_id = orig_lvi.lv_id } (* force a copy *), fun lvi -> (* using [Visitor_behavior.Get.logic_var bhv lvi] is correct only because the lv_id used to compare the lvi does not change between the original one and this copy *) try let new_vi = Cil_datatype.Varinfo.Hashtbl.find tbl vi in Cil_datatype.Logic_var.Hashtbl.add already_visited orig_lvi lvi; lvi.lv_id <- new_vi.vid; lvi.lv_name <- new_vi.vname; lvi.lv_origin <- Some new_vi; new_vi.vlogic_var_assoc <- Some lvi; lvi with Not_found -> assert vi.vglob; Visitor_behavior.Get.logic_var bhv lvi) method !videntified_term _ = Cil.DoChildrenPost Logic_const.refresh_identified_term method !videntified_predicate _ = Cil.DoChildrenPost Logic_const.refresh_predicate end in Cil.visitCilFunspec o spec let dup_fundec loc spec bhv sound_verdict_vi kf vi new_vi = new_vi.vdefined <- true; let formals = Kernel_function.get_formals kf in let mk_formal vi = let name = if vi.vname = "" then (* unnamed formal parameter: must generate a fresh name since a fundec cannot have unnamed formals (see bts #2303). *) Varname.get ~scope:Varname.Function (Functions.RTL.mk_gen_name "unamed_formal") else vi.vname in Cil.copyVarinfo vi name in let new_formals = List.map mk_formal formals in let res = let ty = Kernel_function.get_return_type kf in if Cil.isVoidType ty then None else Some (Cil.makeVarinfo false false ~referenced:true "__retres" ty) in let return = Cil.mkStmt ~valid_sid:true (Return(Extlib.opt_map (Cil.evar ~loc) res, loc)) in let stmts = let l = [ Cil.mkStmtOneInstr ~valid_sid:true (Call(Extlib.opt_map Cil.var res, Cil.evar ~loc vi, List.map (Cil.evar ~loc) new_formals, loc)); return ] in if Functions.instrument kf then l else (* set the 'unsound_verdict' variable to 'false' whenever required *) let unsound = Cil.mkStmtOneInstr ~valid_sid:true (Set((Var sound_verdict_vi, NoOffset), Cil.zero ~loc, loc)) in unsound :: l in let locals = match res with None -> [] | Some r -> [ r ] in let body = Cil.mkBlock stmts in body.blocals <- locals; let tbl = Cil_datatype.Varinfo.Hashtbl.create 7 in List.iter2 (Cil_datatype.Varinfo.Hashtbl.add tbl) formals new_formals; let new_spec = dup_funspec tbl bhv spec in { svar = new_vi; sformals = new_formals; slocals = locals; smaxid = List.length new_formals; sbody = body; smaxstmtid = None; sallstmts = []; sspec = new_spec } let dup_global loc actions spec bhv sound_verdict_vi kf vi new_vi = let name = vi.vname in Options.feedback ~dkey ~level:2 "entering in function %s" name; let fundec = dup_fundec loc spec bhv sound_verdict_vi kf vi new_vi in let fct = Definition(fundec, loc) in let new_spec = fundec.sspec in let new_kf = { fundec = fct; spec = new_spec } in Queue.add (fun () -> Kernel_function.Hashtbl.add fct_tbl new_kf (); Globals.Functions.register new_kf; Globals.Functions.replace_by_definition new_spec fundec loc; Annotations.register_funspec new_kf) actions; Options.feedback ~dkey ~level:2 "function %s" name; (* remove the specs attached to the previous kf iff it is a definition: it is necessary to keep stable the number of annotations in order to get [Keep_status] working fine. *) let kf = Visitor_behavior.Get.kernel_function bhv kf in if Kernel_function.is_definition kf then begin Queue.add (fun () -> let bhvs = Annotations.fold_behaviors (fun e b acc -> (e, b) :: acc) kf [] in List.iter (fun (e, b) -> Annotations.remove_behavior ~force:true e kf b) bhvs; Annotations.iter_decreases (fun e _ -> Annotations.remove_decreases e kf) kf; Annotations.iter_terminates (fun e _ -> Annotations.remove_terminates e kf) kf; Annotations.iter_complete (fun e l -> Annotations.remove_complete e kf l) kf; Annotations.iter_disjoint (fun e l -> Annotations.remove_disjoint e kf l) kf) actions end; GFun(fundec, loc), GFunDecl(new_spec, new_vi, loc) (* ********************************************************************** *) (* Visitor *) (* ********************************************************************** *) type position = Before_gmp | Gmpz | After_gmp | Memory_model | Code class dup_functions_visitor prj = object (self) inherit Visitor.frama_c_copy prj val unduplicable_functions = let white_list = [ "__builtin_va_arg"; "__builtin_va_end"; "__builtin_va_start"; "__builtin_va_copy" ] in List.fold_left (fun acc s -> Datatype.String.Set.add s acc) Datatype.String.Set.empty white_list val fct_tbl = Cil_datatype.Varinfo.Hashtbl.create 7 val mutable before_memory_model = Before_gmp val mutable new_definitions: global list = [] (* new definitions of the annotated functions which will contain the translation of the E-ACSL contract *) val mutable sound_verdict_vi = let name = Functions.RTL.mk_api_name "sound_verdict" in let vi = Project.on prj (Cil.makeGlobalVar name) Cil.intType in vi.vstorage <- Extern; vi.vreferenced <- true; vi method private before_memory_model = match before_memory_model with | Before_gmp | Gmpz | After_gmp -> true | Memory_model | Code -> false method private insert_libc l = match new_definitions with | [] -> l | _ :: _ -> (* add the generated definitions of libc at the end of [l]. This way, we are sure that they have access to all of it (in particular, the memory model, GMP and the soundness variable). Also add the [__e_acsl_sound_verdict] variable at the beginning *) let res = GVarDecl(sound_verdict_vi, Cil_datatype.Location.unknown) :: l @ new_definitions in new_definitions <- []; res method private next () = match before_memory_model with | Before_gmp -> () | Gmpz -> before_memory_model <- After_gmp | After_gmp -> () | Memory_model -> before_memory_model <- Code | Code -> () method !vlogic_info_decl li = Global.add_logic_info li; Cil.JustCopy method !vvrbl vi = try let new_vi = Cil_datatype.Varinfo.Hashtbl.find fct_tbl vi in Cil.ChangeTo new_vi with Not_found -> Cil.JustCopy method private is_unvariadic_function vi = match Cil.unrollType vi.vtype with | TFun(_, _, variadic, _) -> not variadic | _ -> false method !vglob_aux = function | GFunDecl(_, vi, loc) | GFun({ svar = vi }, loc) when (* duplicate a function iff: *) not (Cil_datatype.Varinfo.Hashtbl.mem fct_tbl vi) (* it is not already duplicated *) && not (Datatype.String.Set.mem vi.vname unduplicable_functions) (* it is duplicable *) && self#is_unvariadic_function vi (* it is not a variadic function *) && not (Misc.is_library_loc loc) (* it is not in the E-ACSL's RTL *) && not (Cil.is_builtin vi) (* it is not a Frama-C built-in *) && (let kf = try Globals.Functions.get vi with Not_found -> assert false in not (Functions.instrument kf) (* either explicitely listed as to be not instrumented *) || (* or: *) (not (Cil.is_empty_funspec (Annotations.funspec ~populate:false (Extlib.the self#current_kf))) (* it has a function contract *) && Functions.check kf (* its annotations must be monitored *))) -> self#next (); let name = Functions.RTL.mk_gen_name vi.vname in let new_vi = Project.on prj (Cil.makeGlobalVar name) vi.vtype in Cil_datatype.Varinfo.Hashtbl.add fct_tbl vi new_vi; Cil.DoChildrenPost (fun l -> match l with | [ GVarDecl(vi, _) | GFunDecl(_, vi, _) | GFun({ svar = vi }, _) as g ] -> (match g with | GFunDecl _ -> if not (Kernel_function.is_definition (Extlib.the self#current_kf)) && vi.vname <> "malloc" && vi.vname <> "free" then Options.warning "@[annotating undefined function `%a':@ \ the generated program may miss memory instrumentation@ \ if there are memory-related annotations.@]" Printer.pp_varinfo vi | GFun _ -> () | _ -> assert false); let tmp = vi.vname in if tmp = Kernel.MainFunction.get () then begin (* the new function becomes the new main: simply swap the name of both functions *) vi.vname <- new_vi.vname; new_vi.vname <- tmp end; let kf = try Globals.Functions.get (Visitor_behavior.Get_orig.varinfo self#behavior vi) with Not_found -> Options.fatal "unknown function `%s' while trying to duplicate it" vi.vname in let spec = Annotations.funspec ~populate:false kf in let vi_bhv = Visitor_behavior.Get.varinfo self#behavior vi in let new_g, new_decl = dup_global loc self#get_filling_actions spec self#behavior sound_verdict_vi kf vi_bhv new_vi in (* postpone the introduction of the new function definition to the end *) new_definitions <- new_g :: new_definitions; (* put the declaration before the original function in order to solve issue with recursive functions *) [ new_decl; g ] | _ -> assert false) | GVarDecl(_, loc) | GFunDecl(_, _, loc) | GFun(_, loc) when Misc.is_library_loc loc -> (match before_memory_model with | Before_gmp -> before_memory_model <- Gmpz | Gmpz | Memory_model -> () | After_gmp -> before_memory_model <- Memory_model | Code -> () (* still processing the GMP and memory model headers, but reading some libc code *)); Cil.JustCopy | GVarDecl(vi, _) | GFunDecl(_, vi, _) | GFun({ svar = vi }, _) when Cil.is_builtin vi -> self#next (); Cil.JustCopy | _ -> self#next (); Cil.DoChildren method !vfile _ = Cil.DoChildrenPost (fun f -> match new_definitions with | [] -> f | _ :: _ -> (* required by the few cases where there is no global tagged as [Code] in the file. *) f.globals <- self#insert_libc f.globals; f) initializer Project.copy ~selection:(Parameter_state.get_selection ()) prj; reset () end let dup () = Options.feedback ~level:2 "duplicating annotated functions"; let prj = File.create_project_from_visitor "e_acsl_dup_functions" (new dup_functions_visitor) in Queue.iter (fun f -> f ()) actions; prj (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/project_initializer/dup_functions.mli0000666000000000000000000000324513571573400025056 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val dup: unit -> Project.t (* Local Variables: compile-command: "make" End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/project_initializer/keep_status.ml0000666000000000000000000001405613571573400024356 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* E-ACSL needs to access to the property status of every property (in particular for the option -e-acsl-valid). However, the necessary elements for building a property are copied/modified several times from the original project to the final project and the property statuses are destroyed when creating the intermediate projects; so there is no easy way to access to property statuses from the final project. This module aims at solving this issue by providing an access to property statuses from the final project. To work properly, it requires to visit every property during the final visit in the very same order than during the AST preparation visit. Indeed, for each function, it associates to each property an unique integer corresponding to its visit ordering. *) (* the kind is only used for a few additional consistency checks between [push] and [must_translate]*) type kind = | K_Assert | K_Invariant | K_Variant | K_StmtSpec | K_Allocation | K_Assigns | K_Decreases | K_Terminates | K_Complete | K_Disjoint | K_Requires | K_Ensures let pretty_kind fmt k = Format.fprintf fmt "%s" (match k with | K_Assert -> "assert" | K_Invariant -> "invariant" | K_Variant -> "variant" | K_StmtSpec -> "stmtspec" | K_Allocation -> "allocation" | K_Assigns -> "assigns" | K_Decreases -> "decreases" | K_Terminates -> "terminates" | K_Complete -> "complete" | K_Disjoint -> "disjoint" | K_Requires -> "requires" | K_Ensures -> "ensures") (* information attached to every kernel_function containing an annotation *) type kf_info = { mutable cpt: int; (* counter building the relationship between [push] and [must_translate *) mutable statuses: (kind * bool) Datatype.Int.Map.t (* map associating a property as an integer to its kind and status ([true] = proved) *) } (* statuses for each function represented by its name (because the [kf] itself changes from a project to another). *) let keep_status : kf_info Datatype.String.Hashtbl.t = Datatype.String.Hashtbl.create 17 (* will contain the value of a few options from the original project in order to safely use them from the final project. *) let option_valid = ref false let option_check = ref false let clear () = Datatype.String.Hashtbl.clear keep_status; option_valid := Options.Valid.get (); option_check := Options.Check.get () let push kf kind ppt = (* Options.feedback "PUSHING %a for %a" pretty_kind kind Kernel_function.pretty kf;*) (* no registration when -e-acsl-check or -e-acsl-valid *) if not (!option_check || !option_valid) then let keep = let open Property_status in match get ppt with | Never_tried | Inconsistent _ | Best ((False_if_reachable | False_and_reachable | Dont_know), _) -> true | Best (True, _) -> false in let status = kind, keep in let name = Kernel_function.get_name kf in try let info = Datatype.String.Hashtbl.find keep_status name in info.cpt <- info.cpt + 1; info.statuses <- Datatype.Int.Map.add info.cpt status info.statuses with Not_found -> let info = { cpt = 1; statuses = Datatype.Int.Map.singleton 1 status } in Datatype.String.Hashtbl.add keep_status name info let before_translation () = (* reset all counters *) Datatype.String.Hashtbl.iter (fun _ info -> info.cpt <- 0) keep_status let must_translate kf kind = (* Options.feedback "GETTING %a for %a" pretty_kind kind Kernel_function.pretty kf;*) !option_check || !option_valid || (* function contracts have been moved from the original function to its duplicate by [Dup_function] but they are still associated to the original function here *) let name = Functions.RTL.get_original_name kf in try let info = try Datatype.String.Hashtbl.find keep_status name with Not_found -> Options.fatal "[keep_status] unbound function" Datatype.String.pretty kf in info.cpt <- info.cpt + 1; let kind', keep = try Datatype.Int.Map.find info.cpt info.statuses with Not_found -> Options.fatal "[keep_status] unbound annotation (id %d)" info.cpt in (* check kind consistency in order to detect more abnormal behaviors *) if kind <> kind' then Options.fatal "[keep_status] incorrect kind '%a' (expected: '%a')" pretty_kind kind pretty_kind kind'; keep with Not_found -> true frama-c-20.0-Calcium/src/plugins/e-acsl/src/project_initializer/keep_status.mli0000666000000000000000000000511013571573400024516 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Make the property statuses of the initial project accessible when doing the main translation *) type kind = | K_Assert | K_Invariant | K_Variant | K_StmtSpec | K_Allocation | K_Assigns | K_Decreases | K_Terminates (* TODO: should be removed: not part of the E-ACSL subset *) | K_Complete | K_Disjoint | K_Requires | K_Ensures val clear: unit -> unit (** to be called before any program transformation *) val push: Kernel_function.t -> kind -> Property.t -> unit (** store the given property of the given kind for the given function *) val before_translation: unit -> unit (** to be called just before the main translation *) val must_translate: Kernel_function.t -> kind -> bool (** To be called just before transforming a property of the given kind for the given function. VERY IMPORTANT: the property of the n-th call to this function exactly correspond to the n-th pushed property (see {!push}). @return true if and only if the translation must occur. *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/project_initializer/prepare_ast.ml0000666000000000000000000002072513571573400024334 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types exception Alignment_error of string let align_error s = raise (Alignment_error s) (* Returns true if the list of attributes [attrs] contains an [align] * attribute of [algn] or greater. Returns false otherwise. * Throws an exception if * - [attrs] contains several [align] attributes specifying different * alignment * - [attrs] has a single align attribute with a value which is less than [algn] *) let sufficiently_aligned attrs algn = let alignment = List.fold_left (fun acc attr -> match attr with | Attr("align", [AInt i]) -> let alignment = Integer.to_int i in if acc <> 0 && acc <> alignment then (* Multiple align attributes with different values *) align_error "Multiple alignment attributes" else if alignment < algn then (* If there is an alignment attribute it should be greater * or equal to [algn] *) align_error "Insufficient alignment" else alignment | Attr("align", _) -> (* Align attribute with an argument other than a single number, should not happen really *) assert false | _ -> acc ) 0 attrs in alignment > 0 (* Given the type and the list of attributes of [varinfo] ([fieldinfo]) return * true if that [varinfo] ([fieldinfo]) requires to be aligned at the boundary * of [algn] (i.e., less than [algn] bytes and has no alignment attribute *) let require_alignment typ attrs algn = Cil.bitsSizeOf typ < algn*8 && not (sufficiently_aligned attrs algn) class prepare_visitor prj = object (self) inherit Visitor.frama_c_copy prj (* Add align attributes to local variables (required by temporal analysis) *) method !vblock _ = if Options.Temporal_validity.get () then Cil.DoChildrenPost (fun blk -> List.iter (fun vi -> (* 4 bytes alignment is required to allow sufficient space for storage of 32-bit timestamps in a 1:1 shadow. *) if require_alignment vi.vtype vi.vattr 4; then begin vi.vattr <- Attr("aligned",[AInt Integer.four]) :: vi.vattr end) blk.blocals; blk) else Cil.DoChildren (* IMPORTANT: for keeping property statuses, we must preserve the ordering of translation, see function [Translate.translate_pre_spec] and [Translate.translate_post_spec]: be careful when modifying it. *) method private push_pre_spec s = let kf = Extlib.the self#current_kf in let kinstr = self#current_kinstr in let open Keep_status in Extlib.may (fun v -> push kf K_Decreases (Property.ip_of_decreases kf kinstr v)) s.spec_variant; Extlib.may (fun t -> push kf K_Terminates (Property.ip_of_terminates kf kinstr t)) s.spec_terminates; List.iter (fun l -> push kf K_Complete (Property.ip_of_complete kf kinstr ~active:[] l)) s.spec_complete_behaviors; List.iter (fun l -> push kf K_Disjoint (Property.ip_of_disjoint kf kinstr ~active:[] l)) s.spec_disjoint_behaviors; List.iter (fun b -> List.iter (fun p -> push kf K_Requires (Property.ip_of_requires kf kinstr b p)) b.b_requires) s.spec_behavior method private push_post_spec spec = let do_behavior b = let kf = Extlib.the self#current_kf in let ki = match self#current_stmt with | None -> Kglobal | Some stmt -> Kstmt stmt in let open Keep_status in Extlib.may (push kf K_Assigns) (Property.ip_of_assigns kf ki (Property.Id_contract (Datatype.String.Set.empty (* TODO *), b)) b.b_assigns); List.iter (fun p -> push kf K_Ensures (Property.ip_of_ensures kf ki b p)) b.b_post_cond in (* fix ordering of behaviors' iterations *) let bhvs = List.sort (fun b1 b2 -> String.compare b1.b_name b2.b_name) spec.spec_behavior in List.iter do_behavior bhvs method private push_pre_code_annot a = let kf = Extlib.the self#current_kf in let stmt = Extlib.the self#current_stmt in let push_single k a = Keep_status.push kf k (Property.ip_of_code_annot_single kf stmt a) in let open Keep_status in match a.annot_content with | AAssert _ -> push_single K_Assert a | AStmtSpec(_ (* TODO *), s) -> self#push_pre_spec s | AInvariant _ -> push_single K_Invariant a | AVariant v -> push kf K_Variant (Property.ip_of_decreases kf (Kstmt stmt) v) | AAssigns _ -> (* TODO: should be a postcondition, but considered as a unhandled precondition in translate.ml right now; and we need to preserve the same ordering *) Extlib.may (push kf K_Assigns) (Property.ip_assigns_of_code_annot kf (Kstmt stmt) a) | AAllocation(_ (* TODO *), alloc) -> Extlib.may (push kf K_Allocation) (Property.ip_of_allocation kf (Kstmt stmt) (Property.Id_loop a) alloc) | APragma _ -> () (* not yet translated *) | AExtended _ -> () (* never translate extensions *) method private push_post_code_annot a = match a.annot_content with | AStmtSpec(_ (* TODO *), s) -> self#push_post_spec s | AAssert _ | AInvariant _ | AVariant _ | AAssigns _ | AAllocation _ | APragma _ | AExtended _ -> () (* Move variable declared in the body of a switch statement to the outer scope *) method !vstmt_aux init_stmt = Annotations.iter_code_annot (fun _ a -> self#push_pre_code_annot a) init_stmt; Cil.DoChildrenPost (fun stmt -> Annotations.iter_code_annot (fun _ a -> self#push_post_code_annot a) init_stmt; match stmt.skind with | Switch(_,sw_blk,_,_) -> let new_blk = Cil.mkBlock [ stmt ] in let new_stmt = Cil.mkStmt (Block new_blk) in new_blk.blocals <- sw_blk.blocals; sw_blk.blocals <- []; new_stmt | _ -> stmt) method private is_unvariadic_function vi = match Cil.unrollType vi.vtype with | TFun(_, _, variadic, _) -> not variadic | _ -> false method !vglob_aux = function | GVarDecl(vi, loc) | GFunDecl(_, vi, loc) | GFun({ svar = vi }, loc) when self#is_unvariadic_function vi && not (Misc.is_library_loc loc) && not (Cil.is_builtin vi) -> let kf = Extlib.the self#current_kf in let s = Annotations.funspec ~populate:false kf in Cil.DoChildrenPost (fun f -> self#push_pre_spec s; self#push_post_spec s; f) | _ -> Cil.DoChildren initializer Project.copy ~selection:(Parameter_state.get_selection ()) prj end let prepare () = Options.feedback ~level:2 "prepare AST for E-ACSL transformations"; File.create_project_from_visitor "e_acsl_prepare_ast" (new prepare_visitor) (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/src/project_initializer/prepare_ast.mli0000666000000000000000000000365613571573400024511 0ustar (**************************************************************************) (* *) (* This file is part of the Frama-C's E-ACSL plug-in. *) (* *) (* Copyright (C) 2012-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Prepare AST for E-ACSL generation. So for this module performs two tasks: - move declarations of variables declared in the bodies of switch statements to upper scopes; - store what is necessary to translate in [Keep_status]. *) val prepare: unit -> Project.t (* Local Variables: compile-command: "make -C ../.." End: *) frama-c-20.0-Calcium/src/plugins/e-acsl/tests/0000777000000000000000000000000013571573400015771 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/0000777000000000000000000000000013571573400017100 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/arith.i0000666000000000000000000000175613571573400020372 0ustar /* run.config COMMENT: arithmetic operations */ int main(void) { int x = -3; int y = 2; long z = 2L; /*@ assert -3 == x; */ ; /*@ assert x == -3; */ ; /*@ assert 0 != ~0; */ ; /*@ assert x+1 == -2; */ ; /*@ assert x-1 == -4; */ ; /*@ assert x*3 == -9; */ ; /*@ assert x/3 == -1; */ ; /*@ assert 0xffffffffffffffffffffff/0xffffffffffffffffffffff == 1; */ ; /*@ assert x % 2 == -1; */ ; /*@ assert -3 % -2 == -1; */ ; /*@ assert 3 % -2 == 1; */ ; /*@ assert x * 2 + (3 + y) - 4 + (x - y) == -10; */ ; /*@ assert (0 == 1) == !(0 == 0); */ ; /*@ assert (0 <= -1) == (0 > 0); */ ; /*@ assert (0 >= -1) == (0 <= 0); */ ; /*@ assert (0 != 1) == !(0 != 0); */ ; /*@ assert 0 == !1; */ ; /*@ assert 4 / y == 2; */ // non trivial division added when fixing bts #751 // example from the JFLA'15 paper (but for a 64-bit architecture) /*@ assert 1 + ((z+1) / (y-123456789123456789)) == 1; */ /*@ assert 1 - x == -x + 1; */ // test GIT issue #37 return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/array.i0000666000000000000000000000040613571573400020370 0ustar /* run.config_ci COMMENT: arrays STDOPT: #"-slevel 5" */ int T1[3],T2[4]; int main(void) { for(int i = 0; i < 3; i++) T1[i] = i; for(int i = 0; i < 4; i++) T2[i] = 2*i; /*@ assert T1[0] == T2[0]; */ /*@ assert T1[1] != T2[1]; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/at.i0000666000000000000000000000160213571573400017655 0ustar /* run.config COMMENT: \at */ int A = 0; /*@ ensures \at(A,Post) == 3; */ void f(void) { A = 1; F: A = 2; /*@ assert \at(A,Pre) == 0; */ /*@ assert \at(A,F) == 1; */ /*@ assert \at(A,Here) == 2; */ /*@ assert \at(\at(A,Pre),F) == 0; */ A = 3; } void g(int *p, int *q) { *p = 0; *(p+1) = 1; *q = 0; L1: *p = 2; *(p+1) = 3; *q = 1; L2: A = 4; /*@ assert (\at(*(p+\at(*q,L1)),L2) == 2); */ L3: /*@ assert (\at(*(p+\at(*q,L1)),Here) == 2); */ // /*@ assert (\at(*(p+\at(*q,L1)),L3) == 2); */ // doesn't work yet // /*@ assert (\at(*(p+\at(*q,L2)),L1)) == 1; */ return ; } /*@ ensures \result == x; */ int h(int x) { return x; } int main(void) { int x; x = h(0); L: /*@ assert x == 0; */ x = 1; x = 2; f(); /*@ assert \at(x,L) == 0; */ /*@ assert \at(x+1,L) == 1; */ /*@ assert \at(x,L)+1 == 1; */ int t[2]; g(t,&x); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/at_on-purely-logic-variables.c0000666000000000000000000000321513571573400024724 0ustar /* run.config COMMENT: \at on purely logic variables COMMENT: */ /*@ ensures \forall integer n; 1 < n <= 3 ==> \old(t[n] == 12) && \old(t[n - 1] > 5); ensures \let m = 4; \old(t[m] == -4) && \old(t[m - 4]) == 9; */ void f(int *t) {} void g() { int m; m = 8; Q: ; m = 10; /*@ assert \exists integer w; 3 <= w < 6 && \at(m + w == 12, Q); */ ; } int main(void) { int n; n = 7; L: ; n = 9; K: ; n = 666; // Predicates: /*@ assert \let i = 3; \at(n + i == 10, L); */ ; /*@ assert \exists integer j; 2 <= j < 5 && \at(n + j == 11, L); */ ; /*@ assert \let k = -7; \exists integer u; 9 <= u < 21 && \forall integer v; -5 < v <= 6 ==> \at((u > 0 ? n + k : u + v) > 0, K); */ ; // Terms: /*@ assert \let i = 3; \at(n + i, L) == 10; */ ; unsigned int m = 3; G: ; m = -3; /*@ assert \exists integer k; -9 < k < 0 && \at(m + k, G) == 0; */ ; /*@ assert \exists integer u; 9 <= u < 21 && \forall integer v; -5 < v <= (u < 15 ? u + 6 : 3) ==> \at(n + u + v > 0, K); */ ; // Function calls: int t[5] = {9, 12, 12, 12, -4}; f(t); g(); // Name capturing /*@ assert \exists integer u; 10 <= u < 20 && \exists integer v; -10 < v <= -5 + (\let u = -2; u) // another u && \exists integer w; 100 < w <= 200 && \at(n - u + (\let u = 42; u) // yet another u + v + w > 0, K); */ ; // Not yet: /*@ assert \exists integer j; 2 <= j < 10000000000000000 // too big => not_yet && \at(n + j == 11, L); */ ; /*@ assert \let i = n; // lv defined with C var => not_yet \at(n + i == 10, L); */ ; return 0; }frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/cast.i0000666000000000000000000000123613571573400020206 0ustar /* run.config COMMENT: cast */ int main(void) { long x = 0; int y = 0; /*@ assert (int)x == y; */ ; /*@ assert x == (long)y; */ ; /*@ assert y == (int)0; */ ; // cast from integer to int /*@ assert (unsigned int) y == (unsigned int)0; */ ; /* cast from integer to unsigned int */ /*@ assert y != (int)0xfffffffffffffff; */ ; // cast from integer to int /*@ assert (unsigned int) y != (unsigned int)0xfffffffffffffff; */ ; /* cast from integer to unsigned int */ /* heterogeneous casts from/to integers */ int t[2] = { 0, 1 }; /*@ assert (float)x == t[(int)0.1]; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/comparison.i0000666000000000000000000000123613571573400021426 0ustar /* run.config COMMENT: comparison operators */ int main(void) { int x = 0, y = 1; /*@ assert x < y; */ /*@ assert y > x; */ /*@ assert x <= 0; */ /*@ assert y >= 1; */ char *s = "toto"; /*@ assert s == s; */ // waiting for clarification of semantics of ACSL's literal strings // /*@ assert "toto" != "titi"; */ /*@ assert 5 < 18; */ /*@ assert 32 > 3; */ /*@ assert 12 <= 13; */ /*@ assert 123 >= 12; */ /*@ assert 0xff == 0xff; */ /*@ assert 1 != 2; */ /*@ assert -5 < 18; */ /*@ assert 32 > -3; */ /*@ assert -12 <= 13; */ /*@ assert 123 >= -12; */ /*@ assert -0xff == -(+0xff); */ /*@ assert +1 != -2; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/functions.c0000666000000000000000000000360613571573400021261 0ustar /* run.config COMMENT: logic functions without labels */ /*@ predicate p1(int x, int y) = x + y > 0; */ /*@ predicate p2(integer x, integer y) = x + y > 0; */ /*@ logic integer f1(integer x, integer y) = x + y; */ // E-ACSL integer typing: // types less than int are considered as int /*@ logic char h_char(char c) = c; */ /*@ logic short h_short(short s) = s; */ /*@ logic int g_hidden(int x) = x; */ /*@ logic int g(int x) = g_hidden(x); */ struct mystruct { int k, l; }; typedef struct mystruct mystruct; /*@ logic mystruct t1(mystruct m) = m; */ /*@ logic integer t2(mystruct m) = m.k + m.l; */ // To test function call in other clauses than assert: /*@ predicate k_pred(integer x) = x > 0; */ /*@ requires k_pred(x); */ void k(int x) {} // To test non-interference with global inits: int glob = 5; // To test that functions that are never called are not generated: /*@ predicate never_called(int x) = x == x; */ /*@ logic double f2(double x) = (double)(1/x); */ /* handle in MR !226 */ // To test not_yet: /*@ predicate p_notyet{L}(integer x) = x > 0; */ /*@ logic integer f_notyet{L}(integer x) = x; */ int main (void) { int x = 1, y = 2; /*@ assert p1(x, y); */ ; /*@ assert p2(3, 4); */ ; /*@ assert p2(5, 99999999999999999999999999999); */ ; /*@ assert f1(x, y) == 3; */ ; /*@ assert p2(x, f1(3, 4)); */ ; /*@ assert f1(9, 99999999999999999999999999999) > 0; */ ; /*@ assert f1(99999999999999999999999999999, 99999999999999999999999999999) == 199999999999999999999999999998; */ ; /*@ assert g(x) == x; */ ; char c = 'c'; /*@ assert h_char(c) == c; */ ; short s = 1; /*@ assert h_short(s) == s; */ ; mystruct m; m.k = 8; m.l = 9; /*@ assert t2(t1(m)) == 17; */ ; k(9); double d = 2.0; /*@ assert f2(d) > 0; */ ; // not yet supported /* /\*@ assert p_notyet(27); *\/ ; */ /* /\*@ assert f_notyet(27) == 27; *\/ ; */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/functions_rec.c0000666000000000000000000000130713571573400022106 0ustar /* run.config_ci COMMENT: recursive logic functions STDOPT: +"-eva-ignore-recursive-calls" */ /*@ logic integer f1(integer n) = n <= 0 ? 0 : f1(n - 1) + n; */ /*@ logic integer f2(integer n) = n < 0 ? 1 : f2(n - 1)*f2(n - 2)/f2(n - 3); */ /*@ logic integer g(integer n) = 0; */ /*@ logic integer f3(integer n) = n > 0 ? g(n)*f3(n - 1) - 5 : g(n + 1); */ /*@ logic integer f4(integer n) = n < 100 ? f4(n + 1) : n < 0x7fffffffffffffffL ? 0x7fffffffffffffffL : 6; */ int main (void) { /*@ assert f1(0) == 0; */ ; /*@ assert f1(1) == 1; */ ; /*@ assert f1(100) == 5050; */ ; /*@ assert f2(7) == 1; */ ; /*@ assert f3(6) == -5; */ ; /*@ assert f4(9) > 0; */ ; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/integer_constant.i0000666000000000000000000000054313571573400022622 0ustar /* run.config COMMENT: integer constant + a stmt after the assertion */ int main(void) { int x; /*@ assert 0 == 0; */ x = 0; x++; /* prevent GCC's warning */ /*@ assert 0 != 1; */ /*@ assert 1152921504606846975 == 0xfffffffffffffff; */ /*@ assert 0xffffffffffffffffffffffffffffffff == 0xffffffffffffffffffffffffffffffff; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/let.c0000666000000000000000000000167713571573400020043 0ustar /* run.config COMMENT: let binding */ int main(void) { int n = -2; /*@ assert \let u = n*n; u >= 0; */ ; /*@ assert \let u = n*n; \let v = u + 1; u > 0; */ ; /*@ assert ((\let u = 1; u) + 1) == 2; */ ; /*@ assert \let u = 1; (\let v = u + 1; v) == 2; */ ; /*@ assert \let u = 1; (\let u = u + 1; u) == 2; */ ; long m = 0x7fffffffffffffffL; /*@ assert (\let u = m; u*u) > m; */ ; char c = 'a'; /*@ assert \let u = 'b'; c < u; */ ; float f = 1.0f; /*@ assert \let u = f; u == f; */ ; int t[4] = {1,2,3,4}; /*@ assert \let u = t + 1; 1 == 1; */ ; // testing warnings when using // let on pointers/arrays /*@ assert (\let u = t + 1; 1) == 1; */ ; // same but for terms struct {int x, y;} r = {1, 2}; /*@ assert \let u = r; u.x + u.y == 3; */ ; union {int x; char *y;} s; s.x = 5; /*@ assert (\let u = s; u.x) > 0; */ ; return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/longlong.i0000666000000000000000000000061413571573400021072 0ustar /* run.config_ci COMMENT: upgrading longlong to GMP STDOPT: +"-eva-ignore-recursive-calls" */ unsigned long long my_pow(unsigned int x, unsigned int n) { int tmp; if (n <= 1) return 1; tmp = my_pow(x, n / 2); tmp *= tmp; if (n % 2 == 0) return tmp; return x * tmp; } int main(void) { unsigned long long x = my_pow(2, 63); /*@ assert (2 * x + 1) % 2 == 1; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/not.i0000666000000000000000000000021113571573400020044 0ustar /* run.config COMMENT: predicate [!p] */ int main(void) { int x = 0; /*@ assert ! x; */ if (x) /*@ assert x; */ ; return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/0000777000000000000000000000000013571573400021020 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/arith.res.oracle0000666000000000000000000000115113571573400024104 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/arith.i:18: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/arith.i:34: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/arith.i:34: Warning: signed overflow. assert -2147483648 ≤ 1 + __gen_e_acsl__7; [eva:alarm] tests/arith/arith.i:34: Warning: signed overflow. assert 1 + __gen_e_acsl__7 ≤ 2147483647; [eva:alarm] tests/arith/arith.i:34: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/array.res.oracle0000666000000000000000000000067313571573400024123 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/array.i:13: Warning: assertion got status unknown. [eva:alarm] tests/arith/array.i:13: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/array.i:14: Warning: assertion got status unknown. [eva:alarm] tests/arith/array.i:14: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/at.res.oracle0000666000000000000000000000110713571573400023402 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/at.i:12: Warning: assertion got status unknown. [eva:alarm] tests/arith/at.i:14: Warning: assertion got status unknown. [eva:alarm] tests/arith/at.i:48: Warning: assertion got status unknown. [eva:alarm] tests/arith/at.i:49: Warning: assertion got status unknown. [eva:alarm] tests/arith/at.i:50: Warning: assertion got status unknown. [eva:alarm] tests/arith/at.i:26: Warning: assertion got status unknown. [eva:alarm] tests/arith/at.i:28: Warning: assertion got status unknown. ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/at_on-purely-logic-variables.res.oracleframa-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/at_on-purely-logic-variables.res.oracl0000666000000000000000000001112513571573400030311 0ustar [e-acsl] beginning translation. [e-acsl] tests/arith/at_on-purely-logic-variables.c:64: Warning: E-ACSL construct `\at on purely logic variables that needs to allocate too much memory (bigger than int_max bytes)' is not yet supported. Ignoring annotation. [e-acsl] tests/arith/at_on-purely-logic-variables.c:65: Warning: E-ACSL construct `\at with logic variable linked to C variable' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/at_on-purely-logic-variables.c:28: Warning: assertion got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:29: Warning: assertion got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:29: Warning: accessing uninitialized left-value. assert \initialized(__gen_e_acsl_at_2 + (__gen_e_acsl_j - 2)); [eva:alarm] tests/arith/at_on-purely-logic-variables.c:29: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:29: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:31: Warning: assertion got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:33: Warning: accessing uninitialized left-value. assert \initialized(__gen_e_acsl_at_3 + ((__gen_e_acsl_u - 9) * 11 + ((__gen_e_acsl_v - -5) - 1))); [eva:alarm] tests/arith/at_on-purely-logic-variables.c:34: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:37: Warning: assertion got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:41: Warning: assertion got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:41: Warning: accessing uninitialized left-value. assert \initialized(__gen_e_acsl_at_5 + ((__gen_e_acsl_k_3 - -9) - 1)); [eva:alarm] tests/arith/at_on-purely-logic-variables.c:41: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:41: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:43: Warning: assertion got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:44: Warning: accessing uninitialized left-value. assert \initialized(__gen_e_acsl_at_6 + ((__gen_e_acsl_u_3 - 9) * 32 + ((__gen_e_acsl_v_3 - -5) - 1))); [eva:alarm] tests/arith/at_on-purely-logic-variables.c:45: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:7: Warning: accessing uninitialized left-value. assert \initialized(__gen_e_acsl_at + ((__gen_e_acsl_n - 1) - 1)); [eva:alarm] tests/arith/at_on-purely-logic-variables.c:7: Warning: accessing uninitialized left-value. assert \initialized(__gen_e_acsl_at_2 + ((__gen_e_acsl_n - 1) - 1)); [eva:alarm] tests/arith/at_on-purely-logic-variables.c:7: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:7: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:6: Warning: function __gen_e_acsl_f: postcondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:8: Warning: function __gen_e_acsl_f: postcondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:16: Warning: assertion got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:16: Warning: accessing uninitialized left-value. assert \initialized(__gen_e_acsl_at + (__gen_e_acsl_w - 3)); [eva:alarm] tests/arith/at_on-purely-logic-variables.c:16: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:16: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:54: Warning: assertion got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:56: Warning: accessing uninitialized left-value. assert \initialized(__gen_e_acsl_at_7 + ((__gen_e_acsl_u_5 - 10) * 300 + (((__gen_e_acsl_v_5 - -10) - 1) * 100 + ((__gen_e_acsl_w - 100) - 1)))); [eva:alarm] tests/arith/at_on-purely-logic-variables.c:63: Warning: assertion got status unknown. [eva:alarm] tests/arith/at_on-purely-logic-variables.c:65: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/cast.res.oracle0000666000000000000000000000030213571573400023724 0ustar [e-acsl] beginning translation. [e-acsl] tests/arith/cast.i:22: Warning: E-ACSL construct `R to Int' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/comparison.res.oracle0000666000000000000000000000011713571573400025150 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/functions.res.oracle0000666000000000000000000000135413571573400025012 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/functions.c:44: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/functions.c:47: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/functions.c:48: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/functions.c:49: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/functions.c:68: Warning: non-finite double value. assert \is_finite(__gen_e_acsl__10); [eva:alarm] tests/arith/functions.c:68: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/functions_rec.res.oracle0000666000000000000000000001126613571573400025646 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/functions_rec.c:22: Warning: assertion got status unknown. [eva:alarm] tests/arith/functions_rec.c:22: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/functions_rec.c:23: Warning: assertion got status unknown. [eva:alarm] tests/arith/functions_rec.c:23: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/functions_rec.c:24: Warning: assertion got status unknown. [eva] tests/arith/functions_rec.c:7: Warning: recursive call during value analysis of __gen_e_acsl_f1_2 (__gen_e_acsl_f1_2 <- __gen_e_acsl_f1_2 :: tests/arith/functions_rec.c:7 <- __gen_e_acsl_f1 :: tests/arith/functions_rec.c:24 <- main). Assuming the call has no effect. The analysis will be unsound. [eva:alarm] tests/arith/functions_rec.c:24: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/functions_rec.c:26: Warning: assertion got status unknown. [eva] tests/arith/functions_rec.c:10: Warning: recursive call during value analysis of __gen_e_acsl_f2_2 (__gen_e_acsl_f2_2 <- __gen_e_acsl_f2_2 :: tests/arith/functions_rec.c:10 <- __gen_e_acsl_f2 :: tests/arith/functions_rec.c:26 <- main). Assuming the call has no effect. The analysis will be unsound. [eva] tests/arith/functions_rec.c:10: Warning: recursive call during value analysis of __gen_e_acsl_f2_2 (__gen_e_acsl_f2_2 <- __gen_e_acsl_f2_2 :: tests/arith/functions_rec.c:10 <- __gen_e_acsl_f2 :: tests/arith/functions_rec.c:26 <- main). Assuming the call has no effect. The analysis will be unsound. [eva] tests/arith/functions_rec.c:10: Warning: recursive call during value analysis of __gen_e_acsl_f2_2 (__gen_e_acsl_f2_2 <- __gen_e_acsl_f2_2 :: tests/arith/functions_rec.c:10 <- __gen_e_acsl_f2 :: tests/arith/functions_rec.c:26 <- main). Assuming the call has no effect. The analysis will be unsound. [eva:alarm] tests/arith/functions_rec.c:10: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/functions_rec.c:10: Warning: division by zero. assert __gen_e_acsl_f2_8 ≢ 0; [eva:alarm] tests/arith/functions_rec.c:10: Warning: signed overflow. assert -2147483648 ≤ __gen_e_acsl_f2_4 * __gen_e_acsl_f2_6; [eva:alarm] tests/arith/functions_rec.c:10: Warning: signed overflow. assert __gen_e_acsl_f2_4 * __gen_e_acsl_f2_6 ≤ 2147483647; [eva:alarm] tests/arith/functions_rec.c:10: Warning: signed overflow. assert (int)(__gen_e_acsl_f2_4 * __gen_e_acsl_f2_6) / __gen_e_acsl_f2_8 ≤ 2147483647; [eva:alarm] tests/arith/functions_rec.c:10: Warning: division by zero. assert __gen_e_acsl_f2_13 ≢ 0; [eva:alarm] tests/arith/functions_rec.c:10: Warning: signed overflow. assert -2147483648 ≤ __gen_e_acsl_f2_9 * __gen_e_acsl_f2_11; [eva:alarm] tests/arith/functions_rec.c:10: Warning: signed overflow. assert __gen_e_acsl_f2_9 * __gen_e_acsl_f2_11 ≤ 2147483647; [eva:alarm] tests/arith/functions_rec.c:10: Warning: signed overflow. assert (int)(__gen_e_acsl_f2_9 * __gen_e_acsl_f2_11) / __gen_e_acsl_f2_13 ≤ 2147483647; [eva:alarm] tests/arith/functions_rec.c:26: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/functions_rec.c:28: Warning: assertion got status unknown. [eva] tests/arith/functions_rec.c:14: Warning: recursive call during value analysis of __gen_e_acsl_f3_2 (__gen_e_acsl_f3_2 <- __gen_e_acsl_f3_2 :: tests/arith/functions_rec.c:14 <- __gen_e_acsl_f3 :: tests/arith/functions_rec.c:28 <- main). Assuming the call has no effect. The analysis will be unsound. [eva:alarm] tests/arith/functions_rec.c:30: Warning: assertion got status unknown. [eva] tests/arith/functions_rec.c:17: Warning: recursive call during value analysis of __gen_e_acsl_f4_2 (__gen_e_acsl_f4_2 <- __gen_e_acsl_f4_2 :: tests/arith/functions_rec.c:17 <- __gen_e_acsl_f4 :: tests/arith/functions_rec.c:30 <- main). Assuming the call has no effect. The analysis will be unsound. [eva:alarm] tests/arith/functions_rec.c:30: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_arith.c0000666000000000000000000001431613571573400023131 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = -3; int y = 2; long z = 2L; /*@ assert -3 ≡ x; */ __e_acsl_assert(-3 == x,(char *)"Assertion",(char *)"main", (char *)"-3 == x",10); /*@ assert x ≡ -3; */ __e_acsl_assert(x == -3,(char *)"Assertion",(char *)"main", (char *)"x == -3",11); /*@ assert 0 ≢ ~0; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"0 != ~0",12); /*@ assert x + 1 ≡ -2; */ __e_acsl_assert(x + 1L == -2L,(char *)"Assertion",(char *)"main", (char *)"x + 1 == -2",14); /*@ assert x - 1 ≡ -4; */ __e_acsl_assert(x - 1L == -4L,(char *)"Assertion",(char *)"main", (char *)"x - 1 == -4",15); /*@ assert x * 3 ≡ -9; */ __e_acsl_assert(x * 3L == -9L,(char *)"Assertion",(char *)"main", (char *)"x * 3 == -9",16); /*@ assert x / 3 ≡ -1; */ __e_acsl_assert(x / 3 == -1,(char *)"Assertion",(char *)"main", (char *)"x / 3 == -1",17); /*@ assert 0xffffffffffffffffffffff / 0xffffffffffffffffffffff ≡ 1; */ { __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl__2; int __gen_e_acsl_div_guard; __e_acsl_mpz_t __gen_e_acsl_div; long __gen_e_acsl__3; __gmpz_init_set_str(__gen_e_acsl_,"309485009821345068724781055",10); __gmpz_init_set_si(__gen_e_acsl__2,0L); __gen_e_acsl_div_guard = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gmpz_init(__gen_e_acsl_div); /*@ assert E_ACSL: 0xffffffffffffffffffffff ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_div_guard == 0),(char *)"Assertion", (char *)"main",(char *)"0xffffffffffffffffffffff == 0", 18); __gmpz_tdiv_q(__gen_e_acsl_div, (__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); __gen_e_acsl__3 = __gmpz_get_si((__e_acsl_mpz_struct const *)(__gen_e_acsl_div)); __e_acsl_assert(__gen_e_acsl__3 == 1L,(char *)"Assertion",(char *)"main", (char *)"0xffffffffffffffffffffff / 0xffffffffffffffffffffff == 1", 18); __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl__2); __gmpz_clear(__gen_e_acsl_div); } /*@ assert x % 2 ≡ -1; */ __e_acsl_assert(x % 2 == -1,(char *)"Assertion",(char *)"main", (char *)"x % 2 == -1",19); /*@ assert -3 % -2 ≡ -1; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"-3 % -2 == -1",20); /*@ assert 3 % -2 ≡ 1; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"3 % -2 == 1", 21); /*@ assert ((x * 2 + (3 + y)) - 4) + (x - y) ≡ -10; */ __e_acsl_assert(((x * 2L + (3L + y)) - 4L) + (x - (long)y) == -10L, (char *)"Assertion",(char *)"main", (char *)"((x * 2 + (3 + y)) - 4) + (x - y) == -10",23); /*@ assert (0 ≡ 1) ≡ !(0 ≡ 0); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"(0 == 1) == !(0 == 0)",25); /*@ assert (0 ≤ -1) ≡ (0 > 0); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"(0 <= -1) == (0 > 0)",26); /*@ assert (0 ≥ -1) ≡ (0 ≤ 0); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"(0 >= -1) == (0 <= 0)",27); /*@ assert (0 ≢ 1) ≡ !(0 ≢ 0); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"(0 != 1) == !(0 != 0)",28); /*@ assert (0 ≢ 0) ≡ !(1 ≢ 0); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"(0 != 0) == !(1 != 0)",30); /*@ assert 4 / y ≡ 2; */ { __e_acsl_assert(y != 0,(char *)"RTE",(char *)"main", (char *)"division_by_zero: y != 0",31); __e_acsl_assert(4 / y == 2,(char *)"Assertion",(char *)"main", (char *)"4 / y == 2",31); } /*@ assert 1 + (z + 1) / (y - 123456789123456789) ≡ 1; */ { __e_acsl_mpz_t __gen_e_acsl_z; __e_acsl_mpz_t __gen_e_acsl__4; __e_acsl_mpz_t __gen_e_acsl_add; __e_acsl_mpz_t __gen_e_acsl__5; __e_acsl_mpz_t __gen_e_acsl__6; int __gen_e_acsl_div_guard_2; __e_acsl_mpz_t __gen_e_acsl_div_2; long __gen_e_acsl__7; __gmpz_init_set_si(__gen_e_acsl_z,z); __gmpz_init_set_si(__gen_e_acsl__4,1L); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add, (__e_acsl_mpz_struct const *)(__gen_e_acsl_z), (__e_acsl_mpz_struct const *)(__gen_e_acsl__4)); __gmpz_init_set_si(__gen_e_acsl__5,y - 123456789123456789L); __gmpz_init_set_si(__gen_e_acsl__6,0L); __gen_e_acsl_div_guard_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__5), (__e_acsl_mpz_struct const *)(__gen_e_acsl__6)); __gmpz_init(__gen_e_acsl_div_2); /*@ assert E_ACSL: y - 123456789123456789 ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_div_guard_2 == 0),(char *)"Assertion", (char *)"main",(char *)"y - 123456789123456789 == 0",34); __gmpz_tdiv_q(__gen_e_acsl_div_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add), (__e_acsl_mpz_struct const *)(__gen_e_acsl__5)); __gen_e_acsl__7 = __gmpz_get_si((__e_acsl_mpz_struct const *)(__gen_e_acsl_div_2)); /*@ assert Eva: signed_overflow: -2147483648 ≤ 1 + __gen_e_acsl__7; */ /*@ assert Eva: signed_overflow: 1 + __gen_e_acsl__7 ≤ 2147483647; */ __e_acsl_assert(1 + __gen_e_acsl__7 == 1,(char *)"Assertion", (char *)"main", (char *)"1 + (z + 1) / (y - 123456789123456789) == 1",34); __gmpz_clear(__gen_e_acsl_z); __gmpz_clear(__gen_e_acsl__4); __gmpz_clear(__gen_e_acsl_add); __gmpz_clear(__gen_e_acsl__5); __gmpz_clear(__gen_e_acsl__6); __gmpz_clear(__gen_e_acsl_div_2); } /*@ assert 1 - x ≡ -x + 1; */ __e_acsl_assert(1L - x == - ((long)x) + 1L,(char *)"Assertion", (char *)"main",(char *)"1 - x == -x + 1",36); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_array.c0000666000000000000000000000125613571573400023137 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int T1[3]; int T2[4]; int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); { int i = 0; while (i < 3) { T1[i] = i; i ++; } } { int i_0 = 0; while (i_0 < 4) { T2[i_0] = 2 * i_0; i_0 ++; } } /*@ assert T1[0] ≡ T2[0]; */ __e_acsl_assert(T1[0] == T2[0],(char *)"Assertion",(char *)"main", (char *)"T1[0] == T2[0]",13); /*@ assert T1[1] ≢ T2[1]; */ __e_acsl_assert(T1[1] != T2[1],(char *)"Assertion",(char *)"main", (char *)"T1[1] != T2[1]",14); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_at.c0000666000000000000000000001413413571573400022424 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; int A = 0; /*@ ensures \at(A,Post) ≡ 3; */ void __gen_e_acsl_f(void); void f(void) { int __gen_e_acsl_at_4; int __gen_e_acsl_at_3; int __gen_e_acsl_at_2; int __gen_e_acsl_at; __gen_e_acsl_at_3 = A; __gen_e_acsl_at = A; A = 1; F: { __gen_e_acsl_at_4 = __gen_e_acsl_at_3; __gen_e_acsl_at_2 = A; A = 2; } /*@ assert \at(A,Pre) ≡ 0; */ __e_acsl_assert(__gen_e_acsl_at == 0,(char *)"Assertion",(char *)"f", (char *)"\\at(A,Pre) == 0",11); /*@ assert \at(A,F) ≡ 1; */ __e_acsl_assert(__gen_e_acsl_at_2 == 1,(char *)"Assertion",(char *)"f", (char *)"\\at(A,F) == 1",12); /*@ assert \at(A,Here) ≡ 2; */ __e_acsl_assert(A == 2,(char *)"Assertion",(char *)"f", (char *)"\\at(A,Here) == 2",13); /*@ assert \at(\at(A,Pre),F) ≡ 0; */ __e_acsl_assert(__gen_e_acsl_at_4 == 0,(char *)"Assertion",(char *)"f", (char *)"\\at(\\at(A,Pre),F) == 0",14); A = 3; return; } void g(int *p, int *q) { int __gen_e_acsl_at_3; int __gen_e_acsl_at_2; int __gen_e_acsl_at; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_initialize((void *)p,sizeof(int)); *p = 0; __e_acsl_initialize((void *)(p + 1),sizeof(int)); *(p + 1) = 1; __e_acsl_initialize((void *)q,sizeof(int)); *q = 0; L1: { { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)q,sizeof(int), (void *)q, (void *)(& q)); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"RTE",(char *)"g", (char *)"mem_access: \\valid_read(q)",28); __gen_e_acsl_at_3 = *q; } { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)q,sizeof(int), (void *)q,(void *)(& q)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"g", (char *)"mem_access: \\valid_read(q)",26); __gen_e_acsl_at = *q; } __e_acsl_initialize((void *)p,sizeof(int)); *p = 2; } __e_acsl_initialize((void *)(p + 1),sizeof(int)); *(p + 1) = 3; __e_acsl_initialize((void *)q,sizeof(int)); *q = 1; L2: { { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(p + __gen_e_acsl_at), sizeof(int),(void *)p, (void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE",(char *)"g", (char *)"mem_access: \\valid_read(p + __gen_e_acsl_at)", 26); __gen_e_acsl_at_2 = *(p + __gen_e_acsl_at); } A = 4; } /*@ assert \at(*(p + \at(*q,L1)),L2) ≡ 2; */ __e_acsl_assert(__gen_e_acsl_at_2 == 2,(char *)"Assertion",(char *)"g", (char *)"\\at(*(p + \\at(*q,L1)),L2) == 2",26); L3: /*@ assert \at(*(p + \at(*q,L1)),Here) ≡ 2; */ { int __gen_e_acsl_valid_read_4; __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)(p + __gen_e_acsl_at_3), sizeof(int),(void *)p, (void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid_read_4,(char *)"RTE",(char *)"g", (char *)"mem_access: \\valid_read(p + __gen_e_acsl_at_3)", 28); __e_acsl_assert(*(p + __gen_e_acsl_at_3) == 2,(char *)"Assertion", (char *)"g",(char *)"\\at(*(p + \\at(*q,L1)),Here) == 2", 28); } __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); return; } /*@ ensures \result ≡ \old(x); */ int __gen_e_acsl_h(int x); int h(int x) { __e_acsl_store_block((void *)(& x),(size_t)4); __e_acsl_delete_block((void *)(& x)); return x; } int main(void) { long __gen_e_acsl_at_3; long __gen_e_acsl_at_2; int __gen_e_acsl_at; int __retres; int x; int t[2]; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(t),(size_t)8); __e_acsl_store_block((void *)(& x),(size_t)4); __e_acsl_full_init((void *)(& x)); x = __gen_e_acsl_h(0); L: /*@ assert x ≡ 0; */ { __gen_e_acsl_at_3 = (long)x; __gen_e_acsl_at_2 = x + 1L; __gen_e_acsl_at = x; __e_acsl_assert(x == 0,(char *)"Assertion",(char *)"main", (char *)"x == 0",43); } __e_acsl_full_init((void *)(& x)); x = 1; __e_acsl_full_init((void *)(& x)); x = 2; __gen_e_acsl_f(); /*@ assert \at(x,L) ≡ 0; */ __e_acsl_assert(__gen_e_acsl_at == 0,(char *)"Assertion",(char *)"main", (char *)"\\at(x,L) == 0",48); /*@ assert \at(x + 1,L) ≡ 1; */ __e_acsl_assert(__gen_e_acsl_at_2 == 1L,(char *)"Assertion",(char *)"main", (char *)"\\at(x + 1,L) == 1",49); /*@ assert \at(x,L) + 1 ≡ 1; */ __e_acsl_assert(__gen_e_acsl_at_3 + 1L == 1L,(char *)"Assertion", (char *)"main",(char *)"\\at(x,L) + 1 == 1",50); g(t,& x); __retres = 0; __e_acsl_delete_block((void *)(t)); __e_acsl_delete_block((void *)(& x)); __e_acsl_memory_clean(); return __retres; } /*@ ensures \result ≡ \old(x); */ int __gen_e_acsl_h(int x) { int __gen_e_acsl_at; int __retres; __e_acsl_store_block((void *)(& __retres),(size_t)4); __gen_e_acsl_at = x; __e_acsl_store_block((void *)(& x),(size_t)4); __retres = h(x); __e_acsl_assert(__retres == __gen_e_acsl_at,(char *)"Postcondition", (char *)"h",(char *)"\\result == \\old(x)",35); __e_acsl_delete_block((void *)(& x)); __e_acsl_delete_block((void *)(& __retres)); return __retres; } /*@ ensures \at(A,Post) ≡ 3; */ void __gen_e_acsl_f(void) { int __gen_e_acsl_at; f(); __gen_e_acsl_at = A; __e_acsl_assert(__gen_e_acsl_at == 3,(char *)"Postcondition",(char *)"f", (char *)"\\at(A,Post) == 3",7); return; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_at_on-purely-logic-variables.c0000666000000000000000000006621413571573400027505 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /*@ ensures ∀ ℤ n; 1 < n ≤ 3 ⇒ \old(*(t + n) ≡ 12) ∧ \old(*(t + (n - 1)) > 5); ensures \let m = 4; \old(*(t + m) ≡ -4) ∧ \old(*(t + (m - 4))) ≡ 9; */ void __gen_e_acsl_f(int *t); void f(int *t) { __e_acsl_store_block((void *)(& t),(size_t)8); __e_acsl_delete_block((void *)(& t)); return; } void g(void) { int *__gen_e_acsl_at; int m; __gen_e_acsl_at = (int *)malloc((size_t)12); m = 8; Q: { { int __gen_e_acsl_w_2; __gen_e_acsl_w_2 = 3; while (1) { if (__gen_e_acsl_w_2 < 6) ; else break; *(__gen_e_acsl_at + (__gen_e_acsl_w_2 - 3)) = m + (long)__gen_e_acsl_w_2 == 12L; __gen_e_acsl_w_2 ++; } } ; } m = 10; /*@ assert ∃ ℤ w; 3 ≤ w < 6 ∧ \at(m + w ≡ 12,Q); */ { int __gen_e_acsl_exists; int __gen_e_acsl_w; __gen_e_acsl_exists = 0; __gen_e_acsl_w = 3; while (1) { if (__gen_e_acsl_w < 6) ; else break; { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(__gen_e_acsl_at + (int)( __gen_e_acsl_w - 3L)), sizeof(int), (void *)__gen_e_acsl_at, (void *)(& __gen_e_acsl_at)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"g", (char *)"mem_access: \\valid_read(__gen_e_acsl_at + (int)(__gen_e_acsl_w - 3))", 16); /*@ assert Eva: initialization: \initialized(__gen_e_acsl_at + (__gen_e_acsl_w - 3)); */ if (! *(__gen_e_acsl_at + (__gen_e_acsl_w - 3))) ; else { __gen_e_acsl_exists = 1; goto e_acsl_end_loop1; } } __gen_e_acsl_w ++; } e_acsl_end_loop1: ; __e_acsl_assert(__gen_e_acsl_exists,(char *)"Assertion",(char *)"g", (char *)"\\exists integer w; 3 <= w < 6 && \\at(m + w == 12,Q)", 16); } free((void *)__gen_e_acsl_at); return; } int main(void) { int *__gen_e_acsl_at_7; int *__gen_e_acsl_at_6; long *__gen_e_acsl_at_5; long *__gen_e_acsl_at_4; int *__gen_e_acsl_at_3; int *__gen_e_acsl_at_2; int *__gen_e_acsl_at; int __retres; int n; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __gen_e_acsl_at_7 = (int *)malloc((size_t)12000); __gen_e_acsl_at_6 = (int *)malloc((size_t)1536); __gen_e_acsl_at_5 = (long *)malloc((size_t)64); __gen_e_acsl_at_4 = (long *)malloc((size_t)8); __gen_e_acsl_at_3 = (int *)malloc((size_t)528); __gen_e_acsl_at_2 = (int *)malloc((size_t)12); __gen_e_acsl_at = (int *)malloc((size_t)4); __e_acsl_store_block((void *)(& n),(size_t)4); __e_acsl_full_init((void *)(& n)); n = 7; L: { { int __gen_e_acsl_i_4; __gen_e_acsl_i_4 = 3; *(__gen_e_acsl_at_4 + 0) = n + (long)__gen_e_acsl_i_4; } { int __gen_e_acsl_j_2; __gen_e_acsl_j_2 = 2; while (1) { if (__gen_e_acsl_j_2 < 5) ; else break; *(__gen_e_acsl_at_2 + (__gen_e_acsl_j_2 - 2)) = n + (long)__gen_e_acsl_j_2 == 11L; __gen_e_acsl_j_2 ++; } } { int __gen_e_acsl_i_2; __gen_e_acsl_i_2 = 3; *(__gen_e_acsl_at + 0) = n + (long)__gen_e_acsl_i_2 == 10L; } ; } __e_acsl_full_init((void *)(& n)); n = 9; K: { { int __gen_e_acsl_u_6; int __gen_e_acsl_v_6; int __gen_e_acsl_w_2; __gen_e_acsl_u_6 = 10; while (1) { if (__gen_e_acsl_u_6 < 20) ; else break; __gen_e_acsl_v_6 = -10 + 1; while (1) { { int __gen_e_acsl_u_8; __gen_e_acsl_u_8 = -2; if (__gen_e_acsl_v_6 <= -5 + __gen_e_acsl_u_8) ; else break; } __gen_e_acsl_w_2 = 100 + 1; while (1) { if (__gen_e_acsl_w_2 <= 200) ; else break; { int __gen_e_acsl_u_7; __gen_e_acsl_u_7 = 42; *(__gen_e_acsl_at_7 + ((__gen_e_acsl_u_6 - 10) * 300 + ( ((__gen_e_acsl_v_6 - -10) - 1) * 100 + ( (__gen_e_acsl_w_2 - 100) - 1)))) = (((n - (long)__gen_e_acsl_u_6) + __gen_e_acsl_u_7) + __gen_e_acsl_v_6) + __gen_e_acsl_w_2 > 0L; } __gen_e_acsl_w_2 ++; } __gen_e_acsl_v_6 ++; } __gen_e_acsl_u_6 ++; } } { int __gen_e_acsl_u_4; int __gen_e_acsl_v_4; __gen_e_acsl_u_4 = 9; while (1) { if (__gen_e_acsl_u_4 < 21) ; else break; __gen_e_acsl_v_4 = -5 + 1; while (1) { { int __gen_e_acsl_if_2; if (__gen_e_acsl_u_4 < 15) __gen_e_acsl_if_2 = __gen_e_acsl_u_4 + 6; else __gen_e_acsl_if_2 = 3; if (__gen_e_acsl_v_4 <= __gen_e_acsl_if_2) ; else break; } *(__gen_e_acsl_at_6 + ((__gen_e_acsl_u_4 - 9) * 32 + ((__gen_e_acsl_v_4 - -5) - 1))) = (n + (long)__gen_e_acsl_u_4) + __gen_e_acsl_v_4 > 0L; __gen_e_acsl_v_4 ++; } __gen_e_acsl_u_4 ++; } } { int __gen_e_acsl_k_2; int __gen_e_acsl_u_2; int __gen_e_acsl_v_2; __gen_e_acsl_k_2 = -7; __gen_e_acsl_u_2 = 9; while (1) { if (__gen_e_acsl_u_2 < 21) ; else break; __gen_e_acsl_v_2 = -5 + 1; while (1) { if (__gen_e_acsl_v_2 <= 6) ; else break; { long __gen_e_acsl_if; if (__gen_e_acsl_u_2 > 0) __gen_e_acsl_if = n + (long)__gen_e_acsl_k_2; else __gen_e_acsl_if = __gen_e_acsl_u_2 + __gen_e_acsl_v_2; *(__gen_e_acsl_at_3 + ((__gen_e_acsl_u_2 - 9) * 11 + ((__gen_e_acsl_v_2 - -5) - 1))) = __gen_e_acsl_if > 0L; } __gen_e_acsl_v_2 ++; } __gen_e_acsl_u_2 ++; } } ; } __e_acsl_full_init((void *)(& n)); n = 666; /*@ assert \let i = 3; \at(n + i ≡ 10,L); */ { int __gen_e_acsl_i; int __gen_e_acsl_valid_read; __gen_e_acsl_i = 3; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(__gen_e_acsl_at + 0), sizeof(int), (void *)__gen_e_acsl_at, (void *)(& __gen_e_acsl_at)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(__gen_e_acsl_at + 0)", 28); __e_acsl_assert(*(__gen_e_acsl_at + 0),(char *)"Assertion", (char *)"main", (char *)"\\let i = 3; \\at(n + i == 10,L)",28); } /*@ assert ∃ ℤ j; 2 ≤ j < 5 ∧ \at(n + j ≡ 11,L); */ { int __gen_e_acsl_exists; int __gen_e_acsl_j; __gen_e_acsl_exists = 0; __gen_e_acsl_j = 2; while (1) { if (__gen_e_acsl_j < 5) ; else break; { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(__gen_e_acsl_at_2 + (int)( __gen_e_acsl_j - 2L)), sizeof(int), (void *)__gen_e_acsl_at_2, (void *)(& __gen_e_acsl_at_2)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE", (char *)"main", (char *)"mem_access: \\valid_read(__gen_e_acsl_at_2 + (int)(__gen_e_acsl_j - 2))", 29); /*@ assert Eva: initialization: \initialized(__gen_e_acsl_at_2 + (__gen_e_acsl_j - 2)); */ if (! *(__gen_e_acsl_at_2 + (__gen_e_acsl_j - 2))) ; else { __gen_e_acsl_exists = 1; goto e_acsl_end_loop2; } } __gen_e_acsl_j ++; } e_acsl_end_loop2: ; __e_acsl_assert(__gen_e_acsl_exists,(char *)"Assertion",(char *)"main", (char *)"\\exists integer j; 2 <= j < 5 && \\at(n + j == 11,L)", 29); } /*@ assert \let k = -7; ∃ ℤ u; 9 ≤ u < 21 ∧ (∀ ℤ v; -5 < v ≤ 6 ⇒ \at((u > 0? n + k: u + v) > 0,K)); */ { int __gen_e_acsl_k; int __gen_e_acsl_exists_2; int __gen_e_acsl_u; __gen_e_acsl_k = -7; __gen_e_acsl_exists_2 = 0; __gen_e_acsl_u = 9; while (1) { if (__gen_e_acsl_u < 21) ; else break; { int __gen_e_acsl_forall; int __gen_e_acsl_v; __gen_e_acsl_forall = 1; __gen_e_acsl_v = -5 + 1; while (1) { if (__gen_e_acsl_v <= 6) ; else break; { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)( __gen_e_acsl_at_3 + (int)( (long)((int)( (long)((int)( __gen_e_acsl_u - 9L)) * 11L)) + (int)( (int)(__gen_e_acsl_v - -5L) - 1))), sizeof(int), (void *)__gen_e_acsl_at_3, (void *)(& __gen_e_acsl_at_3)); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"RTE", (char *)"main", (char *)"mem_access:\n \\valid_read(__gen_e_acsl_at_3 +\n (int)((int)((int)(__gen_e_acsl_u - 9) * 11) +\n (int)((int)(__gen_e_acsl_v - -5) - 1)))", 34); /*@ assert Eva: initialization: \initialized(__gen_e_acsl_at_3 + ((__gen_e_acsl_u - 9) * 11 + ((__gen_e_acsl_v - -5) - 1))); */ if (*(__gen_e_acsl_at_3 + ((__gen_e_acsl_u - 9) * 11 + (( __gen_e_acsl_v - -5) - 1)))) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop3; } } __gen_e_acsl_v ++; } e_acsl_end_loop3: ; if (! __gen_e_acsl_forall) ; else { __gen_e_acsl_exists_2 = 1; goto e_acsl_end_loop4; } } __gen_e_acsl_u ++; } e_acsl_end_loop4: ; __e_acsl_assert(__gen_e_acsl_exists_2,(char *)"Assertion",(char *)"main", (char *)"\\let k = -7;\n\\exists integer u;\n 9 <= u < 21 &&\n (\\forall integer v; -5 < v <= 6 ==> \\at((u > 0? n + k: u + v) > 0,K))", 31); } /*@ assert \let i = 3; \at(n + i,L) ≡ 10; */ { int __gen_e_acsl_i_3; int __gen_e_acsl_valid_read_4; __gen_e_acsl_i_3 = 3; __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)(__gen_e_acsl_at_4 + 0), sizeof(long), (void *)__gen_e_acsl_at_4, (void *)(& __gen_e_acsl_at_4)); __e_acsl_assert(__gen_e_acsl_valid_read_4,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(__gen_e_acsl_at_4 + 0)", 37); __e_acsl_assert(*(__gen_e_acsl_at_4 + 0) == 10L,(char *)"Assertion", (char *)"main", (char *)"\\let i = 3; \\at(n + i,L) == 10",37); } unsigned int m = (unsigned int)3; G: { { int __gen_e_acsl_k_4; __gen_e_acsl_k_4 = -9 + 1; while (1) { if (__gen_e_acsl_k_4 < 0) ; else break; *(__gen_e_acsl_at_5 + ((__gen_e_acsl_k_4 - -9) - 1)) = m + (long)__gen_e_acsl_k_4; __gen_e_acsl_k_4 ++; } } ; } m = (unsigned int)(-3); /*@ assert ∃ ℤ k; -9 < k < 0 ∧ \at(m + k,G) ≡ 0; */ { int __gen_e_acsl_exists_3; int __gen_e_acsl_k_3; __gen_e_acsl_exists_3 = 0; __gen_e_acsl_k_3 = -9 + 1; while (1) { if (__gen_e_acsl_k_3 < 0) ; else break; { int __gen_e_acsl_valid_read_5; __gen_e_acsl_valid_read_5 = __e_acsl_valid_read((void *)(__gen_e_acsl_at_5 + ( (int)( __gen_e_acsl_k_3 - -9L) - 1)), sizeof(long), (void *)__gen_e_acsl_at_5, (void *)(& __gen_e_acsl_at_5)); __e_acsl_assert(__gen_e_acsl_valid_read_5,(char *)"RTE", (char *)"main", (char *)"mem_access:\n \\valid_read(__gen_e_acsl_at_5 + (int)((int)(__gen_e_acsl_k_3 - -9) - 1))", 41); /*@ assert Eva: initialization: \initialized(__gen_e_acsl_at_5 + ((__gen_e_acsl_k_3 - -9) - 1)); */ if (! (*(__gen_e_acsl_at_5 + ((__gen_e_acsl_k_3 - -9) - 1)) == 0L)) ; else { __gen_e_acsl_exists_3 = 1; goto e_acsl_end_loop5; } } __gen_e_acsl_k_3 ++; } e_acsl_end_loop5: ; __e_acsl_assert(__gen_e_acsl_exists_3,(char *)"Assertion",(char *)"main", (char *)"\\exists integer k; -9 < k < 0 && \\at(m + k,G) == 0", 41); } /*@ assert ∃ ℤ u; 9 ≤ u < 21 ∧ (∀ ℤ v; -5 < v ≤ (u < 15? u + 6: 3) ⇒ \at((n + u) + v > 0,K)); */ { int __gen_e_acsl_exists_4; int __gen_e_acsl_u_3; __gen_e_acsl_exists_4 = 0; __gen_e_acsl_u_3 = 9; while (1) { if (__gen_e_acsl_u_3 < 21) ; else break; { int __gen_e_acsl_forall_2; int __gen_e_acsl_v_3; __gen_e_acsl_forall_2 = 1; __gen_e_acsl_v_3 = -5 + 1; while (1) { { int __gen_e_acsl_if_3; if (__gen_e_acsl_u_3 < 15) __gen_e_acsl_if_3 = __gen_e_acsl_u_3 + 6; else __gen_e_acsl_if_3 = 3; if (__gen_e_acsl_v_3 <= __gen_e_acsl_if_3) ; else break; } { int __gen_e_acsl_valid_read_6; __gen_e_acsl_valid_read_6 = __e_acsl_valid_read((void *)( __gen_e_acsl_at_6 + (int)( (long)((int)( (long)((int)( __gen_e_acsl_u_3 - 9L)) * 32L)) + (int)( (int)(__gen_e_acsl_v_3 - -5L) - 1))), sizeof(int), (void *)__gen_e_acsl_at_6, (void *)(& __gen_e_acsl_at_6)); __e_acsl_assert(__gen_e_acsl_valid_read_6,(char *)"RTE", (char *)"main", (char *)"mem_access:\n \\valid_read(__gen_e_acsl_at_6 +\n (int)((int)((int)(__gen_e_acsl_u_3 - 9) * 32) +\n (int)((int)(__gen_e_acsl_v_3 - -5) - 1)))", 45); /*@ assert Eva: initialization: \initialized(__gen_e_acsl_at_6 + ((__gen_e_acsl_u_3 - 9) * 32 + ((__gen_e_acsl_v_3 - -5) - 1))); */ if (*(__gen_e_acsl_at_6 + ((__gen_e_acsl_u_3 - 9) * 32 + ( (__gen_e_acsl_v_3 - -5) - 1)))) ; else { __gen_e_acsl_forall_2 = 0; goto e_acsl_end_loop6; } } __gen_e_acsl_v_3 ++; } e_acsl_end_loop6: ; if (! __gen_e_acsl_forall_2) ; else { __gen_e_acsl_exists_4 = 1; goto e_acsl_end_loop7; } } __gen_e_acsl_u_3 ++; } e_acsl_end_loop7: ; __e_acsl_assert(__gen_e_acsl_exists_4,(char *)"Assertion",(char *)"main", (char *)"\\exists integer u;\n 9 <= u < 21 &&\n (\\forall integer v; -5 < v <= (u < 15? u + 6: 3) ==> \\at((n + u) + v > 0,K))", 43); } int t[5] = {9, 12, 12, 12, -4}; __e_acsl_store_block((void *)(t),(size_t)20); __e_acsl_full_init((void *)(& t)); __gen_e_acsl_f(t); g(); /*@ assert ∃ ℤ u; 10 ≤ u < 20 ∧ (∃ ℤ v; -10 < v ≤ -5 + (\let u = -2; u) ∧ (∃ ℤ w; 100 < w ≤ 200 ∧ \at((((n - u) + (\let u = 42; u)) + v) + w > 0,K))); */ { int __gen_e_acsl_exists_5; int __gen_e_acsl_u_5; __gen_e_acsl_exists_5 = 0; __gen_e_acsl_u_5 = 10; while (1) { if (__gen_e_acsl_u_5 < 20) ; else break; { int __gen_e_acsl_exists_6; int __gen_e_acsl_v_5; __gen_e_acsl_exists_6 = 0; __gen_e_acsl_v_5 = -10 + 1; while (1) { { int __gen_e_acsl_u_9; __gen_e_acsl_u_9 = -2; if (__gen_e_acsl_v_5 <= -5 + __gen_e_acsl_u_9) ; else break; } { int __gen_e_acsl_exists_7; int __gen_e_acsl_w; __gen_e_acsl_exists_7 = 0; __gen_e_acsl_w = 100 + 1; while (1) { if (__gen_e_acsl_w <= 200) ; else break; { int __gen_e_acsl_valid_read_7; __gen_e_acsl_valid_read_7 = __e_acsl_valid_read((void *)( __gen_e_acsl_at_7 + (int)( (long)((int)( (long)((int)( __gen_e_acsl_u_5 - 10L)) * 300L)) + (int)( (long)((int)( (long)((int)( (int)( __gen_e_acsl_v_5 - -10L) - 1)) * 100L)) + (int)( (long)((int)( __gen_e_acsl_w - 100L)) - 1L)))), sizeof(int), (void *)__gen_e_acsl_at_7, (void *)(& __gen_e_acsl_at_7)); __e_acsl_assert(__gen_e_acsl_valid_read_7,(char *)"RTE", (char *)"main", (char *)"mem_access:\n \\valid_read(__gen_e_acsl_at_7 +\n (int)((int)((int)(__gen_e_acsl_u_5 - 10) * 300) +\n (int)((int)((int)((int)(__gen_e_acsl_v_5 - -10) - 1) *\n 100)\n + (int)((int)(__gen_e_acsl_w - 100) - 1))))", 57); /*@ assert Eva: initialization: \initialized(__gen_e_acsl_at_7 + ((__gen_e_acsl_u_5 - 10) * 300 + (((__gen_e_acsl_v_5 - -10) - 1) * 100 + ((__gen_e_acsl_w - 100) - 1)))); */ if (! *(__gen_e_acsl_at_7 + ((__gen_e_acsl_u_5 - 10) * 300 + ( ((__gen_e_acsl_v_5 - -10) - 1) * 100 + ( (__gen_e_acsl_w - 100) - 1))))) ; else { __gen_e_acsl_exists_7 = 1; goto e_acsl_end_loop8; } } __gen_e_acsl_w ++; } e_acsl_end_loop8: ; if (! __gen_e_acsl_exists_7) ; else { __gen_e_acsl_exists_6 = 1; goto e_acsl_end_loop9; } } __gen_e_acsl_v_5 ++; } e_acsl_end_loop9: ; if (! __gen_e_acsl_exists_6) ; else { __gen_e_acsl_exists_5 = 1; goto e_acsl_end_loop10; } } __gen_e_acsl_u_5 ++; } e_acsl_end_loop10: ; __e_acsl_assert(__gen_e_acsl_exists_5,(char *)"Assertion",(char *)"main", (char *)"\\exists integer u;\n 10 <= u < 20 &&\n (\\exists integer v;\n -10 < v <= -5 + (\\let u = -2; u) &&\n (\\exists integer w;\n 100 < w <= 200 && \\at((((n - u) + (\\let u = 42; u)) + v) + w > 0,K)))", 54); } /*@ assert ∃ ℤ j; 2 ≤ j < 10000000000000000 ∧ \at(n + j ≡ 11,L); */ ; /*@ assert \let i = n; \at(n + i ≡ 10,L); */ ; __retres = 0; __e_acsl_delete_block((void *)(t)); __e_acsl_delete_block((void *)(& n)); free((void *)__gen_e_acsl_at_7); free((void *)__gen_e_acsl_at_6); free((void *)__gen_e_acsl_at_5); free((void *)__gen_e_acsl_at_4); free((void *)__gen_e_acsl_at_3); free((void *)__gen_e_acsl_at_2); free((void *)__gen_e_acsl_at); __e_acsl_memory_clean(); return __retres; } /*@ ensures ∀ ℤ n; 1 < n ≤ 3 ⇒ \old(*(t + n) ≡ 12) ∧ \old(*(t + (n - 1)) > 5); ensures \let m = 4; \old(*(t + m) ≡ -4) ∧ \old(*(t + (m - 4))) ≡ 9; */ void __gen_e_acsl_f(int *t) { int *__gen_e_acsl_at_4; int *__gen_e_acsl_at_3; int *__gen_e_acsl_at_2; int *__gen_e_acsl_at; __gen_e_acsl_at_4 = (int *)malloc((size_t)4); __gen_e_acsl_at_3 = (int *)malloc((size_t)4); __gen_e_acsl_at_2 = (int *)malloc((size_t)8); __gen_e_acsl_at = (int *)malloc((size_t)8); { int __gen_e_acsl_m_3; __gen_e_acsl_m_3 = 4; *(__gen_e_acsl_at_4 + 0) = *(t + (__gen_e_acsl_m_3 - 4)); } { int __gen_e_acsl_m_2; __gen_e_acsl_m_2 = 4; *(__gen_e_acsl_at_3 + 0) = *(t + __gen_e_acsl_m_2) == -4; } { int __gen_e_acsl_n_3; __gen_e_acsl_n_3 = 1 + 1; while (1) { if (__gen_e_acsl_n_3 <= 3) ; else break; *(__gen_e_acsl_at_2 + ((__gen_e_acsl_n_3 - 1) - 1)) = *(t + (__gen_e_acsl_n_3 - 1)) > 5; __gen_e_acsl_n_3 ++; } } { int __gen_e_acsl_n_2; __gen_e_acsl_n_2 = 1 + 1; while (1) { if (__gen_e_acsl_n_2 <= 3) ; else break; *(__gen_e_acsl_at + ((__gen_e_acsl_n_2 - 1) - 1)) = *(t + __gen_e_acsl_n_2) == 12; __gen_e_acsl_n_2 ++; } } __e_acsl_store_block((void *)(& t),(size_t)8); f(t); { int __gen_e_acsl_forall; int __gen_e_acsl_n; int __gen_e_acsl_m; int __gen_e_acsl_valid_read_3; int __gen_e_acsl_and_2; __gen_e_acsl_forall = 1; __gen_e_acsl_n = 1 + 1; while (1) { if (__gen_e_acsl_n <= 3) ; else break; { int __gen_e_acsl_valid_read; int __gen_e_acsl_and; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(__gen_e_acsl_at + (int)( (long)((int)( __gen_e_acsl_n - 1L)) - 1L)), sizeof(int), (void *)__gen_e_acsl_at, (void *)(& __gen_e_acsl_at)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"f", (char *)"mem_access:\n \\valid_read(__gen_e_acsl_at + (int)((int)(__gen_e_acsl_n - 1) - 1))", 7); /*@ assert Eva: initialization: \initialized(__gen_e_acsl_at + ((__gen_e_acsl_n - 1) - 1)); */ if (*(__gen_e_acsl_at + ((__gen_e_acsl_n - 1) - 1))) { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(__gen_e_acsl_at_2 + (int)( (long)((int)( __gen_e_acsl_n - 1L)) - 1L)), sizeof(int), (void *)__gen_e_acsl_at_2, (void *)(& __gen_e_acsl_at_2)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE", (char *)"f", (char *)"mem_access:\n \\valid_read(__gen_e_acsl_at_2 + (int)((int)(__gen_e_acsl_n - 1) - 1))", 7); /*@ assert Eva: initialization: \initialized(__gen_e_acsl_at_2 + ((__gen_e_acsl_n - 1) - 1)); */ __gen_e_acsl_and = *(__gen_e_acsl_at_2 + ((__gen_e_acsl_n - 1) - 1)); } else __gen_e_acsl_and = 0; if (__gen_e_acsl_and) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop11; } } __gen_e_acsl_n ++; } e_acsl_end_loop11: ; __e_acsl_assert(__gen_e_acsl_forall,(char *)"Postcondition",(char *)"f", (char *)"\\forall integer n;\n 1 < n <= 3 ==> \\old(*(t + n) == 12) && \\old(*(t + (n - 1)) > 5)", 6); __gen_e_acsl_m = 4; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)(__gen_e_acsl_at_3 + 0), sizeof(int), (void *)__gen_e_acsl_at_3, (void *)(& __gen_e_acsl_at_3)); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(__gen_e_acsl_at_3 + 0)", 8); if (*(__gen_e_acsl_at_3 + 0)) { int __gen_e_acsl_valid_read_4; __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)(__gen_e_acsl_at_4 + 0), sizeof(int), (void *)__gen_e_acsl_at_4, (void *)(& __gen_e_acsl_at_4)); __e_acsl_assert(__gen_e_acsl_valid_read_4,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(__gen_e_acsl_at_4 + 0)", 8); __gen_e_acsl_and_2 = *(__gen_e_acsl_at_4 + 0) == 9; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Postcondition",(char *)"f", (char *)"\\let m = 4; \\old(*(t + m) == -4) && \\old(*(t + (m - 4))) == 9", 8); __e_acsl_delete_block((void *)(& t)); free((void *)__gen_e_acsl_at_4); free((void *)__gen_e_acsl_at_3); free((void *)__gen_e_acsl_at_2); free((void *)__gen_e_acsl_at); return; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_cast.c0000666000000000000000000000251213571573400022747 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); long x = (long)0; int y = 0; /*@ assert (int)x ≡ y; */ __e_acsl_assert((int)x == y,(char *)"Assertion",(char *)"main", (char *)"(int)x == y",9); /*@ assert x ≡ (long)y; */ __e_acsl_assert(x == (long)y,(char *)"Assertion",(char *)"main", (char *)"x == (long)y",10); /*@ assert y ≡ (int)0; */ __e_acsl_assert(y == 0,(char *)"Assertion",(char *)"main", (char *)"y == (int)0",12); /*@ assert (unsigned int)y ≡ (unsigned int)0; */ __e_acsl_assert((unsigned int)y == 0U,(char *)"Assertion",(char *)"main", (char *)"(unsigned int)y == (unsigned int)0",13); /*@ assert y ≢ (int)0xfffffffffffffff; */ __e_acsl_assert(y != -1,(char *)"Assertion",(char *)"main", (char *)"y != (int)0xfffffffffffffff",16); /*@ assert (unsigned int)y ≢ (unsigned int)0xfffffffffffffff; */ __e_acsl_assert((unsigned int)y != 4294967295U,(char *)"Assertion", (char *)"main", (char *)"(unsigned int)y != (unsigned int)0xfffffffffffffff", 17); int t[2] = {0, 1}; /*@ assert (float)x ≡ t[(int)0.1]; */ ; __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_comparison.c0000666000000000000000000000423213571573400024170 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; int y = 1; /*@ assert x < y; */ __e_acsl_assert(x < y,(char *)"Assertion",(char *)"main",(char *)"x < y",7); /*@ assert y > x; */ __e_acsl_assert(y > x,(char *)"Assertion",(char *)"main",(char *)"y > x",8); /*@ assert x ≤ 0; */ __e_acsl_assert(x <= 0,(char *)"Assertion",(char *)"main",(char *)"x <= 0", 9); /*@ assert y ≥ 1; */ __e_acsl_assert(y >= 1,(char *)"Assertion",(char *)"main",(char *)"y >= 1", 10); char *s = (char *)"toto"; /*@ assert s ≡ s; */ __e_acsl_assert(s == s,(char *)"Assertion",(char *)"main",(char *)"s == s", 12); /*@ assert 5 < 18; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"5 < 18",15); /*@ assert 32 > 3; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"32 > 3",16); /*@ assert 12 ≤ 13; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"12 <= 13",17); /*@ assert 123 ≥ 12; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"123 >= 12", 18); /*@ assert 0xff ≡ 0xff; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"0xff == 0xff",19); /*@ assert 1 ≢ 2; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"1 != 2",20); /*@ assert -5 < 18; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"-5 < 18",22); /*@ assert 32 > -3; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"32 > -3",23); /*@ assert -12 ≤ 13; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"-12 <= 13", 24); /*@ assert 123 ≥ -12; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"123 >= -12", 25); /*@ assert -0xff ≡ -0xff; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"-0xff == -0xff",26); /*@ assert 1 ≢ -2; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"1 != -2",27); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_functions.c0000666000000000000000000002577613571573400024046 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; struct mystruct { int k ; int l ; }; typedef struct mystruct mystruct; /*@ predicate p1(int x, int y) = x + y > 0; */ int __gen_e_acsl_p1(int x, int y); /*@ predicate p2(ℤ x, ℤ y) = x + y > 0; */ int __gen_e_acsl_p2(int x, int y); int __gen_e_acsl_p2_3(int x, __e_acsl_mpz_struct * y); int __gen_e_acsl_p2_5(int x, long y); /*@ logic ℤ f1(ℤ x, ℤ y) = x + y; */ long __gen_e_acsl_f1(int x, int y); void __gen_e_acsl_f1_5(__e_acsl_mpz_t *__retres_arg, int x, __e_acsl_mpz_struct * y); void __gen_e_acsl_f1_7(__e_acsl_mpz_t *__retres_arg, __e_acsl_mpz_struct * x, __e_acsl_mpz_struct * y); /*@ logic char h_char(char c) = c; */ int __gen_e_acsl_h_char(int c); /*@ logic short h_short(short s) = s; */ int __gen_e_acsl_h_short(int s); /*@ logic int g_hidden(int x) = x; */ int __gen_e_acsl_g_hidden(int x); /*@ logic int g(int x) = g_hidden(x); */ int __gen_e_acsl_g(int x); /*@ logic mystruct t1(mystruct m) = m; */ mystruct __gen_e_acsl_t1(mystruct m); /*@ logic ℤ t2(mystruct m) = m.k + m.l; */ long __gen_e_acsl_t2(mystruct m); /*@ predicate k_pred(ℤ x) = x > 0; */ int __gen_e_acsl_k_pred(int x); /*@ requires k_pred(x); */ void __gen_e_acsl_k(int x); void k(int x) { return; } int glob = 5; /*@ predicate never_called(int x) = x ≡ x; */ /*@ logic double f2(double x) = (double)(1 / x); */ double __gen_e_acsl_f2(double x); /*@ predicate p_notyet{L}(ℤ x) = x > 0; */ /*@ logic ℤ f_notyet{L}(ℤ x) = x; */ int main(void) { int __retres; mystruct m; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 1; int y = 2; /*@ assert p1(x, y); */ { int __gen_e_acsl_p1_2; __gen_e_acsl_p1_2 = __gen_e_acsl_p1(x,y); __e_acsl_assert(__gen_e_acsl_p1_2,(char *)"Assertion",(char *)"main", (char *)"p1(x, y)",42); } /*@ assert p2(3, 4); */ { int __gen_e_acsl_p2_2; __gen_e_acsl_p2_2 = __gen_e_acsl_p2(3,4); __e_acsl_assert(__gen_e_acsl_p2_2,(char *)"Assertion",(char *)"main", (char *)"p2(3, 4)",43); } /*@ assert p2(5, 99999999999999999999999999999); */ { __e_acsl_mpz_t __gen_e_acsl_; int __gen_e_acsl_p2_4; __gmpz_init_set_str(__gen_e_acsl_,"99999999999999999999999999999",10); __gen_e_acsl_p2_4 = __gen_e_acsl_p2_3(5, (__e_acsl_mpz_struct *)__gen_e_acsl_); __e_acsl_assert(__gen_e_acsl_p2_4,(char *)"Assertion",(char *)"main", (char *)"p2(5, 99999999999999999999999999999)",44); __gmpz_clear(__gen_e_acsl_); } /*@ assert f1(x, y) ≡ 3; */ { long __gen_e_acsl_f1_2; __gen_e_acsl_f1_2 = __gen_e_acsl_f1(x,y); __e_acsl_assert(__gen_e_acsl_f1_2 == 3L,(char *)"Assertion", (char *)"main",(char *)"f1(x, y) == 3",46); } /*@ assert p2(x, f1(3, 4)); */ { long __gen_e_acsl_f1_4; int __gen_e_acsl_p2_6; __gen_e_acsl_f1_4 = __gen_e_acsl_f1(3,4); __gen_e_acsl_p2_6 = __gen_e_acsl_p2_5(x,__gen_e_acsl_f1_4); __e_acsl_assert(__gen_e_acsl_p2_6,(char *)"Assertion",(char *)"main", (char *)"p2(x, f1(3, 4))",47); } /*@ assert f1(9, 99999999999999999999999999999) > 0; */ { __e_acsl_mpz_t __gen_e_acsl__4; __e_acsl_mpz_t __gen_e_acsl_f1_6; __e_acsl_mpz_t __gen_e_acsl__5; int __gen_e_acsl_gt_3; __gmpz_init_set_str(__gen_e_acsl__4,"99999999999999999999999999999",10); __gen_e_acsl_f1_5(& __gen_e_acsl_f1_6,9, (__e_acsl_mpz_struct *)__gen_e_acsl__4); __gmpz_init_set_si(__gen_e_acsl__5,0L); __gen_e_acsl_gt_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_6), (__e_acsl_mpz_struct const *)(__gen_e_acsl__5)); __e_acsl_assert(__gen_e_acsl_gt_3 > 0,(char *)"Assertion",(char *)"main", (char *)"f1(9, 99999999999999999999999999999) > 0",48); __gmpz_clear(__gen_e_acsl__4); __gmpz_clear(__gen_e_acsl_f1_6); __gmpz_clear(__gen_e_acsl__5); } /*@ assert f1(99999999999999999999999999999, 99999999999999999999999999999) ≡ 199999999999999999999999999998; */ { __e_acsl_mpz_t __gen_e_acsl__6; __e_acsl_mpz_t __gen_e_acsl_f1_8; __e_acsl_mpz_t __gen_e_acsl__7; int __gen_e_acsl_eq; __gmpz_init_set_str(__gen_e_acsl__6,"99999999999999999999999999999",10); __gen_e_acsl_f1_7(& __gen_e_acsl_f1_8, (__e_acsl_mpz_struct *)__gen_e_acsl__6, (__e_acsl_mpz_struct *)__gen_e_acsl__6); __gmpz_init_set_str(__gen_e_acsl__7,"199999999999999999999999999998",10); __gen_e_acsl_eq = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_8), (__e_acsl_mpz_struct const *)(__gen_e_acsl__7)); __e_acsl_assert(__gen_e_acsl_eq == 0,(char *)"Assertion",(char *)"main", (char *)"f1(99999999999999999999999999999, 99999999999999999999999999999) ==\n199999999999999999999999999998", 49); __gmpz_clear(__gen_e_acsl__6); __gmpz_clear(__gen_e_acsl_f1_8); __gmpz_clear(__gen_e_acsl__7); } /*@ assert g(x) ≡ x; */ { int __gen_e_acsl_g_2; __gen_e_acsl_g_2 = __gen_e_acsl_g(x); __e_acsl_assert(__gen_e_acsl_g_2 == x,(char *)"Assertion",(char *)"main", (char *)"g(x) == x",53); } char c = (char)'c'; /*@ assert h_char(c) ≡ c; */ { int __gen_e_acsl_h_char_2; __gen_e_acsl_h_char_2 = __gen_e_acsl_h_char((int)c); __e_acsl_assert(__gen_e_acsl_h_char_2 == (int)c,(char *)"Assertion", (char *)"main",(char *)"h_char(c) == c",56); } short s = (short)1; /*@ assert h_short(s) ≡ s; */ { int __gen_e_acsl_h_short_2; __gen_e_acsl_h_short_2 = __gen_e_acsl_h_short((int)s); __e_acsl_assert(__gen_e_acsl_h_short_2 == (int)s,(char *)"Assertion", (char *)"main",(char *)"h_short(s) == s",58); } m.k = 8; m.l = 9; /*@ assert t2(t1(m)) ≡ 17; */ { mystruct __gen_e_acsl_t1_2; long __gen_e_acsl_t2_2; __gen_e_acsl_t1_2 = __gen_e_acsl_t1(m); __gen_e_acsl_t2_2 = __gen_e_acsl_t2(__gen_e_acsl_t1_2); __e_acsl_assert(__gen_e_acsl_t2_2 == 17L,(char *)"Assertion", (char *)"main",(char *)"t2(t1(m)) == 17",63); } __gen_e_acsl_k(9); double d = 2.0; /*@ assert f2(d) > 0; */ { double __gen_e_acsl_f2_2; __gen_e_acsl_f2_2 = __gen_e_acsl_f2(d); __e_acsl_assert(__gen_e_acsl_f2_2 > 0.,(char *)"Assertion", (char *)"main",(char *)"f2(d) > 0",68); } __retres = 0; return __retres; } /*@ requires k_pred(x); */ void __gen_e_acsl_k(int x) { { int __gen_e_acsl_k_pred_2; __gen_e_acsl_k_pred_2 = __gen_e_acsl_k_pred(x); __e_acsl_assert(__gen_e_acsl_k_pred_2,(char *)"Precondition",(char *)"k", (char *)"k_pred(x)",25); } k(x); return; } int __gen_e_acsl_k_pred(int x) { int __retres = x > 0; return __retres; } long __gen_e_acsl_f1(int x, int y) { long __retres = x + (long)y; return __retres; } void __gen_e_acsl_f1_5(__e_acsl_mpz_t *__retres_arg, int x, __e_acsl_mpz_struct * y) { __e_acsl_mpz_t __gen_e_acsl_x_3; __e_acsl_mpz_t __gen_e_acsl_add_3; __gmpz_init_set_si(__gen_e_acsl_x_3,(long)x); __gmpz_init(__gen_e_acsl_add_3); __gmpz_add(__gen_e_acsl_add_3, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_3), (__e_acsl_mpz_struct const *)(y)); __gmpz_init_set(*__retres_arg, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_3)); __gmpz_clear(__gen_e_acsl_x_3); __gmpz_clear(__gen_e_acsl_add_3); return; } void __gen_e_acsl_f1_7(__e_acsl_mpz_t *__retres_arg, __e_acsl_mpz_struct * x, __e_acsl_mpz_struct * y) { __e_acsl_mpz_t __gen_e_acsl_add_4; __gmpz_init(__gen_e_acsl_add_4); __gmpz_add(__gen_e_acsl_add_4,(__e_acsl_mpz_struct const *)(x), (__e_acsl_mpz_struct const *)(y)); __gmpz_init_set(*__retres_arg, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_4)); __gmpz_clear(__gen_e_acsl_add_4); return; } int __gen_e_acsl_h_char(int c) { return c; } int __gen_e_acsl_h_short(int s) { return s; } int __gen_e_acsl_g_hidden(int x) { return x; } double __gen_e_acsl_f2(double x) { __e_acsl_mpq_t __gen_e_acsl__8; __e_acsl_mpq_t __gen_e_acsl__9; __e_acsl_mpq_t __gen_e_acsl_div; double __gen_e_acsl__10; __gmpq_init(__gen_e_acsl__8); __gmpq_set_str(__gen_e_acsl__8,"1",10); __gmpq_init(__gen_e_acsl__9); __gmpq_set_d(__gen_e_acsl__9,x); __gmpq_init(__gen_e_acsl_div); __gmpq_div(__gen_e_acsl_div,(__e_acsl_mpq_struct const *)(__gen_e_acsl__8), (__e_acsl_mpq_struct const *)(__gen_e_acsl__9)); __gen_e_acsl__10 = __gmpq_get_d((__e_acsl_mpq_struct const *)(__gen_e_acsl_div)); __gmpq_clear(__gen_e_acsl__8); __gmpq_clear(__gen_e_acsl__9); __gmpq_clear(__gen_e_acsl_div); /*@ assert Eva: is_nan_or_infinite: \is_finite(__gen_e_acsl__10); */ return __gen_e_acsl__10; } int __gen_e_acsl_g(int x) { int __gen_e_acsl_g_hidden_2; __gen_e_acsl_g_hidden_2 = __gen_e_acsl_g_hidden(x); return __gen_e_acsl_g_hidden_2; } mystruct __gen_e_acsl_t1(mystruct m) { return m; } int __gen_e_acsl_p1(int x, int y) { int __retres = x + (long)y > 0L; return __retres; } long __gen_e_acsl_t2(mystruct m) { long __retres = m.k + (long)m.l; return __retres; } int __gen_e_acsl_p2(int x, int y) { int __retres = x + (long)y > 0L; return __retres; } int __gen_e_acsl_p2_3(int x, __e_acsl_mpz_struct * y) { __e_acsl_mpz_t __gen_e_acsl_x; __e_acsl_mpz_t __gen_e_acsl_add; __e_acsl_mpz_t __gen_e_acsl__2; int __gen_e_acsl_gt; __gmpz_init_set_si(__gen_e_acsl_x,(long)x); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add,(__e_acsl_mpz_struct const *)(__gen_e_acsl_x), (__e_acsl_mpz_struct const *)(y)); __gmpz_init_set_si(__gen_e_acsl__2,0L); __gen_e_acsl_gt = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); int __retres = __gen_e_acsl_gt > 0; __gmpz_clear(__gen_e_acsl_x); __gmpz_clear(__gen_e_acsl_add); __gmpz_clear(__gen_e_acsl__2); return __retres; } int __gen_e_acsl_p2_5(int x, long y) { __e_acsl_mpz_t __gen_e_acsl_x_2; __e_acsl_mpz_t __gen_e_acsl_y; __e_acsl_mpz_t __gen_e_acsl_add_2; __e_acsl_mpz_t __gen_e_acsl__3; int __gen_e_acsl_gt_2; __gmpz_init_set_si(__gen_e_acsl_x_2,(long)x); __gmpz_init_set_si(__gen_e_acsl_y,y); __gmpz_init(__gen_e_acsl_add_2); __gmpz_add(__gen_e_acsl_add_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_y)); __gmpz_init_set_si(__gen_e_acsl__3,0L); __gen_e_acsl_gt_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__3)); int __retres = __gen_e_acsl_gt_2 > 0; __gmpz_clear(__gen_e_acsl_x_2); __gmpz_clear(__gen_e_acsl_y); __gmpz_clear(__gen_e_acsl_add_2); __gmpz_clear(__gen_e_acsl__3); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_functions_rec.c0000666000000000000000000002304413571573400024661 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" /*@ logic ℤ f1(ℤ n) = n ≤ 0? 0: f1(n - 1) + n; */ void __gen_e_acsl_f1(__e_acsl_mpz_t *__retres_arg, int n); void __gen_e_acsl_f1_2(__e_acsl_mpz_t *__retres_arg, long n); /*@ logic ℤ f2(ℤ n) = n < 0? 1: (f2(n - 1) * f2(n - 2)) / f2(n - 3); */ int __gen_e_acsl_f2(int n); int __gen_e_acsl_f2_2(long n); /*@ logic ℤ g(ℤ n) = 0; */ int __gen_e_acsl_g(int n); int __gen_e_acsl_g_5(long n); /*@ logic ℤ f3(ℤ n) = n > 0? g(n) * f3(n - 1) - 5: g(n + 1); */ int __gen_e_acsl_f3(int n); int __gen_e_acsl_f3_2(long n); /*@ logic ℤ f4(ℤ n) = n < 100? f4(n + 1): (n < 0x7fffffffffffffffL? 0x7fffffffffffffffL: 6); */ unsigned long __gen_e_acsl_f4(int n); unsigned long __gen_e_acsl_f4_2(long n); int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); /*@ assert f1(0) ≡ 0; */ { __e_acsl_mpz_t __gen_e_acsl_f1_6; __e_acsl_mpz_t __gen_e_acsl__3; int __gen_e_acsl_eq; __gen_e_acsl_f1(& __gen_e_acsl_f1_6,0); __gmpz_init_set_si(__gen_e_acsl__3,0L); __gen_e_acsl_eq = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_6), (__e_acsl_mpz_struct const *)(__gen_e_acsl__3)); __e_acsl_assert(__gen_e_acsl_eq == 0,(char *)"Assertion",(char *)"main", (char *)"f1(0) == 0",22); __gmpz_clear(__gen_e_acsl_f1_6); __gmpz_clear(__gen_e_acsl__3); } /*@ assert f1(1) ≡ 1; */ { __e_acsl_mpz_t __gen_e_acsl_f1_8; __e_acsl_mpz_t __gen_e_acsl__4; int __gen_e_acsl_eq_2; __gen_e_acsl_f1(& __gen_e_acsl_f1_8,1); __gmpz_init_set_si(__gen_e_acsl__4,1L); __gen_e_acsl_eq_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_8), (__e_acsl_mpz_struct const *)(__gen_e_acsl__4)); __e_acsl_assert(__gen_e_acsl_eq_2 == 0,(char *)"Assertion", (char *)"main",(char *)"f1(1) == 1",23); __gmpz_clear(__gen_e_acsl_f1_8); __gmpz_clear(__gen_e_acsl__4); } /*@ assert f1(100) ≡ 5050; */ { __e_acsl_mpz_t __gen_e_acsl_f1_10; __e_acsl_mpz_t __gen_e_acsl__5; int __gen_e_acsl_eq_3; __gen_e_acsl_f1(& __gen_e_acsl_f1_10,100); __gmpz_init_set_si(__gen_e_acsl__5,5050L); __gen_e_acsl_eq_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_10), (__e_acsl_mpz_struct const *)(__gen_e_acsl__5)); __e_acsl_assert(__gen_e_acsl_eq_3 == 0,(char *)"Assertion", (char *)"main",(char *)"f1(100) == 5050",24); __gmpz_clear(__gen_e_acsl_f1_10); __gmpz_clear(__gen_e_acsl__5); } /*@ assert f2(7) ≡ 1; */ { int __gen_e_acsl_f2_14; __gen_e_acsl_f2_14 = __gen_e_acsl_f2(7); __e_acsl_assert(__gen_e_acsl_f2_14 == 1,(char *)"Assertion", (char *)"main",(char *)"f2(7) == 1",26); } /*@ assert f3(6) ≡ -5; */ { int __gen_e_acsl_f3_6; __gen_e_acsl_f3_6 = __gen_e_acsl_f3(6); __e_acsl_assert(__gen_e_acsl_f3_6 == -5,(char *)"Assertion", (char *)"main",(char *)"f3(6) == -5",28); } /*@ assert f4(9) > 0; */ { unsigned long __gen_e_acsl_f4_6; __gen_e_acsl_f4_6 = __gen_e_acsl_f4(9); __e_acsl_assert(__gen_e_acsl_f4_6 > 0UL,(char *)"Assertion", (char *)"main",(char *)"f4(9) > 0",30); } __retres = 0; return __retres; } int __gen_e_acsl_f3(int n) { int __gen_e_acsl_if_6; if (n > 0) { int __gen_e_acsl_g_2; int __gen_e_acsl_f3_5; __gen_e_acsl_g_2 = __gen_e_acsl_g(n); __gen_e_acsl_f3_5 = __gen_e_acsl_f3_2(n - 1L); __gen_e_acsl_if_6 = __gen_e_acsl_g_2 * __gen_e_acsl_f3_5 - 5; } else { int __gen_e_acsl_g_8; __gen_e_acsl_g_8 = __gen_e_acsl_g_5(n + 1L); __gen_e_acsl_if_6 = __gen_e_acsl_g_8; } return __gen_e_acsl_if_6; } int __gen_e_acsl_f3_2(long n) { int __gen_e_acsl_if_5; if (n > 0L) { int __gen_e_acsl_g_4; int __gen_e_acsl_f3_4; __gen_e_acsl_g_4 = __gen_e_acsl_g((int)n); __gen_e_acsl_f3_4 = __gen_e_acsl_f3_2(n - 1L); __gen_e_acsl_if_5 = __gen_e_acsl_g_4 * __gen_e_acsl_f3_4 - 5; } else { int __gen_e_acsl_g_6; __gen_e_acsl_g_6 = __gen_e_acsl_g_5(n + 1L); __gen_e_acsl_if_5 = __gen_e_acsl_g_6; } return __gen_e_acsl_if_5; } unsigned long __gen_e_acsl_f4(int n) { unsigned long __gen_e_acsl_if_10; if (n < 100) { unsigned long __gen_e_acsl_f4_5; __gen_e_acsl_f4_5 = __gen_e_acsl_f4_2(n + 1L); __gen_e_acsl_if_10 = __gen_e_acsl_f4_5; } else { unsigned long __gen_e_acsl_if_9; if ((long)n < 9223372036854775807L) __gen_e_acsl_if_9 = 9223372036854775807UL; else __gen_e_acsl_if_9 = 6UL; __gen_e_acsl_if_10 = __gen_e_acsl_if_9; } return __gen_e_acsl_if_10; } unsigned long __gen_e_acsl_f4_2(long n) { unsigned long __gen_e_acsl_if_8; if (n < 100L) { unsigned long __gen_e_acsl_f4_4; __gen_e_acsl_f4_4 = __gen_e_acsl_f4_2(n + 1L); __gen_e_acsl_if_8 = __gen_e_acsl_f4_4; } else { unsigned long __gen_e_acsl_if_7; if (n < 9223372036854775807L) __gen_e_acsl_if_7 = 9223372036854775807UL; else __gen_e_acsl_if_7 = 6UL; __gen_e_acsl_if_8 = __gen_e_acsl_if_7; } return __gen_e_acsl_if_8; } void __gen_e_acsl_f1(__e_acsl_mpz_t *__retres_arg, int n) { __e_acsl_mpz_t __gen_e_acsl_if_2; if (n <= 0) { __e_acsl_mpz_t __gen_e_acsl_; __gmpz_init_set_si(__gen_e_acsl_,0L); __gmpz_init_set(__gen_e_acsl_if_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); __gmpz_clear(__gen_e_acsl_); } else { __e_acsl_mpz_t __gen_e_acsl_f1_5; __e_acsl_mpz_t __gen_e_acsl_n_2; __e_acsl_mpz_t __gen_e_acsl_add_2; __gen_e_acsl_f1_2(& __gen_e_acsl_f1_5,n - 1L); __gmpz_init_set_si(__gen_e_acsl_n_2,(long)n); __gmpz_init(__gen_e_acsl_add_2); __gmpz_add(__gen_e_acsl_add_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_5), (__e_acsl_mpz_struct const *)(__gen_e_acsl_n_2)); __gmpz_init_set(__gen_e_acsl_if_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2)); __gmpz_clear(__gen_e_acsl_f1_5); __gmpz_clear(__gen_e_acsl_n_2); __gmpz_clear(__gen_e_acsl_add_2); } __gmpz_init_set(*__retres_arg, (__e_acsl_mpz_struct const *)(__gen_e_acsl_if_2)); __gmpz_clear(__gen_e_acsl_if_2); return; } void __gen_e_acsl_f1_2(__e_acsl_mpz_t *__retres_arg, long n) { __e_acsl_mpz_t __gen_e_acsl_if; if (n <= 0L) { __e_acsl_mpz_t __gen_e_acsl__2; __gmpz_init_set_si(__gen_e_acsl__2,0L); __gmpz_init_set(__gen_e_acsl_if, (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gmpz_clear(__gen_e_acsl__2); } else { __e_acsl_mpz_t __gen_e_acsl_f1_4; __e_acsl_mpz_t __gen_e_acsl_n; __e_acsl_mpz_t __gen_e_acsl_add; __gen_e_acsl_f1_2(& __gen_e_acsl_f1_4,n - 1L); __gmpz_init_set_si(__gen_e_acsl_n,n); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add, (__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_4), (__e_acsl_mpz_struct const *)(__gen_e_acsl_n)); __gmpz_init_set(__gen_e_acsl_if, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add)); __gmpz_clear(__gen_e_acsl_f1_4); __gmpz_clear(__gen_e_acsl_n); __gmpz_clear(__gen_e_acsl_add); } __gmpz_init_set(*__retres_arg, (__e_acsl_mpz_struct const *)(__gen_e_acsl_if)); __gmpz_clear(__gen_e_acsl_if); return; } int __gen_e_acsl_f2(int n) { int __gen_e_acsl_if_4; if (n < 0) __gen_e_acsl_if_4 = 1; else { int __gen_e_acsl_f2_9; int __gen_e_acsl_f2_11; int __gen_e_acsl_f2_13; __gen_e_acsl_f2_9 = __gen_e_acsl_f2_2(n - 1L); __gen_e_acsl_f2_11 = __gen_e_acsl_f2_2(n - 2L); __gen_e_acsl_f2_13 = __gen_e_acsl_f2_2(n - 3L); __e_acsl_assert(__gen_e_acsl_f2_13 != 0,(char *)"RTE",(char *)"f2", (char *)"division_by_zero: __gen_e_acsl_f2_13 != 0",10); /*@ assert Eva: division_by_zero: __gen_e_acsl_f2_13 ≢ 0; */ /*@ assert Eva: signed_overflow: -2147483648 ≤ __gen_e_acsl_f2_9 * __gen_e_acsl_f2_11; */ /*@ assert Eva: signed_overflow: __gen_e_acsl_f2_9 * __gen_e_acsl_f2_11 ≤ 2147483647; */ /*@ assert Eva: signed_overflow: (int)(__gen_e_acsl_f2_9 * __gen_e_acsl_f2_11) / __gen_e_acsl_f2_13 ≤ 2147483647; */ __gen_e_acsl_if_4 = (__gen_e_acsl_f2_9 * __gen_e_acsl_f2_11) / __gen_e_acsl_f2_13; } return __gen_e_acsl_if_4; } int __gen_e_acsl_f2_2(long n) { int __gen_e_acsl_if_3; if (n < 0L) __gen_e_acsl_if_3 = 1; else { int __gen_e_acsl_f2_4; int __gen_e_acsl_f2_6; int __gen_e_acsl_f2_8; __gen_e_acsl_f2_4 = __gen_e_acsl_f2_2(n - 1L); __gen_e_acsl_f2_6 = __gen_e_acsl_f2_2(n - 2L); __gen_e_acsl_f2_8 = __gen_e_acsl_f2_2(n - 3L); __e_acsl_assert(__gen_e_acsl_f2_8 != 0,(char *)"RTE",(char *)"f2_2", (char *)"division_by_zero: __gen_e_acsl_f2_8 != 0",10); /*@ assert Eva: division_by_zero: __gen_e_acsl_f2_8 ≢ 0; */ /*@ assert Eva: signed_overflow: -2147483648 ≤ __gen_e_acsl_f2_4 * __gen_e_acsl_f2_6; */ /*@ assert Eva: signed_overflow: __gen_e_acsl_f2_4 * __gen_e_acsl_f2_6 ≤ 2147483647; */ /*@ assert Eva: signed_overflow: (int)(__gen_e_acsl_f2_4 * __gen_e_acsl_f2_6) / __gen_e_acsl_f2_8 ≤ 2147483647; */ __gen_e_acsl_if_3 = (__gen_e_acsl_f2_4 * __gen_e_acsl_f2_6) / __gen_e_acsl_f2_8; } return __gen_e_acsl_if_3; } int __gen_e_acsl_g(int n) { int __retres = 0; return __retres; } int __gen_e_acsl_g_5(long n) { int __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_integer_constant.c0000666000000000000000000000241213571573400025362 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; int x; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); /*@ assert 0 ≡ 0; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"0 == 0",6); x = 0; x ++; /*@ assert 0 ≢ 1; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"0 != 1",8); /*@ assert 1152921504606846975 ≡ 0xfffffffffffffff; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"1152921504606846975 == 0xfffffffffffffff",9); /*@ assert 0xffffffffffffffffffffffffffffffff ≡ 0xffffffffffffffffffffffffffffffff; */ { __e_acsl_mpz_t __gen_e_acsl_; int __gen_e_acsl_eq; __gmpz_init_set_str(__gen_e_acsl_, "340282366920938463463374607431768211455",10); __gen_e_acsl_eq = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); __e_acsl_assert(__gen_e_acsl_eq == 0,(char *)"Assertion",(char *)"main", (char *)"0xffffffffffffffffffffffffffffffff == 0xffffffffffffffffffffffffffffffff", 11); __gmpz_clear(__gen_e_acsl_); } __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_let.c0000666000000000000000000001122013571573400022575 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" struct __anonstruct_r_1 { int x ; int y ; }; union __anonunion_s_2 { int x ; char *y ; }; int main(void) { int __retres; union __anonunion_s_2 s; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int n = -2; /*@ assert \let u = n * n; u ≥ 0; */ { long __gen_e_acsl_u; __gen_e_acsl_u = n * (long)n; __e_acsl_assert(__gen_e_acsl_u >= 0L,(char *)"Assertion",(char *)"main", (char *)"\\let u = n * n; u >= 0",7); } /*@ assert \let u = n * n; \let v = u + 1; u > 0; */ { long __gen_e_acsl_u_2; long __gen_e_acsl_v; __gen_e_acsl_u_2 = n * (long)n; __gen_e_acsl_v = __gen_e_acsl_u_2 + 1L; __e_acsl_assert(__gen_e_acsl_u_2 > 0L,(char *)"Assertion",(char *)"main", (char *)"\\let u = n * n;\n\\let v = u + 1; u > 0",9); } /*@ assert (\let u = 1; u) + 1 ≡ 2; */ { int __gen_e_acsl_u_3; __gen_e_acsl_u_3 = 1; __e_acsl_assert(__gen_e_acsl_u_3 + 1 == 2,(char *)"Assertion", (char *)"main",(char *)"(\\let u = 1; u) + 1 == 2",12); } /*@ assert \let u = 1; (\let v = u + 1; v) ≡ 2; */ { int __gen_e_acsl_u_4; int __gen_e_acsl_v_2; __gen_e_acsl_u_4 = 1; __gen_e_acsl_v_2 = __gen_e_acsl_u_4 + 1; __e_acsl_assert(__gen_e_acsl_v_2 == 2,(char *)"Assertion",(char *)"main", (char *)"\\let u = 1; (\\let v = u + 1; v) == 2",14); } /*@ assert \let u = 1; (\let u = u + 1; u) ≡ 2; */ { int __gen_e_acsl_u_5; int __gen_e_acsl_u_6; __gen_e_acsl_u_5 = 1; __gen_e_acsl_u_6 = __gen_e_acsl_u_5 + 1; __e_acsl_assert(__gen_e_acsl_u_6 == 2,(char *)"Assertion",(char *)"main", (char *)"\\let u = 1; (\\let u = u + 1; u) == 2",17); } long m = 0x7fffffffffffffffL; /*@ assert (\let u = m; u * u) > m; */ { long __gen_e_acsl_u_7; __e_acsl_mpz_t __gen_e_acsl_u_8; __e_acsl_mpz_t __gen_e_acsl_mul; __e_acsl_mpz_t __gen_e_acsl_m; int __gen_e_acsl_gt; __gen_e_acsl_u_7 = m; __gmpz_init_set_si(__gen_e_acsl_u_8,__gen_e_acsl_u_7); __gmpz_init(__gen_e_acsl_mul); __gmpz_mul(__gen_e_acsl_mul, (__e_acsl_mpz_struct const *)(__gen_e_acsl_u_8), (__e_acsl_mpz_struct const *)(__gen_e_acsl_u_8)); __gmpz_init_set_si(__gen_e_acsl_m,m); __gen_e_acsl_gt = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul), (__e_acsl_mpz_struct const *)(__gen_e_acsl_m)); __e_acsl_assert(__gen_e_acsl_gt > 0,(char *)"Assertion",(char *)"main", (char *)"(\\let u = m; u * u) > m",21); __gmpz_clear(__gen_e_acsl_u_8); __gmpz_clear(__gen_e_acsl_mul); __gmpz_clear(__gen_e_acsl_m); } char c = (char)'a'; /*@ assert \let u = 'b'; c < u; */ { int __gen_e_acsl_u_9; __gen_e_acsl_u_9 = 'b'; __e_acsl_assert((int)c < __gen_e_acsl_u_9,(char *)"Assertion", (char *)"main",(char *)"\\let u = \'b\'; c < u",24); } float f = 1.0f; __e_acsl_store_block((void *)(& f),(size_t)4); __e_acsl_full_init((void *)(& f)); /*@ assert \let u = f; u ≡ f; */ { float __gen_e_acsl_u_10; __gen_e_acsl_u_10 = f; __e_acsl_assert(__gen_e_acsl_u_10 == f,(char *)"Assertion", (char *)"main",(char *)"\\let u = f; u == f",27); } int t[4] = {1, 2, 3, 4}; /*@ assert \let u = &t[1]; 1 ≡ 1; */ { int * /*[4]*/ __gen_e_acsl_u_11; __gen_e_acsl_u_11 = & t[1]; __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"\\let u = &t[1]; 1 == 1",30); } /*@ assert (\let u = &t[1]; 1) ≡ 1; */ { int * /*[4]*/ __gen_e_acsl_u_12; __gen_e_acsl_u_12 = & t[1]; __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"(\\let u = &t[1]; 1) == 1",32); } struct __anonstruct_r_1 r = {.x = 1, .y = 2}; __e_acsl_store_block((void *)(& r),(size_t)8); __e_acsl_full_init((void *)(& r)); /*@ assert \let u = r; u.x + u.y ≡ 3; */ { struct __anonstruct_r_1 __gen_e_acsl_u_13; __gen_e_acsl_u_13 = r; __e_acsl_assert(__gen_e_acsl_u_13.x + (long)__gen_e_acsl_u_13.y == 3L, (char *)"Assertion",(char *)"main", (char *)"\\let u = r; u.x + u.y == 3",35); } s.x = 5; /*@ assert (\let u = s; u.x) > 0; */ { union __anonunion_s_2 __gen_e_acsl_u_14; __gen_e_acsl_u_14 = s; __e_acsl_assert(__gen_e_acsl_u_14.x > 0,(char *)"Assertion", (char *)"main",(char *)"(\\let u = s; u.x) > 0",39); } __retres = 0; __e_acsl_delete_block((void *)(& r)); __e_acsl_delete_block((void *)(& f)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_longlong.c0000666000000000000000000000553313571573400023642 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" unsigned long long my_pow(unsigned int x, unsigned int n) { unsigned long long __retres; int tmp; unsigned long long tmp_0; if (n <= (unsigned int)1) { __retres = (unsigned long long)1; goto return_label; } tmp_0 = my_pow(x,n / (unsigned int)2); tmp = (int)tmp_0; /*@ assert Eva: signed_overflow: -2147483648 ≤ tmp * tmp; */ /*@ assert Eva: signed_overflow: tmp * tmp ≤ 2147483647; */ tmp *= tmp; if (n % (unsigned int)2 == (unsigned int)0) { __retres = (unsigned long long)tmp; goto return_label; } __retres = (unsigned long long)(x * (unsigned int)tmp); return_label: return __retres; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); unsigned long long x = my_pow((unsigned int)2,(unsigned int)63); /*@ assert (2 * x + 1) % 2 ≡ 1; */ { __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl_x; __e_acsl_mpz_t __gen_e_acsl_mul; __e_acsl_mpz_t __gen_e_acsl__2; __e_acsl_mpz_t __gen_e_acsl_add; __e_acsl_mpz_t __gen_e_acsl__3; int __gen_e_acsl_mod_guard; __e_acsl_mpz_t __gen_e_acsl_mod; long __gen_e_acsl__4; __gmpz_init_set_si(__gen_e_acsl_,2L); __gmpz_init(__gen_e_acsl_x); __gmpz_import(__gen_e_acsl_x,(size_t)1,1,(size_t)8,0,(size_t)0, (void const *)(& x)); __gmpz_init(__gen_e_acsl_mul); __gmpz_mul(__gen_e_acsl_mul,(__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl_x)); __gmpz_init_set_si(__gen_e_acsl__2,1L); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add, (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gmpz_init_set_si(__gen_e_acsl__3,0L); __gen_e_acsl_mod_guard = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl__3)); __gmpz_init(__gen_e_acsl_mod); /*@ assert E_ACSL: 2 ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_mod_guard == 0),(char *)"Assertion", (char *)"main",(char *)"2 == 0",17); __gmpz_tdiv_r(__gen_e_acsl_mod, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add), (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); __gen_e_acsl__4 = __gmpz_get_si((__e_acsl_mpz_struct const *)(__gen_e_acsl_mod)); __e_acsl_assert(__gen_e_acsl__4 == 1L,(char *)"Assertion",(char *)"main", (char *)"(2 * x + 1) % 2 == 1",17); __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl_x); __gmpz_clear(__gen_e_acsl_mul); __gmpz_clear(__gen_e_acsl__2); __gmpz_clear(__gen_e_acsl_add); __gmpz_clear(__gen_e_acsl__3); __gmpz_clear(__gen_e_acsl_mod); } __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_not.c0000666000000000000000000000073113571573400022616 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; /*@ assert x ≡ 0; */ __e_acsl_assert(x == 0,(char *)"Assertion",(char *)"main",(char *)"x == 0", 6); if (x) /*@ assert x ≢ 0; */ __e_acsl_assert(x != 0,(char *)"Assertion",(char *)"main", (char *)"x != 0",7); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_quantif.c0000666000000000000000000002643413571573400023475 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); /*@ assert ∀ ℤ x; 0 ≤ x ≤ 1 ⇒ x ≡ 0 ∨ x ≡ 1; */ { int __gen_e_acsl_forall; int __gen_e_acsl_x; __gen_e_acsl_forall = 1; __gen_e_acsl_x = 0; while (1) { if (__gen_e_acsl_x <= 1) ; else break; { int __gen_e_acsl_or; if (__gen_e_acsl_x == 0) __gen_e_acsl_or = 1; else __gen_e_acsl_or = __gen_e_acsl_x == 1; if (__gen_e_acsl_or) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop1; } } __gen_e_acsl_x ++; } e_acsl_end_loop1: ; __e_acsl_assert(__gen_e_acsl_forall,(char *)"Assertion",(char *)"main", (char *)"\\forall integer x; 0 <= x <= 1 ==> x == 0 || x == 1", 9); } /*@ assert ∀ ℤ x; 0 < x ≤ 1 ⇒ x ≡ 1; */ { int __gen_e_acsl_forall_2; int __gen_e_acsl_x_2; __gen_e_acsl_forall_2 = 1; __gen_e_acsl_x_2 = 0 + 1; while (1) { if (__gen_e_acsl_x_2 <= 1) ; else break; if (__gen_e_acsl_x_2 == 1) ; else { __gen_e_acsl_forall_2 = 0; goto e_acsl_end_loop2; } __gen_e_acsl_x_2 ++; } e_acsl_end_loop2: ; __e_acsl_assert(__gen_e_acsl_forall_2,(char *)"Assertion",(char *)"main", (char *)"\\forall integer x; 0 < x <= 1 ==> x == 1",10); } /*@ assert ∀ ℤ x; 0 ≤ x < 1 ⇒ x ≡ 0; */ { int __gen_e_acsl_forall_3; int __gen_e_acsl_x_3; __gen_e_acsl_forall_3 = 1; __gen_e_acsl_x_3 = 0; while (1) { if (__gen_e_acsl_x_3 < 1) ; else break; if (__gen_e_acsl_x_3 == 0) ; else { __gen_e_acsl_forall_3 = 0; goto e_acsl_end_loop3; } __gen_e_acsl_x_3 ++; } e_acsl_end_loop3: ; __e_acsl_assert(__gen_e_acsl_forall_3,(char *)"Assertion",(char *)"main", (char *)"\\forall integer x; 0 <= x < 1 ==> x == 0",11); } /*@ assert ∀ ℤ x, ℤ y, ℤ z; 0 ≤ x < 2 ∧ 0 ≤ y < 5 ∧ 0 ≤ z ≤ y ⇒ x + z ≤ y + 1; */ { int __gen_e_acsl_forall_4; int __gen_e_acsl_x_4; int __gen_e_acsl_y; int __gen_e_acsl_z; __gen_e_acsl_forall_4 = 1; __gen_e_acsl_x_4 = 0; while (1) { if (__gen_e_acsl_x_4 < 2) ; else break; __gen_e_acsl_y = 0; while (1) { if (__gen_e_acsl_y < 5) ; else break; __gen_e_acsl_z = 0; while (1) { if (__gen_e_acsl_z <= __gen_e_acsl_y) ; else break; if (__gen_e_acsl_x_4 + __gen_e_acsl_z <= __gen_e_acsl_y + 1) ; else { __gen_e_acsl_forall_4 = 0; goto e_acsl_end_loop4; } __gen_e_acsl_z ++; } __gen_e_acsl_y ++; } __gen_e_acsl_x_4 ++; } e_acsl_end_loop4: ; __e_acsl_assert(__gen_e_acsl_forall_4,(char *)"Assertion",(char *)"main", (char *)"\\forall integer x, integer y, integer z;\n 0 <= x < 2 && 0 <= y < 5 && 0 <= z <= y ==> x + z <= y + 1", 15); } /*@ assert ∃ int x; 0 ≤ x < 10 ∧ x ≡ 5; */ { int __gen_e_acsl_exists; int __gen_e_acsl_x_5; __gen_e_acsl_exists = 0; __gen_e_acsl_x_5 = 0; while (1) { if (__gen_e_acsl_x_5 < 10) ; else break; if (! (__gen_e_acsl_x_5 == 5)) ; else { __gen_e_acsl_exists = 1; goto e_acsl_end_loop5; } __gen_e_acsl_x_5 ++; } e_acsl_end_loop5: ; __e_acsl_assert(__gen_e_acsl_exists,(char *)"Assertion",(char *)"main", (char *)"\\exists int x; 0 <= x < 10 && x == 5",20); } /*@ assert ∀ int x; 0 ≤ x < 10 ⇒ x % 2 ≡ 0 ⇒ (∃ ℤ y; 0 ≤ y ≤ x / 2 ∧ x ≡ 2 * y); */ { int __gen_e_acsl_forall_5; int __gen_e_acsl_x_6; __gen_e_acsl_forall_5 = 1; __gen_e_acsl_x_6 = 0; while (1) { if (__gen_e_acsl_x_6 < 10) ; else break; { int __gen_e_acsl_implies; if (! (__gen_e_acsl_x_6 % 2 == 0)) __gen_e_acsl_implies = 1; else { int __gen_e_acsl_exists_2; int __gen_e_acsl_y_2; __gen_e_acsl_exists_2 = 0; __gen_e_acsl_y_2 = 0; while (1) { if (__gen_e_acsl_y_2 <= __gen_e_acsl_x_6 / 2) ; else break; if (! (__gen_e_acsl_x_6 == 2 * __gen_e_acsl_y_2)) ; else { __gen_e_acsl_exists_2 = 1; goto e_acsl_end_loop6; } __gen_e_acsl_y_2 ++; } e_acsl_end_loop6: ; __gen_e_acsl_implies = __gen_e_acsl_exists_2; } if (__gen_e_acsl_implies) ; else { __gen_e_acsl_forall_5 = 0; goto e_acsl_end_loop7; } } __gen_e_acsl_x_6 ++; } e_acsl_end_loop7: ; __e_acsl_assert(__gen_e_acsl_forall_5,(char *)"Assertion",(char *)"main", (char *)"\\forall int x;\n 0 <= x < 10 ==>\n x % 2 == 0 ==> (\\exists integer y; 0 <= y <= x / 2 && x == 2 * y)", 24); } { int buf[10]; __e_acsl_store_block((void *)(buf),(size_t)40); unsigned long len = (unsigned long)9; /*@ assert ∀ ℤ i; 0 ≤ i < 10 ⇒ \valid(&buf[i]); */ { int __gen_e_acsl_forall_6; int __gen_e_acsl_i; __gen_e_acsl_forall_6 = 1; __gen_e_acsl_i = 0; while (1) { if (__gen_e_acsl_i < 10) ; else break; { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(& buf[__gen_e_acsl_i]), sizeof(int), (void *)(& buf[__gen_e_acsl_i]), (void *)0); if (__gen_e_acsl_valid) ; else { __gen_e_acsl_forall_6 = 0; goto e_acsl_end_loop8; } } __gen_e_acsl_i ++; } e_acsl_end_loop8: ; __e_acsl_assert(__gen_e_acsl_forall_6,(char *)"Assertion", (char *)"main", (char *)"\\forall integer i; 0 <= i < 10 ==> \\valid(&buf[i])", 30); } /*@ assert ∀ char i; 0 ≤ i < 10 ⇒ \valid(&buf[i]); */ { int __gen_e_acsl_forall_7; int __gen_e_acsl_i_2; __gen_e_acsl_forall_7 = 1; __gen_e_acsl_i_2 = (char)0; while (1) { if (__gen_e_acsl_i_2 < 10) ; else break; { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)(& buf[__gen_e_acsl_i_2]), sizeof(int), (void *)(& buf[__gen_e_acsl_i_2]), (void *)0); if (__gen_e_acsl_valid_2) ; else { __gen_e_acsl_forall_7 = 0; goto e_acsl_end_loop9; } } __gen_e_acsl_i_2 ++; } e_acsl_end_loop9: ; __e_acsl_assert(__gen_e_acsl_forall_7,(char *)"Assertion", (char *)"main", (char *)"\\forall char i; 0 <= i < 10 ==> \\valid(&buf[i])", 31); } /*@ assert ∀ ℤ i; 0 ≤ i < len ⇒ \valid(&buf[i]); */ { int __gen_e_acsl_forall_8; unsigned long __gen_e_acsl_i_3; __gen_e_acsl_forall_8 = 1; __gen_e_acsl_i_3 = 0UL; while (1) { if (__gen_e_acsl_i_3 < len) ; else break; { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)(& buf[__gen_e_acsl_i_3]), sizeof(int), (void *)(& buf[__gen_e_acsl_i_3]), (void *)0); if (__gen_e_acsl_valid_3) ; else { __gen_e_acsl_forall_8 = 0; goto e_acsl_end_loop10; } } __gen_e_acsl_i_3 ++; } e_acsl_end_loop10: ; __e_acsl_assert(__gen_e_acsl_forall_8,(char *)"Assertion", (char *)"main", (char *)"\\forall integer i; 0 <= i < len ==> \\valid(&buf[i])", 32); } /*@ assert ∀ ℤ i; 0 ≤ i ≤ len ⇒ \valid(&buf[i]); */ { int __gen_e_acsl_forall_9; __e_acsl_mpz_t __gen_e_acsl_i_4; __gen_e_acsl_forall_9 = 1; __gmpz_init(__gen_e_acsl_i_4); { __e_acsl_mpz_t __gen_e_acsl_; __gmpz_init_set_si(__gen_e_acsl_,0L); __gmpz_set(__gen_e_acsl_i_4, (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); __gmpz_clear(__gen_e_acsl_); } while (1) { { __e_acsl_mpz_t __gen_e_acsl_len; int __gen_e_acsl_le; __gmpz_init_set_ui(__gen_e_acsl_len,len); __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_i_4), (__e_acsl_mpz_struct const *)(__gen_e_acsl_len)); if (__gen_e_acsl_le <= 0) ; else break; __gmpz_clear(__gen_e_acsl_len); } { long __gen_e_acsl_i_5; int __gen_e_acsl_valid_4; __gen_e_acsl_i_5 = __gmpz_get_si((__e_acsl_mpz_struct const *)(__gen_e_acsl_i_4)); __gen_e_acsl_valid_4 = __e_acsl_valid((void *)(& buf[__gen_e_acsl_i_5]), sizeof(int), (void *)(& buf[__gen_e_acsl_i_5]), (void *)0); if (__gen_e_acsl_valid_4) ; else { __gen_e_acsl_forall_9 = 0; goto e_acsl_end_loop11; } } { __e_acsl_mpz_t __gen_e_acsl__2; __e_acsl_mpz_t __gen_e_acsl_add; __gmpz_init_set_ui(__gen_e_acsl__2,1UL); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add, (__e_acsl_mpz_struct const *)(__gen_e_acsl_i_4), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gmpz_set(__gen_e_acsl_i_4, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add)); __gmpz_clear(__gen_e_acsl__2); __gmpz_clear(__gen_e_acsl_add); } } e_acsl_end_loop11: ; __e_acsl_assert(__gen_e_acsl_forall_9,(char *)"Assertion", (char *)"main", (char *)"\\forall integer i; 0 <= i <= len ==> \\valid(&buf[i])", 33); __gmpz_clear(__gen_e_acsl_i_4); __e_acsl_delete_block((void *)(buf)); } } /*@ assert ∀ ℤ x; 0 < x < 1 ⇒ \false; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"\\forall integer x; 0 < x < 1 ==> \\false",37); /*@ assert ¬(∃ char c; 10 ≤ c < 10 ∧ c ≡ 10); */ __e_acsl_assert(! 0,(char *)"Assertion",(char *)"main", (char *)"!(\\exists char c; 10 <= c < 10 && c == 10)",38); /*@ assert \let u = 5; ∀ ℤ x, ℤ y; 0 ≤ x < 2 ∧ 4 < y < u ⇒ \false; */ { int __gen_e_acsl_u; __gen_e_acsl_u = 5; __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"\\let u = 5;\n\\forall integer x, integer y; 0 <= x < 2 && 4 < y < u ==> \\false", 40); } __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/gen_rationals.c0000666000000000000000000003157613571573400024025 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /*@ ensures \let delta = 1; \let avg_real = (\old(a) + \old(b)) / 2; avg_real - delta < \result < avg_real + delta; */ double __gen_e_acsl_avg(double a, double b); double avg(double a, double b) { double __retres; __retres = (a + b) / (double)2; return __retres; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); /*@ assert 3 ≢ 1.5; */ __e_acsl_assert(3. != 1.5,(char *)"Assertion",(char *)"main", (char *)"3 != 1.5",12); /*@ assert 3 ≡ 1.5 + 1.5; */ { __e_acsl_mpq_t __gen_e_acsl_; __e_acsl_mpq_t __gen_e_acsl__2; __e_acsl_mpq_t __gen_e_acsl__3; __e_acsl_mpq_t __gen_e_acsl_add; int __gen_e_acsl_eq; __gmpq_init(__gen_e_acsl_); __gmpq_set_str(__gen_e_acsl_,"3",10); __gmpq_init(__gen_e_acsl__2); __gmpq_set_d(__gen_e_acsl__2,1.5); __gmpq_init(__gen_e_acsl__3); __gmpq_set_d(__gen_e_acsl__3,1.5); __gmpq_init(__gen_e_acsl_add); __gmpq_add(__gen_e_acsl_add, (__e_acsl_mpq_struct const *)(__gen_e_acsl__2), (__e_acsl_mpq_struct const *)(__gen_e_acsl__3)); __gen_e_acsl_eq = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl_), (__e_acsl_mpq_struct const *)(__gen_e_acsl_add)); __e_acsl_assert(__gen_e_acsl_eq == 0,(char *)"Assertion",(char *)"main", (char *)"3 == 1.5 + 1.5",13); __gmpq_clear(__gen_e_acsl_); __gmpq_clear(__gen_e_acsl__2); __gmpq_clear(__gen_e_acsl__3); __gmpq_clear(__gen_e_acsl_add); } /*@ assert 0.1 ≡ 0.1; */ { __e_acsl_mpq_t __gen_e_acsl__4; int __gen_e_acsl_eq_2; __gmpq_init(__gen_e_acsl__4); __gmpq_set_str(__gen_e_acsl__4,"01/10",10); __gen_e_acsl_eq_2 = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl__4), (__e_acsl_mpq_struct const *)(__gen_e_acsl__4)); __e_acsl_assert(__gen_e_acsl_eq_2 == 0,(char *)"Assertion", (char *)"main",(char *)"0.1 == 0.1",14); __gmpq_clear(__gen_e_acsl__4); } /*@ assert (double)1.0 ≡ 1.0; */ __e_acsl_assert(1. == 1.,(char *)"Assertion",(char *)"main", (char *)"(double)1.0 == 1.0",15); /*@ assert (double)0.1 ≢ 0.1; */ { __e_acsl_mpq_t __gen_e_acsl__5; double __gen_e_acsl__6; __e_acsl_mpq_t __gen_e_acsl__7; int __gen_e_acsl_ne; __gmpq_init(__gen_e_acsl__5); __gmpq_set_str(__gen_e_acsl__5,"01/10",10); __gen_e_acsl__6 = __gmpq_get_d((__e_acsl_mpq_struct const *)(__gen_e_acsl__5)); __gmpq_init(__gen_e_acsl__7); /*@ assert Eva: is_nan_or_infinite: \is_finite(__gen_e_acsl__6); */ __gmpq_set_d(__gen_e_acsl__7,__gen_e_acsl__6); __gen_e_acsl_ne = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl__7), (__e_acsl_mpq_struct const *)(__gen_e_acsl__5)); __e_acsl_assert(__gen_e_acsl_ne != 0,(char *)"Assertion",(char *)"main", (char *)"(double)0.1 != 0.1",16); __gmpq_clear(__gen_e_acsl__5); __gmpq_clear(__gen_e_acsl__7); } /*@ assert (float)0.1 ≢ (double)0.1; */ { __e_acsl_mpq_t __gen_e_acsl__8; double __gen_e_acsl__9; double __gen_e_acsl__10; __gmpq_init(__gen_e_acsl__8); __gmpq_set_str(__gen_e_acsl__8,"01/10",10); __gen_e_acsl__9 = __gmpq_get_d((__e_acsl_mpq_struct const *)(__gen_e_acsl__8)); __gen_e_acsl__10 = __gmpq_get_d((__e_acsl_mpq_struct const *)(__gen_e_acsl__8)); /*@ assert Eva: is_nan_or_infinite: \is_finite(__gen_e_acsl__9); */ /*@ assert Eva: is_nan_or_infinite: \is_finite(__gen_e_acsl__10); */ /*@ assert Eva: is_nan_or_infinite: \is_finite((float)__gen_e_acsl__9); */ __e_acsl_assert((double)((float)__gen_e_acsl__9) != __gen_e_acsl__10, (char *)"Assertion",(char *)"main", (char *)"(float)0.1 != (double)0.1",17); __gmpq_clear(__gen_e_acsl__8); } /*@ assert (double)1.1 ≢ 1 + 0.1; */ { __e_acsl_mpq_t __gen_e_acsl__11; double __gen_e_acsl__12; __e_acsl_mpq_t __gen_e_acsl__13; __e_acsl_mpq_t __gen_e_acsl__14; __e_acsl_mpq_t __gen_e_acsl_add_2; __e_acsl_mpq_t __gen_e_acsl__15; int __gen_e_acsl_ne_2; __gmpq_init(__gen_e_acsl__11); __gmpq_set_str(__gen_e_acsl__11,"11/10",10); __gen_e_acsl__12 = __gmpq_get_d((__e_acsl_mpq_struct const *)(__gen_e_acsl__11)); __gmpq_init(__gen_e_acsl__13); __gmpq_set_str(__gen_e_acsl__13,"1",10); __gmpq_init(__gen_e_acsl__14); __gmpq_set_str(__gen_e_acsl__14,"01/10",10); __gmpq_init(__gen_e_acsl_add_2); __gmpq_add(__gen_e_acsl_add_2, (__e_acsl_mpq_struct const *)(__gen_e_acsl__13), (__e_acsl_mpq_struct const *)(__gen_e_acsl__14)); __gmpq_init(__gen_e_acsl__15); /*@ assert Eva: is_nan_or_infinite: \is_finite(__gen_e_acsl__12); */ __gmpq_set_d(__gen_e_acsl__15,__gen_e_acsl__12); __gen_e_acsl_ne_2 = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl__15), (__e_acsl_mpq_struct const *)(__gen_e_acsl_add_2)); __e_acsl_assert(__gen_e_acsl_ne_2 != 0,(char *)"Assertion", (char *)"main",(char *)"(double)1.1 != 1 + 0.1",18); __gmpq_clear(__gen_e_acsl__11); __gmpq_clear(__gen_e_acsl__13); __gmpq_clear(__gen_e_acsl__14); __gmpq_clear(__gen_e_acsl_add_2); __gmpq_clear(__gen_e_acsl__15); } /*@ assert 1 + 0.1 ≡ 2 - 0.9; */ { __e_acsl_mpq_t __gen_e_acsl__16; __e_acsl_mpq_t __gen_e_acsl__17; __e_acsl_mpq_t __gen_e_acsl_add_3; __e_acsl_mpq_t __gen_e_acsl__18; __e_acsl_mpq_t __gen_e_acsl__19; __e_acsl_mpq_t __gen_e_acsl_sub; int __gen_e_acsl_eq_3; __gmpq_init(__gen_e_acsl__16); __gmpq_set_str(__gen_e_acsl__16,"1",10); __gmpq_init(__gen_e_acsl__17); __gmpq_set_str(__gen_e_acsl__17,"01/10",10); __gmpq_init(__gen_e_acsl_add_3); __gmpq_add(__gen_e_acsl_add_3, (__e_acsl_mpq_struct const *)(__gen_e_acsl__16), (__e_acsl_mpq_struct const *)(__gen_e_acsl__17)); __gmpq_init(__gen_e_acsl__18); __gmpq_set_str(__gen_e_acsl__18,"2",10); __gmpq_init(__gen_e_acsl__19); __gmpq_set_str(__gen_e_acsl__19,"09/10",10); __gmpq_init(__gen_e_acsl_sub); __gmpq_sub(__gen_e_acsl_sub, (__e_acsl_mpq_struct const *)(__gen_e_acsl__18), (__e_acsl_mpq_struct const *)(__gen_e_acsl__19)); __gen_e_acsl_eq_3 = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl_add_3), (__e_acsl_mpq_struct const *)(__gen_e_acsl_sub)); __e_acsl_assert(__gen_e_acsl_eq_3 == 0,(char *)"Assertion", (char *)"main",(char *)"1 + 0.1 == 2 - 0.9",19); __gmpq_clear(__gen_e_acsl__16); __gmpq_clear(__gen_e_acsl__17); __gmpq_clear(__gen_e_acsl_add_3); __gmpq_clear(__gen_e_acsl__18); __gmpq_clear(__gen_e_acsl__19); __gmpq_clear(__gen_e_acsl_sub); } float x = 0.2f; float y = 0.3f; float sum = x + y; /*@ assert sum ≢ x * y; */ { __e_acsl_mpq_t __gen_e_acsl_y; __e_acsl_mpq_t __gen_e_acsl__20; __e_acsl_mpq_t __gen_e_acsl_mul; __e_acsl_mpq_t __gen_e_acsl__21; int __gen_e_acsl_ne_3; __gmpq_init(__gen_e_acsl_y); __gmpq_set_d(__gen_e_acsl_y,(double)y); __gmpq_init(__gen_e_acsl__20); __gmpq_set_d(__gen_e_acsl__20,(double)x); __gmpq_init(__gen_e_acsl_mul); __gmpq_mul(__gen_e_acsl_mul, (__e_acsl_mpq_struct const *)(__gen_e_acsl__20), (__e_acsl_mpq_struct const *)(__gen_e_acsl_y)); __gmpq_init(__gen_e_acsl__21); __gmpq_set_d(__gen_e_acsl__21,(double)sum); __gen_e_acsl_ne_3 = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl__21), (__e_acsl_mpq_struct const *)(__gen_e_acsl_mul)); __e_acsl_assert(__gen_e_acsl_ne_3 != 0,(char *)"Assertion", (char *)"main",(char *)"sum != x * y",23); __gmpq_clear(__gen_e_acsl_y); __gmpq_clear(__gen_e_acsl__20); __gmpq_clear(__gen_e_acsl_mul); __gmpq_clear(__gen_e_acsl__21); } double d = 0.1; __gen_e_acsl_avg(4.3,11.7); /*@ assert 1.1d ≢ 1 + 0.1; */ { __e_acsl_mpq_t __gen_e_acsl__22; __e_acsl_mpq_t __gen_e_acsl__23; __e_acsl_mpq_t __gen_e_acsl_add_4; __e_acsl_mpq_t __gen_e_acsl__24; int __gen_e_acsl_ne_4; __gmpq_init(__gen_e_acsl__22); __gmpq_set_str(__gen_e_acsl__22,"1",10); __gmpq_init(__gen_e_acsl__23); __gmpq_set_str(__gen_e_acsl__23,"01/10",10); __gmpq_init(__gen_e_acsl_add_4); __gmpq_add(__gen_e_acsl_add_4, (__e_acsl_mpq_struct const *)(__gen_e_acsl__22), (__e_acsl_mpq_struct const *)(__gen_e_acsl__23)); __gmpq_init(__gen_e_acsl__24); __gmpq_set_d(__gen_e_acsl__24,1.1); __gen_e_acsl_ne_4 = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl__24), (__e_acsl_mpq_struct const *)(__gen_e_acsl_add_4)); __e_acsl_assert(__gen_e_acsl_ne_4 != 0,(char *)"Assertion", (char *)"main",(char *)"1.1d != 1 + 0.1",30); __gmpq_clear(__gen_e_acsl__22); __gmpq_clear(__gen_e_acsl__23); __gmpq_clear(__gen_e_acsl_add_4); __gmpq_clear(__gen_e_acsl__24); } __retres = 0; return __retres; } /*@ ensures \let delta = 1; \let avg_real = (\old(a) + \old(b)) / 2; avg_real - delta < \result < avg_real + delta; */ double __gen_e_acsl_avg(double a, double b) { double __gen_e_acsl_at_2; __e_acsl_mpq_t __gen_e_acsl_at; double __retres; __gen_e_acsl_at_2 = b; { __e_acsl_mpq_t __gen_e_acsl_a; __gmpq_init(__gen_e_acsl_a); __gmpq_set_d(__gen_e_acsl_a,a); __gmpq_init(__gen_e_acsl_at); __gmpq_set(__gen_e_acsl_at,(__e_acsl_mpq_struct const *)(__gen_e_acsl_a)); __gmpq_clear(__gen_e_acsl_a); } __retres = avg(a,b); { int __gen_e_acsl_delta; __e_acsl_mpq_t __gen_e_acsl_avg_real; __e_acsl_mpq_t __gen_e_acsl_; __e_acsl_mpq_t __gen_e_acsl_add; __e_acsl_mpq_t __gen_e_acsl__2; __e_acsl_mpq_t __gen_e_acsl_div; __e_acsl_mpq_t __gen_e_acsl_delta_2; __e_acsl_mpq_t __gen_e_acsl_sub; __e_acsl_mpq_t __gen_e_acsl__3; int __gen_e_acsl_lt; int __gen_e_acsl_and; __gen_e_acsl_delta = 1; __gmpq_init(__gen_e_acsl_); __gmpq_set_d(__gen_e_acsl_,__gen_e_acsl_at_2); __gmpq_init(__gen_e_acsl_add); __gmpq_add(__gen_e_acsl_add, (__e_acsl_mpq_struct const *)(__gen_e_acsl_at), (__e_acsl_mpq_struct const *)(__gen_e_acsl_)); __gmpq_init(__gen_e_acsl__2); __gmpq_set_str(__gen_e_acsl__2,"2",10); __gmpq_init(__gen_e_acsl_div); __gmpq_div(__gen_e_acsl_div, (__e_acsl_mpq_struct const *)(__gen_e_acsl_add), (__e_acsl_mpq_struct const *)(__gen_e_acsl__2)); __gmpq_init(__gen_e_acsl_avg_real); __gmpq_set(__gen_e_acsl_avg_real, (__e_acsl_mpq_struct const *)(__gen_e_acsl_div)); __gmpq_init(__gen_e_acsl_delta_2); __gmpq_set_si(__gen_e_acsl_delta_2,(long)__gen_e_acsl_delta); __gmpq_init(__gen_e_acsl_sub); __gmpq_sub(__gen_e_acsl_sub, (__e_acsl_mpq_struct const *)(__gen_e_acsl_avg_real), (__e_acsl_mpq_struct const *)(__gen_e_acsl_delta_2)); __gmpq_init(__gen_e_acsl__3); __gmpq_set_d(__gen_e_acsl__3,__retres); __gen_e_acsl_lt = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl_sub), (__e_acsl_mpq_struct const *)(__gen_e_acsl__3)); if (__gen_e_acsl_lt < 0) { __e_acsl_mpq_t __gen_e_acsl_delta_3; __e_acsl_mpq_t __gen_e_acsl_add_2; __e_acsl_mpq_t __gen_e_acsl__4; int __gen_e_acsl_lt_2; __gmpq_init(__gen_e_acsl_delta_3); __gmpq_set_si(__gen_e_acsl_delta_3,(long)__gen_e_acsl_delta); __gmpq_init(__gen_e_acsl_add_2); __gmpq_add(__gen_e_acsl_add_2, (__e_acsl_mpq_struct const *)(__gen_e_acsl_avg_real), (__e_acsl_mpq_struct const *)(__gen_e_acsl_delta_3)); __gmpq_init(__gen_e_acsl__4); __gmpq_set_d(__gen_e_acsl__4,__retres); __gen_e_acsl_lt_2 = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl__4), (__e_acsl_mpq_struct const *)(__gen_e_acsl_add_2)); __gen_e_acsl_and = __gen_e_acsl_lt_2 < 0; __gmpq_clear(__gen_e_acsl_delta_3); __gmpq_clear(__gen_e_acsl_add_2); __gmpq_clear(__gen_e_acsl__4); } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Postcondition",(char *)"avg", (char *)"\\let delta = 1;\n\\let avg_real = (\\old(a) + \\old(b)) / 2;\n avg_real - delta < \\result < avg_real + delta", 4); __gmpq_clear(__gen_e_acsl_avg_real); __gmpq_clear(__gen_e_acsl_); __gmpq_clear(__gen_e_acsl_add); __gmpq_clear(__gen_e_acsl__2); __gmpq_clear(__gen_e_acsl_div); __gmpq_clear(__gen_e_acsl_delta_2); __gmpq_clear(__gen_e_acsl_sub); __gmpq_clear(__gen_e_acsl__3); __gmpq_clear(__gen_e_acsl_at); return __retres; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/integer_constant.res.oracle0000666000000000000000000000030513571573400026343 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/integer_constant.i:11: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/let.res.oracle0000666000000000000000000000225513571573400023567 0ustar [e-acsl] beginning translation. [e-acsl] tests/arith/let.c:30: Warning: E-ACSL construct `let-binding on array or pointer' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/let.c:7: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:9: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:12: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:14: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:17: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:21: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:21: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/let.c:24: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:27: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:30: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:32: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:35: Warning: assertion got status unknown. [eva:alarm] tests/arith/let.c:39: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/longlong.res.oracle0000666000000000000000000000131313571573400024614 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva] tests/arith/longlong.i:9: Warning: recursive call during value analysis of my_pow (my_pow <- my_pow :: tests/arith/longlong.i:16 <- main). Assuming the call has no effect. The analysis will be unsound. [eva:alarm] tests/arith/longlong.i:10: Warning: signed overflow. assert -2147483648 ≤ tmp * tmp; [eva:alarm] tests/arith/longlong.i:10: Warning: signed overflow. assert tmp * tmp ≤ 2147483647; [eva:alarm] tests/arith/longlong.i:17: Warning: function __gmpz_import: precondition got status unknown. [eva:alarm] tests/arith/longlong.i:17: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/not.res.oracle0000666000000000000000000000011713571573400023576 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/quantif.res.oracle0000666000000000000000000000305313571573400024447 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/quantif.i:9: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:10: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:11: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:15: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:15: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/quantif.i:20: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:24: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:24: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/quantif.i:30: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:30: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/quantif.i:31: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/quantif.i:32: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:32: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/quantif.i:33: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:33: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/quantif.i:37: Warning: assertion got status unknown. [eva:alarm] tests/arith/quantif.i:40: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/oracle_ci/rationals.res.oracle0000666000000000000000000000511213571573400024772 0ustar [kernel:parser:decimal-float] tests/arith/rationals.c:20: Warning: Floating-point constant 0.2f is not represented exactly. Will use 0x1.99999a0000000p-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [e-acsl] beginning translation. [e-acsl] Warning: R to float: double rounding might cause unsoundness [e-acsl] tests/arith/rationals.c:17: Warning: E-ACSL construct `predicate with no definition nor reads clause' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/arith/rationals.c:13: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/rationals.c:14: Warning: assertion got status unknown. [eva:alarm] tests/arith/rationals.c:14: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/rationals.c:16: Warning: assertion got status unknown. [eva:alarm] tests/arith/rationals.c:16: Warning: non-finite double value. assert \is_finite(__gen_e_acsl__6); [eva:alarm] tests/arith/rationals.c:16: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/rationals.c:17: Warning: non-finite double value. assert \is_finite(__gen_e_acsl__9); [eva:alarm] tests/arith/rationals.c:17: Warning: non-finite double value. assert \is_finite(__gen_e_acsl__10); [eva:alarm] tests/arith/rationals.c:17: Warning: non-finite float value. assert \is_finite((float)__gen_e_acsl__9); [eva:alarm] tests/arith/rationals.c:17: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/rationals.c:18: Warning: assertion got status unknown. [eva:alarm] tests/arith/rationals.c:18: Warning: non-finite double value. assert \is_finite(__gen_e_acsl__12); [eva:alarm] tests/arith/rationals.c:18: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/rationals.c:19: Warning: assertion got status unknown. [eva:alarm] tests/arith/rationals.c:19: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/rationals.c:23: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/rationals.c:4: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/arith/rationals.c:4: Warning: function __gen_e_acsl_avg: postcondition got status unknown. [eva:alarm] tests/arith/rationals.c:30: Warning: assertion got status unknown. [eva:alarm] tests/arith/rationals.c:30: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/quantif.i0000666000000000000000000000243013571573400020720 0ustar /* run.config COMMENT: quantifiers */ int main(void) { // simple universal quantifications /*@ assert \forall integer x; 0 <= x <= 1 ==> x == 0 || x == 1; */ /*@ assert \forall integer x; 0 < x <= 1 ==> x == 1; */ /*@ assert \forall integer x; 0 <= x < 1 ==> x == 0; */ /* // multiple universal quantifications */ /*@ assert \forall integer x,y,z; 0 <= x < 2 && 0 <= y < 5 && 0 <= z <= y ==> x+z <= y+1; */ // simple existential quantification /*@ assert \exists int x; 0 <= x < 10 && x == 5; */ // mixed universal and existential quantifications /*@ assert \forall int x; 0 <= x < 10 ==> x % 2 == 0 ==> \exists integer y; 0 <= y <= x/2 && x == 2 * y; */ { // Gitlab issue #42 int buf[10]; unsigned long len = 9; /*@ assert \forall integer i; 0 <= i < 10 ==> \valid(buf+i); */ /*@ assert \forall char i; 0 <= i < 10 ==> \valid(buf+i); */ /*@ assert \forall integer i; 0 <= i < len ==> \valid(buf+i); */ /*@ assert \forall integer i; 0 <= i <= len ==> \valid(buf+i); */ } // Empty quantifications /*@ assert \forall integer x; 0 < x < 1 ==> \false; */ /*@ assert ! \exists char c; 10 <= c < 10 && c == 10; */ ; /*@ assert \let u = 5; \forall integer x,y; 0 <= x < 2 && 4 < y < u ==> \false; */ ; return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/arith/rationals.c0000666000000000000000000000200413571573400021234 0ustar /* real numbers */ /*@ ensures \let delta = 1; \let avg_real = (a+b)/2; avg_real - delta < \result < avg_real + delta; */ double avg(double a, double b) { return (a+b)/2; } int main(void) { /*@ assert 3 != 1.5; */ ; /*@ assert 3 == 1.5 + 1.5; */ ; /*@ assert 0.1 == 0.1; */ ; /*@ assert (double)1.0 == 1.0; */ ; /*@ assert (double)0.1 != 0.1; */ ; /*@ assert (float)0.1 != (double)0.1; */ ; /*@ assert (double)1.1 != 1 + 0.1 ;*/ ; /*@ assert 1 + 0.1 == 2 - 0.9; */ ; float x = 0.2f, y = 0.3f, sum = x + y; /*@ assert sum != x * y; */ ; /* @ assert \let n = 1; 4 == n + 3.0; */ ; // TODO: fail at runtime, I don't know why double d = 0.1; avg(4.3, 11.7); /*@ assert 1.1d != 1 + 0.1; */ ; // Not yet: // long double ld = 0.1l; // /*@ assert d + 1 != ld + 1; */ ; // long double // /*@ assert 3 != 1e5; */ ; // number not written in decimal expansion form ///*@ assert \let n = 99999999999999999999999999; // 4 != n + 3.7; */ ; // creating Q from Z } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/0000777000000000000000000000000013571573400016561 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1304.i0000666000000000000000000000101613571573400020031 0ustar /* run.config COMMENT: argument of functions must be kept, so keep its parameter */ struct msgA { int type; int a[2]; }; struct msgB { int type; double x; }; union msg { struct { int type; } T; struct msgA A; struct msgB B; }; void read_sensor_4(unsigned* m) { /* put 4 bytes from sensors into m */ *m = 0; } int main(void) { unsigned char buf[sizeof(union msg)]; int i; for(i = 0; i < sizeof(buf)/4; i++) read_sensor_4((unsigned*)buf+i); /*@ assert \initialized((union msg*)buf); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1307.i0000666000000000000000000000200213571573400020030 0ustar /* run.config COMMENT: spec with floats and reals */ /*@ requires \valid(Mtmax_in); @ requires \valid(Mwmax); @ requires \valid(Mtmax_out); @ behavior OverEstimate_Motoring: @ assumes \true; @ ensures *Mtmax_out != *Mtmax_in + (5 - (((5 / 80) * *Mwmax) * 0.4)); @*/ void foo(float* Mtmax_in, float* Mwmax, float* Mtmax_out) { /* Real semantics and floating-point semantics give different results because: 1) Mtmax_out is 5.975 is in R 2) The float closest to 5.975 is 5.97499999999999964472863211995 */ *Mtmax_out = *Mtmax_in + (5 - (((5 / 80) * *Mwmax) * 0.4)); } /*@ requires \valid(Mtmin_in); @ requires \valid(Mwmin); @ requires \valid(Mtmin_out); @ @ behavior UnderEstimate_Motoring: @ assumes \true; @ ensures *Mtmin_out == *Mtmin_in < 0.85 * *Mwmin ? *Mtmin_in : 0.85 * *Mwmin; @*/ void bar(float* Mtmin_in, float* Mwmin, float* Mtmin_out) { *Mtmin_out = 0.85 * *Mwmin; } int main(void) { float f = 1.0, g = 1.0, h; foo(&f, &g, &h); bar(&f, &g, &h); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1324.i0000666000000000000000000000071513571573400020040 0ustar /* run.config COMMENT: fixed bug with typing of universal quantification */ /*@ behavior yes: @ assumes \forall int i; 0 < i < n ==> t[i-1] <= t[i]; @ ensures \result == 1; @*/ int sorted(int * t, int n) { int b = 1; if(n <= 1) return 1; for(b = 1; b < n; b++) { if(t[b-1] > t[b]) return 0; } return 1; } int main(void) { int t[7] = { 1, 4, 4, 5, 5, 5, 7 }; int n = sorted(t, 7); /*@ assert n == 1; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1326.i0000666000000000000000000000075413571573400020045 0ustar /* run.config COMMENT: complex term left-values */ typedef int ArrayInt[5]; /*@ ensures *AverageAccel == ((*Accel)[4] + (*Accel)[3] + (*Accel)[2] + (*Accel)[1] + (*Accel)[0]) / 5; @*/ void atp_NORMAL_computeAverageAccel(ArrayInt* Accel,int* AverageAccel) { *AverageAccel = ((*Accel)[4] + (*Accel)[3] + (*Accel)[2] + (*Accel)[1] + (*Accel)[0]) / 5; } int main(void) { ArrayInt Accel = { 1, 2, 3, 4, 5 }; int av; atp_NORMAL_computeAverageAccel(&Accel, &av); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1390.c0000666000000000000000000000123213571573400020030 0ustar /* run.config COMMENT: bts #1390, issue with typing of quantified variables */ #include "stdlib.h" /*@behavior exists: assumes \exists integer i; 0 <= i < (int)n && ((char*)buf)[i] == c; ensures \forall int j; 0 <= j < (int)\offset((char*)\result) ==> ((char*)buf)[j] != c; behavior not_exists: assumes \forall integer k; 0 <= k < (int)n ==> ((char*)buf)[k] != c; ensures \result == (void*) 0; */ void *memchr(const void *buf, int c, size_t n) { int i; char *s = buf; for(i = 0; i < n; i++) { if(*s == c) return s; s++; } return (void*)0; } int main(void) { memchr("toto", 'o', 4); memchr("tata", 'o', 4); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1395.i0000666000000000000000000000040413571573400020043 0ustar /* run.config_ci COMMENT: recursive function STDOPT: +"-eva-ignore-recursive-calls" */ /*@ requires n > 0; */ int fact(int n) { if (n == 1) return 1; return n * fact(n - 1); } int main() { int x = fact(5); /*@ assert x == 120; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1398.c0000666000000000000000000000031113571573400020035 0ustar /* run.config COMMENT: variadic function call */ #include "stdio.h" int main(void) { int x = 0, t[2]; int i = 1; t[0] = 1; t[1] = 2; printf("X=%d, t[0]=%d, t[1]=%d\n", x, t[0], t[i]); } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1399.c0000666000000000000000000000116613571573400020047 0ustar /* run.config COMMENT: complex fields and indexes + potential RTE in \initialized */ #include "stdlib.h" struct spongeStateStruct { unsigned char __attribute__((__aligned__(32))) state[1600 / 8] ; unsigned char __attribute__((__aligned__(32))) dataQueue[1536 / 8] ; unsigned int bitsInQueue ; } __attribute__((__aligned__(32))); typedef struct spongeStateStruct spongeState; int main(void) { spongeState* state = (spongeState*) malloc(sizeof(spongeState)); state->bitsInQueue = 16; /*@ assert ! \initialized(&state->dataQueue[state->bitsInQueue/(unsigned int)8]); */ free(state); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1478.c0000666000000000000000000000050613571573400020042 0ustar /* run.config COMMENT: bts #1478 about wrong detection of initializers in pre-analysis */ int global_i; int* global_i_ptr = &global_i; int global_i = 0; /*@ requires global_i == 0; requires \valid(global_i_ptr); requires global_i_ptr == &global_i; */ void loop(void) { } int main(void) { loop(); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1700.i0000666000000000000000000000030313571573400020027 0ustar /* run.config COMMENT: pointer to an empty struct */ struct toto {}; int main() { struct toto s; //@ assert \valid(&s); struct toto *p; p = &s; //@ assert \valid(p); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1717.i0000666000000000000000000000033413571573400020043 0ustar /* run.config COMMENT: bts #1717, issue with labels on memory-related statements */ int main(void) { int a = 10, *p; goto lbl_1; lbl_2: /*@ assert \valid(p); */ return 0; lbl_1: p = &a; goto lbl_2; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1718.i0000666000000000000000000000052113571573400020042 0ustar /* run.config COMMENT: bts #1718, issue regarding incorrect initialization of literal strings in global arrays with compound initializers COMMENT: no diff COMMENT: no diff COMMENT: no diff */ int main(void) { int a = 10, *p; goto lbl_1; lbl_2: /*@ assert \valid(p); */ return 0; lbl_1: p = &a; goto lbl_2; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1740.i0000666000000000000000000000042113571573400020034 0ustar /* run.config COMMENT: bts #1740, about failure to correctly track local variables in presence of goto */ int main(void) { int *p; { int a = 0; p = &a; /*@ assert \valid(p); */ goto L; } L: /*@ assert ! \valid(p); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts1837.i0000666000000000000000000000063513571573400020052 0ustar /* run.config COMMENT: bts #1837, about initialization of literal strings */ char *S = "foo"; int f(void) { char *s1 = "foo"; char *s2 = "bar"; /*@ assert \valid_read(S); */ /*@ assert \valid_read(s1); */ /*@ assert \valid_read(s2); */ return 0; } int main(void) { int i = 4; while (i--) { char *s = "toto"; /*@ assert \valid_read(s) ; */ /*@ assert !\valid(s) ; */ } f(); } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts2191.c0000666000000000000000000000055713571573400020041 0ustar /* run.config COMMENT: bts #2191, issue with unrolling types of struct members */ struct ST { char *str; int num; }; struct ST _G[] = { { .str = "Struct_G[0]", .num = 99 }, { .str = "Struct_G[1]", .num = 147 } }; int main(int argc, char **argv) { /*@ assert \valid_read(_G[0].str); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts2192.c0000666000000000000000000000027313571573400020035 0ustar /* run.config COMMENT: bts #2292, failures due to unregistered RTL functions */ #include int a; char *n = "134"; int main(int argc, char **argv) { a = argc = atoi(n); } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts2231.i0000666000000000000000000000024513571573400020034 0ustar /* run.config COMMENT: bts #2231, issue with typing of casts */ long A = 0; int main(void) { /*@ assert A + (long)((long)(3 * A) - 1) == -1; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts2252.c0000666000000000000000000000075313571573400020035 0ustar /* run.config COMMENT: bts #2252, failures due to typing of offsets */ #include int main() { char* srcbuf = "Test Code"; int i, loc = 1; char * destbuf = (char*)malloc(10*sizeof(char)); char ch = 'o'; if (destbuf != NULL) { for (i = -1; i < 0; i++) { /*@ assert ! \valid_read(srcbuf + i); */ if (srcbuf[i] == ch) { /* ERROR: Buffer Underrun */ loc = i; } } strncpy (&destbuf[loc], &srcbuf[loc], 1); free(destbuf); } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts2305.c0000666000000000000000000000057013571573400020031 0ustar /* run.config COMMENT: bts #2305, taking the address of a bitfield */ #include struct bitfields { int i : 2; bool j : 1; } t; int test(struct bitfields *a) { return a->i; } int main(int argc, char **argv) { //@ assert \valid_read(&(t.j)); //@ assert \valid_read(&(t.j) + (1..3)); t.j = 1; //@ assert \initialized(&(t.j)); return test(&t); } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts2386.c0000666000000000000000000000043213571573400020037 0ustar /* run.config, run.config_2 COMMENT: pointer substraction */ void f(const void *s, int c, unsigned long n) { const unsigned char *p = s; /*@ assert p - s == n - n; */ /*@ assert p - s == 0; */ } int main() { const char *s = "1234567890"; f(s, '0', 11); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/bts2406.c0000666000000000000000000000042113571573400020026 0ustar /* run.config COMMENT: bts #2306, do not monitor incomplete types */ const char tab[]; /* not monitored */ char t[10]; /* monitored */ int main(void) { char *p = tab; /* monitored */ /*@ assert !\valid(p+(0..9)); */ /*@ assert \valid(t+(0..9)); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/issue69.c0000666000000000000000000000040313571573400020231 0ustar /* run.config COMMENT: typing bug of Issue 69 */ int main(void) { /*@ assert \forall unsigned char c; 4 <= c <= 300 ==> 0 <= c <= 255; */ ; int n = 5; /*@ assert \let m = n > 0 ? 4 : 341; \forall char u; 1 < u < m ==> u > 0; */ ; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/0000777000000000000000000000000013571573400020501 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1304.res.oracle0000666000000000000000000000023213571573400023555 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/bts/bts1304.i:23: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1307.res.oracle0000666000000000000000000000107013571573400023561 0ustar [kernel:parser:decimal-float] tests/bts/bts1307.i:17: Warning: Floating-point constant 0.4 is not represented exactly. Will use 0x1.999999999999ap-2. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/bts/bts1307.i:11: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/bts/bts1307.i:11: Warning: function __gen_e_acsl_foo, behavior OverEstimate_Motoring: postcondition got status invalid. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1324.res.oracle0000666000000000000000000000027113571573400023562 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/bts/bts1324.i:6: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1326.res.oracle0000666000000000000000000000011713571573400023563 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1390.res.oracle0000666000000000000000000000133613571573400023570 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:builtins:missing-spec] tests/bts/bts1390.c:13: Warning: The builtin for function memchr will not be used, as its frama-c libc specification is not available. [eva:alarm] tests/bts/bts1390.c:11: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/bts/bts1390.c:8: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/bts/bts1390.c:12: Warning: function __gen_e_acsl_memchr, behavior not_exists: postcondition got status unknown. (Behavior may be inactive, no reduction performed.) [eva:alarm] tests/bts/bts1390.c:17: Warning: out of bounds read. assert \valid_read(s); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1395.res.oracle0000666000000000000000000000143213571573400023572 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva] tests/bts/bts1395.i:9: Warning: recursive call during value analysis of __gen_e_acsl_fact (__gen_e_acsl_fact <- fact :: tests/bts/bts1395.i:7 <- __gen_e_acsl_fact :: tests/bts/bts1395.i:13 <- main). Assuming the call has no effect. The analysis will be unsound. [eva:alarm] tests/bts/bts1395.i:9: Warning: signed overflow. assert -2147483648 ≤ n * tmp; (tmp from fact(n - 1)) [eva:alarm] tests/bts/bts1395.i:9: Warning: signed overflow. assert n * tmp ≤ 2147483647; (tmp from fact(n - 1)) [eva:alarm] tests/bts/bts1395.i:14: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1398.res.oracle0000666000000000000000000000037013571573400023575 0ustar [e-acsl] beginning translation. [kernel:annot:missing-spec] FRAMAC_SHARE/libc/stdio.h:211: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1399.res.oracle0000666000000000000000000000011713571573400023575 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1478.res.oracle0000666000000000000000000000011713571573400023573 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1700.res.oracle0000666000000000000000000000011713571573400023557 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1717.res.oracle0000666000000000000000000000011713571573400023567 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1718.res.oracle0000666000000000000000000000011713571573400023570 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1740.res.oracle0000666000000000000000000000050513571573400023564 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:locals-escaping] tests/bts/bts1740.i:12: Warning: locals {a} escaping the scope of a block of main through p [eva:alarm] tests/bts/bts1740.i:16: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts1837.res.oracle0000666000000000000000000000025613571573400023576 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/bts/bts1837.i:18: Warning: signed overflow. assert -2147483648 ≤ i - 1; frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts2191.res.oracle0000666000000000000000000000011713571573400023564 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts2192.res.oracle0000666000000000000000000000057113571573400023571 0ustar [e-acsl] beginning translation. [e-acsl] Warning: annotating undefined function `atoi': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] FRAMAC_SHARE/libc/stdlib.h:78: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts2231.res.oracle0000666000000000000000000000045613571573400023565 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/bts/bts2231.i:8: Warning: signed overflow. assert -9223372036854775808 ≤ __gen_e_acsl__2 - 1; [eva:alarm] tests/bts/bts2231.i:8: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts2252.res.oracle0000666000000000000000000000074113571573400023565 0ustar [kernel:typing:implicit-function-declaration] tests/bts/bts2252.c:22: Warning: Calling undeclared function strncpy. Old style K&R code? [e-acsl] beginning translation. [kernel:annot:missing-spec] tests/bts/bts2252.c:22: Warning: Neither code nor specification for function strncpy, generating default assigns from the prototype [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/bts/bts2252.c:17: Warning: out of bounds read. assert \valid_read(srcbuf + i); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts2305.res.oracle0000666000000000000000000000071113571573400023561 0ustar [e-acsl] beginning translation. [e-acsl] tests/bts/bts2305.c:19: Warning: E-ACSL construct `bitfield pointer' is not yet supported. Ignoring annotation. [e-acsl] tests/bts/bts2305.c:20: Warning: E-ACSL construct `bitfield pointer' is not yet supported. Ignoring annotation. [e-acsl] tests/bts/bts2305.c:22: Warning: E-ACSL construct `bitfield pointer' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts2386.res.oracle0000666000000000000000000000027113571573400023573 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/bts/bts2386.c:7: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/bts2406.res.oracle0000666000000000000000000000037713571573400023573 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva] tests/bts/bts2406.c:5: Warning: during initialization of variable 'tab', size of type 'char const []' cannot be computed (Size of array without number of elements.) frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1304.c0000666000000000000000000000255013571573400022600 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" struct msgA { int type ; int a[2] ; }; struct msgB { int type ; double x ; }; struct __anonstruct_T_1 { int type ; }; union msg { struct __anonstruct_T_1 T ; struct msgA A ; struct msgB B ; }; void read_sensor_4(unsigned int *m) { __e_acsl_store_block((void *)(& m),(size_t)8); __e_acsl_initialize((void *)m,sizeof(unsigned int)); *m = (unsigned int)0; __e_acsl_delete_block((void *)(& m)); return; } int main(void) { int __retres; unsigned char buf[sizeof(union msg)]; int i; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(buf),(size_t)16); i = 0; while ((unsigned long)i < sizeof(buf) / (unsigned long)4) { read_sensor_4((unsigned int *)(buf) + i); i ++; } /*@ assert \initialized((union msg *)((unsigned char *)buf)); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(buf), sizeof(union msg)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main", (char *)"\\initialized((union msg *)((unsigned char *)buf))", 23); } __retres = 0; __e_acsl_delete_block((void *)(buf)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1307.c0000666000000000000000000003224113571573400022603 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /*@ requires \valid(Mtmax_in); requires \valid(Mwmax); requires \valid(Mtmax_out); behavior OverEstimate_Motoring: assumes \true; ensures *\old(Mtmax_out) ≢ *\old(Mtmax_in) + (5 - ((5 / 80) * *\old(Mwmax)) * 0.4); */ void __gen_e_acsl_foo(float *Mtmax_in, float *Mwmax, float *Mtmax_out); void foo(float *Mtmax_in, float *Mwmax, float *Mtmax_out) { __e_acsl_store_block((void *)(& Mtmax_out),(size_t)8); __e_acsl_store_block((void *)(& Mwmax),(size_t)8); __e_acsl_store_block((void *)(& Mtmax_in),(size_t)8); __e_acsl_initialize((void *)Mtmax_out,sizeof(float)); *Mtmax_out = (float)((double)*Mtmax_in + ((double)5 - (double)((float)( 5 / 80) * *Mwmax) * 0.4)); __e_acsl_delete_block((void *)(& Mtmax_out)); __e_acsl_delete_block((void *)(& Mwmax)); __e_acsl_delete_block((void *)(& Mtmax_in)); return; } /*@ requires \valid(Mtmin_in); requires \valid(Mwmin); requires \valid(Mtmin_out); behavior UnderEstimate_Motoring: assumes \true; ensures *\old(Mtmin_out) ≡ *\old(Mtmin_in) < 0.85 * *\old(Mwmin)? *\old(Mtmin_in) ≢ 0.: 0.85 * *\old(Mwmin) ≢ 0.; */ void __gen_e_acsl_bar(float *Mtmin_in, float *Mwmin, float *Mtmin_out); void bar(float *Mtmin_in, float *Mwmin, float *Mtmin_out) { __e_acsl_store_block((void *)(& Mtmin_out),(size_t)8); __e_acsl_store_block((void *)(& Mwmin),(size_t)8); __e_acsl_store_block((void *)(& Mtmin_in),(size_t)8); __e_acsl_initialize((void *)Mtmin_out,sizeof(float)); *Mtmin_out = (float)(0.85 * (double)*Mwmin); __e_acsl_delete_block((void *)(& Mtmin_out)); __e_acsl_delete_block((void *)(& Mwmin)); __e_acsl_delete_block((void *)(& Mtmin_in)); return; } int main(void) { int __retres; float h; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& h),(size_t)4); float f = (float)1.0; __e_acsl_store_block((void *)(& f),(size_t)4); __e_acsl_full_init((void *)(& f)); float g = (float)1.0; __e_acsl_store_block((void *)(& g),(size_t)4); __e_acsl_full_init((void *)(& g)); __gen_e_acsl_foo(& f,& g,& h); __gen_e_acsl_bar(& f,& g,& h); __retres = 0; __e_acsl_delete_block((void *)(& h)); __e_acsl_delete_block((void *)(& g)); __e_acsl_delete_block((void *)(& f)); __e_acsl_memory_clean(); return __retres; } /*@ requires \valid(Mtmin_in); requires \valid(Mwmin); requires \valid(Mtmin_out); behavior UnderEstimate_Motoring: assumes \true; ensures *\old(Mtmin_out) ≡ *\old(Mtmin_in) < 0.85 * *\old(Mwmin)? *\old(Mtmin_in) ≢ 0.: 0.85 * *\old(Mwmin) ≢ 0.; */ void __gen_e_acsl_bar(float *Mtmin_in, float *Mwmin, float *Mtmin_out) { float *__gen_e_acsl_at_6; float *__gen_e_acsl_at_5; float *__gen_e_acsl_at_4; float *__gen_e_acsl_at_3; float *__gen_e_acsl_at_2; float *__gen_e_acsl_at; __gen_e_acsl_at_6 = Mwmin; __gen_e_acsl_at_5 = Mtmin_in; __gen_e_acsl_at_4 = Mwmin; __gen_e_acsl_at_3 = Mtmin_in; __gen_e_acsl_at_2 = Mtmin_in; __gen_e_acsl_at = Mtmin_out; { int __gen_e_acsl_valid; int __gen_e_acsl_valid_2; int __gen_e_acsl_valid_3; __e_acsl_store_block((void *)(& Mtmin_out),(size_t)8); __e_acsl_store_block((void *)(& Mwmin),(size_t)8); __e_acsl_store_block((void *)(& Mtmin_in),(size_t)8); __gen_e_acsl_valid = __e_acsl_valid((void *)Mtmin_in,sizeof(float), (void *)Mtmin_in, (void *)(& Mtmin_in)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Precondition",(char *)"bar", (char *)"\\valid(Mtmin_in)",20); __gen_e_acsl_valid_2 = __e_acsl_valid((void *)Mwmin,sizeof(float), (void *)Mwmin,(void *)(& Mwmin)); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Precondition", (char *)"bar",(char *)"\\valid(Mwmin)",21); __gen_e_acsl_valid_3 = __e_acsl_valid((void *)Mtmin_out,sizeof(float), (void *)Mtmin_out, (void *)(& Mtmin_out)); __e_acsl_assert(__gen_e_acsl_valid_3,(char *)"Precondition", (char *)"bar",(char *)"\\valid(Mtmin_out)",22); } bar(Mtmin_in,Mwmin,Mtmin_out); { int __gen_e_acsl_valid_read; int __gen_e_acsl_valid_read_2; int __gen_e_acsl_and; int __gen_e_acsl_if; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)__gen_e_acsl_at_2, sizeof(float), (void *)__gen_e_acsl_at_2, (void *)(& __gen_e_acsl_at_2)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"bar", (char *)"mem_access: \\valid_read(__gen_e_acsl_at_2)",26); __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)__gen_e_acsl_at, sizeof(float), (void *)__gen_e_acsl_at, (void *)(& __gen_e_acsl_at)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE",(char *)"bar", (char *)"mem_access: \\valid_read(__gen_e_acsl_at)",26); if (*__gen_e_acsl_at == *__gen_e_acsl_at_2) { __e_acsl_mpq_t __gen_e_acsl_; __e_acsl_mpq_t __gen_e_acsl__2; __e_acsl_mpq_t __gen_e_acsl_mul; __e_acsl_mpq_t __gen_e_acsl__3; int __gen_e_acsl_lt; __gmpq_init(__gen_e_acsl_); __gmpq_set_str(__gen_e_acsl_,"085/100",10); __gmpq_init(__gen_e_acsl__2); __gmpq_set_d(__gen_e_acsl__2,(double)*__gen_e_acsl_at_4); __gmpq_init(__gen_e_acsl_mul); __gmpq_mul(__gen_e_acsl_mul, (__e_acsl_mpq_struct const *)(__gen_e_acsl_), (__e_acsl_mpq_struct const *)(__gen_e_acsl__2)); __gmpq_init(__gen_e_acsl__3); __gmpq_set_d(__gen_e_acsl__3,(double)*__gen_e_acsl_at_3); __gen_e_acsl_lt = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl__3), (__e_acsl_mpq_struct const *)(__gen_e_acsl_mul)); __gen_e_acsl_and = __gen_e_acsl_lt < 0; __gmpq_clear(__gen_e_acsl_); __gmpq_clear(__gen_e_acsl__2); __gmpq_clear(__gen_e_acsl_mul); __gmpq_clear(__gen_e_acsl__3); } else __gen_e_acsl_and = 0; if (__gen_e_acsl_and) { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)__gen_e_acsl_at_5, sizeof(float), (void *)__gen_e_acsl_at_5, (void *)(& __gen_e_acsl_at_5)); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"RTE",(char *)"bar", (char *)"mem_access: \\valid_read(__gen_e_acsl_at_5)", 26); __gen_e_acsl_if = (double)*__gen_e_acsl_at_5 != 0.; } else { __e_acsl_mpq_t __gen_e_acsl__4; __e_acsl_mpq_t __gen_e_acsl__5; __e_acsl_mpq_t __gen_e_acsl_mul_2; __e_acsl_mpq_t __gen_e_acsl__6; int __gen_e_acsl_ne; __gmpq_init(__gen_e_acsl__4); __gmpq_set_str(__gen_e_acsl__4,"085/100",10); __gmpq_init(__gen_e_acsl__5); __gmpq_set_d(__gen_e_acsl__5,(double)*__gen_e_acsl_at_6); __gmpq_init(__gen_e_acsl_mul_2); __gmpq_mul(__gen_e_acsl_mul_2, (__e_acsl_mpq_struct const *)(__gen_e_acsl__4), (__e_acsl_mpq_struct const *)(__gen_e_acsl__5)); __gmpq_init(__gen_e_acsl__6); __gmpq_set_d(__gen_e_acsl__6,0.); __gen_e_acsl_ne = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl_mul_2), (__e_acsl_mpq_struct const *)(__gen_e_acsl__6)); __gen_e_acsl_if = __gen_e_acsl_ne != 0; __gmpq_clear(__gen_e_acsl__4); __gmpq_clear(__gen_e_acsl__5); __gmpq_clear(__gen_e_acsl_mul_2); __gmpq_clear(__gen_e_acsl__6); } __e_acsl_assert(__gen_e_acsl_if,(char *)"Postcondition",(char *)"bar", (char *)"*\\old(Mtmin_out) == *\\old(Mtmin_in) < 0.85 * *\\old(Mwmin)?\n *\\old(Mtmin_in) != 0.:\n 0.85 * *\\old(Mwmin) != 0.", 26); __e_acsl_delete_block((void *)(& Mtmin_out)); __e_acsl_delete_block((void *)(& Mwmin)); __e_acsl_delete_block((void *)(& Mtmin_in)); return; } } /*@ requires \valid(Mtmax_in); requires \valid(Mwmax); requires \valid(Mtmax_out); behavior OverEstimate_Motoring: assumes \true; ensures *\old(Mtmax_out) ≢ *\old(Mtmax_in) + (5 - ((5 / 80) * *\old(Mwmax)) * 0.4); */ void __gen_e_acsl_foo(float *Mtmax_in, float *Mwmax, float *Mtmax_out) { float *__gen_e_acsl_at_3; float *__gen_e_acsl_at_2; float *__gen_e_acsl_at; __gen_e_acsl_at_3 = Mwmax; __gen_e_acsl_at_2 = Mtmax_in; __gen_e_acsl_at = Mtmax_out; { int __gen_e_acsl_valid; int __gen_e_acsl_valid_2; int __gen_e_acsl_valid_3; __e_acsl_store_block((void *)(& Mtmax_out),(size_t)8); __e_acsl_store_block((void *)(& Mwmax),(size_t)8); __e_acsl_store_block((void *)(& Mtmax_in),(size_t)8); __gen_e_acsl_valid = __e_acsl_valid((void *)Mtmax_in,sizeof(float), (void *)Mtmax_in, (void *)(& Mtmax_in)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Precondition",(char *)"foo", (char *)"\\valid(Mtmax_in)",5); __gen_e_acsl_valid_2 = __e_acsl_valid((void *)Mwmax,sizeof(float), (void *)Mwmax,(void *)(& Mwmax)); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Precondition", (char *)"foo",(char *)"\\valid(Mwmax)",6); __gen_e_acsl_valid_3 = __e_acsl_valid((void *)Mtmax_out,sizeof(float), (void *)Mtmax_out, (void *)(& Mtmax_out)); __e_acsl_assert(__gen_e_acsl_valid_3,(char *)"Precondition", (char *)"foo",(char *)"\\valid(Mtmax_out)",7); } foo(Mtmax_in,Mwmax,Mtmax_out); { __e_acsl_mpq_t __gen_e_acsl_; __e_acsl_mpq_t __gen_e_acsl__2; __e_acsl_mpq_t __gen_e_acsl__3; __e_acsl_mpq_t __gen_e_acsl_div; __e_acsl_mpq_t __gen_e_acsl__4; __e_acsl_mpq_t __gen_e_acsl_mul; __e_acsl_mpq_t __gen_e_acsl__5; __e_acsl_mpq_t __gen_e_acsl_mul_2; __e_acsl_mpq_t __gen_e_acsl_sub; __e_acsl_mpq_t __gen_e_acsl__6; __e_acsl_mpq_t __gen_e_acsl_add; __e_acsl_mpq_t __gen_e_acsl__7; int __gen_e_acsl_ne; __gmpq_init(__gen_e_acsl_); __gmpq_set_str(__gen_e_acsl_,"5",10); __gmpq_init(__gen_e_acsl__2); __gmpq_set_si(__gen_e_acsl__2,5L); __gmpq_init(__gen_e_acsl__3); __gmpq_set_si(__gen_e_acsl__3,80L); __gmpq_init(__gen_e_acsl_div); __gmpq_div(__gen_e_acsl_div, (__e_acsl_mpq_struct const *)(__gen_e_acsl__2), (__e_acsl_mpq_struct const *)(__gen_e_acsl__3)); __gmpq_init(__gen_e_acsl__4); __gmpq_set_d(__gen_e_acsl__4,(double)*__gen_e_acsl_at_3); __gmpq_init(__gen_e_acsl_mul); __gmpq_mul(__gen_e_acsl_mul, (__e_acsl_mpq_struct const *)(__gen_e_acsl_div), (__e_acsl_mpq_struct const *)(__gen_e_acsl__4)); __gmpq_init(__gen_e_acsl__5); __gmpq_set_str(__gen_e_acsl__5,"04/10",10); __gmpq_init(__gen_e_acsl_mul_2); __gmpq_mul(__gen_e_acsl_mul_2, (__e_acsl_mpq_struct const *)(__gen_e_acsl_mul), (__e_acsl_mpq_struct const *)(__gen_e_acsl__5)); __gmpq_init(__gen_e_acsl_sub); __gmpq_sub(__gen_e_acsl_sub,(__e_acsl_mpq_struct const *)(__gen_e_acsl_), (__e_acsl_mpq_struct const *)(__gen_e_acsl_mul_2)); __gmpq_init(__gen_e_acsl__6); __gmpq_set_d(__gen_e_acsl__6,(double)*__gen_e_acsl_at_2); __gmpq_init(__gen_e_acsl_add); __gmpq_add(__gen_e_acsl_add, (__e_acsl_mpq_struct const *)(__gen_e_acsl__6), (__e_acsl_mpq_struct const *)(__gen_e_acsl_sub)); __gmpq_init(__gen_e_acsl__7); __gmpq_set_d(__gen_e_acsl__7,(double)*__gen_e_acsl_at); __gen_e_acsl_ne = __gmpq_cmp((__e_acsl_mpq_struct const *)(__gen_e_acsl__7), (__e_acsl_mpq_struct const *)(__gen_e_acsl_add)); __e_acsl_assert(__gen_e_acsl_ne != 0,(char *)"Postcondition", (char *)"foo", (char *)"*\\old(Mtmax_out) != *\\old(Mtmax_in) + (5 - ((5 / 80) * *\\old(Mwmax)) * 0.4)", 11); __e_acsl_delete_block((void *)(& Mtmax_out)); __e_acsl_delete_block((void *)(& Mwmax)); __e_acsl_delete_block((void *)(& Mtmax_in)); __gmpq_clear(__gen_e_acsl_); __gmpq_clear(__gen_e_acsl__2); __gmpq_clear(__gen_e_acsl__3); __gmpq_clear(__gen_e_acsl_div); __gmpq_clear(__gen_e_acsl__4); __gmpq_clear(__gen_e_acsl_mul); __gmpq_clear(__gen_e_acsl__5); __gmpq_clear(__gen_e_acsl_mul_2); __gmpq_clear(__gen_e_acsl_sub); __gmpq_clear(__gen_e_acsl__6); __gmpq_clear(__gen_e_acsl_add); __gmpq_clear(__gen_e_acsl__7); return; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1324.c0000666000000000000000000000637513571573400022613 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /*@ behavior yes: assumes ∀ int i; 0 < i < n ⇒ *(t + (i - 1)) ≤ *(t + i); ensures \result ≡ 1; */ int __gen_e_acsl_sorted(int *t, int n); int sorted(int *t, int n) { int __retres; int b = 1; if (n <= 1) { __retres = 1; goto return_label; } b = 1; while (b < n) { if (*(t + (b - 1)) > *(t + b)) { __retres = 0; goto return_label; } b ++; } __retres = 1; return_label: return __retres; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int t[7] = {1, 4, 4, 5, 5, 5, 7}; __e_acsl_store_block((void *)(t),(size_t)28); __e_acsl_full_init((void *)(& t)); int n = __gen_e_acsl_sorted(t,7); /*@ assert n ≡ 1; */ __e_acsl_assert(n == 1,(char *)"Assertion",(char *)"main",(char *)"n == 1", 23); __retres = 0; __e_acsl_delete_block((void *)(t)); __e_acsl_memory_clean(); return __retres; } /*@ behavior yes: assumes ∀ int i; 0 < i < n ⇒ *(t + (i - 1)) ≤ *(t + i); ensures \result ≡ 1; */ int __gen_e_acsl_sorted(int *t, int n) { int __gen_e_acsl_at; int __retres; { int __gen_e_acsl_forall; int __gen_e_acsl_i; __gen_e_acsl_forall = 1; __gen_e_acsl_i = 0 + 1; while (1) { if (__gen_e_acsl_i < n) ; else break; { int __gen_e_acsl_valid_read; int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(t + __gen_e_acsl_i), sizeof(int),(void *)t, (void *)(& t)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE", (char *)"sorted", (char *)"mem_access: \\valid_read(t + __gen_e_acsl_i)", 6); __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(t + ( __gen_e_acsl_i - 1L)), sizeof(int), (void *)t, (void *)(& t)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE", (char *)"sorted", (char *)"mem_access: \\valid_read(t + (long)(__gen_e_acsl_i - 1))", 6); if (*(t + (__gen_e_acsl_i - 1L)) <= *(t + __gen_e_acsl_i)) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop1; } } __gen_e_acsl_i ++; } e_acsl_end_loop1: ; __gen_e_acsl_at = __gen_e_acsl_forall; } __e_acsl_store_block((void *)(& t),(size_t)8); __retres = sorted(t,n); { int __gen_e_acsl_implies; if (! __gen_e_acsl_at) __gen_e_acsl_implies = 1; else __gen_e_acsl_implies = __retres == 1; __e_acsl_assert(__gen_e_acsl_implies,(char *)"Postcondition", (char *)"sorted", (char *)"\\old(\\forall int i; 0 < i < n ==> *(t + (i - 1)) <= *(t + i)) ==>\n\\result == 1", 7); __e_acsl_delete_block((void *)(& t)); return __retres; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1326.c0000666000000000000000000001414013571573400022602 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; typedef int ArrayInt[5]; /*@ ensures *\old(AverageAccel) ≡ (((((*\old(Accel))[4] + (*\old(Accel))[3]) + (*\old(Accel))[2]) + (*\old(Accel))[1]) + (*\old(Accel))[0]) / 5; */ void __gen_e_acsl_atp_NORMAL_computeAverageAccel(ArrayInt *Accel, int *AverageAccel); void atp_NORMAL_computeAverageAccel(ArrayInt *Accel, int *AverageAccel) { __e_acsl_store_block((void *)(& AverageAccel),(size_t)8); __e_acsl_store_block((void *)(& Accel),(size_t)8); __e_acsl_initialize((void *)AverageAccel,sizeof(int)); *AverageAccel = (((((*Accel)[4] + (*Accel)[3]) + (*Accel)[2]) + (*Accel)[1]) + (*Accel)[0]) / 5; __e_acsl_delete_block((void *)(& AverageAccel)); __e_acsl_delete_block((void *)(& Accel)); return; } int main(void) { int __retres; int av; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& av),(size_t)4); ArrayInt Accel = {1, 2, 3, 4, 5}; __e_acsl_store_block((void *)(Accel),(size_t)20); __e_acsl_full_init((void *)(& Accel)); __gen_e_acsl_atp_NORMAL_computeAverageAccel(& Accel,& av); __retres = 0; __e_acsl_delete_block((void *)(& av)); __e_acsl_delete_block((void *)(Accel)); __e_acsl_memory_clean(); return __retres; } /*@ ensures *\old(AverageAccel) ≡ (((((*\old(Accel))[4] + (*\old(Accel))[3]) + (*\old(Accel))[2]) + (*\old(Accel))[1]) + (*\old(Accel))[0]) / 5; */ void __gen_e_acsl_atp_NORMAL_computeAverageAccel(ArrayInt *Accel, int *AverageAccel) { ArrayInt *__gen_e_acsl_at_6; ArrayInt *__gen_e_acsl_at_5; ArrayInt *__gen_e_acsl_at_4; ArrayInt *__gen_e_acsl_at_3; ArrayInt *__gen_e_acsl_at_2; int *__gen_e_acsl_at; __gen_e_acsl_at_6 = Accel; __gen_e_acsl_at_5 = Accel; __gen_e_acsl_at_4 = Accel; __gen_e_acsl_at_3 = Accel; __gen_e_acsl_at_2 = Accel; __gen_e_acsl_at = AverageAccel; __e_acsl_store_block((void *)(& AverageAccel),(size_t)8); __e_acsl_store_block((void *)(& Accel),(size_t)8); atp_NORMAL_computeAverageAccel(Accel,AverageAccel); { int __gen_e_acsl_valid_read; int __gen_e_acsl_valid_read_2; int __gen_e_acsl_valid_read_3; int __gen_e_acsl_valid_read_4; int __gen_e_acsl_valid_read_5; int __gen_e_acsl_valid_read_6; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(*__gen_e_acsl_at_6), sizeof(int), (void *)(*__gen_e_acsl_at_6), (void *)(*__gen_e_acsl_at_6)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE", (char *)"atp_NORMAL_computeAverageAccel", (char *)"mem_access: \\valid_read((int *)*__gen_e_acsl_at_6)", 8); __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(& (*__gen_e_acsl_at_5)[1]), sizeof(int), (void *)(& (*__gen_e_acsl_at_5)[1]), (void *)0); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE", (char *)"atp_NORMAL_computeAverageAccel", (char *)"mem_access: \\valid_read(&(*__gen_e_acsl_at_5)[1])", 8); __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)(& (*__gen_e_acsl_at_4)[2]), sizeof(int), (void *)(& (*__gen_e_acsl_at_4)[2]), (void *)0); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"RTE", (char *)"atp_NORMAL_computeAverageAccel", (char *)"mem_access: \\valid_read(&(*__gen_e_acsl_at_4)[2])", 8); __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)(& (*__gen_e_acsl_at_3)[3]), sizeof(int), (void *)(& (*__gen_e_acsl_at_3)[3]), (void *)0); __e_acsl_assert(__gen_e_acsl_valid_read_4,(char *)"RTE", (char *)"atp_NORMAL_computeAverageAccel", (char *)"mem_access: \\valid_read(&(*__gen_e_acsl_at_3)[3])", 8); __gen_e_acsl_valid_read_5 = __e_acsl_valid_read((void *)(& (*__gen_e_acsl_at_2)[4]), sizeof(int), (void *)(& (*__gen_e_acsl_at_2)[4]), (void *)0); __e_acsl_assert(__gen_e_acsl_valid_read_5,(char *)"RTE", (char *)"atp_NORMAL_computeAverageAccel", (char *)"mem_access: \\valid_read(&(*__gen_e_acsl_at_2)[4])", 8); __gen_e_acsl_valid_read_6 = __e_acsl_valid_read((void *)__gen_e_acsl_at, sizeof(int), (void *)__gen_e_acsl_at, (void *)(& __gen_e_acsl_at)); __e_acsl_assert(__gen_e_acsl_valid_read_6,(char *)"RTE", (char *)"atp_NORMAL_computeAverageAccel", (char *)"mem_access: \\valid_read(__gen_e_acsl_at)",8); __e_acsl_assert(*__gen_e_acsl_at == (int)((((((*__gen_e_acsl_at_2)[4] + (long)(*__gen_e_acsl_at_3)[3]) + (*__gen_e_acsl_at_4)[2]) + (*__gen_e_acsl_at_5)[1]) + (*__gen_e_acsl_at_6)[0]) / 5L), (char *)"Postcondition", (char *)"atp_NORMAL_computeAverageAccel", (char *)"*\\old(AverageAccel) ==\n(((((*\\old(Accel))[4] + (*\\old(Accel))[3]) + (*\\old(Accel))[2]) +\n (*\\old(Accel))[1])\n + (*\\old(Accel))[0])\n/ 5", 8); __e_acsl_delete_block((void *)(& AverageAccel)); __e_acsl_delete_block((void *)(& Accel)); return; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1390.c0000666000000000000000000001715013571573400022607 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_2; extern int __e_acsl_sound_verdict; /*@ behavior exists: assumes ∃ ℤ i; 0 ≤ i < (int)n ∧ (int)*((char *)buf + i) ≡ c; ensures ∀ int j; 0 ≤ j < (int)\offset((char *)\result) ⇒ (int)*((char *)\old(buf) + j) ≢ \old(c); behavior not_exists: assumes ∀ ℤ k; 0 ≤ k < (int)n ⇒ (int)*((char *)buf + k) ≢ c; ensures \result ≡ (void *)0; */ void *__gen_e_acsl_memchr(void const *buf, int c, size_t n); void *memchr(void const *buf, int c, size_t n) { void *__retres; int i; __e_acsl_store_block((void *)(& __retres),(size_t)8); __e_acsl_store_block((void *)(& buf),(size_t)8); char *s = (char *)buf; __e_acsl_store_block((void *)(& s),(size_t)8); __e_acsl_full_init((void *)(& s)); i = 0; while ((size_t)i < n) { /*@ assert Eva: mem_access: \valid_read(s); */ if ((int)*s == c) { __e_acsl_full_init((void *)(& __retres)); __retres = (void *)s; goto return_label; } __e_acsl_full_init((void *)(& s)); s ++; i ++; } __e_acsl_full_init((void *)(& __retres)); __retres = (void *)0; return_label: { __e_acsl_delete_block((void *)(& buf)); __e_acsl_delete_block((void *)(& s)); __e_acsl_delete_block((void *)(& __retres)); return __retres; } } /*@ behavior exists: assumes ∃ ℤ i; 0 ≤ i < (int)n ∧ (int)*((char *)buf + i) ≡ c; ensures ∀ int j; 0 ≤ j < (int)\offset((char *)\result) ⇒ (int)*((char *)\old(buf) + j) ≢ \old(c); behavior not_exists: assumes ∀ ℤ k; 0 ≤ k < (int)n ⇒ (int)*((char *)buf + k) ≢ c; ensures \result ≡ (void *)0; */ void *__gen_e_acsl_memchr(void const *buf, int c, size_t n) { int __gen_e_acsl_at_4; int __gen_e_acsl_at_3; void const *__gen_e_acsl_at_2; int __gen_e_acsl_at; void *__retres; __e_acsl_store_block((void *)(& __retres),(size_t)8); { int __gen_e_acsl_forall_2; unsigned int __gen_e_acsl_k; __gen_e_acsl_forall_2 = 1; __gen_e_acsl_k = 0U; while (1) { if (__gen_e_acsl_k < (unsigned int)((int)((unsigned int)n))) ; else break; { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)((char *)buf + __gen_e_acsl_k), sizeof(char), (void *)buf, (void *)(& buf)); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"RTE", (char *)"memchr", (char *)"mem_access: \\valid_read((char *)buf + __gen_e_acsl_k)", 11); if ((int)*((char *)buf + __gen_e_acsl_k) != c) ; else { __gen_e_acsl_forall_2 = 0; goto e_acsl_end_loop3; } } __gen_e_acsl_k ++; } e_acsl_end_loop3: ; __gen_e_acsl_at_4 = __gen_e_acsl_forall_2; } __gen_e_acsl_at_3 = c; __gen_e_acsl_at_2 = buf; { int __gen_e_acsl_exists; unsigned int __gen_e_acsl_i; __gen_e_acsl_exists = 0; __gen_e_acsl_i = 0U; while (1) { if (__gen_e_acsl_i < (unsigned int)((int)((unsigned int)n))) ; else break; { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)((char *)buf + __gen_e_acsl_i), sizeof(char), (void *)buf, (void *)(& buf)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE", (char *)"memchr", (char *)"mem_access: \\valid_read((char *)buf + __gen_e_acsl_i)", 8); if (! ((int)*((char *)buf + __gen_e_acsl_i) == c)) ; else { __gen_e_acsl_exists = 1; goto e_acsl_end_loop1; } } __gen_e_acsl_i ++; } e_acsl_end_loop1: ; __gen_e_acsl_at = __gen_e_acsl_exists; } __e_acsl_store_block((void *)(& buf),(size_t)8); __retres = memchr(buf,c,n); { int __gen_e_acsl_implies; int __gen_e_acsl_implies_2; if (! __gen_e_acsl_at) __gen_e_acsl_implies = 1; else { int __gen_e_acsl_forall; unsigned int __gen_e_acsl_j; __gen_e_acsl_forall = 1; __gen_e_acsl_j = 0; while (1) { { unsigned long __gen_e_acsl_offset; __gen_e_acsl_offset = __e_acsl_offset(__retres); if (__gen_e_acsl_j < (unsigned int)((int)((unsigned int)__gen_e_acsl_offset))) ; else break; } { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)((char *)__gen_e_acsl_at_2 + __gen_e_acsl_j), sizeof(char), (void *)__gen_e_acsl_at_2, (void *)(& __gen_e_acsl_at_2)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE", (char *)"memchr", (char *)"mem_access: \\valid_read((char *)__gen_e_acsl_at_2 + __gen_e_acsl_j)", 9); if ((int)*((char *)__gen_e_acsl_at_2 + __gen_e_acsl_j) != __gen_e_acsl_at_3) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop2; } } __gen_e_acsl_j ++; } e_acsl_end_loop2: ; __gen_e_acsl_implies = __gen_e_acsl_forall; } __e_acsl_assert(__gen_e_acsl_implies,(char *)"Postcondition", (char *)"memchr", (char *)"\\old(\\exists integer i; 0 <= i < (int)n && (int)*((char *)buf + i) == c) ==>\n(\\forall int j;\n 0 <= j < (int)\\offset((char *)\\result) ==>\n (int)*((char *)\\old(buf) + j) != \\old(c))", 9); if (! __gen_e_acsl_at_4) __gen_e_acsl_implies_2 = 1; else __gen_e_acsl_implies_2 = __retres == (void *)0; __e_acsl_assert(__gen_e_acsl_implies_2,(char *)"Postcondition", (char *)"memchr", (char *)"\\old(\\forall integer k; 0 <= k < (int)n ==> (int)*((char *)buf + k) != c) ==>\n\\result == (void *)0", 12); __e_acsl_delete_block((void *)(& buf)); __e_acsl_delete_block((void *)(& __retres)); return __retres; } } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "toto"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("toto")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_2 = "tata"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2, sizeof("tata")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __gen_e_acsl_memchr((void const *)__gen_e_acsl_literal_string,'o', (unsigned long)4); __gen_e_acsl_memchr((void const *)__gen_e_acsl_literal_string_2,'o', (unsigned long)4); __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1395.c0000666000000000000000000000173613571573400022617 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /*@ requires n > 0; */ int __gen_e_acsl_fact(int n); int fact(int n) { int __retres; int tmp; if (n == 1) { __retres = 1; goto return_label; } tmp = __gen_e_acsl_fact(n - 1); ; /*@ assert Eva: signed_overflow: -2147483648 ≤ n * tmp; */ /*@ assert Eva: signed_overflow: n * tmp ≤ 2147483647; */ __retres = n * tmp; return_label: return __retres; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = __gen_e_acsl_fact(5); /*@ assert x ≡ 120; */ __e_acsl_assert(x == 120,(char *)"Assertion",(char *)"main", (char *)"x == 120",14); __retres = 0; return __retres; } /*@ requires n > 0; */ int __gen_e_acsl_fact(int n) { int __retres; __e_acsl_assert(n > 0,(char *)"Precondition",(char *)"fact", (char *)"n > 0",6); __retres = fact(n); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1398.c0000666000000000000000000000153613571573400022620 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "X=%d, t[0]=%d, t[1]=%d\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string, sizeof("X=%d, t[0]=%d, t[1]=%d\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); } return; } int main(void) { int __retres; int t[2]; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); int x = 0; int i = 1; t[0] = 1; t[1] = 2; printf(__gen_e_acsl_literal_string,x,t[0],t[i]); __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1399.c0000666000000000000000000000371213571573400022617 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" struct spongeStateStruct { unsigned char __attribute__((__aligned__(32))) state[1600 / 8] ; unsigned char __attribute__((__aligned__(32))) dataQueue[1536 / 8] ; unsigned int bitsInQueue ; } __attribute__((__aligned__(32))); typedef struct spongeStateStruct spongeState; int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); spongeState *state = malloc(sizeof(spongeState)); __e_acsl_store_block((void *)(& state),(size_t)8); __e_acsl_full_init((void *)(& state)); __e_acsl_initialize((void *)(& state->bitsInQueue),sizeof(unsigned int)); state->bitsInQueue = (unsigned int)16; /*@ assert ¬\initialized(&state->dataQueue[state->bitsInQueue / 8]); */ { int __gen_e_acsl_valid_read; int __gen_e_acsl_initialized; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(& state->bitsInQueue), sizeof(unsigned int), (void *)(& state->bitsInQueue), (void *)0); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(&state->bitsInQueue)", 19); __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& state->dataQueue[ state->bitsInQueue / 8U]), sizeof(unsigned char __attribute__(( __aligned__(32))))); __e_acsl_assert(! __gen_e_acsl_initialized,(char *)"Assertion", (char *)"main", (char *)"!\\initialized(&state->dataQueue[state->bitsInQueue / 8])", 19); } free((void *)state); __retres = 0; __e_acsl_delete_block((void *)(& state)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1478.c0000666000000000000000000000343013571573400022612 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; int global_i; int *global_i_ptr = & global_i; int global_i = 0; /*@ requires global_i ≡ 0; requires \valid(global_i_ptr); requires global_i_ptr ≡ &global_i; */ void __gen_e_acsl_loop(void); void loop(void) { return; } /*@ requires global_i ≡ 0; requires \valid(global_i_ptr); requires global_i_ptr ≡ &global_i; */ void __gen_e_acsl_loop(void) { { int __gen_e_acsl_valid; __e_acsl_assert(global_i == 0,(char *)"Precondition",(char *)"loop", (char *)"global_i == 0",9); __gen_e_acsl_valid = __e_acsl_valid((void *)global_i_ptr,sizeof(int), (void *)global_i_ptr, (void *)(& global_i_ptr)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Precondition",(char *)"loop", (char *)"\\valid(global_i_ptr)",10); __e_acsl_assert(global_i_ptr == & global_i,(char *)"Precondition", (char *)"loop",(char *)"global_i_ptr == &global_i",11); } loop(); return; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& global_i_ptr),(size_t)8); __e_acsl_full_init((void *)(& global_i_ptr)); __e_acsl_store_block((void *)(& global_i),(size_t)4); __e_acsl_full_init((void *)(& global_i)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __gen_e_acsl_loop(); __retres = 0; __e_acsl_delete_block((void *)(& global_i_ptr)); __e_acsl_delete_block((void *)(& global_i)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1700.c0000666000000000000000000000271313571573400022601 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" struct toto { }; int main(void) { int __retres; struct toto s; struct toto *p; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_store_block((void *)(& s),(size_t)0); /*@ assert \valid(&s); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(& s),sizeof(struct toto), (void *)(& s),(void *)0); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"\\valid(&s)",9); } __e_acsl_full_init((void *)(& p)); p = & s; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(struct toto *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)p,sizeof(struct toto), (void *)p,(void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid_2; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",12); } __retres = 0; __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& s)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1717.c0000666000000000000000000000236413571573400022613 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; int *p; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); int a = 10; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); goto lbl_1; lbl_2: /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",10); } __retres = 0; goto return_label; lbl_1: { __e_acsl_full_init((void *)(& p)); p = & a; } goto lbl_2; return_label: { __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1718.c0000666000000000000000000000236413571573400022614 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; int *p; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); int a = 10; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); goto lbl_1; lbl_2: /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",13); } __retres = 0; goto return_label; lbl_1: { __e_acsl_full_init((void *)(& p)); p = & a; } goto lbl_2; return_label: { __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1740.c0000666000000000000000000000365713571573400022615 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; int *p; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); { int a = 0; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); __e_acsl_full_init((void *)(& p)); p = & a; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",11); } __e_acsl_delete_block((void *)(& a)); goto L; __e_acsl_delete_block((void *)(& a)); } L: /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; /*@ assert Eva: dangling_pointer: ¬\dangling(&p); */ __gen_e_acsl_valid_2 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"!\\valid(p)",16); } __retres = 0; __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts1837.c0000666000000000000000000001320213571573400022607 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string_3; char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_2; char *S = (char *)"foo"; int f(void) { int __retres; char *s1 = (char *)__gen_e_acsl_literal_string; __e_acsl_store_block((void *)(& s1),(size_t)8); __e_acsl_full_init((void *)(& s1)); char *s2 = (char *)__gen_e_acsl_literal_string_2; __e_acsl_store_block((void *)(& s2),(size_t)8); __e_acsl_full_init((void *)(& s2)); /*@ assert \valid_read(S); */ { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)S,sizeof(char), (void *)S,(void *)(& S)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"Assertion",(char *)"f", (char *)"\\valid_read(S)",10); } /*@ assert \valid_read(s1); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& s1), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)s1, sizeof(char), (void *)s1, (void *)(& s1)); __gen_e_acsl_and = __gen_e_acsl_valid_read_2; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"f", (char *)"\\valid_read(s1)",11); } /*@ assert \valid_read(s2); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& s2), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)s2, sizeof(char), (void *)s2, (void *)(& s2)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_read_3; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion",(char *)"f", (char *)"\\valid_read(s2)",12); } __retres = 0; __e_acsl_delete_block((void *)(& s2)); __e_acsl_delete_block((void *)(& s1)); return __retres; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string_3 = "toto"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3, sizeof("toto")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3); __gen_e_acsl_literal_string = "foo"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("foo")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_2 = "bar"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2,sizeof("bar")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __e_acsl_store_block((void *)(& S),(size_t)8); __e_acsl_full_init((void *)(& S)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); int i = 4; while (1) { int tmp; tmp = i; /*@ assert Eva: signed_overflow: -2147483648 ≤ i - 1; */ i --; ; if (! tmp) break; { char *s = (char *)__gen_e_acsl_literal_string_3; __e_acsl_store_block((void *)(& s),(size_t)8); __e_acsl_full_init((void *)(& s)); /*@ assert \valid_read(s); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& s), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)s, sizeof(char), (void *)s, (void *)(& s)); __gen_e_acsl_and = __gen_e_acsl_valid_read; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(s)",20); } /*@ assert ¬\valid(s); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& s), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)s,sizeof(char), (void *)s,(void *)(& s)); __gen_e_acsl_and_2 = __gen_e_acsl_valid; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion", (char *)"main",(char *)"!\\valid(s)",21); __e_acsl_delete_block((void *)(& s)); } } } f(); __retres = 0; __e_acsl_delete_block((void *)(& S)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts2191.c0000666000000000000000000000417713571573400022614 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_2; struct ST { char *str ; int num ; }; struct ST _G[2] = {{.str = (char *)"Struct_G[0]", .num = 99}, {.str = (char *)"Struct_G[1]", .num = 147}}; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "Struct_G[1]"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string, sizeof("Struct_G[1]")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_2 = "Struct_G[0]"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2, sizeof("Struct_G[0]")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __e_acsl_store_block((void *)(_G),(size_t)32); __e_acsl_full_init((void *)(& _G)); } return; } int main(int argc, char **argv) { int __retres; __e_acsl_memory_init(& argc,& argv,(size_t)8); __e_acsl_globals_init(); /*@ assert \valid_read(_G[0].str); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& _G[0].str), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)_G[0].str, sizeof(char), (void *)_G[0].str, (void *)(& _G[0].str)); __gen_e_acsl_and = __gen_e_acsl_valid_read; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(_G[0].str)",22); } __retres = 0; __e_acsl_delete_block((void *)(_G)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts2192.c0000666000000000000000000000166213571573400022611 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; extern int __e_acsl_sound_verdict; int a; char *n = (char *)"134"; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "134"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("134")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __e_acsl_store_block((void *)(& n),(size_t)8); __e_acsl_full_init((void *)(& n)); } return; } int main(int argc, char **argv) { int __retres; __e_acsl_memory_init(& argc,& argv,(size_t)8); __e_acsl_globals_init(); argc = __gen_e_acsl_atoi((char const *)n); a = argc; __retres = 0; __e_acsl_delete_block((void *)(& n)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts2231.c0000666000000000000000000000342413571573400022601 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" long A = (long)0; int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); /*@ assert A + (long)((long)(3 * A) - 1) ≡ -1; */ { __e_acsl_mpz_t __gen_e_acsl_A; __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl_mul; long __gen_e_acsl__2; __e_acsl_mpz_t __gen_e_acsl__3; __e_acsl_mpz_t __gen_e_acsl_add; __e_acsl_mpz_t __gen_e_acsl__4; int __gen_e_acsl_eq; __gmpz_init_set_si(__gen_e_acsl_A,A); __gmpz_init_set_si(__gen_e_acsl_,3L); __gmpz_init(__gen_e_acsl_mul); __gmpz_mul(__gen_e_acsl_mul,(__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl_A)); __gen_e_acsl__2 = __gmpz_get_si((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul)); /*@ assert Eva: signed_overflow: -9223372036854775808 ≤ __gen_e_acsl__2 - 1; */ __gmpz_init_set_si(__gen_e_acsl__3,__gen_e_acsl__2 - 1L); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add, (__e_acsl_mpz_struct const *)(__gen_e_acsl_A), (__e_acsl_mpz_struct const *)(__gen_e_acsl__3)); __gmpz_init_set_si(__gen_e_acsl__4,(long)(-1)); __gen_e_acsl_eq = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add), (__e_acsl_mpz_struct const *)(__gen_e_acsl__4)); __e_acsl_assert(__gen_e_acsl_eq == 0,(char *)"Assertion",(char *)"main", (char *)"A + (long)((long)(3 * A) - 1) == -1",8); __gmpz_clear(__gen_e_acsl_A); __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl_mul); __gmpz_clear(__gen_e_acsl__3); __gmpz_clear(__gen_e_acsl_add); __gmpz_clear(__gen_e_acsl__4); } __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts2252.c0000666000000000000000000000422513571573400022604 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; /*@ assigns \result, *(x_0 + (0 ..)), *(x_1 + (0 ..)); assigns \result \from *(x_0 + (0 ..)), *(x_1 + (0 ..)), x_2; assigns *(x_0 + (0 ..)) \from *(x_0 + (0 ..)), *(x_1 + (0 ..)), x_2; assigns *(x_1 + (0 ..)) \from *(x_0 + (0 ..)), *(x_1 + (0 ..)), x_2; */ extern int ( /* missing proto */ strncpy)(char *x_0, char *x_1, int x_2); void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "Test Code"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string, sizeof("Test Code")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); } return; } int main(void) { int __retres; int i; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); char *srcbuf = (char *)__gen_e_acsl_literal_string; __e_acsl_store_block((void *)(& srcbuf),(size_t)8); __e_acsl_full_init((void *)(& srcbuf)); int loc = 1; char *destbuf = malloc((unsigned long)10 * sizeof(char)); char ch = (char)'o'; if (destbuf != (char *)0) { i = -1; while (i < 0) { /*@ assert ¬\valid_read(srcbuf + i); */ { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(srcbuf + i), sizeof(char), (void *)srcbuf, (void *)(& srcbuf)); __e_acsl_assert(! __gen_e_acsl_valid_read,(char *)"Assertion", (char *)"main",(char *)"!\\valid_read(srcbuf + i)", 16); } /*@ assert Eva: mem_access: \valid_read(srcbuf + i); */ if ((int)*(srcbuf + i) == (int)ch) loc = i; i ++; } strncpy(destbuf + loc,srcbuf + loc,1); free((void *)destbuf); } __retres = 0; __e_acsl_delete_block((void *)(& srcbuf)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts2305.c0000666000000000000000000000152013571573400022576 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" struct bitfields { int i : 2 ; _Bool j : 1 ; }; struct bitfields t; int test(struct bitfields *a) { int __retres; __retres = (int)a->i; return __retres; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& t),(size_t)4); __e_acsl_full_init((void *)(& t)); } return; } int main(int argc, char **argv) { int tmp; __e_acsl_memory_init(& argc,& argv,(size_t)8); __e_acsl_globals_init(); /*@ assert \valid_read(&t.j); */ ; /*@ assert \valid_read(&t.j + (1 .. 3)); */ ; ; t.j = (_Bool)1; /*@ assert \initialized(&t.j); */ ; tmp = test(& t); __e_acsl_delete_block((void *)(& t)); __e_acsl_memory_clean(); return tmp; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts2386.c0000666000000000000000000000451513571573400022616 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; void f(void const *s, int c, unsigned long n) { __e_acsl_store_block((void *)(& s),(size_t)8); unsigned char const *p = (unsigned char const *)s; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); /*@ assert p - (unsigned char const *)s ≡ n - n; */ { __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl_n; __e_acsl_mpz_t __gen_e_acsl_sub; int __gen_e_acsl_eq; __gmpz_init_set_ui(__gen_e_acsl_,p - (unsigned char const *)s); __gmpz_init_set_ui(__gen_e_acsl_n,n); __gmpz_init(__gen_e_acsl_sub); __gmpz_sub(__gen_e_acsl_sub, (__e_acsl_mpz_struct const *)(__gen_e_acsl_n), (__e_acsl_mpz_struct const *)(__gen_e_acsl_n)); __gen_e_acsl_eq = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub)); __e_acsl_assert(__gen_e_acsl_eq == 0,(char *)"Assertion",(char *)"f", (char *)"p - (unsigned char const *)s == n - n",7); __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl_n); __gmpz_clear(__gen_e_acsl_sub); } /*@ assert p - (unsigned char const *)s ≡ 0; */ __e_acsl_assert(p - (unsigned char const *)s == 0UL,(char *)"Assertion", (char *)"f",(char *)"p - (unsigned char const *)s == 0",8); __e_acsl_delete_block((void *)(& s)); __e_acsl_delete_block((void *)(& p)); return; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "1234567890"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string, sizeof("1234567890")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); char const *s = __gen_e_acsl_literal_string; __e_acsl_store_block((void *)(& s),(size_t)8); __e_acsl_full_init((void *)(& s)); f((void const *)s,'0',(unsigned long)11); __retres = 0; __e_acsl_delete_block((void *)(& s)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_bts2406.c0000666000000000000000000000260113571573400022601 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char const tab[]; char t[10]; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(t),(size_t)10); __e_acsl_full_init((void *)(& t)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); char *p = (char *)(tab); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); /*@ assert ¬\valid(p + (0 .. 9)); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(p + 1 * 0),(size_t)9, (void *)p,(void *)(& p)); __e_acsl_assert(! __gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"!\\valid(p + (0 .. 9))",10); } /*@ assert \valid(&t[0 .. 9]); */ { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)(& t + 1 * 0),(size_t)9, (void *)(& t),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Assertion",(char *)"main", (char *)"\\valid(&t[0 .. 9])",11); } __retres = 0; __e_acsl_delete_block((void *)(t)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/gen_issue69.c0000666000000000000000000000405013571573400023004 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); /*@ assert ∀ unsigned char c; 4 ≤ c ≤ 300 ⇒ 0 ≤ c ≤ 255; */ { int __gen_e_acsl_forall; int __gen_e_acsl_c; __gen_e_acsl_forall = 1; __gen_e_acsl_c = (unsigned char)4; while (1) { if (__gen_e_acsl_c <= 255) ; else break; { int __gen_e_acsl_and; if (0 <= __gen_e_acsl_c) __gen_e_acsl_and = __gen_e_acsl_c <= 255; else __gen_e_acsl_and = 0; if (__gen_e_acsl_and) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop1; } } __gen_e_acsl_c ++; } e_acsl_end_loop1: ; __e_acsl_assert(__gen_e_acsl_forall,(char *)"Assertion",(char *)"main", (char *)"\\forall unsigned char c; 4 <= c <= 300 ==> 0 <= c <= 255", 6); } int n = 5; /*@ assert \let m = n > 0? 4: 341; ∀ char u; 1 < u < m ⇒ u > 0; */ { int __gen_e_acsl_m; int __gen_e_acsl_if; int __gen_e_acsl_forall_2; int __gen_e_acsl_u; if (n > 0) __gen_e_acsl_if = 4; else __gen_e_acsl_if = 341; __gen_e_acsl_m = __gen_e_acsl_if; __gen_e_acsl_forall_2 = 1; __gen_e_acsl_u = (char)1 + 1; while (1) { { int __gen_e_acsl_and_2; if (-128 <= __gen_e_acsl_u) __gen_e_acsl_and_2 = __gen_e_acsl_u <= 127; else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"RTE",(char *)"main", (char *)"-128 <= u <= 127",11); } if (__gen_e_acsl_u < __gen_e_acsl_m) ; else break; if (__gen_e_acsl_u > 0) ; else { __gen_e_acsl_forall_2 = 0; goto e_acsl_end_loop2; } __gen_e_acsl_u ++; } e_acsl_end_loop2: ; __e_acsl_assert(__gen_e_acsl_forall_2,(char *)"Assertion",(char *)"main", (char *)"\\let m = n > 0? 4: 341;\n\\forall char u; 1 < u < m ==> u > 0", 10); } __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/bts/oracle_ci/issue69.res.oracle0000666000000000000000000000023213571573400023764 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/bts/issue69.c:10: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/builtin/0000777000000000000000000000000013571573400017437 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/builtin/test_config_ci0000666000000000000000000000005213571573400022336 0ustar STDOPT: #"-e-acsl-replace-libc-functions" frama-c-20.0-Calcium/src/plugins/e-acsl/tests/builtin/test_config_dev0000666000000000000000000000055213571573400022526 0ustar MACRO: DEST @PTEST_RESULT@/gen_@PTEST_NAME@ MACRO: OUT @PTEST_NAME@.res.log MACRO: ERR @PTEST_NAME@.err.log EXEC: ./scripts/e-acsl-gcc.sh --libc-replacements -q -c -X --frama-c-extra="-journal-disable -verbose 0 -kernel-warn-key *=inactive" -o @DEST@.run.c -O @DEST@.out @PTEST_FILE@ > @PTEST_RESULT@/@OUT@ 2> @PTEST_RESULT@/@ERR@ && ./@DEST@.e-acsl > /dev/null frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/0000777000000000000000000000000013571573400020200 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/false.i0000666000000000000000000000017013571573400021442 0ustar /* run.config COMMENT: assert \false */ int main(void) { int x = 0; if (x) /*@ assert \false; */ ; return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/function_contract.i0000666000000000000000000000270113571573400024074 0ustar /* run.config COMMENT: function contract */ int X = 0, Y = 2; // one ensures /*@ ensures X == 1; */ void f(void) { X = 1; } // several ensures /*@ ensures X == 2; @ ensures Y == 2; */ void g(void) { X = 2; } // one requires /*@ requires X == 2; */ void h(void) { X += 1; } // several requires /*@ requires X == 3; @ requires Y == 2; */ void i(void) { X += Y; } // several behaviors /*@ behavior b1: @ requires X == 5; @ ensures X == 3; @ behavior b2: @ requires X == 3 + Y; @ requires Y == 2; @ ensures X == Y + 1; */ void j(void) { X = 3; } // mix requires and assumes /*@ behavior b1: @ assumes X == 1; @ requires X == 0; @ behavior b2: @ assumes X == 3; @ assumes Y == 2; @ requires X == 3; @ requires X + Y == 5; */ void k(void) { X += Y; } // mix ensures + contract on return /*@ ensures X == 5; */ int l() { /*@ assert Y == 2; */ return X; } // mix ensures and assumes /*@ behavior b1: @ assumes X == 7; @ ensures X == 95; @ behavior b2: @ assumes X == 5; @ assumes Y == 2; @ ensures X == 7; @ ensures X == \old(X) + Y; */ void m(void) { X += Y; } // mix requires, ensures and assumes /*@ requires X > 0; @ requires X < 10; @ behavior b1: @ assumes X == 7; @ ensures X == 8; @ behavior b2: @ assumes X == 5; @ ensures X == 98; */ void n(void) { X ++; } int main(void) { f(); g(); h(); i(); j(); k(); l(); m(); n(); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/ghost.i0000666000000000000000000000047613571573400021505 0ustar /* run.config COMMENT: ghost code */ /*@ ghost int G = 0; */ /*@ ghost int *P; */ // /*@ ghost int foo(int *x) { return *x + 1; } */ int main(void) { /*@ ghost P = &G; */ ; /*@ ghost int *q = P; */ /*@ ghost (*P)++; */ /*@ assert *q == G; */ // /*@ ghost G = foo(&G); */ // /*@ assert G == 2; */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/invariant.i0000666000000000000000000000033713571573400022350 0ustar /* run.config_ci COMMENT: invariant STDOPT: +"-slevel 11" */ int main(void) { int x = 0; for(int i = 0; i < 10; i++) { /*@ invariant 0 <= i < 10; */ x += i; /*@ invariant i <= x; */ } return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/labeled_stmt.i0000666000000000000000000000040113571573400023004 0ustar /* run.config COMMENT: labeled stmt and gotos */ int X = 0; /*@ ensures X == 3; */ int main(void) { goto L1; L1: /*@ assert X == 0; */ X = 1; goto L2; L2: /*@ requires X == 1; ensures X == 2; */ X = 2; if (X) { X = 3; return 0; } return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/lazy.i0000666000000000000000000000155113571573400021333 0ustar /* run.config COMMENT: terms and predicates using lazy operators */ int main(void) { int x = 0, y = 1; // lazy predicates /*@ assert x == 0 && y == 1; */ /*@ assert ! (x != 0 && y == 1/0); */ /*@ assert y == 1 || x == 1; */ /*@ assert x == 0 || y == 1/0; */ /*@ assert x == 0 ==> y == 1; */ /*@ assert x == 1 ==> y == 1/0; */ /*@ assert x ? x : y; */ /*@ assert y ? y : x; */ /*@ assert x == 1 ? x == 18 : x == 0; */ // these predicates are not lazy, but are encoded by lazy ones /*@ assert x == 2 <==> y == 3; */ /*@ assert x == 0 <==> y == 1; */ // lazy terms /*@ assert (x ? x : y) == (x == 0); */ /*@ assert (x && y) || y; */ // converted into predicate by the kernel /*@ assert (x || y) && y == 1; */ // converted into predicate by the kernel /*@ assert (x || y) == y; */ /*@ assert (x && y) == x; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/loop.i0000666000000000000000000000132213571573400021321 0ustar /* run.config_ci COMMENT: loop invariants STDOPT: +"-slevel 160" */ void simple_loop() { int sum = 0; /*@ loop invariant 0 <= i <= 10; */ for(int i = 0; i < 10; i++) sum +=i; } void nested_loops() { int t[10][15]; /*@ loop invariant 0 <= i <= 10; */ for(int i = 0; i < 10; i++) /*@ loop invariant 0 <= j <= 15; @ loop invariant @ \forall integer k,l; 0 <= k < i && 0 <= l < j ==> t[k][l] == k * l; */ for(int j = 0; j < 15; j++) t[i][j] = i * j; } void unnatural_loop() { int x = 0; /*@ loop invariant 0 <= i <= 6; */ for(int i = 0; i < 10; i++) { if (x == 5) break; x = i; } } int main(void) { simple_loop(); nested_loops(); unnatural_loop(); } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/nested_code_annot.i0000666000000000000000000000066313571573400024032 0ustar /* run.config COMMENT: structured stmt with several code annotations inside */ int main(void) { int x = 0, y = 1; /*@ assert x < y; */ /*@ requires x == 0; @ ensures x >= 1; */ { if (x) /*@ assert \false; */ ; else { /*@ requires x == 0; @ ensures x == 1; */ x++; if (x) { /*@ requires x == 1; @ ensures x == 2; */ x++; } else /*@ assert \false; */ ; } } return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/0000777000000000000000000000000013571573400022120 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/false.res.oracle0000666000000000000000000000011713571573400025170 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/function_contract.res.oracle0000666000000000000000000000011713571573400027620 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_false.c0000666000000000000000000000050213571573400024204 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; if (x) /*@ assert \false; */ __e_acsl_assert(0,(char *)"Assertion",(char *)"main",(char *)"\\false",6); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_function_contract.c0000666000000000000000000001730313571573400026643 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; int X = 0; int Y = 2; /*@ ensures X ≡ 1; */ void __gen_e_acsl_f(void); void f(void) { X = 1; return; } /*@ ensures X ≡ 2; ensures Y ≡ 2; */ void __gen_e_acsl_g(void); void g(void) { X = 2; return; } /*@ requires X ≡ 2; */ void __gen_e_acsl_h(void); void h(void) { X ++; return; } /*@ requires X ≡ 3; requires Y ≡ 2; */ void __gen_e_acsl_i(void); void i(void) { X += Y; return; } /*@ behavior b1: requires X ≡ 5; ensures X ≡ 3; behavior b2: requires X ≡ 3 + Y; requires Y ≡ 2; ensures X ≡ Y + 1; */ void __gen_e_acsl_j(void); void j(void) { X = 3; return; } /*@ behavior b1: assumes X ≡ 1; requires X ≡ 0; behavior b2: assumes X ≡ 3; assumes Y ≡ 2; requires X ≡ 3; requires X + Y ≡ 5; */ void __gen_e_acsl_k(void); void k(void) { X += Y; return; } /*@ ensures X ≡ 5; */ int __gen_e_acsl_l(void); int l(void) { /*@ assert Y ≡ 2; */ __e_acsl_assert(Y == 2,(char *)"Assertion",(char *)"l",(char *)"Y == 2",49); return X; } /*@ behavior b1: assumes X ≡ 7; ensures X ≡ 95; behavior b2: assumes X ≡ 5; assumes Y ≡ 2; ensures X ≡ 7; ensures X ≡ \old(X) + Y; */ void __gen_e_acsl_m(void); void m(void) { X += Y; return; } /*@ requires X > 0; requires X < 10; behavior b1: assumes X ≡ 7; ensures X ≡ 8; behavior b2: assumes X ≡ 5; ensures X ≡ 98; */ void __gen_e_acsl_n(void); void n(void) { X ++; return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __gen_e_acsl_f(); __gen_e_acsl_g(); __gen_e_acsl_h(); __gen_e_acsl_i(); __gen_e_acsl_j(); __gen_e_acsl_k(); __gen_e_acsl_l(); __gen_e_acsl_m(); __gen_e_acsl_n(); __retres = 0; return __retres; } /*@ requires X > 0; requires X < 10; behavior b1: assumes X ≡ 7; ensures X ≡ 8; behavior b2: assumes X ≡ 5; ensures X ≡ 98; */ void __gen_e_acsl_n(void) { int __gen_e_acsl_at_2; int __gen_e_acsl_at; __gen_e_acsl_at_2 = X == 5; __gen_e_acsl_at = X == 7; __e_acsl_assert(X > 0,(char *)"Precondition",(char *)"n",(char *)"X > 0", 65); __e_acsl_assert(X < 10,(char *)"Precondition",(char *)"n",(char *)"X < 10", 66); n(); { int __gen_e_acsl_implies; int __gen_e_acsl_implies_2; if (! __gen_e_acsl_at) __gen_e_acsl_implies = 1; else __gen_e_acsl_implies = X == 8; __e_acsl_assert(__gen_e_acsl_implies,(char *)"Postcondition",(char *)"n", (char *)"\\old(X == 7) ==> X == 8",69); if (! __gen_e_acsl_at_2) __gen_e_acsl_implies_2 = 1; else __gen_e_acsl_implies_2 = X == 98; __e_acsl_assert(__gen_e_acsl_implies_2,(char *)"Postcondition", (char *)"n",(char *)"\\old(X == 5) ==> X == 98",72); return; } } /*@ behavior b1: assumes X ≡ 7; ensures X ≡ 95; behavior b2: assumes X ≡ 5; assumes Y ≡ 2; ensures X ≡ 7; ensures X ≡ \old(X) + Y; */ void __gen_e_acsl_m(void) { long __gen_e_acsl_at_4; int __gen_e_acsl_at_3; int __gen_e_acsl_at_2; int __gen_e_acsl_at; __gen_e_acsl_at_4 = (long)X; { int __gen_e_acsl_and_2; if (X == 5) __gen_e_acsl_and_2 = Y == 2; else __gen_e_acsl_and_2 = 0; __gen_e_acsl_at_3 = __gen_e_acsl_and_2; } { int __gen_e_acsl_and; if (X == 5) __gen_e_acsl_and = Y == 2; else __gen_e_acsl_and = 0; __gen_e_acsl_at_2 = __gen_e_acsl_and; } __gen_e_acsl_at = X == 7; m(); { int __gen_e_acsl_implies; int __gen_e_acsl_implies_2; int __gen_e_acsl_implies_3; if (! __gen_e_acsl_at) __gen_e_acsl_implies = 1; else __gen_e_acsl_implies = X == 95; __e_acsl_assert(__gen_e_acsl_implies,(char *)"Postcondition",(char *)"m", (char *)"\\old(X == 7) ==> X == 95",56); if (! __gen_e_acsl_at_2) __gen_e_acsl_implies_2 = 1; else __gen_e_acsl_implies_2 = X == 7; __e_acsl_assert(__gen_e_acsl_implies_2,(char *)"Postcondition", (char *)"m",(char *)"\\old(X == 5 && Y == 2) ==> X == 7", 60); if (! __gen_e_acsl_at_3) __gen_e_acsl_implies_3 = 1; else __gen_e_acsl_implies_3 = (long)X == __gen_e_acsl_at_4 + Y; __e_acsl_assert(__gen_e_acsl_implies_3,(char *)"Postcondition", (char *)"m", (char *)"\\old(X == 5 && Y == 2) ==> X == \\old(X) + Y", 61); return; } } /*@ ensures X ≡ 5; */ int __gen_e_acsl_l(void) { int __retres; __retres = l(); __e_acsl_assert(X == 5,(char *)"Postcondition",(char *)"l", (char *)"X == 5",47); return __retres; } /*@ behavior b1: assumes X ≡ 1; requires X ≡ 0; behavior b2: assumes X ≡ 3; assumes Y ≡ 2; requires X ≡ 3; requires X + Y ≡ 5; */ void __gen_e_acsl_k(void) { { int __gen_e_acsl_implies; int __gen_e_acsl_and; int __gen_e_acsl_implies_2; int __gen_e_acsl_and_2; int __gen_e_acsl_implies_3; if (! (X == 1)) __gen_e_acsl_implies = 1; else __gen_e_acsl_implies = X == 0; __e_acsl_assert(__gen_e_acsl_implies,(char *)"Precondition",(char *)"k", (char *)"X == 1 ==> X == 0",38); if (X == 3) __gen_e_acsl_and = Y == 2; else __gen_e_acsl_and = 0; if (! __gen_e_acsl_and) __gen_e_acsl_implies_2 = 1; else __gen_e_acsl_implies_2 = X == 3; __e_acsl_assert(__gen_e_acsl_implies_2,(char *)"Precondition", (char *)"k",(char *)"X == 3 && Y == 2 ==> X == 3",42); if (X == 3) __gen_e_acsl_and_2 = Y == 2; else __gen_e_acsl_and_2 = 0; if (! __gen_e_acsl_and_2) __gen_e_acsl_implies_3 = 1; else __gen_e_acsl_implies_3 = X + (long)Y == 5L; __e_acsl_assert(__gen_e_acsl_implies_3,(char *)"Precondition", (char *)"k",(char *)"X == 3 && Y == 2 ==> X + Y == 5",43); } k(); return; } /*@ behavior b1: requires X ≡ 5; ensures X ≡ 3; behavior b2: requires X ≡ 3 + Y; requires Y ≡ 2; ensures X ≡ Y + 1; */ void __gen_e_acsl_j(void) { __e_acsl_assert(X == 5,(char *)"Precondition",(char *)"j",(char *)"X == 5", 27); __e_acsl_assert((long)X == 3L + Y,(char *)"Precondition",(char *)"j", (char *)"X == 3 + Y",30); __e_acsl_assert(Y == 2,(char *)"Precondition",(char *)"j",(char *)"Y == 2", 31); j(); __e_acsl_assert(X == 3,(char *)"Postcondition",(char *)"j", (char *)"X == 3",28); __e_acsl_assert((long)X == Y + 1L,(char *)"Postcondition",(char *)"j", (char *)"X == Y + 1",32); return; } /*@ requires X ≡ 3; requires Y ≡ 2; */ void __gen_e_acsl_i(void) { __e_acsl_assert(X == 3,(char *)"Precondition",(char *)"i",(char *)"X == 3", 21); __e_acsl_assert(Y == 2,(char *)"Precondition",(char *)"i",(char *)"Y == 2", 22); i(); return; } /*@ requires X ≡ 2; */ void __gen_e_acsl_h(void) { __e_acsl_assert(X == 2,(char *)"Precondition",(char *)"h",(char *)"X == 2", 17); h(); return; } /*@ ensures X ≡ 2; ensures Y ≡ 2; */ void __gen_e_acsl_g(void) { g(); __e_acsl_assert(X == 2,(char *)"Postcondition",(char *)"g", (char *)"X == 2",12); __e_acsl_assert(Y == 2,(char *)"Postcondition",(char *)"g", (char *)"Y == 2",13); return; } /*@ ensures X ≡ 1; */ void __gen_e_acsl_f(void) { f(); __e_acsl_assert(X == 1,(char *)"Postcondition",(char *)"f", (char *)"X == 1",8); return; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_ghost.c0000666000000000000000000000444613571573400024251 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int G = 0; int *P; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& P),(size_t)8); __e_acsl_full_init((void *)(& P)); __e_acsl_store_block((void *)(& G),(size_t)4); __e_acsl_full_init((void *)(& G)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); P = & G; int *q = P; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); { int __gen_e_acsl_valid_read; int __gen_e_acsl_valid; __e_acsl_initialize((void *)P,sizeof(int)); __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)P,sizeof(int), (void *)P,(void *)(& P)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(P)",13); __gen_e_acsl_valid = __e_acsl_valid((void *)P,sizeof(int),(void *)P, (void *)(& P)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid(P)",13); } (*P) ++; /*@ assert *q ≡ G; */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)q,sizeof(int), (void *)q, (void *)(& q)); __gen_e_acsl_and = __gen_e_acsl_valid_read_2; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(q)",14); __e_acsl_assert(*q == G,(char *)"Assertion",(char *)"main", (char *)"*q == G",14); } __retres = 0; __e_acsl_delete_block((void *)(& P)); __e_acsl_delete_block((void *)(& G)); __e_acsl_delete_block((void *)(& q)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_invariant.c0000666000000000000000000000130413571573400025106 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; { int i = 0; while (i < 10) { /*@ invariant 0 ≤ i < 10; */ { int __gen_e_acsl_and; if (0 <= i) __gen_e_acsl_and = i < 10; else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Invariant",(char *)"main", (char *)"0 <= i < 10",9); } x += i; /*@ invariant i ≤ x; */ __e_acsl_assert(i <= x,(char *)"Invariant",(char *)"main", (char *)"i <= x",11); i ++; } } __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_labeled_stmt.c0000666000000000000000000000203013571573400025547 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; int X = 0; /*@ ensures X ≡ 3; */ int main(void); int __gen_e_acsl_main(void) { int __retres; goto L1; L1: /*@ assert X ≡ 0; */ __e_acsl_assert(X == 0,(char *)"Assertion",(char *)"main",(char *)"X == 0", 10); X = 1; goto L2; L2: /*@ requires X ≡ 1; ensures X ≡ 2; */ { __e_acsl_assert(X == 1,(char *)"Precondition",(char *)"main", (char *)"X == 1",12); X = 2; __e_acsl_assert(X == 2,(char *)"Postcondition",(char *)"main", (char *)"X == 2",12); } if (X) { X = 3; __retres = 0; goto return_label; } __retres = 0; return_label: return __retres; } /*@ ensures X ≡ 3; */ int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __retres = __gen_e_acsl_main(); __e_acsl_assert(X == 3,(char *)"Postcondition",(char *)"main", (char *)"X == 3",7); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_lazy.c0000666000000000000000000001404213571573400024075 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; int y = 1; /*@ assert x ≡ 0 ∧ y ≡ 1; */ { int __gen_e_acsl_and; if (x == 0) __gen_e_acsl_and = y == 1; else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"x == 0 && y == 1",9); } /*@ assert ¬(x ≢ 0 ∧ y ≡ 1 / 0); */ { int __gen_e_acsl_and_2; if (x != 0) { __e_acsl_assert(0,(char *)"RTE",(char *)"main", (char *)"division_by_zero: 0 != 0",10); __gen_e_acsl_and_2 = y == 1 / 0; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"!(x != 0 && y == 1 / 0)",10); } /*@ assert y ≡ 1 ∨ x ≡ 1; */ { int __gen_e_acsl_or; if (y == 1) __gen_e_acsl_or = 1; else __gen_e_acsl_or = x == 1; __e_acsl_assert(__gen_e_acsl_or,(char *)"Assertion",(char *)"main", (char *)"y == 1 || x == 1",11); } /*@ assert x ≡ 0 ∨ y ≡ 1 / 0; */ { int __gen_e_acsl_or_2; if (x == 0) __gen_e_acsl_or_2 = 1; else { __e_acsl_assert(0,(char *)"RTE",(char *)"main", (char *)"division_by_zero: 0 != 0",12); __gen_e_acsl_or_2 = y == 1 / 0; } __e_acsl_assert(__gen_e_acsl_or_2,(char *)"Assertion",(char *)"main", (char *)"x == 0 || y == 1 / 0",12); } /*@ assert x ≡ 0 ⇒ y ≡ 1; */ { int __gen_e_acsl_implies; if (! (x == 0)) __gen_e_acsl_implies = 1; else __gen_e_acsl_implies = y == 1; __e_acsl_assert(__gen_e_acsl_implies,(char *)"Assertion",(char *)"main", (char *)"x == 0 ==> y == 1",13); } /*@ assert x ≡ 1 ⇒ y ≡ 1 / 0; */ { int __gen_e_acsl_implies_2; if (! (x == 1)) __gen_e_acsl_implies_2 = 1; else { __e_acsl_assert(0,(char *)"RTE",(char *)"main", (char *)"division_by_zero: 0 != 0",14); __gen_e_acsl_implies_2 = y == 1 / 0; } __e_acsl_assert(__gen_e_acsl_implies_2,(char *)"Assertion", (char *)"main",(char *)"x == 1 ==> y == 1 / 0",14); } /*@ assert x ≢ 0? x ≢ 0: y ≢ 0; */ { int __gen_e_acsl_if; if (x != 0) __gen_e_acsl_if = x != 0; else __gen_e_acsl_if = y != 0; __e_acsl_assert(__gen_e_acsl_if,(char *)"Assertion",(char *)"main", (char *)"x != 0? x != 0: y != 0",15); } /*@ assert y ≢ 0? y ≢ 0: x ≢ 0; */ { int __gen_e_acsl_if_2; if (y != 0) __gen_e_acsl_if_2 = y != 0; else __gen_e_acsl_if_2 = x != 0; __e_acsl_assert(__gen_e_acsl_if_2,(char *)"Assertion",(char *)"main", (char *)"y != 0? y != 0: x != 0",16); } /*@ assert x ≡ 1? x ≡ 18: x ≡ 0; */ { int __gen_e_acsl_if_3; if (x == 1) __gen_e_acsl_if_3 = x == 18; else __gen_e_acsl_if_3 = x == 0; __e_acsl_assert(__gen_e_acsl_if_3,(char *)"Assertion",(char *)"main", (char *)"x == 1? x == 18: x == 0",17); } /*@ assert x ≡ 2 ⇔ y ≡ 3; */ { int __gen_e_acsl_implies_3; int __gen_e_acsl_equiv; if (! (x == 2)) __gen_e_acsl_implies_3 = 1; else __gen_e_acsl_implies_3 = y == 3; if (__gen_e_acsl_implies_3) { int __gen_e_acsl_implies_4; if (! (y == 3)) __gen_e_acsl_implies_4 = 1; else __gen_e_acsl_implies_4 = x == 2; __gen_e_acsl_equiv = __gen_e_acsl_implies_4; } else __gen_e_acsl_equiv = 0; __e_acsl_assert(__gen_e_acsl_equiv,(char *)"Assertion",(char *)"main", (char *)"x == 2 <==> y == 3",20); } /*@ assert x ≡ 0 ⇔ y ≡ 1; */ { int __gen_e_acsl_implies_5; int __gen_e_acsl_equiv_2; if (! (x == 0)) __gen_e_acsl_implies_5 = 1; else __gen_e_acsl_implies_5 = y == 1; if (__gen_e_acsl_implies_5) { int __gen_e_acsl_implies_6; if (! (y == 1)) __gen_e_acsl_implies_6 = 1; else __gen_e_acsl_implies_6 = x == 0; __gen_e_acsl_equiv_2 = __gen_e_acsl_implies_6; } else __gen_e_acsl_equiv_2 = 0; __e_acsl_assert(__gen_e_acsl_equiv_2,(char *)"Assertion",(char *)"main", (char *)"x == 0 <==> y == 1",21); } /*@ assert ((x ≢ 0? x: y) ≢ 0) ≡ (x ≡ 0); */ { int __gen_e_acsl_if_4; if (x != 0) __gen_e_acsl_if_4 = x; else __gen_e_acsl_if_4 = y; __e_acsl_assert((__gen_e_acsl_if_4 != 0) == (x == 0),(char *)"Assertion", (char *)"main", (char *)"((x != 0? x: y) != 0) == (x == 0)",24); } /*@ assert (x ≢ 0 ∧ y ≢ 0) ∨ y ≢ 0; */ { int __gen_e_acsl_and_3; int __gen_e_acsl_or_3; if (x != 0) __gen_e_acsl_and_3 = y != 0; else __gen_e_acsl_and_3 = 0; if (__gen_e_acsl_and_3) __gen_e_acsl_or_3 = 1; else __gen_e_acsl_or_3 = y != 0; __e_acsl_assert(__gen_e_acsl_or_3,(char *)"Assertion",(char *)"main", (char *)"(x != 0 && y != 0) || y != 0",25); } /*@ assert (x ≢ 0 ∨ y ≢ 0) ∧ y ≡ 1; */ { int __gen_e_acsl_or_4; int __gen_e_acsl_and_4; if (x != 0) __gen_e_acsl_or_4 = 1; else __gen_e_acsl_or_4 = y != 0; if (__gen_e_acsl_or_4) __gen_e_acsl_and_4 = y == 1; else __gen_e_acsl_and_4 = 0; __e_acsl_assert(__gen_e_acsl_and_4,(char *)"Assertion",(char *)"main", (char *)"(x != 0 || y != 0) && y == 1",26); } /*@ assert (x ≢ 0 ∨ y ≢ 0) ≡ (y ≢ 0); */ { int __gen_e_acsl_or_5; if (x != 0) __gen_e_acsl_or_5 = 1; else __gen_e_acsl_or_5 = y != 0; __e_acsl_assert(__gen_e_acsl_or_5 == (y != 0),(char *)"Assertion", (char *)"main",(char *)"(x != 0 || y != 0) == (y != 0)", 27); } /*@ assert (x ≢ 0 ∧ y ≢ 0) ≡ (x ≢ 0); */ { int __gen_e_acsl_and_5; if (x != 0) __gen_e_acsl_and_5 = y != 0; else __gen_e_acsl_and_5 = 0; __e_acsl_assert(__gen_e_acsl_and_5 == (x != 0),(char *)"Assertion", (char *)"main",(char *)"(x != 0 && y != 0) == (x != 0)", 28); } __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_loop.c0000666000000000000000000001671013571573400024073 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" void simple_loop(void) { int sum = 0; { int i = 0; { { int __gen_e_acsl_and; if (0 <= i) __gen_e_acsl_and = i <= 10; else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Invariant", (char *)"simple_loop",(char *)"0 <= i <= 10",8); } /*@ loop invariant 0 ≤ i ≤ 10; */ while (i < 10) { sum += i; { int __gen_e_acsl_and_2; i ++; if (0 <= i) __gen_e_acsl_and_2 = i <= 10; else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Invariant", (char *)"simple_loop",(char *)"0 <= i <= 10",8); } } } } return; } void nested_loops(void) { int t[10][15]; int i = 0; { { int __gen_e_acsl_and; if (0 <= i) __gen_e_acsl_and = i <= 10; else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Invariant", (char *)"nested_loops",(char *)"0 <= i <= 10",15); } /*@ loop invariant 0 ≤ i ≤ 10; */ while (i < 10) { { int j = 0; { { int __gen_e_acsl_forall; int __gen_e_acsl_k; int __gen_e_acsl_l; int __gen_e_acsl_and_2; __gen_e_acsl_forall = 1; __gen_e_acsl_k = 0; while (1) { if (__gen_e_acsl_k < i) ; else break; __gen_e_acsl_l = 0; while (1) { if (__gen_e_acsl_l < j) ; else break; __e_acsl_assert(__gen_e_acsl_l < 15,(char *)"RTE", (char *)"nested_loops", (char *)"index_bound: __gen_e_acsl_l < 15", 19); __e_acsl_assert(0 <= __gen_e_acsl_l,(char *)"RTE", (char *)"nested_loops", (char *)"index_bound: 0 <= __gen_e_acsl_l", 19); __e_acsl_assert(__gen_e_acsl_k < 10,(char *)"RTE", (char *)"nested_loops", (char *)"index_bound: __gen_e_acsl_k < 10", 19); __e_acsl_assert(0 <= __gen_e_acsl_k,(char *)"RTE", (char *)"nested_loops", (char *)"index_bound: 0 <= __gen_e_acsl_k", 19); if ((long)t[__gen_e_acsl_k][__gen_e_acsl_l] == __gen_e_acsl_k * (long)__gen_e_acsl_l) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop1; } __gen_e_acsl_l ++; } __gen_e_acsl_k ++; } e_acsl_end_loop1: ; __e_acsl_assert(__gen_e_acsl_forall,(char *)"Invariant", (char *)"nested_loops", (char *)"\\forall integer k, integer l; 0 <= k < i && 0 <= l < j ==> t[k][l] == k * l", 19); if (0 <= j) __gen_e_acsl_and_2 = j <= 15; else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Invariant", (char *)"nested_loops",(char *)"0 <= j <= 15",17); } /*@ loop invariant 0 ≤ j ≤ 15; loop invariant ∀ ℤ k, ℤ l; 0 ≤ k < i ∧ 0 ≤ l < j ⇒ t[k][l] ≡ k * l; */ while (j < 15) { t[i][j] = i * j; { int __gen_e_acsl_and_3; int __gen_e_acsl_forall_2; int __gen_e_acsl_k_2; int __gen_e_acsl_l_2; j ++; if (0 <= j) __gen_e_acsl_and_3 = j <= 15; else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Invariant", (char *)"nested_loops",(char *)"0 <= j <= 15", 17); __gen_e_acsl_forall_2 = 1; __gen_e_acsl_k_2 = 0; while (1) { if (__gen_e_acsl_k_2 < i) ; else break; __gen_e_acsl_l_2 = 0; while (1) { if (__gen_e_acsl_l_2 < j) ; else break; __e_acsl_assert(__gen_e_acsl_l_2 < 15,(char *)"RTE", (char *)"nested_loops", (char *)"index_bound: __gen_e_acsl_l_2 < 15", 19); __e_acsl_assert(0 <= __gen_e_acsl_l_2,(char *)"RTE", (char *)"nested_loops", (char *)"index_bound: 0 <= __gen_e_acsl_l_2", 19); __e_acsl_assert(__gen_e_acsl_k_2 < 10,(char *)"RTE", (char *)"nested_loops", (char *)"index_bound: __gen_e_acsl_k_2 < 10", 19); __e_acsl_assert(0 <= __gen_e_acsl_k_2,(char *)"RTE", (char *)"nested_loops", (char *)"index_bound: 0 <= __gen_e_acsl_k_2", 19); /*@ assert Eva: initialization: \initialized(&t[__gen_e_acsl_k_2][__gen_e_acsl_l_2]); */ if ((long)t[__gen_e_acsl_k_2][__gen_e_acsl_l_2] == __gen_e_acsl_k_2 * (long)__gen_e_acsl_l_2) ; else { __gen_e_acsl_forall_2 = 0; goto e_acsl_end_loop2; } __gen_e_acsl_l_2 ++; } __gen_e_acsl_k_2 ++; } e_acsl_end_loop2: ; __e_acsl_assert(__gen_e_acsl_forall_2,(char *)"Invariant", (char *)"nested_loops", (char *)"\\forall integer k, integer l; 0 <= k < i && 0 <= l < j ==> t[k][l] == k * l", 19); } } } } { int __gen_e_acsl_and_4; i ++; if (0 <= i) __gen_e_acsl_and_4 = i <= 10; else __gen_e_acsl_and_4 = 0; __e_acsl_assert(__gen_e_acsl_and_4,(char *)"Invariant", (char *)"nested_loops",(char *)"0 <= i <= 10",15); } } } return; } void unnatural_loop(void) { int x = 0; { int i = 0; { { int __gen_e_acsl_and; if (0 <= i) __gen_e_acsl_and = i <= 6; else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Invariant", (char *)"unnatural_loop",(char *)"0 <= i <= 6",26); } /*@ loop invariant 0 ≤ i ≤ 6; */ while (i < 10) { if (x == 5) break; x = i; { int __gen_e_acsl_and_2; i ++; if (0 <= i) __gen_e_acsl_and_2 = i <= 6; else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Invariant", (char *)"unnatural_loop",(char *)"0 <= i <= 6",26); } } } } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); simple_loop(); nested_loops(); unnatural_loop(); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_nested_code_annot.c0000666000000000000000000000306713571573400026576 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; int y = 1; /*@ assert x < y; */ __e_acsl_assert(x < y,(char *)"Assertion",(char *)"main",(char *)"x < y",7); /*@ requires x ≡ 0; ensures x ≥ 1; */ { __e_acsl_assert(x == 0,(char *)"Precondition",(char *)"main", (char *)"x == 0",8); if (x) /*@ assert \false; */ __e_acsl_assert(0,(char *)"Assertion",(char *)"main",(char *)"\\false", 11); else { /*@ requires x ≡ 0; ensures x ≡ 1; */ { __e_acsl_assert(x == 0,(char *)"Precondition",(char *)"main", (char *)"x == 0",13); x ++; __e_acsl_assert(x == 1,(char *)"Postcondition",(char *)"main", (char *)"x == 1",14); } if (x) { /*@ requires x ≡ 1; ensures x ≡ 2; */ { __e_acsl_assert(x == 1,(char *)"Precondition",(char *)"main", (char *)"x == 1",17); x ++; __e_acsl_assert(x == 2,(char *)"Postcondition",(char *)"main", (char *)"x == 2",18); } } else /*@ assert \false; */ __e_acsl_assert(0,(char *)"Assertion",(char *)"main", (char *)"\\false",21); } __e_acsl_assert(x >= 1,(char *)"Postcondition",(char *)"main", (char *)"x >= 1",9); } __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_result.c0000666000000000000000000000337213571573400024440 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /*@ ensures \result ≡ (int)(\old(x) - \old(x)); */ int __gen_e_acsl_f(int x); int f(int x) { x = 0; return x; } int Y = 1; /*@ ensures \result ≡ \old(x); ensures \result ≡ Y; */ int __gen_e_acsl_g(int x); int g(int x) { return x; } /*@ ensures \result ≡ 0; */ int __gen_e_acsl_h(void); int h(void) { int __retres; __retres = 0; return __retres; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __gen_e_acsl_f(1); __gen_e_acsl_g(Y); __gen_e_acsl_h(); __retres = 0; return __retres; } /*@ ensures \result ≡ 0; */ int __gen_e_acsl_h(void) { int __retres; __retres = h(); __e_acsl_assert(__retres == 0,(char *)"Postcondition",(char *)"h", (char *)"\\result == 0",18); return __retres; } /*@ ensures \result ≡ \old(x); ensures \result ≡ Y; */ int __gen_e_acsl_g(int x) { int __gen_e_acsl_at; int __retres; __gen_e_acsl_at = x; __retres = g(x); __e_acsl_assert(__retres == __gen_e_acsl_at,(char *)"Postcondition", (char *)"g",(char *)"\\result == \\old(x)",12); __e_acsl_assert(__retres == Y,(char *)"Postcondition",(char *)"g", (char *)"\\result == Y",13); return __retres; } /*@ ensures \result ≡ (int)(\old(x) - \old(x)); */ int __gen_e_acsl_f(int x) { int __gen_e_acsl_at_2; long __gen_e_acsl_at; int __retres; __gen_e_acsl_at_2 = x; __gen_e_acsl_at = (long)x; __retres = f(x); __e_acsl_assert(__retres == (int)(__gen_e_acsl_at - __gen_e_acsl_at_2), (char *)"Postcondition",(char *)"f", (char *)"\\result == (int)(\\old(x) - \\old(x))",5); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_stmt_contract.c0000666000000000000000000001001113571573400025772 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; int y = 2; /*@ ensures x ≡ 1; */ { x = 1; __e_acsl_assert(x == 1,(char *)"Postcondition",(char *)"main", (char *)"x == 1",8); } /*@ ensures x ≡ 2; ensures y ≡ 2; ensures x ≡ 2 ∧ y ≡ 2; */ { int __gen_e_acsl_and; x = 2; __e_acsl_assert(x == 2,(char *)"Postcondition",(char *)"main", (char *)"x == 2",11); __e_acsl_assert(y == 2,(char *)"Postcondition",(char *)"main", (char *)"y == 2",12); if (x == 2) __gen_e_acsl_and = y == 2; else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Postcondition",(char *)"main", (char *)"x == 2 && y == 2",13); } /*@ requires x ≡ 2; */ { __e_acsl_assert(x == 2,(char *)"Precondition",(char *)"main", (char *)"x == 2",17); x ++; } /*@ requires x ≡ 3; requires y ≡ 2; */ { __e_acsl_assert(x == 3,(char *)"Precondition",(char *)"main", (char *)"x == 3",20); __e_acsl_assert(y == 2,(char *)"Precondition",(char *)"main", (char *)"y == 2",21); x += y; } /*@ behavior b1: requires x ≡ 5; ensures x ≡ 3; behavior b2: requires x ≡ 3 + y; requires y ≡ 2; ensures x ≡ y + 1; */ { __e_acsl_assert(x == 5,(char *)"Precondition",(char *)"main", (char *)"x == 5",25); __e_acsl_assert((long)x == 3L + y,(char *)"Precondition",(char *)"main", (char *)"x == 3 + y",28); __e_acsl_assert(y == 2,(char *)"Precondition",(char *)"main", (char *)"y == 2",29); x = 3; __e_acsl_assert(x == 3,(char *)"Postcondition",(char *)"main", (char *)"x == 3",26); __e_acsl_assert((long)x == y + 1L,(char *)"Postcondition",(char *)"main", (char *)"x == y + 1",30); } /*@ behavior b1: assumes x ≡ 1; requires x ≡ 0; behavior b2: assumes x ≡ 3; assumes y ≡ 2; requires x ≡ 3; requires x + y ≡ 5; */ { { int __gen_e_acsl_implies; int __gen_e_acsl_and_2; int __gen_e_acsl_implies_2; int __gen_e_acsl_and_3; int __gen_e_acsl_implies_3; if (! (x == 1)) __gen_e_acsl_implies = 1; else __gen_e_acsl_implies = x == 0; __e_acsl_assert(__gen_e_acsl_implies,(char *)"Precondition", (char *)"main",(char *)"x == 1 ==> x == 0",35); if (x == 3) __gen_e_acsl_and_2 = y == 2; else __gen_e_acsl_and_2 = 0; if (! __gen_e_acsl_and_2) __gen_e_acsl_implies_2 = 1; else __gen_e_acsl_implies_2 = x == 3; __e_acsl_assert(__gen_e_acsl_implies_2,(char *)"Precondition", (char *)"main",(char *)"x == 3 && y == 2 ==> x == 3", 39); if (x == 3) __gen_e_acsl_and_3 = y == 2; else __gen_e_acsl_and_3 = 0; if (! __gen_e_acsl_and_3) __gen_e_acsl_implies_3 = 1; else __gen_e_acsl_implies_3 = x + (long)y == 5L; __e_acsl_assert(__gen_e_acsl_implies_3,(char *)"Precondition", (char *)"main", (char *)"x == 3 && y == 2 ==> x + y == 5",40); } x += y; } /*@ requires x ≡ 5; */ { __e_acsl_assert(x == 5,(char *)"Precondition",(char *)"main", (char *)"x == 5",43); /*@ requires y ≡ 2; */ { __e_acsl_assert(y == 2,(char *)"Precondition",(char *)"main", (char *)"y == 2",44); x += y; } } /*@ requires x ≡ 7; ensures x ≡ 7; */ { __e_acsl_assert(x == 7,(char *)"Precondition",(char *)"main", (char *)"x == 7",47); __retres = 0; goto return_label; __e_acsl_assert(x == 7,(char *)"Postcondition",(char *)"main", (char *)"x == 7",48); } return_label: return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_true.c0000666000000000000000000000047213571573400024077 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; x ++; /*@ assert \true; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main",(char *)"\\true",8); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/gen_typedef.c0000666000000000000000000000057713571573400024566 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" typedef unsigned char uint8; int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); uint8 x = (unsigned char)0; /*@ assert x ≡ 0; */ __e_acsl_assert((int)x == 0,(char *)"Assertion",(char *)"main", (char *)"x == 0",9); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/ghost.res.oracle0000666000000000000000000000011713571573400025222 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/invariant.res.oracle0000666000000000000000000000011713571573400026071 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/labeled_stmt.res.oracle0000666000000000000000000000011713571573400026535 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/lazy.res.oracle0000666000000000000000000000011713571573400025055 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/loop.res.oracle0000666000000000000000000000065413571573400025055 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/constructs/loop.i:19: Warning: loop invariant got status unknown. [eva:alarm] tests/constructs/loop.i:19: Warning: function __e_acsl_assert: precondition got status invalid. [eva:alarm] tests/constructs/loop.i:19: Warning: accessing uninitialized left-value. assert \initialized(&t[__gen_e_acsl_k_2][__gen_e_acsl_l_2]); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/nested_code_annot.res.oracle0000666000000000000000000000011713571573400027551 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/result.res.oracle0000666000000000000000000000011713571573400025414 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/stmt_contract.res.oracle0000666000000000000000000000011713571573400026762 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/true.res.oracle0000666000000000000000000000011713571573400025055 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/oracle_ci/typedef.res.oracle0000666000000000000000000000011713571573400025536 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/result.i0000666000000000000000000000050413571573400021667 0ustar /* run.config COMMENT: \result */ /*@ ensures \result == (int)(x - x); */ int f(int x) { x = 0; return x; } int Y = 1; /*@ ensures \result == x; @ ensures \result == Y; */ int g(int x) { return x; } /*@ ensures \result == 0; */ int h() { return 0; } int main(void) { f(1); g(Y); h(); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/stmt_contract.i0000666000000000000000000000174613571573400023246 0ustar /* run.config COMMENT: stmt contract */ int main(void) { int x = 0, y = 2; // one ensures /*@ ensures x == 1; */ x = 1; // several ensures /*@ ensures x == 2; @ ensures y == 2; @ ensures x == 2 && y == 2; // generate local variables: see BTS #2339 @*/ x = 2; // one requires /*@ requires x == 2; */ x = x + 1; // several requires /*@ requires x == 3; @ requires y == 2; */ x = x + y; // several behaviors /*@ behavior b1: @ requires x == 5; @ ensures x == 3; @ behavior b2: @ requires x == 3+y; @ requires y == 2; @ ensures x == y+1; */ x = 3; // mix requires and assumes /*@ behavior b1: @ assumes x == 1; @ requires x == 0; @ behavior b2: @ assumes x == 3; @ assumes y == 2; @ requires x == 3; @ requires x + y == 5; */ x = x + y; /*@ requires x == 5; */ /*@ requires y == 2; */ x = x + y; /*@ requires x == 7; @ ensures x == 7; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/true.i0000666000000000000000000000032613571573400021332 0ustar /* run.config COMMENT: assert \true */ int main(void) { int x = 0; x++; /* prevent GCC's warning */ ///*@ assert \true == 0; */ // \true as a term: not yet implemented /*@ assert \true; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/constructs/typedef.i0000666000000000000000000000025213571573400022011 0ustar /* run.config COMMENT: typedef (from a Bernard's bug report) */ typedef unsigned char uint8; int main(void) { uint8 x = 0; /*@ assert x == 0; */ ; return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/examples/0000777000000000000000000000000013571573400017607 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/examples/functions_contiki.c0000666000000000000000000000102713571573400023503 0ustar /* run.config COMMENT: functions used in Contiki */ #include #include struct list { struct list *next; int value; }; /*@ logic integer length_aux(struct list *l, integer n) = n < 0 ? -1 : l == NULL ? n : n < INT_MAX ? length_aux(l->next, n+1) : -1; logic integer length(struct list *l) = length_aux(l, 0); */ int main (void) { struct list node1, node2, node3; node1.next = &node2; node2.next = &node3; struct list *l = &node1; /*@ assert length(l) == 3; */ ; }frama-c-20.0-Calcium/src/plugins/e-acsl/tests/examples/linear_search.i0000666000000000000000000000163613571573400022566 0ustar /* run.config COMMENT: linear search (example from the SAC'13 article) */ int A[10]; /*@ requires \forall integer i; 0 <= i < 9 ==> A[i] <= A[i+1]; behavior exists: assumes \exists integer j; 0 <= j < 10 && A[j] == elt; ensures \result == 1; behavior not_exists: assumes \forall integer j; 0 <= j < 10 ==> A[j] != elt; ensures \result == 0; */ int search(int elt){ int k; // linear search in a sorted array /*@ loop invariant 0 <= k <= 10; @ loop invariant \forall integer i; 0 <= i < k ==> A[i] < elt; */ for(k = 0; k < 10; k++) if(A[k] == elt) return 1; // element found else if(A[k] > elt) return 0; // element not found (sorted array) return 0; // element not found } int main(void) { int found; for(int i = 0; i < 10; i++) A[i] = i * i; found = search(36); /*@ assert found == 1; */ found = search(5); /*@ assert found == 0; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/examples/oracle_ci/0000777000000000000000000000000013571573400021527 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/examples/oracle_ci/functions_contiki.res.oracle0000666000000000000000000000050413571573400027235 0ustar [e-acsl] beginning translation. [e-acsl] tests/examples/functions_contiki.c:27: Warning: E-ACSL construct `logic functions with labels' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/examples/functions_contiki.c:27: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/examples/oracle_ci/gen_functions_contiki.c0000666000000000000000000000236713571573400026264 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" struct list { struct list *next ; int value ; }; /*@ logic ℤ length_aux{L}(struct list *l, ℤ n) = \at(n < 0? -1: (l ≡ (struct list *)((void *)0)? n: (n < 2147483647? length_aux(l->next, n + 1): -1)), L); */ /*@ logic ℤ length{L}(struct list *l) = \at(length_aux(l, 0),L); */ int main(void) { int __retres; struct list node1; struct list node2; struct list node3; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& node3),(size_t)16); __e_acsl_store_block((void *)(& node2),(size_t)16); __e_acsl_store_block((void *)(& node1),(size_t)16); __e_acsl_initialize((void *)(& node1.next),sizeof(struct list *)); node1.next = & node2; __e_acsl_initialize((void *)(& node2.next),sizeof(struct list *)); node2.next = & node3; struct list *l = & node1; __e_acsl_store_block((void *)(& l),(size_t)8); __e_acsl_full_init((void *)(& l)); /*@ assert length(l) ≡ 3; */ ; __retres = 0; __e_acsl_delete_block((void *)(& l)); __e_acsl_delete_block((void *)(& node3)); __e_acsl_delete_block((void *)(& node2)); __e_acsl_delete_block((void *)(& node1)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/examples/oracle_ci/gen_linear_search.c0000666000000000000000000001703113571573400025325 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; int A[10]; /*@ requires ∀ ℤ i; 0 ≤ i < 9 ⇒ A[i] ≤ A[i + 1]; behavior exists: assumes ∃ ℤ j; 0 ≤ j < 10 ∧ A[j] ≡ elt; ensures \result ≡ 1; behavior not_exists: assumes ∀ ℤ j; 0 ≤ j < 10 ⇒ A[j] ≢ elt; ensures \result ≡ 0; */ int __gen_e_acsl_search(int elt); int search(int elt) { int __retres; int k; k = 0; { { int __gen_e_acsl_forall; int __gen_e_acsl_i; int __gen_e_acsl_and; __gen_e_acsl_forall = 1; __gen_e_acsl_i = 0; while (1) { if (__gen_e_acsl_i < k) ; else break; __e_acsl_assert(__gen_e_acsl_i < 10,(char *)"RTE",(char *)"search", (char *)"index_bound: __gen_e_acsl_i < 10",18); __e_acsl_assert(0 <= __gen_e_acsl_i,(char *)"RTE",(char *)"search", (char *)"index_bound: 0 <= __gen_e_acsl_i",18); if (A[__gen_e_acsl_i] < elt) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop1; } __gen_e_acsl_i ++; } e_acsl_end_loop1: ; __e_acsl_assert(__gen_e_acsl_forall,(char *)"Invariant", (char *)"search", (char *)"\\forall integer i; 0 <= i < k ==> A[i] < elt", 18); if (0 <= k) __gen_e_acsl_and = k <= 10; else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Invariant",(char *)"search", (char *)"0 <= k <= 10",17); } /*@ loop invariant 0 ≤ k ≤ 10; loop invariant ∀ ℤ i; 0 ≤ i < k ⇒ A[i] < elt; */ while (k < 10) { if (A[k] == elt) { __retres = 1; goto return_label; } else if (A[k] > elt) { __retres = 0; goto return_label; } { int __gen_e_acsl_and_2; int __gen_e_acsl_forall_2; int __gen_e_acsl_i_2; k ++; if (0 <= k) __gen_e_acsl_and_2 = k <= 10; else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Invariant", (char *)"search",(char *)"0 <= k <= 10",17); __gen_e_acsl_forall_2 = 1; __gen_e_acsl_i_2 = 0; while (1) { if (__gen_e_acsl_i_2 < k) ; else break; __e_acsl_assert(__gen_e_acsl_i_2 < 10,(char *)"RTE", (char *)"search", (char *)"index_bound: __gen_e_acsl_i_2 < 10",18); __e_acsl_assert(0 <= __gen_e_acsl_i_2,(char *)"RTE", (char *)"search", (char *)"index_bound: 0 <= __gen_e_acsl_i_2",18); if (A[__gen_e_acsl_i_2] < elt) ; else { __gen_e_acsl_forall_2 = 0; goto e_acsl_end_loop2; } __gen_e_acsl_i_2 ++; } e_acsl_end_loop2: ; __e_acsl_assert(__gen_e_acsl_forall_2,(char *)"Invariant", (char *)"search", (char *)"\\forall integer i; 0 <= i < k ==> A[i] < elt", 18); } } } __retres = 0; return_label: return __retres; } int main(void) { int __retres; int found; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); { int i = 0; while (i < 10) { A[i] = i * i; i ++; } } found = __gen_e_acsl_search(36); /*@ assert found ≡ 1; */ __e_acsl_assert(found == 1,(char *)"Assertion",(char *)"main", (char *)"found == 1",31); found = __gen_e_acsl_search(5); /*@ assert found ≡ 0; */ __e_acsl_assert(found == 0,(char *)"Assertion",(char *)"main", (char *)"found == 0",34); __retres = 0; return __retres; } /*@ requires ∀ ℤ i; 0 ≤ i < 9 ⇒ A[i] ≤ A[i + 1]; behavior exists: assumes ∃ ℤ j; 0 ≤ j < 10 ∧ A[j] ≡ elt; ensures \result ≡ 1; behavior not_exists: assumes ∀ ℤ j; 0 ≤ j < 10 ⇒ A[j] ≢ elt; ensures \result ≡ 0; */ int __gen_e_acsl_search(int elt) { int __gen_e_acsl_at_2; int __gen_e_acsl_at; int __retres; { int __gen_e_acsl_forall_2; int __gen_e_acsl_j_2; __gen_e_acsl_forall_2 = 1; __gen_e_acsl_j_2 = 0; while (1) { if (__gen_e_acsl_j_2 < 10) ; else break; __e_acsl_assert(__gen_e_acsl_j_2 < 10,(char *)"RTE",(char *)"search", (char *)"index_bound: __gen_e_acsl_j_2 < 10",12); __e_acsl_assert(0 <= __gen_e_acsl_j_2,(char *)"RTE",(char *)"search", (char *)"index_bound: 0 <= __gen_e_acsl_j_2",12); if (A[__gen_e_acsl_j_2] != elt) ; else { __gen_e_acsl_forall_2 = 0; goto e_acsl_end_loop5; } __gen_e_acsl_j_2 ++; } e_acsl_end_loop5: ; __gen_e_acsl_at_2 = __gen_e_acsl_forall_2; } { int __gen_e_acsl_exists; int __gen_e_acsl_j; __gen_e_acsl_exists = 0; __gen_e_acsl_j = 0; while (1) { if (__gen_e_acsl_j < 10) ; else break; __e_acsl_assert(__gen_e_acsl_j < 10,(char *)"RTE",(char *)"search", (char *)"index_bound: __gen_e_acsl_j < 10",9); __e_acsl_assert(0 <= __gen_e_acsl_j,(char *)"RTE",(char *)"search", (char *)"index_bound: 0 <= __gen_e_acsl_j",9); if (! (A[__gen_e_acsl_j] == elt)) ; else { __gen_e_acsl_exists = 1; goto e_acsl_end_loop4; } __gen_e_acsl_j ++; } e_acsl_end_loop4: ; __gen_e_acsl_at = __gen_e_acsl_exists; } { int __gen_e_acsl_forall; int __gen_e_acsl_i; __gen_e_acsl_forall = 1; __gen_e_acsl_i = 0; while (1) { if (__gen_e_acsl_i < 9) ; else break; __e_acsl_assert((int)(__gen_e_acsl_i + 1L) < 10,(char *)"RTE", (char *)"search", (char *)"index_bound: (int)(__gen_e_acsl_i + 1) < 10", 7); __e_acsl_assert(0 <= (int)(__gen_e_acsl_i + 1L),(char *)"RTE", (char *)"search", (char *)"index_bound: 0 <= (int)(__gen_e_acsl_i + 1)", 7); __e_acsl_assert(__gen_e_acsl_i < 10,(char *)"RTE",(char *)"search", (char *)"index_bound: __gen_e_acsl_i < 10",7); __e_acsl_assert(0 <= __gen_e_acsl_i,(char *)"RTE",(char *)"search", (char *)"index_bound: 0 <= __gen_e_acsl_i",7); if (A[__gen_e_acsl_i] <= A[__gen_e_acsl_i + 1]) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop3; } __gen_e_acsl_i ++; } e_acsl_end_loop3: ; __e_acsl_assert(__gen_e_acsl_forall,(char *)"Precondition", (char *)"search", (char *)"\\forall integer i; 0 <= i < 9 ==> A[i] <= A[i + 1]", 7); } __retres = search(elt); { int __gen_e_acsl_implies; int __gen_e_acsl_implies_2; if (! __gen_e_acsl_at) __gen_e_acsl_implies = 1; else __gen_e_acsl_implies = __retres == 1; __e_acsl_assert(__gen_e_acsl_implies,(char *)"Postcondition", (char *)"search", (char *)"\\old(\\exists integer j; 0 <= j < 10 && A[j] == elt) ==> \\result == 1", 10); if (! __gen_e_acsl_at_2) __gen_e_acsl_implies_2 = 1; else __gen_e_acsl_implies_2 = __retres == 0; __e_acsl_assert(__gen_e_acsl_implies_2,(char *)"Postcondition", (char *)"search", (char *)"\\old(\\forall integer j; 0 <= j < 10 ==> A[j] != elt) ==> \\result == 0", 13); return __retres; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/examples/oracle_ci/linear_search.res.oracle0000666000000000000000000000265613571573400026316 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/examples/linear_search.i:30: Warning: function __gen_e_acsl_search: precondition got status unknown. [eva:alarm] tests/examples/linear_search.i:7: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/examples/linear_search.i:18: Warning: loop invariant got status unknown. [eva:alarm] tests/examples/linear_search.i:18: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/examples/linear_search.i:10: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/examples/linear_search.i:13: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/examples/linear_search.i:10: Warning: function __gen_e_acsl_search, behavior exists: postcondition got status unknown. (Behavior may be inactive, no reduction performed.) [eva:alarm] tests/examples/linear_search.i:13: Warning: function __gen_e_acsl_search, behavior not_exists: postcondition got status unknown. (Behavior may be inactive, no reduction performed.) [eva:alarm] tests/examples/linear_search.i:31: Warning: assertion got status unknown. [eva:alarm] tests/examples/linear_search.i:33: Warning: function __gen_e_acsl_search: precondition got status unknown. [eva:alarm] tests/examples/linear_search.i:34: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/0000777000000000000000000000000013571573400017261 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/fprintf.c0000666000000000000000000000306213571573400021076 0ustar /* run.config_dev COMMENT: Check behaviours of format functions DONTRUN: */ #include #include #include "signalled.h" int main(int argc, const char **argv) { char *pstr = "Hello world!"; char template [256]; /* *** fprintf *** */ // The first argument to printf should be allocated valid FILE OK(fprintf(stdout, "foobar\n")); ABRT(fprintf(NULL, "foobar\n")); FILE *fh = tmpfile(); if (fh) { OK(fprintf(fh, "foobar %s\n", "foobar")); fclose(fh); ABRT(fprintf(fh, "foobar %s\n", "foobar")); ABRT(fprintf(&argc, "foobar %s\n", "foobar")); } /* *** dprintf *** */ // The first argument to dprintf should be opened file descriptor OK(dprintf(1, "foobar\n")); ABRT(dprintf(3, "foobar\n")); /* *** sprintf *** */ // The buffer used with sprintf should be allocated, writeable and large // enough char buf[5]; OK(sprintf(buf, "-%s-", "1")); // 4 chars, fits OK(sprintf(buf, "-%s-", "12")); // 5 chars, still fits ABRT(sprintf(buf, "-%s-", "123")); // 6 chars, no space for NUL ABRT(sprintf(NULL, "-%s-", "123")); // try NULL ABRT(sprintf(pstr, "-%s-", "123")); // try read-only /* *** snprintf *** */ OK(snprintf(buf, 4, "-%s-", "123")); // 4 chars, fits OK(snprintf(buf, 5, "-%s-", "123")); // 4 chars, fits ABRT(snprintf(pstr, 6, "-%s-", "123")); // try read-only ABRT(snprintf(buf, 6, "-%s-", "123")); // not enough space ABRT(snprintf(NULL, 6, "-%s-", "123")); // not enough space OK(snprintf(NULL, 0, "-%s-", "123")); // NULL should be file because of 0 chars to write return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/0000777000000000000000000000000013571573400021201 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/fprintf.res.oracle0000666000000000000000000001654213571573400024640 0ustar [kernel:typing:implicit-function-declaration] tests/format/fprintf.c:16: Warning: Calling undeclared function fork. Old style K&R code? [kernel:typing:incompatible-types-call] tests/format/fprintf.c:23: Warning: expected 'FILE *' but got argument of type 'int *': & argc [e-acsl] beginning translation. [e-acsl] Warning: annotating undefined function `exit': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] Warning: annotating undefined function `tmpfile': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] Warning: annotating undefined function `fclose': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] Warning: annotating undefined function `waitpid': the generated program may miss memory instrumentation if there are memory-related annotations. [kernel:annot:missing-spec] FRAMAC_SHARE/libc/stdio.h:207: Warning: Neither code nor specification for function fprintf, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/libc/stdio.h:211: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/libc/stdio.h:213: Warning: Neither code nor specification for function snprintf, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/libc/stdio.h:215: Warning: Neither code nor specification for function sprintf, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/libc/stdio.h:521: Warning: Neither code nor specification for function dprintf, generating default assigns from the prototype [kernel:annot:missing-spec] tests/format/fprintf.c:16: Warning: Neither code nor specification for function fork, generating default assigns from the prototype [e-acsl] FRAMAC_SHARE/libc/sys/wait.h:92: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/sys/wait.h:86: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/stdio.h:120: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/stdio.h:122: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/stdio.h:97: Warning: E-ACSL construct `predicate with no definition nor reads clause' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/stdio.h:97: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/stdio.h:97: Warning: E-ACSL construct `abnormal termination case in behavior' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [kernel:annot:missing-spec] tests/format/fprintf.c:16: Warning: Neither code nor specification for function __e_acsl_builtin_fprintf, generating default assigns from the prototype [eva:alarm] FRAMAC_SHARE/libc/sys/wait.h:86: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] FRAMAC_SHARE/libc/sys/wait.h:86: Warning: function __gen_e_acsl_waitpid: postcondition 'initialization,stat_loc_init_on_success' got status unknown. [eva:alarm] tests/format/fprintf.c:16: Warning: accessing uninitialized left-value. assert \initialized(&process_status); [kernel:annot:missing-spec] tests/format/signalled.h:12: Warning: Neither code nor specification for function __e_acsl_builtin_printf, generating default assigns from the prototype [eva:invalid-assigns] tests/format/fprintf.c:17: Completely invalid destination for assigns clause *stream. Ignoring. [eva:alarm] tests/format/fprintf.c:17: Warning: accessing uninitialized left-value. assert \initialized(&process_status_0); [eva:alarm] tests/format/fprintf.c:20: Warning: accessing uninitialized left-value. assert \initialized(&process_status_1); [eva:alarm] FRAMAC_SHARE/libc/stdio.h:120: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/format/fprintf.c:22: Warning: accessing uninitialized left-value. assert \initialized(&process_status_2); [eva:invalid-assigns] tests/format/fprintf.c:23: Completely invalid destination for assigns clause *stream. Ignoring. [eva:alarm] tests/format/fprintf.c:23: Warning: accessing uninitialized left-value. assert \initialized(&process_status_3); [kernel:annot:missing-spec] tests/format/fprintf.c:28: Warning: Neither code nor specification for function __e_acsl_builtin_dprintf, generating default assigns from the prototype [eva:alarm] tests/format/fprintf.c:28: Warning: accessing uninitialized left-value. assert \initialized(&process_status_4); [eva:alarm] tests/format/fprintf.c:29: Warning: accessing uninitialized left-value. assert \initialized(&process_status_5); [kernel:annot:missing-spec] tests/format/fprintf.c:35: Warning: Neither code nor specification for function __e_acsl_builtin_sprintf, generating default assigns from the prototype [eva:alarm] tests/format/fprintf.c:35: Warning: accessing uninitialized left-value. assert \initialized(&process_status_6); [eva:alarm] tests/format/fprintf.c:36: Warning: accessing uninitialized left-value. assert \initialized(&process_status_7); [eva:alarm] tests/format/fprintf.c:37: Warning: accessing uninitialized left-value. assert \initialized(&process_status_8); [eva:invalid-assigns] tests/format/fprintf.c:38: Completely invalid destination for assigns clause *(str + (0 ..)). Ignoring. [eva:alarm] tests/format/fprintf.c:38: Warning: accessing uninitialized left-value. assert \initialized(&process_status_9); [eva:invalid-assigns] tests/format/fprintf.c:39: Completely invalid destination for assigns clause *(str + (0 ..)). Ignoring. [eva:alarm] tests/format/fprintf.c:39: Warning: accessing uninitialized left-value. assert \initialized(&process_status_10); [kernel:annot:missing-spec] tests/format/fprintf.c:42: Warning: Neither code nor specification for function __e_acsl_builtin_snprintf, generating default assigns from the prototype [eva:alarm] tests/format/fprintf.c:42: Warning: accessing uninitialized left-value. assert \initialized(&process_status_11); [eva:alarm] tests/format/fprintf.c:43: Warning: accessing uninitialized left-value. assert \initialized(&process_status_12); [eva:invalid-assigns] tests/format/fprintf.c:44: Completely invalid destination for assigns clause *(str + (0 ..)). Ignoring. [eva:alarm] tests/format/fprintf.c:44: Warning: accessing uninitialized left-value. assert \initialized(&process_status_13); [eva:alarm] tests/format/fprintf.c:45: Warning: accessing uninitialized left-value. assert \initialized(&process_status_14); [eva:invalid-assigns] tests/format/fprintf.c:46: Completely invalid destination for assigns clause *(str + (0 ..)). Ignoring. [eva:alarm] tests/format/fprintf.c:46: Warning: accessing uninitialized left-value. assert \initialized(&process_status_15); [eva:invalid-assigns] tests/format/fprintf.c:47: Completely invalid destination for assigns clause *(str + (0 ..)). Ignoring. [eva:alarm] tests/format/fprintf.c:47: Warning: accessing uninitialized left-value. assert \initialized(&process_status_16); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/gen_fprintf.c0000666000000000000000000005365313571573400023662 0ustar /* Generated by Frama-C */ #include "signal.h" #include "stdio.h" #include "stdlib.h" #include "sys/select.h" #include "sys/time.h" #include "sys/wait.h" char *__gen_e_acsl_literal_string_30; char *__gen_e_acsl_literal_string_29; char *__gen_e_acsl_literal_string_28; char *__gen_e_acsl_literal_string_27; char *__gen_e_acsl_literal_string_26; char *__gen_e_acsl_literal_string_25; char *__gen_e_acsl_literal_string_24; char *__gen_e_acsl_literal_string_23; char *__gen_e_acsl_literal_string_22; char *__gen_e_acsl_literal_string_20; char *__gen_e_acsl_literal_string_18; char *__gen_e_acsl_literal_string_15; char *__gen_e_acsl_literal_string_14; char *__gen_e_acsl_literal_string_13; char *__gen_e_acsl_literal_string_12; char *__gen_e_acsl_literal_string_11; char *__gen_e_acsl_literal_string_8; char *__gen_e_acsl_literal_string_7; char *__gen_e_acsl_literal_string_9; char *__gen_e_acsl_literal_string_6; char *__gen_e_acsl_literal_string_10; char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string_3; char *__gen_e_acsl_literal_string_5; char *__gen_e_acsl_literal_string_4; char *__gen_e_acsl_literal_string_21; char *__gen_e_acsl_literal_string_19; char *__gen_e_acsl_literal_string_17; char *__gen_e_acsl_literal_string_16; extern int __e_acsl_sound_verdict; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ fork)(void); void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string_30 = "tests/format/fprintf.c:47"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_30, sizeof("tests/format/fprintf.c:47")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_30); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_30); __gen_e_acsl_literal_string_29 = "tests/format/fprintf.c:46"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_29, sizeof("tests/format/fprintf.c:46")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_29); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_29); __gen_e_acsl_literal_string_28 = "tests/format/fprintf.c:45"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_28, sizeof("tests/format/fprintf.c:45")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_28); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_28); __gen_e_acsl_literal_string_27 = "tests/format/fprintf.c:44"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_27, sizeof("tests/format/fprintf.c:44")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_27); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_27); __gen_e_acsl_literal_string_26 = "tests/format/fprintf.c:43"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_26, sizeof("tests/format/fprintf.c:43")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_26); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_26); __gen_e_acsl_literal_string_25 = "tests/format/fprintf.c:42"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_25, sizeof("tests/format/fprintf.c:42")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_25); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_25); __gen_e_acsl_literal_string_24 = "tests/format/fprintf.c:39"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_24, sizeof("tests/format/fprintf.c:39")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_24); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_24); __gen_e_acsl_literal_string_23 = "tests/format/fprintf.c:38"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_23, sizeof("tests/format/fprintf.c:38")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_23); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_23); __gen_e_acsl_literal_string_22 = "tests/format/fprintf.c:37"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_22, sizeof("tests/format/fprintf.c:37")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_22); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_22); __gen_e_acsl_literal_string_20 = "tests/format/fprintf.c:36"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_20, sizeof("tests/format/fprintf.c:36")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_20); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_20); __gen_e_acsl_literal_string_18 = "tests/format/fprintf.c:35"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_18, sizeof("tests/format/fprintf.c:35")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_18); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_18); __gen_e_acsl_literal_string_15 = "tests/format/fprintf.c:29"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_15, sizeof("tests/format/fprintf.c:29")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_15); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_15); __gen_e_acsl_literal_string_14 = "tests/format/fprintf.c:28"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_14, sizeof("tests/format/fprintf.c:28")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_14); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_14); __gen_e_acsl_literal_string_13 = "tests/format/fprintf.c:23"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_13, sizeof("tests/format/fprintf.c:23")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_13); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_13); __gen_e_acsl_literal_string_12 = "tests/format/fprintf.c:22"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_12, sizeof("tests/format/fprintf.c:22")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_12); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_12); __gen_e_acsl_literal_string_11 = "tests/format/fprintf.c:20"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_11, sizeof("tests/format/fprintf.c:20")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_11); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_11); __gen_e_acsl_literal_string_8 = "tests/format/fprintf.c:17"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_8, sizeof("tests/format/fprintf.c:17")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_8); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_8); __gen_e_acsl_literal_string_7 = "tests/format/fprintf.c:16"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_7, sizeof("tests/format/fprintf.c:16")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_7); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_7); __gen_e_acsl_literal_string_9 = "foobar %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_9, sizeof("foobar %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_9); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_9); __gen_e_acsl_literal_string_6 = "foobar\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_6, sizeof("foobar\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_6); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_6); __gen_e_acsl_literal_string_10 = "foobar"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_10, sizeof("foobar")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_10); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_10); __gen_e_acsl_literal_string = "TEST %d: "; __e_acsl_store_block((void *)__gen_e_acsl_literal_string, sizeof("TEST %d: ")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_2 = "OK: Expected signal at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2, sizeof("OK: Expected signal at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string_3 = "OK: Expected execution at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3, sizeof("OK: Expected execution at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3); __gen_e_acsl_literal_string_5 = "FAIL: Unexpected signal at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_5, sizeof("FAIL: Unexpected signal at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_5); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_5); __gen_e_acsl_literal_string_4 = "FAIL: Unexpected execution at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_4, sizeof("FAIL: Unexpected execution at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_4); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_4); __gen_e_acsl_literal_string_21 = "123"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_21, sizeof("123")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_21); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_21); __gen_e_acsl_literal_string_19 = "12"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_19,sizeof("12")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_19); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_19); __gen_e_acsl_literal_string_17 = "1"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_17,sizeof("1")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_17); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_17); __gen_e_acsl_literal_string_16 = "-%s-"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_16, sizeof("-%s-")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_16); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_16); } return; } int main(int argc, char const **argv) { int __retres; char template[256]; char buf[5]; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); char *pstr = (char *)"Hello world!"; { pid_t pid = fork(); if (! pid) { __e_acsl_builtin_fprintf("",stdout,__gen_e_acsl_literal_string_6); __gen_e_acsl_exit(0); } else { int process_status; __e_acsl_store_block((void *)(& process_status),(size_t)4); __gen_e_acsl_waitpid(pid,& process_status,0); /*@ assert Eva: initialization: \initialized(&process_status); */ signal_eval(process_status,0,__gen_e_acsl_literal_string_7); __e_acsl_delete_block((void *)(& process_status)); } } { pid_t pid_0 = fork(); if (! pid_0) { __e_acsl_builtin_fprintf("",(FILE *)0,__gen_e_acsl_literal_string_6); __gen_e_acsl_exit(0); } else { int process_status_0; __e_acsl_store_block((void *)(& process_status_0),(size_t)4); __gen_e_acsl_waitpid(pid_0,& process_status_0,0); /*@ assert Eva: initialization: \initialized(&process_status_0); */ signal_eval(process_status_0,1,__gen_e_acsl_literal_string_8); __e_acsl_delete_block((void *)(& process_status_0)); } } FILE *fh = __gen_e_acsl_tmpfile(); __e_acsl_store_block((void *)(& fh),(size_t)8); __e_acsl_full_init((void *)(& fh)); if (fh) { { pid_t pid_1 = fork(); if (! pid_1) { __e_acsl_builtin_fprintf("s",fh,__gen_e_acsl_literal_string_9, __gen_e_acsl_literal_string_10); __gen_e_acsl_exit(0); } else { int process_status_1; __e_acsl_store_block((void *)(& process_status_1),(size_t)4); __gen_e_acsl_waitpid(pid_1,& process_status_1,0); /*@ assert Eva: initialization: \initialized(&process_status_1); */ signal_eval(process_status_1,0,__gen_e_acsl_literal_string_11); __e_acsl_delete_block((void *)(& process_status_1)); } } __gen_e_acsl_fclose(fh); { pid_t pid_2 = fork(); if (! pid_2) { __e_acsl_builtin_fprintf("s",fh,__gen_e_acsl_literal_string_9, __gen_e_acsl_literal_string_10); __gen_e_acsl_exit(0); } else { int process_status_2; __e_acsl_store_block((void *)(& process_status_2),(size_t)4); __gen_e_acsl_waitpid(pid_2,& process_status_2,0); /*@ assert Eva: initialization: \initialized(&process_status_2); */ signal_eval(process_status_2,1,__gen_e_acsl_literal_string_12); __e_acsl_delete_block((void *)(& process_status_2)); } } { pid_t pid_3 = fork(); if (! pid_3) { __e_acsl_builtin_fprintf("s",(FILE *)(& argc), __gen_e_acsl_literal_string_9, __gen_e_acsl_literal_string_10); __gen_e_acsl_exit(0); } else { int process_status_3; __e_acsl_store_block((void *)(& process_status_3),(size_t)4); __gen_e_acsl_waitpid(pid_3,& process_status_3,0); /*@ assert Eva: initialization: \initialized(&process_status_3); */ signal_eval(process_status_3,1,__gen_e_acsl_literal_string_13); __e_acsl_delete_block((void *)(& process_status_3)); } } } { pid_t pid_4 = fork(); if (! pid_4) { __e_acsl_builtin_dprintf("",1,__gen_e_acsl_literal_string_6); __gen_e_acsl_exit(0); } else { int process_status_4; __e_acsl_store_block((void *)(& process_status_4),(size_t)4); __gen_e_acsl_waitpid(pid_4,& process_status_4,0); /*@ assert Eva: initialization: \initialized(&process_status_4); */ signal_eval(process_status_4,0,__gen_e_acsl_literal_string_14); __e_acsl_delete_block((void *)(& process_status_4)); } } { pid_t pid_5 = fork(); if (! pid_5) { __e_acsl_builtin_dprintf("",3,__gen_e_acsl_literal_string_6); __gen_e_acsl_exit(0); } else { int process_status_5; __e_acsl_store_block((void *)(& process_status_5),(size_t)4); __gen_e_acsl_waitpid(pid_5,& process_status_5,0); /*@ assert Eva: initialization: \initialized(&process_status_5); */ signal_eval(process_status_5,1,__gen_e_acsl_literal_string_15); __e_acsl_delete_block((void *)(& process_status_5)); } } { pid_t pid_6 = fork(); if (! pid_6) { __e_acsl_builtin_sprintf("s",buf,__gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_17); __gen_e_acsl_exit(0); } else { int process_status_6; __e_acsl_store_block((void *)(& process_status_6),(size_t)4); __gen_e_acsl_waitpid(pid_6,& process_status_6,0); /*@ assert Eva: initialization: \initialized(&process_status_6); */ signal_eval(process_status_6,0,__gen_e_acsl_literal_string_18); __e_acsl_delete_block((void *)(& process_status_6)); } } { pid_t pid_7 = fork(); if (! pid_7) { __e_acsl_builtin_sprintf("s",buf,__gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_19); __gen_e_acsl_exit(0); } else { int process_status_7; __e_acsl_store_block((void *)(& process_status_7),(size_t)4); __gen_e_acsl_waitpid(pid_7,& process_status_7,0); /*@ assert Eva: initialization: \initialized(&process_status_7); */ signal_eval(process_status_7,0,__gen_e_acsl_literal_string_20); __e_acsl_delete_block((void *)(& process_status_7)); } } { pid_t pid_8 = fork(); if (! pid_8) { __e_acsl_builtin_sprintf("s",buf,__gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_21); __gen_e_acsl_exit(0); } else { int process_status_8; __e_acsl_store_block((void *)(& process_status_8),(size_t)4); __gen_e_acsl_waitpid(pid_8,& process_status_8,0); /*@ assert Eva: initialization: \initialized(&process_status_8); */ signal_eval(process_status_8,1,__gen_e_acsl_literal_string_22); __e_acsl_delete_block((void *)(& process_status_8)); } } { pid_t pid_9 = fork(); if (! pid_9) { __e_acsl_builtin_sprintf("s",(char *)0,__gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_21); __gen_e_acsl_exit(0); } else { int process_status_9; __e_acsl_store_block((void *)(& process_status_9),(size_t)4); __gen_e_acsl_waitpid(pid_9,& process_status_9,0); /*@ assert Eva: initialization: \initialized(&process_status_9); */ signal_eval(process_status_9,1,__gen_e_acsl_literal_string_23); __e_acsl_delete_block((void *)(& process_status_9)); } } { pid_t pid_10 = fork(); if (! pid_10) { __e_acsl_builtin_sprintf("s",pstr,__gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_21); __gen_e_acsl_exit(0); } else { int process_status_10; __e_acsl_store_block((void *)(& process_status_10),(size_t)4); __gen_e_acsl_waitpid(pid_10,& process_status_10,0); /*@ assert Eva: initialization: \initialized(&process_status_10); */ signal_eval(process_status_10,1,__gen_e_acsl_literal_string_24); __e_acsl_delete_block((void *)(& process_status_10)); } } { pid_t pid_11 = fork(); if (! pid_11) { __e_acsl_builtin_snprintf("s",buf,(unsigned long)4, __gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_21); __gen_e_acsl_exit(0); } else { int process_status_11; __e_acsl_store_block((void *)(& process_status_11),(size_t)4); __gen_e_acsl_waitpid(pid_11,& process_status_11,0); /*@ assert Eva: initialization: \initialized(&process_status_11); */ signal_eval(process_status_11,0,__gen_e_acsl_literal_string_25); __e_acsl_delete_block((void *)(& process_status_11)); } } { pid_t pid_12 = fork(); if (! pid_12) { __e_acsl_builtin_snprintf("s",buf,(unsigned long)5, __gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_21); __gen_e_acsl_exit(0); } else { int process_status_12; __e_acsl_store_block((void *)(& process_status_12),(size_t)4); __gen_e_acsl_waitpid(pid_12,& process_status_12,0); /*@ assert Eva: initialization: \initialized(&process_status_12); */ signal_eval(process_status_12,0,__gen_e_acsl_literal_string_26); __e_acsl_delete_block((void *)(& process_status_12)); } } { pid_t pid_13 = fork(); if (! pid_13) { __e_acsl_builtin_snprintf("s",pstr,(unsigned long)6, __gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_21); __gen_e_acsl_exit(0); } else { int process_status_13; __e_acsl_store_block((void *)(& process_status_13),(size_t)4); __gen_e_acsl_waitpid(pid_13,& process_status_13,0); /*@ assert Eva: initialization: \initialized(&process_status_13); */ signal_eval(process_status_13,1,__gen_e_acsl_literal_string_27); __e_acsl_delete_block((void *)(& process_status_13)); } } { pid_t pid_14 = fork(); if (! pid_14) { __e_acsl_builtin_snprintf("s",buf,(unsigned long)6, __gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_21); __gen_e_acsl_exit(0); } else { int process_status_14; __e_acsl_store_block((void *)(& process_status_14),(size_t)4); __gen_e_acsl_waitpid(pid_14,& process_status_14,0); /*@ assert Eva: initialization: \initialized(&process_status_14); */ signal_eval(process_status_14,1,__gen_e_acsl_literal_string_28); __e_acsl_delete_block((void *)(& process_status_14)); } } { pid_t pid_15 = fork(); if (! pid_15) { __e_acsl_builtin_snprintf("s",(char *)0,(unsigned long)6, __gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_21); __gen_e_acsl_exit(0); } else { int process_status_15; __e_acsl_store_block((void *)(& process_status_15),(size_t)4); __gen_e_acsl_waitpid(pid_15,& process_status_15,0); /*@ assert Eva: initialization: \initialized(&process_status_15); */ signal_eval(process_status_15,1,__gen_e_acsl_literal_string_29); __e_acsl_delete_block((void *)(& process_status_15)); } } { pid_t pid_16 = fork(); if (! pid_16) { __e_acsl_builtin_snprintf("s",(char *)0,(unsigned long)0, __gen_e_acsl_literal_string_16, __gen_e_acsl_literal_string_21); __gen_e_acsl_exit(0); } else { int process_status_16; __e_acsl_store_block((void *)(& process_status_16),(size_t)4); __gen_e_acsl_waitpid(pid_16,& process_status_16,0); /*@ assert Eva: initialization: \initialized(&process_status_16); */ signal_eval(process_status_16,0,__gen_e_acsl_literal_string_30); __e_acsl_delete_block((void *)(& process_status_16)); } } __retres = 0; __e_acsl_delete_block((void *)(& fh)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/gen_printf.c0000666000000000000000000107123713571573400023513 0ustar /* Generated by Frama-C */ #include "signal.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "sys/time.h" #include "sys/wait.h" #include "time.h" #include "unistd.h" #include "wchar.h" char *__gen_e_acsl_literal_string_7; char *__gen_e_acsl_literal_string_337; char *__gen_e_acsl_literal_string_335; char *__gen_e_acsl_literal_string_333; char *__gen_e_acsl_literal_string_332; char *__gen_e_acsl_literal_string_330; char *__gen_e_acsl_literal_string_328; char *__gen_e_acsl_literal_string_326; char *__gen_e_acsl_literal_string_324; char *__gen_e_acsl_literal_string_322; char *__gen_e_acsl_literal_string_320; char *__gen_e_acsl_literal_string_318; char *__gen_e_acsl_literal_string_316; char *__gen_e_acsl_literal_string_315; char *__gen_e_acsl_literal_string_314; char *__gen_e_acsl_literal_string_313; char *__gen_e_acsl_literal_string_311; char *__gen_e_acsl_literal_string_310; char *__gen_e_acsl_literal_string_309; char *__gen_e_acsl_literal_string_307; char *__gen_e_acsl_literal_string_305; char *__gen_e_acsl_literal_string_303; char *__gen_e_acsl_literal_string_301; char *__gen_e_acsl_literal_string_299; char *__gen_e_acsl_literal_string_297; char *__gen_e_acsl_literal_string_296; char *__gen_e_acsl_literal_string_295; char *__gen_e_acsl_literal_string_294; char *__gen_e_acsl_literal_string_293; char *__gen_e_acsl_literal_string_292; char *__gen_e_acsl_literal_string_291; char *__gen_e_acsl_literal_string_290; char *__gen_e_acsl_literal_string_288; char *__gen_e_acsl_literal_string_287; char *__gen_e_acsl_literal_string_285; char *__gen_e_acsl_literal_string_284; char *__gen_e_acsl_literal_string_283; char *__gen_e_acsl_literal_string_282; char *__gen_e_acsl_literal_string_281; char *__gen_e_acsl_literal_string_280; char *__gen_e_acsl_literal_string_279; char *__gen_e_acsl_literal_string_277; char *__gen_e_acsl_literal_string_276; char *__gen_e_acsl_literal_string_275; char *__gen_e_acsl_literal_string_273; char *__gen_e_acsl_literal_string_271; char *__gen_e_acsl_literal_string_270; char *__gen_e_acsl_literal_string_269; char *__gen_e_acsl_literal_string_267; char *__gen_e_acsl_literal_string_265; char *__gen_e_acsl_literal_string_264; char *__gen_e_acsl_literal_string_263; char *__gen_e_acsl_literal_string_261; char *__gen_e_acsl_literal_string_259; char *__gen_e_acsl_literal_string_258; char *__gen_e_acsl_literal_string_257; char *__gen_e_acsl_literal_string_255; char *__gen_e_acsl_literal_string_253; char *__gen_e_acsl_literal_string_252; char *__gen_e_acsl_literal_string_251; char *__gen_e_acsl_literal_string_249; char *__gen_e_acsl_literal_string_247; char *__gen_e_acsl_literal_string_246; char *__gen_e_acsl_literal_string_245; char *__gen_e_acsl_literal_string_243; char *__gen_e_acsl_literal_string_241; char *__gen_e_acsl_literal_string_240; char *__gen_e_acsl_literal_string_239; char *__gen_e_acsl_literal_string_237; char *__gen_e_acsl_literal_string_235; char *__gen_e_acsl_literal_string_234; char *__gen_e_acsl_literal_string_233; char *__gen_e_acsl_literal_string_231; char *__gen_e_acsl_literal_string_226; char *__gen_e_acsl_literal_string_221; char *__gen_e_acsl_literal_string_216; char *__gen_e_acsl_literal_string_211; char *__gen_e_acsl_literal_string_206; char *__gen_e_acsl_literal_string_201; char *__gen_e_acsl_literal_string_196; char *__gen_e_acsl_literal_string_194; char *__gen_e_acsl_literal_string_193; char *__gen_e_acsl_literal_string_192; char *__gen_e_acsl_literal_string_191; char *__gen_e_acsl_literal_string_190; char *__gen_e_acsl_literal_string_186; char *__gen_e_acsl_literal_string_183; char *__gen_e_acsl_literal_string_180; char *__gen_e_acsl_literal_string_177; char *__gen_e_acsl_literal_string_174; char *__gen_e_acsl_literal_string_172; char *__gen_e_acsl_literal_string_170; char *__gen_e_acsl_literal_string_168; char *__gen_e_acsl_literal_string_167; char *__gen_e_acsl_literal_string_166; char *__gen_e_acsl_literal_string_165; char *__gen_e_acsl_literal_string_164; char *__gen_e_acsl_literal_string_163; char *__gen_e_acsl_literal_string_161; char *__gen_e_acsl_literal_string_159; char *__gen_e_acsl_literal_string_157; char *__gen_e_acsl_literal_string_155; char *__gen_e_acsl_literal_string_152; char *__gen_e_acsl_literal_string_149; char *__gen_e_acsl_literal_string_146; char *__gen_e_acsl_literal_string_143; char *__gen_e_acsl_literal_string_141; char *__gen_e_acsl_literal_string_138; char *__gen_e_acsl_literal_string_135; char *__gen_e_acsl_literal_string_133; char *__gen_e_acsl_literal_string_130; char *__gen_e_acsl_literal_string_128; char *__gen_e_acsl_literal_string_125; char *__gen_e_acsl_literal_string_122; char *__gen_e_acsl_literal_string_119; char *__gen_e_acsl_literal_string_117; char *__gen_e_acsl_literal_string_114; char *__gen_e_acsl_literal_string_111; char *__gen_e_acsl_literal_string_108; char *__gen_e_acsl_literal_string_106; char *__gen_e_acsl_literal_string_102; char *__gen_e_acsl_literal_string_99; char *__gen_e_acsl_literal_string_96; char *__gen_e_acsl_literal_string_94; char *__gen_e_acsl_literal_string_92; char *__gen_e_acsl_literal_string_89; char *__gen_e_acsl_literal_string_86; char *__gen_e_acsl_literal_string_83; char *__gen_e_acsl_literal_string_80; char *__gen_e_acsl_literal_string_78; char *__gen_e_acsl_literal_string_75; char *__gen_e_acsl_literal_string_72; char *__gen_e_acsl_literal_string_70; char *__gen_e_acsl_literal_string_66; char *__gen_e_acsl_literal_string_63; char *__gen_e_acsl_literal_string_60; char *__gen_e_acsl_literal_string_58; char *__gen_e_acsl_literal_string_55; char *__gen_e_acsl_literal_string_52; char *__gen_e_acsl_literal_string_49; char *__gen_e_acsl_literal_string_47; char *__gen_e_acsl_literal_string_44; char *__gen_e_acsl_literal_string_42; char *__gen_e_acsl_literal_string_40; char *__gen_e_acsl_literal_string_38; char *__gen_e_acsl_literal_string_35; char *__gen_e_acsl_literal_string_32; char *__gen_e_acsl_literal_string_29; char *__gen_e_acsl_literal_string_27; char *__gen_e_acsl_literal_string_25; char *__gen_e_acsl_literal_string_23; char *__gen_e_acsl_literal_string_21; char *__gen_e_acsl_literal_string_19; char *__gen_e_acsl_literal_string_18; char *__gen_e_acsl_literal_string_16; char *__gen_e_acsl_literal_string_14; char *__gen_e_acsl_literal_string_12; char *__gen_e_acsl_literal_string_33; char *__gen_e_acsl_literal_string_9; char *__gen_e_acsl_literal_string_6; char *__gen_e_acsl_literal_string_338; char *__gen_e_acsl_literal_string_68; char *__gen_e_acsl_literal_string_45; char *__gen_e_acsl_literal_string_30; char *__gen_e_acsl_literal_string_36; char *__gen_e_acsl_literal_string_8; char *__gen_e_acsl_literal_string_139; char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string_3; char *__gen_e_acsl_literal_string_10; char *__gen_e_acsl_literal_string_11; char *__gen_e_acsl_literal_string_5; char *__gen_e_acsl_literal_string_4; char *__gen_e_acsl_literal_string_223; char *__gen_e_acsl_literal_string_124; char *__gen_e_acsl_literal_string_220; char *__gen_e_acsl_literal_string_121; char *__gen_e_acsl_literal_string_222; char *__gen_e_acsl_literal_string_123; char *__gen_e_acsl_literal_string_126; char *__gen_e_acsl_literal_string_120; char *__gen_e_acsl_literal_string_118; char *__gen_e_acsl_literal_string_224; char *__gen_e_acsl_literal_string_116; char *__gen_e_acsl_literal_string_188; char *__gen_e_acsl_literal_string_185; char *__gen_e_acsl_literal_string_228; char *__gen_e_acsl_literal_string_132; char *__gen_e_acsl_literal_string_225; char *__gen_e_acsl_literal_string_129; char *__gen_e_acsl_literal_string_227; char *__gen_e_acsl_literal_string_131; char *__gen_e_acsl_literal_string_137; char *__gen_e_acsl_literal_string_182; char *__gen_e_acsl_literal_string_136; char *__gen_e_acsl_literal_string_184; char *__gen_e_acsl_literal_string_134; char *__gen_e_acsl_literal_string_229; char *__gen_e_acsl_literal_string_127; char *__gen_e_acsl_literal_string_26; char *__gen_e_acsl_literal_string_17; char *__gen_e_acsl_literal_string_13; char *__gen_e_acsl_literal_string_15; char *__gen_e_acsl_literal_string_289; char *__gen_e_acsl_literal_string_308; char *__gen_e_acsl_literal_string_187; char *__gen_e_acsl_literal_string_312; char *__gen_e_acsl_literal_string_158; char *__gen_e_acsl_literal_string_198; char *__gen_e_acsl_literal_string_77; char *__gen_e_acsl_literal_string_195; char *__gen_e_acsl_literal_string_74; char *__gen_e_acsl_literal_string_197; char *__gen_e_acsl_literal_string_76; char *__gen_e_acsl_literal_string_91; char *__gen_e_acsl_literal_string_203; char *__gen_e_acsl_literal_string_101; char *__gen_e_acsl_literal_string_200; char *__gen_e_acsl_literal_string_98; char *__gen_e_acsl_literal_string_202; char *__gen_e_acsl_literal_string_100; char *__gen_e_acsl_literal_string_104; char *__gen_e_acsl_literal_string_43; char *__gen_e_acsl_literal_string_171; char *__gen_e_acsl_literal_string_97; char *__gen_e_acsl_literal_string_41; char *__gen_e_acsl_literal_string_95; char *__gen_e_acsl_literal_string_204; char *__gen_e_acsl_literal_string_103; char *__gen_e_acsl_literal_string_169; char *__gen_e_acsl_literal_string_73; char *__gen_e_acsl_literal_string_39; char *__gen_e_acsl_literal_string_71; char *__gen_e_acsl_literal_string_286; char *__gen_e_acsl_literal_string_93; char *__gen_e_acsl_literal_string_199; char *__gen_e_acsl_literal_string_69; char *__gen_e_acsl_literal_string_218; char *__gen_e_acsl_literal_string_113; char *__gen_e_acsl_literal_string_215; char *__gen_e_acsl_literal_string_110; char *__gen_e_acsl_literal_string_217; char *__gen_e_acsl_literal_string_112; char *__gen_e_acsl_literal_string_115; char *__gen_e_acsl_literal_string_179; char *__gen_e_acsl_literal_string_109; char *__gen_e_acsl_literal_string_181; char *__gen_e_acsl_literal_string_107; char *__gen_e_acsl_literal_string_219; char *__gen_e_acsl_literal_string_105; char *__gen_e_acsl_literal_string_160; char *__gen_e_acsl_literal_string_208; char *__gen_e_acsl_literal_string_65; char *__gen_e_acsl_literal_string_205; char *__gen_e_acsl_literal_string_62; char *__gen_e_acsl_literal_string_207; char *__gen_e_acsl_literal_string_64; char *__gen_e_acsl_literal_string_67; char *__gen_e_acsl_literal_string_173; char *__gen_e_acsl_literal_string_61; char *__gen_e_acsl_literal_string_213; char *__gen_e_acsl_literal_string_54; char *__gen_e_acsl_literal_string_210; char *__gen_e_acsl_literal_string_51; char *__gen_e_acsl_literal_string_212; char *__gen_e_acsl_literal_string_53; char *__gen_e_acsl_literal_string_56; char *__gen_e_acsl_literal_string_176; char *__gen_e_acsl_literal_string_50; char *__gen_e_acsl_literal_string_178; char *__gen_e_acsl_literal_string_48; char *__gen_e_acsl_literal_string_214; char *__gen_e_acsl_literal_string_46; char *__gen_e_acsl_literal_string_175; char *__gen_e_acsl_literal_string_59; char *__gen_e_acsl_literal_string_209; char *__gen_e_acsl_literal_string_57; char *__gen_e_acsl_literal_string_248; char *__gen_e_acsl_literal_string_88; char *__gen_e_acsl_literal_string_230; char *__gen_e_acsl_literal_string_79; char *__gen_e_acsl_literal_string_242; char *__gen_e_acsl_literal_string_82; char *__gen_e_acsl_literal_string_336; char *__gen_e_acsl_literal_string_162; char *__gen_e_acsl_literal_string_278; char *__gen_e_acsl_literal_string_236; char *__gen_e_acsl_literal_string_85; char *__gen_e_acsl_literal_string_189; char *__gen_e_acsl_literal_string_156; char *__gen_e_acsl_literal_string_272; char *__gen_e_acsl_literal_string_151; char *__gen_e_acsl_literal_string_254; char *__gen_e_acsl_literal_string_142; char *__gen_e_acsl_literal_string_266; char *__gen_e_acsl_literal_string_145; char *__gen_e_acsl_literal_string_260; char *__gen_e_acsl_literal_string_148; char *__gen_e_acsl_literal_string_140; char *__gen_e_acsl_literal_string_274; char *__gen_e_acsl_literal_string_153; char *__gen_e_acsl_literal_string_256; char *__gen_e_acsl_literal_string_144; char *__gen_e_acsl_literal_string_268; char *__gen_e_acsl_literal_string_147; char *__gen_e_acsl_literal_string_262; char *__gen_e_acsl_literal_string_150; char *__gen_e_acsl_literal_string_250; char *__gen_e_acsl_literal_string_90; char *__gen_e_acsl_literal_string_232; char *__gen_e_acsl_literal_string_81; char *__gen_e_acsl_literal_string_244; char *__gen_e_acsl_literal_string_84; char *__gen_e_acsl_literal_string_154; char *__gen_e_acsl_literal_string_238; char *__gen_e_acsl_literal_string_87; char *__gen_e_acsl_literal_string_22; char *__gen_e_acsl_literal_string_20; char *__gen_e_acsl_literal_string_334; char *__gen_e_acsl_literal_string_28; char *__gen_e_acsl_literal_string_319; char *__gen_e_acsl_literal_string_37; char *__gen_e_acsl_literal_string_24; char *__gen_e_acsl_literal_string_298; char *__gen_e_acsl_literal_string_329; char *__gen_e_acsl_literal_string_306; char *__gen_e_acsl_literal_string_304; char *__gen_e_acsl_literal_string_302; char *__gen_e_acsl_literal_string_31; char *__gen_e_acsl_literal_string_331; char *__gen_e_acsl_literal_string_300; char *__gen_e_acsl_literal_string_327; char *__gen_e_acsl_literal_string_325; char *__gen_e_acsl_literal_string_317; char *__gen_e_acsl_literal_string_321; char *__gen_e_acsl_literal_string_34; char *__gen_e_acsl_literal_string_323; char const *valid_specifiers = "diouxfFeEgGaAcspn"; void apply_specifier(char *format, int spec) { int n; char *tmp_1; __e_acsl_store_block((void *)(& tmp_1),(size_t)8); __e_acsl_store_block((void *)(& n),(size_t)4); __e_acsl_store_block((void *)(& spec),(size_t)4); __e_acsl_store_block((void *)(& format),(size_t)8); void *p = (void *)0; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_full_init((void *)(& tmp_1)); tmp_1 = __gen_e_acsl_strchr(__gen_e_acsl_literal_string_6,spec); if (tmp_1 != (char *)0) __e_acsl_builtin_printf("e",(char const *)format, 1.0); else { char *tmp_0; __e_acsl_store_block((void *)(& tmp_0),(size_t)8); __e_acsl_full_init((void *)(& tmp_0)); tmp_0 = __gen_e_acsl_strchr(__gen_e_acsl_literal_string_7,spec); if (tmp_0 != (char *)0) __e_acsl_builtin_printf("D",(char const *)format, 1U); else { char *tmp; __e_acsl_store_block((void *)(& tmp),(size_t)8); __e_acsl_full_init((void *)(& tmp)); tmp = __gen_e_acsl_strchr(__gen_e_acsl_literal_string_8,spec); if (tmp != (char *)0) __e_acsl_builtin_printf("d",(char const *)format, 97); else if (spec == 's') __e_acsl_builtin_printf("s",(char const *)format, __gen_e_acsl_literal_string_9); else if (spec == 'n') __e_acsl_builtin_printf("i",(char const *)format, & n); else if (spec == 'p') __e_acsl_builtin_printf("p", (char const *)format,p); else __gen_e_acsl_abort(); __e_acsl_delete_block((void *)(& tmp)); } __e_acsl_delete_block((void *)(& tmp_0)); } __e_acsl_delete_block((void *)(& spec)); __e_acsl_delete_block((void *)(& format)); __e_acsl_delete_block((void *)(& tmp_1)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& n)); return; } /*@ assigns \nothing; frees p; */ __attribute__((__FC_BUILTIN__)) void __e_acsl_delete_block(void *p); /* compiler builtin: __attribute__((__FC_BUILTIN__)) void *__builtin_alloca(unsigned long size); */ void test_specifier_application(char const *allowed, char const *fmt, int only_negative, char *at) { size_t tmp; unsigned long __lengthof_format; int i; __e_acsl_store_block((void *)(& i),(size_t)4); __e_acsl_store_block((void *)(& __lengthof_format),(size_t)8); __e_acsl_store_block((void *)(& tmp),(size_t)8); __e_acsl_store_block((void *)(& at),(size_t)8); __e_acsl_store_block((void *)(& only_negative),(size_t)4); __e_acsl_store_block((void *)(& fmt),(size_t)8); __e_acsl_store_block((void *)(& allowed),(size_t)8); __e_acsl_full_init((void *)(& tmp)); tmp = __gen_e_acsl_strlen(fmt); int len = (int)tmp; __e_acsl_store_block((void *)(& len),(size_t)4); __e_acsl_full_init((void *)(& len)); /*@ assert alloca_bounds: 0 < sizeof(char) * (len + 1) ≤ 18446744073709551615; */ { int __gen_e_acsl_and; if (0L < len + 1L) { __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl__2; int __gen_e_acsl_le; __gmpz_init_set_si(__gen_e_acsl_,1L * (len + 1L)); __gmpz_init_set_ui(__gen_e_acsl__2,18446744073709551615UL); __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gen_e_acsl_and = __gen_e_acsl_le <= 0; __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl__2); } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion", (char *)"test_specifier_application", (char *)"alloca_bounds: 0 < sizeof(char) * (len + 1) <= 18446744073709551615", 50); } __e_acsl_full_init((void *)(& __lengthof_format)); __lengthof_format = (unsigned long)(len + 1); char *format = __builtin_alloca(sizeof(char) * __lengthof_format); __e_acsl_store_block((void *)format,sizeof(char) * __lengthof_format); __e_acsl_store_block((void *)(& format),(size_t)8); __e_acsl_full_init((void *)(& format)); __gen_e_acsl_strcpy(format,fmt); { int i_0 = 0; __e_acsl_store_block((void *)(& i_0),(size_t)4); __e_acsl_full_init((void *)(& i_0)); while (1) { size_t tmp_3; __e_acsl_store_block((void *)(& tmp_3),(size_t)8); __e_acsl_full_init((void *)(& tmp_3)); tmp_3 = __gen_e_acsl_strlen(valid_specifiers); ; if (! ((size_t)i_0 < tmp_3)) { __e_acsl_delete_block((void *)(& tmp_3)); break; } { char *tmp_2; __e_acsl_store_block((void *)(& tmp_2),(size_t)8); int c = (int)*(valid_specifiers + i_0); __e_acsl_store_block((void *)(& c),(size_t)4); __e_acsl_full_init((void *)(& c)); __e_acsl_initialize((void *)(format + (len - 1)),sizeof(char)); *(format + (len - 1)) = (char)c; __e_acsl_full_init((void *)(& tmp_2)); tmp_2 = __gen_e_acsl_strchr(allowed,c); if (tmp_2) { if (! only_negative) { { pid_t pid = fork(); __e_acsl_store_block((void *)(& pid),(size_t)4); __e_acsl_full_init((void *)(& pid)); if (! pid) { apply_specifier(format,c); __gen_e_acsl_exit(0); } else { int process_status; __e_acsl_store_block((void *)(& process_status),(size_t)4); waitpid(pid,& process_status,0); signal_eval(process_status,0,(char const *)at); __e_acsl_delete_block((void *)(& process_status)); } __e_acsl_delete_block((void *)(& pid)); } } } else { { pid_t pid_0 = fork(); __e_acsl_store_block((void *)(& pid_0),(size_t)4); __e_acsl_full_init((void *)(& pid_0)); if (! pid_0) { apply_specifier(format,c); __gen_e_acsl_exit(0); } else { int process_status_0; __e_acsl_store_block((void *)(& process_status_0),(size_t)4); waitpid(pid_0,& process_status_0,0); signal_eval(process_status_0,1,(char const *)at); __e_acsl_delete_block((void *)(& process_status_0)); } __e_acsl_delete_block((void *)(& pid_0)); } } __e_acsl_delete_block((void *)(& tmp_2)); __e_acsl_delete_block((void *)(& c)); } __e_acsl_full_init((void *)(& i_0)); i_0 ++; __e_acsl_delete_block((void *)(& tmp_3)); } __e_acsl_delete_block((void *)(& i_0)); } __e_acsl_delete_block((void *)format); __e_acsl_delete_block((void *)(& at)); __e_acsl_delete_block((void *)(& only_negative)); __e_acsl_delete_block((void *)(& fmt)); __e_acsl_delete_block((void *)(& allowed)); __e_acsl_delete_block((void *)(& i)); __e_acsl_delete_block((void *)(& __lengthof_format)); __e_acsl_delete_block((void *)(& format)); __e_acsl_delete_block((void *)(& tmp)); __e_acsl_delete_block((void *)(& len)); return; } void __e_acsl_globals_init(void) { __gen_e_acsl_literal_string_7 = "uoxX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_7,sizeof("uoxX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_7); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_7); __gen_e_acsl_literal_string_337 = "tests/format/printf.c:475"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_337, sizeof("tests/format/printf.c:475")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_337); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_337); __gen_e_acsl_literal_string_335 = "tests/format/printf.c:472"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_335, sizeof("tests/format/printf.c:472")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_335); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_335); __gen_e_acsl_literal_string_333 = "tests/format/printf.c:471"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_333, sizeof("tests/format/printf.c:471")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_333); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_333); __gen_e_acsl_literal_string_332 = "tests/format/printf.c:470"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_332, sizeof("tests/format/printf.c:470")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_332); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_332); __gen_e_acsl_literal_string_330 = "tests/format/printf.c:469"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_330, sizeof("tests/format/printf.c:469")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_330); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_330); __gen_e_acsl_literal_string_328 = "tests/format/printf.c:468"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_328, sizeof("tests/format/printf.c:468")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_328); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_328); __gen_e_acsl_literal_string_326 = "tests/format/printf.c:467"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_326, sizeof("tests/format/printf.c:467")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_326); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_326); __gen_e_acsl_literal_string_324 = "tests/format/printf.c:466"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_324, sizeof("tests/format/printf.c:466")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_324); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_324); __gen_e_acsl_literal_string_322 = "tests/format/printf.c:465"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_322, sizeof("tests/format/printf.c:465")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_322); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_322); __gen_e_acsl_literal_string_320 = "tests/format/printf.c:464"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_320, sizeof("tests/format/printf.c:464")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_320); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_320); __gen_e_acsl_literal_string_318 = "tests/format/printf.c:463"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_318, sizeof("tests/format/printf.c:463")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_318); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_318); __gen_e_acsl_literal_string_316 = "tests/format/printf.c:460"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_316, sizeof("tests/format/printf.c:460")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_316); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_316); __gen_e_acsl_literal_string_315 = "tests/format/printf.c:459"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_315, sizeof("tests/format/printf.c:459")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_315); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_315); __gen_e_acsl_literal_string_314 = "tests/format/printf.c:458"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_314, sizeof("tests/format/printf.c:458")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_314); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_314); __gen_e_acsl_literal_string_313 = "tests/format/printf.c:457"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_313, sizeof("tests/format/printf.c:457")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_313); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_313); __gen_e_acsl_literal_string_311 = "tests/format/printf.c:454"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_311, sizeof("tests/format/printf.c:454")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_311); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_311); __gen_e_acsl_literal_string_310 = "tests/format/printf.c:453"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_310, sizeof("tests/format/printf.c:453")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_310); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_310); __gen_e_acsl_literal_string_309 = "tests/format/printf.c:452"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_309, sizeof("tests/format/printf.c:452")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_309); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_309); __gen_e_acsl_literal_string_307 = "tests/format/printf.c:427"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_307, sizeof("tests/format/printf.c:427")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_307); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_307); __gen_e_acsl_literal_string_305 = "tests/format/printf.c:426"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_305, sizeof("tests/format/printf.c:426")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_305); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_305); __gen_e_acsl_literal_string_303 = "tests/format/printf.c:425"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_303, sizeof("tests/format/printf.c:425")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_303); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_303); __gen_e_acsl_literal_string_301 = "tests/format/printf.c:424"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_301, sizeof("tests/format/printf.c:424")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_301); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_301); __gen_e_acsl_literal_string_299 = "tests/format/printf.c:423"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_299, sizeof("tests/format/printf.c:423")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_299); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_299); __gen_e_acsl_literal_string_297 = "tests/format/printf.c:420"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_297, sizeof("tests/format/printf.c:420")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_297); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_297); __gen_e_acsl_literal_string_296 = "tests/format/printf.c:418"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_296, sizeof("tests/format/printf.c:418")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_296); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_296); __gen_e_acsl_literal_string_295 = "tests/format/printf.c:415"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_295, sizeof("tests/format/printf.c:415")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_295); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_295); __gen_e_acsl_literal_string_294 = "tests/format/printf.c:414"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_294, sizeof("tests/format/printf.c:414")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_294); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_294); __gen_e_acsl_literal_string_293 = "tests/format/printf.c:409"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_293, sizeof("tests/format/printf.c:409")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_293); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_293); __gen_e_acsl_literal_string_292 = "tests/format/printf.c:408"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_292, sizeof("tests/format/printf.c:408")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_292); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_292); __gen_e_acsl_literal_string_291 = "tests/format/printf.c:407"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_291, sizeof("tests/format/printf.c:407")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_291); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_291); __gen_e_acsl_literal_string_290 = "tests/format/printf.c:406"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_290, sizeof("tests/format/printf.c:406")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_290); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_290); __gen_e_acsl_literal_string_288 = "tests/format/printf.c:399"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_288, sizeof("tests/format/printf.c:399")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_288); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_288); __gen_e_acsl_literal_string_287 = "tests/format/printf.c:398"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_287, sizeof("tests/format/printf.c:398")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_287); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_287); __gen_e_acsl_literal_string_285 = "tests/format/printf.c:395"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_285, sizeof("tests/format/printf.c:395")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_285); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_285); __gen_e_acsl_literal_string_284 = "tests/format/printf.c:394"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_284, sizeof("tests/format/printf.c:394")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_284); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_284); __gen_e_acsl_literal_string_283 = "tests/format/printf.c:393"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_283, sizeof("tests/format/printf.c:393")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_283); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_283); __gen_e_acsl_literal_string_282 = "tests/format/printf.c:392"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_282, sizeof("tests/format/printf.c:392")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_282); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_282); __gen_e_acsl_literal_string_281 = "tests/format/printf.c:391"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_281, sizeof("tests/format/printf.c:391")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_281); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_281); __gen_e_acsl_literal_string_280 = "tests/format/printf.c:390"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_280, sizeof("tests/format/printf.c:390")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_280); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_280); __gen_e_acsl_literal_string_279 = "tests/format/printf.c:389"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_279, sizeof("tests/format/printf.c:389")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_279); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_279); __gen_e_acsl_literal_string_277 = "tests/format/printf.c:386"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_277, sizeof("tests/format/printf.c:386")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_277); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_277); __gen_e_acsl_literal_string_276 = "tests/format/printf.c:385"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_276, sizeof("tests/format/printf.c:385")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_276); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_276); __gen_e_acsl_literal_string_275 = "tests/format/printf.c:384"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_275, sizeof("tests/format/printf.c:384")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_275); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_275); __gen_e_acsl_literal_string_273 = "tests/format/printf.c:383"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_273, sizeof("tests/format/printf.c:383")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_273); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_273); __gen_e_acsl_literal_string_271 = "tests/format/printf.c:382"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_271, sizeof("tests/format/printf.c:382")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_271); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_271); __gen_e_acsl_literal_string_270 = "tests/format/printf.c:381"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_270, sizeof("tests/format/printf.c:381")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_270); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_270); __gen_e_acsl_literal_string_269 = "tests/format/printf.c:380"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_269, sizeof("tests/format/printf.c:380")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_269); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_269); __gen_e_acsl_literal_string_267 = "tests/format/printf.c:379"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_267, sizeof("tests/format/printf.c:379")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_267); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_267); __gen_e_acsl_literal_string_265 = "tests/format/printf.c:378"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_265, sizeof("tests/format/printf.c:378")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_265); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_265); __gen_e_acsl_literal_string_264 = "tests/format/printf.c:377"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_264, sizeof("tests/format/printf.c:377")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_264); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_264); __gen_e_acsl_literal_string_263 = "tests/format/printf.c:376"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_263, sizeof("tests/format/printf.c:376")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_263); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_263); __gen_e_acsl_literal_string_261 = "tests/format/printf.c:375"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_261, sizeof("tests/format/printf.c:375")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_261); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_261); __gen_e_acsl_literal_string_259 = "tests/format/printf.c:374"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_259, sizeof("tests/format/printf.c:374")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_259); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_259); __gen_e_acsl_literal_string_258 = "tests/format/printf.c:373"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_258, sizeof("tests/format/printf.c:373")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_258); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_258); __gen_e_acsl_literal_string_257 = "tests/format/printf.c:372"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_257, sizeof("tests/format/printf.c:372")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_257); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_257); __gen_e_acsl_literal_string_255 = "tests/format/printf.c:371"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_255, sizeof("tests/format/printf.c:371")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_255); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_255); __gen_e_acsl_literal_string_253 = "tests/format/printf.c:368"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_253, sizeof("tests/format/printf.c:368")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_253); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_253); __gen_e_acsl_literal_string_252 = "tests/format/printf.c:367"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_252, sizeof("tests/format/printf.c:367")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_252); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_252); __gen_e_acsl_literal_string_251 = "tests/format/printf.c:366"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_251, sizeof("tests/format/printf.c:366")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_251); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_251); __gen_e_acsl_literal_string_249 = "tests/format/printf.c:365"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_249, sizeof("tests/format/printf.c:365")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_249); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_249); __gen_e_acsl_literal_string_247 = "tests/format/printf.c:364"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_247, sizeof("tests/format/printf.c:364")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_247); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_247); __gen_e_acsl_literal_string_246 = "tests/format/printf.c:363"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_246, sizeof("tests/format/printf.c:363")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_246); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_246); __gen_e_acsl_literal_string_245 = "tests/format/printf.c:362"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_245, sizeof("tests/format/printf.c:362")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_245); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_245); __gen_e_acsl_literal_string_243 = "tests/format/printf.c:361"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_243, sizeof("tests/format/printf.c:361")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_243); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_243); __gen_e_acsl_literal_string_241 = "tests/format/printf.c:360"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_241, sizeof("tests/format/printf.c:360")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_241); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_241); __gen_e_acsl_literal_string_240 = "tests/format/printf.c:359"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_240, sizeof("tests/format/printf.c:359")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_240); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_240); __gen_e_acsl_literal_string_239 = "tests/format/printf.c:358"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_239, sizeof("tests/format/printf.c:358")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_239); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_239); __gen_e_acsl_literal_string_237 = "tests/format/printf.c:357"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_237, sizeof("tests/format/printf.c:357")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_237); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_237); __gen_e_acsl_literal_string_235 = "tests/format/printf.c:356"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_235, sizeof("tests/format/printf.c:356")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_235); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_235); __gen_e_acsl_literal_string_234 = "tests/format/printf.c:355"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_234, sizeof("tests/format/printf.c:355")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_234); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_234); __gen_e_acsl_literal_string_233 = "tests/format/printf.c:354"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_233, sizeof("tests/format/printf.c:354")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_233); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_233); __gen_e_acsl_literal_string_231 = "tests/format/printf.c:353"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_231, sizeof("tests/format/printf.c:353")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_231); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_231); __gen_e_acsl_literal_string_226 = "tests/format/printf.c:349"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_226, sizeof("tests/format/printf.c:349")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_226); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_226); __gen_e_acsl_literal_string_221 = "tests/format/printf.c:347"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_221, sizeof("tests/format/printf.c:347")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_221); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_221); __gen_e_acsl_literal_string_216 = "tests/format/printf.c:346"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_216, sizeof("tests/format/printf.c:346")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_216); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_216); __gen_e_acsl_literal_string_211 = "tests/format/printf.c:345"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_211, sizeof("tests/format/printf.c:345")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_211); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_211); __gen_e_acsl_literal_string_206 = "tests/format/printf.c:343"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_206, sizeof("tests/format/printf.c:343")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_206); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_206); __gen_e_acsl_literal_string_201 = "tests/format/printf.c:341"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_201, sizeof("tests/format/printf.c:341")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_201); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_201); __gen_e_acsl_literal_string_196 = "tests/format/printf.c:340"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_196, sizeof("tests/format/printf.c:340")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_196); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_196); __gen_e_acsl_literal_string_194 = "tests/format/printf.c:337"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_194, sizeof("tests/format/printf.c:337")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_194); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_194); __gen_e_acsl_literal_string_193 = "tests/format/printf.c:336"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_193, sizeof("tests/format/printf.c:336")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_193); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_193); __gen_e_acsl_literal_string_192 = "tests/format/printf.c:335"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_192, sizeof("tests/format/printf.c:335")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_192); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_192); __gen_e_acsl_literal_string_191 = "tests/format/printf.c:334"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_191, sizeof("tests/format/printf.c:334")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_191); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_191); __gen_e_acsl_literal_string_190 = "tests/format/printf.c:333"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_190, sizeof("tests/format/printf.c:333")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_190); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_190); __gen_e_acsl_literal_string_186 = "tests/format/printf.c:332"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_186, sizeof("tests/format/printf.c:332")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_186); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_186); __gen_e_acsl_literal_string_183 = "tests/format/printf.c:329"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_183, sizeof("tests/format/printf.c:329")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_183); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_183); __gen_e_acsl_literal_string_180 = "tests/format/printf.c:325"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_180, sizeof("tests/format/printf.c:325")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_180); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_180); __gen_e_acsl_literal_string_177 = "tests/format/printf.c:323"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_177, sizeof("tests/format/printf.c:323")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_177); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_177); __gen_e_acsl_literal_string_174 = "tests/format/printf.c:322"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_174, sizeof("tests/format/printf.c:322")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_174); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_174); __gen_e_acsl_literal_string_172 = "tests/format/printf.c:321"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_172, sizeof("tests/format/printf.c:321")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_172); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_172); __gen_e_acsl_literal_string_170 = "tests/format/printf.c:320"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_170, sizeof("tests/format/printf.c:320")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_170); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_170); __gen_e_acsl_literal_string_168 = "tests/format/printf.c:317"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_168, sizeof("tests/format/printf.c:317")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_168); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_168); __gen_e_acsl_literal_string_167 = "tests/format/printf.c:316"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_167, sizeof("tests/format/printf.c:316")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_167); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_167); __gen_e_acsl_literal_string_166 = "tests/format/printf.c:315"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_166, sizeof("tests/format/printf.c:315")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_166); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_166); __gen_e_acsl_literal_string_165 = "tests/format/printf.c:314"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_165, sizeof("tests/format/printf.c:314")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_165); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_165); __gen_e_acsl_literal_string_164 = "tests/format/printf.c:313"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_164, sizeof("tests/format/printf.c:313")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_164); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_164); __gen_e_acsl_literal_string_163 = "tests/format/printf.c:312"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_163, sizeof("tests/format/printf.c:312")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_163); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_163); __gen_e_acsl_literal_string_161 = "tests/format/printf.c:311"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_161, sizeof("tests/format/printf.c:311")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_161); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_161); __gen_e_acsl_literal_string_159 = "tests/format/printf.c:308"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_159, sizeof("tests/format/printf.c:308")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_159); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_159); __gen_e_acsl_literal_string_157 = "tests/format/printf.c:307"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_157, sizeof("tests/format/printf.c:307")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_157); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_157); __gen_e_acsl_literal_string_155 = "tests/format/printf.c:306"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_155, sizeof("tests/format/printf.c:306")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_155); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_155); __gen_e_acsl_literal_string_152 = "tests/format/printf.c:302"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_152, sizeof("tests/format/printf.c:302")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_152); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_152); __gen_e_acsl_literal_string_149 = "tests/format/printf.c:301"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_149, sizeof("tests/format/printf.c:301")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_149); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_149); __gen_e_acsl_literal_string_146 = "tests/format/printf.c:300"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_146, sizeof("tests/format/printf.c:300")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_146); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_146); __gen_e_acsl_literal_string_143 = "tests/format/printf.c:299"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_143, sizeof("tests/format/printf.c:299")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_143); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_143); __gen_e_acsl_literal_string_141 = "tests/format/printf.c:298"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_141, sizeof("tests/format/printf.c:298")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_141); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_141); __gen_e_acsl_literal_string_138 = "tests/format/printf.c:295"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_138, sizeof("tests/format/printf.c:295")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_138); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_138); __gen_e_acsl_literal_string_135 = "tests/format/printf.c:294"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_135, sizeof("tests/format/printf.c:294")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_135); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_135); __gen_e_acsl_literal_string_133 = "tests/format/printf.c:289"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_133, sizeof("tests/format/printf.c:289")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_133); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_133); __gen_e_acsl_literal_string_130 = "tests/format/printf.c:288"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_130, sizeof("tests/format/printf.c:288")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_130); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_130); __gen_e_acsl_literal_string_128 = "tests/format/printf.c:286"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_128, sizeof("tests/format/printf.c:286")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_128); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_128); __gen_e_acsl_literal_string_125 = "tests/format/printf.c:281"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_125, sizeof("tests/format/printf.c:281")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_125); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_125); __gen_e_acsl_literal_string_122 = "tests/format/printf.c:280"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_122, sizeof("tests/format/printf.c:280")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_122); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_122); __gen_e_acsl_literal_string_119 = "tests/format/printf.c:276"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_119, sizeof("tests/format/printf.c:276")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_119); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_119); __gen_e_acsl_literal_string_117 = "tests/format/printf.c:271"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_117, sizeof("tests/format/printf.c:271")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_117); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_117); __gen_e_acsl_literal_string_114 = "tests/format/printf.c:268"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_114, sizeof("tests/format/printf.c:268")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_114); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_114); __gen_e_acsl_literal_string_111 = "tests/format/printf.c:267"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_111, sizeof("tests/format/printf.c:267")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_111); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_111); __gen_e_acsl_literal_string_108 = "tests/format/printf.c:266"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_108, sizeof("tests/format/printf.c:266")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_108); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_108); __gen_e_acsl_literal_string_106 = "tests/format/printf.c:265"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_106, sizeof("tests/format/printf.c:265")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_106); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_106); __gen_e_acsl_literal_string_102 = "tests/format/printf.c:262"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_102, sizeof("tests/format/printf.c:262")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_102); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_102); __gen_e_acsl_literal_string_99 = "tests/format/printf.c:261"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_99, sizeof("tests/format/printf.c:261")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_99); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_99); __gen_e_acsl_literal_string_96 = "tests/format/printf.c:260"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_96, sizeof("tests/format/printf.c:260")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_96); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_96); __gen_e_acsl_literal_string_94 = "tests/format/printf.c:256"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_94, sizeof("tests/format/printf.c:256")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_94); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_94); __gen_e_acsl_literal_string_92 = "tests/format/printf.c:253"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_92, sizeof("tests/format/printf.c:253")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_92); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_92); __gen_e_acsl_literal_string_89 = "tests/format/printf.c:251"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_89, sizeof("tests/format/printf.c:251")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_89); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_89); __gen_e_acsl_literal_string_86 = "tests/format/printf.c:250"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_86, sizeof("tests/format/printf.c:250")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_86); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_86); __gen_e_acsl_literal_string_83 = "tests/format/printf.c:249"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_83, sizeof("tests/format/printf.c:249")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_83); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_83); __gen_e_acsl_literal_string_80 = "tests/format/printf.c:248"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_80, sizeof("tests/format/printf.c:248")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_80); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_80); __gen_e_acsl_literal_string_78 = "tests/format/printf.c:246"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_78, sizeof("tests/format/printf.c:246")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_78); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_78); __gen_e_acsl_literal_string_75 = "tests/format/printf.c:245"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_75, sizeof("tests/format/printf.c:245")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_75); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_75); __gen_e_acsl_literal_string_72 = "tests/format/printf.c:244"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_72, sizeof("tests/format/printf.c:244")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_72); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_72); __gen_e_acsl_literal_string_70 = "tests/format/printf.c:243"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_70, sizeof("tests/format/printf.c:243")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_70); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_70); __gen_e_acsl_literal_string_66 = "tests/format/printf.c:240"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_66, sizeof("tests/format/printf.c:240")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_66); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_66); __gen_e_acsl_literal_string_63 = "tests/format/printf.c:239"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_63, sizeof("tests/format/printf.c:239")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_63); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_63); __gen_e_acsl_literal_string_60 = "tests/format/printf.c:238"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_60, sizeof("tests/format/printf.c:238")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_60); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_60); __gen_e_acsl_literal_string_58 = "tests/format/printf.c:237"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_58, sizeof("tests/format/printf.c:237")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_58); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_58); __gen_e_acsl_literal_string_55 = "tests/format/printf.c:234"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_55, sizeof("tests/format/printf.c:234")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_55); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_55); __gen_e_acsl_literal_string_52 = "tests/format/printf.c:233"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_52, sizeof("tests/format/printf.c:233")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_52); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_52); __gen_e_acsl_literal_string_49 = "tests/format/printf.c:232"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_49, sizeof("tests/format/printf.c:232")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_49); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_49); __gen_e_acsl_literal_string_47 = "tests/format/printf.c:231"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_47, sizeof("tests/format/printf.c:231")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_47); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_47); __gen_e_acsl_literal_string_44 = "tests/format/printf.c:225"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_44, sizeof("tests/format/printf.c:225")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_44); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_44); __gen_e_acsl_literal_string_42 = "tests/format/printf.c:224"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_42, sizeof("tests/format/printf.c:224")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_42); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_42); __gen_e_acsl_literal_string_40 = "tests/format/printf.c:223"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_40, sizeof("tests/format/printf.c:223")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_40); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_40); __gen_e_acsl_literal_string_38 = "tests/format/printf.c:217"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_38, sizeof("tests/format/printf.c:217")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_38); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_38); __gen_e_acsl_literal_string_35 = "tests/format/printf.c:214"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_35, sizeof("tests/format/printf.c:214")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_35); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_35); __gen_e_acsl_literal_string_32 = "tests/format/printf.c:208"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_32, sizeof("tests/format/printf.c:208")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_32); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_32); __gen_e_acsl_literal_string_29 = "tests/format/printf.c:205"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_29, sizeof("tests/format/printf.c:205")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_29); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_29); __gen_e_acsl_literal_string_27 = "tests/format/printf.c:203"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_27, sizeof("tests/format/printf.c:203")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_27); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_27); __gen_e_acsl_literal_string_25 = "tests/format/printf.c:200"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_25, sizeof("tests/format/printf.c:200")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_25); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_25); __gen_e_acsl_literal_string_23 = "tests/format/printf.c:198"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_23, sizeof("tests/format/printf.c:198")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_23); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_23); __gen_e_acsl_literal_string_21 = "tests/format/printf.c:196"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_21, sizeof("tests/format/printf.c:196")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_21); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_21); __gen_e_acsl_literal_string_19 = "tests/format/printf.c:193"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_19, sizeof("tests/format/printf.c:193")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_19); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_19); __gen_e_acsl_literal_string_18 = "tests/format/printf.c:188"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_18, sizeof("tests/format/printf.c:188")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_18); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_18); __gen_e_acsl_literal_string_16 = "tests/format/printf.c:185"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_16, sizeof("tests/format/printf.c:185")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_16); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_16); __gen_e_acsl_literal_string_14 = "tests/format/printf.c:182"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_14, sizeof("tests/format/printf.c:182")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_14); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_14); __gen_e_acsl_literal_string_12 = "tests/format/printf.c:179"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_12, sizeof("tests/format/printf.c:179")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_12); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_12); __gen_e_acsl_literal_string_33 = "oxXaAeEfFgG"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_33, sizeof("oxXaAeEfFgG")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_33); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_33); __gen_e_acsl_literal_string_9 = "foo"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_9,sizeof("foo")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_9); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_9); __gen_e_acsl_literal_string_6 = "fFeEgGaA"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_6, sizeof("fFeEgGaA")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_6); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_6); __gen_e_acsl_literal_string_338 = "diouxfFeEgGaAcspn"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_338, sizeof("diouxfFeEgGaAcspn")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_338); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_338); __gen_e_acsl_literal_string_68 = "diouxXncsaAeEfFgG"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_68, sizeof("diouxXncsaAeEfFgG")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_68); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_68); __gen_e_acsl_literal_string_45 = "diouxXn"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_45, sizeof("diouxXn")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_45); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_45); __gen_e_acsl_literal_string_30 = "diouxXaAeEfFgGs"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_30, sizeof("diouxXaAeEfFgGs")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_30); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_30); __gen_e_acsl_literal_string_36 = "diouxXaAeEfFgG"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_36, sizeof("diouxXaAeEfFgG")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_36); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_36); __gen_e_acsl_literal_string_8 = "dic"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_8,sizeof("dic")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_8); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_8); __gen_e_acsl_literal_string_139 = "aAeEfFgG"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_139, sizeof("aAeEfFgG")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_139); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_139); __gen_e_acsl_literal_string = "TEST %d: "; __e_acsl_store_block((void *)__gen_e_acsl_literal_string, sizeof("TEST %d: ")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_2 = "OK: Expected signal at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2, sizeof("OK: Expected signal at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string_3 = "OK: Expected execution at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3, sizeof("OK: Expected execution at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3); __gen_e_acsl_literal_string_10 = "Hello world!"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_10, sizeof("Hello world!")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_10); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_10); __gen_e_acsl_literal_string_11 = "Hello world\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_11, sizeof("Hello world\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_11); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_11); __gen_e_acsl_literal_string_5 = "FAIL: Unexpected signal at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_5, sizeof("FAIL: Unexpected signal at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_5); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_5); __gen_e_acsl_literal_string_4 = "FAIL: Unexpected execution at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_4, sizeof("FAIL: Unexpected execution at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_4); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_4); __gen_e_acsl_literal_string_223 = "%zx\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_223, sizeof("%zx\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_223); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_223); __gen_e_acsl_literal_string_124 = "%zx"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_124,sizeof("%zx")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_124); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_124); __gen_e_acsl_literal_string_220 = "%zu\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_220, sizeof("%zu\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_220); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_220); __gen_e_acsl_literal_string_121 = "%zu"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_121,sizeof("%zu")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_121); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_121); __gen_e_acsl_literal_string_222 = "%zo\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_222, sizeof("%zo\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_222); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_222); __gen_e_acsl_literal_string_123 = "%zo"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_123,sizeof("%zo")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_123); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_123); __gen_e_acsl_literal_string_126 = "%zn"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_126,sizeof("%zn")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_126); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_126); __gen_e_acsl_literal_string_120 = "%zi"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_120,sizeof("%zi")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_120); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_120); __gen_e_acsl_literal_string_118 = "%zd"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_118,sizeof("%zd")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_118); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_118); __gen_e_acsl_literal_string_224 = "%zX\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_224, sizeof("%zX\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_224); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_224); __gen_e_acsl_literal_string_116 = "%zX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_116,sizeof("%zX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_116); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_116); __gen_e_acsl_literal_string_188 = "%x\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_188, sizeof("%x\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_188); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_188); __gen_e_acsl_literal_string_185 = "%u\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_185, sizeof("%u\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_185); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_185); __gen_e_acsl_literal_string_228 = "%tx\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_228, sizeof("%tx\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_228); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_228); __gen_e_acsl_literal_string_132 = "%tx"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_132,sizeof("%tx")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_132); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_132); __gen_e_acsl_literal_string_225 = "%tu\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_225, sizeof("%tu\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_225); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_225); __gen_e_acsl_literal_string_129 = "%tu"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_129,sizeof("%tu")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_129); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_129); __gen_e_acsl_literal_string_227 = "%to\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_227, sizeof("%to\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_227); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_227); __gen_e_acsl_literal_string_131 = "%to"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_131,sizeof("%to")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_131); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_131); __gen_e_acsl_literal_string_137 = "%tn"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_137,sizeof("%tn")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_137); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_137); __gen_e_acsl_literal_string_182 = "%ti\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_182, sizeof("%ti\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_182); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_182); __gen_e_acsl_literal_string_136 = "%ti"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_136,sizeof("%ti")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_136); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_136); __gen_e_acsl_literal_string_184 = "%td\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_184, sizeof("%td\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_184); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_184); __gen_e_acsl_literal_string_134 = "%td"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_134,sizeof("%td")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_134); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_134); __gen_e_acsl_literal_string_229 = "%tX\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_229, sizeof("%tX\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_229); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_229); __gen_e_acsl_literal_string_127 = "%tX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_127,sizeof("%tX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_127); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_127); __gen_e_acsl_literal_string_26 = "%s Say it %2$d or %3$u times \n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_26, sizeof("%s Say it %2$d or %3$u times \n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_26); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_26); __gen_e_acsl_literal_string_17 = "%s - %s. Say it %d or %u times \n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_17, sizeof("%s - %s. Say it %d or %u times \n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_17); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_17); __gen_e_acsl_literal_string_13 = "%s - %s! Say it %d or %u times \n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_13, sizeof("%s - %s! Say it %d or %u times \n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_13); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_13); __gen_e_acsl_literal_string_15 = "%s - %s and say it %d or %u more times \n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_15, sizeof("%s - %s and say it %d or %u more times \n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_15); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_15); __gen_e_acsl_literal_string_289 = "%s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_289, sizeof("%s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_289); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_289); __gen_e_acsl_literal_string_308 = "%p"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_308,sizeof("%p")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_308); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_308); __gen_e_acsl_literal_string_187 = "%o\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_187, sizeof("%o\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_187); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_187); __gen_e_acsl_literal_string_312 = "%n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_312,sizeof("%n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_312); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_312); __gen_e_acsl_literal_string_158 = "%m\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_158, sizeof("%m\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_158); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_158); __gen_e_acsl_literal_string_198 = "%lx\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_198, sizeof("%lx\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_198); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_198); __gen_e_acsl_literal_string_77 = "%lx"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_77,sizeof("%lx")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_77); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_77); __gen_e_acsl_literal_string_195 = "%lu\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_195, sizeof("%lu\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_195); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_195); __gen_e_acsl_literal_string_74 = "%lu"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_74,sizeof("%lu")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_74); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_74); __gen_e_acsl_literal_string_197 = "%lo\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_197, sizeof("%lo\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_197); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_197); __gen_e_acsl_literal_string_76 = "%lo"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_76,sizeof("%lo")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_76); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_76); __gen_e_acsl_literal_string_91 = "%ln"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_91,sizeof("%ln")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_91); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_91); __gen_e_acsl_literal_string_203 = "%llx\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_203, sizeof("%llx\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_203); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_203); __gen_e_acsl_literal_string_101 = "%llx"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_101, sizeof("%llx")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_101); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_101); __gen_e_acsl_literal_string_200 = "%llu\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_200, sizeof("%llu\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_200); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_200); __gen_e_acsl_literal_string_98 = "%llu"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_98,sizeof("%llu")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_98); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_98); __gen_e_acsl_literal_string_202 = "%llo\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_202, sizeof("%llo\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_202); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_202); __gen_e_acsl_literal_string_100 = "%llo"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_100, sizeof("%llo")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_100); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_100); __gen_e_acsl_literal_string_104 = "%lln"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_104, sizeof("%lln")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_104); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_104); __gen_e_acsl_literal_string_43 = "%llld\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_43, sizeof("%llld\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_43); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_43); __gen_e_acsl_literal_string_171 = "%lli\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_171, sizeof("%lli\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_171); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_171); __gen_e_acsl_literal_string_97 = "%lli"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_97,sizeof("%lli")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_97); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_97); __gen_e_acsl_literal_string_41 = "%lld\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_41, sizeof("%lld\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_41); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_41); __gen_e_acsl_literal_string_95 = "%lld"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_95,sizeof("%lld")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_95); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_95); __gen_e_acsl_literal_string_204 = "%llX\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_204, sizeof("%llX\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_204); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_204); __gen_e_acsl_literal_string_103 = "%llX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_103, sizeof("%llX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_103); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_103); __gen_e_acsl_literal_string_169 = "%li\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_169, sizeof("%li\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_169); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_169); __gen_e_acsl_literal_string_73 = "%li"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_73,sizeof("%li")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_73); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_73); __gen_e_acsl_literal_string_39 = "%ld\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_39, sizeof("%ld\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_39); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_39); __gen_e_acsl_literal_string_71 = "%ld"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_71,sizeof("%ld")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_71); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_71); __gen_e_acsl_literal_string_286 = "%lc\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_286, sizeof("%lc\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_286); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_286); __gen_e_acsl_literal_string_93 = "%lc"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_93,sizeof("%lc")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_93); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_93); __gen_e_acsl_literal_string_199 = "%lX\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_199, sizeof("%lX\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_199); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_199); __gen_e_acsl_literal_string_69 = "%lX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_69,sizeof("%lX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_69); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_69); __gen_e_acsl_literal_string_218 = "%jx\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_218, sizeof("%jx\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_218); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_218); __gen_e_acsl_literal_string_113 = "%jx"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_113,sizeof("%jx")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_113); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_113); __gen_e_acsl_literal_string_215 = "%ju\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_215, sizeof("%ju\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_215); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_215); __gen_e_acsl_literal_string_110 = "%ju"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_110,sizeof("%ju")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_110); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_110); __gen_e_acsl_literal_string_217 = "%jo\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_217, sizeof("%jo\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_217); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_217); __gen_e_acsl_literal_string_112 = "%jo"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_112,sizeof("%jo")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_112); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_112); __gen_e_acsl_literal_string_115 = "%jn"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_115,sizeof("%jn")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_115); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_115); __gen_e_acsl_literal_string_179 = "%ji\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_179, sizeof("%ji\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_179); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_179); __gen_e_acsl_literal_string_109 = "%ji"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_109,sizeof("%ji")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_109); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_109); __gen_e_acsl_literal_string_181 = "%jd\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_181, sizeof("%jd\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_181); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_181); __gen_e_acsl_literal_string_107 = "%jd"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_107,sizeof("%jd")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_107); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_107); __gen_e_acsl_literal_string_219 = "%jX\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_219, sizeof("%jX\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_219); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_219); __gen_e_acsl_literal_string_105 = "%jX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_105,sizeof("%jX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_105); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_105); __gen_e_acsl_literal_string_160 = "%i\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_160, sizeof("%i\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_160); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_160); __gen_e_acsl_literal_string_208 = "%hx\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_208, sizeof("%hx\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_208); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_208); __gen_e_acsl_literal_string_65 = "%hx"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_65,sizeof("%hx")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_65); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_65); __gen_e_acsl_literal_string_205 = "%hu\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_205, sizeof("%hu\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_205); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_205); __gen_e_acsl_literal_string_62 = "%hu"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_62,sizeof("%hu")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_62); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_62); __gen_e_acsl_literal_string_207 = "%ho\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_207, sizeof("%ho\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_207); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_207); __gen_e_acsl_literal_string_64 = "%ho"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_64,sizeof("%ho")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_64); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_64); __gen_e_acsl_literal_string_67 = "%hn"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_67,sizeof("%hn")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_67); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_67); __gen_e_acsl_literal_string_173 = "%hi\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_173, sizeof("%hi\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_173); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_173); __gen_e_acsl_literal_string_61 = "%hi"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_61,sizeof("%hi")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_61); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_61); __gen_e_acsl_literal_string_213 = "%hhx\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_213, sizeof("%hhx\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_213); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_213); __gen_e_acsl_literal_string_54 = "%hhx"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_54,sizeof("%hhx")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_54); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_54); __gen_e_acsl_literal_string_210 = "%hhu\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_210, sizeof("%hhu\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_210); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_210); __gen_e_acsl_literal_string_51 = "%hhu"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_51,sizeof("%hhu")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_51); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_51); __gen_e_acsl_literal_string_212 = "%hho\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_212, sizeof("%hho\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_212); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_212); __gen_e_acsl_literal_string_53 = "%hho"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_53,sizeof("%hho")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_53); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_53); __gen_e_acsl_literal_string_56 = "%hhn"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_56,sizeof("%hhn")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_56); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_56); __gen_e_acsl_literal_string_176 = "%hhi\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_176, sizeof("%hhi\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_176); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_176); __gen_e_acsl_literal_string_50 = "%hhi"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_50,sizeof("%hhi")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_50); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_50); __gen_e_acsl_literal_string_178 = "%hhd\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_178, sizeof("%hhd\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_178); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_178); __gen_e_acsl_literal_string_48 = "%hhd"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_48,sizeof("%hhd")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_48); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_48); __gen_e_acsl_literal_string_214 = "%hhX\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_214, sizeof("%hhX\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_214); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_214); __gen_e_acsl_literal_string_46 = "%hhX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_46,sizeof("%hhX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_46); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_46); __gen_e_acsl_literal_string_175 = "%hd\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_175, sizeof("%hd\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_175); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_175); __gen_e_acsl_literal_string_59 = "%hd"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_59,sizeof("%hd")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_59); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_59); __gen_e_acsl_literal_string_209 = "%hX\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_209, sizeof("%hX\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_209); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_209); __gen_e_acsl_literal_string_57 = "%hX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_57,sizeof("%hX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_57); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_57); __gen_e_acsl_literal_string_248 = "%g\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_248, sizeof("%g\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_248); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_248); __gen_e_acsl_literal_string_88 = "%g"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_88,sizeof("%g")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_88); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_88); __gen_e_acsl_literal_string_230 = "%f\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_230, sizeof("%f\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_230); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_230); __gen_e_acsl_literal_string_79 = "%f"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_79,sizeof("%f")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_79); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_79); __gen_e_acsl_literal_string_242 = "%e\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_242, sizeof("%e\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_242); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_242); __gen_e_acsl_literal_string_82 = "%e"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_82,sizeof("%e")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_82); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_82); __gen_e_acsl_literal_string_336 = "%d - %\'% - %u times \n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_336, sizeof("%d - %\'% - %u times \n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_336); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_336); __gen_e_acsl_literal_string_162 = "%d\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_162, sizeof("%d\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_162); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_162); __gen_e_acsl_literal_string_278 = "%c\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_278, sizeof("%c\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_278); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_278); __gen_e_acsl_literal_string_236 = "%a\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_236, sizeof("%a\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_236); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_236); __gen_e_acsl_literal_string_85 = "%a"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_85,sizeof("%a")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_85); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_85); __gen_e_acsl_literal_string_189 = "%X\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_189, sizeof("%X\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_189); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_189); __gen_e_acsl_literal_string_156 = "%S\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_156, sizeof("%S\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_156); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_156); __gen_e_acsl_literal_string_272 = "%Lg\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_272, sizeof("%Lg\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_272); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_272); __gen_e_acsl_literal_string_151 = "%Lg"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_151,sizeof("%Lg")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_151); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_151); __gen_e_acsl_literal_string_254 = "%Lf\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_254, sizeof("%Lf\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_254); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_254); __gen_e_acsl_literal_string_142 = "%Lf"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_142,sizeof("%Lf")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_142); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_142); __gen_e_acsl_literal_string_266 = "%Le\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_266, sizeof("%Le\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_266); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_266); __gen_e_acsl_literal_string_145 = "%Le"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_145,sizeof("%Le")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_145); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_145); __gen_e_acsl_literal_string_260 = "%La\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_260, sizeof("%La\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_260); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_260); __gen_e_acsl_literal_string_148 = "%La"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_148,sizeof("%La")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_148); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_148); __gen_e_acsl_literal_string_140 = "%LX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_140,sizeof("%LX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_140); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_140); __gen_e_acsl_literal_string_274 = "%LG\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_274, sizeof("%LG\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_274); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_274); __gen_e_acsl_literal_string_153 = "%LG"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_153,sizeof("%LG")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_153); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_153); __gen_e_acsl_literal_string_256 = "%LF\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_256, sizeof("%LF\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_256); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_256); __gen_e_acsl_literal_string_144 = "%LF"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_144,sizeof("%LF")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_144); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_144); __gen_e_acsl_literal_string_268 = "%LE\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_268, sizeof("%LE\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_268); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_268); __gen_e_acsl_literal_string_147 = "%LE"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_147,sizeof("%LE")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_147); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_147); __gen_e_acsl_literal_string_262 = "%LA\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_262, sizeof("%LA\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_262); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_262); __gen_e_acsl_literal_string_150 = "%LA"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_150,sizeof("%LA")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_150); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_150); __gen_e_acsl_literal_string_250 = "%G\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_250, sizeof("%G\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_250); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_250); __gen_e_acsl_literal_string_90 = "%G"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_90,sizeof("%G")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_90); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_90); __gen_e_acsl_literal_string_232 = "%F\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_232, sizeof("%F\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_232); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_232); __gen_e_acsl_literal_string_81 = "%F"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_81,sizeof("%F")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_81); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_81); __gen_e_acsl_literal_string_244 = "%E\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_244, sizeof("%E\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_244); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_244); __gen_e_acsl_literal_string_84 = "%E"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_84,sizeof("%E")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_84); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_84); __gen_e_acsl_literal_string_154 = "%C\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_154, sizeof("%C\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_154); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_154); __gen_e_acsl_literal_string_238 = "%A\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_238, sizeof("%A\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_238); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_238); __gen_e_acsl_literal_string_87 = "%A"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_87,sizeof("%A")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_87); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_87); __gen_e_acsl_literal_string_22 = "%4$s Say it %2$d or %1$u times \n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_22, sizeof("%4$s Say it %2$d or %1$u times \n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_22); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_22); __gen_e_acsl_literal_string_20 = "%3$s Say it %2$d or %1$u times \n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_20, sizeof("%3$s Say it %2$d or %1$u times \n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_20); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_20); __gen_e_acsl_literal_string_334 = "%10n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_334, sizeof("%10n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_334); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_334); __gen_e_acsl_literal_string_28 = "%1$d - %% - %2$u times \n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_28, sizeof("%1$d - %% - %2$u times \n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_28); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_28); __gen_e_acsl_literal_string_319 = "%0n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_319,sizeof("%0n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_319); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_319); __gen_e_acsl_literal_string_37 = "%0X"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_37,sizeof("%0X")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_37); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_37); __gen_e_acsl_literal_string_24 = "%0$s Say it %2$d or %1$u times \n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_24, sizeof("%0$s Say it %2$d or %1$u times \n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_24); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_24); __gen_e_acsl_literal_string_298 = "%.s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_298, sizeof("%.s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_298); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_298); __gen_e_acsl_literal_string_329 = "%.n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_329,sizeof("%.n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_329); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_329); __gen_e_acsl_literal_string_306 = "%.5s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_306, sizeof("%.5s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_306); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_306); __gen_e_acsl_literal_string_304 = "%.4s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_304, sizeof("%.4s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_304); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_304); __gen_e_acsl_literal_string_302 = "%.3s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_302, sizeof("%.3s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_302); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_302); __gen_e_acsl_literal_string_31 = "%.3X"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_31,sizeof("%.3X")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_31); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_31); __gen_e_acsl_literal_string_331 = "%.2n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_331, sizeof("%.2n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_331); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_331); __gen_e_acsl_literal_string_300 = "%.0s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_300, sizeof("%.0s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_300); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_300); __gen_e_acsl_literal_string_327 = "%-n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_327,sizeof("%-n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_327); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_327); __gen_e_acsl_literal_string_325 = "%+n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_325,sizeof("%+n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_325); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_325); __gen_e_acsl_literal_string_317 = "%\'n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_317, sizeof("%\'n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_317); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_317); __gen_e_acsl_literal_string_321 = "%#n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_321,sizeof("%#n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_321); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_321); __gen_e_acsl_literal_string_34 = "%#X"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_34,sizeof("%#X")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_34); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_34); __gen_e_acsl_literal_string_323 = "% n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_323,sizeof("% n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_323); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_323); __e_acsl_store_block((void *)(& __gen_e_acsl_strcpy),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_strcpy)); __e_acsl_store_block((void *)(& __gen_e_acsl_strchr),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_strchr)); __e_acsl_store_block((void *)(& __gen_e_acsl_strlen),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_strlen)); __e_acsl_store_block((void *)(& __gen_e_acsl_exit),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_exit)); __e_acsl_store_block((void *)(& __gen_e_acsl_abort),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_abort)); __e_acsl_store_block((void *)(& test_specifier_application),(size_t)1); __e_acsl_full_init((void *)(& test_specifier_application)); __e_acsl_store_block((void *)(& apply_specifier),(size_t)1); __e_acsl_full_init((void *)(& apply_specifier)); __e_acsl_store_block((void *)(& valid_specifiers),(size_t)8); __e_acsl_full_init((void *)(& valid_specifiers)); __e_acsl_store_block((void *)(& signal_eval),(size_t)1); __e_acsl_full_init((void *)(& signal_eval)); __e_acsl_store_block((void *)(& testno),(size_t)4); __e_acsl_full_init((void *)(& testno)); __e_acsl_store_block((void *)(& __fc_p_time_tm),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_time_tm)); __e_acsl_store_block((void *)(& __fc_time_tm),(size_t)36); __e_acsl_full_init((void *)(& __fc_time_tm)); __e_acsl_store_block((void *)(__fc_fds),(size_t)4096); __e_acsl_full_init((void *)(& __fc_fds)); __e_acsl_store_block((void *)(& __fc_fds_state),(size_t)4); __e_acsl_full_init((void *)(& __fc_fds_state)); __e_acsl_store_block((void *)(& __fc_time),(size_t)4); __e_acsl_full_init((void *)(& __fc_time)); __e_acsl_store_block((void *)(& __fc_p_strerror),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_strerror)); __e_acsl_store_block((void *)(strerror),(size_t)64); __e_acsl_full_init((void *)(& strerror)); __e_acsl_store_block((void *)(& __fc_strtok_ptr),(size_t)8); __e_acsl_full_init((void *)(& __fc_strtok_ptr)); __e_acsl_store_block((void *)(& __fc_p_fopen),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_fopen)); __e_acsl_store_block((void *)(__fc_fopen),(size_t)128); __e_acsl_full_init((void *)(& __fc_fopen)); __e_acsl_store_block((void *)(& __fc_rand_max),(size_t)8); __e_acsl_full_init((void *)(& __fc_rand_max)); return; } int main(int argc, char const **argv) { int __retres; char *s2; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& s2),(size_t)8); __e_acsl_store_block((void *)(& __retres),(size_t)4); char *pstr = (char *)__gen_e_acsl_literal_string_10; __e_acsl_store_block((void *)(& pstr),(size_t)8); __e_acsl_full_init((void *)(& pstr)); char astr[13] = {(char)'H', (char)'e', (char)'l', (char)'l', (char)'o', (char)' ', (char)'w', (char)'o', (char)'r', (char)'l', (char)'d', (char)'!', (char)'\000'}; __e_acsl_store_block((void *)(astr),(size_t)13); __e_acsl_full_init((void *)(& astr)); signed char *sastr = (signed char *)(astr); __e_acsl_store_block((void *)(& sastr),(size_t)8); __e_acsl_full_init((void *)(& sastr)); void *vptr = (void *)(& argc); __e_acsl_store_block((void *)(& vptr),(size_t)8); __e_acsl_full_init((void *)(& vptr)); char chr = (char)'T'; __e_acsl_store_block((void *)(& chr),(size_t)1); __e_acsl_full_init((void *)(& chr)); unsigned char uchr = (unsigned char)'U'; __e_acsl_store_block((void *)(& uchr),(size_t)1); __e_acsl_full_init((void *)(& uchr)); short shrt = (short)4569; __e_acsl_store_block((void *)(& shrt),(size_t)2); __e_acsl_full_init((void *)(& shrt)); unsigned short ushrt = (unsigned short)4567; __e_acsl_store_block((void *)(& ushrt),(size_t)2); __e_acsl_full_init((void *)(& ushrt)); int i = 268; __e_acsl_store_block((void *)(& i),(size_t)4); __e_acsl_full_init((void *)(& i)); unsigned int ui = (unsigned int)516; __e_acsl_store_block((void *)(& ui),(size_t)4); __e_acsl_full_init((void *)(& ui)); wint_t wi = (unsigned int)123; __e_acsl_store_block((void *)(& wi),(size_t)4); __e_acsl_full_init((void *)(& wi)); long li = (long)3134; __e_acsl_store_block((void *)(& li),(size_t)8); __e_acsl_full_init((void *)(& li)); unsigned long lu = (unsigned long)7845216; __e_acsl_store_block((void *)(& lu),(size_t)8); __e_acsl_full_init((void *)(& lu)); long long lli = 123LL; __e_acsl_store_block((void *)(& lli),(size_t)8); __e_acsl_full_init((void *)(& lli)); unsigned long long llu = (unsigned long long)123LL; __e_acsl_store_block((void *)(& llu),(size_t)8); __e_acsl_full_init((void *)(& llu)); float flt = (float)0.2; __e_acsl_store_block((void *)(& flt),(size_t)4); __e_acsl_full_init((void *)(& flt)); double dbl = 0.3; __e_acsl_store_block((void *)(& dbl),(size_t)8); __e_acsl_full_init((void *)(& dbl)); long double ldbl = (long double)0.3; __e_acsl_store_block((void *)(& ldbl),(size_t)16); __e_acsl_full_init((void *)(& ldbl)); intmax_t imax = (long long)10; __e_acsl_store_block((void *)(& imax),(size_t)8); __e_acsl_full_init((void *)(& imax)); uintmax_t uimax = (unsigned long long)10; __e_acsl_store_block((void *)(& uimax),(size_t)8); __e_acsl_full_init((void *)(& uimax)); size_t szt = (unsigned long)10; __e_acsl_store_block((void *)(& szt),(size_t)8); __e_acsl_full_init((void *)(& szt)); ptrdiff_t ptrdf = (long)147; __e_acsl_store_block((void *)(& ptrdf),(size_t)8); __e_acsl_full_init((void *)(& ptrdf)); { pid_t pid = fork(); __e_acsl_store_block((void *)(& pid),(size_t)4); __e_acsl_full_init((void *)(& pid)); if (! pid) { __e_acsl_builtin_printf("",__gen_e_acsl_literal_string_11); __gen_e_acsl_exit(0); } else { int process_status; __e_acsl_store_block((void *)(& process_status),(size_t)4); waitpid(pid,& process_status,0); /*@ assert Value: initialization: \initialized(&process_status); */ signal_eval(process_status,0,__gen_e_acsl_literal_string_12); __e_acsl_delete_block((void *)(& process_status)); } __e_acsl_delete_block((void *)(& pid)); } { pid_t pid_0 = fork(); __e_acsl_store_block((void *)(& pid_0),(size_t)4); __e_acsl_full_init((void *)(& pid_0)); if (! pid_0) { __e_acsl_builtin_printf("ssdD",__gen_e_acsl_literal_string_13,astr, pstr,i,ui); __gen_e_acsl_exit(0); } else { int process_status_0; __e_acsl_store_block((void *)(& process_status_0),(size_t)4); waitpid(pid_0,& process_status_0,0); /*@ assert Value: initialization: \initialized(&process_status_0); */ signal_eval(process_status_0,0,__gen_e_acsl_literal_string_14); __e_acsl_delete_block((void *)(& process_status_0)); } __e_acsl_delete_block((void *)(& pid_0)); } { pid_t pid_1 = fork(); __e_acsl_store_block((void *)(& pid_1),(size_t)4); __e_acsl_full_init((void *)(& pid_1)); if (! pid_1) { __e_acsl_builtin_printf("ssd",__gen_e_acsl_literal_string_15,astr,pstr, i); __gen_e_acsl_exit(0); } else { int process_status_1; __e_acsl_store_block((void *)(& process_status_1),(size_t)4); waitpid(pid_1,& process_status_1,0); /*@ assert Value: initialization: \initialized(&process_status_1); */ signal_eval(process_status_1,1,__gen_e_acsl_literal_string_16); __e_acsl_delete_block((void *)(& process_status_1)); } __e_acsl_delete_block((void *)(& pid_1)); } { pid_t pid_2 = fork(); __e_acsl_store_block((void *)(& pid_2),(size_t)4); __e_acsl_full_init((void *)(& pid_2)); if (! pid_2) { __e_acsl_builtin_printf("ssdDD",__gen_e_acsl_literal_string_17,astr, pstr,i,ui,ui); __gen_e_acsl_exit(0); } else { int process_status_2; __e_acsl_store_block((void *)(& process_status_2),(size_t)4); waitpid(pid_2,& process_status_2,0); /*@ assert Value: initialization: \initialized(&process_status_2); */ signal_eval(process_status_2,0,__gen_e_acsl_literal_string_18); __e_acsl_delete_block((void *)(& process_status_2)); } __e_acsl_delete_block((void *)(& pid_2)); } char fmt[7] = {(char)'f', (char)'m', (char)'t', (char)':', (char)'%', (char)'s', (char)'\000'}; __e_acsl_store_block((void *)(fmt),(size_t)7); __e_acsl_full_init((void *)(& fmt)); __e_acsl_initialize((void *)(& fmt[6]),sizeof(char)); fmt[6] = (char)'a'; { pid_t pid_3 = fork(); __e_acsl_store_block((void *)(& pid_3),(size_t)4); __e_acsl_full_init((void *)(& pid_3)); if (! pid_3) { __e_acsl_builtin_printf("s",(char const *)(fmt),pstr); __gen_e_acsl_exit(0); } else { int process_status_3; __e_acsl_store_block((void *)(& process_status_3),(size_t)4); waitpid(pid_3,& process_status_3,0); /*@ assert Value: initialization: \initialized(&process_status_3); */ signal_eval(process_status_3,1,__gen_e_acsl_literal_string_19); __e_acsl_delete_block((void *)(& process_status_3)); } __e_acsl_delete_block((void *)(& pid_3)); } { pid_t pid_4 = fork(); __e_acsl_store_block((void *)(& pid_4),(size_t)4); __e_acsl_full_init((void *)(& pid_4)); if (! pid_4) { __e_acsl_builtin_printf("Dds",__gen_e_acsl_literal_string_20,ui,i,astr); __gen_e_acsl_exit(0); } else { int process_status_4; __e_acsl_store_block((void *)(& process_status_4),(size_t)4); waitpid(pid_4,& process_status_4,0); /*@ assert Value: initialization: \initialized(&process_status_4); */ signal_eval(process_status_4,0,__gen_e_acsl_literal_string_21); __e_acsl_delete_block((void *)(& process_status_4)); } __e_acsl_delete_block((void *)(& pid_4)); } { pid_t pid_5 = fork(); __e_acsl_store_block((void *)(& pid_5),(size_t)4); __e_acsl_full_init((void *)(& pid_5)); if (! pid_5) { __e_acsl_builtin_printf("Dds",__gen_e_acsl_literal_string_22,ui,i,astr); __gen_e_acsl_exit(0); } else { int process_status_5; __e_acsl_store_block((void *)(& process_status_5),(size_t)4); waitpid(pid_5,& process_status_5,0); /*@ assert Value: initialization: \initialized(&process_status_5); */ signal_eval(process_status_5,1,__gen_e_acsl_literal_string_23); __e_acsl_delete_block((void *)(& process_status_5)); } __e_acsl_delete_block((void *)(& pid_5)); } { pid_t pid_6 = fork(); __e_acsl_store_block((void *)(& pid_6),(size_t)4); __e_acsl_full_init((void *)(& pid_6)); if (! pid_6) { __e_acsl_builtin_printf("Dds",__gen_e_acsl_literal_string_24,ui,i,astr); __gen_e_acsl_exit(0); } else { int process_status_6; __e_acsl_store_block((void *)(& process_status_6),(size_t)4); waitpid(pid_6,& process_status_6,0); /*@ assert Value: initialization: \initialized(&process_status_6); */ signal_eval(process_status_6,1,__gen_e_acsl_literal_string_25); __e_acsl_delete_block((void *)(& process_status_6)); } __e_acsl_delete_block((void *)(& pid_6)); } { pid_t pid_7 = fork(); __e_acsl_store_block((void *)(& pid_7),(size_t)4); __e_acsl_full_init((void *)(& pid_7)); if (! pid_7) { __e_acsl_builtin_printf("sdD",__gen_e_acsl_literal_string_26,astr,i,ui); __gen_e_acsl_exit(0); } else { int process_status_7; __e_acsl_store_block((void *)(& process_status_7),(size_t)4); waitpid(pid_7,& process_status_7,0); /*@ assert Value: initialization: \initialized(&process_status_7); */ signal_eval(process_status_7,1,__gen_e_acsl_literal_string_27); __e_acsl_delete_block((void *)(& process_status_7)); } __e_acsl_delete_block((void *)(& pid_7)); } { pid_t pid_8 = fork(); __e_acsl_store_block((void *)(& pid_8),(size_t)4); __e_acsl_full_init((void *)(& pid_8)); if (! pid_8) { __e_acsl_builtin_printf("dD",__gen_e_acsl_literal_string_28,i,ui); __gen_e_acsl_exit(0); } else { int process_status_8; __e_acsl_store_block((void *)(& process_status_8),(size_t)4); waitpid(pid_8,& process_status_8,0); /*@ assert Value: initialization: \initialized(&process_status_8); */ signal_eval(process_status_8,0,__gen_e_acsl_literal_string_29); __e_acsl_delete_block((void *)(& process_status_8)); } __e_acsl_delete_block((void *)(& pid_8)); } test_specifier_application(__gen_e_acsl_literal_string_30, __gen_e_acsl_literal_string_31,0, (char *)__gen_e_acsl_literal_string_32); test_specifier_application(__gen_e_acsl_literal_string_33, __gen_e_acsl_literal_string_34,0, (char *)__gen_e_acsl_literal_string_35); test_specifier_application(__gen_e_acsl_literal_string_36, __gen_e_acsl_literal_string_37,0, (char *)__gen_e_acsl_literal_string_38); { pid_t pid_9 = fork(); __e_acsl_store_block((void *)(& pid_9),(size_t)4); __e_acsl_full_init((void *)(& pid_9)); if (! pid_9) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_39,1L); __gen_e_acsl_exit(0); } else { int process_status_9; __e_acsl_store_block((void *)(& process_status_9),(size_t)4); waitpid(pid_9,& process_status_9,0); signal_eval(process_status_9,0,__gen_e_acsl_literal_string_40); __e_acsl_delete_block((void *)(& process_status_9)); } __e_acsl_delete_block((void *)(& pid_9)); } { pid_t pid_10 = fork(); __e_acsl_store_block((void *)(& pid_10),(size_t)4); __e_acsl_full_init((void *)(& pid_10)); if (! pid_10) { __e_acsl_builtin_printf("r",__gen_e_acsl_literal_string_41,1LL); __gen_e_acsl_exit(0); } else { int process_status_10; __e_acsl_store_block((void *)(& process_status_10),(size_t)4); waitpid(pid_10,& process_status_10,0); signal_eval(process_status_10,0,__gen_e_acsl_literal_string_42); __e_acsl_delete_block((void *)(& process_status_10)); } __e_acsl_delete_block((void *)(& pid_10)); } { pid_t pid_11 = fork(); __e_acsl_store_block((void *)(& pid_11),(size_t)4); __e_acsl_full_init((void *)(& pid_11)); if (! pid_11) { __e_acsl_builtin_printf("r",__gen_e_acsl_literal_string_43,1LL); __gen_e_acsl_exit(0); } else { int process_status_11; __e_acsl_store_block((void *)(& process_status_11),(size_t)4); waitpid(pid_11,& process_status_11,0); signal_eval(process_status_11,1,__gen_e_acsl_literal_string_44); __e_acsl_delete_block((void *)(& process_status_11)); } __e_acsl_delete_block((void *)(& pid_11)); } test_specifier_application(__gen_e_acsl_literal_string_45, __gen_e_acsl_literal_string_46,1, (char *)__gen_e_acsl_literal_string_47); { pid_t pid_12 = fork(); __e_acsl_store_block((void *)(& pid_12),(size_t)4); __e_acsl_full_init((void *)(& pid_12)); if (! pid_12) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_48,1); __gen_e_acsl_exit(0); } else { int process_status_12; __e_acsl_store_block((void *)(& process_status_12),(size_t)4); waitpid(pid_12,& process_status_12,0); signal_eval(process_status_12,0,__gen_e_acsl_literal_string_49); __e_acsl_delete_block((void *)(& process_status_12)); } __e_acsl_delete_block((void *)(& pid_12)); } { pid_t pid_13 = fork(); __e_acsl_store_block((void *)(& pid_13),(size_t)4); __e_acsl_full_init((void *)(& pid_13)); if (! pid_13) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_50,1); __gen_e_acsl_exit(0); } else { int process_status_13; __e_acsl_store_block((void *)(& process_status_13),(size_t)4); waitpid(pid_13,& process_status_13,0); signal_eval(process_status_13,0,__gen_e_acsl_literal_string_49); __e_acsl_delete_block((void *)(& process_status_13)); } __e_acsl_delete_block((void *)(& pid_13)); } { pid_t pid_14 = fork(); __e_acsl_store_block((void *)(& pid_14),(size_t)4); __e_acsl_full_init((void *)(& pid_14)); if (! pid_14) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_51,1); __gen_e_acsl_exit(0); } else { int process_status_14; __e_acsl_store_block((void *)(& process_status_14),(size_t)4); waitpid(pid_14,& process_status_14,0); signal_eval(process_status_14,0,__gen_e_acsl_literal_string_52); __e_acsl_delete_block((void *)(& process_status_14)); } __e_acsl_delete_block((void *)(& pid_14)); } { pid_t pid_15 = fork(); __e_acsl_store_block((void *)(& pid_15),(size_t)4); __e_acsl_full_init((void *)(& pid_15)); if (! pid_15) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_53,1); __gen_e_acsl_exit(0); } else { int process_status_15; __e_acsl_store_block((void *)(& process_status_15),(size_t)4); waitpid(pid_15,& process_status_15,0); signal_eval(process_status_15,0,__gen_e_acsl_literal_string_52); __e_acsl_delete_block((void *)(& process_status_15)); } __e_acsl_delete_block((void *)(& pid_15)); } { pid_t pid_16 = fork(); __e_acsl_store_block((void *)(& pid_16),(size_t)4); __e_acsl_full_init((void *)(& pid_16)); if (! pid_16) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_54,1); __gen_e_acsl_exit(0); } else { int process_status_16; __e_acsl_store_block((void *)(& process_status_16),(size_t)4); waitpid(pid_16,& process_status_16,0); signal_eval(process_status_16,0,__gen_e_acsl_literal_string_55); __e_acsl_delete_block((void *)(& process_status_16)); } __e_acsl_delete_block((void *)(& pid_16)); } { pid_t pid_17 = fork(); __e_acsl_store_block((void *)(& pid_17),(size_t)4); __e_acsl_full_init((void *)(& pid_17)); if (! pid_17) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_46,1); __gen_e_acsl_exit(0); } else { int process_status_17; __e_acsl_store_block((void *)(& process_status_17),(size_t)4); waitpid(pid_17,& process_status_17,0); signal_eval(process_status_17,0,__gen_e_acsl_literal_string_55); __e_acsl_delete_block((void *)(& process_status_17)); } __e_acsl_delete_block((void *)(& pid_17)); } { pid_t pid_18 = fork(); __e_acsl_store_block((void *)(& pid_18),(size_t)4); __e_acsl_full_init((void *)(& pid_18)); if (! pid_18) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_56,& chr); __gen_e_acsl_exit(0); } else { int process_status_18; __e_acsl_store_block((void *)(& process_status_18),(size_t)4); waitpid(pid_18,& process_status_18,0); signal_eval(process_status_18,0,__gen_e_acsl_literal_string_55); __e_acsl_delete_block((void *)(& process_status_18)); } __e_acsl_delete_block((void *)(& pid_18)); } test_specifier_application(__gen_e_acsl_literal_string_45, __gen_e_acsl_literal_string_57,1, (char *)__gen_e_acsl_literal_string_58); { pid_t pid_19 = fork(); __e_acsl_store_block((void *)(& pid_19),(size_t)4); __e_acsl_full_init((void *)(& pid_19)); if (! pid_19) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_59,1); __gen_e_acsl_exit(0); } else { int process_status_19; __e_acsl_store_block((void *)(& process_status_19),(size_t)4); waitpid(pid_19,& process_status_19,0); signal_eval(process_status_19,0,__gen_e_acsl_literal_string_60); __e_acsl_delete_block((void *)(& process_status_19)); } __e_acsl_delete_block((void *)(& pid_19)); } { pid_t pid_20 = fork(); __e_acsl_store_block((void *)(& pid_20),(size_t)4); __e_acsl_full_init((void *)(& pid_20)); if (! pid_20) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_61,1); __gen_e_acsl_exit(0); } else { int process_status_20; __e_acsl_store_block((void *)(& process_status_20),(size_t)4); waitpid(pid_20,& process_status_20,0); signal_eval(process_status_20,0,__gen_e_acsl_literal_string_60); __e_acsl_delete_block((void *)(& process_status_20)); } __e_acsl_delete_block((void *)(& pid_20)); } { pid_t pid_21 = fork(); __e_acsl_store_block((void *)(& pid_21),(size_t)4); __e_acsl_full_init((void *)(& pid_21)); if (! pid_21) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_62,1); __gen_e_acsl_exit(0); } else { int process_status_21; __e_acsl_store_block((void *)(& process_status_21),(size_t)4); waitpid(pid_21,& process_status_21,0); signal_eval(process_status_21,0,__gen_e_acsl_literal_string_63); __e_acsl_delete_block((void *)(& process_status_21)); } __e_acsl_delete_block((void *)(& pid_21)); } { pid_t pid_22 = fork(); __e_acsl_store_block((void *)(& pid_22),(size_t)4); __e_acsl_full_init((void *)(& pid_22)); if (! pid_22) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_64,1); __gen_e_acsl_exit(0); } else { int process_status_22; __e_acsl_store_block((void *)(& process_status_22),(size_t)4); waitpid(pid_22,& process_status_22,0); signal_eval(process_status_22,0,__gen_e_acsl_literal_string_63); __e_acsl_delete_block((void *)(& process_status_22)); } __e_acsl_delete_block((void *)(& pid_22)); } { pid_t pid_23 = fork(); __e_acsl_store_block((void *)(& pid_23),(size_t)4); __e_acsl_full_init((void *)(& pid_23)); if (! pid_23) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_65,1); __gen_e_acsl_exit(0); } else { int process_status_23; __e_acsl_store_block((void *)(& process_status_23),(size_t)4); waitpid(pid_23,& process_status_23,0); signal_eval(process_status_23,0,__gen_e_acsl_literal_string_66); __e_acsl_delete_block((void *)(& process_status_23)); } __e_acsl_delete_block((void *)(& pid_23)); } { pid_t pid_24 = fork(); __e_acsl_store_block((void *)(& pid_24),(size_t)4); __e_acsl_full_init((void *)(& pid_24)); if (! pid_24) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_57,1); __gen_e_acsl_exit(0); } else { int process_status_24; __e_acsl_store_block((void *)(& process_status_24),(size_t)4); waitpid(pid_24,& process_status_24,0); signal_eval(process_status_24,0,__gen_e_acsl_literal_string_66); __e_acsl_delete_block((void *)(& process_status_24)); } __e_acsl_delete_block((void *)(& pid_24)); } { pid_t pid_25 = fork(); __e_acsl_store_block((void *)(& pid_25),(size_t)4); __e_acsl_full_init((void *)(& pid_25)); if (! pid_25) { __e_acsl_builtin_printf("q",__gen_e_acsl_literal_string_67,& shrt); __gen_e_acsl_exit(0); } else { int process_status_25; __e_acsl_store_block((void *)(& process_status_25),(size_t)4); waitpid(pid_25,& process_status_25,0); signal_eval(process_status_25,0,__gen_e_acsl_literal_string_66); __e_acsl_delete_block((void *)(& process_status_25)); } __e_acsl_delete_block((void *)(& pid_25)); } test_specifier_application(__gen_e_acsl_literal_string_68, __gen_e_acsl_literal_string_69,1, (char *)__gen_e_acsl_literal_string_70); { pid_t pid_26 = fork(); __e_acsl_store_block((void *)(& pid_26),(size_t)4); __e_acsl_full_init((void *)(& pid_26)); if (! pid_26) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_71,1L); __gen_e_acsl_exit(0); } else { int process_status_26; __e_acsl_store_block((void *)(& process_status_26),(size_t)4); waitpid(pid_26,& process_status_26,0); signal_eval(process_status_26,0,__gen_e_acsl_literal_string_72); __e_acsl_delete_block((void *)(& process_status_26)); } __e_acsl_delete_block((void *)(& pid_26)); } { pid_t pid_27 = fork(); __e_acsl_store_block((void *)(& pid_27),(size_t)4); __e_acsl_full_init((void *)(& pid_27)); if (! pid_27) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_73,1L); __gen_e_acsl_exit(0); } else { int process_status_27; __e_acsl_store_block((void *)(& process_status_27),(size_t)4); waitpid(pid_27,& process_status_27,0); signal_eval(process_status_27,0,__gen_e_acsl_literal_string_72); __e_acsl_delete_block((void *)(& process_status_27)); } __e_acsl_delete_block((void *)(& pid_27)); } { pid_t pid_28 = fork(); __e_acsl_store_block((void *)(& pid_28),(size_t)4); __e_acsl_full_init((void *)(& pid_28)); if (! pid_28) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_74,1UL); __gen_e_acsl_exit(0); } else { int process_status_28; __e_acsl_store_block((void *)(& process_status_28),(size_t)4); waitpid(pid_28,& process_status_28,0); signal_eval(process_status_28,0,__gen_e_acsl_literal_string_75); __e_acsl_delete_block((void *)(& process_status_28)); } __e_acsl_delete_block((void *)(& pid_28)); } { pid_t pid_29 = fork(); __e_acsl_store_block((void *)(& pid_29),(size_t)4); __e_acsl_full_init((void *)(& pid_29)); if (! pid_29) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_76,1UL); __gen_e_acsl_exit(0); } else { int process_status_29; __e_acsl_store_block((void *)(& process_status_29),(size_t)4); waitpid(pid_29,& process_status_29,0); signal_eval(process_status_29,0,__gen_e_acsl_literal_string_75); __e_acsl_delete_block((void *)(& process_status_29)); } __e_acsl_delete_block((void *)(& pid_29)); } { pid_t pid_30 = fork(); __e_acsl_store_block((void *)(& pid_30),(size_t)4); __e_acsl_full_init((void *)(& pid_30)); if (! pid_30) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_77,1UL); __gen_e_acsl_exit(0); } else { int process_status_30; __e_acsl_store_block((void *)(& process_status_30),(size_t)4); waitpid(pid_30,& process_status_30,0); signal_eval(process_status_30,0,__gen_e_acsl_literal_string_78); __e_acsl_delete_block((void *)(& process_status_30)); } __e_acsl_delete_block((void *)(& pid_30)); } { pid_t pid_31 = fork(); __e_acsl_store_block((void *)(& pid_31),(size_t)4); __e_acsl_full_init((void *)(& pid_31)); if (! pid_31) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_69,1UL); __gen_e_acsl_exit(0); } else { int process_status_31; __e_acsl_store_block((void *)(& process_status_31),(size_t)4); waitpid(pid_31,& process_status_31,0); signal_eval(process_status_31,0,__gen_e_acsl_literal_string_78); __e_acsl_delete_block((void *)(& process_status_31)); } __e_acsl_delete_block((void *)(& pid_31)); } { pid_t pid_32 = fork(); __e_acsl_store_block((void *)(& pid_32),(size_t)4); __e_acsl_full_init((void *)(& pid_32)); if (! pid_32) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_79,dbl); __gen_e_acsl_exit(0); } else { int process_status_32; __e_acsl_store_block((void *)(& process_status_32),(size_t)4); waitpid(pid_32,& process_status_32,0); signal_eval(process_status_32,0,__gen_e_acsl_literal_string_80); __e_acsl_delete_block((void *)(& process_status_32)); } __e_acsl_delete_block((void *)(& pid_32)); } { pid_t pid_33 = fork(); __e_acsl_store_block((void *)(& pid_33),(size_t)4); __e_acsl_full_init((void *)(& pid_33)); if (! pid_33) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_81,dbl); __gen_e_acsl_exit(0); } else { int process_status_33; __e_acsl_store_block((void *)(& process_status_33),(size_t)4); waitpid(pid_33,& process_status_33,0); signal_eval(process_status_33,0,__gen_e_acsl_literal_string_80); __e_acsl_delete_block((void *)(& process_status_33)); } __e_acsl_delete_block((void *)(& pid_33)); } { pid_t pid_34 = fork(); __e_acsl_store_block((void *)(& pid_34),(size_t)4); __e_acsl_full_init((void *)(& pid_34)); if (! pid_34) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_82,dbl); __gen_e_acsl_exit(0); } else { int process_status_34; __e_acsl_store_block((void *)(& process_status_34),(size_t)4); waitpid(pid_34,& process_status_34,0); signal_eval(process_status_34,0,__gen_e_acsl_literal_string_83); __e_acsl_delete_block((void *)(& process_status_34)); } __e_acsl_delete_block((void *)(& pid_34)); } { pid_t pid_35 = fork(); __e_acsl_store_block((void *)(& pid_35),(size_t)4); __e_acsl_full_init((void *)(& pid_35)); if (! pid_35) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_84,dbl); __gen_e_acsl_exit(0); } else { int process_status_35; __e_acsl_store_block((void *)(& process_status_35),(size_t)4); waitpid(pid_35,& process_status_35,0); signal_eval(process_status_35,0,__gen_e_acsl_literal_string_83); __e_acsl_delete_block((void *)(& process_status_35)); } __e_acsl_delete_block((void *)(& pid_35)); } { pid_t pid_36 = fork(); __e_acsl_store_block((void *)(& pid_36),(size_t)4); __e_acsl_full_init((void *)(& pid_36)); if (! pid_36) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_85,dbl); __gen_e_acsl_exit(0); } else { int process_status_36; __e_acsl_store_block((void *)(& process_status_36),(size_t)4); waitpid(pid_36,& process_status_36,0); signal_eval(process_status_36,0,__gen_e_acsl_literal_string_86); __e_acsl_delete_block((void *)(& process_status_36)); } __e_acsl_delete_block((void *)(& pid_36)); } { pid_t pid_37 = fork(); __e_acsl_store_block((void *)(& pid_37),(size_t)4); __e_acsl_full_init((void *)(& pid_37)); if (! pid_37) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_87,dbl); __gen_e_acsl_exit(0); } else { int process_status_37; __e_acsl_store_block((void *)(& process_status_37),(size_t)4); waitpid(pid_37,& process_status_37,0); signal_eval(process_status_37,0,__gen_e_acsl_literal_string_86); __e_acsl_delete_block((void *)(& process_status_37)); } __e_acsl_delete_block((void *)(& pid_37)); } { pid_t pid_38 = fork(); __e_acsl_store_block((void *)(& pid_38),(size_t)4); __e_acsl_full_init((void *)(& pid_38)); if (! pid_38) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_88,dbl); __gen_e_acsl_exit(0); } else { int process_status_38; __e_acsl_store_block((void *)(& process_status_38),(size_t)4); waitpid(pid_38,& process_status_38,0); signal_eval(process_status_38,0,__gen_e_acsl_literal_string_89); __e_acsl_delete_block((void *)(& process_status_38)); } __e_acsl_delete_block((void *)(& pid_38)); } { pid_t pid_39 = fork(); __e_acsl_store_block((void *)(& pid_39),(size_t)4); __e_acsl_full_init((void *)(& pid_39)); if (! pid_39) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_90,dbl); __gen_e_acsl_exit(0); } else { int process_status_39; __e_acsl_store_block((void *)(& process_status_39),(size_t)4); waitpid(pid_39,& process_status_39,0); signal_eval(process_status_39,0,__gen_e_acsl_literal_string_89); __e_acsl_delete_block((void *)(& process_status_39)); } __e_acsl_delete_block((void *)(& pid_39)); } { pid_t pid_40 = fork(); __e_acsl_store_block((void *)(& pid_40),(size_t)4); __e_acsl_full_init((void *)(& pid_40)); if (! pid_40) { __e_acsl_builtin_printf("z",__gen_e_acsl_literal_string_91,& li); __gen_e_acsl_exit(0); } else { int process_status_40; __e_acsl_store_block((void *)(& process_status_40),(size_t)4); waitpid(pid_40,& process_status_40,0); signal_eval(process_status_40,0,__gen_e_acsl_literal_string_92); __e_acsl_delete_block((void *)(& process_status_40)); } __e_acsl_delete_block((void *)(& pid_40)); } { pid_t pid_41 = fork(); __e_acsl_store_block((void *)(& pid_41),(size_t)4); __e_acsl_full_init((void *)(& pid_41)); if (! pid_41) { __e_acsl_builtin_printf("D",__gen_e_acsl_literal_string_93,wi); __gen_e_acsl_exit(0); } else { int process_status_41; __e_acsl_store_block((void *)(& process_status_41),(size_t)4); waitpid(pid_41,& process_status_41,0); signal_eval(process_status_41,0,__gen_e_acsl_literal_string_94); __e_acsl_delete_block((void *)(& process_status_41)); } __e_acsl_delete_block((void *)(& pid_41)); } { pid_t pid_42 = fork(); __e_acsl_store_block((void *)(& pid_42),(size_t)4); __e_acsl_full_init((void *)(& pid_42)); if (! pid_42) { __e_acsl_builtin_printf("r",__gen_e_acsl_literal_string_95,1LL); __gen_e_acsl_exit(0); } else { int process_status_42; __e_acsl_store_block((void *)(& process_status_42),(size_t)4); waitpid(pid_42,& process_status_42,0); signal_eval(process_status_42,0,__gen_e_acsl_literal_string_96); __e_acsl_delete_block((void *)(& process_status_42)); } __e_acsl_delete_block((void *)(& pid_42)); } { pid_t pid_43 = fork(); __e_acsl_store_block((void *)(& pid_43),(size_t)4); __e_acsl_full_init((void *)(& pid_43)); if (! pid_43) { __e_acsl_builtin_printf("r",__gen_e_acsl_literal_string_97,1LL); __gen_e_acsl_exit(0); } else { int process_status_43; __e_acsl_store_block((void *)(& process_status_43),(size_t)4); waitpid(pid_43,& process_status_43,0); signal_eval(process_status_43,0,__gen_e_acsl_literal_string_96); __e_acsl_delete_block((void *)(& process_status_43)); } __e_acsl_delete_block((void *)(& pid_43)); } { pid_t pid_44 = fork(); __e_acsl_store_block((void *)(& pid_44),(size_t)4); __e_acsl_full_init((void *)(& pid_44)); if (! pid_44) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_98,1ULL); __gen_e_acsl_exit(0); } else { int process_status_44; __e_acsl_store_block((void *)(& process_status_44),(size_t)4); waitpid(pid_44,& process_status_44,0); signal_eval(process_status_44,0,__gen_e_acsl_literal_string_99); __e_acsl_delete_block((void *)(& process_status_44)); } __e_acsl_delete_block((void *)(& pid_44)); } { pid_t pid_45 = fork(); __e_acsl_store_block((void *)(& pid_45),(size_t)4); __e_acsl_full_init((void *)(& pid_45)); if (! pid_45) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_100,1ULL); __gen_e_acsl_exit(0); } else { int process_status_45; __e_acsl_store_block((void *)(& process_status_45),(size_t)4); waitpid(pid_45,& process_status_45,0); signal_eval(process_status_45,0,__gen_e_acsl_literal_string_99); __e_acsl_delete_block((void *)(& process_status_45)); } __e_acsl_delete_block((void *)(& pid_45)); } { pid_t pid_46 = fork(); __e_acsl_store_block((void *)(& pid_46),(size_t)4); __e_acsl_full_init((void *)(& pid_46)); if (! pid_46) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_101,1ULL); __gen_e_acsl_exit(0); } else { int process_status_46; __e_acsl_store_block((void *)(& process_status_46),(size_t)4); waitpid(pid_46,& process_status_46,0); signal_eval(process_status_46,0,__gen_e_acsl_literal_string_102); __e_acsl_delete_block((void *)(& process_status_46)); } __e_acsl_delete_block((void *)(& pid_46)); } { pid_t pid_47 = fork(); __e_acsl_store_block((void *)(& pid_47),(size_t)4); __e_acsl_full_init((void *)(& pid_47)); if (! pid_47) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_103,1ULL); __gen_e_acsl_exit(0); } else { int process_status_47; __e_acsl_store_block((void *)(& process_status_47),(size_t)4); waitpid(pid_47,& process_status_47,0); signal_eval(process_status_47,0,__gen_e_acsl_literal_string_102); __e_acsl_delete_block((void *)(& process_status_47)); } __e_acsl_delete_block((void *)(& pid_47)); } { pid_t pid_48 = fork(); __e_acsl_store_block((void *)(& pid_48),(size_t)4); __e_acsl_full_init((void *)(& pid_48)); if (! pid_48) { __e_acsl_builtin_printf("w",__gen_e_acsl_literal_string_104,& lli); __gen_e_acsl_exit(0); } else { int process_status_48; __e_acsl_store_block((void *)(& process_status_48),(size_t)4); waitpid(pid_48,& process_status_48,0); signal_eval(process_status_48,0,__gen_e_acsl_literal_string_102); __e_acsl_delete_block((void *)(& process_status_48)); } __e_acsl_delete_block((void *)(& pid_48)); } test_specifier_application(__gen_e_acsl_literal_string_45, __gen_e_acsl_literal_string_105,1, (char *)__gen_e_acsl_literal_string_106); { pid_t pid_49 = fork(); __e_acsl_store_block((void *)(& pid_49),(size_t)4); __e_acsl_full_init((void *)(& pid_49)); if (! pid_49) { __e_acsl_builtin_printf("r",__gen_e_acsl_literal_string_107,imax); __gen_e_acsl_exit(0); } else { int process_status_49; __e_acsl_store_block((void *)(& process_status_49),(size_t)4); waitpid(pid_49,& process_status_49,0); signal_eval(process_status_49,0,__gen_e_acsl_literal_string_108); __e_acsl_delete_block((void *)(& process_status_49)); } __e_acsl_delete_block((void *)(& pid_49)); } { pid_t pid_50 = fork(); __e_acsl_store_block((void *)(& pid_50),(size_t)4); __e_acsl_full_init((void *)(& pid_50)); if (! pid_50) { __e_acsl_builtin_printf("r",__gen_e_acsl_literal_string_109,imax); __gen_e_acsl_exit(0); } else { int process_status_50; __e_acsl_store_block((void *)(& process_status_50),(size_t)4); waitpid(pid_50,& process_status_50,0); signal_eval(process_status_50,0,__gen_e_acsl_literal_string_108); __e_acsl_delete_block((void *)(& process_status_50)); } __e_acsl_delete_block((void *)(& pid_50)); } { pid_t pid_51 = fork(); __e_acsl_store_block((void *)(& pid_51),(size_t)4); __e_acsl_full_init((void *)(& pid_51)); if (! pid_51) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_110,uimax); __gen_e_acsl_exit(0); } else { int process_status_51; __e_acsl_store_block((void *)(& process_status_51),(size_t)4); waitpid(pid_51,& process_status_51,0); signal_eval(process_status_51,0,__gen_e_acsl_literal_string_111); __e_acsl_delete_block((void *)(& process_status_51)); } __e_acsl_delete_block((void *)(& pid_51)); } { pid_t pid_52 = fork(); __e_acsl_store_block((void *)(& pid_52),(size_t)4); __e_acsl_full_init((void *)(& pid_52)); if (! pid_52) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_112,uimax); __gen_e_acsl_exit(0); } else { int process_status_52; __e_acsl_store_block((void *)(& process_status_52),(size_t)4); waitpid(pid_52,& process_status_52,0); signal_eval(process_status_52,0,__gen_e_acsl_literal_string_111); __e_acsl_delete_block((void *)(& process_status_52)); } __e_acsl_delete_block((void *)(& pid_52)); } { pid_t pid_53 = fork(); __e_acsl_store_block((void *)(& pid_53),(size_t)4); __e_acsl_full_init((void *)(& pid_53)); if (! pid_53) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_113,uimax); __gen_e_acsl_exit(0); } else { int process_status_53; __e_acsl_store_block((void *)(& process_status_53),(size_t)4); waitpid(pid_53,& process_status_53,0); signal_eval(process_status_53,0,__gen_e_acsl_literal_string_114); __e_acsl_delete_block((void *)(& process_status_53)); } __e_acsl_delete_block((void *)(& pid_53)); } { pid_t pid_54 = fork(); __e_acsl_store_block((void *)(& pid_54),(size_t)4); __e_acsl_full_init((void *)(& pid_54)); if (! pid_54) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_105,uimax); __gen_e_acsl_exit(0); } else { int process_status_54; __e_acsl_store_block((void *)(& process_status_54),(size_t)4); waitpid(pid_54,& process_status_54,0); signal_eval(process_status_54,0,__gen_e_acsl_literal_string_114); __e_acsl_delete_block((void *)(& process_status_54)); } __e_acsl_delete_block((void *)(& pid_54)); } { pid_t pid_55 = fork(); __e_acsl_store_block((void *)(& pid_55),(size_t)4); __e_acsl_full_init((void *)(& pid_55)); if (! pid_55) { __e_acsl_builtin_printf("w",__gen_e_acsl_literal_string_115,& imax); __gen_e_acsl_exit(0); } else { int process_status_55; __e_acsl_store_block((void *)(& process_status_55),(size_t)4); waitpid(pid_55,& process_status_55,0); signal_eval(process_status_55,0,__gen_e_acsl_literal_string_114); __e_acsl_delete_block((void *)(& process_status_55)); } __e_acsl_delete_block((void *)(& pid_55)); } test_specifier_application(__gen_e_acsl_literal_string_45, __gen_e_acsl_literal_string_116,1, (char *)__gen_e_acsl_literal_string_117); { pid_t pid_56 = fork(); __e_acsl_store_block((void *)(& pid_56),(size_t)4); __e_acsl_full_init((void *)(& pid_56)); if (! pid_56) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_118,li); __gen_e_acsl_exit(0); } else { int process_status_56; __e_acsl_store_block((void *)(& process_status_56),(size_t)4); waitpid(pid_56,& process_status_56,0); signal_eval(process_status_56,0,__gen_e_acsl_literal_string_119); __e_acsl_delete_block((void *)(& process_status_56)); } __e_acsl_delete_block((void *)(& pid_56)); } { pid_t pid_57 = fork(); __e_acsl_store_block((void *)(& pid_57),(size_t)4); __e_acsl_full_init((void *)(& pid_57)); if (! pid_57) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_120,li); __gen_e_acsl_exit(0); } else { int process_status_57; __e_acsl_store_block((void *)(& process_status_57),(size_t)4); waitpid(pid_57,& process_status_57,0); signal_eval(process_status_57,0,__gen_e_acsl_literal_string_119); __e_acsl_delete_block((void *)(& process_status_57)); } __e_acsl_delete_block((void *)(& pid_57)); } { pid_t pid_58 = fork(); __e_acsl_store_block((void *)(& pid_58),(size_t)4); __e_acsl_full_init((void *)(& pid_58)); if (! pid_58) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_121,szt); __gen_e_acsl_exit(0); } else { int process_status_58; __e_acsl_store_block((void *)(& process_status_58),(size_t)4); waitpid(pid_58,& process_status_58,0); signal_eval(process_status_58,0,__gen_e_acsl_literal_string_122); __e_acsl_delete_block((void *)(& process_status_58)); } __e_acsl_delete_block((void *)(& pid_58)); } { pid_t pid_59 = fork(); __e_acsl_store_block((void *)(& pid_59),(size_t)4); __e_acsl_full_init((void *)(& pid_59)); if (! pid_59) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_123,szt); __gen_e_acsl_exit(0); } else { int process_status_59; __e_acsl_store_block((void *)(& process_status_59),(size_t)4); waitpid(pid_59,& process_status_59,0); signal_eval(process_status_59,0,__gen_e_acsl_literal_string_122); __e_acsl_delete_block((void *)(& process_status_59)); } __e_acsl_delete_block((void *)(& pid_59)); } { pid_t pid_60 = fork(); __e_acsl_store_block((void *)(& pid_60),(size_t)4); __e_acsl_full_init((void *)(& pid_60)); if (! pid_60) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_124,szt); __gen_e_acsl_exit(0); } else { int process_status_60; __e_acsl_store_block((void *)(& process_status_60),(size_t)4); waitpid(pid_60,& process_status_60,0); signal_eval(process_status_60,0,__gen_e_acsl_literal_string_125); __e_acsl_delete_block((void *)(& process_status_60)); } __e_acsl_delete_block((void *)(& pid_60)); } { pid_t pid_61 = fork(); __e_acsl_store_block((void *)(& pid_61),(size_t)4); __e_acsl_full_init((void *)(& pid_61)); if (! pid_61) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_116,szt); __gen_e_acsl_exit(0); } else { int process_status_61; __e_acsl_store_block((void *)(& process_status_61),(size_t)4); waitpid(pid_61,& process_status_61,0); signal_eval(process_status_61,0,__gen_e_acsl_literal_string_125); __e_acsl_delete_block((void *)(& process_status_61)); } __e_acsl_delete_block((void *)(& pid_61)); } { pid_t pid_62 = fork(); __e_acsl_store_block((void *)(& pid_62),(size_t)4); __e_acsl_full_init((void *)(& pid_62)); if (! pid_62) { __e_acsl_builtin_printf("Z",__gen_e_acsl_literal_string_126,& szt); __gen_e_acsl_exit(0); } else { int process_status_62; __e_acsl_store_block((void *)(& process_status_62),(size_t)4); waitpid(pid_62,& process_status_62,0); signal_eval(process_status_62,0,__gen_e_acsl_literal_string_125); __e_acsl_delete_block((void *)(& process_status_62)); } __e_acsl_delete_block((void *)(& pid_62)); } test_specifier_application(__gen_e_acsl_literal_string_45, __gen_e_acsl_literal_string_127,1, (char *)__gen_e_acsl_literal_string_128); { pid_t pid_63 = fork(); __e_acsl_store_block((void *)(& pid_63),(size_t)4); __e_acsl_full_init((void *)(& pid_63)); if (! pid_63) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_129,lu); __gen_e_acsl_exit(0); } else { int process_status_63; __e_acsl_store_block((void *)(& process_status_63),(size_t)4); waitpid(pid_63,& process_status_63,0); signal_eval(process_status_63,0,__gen_e_acsl_literal_string_130); __e_acsl_delete_block((void *)(& process_status_63)); } __e_acsl_delete_block((void *)(& pid_63)); } { pid_t pid_64 = fork(); __e_acsl_store_block((void *)(& pid_64),(size_t)4); __e_acsl_full_init((void *)(& pid_64)); if (! pid_64) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_131,lu); __gen_e_acsl_exit(0); } else { int process_status_64; __e_acsl_store_block((void *)(& process_status_64),(size_t)4); waitpid(pid_64,& process_status_64,0); signal_eval(process_status_64,0,__gen_e_acsl_literal_string_130); __e_acsl_delete_block((void *)(& process_status_64)); } __e_acsl_delete_block((void *)(& pid_64)); } { pid_t pid_65 = fork(); __e_acsl_store_block((void *)(& pid_65),(size_t)4); __e_acsl_full_init((void *)(& pid_65)); if (! pid_65) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_132,lu); __gen_e_acsl_exit(0); } else { int process_status_65; __e_acsl_store_block((void *)(& process_status_65),(size_t)4); waitpid(pid_65,& process_status_65,0); signal_eval(process_status_65,0,__gen_e_acsl_literal_string_133); __e_acsl_delete_block((void *)(& process_status_65)); } __e_acsl_delete_block((void *)(& pid_65)); } { pid_t pid_66 = fork(); __e_acsl_store_block((void *)(& pid_66),(size_t)4); __e_acsl_full_init((void *)(& pid_66)); if (! pid_66) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_127,lu); __gen_e_acsl_exit(0); } else { int process_status_66; __e_acsl_store_block((void *)(& process_status_66),(size_t)4); waitpid(pid_66,& process_status_66,0); signal_eval(process_status_66,0,__gen_e_acsl_literal_string_133); __e_acsl_delete_block((void *)(& process_status_66)); } __e_acsl_delete_block((void *)(& pid_66)); } { pid_t pid_67 = fork(); __e_acsl_store_block((void *)(& pid_67),(size_t)4); __e_acsl_full_init((void *)(& pid_67)); if (! pid_67) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_134,ptrdf); __gen_e_acsl_exit(0); } else { int process_status_67; __e_acsl_store_block((void *)(& process_status_67),(size_t)4); waitpid(pid_67,& process_status_67,0); signal_eval(process_status_67,0,__gen_e_acsl_literal_string_135); __e_acsl_delete_block((void *)(& process_status_67)); } __e_acsl_delete_block((void *)(& pid_67)); } { pid_t pid_68 = fork(); __e_acsl_store_block((void *)(& pid_68),(size_t)4); __e_acsl_full_init((void *)(& pid_68)); if (! pid_68) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_136,ptrdf); __gen_e_acsl_exit(0); } else { int process_status_68; __e_acsl_store_block((void *)(& process_status_68),(size_t)4); waitpid(pid_68,& process_status_68,0); signal_eval(process_status_68,0,__gen_e_acsl_literal_string_135); __e_acsl_delete_block((void *)(& process_status_68)); } __e_acsl_delete_block((void *)(& pid_68)); } { pid_t pid_69 = fork(); __e_acsl_store_block((void *)(& pid_69),(size_t)4); __e_acsl_full_init((void *)(& pid_69)); if (! pid_69) { __e_acsl_builtin_printf("z",__gen_e_acsl_literal_string_137,& ptrdf); __gen_e_acsl_exit(0); } else { int process_status_69; __e_acsl_store_block((void *)(& process_status_69),(size_t)4); waitpid(pid_69,& process_status_69,0); signal_eval(process_status_69,0,__gen_e_acsl_literal_string_138); __e_acsl_delete_block((void *)(& process_status_69)); } __e_acsl_delete_block((void *)(& pid_69)); } test_specifier_application(__gen_e_acsl_literal_string_139, __gen_e_acsl_literal_string_140,1, (char *)__gen_e_acsl_literal_string_141); { pid_t pid_70 = fork(); __e_acsl_store_block((void *)(& pid_70),(size_t)4); __e_acsl_full_init((void *)(& pid_70)); if (! pid_70) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_142,ldbl); __gen_e_acsl_exit(0); } else { int process_status_70; __e_acsl_store_block((void *)(& process_status_70),(size_t)4); waitpid(pid_70,& process_status_70,0); signal_eval(process_status_70,0,__gen_e_acsl_literal_string_143); __e_acsl_delete_block((void *)(& process_status_70)); } __e_acsl_delete_block((void *)(& pid_70)); } { pid_t pid_71 = fork(); __e_acsl_store_block((void *)(& pid_71),(size_t)4); __e_acsl_full_init((void *)(& pid_71)); if (! pid_71) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_144,ldbl); __gen_e_acsl_exit(0); } else { int process_status_71; __e_acsl_store_block((void *)(& process_status_71),(size_t)4); waitpid(pid_71,& process_status_71,0); signal_eval(process_status_71,0,__gen_e_acsl_literal_string_143); __e_acsl_delete_block((void *)(& process_status_71)); } __e_acsl_delete_block((void *)(& pid_71)); } { pid_t pid_72 = fork(); __e_acsl_store_block((void *)(& pid_72),(size_t)4); __e_acsl_full_init((void *)(& pid_72)); if (! pid_72) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_145,ldbl); __gen_e_acsl_exit(0); } else { int process_status_72; __e_acsl_store_block((void *)(& process_status_72),(size_t)4); waitpid(pid_72,& process_status_72,0); signal_eval(process_status_72,0,__gen_e_acsl_literal_string_146); __e_acsl_delete_block((void *)(& process_status_72)); } __e_acsl_delete_block((void *)(& pid_72)); } { pid_t pid_73 = fork(); __e_acsl_store_block((void *)(& pid_73),(size_t)4); __e_acsl_full_init((void *)(& pid_73)); if (! pid_73) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_147,ldbl); __gen_e_acsl_exit(0); } else { int process_status_73; __e_acsl_store_block((void *)(& process_status_73),(size_t)4); waitpid(pid_73,& process_status_73,0); signal_eval(process_status_73,0,__gen_e_acsl_literal_string_146); __e_acsl_delete_block((void *)(& process_status_73)); } __e_acsl_delete_block((void *)(& pid_73)); } { pid_t pid_74 = fork(); __e_acsl_store_block((void *)(& pid_74),(size_t)4); __e_acsl_full_init((void *)(& pid_74)); if (! pid_74) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_148,ldbl); __gen_e_acsl_exit(0); } else { int process_status_74; __e_acsl_store_block((void *)(& process_status_74),(size_t)4); waitpid(pid_74,& process_status_74,0); signal_eval(process_status_74,0,__gen_e_acsl_literal_string_149); __e_acsl_delete_block((void *)(& process_status_74)); } __e_acsl_delete_block((void *)(& pid_74)); } { pid_t pid_75 = fork(); __e_acsl_store_block((void *)(& pid_75),(size_t)4); __e_acsl_full_init((void *)(& pid_75)); if (! pid_75) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_150,ldbl); __gen_e_acsl_exit(0); } else { int process_status_75; __e_acsl_store_block((void *)(& process_status_75),(size_t)4); waitpid(pid_75,& process_status_75,0); signal_eval(process_status_75,0,__gen_e_acsl_literal_string_149); __e_acsl_delete_block((void *)(& process_status_75)); } __e_acsl_delete_block((void *)(& pid_75)); } { pid_t pid_76 = fork(); __e_acsl_store_block((void *)(& pid_76),(size_t)4); __e_acsl_full_init((void *)(& pid_76)); if (! pid_76) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_151,ldbl); __gen_e_acsl_exit(0); } else { int process_status_76; __e_acsl_store_block((void *)(& process_status_76),(size_t)4); waitpid(pid_76,& process_status_76,0); signal_eval(process_status_76,0,__gen_e_acsl_literal_string_152); __e_acsl_delete_block((void *)(& process_status_76)); } __e_acsl_delete_block((void *)(& pid_76)); } { pid_t pid_77 = fork(); __e_acsl_store_block((void *)(& pid_77),(size_t)4); __e_acsl_full_init((void *)(& pid_77)); if (! pid_77) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_153,ldbl); __gen_e_acsl_exit(0); } else { int process_status_77; __e_acsl_store_block((void *)(& process_status_77),(size_t)4); waitpid(pid_77,& process_status_77,0); signal_eval(process_status_77,0,__gen_e_acsl_literal_string_152); __e_acsl_delete_block((void *)(& process_status_77)); } __e_acsl_delete_block((void *)(& pid_77)); } { pid_t pid_78 = fork(); __e_acsl_store_block((void *)(& pid_78),(size_t)4); __e_acsl_full_init((void *)(& pid_78)); if (! pid_78) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_154,1); __gen_e_acsl_exit(0); } else { int process_status_78; __e_acsl_store_block((void *)(& process_status_78),(size_t)4); waitpid(pid_78,& process_status_78,0); signal_eval(process_status_78,1,__gen_e_acsl_literal_string_155); __e_acsl_delete_block((void *)(& process_status_78)); } __e_acsl_delete_block((void *)(& pid_78)); } { pid_t pid_79 = fork(); __e_acsl_store_block((void *)(& pid_79),(size_t)4); __e_acsl_full_init((void *)(& pid_79)); if (! pid_79) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_156,1); __gen_e_acsl_exit(0); } else { int process_status_79; __e_acsl_store_block((void *)(& process_status_79),(size_t)4); waitpid(pid_79,& process_status_79,0); signal_eval(process_status_79,1,__gen_e_acsl_literal_string_157); __e_acsl_delete_block((void *)(& process_status_79)); } __e_acsl_delete_block((void *)(& pid_79)); } { pid_t pid_80 = fork(); __e_acsl_store_block((void *)(& pid_80),(size_t)4); __e_acsl_full_init((void *)(& pid_80)); if (! pid_80) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_158,1); __gen_e_acsl_exit(0); } else { int process_status_80; __e_acsl_store_block((void *)(& process_status_80),(size_t)4); waitpid(pid_80,& process_status_80,0); signal_eval(process_status_80,1,__gen_e_acsl_literal_string_159); __e_acsl_delete_block((void *)(& process_status_80)); } __e_acsl_delete_block((void *)(& pid_80)); } { pid_t pid_81 = fork(); __e_acsl_store_block((void *)(& pid_81),(size_t)4); __e_acsl_full_init((void *)(& pid_81)); if (! pid_81) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_160,i); __gen_e_acsl_exit(0); } else { int process_status_81; __e_acsl_store_block((void *)(& process_status_81),(size_t)4); waitpid(pid_81,& process_status_81,0); signal_eval(process_status_81,0,__gen_e_acsl_literal_string_161); __e_acsl_delete_block((void *)(& process_status_81)); } __e_acsl_delete_block((void *)(& pid_81)); } { pid_t pid_82 = fork(); __e_acsl_store_block((void *)(& pid_82),(size_t)4); __e_acsl_full_init((void *)(& pid_82)); if (! pid_82) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_162,i); __gen_e_acsl_exit(0); } else { int process_status_82; __e_acsl_store_block((void *)(& process_status_82),(size_t)4); waitpid(pid_82,& process_status_82,0); signal_eval(process_status_82,0,__gen_e_acsl_literal_string_161); __e_acsl_delete_block((void *)(& process_status_82)); } __e_acsl_delete_block((void *)(& pid_82)); } { pid_t pid_83 = fork(); __e_acsl_store_block((void *)(& pid_83),(size_t)4); __e_acsl_full_init((void *)(& pid_83)); if (! pid_83) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_160,(int)chr); __gen_e_acsl_exit(0); } else { int process_status_83; __e_acsl_store_block((void *)(& process_status_83),(size_t)4); waitpid(pid_83,& process_status_83,0); signal_eval(process_status_83,0,__gen_e_acsl_literal_string_163); __e_acsl_delete_block((void *)(& process_status_83)); } __e_acsl_delete_block((void *)(& pid_83)); } { pid_t pid_84 = fork(); __e_acsl_store_block((void *)(& pid_84),(size_t)4); __e_acsl_full_init((void *)(& pid_84)); if (! pid_84) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_162,(int)chr); __gen_e_acsl_exit(0); } else { int process_status_84; __e_acsl_store_block((void *)(& process_status_84),(size_t)4); waitpid(pid_84,& process_status_84,0); signal_eval(process_status_84,0,__gen_e_acsl_literal_string_163); __e_acsl_delete_block((void *)(& process_status_84)); } __e_acsl_delete_block((void *)(& pid_84)); } { pid_t pid_85 = fork(); __e_acsl_store_block((void *)(& pid_85),(size_t)4); __e_acsl_full_init((void *)(& pid_85)); if (! pid_85) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_160,(int)shrt); __gen_e_acsl_exit(0); } else { int process_status_85; __e_acsl_store_block((void *)(& process_status_85),(size_t)4); waitpid(pid_85,& process_status_85,0); signal_eval(process_status_85,0,__gen_e_acsl_literal_string_164); __e_acsl_delete_block((void *)(& process_status_85)); } __e_acsl_delete_block((void *)(& pid_85)); } { pid_t pid_86 = fork(); __e_acsl_store_block((void *)(& pid_86),(size_t)4); __e_acsl_full_init((void *)(& pid_86)); if (! pid_86) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_162,(int)shrt); __gen_e_acsl_exit(0); } else { int process_status_86; __e_acsl_store_block((void *)(& process_status_86),(size_t)4); waitpid(pid_86,& process_status_86,0); signal_eval(process_status_86,0,__gen_e_acsl_literal_string_164); __e_acsl_delete_block((void *)(& process_status_86)); } __e_acsl_delete_block((void *)(& pid_86)); } { pid_t pid_87 = fork(); __e_acsl_store_block((void *)(& pid_87),(size_t)4); __e_acsl_full_init((void *)(& pid_87)); if (! pid_87) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_160,li); __gen_e_acsl_exit(0); } else { int process_status_87; __e_acsl_store_block((void *)(& process_status_87),(size_t)4); waitpid(pid_87,& process_status_87,0); signal_eval(process_status_87,1,__gen_e_acsl_literal_string_165); __e_acsl_delete_block((void *)(& process_status_87)); } __e_acsl_delete_block((void *)(& pid_87)); } { pid_t pid_88 = fork(); __e_acsl_store_block((void *)(& pid_88),(size_t)4); __e_acsl_full_init((void *)(& pid_88)); if (! pid_88) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_162,li); __gen_e_acsl_exit(0); } else { int process_status_88; __e_acsl_store_block((void *)(& process_status_88),(size_t)4); waitpid(pid_88,& process_status_88,0); signal_eval(process_status_88,1,__gen_e_acsl_literal_string_165); __e_acsl_delete_block((void *)(& process_status_88)); } __e_acsl_delete_block((void *)(& pid_88)); } { pid_t pid_89 = fork(); __e_acsl_store_block((void *)(& pid_89),(size_t)4); __e_acsl_full_init((void *)(& pid_89)); if (! pid_89) { __e_acsl_builtin_printf("D",__gen_e_acsl_literal_string_160,ui); __gen_e_acsl_exit(0); } else { int process_status_89; __e_acsl_store_block((void *)(& process_status_89),(size_t)4); waitpid(pid_89,& process_status_89,0); signal_eval(process_status_89,1,__gen_e_acsl_literal_string_166); __e_acsl_delete_block((void *)(& process_status_89)); } __e_acsl_delete_block((void *)(& pid_89)); } { pid_t pid_90 = fork(); __e_acsl_store_block((void *)(& pid_90),(size_t)4); __e_acsl_full_init((void *)(& pid_90)); if (! pid_90) { __e_acsl_builtin_printf("D",__gen_e_acsl_literal_string_162,ui); __gen_e_acsl_exit(0); } else { int process_status_90; __e_acsl_store_block((void *)(& process_status_90),(size_t)4); waitpid(pid_90,& process_status_90,0); signal_eval(process_status_90,1,__gen_e_acsl_literal_string_166); __e_acsl_delete_block((void *)(& process_status_90)); } __e_acsl_delete_block((void *)(& pid_90)); } { pid_t pid_91 = fork(); __e_acsl_store_block((void *)(& pid_91),(size_t)4); __e_acsl_full_init((void *)(& pid_91)); if (! pid_91) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_160,vptr); __gen_e_acsl_exit(0); } else { int process_status_91; __e_acsl_store_block((void *)(& process_status_91),(size_t)4); waitpid(pid_91,& process_status_91,0); signal_eval(process_status_91,1,__gen_e_acsl_literal_string_167); __e_acsl_delete_block((void *)(& process_status_91)); } __e_acsl_delete_block((void *)(& pid_91)); } { pid_t pid_92 = fork(); __e_acsl_store_block((void *)(& pid_92),(size_t)4); __e_acsl_full_init((void *)(& pid_92)); if (! pid_92) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_162,vptr); __gen_e_acsl_exit(0); } else { int process_status_92; __e_acsl_store_block((void *)(& process_status_92),(size_t)4); waitpid(pid_92,& process_status_92,0); signal_eval(process_status_92,1,__gen_e_acsl_literal_string_167); __e_acsl_delete_block((void *)(& process_status_92)); } __e_acsl_delete_block((void *)(& pid_92)); } { pid_t pid_93 = fork(); __e_acsl_store_block((void *)(& pid_93),(size_t)4); __e_acsl_full_init((void *)(& pid_93)); if (! pid_93) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_160, (double)flt); __gen_e_acsl_exit(0); } else { int process_status_93; __e_acsl_store_block((void *)(& process_status_93),(size_t)4); waitpid(pid_93,& process_status_93,0); signal_eval(process_status_93,1,__gen_e_acsl_literal_string_168); __e_acsl_delete_block((void *)(& process_status_93)); } __e_acsl_delete_block((void *)(& pid_93)); } { pid_t pid_94 = fork(); __e_acsl_store_block((void *)(& pid_94),(size_t)4); __e_acsl_full_init((void *)(& pid_94)); if (! pid_94) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_162, (double)flt); __gen_e_acsl_exit(0); } else { int process_status_94; __e_acsl_store_block((void *)(& process_status_94),(size_t)4); waitpid(pid_94,& process_status_94,0); signal_eval(process_status_94,1,__gen_e_acsl_literal_string_168); __e_acsl_delete_block((void *)(& process_status_94)); } __e_acsl_delete_block((void *)(& pid_94)); } { pid_t pid_95 = fork(); __e_acsl_store_block((void *)(& pid_95),(size_t)4); __e_acsl_full_init((void *)(& pid_95)); if (! pid_95) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_169,li); __gen_e_acsl_exit(0); } else { int process_status_95; __e_acsl_store_block((void *)(& process_status_95),(size_t)4); waitpid(pid_95,& process_status_95,0); signal_eval(process_status_95,0,__gen_e_acsl_literal_string_170); __e_acsl_delete_block((void *)(& process_status_95)); } __e_acsl_delete_block((void *)(& pid_95)); } { pid_t pid_96 = fork(); __e_acsl_store_block((void *)(& pid_96),(size_t)4); __e_acsl_full_init((void *)(& pid_96)); if (! pid_96) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_39,li); __gen_e_acsl_exit(0); } else { int process_status_96; __e_acsl_store_block((void *)(& process_status_96),(size_t)4); waitpid(pid_96,& process_status_96,0); signal_eval(process_status_96,0,__gen_e_acsl_literal_string_170); __e_acsl_delete_block((void *)(& process_status_96)); } __e_acsl_delete_block((void *)(& pid_96)); } { pid_t pid_97 = fork(); __e_acsl_store_block((void *)(& pid_97),(size_t)4); __e_acsl_full_init((void *)(& pid_97)); if (! pid_97) { __e_acsl_builtin_printf("r",__gen_e_acsl_literal_string_171,lli); __gen_e_acsl_exit(0); } else { int process_status_97; __e_acsl_store_block((void *)(& process_status_97),(size_t)4); waitpid(pid_97,& process_status_97,0); signal_eval(process_status_97,0,__gen_e_acsl_literal_string_172); __e_acsl_delete_block((void *)(& process_status_97)); } __e_acsl_delete_block((void *)(& pid_97)); } { pid_t pid_98 = fork(); __e_acsl_store_block((void *)(& pid_98),(size_t)4); __e_acsl_full_init((void *)(& pid_98)); if (! pid_98) { __e_acsl_builtin_printf("r",__gen_e_acsl_literal_string_41,lli); __gen_e_acsl_exit(0); } else { int process_status_98; __e_acsl_store_block((void *)(& process_status_98),(size_t)4); waitpid(pid_98,& process_status_98,0); signal_eval(process_status_98,0,__gen_e_acsl_literal_string_172); __e_acsl_delete_block((void *)(& process_status_98)); } __e_acsl_delete_block((void *)(& pid_98)); } { pid_t pid_99 = fork(); __e_acsl_store_block((void *)(& pid_99),(size_t)4); __e_acsl_full_init((void *)(& pid_99)); if (! pid_99) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_173,(int)shrt); __gen_e_acsl_exit(0); } else { int process_status_99; __e_acsl_store_block((void *)(& process_status_99),(size_t)4); waitpid(pid_99,& process_status_99,0); signal_eval(process_status_99,0,__gen_e_acsl_literal_string_174); __e_acsl_delete_block((void *)(& process_status_99)); } __e_acsl_delete_block((void *)(& pid_99)); } { pid_t pid_100 = fork(); __e_acsl_store_block((void *)(& pid_100),(size_t)4); __e_acsl_full_init((void *)(& pid_100)); if (! pid_100) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_175,(int)shrt); __gen_e_acsl_exit(0); } else { int process_status_100; __e_acsl_store_block((void *)(& process_status_100),(size_t)4); waitpid(pid_100,& process_status_100,0); signal_eval(process_status_100,0,__gen_e_acsl_literal_string_174); __e_acsl_delete_block((void *)(& process_status_100)); } __e_acsl_delete_block((void *)(& pid_100)); } { pid_t pid_101 = fork(); __e_acsl_store_block((void *)(& pid_101),(size_t)4); __e_acsl_full_init((void *)(& pid_101)); if (! pid_101) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_176,(int)chr); __gen_e_acsl_exit(0); } else { int process_status_101; __e_acsl_store_block((void *)(& process_status_101),(size_t)4); waitpid(pid_101,& process_status_101,0); signal_eval(process_status_101,0,__gen_e_acsl_literal_string_177); __e_acsl_delete_block((void *)(& process_status_101)); } __e_acsl_delete_block((void *)(& pid_101)); } { pid_t pid_102 = fork(); __e_acsl_store_block((void *)(& pid_102),(size_t)4); __e_acsl_full_init((void *)(& pid_102)); if (! pid_102) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_178,(int)chr); __gen_e_acsl_exit(0); } else { int process_status_102; __e_acsl_store_block((void *)(& process_status_102),(size_t)4); waitpid(pid_102,& process_status_102,0); signal_eval(process_status_102,0,__gen_e_acsl_literal_string_177); __e_acsl_delete_block((void *)(& process_status_102)); } __e_acsl_delete_block((void *)(& pid_102)); } { pid_t pid_103 = fork(); __e_acsl_store_block((void *)(& pid_103),(size_t)4); __e_acsl_full_init((void *)(& pid_103)); if (! pid_103) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_179,li); __gen_e_acsl_exit(0); } else { int process_status_103; __e_acsl_store_block((void *)(& process_status_103),(size_t)4); waitpid(pid_103,& process_status_103,0); signal_eval(process_status_103,0,__gen_e_acsl_literal_string_180); __e_acsl_delete_block((void *)(& process_status_103)); } __e_acsl_delete_block((void *)(& pid_103)); } { pid_t pid_104 = fork(); __e_acsl_store_block((void *)(& pid_104),(size_t)4); __e_acsl_full_init((void *)(& pid_104)); if (! pid_104) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_181,li); __gen_e_acsl_exit(0); } else { int process_status_104; __e_acsl_store_block((void *)(& process_status_104),(size_t)4); waitpid(pid_104,& process_status_104,0); signal_eval(process_status_104,0,__gen_e_acsl_literal_string_180); __e_acsl_delete_block((void *)(& process_status_104)); } __e_acsl_delete_block((void *)(& pid_104)); } { pid_t pid_105 = fork(); __e_acsl_store_block((void *)(& pid_105),(size_t)4); __e_acsl_full_init((void *)(& pid_105)); if (! pid_105) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_182,ptrdf); __gen_e_acsl_exit(0); } else { int process_status_105; __e_acsl_store_block((void *)(& process_status_105),(size_t)4); waitpid(pid_105,& process_status_105,0); signal_eval(process_status_105,0,__gen_e_acsl_literal_string_183); __e_acsl_delete_block((void *)(& process_status_105)); } __e_acsl_delete_block((void *)(& pid_105)); } { pid_t pid_106 = fork(); __e_acsl_store_block((void *)(& pid_106),(size_t)4); __e_acsl_full_init((void *)(& pid_106)); if (! pid_106) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_184,ptrdf); __gen_e_acsl_exit(0); } else { int process_status_106; __e_acsl_store_block((void *)(& process_status_106),(size_t)4); waitpid(pid_106,& process_status_106,0); signal_eval(process_status_106,0,__gen_e_acsl_literal_string_183); __e_acsl_delete_block((void *)(& process_status_106)); } __e_acsl_delete_block((void *)(& pid_106)); } { pid_t pid_107 = fork(); __e_acsl_store_block((void *)(& pid_107),(size_t)4); __e_acsl_full_init((void *)(& pid_107)); if (! pid_107) { __e_acsl_builtin_printf("D",__gen_e_acsl_literal_string_185,ui); __gen_e_acsl_exit(0); } else { int process_status_107; __e_acsl_store_block((void *)(& process_status_107),(size_t)4); waitpid(pid_107,& process_status_107,0); signal_eval(process_status_107,0,__gen_e_acsl_literal_string_186); __e_acsl_delete_block((void *)(& process_status_107)); } __e_acsl_delete_block((void *)(& pid_107)); } { pid_t pid_108 = fork(); __e_acsl_store_block((void *)(& pid_108),(size_t)4); __e_acsl_full_init((void *)(& pid_108)); if (! pid_108) { __e_acsl_builtin_printf("D",__gen_e_acsl_literal_string_187,ui); __gen_e_acsl_exit(0); } else { int process_status_108; __e_acsl_store_block((void *)(& process_status_108),(size_t)4); waitpid(pid_108,& process_status_108,0); signal_eval(process_status_108,0,__gen_e_acsl_literal_string_186); __e_acsl_delete_block((void *)(& process_status_108)); } __e_acsl_delete_block((void *)(& pid_108)); } { pid_t pid_109 = fork(); __e_acsl_store_block((void *)(& pid_109),(size_t)4); __e_acsl_full_init((void *)(& pid_109)); if (! pid_109) { __e_acsl_builtin_printf("D",__gen_e_acsl_literal_string_188,ui); __gen_e_acsl_exit(0); } else { int process_status_109; __e_acsl_store_block((void *)(& process_status_109),(size_t)4); waitpid(pid_109,& process_status_109,0); signal_eval(process_status_109,0,__gen_e_acsl_literal_string_186); __e_acsl_delete_block((void *)(& process_status_109)); } __e_acsl_delete_block((void *)(& pid_109)); } { pid_t pid_110 = fork(); __e_acsl_store_block((void *)(& pid_110),(size_t)4); __e_acsl_full_init((void *)(& pid_110)); if (! pid_110) { __e_acsl_builtin_printf("D",__gen_e_acsl_literal_string_189,ui); __gen_e_acsl_exit(0); } else { int process_status_110; __e_acsl_store_block((void *)(& process_status_110),(size_t)4); waitpid(pid_110,& process_status_110,0); signal_eval(process_status_110,0,__gen_e_acsl_literal_string_186); __e_acsl_delete_block((void *)(& process_status_110)); } __e_acsl_delete_block((void *)(& pid_110)); } { pid_t pid_111 = fork(); __e_acsl_store_block((void *)(& pid_111),(size_t)4); __e_acsl_full_init((void *)(& pid_111)); if (! pid_111) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_185,li); __gen_e_acsl_exit(0); } else { int process_status_111; __e_acsl_store_block((void *)(& process_status_111),(size_t)4); waitpid(pid_111,& process_status_111,0); signal_eval(process_status_111,1,__gen_e_acsl_literal_string_190); __e_acsl_delete_block((void *)(& process_status_111)); } __e_acsl_delete_block((void *)(& pid_111)); } { pid_t pid_112 = fork(); __e_acsl_store_block((void *)(& pid_112),(size_t)4); __e_acsl_full_init((void *)(& pid_112)); if (! pid_112) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_187,li); __gen_e_acsl_exit(0); } else { int process_status_112; __e_acsl_store_block((void *)(& process_status_112),(size_t)4); waitpid(pid_112,& process_status_112,0); signal_eval(process_status_112,1,__gen_e_acsl_literal_string_190); __e_acsl_delete_block((void *)(& process_status_112)); } __e_acsl_delete_block((void *)(& pid_112)); } { pid_t pid_113 = fork(); __e_acsl_store_block((void *)(& pid_113),(size_t)4); __e_acsl_full_init((void *)(& pid_113)); if (! pid_113) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_188,li); __gen_e_acsl_exit(0); } else { int process_status_113; __e_acsl_store_block((void *)(& process_status_113),(size_t)4); waitpid(pid_113,& process_status_113,0); signal_eval(process_status_113,1,__gen_e_acsl_literal_string_190); __e_acsl_delete_block((void *)(& process_status_113)); } __e_acsl_delete_block((void *)(& pid_113)); } { pid_t pid_114 = fork(); __e_acsl_store_block((void *)(& pid_114),(size_t)4); __e_acsl_full_init((void *)(& pid_114)); if (! pid_114) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_189,li); __gen_e_acsl_exit(0); } else { int process_status_114; __e_acsl_store_block((void *)(& process_status_114),(size_t)4); waitpid(pid_114,& process_status_114,0); signal_eval(process_status_114,1,__gen_e_acsl_literal_string_190); __e_acsl_delete_block((void *)(& process_status_114)); } __e_acsl_delete_block((void *)(& pid_114)); } { pid_t pid_115 = fork(); __e_acsl_store_block((void *)(& pid_115),(size_t)4); __e_acsl_full_init((void *)(& pid_115)); if (! pid_115) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_185,lu); __gen_e_acsl_exit(0); } else { int process_status_115; __e_acsl_store_block((void *)(& process_status_115),(size_t)4); waitpid(pid_115,& process_status_115,0); signal_eval(process_status_115,1,__gen_e_acsl_literal_string_191); __e_acsl_delete_block((void *)(& process_status_115)); } __e_acsl_delete_block((void *)(& pid_115)); } { pid_t pid_116 = fork(); __e_acsl_store_block((void *)(& pid_116),(size_t)4); __e_acsl_full_init((void *)(& pid_116)); if (! pid_116) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_187,lu); __gen_e_acsl_exit(0); } else { int process_status_116; __e_acsl_store_block((void *)(& process_status_116),(size_t)4); waitpid(pid_116,& process_status_116,0); signal_eval(process_status_116,1,__gen_e_acsl_literal_string_191); __e_acsl_delete_block((void *)(& process_status_116)); } __e_acsl_delete_block((void *)(& pid_116)); } { pid_t pid_117 = fork(); __e_acsl_store_block((void *)(& pid_117),(size_t)4); __e_acsl_full_init((void *)(& pid_117)); if (! pid_117) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_188,lu); __gen_e_acsl_exit(0); } else { int process_status_117; __e_acsl_store_block((void *)(& process_status_117),(size_t)4); waitpid(pid_117,& process_status_117,0); signal_eval(process_status_117,1,__gen_e_acsl_literal_string_191); __e_acsl_delete_block((void *)(& process_status_117)); } __e_acsl_delete_block((void *)(& pid_117)); } { pid_t pid_118 = fork(); __e_acsl_store_block((void *)(& pid_118),(size_t)4); __e_acsl_full_init((void *)(& pid_118)); if (! pid_118) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_189,lu); __gen_e_acsl_exit(0); } else { int process_status_118; __e_acsl_store_block((void *)(& process_status_118),(size_t)4); waitpid(pid_118,& process_status_118,0); signal_eval(process_status_118,1,__gen_e_acsl_literal_string_191); __e_acsl_delete_block((void *)(& process_status_118)); } __e_acsl_delete_block((void *)(& pid_118)); } { pid_t pid_119 = fork(); __e_acsl_store_block((void *)(& pid_119),(size_t)4); __e_acsl_full_init((void *)(& pid_119)); if (! pid_119) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_185, (double)flt); __gen_e_acsl_exit(0); } else { int process_status_119; __e_acsl_store_block((void *)(& process_status_119),(size_t)4); waitpid(pid_119,& process_status_119,0); signal_eval(process_status_119,1,__gen_e_acsl_literal_string_192); __e_acsl_delete_block((void *)(& process_status_119)); } __e_acsl_delete_block((void *)(& pid_119)); } { pid_t pid_120 = fork(); __e_acsl_store_block((void *)(& pid_120),(size_t)4); __e_acsl_full_init((void *)(& pid_120)); if (! pid_120) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_187, (double)flt); __gen_e_acsl_exit(0); } else { int process_status_120; __e_acsl_store_block((void *)(& process_status_120),(size_t)4); waitpid(pid_120,& process_status_120,0); signal_eval(process_status_120,1,__gen_e_acsl_literal_string_192); __e_acsl_delete_block((void *)(& process_status_120)); } __e_acsl_delete_block((void *)(& pid_120)); } { pid_t pid_121 = fork(); __e_acsl_store_block((void *)(& pid_121),(size_t)4); __e_acsl_full_init((void *)(& pid_121)); if (! pid_121) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_188, (double)flt); __gen_e_acsl_exit(0); } else { int process_status_121; __e_acsl_store_block((void *)(& process_status_121),(size_t)4); waitpid(pid_121,& process_status_121,0); signal_eval(process_status_121,1,__gen_e_acsl_literal_string_192); __e_acsl_delete_block((void *)(& process_status_121)); } __e_acsl_delete_block((void *)(& pid_121)); } { pid_t pid_122 = fork(); __e_acsl_store_block((void *)(& pid_122),(size_t)4); __e_acsl_full_init((void *)(& pid_122)); if (! pid_122) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_189, (double)flt); __gen_e_acsl_exit(0); } else { int process_status_122; __e_acsl_store_block((void *)(& process_status_122),(size_t)4); waitpid(pid_122,& process_status_122,0); signal_eval(process_status_122,1,__gen_e_acsl_literal_string_192); __e_acsl_delete_block((void *)(& process_status_122)); } __e_acsl_delete_block((void *)(& pid_122)); } { pid_t pid_123 = fork(); __e_acsl_store_block((void *)(& pid_123),(size_t)4); __e_acsl_full_init((void *)(& pid_123)); if (! pid_123) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_185,vptr); __gen_e_acsl_exit(0); } else { int process_status_123; __e_acsl_store_block((void *)(& process_status_123),(size_t)4); waitpid(pid_123,& process_status_123,0); signal_eval(process_status_123,1,__gen_e_acsl_literal_string_193); __e_acsl_delete_block((void *)(& process_status_123)); } __e_acsl_delete_block((void *)(& pid_123)); } { pid_t pid_124 = fork(); __e_acsl_store_block((void *)(& pid_124),(size_t)4); __e_acsl_full_init((void *)(& pid_124)); if (! pid_124) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_187,vptr); __gen_e_acsl_exit(0); } else { int process_status_124; __e_acsl_store_block((void *)(& process_status_124),(size_t)4); waitpid(pid_124,& process_status_124,0); signal_eval(process_status_124,1,__gen_e_acsl_literal_string_193); __e_acsl_delete_block((void *)(& process_status_124)); } __e_acsl_delete_block((void *)(& pid_124)); } { pid_t pid_125 = fork(); __e_acsl_store_block((void *)(& pid_125),(size_t)4); __e_acsl_full_init((void *)(& pid_125)); if (! pid_125) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_188,vptr); __gen_e_acsl_exit(0); } else { int process_status_125; __e_acsl_store_block((void *)(& process_status_125),(size_t)4); waitpid(pid_125,& process_status_125,0); signal_eval(process_status_125,1,__gen_e_acsl_literal_string_193); __e_acsl_delete_block((void *)(& process_status_125)); } __e_acsl_delete_block((void *)(& pid_125)); } { pid_t pid_126 = fork(); __e_acsl_store_block((void *)(& pid_126),(size_t)4); __e_acsl_full_init((void *)(& pid_126)); if (! pid_126) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_189,vptr); __gen_e_acsl_exit(0); } else { int process_status_126; __e_acsl_store_block((void *)(& process_status_126),(size_t)4); waitpid(pid_126,& process_status_126,0); signal_eval(process_status_126,1,__gen_e_acsl_literal_string_193); __e_acsl_delete_block((void *)(& process_status_126)); } __e_acsl_delete_block((void *)(& pid_126)); } { pid_t pid_127 = fork(); __e_acsl_store_block((void *)(& pid_127),(size_t)4); __e_acsl_full_init((void *)(& pid_127)); if (! pid_127) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_185,astr); __gen_e_acsl_exit(0); } else { int process_status_127; __e_acsl_store_block((void *)(& process_status_127),(size_t)4); waitpid(pid_127,& process_status_127,0); signal_eval(process_status_127,1,__gen_e_acsl_literal_string_194); __e_acsl_delete_block((void *)(& process_status_127)); } __e_acsl_delete_block((void *)(& pid_127)); } { pid_t pid_128 = fork(); __e_acsl_store_block((void *)(& pid_128),(size_t)4); __e_acsl_full_init((void *)(& pid_128)); if (! pid_128) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_187,astr); __gen_e_acsl_exit(0); } else { int process_status_128; __e_acsl_store_block((void *)(& process_status_128),(size_t)4); waitpid(pid_128,& process_status_128,0); signal_eval(process_status_128,1,__gen_e_acsl_literal_string_194); __e_acsl_delete_block((void *)(& process_status_128)); } __e_acsl_delete_block((void *)(& pid_128)); } { pid_t pid_129 = fork(); __e_acsl_store_block((void *)(& pid_129),(size_t)4); __e_acsl_full_init((void *)(& pid_129)); if (! pid_129) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_188,astr); __gen_e_acsl_exit(0); } else { int process_status_129; __e_acsl_store_block((void *)(& process_status_129),(size_t)4); waitpid(pid_129,& process_status_129,0); signal_eval(process_status_129,1,__gen_e_acsl_literal_string_194); __e_acsl_delete_block((void *)(& process_status_129)); } __e_acsl_delete_block((void *)(& pid_129)); } { pid_t pid_130 = fork(); __e_acsl_store_block((void *)(& pid_130),(size_t)4); __e_acsl_full_init((void *)(& pid_130)); if (! pid_130) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_189,astr); __gen_e_acsl_exit(0); } else { int process_status_130; __e_acsl_store_block((void *)(& process_status_130),(size_t)4); waitpid(pid_130,& process_status_130,0); signal_eval(process_status_130,1,__gen_e_acsl_literal_string_194); __e_acsl_delete_block((void *)(& process_status_130)); } __e_acsl_delete_block((void *)(& pid_130)); } { pid_t pid_131 = fork(); __e_acsl_store_block((void *)(& pid_131),(size_t)4); __e_acsl_full_init((void *)(& pid_131)); if (! pid_131) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_195,lu); __gen_e_acsl_exit(0); } else { int process_status_131; __e_acsl_store_block((void *)(& process_status_131),(size_t)4); waitpid(pid_131,& process_status_131,0); signal_eval(process_status_131,0,__gen_e_acsl_literal_string_196); __e_acsl_delete_block((void *)(& process_status_131)); } __e_acsl_delete_block((void *)(& pid_131)); } { pid_t pid_132 = fork(); __e_acsl_store_block((void *)(& pid_132),(size_t)4); __e_acsl_full_init((void *)(& pid_132)); if (! pid_132) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_197,lu); __gen_e_acsl_exit(0); } else { int process_status_132; __e_acsl_store_block((void *)(& process_status_132),(size_t)4); waitpid(pid_132,& process_status_132,0); signal_eval(process_status_132,0,__gen_e_acsl_literal_string_196); __e_acsl_delete_block((void *)(& process_status_132)); } __e_acsl_delete_block((void *)(& pid_132)); } { pid_t pid_133 = fork(); __e_acsl_store_block((void *)(& pid_133),(size_t)4); __e_acsl_full_init((void *)(& pid_133)); if (! pid_133) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_198,lu); __gen_e_acsl_exit(0); } else { int process_status_133; __e_acsl_store_block((void *)(& process_status_133),(size_t)4); waitpid(pid_133,& process_status_133,0); signal_eval(process_status_133,0,__gen_e_acsl_literal_string_196); __e_acsl_delete_block((void *)(& process_status_133)); } __e_acsl_delete_block((void *)(& pid_133)); } { pid_t pid_134 = fork(); __e_acsl_store_block((void *)(& pid_134),(size_t)4); __e_acsl_full_init((void *)(& pid_134)); if (! pid_134) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_199,lu); __gen_e_acsl_exit(0); } else { int process_status_134; __e_acsl_store_block((void *)(& process_status_134),(size_t)4); waitpid(pid_134,& process_status_134,0); signal_eval(process_status_134,0,__gen_e_acsl_literal_string_196); __e_acsl_delete_block((void *)(& process_status_134)); } __e_acsl_delete_block((void *)(& pid_134)); } { pid_t pid_135 = fork(); __e_acsl_store_block((void *)(& pid_135),(size_t)4); __e_acsl_full_init((void *)(& pid_135)); if (! pid_135) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_200,llu); __gen_e_acsl_exit(0); } else { int process_status_135; __e_acsl_store_block((void *)(& process_status_135),(size_t)4); waitpid(pid_135,& process_status_135,0); signal_eval(process_status_135,0,__gen_e_acsl_literal_string_201); __e_acsl_delete_block((void *)(& process_status_135)); } __e_acsl_delete_block((void *)(& pid_135)); } { pid_t pid_136 = fork(); __e_acsl_store_block((void *)(& pid_136),(size_t)4); __e_acsl_full_init((void *)(& pid_136)); if (! pid_136) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_202,llu); __gen_e_acsl_exit(0); } else { int process_status_136; __e_acsl_store_block((void *)(& process_status_136),(size_t)4); waitpid(pid_136,& process_status_136,0); signal_eval(process_status_136,0,__gen_e_acsl_literal_string_201); __e_acsl_delete_block((void *)(& process_status_136)); } __e_acsl_delete_block((void *)(& pid_136)); } { pid_t pid_137 = fork(); __e_acsl_store_block((void *)(& pid_137),(size_t)4); __e_acsl_full_init((void *)(& pid_137)); if (! pid_137) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_203,llu); __gen_e_acsl_exit(0); } else { int process_status_137; __e_acsl_store_block((void *)(& process_status_137),(size_t)4); waitpid(pid_137,& process_status_137,0); signal_eval(process_status_137,0,__gen_e_acsl_literal_string_201); __e_acsl_delete_block((void *)(& process_status_137)); } __e_acsl_delete_block((void *)(& pid_137)); } { pid_t pid_138 = fork(); __e_acsl_store_block((void *)(& pid_138),(size_t)4); __e_acsl_full_init((void *)(& pid_138)); if (! pid_138) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_204,llu); __gen_e_acsl_exit(0); } else { int process_status_138; __e_acsl_store_block((void *)(& process_status_138),(size_t)4); waitpid(pid_138,& process_status_138,0); signal_eval(process_status_138,0,__gen_e_acsl_literal_string_201); __e_acsl_delete_block((void *)(& process_status_138)); } __e_acsl_delete_block((void *)(& pid_138)); } { pid_t pid_139 = fork(); __e_acsl_store_block((void *)(& pid_139),(size_t)4); __e_acsl_full_init((void *)(& pid_139)); if (! pid_139) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_205,i); __gen_e_acsl_exit(0); } else { int process_status_139; __e_acsl_store_block((void *)(& process_status_139),(size_t)4); waitpid(pid_139,& process_status_139,0); signal_eval(process_status_139,0,__gen_e_acsl_literal_string_206); __e_acsl_delete_block((void *)(& process_status_139)); } __e_acsl_delete_block((void *)(& pid_139)); } { pid_t pid_140 = fork(); __e_acsl_store_block((void *)(& pid_140),(size_t)4); __e_acsl_full_init((void *)(& pid_140)); if (! pid_140) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_207,i); __gen_e_acsl_exit(0); } else { int process_status_140; __e_acsl_store_block((void *)(& process_status_140),(size_t)4); waitpid(pid_140,& process_status_140,0); signal_eval(process_status_140,0,__gen_e_acsl_literal_string_206); __e_acsl_delete_block((void *)(& process_status_140)); } __e_acsl_delete_block((void *)(& pid_140)); } { pid_t pid_141 = fork(); __e_acsl_store_block((void *)(& pid_141),(size_t)4); __e_acsl_full_init((void *)(& pid_141)); if (! pid_141) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_208,i); __gen_e_acsl_exit(0); } else { int process_status_141; __e_acsl_store_block((void *)(& process_status_141),(size_t)4); waitpid(pid_141,& process_status_141,0); signal_eval(process_status_141,0,__gen_e_acsl_literal_string_206); __e_acsl_delete_block((void *)(& process_status_141)); } __e_acsl_delete_block((void *)(& pid_141)); } { pid_t pid_142 = fork(); __e_acsl_store_block((void *)(& pid_142),(size_t)4); __e_acsl_full_init((void *)(& pid_142)); if (! pid_142) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_209,i); __gen_e_acsl_exit(0); } else { int process_status_142; __e_acsl_store_block((void *)(& process_status_142),(size_t)4); waitpid(pid_142,& process_status_142,0); signal_eval(process_status_142,0,__gen_e_acsl_literal_string_206); __e_acsl_delete_block((void *)(& process_status_142)); } __e_acsl_delete_block((void *)(& pid_142)); } { pid_t pid_143 = fork(); __e_acsl_store_block((void *)(& pid_143),(size_t)4); __e_acsl_full_init((void *)(& pid_143)); if (! pid_143) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_210,i); __gen_e_acsl_exit(0); } else { int process_status_143; __e_acsl_store_block((void *)(& process_status_143),(size_t)4); waitpid(pid_143,& process_status_143,0); signal_eval(process_status_143,0,__gen_e_acsl_literal_string_211); __e_acsl_delete_block((void *)(& process_status_143)); } __e_acsl_delete_block((void *)(& pid_143)); } { pid_t pid_144 = fork(); __e_acsl_store_block((void *)(& pid_144),(size_t)4); __e_acsl_full_init((void *)(& pid_144)); if (! pid_144) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_212,i); __gen_e_acsl_exit(0); } else { int process_status_144; __e_acsl_store_block((void *)(& process_status_144),(size_t)4); waitpid(pid_144,& process_status_144,0); signal_eval(process_status_144,0,__gen_e_acsl_literal_string_211); __e_acsl_delete_block((void *)(& process_status_144)); } __e_acsl_delete_block((void *)(& pid_144)); } { pid_t pid_145 = fork(); __e_acsl_store_block((void *)(& pid_145),(size_t)4); __e_acsl_full_init((void *)(& pid_145)); if (! pid_145) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_213,i); __gen_e_acsl_exit(0); } else { int process_status_145; __e_acsl_store_block((void *)(& process_status_145),(size_t)4); waitpid(pid_145,& process_status_145,0); signal_eval(process_status_145,0,__gen_e_acsl_literal_string_211); __e_acsl_delete_block((void *)(& process_status_145)); } __e_acsl_delete_block((void *)(& pid_145)); } { pid_t pid_146 = fork(); __e_acsl_store_block((void *)(& pid_146),(size_t)4); __e_acsl_full_init((void *)(& pid_146)); if (! pid_146) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_214,i); __gen_e_acsl_exit(0); } else { int process_status_146; __e_acsl_store_block((void *)(& process_status_146),(size_t)4); waitpid(pid_146,& process_status_146,0); signal_eval(process_status_146,0,__gen_e_acsl_literal_string_211); __e_acsl_delete_block((void *)(& process_status_146)); } __e_acsl_delete_block((void *)(& pid_146)); } { pid_t pid_147 = fork(); __e_acsl_store_block((void *)(& pid_147),(size_t)4); __e_acsl_full_init((void *)(& pid_147)); if (! pid_147) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_215,uimax); __gen_e_acsl_exit(0); } else { int process_status_147; __e_acsl_store_block((void *)(& process_status_147),(size_t)4); waitpid(pid_147,& process_status_147,0); signal_eval(process_status_147,0,__gen_e_acsl_literal_string_216); __e_acsl_delete_block((void *)(& process_status_147)); } __e_acsl_delete_block((void *)(& pid_147)); } { pid_t pid_148 = fork(); __e_acsl_store_block((void *)(& pid_148),(size_t)4); __e_acsl_full_init((void *)(& pid_148)); if (! pid_148) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_217,uimax); __gen_e_acsl_exit(0); } else { int process_status_148; __e_acsl_store_block((void *)(& process_status_148),(size_t)4); waitpid(pid_148,& process_status_148,0); signal_eval(process_status_148,0,__gen_e_acsl_literal_string_216); __e_acsl_delete_block((void *)(& process_status_148)); } __e_acsl_delete_block((void *)(& pid_148)); } { pid_t pid_149 = fork(); __e_acsl_store_block((void *)(& pid_149),(size_t)4); __e_acsl_full_init((void *)(& pid_149)); if (! pid_149) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_218,uimax); __gen_e_acsl_exit(0); } else { int process_status_149; __e_acsl_store_block((void *)(& process_status_149),(size_t)4); waitpid(pid_149,& process_status_149,0); signal_eval(process_status_149,0,__gen_e_acsl_literal_string_216); __e_acsl_delete_block((void *)(& process_status_149)); } __e_acsl_delete_block((void *)(& pid_149)); } { pid_t pid_150 = fork(); __e_acsl_store_block((void *)(& pid_150),(size_t)4); __e_acsl_full_init((void *)(& pid_150)); if (! pid_150) { __e_acsl_builtin_printf("R",__gen_e_acsl_literal_string_219,uimax); __gen_e_acsl_exit(0); } else { int process_status_150; __e_acsl_store_block((void *)(& process_status_150),(size_t)4); waitpid(pid_150,& process_status_150,0); signal_eval(process_status_150,0,__gen_e_acsl_literal_string_216); __e_acsl_delete_block((void *)(& process_status_150)); } __e_acsl_delete_block((void *)(& pid_150)); } { pid_t pid_151 = fork(); __e_acsl_store_block((void *)(& pid_151),(size_t)4); __e_acsl_full_init((void *)(& pid_151)); if (! pid_151) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_220,szt); __gen_e_acsl_exit(0); } else { int process_status_151; __e_acsl_store_block((void *)(& process_status_151),(size_t)4); waitpid(pid_151,& process_status_151,0); signal_eval(process_status_151,0,__gen_e_acsl_literal_string_221); __e_acsl_delete_block((void *)(& process_status_151)); } __e_acsl_delete_block((void *)(& pid_151)); } { pid_t pid_152 = fork(); __e_acsl_store_block((void *)(& pid_152),(size_t)4); __e_acsl_full_init((void *)(& pid_152)); if (! pid_152) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_222,szt); __gen_e_acsl_exit(0); } else { int process_status_152; __e_acsl_store_block((void *)(& process_status_152),(size_t)4); waitpid(pid_152,& process_status_152,0); signal_eval(process_status_152,0,__gen_e_acsl_literal_string_221); __e_acsl_delete_block((void *)(& process_status_152)); } __e_acsl_delete_block((void *)(& pid_152)); } { pid_t pid_153 = fork(); __e_acsl_store_block((void *)(& pid_153),(size_t)4); __e_acsl_full_init((void *)(& pid_153)); if (! pid_153) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_223,szt); __gen_e_acsl_exit(0); } else { int process_status_153; __e_acsl_store_block((void *)(& process_status_153),(size_t)4); waitpid(pid_153,& process_status_153,0); signal_eval(process_status_153,0,__gen_e_acsl_literal_string_221); __e_acsl_delete_block((void *)(& process_status_153)); } __e_acsl_delete_block((void *)(& pid_153)); } { pid_t pid_154 = fork(); __e_acsl_store_block((void *)(& pid_154),(size_t)4); __e_acsl_full_init((void *)(& pid_154)); if (! pid_154) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_224,szt); __gen_e_acsl_exit(0); } else { int process_status_154; __e_acsl_store_block((void *)(& process_status_154),(size_t)4); waitpid(pid_154,& process_status_154,0); signal_eval(process_status_154,0,__gen_e_acsl_literal_string_221); __e_acsl_delete_block((void *)(& process_status_154)); } __e_acsl_delete_block((void *)(& pid_154)); } { pid_t pid_155 = fork(); __e_acsl_store_block((void *)(& pid_155),(size_t)4); __e_acsl_full_init((void *)(& pid_155)); if (! pid_155) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_225,lu); __gen_e_acsl_exit(0); } else { int process_status_155; __e_acsl_store_block((void *)(& process_status_155),(size_t)4); waitpid(pid_155,& process_status_155,0); signal_eval(process_status_155,0,__gen_e_acsl_literal_string_226); __e_acsl_delete_block((void *)(& process_status_155)); } __e_acsl_delete_block((void *)(& pid_155)); } { pid_t pid_156 = fork(); __e_acsl_store_block((void *)(& pid_156),(size_t)4); __e_acsl_full_init((void *)(& pid_156)); if (! pid_156) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_227,lu); __gen_e_acsl_exit(0); } else { int process_status_156; __e_acsl_store_block((void *)(& process_status_156),(size_t)4); waitpid(pid_156,& process_status_156,0); signal_eval(process_status_156,0,__gen_e_acsl_literal_string_226); __e_acsl_delete_block((void *)(& process_status_156)); } __e_acsl_delete_block((void *)(& pid_156)); } { pid_t pid_157 = fork(); __e_acsl_store_block((void *)(& pid_157),(size_t)4); __e_acsl_full_init((void *)(& pid_157)); if (! pid_157) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_228,lu); __gen_e_acsl_exit(0); } else { int process_status_157; __e_acsl_store_block((void *)(& process_status_157),(size_t)4); waitpid(pid_157,& process_status_157,0); signal_eval(process_status_157,0,__gen_e_acsl_literal_string_226); __e_acsl_delete_block((void *)(& process_status_157)); } __e_acsl_delete_block((void *)(& pid_157)); } { pid_t pid_158 = fork(); __e_acsl_store_block((void *)(& pid_158),(size_t)4); __e_acsl_full_init((void *)(& pid_158)); if (! pid_158) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_229,lu); __gen_e_acsl_exit(0); } else { int process_status_158; __e_acsl_store_block((void *)(& process_status_158),(size_t)4); waitpid(pid_158,& process_status_158,0); signal_eval(process_status_158,0,__gen_e_acsl_literal_string_226); __e_acsl_delete_block((void *)(& process_status_158)); } __e_acsl_delete_block((void *)(& pid_158)); } { pid_t pid_159 = fork(); __e_acsl_store_block((void *)(& pid_159),(size_t)4); __e_acsl_full_init((void *)(& pid_159)); if (! pid_159) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_230,dbl); __gen_e_acsl_exit(0); } else { int process_status_159; __e_acsl_store_block((void *)(& process_status_159),(size_t)4); waitpid(pid_159,& process_status_159,0); signal_eval(process_status_159,0,__gen_e_acsl_literal_string_231); __e_acsl_delete_block((void *)(& process_status_159)); } __e_acsl_delete_block((void *)(& pid_159)); } { pid_t pid_160 = fork(); __e_acsl_store_block((void *)(& pid_160),(size_t)4); __e_acsl_full_init((void *)(& pid_160)); if (! pid_160) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_232,dbl); __gen_e_acsl_exit(0); } else { int process_status_160; __e_acsl_store_block((void *)(& process_status_160),(size_t)4); waitpid(pid_160,& process_status_160,0); signal_eval(process_status_160,0,__gen_e_acsl_literal_string_231); __e_acsl_delete_block((void *)(& process_status_160)); } __e_acsl_delete_block((void *)(& pid_160)); } { pid_t pid_161 = fork(); __e_acsl_store_block((void *)(& pid_161),(size_t)4); __e_acsl_full_init((void *)(& pid_161)); if (! pid_161) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_230,ldbl); __gen_e_acsl_exit(0); } else { int process_status_161; __e_acsl_store_block((void *)(& process_status_161),(size_t)4); waitpid(pid_161,& process_status_161,0); signal_eval(process_status_161,1,__gen_e_acsl_literal_string_233); __e_acsl_delete_block((void *)(& process_status_161)); } __e_acsl_delete_block((void *)(& pid_161)); } { pid_t pid_162 = fork(); __e_acsl_store_block((void *)(& pid_162),(size_t)4); __e_acsl_full_init((void *)(& pid_162)); if (! pid_162) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_232,ldbl); __gen_e_acsl_exit(0); } else { int process_status_162; __e_acsl_store_block((void *)(& process_status_162),(size_t)4); waitpid(pid_162,& process_status_162,0); signal_eval(process_status_162,1,__gen_e_acsl_literal_string_233); __e_acsl_delete_block((void *)(& process_status_162)); } __e_acsl_delete_block((void *)(& pid_162)); } { pid_t pid_163 = fork(); __e_acsl_store_block((void *)(& pid_163),(size_t)4); __e_acsl_full_init((void *)(& pid_163)); if (! pid_163) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_230,i); __gen_e_acsl_exit(0); } else { int process_status_163; __e_acsl_store_block((void *)(& process_status_163),(size_t)4); waitpid(pid_163,& process_status_163,0); signal_eval(process_status_163,1,__gen_e_acsl_literal_string_234); __e_acsl_delete_block((void *)(& process_status_163)); } __e_acsl_delete_block((void *)(& pid_163)); } { pid_t pid_164 = fork(); __e_acsl_store_block((void *)(& pid_164),(size_t)4); __e_acsl_full_init((void *)(& pid_164)); if (! pid_164) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_232,i); __gen_e_acsl_exit(0); } else { int process_status_164; __e_acsl_store_block((void *)(& process_status_164),(size_t)4); waitpid(pid_164,& process_status_164,0); signal_eval(process_status_164,1,__gen_e_acsl_literal_string_234); __e_acsl_delete_block((void *)(& process_status_164)); } __e_acsl_delete_block((void *)(& pid_164)); } { pid_t pid_165 = fork(); __e_acsl_store_block((void *)(& pid_165),(size_t)4); __e_acsl_full_init((void *)(& pid_165)); if (! pid_165) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_230,lu); __gen_e_acsl_exit(0); } else { int process_status_165; __e_acsl_store_block((void *)(& process_status_165),(size_t)4); waitpid(pid_165,& process_status_165,0); signal_eval(process_status_165,1,__gen_e_acsl_literal_string_235); __e_acsl_delete_block((void *)(& process_status_165)); } __e_acsl_delete_block((void *)(& pid_165)); } { pid_t pid_166 = fork(); __e_acsl_store_block((void *)(& pid_166),(size_t)4); __e_acsl_full_init((void *)(& pid_166)); if (! pid_166) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_232,lu); __gen_e_acsl_exit(0); } else { int process_status_166; __e_acsl_store_block((void *)(& process_status_166),(size_t)4); waitpid(pid_166,& process_status_166,0); signal_eval(process_status_166,1,__gen_e_acsl_literal_string_235); __e_acsl_delete_block((void *)(& process_status_166)); } __e_acsl_delete_block((void *)(& pid_166)); } { pid_t pid_167 = fork(); __e_acsl_store_block((void *)(& pid_167),(size_t)4); __e_acsl_full_init((void *)(& pid_167)); if (! pid_167) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_236,dbl); __gen_e_acsl_exit(0); } else { int process_status_167; __e_acsl_store_block((void *)(& process_status_167),(size_t)4); waitpid(pid_167,& process_status_167,0); signal_eval(process_status_167,0,__gen_e_acsl_literal_string_237); __e_acsl_delete_block((void *)(& process_status_167)); } __e_acsl_delete_block((void *)(& pid_167)); } { pid_t pid_168 = fork(); __e_acsl_store_block((void *)(& pid_168),(size_t)4); __e_acsl_full_init((void *)(& pid_168)); if (! pid_168) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_238,dbl); __gen_e_acsl_exit(0); } else { int process_status_168; __e_acsl_store_block((void *)(& process_status_168),(size_t)4); waitpid(pid_168,& process_status_168,0); signal_eval(process_status_168,0,__gen_e_acsl_literal_string_237); __e_acsl_delete_block((void *)(& process_status_168)); } __e_acsl_delete_block((void *)(& pid_168)); } { pid_t pid_169 = fork(); __e_acsl_store_block((void *)(& pid_169),(size_t)4); __e_acsl_full_init((void *)(& pid_169)); if (! pid_169) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_236,ldbl); __gen_e_acsl_exit(0); } else { int process_status_169; __e_acsl_store_block((void *)(& process_status_169),(size_t)4); waitpid(pid_169,& process_status_169,0); signal_eval(process_status_169,1,__gen_e_acsl_literal_string_239); __e_acsl_delete_block((void *)(& process_status_169)); } __e_acsl_delete_block((void *)(& pid_169)); } { pid_t pid_170 = fork(); __e_acsl_store_block((void *)(& pid_170),(size_t)4); __e_acsl_full_init((void *)(& pid_170)); if (! pid_170) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_238,ldbl); __gen_e_acsl_exit(0); } else { int process_status_170; __e_acsl_store_block((void *)(& process_status_170),(size_t)4); waitpid(pid_170,& process_status_170,0); signal_eval(process_status_170,1,__gen_e_acsl_literal_string_239); __e_acsl_delete_block((void *)(& process_status_170)); } __e_acsl_delete_block((void *)(& pid_170)); } { pid_t pid_171 = fork(); __e_acsl_store_block((void *)(& pid_171),(size_t)4); __e_acsl_full_init((void *)(& pid_171)); if (! pid_171) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_236,i); __gen_e_acsl_exit(0); } else { int process_status_171; __e_acsl_store_block((void *)(& process_status_171),(size_t)4); waitpid(pid_171,& process_status_171,0); signal_eval(process_status_171,1,__gen_e_acsl_literal_string_240); __e_acsl_delete_block((void *)(& process_status_171)); } __e_acsl_delete_block((void *)(& pid_171)); } { pid_t pid_172 = fork(); __e_acsl_store_block((void *)(& pid_172),(size_t)4); __e_acsl_full_init((void *)(& pid_172)); if (! pid_172) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_238,i); __gen_e_acsl_exit(0); } else { int process_status_172; __e_acsl_store_block((void *)(& process_status_172),(size_t)4); waitpid(pid_172,& process_status_172,0); signal_eval(process_status_172,1,__gen_e_acsl_literal_string_240); __e_acsl_delete_block((void *)(& process_status_172)); } __e_acsl_delete_block((void *)(& pid_172)); } { pid_t pid_173 = fork(); __e_acsl_store_block((void *)(& pid_173),(size_t)4); __e_acsl_full_init((void *)(& pid_173)); if (! pid_173) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_236,lu); __gen_e_acsl_exit(0); } else { int process_status_173; __e_acsl_store_block((void *)(& process_status_173),(size_t)4); waitpid(pid_173,& process_status_173,0); signal_eval(process_status_173,1,__gen_e_acsl_literal_string_241); __e_acsl_delete_block((void *)(& process_status_173)); } __e_acsl_delete_block((void *)(& pid_173)); } { pid_t pid_174 = fork(); __e_acsl_store_block((void *)(& pid_174),(size_t)4); __e_acsl_full_init((void *)(& pid_174)); if (! pid_174) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_238,lu); __gen_e_acsl_exit(0); } else { int process_status_174; __e_acsl_store_block((void *)(& process_status_174),(size_t)4); waitpid(pid_174,& process_status_174,0); signal_eval(process_status_174,1,__gen_e_acsl_literal_string_241); __e_acsl_delete_block((void *)(& process_status_174)); } __e_acsl_delete_block((void *)(& pid_174)); } { pid_t pid_175 = fork(); __e_acsl_store_block((void *)(& pid_175),(size_t)4); __e_acsl_full_init((void *)(& pid_175)); if (! pid_175) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_242,dbl); __gen_e_acsl_exit(0); } else { int process_status_175; __e_acsl_store_block((void *)(& process_status_175),(size_t)4); waitpid(pid_175,& process_status_175,0); signal_eval(process_status_175,0,__gen_e_acsl_literal_string_243); __e_acsl_delete_block((void *)(& process_status_175)); } __e_acsl_delete_block((void *)(& pid_175)); } { pid_t pid_176 = fork(); __e_acsl_store_block((void *)(& pid_176),(size_t)4); __e_acsl_full_init((void *)(& pid_176)); if (! pid_176) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_244,dbl); __gen_e_acsl_exit(0); } else { int process_status_176; __e_acsl_store_block((void *)(& process_status_176),(size_t)4); waitpid(pid_176,& process_status_176,0); signal_eval(process_status_176,0,__gen_e_acsl_literal_string_243); __e_acsl_delete_block((void *)(& process_status_176)); } __e_acsl_delete_block((void *)(& pid_176)); } { pid_t pid_177 = fork(); __e_acsl_store_block((void *)(& pid_177),(size_t)4); __e_acsl_full_init((void *)(& pid_177)); if (! pid_177) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_242,ldbl); __gen_e_acsl_exit(0); } else { int process_status_177; __e_acsl_store_block((void *)(& process_status_177),(size_t)4); waitpid(pid_177,& process_status_177,0); signal_eval(process_status_177,1,__gen_e_acsl_literal_string_245); __e_acsl_delete_block((void *)(& process_status_177)); } __e_acsl_delete_block((void *)(& pid_177)); } { pid_t pid_178 = fork(); __e_acsl_store_block((void *)(& pid_178),(size_t)4); __e_acsl_full_init((void *)(& pid_178)); if (! pid_178) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_244,ldbl); __gen_e_acsl_exit(0); } else { int process_status_178; __e_acsl_store_block((void *)(& process_status_178),(size_t)4); waitpid(pid_178,& process_status_178,0); signal_eval(process_status_178,1,__gen_e_acsl_literal_string_245); __e_acsl_delete_block((void *)(& process_status_178)); } __e_acsl_delete_block((void *)(& pid_178)); } { pid_t pid_179 = fork(); __e_acsl_store_block((void *)(& pid_179),(size_t)4); __e_acsl_full_init((void *)(& pid_179)); if (! pid_179) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_242,i); __gen_e_acsl_exit(0); } else { int process_status_179; __e_acsl_store_block((void *)(& process_status_179),(size_t)4); waitpid(pid_179,& process_status_179,0); signal_eval(process_status_179,1,__gen_e_acsl_literal_string_246); __e_acsl_delete_block((void *)(& process_status_179)); } __e_acsl_delete_block((void *)(& pid_179)); } { pid_t pid_180 = fork(); __e_acsl_store_block((void *)(& pid_180),(size_t)4); __e_acsl_full_init((void *)(& pid_180)); if (! pid_180) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_244,i); __gen_e_acsl_exit(0); } else { int process_status_180; __e_acsl_store_block((void *)(& process_status_180),(size_t)4); waitpid(pid_180,& process_status_180,0); signal_eval(process_status_180,1,__gen_e_acsl_literal_string_246); __e_acsl_delete_block((void *)(& process_status_180)); } __e_acsl_delete_block((void *)(& pid_180)); } { pid_t pid_181 = fork(); __e_acsl_store_block((void *)(& pid_181),(size_t)4); __e_acsl_full_init((void *)(& pid_181)); if (! pid_181) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_242,lu); __gen_e_acsl_exit(0); } else { int process_status_181; __e_acsl_store_block((void *)(& process_status_181),(size_t)4); waitpid(pid_181,& process_status_181,0); signal_eval(process_status_181,1,__gen_e_acsl_literal_string_247); __e_acsl_delete_block((void *)(& process_status_181)); } __e_acsl_delete_block((void *)(& pid_181)); } { pid_t pid_182 = fork(); __e_acsl_store_block((void *)(& pid_182),(size_t)4); __e_acsl_full_init((void *)(& pid_182)); if (! pid_182) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_244,lu); __gen_e_acsl_exit(0); } else { int process_status_182; __e_acsl_store_block((void *)(& process_status_182),(size_t)4); waitpid(pid_182,& process_status_182,0); signal_eval(process_status_182,1,__gen_e_acsl_literal_string_247); __e_acsl_delete_block((void *)(& process_status_182)); } __e_acsl_delete_block((void *)(& pid_182)); } { pid_t pid_183 = fork(); __e_acsl_store_block((void *)(& pid_183),(size_t)4); __e_acsl_full_init((void *)(& pid_183)); if (! pid_183) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_248,dbl); __gen_e_acsl_exit(0); } else { int process_status_183; __e_acsl_store_block((void *)(& process_status_183),(size_t)4); waitpid(pid_183,& process_status_183,0); signal_eval(process_status_183,0,__gen_e_acsl_literal_string_249); __e_acsl_delete_block((void *)(& process_status_183)); } __e_acsl_delete_block((void *)(& pid_183)); } { pid_t pid_184 = fork(); __e_acsl_store_block((void *)(& pid_184),(size_t)4); __e_acsl_full_init((void *)(& pid_184)); if (! pid_184) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_250,dbl); __gen_e_acsl_exit(0); } else { int process_status_184; __e_acsl_store_block((void *)(& process_status_184),(size_t)4); waitpid(pid_184,& process_status_184,0); signal_eval(process_status_184,0,__gen_e_acsl_literal_string_249); __e_acsl_delete_block((void *)(& process_status_184)); } __e_acsl_delete_block((void *)(& pid_184)); } { pid_t pid_185 = fork(); __e_acsl_store_block((void *)(& pid_185),(size_t)4); __e_acsl_full_init((void *)(& pid_185)); if (! pid_185) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_248,ldbl); __gen_e_acsl_exit(0); } else { int process_status_185; __e_acsl_store_block((void *)(& process_status_185),(size_t)4); waitpid(pid_185,& process_status_185,0); signal_eval(process_status_185,1,__gen_e_acsl_literal_string_251); __e_acsl_delete_block((void *)(& process_status_185)); } __e_acsl_delete_block((void *)(& pid_185)); } { pid_t pid_186 = fork(); __e_acsl_store_block((void *)(& pid_186),(size_t)4); __e_acsl_full_init((void *)(& pid_186)); if (! pid_186) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_250,ldbl); __gen_e_acsl_exit(0); } else { int process_status_186; __e_acsl_store_block((void *)(& process_status_186),(size_t)4); waitpid(pid_186,& process_status_186,0); signal_eval(process_status_186,1,__gen_e_acsl_literal_string_251); __e_acsl_delete_block((void *)(& process_status_186)); } __e_acsl_delete_block((void *)(& pid_186)); } { pid_t pid_187 = fork(); __e_acsl_store_block((void *)(& pid_187),(size_t)4); __e_acsl_full_init((void *)(& pid_187)); if (! pid_187) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_248,i); __gen_e_acsl_exit(0); } else { int process_status_187; __e_acsl_store_block((void *)(& process_status_187),(size_t)4); waitpid(pid_187,& process_status_187,0); signal_eval(process_status_187,1,__gen_e_acsl_literal_string_252); __e_acsl_delete_block((void *)(& process_status_187)); } __e_acsl_delete_block((void *)(& pid_187)); } { pid_t pid_188 = fork(); __e_acsl_store_block((void *)(& pid_188),(size_t)4); __e_acsl_full_init((void *)(& pid_188)); if (! pid_188) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_250,i); __gen_e_acsl_exit(0); } else { int process_status_188; __e_acsl_store_block((void *)(& process_status_188),(size_t)4); waitpid(pid_188,& process_status_188,0); signal_eval(process_status_188,1,__gen_e_acsl_literal_string_252); __e_acsl_delete_block((void *)(& process_status_188)); } __e_acsl_delete_block((void *)(& pid_188)); } { pid_t pid_189 = fork(); __e_acsl_store_block((void *)(& pid_189),(size_t)4); __e_acsl_full_init((void *)(& pid_189)); if (! pid_189) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_248,lu); __gen_e_acsl_exit(0); } else { int process_status_189; __e_acsl_store_block((void *)(& process_status_189),(size_t)4); waitpid(pid_189,& process_status_189,0); signal_eval(process_status_189,1,__gen_e_acsl_literal_string_253); __e_acsl_delete_block((void *)(& process_status_189)); } __e_acsl_delete_block((void *)(& pid_189)); } { pid_t pid_190 = fork(); __e_acsl_store_block((void *)(& pid_190),(size_t)4); __e_acsl_full_init((void *)(& pid_190)); if (! pid_190) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_250,lu); __gen_e_acsl_exit(0); } else { int process_status_190; __e_acsl_store_block((void *)(& process_status_190),(size_t)4); waitpid(pid_190,& process_status_190,0); signal_eval(process_status_190,1,__gen_e_acsl_literal_string_253); __e_acsl_delete_block((void *)(& process_status_190)); } __e_acsl_delete_block((void *)(& pid_190)); } { pid_t pid_191 = fork(); __e_acsl_store_block((void *)(& pid_191),(size_t)4); __e_acsl_full_init((void *)(& pid_191)); if (! pid_191) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_254,dbl); __gen_e_acsl_exit(0); } else { int process_status_191; __e_acsl_store_block((void *)(& process_status_191),(size_t)4); waitpid(pid_191,& process_status_191,0); signal_eval(process_status_191,1,__gen_e_acsl_literal_string_255); __e_acsl_delete_block((void *)(& process_status_191)); } __e_acsl_delete_block((void *)(& pid_191)); } { pid_t pid_192 = fork(); __e_acsl_store_block((void *)(& pid_192),(size_t)4); __e_acsl_full_init((void *)(& pid_192)); if (! pid_192) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_256,dbl); __gen_e_acsl_exit(0); } else { int process_status_192; __e_acsl_store_block((void *)(& process_status_192),(size_t)4); waitpid(pid_192,& process_status_192,0); signal_eval(process_status_192,1,__gen_e_acsl_literal_string_255); __e_acsl_delete_block((void *)(& process_status_192)); } __e_acsl_delete_block((void *)(& pid_192)); } { pid_t pid_193 = fork(); __e_acsl_store_block((void *)(& pid_193),(size_t)4); __e_acsl_full_init((void *)(& pid_193)); if (! pid_193) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_254,ldbl); __gen_e_acsl_exit(0); } else { int process_status_193; __e_acsl_store_block((void *)(& process_status_193),(size_t)4); waitpid(pid_193,& process_status_193,0); signal_eval(process_status_193,0,__gen_e_acsl_literal_string_257); __e_acsl_delete_block((void *)(& process_status_193)); } __e_acsl_delete_block((void *)(& pid_193)); } { pid_t pid_194 = fork(); __e_acsl_store_block((void *)(& pid_194),(size_t)4); __e_acsl_full_init((void *)(& pid_194)); if (! pid_194) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_256,ldbl); __gen_e_acsl_exit(0); } else { int process_status_194; __e_acsl_store_block((void *)(& process_status_194),(size_t)4); waitpid(pid_194,& process_status_194,0); signal_eval(process_status_194,0,__gen_e_acsl_literal_string_257); __e_acsl_delete_block((void *)(& process_status_194)); } __e_acsl_delete_block((void *)(& pid_194)); } { pid_t pid_195 = fork(); __e_acsl_store_block((void *)(& pid_195),(size_t)4); __e_acsl_full_init((void *)(& pid_195)); if (! pid_195) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_254,i); __gen_e_acsl_exit(0); } else { int process_status_195; __e_acsl_store_block((void *)(& process_status_195),(size_t)4); waitpid(pid_195,& process_status_195,0); signal_eval(process_status_195,1,__gen_e_acsl_literal_string_258); __e_acsl_delete_block((void *)(& process_status_195)); } __e_acsl_delete_block((void *)(& pid_195)); } { pid_t pid_196 = fork(); __e_acsl_store_block((void *)(& pid_196),(size_t)4); __e_acsl_full_init((void *)(& pid_196)); if (! pid_196) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_256,i); __gen_e_acsl_exit(0); } else { int process_status_196; __e_acsl_store_block((void *)(& process_status_196),(size_t)4); waitpid(pid_196,& process_status_196,0); signal_eval(process_status_196,1,__gen_e_acsl_literal_string_258); __e_acsl_delete_block((void *)(& process_status_196)); } __e_acsl_delete_block((void *)(& pid_196)); } { pid_t pid_197 = fork(); __e_acsl_store_block((void *)(& pid_197),(size_t)4); __e_acsl_full_init((void *)(& pid_197)); if (! pid_197) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_254,lu); __gen_e_acsl_exit(0); } else { int process_status_197; __e_acsl_store_block((void *)(& process_status_197),(size_t)4); waitpid(pid_197,& process_status_197,0); signal_eval(process_status_197,1,__gen_e_acsl_literal_string_259); __e_acsl_delete_block((void *)(& process_status_197)); } __e_acsl_delete_block((void *)(& pid_197)); } { pid_t pid_198 = fork(); __e_acsl_store_block((void *)(& pid_198),(size_t)4); __e_acsl_full_init((void *)(& pid_198)); if (! pid_198) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_256,lu); __gen_e_acsl_exit(0); } else { int process_status_198; __e_acsl_store_block((void *)(& process_status_198),(size_t)4); waitpid(pid_198,& process_status_198,0); signal_eval(process_status_198,1,__gen_e_acsl_literal_string_259); __e_acsl_delete_block((void *)(& process_status_198)); } __e_acsl_delete_block((void *)(& pid_198)); } { pid_t pid_199 = fork(); __e_acsl_store_block((void *)(& pid_199),(size_t)4); __e_acsl_full_init((void *)(& pid_199)); if (! pid_199) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_260,dbl); __gen_e_acsl_exit(0); } else { int process_status_199; __e_acsl_store_block((void *)(& process_status_199),(size_t)4); waitpid(pid_199,& process_status_199,0); signal_eval(process_status_199,1,__gen_e_acsl_literal_string_261); __e_acsl_delete_block((void *)(& process_status_199)); } __e_acsl_delete_block((void *)(& pid_199)); } { pid_t pid_200 = fork(); __e_acsl_store_block((void *)(& pid_200),(size_t)4); __e_acsl_full_init((void *)(& pid_200)); if (! pid_200) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_262,dbl); __gen_e_acsl_exit(0); } else { int process_status_200; __e_acsl_store_block((void *)(& process_status_200),(size_t)4); waitpid(pid_200,& process_status_200,0); signal_eval(process_status_200,1,__gen_e_acsl_literal_string_261); __e_acsl_delete_block((void *)(& process_status_200)); } __e_acsl_delete_block((void *)(& pid_200)); } { pid_t pid_201 = fork(); __e_acsl_store_block((void *)(& pid_201),(size_t)4); __e_acsl_full_init((void *)(& pid_201)); if (! pid_201) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_260,ldbl); __gen_e_acsl_exit(0); } else { int process_status_201; __e_acsl_store_block((void *)(& process_status_201),(size_t)4); waitpid(pid_201,& process_status_201,0); signal_eval(process_status_201,0,__gen_e_acsl_literal_string_263); __e_acsl_delete_block((void *)(& process_status_201)); } __e_acsl_delete_block((void *)(& pid_201)); } { pid_t pid_202 = fork(); __e_acsl_store_block((void *)(& pid_202),(size_t)4); __e_acsl_full_init((void *)(& pid_202)); if (! pid_202) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_262,ldbl); __gen_e_acsl_exit(0); } else { int process_status_202; __e_acsl_store_block((void *)(& process_status_202),(size_t)4); waitpid(pid_202,& process_status_202,0); signal_eval(process_status_202,0,__gen_e_acsl_literal_string_263); __e_acsl_delete_block((void *)(& process_status_202)); } __e_acsl_delete_block((void *)(& pid_202)); } { pid_t pid_203 = fork(); __e_acsl_store_block((void *)(& pid_203),(size_t)4); __e_acsl_full_init((void *)(& pid_203)); if (! pid_203) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_260,i); __gen_e_acsl_exit(0); } else { int process_status_203; __e_acsl_store_block((void *)(& process_status_203),(size_t)4); waitpid(pid_203,& process_status_203,0); signal_eval(process_status_203,1,__gen_e_acsl_literal_string_264); __e_acsl_delete_block((void *)(& process_status_203)); } __e_acsl_delete_block((void *)(& pid_203)); } { pid_t pid_204 = fork(); __e_acsl_store_block((void *)(& pid_204),(size_t)4); __e_acsl_full_init((void *)(& pid_204)); if (! pid_204) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_262,i); __gen_e_acsl_exit(0); } else { int process_status_204; __e_acsl_store_block((void *)(& process_status_204),(size_t)4); waitpid(pid_204,& process_status_204,0); signal_eval(process_status_204,1,__gen_e_acsl_literal_string_264); __e_acsl_delete_block((void *)(& process_status_204)); } __e_acsl_delete_block((void *)(& pid_204)); } { pid_t pid_205 = fork(); __e_acsl_store_block((void *)(& pid_205),(size_t)4); __e_acsl_full_init((void *)(& pid_205)); if (! pid_205) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_260,lu); __gen_e_acsl_exit(0); } else { int process_status_205; __e_acsl_store_block((void *)(& process_status_205),(size_t)4); waitpid(pid_205,& process_status_205,0); signal_eval(process_status_205,1,__gen_e_acsl_literal_string_265); __e_acsl_delete_block((void *)(& process_status_205)); } __e_acsl_delete_block((void *)(& pid_205)); } { pid_t pid_206 = fork(); __e_acsl_store_block((void *)(& pid_206),(size_t)4); __e_acsl_full_init((void *)(& pid_206)); if (! pid_206) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_262,lu); __gen_e_acsl_exit(0); } else { int process_status_206; __e_acsl_store_block((void *)(& process_status_206),(size_t)4); waitpid(pid_206,& process_status_206,0); signal_eval(process_status_206,1,__gen_e_acsl_literal_string_265); __e_acsl_delete_block((void *)(& process_status_206)); } __e_acsl_delete_block((void *)(& pid_206)); } { pid_t pid_207 = fork(); __e_acsl_store_block((void *)(& pid_207),(size_t)4); __e_acsl_full_init((void *)(& pid_207)); if (! pid_207) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_266,dbl); __gen_e_acsl_exit(0); } else { int process_status_207; __e_acsl_store_block((void *)(& process_status_207),(size_t)4); waitpid(pid_207,& process_status_207,0); signal_eval(process_status_207,1,__gen_e_acsl_literal_string_267); __e_acsl_delete_block((void *)(& process_status_207)); } __e_acsl_delete_block((void *)(& pid_207)); } { pid_t pid_208 = fork(); __e_acsl_store_block((void *)(& pid_208),(size_t)4); __e_acsl_full_init((void *)(& pid_208)); if (! pid_208) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_268,dbl); __gen_e_acsl_exit(0); } else { int process_status_208; __e_acsl_store_block((void *)(& process_status_208),(size_t)4); waitpid(pid_208,& process_status_208,0); signal_eval(process_status_208,1,__gen_e_acsl_literal_string_267); __e_acsl_delete_block((void *)(& process_status_208)); } __e_acsl_delete_block((void *)(& pid_208)); } { pid_t pid_209 = fork(); __e_acsl_store_block((void *)(& pid_209),(size_t)4); __e_acsl_full_init((void *)(& pid_209)); if (! pid_209) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_266,ldbl); __gen_e_acsl_exit(0); } else { int process_status_209; __e_acsl_store_block((void *)(& process_status_209),(size_t)4); waitpid(pid_209,& process_status_209,0); signal_eval(process_status_209,0,__gen_e_acsl_literal_string_269); __e_acsl_delete_block((void *)(& process_status_209)); } __e_acsl_delete_block((void *)(& pid_209)); } { pid_t pid_210 = fork(); __e_acsl_store_block((void *)(& pid_210),(size_t)4); __e_acsl_full_init((void *)(& pid_210)); if (! pid_210) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_268,ldbl); __gen_e_acsl_exit(0); } else { int process_status_210; __e_acsl_store_block((void *)(& process_status_210),(size_t)4); waitpid(pid_210,& process_status_210,0); signal_eval(process_status_210,0,__gen_e_acsl_literal_string_269); __e_acsl_delete_block((void *)(& process_status_210)); } __e_acsl_delete_block((void *)(& pid_210)); } { pid_t pid_211 = fork(); __e_acsl_store_block((void *)(& pid_211),(size_t)4); __e_acsl_full_init((void *)(& pid_211)); if (! pid_211) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_266,i); __gen_e_acsl_exit(0); } else { int process_status_211; __e_acsl_store_block((void *)(& process_status_211),(size_t)4); waitpid(pid_211,& process_status_211,0); signal_eval(process_status_211,1,__gen_e_acsl_literal_string_270); __e_acsl_delete_block((void *)(& process_status_211)); } __e_acsl_delete_block((void *)(& pid_211)); } { pid_t pid_212 = fork(); __e_acsl_store_block((void *)(& pid_212),(size_t)4); __e_acsl_full_init((void *)(& pid_212)); if (! pid_212) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_268,i); __gen_e_acsl_exit(0); } else { int process_status_212; __e_acsl_store_block((void *)(& process_status_212),(size_t)4); waitpid(pid_212,& process_status_212,0); signal_eval(process_status_212,1,__gen_e_acsl_literal_string_270); __e_acsl_delete_block((void *)(& process_status_212)); } __e_acsl_delete_block((void *)(& pid_212)); } { pid_t pid_213 = fork(); __e_acsl_store_block((void *)(& pid_213),(size_t)4); __e_acsl_full_init((void *)(& pid_213)); if (! pid_213) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_266,lu); __gen_e_acsl_exit(0); } else { int process_status_213; __e_acsl_store_block((void *)(& process_status_213),(size_t)4); waitpid(pid_213,& process_status_213,0); signal_eval(process_status_213,1,__gen_e_acsl_literal_string_271); __e_acsl_delete_block((void *)(& process_status_213)); } __e_acsl_delete_block((void *)(& pid_213)); } { pid_t pid_214 = fork(); __e_acsl_store_block((void *)(& pid_214),(size_t)4); __e_acsl_full_init((void *)(& pid_214)); if (! pid_214) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_268,lu); __gen_e_acsl_exit(0); } else { int process_status_214; __e_acsl_store_block((void *)(& process_status_214),(size_t)4); waitpid(pid_214,& process_status_214,0); signal_eval(process_status_214,1,__gen_e_acsl_literal_string_271); __e_acsl_delete_block((void *)(& process_status_214)); } __e_acsl_delete_block((void *)(& pid_214)); } { pid_t pid_215 = fork(); __e_acsl_store_block((void *)(& pid_215),(size_t)4); __e_acsl_full_init((void *)(& pid_215)); if (! pid_215) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_272,dbl); __gen_e_acsl_exit(0); } else { int process_status_215; __e_acsl_store_block((void *)(& process_status_215),(size_t)4); waitpid(pid_215,& process_status_215,0); signal_eval(process_status_215,1,__gen_e_acsl_literal_string_273); __e_acsl_delete_block((void *)(& process_status_215)); } __e_acsl_delete_block((void *)(& pid_215)); } { pid_t pid_216 = fork(); __e_acsl_store_block((void *)(& pid_216),(size_t)4); __e_acsl_full_init((void *)(& pid_216)); if (! pid_216) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_274,dbl); __gen_e_acsl_exit(0); } else { int process_status_216; __e_acsl_store_block((void *)(& process_status_216),(size_t)4); waitpid(pid_216,& process_status_216,0); signal_eval(process_status_216,1,__gen_e_acsl_literal_string_273); __e_acsl_delete_block((void *)(& process_status_216)); } __e_acsl_delete_block((void *)(& pid_216)); } { pid_t pid_217 = fork(); __e_acsl_store_block((void *)(& pid_217),(size_t)4); __e_acsl_full_init((void *)(& pid_217)); if (! pid_217) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_272,ldbl); __gen_e_acsl_exit(0); } else { int process_status_217; __e_acsl_store_block((void *)(& process_status_217),(size_t)4); waitpid(pid_217,& process_status_217,0); signal_eval(process_status_217,0,__gen_e_acsl_literal_string_275); __e_acsl_delete_block((void *)(& process_status_217)); } __e_acsl_delete_block((void *)(& pid_217)); } { pid_t pid_218 = fork(); __e_acsl_store_block((void *)(& pid_218),(size_t)4); __e_acsl_full_init((void *)(& pid_218)); if (! pid_218) { __e_acsl_builtin_printf("E",__gen_e_acsl_literal_string_274,ldbl); __gen_e_acsl_exit(0); } else { int process_status_218; __e_acsl_store_block((void *)(& process_status_218),(size_t)4); waitpid(pid_218,& process_status_218,0); signal_eval(process_status_218,0,__gen_e_acsl_literal_string_275); __e_acsl_delete_block((void *)(& process_status_218)); } __e_acsl_delete_block((void *)(& pid_218)); } { pid_t pid_219 = fork(); __e_acsl_store_block((void *)(& pid_219),(size_t)4); __e_acsl_full_init((void *)(& pid_219)); if (! pid_219) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_272,i); __gen_e_acsl_exit(0); } else { int process_status_219; __e_acsl_store_block((void *)(& process_status_219),(size_t)4); waitpid(pid_219,& process_status_219,0); signal_eval(process_status_219,1,__gen_e_acsl_literal_string_276); __e_acsl_delete_block((void *)(& process_status_219)); } __e_acsl_delete_block((void *)(& pid_219)); } { pid_t pid_220 = fork(); __e_acsl_store_block((void *)(& pid_220),(size_t)4); __e_acsl_full_init((void *)(& pid_220)); if (! pid_220) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_274,i); __gen_e_acsl_exit(0); } else { int process_status_220; __e_acsl_store_block((void *)(& process_status_220),(size_t)4); waitpid(pid_220,& process_status_220,0); signal_eval(process_status_220,1,__gen_e_acsl_literal_string_276); __e_acsl_delete_block((void *)(& process_status_220)); } __e_acsl_delete_block((void *)(& pid_220)); } { pid_t pid_221 = fork(); __e_acsl_store_block((void *)(& pid_221),(size_t)4); __e_acsl_full_init((void *)(& pid_221)); if (! pid_221) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_272,lu); __gen_e_acsl_exit(0); } else { int process_status_221; __e_acsl_store_block((void *)(& process_status_221),(size_t)4); waitpid(pid_221,& process_status_221,0); signal_eval(process_status_221,1,__gen_e_acsl_literal_string_277); __e_acsl_delete_block((void *)(& process_status_221)); } __e_acsl_delete_block((void *)(& pid_221)); } { pid_t pid_222 = fork(); __e_acsl_store_block((void *)(& pid_222),(size_t)4); __e_acsl_full_init((void *)(& pid_222)); if (! pid_222) { __e_acsl_builtin_printf("L",__gen_e_acsl_literal_string_274,lu); __gen_e_acsl_exit(0); } else { int process_status_222; __e_acsl_store_block((void *)(& process_status_222),(size_t)4); waitpid(pid_222,& process_status_222,0); signal_eval(process_status_222,1,__gen_e_acsl_literal_string_277); __e_acsl_delete_block((void *)(& process_status_222)); } __e_acsl_delete_block((void *)(& pid_222)); } { pid_t pid_223 = fork(); __e_acsl_store_block((void *)(& pid_223),(size_t)4); __e_acsl_full_init((void *)(& pid_223)); if (! pid_223) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_278,i); __gen_e_acsl_exit(0); } else { int process_status_223; __e_acsl_store_block((void *)(& process_status_223),(size_t)4); waitpid(pid_223,& process_status_223,0); signal_eval(process_status_223,0,__gen_e_acsl_literal_string_279); __e_acsl_delete_block((void *)(& process_status_223)); } __e_acsl_delete_block((void *)(& pid_223)); } { pid_t pid_224 = fork(); __e_acsl_store_block((void *)(& pid_224),(size_t)4); __e_acsl_full_init((void *)(& pid_224)); if (! pid_224) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_278,(int)chr); __gen_e_acsl_exit(0); } else { int process_status_224; __e_acsl_store_block((void *)(& process_status_224),(size_t)4); waitpid(pid_224,& process_status_224,0); signal_eval(process_status_224,0,__gen_e_acsl_literal_string_280); __e_acsl_delete_block((void *)(& process_status_224)); } __e_acsl_delete_block((void *)(& pid_224)); } { pid_t pid_225 = fork(); __e_acsl_store_block((void *)(& pid_225),(size_t)4); __e_acsl_full_init((void *)(& pid_225)); if (! pid_225) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_278,(int)shrt); __gen_e_acsl_exit(0); } else { int process_status_225; __e_acsl_store_block((void *)(& process_status_225),(size_t)4); waitpid(pid_225,& process_status_225,0); signal_eval(process_status_225,0,__gen_e_acsl_literal_string_281); __e_acsl_delete_block((void *)(& process_status_225)); } __e_acsl_delete_block((void *)(& pid_225)); } { pid_t pid_226 = fork(); __e_acsl_store_block((void *)(& pid_226),(size_t)4); __e_acsl_full_init((void *)(& pid_226)); if (! pid_226) { __e_acsl_builtin_printf("D",__gen_e_acsl_literal_string_278,ui); __gen_e_acsl_exit(0); } else { int process_status_226; __e_acsl_store_block((void *)(& process_status_226),(size_t)4); waitpid(pid_226,& process_status_226,0); signal_eval(process_status_226,1,__gen_e_acsl_literal_string_282); __e_acsl_delete_block((void *)(& process_status_226)); } __e_acsl_delete_block((void *)(& pid_226)); } { pid_t pid_227 = fork(); __e_acsl_store_block((void *)(& pid_227),(size_t)4); __e_acsl_full_init((void *)(& pid_227)); if (! pid_227) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_278,li); __gen_e_acsl_exit(0); } else { int process_status_227; __e_acsl_store_block((void *)(& process_status_227),(size_t)4); waitpid(pid_227,& process_status_227,0); signal_eval(process_status_227,1,__gen_e_acsl_literal_string_283); __e_acsl_delete_block((void *)(& process_status_227)); } __e_acsl_delete_block((void *)(& pid_227)); } { pid_t pid_228 = fork(); __e_acsl_store_block((void *)(& pid_228),(size_t)4); __e_acsl_full_init((void *)(& pid_228)); if (! pid_228) { __e_acsl_builtin_printf("e",__gen_e_acsl_literal_string_278, (double)flt); __gen_e_acsl_exit(0); } else { int process_status_228; __e_acsl_store_block((void *)(& process_status_228),(size_t)4); waitpid(pid_228,& process_status_228,0); signal_eval(process_status_228,1,__gen_e_acsl_literal_string_284); __e_acsl_delete_block((void *)(& process_status_228)); } __e_acsl_delete_block((void *)(& pid_228)); } { pid_t pid_229 = fork(); __e_acsl_store_block((void *)(& pid_229),(size_t)4); __e_acsl_full_init((void *)(& pid_229)); if (! pid_229) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_278,astr); __gen_e_acsl_exit(0); } else { int process_status_229; __e_acsl_store_block((void *)(& process_status_229),(size_t)4); waitpid(pid_229,& process_status_229,0); signal_eval(process_status_229,1,__gen_e_acsl_literal_string_285); __e_acsl_delete_block((void *)(& process_status_229)); } __e_acsl_delete_block((void *)(& pid_229)); } { pid_t pid_230 = fork(); __e_acsl_store_block((void *)(& pid_230),(size_t)4); __e_acsl_full_init((void *)(& pid_230)); if (! pid_230) { __e_acsl_builtin_printf("D",__gen_e_acsl_literal_string_286,wi); __gen_e_acsl_exit(0); } else { int process_status_230; __e_acsl_store_block((void *)(& process_status_230),(size_t)4); waitpid(pid_230,& process_status_230,0); signal_eval(process_status_230,0,__gen_e_acsl_literal_string_287); __e_acsl_delete_block((void *)(& process_status_230)); } __e_acsl_delete_block((void *)(& pid_230)); } { pid_t pid_231 = fork(); __e_acsl_store_block((void *)(& pid_231),(size_t)4); __e_acsl_full_init((void *)(& pid_231)); if (! pid_231) { __e_acsl_builtin_printf("l",__gen_e_acsl_literal_string_286,li); __gen_e_acsl_exit(0); } else { int process_status_231; __e_acsl_store_block((void *)(& process_status_231),(size_t)4); waitpid(pid_231,& process_status_231,0); signal_eval(process_status_231,1,__gen_e_acsl_literal_string_288); __e_acsl_delete_block((void *)(& process_status_231)); } __e_acsl_delete_block((void *)(& pid_231)); } { pid_t pid_232 = fork(); __e_acsl_store_block((void *)(& pid_232),(size_t)4); __e_acsl_full_init((void *)(& pid_232)); if (! pid_232) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_289,astr); __gen_e_acsl_exit(0); } else { int process_status_232; __e_acsl_store_block((void *)(& process_status_232),(size_t)4); waitpid(pid_232,& process_status_232,0); signal_eval(process_status_232,0,__gen_e_acsl_literal_string_290); __e_acsl_delete_block((void *)(& process_status_232)); } __e_acsl_delete_block((void *)(& pid_232)); } { pid_t pid_233 = fork(); __e_acsl_store_block((void *)(& pid_233),(size_t)4); __e_acsl_full_init((void *)(& pid_233)); if (! pid_233) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_289,pstr); __gen_e_acsl_exit(0); } else { int process_status_233; __e_acsl_store_block((void *)(& process_status_233),(size_t)4); waitpid(pid_233,& process_status_233,0); signal_eval(process_status_233,0,__gen_e_acsl_literal_string_291); __e_acsl_delete_block((void *)(& process_status_233)); } __e_acsl_delete_block((void *)(& pid_233)); } { pid_t pid_234 = fork(); __e_acsl_store_block((void *)(& pid_234),(size_t)4); __e_acsl_full_init((void *)(& pid_234)); if (! pid_234) { __e_acsl_builtin_printf("d",__gen_e_acsl_literal_string_289,i); __gen_e_acsl_exit(0); } else { int process_status_234; __e_acsl_store_block((void *)(& process_status_234),(size_t)4); waitpid(pid_234,& process_status_234,0); signal_eval(process_status_234,1,__gen_e_acsl_literal_string_292); __e_acsl_delete_block((void *)(& process_status_234)); } __e_acsl_delete_block((void *)(& pid_234)); } { pid_t pid_235 = fork(); __e_acsl_store_block((void *)(& pid_235),(size_t)4); __e_acsl_full_init((void *)(& pid_235)); if (! pid_235) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_289,vptr); __gen_e_acsl_exit(0); } else { int process_status_235; __e_acsl_store_block((void *)(& process_status_235),(size_t)4); waitpid(pid_235,& process_status_235,0); signal_eval(process_status_235,1,__gen_e_acsl_literal_string_293); __e_acsl_delete_block((void *)(& process_status_235)); } __e_acsl_delete_block((void *)(& pid_235)); } char *s1 = (char *)0; __e_acsl_store_block((void *)(& s1),(size_t)8); __e_acsl_full_init((void *)(& s1)); { pid_t pid_236 = fork(); __e_acsl_store_block((void *)(& pid_236),(size_t)4); __e_acsl_full_init((void *)(& pid_236)); if (! pid_236) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_289,s1); __gen_e_acsl_exit(0); } else { int process_status_236; __e_acsl_store_block((void *)(& process_status_236),(size_t)4); waitpid(pid_236,& process_status_236,0); signal_eval(process_status_236,1,__gen_e_acsl_literal_string_294); __e_acsl_delete_block((void *)(& process_status_236)); } __e_acsl_delete_block((void *)(& pid_236)); } { pid_t pid_237 = fork(); __e_acsl_store_block((void *)(& pid_237),(size_t)4); __e_acsl_full_init((void *)(& pid_237)); if (! pid_237) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_289,s2); __gen_e_acsl_exit(0); } else { int process_status_237; __e_acsl_store_block((void *)(& process_status_237),(size_t)4); waitpid(pid_237,& process_status_237,0); signal_eval(process_status_237,1,__gen_e_acsl_literal_string_295); __e_acsl_delete_block((void *)(& process_status_237)); } __e_acsl_delete_block((void *)(& pid_237)); } char s4[4] = {(char)'c', (char)'a', (char)'t', (char)'\000'}; __e_acsl_store_block((void *)(s4),(size_t)4); __e_acsl_full_init((void *)(& s4)); { pid_t pid_238 = fork(); __e_acsl_store_block((void *)(& pid_238),(size_t)4); __e_acsl_full_init((void *)(& pid_238)); if (! pid_238) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_289,s4); __gen_e_acsl_exit(0); } else { int process_status_238; __e_acsl_store_block((void *)(& process_status_238),(size_t)4); waitpid(pid_238,& process_status_238,0); signal_eval(process_status_238,0,__gen_e_acsl_literal_string_296); __e_acsl_delete_block((void *)(& process_status_238)); } __e_acsl_delete_block((void *)(& pid_238)); } __e_acsl_initialize((void *)(& s4[3]),sizeof(char)); s4[3] = (char)'s'; { pid_t pid_239 = fork(); __e_acsl_store_block((void *)(& pid_239),(size_t)4); __e_acsl_full_init((void *)(& pid_239)); if (! pid_239) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_289,s4); __gen_e_acsl_exit(0); } else { int process_status_239; __e_acsl_store_block((void *)(& process_status_239),(size_t)4); waitpid(pid_239,& process_status_239,0); signal_eval(process_status_239,1,__gen_e_acsl_literal_string_297); __e_acsl_delete_block((void *)(& process_status_239)); } __e_acsl_delete_block((void *)(& pid_239)); } { pid_t pid_240 = fork(); __e_acsl_store_block((void *)(& pid_240),(size_t)4); __e_acsl_full_init((void *)(& pid_240)); if (! pid_240) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_298,s1); __gen_e_acsl_exit(0); } else { int process_status_240; __e_acsl_store_block((void *)(& process_status_240),(size_t)4); waitpid(pid_240,& process_status_240,0); signal_eval(process_status_240,0,__gen_e_acsl_literal_string_299); __e_acsl_delete_block((void *)(& process_status_240)); } __e_acsl_delete_block((void *)(& pid_240)); } { pid_t pid_241 = fork(); __e_acsl_store_block((void *)(& pid_241),(size_t)4); __e_acsl_full_init((void *)(& pid_241)); if (! pid_241) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_300,s1); __gen_e_acsl_exit(0); } else { int process_status_241; __e_acsl_store_block((void *)(& process_status_241),(size_t)4); waitpid(pid_241,& process_status_241,0); signal_eval(process_status_241,0,__gen_e_acsl_literal_string_301); __e_acsl_delete_block((void *)(& process_status_241)); } __e_acsl_delete_block((void *)(& pid_241)); } { pid_t pid_242 = fork(); __e_acsl_store_block((void *)(& pid_242),(size_t)4); __e_acsl_full_init((void *)(& pid_242)); if (! pid_242) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_302,s4); __gen_e_acsl_exit(0); } else { int process_status_242; __e_acsl_store_block((void *)(& process_status_242),(size_t)4); waitpid(pid_242,& process_status_242,0); signal_eval(process_status_242,0,__gen_e_acsl_literal_string_303); __e_acsl_delete_block((void *)(& process_status_242)); } __e_acsl_delete_block((void *)(& pid_242)); } { pid_t pid_243 = fork(); __e_acsl_store_block((void *)(& pid_243),(size_t)4); __e_acsl_full_init((void *)(& pid_243)); if (! pid_243) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_304,s4); __gen_e_acsl_exit(0); } else { int process_status_243; __e_acsl_store_block((void *)(& process_status_243),(size_t)4); waitpid(pid_243,& process_status_243,0); signal_eval(process_status_243,0,__gen_e_acsl_literal_string_305); __e_acsl_delete_block((void *)(& process_status_243)); } __e_acsl_delete_block((void *)(& pid_243)); } { pid_t pid_244 = fork(); __e_acsl_store_block((void *)(& pid_244),(size_t)4); __e_acsl_full_init((void *)(& pid_244)); if (! pid_244) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_306,s4); __gen_e_acsl_exit(0); } else { int process_status_244; __e_acsl_store_block((void *)(& process_status_244),(size_t)4); waitpid(pid_244,& process_status_244,0); signal_eval(process_status_244,1,__gen_e_acsl_literal_string_307); __e_acsl_delete_block((void *)(& process_status_244)); } __e_acsl_delete_block((void *)(& pid_244)); } { pid_t pid_245 = fork(); __e_acsl_store_block((void *)(& pid_245),(size_t)4); __e_acsl_full_init((void *)(& pid_245)); if (! pid_245) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_308,vptr); __gen_e_acsl_exit(0); } else { int process_status_245; __e_acsl_store_block((void *)(& process_status_245),(size_t)4); waitpid(pid_245,& process_status_245,0); signal_eval(process_status_245,0,__gen_e_acsl_literal_string_309); __e_acsl_delete_block((void *)(& process_status_245)); } __e_acsl_delete_block((void *)(& pid_245)); } { pid_t pid_246 = fork(); __e_acsl_store_block((void *)(& pid_246),(size_t)4); __e_acsl_full_init((void *)(& pid_246)); if (! pid_246) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_308,astr); __gen_e_acsl_exit(0); } else { int process_status_246; __e_acsl_store_block((void *)(& process_status_246),(size_t)4); waitpid(pid_246,& process_status_246,0); signal_eval(process_status_246,1,__gen_e_acsl_literal_string_310); __e_acsl_delete_block((void *)(& process_status_246)); } __e_acsl_delete_block((void *)(& pid_246)); } { pid_t pid_247 = fork(); __e_acsl_store_block((void *)(& pid_247),(size_t)4); __e_acsl_full_init((void *)(& pid_247)); if (! pid_247) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_308,(void *)0); __gen_e_acsl_exit(0); } else { int process_status_247; __e_acsl_store_block((void *)(& process_status_247),(size_t)4); waitpid(pid_247,& process_status_247,0); signal_eval(process_status_247,1,__gen_e_acsl_literal_string_311); __e_acsl_delete_block((void *)(& process_status_247)); } __e_acsl_delete_block((void *)(& pid_247)); } { pid_t pid_248 = fork(); __e_acsl_store_block((void *)(& pid_248),(size_t)4); __e_acsl_full_init((void *)(& pid_248)); if (! pid_248) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_312,& i); __gen_e_acsl_exit(0); } else { int process_status_248; __e_acsl_store_block((void *)(& process_status_248),(size_t)4); waitpid(pid_248,& process_status_248,0); signal_eval(process_status_248,0,__gen_e_acsl_literal_string_313); __e_acsl_delete_block((void *)(& process_status_248)); } __e_acsl_delete_block((void *)(& pid_248)); } { pid_t pid_249 = fork(); __e_acsl_store_block((void *)(& pid_249),(size_t)4); __e_acsl_full_init((void *)(& pid_249)); if (! pid_249) { __e_acsl_builtin_printf("I",__gen_e_acsl_literal_string_312,& ui); __gen_e_acsl_exit(0); } else { int process_status_249; __e_acsl_store_block((void *)(& process_status_249),(size_t)4); waitpid(pid_249,& process_status_249,0); signal_eval(process_status_249,1,__gen_e_acsl_literal_string_314); __e_acsl_delete_block((void *)(& process_status_249)); } __e_acsl_delete_block((void *)(& pid_249)); } { pid_t pid_250 = fork(); __e_acsl_store_block((void *)(& pid_250),(size_t)4); __e_acsl_full_init((void *)(& pid_250)); if (! pid_250) { __e_acsl_builtin_printf("p",__gen_e_acsl_literal_string_312,(void *)0); __gen_e_acsl_exit(0); } else { int process_status_250; __e_acsl_store_block((void *)(& process_status_250),(size_t)4); waitpid(pid_250,& process_status_250,0); signal_eval(process_status_250,1,__gen_e_acsl_literal_string_315); __e_acsl_delete_block((void *)(& process_status_250)); } __e_acsl_delete_block((void *)(& pid_250)); } { pid_t pid_251 = fork(); __e_acsl_store_block((void *)(& pid_251),(size_t)4); __e_acsl_full_init((void *)(& pid_251)); if (! pid_251) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_312, (int *)pstr); __gen_e_acsl_exit(0); } else { int process_status_251; __e_acsl_store_block((void *)(& process_status_251),(size_t)4); waitpid(pid_251,& process_status_251,0); signal_eval(process_status_251,1,__gen_e_acsl_literal_string_316); __e_acsl_delete_block((void *)(& process_status_251)); } __e_acsl_delete_block((void *)(& pid_251)); } { pid_t pid_252 = fork(); __e_acsl_store_block((void *)(& pid_252),(size_t)4); __e_acsl_full_init((void *)(& pid_252)); if (! pid_252) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_317,& i); __gen_e_acsl_exit(0); } else { int process_status_252; __e_acsl_store_block((void *)(& process_status_252),(size_t)4); waitpid(pid_252,& process_status_252,0); signal_eval(process_status_252,1,__gen_e_acsl_literal_string_318); __e_acsl_delete_block((void *)(& process_status_252)); } __e_acsl_delete_block((void *)(& pid_252)); } { pid_t pid_253 = fork(); __e_acsl_store_block((void *)(& pid_253),(size_t)4); __e_acsl_full_init((void *)(& pid_253)); if (! pid_253) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_319,& i); __gen_e_acsl_exit(0); } else { int process_status_253; __e_acsl_store_block((void *)(& process_status_253),(size_t)4); waitpid(pid_253,& process_status_253,0); signal_eval(process_status_253,1,__gen_e_acsl_literal_string_320); __e_acsl_delete_block((void *)(& process_status_253)); } __e_acsl_delete_block((void *)(& pid_253)); } { pid_t pid_254 = fork(); __e_acsl_store_block((void *)(& pid_254),(size_t)4); __e_acsl_full_init((void *)(& pid_254)); if (! pid_254) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_321,& i); __gen_e_acsl_exit(0); } else { int process_status_254; __e_acsl_store_block((void *)(& process_status_254),(size_t)4); waitpid(pid_254,& process_status_254,0); signal_eval(process_status_254,1,__gen_e_acsl_literal_string_322); __e_acsl_delete_block((void *)(& process_status_254)); } __e_acsl_delete_block((void *)(& pid_254)); } { pid_t pid_255 = fork(); __e_acsl_store_block((void *)(& pid_255),(size_t)4); __e_acsl_full_init((void *)(& pid_255)); if (! pid_255) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_323,& i); __gen_e_acsl_exit(0); } else { int process_status_255; __e_acsl_store_block((void *)(& process_status_255),(size_t)4); waitpid(pid_255,& process_status_255,0); signal_eval(process_status_255,1,__gen_e_acsl_literal_string_324); __e_acsl_delete_block((void *)(& process_status_255)); } __e_acsl_delete_block((void *)(& pid_255)); } { pid_t pid_256 = fork(); __e_acsl_store_block((void *)(& pid_256),(size_t)4); __e_acsl_full_init((void *)(& pid_256)); if (! pid_256) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_325,& i); __gen_e_acsl_exit(0); } else { int process_status_256; __e_acsl_store_block((void *)(& process_status_256),(size_t)4); waitpid(pid_256,& process_status_256,0); signal_eval(process_status_256,1,__gen_e_acsl_literal_string_326); __e_acsl_delete_block((void *)(& process_status_256)); } __e_acsl_delete_block((void *)(& pid_256)); } { pid_t pid_257 = fork(); __e_acsl_store_block((void *)(& pid_257),(size_t)4); __e_acsl_full_init((void *)(& pid_257)); if (! pid_257) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_327,& i); __gen_e_acsl_exit(0); } else { int process_status_257; __e_acsl_store_block((void *)(& process_status_257),(size_t)4); waitpid(pid_257,& process_status_257,0); signal_eval(process_status_257,1,__gen_e_acsl_literal_string_328); __e_acsl_delete_block((void *)(& process_status_257)); } __e_acsl_delete_block((void *)(& pid_257)); } { pid_t pid_258 = fork(); __e_acsl_store_block((void *)(& pid_258),(size_t)4); __e_acsl_full_init((void *)(& pid_258)); if (! pid_258) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_329,& i); __gen_e_acsl_exit(0); } else { int process_status_258; __e_acsl_store_block((void *)(& process_status_258),(size_t)4); waitpid(pid_258,& process_status_258,0); signal_eval(process_status_258,1,__gen_e_acsl_literal_string_330); __e_acsl_delete_block((void *)(& process_status_258)); } __e_acsl_delete_block((void *)(& pid_258)); } { pid_t pid_259 = fork(); __e_acsl_store_block((void *)(& pid_259),(size_t)4); __e_acsl_full_init((void *)(& pid_259)); if (! pid_259) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_331,& i); __gen_e_acsl_exit(0); } else { int process_status_259; __e_acsl_store_block((void *)(& process_status_259),(size_t)4); waitpid(pid_259,& process_status_259,0); signal_eval(process_status_259,1,__gen_e_acsl_literal_string_332); __e_acsl_delete_block((void *)(& process_status_259)); } __e_acsl_delete_block((void *)(& pid_259)); } { pid_t pid_260 = fork(); __e_acsl_store_block((void *)(& pid_260),(size_t)4); __e_acsl_full_init((void *)(& pid_260)); if (! pid_260) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_331,& i); __gen_e_acsl_exit(0); } else { int process_status_260; __e_acsl_store_block((void *)(& process_status_260),(size_t)4); waitpid(pid_260,& process_status_260,0); signal_eval(process_status_260,1,__gen_e_acsl_literal_string_333); __e_acsl_delete_block((void *)(& process_status_260)); } __e_acsl_delete_block((void *)(& pid_260)); } { pid_t pid_261 = fork(); __e_acsl_store_block((void *)(& pid_261),(size_t)4); __e_acsl_full_init((void *)(& pid_261)); if (! pid_261) { __e_acsl_builtin_printf("i",__gen_e_acsl_literal_string_334,& i); __gen_e_acsl_exit(0); } else { int process_status_261; __e_acsl_store_block((void *)(& process_status_261),(size_t)4); waitpid(pid_261,& process_status_261,0); signal_eval(process_status_261,1,__gen_e_acsl_literal_string_335); __e_acsl_delete_block((void *)(& process_status_261)); } __e_acsl_delete_block((void *)(& pid_261)); } { pid_t pid_262 = fork(); __e_acsl_store_block((void *)(& pid_262),(size_t)4); __e_acsl_full_init((void *)(& pid_262)); if (! pid_262) { __e_acsl_builtin_printf("dD",__gen_e_acsl_literal_string_336,i,ui); __gen_e_acsl_exit(0); } else { int process_status_262; __e_acsl_store_block((void *)(& process_status_262),(size_t)4); waitpid(pid_262,& process_status_262,0); signal_eval(process_status_262,1,__gen_e_acsl_literal_string_337); __e_acsl_delete_block((void *)(& process_status_262)); } __e_acsl_delete_block((void *)(& pid_262)); } __e_acsl_full_init((void *)(& __retres)); __retres = 0; __e_acsl_delete_block((void *)(& argv)); __e_acsl_delete_block((void *)(& argc)); __e_acsl_delete_block((void *)(& test_specifier_application)); __e_acsl_delete_block((void *)(& apply_specifier)); __e_acsl_delete_block((void *)(& valid_specifiers)); __e_acsl_delete_block((void *)(& signal_eval)); __e_acsl_delete_block((void *)(& testno)); __e_acsl_delete_block((void *)(& __fc_p_time_tm)); __e_acsl_delete_block((void *)(& __fc_time_tm)); __e_acsl_delete_block((void *)(__fc_fds)); __e_acsl_delete_block((void *)(& __fc_fds_state)); __e_acsl_delete_block((void *)(& __fc_time)); __e_acsl_delete_block((void *)(& __fc_p_strerror)); __e_acsl_delete_block((void *)(strerror)); __e_acsl_delete_block((void *)(& __fc_strtok_ptr)); __e_acsl_delete_block((void *)(& __fc_p_fopen)); __e_acsl_delete_block((void *)(__fc_fopen)); __e_acsl_delete_block((void *)(& __fc_rand_max)); __e_acsl_delete_block((void *)(s4)); __e_acsl_delete_block((void *)(& s2)); __e_acsl_delete_block((void *)(& s1)); __e_acsl_delete_block((void *)(fmt)); __e_acsl_delete_block((void *)(& ptrdf)); __e_acsl_delete_block((void *)(& szt)); __e_acsl_delete_block((void *)(& uimax)); __e_acsl_delete_block((void *)(& imax)); __e_acsl_delete_block((void *)(& ldbl)); __e_acsl_delete_block((void *)(& dbl)); __e_acsl_delete_block((void *)(& flt)); __e_acsl_delete_block((void *)(& llu)); __e_acsl_delete_block((void *)(& lli)); __e_acsl_delete_block((void *)(& lu)); __e_acsl_delete_block((void *)(& li)); __e_acsl_delete_block((void *)(& wi)); __e_acsl_delete_block((void *)(& ui)); __e_acsl_delete_block((void *)(& i)); __e_acsl_delete_block((void *)(& ushrt)); __e_acsl_delete_block((void *)(& shrt)); __e_acsl_delete_block((void *)(& uchr)); __e_acsl_delete_block((void *)(& chr)); __e_acsl_delete_block((void *)(& vptr)); __e_acsl_delete_block((void *)(& sastr)); __e_acsl_delete_block((void *)(astr)); __e_acsl_delete_block((void *)(& pstr)); __e_acsl_delete_block((void *)(& __retres)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/gen_printf2.c0000666000000000000000000003534713571573400023576 0ustar /* Generated by Frama-C */ #include "signal.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "sys/time.h" #include "sys/wait.h" #include "time.h" #include "unistd.h" #include "wchar.h" char *__gen_e_acsl_literal_string_6; char *__gen_e_acsl_literal_string_8; char *__gen_e_acsl_literal_string_5; char *__gen_e_acsl_literal_string_9; char *__gen_e_acsl_literal_string_7; char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string_4; char *__gen_e_acsl_literal_string_3; void signal_eval(int status, int expect_signal, char const *at) { __e_acsl_store_block((void *)(& at),(size_t)8); __e_acsl_store_block((void *)(& expect_signal),(size_t)4); __e_acsl_store_block((void *)(& status),(size_t)4); int signalled = (int)((signed char)((status & 0x7f) + 1)) >> 1 > 0; __e_acsl_store_block((void *)(& signalled),(size_t)4); __e_acsl_full_init((void *)(& signalled)); if (signalled) { if (expect_signal) __e_acsl_builtin_printf("s", __gen_e_acsl_literal_string, at); else goto _LAND_1; } else _LAND_1: if (! signalled) { if (! expect_signal) __e_acsl_builtin_printf("s", __gen_e_acsl_literal_string_2, at); else goto _LAND_0; } else _LAND_0: if (! signalled) { if (expect_signal) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_3,at); __gen_e_acsl_exit(1); } else goto _LAND; } else { _LAND: ; if (signalled) if (! expect_signal) { __e_acsl_builtin_printf("s",__gen_e_acsl_literal_string_4,at); __gen_e_acsl_exit(2); } } __e_acsl_delete_block((void *)(& at)); __e_acsl_delete_block((void *)(& expect_signal)); __e_acsl_delete_block((void *)(& status)); __e_acsl_delete_block((void *)(& signalled)); return; } char const *valid_specifiers = "diouxfFeEgGaAcspn"; void apply_specifier(char *format, int spec) { int n; char *tmp_1; __e_acsl_store_block((void *)(& tmp_1),(size_t)8); __e_acsl_store_block((void *)(& n),(size_t)4); __e_acsl_store_block((void *)(& spec),(size_t)4); __e_acsl_store_block((void *)(& format),(size_t)8); void *p = (void *)0; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_full_init((void *)(& tmp_1)); tmp_1 = __gen_e_acsl_strchr(__gen_e_acsl_literal_string_5,spec); if (tmp_1 != (char *)0) __e_acsl_builtin_printf("e",(char const *)format, 1.0); else { char *tmp_0; __e_acsl_store_block((void *)(& tmp_0),(size_t)8); __e_acsl_full_init((void *)(& tmp_0)); tmp_0 = __gen_e_acsl_strchr(__gen_e_acsl_literal_string_6,spec); if (tmp_0 != (char *)0) __e_acsl_builtin_printf("D",(char const *)format, 1U); else { char *tmp; __e_acsl_store_block((void *)(& tmp),(size_t)8); __e_acsl_full_init((void *)(& tmp)); tmp = __gen_e_acsl_strchr(__gen_e_acsl_literal_string_7,spec); if (tmp != (char *)0) __e_acsl_builtin_printf("d",(char const *)format, 97); else if (spec == 's') __e_acsl_builtin_printf("s",(char const *)format, __gen_e_acsl_literal_string_8); else if (spec == 'n') __e_acsl_builtin_printf("i",(char const *)format, & n); else if (spec == 'p') __e_acsl_builtin_printf("p", (char const *)format,p); else __gen_e_acsl_abort(); __e_acsl_delete_block((void *)(& tmp)); } __e_acsl_delete_block((void *)(& tmp_0)); } __e_acsl_delete_block((void *)(& spec)); __e_acsl_delete_block((void *)(& format)); __e_acsl_delete_block((void *)(& tmp_1)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& n)); return; } /*@ assigns \nothing; */ __attribute__((__FC_BUILTIN__)) void __e_acsl_delete_block(void *); /* compiler builtin: void *__builtin_alloca(unsigned long); */ void test_specifier_application(char const *allowed, char const *fmt, int only_negative, char *at) { size_t tmp; unsigned long __lengthof_format; __e_acsl_store_block((void *)(& __lengthof_format),(size_t)8); __e_acsl_store_block((void *)(& tmp),(size_t)8); __e_acsl_store_block((void *)(& at),(size_t)8); __e_acsl_store_block((void *)(& only_negative),(size_t)4); __e_acsl_store_block((void *)(& fmt),(size_t)8); __e_acsl_store_block((void *)(& allowed),(size_t)8); __e_acsl_full_init((void *)(& tmp)); tmp = __gen_e_acsl_strlen(fmt); int len = (int)tmp; __e_acsl_store_block((void *)(& len),(size_t)4); __e_acsl_full_init((void *)(& len)); /*@ assert alloca_bounds: 0 < sizeof(char) * (len + 1) ≤ 18446744073709551615; */ { int __gen_e_acsl_and; if (0L < 1L * (len + 1L)) { __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl__2; int __gen_e_acsl_le; __gmpz_init_set_si(__gen_e_acsl_,1L * (len + 1L)); __gmpz_init_set_ui(__gen_e_acsl__2,18446744073709551615UL); __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gen_e_acsl_and = __gen_e_acsl_le <= 0; __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl__2); } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion", (char *)"test_specifier_application", (char *)"alloca_bounds: 0 < sizeof(char) * (len + 1) <= 18446744073709551615", 82); } __e_acsl_full_init((void *)(& __lengthof_format)); __lengthof_format = (unsigned long)(len + 1); char *format = __builtin_alloca(sizeof(char) * __lengthof_format); __e_acsl_store_block((void *)format,sizeof(char) * __lengthof_format); __e_acsl_store_block((void *)(& format),(size_t)8); __e_acsl_full_init((void *)(& format)); __gen_e_acsl_strcpy(format,fmt); { int i_0 = 0; __e_acsl_store_block((void *)(& i_0),(size_t)4); __e_acsl_full_init((void *)(& i_0)); while (1) { size_t tmp_3; __e_acsl_store_block((void *)(& tmp_3),(size_t)8); __e_acsl_full_init((void *)(& tmp_3)); tmp_3 = __gen_e_acsl_strlen(valid_specifiers); ; if (! ((size_t)i_0 < tmp_3)) { __e_acsl_delete_block((void *)(& tmp_3)); break; } { char *tmp_2; __e_acsl_store_block((void *)(& tmp_2),(size_t)8); int c = (int)*(valid_specifiers + i_0); __e_acsl_store_block((void *)(& c),(size_t)4); __e_acsl_full_init((void *)(& c)); __e_acsl_initialize((void *)(format + (len - 1)),sizeof(char)); *(format + (len - 1)) = (char)c; __e_acsl_full_init((void *)(& tmp_2)); tmp_2 = __gen_e_acsl_strchr(allowed,c); if (tmp_2) { if (! only_negative) { { pid_t pid = fork(); __e_acsl_store_block((void *)(& pid),(size_t)4); __e_acsl_full_init((void *)(& pid)); if (! pid) { apply_specifier(format,c); __gen_e_acsl_exit(0); } else { int process_status; __e_acsl_store_block((void *)(& process_status),(size_t)4); waitpid(pid,& process_status,0); signal_eval(process_status,0,(char const *)at); __e_acsl_delete_block((void *)(& process_status)); } __e_acsl_delete_block((void *)(& pid)); } } } else { { pid_t pid_0 = fork(); __e_acsl_store_block((void *)(& pid_0),(size_t)4); __e_acsl_full_init((void *)(& pid_0)); if (! pid_0) { apply_specifier(format,c); __gen_e_acsl_exit(0); } else { int process_status_0; __e_acsl_store_block((void *)(& process_status_0),(size_t)4); waitpid(pid_0,& process_status_0,0); signal_eval(process_status_0,1,(char const *)at); __e_acsl_delete_block((void *)(& process_status_0)); } __e_acsl_delete_block((void *)(& pid_0)); } } __e_acsl_delete_block((void *)(& tmp_2)); __e_acsl_delete_block((void *)(& c)); } __e_acsl_full_init((void *)(& i_0)); i_0 ++; __e_acsl_delete_block((void *)(& tmp_3)); } __e_acsl_delete_block((void *)(& i_0)); } __e_acsl_delete_block((void *)format); __e_acsl_delete_block((void *)(& at)); __e_acsl_delete_block((void *)(& only_negative)); __e_acsl_delete_block((void *)(& fmt)); __e_acsl_delete_block((void *)(& allowed)); __e_acsl_delete_block((void *)(& __lengthof_format)); __e_acsl_delete_block((void *)(& format)); __e_acsl_delete_block((void *)(& tmp)); __e_acsl_delete_block((void *)(& len)); return; } void __e_acsl_globals_init(void) { __gen_e_acsl_literal_string_6 = "uoxX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_6,sizeof("uoxX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_6); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_6); __gen_e_acsl_literal_string_8 = "foo"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_8,sizeof("foo")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_8); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_8); __gen_e_acsl_literal_string_5 = "fFeEgGaA"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_5, sizeof("fFeEgGaA")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_5); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_5); __gen_e_acsl_literal_string_9 = "diouxfFeEgGaAcspn"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_9, sizeof("diouxfFeEgGaAcspn")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_9); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_9); __gen_e_acsl_literal_string_7 = "dic"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_7,sizeof("dic")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_7); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_7); __gen_e_acsl_literal_string = "OK: expected signal at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string, sizeof("OK: expected signal at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_2 = "OK: Expected execution at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2, sizeof("OK: Expected execution at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string_4 = "FAIL: Unexpected signal at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_4, sizeof("FAIL: Unexpected signal at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_4); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_4); __gen_e_acsl_literal_string_3 = "FAIL: Unexpected execution at %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3, sizeof("FAIL: Unexpected execution at %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3); __e_acsl_store_block((void *)(& __gen_e_acsl_strcpy),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_strcpy)); __e_acsl_store_block((void *)(& __gen_e_acsl_strchr),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_strchr)); __e_acsl_store_block((void *)(& __gen_e_acsl_strlen),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_strlen)); __e_acsl_store_block((void *)(& __gen_e_acsl_exit),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_exit)); __e_acsl_store_block((void *)(& __gen_e_acsl_abort),(size_t)1); __e_acsl_full_init((void *)(& __gen_e_acsl_abort)); __e_acsl_store_block((void *)(& test_specifier_application),(size_t)1); __e_acsl_full_init((void *)(& test_specifier_application)); __e_acsl_store_block((void *)(& apply_specifier),(size_t)1); __e_acsl_full_init((void *)(& apply_specifier)); __e_acsl_store_block((void *)(& valid_specifiers),(size_t)8); __e_acsl_full_init((void *)(& valid_specifiers)); __e_acsl_store_block((void *)(& signal_eval),(size_t)1); __e_acsl_full_init((void *)(& signal_eval)); __e_acsl_store_block((void *)(& __fc_p_time_tm),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_time_tm)); __e_acsl_store_block((void *)(& __fc_time_tm),(size_t)36); __e_acsl_full_init((void *)(& __fc_time_tm)); __e_acsl_store_block((void *)(__fc_fds),(size_t)4096); __e_acsl_full_init((void *)(& __fc_fds)); __e_acsl_store_block((void *)(& __fc_fds_state),(size_t)4); __e_acsl_full_init((void *)(& __fc_fds_state)); __e_acsl_store_block((void *)(& __fc_time),(size_t)4); __e_acsl_full_init((void *)(& __fc_time)); __e_acsl_store_block((void *)(& __fc_p_fopen),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_fopen)); __e_acsl_store_block((void *)(__fc_fopen),(size_t)4096); __e_acsl_full_init((void *)(& __fc_fopen)); __e_acsl_store_block((void *)(& __fc_rand_max),(size_t)8); __e_acsl_full_init((void *)(& __fc_rand_max)); return; } int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& __retres),(size_t)4); __e_acsl_full_init((void *)(& __retres)); __retres = 0; __e_acsl_delete_block((void *)(& argv)); __e_acsl_delete_block((void *)(& argc)); __e_acsl_delete_block((void *)(& test_specifier_application)); __e_acsl_delete_block((void *)(& apply_specifier)); __e_acsl_delete_block((void *)(& valid_specifiers)); __e_acsl_delete_block((void *)(& signal_eval)); __e_acsl_delete_block((void *)(& __fc_p_time_tm)); __e_acsl_delete_block((void *)(& __fc_time_tm)); __e_acsl_delete_block((void *)(__fc_fds)); __e_acsl_delete_block((void *)(& __fc_fds_state)); __e_acsl_delete_block((void *)(& __fc_time)); __e_acsl_delete_block((void *)(& __fc_p_fopen)); __e_acsl_delete_block((void *)(__fc_fopen)); __e_acsl_delete_block((void *)(& __fc_rand_max)); __e_acsl_delete_block((void *)(& __retres)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/printf.0.err.oracle0000666000000000000000000000000013571573400024605 0ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/printf.0.res.oracle0000666000000000000000000001241713571573400024625 0ustar [e-acsl] beginning translation. [e-acsl] warning: annotating undefined function `abort': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] warning: annotating undefined function `exit': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] warning: annotating undefined function `strlen': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] warning: annotating undefined function `strchr': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] warning: annotating undefined function `strcpy': the generated program may miss memory instrumentation if there are memory-related annotations. FRAMAC_SHARE/libc/stdio.h:150:[kernel] warning: Neither code nor specification for function printf, generating default assigns from the prototype FRAMAC_SHARE/libc/unistd.h:785:[kernel] warning: Neither code nor specification for function fork, generating default assigns from the prototype FRAMAC_SHARE/libc/sys/wait.h:57:[kernel] warning: Neither code nor specification for function waitpid, generating default assigns from the prototype :0:[kernel] warning: Neither code nor specification for function __fc_vla_free, generating default assigns from the prototype :0:[kernel] warning: Neither code nor specification for function __fc_vla_alloc, generating default assigns from the prototype FRAMAC_SHARE/libc/string.h:221:[e-acsl] warning: E-ACSL construct `logic function application' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:222:[e-acsl] warning: E-ACSL construct `trange' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:224:[e-acsl] warning: E-ACSL construct `\separated' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:224:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:227:[e-acsl] warning: E-ACSL construct `logic function returning an integer' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:227:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:124:[e-acsl] warning: E-ACSL construct `logic function application' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:127:[e-acsl] warning: E-ACSL construct `user-defined logic type' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:134:[e-acsl] warning: E-ACSL construct `user-defined logic type' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:92:[e-acsl] warning: E-ACSL construct `logic function application' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:92:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:94:[e-acsl] warning: E-ACSL construct `logic function returning an integer' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:94:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/stdlib.h:396:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [value] Analyzing a complete application starting at main [value] Computing initial state [value] Initial state computed [value:initial-state] Values of globals at initialization __fc_rand_max ∈ {32767} __fc_heap_status ∈ [--..--] __e_acsl_init ∈ [--..--] __fc_fopen[0..511] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __e_acsl_internal_heap ∈ [--..--] __e_acsl_heap_allocation_size ∈ [--..--] __e_acsl_math_HUGE_VAL ∈ [-1.79769313486e+308 .. 1.79769313486e+308] __e_acsl_math_HUGE_VALF ∈ [-3.40282346639e+38 .. 3.40282346639e+38] __e_acsl_math_INFINITY ∈ [-1.79769313486e+308 .. 1.79769313486e+308] __fc_time ∈ [--..--] __fc_fds_state ∈ [--..--] __fc_fds[0..1023] ∈ {0} __fc_time_tm ∈ {0} __fc_p_time_tm ∈ {{ &__fc_time_tm }} valid_specifiers ∈ {{ "diouxfFeEgGaAcspn" }} __gen_e_acsl_literal_string ∈ {0} __gen_e_acsl_literal_string_2 ∈ {0} __gen_e_acsl_literal_string_3 ∈ {0} __gen_e_acsl_literal_string_4 ∈ {0} __gen_e_acsl_literal_string_5 ∈ {0} __gen_e_acsl_literal_string_6 ∈ {0} __gen_e_acsl_literal_string_7 ∈ {0} __gen_e_acsl_literal_string_8 ∈ {0} [value] using specification for function __e_acsl_memory_init [value] using specification for function __e_acsl_store_block [value] using specification for function __e_acsl_full_init [value] using specification for function __e_acsl_mark_readonly [value] using specification for function __e_acsl_delete_block [value] using specification for function __e_acsl_memory_clean [value] done for function main frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/printf.1.err.oracle0000666000000000000000000000000013571573400024606 0ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/printf.1.res.oracle0000666000000000000000000001246713571573400024633 0ustar [e-acsl] beginning translation. [e-acsl] warning: annotating undefined function `abort': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] warning: annotating undefined function `exit': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] warning: annotating undefined function `strlen': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] warning: annotating undefined function `strchr': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] warning: annotating undefined function `strcpy': the generated program may miss memory instrumentation if there are memory-related annotations. FRAMAC_SHARE/libc/stdio.h:150:[kernel] warning: Neither code nor specification for function printf, generating default assigns from the prototype FRAMAC_SHARE/libc/unistd.h:785:[kernel] warning: Neither code nor specification for function fork, generating default assigns from the prototype FRAMAC_SHARE/libc/sys/wait.h:57:[kernel] warning: Neither code nor specification for function waitpid, generating default assigns from the prototype :0:[kernel] warning: Neither code nor specification for function __fc_vla_free, generating default assigns from the prototype :0:[kernel] warning: Neither code nor specification for function __fc_vla_alloc, generating default assigns from the prototype FRAMAC_SHARE/libc/string.h:221:[e-acsl] warning: E-ACSL construct `logic function application' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:222:[e-acsl] warning: E-ACSL construct `trange' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:224:[e-acsl] warning: E-ACSL construct `\separated' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:224:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:227:[e-acsl] warning: E-ACSL construct `logic function returning an integer' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:227:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:124:[e-acsl] warning: E-ACSL construct `logic function application' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:127:[e-acsl] warning: E-ACSL construct `user-defined logic type' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:134:[e-acsl] warning: E-ACSL construct `user-defined logic type' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:92:[e-acsl] warning: E-ACSL construct `logic function application' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:92:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:94:[e-acsl] warning: E-ACSL construct `logic function returning an integer' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/string.h:94:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. FRAMAC_SHARE/libc/stdlib.h:396:[e-acsl] warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [value] Analyzing a complete application starting at main [value] Computing initial state [value] Initial state computed [value:initial-state] Values of globals at initialization __fc_rand_max ∈ {32767} __fc_heap_status ∈ [--..--] __e_acsl_init ∈ [--..--] __fc_fopen[0..511] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __e_acsl_internal_heap ∈ [--..--] __e_acsl_heap_allocation_size ∈ [--..--] __e_acsl_math_HUGE_VAL ∈ [-1.79769313486e+308 .. 1.79769313486e+308] __e_acsl_math_HUGE_VALF ∈ [-3.40282346639e+38 .. 3.40282346639e+38] __e_acsl_math_INFINITY ∈ [-1.79769313486e+308 .. 1.79769313486e+308] __fc_time ∈ [--..--] __fc_fds_state ∈ [--..--] __fc_fds[0..1023] ∈ {0} __fc_time_tm ∈ {0} __fc_p_time_tm ∈ {{ &__fc_time_tm }} valid_specifiers ∈ {{ "diouxfFeEgGaAcspn" }} __gen_e_acsl_literal_string ∈ {0} __gen_e_acsl_literal_string_2 ∈ {0} __gen_e_acsl_literal_string_3 ∈ {0} __gen_e_acsl_literal_string_4 ∈ {0} __gen_e_acsl_literal_string_5 ∈ {0} __gen_e_acsl_literal_string_6 ∈ {0} __gen_e_acsl_literal_string_7 ∈ {0} __gen_e_acsl_literal_string_8 ∈ {0} __gen_e_acsl_literal_string_9 ∈ {0} [value] using specification for function __e_acsl_memory_init [value] using specification for function __e_acsl_store_block [value] using specification for function __e_acsl_full_init [value] using specification for function __e_acsl_mark_readonly [value] using specification for function __e_acsl_delete_block [value] using specification for function __e_acsl_memory_clean [value] done for function main frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/printf.err.oracle0000666000000000000000000000000013571573400024447 0ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/oracle_ci/printf.res.oracle0000666000000000000000000004772713571573400024503 0ustar [kernel:parser:decimal-float] tests/format/printf.c:88: Warning: Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [e-acsl] beginning translation. [e-acsl] Warning: annotating undefined function `abort': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] Warning: annotating undefined function `exit': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] Warning: annotating undefined function `strlen': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] Warning: annotating undefined function `strchr': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] Warning: annotating undefined function `strcpy': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] FRAMAC_SHARE/libc/string.h:327: Warning: E-ACSL construct `logic functions with labels' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:328: Warning: E-ACSL construct `logic function returning an integer' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:330: Warning: E-ACSL construct `\separated' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:330: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:333: Warning: E-ACSL construct `logic functions performing read accesses' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:143: Warning: E-ACSL construct `logic functions with labels' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:157: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:146: Warning: E-ACSL construct `logic functions performing read accesses' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:146: Warning: E-ACSL construct `logic functions performing read accesses' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:153: Warning: E-ACSL construct `logic functions performing read accesses' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:111: Warning: E-ACSL construct `logic functions with labels' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:111: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:113: Warning: E-ACSL construct `logic functions performing read accesses' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:113: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/stdlib.h:406: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [value] Analyzing a complete application starting at main [value] Computing initial state [value] Initial state computed [value:initial-state] Values of globals at initialization __e_acsl_init ∈ [--..--] __e_acsl_heap_allocation_size ∈ [--..--] __e_acsl_math_HUGE_VAL ∈ [-1.79769313486e+308 .. 1.79769313486e+308] __e_acsl_math_HUGE_VALF ∈ [-3.40282346639e+38 .. 3.40282346639e+38] __e_acsl_math_INFINITY ∈ [-1.79769313486e+308 .. 1.79769313486e+308] testno ∈ {0} valid_specifiers ∈ {{ "diouxfFeEgGaAcspn" }} __gen_e_acsl_literal_string ∈ {0} __gen_e_acsl_literal_string_2 ∈ {0} __gen_e_acsl_literal_string_3 ∈ {0} __gen_e_acsl_literal_string_4 ∈ {0} __gen_e_acsl_literal_string_5 ∈ {0} __gen_e_acsl_literal_string_6 ∈ {0} __gen_e_acsl_literal_string_7 ∈ {0} __gen_e_acsl_literal_string_8 ∈ {0} __gen_e_acsl_literal_string_9 ∈ {0} __gen_e_acsl_literal_string_10 ∈ {0} __gen_e_acsl_literal_string_11 ∈ {0} __gen_e_acsl_literal_string_12 ∈ {0} __gen_e_acsl_literal_string_13 ∈ {0} __gen_e_acsl_literal_string_14 ∈ {0} __gen_e_acsl_literal_string_15 ∈ {0} __gen_e_acsl_literal_string_16 ∈ {0} __gen_e_acsl_literal_string_17 ∈ {0} __gen_e_acsl_literal_string_18 ∈ {0} __gen_e_acsl_literal_string_19 ∈ {0} __gen_e_acsl_literal_string_20 ∈ {0} __gen_e_acsl_literal_string_21 ∈ {0} __gen_e_acsl_literal_string_22 ∈ {0} __gen_e_acsl_literal_string_23 ∈ {0} __gen_e_acsl_literal_string_24 ∈ {0} __gen_e_acsl_literal_string_25 ∈ {0} __gen_e_acsl_literal_string_26 ∈ {0} __gen_e_acsl_literal_string_27 ∈ {0} __gen_e_acsl_literal_string_28 ∈ {0} __gen_e_acsl_literal_string_29 ∈ {0} __gen_e_acsl_literal_string_30 ∈ {0} __gen_e_acsl_literal_string_31 ∈ {0} __gen_e_acsl_literal_string_32 ∈ {0} __gen_e_acsl_literal_string_33 ∈ {0} __gen_e_acsl_literal_string_34 ∈ {0} __gen_e_acsl_literal_string_35 ∈ {0} __gen_e_acsl_literal_string_36 ∈ {0} __gen_e_acsl_literal_string_37 ∈ {0} __gen_e_acsl_literal_string_38 ∈ {0} __gen_e_acsl_literal_string_39 ∈ {0} __gen_e_acsl_literal_string_40 ∈ {0} __gen_e_acsl_literal_string_41 ∈ {0} __gen_e_acsl_literal_string_42 ∈ {0} __gen_e_acsl_literal_string_43 ∈ {0} __gen_e_acsl_literal_string_44 ∈ {0} __gen_e_acsl_literal_string_45 ∈ {0} __gen_e_acsl_literal_string_46 ∈ {0} __gen_e_acsl_literal_string_47 ∈ {0} __gen_e_acsl_literal_string_48 ∈ {0} __gen_e_acsl_literal_string_49 ∈ {0} __gen_e_acsl_literal_string_50 ∈ {0} __gen_e_acsl_literal_string_51 ∈ {0} __gen_e_acsl_literal_string_52 ∈ {0} __gen_e_acsl_literal_string_53 ∈ {0} __gen_e_acsl_literal_string_54 ∈ {0} __gen_e_acsl_literal_string_55 ∈ {0} __gen_e_acsl_literal_string_56 ∈ {0} __gen_e_acsl_literal_string_57 ∈ {0} __gen_e_acsl_literal_string_58 ∈ {0} __gen_e_acsl_literal_string_59 ∈ {0} __gen_e_acsl_literal_string_60 ∈ {0} __gen_e_acsl_literal_string_61 ∈ {0} __gen_e_acsl_literal_string_62 ∈ {0} __gen_e_acsl_literal_string_63 ∈ {0} __gen_e_acsl_literal_string_64 ∈ {0} __gen_e_acsl_literal_string_65 ∈ {0} __gen_e_acsl_literal_string_66 ∈ {0} __gen_e_acsl_literal_string_67 ∈ {0} __gen_e_acsl_literal_string_68 ∈ {0} __gen_e_acsl_literal_string_69 ∈ {0} __gen_e_acsl_literal_string_70 ∈ {0} __gen_e_acsl_literal_string_71 ∈ {0} __gen_e_acsl_literal_string_72 ∈ {0} __gen_e_acsl_literal_string_73 ∈ {0} __gen_e_acsl_literal_string_74 ∈ {0} __gen_e_acsl_literal_string_75 ∈ {0} __gen_e_acsl_literal_string_76 ∈ {0} __gen_e_acsl_literal_string_77 ∈ {0} __gen_e_acsl_literal_string_78 ∈ {0} __gen_e_acsl_literal_string_79 ∈ {0} __gen_e_acsl_literal_string_80 ∈ {0} __gen_e_acsl_literal_string_81 ∈ {0} __gen_e_acsl_literal_string_82 ∈ {0} __gen_e_acsl_literal_string_83 ∈ {0} __gen_e_acsl_literal_string_84 ∈ {0} __gen_e_acsl_literal_string_85 ∈ {0} __gen_e_acsl_literal_string_86 ∈ {0} __gen_e_acsl_literal_string_87 ∈ {0} __gen_e_acsl_literal_string_88 ∈ {0} __gen_e_acsl_literal_string_89 ∈ {0} __gen_e_acsl_literal_string_90 ∈ {0} __gen_e_acsl_literal_string_91 ∈ {0} __gen_e_acsl_literal_string_92 ∈ {0} __gen_e_acsl_literal_string_93 ∈ {0} __gen_e_acsl_literal_string_94 ∈ {0} __gen_e_acsl_literal_string_95 ∈ {0} __gen_e_acsl_literal_string_96 ∈ {0} __gen_e_acsl_literal_string_97 ∈ {0} __gen_e_acsl_literal_string_98 ∈ {0} __gen_e_acsl_literal_string_99 ∈ {0} __gen_e_acsl_literal_string_100 ∈ {0} __gen_e_acsl_literal_string_101 ∈ {0} __gen_e_acsl_literal_string_102 ∈ {0} __gen_e_acsl_literal_string_103 ∈ {0} __gen_e_acsl_literal_string_104 ∈ {0} __gen_e_acsl_literal_string_105 ∈ {0} __gen_e_acsl_literal_string_106 ∈ {0} __gen_e_acsl_literal_string_107 ∈ {0} __gen_e_acsl_literal_string_108 ∈ {0} __gen_e_acsl_literal_string_109 ∈ {0} __gen_e_acsl_literal_string_110 ∈ {0} __gen_e_acsl_literal_string_111 ∈ {0} __gen_e_acsl_literal_string_112 ∈ {0} __gen_e_acsl_literal_string_113 ∈ {0} __gen_e_acsl_literal_string_114 ∈ {0} __gen_e_acsl_literal_string_115 ∈ {0} __gen_e_acsl_literal_string_116 ∈ {0} __gen_e_acsl_literal_string_117 ∈ {0} __gen_e_acsl_literal_string_118 ∈ {0} __gen_e_acsl_literal_string_119 ∈ {0} __gen_e_acsl_literal_string_120 ∈ {0} __gen_e_acsl_literal_string_121 ∈ {0} __gen_e_acsl_literal_string_122 ∈ {0} __gen_e_acsl_literal_string_123 ∈ {0} __gen_e_acsl_literal_string_124 ∈ {0} __gen_e_acsl_literal_string_125 ∈ {0} __gen_e_acsl_literal_string_126 ∈ {0} __gen_e_acsl_literal_string_127 ∈ {0} __gen_e_acsl_literal_string_128 ∈ {0} __gen_e_acsl_literal_string_129 ∈ {0} __gen_e_acsl_literal_string_130 ∈ {0} __gen_e_acsl_literal_string_131 ∈ {0} __gen_e_acsl_literal_string_132 ∈ {0} __gen_e_acsl_literal_string_133 ∈ {0} __gen_e_acsl_literal_string_134 ∈ {0} __gen_e_acsl_literal_string_135 ∈ {0} __gen_e_acsl_literal_string_136 ∈ {0} __gen_e_acsl_literal_string_137 ∈ {0} __gen_e_acsl_literal_string_138 ∈ {0} __gen_e_acsl_literal_string_139 ∈ {0} __gen_e_acsl_literal_string_140 ∈ {0} __gen_e_acsl_literal_string_141 ∈ {0} __gen_e_acsl_literal_string_142 ∈ {0} __gen_e_acsl_literal_string_143 ∈ {0} __gen_e_acsl_literal_string_144 ∈ {0} __gen_e_acsl_literal_string_145 ∈ {0} __gen_e_acsl_literal_string_146 ∈ {0} __gen_e_acsl_literal_string_147 ∈ {0} __gen_e_acsl_literal_string_148 ∈ {0} __gen_e_acsl_literal_string_149 ∈ {0} __gen_e_acsl_literal_string_150 ∈ {0} __gen_e_acsl_literal_string_151 ∈ {0} __gen_e_acsl_literal_string_152 ∈ {0} __gen_e_acsl_literal_string_153 ∈ {0} __gen_e_acsl_literal_string_154 ∈ {0} __gen_e_acsl_literal_string_155 ∈ {0} __gen_e_acsl_literal_string_156 ∈ {0} __gen_e_acsl_literal_string_157 ∈ {0} __gen_e_acsl_literal_string_158 ∈ {0} __gen_e_acsl_literal_string_159 ∈ {0} __gen_e_acsl_literal_string_160 ∈ {0} __gen_e_acsl_literal_string_161 ∈ {0} __gen_e_acsl_literal_string_162 ∈ {0} __gen_e_acsl_literal_string_163 ∈ {0} __gen_e_acsl_literal_string_164 ∈ {0} __gen_e_acsl_literal_string_165 ∈ {0} __gen_e_acsl_literal_string_166 ∈ {0} __gen_e_acsl_literal_string_167 ∈ {0} __gen_e_acsl_literal_string_168 ∈ {0} __gen_e_acsl_literal_string_169 ∈ {0} __gen_e_acsl_literal_string_170 ∈ {0} __gen_e_acsl_literal_string_171 ∈ {0} __gen_e_acsl_literal_string_172 ∈ {0} __gen_e_acsl_literal_string_173 ∈ {0} __gen_e_acsl_literal_string_174 ∈ {0} __gen_e_acsl_literal_string_175 ∈ {0} __gen_e_acsl_literal_string_176 ∈ {0} __gen_e_acsl_literal_string_177 ∈ {0} __gen_e_acsl_literal_string_178 ∈ {0} __gen_e_acsl_literal_string_179 ∈ {0} __gen_e_acsl_literal_string_180 ∈ {0} __gen_e_acsl_literal_string_181 ∈ {0} __gen_e_acsl_literal_string_182 ∈ {0} __gen_e_acsl_literal_string_183 ∈ {0} __gen_e_acsl_literal_string_184 ∈ {0} __gen_e_acsl_literal_string_185 ∈ {0} __gen_e_acsl_literal_string_186 ∈ {0} __gen_e_acsl_literal_string_187 ∈ {0} __gen_e_acsl_literal_string_188 ∈ {0} __gen_e_acsl_literal_string_189 ∈ {0} __gen_e_acsl_literal_string_190 ∈ {0} __gen_e_acsl_literal_string_191 ∈ {0} __gen_e_acsl_literal_string_192 ∈ {0} __gen_e_acsl_literal_string_193 ∈ {0} __gen_e_acsl_literal_string_194 ∈ {0} __gen_e_acsl_literal_string_195 ∈ {0} __gen_e_acsl_literal_string_196 ∈ {0} __gen_e_acsl_literal_string_197 ∈ {0} __gen_e_acsl_literal_string_198 ∈ {0} __gen_e_acsl_literal_string_199 ∈ {0} __gen_e_acsl_literal_string_200 ∈ {0} __gen_e_acsl_literal_string_201 ∈ {0} __gen_e_acsl_literal_string_202 ∈ {0} __gen_e_acsl_literal_string_203 ∈ {0} __gen_e_acsl_literal_string_204 ∈ {0} __gen_e_acsl_literal_string_205 ∈ {0} __gen_e_acsl_literal_string_206 ∈ {0} __gen_e_acsl_literal_string_207 ∈ {0} __gen_e_acsl_literal_string_208 ∈ {0} __gen_e_acsl_literal_string_209 ∈ {0} __gen_e_acsl_literal_string_210 ∈ {0} __gen_e_acsl_literal_string_211 ∈ {0} __gen_e_acsl_literal_string_212 ∈ {0} __gen_e_acsl_literal_string_213 ∈ {0} __gen_e_acsl_literal_string_214 ∈ {0} __gen_e_acsl_literal_string_215 ∈ {0} __gen_e_acsl_literal_string_216 ∈ {0} __gen_e_acsl_literal_string_217 ∈ {0} __gen_e_acsl_literal_string_218 ∈ {0} __gen_e_acsl_literal_string_219 ∈ {0} __gen_e_acsl_literal_string_220 ∈ {0} __gen_e_acsl_literal_string_221 ∈ {0} __gen_e_acsl_literal_string_222 ∈ {0} __gen_e_acsl_literal_string_223 ∈ {0} __gen_e_acsl_literal_string_224 ∈ {0} __gen_e_acsl_literal_string_225 ∈ {0} __gen_e_acsl_literal_string_226 ∈ {0} __gen_e_acsl_literal_string_227 ∈ {0} __gen_e_acsl_literal_string_228 ∈ {0} __gen_e_acsl_literal_string_229 ∈ {0} __gen_e_acsl_literal_string_230 ∈ {0} __gen_e_acsl_literal_string_231 ∈ {0} __gen_e_acsl_literal_string_232 ∈ {0} __gen_e_acsl_literal_string_233 ∈ {0} __gen_e_acsl_literal_string_234 ∈ {0} __gen_e_acsl_literal_string_235 ∈ {0} __gen_e_acsl_literal_string_236 ∈ {0} __gen_e_acsl_literal_string_237 ∈ {0} __gen_e_acsl_literal_string_238 ∈ {0} __gen_e_acsl_literal_string_239 ∈ {0} __gen_e_acsl_literal_string_240 ∈ {0} __gen_e_acsl_literal_string_241 ∈ {0} __gen_e_acsl_literal_string_242 ∈ {0} __gen_e_acsl_literal_string_243 ∈ {0} __gen_e_acsl_literal_string_244 ∈ {0} __gen_e_acsl_literal_string_245 ∈ {0} __gen_e_acsl_literal_string_246 ∈ {0} __gen_e_acsl_literal_string_247 ∈ {0} __gen_e_acsl_literal_string_248 ∈ {0} __gen_e_acsl_literal_string_249 ∈ {0} __gen_e_acsl_literal_string_250 ∈ {0} __gen_e_acsl_literal_string_251 ∈ {0} __gen_e_acsl_literal_string_252 ∈ {0} __gen_e_acsl_literal_string_253 ∈ {0} __gen_e_acsl_literal_string_254 ∈ {0} __gen_e_acsl_literal_string_255 ∈ {0} __gen_e_acsl_literal_string_256 ∈ {0} __gen_e_acsl_literal_string_257 ∈ {0} __gen_e_acsl_literal_string_258 ∈ {0} __gen_e_acsl_literal_string_259 ∈ {0} __gen_e_acsl_literal_string_260 ∈ {0} __gen_e_acsl_literal_string_261 ∈ {0} __gen_e_acsl_literal_string_262 ∈ {0} __gen_e_acsl_literal_string_263 ∈ {0} __gen_e_acsl_literal_string_264 ∈ {0} __gen_e_acsl_literal_string_265 ∈ {0} __gen_e_acsl_literal_string_266 ∈ {0} __gen_e_acsl_literal_string_267 ∈ {0} __gen_e_acsl_literal_string_268 ∈ {0} __gen_e_acsl_literal_string_269 ∈ {0} __gen_e_acsl_literal_string_270 ∈ {0} __gen_e_acsl_literal_string_271 ∈ {0} __gen_e_acsl_literal_string_272 ∈ {0} __gen_e_acsl_literal_string_273 ∈ {0} __gen_e_acsl_literal_string_274 ∈ {0} __gen_e_acsl_literal_string_275 ∈ {0} __gen_e_acsl_literal_string_276 ∈ {0} __gen_e_acsl_literal_string_277 ∈ {0} __gen_e_acsl_literal_string_278 ∈ {0} __gen_e_acsl_literal_string_279 ∈ {0} __gen_e_acsl_literal_string_280 ∈ {0} __gen_e_acsl_literal_string_281 ∈ {0} __gen_e_acsl_literal_string_282 ∈ {0} __gen_e_acsl_literal_string_283 ∈ {0} __gen_e_acsl_literal_string_284 ∈ {0} __gen_e_acsl_literal_string_285 ∈ {0} __gen_e_acsl_literal_string_286 ∈ {0} __gen_e_acsl_literal_string_287 ∈ {0} __gen_e_acsl_literal_string_288 ∈ {0} __gen_e_acsl_literal_string_289 ∈ {0} __gen_e_acsl_literal_string_290 ∈ {0} __gen_e_acsl_literal_string_291 ∈ {0} __gen_e_acsl_literal_string_292 ∈ {0} __gen_e_acsl_literal_string_293 ∈ {0} __gen_e_acsl_literal_string_294 ∈ {0} __gen_e_acsl_literal_string_295 ∈ {0} __gen_e_acsl_literal_string_296 ∈ {0} __gen_e_acsl_literal_string_297 ∈ {0} __gen_e_acsl_literal_string_298 ∈ {0} __gen_e_acsl_literal_string_299 ∈ {0} __gen_e_acsl_literal_string_300 ∈ {0} __gen_e_acsl_literal_string_301 ∈ {0} __gen_e_acsl_literal_string_302 ∈ {0} __gen_e_acsl_literal_string_303 ∈ {0} __gen_e_acsl_literal_string_304 ∈ {0} __gen_e_acsl_literal_string_305 ∈ {0} __gen_e_acsl_literal_string_306 ∈ {0} __gen_e_acsl_literal_string_307 ∈ {0} __gen_e_acsl_literal_string_308 ∈ {0} __gen_e_acsl_literal_string_309 ∈ {0} __gen_e_acsl_literal_string_310 ∈ {0} __gen_e_acsl_literal_string_311 ∈ {0} __gen_e_acsl_literal_string_312 ∈ {0} __gen_e_acsl_literal_string_313 ∈ {0} __gen_e_acsl_literal_string_314 ∈ {0} __gen_e_acsl_literal_string_315 ∈ {0} __gen_e_acsl_literal_string_316 ∈ {0} __gen_e_acsl_literal_string_317 ∈ {0} __gen_e_acsl_literal_string_318 ∈ {0} __gen_e_acsl_literal_string_319 ∈ {0} __gen_e_acsl_literal_string_320 ∈ {0} __gen_e_acsl_literal_string_321 ∈ {0} __gen_e_acsl_literal_string_322 ∈ {0} __gen_e_acsl_literal_string_323 ∈ {0} __gen_e_acsl_literal_string_324 ∈ {0} __gen_e_acsl_literal_string_325 ∈ {0} __gen_e_acsl_literal_string_326 ∈ {0} __gen_e_acsl_literal_string_327 ∈ {0} __gen_e_acsl_literal_string_328 ∈ {0} __gen_e_acsl_literal_string_329 ∈ {0} __gen_e_acsl_literal_string_330 ∈ {0} __gen_e_acsl_literal_string_331 ∈ {0} __gen_e_acsl_literal_string_332 ∈ {0} __gen_e_acsl_literal_string_333 ∈ {0} __gen_e_acsl_literal_string_334 ∈ {0} __gen_e_acsl_literal_string_335 ∈ {0} __gen_e_acsl_literal_string_336 ∈ {0} __gen_e_acsl_literal_string_337 ∈ {0} __gen_e_acsl_literal_string_338 ∈ {0} [value] using specification for function __e_acsl_memory_init [value] using specification for function __e_acsl_store_block [value] using specification for function __e_acsl_full_init [value] using specification for function __e_acsl_mark_readonly [value] using specification for function fork [value] using specification for function __e_acsl_builtin_printf [value] using specification for function exit [value] using specification for function waitpid [value:alarm] tests/format/printf.c:179: Warning: accessing uninitialized left-value. assert \initialized(&process_status); [value] using specification for function __e_acsl_delete_block [value:alarm] tests/format/printf.c:182: Warning: accessing uninitialized left-value. assert \initialized(&process_status_0); [value:alarm] tests/format/printf.c:185: Warning: accessing uninitialized left-value. assert \initialized(&process_status_1); [value:alarm] tests/format/printf.c:188: Warning: accessing uninitialized left-value. assert \initialized(&process_status_2); [value] using specification for function __e_acsl_initialize [value:alarm] tests/format/printf.c:193: Warning: accessing uninitialized left-value. assert \initialized(&process_status_3); [value:alarm] tests/format/printf.c:196: Warning: accessing uninitialized left-value. assert \initialized(&process_status_4); [value:alarm] tests/format/printf.c:198: Warning: accessing uninitialized left-value. assert \initialized(&process_status_5); [value:alarm] tests/format/printf.c:200: Warning: accessing uninitialized left-value. assert \initialized(&process_status_6); [value:alarm] tests/format/printf.c:203: Warning: accessing uninitialized left-value. assert \initialized(&process_status_7); [value:alarm] tests/format/printf.c:205: Warning: accessing uninitialized left-value. assert \initialized(&process_status_8); [value] using specification for function __gmpz_init_set_si [value] using specification for function __gmpz_init_set_ui [value] using specification for function __gmpz_cmp [value] using specification for function __gmpz_clear [value] using specification for function __e_acsl_assert [value:alarm] tests/format/printf.c:50: Warning: function __e_acsl_assert: precondition got status unknown. [value] using specification for function __builtin_alloca [value:alarm] tests/format/printf.c:51: Warning: function __gen_e_acsl_strcpy: precondition 'room_string' got status invalid. [value] done for function main frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/printf.c0000666000000000000000000004736613571573400020747 0ustar /* run.config_ci,run.config_dev COMMENT: Check detection of format-string vulnerabilities via printf DONTRUN: */ #include #include #include #include #include #include #include #include #include #include "signalled.h" #define ABRT_AT(code,at) SIGNALLED_AT(code, 1, at) #define OK_AT(code,at) SIGNALLED_AT(code, 0, at) /* All valid format specifiers */ const char *valid_specifiers = "diouxfFeEgGaAcspn"; /* Given a format string with a specifier at the last position run printf with this format picking the right type */ void apply_specifier(char *format, int spec) { int n; void *p = NULL; if (strchr("fFeEgGaA", spec) != NULL) printf(format, 1.0); else if (strchr("uoxX", spec) != NULL) printf(format, 1U); else if (strchr("dic", spec) != NULL) printf(format, 97); else if (spec == 's') printf(format, "foo"); else if (spec == 'n') printf(format, &n); else if (spec == 'p') printf(format, p); else abort(); } /* Given a string consisting of format specifiers (`allowed`) and a mutable format string `fmt` with a specifier located at the last position run positive tests for all specifiers from `allowed` and negative ones for the remaining one. If `only_negative` is true then only negative tests are run */ void test_specifier_application(const char *allowed, const char *fmt, int only_negative, char *at) { int len = strlen(fmt); char format[len + 1]; strcpy(format, fmt); int i; for (int i = 0; i < strlen(valid_specifiers); i++) { int c = valid_specifiers[i]; format[len - 1] = c; if (strchr(allowed, c)) { if (!only_negative) { OK_AT(apply_specifier(format,c),at); } } else { ABRT_AT(apply_specifier(format,c),at); } } } int main(int argc, const char **argv) { // pointers char *pstr = "Hello world!"; char astr[] = "Hello world!"; signed char *sastr = astr; void *vptr = (void*)&argc; // char char chr = 'T'; unsigned char uchr = 'U'; // short short shrt = 4569; unsigned short ushrt = 4567; // int int i = 268; unsigned ui = 516; wint_t wi = 123; // long long li = 3134; unsigned long lu = 7845216; long long lli = 123LL; unsigned long long llu = 123LL; // double float flt = 0.2; double dbl = 0.3; long double ldbl = 0.3; // typedefs intmax_t imax = 10; uintmax_t uimax = 10; size_t szt = 10; ptrdiff_t ptrdf = 147; // An undefined behaviour occurs if: // 1. a format directive has no corresponding argument // 2. a format string is not NUL-terminated // +Argument Number // 3. numbered and non-numbered arguments cannot be mixed // +Precision // 4. precision is specified for a CS other than [diouxXaAeEfFgG] // (csn%) // +Flags: // 5. a flag is not one of [-+ #0'] // 6. '#' flag is used with a CS other than [oxXaAeEfFgG] // 7. '0' flag is used with a CS other than [diouxXaAeEfFgG] // +Length modifiers (LM): // 8. a LM is not one of [hljztL] or [ll] or [hh] // 9. there are more than one LM per one CS // 10. 'hh' used with a CS other than [diouxXn] // 11. 'h' used with a CS other than [diouxXn] // 12. 'l' used with a CS other than [diouxXncsaAeEfFgG] // 13. 'll' used with a CS other than [diouxXn] // 14. 'j' used with a CS other than [diouxXn] // 15. 'z' used with a CS other than [diouxXn] // 16. 't' used with a CS other than [diouxXn] // 17. 'L' used with a CS other than [aAeEfFgG] // +Conversion specifiers (CS): // 18. Not one of [diouxfFeEgGaAcspnCS%] // - [di] // 19. no LM is present and the argument corresponding to // the above specifier is not of type 'int' // 20. LM is present and the argument corresponding to the above // CS is not of signed integral type given by the LM // - [ouxX] // 21. no LM is present and the argument corresponding to // the above specifier is not of type 'unsigned int' // 22. LM is present and the argument corresponding to the above // CS is not of unsigned integral type given by the LM // - [aAeEgGfF] // 23. no LM is present and the argument corresponding to the above CS // is not of type 'double' // 24. LM is present (only 'L' is possible) and the argument // corresponding to the above CS is not of type 'long double' // - [c] // 25. no LM is present and the argument corresponding to the above CS // is not of type 'int' // 26. LM is present (only 'l') and the argument corresponding to // the above CS is not of type 'wint_t' // - [s] // 27. no LM is present and the argument corresponding to the above CS // is not a valid pointer of any character type. // 28. no LM is present and no precision is specified and the argument // corresponding to the above CS is not NUL-terminated array of // characters. An undefined behaviour also occurs if the precision // is given but it is greater then the size of array and the array // does not contain a NUL character // 29. LM is present and the argument corresponding to the above CS is // not a valid pointer of wchar_t type. // 30. LM is present and no precision is specified and the argument // corresponding to the above CS is not wide NUL-terminated (L'\0') // array of wchar_t. An undefined behaviour also occurs if the // precision is given but it is greater then the size of array // and the array does not contain a NUL character // - [p] // 31. the argument corresponding to the above CS is not a valid pointer // of void type // - [n] // 32. the argument corresponding to the above CS is not a valid pointer // of signed int type // 33. directive involving the above CS contains flags or field width or // or precision // - [%] // 34. The complete specification for the above CS is other than '%%' // // Additional undefined behaviours for functions other than printf // 35. fprintf: stream that fprintf writes to is not a valid open filehandle // 36. dprintf: file descriptor dprintf writes to is not a file descriptor // for a file opened for writing // 37. sprintf/snprintf: buffer that sprintf or snprintf write to is not // a writeable allocated block of whose size if equal to or larger than // written bytes // 38. sprintf/snprintf: memory spaces given by the buffer and the rest of // the arguments are not disjoint // Simplest case OK(printf("Hello world\n")); // A few conversion specifiers OK(printf("%s - %s! Say it %d or %u times \n", astr, pstr, i, ui)); // Undef 1: insifficient arguments ABRT(printf("%s - %s and say it %d or %u more times \n", astr, pstr, i)); // Excessive arguments are fine. They are discarded OK(printf("%s - %s. Say it %d or %u times \n", astr, pstr, i, ui, ui)); // Undef 2: unterminated format string char fmt[7] = "fmt:%s"; fmt[6] = 'a'; ABRT(printf(fmt, pstr)); // Support for numbered arguments OK(printf("%3$s Say it %2$d or %1$u times \n", ui, i, astr)); // Excessive arguments lead to undefined behaviors ABRT(printf("%4$s Say it %2$d or %1$u times \n", ui, i, astr)); // There is no argument 0 ABRT(printf("%0$s Say it %2$d or %1$u times \n", ui, i, astr)); // Undef 3: numbered and non-numbered arguments cannot be mixed ... ABRT(printf("%s Say it %2$d or %3$u times \n", astr, i, ui)); // ... except for a complete specification '%%' OK(printf("%1$d - %% - %2$u times \n", i, ui)); // Undef 4. precision is specified for a CS other than [diouxXaAeEfFgGs] test_specifier_application("diouxXaAeEfFgGs", "%.3X", 0, AT); // Undef 5. a flag is not one of [-+ #0'] // Guarded by internal assertion // Undef 6. '#' flag is used with a CS other than [oxXaAeEfFgG] (i.e.,udicsn) test_specifier_application("oxXaAeEfFgG", "%#X", 0, AT); // Undef 7. '0' flag is used with a CS other than [diouxXaAeEfFgG] (i.e., csn) test_specifier_application("diouxXaAeEfFgG", "%0X", 0, AT); // Undef 8. a LM is not one of [hljztL] or [ll] or [hh] // Guarded by internal assertion // Undef 9. there are more than one LM per one CS OK(printf("%ld\n", 1L)); OK(printf("%lld\n",1LL)); ABRT(printf("%llld\n", 1LL)); // FIXME: an issue with positive tests here. This is because length modifiers // change expected types and types used in the `apply_specifier` no longer apply. // Undef 10. 'hh' used with a CS other than [diouxXn] test_specifier_application("diouxXn", "%hhX", 1, AT); OK(printf("%hhd", 1)); OK(printf("%hhi", 1)); OK(printf("%hhu", 1)); OK(printf("%hho", 1)); OK(printf("%hhx", 1)); OK(printf("%hhX", 1)); OK(printf("%hhn", &chr)); // Undef 11. 'h' used with a CS other than [diouxXn] test_specifier_application("diouxXn", "%hX", 1, AT); OK(printf("%hd", 1)); OK(printf("%hi", 1)); OK(printf("%hu", 1)); OK(printf("%ho", 1)); OK(printf("%hx", 1)); OK(printf("%hX", 1)); OK(printf("%hn", &shrt)); // Undef 12. 'l' used with a CS other than [diouxXncsaAeEfFgG] test_specifier_application("diouxXncsaAeEfFgG", "%lX", 1, AT); OK(printf("%ld", 1L)); OK(printf("%li", 1L)); OK(printf("%lu", 1UL)); OK(printf("%lo", 1UL)); OK(printf("%lx", 1UL)); OK(printf("%lX", 1UL)); // No effect on [aAeEfFgG] OK(printf("%f", dbl)); OK(printf("%F", dbl)); OK(printf("%e", dbl)); OK(printf("%E", dbl)); OK(printf("%a", dbl)); OK(printf("%A", dbl)); OK(printf("%g", dbl)); OK(printf("%G", dbl)); // Pointer to long int for [n] OK(printf("%ln", &li)); // wint_t for [c], since wint_t is essentially short then it is the subject // to promotions and "%lc" expects an int OK(printf("%lc", wi)); // Undef 13. 'll' used with a CS other than [diouxXn] //test_specifier_application("diouxXn", "%llX", 1, AT); OK(printf("%lld", 1LL)); OK(printf("%lli", 1LL)); OK(printf("%llu", 1ULL)); OK(printf("%llo", 1ULL)); OK(printf("%llx", 1ULL)); OK(printf("%llX", 1ULL)); OK(printf("%lln", &lli)); // Undef 14. 'j' used with a CS other than [diouxXn] test_specifier_application("diouxXn", "%jX", 1, AT); OK(printf("%jd", imax)); OK(printf("%ji", imax)); OK(printf("%ju", uimax)); OK(printf("%jo", uimax)); OK(printf("%jx", uimax)); OK(printf("%jX", uimax)); OK(printf("%jn", &imax)); // Undef 15. 'z' used with a CS other than [diouxXn] test_specifier_application("diouxXn", "%zX", 1, AT); // For 'zi' and 'zd' modifiers we need type of `size_t` size but signed. // For simplicity the below assumes that in a 32-bit system it is `int` and // `long` in 64 bit. This may fail though, so use with caution. #if __WORDSIZE == 64 OK(printf("%zd", li)); OK(printf("%zi", li)); #elif __WORDSIZE == 32 OK(printf("%zd", i)); OK(printf("%zi", i)); #endif OK(printf("%zu", szt)); OK(printf("%zo", szt)); OK(printf("%zx", szt)); OK(printf("%zX", szt)); OK(printf("%zn", &szt)); // Undef 16. 't' used with a CS other than [diouxXn] // Same as above but since ptrdiff_t is sizned we have to tweak types for // [uoxX] test_specifier_application("diouxXn", "%tX", 1, AT); #if __WORDSIZE == 64 OK(printf("%tu", lu)); OK(printf("%to", lu)); OK(printf("%tx", lu)); OK(printf("%tX", lu)); #elif __WORDSIZE == 32 OK(printf("%tu", u)); OK(printf("%to", u)); OK(printf("%tx", u)); OK(printf("%tX", u)); #endif OK(printf("%td", ptrdf)); OK(printf("%ti", ptrdf)); OK(printf("%tn", &ptrdf)); // Undef 17. 'L' used with a CS other than [aAeEfFgG] test_specifier_application("aAeEfFgG", "%LX", 1, AT); OK(printf("%Lf", ldbl)); OK(printf("%LF", ldbl)); OK(printf("%Le", ldbl)); OK(printf("%LE", ldbl)); OK(printf("%La", ldbl)); OK(printf("%LA", ldbl)); OK(printf("%Lg", ldbl)); OK(printf("%LG", ldbl)); // Undef 18. CS is not one of [diouxfFeEgGaAcspnCS%] // Try some of specifiers supported by GLIBC printf but not in C99 ABRT(printf("%C\n",1)); ABRT(printf("%S\n",1)); ABRT(printf("%m\n",1)); // Undef 19. [di]: no LM is present and the argument is not of type 'int' OK(printf("%i\n", i)); OK(printf("%d\n", i)); OK(printf("%i\n", chr)); OK(printf("%d\n", chr)); // promoted to int OK(printf("%i\n", shrt)); OK(printf("%d\n", shrt)); // promoted to int ABRT(printf("%i\n", li)); ABRT(printf("%d\n", li)); ABRT(printf("%i\n", ui)); ABRT(printf("%d\n", ui)); ABRT(printf("%i\n", vptr)); ABRT(printf("%d\n", vptr)); ABRT(printf("%i\n", flt)); ABRT(printf("%d\n", flt)); // Undef 20. [di]: LM is present and the argument is not of type given by LM OK(printf("%li\n", li)); OK(printf("%ld\n", li)); OK(printf("%lli\n", lli)); OK(printf("%lld\n", lli)); OK(printf("%hi\n", shrt)); OK(printf("%hd\n", shrt)); OK(printf("%hhi\n", chr)); OK(printf("%hhd\n", chr)); #if __WORDSIZE == 64 OK(printf("%ji\n", li)); OK(printf("%jd\n", li)); #elif __WORDSIZE == 32 OK(printf("%zi\n", i)); OK(printf("%zd\n", i)); #endif OK(printf("%ti\n", ptrdf)); OK(printf("%td\n", ptrdf)); // Undef 21. [ouxX]: no LM is present and the argument is not 'unsigned int' OK(printf("%u\n", ui)); OK(printf("%o\n", ui)); OK(printf("%x\n", ui)); OK(printf("%X\n", ui)); ABRT(printf("%u\n", li)); ABRT(printf("%o\n", li)); ABRT(printf("%x\n", li)); ABRT(printf("%X\n", li)); ABRT(printf("%u\n", lu)); ABRT(printf("%o\n", lu)); ABRT(printf("%x\n", lu)); ABRT(printf("%X\n", lu)); ABRT(printf("%u\n", flt)); ABRT(printf("%o\n", flt)); ABRT(printf("%x\n", flt)); ABRT(printf("%X\n", flt)); ABRT(printf("%u\n", vptr)); ABRT(printf("%o\n", vptr)); ABRT(printf("%x\n", vptr)); ABRT(printf("%X\n", vptr)); ABRT(printf("%u\n", astr)); ABRT(printf("%o\n", astr)); ABRT(printf("%x\n", astr)); ABRT(printf("%X\n", astr)); // Undef 22. [ouxX]: LM is present and the argument is not of type given by the LM OK(printf("%lu\n", lu)); OK(printf("%lo\n", lu)); OK(printf("%lx\n", lu)); OK(printf("%lX\n", lu)); OK(printf("%llu\n", llu)); OK(printf("%llo\n", llu)); OK(printf("%llx\n", llu)); OK(printf("%llX\n", llu)); // subject to promotion so expects int OK(printf("%hu\n", i)); OK(printf("%ho\n", i)); OK(printf("%hx\n", i)); OK(printf("%hX\n", i)); // subject to promotion so expects int OK(printf("%hhu\n", i)); OK(printf("%hho\n", i)); OK(printf("%hhx\n", i)); OK(printf("%hhX\n", i)); OK(printf("%ju\n", uimax)); OK(printf("%jo\n", uimax)); OK(printf("%jx\n", uimax)); OK(printf("%jX\n", uimax)); OK(printf("%zu\n", szt)); OK(printf("%zo\n", szt)); OK(printf("%zx\n", szt)); OK(printf("%zX\n", szt)); #if __WORDSIZE == 64 OK(printf("%tu\n", lu)); OK(printf("%to\n", lu)); OK(printf("%tx\n", lu)); OK(printf("%tX\n", lu)); #endif // Undef 23. [aAgGfFeE]: no LM is present and the argument is not of type 'double' OK(printf("%f\n",dbl)); OK(printf("%F\n",dbl)); ABRT(printf("%f\n",ldbl)); ABRT(printf("%F\n",ldbl)); ABRT(printf("%f\n",i)); ABRT(printf("%F\n",i)); ABRT(printf("%f\n",lu)); ABRT(printf("%F\n",lu)); OK(printf("%a\n",dbl)); OK(printf("%A\n",dbl)); ABRT(printf("%a\n",ldbl)); ABRT(printf("%A\n",ldbl)); ABRT(printf("%a\n",i)); ABRT(printf("%A\n",i)); ABRT(printf("%a\n",lu)); ABRT(printf("%A\n",lu)); OK(printf("%e\n",dbl)); OK(printf("%E\n",dbl)); ABRT(printf("%e\n",ldbl)); ABRT(printf("%E\n",ldbl)); ABRT(printf("%e\n",i)); ABRT(printf("%E\n",i)); ABRT(printf("%e\n",lu)); ABRT(printf("%E\n",lu)); OK(printf("%g\n",dbl)); OK(printf("%G\n",dbl)); ABRT(printf("%g\n",ldbl)); ABRT(printf("%G\n",ldbl)); ABRT(printf("%g\n",i)); ABRT(printf("%G\n",i)); ABRT(printf("%g\n",lu)); ABRT(printf("%G\n",lu)); // 24. [aAgGfFeE]: 'L' LM is present and the argument is not of type 'long double' ABRT(printf("%Lf\n",dbl)); ABRT(printf("%LF\n",dbl)); OK(printf("%Lf\n",ldbl)); OK(printf("%LF\n",ldbl)); ABRT(printf("%Lf\n",i)); ABRT(printf("%LF\n",i)); ABRT(printf("%Lf\n",lu)); ABRT(printf("%LF\n",lu)); ABRT(printf("%La\n",dbl)); ABRT(printf("%LA\n",dbl)); OK(printf("%La\n",ldbl)); OK(printf("%LA\n",ldbl)); ABRT(printf("%La\n",i)); ABRT(printf("%LA\n",i)); ABRT(printf("%La\n",lu)); ABRT(printf("%LA\n",lu)); ABRT(printf("%Le\n",dbl)); ABRT(printf("%LE\n",dbl)); OK(printf("%Le\n",ldbl)); OK(printf("%LE\n",ldbl)); ABRT(printf("%Le\n",i)); ABRT(printf("%LE\n",i)); ABRT(printf("%Le\n",lu)); ABRT(printf("%LE\n",lu)); ABRT(printf("%Lg\n",dbl)); ABRT(printf("%LG\n",dbl)); OK(printf("%Lg\n",ldbl)); OK(printf("%LG\n",ldbl)); ABRT(printf("%Lg\n",i)); ABRT(printf("%LG\n",i)); ABRT(printf("%Lg\n",lu)); ABRT(printf("%LG\n",lu)); // Undef 25. [c] no LM is present and the argument is not of type 'int' OK(printf("%c\n", i)); OK(printf("%c\n", chr)); OK(printf("%c\n", shrt)); ABRT(printf("%c\n", ui)); ABRT(printf("%c\n", li)); ABRT(printf("%c\n", flt)); ABRT(printf("%c\n", astr)); // Undef 26. [c]: 'l' LM is present and the argument is not of type 'wint_t' OK(printf("%lc\n", wi)); // Both are fine because size comparison is performed ABRT(printf("%lc\n", li)); // Undef 27/28. no LM is present and // - the argument is not a valid pointer of any character type // - no precision is specified the argument is not NUL-terminated // - the precision is given but it is greater then the size of array // and the array does not contain a NUL character OK(printf("%s\n", astr)); OK(printf("%s\n", pstr)); ABRT(printf("%s\n", i)); ABRT(printf("%s\n", vptr)); char *s1 = NULL; char *s2; ABRT(printf("%s\n", s1)); // Unallocated ABRT(printf("%s\n", s2)); // Unallocated char s4[4] = "cat"; OK(printf("%s\n", s4)); s4[3] = 's'; ABRT(printf("%s\n", s4)); // Not NUL-terminated // Precision OK(printf("%.s\n", s1)); // The precision is zero, so print nothing OK(printf("%.0s\n", s1)); // The precision is zero, so print nothing OK(printf("%.3s\n", s4)); // Within allocated limits even though no NUL OK(printf("%.4s\n", s4)); // Within allocated limits even though no NUL ABRT(printf("%.5s\n", s4)); // Precision goes over limits // Undef 29/30. Same as 27/28 but for '%ls' and wchar_t* #ifdef WIDE_STRING ABRT(printf("%ls\n", astr)); ABRT(printf("%ls\n", pstr)); ABRT(printf("%ls\n", NULL)); wchar_t *ls1; wchar_t *ls2 = NULL; wchar_t ls4[4] = L"cat"; ABRT(printf("%ls\n", ls1)); ABRT(printf("%ls\n", ls2)); OK(printf("%ls\n", ls4)); // Precision OK(printf("%.ls\n", ls1)); // The precision is zero, so print nothing OK(printf("%.0ls\n", ls1)); // The precision is zero, so print nothing OK(printf("%.3ls\n", ls4)); // Within allocated limits even though no NUL OK(printf("%.4ls\n", ls4)); // Within allocated limits even though no NUL ABRT(printf("%.5ls\n", ls4)); // Precision goes over limits #endif // Undef 31. [p]: the argument is not a valid pointer of void type OK(printf("%p", vptr)); ABRT(printf("%p", astr)); ABRT(printf("%p", NULL)); // Undef 32. [n]: the argument is not a valid pointer of signed int type OK(printf("%n", &i)); ABRT(printf("%n", &ui)); // pointer to unsigned type ABRT(printf("%n", NULL)); // NULL ABRT(printf("%n", (int*)pstr)); // cast of read-only string // Undef 33. [n]: directive using [n] contains flags or field width or precision ABRT(printf("%'n", &i)); ABRT(printf("%0n", &i)); ABRT(printf("%#n", &i)); ABRT(printf("% n", &i)); ABRT(printf("%+n", &i)); ABRT(printf("%-n", &i)); ABRT(printf("%.n", &i)); ABRT(printf("%.2n", &i)); ABRT(printf("%.2n", &i)); ABRT(printf("%10n", &i)); // Undef 34. [%]: the complete specification is other than '%%' ABRT(printf("%d - %'% - %u times \n", i, ui)); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/signalled.h0000666000000000000000000000261413571573400021377 0ustar #include #include #include #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) #define AT __FILE__ ":" TOSTRING(__LINE__) int testno = 0; void signal_eval(int status, int expect_signal, const char *at) { printf("TEST %d: ", ++testno); int signalled = WIFSIGNALED(status); if (signalled && expect_signal) printf("OK: Expected signal at %s\n", at); else if (!signalled && !expect_signal) printf("OK: Expected execution at %s\n", at); else if (!signalled && expect_signal) { printf("FAIL: Unexpected execution at %s\n", at); exit(1); } else if (signalled && !expect_signal) { printf("FAIL: Unexpected signal at %s\n", at); exit(2); } } /* The following macro runs a chunk of code in a subprocess and evaluates the result. This macro assumes that fork is always successful. */ #define SIGNALLED_AT(code, expect_signal, at) { \ pid_t pid = fork(); \ if(!pid) { \ code; \ exit(0); \ } else { \ int process_status; \ waitpid(pid, &process_status, 0); \ signal_eval(process_status, expect_signal, at); \ } \ } #define ABRT(code) SIGNALLED_AT(code, 1, AT) #define OK(code) SIGNALLED_AT(code, 0, AT); #define ABRT_AT(code,at) SIGNALLED_AT(code, 1, at) #define OK_AT(code,at) SIGNALLED_AT(code, 0, at) frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/test_config_ci0000666000000000000000000000005313571573400022161 0ustar STDOPT: #"-e-acsl-validate-format-strings" frama-c-20.0-Calcium/src/plugins/e-acsl/tests/format/test_config_dev0000666000000000000000000000053713571573400022353 0ustar MACRO: DEST @PTEST_RESULT@/gen_@PTEST_NAME@ MACRO: OUT @PTEST_NAME@.res.log MACRO: ERR @PTEST_NAME@.err.log EXEC: ./scripts/e-acsl-gcc.sh --validate-format-strings -q -c -X --frama-c-extra="-verbose 0 -kernel-warn-key *=inactive" -o @DEST@.run.c -O @DEST@.out @PTEST_FILE@ > @PTEST_RESULT@/@OUT@ 2> @PTEST_RESULT@/@ERR@ && ./@DEST@.e-acsl > /dev/null frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/0000777000000000000000000000000013571573400020206 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/addrOf.i0000666000000000000000000000031613571573400021557 0ustar /* run.config COMMENT: addrOf */ void f(){ int m, *u, *p; u = &m; p = u; m = 123; //@ assert \initialized(p); } int main(void) { int x = 0; f(); /*@ assert &x == &x; */ ; return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/oracle_ci/0000777000000000000000000000000013571573400022126 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/oracle_ci/addrOf.0.res.oracle0000666000000000000000000000173213571573400025445 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization __e_acsl_init ∈ [--..--] __e_acsl_heap_allocation_size ∈ [--..--] __e_acsl_math_HUGE_VAL ∈ [-1.79769313486e+308 .. 1.79769313486e+308] __e_acsl_math_HUGE_VALF ∈ [-3.40282346639e+38 .. 3.40282346639e+38] __e_acsl_math_INFINITY ∈ [-1.79769313486e+308 .. 1.79769313486e+308] [eva] using specification for function __e_acsl_memory_init [eva] using specification for function __e_acsl_store_block [eva] using specification for function __e_acsl_full_init [eva] using specification for function __e_acsl_initialized [eva] using specification for function __e_acsl_assert [eva] using specification for function __e_acsl_delete_block [eva] using specification for function __e_acsl_memory_clean [eva] done for function main frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/oracle_ci/addrOf.1.res.oracle0000666000000000000000000000173213571573400025446 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization __e_acsl_init ∈ [--..--] __e_acsl_heap_allocation_size ∈ [--..--] __e_acsl_math_HUGE_VAL ∈ [-1.79769313486e+308 .. 1.79769313486e+308] __e_acsl_math_HUGE_VALF ∈ [-3.40282346639e+38 .. 3.40282346639e+38] __e_acsl_math_INFINITY ∈ [-1.79769313486e+308 .. 1.79769313486e+308] [eva] using specification for function __e_acsl_memory_init [eva] using specification for function __e_acsl_store_block [eva] using specification for function __e_acsl_full_init [eva] using specification for function __e_acsl_initialized [eva] using specification for function __e_acsl_assert [eva] using specification for function __e_acsl_delete_block [eva] using specification for function __e_acsl_memory_clean [eva] done for function main frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/oracle_ci/addrOf.res.oracle0000666000000000000000000000011713571573400025303 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/oracle_ci/gen_addrOf.c0000666000000000000000000000620513571573400024325 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" void f(void) { int m; int *u; int *p; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_store_block((void *)(& u),(size_t)8); __e_acsl_store_block((void *)(& m),(size_t)4); __e_acsl_full_init((void *)(& u)); u = & m; __e_acsl_full_init((void *)(& p)); p = u; __e_acsl_full_init((void *)(& m)); m = 123; /*@ assert \initialized(p); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion",(char *)"f", (char *)"\\initialized(p)",10); } __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& u)); __e_acsl_delete_block((void *)(& m)); return; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& f),(size_t)1); __e_acsl_full_init((void *)(& f)); __e_acsl_store_block((void *)(& __fc_p_tmpnam),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_tmpnam)); __e_acsl_store_block((void *)(__fc_tmpnam),(size_t)2048); __e_acsl_full_init((void *)(& __fc_tmpnam)); __e_acsl_store_block((void *)(& __fc_p_fopen),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_fopen)); __e_acsl_store_block((void *)(__fc_fopen),(size_t)128); __e_acsl_full_init((void *)(& __fc_fopen)); __e_acsl_store_block((void *)(& stdin),(size_t)8); __e_acsl_full_init((void *)(& stdin)); __e_acsl_store_block((void *)(& __fc_p_random48_counter),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_random48_counter)); __e_acsl_store_block((void *)(random48_counter),(size_t)6); __e_acsl_full_init((void *)(& random48_counter)); __e_acsl_store_block((void *)(& __fc_random48_init),(size_t)4); __e_acsl_full_init((void *)(& __fc_random48_init)); __e_acsl_store_block((void *)(& __fc_rand_max),(size_t)8); __e_acsl_full_init((void *)(& __fc_rand_max)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& __retres),(size_t)4); int x = 0; __e_acsl_store_block((void *)(& x),(size_t)4); __e_acsl_full_init((void *)(& x)); f(); /*@ assert &x ≡ &x; */ __e_acsl_assert(& x == & x,(char *)"Assertion",(char *)"main", (char *)"&x == &x",16); __e_acsl_full_init((void *)(& __retres)); __retres = 0; __e_acsl_delete_block((void *)(& f)); __e_acsl_delete_block((void *)(& __fc_p_tmpnam)); __e_acsl_delete_block((void *)(__fc_tmpnam)); __e_acsl_delete_block((void *)(& __fc_p_fopen)); __e_acsl_delete_block((void *)(__fc_fopen)); __e_acsl_delete_block((void *)(& stdin)); __e_acsl_delete_block((void *)(& __fc_p_random48_counter)); __e_acsl_delete_block((void *)(random48_counter)); __e_acsl_delete_block((void *)(& __fc_random48_init)); __e_acsl_delete_block((void *)(& __fc_rand_max)); __e_acsl_delete_block((void *)(& x)); __e_acsl_delete_block((void *)(& __retres)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/oracle_ci/gen_addrOf2.c0000666000000000000000000000526213571573400024411 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" void f(void) { int m; int *u; int *p; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_store_block((void *)(& u),(size_t)8); __e_acsl_store_block((void *)(& m),(size_t)4); __e_acsl_full_init((void *)(& u)); u = & m; __e_acsl_full_init((void *)(& p)); p = u; __e_acsl_full_init((void *)(& m)); m = 123; /*@ assert \initialized(p); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion",(char *)"f", (char *)"\\initialized(p)",10); } __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& u)); __e_acsl_delete_block((void *)(& m)); return; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& f),(size_t)1); __e_acsl_full_init((void *)(& f)); __e_acsl_store_block((void *)(& __fc_p_fopen),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_fopen)); __e_acsl_store_block((void *)(__fc_fopen),(size_t)128); __e_acsl_full_init((void *)(& __fc_fopen)); __e_acsl_store_block((void *)(& __fc_p_random48_counter),(size_t)8); __e_acsl_full_init((void *)(& __fc_p_random48_counter)); __e_acsl_store_block((void *)(random48_counter),(size_t)6); __e_acsl_full_init((void *)(& random48_counter)); __e_acsl_store_block((void *)(& __fc_random48_init),(size_t)4); __e_acsl_full_init((void *)(& __fc_random48_init)); __e_acsl_store_block((void *)(& __fc_rand_max),(size_t)8); __e_acsl_full_init((void *)(& __fc_rand_max)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& __retres),(size_t)4); int x = 0; __e_acsl_store_block((void *)(& x),(size_t)4); __e_acsl_full_init((void *)(& x)); f(); /*@ assert &x ≡ &x; */ __e_acsl_assert(& x == & x,(char *)"Assertion",(char *)"main", (char *)"&x == &x",16); __e_acsl_full_init((void *)(& __retres)); __retres = 0; __e_acsl_delete_block((void *)(& f)); __e_acsl_delete_block((void *)(& __fc_p_fopen)); __e_acsl_delete_block((void *)(__fc_fopen)); __e_acsl_delete_block((void *)(& __fc_p_random48_counter)); __e_acsl_delete_block((void *)(random48_counter)); __e_acsl_delete_block((void *)(& __fc_random48_init)); __e_acsl_delete_block((void *)(& __fc_rand_max)); __e_acsl_delete_block((void *)(& x)); __e_acsl_delete_block((void *)(& __retres)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/test_config_ci0000666000000000000000000000003713571573400023110 0ustar STDOPT: #"-e-acsl-full-mmodel" frama-c-20.0-Calcium/src/plugins/e-acsl/tests/full-mmodel/test_config_dev0000666000000000000000000000054413571573400023276 0ustar MACRO: DEST @PTEST_RESULT@/gen_@PTEST_NAME@ MACRO: OUT @PTEST_NAME@.res.log MACRO: ERR @PTEST_NAME@.err.log EXEC: ./scripts/e-acsl-gcc.sh --full-mmodel -q -c -X --frama-c-extra="-journal-disable -verbose 0 -kernel-warn-key *=inactive" -o @DEST@.run.c -O @DEST@.out @PTEST_FILE@ > @PTEST_RESULT@/@OUT@ 2> @PTEST_RESULT@/@ERR@ && ./@DEST@.e-acsl > /dev/null frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/0000777000000000000000000000000013571573400017533 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/arith.i0000666000000000000000000000175613571573400021025 0ustar /* run.config COMMENT: arithmetic operations */ int main(void) { int x = -3; int y = 2; long z = 2L; /*@ assert -3 == x; */ ; /*@ assert x == -3; */ ; /*@ assert 0 != ~0; */ ; /*@ assert x+1 == -2; */ ; /*@ assert x-1 == -4; */ ; /*@ assert x*3 == -9; */ ; /*@ assert x/3 == -1; */ ; /*@ assert 0xffffffffffffffffffffff/0xffffffffffffffffffffff == 1; */ ; /*@ assert x % 2 == -1; */ ; /*@ assert -3 % -2 == -1; */ ; /*@ assert 3 % -2 == 1; */ ; /*@ assert x * 2 + (3 + y) - 4 + (x - y) == -10; */ ; /*@ assert (0 == 1) == !(0 == 0); */ ; /*@ assert (0 <= -1) == (0 > 0); */ ; /*@ assert (0 >= -1) == (0 <= 0); */ ; /*@ assert (0 != 1) == !(0 != 0); */ ; /*@ assert 0 == !1; */ ; /*@ assert 4 / y == 2; */ // non trivial division added when fixing bts #751 // example from the JFLA'15 paper (but for a 64-bit architecture) /*@ assert 1 + ((z+1) / (y-123456789123456789)) == 1; */ /*@ assert 1 - x == -x + 1; */ // test GIT issue #37 return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/functions.c0000666000000000000000000000360613571573400021714 0ustar /* run.config COMMENT: logic functions without labels */ /*@ predicate p1(int x, int y) = x + y > 0; */ /*@ predicate p2(integer x, integer y) = x + y > 0; */ /*@ logic integer f1(integer x, integer y) = x + y; */ // E-ACSL integer typing: // types less than int are considered as int /*@ logic char h_char(char c) = c; */ /*@ logic short h_short(short s) = s; */ /*@ logic int g_hidden(int x) = x; */ /*@ logic int g(int x) = g_hidden(x); */ struct mystruct { int k, l; }; typedef struct mystruct mystruct; /*@ logic mystruct t1(mystruct m) = m; */ /*@ logic integer t2(mystruct m) = m.k + m.l; */ // To test function call in other clauses than assert: /*@ predicate k_pred(integer x) = x > 0; */ /*@ requires k_pred(x); */ void k(int x) {} // To test non-interference with global inits: int glob = 5; // To test that functions that are never called are not generated: /*@ predicate never_called(int x) = x == x; */ /*@ logic double f2(double x) = (double)(1/x); */ /* handle in MR !226 */ // To test not_yet: /*@ predicate p_notyet{L}(integer x) = x > 0; */ /*@ logic integer f_notyet{L}(integer x) = x; */ int main (void) { int x = 1, y = 2; /*@ assert p1(x, y); */ ; /*@ assert p2(3, 4); */ ; /*@ assert p2(5, 99999999999999999999999999999); */ ; /*@ assert f1(x, y) == 3; */ ; /*@ assert p2(x, f1(3, 4)); */ ; /*@ assert f1(9, 99999999999999999999999999999) > 0; */ ; /*@ assert f1(99999999999999999999999999999, 99999999999999999999999999999) == 199999999999999999999999999998; */ ; /*@ assert g(x) == x; */ ; char c = 'c'; /*@ assert h_char(c) == c; */ ; short s = 1; /*@ assert h_short(s) == s; */ ; mystruct m; m.k = 8; m.l = 9; /*@ assert t2(t1(m)) == 17; */ ; k(9); double d = 2.0; /*@ assert f2(d) > 0; */ ; // not yet supported /* /\*@ assert p_notyet(27); *\/ ; */ /* /\*@ assert f_notyet(27) == 27; *\/ ; */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/oracle_ci/0000777000000000000000000000000013571573400021453 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/oracle_ci/arith.res.oracle0000666000000000000000000000452513571573400024547 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/gmp-only/arith.i:10: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:11: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:12: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:14: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:15: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:16: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:17: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:18: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:19: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:20: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:21: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:23: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:25: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:26: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:27: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:28: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:30: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:31: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:34: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:34: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/arith.i:36: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/oracle_ci/functions.res.oracle0000666000000000000000000000345213571573400025446 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/gmp-only/functions.c:42: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:43: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:44: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:46: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:47: Warning: accessing uninitialized left-value. assert \initialized((__e_acsl_mpz_struct *)__gen_e_acsl_f1_4); [eva:alarm] tests/gmp-only/functions.c:47: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:48: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:49: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:53: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:56: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:58: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:63: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:25: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/gmp-only/functions.c:68: Warning: non-finite double value. assert \is_finite(__gen_e_acsl__15); [eva:alarm] tests/gmp-only/functions.c:68: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/oracle_ci/gen_arith.c0000666000000000000000000007546413571573400023577 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = -3; int y = 2; long z = 2L; /*@ assert -3 ≡ x; */ { __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl_neg; __e_acsl_mpz_t __gen_e_acsl_x; int __gen_e_acsl_eq; __gmpz_init_set_si(__gen_e_acsl_,3L); __gmpz_init(__gen_e_acsl_neg); __gmpz_neg(__gen_e_acsl_neg,(__e_acsl_mpz_struct const *)(__gen_e_acsl_)); __gmpz_init_set_si(__gen_e_acsl_x,(long)x); __gen_e_acsl_eq = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_neg), (__e_acsl_mpz_struct const *)(__gen_e_acsl_x)); __e_acsl_assert(__gen_e_acsl_eq == 0,(char *)"Assertion",(char *)"main", (char *)"-3 == x",10); __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl_neg); __gmpz_clear(__gen_e_acsl_x); } /*@ assert x ≡ -3; */ { __e_acsl_mpz_t __gen_e_acsl_x_2; __e_acsl_mpz_t __gen_e_acsl__2; __e_acsl_mpz_t __gen_e_acsl_neg_2; int __gen_e_acsl_eq_2; __gmpz_init_set_si(__gen_e_acsl_x_2,(long)x); __gmpz_init_set_si(__gen_e_acsl__2,3L); __gmpz_init(__gen_e_acsl_neg_2); __gmpz_neg(__gen_e_acsl_neg_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gen_e_acsl_eq_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_x_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_2)); __e_acsl_assert(__gen_e_acsl_eq_2 == 0,(char *)"Assertion", (char *)"main",(char *)"x == -3",11); __gmpz_clear(__gen_e_acsl_x_2); __gmpz_clear(__gen_e_acsl__2); __gmpz_clear(__gen_e_acsl_neg_2); } /*@ assert 0 ≢ ~0; */ { __e_acsl_mpz_t __gen_e_acsl__3; __e_acsl_mpz_t __gen_e_acsl_bnot; int __gen_e_acsl_ne; __gmpz_init_set_si(__gen_e_acsl__3,0L); __gmpz_init(__gen_e_acsl_bnot); __gmpz_com(__gen_e_acsl_bnot, (__e_acsl_mpz_struct const *)(__gen_e_acsl__3)); __gen_e_acsl_ne = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__3), (__e_acsl_mpz_struct const *)(__gen_e_acsl_bnot)); __e_acsl_assert(__gen_e_acsl_ne != 0,(char *)"Assertion",(char *)"main", (char *)"0 != ~0",12); __gmpz_clear(__gen_e_acsl__3); __gmpz_clear(__gen_e_acsl_bnot); } /*@ assert x + 1 ≡ -2; */ { __e_acsl_mpz_t __gen_e_acsl_x_3; __e_acsl_mpz_t __gen_e_acsl__4; __e_acsl_mpz_t __gen_e_acsl_add; __e_acsl_mpz_t __gen_e_acsl__5; __e_acsl_mpz_t __gen_e_acsl_neg_3; int __gen_e_acsl_eq_3; __gmpz_init_set_si(__gen_e_acsl_x_3,(long)x); __gmpz_init_set_si(__gen_e_acsl__4,1L); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_3), (__e_acsl_mpz_struct const *)(__gen_e_acsl__4)); __gmpz_init_set_si(__gen_e_acsl__5,2L); __gmpz_init(__gen_e_acsl_neg_3); __gmpz_neg(__gen_e_acsl_neg_3, (__e_acsl_mpz_struct const *)(__gen_e_acsl__5)); __gen_e_acsl_eq_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_3)); __e_acsl_assert(__gen_e_acsl_eq_3 == 0,(char *)"Assertion", (char *)"main",(char *)"x + 1 == -2",14); __gmpz_clear(__gen_e_acsl_x_3); __gmpz_clear(__gen_e_acsl__4); __gmpz_clear(__gen_e_acsl_add); __gmpz_clear(__gen_e_acsl__5); __gmpz_clear(__gen_e_acsl_neg_3); } /*@ assert x - 1 ≡ -4; */ { __e_acsl_mpz_t __gen_e_acsl_x_4; __e_acsl_mpz_t __gen_e_acsl__6; __e_acsl_mpz_t __gen_e_acsl_sub; __e_acsl_mpz_t __gen_e_acsl__7; __e_acsl_mpz_t __gen_e_acsl_neg_4; int __gen_e_acsl_eq_4; __gmpz_init_set_si(__gen_e_acsl_x_4,(long)x); __gmpz_init_set_si(__gen_e_acsl__6,1L); __gmpz_init(__gen_e_acsl_sub); __gmpz_sub(__gen_e_acsl_sub, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_4), (__e_acsl_mpz_struct const *)(__gen_e_acsl__6)); __gmpz_init_set_si(__gen_e_acsl__7,4L); __gmpz_init(__gen_e_acsl_neg_4); __gmpz_neg(__gen_e_acsl_neg_4, (__e_acsl_mpz_struct const *)(__gen_e_acsl__7)); __gen_e_acsl_eq_4 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_sub), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_4)); __e_acsl_assert(__gen_e_acsl_eq_4 == 0,(char *)"Assertion", (char *)"main",(char *)"x - 1 == -4",15); __gmpz_clear(__gen_e_acsl_x_4); __gmpz_clear(__gen_e_acsl__6); __gmpz_clear(__gen_e_acsl_sub); __gmpz_clear(__gen_e_acsl__7); __gmpz_clear(__gen_e_acsl_neg_4); } /*@ assert x * 3 ≡ -9; */ { __e_acsl_mpz_t __gen_e_acsl_x_5; __e_acsl_mpz_t __gen_e_acsl__8; __e_acsl_mpz_t __gen_e_acsl_mul; __e_acsl_mpz_t __gen_e_acsl__9; __e_acsl_mpz_t __gen_e_acsl_neg_5; int __gen_e_acsl_eq_5; __gmpz_init_set_si(__gen_e_acsl_x_5,(long)x); __gmpz_init_set_si(__gen_e_acsl__8,3L); __gmpz_init(__gen_e_acsl_mul); __gmpz_mul(__gen_e_acsl_mul, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_5), (__e_acsl_mpz_struct const *)(__gen_e_acsl__8)); __gmpz_init_set_si(__gen_e_acsl__9,9L); __gmpz_init(__gen_e_acsl_neg_5); __gmpz_neg(__gen_e_acsl_neg_5, (__e_acsl_mpz_struct const *)(__gen_e_acsl__9)); __gen_e_acsl_eq_5 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_5)); __e_acsl_assert(__gen_e_acsl_eq_5 == 0,(char *)"Assertion", (char *)"main",(char *)"x * 3 == -9",16); __gmpz_clear(__gen_e_acsl_x_5); __gmpz_clear(__gen_e_acsl__8); __gmpz_clear(__gen_e_acsl_mul); __gmpz_clear(__gen_e_acsl__9); __gmpz_clear(__gen_e_acsl_neg_5); } /*@ assert x / 3 ≡ -1; */ { __e_acsl_mpz_t __gen_e_acsl_x_6; __e_acsl_mpz_t __gen_e_acsl__10; __e_acsl_mpz_t __gen_e_acsl__11; int __gen_e_acsl_div_guard; __e_acsl_mpz_t __gen_e_acsl_div; __e_acsl_mpz_t __gen_e_acsl__12; __e_acsl_mpz_t __gen_e_acsl_neg_6; int __gen_e_acsl_eq_6; __gmpz_init_set_si(__gen_e_acsl_x_6,(long)x); __gmpz_init_set_si(__gen_e_acsl__10,3L); __gmpz_init_set_si(__gen_e_acsl__11,0L); __gen_e_acsl_div_guard = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__10), (__e_acsl_mpz_struct const *)(__gen_e_acsl__11)); __gmpz_init(__gen_e_acsl_div); /*@ assert E_ACSL: 3 ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_div_guard == 0),(char *)"Assertion", (char *)"main",(char *)"3 == 0",17); __gmpz_tdiv_q(__gen_e_acsl_div, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_6), (__e_acsl_mpz_struct const *)(__gen_e_acsl__10)); __gmpz_init_set_si(__gen_e_acsl__12,1L); __gmpz_init(__gen_e_acsl_neg_6); __gmpz_neg(__gen_e_acsl_neg_6, (__e_acsl_mpz_struct const *)(__gen_e_acsl__12)); __gen_e_acsl_eq_6 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_div), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_6)); __e_acsl_assert(__gen_e_acsl_eq_6 == 0,(char *)"Assertion", (char *)"main",(char *)"x / 3 == -1",17); __gmpz_clear(__gen_e_acsl_x_6); __gmpz_clear(__gen_e_acsl__10); __gmpz_clear(__gen_e_acsl__11); __gmpz_clear(__gen_e_acsl_div); __gmpz_clear(__gen_e_acsl__12); __gmpz_clear(__gen_e_acsl_neg_6); } /*@ assert 0xffffffffffffffffffffff / 0xffffffffffffffffffffff ≡ 1; */ { __e_acsl_mpz_t __gen_e_acsl__13; __e_acsl_mpz_t __gen_e_acsl__14; int __gen_e_acsl_div_guard_2; __e_acsl_mpz_t __gen_e_acsl_div_2; __e_acsl_mpz_t __gen_e_acsl__15; int __gen_e_acsl_eq_7; __gmpz_init_set_str(__gen_e_acsl__13,"309485009821345068724781055",10); __gmpz_init_set_si(__gen_e_acsl__14,0L); __gen_e_acsl_div_guard_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__13), (__e_acsl_mpz_struct const *)(__gen_e_acsl__14)); __gmpz_init(__gen_e_acsl_div_2); /*@ assert E_ACSL: 0xffffffffffffffffffffff ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_div_guard_2 == 0),(char *)"Assertion", (char *)"main",(char *)"0xffffffffffffffffffffff == 0", 18); __gmpz_tdiv_q(__gen_e_acsl_div_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl__13), (__e_acsl_mpz_struct const *)(__gen_e_acsl__13)); __gmpz_init_set_si(__gen_e_acsl__15,1L); __gen_e_acsl_eq_7 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_div_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__15)); __e_acsl_assert(__gen_e_acsl_eq_7 == 0,(char *)"Assertion", (char *)"main", (char *)"0xffffffffffffffffffffff / 0xffffffffffffffffffffff == 1", 18); __gmpz_clear(__gen_e_acsl__13); __gmpz_clear(__gen_e_acsl__14); __gmpz_clear(__gen_e_acsl_div_2); __gmpz_clear(__gen_e_acsl__15); } /*@ assert x % 2 ≡ -1; */ { __e_acsl_mpz_t __gen_e_acsl_x_7; __e_acsl_mpz_t __gen_e_acsl__16; __e_acsl_mpz_t __gen_e_acsl__17; int __gen_e_acsl_mod_guard; __e_acsl_mpz_t __gen_e_acsl_mod; __e_acsl_mpz_t __gen_e_acsl__18; __e_acsl_mpz_t __gen_e_acsl_neg_7; int __gen_e_acsl_eq_8; __gmpz_init_set_si(__gen_e_acsl_x_7,(long)x); __gmpz_init_set_si(__gen_e_acsl__16,2L); __gmpz_init_set_si(__gen_e_acsl__17,0L); __gen_e_acsl_mod_guard = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__16), (__e_acsl_mpz_struct const *)(__gen_e_acsl__17)); __gmpz_init(__gen_e_acsl_mod); /*@ assert E_ACSL: 2 ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_mod_guard == 0),(char *)"Assertion", (char *)"main",(char *)"2 == 0",19); __gmpz_tdiv_r(__gen_e_acsl_mod, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_7), (__e_acsl_mpz_struct const *)(__gen_e_acsl__16)); __gmpz_init_set_si(__gen_e_acsl__18,1L); __gmpz_init(__gen_e_acsl_neg_7); __gmpz_neg(__gen_e_acsl_neg_7, (__e_acsl_mpz_struct const *)(__gen_e_acsl__18)); __gen_e_acsl_eq_8 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_mod), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_7)); __e_acsl_assert(__gen_e_acsl_eq_8 == 0,(char *)"Assertion", (char *)"main",(char *)"x % 2 == -1",19); __gmpz_clear(__gen_e_acsl_x_7); __gmpz_clear(__gen_e_acsl__16); __gmpz_clear(__gen_e_acsl__17); __gmpz_clear(__gen_e_acsl_mod); __gmpz_clear(__gen_e_acsl__18); __gmpz_clear(__gen_e_acsl_neg_7); } /*@ assert -3 % -2 ≡ -1; */ { __e_acsl_mpz_t __gen_e_acsl__19; __e_acsl_mpz_t __gen_e_acsl_neg_8; __e_acsl_mpz_t __gen_e_acsl__20; __e_acsl_mpz_t __gen_e_acsl_neg_9; __e_acsl_mpz_t __gen_e_acsl__21; int __gen_e_acsl_mod_guard_2; __e_acsl_mpz_t __gen_e_acsl_mod_2; __e_acsl_mpz_t __gen_e_acsl__22; __e_acsl_mpz_t __gen_e_acsl_neg_10; int __gen_e_acsl_eq_9; __gmpz_init_set_si(__gen_e_acsl__19,3L); __gmpz_init(__gen_e_acsl_neg_8); __gmpz_neg(__gen_e_acsl_neg_8, (__e_acsl_mpz_struct const *)(__gen_e_acsl__19)); __gmpz_init_set_si(__gen_e_acsl__20,2L); __gmpz_init(__gen_e_acsl_neg_9); __gmpz_neg(__gen_e_acsl_neg_9, (__e_acsl_mpz_struct const *)(__gen_e_acsl__20)); __gmpz_init_set_si(__gen_e_acsl__21,0L); __gen_e_acsl_mod_guard_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_9), (__e_acsl_mpz_struct const *)(__gen_e_acsl__21)); __gmpz_init(__gen_e_acsl_mod_2); /*@ assert E_ACSL: -2 ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_mod_guard_2 == 0),(char *)"Assertion", (char *)"main",(char *)"-2 == 0",20); __gmpz_tdiv_r(__gen_e_acsl_mod_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_8), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_9)); __gmpz_init_set_si(__gen_e_acsl__22,1L); __gmpz_init(__gen_e_acsl_neg_10); __gmpz_neg(__gen_e_acsl_neg_10, (__e_acsl_mpz_struct const *)(__gen_e_acsl__22)); __gen_e_acsl_eq_9 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_mod_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_10)); __e_acsl_assert(__gen_e_acsl_eq_9 == 0,(char *)"Assertion", (char *)"main",(char *)"-3 % -2 == -1",20); __gmpz_clear(__gen_e_acsl__19); __gmpz_clear(__gen_e_acsl_neg_8); __gmpz_clear(__gen_e_acsl__20); __gmpz_clear(__gen_e_acsl_neg_9); __gmpz_clear(__gen_e_acsl__21); __gmpz_clear(__gen_e_acsl_mod_2); __gmpz_clear(__gen_e_acsl__22); __gmpz_clear(__gen_e_acsl_neg_10); } /*@ assert 3 % -2 ≡ 1; */ { __e_acsl_mpz_t __gen_e_acsl__23; __e_acsl_mpz_t __gen_e_acsl__24; __e_acsl_mpz_t __gen_e_acsl_neg_11; __e_acsl_mpz_t __gen_e_acsl__25; int __gen_e_acsl_mod_guard_3; __e_acsl_mpz_t __gen_e_acsl_mod_3; __e_acsl_mpz_t __gen_e_acsl__26; int __gen_e_acsl_eq_10; __gmpz_init_set_si(__gen_e_acsl__23,3L); __gmpz_init_set_si(__gen_e_acsl__24,2L); __gmpz_init(__gen_e_acsl_neg_11); __gmpz_neg(__gen_e_acsl_neg_11, (__e_acsl_mpz_struct const *)(__gen_e_acsl__24)); __gmpz_init_set_si(__gen_e_acsl__25,0L); __gen_e_acsl_mod_guard_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_11), (__e_acsl_mpz_struct const *)(__gen_e_acsl__25)); __gmpz_init(__gen_e_acsl_mod_3); /*@ assert E_ACSL: -2 ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_mod_guard_3 == 0),(char *)"Assertion", (char *)"main",(char *)"-2 == 0",21); __gmpz_tdiv_r(__gen_e_acsl_mod_3, (__e_acsl_mpz_struct const *)(__gen_e_acsl__23), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_11)); __gmpz_init_set_si(__gen_e_acsl__26,1L); __gen_e_acsl_eq_10 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_mod_3), (__e_acsl_mpz_struct const *)(__gen_e_acsl__26)); __e_acsl_assert(__gen_e_acsl_eq_10 == 0,(char *)"Assertion", (char *)"main",(char *)"3 % -2 == 1",21); __gmpz_clear(__gen_e_acsl__23); __gmpz_clear(__gen_e_acsl__24); __gmpz_clear(__gen_e_acsl_neg_11); __gmpz_clear(__gen_e_acsl__25); __gmpz_clear(__gen_e_acsl_mod_3); __gmpz_clear(__gen_e_acsl__26); } /*@ assert ((x * 2 + (3 + y)) - 4) + (x - y) ≡ -10; */ { __e_acsl_mpz_t __gen_e_acsl_x_8; __e_acsl_mpz_t __gen_e_acsl__27; __e_acsl_mpz_t __gen_e_acsl_mul_2; __e_acsl_mpz_t __gen_e_acsl__28; __e_acsl_mpz_t __gen_e_acsl_y; __e_acsl_mpz_t __gen_e_acsl_add_2; __e_acsl_mpz_t __gen_e_acsl_add_3; __e_acsl_mpz_t __gen_e_acsl__29; __e_acsl_mpz_t __gen_e_acsl_sub_2; __e_acsl_mpz_t __gen_e_acsl_sub_3; __e_acsl_mpz_t __gen_e_acsl_add_4; __e_acsl_mpz_t __gen_e_acsl__30; __e_acsl_mpz_t __gen_e_acsl_neg_12; int __gen_e_acsl_eq_11; __gmpz_init_set_si(__gen_e_acsl_x_8,(long)x); __gmpz_init_set_si(__gen_e_acsl__27,2L); __gmpz_init(__gen_e_acsl_mul_2); __gmpz_mul(__gen_e_acsl_mul_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_8), (__e_acsl_mpz_struct const *)(__gen_e_acsl__27)); __gmpz_init_set_si(__gen_e_acsl__28,3L); __gmpz_init_set_si(__gen_e_acsl_y,(long)y); __gmpz_init(__gen_e_acsl_add_2); __gmpz_add(__gen_e_acsl_add_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl__28), (__e_acsl_mpz_struct const *)(__gen_e_acsl_y)); __gmpz_init(__gen_e_acsl_add_3); __gmpz_add(__gen_e_acsl_add_3, (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2)); __gmpz_init_set_si(__gen_e_acsl__29,4L); __gmpz_init(__gen_e_acsl_sub_2); __gmpz_sub(__gen_e_acsl_sub_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_3), (__e_acsl_mpz_struct const *)(__gen_e_acsl__29)); __gmpz_init(__gen_e_acsl_sub_3); __gmpz_sub(__gen_e_acsl_sub_3, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_8), (__e_acsl_mpz_struct const *)(__gen_e_acsl_y)); __gmpz_init(__gen_e_acsl_add_4); __gmpz_add(__gen_e_acsl_add_4, (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_3)); __gmpz_init_set_si(__gen_e_acsl__30,10L); __gmpz_init(__gen_e_acsl_neg_12); __gmpz_neg(__gen_e_acsl_neg_12, (__e_acsl_mpz_struct const *)(__gen_e_acsl__30)); __gen_e_acsl_eq_11 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add_4), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_12)); __e_acsl_assert(__gen_e_acsl_eq_11 == 0,(char *)"Assertion", (char *)"main", (char *)"((x * 2 + (3 + y)) - 4) + (x - y) == -10",23); __gmpz_clear(__gen_e_acsl_x_8); __gmpz_clear(__gen_e_acsl__27); __gmpz_clear(__gen_e_acsl_mul_2); __gmpz_clear(__gen_e_acsl__28); __gmpz_clear(__gen_e_acsl_y); __gmpz_clear(__gen_e_acsl_add_2); __gmpz_clear(__gen_e_acsl_add_3); __gmpz_clear(__gen_e_acsl__29); __gmpz_clear(__gen_e_acsl_sub_2); __gmpz_clear(__gen_e_acsl_sub_3); __gmpz_clear(__gen_e_acsl_add_4); __gmpz_clear(__gen_e_acsl__30); __gmpz_clear(__gen_e_acsl_neg_12); } /*@ assert (0 ≡ 1) ≡ !(0 ≡ 0); */ { __e_acsl_mpz_t __gen_e_acsl__31; __e_acsl_mpz_t __gen_e_acsl__32; int __gen_e_acsl_eq_12; __e_acsl_mpz_t __gen_e_acsl__33; int __gen_e_acsl_eq_13; __e_acsl_mpz_t __gen_e_acsl__34; int __gen_e_acsl_not; __e_acsl_mpz_t __gen_e_acsl__35; int __gen_e_acsl_eq_14; __gmpz_init_set_si(__gen_e_acsl__31,0L); __gmpz_init_set_si(__gen_e_acsl__32,1L); __gen_e_acsl_eq_12 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__31), (__e_acsl_mpz_struct const *)(__gen_e_acsl__32)); __gmpz_init_set_si(__gen_e_acsl__33,(long)(__gen_e_acsl_eq_12 == 0)); __gen_e_acsl_eq_13 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__31), (__e_acsl_mpz_struct const *)(__gen_e_acsl__31)); __gmpz_init_set_si(__gen_e_acsl__34,(long)(__gen_e_acsl_eq_13 == 0)); __gen_e_acsl_not = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__34), (__e_acsl_mpz_struct const *)(__gen_e_acsl__31)); __gmpz_init_set_si(__gen_e_acsl__35,(long)(__gen_e_acsl_not == 0)); __gen_e_acsl_eq_14 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__33), (__e_acsl_mpz_struct const *)(__gen_e_acsl__35)); __e_acsl_assert(__gen_e_acsl_eq_14 == 0,(char *)"Assertion", (char *)"main",(char *)"(0 == 1) == !(0 == 0)",25); __gmpz_clear(__gen_e_acsl__31); __gmpz_clear(__gen_e_acsl__32); __gmpz_clear(__gen_e_acsl__33); __gmpz_clear(__gen_e_acsl__34); __gmpz_clear(__gen_e_acsl__35); } /*@ assert (0 ≤ -1) ≡ (0 > 0); */ { __e_acsl_mpz_t __gen_e_acsl__36; __e_acsl_mpz_t __gen_e_acsl__37; __e_acsl_mpz_t __gen_e_acsl_neg_13; int __gen_e_acsl_le; __e_acsl_mpz_t __gen_e_acsl__38; int __gen_e_acsl_gt; __e_acsl_mpz_t __gen_e_acsl__39; int __gen_e_acsl_eq_15; __gmpz_init_set_si(__gen_e_acsl__36,0L); __gmpz_init_set_si(__gen_e_acsl__37,1L); __gmpz_init(__gen_e_acsl_neg_13); __gmpz_neg(__gen_e_acsl_neg_13, (__e_acsl_mpz_struct const *)(__gen_e_acsl__37)); __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__36), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_13)); __gmpz_init_set_si(__gen_e_acsl__38,(long)(__gen_e_acsl_le <= 0)); __gen_e_acsl_gt = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__36), (__e_acsl_mpz_struct const *)(__gen_e_acsl__36)); __gmpz_init_set_si(__gen_e_acsl__39,(long)(__gen_e_acsl_gt > 0)); __gen_e_acsl_eq_15 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__38), (__e_acsl_mpz_struct const *)(__gen_e_acsl__39)); __e_acsl_assert(__gen_e_acsl_eq_15 == 0,(char *)"Assertion", (char *)"main",(char *)"(0 <= -1) == (0 > 0)",26); __gmpz_clear(__gen_e_acsl__36); __gmpz_clear(__gen_e_acsl__37); __gmpz_clear(__gen_e_acsl_neg_13); __gmpz_clear(__gen_e_acsl__38); __gmpz_clear(__gen_e_acsl__39); } /*@ assert (0 ≥ -1) ≡ (0 ≤ 0); */ { __e_acsl_mpz_t __gen_e_acsl__40; __e_acsl_mpz_t __gen_e_acsl__41; __e_acsl_mpz_t __gen_e_acsl_neg_14; int __gen_e_acsl_ge; __e_acsl_mpz_t __gen_e_acsl__42; int __gen_e_acsl_le_2; __e_acsl_mpz_t __gen_e_acsl__43; int __gen_e_acsl_eq_16; __gmpz_init_set_si(__gen_e_acsl__40,0L); __gmpz_init_set_si(__gen_e_acsl__41,1L); __gmpz_init(__gen_e_acsl_neg_14); __gmpz_neg(__gen_e_acsl_neg_14, (__e_acsl_mpz_struct const *)(__gen_e_acsl__41)); __gen_e_acsl_ge = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__40), (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_14)); __gmpz_init_set_si(__gen_e_acsl__42,(long)(__gen_e_acsl_ge >= 0)); __gen_e_acsl_le_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__40), (__e_acsl_mpz_struct const *)(__gen_e_acsl__40)); __gmpz_init_set_si(__gen_e_acsl__43,(long)(__gen_e_acsl_le_2 <= 0)); __gen_e_acsl_eq_16 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__42), (__e_acsl_mpz_struct const *)(__gen_e_acsl__43)); __e_acsl_assert(__gen_e_acsl_eq_16 == 0,(char *)"Assertion", (char *)"main",(char *)"(0 >= -1) == (0 <= 0)",27); __gmpz_clear(__gen_e_acsl__40); __gmpz_clear(__gen_e_acsl__41); __gmpz_clear(__gen_e_acsl_neg_14); __gmpz_clear(__gen_e_acsl__42); __gmpz_clear(__gen_e_acsl__43); } /*@ assert (0 ≢ 1) ≡ !(0 ≢ 0); */ { __e_acsl_mpz_t __gen_e_acsl__44; __e_acsl_mpz_t __gen_e_acsl__45; int __gen_e_acsl_ne_2; __e_acsl_mpz_t __gen_e_acsl__46; int __gen_e_acsl_ne_3; __e_acsl_mpz_t __gen_e_acsl__47; int __gen_e_acsl_not_2; __e_acsl_mpz_t __gen_e_acsl__48; int __gen_e_acsl_eq_17; __gmpz_init_set_si(__gen_e_acsl__44,0L); __gmpz_init_set_si(__gen_e_acsl__45,1L); __gen_e_acsl_ne_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__44), (__e_acsl_mpz_struct const *)(__gen_e_acsl__45)); __gmpz_init_set_si(__gen_e_acsl__46,(long)(__gen_e_acsl_ne_2 != 0)); __gen_e_acsl_ne_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__44), (__e_acsl_mpz_struct const *)(__gen_e_acsl__44)); __gmpz_init_set_si(__gen_e_acsl__47,(long)(__gen_e_acsl_ne_3 != 0)); __gen_e_acsl_not_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__47), (__e_acsl_mpz_struct const *)(__gen_e_acsl__44)); __gmpz_init_set_si(__gen_e_acsl__48,(long)(__gen_e_acsl_not_2 == 0)); __gen_e_acsl_eq_17 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__46), (__e_acsl_mpz_struct const *)(__gen_e_acsl__48)); __e_acsl_assert(__gen_e_acsl_eq_17 == 0,(char *)"Assertion", (char *)"main",(char *)"(0 != 1) == !(0 != 0)",28); __gmpz_clear(__gen_e_acsl__44); __gmpz_clear(__gen_e_acsl__45); __gmpz_clear(__gen_e_acsl__46); __gmpz_clear(__gen_e_acsl__47); __gmpz_clear(__gen_e_acsl__48); } /*@ assert (0 ≢ 0) ≡ !(1 ≢ 0); */ { __e_acsl_mpz_t __gen_e_acsl__49; int __gen_e_acsl_ne_4; __e_acsl_mpz_t __gen_e_acsl__50; __e_acsl_mpz_t __gen_e_acsl__51; int __gen_e_acsl_ne_5; __e_acsl_mpz_t __gen_e_acsl__52; int __gen_e_acsl_not_3; __e_acsl_mpz_t __gen_e_acsl__53; int __gen_e_acsl_eq_18; __gmpz_init_set_si(__gen_e_acsl__49,0L); __gen_e_acsl_ne_4 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__49), (__e_acsl_mpz_struct const *)(__gen_e_acsl__49)); __gmpz_init_set_si(__gen_e_acsl__50,(long)(__gen_e_acsl_ne_4 != 0)); __gmpz_init_set_si(__gen_e_acsl__51,1L); __gen_e_acsl_ne_5 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__51), (__e_acsl_mpz_struct const *)(__gen_e_acsl__49)); __gmpz_init_set_si(__gen_e_acsl__52,(long)(__gen_e_acsl_ne_5 != 0)); __gen_e_acsl_not_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__52), (__e_acsl_mpz_struct const *)(__gen_e_acsl__49)); __gmpz_init_set_si(__gen_e_acsl__53,(long)(__gen_e_acsl_not_3 == 0)); __gen_e_acsl_eq_18 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__50), (__e_acsl_mpz_struct const *)(__gen_e_acsl__53)); __e_acsl_assert(__gen_e_acsl_eq_18 == 0,(char *)"Assertion", (char *)"main",(char *)"(0 != 0) == !(1 != 0)",30); __gmpz_clear(__gen_e_acsl__49); __gmpz_clear(__gen_e_acsl__50); __gmpz_clear(__gen_e_acsl__51); __gmpz_clear(__gen_e_acsl__52); __gmpz_clear(__gen_e_acsl__53); } /*@ assert 4 / y ≡ 2; */ { __e_acsl_mpz_t __gen_e_acsl__54; __e_acsl_mpz_t __gen_e_acsl_y_2; __e_acsl_mpz_t __gen_e_acsl__55; int __gen_e_acsl_div_guard_3; __e_acsl_mpz_t __gen_e_acsl_div_3; __e_acsl_mpz_t __gen_e_acsl__56; int __gen_e_acsl_eq_19; __gmpz_init_set_si(__gen_e_acsl__54,4L); __gmpz_init_set_si(__gen_e_acsl_y_2,(long)y); __gmpz_init_set_si(__gen_e_acsl__55,0L); __gen_e_acsl_div_guard_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_y_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__55)); __gmpz_init(__gen_e_acsl_div_3); /*@ assert E_ACSL: y ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_div_guard_3 == 0),(char *)"Assertion", (char *)"main",(char *)"y == 0",31); __gmpz_tdiv_q(__gen_e_acsl_div_3, (__e_acsl_mpz_struct const *)(__gen_e_acsl__54), (__e_acsl_mpz_struct const *)(__gen_e_acsl_y_2)); __gmpz_init_set_si(__gen_e_acsl__56,2L); __gen_e_acsl_eq_19 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_div_3), (__e_acsl_mpz_struct const *)(__gen_e_acsl__56)); __e_acsl_assert(__gen_e_acsl_eq_19 == 0,(char *)"Assertion", (char *)"main",(char *)"4 / y == 2",31); __gmpz_clear(__gen_e_acsl__54); __gmpz_clear(__gen_e_acsl_y_2); __gmpz_clear(__gen_e_acsl__55); __gmpz_clear(__gen_e_acsl_div_3); __gmpz_clear(__gen_e_acsl__56); } /*@ assert 1 + (z + 1) / (y - 123456789123456789) ≡ 1; */ { __e_acsl_mpz_t __gen_e_acsl__57; __e_acsl_mpz_t __gen_e_acsl_z; __e_acsl_mpz_t __gen_e_acsl_add_5; __e_acsl_mpz_t __gen_e_acsl_y_3; __e_acsl_mpz_t __gen_e_acsl__58; __e_acsl_mpz_t __gen_e_acsl_sub_4; __e_acsl_mpz_t __gen_e_acsl__59; int __gen_e_acsl_div_guard_4; __e_acsl_mpz_t __gen_e_acsl_div_4; __e_acsl_mpz_t __gen_e_acsl_add_6; int __gen_e_acsl_eq_20; __gmpz_init_set_si(__gen_e_acsl__57,1L); __gmpz_init_set_si(__gen_e_acsl_z,z); __gmpz_init(__gen_e_acsl_add_5); __gmpz_add(__gen_e_acsl_add_5, (__e_acsl_mpz_struct const *)(__gen_e_acsl_z), (__e_acsl_mpz_struct const *)(__gen_e_acsl__57)); __gmpz_init_set_si(__gen_e_acsl_y_3,(long)y); __gmpz_init_set_ui(__gen_e_acsl__58,123456789123456789UL); __gmpz_init(__gen_e_acsl_sub_4); __gmpz_sub(__gen_e_acsl_sub_4, (__e_acsl_mpz_struct const *)(__gen_e_acsl_y_3), (__e_acsl_mpz_struct const *)(__gen_e_acsl__58)); __gmpz_init_set_si(__gen_e_acsl__59,0L); __gen_e_acsl_div_guard_4 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_4), (__e_acsl_mpz_struct const *)(__gen_e_acsl__59)); __gmpz_init(__gen_e_acsl_div_4); /*@ assert E_ACSL: y - 123456789123456789 ≢ 0; */ __e_acsl_assert(! (__gen_e_acsl_div_guard_4 == 0),(char *)"Assertion", (char *)"main",(char *)"y - 123456789123456789 == 0",34); __gmpz_tdiv_q(__gen_e_acsl_div_4, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_5), (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_4)); __gmpz_init(__gen_e_acsl_add_6); __gmpz_add(__gen_e_acsl_add_6, (__e_acsl_mpz_struct const *)(__gen_e_acsl__57), (__e_acsl_mpz_struct const *)(__gen_e_acsl_div_4)); __gen_e_acsl_eq_20 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add_6), (__e_acsl_mpz_struct const *)(__gen_e_acsl__57)); __e_acsl_assert(__gen_e_acsl_eq_20 == 0,(char *)"Assertion", (char *)"main", (char *)"1 + (z + 1) / (y - 123456789123456789) == 1",34); __gmpz_clear(__gen_e_acsl__57); __gmpz_clear(__gen_e_acsl_z); __gmpz_clear(__gen_e_acsl_add_5); __gmpz_clear(__gen_e_acsl_y_3); __gmpz_clear(__gen_e_acsl__58); __gmpz_clear(__gen_e_acsl_sub_4); __gmpz_clear(__gen_e_acsl__59); __gmpz_clear(__gen_e_acsl_div_4); __gmpz_clear(__gen_e_acsl_add_6); } /*@ assert 1 - x ≡ -x + 1; */ { __e_acsl_mpz_t __gen_e_acsl__60; __e_acsl_mpz_t __gen_e_acsl_x_9; __e_acsl_mpz_t __gen_e_acsl_sub_5; __e_acsl_mpz_t __gen_e_acsl_neg_15; __e_acsl_mpz_t __gen_e_acsl_add_7; int __gen_e_acsl_eq_21; __gmpz_init_set_si(__gen_e_acsl__60,1L); __gmpz_init_set_si(__gen_e_acsl_x_9,(long)x); __gmpz_init(__gen_e_acsl_sub_5); __gmpz_sub(__gen_e_acsl_sub_5, (__e_acsl_mpz_struct const *)(__gen_e_acsl__60), (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_9)); __gmpz_init(__gen_e_acsl_neg_15); __gmpz_neg(__gen_e_acsl_neg_15, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_9)); __gmpz_init(__gen_e_acsl_add_7); __gmpz_add(__gen_e_acsl_add_7, (__e_acsl_mpz_struct const *)(__gen_e_acsl_neg_15), (__e_acsl_mpz_struct const *)(__gen_e_acsl__60)); __gen_e_acsl_eq_21 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_5), (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_7)); __e_acsl_assert(__gen_e_acsl_eq_21 == 0,(char *)"Assertion", (char *)"main",(char *)"1 - x == -x + 1",36); __gmpz_clear(__gen_e_acsl__60); __gmpz_clear(__gen_e_acsl_x_9); __gmpz_clear(__gen_e_acsl_sub_5); __gmpz_clear(__gen_e_acsl_neg_15); __gmpz_clear(__gen_e_acsl_add_7); } __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/oracle_ci/gen_functions.c0000666000000000000000000003711413571573400024466 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; struct mystruct { int k ; int l ; }; typedef struct mystruct mystruct; /*@ predicate p1(int x, int y) = x + y > 0; */ int __gen_e_acsl_p1(int x, int y); /*@ predicate p2(ℤ x, ℤ y) = x + y > 0; */ int __gen_e_acsl_p2(int x, int y); int __gen_e_acsl_p2_3(int x, __e_acsl_mpz_struct * y); /*@ logic ℤ f1(ℤ x, ℤ y) = x + y; */ void __gen_e_acsl_f1(__e_acsl_mpz_t *__retres_arg, int x, int y); void __gen_e_acsl_f1_5(__e_acsl_mpz_t *__retres_arg, int x, __e_acsl_mpz_struct * y); void __gen_e_acsl_f1_7(__e_acsl_mpz_t *__retres_arg, __e_acsl_mpz_struct * x, __e_acsl_mpz_struct * y); /*@ logic char h_char(char c) = c; */ int __gen_e_acsl_h_char(int c); /*@ logic short h_short(short s) = s; */ int __gen_e_acsl_h_short(int s); /*@ logic int g_hidden(int x) = x; */ int __gen_e_acsl_g_hidden(int x); /*@ logic int g(int x) = g_hidden(x); */ int __gen_e_acsl_g(int x); /*@ logic mystruct t1(mystruct m) = m; */ mystruct __gen_e_acsl_t1(mystruct m); /*@ logic ℤ t2(mystruct m) = m.k + m.l; */ void __gen_e_acsl_t2(__e_acsl_mpz_t *__retres_arg, mystruct m); /*@ predicate k_pred(ℤ x) = x > 0; */ int __gen_e_acsl_k_pred(int x); /*@ requires k_pred(x); */ void __gen_e_acsl_k(int x); void k(int x) { return; } int glob = 5; /*@ predicate never_called(int x) = x ≡ x; */ /*@ logic double f2(double x) = (double)(1 / x); */ double __gen_e_acsl_f2(double x); /*@ predicate p_notyet{L}(ℤ x) = x > 0; */ /*@ logic ℤ f_notyet{L}(ℤ x) = x; */ int main(void) { int __retres; mystruct m; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 1; int y = 2; /*@ assert p1(x, y); */ { int __gen_e_acsl_p1_2; __gen_e_acsl_p1_2 = __gen_e_acsl_p1(x,y); __e_acsl_assert(__gen_e_acsl_p1_2,(char *)"Assertion",(char *)"main", (char *)"p1(x, y)",42); } /*@ assert p2(3, 4); */ { int __gen_e_acsl_p2_2; __gen_e_acsl_p2_2 = __gen_e_acsl_p2(3,4); __e_acsl_assert(__gen_e_acsl_p2_2,(char *)"Assertion",(char *)"main", (char *)"p2(3, 4)",43); } /*@ assert p2(5, 99999999999999999999999999999); */ { __e_acsl_mpz_t __gen_e_acsl__3; int __gen_e_acsl_p2_4; __gmpz_init_set_str(__gen_e_acsl__3,"99999999999999999999999999999",10); __gen_e_acsl_p2_4 = __gen_e_acsl_p2_3(5, (__e_acsl_mpz_struct *)__gen_e_acsl__3); __e_acsl_assert(__gen_e_acsl_p2_4,(char *)"Assertion",(char *)"main", (char *)"p2(5, 99999999999999999999999999999)",44); __gmpz_clear(__gen_e_acsl__3); } /*@ assert f1(x, y) ≡ 3; */ { __e_acsl_mpz_t __gen_e_acsl_f1_2; __e_acsl_mpz_t __gen_e_acsl__5; int __gen_e_acsl_eq; __gen_e_acsl_f1(& __gen_e_acsl_f1_2,x,y); __gmpz_init_set_si(__gen_e_acsl__5,3L); __gen_e_acsl_eq = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__5)); __e_acsl_assert(__gen_e_acsl_eq == 0,(char *)"Assertion",(char *)"main", (char *)"f1(x, y) == 3",46); __gmpz_clear(__gen_e_acsl_f1_2); __gmpz_clear(__gen_e_acsl__5); } /*@ assert p2(x, f1(3, 4)); */ { __e_acsl_mpz_t __gen_e_acsl_f1_4; int __gen_e_acsl_p2_6; __gen_e_acsl_f1(& __gen_e_acsl_f1_4,3,4); /*@ assert Eva: initialization: \initialized((__e_acsl_mpz_struct *)__gen_e_acsl_f1_4); */ __gen_e_acsl_p2_6 = __gen_e_acsl_p2_3(x, (__e_acsl_mpz_struct *)__gen_e_acsl_f1_4); __e_acsl_assert(__gen_e_acsl_p2_6,(char *)"Assertion",(char *)"main", (char *)"p2(x, f1(3, 4))",47); __gmpz_clear(__gen_e_acsl_f1_4); } /*@ assert f1(9, 99999999999999999999999999999) > 0; */ { __e_acsl_mpz_t __gen_e_acsl__6; __e_acsl_mpz_t __gen_e_acsl_f1_6; __e_acsl_mpz_t __gen_e_acsl__7; int __gen_e_acsl_gt_4; __gmpz_init_set_str(__gen_e_acsl__6,"99999999999999999999999999999",10); __gen_e_acsl_f1_5(& __gen_e_acsl_f1_6,9, (__e_acsl_mpz_struct *)__gen_e_acsl__6); __gmpz_init_set_si(__gen_e_acsl__7,0L); __gen_e_acsl_gt_4 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_6), (__e_acsl_mpz_struct const *)(__gen_e_acsl__7)); __e_acsl_assert(__gen_e_acsl_gt_4 > 0,(char *)"Assertion",(char *)"main", (char *)"f1(9, 99999999999999999999999999999) > 0",48); __gmpz_clear(__gen_e_acsl__6); __gmpz_clear(__gen_e_acsl_f1_6); __gmpz_clear(__gen_e_acsl__7); } /*@ assert f1(99999999999999999999999999999, 99999999999999999999999999999) ≡ 199999999999999999999999999998; */ { __e_acsl_mpz_t __gen_e_acsl__8; __e_acsl_mpz_t __gen_e_acsl_f1_8; __e_acsl_mpz_t __gen_e_acsl__9; int __gen_e_acsl_eq_2; __gmpz_init_set_str(__gen_e_acsl__8,"99999999999999999999999999999",10); __gen_e_acsl_f1_7(& __gen_e_acsl_f1_8, (__e_acsl_mpz_struct *)__gen_e_acsl__8, (__e_acsl_mpz_struct *)__gen_e_acsl__8); __gmpz_init_set_str(__gen_e_acsl__9,"199999999999999999999999999998",10); __gen_e_acsl_eq_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_8), (__e_acsl_mpz_struct const *)(__gen_e_acsl__9)); __e_acsl_assert(__gen_e_acsl_eq_2 == 0,(char *)"Assertion", (char *)"main", (char *)"f1(99999999999999999999999999999, 99999999999999999999999999999) ==\n199999999999999999999999999998", 49); __gmpz_clear(__gen_e_acsl__8); __gmpz_clear(__gen_e_acsl_f1_8); __gmpz_clear(__gen_e_acsl__9); } /*@ assert g(x) ≡ x; */ { int __gen_e_acsl_g_2; __e_acsl_mpz_t __gen_e_acsl_app; __e_acsl_mpz_t __gen_e_acsl_x_6; int __gen_e_acsl_eq_3; __gen_e_acsl_g_2 = __gen_e_acsl_g(x); __gmpz_init_set_si(__gen_e_acsl_app,(long)__gen_e_acsl_g_2); __gmpz_init_set_si(__gen_e_acsl_x_6,(long)x); __gen_e_acsl_eq_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_app), (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_6)); __e_acsl_assert(__gen_e_acsl_eq_3 == 0,(char *)"Assertion", (char *)"main",(char *)"g(x) == x",53); __gmpz_clear(__gen_e_acsl_app); __gmpz_clear(__gen_e_acsl_x_6); } char c = (char)'c'; /*@ assert h_char(c) ≡ c; */ { int __gen_e_acsl_h_char_2; __e_acsl_mpz_t __gen_e_acsl_app_2; __e_acsl_mpz_t __gen_e_acsl_c; int __gen_e_acsl_eq_4; __gen_e_acsl_h_char_2 = __gen_e_acsl_h_char((int)c); __gmpz_init_set_si(__gen_e_acsl_app_2,(long)__gen_e_acsl_h_char_2); __gmpz_init_set_si(__gen_e_acsl_c,(long)c); __gen_e_acsl_eq_4 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_app_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_c)); __e_acsl_assert(__gen_e_acsl_eq_4 == 0,(char *)"Assertion", (char *)"main",(char *)"h_char(c) == c",56); __gmpz_clear(__gen_e_acsl_app_2); __gmpz_clear(__gen_e_acsl_c); } short s = (short)1; /*@ assert h_short(s) ≡ s; */ { int __gen_e_acsl_h_short_2; __e_acsl_mpz_t __gen_e_acsl_app_3; __e_acsl_mpz_t __gen_e_acsl_s; int __gen_e_acsl_eq_5; __gen_e_acsl_h_short_2 = __gen_e_acsl_h_short((int)s); __gmpz_init_set_si(__gen_e_acsl_app_3,(long)__gen_e_acsl_h_short_2); __gmpz_init_set_si(__gen_e_acsl_s,(long)s); __gen_e_acsl_eq_5 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_app_3), (__e_acsl_mpz_struct const *)(__gen_e_acsl_s)); __e_acsl_assert(__gen_e_acsl_eq_5 == 0,(char *)"Assertion", (char *)"main",(char *)"h_short(s) == s",58); __gmpz_clear(__gen_e_acsl_app_3); __gmpz_clear(__gen_e_acsl_s); } m.k = 8; m.l = 9; /*@ assert t2(t1(m)) ≡ 17; */ { mystruct __gen_e_acsl_t1_2; __e_acsl_mpz_t __gen_e_acsl_t2_2; __e_acsl_mpz_t __gen_e_acsl__12; int __gen_e_acsl_eq_6; __gen_e_acsl_t1_2 = __gen_e_acsl_t1(m); __gen_e_acsl_t2(& __gen_e_acsl_t2_2,__gen_e_acsl_t1_2); __gmpz_init_set_si(__gen_e_acsl__12,17L); __gen_e_acsl_eq_6 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_t2_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__12)); __e_acsl_assert(__gen_e_acsl_eq_6 == 0,(char *)"Assertion", (char *)"main",(char *)"t2(t1(m)) == 17",63); __gmpz_clear(__gen_e_acsl_t2_2); __gmpz_clear(__gen_e_acsl__12); } __gen_e_acsl_k(9); double d = 2.0; /*@ assert f2(d) > 0; */ { double __gen_e_acsl_f2_2; __gen_e_acsl_f2_2 = __gen_e_acsl_f2(d); __e_acsl_assert(__gen_e_acsl_f2_2 > 0.,(char *)"Assertion", (char *)"main",(char *)"f2(d) > 0",68); } __retres = 0; return __retres; } /*@ requires k_pred(x); */ void __gen_e_acsl_k(int x) { { int __gen_e_acsl_k_pred_2; __gen_e_acsl_k_pred_2 = __gen_e_acsl_k_pred(x); __e_acsl_assert(__gen_e_acsl_k_pred_2,(char *)"Precondition",(char *)"k", (char *)"k_pred(x)",25); } k(x); return; } int __gen_e_acsl_k_pred(int x) { __e_acsl_mpz_t __gen_e_acsl_x; __e_acsl_mpz_t __gen_e_acsl_; int __gen_e_acsl_gt; __gmpz_init_set_si(__gen_e_acsl_x,(long)x); __gmpz_init_set_si(__gen_e_acsl_,0L); __gen_e_acsl_gt = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_x), (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); int __retres = __gen_e_acsl_gt > 0; __gmpz_clear(__gen_e_acsl_x); __gmpz_clear(__gen_e_acsl_); return __retres; } void __gen_e_acsl_f1(__e_acsl_mpz_t *__retres_arg, int x, int y) { __e_acsl_mpz_t __gen_e_acsl_x_4; __e_acsl_mpz_t __gen_e_acsl_y_3; __e_acsl_mpz_t __gen_e_acsl_add_4; __gmpz_init_set_si(__gen_e_acsl_x_4,(long)x); __gmpz_init_set_si(__gen_e_acsl_y_3,(long)y); __gmpz_init(__gen_e_acsl_add_4); __gmpz_add(__gen_e_acsl_add_4, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_4), (__e_acsl_mpz_struct const *)(__gen_e_acsl_y_3)); __gmpz_init_set(*__retres_arg, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_4)); __gmpz_clear(__gen_e_acsl_x_4); __gmpz_clear(__gen_e_acsl_y_3); __gmpz_clear(__gen_e_acsl_add_4); return; } void __gen_e_acsl_f1_5(__e_acsl_mpz_t *__retres_arg, int x, __e_acsl_mpz_struct * y) { __e_acsl_mpz_t __gen_e_acsl_x_5; __e_acsl_mpz_t __gen_e_acsl_add_5; __gmpz_init_set_si(__gen_e_acsl_x_5,(long)x); __gmpz_init(__gen_e_acsl_add_5); __gmpz_add(__gen_e_acsl_add_5, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_5), (__e_acsl_mpz_struct const *)(y)); __gmpz_init_set(*__retres_arg, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_5)); __gmpz_clear(__gen_e_acsl_x_5); __gmpz_clear(__gen_e_acsl_add_5); return; } void __gen_e_acsl_f1_7(__e_acsl_mpz_t *__retres_arg, __e_acsl_mpz_struct * x, __e_acsl_mpz_struct * y) { __e_acsl_mpz_t __gen_e_acsl_add_6; __gmpz_init(__gen_e_acsl_add_6); __gmpz_add(__gen_e_acsl_add_6,(__e_acsl_mpz_struct const *)(x), (__e_acsl_mpz_struct const *)(y)); __gmpz_init_set(*__retres_arg, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_6)); __gmpz_clear(__gen_e_acsl_add_6); return; } int __gen_e_acsl_h_char(int c) { return c; } int __gen_e_acsl_h_short(int s) { return s; } int __gen_e_acsl_g_hidden(int x) { return x; } double __gen_e_acsl_f2(double x) { __e_acsl_mpq_t __gen_e_acsl__13; __e_acsl_mpq_t __gen_e_acsl__14; __e_acsl_mpq_t __gen_e_acsl_div; double __gen_e_acsl__15; __gmpq_init(__gen_e_acsl__13); __gmpq_set_str(__gen_e_acsl__13,"1",10); __gmpq_init(__gen_e_acsl__14); __gmpq_set_d(__gen_e_acsl__14,x); __gmpq_init(__gen_e_acsl_div); __gmpq_div(__gen_e_acsl_div, (__e_acsl_mpq_struct const *)(__gen_e_acsl__13), (__e_acsl_mpq_struct const *)(__gen_e_acsl__14)); __gen_e_acsl__15 = __gmpq_get_d((__e_acsl_mpq_struct const *)(__gen_e_acsl_div)); __gmpq_clear(__gen_e_acsl__13); __gmpq_clear(__gen_e_acsl__14); __gmpq_clear(__gen_e_acsl_div); /*@ assert Eva: is_nan_or_infinite: \is_finite(__gen_e_acsl__15); */ return __gen_e_acsl__15; } int __gen_e_acsl_g(int x) { int __gen_e_acsl_g_hidden_2; __gen_e_acsl_g_hidden_2 = __gen_e_acsl_g_hidden(x); return __gen_e_acsl_g_hidden_2; } mystruct __gen_e_acsl_t1(mystruct m) { return m; } int __gen_e_acsl_p1(int x, int y) { __e_acsl_mpz_t __gen_e_acsl_x; __e_acsl_mpz_t __gen_e_acsl_y; __e_acsl_mpz_t __gen_e_acsl_add; __e_acsl_mpz_t __gen_e_acsl_; int __gen_e_acsl_gt; __gmpz_init_set_si(__gen_e_acsl_x,(long)x); __gmpz_init_set_si(__gen_e_acsl_y,(long)y); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add,(__e_acsl_mpz_struct const *)(__gen_e_acsl_x), (__e_acsl_mpz_struct const *)(__gen_e_acsl_y)); __gmpz_init_set_si(__gen_e_acsl_,0L); __gen_e_acsl_gt = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add), (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); int __retres = __gen_e_acsl_gt > 0; __gmpz_clear(__gen_e_acsl_x); __gmpz_clear(__gen_e_acsl_y); __gmpz_clear(__gen_e_acsl_add); __gmpz_clear(__gen_e_acsl_); return __retres; } void __gen_e_acsl_t2(__e_acsl_mpz_t *__retres_arg, mystruct m) { __e_acsl_mpz_t __gen_e_acsl__10; __e_acsl_mpz_t __gen_e_acsl__11; __e_acsl_mpz_t __gen_e_acsl_add_7; __gmpz_init_set_si(__gen_e_acsl__10,(long)m.k); __gmpz_init_set_si(__gen_e_acsl__11,(long)m.l); __gmpz_init(__gen_e_acsl_add_7); __gmpz_add(__gen_e_acsl_add_7, (__e_acsl_mpz_struct const *)(__gen_e_acsl__10), (__e_acsl_mpz_struct const *)(__gen_e_acsl__11)); __gmpz_init_set(*__retres_arg, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_7)); __gmpz_clear(__gen_e_acsl__10); __gmpz_clear(__gen_e_acsl__11); __gmpz_clear(__gen_e_acsl_add_7); return; } int __gen_e_acsl_p2(int x, int y) { __e_acsl_mpz_t __gen_e_acsl_x_2; __e_acsl_mpz_t __gen_e_acsl_y_2; __e_acsl_mpz_t __gen_e_acsl_add_2; __e_acsl_mpz_t __gen_e_acsl__2; int __gen_e_acsl_gt_2; __gmpz_init_set_si(__gen_e_acsl_x_2,(long)x); __gmpz_init_set_si(__gen_e_acsl_y_2,(long)y); __gmpz_init(__gen_e_acsl_add_2); __gmpz_add(__gen_e_acsl_add_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_y_2)); __gmpz_init_set_si(__gen_e_acsl__2,0L); __gen_e_acsl_gt_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); int __retres = __gen_e_acsl_gt_2 > 0; __gmpz_clear(__gen_e_acsl_x_2); __gmpz_clear(__gen_e_acsl_y_2); __gmpz_clear(__gen_e_acsl_add_2); __gmpz_clear(__gen_e_acsl__2); return __retres; } int __gen_e_acsl_p2_3(int x, __e_acsl_mpz_struct * y) { __e_acsl_mpz_t __gen_e_acsl_x_3; __e_acsl_mpz_t __gen_e_acsl_add_3; __e_acsl_mpz_t __gen_e_acsl__4; int __gen_e_acsl_gt_3; __gmpz_init_set_si(__gen_e_acsl_x_3,(long)x); __gmpz_init(__gen_e_acsl_add_3); __gmpz_add(__gen_e_acsl_add_3, (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_3), (__e_acsl_mpz_struct const *)(y)); __gmpz_init_set_si(__gen_e_acsl__4,0L); __gen_e_acsl_gt_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add_3), (__e_acsl_mpz_struct const *)(__gen_e_acsl__4)); int __retres = __gen_e_acsl_gt_3 > 0; __gmpz_clear(__gen_e_acsl_x_3); __gmpz_clear(__gen_e_acsl_add_3); __gmpz_clear(__gen_e_acsl__4); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/test_config_ci0000666000000000000000000000003413571573400022432 0ustar STDOPT: #"-e-acsl-gmp-only" frama-c-20.0-Calcium/src/plugins/e-acsl/tests/gmp-only/test_config_dev0000666000000000000000000000053413571573400022622 0ustar MACRO: DEST @PTEST_RESULT@/gen_@PTEST_NAME@ MACRO: OUT @PTEST_NAME@.res.log MACRO: ERR @PTEST_NAME@.err.log EXEC: ./scripts/e-acsl-gcc.sh --gmp -q -c -X --frama-c-extra="-journal-disable -verbose 0 -kernel-warn-key *=inactive" -o @DEST@.run.c -O @DEST@.out @PTEST_FILE@ > @PTEST_RESULT@/@OUT@ 2> @PTEST_RESULT@/@ERR@ && ./@DEST@.e-acsl > /dev/null frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/0000777000000000000000000000000013571573400017301 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/addrOf.i0000666000000000000000000000031613571573400020652 0ustar /* run.config COMMENT: addrOf */ void f(){ int m, *u, *p; u = &m; p = u; m = 123; //@ assert \initialized(p); } int main(void) { int x = 0; f(); /*@ assert &x == &x; */ ; return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/alias.i0000666000000000000000000000027113571573400020544 0ustar /* run.config COMMENT: alias */ void f(int* dest, int val) { int *ptr = dest; *ptr = val; } int main() { int i; f(&i, 255); /*@ assert \initialized(&i); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/base_addr.c0000666000000000000000000000342213571573400021352 0ustar /* run.config * COMMENT: Behaviours of the \base_addr E-ACSL predicate */ #include int A[] = { 1, 2, 3, 4}; int *PA; int main(void) { /* Global memory */ PA = (int*)&A; /*@ assert \base_addr(&A[0]) == \base_addr(&A); */ /*@ assert \base_addr(&A[0]) == \base_addr(PA); */ /*@ assert \base_addr(A+3) == \base_addr(PA); */ PA++; /*@ assert \base_addr(PA) == \base_addr(&A[0]); */ /*@ assert \base_addr(PA+2) == \base_addr(A+3); */ /* Stack memory [long blocks] */ int a[] = { 1, 2, 3, 4 }; int *pa; pa = (int*)&a; /*@ assert \base_addr(&a[0]) == \base_addr(&a); */ /*@ assert \base_addr(&a[0]) == \base_addr(pa); */ /*@ assert \base_addr(a+3) == \base_addr(pa); */ pa++; /*@ assert \base_addr(pa) == \base_addr(&a[0]); */ /*@ assert \base_addr(pa+2) == \base_addr(&a[0]); */ /* Stack memory [Short blocks] */ long l = 4; char *pl = (char*)&l; /*@ assert \base_addr(&l) == \base_addr(pl); */ /*@ assert \base_addr(pl+2) == \base_addr(&l); */ short *pi = (short*)&l; pi++; pl++; /*@ assert \base_addr(pi) == \base_addr(pl); */ /*@ assert \base_addr(pl) == \base_addr(&l); */ /* Heap memory [single segment] */ char *p = malloc(12); char *pd = p; /*@ assert \base_addr(p) == \base_addr(pd); */ /*@ assert \base_addr(p+1) == \base_addr(pd+5); */ /*@ assert \base_addr(p+11) == \base_addr(pd+1); */ p += 5; /*@ assert \base_addr(p+5) == \base_addr(pd); */ /*@ assert \base_addr(p-5) == \base_addr(pd); */ /* Heap memory [multiple segments] */ long *q = malloc(30*sizeof(long)); long *qd = q; /*@ assert \base_addr(q) == \base_addr(qd); */ q++; /*@ assert \base_addr(q) == \base_addr(qd); */ q += 2; /*@ assert \base_addr(q) == \base_addr(qd); */ q += 4; /*@ assert \base_addr(q) == \base_addr(qd); */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/block_length.c0000666000000000000000000000320213571573400022075 0ustar /* run.config COMMENT: Behaviours of the \block_length E-ACSL predicate */ #include int A[] = { 1, 2, 3, 4}; int *PA; struct Zero { } ZERO; int main(void) { /* Zero-sized blocks */ struct Zero zero; /*@ assert \block_length(&ZERO) == 0; */ /*@ assert \block_length(&zero) == 0; */ /* Global memory */ PA = (int*)&A; /*@ assert \block_length(&A[0]) == sizeof(A); */ /*@ assert \block_length(A+3) == sizeof(A); */ /*@ assert \block_length(PA) == sizeof(A); */ PA++; /*@ assert \block_length(PA+1) == \block_length(A+1); */ /* Stack memory [long blocks] */ int a[] = { 1, 2, 3, 4}; int *pa = (int*)&a; /*@ assert \block_length(&a[0]) == sizeof(a); */ /*@ assert \block_length(a+3) == sizeof(a); */ /*@ assert \block_length(pa) == sizeof(a); */ pa++; /*@ assert \block_length(pa+1) == \block_length(a+1); */ /* Stack memory [Short blocks] */ long l = 4; char *pl = (char*)&l; /*@ assert \block_length(&l) == sizeof(long); */ /*@ assert \block_length(pl) == sizeof(long); */ /*@ assert \block_length(pl+7) == sizeof(long); */ int *pi = (int*)&l; /*@ assert \block_length(pi) == \block_length(&l); */ pi++; /*@ assert \block_length(pi) == \block_length(&l); */ /* Heap memory [single segment] */ size_t size = 12; char *p = malloc(size); /*@ assert \block_length(p) == size; */ /*@ assert \block_length(p+11) == size; */ p += 5; /*@ assert \block_length(p+5) == \block_length(p-5); */ /* Heap memory [multiple segments] */ size = 30*sizeof(long); long *q = malloc(size); /*@ assert \block_length(q) == size; */ q += 4; /*@ assert \block_length(q) == size; */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/block_valid.c0000666000000000000000000000244413571573400021722 0ustar /* run.config COMMENT: Check violations related to accessing an allocated memory block COMMENT: through a pointer to another block */ #include #include #define ADDROF(_a) ((uintptr_t)_a) int A = 1, B = 2, C = 3; int main(int argc, char **argv) { int *p = NULL, *q = NULL; int a = 1, b = 2, c = 3; p = &b; /*@assert \valid(p); */ /* `p` points to `b`, `p+1` accesses either `a` or `c` */ /*@assert ! \valid(p+1); */ p = &B; /*@assert \valid(p); */ /* `p` points to `B`, `p+1` accesses either `A` or `C` */ /*@assert ! \valid(p+1); */ char *pmin = (char*)malloc(sizeof(int)); char *pmax = (char*)malloc(sizeof(int)); /* Since `pmin` is allocated before `pmax` it is likely that the start * address of `pmin` is less than the start address of `pmax`, still, * just in case, make sure it is true and swap the addresses otherwise. */ if (ADDROF(pmin) > ADDROF(pmax)) { char *t = pmin; pmin = pmax; pmax = t; } *pmin = 'P'; *pmax = 'L'; int diff = (uintptr_t)pmax - (uintptr_t)pmin; /*@assert \valid(pmin); */ /*@assert \valid(pmax); */ /* Access `pmax` through `pmin` */ /*@assert ! \valid(pmin + diff); */ /* Access `pmin` through `pmax` */ /*@assert ! \valid(pmax - diff); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/bypassed_var.c0000666000000000000000000000052013571573400022124 0ustar /* run.config COMMENT: Variable, which declaration is bypassed by a goto jump */ int main(int argc, char const **argv) { goto L; { int *p; L: p = &argc; /* Important to keep this statement here to make sure initialize is ran after store_block */ /*@ assert \valid(&p); */ } return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/call.c0000666000000000000000000000042313571573400020357 0ustar /* run.config COMMENT: function call */ #include /*@ ensures \valid(\result); */ int *f(int *x, int *y) { *y = 1; return x; } int main() { int x = 0, *p, *q = malloc(sizeof(int)), *r = malloc(sizeof(int)); p = f(&x, q); q = f(&x, r); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/compound_initializers.c0000666000000000000000000000137413571573400024064 0ustar /* run.config COMMENT: Compound initializers */ int _F; char *_A[2] = { "XX", "YY" }; char *_B = "ZZ"; char *_C; int _D[] = { 44, 88 }; int _E = 44; int _F = 9;; struct ST { char *str; int num; }; struct ST _G[] = { { .str = "First", .num = 99 }, { .str = "Second", .num = 147 } }; int main(int argc, char **argv) { /*@ assert \valid(&_A[0]); */ /*@ assert \valid_read(_A[0]); */ /*@ assert \valid_read(_A[1]); */ /*@ assert \valid_read(_B); */ /*@ assert \valid(&_C); */ /*@ assert \valid(&_D[0]); */ /*@ assert \valid(&_E); */ /*@ assert \valid(&_F); */ /*@ assert _E == 44; */ /*@ assert \valid(&_G); */ /*@ assert _G[0].num == 99; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/constructor.c0000666000000000000000000000045413571573400022035 0ustar /* run.config COMMENT: bts #2405. Memory not initialized for code executed before main. */ #include #include __attribute__((constructor)) void f() { printf("f\n"); char *buf = (char*)malloc(10*sizeof(char)); free(buf); } int main() { printf("main\n"); return 0; }frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/ctype_macros.c0000666000000000000000000000250313571573400022135 0ustar /* run.config_ci, run.config_dev COMMENT: Tests for function-based implementation of ctype.h features */ /* ctype.h tests (e.g., `isalpha`, `isnumber` etc) in GLIBC are implemented as macro-definitions featuring `__ctype_b_loc` function which returns an address of an array with locale-specific data. Because of Frama-C normalization below snippet: char c = isupper(argc); char *d = &c; is approximately as follows: char c; unsigned short const **tmp; char *d; tmp = __ctype_b_loc(); d = &c; Since no implementation of `__ctype_b_loc` is provided, its return address is not recorded (the bounds of the array are also implementation specific). Then, `d` points to some internal array on stack and the assertion below does not hold (while it should). This test checks that E-ACSL uses function-based implementations of ctype tests (by defining __NO_CTYPE macro during preprocessing). Thus, the normalized code should resemble the below snippet: char c; int tmp; char *d; tmp = isupper(argc); c = (char)tmp; d = & c; Notably, since isupper returns an int, `d` points to `c` (on stack) and therefore the assertion holds. */ #include int main(int argc, const char **argv) { char c = isupper(argc); char *d = &c; /*@ assert \valid(d); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/early_exit.c0000666000000000000000000000616413571573400021621 0ustar /* run.config COMMENT: test that local variables within a scope are removed from tracking even if the execution exists the scope early via goto, break or continue. */ /* Simple test case from BTS (#1740) */ int goto_bts() { int *p; { int a = 0; p = &a; /*@ assert \valid(p); */ goto L; } L: /*@ assert ! \valid(p); */ return 0; } /* Make sure that when `goto` jumps over several scopes all locals * from those scopes are removed. */ int goto_valid() { int a = 9; int *p, *q, *r; { int a1 = 0; p = &a1; { int a2 = 0; q = &a2; { int a3 = 0; r = &a3; goto FIRST; /* Dead code */ p = (void*)0; r = q = &a; } } FIRST: /* At this point `a1` is still in scope, while `a2` and `a3` are not, thus * `q` and `r` become invalid, whereas `p` is still valid. */ /*@ assert \valid(p); */ /*@ assert ! \valid(q); */ /*@ assert ! \valid(r); */ /* The following `goto` invalidates `p`. */ goto SECOND; /* Dead code */ p = r = q = &a; } SECOND: /*@ assert ! \valid(p); */ /*@ assert ! \valid(q); */ /*@ assert ! \valid(r); */ return 0; } /* Make sure that when a break statement is executed within a switch statement * then all local variables declared within that switch are removed. */ int switch_valid() { int i = 1; int *p, *q, *s; { s = &i; switch(i) { default: { int a1 = 0; p = &a1; { int a2 = 0; q = &a2; /*@ assert \valid(p); */ /*@ assert \valid(q); */ /*@ assert \valid(s); */ break; } /* Dead code */ p = q = &i; s = (void*)0; } } /* Break invalidates `p` and `q` but `s` is still in scope. */ /*@ assert ! \valid(q); */ /*@ assert ! \valid(p); */ /*@ assert \valid(s); */ } return 0; } /* Same as switch_valid but for a break statement in a body of a loop. */ int while_valid() { int *p, *q, *r; int i = 5; { int a0 = 0; r = &a0; while (--i) { { int a1 = 0; p = &a1; { int a2 = 0; q = &a2; /*@ assert \valid(p); */ /*@ assert \valid(q); */ /*@ assert \valid(r); */ if (!i) break; } } } /*@ assert ! \valid(p); */ /*@ assert ! \valid(q); */ /*@ assert \valid(r); */ } return 0; } /* Make sure that when `continue` is executed then local variables in scope * are not recorded twice. */ void continue_valid() { int i = 0; int *p, *q; while (i++) { /*@ assert ! \valid(p); */ /*@ assert ! \valid(q); */ int a1 = 1; p = &a1; /*@ assert \valid(p); */ /*@ assert ! \valid(q); */ { int a2 = 1; q = &a2; /*@ assert \valid(p); */ /*@ assert \valid(q); */ continue; } if (i == 5) break; } /*@ assert ! \valid(p); */ /*@ assert ! \valid(q); */ } int main(int argc, const char *argv[]) { goto_bts(); goto_valid(); switch_valid(); while_valid(); continue_valid(); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/errno.c0000666000000000000000000000035113571573400020571 0ustar /* run.config COMMENT: Check whether location of errno is recorded */ #include #include #include int main(int argc, const char **argv) { int *p = &errno; /*@ assert \valid(p); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/freeable.c0000666000000000000000000000076013571573400021215 0ustar /* run.config COMMENT: \freeable */ #include extern void *malloc(size_t p); extern void free(void* p); char array[1024]; int main(void) { int *p; /*@ assert ! \freeable(p); */ /*@ assert ! \freeable((void*)0); */ p = (int*)malloc(4*sizeof(int)); /*@ assert ! \freeable(p+1); */ /*@ assert \freeable(p); */ free(p); /*@ assert ! \freeable(p); */ // test cases for BTS #1830 /*@ assert ! \freeable(&(array[0])); */ /*@ assert ! \freeable(&(array[5])); */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/ghost_parameters.i0000666000000000000000000000037313571573400023025 0ustar /* run.config COMMENT: ghost parameters STDOPT: */ void function(int a, int b) /*@ ghost(int c, int d) */ { } int main(void){ int w = 0 ; int x = 1 ; //@ ghost int y = 2 ; //@ ghost int z = 3 ; function(w, x) /*@ ghost(y, z) */; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/goto.c0000666000000000000000000000073013571573400020415 0ustar /* run.config COMMENT: check a fix of a bug which occured when a [full_init] stmt is COMMENT: generated for a labeled statement which a goto points to. COMMENT: test both backward and forward gotos. */ char a; int main(void) { char *b; goto _LOR; _LOR: b = &a; if (a) goto _LOR; // dead code in order to prevent infinite loop // but still meaningfull in term of code generated by E-ACSL /*@ assert \initialized(b); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/hidden_malloc.c0000666000000000000000000000050313571573400022225 0ustar /* run.config COMMENT: Malloc executed by a library function */ #include #include int main(int argc, const char **argv) { /* If the second argument of `realpath` is NULL it uses malloc. Make sure that memory layout has been initialized. */ char *cwd = realpath(".", NULL); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/init.c0000666000000000000000000000034213571573400020407 0ustar /* run.config COMMENT: initialization of globals (bts #1818) */ int a = 0, b; int main(void) { int *p = &a, *q = &b; /*@assert \initialized(&b) ; */ /*@assert \initialized(q) ; */ /*@assert \initialized(p) ; */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/init_function.c0000666000000000000000000000056413571573400022322 0ustar /* run.config COMMENT: Check if the instrumentation engine still adds __e_acsl_memory init COMMENT: is inserted for the case when no malloc is used but no no variable COMMENT: is required tracking */ #include int main(void) { /* @assert (__heap_allocation_size == 0); */ char *a = malloc(7); /* @assert (__heap_allocation_size == 7); */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/initialized.c0000666000000000000000000000624413571573400021760 0ustar /* run.config COMMENT: Behaviours of the \initialized E-ACSL predicate */ #include int A = 0; int B; #define ODD(_n) (_n%2 != 0) int main(void) { /* All globals are initialized, even if the initializer is not given */ int *p = &A; int *q = &B; /*@assert \initialized(&A) ; */ /*@assert \initialized(&B) ; */ /*@assert \initialized(p) ; */ /*@assert \initialized(q) ; */ /* A local variable without an initializer is uninitialized */ int a = 0; int b; long *r; long c[2] = { 1, 1 }; long d[2]; p = &a; q = &b; /*@assert \initialized(&a) ; */ /*@assert ! \initialized(&b) ; */ /*@assert \initialized(p) ; */ /*@assert ! \initialized(q) ; */ /*@assert \initialized(&c) ; */ /*@assert ! \initialized(&d) ; */ /* Local variables can also be initialized by assignments */ b = 0; /*@assert \initialized(q); */ /*@assert \initialized(&b); */ r = d; /*@assert ! \initialized(&d[0]); */ /*@assert ! \initialized(d+1); */ /*@assert ! \initialized(&d); */ /*@assert ! \initialized(r); */ /*@assert ! \initialized(r+1); */ d[0] = 1; /*@assert \initialized(&d[0]); */ /*@assert ! \initialized(d+1); */ /*@assert ! \initialized(&d); */ /*@assert \initialized(r); */ /*@assert ! \initialized(r+1); */ d[1] = 1; /*@assert \initialized(&d[0]); */ /*@assert \initialized(d+1); */ /*@assert \initialized(&d); */ /*@assert \initialized(r); */ /*@assert \initialized(r+1); */ /* Malloc allocates un-initialized memory */ p = (int*)malloc(sizeof(int*)); /*@assert ! \initialized(p); */ /* Calloc allocates initialized memory */ q = (int*)calloc(1, sizeof(int)); /*@ assert \initialized(q); */ /* Block reallocared using `realloc' carries initialization of the * existing fragment but does not initialize the newly allocated one */ q = (int*)realloc(q, 2*sizeof(int)); /*@assert \initialized(q); */ q++; /*@assert ! \initialized(q); */ q--; /* An initialized on an un-allocated region is always false. This does not * lead to undefined bevaviours in production mode or assertion failures in * debug mode. */ free(p); free(q); /*@assert ! \initialized(p); */ /*@assert ! \initialized(q); */ /* Spoofing access to a non-existing stack address */ q = (int*)(&q - 1024*5); /*assert ! \initialized(q); */ /* Spoofing access to a non-existing global address */ q = (int*)128; /*@assert ! \initialized(q); */ p = NULL; /*@assert ! \initialized(p); */ /* Partial initialization */ int size = 100; char *partsc = (char*)malloc(size*sizeof(char)); char *partsi = (char*)malloc(size*sizeof(int)); for (int i = 0; i < size; i++) { if (ODD(i)) partsc[i] = '0'; else partsi[i] = 0; } for (int i = 0; i < size; i++) { if (ODD(i)) { /* @assert \initialized(partsc + i); */ /* @assert ! \initialized(partsi + i); */ } else { /* @assert \initialized(partsi + i); */ /* @assert ! \initialized(partsc + i); */ } } /* Check duplicate initialization does not affect correct count of * initialized bits (relevant for bittree model). */ int dup [2]; dup[0] = 1; dup[0] = 1; /* @assert ! \initialized(&dup); */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/literal_string.i0000666000000000000000000000134013571573400022473 0ustar /* run.config COMMENT: literal string */ int main(void); char *T = "bar"; int G = 0; void f(void) { /*@ assert T[G] == 'b'; */ ; G++; } char *S = "foo"; char *S2 = "foo2"; int IDX = 1; int G2 = 2; const char *s_str = "the cat"; const char *l_str = "the dog and the cat"; int main(void) { char *SS = "ss"; /*@ assert S[G2] == 'o'; */ /*@ assert \initialized(S); */ /*@ assert \valid_read(S2); */ /*@ assert ! \valid(SS); */ f(); /* Make sure that compiler does not "merge strings", i.e., represents literal * strings as separate memory blocks. An assertion enabled in the debug mode * fails the execution if `s_str` is used as a part of `l_str`. */ s_str++; l_str++; return 0; } char *U = "baz"; frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/local_goto.c0000666000000000000000000000135713571573400021575 0ustar /* run.config COMMENT: Check that deleting statements before goto jumps takes into COMMENT: account variable declarations given via local inits */ #include #define describe(lab) \ printf("t is %d, going to %s\n", t, #lab) int main(int argc, const char **argv) { int t = 0; { UP: if (t == 2) { describe(RET); goto RET; } } AGAIN: { int a; a = 1; /*@assert \valid(&a); */ if (t == 2) { describe(UP); /* When jumping to UP label we need to make sure that the program transformation does not insert a call deleting [b]. */ goto UP; } else t++; int b = 15; /*@assert \valid(&b); */ describe(AGAIN); goto AGAIN; } RET: return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/local_init.c0000666000000000000000000000056513571573400021570 0ustar /* run.config_ci COMMENT: test of a local initializer which contains an annotation LOG: gen_@PTEST_NAME@.c STDOPT: #"-lib-entry -eva -e-acsl-prepare -e-acsl-share ./share/e-acsl -then -no-lib-entry" */ int X = 0; int *p = &X; int f(void) { int x = *p; // Eva's alarm in -lib-entry on this local initializer return x; } int main(void) { f(); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/local_var.c0000666000000000000000000000065213571573400021412 0ustar /* run.config COMMENT: allocation and de-allocation of local variables */ #include struct list { int element; struct list * next; }; struct list * add(struct list * l, int i) { struct list * new; new = malloc(sizeof(struct list)); /*@ assert \valid(new); */ new->element = i; new->next = l; return new; } int main() { struct list * l = NULL; l = add(l, 4); l = add(l, 7); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/mainargs.c0000666000000000000000000000111413571573400021243 0ustar /* run.config COMMENT: the contents of argv should be valid */ #include /*@ requires \valid(&argc); @ requires \valid(&argv); */ int main(int argc, char **argv) { int i; /*@ assert \forall int k; 0 <= k && k < argc ==> \valid(argv + k) ; */ /*@ assert \block_length(argv) == (argc+1)*sizeof(char*) ; */ /*@ assert argv[argc] == \null ; */ /*@ assert ! \valid(argv[argc]) ; */ for (i = 0; i < argc; i++) { int len = strlen(argv[i]); /*@ assert \valid(argv[i]) ; */ /*@ assert \forall int k; 0 <= k && k <= len ==> \valid(&argv[i][k]) ; */ } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/memalign.c0000666000000000000000000000157313571573400021244 0ustar /* run.config COMMENT: Check aligned heap memory allocation */ #include int posix_memalign(void **memptr, size_t alignment, size_t size); void *aligned_alloc(size_t alignment, size_t size); int main(int argc, const char **argv) { char **memptr = malloc(sizeof(void*)); int res2 = posix_memalign((void**)memptr, 256, 15); char *p = *memptr; /*@assert \valid(p); */ /*@assert \block_length(p) == 15; */ /*@assert \freeable(p); */ free(p); /*@assert ! \valid(p); */ char *a; a = aligned_alloc(256, 12); /*@assert a == \null; */ a = aligned_alloc(255, 512); /*@assert a == \null; */ a = aligned_alloc(0, 512); /*@assert a == \null; */ a = aligned_alloc(256, 512); /*@assert a != \null; */ /*@assert \valid(a); */ /*@assert \block_length(a) == 512; */ /*@assert \freeable(a); */ free(a); /*@assert ! \valid(a); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/memsize.c0000666000000000000000000000341013571573400021114 0ustar /* run.config COMMENT: Checking heap memory size */ #include #include #include extern size_t __e_acsl_heap_allocation_size; int main(int argc, char **argv) { /* Allocation increases */ char *a = malloc(7); /*@assert (__e_acsl_heap_allocation_size == 7); */ char *b = malloc(14); /*@assert (__e_acsl_heap_allocation_size == 21); */ /* Allocation decreases */ free(a); /*@assert (__e_acsl_heap_allocation_size == 14); */ /* Make sure that free with NULL behaves and does not affect allocation */ a = NULL; free(a); /*@assert (__e_acsl_heap_allocation_size == 14); */ /* Realloc decreases allocation */ b = realloc(b, 9); /*@assert (__e_acsl_heap_allocation_size == 9); */ /* Realloc increases allocation */ b = realloc(b, 18); /*@assert (__e_acsl_heap_allocation_size == 18); */ /* Realloc with 0 is equivalent to free */ b = realloc(b, 0); b = NULL; /*@assert (__e_acsl_heap_allocation_size == 0); */ /* realloc with 0 is equivalent to malloc */ b = realloc(b, 8); /*@assert (__e_acsl_heap_allocation_size == 8); */ /* Abandon b and behave like malloc again */ b = realloc(NULL, 8); /*@assert (__e_acsl_heap_allocation_size == 16); */ /* Make realloc fail by supplying a huge number */ b = realloc(NULL, SIZE_MAX); /*@assert (__e_acsl_heap_allocation_size == 16); */ /*@assert (b == NULL); */ /* Same as test for calloc ... */ b = calloc(SIZE_MAX, SIZE_MAX); /*@assert (__e_acsl_heap_allocation_size == 16); */ /*@assert (b == NULL); */ /* ... and for malloc */ b = malloc(SIZE_MAX); /*@assert (__e_acsl_heap_allocation_size == 16); */ /*@assert (b == NULL); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/null.i0000666000000000000000000000015313571573400020424 0ustar /* run.config COMMENT: assert \null == 0 */ int main(void) { /*@ assert \null == 0; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/offset.c0000666000000000000000000000250313571573400020733 0ustar /* run.config COMMENT: Behaviours of the \offset E-ACSL predicate */ #include int A[] = { 1, 2, 3, 4}; int *PA; int main(void) { /* Global memory */ PA = (int*)&A; /*@ assert \offset(&A[0]) == 0; */ /*@ assert \offset(A+3) == 12; */ /*@ assert \offset(PA) == 0; */ PA++; /*@ assert \offset(PA+1) == 8; */ /* Stack memory [long blocks] */ int a[] = { 1, 2, 3, 4}; /*@ assert \offset(&a[0]) == 0; */ /*@ assert \offset(a+1) == 4; */ /*@ assert \offset(a+3) == 12; */ /* Stack memory [Short blocks] */ long l = 4; char *pl = (char*)&l; /*@ assert \offset(&l) == 0; */ /*@ assert \offset(pl) == 0; */ /*@ assert \offset(pl+1) == 1; */ /*@ assert \offset(pl+7) == 7; */ int *pi = (int*)&l; /*@ assert \offset(pi) == 0; */ pi++; /*@ assert \offset(pi) == 4; */ /* Heap memory [single segment] */ char *p = malloc(12); /*@ assert \offset(p) == 0; */ /*@ assert \offset(p+1) == 1; */ /*@ assert \offset(p+11) == 11; */ p += 5; /*@ assert \offset(p+5) == 10; */ /*@ assert \offset(p-5) == 0; */ /* Heap memory [multiple segments] */ long *q = malloc(30*sizeof(long)); /*@ assert \offset(q) == 0; */ q++; /*@ assert \offset(q) == sizeof(long); */ q += 2; /*@ assert \offset(q) == sizeof(long)*3; */ q += 4; /*@ assert \offset(q) == sizeof(long)*7; */ } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/0000777000000000000000000000000013571573400021221 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/addrOf.res.oracle0000666000000000000000000000011713571573400024376 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/alias.res.oracle0000666000000000000000000000011713571573400024270 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/base_addr.res.oracle0000666000000000000000000000011713571573400025103 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/block_length.res.oracle0000666000000000000000000000011713571573400025632 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/block_valid.res.oracle0000666000000000000000000000130113571573400025444 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/block_valid.c:49: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/block_valid.c:50: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/block_valid.c:52: Warning: assertion got status unknown. [eva:alarm] tests/memory/block_valid.c:52: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/block_valid.c:54: Warning: assertion got status unknown. [eva:alarm] tests/memory/block_valid.c:54: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/bypassed_var.res.oracle0000666000000000000000000000011713571573400025661 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/call.res.oracle0000666000000000000000000000011713571573400024112 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/compound_initializers.res.oracle0000666000000000000000000000011713571573400027611 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/constructor.res.oracle0000666000000000000000000000037013571573400025565 0ustar [e-acsl] beginning translation. [kernel:annot:missing-spec] FRAMAC_SHARE/libc/stdio.h:211: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/ctype_macros.res.oracle0000666000000000000000000000262413571573400025674 0ustar [e-acsl] beginning translation. [e-acsl] Warning: annotating undefined function `isupper': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] tests/memory/ctype_macros.c:39: Warning: E-ACSL construct `disjoint behaviors' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/ctype.h:174: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/ctype_macros.c:37: Warning: function __gen_e_acsl_isupper: precondition 'c_uchar_or_eof' got status unknown. [eva:alarm] FRAMAC_SHARE/libc/ctype.h:174: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] FRAMAC_SHARE/libc/ctype.h:178: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] FRAMAC_SHARE/libc/ctype.h:181: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] FRAMAC_SHARE/libc/ctype.h:178: Warning: function __gen_e_acsl_isupper, behavior definitely_match: postcondition 'nonzero_result' got status unknown. (Behavior may be inactive, no reduction performed.) [eva:alarm] FRAMAC_SHARE/libc/ctype.h:181: Warning: function __gen_e_acsl_isupper, behavior definitely_not_match: postcondition 'zero_result' got status unknown. (Behavior may be inactive, no reduction performed.) frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/decl_in_switch.err.oracle0000666000000000000000000000000013571573400026143 0ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/decl_in_switch.res.oracle0000666000000000000000000000034713571573400026162 0ustar [e-acsl] beginning translation. FRAMAC_SHARE/libc/stdlib.h:276:[kernel] warning: No code nor implicit assigns clause for function calloc, generating default assigns from the prototype [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/early_exit.res.oracle0000666000000000000000000000052513571573400025347 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:locals-escaping] tests/memory/early_exit.c:14: Warning: locals {a} escaping the scope of a block of goto_bts through p [eva:alarm] tests/memory/early_exit.c:18: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/errno.res.oracle0000666000000000000000000000011713571573400024324 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/freeable.res.oracle0000666000000000000000000000041713571573400024747 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/freeable.c:14: Warning: assertion got status unknown. [eva:alarm] tests/memory/freeable.c:14: Warning: accessing uninitialized left-value. assert \initialized(&p); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_addrOf.c0000666000000000000000000000214213571573400023414 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" void f(void) { int m; int *u; int *p; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_store_block((void *)(& u),(size_t)8); __e_acsl_store_block((void *)(& m),(size_t)4); __e_acsl_full_init((void *)(& u)); u = & m; __e_acsl_full_init((void *)(& p)); p = u; __e_acsl_full_init((void *)(& m)); m = 123; /*@ assert \initialized(p); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion",(char *)"f", (char *)"\\initialized(p)",10); } __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& u)); __e_acsl_delete_block((void *)(& m)); return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; f(); /*@ assert &x ≡ &x; */ __e_acsl_assert(& x == & x,(char *)"Assertion",(char *)"main", (char *)"&x == &x",16); __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_alias.c0000666000000000000000000000200213571573400023301 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" void f(int *dest, int val) { __e_acsl_store_block((void *)(& dest),(size_t)8); int *ptr = dest; __e_acsl_store_block((void *)(& ptr),(size_t)8); __e_acsl_full_init((void *)(& ptr)); __e_acsl_initialize((void *)ptr,sizeof(int)); *ptr = val; __e_acsl_delete_block((void *)(& dest)); __e_acsl_delete_block((void *)(& ptr)); return; } int main(void) { int __retres; int i; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& i),(size_t)4); f(& i,255); /*@ assert \initialized(&i); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& i), sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&i)",14); } __retres = 0; __e_acsl_delete_block((void *)(& i)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_base_addr.c0000666000000000000000000003203613571573400024126 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int A[4] = {1, 2, 3, 4}; int *PA; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& PA),(size_t)8); __e_acsl_full_init((void *)(& PA)); __e_acsl_store_block((void *)(A),(size_t)16); __e_acsl_full_init((void *)(& A)); } return; } int main(void) { int __retres; int *pa; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& pa),(size_t)8); PA = (int *)(& A); /*@ assert \base_addr((int *)A) ≡ \base_addr(&A); */ { void *__gen_e_acsl_base_addr; void *__gen_e_acsl_base_addr_2; __gen_e_acsl_base_addr = __e_acsl_base_addr((void *)(A)); __gen_e_acsl_base_addr_2 = __e_acsl_base_addr((void *)(& A)); __e_acsl_assert(__gen_e_acsl_base_addr == __gen_e_acsl_base_addr_2, (char *)"Assertion",(char *)"main", (char *)"\\base_addr((int *)A) == \\base_addr(&A)",13); } /*@ assert \base_addr((int *)A) ≡ \base_addr(PA); */ { void *__gen_e_acsl_base_addr_3; void *__gen_e_acsl_base_addr_4; __gen_e_acsl_base_addr_3 = __e_acsl_base_addr((void *)(A)); __gen_e_acsl_base_addr_4 = __e_acsl_base_addr((void *)PA); __e_acsl_assert(__gen_e_acsl_base_addr_3 == __gen_e_acsl_base_addr_4, (char *)"Assertion",(char *)"main", (char *)"\\base_addr((int *)A) == \\base_addr(PA)",14); } /*@ assert \base_addr(&A[3]) ≡ \base_addr(PA); */ { void *__gen_e_acsl_base_addr_5; void *__gen_e_acsl_base_addr_6; __gen_e_acsl_base_addr_5 = __e_acsl_base_addr((void *)(& A[3])); __gen_e_acsl_base_addr_6 = __e_acsl_base_addr((void *)PA); __e_acsl_assert(__gen_e_acsl_base_addr_5 == __gen_e_acsl_base_addr_6, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(&A[3]) == \\base_addr(PA)",15); } PA ++; /*@ assert \base_addr(PA) ≡ \base_addr((int *)A); */ { void *__gen_e_acsl_base_addr_7; void *__gen_e_acsl_base_addr_8; __gen_e_acsl_base_addr_7 = __e_acsl_base_addr((void *)PA); __gen_e_acsl_base_addr_8 = __e_acsl_base_addr((void *)(A)); __e_acsl_assert(__gen_e_acsl_base_addr_7 == __gen_e_acsl_base_addr_8, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(PA) == \\base_addr((int *)A)",17); } /*@ assert \base_addr(PA + 2) ≡ \base_addr(&A[3]); */ { void *__gen_e_acsl_base_addr_9; void *__gen_e_acsl_base_addr_10; __gen_e_acsl_base_addr_9 = __e_acsl_base_addr((void *)(PA + 2)); __gen_e_acsl_base_addr_10 = __e_acsl_base_addr((void *)(& A[3])); __e_acsl_assert(__gen_e_acsl_base_addr_9 == __gen_e_acsl_base_addr_10, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(PA + 2) == \\base_addr(&A[3])",18); } int a[4] = {1, 2, 3, 4}; __e_acsl_store_block((void *)(a),(size_t)16); __e_acsl_full_init((void *)(& a)); __e_acsl_full_init((void *)(& pa)); pa = (int *)(& a); /*@ assert \base_addr((int *)a) ≡ \base_addr(&a); */ { void *__gen_e_acsl_base_addr_11; void *__gen_e_acsl_base_addr_12; __gen_e_acsl_base_addr_11 = __e_acsl_base_addr((void *)(a)); __gen_e_acsl_base_addr_12 = __e_acsl_base_addr((void *)(& a)); __e_acsl_assert(__gen_e_acsl_base_addr_11 == __gen_e_acsl_base_addr_12, (char *)"Assertion",(char *)"main", (char *)"\\base_addr((int *)a) == \\base_addr(&a)",25); } /*@ assert \base_addr((int *)a) ≡ \base_addr(pa); */ { void *__gen_e_acsl_base_addr_13; void *__gen_e_acsl_base_addr_14; __gen_e_acsl_base_addr_13 = __e_acsl_base_addr((void *)(a)); __gen_e_acsl_base_addr_14 = __e_acsl_base_addr((void *)pa); __e_acsl_assert(__gen_e_acsl_base_addr_13 == __gen_e_acsl_base_addr_14, (char *)"Assertion",(char *)"main", (char *)"\\base_addr((int *)a) == \\base_addr(pa)",26); } /*@ assert \base_addr(&a[3]) ≡ \base_addr(pa); */ { void *__gen_e_acsl_base_addr_15; void *__gen_e_acsl_base_addr_16; __gen_e_acsl_base_addr_15 = __e_acsl_base_addr((void *)(& a[3])); __gen_e_acsl_base_addr_16 = __e_acsl_base_addr((void *)pa); __e_acsl_assert(__gen_e_acsl_base_addr_15 == __gen_e_acsl_base_addr_16, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(&a[3]) == \\base_addr(pa)",27); } __e_acsl_full_init((void *)(& pa)); pa ++; /*@ assert \base_addr(pa) ≡ \base_addr((int *)a); */ { void *__gen_e_acsl_base_addr_17; void *__gen_e_acsl_base_addr_18; __gen_e_acsl_base_addr_17 = __e_acsl_base_addr((void *)pa); __gen_e_acsl_base_addr_18 = __e_acsl_base_addr((void *)(a)); __e_acsl_assert(__gen_e_acsl_base_addr_17 == __gen_e_acsl_base_addr_18, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(pa) == \\base_addr((int *)a)",29); } /*@ assert \base_addr(pa + 2) ≡ \base_addr((int *)a); */ { void *__gen_e_acsl_base_addr_19; void *__gen_e_acsl_base_addr_20; __gen_e_acsl_base_addr_19 = __e_acsl_base_addr((void *)(pa + 2)); __gen_e_acsl_base_addr_20 = __e_acsl_base_addr((void *)(a)); __e_acsl_assert(__gen_e_acsl_base_addr_19 == __gen_e_acsl_base_addr_20, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(pa + 2) == \\base_addr((int *)a)", 30); } long l = (long)4; __e_acsl_store_block((void *)(& l),(size_t)8); __e_acsl_full_init((void *)(& l)); char *pl = (char *)(& l); __e_acsl_store_block((void *)(& pl),(size_t)8); __e_acsl_full_init((void *)(& pl)); /*@ assert \base_addr(&l) ≡ \base_addr(pl); */ { void *__gen_e_acsl_base_addr_21; void *__gen_e_acsl_base_addr_22; __gen_e_acsl_base_addr_21 = __e_acsl_base_addr((void *)(& l)); __gen_e_acsl_base_addr_22 = __e_acsl_base_addr((void *)pl); __e_acsl_assert(__gen_e_acsl_base_addr_21 == __gen_e_acsl_base_addr_22, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(&l) == \\base_addr(pl)",35); } /*@ assert \base_addr(pl + 2) ≡ \base_addr(&l); */ { void *__gen_e_acsl_base_addr_23; void *__gen_e_acsl_base_addr_24; __gen_e_acsl_base_addr_23 = __e_acsl_base_addr((void *)(pl + 2)); __gen_e_acsl_base_addr_24 = __e_acsl_base_addr((void *)(& l)); __e_acsl_assert(__gen_e_acsl_base_addr_23 == __gen_e_acsl_base_addr_24, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(pl + 2) == \\base_addr(&l)",36); } short *pi = (short *)(& l); __e_acsl_store_block((void *)(& pi),(size_t)8); __e_acsl_full_init((void *)(& pi)); __e_acsl_full_init((void *)(& pi)); pi ++; __e_acsl_full_init((void *)(& pl)); pl ++; /*@ assert \base_addr(pi) ≡ \base_addr(pl); */ { void *__gen_e_acsl_base_addr_25; void *__gen_e_acsl_base_addr_26; __gen_e_acsl_base_addr_25 = __e_acsl_base_addr((void *)pi); __gen_e_acsl_base_addr_26 = __e_acsl_base_addr((void *)pl); __e_acsl_assert(__gen_e_acsl_base_addr_25 == __gen_e_acsl_base_addr_26, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(pi) == \\base_addr(pl)",40); } /*@ assert \base_addr(pl) ≡ \base_addr(&l); */ { void *__gen_e_acsl_base_addr_27; void *__gen_e_acsl_base_addr_28; __gen_e_acsl_base_addr_27 = __e_acsl_base_addr((void *)pl); __gen_e_acsl_base_addr_28 = __e_acsl_base_addr((void *)(& l)); __e_acsl_assert(__gen_e_acsl_base_addr_27 == __gen_e_acsl_base_addr_28, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(pl) == \\base_addr(&l)",41); } char *p = malloc((unsigned long)12); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); char *pd = p; __e_acsl_store_block((void *)(& pd),(size_t)8); __e_acsl_full_init((void *)(& pd)); /*@ assert \base_addr(p) ≡ \base_addr(pd); */ { void *__gen_e_acsl_base_addr_29; void *__gen_e_acsl_base_addr_30; __gen_e_acsl_base_addr_29 = __e_acsl_base_addr((void *)p); __gen_e_acsl_base_addr_30 = __e_acsl_base_addr((void *)pd); __e_acsl_assert(__gen_e_acsl_base_addr_29 == __gen_e_acsl_base_addr_30, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(p) == \\base_addr(pd)",46); } /*@ assert \base_addr(p + 1) ≡ \base_addr(pd + 5); */ { void *__gen_e_acsl_base_addr_31; void *__gen_e_acsl_base_addr_32; __gen_e_acsl_base_addr_31 = __e_acsl_base_addr((void *)(p + 1)); __gen_e_acsl_base_addr_32 = __e_acsl_base_addr((void *)(pd + 5)); __e_acsl_assert(__gen_e_acsl_base_addr_31 == __gen_e_acsl_base_addr_32, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(p + 1) == \\base_addr(pd + 5)",47); } /*@ assert \base_addr(p + 11) ≡ \base_addr(pd + 1); */ { void *__gen_e_acsl_base_addr_33; void *__gen_e_acsl_base_addr_34; __gen_e_acsl_base_addr_33 = __e_acsl_base_addr((void *)(p + 11)); __gen_e_acsl_base_addr_34 = __e_acsl_base_addr((void *)(pd + 1)); __e_acsl_assert(__gen_e_acsl_base_addr_33 == __gen_e_acsl_base_addr_34, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(p + 11) == \\base_addr(pd + 1)",48); } __e_acsl_full_init((void *)(& p)); p += 5; /*@ assert \base_addr(p + 5) ≡ \base_addr(pd); */ { void *__gen_e_acsl_base_addr_35; void *__gen_e_acsl_base_addr_36; __gen_e_acsl_base_addr_35 = __e_acsl_base_addr((void *)(p + 5)); __gen_e_acsl_base_addr_36 = __e_acsl_base_addr((void *)pd); __e_acsl_assert(__gen_e_acsl_base_addr_35 == __gen_e_acsl_base_addr_36, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(p + 5) == \\base_addr(pd)",50); } /*@ assert \base_addr(p - 5) ≡ \base_addr(pd); */ { void *__gen_e_acsl_base_addr_37; void *__gen_e_acsl_base_addr_38; __gen_e_acsl_base_addr_37 = __e_acsl_base_addr((void *)(p - 5)); __gen_e_acsl_base_addr_38 = __e_acsl_base_addr((void *)pd); __e_acsl_assert(__gen_e_acsl_base_addr_37 == __gen_e_acsl_base_addr_38, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(p - 5) == \\base_addr(pd)",51); } long *q = malloc((unsigned long)30 * sizeof(long)); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); long *qd = q; __e_acsl_store_block((void *)(& qd),(size_t)8); __e_acsl_full_init((void *)(& qd)); /*@ assert \base_addr(q) ≡ \base_addr(qd); */ { void *__gen_e_acsl_base_addr_39; void *__gen_e_acsl_base_addr_40; __gen_e_acsl_base_addr_39 = __e_acsl_base_addr((void *)q); __gen_e_acsl_base_addr_40 = __e_acsl_base_addr((void *)qd); __e_acsl_assert(__gen_e_acsl_base_addr_39 == __gen_e_acsl_base_addr_40, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(q) == \\base_addr(qd)",57); } __e_acsl_full_init((void *)(& q)); q ++; /*@ assert \base_addr(q) ≡ \base_addr(qd); */ { void *__gen_e_acsl_base_addr_41; void *__gen_e_acsl_base_addr_42; __gen_e_acsl_base_addr_41 = __e_acsl_base_addr((void *)q); __gen_e_acsl_base_addr_42 = __e_acsl_base_addr((void *)qd); __e_acsl_assert(__gen_e_acsl_base_addr_41 == __gen_e_acsl_base_addr_42, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(q) == \\base_addr(qd)",59); } __e_acsl_full_init((void *)(& q)); q += 2; /*@ assert \base_addr(q) ≡ \base_addr(qd); */ { void *__gen_e_acsl_base_addr_43; void *__gen_e_acsl_base_addr_44; __gen_e_acsl_base_addr_43 = __e_acsl_base_addr((void *)q); __gen_e_acsl_base_addr_44 = __e_acsl_base_addr((void *)qd); __e_acsl_assert(__gen_e_acsl_base_addr_43 == __gen_e_acsl_base_addr_44, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(q) == \\base_addr(qd)",61); } __e_acsl_full_init((void *)(& q)); q += 4; /*@ assert \base_addr(q) ≡ \base_addr(qd); */ { void *__gen_e_acsl_base_addr_45; void *__gen_e_acsl_base_addr_46; __gen_e_acsl_base_addr_45 = __e_acsl_base_addr((void *)q); __gen_e_acsl_base_addr_46 = __e_acsl_base_addr((void *)qd); __e_acsl_assert(__gen_e_acsl_base_addr_45 == __gen_e_acsl_base_addr_46, (char *)"Assertion",(char *)"main", (char *)"\\base_addr(q) == \\base_addr(qd)",63); } __retres = 0; __e_acsl_delete_block((void *)(& PA)); __e_acsl_delete_block((void *)(A)); __e_acsl_delete_block((void *)(& qd)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& pd)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& pi)); __e_acsl_delete_block((void *)(& pl)); __e_acsl_delete_block((void *)(& l)); __e_acsl_delete_block((void *)(& pa)); __e_acsl_delete_block((void *)(a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_block_length.c0000666000000000000000000002410513571573400024653 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" struct Zero { }; int A[4] = {1, 2, 3, 4}; int *PA; struct Zero ZERO; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& ZERO),(size_t)0); __e_acsl_full_init((void *)(& ZERO)); __e_acsl_store_block((void *)(& PA),(size_t)8); __e_acsl_full_init((void *)(& PA)); __e_acsl_store_block((void *)(A),(size_t)16); __e_acsl_full_init((void *)(& A)); } return; } int main(void) { int __retres; struct Zero zero; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& zero),(size_t)0); /*@ assert \block_length(&ZERO) ≡ 0; */ { unsigned long __gen_e_acsl_block_length; __gen_e_acsl_block_length = __e_acsl_block_length((void *)(& ZERO)); __e_acsl_assert(__gen_e_acsl_block_length == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\block_length(&ZERO) == 0",15); } /*@ assert \block_length(&zero) ≡ 0; */ { unsigned long __gen_e_acsl_block_length_2; __gen_e_acsl_block_length_2 = __e_acsl_block_length((void *)(& zero)); __e_acsl_assert(__gen_e_acsl_block_length_2 == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\block_length(&zero) == 0",16); } PA = (int *)(& A); /*@ assert \block_length((int *)A) ≡ sizeof(A); */ { unsigned long __gen_e_acsl_block_length_3; __gen_e_acsl_block_length_3 = __e_acsl_block_length((void *)(A)); __e_acsl_assert(__gen_e_acsl_block_length_3 == 16UL,(char *)"Assertion", (char *)"main", (char *)"\\block_length((int *)A) == sizeof(A)",20); } /*@ assert \block_length(&A[3]) ≡ sizeof(A); */ { unsigned long __gen_e_acsl_block_length_4; __gen_e_acsl_block_length_4 = __e_acsl_block_length((void *)(& A[3])); __e_acsl_assert(__gen_e_acsl_block_length_4 == 16UL,(char *)"Assertion", (char *)"main", (char *)"\\block_length(&A[3]) == sizeof(A)",21); } /*@ assert \block_length(PA) ≡ sizeof(A); */ { unsigned long __gen_e_acsl_block_length_5; __gen_e_acsl_block_length_5 = __e_acsl_block_length((void *)PA); __e_acsl_assert(__gen_e_acsl_block_length_5 == 16UL,(char *)"Assertion", (char *)"main",(char *)"\\block_length(PA) == sizeof(A)", 22); } PA ++; /*@ assert \block_length(PA + 1) ≡ \block_length(&A[1]); */ { unsigned long __gen_e_acsl_block_length_6; unsigned long __gen_e_acsl_block_length_7; __gen_e_acsl_block_length_6 = __e_acsl_block_length((void *)(PA + 1)); __gen_e_acsl_block_length_7 = __e_acsl_block_length((void *)(& A[1])); __e_acsl_assert(__gen_e_acsl_block_length_6 == __gen_e_acsl_block_length_7, (char *)"Assertion",(char *)"main", (char *)"\\block_length(PA + 1) == \\block_length(&A[1])", 24); } int a[4] = {1, 2, 3, 4}; __e_acsl_store_block((void *)(a),(size_t)16); __e_acsl_full_init((void *)(& a)); int *pa = (int *)(& a); __e_acsl_store_block((void *)(& pa),(size_t)8); __e_acsl_full_init((void *)(& pa)); /*@ assert \block_length((int *)a) ≡ sizeof(a); */ { unsigned long __gen_e_acsl_block_length_8; __gen_e_acsl_block_length_8 = __e_acsl_block_length((void *)(a)); __e_acsl_assert(__gen_e_acsl_block_length_8 == 16UL,(char *)"Assertion", (char *)"main", (char *)"\\block_length((int *)a) == sizeof(a)",29); } /*@ assert \block_length(&a[3]) ≡ sizeof(a); */ { unsigned long __gen_e_acsl_block_length_9; __gen_e_acsl_block_length_9 = __e_acsl_block_length((void *)(& a[3])); __e_acsl_assert(__gen_e_acsl_block_length_9 == 16UL,(char *)"Assertion", (char *)"main", (char *)"\\block_length(&a[3]) == sizeof(a)",30); } /*@ assert \block_length(pa) ≡ sizeof(a); */ { unsigned long __gen_e_acsl_block_length_10; __gen_e_acsl_block_length_10 = __e_acsl_block_length((void *)pa); __e_acsl_assert(__gen_e_acsl_block_length_10 == 16UL,(char *)"Assertion", (char *)"main",(char *)"\\block_length(pa) == sizeof(a)", 31); } __e_acsl_full_init((void *)(& pa)); pa ++; /*@ assert \block_length(pa + 1) ≡ \block_length(&a[1]); */ { unsigned long __gen_e_acsl_block_length_11; unsigned long __gen_e_acsl_block_length_12; __gen_e_acsl_block_length_11 = __e_acsl_block_length((void *)(pa + 1)); __gen_e_acsl_block_length_12 = __e_acsl_block_length((void *)(& a[1])); __e_acsl_assert(__gen_e_acsl_block_length_11 == __gen_e_acsl_block_length_12, (char *)"Assertion",(char *)"main", (char *)"\\block_length(pa + 1) == \\block_length(&a[1])", 33); } long l = (long)4; __e_acsl_store_block((void *)(& l),(size_t)8); __e_acsl_full_init((void *)(& l)); char *pl = (char *)(& l); __e_acsl_store_block((void *)(& pl),(size_t)8); __e_acsl_full_init((void *)(& pl)); /*@ assert \block_length(&l) ≡ sizeof(long); */ { unsigned long __gen_e_acsl_block_length_13; __gen_e_acsl_block_length_13 = __e_acsl_block_length((void *)(& l)); __e_acsl_assert(__gen_e_acsl_block_length_13 == 8UL,(char *)"Assertion", (char *)"main", (char *)"\\block_length(&l) == sizeof(long)",39); } /*@ assert \block_length(pl) ≡ sizeof(long); */ { unsigned long __gen_e_acsl_block_length_14; __gen_e_acsl_block_length_14 = __e_acsl_block_length((void *)pl); __e_acsl_assert(__gen_e_acsl_block_length_14 == 8UL,(char *)"Assertion", (char *)"main", (char *)"\\block_length(pl) == sizeof(long)",40); } /*@ assert \block_length(pl + 7) ≡ sizeof(long); */ { unsigned long __gen_e_acsl_block_length_15; __gen_e_acsl_block_length_15 = __e_acsl_block_length((void *)(pl + 7)); __e_acsl_assert(__gen_e_acsl_block_length_15 == 8UL,(char *)"Assertion", (char *)"main", (char *)"\\block_length(pl + 7) == sizeof(long)",41); } int *pi = (int *)(& l); __e_acsl_store_block((void *)(& pi),(size_t)8); __e_acsl_full_init((void *)(& pi)); /*@ assert \block_length(pi) ≡ \block_length(&l); */ { unsigned long __gen_e_acsl_block_length_16; unsigned long __gen_e_acsl_block_length_17; __gen_e_acsl_block_length_16 = __e_acsl_block_length((void *)pi); __gen_e_acsl_block_length_17 = __e_acsl_block_length((void *)(& l)); __e_acsl_assert(__gen_e_acsl_block_length_16 == __gen_e_acsl_block_length_17, (char *)"Assertion",(char *)"main", (char *)"\\block_length(pi) == \\block_length(&l)",43); } __e_acsl_full_init((void *)(& pi)); pi ++; /*@ assert \block_length(pi) ≡ \block_length(&l); */ { unsigned long __gen_e_acsl_block_length_18; unsigned long __gen_e_acsl_block_length_19; __gen_e_acsl_block_length_18 = __e_acsl_block_length((void *)pi); __gen_e_acsl_block_length_19 = __e_acsl_block_length((void *)(& l)); __e_acsl_assert(__gen_e_acsl_block_length_18 == __gen_e_acsl_block_length_19, (char *)"Assertion",(char *)"main", (char *)"\\block_length(pi) == \\block_length(&l)",45); } size_t size = (unsigned long)12; char *p = malloc(size); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); /*@ assert \block_length(p) ≡ size; */ { unsigned long __gen_e_acsl_block_length_20; __gen_e_acsl_block_length_20 = __e_acsl_block_length((void *)p); __e_acsl_assert(__gen_e_acsl_block_length_20 == size,(char *)"Assertion", (char *)"main",(char *)"\\block_length(p) == size",50); } /*@ assert \block_length(p + 11) ≡ size; */ { unsigned long __gen_e_acsl_block_length_21; __gen_e_acsl_block_length_21 = __e_acsl_block_length((void *)(p + 11)); __e_acsl_assert(__gen_e_acsl_block_length_21 == size,(char *)"Assertion", (char *)"main",(char *)"\\block_length(p + 11) == size", 51); } __e_acsl_full_init((void *)(& p)); p += 5; /*@ assert \block_length(p + 5) ≡ \block_length(p - 5); */ { unsigned long __gen_e_acsl_block_length_22; unsigned long __gen_e_acsl_block_length_23; __gen_e_acsl_block_length_22 = __e_acsl_block_length((void *)(p + 5)); __gen_e_acsl_block_length_23 = __e_acsl_block_length((void *)(p - 5)); __e_acsl_assert(__gen_e_acsl_block_length_22 == __gen_e_acsl_block_length_23, (char *)"Assertion",(char *)"main", (char *)"\\block_length(p + 5) == \\block_length(p - 5)", 53); } size = (unsigned long)30 * sizeof(long); long *q = malloc(size); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); /*@ assert \block_length(q) ≡ size; */ { unsigned long __gen_e_acsl_block_length_24; __gen_e_acsl_block_length_24 = __e_acsl_block_length((void *)q); __e_acsl_assert(__gen_e_acsl_block_length_24 == size,(char *)"Assertion", (char *)"main",(char *)"\\block_length(q) == size",59); } __e_acsl_full_init((void *)(& q)); q += 4; /*@ assert \block_length(q) ≡ size; */ { unsigned long __gen_e_acsl_block_length_25; __gen_e_acsl_block_length_25 = __e_acsl_block_length((void *)q); __e_acsl_assert(__gen_e_acsl_block_length_25 == size,(char *)"Assertion", (char *)"main",(char *)"\\block_length(q) == size",61); } __retres = 0; __e_acsl_delete_block((void *)(& ZERO)); __e_acsl_delete_block((void *)(& PA)); __e_acsl_delete_block((void *)(A)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& pi)); __e_acsl_delete_block((void *)(& pl)); __e_acsl_delete_block((void *)(& l)); __e_acsl_delete_block((void *)(& pa)); __e_acsl_delete_block((void *)(a)); __e_acsl_delete_block((void *)(& zero)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_block_valid.c0000666000000000000000000001343313571573400024473 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int A = 1; int B = 2; int C = 3; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& B),(size_t)4); __e_acsl_full_init((void *)(& B)); } return; } int main(int argc, char **argv) { int __retres; __e_acsl_memory_init(& argc,& argv,(size_t)8); __e_acsl_globals_init(); int *p = (int *)0; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); int *q = (int *)0; int a = 1; int b = 2; __e_acsl_store_block((void *)(& b),(size_t)4); __e_acsl_full_init((void *)(& b)); int c = 3; __e_acsl_full_init((void *)(& p)); p = & b; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",24); } /*@ assert ¬\valid(p + 1); */ { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)(p + 1),sizeof(int), (void *)p,(void *)(& p)); __e_acsl_assert(! __gen_e_acsl_valid_2,(char *)"Assertion", (char *)"main",(char *)"!\\valid(p + 1)",26); } __e_acsl_full_init((void *)(& p)); p = & B; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",29); } /*@ assert ¬\valid(p + 1); */ { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)(p + 1),sizeof(int), (void *)p,(void *)(& p)); __e_acsl_assert(! __gen_e_acsl_valid_4,(char *)"Assertion", (char *)"main",(char *)"!\\valid(p + 1)",31); } char *pmin = malloc(sizeof(int)); __e_acsl_store_block((void *)(& pmin),(size_t)8); __e_acsl_full_init((void *)(& pmin)); char *pmax = malloc(sizeof(int)); __e_acsl_store_block((void *)(& pmax),(size_t)8); __e_acsl_full_init((void *)(& pmax)); if ((unsigned long)pmin > (unsigned long)pmax) { char *t = pmin; __e_acsl_store_block((void *)(& t),(size_t)8); __e_acsl_full_init((void *)(& t)); __e_acsl_full_init((void *)(& pmin)); pmin = pmax; __e_acsl_full_init((void *)(& pmax)); pmax = t; __e_acsl_delete_block((void *)(& t)); } __e_acsl_initialize((void *)pmin,sizeof(char)); *pmin = (char)'P'; __e_acsl_initialize((void *)pmax,sizeof(char)); *pmax = (char)'L'; int diff = (int)((unsigned long)pmax - (unsigned long)pmin); /*@ assert \valid(pmin); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& pmin), sizeof(char *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)pmin,sizeof(char), (void *)pmin,(void *)(& pmin)); __gen_e_acsl_and_3 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid(pmin)",49); } /*@ assert \valid(pmax); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& pmax), sizeof(char *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)pmax,sizeof(char), (void *)pmax,(void *)(& pmax)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(__gen_e_acsl_and_4,(char *)"Assertion",(char *)"main", (char *)"\\valid(pmax)",50); } /*@ assert ¬\valid(pmin + diff); */ { int __gen_e_acsl_valid_7; __gen_e_acsl_valid_7 = __e_acsl_valid((void *)(pmin + diff),sizeof(char), (void *)pmin,(void *)(& pmin)); __e_acsl_assert(! __gen_e_acsl_valid_7,(char *)"Assertion", (char *)"main",(char *)"!\\valid(pmin + diff)",52); } /*@ assert ¬\valid(pmax - diff); */ { int __gen_e_acsl_valid_8; __gen_e_acsl_valid_8 = __e_acsl_valid((void *)(pmax - diff),sizeof(char), (void *)pmax,(void *)(& pmax)); __e_acsl_assert(! __gen_e_acsl_valid_8,(char *)"Assertion", (char *)"main",(char *)"!\\valid(pmax - diff)",54); } __retres = 0; __e_acsl_delete_block((void *)(& B)); __e_acsl_delete_block((void *)(& pmax)); __e_acsl_delete_block((void *)(& pmin)); __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_bypassed_var.c0000666000000000000000000000155113571573400024702 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); goto L; { int *p; __e_acsl_store_block((void *)(& p),(size_t)8); L: __e_acsl_store_block_duplicate((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); p = & argc; /*@ assert \valid(&p); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(& p),sizeof(int *), (void *)(& p),(void *)0); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"\\valid(&p)",13); __e_acsl_delete_block((void *)(& p)); } } __retres = 0; __e_acsl_delete_block((void *)(& argc)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_call.c0000666000000000000000000000361713571573400023140 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /*@ ensures \valid(\result); */ int *__gen_e_acsl_f(int *x, int *y); int *f(int *x, int *y) { __e_acsl_store_block((void *)(& y),(size_t)8); __e_acsl_store_block((void *)(& x),(size_t)8); __e_acsl_initialize((void *)y,sizeof(int)); *y = 1; __e_acsl_delete_block((void *)(& y)); __e_acsl_delete_block((void *)(& x)); return x; } int main(void) { int __retres; int *p; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); int x = 0; __e_acsl_store_block((void *)(& x),(size_t)4); __e_acsl_full_init((void *)(& x)); int *q = malloc(sizeof(int)); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); int *r = malloc(sizeof(int)); __e_acsl_full_init((void *)(& p)); p = __gen_e_acsl_f(& x,q); __e_acsl_full_init((void *)(& q)); q = __gen_e_acsl_f(& x,r); __retres = 0; __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& x)); __e_acsl_memory_clean(); return __retres; } /*@ ensures \valid(\result); */ int *__gen_e_acsl_f(int *x, int *y) { int *__retres; __e_acsl_store_block((void *)(& __retres),(size_t)8); __e_acsl_store_block((void *)(& y),(size_t)8); __e_acsl_store_block((void *)(& x),(size_t)8); __retres = f(x,y); { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)__retres,sizeof(int), (void *)__retres, (void *)(& __retres)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Postcondition",(char *)"f", (char *)"\\valid(\\result)",7); __e_acsl_delete_block((void *)(& y)); __e_acsl_delete_block((void *)(& x)); __e_acsl_delete_block((void *)(& __retres)); return __retres; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_compound_initializers.c0000666000000000000000000001650213571573400026634 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string_3; char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string_4; char *__gen_e_acsl_literal_string_5; struct ST { char *str ; int num ; }; int _F; char *_A[2] = {(char *)"XX", (char *)"YY"}; char *_B = (char *)"ZZ"; char *_C; int _D[2] = {44, 88}; int _E = 44; int _F = 9; struct ST _G[2] = {{.str = (char *)"First", .num = 99}, {.str = (char *)"Second", .num = 147}}; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string_3 = "ZZ"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3,sizeof("ZZ")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3); __gen_e_acsl_literal_string = "YY"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("YY")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_2 = "XX"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2,sizeof("XX")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string_4 = "Second"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_4, sizeof("Second")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_4); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_4); __gen_e_acsl_literal_string_5 = "First"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_5, sizeof("First")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_5); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_5); __e_acsl_store_block((void *)(_G),(size_t)32); __e_acsl_full_init((void *)(& _G)); __e_acsl_store_block((void *)(& _E),(size_t)4); __e_acsl_full_init((void *)(& _E)); __e_acsl_store_block((void *)(_D),(size_t)8); __e_acsl_full_init((void *)(& _D)); __e_acsl_store_block((void *)(& _C),(size_t)8); __e_acsl_full_init((void *)(& _C)); __e_acsl_store_block((void *)(& _B),(size_t)8); __e_acsl_full_init((void *)(& _B)); __e_acsl_store_block((void *)(_A),(size_t)16); __e_acsl_full_init((void *)(& _A)); __e_acsl_store_block((void *)(& _F),(size_t)4); __e_acsl_full_init((void *)(& _F)); } return; } int main(int argc, char **argv) { int __retres; __e_acsl_memory_init(& argc,& argv,(size_t)8); __e_acsl_globals_init(); /*@ assert \valid((char **)_A); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(_A),sizeof(char *), (void *)(_A),(void *)(_A)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"\\valid((char **)_A)",33); } /*@ assert \valid_read(_A[0]); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(_A), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)_A[0], sizeof(char), (void *)_A[0], (void *)(_A)); __gen_e_acsl_and = __gen_e_acsl_valid_read; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(_A[0])",34); } /*@ assert \valid_read(_A[1]); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& _A[1]), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)_A[1], sizeof(char), (void *)_A[1], (void *)(& _A[1])); __gen_e_acsl_and_2 = __gen_e_acsl_valid_read_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(_A[1])",35); } /*@ assert \valid_read(_B); */ { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)_B,sizeof(char), (void *)_B, (void *)(& _B)); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"Assertion", (char *)"main",(char *)"\\valid_read(_B)",36); } /*@ assert \valid(&_C); */ { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)(& _C),sizeof(char *), (void *)(& _C),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Assertion",(char *)"main", (char *)"\\valid(&_C)",37); } /*@ assert \valid((int *)_D); */ { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)(_D),sizeof(int), (void *)(_D),(void *)(_D)); __e_acsl_assert(__gen_e_acsl_valid_3,(char *)"Assertion",(char *)"main", (char *)"\\valid((int *)_D)",38); } /*@ assert \valid(&_E); */ { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)(& _E),sizeof(int), (void *)(& _E),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_4,(char *)"Assertion",(char *)"main", (char *)"\\valid(&_E)",39); } /*@ assert \valid(&_F); */ { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)(& _F),sizeof(int), (void *)(& _F),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_5,(char *)"Assertion",(char *)"main", (char *)"\\valid(&_F)",40); } /*@ assert _E ≡ 44; */ __e_acsl_assert(_E == 44,(char *)"Assertion",(char *)"main", (char *)"_E == 44",41); /*@ assert \valid(&_G); */ { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)(& _G), sizeof(struct ST [2]), (void *)(& _G),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_6,(char *)"Assertion",(char *)"main", (char *)"\\valid(&_G)",42); } /*@ assert _G[0].num ≡ 99; */ __e_acsl_assert(_G[0].num == 99,(char *)"Assertion",(char *)"main", (char *)"_G[0].num == 99",43); __retres = 0; __e_acsl_delete_block((void *)(_G)); __e_acsl_delete_block((void *)(& _E)); __e_acsl_delete_block((void *)(_D)); __e_acsl_delete_block((void *)(& _C)); __e_acsl_delete_block((void *)(& _B)); __e_acsl_delete_block((void *)(_A)); __e_acsl_delete_block((void *)(& _F)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_constructor.c0000666000000000000000000000232213571573400024602 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string; void f(void) __attribute__((__constructor__)); void f(void) { printf(__gen_e_acsl_literal_string); char *buf = malloc((unsigned long)10 * sizeof(char)); free((void *)buf); return; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string_2 = "main\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2, sizeof("main\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string = "f\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("f\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); printf(__gen_e_acsl_literal_string_2); __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_ctype_macros.c0000666000000000000000000000237213571573400024712 0ustar /* Generated by Frama-C */ #include "ctype.h" #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; int main(int argc, char const **argv) { int __retres; int tmp; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); tmp = __gen_e_acsl_isupper(argc); char c = (char)tmp; __e_acsl_store_block((void *)(& c),(size_t)1); __e_acsl_full_init((void *)(& c)); char *d = & c; __e_acsl_store_block((void *)(& d),(size_t)8); __e_acsl_full_init((void *)(& d)); /*@ assert \valid(d); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& d), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)d,sizeof(char),(void *)d, (void *)(& d)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(d)",39); } __retres = 0; __e_acsl_delete_block((void *)(& d)); __e_acsl_delete_block((void *)(& c)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_decl_in_switch.c0000666000000000000000000000725413571573400025204 0ustar /* Generated by Frama-C */ typedef unsigned long size_t; struct __e_acsl_mpz_struct { int _mp_alloc ; int _mp_size ; unsigned long *_mp_d ; }; typedef struct __e_acsl_mpz_struct __e_acsl_mpz_struct; typedef __e_acsl_mpz_struct ( __attribute__((__FC_BUILTIN__)) __e_acsl_mpz_t)[1]; struct __e_acsl_mpq_struct { __e_acsl_mpz_struct _mp_num ; __e_acsl_mpz_struct _mp_den ; }; typedef struct __e_acsl_mpq_struct __e_acsl_mpq_struct; typedef __e_acsl_mpq_struct ( __attribute__((__FC_BUILTIN__)) __e_acsl_mpq_t)[1]; typedef struct _IO_FILE FILE; /*@ ghost extern int __e_acsl_init; */ extern size_t __e_acsl_heap_allocation_size; typedef unsigned short __uint16_t; typedef unsigned int __uint32_t; typedef unsigned long __uint64_t; typedef long __off_t; typedef long __off64_t; struct _IO_FILE; typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next ; struct _IO_FILE *_sbuf ; int _pos ; }; struct _IO_FILE { int _flags ; char *_IO_read_ptr ; char *_IO_read_end ; char *_IO_read_base ; char *_IO_write_base ; char *_IO_write_ptr ; char *_IO_write_end ; char *_IO_buf_base ; char *_IO_buf_end ; char *_IO_save_base ; char *_IO_backup_base ; char *_IO_save_end ; struct _IO_marker *_markers ; struct _IO_FILE *_chain ; int _fileno ; int _flags2 ; __off_t _old_offset ; unsigned short _cur_column ; signed char _vtable_offset ; char _shortbuf[1] ; _IO_lock_t *_lock ; __off64_t _offset ; void *__pad1 ; void *__pad2 ; void *__pad3 ; void *__pad4 ; size_t __pad5 ; int _mode ; char _unused2[((unsigned long)15 * sizeof(int) - (unsigned long)4 * sizeof(void *)) - sizeof(size_t)] ; }; /* compiler builtin: unsigned int __builtin_bswap32(unsigned int); */ /* compiler builtin: unsigned long __builtin_bswap64(unsigned long); */ __inline static unsigned int __bswap_32(unsigned int __bsx) { unsigned int tmp; tmp = __builtin_bswap32(__bsx); return tmp; } __inline static __uint64_t __bswap_64(__uint64_t __bsx) { __uint64_t tmp; tmp = __builtin_bswap64(__bsx); return tmp; } __inline static __uint16_t __uint16_identity(__uint16_t __x) { return __x; } __inline static __uint32_t __uint32_identity(__uint32_t __x) { return __x; } __inline static __uint64_t __uint64_identity(__uint64_t __x) { return __x; } /*@ predicate diffSize{L1, L2}(ℤ i) = \at(__e_acsl_heap_allocation_size,L1) - \at(__e_acsl_heap_allocation_size,L2) ≡ i; */ extern __attribute__((__FC_BUILTIN__)) int ( /* missing proto */ __e_acsl_memory_init)( int *x_0, char ***x_1, unsigned long x_2); extern __attribute__((__FC_BUILTIN__)) int ( /* missing proto */ __e_acsl_store_block)( void *x_0, unsigned long x_1); extern __attribute__((__FC_BUILTIN__)) int ( /* missing proto */ __e_acsl_full_init)( void *x_0); extern __attribute__((__FC_BUILTIN__)) int ( /* missing proto */ __e_acsl_delete_block)( void *x_0); extern __attribute__((__FC_BUILTIN__)) int ( /* missing proto */ __e_acsl_memory_clean)( void); int main(int argc, char **argv) { int __retres; __e_acsl_memory_init(& argc,& argv,8UL); __e_acsl_memory_init(& argc,& argv,8UL); __e_acsl_store_block((void *)(& argc),4UL); { int *p; __e_acsl_store_block((void *)(& p),8UL); __e_acsl_store_block((void *)(& p),8UL); switch (argc) { default: ; __e_acsl_full_init((void *)(& p)); __e_acsl_full_init((void *)(& p)); p = & argc; break; } __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& p)); } __retres = 0; __e_acsl_delete_block((void *)(& argc)); __e_acsl_memory_clean(); __e_acsl_delete_block((void *)(& argc)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_early_exit.c0000666000000000000000000006253513571573400024376 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int goto_bts(void) { int __retres; int *p; __e_acsl_store_block((void *)(& p),(size_t)8); { int a = 0; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); __e_acsl_full_init((void *)(& p)); p = & a; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion", (char *)"goto_bts",(char *)"\\valid(p)",13); } __e_acsl_delete_block((void *)(& a)); goto L; __e_acsl_delete_block((void *)(& a)); } L: /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; /*@ assert Eva: dangling_pointer: ¬\dangling(&p); */ __gen_e_acsl_valid_2 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion", (char *)"goto_bts",(char *)"!\\valid(p)",18); } __retres = 0; __e_acsl_delete_block((void *)(& p)); return __retres; } int goto_valid(void) { int __retres; int *p; int *q; int *r; __e_acsl_store_block((void *)(& r),(size_t)8); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); int a = 9; { int a1 = 0; __e_acsl_store_block((void *)(& a1),(size_t)4); __e_acsl_full_init((void *)(& a1)); __e_acsl_full_init((void *)(& p)); p = & a1; { int a2 = 0; __e_acsl_store_block((void *)(& a2),(size_t)4); __e_acsl_full_init((void *)(& a2)); __e_acsl_full_init((void *)(& q)); q = & a2; { int a3 = 0; __e_acsl_store_block((void *)(& a3),(size_t)4); __e_acsl_full_init((void *)(& a3)); __e_acsl_full_init((void *)(& r)); r = & a3; __e_acsl_delete_block((void *)(& a2)); __e_acsl_delete_block((void *)(& a3)); goto FIRST; __e_acsl_full_init((void *)(& p)); p = (int *)0; __e_acsl_full_init((void *)(& q)); q = & a; __e_acsl_full_init((void *)(& r)); r = q; __e_acsl_delete_block((void *)(& a3)); __e_acsl_delete_block((void *)(& a2)); } } FIRST: /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion", (char *)"goto_valid",(char *)"\\valid(p)",46); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(int), (void *)q,(void *)(& q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion", (char *)"goto_valid",(char *)"!\\valid(q)",47); } /*@ assert ¬\valid(r); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& r), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)r,sizeof(int), (void *)r,(void *)(& r)); __gen_e_acsl_and_3 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(! __gen_e_acsl_and_3,(char *)"Assertion", (char *)"goto_valid",(char *)"!\\valid(r)",48); } __e_acsl_delete_block((void *)(& a1)); goto SECOND; __e_acsl_full_init((void *)(& q)); q = & a; __e_acsl_full_init((void *)(& r)); r = q; __e_acsl_full_init((void *)(& p)); p = r; __e_acsl_delete_block((void *)(& a1)); } SECOND: /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(! __gen_e_acsl_and_4,(char *)"Assertion", (char *)"goto_valid",(char *)"!\\valid(p)",56); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_5 = 0; __e_acsl_assert(! __gen_e_acsl_and_5,(char *)"Assertion", (char *)"goto_valid",(char *)"!\\valid(q)",57); } /*@ assert ¬\valid(r); */ { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& r), sizeof(int *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)r,sizeof(int),(void *)r, (void *)(& r)); __gen_e_acsl_and_6 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(! __gen_e_acsl_and_6,(char *)"Assertion", (char *)"goto_valid",(char *)"!\\valid(r)",58); } __retres = 0; __e_acsl_delete_block((void *)(& r)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); return __retres; } int switch_valid(void) { int __retres; int *p; int *q; int *s; __e_acsl_store_block((void *)(& s),(size_t)8); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); int i = 1; __e_acsl_store_block((void *)(& i),(size_t)4); __e_acsl_full_init((void *)(& i)); __e_acsl_full_init((void *)(& s)); s = & i; switch (i) { default: { int a1 = 0; __e_acsl_store_block((void *)(& a1),(size_t)4); __e_acsl_full_init((void *)(& a1)); __e_acsl_full_init((void *)(& p)); p = & a1; { int a2 = 0; __e_acsl_store_block((void *)(& a2),(size_t)4); __e_acsl_full_init((void *)(& a2)); __e_acsl_full_init((void *)(& q)); q = & a2; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion", (char *)"switch_valid",(char *)"\\valid(p)",76); } /*@ assert \valid(q); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(int), (void *)q,(void *)(& q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion", (char *)"switch_valid",(char *)"\\valid(q)",77); } /*@ assert \valid(s); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& s), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)s,sizeof(int), (void *)s,(void *)(& s)); __gen_e_acsl_and_3 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion", (char *)"switch_valid",(char *)"\\valid(s)",78); } __e_acsl_delete_block((void *)(& a1)); __e_acsl_delete_block((void *)(& a2)); break; __e_acsl_delete_block((void *)(& a2)); } __e_acsl_full_init((void *)(& q)); q = & i; __e_acsl_full_init((void *)(& p)); p = q; __e_acsl_full_init((void *)(& s)); s = (int *)0; __e_acsl_delete_block((void *)(& a1)); } } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(! __gen_e_acsl_and_4,(char *)"Assertion", (char *)"switch_valid",(char *)"!\\valid(q)",87); } /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_5 = 0; __e_acsl_assert(! __gen_e_acsl_and_5,(char *)"Assertion", (char *)"switch_valid",(char *)"!\\valid(p)",88); } /*@ assert \valid(s); */ { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& s), sizeof(int *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)s,sizeof(int),(void *)s, (void *)(& s)); __gen_e_acsl_and_6 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(__gen_e_acsl_and_6,(char *)"Assertion", (char *)"switch_valid",(char *)"\\valid(s)",89); } __retres = 0; __e_acsl_delete_block((void *)(& s)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& i)); return __retres; } int while_valid(void) { int __retres; int *p; int *q; int *r; __e_acsl_store_block((void *)(& r),(size_t)8); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); int i = 5; { int a0 = 0; __e_acsl_store_block((void *)(& a0),(size_t)4); __e_acsl_full_init((void *)(& a0)); __e_acsl_full_init((void *)(& r)); r = & a0; while (1) { i --; if (! i) break; { int a1 = 0; __e_acsl_store_block((void *)(& a1),(size_t)4); __e_acsl_full_init((void *)(& a1)); __e_acsl_full_init((void *)(& p)); p = & a1; { int a2 = 0; __e_acsl_store_block((void *)(& a2),(size_t)4); __e_acsl_full_init((void *)(& a2)); __e_acsl_full_init((void *)(& q)); q = & a2; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion", (char *)"while_valid",(char *)"\\valid(p)",108); } /*@ assert \valid(q); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(int), (void *)q,(void *)(& q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion", (char *)"while_valid",(char *)"\\valid(q)",109); } /*@ assert \valid(r); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& r), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)r,sizeof(int), (void *)r,(void *)(& r)); __gen_e_acsl_and_3 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion", (char *)"while_valid",(char *)"\\valid(r)",110); } if (! i) { __e_acsl_delete_block((void *)(& a1)); __e_acsl_delete_block((void *)(& a2)); break; } __e_acsl_delete_block((void *)(& a2)); __e_acsl_delete_block((void *)(& a1)); } } } /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(! __gen_e_acsl_and_4,(char *)"Assertion", (char *)"while_valid",(char *)"!\\valid(p)",116); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)q,sizeof(int), (void *)q,(void *)(& q)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_5 = 0; __e_acsl_assert(! __gen_e_acsl_and_5,(char *)"Assertion", (char *)"while_valid",(char *)"!\\valid(q)",117); } /*@ assert \valid(r); */ { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& r), sizeof(int *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)r,sizeof(int), (void *)r,(void *)(& r)); __gen_e_acsl_and_6 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(__gen_e_acsl_and_6,(char *)"Assertion", (char *)"while_valid",(char *)"\\valid(r)",118); __e_acsl_delete_block((void *)(& a0)); } } __retres = 0; __e_acsl_delete_block((void *)(& r)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); return __retres; } void continue_valid(void) { int *p; int *q; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); int i = 0; while (1) { int tmp; tmp = i; i ++; ; if (! tmp) break; { /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(! __gen_e_acsl_and,(char *)"Assertion", (char *)"continue_valid",(char *)"!\\valid(p)",130); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(int), (void *)q,(void *)(& q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion", (char *)"continue_valid",(char *)"!\\valid(q)",131); } int a1 = 1; __e_acsl_store_block((void *)(& a1),(size_t)4); __e_acsl_full_init((void *)(& a1)); __e_acsl_full_init((void *)(& p)); p = & a1; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and_3 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion", (char *)"continue_valid",(char *)"\\valid(p)",135); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)q,sizeof(int), (void *)q,(void *)(& q)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(! __gen_e_acsl_and_4,(char *)"Assertion", (char *)"continue_valid",(char *)"!\\valid(q)",136); } { int a2 = 1; __e_acsl_store_block((void *)(& a2),(size_t)4); __e_acsl_full_init((void *)(& a2)); __e_acsl_full_init((void *)(& q)); q = & a2; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_5 = 0; __e_acsl_assert(__gen_e_acsl_and_5,(char *)"Assertion", (char *)"continue_valid",(char *)"\\valid(p)",141); } /*@ assert \valid(q); */ { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)q,sizeof(int), (void *)q,(void *)(& q)); __gen_e_acsl_and_6 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(__gen_e_acsl_and_6,(char *)"Assertion", (char *)"continue_valid",(char *)"\\valid(q)",142); } __e_acsl_delete_block((void *)(& a1)); __e_acsl_delete_block((void *)(& a2)); continue; __e_acsl_delete_block((void *)(& a2)); } if (i == 5) { __e_acsl_delete_block((void *)(& a1)); break; } __e_acsl_delete_block((void *)(& a1)); } } /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized_7; int __gen_e_acsl_and_7; __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_7) { int __gen_e_acsl_valid_7; __gen_e_acsl_valid_7 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_7 = __gen_e_acsl_valid_7; } else __gen_e_acsl_and_7 = 0; __e_acsl_assert(! __gen_e_acsl_and_7,(char *)"Assertion", (char *)"continue_valid",(char *)"!\\valid(p)",150); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_8; int __gen_e_acsl_and_8; __gen_e_acsl_initialized_8 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_8) { int __gen_e_acsl_valid_8; __gen_e_acsl_valid_8 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_8 = __gen_e_acsl_valid_8; } else __gen_e_acsl_and_8 = 0; __e_acsl_assert(! __gen_e_acsl_and_8,(char *)"Assertion", (char *)"continue_valid",(char *)"!\\valid(q)",151); } __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); return; } int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); goto_bts(); goto_valid(); switch_valid(); while_valid(); continue_valid(); __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_errno.c0000666000000000000000000000252713571573400023351 0ustar /* Generated by Frama-C */ #include "errno.h" #include "stdio.h" #include "stdlib.h" void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& errno),(size_t)4); __e_acsl_full_init((void *)(& errno)); } return; } int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); int *p = & errno; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",11); } __retres = 0; __e_acsl_delete_block((void *)(& errno)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_freeable.c0000666000000000000000000000530513571573400023766 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char array[1024]; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(array),(size_t)1024); __e_acsl_full_init((void *)(& array)); } return; } int main(void) { int __retres; int *p; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& p),(size_t)8); /*@ assert ¬\freeable(p); */ { int __gen_e_acsl_freeable; /*@ assert Eva: initialization: \initialized(&p); */ __gen_e_acsl_freeable = __e_acsl_freeable((void *)p); __e_acsl_assert(! __gen_e_acsl_freeable,(char *)"Assertion", (char *)"main",(char *)"!\\freeable(p)",14); } /*@ assert ¬\freeable((void *)0); */ { int __gen_e_acsl_freeable_2; __gen_e_acsl_freeable_2 = __e_acsl_freeable((void *)0); __e_acsl_assert(! __gen_e_acsl_freeable_2,(char *)"Assertion", (char *)"main",(char *)"!\\freeable((void *)0)",15); } __e_acsl_full_init((void *)(& p)); p = (int *)malloc((unsigned long)4 * sizeof(int)); /*@ assert ¬\freeable(p + 1); */ { int __gen_e_acsl_freeable_3; __gen_e_acsl_freeable_3 = __e_acsl_freeable((void *)(p + 1)); __e_acsl_assert(! __gen_e_acsl_freeable_3,(char *)"Assertion", (char *)"main",(char *)"!\\freeable(p + 1)",17); } /*@ assert \freeable(p); */ { int __gen_e_acsl_freeable_4; __gen_e_acsl_freeable_4 = __e_acsl_freeable((void *)p); __e_acsl_assert(__gen_e_acsl_freeable_4,(char *)"Assertion", (char *)"main",(char *)"\\freeable(p)",18); } free((void *)p); /*@ assert ¬\freeable(p); */ { int __gen_e_acsl_freeable_5; __gen_e_acsl_freeable_5 = __e_acsl_freeable((void *)p); __e_acsl_assert(! __gen_e_acsl_freeable_5,(char *)"Assertion", (char *)"main",(char *)"!\\freeable(p)",20); } /*@ assert ¬\freeable((char *)array); */ { int __gen_e_acsl_freeable_6; __gen_e_acsl_freeable_6 = __e_acsl_freeable((void *)(array)); __e_acsl_assert(! __gen_e_acsl_freeable_6,(char *)"Assertion", (char *)"main",(char *)"!\\freeable((char *)array)",23); } /*@ assert ¬\freeable(&array[5]); */ { int __gen_e_acsl_freeable_7; __gen_e_acsl_freeable_7 = __e_acsl_freeable((void *)(& array[5])); __e_acsl_assert(! __gen_e_acsl_freeable_7,(char *)"Assertion", (char *)"main",(char *)"!\\freeable(&array[5])",24); } __retres = 0; __e_acsl_delete_block((void *)(array)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_ghost_parameters.c0000666000000000000000000000050413571573400025564 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" void function(int a, int b, int c, int d) { return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int w = 0; int x = 1; int y = 2; int z = 3; function(w,x,y,z); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_goto.c0000666000000000000000000000202213571573400023162 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char a; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& a),(size_t)1); __e_acsl_full_init((void *)(& a)); } return; } int main(void) { int __retres; char *b; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& b),(size_t)8); goto _LOR; _LOR: { __e_acsl_full_init((void *)(& b)); b = & a; } if (a) goto _LOR; /*@ assert \initialized(b); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)b,sizeof(char)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main",(char *)"\\initialized(b)",15); } __retres = 0; __e_acsl_delete_block((void *)(& a)); __e_acsl_delete_block((void *)(& b)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_hidden_malloc.c0000666000000000000000000000207113571573400025000 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; /*@ assigns \result, *((char *)x_1 + (0 ..)); assigns \result \from *(x_0 + (0 ..)), *((char *)x_1 + (0 ..)); assigns *((char *)x_1 + (0 ..)) \from *(x_0 + (0 ..)), *((char *)x_1 + (0 ..)); */ extern int ( /* missing proto */ realpath)(char const *x_0, void *x_1); void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "."; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof(".")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); } return; } int main(int argc, char const **argv) { int __retres; int tmp; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); tmp = realpath(__gen_e_acsl_literal_string,(void *)0); char *cwd = (char *)tmp; __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_init.c0000666000000000000000000000321613571573400023163 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int a = 0; int b; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& b),(size_t)4); __e_acsl_full_init((void *)(& b)); __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); int *p = & a; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); int *q = & b; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); /*@ assert \initialized(&b); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"\\initialized(&b)",9); /*@ assert \initialized(q); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)q,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main",(char *)"\\initialized(q)",10); } /*@ assert \initialized(p); */ { int __gen_e_acsl_initialized_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_2,(char *)"Assertion", (char *)"main",(char *)"\\initialized(p)",11); } __retres = 0; __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_init_function.c0000666000000000000000000000040313571573400025063 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); char *a = malloc((unsigned long)7); __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_initialized.c0000666000000000000000000003370713571573400024535 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int A = 0; int B; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& B),(size_t)4); __e_acsl_full_init((void *)(& B)); __e_acsl_store_block((void *)(& A),(size_t)4); __e_acsl_full_init((void *)(& A)); } return; } int main(void) { int __retres; int b; long *r; long d[2]; int dup[2]; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(d),(size_t)16); __e_acsl_store_block((void *)(& r),(size_t)8); __e_acsl_store_block((void *)(& b),(size_t)4); int *p = & A; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); int *q = & B; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); /*@ assert \initialized(&A); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"\\initialized(&A)",16); /*@ assert \initialized(&B); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"\\initialized(&B)",17); /*@ assert \initialized(p); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main",(char *)"\\initialized(p)",18); } /*@ assert \initialized(q); */ { int __gen_e_acsl_initialized_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)q,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_2,(char *)"Assertion", (char *)"main",(char *)"\\initialized(q)",19); } int a = 0; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); long c[2] = {(long)1, (long)1}; __e_acsl_store_block((void *)(c),(size_t)16); __e_acsl_full_init((void *)(& c)); __e_acsl_full_init((void *)(& p)); p = & a; __e_acsl_full_init((void *)(& q)); q = & b; /*@ assert \initialized(&a); */ { int __gen_e_acsl_initialized_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& a), sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_3,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&a)",30); } /*@ assert ¬\initialized(&b); */ { int __gen_e_acsl_initialized_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& b), sizeof(int)); __e_acsl_assert(! __gen_e_acsl_initialized_4,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(&b)",31); } /*@ assert \initialized(p); */ { int __gen_e_acsl_initialized_5; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_5,(char *)"Assertion", (char *)"main",(char *)"\\initialized(p)",32); } /*@ assert ¬\initialized(q); */ { int __gen_e_acsl_initialized_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)q,sizeof(int)); __e_acsl_assert(! __gen_e_acsl_initialized_6,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(q)",33); } /*@ assert \initialized(&c); */ { int __gen_e_acsl_initialized_7; __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& c), sizeof(long [2])); __e_acsl_assert(__gen_e_acsl_initialized_7,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&c)",34); } /*@ assert ¬\initialized(&d); */ { int __gen_e_acsl_initialized_8; __gen_e_acsl_initialized_8 = __e_acsl_initialized((void *)(& d), sizeof(long [2])); __e_acsl_assert(! __gen_e_acsl_initialized_8,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(&d)",35); } __e_acsl_full_init((void *)(& b)); b = 0; /*@ assert \initialized(q); */ { int __gen_e_acsl_initialized_9; __gen_e_acsl_initialized_9 = __e_acsl_initialized((void *)q,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_9,(char *)"Assertion", (char *)"main",(char *)"\\initialized(q)",39); } /*@ assert \initialized(&b); */ { int __gen_e_acsl_initialized_10; __gen_e_acsl_initialized_10 = __e_acsl_initialized((void *)(& b), sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_10,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&b)",40); } __e_acsl_full_init((void *)(& r)); r = d; /*@ assert ¬\initialized((long *)d); */ { int __gen_e_acsl_initialized_11; __gen_e_acsl_initialized_11 = __e_acsl_initialized((void *)(d), sizeof(long)); __e_acsl_assert(! __gen_e_acsl_initialized_11,(char *)"Assertion", (char *)"main",(char *)"!\\initialized((long *)d)",43); } /*@ assert ¬\initialized(&d[1]); */ { int __gen_e_acsl_initialized_12; __gen_e_acsl_initialized_12 = __e_acsl_initialized((void *)(& d[1]), sizeof(long)); __e_acsl_assert(! __gen_e_acsl_initialized_12,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(&d[1])",44); } /*@ assert ¬\initialized(&d); */ { int __gen_e_acsl_initialized_13; __gen_e_acsl_initialized_13 = __e_acsl_initialized((void *)(& d), sizeof(long [2])); __e_acsl_assert(! __gen_e_acsl_initialized_13,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(&d)",45); } /*@ assert ¬\initialized(r); */ { int __gen_e_acsl_initialized_14; __gen_e_acsl_initialized_14 = __e_acsl_initialized((void *)r, sizeof(long)); __e_acsl_assert(! __gen_e_acsl_initialized_14,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(r)",46); } /*@ assert ¬\initialized(r + 1); */ { int __gen_e_acsl_initialized_15; __gen_e_acsl_initialized_15 = __e_acsl_initialized((void *)(r + 1), sizeof(long)); __e_acsl_assert(! __gen_e_acsl_initialized_15,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(r + 1)",47); } __e_acsl_initialize((void *)(d),sizeof(long)); d[0] = (long)1; /*@ assert \initialized((long *)d); */ { int __gen_e_acsl_initialized_16; __gen_e_acsl_initialized_16 = __e_acsl_initialized((void *)(d), sizeof(long)); __e_acsl_assert(__gen_e_acsl_initialized_16,(char *)"Assertion", (char *)"main",(char *)"\\initialized((long *)d)",50); } /*@ assert ¬\initialized(&d[1]); */ { int __gen_e_acsl_initialized_17; __gen_e_acsl_initialized_17 = __e_acsl_initialized((void *)(& d[1]), sizeof(long)); __e_acsl_assert(! __gen_e_acsl_initialized_17,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(&d[1])",51); } /*@ assert ¬\initialized(&d); */ { int __gen_e_acsl_initialized_18; __gen_e_acsl_initialized_18 = __e_acsl_initialized((void *)(& d), sizeof(long [2])); __e_acsl_assert(! __gen_e_acsl_initialized_18,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(&d)",52); } /*@ assert \initialized(r); */ { int __gen_e_acsl_initialized_19; __gen_e_acsl_initialized_19 = __e_acsl_initialized((void *)r, sizeof(long)); __e_acsl_assert(__gen_e_acsl_initialized_19,(char *)"Assertion", (char *)"main",(char *)"\\initialized(r)",53); } /*@ assert ¬\initialized(r + 1); */ { int __gen_e_acsl_initialized_20; __gen_e_acsl_initialized_20 = __e_acsl_initialized((void *)(r + 1), sizeof(long)); __e_acsl_assert(! __gen_e_acsl_initialized_20,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(r + 1)",54); } __e_acsl_initialize((void *)(& d[1]),sizeof(long)); d[1] = (long)1; /*@ assert \initialized((long *)d); */ { int __gen_e_acsl_initialized_21; __gen_e_acsl_initialized_21 = __e_acsl_initialized((void *)(d), sizeof(long)); __e_acsl_assert(__gen_e_acsl_initialized_21,(char *)"Assertion", (char *)"main",(char *)"\\initialized((long *)d)",57); } /*@ assert \initialized(&d[1]); */ { int __gen_e_acsl_initialized_22; __gen_e_acsl_initialized_22 = __e_acsl_initialized((void *)(& d[1]), sizeof(long)); __e_acsl_assert(__gen_e_acsl_initialized_22,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&d[1])",58); } /*@ assert \initialized(&d); */ { int __gen_e_acsl_initialized_23; __gen_e_acsl_initialized_23 = __e_acsl_initialized((void *)(& d), sizeof(long [2])); __e_acsl_assert(__gen_e_acsl_initialized_23,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&d)",59); } /*@ assert \initialized(r); */ { int __gen_e_acsl_initialized_24; __gen_e_acsl_initialized_24 = __e_acsl_initialized((void *)r, sizeof(long)); __e_acsl_assert(__gen_e_acsl_initialized_24,(char *)"Assertion", (char *)"main",(char *)"\\initialized(r)",60); } /*@ assert \initialized(r + 1); */ { int __gen_e_acsl_initialized_25; __gen_e_acsl_initialized_25 = __e_acsl_initialized((void *)(r + 1), sizeof(long)); __e_acsl_assert(__gen_e_acsl_initialized_25,(char *)"Assertion", (char *)"main",(char *)"\\initialized(r + 1)",61); } __e_acsl_full_init((void *)(& p)); p = (int *)malloc(sizeof(int *)); /*@ assert ¬\initialized(p); */ { int __gen_e_acsl_initialized_26; __gen_e_acsl_initialized_26 = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(! __gen_e_acsl_initialized_26,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(p)",65); } __e_acsl_full_init((void *)(& q)); q = (int *)calloc((unsigned long)1,sizeof(int)); /*@ assert \initialized(q); */ { int __gen_e_acsl_initialized_27; __gen_e_acsl_initialized_27 = __e_acsl_initialized((void *)q,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_27,(char *)"Assertion", (char *)"main",(char *)"\\initialized(q)",69); } __e_acsl_full_init((void *)(& q)); q = (int *)realloc((void *)q,(unsigned long)2 * sizeof(int)); /*@ assert \initialized(q); */ { int __gen_e_acsl_initialized_28; __gen_e_acsl_initialized_28 = __e_acsl_initialized((void *)q,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_28,(char *)"Assertion", (char *)"main",(char *)"\\initialized(q)",74); } __e_acsl_full_init((void *)(& q)); q ++; /*@ assert ¬\initialized(q); */ { int __gen_e_acsl_initialized_29; __gen_e_acsl_initialized_29 = __e_acsl_initialized((void *)q,sizeof(int)); __e_acsl_assert(! __gen_e_acsl_initialized_29,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(q)",76); } __e_acsl_full_init((void *)(& q)); q --; free((void *)p); free((void *)q); /*@ assert ¬\initialized(p); */ { int __gen_e_acsl_initialized_30; /*@ assert Eva: dangling_pointer: ¬\dangling(&p); */ __gen_e_acsl_initialized_30 = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(! __gen_e_acsl_initialized_30,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(p)",84); } /*@ assert ¬\initialized(q); */ { int __gen_e_acsl_initialized_31; __gen_e_acsl_initialized_31 = __e_acsl_initialized((void *)q,sizeof(int)); __e_acsl_assert(! __gen_e_acsl_initialized_31,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(q)",85); } __e_acsl_full_init((void *)(& q)); q = (int *)(& q - 1024 * 5); __e_acsl_full_init((void *)(& q)); q = (int *)128; /*@ assert ¬\initialized(q); */ { int __gen_e_acsl_initialized_32; __gen_e_acsl_initialized_32 = __e_acsl_initialized((void *)q,sizeof(int)); __e_acsl_assert(! __gen_e_acsl_initialized_32,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(q)",93); } __e_acsl_full_init((void *)(& p)); p = (int *)0; /*@ assert ¬\initialized(p); */ { int __gen_e_acsl_initialized_33; __gen_e_acsl_initialized_33 = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(! __gen_e_acsl_initialized_33,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(p)",96); } int size = 100; char *partsc = malloc((unsigned long)size * sizeof(char)); char *partsi = malloc((unsigned long)size * sizeof(int)); { int i = 0; while (i < size) { if (i % 2 != 0) *(partsc + i) = (char)'0'; else *(partsi + i) = (char)0; i ++; } } { int i_0 = 0; while (i_0 < size) { if (i_0 % 2 != 0) ; i_0 ++; } } dup[0] = 1; dup[0] = 1; __retres = 0; __e_acsl_delete_block((void *)(& B)); __e_acsl_delete_block((void *)(& A)); __e_acsl_delete_block((void *)(d)); __e_acsl_delete_block((void *)(c)); __e_acsl_delete_block((void *)(& r)); __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_literal_string.c0000666000000000000000000001334013571573400025241 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string_6; char *__gen_e_acsl_literal_string_5; char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_4; char *__gen_e_acsl_literal_string_3; char *__gen_e_acsl_literal_string_2; int main(void); char *T = (char *)"bar"; int G = 0; void f(void) { /*@ assert *(T + G) ≡ 'b'; */ { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(T + G), sizeof(char),(void *)T, (void *)(& T)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(T + G)",11); __e_acsl_assert((int)*(T + G) == 98,(char *)"Assertion",(char *)"f", (char *)"*(T + G) == \'b\'",11); } G ++; return; } char *S = (char *)"foo"; char *S2 = (char *)"foo2"; int IDX = 1; int G2 = 2; char const *s_str = "the cat"; char const *l_str = "the dog and the cat"; char *U = (char *)"baz"; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string_6 = "the dog and the cat"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_6, sizeof("the dog and the cat")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_6); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_6); __gen_e_acsl_literal_string_5 = "the cat"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_5, sizeof("the cat")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_5); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_5); __gen_e_acsl_literal_string = "ss"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("ss")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_4 = "foo2"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_4, sizeof("foo2")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_4); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_4); __gen_e_acsl_literal_string_3 = "foo"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3,sizeof("foo")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3); __gen_e_acsl_literal_string_2 = "bar"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2,sizeof("bar")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __e_acsl_store_block((void *)(& l_str),(size_t)8); __e_acsl_full_init((void *)(& l_str)); __e_acsl_store_block((void *)(& s_str),(size_t)8); __e_acsl_full_init((void *)(& s_str)); __e_acsl_store_block((void *)(& S2),(size_t)8); __e_acsl_full_init((void *)(& S2)); __e_acsl_store_block((void *)(& S),(size_t)8); __e_acsl_full_init((void *)(& S)); __e_acsl_store_block((void *)(& T),(size_t)8); __e_acsl_full_init((void *)(& T)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); char *SS = (char *)__gen_e_acsl_literal_string; __e_acsl_store_block((void *)(& SS),(size_t)8); __e_acsl_full_init((void *)(& SS)); /*@ assert *(S + G2) ≡ 'o'; */ { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(S + G2), sizeof(char),(void *)S, (void *)(& S)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(S + G2)",25); __e_acsl_assert((int)*(S + G2) == 111,(char *)"Assertion",(char *)"main", (char *)"*(S + G2) == \'o\'",25); } /*@ assert \initialized(S); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)S,sizeof(char)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main",(char *)"\\initialized(S)",26); } /*@ assert \valid_read(S2); */ { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)S2,sizeof(char), (void *)S2, (void *)(& S2)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"Assertion", (char *)"main",(char *)"\\valid_read(S2)",27); } /*@ assert ¬\valid(SS); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& SS), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)SS,sizeof(char),(void *)SS, (void *)(& SS)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(! __gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"!\\valid(SS)",28); } f(); s_str ++; l_str ++; __retres = 0; __e_acsl_delete_block((void *)(& l_str)); __e_acsl_delete_block((void *)(& s_str)); __e_acsl_delete_block((void *)(& S2)); __e_acsl_delete_block((void *)(& S)); __e_acsl_delete_block((void *)(& T)); __e_acsl_delete_block((void *)(& SS)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_local_goto.c0000666000000000000000000000611013571573400024336 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_3; char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string_4; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "t is %d, going to %s\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string, sizeof("t is %d, going to %s\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_3 = "UP"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3,sizeof("UP")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3); __gen_e_acsl_literal_string_2 = "RET"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2,sizeof("RET")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string_4 = "AGAIN"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_4, sizeof("AGAIN")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_4); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_4); } return; } int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); int t = 0; UP: ; if (t == 2) { printf(__gen_e_acsl_literal_string,t,__gen_e_acsl_literal_string_2); goto RET; } AGAIN: { int a; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); a = 1; /*@ assert \valid(&a); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(& a),sizeof(int), (void *)(& a),(void *)0); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"\\valid(&a)",25); } if (t == 2) { printf(__gen_e_acsl_literal_string,t,__gen_e_acsl_literal_string_3); __e_acsl_delete_block((void *)(& a)); goto UP; } else t ++; int b = 15; __e_acsl_store_block((void *)(& b),(size_t)4); __e_acsl_full_init((void *)(& b)); /*@ assert \valid(&b); */ { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)(& b),sizeof(int), (void *)(& b),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Assertion", (char *)"main",(char *)"\\valid(&b)",36); } printf(__gen_e_acsl_literal_string,t,__gen_e_acsl_literal_string_4); __e_acsl_delete_block((void *)(& a)); __e_acsl_delete_block((void *)(& b)); goto AGAIN; __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); } RET: __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_local_init.c0000666000000000000000000000134113571573400024332 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int X = 0; int *p = & X; int f(void) { int x = *p; return x; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_store_block((void *)(& X),(size_t)4); __e_acsl_full_init((void *)(& X)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); f(); __retres = 0; __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& X)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_local_var.c0000666000000000000000000000327213571573400024164 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" struct list { int element ; struct list *next ; }; struct list *add(struct list *l, int i) { struct list *new; __e_acsl_store_block((void *)(& new),(size_t)8); __e_acsl_store_block((void *)(& l),(size_t)8); __e_acsl_full_init((void *)(& new)); new = (struct list *)malloc(sizeof(struct list)); /*@ assert \valid(new); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& new), sizeof(struct list *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)new,sizeof(struct list), (void *)new,(void *)(& new)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"add", (char *)"\\valid(new)",15); } __e_acsl_initialize((void *)(& new->element),sizeof(int)); new->element = i; __e_acsl_initialize((void *)(& new->next),sizeof(struct list *)); new->next = l; __e_acsl_delete_block((void *)(& l)); __e_acsl_delete_block((void *)(& new)); return new; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); struct list *l = (struct list *)0; __e_acsl_store_block((void *)(& l),(size_t)8); __e_acsl_full_init((void *)(& l)); __e_acsl_full_init((void *)(& l)); l = add(l,4); __e_acsl_full_init((void *)(& l)); l = add(l,7); __retres = 0; __e_acsl_delete_block((void *)(& l)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_mainargs.c0000666000000000000000000002030013571573400024012 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" #include "string.h" extern int __e_acsl_sound_verdict; /*@ requires \valid(&argc); requires \valid(&argv); */ int main(int argc, char **argv); int __gen_e_acsl_main(int argc, char **argv) { int __retres; int i; /*@ assert ∀ int k; 0 ≤ k < argc ⇒ \valid(argv + k); */ { int __gen_e_acsl_forall; int __gen_e_acsl_k; __e_acsl_store_block((void *)(& argv),(size_t)8); __gen_e_acsl_forall = 1; __gen_e_acsl_k = 0; while (1) { if (__gen_e_acsl_k < argc) ; else break; { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(argv + __gen_e_acsl_k), sizeof(char *),(void *)argv, (void *)(& argv)); if (__gen_e_acsl_valid) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop1; } } __gen_e_acsl_k ++; } e_acsl_end_loop1: ; __e_acsl_assert(__gen_e_acsl_forall,(char *)"Assertion",(char *)"main", (char *)"\\forall int k; 0 <= k < argc ==> \\valid(argv + k)", 12); } /*@ assert \block_length(argv) ≡ (argc + 1) * sizeof(char *); */ { unsigned long __gen_e_acsl_block_length; __e_acsl_mpz_t __gen_e_acsl_block_length_2; __e_acsl_mpz_t __gen_e_acsl_; int __gen_e_acsl_eq; __gen_e_acsl_block_length = __e_acsl_block_length((void *)argv); __gmpz_init_set_ui(__gen_e_acsl_block_length_2,__gen_e_acsl_block_length); __gmpz_init_set_si(__gen_e_acsl_,(argc + 1L) * 8); __gen_e_acsl_eq = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_block_length_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); __e_acsl_assert(__gen_e_acsl_eq == 0,(char *)"Assertion",(char *)"main", (char *)"\\block_length(argv) == (argc + 1) * sizeof(char *)", 13); __gmpz_clear(__gen_e_acsl_block_length_2); __gmpz_clear(__gen_e_acsl_); } /*@ assert *(argv + argc) ≡ \null; */ { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(argv + argc), sizeof(char *), (void *)argv, (void *)(& argv)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(argv + argc)",15); /*@ assert Eva: mem_access: \valid_read(argv + argc); */ __e_acsl_assert(*(argv + argc) == (char *)0,(char *)"Assertion", (char *)"main",(char *)"*(argv + argc) == \\null",15); } /*@ assert ¬\valid(*(argv + argc)); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(argv + argc), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read_2; int __gen_e_acsl_valid_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(argv + argc), sizeof(char *), (void *)argv, (void *)(& argv)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(argv + argc)",16); /*@ assert Eva: mem_access: \valid_read(argv + argc); */ __gen_e_acsl_valid_2 = __e_acsl_valid((void *)*(argv + argc), sizeof(char), (void *)*(argv + argc), (void *)(argv + argc)); __gen_e_acsl_and = __gen_e_acsl_valid_2; } else __gen_e_acsl_and = 0; __e_acsl_assert(! __gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"!\\valid(*(argv + argc))",16); } i = 0; while (i < argc) { { size_t tmp; tmp = __gen_e_acsl_strlen((char const *)*(argv + i)); int len = (int)tmp; /*@ assert \valid(*(argv + i)); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(argv + i), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_read_3; int __gen_e_acsl_valid_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)(argv + i), sizeof(char *), (void *)argv, (void *)(& argv)); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"RTE", (char *)"main", (char *)"mem_access: \\valid_read(argv + i)",19); __gen_e_acsl_valid_3 = __e_acsl_valid((void *)*(argv + i), sizeof(char), (void *)*(argv + i), (void *)(argv + i)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion", (char *)"main",(char *)"\\valid(*(argv + i))",19); } /*@ assert ∀ int k; 0 ≤ k ≤ len ⇒ \valid(*(argv + i) + k); */ { int __gen_e_acsl_forall_2; long __gen_e_acsl_k_2; __gen_e_acsl_forall_2 = 1; __gen_e_acsl_k_2 = 0; while (1) { if (__gen_e_acsl_k_2 <= (long)len) ; else break; { int __gen_e_acsl_valid_read_4; int __gen_e_acsl_valid_4; __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)( argv + i), sizeof(char *), (void *)argv, (void *)(& argv)); __e_acsl_assert(__gen_e_acsl_valid_read_4,(char *)"RTE", (char *)"main", (char *)"mem_access: \\valid_read(argv + i)",20); __gen_e_acsl_valid_4 = __e_acsl_valid((void *)(*(argv + i) + __gen_e_acsl_k_2), sizeof(char), (void *)*(argv + i), (void *)(argv + i)); if (__gen_e_acsl_valid_4) ; else { __gen_e_acsl_forall_2 = 0; goto e_acsl_end_loop2; } } __gen_e_acsl_k_2 ++; } e_acsl_end_loop2: ; __e_acsl_assert(__gen_e_acsl_forall_2,(char *)"Assertion", (char *)"main", (char *)"\\forall int k; 0 <= k <= len ==> \\valid(*(argv + i) + k)", 20); } } i ++; } __retres = 0; __e_acsl_delete_block((void *)(& argv)); return __retres; } /*@ requires \valid(&argc); requires \valid(&argv); */ int main(int argc, char **argv) { int __retres; __e_acsl_memory_init(& argc,& argv,(size_t)8); { int __gen_e_acsl_valid; int __gen_e_acsl_valid_2; __gen_e_acsl_valid = __e_acsl_valid((void *)(& argc),sizeof(int), (void *)(& argc),(void *)0); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Precondition",(char *)"main", (char *)"\\valid(&argc)",7); __gen_e_acsl_valid_2 = __e_acsl_valid((void *)(& argv),sizeof(char **), (void *)(& argv),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Precondition", (char *)"main",(char *)"\\valid(&argv)",8); } __retres = __gen_e_acsl_main(argc,argv); __e_acsl_delete_block((void *)(& argv)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_memalign.c0000666000000000000000000001274313571573400024016 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(int argc, char const **argv) { int __retres; char *a; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_store_block((void *)(& a),(size_t)8); char **memptr = malloc(sizeof(void *)); __e_acsl_store_block((void *)(& memptr),(size_t)8); __e_acsl_full_init((void *)(& memptr)); int res2 = posix_memalign((void **)memptr,(unsigned long)256,(unsigned long)15); /*@ assert Eva: initialization: \initialized(memptr); */ char *p = *memptr; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(char),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",15); } /*@ assert \block_length(p) ≡ 15; */ { unsigned long __gen_e_acsl_block_length; __gen_e_acsl_block_length = __e_acsl_block_length((void *)p); __e_acsl_assert(__gen_e_acsl_block_length == 15UL,(char *)"Assertion", (char *)"main",(char *)"\\block_length(p) == 15",16); } /*@ assert \freeable(p); */ { int __gen_e_acsl_freeable; __gen_e_acsl_freeable = __e_acsl_freeable((void *)p); __e_acsl_assert(__gen_e_acsl_freeable,(char *)"Assertion",(char *)"main", (char *)"\\freeable(p)",17); } free((void *)p); /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& p), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)p,sizeof(char),(void *)p, (void *)(& p)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"!\\valid(p)",19); } __e_acsl_full_init((void *)(& a)); a = (char *)aligned_alloc((unsigned long)256,(unsigned long)12); /*@ assert a ≡ \null; */ __e_acsl_assert(a == (char *)0,(char *)"Assertion",(char *)"main", (char *)"a == \\null",23); __e_acsl_full_init((void *)(& a)); a = (char *)aligned_alloc((unsigned long)255,(unsigned long)512); /*@ assert a ≡ \null; */ __e_acsl_assert(a == (char *)0,(char *)"Assertion",(char *)"main", (char *)"a == \\null",26); __e_acsl_full_init((void *)(& a)); a = (char *)aligned_alloc((unsigned long)0,(unsigned long)512); /*@ assert a ≡ \null; */ __e_acsl_assert(a == (char *)0,(char *)"Assertion",(char *)"main", (char *)"a == \\null",29); __e_acsl_full_init((void *)(& a)); a = (char *)aligned_alloc((unsigned long)256,(unsigned long)512); /*@ assert a ≢ \null; */ __e_acsl_assert(a != (char *)0,(char *)"Assertion",(char *)"main", (char *)"a != \\null",32); /*@ assert \valid(a); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& a), sizeof(char *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)a,sizeof(char),(void *)a, (void *)(& a)); __gen_e_acsl_and_3 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid(a)",33); } /*@ assert \block_length(a) ≡ 512; */ { unsigned long __gen_e_acsl_block_length_2; __gen_e_acsl_block_length_2 = __e_acsl_block_length((void *)a); __e_acsl_assert(__gen_e_acsl_block_length_2 == 512UL,(char *)"Assertion", (char *)"main",(char *)"\\block_length(a) == 512",34); } /*@ assert \freeable(a); */ { int __gen_e_acsl_freeable_2; __gen_e_acsl_freeable_2 = __e_acsl_freeable((void *)a); __e_acsl_assert(__gen_e_acsl_freeable_2,(char *)"Assertion", (char *)"main",(char *)"\\freeable(a)",35); } free((void *)a); /*@ assert ¬\valid(a); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& a), sizeof(char *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)a,sizeof(char),(void *)a, (void *)(& a)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(! __gen_e_acsl_and_4,(char *)"Assertion",(char *)"main", (char *)"!\\valid(a)",38); } __retres = 0; __e_acsl_delete_block((void *)(& a)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& memptr)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_memsize.c0000666000000000000000000001002213571573400023662 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(int argc, char **argv) { int __retres; __e_acsl_memory_init(& argc,& argv,(size_t)8); char *a = malloc((unsigned long)7); /*@ assert __e_acsl_heap_allocation_size ≡ 7; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 7UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 7",14); char *b = malloc((unsigned long)14); /*@ assert __e_acsl_heap_allocation_size ≡ 21; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 21UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 21",16); free((void *)a); /*@ assert __e_acsl_heap_allocation_size ≡ 14; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 14UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 14",20); a = (char *)0; free((void *)a); /*@ assert __e_acsl_heap_allocation_size ≡ 14; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 14UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 14",25); b = (char *)realloc((void *)b,(unsigned long)9); /*@ assert __e_acsl_heap_allocation_size ≡ 9; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 9UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 9",29); b = (char *)realloc((void *)b,(unsigned long)18); /*@ assert __e_acsl_heap_allocation_size ≡ 18; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 18UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 18",33); b = (char *)realloc((void *)b,(unsigned long)0); b = (char *)0; /*@ assert __e_acsl_heap_allocation_size ≡ 0; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 0UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 0",38); b = (char *)realloc((void *)b,(unsigned long)8); /*@ assert __e_acsl_heap_allocation_size ≡ 8; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 8UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 8",42); b = (char *)realloc((void *)0,(unsigned long)8); /*@ assert __e_acsl_heap_allocation_size ≡ 16; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 16UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 16",46); b = (char *)realloc((void *)0,18446744073709551615UL); /*@ assert __e_acsl_heap_allocation_size ≡ 16; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 16UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 16",50); /*@ assert b ≡ (char *)((void *)0); */ __e_acsl_assert(b == (char *)0,(char *)"Assertion",(char *)"main", (char *)"b == (char *)((void *)0)",51); b = (char *)calloc(18446744073709551615UL,18446744073709551615UL); /*@ assert __e_acsl_heap_allocation_size ≡ 16; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 16UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 16",55); /*@ assert b ≡ (char *)((void *)0); */ __e_acsl_assert(b == (char *)0,(char *)"Assertion",(char *)"main", (char *)"b == (char *)((void *)0)",56); b = (char *)malloc(18446744073709551615UL); /*@ assert __e_acsl_heap_allocation_size ≡ 16; */ __e_acsl_assert(__e_acsl_heap_allocation_size == 16UL,(char *)"Assertion", (char *)"main", (char *)"__e_acsl_heap_allocation_size == 16",60); /*@ assert b ≡ (char *)((void *)0); */ __e_acsl_assert(b == (char *)0,(char *)"Assertion",(char *)"main", (char *)"b == (char *)((void *)0)",61); __retres = 0; __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_null.c0000666000000000000000000000055013571573400023170 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); /*@ assert \null ≡ (void *)0; */ __e_acsl_assert((void *)0 == (void *)0,(char *)"Assertion",(char *)"main", (char *)"\\null == (void *)0",6); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_offset.c0000666000000000000000000002025013571573400023503 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int A[4] = {1, 2, 3, 4}; int *PA; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& PA),(size_t)8); __e_acsl_full_init((void *)(& PA)); __e_acsl_store_block((void *)(A),(size_t)16); __e_acsl_full_init((void *)(& A)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); PA = (int *)(& A); /*@ assert \offset((int *)A) ≡ 0; */ { unsigned long __gen_e_acsl_offset; __gen_e_acsl_offset = __e_acsl_offset((void *)(A)); __e_acsl_assert(__gen_e_acsl_offset == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\offset((int *)A) == 0",13); } /*@ assert \offset(&A[3]) ≡ 12; */ { unsigned long __gen_e_acsl_offset_2; __gen_e_acsl_offset_2 = __e_acsl_offset((void *)(& A[3])); __e_acsl_assert(__gen_e_acsl_offset_2 == 12UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(&A[3]) == 12",14); } /*@ assert \offset(PA) ≡ 0; */ { unsigned long __gen_e_acsl_offset_3; __gen_e_acsl_offset_3 = __e_acsl_offset((void *)PA); __e_acsl_assert(__gen_e_acsl_offset_3 == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(PA) == 0",15); } PA ++; /*@ assert \offset(PA + 1) ≡ 8; */ { unsigned long __gen_e_acsl_offset_4; __gen_e_acsl_offset_4 = __e_acsl_offset((void *)(PA + 1)); __e_acsl_assert(__gen_e_acsl_offset_4 == 8UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(PA + 1) == 8",17); } int a[4] = {1, 2, 3, 4}; __e_acsl_store_block((void *)(a),(size_t)16); __e_acsl_full_init((void *)(& a)); /*@ assert \offset((int *)a) ≡ 0; */ { unsigned long __gen_e_acsl_offset_5; __gen_e_acsl_offset_5 = __e_acsl_offset((void *)(a)); __e_acsl_assert(__gen_e_acsl_offset_5 == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\offset((int *)a) == 0",21); } /*@ assert \offset(&a[1]) ≡ 4; */ { unsigned long __gen_e_acsl_offset_6; __gen_e_acsl_offset_6 = __e_acsl_offset((void *)(& a[1])); __e_acsl_assert(__gen_e_acsl_offset_6 == 4UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(&a[1]) == 4",22); } /*@ assert \offset(&a[3]) ≡ 12; */ { unsigned long __gen_e_acsl_offset_7; __gen_e_acsl_offset_7 = __e_acsl_offset((void *)(& a[3])); __e_acsl_assert(__gen_e_acsl_offset_7 == 12UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(&a[3]) == 12",23); } long l = (long)4; __e_acsl_store_block((void *)(& l),(size_t)8); __e_acsl_full_init((void *)(& l)); char *pl = (char *)(& l); __e_acsl_store_block((void *)(& pl),(size_t)8); __e_acsl_full_init((void *)(& pl)); /*@ assert \offset(&l) ≡ 0; */ { unsigned long __gen_e_acsl_offset_8; __gen_e_acsl_offset_8 = __e_acsl_offset((void *)(& l)); __e_acsl_assert(__gen_e_acsl_offset_8 == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(&l) == 0",28); } /*@ assert \offset(pl) ≡ 0; */ { unsigned long __gen_e_acsl_offset_9; __gen_e_acsl_offset_9 = __e_acsl_offset((void *)pl); __e_acsl_assert(__gen_e_acsl_offset_9 == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(pl) == 0",29); } /*@ assert \offset(pl + 1) ≡ 1; */ { unsigned long __gen_e_acsl_offset_10; __gen_e_acsl_offset_10 = __e_acsl_offset((void *)(pl + 1)); __e_acsl_assert(__gen_e_acsl_offset_10 == 1UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(pl + 1) == 1",30); } /*@ assert \offset(pl + 7) ≡ 7; */ { unsigned long __gen_e_acsl_offset_11; __gen_e_acsl_offset_11 = __e_acsl_offset((void *)(pl + 7)); __e_acsl_assert(__gen_e_acsl_offset_11 == 7UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(pl + 7) == 7",31); } int *pi = (int *)(& l); __e_acsl_store_block((void *)(& pi),(size_t)8); __e_acsl_full_init((void *)(& pi)); /*@ assert \offset(pi) ≡ 0; */ { unsigned long __gen_e_acsl_offset_12; __gen_e_acsl_offset_12 = __e_acsl_offset((void *)pi); __e_acsl_assert(__gen_e_acsl_offset_12 == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(pi) == 0",33); } __e_acsl_full_init((void *)(& pi)); pi ++; /*@ assert \offset(pi) ≡ 4; */ { unsigned long __gen_e_acsl_offset_13; __gen_e_acsl_offset_13 = __e_acsl_offset((void *)pi); __e_acsl_assert(__gen_e_acsl_offset_13 == 4UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(pi) == 4",35); } char *p = malloc((unsigned long)12); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); /*@ assert \offset(p) ≡ 0; */ { unsigned long __gen_e_acsl_offset_14; __gen_e_acsl_offset_14 = __e_acsl_offset((void *)p); __e_acsl_assert(__gen_e_acsl_offset_14 == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(p) == 0",39); } /*@ assert \offset(p + 1) ≡ 1; */ { unsigned long __gen_e_acsl_offset_15; __gen_e_acsl_offset_15 = __e_acsl_offset((void *)(p + 1)); __e_acsl_assert(__gen_e_acsl_offset_15 == 1UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(p + 1) == 1",40); } /*@ assert \offset(p + 11) ≡ 11; */ { unsigned long __gen_e_acsl_offset_16; __gen_e_acsl_offset_16 = __e_acsl_offset((void *)(p + 11)); __e_acsl_assert(__gen_e_acsl_offset_16 == 11UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(p + 11) == 11",41); } __e_acsl_full_init((void *)(& p)); p += 5; /*@ assert \offset(p + 5) ≡ 10; */ { unsigned long __gen_e_acsl_offset_17; __gen_e_acsl_offset_17 = __e_acsl_offset((void *)(p + 5)); __e_acsl_assert(__gen_e_acsl_offset_17 == 10UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(p + 5) == 10",43); } /*@ assert \offset(p - 5) ≡ 0; */ { unsigned long __gen_e_acsl_offset_18; __gen_e_acsl_offset_18 = __e_acsl_offset((void *)(p - 5)); __e_acsl_assert(__gen_e_acsl_offset_18 == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(p - 5) == 0",44); } long *q = malloc((unsigned long)30 * sizeof(long)); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); /*@ assert \offset(q) ≡ 0; */ { unsigned long __gen_e_acsl_offset_19; __gen_e_acsl_offset_19 = __e_acsl_offset((void *)q); __e_acsl_assert(__gen_e_acsl_offset_19 == 0UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(q) == 0",49); } __e_acsl_full_init((void *)(& q)); q ++; /*@ assert \offset(q) ≡ sizeof(long); */ { unsigned long __gen_e_acsl_offset_20; __gen_e_acsl_offset_20 = __e_acsl_offset((void *)q); __e_acsl_assert(__gen_e_acsl_offset_20 == 8UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(q) == sizeof(long)",51); } __e_acsl_full_init((void *)(& q)); q += 2; /*@ assert \offset(q) ≡ sizeof(long) * 3; */ { unsigned long __gen_e_acsl_offset_21; __gen_e_acsl_offset_21 = __e_acsl_offset((void *)q); __e_acsl_assert(__gen_e_acsl_offset_21 == 24UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(q) == sizeof(long) * 3", 53); } __e_acsl_full_init((void *)(& q)); q += 4; /*@ assert \offset(q) ≡ sizeof(long) * 7; */ { unsigned long __gen_e_acsl_offset_22; __gen_e_acsl_offset_22 = __e_acsl_offset((void *)q); __e_acsl_assert(__gen_e_acsl_offset_22 == 56UL,(char *)"Assertion", (char *)"main",(char *)"\\offset(q) == sizeof(long) * 7", 55); } __retres = 0; __e_acsl_delete_block((void *)(& PA)); __e_acsl_delete_block((void *)(A)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& pi)); __e_acsl_delete_block((void *)(& pl)); __e_acsl_delete_block((void *)(& l)); __e_acsl_delete_block((void *)(a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_other_constants.c0000666000000000000000000000077113571573400025440 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" enum bool { false = 0, true = 1 }; int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); /*@ assert 'c' ≡ 'c'; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"\'c\' == \'c\'",10); /*@ assert false ≢ true; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"false != true",11); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_ptr.c0000666000000000000000000001177113571573400023032 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 1; __e_acsl_store_block((void *)(& x),(size_t)4); __e_acsl_full_init((void *)(& x)); int t[3] = {2, 3, 4}; __e_acsl_store_block((void *)(t),(size_t)12); __e_acsl_full_init((void *)(& t)); int *p = & x; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); /*@ assert *p ≡ 1; */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid_read; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p)",11); __e_acsl_assert(*p == 1,(char *)"Assertion",(char *)"main", (char *)"*p == 1",11); } /*@ assert t[0] ≡ 2; */ __e_acsl_assert(t[0] == 2,(char *)"Assertion",(char *)"main", (char *)"t[0] == 2",12); /*@ assert t[2] ≡ 4; */ __e_acsl_assert(t[2] == 4,(char *)"Assertion",(char *)"main", (char *)"t[2] == 4",13); /*@ assert t[(2 * sizeof(int)) / sizeof((int)0x0)] ≡ 4; */ __e_acsl_assert(t[2] == 4,(char *)"Assertion",(char *)"main", (char *)"t[(2 * sizeof(int)) / sizeof((int)0x0)] == 4",14); { int i = 0; while (i < 2) { /*@ assert t[i] ≡ i + 2; */ { __e_acsl_assert(i < 3,(char *)"RTE",(char *)"main", (char *)"index_bound: i < 3",17); __e_acsl_assert(0 <= i,(char *)"RTE",(char *)"main", (char *)"index_bound: 0 <= i",17); __e_acsl_assert((long)t[i] == i + 2L,(char *)"Assertion", (char *)"main",(char *)"t[i] == i + 2",17); } /*@ assert t[2 - i] ≡ 4 - i; */ { __e_acsl_assert(2L - i < 3L,(char *)"RTE",(char *)"main", (char *)"index_bound: (long)(2 - i) < 3",18); __e_acsl_assert(0L <= 2L - i,(char *)"RTE",(char *)"main", (char *)"index_bound: 0 <= (long)(2 - i)",18); __e_acsl_assert((long)t[2L - i] == 4L - i,(char *)"Assertion", (char *)"main",(char *)"t[2 - i] == 4 - i",18); } /*@ assert *(&t[2] - i) ≡ 4 - i; */ { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(& t[2] - i), sizeof(int), (void *)(& t[2]), (void *)0); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE", (char *)"main", (char *)"mem_access: \\valid_read(&t[2] - i)",19); __e_acsl_assert((long)*(& t[2] - i) == 4L - i,(char *)"Assertion", (char *)"main",(char *)"*(&t[2] - i) == 4 - i",19); } i ++; } } __e_acsl_full_init((void *)(& p)); p = & t[2]; __e_acsl_initialize((void *)(& t[2]),sizeof(int)); t[2] = 5; /*@ assert *p ≡ 5; */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)p,sizeof(int), (void *)p, (void *)(& p)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_read_3; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p)",25); __e_acsl_assert(*p == 5,(char *)"Assertion",(char *)"main", (char *)"*p == 5",25); } int k = -1; /*@ assert *(p + k) ≡ 3; */ { int __gen_e_acsl_valid_read_4; __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)(p + k), sizeof(int),(void *)p, (void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid_read_4,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p + k)",27); __e_acsl_assert(*(p + k) == 3,(char *)"Assertion",(char *)"main", (char *)"*(p + k) == 3",27); } __retres = 0; __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(t)); __e_acsl_delete_block((void *)(& x)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_ptr_init.c0000666000000000000000000000346613571573400024057 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int *A; int *B; void f(void) { A = B; return; } void g(int *C, int *D) { /*@ assert \initialized(&C); */ { __e_acsl_store_block((void *)(& C),(size_t)8); __e_acsl_assert(1,(char *)"Assertion",(char *)"g", (char *)"\\initialized(&C)",16); } __e_acsl_delete_block((void *)(& C)); return; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& B),(size_t)8); __e_acsl_full_init((void *)(& B)); __e_acsl_store_block((void *)(& A),(size_t)8); __e_acsl_full_init((void *)(& A)); } return; } int main(void) { int __retres; int *x; int *y; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& y),(size_t)8); __e_acsl_store_block((void *)(& x),(size_t)8); B = (int *)malloc(sizeof(int)); __e_acsl_full_init((void *)(& y)); y = (int *)malloc(sizeof(int)); __e_acsl_full_init((void *)(& x)); x = y; f(); /*@ assert \initialized(&A); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"\\initialized(&A)",25); /*@ assert \initialized(&x); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& x), sizeof(int *)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&x)",26); } g(x,y); __retres = 0; __e_acsl_delete_block((void *)(& B)); __e_acsl_delete_block((void *)(& A)); __e_acsl_delete_block((void *)(& y)); __e_acsl_delete_block((void *)(& x)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_ranges_in_builtins.c0000666000000000000000000006102713571573400026102 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; struct S { int a[2] ; float *b ; float *c ; }; /*@ requires ¬\valid(s + (3 .. n + 1000)); */ void __gen_e_acsl_f(char *s, long n); void f(char *s, long n) { return; } /*@ requires \valid(ptr + (0 .. size - 1)); ensures ¬\valid(\old(ptr) + (0 .. \old(size) + 1)); */ void __gen_e_acsl_g(long *ptr, size_t size); void g(long *ptr, size_t size) { __e_acsl_store_block((void *)(& ptr),(size_t)8); __e_acsl_delete_block((void *)(& ptr)); return; } int main(void) { int __retres; int *a; char *b; double t2[4]; float t3[7][2][4]; struct S s; int **multi_dynamic; int i; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& multi_dynamic),(size_t)8); __e_acsl_store_block((void *)(& s),(size_t)24); __e_acsl_store_block((void *)(t3),(size_t)224); __e_acsl_store_block((void *)(t2),(size_t)32); __e_acsl_store_block((void *)(& b),(size_t)8); __e_acsl_store_block((void *)(& a),(size_t)8); __e_acsl_full_init((void *)(& a)); a = (int *)malloc((unsigned long)10 * sizeof(int)); /*@ assert \valid(a + (0 .. 4)); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)((char *)a + 4 * 0), (size_t)16,(void *)a,(void *)(& a)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"\\valid(a + (0 .. 4))",19); } int j = 2; /*@ assert \valid(a + (4 .. 8 + j)); */ { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)((char *)a + 4 * 4), (size_t)(4L * ((8L + j) - 4L)), (void *)a,(void *)(& a)); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Assertion",(char *)"main", (char *)"\\valid(a + (4 .. 8 + j))",21); } /*@ assert ¬\valid(a + (10 .. 11)); */ { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)((char *)a + 4 * 10), (size_t)4,(void *)a,(void *)(& a)); __e_acsl_assert(! __gen_e_acsl_valid_3,(char *)"Assertion", (char *)"main",(char *)"!\\valid(a + (10 .. 11))",22); } free((void *)a); __e_acsl_full_init((void *)(& b)); b = (char *)malloc((unsigned long)10 * sizeof(char)); /*@ assert \valid(b + (0 .. 10)); */ { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)(b + 1 * 0),(size_t)10, (void *)b,(void *)(& b)); __e_acsl_assert(__gen_e_acsl_valid_4,(char *)"Assertion",(char *)"main", (char *)"\\valid(b + (0 .. 10))",27); } /*@ assert ¬\valid(b + (11 .. 15)); */ { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)(b + 1 * 11),(size_t)4, (void *)b,(void *)(& b)); __e_acsl_assert(! __gen_e_acsl_valid_5,(char *)"Assertion", (char *)"main",(char *)"!\\valid(b + (11 .. 15))",28); } long t[3] = {7l, 8l, 9l}; __e_acsl_store_block((void *)(t),(size_t)24); __e_acsl_full_init((void *)(& t)); /*@ assert \valid(&t[0 .. 2]); */ { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)((char *)(& t) + 8 * 0), (size_t)16,(void *)(& t),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_6,(char *)"Assertion",(char *)"main", (char *)"\\valid(&t[0 .. 2])",31); } /*@ assert ¬\valid(&t[3 .. 5]); */ { int __gen_e_acsl_valid_7; __gen_e_acsl_valid_7 = __e_acsl_valid((void *)((char *)(& t) + 8 * 3), (size_t)16,(void *)(& t),(void *)0); __e_acsl_assert(! __gen_e_acsl_valid_7,(char *)"Assertion", (char *)"main",(char *)"!\\valid(&t[3 .. 5])",32); } __gen_e_acsl_g(t,(unsigned long)3); __e_acsl_initialize((void *)(t2),sizeof(double)); t2[0] = 0.5; __e_acsl_initialize((void *)(& t2[1]),sizeof(double)); t2[1] = 1.5; /*@ assert \initialized(&t2[0 .. 1]); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)((char *)(& t2) + 8 * 0), (size_t)8); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&t2[0 .. 1])",38); } /*@ assert ¬\initialized(&t2[2 .. 3]); */ { int __gen_e_acsl_initialized_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)((char *)(& t2) + 8 * 2), (size_t)8); __e_acsl_assert(! __gen_e_acsl_initialized_2,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(&t2[2 .. 3])",39); } /*@ assert ¬\initialized(b + (0 .. 10)); */ { int __gen_e_acsl_initialized_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(b + 1 * 0), (size_t)10); __e_acsl_assert(! __gen_e_acsl_initialized_3,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(b + (0 .. 10))", 41); } free((void *)b); int n = 2; /*@ assert ¬\initialized(&t3[n - 1 .. n + 2][1][0 .. 1]); */ { int __gen_e_acsl_forall; int __gen_e_acsl_range_2; __gen_e_acsl_forall = 1; __gen_e_acsl_range_2 = 0; while (1) { if (__gen_e_acsl_range_2 <= 1) ; else break; { int __gen_e_acsl_forall_2; long __gen_e_acsl_range; __gen_e_acsl_forall_2 = 1; __gen_e_acsl_range = n - 1L; while (1) { if (__gen_e_acsl_range <= n + 2L) ; else break; { int __gen_e_acsl_initialized_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& t3[__gen_e_acsl_range][1][__gen_e_acsl_range_2]), sizeof(float)); if (__gen_e_acsl_initialized_4) ; else { __gen_e_acsl_forall_2 = 0; goto e_acsl_end_loop1; } } __gen_e_acsl_range ++; } e_acsl_end_loop1: ; if (__gen_e_acsl_forall_2) ; else { __gen_e_acsl_forall = 0; goto e_acsl_end_loop2; } } __gen_e_acsl_range_2 ++; } e_acsl_end_loop2: ; __e_acsl_assert(! __gen_e_acsl_forall,(char *)"Assertion",(char *)"main", (char *)"!\\initialized(&t3[n - 1 .. n + 2][1][0 .. 1])", 46); } /*@ assert ¬\valid_read(&t3[6][1][0] + (2 .. 10)); */ { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)((char *)(& t3[6][1][0]) + 4 * 2),(size_t)32, (void *)(& t3[6][1][0]), (void *)0); __e_acsl_assert(! __gen_e_acsl_valid_read,(char *)"Assertion", (char *)"main", (char *)"!\\valid_read(&t3[6][1][0] + (2 .. 10))",48); } /*@ assert \valid_read(&t3[n - 1 .. n + 2][1]); */ { int __gen_e_acsl_forall_3; long __gen_e_acsl_range_3; __gen_e_acsl_forall_3 = 1; __gen_e_acsl_range_3 = n - 1L; while (1) { if (__gen_e_acsl_range_3 <= n + 2L) ; else break; { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(& t3[__gen_e_acsl_range_3][1]), sizeof(float [4]), (void *)(& t3[__gen_e_acsl_range_3][1]), (void *)0); if (__gen_e_acsl_valid_read_2) ; else { __gen_e_acsl_forall_3 = 0; goto e_acsl_end_loop3; } } __gen_e_acsl_range_3 ++; } e_acsl_end_loop3: ; __e_acsl_assert(__gen_e_acsl_forall_3,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(&t3[n - 1 .. n + 2][1])",49); } __e_acsl_initialize((void *)(& s.a[0]),sizeof(int)); s.a[0] = 7; __e_acsl_initialize((void *)(& s.a[1]),sizeof(int)); s.a[1] = 8; /*@ assert \initialized(&s.a[0] + (1 .. 2)); */ { int __gen_e_acsl_initialized_5; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)((char *)(& s.a[0]) + 4 * 1), (size_t)4); __e_acsl_assert(__gen_e_acsl_initialized_5,(char *)"Assertion", (char *)"main", (char *)"\\initialized(&s.a[0] + (1 .. 2))",53); } /*@ assert ¬\initialized(s.b + (0 .. 1)); */ { int __gen_e_acsl_initialized_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)((char *)s.b + 4 * 0), (size_t)4); __e_acsl_assert(! __gen_e_acsl_initialized_6,(char *)"Assertion", (char *)"main",(char *)"!\\initialized(s.b + (0 .. 1))", 54); } int size1 = 5; int size2 = 9; __e_acsl_full_init((void *)(& multi_dynamic)); multi_dynamic = (int **)malloc((unsigned long)size1 * sizeof(*multi_dynamic)); i = 0; while (i < size1) { __e_acsl_initialize((void *)(multi_dynamic + i),sizeof(int *)); *(multi_dynamic + i) = (int *)malloc((unsigned long)size2 * sizeof(*(*( multi_dynamic + i)))); i ++; } /*@ assert \valid(*(multi_dynamic + 4) + (1 .. 7)); */ { int __gen_e_acsl_valid_read_3; int __gen_e_acsl_valid_8; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)(multi_dynamic + 4), sizeof(int *), (void *)multi_dynamic, (void *)(& multi_dynamic)); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(multi_dynamic + 4)",63); __gen_e_acsl_valid_8 = __e_acsl_valid((void *)((char *)*(multi_dynamic + 4) + 4 * 1),(size_t)24, (void *)*(multi_dynamic + 4), (void *)(multi_dynamic + 4)); __e_acsl_assert(__gen_e_acsl_valid_8,(char *)"Assertion",(char *)"main", (char *)"\\valid(*(multi_dynamic + 4) + (1 .. 7))",63); } /*@ assert \valid(*(multi_dynamic + (2 .. 4)) + (1 .. 7)); */ ; i --; while (i >= 0) { free((void *)*(multi_dynamic + i)); i --; } free((void *)multi_dynamic); char c = (char)'w'; __e_acsl_store_block((void *)(& c),(size_t)1); __e_acsl_full_init((void *)(& c)); __gen_e_acsl_f(& c,(long)5); __retres = 0; __e_acsl_delete_block((void *)(& c)); __e_acsl_delete_block((void *)(& multi_dynamic)); __e_acsl_delete_block((void *)(& s)); __e_acsl_delete_block((void *)(t3)); __e_acsl_delete_block((void *)(t2)); __e_acsl_delete_block((void *)(t)); __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } /*@ requires \valid(ptr + (0 .. size - 1)); ensures ¬\valid(\old(ptr) + (0 .. \old(size) + 1)); */ void __gen_e_acsl_g(long *ptr, size_t size) { __e_acsl_mpz_t __gen_e_acsl_at_2; long *__gen_e_acsl_at; { __e_acsl_mpz_t __gen_e_acsl_size_6; __gmpz_init_set_ui(__gen_e_acsl_size_6,size); __gmpz_init_set(__gen_e_acsl_at_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_6)); __gmpz_clear(__gen_e_acsl_size_6); } { __e_acsl_mpz_t __gen_e_acsl_size_5; __gmpz_init_set_ui(__gen_e_acsl_size_5,size); __gmpz_init_set(__gen_e_acsl_at_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_5)); __gmpz_clear(__gen_e_acsl_size_5); } { __e_acsl_mpz_t __gen_e_acsl_size_4; __gmpz_init_set_ui(__gen_e_acsl_size_4,size); __gmpz_init_set(__gen_e_acsl_at_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_4)); __gmpz_clear(__gen_e_acsl_size_4); } __gen_e_acsl_at = ptr; { __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl_sizeof; __e_acsl_mpz_t __gen_e_acsl_size; __e_acsl_mpz_t __gen_e_acsl__2; __e_acsl_mpz_t __gen_e_acsl_sub; __e_acsl_mpz_t __gen_e_acsl_sub_2; __e_acsl_mpz_t __gen_e_acsl_mul; int __gen_e_acsl_le; int __gen_e_acsl_and; unsigned long __gen_e_acsl_size_3; int __gen_e_acsl_valid; __e_acsl_store_block((void *)(& ptr),(size_t)8); __gmpz_init_set_si(__gen_e_acsl_,0L); __gmpz_init_set_si(__gen_e_acsl_sizeof,8L); __gmpz_init_set_ui(__gen_e_acsl_size,size); __gmpz_init_set_si(__gen_e_acsl__2,1L); __gmpz_init(__gen_e_acsl_sub); __gmpz_sub(__gen_e_acsl_sub, (__e_acsl_mpz_struct const *)(__gen_e_acsl_size), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gmpz_init(__gen_e_acsl_sub_2); __gmpz_sub(__gen_e_acsl_sub_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub), (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); __gmpz_init(__gen_e_acsl_mul); __gmpz_mul(__gen_e_acsl_mul, (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof), (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_2)); __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul)); if (__gen_e_acsl_le <= 0) { __e_acsl_mpz_t __gen_e_acsl_sizeof_2; __e_acsl_mpz_t __gen_e_acsl_size_2; __e_acsl_mpz_t __gen_e_acsl__3; __e_acsl_mpz_t __gen_e_acsl_sub_3; __e_acsl_mpz_t __gen_e_acsl__4; __e_acsl_mpz_t __gen_e_acsl_sub_4; __e_acsl_mpz_t __gen_e_acsl_mul_2; __e_acsl_mpz_t __gen_e_acsl__5; int __gen_e_acsl_lt; __gmpz_init_set_si(__gen_e_acsl_sizeof_2,8L); __gmpz_init_set_ui(__gen_e_acsl_size_2,size); __gmpz_init_set_si(__gen_e_acsl__3,1L); __gmpz_init(__gen_e_acsl_sub_3); __gmpz_sub(__gen_e_acsl_sub_3, (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__3)); __gmpz_init_set_si(__gen_e_acsl__4,0L); __gmpz_init(__gen_e_acsl_sub_4); __gmpz_sub(__gen_e_acsl_sub_4, (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_3), (__e_acsl_mpz_struct const *)(__gen_e_acsl__4)); __gmpz_init(__gen_e_acsl_mul_2); __gmpz_mul(__gen_e_acsl_mul_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_4)); __gmpz_init_set_ui(__gen_e_acsl__5,18446744073709551615UL); __gen_e_acsl_lt = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__5)); __gen_e_acsl_and = __gen_e_acsl_lt < 0; __gmpz_clear(__gen_e_acsl_sizeof_2); __gmpz_clear(__gen_e_acsl_size_2); __gmpz_clear(__gen_e_acsl__3); __gmpz_clear(__gen_e_acsl_sub_3); __gmpz_clear(__gen_e_acsl__4); __gmpz_clear(__gen_e_acsl_sub_4); __gmpz_clear(__gen_e_acsl_mul_2); __gmpz_clear(__gen_e_acsl__5); } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"RTE",(char *)"g", (char *)"\\valid(ptr + (0 .. size - 1))",7); __gen_e_acsl_size_3 = __gmpz_get_ui((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul)); __gen_e_acsl_valid = __e_acsl_valid((void *)((char *)ptr + 8 * 0), __gen_e_acsl_size_3,(void *)ptr, (void *)(& ptr)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Precondition",(char *)"g", (char *)"\\valid(ptr + (0 .. size - 1))",7); __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl_sizeof); __gmpz_clear(__gen_e_acsl_size); __gmpz_clear(__gen_e_acsl__2); __gmpz_clear(__gen_e_acsl_sub); __gmpz_clear(__gen_e_acsl_sub_2); __gmpz_clear(__gen_e_acsl_mul); } g(ptr,size); { __e_acsl_mpz_t __gen_e_acsl__6; __e_acsl_mpz_t __gen_e_acsl_sizeof_3; __e_acsl_mpz_t __gen_e_acsl__7; __e_acsl_mpz_t __gen_e_acsl_add; __e_acsl_mpz_t __gen_e_acsl_sub_5; __e_acsl_mpz_t __gen_e_acsl_mul_3; int __gen_e_acsl_le_2; int __gen_e_acsl_and_2; unsigned long __gen_e_acsl_size_7; int __gen_e_acsl_valid_2; __gmpz_init_set_si(__gen_e_acsl__6,0L); __gmpz_init_set_si(__gen_e_acsl_sizeof_3,8L); __gmpz_init_set_si(__gen_e_acsl__7,1L); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add, (__e_acsl_mpz_struct const *)(__gen_e_acsl_at_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__7)); __gmpz_init(__gen_e_acsl_sub_5); __gmpz_sub(__gen_e_acsl_sub_5, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add), (__e_acsl_mpz_struct const *)(__gen_e_acsl__6)); __gmpz_init(__gen_e_acsl_mul_3); __gmpz_mul(__gen_e_acsl_mul_3, (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof_3), (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_5)); __gen_e_acsl_le_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl__6), (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_3)); if (__gen_e_acsl_le_2 <= 0) { __e_acsl_mpz_t __gen_e_acsl_sizeof_4; __e_acsl_mpz_t __gen_e_acsl__8; __e_acsl_mpz_t __gen_e_acsl_add_2; __e_acsl_mpz_t __gen_e_acsl__9; __e_acsl_mpz_t __gen_e_acsl_sub_6; __e_acsl_mpz_t __gen_e_acsl_mul_4; __e_acsl_mpz_t __gen_e_acsl__10; int __gen_e_acsl_lt_2; __gmpz_init_set_si(__gen_e_acsl_sizeof_4,8L); __gmpz_init_set_si(__gen_e_acsl__8,1L); __gmpz_init(__gen_e_acsl_add_2); __gmpz_add(__gen_e_acsl_add_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_at_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__8)); __gmpz_init_set_si(__gen_e_acsl__9,0L); __gmpz_init(__gen_e_acsl_sub_6); __gmpz_sub(__gen_e_acsl_sub_6, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__9)); __gmpz_init(__gen_e_acsl_mul_4); __gmpz_mul(__gen_e_acsl_mul_4, (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof_4), (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_6)); __gmpz_init_set_ui(__gen_e_acsl__10,18446744073709551615UL); __gen_e_acsl_lt_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_4), (__e_acsl_mpz_struct const *)(__gen_e_acsl__10)); __gen_e_acsl_and_2 = __gen_e_acsl_lt_2 < 0; __gmpz_clear(__gen_e_acsl_sizeof_4); __gmpz_clear(__gen_e_acsl__8); __gmpz_clear(__gen_e_acsl_add_2); __gmpz_clear(__gen_e_acsl__9); __gmpz_clear(__gen_e_acsl_sub_6); __gmpz_clear(__gen_e_acsl_mul_4); __gmpz_clear(__gen_e_acsl__10); } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"RTE",(char *)"g", (char *)"\\valid(\\old(ptr) + (0 .. \\old(size) + 1))",8); __gen_e_acsl_size_7 = __gmpz_get_ui((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_3)); __gen_e_acsl_valid_2 = __e_acsl_valid((void *)((char *)__gen_e_acsl_at + 8 * 0), __gen_e_acsl_size_7, (void *)__gen_e_acsl_at, (void *)(& __gen_e_acsl_at)); __e_acsl_assert(! __gen_e_acsl_valid_2,(char *)"Postcondition", (char *)"g", (char *)"!\\valid(\\old(ptr) + (0 .. \\old(size) + 1))", 8); __e_acsl_delete_block((void *)(& ptr)); __gmpz_clear(__gen_e_acsl__6); __gmpz_clear(__gen_e_acsl_sizeof_3); __gmpz_clear(__gen_e_acsl__7); __gmpz_clear(__gen_e_acsl_add); __gmpz_clear(__gen_e_acsl_sub_5); __gmpz_clear(__gen_e_acsl_mul_3); __gmpz_clear(__gen_e_acsl_at_2); return; } } /*@ requires ¬\valid(s + (3 .. n + 1000)); */ void __gen_e_acsl_f(char *s, long n) { { __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl_sizeof; __e_acsl_mpz_t __gen_e_acsl_n; __e_acsl_mpz_t __gen_e_acsl__2; __e_acsl_mpz_t __gen_e_acsl_add; __e_acsl_mpz_t __gen_e_acsl__3; __e_acsl_mpz_t __gen_e_acsl_sub; __e_acsl_mpz_t __gen_e_acsl_mul; int __gen_e_acsl_le; int __gen_e_acsl_and; unsigned long __gen_e_acsl_size; int __gen_e_acsl_valid; __e_acsl_store_block((void *)(& s),(size_t)8); __gmpz_init_set_si(__gen_e_acsl_,0L); __gmpz_init_set_si(__gen_e_acsl_sizeof,1L); __gmpz_init_set_si(__gen_e_acsl_n,n); __gmpz_init_set_si(__gen_e_acsl__2,1000L); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add, (__e_acsl_mpz_struct const *)(__gen_e_acsl_n), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gmpz_init_set_si(__gen_e_acsl__3,3L); __gmpz_init(__gen_e_acsl_sub); __gmpz_sub(__gen_e_acsl_sub, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add), (__e_acsl_mpz_struct const *)(__gen_e_acsl__3)); __gmpz_init(__gen_e_acsl_mul); __gmpz_mul(__gen_e_acsl_mul, (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof), (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub)); __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul)); if (__gen_e_acsl_le <= 0) { __e_acsl_mpz_t __gen_e_acsl_sizeof_2; __e_acsl_mpz_t __gen_e_acsl_n_2; __e_acsl_mpz_t __gen_e_acsl__4; __e_acsl_mpz_t __gen_e_acsl_add_2; __e_acsl_mpz_t __gen_e_acsl__5; __e_acsl_mpz_t __gen_e_acsl_sub_2; __e_acsl_mpz_t __gen_e_acsl_mul_2; __e_acsl_mpz_t __gen_e_acsl__6; int __gen_e_acsl_lt; __gmpz_init_set_si(__gen_e_acsl_sizeof_2,1L); __gmpz_init_set_si(__gen_e_acsl_n_2,n); __gmpz_init_set_si(__gen_e_acsl__4,1000L); __gmpz_init(__gen_e_acsl_add_2); __gmpz_add(__gen_e_acsl_add_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_n_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__4)); __gmpz_init_set_si(__gen_e_acsl__5,3L); __gmpz_init(__gen_e_acsl_sub_2); __gmpz_sub(__gen_e_acsl_sub_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__5)); __gmpz_init(__gen_e_acsl_mul_2); __gmpz_mul(__gen_e_acsl_mul_2, (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_2)); __gmpz_init_set_ui(__gen_e_acsl__6,18446744073709551615UL); __gen_e_acsl_lt = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl__6)); __gen_e_acsl_and = __gen_e_acsl_lt < 0; __gmpz_clear(__gen_e_acsl_sizeof_2); __gmpz_clear(__gen_e_acsl_n_2); __gmpz_clear(__gen_e_acsl__4); __gmpz_clear(__gen_e_acsl_add_2); __gmpz_clear(__gen_e_acsl__5); __gmpz_clear(__gen_e_acsl_sub_2); __gmpz_clear(__gen_e_acsl_mul_2); __gmpz_clear(__gen_e_acsl__6); } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"RTE",(char *)"f", (char *)"\\valid(s + (3 .. n + 1000))",5); __gen_e_acsl_size = __gmpz_get_ui((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul)); __gen_e_acsl_valid = __e_acsl_valid((void *)(s + 1 * 3), __gen_e_acsl_size,(void *)s, (void *)(& s)); __e_acsl_assert(! __gen_e_acsl_valid,(char *)"Precondition",(char *)"f", (char *)"!\\valid(s + (3 .. n + 1000))",5); __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl_sizeof); __gmpz_clear(__gen_e_acsl_n); __gmpz_clear(__gen_e_acsl__2); __gmpz_clear(__gen_e_acsl_add); __gmpz_clear(__gen_e_acsl__3); __gmpz_clear(__gen_e_acsl_sub); __gmpz_clear(__gen_e_acsl_mul); } f(s,n); __e_acsl_delete_block((void *)(& s)); return; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_sizeof.c0000666000000000000000000000056313571573400023521 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; x ++; /*@ assert sizeof(int) ≡ sizeof(x); */ __e_acsl_assert(1,(char *)"Assertion",(char *)"main", (char *)"sizeof(int) == sizeof(x)",8); __retres = 0; return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_stdout.c0000666000000000000000000000354213571573400023544 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& stdout),(size_t)8); __e_acsl_full_init((void *)(& stdout)); __e_acsl_store_block((void *)(& stdin),(size_t)8); __e_acsl_full_init((void *)(& stdin)); __e_acsl_store_block((void *)(& stderr),(size_t)8); __e_acsl_full_init((void *)(& stderr)); } return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); /*@ assert \valid(__fc_stderr); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)stderr,sizeof(FILE), (void *)stderr,(void *)(& stderr)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"\\valid(__fc_stderr)",8); } /*@ assert \valid(__fc_stdin); */ { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)stdin,sizeof(FILE), (void *)stdin,(void *)(& stdin)); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Assertion",(char *)"main", (char *)"\\valid(__fc_stdin)",9); } /*@ assert \valid(__fc_stdout); */ { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)stdout,sizeof(FILE), (void *)stdout,(void *)(& stdout)); __e_acsl_assert(__gen_e_acsl_valid_3,(char *)"Assertion",(char *)"main", (char *)"\\valid(__fc_stdout)",10); } __retres = 0; __e_acsl_delete_block((void *)(& stdout)); __e_acsl_delete_block((void *)(& stdin)); __e_acsl_delete_block((void *)(& stderr)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_valid.c0000666000000000000000000005126013571573400023321 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; int *X; int Z; /*@ requires \valid(x); ensures \valid(\result); */ int *__gen_e_acsl_f(int *x); int *f(int *x) { int *y; __e_acsl_store_block((void *)(& y),(size_t)8); /*@ assert ¬\valid(y); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __e_acsl_store_block((void *)(& x),(size_t)8); __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& y), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)y,sizeof(int),(void *)y, (void *)(& y)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(! __gen_e_acsl_and,(char *)"Assertion",(char *)"f", (char *)"!\\valid(y)",13); } __e_acsl_full_init((void *)(& y)); y = x; /*@ assert \valid(x); */ { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)x,sizeof(int),(void *)x, (void *)(& x)); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Assertion",(char *)"f", (char *)"\\valid(x)",15); } __e_acsl_delete_block((void *)(& x)); __e_acsl_delete_block((void *)(& y)); return y; } void g(void) { int m; int *u; int **p; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_store_block((void *)(& u),(size_t)8); __e_acsl_store_block((void *)(& m),(size_t)4); __e_acsl_full_init((void *)(& p)); p = & u; __e_acsl_full_init((void *)(& u)); u = & m; __e_acsl_full_init((void *)(& m)); m = 123; /*@ assert \valid(*p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and_2; __gen_e_acsl_initialized = __e_acsl_initialized((void *)p,sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and; int __gen_e_acsl_valid; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& p), sizeof(int **)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)p, sizeof(int *), (void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid_read; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"RTE",(char *)"g", (char *)"mem_access: \\valid_read(p)",24); __gen_e_acsl_valid = __e_acsl_valid((void *)*p,sizeof(int),(void *)*p, (void *)p); __gen_e_acsl_and_2 = __gen_e_acsl_valid; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion",(char *)"g", (char *)"\\valid(*p)",24); } __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& u)); __e_acsl_delete_block((void *)(& m)); return; } /*@ requires \valid(x); ensures \valid(\result); */ int *__gen_e_acsl_f(int *x) { int *__retres; __e_acsl_store_block((void *)(& __retres),(size_t)8); { int __gen_e_acsl_valid; __e_acsl_store_block((void *)(& x),(size_t)8); __gen_e_acsl_valid = __e_acsl_valid((void *)x,sizeof(int),(void *)x, (void *)(& x)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Precondition",(char *)"f", (char *)"\\valid(x)",9); } __retres = f(x); { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)__retres,sizeof(int), (void *)__retres, (void *)(& __retres)); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Postcondition",(char *)"f", (char *)"\\valid(\\result)",10); __e_acsl_delete_block((void *)(& x)); __e_acsl_delete_block((void *)(& __retres)); return __retres; } } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& Z),(size_t)4); __e_acsl_full_init((void *)(& Z)); __e_acsl_store_block((void *)(& X),(size_t)8); __e_acsl_full_init((void *)(& X)); } return; } int main(void) { int __retres; int *a; int *b; int **c; int ***d; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& d),(size_t)8); __e_acsl_store_block((void *)(& c),(size_t)8); __e_acsl_store_block((void *)(& b),(size_t)8); __e_acsl_store_block((void *)(& a),(size_t)8); int n = 0; __e_acsl_store_block((void *)(& n),(size_t)4); __e_acsl_full_init((void *)(& n)); /*@ assert ¬\valid(a) ∧ ¬\valid(b) ∧ ¬\valid(X); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; int __gen_e_acsl_and_3; int __gen_e_acsl_and_4; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& a), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)a,sizeof(int),(void *)a, (void *)(& a)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; if (! __gen_e_acsl_and) { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __gen_e_acsl_and_3 = ! __gen_e_acsl_and_2; } else __gen_e_acsl_and_3 = 0; if (__gen_e_acsl_and_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)X,sizeof(int),(void *)X, (void *)(& X)); __gen_e_acsl_and_4 = ! __gen_e_acsl_valid_3; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(__gen_e_acsl_and_4,(char *)"Assertion",(char *)"main", (char *)"!\\valid(a) && !\\valid(b) && !\\valid(X)",29); } __e_acsl_full_init((void *)(& a)); a = (int *)malloc(sizeof(int)); /*@ assert \valid(a) ∧ ¬\valid(b) ∧ ¬\valid(X); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_5; int __gen_e_acsl_and_7; int __gen_e_acsl_and_8; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& a), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)a,sizeof(int),(void *)a, (void *)(& a)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_5 = 0; if (__gen_e_acsl_and_5) { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_6 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_6 = 0; __gen_e_acsl_and_7 = ! __gen_e_acsl_and_6; } else __gen_e_acsl_and_7 = 0; if (__gen_e_acsl_and_7) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)X,sizeof(int),(void *)X, (void *)(& X)); __gen_e_acsl_and_8 = ! __gen_e_acsl_valid_6; } else __gen_e_acsl_and_8 = 0; __e_acsl_assert(__gen_e_acsl_and_8,(char *)"Assertion",(char *)"main", (char *)"\\valid(a) && !\\valid(b) && !\\valid(X)",31); } X = a; /*@ assert \valid(a) ∧ ¬\valid(b) ∧ \valid(X); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_9; int __gen_e_acsl_and_11; int __gen_e_acsl_and_12; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& a), sizeof(int *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_7; __gen_e_acsl_valid_7 = __e_acsl_valid((void *)a,sizeof(int),(void *)a, (void *)(& a)); __gen_e_acsl_and_9 = __gen_e_acsl_valid_7; } else __gen_e_acsl_and_9 = 0; if (__gen_e_acsl_and_9) { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_10; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_8; __gen_e_acsl_valid_8 = __e_acsl_valid((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_10 = __gen_e_acsl_valid_8; } else __gen_e_acsl_and_10 = 0; __gen_e_acsl_and_11 = ! __gen_e_acsl_and_10; } else __gen_e_acsl_and_11 = 0; if (__gen_e_acsl_and_11) { int __gen_e_acsl_valid_9; __gen_e_acsl_valid_9 = __e_acsl_valid((void *)X,sizeof(int),(void *)X, (void *)(& X)); __gen_e_acsl_and_12 = __gen_e_acsl_valid_9; } else __gen_e_acsl_and_12 = 0; __e_acsl_assert(__gen_e_acsl_and_12,(char *)"Assertion",(char *)"main", (char *)"\\valid(a) && !\\valid(b) && \\valid(X)",33); } __e_acsl_full_init((void *)(& b)); b = __gen_e_acsl_f(& n); /*@ assert \valid(a) ∧ \valid(b) ∧ \valid(X); */ { int __gen_e_acsl_initialized_7; int __gen_e_acsl_and_13; int __gen_e_acsl_and_15; int __gen_e_acsl_and_16; __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& a), sizeof(int *)); if (__gen_e_acsl_initialized_7) { int __gen_e_acsl_valid_10; __gen_e_acsl_valid_10 = __e_acsl_valid((void *)a,sizeof(int),(void *)a, (void *)(& a)); __gen_e_acsl_and_13 = __gen_e_acsl_valid_10; } else __gen_e_acsl_and_13 = 0; if (__gen_e_acsl_and_13) { int __gen_e_acsl_initialized_8; int __gen_e_acsl_and_14; __gen_e_acsl_initialized_8 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_8) { int __gen_e_acsl_valid_11; __gen_e_acsl_valid_11 = __e_acsl_valid((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_14 = __gen_e_acsl_valid_11; } else __gen_e_acsl_and_14 = 0; __gen_e_acsl_and_15 = __gen_e_acsl_and_14; } else __gen_e_acsl_and_15 = 0; if (__gen_e_acsl_and_15) { int __gen_e_acsl_valid_12; __gen_e_acsl_valid_12 = __e_acsl_valid((void *)X,sizeof(int),(void *)X, (void *)(& X)); __gen_e_acsl_and_16 = __gen_e_acsl_valid_12; } else __gen_e_acsl_and_16 = 0; __e_acsl_assert(__gen_e_acsl_and_16,(char *)"Assertion",(char *)"main", (char *)"\\valid(a) && \\valid(b) && \\valid(X)",35); } X = b; /*@ assert \valid(a) ∧ \valid(b) ∧ \valid(X); */ { int __gen_e_acsl_initialized_9; int __gen_e_acsl_and_17; int __gen_e_acsl_and_19; int __gen_e_acsl_and_20; __gen_e_acsl_initialized_9 = __e_acsl_initialized((void *)(& a), sizeof(int *)); if (__gen_e_acsl_initialized_9) { int __gen_e_acsl_valid_13; __gen_e_acsl_valid_13 = __e_acsl_valid((void *)a,sizeof(int),(void *)a, (void *)(& a)); __gen_e_acsl_and_17 = __gen_e_acsl_valid_13; } else __gen_e_acsl_and_17 = 0; if (__gen_e_acsl_and_17) { int __gen_e_acsl_initialized_10; int __gen_e_acsl_and_18; __gen_e_acsl_initialized_10 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_10) { int __gen_e_acsl_valid_14; __gen_e_acsl_valid_14 = __e_acsl_valid((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_18 = __gen_e_acsl_valid_14; } else __gen_e_acsl_and_18 = 0; __gen_e_acsl_and_19 = __gen_e_acsl_and_18; } else __gen_e_acsl_and_19 = 0; if (__gen_e_acsl_and_19) { int __gen_e_acsl_valid_15; __gen_e_acsl_valid_15 = __e_acsl_valid((void *)X,sizeof(int),(void *)X, (void *)(& X)); __gen_e_acsl_and_20 = __gen_e_acsl_valid_15; } else __gen_e_acsl_and_20 = 0; __e_acsl_assert(__gen_e_acsl_and_20,(char *)"Assertion",(char *)"main", (char *)"\\valid(a) && \\valid(b) && \\valid(X)",37); } __e_acsl_full_init((void *)(& c)); c = & a; __e_acsl_full_init((void *)(& d)); d = & c; /*@ assert \valid(*c); */ { int __gen_e_acsl_initialized_11; int __gen_e_acsl_and_22; __gen_e_acsl_initialized_11 = __e_acsl_initialized((void *)c, sizeof(int *)); if (__gen_e_acsl_initialized_11) { int __gen_e_acsl_initialized_12; int __gen_e_acsl_and_21; int __gen_e_acsl_valid_16; __gen_e_acsl_initialized_12 = __e_acsl_initialized((void *)(& c), sizeof(int **)); if (__gen_e_acsl_initialized_12) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)c, sizeof(int *), (void *)c, (void *)(& c)); __gen_e_acsl_and_21 = __gen_e_acsl_valid_read; } else __gen_e_acsl_and_21 = 0; __e_acsl_assert(__gen_e_acsl_and_21,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(c)",40); __gen_e_acsl_valid_16 = __e_acsl_valid((void *)*c,sizeof(int), (void *)*c,(void *)c); __gen_e_acsl_and_22 = __gen_e_acsl_valid_16; } else __gen_e_acsl_and_22 = 0; __e_acsl_assert(__gen_e_acsl_and_22,(char *)"Assertion",(char *)"main", (char *)"\\valid(*c)",40); } /*@ assert \valid(*(*d)); */ { int __gen_e_acsl_valid_read_2; int __gen_e_acsl_initialized_13; int __gen_e_acsl_and_26; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)d,sizeof(int **), (void *)d,(void *)(& d)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(d)",41); __gen_e_acsl_initialized_13 = __e_acsl_initialized((void *)*d, sizeof(int *)); if (__gen_e_acsl_initialized_13) { int __gen_e_acsl_initialized_14; int __gen_e_acsl_and_24; int __gen_e_acsl_initialized_16; int __gen_e_acsl_and_25; int __gen_e_acsl_valid_17; __gen_e_acsl_initialized_14 = __e_acsl_initialized((void *)d, sizeof(int **)); if (__gen_e_acsl_initialized_14) { int __gen_e_acsl_initialized_15; int __gen_e_acsl_and_23; int __gen_e_acsl_valid_read_4; __gen_e_acsl_initialized_15 = __e_acsl_initialized((void *)(& d), sizeof(int ***)); if (__gen_e_acsl_initialized_15) { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)d, sizeof(int **), (void *)d, (void *)(& d)); __gen_e_acsl_and_23 = __gen_e_acsl_valid_read_3; } else __gen_e_acsl_and_23 = 0; __e_acsl_assert(__gen_e_acsl_and_23,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(d)",41); __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)*d, sizeof(int *), (void *)*d,(void *)d); __gen_e_acsl_and_24 = __gen_e_acsl_valid_read_4; } else __gen_e_acsl_and_24 = 0; __e_acsl_assert(__gen_e_acsl_and_24,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(*d)",41); __gen_e_acsl_initialized_16 = __e_acsl_initialized((void *)(& d), sizeof(int ***)); if (__gen_e_acsl_initialized_16) { int __gen_e_acsl_valid_read_5; __gen_e_acsl_valid_read_5 = __e_acsl_valid_read((void *)d, sizeof(int **), (void *)d, (void *)(& d)); __gen_e_acsl_and_25 = __gen_e_acsl_valid_read_5; } else __gen_e_acsl_and_25 = 0; __e_acsl_assert(__gen_e_acsl_and_25,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(d)",41); __gen_e_acsl_valid_17 = __e_acsl_valid((void *)*(*d),sizeof(int), (void *)*(*d),(void *)*d); __gen_e_acsl_and_26 = __gen_e_acsl_valid_17; } else __gen_e_acsl_and_26 = 0; __e_acsl_assert(__gen_e_acsl_and_26,(char *)"Assertion",(char *)"main", (char *)"\\valid(*(*d))",41); } free((void *)a); /*@ assert ¬\valid(a) ∧ \valid(b) ∧ \valid(X); */ { int __gen_e_acsl_initialized_17; int __gen_e_acsl_and_27; int __gen_e_acsl_and_29; int __gen_e_acsl_and_30; __gen_e_acsl_initialized_17 = __e_acsl_initialized((void *)(& a), sizeof(int *)); if (__gen_e_acsl_initialized_17) { int __gen_e_acsl_valid_18; /*@ assert Eva: dangling_pointer: ¬\dangling(&a); */ __gen_e_acsl_valid_18 = __e_acsl_valid((void *)a,sizeof(int),(void *)a, (void *)(& a)); __gen_e_acsl_and_27 = __gen_e_acsl_valid_18; } else __gen_e_acsl_and_27 = 0; if (! __gen_e_acsl_and_27) { int __gen_e_acsl_initialized_18; int __gen_e_acsl_and_28; __gen_e_acsl_initialized_18 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_18) { int __gen_e_acsl_valid_19; __gen_e_acsl_valid_19 = __e_acsl_valid((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_28 = __gen_e_acsl_valid_19; } else __gen_e_acsl_and_28 = 0; __gen_e_acsl_and_29 = __gen_e_acsl_and_28; } else __gen_e_acsl_and_29 = 0; if (__gen_e_acsl_and_29) { int __gen_e_acsl_valid_20; __gen_e_acsl_valid_20 = __e_acsl_valid((void *)X,sizeof(int),(void *)X, (void *)(& X)); __gen_e_acsl_and_30 = __gen_e_acsl_valid_20; } else __gen_e_acsl_and_30 = 0; __e_acsl_assert(__gen_e_acsl_and_30,(char *)"Assertion",(char *)"main", (char *)"!\\valid(a) && \\valid(b) && \\valid(X)",43); } /*@ assert \valid(&Z); */ { int __gen_e_acsl_valid_21; __gen_e_acsl_valid_21 = __e_acsl_valid((void *)(& Z),sizeof(int), (void *)(& Z),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_21,(char *)"Assertion",(char *)"main", (char *)"\\valid(&Z)",44); } g(); __retres = 0; __e_acsl_delete_block((void *)(& Z)); __e_acsl_delete_block((void *)(& X)); __e_acsl_delete_block((void *)(& n)); __e_acsl_delete_block((void *)(& d)); __e_acsl_delete_block((void *)(& c)); __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_valid_alias.c0000666000000000000000000001261213571573400024470 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; int *a; int *b; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& b),(size_t)8); __e_acsl_store_block((void *)(& a),(size_t)8); int n = 0; /*@ assert ¬\valid(a) ∧ ¬\valid(b); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; int __gen_e_acsl_and_3; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& a), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)a,sizeof(int),(void *)a, (void *)(& a)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; if (! __gen_e_acsl_and) { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __gen_e_acsl_and_3 = ! __gen_e_acsl_and_2; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"!\\valid(a) && !\\valid(b)",9); } __e_acsl_full_init((void *)(& a)); a = (int *)malloc(sizeof(int)); __e_acsl_initialize((void *)a,sizeof(int)); *a = n; __e_acsl_full_init((void *)(& b)); b = a; /*@ assert \valid(a) ∧ \valid(b); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_4; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& a), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)a,sizeof(int),(void *)a, (void *)(& a)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_4 = 0; if (__gen_e_acsl_and_4) { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_5 = 0; __gen_e_acsl_and_6 = __gen_e_acsl_and_5; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(__gen_e_acsl_and_6,(char *)"Assertion",(char *)"main", (char *)"\\valid(a) && \\valid(b)",13); } /*@ assert *b ≡ n; */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_7; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_7 = __gen_e_acsl_valid_read; } else __gen_e_acsl_and_7 = 0; __e_acsl_assert(__gen_e_acsl_and_7,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(b)",14); __e_acsl_assert(*b == n,(char *)"Assertion",(char *)"main", (char *)"*b == n",14); } free((void *)b); /*@ assert ¬\valid(a) ∧ ¬\valid(b); */ { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_8; int __gen_e_acsl_and_10; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& a), sizeof(int *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_5; /*@ assert Eva: dangling_pointer: ¬\dangling(&a); */ __gen_e_acsl_valid_5 = __e_acsl_valid((void *)a,sizeof(int),(void *)a, (void *)(& a)); __gen_e_acsl_and_8 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_8 = 0; if (! __gen_e_acsl_and_8) { int __gen_e_acsl_initialized_7; int __gen_e_acsl_and_9; __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& b), sizeof(int *)); if (__gen_e_acsl_initialized_7) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)b,sizeof(int), (void *)b,(void *)(& b)); __gen_e_acsl_and_9 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_9 = 0; __gen_e_acsl_and_10 = ! __gen_e_acsl_and_9; } else __gen_e_acsl_and_10 = 0; __e_acsl_assert(__gen_e_acsl_and_10,(char *)"Assertion",(char *)"main", (char *)"!\\valid(a) && !\\valid(b)",16); } __retres = 0; __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_valid_in_contract.c0000666000000000000000000000777113571573400025714 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; struct list { int element ; struct list *next ; }; /*@ behavior B1: assumes l ≡ \null; ensures \result ≡ \old(l); behavior B2: assumes ¬\valid(l) ∨ ¬\valid(l->next); ensures \result ≡ \old(l); */ struct list *__gen_e_acsl_f(struct list *l); struct list *f(struct list *l) { struct list *__retres; __e_acsl_store_block((void *)(& __retres),(size_t)8); __e_acsl_store_block((void *)(& l),(size_t)8); if (l == (struct list *)0) { __e_acsl_full_init((void *)(& __retres)); __retres = l; goto return_label; } if (l->next == (struct list *)0) { __e_acsl_full_init((void *)(& __retres)); __retres = l; goto return_label; } __e_acsl_full_init((void *)(& __retres)); __retres = (struct list *)0; return_label: { __e_acsl_delete_block((void *)(& l)); __e_acsl_delete_block((void *)(& __retres)); return __retres; } } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __gen_e_acsl_f((struct list *)0); __retres = 0; __e_acsl_memory_clean(); return __retres; } /*@ behavior B1: assumes l ≡ \null; ensures \result ≡ \old(l); behavior B2: assumes ¬\valid(l) ∨ ¬\valid(l->next); ensures \result ≡ \old(l); */ struct list *__gen_e_acsl_f(struct list *l) { struct list *__gen_e_acsl_at_4; int __gen_e_acsl_at_3; struct list *__gen_e_acsl_at_2; int __gen_e_acsl_at; struct list *__retres; __e_acsl_store_block((void *)(& __retres),(size_t)8); __gen_e_acsl_at_4 = l; { int __gen_e_acsl_valid; int __gen_e_acsl_or; __gen_e_acsl_valid = __e_acsl_valid((void *)l,sizeof(struct list), (void *)l,(void *)(& l)); if (! __gen_e_acsl_valid) __gen_e_acsl_or = 1; else { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& l->next), sizeof(struct list *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; int __gen_e_acsl_valid_2; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(& l->next), sizeof(struct list *), (void *)(& l->next), (void *)0); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(&l->next)",17); __gen_e_acsl_valid_2 = __e_acsl_valid((void *)l->next, sizeof(struct list), (void *)l->next, (void *)(& l->next)); __gen_e_acsl_and = __gen_e_acsl_valid_2; } else __gen_e_acsl_and = 0; __gen_e_acsl_or = ! __gen_e_acsl_and; } __gen_e_acsl_at_3 = __gen_e_acsl_or; } __gen_e_acsl_at_2 = l; __gen_e_acsl_at = l == (struct list *)0; __e_acsl_store_block((void *)(& l),(size_t)8); __retres = f(l); { int __gen_e_acsl_implies; int __gen_e_acsl_implies_2; if (! __gen_e_acsl_at) __gen_e_acsl_implies = 1; else __gen_e_acsl_implies = __retres == __gen_e_acsl_at_2; __e_acsl_assert(__gen_e_acsl_implies,(char *)"Postcondition",(char *)"f", (char *)"\\old(l == \\null) ==> \\result == \\old(l)",15); if (! __gen_e_acsl_at_3) __gen_e_acsl_implies_2 = 1; else __gen_e_acsl_implies_2 = __retres == __gen_e_acsl_at_4; __e_acsl_assert(__gen_e_acsl_implies_2,(char *)"Postcondition", (char *)"f", (char *)"\\old(!\\valid{Here}(l) || !\\valid{Here}(l->next)) ==> \\result == \\old(l)", 18); __e_acsl_delete_block((void *)(& l)); __e_acsl_delete_block((void *)(& __retres)); return __retres; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_vector.c0000666000000000000000000001006613571573400023523 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int LAST; int *new_inversed(int len, int *v) { int i; int *p; __e_acsl_store_block((void *)(& p),(size_t)8); /*@ assert \valid(v) ∧ \offset(v) + len * sizeof(int) ≤ \block_length(v); */ { int __gen_e_acsl_valid; int __gen_e_acsl_and; __e_acsl_store_block((void *)(& v),(size_t)8); __gen_e_acsl_valid = __e_acsl_valid((void *)v,sizeof(int),(void *)v, (void *)(& v)); if (__gen_e_acsl_valid) { unsigned long __gen_e_acsl_offset; __e_acsl_mpz_t __gen_e_acsl_offset_2; __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl_add; unsigned long __gen_e_acsl_block_length; __e_acsl_mpz_t __gen_e_acsl_block_length_2; int __gen_e_acsl_le; __gen_e_acsl_offset = __e_acsl_offset((void *)v); __gmpz_init_set_ui(__gen_e_acsl_offset_2,__gen_e_acsl_offset); __gmpz_init_set_si(__gen_e_acsl_,len * 4L); __gmpz_init(__gen_e_acsl_add); __gmpz_add(__gen_e_acsl_add, (__e_acsl_mpz_struct const *)(__gen_e_acsl_offset_2), (__e_acsl_mpz_struct const *)(__gen_e_acsl_)); __gen_e_acsl_block_length = __e_acsl_block_length((void *)v); __gmpz_init_set_ui(__gen_e_acsl_block_length_2, __gen_e_acsl_block_length); __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add), (__e_acsl_mpz_struct const *)(__gen_e_acsl_block_length_2)); __gen_e_acsl_and = __gen_e_acsl_le <= 0; __gmpz_clear(__gen_e_acsl_offset_2); __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl_add); __gmpz_clear(__gen_e_acsl_block_length_2); } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion", (char *)"new_inversed", (char *)"\\valid(v) && \\offset(v) + len * sizeof(int) <= \\block_length(v)", 11); } __e_acsl_full_init((void *)(& p)); p = (int *)malloc(sizeof(int) * (unsigned long)len); i = 0; while (i < len) { __e_acsl_initialize((void *)(p + i),sizeof(int)); *(p + i) = *(v + ((len - i) - 1)); i ++; } __e_acsl_delete_block((void *)(& v)); __e_acsl_delete_block((void *)(& p)); return p; } int main(void) { int __retres; int *v2; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& v2),(size_t)8); int x = 3; int v1[3] = {1, 2, x}; __e_acsl_store_block((void *)(v1),(size_t)12); __e_acsl_full_init((void *)(& v1)); /*@ assert \valid(&v1[2]); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(& v1[2]),sizeof(int), (void *)(& v1[2]),(void *)0); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"\\valid(&v1[2])",21); } LAST = v1[2]; /*@ assert \initialized(&v1[2]); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& v1[2]), sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&v1[2])",23); } __e_acsl_full_init((void *)(& v2)); v2 = new_inversed(3,v1); /*@ assert Eva: initialization: \initialized(v2 + 2); */ LAST = *(v2 + 2); /*@ assert \initialized(v2 + 2); */ { int __gen_e_acsl_initialized_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(v2 + 2), sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_2,(char *)"Assertion", (char *)"main",(char *)"\\initialized(v2 + 2)",26); } /*@ assert LAST ≡ 1; */ __e_acsl_assert(LAST == 1,(char *)"Assertion",(char *)"main", (char *)"LAST == 1",27); free((void *)v2); __retres = 0; __e_acsl_delete_block((void *)(& v2)); __e_acsl_delete_block((void *)(v1)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/gen_vla.c0000666000000000000000000000475613571573400023014 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int LEN = 10; /*@ assigns \nothing; frees p; */ __attribute__((__FC_BUILTIN__)) void __e_acsl_delete_block(void *p); /* compiler builtin: __attribute__((__FC_BUILTIN__)) void *__builtin_alloca(unsigned long size); */ int main(int argc, char **argv) { int __retres; unsigned long __lengthof_arr; int i; __e_acsl_memory_init(& argc,& argv,(size_t)8); /*@ assert alloca_bounds: 0 < sizeof(int) * LEN ≤ 18446744073709551615; */ { int __gen_e_acsl_and; if (0L < 4L * LEN) { __e_acsl_mpz_t __gen_e_acsl_; __e_acsl_mpz_t __gen_e_acsl__2; int __gen_e_acsl_le; __gmpz_init_set_si(__gen_e_acsl_,4L * LEN); __gmpz_init_set_ui(__gen_e_acsl__2,18446744073709551615UL); __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_), (__e_acsl_mpz_struct const *)(__gen_e_acsl__2)); __gen_e_acsl_and = __gen_e_acsl_le <= 0; __gmpz_clear(__gen_e_acsl_); __gmpz_clear(__gen_e_acsl__2); } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"alloca_bounds: 0 < sizeof(int) * LEN <= 18446744073709551615", 8); } __lengthof_arr = (unsigned long)LEN; int *arr = __builtin_alloca(sizeof(int) * __lengthof_arr); __e_acsl_store_block((void *)arr,sizeof(int) * __lengthof_arr); __e_acsl_store_block((void *)(& arr),(size_t)8); __e_acsl_full_init((void *)(& arr)); i = 0; while (i <= LEN) { if (i < LEN) { /*@ assert \valid(arr + i); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(arr + i),sizeof(int), (void *)arr,(void *)(& arr)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion", (char *)"main",(char *)"\\valid(arr + i)",12); } } else { /*@ assert ¬\valid(arr + i); */ { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)(arr + i),sizeof(int), (void *)arr,(void *)(& arr)); __e_acsl_assert(! __gen_e_acsl_valid_2,(char *)"Assertion", (char *)"main",(char *)"!\\valid(arr + i)",14); } } i ++; } __retres = 0; __e_acsl_delete_block((void *)arr); __e_acsl_delete_block((void *)(& arr)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/ghost_parameters.res.oracle0000666000000000000000000000011713571573400026546 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/goto.res.oracle0000666000000000000000000000011713571573400024147 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/hidden_malloc.res.oracle0000666000000000000000000000104213571573400025757 0ustar [kernel:typing:implicit-function-declaration] tests/memory/hidden_malloc.c:11: Warning: Calling undeclared function realpath. Old style K&R code? [e-acsl] beginning translation. [kernel:annot:missing-spec] tests/memory/hidden_malloc.c:11: Warning: Neither code nor specification for function realpath, generating default assigns from the prototype [e-acsl] translation done in project "e-acsl". [eva:invalid-assigns] tests/memory/hidden_malloc.c:11: Completely invalid destination for assigns clause *((char *)x_1 + (0 ..)). Ignoring. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/init.res.oracle0000666000000000000000000000011713571573400024142 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/init_function.res.oracle0000666000000000000000000000011713571573400026047 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/initialized.res.oracle0000666000000000000000000000045413571573400025510 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/initialized.c:84: Warning: assertion got status unknown. [eva:alarm] tests/memory/initialized.c:84: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/literal_string.res.oracle0000666000000000000000000000011713571573400026221 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/local_goto.res.oracle0000666000000000000000000000037013571573400025322 0ustar [e-acsl] beginning translation. [kernel:annot:missing-spec] FRAMAC_SHARE/libc/stdio.h:211: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/local_init.res.oracle0000666000000000000000000000026013571573400025313 0ustar [eva:alarm] tests/memory/local_init.c:11: Warning: out of bounds read. assert \valid_read(p); [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/local_var.res.oracle0000666000000000000000000000011713571573400025141 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/mainargs.res.oracle0000666000000000000000000000457113571573400025010 0ustar [e-acsl] beginning translation. [e-acsl] Warning: annotating undefined function `strlen': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] FRAMAC_SHARE/libc/string.h:125: Warning: E-ACSL construct `logic functions with labels' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:125: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:127: Warning: E-ACSL construct `logic functions performing read accesses' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/mainargs.c:12: Warning: assertion got status unknown. [eva:alarm] tests/memory/mainargs.c:12: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/mainargs.c:13: Warning: assertion got status unknown. [eva:alarm] tests/memory/mainargs.c:13: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/mainargs.c:15: Warning: assertion got status unknown. [eva:alarm] tests/memory/mainargs.c:15: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/mainargs.c:15: Warning: out of bounds read. assert \valid_read(argv + argc); [eva:alarm] tests/memory/mainargs.c:16: Warning: assertion got status unknown. [eva:alarm] tests/memory/mainargs.c:16: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/mainargs.c:16: Warning: out of bounds read. assert \valid_read(argv + argc); [eva:alarm] tests/memory/mainargs.c:16: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/mainargs.c:18: Warning: function __gen_e_acsl_strlen: precondition 'valid_string_s' got status unknown. [eva:alarm] FRAMAC_SHARE/libc/string.h:125: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva:alarm] FRAMAC_SHARE/libc/string.h:127: Warning: function __gen_e_acsl_strlen: postcondition 'acsl_c_equiv' got status unknown. [eva:alarm] tests/memory/mainargs.c:19: Warning: assertion got status unknown. [eva:alarm] tests/memory/mainargs.c:20: Warning: assertion got status unknown. [eva:alarm] tests/memory/mainargs.c:20: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/memalign.res.oracle0000666000000000000000000000030413571573400024766 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/memalign.c:14: Warning: accessing uninitialized left-value. assert \initialized(memptr); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/memsize.res.oracle0000666000000000000000000000040513571573400024650 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/memsize.c:14: Warning: assertion got status unknown. [eva:alarm] tests/memory/memsize.c:16: Warning: assertion got status invalid (stopping propagation). frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/null.res.oracle0000666000000000000000000000011713571573400024151 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/offset.res.oracle0000666000000000000000000000011713571573400024465 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/other_constants.res.oracle0000666000000000000000000000011713571573400026414 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/ptr.res.oracle0000666000000000000000000000115313571573400024005 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/ptr.i:17: Warning: assertion got status unknown. [eva:alarm] tests/memory/ptr.i:17: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/ptr.i:18: Warning: assertion got status unknown. [eva:alarm] tests/memory/ptr.i:18: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/ptr.i:19: Warning: assertion got status unknown. [eva:alarm] tests/memory/ptr.i:19: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/ptr_init.res.oracle0000666000000000000000000000011713571573400025027 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/ranges_in_builtins.res.oracle0000666000000000000000000000055113571573400027057 0ustar [e-acsl] beginning translation. [e-acsl] tests/memory/ranges_in_builtins.c:64: Warning: E-ACSL construct `arithmetic over set of pointers or arrays' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/ranges_in_builtins.c:21: Warning: assertion got status invalid (stopping propagation). frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/sizeof.res.oracle0000666000000000000000000000011713571573400024476 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/stdout.res.oracle0000666000000000000000000000046413571573400024526 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/stdout.c:8: Warning: assertion got status unknown. [eva:alarm] tests/memory/stdout.c:9: Warning: assertion got status unknown. [eva:alarm] tests/memory/stdout.c:10: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/valid.res.oracle0000666000000000000000000000032113571573400024273 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/valid.c:43: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&a); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/valid_alias.res.oracle0000666000000000000000000000032713571573400025452 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/valid_alias.c:16: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&a); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/valid_in_contract.res.oracle0000666000000000000000000000011713571573400026661 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/vector.res.oracle0000666000000000000000000000057413571573400024510 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/vector.c:11: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/vector.c:25: Warning: accessing uninitialized left-value. assert \initialized(v2 + 2); [eva:alarm] tests/memory/vector.c:27: Warning: assertion got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/oracle_ci/vla.res.oracle0000666000000000000000000000043413571573400023763 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/memory/vla.c:8: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/memory/vla.c:12: Warning: assertion got status invalid (stopping propagation). frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/other_constants.i0000666000000000000000000000042613571573400022672 0ustar /* run.config COMMENT: non integer constants */ enum bool { false, true }; int main(void) { // waiting for clarification of semantics of ACSL's literal strings // /*@ assert "toto" != "titi"; */ /*@ assert 'c' == 'c'; */ /*@ assert false != true; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/ptr.i0000666000000000000000000000104713571573400020262 0ustar /* run.config COMMENT: pointers and pointer arithmetic */ int main(void) { int x = 1; int t[3] = { 2, 3, 4 }; int *p = &x; /*@ assert *p == 1; */ /*@ assert *t == 2; */ /*@ assert *(t+2) == 4; */ /*@ assert *(t+2*sizeof(int)/sizeof((int)0x0)) == 4; */ for(int i = 0; i < 2; i++) { /*@ assert (*(t+i) == i+2); */ ; /*@ assert (*(t+(2-i)) == 4-i); */ ; /*@ assert (*(t+2-i) == 4-i); */ ; ; } p = t+2; t[2] = 5; /*@ assert *p == 5; */ int k = -1; /*@ assert *(p+k) == 3; */ // bts #2252 return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/ptr_init.c0000666000000000000000000000064313571573400021300 0ustar /* run.config COMMENT: initialized and function calls */ #include "stdlib.h" extern void *malloc(size_t); int *A, *B; void f() { A = B; } void g(int *C, int* D) { /*@ assert \initialized(&C); */ } int main(void) { int *x, *y; B = (int*) malloc(sizeof(int)); y = (int*) malloc(sizeof(int)); x = y; f(); /*@ assert \initialized(&A); */ /*@ assert \initialized(&x); */ g(x, y); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/ranges_in_builtins.c0000666000000000000000000000404413571573400023325 0ustar /* run.config COMMENT: ranges in a few builtins */ #include "stdlib.h" /*@ requires !\valid(s + (3..n+1000)); */ void f(char *s, long n){} /*@ requires \valid(ptr + (0 .. size - 1)); ensures ! \valid(ptr + (0 .. size + 1)); // In pure ACSL, the following predicate is true; // however at runtime, its evalulation results in UB ==> false. // ensures ! \valid(ptr + (0 .. SIZE_MAX*SIZE_MAX)); */ void g(long *ptr, size_t size) { } extern void *malloc(size_t p); extern void free(void* p); struct S { int a[2]; float *b; float *c;}; int main(void) { int *a; a = malloc(10*sizeof(int)); /*@ assert \valid(a + (0 .. 4)); */ ; int j = 2; /*@ assert \valid(a + (4 .. 8+j)); */ ; /*@ assert !\valid(a + (10 .. 11)); */ ; free(a); char *b; b = malloc(10*sizeof(char)); /*@ assert \valid(b + (0 .. 10)); */ ; /*@ assert !\valid(b + (11 .. 15)); */ ; long t[3] = {7l, 8l, 9l}; /*@ assert \valid(&t[0..2]); */ ; /*@ assert !\valid(&t[3..5]); */ ; g(t, 3); double t2[4]; t2[0] = 0.5; t2[1] = 1.5; /*@ assert \initialized(&t2[0..1]); */ ; /*@ assert !\initialized(&t2[2..3]); */ ; /*@ assert !\initialized(b + (0 .. 10));*/ free(b); int n = 2; float t3[7][2][4]; /*@ assert !\initialized(&t3[(n-1)..(n+2)][1][0..1]); */ ; /*@ assert !\valid_read(&t3[6][1][0] + (2..10)); */ /*@ assert \valid_read(&t3[(n-1)..(n+2)][1]); */ struct S s; s.a[0] = 7; s.a[1] = 8; /*@ assert \initialized(&s.a[0] + (1..2)); */ ; /*@ assert !\initialized(s.b + (0..1)); */ ; int **multi_dynamic; int size1 = 5, size2 = 9; multi_dynamic = malloc(size1 * sizeof(*multi_dynamic)); int i; for(i = 0; i < size1; i++) { multi_dynamic[i] = malloc(size2 * sizeof(*(multi_dynamic[i]))); } /*@ assert \valid(&multi_dynamic[4][1..7]); */ // single call to builtin /*@ assert \valid(&multi_dynamic[2..4][1..7]); */ // need to modify Mmodel // => not_yet for(i = i-1 ; i >= 0 ; i--) { free(multi_dynamic[i]); } free(multi_dynamic); char c = 'w'; f(&c, 5); }frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/sizeof.i0000666000000000000000000000024013571573400020746 0ustar /* run.config COMMENT: sizeof */ int main(void) { int x = 0; x++; /* prevent GCC's warning */ /*@ assert sizeof(int) == sizeof(x); */ ; return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/stdout.c0000666000000000000000000000033713571573400020772 0ustar /* run.config COMMENT: ensure that standard streams are properly tracked */ #include int main(void) { /*@assert \valid(stderr); */ /*@assert \valid(stdin); */ /*@assert \valid(stdout); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/valid.c0000666000000000000000000000157713571573400020556 0ustar /* run.config COMMENT: \valid */ #include "stdlib.h" int *X, Z; /*@ requires \valid(x); @ ensures \valid(\result); */ int *f(int *x) { int *y; /*@ assert ! \valid(y); */ y = x; /*@ assert \valid(x); */ return y; } void g(void) { int m, *u, **p; p=&u; u=&m; m=123; //@ assert \valid(*p); } int main(void) { int *a, *b, **c, ***d, n = 0; /*@ assert ! \valid(a) && ! \valid(b) && ! \valid(X); */ a = malloc(sizeof(int)); /*@ assert \valid(a) && ! \valid(b) && ! \valid(X); */ X = a; /*@ assert \valid(a) && ! \valid(b) && \valid(X); */ b = f(&n); /*@ assert \valid(a) && \valid(b) && \valid(X); */ X = b; /*@ assert \valid(a) && \valid(b) && \valid(X); */ c = &a; d = &c; /*@ assert \valid(*c); */ /*@ assert \valid(**d); */ free(a); /*@ assert ! \valid(a) && \valid(b) && \valid(X); */ /*@ assert \valid(&Z); */ g(); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/valid_alias.c0000666000000000000000000000053013571573400021713 0ustar /* run.config COMMENT: \valid in presence of aliasing */ #include "stdlib.h" int main(void) { int *a, *b, n = 0; /*@ assert ! \valid(a) && ! \valid(b); */ a = malloc(sizeof(int)); *a = n; b = a; /*@ assert \valid(a) && \valid(b); */ /*@ assert *b == n; */ free(b); /*@ assert ! \valid(a) && ! \valid(b); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/valid_in_contract.c0000666000000000000000000000100113571573400023117 0ustar /* run.config COMMENT: function contract involving \valid */ #include struct list { int element; struct list * next; }; /*@ @ behavior B1: @ assumes l == \null; @ ensures \result == l; @ behavior B2: @ assumes ! \valid(l) || ! \valid(l->next); @ ensures \result == l; */ struct list * f(struct list * l) { /* length = 0 */ if(l == NULL) return l; /* length = 1 : already sorted */ if(l->next == NULL) return l; return NULL; } int main() { f(NULL); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/memory/vector.c0000666000000000000000000000107313571573400020750 0ustar /* run.config COMMENT: function call + initialized */ #include int LAST; int* new_inversed(int len, int *v) { int i, *p; //@ assert \valid(v) && \offset(v)+len*sizeof(int) <= \block_length(v); p = malloc(sizeof(int)*len); for(i=0; i Datatype.Filepath.of_string s = file) (Kernel.Files.get ()) then super#global fmt g end end let () = Printer.update_printer (module Printer_extension) frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/0000777000000000000000000000000013571573400017411 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/builtin.i0000666000000000000000000000042513571573400021232 0ustar /* run.config_ci COMMENT: -e-acsl-builtins LOG: gen_builtin.c STDOPT: #"-e-acsl-builtins incr" */ int incr(int); /*@ ensures \result == incr(i); */ int f(int i) { int j = i + 1; return j; } int incr(int x) { return x + 1; } int main() { int i = f(2); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/e-acsl-functions.c0000666000000000000000000000106113571573400022725 0ustar /* run.config_ci COMMENT: test option -e-acsl-functions LOG: gen_@PTEST_NAME@.c STDOPT: #"-e-acsl-functions f" */ /*@ requires \initialized(p); @ requires *p == 0; @ ensures \result == \old(*p); */ int f(int *p) { /*@ loop invariant 0 <= i <= 1; */ for(int i = 0; i < 1; i++) ; return 0; } /*@ requires \initialized(p); @ requires *p == 1; @ ensures \result == \old(*p); */ int g(int *p) { /*@ loop invariant 0 <= i <= 1; */ for(int i = 0; i < 1; i++) ; return 0; } int main(void) { int x = 0; int y = 0; f(&x); g(&y); } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/e-acsl-instrument.c0000666000000000000000000000171513571573400023133 0ustar /* run.config_ci COMMENT: test option -e-acsl-instrument; cannot run Eva on this example LOG: gen_@PTEST_NAME@.c STDOPT:#"-e-acsl-instrument='@@all,-uninstrument1,-uninstrument2'" */ #include int uninstrument1(int *p) { *p = 0; return 0; } /*@ requires \valid(p); */ int uninstrument2(int *p) { { int *q = p; *p = 0; goto L; } L: return 0; } int instrument1(int *p) { *p = 0; return 0; } /*@ requires \valid(p); */ int instrument2(int *p) { { int *q = p; *p = 0; goto L; } L: return 0; } /* test combination of -e-acsl-instrument and -variadic-no-translation; see gitlab's issue #88 */ int vol(int n, ...) { va_list vl; va_start(vl, n); int r = va_arg(vl, int); va_end(vl); return 1; } int main(void) { int x; int y = 0; instrument1(&x); uninstrument1(&x); instrument2(&x); uninstrument2(&x); /*@ assert \initialized(&x); */ /*@ assert \initialized(&y); */ return vol(6, 1); } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/e-acsl-valid.c0000666000000000000000000000156313571573400022023 0ustar /* run.config_ci COMMENT: test option -e-acsl-no-valid DONTRUN: LOG: gen_@PTEST_NAME@.c STDOPT: #"-e-acsl-prepare -e-acsl-share ./share/e-acsl -eva -eva-verbose 0 -then -e-acsl-no-valid" */ #include /*@ requires \valid(y); @ requires *x >= 0; @ ensures *x == \old(*x)+1; @ assigns *x \from *x,x; @ behavior b1: @ assumes *x == 1; @ assigns \nothing; @ ensures *x < 0; @ behavior b2: @ assumes *x == 0; @ ensures *x == 1; @ complete behaviors; @ disjoint behaviors b1, b2; @ */ void f(int *x, int *y) { /*@ requires *x >= 0; @ ensures 2 >= 1; @ assigns *x; */ { (*x)++; } /*@ loop invariant 0 <= i <= 1; @ loop variant 2 - i; */ for(int i = 0; i < 1; i++) /*@ assert 1 == 1; */ /*@ assert \valid(y); */ ; } int main(void) { int x = 0; int *y = (int *)malloc(sizeof(int)); f(&x, y); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/oracle_ci/0000777000000000000000000000000013571573400021331 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/oracle_ci/builtin.res.oracle0000666000000000000000000000027513571573400024762 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/special/builtin.i:9: Warning: function __gen_e_acsl_f: postcondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/oracle_ci/e-acsl-functions.res.oracle0000666000000000000000000000030213571573400026455 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/special/e-acsl-functions.c:29: Warning: function g: precondition *p ≡ 1 got status invalid. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/oracle_ci/e-acsl-instrument.res.oracle0000666000000000000000000000142013571573400026657 0ustar [e-acsl] beginning translation. [kernel:annot:missing-spec] :0: Warning: Neither code nor specification for function __builtin_va_arg, generating default assigns from the prototype [kernel:annot:missing-spec] :0: Warning: Neither code nor specification for function __builtin_va_end, generating default assigns from the prototype [kernel:annot:missing-spec] :0: Warning: Neither code nor specification for function __builtin_va_start, generating default assigns from the prototype [e-acsl] tests/special/e-acsl-instrument.c:58: Warning: ignoring effect of variadic function vol [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/special/e-acsl-instrument.c:44: Warning: accessing uninitialized left-value. assert \initialized(&tmp); (tmp from vararg) frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/oracle_ci/e-acsl-valid.res.oracle0000666000000000000000000000611413571573400025553 0ustar [eva:alarm] tests/special/e-acsl-valid.c:36: Warning: function f: precondition \valid(y) got status unknown. [e-acsl] beginning translation. [kernel:annot:missing-spec] FRAMAC_SHARE/e-acsl/e_acsl.h:165: Warning: Neither code nor specification for function aligned_alloc, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/e-acsl/e_acsl.h:181: Warning: Neither code nor specification for function __e_acsl_mspaces_init, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/e-acsl/e_acsl.h:446: Warning: Neither code nor specification for function __e_acsl_builtin_printf, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/e-acsl/e_acsl.h:450: Warning: Neither code nor specification for function __e_acsl_builtin_fprintf, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/e-acsl/e_acsl.h:454: Warning: Neither code nor specification for function __e_acsl_builtin_dprintf, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/e-acsl/e_acsl.h:458: Warning: Neither code nor specification for function __e_acsl_builtin_sprintf, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/e-acsl/e_acsl.h:462: Warning: Neither code nor specification for function __e_acsl_builtin_snprintf, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/e-acsl/e_acsl.h:467: Warning: Neither code nor specification for function __e_acsl_builtin_syslog, generating default assigns from the prototype [kernel:annot:missing-spec] FRAMAC_SHARE/e-acsl/e_acsl.h:488: Warning: Neither code nor specification for function __e_acsl_floating_point_exception, generating default assigns from the prototype [kernel] Current source was: tests/special/e-acsl-valid.c:33 The full backtrace is: Raised at file "src/libraries/project/project.ml", line 405, characters 59-66 Called from file "src/main.ml", line 155, characters 14-1023 Called from file "src/main.ml", line 121, characters 12-34 Called from file "src/libraries/project/state_builder.ml", line 565, characters 17-22 Called from file "src/main.ml", line 258, characters 11-56 Called from file "queue.ml", line 121, characters 6-15 Called from file "src/kernel_internals/runtime/boot.ml", line 36, characters 4-20 Called from file "src/kernel_services/cmdline_parameters/cmdline.ml", line 792, characters 2-9 Called from file "src/kernel_services/cmdline_parameters/cmdline.ml", line 807, characters 30-76 Called from file "src/kernel_services/cmdline_parameters/cmdline.ml", line 229, characters 4-8 Unexpected error (E_ACSL.Misc.Unregistered_library_function("__e_acsl_store_block")). Please report as 'crash' at http://bts.frama-c.com/. Your Frama-C version is 19.0+dev (Potassium). Note that a version and a backtrace alone often do not contain enough information to understand the bug. Guidelines for reporting bugs are at: http://bts.frama-c.com/dokuwiki/doku.php?id=mantis:frama-c:bug_reporting_guidelines frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/oracle_ci/gen_builtin.c0000666000000000000000000000161413571573400023776 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; int incr(int x); /*@ ensures \result ≡ incr(\old(i)); */ int __gen_e_acsl_f(int i); int f(int i) { int j = i + 1; return j; } int incr(int x) { int __retres; __retres = x + 1; return __retres; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int i = __gen_e_acsl_f(2); __retres = 0; return __retres; } /*@ ensures \result ≡ incr(\old(i)); */ int __gen_e_acsl_f(int i) { int __gen_e_acsl_at; int __retres; __gen_e_acsl_at = i; __retres = f(i); { int __gen_e_acsl_incr_app; __gen_e_acsl_incr_app = incr(__gen_e_acsl_at); __e_acsl_assert(__retres == __gen_e_acsl_incr_app, (char *)"Postcondition",(char *)"f", (char *)"\\result == incr(\\old(i))",9); return __retres; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/oracle_ci/gen_e-acsl-functions.c0000666000000000000000000000522313571573400025502 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /*@ requires \initialized(p); requires *p ≡ 0; ensures \result ≡ \old(*p); */ int __gen_e_acsl_f(int *p); int f(int *p) { int __retres; __e_acsl_store_block((void *)(& p),(size_t)8); { int i = 0; { { int __gen_e_acsl_and; if (0 <= i) __gen_e_acsl_and = i <= 1; else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Invariant",(char *)"f", (char *)"0 <= i <= 1",11); } /*@ loop invariant 0 ≤ i ≤ 1; */ while (i < 1) { int __gen_e_acsl_and_2; i ++; if (0 <= i) __gen_e_acsl_and_2 = i <= 1; else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Invariant",(char *)"f", (char *)"0 <= i <= 1",11); } } } __retres = 0; __e_acsl_delete_block((void *)(& p)); return __retres; } /*@ requires \initialized(p); requires *p ≡ 1; ensures \result ≡ \old(*p); */ int g(int *p) { int __retres; { int i = 0; /*@ loop invariant 0 ≤ i ≤ 1; */ while (i < 1) i ++; } __retres = 0; return __retres; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; __e_acsl_store_block((void *)(& x),(size_t)4); __e_acsl_full_init((void *)(& x)); int y = 0; __gen_e_acsl_f(& x); g(& y); __retres = 0; __e_acsl_delete_block((void *)(& x)); __e_acsl_memory_clean(); return __retres; } /*@ requires \initialized(p); requires *p ≡ 0; ensures \result ≡ \old(*p); */ int __gen_e_acsl_f(int *p) { int __gen_e_acsl_at; int __retres; { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)p,sizeof(int), (void *)p,(void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(p)",9); __gen_e_acsl_at = *p; } { int __gen_e_acsl_initialized; __e_acsl_store_block((void *)(& p),(size_t)8); __gen_e_acsl_initialized = __e_acsl_initialized((void *)p,sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Precondition", (char *)"f",(char *)"\\initialized(p)",7); __e_acsl_assert(*p == 0,(char *)"Precondition",(char *)"f", (char *)"*p == 0",8); } __retres = f(p); __e_acsl_assert(__retres == __gen_e_acsl_at,(char *)"Postcondition", (char *)"f",(char *)"\\result == \\old(*p)",9); __e_acsl_delete_block((void *)(& p)); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/oracle_ci/gen_e-acsl-instrument.c0000666000000000000000000000766213571573400025713 0ustar /* Generated by Frama-C */ #include "stdarg.h" #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /* compiler builtin: void __builtin_va_arg(__builtin_va_list, unsigned long, void *); */ /* compiler builtin: void __builtin_va_end(__builtin_va_list); */ /* compiler builtin: void __builtin_va_start(__builtin_va_list); */ int __gen_e_acsl_uninstrument1(int *p); int uninstrument1(int *p) { int __retres; *p = 0; __retres = 0; return __retres; } /*@ requires \valid(p); */ int __gen_e_acsl_uninstrument2(int *p); int uninstrument2(int *p) { int __retres; { int *q = p; *p = 0; goto L; } L: __retres = 0; return __retres; } int instrument1(int *p) { int __retres; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_initialize((void *)p,sizeof(int)); *p = 0; __retres = 0; __e_acsl_delete_block((void *)(& p)); return __retres; } /*@ requires \valid(p); */ int __gen_e_acsl_instrument2(int *p); int instrument2(int *p) { int __retres; __e_acsl_store_block((void *)(& p),(size_t)8); { int *q = p; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); __e_acsl_initialize((void *)p,sizeof(int)); *p = 0; __e_acsl_delete_block((void *)(& q)); goto L; __e_acsl_delete_block((void *)(& q)); } L: __retres = 0; __e_acsl_delete_block((void *)(& p)); return __retres; } int vol(int n , ...) { int __retres; va_list vl; int tmp; __builtin_va_start(vl,n); tmp = __builtin_va_arg (vl, int); /*@ assert Eva: initialization: \initialized(&tmp); */ int r = tmp; __builtin_va_end(vl); __retres = 1; return __retres; } int main(void) { int x; int tmp; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& x),(size_t)4); int y = 0; __e_acsl_store_block((void *)(& y),(size_t)4); __e_acsl_full_init((void *)(& y)); instrument1(& x); __gen_e_acsl_uninstrument1(& x); __gen_e_acsl_instrument2(& x); __gen_e_acsl_uninstrument2(& x); /*@ assert \initialized(&x); */ { int __gen_e_acsl_initialized; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& x), sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&x)",56); } /*@ assert \initialized(&y); */ { int __gen_e_acsl_initialized_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& y), sizeof(int)); __e_acsl_assert(__gen_e_acsl_initialized_2,(char *)"Assertion", (char *)"main",(char *)"\\initialized(&y)",57); } tmp = vol(6,1); __e_acsl_delete_block((void *)(& y)); __e_acsl_delete_block((void *)(& x)); __e_acsl_memory_clean(); return tmp; } /*@ requires \valid(p); */ int __gen_e_acsl_instrument2(int *p) { int __retres; { int __gen_e_acsl_valid; __e_acsl_store_block((void *)(& p),(size_t)8); __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Precondition", (char *)"instrument2",(char *)"\\valid(p)",29); } __retres = instrument2(p); __e_acsl_delete_block((void *)(& p)); return __retres; } /*@ requires \valid(p); */ int __gen_e_acsl_uninstrument2(int *p) { int __retres; { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Precondition", (char *)"uninstrument2",(char *)"\\valid(p)",14); } __e_acsl_sound_verdict = 0; __retres = uninstrument2(p); return __retres; } int __gen_e_acsl_uninstrument1(int *p) { int __retres; __e_acsl_sound_verdict = 0; __retres = uninstrument1(p); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/special/oracle_ci/gen_e-acsl-valid.c0000666000000000000000000001617713571573400024603 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" extern int __e_acsl_sound_verdict; /*@ requires \valid(y); requires *x ≥ 0; ensures *\old(x) ≡ \old(*x) + 1; assigns *x; assigns *x \from *x, x; behavior b1: assumes *x ≡ 1; ensures *\old(x) < 0; assigns \nothing; behavior b2: assumes *x ≡ 0; ensures *\old(x) ≡ 1; complete behaviors b2, b1; disjoint behaviors b1, b2; */ void __gen_e_acsl_f(int *x, int *y); void f(int *x, int *y) { /*@ requires *x ≥ 0; ensures 2 ≥ 1; assigns *x; */ { { int __gen_e_acsl_valid_read; __e_acsl_store_block((void *)(& y),(size_t)8); __e_acsl_store_block((void *)(& x),(size_t)8); __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)x,sizeof(int), (void *)x,(void *)(& x)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(x)",27); __e_acsl_assert(*x >= 0,(char *)"Precondition",(char *)"f", (char *)"*x >= 0",27); } __e_acsl_initialize((void *)x,sizeof(int)); (*x) ++; __e_acsl_assert(1,(char *)"Postcondition",(char *)"f",(char *)"2 >= 1", 28); } { int i = 0; /*@ loop variant 2 - i; */ { { int __gen_e_acsl_and; if (0 <= i) __gen_e_acsl_and = i <= 1; else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Invariant",(char *)"f", (char *)"0 <= i <= 1",31); } /*@ loop invariant 0 ≤ i ≤ 1; */ while (i < 1) { /*@ assert 1 ≡ 1; */ __e_acsl_assert(1,(char *)"Assertion",(char *)"f",(char *)"1 == 1", 33); /*@ assert \valid(y); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)y,sizeof(int), (void *)y,(void *)(& y)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"f", (char *)"\\valid(y)",33); } { int __gen_e_acsl_and_2; i ++; if (0 <= i) __gen_e_acsl_and_2 = i <= 1; else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Invariant",(char *)"f", (char *)"0 <= i <= 1",31); } } } } __e_acsl_delete_block((void *)(& y)); __e_acsl_delete_block((void *)(& x)); return; } int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int x = 0; __e_acsl_store_block((void *)(& x),(size_t)4); __e_acsl_full_init((void *)(& x)); int *y = malloc(sizeof(int)); __e_acsl_store_block((void *)(& y),(size_t)8); __e_acsl_full_init((void *)(& y)); __gen_e_acsl_f(& x,y); __retres = 0; __e_acsl_delete_block((void *)(& y)); __e_acsl_delete_block((void *)(& x)); __e_acsl_memory_clean(); return __retres; } /*@ requires \valid(y); requires *x ≥ 0; ensures *\old(x) ≡ \old(*x) + 1; assigns *x; assigns *x \from *x, x; behavior b1: assumes *x ≡ 1; ensures *\old(x) < 0; assigns \nothing; behavior b2: assumes *x ≡ 0; ensures *\old(x) ≡ 1; complete behaviors b2, b1; disjoint behaviors b1, b2; */ void __gen_e_acsl_f(int *x, int *y) { long __gen_e_acsl_at_6; int *__gen_e_acsl_at_5; int *__gen_e_acsl_at_4; int __gen_e_acsl_at_3; int *__gen_e_acsl_at_2; int __gen_e_acsl_at; { int __gen_e_acsl_valid_read_5; __gen_e_acsl_valid_read_5 = __e_acsl_valid_read((void *)x,sizeof(int), (void *)x,(void *)(& x)); __e_acsl_assert(__gen_e_acsl_valid_read_5,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(x)",14); __gen_e_acsl_at_6 = (long)*x; } __gen_e_acsl_at_5 = x; __gen_e_acsl_at_4 = x; { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)x,sizeof(int), (void *)x,(void *)(& x)); __e_acsl_assert(__gen_e_acsl_valid_read_3,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(x)",21); __gen_e_acsl_at_3 = *x == 0; } __gen_e_acsl_at_2 = x; { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)x,sizeof(int), (void *)x,(void *)(& x)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(x)",17); __gen_e_acsl_at = *x == 1; } { int __gen_e_acsl_valid; __e_acsl_store_block((void *)(& y),(size_t)8); __e_acsl_store_block((void *)(& x),(size_t)8); __gen_e_acsl_valid = __e_acsl_valid((void *)y,sizeof(int),(void *)y, (void *)(& y)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Precondition",(char *)"f", (char *)"\\valid(y)",12); __e_acsl_assert(*x >= 0,(char *)"Precondition",(char *)"f", (char *)"*x >= 0",13); } f(x,y); { int __gen_e_acsl_implies; int __gen_e_acsl_implies_2; if (! __gen_e_acsl_at) __gen_e_acsl_implies = 1; else { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)__gen_e_acsl_at_2, sizeof(int), (void *)__gen_e_acsl_at_2, (void *)(& __gen_e_acsl_at_2)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(__gen_e_acsl_at_2)", 19); __gen_e_acsl_implies = *__gen_e_acsl_at_2 < 0; } __e_acsl_assert(__gen_e_acsl_implies,(char *)"Postcondition",(char *)"f", (char *)"\\old(*x == 1) ==> *\\old(x) < 0",19); if (! __gen_e_acsl_at_3) __gen_e_acsl_implies_2 = 1; else { int __gen_e_acsl_valid_read_4; __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)__gen_e_acsl_at_4, sizeof(int), (void *)__gen_e_acsl_at_4, (void *)(& __gen_e_acsl_at_4)); __e_acsl_assert(__gen_e_acsl_valid_read_4,(char *)"RTE",(char *)"f", (char *)"mem_access: \\valid_read(__gen_e_acsl_at_4)", 22); __gen_e_acsl_implies_2 = *__gen_e_acsl_at_4 == 1; } __e_acsl_assert(__gen_e_acsl_implies_2,(char *)"Postcondition", (char *)"f",(char *)"\\old(*x == 0) ==> *\\old(x) == 1", 22); __e_acsl_assert((long)*__gen_e_acsl_at_5 == __gen_e_acsl_at_6 + 1L, (char *)"Postcondition",(char *)"f", (char *)"*\\old(x) == \\old(*x) + 1",14); __e_acsl_delete_block((void *)(& y)); __e_acsl_delete_block((void *)(& x)); return; } } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/0000777000000000000000000000000013571573400017614 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/0000777000000000000000000000000013571573400021534 5ustar frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_addr-by-val.c0000666000000000000000000000221513571573400025156 0ustar /* Generated by Frama-C */ #include "stdint.h" #include "stdio.h" #include "stdlib.h" int main(int argc, char **argv) { int __retres; char *p; int *q; __e_acsl_memory_init(& argc,& argv,(size_t)8); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); uintptr_t addr = (unsigned long)(& argc); __e_acsl_store_block((void *)(& addr),(size_t)8); __e_acsl_full_init((void *)(& addr)); __e_acsl_temporal_store_nblock((void *)(& q),(void *)(& argc)); __e_acsl_full_init((void *)(& q)); q = & argc; __e_acsl_temporal_store_nblock((void *)(& p),(void *)((char *)addr)); __e_acsl_full_init((void *)(& p)); p = (char *)addr; __e_acsl_temporal_store_nblock((void *)(& p),(void *)0x123456); __e_acsl_full_init((void *)(& p)); p = (char *)0x123456; __e_acsl_temporal_store_nreferent((void *)(& p),(void *)(& q)); __e_acsl_full_init((void *)(& p)); p = (char *)q; __retres = 0; __e_acsl_delete_block((void *)(& argc)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& addr)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_args.c0000666000000000000000000000412313571573400024010 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); /*@ assert \valid(&argc); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(& argc),sizeof(int), (void *)(& argc),(void *)0); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"\\valid(&argc)",8); } /*@ assert \valid(argv); */ { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)argv,sizeof(char const *), (void *)argv,(void *)(& argv)); __e_acsl_assert(__gen_e_acsl_valid_2,(char *)"Assertion",(char *)"main", (char *)"\\valid(argv)",9); } /*@ assert \valid(*argv); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)argv, sizeof(char const *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; int __gen_e_acsl_valid_3; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)argv, sizeof(char const *), (void *)argv, (void *)(& argv)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(argv)",10); __gen_e_acsl_valid_3 = __e_acsl_valid((void *)*argv,sizeof(char const), (void *)*argv,(void *)argv); __gen_e_acsl_and = __gen_e_acsl_valid_3; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(*argv)",10); } __retres = 0; __e_acsl_delete_block((void *)(& argv)); __e_acsl_delete_block((void *)(& argc)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_array.c0000666000000000000000000000566113571573400024202 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; int *src[3]; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(src),(size_t)24); int a = 111; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); int b = 222; __e_acsl_store_block((void *)(& b),(size_t)4); __e_acsl_full_init((void *)(& b)); __e_acsl_temporal_store_nblock((void *)(src),(void *)(& a)); __e_acsl_initialize((void *)(src),sizeof(int *)); src[0] = & a; __e_acsl_temporal_store_nblock((void *)(& src[1]),(void *)(& b)); __e_acsl_initialize((void *)(& src[1]),sizeof(int *)); src[1] = & b; /*@ assert \valid(src[0]); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(src), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)src[0],sizeof(int), (void *)src[0],(void *)(src)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(src[0])",13); } /*@ assert \valid(src[1]); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& src[1]), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)src[1],sizeof(int), (void *)src[1], (void *)(& src[1])); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"\\valid(src[1])",14); } /*@ assert ¬\valid(src[2]); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& src[2]), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)src[2],sizeof(int), (void *)src[2], (void *)(& src[2])); __gen_e_acsl_and_3 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(! __gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"!\\valid(src[2])",15); } __retres = 0; __e_acsl_delete_block((void *)(src)); __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_char.c0000666000000000000000000000456513571573400024003 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); char a __attribute__((__aligned__(4))) = (char)'1'; __e_acsl_store_block((void *)(& a),(size_t)1); __e_acsl_full_init((void *)(& a)); char b __attribute__((__aligned__(4))) = (char)'2'; __e_acsl_store_block((void *)(& b),(size_t)1); __e_acsl_full_init((void *)(& b)); char *p = & a; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)(& a)); char *q = & b; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); __e_acsl_temporal_store_nblock((void *)(& q),(void *)(& b)); __e_acsl_temporal_store_nreferent((void *)(& p),(void *)(& q)); __e_acsl_full_init((void *)(& p)); p = q; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(char),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",17); } /*@ assert \valid(q); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(char),(void *)q, (void *)(& q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"\\valid(q)",18); } __retres = 0; __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_darray.c0000666000000000000000000001122513571573400024337 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" void area_triangle(double (*vertices)[4]) { /*@ assert rte: mem_access: \valid_read((double *)*(vertices + 0)); */ { int __gen_e_acsl_valid_read; __e_acsl_store_block((void *)(& vertices),(size_t)8); __e_acsl_temporal_pull_parameter((void *)(& vertices),0U,8UL); __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(*(vertices + 0)), sizeof(double), (void *)(*(vertices + 0)), (void *)(*(vertices + 0))); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"Assertion", (char *)"area_triangle", (char *)"rte: mem_access: \\valid_read((double *)*(vertices + 0))", 6); } /*@ assert rte: mem_access: \valid_read((double *)*(vertices + 1)); */ { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(*(vertices + 1)), sizeof(double), (void *)(*(vertices + 1)), (void *)(*(vertices + 1))); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"Assertion", (char *)"area_triangle", (char *)"rte: mem_access: \\valid_read((double *)*(vertices + 1))", 7); } __e_acsl_delete_block((void *)(& vertices)); return; } void abe_matrix(double (*vertices)[4]) { __e_acsl_store_block((void *)(& vertices),(size_t)8); __e_acsl_temporal_pull_parameter((void *)(& vertices),0U,8UL); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& vertices),0U); area_triangle(vertices); __e_acsl_delete_block((void *)(& vertices)); return; } double Vertices[3][4]; double Vertices2[3][4] = {}; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(Vertices2),(size_t)96); __e_acsl_full_init((void *)(& Vertices2)); __e_acsl_store_block((void *)(Vertices),(size_t)96); __e_acsl_full_init((void *)(& Vertices)); } return; } int main(int argc, char const **argv) { int __retres; double vertices2[3][4]; double vertices3[3][4]; double triple_vertices[2][3][4]; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(triple_vertices),(size_t)192); __e_acsl_store_block((void *)(vertices3),(size_t)96); __e_acsl_store_block((void *)(vertices2),(size_t)96); double vertices[3][4] = {{1.0, 2.0, 3.0, 4.0}, {5.0, 6.0, 7.0, 8.0}, {9.0, 10.0, 11.0, 12.0}}; __e_acsl_store_block((void *)(vertices),(size_t)96); __e_acsl_full_init((void *)(& vertices)); double triple_vertices2[2][3][4] = {}; __e_acsl_store_block((void *)(triple_vertices2),(size_t)192); __e_acsl_full_init((void *)(& triple_vertices2)); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(vertices),0U); abe_matrix(vertices); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(vertices2),0U); abe_matrix(vertices2); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(vertices3),0U); abe_matrix(vertices3); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(Vertices),0U); abe_matrix(Vertices); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(Vertices2),0U); abe_matrix(Vertices2); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(triple_vertices[0]),0U); abe_matrix(triple_vertices[0]); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(triple_vertices2[0]),0U); abe_matrix(triple_vertices2[0]); __retres = 0; __e_acsl_delete_block((void *)(Vertices2)); __e_acsl_delete_block((void *)(Vertices)); __e_acsl_delete_block((void *)(triple_vertices2)); __e_acsl_delete_block((void *)(triple_vertices)); __e_acsl_delete_block((void *)(vertices3)); __e_acsl_delete_block((void *)(vertices2)); __e_acsl_delete_block((void *)(vertices)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_dpointer.c0000666000000000000000000001000113571573400024670 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); int **p = malloc(sizeof(int *) * (unsigned long)3); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p)); int i = 0; while (i < 3) { /*@ assert \valid(p + i); */ { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)(p + i),sizeof(int *), (void *)p,(void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid,(char *)"Assertion",(char *)"main", (char *)"\\valid(p + i)",12); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_initialize((void *)(p + i),sizeof(int *)); *(p + i) = (int *)malloc(sizeof(int)); /*@ assert Eva: initialization: \initialized(p + i); */ __e_acsl_temporal_store_nblock((void *)(p + i),(void *)*(p + i)); /*@ assert \valid(*(p + i)); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(p + i), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; int __gen_e_acsl_valid_2; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(p + i), sizeof(int *), (void *)p, (void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p + i)",14); /*@ assert Eva: initialization: \initialized(p + i); */ __gen_e_acsl_valid_2 = __e_acsl_valid((void *)*(p + i),sizeof(int), (void *)*(p + i), (void *)(p + i)); __gen_e_acsl_and = __gen_e_acsl_valid_2; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(*(p + i))",14); } i ++; } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(p + 2),0U); /*@ assert Eva: initialization: \initialized(p + 2); */ free((void *)*(p + 2)); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); malloc(sizeof(int)); /*@ assert ¬\valid(*(p + 2)); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(p + 2), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_read_2; int __gen_e_acsl_valid_3; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(p + 2), sizeof(int *), (void *)p, (void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p + 2)",20); /*@ assert Eva: dangling_pointer: ¬\dangling(p + 2); */ __gen_e_acsl_valid_3 = __e_acsl_valid((void *)*(p + 2),sizeof(int), (void *)*(p + 2),(void *)( p + 2)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"!\\valid(*(p + 2))",20); } __retres = 0; __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_fptr.c0000666000000000000000000000427313571573400024035 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int *foo(int *p) { int *q = p; return q; } void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __e_acsl_store_block((void *)(& foo),(size_t)1); __e_acsl_full_init((void *)(& foo)); } return; } int main(int argc, char const **argv) { int __retres; int *q; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& q),(size_t)8); int *p = & argc; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)(& argc)); int *(*fp)(int *) = & foo; __e_acsl_store_block((void *)(& fp),(size_t)8); __e_acsl_full_init((void *)(& fp)); __e_acsl_temporal_store_nblock((void *)(& fp),(void *)(& foo)); __e_acsl_temporal_store_nblock((void *)(& fp),(void *)(& foo)); __e_acsl_full_init((void *)(& fp)); fp = & foo; /*@ assert \valid_function(fp); */ ; __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& p),0U); __e_acsl_full_init((void *)(& q)); q = (*fp)(p); __e_acsl_temporal_store_nblock((void *)(& q),(void *)*(& q)); /*@ assert \valid(q); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(q)",20); } __retres = 0; __e_acsl_delete_block((void *)(& argc)); __e_acsl_delete_block((void *)(& foo)); __e_acsl_delete_block((void *)(& fp)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_fun_lib.c0000666000000000000000000001360013571573400024472 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" /*@ assigns \result, *(x_0 + (0 ..)), *(x_1 + (0 ..)); assigns \result \from *(x_0 + (0 ..)), *(x_1 + (0 ..)); assigns *(x_0 + (0 ..)) \from *(x_0 + (0 ..)), *(x_1 + (0 ..)); assigns *(x_1 + (0 ..)) \from *(x_0 + (0 ..)), *(x_1 + (0 ..)); */ extern int ( /* missing proto */ realpath)(char *x_0, char *x_1); int main(void) { int __retres; int tmp_0; int tmp_1; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& tmp_1),(size_t)4); __e_acsl_store_block((void *)(& tmp_0),(size_t)4); char *c = (char *)"."; __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); char *p = malloc((unsigned long)256); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p)); char *q = (char *)0; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); __e_acsl_temporal_store_nblock((void *)(& q),(void *)0); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_full_init((void *)(& q)); q = (char *)malloc((unsigned long)256); __e_acsl_temporal_store_nblock((void *)(& q),(void *)*(& q)); /*@ assert \valid(q) ∧ \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; int __gen_e_acsl_and_3; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& q), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)q,sizeof(char),(void *)q, (void *)(& q)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; if (__gen_e_acsl_and) { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& p), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)p,sizeof(char), (void *)p,(void *)(& p)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __gen_e_acsl_and_3 = __gen_e_acsl_and_2; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid(q) && \\valid(p)",16); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& q),1U); __e_acsl_full_init((void *)(& tmp_0)); tmp_0 = realpath(c,q); char *path = (char *)tmp_0; __e_acsl_store_block((void *)(& path),(size_t)8); __e_acsl_full_init((void *)(& path)); __e_acsl_temporal_store_nblock((void *)(& path),(void *)((char *)tmp_0)); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& q),1U); __e_acsl_full_init((void *)(& tmp_1)); tmp_1 = realpath(c,q); __e_acsl_temporal_store_nblock((void *)(& path),(void *)((char *)tmp_1)); __e_acsl_full_init((void *)(& path)); path = (char *)tmp_1; /*@ assert \valid(path); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& path), sizeof(char *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)path,sizeof(char), (void *)path,(void *)(& path)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(__gen_e_acsl_and_4,(char *)"Assertion",(char *)"main", (char *)"\\valid(path)",23); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& p),0U); free((void *)p); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& path),0U); free((void *)path); /*@ assert ¬\valid(p) ∧ ¬\valid(path); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_5; int __gen_e_acsl_and_7; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& p), sizeof(char *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)p,sizeof(char),(void *)p, (void *)(& p)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_5 = 0; if (! __gen_e_acsl_and_5) { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& path), sizeof(char *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)path,sizeof(char), (void *)path,(void *)(& path)); __gen_e_acsl_and_6 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_6 = 0; __gen_e_acsl_and_7 = ! __gen_e_acsl_and_6; } else __gen_e_acsl_and_7 = 0; __e_acsl_assert(__gen_e_acsl_and_7,(char *)"Assertion",(char *)"main", (char *)"!\\valid(p) && !\\valid(path)",30); } __retres = 0; __e_acsl_delete_block((void *)(& tmp_1)); __e_acsl_delete_block((void *)(& tmp_0)); __e_acsl_delete_block((void *)(& path)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_fun_ptr.c0000666000000000000000000000406713571573400024540 0ustar /* Generated by Frama-C */ #include "stdint.h" #include "stdio.h" #include "stdlib.h" int *pfun(char c, int *p, int *p2, int *p3, int *p4, int i) { __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_temporal_pull_parameter((void *)(& p),1U,8UL); int *q = p; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); __e_acsl_temporal_store_nreferent((void *)(& q),(void *)(& p)); __e_acsl_temporal_save_return((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& q)); return q; } int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); int a = 1; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); int *p = & a; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)(& a)); uintptr_t addr = (unsigned long)(& addr); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& p),1U); __e_acsl_temporal_save_nblock_parameter((void *)(& a),2U); __e_acsl_full_init((void *)(& p)); p = pfun((char)'a',p,& a,(int *)0,(int *)addr,2); __e_acsl_temporal_pull_return((void *)(& p)); /*@ assert \valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",28); } __retres = 0; __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_getenv.c0000666000000000000000000000714213571573400024350 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string; extern int __e_acsl_sound_verdict; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string_2 = "PATH"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2, sizeof("PATH")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string = "HOME"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("HOME")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); } return; } int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); char *g1 = (char *)0; __e_acsl_store_block((void *)(& g1),(size_t)8); __e_acsl_full_init((void *)(& g1)); __e_acsl_temporal_store_nblock((void *)(& g1),(void *)0); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_full_init((void *)(& g1)); g1 = __gen_e_acsl_getenv(__gen_e_acsl_literal_string); __e_acsl_temporal_pull_return((void *)(& g1)); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); char *g2 = __gen_e_acsl_getenv(__gen_e_acsl_literal_string_2); __e_acsl_store_block((void *)(& g2),(size_t)8); __e_acsl_full_init((void *)(& g2)); __e_acsl_temporal_pull_return((void *)(& g2)); /*@ assert g1 ≡ \null ∨ \valid(g1); */ { int __gen_e_acsl_or; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)g1, (void *)0); */ if (g1 == (char *)0) __gen_e_acsl_or = 1; else { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& g1), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)g1,sizeof(char), (void *)g1,(void *)(& g1)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __gen_e_acsl_or = __gen_e_acsl_and; } __e_acsl_assert(__gen_e_acsl_or,(char *)"Assertion",(char *)"main", (char *)"g1 == \\null || \\valid(g1)",13); } /*@ assert g2 ≡ \null ∨ \valid(g2); */ { int __gen_e_acsl_or_2; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)g2, (void *)0); */ if (g2 == (char *)0) __gen_e_acsl_or_2 = 1; else { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& g2), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)g2,sizeof(char), (void *)g2,(void *)(& g2)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __gen_e_acsl_or_2 = __gen_e_acsl_and_2; } __e_acsl_assert(__gen_e_acsl_or_2,(char *)"Assertion",(char *)"main", (char *)"g2 == \\null || \\valid(g2)",14); } __retres = 0; __e_acsl_delete_block((void *)(& g2)); __e_acsl_delete_block((void *)(& g1)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_global_init.c0000666000000000000000000002147313571573400025346 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string_4; char *__gen_e_acsl_literal_string_3; struct tree_desc { int *extra_bits ; }; typedef struct tree_desc tree_desc; struct tree_desc2 { struct tree_desc desc ; }; typedef struct tree_desc2 tree_desc2; static int extra_lbits[1] = {0}; static tree_desc l_desc = {.extra_bits = extra_lbits}; static tree_desc descs[2] = {{.extra_bits = extra_lbits}, {.extra_bits = extra_lbits}}; static tree_desc2 l_desc2 = {.desc = {.extra_bits = extra_lbits}}; static tree_desc2 descs2[2] = {{.desc = {.extra_bits = extra_lbits}}, {.desc = {.extra_bits = extra_lbits}}}; void build_tree(tree_desc *desc) { int *extra; __e_acsl_store_block((void *)(& extra),(size_t)8); __e_acsl_store_block((void *)(& desc),(size_t)8); __e_acsl_temporal_pull_parameter((void *)(& desc),0U,8UL); __e_acsl_temporal_store_nreferent((void *)(& extra), (void *)(& desc->extra_bits)); __e_acsl_full_init((void *)(& extra)); extra = desc->extra_bits; /*@ assert \valid(extra); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& extra), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)extra,sizeof(int), (void *)extra,(void *)(& extra)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion", (char *)"build_tree",(char *)"\\valid(extra)",39); } __e_acsl_delete_block((void *)(& desc)); __e_acsl_delete_block((void *)(& extra)); return; } char const *strings[2][2] = {{"the", "tha"}, {"thi", "tho"}}; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "tho"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("tho")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_2 = "thi"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2,sizeof("thi")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string_4 = "the"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_4,sizeof("the")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_4); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_4); __gen_e_acsl_literal_string_3 = "tha"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3,sizeof("tha")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3); __e_acsl_store_block((void *)(descs2),(size_t)16); __e_acsl_full_init((void *)(& descs2)); __e_acsl_store_block((void *)(& l_desc2),(size_t)8); __e_acsl_full_init((void *)(& l_desc2)); __e_acsl_store_block((void *)(descs),(size_t)16); __e_acsl_full_init((void *)(& descs)); __e_acsl_store_block((void *)(& l_desc),(size_t)8); __e_acsl_full_init((void *)(& l_desc)); __e_acsl_store_block((void *)(extra_lbits),(size_t)4); __e_acsl_full_init((void *)(& extra_lbits)); __e_acsl_store_block((void *)(strings),(size_t)32); __e_acsl_full_init((void *)(& strings)); __e_acsl_temporal_store_nblock((void *)(& descs2[0].desc.extra_bits), (void *)(extra_lbits)); __e_acsl_temporal_store_nblock((void *)(& descs2[1].desc.extra_bits), (void *)(extra_lbits)); __e_acsl_temporal_store_nblock((void *)(& l_desc2.desc.extra_bits), (void *)(extra_lbits)); __e_acsl_temporal_store_nblock((void *)(& descs[0].extra_bits), (void *)(extra_lbits)); __e_acsl_temporal_store_nblock((void *)(& descs[1].extra_bits), (void *)(extra_lbits)); __e_acsl_temporal_store_nblock((void *)(& l_desc.extra_bits), (void *)(extra_lbits)); __e_acsl_temporal_store_nblock((void *)(& strings[0][0]), (void *)__gen_e_acsl_literal_string_4); __e_acsl_temporal_store_nblock((void *)(& strings[0][1]), (void *)__gen_e_acsl_literal_string_3); __e_acsl_temporal_store_nblock((void *)(& strings[1][0]), (void *)__gen_e_acsl_literal_string_2); __e_acsl_temporal_store_nblock((void *)(& strings[1][1]), (void *)__gen_e_acsl_literal_string); } return; } int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& l_desc),0U); build_tree(& l_desc); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(descs),0U); build_tree(descs); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& descs[1]),0U); build_tree(& descs[1]); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& l_desc2.desc),0U); build_tree(& l_desc2.desc); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& descs2[0].desc),0U); build_tree(& descs2[0].desc); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& descs2[1].desc),0U); build_tree(& descs2[1].desc); char **p = (char **)(strings); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)(strings)); /*@ assert \valid_read(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(char **)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)p,sizeof(char *), (void *)p,(void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid_read; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(p)",57); } /*@ assert \valid_read(*p); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)p, sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_2; int __gen_e_acsl_valid_read_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& p), sizeof(char **)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)p, sizeof(char *), (void *)p, (void *)(& p)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_read_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p)",58); __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)*p, sizeof(char), (void *)*p,(void *)p); __gen_e_acsl_and_3 = __gen_e_acsl_valid_read_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(*p)",58); } __retres = 0; __e_acsl_delete_block((void *)(descs2)); __e_acsl_delete_block((void *)(& l_desc2)); __e_acsl_delete_block((void *)(descs)); __e_acsl_delete_block((void *)(& l_desc)); __e_acsl_delete_block((void *)(extra_lbits)); __e_acsl_delete_block((void *)(strings)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_labels.c0000666000000000000000000000726413571573400024327 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" void foo(int *a, int *b) { __e_acsl_store_block((void *)(& b),(size_t)8); __e_acsl_store_block((void *)(& a),(size_t)8); __e_acsl_temporal_pull_parameter((void *)(& a),0U,8UL); __e_acsl_temporal_pull_parameter((void *)(& b),1U,8UL); int t = *a; __e_acsl_initialize((void *)a,sizeof(int)); *a = *b; __e_acsl_initialize((void *)b,sizeof(int)); *b = t; __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); return; } int *Q; int *bar(void) { RET: ; return Q; } int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); int a = 11; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); int b = 12; __e_acsl_store_block((void *)(& b),(size_t)4); __e_acsl_full_init((void *)(& b)); int *p = & a; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)(& a)); int *q = & b; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); __e_acsl_temporal_store_nblock((void *)(& q),(void *)(& b)); LAB: __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& p),0U); __e_acsl_temporal_save_nreferent_parameter((void *)(& q),1U); foo(p,q); /*@ assert \valid(p) ∧ \valid(q); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; int __gen_e_acsl_and_3; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; if (__gen_e_acsl_and) { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(int), (void *)q,(void *)(& q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __gen_e_acsl_and_3 = __gen_e_acsl_and_2; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid(p) && \\valid(q)",28); } LAB2: __e_acsl_temporal_store_nreferent((void *)(& q),(void *)(& p)); __e_acsl_full_init((void *)(& q)); q = p; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(__gen_e_acsl_and_4,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",32); } __retres = 0; __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_lit_string.c0000666000000000000000000001702613571573400025240 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string_2 = "g"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2,sizeof("g")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string = "f"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("f")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); } return; } int main(void) { int __retres; char *g; char *q; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_store_block((void *)(& g),(size_t)8); char *f = (char *)__gen_e_acsl_literal_string; __e_acsl_store_block((void *)(& f),(size_t)8); __e_acsl_full_init((void *)(& f)); __e_acsl_temporal_store_nblock((void *)(& f), (void *)__gen_e_acsl_literal_string); /*@ assert \valid_read(f) ∧ ¬\valid(f); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; int __gen_e_acsl_and_3; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& f), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)f,sizeof(char), (void *)f,(void *)(& f)); __gen_e_acsl_and = __gen_e_acsl_valid_read; } else __gen_e_acsl_and = 0; if (__gen_e_acsl_and) { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& f), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)f,sizeof(char),(void *)f, (void *)(& f)); __gen_e_acsl_and_2 = __gen_e_acsl_valid; } else __gen_e_acsl_and_2 = 0; __gen_e_acsl_and_3 = ! __gen_e_acsl_and_2; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(f) && !\\valid(f)",9); } __e_acsl_temporal_store_nblock((void *)(& g), (void *)__gen_e_acsl_literal_string_2); __e_acsl_full_init((void *)(& g)); g = (char *)__gen_e_acsl_literal_string_2; /*@ assert \valid_read(g) ∧ ¬\valid(g); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_4; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& g), sizeof(char *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)g,sizeof(char), (void *)g, (void *)(& g)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_read_2; } else __gen_e_acsl_and_4 = 0; if (__gen_e_acsl_and_4) { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& g), sizeof(char *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)g,sizeof(char), (void *)g,(void *)(& g)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_5 = 0; __gen_e_acsl_and_6 = ! __gen_e_acsl_and_5; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(__gen_e_acsl_and_6,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(g) && !\\valid(g)",12); } char *p = f; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nreferent((void *)(& p),(void *)(& f)); /*@ assert \valid_read(p) ∧ ¬\valid(p); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_7; int __gen_e_acsl_and_9; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& p), sizeof(char *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)p,sizeof(char), (void *)p, (void *)(& p)); __gen_e_acsl_and_7 = __gen_e_acsl_valid_read_3; } else __gen_e_acsl_and_7 = 0; if (__gen_e_acsl_and_7) { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_8; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& p), sizeof(char *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)p,sizeof(char), (void *)p,(void *)(& p)); __gen_e_acsl_and_8 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_8 = 0; __gen_e_acsl_and_9 = ! __gen_e_acsl_and_8; } else __gen_e_acsl_and_9 = 0; __e_acsl_assert(__gen_e_acsl_and_9,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(p) && !\\valid(p)",15); } __e_acsl_temporal_store_nreferent((void *)(& q),(void *)(& f)); __e_acsl_full_init((void *)(& q)); q = f; /*@ assert \valid_read(q) ∧ ¬\valid(q); */ { int __gen_e_acsl_initialized_7; int __gen_e_acsl_and_10; int __gen_e_acsl_and_12; __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& q), sizeof(char *)); if (__gen_e_acsl_initialized_7) { int __gen_e_acsl_valid_read_4; __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)q,sizeof(char), (void *)q, (void *)(& q)); __gen_e_acsl_and_10 = __gen_e_acsl_valid_read_4; } else __gen_e_acsl_and_10 = 0; if (__gen_e_acsl_and_10) { int __gen_e_acsl_initialized_8; int __gen_e_acsl_and_11; __gen_e_acsl_initialized_8 = __e_acsl_initialized((void *)(& q), sizeof(char *)); if (__gen_e_acsl_initialized_8) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)q,sizeof(char), (void *)q,(void *)(& q)); __gen_e_acsl_and_11 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_11 = 0; __gen_e_acsl_and_12 = ! __gen_e_acsl_and_11; } else __gen_e_acsl_and_12 = 0; __e_acsl_assert(__gen_e_acsl_and_12,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(q) && !\\valid(q)",18); } __retres = 0; __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(& g)); __e_acsl_delete_block((void *)(& f)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_local_init.c0000666000000000000000000004640613571573400025203 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string_4; char *__gen_e_acsl_literal_string_3; char *__gen_e_acsl_literal_string; char *__gen_e_acsl_literal_string_2; char *__gen_e_acsl_literal_string_5; char *__gen_e_acsl_literal_string_7; char *__gen_e_acsl_literal_string_6; struct tree_desc { int *extra_bits ; }; typedef struct tree_desc tree_desc; struct tree_desc2 { struct tree_desc desc ; }; typedef struct tree_desc2 tree_desc2; void build_tree(tree_desc *desc) { int *extra; __e_acsl_store_block((void *)(& extra),(size_t)8); __e_acsl_store_block((void *)(& desc),(size_t)8); __e_acsl_temporal_pull_parameter((void *)(& desc),0U,8UL); __e_acsl_temporal_store_nreferent((void *)(& extra), (void *)(& desc->extra_bits)); __e_acsl_full_init((void *)(& extra)); extra = desc->extra_bits; /*@ assert \valid(extra); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& extra), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)extra,sizeof(int), (void *)extra,(void *)(& extra)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion", (char *)"build_tree",(char *)"\\valid(extra)",23); } __e_acsl_delete_block((void *)(& desc)); __e_acsl_delete_block((void *)(& extra)); return; } char *Strings[2][2] = {{(char *)"the", (char *)"tha"}, {(char *)"thi", (char *)"tho"}}; char *Str[4] = {(char *)"foo", (char *)"bar", (char *)"baz", (char *)0}; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string_4 = "tho"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_4,sizeof("tho")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_4); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_4); __gen_e_acsl_literal_string_3 = "thi"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3,sizeof("thi")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3); __gen_e_acsl_literal_string = "the"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("the")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); __gen_e_acsl_literal_string_2 = "tha"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2,sizeof("tha")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2); __gen_e_acsl_literal_string_5 = "foo"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_5,sizeof("foo")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_5); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_5); __gen_e_acsl_literal_string_7 = "baz"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_7,sizeof("baz")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_7); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_7); __gen_e_acsl_literal_string_6 = "bar"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string_6,sizeof("bar")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string_6); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_6); __e_acsl_store_block((void *)(Str),(size_t)32); __e_acsl_full_init((void *)(& Str)); __e_acsl_store_block((void *)(Strings),(size_t)32); __e_acsl_full_init((void *)(& Strings)); __e_acsl_temporal_store_nblock((void *)(Str), (void *)__gen_e_acsl_literal_string_5); __e_acsl_temporal_store_nblock((void *)(& Str[1]), (void *)__gen_e_acsl_literal_string_6); __e_acsl_temporal_store_nblock((void *)(& Str[2]), (void *)__gen_e_acsl_literal_string_7); __e_acsl_temporal_store_nblock((void *)(& Str[3]),(void *)0); __e_acsl_temporal_store_nblock((void *)(& Strings[0][0]), (void *)__gen_e_acsl_literal_string); __e_acsl_temporal_store_nblock((void *)(& Strings[0][1]), (void *)__gen_e_acsl_literal_string_2); __e_acsl_temporal_store_nblock((void *)(& Strings[1][0]), (void *)__gen_e_acsl_literal_string_3); __e_acsl_temporal_store_nblock((void *)(& Strings[1][1]), (void *)__gen_e_acsl_literal_string_4); } return; } int main(int argc, char const **argv) { int __retres; __e_acsl_memory_init(& argc,(char ***)(& argv),(size_t)8); __e_acsl_globals_init(); char *strings[2][2] = {{(char *)__gen_e_acsl_literal_string, (char *)__gen_e_acsl_literal_string_2}, {(char *)__gen_e_acsl_literal_string_3, (char *)__gen_e_acsl_literal_string_4}}; __e_acsl_store_block((void *)(strings),(size_t)32); __e_acsl_full_init((void *)(& strings)); __e_acsl_temporal_store_nblock((void *)(& strings[1][1]), (void *)__gen_e_acsl_literal_string_4); __e_acsl_temporal_store_nblock((void *)(& strings[1][0]), (void *)__gen_e_acsl_literal_string_3); __e_acsl_temporal_store_nblock((void *)(& strings[0][1]), (void *)__gen_e_acsl_literal_string_2); __e_acsl_temporal_store_nblock((void *)(& strings[0][0]), (void *)__gen_e_acsl_literal_string); char **p = (char **)(strings); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)(strings)); /*@ assert \valid_read(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(char **)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)p,sizeof(char *), (void *)p,(void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid_read; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(p)",41); } /*@ assert \valid_read(*p); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)p, sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_2; int __gen_e_acsl_valid_read_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& p), sizeof(char **)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_read_2; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)p, sizeof(char *), (void *)p, (void *)(& p)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_read_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p)",42); __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)*p, sizeof(char), (void *)*p,(void *)p); __gen_e_acsl_and_3 = __gen_e_acsl_valid_read_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(*p)",42); } char *str[4] = {(char *)__gen_e_acsl_literal_string_5, (char *)__gen_e_acsl_literal_string_6, (char *)__gen_e_acsl_literal_string_7, (char *)0}; __e_acsl_store_block((void *)(str),(size_t)32); __e_acsl_full_init((void *)(& str)); __e_acsl_temporal_store_nblock((void *)(& str[3]),(void *)0); __e_acsl_temporal_store_nblock((void *)(& str[2]), (void *)__gen_e_acsl_literal_string_7); __e_acsl_temporal_store_nblock((void *)(& str[1]), (void *)__gen_e_acsl_literal_string_6); __e_acsl_temporal_store_nblock((void *)(str), (void *)__gen_e_acsl_literal_string_5); __e_acsl_temporal_store_nblock((void *)(& p),(void *)(& str)); __e_acsl_full_init((void *)(& p)); p = (char **)(& str); /*@ assert \valid_read(p); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& p), sizeof(char **)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_read_4; __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)p, sizeof(char *), (void *)p, (void *)(& p)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_read_4; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(__gen_e_acsl_and_4,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(p)",48); } /*@ assert \valid_read(*p); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)p, sizeof(char *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_5; int __gen_e_acsl_valid_read_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& p), sizeof(char **)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_read_5; __gen_e_acsl_valid_read_5 = __e_acsl_valid_read((void *)p, sizeof(char *), (void *)p, (void *)(& p)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_read_5; } else __gen_e_acsl_and_5 = 0; __e_acsl_assert(__gen_e_acsl_and_5,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p)",49); __gen_e_acsl_valid_read_6 = __e_acsl_valid_read((void *)*p, sizeof(char), (void *)*p,(void *)p); __gen_e_acsl_and_6 = __gen_e_acsl_valid_read_6; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(__gen_e_acsl_and_6,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(*p)",49); } char **P = (char **)(Strings); __e_acsl_store_block((void *)(& P),(size_t)8); __e_acsl_full_init((void *)(& P)); __e_acsl_temporal_store_nblock((void *)(& P),(void *)(Strings)); /*@ assert \valid_read(P); */ { int __gen_e_acsl_initialized_7; int __gen_e_acsl_and_7; __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& P), sizeof(char **)); if (__gen_e_acsl_initialized_7) { int __gen_e_acsl_valid_read_7; __gen_e_acsl_valid_read_7 = __e_acsl_valid_read((void *)P, sizeof(char *), (void *)P, (void *)(& P)); __gen_e_acsl_and_7 = __gen_e_acsl_valid_read_7; } else __gen_e_acsl_and_7 = 0; __e_acsl_assert(__gen_e_acsl_and_7,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(P)",53); } /*@ assert \valid_read(*P); */ { int __gen_e_acsl_initialized_8; int __gen_e_acsl_and_9; __gen_e_acsl_initialized_8 = __e_acsl_initialized((void *)P, sizeof(char *)); if (__gen_e_acsl_initialized_8) { int __gen_e_acsl_initialized_9; int __gen_e_acsl_and_8; int __gen_e_acsl_valid_read_9; __gen_e_acsl_initialized_9 = __e_acsl_initialized((void *)(& P), sizeof(char **)); if (__gen_e_acsl_initialized_9) { int __gen_e_acsl_valid_read_8; __gen_e_acsl_valid_read_8 = __e_acsl_valid_read((void *)P, sizeof(char *), (void *)P, (void *)(& P)); __gen_e_acsl_and_8 = __gen_e_acsl_valid_read_8; } else __gen_e_acsl_and_8 = 0; __e_acsl_assert(__gen_e_acsl_and_8,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(P)",54); __gen_e_acsl_valid_read_9 = __e_acsl_valid_read((void *)*P, sizeof(char), (void *)*P,(void *)P); __gen_e_acsl_and_9 = __gen_e_acsl_valid_read_9; } else __gen_e_acsl_and_9 = 0; __e_acsl_assert(__gen_e_acsl_and_9,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(*P)",54); } __e_acsl_temporal_store_nblock((void *)(& P),(void *)(& Str)); __e_acsl_full_init((void *)(& P)); P = (char **)(& Str); /*@ assert \valid_read(P); */ { int __gen_e_acsl_initialized_10; int __gen_e_acsl_and_10; __gen_e_acsl_initialized_10 = __e_acsl_initialized((void *)(& P), sizeof(char **)); if (__gen_e_acsl_initialized_10) { int __gen_e_acsl_valid_read_10; __gen_e_acsl_valid_read_10 = __e_acsl_valid_read((void *)P, sizeof(char *), (void *)P, (void *)(& P)); __gen_e_acsl_and_10 = __gen_e_acsl_valid_read_10; } else __gen_e_acsl_and_10 = 0; __e_acsl_assert(__gen_e_acsl_and_10,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(P)",58); } /*@ assert \valid_read(*P); */ { int __gen_e_acsl_initialized_11; int __gen_e_acsl_and_12; __gen_e_acsl_initialized_11 = __e_acsl_initialized((void *)P, sizeof(char *)); if (__gen_e_acsl_initialized_11) { int __gen_e_acsl_initialized_12; int __gen_e_acsl_and_11; int __gen_e_acsl_valid_read_12; __gen_e_acsl_initialized_12 = __e_acsl_initialized((void *)(& P), sizeof(char **)); if (__gen_e_acsl_initialized_12) { int __gen_e_acsl_valid_read_11; __gen_e_acsl_valid_read_11 = __e_acsl_valid_read((void *)P, sizeof(char *), (void *)P, (void *)(& P)); __gen_e_acsl_and_11 = __gen_e_acsl_valid_read_11; } else __gen_e_acsl_and_11 = 0; __e_acsl_assert(__gen_e_acsl_and_11,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(P)",59); __gen_e_acsl_valid_read_12 = __e_acsl_valid_read((void *)*P, sizeof(char), (void *)*P,(void *)P); __gen_e_acsl_and_12 = __gen_e_acsl_valid_read_12; } else __gen_e_acsl_and_12 = 0; __e_acsl_assert(__gen_e_acsl_and_12,(char *)"Assertion",(char *)"main", (char *)"\\valid_read(*P)",59); } int extra_lbits[1] = {0}; __e_acsl_store_block((void *)(extra_lbits),(size_t)4); __e_acsl_full_init((void *)(& extra_lbits)); tree_desc l_desc = {.extra_bits = extra_lbits}; __e_acsl_store_block((void *)(& l_desc),(size_t)8); __e_acsl_full_init((void *)(& l_desc)); __e_acsl_temporal_store_nblock((void *)(& l_desc.extra_bits), (void *)(extra_lbits)); tree_desc descs[2] = {{.extra_bits = extra_lbits}, {.extra_bits = extra_lbits}}; __e_acsl_store_block((void *)(descs),(size_t)16); __e_acsl_full_init((void *)(& descs)); __e_acsl_temporal_store_nblock((void *)(& descs[1].extra_bits), (void *)(extra_lbits)); __e_acsl_temporal_store_nblock((void *)(& descs[0].extra_bits), (void *)(extra_lbits)); tree_desc2 l_desc2 = {.desc = {.extra_bits = extra_lbits}}; __e_acsl_store_block((void *)(& l_desc2),(size_t)8); __e_acsl_full_init((void *)(& l_desc2)); __e_acsl_temporal_store_nblock((void *)(& l_desc2.desc.extra_bits), (void *)(extra_lbits)); tree_desc2 descs2[2] = {{.desc = {.extra_bits = extra_lbits}}, {.desc = {.extra_bits = extra_lbits}}}; __e_acsl_store_block((void *)(descs2),(size_t)16); __e_acsl_full_init((void *)(& descs2)); __e_acsl_temporal_store_nblock((void *)(& descs2[1].desc.extra_bits), (void *)(extra_lbits)); __e_acsl_temporal_store_nblock((void *)(& descs2[0].desc.extra_bits), (void *)(extra_lbits)); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& l_desc),0U); build_tree(& l_desc); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(descs),0U); build_tree(descs); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& descs[1]),0U); build_tree(& descs[1]); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& l_desc2.desc),0U); build_tree(& l_desc2.desc); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& descs2[0].desc),0U); build_tree(& descs2[0].desc); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& descs2[1].desc),0U); build_tree(& descs2[1].desc); __retres = 0; __e_acsl_delete_block((void *)(Str)); __e_acsl_delete_block((void *)(Strings)); __e_acsl_delete_block((void *)(descs2)); __e_acsl_delete_block((void *)(& l_desc2)); __e_acsl_delete_block((void *)(descs)); __e_acsl_delete_block((void *)(& l_desc)); __e_acsl_delete_block((void *)(extra_lbits)); __e_acsl_delete_block((void *)(& P)); __e_acsl_delete_block((void *)(str)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(strings)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_malloc-asan.c0000666000000000000000000000523013571573400025243 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" char *__gen_e_acsl_literal_string; void __e_acsl_globals_init(void) { static char __e_acsl_already_run = 0; if (! __e_acsl_already_run) { __e_acsl_already_run = 1; __gen_e_acsl_literal_string = "Same address %p in %d steps\n"; __e_acsl_store_block((void *)__gen_e_acsl_literal_string, sizeof("Same address %p in %d steps\n")); __e_acsl_full_init((void *)__gen_e_acsl_literal_string); __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string); } return; } int main(void) { int __retres; int *p; int *q; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_globals_init(); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); int counter = 0; size_t limit = (unsigned long)10000; __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_full_init((void *)(& p)); p = (int *)malloc((unsigned long)(1024 * 1024)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p)); __e_acsl_temporal_store_nreferent((void *)(& q),(void *)(& p)); __e_acsl_full_init((void *)(& q)); q = p; __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& p),0U); free((void *)p); while ((size_t)counter < limit) { __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_full_init((void *)(& p)); p = (int *)malloc((unsigned long)(1024 * 1024)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p)); counter ++; /*@ assert Eva: dangling_pointer: ¬\dangling(&q); */ if (p != q) { __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& p),0U); free((void *)p); } else { __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& p),1U); printf(__gen_e_acsl_literal_string,p,counter); break; } __e_acsl_temporal_store_nblock((void *)(& p),(void *)0); __e_acsl_full_init((void *)(& p)); p = (int *)0; } if (p) { __e_acsl_initialize((void *)q,sizeof(int)); *q = 1; __e_acsl_initialize((void *)p,sizeof(int)); *p = 2; } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& p),0U); free((void *)p); __retres = 0; __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_malloc.c0000666000000000000000000002025713571573400024331 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; int *p; int *q; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_store_block((void *)(& p),(size_t)8); /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(! __gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"!\\valid(p)",11); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"!\\valid(q)",12); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_full_init((void *)(& p)); p = (int *)malloc(sizeof(int)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p)); __e_acsl_temporal_store_nreferent((void *)(& q),(void *)(& p)); __e_acsl_full_init((void *)(& q)); q = p; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_3 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",17); } /*@ assert \valid(q); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(__gen_e_acsl_and_4,(char *)"Assertion",(char *)"main", (char *)"\\valid(q)",18); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& q),0U); free((void *)q); /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_5; /*@ assert Eva: dangling_pointer: ¬\dangling(&p); */ __gen_e_acsl_valid_5 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_5 = 0; __e_acsl_assert(! __gen_e_acsl_and_5,(char *)"Assertion",(char *)"main", (char *)"!\\valid(p)",22); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_6 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(! __gen_e_acsl_and_6,(char *)"Assertion",(char *)"main", (char *)"!\\valid(q)",23); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_full_init((void *)(& p)); p = (int *)malloc(sizeof(int)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p)); /*@ assert \valid(p); */ { int __gen_e_acsl_initialized_7; int __gen_e_acsl_and_7; __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_7) { int __gen_e_acsl_valid_7; __gen_e_acsl_valid_7 = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and_7 = __gen_e_acsl_valid_7; } else __gen_e_acsl_and_7 = 0; __e_acsl_assert(__gen_e_acsl_and_7,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",28); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_8; int __gen_e_acsl_and_8; __gen_e_acsl_initialized_8 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_8) { int __gen_e_acsl_valid_8; __gen_e_acsl_valid_8 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_8 = __gen_e_acsl_valid_8; } else __gen_e_acsl_and_8 = 0; __e_acsl_assert(! __gen_e_acsl_and_8,(char *)"Assertion",(char *)"main", (char *)"!\\valid(q)",29); } __e_acsl_initialize((void *)q,sizeof(int)); *q = 1; __e_acsl_initialize((void *)p,sizeof(int)); *p = 2; __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_full_init((void *)(& q)); q = (int *)calloc((unsigned long)4096,(unsigned long)1); __e_acsl_temporal_store_nblock((void *)(& q),(void *)*(& q)); /*@ assert \valid(q); */ { int __gen_e_acsl_initialized_9; int __gen_e_acsl_and_9; __gen_e_acsl_initialized_9 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_9) { int __gen_e_acsl_valid_9; __gen_e_acsl_valid_9 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_9 = __gen_e_acsl_valid_9; } else __gen_e_acsl_and_9 = 0; __e_acsl_assert(__gen_e_acsl_and_9,(char *)"Assertion",(char *)"main", (char *)"\\valid(q)",35); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& q),0U); __e_acsl_full_init((void *)(& q)); q = (int *)realloc((void *)q,(unsigned long)8192); __e_acsl_temporal_store_nblock((void *)(& q),(void *)*(& q)); /*@ assert \valid(q); */ { int __gen_e_acsl_initialized_10; int __gen_e_acsl_and_10; __gen_e_acsl_initialized_10 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_10) { int __gen_e_acsl_valid_10; __gen_e_acsl_valid_10 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_10 = __gen_e_acsl_valid_10; } else __gen_e_acsl_and_10 = 0; __e_acsl_assert(__gen_e_acsl_and_10,(char *)"Assertion",(char *)"main", (char *)"\\valid(q)",39); } __retres = 0; __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_memcpy.c0000666000000000000000000003660713571573400024362 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" #include "string.h" extern int __e_acsl_sound_verdict; int main(void) { int __retres; int *src[2]; int *dest[2]; int *tmp_1; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(& tmp_1),(size_t)8); __e_acsl_store_block((void *)(dest),(size_t)16); __e_acsl_store_block((void *)(src),(size_t)16); int a = 111; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); int b = 222; __e_acsl_store_block((void *)(& b),(size_t)4); __e_acsl_full_init((void *)(& b)); int size = (int)(sizeof(int *) * (unsigned long)2); __e_acsl_temporal_store_nblock((void *)(src),(void *)(& a)); __e_acsl_initialize((void *)(src),sizeof(int *)); src[0] = & a; __e_acsl_temporal_store_nblock((void *)(& src[1]),(void *)(& b)); __e_acsl_initialize((void *)(& src[1]),sizeof(int *)); src[1] = & b; __e_acsl_temporal_store_nblock((void *)(dest),(void *)0); __e_acsl_initialize((void *)(dest),sizeof(int *)); dest[0] = (int *)0; __e_acsl_temporal_store_nblock((void *)(& dest[1]),(void *)0); __e_acsl_initialize((void *)(& dest[1]),sizeof(int *)); dest[1] = (int *)0; /*@ assert \valid(src[0]); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(src), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)src[0],sizeof(int), (void *)src[0],(void *)(src)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(src[0])",22); } /*@ assert \valid(src[1]); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& src[1]), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)src[1],sizeof(int), (void *)src[1], (void *)(& src[1])); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(__gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"\\valid(src[1])",23); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& dest),0U); __e_acsl_temporal_save_nblock_parameter((void *)(& src),1U); __gen_e_acsl_memcpy((void *)(& dest),(void const *)(& src), (unsigned long)size); /*@ assert \valid(dest[0]); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(dest), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)dest[0],sizeof(int), (void *)dest[0],(void *)(dest)); __gen_e_acsl_and_3 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid(dest[0])",27); } /*@ assert \valid(dest[1]); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& dest[1]), sizeof(int *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)dest[1],sizeof(int), (void *)dest[1], (void *)(& dest[1])); __gen_e_acsl_and_4 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(__gen_e_acsl_and_4,(char *)"Assertion",(char *)"main", (char *)"\\valid(dest[1])",28); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nblock_parameter((void *)(& dest),0U); __gen_e_acsl_memset((void *)(& dest),0,(unsigned long)size); /*@ assert ¬\valid(dest[0]); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(dest), sizeof(int *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)dest[0],sizeof(int), (void *)dest[0],(void *)(dest)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_5 = 0; __e_acsl_assert(! __gen_e_acsl_and_5,(char *)"Assertion",(char *)"main", (char *)"!\\valid(dest[0])",32); } /*@ assert ¬\valid(dest[1]); */ { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& dest[1]), sizeof(int *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)dest[1],sizeof(int), (void *)dest[1], (void *)(& dest[1])); __gen_e_acsl_and_6 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(! __gen_e_acsl_and_6,(char *)"Assertion",(char *)"main", (char *)"!\\valid(dest[1])",33); } __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); int **p = malloc((unsigned long)size); __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p)); __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); int **q = malloc((unsigned long)size); __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); __e_acsl_temporal_store_nblock((void *)(& q),(void *)*(& q)); __e_acsl_temporal_store_nblock((void *)p,(void *)(& a)); __e_acsl_initialize((void *)p,sizeof(int *)); *p = & a; __e_acsl_temporal_store_nblock((void *)(p + 1),(void *)(& a)); __e_acsl_initialize((void *)(p + 1),sizeof(int *)); *(p + 1) = & a; /*@ assert \valid(*p); */ { int __gen_e_acsl_initialized_7; int __gen_e_acsl_and_8; __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)p, sizeof(int *)); if (__gen_e_acsl_initialized_7) { int __gen_e_acsl_initialized_8; int __gen_e_acsl_and_7; int __gen_e_acsl_valid_7; __gen_e_acsl_initialized_8 = __e_acsl_initialized((void *)(& p), sizeof(int **)); if (__gen_e_acsl_initialized_8) { int __gen_e_acsl_valid_read; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)p, sizeof(int *), (void *)p, (void *)(& p)); __gen_e_acsl_and_7 = __gen_e_acsl_valid_read; } else __gen_e_acsl_and_7 = 0; __e_acsl_assert(__gen_e_acsl_and_7,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p)",42); __gen_e_acsl_valid_7 = __e_acsl_valid((void *)*p,sizeof(int), (void *)*p,(void *)p); __gen_e_acsl_and_8 = __gen_e_acsl_valid_7; } else __gen_e_acsl_and_8 = 0; __e_acsl_assert(__gen_e_acsl_and_8,(char *)"Assertion",(char *)"main", (char *)"\\valid(*p)",42); } /*@ assert \valid(*(p + 1)); */ { int __gen_e_acsl_initialized_9; int __gen_e_acsl_and_9; __gen_e_acsl_initialized_9 = __e_acsl_initialized((void *)(p + 1), sizeof(int *)); if (__gen_e_acsl_initialized_9) { int __gen_e_acsl_valid_read_2; int __gen_e_acsl_valid_8; __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(p + 1), sizeof(int *), (void *)p, (void *)(& p)); __e_acsl_assert(__gen_e_acsl_valid_read_2,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(p + 1)",43); __gen_e_acsl_valid_8 = __e_acsl_valid((void *)*(p + 1),sizeof(int), (void *)*(p + 1),(void *)( p + 1)); __gen_e_acsl_and_9 = __gen_e_acsl_valid_8; } else __gen_e_acsl_and_9 = 0; __e_acsl_assert(__gen_e_acsl_and_9,(char *)"Assertion",(char *)"main", (char *)"\\valid(*(p + 1))",43); } /*@ assert ¬\valid(*q); */ { int __gen_e_acsl_initialized_10; int __gen_e_acsl_and_11; __gen_e_acsl_initialized_10 = __e_acsl_initialized((void *)q, sizeof(int *)); if (__gen_e_acsl_initialized_10) { int __gen_e_acsl_initialized_11; int __gen_e_acsl_and_10; int __gen_e_acsl_valid_9; __gen_e_acsl_initialized_11 = __e_acsl_initialized((void *)(& q), sizeof(int **)); if (__gen_e_acsl_initialized_11) { int __gen_e_acsl_valid_read_3; __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)q, sizeof(int *), (void *)q, (void *)(& q)); __gen_e_acsl_and_10 = __gen_e_acsl_valid_read_3; } else __gen_e_acsl_and_10 = 0; __e_acsl_assert(__gen_e_acsl_and_10,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(q)",44); __gen_e_acsl_valid_9 = __e_acsl_valid((void *)*q,sizeof(int), (void *)*q,(void *)q); __gen_e_acsl_and_11 = __gen_e_acsl_valid_9; } else __gen_e_acsl_and_11 = 0; __e_acsl_assert(! __gen_e_acsl_and_11,(char *)"Assertion",(char *)"main", (char *)"!\\valid(*q)",44); } /*@ assert ¬\valid(*(q + 1)); */ { int __gen_e_acsl_initialized_12; int __gen_e_acsl_and_12; __gen_e_acsl_initialized_12 = __e_acsl_initialized((void *)(q + 1), sizeof(int *)); if (__gen_e_acsl_initialized_12) { int __gen_e_acsl_valid_read_4; int __gen_e_acsl_valid_10; __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)(q + 1), sizeof(int *), (void *)q, (void *)(& q)); __e_acsl_assert(__gen_e_acsl_valid_read_4,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(q + 1)",45); __gen_e_acsl_valid_10 = __e_acsl_valid((void *)*(q + 1),sizeof(int), (void *)*(q + 1), (void *)(q + 1)); __gen_e_acsl_and_12 = __gen_e_acsl_valid_10; } else __gen_e_acsl_and_12 = 0; __e_acsl_assert(! __gen_e_acsl_and_12,(char *)"Assertion",(char *)"main", (char *)"!\\valid(*(q + 1))",45); } __e_acsl_temporal_store_nblock((void *)(& tmp_1),(void *)0); __e_acsl_full_init((void *)(& tmp_1)); tmp_1 = (int *)0; __e_acsl_temporal_store_nreferent((void *)(q + 1),(void *)(& tmp_1)); __e_acsl_initialize((void *)(q + 1),sizeof(int *)); *(q + 1) = tmp_1; __e_acsl_temporal_store_nreferent((void *)q,(void *)(& tmp_1)); __e_acsl_initialize((void *)q,sizeof(int *)); *q = tmp_1; __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_temporal_save_nreferent_parameter((void *)(& q),0U); __e_acsl_temporal_save_nreferent_parameter((void *)(& p),1U); __gen_e_acsl_memcpy((void *)q,(void const *)p,(unsigned long)size); /*@ assert \valid(*q); */ { int __gen_e_acsl_initialized_13; int __gen_e_acsl_and_14; __gen_e_acsl_initialized_13 = __e_acsl_initialized((void *)q, sizeof(int *)); if (__gen_e_acsl_initialized_13) { int __gen_e_acsl_initialized_14; int __gen_e_acsl_and_13; int __gen_e_acsl_valid_11; __gen_e_acsl_initialized_14 = __e_acsl_initialized((void *)(& q), sizeof(int **)); if (__gen_e_acsl_initialized_14) { int __gen_e_acsl_valid_read_5; __gen_e_acsl_valid_read_5 = __e_acsl_valid_read((void *)q, sizeof(int *), (void *)q, (void *)(& q)); __gen_e_acsl_and_13 = __gen_e_acsl_valid_read_5; } else __gen_e_acsl_and_13 = 0; __e_acsl_assert(__gen_e_acsl_and_13,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(q)",50); __gen_e_acsl_valid_11 = __e_acsl_valid((void *)*q,sizeof(int), (void *)*q,(void *)q); __gen_e_acsl_and_14 = __gen_e_acsl_valid_11; } else __gen_e_acsl_and_14 = 0; __e_acsl_assert(__gen_e_acsl_and_14,(char *)"Assertion",(char *)"main", (char *)"\\valid(*q)",50); } /*@ assert \valid(*(q + 1)); */ { int __gen_e_acsl_initialized_15; int __gen_e_acsl_and_15; __gen_e_acsl_initialized_15 = __e_acsl_initialized((void *)(q + 1), sizeof(int *)); if (__gen_e_acsl_initialized_15) { int __gen_e_acsl_valid_read_6; int __gen_e_acsl_valid_12; __gen_e_acsl_valid_read_6 = __e_acsl_valid_read((void *)(q + 1), sizeof(int *), (void *)q, (void *)(& q)); __e_acsl_assert(__gen_e_acsl_valid_read_6,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(q + 1)",51); __gen_e_acsl_valid_12 = __e_acsl_valid((void *)*(q + 1),sizeof(int), (void *)*(q + 1), (void *)(q + 1)); __gen_e_acsl_and_15 = __gen_e_acsl_valid_12; } else __gen_e_acsl_and_15 = 0; __e_acsl_assert(__gen_e_acsl_and_15,(char *)"Assertion",(char *)"main", (char *)"\\valid(*(q + 1))",51); } __retres = 0; __e_acsl_delete_block((void *)(& tmp_1)); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_delete_block((void *)(dest)); __e_acsl_delete_block((void *)(src)); __e_acsl_delete_block((void *)(& b)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_scope.c0000666000000000000000000001442213571573400024170 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int *p = (int *)0; __e_acsl_store_block((void *)(& p),(size_t)8); __e_acsl_full_init((void *)(& p)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)0); int *q = (int *)0; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); __e_acsl_temporal_store_nblock((void *)(& q),(void *)0); { int i = 9; __e_acsl_store_block((void *)(& i),(size_t)4); __e_acsl_full_init((void *)(& i)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)(& i)); __e_acsl_full_init((void *)(& p)); p = & i; __e_acsl_temporal_store_nreferent((void *)(& q),(void *)(& p)); __e_acsl_full_init((void *)(& q)); q = p; __e_acsl_delete_block((void *)(& i)); } /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; /*@ assert Eva: dangling_pointer: ¬\dangling(&p); */ __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p, (void *)(& p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(! __gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"!\\valid(p)",15); } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"!\\valid(q)",16); } { int j = 8; __e_acsl_store_block((void *)(& j),(size_t)4); __e_acsl_full_init((void *)(& j)); __e_acsl_temporal_store_nblock((void *)(& p),(void *)(& j)); __e_acsl_full_init((void *)(& p)); p = & j; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_3; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and_3 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",21); } __e_acsl_initialize((void *)p,sizeof(int)); *p = 1; /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_4; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)q,sizeof(int), (void *)q,(void *)(& q)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_4 = 0; __e_acsl_assert(! __gen_e_acsl_and_4,(char *)"Assertion", (char *)"main",(char *)"!\\valid(q)",24); } /*@ assert \valid(&j); */ { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)(& j),sizeof(int), (void *)(& j),(void *)0); __e_acsl_assert(__gen_e_acsl_valid_5,(char *)"Assertion", (char *)"main",(char *)"\\valid(&j)",25); __e_acsl_delete_block((void *)(& j)); } } int len = 3; __e_acsl_temporal_store_nblock((void *)(& p),(void *)0); __e_acsl_full_init((void *)(& p)); p = (int *)0; __e_acsl_temporal_store_nblock((void *)(& q),(void *)0); __e_acsl_full_init((void *)(& q)); q = (int *)0; while (len) { int a; __e_acsl_store_block((void *)(& a),(size_t)4); /*@ assert ¬\valid(p); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_5 = 0; __e_acsl_assert(! __gen_e_acsl_and_5,(char *)"Assertion", (char *)"main",(char *)"!\\valid(p)",34); } __e_acsl_temporal_store_nblock((void *)(& q),(void *)(& a)); __e_acsl_full_init((void *)(& q)); q = & a; __e_acsl_temporal_store_nreferent((void *)(& p),(void *)(& q)); __e_acsl_full_init((void *)(& p)); p = q; /*@ assert \valid(p); */ { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& p), sizeof(int *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_7; __gen_e_acsl_valid_7 = __e_acsl_valid((void *)p,sizeof(int), (void *)p,(void *)(& p)); __gen_e_acsl_and_6 = __gen_e_acsl_valid_7; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(__gen_e_acsl_and_6,(char *)"Assertion",(char *)"main", (char *)"\\valid(p)",37); } len --; __e_acsl_delete_block((void *)(& a)); } __retres = 0; __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(& p)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_struct.c0000666000000000000000000003345213571573400024407 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" struct temporal_t { char *p ; char *q ; }; struct larger_t { char *p ; char *q ; struct temporal_t t ; }; typedef struct temporal_t temporal; typedef struct larger_t larger; int main(void) { int __retres; temporal t1; temporal t2; temporal *tp; temporal tarr[2]; larger l; larger *lp; larger larr[2]; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); __e_acsl_store_block((void *)(larr),(size_t)64); __e_acsl_store_block((void *)(& lp),(size_t)8); __e_acsl_store_block((void *)(& l),(size_t)32); __e_acsl_store_block((void *)(tarr),(size_t)32); __e_acsl_store_block((void *)(& t2),(size_t)16); __e_acsl_store_block((void *)(& t1),(size_t)16); int a = 1; __e_acsl_store_block((void *)(& a),(size_t)4); __e_acsl_full_init((void *)(& a)); int b = 2; __e_acsl_temporal_store_nblock((void *)(& t1.p),(void *)(& a)); __e_acsl_initialize((void *)(& t1.p),sizeof(char *)); t1.p = (char *)(& a); __e_acsl_temporal_store_nreferent((void *)(& t1.q),(void *)(& t1.p)); __e_acsl_initialize((void *)(& t1.q),sizeof(char *)); t1.q = t1.p; /*@ assert \valid(t1.p) ∧ \valid(t1.q); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; int __gen_e_acsl_and_3; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& t1.p), sizeof(char *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)t1.p,sizeof(char), (void *)t1.p,(void *)(& t1.p)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; if (__gen_e_acsl_and) { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& t1.q), sizeof(char *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)t1.q,sizeof(char), (void *)t1.q,(void *)(& t1.q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __gen_e_acsl_and_3 = __gen_e_acsl_and_2; } else __gen_e_acsl_and_3 = 0; __e_acsl_assert(__gen_e_acsl_and_3,(char *)"Assertion",(char *)"main", (char *)"\\valid(t1.p) && \\valid(t1.q)",31); } /*@ assert ¬\valid(t2.p) ∧ ¬\valid(t2.q); */ { int __gen_e_acsl_initialized_3; int __gen_e_acsl_and_4; int __gen_e_acsl_and_6; __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& t2.p), sizeof(char *)); if (__gen_e_acsl_initialized_3) { int __gen_e_acsl_valid_3; __gen_e_acsl_valid_3 = __e_acsl_valid((void *)t2.p,sizeof(char), (void *)t2.p,(void *)(& t2.p)); __gen_e_acsl_and_4 = __gen_e_acsl_valid_3; } else __gen_e_acsl_and_4 = 0; if (! __gen_e_acsl_and_4) { int __gen_e_acsl_initialized_4; int __gen_e_acsl_and_5; __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& t2.q), sizeof(char *)); if (__gen_e_acsl_initialized_4) { int __gen_e_acsl_valid_4; __gen_e_acsl_valid_4 = __e_acsl_valid((void *)t2.q,sizeof(char), (void *)t2.q,(void *)(& t2.q)); __gen_e_acsl_and_5 = __gen_e_acsl_valid_4; } else __gen_e_acsl_and_5 = 0; __gen_e_acsl_and_6 = ! __gen_e_acsl_and_5; } else __gen_e_acsl_and_6 = 0; __e_acsl_assert(__gen_e_acsl_and_6,(char *)"Assertion",(char *)"main", (char *)"!\\valid(t2.p) && !\\valid(t2.q)",32); } __e_acsl_temporal_memcpy((void *)(& t2),(void *)(& t1),(size_t)16); __e_acsl_full_init((void *)(& t2)); t2 = t1; /*@ assert \valid(t2.p) ∧ \valid(t2.q); */ { int __gen_e_acsl_initialized_5; int __gen_e_acsl_and_7; int __gen_e_acsl_and_9; __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& t2.p), sizeof(char *)); if (__gen_e_acsl_initialized_5) { int __gen_e_acsl_valid_5; __gen_e_acsl_valid_5 = __e_acsl_valid((void *)t2.p,sizeof(char), (void *)t2.p,(void *)(& t2.p)); __gen_e_acsl_and_7 = __gen_e_acsl_valid_5; } else __gen_e_acsl_and_7 = 0; if (__gen_e_acsl_and_7) { int __gen_e_acsl_initialized_6; int __gen_e_acsl_and_8; __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& t2.q), sizeof(char *)); if (__gen_e_acsl_initialized_6) { int __gen_e_acsl_valid_6; __gen_e_acsl_valid_6 = __e_acsl_valid((void *)t2.q,sizeof(char), (void *)t2.q,(void *)(& t2.q)); __gen_e_acsl_and_8 = __gen_e_acsl_valid_6; } else __gen_e_acsl_and_8 = 0; __gen_e_acsl_and_9 = __gen_e_acsl_and_8; } else __gen_e_acsl_and_9 = 0; __e_acsl_assert(__gen_e_acsl_and_9,(char *)"Assertion",(char *)"main", (char *)"\\valid(t2.p) && \\valid(t2.q)",35); } __e_acsl_temporal_store_nblock((void *)(& t2.p),(void *)0); __e_acsl_initialize((void *)(& t2.p),sizeof(char *)); t2.p = (char *)0; __e_acsl_temporal_reset_parameters(); __e_acsl_temporal_reset_return(); __e_acsl_initialize((void *)(& t2.q),sizeof(char *)); t2.q = (char *)malloc((unsigned long)4); __e_acsl_temporal_store_nblock((void *)(& t2.q),(void *)*(& t2.q)); /*@ assert ¬\valid(t2.p) ∧ \valid(t2.q); */ { int __gen_e_acsl_initialized_7; int __gen_e_acsl_and_10; int __gen_e_acsl_and_12; __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& t2.p), sizeof(char *)); if (__gen_e_acsl_initialized_7) { int __gen_e_acsl_valid_7; __gen_e_acsl_valid_7 = __e_acsl_valid((void *)t2.p,sizeof(char), (void *)t2.p,(void *)(& t2.p)); __gen_e_acsl_and_10 = __gen_e_acsl_valid_7; } else __gen_e_acsl_and_10 = 0; if (! __gen_e_acsl_and_10) { int __gen_e_acsl_initialized_8; int __gen_e_acsl_and_11; __gen_e_acsl_initialized_8 = __e_acsl_initialized((void *)(& t2.q), sizeof(char *)); if (__gen_e_acsl_initialized_8) { int __gen_e_acsl_valid_8; __gen_e_acsl_valid_8 = __e_acsl_valid((void *)t2.q,sizeof(char), (void *)t2.q,(void *)(& t2.q)); __gen_e_acsl_and_11 = __gen_e_acsl_valid_8; } else __gen_e_acsl_and_11 = 0; __gen_e_acsl_and_12 = __gen_e_acsl_and_11; } else __gen_e_acsl_and_12 = 0; __e_acsl_assert(__gen_e_acsl_and_12,(char *)"Assertion",(char *)"main", (char *)"!\\valid(t2.p) && \\valid(t2.q)",39); } __e_acsl_temporal_memcpy((void *)(& l.t),(void *)(& t2),(size_t)16); __e_acsl_initialize((void *)(& l.t),sizeof(struct temporal_t)); l.t = t2; /*@ assert ¬\valid(l.t.p) ∧ \valid(l.t.q); */ { int __gen_e_acsl_initialized_9; int __gen_e_acsl_and_13; int __gen_e_acsl_and_15; __gen_e_acsl_initialized_9 = __e_acsl_initialized((void *)(& l.t.p), sizeof(char *)); if (__gen_e_acsl_initialized_9) { int __gen_e_acsl_valid_9; __gen_e_acsl_valid_9 = __e_acsl_valid((void *)l.t.p,sizeof(char), (void *)l.t.p,(void *)(& l.t.p)); __gen_e_acsl_and_13 = __gen_e_acsl_valid_9; } else __gen_e_acsl_and_13 = 0; if (! __gen_e_acsl_and_13) { int __gen_e_acsl_initialized_10; int __gen_e_acsl_and_14; __gen_e_acsl_initialized_10 = __e_acsl_initialized((void *)(& l.t.q), sizeof(char *)); if (__gen_e_acsl_initialized_10) { int __gen_e_acsl_valid_10; __gen_e_acsl_valid_10 = __e_acsl_valid((void *)l.t.q,sizeof(char), (void *)l.t.q, (void *)(& l.t.q)); __gen_e_acsl_and_14 = __gen_e_acsl_valid_10; } else __gen_e_acsl_and_14 = 0; __gen_e_acsl_and_15 = __gen_e_acsl_and_14; } else __gen_e_acsl_and_15 = 0; __e_acsl_assert(__gen_e_acsl_and_15,(char *)"Assertion",(char *)"main", (char *)"!\\valid(l.t.p) && \\valid(l.t.q)",42); } __e_acsl_temporal_store_nblock((void *)(& lp),(void *)(& l)); __e_acsl_full_init((void *)(& lp)); lp = & l; /*@ assert ¬\valid(lp->t.p); */ { int __gen_e_acsl_initialized_11; int __gen_e_acsl_and_16; __gen_e_acsl_initialized_11 = __e_acsl_initialized((void *)(& lp->t.p), sizeof(char *)); if (__gen_e_acsl_initialized_11) { int __gen_e_acsl_valid_read; int __gen_e_acsl_valid_11; __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(& lp->t.p), sizeof(char *), (void *)(& lp->t.p), (void *)0); __e_acsl_assert(__gen_e_acsl_valid_read,(char *)"RTE",(char *)"main", (char *)"mem_access: \\valid_read(&lp->t.p)",45); __gen_e_acsl_valid_11 = __e_acsl_valid((void *)lp->t.p,sizeof(char), (void *)lp->t.p, (void *)(& lp->t.p)); __gen_e_acsl_and_16 = __gen_e_acsl_valid_11; } else __gen_e_acsl_and_16 = 0; __e_acsl_assert(! __gen_e_acsl_and_16,(char *)"Assertion",(char *)"main", (char *)"!\\valid(lp->t.p)",45); } __e_acsl_temporal_memcpy((void *)(tarr),(void *)(& t2),(size_t)16); __e_acsl_initialize((void *)(tarr),sizeof(temporal)); tarr[0] = t2; /*@ assert ¬\valid(tarr[0].p) ∧ \valid(tarr[0].q); */ { int __gen_e_acsl_initialized_12; int __gen_e_acsl_and_17; int __gen_e_acsl_and_19; __gen_e_acsl_initialized_12 = __e_acsl_initialized((void *)(& tarr[0].p), sizeof(char *)); if (__gen_e_acsl_initialized_12) { int __gen_e_acsl_valid_12; __gen_e_acsl_valid_12 = __e_acsl_valid((void *)tarr[0].p,sizeof(char), (void *)tarr[0].p, (void *)(& tarr[0].p)); __gen_e_acsl_and_17 = __gen_e_acsl_valid_12; } else __gen_e_acsl_and_17 = 0; if (! __gen_e_acsl_and_17) { int __gen_e_acsl_initialized_13; int __gen_e_acsl_and_18; __gen_e_acsl_initialized_13 = __e_acsl_initialized((void *)(& tarr[0].q), sizeof(char *)); if (__gen_e_acsl_initialized_13) { int __gen_e_acsl_valid_13; __gen_e_acsl_valid_13 = __e_acsl_valid((void *)tarr[0].q, sizeof(char), (void *)tarr[0].q, (void *)(& tarr[0].q)); __gen_e_acsl_and_18 = __gen_e_acsl_valid_13; } else __gen_e_acsl_and_18 = 0; __gen_e_acsl_and_19 = __gen_e_acsl_and_18; } else __gen_e_acsl_and_19 = 0; __e_acsl_assert(__gen_e_acsl_and_19,(char *)"Assertion",(char *)"main", (char *)"!\\valid(tarr[0].p) && \\valid(tarr[0].q)",48); } __e_acsl_temporal_memcpy((void *)(larr),(void *)(& l),(size_t)32); __e_acsl_initialize((void *)(larr),sizeof(larger)); larr[0] = l; /*@ assert ¬\valid(larr[0].t.p) ∧ \valid(larr[0].t.q); */ { int __gen_e_acsl_initialized_14; int __gen_e_acsl_and_20; int __gen_e_acsl_and_22; __gen_e_acsl_initialized_14 = __e_acsl_initialized((void *)(& larr[0].t.p), sizeof(char *)); if (__gen_e_acsl_initialized_14) { int __gen_e_acsl_valid_14; __gen_e_acsl_valid_14 = __e_acsl_valid((void *)larr[0].t.p, sizeof(char), (void *)larr[0].t.p, (void *)(& larr[0].t.p)); __gen_e_acsl_and_20 = __gen_e_acsl_valid_14; } else __gen_e_acsl_and_20 = 0; if (! __gen_e_acsl_and_20) { int __gen_e_acsl_initialized_15; int __gen_e_acsl_and_21; __gen_e_acsl_initialized_15 = __e_acsl_initialized((void *)(& larr[0].t.q), sizeof(char *)); if (__gen_e_acsl_initialized_15) { int __gen_e_acsl_valid_15; __gen_e_acsl_valid_15 = __e_acsl_valid((void *)larr[0].t.q, sizeof(char), (void *)larr[0].t.q, (void *)(& larr[0].t.q)); __gen_e_acsl_and_21 = __gen_e_acsl_valid_15; } else __gen_e_acsl_and_21 = 0; __gen_e_acsl_and_22 = __gen_e_acsl_and_21; } else __gen_e_acsl_and_22 = 0; __e_acsl_assert(__gen_e_acsl_and_22,(char *)"Assertion",(char *)"main", (char *)"!\\valid(larr[0].t.p) && \\valid(larr[0].t.q)", 51); } __retres = 0; __e_acsl_delete_block((void *)(larr)); __e_acsl_delete_block((void *)(& lp)); __e_acsl_delete_block((void *)(& l)); __e_acsl_delete_block((void *)(tarr)); __e_acsl_delete_block((void *)(& t2)); __e_acsl_delete_block((void *)(& t1)); __e_acsl_delete_block((void *)(& a)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/gen_t_while.c0000666000000000000000000000446013571573400024170 0ustar /* Generated by Frama-C */ #include "stdio.h" #include "stdlib.h" int main(void) { int __retres; __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8); int i = 0; int arr[4] = {1, 2, 3, 4}; __e_acsl_store_block((void *)(arr),(size_t)16); __e_acsl_full_init((void *)(& arr)); int arr2[4] = {1, 2, 3, 4}; if (! ((unsigned long)(& arr) + sizeof(arr) == (unsigned long)(& arr2))) { __retres = 0; goto return_label; } int *q = arr; __e_acsl_store_block((void *)(& q),(size_t)8); __e_acsl_full_init((void *)(& q)); __e_acsl_temporal_store_nblock((void *)(& q),(void *)(arr)); while (i < 4) { /*@ assert \valid(q); */ { int __gen_e_acsl_initialized; int __gen_e_acsl_and; __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized) { int __gen_e_acsl_valid; __gen_e_acsl_valid = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and = __gen_e_acsl_valid; } else __gen_e_acsl_and = 0; __e_acsl_assert(__gen_e_acsl_and,(char *)"Assertion",(char *)"main", (char *)"\\valid(q)",28); } __e_acsl_initialize((void *)q,sizeof(int)); *q = 1; i ++; __e_acsl_temporal_store_nreferent((void *)(& q),(void *)(& q)); __e_acsl_full_init((void *)(& q)); q ++; } /*@ assert ¬\valid(q); */ { int __gen_e_acsl_initialized_2; int __gen_e_acsl_and_2; __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q), sizeof(int *)); if (__gen_e_acsl_initialized_2) { int __gen_e_acsl_valid_2; __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(int),(void *)q, (void *)(& q)); __gen_e_acsl_and_2 = __gen_e_acsl_valid_2; } else __gen_e_acsl_and_2 = 0; __e_acsl_assert(! __gen_e_acsl_and_2,(char *)"Assertion",(char *)"main", (char *)"!\\valid(q)",36); } __retres = 0; return_label: __e_acsl_store_block_duplicate((void *)(& q),(size_t)8); __e_acsl_delete_block((void *)(& q)); __e_acsl_delete_block((void *)(arr)); __e_acsl_memory_clean(); return __retres; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_addr-by-val.res.oracle0000666000000000000000000000011713571573400026137 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_args.res.oracle0000666000000000000000000000040613571573400024772 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/temporal/t_args.c:9: Warning: assertion got status unknown. [eva:alarm] tests/temporal/t_args.c:10: Warning: assertion got status invalid (stopping propagation). frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_array.res.oracle0000666000000000000000000000011713571573400025153 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_char.res.oracle0000666000000000000000000000011713571573400024752 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_darray.res.oracle0000666000000000000000000000011713571573400025317 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_dpointer.res.oracle0000666000000000000000000000227313571573400025666 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/temporal/t_dpointer.c:12: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/temporal/t_dpointer.c:13: Warning: accessing uninitialized left-value. assert \initialized(p + i); [eva:alarm] tests/temporal/t_dpointer.c:14: Warning: assertion got status unknown. [eva:alarm] tests/temporal/t_dpointer.c:14: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/temporal/t_dpointer.c:14: Warning: accessing uninitialized left-value. assert \initialized(p + i); [eva:alarm] tests/temporal/t_dpointer.c:14: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/temporal/t_dpointer.c:18: Warning: accessing uninitialized left-value. assert \initialized(p + 2); [eva:alarm] tests/temporal/t_dpointer.c:20: Warning: assertion got status unknown. [eva:alarm] tests/temporal/t_dpointer.c:20: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(p + 2); [eva:alarm] tests/temporal/t_dpointer.c:20: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_fptr.res.oracle0000666000000000000000000000047413571573400025016 0ustar [e-acsl] beginning translation. [e-acsl] tests/temporal/t_fptr.c:19: Warning: function pointers may introduce too limited instrumentation. [e-acsl] tests/temporal/t_fptr.c:17: Warning: E-ACSL construct `\valid_function' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_fun_lib.res.oracle0000666000000000000000000000140313571573400025452 0ustar [kernel:typing:implicit-function-declaration] tests/temporal/t_fun_lib.c:20: Warning: Calling undeclared function realpath. Old style K&R code? [e-acsl] beginning translation. [kernel:annot:missing-spec] tests/temporal/t_fun_lib.c:20: Warning: Neither code nor specification for function realpath, generating default assigns from the prototype [e-acsl] translation done in project "e-acsl". [eva:invalid-assigns] tests/temporal/t_fun_lib.c:20: Completely invalid destination for assigns clause *(x_0 + (0 ..)). Ignoring. [eva:invalid-assigns] tests/temporal/t_fun_lib.c:21: Completely invalid destination for assigns clause *(x_0 + (0 ..)). Ignoring. [eva:alarm] tests/temporal/t_fun_lib.c:23: Warning: assertion got status invalid (stopping propagation). frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_fun_ptr.res.oracle0000666000000000000000000000011713571573400025512 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_getenv.res.oracle0000666000000000000000000000302213571573400025323 0ustar [e-acsl] beginning translation. [e-acsl] Warning: annotating undefined function `getenv': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] FRAMAC_SHARE/libc/stdlib.h:486: Warning: E-ACSL construct `logic functions with labels' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/stdlib.h:486: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [eva:alarm] FRAMAC_SHARE/libc/stdlib.h:488: Warning: pointer comparison. assert \pointer_comparable((void *)__retres, (void *)0); [eva:alarm] FRAMAC_SHARE/libc/stdlib.h:488: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] FRAMAC_SHARE/libc/stdlib.h:488: Warning: function __gen_e_acsl_getenv: postcondition 'null_or_valid_result' got status unknown. [eva:alarm] tests/temporal/t_getenv.c:13: Warning: assertion got status unknown. [eva:alarm] tests/temporal/t_getenv.c:13: Warning: pointer comparison. assert \pointer_comparable((void *)g1, (void *)0); [eva:alarm] tests/temporal/t_getenv.c:13: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/temporal/t_getenv.c:14: Warning: assertion got status unknown. [eva:alarm] tests/temporal/t_getenv.c:14: Warning: pointer comparison. assert \pointer_comparable((void *)g2, (void *)0); [eva:alarm] tests/temporal/t_getenv.c:14: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_global_init.res.oracle0000666000000000000000000000011713571573400026320 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_labels.res.oracle0000666000000000000000000000011713571573400025277 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_lit_string.res.oracle0000666000000000000000000000011713571573400026213 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_local_init.res.oracle0000666000000000000000000000011713571573400026152 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_malloc-asan.res.oracle0000666000000000000000000000060413571573400026225 0ustar [e-acsl] beginning translation. [kernel:annot:missing-spec] FRAMAC_SHARE/libc/stdio.h:211: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/temporal/t_malloc-asan.c:28: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&q); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_malloc.res.oracle0000666000000000000000000000032613571573400025306 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/temporal/t_malloc.c:22: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_memcpy.res.oracle0000666000000000000000000000361713571573400025337 0ustar [e-acsl] beginning translation. [e-acsl] Warning: annotating undefined function `memcpy': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] Warning: annotating undefined function `memset': the generated program may miss memory instrumentation if there are memory-related annotations. [e-acsl] FRAMAC_SHARE/libc/string.h:92: Warning: E-ACSL construct `\separated' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:115: Warning: E-ACSL construct `logic functions with labels' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:115: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:118: Warning: E-ACSL construct `user-defined logic type' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:92: Warning: E-ACSL construct `logic functions with labels' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:93: Warning: E-ACSL construct `logic functions with labels' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:95: Warning: E-ACSL construct `\separated' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:95: Warning: E-ACSL construct `assigns clause in behavior' is not yet supported. Ignoring annotation. [e-acsl] FRAMAC_SHARE/libc/string.h:98: Warning: E-ACSL construct `logic functions performing read accesses' is not yet supported. Ignoring annotation. [e-acsl] translation done in project "e-acsl". [eva:alarm] FRAMAC_SHARE/libc/string.h:98: Warning: function __gen_e_acsl_memcpy: postcondition 'copied_contents' got status unknown. [eva:alarm] FRAMAC_SHARE/libc/string.h:118: Warning: function __gen_e_acsl_memset: postcondition 'acsl_c_equiv' got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_scope.res.oracle0000666000000000000000000000071113571573400025146 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:locals-escaping] tests/temporal/t_scope.c:10: Warning: locals {i} escaping the scope of a block of main through p [eva:locals-escaping] tests/temporal/t_scope.c:10: Warning: locals {i} escaping the scope of a block of main through q [eva:alarm] tests/temporal/t_scope.c:15: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_struct.res.oracle0000666000000000000000000000011713571573400025361 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/oracle_ci/t_while.res.oracle0000666000000000000000000000071713571573400025153 0ustar [e-acsl] beginning translation. [e-acsl] translation done in project "e-acsl". [eva:alarm] tests/temporal/t_while.c:28: Warning: function __e_acsl_assert: precondition got status unknown. [eva:alarm] tests/temporal/t_while.c:28: Warning: assertion got status unknown. [eva:alarm] tests/temporal/t_while.c:36: Warning: assertion got status unknown. [eva:alarm] tests/temporal/t_while.c:36: Warning: function __e_acsl_assert: precondition got status unknown. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_addr-by-val.c0000666000000000000000000000052313571573400022405 0ustar /* run.config COMMENT: Case when a pointer is taking address by value. */ #include int main (int argc, char **argv) { uintptr_t addr = (uintptr_t)&argc; char *p; int *q; q = &argc; /* Here the referent of p should be assigned from the value of addr */ p = (char*)addr; p = (char*)0x123456; p = (char*)q; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_args.c0000666000000000000000000000037113571573400021240 0ustar /* run.config COMMENT: Check that command line parameters are properly tracked */ #include int main(int argc, const char **argv) { /*@assert \valid(&argc); */ /*@assert \valid(argv); */ /*@assert \valid(*argv); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_array.c0000666000000000000000000000041613571573400021422 0ustar /* run.config COMMENT: Check temporal timestamps of arrays */ int main() { int a = 111, b = 222; int *src[3]; src[0] = &a; src[1] = &b; /*@assert \valid(src[0]); */ /*@assert \valid(src[1]); */ /*@assert ! \valid(src[2]); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_char.c0000666000000000000000000000073013571573400021220 0ustar /* run.config COMMENT: Check that when small blocks (such as char) are used the COMMENT: instrumentation adds alignment sufficient for tracking COMMENT: block origin number via shadowing */ int main(int argc, const char **argv) { char a = '1', b = '2'; /* Should fail here in debug mode due to overlapping shadow spaces of [a] and [b]*/ char *p = &a, *q = &b; p = q; /*@assert \valid(p); */ /*@assert \valid(q); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_darray.c0000666000000000000000000000162013571573400021564 0ustar /* run.config COMMENT: Checking propagation of referent numbers in arrays */ void area_triangle(double (*vertices)[4]) { /*@ assert rte: mem_access: \valid_read((double *)*(vertices + 0)); */ /*@ assert rte: mem_access: \valid_read((double *)*(vertices + 1)); */ return; } void abe_matrix(double (*vertices)[4]) { area_triangle(vertices); return; } double Vertices[3][4]; double Vertices2[3][4] = {}; int main(int argc, const char **argv) { double vertices[3][4] = { { 1.0, 2.0, 3.0, 4.0 }, { 5.0, 6.0, 7.0, 8.0 }, { 9.0, 10.0, 11.0, 12.0 } }; double vertices2[3][4]; double vertices3[3][4]; double triple_vertices[2][3][4]; double triple_vertices2[2][3][4] = {}; abe_matrix(vertices); abe_matrix(vertices2); abe_matrix(vertices3); abe_matrix(Vertices); abe_matrix(Vertices2); abe_matrix(triple_vertices[0]); abe_matrix(triple_vertices2[0]); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_dpointer.c0000666000000000000000000000056713571573400022137 0ustar /* run.config COMMENT: Simple case of double pointer dereference */ #include int main(void) { int **p = malloc(sizeof(int*)*3); int i = 0; while (i < 3) { /*@assert \valid(p+i); */ *(p+i) = malloc(sizeof(int)); /*@assert \valid(*(p+i)); */ i++; } free(*(p+2)); malloc(sizeof(int)); /*@assert ! \valid(*(p+2)); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_fptr.c0000666000000000000000000000052713571573400021262 0ustar /* run.config COMMENT: Check simple case of calling functions via pointer derefernce */ int* foo(int *p) { int *q = p; return q; } int main(int argc, const char **argv) { int *p = &argc, *q; int* (*fp)(int*) = &foo; fp = &foo; /*@assert \valid_function(fp); */ q = (*fp)(p); /*@assert \valid(q); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_fun_lib.c0000666000000000000000000000136413571573400021725 0ustar /* run.config COMMENT: Check handling library functions (without definitions) */ #include #include int main(void) { char *c = "."; /* Allocating function (such as malloc, recognized by name): - take block number of the returned pointer (after) */ char *p = malloc(PATH_MAX), *q = NULL; q = malloc(PATH_MAX); /*@assert \valid(q) && \valid(p); */ /* Function with no definition returning a pointer: same treatment as allocating function */ char *path = realpath(c, q); path = realpath(c, q); /*@assert \valid(path); */ /* Function with no definition and no return value: do nothing */ free(p); free(path); /*@assert ! \valid(p) && !\valid(path); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_fun_ptr.c0000666000000000000000000000144413571573400021763 0ustar /* run.config COMMENT: Check handling function definitions with pointer parameters */ #include #include int* pfun(char c, int *p, int *p2, int *p3, int *p4, int i) { int *q = p; return q; } int main(int argc, const char **argv) { int a = 1; int *p = &a; uintptr_t addr = (uintptr_t)&addr; /* Function with definition returning a pointer: - save all pointer parameters + call via pointer - save referent number + call via addressof - sabe block number + call via NULL - save invalid + call via value - save block number - store return referent in return handler - take referent number of the return value (via return handler) */ p = pfun('a', p, &a, NULL, (int*)addr, 2); /*@assert \valid(p); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_getenv.c0000666000000000000000000000053413571573400021575 0ustar /* run.config COMMENT: Check temporal validity of environment string (via getenv function) */ #include #include int main(int argc, const char **argv) { char *g1 = NULL; g1 = getenv("HOME"); char *g2 = getenv("PATH"); /*@assert g1 == \null || \valid(g1); */ /*@assert g2 == \null || \valid(g2); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_global_init.c0000666000000000000000000000231213571573400022564 0ustar /* run.config COMMENT: Check global compound variable initializers */ struct tree_desc { int *extra_bits ; }; typedef struct tree_desc tree_desc; struct tree_desc2 { struct tree_desc desc; }; typedef struct tree_desc2 tree_desc2; static int extra_lbits[] = {0}; static tree_desc l_desc = /* This bit should be tracked via globals_init function */ { .extra_bits = extra_lbits }; static tree_desc descs [2] = { { .extra_bits = extra_lbits }, { .extra_bits = extra_lbits } }; static tree_desc2 l_desc2 = { .desc = { .extra_bits = extra_lbits } }; static tree_desc2 descs2 [2] = { { .desc = { .extra_bits = extra_lbits } }, { .desc = { .extra_bits = extra_lbits } } }; void build_tree(tree_desc *desc) { int *extra; extra = desc->extra_bits; /*@assert \valid(extra); */ } const char * strings [2][2] = { { "the", "tha" }, { "thi", "tho" } }; int main(int argc, const char **argv) { build_tree(&l_desc); build_tree(&descs[0]); build_tree(&descs[1]); build_tree(&l_desc2.desc); build_tree(&descs2[0].desc); build_tree(&descs2[1].desc); char **p = (char**)&strings[0]; /*@assert \valid_read(p); */ /*@assert \valid_read(*p); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_labels.c0000666000000000000000000000105313571573400021544 0ustar /* run.config COMMENT: Check that statements generated via temporal analysis are handled COMMENT: properly, i.e., if a statement has a label attached then all COMMENT: the generated statements are inserted after that label */ void foo(int *a, int *b) { int t = *a; *a = *b; *b = t; } int *Q; int* bar() { RET: return Q; } int main(int argc, const char **argv) { int a = 11, b = 12; int *p = &a, *q = &b; LAB: foo(p, q); /*@assert \valid(p) && \valid(q); */ LAB2: q = p; /*@assert \valid(p); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_lit_string.c0000666000000000000000000000100113571573400022451 0ustar /* run.config COMMENT: Check handling of literal strings. Because literal strings are COMMENT: replaced by variables we need to make sure that we take block COMMENT: numbers and not referent numbers in assignments */ int main(void) { char *f = "f"; /*@assert \valid_read(f) && !\valid(f); */ char *g; g = "g"; /*@assert \valid_read(g) && !\valid(g); */ char *p = f; /*@assert \valid_read(p) && !\valid(p); */ char *q; q = f; /*@assert \valid_read(q) && !\valid(q); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_local_init.c0000666000000000000000000000311213571573400022415 0ustar /* run.config COMMENT: Check local compound variable initializers */ #include #include struct tree_desc { int *extra_bits ; }; typedef struct tree_desc tree_desc; struct tree_desc2 { struct tree_desc desc; }; typedef struct tree_desc2 tree_desc2; void build_tree(tree_desc *desc) { int *extra; extra = desc->extra_bits; /*@assert \valid(extra); */ } char * Strings [2][2] = { { "the", "tha" }, { "thi", "tho" } }; char * Str [4] = { "foo", "bar", "baz", NULL }; int main(int argc, const char **argv) { char * strings [2][2] = { { "the", "tha" }, { "thi", "tho" } }; char **p = (char**)&strings[0]; /*@assert \valid_read(p); */ /*@assert \valid_read(*p); */ char * str [4] = { "foo", "bar", "baz", NULL }; p = (char**)&str; /*@assert \valid_read(p); */ /*@assert \valid_read(*p); */ char **P = (char**)&Strings[0]; /*@assert \valid_read(P); */ /*@assert \valid_read(*P); */ P = (char**)&Str; /*@assert \valid_read(P); */ /*@assert \valid_read(*P); */ int extra_lbits[] = {0}; tree_desc l_desc = { .extra_bits = extra_lbits }; tree_desc descs [2] = { { .extra_bits = extra_lbits }, { .extra_bits = extra_lbits } }; tree_desc2 l_desc2 = { .desc = { .extra_bits = extra_lbits } }; tree_desc2 descs2 [2] = { { .desc = { .extra_bits = extra_lbits } }, { .desc = { .extra_bits = extra_lbits } } }; build_tree(&l_desc); build_tree(&descs[0]); build_tree(&descs[1]); build_tree(&l_desc2.desc); build_tree(&descs2[0].desc); build_tree(&descs2[1].desc); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_malloc-asan.c0000666000000000000000000000151213571573400022471 0ustar /* run.config COMMENT: Temporal analysis with respect dynamic memory allocation. COMMENT: malloc-free-malloc errors COMMENT: This test is a modification aiming targeting AddressSanitizer and COMMENT: Valgrind tools who are not capable of catching this bug */ #include #include #define MB (1024*1024) int main(void) { int *p, *q; int counter = 0; size_t limit = 10000; p = (int*)malloc(MB); q = p; free(p); /* Allocate and de-allocate a chunk of memory until allocator reuses address */ while (counter < limit) { p = (int*)malloc(MB); counter++; if (p != q) free(p); else { printf("Same address %p in %d steps\n", p, counter); break; } p = NULL; } if (p) { *q = 1; /* temporally invalid */ *p = 2; } free(p); return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_malloc.c0000666000000000000000000000147613571573400021562 0ustar /* run.config COMMENT: Temporal analysis with respect dynamic memory allocation. COMMENT: malloc-free-malloc errors */ #include int main(void) { int *p, *q; /*@assert ! \valid(p); */ /*@assert ! \valid(q); */ p = (int*)malloc(sizeof(int)); q = p; /*@assert \valid(p); */ /*@assert \valid(q); */ free(q); /*@assert ! \valid(p); */ /*@assert ! \valid(q); */ p = (int*)malloc(sizeof(int)); /* q is temporally invalid: points to the block allocated by the first malloc call which has been deallocated, while p is valid */ /*@assert \valid(p); */ /*@assert ! \valid(q);*/ *q = 1; *p = 2; /* ... and for calloc .. */ q = (char*)calloc(4096,1); /*@assert \valid(q); */ /* ... and and realloc */ q = (char*)realloc(q, 8192); /*@assert \valid(q); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_memcpy.c0000666000000000000000000000171113571573400021575 0ustar #include #include int main() { /* ********** STACK ********** */ int a = 111, b = 222; int *src[2], *dest[2]; int size = sizeof(int*)*2; src[0] = &a; src[1] = &b; /* FIXME: memcpy should initialize, since so far it does not do the initialization by hand */ dest[0] = NULL; dest[1] = NULL; /*@assert \valid(*src); */ /*@assert \valid(*(src + 1)); */ memcpy(&dest, &src, size); /*@ assert \valid(*dest); */ /*@ assert \valid(*(dest + 1)); */ memset(&dest, 0, size); /*@assert ! \valid(*dest); */ /*@assert ! \valid(*(dest + 1)); */ /* ********** HEAP ********** */ int **p = malloc(size); int **q = malloc(size); *p = &a; *(p+1) = &a; /*@assert \valid(*p); */ /*@assert \valid(*(p+1)); */ /*@assert ! \valid(*q); */ /*@assert ! \valid(*(q+1)); */ *q = *(q+1) = NULL; memcpy(q, p, size); /*@assert \valid(*q); */ /*@assert \valid(*(q+1)); */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_scope.c0000666000000000000000000000122413571573400021413 0ustar /* run.config COMMENT: Temporal analysis with respect to scopes */ #include int main() { int *p = NULL, *q = NULL; { int i = 9; p = &i; q = p; } /*@assert ! \valid(p); */ /*@assert ! \valid(q); */ { int j = 8; p = &j; /*@assert \valid(p); */ *p = 1; /* `q` now may point to `j`, bit not necessarily */ /*@assert ! \valid(q); */ /*@assert \valid(&j); */ } /* Example from Arvid's report (Listing 3.12) */ int len = 3; p = NULL, q = NULL; while (len) { int a; /*@assert ! \valid(p); */ q = &a; p = q; /*@assert \valid(p); */ len--; } return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_struct.c0000666000000000000000000000171613571573400021634 0ustar /* run.config COMMENT: Several basic cases involving assignments of structs */ /* Data types and typedefs {{{ */ #include struct temporal_t { char *p; char *q; }; struct larger_t { char *p; char *q; struct temporal_t t; }; typedef struct temporal_t temporal; typedef struct larger_t larger; /* }}} */ int main(void) { int a = 1, b = 2; temporal t1, t2, *tp, tarr[2]; larger l, *lp, larr[2]; t1.p = &a; t1.q = t1.p; /*@assert \valid(t1.p) && \valid(t1.q); */ /*@assert !\valid(t2.p) && !\valid(t2.q); */ t2 = t1; /*@assert \valid(t2.p) && \valid(t2.q); */ t2.p = NULL; t2.q = malloc(4); /*@assert ! \valid(t2.p) && \valid(t2.q); */ l.t = t2; /*@assert ! \valid(l.t.p) && \valid(l.t.q); */ lp = &l; /*@assert ! \valid(lp->t.p); */ tarr[0] = t2; /*@assert ! \valid(tarr[0].p) && \valid(tarr[0].q) ; */ larr[0] = l; /*@assert ! \valid(larr[0].t.p) && \valid(larr[0].t.q) ; */ return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/t_while.c0000666000000000000000000000226013571573400021413 0ustar /* run.config COMMENT: Off-by-one error where a pointer is made point to an adjacent block COMMENT: Note that this behaviour is not quaranteed by likely due to the COMMENT: way compiler allocates stack blocks */ #include #define intaddr(_x) ((uintptr_t)&_x) int main(void) { int i = 0; /* Assuming here that arr is allocated first, and arr2 is allocated second and that there is no gap betwee [arr] and [arr2]. This behaviour is compiler specific but still likely. At least this is the case for some current versions of GCC/Clang */ int arr [] = {1, 2, 3, 4}; int arr2 [] = {1, 2, 3, 4}; /* Check that the above condition holds, otherwise there is no point having this test */ if (!(intaddr(arr) + sizeof(arr) == intaddr(arr2))) return 0; int *q = arr; while (i < 4) { /*@assert \valid(q); */ *q = 1; /* This dereference of [q] is valid but the last [q++] */ i++; /* makes [q] point to [arr2] */ q++; } /* At this point the dereference is temporally invalid since [q] should store the referent number of [arr1] while in fact it points to [arr2] */ /*@assert ! \valid(q); */ // *q = 1; return 0; } frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/test_config_ci0000666000000000000000000000004513571573400022515 0ustar STDOPT: #"-e-acsl-temporal-validity" frama-c-20.0-Calcium/src/plugins/e-acsl/tests/temporal/test_config_dev0000666000000000000000000000055213571573400022703 0ustar DONTRUN: MACRO: DEST @PTEST_RESULT@/gen_@PTEST_NAME@ MACRO: OUT @PTEST_NAME@.res.log MACRO: ERR @PTEST_NAME@.err.log EXEC: ./scripts/e-acsl-gcc.sh --temporal -q -c -X --frama-c-extra="-journal-disable -verbose 0 -kernel-warn-key *=inactive" -o @DEST@.run.c -O @DEST@.out @PTEST_FILE@ > @PTEST_RESULT@/@OUT@ 2> @PTEST_RESULT@/@ERR@ && ./@DEST@.e-acsl > /dev/null frama-c-20.0-Calcium/src/plugins/e-acsl/tests/test_config_ci.in0000666000000000000000000000153113571573400021300 0ustar MACRO: DEST @PTEST_RESULT@/gen_@PTEST_NAME@ MACRO: GLOBAL -machdep gcc_x86_64 -variadic-no-translation -verbose 0 MACRO: EACSL -e-acsl -e-acsl-share ./share/e-acsl -e-acsl-verbose 1 MACRO: EVA -eva -eva-no-alloc-returns-null -eva-no-results -eva-no-print -eva-warn-key libc:unsupported-spec=inactive MACRO: EVENTUALLY -print -ocode @DEST@.c -load-script ./tests/print.cmxs LOG: gen_@PTEST_NAME@.c OPT: @GLOBAL@ @EACSL@ -then-last @EVA@ @EVENTUALLY@ FILTER:@SEDCMD@ -e "s|[a-zA-Z/\\]\+frama_c_project_e-acsl_[a-z0-9]*|PROJECT_FILE|" -e "s|$FRAMAC_SHARE|FRAMAC_SHARE|g" -e "s|../../share|FRAMAC_SHARE|g" -e "s|./share/e-acsl|FRAMAC_SHARE/e-acsl|g" -e "s|share/e-acsl|FRAMAC_SHARE/e-acsl|g" COMMENT: This regex works around the tendency of Frama-C to transform COMMENT: absolute path into relative ones whenever the file is not too far COMMENT: away from cwd. frama-c-20.0-Calcium/src/plugins/e-acsl/tests/test_config_dev.in0000666000000000000000000000053713571573400021470 0ustar MACRO: DEST @PTEST_RESULT@/@PTEST_NAME@ MACRO: OUT @PTEST_NAME@.res.log MACRO: ERR @PTEST_NAME@.err.log EXEC: BIN @DEST@.gcc.c ./scripts/e-acsl-gcc.sh -q -c -X --frama-c-extra="-journal-disable -verbose 0 -kernel-warn-key *=inactive" -o @DEST@.gcc.c -O @DEST@ @PTEST_FILE@ > @PTEST_RESULT@/@OUT@ 2> @PTEST_RESULT@/@ERR@ && ./@DEST@.e-acsl > /dev/null frama-c-20.0-Calcium/src/plugins/from/0000777000000000000000000000000013571573400014426 5ustar frama-c-20.0-Calcium/src/plugins/from/From.mli0000666000000000000000000000333513571573400016040 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: From.mli,v 1.6 2008-04-01 09:25:20 uid568 Exp $ *) (** No function is directly exported: they are registered in {!Db.From}. *) frama-c-20.0-Calcium/src/plugins/from/callwise.ml0000666000000000000000000002053313571573400016566 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_datatype module Tbl = Cil_state_builder.Kinstr_hashtbl (Function_Froms) (struct let name = "Callwise dependencies" let size = 17 let dependencies = [ Db.Value.self ] end) let () = From_parameters.ForceCallDeps.set_output_dependencies [Tbl.self] let merge_call_froms table callsite froms = try let current = Kinstr.Hashtbl.find table callsite in let new_froms = Function_Froms.join froms current in Kinstr.Hashtbl.replace table callsite new_froms with Not_found -> Kinstr.Hashtbl.add table callsite froms (** State for the analysis of one function call *) type from_state = { current_function: Kernel_function.t (** Function being analyzed *); value_initial_state: Db.Value.state (** State of Value at the beginning of the call *); table_for_calls: Function_Froms.t Kinstr.Hashtbl.t (** State of the From plugin for each statement containing a function call in the body of [current_function]. Updated incrementally each time Value analyses such a statement *); } (** The state of the callwise From analysis. Only the top of this callstack is accessed. New calls are pushed on the stack when Value starts the analysis of a function, and popped when the analysis finishes. This stack is manually synchronized with Value's callstack. *) let call_froms_stack : from_state list ref = ref [] let record_callwise_dependencies_in_db call_site froms = try let previous = Tbl.find call_site in Tbl.replace call_site (Function_Froms.join previous froms) with Not_found -> Tbl.add call_site froms let call_for_individual_froms (call_type, value_initial_state, call_stack) = if From_parameters.ForceCallDeps.get () then begin let current_function, call_site = List.hd call_stack in let register_from froms = try let { table_for_calls = table } = List.hd !call_froms_stack in merge_call_froms table call_site froms; record_callwise_dependencies_in_db call_site froms; with Failure _ -> From_parameters.fatal "calldeps internal error 23 empty callfromsstack %a" Kernel_function.pretty current_function in let compute_from_behaviors bhv = let assigns = Ast_info.merge_assigns bhv in let froms = From_compute.compute_using_prototype_for_state value_initial_state current_function assigns in register_from froms in match call_type with | `Def | `Memexec -> let table_for_calls = Kinstr.Hashtbl.create 7 in call_froms_stack := { current_function; value_initial_state; table_for_calls } :: !call_froms_stack | `Builtin { Value_types.c_from = Some (result,_) } -> register_from result | `Builtin { Value_types.c_from = None } -> let behaviors = !Db.Value.valid_behaviors current_function value_initial_state in compute_from_behaviors behaviors | `Spec spec -> compute_from_behaviors spec.Cil_types.spec_behavior end let end_record call_stack froms = let (current_function_value, call_site) = List.hd call_stack in record_callwise_dependencies_in_db call_site froms; (* pop + record in top of stack the froms of function that just finished *) match !call_froms_stack with | {current_function} :: ({table_for_calls = table} :: _ as tail) -> if current_function_value != current_function then From_parameters.fatal "calldeps %a != %a@." Kernel_function.pretty current_function Kernel_function.pretty current_function_value; call_froms_stack := tail; merge_call_froms table call_site froms | _ -> (* the entry point, probably *) Tbl.mark_as_computed (); call_froms_stack := [] module MemExec = State_builder.Hashtbl (Datatype.Int.Hashtbl) (Function_Froms) (struct let size = 17 let dependencies = [Tbl.self] let name = "From.Callwise.MemExec" end) let compute_call_from_value_states current_function states = let module To_Use = struct let get_from_call _f callsite = let { table_for_calls } = List.hd !call_froms_stack in try Kinstr.Hashtbl.find table_for_calls (Cil_types.Kstmt callsite) with Not_found -> raise From_compute.Call_did_not_take_place let get_value_state s = try Stmt.Hashtbl.find states s with Not_found -> Cvalue.Model.bottom let keep_base kf base = let fundec = Kernel_function.get_definition kf in not (Base.is_formal_or_local base fundec) let cleanup_and_save _kf froms = froms end in let module Callwise_Froms = From_compute.Make(To_Use) in Callwise_Froms.compute_and_return current_function let record_for_individual_froms (call_stack, value_res) = if From_parameters.ForceCallDeps.get () then begin let froms = match value_res with | Value_types.Normal (states, _after_states) | Value_types.NormalStore ((states, _after_states), _) -> let cur_kf, _ = List.hd call_stack in let froms = try if !Db.Value.no_results (Kernel_function.get_definition cur_kf) then Function_Froms.top else compute_call_from_value_states cur_kf (Lazy.force states) with Kernel_function.No_Definition -> Function_Froms.top in let pre_state = match !call_froms_stack with | [] -> assert false | { value_initial_state } :: _ -> value_initial_state in if From_parameters.VerifyAssigns.get () then !Db.Value.verify_assigns_froms cur_kf pre_state froms; (match value_res with | Value_types.NormalStore (_, memexec_counter) -> MemExec.replace memexec_counter froms | _ -> ()); froms | Value_types.Reuse counter -> MemExec.find counter in end_record call_stack froms end (* Register our callbacks inside the value analysis *) let () = From_parameters.ForceCallDeps.add_update_hook (fun _bold bnew -> if bnew then begin Db.Value.Call_Type_Value_Callbacks.extend_once call_for_individual_froms; Db.Value.Record_Value_Callbacks_New.extend_once record_for_individual_froms; end) let force_compute_all_calldeps ()= if Db.Value.is_computed () then Project.clear ~selection:(State_selection.with_dependencies Db.Value.self) (); !Db.Value.compute () (* Registration for call-wise from *) let () = Db.register_guarded_compute "From.compute_all_calldeps" Tbl.is_computed Db.From.compute_all_calldeps force_compute_all_calldeps; Db.From.Callwise.iter := Tbl.iter; Db.From.Callwise.find := Tbl.find (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/from/callwise.mli0000666000000000000000000000356113571573400016741 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Computation of callwise functional dependencies. The results are computed while the value analysis runs, and the results are usually much more precise than the functionwise results. Nothing is exported here, the API can be found in the Db.From.Callwise module *) frama-c-20.0-Calcium/src/plugins/from/from_compute.ml0000666000000000000000000006707713571573400017500 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil open Cil_datatype open Abstract_interp open Locations exception Call_did_not_take_place module type To_Use = sig val get_from_call : kernel_function -> stmt -> Function_Froms.t val get_value_state : stmt -> Db.Value.state val keep_base : kernel_function -> Base.t -> bool val cleanup_and_save : kernel_function -> Function_Froms.t -> Function_Froms.t end let rec find_deps_no_transitivity state expr = (* The value of the expression [expr], just before executing the statement [instr], is a function of the values of the returned zones. *) match expr.enode with | Info (e, _) -> find_deps_no_transitivity state e | AlignOfE _| AlignOf _| SizeOfStr _ |SizeOfE _| SizeOf _ | Const _ -> Function_Froms.Deps.bottom | AddrOf lv | StartOf lv -> let deps, _ = !Db.Value.lval_to_loc_with_deps_state (* loc ignored *) state ~deps:Zone.bottom lv in Function_Froms.Deps.from_data_deps deps | CastE (_, e)|UnOp (_, e, _) -> find_deps_no_transitivity state e | BinOp (_, e1, e2, _) -> Function_Froms.Deps.join (find_deps_no_transitivity state e1) (find_deps_no_transitivity state e2) | Lval v -> find_deps_lval_no_transitivity state v and find_deps_lval_no_transitivity state lv = let ind_deps, direct_deps, _exact = !Db.Value.lval_to_zone_with_deps_state state ~for_writing:false ~deps:(Some Zone.bottom) lv in From_parameters.debug "find_deps_lval_no_trs:@\n deps:%a@\n direct_deps:%a" Zone.pretty ind_deps Zone.pretty direct_deps; { Function_Froms.Deps.data = direct_deps; indirect = ind_deps } let compute_using_prototype_for_state state kf assigns = let varinfo = Kernel_function.get_vi kf in let return_deps,deps = match assigns with | WritesAny -> From_parameters.warning "@[no assigns clauses@ for function %a.@]@ \ Results will be imprecise." Kernel_function.pretty kf; Function_Froms.Memory.(top_return, top) | Writes assigns -> let (rt_typ,_,_,_) = splitFunctionTypeVI varinfo in let input_zone out ins = (* Technically out is unused, but there is a signature problem *) !Db.Value.assigns_inputs_to_zone state (Writes [out, ins]) in let treat_assign acc (out, ins) = try let (output_loc_under, output_loc_over, _deps) = !Db.Properties.Interp.loc_to_loc_under_over ~result:None state out.it_content in let input_zone = input_zone out ins in (* assign clauses do not let us specify address dependencies for now, so we assume it is all data dependencies *) let input_deps = Function_Froms.Deps.from_data_deps input_zone in (* Weak update of the over-approximation of the zones assigned *) let acc = Function_Froms.Memory.add_binding_loc ~exact:false acc output_loc_over input_deps in let output_loc_under_zone = Locations.enumerate_valid_bits_under Write output_loc_under in (* Now, perform a strong update on the zones that are guaranteed to be assigned (under-approximation) AND that do not depend on themselves. Note: here we remove an overapproximation from an underapproximation to get an underapproximation, which is not the usual direction. It works here because diff on non-top zones is an exact operation. *) let sure_out_zone = Zone.(if equal top input_zone then bottom else diff output_loc_under_zone input_zone) in let acc = Function_Froms.Memory.add_binding ~exact:true acc sure_out_zone input_deps in acc with Db.Properties.Interp.No_conversion -> From_parameters.result ~once:true ~current:true "Unable to extract assigns in %a" Kernel_function.pretty kf; acc in let treat_ret_assign acc (out, from) = let zone_from = input_zone out from in (* assign clauses do not let us specify address dependencies for now, so we assume it is all data dependencies *) let inputs_deps = Function_Froms.Deps.from_data_deps zone_from in try let coffs = !Db.Properties.Interp.loc_to_offset ~result:None out.it_content in List.fold_left (fun acc coff -> let (base,width) = bitsOffset rt_typ coff in let size = Int_Base.inject (Int.of_int width) in Function_Froms.Memory.(add_to_return ~start:base ~size ~m:acc inputs_deps) ) acc coffs with Db.Properties.Interp.No_conversion | SizeOfError _ -> From_parameters.result ~once:true ~current:true "Unable to extract a proper offset. \ Using FROM for the whole \\result"; let size = Bit_utils.sizeof rt_typ in Function_Froms.(Memory.add_to_return ~size ~m:acc inputs_deps) in let return_assigns, other_assigns = List.fold_left (fun (ra,oa) (loc,_ as a) -> if Logic_utils.is_result loc.it_content then a::ra,oa else ra,a::oa) ([],[]) assigns in let return_assigns = match return_assigns with | [] when Cil.isVoidType rt_typ -> Function_Froms.Memory.default_return | [] -> (* \from unspecified. *) let size = Bit_utils.sizeof rt_typ in Function_Froms.Memory.top_return_size size | _ -> List.fold_left treat_ret_assign Function_Froms.Memory.default_return return_assigns in return_assigns, List.fold_left treat_assign Function_Froms.Memory.empty other_assigns in { deps_return = return_deps; Function_Froms.deps_table = deps } module ZoneStmtMap = struct include Hptmap.Make(Stmt_Id)(Zone)(Hptmap.Comp_unused) (struct let v = [[]] end) (struct let l = [Ast.self] end) let join = let decide _k z1 z2 = Zone.join z1 z2 in join ~cache:(Hptmap_sig.PersistentCache "From_compute.ZoneStmtMap.join") ~symmetric:true ~idempotent:true ~decide end module Make (To_Use: To_Use) = struct type t' = { additional_deps_table : ZoneStmtMap.t; (** Additional control dependencies to add to all modified variables, coming from the control statements encountered so far (If, Switch). The statement information is used to remove the dependencies that are no longer useful, when we reach a statement that post-dominates the statement that gave rise to the dependency. *) additional_deps : Zone.t; (** Union of the sets in {!additional_deps_table} *) deps_table : Function_Froms.Memory.t (** dependency table *) } let call_stack : kernel_function Stack.t = Stack.create () (** Stack of function being processed *) (** Recreate the [additional_deps] field from [additional_deps_table] *) let rebuild_additional_deps map = ZoneStmtMap.fold (fun _ z accz -> Zone.join z accz) map Zone.bottom (** given a [Function_Froms.Deps.t], apply [f] on both components and merge the result: depending directly on an indirect dependency -> indirect, depending indirectly on a direct dependency -> indirect *) let merge_deps f deps = let open Function_Froms.Deps in let ind = f deps.indirect in let data = f deps.data in let ind = Zone.join data.indirect (to_zone ind) in let data = data.data in { data = data; indirect = ind } (** Bind all the variables of [b] to [Assigned \from \nothing]. This function is always called on local variables. We do *not* want to bind a local variable [v] to Unassigned, as otherwise we could get some dependencies that refer to [v] (when [v] is not guaranteed to be always assigned, or for padding in local structs), and that would need to be removed when v goes out of scope. Moreover, semantically, [v] *is* assigned (albeit to "uninitialized", which represents an indefinite part of the stack). We do not attempts to track this "uninitialized" information in From, as this is redundant with the work done by Value -- hence the use of [\nothing].*) let bind_locals m b = let aux_local acc vi = Cil.CurrentLoc.set vi.vdecl; (* Consider that local are initialized to a constant value *) Function_Froms.Memory.bind_var vi Function_Froms.Deps.bottom acc in let loc = Cil.CurrentLoc.get () in let r = List.fold_left aux_local m b.blocals in Cil.CurrentLoc.set loc; r let unbind_locals m b = let aux_local acc vi = Function_Froms.Memory.unbind_var vi acc in List.fold_left aux_local m b.blocals let find stmt deps_tbl expr = let state = To_Use.get_value_state stmt in let pre_trans = find_deps_no_transitivity state expr in merge_deps (fun d -> Function_Froms.Memory.find_precise deps_tbl d) pre_trans let lval_to_zone_with_deps stmt ~for_writing lv = let state = To_Use.get_value_state stmt in !Db.Value.lval_to_zone_with_deps_state state ~deps:(Some Zone.bottom) ~for_writing lv let lval_to_precise_loc_with_deps stmt ~for_writing lv = let state = To_Use.get_value_state stmt in let deps, loc = !Db.Value.lval_to_precise_loc_with_deps_state state ~deps:(Some Zone.bottom) lv in let exact = Precise_locs.valid_cardinal_zero_or_one ~for_writing loc in deps, loc, exact let empty_from = { additional_deps_table = ZoneStmtMap.empty; additional_deps = Zone.bottom; deps_table = Function_Froms.Memory.empty } let bottom_from = { additional_deps_table = ZoneStmtMap.empty; additional_deps = Zone.bottom; deps_table = Function_Froms.Memory.bottom } module Computer = struct type t = t' let bottom = bottom_from;; let callwise_states_with_formals = Stmt.Hashtbl.create 7 let substitute call_site_froms extra_loc deps = let subst_deps = Function_Froms.Memory.substitute call_site_froms deps in Function_Froms.Deps.add_indirect_dep subst_deps extra_loc let display_one_from fmt v = Function_Froms.Memory.pretty fmt v.deps_table; Format.fprintf fmt "Additional Variable Map : %a@\n" ZoneStmtMap.pretty v.additional_deps_table; Format.fprintf fmt "Additional Variable Map Set : %a@\n" Zone.pretty v.additional_deps let pretty fmt (v: t) = display_one_from fmt v let transfer_conditional_exp s exp state = let additional = find s state.deps_table exp in let additional = Function_Froms.Deps.to_zone additional in {state with additional_deps_table = ZoneStmtMap.add s additional state.additional_deps_table; additional_deps = Zone.join additional state.additional_deps } let join_and_is_included new_ old = let additional_map, additional_zone, included = let mold = old.additional_deps_table in let mnew = new_.additional_deps_table in let zold = old.additional_deps in let m = ZoneStmtMap.join mnew mold in if ZoneStmtMap.equal m mold then mold, zold, true else let new_z = Zone.join old.additional_deps new_.additional_deps in m, new_z, false in let map = Function_Froms.Memory.join new_.deps_table old.deps_table in let included' = Function_Froms.Memory.is_included new_.deps_table old.deps_table in { deps_table = map; additional_deps_table = additional_map; additional_deps = additional_zone; }, included && included' let join old new_ = fst (join_and_is_included old new_) let is_included old new_ = snd (join_and_is_included old new_) (** Handle an assignment [lv = ...], the dependencies of the right-hand side being stored in [deps_right]. [init] is true for a local initialization, in which case the left location is not reduced to its valid part for a writing, in order to keep the const local variables. *) let transfer_assign stmt ~init lv deps_right state = (* The assigned location is [loc], whose address is computed from [deps]. *) let deps, loc, exact = lval_to_precise_loc_with_deps stmt ~for_writing:(not init) lv in let deps_of_deps = Function_Froms.Memory.find state.deps_table deps in let all_indirect = Zone.join state.additional_deps deps_of_deps in let deps = Function_Froms.Deps.add_indirect_dep deps_right all_indirect in let access = if init then Read else Write in { state with deps_table = Function_Froms.Memory.add_binding_precise_loc ~exact access state.deps_table loc deps } let transfer_call stmt dest f args _loc state = !Db.progress (); let value_state = To_Use.get_value_state stmt in let f_deps, called_vinfos = !Db.Value.expr_to_kernel_function_state value_state ~deps:(Some Zone.bottom) f in (* dependencies for the evaluation of [f] *) let f_deps = Function_Froms.Memory.find state.deps_table f_deps in let additional_deps = Zone.join state.additional_deps f_deps in let args_froms = List.map (fun arg -> (* TODO : dependencies on subfields for structs *) find stmt state.deps_table arg) args in let states_with_formals = ref [] in let do_on kf = let called_vinfo = Kernel_function.get_vi kf in if Ast_info.is_frama_c_builtin called_vinfo.vname then state else let froms_call = To_Use.get_from_call kf stmt in let froms_call_table = froms_call.Function_Froms.deps_table in if Function_Froms.Memory.is_bottom froms_call_table then bottom_from else let formal_args = Kernel_function.get_formals kf in let state_with_formals = ref state.deps_table in begin try List.iter2 (fun vi from -> state_with_formals := Function_Froms.Memory.bind_var vi from !state_with_formals; ) formal_args args_froms; with Invalid_argument _ -> From_parameters.warning ~once:true ~current:true "variadic call detected. Using only %d argument(s)." (min (List.length formal_args) (List.length args_froms)) end; if not (Db.From.Record_From_Callbacks.is_empty ()) then states_with_formals := (kf, !state_with_formals) :: !states_with_formals; let subst_before_call = substitute !state_with_formals additional_deps in (* From state just after the call, but before the result assignment *) let deps_after_call = let before_call = state.deps_table in let open Function_Froms in let subst d = DepsOrUnassigned.subst subst_before_call d in let call_substituted = Memory.map subst froms_call_table in Memory.compose call_substituted before_call in let state = {state with deps_table = deps_after_call } in (* Treatement for the possible assignment of the call result *) match dest with | None -> state | Some lv -> let return_from = froms_call.Function_Froms.deps_return in let deps_ret = subst_before_call return_from in let init = Cil.is_mutable_or_initialized lv in transfer_assign stmt ~init lv deps_ret state in let f f acc = let p = do_on f in match acc with | None -> Some p | Some acc_memory -> Some {state with deps_table = Function_Froms.Memory.join p.deps_table acc_memory.deps_table} in let result = try (match Kernel_function.Hptset.fold f called_vinfos None with | None -> state | Some s -> s); with Call_did_not_take_place -> state in if not (Db.From.Record_From_Callbacks.is_empty ()) then Stmt.Hashtbl.replace callwise_states_with_formals stmt !states_with_formals; result let transfer_instr stmt (i: instr) (state: t) = !Db.progress (); match i with | Set (lv, exp, _) -> let comp_vars = find stmt state.deps_table exp in let init = Cil.is_mutable_or_initialized lv in transfer_assign stmt ~init lv comp_vars state | Local_init(v, AssignInit i, _) -> let rec aux lv i acc = let doinit o i _ state = aux (Cil.addOffsetLval o lv) i state in match i with | SingleInit e -> let comp_vars = find stmt acc.deps_table e in transfer_assign stmt ~init:true lv comp_vars acc | CompoundInit (ct, initl) -> (* To avoid a performance issue, do not fold implicit initializers of scalar or large arrays. We still use implicit initializers for small struct arrays, as this may be more precise in case of padding bits. The 100 limit is arbitrary. *) let implicit = not (Cil.isArrayType ct && (Cil.isArithmeticOrPointerType (Cil.typeOf_array_elem ct) || Ast_info.array_size ct > (Integer.of_int 100))) in let r = Cil.foldLeftCompound ~implicit ~doinit ~ct ~initl ~acc in if implicit then r else (* If implicit zero-initializers have been skipped, also mark the entire array as initialized from no dependency (nothing is read by the implicit zero-initializers). *) transfer_assign stmt ~init:true lv Function_Froms.Deps.bottom r in aux (Cil.var v) i state | Call (lvaloption,funcexp,argl,loc) -> transfer_call stmt lvaloption funcexp argl loc state | Local_init (v, ConsInit(f, args, kind), loc) -> Cil.treat_constructor_as_func (transfer_call stmt) v f args kind loc state | Asm _ | Code_annot _ | Skip _ -> state let transfer_guard s e d = let value_state = To_Use.get_value_state s in let interpreted_e = !Db.Value.eval_expr value_state e in let t1 = unrollType (typeOf e) in let do_then, do_else = if isIntegralType t1 || isPointerType t1 then Cvalue.V.contains_non_zero interpreted_e, Cvalue.V.contains_zero interpreted_e else true, true (* TODO: a float condition is true iff != 0.0 *) in (if do_then then d else bottom), (if do_else then d else bottom) ;; (* Eliminate additional variables originating from a control-flow branching statement closing at [s]. *) let eliminate_additional s data = let kf = Stack.top call_stack in let map = data.additional_deps_table in let map' = ZoneStmtMap.fold (fun k _v acc_map -> if !Db.Postdominators.is_postdominator kf ~opening:k ~closing:s then ZoneStmtMap.remove k acc_map else acc_map ) map map in if not (map == map') then { data with additional_deps_table = map'; additional_deps = rebuild_additional_deps map'; } else data let transfer_stmt s data = let data = eliminate_additional s data in let map_on_all_succs new_data = List.map (fun x -> (x,new_data)) s.succs in match s.skind with | Instr i -> map_on_all_succs (transfer_instr s i data) | If(exp,_,_,_) -> let data = transfer_conditional_exp s exp data in Dataflows.transfer_if_from_guard transfer_guard s data | Switch(exp,_,_,_) -> let data = transfer_conditional_exp s exp data in Dataflows.transfer_switch_from_guard transfer_guard s data | Return _ | Throw _ -> [] | UnspecifiedSequence _ | Loop _ | Block _ | Goto _ | Break _ | Continue _ | TryExcept _ | TryFinally _ | TryCatch _ -> map_on_all_succs data ;; (* Filter out unreachable values. *) let transfer_stmt s d = if Db.Value.is_reachable (To_Use.get_value_state s) && not (Function_Froms.Memory.is_bottom d.deps_table) then transfer_stmt s d else [] let doEdge s succ d = if Db.Value.is_reachable (To_Use.get_value_state succ) then let dt = d.deps_table in let opened = Kernel_function.blocks_opened_by_edge s succ in let closed = Kernel_function.blocks_closed_by_edge s succ in let dt = List.fold_left bind_locals dt opened in let dt = List.fold_left unbind_locals dt closed in { d with deps_table = dt } else bottom_from (* Filter the outgoing data using doEdge. *) let transfer_stmt s d = let ds = transfer_stmt s d in List.map (fun (succ, d) -> (succ, doEdge s succ d)) ds ;; end (* Remove all local variables and formals from table *) let externalize return kf state = let deps_return = (match return.skind with | Return (Some ({enode = Lval v}),_) -> let deps, target, _exact = lval_to_zone_with_deps ~for_writing:false return v in let z = Zone.join target deps in let deps = Function_Froms.Memory.find_precise state.deps_table z in let size = Bit_utils.sizeof (Cil.typeOfLval v) in Function_Froms.(Memory.add_to_return ~size deps) | Return (None,_) -> Function_Froms.Memory.default_return | _ -> assert false) in let accept = To_Use.keep_base kf in let deps_table = Function_Froms.Memory.filter_base accept state.deps_table in { deps_return = deps_return; Function_Froms.deps_table = deps_table } let compute_using_cfg kf = match kf.fundec with | Declaration _ -> assert false | Definition (f,_) -> if !Db.Value.no_results f then Function_Froms.top else try Stack.iter (fun g -> if kf == g then begin if Db.Value.ignored_recursive_call kf then From_parameters.error "during dependencies computations for %a, \ ignoring probable recursive" Kernel_function.pretty kf; raise Exit end) call_stack; Stack.push kf call_stack; let state = { empty_from with deps_table = bind_locals empty_from.deps_table f.sbody } in let module Fenv = (val Dataflows.function_env kf: Dataflows.FUNCTION_ENV) in let module Dataflow_arg = struct include Computer let init = [(Kernel_function.find_first_stmt kf, state)] end in let module Compute = Dataflows.Simple_forward(Fenv)(Dataflow_arg) in let ret_id = Kernel_function.find_return kf in if not (Db.From.Record_From_Callbacks.is_empty ()) then begin From_parameters.feedback "Now calling From callbacks"; let states = Stmt.Hashtbl.create Fenv.nb_stmts in Compute.iter_on_result (fun k record -> Stmt.Hashtbl.add states k record.deps_table); Db.From.Record_From_Callbacks.apply (call_stack, states, Dataflow_arg.callwise_states_with_formals) end; let _poped = Stack.pop call_stack in let last_from = try if Db.Value.is_reachable (To_Use.get_value_state ret_id) then externalize ret_id kf Compute.before.(Fenv.to_ordered ret_id) else raise Not_found with Not_found -> begin From_parameters.result "Non-terminating function %a (no dependencies)" Kernel_function.pretty kf; { Function_Froms.deps_return = Function_Froms.Memory.default_return; deps_table = Function_Froms.Memory.bottom } end in last_from with Exit (* Recursive call *) -> { Function_Froms.deps_return = Function_Froms.Memory.default_return; deps_table = Function_Froms.Memory.empty } let compute_using_prototype kf = let state = Db.Value.get_initial_state kf in let behaviors = !Db.Value.valid_behaviors kf state in let assigns = Ast_info.merge_assigns behaviors in compute_using_prototype_for_state state kf assigns let compute_and_return kf = let call_site_loc = CurrentLoc.get () in From_parameters.feedback "Computing for function %a%s" Kernel_function.pretty kf (let s = ref "" in Stack.iter (fun kf -> s := !s^" <-"^(Format.asprintf "%a" Kernel_function.pretty kf)) call_stack; !s); !Db.progress (); let result = if !Db.Value.use_spec_instead_of_definition kf then compute_using_prototype kf else compute_using_cfg kf in let result = To_Use.cleanup_and_save kf result in From_parameters.feedback "Done for function %a" Kernel_function.pretty kf; !Db.progress (); CurrentLoc.set call_site_loc; result let compute kf = !Db.Value.compute (); ignore (compute_and_return kf) end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/from/from_compute.mli0000666000000000000000000000714613571573400017640 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Module implementing the computation of functional dependencies *) open Cil_types (** Computations of From can be done Functionwise (one result per function), or Callwise (one result by call). The signature [To_Use] is used to describe the functions that are different between the two implementations.*) module type To_Use = sig (** How to find the Froms for a given call during the analysis. *) val get_from_call : kernel_function -> stmt -> Function_Froms.t (** How to find the state of Value at a given statement during the analysis.*) val get_value_state : stmt -> Db.Value.state val keep_base : kernel_function -> Base.t -> bool (** Return true if the given base is in scope after a call to the given function. (In particular, formals and locals of the function must result in [false].) *) (** Clean the given from (that have been computed for the given function), optionally save them, and return the cleaned result. *) val cleanup_and_save : kernel_function -> Function_Froms.t -> Function_Froms.t end (** Function that compute the Froms from a given prototype, called in the given state *) val compute_using_prototype_for_state : Db.Value.state -> Kernel_function.t -> assigns -> Function_Froms.froms (** Direct computation of the dependencies on expressions, offsets and lvals. The state at the statement is taken from Values_To_Use *) val find_deps_no_transitivity : Db.Value.state -> exp -> Function_Froms.Deps.t val find_deps_lval_no_transitivity : Db.Value.state -> lval -> Function_Froms.Deps.t (** Functor computing the functional dependencies, according to the three modules above. *) module Make (To_Use: To_Use) : sig (** Compute the dependencies of the given function, and return them *) val compute_and_return : Kernel_function.t -> Function_Froms.t (** Compute the dependencies of the given function *) val compute : Kernel_function.t -> unit end (** Exception indicating that a given call statement was not evaluated. *) exception Call_did_not_take_place frama-c-20.0-Calcium/src/plugins/from/from_parameters.ml0000666000000000000000000000511413571573400020147 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "from analysis" let shortname = "from" let help = "functional dependencies" end) module ForceDeps = WithOutput (struct let option_name = "-deps" let help = "force dependencies display" let output_by_default = true end) module ForceCallDeps = WithOutput (struct let option_name = "-calldeps" let help = "force callsite-wise dependencies" let output_by_default = true end) module ShowIndirectDeps = False (struct let option_name = "-show-indirect-deps" let help = "experimental" end) module VerifyAssigns = False (struct let option_name = "-from-verify-assigns" let help = "verification of assigns/from clauses for functions with \ bodies. Implies -calldeps" end) let () = VerifyAssigns.add_set_hook (fun _ new_ -> if new_ then ForceCallDeps.set true) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/from/from_parameters.mli0000666000000000000000000000375613571573400020332 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S (** Option -deps *) module ForceDeps: Parameter_sig.With_output (** Option -calldeps. @plugin development guide *) module ForceCallDeps: Parameter_sig.With_output (** Option -show-indirect-deps *) module ShowIndirectDeps: Parameter_sig.Bool (** Option -from-verify-assigns. *) module VerifyAssigns: Parameter_sig.Bool (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/from/from_register.ml0000666000000000000000000001514613571573400017636 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types let pretty_with_indirect fmt v = let deps = !Db.From.get v in Function_Froms.pretty_with_type_indirect (Kernel_function.get_type v) fmt deps let display fmtopt = Extlib.may (fun fmt -> Format.fprintf fmt "@[") fmtopt; Callgraph.Uses.iter_in_rev_order (fun kf -> if !Db.Value.is_called kf then let header fmt = Format.fprintf fmt "Function %a:" Kernel_function.pretty kf in let pretty = if From_parameters.ShowIndirectDeps.get () then pretty_with_indirect else !Db.From.pretty in match fmtopt with | None -> From_parameters.printf ~header "@[ %a@]" pretty kf | Some fmt -> Format.fprintf fmt "@[%t@]@ @[ %a]" header pretty kf ); Extlib.may (fun fmt -> Format.fprintf fmt "@]") fmtopt module SortCalls = struct type t = stmt (* Sort first by original source code location, then by sid *) let compare s1 s2 = let r = Cil_datatype.Location.compare (Cil_datatype.Stmt.loc s1) (Cil_datatype.Stmt.loc s2) in if r = 0 then Cil_datatype.Stmt.compare s1 s2 (* This is not really stable, but no good criterion is left *) else r end module MapStmtCalls = FCMap.Make(SortCalls) let iter_callwise_calls_sorted f = let hkf = Kernel_function.Hashtbl.create 17 in let kglobal = ref None in !Db.From.Callwise.iter (fun ki d -> match ki with | Kglobal -> kglobal := Some d | Kstmt s -> let kf = Kernel_function.find_englobing_kf s in let m = try Kernel_function.Hashtbl.find hkf kf with Not_found -> MapStmtCalls.empty in let m = MapStmtCalls.add s d m in Kernel_function.Hashtbl.replace hkf kf m ); Callgraph.Uses.iter_in_rev_order (fun kf -> try let m = Kernel_function.Hashtbl.find hkf kf in MapStmtCalls.iter (fun s d -> f (Kstmt s) d) m with Not_found -> () ); match !kglobal with | None -> () | Some d -> f Kglobal d let main () = let not_quiet = From_parameters.verbose_atleast 1 in let forcedeps = From_parameters.ForceDeps.get () in let forcecalldeps = From_parameters.ForceCallDeps.get () in let treat_call s funtype = let caller = Kernel_function.find_englobing_kf s in let f, typ_f = if !Db.Value.no_results (Kernel_function.get_definition caller) then "", funtype else try let set = Db.Value.call_to_kernel_function s in let kf = Kernel_function.Hptset.choose set in Pretty_utils.to_string Kernel_function.pretty kf, Kernel_function.get_type kf with | Not_found -> From_parameters.fatal ~source:(fst (Cil_datatype.Stmt.loc s)) "Invalid call %a@." Printer.pp_stmt s in (fun fmt -> Format.fprintf fmt "@[call to %s at %a (by %a)%t:@]" f Cil_datatype.Location.pretty (Cil_datatype.Stmt.loc s) Kernel_function.pretty caller (fun fmt -> if From_parameters.debug_atleast 1 then Format.fprintf fmt " " s.Cil_types.sid) ), typ_f in if forcedeps then begin !Db.From.compute_all (); From_parameters.ForceDeps.output (fun () -> From_parameters.feedback "====== DEPENDENCIES COMPUTED ======@\n\ These dependencies hold at termination for the executions that terminate:"; display None; From_parameters.feedback "====== END OF DEPENDENCIES ======" ) end; if forcecalldeps then !Db.From.compute_all_calldeps (); if not_quiet && forcecalldeps then begin From_parameters.ForceCallDeps.output (fun () -> From_parameters.feedback "====== DISPLAYING CALLWISE DEPENDENCIES ======"; iter_callwise_calls_sorted (fun ki d -> let header, typ = match ki with | Kglobal -> (fun fmt -> Format.fprintf fmt "@[entry point:@]"), Kernel_function.get_type (fst (Globals.entry_point ())) | Kstmt ({skind = Instr (Call (_, ekf, _, _))} as s) -> treat_call s (Cil.typeOf ekf) | Kstmt ({skind = Instr (Local_init(_,ConsInit(f,_,_),_))} as s)-> treat_call s f.vtype | _ -> assert false (* Not a call *) in From_parameters.printf ~header "@[ %a@]" ((if From_parameters.ShowIndirectDeps.get () then Function_Froms.pretty_with_type_indirect else Function_Froms.pretty_with_type) typ) d); From_parameters.feedback "====== END OF CALLWISE DEPENDENCIES ======"; ) end let () = Db.Main.extend main let access_from zone mem = Function_Froms.Memory.find mem zone (* Registration for most Db.From functions is done at the end of the Functionwise and Callwise modules *) let () = Db.From.display := (fun fmt -> display (Some fmt)); Db.From.access := access_from; (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/from/from_register.mli0000666000000000000000000000327113571573400020003 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Registration of the From plugin in Frama-C main loop. Nothing is exported in this module *) frama-c-20.0-Calcium/src/plugins/from/from_register_gui.ml0000666000000000000000000000472013571573400020476 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types let main (main_ui:Design.main_window_extension_points) = let filetree_selector ~was_activated ~activating node = (* [JS 2009/30/03] GUI may become too slow if froms are displayed *) if false && Db.Value.is_computed () then begin if not was_activated && activating then begin match node with | Filetree.Global (Cil_types.GFun ({svar=v},_)) -> begin try let kf = Globals.Functions.get v in if !Db.From.is_computed kf then main_ui#pretty_information "@[Functional dependencies:@\n%a@]@." !Db.From.pretty kf with Not_found -> () end | _ -> (); end; end in main_ui#file_tree#add_select_function filetree_selector let () = Design.register_extension main (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/from/from_register_gui.mli0000666000000000000000000000336613571573400020654 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Extension of the GUI in order to support the from analysis. No function is exported. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/from/functionwise.ml0000666000000000000000000001127613571573400017504 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Locations module Tbl = Kernel_function.Make_Table (Function_Froms) (struct let name = "Functionwise dependencies" let size = 17 let dependencies = [ Db.Value.self ] end) let () = From_parameters.ForceDeps.set_output_dependencies [Tbl.self] (* Forward reference to a function computing the from for a given function *) let force_compute = ref (fun _ -> assert false) module To_Use = struct let get_value_state s = Db.Value.get_stmt_state s let memo kf = Tbl.memo (fun kf -> !force_compute kf; try Tbl.find kf with Not_found -> invalid_arg "could not compute dependencies") kf let get_from_call kf _ = memo kf let keep_base kf = (* Eta-expansion required *) Callgraph.Uses.accept_base ~with_formals:false ~with_locals:false kf let cleanup kf froms = if Function_Froms.Memory.is_bottom froms.Function_Froms.deps_table then froms else let f b intervs = if Callgraph.Uses.accept_base ~with_formals:true ~with_locals:false kf b then Zone.inject b intervs else Zone.bottom in let joiner = Zone.join in let projection _ = Int_Intervals.top in let zone_substitution = Zone.cached_fold ~cache_name:"from cleanup" ~temporary:true ~f ~joiner ~empty:Zone.bottom ~projection in let zone_substitution x = try zone_substitution x with Abstract_interp.Error_Top -> Zone.top in let map_zone = Function_Froms.Deps.map zone_substitution in let subst = Function_Froms.DepsOrUnassigned.subst map_zone in let open Function_Froms in { deps_table = Memory.map subst froms.deps_table; deps_return = Deps.map zone_substitution froms.deps_return; } let cleanup_and_save kf froms = let froms = cleanup kf froms in Tbl.add kf froms; froms end module From = From_compute.Make(To_Use) let () = force_compute := From.compute let force_compute_all () = !Db.Value.compute (); Callgraph.Uses.iter_in_rev_order (fun kf -> if Kernel_function.is_definition kf && !Db.Value.is_called kf then !Db.From.compute kf) (* Db Registration for function-wise from *) let () = Db.From.self := Tbl.self; Db.From.is_computed := Tbl.mem; Db.From.compute := (fun kf -> ignore (To_Use.memo kf)); Db.From.get := To_Use.memo; Db.From.pretty := (fun fmt v -> let deps = To_Use.memo v in Function_Froms.pretty_with_type (Kernel_function.get_type v) fmt deps); Db.From.find_deps_no_transitivity := (fun stmt lv -> let state = Db.Value.get_stmt_state stmt in let deps = From_compute.find_deps_no_transitivity state lv in Function_Froms.Deps.to_zone deps); (* Once this function has been moved to Eva, remove the dependency of Inout from From. *) Db.From.find_deps_no_transitivity_state := (fun s e -> let deps = From_compute.find_deps_no_transitivity s e in Function_Froms.Deps.to_zone deps); ignore ( Db.register_compute "From.compute_all" [Tbl.self] Db.From.compute_all force_compute_all); (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/from/functionwise.mli0000666000000000000000000000345513571573400017655 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Computation of functional dependencies. In this module, the results are computed from the synthetic results of the value analysis. Nothing is exported here, the API can be found in the Db.From module *) frama-c-20.0-Calcium/src/plugins/gui/0000777000000000000000000000000013571573400014247 5ustar frama-c-20.0-Calcium/src/plugins/gui/GSourceView2.ml.in0000666000000000000000000000407413571573400017477 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** compatibility layer between gtksourceview 2 and 3. *) include GSourceView2 let make_marker_attributes ~(source:source_view) ~(category:string) ~(priority: int) ?(background: Gdk.color option) ?(pixbuf:GdkPixbuf.pixbuf option) ?(icon_name:string option) () = ignore icon_name; (* not in lablgtk2. *) source#set_mark_category_priority ~category priority; source#set_mark_category_pixbuf ~category pixbuf; source#set_mark_category_background ~category background frama-c-20.0-Calcium/src/plugins/gui/GSourceView2.mli.in0000666000000000000000000000355313571573400017651 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* compatibility between gtksourceview 2 and 3. *) include module type of GSourceView2 val make_marker_attributes: source:source_view -> category:string -> priority: int -> ?background: Gdk.color -> ?pixbuf:GdkPixbuf.pixbuf -> ?icon_name:string -> unit -> unit frama-c-20.0-Calcium/src/plugins/gui/GSourceView3.ml.in0000666000000000000000000000417713571573400017504 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** compatibility layer between gtksourceview 2 and 3. *) include GSourceView3 let make_marker_attributes ~(source:source_view) ~(category:string) ~(priority: int) ?(background: Gdk.rgba option) ?(pixbuf:GdkPixbuf.pixbuf option) ?(icon_name:string option) () = let my_attributes = GSourceView3.source_mark_attributes () in Extlib.may my_attributes#set_background background; Extlib.may my_attributes#set_pixbuf pixbuf; Extlib.may my_attributes#set_icon_name icon_name; source#set_mark_attributes ~category my_attributes priority frama-c-20.0-Calcium/src/plugins/gui/GSourceView3.mli.in0000666000000000000000000000355213571573400017651 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* compatibility between gtksourceview 2 and 3. *) include module type of GSourceView3 val make_marker_attributes: source:source_view -> category:string -> priority: int -> ?background: Gdk.rgba -> ?pixbuf:GdkPixbuf.pixbuf -> ?icon_name:string -> unit -> unit frama-c-20.0-Calcium/src/plugins/gui/analyses_manager.ml0000666000000000000000000001060113571573400020110 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let filter name extension = let f = GFile.filter ~name () in f#add_pattern ("*" ^ extension); f let run title filter_name extension loader (host_window: Design.main_window_extension_points) = let dialog = GWindow.file_chooser_dialog ~action:`OPEN ~title ~parent:host_window#main_window () in dialog#add_button_stock `CANCEL `CANCEL ; dialog#add_select_button_stock `EXECUTE `EXECUTE ; dialog#add_filter (filter filter_name extension); host_window#protect ~cancelable:true ~parent:(dialog :> GWindow.window_skel) (fun () -> match dialog#run () with | `EXECUTE -> let run f = loader f; !Db.Main.play (); host_window#reset () in Extlib.may run dialog#filename; | `DELETE_EVENT | `CANCEL -> ()); dialog#destroy () let run_module = run "Load an OCaml object file" "OCaml objects" ".ml,.cmo,.cma,.cmxs" Dynamic.load_module let insert (main_ui: Design.main_window_extension_points) = let menu_manager = main_ui#menu_manager () in let stop = ref (fun () -> assert false) (* delayed *) in let stop_sensitive = ref false (* can the stop button be clicked? *) in let default_analyses_items = menu_manager#add_plugin [ Menu_manager.toolmenubar ~icon:`PROPERTIES ~label:"Analyses" ~tooltip:"Configure and run analyses" (Menu_manager.Unit_callback main_ui#launcher); Menu_manager.menubar ~icon:`EXECUTE "Load and run an OCaml Module" (Menu_manager.Unit_callback (fun () -> run_module main_ui)); Menu_manager.toolbar ~sensitive:(fun () -> !stop_sensitive) ~icon:`STOP ~label:"Stop" ~tooltip:"Stop currently running analyses" (Menu_manager.Unit_callback (fun () -> !stop ())); ] in default_analyses_items.(0)#add_accelerator `CONTROL 'r'; let stop_button = Extlib.the default_analyses_items.(2)#tool_button in let old_progress = ref !Db.progress in stop := (fun () -> Db.progress := (fun () -> Db.progress := !old_progress; raise Db.Cancel)); Gtk_helper.register_locking_machinery ~lock_last:true ~lock:(fun cancelable -> if !stop_sensitive then Gui_parameters.warning "Inconsistent state for stop button. Ignoring."; old_progress := !Db.progress; menu_manager#set_sensitive false; if cancelable then (stop_button#misc#set_sensitive true; stop_sensitive := true); ) ~unlock:(fun () -> Db.progress := !old_progress; menu_manager#set_sensitive true; stop_button#misc#set_sensitive false; stop_sensitive := false; ) () let () = Design.register_extension insert (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/analyses_manager.mli0000666000000000000000000000330713571573400020266 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Nothing exported. Automatic registration. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/book_manager.ml0000666000000000000000000001447413571573400017237 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let dkey = Gui_parameters.register_category "book_manager" module Q = Qstack.Make (struct type t = GSourceView.source_view let equal x y = x == y end) type t = { notebook : GPack.notebook ; views : Q.t ; } let make ?tab_pos ?packing () = let notebook = GPack.notebook ~scrollable:true ~show_tabs:true ?tab_pos ?packing () in notebook#set_enable_popup true ; { notebook = notebook ; views = Q.create (); } let get_notebook t = t.notebook let set_current_view t n = if (n>=0) && (n < (Q.length t.views)) then t.notebook#goto_page n let prepend_source_tab w titre = Gui_parameters.debug ~dkey "prepend_source_tab"; (* insert one extra tab in the source window w, with label *) let label = GMisc.label ~text:titre () in let sw = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:(fun arg -> ignore (w.notebook#prepend_page ~tab_label:label#coerce arg)) () in let window = (Source_viewer.make ~packing:sw#add ()) in (* Remove default pango menu for textviews *) ignore (window#event#connect#button_press ~callback: (fun ev -> GdkEvent.Button.button ev = 3)); Q.add window w.views; w.notebook#goto_page 0; window let get_nth_page (t:t) n = let nb = t.notebook in nb#get_nth_page n (* Deprecated *) let current_page (t:t) = let nb = t.notebook in nb#current_page let last_page t = Q.length t.views - 1 (* ABP and methods to manage this memory *) let get_current_view (t:t) = let nb = t.notebook in let cp = nb#current_page in Gui_parameters.debug ~dkey "get_current_view: %d" cp; Q.nth cp t.views let get_current_index (t:t) = let cp = t.notebook#current_page in Gui_parameters.debug ~dkey "get_current_index: %d" cp; cp let delete_view (t:t) cp = let nb = t.notebook in Gui_parameters.debug ~dkey "delete_current_view - cur is page %d" cp; Q.remove (Q.nth cp t.views) t.views; nb#remove_page cp; let last = pred (Q.length t.views) in Gui_parameters.debug ~dkey "Going to page (delete_current_view) %d" last; nb#goto_page last (* delete within w the tab that contains window win *) let delete_view_and_loc w win () = Gui_parameters.debug ~dkey "delete_view_and_loc "; let idx = Q.idx win w.views in delete_view w idx let delete_current_view t = delete_view t t.notebook#current_page let delete_all_views (t:t) = Q.iter (fun _ -> t.notebook#remove_page 0) t.views; Q.clear t.views let append_view (t:t) (v:GSourceView.source_view) = let nb = t.notebook in let next = Q.length t.views in let text = Printf.sprintf "Page %d" next in let label = GMisc.label ~text:text () in let sw = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:(fun arg -> ignore (nb#append_page ~tab_label:label#coerce arg)) () in sw#add (v:>GObj.widget); nb#goto_page next; Gui_parameters.debug ~dkey "Going to page (append_view) %d" next; Q.add_at_end v t.views; Gui_parameters.debug ~dkey "append_view - nb pages is %d" (Q.length t.views); Gui_parameters.debug ~dkey "append_view - current nb page is %d" nb#current_page let get_nth_view t (n:int) = Q.nth n t.views let enable_popup (t:t) (b:bool) = let nb = t.notebook in nb#set_enable_popup b let set_scrollable (t:t) (b:bool) = let nb = t.notebook in nb#set_scrollable b (* get length of the current source_views list *) let length t = Q.length t.views let append_source_tab w titre = Gui_parameters.debug ~dkey "append_source_tab"; (* insert one extra tab in the source window w, with some title *) let composed_label = GPack.hbox () in let _ = GMisc.label ~text:(titre) ~packing:composed_label#add () in let cbutton = GButton.button ~packing:composed_label#add () in cbutton#set_use_stock false ; cbutton#set_label "X"; cbutton#misc#set_size_request ~width:20 ~height:20 (); let sw = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:(fun arg -> ignore (w.notebook#append_page ~tab_label:composed_label#coerce arg)) (* ~packing:(fun arg -> ignore (w.notebook#append_page ~tab_label:label#coerce arg)) *) () in let window = (Source_viewer.make ~packing:sw#add ()) in ignore (cbutton#connect#clicked ~callback:(fun () -> delete_view_and_loc w window ())); (* Remove default pango menu for textviews *) ignore (window#event#connect#button_press ~callback: (fun ev -> GdkEvent.Button.button ev = 3)); Q.add_at_end window w.views; let last = pred (Q.length w.views) in (* THIS CALLS THE SWITCH_PAGE CALLBACK IMMEDIATELY! *) w.notebook#goto_page last; window (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/book_manager.mli0000666000000000000000000000531113571573400017376 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Undocumented. Do not use this module if you don't know what you are doing. *) (* [JS 2011/10/03] Yet useless for the Frama-C platform. It seems to be only used by a CEA private plug-in (AP via LC). To the authors/users of this module: please document it. *) type t val make: ?tab_pos:Gtk.Tags.position -> ?packing:(GObj.widget -> unit) -> unit -> t val get_notebook: t -> GPack.notebook val append_source_tab : t -> string -> GSourceView.source_view val prepend_source_tab : t -> string -> GSourceView.source_view val get_nth_page: t -> int -> GObj.widget val current_page: t -> int val last_page: t -> int val set_current_view: t -> int -> unit val get_current_view: t -> GSourceView.source_view val get_current_index: t -> int val delete_current_view: t -> unit val delete_view: t -> int -> unit val delete_all_views: t -> unit val append_view: t -> GSourceView.source_view -> unit val get_nth_view: t -> int -> GSourceView.source_view val enable_popup : t -> bool -> unit val set_scrollable : t -> bool -> unit val length: t -> int (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/debug_manager.ml0000666000000000000000000000650713571573400017371 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Require Dgraph included in Ocamlgraph, thus GnomeCanvas *) open Dgraph let graph_view ~packing mk_dot = let f = try Extlib.temp_file_cleanup_at_exit "framac_graph_view" "dot" with Extlib.Temp_file_error s -> Gui_parameters.abort "cannot create temporary file: %s" s in mk_dot f; snd (DGraphContainer.Dot.from_dot_with_commands ~status:DGraphContainer.Global ~packing f) let state_dependency_graph ~packing () = graph_view ~packing State_dependency_graph.dump (* [JS 2011/07/05] to be reimplemented *) let status_dependency_graph ~packing:_ () = assert false (* let g = Properties_status.Consolidation_tree.get_full_graph () in graph_view ~packing (Properties_status.Consolidation_tree.dump g)*) let graph_window main_window title mk_view = let height = int_of_float (float main_window#default_height *. 3. /. 4.) in let width = int_of_float (float main_window#default_width *. 3. /. 4.) in let window = GWindow.window ~width ~height ~title ~resizable:true ~position:`CENTER () in let view = mk_view ~packing:window#add () in window#show (); view#adapt_zoom () open Menu_manager let () = Design.register_extension (fun window -> let mk_graph = graph_window window#main_window in ignore ((window#menu_manager ())#add_debug ~show:(fun () -> Gui_parameters.debug_atleast 1) [ (let s = "State Dependency Graph" in menubar s (Unit_callback (fun () -> mk_graph s state_dependency_graph))); (let s = "Status Graph" in menubar s (Unit_callback (fun () -> mk_graph s status_dependency_graph))) ])) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/debug_manager.mli0000666000000000000000000000330713571573400017535 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Nothing exported. Automatic registration. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/design.ml0000666000000000000000000022711013571573400016055 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Main GUI skeleton *) open Cil_types open Cil_datatype open Cil open Pretty_source open Gtk_helper let dkey = Gui_parameters.register_category "design" let dkey_scroll = Gui_parameters.register_category "scroll" let use_external_viewer = false class type reactive_buffer = object inherit error_manager method buffer : GSourceView.source_buffer method locs : Pretty_source.Locs.state method rehighlight: unit method redisplay: unit end class type view_code = object method scroll : Pretty_source.localizable -> unit method view_stmt : stmt -> unit method view_original_stmt : stmt -> location method view_original : location -> unit method display_globals : global list -> unit method select_or_display_global : global -> unit end class type main_window_extension_points = object inherit Launcher.basic_main inherit view_code method toplevel : main_window_extension_points method menu_manager: unit -> Menu_manager.menu_manager method file_tree : Filetree.t method file_tree_view : GTree.view method annot_window : Wtext.text method pretty_information: 'a. ?scroll:bool -> ('a, Format.formatter, unit) format -> 'a (** Pretty print a message in the [annot_window]. *) method launcher : unit -> unit method source_viewer : GSourceView.source_view method source_viewer_scroll : GBin.scrolled_window method display_globals : global list -> unit method register_source_selector : (GMenu.menu GMenu.factory -> main_window_extension_points -> button:int -> Pretty_source.localizable -> unit) -> unit method register_source_highlighter : (reactive_buffer -> localizable -> start:int -> stop:int -> unit) -> unit method register_panel : (main_window_extension_points -> (string * GObj.widget *(unit-> unit) option)) -> unit method rehighlight : unit -> unit method redisplay : unit -> unit method reactive_buffer: reactive_buffer method original_source_viewer : Source_manager.t method reset : unit -> unit method error : 'a. ?parent:GWindow.window_skel -> ?reset:bool -> ('a, Format.formatter, unit) format -> 'a method push_info : 'a. ('a, Format.formatter, unit) format -> 'a method pop_info : unit -> unit method show_ids: bool method help_message : 'a 'b. ( as 'a) -> ('b, Format.formatter, unit) format -> 'b method lower_notebook : GPack.notebook end (** The list of registered extension *) let (handlers:(main_window_extension_points -> unit) list ref) = ref [] (** Insert an extension *) let register_extension f = handlers := f::!handlers (** Apply all extensions *) let process_extensions window = List.iter (fun f -> f window) (List.rev !handlers) (** The list of reset extensions. Such extensions are used for example when the current project is changed. *) let (reset_handlers:(main_window_extension_points -> unit) list ref) = ref [] (** Insert a reset extension *) let register_reset_extension f = reset_handlers := f::!reset_handlers (** Apply all reset extensions *) let reset_extensions window = List.iter (fun f -> f window) (List.rev !reset_handlers) (** Memoization of the class used to display a list of globals inside a GTK source view (reactive_buffer) *) module Globals_GUI = struct include Hashtbl.Make (struct type t = global list let equal x y = try List.for_all2 (==) x y with Invalid_argument _ -> false let hash = Hashtbl.hash end) let tbl: reactive_buffer t = create 17 let find k = find tbl k let add k = add tbl k let clear () = clear tbl end let filetree_selector (main_ui:main_window_extension_points) ~was_activated ~activating globals = (*Format.printf "filetree selector:%b@." (not was_activated && activating);*) if not was_activated && activating then begin let source = main_ui#source_viewer in (match globals with | Filetree.File (f, l) -> Source_manager.load_file main_ui#original_source_viewer ~filename:f ~line:1 ~click_cb:(fun _ -> (* original_source callback unnecessary here *) ()) (); main_ui#display_globals l | Filetree.Global (GVarDecl (vi, _)) -> (* try to find a definition instead of a declaration, which is more informative. *) main_ui#display_globals [Ast.def_or_last_decl vi] | Filetree.Global g -> main_ui#display_globals [g]; ); source#scroll_to_mark ~use_align:true ~xalign:0. ~yalign:0.5 `INSERT; let print_one_global prefix (v,loc) = main_ui#protect ~cancelable:false (fun () -> main_ui#view_original loc; main_ui#pretty_information "%s '%s'@." prefix v.vname) in main_ui#annot_window#clear; begin match globals with | Filetree.Global g -> begin History.push (History.Global g); match g with | GFun ({svar=v},loc) -> print_one_global "Function" (v,loc) | GVar (v,_,loc) -> print_one_global "Variable" (v,loc) | GVarDecl (v, loc) -> print_one_global "Variable" (v,loc) | GFunDecl (_, v, loc) -> print_one_global "Declared function" (v,loc) | _ -> () (* cannot currently happen, we do not display the other globals in the filetree *) end | Filetree.File (f, globals) -> let max_length = 40 in let cons_limit r g l = if !r >= max_length then l else (incr r;g::l) in let gfun_c,gtyp_c,gcomptagdecl_c,genumtagdecl_c,gvardecl_c,gvar_c= ref 0,ref 0,ref 0,ref 0,ref 0,ref 0 in let (gfun,gtype,gcomp,genum,gvardecl,gvar) = List.fold_right (fun g (gfun,gtype,gcomp,genum,gvardecl,gvar) -> match g with | GFun _ -> (cons_limit gfun_c g gfun,gtype,gcomp,genum,gvardecl,gvar) | GFunDecl _ -> (cons_limit gfun_c g gfun,gtype,gcomp,genum,gvardecl,gvar) | GType _ -> (gfun,cons_limit gtyp_c g gtype,gcomp,genum,gvardecl,gvar) | GCompTagDecl _ -> (gfun,gtype,cons_limit gcomptagdecl_c g gcomp,genum,gvardecl,gvar) | GEnumTagDecl _ -> (gfun,gtype,gcomp,cons_limit genumtagdecl_c g genum,gvardecl,gvar) | GVarDecl _ -> (gfun,gtype,gcomp,genum,cons_limit gvardecl_c g gvardecl,gvar) | GVar _ -> (gfun,gtype,gcomp,genum,gvardecl,cons_limit gvar_c g gvar) | _ -> (gfun,gtype,gcomp,genum,gvardecl,gvar)) globals ([],[],[],[],[],[]) in main_ui#pretty_information "@[File %a@]@." Datatype.Filepath.pretty f; let printing (head:string) (ellipsis:bool) (f:Format.formatter -> 'a -> unit) (l:'a list) = if l <> [] then main_ui#pretty_information "@[%s @[%a@]%s@]@\n" head (Pretty_utils.pp_list ~sep:",@ " f) l (if ellipsis then "..." else "") in printing "Functions:" (!gfun_c>=max_length) (fun fmt -> (function GFun ({svar=v},_) | GFunDecl (_, v, _) -> Varinfo.pretty fmt v | _ -> assert false)) gfun; printing "Types:" (!gtyp_c>=max_length) (function fmt -> (function (GType ({tname=name},_)) -> Format.pp_print_string fmt name | _ -> assert false)) gtype; printing "Composite types:" (!gcomptagdecl_c>=max_length) (function fmt -> (function GCompTagDecl ({cname=name},_) |GCompTag ({cname=name},_)-> Format.pp_print_string fmt name | _ -> assert false)) gcomp; printing "Enums:" (!genumtagdecl_c>=max_length) (function fmt -> (function GEnumTagDecl ({ename=name},_) | GEnumTag ({ename=name},_)-> Format.pp_print_string fmt name |_ -> assert false)) genum; printing "Declared variables:" (!gvardecl_c>=max_length) (function fmt -> (function GVarDecl (v,_) -> Varinfo.pretty fmt v | _ -> assert false)) gvardecl; printing "Variables:" (!gvar_c>=max_length) (fun fmt -> (function GVar(v,_,_) -> Varinfo.pretty fmt v | _ -> assert false)) gvar; main_ui#pretty_information "%!" end end let pretty_predicate_status fmt p = if Property.has_status p then let s = Property_status.get p in Format.fprintf fmt "Status: %a@." Property_status.pretty s (* This is called when a localizable is selected in the pretty-printed source buffer *) let to_do_on_real_select _menu (main_ui:main_window_extension_points) ~button selected = History.push (History.Localizable selected); if button = 1 then begin main_ui#annot_window#clear; end (* Returns a pair (name, callback), where [name] is the name of the selected global variable, function or label, and [callback] executes a jump to the definition of [selected], if it is possible. Otherwise, returns [None]. *) let go_to_definition selected main_ui = match selected with | PLval (_kf, _ki, lv) -> begin match lv with | Var vi, _ when vi.vsource && vi.vglob -> let typ = Cil.typeOfLval lv in let glob = if Cil.isFunctionType typ then Kernel_function.get_global (Globals.Functions.get vi) else GVarDecl (vi, Location.unknown) in let name = Pretty_utils.escape_underscores (Format.asprintf "%a" Varinfo.pretty vi) in Some (name, fun () -> ignore (main_ui#select_or_display_global glob)) | _ -> None (* cannot go to definition *) end | PStmt (kf,{skind = Goto (stmt, _)}) -> begin match !stmt.labels with | Label (lbl, _, _) :: _ -> let name = Pretty_utils.escape_underscores lbl in Some (name, fun () -> ignore (main_ui#scroll (PStmt (kf, !stmt)))) | _ -> None end | _ -> None (* cannot go to definition *) (* Print the code annotations on the given statement *) let print_code_annotations (main_ui:main_window_extension_points) kf stmt = Annotations.iter_code_annot (fun e a -> let kind = if Emitter.equal e Emitter.end_user then "user annotation" else match Alarms.find a with | Some _ -> "alarm" | None -> Format.asprintf "emitted by %a" Emitter.pretty e in main_ui#pretty_information "@[%s: @[%a@]@]@.%a@." kind Printer.pp_code_annotation a (Pretty_utils.pp_list ~sep:"@\n" pretty_predicate_status) (Property.ip_of_code_annot kf stmt a)) stmt (* When the statement is a call, print the statuses of the preconditions of the called functions at this specific call site. *) let print_call_preconditions (main_ui: main_window_extension_points) stmt = let by_ptr_call = match stmt.skind with | Instr (Call (_, e, _, _)) -> Some (Kernel_function.get_called e = None) | Instr (Local_init (_, ConsInit _, _)) -> Some false | _ -> None in match by_ptr_call with | None -> () (* Not a call *) | Some by_ptr -> let called_at = Statuses_by_call.all_functions_with_preconditions stmt in let aux_callee kf = let warn_missing = false in let l= Statuses_by_call.all_call_preconditions_at ~warn_missing kf stmt in let pp_kf fmt = if by_ptr then Format.fprintf fmt "of %a:@ " Kernel_function.pretty kf in let aux_prop (orig, copy) = main_ui#pretty_information "@[Precondition %t%a@.%a@]@." pp_kf Property.pretty orig pretty_predicate_status copy in List.iter aux_prop l in Kernel_function.Hptset.iter aux_callee called_at (* This is called when a localizable is selected in the pretty-printed source buffer, and also when a localizable is clicked on in the information panel *) let to_do_on_select (menu_factory:GMenu.menu GMenu.factory) (main_ui:main_window_extension_points) ~button selected = let view_original ?loc stmt = Gui_parameters.debug ~dkey:dkey_scroll "view_original: %a, stmt id %d" (Pretty_utils.pp_opt ~none:"None" Printer.pp_location) loc stmt.sid; match loc with | None -> main_ui#view_original_stmt stmt | Some loc -> main_ui#view_original loc; loc in let current_statement_msg ?loc kf stmt = main_ui#pretty_information "Function: %t@." (fun fmt -> match kf with | None -> Format.pp_print_string fmt "" | Some kf -> Kernel_function.pretty fmt kf); match stmt with | Kglobal -> main_ui#pretty_information "@." | Kstmt s -> let loc = view_original ?loc s in if main_ui#show_ids then main_ui#pretty_information "Statement: %d (%a)@.@." s.sid Printer.pp_location loc else main_ui#pretty_information "Line %a@.@." Printer.pp_location loc in let pp_decl fmt loc = if Cil_datatype.Location.equal loc Cil_datatype.Location.unknown then () else Format.fprintf fmt " (declared at %a)" Printer.pp_location loc in let formal_or_local vi = if vi.vformal then "formal parameter" else "local variable" in let pp_defining_fun fmt vi = match Kernel_function.find_defining_kf vi with | None -> () | Some kf -> Format.fprintf fmt " of function %a" Kernel_function.pretty kf in let pp_var_with_decl fmt vi = if vi.vglob then Format.fprintf fmt "%sglobal variable%a" (if vi.vsource then "" else "generated ") pp_decl vi.vdecl else Format.fprintf fmt "%s%s%a%a" (if vi.vsource then "" else "generated ") (formal_or_local vi) pp_defining_fun vi pp_decl vi.vdecl in if button = 1 then begin let open Property in match selected with | PStmtStart _ -> () | PStmt (kf, stmt) -> current_statement_msg (Some kf) (Kstmt stmt); print_code_annotations main_ui kf stmt; print_call_preconditions main_ui stmt; | PIP (IPCodeAnnot {ica_kf;ica_stmt;ica_ca} as ip) -> current_statement_msg ?loc:(Cil_datatype.Code_annotation.loc ica_ca) (Some ica_kf) (Kstmt ica_stmt); if main_ui#show_ids then main_ui#pretty_information "Code annotation id: %d@." ica_ca.annot_id; main_ui#pretty_information "%a@." pretty_predicate_status ip | PIP(IPAllocation _ as ip) -> main_ui#pretty_information "This is an allocation clause@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP(IPAssigns _ as ip) -> main_ui#pretty_information "This is an assigns clause@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP(IPFrom _ as ip) -> main_ui#pretty_information "This is a from clause@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPPredicate {ip_kind = PKRequires _} as ip) -> main_ui#pretty_information "This is a requires clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPExtended {ie_ext={ext_name}} as ip) -> main_ui#pretty_information "This clause is a %s extension.@.%a@." ext_name pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPPredicate {ip_kind = PKTerminates} as ip) -> main_ui#pretty_information "This is a terminates clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPPredicate {ip_kind = PKEnsures (_,Normal)} as ip) -> main_ui#pretty_information "This is an ensures clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPPredicate {ip_kind = PKEnsures (_,Exits)} as ip) -> main_ui#pretty_information "This is an exits clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPPredicate {ip_kind = PKEnsures (_,Returns)} as ip) -> main_ui#pretty_information "This is a returns clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPPredicate {ip_kind = PKEnsures (_,Breaks)} as ip) -> main_ui#pretty_information "This is a breaks clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPPredicate {ip_kind = PKEnsures (_,Continues)} as ip) -> main_ui#pretty_information "This is a continues clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPPredicate {ip_kind = PKAssumes _} as ip) -> main_ui#pretty_information "This is an assumes clause.@."; main_ui#view_original (location ip) | PIP (IPDecrease {id_kinstr=Kglobal} as ip) -> main_ui#pretty_information "This is a decreases clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP (IPDecrease {id_kinstr=Kstmt _} as ip) -> main_ui#pretty_information "This is a loop variant.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP(IPDisjoint _ as ip) -> main_ui#pretty_information "This is a disjoint behaviors clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP(IPComplete _ as ip) -> main_ui#pretty_information "This is a complete behaviors clause.@.%a@." pretty_predicate_status ip; main_ui#view_original (location ip) | PIP(IPAxiom _ as ip) -> main_ui#pretty_information "This is an axiom.@."; main_ui#view_original (location ip) | PIP(IPAxiomatic _ as ip) -> main_ui#pretty_information "This is an axiomatic.@."; main_ui#view_original (location ip) | PIP(IPLemma _ as ip) -> main_ui#pretty_information "This is a lemma.@."; main_ui#view_original (location ip) | PIP(IPTypeInvariant _ as ip) -> main_ui#pretty_information "This is a type invariant.@."; main_ui#view_original (location ip) | PIP(IPGlobalInvariant _ as ip) -> main_ui#pretty_information "This is a global invariant.@."; main_ui#view_original (location ip) | PIP(IPBehavior _ as ip) -> main_ui#pretty_information "This is a behavior.@."; main_ui#view_original (location ip) | PIP (IPPropertyInstance {ii_ip=ip'} as ip) -> main_ui#pretty_information "@[This is an instance of property `%a'.@]@." short_pretty ip'; main_ui#view_original (location ip) | PIP(IPReachable _ | IPOther _) -> (* these properties are not selectable *) assert false | PGlobal _g -> main_ui#pretty_information "This is a global.@."; | PLval (kf, ki,lv) -> let ty = typeOfLval lv in if isFunctionType ty then begin begin match ki with | Kstmt s -> ignore (view_original s) | Kglobal -> (); end; main_ui#pretty_information "This is a C function of type `%a'@." Gui_printers.pp_typ ty end else begin current_statement_msg kf ki; match lv with | Var vi,NoOffset -> main_ui#pretty_information "Variable %a has type `%a'.@\nIt is a %a.@\n\ %tIt is %sreferenced and its address is %staken.@." Varinfo.pretty vi Gui_printers.pp_typ vi.vtype pp_var_with_decl vi (fun fmt -> match vi.vdescr with | None -> () | Some s -> Format.fprintf fmt "This is a temporary variable for \"%s\".@\n" s) (if vi.vreferenced then "" else "not ") (if vi.vaddrof then "" else "not ") | _ -> let typ = typeOfLval lv in main_ui#pretty_information "This is an lvalue of type %a@." Gui_printers.pp_typ typ end | PExp (_kf, _ki, e) -> begin let typ = typeOf e in match constFoldToInt e with | Some i -> begin match e.enode with | Const (CEnum {eihost}) -> let typ_enum = TEnum (eihost, []) in main_ui#pretty_information "This is a C enumeration constant, \ defined in %a with a value of %a.@." Gui_printers.pp_typ typ_enum Abstract_interp.Int.pretty i | _ -> main_ui#pretty_information "This is a constant C expression of type %a, equal to %a.@." Gui_printers.pp_typ typ Abstract_interp.Int.pretty i end | None -> main_ui#pretty_information "This is a pure C expression of type %a.@." Gui_printers.pp_typ typ end | PTermLval (_, _, ip, tlv) -> main_ui#pretty_information "This is a logical left-value, \ of logic type %a.@." Printer.pp_logic_type (Cil.typeOfTermLval tlv); main_ui#view_original (Property.location ip) | PVDecl (kf,_,vi) -> if vi.vglob then begin main_ui#view_original (Global.loc (Ast.def_or_last_decl vi)); main_ui#pretty_information "This is the last declaration or definition of %s %a.@\n\ It is %sreferenced and its address is %staken.@." (if Cil.isFunctionType vi.vtype then "function" else "global variable") Varinfo.pretty vi (if vi.vreferenced then "" else "not ") (if vi.vaddrof then "" else "not ") end else begin main_ui#view_original vi.vdecl; let kf = Extlib.the kf in main_ui#pretty_information "This is the declaration of %s %a in function %a%t@." (formal_or_local vi) Varinfo.pretty vi Kernel_function.pretty kf (fun fmt -> match vi.vdescr with None -> () | Some s -> Format.fprintf fmt "@\nThis is a temporary variable for \"%s\".@." s) end end else if button = 3 then begin match go_to_definition selected main_ui with | None -> () (* no menu to show *) | Some (escaped_name, callback) -> ignore (menu_factory#add_item ("Go to definition of " ^ escaped_name) ~callback) end module Feedback = struct module F = Property_status.Feedback let category = function | F.Never_tried -> "never_tried" | F.Considered_valid -> "considered_valid" | F.Valid -> "surely_valid" | F.Invalid -> "surely_invalid" | F.Invalid_but_dead -> "invalid_but_dead" | F.Valid_but_dead -> "valid_but_dead" | F.Unknown_but_dead -> "unknown_but_dead" | F.Unknown -> "unknown" | F.Valid_under_hyp -> "valid_under_hyp" | F.Invalid_under_hyp -> "invalid_under_hyp" | F.Inconsistent -> "inconsistent" let long_category = function | F.Never_tried -> "Never tried: no status is available for this property" | F.Considered_valid -> "Considered valid: this is a hypothesis that shall be verified outside Frama-C" | F.Valid -> "Surely valid: verified (including all of its dependencies)" | F.Invalid -> "Surely invalid: refuted (and all of its dependencies have been verified)" | F.Invalid_but_dead -> "Invalid but dead: refuted, but unreachable" | F.Valid_but_dead -> "Valid but dead: verified, but unreachable" | F.Unknown_but_dead -> "Unknown but dead: unknown status, and unreachable" | F.Unknown -> "Unknown: a verification has been attempted, but without conclusion" | F.Valid_under_hyp -> "Valid under hypotheses: verified (but has dependencies with Unknown status)" | F.Invalid_under_hyp -> "Invalid under hypotheses: refuted (but has dependencies with Unknown status)" | F.Inconsistent -> "Inconsistent: got both true and false statuses (possibly cyclic dependencies, or an incorrect axiomatization)" (* Two extra categories are used to add folding or unfolding icons on call sites with preconditions. *) let fold_category = "fold" let unfold_category = "unfold" (*GTK3 does not exist anymore in gsourceview3. *) let declare_markers (source:GSourceView.source_view) = GSourceView.make_marker_attributes ~source ~category:fold_category ~priority:2 ~pixbuf:(Gtk_helper.Icon.(get Fold)) (); GSourceView.make_marker_attributes ~source ~category:unfold_category ~priority:2 ~pixbuf:(Gtk_helper.Icon.(get Unfold)) (); List.iter (fun v -> GSourceView.make_marker_attributes ~source ~category:(category v) ~priority:1 ~pixbuf:(Gtk_helper.Icon.get (Gtk_helper.Icon.Feedback v)) ()) [ F.Never_tried; F.Considered_valid; F.Valid; F.Invalid; F.Invalid_but_dead; F.Valid_but_dead; F.Unknown; F.Unknown_but_dead; F.Valid_under_hyp; F.Invalid_under_hyp; F.Inconsistent ] (* tooltip marks are recreated whenever the buffer changes *) let tooltip_marks : (int, string) Hashtbl.t = Hashtbl.create 8 (* Binds the line of a callsite to the corresponding statement. Used to fold or unfold preconditions at a call site when the user clicks on the bullet (we need to retrieve the statement from the line clicked). *) let call_sites : (int, stmt) Hashtbl.t = Hashtbl.create 8 let clear_tables () = Hashtbl.clear tooltip_marks; Hashtbl.clear call_sites let mark (source:GSourceView.source_buffer) ?call_site ~offset validity = let iter = source#get_iter_at_char offset in let mark = iter#set_line_offset 0 in let category = category validity in source#remove_source_marks mark mark () ; ignore (source#create_source_mark ~category mark) ; Hashtbl.replace tooltip_marks iter#line (long_category validity); match call_site with | None -> () | Some stmt -> Hashtbl.replace call_sites iter#line stmt; if Pretty_source.are_preconds_unfolded stmt then ignore (source#create_source_mark ~category:fold_category mark) else ignore (source#create_source_mark ~category:unfold_category mark) end (** Widgets that might result in a localizable being selected: - the main ui reactive buffer (pretty-printed source) - the information panel, when the user clicks on a localizable *) type localizable_selection_origin = ReactiveBuffer | InformationPanel (** Global selectors and highlighters *) let highlighter = ref [] let selector = ref ([] : ((GMenu.menu GMenu.factory -> main_window_extension_points -> button:int -> Pretty_source.localizable -> unit ) * localizable_selection_origin list) list) class protected_menu_factory (host:Gtk_helper.host) (menu:GMenu.menu) = object inherit [GMenu.menu] GMenu.factory menu as super method! add_item ?key ?callback ?submenu string = let callback = match callback with None -> None | Some cb -> Some (fun () -> ignore (host#full_protect ~cancelable:true cb)) in super#add_item ?key ?callback ?submenu string method! add_check_item ?active ?key ?callback string = let callback = match callback with None -> None | Some cb -> Some (fun b -> ignore (host#full_protect ~cancelable:false (fun () -> cb b))) in super#add_check_item ?active ?key ?callback string end (* This function reacts to the section of a localizable. The [origin] arguments identifies the widget where the selection occurred *) let selector_localizable (main_ui:main_window_extension_points) origin ~button localizable = let popup_factory = new protected_menu_factory (main_ui:>Gtk_helper.host) (GMenu.menu()) in List.iter (fun (f, origins) -> if List.mem origin origins then f popup_factory main_ui ~button localizable ) !selector; if button = 3 && popup_factory#menu#children <> [] then let time = GtkMain.Main.get_current_event_time () in popup_factory#menu#popup ~button ~time class reactive_buffer_cl (main_ui:main_window_extension_points) ?(parent_window=main_ui#main_window) globs :reactive_buffer = let buffer = Source_viewer.buffer () in let locs = Pretty_source.Locs.create () in object(self) inherit error_manager ~reset:main_ui#reset (parent_window:>GWindow.window_skel) method buffer = buffer method locs = locs method rehighlight = Pretty_source.hilite locs method redisplay = self#init method private init = Feedback.clear_tables (); let highlighter localizable ~start ~stop = List.iter (fun f -> f (self:>reactive_buffer) localizable ~start ~stop) !highlighter in let selector = selector_localizable main_ui ReactiveBuffer in Pretty_source.display_source globs buffer ~host:(self:>Gtk_helper.host) ~highlighter ~selector locs; self#rehighlight initializer self#init; Globals_GUI.add globs (self:> reactive_buffer) end (* This is a dummy instance of [reactive_buffer], used to bootstrap the creation of the main window of the GUI. *) let dummy_reactive_buffer (parent_window:GWindow.window) = let buffer = Source_viewer.buffer () in let locs = Pretty_source.Locs.create () in object inherit error_manager (parent_window:>GWindow.window_skel) method buffer = buffer method locs = locs method rehighlight = () method redisplay = () end let reactive_buffer main_ui ?parent_window globs = try Globals_GUI.find globs with Not_found -> new reactive_buffer_cl main_ui ?parent_window globs (* Reference to the view used by the stdout console, to enable use of Ctrl+F. *) let console_view : GText.view option ref = ref None (** The main application window *) class main_window () : main_window_extension_points = let final_w,width = try true,Configuration.find_int "window_width" with Not_found -> false,(Gdk.Screen.width ())*7/8 in let final_h,height =try true,Configuration.find_int "window_height" with Not_found -> false,(Gdk.Screen.height ())*7/8 in let max_width = (* maximum width for this height *) height * 8 / 5 (* 16/10 ratio *) in let width, height = if width > max_width then (if final_w then width else max_width), height else let max_height = width * 3 / 4 in let new_height = min height max_height in width, if final_h then height else new_height in let main_window = Gtk_compat.window ?icon:framac_icon ~title:"Frama-C" ~position:`CENTER ~resizable:true ~show:false () in let () = main_window#set_default_size ~width ~height in let () = main_window#set_geometry_hints ~min_size:(1,1) main_window#coerce in let watch_cursor = Gdk.Cursor.create `WATCH in let arrow_cursor = Gdk.Cursor.create `ARROW in (* On top one finds the menubar *) let toplevel_vbox = GPack.box `VERTICAL ~packing:main_window#add () in (* toplevel_vbox->*bottom_hbox *) let bottom_hbox = GPack.box `HORIZONTAL ~packing:(toplevel_vbox#pack ~expand:false ~fill:false ~from:`END) () in (* status bar (at bottom) *) (* toplevel_vbox->bottom_hbox-> *statusbar *) let statusbar = GMisc.statusbar ~packing:bottom_hbox#add () in let status_context = statusbar#new_context "messages" in (* progress bar (at bottom) *) (* toplevel_vbox->bottom_hbox-> [statusbar;*progress_bar] *) let progress_bar = GRange.progress_bar ~pulse_step:0.01 ~packing:(bottom_hbox#pack ~fill:false) () in (* Split below the bars *) (* toplevel_vbox->[*toplevel_hpaned;bottom_hbox] *) let toplevel_hpaned = GPack.paned `HORIZONTAL ~packing:(toplevel_vbox#pack ~expand:true ~fill:true ~from:`END) () in (* Save the handle ratio whenever it is changed *) let _ = toplevel_hpaned#event#connect#button_release ~callback:(fun _ -> save_paned_ratio "toplevel_hpaned" toplevel_hpaned; false) in let filetree_panel_vpaned = GPack.paned `VERTICAL ~packing:(toplevel_hpaned#add1) () in let _ = filetree_panel_vpaned#event#connect#button_release ~callback:(fun _ -> save_paned_ratio "filetree_panel_vpaned" filetree_panel_vpaned; false) in (* The left filetree inside an automatic scrolled window and a nice frame *) let filetree_frame = GBin.frame ~shadow_type:`ETCHED_OUT ~packing:filetree_panel_vpaned#add1 () in let filetree_scrolled_window = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:filetree_frame#add () in let file_tree_view = GTree.view ~packing:filetree_scrolled_window#add () in let () = file_tree_view#misc#set_name "file tree" in let () = file_tree_view#selection#set_mode `SINGLE in let () = file_tree_view#set_rules_hint true in let () = file_tree_view#set_headers_clickable true in (* splits between messages and sources *) let vb_message_sources = GPack.paned `VERTICAL ~border_width:3 ~packing:toplevel_hpaned#add2 () in let _ = vb_message_sources#event#connect#button_release ~callback:(fun _ -> save_paned_ratio "vb_message_sources" vb_message_sources; false) in (* splits between messages and sources *) let hb_sources = GPack.paned `HORIZONTAL ~border_width:3 ~packing:vb_message_sources#add1 () in (* Save the handle ratio whenever it is changed *) let _ = hb_sources#event#connect#button_release ~callback:(fun _ -> save_paned_ratio "hb_sources" hb_sources; false) in (* lower notebook *) let fr2 = GBin.frame ~shadow_type:`ETCHED_OUT ~packing:vb_message_sources#add2 () in let lower_notebook = GPack.notebook ~scrollable:true ~show_tabs:true ~packing:fr2#add () in (* lower text view and its scroll view: annotations and messages *) let tab_label = GMisc.label ~markup:"Information" () in let annot_sw = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:(fun w -> ignore (lower_notebook#insert_page ~tab_label:tab_label#coerce w)) () in let annot_window = new Wtext.text () in let () = annot_sw#add_with_viewport annot_window#coerce in let () = Printer.update_printer (module Gui_printers.LinkPrinter: Printer.PrinterExtension) in (* upper text view: source code *) let fr1 = GBin.frame ~shadow_type:`ETCHED_OUT ~packing:hb_sources#add1 () in let source_viewer_scroll = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:fr1#add () in let source_viewer = Source_viewer.make ~packing:source_viewer_scroll#add () in let () = begin source_viewer#set_show_line_numbers false ; source_viewer#set_show_line_marks true ; let _ = source_viewer#event#connect#motion_notify ~callback: (fun ev -> let x = GdkEvent.Motion.x ev in if x < 20.0 (* roughly the width of the left bar *) then begin let y = GdkEvent.Motion.y ev in let (xbuf, ybuf) = source_viewer#window_to_buffer_coords ~tag:`WIDGET ~x:(int_of_float x) ~y:(int_of_float y) in let iterpos = source_viewer#get_iter_at_location xbuf ybuf in let line = iterpos#line in if Hashtbl.mem Feedback.tooltip_marks line then begin let text = Hashtbl.find Feedback.tooltip_marks line in source_viewer#misc#set_has_tooltip true; source_viewer#misc#set_tooltip_text text; end else begin source_viewer#misc#set_has_tooltip false; end end else source_viewer#misc#set_has_tooltip false; ; false) in Feedback.declare_markers source_viewer ; end in let original_source_viewer = Source_manager.make ~packing:hb_sources#add2 () in let () = (* Remove default pango menu (cut/paste, etc) for original source textview*) ignore (source_viewer#event#connect#button_press ~callback: (fun ev -> GdkEvent.Button.button ev = 3)); (* startup configuration *) source_viewer#buffer#place_cursor ~where:source_viewer#buffer#start_iter in let original_reactive_buffer = dummy_reactive_buffer main_window in object (self:#main_window_extension_points) val mutable launcher = [] val mutable panel = [] val mutable main_window_metrics = { Gtk.width=0; height=0; x=0; y=0} val mutable file_tree = None val mutable current_buffer_state: reactive_buffer = original_reactive_buffer val mutable menu_manager = None (* Stores the last text inserted into the "Find text" field. *) val mutable last_find_text = "" method toplevel = (self:>main_window_extension_points) method main_window = main_window method menu_manager () = match menu_manager with | None -> (* toplevel_vbox->[*self#menu_manager();toplevel_hpaned;bottom_hbox] *) let m = new Menu_manager.menu_manager ~packing:(toplevel_vbox#pack ~expand:false ~fill:false ~from:`START) ~host:(self :> Gtk_helper.host) in menu_manager <- Some m; m | Some s -> s method file_tree = Extlib.the file_tree method file_tree_view = file_tree_view method annot_window = annot_window method pretty_information : 'a. ?scroll:bool -> ('a, Format.formatter, unit) format -> 'a = annot_window#printf method source_viewer = source_viewer method source_viewer_scroll = source_viewer_scroll method private register_source_selector_origin origins f = selector := (f, origins)::!selector method register_source_selector f = self#register_source_selector_origin [InformationPanel; ReactiveBuffer] f method register_source_highlighter f = highlighter := f::!highlighter method register_panel f = panel <- f::panel method private initialize_panels () = let to_refresh = ref [] in let sw = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:filetree_panel_vpaned#add2 () in let vbox = GPack.vbox ~packing:sw#add_with_viewport () in let targets = [ { Gtk.target = "application/x" ; Gtk.flags = [] ; Gtk.info = 0 }] in let dragged_frame = ref None in List.iter (fun f -> let text,widget,refresh = f (self:>main_window_extension_points) in let key_config = text in let expander = GBin.expander ~expanded:(Configuration.find_bool ~default:true key_config) ~packing:vbox#pack () in let label_hb = GPack.hbox () in let _label = GMisc.label ~markup:(""^text^"") ~packing:label_hb#pack () in expander#set_label_widget (label_hb#coerce); ignore (expander#connect#activate (fun () -> (* Save expansion of panels*) Configuration.set key_config (Configuration.ConfBool (not expander#expanded)))); let frame = GBin.frame ~packing:expander#add () in frame#add widget; (* Drag stuff *) expander#drag#source_set ~modi:[`BUTTON1] ~actions:[`MOVE] targets; ignore (expander#drag#connect#beginning (fun _ -> dragged_frame:=Some (frame,text))); ignore (expander#drag#connect#ending (fun _ -> dragged_frame:=None)); (* Refreshers *) Extlib.may (fun refresh -> to_refresh:= (fun ()-> if !Gtk_helper.gui_unlocked && expander#expanded then refresh ()) ::!to_refresh) refresh) panel; (* Drop machinery *) let dropper (widget:GObj.widget) = widget#drag#dest_set ~flags:[`ALL] ~actions:[`MOVE] targets; ignore (widget#drag#connect#drop (fun drag_context ~x:_ ~y:_ ~time:_ -> match !dragged_frame with | None (* Not dropping a panel *) -> true | Some (frame,title) -> (*Format.printf "Hello %d %d %ld@." x y time;*) let w = drag_context#source_widget in let new_w = GWindow.window ~position:`MOUSE ~title ~show:true () in let b = GPack.vbox ~packing:new_w#add () in frame#misc#reparent b#coerce; ignore (new_w#connect#destroy (fun () -> frame#misc#reparent w; w#misc#show ())); w#misc#hide (); true)); ignore (widget#drag#connect#motion (fun drag_context ~x:_ ~y:_ ~time -> (*Format.printf "Motion %d %d %ld@." x y time;*) drag_context#status ~time (Some `MOVE); true)); ignore (widget#drag#connect#leave (fun drag_context ~time -> (*Format.printf "Motion %d %d %ld@." x y time;*) drag_context#status ~time (Some `MOVE))); in dropper main_window#coerce; dropper source_viewer#coerce; let refresh_all _ = (List.iter (fun f -> f ()) !to_refresh;true) in ignore (Glib.Timeout.add ~ms:500 ~callback:refresh_all) method launcher () = Launcher.show ~width:(try Configuration.find_int "launcher_width" with Not_found -> main_window_metrics.Gtk.width/2) ~height:(try Configuration.find_int "launcher_height" with Not_found -> 2*main_window_metrics.Gtk.height/3) ~host:(self:>Launcher.basic_main) () method original_source_viewer = original_source_viewer method reactive_buffer = current_buffer_state method display_globals globs = Gui_parameters.debug ~dkey "display_globals"; let buff = reactive_buffer self#toplevel globs in current_buffer_state <- buff; self#source_viewer#set_buffer (buff#buffer:>GText.buffer); self#rehighlight () (* This should not be needed, but for some reason gtk does not highlight the buffer by default *) (* Cf .mli doc. In the first case, the callbacks of the filetree are called, but not in the second case. As of 2011-05-16, the only callback is registered here (in design.ml) and calls filetree_selector *) method select_or_display_global g = if not (self#toplevel#file_tree#select_global g) then filetree_selector self#toplevel ~was_activated:false ~activating:true (Filetree.Global g) method redisplay () = current_buffer_state#redisplay; History.show_current () method rehighlight () = current_buffer_state#rehighlight ; (* General idea: if there is a current buffer AND [loc] is inside, scroll to [loc]. Otherwise, open a relevant buffer by finding a varinfo or a global for [loc], then scroll to [loc]. *) method scroll loc = Gui_parameters.debug ~dkey:dkey_scroll "main_ui: scroll: localizable %a" Printer_tag.Localizable.pretty loc; (* Used to avoid having two different history events, one created by [select_global], the other by [scroll] *) let history = History.on_current_history () in (* [current_buffer_state] contains [loc], [o] is the offset, let's scroll to it *) let show o = history (fun () -> History.push (History.Localizable loc)); let iter = self#source_viewer#buffer#get_iter (`OFFSET o) in Gui_parameters.debug ~dkey:dkey_scroll "scrolling in current view at iter %d,%d" iter#line iter#line_offset ; ignore (self#source_viewer#backward_display_line_start iter); self#source_viewer#buffer#place_cursor iter; ignore (self#source_viewer#scroll_to_mark ~use_align:true ~yalign:0.5 ~xalign:0. `INSERT); let adj = source_viewer_scroll#hadjustment in adj#set_value adj#lower in match Pretty_source.locate_localizable current_buffer_state#locs loc with | Some (b,_) -> show b | None -> (* Searching in [current_buffer_state] did not work, let's try to open a good one *) begin match Pretty_source.kf_of_localizable loc with | Some kf -> let g = Kernel_function.get_global kf in self#select_or_display_global g | None -> match loc with | PGlobal g -> self#select_or_display_global g | _ -> Gui_parameters.debug ~dkey "does not know how to scroll to loc" (* In this case, there is nothing we can do: we do not know which file/global to open to scroll in *) end; match Pretty_source.locate_localizable current_buffer_state#locs loc with | Some (b, _) -> show b | None -> (* Can appear eg. for an if (i<5) inside a loop, which is not shown in general in the source code *) Gui_parameters.debug ~dkey "Unable to scroll to loc, probably \ not shown in the buffer" method view_stmt stmt = let kf = Kernel_function.find_englobing_kf stmt in let loc = PStmt (kf, stmt) in self#scroll loc; ignore (self#view_original_stmt stmt) method view_original loc = Gui_parameters.debug ~dkey:dkey_scroll "main_ui: view_original: location %a" Location.pretty loc; if not (Location.equal loc Location.unknown) then Source_manager.load_file self#original_source_viewer ~filename:(fst loc).Filepath.pos_path ~line:(fst loc).Filepath.pos_lnum ~click_cb:(fun olocz -> match olocz with | None -> () | Some locz -> let scroll_to_locz locz = Wutil.later (fun () -> (* Prevent filetree selector from resetting the original source viewer. *) Source_manager.selection_locked := true; self#scroll locz; (* The selection lock is asynchronously released by a callback, and cannot be released here. *) ) in match locz with | PVDecl (_okf, _, vi) -> begin (* if it is a global variable, show it instead of the current function *) try ignore (Globals.Vars.find vi); let glob = GVarDecl (vi, loc) in Wutil.later (fun () -> Source_manager.selection_locked := true; self#select_or_display_global glob; ) with | Not_found -> (* not a global variable, treat as usual *) scroll_to_locz locz end | PGlobal g -> begin (* if it is a type declaration/definition, ignore it, since types are not displayed in the file tree *) match g with | GType _ | GCompTag _ | GCompTagDecl _ | GEnumTag _ | GEnumTagDecl _ -> () | _ -> scroll_to_locz locz end | _ -> scroll_to_locz locz ) () method view_original_stmt st = let loc = Stmt.loc st in if use_external_viewer then begin if not (Location.equal loc Location.unknown) then let args_for_emacs = Format.sprintf "emacsclient -n +%d %S" (fst loc).Filepath.pos_lnum ((fst loc).Filepath.pos_path :> string) (* Format.sprintf "mate -a -l %d %s" line file *) in Gui_parameters.debug ~dkey "Running %s" args_for_emacs; ignore (Sys.command args_for_emacs); end else self#view_original loc; loc method pop_info () = status_context#pop (); method private push_info_buffer : 'a. ?buffer:Buffer.t -> ('a, Format.formatter, unit) format -> 'a = fun ?buffer fmt -> let b = match buffer with | None -> Buffer.create 80 | Some b -> b in let bfmt = Format.formatter_of_buffer b in Format.kfprintf (function fmt -> Format.pp_print_flush fmt (); let content = Buffer.contents b in ignore (status_context#push content)) bfmt fmt method push_info fmt = self#push_info_buffer fmt method show_ids = Gui_parameters.debug_atleast 1 method help_message w fmt = let buffer = Buffer.create 80 in let bfmt = Format.formatter_of_buffer buffer in Format.kfprintf (function _ -> ignore (w#event#connect#leave_notify (fun _ -> self#pop_info ();true)); ignore (w#event#connect#enter_notify (fun _ -> Format.pp_print_flush bfmt (); self#push_info_buffer ~buffer "" ;false))) bfmt fmt inherit error_manager (main_window:>GWindow.window_skel) (* These private method might be exported when necessary *) method private toplevel_vbox = toplevel_vbox method private toplevel_hpaned = toplevel_hpaned method private statusbar = statusbar method lower_notebook = lower_notebook method private reset_no_extensions () = Gui_parameters.debug ~dkey "Redisplaying gui"; Globals_GUI.clear (); current_buffer_state <- original_reactive_buffer; self#file_tree#reset (); (self#menu_manager ())#refresh () method reset () = self#reset_no_extensions (); reset_extensions self#toplevel; if History.is_empty () then ( self#default_screen ()) else History.show_current () method private default_screen () = try (* If some files have been specified on the command-line, we try to find the main (if possible a definition, not a prototype), and display it *) let main, _ = Globals.entry_point () in self#select_or_display_global (Kernel_function.get_global main) with Globals.No_such_entry_point _ | Not_found -> source_viewer#buffer#set_text "Please select a file in the left panel\nor start a new project." (* Performs a forward text search on the currently focused element, starting at its current cursor position. Selects the next occurrence of the searched text (if found), otherwise displays a message saying it was not found. If [use_dialog] is true, displays a dialog asking for the text to be found (e.g. Ctrl+F). Otherwise, uses the last searched text (e.g. F3). *) method private focused_find_text use_dialog = let find_text_in_viewer ~where (viewer : [`GTextViewer of GText.view |`GSourceViewer of GSourceView.source_view]) text = let buffer, scroll_to_iter = match viewer with | `GTextViewer v -> v#buffer,v#scroll_to_iter | `GSourceViewer v -> v#buffer,v#scroll_to_iter in let cursor_iter = buffer#get_iter_at_mark `INSERT in let after_cursor = cursor_iter#forward_char in let notify_not_found = ref true in (* to avoid redundant 'not found' *) let found_iters = match after_cursor#forward_search ~flags:[] text with | Some _ as iters -> iters | None -> let title = "Find " ^ where in (* try to wrap search if user wishes *) if GToolbox.question_box ~title (Printf.sprintf "No more occurrences for: %s\n\ Search from beginning?" text) ~buttons:["Yes"; "No"] = 1 (*yes*) then let cursor_iter = buffer#get_iter `START in (* note: may end up searching twice some parts of the buffer *) cursor_iter#forward_search ~flags:[] text else (notify_not_found := false; None) in match found_iters with | Some (i1,i2) -> buffer#place_cursor i1; buffer#select_range i1 i2; ignore (scroll_to_iter i1 ~use_align:false ~within_margin:0.025 ); last_find_text <- text | None -> if !notify_not_found then GToolbox.message_box ~title:("Not found " ^ where) (Printf.sprintf "Not found %s: %s" where text) in let focused_widget = GtkWindow.Window.get_focus main_window#as_window in let focused_name = Gobject.Property.get focused_widget GtkBase.Widget.P.name in let opt_where_view = if focused_name = "source" then Some ("in CIL code", `GSourceViewer source_viewer) else if focused_name = "original_source" then let original_buffer = (Source_manager.get_current_source_view original_source_viewer) in Some ("in original code", `GSourceViewer original_buffer) else if focused_name = "file tree" then begin let text = if use_dialog then Extlib.opt_conv "" (Gtk_helper.input_string ~parent:main_window ~title:"Find global" ~ok:"Find" ~cancel:"Cancel" "Find global:" ~text:last_find_text) else last_find_text in if text <> "" then match self#file_tree#find_visible_global text with | None -> GToolbox.message_box ~title:"Global not found" (Printf.sprintf "Global not found: %s" text) | Some g -> last_find_text <- text; self#select_or_display_global g else (); None (* indicates that we are done processing the command *) end else begin let information_view = annot_window#get_view in if Gobject.Property.get information_view#as_widget GtkBase.Widget.P.has_focus then Some ("in Information",`GTextViewer information_view) else let console_view_focused = match !console_view with | Some v -> if Gobject.Property.get v#as_widget GtkBase.Widget.P.has_focus then Some ("in Console",`GTextViewer v) else None | None -> None in if console_view_focused <> None then console_view_focused else (* TODO: add more places where text can be searched *) None end in match opt_where_view with | None -> (* no searchable focused element, or already processed *) () | Some (where,viewer) -> let text = if use_dialog then Extlib.opt_conv "" (Gtk_helper.input_string ~parent:main_window ~title:("Find " ^ where) ~ok:"Find" ~cancel:"Cancel" ("Find text (" ^ where ^ "):") ~text:last_find_text) else last_find_text in if text <> "" then find_text_in_viewer ~where viewer text else () initializer self#set_reset self#reset; let menu_manager = self#menu_manager () (* create the menu_manager *) in main_window#add_accel_group menu_manager#factory#accel_group; (* When the user clicks on the bullet of a call site, folds or unfolds the preconditions at this call site. The relative position of an event is relative to the innermost widget at the given position, regardless of the widget on which the event is bound. The same coordinate can thus refer to different positions according to the reference widget. So we need to use absolute coordinate to precisely check where the click happened. *) let _ = source_viewer#event#connect#button_release ~callback:(fun ev -> (* Absolute x position of the event on the screen. *) let abs_x = int_of_float (GdkEvent.Button.x_root ev) in (* This function returns the absolute position of the top window, or the relative position of an intern widget. *) let rec get_rel_from_main acc win = let x = fst (Gdk.Window.get_position win) in let acc = acc + x in let win = Gdk.Window.get_parent win in if Gobject.get_oid win = Gobject.get_oid main_window#misc#window then acc else get_rel_from_main acc win in let get_x obj = fst (Gdk.Window.get_position obj#misc#window) in (* Absolute position of the main window on the screen. *) let window_abs_x = get_x main_window in (* Relative position of the source_viewer in the main windows. *) let viewer_rel_x = get_rel_from_main 0 source_viewer#misc#window in (* Width of the bullet column in the source viewer. *) if abs_x - (window_abs_x + viewer_rel_x) < 20 then begin let x, y = GdkEvent.Button.(x ev, y ev) in let (xbuf, ybuf) = source_viewer#window_to_buffer_coords ~tag:`WIDGET ~x:(int_of_float x) ~y:(int_of_float y) in let iterpos = source_viewer#get_iter_at_location xbuf ybuf in let line = iterpos#line in try let stmt = Hashtbl.find Feedback.call_sites line in Pretty_source.fold_preconds_at_callsite stmt; self#reset_no_extensions (); (* give some time for the sourceview to recompute its height, otherwise scrolling is broken. *) let has_stabilized = ref false in (* According to the blog post here https://picheta.me/articles/2013/08/gtk-plus--a-method-to-guarantee-scrolling.html the best way to check whether we have correctly scrolled is to retrieve the rectangle corresponding to the mark, the rectangle effectively displayed, and see whether the former is included in the latter. *) let check () = (* not entirely accurate because of the (un)fold action, but should do the trick. We will do the real scroll after stabilization anyway. *) let iter = source_viewer#buffer#get_iter (`LINE line) in let my_rect = source_viewer#get_iter_location iter in let visible_rect = source_viewer#visible_rect in (* in Gdk, x,y represents the top left corner of the rectangle. We just check whether the beginning of the selection is visible (we only have one line of text anyway). *) let res = Gdk.Rectangle.( y my_rect >= y visible_rect && y my_rect <= y visible_rect + height visible_rect ) in Gdk.Rectangle.(Gui_parameters.debug ~dkey:dkey_scroll "my rect is %d (+%d) %d (+%d)@\n\ vis rect is %d (+%d) %d (+%d)@\n\ my rect is visible: %B@." (x my_rect) (width my_rect) (y my_rect) (height my_rect) (x visible_rect) (width visible_rect) (y visible_rect) (height visible_rect) res); has_stabilized := res; (* when added as an idle procedure below, check will be removed whenever it returns false. *) not res in (* in case we were lucky and have stabilized directly. *) ignore (check()); let proc = Glib.Idle.add check in (* in case we are unlucky, stop waiting after 0.5 second and hope for the best. *) let alarm = Glib.Timeout.add ~ms:500 ~callback: (fun () -> has_stabilized := true; Glib.Idle.remove proc; false) in while (not !has_stabilized) do (* do one main loop step so that buffer gets a chance to recompute its height. *) ignore (Glib.Main.iteration false) done; Glib.Timeout.remove alarm; self#view_stmt stmt; with Not_found -> () end; false) in let extra_accel_group = GtkData.AccelGroup.create () in GtkData.AccelGroup.connect extra_accel_group ~key:GdkKeysyms._F ~modi:[`CONTROL] ~callback: (fun _ -> self#focused_find_text true); (* Ctrl+F is bound to an action which opens a popup asking for a string, and then this string is searched in the text starting from the current position. *) GtkData.AccelGroup.connect extra_accel_group ~key:GdkKeysyms._F3 ~callback:(fun _ -> self#focused_find_text false); (* F3 is bound to "Find again": searches the last string input with Ctrl+F without opening a popup window. *) main_window#add_accel_group extra_accel_group; let lock_gui lock = (* lock left part of the GUI. *) filetree_panel_vpaned#misc#set_sensitive (not lock); if lock then ignore (Glib.Timeout.add ~ms:50 ~callback:(fun () -> progress_bar#pulse (); not !Gtk_helper.gui_unlocked)); Gdk.Window.set_cursor main_window#misc#window (if lock then watch_cursor else arrow_cursor); if lock then begin progress_bar#misc#show (); ignore (status_context#push "Computing") end else begin status_context#pop(); progress_bar#misc#hide () end in register_locking_machinery ~lock:(fun _cancelable -> lock_gui true) ~unlock:(fun () -> lock_gui false) (); ignore (main_window#connect#destroy ~callback:Cmdline.bail_out); (* Set the relative position for all paned whenever the main window is resized *) ignore (main_window#misc#connect#size_allocate (fun ({Gtk.width=w;Gtk.height=h} as rect) -> Configuration.set "window_width" (Configuration.ConfInt w); Configuration.set "window_height" (Configuration.ConfInt h); if main_window_metrics.Gtk.width <> w || main_window_metrics.Gtk.height <> h then begin place_paned hb_sources (Configuration.find_float ~default:0.5 "hb_sources"); place_paned vb_message_sources (Configuration.find_float ~default:0.71 "vb_message_sources"); place_paned filetree_panel_vpaned (Configuration.find_float ~default:0.5 "filetree_panel_vpaned"); place_paned toplevel_hpaned (Configuration.find_float ~default:0.18 "toplevel_hpaned"); end; main_window_metrics <- rect)); file_tree <- Some (Filetree.make file_tree_view); self#file_tree#add_select_function (filetree_selector self#toplevel); process_extensions self#toplevel; self#register_source_selector to_do_on_select; self#register_source_selector_origin [ReactiveBuffer] to_do_on_real_select; self#initialize_panels (); main_window#show (); Gdk.Window.set_cursor main_window#misc#window arrow_cursor; let warnings_tab_label = (GMisc.label ~text:"Messages" ())#coerce in let warning_manager = let packing w = ignore (lower_notebook#insert_page ~pos:1 ~tab_label:warnings_tab_label w); let text = Format.sprintf "Messages (%d)" (Messages.nb_messages ()) in let label = GtkMisc.Label.cast warnings_tab_label#as_widget in GtkMisc.Label.set_text label text in let callback e _column = Extlib.may (fun pos -> Extlib.may self#scroll (Pretty_source.loc_to_localizable pos); (* Note: the code below generates double scrolling: the previous call to self#scroll causes the original source viewer to scroll to the beginning of the function, and then the code below re-scrolls it to the exact location. *) self#view_original (pos,pos)) e.Log.evt_source in Warning_manager.make ~packing ~callback in let display_warnings () = Messages.reset_once_flag (); Warning_manager.clear warning_manager; Messages.iter (fun event -> Warning_manager.append warning_manager event); let text = Format.sprintf "Messages (%d)" (Messages.nb_messages ()) in let label = GtkMisc.Label.cast warnings_tab_label#as_widget in GtkMisc.Label.set_text label text in display_warnings (); (* Management of navigation history *) ignore (History.create_buttons (self#menu_manager ())); History.set_display_elt_callback (function | History.Global g -> self#select_or_display_global g | History.Localizable l -> self#scroll l ); register_reset_extension (fun _ -> display_warnings ()); self#default_screen (); menu_manager#refresh (); Project.register_after_set_current_hook ~user_only:true (fun _ -> self#reset ()); let pp_def_loc pp typ = try let opt_tag_name = match typ with | TNamed (ti, _) -> Some (Logic_typing.Typedef, ti.torig_name) | TComp (ci, _, _) -> let tag = if ci.cstruct then Logic_typing.Struct else Logic_typing.Union in let name = if ci.corig_name <> "" then ci.corig_name else ci.cname in Some (tag, name) | TEnum (ei, _) -> let name = if ei.eorig_name <> "" then ei.eorig_name else ei.ename in Some (Logic_typing.Enum, name) | _ -> None in match opt_tag_name with | None -> () | Some (tag, name) -> let g = Globals.Types.global tag name in let loc = Cil_datatype.Global.loc g in Format.fprintf pp ", defined at %a" Printer.pp_location loc with | Not_found -> () in annot_window#links#connect (fun button (_,_,s) -> begin try (* Retrieve a potential varinfo from the selection *) let vi = Gui_printers.varinfo_of_link s in (* Now that we have a varinfo, we re-synthesize a kinstr from the current localizable, as it must be supplied to the callbacks *) match History.selected_localizable () with | None -> () | Some loc -> let kfopt = Pretty_source.kf_of_localizable loc in let ki = Pretty_source.ki_of_localizable loc in let var_localizable = Pretty_source.PLval (kfopt, ki, (Var vi, NoOffset)) in let button = GdkEvent.Button.button button in if button = 1 then self#pretty_information "@."; selector_localizable self#toplevel InformationPanel ~button var_localizable with Gui_printers.NoMatch -> () end; begin try (* Retrieve a potential typ from the selection *) let typ = Gui_printers.typ_of_link s in match typ with | TComp _ | TEnum _ | TPtr _ | TArray _ | TNamed _ -> let base_type = Gui_printers.get_type_specifier typ in let sizeof_str = try Format.sprintf "sizeof %d" (Cil.bytesSizeOf base_type) with Cil.SizeOfError (b, _) -> "unknown size: " ^ b in self#pretty_information ~scroll:true "@.Type information for `%a':@.(%s%a)@. @[%a@]" Printer.pp_typ base_type sizeof_str pp_def_loc typ Gui_printers.pp_typ_unfolded base_type | _ -> () (* avoid printing anything for basic types; also, function types are not supported *) with Gui_printers.NoMatch -> () end; try let loc = Gui_printers.loc_of_link s in (* Retrieve a potential loc from the selection *) let modi = Gdk.Convert.modifier (GdkEvent.Button.state button) in let button = GdkEvent.Button.button button in if button = 1 then if List.mem `CONTROL modi then (* Control-click: open current location using external viewer (Emacs) *) open_in_external_viewer (fst loc).Filepath.pos_path ~line:(fst loc).Filepath.pos_lnum; self#view_original loc with Gui_printers.NoMatch -> ()) end let make_splash () = GMain.Rc.add_default_file (Config.datadir ^"/frama-c.rc"); GMain.Rc.add_default_file (Config.datadir ^"/frama-c-user.rc"); (*print_endline ("BOOT: " ^ (Glib.Main.setlocale `ALL None));*) let (_:string) = GtkMain.Main.init ~setlocale:false () in (*print_endline ("START: " ^ (Glib.Main.setlocale `ALL None));*) let w = GWindow.window ~title:"Splash" ~width:640 ~height:480 ~position:`CENTER_ALWAYS ~show:false ?icon:framac_icon () in ignore(w#event#connect#key_press ~callback:(fun key -> if GdkEvent.Key.keyval key = GdkKeysyms._Escape then Cmdline.bail_out (); false)); let _ = w#event#connect#delete ~callback:(fun _ -> Cmdline.bail_out ()) in let tid = Glib.Timeout.add ~ms:500 ~callback:(fun () -> w#show (); false) in let bx = GPack.vbox ~packing:w#add () in let notebook = GPack.notebook ~packing:bx#add () in let close_button = GButton.button ~packing:(bx#pack ~expand:false ~fill:false) ~stock:`CANCEL () in ignore (close_button#connect#released ~callback:Cmdline.bail_out); let reparent,stdout = Gtk_helper.make_text_page ~pos:2 notebook "Console" in console_view := Some stdout; Gtk_helper.log_redirector (fun s -> stdout#buffer#insert ~iter:stdout#buffer#end_iter s); let force () = Glib.Timeout.remove tid; w#show () in tid, stdout, w, reparent, force let toplevel play = Gtk_helper.Configuration.load (); Db.progress := Gtk_helper.refresh_gui; let in_idle () = let tid, splash_out, splash_w, reparent_console, force_s= make_splash () in let error_manager = new Gtk_helper.error_manager (splash_w:>GWindow.window_skel) in let init_crashed = ref true in error_manager#protect ~cancelable:true ~parent:(splash_w:>GWindow.window_skel) (fun () -> (try play (); (* This is a good point to start using real asynchronous tasks management: plug-ins launched from command line have finished their asynchronous tasks thanks to the default Task.on_idle. *) Task.on_idle := (fun f -> ignore (Glib.Timeout.add ~ms:50 ~callback:f)); let project_name = Gui_parameters.Project_name.get () in if project_name = "" then Project.set_current_as_last_created () else Project.set_current (Project.from_unique_name project_name); Ast.compute () with e -> (* An error occurred: we need to enforce the splash screen realization before we create the error dialog widget.*) force_s (); raise e); init_crashed := false); if Ast.is_computed () then (* if the ast has parsed, but a plugin has crashed, we display the gui *) error_manager#protect ~cancelable:false (fun () -> let main_ui = new main_window () in Gtk_helper.gui_unlocked := true; Glib.Timeout.remove tid; reparent_console main_ui#lower_notebook; splash_w#destroy (); (* Display the console if a crash has occurred. Otherwise, display the information panel *) if !init_crashed then (main_ui#lower_notebook#goto_page 2; (* BY TODO: this should scroll to the end of the console. It does not work at all after the reparent, and only partially before (scrollbar is wrong) *) let end_console = splash_out#buffer#end_iter in ignore (splash_out#scroll_to_iter ~yalign:0. end_console) ) else main_ui#lower_notebook#goto_page 0 ) in ignore (Glib.Idle.add (fun () -> in_idle (); false)); GMain.Main.main () let () = Db.Toplevel.run := toplevel (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/design.mli0000666000000000000000000002525713571573400016236 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** The extensible GUI. @plugin development guide *) open Cil_types (** This is the type of source code buffers that can react to global selections and highlighters. @since Beryllium-20090901 *) class type reactive_buffer = object inherit Gtk_helper.error_manager method buffer : GSourceView.source_buffer method locs : Pretty_source.Locs.state method rehighlight : unit method redisplay : unit end (** This class type lists all the methods available to navigate the source code through the GUI *) class type view_code = object (** {3 Pretty-printed code} *) method scroll : Pretty_source.localizable -> unit (** Move the pretty-printed source viewer to the given localizable if possible. Return a boolean indicating whether the operation succeeded @modify Nitrogen-20111001 Now indicates whether the operation succeeded. *) method display_globals : global list -> unit (** Display the given globals in the pretty-printed source viewer. *) (** {3 Original code} *) method view_original_stmt : stmt -> location (** Display the given [stmt] in the original source viewer *) method view_original : location -> unit (** Display the given location in the original_source_viewer *) (** {3 Both pretty-printed and original code} *) method view_stmt : stmt -> unit (** Display the given [stmt] in the [source_viewer] and in the [original_source_viewer]. Equivalent to two successive calls to [scroll] and [view_original_stmt] @since Carbon-20101201 *) method select_or_display_global : global -> unit (** This function tries to select the global in the treeview. If this fails, for example because the global is not shown in the treeview because of filters, it falls back to displaying the global by hand. @since Nitrogen-20111001 *) end class protected_menu_factory: Gtk_helper.host -> GMenu.menu -> [ GMenu.menu ] GMenu.factory (** This is the type of extension points for the GUI. @modify Boron-20100401 new way of handling the menu and the toolbar @plugin development guide *) class type main_window_extension_points = object inherit view_code (** {3 Main Components} *) method toplevel : main_window_extension_points (** The whole GUI aka self *) method menu_manager: unit -> Menu_manager.menu_manager (** The object managing the menubar and the toolbar. @since Boron-20100401 *) method file_tree : Filetree.t (** The tree containing the list of files and functions *) method file_tree_view : GTree.view (** The tree view containing the list of files and functions *) method main_window : GWindow.window (** The main window *) method annot_window : Wtext.text (** The information panel. The text is automatically cleared whenever the selection is changed. You should not directly use the buffer contained in the annot_window to add text. Use the method [pretty_information]. *) method pretty_information : 'a. ?scroll:bool -> ('a, Format.formatter, unit) format -> 'a (** Pretty print a message in the [annot_window], optionally scrolling it to the beginning of the message. *) method lower_notebook : GPack.notebook (** The lower notebook with messages tabs *) (** {4 Source viewers} *) method source_viewer : GSourceView.source_view (** The [GText.view] showing the AST. *) method source_viewer_scroll : GBin.scrolled_window (** The scrolling of the [GText.view] showing the AST. *) method reactive_buffer: reactive_buffer (** The buffer containing the AST. @since Carbon-20101201 *) method original_source_viewer : Source_manager.t (** The multi-tab source file display widget containing the original source. *) (** {3 Dialog Boxes} *) method launcher : unit -> unit (** Display the analysis configuration dialog and offer the opportunity to launch to the user *) method error : 'a. ?parent:GWindow.window_skel -> ?reset:bool -> ('a, Format.formatter, unit) format -> 'a (** Popup a modal dialog displaying an error message. If [reset] is true (default is false), the gui is reset after the dialog has been displayed. *) (** {3 Extension Points} *) method register_source_selector : (GMenu.menu GMenu.factory -> main_window_extension_points -> button:int -> Pretty_source.localizable -> unit) -> unit (** register an action to perform when button is released on a given localizable. If the button 3 is released, the first argument is popped as a contextual menu. @plugin development guide *) method register_source_highlighter : (reactive_buffer -> Pretty_source.localizable -> start:int -> stop:int -> unit) -> unit (** register an highlighting function to run on a given localizable between start and stop in the given buffer. Priority of [Gtext.tags] is used to decide which tag is rendered on top of the other. @modify Aluminium-20160501: receives a {!reactive_buffer} instead of a {!GSourceView.source_buffer} *) method register_panel : (main_window_extension_points->(string*GObj.widget*(unit-> unit) option)) -> unit (** [register_panel (name, widget, refresh)] registers a panel in GUI. The arguments are the name of the panel to create, the widget containing the panel and a function to be called on refresh. *) (** {3 General features} *) method reset : unit -> unit (** Reset the GUI and its extensions to its initial state *) method rehighlight : unit -> unit (** Force to rehighlight the current displayed buffer. Plugins should call this method whenever they have changed the states on which the function given to [register_source_highlighter] have been updated. *) method redisplay : unit -> unit (** @since Nitrogen-20111001 Force to redisplay the current displayed buffer. Plugins should call this method whenever they have changed the globals. For example whenever a plugin adds an annotation, the buffers need to be redisplayed. *) method protect : cancelable:bool -> ?parent:GWindow.window_skel -> (unit -> unit) -> unit (** Lock the GUI ; run the function ; catch all exceptions ; Unlock GUI The parent window must be set if this method is not called directly by the main window: it will ensure that error dialogs are transient for the right window. Set cancelable to [true] if the protected action should be cancellable by the user through button `Stop'. *) method full_protect : 'a . cancelable:bool -> ?parent:GWindow.window_skel -> (unit -> 'a) -> 'a option (** Lock the GUI ; run the function ; catch all exceptions ; Unlock GUI ; returns [f ()]. The parent window must be set if this method is not called directly by the main window: it will ensure that error dialogs are transient for the right window. Set cancelable to [true] if the protected action should be cancellable by the user through button `Stop'. *) method push_info : 'a. ('a, Format.formatter, unit) format -> 'a (** Pretty print a temporary information in the status bar *) method pop_info : unit -> unit (** Remove last temporary information in the status bar *) method show_ids : bool (** If [true], the messages shown in the GUI can mention internal ids (vid, sid, etc.). If [false], other means of identification should be used (line numbers, etc.). *) method help_message : 'a 'b. ( as 'a) -> ('b, Format.formatter, unit) format -> 'b (** Help message displayed when entering the widget *) end class main_window : unit -> main_window_extension_points val register_extension : (main_window_extension_points -> unit) -> unit (** Register an extension to the main GUI. It will be invoked at initialization time. @plugin development guide *) val register_reset_extension : (main_window_extension_points -> unit) -> unit (** Register a function to be called whenever the main GUI reset method is called. *) val reactive_buffer : main_window_extension_points -> ?parent_window:GWindow.window -> global list -> reactive_buffer (** This function creates a reactive buffer for the given list of globals. These buffers are cached and sensitive to selections and highlighters. @since Beryllium-20090901 *) (** Bullets in left-margins @since Nitrogen-20111001 *) module Feedback : sig val declare_markers: GSourceView.source_view -> unit (** Declares the icons used for the property status bullets, as marks in the left-margin of the source buffer. These icons depend on the GUI theme, and must be reset when the theme is changed. @since Chlorine-20180501 *) val mark : GSourceView.source_buffer -> ?call_site:stmt -> offset:int -> Property_status.Feedback.t -> unit (** [offset] is the offset of the character in the source buffer. The mark is put in the left-margin of the line corresponding to said character. [call_site] is the statement marked, if it is a call. *) end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/dgraph_helper.mli0000666000000000000000000000377013571573400017565 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Create a new window displaying a graph. @plugin development guide *) val graph_window: parent: GWindow.window -> title:string -> (packing:(GObj.widget -> unit) -> unit -> unit; ..>) -> unit (** Create a new window displaying a graph, by printing dot commands. *) val graph_window_through_dot: parent: GWindow.window -> title:string -> (Format.formatter -> unit) -> unit frama-c-20.0-Calcium/src/plugins/gui/dgraph_helper.no.ml0000666000000000000000000000424413571573400020024 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let window_msg_unavailable () = let buttons = GWindow.Buttons.ok in let message_type = `WARNING in let message = "Frama-C has not been compiled against a library with \ working graph visualization. Property dependencies graph can't be shown." in let dialog = GWindow.message_dialog ~buttons ~show:true ~message_type ~message () in let callback _ = dialog#destroy () in ignore (dialog#connect#response ~callback) let graph_window ~parent:_ ~title:_ _ = window_msg_unavailable () let graph_window_through_dot ~parent:_ ~title:_ _ = window_msg_unavailable () frama-c-20.0-Calcium/src/plugins/gui/dgraph_helper.yes.ml0000666000000000000000000000535613571573400020215 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let graph_window ~parent ~title make_view = let height = int_of_float (float parent#default_height *. 3. /. 4.) in let width = int_of_float (float parent#default_width *. 3. /. 4.) in let graph_window = GWindow.window ~width ~height ~title ~resizable:true ~position:`CENTER () in let view = make_view ~packing:graph_window#add () in graph_window#show(); view#adapt_zoom(); () ;; let graph_window_through_dot ~parent ~title dot_formatter = let make_view ~packing () = let temp_file = try Extlib.temp_file_cleanup_at_exit "framac_property_status_navigator_graph" "dot" with Extlib.Temp_file_error s -> Gui_parameters.abort "cannot create temporary file: %s" s in let fmt = Format.formatter_of_out_channel (open_out temp_file) in dot_formatter fmt; Format.pp_print_flush fmt (); let view = snd (Dgraph.DGraphContainer.Dot.from_dot_with_commands ~packing temp_file) in view in try graph_window ~parent ~title make_view with Dgraph.DGraphModel.DotError _ as exn -> Gui_parameters.error "@[cannot display dot graph:@ %s@]" (Printexc.to_string exn) frama-c-20.0-Calcium/src/plugins/gui/file_manager.ml0000666000000000000000000002503013571573400017212 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let add_files (host_window: Design.main_window_extension_points) = Gtk_helper.source_files_chooser (host_window :> Gtk_helper.source_files_chooser_host) (Kernel.Files.get ()) (fun filenames -> Kernel.Files.set filenames; if Ast.is_computed () then Gui_parameters.warning "Input files unchanged. Ignored." else begin File.init_from_cmdline (); host_window#reset () end) let filename: string option ref = ref None (* [None] for opening the 'save as' dialog box; [Some f] for saving in file [f] *) let reparse (host_window: Design.main_window_extension_points) = let old_helt = History.get_current () in let old_scroll = let adj = host_window#source_viewer_scroll#vadjustment in (adj#value -. adj#lower ) /. (adj#upper -. adj#lower) in let succeeded = host_window#full_protect ~cancelable:true (fun () -> let files = Kernel.Files.get () in Kernel.Files.set []; Kernel.Files.set files; Ast.compute (); !Db.Main.play (); Source_manager.clear host_window#original_source_viewer) in begin match old_helt, succeeded with | None, _ -> (** no history available before reparsing *) host_window#reset () | _, None -> (** the user stopped or an error occurred *) host_window#reset () | Some old_helt, Some () -> let new_helt = History.translate_history_elt old_helt in Extlib.may History.push new_helt; host_window#reset (); (** The buffer is not ready yet, modification of its vadjustement is unreliable *) let set () = let adj = host_window#source_viewer_scroll#vadjustment in adj#set_value (old_scroll *. (adj#upper-.adj#lower) +. adj#lower) in Wutil.later set end let save_in (host_window: Design.main_window_extension_points) parent name = try Project.save_all name; filename := Some name with Project.IOError s -> host_window#error ~parent "Cannot save: %s" s (** Save a project file. Choose a filename *) let save_file_as (host_window: Design.main_window_extension_points) = let dialog = GWindow.file_chooser_dialog ~action:`SAVE ~title:"Save the current session" ~parent:host_window#main_window () in (*dialog#set_do_overwrite_confirmation true ; only in later lablgtk2 *) dialog#add_button_stock `CANCEL `CANCEL ; dialog#add_select_button_stock `SAVE `SAVE ; host_window#protect ~cancelable:true ~parent:(dialog :> GWindow.window_skel) (fun () -> match dialog#run () with | `SAVE -> Extlib.may (save_in host_window (dialog :> GWindow.window_skel)) dialog#filename | `DELETE_EVENT | `CANCEL -> ()); dialog#destroy () let save_file (host_window: Design.main_window_extension_points) = match !filename with | None -> save_file_as host_window | Some f -> save_in host_window (host_window#main_window :> GWindow.window_skel) f (** Load a project file *) let load_file (host_window: Design.main_window_extension_points) = let dialog = GWindow.file_chooser_dialog ~action:`OPEN ~title:"Load a saved session" ~parent:host_window#main_window () in dialog#add_button_stock `CANCEL `CANCEL ; dialog#add_select_button_stock `OPEN `OPEN ; host_window#protect ~cancelable:true ~parent:(dialog:>GWindow.window_skel) (fun () -> match dialog#run () with | `OPEN -> begin match dialog#filename with | None -> () | Some f -> Project.load_all f end | `DELETE_EVENT | `CANCEL -> ()); dialog#destroy () (** Open the Preferences dialog *) let preferences (host_window: Design.main_window_extension_points) = let dialog = GWindow.dialog ~modal:true ~border_width:8 ~title:"Preferences" ~parent:host_window#main_window () in let main_box = dialog#vbox in main_box#set_spacing 10; let theme_frame = GBin.frame ~label:"Property bullets theme" () in main_box#pack theme_frame#coerce; let theme_box = GPack.vbox ~spacing:2 ~border_width:10 () in theme_frame#add theme_box#coerce; (* Themes are directories in share/theme. *) let themes_path = !Wutil.share ^ "/theme/" in let themes = Array.to_list (Sys.readdir themes_path) in let is_theme_directory name = Sys.is_directory (themes_path ^ name) in let themes = List.filter is_theme_directory themes in (* The current theme is kept in the configuration file. *) let active_theme = Gtk_helper.Configuration.find_string ~default:"default" "theme" in let theme_group = new Widget.group "" in let build_theme_button name = let label = String.capitalize_ascii name in let widget = theme_group#add_radio ~label ~value:name () in theme_box#add widget#coerce in (* Builds the theme buttons, and sets the active theme. *) List.iter build_theme_button themes; theme_group#set active_theme; (* External editor command. *) let default = "emacs +%d %s" in let editor = Gtk_helper.Configuration.find_string ~default "editor" in let editor_frame = GBin.frame ~label:"Editor command" () in main_box#pack editor_frame#coerce; let editor_box = GPack.vbox ~spacing:5 ~border_width:10 () in editor_frame#add editor_box#coerce; let text = "Command to open an external editor \ on Ctrl-click in the original source code. \n\ Use %s for file name and %d for line number." in let label = GMisc.label ~xalign:0. ~line_wrap:true ~text () in editor_box#pack label#coerce; let editor_input = GEdit.entry ~width_chars:30 ~text:editor () in editor_box#pack editor_input#coerce ~expand:true; (* Save and cancel buttons. *) let hbox_buttons = dialog#action_area in let packing = hbox_buttons#pack ~expand:true ~padding:3 in let wb_ok = GButton.button ~label:"Save" ~packing () in let wb_cancel = GButton.button ~label:"Cancel" ~packing () in wb_ok#grab_default (); let f_ok () = (* retrieve chosen preferences from dialog *) (* note: Guilib does not allow double quotes in strings, but it fails without raising an exception, so we must check if beforehand. *) if String.contains editor_input#text '"' then GToolbox.message_box ~title:"Error" "Error: configuration strings cannot contain double quotes. \n\ Use single quotes instead. \n\ Note that file names (%s) are automatically quoted." else begin Gui_parameters.debug "saving preferences"; Gtk_helper.Configuration.set "theme" (Gtk_helper.Configuration.ConfString theme_group#get); Gtk_helper.Configuration.set "editor" (Gtk_helper.Configuration.ConfString editor_input#text); Gtk_helper.Configuration.save (); dialog#destroy (); (* Reloads the icons from the theme, and resets the icons used as property status bullets.*) Gtk_helper.Icon.clear (); Design.Feedback.declare_markers host_window#source_viewer; end in let f_cancel () = Gui_parameters.debug "canceled, preferences not saved"; dialog#destroy () in ignore (wb_ok#connect#clicked f_ok); ignore (wb_cancel#connect#clicked f_cancel); (* the enter key is linked to the ok action *) (* the escape key is linked to the cancel action *) dialog#misc#grab_focus (); dialog#show () let insert (host_window: Design.main_window_extension_points) = let menu_manager = host_window#menu_manager () in let _, filemenu = menu_manager#add_menu "_File" in let file_items = menu_manager#add_entries filemenu [ Menu_manager.toolmenubar ~icon:`FILE ~label:"Source files" ~tooltip:"Create a new session from existing C files" (Menu_manager.Unit_callback (fun () -> add_files host_window)); Menu_manager.toolmenubar ~icon:`REFRESH ~label:"Reparse" ~tooltip:"Reparse source files, and replay analyses" (Menu_manager.Unit_callback (fun () -> reparse host_window)); Menu_manager.toolmenubar `REVERT_TO_SAVED "Load session" (Menu_manager.Unit_callback (fun () -> load_file host_window)); Menu_manager.toolmenubar `SAVE "Save session" (Menu_manager.Unit_callback (fun () -> save_file host_window)); Menu_manager.menubar ~icon:`SAVE_AS "Save session as" (Menu_manager.Unit_callback (fun () -> save_file_as host_window)); Menu_manager.menubar ~icon:`PREFERENCES "Preferences" (Menu_manager.Unit_callback (fun () -> preferences host_window)); ] in file_items.(5)#add_accelerator `CONTROL 'p'; file_items.(3)#add_accelerator `CONTROL 's'; file_items.(2)#add_accelerator `CONTROL 'l'; let stock = `QUIT in let quit_item = menu_manager#add_entries filemenu [ Menu_manager.menubar ~icon:stock "Exit Frama-C" (Menu_manager.Unit_callback Cmdline.bail_out) ] in quit_item.(0)#add_accelerator `CONTROL 'q' (** Register this dialog in main window menu bar *) let () = Design.register_extension insert (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/file_manager.mli0000666000000000000000000000330713571573400017366 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Nothing exported. Automatic registration. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/filetree.ml0000666000000000000000000011470213571573400016405 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype open Extlib open Gtk_helper (* To debug performance related to height of lines *) let fixed_height = false type filetree_node = | File of Datatype.Filepath.t * Cil_types.global list | Global of Cil_types.global let same_node n1 n2 = match n1, n2 with | File (f1, _), File (f2, _) -> f1 = f2 | Global g1, Global g2 -> Cil_datatype.Global.equal g1 g2 | _ -> false let _pretty_node fmt = function | File (s, _) -> Datatype.Filepath.pretty fmt s | Global (GFun ({svar = vi},_) | GVar(vi,_,_) | GFunDecl (_,vi,_) | GVarDecl(vi,_)) -> Format.fprintf fmt "%s" vi.vname | _ -> () (* Fetches the internal (hidden) GtkButton of the column header. Experimentally, to first force gtk to create a header button for the column, you should: - add first the column to the table; - explicitely set the widget of the header (and this widget should not be a button itself). Otherwise, this function will return None. *) let get_column_header_button (col: GTree.view_column) = let rec get_button = function | None -> None | Some w -> if w#misc#get_type = "GtkButton" then let but_props = GtkButtonProps.Button.cast w#as_widget in Some (new GButton.button but_props) else get_button w#misc#parent in get_button col#widget class type t = object method model : GTree.model method flat_mode: bool method set_file_attribute: ?strikethrough:bool -> ?text:string -> Datatype.Filepath.t -> unit method set_global_attribute: ?strikethrough:bool -> ?text:string -> varinfo -> unit method add_global_filter: text:string -> key:string -> (Cil_types.global -> bool) -> (unit -> bool) * GMenu.check_menu_item method get_file_globals: Datatype.Filepath.t -> (string * bool) list method find_visible_global: string -> Cil_types.global option method add_select_function : (was_activated:bool -> activating:bool -> filetree_node -> unit) -> unit method append_text_column: title:string -> tooltip:string -> visible:(unit -> bool) -> text:(global -> string) -> ?sort:(global -> global -> int) -> ([`Visibility | `Contents] -> unit) method append_pixbuf_column: title:string -> (global list -> GTree.cell_properties_pixbuf list) -> (unit -> bool) -> ([`Visibility | `Contents] -> unit) method select_global : Cil_types.global -> bool method selected_globals : Cil_types.global list method view : GTree.view method reset : unit -> unit method register_reset_extension : (t -> unit) -> unit method refresh_columns : unit -> unit end (* crude way to to debug inefficiencies with the gtk interface *) (*let c = ref 0 let gtk s = incr c; Format.printf "[%d %s]@." !c s *) module MAKE(TREE:sig type t val sons: t -> t array end) = struct type custom_tree = {finfo: TREE.t; mutable sons: custom_tree array; mutable parent: custom_tree option; fidx: int (* invariant: parent.(fidx)==myself *) } let inbound i a = i>=0 && i None | _ -> if inbound indices.(0) roots then let result = ref (roots.(indices.(0))) in try for depth=1 to Array.length indices - 1 do let index = indices.(depth) in if inbound index !result.sons then result:=!result.sons.(index) else raise Not_found done; Some !result with Not_found -> None else None method custom_get_path (row:custom_tree) : Gtk.tree_path = let current_row = ref row in let path = ref [] in while !current_row.parent <> None do path := !current_row.fidx::!path; current_row := match !current_row.parent with Some p -> p | None -> assert false done; GTree.Path.create ((!current_row.fidx)::!path) method custom_value (_t:Gobject.g_type) (_row:custom_tree) ~column:_ = assert false method custom_iter_next (row:custom_tree) : custom_tree option = let nidx = succ row.fidx in match row.parent with | None -> if inbound nidx roots then Some roots.(nidx) else None | Some parent -> if inbound nidx parent.sons then Some parent.sons.(nidx) else None method custom_iter_children (rowopt:custom_tree option) :custom_tree option = match rowopt with | None -> if inbound 0 roots then Some roots.(0) else None | Some row -> if inbound 0 row.sons then Some row.sons.(0) else None method custom_iter_has_child (row:custom_tree) : bool = Array.length row.sons > 0 method custom_iter_n_children (rowopt:custom_tree option) : int = match rowopt with | None -> Array.length roots | Some row -> Array.length row.sons method custom_iter_nth_child (rowopt:custom_tree option) (n:int) : custom_tree option = match rowopt with | None when inbound n roots -> Some roots.(n) | Some row when inbound n row.sons -> Some (row.sons.(n)) | _ -> None method custom_iter_parent (row:custom_tree) : custom_tree option = row.parent method custom_foreach f = let f p _ = f p (match self#custom_get_iter p with | Some v -> v | None -> assert false) in parent#foreach f method set_tree (fill_cache:int list->custom_tree->unit) (t:TREE.t list) = num_roots <- 0; let rec make_forest pos root sons = Array.mapi (fun i t -> let result = {finfo=t; fidx=i; parent = Some root; sons = [||] } in fill_cache (i::pos) result; let sons = make_forest (i::pos) result (TREE.sons t) in result.sons<-sons; result) sons in let new_roots = List.map (fun t -> let pos = num_roots in num_roots <- num_roots+1; let root = { finfo = t; sons = [||]; parent = None; fidx = pos } in fill_cache [pos] root; let sons = make_forest [pos] root (TREE.sons t) in root.sons <- sons; root) t in roots <- Array.of_list new_roots method clear () = self#custom_foreach (fun p _ -> self#custom_row_deleted p; false) end let custom_tree () = new custom_tree_class (new GTree.column_list) end module MYTREE = struct type storage = { mutable name : string; mutable globals: global array; mutable strikethrough: bool} type t = MFile of storage*t list | MGlobal of storage (* Sort order of the rows. *) type sort_order = | Ascending (* Ascending alphabetical order on names. *) | Descending (* Descending alphabetical order on names. *) | Custom of (global -> global -> int) (* Custom order on globals. *) let inverse_sort = function | Ascending -> Descending | Descending -> Ascending | Custom sort -> Custom (fun g h -> sort h g) let storage_type = function | MFile (s, _) -> File (Datatype.Filepath.of_string s.name, Array.to_list s.globals) | MGlobal { globals = [| g |] } -> Global g | MGlobal _ -> assert false let sons t = match t with | MFile (_,s) -> Array.of_list s | MGlobal _ -> [| |] let sons_info = function | MFile (_, l) -> List.map (function | MGlobal { name = n; strikethrough = st } -> (n, st) | MFile _ -> assert false (* should not happen, a file is never under a file in the tree *) ) l | MGlobal _ -> [] let get_storage t = match t with | MFile (s,_) -> s | MGlobal s -> s let is_function_global = function | GFun _ | GFunDecl _ -> true | _ -> false let is_defined_global = function | GFun _ | GVar _ | GEnumTag _ | GCompTag _ -> true | _ -> false let is_undefined_global = function | GFunDecl _ | GVarDecl _ | GEnumTagDecl _ | GCompTagDecl _ -> true | _ -> false let is_builtin_global g = Cil.hasAttribute "FC_BUILTIN" (Cil_datatype.Global.attr g) let comes_from_share filename = Filepath.is_relative ~base_name:Config.datadir filename let is_stdlib_global g = Cil.hasAttribute "fc_stdlib" (Cil_datatype.Global.attr g) || Cil.hasAttribute "fc_stdlib_generated" (Cil_datatype.Global.attr g) let is_function t = match t with | MFile _ -> false | MGlobal {globals = [| g |]} -> is_function_global g | MGlobal _ -> false let default_storage s globals = { name = s; globals = globals; strikethrough = false; } let global_name s = Pretty_utils.to_string Printer.pp_varname s let ga_name = function | Dfun_or_pred (li, _) -> Some (global_name li.l_var_info.lv_name) | Dvolatile _ -> Some "volatile clause" | Daxiomatic (s, _, _,_) -> Some (global_name s) | Dtype (lti, _) -> Some (global_name lti.lt_name) | Dlemma (s, _, _, _, _, _,_) -> Some (global_name s) | Dinvariant (li, _) -> Some (global_name li.l_var_info.lv_name) | Dtype_annot (li, _) -> Some (global_name li.l_var_info.lv_name) | Dmodel_annot (mf, _) -> Some (global_name mf.mi_name) | Dcustom_annot _ -> Some "custom clause" | Dextended ({ext_name},_,_) -> Some ("ACSL extension " ^ ext_name) let make_list_globals hide sort_order globs = (* Association list binding names to globals. *) let l = List.fold_left (* Correct the function sons_info above if a [File] constructor can appear in [sons] *) (fun acc glob -> match glob with | GFun ({svar=vi},_) | GVar(vi,_,_) | GVarDecl(vi,_) | GFunDecl (_, vi, _)-> (* Only display the last declaration/definition *) if hide glob || (not (Ast.is_def_or_last_decl glob)) then acc else ((global_name vi.vname), glob) :: acc | GAnnot (ga, _) -> if hide glob then acc else (match ga_name ga with | None -> acc | Some s -> (s, glob) :: acc) | _ -> acc) [] globs in let sort = match sort_order with | Ascending -> fun (s1, _) (s2, _) -> Extlib.compare_ignore_case s1 s2 | Descending -> fun (s1, _) (s2, _) -> Extlib.compare_ignore_case s2 s1 | Custom sort -> fun (name1, g1) (name2, g2) -> let c = sort g1 g2 in if c = 0 then Extlib.compare_ignore_case name1 name2 else c in let sorted = List.sort sort l in List.map (fun (name, g) -> MGlobal (default_storage name [|g|])) sorted let make_file hide sort_order (path, globs) = let storage = default_storage (path : Filepath.Normalized.t :> string) (Array.of_list globs) in let sons = make_list_globals hide sort_order globs in storage, sons end module MODEL=MAKE(MYTREE) (* Primitives to handle the filetree menu (which allows to hide some entries) *) module MenusHide = struct let hide key () = Configuration.find_bool ~default:false key let menu_item (menu: GMenu.menu) ~label ~key = let mi = GMenu.check_menu_item ~label () in mi#set_active (hide key ()); menu#add (mi :> GMenu.menu_item); mi let mi_set_callback (mi: GMenu.check_menu_item) ~key reset = mi#connect#toggled ~callback: (fun () -> let v = mi#active in Configuration.set key (Configuration.ConfBool v); reset ()) end let key_flat_mode = "filetree_flat_mode" let flat_mode = MenusHide.hide key_flat_mode let key_hide_stdlib = "filetree_hide_stdlib" let hide_stdlib = MenusHide.hide key_hide_stdlib module State = struct (* Caching between what is selected in the filetree and the gtk to the gtk node *) type cache = { cache_files: (int list * MODEL.custom_tree) Datatype.Filepath.Hashtbl.t; cache_vars: (int list * MODEL.custom_tree) Varinfo.Hashtbl.t; cache_global_annot: (int list * MODEL.custom_tree) Global_annotation.Hashtbl.t; } let default_cache () = { cache_files = Datatype.Filepath.Hashtbl.create 17; cache_vars = Varinfo.Hashtbl.create 17; cache_global_annot = Global_annotation.Hashtbl.create 17; } let path_from_node cache = function | File (s, _) -> (try Some (Datatype.Filepath.Hashtbl.find cache.cache_files s) with Not_found -> None) | Global (GFun ({svar = vi},_) | GVar(vi,_,_) | GVarDecl(vi,_) | GFunDecl (_,vi,_)) -> (try Some (Varinfo.Hashtbl.find cache.cache_vars vi) with Not_found -> None) | Global (GAnnot (ga,_)) -> (try Some (Global_annotation.Hashtbl.find cache.cache_global_annot ga) with Not_found -> None) | _ -> None let fill_cache cache (path:int list) row = match row.MODEL.finfo with | MYTREE.MFile (storage,_) -> Datatype.Filepath.Hashtbl.add cache.cache_files (Datatype.Filepath.of_string storage.MYTREE.name) (path,row) | MYTREE.MGlobal storage -> match storage.MYTREE.globals with (* Only one element in this array by invariant: this is a leaf*) | [| GFun ({svar=vi},_) | GVar(vi,_,_) | GVarDecl(vi,_) | GFunDecl (_,vi,_)|] -> Varinfo.Hashtbl.add cache.cache_vars vi (path,row) | [| GAnnot (ga,_) |] -> Global_annotation.Hashtbl.add cache.cache_global_annot ga (path,row) | _ -> (* no cache for other globals yet *) () (* Extract Cil globals. We remove builtins that are not used in this project, as well as files that do not contain anything afterwards *) let cil_files () = let files = Globals.FileIndex.get_files () in let globals_of_file f = let all = Globals.FileIndex.get_symbols f in let is_unused = function | GFun ({svar = vi},_) | GFunDecl (_, vi, _) | GVar (vi, _, _) | GVarDecl (vi, _) -> Cil.is_unused_builtin vi | _ -> false in f, Extlib.filter_out is_unused all in Extlib.filter_map' globals_of_file (fun (_, gl) -> gl <> []) files (** Make and fill the custom model with default values. *) let compute hide_filters sort_order = let hide g = List.exists (fun filter -> filter g) hide_filters in let model = MODEL.custom_tree () in let cache = default_cache () in (* Let's fill up the model with all files and functions. *) let files = cil_files () in begin if flat_mode () then let list = List.concat (List.map snd files) in let files = MYTREE.make_list_globals hide sort_order list in model#set_tree (fill_cache cache) files else let sorted_files = (List.sort (fun (p1, _) (p2, _) -> (* invert comparison order due to inversion by fold_left below *) Filepath.Normalized.compare_pretty p2 p1 ) files) in let files = List.fold_left (fun acc v -> let name, globals = MYTREE.make_file hide sort_order v in if not ((hide_stdlib ()) && (MYTREE.comes_from_share name.MYTREE.name)) then (MYTREE.MFile (name, globals))::acc else acc) [] sorted_files in model#set_tree (fill_cache cache) files; end; model, cache end (* Definitions related to 'Find text' using [visible_nodes] *) exception Found_global of Cil_types.global exception Global_not_found let make (tree_view:GTree.view) = (* Menu for configuring the filetree *) let menu = GMenu.menu () in (* Buttons to show/hide variables and/or functions *) let key_hide_variables = "filetree_hide_variables" in let key_hide_functions = "filetree_hide_functions" in let key_hide_defined = "filetree_hide_defined" in let key_hide_undefined = "filetree_hide_undefined" in let key_hide_builtins = "filetree_hide_builtins" in let key_hide_annotations = "filetree_hide_annotattions" in let hide_variables = MenusHide.hide key_hide_variables in let hide_functions = MenusHide.hide key_hide_functions in let hide_defined = MenusHide.hide key_hide_defined in let hide_undefined = MenusHide.hide key_hide_undefined in let hide_builtins = MenusHide.hide key_hide_builtins in let hide_annotations = MenusHide.hide key_hide_annotations in let initial_filter g = let hide_kind = function | GFun _ | GFunDecl _ -> hide_functions () | GVar _ | GVarDecl _ -> hide_variables () | GAnnot _ -> hide_annotations () | _ -> false in hide_kind g || (MYTREE.is_builtin_global g && hide_builtins ()) || (MYTREE.is_stdlib_global g && hide_stdlib ()) || (MYTREE.is_defined_global g && hide_defined ()) || (MYTREE.is_undefined_global g && hide_undefined ()) in let initial_sort_order = MYTREE.Ascending in let mhide_variables = MenusHide.menu_item menu ~label:"Hide variables" ~key:key_hide_variables in let mhide_functions = MenusHide.menu_item menu ~label:"Hide functions" ~key:key_hide_functions in let mhide_stdlib = MenusHide.menu_item menu ~label:"Hide stdlib" ~key:key_hide_stdlib in let mhide_defined = MenusHide.menu_item menu ~label:"Hide defined symbols" ~key:key_hide_defined in let mhide_undefined = MenusHide.menu_item menu ~label:"Hide undefined symbols" ~key:key_hide_undefined in let mhide_builtins = MenusHide.menu_item menu ~label:"Hide built-ins" ~key:key_hide_builtins in let mhide_annotations = MenusHide.menu_item menu ~label:"Hide global annotations" ~key:key_hide_annotations in let () = menu#add (GMenu.separator_item () :> GMenu.menu_item) in let mflat_mode = MenusHide.menu_item menu ~label:"Flat mode" ~key:key_flat_mode in (* Initial filetree nodes to display *) let init_model, init_path_cache = State.compute [initial_filter] initial_sort_order in let set_row model ?strikethrough ?text (path,raw_row) = let row = raw_row.MODEL.finfo in may (fun b -> (MYTREE.get_storage row).MYTREE.strikethrough <- b) strikethrough; may (fun b -> (MYTREE.get_storage row).MYTREE.name <- b) text; if false then model#custom_row_changed (GTree.Path.create (List.rev path)) raw_row in let myself = object(self) (* Invariant: the filetree is always completely rebuilt when the project changes, because Design calls [reset] below. *) (* GTK model of the filetree *) val mutable model_custom = init_model (* caching from nodes to paths *) val mutable path_cache = init_path_cache (* node currently selected *) val mutable current_node = None (* Extendable. See method register_reset_extension. *) val mutable reset_extensions = [] (* Extendable. See method add_select_function. *) val mutable select_functions = [] (* Extendable. See method add_global_filter *) val mutable hide_globals_filters = [initial_filter] (* Extendable. See method append_pixbuf_column. *) val mutable columns_visibility = [] (* Should be we call the actions registered to be applied on a node, even if the node is already selected. Used after 'reset' has been called. *) val mutable force_selection = false (* Forward reference to the first column. Always set *) val mutable name_column = None (* Sort order for the rows in the filetree. Alphabetical order on names by default, can be changed for custom order by text columns. *) val mutable sort_order = initial_sort_order (* The direction of the current sorting, and the column id according to which the tree is sorted. Used to maintain consistent sort indicators. *) val mutable sort_kind = `ASCENDING, -1 (* Properly sets the sort indicator of [column], according to the current [sort_kind]. *) method private set_sort_indicator column = let order, id = sort_kind in if id = column#get_oid then (column#set_sort_indicator true; column#set_sort_order order) else column#set_sort_indicator false (* Changes the sort order to [sort] when left-clicking on the header of [column]. *) method private change_sort column sort = match sort_kind with | `ASCENDING, id when id = column#get_oid -> sort_kind <- `DESCENDING, column#get_oid; sort_order <- MYTREE.inverse_sort sort | _ -> sort_kind <- `ASCENDING, column#get_oid; sort_order <- sort method refresh_columns () = List.iter (fun f -> f `Visibility) columns_visibility method append_text_column ~title ~tooltip ~visible ~text ?sort = let renderer = GTree.cell_renderer_text [`XALIGN 0.5] in let column = GTree.view_column ~renderer:(renderer,[]) () in ignore (tree_view#append_column column); let label = GMisc.label ~text:title () in Gtk_helper.do_tooltip ~tooltip label; column#set_widget (Some label#coerce); column#set_alignment 0.5; column#set_reorderable true; column#set_min_width 50; if fixed_height then (column#set_sizing `FIXED; column#set_resizable false; column#set_fixed_width 100) else column#set_resizable true; let texts globals = List.fold_left (fun acc global -> `TEXT (text global) :: acc) [] globals in let f model row = if visible () then let path = model#get_path row in self#set_sort_indicator column; match model_custom#custom_get_iter path with | Some {MODEL.finfo=v} -> let globals = Array.to_list MYTREE.((get_storage v).globals) in renderer#set_properties (texts globals) | None -> () in column#set_cell_data_func renderer f; let sort = match sort with | None -> fun g h -> String.compare (text g) (text h) | Some sort -> sort in let callback () = self#change_sort column (MYTREE.Custom sort); self#reset () in column#set_clickable true; ignore (column#connect#clicked ~callback); let refresh = function | `Contents -> self#reset () | `Visibility -> column#set_visible (visible ()) in refresh `Visibility; columns_visibility <- refresh :: columns_visibility; refresh method append_pixbuf_column ~title (f:(global list -> GTree.cell_properties_pixbuf list)) visible = let column = GTree.view_column ~title () in column#set_reorderable true; if fixed_height then (column#set_sizing `FIXED; column#set_resizable false; column#set_fixed_width 100) else column#set_resizable true; let renderer = GTree.cell_renderer_pixbuf [] in column#pack renderer; column#set_cell_data_func renderer (fun model row -> if visible () then let (path:Gtk.tree_path) = model#get_path row in match model_custom#custom_get_iter path with | Some {MODEL.finfo=v} -> renderer#set_properties (f (Array.to_list((MYTREE.get_storage v).MYTREE.globals))) | None -> ()); ignore (tree_view#append_column column); let filter_active, mi = self#filter_from_column visible title f in (* We return a function showing or masking the column*) let refresh = let prev = ref true in fun r -> let visible = visible () in if !prev != visible then ( (* Column freshly appeared or disappeared. Update it *) prev := visible; column#set_visible visible; mi#misc#set_sensitive visible; (* A filter is active for the column. The visible nodes have probably changed, destroy the filetree and rebuild it *) if filter_active () then self#reset (); ) (* Column state has not changed. If it is visible and its contents have changed, the nodes to display may change *) else if visible && r = `Contents && filter_active () then self#reset () in refresh `Visibility; columns_visibility <- refresh :: columns_visibility; refresh method private filter_from_column col_visible title f = let opt_active = ref (fun () -> false) in let hide_global g = col_visible () && (! opt_active)() && f [g] = [(`STOCK_ID "" : GTree.cell_properties_pixbuf)] in let text = Printf.sprintf "Selected by %s only" title in let key = "filter_" ^ title in let visible, mi = self#add_global_filter ~text ~key hide_global in opt_active := visible; (visible, mi) method view = tree_view method model = model_custom method reset () = self#reset_internal (); self#refresh_columns (); method register_reset_extension f = reset_extensions <- f :: reset_extensions method set_file_attribute ?strikethrough ?text filename = try set_row model_custom ?strikethrough ?text (Datatype.Filepath.Hashtbl.find path_cache.State.cache_files filename) with Not_found -> () (* Some files might not be in the list because of our filters. Ignore *) method set_global_attribute ?strikethrough ?text v = try set_row model_custom ?strikethrough ?text (Varinfo.Hashtbl.find path_cache.State.cache_vars v) with Not_found -> () (* Some globals might not be in the list because of our filters. Ignore *) method flat_mode = flat_mode () method get_file_globals file = try let _, raw_row = Datatype.Filepath.Hashtbl.find path_cache.State.cache_files file in MYTREE.sons_info raw_row.MODEL.finfo with Not_found -> [] (* Some files may be hidden if they contain nothing interesting *) method find_visible_global text = (* We perform up to two iterations in the list of globals, as follows: 1. First, we advance until the selected element (if any); 2. Then, we start searching for [text] until the end of the list; 3. If nothing was found, we start again, this time from the beginning of the list until the selected global. *) let regex = Str.regexp_case_fold text in let name_matches name = try ignore (Str.search_forward regex name 0); true with Not_found -> false in let found_selection = ref (current_node = None) in let model = model_custom in let get_global = function Global g -> g | _ -> assert false in let is_current_node node = match current_node with | None -> false | Some node' -> same_node node node' in (* Called when the currently selected node has been found. Either the real search can start, or we abort because we have finished wrapping around. *) let node_found () = if not !found_selection then found_selection := true else raise Global_not_found (* finished *); in let rec aux text t = match t.MODEL.finfo with | MYTREE.MFile ({MYTREE.name},_) -> (* search children *) (* note: we avoid calling [storage_type] here because we do not need the child nodes *) let fake_node = File (Datatype.Filepath.of_string name,[]) in if is_current_node fake_node then node_found (); Array.iter (aux text) t.MODEL.sons | MYTREE.MGlobal {MYTREE.name} as st -> let node = MYTREE.storage_type st in if is_current_node node then node_found () else (* We never consider the current node as matching. This way, if 'foo' is selected, we can search for 'fo' and find it farther.*) if !found_selection && name_matches name then raise (Found_global (get_global node)) in try Array.iter (aux text) model#get_roots; (* First search did not succeed, will try second search if user wants to wrap around. *) if current_node <> None && GToolbox.question_box ~title:"Not found" (Printf.sprintf "No more occurrences for: %s\n\ Search from beginning?" text) ~buttons:["Yes"; "No"] = 1(*yes*) then begin assert (!found_selection); (* try searching again *) Array.iter (aux text) model#get_roots; end; None with | Found_global g -> Some g | Global_not_found -> None method private enable_select_functions () = let select path path_currently_selected = let fail e = Gui_parameters.error "selector handler got an internal error, please report: %s@.%s@." (Printexc.to_string e) (Printexc.get_backtrace ()) in try let {MODEL.finfo=t} = Extlib.the (model_custom#custom_get_iter path) in let selected_node = MYTREE.storage_type t in let was_activated = match current_node with | None -> false | Some old_node -> same_node selected_node old_node in if (force_selection || not was_activated) && not path_currently_selected then begin (*Format.printf "##Select %a: %b %b %b, %s@." pretty_node selected_node force_selection was_activated path_currently_selected (GTree.Path.to_string path) *) current_node <- Some selected_node; let old_force_selection = force_selection in List.iter (fun f -> try f ~was_activated:(not old_force_selection && was_activated) ~activating:true selected_node with e -> fail e) select_functions; end; force_selection <- false; true with e -> Gui_parameters.error "gui could not select row in filetree, please report: %s" (Printexc.to_string e); true in tree_view#selection#set_select_function select method add_select_function f = select_functions <- select_functions@[f]; method private varinfo_of_global g = match g with | GVar (vi, _, _) | GVarDecl (vi, _) | GFun ({svar = vi}, _) | GFunDecl (_, vi, _) -> Some vi | _ -> None method unselect = tree_view#selection#unselect_all (); current_node <- None (* Display a path of the gtk filetree, by expanding and centering the needed nodes *) method private show_path_in_tree path = expand_to_path tree_view path; tree_view#selection#select_path path; (* set_cursor updates the keyboard cursor and scrolls to the element *) tree_view#set_cursor path (Extlib.the name_column); tree_view#misc#grab_focus () (* TODO: keep the structure of the tree, ie. reexpand all the nodes that are currently expanded (not only the currently selected) *) method private reset_internal () = (* We force a full recomputation using our filters for globals *) let mc, cache = State.compute hide_globals_filters sort_order in tree_view#set_model (Some (mc:>GTree.model)); model_custom <- mc; path_cache <- cache; List.iter (fun f -> f (self :> t)) reset_extensions; force_selection <- true; (* Here, current_node may come from another project. This is not a problem, as we only use it to do a basic search. Otherwise, the solution would be to projectify it outside of the class. *) (match current_node with | None -> () | Some node -> match State.path_from_node path_cache node with | None -> () | Some (path, _) -> self#show_path_in_tree (GTree.Path.create (List.rev path))) method select_global g = match State.path_from_node path_cache (Global g) with | None -> (* selection failed *) self#unselect; false | Some (path, _) -> self#show_path_in_tree (GTree.Path.create (List.rev path)); true method selected_globals = match current_node with | None -> [] | Some (File (_, g)) -> g | Some (Global g) -> [g] method add_global_filter ~text ~key f = hide_globals_filters <- f :: hide_globals_filters; let mi = MenusHide.menu_item menu ~label:text ~key in ignore (MenusHide.mi_set_callback mi ~key self#reset_internal); (MenusHide.hide key, mi) initializer (* Name column *) let name_renderer = GTree.cell_renderer_text [`YALIGN 0.0] in let column = GTree.view_column ~title:"Name" ~renderer:((name_renderer:>GTree.cell_renderer),[]) () in let _ = tree_view#append_column column in name_column <- Some column; let m_name_renderer renderer (lmodel:GTree.model) iter = self#set_sort_indicator column; let (path:Gtk.tree_path) = lmodel#get_path iter in match self#model#custom_get_iter path with | Some p -> let special, text, strike, underline = match p.MODEL.finfo with | MYTREE.MFile ({MYTREE.name=m; strikethrough=strike},_) -> if m = "" (* Unknown location *) then true, "Unknown file", strike, false else let path = Datatype.Filepath.of_string m in false, Filepath.Normalized.to_pretty_string path, strike, false | MYTREE.MGlobal ({MYTREE.name=m; strikethrough=strike}) as s -> false, m, strike, MYTREE.is_function s in renderer#set_properties [ `TEXT text; `STRIKETHROUGH strike; `WEIGHT (if special then `LIGHT else `NORMAL); `UNDERLINE (if underline then `LOW else `NONE) ] | None -> () in column#set_cell_data_func name_renderer (m_name_renderer name_renderer); if fixed_height then column#set_sizing `FIXED; if fixed_height then ( column#set_resizable false; column#set_fixed_width 100) else column#set_resizable true; column#set_clickable true; let title = GMisc.label ~text:"Name" () in column#set_widget (Some title#coerce); (* Filter menu when right-clicking on the column header. *) let pop_menu () = menu#popup ~button:3 ~time:(GtkMain.Main.get_current_event_time ()); in let () = match get_column_header_button column with | None -> (* Should not happen, but who knowns? *) ignore (column#connect#clicked pop_menu) | Some button -> (* Connect the menu to a right click. *) let callback evt = if GdkEvent.Button.button evt = 3 then (pop_menu (); true) else false in ignore (button#event#connect#button_release ~callback) in (* Changes the sort order when left-clicking on the column header. *) let callback () = self#change_sort column MYTREE.Ascending; self#reset () in ignore (column#connect#clicked callback); (* Sets the sort_kind to the initial sort. *) sort_kind <- `ASCENDING, column#get_oid; ignore (MenusHide.mi_set_callback mhide_functions key_hide_functions self#reset_internal); ignore (MenusHide.mi_set_callback mhide_variables key_hide_variables self#reset_internal); ignore (MenusHide.mi_set_callback mhide_stdlib key_hide_stdlib self#reset_internal); ignore (MenusHide.mi_set_callback mhide_defined key_hide_defined self#reset_internal); ignore (MenusHide.mi_set_callback mhide_undefined key_hide_undefined self#reset_internal); ignore (MenusHide.mi_set_callback mhide_builtins key_hide_builtins self#reset_internal); ignore (MenusHide.mi_set_callback mhide_annotations key_hide_annotations self#reset_internal); ignore (MenusHide.mi_set_callback mflat_mode key_flat_mode self#reset_internal); menu#add (GMenu.separator_item () :> GMenu.menu_item); tree_view#set_model (Some (init_model:>GTree.model)); self#enable_select_functions (); if fixed_height then tree_view#set_fixed_height_mode true; end in (myself:>t) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/filetree.mli0000666000000000000000000001724413571573400016561 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** The tree containing the list of modules and functions together with dynamic columns *) type filetree_node = | File of Datatype.Filepath.t * Cil_types.global list | Global of Cil_types.global (** Caml type for the infos on a node of the tree. Not all globals appear in the filetree. Currently, the visible ones are: - functions definitions, or declarations if no definition exists - global variables - global annotations @since Nitrogen-20111001 *) class type t = object method model : GTree.model method flat_mode: bool (** Return [true] if the filetree currently displays all globals in flat mode (all children of the same node), [false] otherwise (children of the file they are declared in). If [true], the methods [set_file_attribute] and [get_files_globals] must not be used @since Nitrogen-20111001 *) method set_file_attribute: ?strikethrough:bool -> ?text:string -> Datatype.Filepath.t -> unit (** Manually set some attributes of the given filename. *) method set_global_attribute: ?strikethrough:bool -> ?text:string -> Cil_types.varinfo -> unit (** Manually set some attributes of the given variable. *) method add_global_filter: text:string -> key:string -> (Cil_types.global -> bool) -> (unit -> bool) * GMenu.check_menu_item (** [add_global_filter text key f] adds a filter for the visibility of the globals, according to [f]. If any of the filters registered through this method returns true, the global is not displayed in the filetree. [text] is used in the filetree menu, to label the entry permitting to activate or deactivate the filter. [key] is used to store the current state of the filter internally. The created menu is returned. @since Nitrogen-20111001 @modify Oxygen-20120901 Signature change for the filter argument, return the menu. *) method get_file_globals: Datatype.Filepath.t -> (string * bool) list (** Return the names and the attributes (currently only the strikethrough property) of the globals in the file passed as argument *) method find_visible_global: string -> Cil_types.global option (** [find_visible_global str] searches for the next occurrence of a visible global whose name contains [str], starting at the currently selected element. Returns the global found (if any). @since Magnesium-20151001 *) method add_select_function : (was_activated:bool -> activating:bool -> filetree_node -> unit) -> unit (** Register a callback that is called whenever an element of the file tree is selected or unselected. @modify Nitrogen-20111001 Changed argument from a list of globals to [filetree_node] *) method append_text_column: title:string -> tooltip:string -> visible:(unit -> bool) -> text:(Cil_types.global -> string) -> ?sort:(Cil_types.global -> Cil_types.global -> int) -> ([`Visibility | `Contents] -> unit) (** [append_text_column ~title ~tooltip ~visible ~text ~sort] appends a new column with name [title] to the file tree, and registers [text] as a callback computing the text for each global variable. The column is displayed when [visible] returns true. Rows of the filetree can be sorted according to [sort], if it is provided. Otherwise, they can be sorted according to the alphabetical order established by [text]. The returned function can be used to force an update on the display of the column. [`Visibility] means that the column must be shown or hidden. [`Contents] means what it contains has changed. *) method append_pixbuf_column: title:string -> (Cil_types.global list -> GTree.cell_properties_pixbuf list) -> (unit -> bool) -> ([`Visibility | `Contents] -> unit) (** [append_pixbuf_column title f visible] appends a new column with name [title] to the file tree and registers [f] as a callback computing the list of properties for this column. Do not forget that properties need to be set and unset explicitly. The argument [visible] is used by the column to decide whether it should appear. The returned function can be used to force an update on the display of the column [`Visibility] means that the column must be show or hidden. [`Contents] means what it contains has changed. @modify Nitrogen-20111001 Add third argument, and change return type @modify Oxygen-20120901 Change return type *) method select_global : Cil_types.global -> bool (** Selects the given global in the tree view and run the associated callbacks. Return a boolean indicating whether the selection succeeded. (Currently, only variables and functions can be selected, provided they are not filtered out.) Unless you known what your are doing, prefer calling [main_ui#select_or_display_global], which is more resilient to globals not displayed in the filetree. @modify Nitrogen-20111001 Takes a [global] as argument, instead of a [varinfo]. Returns a boolean to indicate success or failure. *) method selected_globals : Cil_types.global list (** @since Carbon-20101201 @return the list of selected globals in the treeview. *) method view : GTree.view (** The tree view associated in which the file tree is packed. *) method reset : unit -> unit (** Resynchronize the tree view with the current project state. This is called in particular by the generic reset extension of {!Design} *) method register_reset_extension : (t -> unit) -> unit (** Register a function to be called whenever the reset method of the filetree is called. *) method refresh_columns : unit -> unit (** Refresh the state of all the non-source columns of the filetree, by hiding those that should be hidden, and displaying the others. Called by [reset] @since Nitrogen-20111001 *) end val make : GTree.view -> t (** Create a file tree packed in the given tree_view. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/gtk_compat.2.ml0000666000000000000000000000613613571573400017077 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Pango = struct open Wutil_once let small_font = once (fun f -> let f = Pango.Font.copy f in let s = Pango.Font.get_size f in Pango.Font.set_size f (s-2) ; f) let bold_font = once (fun f -> let f = Pango.Font.copy f in Pango.Font.set_weight f `BOLD ; f) let modify_font phi widget = widget#misc#modify_font (phi widget#misc#pango_context#font_description) let set_small_font w = modify_font small_font w let set_bold_font w = modify_font bold_font w end let get_toolbar_index (toolbar:GButton.toolbar) (item:GButton.tool_item) = toolbar#get_item_index item let window ?(kind:Gtk.Tags.window_type option) ?(title:string option) ?(decorated:bool option) ?(deletable:bool option) ?(focus_on_map:bool option) ?(icon:GdkPixbuf.pixbuf option) ?(icon_name:string option) ?(modal:bool option) ?(position:Gtk.Tags.window_position option) ?(resizable:bool option) ?(screen:Gdk.screen option) ?(type_hint:Gdk.Tags.window_type_hint option) ?(urgency_hint:bool option) ?(wmclass:(string * string) option) ?(border_width:int option) ?(width:int option) ?(height:int option) ?(show:bool option) () = let allow_shrink = resizable in let allow_grow = resizable in ignore wmclass; GWindow.window ?kind ?title ?decorated ?deletable ?focus_on_map ?icon ?icon_name ?modal ?position ?resizable ?allow_grow ?allow_shrink ?screen ?type_hint ?urgency_hint ?border_width ?width ?height ?show () frama-c-20.0-Calcium/src/plugins/gui/gtk_compat.3.ml0000666000000000000000000000440113571573400017071 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Pango = struct open Wutil_once let small_font = once (fun (f: GPango.font_description) -> let f = f#copy in let size = f#size - 2 in f#modify ~size (); f) let bold_font = once (fun (f: GPango.font_description) -> let f = f#copy in let weight = `BOLD in f#modify ~weight (); f) let modify_font phi (widget: #GObj.widget) = widget#misc#modify_font (phi widget#misc#pango_context#font_description) let set_small_font w = modify_font small_font w let set_bold_font w = modify_font bold_font w end let get_toolbar_index toolbar item = toolbar#get_item_index item#as_tool_item let window = GWindow.window frama-c-20.0-Calcium/src/plugins/gui/gtk_compat.mli0000666000000000000000000000443213571573400017105 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Pango : sig val set_small_font : #GObj.widget -> unit (** makes the font smaller. *) val set_bold_font : #GObj.widget -> unit (** makes the font bold. *) end val get_toolbar_index: GButton.toolbar -> GButton.tool_item -> int val window: ?kind:Gtk.Tags.window_type -> ?title:string -> ?decorated:bool -> ?deletable:bool -> ?focus_on_map:bool -> ?icon:GdkPixbuf.pixbuf -> ?icon_name:string -> ?modal:bool -> ?position:Gtk.Tags.window_position -> ?resizable:bool -> ?screen:Gdk.screen -> ?type_hint:Gdk.Tags.window_type_hint -> ?urgency_hint:bool -> ?wmclass:(string * string) -> ?border_width:int -> ?width:int -> ?height:int -> ?show:bool -> unit -> GWindow.window frama-c-20.0-Calcium/src/plugins/gui/gtk_form.ml0000666000000000000000000001323113571573400016411 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ------------------------------------------------------------------------ *) (* --- Forms Factory --- *) (* ------------------------------------------------------------------------ *) type demon = (unit -> unit) list ref let demon () = ref [] let register demon f = demon := !demon @ [f] let refresh demon () = List.iter (fun f -> try f() with _ -> ()) !demon (* ------------------------------------------------------------------------ *) (* --- Utilities --- *) (* ------------------------------------------------------------------------ *) type 'a field = ?tooltip:string -> packing:(GObj.widget -> unit) -> (unit -> 'a) -> ('a -> unit) -> demon -> unit (* ------------------------------------------------------------------------ *) (* --- Check Button --- *) (* ------------------------------------------------------------------------ *) let check ?label ?tooltip ~packing get set demon = let button = GButton.check_button ?label ~packing ~active:(get ()) () in Gtk_helper.do_tooltip ?tooltip button ; ignore (button#connect#toggled ~callback:(fun () -> set button#active)); register demon (fun () -> button#set_active (get())) (* ------------------------------------------------------------------------ *) (* --- Menu Button --- *) (* ------------------------------------------------------------------------ *) let menu entries ?width ?tooltip ~packing get set demon = let strings = List.map fst entries in let combo_box, (_model, column) = GEdit.combo_box_text ~strings ?width ~wrap_width:1 ~packing () in let callback () = try match combo_box#active_iter with | None -> () | Some row -> let title = (combo_box#model#get ~row ~column) in let (_,item) = List.find (fun (t,_) -> t=title) entries in set item with Not_found -> () in let rec lookup k item = function | [] -> raise Not_found | (_,value) :: entries -> if value = item then k else lookup (succ k) item entries in let update () = try combo_box#set_active (lookup 0 (get ()) entries) with Not_found -> () in ignore (combo_box#connect#changed callback) ; Gtk_helper.do_tooltip ?tooltip combo_box ; register demon update (* ------------------------------------------------------------------------ *) (* --- Spinner --- *) (* ------------------------------------------------------------------------ *) let spinner ?(lower=0) ?(upper=max_int) ?width ?tooltip ~packing get set demon = let spin = GEdit.spin_button ~digits:0 ?width ~packing () in spin#adjustment#set_bounds ~lower:(float lower) ~upper:(float upper) ~step_incr:1. () ; let callback () = let a = spin#value_as_int in let b = get () in if a<>b then set a in let update () = spin#adjustment#set_value (float (get ())) in ignore (spin#connect#value_changed ~callback) ; Gtk_helper.do_tooltip ?tooltip spin ; register demon update (* ------------------------------------------------------------------------ *) (* --- Forms --- *) (* ------------------------------------------------------------------------ *) class form ~packing = object val table = GPack.table ~rows:2 ~col_spacings:8 ~packing () val mutable top = 0 method label text = ignore (GMisc.label ~text ~packing:(table#attach ~top ~left:0 ~expand:`NONE) ()) method item obj = table#attach ~top ~left:1 ~expand:`X ~fill:`X obj ; top <- succ top method row obj = table#attach ~top ~left:0 ~right:2 ~expand:`X ~fill:`X obj ; top <- succ top end let label ~text ~packing () = ignore (GMisc.label ~xpad:3 ~text ~packing ()) let button ~label ?tooltip ~callback ~packing () = let b = GButton.button ~label ~packing () in Gtk_helper.do_tooltip ?tooltip b ; ignore (b#connect#clicked ~callback) frama-c-20.0-Calcium/src/plugins/gui/gtk_form.mli0000666000000000000000000000571413571573400016571 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {b DEPRECATED.} Helpers around [Gtk_helper] to create side-panel widgets. This module should not be used anymore. The provided helpers allow for synchronizing plugin options with predefined widgets. However, the widgets should be now created with [Toolbox]. The synchronization can be achieved using [Toolbox.signal] as a replacement for above [demon]. *) (* ------------------------------------------------------------------------ *) (* --- Forms Factory --- *) (* ------------------------------------------------------------------------ *) type demon val demon : unit -> demon val register : demon -> (unit -> unit) -> unit val refresh : demon -> (unit -> unit) type 'a field = ?tooltip:string -> packing:(GObj.widget -> unit) -> (unit -> 'a) -> ('a -> unit) -> demon -> unit val check : ?label:string -> bool field val menu : (string * 'a) list -> ?width:int -> 'a field val spinner : ?lower:int -> ?upper:int -> ?width:int -> int field val label : text:string -> packing:(GObj.widget -> unit) -> unit -> unit val button : label:string -> ?tooltip:string -> callback:(unit -> unit) -> packing:(GObj.widget -> unit) -> unit -> unit class form : packing:(GObj.widget -> unit) -> object method label : string -> unit method item : GObj.widget -> unit method row : GObj.widget -> unit end frama-c-20.0-Calcium/src/plugins/gui/gtk_helper.ml0000666000000000000000000010424313571573400016731 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Generic Gtk helpers. *) let () = begin Wutil.share := Config.datadir; Wutil.flush := (fun msg -> Gui_parameters.warning "%s" msg); end let framac_logo, framac_icon = try let img ext = Some (GdkPixbuf.from_file (Config.datadir ^ "/frama-c." ^ ext)) in img "png", img "ico" with | Glib.GError _ -> Gui_parameters.warning "Frama-C icon/logo not found. Is FRAMAC_SHARE correctly set?"; None, None | GdkPixbuf.GdkPixbufError (_, errmsg) -> Gui_parameters.warning "Could not load Frama-C icon/logo: %s" errmsg; None, None module Configuration = struct include Cilconfig let configuration_file () = try Gui_parameters.Config.file ~error:false "frama-c-gui.config" with Gui_parameters.Config.No_dir -> "" let load () = loadConfiguration (configuration_file ()) let save () = saveConfiguration (configuration_file ()) let () = Cmdline.at_normal_exit save let set = setConfiguration let find = findConfiguration let use_int = useConfigurationInt let set_int key s = set key (ConfInt s) let find_int ?default key = try findConfigurationInt key with Not_found -> match default with | None -> raise Not_found | Some v -> set key (ConfInt v); v let use_float = useConfigurationFloat let set_float key f = set key (ConfFloat f) let find_float ?default key = try findConfigurationFloat key with Not_found -> match default with | None -> raise Not_found | Some v -> set key (ConfFloat v); v let use_bool = useConfigurationBool let set_bool key b = set key (ConfBool b) let find_bool ?default key = try findConfigurationBool key with Not_found -> match default with | None -> raise Not_found | Some v -> set key (ConfBool v); v let use_string = useConfigurationString let set_string key s = set key (ConfString s) let find_string ?default s = try findConfigurationString s with Not_found -> match default with | None -> raise Not_found | Some v -> set s (ConfString v); v let set_list key l = set key (ConfList l) let use_list = useConfigurationList let find_list = findConfigurationList class type ['a] selector = object method set : 'a -> unit method connect : ('a -> unit) -> unit end let config_string ~key ~default widget = let init = find_string ~default key in widget#set init ; widget#connect (set_string key) let config_int ~key ~default widget = let init = find_int ~default key in widget#set init ; widget#connect (set_int key) let config_bool ~key ~default widget = let init = find_bool ~default key in widget#set init ; widget#connect (set_bool key) let config_float ~key ~default widget = let init = find_float ~default key in widget#set init ; widget#connect (set_float key) let config_values ~key ~default ~values widget = begin let of_string s = fst (List.find (fun e -> snd e = s) values) in let to_string v = snd (List.find (fun e -> fst e = v) values) in let init = try of_string (find_string key) with Not_found -> default in widget#set init ; widget#connect (fun v -> try set_string key (to_string v) with Not_found -> ()) end end module Icon = struct type kind = Frama_C | Unmark | Fold | Unfold | Custom of string | Feedback of Property_status.Feedback.t module F = Property_status.Feedback type theme_file = | ThemeSpecific of string | ThemeGeneric of string let builtins = [(Frama_C, ThemeGeneric "frama-c.ico"); (Unmark, ThemeGeneric "unmark.png"); (Fold, ThemeSpecific "fold.png"); (Unfold, ThemeSpecific "unfold.png"); (Feedback F.Never_tried, ThemeSpecific "never_tried.png"); (Feedback F.Unknown, ThemeSpecific "unknown.png"); (Feedback F.Valid, ThemeSpecific "surely_valid.png"); (Feedback F.Invalid, ThemeSpecific "surely_invalid.png"); (Feedback F.Considered_valid, ThemeSpecific "considered_valid.png"); (Feedback F.Valid_under_hyp, ThemeSpecific "valid_under_hyp.png"); (Feedback F.Invalid_under_hyp, ThemeSpecific "invalid_under_hyp.png"); (Feedback F.Invalid_but_dead, ThemeSpecific "invalid_but_dead.png"); (Feedback F.Unknown_but_dead, ThemeSpecific "unknown_but_dead.png"); (Feedback F.Valid_but_dead, ThemeSpecific "valid_but_dead.png"); (Feedback F.Inconsistent, ThemeSpecific "inconsistent.png"); ] let theme_directory () = Configuration.find_string ~default:"default" "theme" let get_file_in_theme = function | ThemeSpecific x -> "theme/" ^ (theme_directory ()) ^ "/" ^ x | ThemeGeneric x -> x type icon = Filename of theme_file | Pixbuf of GdkPixbuf.pixbuf let h = Hashtbl.create 7 let clear () = List.iter (fun (k,f) -> Hashtbl.replace h k (Filename f)) builtins let () = clear () let get k = try match Hashtbl.find h k with | Filename f' -> let f = get_file_in_theme f' in let p = Widget.shared_icon f in Hashtbl.replace h k (Pixbuf p); p | Pixbuf p -> p with Not_found -> assert false let default = Widget.default_icon let register ~name ~file = Hashtbl.replace h (Custom name) (Filename (ThemeGeneric file)) end let apply_tag b tag pb pe = let b = (b:>GText.buffer) in let start = b#get_iter (`OFFSET pb) in let stop = b#get_iter (`OFFSET pe) in b#apply_tag ~start ~stop tag let remove_tag b tag pb pe = let b = (b:>GText.buffer) in let start = b#get_iter (`OFFSET pb) in let stop = b#get_iter (`OFFSET pe) in b#remove_tag ~start ~stop tag let cleanup_tag b tag = let b = (b:>GText.buffer) in b#remove_tag tag ~start:b#start_iter ~stop:b#end_iter (* This table shall not be projectified: it contains trans-project informations *) module IntHashtbl = Hashtbl.Make(struct type t = int let hash = Hashtbl.hash let equal : int -> int -> bool = (=) end) let tag_names = IntHashtbl.create 17 let cleanup_all_tags b = let b = (b:>GText.buffer) in let start = b#start_iter in let stop = b#end_iter in try let tags = IntHashtbl.find tag_names (Oo.id b) in Datatype.String.Set.iter (fun s -> b#remove_tag_by_name s ~start ~stop) tags with Not_found -> () let make_tag (buffer:< tag_table : Gtk.text_tag_table; create_tag : ?name:string -> GText.tag_property list -> GText.tag ; .. >) ~name l = match GtkText.TagTable.lookup buffer#tag_table name with | None -> let oid = Oo.id buffer in let old_set = try IntHashtbl.find tag_names oid with Not_found -> Datatype.String.Set.empty in IntHashtbl.replace tag_names oid (Datatype.String.Set.add name old_set); buffer#create_tag ~name l | Some t -> new GText.tag t let expand_to_path (treeview:GTree.view) path = treeview#expand_to_path path let make_formatter ?(flush= fun () -> ()) t = let t = (t:>GText.buffer) in let fmt_emit s start length = let subs = String.sub s start length in t#insert ~iter:t#end_iter subs in Format.make_formatter fmt_emit flush let redirect fmt (t:#GText.buffer) = let fmt_emit s start length = let subs = String.sub s start length in t#insert subs in let fmt_flush () = () in Format.pp_set_formatter_output_functions fmt fmt_emit fmt_flush let gui_unlocked = ref false module Lock = struct let last = ref (fun _ -> ()) module H = Hook.Build(struct type t = bool end) let extend is_last f = if is_last then last := f else H.extend f let apply b = H.apply b; !last b end module Unlock = struct let first = ref (fun () -> ()) module H = Hook.Make(struct end) let extend is_first f = if is_first then first := f else H.extend f let apply () = !first (); H.apply () end let register_locking_machinery ?(lock_last=false) ~lock ~unlock () = if lock_last then begin Lock.extend true lock; Unlock.extend true unlock end else begin Lock.extend false lock; Unlock.extend false unlock end let log_redirector ?(flush=fun () -> ()) emit_string = let output s offset length = emit_string (String.sub s offset length) in Log.set_output ~isatty:false output flush let make_string_list ~packing = let (model,column) = GTree.store_of_list Gobject.Data.string [] in let insert s = let row = model#append () in model#set ~row ~column s in let get_all () = let l = ref [] in model#foreach (fun _ row -> l := model#get ~row ~column ::!l ; false); !l in let view = GTree.view ~model ~reorderable:true ~packing () in let view_column = GTree.view_column ~title:"Source file(s)" () in let str_renderer = GTree.cell_renderer_text [] in view_column#pack str_renderer; view_column#add_attribute str_renderer "text" column; let _ = view#append_column view_column in let remove_selected () = let path_list = view#selection#get_selected_rows in let row_refs = List.map model#get_row_reference path_list in List.iter (fun rr -> ignore (model#remove rr#iter)) row_refs in insert,remove_selected, get_all let model_of_list conv l = let cols = new GTree.column_list in let column = cols#add conv in let model = GTree.list_store cols in List.iter (fun data -> let row = model#append () in model#set ~row ~column data) l ; (model, column) let string_selector completions packing = let (model, col) = model_of_list Gobject.Data.string completions in let entry = GEdit.entry ~packing () in let c = GEdit.entry_completion ~model ~entry () in c#set_text_column col ; entry (* (GEdit.combo ~popdown_strings:completions ~packing ())#entry *) let mk_label ?(use_markup=false) ?xalign (container:GPack.box) label = let l = GMisc.label ~xpad:3 ~line_wrap:true ?xalign ~packing:(container#pack ~expand:true ~fill:true) in if use_markup then l ~markup:label () else l ~text:label () type 'a chooser = GPack.box -> string -> (unit -> 'a) -> ('a -> unit) -> (unit -> unit) (* ------------------------------------------------------------------------ *) (* --- Bundle of fields --- *) (* ------------------------------------------------------------------------ *) let do_tooltip ?tooltip obj = match tooltip with | None -> () | Some text -> obj#coerce#misc#set_tooltip_text text let on_bool ?tooltip ?use_markup (container:GPack.box) label get set = let result = ref (get ()) in let container = GPack.hbox ~packing:container#pack () in do_tooltip ?tooltip container; let button = GButton.check_button ~packing:container#pack ~active:!result () in ignore (mk_label ?use_markup container ~xalign:0. label); ignore (button#connect#toggled ~callback:(fun () -> set button#active)); let update () = button#set_active (get()) in (fun () -> update ()) let range_selector ?tooltip ?use_markup (container:GPack.box) ~label ~lower ~upper set get = let container = GPack.hbox ~packing:container#pack () in do_tooltip ?tooltip container; let x = GEdit.spin_button ~digits:0 ~packing:(container#pack ~padding:10) () in x#adjustment#set_bounds ~lower:(float lower) ~upper:(float upper) ~step_incr:1. (); x#adjustment#set_value (float (get ())); ignore (x#connect#value_changed ~callback: (fun () -> set x#value_as_int)); ignore (mk_label ?use_markup ~xalign:0. container label); (fun () -> x#adjustment#set_value (float (get ()))) let on_int ?tooltip ?use_markup ?(lower=0) ?(upper=max_int) ?(sensitive=(fun () -> true)) ?width (container:GPack.box) label get set = let container = GPack.hbox ~packing:container#pack () in do_tooltip ?tooltip container; let non_fixed = width=None in let spin = GEdit.spin_button ~digits:0 ?width ~packing:(container#pack ~expand:non_fixed ~fill:non_fixed) () in spin#adjustment#set_bounds ~lower:(float lower) ~upper:(float upper) ~step_incr:1. (); spin#adjustment#set_value (float (get())); ignore (spin#connect#value_changed ~callback: (fun () -> set spin#value_as_int)); let label = mk_label ?use_markup ~xalign:0. container label in (fun () -> label#misc#set_sensitive (sensitive ()); spin#misc#set_sensitive (sensitive ()); spin#adjustment#set_value (float (get()))) let on_string ?tooltip ?use_markup ?(validator=(fun _ -> true)) ?width (container:GPack.box) label get set = let container = GPack.hbox ~packing:container#pack () in do_tooltip ?tooltip container; let entry = GEdit.entry ~packing:container#pack ~text:(get()) ?width () in let callback _ = let text = entry#text in if validator text then set text else entry#set_text (get ()); false in ignore (entry#event#connect#focus_out ~callback); ignore (entry#connect#activate ~callback:(fun () -> ignore (callback ()))); ignore (mk_label ?use_markup ~xalign:0. container label); (fun () -> if not (Gobject.Property.get entry#as_widget GtkBase.Widget.P.has_focus) then entry#set_text (get ())) let on_string_set ?tooltip ?use_markup ?width (container:GPack.box) label get set = let container = GPack.hbox ~packing:container#pack () in do_tooltip ?tooltip container; let entry = GEdit.entry ~packing:container#pack ~text:(get()) ?width () in let callback _ = set entry#text; false in ignore (entry#event#connect#focus_out ~callback); ignore (entry#connect#activate ~callback:(fun () -> ignore (callback ()))); ignore (mk_label ?use_markup ~xalign:0. container (label ^ " (list)")); (fun () -> if not (Gobject.Property.get entry#as_widget GtkBase.Widget.P.has_focus) then entry#set_text (get())) let on_string_completion ?tooltip ?use_markup ?(validator=(fun _ -> true)) completions (container:GPack.box) label get set = let box = GPack.hbox ~packing:container#pack () in do_tooltip ?tooltip box; let entry = string_selector completions box#pack in ignore (mk_label ?use_markup ~xalign:0. box label); let () = entry#set_text (get()) in let callback _ = let text = entry#text in if validator text then set text else entry#set_text (get()); false in ignore (entry#event#connect#focus_out ~callback); ignore (entry#connect#activate ~callback:(fun () -> ignore (callback ()))); (fun () -> entry#set_text (get())) let on_combo values ?tooltip ?(use_markup=false) ?width (container:GPack.box) label get set = let rec select i (x:string) = function | [] -> (-1) | y::ys -> if x=y then i else select (succ i) x ys in let container = GPack.hbox ~packing:container#pack () in do_tooltip ?tooltip container; let non_fixed = width=None in let combo_box, (_model, column) = GEdit.combo_box_text ~strings:values ?width ~wrap_width:3 ~use_markup ~packing:(container#pack ~expand:non_fixed ~fill:non_fixed) () in let callback () = match combo_box#active_iter with | None -> () | Some row -> set (combo_box#model#get ~row ~column) in let update () = let result = ref (get ()) in let k = select 0 !result values in if k >= 0 then combo_box#set_active k in ignore (combo_box#connect#changed callback) ; ignore (mk_label ~use_markup ~xalign:0. container label) ; (fun () -> update ()) (* ------------------------------------------------------------------------ *) (* --- Misc --- *) (* ------------------------------------------------------------------------ *) let save_paned_ratio key (paned:GPack.paned) = let ratio = Wutil.get_pane_ratio paned in Configuration.set key (Configuration.ConfFloat ratio) let place_paned = Wutil.set_pane_ratio let old_gtk_compat f x = try f x with Not_found -> () let trace_event (w:GObj.event_ops) = let string_of_event x = match GdkEvent.get_type x with | `NOTHING -> "nothing" | `DELETE -> "delete" | `DESTROY -> "destroy" | `EXPOSE -> "expose" | `MOTION_NOTIFY -> "motion-notify" | `BUTTON_PRESS -> "button-press" | `TWO_BUTTON_PRESS -> "2 button-press" | `THREE_BUTTON_PRESS -> "3 button-press" | `BUTTON_RELEASE -> "button-release" | `KEY_PRESS -> "key-press" | `KEY_RELEASE -> "key-release" | `ENTER_NOTIFY -> "enter-notfiy" | `LEAVE_NOTIFY -> "leave-notify" | `FOCUS_CHANGE -> "focus-change" | `CONFIGURE -> "configure" | `MAP -> "map" | `UNMAP -> "unmap" | `PROPERTY_NOTIFY -> "property-notify" | `SELECTION_CLEAR -> "selection-clear" | `SELECTION_REQUEST -> "selection-request" | `SELECTION_NOTIFY -> "selection-notify" | `PROXIMITY_IN -> "proximity-in" | `PROXIMITY_OUT -> "proximiy-out" | `DRAG_ENTER -> "drag-enter" | `DRAG_LEAVE -> "drag-leave" | `DRAG_MOTION -> "drag-motion" | `DRAG_STATUS -> "drag-status" | `DROP_START -> "drop-start" | `DROP_FINISHED -> "drop-finish" | `CLIENT_EVENT -> "client-event" | `VISIBILITY_NOTIFY -> "visibility-notify" (*GTK3 Event does not exist anymore *) (* | `NO_EXPOSE-> "no-expose" *) | `SCROLL -> "scroll" | `WINDOW_STATE -> "window-state" | `SETTING -> "setting" (*GTK3: leave room for more events. *) | _ -> "unknown-gtk3-event" in ignore (w#connect#any ~callback:(fun e -> Format.eprintf "TRACING event: %s@." (string_of_event e); false)) module MAKE_CUSTOM_LIST(A:sig type t end) = struct type custom_list = {finfo: A.t; fidx: int (* invariant: root.(fidx)==myself *) } module H = Hashtbl let inbound i a = i>=0 && i None method! custom_flags = [`LIST_ONLY] method custom_get_iter (path:Gtk.tree_path) : custom_list option = let indices: int array = GTree.Path.get_indices path in match indices with | [||] -> None | [|i|] -> self#find_opt i | _ -> failwith "Invalid Path of depth > 1 in a list" method custom_get_path (row:custom_list) : Gtk.tree_path = GTree.Path.create [row.fidx] method custom_value (_t:Gobject.g_type) (_row:custom_list) ~column:_ = assert false method custom_iter_next (row:custom_list) : custom_list option = let nidx = succ row.fidx in self#find_opt nidx method custom_iter_children (rowopt:custom_list option):custom_list option = match rowopt with | None -> self#find_opt 0 | Some _ -> None method custom_iter_has_child (_:custom_list) : bool = false method custom_iter_n_children (rowopt:custom_list option) : int = match rowopt with | None -> H.length roots | Some _ -> assert false method custom_iter_nth_child (rowopt:custom_list option) (n:int) : custom_list option = match rowopt with | None -> self#find_opt n | _ -> None method custom_iter_parent (_:custom_list) : custom_list option = None method insert (t:A.t) = let e = {finfo=t; fidx= last_idx } in self#custom_row_inserted (GTree.Path.create [last_idx]) e; H.add roots last_idx e; last_idx <- last_idx+1; method clear () = for i=last_idx-1 downto 0 do self#custom_row_deleted (GTree.Path.create [i]); done; last_idx <- 0; H.clear roots; end let custom_list () = new custom_list_class (new GTree.column_list) let make_view_column model renderer properties ~title = let m_renderer renderer (lmodel:GTree.model) iter = let (path:Gtk.tree_path) = lmodel#get_path iter in let props = match model#custom_get_iter path with | Some {finfo=v} -> properties v | None -> [] in renderer#set_properties props in let cview = GTree.view_column ~title ~renderer:(renderer,[]) () in cview#set_cell_data_func renderer (m_renderer renderer); cview end (* NOTE: this code has been copied from lablgtk's gToolbox.ml to allow binding the behavior of "keypad enter" to the "return" key *) let input_widget ~parent ~widget ~event ~get_text ~bind_ok ~expand ~title ?(ok="Ok") ?(cancel="Cancel") message = let retour = ref None in let window = GWindow.dialog ~parent ~title ~modal:false () in ignore (window#connect#destroy ~callback: GMain.Main.quit); let main_box = window#vbox in let hbox_boutons = window#action_area in let vbox_saisie = GPack.vbox ~packing: (main_box#pack ~expand: true) () in ignore (GMisc.label ~text:message ~packing:(vbox_saisie#pack ~padding:3) ()); vbox_saisie#pack widget ~expand ~padding: 3; let wb_ok = GButton.button ~label: ok ~packing: (hbox_boutons#pack ~expand: true ~padding: 3) () in wb_ok#grab_default (); let wb_cancel = GButton.button ~label: cancel ~packing: (hbox_boutons#pack ~expand: true ~padding: 3) () in let f_ok () = retour := Some (get_text ()) ; window#destroy () in let f_cancel () = retour := None; window#destroy () in ignore (wb_ok#connect#clicked f_ok); ignore (wb_cancel#connect#clicked f_cancel); (* the enter key is linked to the ok action *) (* the escape key is linked to the cancel action *) ignore (event#connect#key_press ~callback: begin fun ev -> if (GdkEvent.Key.keyval ev = GdkKeysyms._Return || GdkEvent.Key.keyval ev = GdkKeysyms._KP_Enter) && bind_ok then f_ok (); if GdkEvent.Key.keyval ev = GdkKeysyms._Escape then f_cancel (); false end); widget#misc#grab_focus (); window#show (); GMain.Main.main (); !retour (* NOTE: this code has been copied from lablgtk's gToolbox.ml to allow binding the behavior of "keypad enter" to the "return" key *) let input_string ~parent ~title ?ok ?cancel ?(text="") message = let we_chaine = GEdit.entry ~text () in if text <> "" then we_chaine#select_region 0 (we_chaine#text_length); input_widget ~parent ~widget:we_chaine#coerce ~event:we_chaine#event ~get_text:(fun () -> we_chaine#text) ~bind_ok:true ~expand: false ~title ?ok ?cancel message (* ************************************************************************** *) (** {2 Error manager} *) (* ************************************************************************** *) (** A utility class to catch exceptions and report proper error messages. *) class type host = object method error: 'a. ?parent:GWindow.window_skel -> ?reset:bool -> ('a, Format.formatter, unit) format -> 'a method full_protect : 'a. cancelable:bool -> ?parent:GWindow.window_skel -> (unit -> 'a) -> 'a option method protect : cancelable:bool -> ?parent:GWindow.window_skel -> (unit -> unit) -> unit method private set_reset: (unit -> unit) -> unit end class error_manager ?reset (o_parent:GWindow.window_skel) : host = object (self: #host) val mutable f_reset = match reset with | None -> fun () -> () | Some f -> f method private set_reset f = f_reset <- f method private error_string ?parent ~reset message = let w = GWindow.message_dialog ~message ~message_type:`ERROR ~parent:(Extlib.opt_conv o_parent parent) ~buttons:GWindow.Buttons.ok ~title:"Error" ~position:`CENTER_ALWAYS ~modal:true () in w#show (); w#present (); ignore (w#run ()); w#destroy (); if reset then f_reset () method error ?parent ?(reset=false) fmt = let b = Buffer.create 80 in let bfmt = Format.formatter_of_buffer b in Format.kfprintf (function fmt -> Format.pp_print_flush fmt (); let content = Buffer.contents b in self#error_string ?parent ~reset content) bfmt fmt method private display_toplevel_error ?parent ~cancelable e = Cmdline.error_occurred e; if cancelable then Project.Undo.restore (); self#error ?parent ~reset:true "%s" (Cmdline.protect e); method protect ~cancelable ?(parent:GWindow.window_skel option) f = ignore (self#full_protect ~cancelable ?parent f) method full_protect ~cancelable ?(parent:GWindow.window_skel option) f = let cancelable = cancelable && Gui_parameters.Undo.get () in try if cancelable then Project.Undo.breakpoint (); let old_gui_unlocked = !gui_unlocked in let res = Extlib.try_finally ~finally:(fun () -> if old_gui_unlocked then begin Unlock.apply (); gui_unlocked := true end) (fun () -> if old_gui_unlocked then begin Lock.apply cancelable; gui_unlocked := false; end; f ()) () in if cancelable then Project.Undo.clear_breakpoint (); Some res with | Cmdline.Exit -> if cancelable then Project.Undo.clear_breakpoint (); None | Sys.Break | Db.Cancel -> if cancelable then Project.Undo.restore (); self#error ?parent ~reset:true "Stopping current computation on user request."; None | Globals.No_such_entry_point msg -> (try Gui_parameters.abort "%s" msg with | Log.AbortError _ as e -> self#display_toplevel_error ?parent ~cancelable e; None) | e when Cmdline.catch_at_toplevel e -> self#display_toplevel_error ?parent ~cancelable e; None | e -> if Gui_parameters.debug_atleast 1 then begin Cmdline.error_occurred e; raise e end else begin self#display_toplevel_error ?parent ~cancelable e; None end end let make_text_page ?pos (notebook:GPack.notebook) title = let make_tab_label (notebook:GPack.notebook) = let flash_title = Format.sprintf "%s" title in let tab_label = GMisc.label ~markup:title () in let sw = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing: (fun w -> ignore (notebook#insert_page ?pos ~tab_label:tab_label#coerce w)) () in let flash b = tab_label#set_text (if b then flash_title else title); ignore(tab_label#set_use_markup true) in flash, sw in let flash,sw = make_tab_label notebook in let flash_ref = ref flash in let w = GText.view ~packing:sw#add () in let _ = w#set_editable false in let _ = w#misc#connect#map (fun () -> !flash_ref false) in let _ = w#event#connect#focus_in (fun _ -> !flash_ref false; false) in let _ = w#buffer#connect#changed (fun () -> !flash_ref true) in let reparent_page (notebook:GPack.notebook) = let flash, sw = make_tab_label notebook in flash_ref := flash; w#misc#reparent sw#coerce in reparent_page, w (* Converts the 'editor' string saved in the GUI configuration to the actual command to be executed *) let prepare_editor_cmd s line filename = let s = Str.global_replace (Str.regexp "%s") filename s in let s = Str.global_replace (Str.regexp "%d") (string_of_int line) s in (* always start in background, otherwise will freeze the GUI *) s ^ " &" let open_in_external_viewer ?(line=1) (file : Datatype.Filepath.t) = let filename = Format.asprintf "%S" (file :> string) in let editor = Configuration.find_string ~default:"emacs +%d %s" "editor" in if editor = "" then Gui_parameters.feedback "no external viewer configured in Preferences" else let cmd = prepare_editor_cmd editor line filename in Gui_parameters.feedback "opening external viewer, running command: %s" cmd; ignore (Sys.command cmd) exception Too_many_events let refresh_gui () = let counter = ref 0 in try while Glib.Main.iteration false do if !counter >= 10 then raise Too_many_events else incr counter done with Too_many_events -> () (* ************************************************************************* *) (** {2 Source File Chooser} *) (* ************************************************************************* *) class type source_files_chooser_host = object inherit host method main_window: GWindow.window_skel method reset: unit -> unit end let accepted_source_files () = let f = GFile.filter ~name:"Source files" () in List.iter (fun s -> f#add_pattern ("*" ^ s)) (File.get_suffixes ()); f let all_files () = let f = GFile.filter ~name:"All files" () in f#add_pattern "*.*"; f let source_files_chooser (main_ui: source_files_chooser_host) defaults f = let dialog = GWindow.dialog ~width:800 ~height:400 ~modal:true ~title:"Select C source files" ~parent:main_ui#main_window ~destroy_with_parent:true () in dialog#add_button_stock `CANCEL `CANCEL ; dialog#add_button_stock `OK `OPEN; let hbox = GPack.box `HORIZONTAL ~packing:dialog#vbox#add () in let filechooser = GFile.chooser_widget ~action:`OPEN ~packing:(hbox#pack ~expand:true ~fill:true) () in Configuration.use_string "last_opened_dir" (fun s -> ignore (filechooser#set_current_folder s)); filechooser#set_select_multiple true; filechooser#add_filter (accepted_source_files ()); filechooser#add_filter (all_files ()); let bbox = GPack.button_box ~layout:`START `VERTICAL ~packing:(hbox#pack ~expand:false ~fill:false) () in let add_button = GButton.button ~stock:`ADD ~packing:bbox#add () in let remove_button = GButton.button ~stock:`REMOVE ~packing:bbox#add () in let w = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:(hbox#pack ~expand:true ~fill:true) () in let add,remove,get_all = make_string_list ~packing:w#add in let add_selected_files () = let f = filechooser#get_filenames in List.iter add f in List.iter add defaults; ignore (add_button#connect#pressed ~callback:add_selected_files); ignore (remove_button#connect#pressed ~callback:remove); ignore (filechooser#connect#file_activated ~callback:add_selected_files); let response r = (match r with | `OPEN -> main_ui#protect ~cancelable:true ~parent:(dialog :> GWindow.window_skel) (fun () -> f (get_all ())) | `DELETE_EVENT | `CANCEL -> ()); Extlib.may (fun f -> Configuration.set "last_opened_dir" (Configuration.ConfString f)) filechooser#current_folder; dialog#destroy () in let (_:GtkSignal.id) = dialog#connect#response ~callback:response in dialog#show (); () let default_dir = ref "" let select_file ?title ?(dir=default_dir) ?(filename="") () = let filename = if Filename.is_relative filename then if !dir <> "" then !dir ^ "/" ^ filename else "" else begin dir:= Filename.dirname filename; filename end in let dialog: GWindow.Buttons.file_selection GWindow.file_chooser_dialog = GWindow.file_chooser_dialog ~action:`OPEN ?title ~modal:true () in ignore (dialog#set_filename filename); let result = ref None in let action r = (match r with | `OK -> let file = dialog#filename in (match file with | None -> () | Some file -> dir := Filename.dirname file; result := Some file) | _ -> ()); dialog#destroy () in dialog#add_select_button "Open" `OK; dialog#add_button "Cancel" `CANCEL; dialog#show (); action (dialog#run ()); !result let spawn_command ?(timeout=0) ?stdout ?stderr s args f = let check_result = Command.command_async s ?stdout ?stderr args in let has_timeout = timeout > 0 in let hang_on = float_of_int timeout in let starting_time = if has_timeout then Unix.time () else 0. in let for_idle () = match check_result () with | Command.Not_ready kill -> if has_timeout && Unix.time () -. starting_time >= hang_on then begin kill (); f (Unix.WSIGNALED Sys.sigalrm); false end else true | Command.Result p -> f p; false in let prio = Glib.int_of_priority `LOW in ignore (Glib.Idle.add ~prio for_idle) let image_menu_item ~(image:GObj.widget) ~text ~packing = let mi = GMenu.menu_item () in let box = GPack.hbox ~spacing:2 ~border_width:0 ~packing:mi#add () in box#add image; box#add (GMisc.label ~justify:`LEFT ~xalign:0. ~xpad:0 ~text ())#coerce; packing mi; mi (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/gtk_helper.mli0000666000000000000000000004200213571573400017074 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Generic Gtk helpers. *) val framac_logo: GdkPixbuf.pixbuf option (** @since Boron-20100401 *) val framac_icon: GdkPixbuf.pixbuf option (** @since Boron-20100401 *) (** Some generic icon management tools. @since Carbon-20101201 *) module Icon: sig type kind = Frama_C | Unmark | Fold | Unfold | Custom of string | Feedback of Property_status.Feedback.t (** Generic icons available in every proper install of Frama-C. To be able to use [Custom s] you must have called [register ~name:s ~file], otherwise you will get a generic icon placeholder. *) val register: name:string -> file:string -> unit (** [register ~name ~file] registers the kind [Custom name] associated to the filename [file]. [$FRAMAC_SHARE/f] should point to an existing file containing an image loadable by GdkPixbuf. *) val get: kind -> GdkPixbuf.pixbuf (** @return the pixbuf associated to the given kind. If the given kind is [Custom s] and no one ever called [register ~name:s ~file] where [file] is such that [$(FRAMAC_SHARE)/f] is not a real image file loadable by GdkPixbuf, a generic icon placeholder is returned. *) val default: unit -> GdkPixbuf.pixbuf val clear: unit -> unit (** Reloads the builtin icons from the theme specified in the configuration. Used when the theme is changed. @since Chlorine-20180501 *) end (** Configuration module for the GUI: all magic visual constants should use this mechanism (window width, ratios, ...). @since Carbon-20101201 *) module Configuration: sig type configData = ConfInt of int | ConfBool of bool | ConfFloat of float | ConfString of string | ConfList of configData list val load : unit -> unit val save : unit -> unit val set : string -> configData -> unit (** Set a configuration element, with a key. Overwrites the previous values *) val find: string -> configData (** Find a configuration elements, given a key. Raises Not_found if it cannot find it *) val find_int: ?default:int -> string -> int (** Like find but extracts the integer. Raises Not_found if the key is found but is not an integer. Raises Not_found if no default is given and the key is not found. If a default is given and the key is not found then the default value is stored for the given key and returned. *) val use_int: string -> (int -> unit) -> unit (** Looks for an integer configuration element, and if it is found, it is given to the given function. Otherwise, does nothing *) val set_int: string -> int -> unit (** Sets a ConfigInt *) val find_bool : ?default:bool -> string -> bool (** Same as {find_int}. *) val use_bool: string -> (bool -> unit) -> unit (** Same as {!use_int}. *) val set_bool: string -> bool -> unit (** Sets a ConfigBool *) val find_float : ?default:float -> string -> float (** Same as {!find_int}. *) val use_float: string -> (float -> unit) -> unit (** Same as {!use_int}. *) val set_float: string -> float -> unit (** Sets a ConfigFloat *) val find_string: ?default:string -> string -> string (** Same as {!find_int}. *) val use_string: string -> (string -> unit) -> unit (** Same as {!use_int}. *) val find_list: string -> configData list val use_list: string -> (configData list -> unit) -> unit val set_list: string -> configData list -> unit (** Helpers to connect widgets to configuration values. The configuration value is first pushed to the widget using method [#set], or the [~default] value is used instead. Then, a callback is registered into the widget via [#connect] such that subsequent values from user's action are saved back into the configuration file. *) (** Abstract interface to the connected widget. This API is consistent with the [Widget] ones. *) class type ['a] selector = object method set : 'a -> unit (** Set's widget value to given one. *) method connect : ('a -> unit) -> unit (** Register a callback invoked by the widget each time the value is edited. *) end val config_int : key:string -> default:int -> int #selector -> unit val config_bool : key:string -> default:bool -> bool #selector -> unit val config_string : key:string -> default:string -> string #selector -> unit val config_float : key:string -> default:float -> float #selector -> unit val config_values : key:string -> default:'a -> values:('a * string) list -> 'a #selector -> unit (** The [values] field is used as a dictionary of available values. They are compared with [Pervasives.(=)]. *) end (* ************************************************************************** *) (** {2 Tags} *) (* ************************************************************************** *) val make_tag : < tag_table : Gtk.text_tag_table; create_tag : ?name:string -> GText.tag_property list -> GText.tag ; .. > -> name:string -> GText.tag_property list -> GText.tag val apply_tag : GSourceView.source_buffer -> GText.tag -> int -> int -> unit val remove_tag : GSourceView.source_buffer -> GText.tag -> int -> int -> unit val cleanup_tag : GSourceView.source_buffer -> GText.tag -> unit val cleanup_all_tags : GSourceView.source_buffer -> unit (* ************************************************************************** *) (** {2 Channels} *) (* ************************************************************************** *) val make_formatter: ?flush:(unit -> unit) -> #GText.buffer -> Format.formatter (** Build a formatter that redirects its output to the given buffer. [flush] is called whenever the formatter is flushed. *) val log_redirector: ?flush:(unit->unit) -> (string -> unit) -> unit (** Redirects all strings written to the terminal and call the given function on each. *) val redirect : Format.formatter -> #GText.buffer -> unit (** Redirect the given formatter to the given buffer *) (* ************************************************************************** *) (** {2 Asynchronous command execution} *) (* ************************************************************************** *) val spawn_command: ?timeout:int -> ?stdout:Buffer.t -> ?stderr:Buffer.t -> string -> string array -> (Unix.process_status -> unit) -> unit (** Launches the given command and calls the given function when the process terminates. If timeout is > 0 (the default) then the process will be killed if it does not end before timeout seconds. In this case the returned process status will be [Unix.WSIGNALED Sys.sigalrm]. *) (* ************************************************************************** *) (** {2 Locks} *) (* ************************************************************************** *) val gui_unlocked: bool ref (** This is a mutex you may use to prevent running some code while the GUI is locked. *) val register_locking_machinery: ?lock_last:bool -> lock:(bool -> unit) -> unlock:(unit -> unit) -> unit -> unit (** Add hooks to the locking mechanism of the GUI. [lock_last] must be set to true if [lock] must be executed after all the others locking actions and [unlock] must be executed before all the others unlocking actions. Default is [false]. At least one "lock_last" action is allowed. @since Beryllium-20090901 @modify Boron-20100401 new optional argument [lock_last] and new argument [()] *) (* ************************************************************************** *) (** 2 Tooltips *) (* ************************************************************************** *) val do_tooltip: ?tooltip:string -> < coerce: GObj.widget; .. > -> unit (** Add the given tooltip to the given widget. It has no effect if no tooltip is given. *) (* ************************************************************************** *) (** {2 Chooser} *) (* ************************************************************************** *) type 'a chooser = GPack.box -> string -> (unit -> 'a) -> ('a -> unit) -> (unit -> unit) (** The created widget is packed in the box. The two following functions are supposed to be accessors(get and set) for the value to be displayed. The returned closure may be called to resynchronize the value in the widget from the get function. *) val on_bool: ?tooltip:string -> ?use_markup:bool -> bool chooser (** Pack a check button *) val range_selector: ?tooltip:string -> ?use_markup:bool -> GPack.box -> label:string -> lower:int -> upper:int -> (int -> unit) -> (unit -> int) -> unit -> unit val on_int: ?tooltip:string -> ?use_markup:bool -> ?lower:int -> ?upper:int -> ?sensitive:(unit -> bool) -> ?width:int -> int chooser (** Pack a spin button. By default, sensitivity is set to true when this function is called. *) val on_string: ?tooltip:string -> ?use_markup:bool -> ?validator:(string -> bool) -> ?width:int -> string chooser (** Pack a string chooser *) val on_string_set: ?tooltip:string -> ?use_markup:bool -> ?width:int -> string chooser (** Pack a string-set chooser *) val on_string_completion: ?tooltip:string -> ?use_markup:bool -> ?validator:(string -> bool) -> string list -> string chooser val on_combo: string list -> ?tooltip:string -> ?use_markup:bool -> ?width:int -> string chooser (** Pack a string-selector *) (* ************************************************************************** *) (** {2 Error manager} *) (* ************************************************************************** *) (** A utility class to catch exceptions and report proper error messages. See the documentations of the methods in {!Design.main_window_extension_points}, which inherits from this class. *) class type host = object method error: 'a. ?parent:GWindow.window_skel -> ?reset:bool -> ('a, Format.formatter, unit) format -> 'a method full_protect : 'a. cancelable:bool -> ?parent:GWindow.window_skel -> (unit -> 'a) -> 'a option method protect : cancelable:bool -> ?parent:GWindow.window_skel -> (unit -> unit) -> unit method private set_reset: (unit -> unit) -> unit end (** A utility class to catch exceptions and report proper error messages. The error dialog will be transient for the [GWindow.window_skel] argument. @since Beryllium-20090901 *) class error_manager : ?reset:(unit -> unit) -> GWindow.window_skel -> host (* ************************************************************************** *) (** {2 Source files chooser} *) (* ************************************************************************** *) (** @since Boron-20100401 *) class type source_files_chooser_host = object inherit host method main_window: GWindow.window_skel method reset: unit -> unit end (** Open a dialog box for choosing C source files and performing an action on them. @since Boron-20100401 *) val source_files_chooser: source_files_chooser_host -> string list (** list of default selected files *) -> (string list -> unit) -> unit (** Launches a standard gtk file chooser window and returns the name of the selected file. Replaces GToolbox.select_file that has not been ported to lablgtk3. @since 19.0-Potassium *) val select_file: ?title:string -> ?dir:(string ref)-> ?filename:string -> unit -> string option (* ************************************************************************** *) (** {2 Miscellaneous} *) (* ************************************************************************** *) val refresh_gui: unit -> unit (** Process some pending events in the main Glib loop. This is intended to be called only when [!gui_unlocked == false]. @since Beryllium-20090901 *) val string_selector: string list -> (GObj.widget -> unit) -> GEdit.entry val expand_to_path : GTree.view -> Gtk.tree_path -> unit val make_string_list: packing:(GObj.widget -> unit) -> (string -> unit)* (unit -> unit)*(unit -> string list) (** @return (add, remove_selected, get_elements) *) val place_paned: GPack.paned -> float -> unit (** Sets the position of the paned widget to the given ratio *) val save_paned_ratio: string -> GPack.paned -> unit (** Saves the current ratio of the panel associated to the given key. *) val old_gtk_compat: ('a -> unit) -> 'a -> unit (** Catch exception [Not_found] and do nothing *) val trace_event: GObj.event_ops -> unit (** Trace all events on stderr for the given object. This is a debugging function: it should not be called during normal execution. *) val make_text_page: ?pos:int -> GPack.notebook -> string -> (GPack.notebook -> unit) * GText.view (** Insert a GText.view in a new page of the notebook with the given title, at position [pos] if specified, or last if not. It returns a new GText.view together with a function to reparent the inserted page in another notebook. The tab label of the created page will be highlighted whenever its contents changes. @since Beryllium-20090901 *) val open_in_external_viewer : ?line:int -> Datatype.Filepath.t -> unit (** Opens [file] in an external viewer, optionally centered on line [line] (if supported by the viewer). The viewer is executed in the background (i.e. it does not block the execution of Frama-C). The external viewer is given by the environment variable [EDITOR]. If undefined, a default viewer is used. @since Magnesium-20151001 *) (** A functor to build custom Gtk lists. You'll probably prefer to use the highlevel custom models in the next module named Custom.List. It may be part of a future lablgtk release. Do not change anything without changing lablgtk svn.*) module MAKE_CUSTOM_LIST(A : sig type t end) : sig type custom_list = { finfo : A.t; fidx : int; } val inbound : int -> 'a array -> bool class custom_list_class : GTree.column_list -> object inherit [custom_list,custom_list,unit,unit] GTree.custom_tree_model method custom_decode_iter : custom_list -> unit -> unit -> custom_list method custom_encode_iter : custom_list -> custom_list * unit * unit method custom_get_iter : Gtk.tree_path -> custom_list option method custom_get_path : custom_list -> Gtk.tree_path method custom_iter_children : custom_list option -> custom_list option method custom_iter_has_child : custom_list -> bool method custom_iter_n_children : custom_list option -> int method custom_iter_next : custom_list -> custom_list option method custom_iter_nth_child : custom_list option -> int -> custom_list option method custom_iter_parent : custom_list -> custom_list option method custom_value : Gobject.g_type -> custom_list -> column:int -> Gobject.basic method insert : A.t -> unit method clear : unit -> unit end val custom_list : unit -> custom_list_class val make_view_column : custom_list_class -> ('b,'a) #GTree.cell_renderer_skel -> (A.t -> 'a list) -> title:string -> GTree.view_column end (** Copied from lablgtk [GToolbox.input_string]. See the lablgtk API for more details. *) val input_string : parent: GWindow.window -> title:string -> ?ok:string -> ?cancel:string -> ?text:string -> string -> string option (** calls the packing function to append a new menu item with an icon and a label. replaces GMenu.image_menu_item that has been deprecated in GTK3 *) val image_menu_item: image:GObj.widget -> text: string -> packing: (GMenu.menu_item -> unit) -> GMenu.menu_item (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/gui_parameters.ml0000666000000000000000000000463413571573400017617 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let () = Plugin.is_config_visible () include Plugin.Register (struct let name = "GUI" let shortname = "gui" let help = "Graphical User Interface" end) let () = Parameter_customize.do_not_projectify () module Project_name = Empty_string (struct let option_name = "-gui-project" let arg_name = "p" let help = "run the GUI on project

    after applying the \ command line actions (by default, it is run on the default project" end) (* Used mainly for debugging purposes. No need to show it to the user *) let () = Parameter_customize.is_invisible () module Undo = True (struct let option_name = "-gui-undo" let help = "possible to click on the `undo' button (set by default)" end) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/gui_parameters.mli0000666000000000000000000000347613571573400017773 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** GUI as a plug-in. *) include Plugin.S module Project_name: Parameter_sig.String (** Option -gui-project. *) module Undo: Parameter_sig.Bool (** Option -undo. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/gui_printers.ml0000666000000000000000000001564713571573400017330 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* Mapping from vid to varinfos whose name have been printed in the annotation window *) module ResolveVid = State_builder.Hashtbl(Datatype.Int.Hashtbl)(Cil_datatype.Varinfo) (struct let name = "Design.ResolveVid" let size = 67 let dependencies = [Ast.self] end) (* Maps Cil_types.typ to unique IDs (necessary for the type links). *) module ResolveTypId = State_builder.Hashtbl(Cil_datatype.TypNoUnroll.Hashtbl)(Datatype.Int) (struct let name = "Design.ResolveTypId" let size = 67 let dependencies = [Ast.self] end) (* Maps unique IDs back to Cil_types.typ. *) module ResolveTyp = State_builder.Hashtbl(Datatype.Int.Hashtbl)(Cil_datatype.TypNoUnroll) (struct let name = "Design.ResolveTyp" let size = 67 let dependencies = [Ast.self] end) (* Maps Cil_types.location to unique IDs. *) module ResolveLocId = State_builder.Hashtbl(Cil_datatype.Location.Hashtbl)(Datatype.Int) (struct let name = "Design.ResolveLocId" let size = 67 let dependencies = [Ast.self] end) (* Maps unique IDs back to Cil_types.location. *) module ResolveLoc = State_builder.Hashtbl(Datatype.Int.Hashtbl)(Cil_datatype.Location) (struct let name = "Design.ResolveLoc" let size = 67 let dependencies = [Ast.self] end) (* Returns the ID associated to a linked [typ] (adding it to the maps if needed). Only typedefs, composite types and enumerations are linked. *) let tid_of_typ typ = match typ with | TNamed _ | TComp _ | TEnum _ -> (try Some (ResolveTypId.find typ) with | Not_found -> let nextId = ResolveTypId.length () in ResolveTypId.replace typ nextId; ResolveTyp.replace nextId typ; Some nextId) | _ -> None (* Returns the ID associated to a location (adding it to the maps if needed). *) let lid_of_loc loc = try ResolveLocId.find loc with | Not_found -> let nextId = ResolveLocId.length () in ResolveLocId.replace loc nextId; ResolveLoc.replace nextId loc; nextId (* Returns the base type for a pointer/array, otherwise [t] itself. E.g. for [t = int***], returns [int]. *) let rec get_type_specifier (t:typ) = match t with | TPtr (bt, _) | TArray (bt, _, _, _) -> get_type_specifier bt | _ -> t let pp_tcomp_unfolded fmt comp attrs = (* uses GCompTag pretty-printer to expand the composite type *) let cattrs = Cil.addAttributes attrs comp.cattr in let comp = {comp with cattr = cattrs} in Printer.pp_global fmt (GCompTag (comp, Cil_datatype.Location.unknown)) let pp_enum_unfolded fmt enum attrs = (* use GEnumTag pretty-printer to expand the enum *) let eattrs = Cil.addAttributes attrs enum.eattr in let enum = {enum with eattr = eattrs} in Printer.pp_global fmt (GEnumTag (enum, Cil_datatype.Location.unknown)) (* This function is intended to be used in a class extended by {!LinkPrinter} below, as otherwise the sub-types won't be clickable. Doing it differently is difficult, because we want to unroll only one level of types (hence we cannot say that this function is the method [typ] itself), and we cannot add new public methods in extensible printers. *) let pp_typ_unfolded fmt (t : typ) = match t with | TNamed (ty, attrs) -> begin (* unfolds the typedef, and one step further if it is a TComp/TEnum *) match ty.ttype with | TComp (comp, _, cattrs) -> pp_tcomp_unfolded fmt comp (Cil.addAttributes attrs cattrs) | TEnum (enum, eattrs) -> pp_enum_unfolded fmt enum (Cil.addAttributes attrs eattrs) | _ -> Printer.pp_typ fmt (Cil.typeAddAttributes attrs ty.ttype) end | TComp (comp, _, attrs) -> pp_tcomp_unfolded fmt comp attrs | TEnum (enum, attrs) -> pp_enum_unfolded fmt enum attrs | _ -> Printer.pp_typ fmt t let pp_typ fmt typ = match tid_of_typ typ with | None -> Format.fprintf fmt "@{%a@}" Printer.pp_typ typ | Some tid -> Format.fprintf fmt "@{%a@}" tid Printer.pp_typ typ (* Override the default printer to add tags around types and some l-values *) module LinkPrinter(X: Printer.PrinterClass) = struct class printer = object inherit X.printer as super method! typ ?fundecl nameOpt fmt t = match tid_of_typ t with | None -> Format.fprintf fmt "@{%a@}" (super#typ ?fundecl nameOpt) t | Some tid -> Format.fprintf fmt "@{%a@}" tid (super#typ ?fundecl nameOpt) t method! varinfo fmt vi = ResolveVid.replace vi.vid vi; Format.fprintf fmt "@{%a@}" vi.vid super#varinfo vi method! location fmt loc = let lid = lid_of_loc loc in Format.fprintf fmt "@{%a@}" lid super#location loc end end exception NoMatch let varinfo_of_link s = try let vid = Scanf.sscanf s "vid%d" (fun id -> id) in ResolveVid.find vid with Scanf.Scan_failure _ | Not_found (* should not happen *) -> raise NoMatch let typ_of_link s = try let tid = Scanf.sscanf s "typ%d" (fun id -> id) in ResolveTyp.find tid with Scanf.Scan_failure _ | Not_found (* should not happen *) -> raise NoMatch let loc_of_link s = try let tid = Scanf.sscanf s "loc%d" (fun id -> id) in ResolveLoc.find tid with Scanf.Scan_failure _ | Not_found (* should not happen *) -> raise NoMatch frama-c-20.0-Calcium/src/plugins/gui/gui_printers.mli0000666000000000000000000000640613571573400017472 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Special pretty-printers for the GUI. Some sub-elements are annotated by format tags, in order to make them reactive. *) val get_type_specifier: Cil_types.typ -> Cil_types.typ (** Returns the base type for a pointer/array, otherwise [t] itself. E.g. for [t = int***], returns [int]. *) val pp_typ: Format.formatter -> Cil_types.typ -> unit (** Same as {!Printer.pp_typ}, except that the type is output between Format tags [@{}], that are recognized by the GUI. *) val pp_typ_unfolded: Format.formatter -> Cil_types.typ -> unit (** Pretty-prints a type, unfolding it once if it is a typedef, enum, struct or union. *) module LinkPrinter: Printer.PrinterExtension (** Special pretty-printer that outputs tags [link:vidN] around varinfos, and [link:typN] around types. *) exception NoMatch val varinfo_of_link: string -> Cil_types.varinfo (** Convert a string of the form [link:vidN] into the varinfo of vid [N]. This varinfo must have been printed by a pretty-printer extended with {!LinkPrinter}. Raise [NoMatch] if the link is not of the form [link:vidN]. *) val typ_of_link: string -> Cil_types.typ (** Convert a string of the form [link:typN] into a type. The association between [N] and the type is done by printing the type once using {!pp_typ}, or by using a printer extended with {!LinkPrinter}. Raise [NoMatch] if the link is not of the form [link:typN]. *) val loc_of_link: string -> Cil_types.location (** Convert a string of the form [link:locN] into the location of id [N]. This location must have been printed by a pretty-printer extended with {!LinkPrinter}. Raise [NoMatch] if the link is not of the form [link:locN]. *) frama-c-20.0-Calcium/src/plugins/gui/help_manager.ml0000666000000000000000000001140013571573400017217 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let show main_ui = let authors = [ "Michele Alberti"; "Thibaud Antignac"; "Gergö Barany"; "Patrick Baudin"; "Allan Blanchard"; "Lionel Blatter"; "François Bobot"; "Richard Bonichon"; "Quentin Bouillaguet"; "David Bühler"; "Zakaria Chihani"; "Loïc Correnson"; "Julien Crétin"; "Pascal Cuoq"; "Zaynah Dargaye"; "Jean-Christophe Filliâtre"; "Philippe Herrmann"; "Maxime Jacquemin"; "Florent Kirchner"; "Tristan Le Gall"; "Jean-Christophe Léchenet"; "Matthieu Lemerre"; "Dara Ly"; "David Maison"; "Claude Marché"; "André Maroneze"; "Thibault Martin"; "Fonenantsoa Maurica"; "Melody Méaulle"; "Benjamin Monate"; "Yannick Moy"; "Anne Pacalet"; "Valentin Perrelle"; "Guillaume Petiot"; "Virgile Prevosto"; "Armand Puccetti"; "Virgile Robles"; "Muriel Roger"; "Julien Signoles"; "Kostyantyn Vorobyov"; "Boris Yakobowski" ] in let copyright (* should be automatically generated *) = "\t © CEA and INRIA for the Frama-C kernel\n\ \t © CEA for the GUI and plug-ins constant propagation, from, inout, impact, \ metrics, occurrence pdg, postdominators, scope, security_slicing, \ semantic callgraph, slicing, sparecode, syntactic callgraph, users and value.\n\ \n\ See the particular header of each source file for details." in let license (* should be automatically generated *) = "Licenses of the Frama-C kernel and plug-ins are either under LGPL v2.1, \ or BSD.\n\ See the particular header of each source file for details." in let dialog = GWindow.about_dialog ~parent:main_ui#main_window ?icon:Gtk_helper.framac_icon ?logo:Gtk_helper.framac_logo ~name:"Frama-C" ~authors ~copyright ~license ~website:"http://frama-c.com" ~website_label:"Questions and support" ~version:Config.version_and_codename ~comments:"Frama-C is a suite of tools dedicated to the analysis of the \ source code of software written in C." () in (* Buggy labgtk2 prevents this from working...*) ignore (dialog#connect#response ~callback:(fun _ -> try dialog#coerce#destroy () with Not_found -> ())); try ignore (dialog#run ()) with | Not_found -> () (* ignore: raised because of a buggy lablgtk2 *) | Failure msg as e -> if msg = "dialog destroyed" then (* ignore: raised because of a buggy lablgtk2 *) () else raise e (** Register this dialog in main window menu bar *) let () = Design.register_extension (fun window -> let menu_manager = window#menu_manager () in let _helpitem, helpmenu = menu_manager#add_menu "_Help" ~pos:(List.length menu_manager#factory#menu#children) in (* helpitem#set_right_justified true;*) ignore (menu_manager#add_entries helpmenu [ Menu_manager.menubar ~icon:`ABOUT "About" (Menu_manager.Unit_callback (fun () -> show window)); ]); ) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/help_manager.mli0000666000000000000000000000330713571573400017377 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Nothing exported. Automatic registration. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/history.ml0000666000000000000000000002775713571573400016324 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type history_elt = | Global of global | Localizable of Pretty_source.localizable module HistoryElt = struct include Datatype.Make (struct include Datatype.Undefined type t = history_elt let name = "History.history_elt" let reprs = List.map (fun g -> Global g) Cil_datatype.Global.reprs let mem_project = Datatype.never_any_project let equal e1 e2 = match e1, e2 with | Global g1, Global g2 -> Cil_datatype.Global.equal g1 g2 | Localizable l1, Localizable l2 -> Printer_tag.Localizable.equal l1 l2 | (Global _ | Localizable _), __ -> false end) (* Identify two elements that belong to the same function *) let in_same_fun e1 e2 = let f = function | Global (GFunDecl (_, vi, _) | GFun ({svar = vi}, _)) -> (try Some (Globals.Functions.get vi) with Not_found -> None) | Localizable l -> Pretty_source.kf_of_localizable l | _ -> None in match f e1 with | None -> false | Some f1 -> match f e2 with | None -> false | Some f2 -> Kernel_function.equal f1 f2 end type history = { back: history_elt list; current: history_elt option; forward: history_elt list; } let default_history = { back = []; current = None; forward = []; } module History = Datatype.Make (struct include Datatype.Undefined type t = history let name = "History.history" let reprs = [default_history] let mem_project = Datatype.never_any_project let pretty fmt h = Format.fprintf fmt "back %d, cur %b, forward %d" (List.length h.back) (h.current <> None) (List.length h.forward) end) include History module CurrentHistory = State_builder.Ref (History) (struct let name = "History.CurrentHistory" let dependencies = [Ast.self] let default _ = default_history end) (* This is correct because the implementation makes sure that [.current = None] implies [.forward = [] && .back = []] *) let is_empty () = (CurrentHistory.get ()).current = None let can_go_back () = (CurrentHistory.get ()).back <> [] let can_go_forward () = (CurrentHistory.get ()).forward <> [] let display_elt = ref (fun _ -> ()) let set_display_elt_callback f = display_elt := f let show_current () = let h = CurrentHistory.get () in Extlib.may !display_elt h.current; CurrentHistory.set h let back () = let h = CurrentHistory.get () in match h.current, h.back with | Some cur, prev :: prevs -> let h' = {back = prevs; current = Some prev; forward= cur::h.forward} in !display_elt prev; CurrentHistory.set h' | None, prev :: prevs -> let h' = { back = prevs; current = Some prev ; forward = h.forward } in !display_elt prev; CurrentHistory.set h' | _, [] -> () let forward () = let h = CurrentHistory.get () in match h.current, h.forward with | Some cur, next :: nexts -> let h' = { back = cur::h.back; current = Some next; forward = nexts} in !display_elt next; CurrentHistory.set h' | None, next :: nexts -> let h' = { back = h.back; current = Some next; forward = nexts } in !display_elt next; CurrentHistory.set h' | _, [] -> () let on_current_history () = let h = CurrentHistory.get () in fun f -> CurrentHistory.set h; f () let get_current () = (CurrentHistory.get ()).current let push cur = let h = CurrentHistory.get () in let h' = match h.current with | None -> { back = h.back; current = Some cur; forward = [] } | Some prev -> if HistoryElt.equal cur prev then h else if HistoryElt.in_same_fun cur prev then { h with current = Some cur } else { back = prev :: h.back; current = Some cur; forward = [] } in CurrentHistory.set h' let set_forward els = let h = CurrentHistory.get () in let h' = { h with forward = els } in CurrentHistory.set h' let selected_localizable () = match (CurrentHistory.get ()).current with | None | Some (Global _) -> None | Some (Localizable loc) -> Some loc let create_buttons (menu_manager : Menu_manager.menu_manager) = let refresh = menu_manager#refresh in menu_manager#add_plugin ~title:"Navigation" [ Menu_manager.toolmenubar ~sensitive:can_go_back ~icon:`GO_BACK ~label:"Back" ~tooltip:"Go to previous visited source location" (Menu_manager.Unit_callback (fun () -> back (); refresh ())); Menu_manager.toolmenubar ~sensitive:can_go_forward ~icon:`GO_FORWARD ~label:"Forward" ~tooltip:"Go to next visited source location" (Menu_manager.Unit_callback (fun () -> forward (); refresh ())); ] exception Found_global of global (* We build a 'fake' global for [kf], so as to be able to search for it in the AST. Do not use Kernel_function.get_global, as [kf] is no longer in the proper project when kf_to_global is called, which leads to crashes. *) let kf_to_global kf = match kf.fundec with | Definition (d, loc) -> GFun(d,loc) | Declaration (spec, vi, _, loc) -> GFunDecl(spec, vi,loc) let translate_history_elt old_helt = let test_name_file old_name new_name old_loc new_loc = old_name = new_name && (fst old_loc).Filepath.pos_path = (fst new_loc).Filepath.pos_path in let global old_g = let iter new_g = let open Cil_types in (** In the same file, same constructor and same original name *) match old_g, new_g with | (GType( {torig_name = old_name}, old_loc), GType( {torig_name = new_name}, new_loc)) | (GEnumTag( {eorig_name = old_name}, old_loc), GEnumTag( {eorig_name = new_name}, new_loc)) | (GEnumTagDecl( {eorig_name = old_name}, old_loc), GEnumTagDecl( {eorig_name = new_name}, new_loc)) | (GCompTag( {corig_name = old_name}, old_loc), GCompTag( {corig_name = new_name}, new_loc)) | (GCompTagDecl( {corig_name = old_name}, old_loc), GCompTagDecl( {corig_name = new_name}, new_loc)) | (GVarDecl( {vorig_name = old_name}, old_loc), GVarDecl( {vorig_name = new_name}, new_loc)) | (GFunDecl(_, {vorig_name = old_name}, old_loc), GFunDecl(_, {vorig_name = new_name}, new_loc)) | (GVar( {vorig_name = old_name},_, old_loc), GVar( {vorig_name = new_name},_, new_loc)) | (GFun({svar= {vorig_name = old_name}}, old_loc), GFun({svar= {vorig_name = new_name}}, new_loc)) | (GAnnot(Dtype( {lt_name = old_name},_) , old_loc), GAnnot(Dtype( {lt_name = new_name},_) , new_loc)) | (GAnnot(Daxiomatic( old_name,_,_,_), old_loc), GAnnot(Daxiomatic( new_name,_,_,_), new_loc)) | (GAnnot(Dlemma( old_name,_,_,_,_,_,_), old_loc), GAnnot(Dlemma( new_name,_,_,_,_,_,_), new_loc)) | (GAnnot(Dfun_or_pred({l_var_info= {lv_name=old_name}},_), old_loc), GAnnot(Dfun_or_pred({l_var_info= {lv_name=new_name}},_), new_loc)) when test_name_file old_name new_name old_loc new_loc -> raise (Found_global new_g) | GAsm _, GAsm _ | GText _, GText _ | GPragma _, GPragma _ | GAnnot(Dvolatile _,_), GAnnot(Dvolatile _,_) | GAnnot(Dinvariant _,_), GAnnot(Dinvariant _,_) | GAnnot(Dtype_annot _,_), GAnnot(Dtype_annot _,_) | GAnnot(Dmodel_annot _,_), GAnnot(Dmodel_annot _,_) | GAnnot(Dcustom_annot _,_), GAnnot(Dcustom_annot _,_) -> (** they have no names *) () | _ -> (** different constructors *) () in try List.iter iter (Ast.get ()).globals; None with Found_global new_g -> Some new_g in let open Pretty_source in let open Cil_datatype in let global_Global g = Extlib.opt_map (fun x -> Global x) (global g) in match old_helt with | Global old_g -> global_Global old_g | Localizable (PGlobal old_g) -> global_Global old_g | Localizable(PVDecl(Some kf,_,_)) -> global_Global (kf_to_global kf) | Localizable ( PStmt(kf,_) | PStmtStart(kf,_) | PLval(Some kf,_,_) | PExp(Some kf,_,_) | PTermLval(Some kf,_,_,_) as loc) -> begin match global (kf_to_global kf) with | None -> (** The kernel function can't be found nothing to say *) None | Some g -> (** Try to stay at the same offset in the function *) let old_kf_loc = fst (Kernel_function.get_location kf) in let old_loc = match ki_of_localizable loc with | Kstmt s -> fst (Stmt.loc s) | Kglobal -> (* fallback *) old_kf_loc in let offset = old_loc.Filepath.pos_lnum - old_kf_loc.Filepath.pos_lnum in let new_kf_loc = fst (Global.loc g) in let new_loc = {new_kf_loc with Filepath.pos_lnum = new_kf_loc.Filepath.pos_lnum + offset; Filepath.pos_cnum = old_loc.Filepath.pos_cnum; } in match Pretty_source.loc_to_localizable new_loc with | None -> (** the line is unknown *) Some (Global g) | Some locali -> begin match kf_of_localizable locali with | None -> (** not in a kf so return the start of the function *) Some (Global g) | Some kf when not (Global.equal (kf_to_global kf) g) -> (** Fall in the wrong global, so return the start of the function *) Some (Global g) | _ -> (** Fall in the correct global *) Some (Localizable locali) end end | Localizable (PLval(None,_,_) | PExp(None,_,_) | PTermLval(None,_,_,_) | PVDecl(None,_,_)) -> (** no names useful? *) None | Localizable (PIP _ ) -> (** no names available *) None (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/history.mli0000666000000000000000000000674313571573400016465 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {1 Source code navigation history.} @since Nitrogen-20111001 *) type history_elt = | Global of Cil_types.global | Localizable of Pretty_source.localizable val is_empty: unit -> bool (** Does the history contain an event. *) val can_go_back: unit -> bool (** Are there past events in the history. *) val can_go_forward: unit -> bool (** Are there events to redo in the history. *) val back: unit -> unit (** If possible, go back one step in the history. *) val forward: unit -> unit (** If possible (ie. if [back] has been called), go forward one step in the history. *) val push: history_elt -> unit (** Add the element to the current history; clears the forward history, and push the old current element to the past history. *) val set_forward: history_elt list -> unit (** Replaces the forward history with the given elements. *) val get_current: unit -> history_elt option (** return the current history point, if available @since Sodium-20150201 *) val show_current: unit -> unit (** Redisplay the current history point, if available. Useful to refresh the gui. *) val on_current_history: unit -> ((unit -> unit) -> unit) (** [on_current_history ()] returns a closure [at] such that [at f] will execute [f] in a context in which the history will be the one relevant when [on_current_history] was executed. *) val selected_localizable: unit -> Pretty_source.localizable option (** [selected_localizable ()] returns the localizable currently selected, or [None] if nothing or an entire global is selected. *) val translate_history_elt: history_elt -> history_elt option (** try to translate the history_elt of one project to the current one @since Sodium-20150201 *) (**/**) val set_display_elt_callback: (history_elt -> unit) -> unit val create_buttons: Menu_manager.menu_manager -> Menu_manager.item array (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/launcher.ml0000666000000000000000000002521213571573400016404 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Gtk_helper module Kernel_hook = Hook.Make(struct end) class type basic_main = object inherit host method main_window: GWindow.window method reset: unit -> unit end let run (host:basic_main) dialog () = ignore (host#protect ~cancelable:true ~parent:(dialog :> GWindow.window_skel) (fun () -> dialog#destroy (); Kernel_hook.apply (); !Db.Main.play ())); (* Even if the above operation failed, we try to reset the gui, as the plugins might have done something before crashing *) ignore (host#protect ~cancelable:false ~parent:(dialog :> GWindow.window_skel) host#reset); Kernel_hook.clear () let add_parameter (box:GPack.box) p = let name = p.Typed_parameter.name in let tooltip = p.Typed_parameter.help in let is_set = p.Typed_parameter.is_set in let use_markup = is_set () in let highlight s = "" ^ s ^ "" in let hname = highlight name in (match p.Typed_parameter.accessor with | Typed_parameter.Bool ({ Typed_parameter.get = get; set = set }, None) -> let name = if use_markup then hname else name in (* fix bts#510: a parameter [p] must be set if and only if it is set by the user in the launcher. In particular, it must not be reset to its old value if setting another parameter [p'] modifies [p] via hooking. *) let old = get () in let set r = if r <> old then set r in Kernel_hook.extend (on_bool ~tooltip ~use_markup box name get set); | Typed_parameter.Bool ({ Typed_parameter.get = get; set = set }, Some negative_name) -> let use_markup = is_set () in let name, _negative_name = if use_markup then hname, highlight negative_name else name, negative_name in let old = get () in let set r = if r <> old then set r in Kernel_hook.extend (on_bool ~tooltip ~use_markup box name (*negative_name*) get set); | Typed_parameter.Int ({ Typed_parameter.get = get; set = set }, range) -> let use_markup = is_set () in let name = if use_markup then hname else name in let lower, upper = range () in let old = get () in let set r = if r <> old then set r in Kernel_hook.extend (on_int ~tooltip ~use_markup ~lower ~upper ~width:120 box name get set); | Typed_parameter.String ({ Typed_parameter.get = get; set = set }, possible_values) -> let use_markup = is_set () in let hname = if use_markup then hname else name in let old = get () in let widget_value = ref old in let w_set r = widget_value := r in let w_get () = !widget_value in (match possible_values () with | [] -> let _refresh = on_string ~tooltip ~use_markup ~width:250 box hname w_get w_set in Kernel_hook.extend (fun () -> if !widget_value <> old then set !widget_value) | v -> let validator s = let b = List.mem s v in if not b then Gui_parameters.error "invalid input `%s' for %s" s name; b in let _refresh = on_string_completion ~tooltip ~use_markup ~validator v box hname w_get w_set in Kernel_hook.extend (fun () -> if !widget_value <> old then set !widget_value)) ); use_markup let mk_text ~highlight text = let markup = if highlight then Format.sprintf "%s" text else text in let label = GMisc.label ~markup () in label#coerce let set_expander_text (exp: GBin.expander) s ~tooltip highlight = let text = mk_text ~highlight s in Gtk_helper.do_tooltip ?tooltip text; exp#set_label_widget text; exp#set_expanded highlight let add_group (box:GPack.box) label options = let box, set_expander_text = if label = "" then box, fun _ -> () else let expander = GBin.expander ~packing:box#pack () in let frame = GBin.frame ~border_width:5 ~packing:expander#add () in GPack.vbox ~packing:frame#add (), set_expander_text expander ~tooltip:None label in let highlight = List.fold_right (fun p b -> let is_set = add_parameter box p in b || is_set) options false in set_expander_text highlight; highlight let box_plugin p = let frame = GBin.frame ~border_width:5 () in let vbox = GPack.vbox ~packing:frame#add () in let markup = "" ^ String.capitalize_ascii p.Plugin.p_help ^ "" in ignore (GMisc.label ~markup ~packing:(vbox#pack ~padding:15) ()); let sorted_groups = List.sort (fun (s1, _) (s2, _) -> String.compare s1 s2) (Hashtbl.fold (fun l g acc -> if g = [] then acc else (String.capitalize_ascii l, g) :: acc) p.Plugin.p_parameters []) in let highlight = List.fold_left (fun b (l, g) -> let is_set = add_group vbox l g in b || is_set) false sorted_groups in frame, highlight (* Sort plugins, kernel first *) let compare_plugin_name n1 n2 = if n1 = "Kernel" then if n2 = "Kernel" then 0 else -1 else if n2 = "Kernel" then 1 else String.compare n1 n2 (* -------------------------------------------------------------------------- *) (* --- --- *) (* -------------------------------------------------------------------------- *) type plugin_options = string (* plugin name *) * bool (* highlighted *) * GBin.frame let listview_plugins ~(packing:?from:Gtk.Tags.pack_type -> ?expand:bool -> ?fill:bool -> ?padding:int -> GObj.widget -> unit) plugins = let module Data = Indexer.Make( struct type t = plugin_options let compare (x,_,_) (y,_,_) = compare_plugin_name x y end) in let model = object(self) val mutable m = Data.empty method data = m method size = Data.size m method index i = Data.index i m method get i = Data.get i m method add i = m <- Data.add i m; i method reload = m <- Data.empty method coerce = (self:> plugin_options Wtable.listmodel) end in let scrolling_list_plugins = GBin.scrolled_window ~packing:(packing ~expand:false ~padding:5) ~vpolicy:`AUTOMATIC ~hpolicy:`NEVER () in let w = new Wtable.list ~headers:false model#coerce in scrolling_list_plugins#add_with_viewport (w#view :> GObj.widget); let box = GPack.vbox () in let scrolling_right = GBin.scrolled_window ~packing:(packing ~expand:true ~padding:5) ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC () in scrolling_right#add_with_viewport (box :> GObj.widget); let append e = w#insert_row (model#add e) in let _ = w#add_column_text (*~title:"Plugins"*) [`YALIGN 0.0] (fun (name, highlight, _expander) -> let bold = [`FOREGROUND (if highlight then "blue" else "black")] in `TEXT name :: bold ) in w#on_click (fun (_, _, expander) _col -> List.iter box#remove (box#all_children); box#pack (expander :> GObj.widget)); (* scrolling#add_with_viewport (hbox :> GObj.widget); *) List.iter (fun (pname, p) -> let frame, highlight = box_plugin p in append (pname, highlight, frame); ) plugins; (w#view#get_column 0)#set_sizing `AUTOSIZE (* -------------------------------------------------------------------------- *) (* --- --- *) (* -------------------------------------------------------------------------- *) let show ?height ?width ~(host:basic_main) () = let dialog = GWindow.dialog ~title:"Launching analysis" ~modal:true ~position:`CENTER_ON_PARENT ~resizable:true ?width ?height ~parent:host#main_window () in ignore (dialog#misc#connect#size_allocate (fun ({Gtk.width=w;Gtk.height=h}) -> Configuration.set "launcher_width" (Configuration.ConfInt w); Configuration.set "launcher_height" (Configuration.ConfInt h))); ignore (GMisc.label ~text:"Customize parameters, then click on `Execute'" ~packing:(dialog#vbox#pack ~padding:10) ()); let hbox = GPack.hbox ~packing:(dialog#vbox#pack ~fill:true ~expand:true) () in (* Action buttons *) let buttons = GPack.button_box `HORIZONTAL ~layout:`END ~packing:dialog#action_area#pack () in let cancel = GButton.button ~label:"Cancel" ~stock:`CANCEL ~packing:buttons#pack () in ignore (cancel#connect#released dialog#destroy); let button_run = GButton.button ~label:"Configure analysis" ~stock:`EXECUTE ~packing:buttons#pack () in ignore (button_run#connect#released (run host dialog)); let plugins = ref [] in Plugin.iter_on_plugins (fun p -> plugins := (String.capitalize_ascii p.Plugin.p_name, p) :: !plugins); plugins := List.sort (fun (n1, _) (n2, _) -> compare_plugin_name n1 n2)!plugins; listview_plugins ~packing:hbox#pack !plugins; dialog#show () (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/launcher.mli0000666000000000000000000000414313571573400016555 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** The Frama-C launcher. That is the dialog box for configuring and running Frama-C with new parameter values. *) (** Subtype of {!Design.main_window_extension_points} which is required to show the launcher. *) class type basic_main = object inherit Gtk_helper.host method main_window: GWindow.window method reset: unit -> unit end val show: ?height:int -> ?width:int -> host:basic_main -> unit -> unit (** Display the Frama-C launcher. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/menu_manager.ml0000666000000000000000000003067613571573400017253 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type where = | Toolbar of GtkStock.id * string * string | Menubar of GtkStock.id option * string | ToolMenubar of GtkStock.id * string * string type callback_state = | Unit_callback of (unit -> unit) | Bool_callback of (bool -> unit) * (unit -> bool) type entry = { e_where: where; e_callback: callback_state; e_sensitive: unit -> bool } let toolbar ?(sensitive=(fun _ -> true)) ~icon ~label ?(tooltip=label) callback = { e_where = Toolbar (icon, label, tooltip); e_callback = callback; e_sensitive = sensitive } let menubar ?(sensitive=(fun _ -> true)) ?icon text callback = { e_where = Menubar (icon, text); e_callback = callback; e_sensitive = sensitive } let toolmenubar ?(sensitive=(fun _ -> true)) ~icon ~label ?(tooltip=label) callback = { e_where = ToolMenubar (icon, label, tooltip); e_callback = callback; e_sensitive = sensitive } type button_type = | BStandard of GButton.tool_button | BToggle of GButton.toggle_tool_button let bt_type_as_skel = function | BStandard b -> (b :> GButton.tool_button_skel) | BToggle b -> (b :> GButton.tool_button_skel) type menu_item_type = | MStandard of GMenu.menu_item | MCheck of GMenu.check_menu_item let mitem_type_as_skel = function | MCheck m -> (m :> GMenu.menu_item_skel) | MStandard m -> (m :> GMenu.menu_item_skel) class item ?menu ?menu_item ?button group = object (self) method menu_item = match menu_item with Some (MStandard m) -> Some m | _ -> None method check_menu_item = match menu_item with Some (MCheck m) -> Some m | _ -> None method menu_item_skel = match menu_item with Some m -> Some (mitem_type_as_skel m) | _ -> None method tool_button = match button with Some (BStandard b) -> Some b | _ -> None method toggle_tool_button = match button with Some (BToggle b) -> Some b | _ -> None method tool_button_skel = match button with Some b -> Some (bt_type_as_skel b) | None -> None method add_accelerator modifier c = Extlib.may (fun (i : GMenu.menu_item_skel) -> i#add_accelerator ~group ~flags:[ `VISIBLE ] ~modi:[ modifier ] (int_of_char c)) self#menu_item_skel method menu: GMenu.menu option = menu end (* the analyses-menu will be at the last position of the menubar *) let add_submenu container ~pos label = let item = let packing item = container#insert item ~pos in GMenu.menu_item ~use_mnemonic:true ~packing ~label () in let m = GMenu.menu () in item#set_submenu m; item, m (* external set_menu : Obj.t -> unit = "ige_mac_menu_set_menu_bar" *) class menu_manager ?packing ~host:(_:Gtk_helper.host) = let menubar = GMenu.menu_bar ?packing () in (* let () = set_menu (Obj.field (Obj.repr ((menubar)#as_widget)) 1) in *) let factory = new GMenu.factory menubar in let toolbar = GButton.toolbar ?packing () in object (self) val mutable first_tool_separator = None val analyses_menu = snd (add_submenu menubar ~pos:(-1) "_Analyses") val debug_item_and_menu = add_submenu menubar ~pos:(-1) "_Debug" val mutable debug_actions = [] val mutable menubar_items = [] val mutable toolbar_buttons = [] val mutable set_active_states = [] (** {2 API for plug-ins} *) method add_plugin ?title = self#add_entries ?title analyses_menu method add_debug ?title ?(show=fun () -> true) entries = let items = self#add_entries ?title (snd debug_item_and_menu) entries in let action item = if show () then begin Extlib.may (fun i -> i#misc#show ()) item#menu_item; Extlib.may (fun i -> i#misc#show ()) item#tool_button end else begin Extlib.may (fun i -> i#misc#hide ()) item#menu_item; Extlib.may (fun i -> i#misc#hide ()) item#tool_button end in let l = List.rev debug_actions in Array.iter (fun i -> action i; debug_actions <- (fun () -> action i) :: l) items; items (** {2 High-level API} *) method add_menu ?(pos=List.length menubar#children - 2) s = add_submenu ~pos factory#menu s method add_entries ?title ?pos container entries = (* Toolbar *) let toolbar_pos = (* The first group will be at the end of the toolbar. By default, add all the others just before this very first group. *) ref (match pos, first_tool_separator with | None, None -> 0 | None, Some sep -> max 0 (Gtk_compat.get_toolbar_index toolbar (sep:>GButton.tool_item)) | Some p, _ -> p) in let toolbar_packing w = toolbar#insert ~pos:!toolbar_pos w; incr toolbar_pos in let add_tool_separator () = if !toolbar_pos > 0 || first_tool_separator = None then begin let s = GButton.separator_tool_item ~packing:toolbar_packing () in match first_tool_separator with | None -> first_tool_separator <- Some s | Some _ -> () end in let extra_tool_separator () = match pos with | Some 0 -> add_tool_separator () | _ -> () in let add_item_toolbar stock label tooltip callback sensitive = (* let tooltip = try if (GtkStock.Item.lookup stock).GtkStock.label = "" then Some tooltip else None with Not_found -> Some tooltip in *) let b = match callback with | Unit_callback callback -> let b = GButton.tool_button ~label:tooltip ~stock ~packing:toolbar_packing () in b#set_label label; ignore (b#connect#clicked ~callback); BStandard b | Bool_callback (callback, active) -> let b = GButton.toggle_tool_button ~active:(active ()) ~label:tooltip ~stock ~packing:toolbar_packing () in b#set_label tooltip; ignore (b#connect#toggled ~callback:(fun () -> callback b#get_active)); set_active_states <- (fun () -> b#set_active (active ())) :: set_active_states; BToggle b in (bt_type_as_skel b)#misc#set_tooltip_text tooltip; toolbar_buttons <- (b, sensitive) :: toolbar_buttons; b in (* Menubar *) let menu_pos = ref (match pos with None -> -1 | Some p -> p) in let container_packing w = container#insert ~pos:!menu_pos w; if !menu_pos <> -1 then incr menu_pos in let (!!) = Lazy.force in let menubar_packing, in_menu = let aux = lazy (* if [title] is not None, we want to create the submenu only once, and late enough *) (match title with | None -> container_packing, container | Some s -> let sub = snd (add_submenu container ~pos:!menu_pos s) in (fun w -> sub#append w), sub ) in lazy (fst !!aux), lazy (snd !!aux) in let add_menu_separator = fun () -> if !menu_pos > 0 || (!menu_pos = -1 && container#children <> []) then ignore (GMenu.separator_item ~packing:container_packing ()) in let add_item_menu stock_opt label callback sensitive = let item = match stock_opt, callback with | None, Unit_callback callback -> let mi = GMenu.menu_item ~packing:!!menubar_packing ~label () in ignore (mi#connect#activate callback); MStandard mi | Some stock, Unit_callback callback -> let image = (GMisc.image ~stock ~xalign:0. () :> GObj.widget) in let text = label in let packing = !!menubar_packing in let mi = Gtk_helper.image_menu_item ~image ~text ~packing in ignore (mi#connect#activate callback); MStandard mi | _, Bool_callback (callback, active) -> let mi = GMenu.check_menu_item ~packing:!!menubar_packing ~label ~active:(active ()) () in ignore (mi#connect#activate (fun () -> callback mi#active)); set_active_states <- (fun () -> mi#set_active (active ())) :: set_active_states; MCheck mi in menubar_items <- (item, sensitive) :: menubar_items; item in let extra_menu_separator () = match pos with | Some 0 -> add_menu_separator () | _ -> () in (* Entries *) let add_item { e_where = kind; e_callback = callback; e_sensitive = sensitive} = match kind with | Toolbar(stock, label, tooltip) -> let button = add_item_toolbar stock label tooltip callback sensitive in new item ~button factory#accel_group | Menubar(stock_opt, label) -> let menu_item = add_item_menu stock_opt label callback sensitive in new item ~menu:!!in_menu ~menu_item factory#accel_group | ToolMenubar(stock, label, tooltip) -> let button = add_item_toolbar stock label tooltip callback sensitive in let menu_item = add_item_menu (Some stock) label callback sensitive in new item ~menu:!!in_menu ~menu_item ~button factory#accel_group in let edit_menubar = List.exists (function { e_where = Menubar _ | ToolMenubar _ } -> true | _ -> false) entries in let edit_toolbar = List.exists (function { e_where = Toolbar _ | ToolMenubar _ } -> true | _ -> false) entries in if edit_menubar then add_menu_separator (); if edit_toolbar then add_tool_separator (); let entries = List.map add_item entries in if edit_menubar then extra_menu_separator (); if edit_toolbar then extra_tool_separator (); Array.of_list entries method set_sensitive b = List.iter (fun (i, f) -> (bt_type_as_skel i)#misc#set_sensitive (b && f ())) toolbar_buttons; List.iter (fun (i, f) -> (mitem_type_as_skel i)#misc#set_sensitive (b && f())) menubar_items (** {2 Low-level API} *) method factory = factory method menubar = menubar method toolbar = toolbar method refresh () = List.iter (fun (i, f) -> (bt_type_as_skel i)#misc#set_sensitive (f ())) toolbar_buttons; List.iter (fun (i, f) -> (mitem_type_as_skel i)#misc#set_sensitive (f())) menubar_items; List.iter (fun f -> f ()) set_active_states; initializer let reset () = self#refresh (); List.iter (fun f -> f ()) debug_actions; let debug_item = fst debug_item_and_menu in if !Plugin.positive_debug_ref > 0 then debug_item#misc#show () else debug_item#misc#hide () in reset (); Db.Main.extend reset end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/menu_manager.mli0000666000000000000000000001462213571573400017415 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Handle the menubar and the toolbar. @since Boron-20100401 *) (** Where to put a new entry. @since Boron-20100401 *) type where = | Toolbar of GtkStock.id * string * string (** Label then tooltip *) | Menubar of GtkStock.id option (** Stock used for the icon *) * string (** Label *) | ToolMenubar of GtkStock.id * string * string (** Label then tooltip *) (** Callback for the buttons that can be in the menus. Standard buttons/menus have a callback with no argument. Buttons/menus with states are displayed with checkboxes in menus, or as toggle buttons in toolbars. They receive the after-click state as argument. The state of the button with the second argument of [Bool_callback]. Currently checks menus cannot have images in Gtk, or the [GtkStock.id] fields of [where] are ignored. @since Nitrogen-20111001 *) type callback_state = | Unit_callback of (unit -> unit) | Bool_callback of (bool -> unit) * (unit -> bool) (** @since Boron-20100401 @modify Nitrogen-20111001 *) type entry = private { e_where: where; e_callback: callback_state (** callback called when the button is clicked *); e_sensitive: unit -> bool (** should the button be activated when the gui is refreshed *); } (** {2 Smart constructors for menu entries.} If not supplied, the [sensitive] parameter is the function that always returns [true]. @since Nitrogen-20111001 *) val toolbar: ?sensitive:(unit -> bool) -> icon:GtkStock.id -> label:string -> ?tooltip:string -> callback_state -> entry val menubar: ?sensitive:(unit -> bool) -> ?icon:GtkStock.id -> string -> callback_state -> entry val toolmenubar: ?sensitive:(unit -> bool) -> icon:GtkStock.id -> label:string -> ?tooltip:string -> callback_state -> entry (** The item type corresponding to an entry. @since Boron-20100401 *) class type item = object method menu_item: GMenu.menu_item option (** @since Boron-20100401 *) method check_menu_item: GMenu.check_menu_item option (** @since Nitrogen-20111001 *) method menu_item_skel: GMenu.menu_item_skel option (** @since Nitrogen-20111001 *) method menu: GMenu.menu option (** Return the menu in which the item has been inserted, if meaningful @since Nitrogen-20111001 *) method add_accelerator: Gdk.Tags.modifier -> char -> unit (** Add an accelerator iff there is a menu item. @since Boron-20100401 *) method tool_button: GButton.tool_button option (** @since Boron-20100401 *) method toggle_tool_button: GButton.toggle_tool_button option (** @since Nitrogen-20111001 *) method tool_button_skel: GButton.tool_button_skel option (** @since Nitrogen-20111001 *) end (** How to handle a Frama-C menu. @since Boron-20100401 *) class menu_manager: ?packing:(GObj.widget -> unit) -> host:Gtk_helper.host -> object (** {2 API for plug-ins} *) method add_plugin: ?title:string -> entry list -> item array (** Add entries dedicated to a plug-in. If [title] is specified, then the entries are added in a dedicated sub-menu of name [title]. The elements of the returned array are in the same order that the ones in the input list. @since Boron-20100401 *) method add_debug: ?title:string -> ?show:(unit -> bool) -> entry list -> item array (** Add entries to the menu dedicated to debugging tools. If [title] is specified, then the entries are added in a dedicated sub-menu of name [title]. If [show] is specified, then the entries are only shown when this function returns [true] (it returns [true] by default). The elements of the returned array are in the same order that the ones in the input list. @since Boron-20100401 *) (** {2 High-level API} *) method add_menu: ?pos:int -> string -> GMenu.menu_item * GMenu.menu (** @since Boron-20100401 *) method add_entries: ?title:string -> ?pos:int -> GMenu.menu -> entry list -> item array (** Add entries in the given menu. If [title] is specified, then the entries are added in a dedicated sub-menu of name [title]. The elements of the returned array are in the same order that the ones in the input list. @since Boron-20100401 *) method set_sensitive: bool -> unit (** Set the sensitive property of all the entries. @since Boron-20100401 *) (** {2 Low-level API} *) method factory: GMenu.menu_shell GMenu.factory (** @since Boron-20100401 *) method menubar: GMenu.menu_shell (** @since Boron-20100401 *) method toolbar: GButton.toolbar (** @since Boron-20100401 *) method refresh: unit -> unit (** Reset the activation state of the buttons @since Nitrogen-20111001 *) end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/pretty_source.ml0000666000000000000000000005464013571573400017521 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Gtk_helper open Cil_datatype open Printer_tag type localizable = Printer_tag.localizable = | PStmt of (kernel_function * stmt) | PStmtStart of (kernel_function * stmt) | PLval of (kernel_function option * kinstr * lval) | PExp of (kernel_function option * kinstr * exp) | PTermLval of (kernel_function option * kinstr * Property.t * term_lval) | PVDecl of (kernel_function option * kinstr * varinfo) (** Declaration and definition of variables and function. Check the type of the varinfo to distinguish between the various possibilities. If the varinfo is a global or a local, the kernel_function is the one in which the variable is declared. The [kinstr] argument is given for local variables with an explicit initializer. *) | PGlobal of global (** all globals but variable declarations and function definitions. *) | PIP of Property.t let dkey = Gui_parameters.register_category "pretty-source" let kf_of_localizable = Printer_tag.kf_of_localizable let ki_of_localizable = Printer_tag.ki_of_localizable let varinfo_of_localizable = Printer_tag.varinfo_of_localizable module Locs:sig type state val add: state -> int * int -> localizable -> unit val iter : state -> (int * int -> localizable -> unit) -> unit val create : unit -> state val clear : state -> unit val find : state -> int -> (int * int) * localizable val hilite : state -> unit val set_hilite : state -> (unit -> unit) -> unit val add_finalizer: state -> (unit -> unit) -> unit val size : state -> int val stmt_start: state -> stmt -> int end = struct type state = { table : (int*int,localizable) Hashtbl.t; mutable hiliter : unit -> unit; mutable finalizers: (unit -> unit) list; stmt_start: int Datatype.Int.Hashtbl.t (* mapping from sid to their offset in the buffer *); } let create () = {table = Hashtbl.create 97; hiliter = (fun () -> ()); finalizers = []; stmt_start = Datatype.Int.Hashtbl.create 16; } let hilite state = state.hiliter () let set_hilite state f = state.hiliter <- f let add_finalizer state f = state.finalizers <- f :: state.finalizers let finalize state = List.iter (fun f -> f ()) (List.rev state.finalizers) let clear state = finalize state; state.finalizers <- []; state.hiliter <- (fun () -> ()); Hashtbl.clear state.table; Datatype.Int.Hashtbl.clear state.stmt_start; ;; (* Add a location range only if it is not already there. Visually only the innermost pretty printed entity is kept. For example: 'loop assigns x;' will be indexed as an assigns and not as a code annotation. *) let add state range = function | Printer_tag.PStmtStart(_,st) -> Datatype.Int.Hashtbl.add state.stmt_start st.sid (fst range) | localizable -> if not (Hashtbl.mem state.table range) then Hashtbl.add state.table range localizable let stmt_start state s = Datatype.Int.Hashtbl.find state.stmt_start s.sid let find state p = let best = ref None in let update ((b,e) as loc) sid = if b <= p && p <= e then match !best with | None -> best := Some (loc, sid) | Some ((b',e'),_) -> if e-b < e'-b' then best := Some (loc, sid) in Hashtbl.iter update state.table ; match !best with None -> raise Not_found | Some (loc,sid) -> loc, sid let iter state f = Hashtbl.iter f state.table let size state = Hashtbl.length state.table end let hilite state = Locs.hilite state let stmt_start state = Locs.stmt_start state module LocsArray:sig type t val create: Locs.state -> t val length : t -> int val get : t -> int -> (int * int) * localizable val find_next : t -> int -> (localizable -> bool) -> int end = struct (* computes an ordered array containing all the elements of a Locs.state, the order (<) being such that loc1 < loc2 if either loc1 starts before loc2, or loc1 and loc2 start at the same position but loc1 spawns further than loc2. *) type t = ((int*int) * localizable option) array let create state = let arr = Array.make (Locs.size state) ((0,0), None) in let index = ref 0 in Locs.iter state (fun (pb,pe) v -> Array.set arr !index ((pb,pe), Some v) ; incr index ) ; Array.sort (fun ((pb1,pe1),_) ((pb2,pe2),_) -> if (pb1 = pb2) then if (pe1 = pe2) then 0 else (* most englobing comes first *) Transitioning.Stdlib.compare pe2 pe1 else Transitioning.Stdlib.compare pb1 pb2 ) arr ; arr let length arr = Array.length arr (* get loc at index i; raises Not_found if none exists *) let get arr i = if i >= Array.length arr then raise Not_found else match Array.get arr i with | ((_,_),None) -> raise Not_found | ((pb,pe),Some v) -> ((pb,pe),v) (* find the next loc in array starting at index i which satisfies the predicate; raises Not_found if none exists *) let find_next arr i predicate = let rec fnext i = let ((pb',_pe'),v) = get arr i in if predicate v then pb' else fnext (i+1) in fnext i end (* Set of callsite statements where preconditions must be unfolded. *) let unfold_preconds = Cil_datatype.Stmt.Hashtbl.create 8 (* Fold or unfold the preconditions at callsite [stmt]. *) let fold_preconds_at_callsite stmt = if Cil_datatype.Stmt.Hashtbl.mem unfold_preconds stmt then Cil_datatype.Stmt.Hashtbl.remove unfold_preconds stmt else Cil_datatype.Stmt.Hashtbl.replace unfold_preconds stmt () let are_preconds_unfolded stmt = Cil_datatype.Stmt.Hashtbl.mem unfold_preconds stmt module Tag = struct let hashtbl = Hashtbl.create 0 let current = ref 0 let charcode = function | PStmt _ -> 's' | PStmtStart _ -> 'k' | PLval _ -> 'l' | PExp _ -> 'e' | PTermLval _ -> 't' | PVDecl _ -> 'd' | PGlobal _ -> 'g' | PIP _ -> 'i' let create loc = incr current ; let tag = Printf.sprintf "guitag:%c%x" (charcode loc) !current in Hashtbl.replace hashtbl tag loc ; tag let get = Hashtbl.find hashtbl end module Printer = Printer_tag.Make(Tag) exception Found of int*int (* This function identifies two distinct localizable that happen to have the same location in the source code, typically because one of them is not printed. Feel free to add other heuristics if needed. *) let equal_or_same_loc loc1 loc2 = let open Property in Localizable.equal loc1 loc2 || match loc1, loc2 with | PIP (IPReachable {ir_kinstr=Kstmt s}), PStmt (_, s') | PStmt (_, s'), PIP (IPReachable {ir_kinstr=Kstmt s}) | PIP (IPPropertyInstance {ii_stmt=s}), PStmt (_, s') | PStmt (_, s'), PIP (IPPropertyInstance {ii_stmt=s}) when Cil_datatype.Stmt.equal s s' -> true | PIP (IPReachable {ir_kf=Some kf; ir_kinstr=Kglobal}), (PVDecl (_, _, vi) | PGlobal (GFun ({ svar = vi }, _))) | (PVDecl (_, _, vi) | PGlobal (GFun ({ svar = vi }, _))), PIP (IPReachable {ir_kf=Some kf;ir_kinstr=Kglobal}) when Kernel_function.get_vi kf = vi -> true | _ -> false let locate_localizable state loc = try Locs.iter state (fun (b,e) v -> if equal_or_same_loc v loc then raise (Found(b,e))); None with Found (b,e) -> Some (b,e) let localizable_from_locs state ~file ~line = let r = ref [] in Locs.iter state (fun _ v -> let loc,_ = loc_of_localizable v in if line = loc.Filepath.pos_lnum && loc.Filepath.pos_path = file then r := v::!r); !r let buffer_formatter state source = let starts = Stack.create () in let emit_open_tag s = let s = Transitioning.Format.string_of_stag s in (* Ignore tags that are not ours *) if Extlib.string_prefix "guitag:" s then Stack.push (source#end_iter#offset, Tag.get s) starts ; "" in let emit_close_tag s = let s = Transitioning.Format.string_of_stag s in (try if Extlib.string_prefix "guitag:" s then let (p,sid) = Stack.pop starts in Locs.add state (p, source#end_iter#offset) sid with Stack.Empty -> (* This should probably be a hard error *) Gui_parameters.error "empty stack in emit_tag"); "" in let gtk_fmt = Gtk_helper.make_formatter source in Format.pp_set_tags gtk_fmt true; Format.pp_set_print_tags gtk_fmt false; Format.pp_set_mark_tags gtk_fmt true; let open Transitioning.Format in pp_set_formatter_stag_functions gtk_fmt {(pp_get_formatter_stag_functions gtk_fmt ()) with mark_open_stag = emit_open_tag; mark_close_stag = emit_close_tag;}; Format.pp_set_margin gtk_fmt 79; gtk_fmt let display_source globals (source:GSourceView.source_buffer) ~(host:Gtk_helper.host) ~highlighter ~selector state = Locs.clear state; host#protect ~cancelable:false (fun () -> source#set_text ""; source#remove_source_marks ~start:source#start_iter ~stop:source#end_iter (); let hiliter () = let event_tag = Gtk_helper.make_tag source ~name:"events" [] in Gtk_helper.cleanup_all_tags source; let locs_array = LocsArray.create state in let index_max = LocsArray.length locs_array in let index = ref 0 in while(!index < index_max) do ( try let ((pb,pe),v) = LocsArray.get locs_array !index in match v with | PStmt (_,ki) -> (try let pb,pe = match ki with | {skind = Instr _ | Return _ | Goto _ | Break _ | Continue _ | Throw _ } -> pb,pe | {skind = If _ | Loop _ | Switch _ } -> (* These statements contain other statements. We highlight only until the start of the first included statement. *) pb, (try LocsArray.find_next locs_array (!index+1) (fun p -> match p with | PStmt _ -> true | _ -> false (* Do not stop on expressions*)) with Not_found -> pb+1) | {skind = Block _ | TryExcept _ | TryFinally _ | UnspecifiedSequence _ | TryCatch _ } -> pb, (try LocsArray.find_next locs_array (!index+1) (fun _ -> true) with Not_found -> pb+1) in highlighter v ~start:pb ~stop:pe with Not_found -> ()) | PStmtStart _ | PTermLval _ | PLval _ | PVDecl _ | PGlobal _ | PIP _ | PExp _ -> highlighter v ~start:pb ~stop:pe with Not_found -> () ) ; incr index done; (* React to events on the text *) source#apply_tag ~start:source#start_iter ~stop:source#end_iter event_tag; in Locs.set_hilite state hiliter; let gtk_fmt = buffer_formatter state (source:>GText.buffer) in let display_global g = Printer.with_unfold_precond are_preconds_unfolded Printer.pp_global gtk_fmt g ; Format.pp_print_flush gtk_fmt () in let counter = ref 0 in begin try List.iter (fun g -> incr counter; if !counter > 20 then raise Exit; display_global g) globals; with Exit -> Format.fprintf gtk_fmt "@./* Cannot display more than %d globals at a time. Skipping end \ of file.@ \ Use the filetree in 'Flat mode' to navigate the remainder. */@." (!counter-1); (*let ca = source#create_child_anchor source#end_iter in source_view#add_child_at_anchor (GButton.button ~text:"See 10 more globals" ~callback:(fun _ -> call_cc next_10) ()) ca *) end; source#place_cursor source#start_iter; let last_shown_area = Gtk_helper.make_tag source ~name:"last_shown_area" [`BACKGROUND "light green"] in let event_tag = Gtk_helper.make_tag source ~name:"events" [] in let id = event_tag#connect#event ~callback: (fun ~origin:_ ev it -> if !Gtk_helper.gui_unlocked then if GdkEvent.get_type ev = `BUTTON_PRESS then begin let coords = GtkText.Iter.get_offset it in try let ((pb,pe), selected) = Locs.find state coords in (* Highlight the pointed term *) source#remove_tag ~start:source#start_iter ~stop:source#end_iter last_shown_area; apply_tag source last_shown_area pb pe; let event_button = GdkEvent.Button.cast ev in let button = GdkEvent.Button.button event_button in host#protect ~cancelable:false (fun () -> selector ~button selected); with Not_found -> () (* no statement at this offset *) end; false) in Locs.add_finalizer state (fun () -> GtkSignal.disconnect event_tag#as_tag id); ) module LineToLocalizable = Datatype.Hashtbl(Datatype.Int.Hashtbl)(Datatype.Int) (struct let module_name = "Pretty_source.LineToLocalizable" end) module FileToLines = Datatype.Hashtbl(Datatype.Filepath.Hashtbl)(Datatype.Filepath) (struct let module_name = "Pretty_source.FilesToLine" end) module MappingLineLocalizable = struct module LineToLocalizableAux = LineToLocalizable.Make( Datatype.Pair(Location)(Localizable)) include State_builder.Hashtbl(FileToLines)(LineToLocalizableAux) (struct let size = 5 let dependencies = [Ast.self] let name = "Pretty_source.line_to_localizable" end) end class pos_to_localizable = object (self) inherit Visitor.frama_c_inplace (* used to keep track of conditional expressions, to add them to the list of relevant localizables *) val mutable insideIf = None method add_range loc (localizable : localizable) = if not (Location.equal loc Location.unknown) then ( let p1, p2 = loc in if p1.Filepath.pos_path <> p2.Filepath.pos_path then Gui_parameters.debug ~once:true "Localizable over two files: %a and %a; %a" Datatype.Filepath.pretty p1.Filepath.pos_path Datatype.Filepath.pretty p2.Filepath.pos_path Localizable.pretty localizable; let file = p1.Filepath.pos_path in let hfile = try MappingLineLocalizable.find file with Not_found -> let h = LineToLocalizable.create 17 in MappingLineLocalizable.add file h; h in for i = p1.Filepath.pos_lnum to p2.Filepath.pos_lnum do LineToLocalizable.add hfile i (loc, localizable); done ); method! vstmt_aux s = (* we ignore Block statements, since they tend to overlap existing ones which are more precise *) let skip = match s.skind with | Block _ -> true | _ -> false in if not skip then self#add_range (Stmt.loc s) (PStmt (Extlib.the self#current_kf, s)); begin match s.skind with | If (exp, _, _, _) -> (* conditional expressions are treated in a special way *) insideIf <- Some (Kstmt s); ignore (Cil.visitCilExpr (self :> Cil.cilVisitor) exp); insideIf <- None | _ -> () end; Cil.DoChildren method! vexpr exp = begin match insideIf with | Some ki -> (* expressions inside conditionals have a special treatment *) begin match exp.enode with | Lval lv -> (* lvals must be generated differently from other expressions *) self#add_range exp.eloc (PLval(self#current_kf, ki, lv)) | _ -> self#add_range exp.eloc (PExp(self#current_kf, ki, exp)) end | None -> () end; Cil.DoChildren method! vvdec vi = if not vi.vglob && not vi.vtemp then begin match self#current_kf with | None -> (* should not happen*) () | Some kf -> self#add_range vi.vdecl (PVDecl (Some kf,self#current_kinstr,vi)); end; Cil.DoChildren method! vglob_aux g = (match g with | GFun ({ svar = vi }, loc) -> self#add_range loc (PVDecl (Some (Globals.Functions.get vi), Kglobal, vi)) | GVar (vi, _, loc) -> self#add_range loc (PVDecl (None, Kglobal, vi)) | GFunDecl (_, vi, loc) -> self#add_range loc (PVDecl (Some (Globals.Functions.get vi), Kglobal, vi)) | GVarDecl (vi, loc) -> self#add_range loc (PVDecl (None, Kglobal, vi)) | _ -> self#add_range (Global.loc g) (PGlobal g) ); Cil.DoChildren end (* Returns [true] if the column [col] is within location [loc]. *) let location_contains_col loc col = let (pos_start, pos_end) = loc in let (col_start, col_end) = pos_start.Filepath.pos_cnum - pos_start.Filepath.pos_bol, pos_end.Filepath.pos_cnum - pos_end.Filepath.pos_bol in col_start <= col && col <= col_end (* Applies several heuristics to try and match the best localizable to a given location [loc]. The list [possible_locs] should contain all localizables in a given line. If [possible_col] is [true], then we try to take column information into account. Some heuristics may return an empty list, in which case a fallback is later used to return a better choice. *) let apply_location_heuristics precise_col possible_locs loc = let col = loc.Filepath.pos_cnum - loc.Filepath.pos_bol in Gui_parameters.debug ~dkey "apply_location_heuristics (precise_col:%b): loc: %a, col: %d@\n\ possible_locs:@ %a" precise_col Location.pretty (loc, loc) col (Pretty_utils.pp_list ~sep:"@\n" (Pretty_utils.pp_pair ~sep:" :: " Location.pretty Localizable.pretty)) possible_locs; (* Heuristic 1: we try to obtain a subset of localizables related to a given position, or a given column if [precise_col] is true. May result in an empty list. *) let filter_locs l = List.filter (fun (((pos_start, _) as loc'), _) -> if precise_col then location_contains_col loc' col else loc = pos_start ) l in (* Heuristic 2: prioritize expressions if they are present. May result in an empty list. *) let exps l = List.filter (fun (_, lz) -> match lz with | PExp _ -> true | _ -> false) l in (* Heuristic 3: when we have more than one match with the exact same location, we pick the last one in the list. This will be the first statement that has been encountered, and this criterion seems to work well with temporaries introduced by Cil. *) let last l = match List.rev l with [] -> None | (_, lz) :: _ -> Some lz in (* Heuristic 4: when there are no exact locations, we will consider the innermost ones, that is, those at the top of the list. *) let innermost_in loc l = List.filter (fun (loc', _) -> Location.equal loc loc') l in match possible_locs, filter_locs possible_locs with | [], _ -> (* no possible localizables *) None | _, (_ :: _ as exact) -> (* one or more exact localizables; we prioritize expressions *) begin match exps exact with | [] -> (* no expressions, just take the last localizable *) last exact | exps -> (* take the last (usually only) expression *) last exps end | (loc', _) :: __, [] -> (* No exact loc. We consider the innermost statements, ie those at the top of the list *) let filtered = innermost_in loc' possible_locs in last filtered let loc_to_localizable ?(precise_col=false) loc = if not (MappingLineLocalizable.is_computed ()) then ( let vis = new pos_to_localizable in Visitor.visitFramacFile (vis :> Visitor.frama_c_visitor) (Ast.get ()); MappingLineLocalizable.mark_as_computed (); ); try (* Find the mapping from this file to locs-by-line *) let hfile = MappingLineLocalizable.find loc.Filepath.pos_path in (* Find the localizable for this line *) let all = LineToLocalizable.find_all hfile loc.Filepath.pos_lnum in match apply_location_heuristics precise_col all loc with | Some locz -> Gui_parameters.feedback ~dkey "loc: %a -> locz: %a" Location.pretty (loc,loc) Localizable.pretty locz; Some locz | None -> Gui_parameters.feedback ~dkey "loc: %a -> NO locz" Location.pretty (loc,loc); None with | Not_found -> Gui_parameters.debug ~once:true ~source:loc "no matching localizable found"; None (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/pretty_source.mli0000666000000000000000000001117713571573400017670 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Utilities to pretty print source with located elements in a Gtk TextBuffer. *) open Cil_types type localizable = Printer_tag.localizable = | PStmt of (kernel_function * stmt) | PStmtStart of (kernel_function * stmt) | PLval of (kernel_function option * kinstr * lval) | PExp of (kernel_function option * kinstr * exp) | PTermLval of (kernel_function option * kinstr * Property.t * term_lval) | PVDecl of (kernel_function option * kinstr * varinfo) (** Declaration and definition of variables and function. Check the type of the varinfo to distinguish between the various possibilities. If the varinfo is a global or a local, the kernel_function is the one in which the variable is declared. The [kinstr] argument is given for local variables with an explicit initializer. *) | PGlobal of global (** all globals but variable declarations and function definitions. *) | PIP of Property.t module Locs: sig type state (** To call when the source buffer is about to be discarded *) val create: unit -> state val clear: state -> unit end (* Folds or unfolds the preconditions at callsite [stmt]. *) val fold_preconds_at_callsite: stmt -> unit (* Are the preconditions unfolded at statement [stmt]? Used to know which folding or unfolding icon to display at [stmt]. *) val are_preconds_unfolded: stmt -> bool val display_source : global list -> GSourceView.source_buffer -> host:Gtk_helper.host -> highlighter:(localizable -> start:int -> stop:int -> unit) -> selector:(button:int -> localizable -> unit) -> Locs.state -> unit (** The selector and the highlighter are always host#protected. The selector will not be called when [not !Gtk_helper.gui_unlocked]. This clears the [Locs.state] passed as argument, then fills it. *) val hilite : Locs.state -> unit val stmt_start: Locs.state -> stmt -> int (** Offset at which the current statement starts in the buffer corresponding to [state], _without_ ACSL assertions/contracts, etc. *) val locate_localizable : Locs.state -> localizable -> (int*int) option (** @return Some (start,stop) in offset from start of buffer if the given localizable has been displayed according to [Locs.locs]. *) val kf_of_localizable : localizable -> kernel_function option val ki_of_localizable : localizable -> kinstr val varinfo_of_localizable : localizable -> varinfo option val localizable_from_locs : Locs.state -> file:Datatype.Filepath.t -> line:int -> localizable list (** Returns the lists of localizable in [file] at [line] visible in the current [Locs.state]. This function is inefficient as it iterates on all the current [Locs.state]. *) val loc_to_localizable: ?precise_col:bool -> Filepath.position -> localizable option (** return the (hopefully) most precise localizable that contains the given Filepath.position. If [precise_col] is [true], takes the column number into account (possibly a more precise, but costly, result). @since Nitrogen-20111001 *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/project_manager.ml0000666000000000000000000002645613571573400017756 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let compare_prj (_p1, n1) (_p2, n2) = String.compare n1 n2 let projects_list ?(filter=fun _ -> true) () = let projects = Project.fold_on_projects (fun acc p -> if filter p then ((p, Project.get_unique_name p) :: acc) else acc) [] in List.sort compare_prj projects (* use the same order than the projects list. is not possible with an hashtbl. So we use a reference over a set of couple *) module PrjRadiosSet = FCSet.Make (struct type t = (Project.t * string) * GButton.radio_button * GMenu.menu_item let compare (p1, _, _) (p2, _, _) = compare_prj p1 p2 end) let project_radios : PrjRadiosSet.t ref = ref PrjRadiosSet.empty (** Create a new project *) let new_project main_ui = Gtk_helper.source_files_chooser (main_ui :> Gtk_helper.source_files_chooser_host) [] (fun filenames -> let project = Project.create "interactive" in let init () = Kernel.Files.set filenames; File.init_from_cmdline () in Project.on project init (); Project.set_current project) let delete_project project = let name = Project.get_unique_name project in let ok = GToolbox.question_box ~title:(Format.sprintf "Deleting project %S" name) ~buttons:[ "Confirm"; "Cancel" ] (Format.sprintf "Do you want to destroy project %S?" name) in if ok = 1 then begin (try Project.remove ~project () with Project.Cannot_remove _ -> let p = Project.create "default" in Project.on p File.init_from_cmdline (); try Project.remove () with Project.Cannot_remove _ -> assert false) end module Filenames = Hashtbl.Make(Project) let filenames : string Filenames.t = Filenames.create 7 let save_in (host_window: Design.main_window_extension_points) parent project name = try Project.save ~project name; Filenames.replace filenames project name with Project.IOError s -> host_window#error ~parent "Cannot save: %s" s let save_project_as (main_ui: Design.main_window_extension_points) project = let dialog = GWindow.file_chooser_dialog ~action:`SAVE ~title:("Save project " ^ Project.get_unique_name project) ~parent:main_ui#main_window () in (*dialog#set_do_overwrite_confirmation true ; only in later lablgtk2 *) dialog#add_button_stock `CANCEL `CANCEL ; dialog#add_select_button_stock `SAVE `SAVE ; main_ui#protect ~cancelable:true ~parent:(dialog :> GWindow.window_skel) (fun () -> match dialog#run () with | `SAVE -> Extlib.may (save_in main_ui (dialog :> GWindow.window_skel) project) dialog#filename | `DELETE_EVENT | `CANCEL -> ()); dialog#destroy () let save_project (host_window: Design.main_window_extension_points) project = try save_in host_window (host_window#main_window :> GWindow.window_skel) project (Filenames.find filenames project) with Not_found -> save_project_as host_window project let load_project (host_window: Design.main_window_extension_points) = let dialog = GWindow.file_chooser_dialog ~action:`OPEN ~title:"Load a saved project" ~parent:host_window#main_window () in dialog#add_button_stock `CANCEL `CANCEL ; dialog#add_select_button_stock `OPEN `OPEN ; host_window#protect ~cancelable:true ~parent:(dialog:>GWindow.window_skel) (fun () -> match dialog#run () with | `OPEN -> begin match dialog#filename with | None -> () | Some f -> (try ignore (Project.load f) with Project.IOError s | Failure s -> host_window#error ~reset:true ~parent:(dialog:>GWindow.window_skel) "Cannot load: %s" s) end | `DELETE_EVENT | `CANCEL -> ()); dialog#destroy () let mk_project_markup p = let name = Project.get_unique_name p in if Project.is_current p then "" ^ name ^ "" else name let reset ?filter (menu: GMenu.menu) = (* Do not reset all if there is no change. *) let pl = projects_list ?filter () in let same_projects = (* use that project_radios and pl are sorted in the same way *) try let rest = PrjRadiosSet.fold (fun (p1, _, _) acc -> match acc with | [] -> raise Exit | p2 :: acc -> if compare_prj p1 p2 = 0 then acc else raise Exit) !project_radios pl in rest = [] with Exit -> false in if same_projects then begin (* update the item status according to the current project anyway *) PrjRadiosSet.iter (fun ((p, _), r, i) -> r#set_active (Project.is_current p); let widgets = i#children in match widgets with | [ w ] -> (try let label = GMisc.label_cast w in label#set_label (mk_project_markup p); label#set_use_markup true with Gobject.Cannot_cast (t1,t2) -> Gui_parameters.warning "Child of project menu item of kind %s while %s was expected" t1 t2) | [] -> Gui_parameters.warning "Project menu item without child" | _ -> Gui_parameters.warning "Project menu item with %d child" (List.length widgets) ) !project_radios; false end else begin PrjRadiosSet.iter (fun (_, _, i) -> menu#remove i) !project_radios; project_radios := PrjRadiosSet.empty; true end let duplicate_project project = ignore (Project.create_by_copy ~last:false ~src:project (Project.get_name project)) let rec rename_project (main_ui: Design.main_window_extension_points) menu project = let old = Project.get_unique_name project in let s = Gtk_helper.input_string ~parent:main_ui#main_window ~title:"Renaming project" (Format.sprintf "New name for project %S:" old) in (match s with | None -> () | Some s -> try ignore (Project.from_unique_name s); main_ui#error "Project of name %S already exists" s with Project.Unknown_project -> Project.set_name project s); recompute main_ui menu and mk_project_entry window menu ?group p = let pname = Project.get_unique_name p in let markup = mk_project_markup p in let item = GMenu.menu_item ~packing:menu#append () in let _label = GMisc.label ~markup ~xalign:0. ~packing:item#add () in let submenu = GMenu.menu ~packing:item#set_submenu () in let current = GMenu.menu_item ~packing:submenu#append () in let p_item = GButton.radio_button ?group ~active:(Project.is_current p) ~packing:current#add ~label:"Set current" () in let callback () = Project.set_current p in ignore (current#connect#activate ~callback); project_radios := PrjRadiosSet.add ((p, pname), p_item, item) !project_radios; let add_action stock text callback = let image = GMisc.image ~xalign:0. ~stock () in let image = image#coerce in let item = Gtk_helper.image_menu_item ~image ~text ~packing:submenu#append in ignore (item#connect#activate ~callback) in add_action `COPY "Duplicate project" (fun () -> duplicate_project p); add_action `DELETE "Delete project" (fun () -> delete_project p); add_action `SAVE "Save project" (fun () -> save_project window p); add_action `SAVE_AS "Save project as" (fun () -> save_project_as window p); add_action `SELECT_FONT "Rename project" (fun () -> rename_project window menu p); p_item and make_project_entries ?filter window menu = match projects_list ?filter () with | [] -> assert (filter <> None) | (pa, _name) :: tl -> let mk = mk_project_entry window menu in let pa_item = mk pa in let group = pa_item#group in List.iter (fun (pa, _) -> ignore (mk ~group pa)) tl and recompute ?filter window menu = let is_reset = reset ?filter menu in if is_reset then make_project_entries ?filter window menu open Menu_manager (** Register this dialog in main window menu bar *) let () = Design.register_extension (fun window -> let menu_manager = window#menu_manager () in let _item, menu = menu_manager#add_menu "_Project" in let constant_items = menu_manager#add_entries menu [ menubar ~icon:`NEW "New project" (Unit_callback (fun () -> new_project window)); menubar ~icon:`REVERT_TO_SAVED "Load project" (Unit_callback (fun () -> load_project window)); menubar ~icon:`COPY "Duplicate current project" (Unit_callback (fun () -> duplicate_project (Project.current()))); menubar ~icon:`DELETE "Delete current project" (Unit_callback (fun () -> delete_project (Project.current ()))); menubar ~icon:`SELECT_FONT "Rename current project" (Unit_callback (fun () -> rename_project window menu (Project.current ()))); ] in let new_item = constant_items.(0) in new_item#add_accelerator `CONTROL 'n'; constant_items.(3)#add_accelerator `CONTROL 'd'; ignore (GMenu.separator_item ~packing:menu#append ()); let callback_prj _p = recompute window menu in let callback_rm_prj p = let filter p' = not (Project.equal p p') in recompute ~filter window menu in let hook () = recompute window menu in Project.register_create_hook callback_prj; Project.register_after_set_current_hook ~user_only:true callback_prj; Project.register_before_remove_hook callback_rm_prj; Project.register_after_load_hook hook; Project.register_after_global_load_hook hook; recompute window menu) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/project_manager.mli0000666000000000000000000000336713571573400020123 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** No function is exported. Extension of the GUI in order to support project switching. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/property_navigator.ml0000666000000000000000000007706013571573400020551 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Design open Cil_types open Property_status (* Collect all properties that have a status *) let all_properties () = let globals = ref Property.Set.empty in let functions = ref Kernel_function.Map.empty in (* Dispatch properties into globals and per-function map *) Property_status.iter (fun ip -> match Property.get_kf ip with | None -> globals := Property.Set.add ip !globals | Some kf -> if not (Ast_info.is_frama_c_builtin (Kernel_function.get_name kf)) then try let fips = Kernel_function.Map.find kf !functions in fips := Property.Set.add ip !fips with Not_found -> let ips = Property.Set.singleton ip in functions := Kernel_function.Map.add kf (ref ips) !functions ); !functions, !globals type property = { module_name:Datatype.Filepath.t; function_name:string; kind:string; status_name:string; consolidated_status:Consolidation.consolidated_status option; consolidated_status_name:string; status_icon:Gtk_helper.Icon.kind; visible:bool; ip: Property.t; } let kf_name_and_module kf = let name = Kernel_function.get_name kf in let loc = Kernel_function.get_location kf in let file = (fst loc).Filepath.pos_path in name, file let make_property ip = let status = Property_status.get ip in let status_name = Format.asprintf "%a" Property_status.pretty status in let con_status = Consolidation.get ip in let consolidated_status_name = Format.asprintf "%a" Consolidation.pretty con_status in let function_name, module_name = match Property.get_kf ip with | None -> "", Datatype.Filepath.dummy (* TODO: it would be great to find the location of global invariants or lemmas, but there isn't enough information in the ast *) | Some kf -> kf_name_and_module kf in let kind = Format.asprintf "@[%a@]" Property.pretty ip in let status_icon = Gtk_helper.Icon.Feedback (Feedback.get ip) in { module_name = module_name; function_name = function_name; visible = true; ip=ip; kind=kind; status_name = status_name ; consolidated_status = Some con_status ; consolidated_status_name = consolidated_status_name ; status_icon = status_icon ; } module Refreshers: sig type check = { id: int (* used to compare checks *); add: GPack.box -> unit; get: unit -> bool; set: bool -> unit; reset: unit -> unit (* change to default state if needed *); } val onlyCurrent: check val ensures: check val extended: check val preconditions: check val behaviors: check val complete_disjoint: check val allocations: check val assigns: check val from: check val user_assertions: check val user_checks: check val rte: check val invariant: check val variant: check val terminates: check val stmtSpec: check val reachable: check val other: check val instances: check val lemmas: check val axiomatic: check val typeInvariants: check val globalInvariants: check val rteNotGenerated: check val rteGenerated: check val valid: check val validHyp: check val unknown: check val invalid: check val invalidHyp: check val considered_valid: check val untried: check val dead: check val inconsistent: check val active_alarm: Alarms.t -> bool val pack: GPack.box -> unit val set_refresh_needed : (bool -> unit) ref val apply: unit -> unit val all_checks : unit -> check list end = struct (* Function to be called during the idle time of the GUI *) let refreshers = ref [] let add_refresher f = refreshers := f::!refreshers let set_refresh_needed = ref (fun _ -> (*will be defined later*)()) let apply () = List.iter (fun f -> f ()) !refreshers type check = { id: int (* unique ID, used to compare checks *); add: GPack.box -> unit (* pack the corresponding checkbox in the argument*); get: unit -> bool (* state of the checkbox (set/unset *) ; set: bool -> unit (* change checkbox state *) ; reset: unit -> unit (* change to default state if needed *); } let last_id = ref 0 let next_id () = incr last_id; !last_id let checks : check list ref = ref [] let all_checks () = List.rev !checks (* ref below used by [add] to set the configuration, since it must be delayed until the session directory has been set *) let first_extended_ref = ref true (* This function must always be called at OCaml toplevel, because it registers a new Frama-C state. *) let add ~name ~hint ?(default=true) ?(set=(fun _b -> ())) () = let open Gtk_helper in let key_name = String.map (fun c -> if c < 'A' || c > 'z' || (c > 'Z' && c < 'a') then '_' else c) name in let key_name = "property_panel." ^ key_name in let module M = State_builder.Ref (Datatype.Bool) (struct let name = "show " ^ name let dependencies = [] let default () = default end) in let get = M.get in let () = Cmdline.run_after_extended_stage (fun () -> (* avoid loading the configuration file several times *) if !first_extended_ref then begin first_extended_ref := false; Configuration.load () end); Cmdline.run_after_loading_stage (fun () -> let v = Configuration.find_bool ~default key_name in M.set v) in let set v = Configuration.set key_name (Configuration.ConfBool v); set v; !set_refresh_needed true; M.set v in let add hb = add_refresher (Gtk_helper.on_bool ~tooltip:hint hb name get set) in let reset () = if get () <> default then set default in let chk = { id = next_id(); get; set; add; reset } in checks := chk :: !checks; chk let onlyCurrent = add ~name:"Current function" ~default:false ~hint:"Only show properties related to current function" () let preconditions = add ~name:"Preconditions" ~hint:"Show function preconditions" () let ensures = add ~name:"Postconditions" ~hint:"Show function postconditions" () let extended = add ~name:"Extended" ~hint:"Show extended function annotation" () let behaviors = add ~name:"Behaviors" ~default:false ~hint:"Show function behaviors" () let complete_disjoint = add ~name:"Complete/disjoint" ~hint:"Show complete/disjoint behaviors" () let allocations = add ~name:"Allocations" ~hint:"Show function allocations" () let assigns = add ~name:"Assigns" ~hint:"Show function assigns" () let from = add ~name:"From" () ~hint:"Show functional dependencies in function assigns" let user_assertions = add ~name:"User assertions" ~hint:"Show user assertions" () let user_checks = add ~name:"User checks" ~hint:"Show user checks" () (* Function called when RTEs are enabled or disabled. *) let set_rte = ref (fun _b -> ()) let rte = add ~set:(fun b -> !set_rte b) ~name:"RTEs" ~hint:"Show runtime errors" () let invariant = add ~name:"Invariant" ~hint:"Show loop invariants" () let variant = add ~name:"Variant" ~hint:"Show loop termination argument" () let terminates = add ~name:"Terminates" ~hint:"Show function termination clauses" () let stmtSpec = add ~name:"Stmt contract" ~hint:"Show statement contracts" () let lemmas = add ~name:"Lemmas" ~hint:"Show lemmas" () let axiomatic = add ~name:"Axiomatic" ~default:false ~hint:"Show global axiomatics" () let instances = add ~name:"Instances" ~hint:"Show properties that are instances of root properties" () let typeInvariants = add ~name:"Type invariants" ~hint:"Show type invariants" () let globalInvariants = add ~name:"Global invariants" ~hint:"Show global invariants" () let other = add ~name:"Other" ~hint:"Show other properties" () let reachable = add ~default:false ~name:"Reachable" ~hint:"Show 'reachable' hypotheses" () let rteNotGenerated = add ~default:false ~name:"Non generated" ~hint:"Show RTEs assertions that remain to generate" () let rteGenerated = add ~default:false ~name:"Generated" ~hint:"Show RTEs assertions that have been generated" () let valid = add ~name:"Valid" ~hint:"Show properties that are proven valid" () let validHyp = add ~name:"Valid under hyp." ~hint:"Show properties that are are valid, but depend on some hypotheses" () let unknown = add ~name:"Unknown" ~hint:"Show properties with an 'unknown' status" () let invalid = add ~name:"Invalid" ~hint:"Show properties that are proven invalid" () let invalidHyp = add ~name:"Invalid under hyp." ~hint:"Show properties that are are invalid, but depend on \ some hypotheses" () let considered_valid = add ~name:"Considered valid" ~default:false ~hint:"Show properties that are considered valid because \ the platform has no way to prove them" () let untried = add ~name:"Untried" ~default:false ~hint:"Show properties whose proof has not been attempted" () let dead = add ~name:"Dead" ~default:false ~hint:"Show properties on unreachable code" () let inconsistent = add ~name:"Inconsistent" ~hint:"Show properties that have an inconsistent status" () let make_expand (box:GPack.box) ?tooltip text = let key_config = "Properties." ^ text in let expanded =Gtk_helper.Configuration.find_bool ~default:true key_config in let expander = GBin.expander ~expanded ~packing:box#pack () in ignore (expander#connect#activate (fun () -> (* Save expansion of panels*) Gtk_helper.Configuration.set key_config (Gtk_helper.Configuration.ConfBool (not expander#expanded)))); let hb = GPack.vbox ~packing:expander#add () in let markup = Printf.sprintf "%s" text in let label = GMisc.label ~markup () in Gtk_helper.do_tooltip ?tooltip label; expander#set_label_widget label#coerce; hb, expander (* [list_alarms] is the instantiation of [add] for all the various kind of alarms. It is computed by ad hoc introspection on the reprs field of the datatype. [active_alarm] finds the category of the alarm, and returns whether it should be shown according to the corresponding checkbox. *) let list_alarms, active_alarm = (*[h] maps alarms hints to the corresponding [get] checkbox. *) let h = Datatype.String.Hashtbl.create 16 in let aux alarm = (* instantiates [add] for the category of [alarm] *) let name = Alarms.get_short_name alarm in let hint = Alarms.get_description alarm in let ({get} as check) = add ~name ~hint () in Datatype.String.Hashtbl.add h (Alarms.get_short_name alarm) get; check in let active_alarm alarm = try (Datatype.String.Hashtbl.find h (Alarms.get_short_name alarm)) () with Not_found -> Gui_parameters.warning "Unregistered alarm type"; true (* should not happen *) in List.map aux Alarms.reprs, active_alarm let pack (box:GPack.box) = (* let hb = make_expand box ~tooltip:"Locations of the properties that are shown" "Where" in *) onlyCurrent.add (*hb*) box; let hb, _ = make_expand box ~tooltip:"Validity status of the properties that are shown" "Status" in valid.add hb; validHyp.add hb; unknown.add hb; invalid.add hb; invalidHyp.add hb; considered_valid.add hb; untried.add hb; dead.add hb; inconsistent.add hb; let hb, _ = make_expand box ~tooltip:"Which properties (precondition, assertion, etc) are shown" "Kind" in preconditions.add hb; ensures.add hb; extended.add hb; behaviors.add hb; complete_disjoint.add hb; allocations.add hb; assigns.add hb; from.add hb; user_assertions.add hb; user_checks.add hb; rte.add hb; invariant.add hb; variant.add hb; terminates.add hb; stmtSpec.add hb; axiomatic.add hb; lemmas.add hb; typeInvariants.add hb; globalInvariants.add hb; instances.add hb; other.add hb; reachable.add hb; (*Pragma.add hb;*) let hb_category, expand_category = make_expand box ~tooltip:"Category of runtime errors leading to the emission of an \ assertion. Enabled only when RTEs are displayed." "RTE category" in List.iter (fun check_alarm -> check_alarm.add hb_category) list_alarms; let hb, _ = make_expand box ~tooltip:"Whether assertions against runtime errors of a certain class \ have been generated" "RTE emission" in rteNotGenerated.add hb; rteGenerated.add hb; (* Register additional callbacks *) set_rte := (fun b -> hb_category#misc#set_sensitive b; if not b then expand_category#set_expanded false); !set_rte (rte.get ()) (* For the initial state *); ;; end open Refreshers (* Process the rte statuses for the given kf, and add the result in the accumulator. Filter the statuses according to user-selected filters*) let aux_rte kf acc (name, _, rte_status_get: Db.RteGen.status_accessor) = let st = rte_status_get kf in match st, rteGenerated.get (), rteNotGenerated.get () with | true, true, _ | false, _, true -> (* Considered that leaf functions are not verified internally *) let status_name, status = if st then if Kernel_function.is_definition kf then "Generated", Feedback.Valid else "Considered generated", Feedback.Considered_valid else "Not generated", Feedback.Invalid in let function_name, module_name = kf_name_and_module kf in let status_icon = Gtk_helper.Icon.Feedback status in let ip = Property.ip_other name (Property.OLGlob (Kernel_function.get_location kf)) in { module_name = module_name; function_name = function_name; visible = true; ip=ip; kind=Format.asprintf "@[%a@]" Property.pretty ip; status_name = "" ; consolidated_status = None ; consolidated_status_name = status_name ; status_icon = status_icon ; } :: acc | true, false, _ | false, _, false -> acc let properties_tab_label = ref None (* Used to change dynamically the label of the "Properties" tab. *) (* Lists of checkboxes (used by popup menus) *) (* all checks: preconditions; ensures; behaviors; allocations; assigns; from; assertions; invariant; variant; terminates; stmtSpec; axiomatic; typeInvariants; globalInvariants; instances; other; reachable; valid; validHyp; unknown; invalid; invalidHyp; considered_valid; untried; dead; inconsistent; rteNotGenerated; rteGenerated *) (* [reset_checks to_check to_uncheck] sets all checks in [to_check] and unsets all checks in [to_uncheck], then refreshes the view. *) let reset_checks to_check to_uncheck = List.iter (fun chk -> chk.set true) to_check; List.iter (fun chk -> chk.set false) to_uncheck; Refreshers.apply () let reset_checks_default () = List.iter (fun chk -> chk.reset ()) (all_checks ()); Refreshers.apply () let unproven_checks_true = [unknown; invalid; invalidHyp; inconsistent] let unproven_checks_false = [valid; validHyp; considered_valid; untried; dead] let check_default () = reset_checks_default () let check_unproven () = reset_checks unproven_checks_true unproven_checks_false let check_all () = reset_checks (all_checks ()) [] let check_none () = reset_checks [] (all_checks ()) let make_panel (main_ui:main_window_extension_points) = let container = GPack.hbox () in let vb_left = GPack.vbox ~packing:container#pack () in let hb_refresh_reset = GPack.hbox ~packing:vb_left#pack () in let refresh_button = GButton.button ~packing:(hb_refresh_reset#pack ~expand:true) () in let refresh_label = GMisc.label ~markup:"Refresh" () in refresh_button#add refresh_label#coerce; Refreshers.set_refresh_needed := (fun b -> if b then refresh_label#set_label "Refresh" else refresh_label#set_label "Refresh"); (* button to modify all checkboxes according to presets *) let checks_menu = GMenu.menu () in let mi_check_def = GMenu.menu_item ~label:"Reset all filters to default" () in checks_menu#add mi_check_def; ignore (mi_check_def#connect#activate ~callback:(fun () -> check_default ())); let mi_check_unproven = GMenu.menu_item ~label:"Reset 'Status' filters to show only unproven/invalid" () in checks_menu#add mi_check_unproven; ignore (mi_check_unproven#connect#activate ~callback:(fun () -> check_unproven ())); let mi_check_all = GMenu.menu_item ~label:"Select all" () in checks_menu#add mi_check_all; ignore (mi_check_all#connect#activate ~callback:(fun () -> check_all ())); let mi_check_none = GMenu.menu_item ~label:"Unselect all" () in checks_menu#add mi_check_none; ignore (mi_check_none#connect#activate ~callback:(fun () -> check_none ())); let icon = GMisc.image ~stock:`INDEX () in let reset_menu_button = GButton.button ~packing:(hb_refresh_reset#pack ~expand:false) () in reset_menu_button#misc#set_tooltip_text "Reconfigure filters according to presets"; reset_menu_button#add icon#coerce; ignore (reset_menu_button#connect#clicked (fun () -> checks_menu#popup ~button:0 ~time:(GtkMain.Main.get_current_event_time ()))); let sc_buttons = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`NEVER () in let vb = GPack.vbox () in Refreshers.pack vb; sc_buttons#add_with_viewport vb#coerce; vb_left#add sc_buttons#coerce; let module MODEL = Gtk_helper.MAKE_CUSTOM_LIST(struct type t = property end) in let model = MODEL.custom_list () in let append m = if m.visible then model#insert m in let clear () = model#clear () in (* TODO: this avoids some problems when changing projects, where the property navigator displays outdated information. A better solution would be to projectify what is being displayed *) Design.register_reset_extension (fun _ -> clear (); match !properties_tab_label with | None -> () | Some label -> GtkMisc.Label.set_text label "Properties" ); let sc = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:(container#pack ~expand:true ~fill:true) () in let view = GTree.view ~rules_hint:true ~headers_visible:true ~packing:sc#add () in ignore (view#connect#row_activated ~callback:(fun path _col -> match model#custom_get_iter path with | Some { MODEL.finfo = { ip = ip } } -> let format_graph ppf = Consolidation_graph.dump (Consolidation_graph.get ip) ppf in Dgraph_helper.graph_window_through_dot main_ui#main_window "Dependencies" format_graph | None -> ())); view#selection#set_select_function (fun path currently_selected -> if not currently_selected then begin match model#custom_get_iter path with | Some {MODEL.finfo={ip = ip;}} -> ignore (main_ui#scroll (Pretty_source.PIP ip)); (* Note: the code below generates double scrolling: the previous call to main_ui#scroll causes the original source viewer to scroll to the beginning of the function, and then the code below re-scrolls it to the exact statement. *) main_ui#view_original (Property.location ip) | None -> () end; true); let top = `YALIGN 0.0 in let make_view_column renderer properties ~title = let cview = MODEL.make_view_column model renderer properties ~title in cview#set_resizable true; ignore (view#append_column cview) in (* Function name column viewer *) make_view_column (GTree.cell_renderer_text [top]) (function{function_name=m} -> [`TEXT m]) ~title:"Function"; (* Module name column viewer *) make_view_column (GTree.cell_renderer_text [top]) (function{module_name=m} -> [`TEXT (Filepath.Normalized.to_pretty_string m)]) ~title:"File"; (* Kind name column viewer *) make_view_column (GTree.cell_renderer_text [top]) (function{kind=k} -> [`TEXT k]) ~title:"Kind"; (* Status colored column viewer *) make_view_column (GTree.cell_renderer_pixbuf [top]) (function {status_icon=status_icon} -> [`PIXBUF (Gtk_helper.Icon.get status_icon)]) ~title:"Status"; (* Consolidated status name column viewer *) make_view_column (GTree.cell_renderer_text [top]) (function{consolidated_status_name=k}-> [`TEXT k]) ~title:"Consolidated Status"; (* (Local) status name column viewer *) make_view_column (GTree.cell_renderer_text [top]) (function{status_name=k}-> [`TEXT k]) ~title:"Local Status"; view#set_model (Some model#coerce); let visible ip = let open Property in match ip with | IPOther _ -> other.get () | IPReachable _ -> reachable.get () | IPBehavior {ib_kinstr=Kglobal} -> behaviors.get () | IPBehavior {ib_kinstr=Kstmt _} -> behaviors.get () && stmtSpec.get () | IPPredicate {ip_kind=PKRequires _;ip_kinstr=Kglobal} -> preconditions.get () | IPPredicate {ip_kind=PKRequires _;ip_kinstr=Kstmt _} -> preconditions.get () && stmtSpec.get () | IPPredicate {ip_kind = PKAssumes _} -> false | IPPredicate {ip_kind=PKEnsures _;ip_kinstr=Kglobal} -> ensures.get () | IPExtended _ -> extended.get () | IPPredicate {ip_kind=PKEnsures _;ip_kinstr=Kstmt _} -> ensures.get() && stmtSpec.get() | IPPredicate {ip_kind = PKTerminates} -> terminates.get () | IPAxiom _ -> false | IPTypeInvariant _ -> typeInvariants.get() | IPGlobalInvariant _ -> globalInvariants.get() | IPAxiomatic _ -> axiomatic.get () && not (onlyCurrent.get ()) | IPLemma _ -> lemmas.get () | IPComplete _ -> complete_disjoint.get () | IPDisjoint _ -> complete_disjoint.get () | IPCodeAnnot {ica_ca={annot_content = AAssert (_, kind, _)} as ca} -> begin match Alarms.find ca with | Some a -> rte.get () && active_alarm a | None -> match kind with | Assert -> user_assertions.get () | Check -> user_checks.get () end | IPCodeAnnot {ica_ca={annot_content = AInvariant _}} -> invariant.get () | IPCodeAnnot {ica_ca={annot_content = APragma p}} -> Logic_utils.is_property_pragma p (* currently always false. *) | IPCodeAnnot _ -> false (* status of inner nodes *) | IPAllocation {ial_kinstr=Kglobal} -> allocations.get () | IPAllocation {ial_kinstr=Kstmt _;ial_bhv=Id_loop _} -> allocations.get () | IPAllocation {ial_kinstr=Kstmt _;ial_bhv=Id_contract _} -> allocations.get() && stmtSpec.get() | IPAssigns {ias_kinstr=Kglobal} -> assigns.get () | IPAssigns {ias_kinstr=Kstmt _;ias_bhv=Id_loop _} -> assigns.get () | IPAssigns {ias_kinstr=Kstmt _;ias_bhv=Id_contract _} -> assigns.get() && stmtSpec.get() | IPFrom _ -> from.get () | IPDecrease _ -> variant.get () | IPPropertyInstance _ -> instances.get () in let visible_status_aux = function | Consolidation.Never_tried -> untried.get () | Consolidation.Considered_valid -> considered_valid.get () | Consolidation.Valid _ -> valid.get () | Consolidation.Valid_under_hyp _ -> validHyp.get () | Consolidation.Unknown _ -> unknown.get () | Consolidation.Invalid _ -> invalid.get () | Consolidation.Invalid_under_hyp _ -> invalidHyp.get () | Consolidation.Invalid_but_dead _ | Consolidation.Valid_but_dead _ | Consolidation.Unknown_but_dead _ -> dead.get () | Consolidation.Inconsistent _ -> inconsistent.get () in let visible_status = Extlib.may_map visible_status_aux ~dft:true in let fill_model () = let add_ip ip = if visible ip then let p = make_property ip in if visible_status p.consolidated_status then append p in let by_kf, globals = all_properties () in (* Add global properties at the top of the list *) Property.Set.iter add_ip globals; (* Will the results for this kf be ultimately displayed *) let display kf = not (Cil.is_unused_builtin (Kernel_function.get_vi kf)) && not (onlyCurrent.get ()) || (let kfvi = Kernel_function.get_vi kf in List.exists (function | GFun ({svar = fvi},_) | GFunDecl (_, fvi, _) -> Cil_datatype.Varinfo.equal fvi kfvi | _ -> false ) main_ui#file_tree#selected_globals) in let rte_get_all_statuses = !Db.RteGen.get_all_status () in (* All non-filtered RTE statuses for a given function *) let rte_kf kf = List.fold_left (aux_rte kf) [] rte_get_all_statuses in (* Add RTE statuses for all functions. We cannot simply iterate over [by_kf], as functions without any property will not be present in it *) let with_rte = let aux kf acc = if display kf then let props = try !(Kernel_function.Map.find kf by_kf) with Not_found -> Property.Set.empty in (kf, (props, rte_kf kf)) :: acc else acc in Globals.Functions.fold aux [] in (* Sort functions by names, in a case-insensitive way *) let cmp (k1, _) (k2, _) = Extlib.compare_ignore_case (Kernel_function.get_name k1) (Kernel_function.get_name k2) in let by_kf = List.sort cmp with_rte in (* Add the properties for all the relevant functions *) List.iter (fun (kf, (ips, rtes)) -> if display kf then begin Property.Set.iter add_ip ips; List.iter append rtes; end ) by_kf; match !properties_tab_label with | None -> () | Some label -> let text = Format.sprintf "Properties (%d)" (model#custom_iter_n_children None) in GtkMisc.Label.set_text label text in ignore (let callback _ = main_ui#protect ~cancelable:false (fun () -> clear (); Refreshers.apply (); !Refreshers.set_refresh_needed false; fill_model ()) in refresh_button#connect#released ~callback); (* To fill at startup: let (_:GtkSignal.id) = view#misc#connect#after#realize fill_model in *) let tab_label = (GMisc.label ~text:"Properties" ())#coerce in properties_tab_label := Some (GtkMisc.Label.cast tab_label#as_widget); let (_:int) = main_ui#lower_notebook#append_page ~tab_label (container#coerce) in register_reset_extension (fun _ -> Refreshers.apply ()) (* Graphical markers in text showing the status of properties. Aka. "bullets" in left margin *) let highlighter (buffer:reactive_buffer) localizable ~start ~stop = match localizable with | Pretty_source.PIP ppt -> if Property.has_status ppt then Design.Feedback.mark buffer#buffer ~offset:start (Property_status.Feedback.get ppt) | Pretty_source.PStmt(_,({ skind=Instr(Call _| Local_init (_, ConsInit _, _)) } as stmt)) -> let kfs = Statuses_by_call.all_functions_with_preconditions stmt in (* We separate the consolidated statuses of the preconditions inside guarded behaviors from those outside. For guarded behaviors, since we do not keep track of the status of 'assumes' clauses, we cannot know if they are active. Hence, we must weaken any 'Invalid' status into 'Unknown'. *) let filter (ip_src, _ip_copy) = match ip_src with | Property.IPPredicate {Property.ip_kind=Property.PKRequires bhv} -> bhv.b_assumes = [] | _ -> false in let ips_sure, ips_unsure = Kernel_function.Hptset.fold (fun kf (ips_sure, ips_unsure) -> Statuses_by_call.setup_all_preconditions_proxies kf; let ips_kf = Statuses_by_call.all_call_preconditions_at ~warn_missing:false kf stmt in let ips_kf_sure, ips_kf_unsure = List.partition filter ips_kf in (List.map snd ips_kf_sure @ ips_sure), (List.map snd ips_kf_unsure @ ips_unsure)) kfs ([], []) in let ips = ips_sure @ ips_unsure in if ips <> [] then let validity = Property_status.Feedback.get_conjunction ips in let validity = match validity with | Feedback.Invalid_under_hyp -> (* Weaken if the invalidity comes from [ips_unsure]. We do nothing for statuses [Invalid] (a path should exist, hence the behavior must be active), or [Invalid_but_dead] (equivalent to [True]) *) let invalid ip = Feedback.get ip = Feedback.Invalid_under_hyp in if List.exists invalid ips_unsure && not (List.exists invalid ips_sure) then Feedback.Unknown else validity | _ -> validity in (* Positioning the bullet is tricky. We cannot use [start] as offset, because the bullet ends up at the beginning of the spec (assertions, contracts, etc) instead of in front of the function name. We use the beginning of the C part of the statement (which has been computed when the source was rendered). *) let offset = try Pretty_source.stmt_start buffer#locs stmt with Not_found -> Gui_parameters.error "Invalid internal state for statement %d" stmt.sid; stop (* fallback *) in Design.Feedback.mark buffer#buffer ~call_site:stmt ~offset validity | Pretty_source.PStmt _ | Pretty_source.PStmtStart _ | Pretty_source.PGlobal _| Pretty_source.PVDecl _ | Pretty_source.PTermLval _| Pretty_source.PLval _ | Pretty_source.PExp _ -> () let extend (main_ui:main_window_extension_points) = make_panel main_ui; (* There is a hack here. We need to access the state of [main_ui#reactive_buffer] inside [highlighter], but it is not an argument of the callback. Instead, we pass [main_ui] as an additional argument. This only works because there is only one instance of [main_ui]. *) main_ui#register_source_highlighter highlighter let () = Design.register_extension extend (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/property_navigator.mli0000666000000000000000000000342713571573400020716 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Extension of the GUI in order to navigate in ACSL properties. No function is exported. *) (* Empty on purpose. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/source_manager.ml0000666000000000000000000002076313571573400017603 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type tab = { tab_name : string ; tab_file : Datatype.Filepath.t ; tab_page : int ; tab_select : line:int -> unit ; tab_source_view : GSourceView.source_view; } type t = { notebook : GPack.notebook; file_index : (Datatype.Filepath.t,tab) Hashtbl.t; name_index : (string,tab) Hashtbl.t; page_index : (int,tab) Hashtbl.t; mutable pages : int ; } let make ?tab_pos ?packing () = let notebook = GPack.notebook ~scrollable:true ~show_tabs:true ?tab_pos ?packing () in notebook#set_enable_popup true ; { notebook = notebook ; file_index = Hashtbl.create 7; name_index = Hashtbl.create 7; page_index = Hashtbl.create 7; pages = 0 ; } let input_channel b ic = let buf = Bytes.create 1024 and len = ref 0 in while len := input ic buf 0 1024; !len > 0 do Buffer.add_subbytes b buf 0 !len done (* returns [true] in case of success, [false] otherwise *) let with_file name ~f = try let ic = open_in_gen [Open_rdonly] 0o644 name in try f ic; close_in ic; true with _exn -> close_in ic; (*; !flash_info ("Error: "^Printexc.to_string exn)*) false with _exn -> false let clear w = begin for _i=1 to w.pages do w.notebook#remove_page 0 done ; w.pages <- 0 ; Hashtbl.clear w.file_index ; Hashtbl.clear w.name_index ; Hashtbl.clear w.page_index ; end let later f = ignore (Glib.Idle.add (fun () -> f () ; false)) let select_file w filename = try let tab = Hashtbl.find w.file_index filename in later (fun () -> w.notebook#goto_page tab.tab_page) with Not_found -> () let select_name w title = try let tab = Hashtbl.find w.name_index title in later (fun () -> w.notebook#goto_page tab.tab_page) with Not_found -> () let selection_locked = ref false let load_file w ?title ~(filename : Datatype.Filepath.t) ?(line=(-1)) ~click_cb () = Gui_parameters.debug ~level:2 "Opening file \"%a\" line %d" Datatype.Filepath.pretty filename line ; let tab = begin try Hashtbl.find w.file_index filename with Not_found -> let name = match title with | None -> Filepath.Normalized.to_pretty_string filename | Some s -> s in let label = GMisc.label ~text:name () in let sw = GBin.scrolled_window ~vpolicy:`AUTOMATIC ~hpolicy:`AUTOMATIC ~packing:(fun arg -> ignore (w.notebook#append_page ~tab_label:label#coerce arg)) () in let original_source_view = Source_viewer.make ~name:"original_source" ~packing:sw#add () in let window = (original_source_view :> GText.view) in let page_num = w.notebook#page_num sw#coerce in let b = Buffer.create 1024 in let s = if with_file (filename :> string) ~f:(input_channel b) then Wutil.to_utf8 (Buffer.contents b) else let f = Filepath.Normalized.to_pretty_string filename in "Error: cannot open file '" ^ f ^ "'" in Buffer.reset b; let (buffer:GText.buffer) = window#buffer in buffer#set_text s; let select_line ~line = if !selection_locked then (* ignore a single call and release the lock for the next one *) selection_locked := false else begin w.notebook#goto_page page_num; if line >= 0 then let it = buffer#get_iter (`LINE (line-1)) in buffer#place_cursor ~where:it; let y = if buffer#line_count < 20 then 0.23 else 0.3 in window#scroll_to_mark ~use_align:true ~yalign:y `INSERT end in (* Ctrl+click opens the external viewer at the current line and file. *) ignore (window#event#connect#button_press ~callback: (fun ev -> (if GdkEvent.Button.button ev = 1 && List.mem `CONTROL (Gdk.Convert.modifier (GdkEvent.Button.state ev)) then Wutil.later (fun () -> try let cur_page = w.notebook#current_page in let tab = Hashtbl.find w.page_index cur_page in let file = tab.tab_file in let iter = buffer#get_iter_at_mark `INSERT in let line = iter#line + 1 in Gtk_helper.open_in_external_viewer ~line file with Not_found -> failwith (Printf.sprintf "ctrl+click cb: invalid page %d" w.notebook#current_page) ); if GdkEvent.Button.button ev = 1 then Wutil.later (fun () -> try let iter = buffer#get_iter_at_mark `INSERT in let line = iter#line + 1 in let col = iter#line_index in let offset = iter#offset in let pos = {Filepath.pos_path = filename; Filepath.pos_lnum = line; Filepath.pos_bol = offset - col; Filepath.pos_cnum = offset;} in let localz = Pretty_source.loc_to_localizable ~precise_col:true pos in click_cb localz with Not_found -> failwith (Printf.sprintf "click cb: invalid page %d" w.notebook#current_page) ); ); false (* other events are processed as usual *) )); let tab = { tab_file = filename ; tab_name = name ; tab_select = select_line ; tab_page = page_num ; tab_source_view = original_source_view; } in w.pages <- succ page_num ; Hashtbl.add w.file_index filename tab ; Hashtbl.add w.name_index name tab ; Hashtbl.add w.page_index page_num tab ; tab end in (* Runs this at idle priority to let the text be displayed before. *) later (fun () -> tab.tab_select ~line) let get_current_source_view w = try let tab = Hashtbl.find w.page_index w.notebook#current_page in tab.tab_source_view with Not_found -> failwith (Printf.sprintf "get_source_view: invalid page %d" w.notebook#current_page) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/source_manager.mli0000666000000000000000000000557413571573400017757 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** The source viewer multi-tabs widget window. *) type t val selection_locked : bool ref (** Prevents the filetree callback from resetting the selected line when it was selected via a click in the original source viewer. *) val make: ?tab_pos:Gtk.Tags.position -> ?packing:(GObj.widget -> unit) -> unit -> t val load_file: t -> ?title:string -> filename:Datatype.Filepath.t -> ?line:int -> click_cb:(Pretty_source.localizable option -> unit) -> unit -> unit (** If [line] is 0 then the last line of the text is shown. If [line] is less that 0 then no scrolling occurs (default). If [title] is not provided the page title is the filename. [click_cb] is a callback called whenever the user clicks on the original source code. This callback is given the localizable that the user clicked on, if any was found. This localizable is estimated from a reverse mapping from the original source to the Cil source, and not always exact. *) val select_file: t -> Datatype.Filepath.t -> unit (** Selection by page filename *) val select_name: t -> string -> unit (** Selection by page title *) val get_current_source_view : t -> GSourceView.source_view (** Returns the source viewer for the currently displayed tab *) val clear : t -> unit (** Remove all pages added by [load_file] *) frama-c-20.0-Calcium/src/plugins/gui/source_viewer.ml0000666000000000000000000000652613571573400017473 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Build a read only text view for C source code. *) let set_language_to_C (buffer:GSourceView.source_buffer) = let original_source_language_manager = GSourceView.source_language_manager ~default:true in let original_lang = original_source_language_manager#guess_language ~content_type:"text/x-csrc" () in begin match original_lang with | Some _ -> buffer#set_language original_lang | None -> Gui_parameters.warning "Mime type 'text/x-csrc' not found" end; buffer#set_highlight_syntax true let make ?name ~packing () = (* let d = GWindow.font_selection_dialog ~title:"tutu" ~show:true () in d#selection#set_preview_text (Format.sprintf "%s %s %s %s" Utf8_logic.forall Utf8_logic.exists Utf8_logic.eq Utf8_logic.neq) ; *) let original_source_window = GSourceView.source_view ~show_line_numbers:true ~editable:false ~packing () in (* let pixbuf = original_source_window#misc#render_icon ~size:`MENU `DIALOG_WARNING in original_source_window#set_marker_pixbuf "warning" pixbuf; *) original_source_window#misc#modify_font_by_name "Monospace"; original_source_window#misc#set_name (Extlib.opt_conv "source" name); let original_source_buffer = original_source_window#source_buffer in set_language_to_C original_source_buffer; (* ignore (original_source_buffer#create_marker ~typ:"warning" original_source_buffer#start_iter ) ;*) begin try original_source_window#set_highlight_current_line true with Not_found -> () (* very old gtksourceview do not have this property. *) end; original_source_window let buffer () = let original_source_buffer = GSourceView.source_buffer () in set_language_to_C original_source_buffer; original_source_buffer frama-c-20.0-Calcium/src/plugins/gui/source_viewer.mli0000666000000000000000000000364713571573400017645 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** The Frama-C source viewer. That is the buffer where Frama-C puts its pretty-printed AST. *) val make : ?name:string -> packing:(GObj.widget -> unit) -> unit -> GSourceView.source_view (** Build a new source viewer. *) val buffer : unit -> GSourceView.source_buffer (** @return the buffer displaying the pretty-printed AST. *) frama-c-20.0-Calcium/src/plugins/gui/warning_manager.ml0000666000000000000000000000673713571573400017755 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let scope = function | None -> "Global" | Some s -> Format.asprintf "%a" Cil_datatype.Position.pretty s type row = Log.event type t = { widget: (int*row) Wtable.columns; append : row -> unit; clear : unit -> unit;} module Data = Indexer.Make( struct type t = int*row let compare (x,_) (y,_) = Transitioning.Stdlib.compare x y end) let make ~packing ~callback = let model = object(self) val mutable m = Data.empty val mutable age = 0 method data = m method size = Data.size m method index i = Data.index i m method get i = Data.get i m method add i = age<-age+1; m <- Data.add (age,i) m;age,i method reload = age<-0; m <- Data.empty method coerce = (self:> (int*row) Wtable.listmodel) end in let w = new Wtable.list ~packing ~headers:true ~rules:true model#coerce in let append e = w#insert_row (model#add e) in let clear () = (* Post a reload request before clearing. The current model is used to know how many rows must be deleted. *) w#reload ; in let open Log in let _ = w#add_column_pixbuf ~title:"Kind" [`YALIGN 0.0;`XALIGN 0.5] (fun (_,e) -> match e with | {evt_kind=Error} -> [`STOCK_ID "gtk-dialog-error"] | {evt_kind=Warning} -> [`STOCK_ID "gtk-dialog-warning"] | _ -> [`STOCK_ID "gtk-dialog-info"]) in let _ = w#add_column_text ~title:"Source" [`YALIGN 0.0] (fun (_,{evt_source=src}) -> [`TEXT (scope src)]) in let _ = w#add_column_text ~title:"Plugin" [`YALIGN 0.0] (fun (_,{evt_plugin=m}) -> [`TEXT m]) in let _ = w#add_column_text ~title:"Message" [`YALIGN 0.0 ; `EDITABLE true] (fun (_,{evt_message=m}) -> [`TEXT m]) in w#on_click (fun (_,w) c -> callback w c); {widget=w;append=append;clear=clear} let append t message = t.append message let clear t = t.clear () (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/warning_manager.mli0000666000000000000000000000403613571573400020114 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Handle Frama-C warnings in the GUI. *) type t (** Type of the widget containing the warnings. *) val make : packing:(GObj.widget -> unit) -> callback:(Log.event -> GTree.view_column -> unit) -> t (** Build a new widget for storing the warnings. *) val append: t -> Log.event -> unit (** Append a new message warning. *) val clear: t -> unit (** Clear all the stored warnings. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/gui/wbox.ml0000666000000000000000000001207313571573400015563 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Widget type expand = W | H | V | HV let hdir = function W | V -> false | H | HV -> true let vdir = function W | H -> false | V | HV -> true type box = | Void | ToEnd | Pack of expand * int * widget let box ?(expand=W) ?(padding=0) ?widget () = match widget with | None -> Void | Some w -> Pack(expand,padding,(w :> widget)) let g ?(expand=W) ?(padding=0) g = Pack(expand,padding,new Wutil.gobj_widget g) let w ?(expand=W) ?(padding=0) a = Pack(expand,padding,(a :> widget)) let h ?(padding=0) a = Pack(H,padding,(a :> widget)) let v ?(padding=0) a = Pack(V,padding,(a :> widget)) let hv ?(padding=0) a = Pack(HV,padding,(a :> widget)) let label ?(fill=false) ?style ?align ?padding text = w ~expand:(if fill then H else W) ?padding (new Widget.label ~text ?align ?style ()) let rec populate dir (box : #GPack.box) from = function | [] -> () | Pack(e,padding,w)::ws -> box#pack ~from ~expand:(dir e) ~padding w#coerce ; populate dir box from ws | Void::ws -> populate dir box from ws | ToEnd::ws -> if from = `START then populate dir box `END (List.rev ws) else populate dir box from ws let hbox ws = let box = GPack.hbox ~show:true () in populate hdir box `START ws ; new Wutil.gobj_widget box let vbox ws = let box = GPack.vbox ~show:true () in populate vdir box `START ws ; new Wutil.gobj_widget box let hgroup (ws : widget list) = let box = GPack.hbox ~show:true ~homogeneous:true () in List.iter (fun w -> box#pack ~expand:false w#coerce) ws ; new Wutil.gobj_widget box let vgroup (ws : widget list) = let box = GPack.vbox ~show:true ~homogeneous:true () in List.iter (fun w -> box#pack ~expand:false w#coerce) ws ; new Wutil.gobj_widget box let (<|>) xs ys = if ys = [] then xs else (xs @ (ToEnd::ys)) let toolbar xs ys = hbox (xs <|> ys) let sidebar xs ys = vbox (xs <|> ys) let panel ?top ?left ?right ?bottom center = let middle = match left , right with | None , None -> (center :> widget) | Some a , Some b -> hbox [ v a ; hv ~padding:2 center ; v b ] | None , Some b -> hbox [ hv ~padding:2 center ; v b ] | Some a , None -> hbox [ v a ; hv ~padding:2 center ] in match top , bottom with | None , None -> middle | Some t , None -> vbox [ h t ; hv middle ] | None , Some t -> vbox [ hv middle ; w t ] | Some a , Some b -> vbox [ h a ; hv middle ; h b ] class type splitter = object inherit Wutil.widget method get : float method set : float -> unit method connect : (float -> unit) -> unit end let split ~dir w1 w2 = let pane = GPack.paned dir () in pane#add1 w1#coerce ; pane#add2 w2#coerce ; let splitter = object inherit (Wutil.gobj_widget pane) method get = Wutil.get_pane_ratio pane method set = Wutil.set_pane_ratio pane method connect f = let callback _ = f (Wutil.get_pane_ratio pane) ; false in ignore (pane#event#connect#button_release ~callback) end in (splitter :> splitter) let scroll ?(hpolicy=`AUTOMATIC) ?(vpolicy=`AUTOMATIC) w = (* Explicit conversion needed for lablgtk3, as policy_type has been extended with another constructor but we still export the lablgtk2 type. *) let vpolicy = (vpolicy :> Gtk.Tags.policy_type) in let hpolicy = (hpolicy :> Gtk.Tags.policy_type) in let scrolled = GBin.scrolled_window ~vpolicy ~hpolicy () in scrolled#add_with_viewport w#coerce ; new Wutil.gobj_widget scrolled let hscroll w = scroll ~vpolicy:`NEVER w let vscroll w = scroll ~hpolicy:`NEVER w frama-c-20.0-Calcium/src/plugins/gui/wbox.mli0000666000000000000000000001123213571573400015730 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Box Layouts. *) open Widget type box (** A packed widget with its layout directives *) (** Expansion Modes. *) type expand = | W (** Stay at widget's size. *) | H (** Expands horizontally. Typically, a text-field. *) | V (** Expands vertically. Typically a side-bar. *) | HV (** Expands in both directions. Typically, a text editor. *) (** Generic packing. Without [~widget], a space is created instead. Defaults: [~expand:W ~padding:0]. *) val box : ?expand:expand -> ?padding:int -> ?widget:#widget -> unit -> box (** Helper to [box] for packing a [GObj.widget]. Same defaults than [box]. *) val g : ?expand:expand -> ?padding:int -> #GObj.widget -> box (** Helper to [box] for packing a [widget]. Same defaults than [box]. *) val w : ?expand:expand -> ?padding:int -> #widget -> box val h : ?padding:int -> #widget -> box (** [w ~expand:H] *) val v : ?padding:int -> #widget -> box (** [w ~expand:V] *) val hv : ?padding:int -> #widget -> box (** [w ~expand:HV] *) val label : ?fill:bool -> ?style:style -> ?align:align -> ?padding:int -> string -> box (** Helper to pack a [Widget.label] widget using [box]. Default: [~fill:false ~style:`Label ~align:`Left ~padding:0] *) (** [hbox] and [vbox] can be used to created nested boxes. Typically, local scope opening can be used, typically: [Wbox.(hbox [ w A ; w B ; w C ])], where [A], [B] and [C] are widgets, or boxes. Notice that nested boxes can {i generally} be packed using default [W] mode, even if they contains horizontal or vertical widgets. *) val hbox : box list -> widget (** Pack a list of boxes horizontally. *) val vbox : box list -> widget (** Pack a list of boxes vertically. *) (** Pack a list of widgets horizontally, with all widgets stuck to the same width *) val hgroup : widget list -> widget (** Pack a list of widgets vertically, with all widgets stuck to the same width *) val vgroup : widget list -> widget (** The first list is packed to the left side of the toolbar. The second list is packed to the right side of the toolbar. *) val toolbar : box list -> box list -> widget (** The first list is packed to the top of the sidebar. The second list is packed to the bottom of the sidebar. *) val sidebar : box list -> box list -> widget (** Helper to create a full featured window: [~top] is layout as a toolbar, [left] and [right] as sidebars, and [bottom] as a status bar. The main (non-optional) widget is centered with full expansion in both directions. *) val panel : ?top:widget -> ?left:widget -> ?right:widget -> ?bottom:widget -> #widget -> widget class type splitter = object inherit Wutil.widget method get : float method set : float -> unit method connect : (float -> unit) -> unit end val split : dir:[`HORIZONTAL|`VERTICAL] -> widget -> widget -> splitter (** default policy is AUTOMATIC *) val scroll: ?hpolicy:[`AUTOMATIC|`ALWAYS|`NEVER] -> ?vpolicy:[`AUTOMATIC|`ALWAYS|`NEVER] -> widget -> widget (** Same as [scroll ~vpolicy:`NEVER] *) val hscroll : widget -> widget (** Same as [scroll ~volicy:`NEVER] *) val vscroll : widget -> widget frama-c-20.0-Calcium/src/plugins/gui/wfile.ml0000666000000000000000000001166613571573400015721 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- File Chooser --- *) (* -------------------------------------------------------------------------- *) type filekind = [ `FILE | `DIR ] class dialog ?(kind=`FILE) ?(title="Select File") ?(select="Select") ?parent () = let dialog = GWindow.dialog ~title ?parent ~modal:true () in let packing = dialog#vbox#pack ~expand:true in let action = match kind with `FILE -> `SAVE | `DIR -> `CREATE_FOLDER in let chooser = GFile.chooser_widget ~action ~packing () in object inherit [string] Wutil.signal as signal initializer begin ignore (dialog#event#connect#delete (fun _ -> true)) ; dialog#add_button "Cancel" `DELETE_EVENT ; dialog#add_button select `SELECT ; ignore (GMisc.label ~packing:(dialog#action_area#pack ~expand:true) ()) ; end method add_filter ~descr ~patterns = if kind = `FILE then chooser#add_filter (GFile.filter ~name:descr ~patterns ()) method select ?dir ?file () = begin match dir , file with | None , None -> ignore (chooser#set_filename "") | None , Some path -> ignore (chooser#set_filename path) | Some dir , None -> ignore (chooser#set_current_folder dir) ; ignore (chooser#set_current_name "") | Some dir , Some file -> ignore (chooser#set_current_folder dir) ; ignore (chooser#set_current_name file) end ; let result = dialog#run () in dialog#misc#hide () ; match result with | `DELETE_EVENT -> () | `SELECT -> match chooser#get_filenames with | f::_ -> signal#fire f | _ -> () end class button ?kind ?title ?select ?tooltip ?parent () = let box = GPack.hbox ~homogeneous:false ~spacing:0 ~border_width:0 () in let fld = GMisc.label ~text:"(none)" ~xalign:0.0 ~packing:(box#pack ~expand:true) () in let _ = GMisc.separator `VERTICAL ~packing:(box#pack ~expand:false ~padding:2) ~show:true () in let _ = GMisc.image ~packing:(box#pack ~expand:false) ~stock:`OPEN () in let button = GButton.button () in let dialog = new dialog ?kind ?title ?select ?parent () in object(self) inherit Wutil.gobj_widget button inherit! [string] Wutil.selector "" as current val mutable disptip = fun f -> match tooltip , f with | None , "" -> "(none)" | None , _ -> f | Some d , "" -> d | Some d , f -> Printf.sprintf "%s: %s" d f val mutable display = function | "" -> "(none)" | path -> Filename.basename path initializer begin button#add box#coerce ; button#set_focus_on_click false ; ignore (button#connect#clicked self#select) ; dialog#connect current#set ; Wutil.set_tooltip button tooltip ; current#connect (fun f -> button#misc#set_tooltip_text (disptip f) ; fld#set_text (display f)) ; end method set_tooltip p = disptip <- p ; fld#misc#set_tooltip_text (p current#get) method set_display p = display <- p ; fld#set_text (p current#get) method add_filter = dialog#add_filter method select ?dir ?file () = let file = match file with None -> current#get | Some f -> f in dialog#select ?dir ~file () end frama-c-20.0-Calcium/src/plugins/gui/wfile.mli0000666000000000000000000000517213571573400016065 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Widget (** {1 File Choosers} *) type filekind = [ `FILE | `DIR ] (** Dialog for choosing a file. The default file type is [`FILE]. *) class dialog : ?kind:filekind -> ?title:string -> ?select:string -> ?parent:GWindow.window -> unit -> object inherit [string] signal method add_filter : descr:string -> patterns:string list -> unit method select : ?dir:string -> ?file:string -> unit -> unit (** Open the dialog. The selected file is signaled {i via} the connected listeners. *) end (** A button associated with a dialog to select the file. *) class button : ?kind:filekind -> ?title:string -> ?select:string -> ?tooltip:string -> ?parent:GWindow.window -> unit -> object inherit widget inherit dialog inherit [string] selector (** Holds the selected filename, [""] by default. *) method set_tooltip : (string -> string) -> unit (** Set the pretty-printer for tooltip. *) method set_display : (string -> string) -> unit (** Set the pretty-printer for button. *) end frama-c-20.0-Calcium/src/plugins/gui/widget.ml0000666000000000000000000003617513571573400016100 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) class type t = Wutil.widget class type widget = Wutil.widget class type action = object inherit widget method set_tooltip : string -> unit end class type ['a] signal = object method fire : 'a -> unit method set_enabled : bool -> unit method lock : (unit -> unit) -> unit method connect : ('a -> unit) -> unit method on_check : 'a -> (bool -> unit) -> unit method on_value : 'a -> (unit -> unit) -> unit method on_event : (unit -> unit) -> unit end class type ['a] selector = object inherit ['a] signal method set : 'a -> unit method get : 'a method send : ('a -> unit) -> unit -> unit end (* -------------------------------------------------------------------------- *) (* --- Labels --- *) (* -------------------------------------------------------------------------- *) open Wutil type align = [`Left | `Right | `Center] type style = [`Label | `Descr | `Code | `Title] type color = [ GDraw.color | `NORMAL ] let xalign = function `Left -> 0.0 | `Right -> 1.0 | `Center -> 0.5 class label ?(style=`Label) ?(align=`Left) ?width ?text () = let w = GMisc.label ?text ~xalign:(xalign align) () in object inherit Wutil.gobj_widget w val mutable fg = None val mutable bg = None method set_fg (c : color) = match fg , c with | None , `NORMAL -> () | Some c0 , `NORMAL -> w#misc#modify_fg [ `NORMAL , `COLOR c0 ] | None , (#GDraw.color as c) -> fg <- Some (w#misc#style#fg `NORMAL) ; w#misc#modify_fg [ `NORMAL , c ] | Some _ , (#GDraw.color as c) -> w#misc#modify_fg [ `NORMAL , c ] method set_bg (c : color) = match bg , c with | None , `NORMAL -> () | Some c0 , `NORMAL -> w#misc#modify_bg [ `NORMAL , `COLOR c0 ] | None , (#GDraw.color as c) -> bg <- Some (w#misc#style#bg `NORMAL) ; w#misc#modify_bg [ `NORMAL , c ] | Some _ , (#GDraw.color as c) -> w#misc#modify_bg [ `NORMAL , c ] initializer Wutil.on width w#set_width_chars ; match style with | `Label -> () | `Code -> set_monospace w | `Title -> set_bold_font w | `Descr -> w#set_single_line_mode false ; w#set_line_wrap true ; w#set_justify `LEFT ; set_small_font w method set_text = w#set_text method set_tooltip msg = Wutil.set_tooltip w (if msg = "" then None else Some msg) end (* -------------------------------------------------------------------------- *) (* --- Icons --- *) (* -------------------------------------------------------------------------- *) type icon = [ GtkStock.id | `Share of string | `None ] let default_icon = let xpm = [| "12 12 2 1"; ". c #ffffff"; "# c #000000"; "############"; "#..........#"; "#..........#"; "#..........#"; "#..........#"; "#..........#"; "#..........#"; "#..........#"; "#..........#"; "#..........#"; "#..........#"; "############"|] in once (fun () -> GdkPixbuf.from_xpm_data xpm) let pixbufs = Hashtbl.create 63 let shared_icon (f:string) = try Hashtbl.find pixbufs f with Not_found -> let file = Printf.sprintf "%s/%s" !Wutil.share f in let pixbuf = try GdkPixbuf.from_file file with Glib.GError _ -> Wutil.warning "Icon '%s' not found" file ; default_icon () in Hashtbl.add pixbufs f pixbuf ; pixbuf let gimage = function | `None -> GMisc.image () | `Share f -> GMisc.image ~pixbuf:(shared_icon f) () | #GtkStock.id as stock -> GMisc.image ~stock () class image (icn:icon) = let img = gimage icn in object inherit gobj_widget img method set_icon (icn:icon) = match icn with | `None -> img#clear () | `Share f -> img#set_pixbuf (shared_icon f) | #GtkStock.id as id -> img#set_stock id end (* -------------------------------------------------------------------------- *) (* --- Buttons --- *) (* -------------------------------------------------------------------------- *) class button_skel ?align ?(icon=`None) ?tooltip (button:GButton.button_skel) = object(self) val mutable images = [] initializer begin self#set_icon icon ; Wutil.on align (fun a -> button#set_xalign (xalign a)) ; set_tooltip button tooltip ; button#misc#set_can_focus false ; button#set_focus_on_click false ; end inherit gobj_action button method set_label = button#set_label method set_border e = button#set_relief (if e then `NORMAL else `NONE) method set_icon (i:icon) = match i with | `None -> button#unset_image () | #icon as icn -> let image = try List.assoc icn images with Not_found -> let img = gimage icn in images <- (icn,img)::images ; img in button#set_image image#coerce end class button ?align ?icon ?label ?(border=true) ?tooltip () = let relief = if border then `NORMAL else `NONE in let button = GButton.button ?label ~relief ~show:true () in object(self) inherit [unit] signal as s inherit! button_skel ?align ?icon ?tooltip (button :> GButton.button_skel) as b method! set_enabled e = s#set_enabled e ; b#set_enabled e method default = button#grab_default initializer ignore (button#connect#clicked self#fire) end (* -------------------------------------------------------------------------- *) (* --- On/Off Buttons --- *) (* -------------------------------------------------------------------------- *) class checkbox ~label ?tooltip () = let button = GButton.check_button ~label ~show:true () in object inherit [bool] selector false as s inherit! gobj_action button as b method! set_enabled e = s#set_enabled e ; b#set_enabled e method! set a = s#set a ; button#set_active a initializer begin set_tooltip button tooltip ; ignore (button#connect#clicked (fun () -> s#set button#active)) ; end end let toggle_icon_warning = ref true class toggle ?align ?icon ?label ?(border=true) ?tooltip () = let relief = if border then `NORMAL else `NONE in let button = GButton.toggle_button ?label ~relief ~show:true () in object inherit [bool] selector false as s inherit! button_skel ?align ?icon ?tooltip (button :> GButton.button_skel) as b method! set_enabled e = s#set_enabled e ; b#set_enabled e method! set = button#set_active method! set_icon icn = if icn <> `None && !toggle_icon_warning then ( Wutil.warning "[Widget] Icon may not appear on toggle buttons" ; toggle_icon_warning := false ) ; b#set_icon icn initializer ignore (button#connect#clicked (fun () -> s#set button#active)) end class switch ?tooltip () = let pix_on = shared_icon "switch-on.png" in let pix_off = shared_icon "switch-off.png" in let evt = GBin.event_box () in let img = GMisc.image ~pixbuf:pix_on ~packing:evt#add () in object(self) inherit [bool] selector false as s inherit! gobj_action evt as b method! set_enabled e = s#set_enabled e ; b#set_enabled e method! set a = s#set a ; img#set_pixbuf (if a then pix_on else pix_off) initializer begin set_tooltip evt tooltip ; ignore (evt#event#connect#button_release (fun _evt -> self#set (not s#get) ; false)) ; end end (* -------------------------------------------------------------------------- *) (* --- Button Group --- *) (* -------------------------------------------------------------------------- *) (* only used inside groups -> not exported to API *) class radio_group ~label ?tooltip () = let button = GButton.radio_button ~label ~show:true () in object inherit [bool] selector false as s inherit! gobj_action button method! set e = s#set e ; if e then button#set_active true method group = function | None -> Some button#group | (Some g) as sg -> button#set_group g ; sg initializer begin set_tooltip button tooltip ; ignore (button#connect#clicked (fun () -> s#set button#active)) ; end end (* only used inside groups -> not exported to API *) class toggle_group ?label ?icon ?tooltip () = let button = GButton.button ?label ~show:true ~relief:`NONE () in object inherit [bool] selector false as s inherit! button_skel ?icon ?tooltip (button :> GButton.button_skel) as b method! set_enabled e = s#set_enabled e ; b#set_enabled e method! set a = s#set a ; button#set_relief (if a then `NORMAL else `NONE) initializer ignore (button#connect#clicked (fun () -> s#set (not s#get))) end class ['a] group (default : 'a) = object(self) inherit ['a] selector default val mutable cases : (bool selector * 'a) list = [] val mutable group = None initializer self#connect (fun v -> List.iter (fun (w,v0) -> w#set (v=v0)) cases) method private add_case (w : bool selector) (v : 'a) = begin w#set ( v = self#get ) ; w#connect (fun e -> if e then self#set v) ; cases <- (w,v) :: cases ; end method add_toggle ?label ?icon ?tooltip ~value () = let toggle = new toggle_group ?label ?icon ?tooltip () in self#add_case (toggle :> bool selector) value ; (toggle :> widget) method add_radio ~label ?tooltip ~value () = let radio = new radio_group ~label ?tooltip () in self#add_case (radio :> bool selector) value ; group <- radio#group group ; (radio :> widget) method! set_enabled e = List.iter (fun (w,_) -> w#set_enabled e) cases end (* -------------------------------------------------------------------------- *) (* --- Spinner --- *) (* -------------------------------------------------------------------------- *) class spinner ?min ?max ?(step=1) ~value ?tooltip () = let b = GEdit.spin_button ~digits:0 () in object inherit [int] selector value as s inherit! gobj_action b method! set_enabled e = s#set_enabled e ; b#misc#set_sensitive e method! set a = s#set a ; b#set_value (float value) method set_min n = b#adjustment#set_bounds ~lower:(float n) () method set_max n = b#adjustment#set_bounds ~upper:(float n) () initializer begin set_tooltip b tooltip ; let fmap v = function None -> v | Some x -> float x in b#adjustment#set_bounds ~lower:(fmap (float min_int) min) ~upper:(fmap (float max_int) max) ~step_incr:(float step) () ; b#set_value (float value) ; let callback () = s#set b#value_as_int in ignore (b#connect#value_changed ~callback) ; end end (* -------------------------------------------------------------------------- *) (* --- PopDown --- *) (* -------------------------------------------------------------------------- *) let render_options opt a = try List.assoc a opt with Not_found -> "" class ['a] menu ~default ?(options=[]) ?render ?items () = let strings = List.map snd options in let (cmb,(model,_)) as combo = GEdit.combo_box_text ~strings ~wrap_width:1 () in object(self) inherit gobj_action cmb as widget inherit! ['a] selector default as select initializer begin on render self#set_render ; on items self#set_items ; end val mutable printer = render_options options val mutable values = Array.of_list (List.map fst options) method set_options opt = printer <- render_options opt ; self#set_items (List.map fst opt) method set_render p = printer <- p method! set_enabled e = select#set_enabled e ; widget#set_enabled e method get_items = Array.to_list values method set_items xs = begin values <- Array.of_list xs ; model#clear () ; Array.iter (fun x -> GEdit.text_combo_add combo (printer x)) values ; let e = select#get in self#lock (fun () -> Array.iteri (fun i x -> if x=e then cmb#set_active i) values) ; end method private clicked n = if 0 <= n && n < Array.length values then select#set values.(n) method! set x = begin select#set x ; Array.iteri (fun i e -> if x=e then cmb#set_active i) values ; end initializer ignore (cmb#connect#notify_active self#clicked) end (* -------------------------------------------------------------------------- *) (* --- Popup Menu --- *) (* -------------------------------------------------------------------------- *) class popup () = let menu = GMenu.menu () in object val mutable empty = true val mutable separator = false method clear = begin List.iter menu#remove menu#children ; empty <- true ; separator <- false ; end method add_separator = separator <- true method add_item ~label ~callback = if not empty && separator then ignore (GMenu.separator_item ~packing:menu#append ()); let item = GMenu.menu_item ~label ~packing:menu#append () in ignore (item#connect#activate ~callback) ; empty <- false ; separator <- false method run () = if not empty then let time = GMain.Event.get_current_time () in menu#popup ~button:3 ~time end frama-c-20.0-Calcium/src/plugins/gui/widget.mli0000666000000000000000000001427013571573400016241 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {1 Simple Widgets} *) class type widget = object method set_visible : bool -> unit method set_enabled : bool -> unit method coerce : GObj.widget method widget : widget end class type action = object inherit widget method set_tooltip : string -> unit end class type t = widget class type ['a] signal = object method fire : 'a -> unit (** Emits the signal to all connected listeners, if enabled and not locked. The signal itself is locked during the execution of listeners, breaking any circularity. *) method set_enabled : bool -> unit (** Turns emission of signals {i on} or {i off}. *) method lock : (unit -> unit) -> unit (** If not locked, lock and execute the continuation and {i finally} release the lock. *) method connect : ('a -> unit) -> unit (** [connect f] calls [f s] on each signal [s]. *) method on_check : 'a -> (bool -> unit) -> unit (** [on_check v] fires a boolean signal [(s=v)] on signal [s]. *) method on_value : 'a -> (unit -> unit) -> unit (** [on_value v] fires a unit signal on signal [s] when [s=v]. *) method on_event : (unit -> unit) -> unit (** [on_event] fires a unit signal on any signal. *) end class type ['a] selector = object inherit ['a] signal (** listen to all sets. *) method set : 'a -> unit method get : 'a method send : ('a -> unit) -> unit -> unit (* [send f] calls [f] with the current value {i via} the signal lock. *) end (** {2 Labels} *) type align = [`Left | `Right | `Center] type style = [`Label | `Descr | `Code | `Title] type color = [ GDraw.color | `NORMAL ] (** Default: [~style:`Label ~align:`Left] *) class label : ?style:style -> ?align:align -> ?width:int -> ?text:string -> unit -> object inherit widget method set_text : string -> unit method set_tooltip : string -> unit method set_fg : color -> unit method set_bg : color -> unit end (** {2 Icons} *) type icon = [ GtkStock.id | `Share of string | `None ] val default_icon : unit -> GdkPixbuf.pixbuf val shared_icon : string -> GdkPixbuf.pixbuf val gimage : icon -> GMisc.image class image : icon -> object inherit widget method set_icon : icon -> unit end (** {2 Buttons} *) class button : ?align:align -> ?icon:icon -> ?label:string -> ?border:bool -> ?tooltip:string -> unit -> object inherit action inherit [unit] signal method set_icon : icon -> unit method set_label : string -> unit method set_border : bool -> unit method default : unit -> unit end class toggle : ?align:align -> ?icon:icon -> ?label:string -> ?border:bool -> ?tooltip:string -> unit -> object inherit action inherit [bool] selector method set_icon : icon -> unit method set_label : string -> unit method set_border : bool -> unit end class checkbox : label:string -> ?tooltip:string -> unit -> object inherit action inherit [bool] selector end class switch : ?tooltip:string -> unit -> object inherit action inherit [bool] selector end (** {2 Groups} *) (** A group is not a widget ; it creates interconnected toggle or radio buttons, each switching to a peculiar value. Use [Wbox.hgroup] and [Wbox.vgroup] to pack several buttons into a dongle. *) class ['a] group : 'a -> object inherit ['a] selector method add_toggle : ?label:string -> ?icon:icon -> ?tooltip:string -> value:'a -> unit -> widget method add_radio : label:string -> ?tooltip:string -> value:'a -> unit -> widget end (** {2 Selectors} *) class spinner : ?min:int -> ?max:int -> ?step:int -> value:int -> ?tooltip:string -> unit -> object inherit action inherit [int] selector method set_min : int -> unit method set_max : int -> unit end class ['a] menu : default:'a -> ?options:('a * string) list -> ?render:('a -> string) -> ?items:'a list -> unit -> object inherit action inherit ['a] selector method set_options : ('a * string) list -> unit method set_render : ('a -> string) -> unit method set_items : 'a list -> unit method get_items : 'a list end (** Contextual menu. The [#popup] method can be called inside a right-click callback. For instance: [widget#on_right_click menu#popup]. *) class popup : unit -> object method clear : unit (** Remove all items *) method add_item : label:string -> callback:(unit -> unit) -> unit (** Adds an item. *) method add_separator : unit (** Inserts a separator. Consecutive and trailing separators are eliminated. *) method run : unit -> unit (** Run the menu. *) end frama-c-20.0-Calcium/src/plugins/gui/wpalette.ml0000666000000000000000000001207013571573400016426 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Widget class tool ?label ?tooltip ?content () = let status = new Widget.image `None in let toggle = new Widget.toggle ~align:`Left ?label ?tooltip ~border:false () in let action = new Widget.button ~icon:`MEDIA_PLAY ?tooltip () in object(self) initializer begin let color = `NAME "orange" in toggle#coerce#misc#modify_bg [ `PRELIGHT , color ; `ACTIVE , color ] ; toggle#connect self#toggle ; action#connect self#action ; self#toggle false ; action#set_border false ; Wutil.on content self#set_content ; end val mutable details = None val mutable tooltip = None val mutable callback = None val mutable view = None method private toggle a = match details with | None -> () | Some w -> Wutil.set_visible w a method private action () = match callback with | None -> () | Some f -> f () method private render = let hbox = GPack.hbox ~show:true () in hbox#pack ~expand:false status#coerce ; hbox#pack ~expand:true ~fill:true ~padding:1 toggle#coerce ; hbox#pack ~expand:false action#coerce ; match details with | None -> hbox#coerce | Some w -> let vbox = GPack.vbox ~show:true () in vbox#pack ~expand:false hbox#coerce ; vbox#pack ~expand:true ~fill:false w#coerce ; vbox#coerce method tool = (self :> tool) method widget = match view with Some w -> w | None -> let w = new Wutil.gobj_widget self#render in view <- Some w ; w method coerce = self#widget#coerce method on_active = toggle#connect method is_active = toggle#get method set_active = toggle#set method has_action = callback != None method set_enabled e = self#widget#set_enabled e method set_visible v = self#widget#set_visible v method set_label = toggle#set_label method set_tooltip txt = toggle#set_tooltip txt method set_status = status#set_icon method clear_action = callback <- None ; action#set_visible false method set_action ?icon ?tooltip ?callback:cb () = begin callback <- cb ; action#set_visible true ; action#set_enabled (cb != None) ; Wutil.on icon action#set_icon ; Wutil.on tooltip action#set_tooltip ; end method set_content (w : widget) = assert ( details == None ) ; let frame = GBin.frame ~show:false () in let padds = GBin.alignment ~padding:(4,4,4,4) () in padds#add w#coerce ; frame#add padds#coerce ; details <- Some frame end (* -------------------------------------------------------------------------- *) (* --- Panel --- *) (* -------------------------------------------------------------------------- *) class panel () = let box = GPack.vbox ~show:true () in object(self) inherit Wutil.gobj_widget box val mutable lock = false val mutable tools = [] method add_widget (w : GObj.widget) = box#pack ~expand:false w method add_tool (w : tool) = begin self#add_widget w#coerce ; w#on_active (self#active w) ; tools <- w :: tools ; end method private active w a = if a && not lock then try lock <- true ; List.iter (fun w0 -> if w0 <> w then w0#set_active false) tools ; lock <- false ; with e -> lock <- false ; raise e end frama-c-20.0-Calcium/src/plugins/gui/wpalette.mli0000666000000000000000000000671313571573400016606 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Widget (** A side-bar palette of tools. *) (** Configurable palette-tool. Each tool is a widget that consists of three components: - a selectable label with optional status icon - an optional action button (icon only) - an optional configuration panel The action button is only displayed when associated with a callback. Clicking the label toggles the configuration panel, if the tool is [active]. *) class tool : ?label:string -> ?tooltip:string -> ?content:widget -> unit -> object inherit widget method tool : tool (** Self cast *) method is_active : bool method on_active : (bool -> unit) -> unit method set_active : bool -> unit method has_action : bool method set_label : string -> unit method set_status : icon -> unit method set_tooltip : string -> unit method set_action : ?icon:icon -> ?tooltip:string -> ?callback:(unit -> unit) -> unit -> unit (** Makes the {i action} button visible. - If no icon is provided, the previous one is kept. - If no tooltip is provided, the previous one is kept. - If no callback is given, the button is deactivated. - The callback replaces any previous one and makes the action button clickable. *) method clear_action : unit (** Deactivate and hide the {i action} button. *) method set_content : widget -> unit (** Shall be used at most once, and before [#coerce] or [#widget]. *) end (** A Palette. Implemented with a vertical box with a scrollbar. *) class panel : unit -> object inherit widget method add_tool : tool -> unit (** Append a palette-tool. The panel ensures that only one tool is selected and toggled. *) method add_widget : GObj.widget -> unit (** Append an arbitrary widget among other widget tools. *) end frama-c-20.0-Calcium/src/plugins/gui/wpane.ml0000666000000000000000000002351313571573400015717 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Widget (* -------------------------------------------------------------------------- *) (* --- Forms --- *) (* -------------------------------------------------------------------------- *) type field = [ `Compact | `Field | `Panel ] let fexpand = function `Compact -> `NONE | `Field -> `X | `Panel -> `BOTH class form () = let box = GPack.table ~columns:2 ~col_spacings:16 ~homogeneous:false () in object(self) val mutable line = 0 val mutable left = false (* left column fed on current line *) val mutable right = false (* right column fed on current line *) val mutable xpadding = 0 (* set with sections *) inherit Wutil.gobj_widget box method private occupy_left = if left || right then line <- succ line ; left <- true ; right <- false method private occupy_right = if right then (line <- succ line ; left <- false) ; right <- true method private occupy_both = if left || right then line <- succ line ; left <- true ; right <- true method add_newline = self#occupy_both ; let w = GMisc.label ~text:"" () in box#attach ~left:0 ~right:2 ~top:line ~ypadding:12 ~expand:`Y w#coerce method add_section label = self#occupy_both ; let w = GMisc.label ~text:label ~xalign:0.0 ~yalign:1.0 () in Wutil.set_bold_font w ; xpadding <- 24 ; box#attach ~left:0 ~right:1 ~top:line ~xpadding:0 ~ypadding:12 ~expand:`Y w#coerce method add_label_widget w = self#occupy_left ; box#attach ~left:0 ~top:line ~xpadding ~expand:`NONE w method add_label label = let w = GMisc.label ~text:label ~xalign:1.0 () in self#add_label_widget w#coerce method add_field ?label ?(field:field=`Field) w = Wutil.on label self#add_label ; self#occupy_right ; box#attach ~left:1 ~top:line ~expand:(fexpand field) w method add_row ?(field:field=`Field) ?(xpadding=xpadding) ?ypadding w = self#occupy_both ; box#attach ~left:0 ~right:2 ~top:line ~xpadding ?ypadding ~expand:(fexpand field) w end (* -------------------------------------------------------------------------- *) (* --- Extensible Array --- *) (* -------------------------------------------------------------------------- *) class type entry = object method widget : GObj.widget method update : unit -> unit method delete : unit -> unit end let no_entry = fun _ -> assert false class ['a] warray ?(dir=`VERTICAL) ?(entry = no_entry) () = let box = GPack.box dir ~homogeneous:false () in object(self) inherit Wutil.gobj_widget box val mutable rows : ('a * entry) list = [] val mutable creator : ('a -> entry) = entry method set xs = begin List.iter (fun (y,e) -> if not (List.mem y xs) then begin e#delete () ; let w = e#widget in box#remove w ; w#destroy () ; end) rows ; rows <- List.map (fun x -> let e = try List.assoc x rows with Not_found -> let e = creator x in box#pack ~expand:false e#widget ; e in x,e) xs ; ignore (List.fold_left (fun pos (_,w) -> box#reorder_child w#widget ~pos ; succ pos) 0 rows) end method get = List.map fst rows method mem x = List.mem_assoc x rows method private others x = List.fold_right (fun (y,_) ys -> if x=y then ys else y::ys) rows [] method append x = self#set ( self#others x @ [x] ) method insert ?after x = let ys = self#others x in let zs = match after with | None -> x :: ys | Some z -> let rec hook z x = function | [] -> [x] | y::ys -> if y = z then z :: x :: ys else y :: hook z x ys in hook z x ys in self#set zs method remove x = self#set (self#others x) method set_entry f = creator <- f method update () = List.iter (fun (_,e) -> e#update ()) rows end (* -------------------------------------------------------------------------- *) (* --- Notebook --- *) (* -------------------------------------------------------------------------- *) class ['a] notebook ?tabs ~default () = let view = GPack.notebook ~enable_popup:false ~show_tabs:false ~show:true () in object(self) val mutable pages : 'a list = [] inherit ['a] Wutil.selector default as select method add ?label page content = let tab_label = match label with | None -> None | Some text -> Some (GMisc.label ~text ())#coerce in pages <- pages @ [page] ; ignore (view#append_page ?tab_label content) ; self#set default method! set page = let rec scan i p = function | q::qs -> if p=q then view#goto_page i else scan (succ i) p qs | [] -> () in scan 0 page pages method private switched i = try select#set (List.nth pages i) with Invalid_argument _ -> () method on_focus page f = select#connect (fun p -> f (page = p)) initializer begin ignore (view#connect#switch_page self#switched) ; Wutil.on tabs (fun p -> view#set_show_tabs true ; view#set_tab_pos p) ; end method coerce = view#coerce method widget = (self :> Widget.t) method! set_enabled = Wutil.set_enabled view method set_visible = Wutil.set_visible view end (* -------------------------------------------------------------------------- *) (* --- Dialogs --- *) (* -------------------------------------------------------------------------- *) type 'a action = [ | `CANCEL | `APPLY | `DEFAULT of 'a | `SELECT of 'a | `ALT of 'a | `ACTION of (unit -> unit) ] class ['a] dialog ~title ~window ?(resize=false) () = let shell = GWindow.window ~title ~kind:`TOPLEVEL ~modal:true ~show:false ~decorated:true ~position:`CENTER_ON_PARENT ~resizable:resize () in let hclip = GBin.alignment ~packing:shell#add () in let vbox = GPack.vbox ~homogeneous:false ~spacing:6 ~packing:hclip#add () in let vclip = GBin.alignment ~packing:(vbox#pack ~from:`END ~expand:false) () in let hbox = GPack.hbox ~homogeneous:false ~spacing:32 ~packing:vclip#add () in let alt_box = GPack.hbox ~homogeneous:true ~spacing:6 ~packing:(hbox#pack ~expand:true ~fill:false) () in let main_box = GPack.hbox ~homogeneous:true ~spacing:6 ~packing:(hbox#pack ~expand:true ~fill:false) () in object(self) constraint 'a = [> `CANCEL | `APPLY] inherit ['a] Wutil.signal val mutable defw = (fun () -> ()) method add_row w = vbox#pack ~from:`START ~expand:false w method add_block w = vbox#pack ~from:`START ~expand:true w method button ~(action : 'a action) ?label ?icon ?tooltip () = let w = new button ?label ?icon ?tooltip () in let box = match action with | `DEFAULT _ | `APPLY -> defw <- w#default ; main_box | `SELECT _ | `CANCEL -> main_box | `ALT _ | `ACTION _ -> alt_box in box#pack ~expand:false w#coerce ; match action with | `ALT r | `SELECT r | `DEFAULT r -> w#connect (fun () -> self#select r) | `CANCEL -> w#connect (fun () -> self#select `CANCEL) | `APPLY -> w#connect (fun () -> self#select `APPLY) | `ACTION f -> w#connect f method select r = begin window#misc#set_sensitive true ; shell#misc#hide () ; self#fire r ; end method run () = begin window#misc#set_sensitive false ; shell#show () ; defw () ; end initializer begin hclip#set_top_padding 4 ; hclip#set_bottom_padding 4 ; hclip#set_left_padding 24 ; hclip#set_right_padding 24 ; ignore (shell#event#connect#delete (fun _ -> self#select `CANCEL ; true)) ; (* returning [true] prevent the dialog from being destroyed *) end end frama-c-20.0-Calcium/src/plugins/gui/wpane.mli0000666000000000000000000001310513571573400016064 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Panels *) open Widget (** {2 Form} *) (** The expansible attribute of a field. *) type field = [ `Compact (** Fixed size. Does not expand. *) | `Field (** Single line field. Expands to the left. *) | `Panel (** Multiline field. Expands to both left and bottom. *) ] (** A form with various field types. The form consists of two columns, with one entry per line. Left columns is reserved for (optional) labels. Fields take place in right column. It is also possible to add widget that spans over the two columns. The form can be horizontally divided into sections. Elements must be added in left-to-right, top-down order. *) class form : unit -> object inherit widget method add_newline : unit (** Inserts an empty line. *) method add_section : string -> unit (** Starts a new section. *) method add_label : string -> unit (** Inserts a field name. Moves to right column. *) method add_label_widget : GObj.widget -> unit (** Inserts a small (fixed) widget in place of a label. Moves to right column. *) method add_field : ?label:string -> ?field:field -> GObj.widget -> unit (** Inserts an entry in the form. Optional label is inserted in right column is specified. Default [field] is [`Field]. Moves to next line. *) method add_row : ?field:field -> ?xpadding:int -> ?ypadding:int -> GObj.widget -> unit (** Inserts a wide entry in the form, spanning the two columns. Default [field] is [`Field]. Moves to next line. *) end (** {2 Tabbed-pane} *) class ['a] notebook : ?tabs:Gtk.Tags.position -> default:'a -> unit -> object inherit widget inherit ['a] selector method add : ?label:string -> 'a -> GObj.widget -> unit method on_focus : 'a -> (bool -> unit) -> unit end (** {2 Array of Widgets} *) class type entry = object method widget : GObj.widget (** Returns the widget *) method update : unit -> unit (** On array request *) method delete : unit -> unit (** When removed *) end class ['a] warray : ?dir:Gtk.Tags.orientation -> ?entry:('a -> entry) -> unit -> object inherit widget (** Install the new-entry creator. *) method set_entry : ('a -> entry) -> unit method set : 'a list -> unit method get : 'a list method mem : 'a -> bool method append : 'a -> unit method insert : ?after:'a -> 'a -> unit method remove : 'a -> unit method update : unit -> unit (** Request update on each entry. *) end (** {2 Dialogs} *) (** Button for dialog options *) type 'a action = [ | `CANCEL (** Cancel choice (same as closing the dialog or `MAIN `CANCEL) *) | `APPLY (** Default choice (same as `DEFAULT `APPLY) *) | `DEFAULT of 'a (** Default choice (right, small, default button) *) | `SELECT of 'a (** Secondary choice (right, small button) *) | `ALT of 'a (** Alternative choice (left, large button) *) | `ACTION of (unit -> unit) (** Button (left, large button) *) ] (** Dialog Window. Dialog window are asynchronous and modal. To open the dialog, invoke [run]. The method returns immediately. When running, the main window is no more sensitive (dialog is modal). When an action-button is pressed, or the method [select] is invoked, the associated signal is emitted, and the dialog is dismissed. Then focus goes back to the main window, and the dialog can be re-emitted. *) class ['a] dialog : title:string -> window:GWindow.window -> ?resize:bool -> unit -> object constraint 'a = [> `CANCEL | `APPLY] method add_row : GObj.widget -> unit method add_block : GObj.widget -> unit method button : action:'a action -> ?label:string -> ?icon:icon -> ?tooltip:string -> unit -> unit (** Closes the dialog. *) method select : 'a -> unit (** Closes the dialog. *) method run : unit -> unit (** Opens the dialog (asynchronously). *) inherit ['a] signal (** Emitted when the dialog is closed. *) end frama-c-20.0-Calcium/src/plugins/gui/wtable.ml0000666000000000000000000003212713571573400016064 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type ('a,'b) column = ?title:string -> 'b list -> ('a -> 'b list) -> GTree.view_column class type virtual ['a] custom = object inherit ['a,'a,unit,unit] GTree.custom_tree_model method reload : unit end class type ['a] columns = object method view : GTree.view (** the tree *) method scroll : GBin.scrolled_window (** scrolled tree (build on demand) *) method coerce : GObj.widget (** widget of the scroll *) method pack : (GObj.widget -> unit) -> unit (** packs the scroll *) method reload : unit (** Structure has changed *) method update_all : unit (** (only) Content of rows has changed *) method update_row : 'a -> unit method insert_row : 'a -> unit method set_focus : 'a -> GTree.view_column -> unit method on_click : ('a -> GTree.view_column -> unit) -> unit method on_right_click : ('a -> GTree.view_column -> unit) -> unit method on_double_click : ('a -> GTree.view_column -> unit) -> unit method set_selection_mode : Gtk.Tags.selection_mode -> unit method on_selection : (unit -> unit) -> unit method count_selected : int method iter_selected : ('a -> unit) -> unit method is_selected : 'a -> bool method add_column_text : ('a,GTree.cell_properties_text) column method add_column_pixbuf : ('a,GTree.cell_properties_pixbuf) column method add_column_toggle : ('a,GTree.cell_properties_toggle) column method add_column_empty : GTree.view_column (** Add an empty column that always appears after the columns created by the other [add_column] methods. *) end class type ['a] listmodel = object method reload : unit method size : int method index : 'a -> int method get : int -> 'a end class type ['a] treemodel = object method reload : unit method has_child : 'a -> bool method children : 'a option -> int method child_at : 'a option -> int -> 'a method parent : 'a -> 'a option method index : 'a -> int end (* -------------------------------------------------------------------------- *) (* --- Columns --- *) (* -------------------------------------------------------------------------- *) let add_column (view:GTree.view) empty data ?title renderer render = begin let column = GTree.view_column ?title ~renderer:(renderer,[]) () in column#set_resizable true ; (* column#set_sizing `FIXED ; *) column#set_cell_data_func renderer (fun model iter -> let props = match data (model#get_path iter) with | None -> [] | Some e -> render e in renderer#set_properties props) ; ignore (view#append_column column); begin match empty with | None -> () | Some e -> ignore (view#move_column e ~after:column) end ; column end class ['a] makecolumns ?packing ?width ?height (view:GTree.view) (model : 'a #custom) = object(self) val mutable scroll = None initializer match packing with | Some packing -> self#pack packing | None -> () method scroll = match scroll with | None -> let s = GBin.scrolled_window ?width ?height () in s#add view#coerce ; scroll <- Some s ; s | Some s -> s method pack packing = packing self#scroll#coerce method view = view method coerce = self#scroll#coerce method update_all = GtkBase.Widget.queue_draw view#as_tree_view method update_row x = try (*TODO : get the rectangle for raw and use queue_draw_area See : http://www.gtkforums.com/viewtopic.php?t=1716 Sadly this is not available in LablGtk2 yet...*) model#custom_row_changed (model#custom_get_path x) x with Not_found -> () method insert_row x = try let path = model#custom_get_path x in model#custom_row_inserted path x with Not_found -> () method reload = begin (* Delete all nodes in view *) let root = GTree.Path.create [0] in model#foreach (fun _p _i -> (* Do not use p since the path is changed by the call to custom_row_deleted*) model#custom_row_deleted root; false) ; (* Then call model *) model#reload ; end method on_right_click f = let callback evt = let open GdkEvent in if Button.button evt = 3 then begin let x = int_of_float (Button.x evt) in let y = int_of_float (Button.y evt) in match view#get_path_at_pos ~x ~y with | Some (path,col,_,_) -> begin match model#custom_get_iter path with | None -> false | Some item -> let () = f item col in false end | _ -> false end else false in ignore (view#event#connect#button_release ~callback) method on_click f = let callback () = match view#get_cursor () with | Some path , Some col -> begin match model#custom_get_iter path with | None -> () | Some item -> f item col end | _ -> () in ignore (view#connect#cursor_changed ~callback) method on_double_click f = let callback path col = match model#custom_get_iter path with | None -> () | Some item -> f item col in ignore (view#connect#row_activated ~callback) method is_selected item = try view#selection#path_is_selected (model#custom_get_path item) with Not_found -> false method on_selection f = ignore (view#selection#connect#changed ~callback:f) method set_selection_mode = view#selection#set_mode method count_selected = view#selection#count_selected_rows method iter_selected f = List.iter (fun p -> match model#custom_get_iter p with | None -> () | Some item -> f item) view#selection#get_selected_rows method set_focus item col = try let path = model#custom_get_path item in view#scroll_to_cell path col ; view#selection#select_path path ; with Not_found -> () val mutable empty : GTree.view_column option = None method add_column_text ?title props render = let cell = GTree.cell_renderer_text props in add_column view empty model#custom_get_iter ?title cell render method add_column_pixbuf ?title props render = let cell = GTree.cell_renderer_pixbuf props in add_column view empty model#custom_get_iter ?title cell render method add_column_toggle ?title props render = let cell = GTree.cell_renderer_toggle props in add_column view empty model#custom_get_iter ?title cell render method add_column_empty = let column = GTree.view_column ~title:"" () in empty <- Some column ; ignore (view#append_column column); column end (* -------------------------------------------------------------------------- *) (* --- Gtk List Model --- *) (* -------------------------------------------------------------------------- *) class ['a] glist_model (m : 'a listmodel) = object method reload = m#reload inherit ['a,'a,unit,unit] GTree.custom_tree_model (new GTree.column_list) method! custom_flags = [`LIST_ONLY] method custom_decode_iter a () () = a method custom_encode_iter a = (a,(),()) method custom_get_iter path = let idx:int array = GtkTree.TreePath.get_indices path in match idx with | [||] -> None | [|i|] -> (try let e = m#get i in Some e with Not_found -> None) | _ -> failwith "Invalid path of depth>1 in a list" method custom_get_path e = GtkTree.TreePath.create [m#index e] method custom_value (_:Gobject.g_type) (_:'a) ~column:_ = failwith "GwList: empty columns" method custom_iter_children e = match e with | None when (m#size > 0) -> Some(m#get 0) | _ -> None method custom_iter_has_child (_:'a) = false method custom_iter_n_children = function | Some _ -> failwith "GwList: no children" | None -> m#size method custom_iter_nth_child r k = match r with | Some _ -> failwith "GwList: no nth-child" | None -> if k < m#size then Some (m#get k) else None method custom_iter_parent (_:'a) = None method custom_iter_next e = let r = try let k = succ (m#index e) in if k < m#size then Some (m#get k) else None with Not_found -> None in r end (* -------------------------------------------------------------------------- *) (* --- Gtk List View --- *) (* -------------------------------------------------------------------------- *) class ['a] list ?packing ?width ?height ?(headers=true) ?(rules=true) (m : 'a listmodel) = let model = new glist_model m in let view = GTree.view ~model ~headers_visible:headers ~rules_hint:rules ~show:true () in object inherit ['a] makecolumns ?packing ?width ?height view model end (* -------------------------------------------------------------------------- *) (* --- Gtk Tree Model --- *) (* -------------------------------------------------------------------------- *) let rec get_iter m r idx k = if k >= Array.length idx then r else let a = m#child_at r idx.(k) in get_iter m (Some a) idx (succ k) let rec get_path ks m a = let ks = m#index a :: ks in match m#parent a with | None -> ks | Some b -> get_path ks m b class ['a] gtree_model (m : 'a treemodel) = object method reload = m#reload inherit ['a,'a,unit,unit] GTree.custom_tree_model (new GTree.column_list) method custom_decode_iter a () () = a method custom_encode_iter a = (a,(),()) method custom_get_iter path = let idx = GtkTree.TreePath.get_indices path in if Array.length idx = 0 then None else let a = m#child_at None idx.(0) in get_iter m (Some a) idx 1 method custom_get_path e = let ks = get_path [] m e in GtkTree.TreePath.create ks method custom_value (_:Gobject.g_type) (_:'a) ~column:(_:int) : Gobject.basic = Format.eprintf "Wtable.custom_value@." ; assert false method custom_iter_children r = let node = match r with None -> true | Some f -> m#has_child f in if node && m#children r > 0 then Some (m#child_at r 0) else None method custom_iter_has_child r = m#has_child r && m#children (Some r) > 0 method custom_iter_n_children = m#children method custom_iter_nth_child r k = if k < m#children r then Some (m#child_at r k) else None method custom_iter_parent r = m#parent r method custom_iter_next e = let p = m#parent e in let k = succ (m#index e) in if k < m#children p then Some (m#child_at p k) else None end (* -------------------------------------------------------------------------- *) (* --- Gtk Tree View --- *) (* -------------------------------------------------------------------------- *) class ['a] tree ?packing ?width ?height ?(headers=true) ?(rules=true) (m : 'a treemodel) = let model = new gtree_model m in let view = GTree.view ~model ~headers_visible:headers ~rules_hint:rules ~show:true () in object inherit ['a] makecolumns ?packing ?width ?height view model end frama-c-20.0-Calcium/src/plugins/gui/wtable.mli0000666000000000000000000000740613571573400016237 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {1 Table Views} *) type ('a,'b) column = ?title:string -> 'b list -> ('a -> 'b list) -> GTree.view_column class type ['a] columns = object method view : GTree.view (** the tree *) method scroll : GBin.scrolled_window (** scrolled tree (build on demand) *) method coerce : GObj.widget (** widget of the scroll *) method pack : (GObj.widget -> unit) -> unit (** packs the scroll *) method reload : unit (** Structure has changed *) method update_all : unit (** (only) Content of rows has changed *) method update_row : 'a -> unit method insert_row : 'a -> unit method set_focus : 'a -> GTree.view_column -> unit method on_click : ('a -> GTree.view_column -> unit) -> unit method on_right_click : ('a -> GTree.view_column -> unit) -> unit method on_double_click : ('a -> GTree.view_column -> unit) -> unit method set_selection_mode : Gtk.Tags.selection_mode -> unit method on_selection : (unit -> unit) -> unit method count_selected : int method iter_selected : ('a -> unit) -> unit method is_selected : 'a -> bool method add_column_text : ('a,GTree.cell_properties_text) column method add_column_pixbuf : ('a,GTree.cell_properties_pixbuf) column method add_column_toggle : ('a,GTree.cell_properties_toggle) column method add_column_empty : GTree.view_column (** Add an empty column that always appears after the columns created by the other [add_column] methods. *) end class type ['a] listmodel = object method reload : unit method size : int method index : 'a -> int method get : int -> 'a end class ['a] list : ?packing:(GObj.widget->unit) -> ?width:int -> ?height:int -> ?headers:bool -> ?rules:bool -> 'a listmodel -> object inherit ['a] columns end class type ['a] treemodel = object method reload : unit method has_child : 'a -> bool method children : 'a option -> int method child_at : 'a option -> int -> 'a method parent : 'a -> 'a option method index : 'a -> int end class ['a] tree : ?packing:(GObj.widget->unit) -> ?width:int -> ?height:int -> ?headers:bool -> ?rules:bool -> 'a treemodel -> object inherit ['a] columns end frama-c-20.0-Calcium/src/plugins/gui/wtext.ml0000666000000000000000000004371313571573400015764 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Rangemap = Rgmap (* -------------------------------------------------------------------------- *) (* --- Text with Tagging Formatter --- *) (* -------------------------------------------------------------------------- *) type tag = | TAG of GText.tag | MARK of int * string | LINK of int * string | PLAIN let rec filter_tags tgs = function | [] -> tgs | TAG t :: style -> filter_tags (t::tgs) style | (MARK _ | LINK _ | PLAIN) :: style -> filter_tags tgs style let split_tag tag = let rec lookup tag k n = if k < n then if tag.[k] = ':' then String.sub tag 0 k , String.sub tag (k+1) (n-k-1) else lookup tag (succ k) n else tag,"" in lookup tag 0 (String.length tag) let css_sheet = [ "ul" , [ `UNDERLINE `SINGLE ]; "st" , [ `STRIKETHROUGH true ]; "bf" , [ `WEIGHT `BOLD ]; "it" , [ `STYLE `ITALIC ]; "red" , [ `FOREGROUND "red" ]; "blue" , [ `FOREGROUND "blue" ]; "green" , [ `FOREGROUND "darkgreen" ]; "orange" , [ `FOREGROUND "orange" ]; "hover" , [ `BACKGROUND "lightblue" ]; "link" , [ `FOREGROUND "blue" ]; ] type 'a entry = int * int * 'a let rec fire e = function [] -> () | f::fs -> f e ; fire e fs class type ['a] marker = object method set_style : GText.tag_property list -> unit method set_hover : GText.tag_property list -> unit method connect : (GdkEvent.Button.t -> 'a entry -> unit) -> unit method on_click : ('a entry -> unit) -> unit method on_double_click : ('a entry -> unit) -> unit method on_right_click : ('a entry -> unit) -> unit method on_shift_click : ('a entry -> unit) -> unit method on_add : ('a entry -> unit) -> unit method wrap : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit method mark : 'b. 'a -> (Format.formatter -> 'b -> unit) -> Format.formatter -> 'b -> unit method add : 'a entry -> unit end type style = NoStyle | StyleSet | Style of GText.tag_property list let configure tag = function | NoStyle -> NoStyle | StyleSet -> StyleSet | Style [] -> NoStyle | Style sty -> tag#set_properties sty ; StyleSet (* -------------------------------------------------------------------------- *) (* --- Monomorphic Marker --- *) (* -------------------------------------------------------------------------- *) type blind = { hover : GText.tag ; click : (bool -> GdkEvent.Button.t -> unit) ; } type registry = blind entry -> unit type wrapper = (int -> int -> unit) -> (Format.formatter -> unit) -> Format.formatter -> unit class ['a] poly_marker (buffer : GText.buffer) (registry : registry) (wrapper : wrapper) = let style = buffer#create_tag [] in let hover = buffer#create_tag [] in object(self) (*--- Style Configuration ---*) val mutable style_props = NoStyle val mutable hover_props = Style (List.assoc "hover" css_sheet) val mutable to_configure = true method set_style sty = assert to_configure ; style_props <- Style sty method set_hover sty = assert to_configure ; hover_props <- Style sty method private configure = if to_configure then begin style_props <- configure style style_props ; hover_props <- configure hover hover_props ; to_configure <- false ; end val mutable demon : (GdkEvent.Button.t -> 'a entry -> unit) list = [] val mutable demon_click : ('a entry -> unit) list = [] val mutable demon_double : ('a entry -> unit) list = [] val mutable demon_right : ('a entry -> unit) list = [] val mutable demon_shift : ('a entry -> unit) list = [] val mutable demon_added : ('a entry -> unit) list = [] (*--- Signal Connection ---*) method connect f = demon <- demon @ [f] method on_click d = demon_click <- demon_click @ [d] method on_double_click d = demon_double <- demon_double @ [d] method on_right_click d = demon_right <- demon_right @ [d] method on_shift_click d = demon_shift <- demon_shift @ [d] method on_add d = demon_added <- demon_added @ [d] (*--- Adding ---*) method add (e : 'a entry) = begin self#configure ; let (p,q,_) = e in if style_props = StyleSet then begin let start = buffer#get_iter (`OFFSET p) in let stop = buffer#get_iter (`OFFSET q) in buffer#apply_tag style ~start ~stop end ; let click double evt = List.iter (fun f -> f evt e) demon ; if double then fire e demon_double else let state = GdkEvent.Button.state evt in if Gdk.Convert.test_modifier `BUTTON3 state then fire e demon_right else if Gdk.Convert.test_modifier `BUTTON1 state then if Gdk.Convert.test_modifier `SHIFT state then fire e demon_shift else fire e demon_click in registry (p,q,{ hover ; click }) ; ignore (fire e demon_added) ; end method wrap pp (fmt:Format.formatter) (w:'a) : unit = self#mark w pp fmt w method mark : 'b. 'a -> (Format.formatter -> 'b -> unit) -> Format.formatter -> 'b -> unit = fun e pp fmt w -> wrapper (fun p q -> self#add (p,q,e)) (fun fmt -> pp fmt w) fmt end (* -------------------------------------------------------------------------- *) (* --- Text Widget --- *) (* -------------------------------------------------------------------------- *) class text ?(autoscroll=false) ?(width=80) ?(indent=60) () = let buffer = GText.buffer () in let react = buffer#create_tag [] in let view = GText.view ~buffer ~editable:false ~cursor_visible:false ~justification:`LEFT ~wrap_mode:`NONE ~accepts_tab:false ~show:true () in let scroll = GBin.scrolled_window () in object(self) val text = Buffer.create 80 val css = Hashtbl.create 32 val marks : (string,int -> int -> unit) Hashtbl.t = Hashtbl.create 32 val mutable links : string marker option = None val mutable width = width val mutable hrule = "" val mutable ruled = false val mutable indent = indent val mutable hid = 0 val mutable autoscroll = autoscroll val mutable style = [] val mutable fmtref = None val mutable reactive = false val mutable index : blind Rangemap.t = Rangemap.empty val mutable hovered = None val mutable double = false (* -------------------------------------------------------------------------- *) (* --- Text Initializer --- *) (* -------------------------------------------------------------------------- *) initializer begin (* Ignore default pango contextual menu (copy/cut/paste etc...), as this widget is read-only *) ignore (view#event#connect#button_press ~callback:(fun ev -> GdkEvent.Button.button ev = 3)); scroll#add view#coerce end (* -------------------------------------------------------------------------- *) (* --- Text Formatter --- *) (* -------------------------------------------------------------------------- *) method private flush () = if Buffer.length text > 0 then begin let s = Wutil.to_utf8 (Buffer.contents text) in Buffer.clear text ; let tags = filter_tags [] style in let iter = buffer#end_iter in buffer#insert ~tags ~iter s ; if reactive then let start,stop = buffer#bounds in buffer#apply_tag react ~start ~stop ; end method private open_tag name = let name = Transitioning.Format.string_of_stag name in self#flush () ; style <- self#tag name :: style ; "" method private close_tag _name = self#flush () ; match style with | [] -> "" | MARK(p,mrk) :: sty -> style <- sty ; self#mark p mrk ; "" | LINK(p,lnk) :: sty -> style <- sty ; self#link p lnk ; "" | (TAG _ | PLAIN) :: sty -> style <- sty ; "" method fmt = match fmtref with Some fmt -> fmt | None -> let open Transitioning.Format in let output_string s a b = if b > 0 then Buffer.add_substring text s a b in let fmt = Format.make_formatter output_string self#flush in let tagger = pp_get_formatter_stag_functions fmt () in pp_set_formatter_stag_functions fmt { tagger with mark_open_stag = self#open_tag; mark_close_stag = self#close_tag ; } ; Format.pp_set_print_tags fmt false ; Format.pp_set_mark_tags fmt true ; Format.pp_set_margin fmt width ; Format.pp_set_max_indent fmt indent ; fmtref <- Some fmt ; fmt method offset = self#flush () ; buffer#end_iter#offset method set_width w = width <- w ; hrule <- "" ; match fmtref with None -> () | Some fmt -> Format.pp_set_margin fmt w method set_indent p = indent <- p ; match fmtref with None -> () | Some fmt -> Format.pp_set_max_indent fmt p (* -------------------------------------------------------------------------- *) (* --- Link & Marking --- *) (* -------------------------------------------------------------------------- *) method links = match links with | Some marker -> marker | None -> let marker = self#marker in marker#set_style (List.assoc "link" css_sheet) ; marker#set_hover (List.assoc "hover" css_sheet) ; links <- Some marker ; marker method private link p name = let q = buffer#end_iter#offset in self#links#add (p,q,name) method private mark p name = let q = buffer#end_iter#offset in List.iter (fun f -> f p q) (Hashtbl.find_all marks name) method on_link f = self#links#on_click (fun (_,_,lnk) -> f lnk) method wrap f pp fmt = begin let sid = hid <- succ hid ; Printf.sprintf ">%X" hid in Hashtbl.add marks sid (fun p q -> Hashtbl.remove marks sid ; f p q) ; Transitioning.Format.pp_open_stag fmt (Transitioning.Format.stag_of_string sid) ; let () = pp fmt in Transitioning.Format.pp_close_stag fmt () ; end (* -------------------------------------------------------------------------- *) (* --- Tag Marking --- *) (* -------------------------------------------------------------------------- *) method private css_style name props = let sty = TAG(buffer#create_tag ~name props) in Hashtbl.replace css name sty ; sty method private tag name = if Hashtbl.mem marks name then MARK(buffer#end_iter#offset,name) else try Hashtbl.find css name with Not_found -> try self#css_style name (List.assoc name css_sheet) with Not_found -> begin match split_tag name with | "fg",color -> self#css_style name [ `FOREGROUND color ] | "bg",color -> self#css_style name [ `BACKGROUND color ] | "link",name -> LINK(buffer#end_iter#offset,name) | _ -> PLAIN end method set_css sheet = List.iter (fun (name,tags) -> ignore (self#css_style name tags)) sheet method set_style name p q = match self#tag name with | PLAIN | LINK _ | MARK _ -> () | TAG tag -> let start = buffer#get_iter (`OFFSET p) in let stop = buffer#get_iter (`OFFSET q) in buffer#apply_tag tag ~start ~stop method remove_style name p q = match Hashtbl.find css name with | PLAIN | LINK _ | MARK _ -> () | TAG tag -> let start = buffer#get_iter (`OFFSET p) in let stop = buffer#get_iter (`OFFSET q) in buffer#remove_tag tag ~start ~stop method remove_all names = let start,stop = buffer#bounds in List.iter (fun name -> match Hashtbl.find css name with | TAG tag -> buffer#remove_tag tag ~start ~stop | PLAIN | LINK _ | MARK _ -> ()) names (* -------------------------------------------------------------------------- *) (* --- Hover & Mark Dispatcher --- *) (* -------------------------------------------------------------------------- *) method private set_reactive = if not reactive then let callback ~origin:_ evt iter = (* return false to propagate events *) match GdkEvent.get_type evt with | `BUTTON_PRESS -> double <- false ; false | `TWO_BUTTON_PRESS -> double <- true ; false | `BUTTON_RELEASE -> begin match hovered with | None -> () | Some (_,_,blind) -> blind.click double (GdkEvent.Button.cast evt) end ; false | `MOTION_NOTIFY -> let offset = GtkText.Iter.get_offset iter in let entry = try Some(Rangemap.find offset offset index) with Not_found -> None in self#hover entry ; false | _ -> false in ( ignore (react#connect#event ~callback) ; reactive <- true ) method private hover h = match hovered , h with | Some e0 , Some e when e == e0 -> () | None , None -> () | _ -> begin (match hovered with None -> () | Some (_,_,{hover}) -> let start,stop = buffer#bounds in buffer#remove_tag hover ~start ~stop) ; (match h with None -> () | Some (a,b,{hover}) -> let start = buffer#get_iter (`OFFSET a) in let stop = buffer#get_iter (`OFFSET b) in self#hover None ; buffer#apply_tag hover ~start ~stop) ; hovered <- h end method private register e = index <- Rangemap.add e index (* -------------------------------------------------------------------------- *) (* --- User API --- *) (* -------------------------------------------------------------------------- *) method set_autoscroll s = autoscroll <- s method printf : 'a. ?scroll:bool -> ('a,Format.formatter,unit) format -> 'a = fun ?(scroll=autoscroll) text -> (* Save current number of lines in the buffer *) let line = view#buffer#line_count in let finally fmt = Format.pp_print_flush fmt () ; Hashtbl.clear marks ; hid <- 0 ; ruled <- false ; if scroll then (* scrolling must be performed asynchronously using Gtk_helper.later, otherwise it will not take into account the newly added text. *) Wutil.later (self#scroll ~line) in Format.kfprintf finally self#fmt text method hrule = if not ruled then begin if String.length hrule = 0 then hrule <- String.make width '-' ; Format.pp_print_string self#fmt hrule ; Format.pp_print_newline self#fmt () ; ruled <- true ; end method lines = view#buffer#line_count method scroll ?line () = let buf = view#buffer in let line = match line with Some l -> l | None -> buf#line_count in let iter = buf#get_iter_at_char ~line 0 in ignore (view#scroll_to_iter ~use_align:true ~yalign:0.0 iter) method select ?(scroll=false) (p:int) (q:int) = let buffer = view#buffer in let start = buffer#get_iter (`OFFSET p) in let stop = buffer#get_iter (`OFFSET q) in buffer#select_range start stop ; ignore (view#scroll_to_iter ~use_align:scroll ~yalign:0.3 start) method clear = begin Format.pp_print_flush self#fmt () ; Hashtbl.clear marks ; hid <- 0 ; buffer#delete ~start:buffer#start_iter ~stop:buffer#end_iter ; index <- Rangemap.empty ; self#hover None ; end method coerce = scroll#coerce method widget = (self :> Widget.t) method set_enabled = Wutil.set_enabled scroll method set_visible = Wutil.set_visible scroll method set_font = Wutil.set_font view method set_monospace = Wutil.set_monospace view method marker : 'a. 'a marker = let h = new poly_marker buffer self#register self#wrap in self#set_reactive ; (h :> _ marker) method get_view = view end frama-c-20.0-Calcium/src/plugins/gui/wtext.mli0000666000000000000000000001302113571573400016122 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {1 Rich Text Renderer} *) type 'a entry = int * int * 'a class type ['a] marker = object method set_style : GText.tag_property list -> unit (** The style of added entries. Defaults to empty. {b Warning} must be set before any entry is added. *) method set_hover : GText.tag_property list -> unit (** The style of hovered entries. Defaults to background green. {b Warning} must be set before any entry is added. *) method connect : (GdkEvent.Button.t -> 'a entry -> unit) -> unit method on_click : ('a entry -> unit) -> unit method on_double_click : ('a entry -> unit) -> unit method on_right_click : ('a entry -> unit) -> unit method on_shift_click : ('a entry -> unit) -> unit method on_add : ('a entry -> unit) -> unit method wrap : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit (** Register with [#add] an entry around its pretty-print. *) method mark : 'b. 'a -> (Format.formatter -> 'b -> unit) -> Format.formatter -> 'b -> unit (** Register the entry around the pretty-printed material. *) method add : 'a entry -> unit (** Register an entry *) end class text : ?autoscroll:bool -> ?width:int -> ?indent:int -> unit -> object inherit Widget.widget method clear : unit method fmt : Format.formatter (** The formatter used by [printf] method. *) method hrule : unit (** Print an horizontal rule. Consecutive rules are collapsed. *) method printf : 'a. ?scroll:bool -> ('a,Format.formatter,unit) format -> 'a (** Append material to the text buffer, optionally scrolling it to the beginning of the message (defaults to autoscrolling setting). The underlying formatter (method [fmt]) recognizes the following default tags: - ["bf"] bold face - ["it"] italic style - ["ul"] underlined - ["st"] striked through - ["blue"], ["red"], ["orange"], ["green"] predefined foreground color - ["hover"] background green (default for highlighter) - ["link"] underlined blue - ["fg:"] foreground color - ["bg:"] background color - ["link:"] add a link marker Properties for any tag (except parametric and mark) can be modified with method [set_tag_style]. [t#printf] is a shortcut for [Format.fprintf t#fmt] followed by flushing and optional scrolling. *) method set_monospace : unit (** Set a monospace font *) method set_font: string -> unit (** Set the font used to display the text. *) method set_css : (string * GText.tag_property list) list -> unit (** Override properties for the given tag name. Must be used before the tag is used. *) method set_style : string -> int -> int -> unit method remove_style : string -> int -> int -> unit method remove_all : string list -> unit method offset : int method lines : int method set_width : int -> unit method set_indent : int -> unit method wrap : (int -> int -> unit) -> (Format.formatter -> unit) -> Format.formatter -> unit (** Print with a callback to the actual bounds of the printed material after boxing. *) method marker : 'a. 'a marker method links : string marker method on_link : (string -> unit) -> unit (** Short cut to [links#on_click] (callback without range). *) method set_autoscroll: bool -> unit (** Automatically scroll to lastly inserted text (console behavior). *) method scroll : ?line:int -> unit -> unit (** Default line is last one. *) method select : ?scroll:bool -> int -> int -> unit (** When [scroll:false] (default), only minimal scrolling is performed to make the selection visible. Otherwise, the window is scrolled to center the selection at screen. *) method get_view: GText.view (** Returns the viewer object (and the buffer it contains). *) end frama-c-20.0-Calcium/src/plugins/gui/wutil.ml0000666000000000000000000001614013571573400015747 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Utils --- *) (* -------------------------------------------------------------------------- *) let on x f = match x with None -> () | Some x -> f x let fire fs x = List.iter (fun f -> f x) fs let once = Wutil_once.once (* -------------------------------------------------------------------------- *) (* --- Pango Properties --- *) (* -------------------------------------------------------------------------- *) include Gtk_compat.Pango let set_font w name = w#misc#modify_font_by_name name let set_monospace w = set_font w "monospace" (* -------------------------------------------------------------------------- *) (* --- Misc --- *) (* -------------------------------------------------------------------------- *) let set_tooltip w m = on m w#misc#set_tooltip_text let set_enabled (w : #GObj.widget) = w#misc#set_sensitive let set_visible (w : #GObj.widget) e = let m = w#misc in if e then m#show () else m#hide () let share = ref "/usr/local/share" let flush = ref prerr_endline let warning msg = let buffer = Buffer.create 80 in Format.kfprintf (fun fmt -> Format.pp_print_flush fmt () ; !flush (Buffer.contents buffer)) (Format.formatter_of_buffer buffer) msg (* -------------------------------------------------------------------------- *) (* --- UTF-8 --- *) (* -------------------------------------------------------------------------- *) let to_utf8 s = try if Glib.Utf8.validate s then s else Glib.Convert.locale_to_utf8 s with Glib.Convert.Error _ -> try Glib.Convert.convert_with_fallback ~fallback:"#neither UTF-8 nor locale nor ISO-8859-15#" ~to_codeset:"UTF-8" ~from_codeset:"ISO_8859-15" s with Glib.Convert.Error _ as e -> Printexc.to_string e (* -------------------------------------------------------------------------- *) (* --- Timer --- *) (* -------------------------------------------------------------------------- *) let later f = let for_idle () = f () ; false in let prio = Glib.int_of_priority `LOW in ignore (Glib.Idle.add ~prio for_idle) (* -------------------------------------------------------------------------- *) (* --- Ratio --- *) (* -------------------------------------------------------------------------- *) let get_pane_ratio (paned:GPack.paned) = let paned_min_pos = paned#min_position in let paned_max_pos = paned#max_position in let length = paned_max_pos - paned_min_pos in if length = 0 then 0.5 else (float_of_int paned#position)/.(float_of_int length) let set_pane_ratio (paned:GPack.paned) ratio = let paned_min_pos = paned#min_position in let offset = int_of_float (float (paned#max_position - paned_min_pos) *. ratio) in paned#set_position (paned_min_pos + offset) (* -------------------------------------------------------------------------- *) (* --- Widget & Signals --- *) (* -------------------------------------------------------------------------- *) class type widget = object method set_visible : bool -> unit method set_enabled : bool -> unit method coerce : GObj.widget method widget : widget end class gobj_widget obj = object(self) method set_visible = set_visible obj method set_enabled = set_enabled obj method coerce : GObj.widget = (obj#coerce) method widget = (self :> widget) end class gobj_action obj = object inherit gobj_widget obj method set_tooltip txt = set_tooltip (obj :> GObj.widget) (Some txt) end class layout = object(self) val mutable content : widget option = None method coerce = match content with | None -> raise (Invalid_argument "Wbox.layout") | Some w -> w#coerce method widget = match content with | None -> (self :> widget) | Some w -> w method set_visible v = match content with | None -> () | Some w -> w#set_visible v method set_enabled e = match content with | None -> () | Some w -> w#set_enabled e method populate : 'a. (#widget as 'a) -> unit = fun w -> content <- Some (w :> widget) end class virtual ['a] handler = object(self) method virtual connect : ('a -> unit) -> unit method on_check v f = self#connect (fun e -> f (e=v)) method on_value v f = self#connect (fun e -> if e=v then f ()) method on_event f = self#connect (fun _ -> f ()) end class ['a] signal = object val mutable enabled = true val mutable lock = false val mutable demon = [] inherit ['a] handler method fire (x:'a) = if enabled && not lock then try lock <- true ; fire demon x ; lock <- false with err -> lock <- false ; raise err method connect f = demon <- demon @ [f] method set_enabled e = enabled <- e method lock : (unit -> unit) -> unit = fun f -> if not lock then try lock <- true ; f () ; lock <- false with err -> lock <- false ; raise err end class ['a] selector default = object(self) val mutable current : 'a = default inherit ['a] signal method get = current method set x = current <- x ; self#fire x method send f () = self#lock (fun () -> f current) end frama-c-20.0-Calcium/src/plugins/gui/wutil.mli0000666000000000000000000000740713571573400016126 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {1 Wtoolkit - Utilities} *) val on : 'a option -> ('a -> unit) -> unit val fire : ('a -> unit) list -> 'a -> unit val once : ('a -> 'b) -> 'a -> 'b (** {2 Settings & Console} *) val share : string ref val flush : (string -> unit) ref val warning : ('a,Format.formatter,unit) format -> 'a (** {2 Styling} *) val set_enabled : #GObj.widget -> bool -> unit val set_visible : #GObj.widget -> bool -> unit val set_tooltip : #GObj.widget -> string option -> unit val set_font : #GObj.widget -> string -> unit val set_monospace : #GObj.widget -> unit val set_small_font : #GObj.widget -> unit val set_bold_font : #GObj.widget -> unit val to_utf8 : string -> string (** {2 Ratios} *) val get_pane_ratio : GPack.paned -> float val set_pane_ratio : GPack.paned -> float -> unit (** {2 Timing} *) val later : (unit -> unit) -> unit (** Post the action on next idle. *) (** {2 Events} *) (** Defines [on_xxx] in term of [connect]. *) class virtual ['a] handler : object method virtual connect : ('a -> unit) -> unit method on_check : 'a -> (bool -> unit) -> unit (** [on_check v] emits boolean signal [(s=v)] on signal [s]. *) method on_value : 'a -> (unit -> unit) -> unit (** [on_value v] emits a unit signal on signal [s=v]. *) method on_event : (unit -> unit) -> unit (** [on_event] emits a unit signal on any signal [s]. *) end (** Has type {!Widget.signal} *) class ['a] signal : object method fire : 'a -> unit method set_enabled : bool -> unit method connect : ('a -> unit) -> unit method lock : (unit -> unit) -> unit inherit ['a] handler end (** Has type {!Widget.selector} *) class ['a] selector : 'a -> object inherit ['a] signal method set : 'a -> unit method get : 'a method send : ('a -> unit) -> unit -> unit end class type widget = object method set_visible : bool -> unit method set_enabled : bool -> unit method coerce : GObj.widget method widget : widget end class layout : object inherit widget method populate : #widget -> unit end class gobj_widget : #GObj.widget -> widget class gobj_action : #GObj.widget -> object inherit widget method set_tooltip : string -> unit end frama-c-20.0-Calcium/src/plugins/gui/wutil_once.ml0000666000000000000000000000347513571573400016762 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* belongs to Wutil, but used by gtk_compat.{2,3}.ml *) type ('a,'b) cell = Value of 'b | Fun of ('a -> 'b) let get p x = match !p with | Value y -> y | Fun f -> let y = f x in p := Value y ; y let once f = get (ref (Fun f)) frama-c-20.0-Calcium/src/plugins/gui/wutil_once.mli0000666000000000000000000000340013571573400017117 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** [once f] returns a function that will only be applied once per execution of the program and returns the same value afterwards. *) val once: ('a -> 'b) -> 'a -> 'b frama-c-20.0-Calcium/src/plugins/impact/0000777000000000000000000000000013571573400014740 5ustar frama-c-20.0-Calcium/src/plugins/impact/Impact.mli0000666000000000000000000000461513571573400016666 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: Impact.mli,v 1.1 2008-04-08 14:59:02 uid568 Exp $ *) open Cil_types (** Impact analysis. @see <../impact/index.html> internal documentation. *) module Register : sig val compute_pragmas: (unit -> stmt list) (** Compute the impact analysis from the impact pragma in the program. Print and slice the results according to the parameters -impact-print and -impact-slice. @return the impacted statements *) val from_stmt: (stmt -> stmt list) (** Compute the impact analysis of the given statement. @return the impacted statements *) val from_nodes: (kernel_function -> PdgTypes.Node.t list -> PdgTypes.NodeSet.t) (** Compute the impact analysis of the given set of PDG nodes, that come from the given function. @return the impacted nodes *) end frama-c-20.0-Calcium/src/plugins/impact/compute_impact.ml0000666000000000000000000007340513571573400020314 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype open PdgIndex open Reason_graph (** Computation of the PDG nodes that are impacted by the "execution" of some initial PDG nodes. This is implemented as a forward inter-procedural analysis on top of the PDG plugin. *) module NS = Pdg_aux.NS type nodes = NS.t module NM = PdgTypes.Node.Map module KFS = Kernel_function.Hptset module KFM = Kernel_function.Map let kfmns_find_default key m = try KFM.find key m with Not_found -> NS.empty (* Data associated to PDG nodes that are impacted, and that have not been treated yet. *) type todo = { kf: kernel_function (* kernel_function in which the node can be found *); pdg: PdgTypes.Pdg.t (* pdg of this kernel_function *); zone: Locations.Zone.t (* fragment of the node that is impacted *); init: bool (* is this node in the worklist only because it is part of the nodes initially selected as source? The initial nodes are not in the final result, but must be present in intermediate results for technical reasons *); } (* Nodes that are impacted, and that will have to be considered at some point.*) and todolist = todo NM.t (* All nodes that have been found to be impacted. Presented as a map from Kf, because this information cannot be recovered from the PDG nodes. (Also, this speeds up some operations *) type result = nodes KFM.t (* Modelization of a call. The first function (the caller) calls the second (the callee) at the given statement. *) module KfKfCall = Datatype.Triple_with_collections (Kernel_function)(Kernel_function)(Cil_datatype.Stmt) (struct let module_name = "Impact.Compute.KfKfCall" end) (** Worklist maintained by the plugin to build its results *) type worklist = { mutable todo: todolist (** nodes that are impacted, but that have not been propagated yet. *); mutable result: result (** impacted nodes. This field only grows. An invariant is that nodes in [todolist] are not already in [result], except with differing [init] fields. *); mutable downward_calls: Pdg_aux.call_interface KfKfCall.Map.t (** calls for which an input may be impacted. If so, we must compute the impact within the called function. For each call, we associate to each PDG input of the callee the nodes that define the input in the caller. The contents of this field grow. *); mutable callers: KFS.t (** all the callers of the functions in which the initial nodes are located. Constant after initialization, used to initialize [upward_calls] below. *); mutable upward_calls: Pdg_aux.call_interface Lazy.t KfKfCall.Map.t (** calls for which an output may be impacted. If so, we must compute the impact after the call in the caller (which is part of the [callers] field by construction). For each output node at the call point in the caller, associate all the nodes of the callee that define this output. The field is lazy: if the impact "dies" before before reaching the call, we may avoid a costly computation. Constant once initialized. *); mutable fun_changed_downward: KFS.t (** Functions in which a new pdg node has been found since the last iteration. The impact on downward calls with those callers will have to be computed again. *); mutable fun_changed_upward: KFS.t (** Functions in which a new pdg node has been found. The impact on upward calls to those callees will have to be computed again. *); mutable skip: Locations.Zone.t (** Locations for which the impact is dismissed. Nodes that involve only those zones are skipped. Constant after initialization *); mutable initial_nodes: nodes KFM.t (** Nodes that are part of the initial impact query, or directly equivalent to those (corresponding nodes in a caller). *); mutable unimpacted_initial: nodes KFM.t (** Initial nodes (as defined above) that are not "self-impacting" so far. Those nodes will not be part of the final results. *); mutable reason: reason_graph (** Reasons why nodes in [result] are marked as impacted. *); compute_reason: bool (** compute the field [reason]; may be costly *); } (** Extract the node of the kf that are only part of the initial impact *) let unimpacted_initial_by_kf wl kf = kfmns_find_default kf wl.unimpacted_initial (** Extract the current results for a given function *) let result_by_kf wl kf = kfmns_find_default kf wl.result let result_to_node_origin (r: result) : Reason_graph.nodes_origin = KFM.fold (fun kf ns acc -> NS.fold (fun (n, _) acc -> PdgTypes.Node.Map.add n kf acc) ns acc) r PdgTypes.Node.Map.empty let initial_to_node_set (init: nodes KFM.t) : NS.t = KFM.fold (fun _ -> NS.union) init NS.empty (* -------------------------------------------------------------------------- *) (* --- Adding nodes to the worklist, or to the results --- *) (* -------------------------------------------------------------------------- *) (** Mark that [n] comes from an indirect impact, ie. remove it from the set of initial nodes that are not impacted. *) let remove_from_unimpacted_initial wl kf (n, z) = let unimpacted = unimpacted_initial_by_kf wl kf in if NS.mem' (n, z) unimpacted then begin Options.debug ~level:2 "node of initial impact %a is indirectly impacted" PdgTypes.Node.pretty n; wl.unimpacted_initial <- KFM.add kf (NS.remove n unimpacted) wl.unimpacted_initial; end ;; (** Add a node to the sets of impacted nodes. Update the various fields of the worklist that need it. [init] indicates that the node is added only because it belongs to the set of initial nodes. *) let add_to_result wl n kf init = if init = false then remove_from_unimpacted_initial wl kf n; (* if useful, mark that a new node was found in [kf] *) if not (KFS.mem kf wl.fun_changed_downward) then (* wl.fun_changed_upward is not updated, because we merge wl.fun_changed_downward with wl.fun_changed_upward when needed *) wl.fun_changed_downward <- KFS.add kf wl.fun_changed_downward; let set = result_by_kf wl kf in let s' = NS.add' n set in wl.result <- KFM.add kf s' wl.result (** return [true] if the location in [n] is contained in [skip], in which case the node should be skipped entirely *) let node_to_skip skip n = match !Db.Pdg.node_key n with | Key.SigKey (Signature.In (Signature.InImpl z)) | Key.SigKey (Signature.Out (Signature.OutLoc z)) | Key.SigCallKey (_, Signature.In (Signature.InImpl z)) | Key.SigCallKey (_, Signature.Out (Signature.OutLoc z)) -> Locations.Zone.equal Locations.Zone.bottom (Locations.Zone.diff z skip) | _ -> false (** Auxiliary function, used to refuse some nodes that should not go in the results *) let filter wl (n, z) = not (Locations.Zone.is_bottom z) && match !Db.Pdg.node_key n with | Key.SigKey (Signature.In Signature.InCtrl) -> false (* do not consider node [InCtrl]. YYY: find when this may happen *) | Key.VarDecl _ -> false (* do not consider variable declarations. This is probably impossible in a forward analysis anyway. *) | _ -> if node_to_skip wl.skip n then ( Options.debug ~once:true ~level:2 "skipping node %a as required" PdgTypes.Node.pretty n; false) else true (** Add a new edge in the graph explaining the results *) let add_to_reason wl ~nsrc ~ndst rt = if wl.compute_reason && filter wl ndst then let reason = Reason.Set.add (fst nsrc, fst ndst, rt) wl.reason in Options.debug ~level:2 "@[Adding %a@ because of@ %a/%a@]" Pdg_aux.pretty_node ndst Reason_graph.ReasonType.pretty rt Pdg_aux.pretty_node nsrc; wl.reason <- reason ;; (** Add some nodes to the [todo] field of the worklist, while enforcing some invariants. Some kind of pdg nodes must not appear in it, plus the nodes must not be in result already. *) let add_to_do_aux ~init wl kf pdg (pn, zone as n) = if filter wl n then let pp fmt = Format.fprintf fmt "node %a (in %a)" Pdg_aux.pretty_node n Kernel_function.pretty kf; in let add () = let todo = { kf; pdg; init; zone } in wl.todo <- NM.add pn todo wl.todo in try let cur = NM.find pn wl.todo in (* Node is already in the todo list. Check init field and zone *) if (cur.init = true && init = false) || (not (Locations.Zone.is_included zone cur.zone)) then begin (* overwrite the existing binding in the todo list *) Options.debug ~level:2 "todo list node %t is now init=false" pp; add (); end with Not_found -> (* Node is not in todo list. Check if it is already in results *) if NS.mem' n (result_by_kf wl kf) then begin (* Already in results. Check if [init] flag matches. *) if init = false && NS.mem' n (unimpacted_initial_by_kf wl kf) then begin (* TODO: check above *) (* Node was already there with [init=true] or with smaller . Compute impact again with [init=false] *) Options.debug ~level:2 "adding again node %t, with init=false" pp; add () end end else begin (* General case *) Options.debug ~level:2 "adding %t" pp; add () end ;; (** Build the initial value of the [todo] field, from a list of initial nodes *) let initial_to_do_list wl kf pdg nodes = List.iter (fun n -> add_to_do_aux true wl kf pdg n) nodes (** Mark a new node as impacted, and simultaneously mark that it is equivalent to nodes that are all initial nodes *) let add_to_do_part_of_initial wl kf pdg n = add_to_do_aux ~init:true wl kf pdg n; let initial_nodes = kfmns_find_default kf wl.initial_nodes in if not (NS.mem' n initial_nodes) then begin (* n has never been marked as initial. Mark it in both initial and unimpacted_initial fields (it may leave the second later) *) Options.debug ~level:2 "node %a is a part of the initial impact" Pdg_aux.pretty_node n; let unimpacted_kf = unimpacted_initial_by_kf wl kf in let new_unimpacted = NS.add' n unimpacted_kf in let new_initial = NS.add' n initial_nodes in wl.unimpacted_initial <- KFM.add kf new_unimpacted wl.unimpacted_initial; wl.initial_nodes <- KFM.add kf new_initial wl.initial_nodes; end ;; (** From now on, most functions will pass [init = false] to [add_to_do_aux]. We define an alias instead *) let add_to_do = add_to_do_aux ~init:false (* -------------------------------------------------------------------------- *) (* --- Basic propagation --- *) (* -------------------------------------------------------------------------- *) (** Purely intra-procedural propagation from one impacted node. Just follow the PDG once, for all kind of dependencies. *) let intraprocedural_one_node wl (node, z as nsrc) kf pdg = Options.debug ~level:3 "intraprocedural part"; PdgTypes.Pdg.fold_direct_codpds pdg (fun () (dpd, zopt) n -> (* Filter edge according to the subzone of the node that is impacted *) let follow = match zopt with | None -> true | Some z' -> Locations.Zone.intersects z z' in if follow then begin (* YYY: is it possible to compute a refinement on this zone? *) let ndst = (n, Locations.Zone.top) in add_to_reason wl ~nsrc ~ndst (Intraprocedural dpd); add_to_do wl kf pdg ndst; end ) () node; Options.debug ~level:3 "intraprocedural part done" (* -------------------------------------------------------------------------- *) (* --- Downward call propagation --- *) (* -------------------------------------------------------------------------- *) (** Add a downward call to the worklist the first time it is encountered. This functions implicitly caches the mapping from the PDG nodes of the caller to the ones of the callee, as this information is expensive to compute *) let add_downward_call wl (caller_kf, pdg) (called_kf, called_pdg) stmt = Options.debug ~level:3 "downward part"; if not (KfKfCall.Map.mem (caller_kf, called_kf, stmt) wl.downward_calls) then let callee = (called_kf, called_pdg) in let deps = Pdg_aux.all_call_input_nodes ~caller:pdg ~callee stmt in wl.downward_calls <- KfKfCall.Map.add (caller_kf, called_kf, stmt) deps wl.downward_calls; Options.debug ~level:3 "downard part done" else Options.debug ~level:3 "empty downward part" ;; (** Propagate impact from node [node] if it corresponds to a call statement. This is a partially inter-procedural propagation: some nodes of the callee are directly in the worklist, and the call is registered in the field [downward_calls]. *) let downward_one_call_node wl (pnode, _ as node) caller_kf pdg = match !Db.Pdg.node_key pnode with | Key.SigKey (Signature.In Signature.InCtrl) (* never in the worklist *) | Key.VarDecl _ (* never in the worklist *) | Key.CallStmt _ (* pdg returns a SigCallKey instead *) -> assert false | Key.SigKey _ | Key.Stmt _ | Key.Label _ -> (* Only intraprocedural part needed, done by [intraprocedural_one_node] *) () | Key.SigCallKey(id, key) -> let stmt = Key.call_from_id id in let called_kfs = Db.Value.call_to_kernel_function stmt in KFS.iter (fun called_kf -> let called_pdg = !Db.Pdg.get called_kf in let nodes_callee, pdg_ok = Options.debug ~level:3 "%a: considering call to %a" Pdg_aux.pretty_node node Kernel_function.pretty called_kf; try (match key with | Signature.In (Signature.InNum n) -> (try [!Db.Pdg.find_input_node called_pdg n, Locations.Zone.top] with Not_found -> []) | Signature.In Signature.InCtrl -> (try [!Db.Pdg.find_entry_point_node called_pdg, Locations.Zone.top] with Not_found -> []) | Signature.In (Signature.InImpl _) -> assert false | Signature.Out _ -> [] ), true with | Db.Pdg.Top -> Options.warning "no precise pdg for function %s. \n\ Ignoring this function in the analysis (potentially incorrect results)." (Kernel_function.get_name called_kf); [], false | Db.Pdg.Bottom -> (*Function that fails or never returns immediately *) [], false | Not_found -> assert false in Options.debug ~level:4 "Direct call nodes %a" (Pretty_utils.pp_list ~sep:" " Pdg_aux.pretty_node) nodes_callee; List.iter (fun n -> add_to_reason wl ~nsrc:node ~ndst:n InterproceduralDownward; add_to_do wl called_kf called_pdg n ) nodes_callee; if pdg_ok then add_downward_call wl (caller_kf, pdg) (called_kf, called_pdg) stmt ) called_kfs; Options.debug ~level:3 "propagation of call %a done" Pdg_aux.pretty_node node (* TODO: document *) let zone_restrict set_src_impact = let aux (_, z) acc = Locations.Zone.join z acc in NS.fold aux set_src_impact Locations.Zone.bottom (** Propagate impact for one call registered in [downward_calls]. If the set of impacted nodes in the caller intersect the nodes [deps] that define the input [node] of the call, add [node] to the impacted nodes. *) let downward_one_call_inputs wl kf_caller kf_callee (node, deps) = let results_for_kf_caller = result_by_kf wl kf_caller in if NS.intersects deps results_for_kf_caller then let inter = NS.inter deps results_for_kf_caller in let z = zone_restrict inter in let node' = (node, z) in NS.iter' (fun nsrc -> add_to_reason wl ~nsrc ~ndst:node' InterproceduralDownward) inter; add_to_do wl kf_callee (!Db.Pdg.get kf_callee) node'; ;; (** Propagate impact for all calls registered in [downward_calls]. For each caller, if new impacted nodes have been found, try to propagate the call. Then, zero out the list of functions that must be considered again. *) let downward_calls_inputs wl = let aux (kf_caller, kf_callee, _stmt) ldeps = if KFS.mem kf_caller wl.fun_changed_downward then begin Options.debug ~level:3 "Inputs from call %a -> %a" Kernel_function.pretty kf_caller Kernel_function.pretty kf_callee; List.iter (downward_one_call_inputs wl kf_caller kf_callee) ldeps; Options.debug ~level:3 "call done" end in KfKfCall.Map.iter aux wl.downward_calls; wl.fun_changed_downward <- KFS.empty (* -------------------------------------------------------------------------- *) (* --- Upward call propagation --- *) (* -------------------------------------------------------------------------- *) (** Fill out the field [upward_calls] of the worklist. This is done by visiting (transitively) all the callers of functions in [kfs], and registering all the calls found this way. The callers found are added to the field [callers]. For each find, we find the nodes of the callee that define a given output in the caller using [Pdg_aux.all_call_out_nodes]. [kfs] must be all the functions containing the initial nodes of the analysis. *) let all_upward_callers wl kfs = let aux_call (caller, pdg_caller) (callee, pdg_callee) callsite = Options.debug ~level:2 ~source:(fst (Cil_datatype.Stmt.loc callsite)) "Found call %a -> %a" Kernel_function.pretty caller Kernel_function.pretty callee; let nodes = lazy (Pdg_aux.all_call_out_nodes pdg_callee pdg_caller callsite) in wl.upward_calls <- KfKfCall.Map.add (caller, callee, callsite) nodes wl.upward_calls in let rec fixpoint todo = try let kf = KFS.choose todo in let todo = KFS.remove kf todo in let todo = if not (KFS.mem kf wl.callers) then ( Options.debug "Found caller %a" Kernel_function.pretty kf; let pdg_kf = !Db.Pdg.get kf in List.fold_left (fun todo (caller, callsites) -> let pdg_caller = !Db.Pdg.get caller in List.iter (aux_call (caller, pdg_caller) (kf, pdg_kf)) callsites; KFS.add caller todo ) todo (!Db.Value.callers kf); ) else todo in wl.callers <- KFS.add kf wl.callers; fixpoint todo with Not_found -> () in fixpoint kfs (** Upward propagation in all the callers. For all upward-registered calls, find if new impacted nodes have been found in the callee. If so, check if they intersect with the nodes of the callee defining the output. Then, mark the (caller) output node as impacted. At the end, zero out the list of function that must be examined again. *) let upward_in_callers wl = let aux (caller, callee, _callsite) l = if KFS.mem callee wl.fun_changed_upward then List.iter (fun (n, nodes) -> let results_for_callee = result_by_kf wl callee in if NS.intersects nodes results_for_callee then let inter = NS.inter nodes results_for_callee in let unimpacted_callee = unimpacted_initial_by_kf wl callee in let init = NS.for_all' (fun n -> NS.mem' n unimpacted_callee) inter in let z = zone_restrict inter in let n = (n, z) in NS.iter' (fun nsrc -> add_to_reason wl ~nsrc ~ndst:n InterproceduralUpward ) inter; if init then add_to_do_part_of_initial wl caller (!Db.Pdg.get caller) n else add_to_do wl caller (!Db.Pdg.get caller) n ) (Lazy.force l) in KfKfCall.Map.iter aux wl.upward_calls; wl.fun_changed_upward <- KFS.empty (* -------------------------------------------------------------------------- *) (* --- Initialization --- *) (* -------------------------------------------------------------------------- *) (** Compute the initial state of the worklist. *) let initial_worklist ?(skip=Locations.Zone.bottom) ?(reason=false) nodes kf = let initial = KFM.add kf (List.fold_left (fun s n -> NS.add' n s) NS.empty nodes) KFM.empty; in let wl = { todo = NM.empty; result = KFM.empty; downward_calls = KfKfCall.Map.empty; callers = KFS.empty; upward_calls = KfKfCall.Map.empty; initial_nodes = initial; unimpacted_initial = initial; fun_changed_downward = KFS.empty; fun_changed_upward = KFS.empty; skip = skip; reason = Reason.Set.empty; compute_reason = reason; } in (* Fill the [todo] field *) initial_to_do_list wl kf (!Db.Pdg.get kf) nodes; let initial_callers = if Options.Upward.get () then KFS.singleton kf else KFS.empty in (* Fill the [callers] and [upward_calls] fields *) all_upward_callers wl initial_callers; wl (** To compute the impact of a statement, find the initial PDG nodes that must be put in the worklist. The only subtlety consists in skipping input nodes on statements that are calls; otherwise, we would get an impact in the callees of the call. *) let initial_nodes ~skip kf stmt = Options.debug ~level:3 "computing initial nodes for %d" stmt.sid; let pdg = !Db.Pdg.get kf in if Db.Value.is_reachable_stmt stmt then try let all = !Db.Pdg.find_simple_stmt_nodes pdg stmt in let filter n = match PdgTypes.Node.elem_key n with | Key.SigCallKey (_, Signature.In _) -> false | _ -> not (node_to_skip skip n) in List.filter filter all with | PdgTypes.Pdg.Top -> Options.warning "analysis of %a is too imprecise, impact cannot be computed@." Kernel_function.pretty kf; [] | Not_found -> assert false else begin Options.debug ~level:3 "stmt %d is dead. skipping." stmt.sid; [] end (* -------------------------------------------------------------------------- *) (* --- Fixpoint --- *) (* -------------------------------------------------------------------------- *) (** Choose one node to process in the todo list, if one remains *) let pick wl = try let (n, _ as r) = NM.choose wl.todo in wl.todo <- NM.remove n wl.todo; Some r with Not_found -> None (** Empty the [todo] field of the worklist by applying as many basic steps as possible: intra-procedural steps, plus basic inter-procedural steps on downward calls. *) let rec intraprocedural wl = match pick wl with | None -> () | Some (pnode, { kf; pdg; init; zone }) -> let node = pnode, zone in add_to_result wl node kf init; !Db.progress (); Options.debug ~level:2 "considering new node %a in %a:@ <%a>%t" PdgTypes.Node.pretty pnode Kernel_function.pretty kf Pdg_aux.pretty_node node (fun fmt -> if init then Format.pp_print_string fmt " (init)"); intraprocedural_one_node wl node kf pdg; downward_one_call_node wl node kf pdg; intraprocedural wl let something_to_do wl = not (NM.is_empty wl.todo) (** Make the worklist reach a fixpoint, by propagating all possible source of impact as much as possible. Due to the way calls are treated (by intersecting new impacted nodes with constant sets of nodes), it is more efficient to saturate the field [result] before calling [downward_calls_inputs] and [upward_in_callers]. We also make sure all downward propagation is done before starting upward propagation. *) let rec fixpoint wl = if something_to_do wl then begin intraprocedural wl; (* Save functions on which the results have changed, as [downward_calls_inputs] clears the field [fun_changed_downward] *) wl.fun_changed_upward <- KFS.union wl.fun_changed_downward wl.fun_changed_upward; downward_calls_inputs wl; if something_to_do wl then fixpoint wl else ( upward_in_callers wl; fixpoint wl ) end let remove_unimpacted _kf impact initial = match impact, initial with | None, None | Some _, None | None, Some _ (* impossible *) -> impact | Some impact, Some initial -> Some (NS.diff impact initial) (** Impact of a set of nodes. Once the worklist has reached its fixpoint, remove the initial nodes that are not self-impacting from the result, and return this result. *) let impact ?skip ?reason nodes kf = let wl = initial_worklist ?skip ?reason nodes kf in fixpoint wl; let without_init = KFM.merge remove_unimpacted wl.result wl.unimpacted_initial in without_init, wl.unimpacted_initial, wl.initial_nodes, wl.reason (* -------------------------------------------------------------------------- *) (* --- High-level API --- *) (* -------------------------------------------------------------------------- *) (** Impact of a list of PDG nodes coming from the same function *) let nodes_impacted_by_nodes ?(skip=Locations.Zone.bottom) ?(restrict=Locations.Zone.top) ?(reason=false) kf nodes = let nodes = List.map (fun n -> n, restrict) nodes in let r, unimpacted, initial, reason_graph = impact ~skip ~reason nodes kf in let pp_kf fmt (kf, ns) = Format.fprintf fmt "@[%a: %a@]@ " Kernel_function.pretty kf (Pretty_utils.pp_iter ~sep:",@ " ~pre:"" ~suf:"" NS.iter' Pdg_aux.pretty_node) ns in let iter f = KFM.iter (fun kf ns -> f (kf, ns)) in Options.debug ~level:1 "@[Results:@ %a@]" (Pretty_utils.pp_iter ~sep:"@ " ~pre:"" ~suf:"" iter pp_kf) r; let reason_full = { Reason_graph.reason_graph; nodes_origin = result_to_node_origin r; initial_nodes = initial_to_node_set initial; } in if reason then Reason_graph.print_dot_graph reason_full; r, unimpacted, reason_full (** Impact of a list stmts coming from the same function *) let nodes_impacted_by_stmts ?(skip=Locations.Zone.bottom) ?(restrict=Locations.Zone.top) ?(reason=false) kf stmts = let nodes = List.map (initial_nodes ~skip kf) stmts in let nodes = List.concat nodes in Options.debug "about to compute impact for stmt(s) %a, %d initial nodes" (Pretty_utils.pp_list ~sep:",@ " Stmt.pretty_sid) stmts (List.length nodes); nodes_impacted_by_nodes ~skip ~restrict ~reason kf nodes (** Transform the result of an analysis into a set of PDG nodes *) let result_to_nodes (res: result) : nodes = KFM.fold (fun _ s acc -> NS.union s acc) res NS.empty (** Transform a set of PDG nodes into a set of statements *) let nodes_to_stmts ns = let get_stmt node = Key.stmt (!Db.Pdg.node_key node) in let set = (* Do not generate a list immediately, some nodes would be duplicated *) NS.fold (fun (n, _z) acc -> Extlib.may_map ~dft:acc (fun s -> Stmt.Set.add s acc) (get_stmt n) ) ns Stmt.Set.empty in Stmt.Set.elements set (** Impact of a list of statements as a set of statements *) let stmts_impacted ?(skip=Locations.Zone.bottom) ~reason kf stmts = let r, _, _ = nodes_impacted_by_stmts ~skip ~reason kf stmts in nodes_to_stmts (result_to_nodes r) (** Impact of a list of PDG nodes as a set of nodes *) let nodes_impacted ?(skip=Locations.Zone.bottom) ~reason kf nodes = let r, _, _ = nodes_impacted_by_nodes ~skip ~reason kf nodes in result_to_nodes r (** Nodes impacted in a given function *) let impact_in_kf (res: result) kf = kfmns_find_default kf res (** Computation of the [skip] field from a list of variables *) let skip_bases vars = let aux acc v = let z = Locations.Zone.inject v Int_Intervals.top in Locations.Zone.join z acc in List.fold_left aux Locations.Zone.bottom vars (** Computation of the [skip] field from the [-impact-skip] option *) let skip () = let bases = Options.Skip.fold (fun name l -> let vi = try Base.of_varinfo (Globals.Vars.find_from_astinfo name VGlobal) with Not_found -> if name = "NULL" then Base.null else Options.abort "cannot skip unknown variable %s" name in vi :: l) [] in skip_bases bases (* TODO: dynamically register more high-level functions *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/impact/compute_impact.mli0000666000000000000000000000530113571573400020453 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type nodes = Pdg_aux.NS.t type result = nodes Kernel_function.Map.t val initial_nodes: skip:Locations.Zone.t -> kernel_function -> stmt -> PdgTypes.Node.t list val nodes_impacted_by_stmts: ?skip:Locations.Zone.t -> ?restrict:Locations.Zone.t -> ?reason:bool -> kernel_function -> stmt list -> result * (** Initial *) nodes Kernel_function.Map.t * Reason_graph.reason val nodes_impacted_by_nodes: ?skip:Locations.Zone.t -> ?restrict:Locations.Zone.t -> ?reason:bool -> kernel_function -> PdgTypes.Node.t list -> result * (** Initial *) nodes Kernel_function.Map.t * Reason_graph.reason val stmts_impacted: ?skip:Locations.Zone.t -> reason:bool -> kernel_function -> stmt list -> stmt list val nodes_impacted: ?skip:Locations.Zone.t -> reason:bool -> kernel_function -> PdgTypes.Node.t list -> nodes val result_to_nodes: result -> nodes val nodes_to_stmts: nodes -> stmt list val impact_in_kf: result -> Cil_types.kernel_function -> nodes val skip: unit -> Locations.Zone.t (** computed from the option [-impact-skip] *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/impact/options.ml0000666000000000000000000000567513571573400017002 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "impact" let shortname = "impact" let help = "impact analysis (experimental)" end) module Pragma = Kernel_function_set (struct let option_name = "-impact-pragma" let arg_name = "f1, ..., fn" let help = "use the impact pragmas in the code of functions f1,...,fn" end) module Print = False (struct let option_name = "-impact-print" let help = "print the impacted stmt" end) module Reason = False (struct let option_name = "-impact-graph" let help = "build a graph that explains why a statement is in the set \ of impacted nodes" end) module Slicing = False (struct let option_name = "-impact-slicing" let help = "slice from the impacted stmt" end) module Skip = String_set (struct let arg_name = "v1,...,vn" let help = "consider that those variables are not impacted" let option_name = "-impact-skip" end) let () = Parameter_customize.set_negative_option_name "-impact-not-in-callers" module Upward = True (struct let option_name = "-impact-in-callers" let help = "compute compute impact in callers as well as in callees" end) let is_on () = not (Pragma.is_empty ()) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/impact/options.mli0000666000000000000000000000432213571573400017137 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module Pragma: Parameter_sig.Kernel_function_set (** Use pragmas of given function. *) module Print: Parameter_sig.Bool (** Print the impacted stmt on stdout. *) module Reason: Parameter_sig.Bool (** Build the graphs that explains why a node is impacted. *) module Slicing: Parameter_sig.Bool (** Slicing from the impacted stmt. *) module Skip: Parameter_sig.String_set (** Consider that the variables in the string are not impacted *) module Upward: Parameter_sig.Bool (** Also compute impact within callers *) val is_on: unit -> bool (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/impact/pdg_aux.ml0000666000000000000000000001670213571573400016727 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open PdgIndex open Locations type node = PdgTypes.Node.t * Zone.t module NS = struct include Hptmap.Make (PdgTypes.Node) (Locations.Zone) (Hptmap.Comp_unused) (struct let v = [[]] end) (struct let l = [Ast.self] end) let intersects = let name = "Impact.Pdg_aux.NS.intersects" in let z_intersects _ z1 z2 = Locations.Zone.intersects z1 z2 in let map_intersects = symmetric_binary_predicate (Hptmap_sig.PersistentCache name) ExistentialPredicate ~decide_fast:decide_fast_intersection ~decide_one:(fun _ _ -> false) ~decide_both:z_intersects in fun s1 s2 -> map_intersects s1 s2 let inter = let decide _ z1 z2 = let inter = Locations.Zone.narrow z1 z2 in if Locations.Zone.is_bottom inter then None else Some inter in inter ~cache:(Hptmap_sig.PersistentCache "Pdg_aux.NS.inter") ~symmetric:true ~idempotent:true ~decide let union = let decide _k z1 z2 = Zone.join z1 z2 in join ~cache:(Hptmap_sig.PersistentCache "Pdg_aux.NS.union") ~decide ~symmetric:true ~idempotent:true let find_default n m = try find n m with Not_found -> Zone.bottom (* We reimplement the following functions to get a Set semantics *) let add' (n, z) m = let z' = find_default n m in let z'' = Zone.join z z' in if Zone.equal z z' then m else add n z'' m let mem' (n, z) m = let z' = find_default n m in Zone.is_included z z' let remove' (n, z) m = let z' = find_default n m in let z'' = Zone.diff z' z in (* TODO: z is not an under-approximation *) if Zone.equal z Zone.top || Zone.is_bottom z'' then remove n m else add n z'' m let iter' f m = iter (fun n z -> f (n, z)) m let for_all' f m = try iter (fun n z -> if not (f (n, z)) then raise Exit) m; true with Exit -> false let diff m1 m2 = fold (fun n z acc -> remove' (n, z) acc) m2 m1 let filter' f = map' (fun n z -> if f (n, z) then Some z else None) let fold f = fold (fun n z -> f (n, z)) let () = Db.Value.Table_By_Callstack.add_hook_on_update (fun _ -> clear_caches ()) end type call_interface = (PdgTypes.Node.t * NS.t) list let pretty_node fmt (n, z) = if Locations.Zone.equal z Locations.Zone.top then PdgTypes.Node.pretty_node fmt n else let open PdgIndex.Signature in let default () = Format.fprintf fmt "%a/%a" PdgTypes.Node.pretty_node n Locations.Zone.pretty z in let narrow_by_z = function | Out OutRet | In (InCtrl | InNum _) -> default () | In (InImpl z') | Out (OutLoc z') -> if Locations.Zone.equal z z' then PdgTypes.Node.pretty_node fmt n else default () in match PdgTypes.Node.elem_key n with | PdgIndex.Key.SigCallKey (_, key) | PdgIndex.Key.SigKey key -> narrow_by_z key | _ -> default () let node_list_to_set ?(z=Zone.top) = List.fold_left (fun set (n, zopt) -> match zopt, z with | Some z, _ | None, z -> NS.add' (n, z) set ) NS.empty (** [find_call_input_nodes pdg_caller s ?z input] find all the nodes of [pdg_caller] that define the pdg input [input] above the call statement [s]. If [input] is an implicit input, its value is refined according to [z]. *) (* Copied from pdg/sets.ml, as it is currently not exported *) let find_call_input_nodes pdg_caller call_stmt ?(z=Locations.Zone.top) in_key = match in_key with | PdgIndex.Signature.InCtrl | PdgIndex.Signature.InNum _ -> let idx = PdgTypes.Pdg.get_index pdg_caller in let _, call_sgn = FctIndex.find_call idx call_stmt in let node = PdgIndex.Signature.find_in_info call_sgn in_key in [ node, None ] | PdgIndex.Signature.InImpl zone -> let zone' = Locations.Zone.narrow zone z in (* skip undef zone: any result different from None is due to calldeps or some imprecision. *) let nodes, _undef = !Db.Pdg.find_location_nodes_at_stmt pdg_caller call_stmt ~before:true zone' in nodes let all_call_input_nodes ~caller:pdg_caller ~callee:(kf_callee, pdg_callee) call_stmt = let real_inputs = let inout = !Db.Operational_inputs.get_internal_precise ~stmt:call_stmt kf_callee in inout.Inout_type.over_inputs_if_termination in let test_in acc (in_key, in_node) = let default ?z () = let in_nodes = find_call_input_nodes pdg_caller call_stmt ?z in_key in let in_nodes = node_list_to_set ?z in_nodes in (in_node, in_nodes) :: acc in match in_key with | Signature.InCtrl | Signature.InNum _ -> default () | Signature.InImpl z -> if Locations.Zone.intersects z real_inputs then default ~z:real_inputs () else acc in try let sgn = FctIndex.sgn (PdgTypes.Pdg.get_index pdg_callee) in PdgIndex.Signature.fold_all_inputs test_in [] sgn with PdgTypes.Pdg.Top -> Options.warning ~source:(fst (Cil_datatype.Stmt.loc call_stmt)) ~once:true "skipping impact within imprecisely analyzed function %a" Kernel_function.pretty kf_callee; [] let all_call_out_nodes ~callee ~caller call_stmt = try let _, call_sgn = FctIndex.find_call (PdgTypes.Pdg.get_index caller) call_stmt in let test_out acc (out_key, call_out_node) = (* skip undef: any zone found undef is due to an imprecision or a bug*) let out_nodes, _ = !Db.Pdg.find_output_nodes callee out_key in let out_nodes = node_list_to_set out_nodes in (call_out_node, out_nodes) :: acc in PdgIndex.Signature.fold_all_outputs test_out [] call_sgn with PdgTypes.Pdg.Top -> Options.warning ~source:(fst (Cil_datatype.Stmt.loc call_stmt)) ~once:true "cannot propagate impact into imprecisely analyzed caller function %a" Kernel_function.pretty (Kernel_function.find_englobing_kf call_stmt); [] (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/impact/pdg_aux.mli0000666000000000000000000000720213571573400017073 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open PdgTypes open Locations (** Useful functions that are not directly accessible through the other Pdg modules. *) (** Refinement of a PDG node: we add an indication of which zone is really impacted *) type node = Node.t * Zone.t val pretty_node: node Pretty_utils.formatter (** Sets of pairs [Node.t * Zone.t], with a special semantics for zones: [add n z (add n z' empty)] results in [(n, Zone.join z z')] instead of a set with two different elements. All operations see only instance of a node, with the join of all possible zones. Conversely, a node should not be present with an empty zone. *) module NS: sig include Datatype.S val empty: t val is_empty: t -> bool val pretty: t Pretty_utils.formatter val add': node -> t -> t val union: t -> t -> t val inter: t -> t -> t val diff: t -> t -> t val remove: Node.t -> t -> t val mem: Node.t -> t -> bool val mem': node -> t -> bool val intersects: t -> t -> bool val for_all': (node -> bool) -> t -> bool val iter': (node -> unit) -> t -> unit val fold: (node -> 'a -> 'a) -> t -> 'a -> 'a val filter': (node -> bool) -> t -> t end (** Abstract view of a call frontier. An element [n, S] of the list is such that [n] is impacted if one of the nodes of [S] is impacted. *) type call_interface = (PdgTypes.Node.t * NS.t) list (** [all_call_input_nodes caller callee call_stmt] find all the nodes above [call_stmt] in the pdg of [caller] that define the inputs of [callee]. Each input node in [callee] is returned with the set of nodes that define it in [caller]. *) val all_call_input_nodes: caller:Db.Pdg.t -> callee:kernel_function * Db.Pdg.t -> stmt -> call_interface (** [all_call_out_nodes ~callee ~caller stmt] find all the nodes of [callee] that define the Call/Out nodes of [caller] for the call to [callee] that occurs at [stmt]. Each such out node is returned, with the set of nodes that define it in [callee] *) val all_call_out_nodes : callee:Db.Pdg.t -> caller:Db.Pdg.t -> stmt -> call_interface frama-c-20.0-Calcium/src/plugins/impact/reason_graph.ml0000666000000000000000000001776313571573400017760 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module NodeSet = PdgTypes.NodeSet (** Why is a node impacted. The reasons will be given as [n is impacted by the effect of [n'], and the impact is of type reason]. *) type reason_type = | Intraprocedural of PdgTypes.Dpd.t (** The effect of [n'] in [f] impact [n], which is also in [f]. *) | InterproceduralDownward (** the effect of [n'] in [f] has an effect on a callee [f'] of [f], in which [n] is located. *) | InterproceduralUpward (** the effect of [n'] in [f] has an effect on a caller [f'] of [f] (once the call to [f] has ended), [n] being in [f']. *) module ReasonType = Datatype.Make( struct type t = reason_type let name = "Impact.Reason_graph.reason_type" let reprs = [InterproceduralDownward] include Datatype.Serializable_undefined let compare (v1: t) (v2: t) = Extlib.compare_basic v1 v2 let hash (v: t) = Hashtbl.hash v let equal (v1: t) (v2: t) = v1 == v2 let pretty fmt = function | InterproceduralDownward -> Format.pp_print_string fmt "InterDown" | InterproceduralUpward -> Format.pp_print_string fmt "InterUp" | Intraprocedural dpd -> Format.fprintf fmt "Intra%a" PdgTypes.Dpd.pretty dpd end) (** Reasons for impact are expressed as sets [(n', n, reason)] *) module Reason = Datatype.Triple_with_collections(PdgTypes.Node)(PdgTypes.Node)(ReasonType) (struct let module_name = "Impact.Reason_graph.Reason.t" end) type reason_graph = Reason.Set.t (** Map from a node to the kernel_function it belongs to *) type nodes_origin = Cil_types.kernel_function PdgTypes.Node.Map.t type reason = { reason_graph: reason_graph; nodes_origin: nodes_origin; initial_nodes: Pdg_aux.NS.t; } let empty = { reason_graph = Reason.Set.empty; nodes_origin = PdgTypes.Node.Map.empty; initial_nodes = Pdg_aux.NS.empty; } module DatatypeReason = Datatype.Make(struct include Datatype.Serializable_undefined type t = reason let name = "Impact.Reason_graph.reason" let reprs = [empty] end) module type AdditionalInfo = sig val nodes_origin: nodes_origin val initial_nodes: Pdg_aux.NS.t val in_kf: Cil_types.kernel_function option end module Printer (X: AdditionalInfo) = struct type t = reason_graph module V = struct type t = PdgTypes.Node.t (* TODO: use better pretty-printer for nodes *) let pretty fmt n = PdgIndex.Key.pretty fmt (PdgTypes.Node.elem_key n) end module E = struct type t = V.t * V.t * reason_type let src (e, _, _) = e let dst (_, e, _) = e end (* Kernel_function from which a node comes from. May raise [Not_found], typically for initial nodes. *) let node_kf n = PdgTypes.Node.Map.find n X.nodes_origin (* Should the edge be displayed. This is decided by finding whether one of the nodes belong to X.in_kf *) let keep_edge (n1, n2, _) = match X.in_kf with | None -> true | Some kf -> let in_kf n = try Kernel_function.equal kf (node_kf n) with Not_found -> false in in_kf n1 || in_kf n2 let iter_vertex f graph = (* Construct a set, then iter on it. Otherwise, nodes will be seen more than once. *) let all = Reason.Set.fold (fun (src, dst, _ as e) acc -> if keep_edge e then NodeSet.add src (NodeSet.add dst acc) else acc ) graph NodeSet.empty in NodeSet.iter f all let iter_edges_e f graph = Reason.Set.iter (fun e -> if keep_edge e then f e) graph let vertex_name n = Format.sprintf "n%d" (PdgTypes.Node.id n) let graph_attributes _ = [`Label "Impact graph"] let default_vertex_attributes _g = [`Style `Filled; `Shape `Box] let default_edge_attributes _g = [] let vertex_attributes v = let txt = Pretty_utils.to_string V.pretty v in let txt = if String.length txt > 100 then String.sub txt 0 100 else txt in let txt = Format.asprintf "%S" txt in let txt = String.sub txt 1 (String.length txt - 2) in let shape = if Pdg_aux.NS.mem v X.initial_nodes then [`Shape `Diamond; `Color 0x9090FF] else [] in shape @ [`Label txt] let edge_attributes (_, _, reason) = let color = match reason with | Intraprocedural _ -> 0x2F9F9F | InterproceduralUpward -> 0x9F2F9F | InterproceduralDownward -> 0x9F9F2F in let attribs = [`Color color] in match reason with | Intraprocedural dpd -> `Label (Pretty_utils.to_string PdgTypes.Dpd.pretty dpd) :: attribs | _ -> attribs let get_subgraph n = try let name = Kernel_function.get_name (node_kf n) in let attrs = { Graph.Graphviz.DotAttributes.sg_name = name; sg_parent = None; sg_attributes = [`Label name]; } in Some attrs with Not_found -> None end module Dot (X: AdditionalInfo)= Graph.Graphviz.Dot(Printer(X)) let to_dot_formatter ?in_kf reason fmt = let module Dot = Dot(struct let nodes_origin = reason.nodes_origin let initial_nodes = reason.initial_nodes let in_kf = in_kf end) in Kernel.Unicode.without_unicode (Dot.fprint_graph fmt) reason.reason_graph (* May raise [Sys_error] *) let to_dot_file ~temp ?in_kf reason = let dot_file = try let f name ext = if temp then Extlib.temp_file_cleanup_at_exit name ext else Filename.temp_file name ext in f "impact_reason" ".dot" with Extlib.Temp_file_error s -> Options.abort "cannot create temporary file: %s" s in let cout = open_out dot_file in let fmt = Format.formatter_of_out_channel cout in to_dot_formatter ?in_kf reason fmt; close_out cout; dot_file let print_dot_graph reason = try let dot_file = to_dot_file ~temp:false reason in Options.result "Graph output in file '%s'" dot_file with Sys_error _ as exn -> Options.error "Could not generate impact graph: %s" (Printexc.to_string exn) (* Very basic textual debugging function *) let print_reason reason = let pp_node = !Db.Pdg.pretty_node false in let pp fmt (nsrc, ndst, reason) = Format.fprintf fmt "@[%a -> %a (%s)@]" pp_node nsrc pp_node ndst (match reason with | Intraprocedural dpd -> Format.asprintf "intra %a" PdgTypes.Dpd.pretty dpd | InterproceduralDownward -> "downward" | InterproceduralUpward -> "upward" ) in Options.result "Impact graph:@.%a" (Pretty_utils.pp_iter ~pre:"@[" ~sep:"@ " ~suf:"@]" Reason.Set.iter pp) reason frama-c-20.0-Calcium/src/plugins/impact/register.ml0000666000000000000000000001507513571573400017126 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype let rec pp_stmt fmt s = match s.skind with | Instr _ | Return _ | Goto _ | Break _ | Continue _ | TryFinally _ | TryExcept _ | Throw _ | TryCatch _ -> Printer.without_annot Printer.pp_stmt fmt s | If (e, _, _, _) -> Format.fprintf fmt "if(%a) <..>" Printer.pp_exp e | Switch (e, _, _, _) -> Format.fprintf fmt "switch(%a)<..>" Printer.pp_exp e | Loop _ -> Format.fprintf fmt "while (...)" | Block b -> begin match b.bstmts with | [] -> Format.fprintf fmt "" | s :: _ -> Format.fprintf fmt "" pp_stmt s end | UnspecifiedSequence _ -> Format.fprintf fmt "TODO" let print_results fmt a = Pretty_utils.pp_list (fun fmt s -> Format.fprintf fmt "@[%a (sid %d): %a@]" Printer.pp_location (Stmt.loc s) s.sid pp_stmt s ) fmt a let compute_from_stmt stmt = let kf = Kernel_function.find_englobing_kf stmt in let skip = Compute_impact.skip () in let reason = Options.Reason.get () in Compute_impact.stmts_impacted ~skip ~reason kf [stmt] let compute_from_nodes kf nodes = let skip = Compute_impact.skip () in let reason = Options.Reason.get () in let r = Compute_impact.nodes_impacted ~skip ~reason kf nodes in Pdg_aux.NS.fold (fun (n, _z) acc -> PdgTypes.NodeSet.add n acc) r PdgTypes.NodeSet.empty let compute_multiple_stmts skip kf ls = Options.debug "computing impact of statement(s) %a" (Pretty_utils.pp_list ~sep:",@ " Stmt.pretty_sid) ls; let reason = Options.Reason.get () in let res, _, _ = Compute_impact.nodes_impacted_by_stmts ~skip ~reason kf ls in let res_nodes = Compute_impact.result_to_nodes res in let res_stmts = Compute_impact.nodes_to_stmts res_nodes in if Options.Print.get () then begin Options.result "@[@[impacted statements of stmt(s) %a are:@]@ %a@]" (Pretty_utils.pp_list ~sep:",@ " Stmt.pretty_sid) ls print_results res_stmts end; res_nodes (* Slice on the given list of stmts *) let slice (stmts:stmt list) = Options.feedback ~level:2 "beginning slicing"; let name = "impact slicing" in Slicing.Api.Project.reset_slicing (); let select sel ({ sid = id } as stmt) = let kf = Kernel_function.find_englobing_kf stmt in Options.debug ~level:3 "selecting sid %d (of %s)" id (Kernel_function.get_name kf); Slicing.Api.Select.select_stmt sel ~spare:false stmt kf in let sel = List.fold_left select Slicing.Api.Select.empty_selects stmts in Options.debug ~level:2 "applying slicing request"; Slicing.Api.Request.add_persistent_selection sel; Slicing.Api.Request.apply_all_internal (); Slicing.Api.Slice.remove_uncalled (); let extracted_prj = Slicing.Api.Project.extract name in Options.feedback ~level:2 "slicing done"; extracted_prj let all_pragmas_kf l = List.fold_left (fun acc (s, a) -> match a.annot_content with | APragma (Impact_pragma IPstmt) -> s :: acc | APragma (Impact_pragma (IPexpr _)) -> Options.not_yet_implemented "impact pragmas: expr" | _ -> assert false) [] l let compute_pragmas () = Ast.compute (); let pragmas = ref [] in let visitor = object inherit Visitor.frama_c_inplace as super method! vfunc f = pragmas := []; super#vfunc f method! vstmt_aux s = pragmas := List.map (fun a -> s, a) (Annotations.code_annot ~filter:Logic_utils.is_impact_pragma s) @ !pragmas; Cil.DoChildren end in (* fill [pragmas] with all the pragmas of all the selected functions *) let pragmas = Options.Pragma.fold (fun kf acc -> (* Pragma option only accept defined functions. *) let f = Kernel_function.get_definition kf in ignore (Visitor.visitFramacFunction visitor f); if !pragmas != [] then (kf, !pragmas) :: acc else acc) [] in let skip = Compute_impact.skip () in (* compute impact analyses on each kf *) let nodes = List.fold_left (fun nodes (kf, pragmas) -> let pragmas_stmts = all_pragmas_kf pragmas in Pdg_aux.NS.union nodes (compute_multiple_stmts skip kf pragmas_stmts) ) Pdg_aux.NS.empty pragmas in let stmts = Compute_impact.nodes_to_stmts nodes in if Options.Slicing.get () then ignore (slice stmts); stmts; ;; let compute_pragmas = Journal.register "Impact.compute_pragmas" (Datatype.func Datatype.unit (Datatype.list Stmt.ty)) compute_pragmas let from_stmt = Journal.register "Impact.from_stmt" (Datatype.func Stmt.ty (Datatype.list Stmt.ty)) compute_from_stmt let from_nodes = Journal.register "Impact.from_nodes" (Datatype.func2 Kernel_function.ty (Datatype.list PdgTypes.Node.ty) (PdgTypes.NodeSet.ty)) compute_from_nodes let main () = if Options.is_on () then begin Options.feedback "beginning analysis"; assert (not (Options.Pragma.is_empty ())); ignore (compute_pragmas ()); Options.feedback "analysis done" end let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/impact/register_gui.ml0000666000000000000000000003153113571573400017765 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Pretty_source open Gtk_helper open Db open Cil_types module SelectedStmt = struct include State_builder.Option_ref (Cil_datatype.Stmt) (struct let name = "Impact_gui.SelectedStmt" let dependencies = [ Ast.self ] end) let set s = set s; Project.clear ~selection:(State_selection.only_dependencies self) (); end let () = Cmdline.run_after_extended_stage (fun () -> State_dependency_graph.add_codependencies ~onto:SelectedStmt.self [ !Db.Pdg.self ]) module Highlighted_stmt : sig val add: Kernel_function.t -> stmt -> unit val mem: Kernel_function.t -> stmt -> bool val mem_kf: Kernel_function.t -> bool end = struct open Cil_datatype module Tbl = Kernel_function.Make_Table (Stmt.Set) (struct let name = "Impact_gui.Highlighted_stmt" let size = 7 let dependencies = [ SelectedStmt.self ] end) let add kf s = ignore (Tbl.memo ~change:(fun set -> Stmt.Set.add s set) (fun _ -> Stmt.Set.singleton s) kf) let mem kf s = try let set = Tbl.find kf in Stmt.Set.mem s set with Not_found -> false let mem_kf = Tbl.mem end module ImpactedNodes = State_builder.Ref(Kernel_function.Map.Make(Pdg_aux.NS))(struct let name = "Impact.Register_gui.ImpactedNodes" let dependencies = [SelectedStmt.self] let default () = Kernel_function.Map.empty end) module ReasonGraph = State_builder.Ref(Reason_graph.DatatypeReason)(struct let name = "Impact.Register_gui.ReasonGraph" let dependencies = [SelectedStmt.self] let default () = Reason_graph.empty end) module InitialNodes = State_builder.Ref(Pdg_aux.NS)(struct let name = "Impact.Register_gui.InitialNodes" let dependencies = [SelectedStmt.self] let default () = Pdg_aux.NS.empty end) let impact_in_kf kf = Compute_impact.impact_in_kf (ImpactedNodes.get ()) kf (* Update the 'Impact' column of the gui filetree. *) let update_column = ref (fun _ -> ()) (* Are results shown? *) module Enabled = struct include State_builder.Ref (Datatype.Bool) (struct let name = "Impact_gui.State" let dependencies = [] let default () = false end) end (* Should perform slicing after impact? *) module Slicing = State_builder.Ref (Datatype.Bool) (struct let name = "Impact_gui.Slicing" let dependencies = [] let default () = false end) (* Follow Focus mode *) module FollowFocus = State_builder.Ref (Datatype.Bool) (struct let name = "Impact_gui.FollowFocus" let dependencies = [] let default () = false end) let apply_on_stmt f = function | PStmt (kf,s) -> f kf s | _ -> () let impact_highlighter buffer loc ~start ~stop = if Enabled.get () then let buffer = buffer#buffer in let tag name color = let t = make_tag buffer name [`BACKGROUND color ] in apply_tag buffer t start stop in let hilight kf s = if Highlighted_stmt.mem kf s then tag "hilighed_impact" "green" else SelectedStmt.may (fun sel -> if Cil_datatype.Stmt.equal sel s then tag "selected_impact" "cyan") in apply_on_stmt hilight loc let reason_graph_window parent ?in_kf reason = try let mk_dot_file = Reason_graph.to_dot_formatter ?in_kf reason in Dgraph_helper.graph_window_through_dot ~parent ~title:"Impact graph" mk_dot_file with | Sys_error _ as exn -> Options.error "issue when generating impact graph: %s" (Printexc.to_string exn) let impact_statement restrict s = let kf = Kernel_function.find_englobing_kf s in let skip = Compute_impact.skip () in let reason = Options.Reason.get () in let impact, initial, reason = Compute_impact.nodes_impacted_by_stmts ~skip ~restrict ~reason kf [s] in SelectedStmt.set s; ImpactedNodes.set impact; InitialNodes.set (Kernel_function.Map.find kf initial); ReasonGraph.set reason; let stmts = ref [] in Kernel_function.Map.iter (fun kf s -> let stmts' = Compute_impact.nodes_to_stmts s in stmts := stmts' :: !stmts; List.iter (Highlighted_stmt.add kf) stmts' ) impact; let impact = List.concat !stmts in if Slicing.get () then ignore (Register.slice impact); Enabled.set true; impact let impact_statement = Dynamic.register ~comment:"Compute the impact of the statement in the Gui" ~plugin:"impact" "impact_statement_gui" (Datatype.func ~label:("restrict", Some (fun () -> Locations.Zone.top)) Locations.Zone.ty (Datatype.func Cil_datatype.Stmt.ty (Datatype.list Cil_datatype.Stmt.ty))) ~journalize:true impact_statement let impact_statement_ui (main_ui:Design.main_window_extension_points) s = let val_computed = Db.Value.is_computed () in ignore (impact_statement (*restriction*)Locations.Zone.top s); if not val_computed then main_ui#reset () else ( !update_column `Contents; main_ui#rehighlight () ) let impact_graph_of_function (main_ui:Design.main_window_extension_points) kf = let g = ReasonGraph.get () in let open Reason_graph in if not (Reason.Set.is_empty g.reason_graph) then reason_graph_window main_ui#main_window ~in_kf:kf g let pretty_info = ref true let pp_impact_on_inputs (main_ui:Design.main_window_extension_points) kf = let nodes = impact_in_kf kf in if !pretty_info && not (Pdg_aux.NS.is_empty nodes) then let open PdgIndex.Signature in let open PdgIndex.Key in let call, formals, zones = Pdg_aux.NS.fold (fun (node, z) (call, formals, zones as acc) -> match !Pdg.node_key node with | SigCallKey _ | CallStmt _ | Stmt _ | Label _ -> acc (* Related to one stmt: skip *) | VarDecl _ -> acc (* skip *) | SigKey (Out _) -> acc (* probably impossible *) | SigKey (In InCtrl) -> (true, formals, zones) | SigKey (In (InNum i)) -> (call, i :: formals, zones) | SigKey (In (InImpl z')) -> let z = Locations.Zone.narrow z z' in (call, formals, Locations.Zone.join zones z) ) nodes (false, [], Locations.Zone.bottom) in if call = true || formals <> [] || not (Locations.Zone.is_bottom zones) then let formals = List.sort Datatype.Int.compare formals in main_ui#pretty_information "@[Impacted inputs of the function:@ %t%t@]@." (fun fmt -> if call then Format.fprintf fmt "call@ may@ be@ entirely@ skipped; ") (fun fmt -> if formals <> [] then Pretty_utils.pp_list ~pre:"argument(s)@ " ~sep:"@ " ~suf:",@ " Datatype.Int.pretty fmt formals; if not (Locations.Zone.is_bottom zones) then Locations.Zone.pretty fmt zones ) let pp_impacted_call_outputs (main_ui:Design.main_window_extension_points) kf call_stmt = let nodes = impact_in_kf kf in if !pretty_info && not (Pdg_aux.NS.is_empty nodes) then let open PdgIndex.Signature in let open PdgIndex.Key in let ret, zones = Pdg_aux.NS.fold (fun (node, z) (ret, zones as acc) -> match !Pdg.node_key node with | SigCallKey (stmt', key) when Cil_datatype.Stmt.equal call_stmt stmt' -> (match key with | In _ -> acc (* impossible *) | Out OutRet -> (true, zones) | Out (OutLoc z') -> let z = Locations.Zone.narrow z z' in (ret, Locations.Zone.join zones z) ) | _ -> acc ) nodes (false, Locations.Zone.bottom) in if ret = true || not (Locations.Zone.is_bottom zones) then main_ui#pretty_information "@[Memory impacted by this call:@ %t%t@]@." (fun fmt -> if ret then Format.fprintf fmt "return code; ") (fun fmt -> if not (Locations.Zone.is_bottom zones) then Locations.Zone.pretty fmt zones ) let impact_selector (popup_factory:GMenu.menu GMenu.factory) main_ui ~button localizable = match localizable with | PStmt (kf, s) -> if button = 3 || FollowFocus.get () then ( let callback () = ignore (impact_statement_ui main_ui s) in ignore (popup_factory#add_item "_Impact analysis" ~callback); if Options.Reason.get ()then begin let g = ReasonGraph.get () in if not Reason_graph.(Reason.Set.is_empty g.reason_graph) then begin let callback () = reason_graph_window main_ui#main_window ~in_kf:kf g in ignore (popup_factory#add_item "Impact _graph" ~callback); end; end; if FollowFocus.get () then ignore (Glib.Idle.add (fun () -> callback (); false)) ); if button = 1 then begin (* Initial nodes, at the source of the impact *) (match SelectedStmt.get_option () with | Some s' when Cil_datatype.Stmt.equal s s' -> if !pretty_info then main_ui#pretty_information "@[Impact initial nodes:@ %a@]@." (Pretty_utils.pp_iter Pdg_aux.NS.iter' ~sep:",@ " Pdg_aux.pretty_node) (InitialNodes.get ()); | _ -> () ); pp_impacted_call_outputs main_ui kf s end | PVDecl (_, _, vi) | PGlobal (GFun ({ svar = vi }, _)) when Cil.isFunctionType vi.vtype -> if button = 1 then begin let kf = Globals.Functions.get vi in pp_impact_on_inputs main_ui kf; end; if button = 3 then begin let g = ReasonGraph.get () in let open Reason_graph in if not (Reason.Set.is_empty g.reason_graph) then let kf = Globals.Functions.get vi in let callback () = impact_graph_of_function main_ui kf in ignore (popup_factory#add_item "_Impact graph" ~callback); end | _ -> () let impact_panel main_ui = let w = GPack.vbox () in (* check buttons *) let enabled_button = on_bool w "Enable" Enabled.get (fun b -> Enabled.set b; !update_column `Visibility; main_ui#rehighlight ()) in let slicing_button = on_bool w "Slicing after impact" Slicing.get Slicing.set in let follow_focus_button = on_bool w "Follow focus" FollowFocus.get FollowFocus.set in (* panel refresh *) let refresh () = enabled_button (); slicing_button (); follow_focus_button () in "Impact", w#coerce, Some refresh let file_tree_decorate (file_tree:Filetree.t) = update_column := file_tree#append_pixbuf_column ~title:"Impact" (fun globs -> let is_hilighted = function | GFun ({svar = v }, _) -> Highlighted_stmt.mem_kf (Globals.Functions.get v) | _ -> false in let id = (* laziness of && is used for efficiency *) if Enabled.get () && SelectedStmt.get_option () <> None && List.exists is_hilighted globs then "gtk-apply" else "" in [ `STOCK_ID id ]) (fun () -> Enabled.get () && SelectedStmt.get_option () <> None); !update_column `Visibility let main main_ui = main_ui#register_source_selector impact_selector; main_ui#register_source_highlighter impact_highlighter; main_ui#register_panel impact_panel; file_tree_decorate main_ui#file_tree let () = Design.register_extension main (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/impact/register_gui.mli0000666000000000000000000000342713571573400020141 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Extension of the GUI for the impact plugin. *) (** No function is directly exported: this module simply extends the GUI. *) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/inout/0000777000000000000000000000000013571573400014621 5ustar frama-c-20.0-Calcium/src/plugins/inout/Inout.mli0000666000000000000000000000370013571573400016422 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: Inout.mli,v 1.5 2008-04-01 09:25:20 uid568 Exp $ *) (** Inputs-outputs computations. *) (** No function is directly exported: they are registered in: - {!Db.Inputs} for computations of non functional inputs; - {!Db.Outputs} for computations of outputs; - {!Db.Operational_inputs} for computation of inout context; and - {!Db.Derefs}. *) frama-c-20.0-Calcium/src/plugins/inout/cumulative_analysis.ml0000666000000000000000000001674313571573400021247 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Visitor (* To avoid a performance issue, do not fold implicit zero-initializers of large arrays. For arrays of scalar elements, the outputs of an initializer is exactly the zone covered by the array. For arrays containing structs with padding bits, this is an over-approximation, so we prefer folding the initializer if the array is not too big (the 100 cells limit is arbitrary). We still need to fold the explicit initializers to collect the inputs. *) let fold_implicit_initializer typ = not (Cil.isArrayType typ && (Cil.isArithmeticOrPointerType (Cil.typeOf_array_elem typ) || Ast_info.array_size typ > (Integer.of_int 100))) let specialize_state_on_call ?stmt kf = match stmt with | Some ({ skind = Instr (Call (_, _, l, _)) } as stmt) -> let at_stmt = Db.Value.get_stmt_state stmt in if Cvalue.Model.is_top at_stmt then Cvalue.Model.top (* can occur with -no-results-function option *) else !Db.Value.add_formals_to_state at_stmt kf l | Some ({skind = Instr(Local_init(v, ConsInit(_,args,kind),_))} as stmt) -> let at_stmt = Db.Value.get_stmt_state stmt in if Cvalue.Model.is_top at_stmt then Cvalue.Model.top else begin let args = match kind with | Constructor -> Cil.mkAddrOfVi v :: args | Plain_func -> args in !Db.Value.add_formals_to_state at_stmt kf args end | _ -> Db.Value.get_initial_state kf class virtual ['a] cumulative_visitor = object inherit frama_c_inplace as self method specialize_state_on_call kf = specialize_state_on_call ?stmt:self#current_stmt kf method virtual compute_kf: kernel_function -> 'a end class type virtual ['a] cumulative_class = object inherit ['a] cumulative_visitor method bottom: 'a method result: 'a method join: 'a -> unit method compute_funspec : kernel_function -> 'a method clean_kf_result: kernel_function -> 'a -> 'a end module Make (X: sig val analysis_name: string type t module T: Datatype.S with type t = t class virtual do_it: [t] cumulative_class end) = struct module Memo = Kernel_function.Make_Table(X.T) (struct let name = "Inout.Cumulative_analysis.Memo(" ^ X.analysis_name ^ ")" let dependencies = [ Db.Value.self ] let size = 97 end) class do_it_cached call_stack = object(self) inherit X.do_it (* The cycle variable holds the list of functions that are involved in a cycle. As long as it is not empty, we known that the results we are computing are not complete, and we do not memorize them *) val mutable cycle = Kernel_function.Hptset.empty method private add_cycle s = cycle <- Kernel_function.Hptset.union s cycle method cycle = cycle (* Computation using the body of a kernel function. The result is automatically cached by the function if possible *) method private compute_kf_with_def kf = let f = Kernel_function.get_definition kf in if List.exists (Kernel_function.equal kf) call_stack then ( if Db.Value.ignored_recursive_call kf then Inout_parameters.warning ~current:true ~once:true "During %s analysis of %a: ignoring probable recursive call." X.analysis_name Kernel_function.pretty kf; self#add_cycle (Kernel_function.Hptset.singleton kf); self#bottom ) else let computer = new do_it_cached (kf :: call_stack) in ignore (visitFramacFunction (computer:>frama_c_visitor) f); (* Results on all the statements of the function *) let v = computer#result in let v = computer#clean_kf_result kf v in (* recursive calls detected during analysis of the statements*) let cycle_aux = Kernel_function.Hptset.remove kf computer#cycle in self#add_cycle cycle_aux; if Kernel_function.Hptset.is_empty cycle then ( (* No recursive calls, our results are correct *) Inout_parameters.debug "Caching %s result for %a" X.analysis_name Kernel_function.pretty kf; Memo.add kf v; ) else Inout_parameters.debug "Not caching %s result for %a because of cycle" X.analysis_name Kernel_function.pretty kf; v (* Computation and caching for a kernel function, using its spec *) method private compute_kf_with_spec_generic kf = try Memo.find kf with Not_found -> let r_glob = self#compute_funspec kf in let r_glob = self#clean_kf_result kf r_glob in Memo.add kf r_glob; r_glob method compute_kf kf = if !Db.Value.use_spec_instead_of_definition kf then (* If only a declaration is available, or we are instructed to use the spec, do so. If a current stmt is available (most of the times), do not cache the results. Maybe [compute_funspec] will be able to deliver a more precise result on this given statement *) match self#current_stmt with | None -> self#compute_kf_with_spec_generic kf | Some _stmt -> self#compute_funspec kf else try Memo.find kf with Not_found -> self#compute_kf_with_def kf end let statement stmt = let computer = new do_it_cached [] in ignore (visitFramacStmt (computer:>frama_c_visitor) stmt); assert (Kernel_function.Hptset.is_empty computer#cycle); computer#result let expr stmt e = let computer = new do_it_cached [] in computer#push_stmt stmt; ignore (visitFramacExpr (computer:>frama_c_visitor) e); assert (Kernel_function.Hptset.is_empty computer#cycle); computer#result let kernel_function kf = let computer = new do_it_cached [] in computer#join (computer#compute_kf kf); assert (Kernel_function.Hptset.is_empty computer#cycle); computer#result end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/inout/cumulative_analysis.mli0000666000000000000000000001322313571573400021406 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Implementation of a simple meta-analysis on top of the results of the value analysis. This implementation correctly handles memoization and apparent recursive calls during the value analysis. The underlying analysis is supposed to be cumulative at the level of a kernel_function (its results are derived from the results on all its statements), and mostly non-contextual (all the informations can be gathered using a Cil visitor). *) (** Should implicit zero-initializers for [typ] be folded? False for big arrays to avoid a performance issue. *) val fold_implicit_initializer: typ -> bool val specialize_state_on_call: ?stmt:stmt -> kernel_function -> Db.Value.state (** If the given statement is a call to the given function, enrich the superposed memory state at this statement with the formal arguments of this function. This is usually more precise than the superposition of all initial states of the function *) (** Frama-C visitor for cumulative analyses: we add a few useful methods. The method [compute_kf] must be used to add the effects of a call to the given kernel function to the pool of results *) class virtual ['a] cumulative_visitor : object inherit Visitor.frama_c_inplace method specialize_state_on_call: kernel_function -> Db.Value.state (** If the current statement is a call to the given function, enrich the superposed memory state at this statement with the formal arguments of this function. Useful to do an analysis with a limited amount of context *) method virtual compute_kf: kernel_function -> 'a (** Virtual function to use when one needs to compute the effect of a function call. This function carries implicitly a context: thus calling [self#compute_kf k1; self#compute_kf k2] is different from calling one within the other *) end class type virtual ['a] cumulative_class = object inherit ['a] cumulative_visitor method bottom: 'a (** Result of the analysis *) method result: 'a (** Adding partial results to the current ones *) method join: 'a -> unit (** Function that computes and returns the partial results on a funspec. May consult [self#current_stmt] to specialize itself, and return partially contextual results *) method compute_funspec : kernel_function -> 'a (** Assuming [v] are the results of the analysis for [f] (ie. the union of the results on all the statements of [f], or [compute_funspec f] if [f] has no body), [clean_kf_result k v] cleans those results before storing them. Use for example to remove out-of-scope locals *) method clean_kf_result: kernel_function -> 'a -> 'a end module Make (X: sig val analysis_name: string (** Type of the results *) type t module T: Datatype.S with type t = t (** Class that implements the analysis. Must not deal with memoization, as this is automatically done by the functor *) class virtual do_it: [t] cumulative_class end) : sig (** Module that contains the memoized results *) module Memo: sig val self: State.t end (** Class that implements a cached version of the above analysis. Recursion in the dynamic call graphs are handled, provided the value analysis terminated without detecting a real recursion *) class do_it_cached: Kernel_function.t list -> object inherit X.do_it (** Internal methods that gives the functions for which a cycle has been detected in the dynamic call-graph. Results cannot be safely memoized if this set is not empty *) method cycle: Kernel_function.Hptset.t (** Memoized version of the analysis of a kernel-function *) method compute_kf: kernel_function -> X.t end (** Effects of the given kernel_function, using memoization *) val kernel_function: kernel_function -> X.t (** Effects of a statement, using memoization if it contains a function call*) val statement: stmt -> X.t (** Effects of the given expression (which is supposed to be at the given statement *) val expr: stmt -> exp -> X.t end frama-c-20.0-Calcium/src/plugins/inout/derefs.ml0000666000000000000000000001016313571573400016424 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil open Locations class virtual do_it_ = object(self) inherit [Zone.t] Cumulative_analysis.cumulative_visitor val mutable derefs = Zone.bottom method bottom = Zone.bottom method result = derefs method join new_ = derefs <- Zone.join new_ derefs; method! vlval (base,_ as lv) = begin match base with | Var _ -> () | Mem e -> let state = Db.Value.get_state (Kstmt (Extlib.the self#current_stmt)) in let r = !Db.Value.eval_expr state e in let loc = loc_bytes_to_loc_bits r in let size = Bit_utils.sizeof_lval lv in self#join (enumerate_valid_bits Read (make_loc loc size)) end; DoChildren method compute_funspec (_: kernel_function) = Zone.bottom method clean_kf_result (_ : kernel_function) (r: Locations.Zone.t) = r end module Analysis = Cumulative_analysis.Make( struct let analysis_name ="derefs" type t = Locations.Zone.t module T = Locations.Zone class virtual do_it = do_it_ end) let get_internal = Analysis.kernel_function let externalize _return fundec x = Zone.filter_base (fun v -> not (Base.is_formal_or_local v fundec)) x module Externals = Kernel_function.Make_Table(Locations.Zone) (struct let name = "Inout.Derefs.Externals" let dependencies = [ Analysis.Memo.self ] let size = 17 end) let get_external = Externals.memo (fun kf -> !Db.Value.compute (); if Kernel_function.is_definition kf then try externalize (Kernel_function.find_return kf) (Kernel_function.get_definition kf) (get_internal kf) with Kernel_function.No_Statement -> assert false else (* assume there is no deref for leaf functions *) Zone.bottom) let compute_external kf = ignore (get_external kf) let _pretty_internal fmt kf = Format.fprintf fmt "@[Derefs (internal) for function %a:@\n@[ %a@]@]@\n" Kernel_function.pretty kf Zone.pretty (get_internal kf) let pretty_external fmt kf = Format.fprintf fmt "@[Derefs for function %a:@\n@[ %a@]@]@\n" Kernel_function.pretty kf Zone.pretty (get_external kf) let () = Db.Derefs.self_internal := Analysis.Memo.self; Db.Derefs.self_external := Externals.self; Db.Derefs.get_internal := get_internal; Db.Derefs.get_external := get_external; Db.Derefs.compute := compute_external; Db.Derefs.display := pretty_external; Db.Derefs.statement := Analysis.statement frama-c-20.0-Calcium/src/plugins/inout/derefs.mli0000666000000000000000000000333113571573400016574 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val pretty_external: Format.formatter -> Cil_types.kernel_function -> unit val compute_external: Cil_types.kernel_function -> unit frama-c-20.0-Calcium/src/plugins/inout/inout_parameters.ml0000666000000000000000000001003213571573400020530 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "inout" let shortname = "inout" let help = "operational, imperative and all kinds of inputs/outputs" end) module ForceDeref = False (struct let option_name = "-deref" let help = "force deref computation (undocumented)" end) module ForceAccessPath = False (struct let option_name = "-access-path" let help = "force the access path information to be computed" end) module ForceOut = False (struct let option_name = "-out" let help = "Compute internal out. Those are an over-approximation of the set of written locations" end) module ForceExternalOut = False (struct let option_name = "-out-external" let help = "Compute external out. Those are an over-approximation of the set of written locations, excluding locals" end) module ForceInput = False (struct let option_name = "-input" let help = "Compute imperative inputs. Locals and function parameters are not displayed" end) module ForceInputWithFormals = False (struct let option_name = "-input-with-formals" let help = "Compute imperative inputs. Function parameters are displayed, locals are not" end) module ForceInout = False (struct let option_name = "-inout" let help = "Compute operational inputs, an over-approximation of the set of locations whose initial value is used; and the sure outputs, an under-approximation of the set of the certainly written locations" end) (* Remove in Frama-C Chlorine *) let () = Parameter_customize.is_invisible () module ForceCallwiseInout = True (struct let option_name = "-inout-callwise" let help = "Compute callsite-wide operational inputs; this results in more precise results for -inout and -out options" end) let () = ForceCallwiseInout.add_update_hook (fun _ new_ -> if not new_ then Kernel.abort "@[option -inout-callwise can no longer be unset.@]") module ForceInoutExternalWithFormals = False (struct let option_name = "-inout-with-formals" let help = "same as -inout but without local variables and with function parameters" end) let () = Parameter_customize.set_group messages module Output = True(struct let option_name = "-inout-print" let help = "print the results of all the analyzes" end) (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/inout/inout_parameters.mli0000666000000000000000000000412013571573400020702 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module ForceAccessPath: Parameter_sig.Bool module ForceOut: Parameter_sig.Bool module ForceExternalOut: Parameter_sig.Bool module ForceInput: Parameter_sig.Bool module ForceInputWithFormals: Parameter_sig.Bool module ForceInout: Parameter_sig.Bool module ForceCallwiseInout: Parameter_sig.Bool module ForceInoutExternalWithFormals: Parameter_sig.Bool module ForceDeref: Parameter_sig.Bool module Output: Parameter_sig.Bool (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/inout/inputs.ml0000666000000000000000000001630413571573400016501 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Locations open Visitor class virtual do_it_ = object(self) inherit [Zone.t] Cumulative_analysis.cumulative_visitor as super val mutable inputs = Zone.bottom method bottom = Zone.bottom method result = inputs method join new_ = inputs <- Zone.join new_ inputs; method! vstmt_aux s = match s.skind with | UnspecifiedSequence seq -> List.iter (fun (stmt,_,_,_,_) -> ignore (visitFramacStmt (self:>frama_c_visitor) stmt)) seq; Cil.SkipChildren (* do not visit the additional lvals *) | _ -> super#vstmt_aux s method! vlval lv = let state = Db.Value.get_state self#current_kinstr in let deps, bits_loc, _exact = !Db.Value.lval_to_zone_with_deps_state state ~deps:(Some Zone.bottom) ~for_writing:false lv in self#join deps; self#join bits_loc; Cil.SkipChildren method private do_assign lv = let deps,_loc = !Db.Value.lval_to_loc_with_deps (* loc ignored *) ~deps:Zone.bottom self#current_kinstr lv in (* Format.printf "do_assign deps:%a@." Zone.pretty deps; *) self#join deps; method private do_arg_calls f args = let state = Db.Value.get_state self#current_kinstr in (if Cvalue.Model.is_top state then self#join Zone.top else let deps_callees, callees = !Db.Value.expr_to_kernel_function_state ~deps:(Some Zone.bottom) state f in self#join deps_callees; Kernel_function.Hptset.iter (fun kf -> self#join (self#compute_kf kf)) callees; ); List.iter (fun exp -> ignore (visitFramacExpr (self:>frama_c_visitor) exp)) args method! vinst i = if Db.Value.is_reachable (Db.Value.get_state self#current_kinstr) then begin match i with | Set (lv,exp,_) -> self#do_assign lv; ignore (visitFramacExpr (self:>frama_c_visitor) exp); Cil.SkipChildren | Local_init(v, AssignInit i,_) -> let rec aux lv = function | SingleInit e -> self#do_assign lv; ignore (visitFramacExpr (self:>frama_c_visitor) e) | CompoundInit (ct,initl) -> (* No need to consider implicit zero-initializers, for which nothing is read. *) let implicit = false in let doinit o i _ () = ignore (visitFramacOffset (self:>frama_c_visitor) o); aux (Cil.addOffsetLval o lv) i in Cil.foldLeftCompound ~implicit ~doinit ~ct ~initl ~acc:() in aux (Cil.var v) i; Cil.SkipChildren | Call (lv_opt,exp,args,_) -> Extlib.may self#do_assign lv_opt; self#do_arg_calls exp args; Cil.SkipChildren | Local_init(v, ConsInit(f, args, Plain_func), _) -> self#do_assign (Cil.var v); self#do_arg_calls (Cil.evar f) args; Cil.SkipChildren | Local_init(v, ConsInit(f, args, Constructor), _) -> self#do_arg_calls (Cil.evar f) (Cil.mkAddrOfVi v :: args); Cil.SkipChildren | Skip _ | Asm _ | Code_annot _ -> Cil.DoChildren end else Cil.SkipChildren method! vexpr exp = match exp.enode with | AddrOf lv | StartOf lv -> let deps,_loc = !Db.Value.lval_to_loc_with_deps (* loc ignored *) ~deps:Zone.bottom self#current_kinstr lv in self#join deps; Cil.SkipChildren | SizeOfE _ | AlignOfE _ | SizeOf _ | AlignOf _ -> (* we're not evaluating an expression here: there's no input. *) Cil.SkipChildren | _ -> Cil.DoChildren method compute_funspec kf = let state = self#specialize_state_on_call kf in let behaviors = !Db.Value.valid_behaviors kf state in let assigns = Ast_info.merge_assigns behaviors in !Db.Value.assigns_inputs_to_zone state assigns method clean_kf_result (_ : kernel_function) (r: Locations.Zone.t) = r end module Analysis = Cumulative_analysis.Make( struct let analysis_name ="inputs" type t = Locations.Zone.t module T = Locations.Zone class virtual do_it = do_it_ end) let get_internal = Analysis.kernel_function module Externals = Kernel_function.Make_Table(Locations.Zone) (struct let name = "Inout.Inputs.Externals" let dependencies = [ Analysis.Memo.self ] let size = 17 end) let get_external = Externals.memo (fun kf -> Zone.filter_base (Callgraph.Uses.accept_base ~with_formals:false ~with_locals:false kf) (get_internal kf)) let get_with_formals kf = Zone.filter_base (Callgraph.Uses.accept_base ~with_formals:true ~with_locals:false kf) (get_internal kf) let compute_external kf = ignore (get_external kf) let pretty_external fmt kf = Format.fprintf fmt "@[Inputs for function %a:@\n@[ %a@]@]@\n" Kernel_function.pretty kf Zone.pretty (get_external kf) let pretty_with_formals fmt kf = Format.fprintf fmt "@[Inputs (with formals) for function %a:@\n@[ %a@]@]@\n" Kernel_function.pretty kf Zone.pretty (get_with_formals kf) let () = Db.Inputs.self_internal := Analysis.Memo.self; Db.Inputs.self_external := Externals.self; Db.Inputs.self_with_formals := Analysis.Memo.self; Db.Inputs.get_internal := get_internal; Db.Inputs.get_external := get_external; Db.Inputs.get_with_formals := get_with_formals; Db.Inputs.compute := compute_external; Db.Inputs.display := pretty_external; Db.Inputs.display_with_formals := pretty_with_formals; Db.Inputs.statement := Analysis.statement; Db.Inputs.expr := Analysis.expr (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/inout/inputs.mli0000666000000000000000000000335713571573400016656 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val pretty_external: Format.formatter -> Cil_types.kernel_function -> unit val pretty_with_formals: Format.formatter -> Cil_types.kernel_function -> unit frama-c-20.0-Calcium/src/plugins/inout/operational_inputs.ml0000666000000000000000000007352313571573400021104 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Locations (* Computation of over-approximated operational inputs: An accurate computation of these inputs needs the computation of under-approximated outputs. *) type t = Inout_type.t = { over_inputs: Locations.Zone.t; over_inputs_if_termination: Locations.Zone.t; under_outputs_if_termination: Locations.Zone.t; over_outputs: Locations.Zone.t; over_outputs_if_termination: Locations.Zone.t; } let top = { over_inputs = Zone.top; over_inputs_if_termination = Zone.top; under_outputs_if_termination = Zone.bottom; over_outputs = Zone.top; over_outputs_if_termination = Zone.top; } (* [_if_termination] fields of the type above, which are the one propagated by the dataflow analysis of this module. It is meaningless to store the other ones, as they come from branches that are by construction not propagated until the end by the dataflow. *) type compute_t = { over_inputs_d : Zone.t ; under_outputs_d : Zone.t; over_outputs_d: Zone.t; } (* Initial value for the computation *) let empty = { over_inputs_d = Zone.bottom; under_outputs_d = Zone.bottom; over_outputs_d = Zone.bottom; } let bottom = { over_inputs_d = Zone.bottom; under_outputs_d = Zone.top; over_outputs_d = Zone.bottom; } let equal ct1 ct2 = Zone.equal ct1.over_inputs_d ct2.over_inputs_d && Zone.equal ct1.under_outputs_d ct2.under_outputs_d && Zone.equal ct1.over_outputs_d ct2.over_outputs_d let join c1 c2 = { over_inputs_d = Zone.join c1.over_inputs_d c2.over_inputs_d; under_outputs_d = Zone.meet c1.under_outputs_d c2.under_outputs_d; over_outputs_d = Zone.join c1.over_outputs_d c2.over_outputs_d; } let is_included c1 c2 = Zone.is_included c1.over_inputs_d c2.over_inputs_d && Zone.is_included c2.under_outputs_d c1.under_outputs_d && Zone.is_included c1.over_outputs_d c2.over_outputs_d let join_and_is_included smaller larger = let join = join smaller larger in join, equal join larger ;; let externalize_zone ~with_formals kf = Zone.filter_base (Callgraph.Uses.accept_base ~with_formals ~with_locals:false kf) (* This code evaluates an assigns, computing in particular a sound approximation of sure outputs. For an assigns [locs_out \from locs_from], the process is the following: - evaluate locs_out to locations; discard those that are not exact, as we cannot guarantee that they are always assigned - evaluate locs_from, as a zone (no need for locations) - compute the difference between the out and the froms, ie remove the zones that are such that [z \from z] holds (Note: large parts of this code are inspired/redundant with [assigns_to_zone_foobar_state] in Value/register.ml) *) let eval_assigns kf state assigns = let treat_one_zone acc (out, froms as asgn) = (* treat a single assign *) (* Return a list of independent output zones, plus a zone indicating that the zone has been overwritten in a sure way *) let clean_deps = Locations.Zone.filter_base (function | Base.Var (v, _) | Base.Allocated (v, _, _) -> not (Kernel_function.is_formal v kf) | Base.CLogic_Var _ | Base.Null | Base.String _ -> true) in let out_term = out.it_content in let outputs_under, outputs_over, deps = try if Logic_const.(is_result out_term || is_exit_status out_term) then (Zone.bottom, Zone.bottom, Zone.bottom) else let loc_out_under, loc_out_over, deps = !Db.Properties.Interp.loc_to_loc_under_over ~result:None state out_term in (enumerate_valid_bits_under Write loc_out_under, enumerate_valid_bits Write loc_out_over, clean_deps deps) with Db.Properties.Interp.No_conversion -> Inout_parameters.warning ~current:true ~once:true "failed to interpret assigns clause '%a'" Printer.pp_term out_term; (Zone.bottom, Zone.top, Zone.top) in (* Compute all inputs as a zone *) let inputs = try match froms with | FromAny -> Zone.top | From l -> let aux acc { it_content = from } = let _, loc, deps = !Db.Properties.Interp.loc_to_loc_under_over None state from in let acc = Zone.join (clean_deps deps) acc in let z = enumerate_valid_bits Read loc in Zone.join z acc in List.fold_left aux deps l with Db.Properties.Interp.No_conversion -> Inout_parameters.warning ~current:true ~once:true "failed to interpret inputs in assigns clause '%a'" Printer.pp_from asgn; Zone.top in (* Fuse all outputs. An output is sure if it was certainly overwritten (i.e. is in the left part of an assign clause, and if it is not amongst its from.) *) (* Note: here we remove an overapproximation from an underapproximation to get an underapproximation, which is not the usual direction. It works here because diff on non-top zones is an exact operation. *) let sure_out = Zone.(if equal top inputs then bottom else diff outputs_under inputs) in { under_outputs_d = Zone.link acc.under_outputs_d sure_out; over_inputs_d = Zone.join acc.over_inputs_d inputs; over_outputs_d = Zone.join acc.over_outputs_d outputs_over; } in match assigns with | WritesAny -> Inout_parameters.warning "@[no assigns clauses for@ function %a.@]@ \ Results will be imprecise." Kernel_function.pretty kf; top | Writes l -> let init = { bottom with under_outputs_d = Zone.bottom } in let r = List.fold_left treat_one_zone init l in { over_inputs = r.over_inputs_d; over_inputs_if_termination = r.over_inputs_d; under_outputs_if_termination = r.under_outputs_d; over_outputs = r.over_outputs_d; over_outputs_if_termination = r.over_outputs_d; } let compute_using_prototype_state state kf = let behaviors = !Db.Value.valid_behaviors kf state in let assigns = Ast_info.merge_assigns behaviors in eval_assigns kf state assigns let compute_using_given_spec_state state funspec kf = let assigns = Ast_info.merge_assigns funspec.spec_behavior in eval_assigns kf state assigns let compute_using_prototype ?stmt kf = let state = Cumulative_analysis.specialize_state_on_call ?stmt kf in compute_using_prototype_state state kf (* Results of this module, consolidated by functions. Formals and locals are stored *) module Internals = Kernel_function.Make_Table(Inout_type) (struct let name = "Inout.Operational_inputs.Internals" let dependencies = [ Db.Value.self ] let size = 17 end) module CallsiteHash = Value_types.Callsite.Hashtbl (* Results of an an entire call, represented by a pair (stmt, kernel_function]). This table is filled by the [-inout-callwise] option, or for functions for which only the specification is used. *) module CallwiseResults = State_builder.Hashtbl (Value_types.Callsite.Hashtbl) (Inout_type) (struct let size = 17 let dependencies = [Internals.self; Inout_parameters.ForceCallwiseInout.self] let name = "Inout.Operational_inputs.CallwiseResults" end) module Computer(Fenv:Dataflows.FUNCTION_ENV)(X:sig val _version: string (* Debug: Callwise or functionwise *) val _kf: kernel_function (* Debug: Function being analyzed *) val stmt_state: stmt -> Db.Value.state (* Memory state at the given stmt *) val at_call: stmt -> kernel_function -> Inout_type.t (* Results of the analysis for the given call. Must not contain locals or formals *) end) = struct (* We want to compute the in/out for all terminating and non-terminating points of the function. This is not immediate with a dataflow, as all (1) infinite loops, (2) branches that call a non terminating function, or (3) branches that fail, will not appear in the final state. Hence, we two use auxiliary variables into which we add all partial results. *) let non_terminating_inputs = ref Zone.bottom let non_terminating_outputs = ref Zone.bottom let store_non_terminating_inputs inputs = non_terminating_inputs := Zone.join !non_terminating_inputs inputs; ;; let store_non_terminating_outputs outputs = non_terminating_outputs := Zone.join !non_terminating_outputs outputs; ;; (* Store the 'non-termination' information of a function subcall into the current call. [under_outputs] are the current call sure outputs. *) let store_non_terminating_subcall under_outputs subcall = store_non_terminating_inputs (Zone.diff subcall.over_inputs under_outputs); store_non_terminating_outputs subcall.over_outputs; ;; let catenate c1 c2 = let inputs = Zone.diff c2.over_inputs_d c1.under_outputs_d in store_non_terminating_inputs inputs; { over_inputs_d = Zone.join c1.over_inputs_d inputs; under_outputs_d = Zone.link c1.under_outputs_d c2.under_outputs_d; over_outputs_d = Zone.join c1.over_outputs_d c2.over_outputs_d; } type t = compute_t let pretty fmt x = Format.fprintf fmt "@[Over-approximated operational inputs: %a@]@\n\ @[Under-approximated operational outputs: %a@]" Zone.pretty x.over_inputs_d Zone.pretty x.under_outputs_d let bottom = bottom let join_and_is_included = join_and_is_included let join = join let is_included = is_included (* Transfer function on expression. *) let transfer_exp s exp data = let state = X.stmt_state s in let inputs = !Db.From.find_deps_no_transitivity_state state exp in let new_inputs = Zone.diff inputs data.under_outputs_d in store_non_terminating_inputs new_inputs; {data with over_inputs_d = Zone.join data.over_inputs_d new_inputs} (* Initialized const variables should be included as outputs of the function, so [for_writing] must be false for local initializations. It should be true for all other instructions. *) let add_out ~for_writing state lv deps data = let deps, new_outs, exact = !Db.Value.lval_to_zone_with_deps_state state ~deps:(Some deps) ~for_writing lv in store_non_terminating_outputs new_outs; let new_inputs = Zone.diff deps data.under_outputs_d in store_non_terminating_inputs new_inputs; let new_sure_outs = if exact then (* There is only one modified zone. So, this is an exact output. Add it into the under-approximated outputs. *) Zone.link data.under_outputs_d new_outs else data.under_outputs_d in { under_outputs_d = new_sure_outs; over_inputs_d = Zone.join data.over_inputs_d new_inputs; over_outputs_d = Zone.join data.over_outputs_d new_outs } let transfer_call ~for_writing s dest f args _loc data = let state = X.stmt_state s in let f_inputs, called = !Db.Value.expr_to_kernel_function_state ~deps:(Some Zone.bottom) state f in let acc_f_arg_inputs = (* add the inputs of [argl] to the inputs of the function expression *) List.fold_right (fun arg inputs -> let arg_inputs = !Db.From.find_deps_no_transitivity_state state arg in Zone.join inputs arg_inputs) args f_inputs in let data = catenate data { over_inputs_d = acc_f_arg_inputs ; under_outputs_d = Zone.bottom; over_outputs_d = Zone.bottom; } in let for_functions = Kernel_function.Hptset.fold (fun kf acc -> let res = X.at_call s kf in store_non_terminating_subcall data.over_outputs_d res; let for_function = { over_inputs_d = res.over_inputs_if_termination; under_outputs_d = res.under_outputs_if_termination; over_outputs_d = res.over_outputs_if_termination; } in join for_function acc) called bottom in let result = catenate data for_functions in let result = (* Treatment for the possible assignment of the call result *) (match dest with | None -> result | Some lv -> add_out ~for_writing state lv Zone.bottom result) in result (* Transfer function on instructions. *) let transfer_instr stmt (i: instr) (data: t) = match i with | Set (lv, exp, _) -> let state = X.stmt_state stmt in let e_inputs = !Db.From.find_deps_no_transitivity_state state exp in add_out ~for_writing:true state lv e_inputs data | Local_init (v, AssignInit i, _) -> let state = X.stmt_state stmt in let rec aux lv i acc = match i with | SingleInit e -> let e_inputs = !Db.From.find_deps_no_transitivity_state state e in add_out ~for_writing:false state lv e_inputs acc | CompoundInit(ct, initl) -> (* Avoid folding implicit zero-initializer of large arrays. *) let implicit = Cumulative_analysis.fold_implicit_initializer ct in let doinit o i _ data = aux (Cil.addOffsetLval o lv) i data in let data = Cil.foldLeftCompound ~implicit ~doinit ~ct ~initl ~acc in if implicit then data else (* If the implicit zero-initializers hade been skipped, add the zone of the array as outputs. It is exactly the written zone for arrays of scalar elements. Nothing is read by zero-initializers, so the inputs are empty. *) add_out ~for_writing:false state lv Zone.bottom acc in aux (Cil.var v) i data | Call (lvaloption,funcexp,argl,loc) -> transfer_call ~for_writing:true stmt lvaloption funcexp argl loc data | Local_init(v, ConsInit(f, args, kind), loc) -> let transfer = transfer_call ~for_writing:false stmt in Cil.treat_constructor_as_func transfer v f args kind loc data | Asm _ | Code_annot _ | Skip _ -> data ;; (* transfer_guard: gets the state obtained after evaluating the condition, and split the state according to the truth value of the condition. In this case, we just make sure that dead edges get bottom, instead of the input state. *) let transfer_guard stmt e t = let state = X.stmt_state stmt in let v_e = !Db.Value.eval_expr state e in let t1 = Cil.unrollType (Cil.typeOf e) in let do_then, do_else = if Cil.isIntegralType t1 || Cil.isPointerType t1 then Cvalue.V.contains_non_zero v_e, Cvalue.V.contains_zero v_e else true, true (* TODO: a float condition is true iff != 0.0 *) in (if do_then then t else bottom), (if do_else then t else bottom) ;; let return_data = ref bottom;; let transfer_stmt s data = let map_on_all_succs new_data = List.map (fun x -> (x,new_data)) s.succs in match s.skind with | Instr i -> map_on_all_succs (transfer_instr s i data) | If(exp,_,_,_) -> let data = transfer_exp s exp data in Dataflows.transfer_if_from_guard transfer_guard s data | Switch(exp,_,_,_) -> let data = transfer_exp s exp data in Dataflows.transfer_switch_from_guard transfer_guard s data | Return(Some exp,_) -> return_data := transfer_exp s exp data; assert (s.succs == []); [] | Return(None,_) -> return_data := data; assert (s.succs == []); [] | Throw _ | TryCatch _ -> Inout_parameters.fatal "Exception node in the AST" | UnspecifiedSequence _ | Loop _ | Block _ | Goto _ | Break _ | Continue _ | TryExcept _ | TryFinally _ -> map_on_all_succs data ;; (* Note: Not sure this adds anything to the precision (or efficiency) once we have tested the guards. The difference does not show up in the tests. *) let transfer_stmt s data = if Db.Value.is_reachable (X.stmt_state s) then transfer_stmt s data else [] ;; let init = [(Kernel_function.find_first_stmt Fenv.kf), empty];; let end_dataflow () = let res_if_termination = !return_data in { over_inputs_if_termination = res_if_termination.over_inputs_d; under_outputs_if_termination = res_if_termination.under_outputs_d ; over_outputs_if_termination = res_if_termination.over_outputs_d; over_inputs = Zone.join !non_terminating_inputs res_if_termination.over_inputs_d; over_outputs = Zone.join !non_terminating_outputs res_if_termination.over_outputs_d; } end let externalize ~with_formals kf v = let filter = externalize_zone ~with_formals kf in Inout_type.map filter v let compute_externals_using_prototype ?stmt kf = let internals = compute_using_prototype ?stmt kf in externalize ~with_formals:false kf internals let get_internal_aux ?stmt kf = match stmt with | None -> !Db.Operational_inputs.get_internal kf | Some stmt -> try CallwiseResults.find (kf, Kstmt stmt) with Not_found -> if !Db.Value.use_spec_instead_of_definition kf then compute_using_prototype ~stmt kf else !Db.Operational_inputs.get_internal kf let get_external_aux ?stmt kf = match stmt with | None -> !Db.Operational_inputs.get_external kf | Some stmt -> try let internals = CallwiseResults.find (kf, Kstmt stmt) in externalize ~with_formals:false kf internals with Not_found -> if !Db.Value.use_spec_instead_of_definition kf then let r = compute_externals_using_prototype ~stmt kf in CallwiseResults.add (kf, Kstmt stmt) r; r else !Db.Operational_inputs.get_external kf let extract_inout_from_froms froms = let open Function_Froms in let {deps_return; deps_table } = froms in let in_return = Deps.to_zone deps_return in let in_, out_ = match deps_table with | Memory.Top -> Zone.top, Zone.top | Memory.Bottom -> Zone.bottom, Zone.bottom | Memory.Map m -> let aux_from out in_ (acc_in,acc_out as acc) = let open DepsOrUnassigned in (* Skip zones fully unassigned, they are not really port of the dependencies, but just present in the offsetmap to avoid "holes" *) match in_ with | DepsBottom | Unassigned -> acc | AssignedFrom in_ | MaybeAssignedFrom in_ -> Zone.join acc_in (Deps.to_zone in_), Zone.join acc_out out in Memory.fold aux_from m (Zone.bottom, Zone.bottom) in (Zone.join in_return in_), out_ module Callwise = struct let compute_callwise () = Inout_parameters.ForceCallwiseInout.get () || Dynamic.Parameter.Bool.get "-memexec-all" () let merge_call_in_local_table call local_table v = let prev = try CallsiteHash.find local_table call with Not_found -> Inout_type.bottom in let joined = Inout_type.join v prev in CallsiteHash.replace local_table call joined let merge_call_in_global_tables (kf, _ as call) v = (* Global callwise table *) let prev = try CallwiseResults.find call with Not_found -> Inout_type.bottom in CallwiseResults.replace call (Inout_type.join v prev); (* Global, kf-indexed, table *) let prev = try Internals.find kf with Not_found -> Inout_type.bottom in Internals.replace kf (Inout_type.join v prev); ;; let merge_local_table_in_global_ones = CallsiteHash.iter merge_call_in_global_tables ;; let call_inout_stack = ref [] let call_for_callwise_inout (call_type, state, call_stack) = if compute_callwise () then begin let (current_function, ki as call_site) = List.hd call_stack in let merge_inout inout = if ki = Kglobal then merge_call_in_global_tables call_site inout else let _above_function, table = try List.hd !call_inout_stack with Failure _ -> assert false in merge_call_in_local_table call_site table inout in match call_type with | `Builtin {Value_types.c_from = Some (froms,sure_out) } -> let in_, out_ = extract_inout_from_froms froms in let inout = { over_inputs_if_termination = in_; over_inputs = in_; over_outputs_if_termination = out_ ; over_outputs = out_; under_outputs_if_termination = sure_out; } in merge_inout inout | `Def | `Memexec -> let table_current_function = CallsiteHash.create 7 in call_inout_stack := (current_function, table_current_function) :: !call_inout_stack | `Spec spec -> let inout =compute_using_given_spec_state state spec current_function in merge_inout inout | `Builtin { Value_types.c_from = None } -> let inout = compute_using_prototype_state state current_function in merge_inout inout end;; module MemExec = State_builder.Hashtbl (Datatype.Int.Hashtbl) (Inout_type) (struct let size = 17 let dependencies = [Internals.self] let name = "Operational_inputs.MemExec" end) let end_record call_stack inout = merge_local_table_in_global_ones (snd (List.hd !call_inout_stack)); let (current_function, _ as call_site) = List.hd call_stack in (* pop + record in top of stack the inout of function that just finished*) match !call_inout_stack with | (current_function2, _) :: (((_caller, table) :: _) as tail) -> if current_function2 != current_function then Inout_parameters.fatal "callwise inout %a != %a@." Kernel_function.pretty current_function (* g *) Kernel_function.pretty current_function2 (* f *); call_inout_stack := tail; merge_call_in_local_table call_site table inout; | _ -> (* the entry point, probably *) merge_call_in_global_tables call_site inout; call_inout_stack := []; CallwiseResults.mark_as_computed () let compute_call_from_value_states kf states = let module Fenv = (val Dataflows.function_env kf: Dataflows.FUNCTION_ENV) in let module Computer = Computer(Fenv)( struct let _version = "callwise" let _kf = kf let stmt_state stmt = try Cil_datatype.Stmt.Hashtbl.find states stmt with Not_found -> Cvalue.Model.bottom let at_call stmt kf = let _cur_kf, table = List.hd !call_inout_stack in try let with_internals = CallsiteHash.find table (kf, Kstmt stmt) in let filter = match kf.fundec with | Definition (fundec, _) -> (fun b -> not (Base.is_formal_or_local b fundec)) | _ -> let vi_kf = Kernel_function.get_vi kf in (fun b -> not (Base.is_formal_of_prototype b vi_kf)) in Inout_type.map (Zone.filter_base filter) with_internals with Not_found -> Inout_type.bottom end) in let module Compute = Dataflows.Simple_forward(Fenv)(Computer) in Computer.end_dataflow () let record_for_callwise_inout ((call_stack: Db.Value.callstack), value_res) = if compute_callwise () then let inout = match value_res with | Value_types.Normal (states, _after_states) | Value_types.NormalStore ((states, _after_states), _) -> let kf = fst (List.hd call_stack) in let inout = try if !Db.Value.no_results (Kernel_function.get_definition kf) then top else compute_call_from_value_states kf (Lazy.force states) with Kernel_function.No_Definition -> top in (match value_res with | Value_types.NormalStore (_, memexec_counter) -> MemExec.replace memexec_counter inout | _ -> ()); inout | Value_types.Reuse counter -> MemExec.find counter in Db.Operational_inputs.Record_Inout_Callbacks.apply (call_stack, inout); end_record call_stack inout (* Register our callbacks inside the value analysis *) let () = Db.Value.Record_Value_Callbacks_New.extend_once record_for_callwise_inout; Db.Value.Call_Type_Value_Callbacks.extend_once call_for_callwise_inout;; end (* Functionwise version of the computations. *) module FunctionWise = struct (* Stack of function being processed *) let call_stack : kernel_function Stack.t = Stack.create () let compute_internal_using_cfg kf = try let module Fenv = (val Dataflows.function_env kf: Dataflows.FUNCTION_ENV) in let module Computer = Computer(Fenv)(struct let _version = "functionwise" let _kf = kf let stmt_state s = Db.Value.get_stmt_state s let at_call stmt kf = get_external_aux ~stmt kf end) in Stack.iter (fun g -> if kf == g then begin if Db.Value.ignored_recursive_call kf then Inout_parameters.warning ~current:true "During inout context analysis of %a:@ \ ignoring probable recursive call." Kernel_function.pretty kf; raise Exit end) call_stack; Stack.push kf call_stack; let module Compute = Dataflows.Simple_forward(Fenv)(Computer) in let result = Computer.end_dataflow () in ignore (Stack.pop call_stack); result with Exit -> Inout_type.bottom (*TODO*) (*{ Inout_type.over_inputs_if_termination = empty.over_inputs_d ; under_outputs_if_termination = empty.under_outputs_d; over_inputs = empty.over_inputs_d; over_outputs = empty.over_outputs_d; over_outputs_if_termination = empty.over_outputs_d; }*) let compute_internal_using_cfg kf = if !Db.Value.no_results (Kernel_function.get_definition kf) then top else begin Inout_parameters.feedback ~level:2 "computing for function %a%s" Kernel_function.pretty kf (let s = ref "" in Stack.iter (fun kf -> s := !s^" <-"^ (Format.asprintf "%a" Kernel_function.pretty kf)) call_stack; !s); let r = compute_internal_using_cfg kf in Inout_parameters.feedback ~level:2 "done for function %a" Kernel_function.pretty kf; r end end let get_internal = Internals.memo (fun kf -> !Db.Value.compute (); try Internals.find kf (* If [-inout-callwise] is set, the results may have been computed by the call to Value.compute *) with | Not_found -> if!Db.Value.use_spec_instead_of_definition kf then compute_using_prototype kf else FunctionWise.compute_internal_using_cfg kf ) let raw_externals ~with_formals kf = let filter = externalize ~with_formals kf in filter (get_internal kf) module Externals = Kernel_function.Make_Table(Inout_type) (struct let name = "External inouts full" let dependencies = [ Internals.self ] let size = 17 end) let get_external = Externals.memo (raw_externals ~with_formals:false) let compute_external kf = ignore (get_external kf) module Externals_With_Formals = Kernel_function.Make_Table(Inout_type) (struct let name = "Inout.Operational_inputs.Externals_With_Formals" let dependencies = [ Internals.self ] let size = 17 end) let get_external_with_formals = Externals_With_Formals.memo (raw_externals ~with_formals:true) let compute_external_with_formals kf = ignore (get_external_with_formals kf) let pretty_operational_inputs_internal fmt kf = Format.fprintf fmt "@[InOut (internal) for function %a:@\n%a@]@\n" Kernel_function.pretty kf Inout_type.pretty_operational_inputs (get_internal kf) let pretty_operational_inputs_external fmt kf = Format.fprintf fmt "@[InOut for function %a:@\n%a@]@\n" Kernel_function.pretty kf Inout_type.pretty_operational_inputs (get_external kf) let pretty_operational_inputs_external_with_formals fmt kf = Format.fprintf fmt "@[InOut (with formals) for function %a:@\n%a@]@\n" Kernel_function.pretty kf Inout_type.pretty_operational_inputs (get_external_with_formals kf) let () = Db.Operational_inputs.self_internal := Internals.self; Db.Operational_inputs.self_external := Externals.self; Db.Operational_inputs.get_internal := get_internal; Db.Operational_inputs.get_external := get_external; Db.Operational_inputs.get_internal_precise := get_internal_aux; Db.Operational_inputs.compute := compute_external; Db.Operational_inputs.display := pretty_operational_inputs_internal (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/inout/outputs.ml0000666000000000000000000001601213571573400016676 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Visitor open Locations class virtual do_it_ = object(self) inherit [Zone.t] Cumulative_analysis.cumulative_visitor as super val mutable outs = Zone.bottom method bottom = Zone.bottom method result = outs method! vstmt_aux s = match s.skind with | UnspecifiedSequence seq -> List.iter (fun (stmt,_,_,_,_) -> ignore(visitFramacStmt (self:>frama_c_visitor) stmt)) seq; Cil.SkipChildren (* do not visit the additional lvals *) | _ -> super#vstmt_aux s method join new_ = outs <- Zone.join new_ outs; (* For local initializations, counts the written variable as an output of the function, even if it is const; thus, [for_writing] is false in this case. *) method private do_assign ~for_writing lv = let state = Db.Value.get_state self#current_kinstr in let _deps, bits_loc, _exact = !Db.Value.lval_to_zone_with_deps_state state ~deps:None ~for_writing lv in self#join bits_loc method! vinst i = if Db.Value.is_reachable (Db.Value.noassert_get_state self#current_kinstr) then (* noassert needed for Eval.memoize. Not really satisfactory *) begin match i with | Set (lv,_,_) -> let for_writing = not (Cil.is_mutable_or_initialized lv) in self#do_assign ~for_writing lv | Call (lv_opt,exp,_,_) -> (match lv_opt with None -> () | Some lv -> let for_writing = not (Cil.is_mutable_or_initialized lv) in self#do_assign ~for_writing lv); let state = Db.Value.get_state self#current_kinstr in if Cvalue.Model.is_top state then self#join Zone.top else let _, callees = !Db.Value.expr_to_kernel_function_state ~deps:None state exp in Kernel_function.Hptset.iter (fun kf -> let { Inout_type.over_outputs = z } = Operational_inputs.get_external_aux ?stmt:self#current_stmt kf in self#join z ) callees | Local_init (v, AssignInit i, _) -> let rec aux lv = function | SingleInit _ -> self#do_assign ~for_writing:false lv | CompoundInit (ct, initl) -> (* Avoid folding the implicit zero-initializers of large arrays. *) if Cumulative_analysis.fold_implicit_initializer ct then let implicit = true in let doinit o i _ () = aux (Cil.addOffsetLval o lv) i in Cil.foldLeftCompound ~implicit ~doinit ~ct ~initl ~acc:() else (* For arrays of scalar elements, all the zone covered by the array is written. For arrays of structs containing padding bits, this is a sound over-approximation. *) self#do_assign ~for_writing:false lv in aux (Cil.var v) i | Local_init (v, ConsInit(f, _, _),_) -> let state = Db.Value.get_state self#current_kinstr in if Cvalue.Model.is_top state then self#join Zone.top else begin let { Inout_type.over_outputs = z } = Operational_inputs.get_external_aux ?stmt:self#current_stmt (Globals.Functions.get f) in self#do_assign ~for_writing:false (Cil.var v); (* might be redundant with z in case f takes address of v as first argument, but this shouldn't hurt. *) self#join z end | Asm _ | Skip _ | Code_annot _ -> () end; Cil.SkipChildren method clean_kf_result kf r = Zone.filter_base (Callgraph.Uses.accept_base ~with_formals:true ~with_locals:true kf) r method compute_funspec kf = let state = self#specialize_state_on_call kf in let behaviors = !Db.Value.valid_behaviors kf state in let assigns = Ast_info.merge_assigns behaviors in !Db.Value.assigns_outputs_to_zone state ~result:None assigns end module Analysis = Cumulative_analysis.Make( struct let analysis_name ="outputs" type t = Locations.Zone.t module T = Locations.Zone class virtual do_it = do_it_ end) let get_internal = Analysis.kernel_function let externalize kf x = Zone.filter_base (Callgraph.Uses.accept_base ~with_formals:false ~with_locals:false kf) x module Externals = Kernel_function.Make_Table(Locations.Zone) (struct let name = "Inout.Outputs.Externals" let dependencies = [ Analysis.Memo.self ] let size = 17 end) let get_external = Externals.memo (fun kf -> externalize kf (get_internal kf)) let pretty_internal fmt kf = try Format.fprintf fmt "@[Out (internal) for function %a:@\n@[ %a@]@]@\n" Kernel_function.pretty kf Zone.pretty (get_internal kf) with Not_found -> () let pretty_external fmt kf = try Format.fprintf fmt "@[Out (external) for function %a:@\n@[ %a@]@]@\n" Kernel_function.pretty kf Zone.pretty (get_external kf) with Not_found -> () let () = Db.Outputs.self_internal := Analysis.Memo.self; Db.Outputs.self_external := Externals.self; Db.Outputs.get_internal := get_internal; Db.Outputs.get_external := get_external; Db.Outputs.compute := (fun kf -> ignore (get_internal kf)); Db.Outputs.display := pretty_internal; Db.Outputs.display_external := pretty_external; Db.Outputs.statement := Analysis.statement (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/inout/outputs.mli0000666000000000000000000000335313571573400017053 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val pretty_external: Format.formatter -> Cil_types.kernel_function -> unit val pretty_internal: Format.formatter -> Cil_types.kernel_function -> unit frama-c-20.0-Calcium/src/plugins/inout/register.ml0000666000000000000000000000776513571573400017016 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This code duplicates more or less Option_signature.With_output. Since Inout prints the results of all its options interleaved, it is difficult to proceed otherwise *) module ShouldOutput = State_builder.True_ref (struct let dependencies = [Db.Value.self] (* To be completed if some computations use some other results than value *) let name = "Inout.Register.ShouldOuput" end) let () = Inout_parameters.Output.add_set_hook (fun _ v -> if v then ShouldOutput.set true) let main () = let forceout = Inout_parameters.ForceOut.get () in let forceexternalout = Inout_parameters.ForceExternalOut.get () in let forceinput = Inout_parameters.ForceInput.get () in let forceinout = Inout_parameters.ForceInout.get () in let forceinoutwithformals = Inout_parameters.ForceInoutExternalWithFormals.get () in let forcederef = Inout_parameters.ForceDeref.get () in let forceinputwithformals = Inout_parameters.ForceInputWithFormals.get () in if (forceout || forceexternalout || forceinput || forceinputwithformals || forcederef || forceinout || forceinoutwithformals) && Inout_parameters.Output.get () && ShouldOutput.get () then begin ShouldOutput.set false; !Db.Value.compute (); Callgraph.Uses.iter_in_rev_order (fun kf -> if Kernel_function.is_definition kf && !Db.Value.is_called kf then begin if forceout then Inout_parameters.result "%a" Outputs.pretty_internal kf ; if forceexternalout then Inout_parameters.result "%a" Outputs.pretty_external kf ; if forceinput then Inout_parameters.result "%a" Inputs.pretty_external kf; if forcederef then begin Derefs.compute_external kf; Inout_parameters.result "%a" Derefs.pretty_external kf; end; if forceinout then Inout_parameters.result "%a" Operational_inputs.pretty_operational_inputs_internal kf; if forceinoutwithformals then Inout_parameters.result "%a" Operational_inputs.pretty_operational_inputs_external_with_formals kf; if forceinputwithformals then Inout_parameters.result "%a" Inputs.pretty_with_formals kf ; end) end let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/loop_analysis/0000777000000000000000000000000013571573400016337 5ustar frama-c-20.0-Calcium/src/plugins/loop_analysis/LoopAnalysis.mli0000666000000000000000000000357513571573400021471 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Loop Analysis plugin. *) open Cil_types (** [Loop] exports functions related to the estimation of loop iteration bounds. *) module Loop_analysis : sig val analyze: Kernel_function.t -> unit val get_bounds: stmt -> int option val fold_bounds: (stmt -> int -> 'a -> 'a) -> 'a -> 'a end frama-c-20.0-Calcium/src/plugins/loop_analysis/Makefile.in0000666000000000000000000000473513571573400020415 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif PLUGIN_ENABLE:=@ENABLE_LOOP_ANALYSIS@ PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_NAME:= LoopAnalysis PLUGIN_CMO:= options region_analysis_sig region_analysis region_analysis_stmt loop_analysis slevel_analysis register PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure test.c test.oracle README.org PLUGIN_TESTS_DIRS:=loop_analysis include $(FRAMAC_SHARE)/Makefile.dynamic ##################################### # Regenerating the Makefile on need # ##################################### ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif $(LoopAnalysis_DIR)/Makefile: $(LoopAnalysis_DIR)/Makefile.in \ $(CONFIG_STATUS_DIR)/config.status cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ frama-c-20.0-Calcium/src/plugins/loop_analysis/README.org0000666000000000000000000000461313571573400020011 0ustar Loop and "slevel" analysis. Note: this plug-in has been deprecated in favor of newer Eva features, such as `-eva-auto-loop-unroll`, `//@ loop unroll` annotations and trace partitioning. It will be removed in a future release. * Overview This plugin performs two analyses. - Loop analysis :: Tries to compute an upper bound on the number of iterations in a loop. - Slevel analysis :: Based on loop analysis, tries to compute a sensible per-function "slevel" in Value. The analysis proceeds in two steps: first the loop analysis is done, then using its results, the slevel analysis is performed. * Installation The installation follows the standard installation of Frama-C plugins. By default, it is compiled and installed with Frama-C itself. Otherwise, a manual installation can be performed by typing: : make And then, with the sufficient privileges (e.g. as root or using =sudo=): : make install * Usage The analysis of the two parts is triggered using the =-loop= option, for instance: : frama-c -loop test.c The final pass of the analysis, the =slevel= path, outputs: : Add this to your command line: : -val-slevel-merge-after-loop main \ : -val-slevel-merge-after-loop g \ : -val-slevel-merge-after-loop h3 \ : -val-slevel-merge-after-loop h4 \ : -val-slevel-merge-after-loop h5 \ : -val-slevel-merge-after-loop h6 \ : -slevel-function main:40 \ : -slevel-function k:2 \ : -slevel-function f:8 \ : -slevel-function g:0 \ : -slevel-function h:9 \ : -slevel-function h2:9 \ : -slevel-function h3:80 \ : -slevel-function h4:40 \ : -slevel-function h5:40 \ : -slevel-function h6:0 These options are ready to be copy-and-pasted into a shell script or a Makefile. The =-slevel-function=, when found, gives a value that can be used to unroll loops and avoid merging paths; in addition it can detect when Value should merge analysis paths with the option =-val-slevel-merge-after-loop=. A value of 0 means that no reasonable bound has been found, and therefore it might be better to avoid spending time in that function. Note that this is just an initial recommendation, to be later refined by the user. The loop analysis path is silent, but its results can be read programmatically in the =Loop_Max_Iteration= table for use by other plugins. frama-c-20.0-Calcium/src/plugins/loop_analysis/configure0000777000000000000000000027223313571573400020257 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS ENABLE_LOOP_ANALYSIS ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_loop_analysis ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-loop_analysis support for loop analysis plug-in (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-loop_analysis was given. if test "${enable_loop_analysis+set}" = set; then : enableval=$enable_loop_analysis; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "loop_analysis is not available" "$LINENO" 5 fi FORCE_LOOP_ANALYSIS=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_LOOP_ANALYSIS ENABLE_LOOP_ANALYSIS=$ENABLE NAME_LOOP_ANALYSIS=loop_analysis if test "$default" = "no" -a "$FORCE" = "no"; then INFO_LOOP_ANALYSIS=" (not available by default)" fi echo "loop_analysis... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi frama-c-20.0-Calcium/src/plugins/loop_analysis/configure.ac0000666000000000000000000000437413571573400020635 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ############################################## # LoopAnalysis as a standard Frama-C plug-in # ############################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)]) check_plugin(loop_analysis,PLUGIN_RELATIVE_PATH(plugin_file), [support for loop analysis plug-in],yes) ####################### # Generating Makefile # ####################### write_plugin_config(Makefile) frama-c-20.0-Calcium/src/plugins/loop_analysis/loop_analysis.ml0000666000000000000000000006073713571573400021562 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let dkey = Options.register_category "value" module Loop_Max_Iteration = Cil_state_builder.Stmt_hashtbl (Datatype.Int) (struct let size = 97 let name = "Loop_Max_Iteration" let dependencies = [Ast.self] end) let add_loop_bound stmt n = Options.debug "Adding loop bound of %d to %a" n Cil_datatype.Stmt.pretty stmt; try let u = Loop_Max_Iteration.find stmt in Loop_Max_Iteration.replace stmt (max u n) with Not_found -> Loop_Max_Iteration.replace stmt n module type BINARY_SEMILATTICE = sig include Dataflows.JOIN_SEMILATTICE end let pretty_int = Integer.pretty ~hexa:false module Binary(* :BINARY_SEMILATTICE *) = struct (* Affine expression whose coefficients are the loop counters. The last element is a simple integer with no coefficient. *) open Cil_types type binary = | ConstantInt of Integer.t | ConstantVar of varinfo (* The contents of a variable at the beginning of the loop and a fixed offset. *) | AffineRef of varinfo * Integer.t | Boolean of conds | Unknown and cond = | UnknownCond | Lt of bool * binary * binary (* bool if signed. *) | Le of bool * binary * binary (* bool if signed. *) | Eq of binary * binary | Ne of binary * binary (* Conjunction of conditions; empty means true. *) and conds = cond list let rec binary_compare a b = match (a,b) with | ConstantInt i1, ConstantInt i2 -> Integer.compare i1 i2 | ConstantVar v1, ConstantVar v2 -> Cil_datatype.Varinfo.compare v1 v2 | AffineRef (v1,i1), AffineRef(v2,i2) -> let res = Cil_datatype.Varinfo.compare v1 v2 in if res == 0 then Integer.compare i1 i2 else res | Boolean _c1, Boolean _c2 -> assert false | Unknown, Unknown -> 0 | Unknown, _ -> 1 | _, Unknown -> -1 | Boolean _, _ -> 1 | _, Boolean _ -> -1 | AffineRef _, _ -> 1 | _, AffineRef _ -> -1 | ConstantVar _, _ -> 1 | _, ConstantVar _ -> -1 (* | ConstantInt _, _ -> 1 | _, ConstantInt _ -> -1 *) and cond_compare a b = let comp_bin_pair b1 b2 b3 b4 = let res1 = binary_compare b1 b3 in if res1 == 0 then binary_compare b2 b4 else res1 in match (a,b) with | UnknownCond, UnknownCond -> 0 | Lt(_,b1,b2), Lt(_,b3,b4) -> comp_bin_pair b1 b2 b3 b4 | Le(_,b1,b2), Le(_,b3,b4) -> comp_bin_pair b1 b2 b3 b4 | Ne(b1,b2), Ne(b3,b4) -> comp_bin_pair b1 b2 b3 b4 | Eq(b1,b2), Eq(b3,b4) -> comp_bin_pair b1 b2 b3 b4 | UnknownCond, _ -> 1 | _, UnknownCond -> -1 | Lt _, _ -> 1 | _, Lt _ -> -1 | Le _, _ -> 1 | _, Le _ -> -1 | Ne _, _ -> 1 | _, Ne _ -> -1 (* | Eq _, _ -> 1 | _, Eq _ -> -1*) module CondSet = Set.Make(struct type t = cond let compare = cond_compare end) type t = binary let add b1 b2 = match b1, b2 with | Unknown, _ | _, Unknown -> Unknown | ConstantInt(i1), ConstantInt(i2) -> ConstantInt(Integer.add i1 i2) | ConstantInt(i1), AffineRef(v,i2) | AffineRef(v,i2), ConstantInt(i1) -> AffineRef(v,Integer.add i1 i2) | _ -> Unknown let neg = function | Unknown -> Unknown | ConstantInt(i) -> ConstantInt(Integer.neg i) | _ -> Unknown let pretty fmt = function | ConstantInt(i) -> Format.fprintf fmt "%a" pretty_int i | AffineRef(v,i) -> Format.fprintf fmt "ref<%a>+%a" Cil_datatype.Varinfo.pretty v pretty_int i | Unknown -> Format.fprintf fmt "unknown" | ConstantVar(v) -> Format.fprintf fmt "%a" Cil_datatype.Varinfo.pretty v | Boolean _ -> Format.fprintf fmt "bools" let pretty_cond fmt = function | UnknownCond -> Format.fprintf fmt "" | Lt(_,b1,b2) -> Format.fprintf fmt "%a < %a" pretty b1 pretty b2 | Le(_,b1,b2) -> Format.fprintf fmt "%a <= %a" pretty b1 pretty b2 | Eq(b1,b2) -> Format.fprintf fmt "%a == %a" pretty b1 pretty b2 | Ne(b1,b2) -> Format.fprintf fmt "%a != %a" pretty b1 pretty b2 ;; let pretty_conds fmt conds = List.iter (pretty_cond fmt) conds let rec transfer_lval lval _load = match lval with | (Var vi, NoOffset) -> ConstantVar vi | _ -> Unknown and transfer_exp exp load = match exp.enode with | Const(CInt64(i,_,_)) -> ConstantInt i | AddrOf lval -> transfer_lval lval load | Lval lval -> (match load lval with | None -> Unknown | Some(v) -> v) | BinOp(PlusA,e1,e2,_) -> add (transfer_exp e1 load) (transfer_exp e2 load) | BinOp(MinusA,e1,e2,_) -> add (transfer_exp e1 load) (neg (transfer_exp e2 load)) | CastE(_,e) -> transfer_exp e load (* | BinOp((PlusPI|IndexPI|MinusA),_,_,_) -> assert false *) (* | BinOp(_,_,_,_) -> Unknown *) | _ -> (match Cil.constFoldToInt ~machdep:true exp with | None -> Unknown | Some(i) -> ConstantInt i) ;; let transfer_exp exp load = let res = transfer_exp exp load in Options.debug "transfer exp %a: %a" Cil_datatype.Exp.pretty exp pretty res; res ;; let not_cond = function | UnknownCond -> UnknownCond | Lt(signed,b1,b2) -> Lt(signed,b2,b1) | Le(signed,b1,b2) -> Le(signed,b2,b1) | Eq(b1,b2) -> Ne(b1,b2) | Ne(b1,b2) -> Eq(b1,b2) let transfer_cond exp load = match exp.enode with | Cil_types.BinOp(binop,e1,e2,_) -> let b1 = transfer_exp e1 load in let b2 = transfer_exp e2 load in (match binop with | Cil_types.Lt -> Lt(true,b1,b2) | Cil_types.Le -> Le(true,b1,b2) | Cil_types.Gt -> Lt(true,b2,b1) | Cil_types.Ge -> Le(true,b2,b1) | Cil_types.Eq -> Eq(b2,b1) | Cil_types.Ne -> Ne(b2,b1) | _ -> UnknownCond ) | _ -> UnknownCond ;; let transfer_cond exp load = let res = transfer_cond exp load in Options.debug "transfer cond: %a" pretty_cond res; res ;; let join_conds conds1 conds2 = let cond_set1 = List.fold_right CondSet.add conds1 CondSet.empty in let cond_set2 = List.fold_right CondSet.add conds2 CondSet.empty in let inter = CondSet.inter cond_set2 cond_set1 in let conds = UnknownCond::(CondSet.elements inter) in conds ;; let join a b = match (a,b) with | ConstantInt(ia), ConstantInt(ib) when Integer.equal ia ib -> a | ConstantVar(va), ConstantVar(vb) when Cil_datatype.Varinfo.equal va vb -> a | AffineRef(va,ia), AffineRef(vb,ib) when Cil_datatype.Varinfo.equal va vb && Integer.equal ia ib -> a | Boolean(condsa), Boolean(condsb) -> Boolean(join_conds condsa condsb) | Unknown, Unknown -> Unknown | _,_ -> Unknown end module Store(* (B:sig *) (* type t *) (* open Cil_types *) (* val bottom: t *) (* val pretty: Format.formatter -> t -> unit *) (* val transfer_exp : exp -> (lval -> t option) -> t *) (* val transfer_lval : lval -> (lval -> t option) -> t *) (* (\* include BINARY_SEMILATTICE *\) *) (* (\* type address = Cil_types.varinfo *\) *) (* (\* val get_address: t -> address *\) *) (* end *) (* ) *) = struct module B = Binary (* Note: We could do an unsound, heuristical analysis by using a map from lvalues instead, and completely ignoring aliasing. *) (* A map of local variables whose address is never taken. *) module Varinfo = Cil_datatype.Varinfo;; (* The map, and the condition that leads to this point, and the destination of edges. *) type t = (B.t Varinfo.Map.t * B.conds * Cil_types.stmt) let pretty fmt (m,conds) = Format.fprintf fmt "[@[mem={ @["; Varinfo.Map.iter (fun k v -> Format.fprintf fmt "%a -> %a@ " Varinfo.pretty k B.pretty v) m; Format.fprintf fmt "@]}@ conds=@ (%a)@]]" B.pretty_conds conds ;; let bottom = (Varinfo.Map.empty,[],Cil.dummyStmt) let init stmt = (Varinfo.Map.empty,[],stmt) let load map = let open Cil_types in function | (Var(vi),NoOffset) when not vi.vaddrof -> Some( try Varinfo.Map.find vi map with Not_found -> B.AffineRef(vi,Integer.zero)) | _ -> None let join2_stmts stmt1 stmt2 = (* Cil.dummyStmt is bottom for statements. *) if Cil_datatype.Stmt.equal stmt1 stmt2 then stmt1 else if Cil_datatype.Stmt.equal stmt1 Cil.dummyStmt then stmt2 else if Cil_datatype.Stmt.equal stmt2 Cil.dummyStmt then stmt1 else assert false ;; let pretty_increment fmt increment = if Integer.(equal increment one) then Format.fprintf fmt "++" else if Integer.(equal increment minus_one) then Format.fprintf fmt "--" else if Integer.(gt increment zero) then Format.fprintf fmt " += %a" (Integer.pretty ~hexa:false) increment else if Integer.(lt increment zero) then Format.fprintf fmt " -= %a" (Integer.pretty ~hexa:false) (Integer.neg increment) else assert false (* should never happen *) let do_instr instr (value,conds) = let open Cil_types in match instr with | Set((Var(vi),NoOffset),exp,_) when not vi.vaddrof -> (Varinfo.Map.add vi (B.transfer_exp exp (load value)) value, conds) | Set _ -> (value,conds) (* | Set((Var(vi),NoOffset),exp,_) -> assert false *) | Local_init (vi, AssignInit (SingleInit e), _) -> (Varinfo.Map.add vi (B.transfer_exp e (load value)) value, conds) | Local_init (_, AssignInit (CompoundInit _), _) -> (value,conds) | Local_init (_,ConsInit _,_) -> (value,conds) | Call _ -> (value,conds) | Asm _ -> (value,conds) | Code_annot _ -> (value,conds) | Skip _ -> (value,conds) let do_instr instr value = let output = do_instr instr value in Options.debug "Input %a output %a" pretty value pretty output; output ;; let do_guard _stmt exp (mem,conds) = let cond = B.transfer_cond exp (load mem) in let not_cond = B.not_cond cond in ((mem,cond::conds), (mem,not_cond::conds));; let compile_node stmt (mem,conds,stmt2) = let stmt = join2_stmts stmt stmt2 in let value = (mem,conds) in let open Cil_types in let map_on_all_succs (mem,conds) = List.map (fun x -> (Region_analysis.Edge(stmt,x),(mem,conds,x))) stmt.succs in match stmt.skind with | Instr(i) -> map_on_all_succs (do_instr i (mem,conds)) | Return _ -> [Region_analysis.Exit stmt, (mem,conds,Cil.dummyStmt)] | Loop _ | Goto _ | Break _ | Continue _ | Block _ | UnspecifiedSequence _ -> map_on_all_succs value | If _ -> let result = Dataflows.transfer_if_from_guard do_guard stmt value in List.map (fun (succ,(mem,cond)) -> (Region_analysis.Edge(stmt,succ),(mem,cond,succ))) result | Switch _ -> let result = Dataflows.transfer_switch_from_guard do_guard stmt value in List.map (fun (succ,(mem,cond)) -> (Region_analysis.Edge(stmt,succ),(mem,cond,succ))) result | Throw _ | TryCatch _ | TryExcept _ | TryFinally _ -> Options.abort "unsupported exception-related statement: %a" Printer.pp_stmt stmt let value_min_max stmt vi = if (Db.Value.is_computed ()) then begin Options.feedback ~dkey ~once:true "value analysis computed, trying results"; if Db.Value.is_reachable_stmt stmt then let state = Db.Value.get_stmt_state stmt in try let loc = Locations.loc_of_varinfo vi in let v = Db.Value.find state loc in let ival = Cvalue.V.project_ival v in let omin, omax = Ival.min_and_max ival in omin, omax with | Not_found -> Options.feedback ~dkey "value_min_max: not found: %a@.\ function: %a, stmt: %a" Printer.pp_varinfo vi Kernel_function.pretty (Kernel_function.find_englobing_kf stmt) Printer.pp_stmt stmt; None, None | Cvalue.V.Not_based_on_null -> Options.feedback ~dkey "value_min_max: not based on null: %a@.\ function: %a, stmt: %a" Printer.pp_varinfo vi Kernel_function.pretty (Kernel_function.find_englobing_kf stmt) Printer.pp_stmt stmt; None, None else begin Options.feedback ~dkey "skipping unreachable stmt (function: %a)" Kernel_function.pretty (Kernel_function.find_englobing_kf stmt); None, None end end else begin Options.feedback ~dkey ~once:true "value analysis NOT computed, loop analysis will not use it"; None, None end let mu (f:(t -> t)) (value,conds,stmt) = Cil.CurrentLoc.set (Cil_datatype.Stmt.loc stmt); let (result,final_conds,_) = f (init stmt) in (* Induction variables is a map from each Varinfo to its increment. *) let induction_variables = Varinfo.Map.fold (fun key bin acc -> match bin with | B.AffineRef(vi,offset) when not (Integer.is_zero offset) && Varinfo.equal vi key -> Varinfo.Map.add key offset acc | _ -> acc) result Varinfo.Map.empty in (* The result after the loop: replace everything that changed by unknown (i.e. keep variables that did not change). TODO: When we know the number of iterations, replace by the exact value. *) let new_ = Varinfo.Map.fold (fun key bin acc -> match bin with | B.AffineRef(vi,offset) when Integer.is_zero offset && Varinfo.equal vi key -> acc | _ -> Varinfo.Map.add key B.Unknown acc ) result value in let success = ref false in (* Now fill Loop_Max_Iteration for the kernel function. *) (* smaller = true => the test is "vi < bound"; smaller = false => the test is "vi > bound". *) let maybe_insert vi smaller bound offset binop = try let initial = match Varinfo.Map.find vi value with | B.ConstantInt i -> i | B.AffineRef(vi,offset) -> begin match value_min_max stmt vi with | Some imin, _ when smaller -> Integer.add imin offset | _, Some imax when not smaller -> Integer.add imax offset | _, _ -> raise Not_found end | _ -> raise Not_found (* TODO: handle comparison between pointers *) in let increment = Varinfo.Map.find vi induction_variables in Options.debug "maybe_insert: function %a, found var %a, smaller: %b, \ initial %a, increment %a, bound %a, offset %a, binop '%a'" Kernel_function.pretty (Kernel_function.find_englobing_kf stmt) Printer.pp_varinfo vi smaller pretty_int initial pretty_int increment pretty_int bound pretty_int offset Printer.pp_binop binop; let bound = Integer.sub bound initial in let bound_offset = if smaller then Integer.sub bound offset else Integer.add bound offset in (* remainder is used for two purposes: 1. in the case of '!=' loops, to warn if the termination condition may be missed; 2. in '<=' and '>=' loops, to adjust for the last iteration *) let divident = Integer.sub bound offset in let remainder = Integer.e_rem divident increment in (* check if induction variable may miss termination condition *) if binop = Cil_types.Ne && not Integer.(equal remainder zero) then Options.warning ~current:true "termination condition may not be reached (infinite loop?)@;\ loop amounts to: for (%a = 0; %a != %a; %a%a)" Printer.pp_varinfo vi Printer.pp_varinfo vi pretty_int divident Printer.pp_varinfo vi pretty_increment increment else try let value = (Integer.to_int (Integer.c_div bound_offset increment)) in let adjusted_value = if (binop = Cil_types.Le && Integer.(equal remainder zero)) || (not Integer.(equal remainder zero)) then value + 1 else value in if adjusted_value >= 0 then begin success := true; add_loop_bound stmt adjusted_value end with Z.Overflow -> (* overflow in Integer.to_int *) () (* TODO: check if this is useful and does not cause false alarms else if Kernel.UnsignedOverflow.get() then Options.warning ~current:true "possibly infinite loop, or loop which relies on unsigned overflow" *) with Not_found -> () in List.iter (function | B.Lt(_,B.AffineRef(vi,offset),B.ConstantInt bound) -> maybe_insert vi true bound offset Cil_types.Lt | B.Le(_,B.AffineRef(vi,offset),B.ConstantInt bound) -> maybe_insert vi true bound offset Cil_types.Le | B.Lt(_,B.ConstantInt bound,B.AffineRef(vi,offset)) -> maybe_insert vi false bound offset Cil_types.Lt | B.Le(_,B.ConstantInt bound,B.AffineRef(vi,offset)) -> maybe_insert vi false bound offset Cil_types.Le | B.Ne(B.ConstantInt bound,B.AffineRef(vi, offset)) | B.Ne(B.AffineRef(vi, offset),B.ConstantInt bound) -> begin try let increment = Varinfo.Map.find vi induction_variables in assert (not (Integer.equal increment Integer.zero)); if Integer.gt increment Integer.zero then maybe_insert vi true bound offset Cil_types.Ne else maybe_insert vi false bound offset Cil_types.Ne with Not_found -> () end | c -> if (Db.Value.is_computed ()) then begin let min_max_int = value_min_max stmt in match c with | B.Lt(_,B.AffineRef(vi,offset),B.AffineRef(vi', offset')) -> begin match min_max_int vi, min_max_int vi' with | (Some min_bound, _), (_, Some max_bound') -> let b1 = Integer.add min_bound offset in maybe_insert vi' false b1 offset' Cil_types.Lt; let b2 = Integer.add max_bound' offset' in maybe_insert vi true b2 offset Cil_types.Lt | _, _ -> () end | B.Le(_,B.AffineRef(vi,offset),B.AffineRef(vi', offset')) -> begin match min_max_int vi, min_max_int vi' with | (Some min_bound, _), (_, Some max_bound') -> let b1 = Integer.add min_bound offset in maybe_insert vi' false b1 offset' Cil_types.Le; let b2 = Integer.add max_bound' offset' in maybe_insert vi true b2 offset Cil_types.Le | a, b -> Options.debug "failed to get min/max bounds?@.\ - get_min_max_int_for_vi(%a)=%a@.\ - get_min_max_int_for_vi(%a)=%a" Printer.pp_varinfo vi (Pretty_utils.pp_pair (Pretty_utils.pp_opt pretty_int) (Pretty_utils.pp_opt pretty_int)) a Printer.pp_varinfo vi' (Pretty_utils.pp_pair (Pretty_utils.pp_opt pretty_int) (Pretty_utils.pp_opt pretty_int)) b end | B.Ne(B.AffineRef(vi, offset),B.AffineRef(vi', offset')) -> begin try let increment = Varinfo.Map.find vi induction_variables in assert (not (Integer.equal increment Integer.zero)); if Integer.gt increment Integer.zero then match min_max_int vi' with | (_, Some max_bound') -> let b = Integer.add max_bound' offset' in maybe_insert vi true b offset Cil_types.Lt | _ -> () else match min_max_int vi' with | (Some min_bound', _) -> let b = Integer.add min_bound' offset in maybe_insert vi false b offset' Cil_types.Lt | _ -> () with Not_found -> (* try other variable as increment *) try let increment = Varinfo.Map.find vi' induction_variables in assert (not (Integer.equal increment Integer.zero)); if Integer.gt increment Integer.zero then match min_max_int vi with | (_, Some max_bound) -> let b = Integer.add max_bound offset in maybe_insert vi' true b offset' Cil_types.Lt; | _ -> () else match min_max_int vi with | (Some min_bound, _) -> let b = Integer.add min_bound offset' in maybe_insert vi' false b offset Cil_types.Lt | _ -> () with Not_found -> () end | _ -> Options.debug "cannot use value, pattern not matched, c: %a@." B.pretty_cond c end else () (* no value => cannot infer anything *) ) final_conds; (* TODO: Use this table in a second pass, for the slevel analysis. *) if not !success then Options.debug "no success %a init %a body %a result %a" Cil_datatype.Stmt.pretty stmt pretty (value,conds) pretty (result,final_conds) pretty (new_,conds) else Options.debug "success %a init %a body %a result %a" Cil_datatype.Stmt.pretty stmt pretty (value,conds) pretty (result,final_conds) pretty (new_,conds); (new_,conds,stmt) ;; let join2_mem m1 m2 = Varinfo.Map.merge (fun vi b1 b2 -> match (b1,b2) with | Some b1, Some b2 -> Some(B.join b1 b2) | Some b, None | None, Some b -> Some(B.join (B.AffineRef(vi,Integer.zero)) b) | None,None -> assert false) m1 m2 ;; let join2 (mem1,conds1,stmt1) (mem2,conds2,stmt2) = let stmt = join2_stmts stmt1 stmt2 in let conds = B.join_conds conds1 conds2 in let mem = join2_mem mem1 mem2 in (* TODO: If a condition is in both lists, retrieve it. To that end: use a set of conditions? And we do not need unknown; we have a safe approximation of the sufficient conditions to exit the loop. *) (mem,conds,stmt) ;; let join = function | [] -> bottom | [x] -> x | a::b -> List.fold_left join2 a b type abstract_value = t end module Generic = struct include Store end;; let analyze kf = Options.debug "loop analysis of function %a" Kernel_function.pretty kf; let module Specific = struct let kf = kf include Generic end in let module Node = Region_analysis_stmt.MakeNode(Specific) in let module Result = Region_analysis.Make(Node) in let after = Result.after in let _dict = after (Generic.init (Kernel_function.find_first_stmt kf)) in () ;; let get_bounds stmt = try Some (Loop_Max_Iteration.find stmt) with Not_found -> None let fold_bounds f acc = Loop_Max_Iteration.fold_sorted ~cmp:Cil_datatype.Stmt.compare f acc frama-c-20.0-Calcium/src/plugins/loop_analysis/loop_analysis.mli0000666000000000000000000000356513571573400021727 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Loop_Max_Iteration: State_builder.Hashtbl with type key = stmt and type data = int val analyze: Kernel_function.t -> unit val get_bounds: stmt -> int option val fold_bounds: (stmt -> int -> 'a -> 'a) -> 'a -> 'a frama-c-20.0-Calcium/src/plugins/loop_analysis/options.ml0000666000000000000000000000550113571573400020365 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "loop" let shortname = "loop" let help = "[DEPRECATED: use Eva's loop unroll annotations and options] \ Find number of iterations in loops, and slevel value" end) module Run = False (struct let option_name = "-loop" let help = "[deprecated: use Eva loop unroll annotations or \ -eva-auto-loop-unroll] Launch loop analysis" end) module MaxIterations = Int (struct let option_name = "-loop-max-iterations" let arg_name = "num" let default = 1000 let help = "If slevel is found to be higher than this number in a loop" ^ "force the use of merge-after-loop (default: 1000)" end) module MaxSlevel = Int (struct let option_name = "-loop-max-slevel" let arg_name = "num" let default = 10000 let help = "If slevel is found to be higher than this number," ^ "set slevel to 0 instead (default: 10000)" end) module NoBranches = False (struct let option_name = "-loop-no-branches" let help = "Modify the algorithm use to estimate the slevel: ignore \ branching due to ifs and always merge after loops" end) frama-c-20.0-Calcium/src/plugins/loop_analysis/options.mli0000666000000000000000000000336413571573400020543 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module Run:Parameter_sig.Bool module MaxIterations:Parameter_sig.Int module MaxSlevel:Parameter_sig.Int module NoBranches:Parameter_sig.Bool frama-c-20.0-Calcium/src/plugins/loop_analysis/region_analysis.ml0000666000000000000000000002350013571573400022057 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This algorithm is similar to the region-based analysis of the dragon book ("Compilers: Principles, Techniques, and Tools (2nd Edition)", by Aho, Lam, Sethi and Ullman). But there are some important differences: - We never build regions; the nesting of natural loops suffice. - We do not compose transfer functions. Instead, we rely on the fact that Ocaml has first-class functions, and associate to "loop edges" functions describing the behaviour of loops. The composition of region of the Dragon Book does not fit well the translation to terms, for which composition of transfer function would mean creation of closures or a costly substitution; this algorithm avoids function composition. The algorithm could be extended to handle non-natural loops. Instead of using the notion of back edges, we could use that of retreating edge, starting from a spanning tree of the graph. It should be possible to compile strongly connected components with multiple entry point several times, introducing the variable at different entry points, or inlining part of the loop to "reuse" another entry point when feasible. Computation of nested scc can be obtained using "Earnest, Balke and Anderson: Analysis of Graphs by Ordering of Nodes". It is maybe also possible to use the wto ordering of bourdoncle for this purpose. *) include Region_analysis_sig;; module Make(N:Node):sig (* Function computing from an entry abstract value the "after" state, which is a map from each outgoing edge to its respective value. *) val after: N.abstract_value -> N.abstract_value N.Edge_Dict.t end = struct let graph_size = N.Set.cardinal N.Graph.all_nodes let iter_nodes f = N.Set.iter f N.Graph.all_nodes (****************************************************************) (* Back edges. *) (* Return a dict from head nodes to the set of origins of back edges. *) let back_edges:N.Set.t N.Dict.t = let back_edges = N.Dict.create graph_size N.Set.empty in iter_nodes (fun n -> N.Graph.iter_succs n (fun head -> if N.DomTree.dominates head n then N.Dict.set back_edges head (N.Set.add n (N.Dict.get back_edges head)))); back_edges ;; let is_back_edge from to_ = N.Set.mem from (N.Dict.get back_edges to_) ;; (****************************************************************) (* Natural loops. *) type natural_loop = N.Set.t;; (* For each header node, the list of the nested natural_loops with that header, from outermost to innermost. *) let natural_loops: (natural_loop list) N.Dict.t = (* Perform a DFS using the "preds" relation, and returns the set of visited nodes (we use the set to "mark" visits). We first mark the head so as not to go beyond it. *) let natural_loop_for head origin = let visited = ref N.Set.empty in visited := N.Set.add head !visited; let rec loop n = visited := N.Set.add n !visited; N.Graph.iter_preds n (fun k -> if N.Set.mem k !visited then () else loop k); in loop origin; !visited in let natural_loops = N.Dict.create graph_size [] in (* Attach natural loops to their headers, they can be nested; if they are not, merge them. *) let add_natural_loop header nl = let nls = N.Dict.get natural_loops header in let rec loop = function | [] -> [nl] | (a::b) as nls -> if N.Set.subset a nl then nl::nls else if N.Set.subset nl a then a::(loop b) (* Neither is a subset of the other: we merge the loops. *) else (N.Set.union a nl)::b in N.Dict.set natural_loops header (loop nls) in N.Dict.iter back_edges (fun header origins -> N.Set.iter (fun origin -> let natural_loop = natural_loop_for header origin in add_natural_loop header natural_loop) origins); natural_loops ;; (* Let us consider the tree of inclusion of natural loops (i.e. each node in the tree is a natural loop, and children of that tree are the natural loops that it contains). This function performs a postfix iteration on that tree (i.e. with outermost natural loops lasts). Note that the children of the tree are disjoint (i.e. have an empty intersection). *) let natural_loops_postfix_iter f = N.DomTree.domtree_postfix_iter (fun header -> let nls = N.Dict.get natural_loops header in List.iter (fun nl -> f header nl) (List.rev nls)) ;; (****************************************************************) (* Transfer functions of regions. A region is a set of nodes with a _header_ that dominates the other nodes. *) (* For each header node, the transfer function summarizing the natural loop starting at this header node (if any). Note that there may be several loops starting at a header node; if so selects the outermost that has been analyzed so far. Also note that loop_transfer_functions contain closures that use what is contained in [loop_transfer_functions], which causes a recursion avoiding by giving to the closures _copies_ of [loop_transfer_functions]. *) let loop_transfer_functions: (N.abstract_value -> N.abstract_value) option N.Dict.t = N.Dict.create graph_size None;; (* Given an entire region, returns a function computing the "after" state given an abstract value input of the header node. *) let compile_region_after loop_transfer_functions header tset = fun input_term -> let edge_term = N.Edge_Dict.create () in (* The idea is to iterate on each node in topological order, so that we always find the data on input edges. To avoid a topological sort, we allow do_node to call itself on a previous node when the result is not ready, and rely on the fact that edge_term memoizes the results to ensure that do_node is eventually called only once per node. *) let rec do_node n = let input = if n == header then input_term else let inputs = ref [] in N.Graph.iter_preds n (fun pred -> if (N.Set.mem n tset) && (not (is_back_edge pred n)) then let input = get_edge pred n in inputs := input::!inputs ); N.join !inputs in let input = match N.Dict.get loop_transfer_functions n with | None -> input | Some f -> N.mu f input in let outputs = N.compile_node n input in List.iter (fun (edge,output) -> N.Edge_Dict.set edge_term edge output) outputs (* Compute for previous node if result not yet available. *) and get_edge pred n = let edge = Edge(pred, n) in try N.Edge_Dict.get edge_term edge with Not_found -> do_node pred; N.Edge_Dict.get edge_term edge in (* We can now iterate on any order. *) N.Set.iter do_node tset; edge_term ;; (* Given a region that is a natural loop, compute the transfer function for the body of the loop. *) let compile_loop_transfer_function loop_transfer_functions header tset = fun input_term -> let edge_term = compile_region_after loop_transfer_functions header tset input_term in (* Collect the abstract values on the back edges. *) let body_exit_term = let inputs = ref [] in N.Graph.iter_preds header (fun pred -> if (N.Set.mem pred tset) && (is_back_edge pred header) then let edge = Edge(pred,header) in let input = N.Edge_Dict.get edge_term edge in inputs := input::!inputs ); N.join !inputs in body_exit_term ;; (* Compute the final [loop_transfer_functions]. *) natural_loops_postfix_iter (fun header tset -> (* Copy [loop_transfer_functions] for the closure, so that it is not affected by further modifications. *) let copy_ltf = N.Dict.copy loop_transfer_functions in let f = compile_loop_transfer_function copy_ltf header tset in N.Dict.set loop_transfer_functions header (Some f)) ;; let after input = compile_region_after loop_transfer_functions N.Graph.entry_node N.Graph.all_nodes input ;; end frama-c-20.0-Calcium/src/plugins/loop_analysis/region_analysis.mli0000666000000000000000000000460213571573400022232 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* An algorithm for region analysis, similar to the one in the dragon book ("Compilers: Principles, Techniques, and Tools (2nd Edition)", by Aho, Lam, Sethi and Ullman). The main difference compared to dataflow analysis is the handling of loops: the "mu" construction for handling loops allows to perform different computations, especially they can perform actions when first entering the loop or after the fixpoint has been reached. TODO: The algorithm does not handle non-natural loops for now. *) include module type of Region_analysis_sig;; module Make(N:Node):sig (* Function computing from an entry abstract value the "after" state, which is a map from each outgoing edge to its respective value. *) val after: N.abstract_value -> N.abstract_value N.Edge_Dict.t end frama-c-20.0-Calcium/src/plugins/loop_analysis/region_analysis_sig.ml0000666000000000000000000000772613571573400022735 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Input signature for Region_analysis. *) (* type 'node entry_edge = (would be useful if we also want the "before" state) | Entry of 'node (Function entry) | Back_edge of 'node (Back edge to a loop) | Norm_Edge of 'node * 'node *) (* Edges exiting from a node. *) type 'node edge = | Edge of 'node * 'node (* Normal edge. *) | Exit of 'node (* Function Exit. *) module type Node = sig type node val pretty: Format.formatter -> node -> unit (* An imperative dictionary with nodes as keys, and a default value. *) module Dict: sig type 'a t (* Create an initial array of size n, with a default value. *) val create: int -> 'a -> 'a t val get: 'a t -> node -> 'a val set: 'a t -> node -> 'a -> unit val iter: 'a t -> (node -> 'a -> unit) -> unit val copy: 'a t -> 'a t (* Shallow copy *) end module Set:FCSet.S with type elt = node (* The graph of nodes. *) module Graph:sig val iter_succs: node -> (node -> unit) -> unit val iter_preds: node -> (node -> unit) -> unit (* Entry, exits, and nodes of the whole graph. *) val all_nodes: Set.t val entry_node: node val exit_nodes: node list end module DomTree:sig val dominates: node -> node -> bool (* Postfix iteration on the dominator tree. *) val domtree_postfix_iter: (node -> unit) -> unit end (* An imperative dictionary of edges. No default value: calling get on an edge that was never set is forbidden. *) module Edge_Dict:sig type 'a t val set: 'a t -> node edge -> 'a -> unit val get: 'a t -> node edge -> 'a val create: unit -> 'a t val iter: 'a t -> (node edge -> 'a -> unit) -> unit end (* For now. Can be something else. TODO: Use it to perform loop analysis. *) type abstract_value (* Compile a node into a function that, given an input abstract value, return the output abstract value for each outgoing edge of the node. *) val compile_node: node -> abstract_value -> (node edge * abstract_value) list (* Merge the abstract values coming into a node from different edges. *) val join: abstract_value list -> abstract_value (* Given a function providing the effect of a loop, and the initial value at the end of the loop, return an abstract value describing any iteration of a loop. *) val mu: (abstract_value -> abstract_value) -> abstract_value -> abstract_value end frama-c-20.0-Calcium/src/plugins/loop_analysis/region_analysis_stmt.ml0000666000000000000000000001102613571573400023126 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Region_analysis module type M = sig val kf: Kernel_function.t open Cil_types type abstract_value val compile_node: stmt -> abstract_value -> (stmt edge * abstract_value) list val mu: (abstract_value -> abstract_value) -> abstract_value -> abstract_value val join: abstract_value list -> abstract_value end (* Helper function to make region analysis on Frama-C stmts. *) module MakeNode(M:M):Node with type abstract_value = M.abstract_value and type node = Cil_types.stmt = struct include M type node = Cil_types.stmt let pretty = Cil_datatype.Stmt.pretty let equal = Cil_datatype.Stmt.equal module Set = Cil_datatype.Stmt.Set;; module Graph = struct let entry_node = Kernel_function.find_first_stmt M.kf let all_nodes = (* DFS from the entry node. *) let visited = ref Set.empty in let rec loop v = visited := Set.add v !visited; List.iter (fun s -> if not (Set.mem s !visited) then loop s) v.Cil_types.succs in loop entry_node; !visited ;; let exit_nodes = let ret = Kernel_function.find_return M.kf in if Set.mem ret all_nodes then [ret] else [];; let iter_preds n f = List.iter f n.Cil_types.preds let iter_succs n f = List.iter f n.Cil_types.succs end module Dict = struct open Cil_datatype.Stmt type 'a t = 'a Hashtbl.t * 'a let get (hash,default) x = try Hashtbl.find hash x with Not_found -> default ;; let set (hash,_) x value = Hashtbl.replace hash x value;; let iter (hash,_) f = Hashtbl.iter f hash;; let create size default = (Hashtbl.create size, default) let copy (h1,def1) = (Hashtbl.copy h1, def1) end module Edge_Dict = struct module Edge_Hash = Hashtbl.Make(struct type t = node edge let equal a b = match a,b with | Exit n1, Exit n2 -> equal n1 n2 | Edge(from1,to1), Edge(from2,to2) -> equal from1 from2 && equal to1 to2 | _ -> false let hash = function | Exit n -> n.Cil_types.sid | Edge(from,to_) -> 997 * from.Cil_types.sid + to_.Cil_types.sid end) let get = Edge_Hash.find let set = Edge_Hash.replace let create () = Edge_Hash.create 17 let iter m f = Edge_Hash.iter f m type 'a t = 'a Edge_Hash.t end module DomTree = struct let dominates = Dominators.dominates let domtree_postfix_iter f = (* Reverse the normal domtree. *) let dom_tree = Hashtbl.create 17 in let find_or_empty x = try Hashtbl.find dom_tree x with Not_found -> [] in Set.iter (fun x -> match Dominators.get_idom x with | None -> () | Some idom -> Hashtbl.replace dom_tree idom (x::(find_or_empty idom))) Graph.all_nodes; let rec traverse x = let children = find_or_empty x in List.iter traverse children; f x in traverse Graph.entry_node ;; end end frama-c-20.0-Calcium/src/plugins/loop_analysis/region_analysis_stmt.mli0000666000000000000000000000424313571573400023302 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Region_analysis open Cil_types module type M = sig val kf: Kernel_function.t type abstract_value val compile_node: stmt -> abstract_value -> (stmt edge * abstract_value) list val mu: (abstract_value -> abstract_value) -> abstract_value -> abstract_value val join: abstract_value list -> abstract_value end (* Helper function to make region analysis on Frama-C stmts. Produces a Node suitable as an argument to the [Region_analysis.Make] functor.*) module MakeNode(M:M):Node with type abstract_value = M.abstract_value and type node = stmt frama-c-20.0-Calcium/src/plugins/loop_analysis/register.ml0000666000000000000000000000452613571573400020524 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* [nobranches] defines whether this function will compute a full slevel analysis (by default), or estimate loop bounds without branching analysis (if [nobranches = true]). *) let analyze ?(nobranches=false) kf = if Kernel_function.is_definition kf then if Cil_datatype.Stmt.Set.is_empty (Loop.get_non_naturals kf) then (Loop_analysis.analyze kf; Slevel_analysis.analyze ~nobranches kf) else Options.warning "Could not analyze function %a;@ \ it contains a non-natural loop" Kernel_function.pretty kf ;; let main() = if Options.Run.get() then begin Globals.Functions.iter (analyze ~nobranches:(Options.NoBranches.get())); Slevel_analysis.display_results() end ;; Db.Main.extend main;; frama-c-20.0-Calcium/src/plugins/loop_analysis/slevel_analysis.ml0000666000000000000000000003003613571573400022070 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Note: this does not represent exactly the weird slevel consumption strategy. *) module Needs_Merge_After_Loop = Kernel_function.Make_Table (Datatype.Bool) (struct let size = 97 let name = "Needs_Merge_After_Loop" let dependencies = [Ast.self] end) module Suggested_Slevel = Kernel_function.Make_Table (Datatype.Integer) (struct let size = 97 let name = "Suggested_Slevel" let dependencies = [Ast.self] end) module Functions_With_Unknown_Loop = Kernel_function.Make_Table (Datatype.Bool) (struct let size = 97 let name = "Functions_With_Unknown_Loop" let dependencies = [Ast.self] end) let max_slevel_encountered = ref Integer.zero;; let update_max_slevel_encountered x = match x, !max_slevel_encountered with | None, _ -> () | Some a, b -> max_slevel_encountered := Integer.max a b ;; type path_bound = Integer.t option (* None = infinite *) module Specific(KF:sig val kf: Kernel_function.t end) = struct let join2_stmts stmt1 stmt2 = (* Cil.dummyStmt is bottom for statements. *) if Cil_datatype.Stmt.equal stmt1 stmt2 then stmt1 else if Cil_datatype.Stmt.equal stmt1 Cil.dummyStmt then stmt2 else if Cil_datatype.Stmt.equal stmt2 Cil.dummyStmt then stmt1 else assert false ;; let add_path_bounds a b = match (a,b) with | None, _ | _, None -> None | Some a, Some b -> Some (Integer.add a b) type abstract_value = path_bound * Cil_types.stmt let join2 (a1,s1) (a2,s2) = (add_path_bounds a1 a2,join2_stmts s1 s2);; let join = function | [] -> (Some Integer.zero,Cil.dummyStmt) | [x] -> x | a::b -> List.fold_left join2 a b ;; let mu f (entry,loop) = let max_iteration = try Some(Loop_analysis.Loop_Max_Iteration.find loop) with Not_found -> Functions_With_Unknown_Loop.replace KF.kf true; None in let (in_loop,_) = f (Some Integer.one,loop) in let result = match (max_iteration,in_loop, entry) with (* If merge_after_loop, set to 1 after the loop. *) | None, _,_ | _, None,_ | _,_,None -> Needs_Merge_After_Loop.replace KF.kf true; Some Integer.one | Some max_iteration, Some in_loop, Some entry -> (* Kernel.feedback "max_iteration %d in_loop %a entry %a" *) (* max_iteration (Integer.pretty ~hexa:false) in_loop *) (* (Integer.pretty ~hexa:false) entry; *) try let in_loop_i = Integer.to_int in_loop in match in_loop_i with | 1 -> Some(Integer.mul entry (Integer.of_int max_iteration)) | _ -> (* Ignoring entry, we have 1 state at the loop entry, then q, then q^2, etc. Sum i=0 to n q^n = (q^{n+1} - 1)/(q - 1)). *) let s = if in_loop_i > 1 && (max_iteration + 1) > 100 then raise (Invalid_argument "exponent too large for slevel") else Integer.power_int_positive_int in_loop_i (max_iteration + 1) in let slevel_inside_loop = Integer.e_div (Integer.pred s) (Integer.pred in_loop) in let result = Integer.mul entry slevel_inside_loop in (* Kernel.feedback "s %a slevel_inside_loop %a result %a" *) (* (Integer.pretty ~hexa:false) s *) (* (Integer.pretty ~hexa:false) slevel_inside_loop *) (* (Integer.pretty ~hexa:false) result; *) if Integer.le result (Integer.of_int (Options.MaxIterations.get())) then Some result else raise Exit with | Invalid_argument _ (* Possible negative exponent *) | Z.Overflow (* Integer too big *) | Exit -> (* Above MaxIterations. *) update_max_slevel_encountered (Some (Integer.mul entry (Integer.mul in_loop (Integer.of_int max_iteration)))); Needs_Merge_After_Loop.replace KF.kf true; Some Integer.one in (* (match result with *) (* | None -> () *) (* | Some res -> *) (* Kernel.feedback "final result %a" (Integer.pretty ~hexa:false) res); *) (result,loop) let kf = KF.kf let compile_node stmt (num,stmt2) = let stmt = join2_stmts stmt stmt2 in let open Cil_types in let map_on_all_succs (value) = List.map (fun x -> (Region_analysis.Edge(stmt,x),(value,x))) stmt.succs in map_on_all_succs num end (* does not compute branches, and sets -merge-after-loop for all functions *) module SpecificNoBranches(KF:sig val kf: Kernel_function.t end) = struct type abstract_value = path_bound * Cil_types.stmt let join2_stmts stmt1 stmt2 = (* Cil.dummyStmt is bottom for statements. *) if Cil_datatype.Stmt.equal stmt1 stmt2 then stmt1 else if Cil_datatype.Stmt.equal stmt1 Cil.dummyStmt then stmt2 else if Cil_datatype.Stmt.equal stmt2 Cil.dummyStmt then stmt1 else assert false let join2 (a1,s1) (a2,s2) = let path_bounds = match a1, a2 with | None, None -> None | Some a, None | None, Some a -> Some a | Some a1, Some a2 -> Some (Integer.max a1 a2) in path_bounds, join2_stmts s1 s2;; let join = function | [] -> (Some Integer.zero, Cil.dummyStmt) | [x] -> x | a::b -> List.fold_left join2 a b ;; let mu f (entry,loop) = let max_iteration = try Some (Loop_analysis.Loop_Max_Iteration.find loop) with Not_found -> Functions_With_Unknown_Loop.replace KF.kf true; None in let (in_loop,_) = f (Some Integer.one, loop) in let result = match (max_iteration, in_loop, entry) with (* If merge_after_loop, set to 1 after the loop. *) | None, _, _ | _, None, _ | _, _, None -> Some Integer.one | Some max_iteration, Some in_loop, Some entry -> try let in_loop_i = Integer.to_int in_loop in match in_loop_i with | 1 -> Some Integer.(max entry (of_int max_iteration)) | _ -> (* We only want the loop iteration count, so just multiply bounds; add 1 to avoid issues with slevel counting of first/last iterations in nested loops *) Some Integer.(pred (mul (succ (of_int in_loop_i)) (of_int max_iteration))) with | Z.Overflow (* Integer too big *) -> update_max_slevel_encountered (Some (Integer.mul entry (Integer.mul in_loop (Integer.of_int max_iteration)))); Some Integer.one in Needs_Merge_After_Loop.replace KF.kf true; (result, loop) let kf = KF.kf let compile_node stmt (num,stmt2) = let stmt = join2_stmts stmt stmt2 in let map_on_all_succs (value) = List.map (fun x -> Region_analysis.Edge(stmt, x), (value, x)) stmt.Cil_types.succs in map_on_all_succs num end module type M' = Region_analysis_stmt.M with type abstract_value = path_bound * Cil_types.stmt (* [nobranches] defines whether this function will compute a full slevel analysis (by default), or estimate loop bounds without branching analysis (if [nobranches = true]). *) let analyze ?(nobranches=false) kf = max_slevel_encountered := Integer.zero; Options.debug "slevel analysis of function %a" Kernel_function.pretty kf; let m = if nobranches then (module SpecificNoBranches(struct let kf = kf end) : M') else (module Specific(struct let kf = kf end) : M') in let module M = (val m : M') in let module Node = Region_analysis_stmt.MakeNode(M) in let module Result = Region_analysis.Make(Node) in let after = Result.after in let dict = after (Some Integer.one, (Kernel_function.find_first_stmt kf)) in Node.Edge_Dict.iter dict (fun _ (x,_) -> update_max_slevel_encountered x); Suggested_Slevel.replace kf !max_slevel_encountered ;; let cmp_kf_by_name kf1 kf2 = String.compare (Kernel_function.get_name kf1) (Kernel_function.get_name kf2) let display_results() = let display_functions_without_bounds fmt = Functions_With_Unknown_Loop.iter_sorted ~cmp:cmp_kf_by_name (fun kf _ -> Format.fprintf fmt "%a@\n" Kernel_function.pretty kf) in if Functions_With_Unknown_Loop.length () > 0 then Options.result "Functions with loops whose bounds we could not find:@\n%t" display_functions_without_bounds; let display_merge_after_loop fmt = Needs_Merge_After_Loop.iter_sorted ~cmp:cmp_kf_by_name (fun kf _ -> Format.fprintf fmt "-val-slevel-merge-after-loop %a \\@\n" Kernel_function.pretty kf) in let max_slevel_opt = Integer.of_int (Options.MaxSlevel.get ()) in let bounds_over_max_slevel = List.rev ( Suggested_Slevel.fold_sorted ~cmp:cmp_kf_by_name (fun kf i acc -> if Integer.gt i max_slevel_opt then (kf, i) :: acc else acc) []) in let display_slevel_function fmt (kf, i) = Format.fprintf fmt "-slevel-function %a:%a" Kernel_function.pretty kf (Integer.pretty ~hexa:false) i in if bounds_over_max_slevel <> [] then Options.result "Functions with loops whose estimated bounds \ were larger than %s@ (we recommend setting \ their slevel to 0 to avoid wasting time):@\n%a" Options.MaxSlevel.name (Pretty_utils.pp_list ~sep:"@\n" (Pretty_utils.pp_pair ~sep:" " Kernel_function.pretty (fun fmt i -> Format.fprintf fmt "(estimated bounds: %a)" (Integer.pretty ~hexa:false) i))) bounds_over_max_slevel; let functions_with_bounds = List.rev ( Suggested_Slevel.fold_sorted ~cmp:cmp_kf_by_name (fun kf i acc -> (* Do not report -slevel-function for functions whose bounds were not found or were larger than -max-slevel-loop *) let slevel = if Integer.le i max_slevel_opt && not (Functions_With_Unknown_Loop.mem kf) then i else Integer.zero in (kf, slevel) :: acc ) []) in (* for a more usable output, in case the user does not want functions with bounds equal to 0, sort them before the others *) let functions_with_bounds_0, functions_with_bounds_pos = List.partition (fun (_kf, i) -> Integer.equal i Integer.zero) functions_with_bounds in let display_slevel fmt = Format.fprintf fmt "%a" (Pretty_utils.pp_list ~sep:" \\@\n" display_slevel_function) (functions_with_bounds_0 @ functions_with_bounds_pos) in Options.result "Add this to your command line:@\n%t%t @\n" display_merge_after_loop display_slevel; ;; frama-c-20.0-Calcium/src/plugins/markdown-report/0000777000000000000000000000000013571573400016616 5ustar frama-c-20.0-Calcium/src/plugins/markdown-report/Makefile.in0000666000000000000000000000567213571573400020675 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif PLUGIN_DIR ?=. PLUGIN_ENABLE:=@ENABLE_MDR@ PLUGIN_NAME:=Markdown_report PLUGIN_GENERATED:=$(PLUGIN_DIR)/Markdown_report.mli PLUGIN_CMO:=\ sarif mdr_params parse_remarks \ eva_coverage md_gen sarif_gen mdr_register PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_REQUIRES:=ppx_deriving ppx_deriving_yojson yojson PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure share/acsl.xml PLUGIN_TESTS_DIRS:= eva include $(FRAMAC_SHARE)/Makefile.dynamic $(Markdown_report_DIR)/Markdown_report.mli: \ $(Markdown_report_DIR)/mdr_params.mli \ $(Markdown_report_DIR)/md_gen.mli \ $(Markdown_report_DIR)/Makefile echo "module Mdr_params: sig" > $@ cat $(Markdown_report_DIR)/mdr_params.mli >> $@ echo "end" >> $@ echo "module Md_gen: sig" >> $@ cat $(Markdown_report_DIR)/md_gen.mli >> $@ echo "end" >> $@ ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif ifeq ("@ENABLE_MDR@","yes") install:: $(PRINT_CP) $(FRAMAC_DATADIR)/Markdown_report $(MKDIR) $(FRAMAC_DATADIR)/Markdown_report $(CP) $(Markdown_report_DIR)/share/acsl.xml \ $(FRAMAC_DATADIR)/Markdown_report endif frama-c-20.0-Calcium/src/plugins/markdown-report/configure0000777000000000000000000030336013571573400020532 0ustar #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS HAS_OCAML_PPX_DERIVING_YOJSON OCAML_PPX_DERIVING_YOJSON HAS_OCAML_PPX_DERIVING OCAML_PPX_DERIVING ENABLE_MDR ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_mdr ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-mdr Markdown/SARIF report plug-in (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-mdr was given. if test "${enable_mdr+set}" = set; then : enableval=$enable_mdr; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "mdr is not available" "$LINENO" 5 fi FORCE_MDR=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_MDR ENABLE_MDR=$ENABLE NAME_MDR=mdr if test "$default" = "no" -a "$FORCE" = "no"; then INFO_MDR=" (not available by default)" fi echo "mdr... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_OCAML_PPX_DERIVING=$REQUIRE_OCAML_PPX_DERIVING" "mdr REQUIRE_OCAML_PPX_DERIVING_YOJSON=$REQUIRE_OCAML_PPX_DERIVING_YOJSON" "mdr HAS_OCAML_PPX_DERIVING= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml package ppx_deriving" >&5 $as_echo_n "checking for OCaml package ppx_deriving... " >&6; } OCAML_PPX_DERIVING=$(ocamlfind query ppx_deriving -format %v 2>/dev/null) if test -z "$OCAML_PPX_DERIVING" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found via ocamlfind." >&5 $as_echo "not found via ocamlfind." >&6; } HAS_OCAML_PPX_DERIVING=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 $as_echo "found." >&6; } HAS_OCAML_PPX_DERIVING=yes fi HAS_OCAML_PPX_DERIVING_YOJSON= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml package ppx_deriving_yojson" >&5 $as_echo_n "checking for OCaml package ppx_deriving_yojson... " >&6; } OCAML_PPX_DERIVING_YOJSON=$(ocamlfind query ppx_deriving_yojson -format %v 2>/dev/null) if test -z "$OCAML_PPX_DERIVING_YOJSON" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found via ocamlfind." >&5 $as_echo "not found via ocamlfind." >&6; } HAS_OCAML_PPX_DERIVING_YOJSON=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 $as_echo "found." >&6; } HAS_OCAML_PPX_DERIVING_YOJSON=yes fi if test -n "$REQUIRE_OCAML_PPX_DERIVING" -o -n "$USE_OCAML_PPX_DERIVING" -o "$force_check" = "yes"; then if test "$HAS_OCAML_PPX_DERIVING" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: package ppx_deriving not found" >&5 $as_echo "$as_me: WARNING: package ppx_deriving not found" >&2;} reason="ppx_deriving missing" for p in $REQUIRE_OCAML_PPX_DERIVING; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ ppx_deriving\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_OCAML_PPX_DERIVING; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ ppx_deriving\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done else OCAML_PPX_DERIVING=PPX_DERIVING fi fi if test -n "$REQUIRE_OCAML_PPX_DERIVING_YOJSON" -o -n "$USE_OCAML_PPX_DERIVING_YOJSON" -o "$force_check" = "yes"; then if test "$HAS_OCAML_PPX_DERIVING_YOJSON" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: package ppx_deriving_yojson not found" >&5 $as_echo "$as_me: WARNING: package ppx_deriving_yojson not found" >&2;} reason="ppx_deriving_yojson missing" for p in $REQUIRE_OCAML_PPX_DERIVING_YOJSON; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ ppx_deriving_yojson\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_OCAML_PPX_DERIVING_YOJSON; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ ppx_deriving_yojson\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done else OCAML_PPX_DERIVING_YOJSON=PPX_DERIVING_YOJSON fi fi # First, initialize some variables for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` TODOLIST=$TODOLIST" "$plugin eval MARK_$plugin= eval REMEMBER_$plugin= fi done # main call compute_dependency ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi frama-c-20.0-Calcium/src/plugins/markdown-report/configure.ac0000666000000000000000000000441213571573400021105 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)] ) check_plugin(mdr,PLUGIN_RELATIVE_PATH(plugin_file),[Markdown/SARIF report plug-in],yes) plugin_require_pkg(mdr,ppx_deriving) plugin_require_pkg(mdr,ppx_deriving_yojson) configure_pkg(ppx_deriving,[package ppx_deriving not found]) configure_pkg(ppx_deriving_yojson,[package ppx_deriving_yojson not found]) check_plugin_dependencies write_plugin_config(Makefile) frama-c-20.0-Calcium/src/plugins/markdown-report/eva_coverage.ml0000666000000000000000000002072713571573400021606 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type coverage_stats = { syntactic_calls: int; indirect_calls: int; total_stmts: int; covered_stmts: int; } let add_syntactic_call stats = { stats with syntactic_calls = stats.syntactic_calls + 1 } let add_indirect_call stats = { stats with indirect_calls = stats.indirect_calls + 1 } let empty_stats = { syntactic_calls = 0; indirect_calls = 0; total_stmts = 0; covered_stmts = 0 } type call_kind = No_call | Only_indirect | Direct type callee_info = { call: call_kind; is_analyzed: bool; visited: bool; } let no_call = { call = No_call; is_analyzed = false; visited = false; } let indirect_call = { no_call with call = Only_indirect } let direct_call = { indirect_call with call = Direct } let visit info = { info with visited = true; } let is_analyzed_function vi = not (Cil.hasAttribute "fc_stdlib" vi.vattr) && not (Cil.hasAttribute "fc_stdlib_generated" vi.vattr) && Kernel_function.is_definition (Globals.Functions.get vi) && not (List.exists (fun s -> List.exists (fun kf -> Cil_datatype.Varinfo.equal (Kernel_function.get_vi kf) vi) (Globals.FileIndex.get_functions (Filepath.Normalized.of_string s))) (Mdr_params.Stubs.get())) && not (List.mem vi.vname (String.split_on_char ',' (Dynamic.Parameter.String.get "-eva-use-spec" ()))) && not (List.mem vi.vname (List.map (fun s -> List.hd (String.split_on_char ':' s)) (String.split_on_char ',' (Dynamic.Parameter.String.get "-eva-builtin" ())))) let is_analyzed_info vi info = {info with is_analyzed=is_analyzed_function vi; } class eva_coverage_vis ~from_entry_point = object(self) inherit Visitor.frama_c_inplace val mutable stats = empty_stats val calls = Cil_datatype.Varinfo.Hashtbl.create 17 method private incr_total_stmts = stats <- { stats with total_stmts = stats.total_stmts + 1 } method private incr_covered_stmts = stats <- { stats with covered_stmts = stats.covered_stmts + 1 } method! vstmt_aux s = (* We only consider real statements: Blocks do not count. *) match s.skind with | Block _ | UnspecifiedSequence _ -> Cil.DoChildren | _ -> self#incr_total_stmts; if Db.Value.is_reachable_stmt s then self#incr_covered_stmts; Cil.DoChildren method! vinst i = match i with | Call(_, { enode = Lval (Var vi, NoOffset)},_,_) | Local_init(_,ConsInit (vi,_,_),_) -> if Cil_datatype.Varinfo.Hashtbl.mem calls vi then begin let info = Cil_datatype.Varinfo.Hashtbl.find calls vi in Cil_datatype.Varinfo.Hashtbl.replace calls vi { info with call = Direct } end else begin Cil_datatype.Varinfo.Hashtbl.add calls vi (is_analyzed_info vi direct_call) end; Cil.SkipChildren | Call(_,{ enode = Lval (Mem _,NoOffset)},_,_) -> let s = Extlib.the self#current_stmt in let kfs = Db.Value.call_to_kernel_function s in let handle_one kf = let vi = Kernel_function.get_vi kf in if not (Cil_datatype.Varinfo.Hashtbl.mem calls vi) then begin Cil_datatype.Varinfo.Hashtbl.add calls vi (is_analyzed_info vi indirect_call) end else begin let info = Cil_datatype.Varinfo.Hashtbl.find calls vi in if info.call = No_call then begin Cil_datatype.Varinfo.Hashtbl.replace calls vi { info with call = Only_indirect } end end in Kernel_function.Hptset.iter handle_one kfs; Cil.SkipChildren | _ -> Cil.SkipChildren (* No need to go further. *) method compute () = let treat_call vi info reached = let must_visit = not info.visited && info.is_analyzed in Cil_datatype.Varinfo.Hashtbl.replace calls vi (visit info); if must_visit then begin let kf = Globals.Functions.get vi in ignore (Visitor.visitFramacKf (self:>Visitor.frama_c_inplace) kf); end; reached && not must_visit in let check_fixpoint () = Cil_datatype.Varinfo.Hashtbl.fold treat_call calls true in if not from_entry_point then begin Globals.Functions.iter_on_fundecs (fun { svar } -> Cil_datatype.Varinfo.Hashtbl.add calls svar (is_analyzed_info svar no_call)) end; let vi = Globals.Functions.get_vi (Globals.Functions.find_by_name (Kernel.MainFunction.get())) in (* main entry point might be a stub, but we still would like to collect non-stubs calls from it. *) let info = is_analyzed_info vi direct_call in Cil_datatype.Varinfo.Hashtbl.replace calls vi { info with is_analyzed = true }; while not (check_fixpoint ()) do () done; Cil_datatype.Varinfo.Hashtbl.fold (fun _ info stats -> if info.is_analyzed then begin match info.call with | Direct -> add_syntactic_call stats | Only_indirect -> add_indirect_call stats | No_call -> stats end else stats) calls stats end let nb_fundefs () = Globals.Functions.fold (fun kf nb -> if Kernel_function.is_definition kf && is_analyzed_function (Kernel_function.get_vi kf) then nb + 1 else nb) 0 let md_gen () = let main = Kernel.MainFunction.get () in !Db.Value.compute (); let vis = new eva_coverage_vis ~from_entry_point:false in let stats = vis#compute () in let summary_whole = Markdown.format "There are %d function definitions that are not stubbed. They represent \ %d statements, of which %d are potentially reachable through EVA, \ resulting in a **statement coverage of %.1f%%** with respect to the \ entire application." (nb_fundefs()) stats.total_stmts stats.covered_stmts (float_of_int stats.covered_stmts *. 100. /. float_of_int stats.total_stmts) in let vis = new eva_coverage_vis ~from_entry_point:true in let stats = vis#compute () in let summary = Markdown.format "There were potentially %d functions syntactically reachable from %s." stats.syntactic_calls main in let summary = if stats.indirect_calls = 0 then summary else summary @ Markdown.format "In addition, %d were found potentially reachable through \ indirect calls." stats.indirect_calls in let summary = summary @ Markdown.format "These functions contain %d statements, \ of which %d are potentially reachable according to EVA, resulting in \ a **statement coverage of %.1f%%** with respect to the perimeter set \ by this entry point." stats.total_stmts stats.covered_stmts (float_of_int stats.covered_stmts *. 100. /. float_of_int stats.total_stmts) in Markdown.([ Block [Text summary_whole]; Block [Text summary ]]) frama-c-20.0-Calcium/src/plugins/markdown-report/eva_coverage.mli0000666000000000000000000000325713571573400021756 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** generates a coverage summary of EVA's run*) val md_gen: unit -> Markdown.element list frama-c-20.0-Calcium/src/plugins/markdown-report/md_gen.ml0000666000000000000000000005235613571573400020414 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Markdown type env = { is_draft: bool; remarks: Markdown.element list Datatype.String.Map.t; } let insert_remark_opt env anchor placeholder = try Datatype.String.Map.find anchor env.remarks with Not_found -> placeholder let insert_remark env anchor = insert_remark_opt env anchor [] (* apparently, pandoc, or at least its latex output, does not like anchors beginning with _ *) let sanitize_anchor s = if s = "" then "a" else if s.[0] = '_' then "a" ^ s else s let all_eva_domains = [ "-eva-apron-box", "box domain of the Apron library"; "-eva-apron-oct", "octagon domain of the Apron library"; "-eva-bitwise-domain", "domain for bitwise computations"; "-eva-equality-domain", "domain for storing equalities between memory locations"; "-eva-gauges-domain", "gauges domain for relations between memory locations and loop counter"; "-eva-inout-domain", "domain for input and output memory locations"; "-eva-polka-equalities", "linear equalities domain of the Apron library"; "-eva-polka-loose", "loose polyhedra domain of the Apron library"; "-eva-polka-strict", "strict polyhedra domain of the Apron library"; "-eva-sign-domain", "sign domain (useful only for demos)"; "-eva-symbolic-locations-domain", "domain computing ranges of variation for symbolic locations \ (e.g. `a[i]` when `i` is not precisely known by `Cvalue`)" ] let insert_marks env anchor = Comment "BEGIN_REMARK" :: insert_remark env anchor @ [Comment "END_REMARK"] let plural l s = match l with | [] | [ _ ] -> s | _::_::_ -> s ^ "s" let get_eva_domains () = Extlib.filter_map (fun (x,_) -> Dynamic.Parameter.Bool.get x ()) (fun (x,y) -> (plain "option" @ bold x), plain y) all_eva_domains let section_domains env = let anchor = "domains" in let head = H3 (plain "EVA Domains", Some anchor) in if env.is_draft then head :: Comment "You can give more information about the choice of EVA domains" :: insert_marks env anchor else begin let l = get_eva_domains () in head :: Block (match l with | [] -> [Text (plain "Only the base domain (`Cvalue`) \ has been used for the analysis")] | _ -> [Text (plain "In addition to the base domain (`Cvalue`), additional \ domains have been used by EVA"); DL l] ) :: insert_remark env anchor end let section_stubs env = let stubbed_kf = List.concat (List.map (fun f -> let filename = Filepath.Normalized.of_string f in Globals.FileIndex.get_functions ~declarations:false filename) (Mdr_params.Stubs.get ()) ) in let stubbed_kf = List.filter Kernel_function.is_definition stubbed_kf in let opt = Dynamic.Parameter.String.get "-eva-use-spec" () in (* NB: requires OCaml >= 4.04 *) let l = String.split_on_char ',' opt in let use_spec = Extlib.filter_map (* The option can include categories in Frama-C's List/Set/Map sense, which begins with a '@'. In particular, @default is included by default. Theoretically, there could also be some '-' to suppress the inclusion of a function *) (fun s -> String.length s <> 0 && s.[0] <> '@' && s.[0] <> '-') (fun s -> let kf = Globals.Functions.find_by_name s in let anchor = sanitize_anchor s in let content = if env.is_draft then insert_marks env anchor else let intro = Markdown.text @@ Markdown.format "`%s` has the following specification" s in let funspec = Markdown.codeblock ~lang:"acsl" "%a" Printer.pp_funspec (Annotations.funspec kf) in Block ( intro @ funspec ) :: insert_remark env anchor in H4 (code s, Some anchor) :: content) l in let describe_func kf = let name = Kernel_function.get_name kf in let anchor = sanitize_anchor name in let loc = Kernel_function.get_location kf in let content = if env.is_draft then insert_marks env anchor else let intro = Markdown.text @@ Markdown.format "`%s` @[is defined at %a@]" name Cil_datatype.Location.pretty loc in let fundecl = Markdown.codeblock ~lang:"c" "%a" Printer.pp_global (GFun (Kernel_function.get_definition kf,loc)) in Block ( intro @ fundecl ) :: insert_remark env anchor in H4 (code name, Some anchor) :: content in let content = if stubbed_kf <> [] then begin List.map describe_func stubbed_kf end else [] in let content = content @ use_spec in let content = List.concat content in if content = [] then if env.is_draft then [ Comment "No stubs have been used" ] else [ Block [Text (plain "No stubs have been used for this analysis")]] else content let get_files () = let dir_table = Datatype.String.Hashtbl.create 17 in let add_entry f = let dir = Filename.dirname f in let base = Filename.basename f in let suf = try let i = String.rindex base '.' in String.sub base i (String.length base - i) with Not_found -> "" in let entries = try Datatype.String.Hashtbl.find dir_table dir with Not_found -> Datatype.String.Map.empty in let subentries = try Datatype.String.Map.find suf entries with Not_found -> Datatype.String.Set.empty in Datatype.String.( Hashtbl.replace dir_table dir (Map.add suf (Set.add base subentries) entries)) in List.iter add_entry (Kernel.Files.get()); let treat_subentry dir dir_files suf files l = let dir_files = List.fold_left (fun acc s -> if Filename.check_suffix s suf then Datatype.String.Set.add s acc else acc) Datatype.String.Set.empty dir_files in if Datatype.String.Set.subset dir_files files then (dir ^ "/*" ^ suf) :: l else Datatype.String.Set.elements files @ l in let treat_entry dir map l = try let dir_files = Array.to_list (Sys.readdir dir) in Datatype.String.Map.fold (treat_subentry dir dir_files) map l with Sys_error s -> Mdr_params.warning "Unable to find directory %s: %s" dir s; Datatype.String.Map.fold (fun _ s l -> Datatype.String.Set.elements s @ l) map l in Datatype.String.Hashtbl.fold treat_entry dir_table [] let gen_inputs env = let anchor = "c-input" in let prelude = if env.is_draft then Comment "You can add here some remarks about the set of files \ that is considered by Frama-C" :: insert_marks env anchor else insert_remark env anchor in H2 (plain "Input files", Some anchor) :: prelude @ [ Block [ Text (plain "The C source files (not including the headers `.h` files)" @ plain "that have been considered during the analysis \ are the following:" ); UL (List.map (fun x -> text @@ code x) (get_files())); ]] let gen_config env = let anchor = "options" in let header = H2 (plain "Configuration", Some anchor) in let content = if env.is_draft then Comment "You can add here some remarks about the options used for the analysis" :: insert_marks env anchor else begin let placeholder = [ Block [ Text (plain "The options that have been used for this analysis \ are the following.")]] in insert_remark_opt env anchor placeholder end in header :: content let gen_context env = let context = let anchor = "intro" in let header = H1 (plain "Introduction", Some anchor) in if env.is_draft then header :: Comment "You can add here some overall introduction to the analysis" :: insert_marks env anchor else begin match insert_remark env anchor with | [] -> [] | (_::_) as l -> header :: l end in context @ H1 (plain "Context of the analysis", Some "context") :: gen_inputs env @ gen_config env @ section_domains env @ H3 (plain "Stubbed Functions", Some "stubs") :: ( if env.is_draft then Comment "You can add here general comments about the stubs that have been used" :: insert_marks env "stubs" else insert_remark env "stubs") @ section_stubs env let gen_coverage env = let anchor = "coverage" in let header = H1 (plain "Coverage", Some anchor) in let content = Eva_coverage.md_gen () in let content = if env.is_draft then content @ Comment "You can comment on the coverage obtained by EVA" :: insert_marks env anchor else content @ insert_remark env anchor in header :: content let string_of_pos pos = Format.asprintf "%a" Filepath.pp_pos pos let string_of_pos_opt = function | None -> "Global" | Some pos -> string_of_pos pos let string_of_loc (l1, _) = string_of_pos l1 let make_events_table print_kind caption events = let open Log in let caption = Some caption in let header = [ plain "Location", Left; plain "Description", Left; ] in let header = if print_kind then (plain "Kind", Center) :: header else header in let kind = function | Result -> "Result" | Feedback -> "Feedback" | Debug -> "Debug" | Warning -> "Warning" | Error -> "User error" | Failure -> "Internal error" in let treat_event { evt_kind; evt_plugin; evt_source; evt_message } = let evt_message = Str.global_replace (Str.regexp_string "\n") " " evt_message in let line = [ plain (string_of_pos_opt evt_source); format "`%s` (emitted by `%s`)" evt_message evt_plugin ] in if print_kind then plain (kind evt_kind) :: line else line in let content = List.fold_left (fun l evt -> treat_event evt :: l) [] events in Table { caption; header; content } let make_errors_table errs = make_events_table true (plain (plural errs "Error" ^ " reported by Frama-C")) errs let make_warnings_table warnings = make_events_table false (plain (plural warnings "Warning" ^ " reported by Frama-C")) warnings let section_event is_err env nb event = let open Log in let title = Format.asprintf "@[%s %d (%s)@]" (if is_err then "Error" else "Warning") nb (string_of_pos_opt event.evt_source) in let lab = Format.asprintf "@[%s-%d@]" (if is_err then "err" else "warn") nb in let content = if env.is_draft then insert_marks env lab else insert_remark env lab in H2 (plain title, Some lab) :: Block ( (text @@ plain "Message:") @ codeblock "[%s] %s" event.evt_plugin event.evt_message ) :: content let make_events_list is_err env l = List.concat (List.mapi (section_event is_err env) l) let make_errors_list = make_events_list true let make_warnings_list = make_events_list false let gen_section_warnings env = let open Log in Messages.reset_once_flag (); let errs = ref [] in let warnings = ref [] in let add_event evt = match evt.evt_kind with | Error | Failure -> errs:= evt :: !errs | Warning -> warnings := evt :: !warnings | _ -> () in Messages.iter add_event; let errs = !errs in let warnings = !warnings in let error_section = if Messages.nb_errors () <> 0 then begin (* Failure are supposed to stop the analyses right away, so that no report will be generated. On the other hand, Error messages can be triggered without stopping everything. Applying the same treatment to a Failure catched by an evil plugin cannot hurt. *) let prelude = if env.is_draft then [ Comment "you can comment on each individual error" ] else [ Block ( text @@ glue [ bold "Important warning:"; plain "Frama-C did not complete its execution "; plain "successfully. Analysis results may be inaccurate."; plain ((plural errs "The error") ^ " listed below must be"); plain "fixed first before examining other "; plain "warnings and alarms." ] ) ; make_errors_table errs ] in H1 (plain "Errors in the analyzer", Some "errors") :: prelude @ make_errors_list env (List.rev errs) end else [] in if Messages.nb_warnings () <> 0 then begin let prelude = if env.is_draft then [Comment "you can comment on each individual error"] else [Block ( (text @@ glue [ plain ("The table below lists the " ^ plural warnings "warning"); plain "that have been emitted by the analyzer."; plain "They might put additional assumptions on the relevance"; plain "of the analysis results and must be reviewed carefully"; ]) @ (text @@ glue [ plain "Note that this does not take into account emitted alarms:"; plain "they are reported in"; link ~text:(plain "the next section") ~name:"alarms" () ]) ); make_warnings_table warnings ] in error_section @ H1 (plain "Warnings", Some "warnings") :: prelude @ make_warnings_list env (List.rev warnings) end else error_section let gen_section_alarms env = let treat_alarm e kf s ~rank:_ alarm annot (i, sec, content) = let label = "Alarm-" ^ string_of_int i in let link = link ~text:(format "%d" i) ~name:label () in let kind = code @@ Alarms.get_name alarm in let func = code @@ Kernel_function.get_name kf in let loc = string_of_loc @@ Cil_datatype.Stmt.loc s in let loc_text = plain loc in let emitter = code (Emitter.get_name e) in let descr = codeblock ~lang:"acsl" "%a" Printer.pp_code_annotation annot in let sec_title = format "Alarm %d at %s" i loc in let sec_content = if env.is_draft then Block descr :: insert_marks env label else Block ( (text @@ glue [ plain "The following ACSL assertion must hold to avoid" ; plain (Alarms.get_description alarm |> String.lowercase_ascii) ; format "(undefined behavior)." ]) @ descr ) :: insert_remark env label in (i+1, sec @ H2 (sec_title, Some label) :: sec_content, [ link; kind; emitter; func; loc_text ] :: content) in let _,sections, content = Alarms.fold treat_alarm (0,[],[]) in let content = List.rev content in match content with | [] -> let anchor = "alarms" in let text_content = if env.is_draft then Comment "No alarm!" :: insert_marks env anchor else Block (text @@ glue [ bold "No alarm"; plain "was found during the analysis"; plain "Any execution starting from"; code (Kernel.MainFunction.get_function_name ()); plain "in a context matching the one used for the analysis"; plain "will be immune from any undefined behavior." ]) :: insert_remark env anchor in H1 (plain "Results of the analysis", Some anchor) :: text_content | _ :: l -> let alarm = if l = [] then "alarm" else "alarms" in let caption = Some (plain (String.capitalize_ascii alarm ^ " emitted by the analysis")) in let header = [ plain "No", Center; plain "Kind", Center; plain "Emitter", Center; plain "Function", Left; plain "Location", Left; ] in let text_content = if env.is_draft then begin sections end else begin Block (text @@ glue [ plain ("The table below lists the " ^ alarm); plain "that have been emitted during the analysis."; plain "Any execution starting from"; code (Kernel.MainFunction.get_function_name()); plain "in a context matching the one used for the analysis"; plain "will be immune from any other undefined behavior."; plain "More information on each individual alarm is"; plain "given in the remainder of this section" ]) :: Table { content; caption; header } :: sections end in H1 (plain "Results of the analysis", Some "alarms") :: text_content let gen_section_callgraph env = let f = Mdr_params.FlameGraph.get () in if f = "" then [] else begin let anchor = "flamegraph" in let content = if env.is_draft then Comment "A flamegraph provides a visualization of the functions and \ callstacks whose analysis is the most costly." :: insert_marks env anchor else par ( plain "The image below shows the flamegraph (" @ url "http://www.brendangregg.com/flamegraphs.html" @ plain ") for the chosen entry point." ) @ par (image ~alt:"Flamegraph visualization." ~file:f) @ insert_remark env anchor in H1 (plain "Flamegraph", Some anchor) :: content end let gen_section_postlude env = let anchor = "conclusion" in let header = H1 (plain "Conclusion", Some anchor) in if env.is_draft then header :: Comment "You can put here some concluding remarks" :: insert_marks env anchor else begin match insert_remark env anchor with | [] -> [] | (_::_) as l -> header :: l end let gen_alarms env = gen_section_warnings env @ gen_section_alarms env @ gen_section_callgraph env @ gen_section_postlude env let mk_remarks is_draft = let f = Mdr_params.Remarks.get () in if f <> "" then Parse_remarks.get_remarks f else if is_draft then begin let f = Mdr_params.Output.get() in if Sys.file_exists f then begin Mdr_params.feedback "Re-using pre-existing remarks in draft file %s" f; Parse_remarks.get_remarks f end else Datatype.String.Map.empty end else Datatype.String.Map.empty let gen_report ~draft:is_draft () = let remarks = mk_remarks is_draft in let env = { remarks; is_draft } in let context = gen_context env in let coverage = gen_coverage env in let alarms = gen_alarms env in let title = Mdr_params.Title.get () in let title = if title = "" then begin if is_draft then plain "Draft report" else plain "Frama-C Analysis Report" end else plain title in let authors = List.map (fun x -> plain x) (Mdr_params.Authors.get ()) in let date = match Mdr_params.Date.get () with | "" -> None | s -> Some (plain s) in let elements = context @ coverage @ alarms in let elements = if is_draft then Comment "This file contains additional remarks that will be added to \ automatically generated content by Frama-C's Markdown-report plugin. \ For any section of the document, you can write pandoc markdown \ content between the BEGIN and END comments. In addition, the plug-in \ will consider any \\" let end_markdown = Str.regexp_string "" let include_markdown = Str.regexp "" let is_section = Str.regexp "^#[^{]*{#+\\([^}]*\\)}" let cleanup_blanks l = let rec aux = function "" :: l -> aux l | l -> l in aux (List.rev (aux l)) let parse_line env line = if env.is_markdown then begin if Str.string_match end_markdown line 0 then begin let remark = cleanup_blanks env.current_markdown in let remark = match remark with | [] -> Mdr_params.debug ~dkey "Empty remark for section %s" env.current_section; [] | _ -> let res = Markdown.Raw remark in let page = "" in Mdr_params.debug ~dkey "Remark for section %s:@\n%a" env.current_section (Markdown.pp_element ~page) res; [res] in env.remarks <- Datatype.String.Map.add env.current_section remark env.remarks; env.current_markdown <- []; env.is_markdown <- false end else if Str.string_match include_markdown line 0 then begin let f = Str.matched_group 1 line in Mdr_params.debug ~dkey "Remark for section %s in file %s" env.current_section f; try let chan = open_in f in add_channel env chan; close_in chan with Sys_error err -> Mdr_params.error "Unable to open included remarks file %s (%s), Ignoring." f err end else begin env.current_markdown <- line :: env.current_markdown; end end else if Str.string_match beg_markdown line 0 then begin Mdr_params.debug ~dkey "Checking remarks for section %s" env.current_section; env.is_markdown <- true end else if Str.string_match is_section line 0 then begin let sec = Str.matched_group 1 line in Mdr_params.debug ~dkey "Entering section %s" sec; env.current_section <- sec end let parse_remarks env chan = try while true do let s = input_line chan in parse_line env s done; assert false with End_of_file -> close_in chan; env let get_remarks f = Mdr_params.debug ~dkey "Using remarks file %s" f; try let chan = open_in f in let { remarks } = parse_remarks (empty_env ()) chan in remarks with Sys_error err -> Mdr_params.error "Unable to open remarks file %s (%s). \ No additional remarks will be included in the report." f err; Datatype.String.Map.empty frama-c-20.0-Calcium/src/plugins/markdown-report/parse_remarks.mli0000666000000000000000000000357213571573400022166 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Parse skeleton files to add manually written comments to various parts of the report. *) (** [get_remarks f] retrieves the elements associated to various sections of the report, referenced by their anchor. *) val get_remarks: string -> Markdown.element list Datatype.String.Map.t frama-c-20.0-Calcium/src/plugins/markdown-report/sarif.ml0000666000000000000000000007334113571573400020264 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** OCaml representation for the sarif 2.0 schema. *) (** ppx_deriving_yojson generates parser and printer that are recursive by default: we must thus silence spurious let rec warning (39). *) [@@@ warning "-39"] module type Json_type = sig type t val of_yojson: Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_or val to_yojson: t -> Yojson.Safe.t end module Json_dictionary(J: Json_type): Json_type with type t = (string * J.t) list = struct type t = (string * J.t) list let bind x f = match x with Ok x -> f x | Error e -> Error e let bindret x f = bind x (fun x -> Ok (f x)) let bind_pair f (s, x) = bindret (f x) (fun x -> (s, x)) let one_step f acc x = bind acc (fun acc -> (bindret (f x) (fun x -> (x :: acc)))) let bind_list l f = bindret (List.fold_left (one_step (bind_pair f)) (Ok []) l) List.rev let of_yojson = function | `Assoc l -> (match bind_list l J.of_yojson with | Error e -> Error ("dict." ^ e) | Ok _ as res -> res) | `Null -> Ok [] | _ -> Error "dict" let to_yojson l = let json_l = List.map (fun (s, x) -> (s, J.to_yojson x)) l in `Assoc json_l end module Uri: sig include Json_type with type t = private string val sarif_github:t end = struct type t = string[@@deriving yojson] let sarif_github = "https://github.com/oasis-tcs/sarif-spec/blob/master/Documents/CommitteeSpecificationDrafts/v2.0-CSD.1/sarif-schema.json" end module Version: sig include Json_type with type t = private string val v2_0_0: t end = struct type t = string[@@deriving yojson] let v2_0_0 = "2.0.0" end module Message = struct type t = { text: (string [@default ""]); messageId: (string [@default ""]); richText: (string [@default ""]); richMessageId: (string [@default ""]); arguments: (string list [@default []]); }[@@deriving yojson] let create ?(text="") ?(messageId="") ?(richText="") ?(richMessageId="") ?(arguments=[]) () = { text; messageId; richText; richMessageId; arguments } let plain_text ~text ?id:messageId ?arguments () = create ~text ?messageId ?arguments () let markdown ~markdown ?id:richMessageId ?arguments () = let pp fmt = Markdown.pp_elements fmt in let richText = String.trim (Format.asprintf "@[%a@]" pp markdown) in create ~richText ?richMessageId ?arguments () let default = create () end module FileLocation = struct type t = { uri: string; uriBaseId: (string [@default ""]) }[@@deriving yojson] let create ~uri ?(uriBaseId = "") () = { uri; uriBaseId } let default = create ~uri:"" () let of_loc loc = let open Filepath in (* by construction, we have an absolute path here, no need for uriBase *) let uri = ((fst loc).pos_path :> string) in create ~uri () end module FileContent = struct type t = | Text of string [@name "text"] | Binary of string [@name "binary"] [@@deriving yojson] let default = Text "" end module Region = struct type t = { startLine: (int [@default 0]); startColumn: (int [@default 0]); endLine: (int [@default 0]); endColumn: (int [@default 0]); charOffset: (int [@default 0]); charLength: (int [@default 0]); byteOffset: (int [@default 0]); byteLength: (int [@default 0]); snippet: (FileContent.t [@default FileContent.default]); message: (Message.t [@default Message.default]) }[@@deriving yojson] let create ?(startLine = 0) ?(startColumn = 0) ?(endLine = 0) ?(endColumn = 0) ?(charOffset = 0) ?(charLength = 0) ?(byteOffset = 0) ?(byteLength = 0) ?(snippet = FileContent.default) ?(message = Message.default) () = { startLine; startColumn; endLine; endColumn; charOffset; charLength; byteOffset; byteLength; snippet; message } let default = create () let of_loc loc = let open Filepath in let (start, finish) = loc in let startLine = start.pos_lnum in let startColumn = start.pos_cnum - start.pos_bol in let endLine = finish.pos_lnum in let endColumn = finish.pos_cnum - finish.pos_bol in let byteLength = finish.pos_cnum - start.pos_cnum in create ~startLine ~startColumn ~endLine ~endColumn ~byteLength () end module Rectangle = struct type t = { top: (float [@default 0.]); left: (float [@default 0.]); bottom: (float [@default 0.]); right: (float [@default 0.]); message: (Message.t [@default Message.default]); } [@@deriving yojson] end module Custom_properties = Json_dictionary(struct type t = Yojson.Safe.t let of_yojson x = Ok x let to_yojson x = x end) module Properties = struct type tags = string list [@@deriving yojson] type t = { tags: tags; additional_properties: Custom_properties.t } let default = { tags = []; additional_properties = [] } let create additional_properties = let tags = List.map fst additional_properties in { tags; additional_properties } let of_yojson = function | `Null -> Ok default | `Assoc l -> (match List.assoc_opt "tags" l with | None -> Error "properties" | Some json -> (match tags_of_yojson json with | Ok tags -> let additional_properties = List.remove_assoc "tags" l in Ok { tags; additional_properties } | Error loc -> Error ("properties." ^ loc))) | _ -> Error "properties" let to_yojson { tags; additional_properties } = match tags with | [] -> `Null | _ -> `Assoc (("tags", tags_to_yojson tags)::additional_properties) end module PhysicalLocation = struct type t = { id: (string [@default ""]); fileLocation: FileLocation.t; region: (Region.t [@default Region.default]); contextRegion: (Region.t [@default Region.default]); }[@@deriving yojson] let create ?(id = "") ~fileLocation ?(region = Region.default) ?(contextRegion = Region.default) () = { id; fileLocation; region; contextRegion } let default = create ~fileLocation:FileLocation.default () let of_loc loc = let fileLocation = FileLocation.of_loc loc in let region = Region.of_loc loc in create ~fileLocation ~region () end module Location = struct type t = { physicalLocation: PhysicalLocation.t; fullyQualifiedLogicalName: (string [@default ""]); message: (Message.t [@default Message.default]); annotations: (Region.t list [@default []]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] let create ~physicalLocation ?(fullyQualifiedLogicalName = "") ?(message = Message.default) ?(annotations = []) ?(properties = Properties.default) () = { physicalLocation; fullyQualifiedLogicalName; message; annotations; properties; } let default = create ~physicalLocation:PhysicalLocation.default () let of_loc loc = let physicalLocation = PhysicalLocation.of_loc loc in create ~physicalLocation () end module StackFrame = struct type t = { location: (Location.t [@default Location.default]); stack_module: (string [@default ""])[@key "module"]; threadId: (int [@default 0]); address: (int [@default 0]); offset: (int [@default 0]); parameters: (string list [@default []]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] end module Stack = struct type t = { message: (Message.t [@default Message.default]); frames: StackFrame.t list; properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] let default = { message = Message.default; frames = []; properties = Properties.default; } end module Additional_properties = struct include Json_dictionary(struct type t = string[@@deriving yojson] end) let default = [] end module Stl_importance: sig include Json_type with type t = private string val important: t val essential: t val unimportant: t end = struct type t = string [@@deriving yojson] let important = "important" let essential = "essential" let unimportant = "unimportant" end module ThreadFlowLocation = struct type t = { step: int; location: (Location.t [@default Location.default]); stack: (Stack.t [@default Stack.default]); kind: (string [@default ""]); tfl_module: (string [@default ""])[@key "module"]; state: (Additional_properties.t [@default Additional_properties.default]); nestingLevel: (int [@default 0]); executionOrder: (int [@default 0]); timestamp: (string [@default ""]); importance: (Stl_importance.t [@default Stl_importance.unimportant]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] end module ThreadFlow = struct type t = { id: (string [@default ""]); message: (Message.t [@default Message.default]); locations: ThreadFlowLocation.t list; properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] end module Attachment = struct type t = { description: (Message.t [@default Message.default ]); fileLocation: FileLocation.t; regions: (Region.t list [@default []]); rectangles: (Rectangle.t list [@default []]) } [@@deriving yojson] end module CodeFlow = struct type t = { description: (Message.t [@default Message.default]); threadFlows: ThreadFlow.t list; properties: (Properties.t [@default Properties.default]); } [@@deriving yojson] end module Sarif_exception = struct type t = { kind: (string [@default ""]); message: (string [@default ""]); stack: (Stack.t [@default Stack.default]); innerExceptions: (t list [@default []]); }[@@deriving yojson] let default = { kind = ""; message = ""; stack = Stack.default; innerExceptions = [] } end module Notification_kind: sig include Json_type with type t = private string val note: t val warning: t val error: t end = struct type t = string [@@deriving yojson] let note = "note" let warning = "warning" let error = "error" end module Notification = struct type t = { id: (string [@default ""]); ruleId: (string [@default ""]); physicalLocation: (PhysicalLocation.t [@default PhysicalLocation.default]); message: Message.t; level: (Notification_kind.t [@default Notification_kind.warning]); threadId: (int [@default 0]); time: (string [@default ""]); exn: (Sarif_exception.t [@default Sarif_exception.default]) [@key "exception"]; properties: (Properties.t [@default Properties.default]) }[@@deriving yojson] end module Tool = struct type t = { name: string; fullName: (string [@default ""]); version: (string [@default ""]); semanticVersion: (string [@default ""]); fileVersion: (string [@default ""]); downloadUri: (string [@default ""]); sarifLoggerVersion: (string [@default ""]); language: (string [@default "en-US"]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] let create ~name ?(fullName="") ?(version="") ?(semanticVersion="") ?(fileVersion="") ?(downloadUri="") ?(sarifLoggerVersion="") ?(language="en-US") ?(properties=Properties.default) () = { name; fullName; version; semanticVersion; fileVersion; downloadUri; sarifLoggerVersion; language; properties } let default = create ~name:"" () end module Invocation = struct type t = { commandLine: string; arguments: string list; responseFiles: (FileLocation.t list [@default []]); attachments: (Attachment.t list [@default []]); startTime: (string [@default ""]); endTime: (string [@default ""]); exitCode: int; toolNotifications: (Notification.t list [@default []]); configurationNotifications: (Notification.t list [@default []]); exitCodeDescription: (string [@default ""]); exitSignalName: (string [@default ""]); exitSignalNumber: (int [@default 0]); processStartFailureMessage: (string [@default ""]); toolExecutionSuccessful: bool; machine: (string [@default ""]); account: (string [@default ""]); processId: (int [@default 0]); executableLocation: (FileLocation.t [@default FileLocation.default]); workingDirectory: (FileLocation.t [@default FileLocation.default]); environmentVariables: (Additional_properties.t [@default Additional_properties.default]); stdin: (FileLocation.t [@default FileLocation.default]); stdout: (FileLocation.t [@default FileLocation.default]); stderr: (FileLocation.t [@default FileLocation.default]); stdoutStderr: (FileLocation.t [@default FileLocation.default]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] let create ~commandLine ?(arguments = []) ?(responseFiles = []) ?(attachments = []) ?(startTime = "") ?(endTime = "") ?(exitCode = 0) ?(toolNotifications = []) ?(configurationNotifications = []) ?(exitCodeDescription = "") ?(exitSignalName = "") ?(exitSignalNumber = 0) ?(processStartFailureMessage = "") ?(toolExecutionSuccessful = true) ?(machine = "") ?(account = "") ?(processId = 0) ?(executableLocation = FileLocation.default) ?(workingDirectory = FileLocation.default) ?(environmentVariables = Additional_properties.default) ?(stdin = FileLocation.default) ?(stdout = FileLocation.default) ?(stderr = FileLocation.default) ?(stdoutStderr = FileLocation.default) ?(properties = Properties.default) () = { commandLine; arguments; responseFiles; attachments; startTime; endTime; exitCode; toolNotifications; configurationNotifications; exitCodeDescription; exitSignalName; exitSignalNumber; processStartFailureMessage; toolExecutionSuccessful; machine; account; processId; executableLocation; workingDirectory; environmentVariables; stdin; stdout; stderr; stdoutStderr; properties; } let default = create ~commandLine:"/bin/true" () end module Conversion = struct type t = { tool: Tool.t; invocation: (Invocation.t [@default Invocation.default]); analysisToolLogFiles: (FileLocation.t [@default FileLocation.default]); } [@@deriving yojson] let default = { tool = Tool.default; invocation = Invocation.default; analysisToolLogFiles = FileLocation.default; } end module Edge = struct type t = { id: string; label: (Message.t [@default Message.default]); sourceNodeId: string; targetNodeId: string; properties: (Properties.t [@default Properties.default]) } [@@deriving yojson] end module Node = struct type t = { id: string; label: (string [@default ""]); location: (Location.t [@default Location.default]); children: (t list [@default []]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] end module Edge_traversal = struct type t = { edgeId: string; message: (Message.t [@default Message.default]); finalState: (Additional_properties.t [@default Additional_properties.default]); stepOverEdgeCount: (int [@default 0]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] end module Role: sig include Json_type with type t = private string val analysisTarget: t val attachment: t val responseFile: t val resultFile: t val standardStream: t val traceFile: t val unmodifiedFile: t val modifiedFile: t val addedFile: t val deletedFile:t val renamedFile:t val uncontrolledFile: t end = struct type t = string[@@deriving yojson] let analysisTarget = "analysisTarget" let attachment = "attachment" let responseFile = "responseFile" let resultFile = "resultFile" let standardStream = "standardStream" let traceFile = "traceFile" let unmodifiedFile = "unmodifiedFile" let modifiedFile = "modifiedFile" let addedFile = "addedFile" let deletedFile = "deletedFile" let renamedFile = "renamedFile" let uncontrolledFile = "uncontrolledFile" end module Hash = struct type t = { value: string; algorithm: string } [@@deriving yojson] end module Graph = struct type t = { id : string; description: (Message.t [@default Message.default]); nodes: Node.t list; edges: Edge.t list; properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] end module Graph_dictionary = Json_dictionary(Graph) module GraphTraversal = struct type t = { graphId: string; description: (Message.t [@default Message.default]); initialState: (Additional_properties.t [@default Additional_properties.default]); edgeTraversals: Edge_traversal.t list; properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] end module Replacement = struct type t = { deletedRegion: Region.t; insertedContent: (FileContent.t [@default FileContent.default]) }[@@deriving yojson] end module File = struct type t = { fileLocation: (FileLocation.t [@default FileLocation.default]); parentKey: (string [@default ""]); offset: (int [@default 0]); length: (int [@default 0]); roles: (Role.t list [@default []]); mimeType: (string [@default ""]); contents: (FileContent.t [@default FileContent.default]); encoding: (string [@default ""]); hashes: (Hash.t list [@default []]); lastModifiedTime: (string [@default ""]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] let create ?(fileLocation = FileLocation.default) ?(parentKey = "") ?(offset = 0) ?(length = 0) ?(roles = []) ?(mimeType = "") ?(contents = FileContent.default) ?(encoding = "") ?(hashes = []) ?(lastModifiedTime = "") ?(properties = Properties.default) () = { fileLocation; parentKey; offset; length; roles; mimeType; contents; encoding; hashes; lastModifiedTime; properties } end module FileChange = struct type t = { fileLocation: FileLocation.t; replacements: Replacement.t list }[@@deriving yojson] end module Fix = struct type t = { description: (Message.t [@defaut Message.default]); fileChanges: FileChange.t list; }[@@deriving yojson] end module ExternalFiles = struct type t = { conversion: (FileLocation.t [@default FileLocation.default]); files: (FileLocation.t [@default FileLocation.default]); graphs: (FileLocation.t [@default FileLocation.default]); invocations: (FileLocation.t list [@default []]); logicalLocations: (FileLocation.t [@default FileLocation.default]); resources: (FileLocation.t [@default FileLocation.default]); results: (FileLocation.t [@default FileLocation.default]); }[@@deriving yojson] end module LogicalLocation = struct type t = { name: string; fullyQualifiedName: string; decoratedName: string; parentKey: string; kind: string; }[@@deriving yojson] end module RuleConfigLevel: sig include Json_type with type t = private string val cl_note: t val cl_warning: t val cl_error: t val cl_open: t end = struct type t = string [@@deriving yojson] let cl_note = "note" let cl_warning = "warning" let cl_error = "error" let cl_open = "open" end module RuleConfiguration = struct type t = { enabled: (bool [@default false]); defaultLevel: (RuleConfigLevel.t [@default RuleConfigLevel.cl_open]); parameters: (Properties.t [@default Properties.default]) }[@@deriving yojson] let default = { enabled = false; defaultLevel = RuleConfigLevel.cl_open; parameters = Properties.default; } end module Rule = struct type t = { id: (string [@default ""]); name: (string [@default ""]); shortDescription: (Message.t [@default Message.default]); fullDescription: (Message.t [@default Message.default]); messageStrings: (Additional_properties.t [@default Additional_properties.default]); richMessageStrings: (Additional_properties.t [@default Additional_properties.default]); configuration: (RuleConfiguration.t [@default RuleConfiguration.default]); helpUri: (string [@default ""]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] let default = { id = ""; name = ""; shortDescription = Message.default; fullDescription = Message.default; messageStrings = Additional_properties.default; richMessageStrings = Additional_properties.default; configuration = RuleConfiguration.default; helpUri = ""; properties = Properties.default; } let create ~id ?(name="") ?(shortDescription=Message.default) ?(fullDescription=Message.default) ?(messageStrings=Additional_properties.default) ?(richMessageStrings=Additional_properties.default) ?(configuration=RuleConfiguration.default) ?(helpUri="") ?(properties=Properties.default) () = { id; name; shortDescription; fullDescription; messageStrings; richMessageStrings; configuration; helpUri; properties } end module Rule_dictionary = Json_dictionary(Rule) module Resources = struct type t = { messageStrings: (Additional_properties.t [@default Additional_properties.default]); rules: (Rule_dictionary.t [@default []]); }[@@deriving yojson] let default = { messageStrings = Additional_properties.default; rules = [] } let create ?(messageStrings=Additional_properties.default) ?(rules=[]) () = { messageStrings; rules } end module Result_level: sig type t = private string val notApplicable: t val pass: t val note: t val warning: t val error: t val to_yojson: t -> Yojson.Safe.t val of_yojson: Yojson.Safe.t -> (t,string) result end = struct type t = string[@@deriving yojson] let notApplicable = "notApplicable" let pass = "pass" let note = "note" let warning = "warning" let error = "error" end module Result_suppressionState: sig include Json_type with type t = private string val suppressedInSource: t val suppressedExternally: t end = struct type t = string [@@deriving yojson] let suppressedInSource = "suppressedInSource" let suppressedExternally = "suppressedExternally" end module Result_baselineState: sig include Json_type with type t = private string val bs_new: t val bs_existing: t val bs_absent: t end = struct type t = string [@@deriving yojson] let bs_new = "new" let bs_existing = "existing" let bs_absent = "absent" end (* we can't use Result here, as this would conflict with Ppx_deriving_yojson_runtime.Result that is opened by the code generated by Ppx_deriving_yojson. *) module Sarif_result = struct type t = { ruleId: (string [@default ""]); level: (Result_level.t[@default Result_level.notApplicable]); message: (Message.t [@default Message.default]); analysisTarget: (FileLocation.t [@default FileLocation.default]); locations: (Location.t list [@default []]); instanceGuid: (string [@default ""]); correlationGuid: (string [@default ""]); occurrenceCount: (int [@default 1]); partialFingerprints: (Additional_properties.t [@default Additional_properties.default]); fingerprints: (Additional_properties.t [@default Additional_properties.default]); stacks: (Stack.t list [@default []]); codeFlows: (CodeFlow.t list [@default []]); graphs: (Graph_dictionary.t [@default []]); graphTraversals: (GraphTraversal.t list [@default []]); relatedLocations: (Location.t list [@default []]); suppressionStates: (Result_suppressionState.t list [@default []]); baselineState: (Result_baselineState.t [@default Result_baselineState.bs_absent]); attachments: (Attachment.t list [@default []]); workItemsUris: (string list [@default []]); conversionProvenance: (PhysicalLocation.t list [@default[]]); fixes: (Fix.t list [@default []]); properties: (Properties.t [@default Properties.default]) }[@@deriving yojson] let create ?(ruleId = "") ?(level=Result_level.notApplicable) ?(message=Message.default) ?(analysisTarget=FileLocation.default) ?(locations=[]) ?(instanceGuid="") ?(correlationGuid="") ?(occurrenceCount=1) ?(partialFingerprints=Additional_properties.default) ?(fingerprints=Additional_properties.default) ?(stacks=[]) ?(codeFlows=[]) ?(graphs=[]) ?(graphTraversals=[]) ?(relatedLocations=[]) ?(suppressionStates=[]) ?(baselineState=Result_baselineState.bs_absent) ?(attachments=[]) ?(workItemsUris=[]) ?(conversionProvenance=[]) ?(fixes=[]) ?(properties=Properties.default) () = { ruleId;level; message; analysisTarget; locations; instanceGuid; correlationGuid; occurrenceCount; partialFingerprints; fingerprints; stacks; codeFlows; graphs; graphTraversals; relatedLocations; suppressionStates; baselineState; attachments; workItemsUris; conversionProvenance; fixes; properties } end module VersionControlDetails = struct type t = { uri: string; revisionId: (string [@default ""]); branch: (string [@default ""]); tag: (string [@default ""]); timestamp: (string [@default ""]); properties: (Properties.t [@default Properties.default]); }[@@deriving yojson] end module File_dictionary = Json_dictionary(File) module LogicalLocation_dictionary = Json_dictionary(LogicalLocation) module ColumnKind: sig include Json_type with type t = private string val utf16CodeUnits: t val unicodeCodePoints: t end = struct type t = string [@@deriving yojson] let utf16CodeUnits = "utf16CodeUnits" let unicodeCodePoints = "unicodeCodePoints" end module Run = struct type t = { tool: Tool.t; invocations: (Invocation.t list [@default []]); conversion: (Conversion.t [@default Conversion.default]); versionControlProvenance: (VersionControlDetails.t list [@default []]); originalUriBaseIds: (Additional_properties.t [@default Additional_properties.default]); files: (File_dictionary.t [@default []]); logicalLocations: (LogicalLocation_dictionary.t [@default []]); graphs: (Graph_dictionary.t [@default []]); results: (Sarif_result.t list [@default []]); resources: (Resources.t [@default Resources.default]); instanceGuid: (string [@default ""]); correlationGuid: (string [@default ""]); logicalId: (string [@default ""]); description: (Message.t [@default Message.default]); automationLogicalId: (string [@default ""]); baselineInstanceGuid: (string [@default ""]); architecture: (string [@default ""]); richMessageMimeType: (string [@default "text/markdown;variant=GFM" ]); redactionToken: (string [@default ""]); defaultFileEncoding: (string [@default "utf-8"]); columnKind: (ColumnKind.t [@default ColumnKind.unicodeCodePoints]); properties: (Properties.t [@default Properties.default]); } [@@deriving yojson] let create ~tool ~invocations ?(conversion=Conversion.default) ?(versionControlProvenance=[]) ?(originalUriBaseIds=Additional_properties.default) ?(files=[]) ?(logicalLocations=[]) ?(graphs=[]) ?(results=[]) ?(resources=Resources.default) ?(instanceGuid="") ?(correlationGuid="") ?(logicalId="") ?(description=Message.default) ?(automationLogicalId="") ?(baselineInstanceGuid="") ?(architecture="") ?(richMessageMimeType="text/markdown;variant=GFM") ?(redactionToken="") ?(defaultFileEncoding="utf-8") ?(columnKind=ColumnKind.unicodeCodePoints) ?(properties=Properties.default) () = { tool; invocations; conversion; versionControlProvenance; originalUriBaseIds; files; logicalLocations; graphs; results; resources; instanceGuid; correlationGuid; logicalId; description; automationLogicalId; baselineInstanceGuid; architecture; richMessageMimeType; redactionToken; defaultFileEncoding; columnKind; properties } end module Schema = struct type t = { schema: (Uri.t [@default Uri.sarif_github]) [@key "$schema"]; version: Version.t; runs: Run.t list } [@@deriving yojson] let create ?(schema=Uri.sarif_github) ?(version=Version.v2_0_0) ~runs () = { schema; version; runs } end frama-c-20.0-Calcium/src/plugins/markdown-report/sarif_gen.ml0000666000000000000000000001552713571573400021117 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Sarif let frama_c_sarif = let name = "frama-c" in let version = Config.version_and_codename in let semanticVersion = Config.version in let fullName = name ^ "-" ^ version in let downloadUri = "https://frama-c.com/download.html" in Tool.create ~name ~version ~semanticVersion ~fullName ~downloadUri () let get_remarks () = let f = Mdr_params.Remarks.get () in if f <> "" then Parse_remarks.get_remarks f else Datatype.String.Map.empty let get_remark remarks label = match Datatype.String.Map.find_opt label remarks with | None -> [] | Some l -> l let command_line () = Array.to_list Sys.argv module Analysis_cmdline = State_builder.Ref(Datatype.List(Datatype.String)) (struct let name = "Sarif_gen.Analysis_cmdline" let dependencies = [] let default = command_line end) let gen_invocation () = let cl = Analysis_cmdline.get () in let commandLine = String.concat " " cl in let arguments = List.tl cl in Invocation.create ~commandLine ~arguments () let gen_remark alarm = let open Markdown in [ Block [ Text (plain (Printf.sprintf "This alarms represents a potential %s." (Alarms.get_description alarm) ) ) ] ] let level_of_status = let open Property_status.Feedback in let open Sarif.Result_level in function | Never_tried -> notApplicable | Considered_valid | Valid | Valid_under_hyp | Valid_but_dead -> pass | Unknown | Unknown_but_dead -> warning | Invalid | Invalid_under_hyp | Invalid_but_dead -> error | Inconsistent -> note let make_message alarm annot remark = let open Markdown in let name = Alarms.get_name alarm in let text = name ^ "." in let kind = plain (name ^ ":") in let descr = codeblock ~lang:"acsl" "%a" Printer.pp_code_annotation annot in let summary = Block (Text kind :: descr) in let markdown = match remark with | [] -> summary :: gen_remark alarm | _ -> summary :: remark in let richText = String.trim (Format.asprintf "@[%a@]" (Markdown.pp_elements ~page:"") markdown) in Message.create ~text ~richText () let gen_results remarks = let treat_alarm _e kf s ~rank:_ alarm annot (i, rules, content) = let prop = Property.ip_of_code_annot_single kf s annot in let ruleId = Alarms.get_name alarm in let rules = Datatype.String.Map.add ruleId (Alarms.get_description alarm) rules in let label = "Alarm-" ^ string_of_int i in let level = level_of_status (Property_status.Feedback.get prop) in let remark = get_remark remarks label in let message = make_message alarm annot remark in let locations = [ Location.of_loc (Cil_datatype.Stmt.loc s) ] in let res = Sarif_result.create ~level ~ruleId ~message ~locations () in (i+1, rules, res :: content) in let _, rules, content = Alarms.fold treat_alarm (0, Datatype.String.Map.empty,[]) in rules, List.rev content let is_alarm = function | Property.(IPCodeAnnot { ica_ca }) -> Extlib.has_some (Alarms.find ica_ca) | _ -> false let make_ip_message ip = let text = Format.asprintf "@[%a.@]" Property.short_pretty ip in Message.plain_text ~text () let gen_status ip = let status = Property_status.Feedback.get ip in let level = level_of_status status in let locations = [ Location.of_loc (Property.location ip) ] in let message = make_ip_message ip in Sarif_result.create ~level ~locations ~message () let gen_statuses () = let f ip content = if is_alarm ip then content else (gen_status ip) :: content in List.rev (Property_status.fold f []) let gen_files () = let add_src_file f = let key = Filename.chop_extension (Filename.basename f) in let fileLocation = FileLocation.create ~uri:(Filepath.normalize f) () in let roles = [ Role.analysisTarget ] in let mimeType = "text/x-csrc" in key, File.create ~fileLocation ~roles ~mimeType () in List.map add_src_file (Kernel.Files.get ()) let add_rule id desc l = let text = desc ^ "." in let shortDescription = Message.plain_text ~text () in let rule = Rule.create ~id ~shortDescription () in (id, rule) :: l let make_rule_dictionary rules = Datatype.String.Map.fold add_rule rules [] let gen_run remarks = let tool = frama_c_sarif in let invocations = [gen_invocation ()] in let rules, results = gen_results remarks in let user_annot_results = gen_statuses () in let rules = match user_annot_results with | [] -> rules | _ -> Datatype.String.Map.add "user-spec" "User written ACSL specification" rules in let rules = make_rule_dictionary rules in let resources = Resources.create ~rules () in let results = results @ user_annot_results in let files = gen_files () in Run.create ~tool ~invocations ~results ~resources ~files () let generate () = let remarks = get_remarks () in let runs = [ gen_run remarks ] in let json = Schema.create ~runs () |> Schema.to_yojson in let file = Mdr_params.Output.get () in if file = "" then Log.print_on_output (fun fmt -> Yojson.Safe.pretty_print fmt json) else try Command.write_file file (fun out -> Yojson.Safe.pretty_to_channel ~std:true out json) ; Mdr_params.result "Report %s generated" file with Sys_error s -> Mdr_params.abort "Unable to generate %s (%s)" file s frama-c-20.0-Calcium/src/plugins/markdown-report/sarif_gen.mli0000666000000000000000000000322513571573400021260 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** generate a sarif json object. *) val generate: unit -> unit frama-c-20.0-Calcium/src/plugins/markdown-report/share/0000777000000000000000000000000013571573400017720 5ustar frama-c-20.0-Calcium/src/plugins/markdown-report/share/acsl.xml0000666000000000000000000000627413571573400021375 0ustar allocates assert assigns assumes axiom axiomatic behavior behaviors boolean breaks complete continues data decreases disjoint ensures exit_behavior frees ghost global inductive integer invariant lemma logic loop model predicate reads real requires returns sizeof strong struct terminates type union variant frama-c-20.0-Calcium/src/plugins/metrics/0000777000000000000000000000000013571573400015131 5ustar frama-c-20.0-Calcium/src/plugins/metrics/Metrics.mli0000666000000000000000000000515013571573400017243 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Metrics plugin. *) (** See {!Metrics_coverage}. *) module Metrics_coverage : sig val compute_syntactic: libc:bool -> Kernel_function.t -> Cil_datatype.Varinfo.Set.t (**/**) val compute_semantic: libc:bool -> Cil_datatype.Varinfo.Set.t end (** See {!Metrics_base}. *) module Metrics_base : sig module OptionKf : Datatype.S_with_collections with type t = Kernel_function.t option module BasicMetrics : sig type t = { cfile_name : Filepath.Normalized.t; cfunc : Kernel_function.t option; cslocs: int; cifs: int; cloops: int; ccalls: int; cgotos: int; cassigns: int; cexits: int; cfuncs: int; cptrs: int; cdecision_points: int; cglob_vars: int; ccyclo: int; } end end (** See {!Metrics_cilast}. *) module Metrics_cilast : sig val get_metrics_map: libc:bool -> (Metrics_base.BasicMetrics.t Metrics_base.OptionKf.Map.t) Datatype.Filepath.Map.t end (* Local Variables: compile-command: "make -C ../../.." End: *) frama-c-20.0-Calcium/src/plugins/metrics/css_html.ml0000666000000000000000000000733613571573400017310 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let css = "\ body {\ display:block;\ position: relative;\ left: 5%;\ width: 90%;\ font-family: Georgia, Times, serif;\ font-size: 10pt; /* base size */\ min-height: 30em;\ background: #ffffff;\ color: #444444;\ }\ \ h1 {\ font-family: Optima, Verdana, Arial, sans;\ font-size: 1.6em;\ font-weight: normal;\ color: black;\ margin: 0.4em 0em 0.4em 0em;\ padding: 0.4em 0em 0em 1em;\ border-bottom: thin solid #404040;\ }\ \ h2 {\ font-family: Optima, Verdana, Arial, sans;\ font-size: 1.2em;\ font-weight: normal;\ color: black;\ margin: 0.4em 0em 0.4em 0em;\ padding: 0.4em 0em 0em 1em;\ border-bottom: thin dotted #404040;\ }\ \ h3 {\ font-family: Optima, Verdana, Arial, sans;\ font-size: 1.2em;\ font-weight: normal;\ color: black;\ margin: 0.4em 0em 0.4em 0em;\ padding: 0.4em 0em 0em 1em;\ }\ \ td {\ text-align: center;\ border: thin solid black; \ }\ \ th { \ text-align: center;\ font-weight: normal;\ color: black;\ border: thin solid black; \ padding: 3pt;\ background-color: #bfb4b4;\ }\ \ td.entry { \ text-align: left;\ font-weight: normal;\ color: black;\ border: thin solid black; \ padding: 3pt;\ background-color: #e8e8e8 ;\ }\ td.stat { \ text-align: center;\ color: black;\ border: thin solid black; \ padding: 3pt;\ width: 20%; \ }\ \ td.result { \ text-align: center;\ color: black;\ border: thin solid black; \ padding: 3pt;\ background-color: #AFC7C7 ;\ }\ \ tr {}\ \ caption {\ caption-side: bottom;\ }\ \ table {\ border: medium solid black;\ width: 90%; \ }\ \ div.graph {\ text-align: center;\ }\ \ ul.horizontal {\ padding:0;\ margin:0;\ list-style-type:none;\ }\ \ li.horizontal {\ margin-left:1.5em;\ float:left; /*pour IE*/\ }\ \ span {\ font-weight: bold;\ }\ \ a.varinfo, span.vdecl a.varinfo_fun {\ text-decoration: none;\ }\ \ a.varinfo, a.varinfo_fun {\ color: #000;\ }\ \ h3.back {\ font-family: Optima, Verdana, Arial, sans;\ padding-top: 2em;\ }\ \ h3.back a {\ color:black;\ }\ " frama-c-20.0-Calcium/src/plugins/metrics/metrics_acsl.ml0000666000000000000000000003027713571573400020144 0ustar (**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type acsl_stats = { mutable f_requires: int; (** number of requires in function contracts *) mutable s_requires: int; (** number of requires in statement contracts *) mutable f_ensures: int; mutable s_ensures: int; mutable f_behaviors: int; mutable s_behaviors: int; mutable f_assumes: int; mutable s_assumes: int; mutable f_assigns: int; mutable s_assigns: int; (** does not include loop assigns. *) mutable f_froms: int; mutable s_froms: int; (** does not include loop dependencies. *) mutable invariants: int; mutable loop_assigns: int; mutable loop_froms: int; mutable variants: int; mutable asserts: int; } let empty_acsl_stat () = { f_requires = 0; s_requires = 0; f_ensures = 0; s_ensures = 0; f_behaviors = 0; s_behaviors = 0; f_assumes = 0; s_assumes = 0; f_assigns = 0; s_assigns = 0; f_froms = 0; s_froms = 0; invariants = 0; loop_assigns = 0; loop_froms = 0; variants = 0; asserts = 0; } let incr_f_requires stat = stat.f_requires <- stat.f_requires + 1 let incr_s_requires stat = stat.s_requires <- stat.s_requires + 1 let incr_f_ensures stat = stat.f_ensures <- stat.f_ensures + 1 let incr_s_ensures stat = stat.s_ensures <- stat.s_ensures + 1 let incr_f_behaviors stat = stat.f_behaviors <- stat.f_behaviors + 1 let incr_s_behaviors stat = stat.s_behaviors <- stat.s_behaviors + 1 let incr_f_assumes stat = stat.f_assumes <- stat.f_assumes + 1 let incr_s_assumes stat = stat.s_assumes <- stat.s_assumes + 1 let incr_f_assigns stat = stat.f_assigns <- stat.f_assigns + 1 let incr_s_assigns stat = stat.s_assigns <- stat.s_assigns + 1 let incr_f_froms stat = stat.f_froms <- stat.f_froms + 1 let incr_s_froms stat = stat.s_froms <- stat.s_froms + 1 let incr_invariants stat = stat.invariants <- stat.invariants + 1 let incr_loop_assigns stat = stat.loop_assigns <- stat.loop_assigns + 1 let incr_loop_froms stat = stat.loop_froms <- stat.loop_froms + 1 let incr_variants stat = stat.variants <- stat.variants + 1 let incr_asserts stat = stat.asserts <- stat.asserts + 1 let pretty_acsl_stats fmt stat = Format.fprintf fmt "@[requires: %d total, %d in function contracts,\ %d in statement contracts@;\ ensures: %d total, %d in function contracts, %d in statement contracts@;\ behaviors: %d total, %d in function contracts, %d in statement contracts@;\ assumes: %d total, %d in function contracts, %d in statement contracts@;\ assigns: %d total, %d in function contracts, %d in statement contracts@;\ froms: %d total, %d in function contracts, %d in statement contracts@;\ invariants: %d@;loop assigns: %d@;loop froms: %d@;variants: %d@;\ asserts: %d@;@]" (stat.f_requires + stat.s_requires) stat.f_requires stat.s_requires (stat.f_ensures + stat.s_ensures) stat.f_ensures stat.s_ensures (stat.f_behaviors + stat.s_behaviors) stat.f_behaviors stat.s_behaviors (stat.f_assumes + stat.s_assumes) stat.f_assumes stat.s_assumes (stat.f_assigns + stat.s_assigns) stat.f_assigns stat.s_assigns (stat.f_froms + stat.s_froms) stat.f_froms stat.s_froms stat.invariants stat.loop_assigns stat.loop_froms stat.variants stat.asserts let pretty_acsl_stats_html fmt stat = Format.fprintf fmt "@[@{

    Contract elements@}@;@{@;\ @{@{@;@{@;@{@;@{@;@{@;@{@;@{
    @}\ @{total@}@{function contract@}@{statement contract@}@}@;\ @{
    requires@}@;\ @{%d@}@;@{%d@}@;\ @{%d@}@}@;\ @{
    requires@}@;\ @{%d@}@;@{%d@}@;\ @{%d@}@}@;\ @{
    requires@}@;\ @{%d@}@;@{%d@}@;\ @{%d@}@}@;\ @{
    requires@}@;\ @{%d@}@;@{%d@}@;\ @{%d@}@}@;\ @{
    requires@}@;\ @{%d@}@;@{%d@}@;\ @{%d@}@}@;\ @{
    requires@}@;\ @{%d@}@;@{%d@}@;\ @{%d@}@}@}@;\ @{

    Simple code annotations@}@{@;\ @{@{@{@{@{@{
    invariants@}@{%d@}@}@;\ @{
    loop assigns@}@{%d@}@}@;\ @{
    loop froms@}@{%d@}@}@;\ @{
    variants@}@{%d@}@}@;\ @{
    asserts@}@{%d@}@}@;\ @}@]" (stat.f_requires + stat.s_requires) stat.f_requires stat.s_requires (stat.f_ensures + stat.s_ensures) stat.f_ensures stat.s_ensures (stat.f_behaviors + stat.s_behaviors) stat.f_behaviors stat.s_behaviors (stat.f_assumes + stat.s_assumes) stat.f_assumes stat.s_assumes (stat.f_assigns + stat.s_assigns) stat.f_assigns stat.s_assigns (stat.f_froms + stat.s_froms) stat.f_froms stat.s_froms stat.invariants stat.loop_assigns stat.loop_froms stat.variants stat.asserts module Acsl_stats = Datatype.Make( struct type t = acsl_stats let reprs = [empty_acsl_stat ()] let name = "Metrics_acsl.acsl_stats" include Datatype.Serializable_undefined let pretty = pretty_acsl_stats end) module Global_acsl_stats = State_builder.Ref(Acsl_stats) (struct let name = "Metrics_acsl.Global_acsl_stats" let dependencies = [ Ast.self; Annotations.code_annot_state; Annotations.funspec_state; Annotations.global_state ] let default = empty_acsl_stat end) module Functions_acsl_stats = State_builder.Hashtbl (Kernel_function.Hashtbl) (Acsl_stats) (struct let name = "Metrics_acsl.Functions_acsl_stats" let dependencies = [Ast.self; Annotations.code_annot_state; Annotations.funspec_state] let size = 17 end) let get_kf_stats kf = try Functions_acsl_stats.find kf with Not_found -> empty_acsl_stat() module Computed = State_builder.False_ref (struct let name = "Metrics_acsl.Computed" let dependencies = [ Global_acsl_stats.self; Functions_acsl_stats.self] end) let treat_behavior local_stats ki b = let incr_behaviors = if ki = Kglobal then incr_f_behaviors else incr_s_behaviors in let incr_requires = if ki = Kglobal then incr_f_requires else incr_s_requires in let incr_ensures = if ki = Kglobal then incr_f_ensures else incr_s_ensures in let incr_assumes = if ki = Kglobal then incr_f_assumes else incr_s_assumes in let incr_assigns = if ki = Kglobal then incr_f_assigns else incr_s_assigns in let incr_froms = if ki = Kglobal then incr_f_froms else incr_s_froms in let incr_all f _ = f local_stats; f (Global_acsl_stats.get()) in incr_all incr_behaviors (); List.iter (incr_all incr_requires) b.b_requires; List.iter (incr_all incr_ensures) b.b_post_cond; List.iter (incr_all incr_assumes) b.b_assumes; (match b.b_assigns with | WritesAny -> () | Writes l -> incr_all incr_assigns (); List.iter (function | (_,FromAny) -> () | (_,From _) -> incr_all incr_froms ()) l) (*TODO: allocation *) let add_function_contract_stats kf = let local_stats = get_kf_stats kf in let treat_behavior _ b = treat_behavior local_stats Kglobal b in Annotations.iter_behaviors treat_behavior kf let add_code_annot_stats stmt _ ca = let kf = Kernel_function.find_englobing_kf stmt in let local_stats = get_kf_stats kf in let incr_all f = f local_stats; f (Global_acsl_stats.get()) in match ca.annot_content with | AAssert _ -> incr_all incr_asserts | AStmtSpec (_,spec) -> List.iter (treat_behavior local_stats (Kstmt stmt)) spec.spec_behavior | AInvariant _ -> incr_all incr_invariants | AVariant _ -> incr_all incr_variants | AAssigns (_,WritesAny) -> () | AAssigns (_,Writes l) -> incr_all incr_loop_assigns; List.iter (function (_,FromAny) -> () | (_,From _) -> incr_all incr_loop_froms) l | AAllocation _ -> () (* TODO *) | APragma _ | AExtended _ -> () let compute () = if not (Computed.get()) then begin Ast.compute(); Annotations.iter_all_code_annot add_code_annot_stats; Globals.Functions.iter add_function_contract_stats; Computed.set true; end let get_global_stats () = compute (); Global_acsl_stats.get () let dump_html_global fmt = pretty_acsl_stats_html fmt (get_global_stats()) let dump_html_by_function fmt = compute (); Functions_acsl_stats.iter (fun kf stats -> Format.fprintf fmt "@{

    Function %a@}@;%a" Kernel_function.pretty kf pretty_acsl_stats_html stats) let dump_acsl_stats fmt = Metrics_base.mk_hdr 1 fmt "ACSL Statistics"; Format.pp_print_newline fmt (); if Metrics_parameters.ByFunction.get () then begin compute (); Functions_acsl_stats.iter (fun kf stats -> let kf_name = Format.asprintf "%a" Kernel_function.pretty kf in Format.fprintf fmt "@[%a@;%a@]@;" (Metrics_base.mk_hdr 2) kf_name pretty_acsl_stats stats) end else pretty_acsl_stats fmt (get_global_stats()) let dump_acsl_stats_html fmt = Transitioning.Format.pp_set_formatter_stag_functions fmt Metrics_base.html_stag_functions; Format.fprintf fmt "@[ @ \ @{@ \ @{@ \ @{%s@}@ \ <meta content=\"text/html; charset=iso-8859-1\" \ http-equiv=\"Content-Type\"/>@ \ @{<style type=\"text/css\">%s@}@ \ @}@ \ @{<body>\ @[<v 2>@ \ @{<h1>%s@}@;\ %t@]@}@}@]@?" "ACSL Metrics" Css_html.css (if Metrics_parameters.ByFunction.get () then "Detailed ACSL statistics" else "Global ACSL statistics") (if Metrics_parameters.ByFunction.get () then dump_html_global else dump_html_by_function) let dump () = let out = Metrics_parameters.OutputFile.get () in if out <> "" then begin try let chan = open_out out in let fmt = Format.formatter_of_out_channel chan in (match Metrics_base.get_file_type out with | Metrics_base.Html -> dump_acsl_stats_html fmt | Metrics_base.Text -> dump_acsl_stats fmt); close_out chan with Sys_error s -> Metrics_parameters.abort "Cannot open file %s (%s)" out s end else Metrics_parameters.result "%t" dump_acsl_stats ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_acsl.mli�������������������������������������������0000666�0000000�0000000�00000006527�13571573400�020316� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Visitor to compute various metrics about annotations *) type acsl_stats = { mutable f_requires: int; (** number of requires in function contracts *) mutable s_requires: int; (** number of requires in statement contracts *) mutable f_ensures: int; mutable s_ensures: int; mutable f_behaviors: int; mutable s_behaviors: int; mutable f_assumes: int; mutable s_assumes: int; mutable f_assigns: int; mutable s_assigns: int; (** does not include loop assigns. *) mutable f_froms: int; mutable s_froms: int; (** does not include loop dependencies. *) mutable invariants: int; mutable loop_assigns: int; mutable loop_froms: int; mutable variants: int; mutable asserts: int; } val empty_acsl_stat: unit -> acsl_stats val incr_f_requires: acsl_stats -> unit val incr_s_requires: acsl_stats -> unit val incr_f_ensures: acsl_stats -> unit val incr_s_ensures: acsl_stats -> unit val incr_f_behaviors: acsl_stats -> unit val incr_s_behaviors: acsl_stats -> unit val incr_f_assumes: acsl_stats -> unit val incr_s_assumes: acsl_stats -> unit val incr_f_assigns: acsl_stats -> unit val incr_s_assigns: acsl_stats -> unit val incr_f_froms: acsl_stats -> unit val incr_s_froms: acsl_stats -> unit val incr_invariants: acsl_stats -> unit val incr_loop_assigns: acsl_stats -> unit val incr_loop_froms: acsl_stats -> unit val incr_variants: acsl_stats -> unit val incr_asserts: acsl_stats -> unit val pretty_acsl_stats: Format.formatter -> acsl_stats -> unit val pretty_acsl_stats_html: Format.formatter -> acsl_stats -> unit val get_global_stats: unit -> acsl_stats val get_kf_stats: Kernel_function.t -> acsl_stats val dump_acsl_stats: Format.formatter -> unit val dump_acsl_stats_html: Format.formatter -> unit val dump: unit -> unit �������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_base.ml��������������������������������������������0000666�0000000�0000000�00000025210�13571573400�020123� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* vname, vaddrof *) ;; (* Formatting html with Format.formatters *) let html_stag_functions = let mark_open_stag t = let t = Transitioning.Format.string_of_stag t in Format.sprintf "<%s>" t and mark_close_stag t = let t = Transitioning.Format.string_of_stag t in try let index = String.index t ' ' in Format.sprintf "</%s>" (String.sub t 0 index) with | Not_found -> Format.sprintf "</%s>" t and print_open_stag _ = () and print_close_stag _ = () in { Transitioning.Format.mark_open_stag; mark_close_stag; print_open_stag; print_close_stag; } ;; (* Utility function to have underlines the same length as the title. Underlines follow reStructuredText header conventions. *) let mk_hdr level ppf hdr_strg = let c = match level with | 1 -> '=' | 2 -> '-' | 3 -> '~' | _ -> assert false in let len = String.length hdr_strg in let underline = String.make len c in Format.fprintf ppf "@[<v 0>%s@ %s@]" hdr_strg underline ; ;; module OptionKf = Datatype.Option_with_collections (Cil_datatype.Kf) (struct let module_name = "OptionKf" end) (** Defining base metrics and operations on those *) module BasicMetrics = struct (** Record type to compute cyclomatic complexity *) type t = { cfile_name : Datatype.Filepath.t; cfunc : OptionKf.t; cslocs: int; cifs: int; cloops: int; ccalls: int; cgotos: int; cassigns: int; cexits: int; cfuncs: int; cptrs: int; cdecision_points: int; cglob_vars: int; ccyclo: int; } ;; let empty_metrics = { cfile_name = Datatype.Filepath.dummy; cfunc = None; cslocs = 0; cifs = 0; cloops = 0; ccalls = 0; cgotos = 0; cassigns = 0; cexits = 0; cfuncs = 0; cptrs = 0; cdecision_points = 0; cglob_vars = 0; ccyclo = 0; } ;; let apply_then_set f metrics = metrics := f !metrics ;; let incr_slocs metrics = { metrics with cslocs = succ metrics.cslocs ;} ;; let incr_assigns metrics = { metrics with cassigns = succ metrics.cassigns ;} ;; let incr_calls metrics = { metrics with ccalls = succ metrics.ccalls ;} ;; let incr_exits metrics = { metrics with cexits = succ metrics.cexits ;} ;; let incr_funcs metrics = { metrics with cfuncs = succ metrics.cfuncs ;} ;; let incr_gotos metrics = { metrics with cgotos = succ metrics.cgotos ;} ;; let incr_ifs metrics = { metrics with cifs = succ metrics.cifs ;} ;; let incr_loops metrics = { metrics with cloops = succ metrics.cloops ;} ;; let incr_ptrs metrics = { metrics with cptrs = succ metrics.cptrs ;} ;; let incr_dpoints metrics = { metrics with cdecision_points = succ metrics.cdecision_points ;} ;; let incr_glob_vars metrics = { metrics with cglob_vars = succ metrics.cglob_vars ;} ;; let set_cyclo metrics cyclo = { metrics with ccyclo = cyclo ;} ;; (* Compute cyclomatic complexity of a given metrics record *) let compute_cyclo metrics = metrics.cdecision_points - metrics.cexits + 2 ;; let labels = [ "Sloc"; "Decision point"; "Global variables"; "If"; "Loop"; "Goto"; "Assignment"; "Exit point"; "Function"; "Function call"; "Pointer dereferencing"; "Cyclomatic complexity"; ] ;; let str_values metrics = List.map string_of_int [ metrics.cslocs; metrics.cdecision_points; metrics.cglob_vars; metrics.cifs; metrics.cloops; metrics.cgotos; metrics.cassigns; metrics.cexits; metrics.cfuncs; metrics.ccalls; metrics.cptrs; metrics.ccyclo; ] ;; let to_list metrics = List.map2 (fun x y -> [ x; y; ]) labels (str_values metrics) ;; let pp_func_or_none = Pretty_utils.pp_opt ~none:"<none>" Kernel_function.pretty (* Pretty print metrics as text eg. in stdout *) let pp_base_metrics fmt metrics = let heading = if metrics.cfile_name = Datatype.Filepath.dummy && metrics.cfunc = None then (* It is a global metrics *) "Global metrics" else Format.asprintf "Stats for function <%a/%a>" Datatype.Filepath.pretty metrics.cfile_name pp_func_or_none metrics.cfunc in Format.fprintf fmt "@[<v 0>%a @ %a@]" (mk_hdr 1) heading ((fun l1 ppf l2 -> List.iter2 (fun x y -> Format.fprintf ppf "%s = %s@ " x y) l1 l2) labels) (str_values metrics) ;; (* Dummy utility functions for pretty printing simple types *) let pp_int fmt n = Format.fprintf fmt "%d" n ;; type cell_type = | Classic | Entry ;; let cell_type_to_string = function | Entry -> "entry" | Classic -> "classic" ;; let pp_cell_type_html fmt cell_type = Format.fprintf fmt "class=\"%s\"" (cell_type_to_string cell_type) ;; (* Pretty print a HTML cell given a pretty printing function [pp_fun] and a value [pp_arg] *) let pp_cell cell_type pp_fun fmt pp_arg = Format.fprintf fmt "@{<td %a>%a@}" pp_cell_type_html cell_type pp_fun pp_arg ;; let pp_cell_default = pp_cell Classic;; let pp_base_metrics_as_html_row fmt metrics = Format.fprintf fmt "\ @[<v 0>\ @{<tr>@[<v 2>@ \ @[<v 0>%a@ %a@ %a@ %a@ %a@ %a@ %a@ %a@ %a@ @]@]\ @}@ @]" (pp_cell Entry pp_func_or_none) metrics.cfunc (pp_cell_default pp_int) metrics.cifs (pp_cell_default pp_int) metrics.cassigns (pp_cell_default pp_int) metrics.cloops (pp_cell_default pp_int) metrics.ccalls (pp_cell_default pp_int) metrics.cgotos (pp_cell_default pp_int) metrics.cptrs (pp_cell_default pp_int) metrics.cexits (pp_cell_default pp_int) metrics.ccyclo ;; end (* End of BasicMetrics *) (** {3 Filename utilities} *) exception No_suffix;; let get_suffix filename = try let slen = String.length filename in let last_idx = pred slen in let last_dot_idx = String.rindex_from filename last_idx '.' in if last_dot_idx < last_idx then String.sub filename (succ last_dot_idx) (slen - last_dot_idx - 1) else "" with | Not_found -> raise No_suffix ;; type output_type = | Html | Text ;; let get_file_type filename = try match get_suffix filename with | "html" | "htm" -> Html | "txt" | "text" -> Text | s -> Metrics_parameters.fatal "Unknown file extension %s. Cannot produce output.@." s with | No_suffix -> Metrics_parameters.fatal "File %s has no suffix. Cannot produce output.@." filename module VarinfoByName = struct type t = Cil_types.varinfo let compare v1 v2 = Transitioning.Stdlib.compare v1.vname v2.vname end (** Map and sets of varinfos sorted by name (and not by ids) *) module VInfoMap = FCMap.Make (VarinfoByName) module VInfoSet = FCSet.Make (VarinfoByName) (** Other pretty-printing and formatting utilities *) let pretty_set fmt s = Format.fprintf fmt "@["; VInfoMap.iter (fun f n -> Format.fprintf fmt "%s %s(%d call%s);@ " f.Cil_types.vname (if f.vaddrof then "(address taken) " else "") n (if n > 1 then "s" else "")) s; Format.fprintf fmt "@]" let pretty_extern_vars fmt s = Pretty_utils.pp_iter ~pre:"@[" ~suf:"@]" ~sep:";@ " VInfoSet.iter Printer.pp_varinfo fmt s let is_in_libc attrs = Cil.hasAttribute "fc_stdlib" attrs || Cil.hasAttribute "fc_stdlib_generated" attrs let is_entry_point vinfo times_called = times_called = 0 && not vinfo.vaddrof && not (is_in_libc vinfo.vattr) ;; let number_entry_points fs = VInfoMap.fold (fun fvinfo n acc -> if is_entry_point fvinfo n then succ acc else acc) fs 0 ;; let pretty_entry_points fmt fs = let print fmt = VInfoMap.iter (fun fvinfo n -> if is_entry_point fvinfo n then Format.fprintf fmt "%s;@ " fvinfo.vname) in Format.fprintf fmt "@[<hov 1>%a@]" print fs; ;; (* Utilities for CIL ASTs *) let file_of_vinfodef fvinfo = let kf = Globals.Functions.get fvinfo in let decl_loc1, _decl_loc2 = match kf.fundec with | Definition (_, loc) -> loc | Declaration (_, _, _, loc) -> loc in decl_loc1.Filepath.pos_path ;; let file_of_fundef (fun_dec: Cil_types.fundec) = file_of_vinfodef fun_dec.svar ;; (* Utilities for Cabs ASTs *) let extract_fundef_name sname = match sname with | _spec, (the_name, _, _, _) -> the_name ;; let kf_of_cabs_name sname = match sname with | _spec, (the_name, _, _, _) -> Globals.Functions.find_by_name the_name let get_filename fdef = match fdef with | Cabs.FUNDEF(_, _, _, (loc1, _), _loc2) -> loc1.Filepath.pos_path | _ -> assert false ;; let consider_function ~libc vinfo = not (!Db.Value.mem_builtin vinfo.vname || Ast_info.is_frama_c_builtin vinfo.vname || Cil.is_unused_builtin vinfo ) && (libc || not (is_in_libc vinfo.vattr)) let consider_variable ~libc vinfo = not (Cil.hasAttribute "FRAMA_C_MODEL" vinfo.vattr) && (libc || not (is_in_libc vinfo.vattr)) let float_to_string f = let s = Format.sprintf "%F" f in let len = String.length s in let plen = pred len in if s.[plen] = '.' then String.sub s 0 plen else Format.sprintf "%.2f" f (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_base.mli�������������������������������������������0000666�0000000�0000000�00000015243�13571573400�020301� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Tag functions handling html tags for Format *) val html_stag_functions : Transitioning.Format.formatter_stag_functions;; (** mk_hdr [level] [ppf] [hdr_strg] produces a title from [hdr_strg] with an underline of the same length. The character of the underline is set according to [level]: - level 1 headers are underlined by '=' - level 2 headers by '-' - level 3 headers by '~' This function is supposed to follow reStructuredText's conventions. *) val mk_hdr : int -> Format.formatter -> string -> unit;; module OptionKf : Datatype.S_with_collections with type t = Kernel_function.t option module BasicMetrics : sig (** Simple type of metrics. *) type t = { cfile_name : Datatype.Filepath.t ; (** Filename *) cfunc : OptionKf.t; (** Function name if applicable ([None] for global metrics) *) cslocs: int ; (** Lines of code w.r.t. statements *) cifs: int ; (** If / cases of switch *) cloops: int ; (** Loops: for, while, do...while *) ccalls: int ; (** Function calls *) cgotos: int ; (** Gotos *) cassigns: int ; (** Assignments *) cexits: int ; (** Exit points: return *) cfuncs: int ; (** Functions defined: 1 in the case of a single function, possibly more for a file.*) cptrs: int ; (** Access to pointers *) cdecision_points: int ; (** Decision points of the program: ifs, switch cases, exception handlers, ... *) cglob_vars: int; (** Global variables *) ccyclo: int; (** Cyclomatic complexity *) } (** Helpers for metrics purposes for single increment steps *) val incr_funcs : t -> t ;; val incr_slocs : t -> t ;; val incr_ptrs : t -> t ;; val incr_ifs : t -> t ;; val incr_dpoints : t -> t ;; val incr_loops : t -> t ;; val incr_gotos : t -> t ;; val incr_exits : t -> t ;; val incr_assigns : t -> t ;; val incr_calls : t -> t ;; val incr_glob_vars : t -> t ;; val set_cyclo : t -> int -> t ;; (** Update a reference from a pure functional function. Used in particular in combination with helper functions above. *) val apply_then_set : (t -> t) -> t ref -> unit ;; (** Initial empty values for metrics computing. *) val empty_metrics: t;; (** Compute cyclomatic complexity from base_metrics record type. *) val compute_cyclo: t -> int;; (** Matrix-like representation of the record in "Title: value" style *) val to_list : t -> string list list ;; (** Pretty printers for base metrics as text or html. *) val pp_base_metrics: Format.formatter -> t -> unit;; val pp_base_metrics_as_html_row: Format.formatter -> t -> unit;; end ;; (** Local varinfo map and set where the comparison function is the lexicographic one on their respective names. *) module VInfoMap: FCMap.S with type key = Cil_types.varinfo module VInfoSet: FCSet.S with type elt = Cil_types.varinfo ;; (** Pretty print a varinfo set, with some additional information about the varinfo. *) val pretty_set : Format.formatter -> int VInfoMap.t -> unit ;; val pretty_extern_vars: Format.formatter -> VInfoSet.t -> unit (** Handling entry points informations *) val number_entry_points : int VInfoMap.t -> int ;; val pretty_entry_points : Format.formatter -> int VInfoMap.t -> unit ;; (** Get the filename where the definition of a varinfo occurs *) val file_of_vinfodef: Cil_types.varinfo -> Datatype.Filepath.t;; (** Get the filename containing the function definition *) val file_of_fundef: Cil_types.fundec -> Datatype.Filepath.t;; val extract_fundef_name: Cabs.single_name -> string;; val kf_of_cabs_name: Cabs.single_name -> Kernel_function.t;; val get_filename: Cabs.definition -> Datatype.Filepath.t;; (** Type of the generated report file. Automatically set according to the file extension. *) type output_type = | Html | Text ;; (** get_file_type [extension] sets the output type according to [extension]. Raises an error if [extension] is not among supported extensions or is empty. *) val get_file_type: string -> output_type;; (** consider_function [vinfo] returns false if the varinfo is not a function we are interested in. For example, builtins should not be part of the analysis and return false. If [libc] is false, do not consider functions from the Frama-C libc. Skip them using this auxiliary function. *) val consider_function: libc:bool -> Cil_types.varinfo -> bool (** [consider_variable vinfo] returns false if the varinfo is not an object variable we are interested in. Currently excluded variables are those declared with attribute [__FRAMA_C_MODEL__]. If [libc] is false, do not consider variables from the Frama-C libc. *) val consider_variable: libc:bool -> Cil_types.varinfo -> bool (** Convert float to string with the following convention: - if the float is an integer (ie, it has no digits after the decimal point), print it as such; - otherwise, print the first two digits after the decimal point. *) val float_to_string : float -> string ;; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_cabs.ml��������������������������������������������0000666�0000000�0000000�00000053137�13571573400�020132� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Implementation of cyclomatic complexity measures on CAbs' AST *) open Cabs open Metrics_base open Metrics_base.BasicMetrics class metricsCabsVisitor = object(self) inherit Cabsvisit.nopCabsVisitor (* Global metrics store for this Cabs AST *) val global_metrics = ref empty_metrics (* Local metrics in computation *) val local_metrics = ref empty_metrics (* Was last statement a case ? *) val was_case = ref false (* Local metrics are kept stored after computation in this map of maps. Its storing hierarchy is as follows: filename -> function_name -> metrics *) val mutable metrics_map: (BasicMetrics.t Metrics_base.OptionKf.Map.t) Datatype.Filepath.Map.t = Datatype.Filepath.Map.empty val functions_no_source: (string, int) Hashtbl.t = Hashtbl.create 97 val functions_with_source: (string, int) Hashtbl.t = Hashtbl.create 97 val mutable standalone = true (* Getters/setters *) method functions_no_source = functions_no_source method functions_with_source = functions_with_source method set_standalone v = standalone <- v method get_metrics = !global_metrics method private update_metrics_map filename strmap = metrics_map <- Datatype.Filepath.Map.add filename strmap metrics_map (* Utility methods to increase metrics counts *) method private incr_both_metrics f = apply_then_set f global_metrics; apply_then_set f local_metrics method add_to_functions_with_source (funcname:string) = Hashtbl.add functions_with_source funcname 0; Hashtbl.remove functions_no_source funcname; method private record_and_clear metrics = let filename = metrics.cfile_name and func = metrics.cfunc in local_metrics := BasicMetrics.set_cyclo !local_metrics (BasicMetrics.compute_cyclo !local_metrics); global_metrics := BasicMetrics.set_cyclo !global_metrics (!global_metrics.ccyclo + !local_metrics.ccyclo); (try let fun_tbl = Datatype.Filepath.Map.find filename metrics_map in self#update_metrics_map filename (Metrics_base.OptionKf.Map.add func !local_metrics fun_tbl); with | Not_found -> let new_stringmap = Metrics_base.OptionKf.Map.add func !local_metrics Metrics_base.OptionKf.Map.empty in self#update_metrics_map filename new_stringmap; ); local_metrics := empty_metrics; method! vdef def = match def with | FUNDEF (_, sname, _, _, _) -> begin let funcname = Metrics_base.extract_fundef_name sname in local_metrics := {!local_metrics with cfile_name = get_filename def; cfunc = Some (Metrics_base.kf_of_cabs_name sname); cfuncs = 1; (* Only one function is indeed being defined here *)}; Metrics_parameters.debug ~level:1 "Definition of function %s encountered@." funcname; apply_then_set incr_funcs global_metrics; self#add_to_functions_with_source funcname; (* On return record the analysis of the function. *) Cil.ChangeDoChildrenPost ([def], fun _ -> begin if !local_metrics <> empty_metrics then self#record_and_clear !local_metrics; [def] end ); end | DECDEF _ | TYPEDEF _ | ONLYTYPEDEF _ | GLOBASM _ | PRAGMA _ | LINKAGE _ | CUSTOM _ | GLOBANNOT _ -> Cil.DoChildren; method! vexpr expr = (match expr.expr_node with | NOTHING -> () | UNARY (unop, _) -> begin match unop with | PREINCR | POSINCR | PREDECR | POSDECR -> self#incr_both_metrics incr_assigns | MINUS | PLUS | NOT | BNOT -> () | MEMOF -> self#incr_both_metrics incr_ptrs | ADDROF -> () end | LABELADDR _ -> () | BINARY (bop, _, _) -> begin match bop with | ADD | SUB | MUL | DIV | MOD | BAND | BOR | XOR | SHL | SHR | EQ | NE | LT | GT | LE | GE -> () | AND | OR -> self#incr_both_metrics incr_dpoints | ASSIGN | ADD_ASSIGN | SUB_ASSIGN | MUL_ASSIGN | DIV_ASSIGN | BOR_ASSIGN | XOR_ASSIGN | SHL_ASSIGN | SHR_ASSIGN | BAND_ASSIGN | MOD_ASSIGN -> self#incr_both_metrics incr_assigns; end | CAST _ -> () | CALL _ -> self#incr_both_metrics incr_calls; | QUESTION _ -> self#incr_both_metrics incr_dpoints; self#incr_both_metrics incr_ifs; | COMMA _ | CONSTANT _ | PAREN _ | VARIABLE _ | EXPR_SIZEOF _ | TYPE_SIZEOF _ | EXPR_ALIGNOF _ | TYPE_ALIGNOF _ | INDEX _ | MEMBEROF _ | MEMBEROFPTR _ | GNU_BODY _ | EXPR_PATTERN _ -> ()); Cil.DoChildren (* Allows to count only one control-flow branch per case lists *) method private set_case stmt = match stmt.stmt_node with | CASERANGE _ | CASE _ -> was_case := true; | DEFAULT _ | _ -> was_case := false method! vstmt stmt = self#incr_both_metrics incr_slocs; (match stmt.stmt_node with | DEFAULT _ -> () (* The default case is not counted as a path choice point *) | CASERANGE _ | CASE _ -> if not !was_case then self#incr_both_metrics incr_dpoints; | IF _ -> self#incr_both_metrics incr_ifs; self#incr_both_metrics incr_dpoints; | NOP _ | COMPUTATION _ | BLOCK _ -> () (* Next 3 are all loop instructions *) | WHILE _ | DOWHILE _ | FOR _ -> self#incr_both_metrics incr_loops; self#incr_both_metrics incr_dpoints; | BREAK _ | CONTINUE _ -> () | RETURN _ | THROW _ -> self#incr_both_metrics incr_exits; | SWITCH _ -> () | LABEL _ -> () | GOTO _ | COMPGOTO _ -> self#incr_both_metrics incr_gotos; | DEFINITION _ | ASM _ | SEQUENCE _ | TRY_EXCEPT _ | TRY_FINALLY _ | TRY_CATCH _ | CODE_ANNOT _ | CODE_SPEC _ -> ()); self#set_case stmt; Cil.DoChildren method private stats_of_filename filename = try Datatype.Filepath.Map.find filename metrics_map with | Not_found -> Metrics_parameters.fatal "Metrics for file %a not_found@." Datatype.Filepath.pretty filename method pp_file_metrics fmt filename = Format.fprintf fmt "@[<v 0>%a@]" (fun fmt filename -> let fun_tbl = self#stats_of_filename filename in OptionKf.Map.iter (fun _fun_name fmetrics -> Format.fprintf fmt "@ %a" pp_base_metrics fmetrics) fun_tbl; ) filename method pp_detailed_text_metrics fmt () = Datatype.Filepath.Map.iter (fun filename _func_tbl -> Format.fprintf fmt "%a" self#pp_file_metrics filename) metrics_map end ;; (** Halstead metrics computation *) module Halstead = struct (* We follow http://www.verifysoft.com/en_halstead_metrics.html for the classification of operands and operators operands = ids, typenames, typespecs, constants *) let update_val value key tbl = try let v = Hashtbl.find tbl key in Hashtbl.replace tbl key (v + value); with | Not_found -> Hashtbl.add tbl key value ;; let update_val_incr key tbl = update_val 1 key tbl;; type operand_tbl = { var_tbl : (string, int) Hashtbl.t; cst_tbl : (Cabs.constant, int) Hashtbl.t; } ;; type operator_tbl = { knownop_tbl : (string, int) Hashtbl.t; otherop_tbl : (string, int) Hashtbl.t; reserved_tbl : (string, int) Hashtbl.t; tspec_tbl : (Cabs.typeSpecifier, int) Hashtbl.t; } ;; let id_from_init iname = match (fst iname) with | s, _, _, _ -> s ;; class halsteadCabsVisitor = object(self) inherit Cabsvisit.nopCabsVisitor val operand_tbl = { var_tbl = Hashtbl.create 7; cst_tbl = Hashtbl.create 7; } val operator_tbl = { knownop_tbl = Hashtbl.create 7; otherop_tbl = Hashtbl.create 7; reserved_tbl = Hashtbl.create 7; tspec_tbl = Hashtbl.create 7; } method get_operator_tbl () = operator_tbl method get_operand_tbl () = operand_tbl method add_paren () = update_val_incr "(" operator_tbl.otherop_tbl; update_val_incr ")" operator_tbl.otherop_tbl; method! vexpr e = match e.Cabs.expr_node with | UNARY _ -> let unop = fst (Cprint.get_operator e) in update_val_incr unop operator_tbl.knownop_tbl; Cil.DoChildren; | BINARY _ -> let binop = fst (Cprint.get_operator e) in update_val_incr binop operator_tbl.knownop_tbl; Cil.DoChildren; | QUESTION _ -> update_val_incr "?" operator_tbl.otherop_tbl; update_val_incr ":" operator_tbl.otherop_tbl; Cil.DoChildren; | COMMA elist -> let n = List.length elist in if (n > 1) then update_val (n - 1) "," operator_tbl.otherop_tbl; Cil.DoChildren; | CONSTANT c -> update_val_incr c operand_tbl.cst_tbl; Cil.DoChildren; | PAREN _ -> self#add_paren (); Cil.DoChildren; | VARIABLE s -> update_val_incr s operand_tbl.var_tbl; Cil.DoChildren; | EXPR_SIZEOF _ -> update_val_incr "sizeof" operator_tbl.reserved_tbl; Cil.DoChildren; | TYPE_SIZEOF _ -> update_val_incr "sizeof" operator_tbl.reserved_tbl; Cil.DoChildren; | INDEX _ -> update_val_incr "[]" operator_tbl.otherop_tbl; Cil.DoChildren; | _ -> Cil.DoChildren; method! vstmt s = let reserved rstr = update_val_incr rstr operator_tbl.reserved_tbl; Cil.DoChildren; in match s.Cabs.stmt_node with | BLOCK _ -> update_val_incr "{" operator_tbl.otherop_tbl; update_val_incr "}" operator_tbl.otherop_tbl; Cil.DoChildren; | SEQUENCE _ -> print_string "seq\n"; update_val_incr ";" operator_tbl.otherop_tbl; Cil.DoChildren; | IF _ -> self#add_paren (); reserved "if"; | WHILE _ -> self#add_paren (); reserved "while"; | DOWHILE _ -> update_val_incr "do" operator_tbl.reserved_tbl; self#add_paren (); reserved "while"; | FOR _ -> self#add_paren (); update_val 2 ";" operator_tbl.otherop_tbl; reserved "for"; | BREAK _ -> reserved "break"; | CONTINUE _ -> reserved "continue"; | RETURN _ -> reserved "return"; | SWITCH _ -> self#add_paren (); reserved "switch"; | CASE _ -> reserved "case"; | CASERANGE _ -> update_val_incr "..." operator_tbl.otherop_tbl; update_val 2 ";" operator_tbl.otherop_tbl; reserved "case"; | DEFAULT _ -> reserved "default"; | LABEL _ -> update_val_incr ":" operator_tbl.otherop_tbl; Cil.DoChildren; | GOTO (s, _) -> let lname = Format.sprintf "label_%s" s in update_val_incr lname operand_tbl.var_tbl; reserved "goto"; | COMPGOTO _ -> update_val_incr "*" operator_tbl.otherop_tbl; reserved "goto"; | DEFINITION _ -> Cil.DoChildren; | ASM _ -> reserved "asm"; | TRY_EXCEPT _ -> update_val_incr "except" operator_tbl.reserved_tbl; reserved "try"; | TRY_FINALLY _ -> update_val_incr "finally" operator_tbl.reserved_tbl; reserved "try"; | _ -> Cil.DoChildren; method! vtypespec tspec = update_val_incr tspec operator_tbl.tspec_tbl; Cil.DoChildren; method! vspec spec = let reserved rstr = update_val_incr rstr operator_tbl.reserved_tbl; in let do_spec s = match s with | SpecTypedef -> reserved "typedef" | SpecInline -> reserved "inline" | SpecStorage AUTO -> reserved "auto" | SpecStorage STATIC -> reserved "static" | SpecStorage EXTERN -> reserved "extern" | SpecStorage REGISTER -> reserved "register" | SpecCV CV_CONST -> reserved "const" | SpecCV CV_VOLATILE -> reserved "volatile" | SpecCV CV_RESTRICT -> reserved "restrict" | _ -> () in List.iter do_spec spec; Cil.DoChildren; method! vdecltype tdecl = match tdecl with | JUSTBASE -> Cil.SkipChildren; | PARENTYPE _ -> self#add_paren (); Cil.DoChildren; | ARRAY _ -> update_val_incr "array" operator_tbl.reserved_tbl; Cil.DoChildren; | PTR _ -> update_val_incr "*" operator_tbl.otherop_tbl; Cil.DoChildren; | PROTO _ -> Cil.SkipChildren; method! vinitexpr ie = ( match ie with | COMPOUND_INIT l -> let n = List.length l in if n > 0 then update_val n "," operator_tbl.otherop_tbl; | _ -> ()); Cil.DoChildren method! vblock b = if b.bstmts <> [] then ( let n = List.length b.bstmts in update_val n ";" operator_tbl.otherop_tbl); if b.battrs <> [] then update_val (List.length b.battrs) "," operator_tbl.otherop_tbl; Cil.DoChildren; method! vdef d = match d with | FUNDEF (bl, (_, (fname, dtype, _, nloc)), b, loc1, loc2) -> Cil.ChangeDoChildrenPost( [FUNDEF(bl, ([], (fname, dtype, [], nloc)), b, loc1, loc2)], fun x -> x) | DECDEF (_, (_, name_list), _) -> let n = List.fold_left (fun acc n -> update_val_incr (id_from_init n) operand_tbl.var_tbl; acc + 1 ) (-1) name_list in begin assert(n >= 0); if (n > 0) then update_val n "," operator_tbl.otherop_tbl; Cil.DoChildren; end | _ -> Cil.DoChildren end ;; let compose _x1 y1 (x2, y2) = (1 + x2), (y1 + y2);; let fold x y = Hashtbl.fold compose x y;; let compute_operators operator_tbl = let x, y = fold operator_tbl.tspec_tbl ( fold operator_tbl.otherop_tbl ( fold operator_tbl.reserved_tbl ( fold operator_tbl.knownop_tbl (0,0)))) in (float_of_int x), (float_of_int y) ;; let compute_operands operand_tbl = let x, y = fold operand_tbl.cst_tbl ( fold operand_tbl.var_tbl (0,0)) in (float_of_int x), (float_of_int y) ;; type halstead_metrics = { distinct_operators : float; total_operators : float; distinct_operands : float; total_operands : float; program_length : float; program_volume : float; program_level : float; vocabulary_size : float; difficulty_level : float; effort_to_implement : float; time_to_implement : float; bugs_delivered : float; } let get_metrics cabs_visitor = let operator_tbl = cabs_visitor#get_operator_tbl () in let operand_tbl = cabs_visitor#get_operand_tbl () in let distinct_operators, total_operators = compute_operators operator_tbl and distinct_operands, total_operands = compute_operands operand_tbl in let program_length = total_operands +. total_operators in let vocabulary_size = distinct_operands +. distinct_operators in let log2 x = (log x) /. (log 2.0) in let program_volume = program_length *. (log2 vocabulary_size) in let difficulty_level = (distinct_operators /. 2.) *. (total_operands /. distinct_operands) in let program_level = 1. /. difficulty_level in let effort_to_implement = program_volume *. difficulty_level in let time_to_implement = effort_to_implement /. 18. in let bugs_delivered = (effort_to_implement ** (2./.3.)) /. 3000. in { distinct_operators = distinct_operators; total_operators = total_operators; distinct_operands = distinct_operands; total_operands = total_operands; program_length = program_length; program_volume = program_volume; program_level = program_level; vocabulary_size = vocabulary_size; difficulty_level = difficulty_level; effort_to_implement = effort_to_implement; time_to_implement = time_to_implement; bugs_delivered = bugs_delivered; } ;; let to_list hmetrics = [ [ "Total operators"; float_to_string hmetrics.total_operators; ]; [ "Distinct operators"; float_to_string hmetrics.distinct_operators; ]; [ "Total_operands"; float_to_string hmetrics.total_operands; ]; [ "Distinct operands"; float_to_string hmetrics.distinct_operands; ]; [ "Program length"; float_to_string hmetrics.program_length; ]; [ "Vocabulary size"; float_to_string hmetrics.vocabulary_size; ]; [ "Program volume"; float_to_string hmetrics.program_volume; ]; [ "Effort"; float_to_string hmetrics.effort_to_implement; ]; [ "Program level"; float_to_string hmetrics.program_level; ]; [ "Difficulty level"; float_to_string hmetrics.difficulty_level; ]; [ "Time to implement"; float_to_string hmetrics.time_to_implement; ]; [ "Bugs delivered"; float_to_string hmetrics.bugs_delivered; ]; ] ;; let pp_metrics ppf cabs_visitor = let metrics = get_metrics cabs_visitor in (* Compute the metrics from the informations gathered by the visitor. *) let minutes = (int_of_float metrics.time_to_implement) / 60 in let _hours, _minutes = minutes / 60, minutes mod 60 in let operator_tbl = cabs_visitor#get_operator_tbl () in let operand_tbl = cabs_visitor#get_operand_tbl () in let dummy_cst cst = { expr_loc = Cil_datatype.Location.unknown; expr_node = CONSTANT cst; } and simple_pp_htbl ppf htbl = Hashtbl.iter (fun k v -> Format.fprintf ppf "%s: %d@ " k v) htbl in (* Halstead metrics' bugs delivered statistics is said to be underapproximated for C. Hence the "lower bound" commentary on the output next to "bugs delivered". *) let title = "Halstead metrics" and stats = "Global statistics (Halstead)" and operator_sec = "Operators" and operand_sec = "Operands" in Format.fprintf ppf "@[<v 0>%a@ %a@ @ \ %a@ \ @[<v 2>%a@ %a%a%a%a@]@ \ @[<v 2>%a@ %a%a@]@ \ @]" (mk_hdr 1) title (fun ppf l -> List.iter (fun rowl -> Format.fprintf ppf "@[<hov>"; (match rowl with | title :: contents -> Format.fprintf ppf "%s:@ " title; List.iter (fun s -> Format.fprintf ppf "%s@ " s) contents; | [] -> ()); Format.fprintf ppf "@]@ "; ) l) (to_list metrics) (mk_hdr 1) stats (mk_hdr 2) operator_sec (* Operators table *) simple_pp_htbl operator_tbl.reserved_tbl simple_pp_htbl operator_tbl.otherop_tbl simple_pp_htbl operator_tbl.knownop_tbl (fun ppf htbl -> Hashtbl.iter (fun k v -> Format.fprintf ppf "%a: %d@ " Cprint.print_type_spec k v) htbl) operator_tbl.tspec_tbl (* Operands *) (mk_hdr 2) operand_sec simple_pp_htbl operand_tbl.var_tbl (fun ppf htbl -> Hashtbl.iter (fun k v -> Format.fprintf ppf "%a: %d@ " Cprint.print_expression (dummy_cst k) v) htbl) operand_tbl.cst_tbl; ;; let compute_metrics () = (* Run the visitor on all files *) let cabs_files = Ast.UntypedFiles.get () in let cabs_visitor = new halsteadCabsVisitor in List.iter (fun file -> ignore (Cabsvisit.visitCabsFile (cabs_visitor:>Cabsvisit.cabsVisitor) file)) cabs_files ; Metrics_parameters.result "%a" pp_metrics cabs_visitor let get_metrics () = let cabs_files = Ast.UntypedFiles.get () in let cabs_visitor = new halsteadCabsVisitor in List.iter (fun file -> ignore (Cabsvisit.visitCabsFile (cabs_visitor:>Cabsvisit.cabsVisitor) file)) cabs_files ; get_metrics cabs_visitor ;; end let compute_on_cabs () = try let cabs_files = Ast.UntypedFiles.get () in let cabs_visitor = new metricsCabsVisitor in List.iter (fun file -> Metrics_parameters.debug ~level:2 "Compute Cabs metrics for file %a@." Datatype.Filepath.pretty (fst file); ignore (Cabsvisit.visitCabsFile (cabs_visitor:>Cabsvisit.cabsVisitor) file); ) cabs_files ; if Metrics_parameters.ByFunction.get () then Metrics_parameters.result "@[<v 0>Cabs:@ %a@]" cabs_visitor#pp_detailed_text_metrics (); Halstead.compute_metrics (); with | Ast.NoUntypedAst -> Metrics_parameters.warning "@[<v 0> Project has no untyped AST. Only metrics over normalized CIL \ AST are available. \ @]@." (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_cabs.mli�������������������������������������������0000666�0000000�0000000�00000004722�13571573400�020277� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Metrics computing on Cabs Syntactic metrics usually makes more sense on Cabs as they reference the original program. However, one loses CIL facilities for this purpose. Thus, working on Cabs is less developer-friendly. *) (** Main entry point to compute various metrics on Cabs AST instead of CIL AST. *) val compute_on_cabs: unit -> unit ;; module Halstead : sig type halstead_metrics = { distinct_operators : float; total_operators : float; distinct_operands : float; total_operands : float; program_length : float; program_volume : float; program_level : float; vocabulary_size : float; difficulty_level : float; effort_to_implement : float; time_to_implement : float; bugs_delivered : float; } ;; val get_metrics : unit -> halstead_metrics ;; val to_list : halstead_metrics -> string list list ;; end ����������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_cilast.ml������������������������������������������0000666�0000000�0000000�00000074754�13571573400�020511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Kernel_file = File open Cil_datatype open Cil_types open Metrics_base ;; type cilast_metrics = { fundecl_calls: int Metrics_base.VInfoMap.t; fundef_calls: int Metrics_base.VInfoMap.t; extern_global_vars: Metrics_base.VInfoSet.t; basic_global_metrics: BasicMetrics.t } (** Syntactic metrics ================= The goal is to collect various (syntactic) information about the source code (slocs, assignments, loops, ...). From those one can compute McCabe's cyclomatic complexity. *) class type sloc_visitor = object inherit Visitor.generic_frama_c_visitor (* Get the number of times a function has been called if it has been defined (fundef) or not (fundecl). *) method fundecl_calls: int Metrics_base.VInfoMap.t method fundef_calls: int Metrics_base.VInfoMap.t (* Global variables with 'Extern' storage *) method extern_global_vars: Metrics_base.VInfoSet.t (* Get the computed metrics *) method get_global_metrics: BasicMetrics.t (* Print the metrics of a file [Datatype.Filepath.t] to a formatter Yields a fatal error if the file does not exist (or has no metrics). *) method pp_file_metrics: Format.formatter -> Datatype.Filepath.t -> unit method pp_detailed_text_metrics: Format.formatter -> unit (** Print results of all file and functions to the given formatter as text *) method print_stats: Format.formatter -> unit (** Print computed metrics to a formatter *) method get_metrics_map: (BasicMetrics.t OptionKf.Map.t) Datatype.Filepath.Map.t (** Compute and return per-function metrics *) end (* Various metrics computing visitor on Cil AST. These metrics are a necessary step to compute cyclomatic complexity. *) open BasicMetrics ;; class slocVisitor ~libc : sloc_visitor = object(self) inherit Visitor.frama_c_inplace (* Global metrics store for this Cil AST *) val global_metrics = ref BasicMetrics.empty_metrics (* Local metrics in computation *) val local_metrics = ref BasicMetrics.empty_metrics (* Local metrics are kept stored after computation in this map of maps. Its storing hierarchy is as follows: filename -> function_name -> metrics *) val mutable metrics_map: (BasicMetrics.t OptionKf.Map.t) Datatype.Filepath.Map.t = Datatype.Filepath.Map.empty val mutable seen_vars = Varinfo.Set.empty; val fundecl_calls: int VInfoMap.t ref = ref VInfoMap.empty; val fundef_calls: int VInfoMap.t ref = ref VInfoMap.empty; val extern_global_vars = ref VInfoSet.empty (* Getters/setters *) method fundecl_calls = !fundecl_calls method fundef_calls = !fundef_calls method extern_global_vars = !extern_global_vars method get_global_metrics = !global_metrics method get_metrics_map = metrics_map method private update_metrics_map filename kfmap = metrics_map <- Datatype.Filepath.Map.add filename kfmap metrics_map (* Utility method to increase metrics counts *) method private incr_both_metrics f = apply_then_set f global_metrics; apply_then_set f local_metrics method private add_map map vinfo value = map := VInfoMap.add vinfo value !map method private stats_of_filename filename = try Datatype.Filepath.Map.find filename metrics_map with | Not_found -> Metrics_parameters.fatal "Metrics for file %a not_found@." Datatype.Filepath.pretty filename method pp_file_metrics fmt filename = Format.fprintf fmt "@[<v 0>%a@]" (fun fmt filename -> let fun_tbl = self#stats_of_filename filename in OptionKf.Map.iter (fun _fun_name fmetrics -> Format.fprintf fmt "@ %a" pp_base_metrics fmetrics) fun_tbl; ) filename method pp_detailed_text_metrics fmt = Datatype.Filepath.Map.iter (fun filename _func_tbl -> Format.fprintf fmt "%a" self#pp_file_metrics filename) metrics_map method print_stats fmt = Transitioning.Format.pp_set_formatter_stag_functions fmt Metrics_base.html_stag_functions; Format.pp_set_tags fmt true; let pr_hdr fmt hdr_name = Format.fprintf fmt "@{<th>%s@}" hdr_name in Datatype.Filepath.Map.iter (fun filename func_tbl -> Metrics_parameters.result ~level:2 "%a" self#pp_file_metrics filename; if func_tbl <> OptionKf.Map.empty then begin Format.fprintf fmt "@[<v 0>@{<h3>%a@}<br/>@ \ @{<table>\ @[<v 2>@ \ @[<v 2>@{<tbody>@ \ @{<tr>@[<v 2>@ \ %a@ %a@ %a@ %a@ %a@ %a@ %a@ %a@ %a@ @]@}@ \ %a@ \ @}@]@]@ @} \ @]@ " Datatype.Filepath.pretty filename pr_hdr "Function" pr_hdr "#If stmts" pr_hdr "#Assignments" pr_hdr "#Loops" pr_hdr "#Calls" pr_hdr "#Gotos" pr_hdr "#Pointer dereferencing" pr_hdr "#Exits" pr_hdr "Cyclomatic value" (fun fmt fun_tbl -> OptionKf.Map.iter (fun _fname fmetrics -> Format.fprintf fmt "%a" pp_base_metrics_as_html_row fmetrics; ) fun_tbl ) func_tbl; end else Metrics_parameters.warning "Filename <%a> has no functions@." Datatype.Filepath.pretty filename) metrics_map (* Save the local metrics currently computed. Clears it before starting a new metrics computation (e.g. when entering a new function definition. Global metrics are never reset as they define metrics on the whole Cil.file. *) method private record_and_clear_function_metrics metrics = let filename = metrics.cfile_name in let funcname = metrics.cfunc in local_metrics := BasicMetrics.set_cyclo !local_metrics (BasicMetrics.compute_cyclo !local_metrics); global_metrics := BasicMetrics.set_cyclo !global_metrics (!global_metrics.ccyclo + !local_metrics.ccyclo); (try let fun_tbl = Datatype.Filepath.Map.find filename metrics_map in self#update_metrics_map filename (OptionKf.Map.add funcname !local_metrics fun_tbl); with | Not_found -> let new_kfmap = OptionKf.Map.add funcname !local_metrics OptionKf.Map.empty in self#update_metrics_map filename new_kfmap; ); local_metrics := empty_metrics; method! vvdec vi = if not (Varinfo.Set.mem vi seen_vars) then ( if Cil.isFunctionType vi.vtype then ( if consider_function ~libc vi then begin global_metrics := incr_funcs !global_metrics; (* Mark the function as seen, adding 0 to the number of calls *) self#update_call_maps vi 0; end ) else ( if vi.vglob && not vi.vtemp && Metrics_base.consider_variable ~libc vi then ( global_metrics:= incr_glob_vars !global_metrics; if vi.vstorage = Extern then extern_global_vars := VInfoSet.add vi !extern_global_vars ) ); seen_vars <- Varinfo.Set.add vi seen_vars; ); Cil.SkipChildren method! vfunc fdec = if consider_function ~libc fdec.svar then begin (* Here, we get to a fundec definition.this function has a body, let's put it to the "function with source" table. *) local_metrics := {!local_metrics with cfile_name = file_of_fundef fdec; cfunc = Some (Globals.Functions.get fdec.svar); cfuncs = 1; (* Only one function is indeed being defined here *)}; let fvinfo = fdec.svar in (if not (VInfoMap.mem fvinfo !fundef_calls) then (* Never seen before, including never been called *) self#add_map fundef_calls fvinfo 0); (* On return record the analysis of the function. *) Cil.ChangeDoChildrenPost (fdec, fun _ -> begin if !local_metrics <> empty_metrics then self#record_and_clear_function_metrics !local_metrics; fdec; end ); end else Cil.SkipChildren method! vlval (host, _) = begin match host with | Mem _ -> self#incr_both_metrics incr_ptrs; | _ -> () end; Cil.DoChildren method! vstmt s = self#incr_both_metrics incr_slocs; let do_children = match s.skind with | If _ -> self#incr_both_metrics incr_ifs; self#incr_both_metrics incr_dpoints; true | Loop _ -> self#incr_both_metrics incr_loops; true | Goto _ -> self#incr_both_metrics incr_gotos; true | Return _ -> self#incr_both_metrics incr_exits; true | Switch (_, _, _slist, _) -> true (* The catching block is one more possible flow alternative *) | TryFinally _ | TryExcept _ -> self#incr_both_metrics incr_dpoints; true | UnspecifiedSequence l -> List.iter (fun (s,_,_,_,_) -> ignore (Visitor.visitFramacStmt (self:>Visitor.frama_c_visitor) s)) l; false | _ -> true in (* Default cases are not path choice points, as normal labels. Non-default cases are ... just like if statements. *) let rec has_case_label labels = match labels with | (Case _) :: _-> self#incr_both_metrics incr_dpoints; | _ :: labels -> has_case_label labels | [] -> () in has_case_label s.labels; if do_children then Cil.DoChildren else Cil.SkipChildren method! vexpr e = begin (* Logical ands and ors are lazy and generate two different paths *) match e.enode with | BinOp ((LAnd | LOr), _, _, _) -> self#incr_both_metrics incr_dpoints; | _ -> () end; Cil.DoChildren method private image (glob:global) = (* extract just the name of the global , for printing purposes *) match glob with | GVar (v, _, _) -> v.vname ^ " (GVar) " | GVarDecl (v, _) -> v.vname ^ " (GVarDecl) " | GFunDecl (_, v, _) -> v.vname ^ " (GFunDecl) " | GFun (fdec, _) -> fdec.svar.vname ^ " (GFun) " | GType (ty, _) -> ty.tname | GCompTag (ci, _) | GCompTagDecl (ci, _) -> ci.cname | GEnumTagDecl (ei, _) | GEnumTag (ei, _) -> ei.ename | GAsm (_, _) | GPragma _ | GText _ -> "" | GAnnot (an,_) -> begin match an with | Dfun_or_pred (li, _) -> li.l_var_info.lv_name | Dvolatile (_, _, _, _, _) -> " (Volatile) " | Daxiomatic (s, _, _, _) -> s | Dtype (lti, _) -> lti.lt_name | Dlemma (ln, _, _, _, _, _, _) -> ln | Dinvariant (toto, _) -> toto.l_var_info.lv_name | Dtype_annot (ta, _) -> ta.l_var_info.lv_name | Dmodel_annot (mi, _) -> mi.mi_name | Dcustom_annot (_c, _n, _, _) -> " (Custom) " | Dextended ({ext_name}, _, _) -> " (Extension " ^ ext_name ^ ")" end method private images (globs:global list) = (* extract just the names of the globals, for printing purposes *) let les_images = List.map self#image globs in String.concat "," les_images method private update_call_maps vinfo increment = if consider_function ~libc vinfo then let update_call_map funcmap = self#add_map funcmap vinfo (increment + try VInfoMap.find vinfo !funcmap with Not_found-> 0) in if vinfo.vdefined then update_call_map fundef_calls else update_call_map fundecl_calls method! vinst i = begin match i with | Call(v, e, _, _) -> self#incr_both_metrics incr_calls; (match e.enode with | Lval(Var vinfo, NoOffset) -> self#update_call_maps vinfo 1 | _ -> ()); (match v with | Some _ -> self#incr_both_metrics incr_assigns | None -> ()); | Set _ -> self#incr_both_metrics incr_assigns; | Local_init (_, AssignInit _, _) -> self#incr_both_metrics incr_assigns | Local_init (_, ConsInit(f,_, k),_) -> (* if f takes the address of the initialized variable as first argument, there's no explicit assignment in the current function. *) (match k with | Plain_func -> self#incr_both_metrics incr_assigns | Constructor -> ()); self#incr_both_metrics incr_calls; self#update_call_maps f 1 | Asm _ | Skip _ | Code_annot _ -> () end; Cil.DoChildren end let dkey = Metrics_parameters.register_category "used-files" class reachable_from_main visited_vardefs = object inherit Visitor.frama_c_inplace val visited_vardefs = ref visited_vardefs method get_visited_vardefs = !visited_vardefs method! vvrbl vi = if vi.vglob && not (Varinfo.Set.mem vi !visited_vardefs) then begin Metrics_parameters.feedback ~dkey "visiting %a" Printer.pp_varinfo vi; visited_vardefs := Varinfo.Set.add vi !visited_vardefs; try let kf = Globals.Functions.get vi in try let fd = Kernel_function.get_definition kf in let vis = new reachable_from_main !visited_vardefs in ignore (Visitor.visitFramacFunction (vis :> Visitor.frama_c_visitor) fd); visited_vardefs := Varinfo.Set.union !visited_vardefs vis#get_visited_vardefs with Kernel_function.No_Definition -> () with Not_found -> (* global var, not function *) let def = Ast.def_or_last_decl vi in let vis = new reachable_from_main !visited_vardefs in ignore (Visitor.visitFramacGlobal (vis :> Visitor.frama_c_visitor) def); visited_vardefs := Varinfo.Set.union !visited_vardefs vis#get_visited_vardefs end; Cil.SkipChildren end let reachable_from_main () = try let (kf, _) = Globals.entry_point () in Metrics_parameters.feedback ~dkey "compute_reachable_from_main: %a" Kernel_function.pretty kf; try let main_fd = Kernel_function.get_definition kf in let vis = new reachable_from_main (Varinfo.Set.singleton main_fd.svar) in ignore (Visitor.visitFramacFunction (vis :> Visitor.frama_c_visitor) main_fd); Some (Varinfo.Set.elements vis#get_visited_vardefs) with Kernel_function.No_Definition -> None with Globals.No_such_entry_point _ -> None (* Requires a main function *) let compute_files_defining_globals gvars = List.fold_left (fun acc vi -> Metrics_parameters.feedback ~dkey "looking for global: %a" Printer.pp_varinfo vi; let def = Ast.def_or_last_decl vi in let is_def = match def with | GVar _ | GFun _ -> true | _ -> false in if is_def then let loc = Cil_datatype.Global.loc def in if Location.equal loc Location.unknown then acc else begin Metrics_parameters.feedback ~dkey "found %s at: %a" (if is_def then "definition" else "declaration") Printer.pp_location loc; Datatype.Filepath.Set.add ((fst loc).Filepath.pos_path) acc end else acc ) (Datatype.Filepath.Set.empty) gvars class logic_loc_visitor = object inherit Visitor.frama_c_inplace val locs = ref Location.Set.empty method get_locs = !locs method! vterm t = locs := Cil_datatype.Location.Set.add t.term_loc !locs; Cil.DoChildren method! vpredicate p = locs := Cil_datatype.Location.Set.add p.pred_loc !locs; Cil.DoChildren end let get_filenames_in_funspec kf = try let spec = Annotations.funspec ~populate:false kf in Metrics_parameters.feedback ~dkey "looking for files in the spec of: %a" Kernel_function.pretty kf; List.fold_left (fun acc b -> let visitor = new logic_loc_visitor in ignore (Visitor.visitFramacBehavior (visitor :> Visitor.frama_c_visitor) b); let locs = visitor#get_locs in Cil_datatype.Location.Set.fold (fun loc acc' -> let path = (fst loc).Filepath.pos_path in Metrics_parameters.feedback ~dkey ~once:true "found annotation in: %a" Datatype.Filepath.pretty path; Datatype.Filepath.Set.add path acc' ) locs acc ) Datatype.Filepath.Set.empty spec.spec_behavior with Annotations.No_funspec _ -> Datatype.Filepath.Set.empty let compute_files_defining_funspecs gvars = List.fold_left (fun acc vi -> try let kf = Globals.Functions.get vi in let fs = get_filenames_in_funspec kf in Datatype.Filepath.Set.union acc fs with Not_found -> acc ) Datatype.Filepath.Set.empty gvars let used_files () = match reachable_from_main () with | None -> Metrics_parameters.abort "'%s' requires an entry point (-main) with a body" Metrics_parameters.UsedFiles.option_name | Some reachable_gvars -> let used_for_defs = compute_files_defining_globals reachable_gvars in let used_for_specs = compute_files_defining_funspecs reachable_gvars in Datatype.Filepath.Set.union used_for_defs used_for_specs let pretty_used_files used_files = (* Note: used_files may also contain #include'd files, but we only want those given in the command line *) let cmdline_files = List.fold_left (fun acc file -> Datatype.Filepath.Set.add ( Datatype.Filepath.of_string (Kernel_file.get_name file) ) acc ) Datatype.Filepath.Set.empty (Kernel_file.get_all ()) in let used_cmdline_files, used_included_files = Datatype.Filepath.Set.partition (fun path -> Datatype.Filepath.Set.mem path cmdline_files ) used_files in let used_included_c_files = Datatype.Filepath.Set.filter (fun f -> Extlib.string_suffix ~strict:true ".c" (f : Filepath.Normalized.t :> string)) used_included_files in let used_implicitly_included_c_files = Datatype.Filepath.Set.diff used_included_c_files cmdline_files in let unused_cmdline_files = Datatype.Filepath.Set.diff cmdline_files used_cmdline_files in let nb s = Datatype.Filepath.Set.cardinal s in let pp_filepaths title fmt paths = let n = nb paths in if n = 0 then Format.ifprintf fmt "" else let title_len = String.length title in Format.fprintf fmt "@\n%s (%d)\ @\n%s\ @\n%a@\n" title n (String.make (title_len + 4) '=') (Pretty_utils.pp_list ~sep:" \\@\n" ~suf:" \\" Datatype.Filepath.pretty) (Datatype.Filepath.Set.elements paths) in Metrics_parameters.result "Used files starting at function '%a':@\n\ - command line has %d out of %d file(s) being used@\n\ - %d used file(s) inside #include directives, of which %d '.c' file(s).@\n\ %a%a%a" Kernel_function.pretty (fst (Globals.entry_point ())) (nb used_cmdline_files) (nb cmdline_files) (nb used_included_files) (nb used_included_c_files) (pp_filepaths "Used command-line files") used_cmdline_files (pp_filepaths "Unused command-line files") unused_cmdline_files (pp_filepaths "Used, but implicitly included C files") used_implicitly_included_c_files let dump_html fmt cil_visitor = (* Activate tagging for html *) Transitioning.Format.pp_set_formatter_stag_functions fmt html_stag_functions; Format.pp_set_tags fmt true; let pr_row s fmt n = Format.fprintf fmt "@{<tr>@[<v 1>@ \ @{<td class=\"entry\">%s@}@ \ @{<td class=\"stat\">%d@}@]@ @} " s n in let pr_stats fmt visitor = let metrics = visitor#get_global_metrics in Format.fprintf fmt "@[<v 0>@{<table>%a@}@]" (fun fmt metrics -> List.iter2 (fun text value -> pr_row text fmt value) ["SLOC"; "Number of if statements"; "Number of assignments"; "Number of loops"; "Number of calls"; "Number of gotos"; "Number of pointer accesses";] [metrics.cslocs; metrics.cifs; metrics.cassigns; metrics.cloops; metrics.ccalls; metrics.cgotos; metrics.cptrs;]) metrics in let pr_prelude fmt cil_visitor = Format.fprintf fmt "@[<v 0>\ @{<div>@ \ @{<h1>@{<span>Metrics@}@}@ \ @{<h2>Synthetic results@}@ <br/>@ \ @{<span>Defined function(s)@} (%d): <br/>@ \ @[  %a@]@ <br/>@ <br/>@ \ @{<span>Undefined function(s)@} (%d):@ <br/>@ \ @[  %a@]@ <br>@ <br/>@ \ @{<span>'Extern' global variable(s)@} (%d):@ <br/>@ \ @[  %a@]@ <br>@ <br/>@ \ @{<span>Potential entry point(s)@} (%d):@ <br/>@ \ @[  %a@]@ <br/>@ <br/>@ \ @}@]" (VInfoMap.cardinal cil_visitor#fundef_calls) Metrics_base.pretty_set cil_visitor#fundef_calls (VInfoMap.cardinal cil_visitor#fundecl_calls) Metrics_base.pretty_set cil_visitor#fundecl_calls (VInfoSet.cardinal cil_visitor#extern_global_vars) Metrics_base.pretty_extern_vars cil_visitor#extern_global_vars (Metrics_base.number_entry_points cil_visitor#fundef_calls) Metrics_base.pretty_entry_points cil_visitor#fundef_calls in let pr_detailed_results fmt cil_visitor = Format.fprintf fmt "@[<v 0>\ @{<div style=\"text-align: left;\">\ @[<v 2>@ \ @{<h2>Detailed results@}@ \ @[<v 0>%a@ @]\ @]@}" (fun fmt cil_visitor -> cil_visitor#print_stats fmt) cil_visitor in Format.fprintf fmt "@[<v 0>\ <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\ \"http://www.w3.org/TR/html4/strict.dtd\">@ \ @{<html>@ \ @{<head>@ \ @{<title>%s@}@ \ <meta content=\"text/html; charset=iso-8859-1\" \ http-equiv=\"Content-Type\"/>@ \ @{<style type=\"text/css\">%s@}@ \ @}@ \ @{<body>\ @[<v 2>@ \ %a@ \ %a@ \ %a@ \ @]@}@}@]@?" "Metrics" Css_html.css pr_prelude cil_visitor pr_stats cil_visitor pr_detailed_results cil_visitor ;; let pp_funinfo fmt vis = let nfundef = VInfoMap.cardinal vis#fundef_calls in let nfundecl = VInfoMap.cardinal vis#fundecl_calls in let nextern = VInfoSet.cardinal vis#extern_global_vars in let fundef_hdr = Format.sprintf "Defined functions (%d)" nfundef and fundecl_hdr = Format.sprintf "Undefined functions (%d)" nfundecl and extern_hdr = Format.sprintf "'Extern' global variables (%d)" nextern and entry_pts_hdr = Format.sprintf "Potential entry points (%d)" (Metrics_base.number_entry_points vis#fundef_calls) in Format.fprintf fmt "@[<v 0>@[<v 1>%a@ @[%a@]@]@ @ \ @[<v 1>%a@ @[%a@]@]@ @ \ @[<v 1>%a@ @[%a@]@]@ @ \ @[<v 1>%a@ @[%a@]@]@ \ @]" (Metrics_base.mk_hdr 1) fundef_hdr Metrics_base.pretty_set vis#fundef_calls (Metrics_base.mk_hdr 1) fundecl_hdr Metrics_base.pretty_set vis#fundecl_calls (Metrics_base.mk_hdr 1) extern_hdr Metrics_base.pretty_extern_vars vis#extern_global_vars (Metrics_base.mk_hdr 1) entry_pts_hdr Metrics_base.pretty_entry_points vis#fundef_calls ;; let pp_with_funinfo fmt cil_visitor = Format.fprintf fmt "@[<v 0>%a@ %a@]" pp_funinfo cil_visitor pp_base_metrics cil_visitor#get_global_metrics ;; let get_global_metrics ~libc = let file = Ast.get () in (* Do as before *) let cil_visitor = new slocVisitor ~libc in Visitor.visitFramacFileSameGlobals (cil_visitor:>Visitor.frama_c_visitor) file; cil_visitor#get_global_metrics ;; let get_metrics_map ~libc = let file = Ast.get () in (* Do as before *) let cil_visitor = new slocVisitor ~libc in Visitor.visitFramacFileSameGlobals (cil_visitor:>Visitor.frama_c_visitor) file; cil_visitor#get_metrics_map ;; let get_cilast_metrics ~libc = let file = Ast.get () in (* Do as before *) let cil_visitor = new slocVisitor ~libc in Visitor.visitFramacFileSameGlobals (cil_visitor:>Visitor.frama_c_visitor) file; { fundecl_calls = cil_visitor#fundecl_calls; fundef_calls = cil_visitor#fundef_calls; extern_global_vars = cil_visitor#extern_global_vars; basic_global_metrics = cil_visitor#get_global_metrics; } ;; let compute_on_cilast ~libc = let file = Ast.get () in (* Do as before *) let cil_visitor = new slocVisitor ~libc in Visitor.visitFramacFileSameGlobals (cil_visitor:>Visitor.frama_c_visitor) file; if Metrics_parameters.ByFunction.get () then Metrics_parameters.result "@[<v 0>Cil AST@ %t@]" cil_visitor#pp_detailed_text_metrics; (* let r = metrics_to_result cil_visitor in *) (* Print the result to file if required *) let out_fname = Metrics_parameters.OutputFile.get () in begin if out_fname <> "" then try let oc = open_out_bin out_fname in let fmt = Format.formatter_of_out_channel oc in (match Metrics_base.get_file_type out_fname with | Html -> dump_html fmt cil_visitor | Text -> pp_with_funinfo fmt cil_visitor ); close_out oc; with Sys_error _ -> Metrics_parameters.failure "Cannot open file %s.@." out_fname else Metrics_parameters.result "%a" pp_with_funinfo cil_visitor end (* Visitor for the recursive estimation of a stack size. Its arguments are the function currently being visited and the current callstack, as a list of kernel functions. The callstack is used to detect recursive calls. TODO: this computation is far from optimal; for instance, locals_size could be cached for each function. Also, it does not consider calls via function pointers. *) class locals_size_visitor kf callstack = object val mutable locals_size_no_temps = Integer.zero method get_locals_size_no_temps = locals_size_no_temps val mutable locals_size_temps = Integer.zero method get_locals_size_temps = locals_size_temps val mutable max_size_calls_no_temps = Integer.zero method get_max_size_calls_no_temps = max_size_calls_no_temps val mutable max_size_calls_temps = Integer.zero method get_max_size_calls_temps = max_size_calls_temps inherit Visitor.frama_c_inplace method! vinst i = match i with | Call (_, { enode = Lval(Var vi, NoOffset) }, _, _) | Local_init(_, ConsInit(vi,_,_),_) -> begin try let kf' = Globals.Functions.find_by_name vi.vname in Metrics_parameters.debug "@[function %a:@;computing call to function %a@]" Kernel_function.pretty kf Kernel_function.pretty kf'; let new_cs = kf' :: callstack in if List.mem kf' callstack then Metrics_parameters.abort "@[unsupported recursive call detected:@;%a@]" (Pretty_utils.pp_list ~sep:"@ <-@ " Kernel_function.pretty) (List.rev new_cs); let new_vis = new locals_size_visitor kf' new_cs in ignore (Visitor.visitFramacKf (new_vis :> Visitor.frama_c_visitor) kf'); let call_size_no_temps = Integer.add new_vis#get_max_size_calls_no_temps new_vis#get_locals_size_no_temps in let call_size_temps = Integer.add new_vis#get_max_size_calls_temps new_vis#get_locals_size_temps in max_size_calls_no_temps <- Integer.max max_size_calls_no_temps call_size_no_temps; max_size_calls_temps <- Integer.max max_size_calls_temps call_size_temps with Not_found -> (* should not happen *) Metrics_parameters.fatal ~current:true "@[function not found:@;%s@]" vi.vname; end; Cil.DoChildren | _ -> Cil.DoChildren method! vvdec vi = if not vi.vglob && not vi.vghost && vi.vstorage = NoStorage then begin let size_exp = Cil.sizeOf ~loc:vi.vdecl vi.vtype in match Cil.constFoldToInt size_exp with | None -> Metrics_parameters.error "@[in function %a,@;cannot compute sizeof %a (type %a)@]" Kernel_function.pretty kf Printer.pp_varinfo vi Printer.pp_typ vi.vtype | Some size -> Metrics_parameters.debug "@[function %a:@;sizeof(%a) = %a (%s)@]" Kernel_function.pretty kf Printer.pp_varinfo vi (Integer.pretty ~hexa:false) size (if vi.vtemp then "temp" else "non-temp"); if vi.vtemp then locals_size_temps <- Integer.add locals_size_temps size else locals_size_no_temps <- Integer.add locals_size_no_temps size end; Cil.DoChildren end (* Requires a computed Cil AST *) let compute_locals_size kf = let vis = new locals_size_visitor kf [kf] in ignore (Visitor.visitFramacKf (vis :> Visitor.frama_c_visitor) kf); Metrics_parameters.result "@[%a\t%a\t%a\t%a\t%a@]" Kernel_function.pretty kf (Integer.pretty ~hexa:false) vis#get_locals_size_no_temps (Integer.pretty ~hexa:false) (Integer.add vis#get_locals_size_no_temps vis#get_locals_size_temps) (Integer.pretty ~hexa:false) vis#get_max_size_calls_no_temps (Integer.pretty ~hexa:false) (Integer.add vis#get_max_size_calls_no_temps vis#get_max_size_calls_temps) ;; (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_cilast.mli�����������������������������������������0000666�0000000�0000000�00000011143�13571573400�020641� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** In the definitions below, setting argument [libc] to [true] will include functions/variables from the C stdlib in the metrics. *) (** Visitor to compute various syntactic metrics. In particular, it fetches all necessary informations to compute cyclomatic complexity . *) class type sloc_visitor = object inherit Visitor.generic_frama_c_visitor (* Get the number of times a function has been called if it has been defined (fundef) or not (fundecl). *) method fundecl_calls: int Metrics_base.VInfoMap.t method fundef_calls: int Metrics_base.VInfoMap.t method extern_global_vars: Metrics_base.VInfoSet.t (* Get the computed metrics *) method get_global_metrics: Metrics_base.BasicMetrics.t (* Print the metrics of a file [string] to a formatter Yields a fatal error if the file does not exist (or has no metrics). *) method pp_file_metrics: Format.formatter -> Datatype.Filepath.t -> unit method pp_detailed_text_metrics: Format.formatter -> unit (** Print results of all file and functions to the given formatter as text *) method print_stats: Format.formatter -> unit (** Print computed metrics to a formatter *) method get_metrics_map: (Metrics_base.BasicMetrics.t Metrics_base.OptionKf.Map.t) Datatype.Filepath.Map.t (** Compute and return per-function metrics *) end class slocVisitor : libc:bool -> sloc_visitor ;; (** Returns the computed metrics for the entire AST. *) val get_global_metrics : libc:bool -> Metrics_base.BasicMetrics.t ;; type cilast_metrics = { fundecl_calls: int Metrics_base.VInfoMap.t; fundef_calls: int Metrics_base.VInfoMap.t; extern_global_vars: Metrics_base.VInfoSet.t; basic_global_metrics: Metrics_base.BasicMetrics.t } ;; val get_cilast_metrics : libc:bool -> cilast_metrics ;; (** Computes and returns individual metrics per function. *) val get_metrics_map : libc:bool -> (Metrics_base.BasicMetrics.t Metrics_base.OptionKf.Map.t) Datatype.Filepath.Map.t (** Compute metrics on whole CIL AST *) val compute_on_cilast: libc:bool -> unit ;; (** Compute and print the size (in bytes) of local variables on the CIL AST. This is a rough approximation, neither guaranteed to be smaller or larger than the actual value. Only automatic, non-ghost and non-temporary variables present in the source are included. This is useful to estimate the stack size of a function. *) val compute_locals_size: Kernel_function.t -> unit;; (** Computes the set of global variables which are syntactically reachable from the entry point of the program. Returns [None] if there is no entry point. *) val reachable_from_main: unit -> Cil_types.varinfo list option;; (** Computes the set of files defining all global variables syntactically reachable from the entry point of the program (as given by [reachable_from_main]). This function requires a defined entry point. *) val used_files: unit -> Datatype.Filepath.Set.t (** Pretty-prints the result of [used_files] in a verbose way. *) val pretty_used_files: Datatype.Filepath.Set.t -> unit �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_coverage.ml����������������������������������������0000666�0000000�0000000�00000036512�13571573400�021013� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype let compare_vi_names v1 v2 = Extlib.compare_ignore_case v1.vname v2.vname class coverageAuxVisitor ~libc = object(self) inherit Visitor.frama_c_inplace (* Visit the body and the spec of a function *) method private visit_function vi = let kf = Globals.Functions.get vi in let self = (self :> Visitor.frama_c_visitor) in if Metrics_base.consider_function ~libc vi then begin (* Visit the spec. There might be references to function pointers in the assigns *) let spec = Annotations.funspec ~populate:false kf in ignore (Visitor.visitFramacFunspec self spec); end; (try (* Visit the body if we have one *) let fundec = Kernel_function.get_definition kf in ignore (Visitor.visitFramacFunction self fundec); with Kernel_function.No_Definition -> ()) (* Visit the initializer of the given var, if it exists, and returns it *) method private visit_non_function_var vi = if Metrics_base.consider_variable ~libc vi then try (* Visit the initializer if there is one *) let init = Globals.Vars.find vi in match init with | { init = None } -> None | { init = Some init } -> ignore (Visitor.visitFramacInit (self:>Visitor.frama_c_visitor) vi NoOffset init); Some init with Not_found -> (* not a global *) None else None end let dkey_syn = Metrics_parameters.register_category "syntactic-visitor" (* Reachability metrics: from a given entry point compute a conservative estimation of the functions that can be transitively called *) class callableFunctionsVisitor ~libc = object(self) inherit coverageAuxVisitor ~libc as super (* Functions reachable syntactically *) val mutable callable = Varinfo.Set.empty (* All globals initializers visited *) val mutable initializers = [] method initializers = initializers (* All varinfos visited so far. Used to avoid looping *) val visited = Varinfo.Hashtbl.create 17 (* Varinfos remaining to visit *) val todo = Stack.create () method already_seen vi = Varinfo.Hashtbl.mem visited vi (* Each time we see a variable, mark it as to be visited. If it is a function, consider it is called *) method! vvrbl vi = if not (self#already_seen vi) then begin if Cil.isFunctionType vi.vtype && Metrics_base.consider_function ~libc vi then begin Metrics_parameters.feedback ~dkey:dkey_syn "marking %a as callable" Printer.pp_varinfo vi; callable <- Varinfo.Set.add vi callable; end; Stack.push vi todo; end; Cil.SkipChildren (* no children anyway *) method! visit_non_function_var vi = let r = super#visit_non_function_var vi in (match r with | None -> () | Some init -> initializers <- (vi, init) :: initializers ); r method compute vi = (* Initialization *) Stack.clear todo; Stack.push vi todo; Varinfo.Hashtbl.clear visited; Metrics_parameters.feedback ~dkey:dkey_syn "marking %a as callable" Printer.pp_varinfo vi; if Metrics_base.consider_function ~libc vi then callable <- Varinfo.Set.singleton vi; (* Reach fixpoint *) while not (Stack.is_empty todo) do let vi = Stack.pop todo in if not (self#already_seen vi) then begin Metrics_parameters.debug "Coverage: visiting %s" vi.vname; Varinfo.Hashtbl.add visited vi (); if Cil.isFunctionType vi.vtype then self#visit_function vi else ignore (self#visit_non_function_var vi) end; done; callable end type coverage_metrics = { syntactic: Cil_datatype.Varinfo.Set.t; semantic: Cil_datatype.Varinfo.Set.t; initializers: (Cil_types.varinfo * Cil_types.init) list; } class deadCallsVisitor fmt ~libc cov_metrics = let unseen = Varinfo.Set.diff cov_metrics.syntactic cov_metrics.semantic in object(self) inherit coverageAuxVisitor ~libc val mutable current_initializer = None (* When an unseen function is reachable by the body of a function reached, or inside an initializer, display the information *) method private reached_fun vi = if Metrics_base.consider_function ~libc vi && Varinfo.Set.mem vi unseen then match self#current_kf with | None -> (match current_initializer with | None -> assert false | Some vinit -> Format.fprintf fmt "@[<h>Initializer of %s references %s (at %t)@]@ " vinit.vname vi.vname Cil.pp_thisloc ) | Some f -> if Varinfo.Set.mem (Kernel_function.get_vi f) cov_metrics.semantic then let mess = match self#current_stmt with | Some {skind = Instr ( Call (_, {enode = Lval (Var v, NoOffset)}, _, _) | Local_init (_, ConsInit(v, _, _),_))} when Varinfo.equal v vi -> "calls" | _ -> "references" in Format.fprintf fmt "@[<h>Function %a %s %s (at %a)@]@ " Kernel_function.pretty f mess vi.vname Location.pretty (Cil.CurrentLoc.get ()) method! vvrbl vi = if Cil.isFunctionType vi.vtype then self#reached_fun vi; Cil.SkipChildren (* no children anyway *) (* uses initializers *) method compute_and_print = if not (Varinfo.Set.is_empty unseen) || cov_metrics.initializers <> [] then begin Format.fprintf fmt "@[<v>%a@ " (Metrics_base.mk_hdr 2) "References to non-analyzed functions"; let sorted_semantic = List.sort compare_vi_names (Varinfo.Set.elements cov_metrics.semantic) in List.iter self#visit_function sorted_semantic; let sorted_initializers = List.sort (fun (v1, _) (v2, _) -> compare_vi_names v1 v2) cov_metrics.initializers in List.iter (fun (vinit, init) -> current_initializer <- Some vinit; ignore (Visitor.visitFramacInit (self:>Visitor.frama_c_visitor) vinit NoOffset init); current_initializer <- None; ) sorted_initializers; Format.fprintf fmt "@]" end end class coverageByFun = object inherit Visitor.frama_c_inplace val mutable total = 0 val mutable value = 0 method! vstmt s = total <- total + 1; if Db.Value.is_reachable_stmt s then value <- value + 1; Cil.DoChildren method result = (total, value) end module Kf_Coverage = Kernel_function.Make_Table (Datatype.Triple (Datatype.Int) (Datatype.Int) (Datatype.Float)) (struct let name = "Metrics_coverage.Kf_coverage" let size = 7 let dependencies = [ Db.Value.self; Metrics_parameters.Libc.self ] end) let is_computed_by_fun () = Kf_Coverage.length () > 0 let get_coverage = Kf_Coverage.find let compute_coverage_for kf = try let dec = Kernel_function.get_definition kf in let vis = new coverageByFun in ignore (Visitor.visitFramacFunction (vis :> Visitor.frama_c_visitor) dec); let (total, value) = vis#result in let percent = (float_of_int value) /. (float_of_int total) *. 100. in Kf_Coverage.replace kf (total, value, percent) with Kernel_function.No_Definition -> () let compute_coverage_by_fun () = if Db.Value.is_computed () && not (is_computed_by_fun ()) then let libc = Metrics_parameters.Libc.get () in Globals.Functions.iter (fun kf -> if !Db.Value.is_called kf && Metrics_base.consider_function ~libc (Kernel_function.get_vi kf) then compute_coverage_for kf) let clear_coverage_by_fun = Kf_Coverage.clear let compute_syntactic ~libc kf = let vis = new callableFunctionsVisitor ~libc in let res = vis#compute (Kernel_function.get_vi kf) in res, vis#initializers ;; let dkey_sem = Metrics_parameters.register_category "semantic-visitor" let compute_semantic ~libc = assert (Db.Value.is_computed ()); let res = ref Varinfo.Set.empty in (* Just iter on all the functions and consult the appropriate table *) Globals.Functions.iter (fun kf -> if !Db.Value.is_called kf && Metrics_base.consider_function ~libc (Kernel_function.get_vi kf) then begin Metrics_parameters.feedback ~dkey:dkey_sem "marking %a as called" Kernel_function.pretty kf; res := Varinfo.Set.add (Kernel_function.get_vi kf) !res end ); !res ;; let cardinality ~libc s = Varinfo.Set.cardinal (Varinfo.Set.filter (fun vi -> Metrics_base.consider_function ~libc vi) s) class syntactic_printer ~libc reachable = object(self) method private all_funs = Globals.Functions.fold (fun kf acc -> let vi = Kernel_function.get_vi kf in if Metrics_base.consider_function ~libc vi then Varinfo.Set.add vi acc else acc) Varinfo.Set.empty method private pp_fun_set_by_file fmt set = let add_binding map filename fvinfo = let set = try let x = Datatype.Filepath.Map.find filename map in Varinfo.Set.add fvinfo x with Not_found -> Varinfo.Set.add fvinfo Varinfo.Set.empty in Datatype.Filepath.Map.add filename set map in let map = Varinfo.Set.fold (fun fvinfo acc -> if Metrics_base.consider_function ~libc fvinfo then let path = Metrics_base.file_of_vinfodef fvinfo in add_binding acc path fvinfo else acc ) set Datatype.Filepath.Map.empty in Format.fprintf fmt "@[<v 0>"; Datatype.Filepath.Map.iter (fun path fvinfoset -> Format.fprintf fmt "@[<hov 2><%a>:@ %a@]@ " Datatype.Filepath.pretty path (fun fmt vinfoset -> let vars = Varinfo.Set.elements vinfoset in let sorted_vars = List.sort compare_vi_names vars in List.iter (fun vinfo -> Format.fprintf fmt "%a;@ " Printer.pp_varinfo vinfo) sorted_vars ) fvinfoset ) map; Format.fprintf fmt "@]" method pp_reached_from_function fmt kf = let card_syn = cardinality ~libc reachable in let title_reach = Format.asprintf "%a: %d" Kernel_function.pretty kf card_syn in let all = self#all_funs in let card_all = cardinality ~libc all in let title_unreach = Format.asprintf "%a: %d" Kernel_function.pretty kf (card_all - card_syn) in Format.fprintf fmt "@[<v 0>%a@ %a@ %a@ %a@]" (Metrics_base.mk_hdr 2) (Format.sprintf "Functions syntactically reachable from %s" title_reach) self#pp_fun_set_by_file reachable (Metrics_base.mk_hdr 2) (Format.sprintf "Functions syntactically unreachable from %s" title_unreach) self#pp_fun_set_by_file (Varinfo.Set.diff all reachable) end class semantic_printer ~libc (cov_metrics : coverage_metrics) = object(self) inherit syntactic_printer ~libc cov_metrics.syntactic (* uses semantic and initializers *) method pp_unreached_calls fmt = let v = new deadCallsVisitor ~libc fmt cov_metrics in v#compute_and_print (* uses semantic *) method pp_value_coverage fmt = assert (Db.Value.is_computed ()); let all = self#all_funs in let syntactic = cov_metrics.syntactic and semantic = cov_metrics.semantic in let unseen = Varinfo.Set.diff syntactic semantic in let unseen_num = cardinality ~libc unseen in let nall = cardinality ~libc all in let nsyn = cardinality ~libc syntactic and nsem = cardinality ~libc semantic in let percent = (float_of_int nsem) *. 100.0 /. (float_of_int nsyn) in Format.fprintf fmt "@[<v 0>\ %a@ \ Syntactically reachable functions = %d (out of %d)@ \ Semantically reached functions = %d@ \ Coverage estimation = %.1f%% @ " (Metrics_base.mk_hdr 1) "Eva coverage statistics" nsyn nall nsem percent; if unseen_num > 0 then Format.fprintf fmt "@ @[<v 2>Unreached functions (%d) =@ %a@]" unseen_num self#pp_fun_set_by_file unseen; Format.fprintf fmt "@]" (* uses semantic *) method pp_stmts_reached_by_function fmt = compute_coverage_by_fun (); let l = Kf_Coverage.fold (fun kf (total, value, percent) l -> (kf, total, value, percent) :: l) [] in (* Sort by percentage (higher first), then sort by name (for same percentage) *) let l = List.sort (fun (kf1, _, _, p1) (kf2, _, _, p2) -> let c = compare p2 p1 in if c = 0 then compare kf1 kf2 else c ) l in let sum_total, sum_value = List.fold_left (fun (at, av) (_, t, v, _) -> at+t, av+v) (0, 0) l in let percent = 100. *. (float_of_int sum_value) /. (float_of_int sum_total) in Format.fprintf fmt "@[<v 0>%a@ \ %d stmts in analyzed functions, %d stmts analyzed (%.1f%%)@ " (Metrics_base.mk_hdr 2) "Statements analyzed by Eva" sum_total sum_value percent; List.iter (fun (kf, total, visited, percent) -> Format.fprintf fmt "%a: %d stmts out of %d (%.1f%%)@ " Kernel_function.pretty kf visited total percent ) l; Format.fprintf fmt "@]" end let percent_coverage ~libc cov_metrics = let nsyn = cardinality ~libc cov_metrics.syntactic and nsem = cardinality ~libc cov_metrics.semantic in let percent = (float_of_int nsem) /. (float_of_int nsyn) *. 100.0 in percent ;; let compute ~libc = assert (Db.Value.is_computed ()); let semantic = compute_semantic ~libc in let main = fst (Globals.entry_point ()) in let syntactic, initializers = compute_syntactic ~libc main in { syntactic; semantic; initializers } ;; (* Reexport a simpler function *) let compute_syntactic ~libc kf = fst (compute_syntactic ~libc kf) (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_coverage.mli���������������������������������������0000666�0000000�0000000�00000007576�13571573400�021174� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** In the definitions below, setting argument [libc] to [true] will include functions/variables from the C stdlib in the metrics. *) val compute_syntactic: libc:bool -> Kernel_function.t -> Cil_datatype.Varinfo.Set.t (** List of functions that can be syntactically reached from the function *) val compute_semantic: libc:bool -> Cil_datatype.Varinfo.Set.t (** Functions analyzed by the value analysis *) type coverage_metrics = { syntactic: Cil_datatype.Varinfo.Set.t; (** syntactically reachable functions *) semantic: Cil_datatype.Varinfo.Set.t; (** semantically reachable functions *) initializers: (Cil_types.varinfo * Cil_types.init) list; (** initializers *) } val percent_coverage : libc:bool -> coverage_metrics -> float ;; val compute : libc:bool -> coverage_metrics ;; (** Computes both syntactic and semantic coverage information. *) (** Computes the semantic coverage by function. *) val compute_coverage_by_fun: unit -> unit (** Returns the coverage for a given function. Raises [Not_found] if it has not been computed for the function. *) val get_coverage: Kernel_function.t -> int * int * float (* Returns [true] if the coverage by function has been computed. *) val is_computed_by_fun: unit -> bool val clear_coverage_by_fun: unit -> unit (** Pretty-printer for syntactic coverage metrics. *) class syntactic_printer : libc:bool -> Cil_datatype.Varinfo.Set.t -> object method pp_reached_from_function: Format.formatter -> Kernel_function.t -> unit (** Pretty-print the functions that can be syntactically reached from the parameter *) end (** Pretty-printer for semantic coverage metrics. Includes syntactic coverage metrics. *) class semantic_printer : libc:bool -> coverage_metrics -> object inherit syntactic_printer method pp_unreached_calls: Format.formatter -> unit (** Pretty-print semantically unreachable functions that are called by semantically reachable functions. *) method pp_value_coverage: Format.formatter -> unit (** Pretty-print value coverage information, including functions syntactically and semantically reachable from the entry point, as well as coverage percentage. *) method pp_stmts_reached_by_function: Format.formatter -> unit end (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_gui.ml���������������������������������������������0000666�0000000�0000000�00000011342�13571573400�017776� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type ('a, 'b, 'c) metrics_panel = { top : 'a option; bottom : 'b option; actions : 'c list; } ;; (* The option type for top and bottom GTK objects is compulsory in order not to have warnings at runtime. Creation of GTK objects cannot be made before the general window is initialized. The option type with a None value marks the fact that this value is not initialized either (it will only be at register time). *) let get_panel, set_panel, add_panel_action = let panel = ref { top = None; bottom = None; actions = []; } in (fun () -> !panel), (fun top_widget bottom_widget -> panel := { top = top_widget; bottom = bottom_widget; actions = []; } ), (fun action -> panel := { !panel with actions = action :: !panel.actions; }) ;; (** Display the [table_contents] matrix as a GTK table *) let display_as_table table_contents (parent:GPack.box) = let table = GPack.table ~columns:(List.length (List.hd table_contents)) ~rows:(List.length table_contents) ~homogeneous:true ~packing:parent#pack () in Extlib.iteri (fun i row -> Extlib.iteri (fun j text -> table#attach ~left:j ~top:i ((GMisc.label ~justify:`LEFT ~text:text ()):>GObj.widget)) row) table_contents ; ;; (** Remove all sub-elements of a GUI object *) let clear_container w = List.iter (fun c -> c#destroy ()) w#children ;; (** The panel of Metrics has two parts: - The upper part contains the various choices of the user; - The bottom part displays the result. *) let init_panel (main_ui: Design.main_window_extension_points) = let v = GPack.vbox () in (* Titles, buttons, and headers *) let up = GPack.hbox ~width:120 ~packing:(v#pack ~expand:true) () in (* Results *) let bottom = GPack.vbox ~width:120 ~packing:(v#pack ~expand:true) () in let choices = GEdit.combo_box_text ~active:0 ~strings:[] ~packing:(up#pack) () in let launch_button = GButton.button ~label:"Launch" ~packing:(up#pack) () in ignore(launch_button#connect#clicked (fun () -> let actions = (get_panel ()).actions in let sopt = GEdit.text_combo_get_active choices in match sopt with | None -> () | Some s -> if List.mem_assoc s actions then let action = List.assoc s actions in clear_container bottom; ignore (main_ui#full_protect ~cancelable:true (fun () -> action bottom)) else () ) ); set_panel (Some choices) (Some bottom); v ;; let reset_panel _ = let metrics_panel = get_panel () in match metrics_panel.bottom with | None -> () | Some b -> clear_container b; ;; (** Returning a value to register in Frama-C's GUI *) let coerce_panel_to_ui panel_box _main_ui = "Metrics", panel_box#coerce, None ;; (** Add a new metrics to its dedicated panel. The text is added to the combo box while the action is added to the association lists of possible actions. *) let register_metrics ?(apply=false) name display_function = add_panel_action (name, display_function); let metrics_panel = get_panel () in GEdit.text_combo_add (Extlib.the metrics_panel.top) name; if apply then display_function (Extlib.the metrics_panel.bottom); ;; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_gui.mli��������������������������������������������0000666�0000000�0000000�00000005234�13571573400�020152� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {1 GUI utilities for Metrics} *) (** Initialize the main Metrics panel into an upper and lower part. @return a box containing the lower part of the panel where metrics can display their results. *) val init_panel : Design.main_window_extension_points -> GPack.box ;; (** @return a value allowing to register the panel into the main GUI *) val coerce_panel_to_ui : < coerce : 'a; .. > -> 'b -> string * 'a * 'c option ;; (** Display the list of list of strings in a LablGTK table object *) val display_as_table : string list list -> GPack.box -> unit ;; (** Reset metrics panel to pristine conditions by removing children from bottom container *) val reset_panel : 'a -> unit ;; (** register_metrics [metrics_name] [display_function] () adds a selectable choice for the metrics [metrics_name] and add a hook calling [display_function] whenever this metrics is selected and launched. If [apply] is true, [display_function] is immediately applied. [apply] is false by default. *) val register_metrics : ?apply:bool -> string -> (GPack.box -> unit) -> unit ;; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_parameters.ml��������������������������������������0000666�0000000�0000000�00000007742�13571573400�021366� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "metrics" let shortname = "metrics" let help = "syntactic metrics" end) module Enabled = WithOutput (struct let option_name = "-metrics" let help = "activate metrics computation" let output_by_default = true end) module ByFunction = WithOutput (struct let option_name = "-metrics-by-function" let help = "also compute metrics on a per-function basis" let output_by_default = true end) module OutputFile = Empty_string (struct let option_name = "-metrics-output" let arg_name = "filename" let help = "print some metrics into the specified file; \ the output format is recognized through the extension." end) module ValueCoverage = WithOutput ( struct let option_name = "-metrics-eva-cover" let help = "estimate Eva coverage w.r.t. \ to reachable syntactic definitions" let output_by_default = true end) let () = ValueCoverage.add_aliases [ "-metrics-value-cover" ] module AstType = String (struct let option_name = "-metrics-ast" let arg_name = "[cabs | cil | acsl]" let help = "apply metrics to Cabs or CIL AST, or to ACSL specs" let default = "cil" end ) module Libc = False (struct let option_name = "-metrics-libc" let help = "show functions from Frama-C standard C library in the \ results; deactivated by default." end ) let () = AstType.set_possible_values ["cil"; "cabs"; "acsl"] module SyntacticallyReachable = Kernel_function_set (struct let option_name = "-metrics-cover" let arg_name = "f1,..,fn" let help = "compute an overapproximation of the functions reachable from \ f1,..,fn." end ) module LocalsSize = Kernel_function_set (struct let option_name = "-metrics-locals-size" let arg_name = "f1,...,fn" let help = "prints the size of local variables for functions f1,...,fn, \ and for the functions called within them \ (does not support recursive calls)" end) module UsedFiles = False (struct let option_name = "-metrics-used-files" let help = "list files containing global definitions reachable by main" end) (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������frama-c-20.0-Calcium/src/plugins/metrics/metrics_parameters.mli�������������������������������������0000666�0000000�0000000�00000005227�13571573400�021533� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module Enabled: Parameter_sig.With_output (** Activate metrics *) module ByFunction: Parameter_sig.Bool (** Activate metrics by function *) module ValueCoverage: Parameter_sig.With_output (** Give an estimation about value analysis code penetration. Only works on CIL AST. *) module AstType: Parameter_sig.String (** Set the ASTs on which the metrics should be computed *) module OutputFile: Parameter_sig.String (** Pretty print metrics to the given file. The output format will be recognized through the extension. Supported extensions are: "html" or "htm" for HTML "txt" or "text" for text *) module SyntacticallyReachable: Parameter_sig.Kernel_function_set (** Set of functions for which we compute the functions they may call *) module LocalsSize: Parameter_sig.Kernel_function_set (** Compute and print the total size of local variables for all functions in this set (option -metrics-locals-size) *) module Libc: Parameter_sig.Bool module UsedFiles: Parameter_sig.Bool (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/register.ml������������������������������������������������0000666�0000000�0000000�00000007323�13571573400�017314� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Metrics_parameters ;; let () = Enabled.set_output_dependencies [ Ast.self; AstType.self; OutputFile.self; SyntacticallyReachable.self; Libc.self ] ;; let syntactic ?(libc=Metrics_parameters.Libc.get ()) () = begin match AstType.get () with | "cil" -> Metrics_cilast.compute_on_cilast ~libc (* Cabs metrics are experimental. unregistered, unjournalized *) | "cabs" -> Metrics_cabs.compute_on_cabs () | "acsl" -> Metrics_acsl.dump() | _ -> assert false (* the possible values are checked by the kernel*) end; SyntacticallyReachable.iter (fun kf -> let reachable = Metrics_coverage.compute_syntactic ~libc kf in let cov_printer = new Metrics_coverage.syntactic_printer ~libc reachable in Metrics_parameters.result "%a" cov_printer#pp_reached_from_function kf) let () = ValueCoverage.set_output_dependencies [Db.Value.self; Libc.self] let value ~libc () = !Db.Value.compute (); if Db.Value.is_computed () then begin let cov_metrics = Metrics_coverage.compute ~libc in let cov_printer = new Metrics_coverage.semantic_printer ~libc cov_metrics in Metrics_parameters.result "%t" cov_printer#pp_value_coverage; Metrics_parameters.result "%t" cov_printer#pp_unreached_calls; Metrics_parameters.result "%t" cov_printer#pp_stmts_reached_by_function; end ;; let main () = let libc = Libc.get () in if Enabled.get () then Enabled.output (syntactic ~libc); if ValueCoverage.get () then ValueCoverage.output (value ~libc); if LocalsSize.is_set () then begin Ast.compute (); Metrics_parameters.result "function\tlocals_size_no_temps\t\ locals_size_with_temps\t\ max_call_size_no_temps\t\ max_call_size_with_temps"; LocalsSize.iter (fun kf -> Metrics_cilast.compute_locals_size kf); end; if UsedFiles.get () then begin let used_files = Metrics_cilast.used_files () in Metrics_cilast.pretty_used_files used_files end ;; (* Register main entry points *) let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/metrics/register_gui.ml��������������������������������������������0000666�0000000�0000000�00000034527�13571573400�020166� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module defines abstraction for Metrics use *) let mk_bi_label (parent:GPack.box) l1 = let container = GPack.hbox ~packing:parent#pack () in let t = GMisc.label ~text:l1 ~xalign:0.0 ~packing:(container#pack ~expand:false ~fill:true) () in Gtk_helper.old_gtk_compat t#set_width_chars 7; let label = GMisc.label ~selectable:true ~xalign:0.0 ~text:"" ~packing:(container#pack ~expand:true) () in label module HalsteadMetricsGUI = struct let compute = Metrics_cabs.compute_on_cabs let name = "Halstead" let display_result (main_ui:Design.main_window_extension_points) (parent_win:GPack.box) = try let padder = GBin.alignment ~padding:(5, 5, 15, 15) ~packing:parent_win#pack () in let box = GPack.vbox ~homogeneous:false () in padder#add (box:>GObj.widget); ignore(GMisc.label ~markup:(Printf.sprintf "<b>%s</b>" name) ~justify:`LEFT ~packing:box#pack ()); ignore(GMisc.separator `HORIZONTAL ~packing:box#pack ()); let metrics = Metrics_cabs.Halstead.get_metrics () in let table_contents = Metrics_cabs.Halstead.to_list metrics in Metrics_gui.display_as_table table_contents box with | Ast.NoUntypedAst -> main_ui#error "Cannot compute Halstead metrics: untyped AST not present.\n\ It has been removed either by user request or \ by some AST transformation." let register main_ui = Metrics_gui.register_metrics name (display_result main_ui) end module CyclomaticMetricsGUI = struct open Metrics_base open Pretty_source open Visitor let name = "Cyclomatic" class cyclo_class ~libc (main_ui:Design.main_window_extension_points) = object(self) val mutable checked_fun = Kernel_function.dummy () method get_data = let checker = (new Metrics_cilast.slocVisitor ~libc) in ignore (visitFramacGlobal (checker :> frama_c_visitor) (Kernel_function.get_global checked_fun)); checker#get_global_metrics (* 2 becomes "2*checker#funcs" in the general case *) method do_value (main_ui:Design.main_window_extension_points) loc (total:int) (valeur:int) (percent:float) = match loc with | PVDecl (Some kf,_,_) -> begin (* Get the global of this function *) let fname = Kernel_function.get_name kf in (* create a small results window *) let dialog = GWindow.window ~title:(Format.sprintf "Value analysis statistics of %s" fname) ~modal:false ~position:`CENTER_ON_PARENT ~border_width:3 ~resizable:true () in dialog#set_transient_for main_ui#main_window#as_window; let padder = GBin.alignment ~padding:(5, 0, 15, 15) ~packing:dialog#add () in let vbox = GPack.vbox () in padder#add (vbox:>GObj.widget); ignore (dialog#event#connect#delete ~callback:(fun _ -> dialog#misc#hide (); true)); ignore(GMisc.label ~markup:(Printf.sprintf "<b>%s</b>" fname) ~justify:`LEFT ~packing:vbox#pack ()); ignore(GMisc.separator `HORIZONTAL ~packing:vbox#pack ()); let metrics_data = [["total stmts";(string_of_int total)]; ["stmts analyzed";(string_of_int valeur)]; ["percentage of stmts covered"; (string_of_float percent)] ] in Metrics_gui.display_as_table metrics_data vbox; let close_button = GButton.button ~stock:`OK ~packing:vbox#pack () in close_button#set_border_width 10; ignore (close_button#connect#clicked ~callback:dialog#misc#hide); dialog#show () end | _ -> prerr_endline "no function" method do_cyclo (main_ui:Design.main_window_extension_points) = let fname = Kernel_function.get_name checked_fun in (* create a small results window *) let dialog = GWindow.window ~title:(Format.sprintf "Measures for %s" fname) ~modal:false ~position:`CENTER_ON_PARENT ~border_width:3 ~resizable:true () in dialog#set_transient_for main_ui#main_window#as_window; let padder = GBin.alignment ~padding:(5, 0, 15, 15) ~packing:dialog#add () in let vbox = GPack.vbox () in padder#add (vbox:>GObj.widget); ignore (dialog#event#connect#delete ~callback:(fun _ -> dialog#misc#hide (); true)); ignore(GMisc.label ~markup:(Printf.sprintf "<b>%s</b>" fname) ~justify:`LEFT ~packing:vbox#pack ()); ignore(GMisc.separator `HORIZONTAL ~packing:vbox#pack ()); let metrics_data = BasicMetrics.to_list self#get_data in Metrics_gui.display_as_table metrics_data vbox; let close_button = GButton.button ~stock:`OK ~packing:vbox#pack () in close_button#set_border_width 10; ignore (close_button#connect#clicked ~callback:dialog#misc#hide); dialog#show () (* callback of menu_item "Cyclo" *) method display_localizable localizable () = begin match localizable with | PVDecl (Some kf,_,_) -> (* Process only the function selected *) (* Get the global of this function *) checked_fun <- kf; self#do_cyclo main_ui; | _ -> () end method cyclo_selector (popup_factory:GMenu.menu GMenu.factory) main_ui ~button localizable = if button = 3 && Db.Value.is_computed () then match localizable with | PVDecl (Some kf, _,_) -> let callback1 () = Metrics_parameters.debug "cyclo_selector - callback"; self#display_localizable localizable () in let callback2 () = (* function selected is kf *) Metrics_coverage.compute_coverage_by_fun (); (* Got a list of (kf,value,total,percent). Now let's scan this list *) try let valeur,total,percent = Metrics_coverage.get_coverage kf in self#do_value main_ui localizable valeur total percent with Not_found -> () in begin ignore (popup_factory#add_item "Cyclomatic metrics" ~callback:callback1); ignore (popup_factory#add_item "Value metrics" ~callback:callback2) end | _ -> () initializer main_ui#register_source_selector self#cyclo_selector end let compute ~libc () = Metrics_cilast.compute_on_cilast ~libc let display_result ~libc (parent_win:GPack.box) = let padder = GBin.alignment ~padding:(5, 5, 15, 15) ~packing:parent_win#pack () in let box = GPack.vbox ~homogeneous:false () in padder#add (box:>GObj.widget); ignore(GMisc.label ~markup:(Printf.sprintf "<b>%s</b>" name) ~justify:`LEFT ~packing:box#pack ()); ignore(GMisc.separator `HORIZONTAL ~packing:box#pack ()); let metrics = Metrics_cilast.get_global_metrics ~libc in let table_contents = BasicMetrics.to_list metrics in Metrics_gui.display_as_table table_contents box let register ~libc main_ui = ignore (new cyclo_class ~libc main_ui); Metrics_gui.register_metrics name (display_result ~libc) end (** GUI hooks value coverage *) module ValueCoverageGUI = struct open Cil_datatype open Metrics_coverage open Gtk_helper let name = "Eva coverage" let result = ref None let highlight = ref false let update_filetree = ref (fun _ -> ()) let filetree_enabled = ref true let filetree_visible () = !filetree_enabled && Metrics_coverage.is_computed_by_fun () (* TODO : Metrics data structure must be projectified ? *) let compute ~libc = begin match !result with | None -> !Db.Value.compute (); result := Some (Metrics_coverage.compute ~libc) | Some _ -> () end; Metrics_coverage.compute_coverage_by_fun (); !update_filetree `Contents; Extlib.the !result let decorate_filetree (main_ui: Design.main_window_extension_points) = let compute get = function | Cil_types.GFun ({Cil_types.svar = v }, _) -> begin try let kf = Globals.Functions.get v in get (Metrics_coverage.get_coverage kf) with Not_found -> -1 end | _ -> -1 in let percentage (_, _, pct_covered) = truncate (100. -. pct_covered) in let number (total, value, _) = total - value in let number_total (total, _, _) = total in let text get = fun g -> let i = compute get g in if i < 0 then "" else string_of_int i in let sort get = fun g h -> Datatype.Int.compare (compute get g) (compute get h) in let refresh_percentage = main_ui#file_tree#append_text_column ~title:"Dead code %" ~tooltip:"Percentage of dead code in each function" ~visible:filetree_visible ~text:(text percentage) ~sort:(sort percentage) in let refresh_dead_stmts = main_ui#file_tree#append_text_column ~title:"Dead stmts" ~tooltip:"Number of dead statements in each function" ~visible:filetree_visible ~text:(text number) ~sort:(sort number) in let refresh_nb_stmts = main_ui#file_tree#append_text_column ~title:"Total stmts" ~tooltip:"Number of statements in each function" ~visible:filetree_visible ~text:(text number_total) ~sort:(sort number_total) in let refresh x = refresh_percentage x; refresh_dead_stmts x; refresh_nb_stmts x in update_filetree := refresh let () = Db.Value.Table_By_Callstack.add_hook_on_update (fun _ -> Metrics_coverage.clear_coverage_by_fun (); !update_filetree `Visibility) (* Functions are highlighted using different colors according to the following scheme: - Both semantically and syntactically reachable functions are green; - Only syntactically reachable are yellow; - Unreachable (neither semantically nor syntactically) functions are in red (bad!) *) let highlighter buffer loc ~start ~stop = if !highlight then begin match !result with | None -> () | Some metrics -> begin let pure_syntactic = Varinfo.Set.diff metrics.syntactic metrics.semantic in let hilit color = let tag = make_tag buffer#buffer "metrics" [`BACKGROUND color] in apply_tag buffer#buffer tag start stop in let syn_hilit () = hilit "yellow" and sem_hilit () = hilit "green" and unseen_hilit () = hilit "red" in match loc with | Pretty_source.PVDecl(_, _, vi) -> if Ast_info.is_function_type vi then begin if Varinfo.Set.mem vi pure_syntactic then syn_hilit () else if Varinfo.Set.mem vi metrics.semantic then sem_hilit () else unseen_hilit () end | _ -> () end end let display_result ~libc main_ui (parent_win:GPack.box) = let padder = GBin.alignment ~padding:(5, 5, 15, 15) ~packing:parent_win#pack () in let box = GPack.vbox ~homogeneous:false () in padder#add (box:>GObj.widget); ignore(GMisc.label ~markup:(Printf.sprintf "<b>%s</b>" name) ~justify:`LEFT ~packing:box#pack ()); ignore(GMisc.separator `HORIZONTAL ~packing:box#pack ()); let metrics = compute ~libc in let pcent = Metrics_coverage.percent_coverage ~libc metrics in let progress_bar = GRange.progress_bar ~packing:box#pack () in progress_bar#set_fraction (pcent /. 100.0); ignore(GMisc.label ~markup:(Format.sprintf "%s%% functions reached" (Metrics_base.float_to_string pcent)) ~justify:`LEFT ~packing:box#pack ()); let _ignore = Gtk_helper.on_bool box "Highlight results" (fun () -> !highlight) (fun b -> highlight := b; main_ui#rehighlight ()) in let _ignore = Gtk_helper.on_bool box "Show columns" ~tooltip:"Shows the columns related to dead code in the filetree." (fun () -> !filetree_enabled) (fun b -> filetree_enabled := b; !update_filetree `Visibility) in main_ui#rehighlight () let register ~libc main_ui = Design.register_reset_extension (fun _ -> result := None); main_ui#register_source_highlighter highlighter; let apply = Metrics_parameters.ValueCoverage.get () in Metrics_gui.register_metrics ~apply name (display_result ~libc main_ui); end let register_final ?(libc=Metrics_parameters.Libc.get ()) main_ui = let box = Metrics_gui.init_panel main_ui in Design.register_reset_extension Metrics_gui.reset_panel; HalsteadMetricsGUI.register main_ui; CyclomaticMetricsGUI.register ~libc main_ui; ValueCoverageGUI.register ~libc main_ui; Metrics_gui.coerce_panel_to_ui box main_ui let gui (main_ui:Design.main_window_extension_points) = main_ui#register_panel register_final let () = Design.register_extension gui; Design.register_extension ValueCoverageGUI.decorate_filetree �������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/nonterm/�����������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015145� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/nonterm/Makefile.in������������������������������������������������0000666�0000000�0000000�00000005153�13571573400�017216� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif ################### # Plug-in Setting # ################### PLUGIN_DIR ?=. PLUGIN_ENABLE:=@ENABLE_NONTERM@ PLUGIN_NAME:=Nonterm PLUGIN_CMO:= nonterm_run PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure PLUGIN_DEPENDENCIES:=Eva #PLUGIN_NO_DEFAULT_TEST:=no PLUGIN_TESTS_DIRS:=nonterm ################ # Generic part # ################ include $(FRAMAC_SHARE)/Makefile.dynamic ##################################### # Regenerating the Makefile on need # ##################################### ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif $(Nonterm_DIR)/Makefile: $(Nonterm_DIR)/Makefile.in \ $(CONFIG_STATUS_DIR)/config.status cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/nonterm/Nonterm.mli������������������������������������������������0000666�0000000�0000000�00000003157�13571573400�017300� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Nothing is exported *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/nonterm/configure��������������������������������������������������0000777�0000000�0000000�00000272255�13571573400�017071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS ENABLE_NONTERM ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_nonterm ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-nonterm support for nonterm plug-in (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-nonterm was given. if test "${enable_nonterm+set}" = set; then : enableval=$enable_nonterm; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "nonterm is not available" "$LINENO" 5 fi FORCE_NONTERM=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_NONTERM ENABLE_NONTERM=$ENABLE NAME_NONTERM=nonterm if test "$default" = "no" -a "$FORCE" = "no"; then INFO_NONTERM=" (not available by default)" fi echo "nonterm... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_EVA=$REQUIRE_EVA" "nonterm REQUIRED_NONTERM=$REQUIRED_NONTERM" "eva ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/nonterm/configure.ac�����������������������������������������������0000666�0000000�0000000�00000004374�13571573400�017443� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # Nonterm as a standard Frama-C plug-in # ######################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)]) check_plugin(nonterm,PLUGIN_RELATIVE_PATH(plugin_file), [support for nonterm plug-in],yes) plugin_require(nonterm,eva) ####################### # Generating Makefile # ####################### write_plugin_config(Makefile) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/nonterm/nonterm_run.ml���������������������������������������������0000666�0000000�0000000�00000036764�13571573400�020065� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype module Self = Plugin.Register (struct let name = "nonterm" let shortname = "nonterm" let help = "Warns when definitively non-terminating functions/loops are \ detected (e.g. reachable functions with unreachable returns)." end) module Enabled = Self.WithOutput (struct let option_name = "-nonterm" let help = "when on (off by default), \ warns about non-terminating functions/loops" let output_by_default = false end) let () = Parameter_customize.argument_may_be_fundecl () module Ignore = Self.Filled_string_set (struct let option_name = "-nonterm-ignore" let arg_name = "f1,..,fn" let help = "ignore functions f1,..,fn and direct calls to them. \ Functions prefixed with '-' are removed from the ignore \ list. Calls via function pointers are never ignored. \ By default, the following functions are ignored: \ abort, exit" let default = Datatype.String.Set.of_list ["abort"; "exit"] end) module DeadCode = Self.False (struct let option_name = "-nonterm-dead-code" let help = "warns about syntactically unreachable code. \ Note that this may emit a substantial amount of warnings." end) let pretty_stmt_kind fmt stmt = match stmt.skind with | Break _ -> let implicit = try let kf = Kernel_function.find_englobing_kf stmt in let loop = Kernel_function.find_enclosing_loop kf stmt in (* heuristic: if both statements have the same location, then the break was implicitly generated *) Location.equal (Stmt.loc stmt) (Stmt.loc loop) with Not_found -> false in Format.fprintf fmt "%sbreak" (if implicit then "implicit " else "") | Return _ -> (* heuristic: if the return statement has no predecessors, then it is implicitly generated (and dead code) *) let implicit = stmt.preds = [] in Format.fprintf fmt "%sreturn" (if implicit then "implicit " else "") | Loop _ -> Format.fprintf fmt "loop" | Switch _ -> Format.fprintf fmt "switch" | Instr (Call _) -> Format.fprintf fmt "function call" | Instr (Local_init(_,ConsInit _,_)) -> Format.fprintf fmt "function call (initializer)" | _ -> Format.fprintf fmt "statement" let pp_numbered_stacks fmt callstacks = if List.length callstacks < 2 then Format.fprintf fmt "stack: %a" (Pretty_utils.pp_list ~sep:": " Value_types.Callstack.pretty) callstacks else (* number callstacks *) let numbered_callstacks = let count = ref 0 in List.map (fun cs -> incr count; (!count, cs)) callstacks in Format.fprintf fmt "%a" (Pretty_utils.pp_list ~sep:"@\n" (Pretty_utils.pp_pair ~pre:"stack " ~sep:": " Format.pp_print_int Value_types.Callstack.pretty)) numbered_callstacks let warn_nonterminating_statement stmt callstacks = Self.warning ~source:(fst (Stmt.loc stmt)) "non-terminating %a@\n%a" pretty_stmt_kind stmt pp_numbered_stacks callstacks let warn_dead_code stmt = Self.warning ~source:(fst (Stmt.loc stmt)) "%a is syntactically unreachable" pretty_stmt_kind stmt class dead_cc_collector kf = object inherit Visitor.frama_c_inplace val reachable = let first = Kernel_function.find_first_stmt kf in let initial_reachable = Stmt.Hptset.add first (Stmts_graph.reachable_stmts kf first) in ref initial_reachable val dead_ccs = ref [] val cur_cc = ref [] method get = (* the last cc may not have been finalized *) if !cur_cc <> [] then begin dead_ccs := !cur_cc :: !dead_ccs; cur_cc := [] end; !dead_ccs method! vstmt stmt = let new_succs cc s = List.filter (fun s' -> not (List.mem s' cc)) s.succs in if not (Stmt.Hptset.mem stmt !reachable) then begin (* add [stmt] and its successors to a connected component; if there is already one with [stmt], remain there, otherwise create a new one *) begin if !cur_cc = [] then begin let cc = stmt :: new_succs [] stmt in cur_cc := cc end else if List.mem stmt !cur_cc then begin (* part of same cc: update cc in previous list *) cur_cc := !cur_cc @ new_succs !cur_cc stmt; end else (* new cc *) begin dead_ccs := !cur_cc :: !dead_ccs; cur_cc := stmt :: new_succs [] stmt; end end; reachable := Stmt.Hptset.add stmt !reachable end; Cil.DoChildren end let warn_unreachable_statement stmt = Self.warning ~source:(fst (Stmt.loc stmt)) "unreachable %a" pretty_stmt_kind stmt class unreachable_stmt_visitor kf to_ignore = object inherit Visitor.frama_c_inplace val semantically_unreachable : stmt list ref = ref [] method get : stmt list = !semantically_unreachable val syntactically_reachable = let first = Kernel_function.find_first_stmt kf in let initial_reachable = Stmt.Hptset.add first (Stmts_graph.reachable_stmts kf first) in initial_reachable val semantically_considered = ref to_ignore method! vstmt stmt = if Stmt.Hptset.mem stmt syntactically_reachable && Db.Value.is_reachable_stmt stmt = false && not (Stmt.Hptset.mem stmt !semantically_considered) then begin (* add node and its reachable successors to the considered statements *) let cc = Stmt.Hptset.add stmt (Stmts_graph.reachable_stmts kf stmt) in semantically_considered := Stmt.Hptset.union !semantically_considered cc; semantically_unreachable := stmt :: !semantically_unreachable end; Cil.DoChildren end (* Unreachable returns only need to be checked if: 1. SyntacticallyUnreachable is disabled (otherwise it already checks them); 2. No warnings were emitted for the function (otherwise it may be redundant). *) let check_unreachable_returns kf = let st = Db.Value.get_initial_state kf in if Db.Value.is_reachable st then begin try let ret_stmt = Kernel_function.find_return kf in if not (Db.Value.is_reachable_stmt ret_stmt) then warn_unreachable_statement ret_stmt with | Kernel_function.No_Statement -> (* should never happen *) Self.error "function %a has no return statement, skipping" Kernel_function.pretty kf; end (* Checks [kf] for unreachable statements (ignoring those in [to_ignore]) and emits warnings. [warned_kfs] indicates functions which already had warnings emitted, to minimize the amount of redundant ones. *) let check_unreachable_statements kf ~to_ignore ~dead_code ~warned_kfs = if !Db.Value.use_spec_instead_of_definition kf then (* TODO: consider as non-terminating if spec has \terminates(false) or \ensures(false) *) Self.debug "not analyzing function %a@ \ (using specification instead of definition),@ \ considered as always terminating" Kernel_function.pretty kf else let st = Db.Value.get_initial_state kf in if Db.Value.is_reachable st then begin try let vis = new unreachable_stmt_visitor kf to_ignore in ignore (Visitor.visitFramacKf (vis :> Visitor.frama_c_visitor) kf); if dead_code then begin (* compute syntactically unreachable statements *) let vis = new dead_cc_collector kf in ignore (Visitor.visitFramacKf (vis :> Visitor.frama_c_visitor) kf); let cc_heads = List.map List.hd vis#get in Stmt.Hptset.iter (fun h -> warn_dead_code h) (Stmt.Hptset.of_list cc_heads) end else if not (Kernel_function.Set.mem kf warned_kfs) then check_unreachable_returns kf with | Kernel_function.No_Statement -> (* should never happen *) Self.error "function %a has no return statement, skipping" Kernel_function.pretty kf; end (* To avoid redundant warnings, calls to possibly non-terminating functions are ignored if: 1. the function is in the list of functions to be ignored; 2. or the function has a body AND its specification is not being used via -val-use-spec. In case 2, the call is ignored because non-terminating statements inside it will already be reported. *) let ignore_kf name = try let kf = Globals.Functions.find_by_name name in let has_definition = try ignore (Kernel_function.get_definition kf); true with Kernel_function.No_Definition -> false in match Ignore.mem name, !Db.Value.use_spec_instead_of_definition kf, has_definition with | true, _, _ -> true | false, false, true -> true | _, _, _ -> false with Not_found -> false (* simple statement collector: accumulates a list of all statements, except calls to functions in [to_ignore]. *) class stmt_collector = object inherit Visitor.frama_c_inplace val instr_stmts = ref [] method! vstmt stmt = begin match stmt.skind with | (Instr (Call (_, {enode = Lval (Var vi, _)}, _, _)) | Instr (Local_init (_, ConsInit(vi,_,_), _))) when (ignore_kf vi.vname) -> () | _ -> instr_stmts := stmt :: !instr_stmts end; Cil.DoChildren method get_instr_stmts = List.rev !instr_stmts end let get_callstack_state ~after stmt cs = match Db.Value.get_stmt_state_callstack ~after stmt with | None -> None (* unreachable stmt *) | Some table -> try Some (Value_types.Callstack.Hashtbl.find table cs) with Not_found -> None (* collects the list of non-terminating instructions *) let collect_nonterminating_statements fd nonterm_stacks = let vis = new stmt_collector in ignore (Visitor.visitFramacFunction (vis :> Visitor.frama_c_visitor) fd); let new_nonterm_stmts = ref Stmt.Hptset.empty in let add_stack stmt cs = new_nonterm_stmts := Stmt.Hptset.add stmt !new_nonterm_stmts; let prev_stack_list = try Hashtbl.find nonterm_stacks stmt with Not_found -> [] in Hashtbl.replace nonterm_stacks stmt (cs :: prev_stack_list) in List.iter (fun stmt -> match stmt.skind with | Block _ -> (* do not compute; already done for the block stmts *) () | _ -> let source = fst (Stmt.loc stmt) in Self.debug ~source "processing stmt:@ %a" Printer.pp_stmt stmt; match Db.Value.get_stmt_state_callstack ~after:false stmt with | None -> () (* unreachable stmt *) | Some before_table -> Value_types.Callstack.Hashtbl.iter (fun cs before_state -> try match Db.Value.get_stmt_state_callstack ~after:true stmt with | None -> (* no after table => non-terminating statement *) add_stack stmt cs | Some after_table -> let after_state = Value_types.Callstack.Hashtbl.find after_table cs in if Cvalue.Model.is_reachable before_state then if not (Cvalue.Model.is_reachable after_state) then add_stack stmt cs else if match stmt.skind with Loop _ -> true | _ -> false then begin (* special treatment for loops: even if their after state is reachable, we must check that at least one outgoing edge is reachable *) let out_edges = Stmts_graph.get_all_stmt_out_edges stmt in let all_out_edges_unreachable = List.for_all (fun (_, out_stmt) -> match get_callstack_state ~after:false out_stmt cs with | None -> true | Some state -> not (Cvalue.Model.is_reachable state) ) out_edges in if all_out_edges_unreachable then add_stack stmt cs end with | Not_found -> (* in this callstack, the statement is non-terminating *) add_stack stmt cs ) before_table ) vis#get_instr_stmts; !new_nonterm_stmts let rec cmp_callstacks_aux cs1 cs2 = match cs1, cs2 with | [], [] -> 0 | [], _ -> -1 | _, [] -> 1 | (kf1, ki1) :: r1, (kf2, ki2) :: r2 -> let c = Cil_datatype.Kinstr.compare ki1 ki2 in if c <> 0 then c else let c = Kernel_function.compare kf1 kf2 in if c <> 0 then c else cmp_callstacks_aux r1 r2 let cmp_callstacks cs1 cs2 = if cs1 == cs2 then 0 else cmp_callstacks_aux (List.rev cs1) (List.rev cs2) let run () = if not (Ast.is_computed ()) then Self.abort "nonterm requires a computed AST"; if not (Db.Value.is_computed ()) then Self.abort "nonterm requires a computed value analysis"; Self.debug "Starting analysis..."; let file = Ast.get () in let globals = file.globals in let nonterm_stacks = Hashtbl.create 13 in List.iter (fun glob -> match glob with | GFun (fd, _loc) -> let fname = fd.svar.vorig_name in if Ignore.mem fname then Self.debug "ignoring function: %s" fname else begin Self.debug "considering function: %s" fname; let new_nonterm_stmts = collect_nonterminating_statements fd nonterm_stacks in let warned_kfs = Stmt.Hptset.fold (fun stmt acc -> let cs = Hashtbl.find nonterm_stacks stmt in let cs = List.sort cmp_callstacks cs in warn_nonterminating_statement stmt cs; Kernel_function.Set.add (Kernel_function.find_englobing_kf stmt) acc ) new_nonterm_stmts Kernel_function.Set.empty in let kf = Globals.Functions.get fd.svar in check_unreachable_statements kf ~to_ignore:new_nonterm_stmts ~warned_kfs ~dead_code:(DeadCode.get()); end | _ -> () ) globals; Self.feedback ~level:2 "Analysis done." ;; let run_once, _ = State_builder.apply_once "Nonterm.run" [Db.Value.self] run let main () = if Enabled.get () then run_once () let () = Db.Main.extend main ������������frama-c-20.0-Calcium/src/plugins/obfuscator/��������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015632� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/Makefile.in���������������������������������������������0000666�0000000�0000000�00000004423�13571573400�017702� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif PLUGIN_DIR ?=. PLUGIN_ENABLE:=@ENABLE_OBFUSCATOR@ PLUGIN_NAME:=Obfuscator PLUGIN_CMO:= options \ obfuscator_kind \ dictionary \ obfuscate \ obfuscator_register PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure PLUGIN_NO_TEST:=yes include $(FRAMAC_SHARE)/Makefile.dynamic # Regenerating the Makefile on need ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif $(Obfuscator_DIR)/Makefile: $(Obfuscator_DIR)/Makefile.in \ $(CONFIG_STATUS_DIR)/config.status cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/Obfuscator.mli������������������������������������������0000666�0000000�0000000�00000003414�13571573400�020446� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Obfuscator plug-in. *) (** No function is directly exported: they are registered via {!Dynamic.register}. *) (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/configure�����������������������������������������������0000777�0000000�0000000�00000272051�13571573400�017550� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS ENABLE_OBFUSCATOR ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_obfuscator ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-obfuscator support for Obfuscator plug-in (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-obfuscator was given. if test "${enable_obfuscator+set}" = set; then : enableval=$enable_obfuscator; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "obfuscator is not available" "$LINENO" 5 fi FORCE_OBFUSCATOR=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_OBFUSCATOR ENABLE_OBFUSCATOR=$ENABLE NAME_OBFUSCATOR=obfuscator if test "$default" = "no" -a "$FORCE" = "no"; then INFO_OBFUSCATOR=" (not available by default)" fi echo "obfuscator... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/configure.ac��������������������������������������������0000666�0000000�0000000�00000004034�13571573400�020121� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)] ) check_plugin(obfuscator,PLUGIN_RELATIVE_PATH(plugin_file),[support for Obfuscator plug-in],yes) write_plugin_config(Makefile) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/dictionary.ml�������������������������������������������0000666�0000000�0000000�00000007512�13571573400�020336� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Dictionary = State_builder.Hashtbl (Obfuscator_kind.Hashtbl) (Datatype.String.Hashtbl.Make(Datatype.String)) (struct let name = "Obfuscator.Dictionary" let size = 97 let dependencies = [ Ast.self ] end) module Literal_strings = State_builder.Hashtbl (Datatype.String.Hashtbl) (Datatype.String) (struct let name = "Obfuscator.Literal_strings" let size = 17 let dependencies = [ Dictionary.self ] end) let fresh kind name = let h = Dictionary.memo (fun _ -> Datatype.String.Hashtbl.create 17) kind in let idx = Datatype.String.Hashtbl.length h + 1 in let fresh = Obfuscator_kind.prefix kind ^ string_of_int idx in Datatype.String.Hashtbl.add h fresh name; if kind = Obfuscator_kind.Literal_string && not (Literal_strings.mem name) then Literal_strings.add name fresh; fresh let id_of_literal_string = Literal_strings.find let iter_sorted_kind f k h = if Datatype.String.Hashtbl.length h > 0 then let f = f k in Datatype.String.Hashtbl.iter_sorted f h let iter_sorted f = let cmp k1 k2 = Datatype.String.compare (Obfuscator_kind.prefix k1) (Obfuscator_kind.prefix k2) in Dictionary.iter_sorted ~cmp (iter_sorted_kind f) let pretty_entry fmt k = Format.fprintf fmt "// %as@\n" Obfuscator_kind.pretty k; let quote = k = Obfuscator_kind.Literal_string in fun new_ old -> if quote then Format.fprintf fmt "#define %s %S@\n" new_ old else Format.fprintf fmt "#define %s %s@\n" new_ old let pretty_kind fmt k = try let h = Dictionary.find k in iter_sorted_kind (pretty_entry fmt) k h with Not_found -> () let pretty fmt = Format.fprintf fmt "\ /* *********************************** */@\n\ /* start of dictionary for obfuscation */@\n\ /* *********************************** */@\n"; iter_sorted (fun k -> if k = Obfuscator_kind.Literal_string then fun _ _ -> () else pretty_entry fmt k); Format.fprintf fmt "\ /*********************************** */@\n\ /* end of dictionary for obfuscation */@\n\ /*********************************** */@\n@\n" let mark_as_computed () = Dictionary.mark_as_computed () let is_computed () = Dictionary.is_computed () (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/dictionary.mli������������������������������������������0000666�0000000�0000000�00000004075�13571573400�020510� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val fresh: Obfuscator_kind.t -> string -> string (** Generate a fresh name of the given kind *) val id_of_literal_string: string -> string (** @return the generated name for a literal string. @raise Not_found if no name has already been generated. *) val pretty_kind: Format.formatter -> Obfuscator_kind.t -> unit val pretty: Format.formatter -> unit val mark_as_computed: unit -> unit val is_computed: unit -> bool (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/obfuscate.ml��������������������������������������������0000666�0000000�0000000�00000024602�13571573400�020143� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype let warn kind name = Options.warning ~once:true "unobfuscated %s name `%s'" kind name let has_literal_string = ref false class visitor = object inherit Visitor.frama_c_inplace val varinfos_visited = Varinfo.Hashtbl.create 17 val logic_vars_visited = Logic_var.Hashtbl.create 7 val id_pred_visited = Identified_predicate.Hashtbl.create 7 method! vtype = function | TFun(t, args, variadic, attrs) -> let args' = match args with | None -> None | Some l -> Some (List.map (fun (s,t,a) -> (Dictionary.fresh Obfuscator_kind.Formal_in_type s, t, a)) l) in Cil.ChangeDoChildrenPost(TFun(t,args',variadic,attrs), Extlib.id) | _ -> Cil.DoChildren method! vglob_aux = function | GType (ty,_) -> if not (Cil.typeHasAttribute "fc_stdlib" ty.ttype) then ty.tname <- Dictionary.fresh Obfuscator_kind.Type ty.tname; Cil.DoChildren | GVarDecl (v, _) | GVar (v, _, _) | GFun ({svar = v}, _) | GFunDecl (_, v, _) when Cil.is_unused_builtin v -> Cil.SkipChildren | _ -> Cil.DoChildren method! vcompinfo ci = ci.cname <- Dictionary.fresh Obfuscator_kind.Type ci.cname; Cil.DoChildren method! venuminfo ei = ei.ename <- Dictionary.fresh Obfuscator_kind.Type ei.ename; Cil.DoChildren method! vfieldinfo fi = fi.fname <- Dictionary.fresh Obfuscator_kind.Field fi.fname; Cil.DoChildren method! venumitem ei = ei.einame <- Dictionary.fresh Obfuscator_kind.Enum ei.einame; Cil.DoChildren method! vexpr e = match e.enode with | Const(CStr str) -> has_literal_string := true; (* ignore the result: will be handle by hacking the pretty printer *) (try ignore (Dictionary.id_of_literal_string str) with Not_found -> ignore (Dictionary.fresh Obfuscator_kind.Literal_string str)); Cil.SkipChildren | _ -> Cil.DoChildren method! vvdec vi = (* Varinfo can be visited (and obfuscated) more than once: functions for their declaration and definition, variables as parts of the type of the function, and in the body of the function declaration, etc. Thus we make sure that the obfuscator does not visit them twice *) if Varinfo.Hashtbl.mem varinfos_visited vi then Cil.SkipChildren else begin if Cil.isFunctionType vi.vtype then begin if vi.vname <> "main" && not (Cil.is_builtin vi) && not (Cil.is_special_builtin vi.vname) && not (Cil.hasAttribute "fc_stdlib" vi.vattr) then vi.vname <- Dictionary.fresh Obfuscator_kind.Function vi.vname end else begin let add = if vi.vglob then Dictionary.fresh Obfuscator_kind.Global_var else if vi.vformal then Dictionary.fresh Obfuscator_kind.Formal_var else Dictionary.fresh Obfuscator_kind.Local_var in vi.vname <- add vi.vname; end; Varinfo.Hashtbl.add varinfos_visited vi (); Cil.DoChildren end method! vlogic_var_decl lvi = match lvi.lv_kind with | LVGlobal | LVFormal | LVQuant | LVLocal -> if Logic_var.Hashtbl.mem logic_vars_visited lvi then Cil.SkipChildren else begin lvi.lv_name <- Dictionary.fresh Obfuscator_kind.Logic_var lvi.lv_name; Logic_var.Hashtbl.add logic_vars_visited lvi (); Cil.DoChildren end | LVC -> Cil.SkipChildren method! vstmt_aux stmt = let labels = List.map (function | Label(s, loc, true) -> (* only obfuscate user's labels, not Cil's ones *) let s' = Dictionary.fresh Obfuscator_kind.Label s in Label(s', loc, true) | Label(_, _, false) | Case _ | Default _ as label -> label) stmt.labels in stmt.labels <- labels; Cil.DoChildren method! videntified_predicate p = if Identified_predicate.Hashtbl.mem id_pred_visited p then Cil.SkipChildren else begin Identified_predicate.Hashtbl.add id_pred_visited p (); let names = p.ip_content.pred_name in let names' = List.map (Dictionary.fresh Obfuscator_kind.Predicate) names in let p' = { p with ip_content = { p.ip_content with pred_name = names'}} in Cil.ChangeDoChildrenPost (p', Extlib.id) end method! vterm t = List.iter (fun s -> warn "term" s) t.term_name; Cil.DoChildren method! vannotation = function | Daxiomatic(str, _, _, _) -> warn "axiomatic" str; Cil.DoChildren | Dlemma(str, axiom, _, _, _, _, _) -> warn (if axiom then "axiom" else "lemma") str; Cil.DoChildren | _ -> Cil.DoChildren method! vmodel_info mi = warn "model" mi.mi_name; Cil.DoChildren method! vlogic_type_info_decl lti = if not (Logic_env.is_builtin_logic_type lti.lt_name) then lti.lt_name <- Dictionary.fresh Obfuscator_kind.Logic_type lti.lt_name ; Cil.DoChildren method! vlogic_ctor_info_decl lci = if not (Logic_env.is_builtin_logic_ctor lci.ctor_name) then lci.ctor_name <- Dictionary.fresh Obfuscator_kind.Logic_constructor lci.ctor_name ; Cil.DoChildren method! vattr = function | Attr(str, _) | AttrAnnot str -> warn "attribute" str; Cil.DoChildren method! vattrparam p = (match p with | AStr str | ACons(str, _) | ADot(_, str) -> warn "attribute parameter" str | _ -> ()); Cil.DoChildren initializer has_literal_string := false end let obfuscate_behaviors () = (* inheriting method vbehavior or vspec does not work since only a copy of the piece of spec is provided. *) Globals.Functions.iter (fun kf -> let h = Datatype.String.Hashtbl.create 7 in Annotations.iter_behaviors (fun emitter b -> if Emitter.equal emitter Emitter.end_user && not (Cil.is_default_behavior b) then begin Annotations.remove_behavior ~force:true emitter kf b; let new_ = Dictionary.fresh Obfuscator_kind.Behavior b.b_name in Datatype.String.Hashtbl.add h b.b_name new_; b.b_name <- new_; Annotations.add_behaviors emitter kf [ b ]; end) kf; let handle_bnames iter remove add = iter (fun emitter l -> remove emitter kf l; add emitter kf (List.map (Datatype.String.Hashtbl.find h) l)) kf in handle_bnames Annotations.iter_complete (fun e kf l -> Annotations.remove_complete e kf l) (fun e kf l -> Annotations.add_complete e kf l); handle_bnames Annotations.iter_disjoint (fun e kf l -> Annotations.remove_disjoint e kf l) (fun e kf l -> Annotations.add_disjoint e kf l)) module UpdatePrinter (X: Printer.PrinterClass) = struct (* obfuscated printer *) class printer = object inherit X.printer as super method! constant fmt = function | CStr str -> Format.fprintf fmt "%s" (Dictionary.id_of_literal_string str) | c -> super#constant fmt c method! file fmt ast = if !has_literal_string then begin let string_fmt = if Options.Literal_string.is_default () then fmt else begin let file = Options.Literal_string.get () in try let cout = open_out file in Format.formatter_of_out_channel cout with Sys_error _ as exn -> Options.error "@[cannot generate the literal string dictionary \ into file `%s':@ %s@]" file (Printexc.to_string exn); fmt end in Format.fprintf string_fmt "\ /* *********************************************************** */@\n\ /* start of dictionary required to compile the obfuscated code */@\n\ /* *********************************************************** */@\n"; Dictionary.pretty_kind string_fmt Obfuscator_kind.Literal_string; Format.fprintf string_fmt "\ /* ********************************************************* */@\n\ /* end of dictionary required to compile the obfuscated code */@\n\ /* ********************************************************* */@\n@\n"; if fmt != string_fmt then begin Format.pp_print_flush string_fmt (); Format.fprintf fmt "\ /* include the dictionary of literal strings */@\n\ @[#include \"%s\"@]@\n@\n" (Options.Literal_string.get ()) end end; super#file fmt ast end end let obfuscate () = Dictionary.mark_as_computed (); obfuscate_behaviors (); Visitor.visitFramacFileSameGlobals (new visitor :> Visitor.frama_c_visitor) (Ast.get ()); Printer.update_printer (module UpdatePrinter: Printer.PrinterExtension) (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/obfuscate.mli�������������������������������������������0000666�0000000�0000000�00000003263�13571573400�020314� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val obfuscate : unit -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/obfuscator_kind.ml��������������������������������������0000666�0000000�0000000�00000006436�13571573400�021351� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type k = | Behavior | Enum | Field | Formal_var | Formal_in_type | Function | Global_var | Label | Literal_string | Local_var | Logic_var | Predicate | Type | Logic_type | Logic_constructor let name_of_kind = function | Behavior -> "behavior" | Enum -> "enum" | Field -> "field" | Formal_var -> "formal variable" | Formal_in_type -> "formal variable in fun type" | Function -> "function" | Global_var -> "global variable" | Label -> "label" | Literal_string -> "literal string" | Local_var -> "local variable" | Logic_var -> "logic variable" | Predicate -> "predicate" | Type -> "type" | Logic_type -> "logic type" | Logic_constructor -> "logic constructor" let prefix = function | Behavior -> "B" | Enum -> "E" | Field -> "M" | Formal_var -> "f" | Formal_in_type -> "ft" | Function -> "F" | Global_var -> "G" | Label -> "L" | Literal_string -> "LS" | Local_var -> "V" | Logic_var -> "LV" | Predicate -> "P" | Type -> "T" | Logic_type -> "LT" | Logic_constructor -> "LC" include Datatype.Make_with_collections (struct type t = k let name = "Obfuscator.kind" let reprs = [ Global_var ] let hash (k:k) = Hashtbl.hash k let equal (k1:k) k2 = k1 = k2 let compare (k1:k) k2 = Transitioning.Stdlib.compare k1 k2 let varname _ = "k" let internal_pretty_code = Datatype.undefined let copy = Datatype.identity let structural_descr = Structural_descr.t_abstract let rehash = Datatype.identity let mem_project = Datatype.never_any_project let pretty fmt k = Format.fprintf fmt "%s" (name_of_kind k) end) (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/obfuscator_kind.mli�������������������������������������0000666�0000000�0000000�00000003677�13571573400�021526� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type k = | Behavior | Enum | Field | Formal_var | Formal_in_type | Function | Global_var | Label | Literal_string | Local_var | Logic_var | Predicate | Type | Logic_type | Logic_constructor include Datatype.S_with_collections with type t = k val prefix: t -> string (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/obfuscator_register.ml����������������������������������0000666�0000000�0000000�00000006416�13571573400�022246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let disable_other_analyzers () = if Options.Run.get () then let selection = State_selection.Static.diff (Parameter_state.get_selection ()) (State_selection.Static.union (State_selection.of_list (Kernel.CodeOutput.self :: Options.states)) (* The command-line options that govern the creation of the AST must be preserved *) (State_selection.Static.with_codependencies Ast.self)) in Project.clear ~selection () let () = Cmdline.run_after_configuring_stage disable_other_analyzers let force_run () = if not (Dictionary.is_computed ()) then begin let old_printer = Printer.current_printer () in Obfuscate.obfuscate (); if Options.Dictionary.is_default () then Log.print_delayed Dictionary.pretty else begin let file = Options.Dictionary.get () in try let cout = open_out file in let fmt = Format.formatter_of_out_channel cout in Dictionary.pretty fmt with Sys_error _ as exn -> Options.error "@[cannot generate the dictionary into file `%s':@ %s@]" file (Printexc.to_string exn) end; File.pretty_ast (); Printer.set_printer old_printer end let force_run = Dynamic.register ~plugin:"Obfuscator" "force_run" (Datatype.func Datatype.unit Datatype.unit) ~journalize:true force_run let run () = if Options.Run.get () then begin force_run (); Cmdline.bail_out () (* stop Frama-C as specified by the -help message and by the discussion in Gitlab issue #491 *) end let () = Db.Main.extend run (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/options.ml����������������������������������������������0000666�0000000�0000000�00000005074�13571573400�017665� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "obfuscator" let shortname = "obfuscator" let help = "obfuscator for confidential code" end) module Run = False (struct let option_name = "-obfuscate" let help = "print an obfuscated version of the input files and exit.\n\ Disable any other Frama-C analysis." end) module Dictionary = Empty_string (struct let option_name = "-obfuscator-dictionary" let arg_name = "f" let help = "generate the dictionary into file <f> (on stdout by default)" end) module Literal_string = Empty_string (struct let option_name = "-obfuscator-string-dictionary" let arg_name = "f" let help = "generate the dictionary of literal strings into file <f> \ (in the same place than the code by default)" end) let states = [ Run.self; Dictionary.self; Literal_string.self ] (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/obfuscator/options.mli���������������������������������������������0000666�0000000�0000000�00000003465�13571573400�020040� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module Run: Parameter_sig.Bool module Dictionary: Parameter_sig.String module Literal_string: Parameter_sig.String val states: State.t list (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/occurrence/��������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015613� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/occurrence/Occurrence.mli������������������������������������������0000666�0000000�0000000�00000004415�13571573400�020412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Occurrence plug-in. *) open Cil_types (** Interface for the occurrence plugin. @see <../occurrence/index.html> internal documentation. *) module Register: sig val self: State.t val get_last_result: unit -> ((kernel_function option * kinstr * lval) list * varinfo) option val get: (varinfo -> (kernel_function option * kinstr * lval) list) (** Return the occurrences of the given varinfo. An occurrence [ki, lv] is a left-value [lv] which uses the location of [vi] at the position [ki]. *) val print_all: (unit -> unit) (** Print all the occurrence of each variable declarations. *) end (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/occurrence/options.ml����������������������������������������������0000666�0000000�0000000�00000003717�13571573400�017650� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "occurrence" let shortname = "occurrence" let help = "automatically computes where variables are used" end) module Print = False (struct let option_name = "-occurrence" let help = "print results of occurrence analysis" end) (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������frama-c-20.0-Calcium/src/plugins/occurrence/options.mli���������������������������������������������0000666�0000000�0000000�00000003311�13571573400�020007� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module Print: Parameter_sig.Bool (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/occurrence/register.ml���������������������������������������������0000666�0000000�0000000�00000021436�13571573400�017777� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype open Cil open Visitor open Options module Occurrence_datatype = Datatype.Triple(Datatype.Option(Kernel_function))(Kinstr)(Lval) module Occurrences: sig val add: varinfo -> kernel_function option -> kinstr -> lval -> unit val get: varinfo -> (kernel_function option * kinstr * lval) list val self: State.t val get_last_result: unit -> ((Kernel_function.t option * Cil_types.kinstr * (Cil_types.lhost * Cil_types.offset)) list * Cil_types.varinfo) option val iter: (varinfo -> (kernel_function option * kinstr * lval) list -> unit) -> unit val iter_sorted: (varinfo -> (kernel_function option * kinstr * lval) list -> unit) -> unit end = struct module IState = Cil_state_builder.Varinfo_hashtbl (Occurrence_datatype) (struct let size = 17 let name = "Occurrences.State" let dependencies = [ Db.Value.self ] end) module LastResult = State_builder.Option_ref (Varinfo) (struct let name = "Occurrences.LastResult" let dependencies = [ Ast.self; IState.self ] end) let add vi kf ki lv = IState.add vi (kf, ki, lv) let unsafe_get vi = try IState.find_all vi with Not_found -> [] let get vi = LastResult.set vi; unsafe_get vi let get_last_result () = try let vi = LastResult.get () in Some (unsafe_get vi, vi) with Not_found -> None let iter_aux fold f = let old, l = fold (fun v elt (old, l) -> match v, old with | v, None -> assert (l = []); Some v, [ elt ] | v, (Some old as some) when Varinfo.equal v old -> some, elt :: l | v, Some old -> f old l; Some v, [ elt ]) (None, []) in Extlib.may (fun v -> f v l) old let fold_sorted f init = let map = IState.fold Varinfo.Map.add Varinfo.Map.empty in Varinfo.Map.fold f map init let iter = iter_aux IState.fold let iter_sorted = iter_aux fold_sorted let self = IState.self end class occurrence = object (self) inherit Visitor.frama_c_inplace as super method! vlval lv = let ki = self#current_kinstr in if Db.Value.is_accessible ki then begin let z = !Db.Value.lval_to_zone ki lv in try Locations.Zone.fold_topset_ok (fun b _ () -> match b with | Base.Var (vi, _) | Base.Allocated (vi, _, _) -> Occurrences.add vi self#current_kf ki lv | _ -> () ) z () with Abstract_interp.Error_Top -> error ~current:true "Found completely imprecise value (%a). Ignoring@." Printer.pp_lval lv end; DoChildren method! vterm_lval tlv = (try let lv = !Db.Properties.Interp.term_lval_to_lval ~result:None tlv in ignore (self#vlval lv) with (* Translation to lval failed.*) | Db.Properties.Interp.No_conversion -> ()); DoChildren method! vstmt_aux s = !Db.progress (); super#vstmt_aux s initializer !Db.Value.compute () end type access_type = Read | Write | Both (** Try to find [lv] somewhere within a Cil value *) class is_sub_lval lv = object inherit Cil.nopCilVisitor method! vlval lv' = if Cil_datatype.Lval.equal lv lv' then raise Exit; DoChildren end (** Occurrence has found the given [lv] somewhere inside [ki]. We try to find whether this was inside a read or a write operation. This is difficult to do directly inside the {!occurrence} class, as the [vlval] method has no information about the origin of the lval it was called on *) let classify_accesses (_kf, ki, lv) = let vis = new is_sub_lval lv in let aux f v = try ignore (f vis v); false with Exit -> true in let is_lv = Cil_datatype.Lval.equal lv in let contained_exp = aux Cil.visitCilExpr in match ki with | Kglobal -> (* Probably initializers *) Read | Kstmt { skind = Instr i } -> (match i with | Set (lv', e, _) -> if is_lv lv' then if contained_exp e then Both else Write else Read | Call (Some lv', f, args, _) -> if is_lv lv' then if contained_exp f || List.exists contained_exp args then Both else Write else Read | Local_init (v, _, _) -> (match lv with | Var v', _ when Cil_datatype.Varinfo.equal v v' -> (* We are initializing v. We can't read from it at the same time. Hence, there's no need to perform the additional checks done in the cases above. *) Write | _ -> Read) | Asm (_, _, Some { asm_outputs; asm_inputs },_) -> if List.exists (fun (_, _, out) -> is_lv out) asm_outputs then if List.exists (fun (_, _, inp) -> contained_exp inp) asm_inputs then Both else Write else Read | _ -> Read) | _ -> Read let compute, _self = let run () = feedback "beginning analysis"; ignore (visitFramacFile (new occurrence) (Ast.get ())); feedback "analysis done" in State_builder.apply_once "Occurrence.compute" [ Occurrences.self ] run let get vi = compute (); try Occurrences.get vi with Not_found -> assert false let d_ki fmt = function | None, Kglobal -> Format.fprintf fmt "global" | Some kf, Kglobal -> Format.fprintf fmt "specification of %a" Kernel_function.pretty kf | _, Kstmt s -> Format.fprintf fmt "sid %d" s.sid let print_one fmt v l = Format.fprintf fmt "variable %s (%s):@\n" v.vname (if v.vglob then "global" else let kf_name = match l with | [] -> assert false | (Some kf, _, _) :: _ -> Kernel_function.get_name kf | (None,Kstmt _,_)::_ -> assert false | (None,Kglobal,_)::_ -> fatal "inconsistent context for occurrence of variable %s" v.vname in if v.vformal then "parameter of " ^ kf_name else "local of " ^ kf_name); List.iter (fun (kf, ki, lv) -> Format.fprintf fmt " %a: %a@\n" d_ki (kf,ki) Printer.pp_lval lv) l let print_all () = compute (); result "%t" (fun fmt -> Occurrences.iter_sorted (print_one fmt)) (* ************************************************************************** *) (* Exported API *) (* ************************************************************************** *) let self = Occurrences.self let get_last_result = Occurrences.get_last_result let get = Journal.register "Occurrence.get" (Datatype.func Varinfo.ty (* [JS 2011/04/01] Datatype.list buggy in presence of journalisation. See comment in datatype.ml *) (*(Datatype.list (Datatype.pair Kinstr.ty Lval.ty))*) (let module L = Datatype.List(Occurrence_datatype) in L.ty)) get let print_all = Journal.register "Occurrence.print_all" (Datatype.func Datatype.unit Datatype.unit) (* pb: print_all should take a formatter as argument *) print_all (* ************************************************************************** *) (* Main *) (* ************************************************************************** *) let main _fmt = if Print.get () then print_all () let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/occurrence/register_gui.ml�����������������������������������������0000666�0000000�0000000�00000021163�13571573400�020640� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Pretty_source open Gtk_helper open Cil_types open Cil_datatype (* Update the 'Occurrence' column of the gui filetree. *) let update_column = ref (fun _ -> ()) (* Are results shown? *) module Enabled = State_builder.Ref (Datatype.Bool) (struct let name = "Occurrence_gui.State" let dependencies = [Register.self] let default () = false end) module ShowRead = State_builder.Ref (Datatype.Bool) (struct let name = "Occurrence_gui.ShowRead" let dependencies = [] let default () = true end) module ShowWrite = State_builder.Ref (Datatype.Bool) (struct let name = "Occurrence_gui.ShowWrite" let dependencies = [] let default () = true end) let consider_access () = match ShowRead.get (), ShowWrite.get () with | false, false -> (fun _ -> false) | true, true -> (fun _ -> true) | true, false -> (fun ak -> ak = Register.Read || ak = Register.Both) | false, true -> (fun ak -> ak = Register.Write || ak = Register.Both) let filter_accesses l = match ShowRead.get (), ShowWrite.get () with | false, false -> [] | true, true -> l | true, false | false, true -> let f = consider_access () in List.filter (fun access -> f (Register.classify_accesses access)) l let _ignore = Dynamic.register ~plugin:"Occurrence" ~journalize:false "Enabled.set" (Datatype.func Datatype.bool Datatype.unit) Enabled.set let _ignore = Dynamic.register ~plugin:"Occurrence" ~journalize:false "Enabled.get" (Datatype.func Datatype.unit Datatype.bool) Enabled.get let find_occurrence (main_ui:Design.main_window_extension_points) vi () = try ignore (Register.get vi); Enabled.set true; !update_column `Contents; main_ui#rehighlight () with | Globals.No_such_entry_point _ -> GToolbox.message_box ~title:"Error" "Error: Occurrence requires a main function" let apply_on_vi f localizable = match localizable with | PVDecl(_,_,vi) | PLval(_, _, (Var vi, NoOffset)) | PTermLval(_, _, _, (TVar { lv_origin = Some vi }, TNoOffset)) -> if not (Cil.isFunctionType vi.vtype) then f vi | _ -> () let occurrence_highlighter buffer loc ~start ~stop = if Enabled.get () then match Register.get_last_result () with | None -> (* occurrence not computed *) () | Some (result, vi) -> let result = filter_accesses result in let buffer = buffer#buffer in let highlight () = let tag = make_tag buffer "occurrence" [`BACKGROUND "yellow" ] in apply_tag buffer tag start stop in match loc with | PLval (_, ki, lval) -> let same_lval (_kf, k, l) = Kinstr.equal k ki && Lval.equal l lval in if List.exists same_lval result then highlight () | PTermLval (_,ki,_,term_lval) -> let same_tlval (_kf, k, l) = Logic_utils.is_same_tlval (Logic_utils.lval_to_term_lval ~cast:true l) term_lval && Kinstr.equal k ki in if List.exists same_tlval result then highlight () | PVDecl(_, _,vi') when Varinfo.equal vi vi' -> highlight () | PExp _ | PVDecl _ | PStmt _ | PStmtStart _ | PGlobal _ | PIP _ -> () module FollowFocus = State_builder.Ref (Datatype.Bool) (struct let name = "Occurrence_gui.FollowFocus" let dependencies = [] let default () = false end) let occurrence_panel main_ui = let w = GPack.vbox () in (* Selected Var display *) let selected_var_box = GPack.hbox ~packing:w#pack () in ignore (GMisc.label ~xalign:0.0 ~text:"Current var: " ~packing:(selected_var_box#pack ~expand:false) ()); let e = GMisc.label ~xalign:0.0 ~selectable:true ~packing:(selected_var_box#pack ~expand:true ~fill:true) () in e#set_use_markup true; old_gtk_compat e#set_single_line_mode true; (* check_button enabled *) let refresh_enabled_button = on_bool w "Enable" Enabled.get (fun v -> Enabled.set v; !update_column `Visibility; main_ui#rehighlight ()) in (* check_button followFocus *) let refresh_followFocus = on_bool w "Follow focus" FollowFocus.get FollowFocus.set in let h_read_write = GPack.hbox ~packing:w#pack () in let refresh_rw_aux f v = f v; main_ui#file_tree#reset(); main_ui#rehighlight () in let refresh_read = Gtk_helper.on_bool ~tooltip:"Show only occurrences where the zone is read" h_read_write "Read" ShowRead.get (refresh_rw_aux ShowRead.set) in let refresh_write = Gtk_helper.on_bool ~tooltip:"Show only occurrences where the zone is written" h_read_write "Write" ShowWrite.get (refresh_rw_aux ShowWrite.set) in let refresh = let old_vi = ref (-2) in (fun () -> refresh_read(); refresh_write (); refresh_followFocus (); refresh_enabled_button (); let new_result = Register.get_last_result () in (match new_result with | None when !old_vi<> -1 -> old_vi := -1; e#set_label "<i>None</i>" | Some (_,vi) when vi.vid<> !old_vi-> old_vi := vi.vid; e#set_label vi.vname | _ -> ())) in "Occurrence",w#coerce,Some refresh let occurrence_selector (popup_factory:GMenu.menu GMenu.factory) main_ui ~button localizable = apply_on_vi (fun vi -> if button = 3 || FollowFocus.get () then begin let callback = find_occurrence main_ui vi in ignore (popup_factory#add_item "_Occurrence" ~callback); if FollowFocus.get () then ignore (Glib.Idle.add (fun () -> callback (); false)) end) localizable let file_tree_decorate (file_tree:Filetree.t) = update_column := file_tree#append_pixbuf_column ~title:"Occurrence" (fun globs -> match Register.get_last_result () with | None -> (* occurrence not computed *) [`STOCK_ID ""] | Some (result, _) -> let in_globals (kf,ki,_ as access) = (let ak = Register.classify_accesses access in consider_access () ak) && match ki with | Kglobal -> false | Kstmt _ -> let kf = Extlib.the kf in let v0 = Kernel_function.get_vi kf in List.exists (fun glob -> match glob with | GFun ({svar =v1},_ ) -> Varinfo.equal v1 v0 | _ -> false) globs in if List.exists in_globals result then [`STOCK_ID "gtk-apply"] else [`STOCK_ID ""]) (fun () -> Enabled.get ()); !update_column `Visibility let main main_ui = main_ui#register_source_selector occurrence_selector; main_ui#register_source_highlighter occurrence_highlighter; main_ui#register_panel occurrence_panel; file_tree_decorate main_ui#file_tree; ;; let () = Design.register_extension main (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/occurrence/register_gui.mli����������������������������������������0000666�0000000�0000000�00000003537�13571573400�021016� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: register_gui.mli,v 1.4 2008-11-26 15:50:25 uid568 Exp $ *) (** Extension of the GUI for the occurrence plugin. *) (** No function is directly exported: this module simply extends the GUI. *) (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/���������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014235� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/Pdg.mli��������������������������������������������������������0000666�0000000�0000000�00000003424�13571573400�015455� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Program Dependences Graph. *) (** Functions for this plugin are registered through the [Db] module, the dynamic API, and the module Below. *) module Register : module type of Marks ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/annot.ml�������������������������������������������������������0000666�0000000�0000000�00000017425�13571573400�015717� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype open PdgIndex type data_info = ((PdgTypes.Node.t * Locations.Zone.t option) list * Locations.Zone.t option) option type ctrl_info = PdgTypes.Node.t list type decl_info = PdgTypes.Node.t list let zone_info_nodes pdg data_info = let add_info_nodes pdg (nodes_acc, undef_acc) info = let stmt = info.Db.Properties.Interp.To_zone.ki in let before = info.Db.Properties.Interp.To_zone.before in let zone = info.Db.Properties.Interp.To_zone.zone in Pdg_parameters.debug ~level:2 "[pdg:annotation] need %a %s stmt %d@." Locations.Zone.pretty zone (if before then "before" else "after") stmt.sid; let nodes, undef_loc = Sets.find_location_nodes_at_stmt pdg stmt ~before zone in let undef_acc = match undef_acc, undef_loc with | None, _ -> undef_loc | _, None -> undef_acc | Some z1, Some z2 -> Some (Locations.Zone.join z1 z2) in (nodes @ nodes_acc, undef_acc) in match data_info with | None -> None (* To_zone.xxx didn't manage to compute the zone *) | Some data_info -> let data_dpds = ([], None) in let data_dpds = List.fold_left (add_info_nodes pdg) data_dpds data_info in Some data_dpds let get_decl_nodes pdg decl_info = let add_decl_nodes decl_var nodes_acc = let node = Sets.find_decl_var_node pdg decl_var in node::nodes_acc in Varinfo.Set.fold add_decl_nodes decl_info [] let find_nodes_for_function_contract pdg f_interpret = let kf = PdgTypes.Pdg.get_kf pdg in let (data_info, decl_label_info) = f_interpret kf in let data_dpds = zone_info_nodes pdg data_info in let decl_nodes = (* No way to get stmt from labels of at construct into function contracts *) get_decl_nodes pdg decl_label_info.Db.Properties.Interp.To_zone.var in decl_nodes, data_dpds let find_fun_precond_nodes (pdg:PdgTypes.Pdg.t) p = let f_interpret kf = let f_ctx = !Db.Properties.Interp.To_zone.mk_ctx_func_contrat ~state_opt:(Some true) kf in !Db.Properties.Interp.To_zone.from_pred p f_ctx in find_nodes_for_function_contract pdg f_interpret let find_fun_postcond_nodes pdg p = let f_interpret kf = let f_ctx = !Db.Properties.Interp.To_zone.mk_ctx_func_contrat ~state_opt:(Some false) kf in !Db.Properties.Interp.To_zone.from_pred p f_ctx in let nodes,deps = find_nodes_for_function_contract pdg f_interpret in let nodes = (* find is \result is used in p, and if it is the case, * add the node [Sets.find_output_node pdg] * to the returned list of nodes. *) if !Db.Properties.Interp.to_result_from_pred p then (Sets.find_output_node pdg)::nodes else nodes in nodes,deps let find_fun_variant_nodes pdg t = let f_interpret kf = let f_ctx = !Db.Properties.Interp.To_zone.mk_ctx_func_contrat ~state_opt:(Some true) kf in !Db.Properties.Interp.To_zone.from_term t f_ctx in find_nodes_for_function_contract pdg f_interpret let find_code_annot_nodes pdg stmt annot = Pdg_parameters.debug "[pdg:annotation] CodeAnnot-%d stmt %d : %a @." annot.annot_id stmt.sid Printer.pp_code_annotation annot; if Db.Value.is_reachable_stmt stmt then begin let kf = PdgTypes.Pdg.get_kf pdg in let (data_info, decl_label_info), pragmas = !Db.Properties.Interp.To_zone.from_stmt_annot annot (stmt, kf) in let data_dpds = zone_info_nodes pdg data_info in let decl_nodes = get_decl_nodes pdg decl_label_info.Db.Properties.Interp.To_zone.var in let labels = decl_label_info.Db.Properties.Interp.To_zone.lbl in let stmt_key = Key.stmt_key stmt in let stmt_node = match stmt_key with | Key.Stmt _ -> !Db.Pdg.find_stmt_node pdg stmt | Key.CallStmt _ -> !Db.Pdg.find_call_ctrl_node pdg stmt | _ -> assert false in let ctrl_dpds = !Db.Pdg.direct_ctrl_dpds pdg stmt_node in let add_stmt_nodes s acc = try !Db.Pdg.find_stmt_and_blocks_nodes pdg s @ acc with Not_found -> acc in (* can safely ignore pragmas.ctrl * because we already have the ctrl dpds from the stmt node. *) let stmt_pragmas = pragmas.Db.Properties.Interp.To_zone.stmt in let ctrl_dpds = Stmt.Set.fold add_stmt_nodes stmt_pragmas ctrl_dpds in let add_label_nodes l acc = match l with | StmtLabel stmt -> (* TODO: we could be more precise here if we knew which label * is really useful... *) let add acc l = try (Sets.find_label_node pdg !stmt l)::acc with Not_found -> acc in List.fold_left add acc (!stmt).labels | FormalLabel _ | BuiltinLabel _ -> acc in let ctrl_dpds = Logic_label.Set.fold add_label_nodes labels ctrl_dpds in if Pdg_parameters.debug_atleast 2 then begin let p fmt (n,z) = match z with | None -> PdgTypes.Node.pretty fmt n | Some z -> Format.fprintf fmt "%a(%a)" PdgTypes.Node.pretty n Locations.Zone.pretty z in let pl fmt l = List.iter (fun n -> Format.fprintf fmt " %a" p n) l in Pdg_parameters.debug " ctrl nodes = %a" PdgTypes.Node.pretty_list ctrl_dpds; Pdg_parameters.debug " decl nodes = %a" PdgTypes.Node.pretty_list decl_nodes; match data_dpds with | None -> Pdg_parameters.debug " data nodes = None (failed to compute)" | Some (data_nodes, data_undef) -> begin Pdg_parameters.debug " data nodes = %a" pl data_nodes; match data_undef with | None -> () | Some data_undef -> Pdg_parameters.debug " data undef = %a" Locations.Zone.pretty data_undef; end end; ctrl_dpds, decl_nodes, data_dpds end else begin Pdg_parameters.debug ~level:2 "[pdg:annotation] CodeAnnot-%d : unreachable stmt ! @." annot.annot_id; raise Not_found (* unreachable statement *) end (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/annot.mli������������������������������������������������������0000666�0000000�0000000�00000005462�13571573400�016066� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** All these functions find the nodes needed for various kind of annotations. * * @raise Kernel_function.No_Definition on annotations for function declarations. * * *) (** [data_info] is composed of [(node,z_part) list, undef_loc)] * and correspond to data dependencies nodes. * Can be None if we don't know how to compute them. *) type data_info = ((PdgTypes.Node.t * Locations.Zone.t option) list * Locations.Zone.t option) option (** [ctrl_info] correspond to control dependencies nodes *) type ctrl_info = PdgTypes.Node.t list (** [decl_info] correspond to the declarations nodes of the variables needed to * parse the annotation *) type decl_info = PdgTypes.Node.t list (** @raise Not_found when the statement is unreachable. *) val find_code_annot_nodes : PdgTypes.Pdg.t -> Cil_types.stmt -> Cil_types.code_annotation -> ctrl_info * decl_info * data_info val find_fun_precond_nodes : PdgTypes.Pdg.t -> Cil_types.predicate -> decl_info * data_info val find_fun_postcond_nodes : PdgTypes.Pdg.t -> Cil_types.predicate -> decl_info * data_info val find_fun_variant_nodes : PdgTypes.Pdg.t -> Cil_types.term -> decl_info * data_info (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/build.ml�������������������������������������������������������0000666�0000000�0000000�00000120152�13571573400�015667� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Build graphs (PDG) for the function (see module {!module: Build.BuildPdg}) to represent the dependencies between instructions in order to use it for slicing purposes. A function is processed using a forward dataflow analysis (see module {{: ../html/Dataflow2.html}Dataflow2} which is instantiated with the module {!module: Build.Computer} below). *) let dkey = Pdg_parameters.register_category "build" let debug fmt = Pdg_parameters.debug ~dkey fmt let debug2 fmt = Pdg_parameters.debug ~dkey fmt ~level:2 open Cil_types open Cil_datatype open PdgTypes open PdgIndex (* exception Err_Top of string *) exception Err_Bot of string (** set of nodes of the graph *) module BoolNodeSet = FCSet.Make(Datatype.Pair(Datatype.Bool)(PdgTypes.Node)) let pretty_node ?(key=false) fmt n = PdgTypes.Node.pretty fmt n; if key then Format.fprintf fmt ": %a" PdgIndex.Key.pretty (PdgTypes.Node.elem_key n) let is_variadic kf = let varf = Kernel_function.get_vi kf in match varf.vtype with | TFun (_, _, is_variadic, _) -> is_variadic | _ -> Pdg_parameters.fatal "The variable of a kernel_function has to be a function !" (* -------------------------------------------------------------------------- *) (* --- Auxiliary functions --- *) (* -------------------------------------------------------------------------- *) type arg_nodes = Node.t list (** type of the whole PDG representation during its building process *) type pdg_build = { fct : kernel_function; mutable topinput : PdgTypes.Node.t option; mutable other_inputs : (PdgTypes.Node.t * Dpd.td * Locations.Zone.t) list; graph : G.t; states : Pdg_state.states; index : PdgTypes.Pdg.fi; ctrl_dpds : BoolNodeSet.t Stmt.Hashtbl.t ; (** The nodes to which each stmt control-depend on. * The links will be added in the graph at the end. *) decl_nodes : Node.t Varinfo.Hashtbl.t ; (** map between declaration nodes and the variables to build the dependencies. *) } (** create an empty build pdg for the function*) let create_pdg_build kf = let nb_stmts = if !Db.Value.use_spec_instead_of_definition kf then 17 else List.length (Kernel_function.get_definition kf).sallstmts in let index = FctIndex.create nb_stmts in let states = Stmt.Hashtbl.create nb_stmts in let graph = G.create () in { fct = kf; graph = graph; states = states; index = index; topinput = None; other_inputs = []; ctrl_dpds = Stmt.Hashtbl.create nb_stmts ; decl_nodes = Varinfo.Hashtbl.create 10 ; } let _pretty fmt pdg = PdgTypes.Pdg.pretty_graph fmt pdg.graph (** add a node to the PDG, but if it is associated with a stmt, check before if it doesn't exist already (useful for loops). @return the (new or old) node. *) let add_elem pdg key = match key with | Key.CallStmt _ -> assert false | _ -> try FctIndex.find_info pdg.index key with Not_found -> let new_node = G.add_elem pdg.graph key in debug "add_new_node %a@." (pretty_node ~key:true) new_node; FctIndex.add pdg.index key new_node; new_node let decl_var pdg var = let new_node = add_elem pdg (Key.decl_var_key var) in Varinfo.Hashtbl.add pdg.decl_nodes var new_node; new_node let get_var_base zone = try let base, _ = Locations.Zone.find_lonely_key zone in match base with | Base.Var (var,_) -> Some var | _ -> None with Not_found -> None (** add a dependency with the given label between the two nodes. Pre : the nodes have to be already in pdg. *) let add_dpd_in_g graph v1 dpd_kind part_opt v2 = debug "add_dpd : %a -%a-> %a@." PdgTypes.Node.pretty v1 Dpd.pretty_td dpd_kind PdgTypes.Node.pretty v2; G.add_dpd graph v1 dpd_kind part_opt v2 let add_z_dpd pdg n1 k z_part n2 = add_dpd_in_g pdg.graph n1 k z_part n2 let add_ctrl_dpd pdg n1 n2 = add_dpd_in_g pdg.graph n1 Dpd.Ctrl None n2 let add_decl_dpd pdg n1 k n2 = add_dpd_in_g pdg.graph n1 k None n2 (** add a dependency on the variable declaration. The kind of the dependency is address if the variable appears in a lvalue, data otherwise. *) let add_decl_dpds pdg node dpd_kind varset = let add_dpd var = try let var_decl_node = Varinfo.Hashtbl.find pdg.decl_nodes var in add_decl_dpd pdg node dpd_kind var_decl_node with Not_found -> () in Varinfo.Set.iter add_dpd varset (** [add_dpds pdg v dpd_kind state loc] * add 'dpd_kind' dependencies from node n to each element * which are stored for loc in state *) let add_dpds pdg n dpd_kind state loc = let add (node,z_part) = (* we only use [z_part] for dependencies to OutCall. * Would it be interesting to have it on other cases ? *) let z_part = match PdgTypes.Node.elem_key node with | PdgIndex.Key.SigCallKey (_, PdgIndex.Signature.Out (PdgIndex.Signature.OutLoc _)) -> z_part | _ -> None in add_z_dpd pdg n dpd_kind z_part node in let nodes, undef_zone = Pdg_state.get_loc_nodes state loc in List.iter add nodes; match undef_zone with | None -> () | Some undef_zone -> pdg.other_inputs <- (n, dpd_kind, undef_zone) :: pdg.other_inputs (** Process and clear [pdg.ctrl_dpds] which contains a mapping between the * statements and the control dependencies that have to be added to the * statement nodes. * Because some jump nodes can vanish due to optimisations using the value * analysis, we can not rely on the transitivity of the dependencies. * So let's compute a transitive closure of the control dependencies. * The table gives : stmt -> ctrl dependency nodes of the statement. * So for each stmt, we have to find if some of its ctrl nodes * also have dependencies that have to be added to the stmt. * *) let add_ctrl_dpds pdg = let add_indirect ctrl_node_set = (* Also add the ctrl_node dependencies to the set. * TODOopt: probably a better way to do that if it happens to work ! *) let rec add_node (real, n) (acc, seen) = if BoolNodeSet.mem (real, n) seen then (acc, seen) else let seen = BoolNodeSet.add (real, n) seen in let acc = if real then BoolNodeSet.add (true, n) acc else acc in add_rec n (acc, seen) and add_rec ctrl_node acc = match PdgTypes.Node.elem_key ctrl_node with | Key.Stmt ctrl_stmt -> (try let stmt_dpds = Stmt.Hashtbl.find pdg.ctrl_dpds ctrl_stmt in BoolNodeSet.fold add_node stmt_dpds acc with Not_found -> acc) | _ -> (* strange control dependency ! Ignore. *) acc in let acc = BoolNodeSet.empty, BoolNodeSet.empty in let acc, _ = BoolNodeSet.fold add_node ctrl_node_set acc in acc in let add_stmt_ctrl_dpd stmt ctrl_node_set = let stmt_nodes = try FctIndex.find_all pdg.index (Key.stmt_key stmt) with Not_found -> [] (* some stmts have no node if they are dead code for instance*) in let label_nodes acc label = try acc @ FctIndex.find_all pdg.index (Key.label_key stmt label) with Not_found -> acc in let stmt_nodes = List.fold_left label_nodes stmt_nodes stmt.labels in let ctrl_node_set = add_indirect ctrl_node_set in let add_node_ctrl_dpds stmt_node = BoolNodeSet.iter (fun (_, n) -> add_ctrl_dpd pdg stmt_node n) ctrl_node_set in List.iter add_node_ctrl_dpds stmt_nodes in Stmt.Hashtbl.iter add_stmt_ctrl_dpd pdg.ctrl_dpds; Stmt.Hashtbl.clear pdg.ctrl_dpds let process_declarations pdg ~formals ~locals = (** 2 new nodes for each formal parameters : one for its declaration, and one for its values. This is because it might be the case that we only need the declaration whatever the value is. Might allow us to do a better slicing of the callers. TODO: normally, the value should depend on the the declaration, but because we don't know how to select a declaration without selecting the value at the moment, we do the dependence the other way round. *) let do_param (n, state) v = let decl_node = decl_var pdg v in let new_node = add_elem pdg (Key.param_key n) in add_decl_dpd pdg new_node Dpd.Addr decl_node ; add_decl_dpd pdg decl_node Dpd.Addr new_node ; let z = Locations.zone_of_varinfo v in let new_state = Pdg_state.add_loc_node state ~exact:true z new_node in (n+1, new_state) in let _next_in_num, new_state = List.fold_left do_param (1, Pdg_state.empty) formals in List.iter (fun v -> ignore (decl_var pdg v)) locals; new_state let ctrl_call_node pdg call_stmt = try FctIndex.find_info pdg.index (Key.call_ctrl_key call_stmt) with Not_found -> assert false let process_call_args pdg d_state stmt args_dpds : arg_nodes = let num = ref 1 in let process_arg (dpds, decl_dpds) = let new_node = add_elem pdg (Key.call_input_key stmt !num) in add_dpds pdg new_node Dpd.Data d_state dpds; add_decl_dpds pdg new_node Dpd.Data decl_dpds; incr num; new_node in List.map process_arg args_dpds (** Add a PDG node for each formal argument, * and add its dependencies to the corresponding argument node. *) let process_call_params pdg d_state stmt called_kf (arg_nodes:arg_nodes) = let ctrl_node = ctrl_call_node pdg stmt in let param_list = Kernel_function.get_formals called_kf in let process_param state param arg = let new_node = arg in add_ctrl_dpd pdg new_node ctrl_node; let z = Locations.zone_of_varinfo param in Pdg_state.add_loc_node state z new_node ~exact:true in let rec do_param_arg state param_list (arg_nodes: arg_nodes) = match param_list, arg_nodes with | [], [] -> state | p :: param_list, a :: arg_nodes -> let state = process_param state p a in do_param_arg state param_list arg_nodes | [], _ -> (* call to a variadic function *) (* warning already sent during 'from' computation. *) state | _, [] -> Pdg_parameters.fatal "call to a function with to few arguments" in do_param_arg d_state param_list arg_nodes let create_call_output_node pdg state stmt out_key out_from fct_dpds = let new_node = add_elem pdg out_key in add_dpds pdg new_node Dpd.Data state out_from; add_dpds pdg new_node Dpd.Ctrl state fct_dpds; let ctrl_node = ctrl_call_node pdg stmt in add_ctrl_dpd pdg new_node ctrl_node; new_node (** creates a node for lval : caller has to add dpds about the right part *) let create_lval_node pdg state key ~l_loc ~exact ~l_dpds ~l_decl = let new_node = add_elem pdg key in add_dpds pdg new_node Dpd.Addr state l_dpds; add_decl_dpds pdg new_node Dpd.Addr l_decl; let new_state = Pdg_state.add_loc_node state exact l_loc new_node in (new_node, new_state) let add_from pdg state_before state lval (default, deps) = let new_node = add_elem pdg (Key.out_from_key lval) in let exact = (not default) in let state = Pdg_state.add_loc_node state exact lval new_node in add_dpds pdg new_node Dpd.Data state_before deps; state let process_call_output pdg state_before_call state stmt out default from_out fct_dpds = let exact = (not default) in debug "call-%d Out : %a From %a (%sexact)@." stmt.sid Locations.Zone.pretty out Locations.Zone.pretty from_out (if exact then "" else "not "); let key = Key.call_output_key stmt out in let new_node = create_call_output_node pdg state_before_call stmt key from_out fct_dpds in let state = Pdg_state.add_loc_node state exact out new_node in state (** mix between process_call_output and process_asgn *) let process_call_return pdg state_before_call state_with_inputs stmt ~l_loc ~exact ~l_dpds ~l_decl ~r_dpds fct_dpds = let out_key = Key.call_outret_key stmt in let new_node = create_call_output_node pdg state_with_inputs stmt out_key r_dpds fct_dpds in add_dpds pdg new_node Dpd.Addr state_before_call l_dpds; add_decl_dpds pdg new_node Dpd.Addr l_decl; let new_state = Pdg_state.add_loc_node state_before_call exact l_loc new_node in new_state (** for skip statement : we want to add a node in the PDG in order to be able * to store information (like marks) about this statement later on *) let process_skip pdg state stmt = ignore (add_elem pdg (Key.stmt_key stmt)); state (** for asm: similar to [process_skip], except that we emit a warning *) let process_asm pdg state stmt = Pdg_parameters.warning ~once:true ~current:true "Ignoring inline assembly code"; ignore (add_elem pdg (Key.stmt_key stmt)); state let add_label pdg label label_stmt = let key = Key.label_key label_stmt label in try FctIndex.find_info pdg.index key with Not_found -> add_elem pdg key let process_stmt_labels pdg stmt = let add label = match label with | Label _ -> ignore (add_label pdg label stmt) | _ -> (* see [add_dpd_switch_cases] *) () in List.iter add stmt.labels let add_label_and_dpd pdg label label_stmt jump_node = let label_node = add_label pdg label label_stmt in add_ctrl_dpd pdg jump_node label_node let add_dpd_goto_label pdg goto_node dest_goto = let rec pickLabel = function | [] -> None | Label _ as lab :: _ -> Some lab | _ :: rest -> pickLabel rest in let label = match pickLabel dest_goto.labels with | Some label -> label | None -> (* break and continue might not jump to a stmt with label : create one*) let lname = Printf.sprintf "fc_stmt_%d" dest_goto.sid in let label = Label (lname, Cil_datatype.Stmt.loc dest_goto, false) in dest_goto.labels <- label::dest_goto.labels; label in add_label_and_dpd pdg label dest_goto goto_node let add_dpd_switch_cases pdg switch_node case_stmts = let add_case stmt = let rec pickLabel = function | [] -> None | Case _ as lab :: _ -> Some lab | Default _ as lab :: _ -> Some lab | _ :: rest -> pickLabel rest in match pickLabel stmt.labels with | Some label -> add_label_and_dpd pdg label stmt switch_node | None -> assert false (* switch sans case ou default ??? *) in List.iter add_case case_stmts (** The control dependencies are stored : they will be added at the end by [finalize_pdg] *) let store_ctrl_dpds pdg node iterator (real_dpd, controlled_stmt) = debug2 "store_ctrl_dpds on %a (real = %b)@." (pretty_node ~key:true) node real_dpd ; let add_ctrl_dpd stmt = let new_dpds = try let old_dpds = Stmt.Hashtbl.find pdg.ctrl_dpds stmt in BoolNodeSet.add (real_dpd, node) old_dpds with Not_found -> BoolNodeSet.singleton (real_dpd, node) in Stmt.Hashtbl.replace pdg.ctrl_dpds stmt new_dpds in iterator add_ctrl_dpd controlled_stmt let mk_jump_node pdg stmt controlled_stmts = let new_node = add_elem pdg (Key.stmt_key stmt) in begin match stmt.skind with | If _ | Loop _ | Return _ -> () | Break _ | Continue _ -> (* can use : add_dpd_goto_label pdg new_node s * if we want later to change break and continue to goto... *) () | Goto (sref,_) -> add_dpd_goto_label pdg new_node !sref | Switch (_,_,stmts,_) -> add_dpd_switch_cases pdg new_node stmts | _ -> assert false end; store_ctrl_dpds pdg new_node Stmt.Hptset.iter controlled_stmts; new_node (** Add a node for a stmt that is a jump. Add control dependencies from this node to the nodes which correspond to the stmt list. Also add dependencies for the jump to the label. Don't use for jumps with data dependencies : use [process_jump_with_exp] instead ! *) let process_jump pdg stmt controlled_stmts = ignore (mk_jump_node pdg stmt controlled_stmts) (** like [process_jump] but also add data dependencies on the data and their declarations. Use for conditional jumps and returns. *) let process_jump_with_exp pdg stmt controlled_stmts state loc_cond decls_cond = let jump_node = mk_jump_node pdg stmt controlled_stmts in add_dpds pdg jump_node Dpd.Data state loc_cond; add_decl_dpds pdg jump_node Dpd.Data decls_cond let add_blk_ctrl_dpds pdg key bstmts = let new_node = add_elem pdg key in store_ctrl_dpds pdg new_node List.iter (true, bstmts) let process_block pdg stmt blk = add_blk_ctrl_dpds pdg (Key.stmt_key stmt) blk.bstmts let process_entry_point pdg bstmts = add_blk_ctrl_dpds pdg Key.entry_point bstmts let create_fun_output_node pdg state dpds = let new_node = add_elem pdg Key.output_key in match state with | Some state -> add_dpds pdg new_node Dpd.Data state dpds | None -> (* return is unreachable *) () (** add a node corresponding to the returned value. *) let add_retres pdg state ret_stmt retres_loc_dpds retres_decls = let key_return = Key.stmt_key ret_stmt in let return_node = add_elem pdg key_return in let retres_loc = Db.Value.find_return_loc pdg.fct in let retres = Locations.(enumerate_valid_bits Read retres_loc) in add_dpds pdg return_node Dpd.Data state retres_loc_dpds; add_decl_dpds pdg return_node Dpd.Data retres_decls; let new_state = Pdg_state.add_loc_node state true retres return_node in create_fun_output_node pdg (Some new_state) retres; new_state (** part of [finalize_pdg] : add missing inputs * and build a state with the new nodes to find them back when searching for * undefined zones. * (notice that now, they can overlap, for example we can have G and G.a) * And also deals with warning for uninitialized local variables. *) let process_other_inputs pdg = debug2 "process_other_inputs@."; let rec add n dpd_kind (state, zones) z_or_top = (* be careful because [z] can intersect several elements in [zones] *) match zones with | [] -> let key = Key.implicit_in_key z_or_top in let nz = add_elem pdg key in debug "add_implicit_input : %a@." Locations.Zone.pretty z_or_top ; let state = Pdg_state.add_init_state_input state z_or_top nz in add_z_dpd pdg n dpd_kind None nz; state, [(z_or_top, nz)] | (zone, nz)::tl_zones -> match z_or_top, zone with | (Locations.Zone.Top (_,_), Locations.Zone.Top (_,_)) -> add_z_dpd pdg n dpd_kind None nz; (state, zones) | (z, _) when (Locations.Zone.equal zone z) -> add_z_dpd pdg n dpd_kind None nz; (* don't add z : already in *) (state, zones) | _ -> (* rec : look for z in tail *) let state, tl_zones = add n dpd_kind (state, tl_zones) z_or_top in state, (zone, nz)::tl_zones in let add_zone acc (n, dpd_kind, z) = let do_add = match get_var_base z with | Some v -> if Kernel_function.is_local v pdg.fct then false else true | None -> true in if do_add then let acc = match z with | Locations.Zone.Top (_,_) -> add n dpd_kind acc z | _ -> let aux b intervs acc = let z = Locations.Zone.inject b intervs in add n dpd_kind acc z in Locations.Zone.fold_i aux z acc in acc else begin debug2 "might use uninitialized : %a" Locations.Zone.pretty z; acc end in let (state, _) = List.fold_left add_zone (Pdg_state.empty, []) pdg.other_inputs in state (** to call then the building process is over : add the control dependencies in the graph. @return the real PDG that will be used later on. @param from_opt for undefined functions (declarations) *) let finalize_pdg pdg from_opt = debug2 "try to finalize_pdg"; let last_state = try Some (Pdg_state.get_last_state pdg.states) with Not_found -> let ret = try Kernel_function.find_return pdg.fct with Kernel_function.No_Statement -> Pdg_parameters.abort "No return in a declaration" in Pdg_parameters.warning ~once:true ~source:(fst (Stmt.loc ret)) "no final state. Probably unreachable..."; None in (match from_opt with | None -> () (* defined function : retres already processed. *) | Some froms -> (* undefined function : add output 0 *) (* TODO : also add the nodes for the other from ! *) let state = match last_state with Some s -> s | None -> assert false in let process_out out deps s = let open Function_Froms.DepsOrUnassigned in if (equal Unassigned deps) then s else let from_out = to_zone deps in let default = may_be_unassigned deps in add_from pdg state s out (default, from_out) in let from_table = froms.Function_Froms.deps_table in let new_state = if Function_Froms.Memory.is_bottom from_table then Pdg_state.bottom else let new_state = match from_table with | Function_Froms.Memory.Top -> process_out Locations.Zone.top Function_Froms.DepsOrUnassigned.top state | Function_Froms.Memory.Map m -> Function_Froms.Memory.fold_fuse_same process_out m state | Function_Froms.Memory.Bottom -> assert false (* checked above *) in if not (Kernel_function.returns_void pdg.fct) then begin let from0 = froms.Function_Froms.deps_return in let deps_ret = Function_Froms.Memory.collapse_return from0 in let deps_ret = Function_Froms.Deps.to_zone deps_ret in ignore (create_fun_output_node pdg (Some new_state) deps_ret) end; new_state in Pdg_state.store_last_state pdg.states new_state); let init_state = process_other_inputs pdg in Pdg_state.store_init_state pdg.states init_state; add_ctrl_dpds pdg ; debug2 "finalize_pdg ok"; PdgTypes.Pdg.make pdg.fct pdg.graph pdg.states pdg.index (*-----------------------------------------------------------------------*) (** gives needed informations about [lval] : = location + exact + dependencies + declarations *) let get_lval_infos lval stmt = let decl = Cil.extract_varinfos_from_lval lval in let state = Db.Value.get_stmt_state stmt in let dpds, z_loc, exact = !Db.Value.lval_to_zone_with_deps_state state ~deps:(Some Locations.Zone.bottom) ~for_writing:true lval in (z_loc, exact, dpds, decl) (** process assignment {v lval = exp; v} Use the state at ki (before assign) and returns the new state (after assign). *) let process_asgn pdg state stmt lval exp = let r_dpds = !Db.From.find_deps_no_transitivity stmt exp in let r_decl = Cil.extract_varinfos_from_exp exp in let (l_loc, exact, l_dpds, l_decl) = get_lval_infos lval stmt in let key = Key.stmt_key stmt in let new_node, new_state = create_lval_node pdg state key ~l_loc ~exact ~l_dpds ~l_decl in add_dpds pdg new_node Dpd.Data state r_dpds; add_decl_dpds pdg new_node Dpd.Data r_decl; new_state (** Add a PDG node and its dependencies for each explicit call argument. *) let process_args pdg st stmt argl = let process_one_arg arg = let dpds = !Db.From.find_deps_no_transitivity stmt arg in let decl_dpds = Cil.extract_varinfos_from_exp arg in (dpds, decl_dpds) in let arg_dpds = List.map process_one_arg argl in process_call_args pdg st stmt arg_dpds (** Add nodes for the call outputs, and add the dependencies according to from_table. To avoid mixing inputs and outputs, [in_state] is the input state and [new_state] the state to modify. * Process call outputs (including returned value) *) let call_outputs pdg state_before_call state_with_inputs stmt lvaloption froms fct_dpds = (* obtain inputs from state_with_inputs to avoid mixing in and out *) let froms_deps_return = froms.Function_Froms.deps_return in let from_table = froms.Function_Froms.deps_table in let print_outputs fmt = Format.fprintf fmt "call outputs : %a" Function_Froms.Memory.pretty from_table; if not (lvaloption = None) then Format.fprintf fmt "\t and \\result %a@." Function_Froms.Deps.pretty froms_deps_return in debug "%t" print_outputs; let process_out out deps state = if Function_Froms.DepsOrUnassigned.(equal Unassigned deps) then state else let from_out = Function_Froms.DepsOrUnassigned.to_zone deps in let default = Function_Froms.DepsOrUnassigned.may_be_unassigned deps in process_call_output pdg state_with_inputs state stmt out default from_out fct_dpds in if Function_Froms.Memory.is_bottom from_table then Pdg_state.bottom else let state_with_outputs = let open Function_Froms in match from_table with | Memory.Top -> process_out Locations.Zone.top DepsOrUnassigned.top state_before_call | Memory.Bottom -> assert false (* checked above *) | Memory.Map m -> Memory.fold_fuse_same process_out m state_before_call in match lvaloption with | None -> state_with_outputs | Some lval -> let r_dpds = Function_Froms.Memory.collapse_return froms_deps_return in let r_dpds = Function_Froms.Deps.to_zone r_dpds in let (l_loc, exact, l_dpds, l_decl) = get_lval_infos lval stmt in process_call_return pdg state_with_outputs state_with_inputs stmt ~l_loc ~exact ~l_dpds ~l_decl ~r_dpds fct_dpds (** process call : {v lvaloption = funcexp (argl); v} Use the state at ki (before the call) and returns the new state (after the call). *) let process_call pdg state stmt lvaloption funcexp argl _loc = let state_before_call = state in (** add a simple node for each call in order to have something in the PDG for this statement even if there are no input/output *) ignore (add_elem pdg (Key.call_ctrl_key stmt)); let arg_nodes = process_args pdg state_before_call stmt argl in let state_with_args = state in let funcexp_dpds, called_functions = !Db.Value.expr_to_kernel_function (Kstmt stmt) ~deps:(Some Locations.Zone.bottom) funcexp in let mixed_froms = try let froms = !Db.From.Callwise.find (Kstmt stmt) in Some froms with Not_found -> None (* don't have callwise analysis (-calldeps option) *) in let process_simple_call called_kf acc = let state_with_inputs = process_call_params pdg state_with_args stmt called_kf arg_nodes in let r = match mixed_froms with | Some _ -> state_with_inputs (* process outputs later *) | None -> (* don't have callwise analysis (-calldeps option) *) let froms = !Db.From.get called_kf in let state_for_this_call = call_outputs pdg state_before_call state_with_inputs stmt lvaloption froms funcexp_dpds in state_for_this_call in r :: acc in let state_for_each_call = Kernel_function.Hptset.fold process_simple_call called_functions [] in let new_state = match state_for_each_call with | [] -> let stmt_str = Format.asprintf "%a" Printer.pp_stmt stmt in Pdg_parameters.not_yet_implemented "pdg with an unknown function call: %s" stmt_str | st :: [] -> st | st :: other_states -> let merge s1 s2 = let _,s = Pdg_state.test_and_merge ~old:s1 s2 in s in List.fold_left merge st other_states in let new_state = match mixed_froms with | None -> new_state | Some froms -> call_outputs pdg state_before_call new_state stmt lvaloption froms funcexp_dpds in new_state (** Add a node in the PDG for the conditional statement, * and register the statements that are control-dependent on it. *) let process_condition ctrl_dpds_infos pdg state stmt condition = let loc_cond = !Db.From.find_deps_no_transitivity stmt condition in let decls_cond = Cil.extract_varinfos_from_exp condition in let controlled_stmts = CtrlDpds.get_if_controlled_stmts ctrl_dpds_infos stmt in let go_then, go_else = Db.Value.condition_truth_value stmt in let real = go_then && go_else (* real dpd if we can go in both branches *) in if not real then debug "[process_condition] stmt %d is not a real cond (never goes in '%s')@." stmt.sid (if go_then then "else" else "then"); (* build a node for the condition and store de control dependencies *) process_jump_with_exp pdg stmt (real, controlled_stmts) state loc_cond decls_cond (** let's add a node for e jump statement (goto, break, continue) and find the statements which are depending on it. Returns are not handled here, but in {!Build.process_return}. *) let process_jump_stmt pdg ctrl_dpds_infos jump = let controlled_stmts = CtrlDpds.get_jump_controlled_stmts ctrl_dpds_infos jump in let real = Db.Value.is_reachable_stmt jump in if not real then debug "[process_jump_stmt] stmt %d is not a real jump@." jump.sid; process_jump pdg jump (real, controlled_stmts) (** Loop are processed like gotos because CIL transforms them into * {v while(true) body; v} which is equivalent to {v L : body ; goto L; v} * There is a small difference because we have to detect the case where * the [goto L;] would be unreachable (no real loop). * This is important because it might lead to infinite loop (see bst#787) *) let process_loop_stmt pdg ctrl_dpds_infos loop = let _entry, back_edges = Stmts_graph.loop_preds loop in debug2 "[process_loop_stmt] for loop %d : back edges = {%a}@." loop.sid (Pretty_utils.pp_list Stmt.pretty_sid) back_edges; let controlled_stmts = CtrlDpds.get_loop_controlled_stmts ctrl_dpds_infos loop in let real_loop = List.exists (Db.Value.is_reachable_stmt) back_edges in if not real_loop then debug "[process_loop_stmt] stmt %d is not a real loop@." loop.sid; process_jump pdg loop (real_loop, controlled_stmts) (** [return ret_exp;] is equivalent to [out0 = ret_exp; goto END;] * while a simple [return;] is only a [goto END;]. * Here, we assume that the {{:../html/Oneret.html}Oneret} analysis * was used, ie. that it is the only return of the function * and that it is the last statement. So, the [goto] is not useful, * and the final state is stored to be used later on to compute the outputs. *) let process_return _current_function pdg state stmt ret_exp = let last_state = match ret_exp with | Some exp -> let loc_exp = !Db.From.find_deps_no_transitivity stmt exp in let decls_exp = Cil.extract_varinfos_from_exp exp in add_retres pdg state stmt loc_exp decls_exp | None -> let controlled_stmt = Cil_datatype.Stmt.Hptset.empty in let real = Db.Value.is_reachable_stmt stmt in process_jump pdg stmt (real, controlled_stmt); state in if Db.Value.is_reachable_stmt stmt then Pdg_state.store_last_state pdg.states last_state module Computer (Initial:sig val initial: (stmt * PdgTypes.data_state) list end) (Fenv:Dataflows.FUNCTION_ENV) (Param:sig val current_pdg : pdg_build val ctrl_dpds_infos : CtrlDpds.t end) = struct let pdg_debug fmt = debug fmt type t = PdgTypes.data_state let current_pdg = Param.current_pdg let current_function = Fenv.kf;; assert (current_function == current_pdg.fct);; let ctrl_dpds_infos = Param.ctrl_dpds_infos let init = Initial.initial;; let bottom = Pdg_state.bottom let pretty fmt (v: t) = Format.fprintf fmt "<STATE>@\n%a@\n<\\STATE>@." Pdg_state.pretty v let join_and_is_included smaller larger = pdg_debug "smaller (new): %a larger (old) %a" pretty smaller pretty larger; let is_new, new_state = Pdg_state.test_and_merge larger smaller in pdg_debug "new_state: %a is_new: %b" pretty new_state is_new; (new_state, not is_new) ;; let join a b = fst (join_and_is_included a b) let is_included a b = snd (join_and_is_included a b) let rec process_init current_pdg state stmt lv = function | SingleInit e -> process_asgn current_pdg state stmt lv e | CompoundInit (_,l) -> List.fold_left (fun acc (o,i) -> let lv = Cil.addOffsetLval o lv in process_init current_pdg acc stmt lv i) state l (** Compute the new state after 'instr' starting from state before 'state'. *) let doInstr stmt instr state = !Db.progress (); pdg_debug "doInstr sid:%d : %a" stmt.sid Printer.pp_instr instr; match instr with | _ when not (Db.Value.is_reachable_stmt stmt) -> pdg_debug "stmt sid:%d is unreachable : skip.@." stmt.sid ; Pdg_state.bottom | Local_init (v, AssignInit i, _) -> process_init current_pdg state stmt (Cil.var v) i | Local_init (v, ConsInit (f, args, kind), loc) -> !Db.progress (); Cil.treat_constructor_as_func (process_call current_pdg state stmt) v f args kind loc | Set (lv, exp, _) -> process_asgn current_pdg state stmt lv exp | Call (lvaloption,funcexp,argl,loc) -> !Db.progress (); process_call current_pdg state stmt lvaloption funcexp argl loc | Code_annot _ | Skip _ -> process_skip current_pdg state stmt | Asm _ -> process_asm current_pdg state stmt (** Called before processing the successors of the statements. *) let transfer_stmt (stmt: Cil_types.stmt) (state: t) = pdg_debug "doStmt %d @." stmt.sid ; let map_on_all_succs newstate = List.map (fun x -> (x,newstate)) stmt.succs in (* Notice that the stmt labels are processed while processing the jumps. *) process_stmt_labels current_pdg stmt; match stmt.skind with | Instr i -> map_on_all_succs (doInstr stmt i state) | Block blk -> process_block current_pdg stmt blk; map_on_all_succs state | UnspecifiedSequence seq -> process_block current_pdg stmt (Cil.block_from_unspecified_sequence seq); map_on_all_succs state | Switch (exp,_,_,_) | If (exp,_,_,_) -> process_condition ctrl_dpds_infos current_pdg state stmt exp; map_on_all_succs state | Return (exp,_) -> process_return current_function current_pdg state stmt exp; [] | Continue _ | Break _ | Goto _ -> process_jump_stmt current_pdg ctrl_dpds_infos stmt; map_on_all_succs state | Loop _ -> process_loop_stmt current_pdg ctrl_dpds_infos stmt; map_on_all_succs state | Throw _ | TryCatch _ -> Pdg_parameters.fatal "Exception node in the AST" | TryExcept (_, _, _, _) | TryFinally (_, _, _) -> map_on_all_succs state end exception Value_State_Top (** Compute and return the PDG for the given function *) let compute_pdg_for_f kf = let pdg = create_pdg_build kf in let f_locals, f_stmts = if !Db.Value.use_spec_instead_of_definition kf then [], [] else let f = Kernel_function.get_definition kf in if !Db.Value.no_results f then raise Value_State_Top else f.slocals, f.sbody.bstmts in let init_state = process_entry_point pdg f_stmts; let formals = Kernel_function.get_formals kf in process_declarations pdg formals f_locals in let froms = match f_stmts with | [] -> Pdg_state.store_last_state pdg.states init_state; let froms = !Db.From.get kf in Some (froms) | start :: _ -> let ctrl_dpds_infos = CtrlDpds.compute kf in (* Put all statements in initial, so that they are processed and are in the worklist (even if they are dead). *) let allstmts = (Kernel_function.get_definition kf).sallstmts in let allstmts_no_start = List.filter (fun s -> s.sid != start.sid) allstmts in let initial_list = List.map (fun s -> (s, Pdg_state.bottom)) allstmts_no_start in let module Initial = struct let initial = (start, init_state)::initial_list end in let module Fenv = (val Dataflows.function_env kf: Dataflows.FUNCTION_ENV) in let module Computer = Computer(Initial)(Fenv)(struct let current_pdg = pdg let ctrl_dpds_infos = ctrl_dpds_infos end) in if Db.Value.is_reachable_stmt start then begin let module Compute = Dataflows.Simple_forward(Fenv)(Computer) in Array.iteri (fun ord value -> let stmt = Fenv.to_stmt ord in Stmt.Hashtbl.replace pdg.states stmt value) Compute.before; None end else raise (Err_Bot (Printf.sprintf "unreachable entry point (sid:%d, function %s)" start.sid (Kernel_function.get_name kf))) in let pdg = finalize_pdg pdg froms in pdg let degenerated top kf = Pdg_parameters.feedback "%s for function %a" (if top then "Top" else "Bottom") Kernel_function.pretty kf; if top then PdgTypes.Pdg.top kf else PdgTypes.Pdg.bottom kf let compute_pdg kf = if not (Db.Value.is_computed ()) then !Db.Value.compute (); Pdg_parameters.feedback "computing for function %a" Kernel_function.pretty kf; try if is_variadic kf then Pdg_parameters.not_yet_implemented "variadic function"; let pdg = compute_pdg_for_f kf in Pdg_parameters.feedback "done for function %a" Kernel_function.pretty kf; pdg with | Err_Bot what -> Pdg_parameters.warning "%s" what ; degenerated false kf | Value_State_Top -> degenerated true kf | Log.AbortFatal what -> (* [JS 2012/08/24] nobody should catch this exception *) Pdg_parameters.warning "internal error: %s" what ; degenerated true kf | Log.AbortError what -> (* [JS 2012/08/24] nobody should catch this exception *) Pdg_parameters.warning "user error: %s" what ; degenerated true kf | Pdg_state.Cannot_fold -> Pdg_parameters.warning "too imprecise value analysis : abort" ; degenerated true kf | Log.FeatureRequest (who, what) -> (* [JS 2012/08/24] nobody should catch this exception *) Pdg_parameters.warning "not implemented by %s yet: %s" who what ; degenerated true kf (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/build.mli������������������������������������������������������0000666�0000000�0000000�00000003324�13571573400�016041� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val compute_pdg : Cil_types.kernel_function -> PdgTypes.Pdg.t (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/ctrlDpds.ml����������������������������������������������������0000666�0000000�0000000�00000042622�13571573400�016354� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let dkey = Pdg_parameters.register_category "ctrl-dpds" open Cil_types open Cil_datatype (*============================================================================*) (** Lexical successors *) (*============================================================================*) (** Compute a graph which provide the lexical successor of each statement s, ie. the statement which is the next one if 's' is replaced by Nop. Notice that if 's' is an If, Loop, ... the considered statement is the whole block. Example : (1) x = 3; (2) if (c) (3) y = 3; (4) goto L; else (5) z = 8; (6) while (c--) (7) x++; (8) L : return x; (1) -> (2) -> (6) -> (8) (3) -> (4) -> (6) (5) -> (6) (7) -> (6) *) module Lexical_successors : sig type t val compute : Cil_types.kernel_function -> t (** @return the lexical successor of stmt in graph. @raise Not_found if 'stmt' has no successor in 'graph' *) val find : t -> Cil_types.stmt -> Cil_types.stmt end = struct let dkey = Pdg_parameters.register_category "lex-succs" (** Type of the graph *) type t = Cil_types.stmt Stmt.Hashtbl.t let pp_stmt fmt s = Format.fprintf fmt "@[sid:%d(%a)@]" s.sid Stmt.pretty s (** Add links from each [prev] in [prev_list] to [next]. *) let add_links graph prev_list next = match prev_list with | [] -> () | _ -> let link prev = try ignore (Stmt.Hashtbl.find graph prev) with Not_found -> Pdg_parameters.debug ~dkey "add @[%a@,-> %a@]" pp_stmt prev pp_stmt next; Stmt.Hashtbl.add graph prev next in List.iter link prev_list (** Add links from [prev_list] to [stmt]. * (ie. [stmt] is the lexical successor of every statements in [prev_list]) * and build the links inside [stmt] (when it contains blocks) * @return a list of the last statements in [stmt] to continue processing * with the statement that follows. *) let rec process_stmt graph ~prev_list ~stmt = Pdg_parameters.debug ~dkey "computing for statement %a@." pp_stmt stmt; match stmt.skind with | If (_,bthen,belse,_) -> let _ = add_links graph prev_list stmt in let last_then = process_block graph bthen in let last_else = process_block graph belse in let prev_list = match last_then, last_else with | [], [] -> [ stmt ] | last, [] | [], last -> stmt::last | last_then, last_else -> last_then @ last_else in prev_list | Switch (_,blk,_,_) | Block blk -> let _ = add_links graph prev_list stmt in process_block graph blk | UnspecifiedSequence seq -> let _ = add_links graph prev_list stmt in process_block graph (Cil.block_from_unspecified_sequence seq) | Loop (_,body,_,_,_) -> let prev_list = match body.bstmts with | [] -> let _ = add_links graph prev_list stmt in [ stmt ] | head::_ -> let _ = add_links graph prev_list head in let last_list = process_block graph body in let _ = add_links graph last_list stmt in stmt::[] in prev_list | TryCatch _ -> Pdg_parameters.fatal "Try/Catch node in the AST" | Instr _ | Return _ | Goto _ | Break _ | Continue _ | Throw _ | TryFinally _ | TryExcept _ -> let _ = add_links graph prev_list stmt in [stmt] (** Process each statement in blk with no previous statement to begin with. * Then process each statement in the statement list * knowing that the first element of 'tail' * is the successor of every statement in prev_list. * @return a list of the last statements in tail or prev_list if tail=[]. *) and process_block graph blk = let rec process_stmts prev_list stmts = match stmts with | [] -> prev_list | s :: tail -> let s_last_stmts = process_stmt graph prev_list s in process_stmts s_last_stmts tail in process_stmts [] blk.bstmts (** Compute the lexical successor graph for function kf *) let compute kf = Pdg_parameters.debug ~dkey "computing for function %s@." (Kernel_function.get_name kf); if !Db.Value.use_spec_instead_of_definition kf then Stmt.Hashtbl.create 0 else let graph = Stmt.Hashtbl.create 17 in let f = Kernel_function.get_definition kf in let _ = process_block graph f.sbody in graph (** @return the lexical successor of stmt in graph. @raise Not_found if 'stmt' has no successor in 'graph' ie when it is [return]. *) let find graph stmt = try Stmt.Hashtbl.find graph stmt with Not_found -> Pdg_parameters.debug ~dkey ~level:2 "not found for stmt:%d@." stmt.sid; raise Not_found end (*============================================================================*) (** Postdominators (with infinite path extension) *) (*============================================================================*) (** This backward dataflow implements a variant of postdominators that verify the property P enunciated in bts 963: a statement postdominates itself if and only it is within the main path of a syntactically infinite loop. The implementation is as follows: - compute postdominators with an additional flag infinite loop/non-infinite loop. Every path that may terminate does not have the "infinite loop" flag - the implementation verifies property P only for Loop statements. To obtain the property, the cfg is locally rewritten. For statements --> p --> s:Loop --> h --> ... --> e ^ | | | -------------------------- the edges p --> s are transformed into p --> h, but _not_ the backward edges e --> s. This way, s post-dominates itself if and only if s is a syntactically infinite loop, but not if there is an outgoing edge. *) module PdgPostdom : sig type t val compute : kernel_function -> t (** @param with_s tells if the statement has to be added to its postdom. * The returned boolean tells if there is a path to [return] *) val get : t -> with_s:bool -> stmt -> bool * Stmt.Hptset.t end = struct module State = struct type t = | ToReturn of Stmt.Hptset.t | ToInfinity of Stmt.Hptset.t let inter a b = match a,b with | ToReturn v, ToReturn v' -> ToReturn ( Stmt.Hptset.inter v v') | ToInfinity v, ToInfinity v' -> ToInfinity ( Stmt.Hptset.inter v v') | ToReturn v, ToInfinity _ | ToInfinity _, ToReturn v -> ToReturn v let equal a b = match a,b with | ToReturn v, ToReturn v' -> Stmt.Hptset.equal v v' | ToInfinity v, ToInfinity v' -> Stmt.Hptset.equal v v' | _ -> false let add stmt set = match set with | ToReturn set -> ToReturn (Stmt.Hptset.add stmt set) | ToInfinity set -> ToInfinity (Stmt.Hptset.add stmt set) let pretty fmt d = match d with | ToReturn d -> Format.fprintf fmt "{%a}_ret" Stmt.Hptset.pretty d | ToInfinity d -> Format.fprintf fmt "{%a}_oo" Stmt.Hptset.pretty d end type t = State.t Stmt.Hashtbl.t let _pretty fmt infos = Stmt.Hashtbl.iter (fun k v -> Format.fprintf fmt "Stmt:%d\n%a\n======" k.sid State.pretty v) infos let is_in_stmts iter s stmts = try iter (fun s' -> if s.sid = s'.sid then raise Exit) stmts; false with Exit -> true (** change [succs] so move the edges [entry -> loop] to [entry -> head] *) let succs stmt = let modif acc s = match s.skind with | Loop _ -> let head = match s.succs with | [head] -> head | _ -> assert false in let entry, _back_edges = Stmts_graph.loop_preds s in if is_in_stmts List.iter stmt entry then head::acc else s::acc | _ -> s::acc in List.fold_left modif [] stmt.succs (** change [preds] so remove the edges [entry <- loop] * and to add the edges [entry <- head] *) let preds stmt = match stmt.skind with | Loop _ -> (* remove edges from entry to loop *) let _entry, back_edges = Stmts_graph.loop_preds stmt in back_edges | _ -> let modif acc s = match s.skind with | Loop _ -> let entry, _back_edges = Stmts_graph.loop_preds s in s::entry@acc | _ -> s::acc in List.fold_left modif [] stmt.preds let add_postdom infos start init = let get s = try Stmt.Hashtbl.find infos s with Not_found -> State.ToInfinity Stmt.Hptset.empty in let do_stmt stmt = match succs stmt with | [] when stmt.sid = start.sid -> Some (State.ToReturn (Stmt.Hptset.empty)) | [] -> assert false | s::tl -> let add_get s = State.add s (get s) in let combineSuccessors st s = State.inter st (add_get s) in let st = List.fold_left combineSuccessors (add_get s) tl in let old = get stmt in let new_st = (* don't need to State.inter old *) st in if State.equal old new_st then None else Some new_st in let todo = Queue.create () in let add_todo p = if is_in_stmts Queue.iter p todo then () else Queue.add p todo in let rec do_todo () = let s = Queue.take todo in begin match do_stmt s with | None -> (* finished with that one *) () | Some st -> (* store state and add preds *) Stmt.Hashtbl.add infos s st; List.iter add_todo (preds s) end; do_todo () in try let _ = Stmt.Hashtbl.add infos start init in let _ = List.iter (fun p -> Queue.add p todo) (preds start) in do_todo () with Queue.Empty -> () let compute kf = let infos = Stmt.Hashtbl.create 50 in let return = try Kernel_function.find_return kf with Kernel_function.No_Statement -> Pdg_parameters.fatal "No return statement for a function with body %a" Kernel_function.pretty kf in let _ = add_postdom infos return (State.ToReturn (Stmt.Hptset.empty)) in let stmts = if !Db.Value.use_spec_instead_of_definition kf then invalid_arg "[traces] cannot compute for a leaf function" else let f = Kernel_function.get_definition kf in f.sallstmts in let remove_top s = try ignore (Stmt.Hashtbl.find infos s) with Not_found -> Pdg_parameters.debug ~dkey "compute infinite path to sid:%d" s.sid; add_postdom infos s (State.ToInfinity (Stmt.Hptset.empty)) in let _ = List.iter remove_top stmts in infos let get infos ~with_s stmt = try let stmt_to_ret, postdoms = match Stmt.Hashtbl.find infos stmt with | State.ToInfinity postdoms -> false, postdoms | State.ToReturn postdoms -> true, postdoms in let postdoms = if with_s then Stmt.Hptset.add stmt postdoms else postdoms in Pdg_parameters.debug ~dkey ~level:2 "get_postdoms for sid:%d (%s) = %a (%spath to ret)@." stmt.sid (if with_s then "with" else "without") Stmt.Hptset.pretty postdoms (if stmt_to_ret then "" else "no "); stmt_to_ret, postdoms with Not_found -> assert false end (*============================================================================*) (** Compute information needed for control dependencies *) (*============================================================================*) type t = Lexical_successors.t * PdgPostdom.t let compute kf = let lex_succ_graph = Lexical_successors.compute kf in let ctrl_dpds_infos = PdgPostdom.compute kf in (lex_succ_graph, ctrl_dpds_infos) (** Compute the PDB(A,B) set used in the control dependencies algorithm. * Roughly speaking, it gives {v (\{B\} U postdom(B))-postdom(A) v}. * It means that if S is in the result, it postdominates B but not A. * As B is usually a successor of A, it means that S is reached if the B-branch * is chosen, but not necessary for the other branches. Then, S should depend * on A. (see the document to know more about the applied algorithm) *) let pd_b_but_not_a infos stmt_a stmt_b = if stmt_a.sid = stmt_b.sid then Stmt.Hptset.empty else begin let a_to_ret, postdom_a = PdgPostdom.get infos ~with_s:false stmt_a in let b_to_ret, postdom_b = PdgPostdom.get infos ~with_s:true stmt_b in let res = match a_to_ret, b_to_ret with | true, true | false, false -> Stmt.Hptset.diff postdom_b postdom_a | true, false -> postdom_b | false, true -> (* no path [a, ret] but path [b, ret] * possible when a there is a jump, because then we have * either (A=G, B=S) or (A=S, B=L) *) Stmt.Hptset.empty (* because we don't want b postdoms to depend on the jump *) in Pdg_parameters.debug ~dkey ~level:2 "pd_b_but_not_a for a=sid:%d b=sid:%d = %a" stmt_a.sid stmt_b.sid Stmt.Hptset.pretty res; res end (*============================================================================*) (** Control dependencies *) (*============================================================================*) (** @return the statements which are depending on the condition. * * {v = U (PDB (if, succs(if)) v} * (see the document to know more about the applied algorithm). *) let get_if_controlled_stmts ctrl_dpds_infos stmt = let _, infos = ctrl_dpds_infos in let add_pdb_s set succ = Stmt.Hptset.union set (pd_b_but_not_a infos stmt succ) in let controlled_stmts = List.fold_left add_pdb_s Stmt.Hptset.empty stmt.succs in Pdg_parameters.debug ~dkey "controlled_stmt for cond sid:%d = %a" stmt.sid Stmt.Hptset.pretty controlled_stmts; controlled_stmts let jump_controlled_stmts infos jump label lex_suc = Pdg_parameters.debug ~dkey ~level:2 "lex_succ sid:%d = sid:%d" jump.sid lex_suc.sid; Pdg_parameters.debug ~dkey ~level:2 "jump succ sid:%d = sid:%d" jump.sid label.sid; let controlled_stmts = if lex_suc.sid = label.sid then begin (* the label is the jump lexical successor: no dpds *) Pdg_parameters.debug ~dkey "useless jump sid:%d (label = lex_succ = %d)" jump.sid lex_suc.sid; Stmt.Hptset.empty end else let pdb_jump_lex_suc = pd_b_but_not_a infos jump lex_suc in let pdb_lex_suc_label = pd_b_but_not_a infos lex_suc label in let pdb_lex_suc_label = Stmt.Hptset.remove lex_suc pdb_lex_suc_label in Stmt.Hptset.union pdb_jump_lex_suc pdb_lex_suc_label in controlled_stmts (** let's find the statements which are depending on * the jump statement (goto, break, continue) = {v PDB(jump,lex_suc) U (PDB(lex_suc,label) - lex_suc) v} (see the document to know more about the applied algorithm). *) let get_jump_controlled_stmts ctrl_dpds_infos jump = let lex_succ_graph, infos = ctrl_dpds_infos in let lex_suc = try Lexical_successors.find lex_succ_graph jump with Not_found -> assert false in let label = match jump.succs with | [label] -> label | _ -> assert false in let controlled_stmts = jump_controlled_stmts infos jump label lex_suc in Pdg_parameters.debug ~dkey "controlled_stmt for jump sid:%d = %a" jump.sid Stmt.Hptset.pretty controlled_stmts; controlled_stmts (** Try to process [while(1) S; LS: ] as [L: S; goto L; LS: ] *) let get_loop_controlled_stmts ctrl_dpds_infos loop = let lex_succ_graph, infos = ctrl_dpds_infos in let lex_suc = try Lexical_successors.find lex_succ_graph loop with Not_found -> (* must have at least a return *) assert false in let jump = loop in let label = match loop.succs with [head] -> head | _ -> assert false in let controlled_stmts = jump_controlled_stmts infos jump label lex_suc in Pdg_parameters.debug ~dkey "controlled_stmt for loop sid:%d = %a" loop.sid Stmt.Hptset.pretty controlled_stmts; controlled_stmts (*============================================================================*) (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/ctrlDpds.mli���������������������������������������������������0000666�0000000�0000000�00000005036�13571573400�016523� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Internal information about control dependencies *) type t (** Compute some information on the function in order to be able to compute * the control dependencies later on *) val compute : Kernel_function.t -> t (** Compute the list of the statements that should have a control dependency * on the given IF statement. *) val get_if_controlled_stmts : t -> Cil_types.stmt -> Cil_datatype.Stmt.Hptset.t (** Compute the list of the statements that should have a control dependency * on the given jump statement. This statement can be a [goto] of course, * but also a [break], a [continue], or even a loop because CIL transformations make them of the form {v while(true) body; v} which is equivalent to {v L : body ; goto L; v} * *) val get_jump_controlled_stmts : t -> Cil_types.stmt -> Cil_datatype.Stmt.Hptset.t val get_loop_controlled_stmts : t -> Cil_types.stmt -> Cil_datatype.Stmt.Hptset.t (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/marks.ml�������������������������������������������������������0000666�0000000�0000000�00000020554�13571573400�015712� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open PdgIndex open Cil_datatype (** compute the marks to propagate in the caller nodes from the marks of * a function inputs [in_marks]. *) let in_marks_to_caller pdg call m2m ?(rqs=[]) in_marks = let add_n_m acc n z_opt m = let select = PdgMarks.mk_select_node ~z_opt n in match m2m select m with | None -> acc | Some m -> PdgMarks.add_to_select acc select m in let build rqs (in_key, m) = match in_key with | Signature.InCtrl -> add_n_m rqs (!Db.Pdg.find_call_ctrl_node pdg call) None m | Signature.InNum in_num -> add_n_m rqs (!Db.Pdg.find_call_input_node pdg call in_num) None m | Signature.InImpl zone -> let nodes, undef = !Db.Pdg.find_location_nodes_at_stmt pdg call ~before:true zone in let rqs = List.fold_left (fun acc (n,z) -> add_n_m acc n z m) rqs nodes in let rqs = match undef with None -> rqs | Some z -> match m2m (PdgMarks.mk_select_undef_zone z) m with None -> rqs | Some m -> PdgMarks.add_undef_in_to_select rqs undef m in rqs in List.fold_left build rqs in_marks (** some new input marks has been added in a called function. * Build the list of what is to be propagated in the callers. * Be careful that some Pdg can be top : in that case, a list of mark is * returned (Beware that m2m has NOT been called in that case). * *) let translate_in_marks pdg_called in_new_marks ?(m2m=fun _ _ _ m -> Some m) other_rqs = let kf_called = PdgTypes.Pdg.get_kf pdg_called in let translate pdg rqs call = in_marks_to_caller pdg call (m2m (Some call) pdg) ~rqs in_new_marks in let build rqs (caller, _) = let pdg_caller = !Db.Pdg.get caller in let caller_rqs = try let call_stmts = !Db.Pdg.find_call_stmts ~caller kf_called in (* TODO : more intelligent merge ? *) let rqs = List.fold_left (translate pdg_caller) [] call_stmts in PdgMarks.SelList rqs with PdgTypes.Pdg.Top -> let marks = List.fold_left (fun acc (_, m) -> m::acc) [] in_new_marks in PdgMarks.SelTopMarks marks (* #345 *) in (pdg_caller, caller_rqs)::rqs in let res = List.fold_left build other_rqs (!Db.Value.callers kf_called) in res let call_out_marks_to_called called_pdg m2m ?(rqs=[]) out_marks = let build rqs (out_key, m) = let nodes, undef = Sets.find_output_nodes called_pdg out_key in let sel = List.map (fun (n, _z_opt) -> PdgMarks.mk_select_node ~z_opt:None n) nodes in let sel = match undef with None -> sel | Some undef -> (PdgMarks.mk_select_undef_zone undef)::sel in let add acc s = match m2m s m with | None -> acc | Some m -> (s, m)::acc in let rqs = List.fold_left add rqs sel in rqs in List.fold_left build rqs out_marks let translate_out_mark _pdg m2m other_rqs (call, l) = let add_list l_out_m called_kf rqs = let called_pdg = !Db.Pdg.get called_kf in let m2m = m2m (Some call) called_pdg in try let node_marks = call_out_marks_to_called called_pdg m2m ~rqs:[] l_out_m in (called_pdg, PdgMarks.SelList node_marks)::rqs with PdgTypes.Pdg.Top -> (* no PDG for this function : forget the new marks * because anyway, the source function will be called. * *) rqs in let all_called = Db.Value.call_to_kernel_function call in Kernel_function.Hptset.fold (add_list l) all_called other_rqs (** [add_new_marks_to_rqs pdg new_marks other_rqs] translates [new_marks] * that were computed during intraprocedural propagation into requests, * and add them to [other_rqs]. * * The functions [in_m2m] and [out_m2m] can be used to modify the marks during * propagation : *- [in_m2m call_stmt call_in_node mark] : provide the mark to propagate to the [call_in_node] knowing that the mark of the called function has been modify to [mark] *- [out_m2m out_node mark] : provide the mark to propagate to the [out_node] knowing that a call output mark has been modify to [mark]. *) let translate_marks_to_prop pdg new_marks ?(in_m2m=fun _ _ _ m -> Some m) ?(out_m2m=fun _ _ _ m -> Some m) other_rqs = let in_marks, out_marks = new_marks in let other_rqs = translate_in_marks pdg in_marks ~m2m:in_m2m other_rqs in let rqs = List.fold_left (translate_out_mark pdg out_m2m) other_rqs out_marks in rqs (** To also use interprocedural propagation, the user can instantiate this * functor. This is, of course, not mandatory because one can want to use a more * complex propagation (like slicing for instance, that has more than one * version for a source function). *) module F_Proj (C : PdgMarks.Config) : PdgMarks.Proj with type mark = C.M.t and type call_info = C.M.call_info = struct module F = PdgMarks.F_Fct (C.M) type mark = C.M.t type call_info = C.M.call_info type fct = F.fi type fct_info = F.t type t = fct_info Varinfo.Hashtbl.t let empty () = Varinfo.Hashtbl.create 10 let find_marks proj fct_var = try let f = Varinfo.Hashtbl.find proj fct_var in Some (F.get_idx f) with Not_found -> None let get proj pdg = let kf = PdgTypes.Pdg.get_kf pdg in let fct_var = Kernel_function.get_vi kf in try Varinfo.Hashtbl.find proj fct_var with Not_found -> let pdg = !Db.Pdg.get kf in let info = F.create pdg in Varinfo.Hashtbl.add proj fct_var info; info (** Add the marks to the pdg nodes. * @return a merge between the input [other_rqs] and the new requests produced. * *) let apply_fct_rqs proj (pdg, mark_list) other_rqs = match mark_list with | PdgMarks.SelList [] | PdgMarks.SelTopMarks [] -> (* don't want to build the marks when calling [get] if there is nothing to do... *) other_rqs | PdgMarks.SelList mark_list -> let fm = get proj pdg in let to_prop = F.mark_and_propagate fm mark_list in let rqs = translate_marks_to_prop pdg to_prop ~in_m2m:C.mark_to_prop_to_caller_input ~out_m2m:C.mark_to_prop_to_called_output other_rqs in rqs | PdgMarks.SelTopMarks _marks -> (* TODO #345 *) Pdg_parameters.not_yet_implemented "mark propagation in Top PDG" (** Add the marks to the pdg nodes and also apply all the produced requests * to do the interprocedural propagation. *) let mark_and_propagate proj pdg node_marks = let rec apply_all rqs = match rqs with | [] -> () | rq :: tl_rqs -> let new_rqs = apply_fct_rqs proj rq tl_rqs in apply_all new_rqs in apply_all [(pdg, PdgMarks.SelList node_marks)] end (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/marks.mli������������������������������������������������������0000666�0000000�0000000�00000006457�13571573400�016071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open PdgMarks (** [in_marks_to_caller] translate the input information part returned by [mark_and_propagate] into [(node, mark) list] related to a call. Example : if marks has been propagated in [f] and some input marks has changed, they have to be propagated into [f] callers. So this function takes one call to [f] and translate input keys into nodes. The function ([m2m]) is called for each element to translate. See {!m2m} for more information about how to use it. *) val in_marks_to_caller : PdgTypes.Pdg.t -> Cil_types.stmt -> 'mark m2m -> ?rqs:('mark select) -> 'mark info_caller_inputs -> 'mark select (** translate the input information part returned by [mark_and_propagate] using [in_marks_to_caller] for each call. (see above) *) val translate_in_marks : PdgTypes.Pdg.t-> 'mark info_caller_inputs-> ?m2m:('mark call_m2m) -> 'mark pdg_select -> 'mark pdg_select (** we have a list of a call output marks, and we want to translate it into a list of marks on the called function nodes. The pdg is the called_pdg. *) val call_out_marks_to_called : PdgTypes.Pdg.t -> 'mark m2m -> ?rqs:('mark select) -> (PdgIndex.Signature.out_key * 'mark) list -> 'mark select (** use both [translate_in_marks] and [call_out_marks_to_called] to translate the information provided by [mark_and_propagate] info selection on other functions. *) val translate_marks_to_prop : PdgTypes.Pdg.t -> 'mark info_inter -> ?in_m2m:('mark call_m2m) -> ?out_m2m:('mark call_m2m) -> 'mark pdg_select -> 'mark pdg_select module F_Proj (C : Config) : Proj with type mark = C.M.t and type call_info = C.M.call_info (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/pdg_parameters.ml����������������������������������������������0000666�0000000�0000000�00000005241�13571573400�017566� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "pdg" let shortname = "pdg" let help = "Program Dependence Graph" end) let output = add_group "Output" module BuildAll = WithOutput (struct let option_name = "-pdg" let help = "build the dependence graph of each function" let output_by_default = false end) module BuildFct = Kernel_function_set (struct let option_name = "-fct-pdg" let arg_name = "" let help = "build the dependence graph for the specified function" end) let () = Parameter_customize.set_group output module PrintBw = False(struct let option_name = "-codpds" let help = "force option -pdg-print to show the co-dependencies rather than the dependencies" end) let () = Parameter_customize.set_group output module DotBasename = Empty_string (struct let option_name = "-pdg-dot" let arg_name = "basename" let help = "put the PDG of function <f> in basename.f.dot" end) (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/pdg_parameters.mli���������������������������������������������0000666�0000000�0000000�00000003525�13571573400�017742� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module BuildAll: Parameter_sig.With_output module BuildFct: Parameter_sig.Kernel_function_set module PrintBw: Parameter_sig.Bool module DotBasename: Parameter_sig.String (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/pdg_state.ml���������������������������������������������������0000666�0000000�0000000�00000015477�13571573400�016557� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** DataState is associated with a program point and provide the dependencies for the data, ie. it stores for each location the nodes of the pdg where its value was last defined. *) let dkey = Pdg_parameters.register_category "state" module P = Pdg_parameters open PdgTypes exception Cannot_fold let make loc_info under_outputs = { loc_info = loc_info; under_outputs = under_outputs } let empty = make LocInfo.empty Locations.Zone.bottom (* Convention: bottom is used for statements that are not reachable, and for calls that never terminate. In this case, the second field must be ignored *) let bottom = make LocInfo.bottom Locations.Zone.bottom let pretty fmt state = Format.fprintf fmt "state = %a@.with under_outputs = %a@." LocInfo.pretty state.loc_info Locations.Zone.pretty state.under_outputs let add_loc_node state ~exact loc node = P.debug ~dkey ~level:2 "add_loc_node (%s) : node %a -> %a@." (if exact then "exact" else "merge") PdgTypes.Node.pretty node Locations.Zone.pretty loc ; if LocInfo.is_bottom state.loc_info then (* Do not add anything to a bottom state (which comes from an unreachable statement *) state else let new_info = NodeSetLattice.inject_singleton node in let new_loc_info = LocInfo.add_binding ~exact state.loc_info loc new_info in let new_outputs = (* Zone.link in the under-approx version of Zone.join *) if exact then Locations.Zone.link state.under_outputs loc else state.under_outputs in P.debug ~dkey ~level:2 "add_loc_node -> %a" pretty state; make new_loc_info new_outputs (** this one is very similar to [add_loc_node] except that * we want to accumulate the nodes (exact = false) but nonetheless * define under_outputs like (exact = true) *) let add_init_state_input state loc node = match loc with | Locations.Zone.Top(_p,_o) -> (* don't add top because it loses everything*) state | _ -> let new_info = NodeSetLattice.inject_singleton node in let new_loc_info = LocInfo.add_binding ~exact:false state.loc_info loc new_info in let new_outputs = Locations.Zone.link state.under_outputs loc in make new_loc_info new_outputs let test_and_merge ~old new_ = if LocInfo.is_included new_.loc_info old.loc_info && Locations.Zone.is_included old.under_outputs new_.under_outputs then (false, old) else (* Catch Bottom states, as under_outputs get a special value *) if LocInfo.is_bottom old.loc_info then true, new_ else if LocInfo.is_bottom new_.loc_info then true, old else let new_loc_info = LocInfo.join old.loc_info new_.loc_info in let new_outputs = Locations.Zone.meet old.under_outputs new_.under_outputs in let new_state = { loc_info = new_loc_info ; under_outputs = new_outputs } in true, new_state (** returns pairs of (n, z_opt) where n is a node that computes a part of [loc] * and z is the intersection between [loc] and the zone computed by the node. * @raise Cannot_fold if the state is top (TODO : something better ?) * *) let get_loc_nodes_and_part state loc = let process z nodes acc = if Locations.Zone.intersects z loc then let z = if Locations.Zone.equal loc z then Some loc (* Be careful not ot put None here, because if we have n_1 : (s1 = s2) and then n_2 : (s1.b = 3) the state looks like : s1.a -> n_1; s1.b -> n_2 ; s1.c -> n_1. And if we look for s1.a in that state, we get n_1 but this node represent more that s1.a even if it is so in the state... *) else Some (Locations.Zone.narrow z loc) in let add n acc = P.debug ~dkey ~level:2 "get_loc_nodes -> %a@." PdgTypes.Node.pretty_with_part (n,z); (n,z)::acc in NodeSetLattice.fold add nodes acc else acc in match state.loc_info with | LocInfo.Top -> raise Cannot_fold | LocInfo.Bottom -> [] | LocInfo.Map m -> LocInfo.fold process m [] (** @raise Cannot_fold (see [get_loc_nodes_and_part]) *) let get_loc_nodes state loc = P.debug ~dkey ~level:2 "get_loc_nodes %a@. in %a@." Locations.Zone.pretty loc pretty state ; if Locations.Zone.equal loc Locations.Zone.bottom then [], None (* nothing to do *) else let nodes = get_loc_nodes_and_part state loc in let undef_zone = Locations.Zone.diff loc state.under_outputs in P.debug ~dkey ~level:2 "get_loc_nodes -> undef = %a@." Locations.Zone.pretty undef_zone; let undef_zone = if (Locations.Zone.equal undef_zone Locations.Zone.bottom) then None else Some undef_zone in nodes, undef_zone open Cil_datatype type states = PdgTypes.data_state Stmt.Hashtbl.t (* Slightly ugly, but should not be a problem unless the sid counter wraps *) let stmt_init = List.hd Stmt.reprs let stmt_last = { stmt_init with Cil_types.sid = stmt_init.Cil_types.sid - 1 } let store_init_state states state = Stmt.Hashtbl.add states stmt_init state let store_last_state states state = Stmt.Hashtbl.add states stmt_last state let get_init_state states = Stmt.Hashtbl.find states stmt_init let get_last_state states = Stmt.Hashtbl.find states stmt_last let get_stmt_state states stmt = Stmt.Hashtbl.find states stmt �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/pdg_state.mli��������������������������������������������������0000666�0000000�0000000�00000005426�13571573400�016721� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) exception Cannot_fold open PdgTypes (** Types data_state and Node.t come froms this module *) val make : PdgTypes.LocInfo.t -> Locations.Zone.t -> data_state val empty : data_state val bottom: data_state val add_loc_node : data_state -> exact:bool -> Locations.Zone.t -> Node.t -> data_state val add_init_state_input : data_state -> Locations.Zone.t -> Node.t -> data_state (** Kind of 'join' of the two states but test before if the new state is included in ~old. @return (true, old U new) if the result is a new state, (false, old) if new is included in old. *) val test_and_merge : old:data_state -> data_state -> bool * data_state (** @raise Cannot_fold if the state is Top *) val get_loc_nodes : data_state -> Locations.Zone.t -> (Node.t * Locations.Zone.t option) list * Locations.Zone.t option val pretty : Format.formatter -> data_state -> unit (* ~~~~~~~~~~~~~~~~~~~ *) type states = data_state Cil_datatype.Stmt.Hashtbl.t val store_init_state : states -> data_state -> unit val store_last_state : states -> data_state -> unit val get_init_state : states -> data_state val get_stmt_state : states -> Cil_types.stmt -> data_state val get_last_state : states -> data_state ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/register.ml����������������������������������������������������0000666�0000000�0000000�00000015512�13571573400�016417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let compute = Build.compute_pdg let pretty ?(bw=false) fmt pdg = let kf = PdgTypes.Pdg.get_kf pdg in Format.fprintf fmt "@[RESULT for %s:@]@\n@[ %a@]" (Kernel_function.get_name kf) (PdgTypes.Pdg.pretty_bw ~bw) pdg let pretty_node short = if short then PdgTypes.Node.pretty else PdgTypes.Node.pretty_node let print_dot pdg filename = PdgTypes.Pdg.build_dot filename pdg; Pdg_parameters.feedback "dot file generated in %s" filename module Tbl = Kernel_function.Make_Table (PdgTypes.Pdg) (struct let name = "Pdg.State" let dependencies = [] (* postponed because !Db.From.self may not exist yet *) let size = 17 end) let () = Cmdline.run_after_extended_stage (fun () -> State_dependency_graph.add_codependencies ~onto:Tbl.self [ !Db.From.self ]) (** Register external functions into Db. *) let () = Db.Pdg.self := Tbl.self; Db.Pdg.get := Tbl.memo compute; Db.Pdg.node_key := PdgTypes.Node.elem_key; Db.Pdg.find_decl_var_node := Sets.find_decl_var_node; Db.Pdg.find_entry_point_node := Sets.find_entry_point_node; Db.Pdg.find_top_input_node := Sets.find_top_input_node; Db.Pdg.find_simple_stmt_nodes := Sets.find_simple_stmt_nodes; Db.Pdg.find_stmt_and_blocks_nodes := Sets.find_stmt_and_blocks_nodes; Db.Pdg.find_stmt_node := Sets.find_stmt_node; Db.Pdg.find_label_node := Sets.find_label_node; Db.Pdg.find_location_nodes_at_stmt := Sets.find_location_nodes_at_stmt; Db.Pdg.find_location_nodes_at_begin := Sets.find_location_nodes_at_begin; Db.Pdg.find_location_nodes_at_end := Sets.find_location_nodes_at_end; Db.Pdg.find_call_ctrl_node := Sets.find_call_ctrl_node; Db.Pdg.find_call_input_node := Sets.find_call_num_input_node; Db.Pdg.find_call_output_node := Sets.find_call_output_node; Db.Pdg.find_input_node := Sets.find_input_node; Db.Pdg.find_ret_output_node := Sets.find_output_node; Db.Pdg.find_output_nodes := Sets.find_output_nodes; Db.Pdg.find_all_inputs_nodes := Sets.find_all_input_nodes; Db.Pdg.find_call_stmts := Sets.find_call_stmts; Db.Pdg.find_code_annot_nodes := Annot.find_code_annot_nodes; Db.Pdg.find_fun_precond_nodes := Annot.find_fun_precond_nodes; Db.Pdg.find_fun_postcond_nodes := Annot.find_fun_postcond_nodes; Db.Pdg.find_call_out_nodes_to_select := Sets.find_call_out_nodes_to_select; Db.Pdg.find_in_nodes_to_select_for_this_call := Sets.find_in_nodes_to_select_for_this_call; Db.Pdg.direct_dpds := Sets.direct_dpds; Db.Pdg.direct_ctrl_dpds := Sets.direct_ctrl_dpds; Db.Pdg.direct_data_dpds := Sets.direct_data_dpds; Db.Pdg.direct_addr_dpds := Sets.direct_addr_dpds; Db.Pdg.all_dpds := Sets.find_nodes_all_dpds; Db.Pdg.all_ctrl_dpds := Sets.find_nodes_all_ctrl_dpds; Db.Pdg.all_data_dpds := Sets.find_nodes_all_data_dpds; Db.Pdg.all_addr_dpds := Sets.find_nodes_all_addr_dpds; Db.Pdg.direct_uses := Sets.direct_uses; Db.Pdg.direct_ctrl_uses := Sets.direct_ctrl_uses; Db.Pdg.direct_data_uses := Sets.direct_data_uses; Db.Pdg.direct_addr_uses := Sets.direct_addr_uses; Db.Pdg.all_uses := Sets.all_uses; Db.Pdg.custom_related_nodes := Sets.custom_related_nodes; Db.Pdg.iter_nodes := PdgTypes.Pdg.iter_nodes; Db.Pdg.pretty := pretty ; Db.Pdg.pretty_node := pretty_node ; Db.Pdg.pretty_key := PdgIndex.Key.pretty; Db.Pdg.extract := print_dot (* This module contains polymorphic functions : cannot be registered in Db. Can be used through Pdg.Register instead (see Pdg.mli) *) include Marks let deps = [!Db.Pdg.self; Pdg_parameters.BuildAll.self; Pdg_parameters.BuildFct.self] let () = Pdg_parameters.BuildAll.set_output_dependencies deps let compute_for_kf kf = let all = Pdg_parameters.BuildAll.get () in (all && !Db.Value.is_called kf) || Kernel_function.Set.mem kf (Pdg_parameters.BuildFct.get ()) let compute () = !Db.Value.compute (); let do_kf_pdg kf = if compute_for_kf kf then let pdg = !Db.Pdg.get kf in let dot_basename = Pdg_parameters.DotBasename.get () in if dot_basename <> "" then let fname = Kernel_function.get_name kf in !Db.Pdg.extract pdg (dot_basename ^ "." ^ fname ^ ".dot") in Callgraph.Uses.iter_in_rev_order do_kf_pdg; let pp_sep fmt () = Format.pp_print_string fmt "," in Pdg_parameters.( debug "Logging keys : %a" (Format.pp_print_list ~pp_sep pp_category) (get_debug_keys ())); if Pdg_parameters.BuildAll.get () then Pdg_parameters.feedback "====== PDG GRAPH COMPUTED ======" let compute_once, _ = State_builder.apply_once "Pdg.Register.compute_once" deps compute let output () = let bw = Pdg_parameters.PrintBw.get () in let do_kf_pdg kf = if compute_for_kf kf then let pdg = !Db.Pdg.get kf in let header fmt = Format.fprintf fmt "PDG for %a" Kernel_function.pretty kf in Pdg_parameters.printf ~header "@[ @[%a@]@]" (PdgTypes.Pdg.pretty_bw ~bw) pdg in Callgraph.Uses.iter_in_rev_order do_kf_pdg let something_to_do () = Pdg_parameters.BuildAll.get () || not (Kernel_function.Set.is_empty (Pdg_parameters.BuildFct.get ())) let main () = if something_to_do () then (compute_once (); Pdg_parameters.BuildAll.output output) let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/sets.ml��������������������������������������������������������0000666�0000000�0000000�00000034632�13571573400�015555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Provides function to extract information from the PDG. *) open Cil_types open PdgIndex type nodes_and_undef = (PdgTypes.Node.t * Locations.Zone.t option) list * Locations.Zone.t option let get_init_state pdg = try Pdg_state.get_init_state (PdgTypes.Pdg.get_states pdg) with Not_found -> assert false (** @raise Not_found when no last state (strange !) *) let get_last_state pdg = Pdg_state.get_last_state (PdgTypes.Pdg.get_states pdg) (** @raise Not_found for unreachable stmt *) let get_stmt_state pdg stmt = Pdg_state.get_stmt_state (PdgTypes.Pdg.get_states pdg) stmt let find_node pdg key = FctIndex.find_info (PdgTypes.Pdg.get_index pdg) key (** notice that there can be several nodes if the statement is a call. * For If, Switch, ... the node represent only the condition * (see find_stmt_nodes below). *) let find_simple_stmt_nodes pdg stmt = let idx = PdgTypes.Pdg.get_index pdg in let key = Key.stmt_key stmt in (* The call below can raise Not_found if the statement is unreachable *) let nodes = FctIndex.find_all idx key in match stmt.skind with | Return _ -> (* also add OutRet *) (try let ret = FctIndex.find_all idx Key.output_key in ret @ nodes with Not_found -> nodes) | _ -> nodes let rec add_stmt_nodes pdg nodes s = let s_nodes = try find_simple_stmt_nodes pdg s with Not_found -> [] (* Catch the fact that s may correspond to no node, for example if [s] is dead code *) in let nodes = s_nodes @ nodes in let add acc stmt = (* Catch the fact that a sub-statement of s may be unreachable *) try add_stmt_nodes pdg acc stmt with Not_found -> acc in let add_block_stmts_nodes node_list blk = List.fold_left add node_list blk.bstmts in match s.skind with | Switch (_,blk,_,_) | Loop (_, blk, _, _, _) | Block blk -> Pdg_parameters.debug ~level:2 " select_stmt_computation on composed stmt %d@." s.sid; add_block_stmts_nodes nodes blk | UnspecifiedSequence seq -> Pdg_parameters.debug ~level:2 " select_stmt_computation on composed stmt %d@." s.sid; add_block_stmts_nodes nodes (Cil.block_from_unspecified_sequence seq) | If (_,bthen,belse,_) -> let nodes = add_block_stmts_nodes nodes bthen in add_block_stmts_nodes nodes belse | _ -> nodes (** notice that there can be several nodes if the statement is a call. * If the stmt is a composed instruction (block, etc), all the nodes of the * enclosed statements are considered. *) let find_stmt_and_blocks_nodes pdg stmt = add_stmt_nodes pdg [] stmt let find_stmt_node pdg stmt = find_node pdg (Key.stmt_key stmt) let find_entry_point_node pdg = try find_node pdg Key.entry_point with Not_found -> assert false let find_top_input_node pdg = find_node pdg Key.top_input let find_loc_nodes pdg state loc = let nodes, undef = Pdg_state.get_loc_nodes state loc in let nodes, undef = match undef with | Some undef -> let state = get_init_state pdg in let init_nodes, init_undef = Pdg_state.get_loc_nodes state undef in let init_nodes = match loc with | Locations.Zone.Top(_,_) -> begin try (find_top_input_node pdg, None)::init_nodes with Not_found -> init_nodes end | _ -> init_nodes in let nodes = List.fold_left (fun acc n -> n::acc) nodes init_nodes in nodes, init_undef | None -> nodes, undef in nodes, undef let find_location_nodes_at_stmt pdg stmt ~before loc = let get_nodes state = find_loc_nodes pdg state loc in let get_stmt_nodes stmt = get_nodes (get_stmt_state pdg stmt) in let get_stmts_nodes stmts = let add (acc_nodes, acc_loc) stmt = let nodes, undef = get_stmt_nodes stmt in let acc_nodes = nodes @ acc_nodes in let acc_loc = match acc_loc, undef with | _, None -> acc_loc | None, _ -> undef | Some acc_loc, Some undef -> Some (Locations.Zone.join acc_loc undef) in (acc_nodes, acc_loc) in List.fold_left add ([], None) stmts in let nodes, undef_zone = if before then get_stmt_nodes stmt else match stmt.skind, stmt.succs with | Return _, [] -> get_nodes (get_last_state pdg) | _, [] -> (* no successors but not a return => unreachable *) raise Not_found | _, succs -> get_stmts_nodes succs in nodes, undef_zone let find_location_nodes_at_end pdg loc = find_loc_nodes pdg (get_last_state pdg) loc (* be careful that begin is different from init because * init_state only contains implicit inputs * while begin contains only formal arguments *) let find_location_nodes_at_begin pdg loc = let kf = PdgTypes.Pdg.get_kf pdg in let stmts = if !Db.Value.use_spec_instead_of_definition kf then [] else let f = Kernel_function.get_definition kf in f.sbody.bstmts in let state = match stmts with | [] -> get_last_state pdg | stmt :: _ -> get_stmt_state pdg stmt in find_loc_nodes pdg state loc let find_label_node pdg label_stmt label = find_node pdg (Key.label_key label_stmt label) let find_decl_var_node pdg v = find_node pdg (Key.decl_var_key v) let find_output_node pdg = find_node pdg Key.output_key let find_input_node pdg numin = let sgn = FctIndex.sgn (PdgTypes.Pdg.get_index pdg) in PdgIndex.Signature.find_input sgn numin let find_all_input_nodes pdg = let sgn = FctIndex.sgn (PdgTypes.Pdg.get_index pdg) in let add acc (_in_key, info) = info::acc in PdgIndex.Signature.fold_all_inputs add [] sgn let find_call_input_nodes pdg_caller call_stmt in_key = match in_key with | PdgIndex.Signature.InCtrl | PdgIndex.Signature.InNum _ -> let idx = PdgTypes.Pdg.get_index pdg_caller in let _, call_sgn = FctIndex.find_call idx call_stmt in let node = PdgIndex.Signature.find_in_info call_sgn in_key in [ node, None ], None | PdgIndex.Signature.InImpl zone -> find_location_nodes_at_stmt pdg_caller call_stmt ~before:true zone let find_call_ctrl_node pdg stmt = let key = Key.call_ctrl_key stmt in find_node pdg key let find_call_num_input_node pdg call num_in = if num_in = 0 then Pdg_parameters.fatal "0 is not an input number" ; let key = Key.call_input_key call num_in in find_node pdg key let find_call_output_node pdg call = let key = Key.call_outret_key call in find_node pdg key let find_output_nodes called_pdg out_key = match out_key with | PdgIndex.Signature.OutRet -> [ find_output_node called_pdg, None ], None | PdgIndex.Signature.OutLoc out -> find_location_nodes_at_end called_pdg out let find_call_stmts kf ~caller = match List.filter (fun (f, _) -> Kernel_function.equal f caller) (!Db.Value.callers kf) with | [] -> [] | [ _, callsites ] -> assert (callsites <> []); callsites | _ -> assert false (** {2 Build sets of nodes} This parts groups the functions that build sets from the pdg. Made to answer user questions rather that to build slice marks, because efficient marking doesn't need to build this sets. However, it might be useful to prove that it is the same... *) (** add the node in the list if it is not already in. *) let add_node_in_list node node_list = let is_node_in node node_list = let is_node n = (PdgTypes.Node.compare node n) = 0 in try let _ = List.find is_node node_list in true with Not_found -> false in if is_node_in node node_list then node_list, false else (node :: node_list), true (** add the node to the list. It it wasn't already in the list, * recursively call the same function on the successors or/and predecessors * according to the flags. *) let rec add_node_and_custom_dpds get_dpds node_list node = let node_list, added = add_node_in_list node node_list in if added then let is_block = match PdgTypes.Node.elem_key node with | Key.SigKey (PdgIndex.Signature.In PdgIndex.Signature.InCtrl) -> true | Key.Stmt stmt -> (match stmt.skind with Block _ | UnspecifiedSequence _ -> true | _ -> false) | _ -> false in if is_block then node_list (* blocks are not relevant to propagate information *) else List.fold_left (add_node_and_custom_dpds get_dpds) node_list (get_dpds node) else node_list let add_nodes_and_custom_dpds get_dpds node_list nodes = List.fold_left (add_node_and_custom_dpds get_dpds) node_list nodes let custom_related_nodes get_dpds nodes = add_nodes_and_custom_dpds get_dpds [] nodes (** we ignore z_part for the moment. TODO ? *) let filter_nodes l = List.map (fun (n,_) -> n) l (** {3 Backward} build sets of the dependencies of given nodes *) (** gives the list of nodes that the given node depends on, without looking at the kind of dependency. *) let direct_dpds pdg node = filter_nodes (PdgTypes.Pdg.get_all_direct_dpds pdg node) (** gives the list of nodes that the given node depends on, with a given kind of dependency. *) let direct_x_dpds dpd_type pdg node = filter_nodes (PdgTypes.Pdg.get_x_direct_dpds dpd_type pdg node) let direct_data_dpds = direct_x_dpds PdgTypes.Dpd.Data let direct_ctrl_dpds = direct_x_dpds PdgTypes.Dpd.Ctrl let direct_addr_dpds = direct_x_dpds PdgTypes.Dpd.Addr (** accumulates in [node_list] the results of [add_node_and_dpds_or_codpds] for all the [nodes] *) let find_nodes_all_x_dpds dpd_type pdg nodes = let merge_dpds node_list node = let node_dpds = direct_x_dpds dpd_type pdg node in add_nodes_and_custom_dpds (direct_dpds pdg) node_list node_dpds in List.fold_left merge_dpds [] nodes let find_nodes_all_dpds pdg nodes = let merge_dpds node_list node = let node_dpds = direct_dpds pdg node in add_nodes_and_custom_dpds (direct_dpds pdg) node_list node_dpds in List.fold_left merge_dpds [] nodes let find_nodes_all_data_dpds = find_nodes_all_x_dpds PdgTypes.Dpd.Data let find_nodes_all_ctrl_dpds = find_nodes_all_x_dpds PdgTypes.Dpd.Ctrl let find_nodes_all_addr_dpds = find_nodes_all_x_dpds PdgTypes.Dpd.Addr (** {3 Forward} build sets of the nodes that depend on given nodes *) (** @return the list of nodes that directly depend on the given node *) let direct_uses pdg node = filter_nodes (PdgTypes.Pdg.get_all_direct_codpds pdg node) let direct_x_uses dpd_type pdg node = filter_nodes (PdgTypes.Pdg.get_x_direct_codpds dpd_type pdg node) let direct_data_uses = direct_x_uses PdgTypes.Dpd.Data let direct_ctrl_uses = direct_x_uses PdgTypes.Dpd.Ctrl let direct_addr_uses = direct_x_uses PdgTypes.Dpd.Addr (** @return a list containing all the nodes that depend on the given nodes. *) let all_uses pdg nodes = let add_codpds node_list node = let codpds = PdgTypes.Pdg.get_all_direct_codpds pdg node in let codpds = filter_nodes codpds in let get n = filter_nodes (PdgTypes.Pdg.get_all_direct_codpds pdg n) in add_nodes_and_custom_dpds get node_list codpds in List.fold_left add_codpds [] nodes (** {3 Others} *) (* VP: unused function *) (* let node_set_of_list l = List.fold_left (fun acc n -> NodeSet.add n acc) NodeSet.empty l *) (** @return the call outputs nodes [out] such that [find_output_nodes pdg_called out_key] intersects [called_selected_nodes]. *) let find_call_out_nodes_to_select pdg_called called_selected_nodes pdg_caller call_stmt = Pdg_parameters.debug ~level:2 "[pdg:find_call_out_nodes_to_select] for call sid:%d@." call_stmt.sid; let _, call_sgn = FctIndex.find_call (PdgTypes.Pdg.get_index pdg_caller) call_stmt in let test_out acc (out_key, call_out_node) = let called_out_nodes, _undef = find_output_nodes pdg_called out_key in (* undef can be ignored in this case because it is taken into account in * the call part. *) let intersect = List.exists (fun (n,_z) -> PdgTypes.NodeSet.mem n called_selected_nodes) called_out_nodes in if intersect then begin Pdg_parameters.debug ~level:2 "\t+ %a@." PdgTypes.Node.pretty call_out_node; call_out_node::acc end else acc in PdgIndex.Signature.fold_all_outputs test_out [] call_sgn let find_in_nodes_to_select_for_this_call pdg_caller caller_selected_nodes call_stmt pdg_called = Pdg_parameters.debug ~level:2 "[pdg:find_in_nodes_to_select_for_this_call] for call sid:%d@." call_stmt.sid; let sgn = FctIndex.sgn (PdgTypes.Pdg.get_index pdg_called) in let test_in acc (in_key, in_node) = let caller_nodes, _undef = find_call_input_nodes pdg_caller call_stmt in_key in (* undef can be ignored in this case because it is taken into account in * the call part. *) let intersect = List.exists (fun (n,_z) -> PdgTypes.NodeSet.mem n caller_selected_nodes) caller_nodes in if intersect then begin Pdg_parameters.debug ~level:2 "\t+ %a@." PdgTypes.Node.pretty in_node; in_node::acc end else acc in PdgIndex.Signature.fold_all_inputs test_in [] sgn (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg/sets.mli�������������������������������������������������������0000666�0000000�0000000�00000011447�13571573400�015725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** PDG (program dependence graph) access functions. *) open Cil_types type nodes_and_undef = (PdgTypes.Node.t * Locations.Zone.t option) list * Locations.Zone.t option (** {2 PDG nodes for some elements} *) val find_stmt_node: PdgTypes.Pdg.t -> stmt -> PdgTypes.Node.t val find_simple_stmt_nodes: PdgTypes.Pdg.t -> stmt -> PdgTypes.Node.t list val find_stmt_and_blocks_nodes: PdgTypes.Pdg.t -> stmt -> PdgTypes.Node.t list val find_location_nodes_at_stmt: PdgTypes.Pdg.t -> stmt -> before:bool -> Locations.Zone.t -> nodes_and_undef val find_location_nodes_at_end: PdgTypes.Pdg.t -> Locations.Zone.t -> nodes_and_undef val find_location_nodes_at_begin: PdgTypes.Pdg.t -> Locations.Zone.t -> nodes_and_undef val find_label_node: PdgTypes.Pdg.t -> stmt -> label -> PdgTypes.Node.t val find_decl_var_node: PdgTypes.Pdg.t -> varinfo -> PdgTypes.Node.t val find_input_node: PdgTypes.Pdg.t -> int -> PdgTypes.Node.t val find_output_node: PdgTypes.Pdg.t -> PdgTypes.Node.t val find_all_input_nodes: PdgTypes.Pdg.t -> PdgTypes.Node.t list val find_entry_point_node: PdgTypes.Pdg.t -> PdgTypes.Node.t val find_top_input_node: PdgTypes.Pdg.t -> PdgTypes.Node.t val find_output_nodes: PdgTypes.Pdg.t -> PdgIndex.Signature.out_key -> nodes_and_undef val find_call_ctrl_node: PdgTypes.Pdg.t -> stmt -> PdgTypes.Node.t val find_call_num_input_node: PdgTypes.Pdg.t -> stmt -> int -> PdgTypes.Node.t val find_call_input_nodes: PdgTypes.Pdg.t -> stmt -> PdgIndex.Signature.in_key -> nodes_and_undef val find_call_output_node: PdgTypes.Pdg.t -> stmt -> PdgTypes.Node.t val find_call_stmts: kernel_function -> caller:kernel_function -> stmt list val find_call_out_nodes_to_select: PdgTypes.Pdg.t -> PdgTypes.NodeSet.t -> PdgTypes.Pdg.t -> stmt -> PdgTypes.Node.t list val find_in_nodes_to_select_for_this_call: PdgTypes.Pdg.t -> PdgTypes.NodeSet.t -> stmt -> PdgTypes.Pdg.t -> PdgTypes.Node.t list (** direct dependencies only: * This means the nodes that have an edge to the given node. *) val direct_dpds: PdgTypes.Pdg.t -> PdgTypes.Node.t -> PdgTypes.Node.t list val direct_data_dpds: PdgTypes.Pdg.t -> PdgTypes.Node.t -> PdgTypes.Node.t list val direct_ctrl_dpds: PdgTypes.Pdg.t -> PdgTypes.Node.t -> PdgTypes.Node.t list val direct_addr_dpds: PdgTypes.Pdg.t -> PdgTypes.Node.t -> PdgTypes.Node.t list (** transitive closure *) val find_nodes_all_dpds: PdgTypes.Pdg.t -> PdgTypes.Node.t list -> PdgTypes.Node.t list val find_nodes_all_data_dpds: PdgTypes.Pdg.t -> PdgTypes.Node.t list -> PdgTypes.Node.t list val find_nodes_all_ctrl_dpds: PdgTypes.Pdg.t -> PdgTypes.Node.t list -> PdgTypes.Node.t list val find_nodes_all_addr_dpds: PdgTypes.Pdg.t -> PdgTypes.Node.t list -> PdgTypes.Node.t list (** forward *) val direct_uses: PdgTypes.Pdg.t -> PdgTypes.Node.t -> PdgTypes.Node.t list val direct_data_uses: PdgTypes.Pdg.t -> PdgTypes.Node.t -> PdgTypes.Node.t list val direct_ctrl_uses: PdgTypes.Pdg.t -> PdgTypes.Node.t -> PdgTypes.Node.t list val direct_addr_uses: PdgTypes.Pdg.t -> PdgTypes.Node.t -> PdgTypes.Node.t list val all_uses: PdgTypes.Pdg.t -> PdgTypes.Node.t list -> PdgTypes.Node.t list (** others *) val custom_related_nodes: (PdgTypes.Node.t -> PdgTypes.Node.t list) -> PdgTypes.Node.t list -> PdgTypes.Node.t list �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg_types/���������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015461� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg_types/pdgIndex.ml����������������������������������������������0000666�0000000�0000000�00000054025�13571573400�017563� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** *) open Cil_types exception AddError exception CallStatement exception Not_equal let is_call_stmt stmt = match stmt.skind with | Instr (Call _|Local_init(_,ConsInit _,_)) -> true | _ -> false module Signature = struct type in_key = InCtrl | InNum of int | InImpl of Locations.Zone.t type out_key = OutRet | OutLoc of Locations.Zone.t type key = In of in_key | Out of out_key type 'info t = { in_ctrl : 'info option ; in_params : (int * 'info) list ; (** implicit inputs : Maybe we should use [Lmap_bitwise.Make_bitwise] ? but that would make things a lot more complicated... :-? *) in_implicits : (Locations.Zone.t * 'info) list ; out_ret : 'info option ; outputs : (Locations.Zone.t * 'info) list } module Str_descr = struct open Structural_descr let in_key = t_sum [| [| p_int |]; [| Locations.Zone.packed_descr |] |] let out_key = t_sum [| [| Locations.Zone.packed_descr |] |] let key = t_sum [| [| pack in_key |]; [| pack out_key |] |] let t d_info = t_record [| pack (t_option d_info); pack (t_list (t_tuple [| p_int; pack d_info |])); pack (t_list (t_tuple [| Locations.Zone.packed_descr; pack d_info |])); pack (t_option d_info); pack (t_list (t_tuple [| Locations.Zone.packed_descr; pack d_info |])); |] end let empty = { in_ctrl = None ; in_params = [] ; in_implicits = [] ; out_ret = None; outputs = [] } let in_key n = In (InNum n) let in_impl_key loc = In (InImpl loc) let in_top_key = in_impl_key (Locations.Zone.top) let in_ctrl_key = In InCtrl let out_ret_key = Out OutRet let out_key out = Out (OutLoc out) let mk_undef_in_key loc = InImpl loc let copy sgn = sgn (** InCtrl < InNum < InImpl *) let cmp_in_key k1 k2 = match k1, k2 with | (InImpl z1), (InImpl z2) when Locations.Zone.equal z1 z2 -> 0 | (InImpl _), (InImpl _) -> raise Not_equal | (InImpl _), _ -> 1 | _, (InImpl _) -> -1 | InNum n1, InNum n2 -> n1 - n2 | (InNum _), _ -> 1 | _, (InNum _) -> -1 | InCtrl, InCtrl -> 0 (** OutRet < OutLoc *) let cmp_out_key k1 k2 = match k1, k2 with | OutRet, OutRet -> 0 | OutRet, (OutLoc _) -> -1 | (OutLoc _), OutRet -> 1 | OutLoc l1, OutLoc l2 when Locations.Zone.equal l1 l2 -> 0 | OutLoc _, OutLoc _ -> raise Not_equal let equal_out_key k1 k2 = try (0 = cmp_out_key k1 k2) with Not_equal -> false (** add a mapping between [num] and [info] in [lst]. * if we already have something for [num], use function [merge] *) let add_in_list lst num info merge = let new_e = (num, info) in let rec add_to_l l = match l with [] -> [new_e] | (ne, old_e) as e :: tl -> if ne = num then let e = merge old_e info in (num, e)::tl else if ne < num then e :: (add_to_l tl) else new_e :: l in add_to_l lst let add_loc l_loc loc info merge = let rec add lst = match lst with | [] -> [(loc, info)] | (l, e)::tl -> if Locations.Zone.equal l loc then let new_e = merge e info in (loc, new_e)::tl else begin (* if (Locations.Zone.intersects l loc) then begin Format.printf "[pdg] implicit inputs intersect : %a and %a\n" Locations.Zone.pretty l Locations.Zone.pretty loc; assert false end; *) (l, e)::(add tl) end in add l_loc let add_replace replace _old_e new_e = if replace then new_e else raise AddError let add_input sgn n info ~replace = { sgn with in_params = add_in_list sgn.in_params n info (add_replace replace) } let add_impl_input sgn loc info ~replace = { sgn with in_implicits = add_loc sgn.in_implicits loc info (add_replace replace) } let add_output sgn loc info ~replace = { sgn with outputs = add_loc sgn.outputs loc info (add_replace replace) } let add_in_ctrl sgn info ~replace = let new_info = match sgn.in_ctrl with None -> info | Some old -> add_replace replace old info in { sgn with in_ctrl = Some new_info } let add_out_ret sgn info ~replace = let new_info = match sgn.out_ret with None -> info | Some old -> add_replace replace old info in { sgn with out_ret = Some new_info } let add_info sgn key info ~replace = match key with | In InCtrl -> add_in_ctrl sgn info replace | In (InNum n) -> add_input sgn n info replace | In (InImpl loc) -> add_impl_input sgn loc info replace | Out OutRet -> add_out_ret sgn info replace | Out (OutLoc k) -> add_output sgn k info replace let find_input sgn n = try assert (n <> 0); (* no input 0 : use find_in_ctrl *) List.assoc n sgn.in_params with Not_found -> raise Not_found let find_output sgn out_key = let rec find l = match l with | [] -> raise Not_found | (loc, e)::tl -> if Locations.Zone.equal out_key loc then e else find tl in find sgn.outputs let find_out_ret sgn = match sgn.out_ret with | Some i -> i | None -> raise Not_found let find_in_ctrl sgn = match sgn.in_ctrl with | Some i -> i | None -> raise Not_found (** try to find an exact match with loc. * we shouldn't try to find a zone that we don't have... *) let find_implicit_input sgn loc = let rec find l = match l with | [] -> raise Not_found | (in_loc, e)::tl -> if Locations.Zone.equal in_loc loc then e else find tl in find sgn.in_implicits let find_in_top sgn = find_implicit_input sgn Locations.Zone.top let find_in_info sgn in_key = match in_key with | InCtrl -> find_in_ctrl sgn | (InNum n) -> find_input sgn n | (InImpl loc) -> find_implicit_input sgn loc let find_out_info sgn out_key = match out_key with | OutRet -> find_out_ret sgn | (OutLoc k) -> find_output sgn k let find_info sgn key = match key with | In in_key -> find_in_info sgn in_key | Out out_key -> find_out_info sgn out_key let fold_outputs f acc sgn = List.fold_left f acc sgn.outputs let fold_all_outputs f acc sgn = let acc = match sgn.out_ret with | None -> acc | Some info -> f acc (OutRet, info) in List.fold_left (fun acc (k, i) -> f acc ((OutLoc k), i)) acc sgn.outputs let fold_num_inputs f acc sgn = List.fold_left f acc sgn.in_params let fold_impl_inputs f acc sgn = List.fold_left f acc sgn.in_implicits let fold_matching_impl_inputs loc f acc sgn = let test acc (in_loc, info) = if (Locations.Zone.intersects in_loc loc) then f acc (in_loc, info) else acc in List.fold_left test acc sgn.in_implicits let fold_all_inputs f acc sgn = let acc = match sgn.in_ctrl with | None -> acc | Some info -> f acc (InCtrl, info) in let acc = fold_num_inputs (fun acc (n, info) -> f acc ((InNum n), info)) acc sgn in fold_impl_inputs (fun acc (l, info) -> f acc ((InImpl l), info)) acc sgn let fold f acc sgn = let acc = fold_all_inputs (fun acc (n, info) -> f acc (In n, info)) acc sgn in fold_all_outputs (fun acc (n, info) -> f acc (Out n, info)) acc sgn let iter f sgn = fold (fun () v -> f v) () sgn let merge sgn1 sgn2 merge_info = let merge_elem lst (k, info) = add_in_list lst k info merge_info in let inputs = fold_num_inputs merge_elem sgn1.in_params sgn2 in let outputs = fold_outputs merge_elem sgn1.outputs sgn2 in let in_ctrl = match sgn1.in_ctrl, sgn2.in_ctrl with | None, _ -> sgn2.in_ctrl | _, None -> sgn1.in_ctrl | Some i1, Some i2 -> Some (merge_info i1 i2) in assert (sgn1.in_implicits = [] && sgn2.in_implicits = []); let out_ret = match sgn1.out_ret, sgn2.out_ret with | None, _ -> sgn2.out_ret | _, None -> sgn1.out_ret | Some i1, Some i2 -> Some (merge_info i1 i2) in { in_ctrl = in_ctrl; in_params = inputs ; in_implicits = [] ; out_ret = out_ret ; outputs = outputs } let pretty_in_key fmt key = match key with | (InNum n) -> Format.fprintf fmt "In%d" n | InCtrl -> Format.fprintf fmt "InCtrl" | InImpl loc -> Format.fprintf fmt "@[<hv 1>In(%a)@]" Locations.Zone.pretty loc let pretty_out_key fmt key = match key with | OutRet -> Format.fprintf fmt "OutRet" | OutLoc loc -> Format.fprintf fmt "@[<hv 1>Out(%a)@]" Locations.Zone.pretty loc let pretty_key fmt key = match key with | In in_key -> pretty_in_key fmt in_key | Out key -> pretty_out_key fmt key let pretty pp fmt sgn = Pretty_utils.pp_iter ~pre:"@[<v>" ~suf:"@]" ~sep:"@," iter (fun fmt (k,i) -> Format.fprintf fmt "@[<hv>(%a:@ %a)@]" pretty_key k pp i) fmt sgn end module Key = struct type key = | SigKey of Signature.key (** input/output nodes of the function *) | VarDecl of Cil_types.varinfo (** local, parameter or global variable definition *) | Stmt of Cil_types.stmt (** simple statement (not call) excluding its label (stmt.id) *) | CallStmt of Cil_types.stmt (** call statement *) | Label of stmt * Cil_types.label (** Labels are considered as function elements by themselves. *) | SigCallKey of Cil_types.stmt * Signature.key (** Key for an element of a call (input or output). * The call is identified by the statement. *) let entry_point = SigKey (Signature.in_ctrl_key) let top_input = SigKey (Signature.in_top_key) let param_key num_in = SigKey (Signature.in_key num_in) let implicit_in_key loc = SigKey (Signature.in_impl_key loc) let output_key = SigKey (Signature.out_ret_key) (** this is for the nodes inside undefined functions *) let out_from_key loc = SigKey (Signature.out_key loc) let decl_var_key var = VarDecl var let label_key label_stmt label = Label (label_stmt,label) let call_key call = CallStmt call let stmt_key stmt = if is_call_stmt stmt then call_key stmt else Stmt stmt let call_input_key call n = SigCallKey (call, (Signature.in_key n)) let call_outret_key call = SigCallKey (call, (Signature.out_ret_key)) let call_output_key call loc = SigCallKey (call, (Signature.out_key loc)) let call_ctrl_key call = SigCallKey (call, (Signature.in_ctrl_key)) let call_topin_key call = SigCallKey (call, (Signature.in_top_key)) let call_from_id call_id = call_id let stmt key = match key with | SigCallKey (call, _) -> Some call | CallStmt call -> Some call | Stmt stmt -> Some stmt | Label (stmt, _) -> Some stmt | _ -> None (* see PrintPdg.pretty_key : can't be here because it uses Db... *) let pretty_node fmt k = let print_stmt fmt s = match s.skind with | Switch (exp,_,_,_) | If (exp,_,_,_) -> Printer.pp_exp fmt exp | Loop _ -> Format.pp_print_string fmt "while(1)" | Block _ -> Format.pp_print_string fmt "block" | Goto _ | Break _ | Continue _ | Return _ | Instr _ | Throw _ -> Format.fprintf fmt "@[<h 1>%a@]" (Printer.without_annot Printer.pp_stmt) s | UnspecifiedSequence _ -> Format.pp_print_string fmt "unspecified sequence" | TryExcept _ | TryFinally _ | TryCatch _ -> Format.pp_print_string fmt "ERROR" in match k with | CallStmt call -> let call = call_from_id call in Format.fprintf fmt "Call%d : %a" call.sid print_stmt call | Stmt s -> print_stmt fmt s | Label (_,l) -> Printer.pp_label fmt l | VarDecl v -> Format.fprintf fmt "VarDecl : %a" Printer.pp_varinfo v | SigKey k -> Signature.pretty_key fmt k | SigCallKey (call, sgn) -> let call = call_from_id call in Format.fprintf fmt "Call%d-%a : %a" call.sid Signature.pretty_key sgn print_stmt call include Datatype.Make (struct include Datatype.Serializable_undefined type t = key let name = "PdgIndex.Key" open Cil_datatype let reprs = List.fold_left (fun acc v -> List.fold_left (fun acc s -> Stmt s :: acc) (VarDecl v :: acc) Stmt.reprs) [] Varinfo.reprs open Structural_descr let structural_descr = let p_key = pack Signature.Str_descr.key in t_sum [| [| p_key |]; [| Varinfo.packed_descr |]; [| Stmt.packed_descr |]; [| Cil_datatype.Stmt.packed_descr |]; [| Cil_datatype.Stmt.packed_descr; Label.packed_descr |]; [| Cil_datatype.Stmt.packed_descr; p_key |]; |] let rehash = Datatype.identity let pretty = pretty_node let mem_project = Datatype.never_any_project end) end (* [Key] restricted to [Stmt], [VarDecl] and [Label] constructors. Hash tables are built upon this type, and we currently have no full hash/equality function for [Key.t]. *) module RKey = struct include Key let hash = function | Key.VarDecl v -> 17 * Cil_datatype.Varinfo.hash v | Key.Stmt s -> 29 * Cil_datatype.Stmt.hash s | Key.Label (s, _l) -> (* Intentionally buggy: ignore the label and consider only the statement. There seems to be bug in the pdg, only one 'case :' per statement is present. This avoids removing the other 'case' clauses (see tests/slicing/switch.c *) 53 * Cil_datatype.Stmt.hash s (* 7 * Cil_datatype.Label.hash l *) | _ -> assert false let equal k1 k2 = match k1, k2 with | Key.VarDecl v1, Key.VarDecl v2 -> Cil_datatype.Varinfo.equal v1 v2 | Key.Stmt s1, Key.Stmt s2 -> Cil_datatype.Stmt.equal s1 s2 | Key.Label (s1, _l1), Key.Label (s2, _l2) -> (* See [hash] above *) Cil_datatype.Stmt.equal s1 s2 (* && Cil_datatype.Label.equal l1 l2 *) | _ -> false end module H = struct include Hashtbl.Make(RKey) let structural_descr = Structural_descr.t_hashtbl_unchanged_hashs (Descr.str RKey.descr) end module FctIndex = struct type ('node_info, 'call_info) t = { (** inputs and outputs of the function *) mutable sgn : 'node_info Signature.t ; (** calls signatures *) mutable calls : (Cil_types.stmt * ('call_info option * 'node_info Signature.t)) list ; (** everything else *) other : 'node_info H.t } open Structural_descr let t_descr ~ni:d_ninfo ~ci:d_cinfo = t_record [| pack (Signature.Str_descr.t d_ninfo); pack (t_list (t_tuple [| Cil_datatype.Stmt.packed_descr; pack (t_tuple [| pack (t_option d_cinfo); pack (Signature.Str_descr.t d_ninfo); |]) |])); pack (H.structural_descr d_ninfo); |] let sgn idx = idx.sgn let create nb = { sgn = Signature.empty; calls = []; other = H.create nb } let copy idx = { sgn = Signature.copy idx.sgn; calls = idx.calls; other = H.copy idx.other } let merge_info_calls calls1 calls2 merge_a merge_b = let merge_info (b1, sgn1) (b2, sgn2) = let b = match b1, b2 with None, _ -> b2 | _, None -> b1 | Some b1, Some b2 -> Some (merge_b b1 b2) in let sgn = Signature.merge sgn1 sgn2 merge_a in (b, sgn) in let rec merge l1 l2 = match l1, l2 with | [], _ -> l2 | _, [] -> l1 | ((call1, info1) as c1) :: tl1, ((call2, info2) as c2) :: tl2 -> let id1 = call1.sid in let id2 = call2.sid in if id1 = id2 then let info = merge_info info1 info2 in (call1, info) :: (merge tl1 tl2) else if id1 < id2 then c1 :: (merge tl1 l2) else c2 :: (merge l1 tl2) in merge calls1 calls2 let merge idx1 idx2 merge_a merge_b = let sgn = Signature.merge idx1.sgn idx2.sgn merge_a in let table = H.copy idx1.other in let add k a2 = let a = try let a1 = H.find table k in merge_a a1 a2 with Not_found -> a2 in H.replace table k a in H.iter add idx2.other; let calls = merge_info_calls idx1.calls idx2.calls merge_a merge_b in {sgn = sgn; calls = calls; other = table} let add_info_call idx call e ~replace = let sid = call.sid in let rec add l = match l with | [] -> [(call, (Some e, Signature.empty))] | ((call1, (_e1, sgn1)) as c1) :: tl -> let sid1 = call1.sid in if sid = sid1 then (if replace then (call, (Some e, sgn1)) :: tl else raise AddError) else if sid < sid1 then (call, (Some e, Signature.empty)) :: l else c1 :: (add tl) in idx.calls <- add idx.calls let add_info_call_key idx key = match key with | Key.CallStmt call -> add_info_call idx call | _ -> assert false let add_info_sig_call calls call k e replace = let new_sgn old = Signature.add_info old k e replace in let rec add l = match l with | [] -> [(call, (None, new_sgn Signature.empty))] | ((call1, (e1, sgn1)) as c1) :: tl -> let sid = call.sid in let sid1 = call1.sid in if sid = sid1 then (call, (e1, new_sgn sgn1)) :: tl else if sid < sid1 then (call, (None, new_sgn Signature.empty)) :: l else (c1 :: (add tl)) in add calls let find_call idx call = let rec find l = match l with | [] -> raise Not_found | (call1, e1) :: tl -> let sid = call.sid in let sid1 = call1.sid in if sid = sid1 then e1 else if sid < sid1 then raise Not_found else find tl in find idx.calls let find_call_key idx key = match key with | Key.CallStmt call -> find_call idx call | _ -> assert false let find_info_call idx call = let (e1, _sgn1) = find_call idx call in match e1 with Some e -> e | None -> raise Not_found let find_info_call_key idx key = match key with | Key.CallStmt call -> find_info_call idx call | _ -> assert false let find_info_sig_call idx call k = let (_e1, sgn1) = find_call idx call in Signature.find_info sgn1 k let find_all_info_sig_call idx call = let (_e1, sgn1) = find_call idx call in Signature.fold (fun l (_k,i) -> i::l) [] sgn1 let add_replace idx key e replace = let hfct = if replace then H.replace else H.add in match key with | Key.SigKey k -> idx.sgn <- Signature.add_info idx.sgn k e replace | Key.CallStmt _ -> raise CallStatement (* see add_info_call *) | Key.SigCallKey (call, k) -> idx.calls <- add_info_sig_call idx.calls call k e replace | Key.VarDecl _ | Key.Stmt _ | Key.Label _ -> hfct idx.other key e let add idx key e = add_replace idx key e false let add_or_replace idx key e = add_replace idx key e true let length idx = H.length idx.other let find_info idx key = match key with | Key.SigKey k -> Signature.find_info idx.sgn k | Key.CallStmt _ -> raise CallStatement (* see find_info_call *) | Key.SigCallKey (call, k) -> find_info_sig_call idx call k | Key.VarDecl _ | Key.Stmt _ | Key.Label _ -> (try H.find idx.other key with Not_found -> raise Not_found) let find_all idx key = match key with | Key.CallStmt call -> find_all_info_sig_call idx call | _ -> let info = find_info idx key in [info] let find_label idx lab = let collect k info res = match k with | Key.Label (_,k_lab) -> if Cil_datatype.Label.equal k_lab lab then info :: res else res | _ -> res in let infos = H.fold collect idx.other [] in match infos with info :: [] -> info | [] -> raise Not_found | _ -> assert false let fold_calls f idx acc = let process acc (call, (_i, _sgn as i_sgn)) = f call i_sgn acc in List.fold_left process acc idx.calls let fold f idx acc = let acc = Signature.fold (fun acc (k, info) -> f (Key.SigKey k) info acc) acc idx.sgn in let acc = H.fold (fun k info acc -> f k info acc) idx.other acc in List.fold_left (fun acc (call, (_, sgn)) -> Signature.fold (fun acc (k, info) -> f (Key.SigCallKey (call, k)) info acc) acc sgn) acc idx.calls end (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg_types/pdgIndex.mli���������������������������������������������0000666�0000000�0000000�00000021752�13571573400�017735� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module can be useful to store some information about different * elements of a function. * * {!module:PdgIndex.Signature} is used to store information * about function inputs/outputs either for the function itself or for its * calls. {!module:PdgIndex.Key} provides keys to identify the different * elements we want to speak about. {!module:PdgIndex.FctIndex} is the main * object that manages the stored information. * * This module is used for instance to store the relation between a function * elements and the nodes of its PDG, but it can also be used to store many * other things.*) (** try to add in information while there is already something stored. * Should have used replace function *) exception AddError (** Some functions do not apply to call statements because the stored * information has a different type. *) exception CallStatement (** When we compare two things with different locations (no order) *) exception Not_equal (** What we call a [Signature] a mapping between keys that represent either a * function input or output, and some information. *) module Signature : sig (** type of a signature where ['a] is the type of the information that we * want to store for each input/output. *) type 'a t (** key for input elements *) type in_key = private | InCtrl (** input control point *) | InNum of int (** parameters numbered from 1 *) | InImpl of Locations.Zone.t (** key for implicit inputs. Used in function signatures only *) type out_key = private | OutRet (** key for the output corresponding to the [return] *) | OutLoc of Locations.Zone.t (** key for output locations. used in call signatures only *) (** a key represents either an input or an output of a function. *) type key = private In of in_key | Out of out_key val empty : 'a t (** build a new, empty signature *) val mk_undef_in_key : Locations.Zone.t -> in_key val cmp_in_key : in_key -> in_key -> int val cmp_out_key : out_key -> out_key -> int val equal_out_key : out_key -> out_key -> bool val find_info : 'a t -> key -> 'a val find_input : 'a t -> int -> 'a val find_in_ctrl : 'info t -> 'info val find_in_top : 'info t -> 'info val find_in_info : 'info t -> in_key -> 'info val find_out_ret : 'a t -> 'a val find_out_info : 'info t -> out_key -> 'info val fold : ('a -> key * 'b -> 'a) -> 'a -> 'b t -> 'a val fold_num_inputs : ('a -> int * 'b -> 'a) -> 'a -> 'b t -> 'a val fold_impl_inputs : ('a -> Locations.Zone.t * 'b -> 'a) -> 'a -> 'b t -> 'a val fold_matching_impl_inputs : Locations.Zone.t -> ('a -> Locations.Zone.t * 'b -> 'a) -> 'a -> 'b t -> 'a val fold_all_inputs : ('a -> in_key * 'b -> 'a) -> 'a -> 'b t -> 'a val fold_all_outputs : ('a -> out_key * 'b -> 'a) -> 'a -> 'b t -> 'a val pretty : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit val pretty_key : Format.formatter -> key -> unit val pretty_in_key : Format.formatter -> in_key -> unit val pretty_out_key : Format.formatter -> out_key -> unit end (** The keys can be used to identify an element of a function. Have a look at the type [t] to know which kind of elements can be identified.*) module Key : sig type key = private | SigKey of Signature.key (** key for an element of the function signature *) | VarDecl of Cil_types.varinfo (** variable declaration *) | Stmt of Cil_types.stmt (** any statement, except a call *) | CallStmt of Cil_types.stmt (** call statement *) | Label of Cil_types.stmt * Cil_types.label (** program label *) | SigCallKey of Cil_types.stmt * Signature.key (** key for an element of a call signature *) include Datatype.S with type t = key val param_key : int -> t val implicit_in_key : Locations.Zone.t -> t val entry_point : t val top_input : t val output_key : t val out_from_key : Locations.Zone.t -> t val decl_var_key : Cil_types.varinfo -> t val label_key : Cil_types.stmt -> Cil_types.label -> t val stmt_key : Cil_types.stmt -> t val call_key : Cil_types.stmt -> t val call_input_key : Cil_types.stmt -> int -> t val call_output_key : Cil_types.stmt -> Locations.Zone.t -> t val call_outret_key : Cil_types.stmt -> t val call_ctrl_key : Cil_types.stmt -> t val call_topin_key : Cil_types.stmt -> t val stmt : t -> Cil_types.stmt option val call_from_id : Cil_types.stmt -> Cil_types.stmt end (** Mapping between the function elements we are interested in and some * information. Used for instance to associate the nodes with the statements, * or the marks in a slice. *) module FctIndex : sig (** this type is used to build indexes between program objects and some information such as the PDG nodes or the slicing marks. - ['ni] if the type of the information to store for each element, - ['ci] if the type of the information that can be attached to call statements (calls are themselves composed of several elements, so ['ni] information stored for each of them (['ni Signature.t])) *) type ('ni, 'ci) t val create : int -> ('ni, 'ci) t val length : ('ni, 'ci) t -> int (** just copy the mapping *) val copy : ('ni, 'ci) t -> ('ni, 'ci) t (** merge the two indexes using given functions [merge_a] and [merge_b]. These function are _not_ called when an element is in one index, but not the other. It is assumed that [merge_x x bot = x]. *) val merge : ('ni, 'ci) t -> ('ni, 'ci) t -> ('ni -> 'ni -> 'ni) -> ('ci -> 'ci -> 'ci) -> ('ni, 'ci) t (** get the information stored for the function signature *) val sgn : ('ni, 'ci) t -> 'ni Signature.t (** find the information stored for the key. Cannot be used for [Key.CallStmt] keys because the type of the stored information is not the same. See [find_call] instead. *) val find_info : ('ni, 'ci) t -> Key.t-> 'ni (** same than [find_info] except for call statements for which it gives the list of all the information in the signature of the call. *) val find_all : ('ni, 'ci) t -> Key.t-> 'ni list (** Similar to [find_info] for a label *) val find_label: ('ni, 'ci) t -> Cil_types.label -> 'ni (** find the information stored for the call and its signature *) val find_call : ('ni, 'ci) t -> Cil_types.stmt -> 'ci option * 'ni Signature.t val find_call_key : ('ni, 'ci) t -> Key.t -> 'ci option * 'ni Signature.t (** find the information stored for the call *) val find_info_call : ('ni, 'ci) t -> Cil_types.stmt -> 'ci val find_info_call_key : ('ni, 'ci) t -> Key.t -> 'ci val fold_calls : (Cil_types.stmt -> 'ci option * 'ni Signature.t -> 'c -> 'c) -> ('ni, 'ci) t -> 'c -> 'c val fold : (Key.key -> 'ni -> 'a -> 'a) -> ('ni, 'ci) t -> 'a -> 'a (** store the information for the key. @raise AddError if there is already something stored. *) val add : ('ni, 'ci) t -> Key.t-> 'ni -> unit (** store the information for the key. Replace the previously stored information if any. *) val add_or_replace : ('ni, 'ci) t -> Key.t-> 'ni -> unit val add_info_call : ('ni, 'ci) t -> Cil_types.stmt -> 'ci -> replace:bool -> unit val add_info_call_key : ('ni, 'ci) t -> Key.t -> 'ci -> replace:bool -> unit (** Structural destructor for unmarshaling *) val t_descr: ni:Structural_descr.t -> ci:Structural_descr.t -> Structural_descr.t end ����������������������frama-c-20.0-Calcium/src/plugins/pdg_types/pdgMarks.ml����������������������������������������������0000666�0000000�0000000�00000025140�13571573400�017565� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This file provides useful things to help to associate an information * (called mark) to PDG elements and to propagate it across the * dependencies. *) open PdgIndex type select_elem = | SelNode of PdgTypes.Node.t * Locations.Zone.t option (** zone is [Some z] only for nodes that * represent call output in case we want to * select less than the whole OutCall *) | SelIn of Locations.Zone.t type 'tm select = (select_elem * 'tm) list type 'tm pdg_select_info = SelList of 'tm select | SelTopMarks of 'tm list type 'tm pdg_select = (PdgTypes.Pdg.t * 'tm pdg_select_info) list type 'tm info_caller_inputs = (Signature.in_key * 'tm) list type 'tm info_called_outputs = (Cil_types.stmt * (Signature.out_key * 'tm) list) list type 'tm info_inter = 'tm info_caller_inputs * 'tm info_called_outputs let mk_select_node ?(z_opt=None) node = SelNode (node, z_opt) let mk_select_undef_zone zone = SelIn zone let add_to_select select sel m = (sel, m)::select let add_node_to_select select (node,z_opt) m = add_to_select select (mk_select_node ~z_opt node) m let add_undef_in_to_select select undef m = match undef with | None -> select | Some loc -> if (Locations.Zone.equal Locations.Zone.bottom loc) then select else add_to_select select (mk_select_undef_zone loc) m (** Type of the module that the user has to provide to describe the marks. *) module type Mark = sig type t type call_info val is_bottom : t -> bool val merge : t -> t -> t val combine : t -> t -> (t * t) val pretty : Format.formatter -> t -> unit end module type Fct = sig type mark type call_info type fi = (mark, call_info) PdgIndex.FctIndex.t type t = PdgTypes.Pdg.t * fi val create : PdgTypes.Pdg.t -> t val get_idx : t -> fi type mark_info_inter = mark info_inter val empty_to_prop : mark_info_inter val mark_and_propagate : t -> ?to_prop:mark_info_inter -> mark select -> mark_info_inter end (** If the marks provided by the user respect some constraints (see [Mark]), * we have that, after the marks propagation, * the mark of a node are always smaller than the sum of the marks of its * dependencies. It means that the mark of the statement [x = a + b;] * have to be smaller that the mark of [a] plus the mark of [b] at this point. * * If the marks are used for visibility for instance, * it means that if this statement is visible, * so must be the computation of [a] and [b], but [a] and/or [b] can be * visible while [x] is not. *) module F_Fct (M : Mark) : Fct with type mark = M.t and type call_info = M.call_info = struct type mark = M.t type call_info = M.call_info type fi = (mark, call_info) PdgIndex.FctIndex.t type t = PdgTypes.Pdg.t * fi type mark_info_inter = mark info_inter let empty_to_prop = ([], []) let create pdg = let idx = (PdgIndex.FctIndex.create 17) (* TODO Pdg.get_index_size pdg *) in (pdg, idx) let get_idx (_pdg, idx) = idx (** add the given mark to the node. @return [Some m] if [m] has to be propagated in the node dependencies, [None] otherwise. *) let add_mark _pdg fm node_key mark = Kernel.debug ~level:2 "[pdgMark] add_mark %a -> %a @\n" PdgIndex.Key.pretty node_key M.pretty mark ; let mark_to_prop = try begin (* simple node *) let new_mark, mark_to_prop = try let old_mark = PdgIndex.FctIndex.find_info fm node_key in let new_m, m_prop = M.combine old_mark mark in (new_m, m_prop) with Not_found -> (mark, mark) in PdgIndex.FctIndex.add_or_replace fm node_key new_mark; mark_to_prop end with PdgIndex.CallStatement -> (* call statement *) assert false in mark_to_prop let add_in_to_to_prop to_prop in_key mark = let rec add marks = match marks with | [] -> [(in_key, mark)] | (k, m)::tl -> let cmp = try Signature.cmp_in_key in_key k with PdgIndex.Not_equal -> (* k and in_key are 2 different InImpl : look for in_key in tl *) (* TODO : we could try to group several InImpl... *) 1 in if cmp = 0 then (in_key, M.merge m mark)::tl else if cmp < 0 then (in_key, mark) :: marks else (k, m)::(add tl) in let in_marks, out_marks = to_prop in let new_in_marks = add in_marks in new_in_marks, out_marks (** the new marks [to_prop] are composed of two lists : * - one [(in_key, mark) list] means that the mark has been added in the input, * - one [call, (out_key, m) list] that means that [m] has been added * to the [out_key] output of the call. * * This function [add_to_to_prop] groups similar information, * and keep the list sorted. *) let add_to_to_prop to_prop key mark = let rec add_out_key l key = match l with | [] -> [(key, mark)] | (k, m) :: tl -> let cmp = match key, k with | Signature.OutLoc z, Signature.OutLoc zone -> if Locations.Zone.equal z zone then 0 else 1 | _ -> Signature.cmp_out_key key k in if cmp = 0 then (key, M.merge m mark)::tl else if cmp < 0 then (key, mark) :: l else (k, m)::(add_out_key tl key) in let rec add_out out_marks call out_key = match out_marks with | [] -> [ (call, [(out_key, mark)]) ] | (c, l)::tl -> if call.Cil_types.sid = c.Cil_types.sid then (c, add_out_key l out_key)::tl else (c, l)::(add_out tl call out_key) in match key with | Key.SigCallKey (call, Signature.Out out_key) -> let in_marks, out_marks = to_prop in let call = Key.call_from_id call in let new_out_marks = add_out out_marks call out_key in (in_marks, new_out_marks) | Key.SigKey (Signature.In in_key) -> let to_prop = add_in_to_to_prop to_prop in_key mark in to_prop | _ -> (* nothing to do *) to_prop (** mark the nodes and their dependencies with the given mark. * Stop when reach a node which is already marked with this mark. * @return the modified marks of the function inputs, * and of the call outputs for interprocedural propagation. * *) let rec add_node_mark_rec pdg fm node_marks to_prop = let mark_node_and_dpds to_prop (node, z_opt, mark) = Kernel.debug ~level:2 "[pdgMark] add mark to node %a" PdgTypes.Node.pretty node; let node_key = PdgTypes.Node.elem_key node in let node_key = match z_opt with | None -> node_key | Some z -> match node_key with | Key.SigCallKey (call, Signature.Out (Signature.OutLoc out_z)) -> let z = Locations.Zone.narrow z out_z in Key.call_output_key (Key.call_from_id call) z | _ -> node_key in let mark_to_prop = add_mark pdg fm node_key mark in if (M.is_bottom mark_to_prop) then begin Kernel.debug ~level:2 "[pdgMark] mark_and_propagate = stop propagation !@\n"; to_prop end else begin Kernel.debug ~level:2 "[pdgMark] mark_and_propagate = to propagate %a@\n" M.pretty mark_to_prop; let to_prop = add_to_to_prop to_prop node_key mark_to_prop in let dpds_info = PdgTypes.Pdg.get_all_direct_dpds pdg node in let node_marks = List.map (fun (n, z) -> (n, z, mark_to_prop)) dpds_info in add_node_mark_rec pdg fm node_marks to_prop end in List.fold_left mark_node_and_dpds to_prop node_marks let mark_and_propagate fm ?(to_prop=empty_to_prop) select = let pdg, idx = fm in let process to_prop (sel, mark) = match sel with | SelNode (n, z_opt) -> Kernel.debug ~level:2 "[pdgMark] mark_and_propagate start with %a@\n" PdgTypes.Node.pretty_with_part (n, z_opt); add_node_mark_rec pdg idx [(n, z_opt, mark)] to_prop | SelIn loc -> let in_key = Key.implicit_in_key loc in Kernel.debug ~level:2 "[pdgMark] mark_and_propagate start with %a@\n" Key.pretty in_key; let mark_to_prop = add_mark pdg idx in_key mark in if M.is_bottom mark_to_prop then to_prop else add_to_to_prop to_prop in_key mark_to_prop in List.fold_left process to_prop select end module type Proj = sig type t type mark type call_info type fct = (mark, call_info) PdgIndex.FctIndex.t val empty : unit -> t val find_marks : t -> Cil_types.varinfo -> fct option val mark_and_propagate : t -> PdgTypes.Pdg.t -> mark select -> unit end type 'mark m2m = select_elem -> 'mark -> 'mark option type 'mark call_m2m = Cil_types.stmt option -> PdgTypes.Pdg.t -> 'mark m2m module type Config = sig module M : Mark val mark_to_prop_to_caller_input : M.t call_m2m val mark_to_prop_to_called_output : M.t call_m2m end (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg_types/pdgMarks.mli���������������������������������������������0000666�0000000�0000000�00000014666�13571573400�017751� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module provides elements to mapped information (here called 'marks') * to PDG elements and propagate it along the dependencies. * * Some more functions are defined in the PDG plugin itself * (in [pdg/marks]): * the signatures of these public functions can be found in file [Pdg.mli] *) (** Signature of the module to use in order to instantiate the computation *) module type Mark = sig (** type of the information mapped to the nodes *) type t (** type of the information mapped to the function calls. * This can be [unit] if there is nothing to store for the calls. * (see {!PdgIndex.FctIndex} for more information) * *) type call_info (** used to test [combine] result (see below) *) val is_bottom : t -> bool (** merge two pieces of information *) val merge : t -> t -> t (** [combine] is used during propagation. It should return * [(new_mark, mark_to_prop) = combine old_mak new_mark] * where [new_mark] is the mark to associate with the node, * and [mark_to_prop] the mark to propagate to its dependencies. * If [is_bottom mark_to_prop], the propagation is stopped. * *) val combine : t -> t -> t * t val pretty : Format.formatter -> t -> unit end (** When selecting or propagating marks in a function, * the marks are most of the time associated to pdg nodes, * but we also need to associate marks to input locations * in order to propage information to the callers about undefined data. * *) type select_elem = private | SelNode of PdgTypes.Node.t * Locations.Zone.t option | SelIn of Locations.Zone.t val mk_select_node : ?z_opt:Locations.Zone.t option -> PdgTypes.Node.t -> select_elem val mk_select_undef_zone : Locations.Zone.t -> select_elem type 'tm select = (select_elem * 'tm) list val add_to_select : 'tm select -> select_elem -> 'tm -> 'tm select val add_node_to_select : 'tm select -> (PdgTypes.Node.t * Locations.Zone.t option) -> 'tm -> 'tm select val add_undef_in_to_select : 'tm select -> Locations.Zone.t option -> 'tm -> 'tm select (** we sometime need a list of [t_select] associated with its pdg when dealing with several functions at one time. *) type 'tm pdg_select_info = SelList of 'tm select | SelTopMarks of 'tm list type 'tm pdg_select = (PdgTypes.Pdg.t * 'tm pdg_select_info) list (** Represent the information to propagate from a function inputs to its calls. Notice that the input keys don't necessarily correspond to nodes especially when one want to select a data that is not defined in the function. **) type 'tm info_caller_inputs = (PdgIndex.Signature.in_key * 'tm) list (** Represent the information to propagate from a call outputs to the called function. The [stmt] are the calls to consider. *) type 'tm info_called_outputs = (Cil_types.stmt * (PdgIndex.Signature.out_key * 'tm) list) list (** when some marks have been propagated in a function, there is some information to propagate in the callers and called functions to have an interprocedural processing. *) type 'tm info_inter = 'tm info_caller_inputs * 'tm info_called_outputs module type Fct = sig type mark type call_info type fi = (mark, call_info) PdgIndex.FctIndex.t type t = PdgTypes.Pdg.t * fi val create : PdgTypes.Pdg.t -> t val get_idx : t -> fi type mark_info_inter = mark info_inter val empty_to_prop : mark_info_inter val mark_and_propagate : t -> ?to_prop:mark_info_inter -> mark select -> mark_info_inter end module F_Fct(M : Mark) : Fct with type mark = M.t and type call_info = M.call_info type 't_mark m2m = select_elem -> 't_mark -> 't_mark option type 't_mark call_m2m = Cil_types.stmt option -> PdgTypes.Pdg.t -> 't_mark m2m (** this is the type of the functor dedicated to interprocedural propagation. It is defined in PDG plugin *) module type Proj = sig type t type mark type call_info type fct = (mark, call_info) PdgIndex.FctIndex.t val empty: unit -> t val find_marks: t -> Cil_types.varinfo -> fct option val mark_and_propagate: t -> PdgTypes.Pdg.t -> mark select -> unit end module type Config = sig module M : Mark (** define how to translate an input mark of a function into a mark * to propagate in the callers. * The statement specify to which call we are about to propagate, * and the pdg is the one of the caller in which the call is. * If it returns [None], the propagation is stopped. * A simple propagation can be done by returning [Some m]. * The [call] parameter can be [None] when the caller has a Top PDG. * *) val mark_to_prop_to_caller_input : M.t call_m2m (** define how to translate a mark of a call output into a mark * to propagate in the called function. * The statement specify from which call we are about to propagate, * and the pdg is the one of the called function. * *) val mark_to_prop_to_called_output : M.t call_m2m end (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg_types/pdgTypes.ml����������������������������������������������0000666�0000000�0000000�00000060241�13571573400�017615� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** *) open Cil_types (** Node.t is the type of the PDG vertex. *) module Node : sig include Datatype.S_with_collections val id : t -> int val elem_key : t -> PdgIndex.Key.t val stmt : t -> Cil_types.stmt option (*val equivalent : t -> PdgIndex.Key.t -> bool*) val pretty_list : Format.formatter -> t list -> unit val pretty_with_part : Format.formatter -> (t * Locations.Zone.t option) -> unit val pretty_node: Format.formatter -> t -> unit val make: PdgIndex.Key.t -> t end = struct type t = { id : int; key : PdgIndex.Key.t } module Counter = State_builder.Counter(struct let name = "PdgTypes.Node.Counter" end) let make key = {id = Counter.next (); key = key} let print_id fmt e = Format.fprintf fmt "%d" e.id let id n = n.id let elem_key n = n.key let stmt n = PdgIndex.Key.stmt n.key (* BY: not sure it is a good idea to use (=) on keys, which contain Cil structures. Disabled for now (** tells if the node represent the same thing that the given key. *) let equivalent n key = (elem_key n) = key *) let print_id fmt n = Format.fprintf fmt "n:%a" print_id n include (Datatype.Make_with_collections (struct type node = t type t = node let name = "PdgTypes.Elem" let reprs = [ { id = -1; key = PdgIndex.Key.top_input } ] let structural_descr = Structural_descr.t_record [| Structural_descr.p_int; PdgIndex.Key.packed_descr |] let compare e1 e2 = Datatype.Int.compare e1.id e2.id let hash e = e.id let equal e1 e2 = e1.id = e2.id let pretty = print_id let rehash = Datatype.identity let copy = Datatype.undefined let internal_pretty_code = Datatype.undefined let varname = Datatype.undefined let mem_project = Datatype.never_any_project end) : Datatype.S_with_collections with type t := t) let pretty_list fmt l = List.iter (fun n -> Format.fprintf fmt " %a" pretty n) l let pretty_with_part fmt (n, z_part) = Format.fprintf fmt "%a" pretty n; match z_part with None -> () | Some z -> Format.fprintf fmt "(restrict to @[<h 1>%a@])" Locations.Zone.pretty z let pretty_node fmt n = Format.fprintf fmt "@[<hov 2>{n%d}:@ %a@]" (id n) PdgIndex.Key.pretty (elem_key n) end module NodeSet = Hptset.Make(Node) (struct let v = [ [ ] ] end) (struct let l = [ Ast.self ] end) (* Clear the (non-project compliant) internal caches each time the ast is updated, which includes every time we switch project. *) let () = Ast.add_hook_on_update NodeSet.clear_caches let () = Ast.add_monotonic_state NodeSet.self (** set of nodes of the graph *) module NodeSetLattice = struct include Abstract_interp.Make_Lattice_Set (Node) (Node.Set) let default : t = empty end module LocInfo = Lmap_bitwise.Make_bitwise (NodeSetLattice) let () = Ast.add_hook_on_update LocInfo.clear_caches (* See comment on previous call to Ast.add_hook_on_update *) (** Edges label for the Program Dependence Graph. *) module Dpd : sig include Datatype.S (** used to speak about the different kinds of dependencies *) type td = Ctrl | Addr | Data val make : ?a:bool -> ?d:bool -> ?c:bool -> unit -> t val make_simple : td -> t val bottom : t val top : t val adc_value : t -> bool * bool * bool val is_addr : t -> bool val is_ctrl : t -> bool val is_data : t -> bool val is_dpd : td -> t -> bool val is_bottom : t -> bool val is_included : t -> t -> bool val combine : t -> t -> t val add : t -> td -> t val inter : t -> t -> t val intersect : t -> t -> bool (** remove the flags that are in m2 for m1 *) val minus : t -> t -> t val pretty_td : Format.formatter -> td -> unit val pretty : Format.formatter -> t -> unit end = struct type td = Ctrl | Addr | Data let pretty_td fmt td = Format.fprintf fmt "%s" (match td with Ctrl -> "c" | Addr -> "a" | Data -> "d") include Datatype.Int (* Encoding: %b addr; %b data; %b control *) let maddr = 0x100 let mdata = 0x010 let mctrl = 0x001 let make ?(a=false) ?(d=false) ?(c=false) _ = match a,d,c with | false, false, false -> 0x000 | true, false, false -> 0x100 | false, true, false -> 0x010 | false, false, true -> 0x001 | true, true, false -> 0x110 | true, false, true -> 0x101 | false, true, true -> 0x011 | true, true, true -> 0x111 let bottom = 0x000 let top = 0x111 let is_addr d = (d land maddr) != 0 let is_ctrl d = (d land mctrl) != 0 let is_data d = (d land mdata) != 0 let is_dpd tdpd d = match tdpd with | Addr -> is_addr d | Ctrl -> is_ctrl d | Data -> is_data d let is_bottom = (=) bottom let adc_value d = (is_addr d, is_data d, is_ctrl d) let combine d1 d2 = d1 lor d2 let inter d1 d2 = d1 land d2 let intersect d1 d2 = inter d1 d2 != 0 let is_included d1 d2 = combine d1 d2 = d2 let make_simple kind = match kind with | Ctrl -> mctrl | Addr -> maddr | Data -> mdata let add d kind = combine d (make_simple kind) let minus adc1 adc2 = adc1 land (lnot adc2) let pretty fmt d = Format.fprintf fmt "[%c%c%c]" (if is_addr d then 'a' else '-') (if is_ctrl d then 'c' else '-') (if is_data d then 'd' else '-') end module DpdZone : sig include Datatype.S val is_dpd : Dpd.td -> t -> bool val make : Dpd.td -> Locations.Zone.t option -> t val add : t -> Dpd.td -> Locations.Zone.t option -> t val kind_and_zone : t -> Dpd.t * Locations.Zone.t option val dpd_zone : t -> Locations.Zone.t option val pretty : Format.formatter -> t -> unit val pretty_debug: Format.formatter -> t -> unit end = struct include Datatype.Pair(Dpd)(Datatype.Option(Locations.Zone)) (* None == Locations.Zone.Top *) let pretty_debug = pretty let dpd_kind dpd = fst dpd let dpd_zone dpd = snd dpd let kind_and_zone dpd = dpd let make k z = (Dpd.make_simple k), z let is_dpd k dpd = Dpd.is_dpd k (dpd_kind dpd) let add ((d1,z1) as dpd) k z = let d = Dpd.add d1 k in let z = match z1, z with | None, _ -> z1 | _, None -> z | Some zz1, Some zz2 -> (* we are losing some precision here because for instance : * (zz1, addr) + (zz2, data) = (zz1 U zz2, data+addr) *) let zz = Locations.Zone.join zz1 zz2 in match zz with | Locations.Zone.Top(_p, _o) -> None | _ -> (* To share values as much as possible *) if (zz == zz1) then z1 else if (zz == zz2) then z else Some zz in if (d == d1) && (z == z1) then dpd else d, z let pretty fmt dpd = Dpd.pretty fmt (dpd_kind dpd); match (dpd_zone dpd) with None -> () | Some z -> Format.fprintf fmt "@[<h 1>(%a)@]" Locations.Zone.pretty z end (** The graph itself. *) module G = struct (* Hashtbl to maps of nodes to dpdzone. Used to encode one-directional graphs whose nodes are Node.t, and labels on edges are DpdZone. *) module E = struct type t = Node.t * DpdZone.t * Node.t type label = DpdZone.t let src (n, _, _) = n let dst (_, _, n) = n let label (_, l, _) = l end module To = Hptmap.Make(Node)(DpdZone)(Hptmap.Comp_unused) (struct let v = [[]] end)(struct let l = [Ast.self] end) let () = Ast.add_hook_on_update (fun _ -> To.clear_caches ()) (* See comment on previous call to Ast.add_hook_on_update *) let () = Ast.add_monotonic_state To.self module OneDir = Node.Hashtbl.Make(To) let add_node_one_dir g v = if not (Node.Hashtbl.mem g v) then Node.Hashtbl.add g v To.empty let add_edge_one_dir g vsrc vdst lbl = let cur = try Node.Hashtbl.find g vsrc with Not_found -> To.empty in let cur = To.add vdst lbl cur in Node.Hashtbl.replace g vsrc cur let remove_edge_one_dir g vsrc vdst = try let cur = Node.Hashtbl.find g vsrc in let cur = To.remove vdst cur in Node.Hashtbl.replace g vsrc cur with Not_found -> () let aux_iter_one_dir ?(rev=false) f v = To.iter (fun v' lbl -> if rev then f v' lbl v else f v lbl v') let iter_e_one_dir ?(rev=false) f g v = let to_ = Node.Hashtbl.find g v in aux_iter_one_dir ~rev f v to_ let fold_e_one_dir ?(rev=false) f g v = let to_ = Node.Hashtbl.find g v in To.fold (fun v' lbl acc -> if rev then f v' lbl v acc else f v lbl v' acc) to_ let fold_one_dir f g v = let to_ = Node.Hashtbl.find g v in To.fold (fun v' _ acc -> f v' acc) to_ (* Bi-directional graphs *) type g = { d_graph: OneDir.t; co_graph: OneDir.t; } include Datatype.Make (struct include Datatype.Undefined type t = g let name = "PdgTypes.G" let reprs = [ let h = Node.Hashtbl.create 0 in { d_graph = h; co_graph = h} ] let mem_project = Datatype.never_any_project let rehash = Datatype.identity open Structural_descr let structural_descr = t_record [| OneDir.packed_descr; OneDir.packed_descr |] end) let add_node g v = add_node_one_dir g.d_graph v; add_node_one_dir g.co_graph v; ;; let add_vertex = add_node let add_edge g vsrc lbl vdst = add_edge_one_dir g.d_graph vsrc vdst lbl; add_edge_one_dir g.co_graph vdst vsrc lbl; ;; let remove_edge g vsrc vdst = remove_edge_one_dir g.d_graph vsrc vdst; remove_edge_one_dir g.co_graph vdst vsrc; ;; let find_edge g v1 v2 = let dsts = Node.Hashtbl.find g.d_graph v1 in To.find v2 dsts ;; let iter_vertex f g = Node.Hashtbl.iter (fun v _ -> f v) g.d_graph let iter_edges_e f g = Node.Hashtbl.iter (fun v _to -> aux_iter_one_dir f v _to) g.d_graph let iter_succ_e f g = iter_e_one_dir f g.d_graph let fold_succ_e f g = fold_e_one_dir f g.d_graph let fold_pred_e f g = fold_e_one_dir ~rev:true f g.co_graph let iter_pred_e f g = iter_e_one_dir ~rev:true f g.co_graph let create () = { d_graph = Node.Hashtbl.create 17; co_graph = Node.Hashtbl.create 17; } let find_dpd g v1 v2 = let lbl = find_edge g v1 v2 in ((v1, lbl, v2), lbl) let add_elem g key = let elem = Node.make key in add_vertex g elem; elem let simple_add_dpd g v1 dpd v2 = add_edge g v1 dpd v2 let replace_dpd g (v1, _, v2) new_dpd = remove_edge g v1 v2; simple_add_dpd g v1 new_dpd v2 let add_dpd graph v1 dpd_kind opt_zone v2 = try let edge, old_dpd = find_dpd graph v1 v2 in let new_dpd = DpdZone.add old_dpd dpd_kind opt_zone in if not (DpdZone.equal old_dpd new_dpd) then replace_dpd graph edge new_dpd with Not_found -> let new_dpd = DpdZone.make dpd_kind opt_zone in simple_add_dpd graph v1 new_dpd v2 let edge_dpd (_, lbl, _) = DpdZone.kind_and_zone lbl let pretty_edge_label = DpdZone.pretty end (** DataState is associated with a program point and provide the dependencies for the data, ie. it stores for each location the nodes of the pdg where its value was last defined. Managed in src/pdg/state.ml *) type data_state = { loc_info : LocInfo.t ; under_outputs : Locations.Zone.t } module Data_state = Datatype.Make (struct include Datatype.Serializable_undefined type t = data_state let name = "PdgTypes.Data_state" let reprs = List.fold_left (fun acc l -> List.fold_left (fun acc z -> { loc_info = l; under_outputs = z } :: acc) acc Locations.Zone.reprs) [] LocInfo.reprs let rehash = Datatype.identity let structural_descr = Structural_descr.t_record [| LocInfo.packed_descr; Locations.Zone.packed_descr |] let mem_project = Datatype.never_any_project end) (** PDG for a function *) module Pdg = struct exception Top exception Bottom type fi = (Node.t, unit) PdgIndex.FctIndex.t (** The nodes associated to each element. There is only one node for simple statements, but there are several for a call for instance. *) let fi_descr = PdgIndex.FctIndex.t_descr ~ni:(Descr.str Node.descr) ~ci:Structural_descr.t_unit type def = { graph : G.t ; states : data_state Cil_datatype.Stmt.Hashtbl.t ; index : fi ; } type body = PdgDef of def | PdgTop | PdgBottom module Body_datatype = Datatype.Make (struct include Datatype.Undefined(*Serializable_undefined*) type t = body let reprs = [ PdgTop; PdgBottom ] let rehash = Datatype.identity open Structural_descr let structural_descr = t_sum [| [| pack (t_record [| G.packed_descr; (let module H = Cil_datatype.Stmt.Hashtbl.Make(Data_state) in H.packed_descr); pack fi_descr; |]) |] |] let name = "body" let mem_project = Datatype.never_any_project end) let () = Type.set_ml_name Body_datatype.ty None include Datatype.Pair(Kernel_function)(Body_datatype) let make kf graph states index = let body = { graph = graph; states = states; index = index ; } in (kf, PdgDef body) let top kf = (kf, PdgTop) let bottom kf = (kf, PdgBottom) let is_top pdg = match snd pdg with PdgTop -> true | _ -> false let is_bottom pdg = match snd pdg with PdgBottom -> true | _ -> false let get_pdg_body pdg = match snd pdg with | PdgDef pdg -> pdg | PdgTop -> raise Top | PdgBottom -> raise Bottom let get_kf pdg = fst pdg let get_graph pdg = let pdg = get_pdg_body pdg in pdg.graph let get_states pdg = let pdg = get_pdg_body pdg in pdg.states let get_index pdg = let pdg = get_pdg_body pdg in pdg.index let iter_nodes f pdg = G.iter_vertex f (get_graph pdg) let iter_direct_dpds pdg f node = let pdg = get_pdg_body pdg in G.fold_one_dir (fun n () -> f n) pdg.graph.G.d_graph node () let iter_direct_codpds pdg f node = let pdg = get_pdg_body pdg in G.fold_one_dir (fun n () -> f n) pdg.graph.G.co_graph node () let fold_call_nodes f acc pdg call = let _, call_pdg = PdgIndex.FctIndex.find_call (get_index pdg) call in let do_it acc (_k, n) = f acc n in PdgIndex.Signature.fold do_it acc call_pdg type dpd_info = (Node.t * Locations.Zone.t option) (** gives the list of nodes that depend to the given node, with a given kind of dependency if [dpd_type] is not [None]. The dependency kind is dropped *) let get_x_direct_edges ~co ?dpd_type pdg node : dpd_info list = let pdg = get_pdg_body pdg in let is_dpd_ok dpd = match dpd_type with None -> true | Some k -> DpdZone.is_dpd k dpd in let filter n dpd n' nodes = if is_dpd_ok dpd then let n = if co then n else n' in let z = DpdZone.dpd_zone dpd in (n, z) :: nodes else nodes in let fold = if co then G.fold_pred_e else G.fold_succ_e in fold filter pdg.graph node [] let get_x_direct ~co dpd_type pdg node = get_x_direct_edges ~co ~dpd_type pdg node let get_x_direct_dpds k = get_x_direct ~co:false k let get_x_direct_codpds k = get_x_direct ~co:true k let get_all_direct ~co pdg node = get_x_direct_edges ~co pdg node let get_all_direct_dpds pdg node = get_all_direct ~co:false pdg node let get_all_direct_codpds pdg node = get_all_direct ~co:true pdg node let fold_direct ~co (pdg:t) f acc node = let do_e n1 dpd n2 acc = let n = if co then n1 else n2 in f acc (DpdZone.kind_and_zone dpd) n in let fold = if co then G.fold_pred_e else G.fold_succ_e in fold do_e (get_graph pdg) node acc let fold_direct_dpds pdg f acc node = fold_direct ~co:false pdg f acc node let fold_direct_codpds pdg f acc node = fold_direct ~co:true pdg f acc node let pretty_graph ?(bw=false) fmt graph = let all = (* Sorted print is nicer for the user *) let r = ref [] in G.iter_vertex (fun n -> r := n :: !r) graph; List.sort Node.compare !r in let print_dpd src d_kind dst = Format.fprintf fmt "@ "; if bw then Format.fprintf fmt "@[<-%a- %d@]" G.pretty_edge_label d_kind (Node.id src) else Format.fprintf fmt "@[-%a-> %d@]" G.pretty_edge_label d_kind (Node.id dst) in let iter_dpd = if bw then G.iter_pred_e else G.iter_succ_e in let print_node_and_dpds fmt n = Format.fprintf fmt "@[<v 2>@[%a@]" Node.pretty_node n; iter_dpd print_dpd graph n; Format.fprintf fmt "@]"; in Pretty_utils.pp_list ~pre:"@[<v>" ~sep:"@ " ~suf:"@]" print_node_and_dpds fmt all let pretty_bw ?(bw=false) fmt pdg = try let graph = get_graph pdg in pretty_graph ~bw fmt graph; with | Top -> Format.fprintf fmt "Top PDG@." | Bottom -> Format.fprintf fmt "Bottom PDG@." (*-----------------------------------------------------------------------*) module Printer = struct open PdgIndex type parent_t = t type t = parent_t module V = Node module E = struct type t = G.E.t * bool (** boolean to say that the edge is dynamic *) let src (e, _d) = G.E.dst e (* We reverse the direction of edges *) let dst (e, _d) = G.E.src e (* to get graphs with a correct orientation*) end (* Skip InCtrl nodes, that hinder readability *) let print_node n = match Node.elem_key n with | Key.SigKey (Signature.In Signature.InCtrl) | Key.SigCallKey (_, Signature.In Signature.InCtrl) -> false | _ -> true let iter_vertex f pdg = try let graph = get_graph pdg in let f n = if print_node n then f n in G.iter_vertex f graph with Top | Bottom -> () let iter_edges_e f pdg = try let graph = get_graph pdg in let f_static n1 lbl n2 = if print_node n1 && print_node n2 then f ((n1, lbl, n2), false) in G.iter_edges_e f_static graph; with Top | Bottom -> () let graph_attributes _ = [`Rankdir `TopToBottom ] let default_vertex_attributes _ = [`Style `Filled] let vertex_name v = string_of_int (Node.id v) let vertex_attributes v = let color_in = (`Fillcolor 0x6495ED) in let color_out = (`Fillcolor 0x90EE90) in let color_decl = (`Fillcolor 0xFFEFD5) in let color_stmt = (`Fillcolor 0xCCCCCC) in (* let color_annot = (`Fillcolor 0x999999) in *) let color_call = (`Fillcolor 0xFF8A0F) in let color_elem_call = (`Fillcolor 0xFFCA6E) in let sh_box = (`Shape `Box) in let key = Node.elem_key v in let sh, col, txt = match key with | Key.VarDecl v -> let txt = Format.asprintf "@[Decl %s@]" v.vname in `Shape `Box, color_decl, txt | Key.SigKey k -> let txt = Format.asprintf "%a" Signature.pretty_key k in let color = match k with | Signature.Out _ -> color_out | _ -> color_in in `Shape `Box, color, txt | Key.Stmt s -> let sh, txt = match s.skind with | Switch (exp,_,_,_) | If (exp,_,_,_) -> let txt = Pretty_utils.to_string Printer.pp_exp exp in `Shape `Diamond, txt | Loop _ -> `Shape `Doublecircle, "while" | Block _ | UnspecifiedSequence _ -> `Shape `Doublecircle, "{}" | Goto _ | Break _ | Continue _ -> let txt = Pretty_utils.to_string (Printer.without_annot Printer.pp_stmt) s in (`Shape `Doublecircle), txt | Return _ | Instr _ -> let txt = Pretty_utils.to_string (Printer.without_annot Printer.pp_stmt) s in sh_box, txt | _ -> sh_box, "???" in sh, color_stmt, txt | Key.CallStmt call -> let call_stmt = Key.call_from_id call in let txt = Pretty_utils.to_string (Printer.without_annot Printer.pp_stmt) call_stmt in sh_box, color_call, txt | Key.SigCallKey (_call, sgn) -> let txt = Pretty_utils.to_string Signature.pretty_key sgn in sh_box, color_elem_call, txt | Key.Label _ -> let txt = Pretty_utils.to_string Key.pretty key in sh_box, color_stmt, txt in sh :: col :: [`Label ( String.escaped txt)] let default_edge_attributes _ = [`Dir `Back] let edge_attributes (e, dynamic) = let d, z = G.edge_dpd e in let attrib = [] in let attrib = match z with | None -> attrib | Some z -> let txt = Format.asprintf "@[<h 1>%a@]" Locations.Zone.pretty z in (`Label (String.escaped txt)) :: attrib in let attrib = let color = if Dpd.is_data d then (if dynamic then 0xFF00FF else 0x0000FF) else (if dynamic then 0xFF0000 else 0x000000) in (`Color color) :: attrib in let attrib = if Dpd.is_ctrl d then (`Arrowtail `Odot)::attrib else attrib in let attrib = if Dpd.is_addr d then (`Style `Dotted)::attrib else attrib in attrib let get_subgraph v = let mk_subgraph name attrib = let attrib = (`Style `Filled) :: attrib in Some { Graph.Graphviz.DotAttributes.sg_name= name; sg_parent = None; sg_attributes = attrib } in match Node.elem_key v with | Key.CallStmt call | Key.SigCallKey (call, _) -> let call_stmt = Key.call_from_id call in let name = "Call"^(string_of_int call_stmt.sid) in let call_txt = Format.asprintf "%a" Printer.pp_stmt call_stmt in let call_txt = String.escaped call_txt in let attrib = [(`Label (name^" : "^call_txt))] in let attrib = (`Fillcolor 0xB38B4D) :: attrib in mk_subgraph name attrib | Key.SigKey k -> let pack_inputs_outputs = false in if pack_inputs_outputs then begin let is_in = match k with Signature.In _ -> true | _ -> false in let name = if is_in then "Inputs" else "Outputs" in let color = if is_in then 0x90EE90 else 0x6495ED in let attrib = [] in let attrib = (`Fillcolor color) :: attrib in mk_subgraph name attrib end else None | _ -> None end (** @see <http://www.lri.fr/~filliatr/ocamlgraph/doc/Graphviz.html> * Graph.Graphviz *) module PrintG = Graph.Graphviz.Dot(Printer) (*-----------------------------------------------------------------------*) let build_dot filename pdg = let file = open_out filename in PrintG.output_graph file pdg; close_out file end (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/pdg_types/pdgTypes.mli���������������������������������������������0000666�0000000�0000000�00000015746�13571573400�020000� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module defines the types that are used to store the PDG of a function. @plugin development guide *) (** [Dpd] stands for 'dependence'. This object is used as a label on the edges * of the PDG. There are three kinds of dependencies : * - control dependency, * - address dependency, * - data dependency. * An edge can carry one or several kinds. * A bottom edge means that there are no relation. *) module Dpd : sig type t type td = Ctrl | Addr | Data val make : ?a:bool -> ?d:bool -> ?c:bool -> unit -> t val top : t val bottom : t val is_addr : t -> bool val is_ctrl : t -> bool val is_data : t -> bool val adc_value : t -> bool * bool * bool val is_dpd : td -> t -> bool val is_bottom : t -> bool val is_included : t -> t -> bool val compare : t -> t -> int val equal : t -> t -> bool val combine : t -> t -> t val add : t -> td -> t val inter : t -> t -> t val intersect : t -> t -> bool val minus : t -> t -> t val pretty_td : Format.formatter -> td -> unit val pretty : Format.formatter -> t -> unit end (** A node of the PDG : includes some information to know where it comes from. *) module Node : sig include Datatype.S_with_collections val id : t -> int val elem_key : t -> PdgIndex.Key.t val stmt : t -> Cil_types.stmt option (*val equivalent : t -> PdgIndex.Key.t -> bool*) val pretty_list : Format.formatter -> t list -> unit val pretty_with_part : Format.formatter -> (t * Locations.Zone.t option) -> unit val pretty_node: Format.formatter -> t -> unit end module NodeSet : Hptset.S with type elt = Node.t (** Program dependence graph main part : the nodes of the graph represent computations, and the edges represent the dependencies between these computations. Only a few functions are exported, to build the graph in [pdg/build.ml]. Iterating over the PDG should be done using the functions in module [Pdg] below *) module G : sig type t module E : sig type t type label val src : t -> Node.t val dst : t -> Node.t val label : t -> label end val create : unit -> t val add_elem : t -> PdgIndex.Key.t -> Node.t val add_dpd : t -> Node.t -> Dpd.td -> Locations.Zone.t option -> Node.t -> unit end module NodeSetLattice : sig include Lattice_type.Lattice_Set with type O.elt=Node.t val default: t end module LocInfo : Lmap_bitwise.Location_map_bitwise with type v = NodeSetLattice.t (** a [data_state] object is associated with a program point and provides a mapping between a location and some nodes in the PDG that are used to compute the location value at that point. *) type data_state = { loc_info : LocInfo.t ; under_outputs : Locations.Zone.t } module Pdg : sig exception Top (** can be raised by most of the functions when called with a Top PDG. Top means that we were not able to compute the PDG for this function. *) exception Bottom (** exception raised when requiring the PDG of a function that is never called. *) include Datatype.S (** @param name of the function associated with that PDG *) val top : Kernel_function.t -> t val bottom : Kernel_function.t -> t val is_top : t -> bool val is_bottom : t -> bool val get_kf : t -> Kernel_function.t val iter_nodes : (Node.t -> unit) -> t -> unit val fold_call_nodes : ('a -> Node.t -> 'a) -> 'a -> t -> Cil_types.stmt -> 'a val iter_direct_dpds : t -> (Node.t -> unit) -> Node.t -> unit val iter_direct_codpds : t -> (Node.t -> unit) -> Node.t -> unit (** a dependency to another node. The dependency can be restricted to a zone. * (None means no restriction ie. total dependency) *) type dpd_info = (Node.t * Locations.Zone.t option) val get_all_direct_dpds : t -> Node.t -> dpd_info list val get_x_direct_dpds : Dpd.td -> t -> Node.t -> dpd_info list val get_all_direct_codpds : t -> Node.t -> dpd_info list val get_x_direct_codpds : Dpd.td -> t -> Node.t -> dpd_info list val fold_direct_dpds : t -> ('a -> Dpd.t * Locations.Zone.t option -> Node.t -> 'a) -> 'a -> Node.t -> 'a val fold_direct_codpds : t -> ('a -> Dpd.t * Locations.Zone.t option -> Node.t -> 'a) -> 'a -> Node.t -> 'a val pretty_bw : ?bw:bool -> Format.formatter -> t -> unit val pretty_graph : ?bw:bool -> Format.formatter -> G.t -> unit type fi = (Node.t, unit) PdgIndex.FctIndex.t val get_index : t -> fi (** [make fundec graph states index] *) val make : Kernel_function.t -> G.t -> data_state Cil_datatype.Stmt.Hashtbl.t -> fi -> t val get_states : t -> data_state Cil_datatype.Stmt.Hashtbl.t (** build the PDG .dot file and put it in [filename]. *) val build_dot: string -> t -> unit module Printer : sig val iter_vertex : (Node.t -> unit) -> t -> unit val iter_edges_e : (G.E.t * bool -> unit) -> t -> unit val graph_attributes : t -> Graph.Graphviz.DotAttributes.graph list val default_vertex_attributes : t -> Graph.Graphviz.DotAttributes.vertex list val vertex_name : Node.t -> string val vertex_attributes : Node.t -> Graph.Graphviz.DotAttributes.vertex list val get_subgraph : Node.t -> Graph.Graphviz.DotAttributes.subgraph option val default_edge_attributes : 'a -> Graph.Graphviz.DotAttributes.edge list val edge_attributes : G.E.t * bool -> Graph.Graphviz.DotAttributes.edge list end end (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������frama-c-20.0-Calcium/src/plugins/postdominators/����������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016550� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/postdominators/Postdominators.mli����������������������������������0000666�0000000�0000000�00000003426�13571573400�022305� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: Postdominators.mli,v 1.5 2008-04-01 09:25:21 uid568 Exp $ *) (** Postdominators analysis. *) (** No function is directly exported: they are registered in {!Db.Postdominators}. *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/postdominators/compute.ml������������������������������������������0000666�0000000�0000000�00000021735�13571573400�020566� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype module DomKernel = Plugin.Register (struct let name = "dominators" let shortname = "dominators" let help = "Compute postdominators of statements" end) module DomSet = struct type domset = Value of Stmt.Hptset.t | Top let inter a b = match a,b with | Top,Top -> Top | Value v, Top | Top, Value v -> Value v | Value v, Value v' -> Value (Stmt.Hptset.inter v v') let add v d = match d with | Top -> Top | Value d -> Value (Stmt.Hptset.add v d) let mem v = function | Top -> true | Value d -> Stmt.Hptset.mem v d let map f = function | Top -> Top | Value set -> Value (f set) include Datatype.Make (struct include Datatype.Serializable_undefined type t = domset let name = "dominator_set" let reprs = Top :: List.map (fun s -> Value s) Stmt.Hptset.reprs let structural_descr = Structural_descr.t_sum [| [| Stmt.Hptset.packed_descr |] |] let pretty fmt = function | Top -> Format.fprintf fmt "Top" | Value d -> Pretty_utils.pp_iter ~pre:"@[{" ~sep:",@," ~suf:"}@]" Stmt.Hptset.iter (fun fmt s -> Format.fprintf fmt "%d" s.sid) fmt d let equal a b = match a,b with | Top,Top -> true | Value _v, Top | Top, Value _v -> false | Value v, Value v' -> Stmt.Hptset.equal v v' let copy = map Cil_datatype.Stmt.Hptset.copy let mem_project = Datatype.never_any_project end) end (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) module type MakePostDomArg = sig val is_accessible: stmt -> bool (* Evaluation of an expression which is supposed to be the condition of an 'if'. The first boolean (resp. second) represents the possibility that the expression can be non-zero (resp. zero), ie. true (resp. false). *) val eval_cond: stmt -> exp -> bool * bool val dependencies: State.t list val name: string end module MakePostDom(X: MakePostDomArg) = struct module PostDom = Cil_state_builder.Stmt_hashtbl (DomSet) (struct let name = "postdominator." ^ X.name let dependencies = Ast.self :: X.dependencies let size = 503 end) module PostComputer = struct let name = "postdominator" let debug = false type t = DomSet.t module StmtStartData = PostDom let pretty = DomSet.pretty let combineStmtStartData _stmt ~old new_ = if DomSet.equal old new_ then None else Some new_ let combineSuccessors = DomSet.inter let doStmt stmt = !Db.progress (); Postdominators_parameters.debug ~level:2 "doStmt: %d" stmt.sid; match stmt.skind with | Return _ -> Dataflow2.Done (DomSet.Value (Stmt.Hptset.singleton stmt)) | _ -> Dataflow2.Post (fun data -> DomSet.add stmt data) let doInstr _ _ _ = Dataflow2.Default (* We make special tests for 'if' statements without a 'then' or 'else' branch. It can lead to better precision if we can evaluate the condition of the 'if' with always the same truth value *) let filterIf ifstmt next = match ifstmt.skind with | If (e, { bstmts = sthen :: _ }, { bstmts = [] }, _) when not (Stmt.equal sthen next) -> (* [next] is the syntactic successor of the 'if', ie the 'else' branch. If the condition is never false, then [sthen] postdominates [next]. We must not follow the edge from [ifstmt] to [next] *) snd (X.eval_cond ifstmt e) | If (e, { bstmts = [] }, { bstmts = selse :: _ }, _) when not (Stmt.equal selse next) -> (* dual case *) fst (X.eval_cond ifstmt e) | _ -> true let filterStmt pred next = X.is_accessible pred && filterIf pred next let funcExitData = DomSet.Value Stmt.Hptset.empty end module PostCompute = Dataflow2.Backwards(PostComputer) let compute_postdom kf = let return = try Kernel_function.find_return kf with Kernel_function.No_Statement -> Postdominators_parameters.abort "No return statement for a function with body %a" Kernel_function.pretty kf in try let _ = PostDom.find return in Postdominators_parameters.feedback ~level:2 "computed for function %a" Kernel_function.pretty kf with Not_found -> Postdominators_parameters.feedback ~level:2 "computing for function %a" Kernel_function.pretty kf; let f = kf.fundec in match f with | Definition (f,_) -> let stmts = f.sallstmts in List.iter (fun s -> PostDom.add s DomSet.Top) stmts; PostCompute.compute [return]; Postdominators_parameters.feedback ~level:2 "done for function %a" Kernel_function.pretty kf | Declaration _ -> () let get_stmt_postdominators f stmt = let do_it () = PostDom.find stmt in try do_it () with Not_found -> compute_postdom f; do_it () (** @raise Db.PostdominatorsTypes.Top when the statement postdominators * have not been computed ie neither the return statement is reachable, * nor the statement is in a natural loop. *) let stmt_postdominators f stmt = match get_stmt_postdominators f stmt with | DomSet.Value s -> Postdominators_parameters.debug ~level:1 "Postdom for %d are %a" stmt.sid Stmt.Hptset.pretty s; s | DomSet.Top -> raise Db.PostdominatorsTypes.Top let is_postdominator f ~opening ~closing = let open_postdominators = get_stmt_postdominators f opening in DomSet.mem closing open_postdominators let display_postdom () = let disp_all fmt = PostDom.iter (fun k v -> Format.fprintf fmt "Stmt:%d -> @[%a@]\n" k.sid PostComputer.pretty v) in Postdominators_parameters.result "%t" disp_all let print_dot_postdom basename kf = let filename = basename ^ "." ^ Kernel_function.get_name kf ^ ".dot" in Print.build_dot filename kf; Postdominators_parameters.result "dot file generated in %s" filename end module PostDomDb(X: MakePostDomArg)(DbPostDom: Db.PostdominatorsTypes.Sig) = struct include MakePostDom(X) let () = DbPostDom.compute := compute_postdom let () = DbPostDom.is_postdominator := is_postdominator let () = DbPostDom.stmt_postdominators := stmt_postdominators let () = DbPostDom.display := display_postdom let () = DbPostDom.print_dot := print_dot_postdom end module PostDomBasic = PostDomDb( struct let is_accessible _ = true let dependencies = [] let name = "basic" let eval_cond _ _ = true, true end) (Db.Postdominators) let output () = let dot_postdom = Postdominators_parameters.DotPostdomBasename.get () in if dot_postdom <> "" then ( Ast.compute (); Globals.Functions.iter (fun kf -> if Kernel_function.is_definition kf then !Db.Postdominators.print_dot dot_postdom kf) ) let output, _ = State_builder.apply_once "Postdominators.Compute.output" [PostDomBasic.PostDom.self] output let () = Db.Main.extend output module PostDomVal = PostDomDb( struct let is_accessible = Db.Value.is_reachable_stmt let dependencies = [ Db.Value.self ] let name = "value" let eval_cond stmt _e = Db.Value.condition_truth_value stmt end) (Db.PostdominatorsValue) (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������frama-c-20.0-Calcium/src/plugins/postdominators/postdominators_parameters.ml������������������������0000666�0000000�0000000�00000004021�13571573400�024407� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "postdominators" let shortname = "postdominators" let help = "computing postdominators of statements" end) module DotPostdomBasename = Empty_string (struct let option_name = "-dot-postdom" let arg_name = "f" let help = "put the postdominators of function <f> in basename.f.dot" end) (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/postdominators/postdominators_parameters.mli�����������������������0000666�0000000�0000000�00000003350�13571573400�024564� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.General_services module DotPostdomBasename: Parameter_sig.String (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/postdominators/print.ml��������������������������������������������0000666�0000000�0000000�00000013066�13571573400�020244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype let pretty_stmt fmt s = let key = PdgIndex.Key.stmt_key s in !Db.Pdg.pretty_key fmt key module Printer = struct type t = string * (Stmt.Hptset.t option Kinstr.Hashtbl.t) module V = struct type t = Cil_types.stmt * bool let pretty fmt v = pretty_stmt fmt v end module E = struct type t = (V.t * V.t) let src e = fst e let dst e = snd e end let iter_vertex f (_, graph) = let do_s ki postdom = let s = match ki with Kstmt s -> s | _ -> assert false in Postdominators_parameters.debug "iter_vertex %d : %a\n" s.sid V.pretty s; let has_postdom = match postdom with None -> false | _ -> true in f (s, has_postdom) in Kinstr.Hashtbl.iter do_s graph let iter_edges_e f (_, graph) = let do_s ki postdom = let s = match ki with Kstmt s -> s | _ -> assert false in match postdom with None -> () | Some postdom -> let do_edge p = f ((s, true), (p, true)) in Stmt.Hptset.iter do_edge postdom in Kinstr.Hashtbl.iter do_s graph let vertex_name (s, _) = string_of_int s.sid let graph_attributes (title, _) = [`Label title] let default_vertex_attributes _g = [`Style `Filled] let default_edge_attributes _g = [] let vertex_attributes (s, has_postdom) = let attrib = [] in let txt = Format.asprintf "%a" V.pretty s in let attrib = (`Label txt) :: attrib in let color = if has_postdom then 0x7FFFD4 else 0xFF0000 in let attrib = (`Shape `Box) :: attrib in let attrib = (`Fillcolor color) :: attrib in attrib let edge_attributes _s = [] let get_subgraph _v = None end module PostdomGraph = Graph.Graphviz.Dot(Printer) let get_postdom kf graph s = try match Kinstr.Hashtbl.find graph (Kstmt s) with | None -> Stmt.Hptset.empty | Some l -> l with Not_found -> try let postdom = !Db.Postdominators.stmt_postdominators kf s in let postdom = Stmt.Hptset.remove s postdom in Postdominators_parameters.debug "postdom for %d:%a = %a\n" s.sid pretty_stmt s Stmt.Hptset.pretty postdom; Kinstr.Hashtbl.add graph (Kstmt s) (Some postdom); postdom with Db.PostdominatorsTypes.Top -> Kinstr.Hashtbl.add graph (Kstmt s) None; raise Db.PostdominatorsTypes.Top (** [s_postdom] are [s] postdominators, including [s]. * We don't have to represent the relation between s and s. * And because the postdom relation is transitive, if [p] is in [s_postdom], * we can remove [p_postdom] from [s_postdom] in order to have a clearer graph. *) let reduce kf graph s = let remove p s_postdom = if Stmt.Hptset.mem p s_postdom then try let p_postdom = get_postdom kf graph p in let s_postdom = Stmt.Hptset.diff s_postdom p_postdom in s_postdom with Db.PostdominatorsTypes.Top -> assert false (* p postdom s -> cannot be top *) else s_postdom (* p has already been removed from s_postdom *) in try let postdom = get_postdom kf graph s in let postdom = Stmt.Hptset.fold remove postdom postdom in Postdominators_parameters.debug "new postdom for %d:%a = %a\n" s.sid pretty_stmt s Stmt.Hptset.pretty postdom; Kinstr.Hashtbl.replace graph (Kstmt s) (Some postdom) with Db.PostdominatorsTypes.Top -> () let build_reduced_graph kf graph stmts = List.iter (reduce kf graph) stmts let build_dot filename kf = match kf.fundec with | Definition (fct, _) -> let stmts = fct.sallstmts in let graph = Kinstr.Hashtbl.create (List.length stmts) in let _ = build_reduced_graph kf graph stmts in let name = Kernel_function.get_name kf in let title = "Postdominators for function " ^ name in let file = open_out filename in PostdomGraph.output_graph file (title, graph); close_out file | Declaration _ -> Kernel.error "cannot compute for a function without body %a" Kernel_function.pretty kf (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/print_api/���������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015450� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/print_api/Makefile�������������������������������������������������0000666�0000000�0000000�00000004443�13571573400�017115� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Print_api plugin ################## # Frama-C should be properly installed with "make install" # befor any use of this makefile ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c.byte -print-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c.byte -print-libpath) endif PLUGIN_DIR ?= . PLUGIN_NAME := Print_api PLUGIN_CMO := grammar lexer print_interface PLUGIN_GENERATED:= $(PLUGIN_DIR)/grammar.ml $(PLUGIN_DIR)/grammar.mli \ $(PLUGIN_DIR)/lexer.ml PLUGIN_DISTRIB_EXTERNAL:=Makefile include $(FRAMAC_SHARE)/Makefile.dynamic clean:: $(RM) $(Print_api_DIR)/dynamic_plugins.mli $(RM) $(Print_api_DIR)/grammar.output $(RM) $(Print_api_DIR)/grammar.ml $(RM) $(Print_api_DIR)/grammar.mli $(RM) $(Print_api_DIR)/lexer.ml $(RM) -r _build �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/print_api/Print_api.mli��������������������������������������������0000666�0000000�0000000�00000003160�13571573400�020100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Nothing is exported. *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/print_api/grammar.mly����������������������������������������������0000666�0000000�0000000�00000004614�13571573400�017626� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/**************************************************************************/ /* */ /* This file is part of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat à l'énergie atomique et aux énergies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ %{ %} %token <string> WORD %token LPAR %token RPAR %token COMMA %token EOF %start main %type <string> main %% main: type_string EOF { $1 } word: WORD { $1 } type_string: word { $1 } | type_string word { "'a "^$2 } | LPAR type_string COMMA type_string RPAR word { "('a,'b) "^$6 } | LPAR type_string COMMA type_string COMMA type_string RPAR word { "('a,'b,'c) "^$8 } | LPAR type_string COMMA type_string COMMA type_string COMMA type_string RPAR word { "('a,'b,'c,'d) "^$10 } ��������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/print_api/lexer.mll������������������������������������������������0000666�0000000�0000000�00000003524�13571573400�017301� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) { } rule token = parse | [' ' '\t'] { token lexbuf } | [ ^ '(' ',' ')' ' ' ]* { Grammar.WORD (Lexing.lexeme lexbuf) } | '(' { Grammar.LPAR } | ')' { Grammar.RPAR } | ',' { Grammar.COMMA } | eof {Grammar.EOF } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/print_api/print_interface.ml���������������������������������������0000666�0000000�0000000�00000032651�13571573400�021165� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Register the new plugin. *) module Self = Plugin.Register (struct let name = "Print interface" let shortname = "print_api" let help = "This plugin creates a file containing all \ the registered signatures of the dynamic plugins" end) (** Register the new Frama-C option "-print_api". *) module Enabled = Self.String (struct let option_name = "-print_api" let help = "creates a .mli file for the dynamic plugins inside the \ supplied directory" let arg_name = "dir" let default = "" end) type function_element = { name: string; type_string: string; datatype_string: string } (** Each object of the table is going to be composed of : (function_name, type_string) and its corresponding key is "plugin_name" *) let functions_tbl = Hashtbl.create 97 (** [type_to_add] contains types not referenced in [reference] and to be added in the interface. The list [reference] contains the names of the regular types of OCaml and the registered types of static plugins and kernel *) let type_to_add: (string, string * string) Hashtbl.t = Hashtbl.create 97 let clash_with_compilation_unit = let h = Hashtbl.create 97 in List.iter (fun s -> Hashtbl.add h s ()) Config.compilation_unit_names; fun s -> Hashtbl.mem h s || Hashtbl.mem h (String.lowercase_ascii s) (** Modules can depend on each other, when a value of a given module depend on a type of another. It is then important to print them in an appropriate order. *) module Module_deps = Graph.Imperative.Digraph.Concrete(Datatype.String) let module_deps = Module_deps.create () (** Comments are registered apart in the module Dynamic *) module Comment: sig val add: string -> string -> unit val find: string -> string end = struct let tbl: (string, string) Hashtbl.t = Hashtbl.create 97 let add k v = if v <> "" then Hashtbl.add tbl k v let find k = try Hashtbl.find tbl k with Not_found -> "" end (**returns a list of the substrings *) let split_dot s = Str.split (Str.regexp_string ".") s let get_name i s = let li = split_dot s in let rec get_name_aux i j l = if i < j then match i, l with | _, [] -> "" | 0, h :: _ -> h | _ , _ :: q -> get_name_aux (i-1) (j-1) q else "" in get_name_aux i (List.length li) li let sub_string_dot i s = let rec sub_string_dot_aux j = if j < i then get_name j s ^ "." ^ sub_string_dot_aux (j+1) else get_name i s in sub_string_dot_aux 0 (** If s = "module1.module2 ... .fname", then [function_name s] = "fname" *) let function_name s = let rec function_name_aux i s = match i , get_name (i+2) s , get_name (i+1) s with | 0,"","" -> "" | _,"",f -> f | _,_,_ -> function_name_aux (i+1) s in function_name_aux 0 s (** If s = "module1.module2 ... .fname", then [long_function_name s] = "module2 ... .fname" *) let long_function_name s = let pt_idx = ref 0 in try for i = 0 to String.length s - 1 do if s.[i] = '.' then begin pt_idx := i; raise Exit end done; s with Exit -> Str.string_after s (!pt_idx + 1) (** when considering s = "plugin_name_0.plugin_name_1.function_name", [plugin_name s] ="plugin_name_0.plugin_name_1" *) let plugin_name s = let rec plugin_name_aux i s = match i , get_name (i+2) s , get_name (i+1) s with | 0, "", "" -> get_name 0 s | _, "", _ -> sub_string_dot i s | _, _, _ -> plugin_name_aux (i+1) s in plugin_name_aux 0 s let sub_string_dot_compare i s1 s2 = sub_string_dot i s1 = sub_string_dot i s2 let first_divergence m1 m2 = let rec aux i = if sub_string_dot_compare i m1 m2 then aux (i+1) else i in sub_string_dot (aux 0) m1 (* m1 depends on m2 *) let add_module_dep m1 m2 = Module_deps.add_edge module_deps m2 (first_divergence m1 m2) let find_module_deps m1 = (* add the vertex in order to avoid OCamlGraph crashing on a non-existent vertex. *) Module_deps.add_vertex module_deps m1; let deps = Module_deps.pred module_deps m1 in let rec find_real_module m1 m = let complete_name = m1 ^ "." ^ m in if Hashtbl.mem type_to_add complete_name || Hashtbl.mem functions_tbl complete_name then complete_name else let pre_m1 = plugin_name m1 in if m1 = pre_m1 then m else find_real_module m1 m in List.map (find_real_module m1) deps (** true if m2 is a sub-module of m1 *) let is_submodule m1 m2 = let m1' = first_divergence m1 m2 in m1 = m1' (** [analyse_type] is called each time a new value is added to [functions_tbl] in the function [fill_tbl]. It considers what is given by [Type.get_embedded_type_name type_string], tests if the type to analyse is not already recorded in the [reference] list or creates the corresponding type in the Hashtable [type_to add] where the key is the module name of this type. *) let analyse_type name l = let add_type tbl name module_name typ = let add_type_aux t s ty = let temp = try Hashtbl.find_all t s with Not_found -> [] in if not (List.mem ty temp) then Hashtbl.add t s ty in if function_name name = module_name then add_type_aux tbl name typ else begin if name <> module_name then add_module_dep name module_name; add_type_aux tbl module_name typ end in let analyse_type_aux s = if not (String.contains s '>') && (String.contains s '.') then if not (String.contains s ' ') then begin let s_name = get_name 0 s in if not (clash_with_compilation_unit s_name) then let typ_n = function_name s in let module_name = plugin_name s in add_type type_to_add name module_name (typ_n, s) end else let lexbuf = Lexing.from_string s in let param, type_name = let l = Str.split (Str.regexp_string " ") (Grammar.main Lexer.token lexbuf) in match l with | [ h ] -> "", h | [h1; h2 ] -> h1, h2 | _ -> "", "" in let ty_name = get_name 0 type_name in if String.contains type_name '.' && not (clash_with_compilation_unit ty_name) then let typ_n = param ^ " " ^ function_name type_name in let module_name = plugin_name type_name in add_type type_to_add name module_name (typ_n, type_name) in List.iter analyse_type_aux (List.rev l) let is_option key = String.length key > 1 && String.rcontains_from key 1 '-' (** It fills [function_tbl] with the content of [dynamic_values] which is a Hashtable recorded in the module Dynamic. This Hashtable also contains options like: "-hello-help" or "-hello-debug". The 'if' is taking away this useless strings and the module named "Dynamic" and fills the table with the suitable names. *) let fill_tbl key typ _ = if not (is_option key || get_name 0 key = "Dynamic") then let type_list = Type.get_embedded_type_names typ in let func_elem = { name = function_name key ; type_string = Type.name typ ; datatype_string = Type.ml_name typ } in Hashtbl.add functions_tbl (plugin_name key) func_elem; analyse_type (plugin_name key) type_list (** It replaces the sub-strings "Plugin.type" of all the string [type_string] used in the module named "Plugin" by "type". It also removes the option structure (e.g. "~gid:string" is replaced by "string"). *) let repair_type module_name type_string = let rec remove_param_name s = try let c = String.index s ':' in let after = remove_param_name (Str.string_after s (c+1)) in try let n = String.index s '~' in if n < c then if n = 0 then after else remove_param_name (Str.string_before s n) ^ after else s with Not_found -> if c = 0 then after else let sp = String.rindex (Str.string_before s c) ' ' in remove_param_name (Str.string_before s (sp + 1)) ^ after with Not_found -> s in let remove_name_module s module_n = Str.global_replace (Str.regexp (module_n ^ "\\.")) "" s in match split_dot module_name with | [] -> type_string | l -> List.fold_left remove_name_module (remove_param_name type_string) l (** For each key of the table [functions_tbl], [print_plugin] takes all the pieces of information found in the Hashtable [dynamic_values] of the module Dynamic and stored in the 3 Hashtables ([functions_tb]l, [type_to_add], [comment_tbl]) and builds up a string in order to write the signature of this module in the .mli file *) let print_plugin fmt = let modules_list: (string, unit) Hashtbl.t = Hashtbl.create 7 in let rec space i = match i with | 0 -> "" | _ -> space (i-1) ^ " " in let rec print_types fmt sp = function | [] -> () | (h, long_h) :: q -> Format.fprintf fmt "@\n%stype %s@\n%s \ (** @@call by writing [T.ty] where [T] has previously been defined by: \ [module T = Type.Abstract(struct let name = %s end)]. Be careful to replace occurrences of %s by T.ty anywhere else in this doc. *)" sp h sp long_h long_h; print_types fmt sp q in let rec print_one_plugin fmt i key1 = if not (get_name i key1 = "") then let module_name = sub_string_dot i key1 in if not (Hashtbl.mem modules_list module_name) then begin Hashtbl.add modules_list module_name (); (* Check whether there are some modules to be treated before us. *) let deps = find_module_deps key1 in let extern, sub_modules = List.partition (is_submodule key1) deps in List.iter (print_one_plugin fmt i) extern; let short_module_name = String.capitalize_ascii (get_name i key1) in let space_i = space i in Format.fprintf fmt "\n \n%smodule %s:\n%ssig " space_i short_module_name space_i; List.iter (print_one_plugin fmt (succ i)) sub_modules; let module_types = try Hashtbl.find_all type_to_add module_name with Not_found -> [] in print_types fmt (space i) module_types ; let print_one_plugin_aux fmt key elem = if sub_string_dot i key = module_name then let succ_i = succ i in if get_name succ_i key = "" then begin let plugin_name = sub_string_dot 0 key1 in let found_comment = Comment.find (key ^ "." ^ elem.name) in Format.fprintf fmt "@\n%s@[ @[val %s:@ %s@]@\n%s@[ (** %s\n\ @@call Dynamic.get ~plugin:\"%s\" \"%s\" %s *)@]@]@\n" space_i elem.name (repair_type module_name elem.type_string) space_i found_comment plugin_name (long_function_name (key ^ "." ^ elem.name)) elem.datatype_string; Hashtbl.remove functions_tbl key end else print_one_plugin fmt succ_i key in Hashtbl.iter (print_one_plugin_aux fmt) functions_tbl ; Format.fprintf fmt "\n%send" (space i) end in let print_all fmt i key _ = print_one_plugin fmt i key in Format.fprintf fmt "@[%t@]" (fun fmt -> Hashtbl.iter (print_all fmt 0) functions_tbl) (** [print] is the main function of this module. It takes one argument which is the path and opens the file path/dynamic_plugins.mli. It fills [functions_tbl], [comment_tbl] and [type_to_add] using the functions [fill_tbl] and [add_comment] and then prints the plugins in the file with [print_plugin] *) let print path = try Dynamic.iter fill_tbl; Dynamic.iter_comment Comment.add; let channel = open_out (path ^ "/dynamic_plugins.mli") in let fmt = Format.formatter_of_out_channel channel in Format.fprintf fmt "@[@[(** This@ module@ contains@ all@ the@ dynamically@ \ registered@ plugins *)@]@ %t@]" print_plugin; close_out channel with Sys_error _ as e -> Self.error "%s" (Printexc.to_string e) (** register [print (path : string)] *) let print = Dynamic.register ~comment: "Create a .mli file used by 'make doc' \ to generate the html documentation of dynamic plug-ins.\ It takes the path where to create this file as an argument." ~plugin:"Print_api" "run" ~journalize:true (Datatype.func Datatype.string Datatype.unit) print let run () = if not (Enabled.is_default ()) then print (Enabled.get ()) let () = Db.Main.extend run ���������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/���������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014234� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/Makefile�������������������������������������������������������0000666�0000000�0000000�00000007700�13571573400�015700� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of WP plug-in of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat a l'energie atomique et aux energies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # -------------------------------------------------------------------------- # --- Frama-C Config # -------------------------------------------------------------------------- ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c -journal-disable -print-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c -journal-disable -print-libpath) endif PLUGIN_DIR ?=. ifneq ("$(FRAMAC_INTERNAL)","yes") include $(FRAMAC_SHARE)/Makefile.config endif # -------------------------------------------------------------------------- # --- Plugin Config # -------------------------------------------------------------------------- PLUGIN_ENABLE:=yes PLUGIN_DYNAMIC:=yes PLUGIN_NAME:=Qed PLUGIN_CMO:= \ hcons \ listmap listset \ intmap intset \ idxmap idxset \ mergemap mergeset collection \ partition cache \ bvars logic \ pool kind term \ plib pretty engine export \ export_whycore \ export_altergo \ export_why3 \ export_coq \ PLUGIN_GUI_CMO:= QedGui PLUGIN_DEPENDENCIES:= PLUGIN_TESTS_DIRS:= PLUGIN_BFLAGS:= PLUGIN_OFLAGS:= PLUGIN_GENERATED:= $(PLUGIN_DIR)/Qed.mli PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLED) PLUGIN_DISTRIB_EXTERNAL:= Makefile include $(FRAMAC_SHARE)/Makefile.dynamic # -------------------------------------------------------------------------- # --- Plugin API # -------------------------------------------------------------------------- QED_API= \ hcons.mli \ listset.mli listmap.mli \ intset.mli intmap.mli \ idxset.mli idxmap.mli \ mergemap.mli mergeset.mli collection.mli \ partition.mli cache.mli \ bvars.mli \ logic.ml \ pool.mli kind.mli term.mli \ plib.mli pretty.mli engine.ml export.mli \ export_whycore.mli \ export_altergo.mli \ export_why3.mli \ export_coq.mli \ QED_MLI=$(addprefix $(Qed_DIR)/, $(QED_API)) define QED_capitalize $(shell printf "%s%s" \ $$($(ECHO) $(1) | cut -c 1 | tr '[:lower:]' '[:upper:]') $$($(ECHO) $(1) | cut -c 2-)) endef define QED_export $(ECHO) "module $(call QED_capitalize, $(basename $(notdir $(1)))) : sig" >> $(2); $(CAT) $(1) >> $(2); $(ECHO) "end" >> $(2); endef $(Qed_DIR)/Qed.mli: $(QED_MLI) $(PRINT_MAKING) $@ $(RM) $@ $@.tmp $(ECHO) "(* This file is generated. Do not edit. *)" > $@.tmp $(ECHO) "(** {b Qed Public API} *)" > $@.tmp $(foreach file,$(QED_MLI),$(call QED_export,$(file),$@.tmp)) $(CHMOD_RO) $@.tmp $(MV) $@.tmp $@ clean:: $(RM) $(Qed_DIR)/Qed.mli # -------------------------------------------------------------------------- ����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/QedGui.ml������������������������������������������������������0000666�0000000�0000000�00000003166�13571573400�015752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Fake Module for Frama-C / Gui *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/bvars.ml�������������������������������������������������������0000666�0000000�0000000�00000005402�13571573400�015704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Upper approximated Set of (un-)bound variables --- *) (* -------------------------------------------------------------------------- *) type t = { lower : int ; (* lower bound of variables, or 0 if empty *) upper : int ; (* upper bound of variables +1, or 0 is empty *) order : int ; (* depth of binders inside *) } let empty = { lower=0 ; upper=0 ; order=0 } let is_empty a = (a.upper = 0) let closed s = s.upper <= s.order let closed_at d s = s.upper = 0 || d <= s.lower let union a b = if is_empty a then b else if is_empty b then a else { lower = min a.lower b.lower ; order = max a.order b.order ; upper = max a.upper b.upper ; } let singleton k = { order = 0 ; lower = k ; upper = k+1 ; } let contains k s = s.lower <= k && k < s.upper let overlap k n s = s.lower < k+n && k < s.upper let order s = s.order let bind s = { upper = s.upper ; lower = s.lower ; order = succ s.order ; } let pretty fmt s = if is_empty s then Format.fprintf fmt "<empty>" else Format.fprintf fmt "\\%d.[%d-%d]" s.order s.lower (s.upper - 1) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/bvars.mli������������������������������������������������������0000666�0000000�0000000�00000005101�13571573400�016051� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Bound Variables Footprints. All provided operation are constant-time bitwise and integer operations. *) (* -------------------------------------------------------------------------- *) type t (** An over-approximation of set of integers *) val empty : t val singleton : int -> t val order : t -> int (** Max stack of binders *) val bind : t -> t (** Decrease all elements in [s] after removing [0] *) val union : t -> t -> t val closed : t -> bool (** All variables are bound *) val closed_at : int -> t -> bool (** [closed_at n a] Does not contains variables [k<n] *) val is_empty : t -> bool (** No bound variables *) val contains : int -> t -> bool (** if [contains k s] returns [false] then [k] does not belong to [s] *) val overlap : int -> int -> t -> bool (** if [may_overlap k n s] returns [false] then no variable [i] with [k<=i<k+n] occurs in [s]. *) val pretty : Format.formatter -> t -> unit ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/cache.ml�������������������������������������������������������0000666�0000000�0000000�00000006362�13571573400�015640� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Simple Caches --- *) (* -------------------------------------------------------------------------- *) module type S = sig type t val hash : t -> int val equal : t -> t -> bool end module type Cache = sig type 'a value type 'a cache val create : size:int -> 'a cache val clear : 'a cache -> unit val compute : 'a cache -> 'a value -> 'a value end let rec log2up n a b = let c = (a+b) / 2 in let s = 1 lsl c in if s = n then c else if c = a then b else if s < n then log2up n c b else log2up n a c let max_cache_log = log2up Sys.max_array_length 0 (Sys.word_size - 3) - 1 let alloc size = 1 lsl (log2up size 0 max_cache_log) module Unary(A : S) = struct type 'a value = A.t -> 'a type 'a cell = N | C of A.t * 'a type 'a cache = 'a cell array let clear m = Array.fill m 0 (Array.length m) N let compute m f x = let h = A.hash x land (pred (Array.length m)) in match m.(h) with | C( e , r ) when A.equal x e -> r | _ -> let r = f x in m.(h) <- C(x,r) ; r let create ~size = Array.make (alloc size) N end module Binary(A : S) = struct type 'a value = A.t -> A.t -> 'a type 'a cell = N | C of A.t * A.t * 'a type 'a cache = 'a cell array let clear m = Array.fill m 0 (Array.length m) N let compute m f x y = let s = Array.length m in let h = (A.hash x * 5 + A.hash y * 7) land (pred s) in match m.(h) with | C( a , b , r ) when A.equal x a && A.equal y b -> r | _ -> let r = f x y in m.(h) <- C(x,y,r) ; r let create ~size = Array.make (alloc size) N end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/cache.mli������������������������������������������������������0000666�0000000�0000000�00000004312�13571573400�016002� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Simple Caches --- *) (* -------------------------------------------------------------------------- *) module type S = sig type t val hash : t -> int val equal : t -> t -> bool end module type Cache = sig type 'a value type 'a cache val create : size:int -> 'a cache val clear : 'a cache -> unit val compute : 'a cache -> 'a value -> 'a value end module Unary(A : S) : Cache with type 'a value = A.t -> 'a module Binary(A : S) : Cache with type 'a value = A.t -> A.t -> 'a ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/collection.ml��������������������������������������������������0000666�0000000�0000000�00000012376�13571573400�016732� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Aggregation of MergeMap and MergeSet --- *) (* -------------------------------------------------------------------------- *) module type T = sig type t val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int end module type Map = sig type key type 'a t val empty : 'a t val add : key -> 'a -> 'a t -> 'a t val mem : key -> 'a t -> bool val find : key -> 'a t -> 'a val findk : key -> 'a t -> key * 'a val size : 'a t -> int val is_empty : 'a t -> bool (** [insert (fun key v old -> ...) key v map] *) val insert : (key -> 'a -> 'a -> 'a) -> key -> 'a -> 'a t -> 'a t val change : (key -> 'b -> 'a option -> 'a option) -> key -> 'b -> 'a t -> 'a t val map : ('a -> 'b) -> 'a t -> 'b t val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t val mapf : (key -> 'a -> 'b option) -> 'a t -> 'b t val mapq : (key -> 'a -> 'a option) -> 'a t -> 'a t val filter : (key -> 'a -> bool) -> 'a t -> 'a t val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t val iter : (key -> 'a -> unit) -> 'a t -> unit val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val iter_sorted : (key -> 'a -> unit) -> 'a t -> unit val fold_sorted : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val union : (key -> 'a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t val inter : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val interf : (key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t val interq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val diffq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val subset : (key -> 'a -> 'b -> bool) -> 'a t -> 'b t -> bool val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val iterk : (key -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit val iter2 : (key -> 'a option -> 'b option -> unit) -> 'a t -> 'b t -> unit val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t type domain val domain : 'a t -> domain end module type Set = sig type elt type t val empty : t val add : elt -> t -> t val singleton : elt -> t val elements : t -> elt list val is_empty : t -> bool val mem : elt -> t -> bool val iter : (elt -> unit) -> t -> unit val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a val filter : (elt -> bool) -> t -> t val partition : (elt -> bool) -> t -> t * t val for_all : (elt -> bool) -> t -> bool val exists : (elt -> bool) -> t -> bool val iter_sorted : (elt -> unit) -> t -> unit val fold_sorted : (elt -> 'a -> 'a) -> t -> 'a -> 'a val union : t -> t -> t val inter : t -> t -> t val diff : t -> t -> t val subset : t -> t -> bool val intersect : t -> t -> bool val of_list : elt list -> t type 'a mapping val mapping : (elt -> 'a) -> t -> 'a mapping end module type S = sig type t type set type 'a map val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int module Map : Map with type 'a t = 'a map and type key = t and type domain = set module Set : Set with type t = set and type elt = t and type 'a mapping = 'a map end module Make(A : T) = struct type t = A.t type set = A.t list Intmap.t type 'a map = (A.t * 'a) list Intmap.t let hash = A.hash let equal = A.equal let compare = A.compare module Map_i = Mergemap.Make(A) module Set_i = Mergeset.Make(A) module Map = struct include Map_i type domain = set let domain m = Intmap.map (List.map fst) m end module Set = struct include Set_i type 'a mapping = 'a map let mapping f m = Intmap.map (List.map (fun k -> k,f k)) m end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/collection.mli�������������������������������������������������0000666�0000000�0000000�00000011354�13571573400�017076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Merging Maps and Sets *) (* -------------------------------------------------------------------------- *) module type T = sig type t val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int end module type Map = sig type key type 'a t val empty : 'a t val add : key -> 'a -> 'a t -> 'a t val mem : key -> 'a t -> bool val find : key -> 'a t -> 'a val findk : key -> 'a t -> key * 'a val size : 'a t -> int val is_empty : 'a t -> bool (** [insert (fun key v old -> ...) key v map] *) val insert : (key -> 'a -> 'a -> 'a) -> key -> 'a -> 'a t -> 'a t val change : (key -> 'b -> 'a option -> 'a option) -> key -> 'b -> 'a t -> 'a t val map : ('a -> 'b) -> 'a t -> 'b t val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t val mapf : (key -> 'a -> 'b option) -> 'a t -> 'b t val mapq : (key -> 'a -> 'a option) -> 'a t -> 'a t val filter : (key -> 'a -> bool) -> 'a t -> 'a t val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t val iter : (key -> 'a -> unit) -> 'a t -> unit val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val iter_sorted : (key -> 'a -> unit) -> 'a t -> unit val fold_sorted : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val union : (key -> 'a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t val inter : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val interf : (key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t val interq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val diffq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val subset : (key -> 'a -> 'b -> bool) -> 'a t -> 'b t -> bool val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val iterk : (key -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit val iter2 : (key -> 'a option -> 'b option -> unit) -> 'a t -> 'b t -> unit val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t type domain val domain : 'a t -> domain end module type Set = sig type elt type t val empty : t val add : elt -> t -> t val singleton : elt -> t val elements : t -> elt list val is_empty : t -> bool val mem : elt -> t -> bool val iter : (elt -> unit) -> t -> unit val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a val filter : (elt -> bool) -> t -> t val partition : (elt -> bool) -> t -> t * t val for_all : (elt -> bool) -> t -> bool val exists : (elt -> bool) -> t -> bool val iter_sorted : (elt -> unit) -> t -> unit val fold_sorted : (elt -> 'a -> 'a) -> t -> 'a -> 'a val union : t -> t -> t val inter : t -> t -> t val diff : t -> t -> t val subset : t -> t -> bool val intersect : t -> t -> bool val of_list : elt list -> t type 'a mapping val mapping : (elt -> 'a) -> t -> 'a mapping end module type S = sig type t type set type 'a map val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int module Map : Map with type 'a t = 'a map and type key = t and type domain = set module Set : Set with type t = set and type elt = t and type 'a mapping = 'a map end module Make(A : T) : S with type t = A.t ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/engine.ml������������������������������������������������������0000666�0000000�0000000�00000024677�13571573400�016053� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Engine Signature --- *) (* -------------------------------------------------------------------------- *) (** Generic Engine Signature *) open Format open Plib type op = | Op of string (** Infix or prefix operator *) | Assoc of string (** Left-associative binary operator (like + and -) *) | Call of string (** Logic function or predicate *) type link = | F_call of string (** n-ary function *) | F_subst of string (** n-ary function with substitution "foo(%1,%2)" *) | F_left of string (** 2-ary function left-to-right + *) | F_right of string (** 2-ary function right-to-left + *) | F_list of string * string (** n-ary function with (cons,nil) constructors *) | F_assoc of string (** associative infix operator *) | F_bool_prop of string * string (** Has a bool and prop version *) type callstyle = | CallVar (** Call is [f(x,...)] ; [f()] can be written [f] *) | CallVoid (** Call is [f(x,...)] ; in [f()], [()] is mandatory *) | CallApply (** Call is [f x ...] *) type mode = | Mpositive (** Current scope is [Prop] in positive position. *) | Mnegative (** Current scope is [Prop] in negative position. *) | Mterm (** Current scope is [Term]. *) | Mterm_int (** [Int] is required but actual scope is [Term]. *) | Mterm_real (** [Real] is required but actual scope is [Term]. *) | Mint (** Current scope is [Int]. *) | Mreal (** Current scope is [Real]. *) type flow = Flow | Atom type cmode = Cprop | Cterm type amode = Aint | Areal type pmode = Positive | Negative | Boolean type ('x,'f) ftrigger = | TgAny | TgVar of 'x | TgGet of ('x,'f) ftrigger * ('x,'f) ftrigger | TgSet of ('x,'f) ftrigger * ('x,'f) ftrigger * ('x,'f) ftrigger | TgFun of 'f * ('x,'f) ftrigger list | TgProp of 'f * ('x,'f) ftrigger list type ('t,'f,'c) ftypedef = | Tabs | Tdef of 't | Trec of ('f * 't) list | Tsum of ('c * 't list) list type scope = [ `Auto | `Unfolded | `Defined of string ] module type Env = sig type t type term val create : unit -> t val copy : t -> t val clear : t -> unit val used : t -> string -> bool val fresh : t -> sanitizer:('a -> string) -> ?suggest:bool -> 'a -> string val define : t -> string -> term -> unit val unfold : t -> term -> unit val shared : t -> term -> bool val shareable : t -> term -> bool val set_indexed_vars : t -> unit val iter : (string -> term -> unit) -> t -> unit end (** Generic Engine Signature *) class type virtual ['z,'adt,'field,'logic,'tau,'var,'term,'env] engine = object (** {3 Linking} *) method sanitize : string -> string method virtual datatype : 'adt -> string method virtual field : 'field -> string method virtual link : 'logic -> link (** {3 Global and Local Environment} *) method env : 'env (** Returns a fresh copy of the current environment. *) method set_env : 'env -> unit (** Set environment. *) method lookup : 'term -> scope (** Term scope in the current environment. *) method scope : 'env -> (unit -> unit) -> unit (** Calls the continuation in the provided environment. Previous environment is restored after return. *) method local : (unit -> unit) -> unit (** Calls the continuation in a local copy of the environment. Previous environment is restored after return, but allocators are left unchanged to enforce on-the-fly alpha-conversion. *) method global : (unit -> unit) -> unit (** Calls the continuation in a fresh local environment. Previous environment is restored after return. *) method bind : 'var -> string method find : 'var -> string (** {3 Types} *) method t_int : string method t_real : string method t_bool : string method t_prop : string method t_atomic : 'tau -> bool method pp_array : 'tau printer (** For [Z->a] arrays *) method pp_farray : 'tau printer2 (** For [k->a] arrays *) method pp_tvar : int printer (** Type variables. *) method pp_datatype : 'adt -> 'tau list printer method pp_tau : 'tau printer (** Without parentheses. *) method pp_subtau : 'tau printer (** With parentheses if non-atomic. *) (** {3 Current Mode} The mode represents the expected type for a term to printed. A requirement for all term printers in the engine is that current mode must be correctly set before call. Each term printer is then responsible for setting appropriate modes for its sub-terms. *) method mode : mode method with_mode : mode -> (mode -> unit) -> unit (** Calls the continuation with given mode for sub-terms. The englobing mode is passed to continuation and then restored. *) method op_scope : amode -> string option (** Optional scoping post-fix operator when entering arithmetic mode. *) (** {3 Primitives} *) method e_true : cmode -> string (** ["true"] *) method e_false : cmode -> string (** ["false"] *) method pp_int : amode -> 'z printer method pp_real : Q.t printer (** {3 Variables} *) method pp_var : string printer (** {3 Calls} These printers only applies to connective, operators and functions that are morphisms {i w.r.t} current mode. *) method callstyle : callstyle method pp_fun : cmode -> 'logic -> 'term list printer method pp_apply : cmode -> 'term -> 'term list printer (** {3 Arithmetics Operators} *) method op_real_of_int : op method op_add : amode -> op method op_sub : amode -> op method op_mul : amode -> op method op_div : amode -> op method op_mod : amode -> op method op_minus : amode -> op method pp_times : formatter -> 'z -> 'term -> unit (** Defaults to [self#op_minus] or [self#op_mul] *) (** {3 Comparison Operators} *) method op_equal : cmode -> op method op_noteq : cmode -> op method op_eq : cmode -> amode -> op method op_neq : cmode -> amode -> op method op_lt : cmode -> amode -> op method op_leq : cmode -> amode -> op method pp_equal : 'term printer2 method pp_noteq : 'term printer2 (** {3 Arrays} *) method pp_array_cst : formatter -> 'tau -> 'term -> unit (** Constant array ["[v...]"]. *) method pp_array_get : formatter -> 'term -> 'term -> unit (** Access ["a[k]"]. *) method pp_array_set : formatter -> 'term -> 'term -> 'term -> unit (** Update ["a[k <- v]"]. *) (** {3 Records} *) method pp_get_field : formatter -> 'term -> 'field -> unit (** Field access. *) method pp_def_fields : ('field * 'term) list printer (** Record construction. *) (** {3 Logical Connectives} *) method op_not : cmode -> op method op_and : cmode -> op method op_or : cmode -> op method op_imply : cmode -> op method op_equiv : cmode -> op (** {3 Conditionals} *) method pp_not : 'term printer method pp_imply : formatter -> 'term list -> 'term -> unit method pp_conditional : formatter -> 'term -> 'term -> 'term -> unit (** {3 Binders} *) method pp_forall : 'tau -> string list printer method pp_exists : 'tau -> string list printer method pp_lambda : (string * 'tau) list printer (** {3 Bindings} *) method shared : 'term -> bool method shareable : 'term -> bool method subterms : ('term -> unit) -> 'term -> unit method pp_let : formatter -> pmode -> string -> 'term -> unit (** {3 Terms} *) method is_atomic : 'term -> bool (** Sub-terms that require parentheses. Shared sub-terms are detected on behalf of this method. *) method pp_flow : 'term printer (** Printer with shared sub-terms printed with their name and without parentheses. *) method pp_atom : 'term printer (** Printer with shared sub-terms printed with their name and within parentheses for non-atomic expressions. Additional scope terminates the expression when required (typically for Coq). *) method pp_repr : 'term printer (** Raw representation of a term, as it is. This is where you should hook a printer to keep sharing, parentheses, and such. *) (** {3 Top Level} *) method pp_term : 'term printer (** Prints in {i term} mode. Default uses [self#pp_shared] with mode [Mterm] inside an [<hov>] box. *) method pp_prop : 'term printer (** Prints in {i prop} mode. Default uses [self#pp_shared] with mode [Mprop] inside an [<hv>] box. *) method pp_expr : 'tau -> 'term printer (** Prints in {i term}, {i arithmetic} or {i prop} mode with respect to provided type. *) method pp_sort : 'term printer (** Prints in {i term}, {i arithmetic} or {i prop} mode with respect to the sort of term. Boolean expression that also have a property form are printed in [Mprop] mode. *) end �����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export.ml������������������������������������������������������0000666�0000000�0000000�00000107326�13571573400�016120� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Exportation to Foreign Languages --- *) (* -------------------------------------------------------------------------- *) open Format open Logic open Plib open Engine let cmode = function | Mpositive | Mnegative -> Cprop | Mterm | Mterm_int | Mterm_real | Mint | Mreal -> Cterm let pmode = function | Mpositive -> Positive | Mnegative -> Negative | Mterm | Mterm_int | Mterm_real | Mint | Mreal -> Boolean let amode = function | Mpositive | Mnegative | Mterm | Mterm_int | Mint -> Aint | Mterm_real | Mreal -> Areal let smode = function | Sprop -> Mpositive | Sint -> Mterm_int | Sreal -> Mterm_real | Sbool | Sarray _ | Sdata -> Mterm let tmode = function | Prop -> Mpositive | Bool -> Mterm | Int -> Mterm_int | Real -> Mterm_real | Tvar _ | Array _ | Record _ | Data _ -> Mterm let ctau = function | Prop -> Cprop | _ -> Cterm let link_name = function | F_call f -> f | _ -> assert false (** Only normal function call F_call can be declared *) let debug = function | F_call f | F_left f | F_right f | F_bool_prop(_,f) | F_list(f,_) | F_subst f | F_assoc f -> f (* -------------------------------------------------------------------------- *) (* --- Identifiers --- *) (* -------------------------------------------------------------------------- *) let is_letter = function | '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' -> true | _ -> false let is_identifier op = try for i = 0 to String.length op - 1 do if not (is_letter op.[i]) then raise Exit done ; true with Exit -> false let sanitize ~to_lowercase base = let p = Buffer.create 32 in for i=0 to String.length base - 1 do let c = base.[i] in match c with | '0' .. '9' | 'a' .. 'z' | '_' -> Buffer.add_char p c | 'A' .. 'Z' -> Buffer.add_char p (if to_lowercase then Char.lowercase_ascii c else c) | _ -> () done ; Buffer.contents p (* -------------------------------------------------------------------------- *) (* --- Generic Engine --- *) (* -------------------------------------------------------------------------- *) module Make(T : Term) = struct open T type trigger = (var,Fun.t) ftrigger type typedef = (tau,Field.t,Fun.t) ftypedef (* -------------------------------------------------------------------------- *) (* --- Allocator --- *) (* -------------------------------------------------------------------------- *) module VarMap = Map.Make(T.Var) module Ident = Map.Make(String) module Users = Set.Make(String) type index = { mutable short : bool ; mutable index : int Ident.t ; mutable fvars : string VarMap.t ; mutable bvars : string Intmap.t ; mutable share : string Tmap.t ; mutable unzip : Tset.t ; mutable users : Users.t ; } let create_index () = { short = true ; index = Ident.empty ; fvars = VarMap.empty ; bvars = Intmap.empty ; share = Tmap.empty ; unzip = Tset.empty ; users = Users.empty ; } let clear_index lnk = begin lnk.index <- Ident.empty ; lnk.fvars <- VarMap.empty ; lnk.bvars <- Intmap.empty ; lnk.share <- Tmap.empty ; lnk.unzip <- Tset.empty ; lnk.users <- Users.empty ; end let copy_index lnk = { short = lnk.short ; index = lnk.index ; fvars = lnk.fvars ; bvars = lnk.bvars ; share = lnk.share ; unzip = lnk.unzip ; users = lnk.users ; } let rec find_fresh index sanitizer ~suggest basename k = let x = if k=0 && index.short && String.length basename = 1 then basename else Printf.sprintf "%s_%d" basename k in if Users.mem x index.users then find_fresh index sanitizer ~suggest basename (succ k) else ( if not suggest then index.index <- Ident.add basename (succ k) index.index ; x ) let fresh index sanitizer ?(suggest=false) basename = let basename = sanitizer basename in let k = try Ident.find basename index.index with Not_found -> 0 in find_fresh index sanitizer ~suggest basename k let bind_bvar k t index sanitizer = let x = fresh index sanitizer (Tau.basename t) in index.bvars <- Intmap.add k x index.bvars ; x let find_bvar k index = try Intmap.find k index.bvars with Not_found -> assert false let bind_fvar v index sanitizer = let x = fresh index sanitizer (Var.basename v) in index.fvars <- VarMap.add v x index.fvars ; x let find_fvar v index = try VarMap.find v index.fvars with Not_found -> Plib.sprintf "#{%a}" Var.pretty v let bind_term x t index = begin index.users <- Users.add x index.users ; index.share <- Tmap.add t x index.share ; end let unbind_term t index = begin (try let x = Tmap.find t index.share in index.users <- Users.remove x index.users ; index.share <- Tmap.remove t index.share ; with Not_found -> ()) ; index.unzip <- Tset.add t index.unzip ; end module Env = struct type t = index let create = create_index let copy index = copy_index index let clear index = clear_index index let used index name = Users.mem name index.users let fresh index ~sanitizer ?(suggest=false) basename = fresh index sanitizer ~suggest basename let define index x t = bind_term x t index let unfold index t = unbind_term t index let lookup index t = try `Defined(Tmap.find t index.share) with Not_found -> if Tset.mem t index.unzip then `Unfolded else `Auto let shared index t = Tmap.mem t index.share let shareable index t = not (Tset.mem t index.unzip) let set_indexed_vars index = index.short <- false let iter phi index = Tmap.iter (fun t x -> phi x t) index.share end (* -------------------------------------------------------------------------- *) (* --- Binders --- *) (* -------------------------------------------------------------------------- *) module TauMap = Map.Make(T.Tau) let add_var k t vars = let ks = try TauMap.find t vars with Not_found -> [] in TauMap.add t (k::ks) vars let rec binders q k vars e = match T.repr e with | Bind(q',t,e) when q'=q -> binders q (succ k) (add_var k t vars) (lc_repr e) | _ -> k,vars,e let rec lambda k kts e = match T.repr e with | Bind(Lambda,t,e) -> lambda (succ k) ((k,t)::kts) (lc_repr e) | _ -> k,List.rev kts,e let rec has_prop_form link e = match T.repr e with | Eq _ | Neq _ | Leq _ | Lt _ | Imply _ | And _ | Or _ | If _ | Bind((Forall|Exists),_,_) | True | False -> true | Not a -> has_prop_form link a | Fun(f,_) -> begin match link f with | F_bool_prop _ -> true | _ -> T.Fun.sort f = Sprop end | _ -> false (* -------------------------------------------------------------------------- *) (* --- Engine --- *) (* -------------------------------------------------------------------------- *) class virtual engine = object(self) val mutable index = create_index () method sanitize = sanitize ~to_lowercase:false method virtual datatype : ADT.t -> string method virtual field : Field.t -> string method lookup t : scope = Env.lookup index t method env = copy_index index method set_env env = index <- env method marks = let env = index (* NOT a fresh copy *) in let shared = Env.shared env in let shareable e = self#shareable e && Env.shareable env e in let subterms = self#subterms in let marks = T.marks ~shared ~shareable ~subterms () in env , marks method scope env (job : unit -> unit) = let stack = index in index <- env ; try job () ; index <- stack with err -> index <- stack ; raise err method local (job : unit -> unit) = self#scope (copy_index index) job method global (job : unit -> unit) = self#scope (create_index ()) job method bind v = bind_fvar v index self#sanitize method find v = VarMap.find v index.fvars (* -------------------------------------------------------------------------- *) (* --- Types --- *) (* -------------------------------------------------------------------------- *) method virtual t_int : string method virtual t_real : string method virtual t_bool : string method virtual t_prop : string method virtual t_atomic : tau -> bool method virtual pp_tvar : int printer method virtual pp_array : tau printer method virtual pp_farray : tau printer2 method virtual pp_datatype : ADT.t -> tau list printer method pp_subtau fmt t = if self#t_atomic t then self#pp_tau fmt t else fprintf fmt "@[<hov 1>(%a)@]" self#pp_tau t method pp_tau fmt = function | Int -> pp_print_string fmt self#t_int | Real -> pp_print_string fmt self#t_real | Bool -> pp_print_string fmt self#t_bool | Prop -> pp_print_string fmt self#t_prop | Array(Int,d) -> self#pp_array fmt d | Array(k,d) -> self#pp_farray fmt k d | Record _fts -> failwith "Qed.Export.record" | Tvar x -> self#pp_tvar fmt x | Data(adt,ts) -> self#pp_datatype adt fmt ts (* -------------------------------------------------------------------------- *) (* --- Mode --- *) (* -------------------------------------------------------------------------- *) val mutable mode = Mpositive method mode = mode method with_mode m f = let m0 = mode in if m = m0 then f m else try mode <- m ; f m0 ; mode <- m0 with err -> mode <- m0 ; raise err (* -------------------------------------------------------------------------- *) (* --- Variables --- *) (* -------------------------------------------------------------------------- *) method pp_var = Format.pp_print_string (* -------------------------------------------------------------------------- *) (* --- Atoms --- *) (* -------------------------------------------------------------------------- *) method virtual e_true : cmode -> string method virtual e_false : cmode -> string method virtual pp_int : amode -> Z.t printer method virtual pp_real : Q.t printer method virtual is_atomic : term -> bool (* -------------------------------------------------------------------------- *) (* --- Calls --- *) (* -------------------------------------------------------------------------- *) method virtual op_spaced : string -> bool method virtual callstyle : callstyle method virtual link : Fun.t -> link method private pp_call ~f fmt xs = match self#callstyle with | CallVar -> Plib.pp_call_var ~f self#pp_flow fmt xs | CallVoid -> Plib.pp_call_void ~f self#pp_flow fmt xs | CallApply -> Plib.pp_call_apply ~f self#pp_atom fmt xs method private pp_callsorts ~f fmt sorts xs = let pp_mode pp fmt (m,x) = self#with_mode m (fun _ -> pp fmt x) in let rec wrap sorts xs = match sorts , xs with | [] , _ -> List.map (fun x -> Mterm,x) xs | _ , [] -> [] | m::ms , x::xs -> (smode m,x)::(wrap ms xs) in let mxs = wrap sorts xs in match self#callstyle with | CallVar -> Plib.pp_call_var ~f (pp_mode self#pp_flow) fmt mxs | CallVoid -> Plib.pp_call_void ~f (pp_mode self#pp_flow) fmt mxs | CallApply -> Plib.pp_call_apply ~f (pp_mode self#pp_atom) fmt mxs method private pp_unop ~op fmt x = match op with | Assoc op | Op op -> if self#op_spaced op (*&& self#is_atomic x*) then fprintf fmt "%s %a" op self#pp_flow x else fprintf fmt "%s%a" op self#pp_atom x | Call f -> self#pp_call ~f fmt [x] method private pp_binop ~op fmt x y = match op with | Assoc op | Op op -> fprintf fmt "%a %s@ %a" self#pp_atom x op self#pp_atom y | Call f -> self#pp_call ~f fmt [x;y] method private pp_binop_term ~op fmt x y = self#with_mode Mterm (fun _old -> self#pp_binop ~op fmt x y) method private pp_nary ~op fmt xs = match op with | Assoc op -> Plib.pp_assoc ~op self#pp_atom fmt xs | Op op -> Plib.pp_fold_binop ~op self#pp_atom fmt xs | Call f -> match self#callstyle with | CallVar | CallVoid -> Plib.pp_fold_call ~f self#pp_flow fmt xs | CallApply -> Plib.pp_fold_apply ~f self#pp_atom fmt xs method pp_fun cmode fct fmt xs = match self#link fct, cmode with | F_call f, _ | F_bool_prop (f,_), Cterm | F_bool_prop (_,f), Cprop -> self#pp_callsorts ~f fmt (Fun.params fct) xs | F_assoc op, _ -> Plib.pp_assoc ~e:"?" ~op self#pp_atom fmt xs | F_left f, _ -> begin match self#callstyle with | CallVar | CallVoid -> Plib.pp_fold_call ~f self#pp_flow fmt xs | CallApply -> Plib.pp_fold_apply ~f self#pp_atom fmt xs end | F_right f, _ -> begin let xs = List.rev xs in match self#callstyle with | CallVar | CallVoid -> Plib.pp_fold_call_rev ~f self#pp_flow fmt xs | CallApply -> Plib.pp_fold_apply_rev ~f self#pp_atom fmt xs end | F_list(fc,fn), _ -> begin let rec plist w fmt xs = let style,fc,fn = w in match style , xs with | (CallVar|CallApply) , [] -> pp_print_string fmt fn | CallVoid , [] -> fprintf fmt "%s()" fn | (CallVar|CallVoid) , x::xs -> fprintf fmt "@[<hov 2>%s(@,%a,@,%a)@]" fc self#pp_flow x (plist w) xs | CallApply , x::xs -> fprintf fmt "@[<hov 2>(%s@ %a @ %a)@]" fc self#pp_atom x (plist w) xs in plist (self#callstyle,fc,fn) fmt xs end | F_subst s, _ -> let print = match self#callstyle with | CallVar | CallVoid -> self#pp_flow | CallApply -> self#pp_atom in Plib.substitute_list print s fmt xs method virtual pp_apply : cmode -> term -> term list printer (* -------------------------------------------------------------------------- *) (* --- Arithmetics Operators --- *) (* -------------------------------------------------------------------------- *) method virtual op_scope : amode -> string option method virtual op_real_of_int : op method virtual op_add : amode -> op method virtual op_sub : amode -> op method virtual op_mul : amode -> op method virtual op_div : amode -> op method virtual op_mod : amode -> op method virtual op_minus : amode -> op (* -------------------------------------------------------------------------- *) (* --- Comparisons --- *) (* -------------------------------------------------------------------------- *) method virtual op_equal : cmode -> op method virtual op_noteq : cmode -> op method virtual op_eq : cmode -> amode -> op method virtual op_neq : cmode -> amode -> op method virtual op_lt : cmode -> amode -> op method virtual op_leq : cmode -> amode -> op (* -------------------------------------------------------------------------- *) (* --- Arithmetics Printers --- *) (* -------------------------------------------------------------------------- *) method private pp_arith_arg flow fmt e = match T.repr e with | Kint _ | Kreal _ -> self#pp_atom fmt e | _ -> self#pp_arith_atom flow fmt e method private pp_arith_atom flow fmt e = if mode = Mreal && T.is_int e then self#with_mode Mint (fun _ -> match self#op_real_of_int with | Op op | Assoc op -> begin match flow with | Atom -> fprintf fmt "(%s %a)" op self#pp_atom e | Flow -> fprintf fmt "%s %a" op self#pp_atom e end | Call f -> begin match self#callstyle with | CallVar | CallVoid -> fprintf fmt "%s(%a)" f self#pp_flow e | CallApply -> match flow with | Atom -> fprintf fmt "(%s %a)" f self#pp_atom e | Flow -> fprintf fmt "%s %a" f self#pp_atom e end) else match flow with | Flow -> self#pp_flow fmt e | Atom -> self#pp_atom fmt e method private pp_arith_call ~f fmt xs = match self#callstyle with | CallVar -> Plib.pp_call_var ~f (self#pp_arith_arg Flow) fmt xs | CallVoid -> Plib.pp_call_void ~f (self#pp_arith_arg Flow) fmt xs | CallApply -> Plib.pp_call_apply ~f (self#pp_arith_arg Atom) fmt xs method private pp_arith_unop ~phi fmt a = self#with_mode (if T.is_real a then Mreal else Mint) begin fun _ -> match phi (amode mode) with | Assoc op | Op op -> if self#op_spaced op then fprintf fmt "%s %a" op (self#pp_arith_arg Atom) a else fprintf fmt "%s%a" op (self#pp_arith_arg Atom) a | Call f -> self#pp_arith_call ~f fmt [a] end method private pp_arith_binop ~phi fmt a b = self#with_mode (if T.is_real a || T.is_real b then Mreal else Mint) begin fun _ -> match phi (amode mode) with | Assoc op | Op op -> Plib.pp_binop ~op (self#pp_arith_arg Atom) fmt a b | Call f -> self#pp_arith_call ~f fmt [a;b] end method private pp_arith_nary ~phi fmt xs = self#with_mode (if List.exists T.is_real xs then Mreal else Mint) begin fun _ -> match phi (amode mode) with | Assoc op -> Plib.pp_assoc ~e:"?" ~op (self#pp_arith_arg Atom) fmt xs | Op op -> Plib.pp_fold_binop ~e:"?" ~op (self#pp_arith_arg Atom) fmt xs | Call f -> match self#callstyle with | CallVar | CallVoid -> Plib.pp_fold_call ~e:"?" ~f (self#pp_arith_arg Flow) fmt xs | CallApply -> Plib.pp_fold_apply ~e:"?" ~f (self#pp_arith_arg Atom) fmt xs end method private pp_arith_cmp ~phi fmt a b = let is_real = T.is_real a || T.is_real b in let amode = if is_real then Areal else Aint in let gmode = if is_real then Mreal else Mint in match phi (cmode mode) amode with | Assoc op | Op op -> self#with_mode gmode (fun emode -> let scope = match emode with | Mpositive | Mnegative | Mterm | Mterm_int | Mterm_real -> self#op_scope amode | Mint | Mreal -> None in match scope with | None -> begin fprintf fmt "@[<hov 2>" ; Plib.pp_binop ~op (self#pp_arith_arg Atom) fmt a b ; fprintf fmt "@]" ; end | Some s -> begin fprintf fmt "@[<hov 1>(" ; Plib.pp_binop ~op (self#pp_arith_arg Atom) fmt a b ; fprintf fmt ")%s@]" s ; end) | Call f -> begin fprintf fmt "@[<hov 2>" ; self#with_mode gmode (fun _ -> self#pp_arith_call ~f fmt [a;b]) ; fprintf fmt "@]" ; end method pp_times fmt k e = if Z.equal k Z.minus_one then self#pp_arith_unop ~phi:(self#op_minus) fmt e else self#pp_arith_binop ~phi:(self#op_mul) fmt (T.e_zint k) e (* -------------------------------------------------------------------------- *) (* --- Arrays --- *) (* -------------------------------------------------------------------------- *) method virtual pp_array_cst : formatter -> tau -> term -> unit method virtual pp_array_get : formatter -> term -> term -> unit method virtual pp_array_set : formatter -> term -> term -> term -> unit (* -------------------------------------------------------------------------- *) (* --- Records --- *) (* -------------------------------------------------------------------------- *) method virtual pp_get_field : formatter -> term -> Field.t -> unit method virtual pp_def_fields : record printer (* -------------------------------------------------------------------------- *) (* --- Logical Connectives --- *) (* -------------------------------------------------------------------------- *) method virtual op_not : cmode -> op method virtual op_and : cmode -> op method virtual op_or : cmode -> op method virtual op_imply : cmode -> op method virtual op_equiv : cmode -> op (* -------------------------------------------------------------------------- *) (* --- Polarity --- *) (* -------------------------------------------------------------------------- *) method pp_not fmt p = let pp = self#pp_unop ~op:(self#op_not (cmode mode)) in match mode with | Mpositive -> mode <- Mnegative ; pp fmt p ; mode <- Mpositive | Mnegative -> mode <- Mpositive ; pp fmt p ; mode <- Mnegative | _ -> pp fmt p method private pp_polarity pp fmt (inv,x) = match mode with | Mpositive when inv -> mode <- Mnegative ; pp fmt x ; mode <- Mpositive | Mnegative when inv -> mode <- Mpositive ; pp fmt x ; mode <- Mnegative | _ -> pp fmt x method pp_imply fmt hs p = let op = self#op_imply (cmode mode) in let pp_atom = self#pp_polarity self#pp_atom in let pp_flow = self#pp_polarity self#pp_flow in let xs = List.map (fun h -> true,h) hs @ [false,p] in match op with | Assoc op -> Plib.pp_assoc ~e:"?" ~op pp_atom fmt xs | Op op -> Plib.pp_fold_binop ~e:"?" ~op pp_atom fmt xs | Call f -> match self#callstyle with | CallVar | CallVoid -> Plib.pp_fold_call ~e:"?" ~f pp_flow fmt xs | CallApply -> Plib.pp_fold_apply ~e:"?" ~f pp_atom fmt xs (* -------------------------------------------------------------------------- *) (* --- Equality --- *) (* -------------------------------------------------------------------------- *) method pp_equal fmt a b = let cm = cmode mode in match Kind.merge (T.sort a) (T.sort b) with | Sprop | Sbool -> self#pp_binop ~op:(self#op_equiv cm) fmt a b | Sdata | Sarray _ -> self#pp_binop_term ~op:(self#op_equal cm) fmt a b | Sint | Sreal -> self#pp_arith_cmp ~phi:(self#op_eq) fmt a b method pp_noteq fmt a b = let cm = cmode mode in match Kind.merge (T.sort a) (T.sort b) with | Sprop | Sbool -> self#pp_unop ~op:(self#op_not cm) fmt (T.e_equiv a b) | Sdata | Sarray _ -> self#pp_binop_term ~op:(self#op_noteq cm) fmt a b | Sint | Sreal -> self#pp_arith_cmp ~phi:(self#op_neq) fmt a b (* -------------------------------------------------------------------------- *) (* --- Conditional --- *) (* -------------------------------------------------------------------------- *) method virtual pp_conditional : formatter -> term -> term -> term -> unit (* -------------------------------------------------------------------------- *) (* --- Quantifiers --- *) (* -------------------------------------------------------------------------- *) method virtual pp_forall : tau -> string list printer method virtual pp_exists : tau -> string list printer method virtual pp_lambda : (string * tau) list printer method private pp_binders fmt e = match T.repr e with | Bind(Lambda,t,e) -> let e = lc_repr e in let n,kts,e = lambda 1 [0,t] e in let last = Bvars.order (lc_vars e) + n - 1 in let binder (k,t) = bind_bvar (last-k) t index self#sanitize , t in let xts = List.map binder kts in self#pp_lambda fmt xts ; self#pp_binders fmt e | Bind((Forall|Exists) as q,t,e) -> let e = lc_repr e in let n,vars,e = binders q 1 (add_var 0 t TauMap.empty) e in let last = Bvars.order (lc_vars e) + n - 1 in TauMap.iter (fun t ks -> let binder k = bind_bvar (last-k) t index self#sanitize in let xs = List.fold_left (fun xs k -> binder k :: xs) [] ks in match q with | Forall -> fprintf fmt "%a@ " (self#pp_forall t) xs | Exists -> fprintf fmt "%a@ " (self#pp_exists t) xs | Lambda -> assert false ) vars ; self#pp_binders fmt e | _ -> self#pp_shared fmt e (* -------------------------------------------------------------------------- *) (* --- Sharing --- *) (* -------------------------------------------------------------------------- *) method shared (_ : term) = false method shareable e = match T.repr e with | Kint _ | Kreal _ | True | False -> false | Times _ | Add _ | Mul _ | Div _ | Mod _ -> true | Eq _ | Neq _ | Leq _ | Lt _ -> false | Acst _ -> false | Aget _ | Aset _ | Rget _ | Rdef _ -> true | And _ | Or _ | Not _ | Imply _ | If _ -> false | Fun _ -> not (T.is_prop e) | Bvar _ | Fvar _ | Apply _ | Bind _ -> false method subterms f e = match T.repr e with | Rdef fts -> begin match T.record_with fts with | None -> T.lc_iter f e | Some(a,fts) -> f a ; List.iter (fun (_,e) -> f e) fts end | _ -> T.lc_iter f e method virtual pp_let : Format.formatter -> pmode -> string -> term -> unit method private pp_shared fmt e = let shared e = Tmap.mem e index.share || self#shared e in let shareable e = self#shareable e && not (Tset.mem e index.unzip) in let subterms = self#subterms in let es = T.shared ~shareable ~shared ~subterms [e] in if es <> [] then self#local begin fun () -> let m0 = mode in let p0 = pmode m0 in List.iter (fun e -> let x = fresh index self#sanitize (T.basename e) in mode <- Mterm ; self#pp_let fmt p0 x e ; bind_term x e index ; ) es ; mode <- m0 ; self#pp_flow fmt e ; end else self#pp_flow fmt e (* -------------------------------------------------------------------------- *) (* --- Expressions --- *) (* -------------------------------------------------------------------------- *) method pp_atom fmt e = self#pp_bool self#pp_do_atom fmt e method pp_flow fmt e = self#pp_bool self#pp_do_flow fmt e method private op_scope_for e = match mode with | (Mpositive | Mnegative | Mterm) when T.is_int e -> self#op_scope Aint | (Mpositive | Mnegative | Mterm) when T.is_real e -> self#op_scope Areal | Mterm_int -> self#op_scope Aint | Mterm_real -> self#op_scope Areal | _ -> None method private pp_bool pp fmt e = if cmode mode = Cprop && not (has_prop_form self#link e) then match T.repr e with | Not a -> fprintf fmt "(%a=%s)" self#pp_do_atom a (self#e_false Cterm) | _ -> fprintf fmt "(%a=%s)" self#pp_do_atom e (self#e_true Cterm) else pp fmt e method private pp_do_atom fmt e = try self#pp_var fmt (Tmap.find e index.share) with Not_found -> if self#is_atomic e then self#pp_repr fmt e else fprintf fmt "@[<hov 1>(%a)@]" self#pp_repr e ; match self#op_scope_for e with | None -> () | Some s -> pp_print_string fmt s method private pp_do_flow fmt e = try self#pp_var fmt (Tmap.find e index.share) with Not_found -> match self#op_scope_for e with | None -> self#pp_repr fmt e | Some s -> fprintf fmt "@[<hov 1>(%a)%s@]" self#pp_repr e s method private pp_addition fmt xs = let amode = if List.exists T.is_real xs then Areal else Aint in match self#op_add amode , self#op_sub amode , self#op_minus amode with | Assoc add , Assoc sub , Op minus -> let factor x = match T.repr x with | Kint z when Z.lt z Z.zero-> (false,T.e_zint (Z.neg z)) | Kreal r when Q.lt r Q.zero -> (false,T.e_real (Q.neg r)) | Times(k,y) when Z.lt k Z.zero -> (false,T.e_times (Z.neg k) y) | _ -> (true,x) in let sxs = List.map factor xs in let sxs = List.stable_sort (fun (s1,e1) (s2,e2) -> match s1,s2 with | true,true | false,false -> Transitioning.Stdlib.compare (T.weigth e1) (T.weigth e2) | true,false -> (-1) | false,true -> 1 ) sxs in Plib.iteri (fun i (s,x) -> begin match i , s with | (Ifirst | Isingle) , false -> if self#op_spaced minus && self#is_atomic x then fprintf fmt "%s " minus else pp_print_string fmt minus | (Ifirst | Isingle) , true -> () | (Imiddle | Ilast) , true -> fprintf fmt "@ %s " add | (Imiddle | Ilast) , false -> fprintf fmt "@ %s " sub end ; self#pp_arith_arg Atom fmt x ) sxs | _ -> self#pp_arith_nary ~phi:(self#op_add) fmt xs method pp_repr fmt e = match T.repr e with | True -> pp_print_string fmt (self#e_true (cmode mode)) | False -> pp_print_string fmt (self#e_false (cmode mode)) | Fvar x -> self#pp_var fmt (find_fvar x index) | Bvar(k,_) -> self#pp_var fmt (find_bvar k index) | Not p -> self#pp_not fmt p | Kint x -> self#pp_int (amode mode) fmt x | Kreal x -> self#pp_real fmt x | Add xs -> self#pp_addition fmt xs | Mul xs -> self#pp_arith_nary ~phi:(self#op_mul) fmt xs | Div(a,b) -> self#pp_arith_binop ~phi:(self#op_div) fmt a b | Mod(a,b) -> self#pp_arith_binop ~phi:(self#op_mod) fmt a b | Times(k,a) -> self#pp_times fmt k a | Eq(a,b) -> self#pp_equal fmt a b | Neq(a,b) -> self#pp_noteq fmt a b | Lt(a,b) -> self#pp_arith_cmp ~phi:(self#op_lt) fmt a b | Leq(a,b) -> self#pp_arith_cmp ~phi:(self#op_leq) fmt a b | Acst(t,v) -> self#with_mode Mterm (fun _ -> self#pp_array_cst fmt t v) | Aget(a,k) -> self#with_mode Mterm (fun _ -> self#pp_array_get fmt a k) | Aset(a,k,v) -> self#with_mode Mterm (fun _ -> self#pp_array_set fmt a k v) | Rget(r,f) -> self#with_mode Mterm (fun _ -> self#pp_get_field fmt r f) | Rdef fts -> self#with_mode Mterm (fun _ -> self#pp_def_fields fmt fts) | If(a,b,c) -> self#pp_conditional fmt a b c | And ts -> self#pp_nary ~op:(self#op_and (cmode mode)) fmt ts | Or ts -> self#pp_nary ~op:(self#op_or (cmode mode)) fmt ts | Imply(hs,p) -> self#pp_imply fmt hs p | Apply(e,es) -> self#with_mode Mterm (fun em -> self#pp_apply (cmode em) e fmt es) | Fun(f,ts) -> self#with_mode Mterm (fun em -> self#pp_fun (cmode em) f fmt ts) | Bind _ -> self#local (fun () -> self#pp_binders fmt e) (* -------------------------------------------------------------------------- *) (* --- Formulae --- *) (* -------------------------------------------------------------------------- *) method private pp_expr_mode m fmt e = self#with_mode m (fun _old -> self#pp_shared fmt e) method pp_term = self#pp_expr_mode Mterm method pp_prop = self#pp_expr_mode Mpositive method pp_expr (tau:tau) = self#pp_expr_mode (tmode tau) method pp_sort fmt e = let mode = match T.sort e with | Sprop -> Mpositive | Sbool when has_prop_form self#link e -> Mpositive | Sint -> Mterm_int | Sreal -> Mterm_real | Sbool | Sdata | Sarray _ -> Mterm in self#pp_expr_mode mode fmt e end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export.mli�����������������������������������������������������0000666�0000000�0000000�00000014357�13571573400�016272� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Exportation to Foreign Languages --- *) (* -------------------------------------------------------------------------- *) (** Export Engine Factory *) open Format open Logic open Plib open Engine val cmode : mode -> cmode val amode : mode -> amode val pmode : mode -> pmode val tmode : ('a,'f) Logic.datatype -> mode val ctau : ('a,'f) Logic.datatype -> cmode val is_identifier : string -> bool val sanitize : to_lowercase:bool -> string -> string val debug : link -> string val link_name : link -> string module Make(T : Term) : sig open T module TauMap : Map.S with type key = tau module Env : Env with type term := term type trigger = (var,Fun.t) ftrigger type typedef = (tau,Field.t,Fun.t) ftypedef class virtual engine : object method sanitize : string -> string method virtual datatype : ADT.t -> string method virtual field : Field.t -> string method virtual link : Fun.t -> link method env : Env.t (** A safe copy of the environment *) method set_env : Env.t -> unit (** Set the environment *) method marks : Env.t * T.marks (** The current environment with empty marks *) method lookup : term -> scope method set_env : Env.t -> unit method scope : Env.t -> (unit -> unit) -> unit method local : (unit -> unit) -> unit method global : (unit -> unit) -> unit method bind : var -> string method find : var -> string method virtual t_int : string method virtual t_real : string method virtual t_bool : string method virtual t_prop : string method virtual t_atomic : tau -> bool method virtual pp_tvar : int printer method virtual pp_array : tau printer method virtual pp_farray : tau printer2 method virtual pp_datatype : ADT.t -> tau list printer method pp_subtau : tau printer method mode : mode method with_mode : mode -> (mode -> unit) -> unit method virtual e_true : cmode -> string method virtual e_false : cmode -> string method virtual pp_int : amode -> Z.t printer method virtual pp_real : Q.t printer method virtual is_atomic : term -> bool method virtual op_spaced : string -> bool method virtual callstyle : callstyle method virtual pp_apply : cmode -> term -> term list printer method pp_fun : cmode -> Fun.t -> term list printer method virtual op_scope : amode -> string option method virtual op_real_of_int : op method virtual op_add : amode -> op method virtual op_sub : amode -> op method virtual op_mul : amode -> op method virtual op_div : amode -> op method virtual op_mod : amode -> op method virtual op_minus : amode -> op method pp_times : formatter -> Z.t -> term -> unit method virtual op_equal : cmode -> op method virtual op_noteq : cmode -> op method virtual op_eq : cmode -> amode -> op method virtual op_neq : cmode -> amode -> op method virtual op_lt : cmode -> amode -> op method virtual op_leq : cmode -> amode -> op method virtual pp_array_cst : formatter -> tau -> term -> unit method virtual pp_array_get : formatter -> term -> term -> unit method virtual pp_array_set : formatter -> term -> term -> term -> unit method virtual pp_get_field : formatter -> term -> Field.t -> unit method virtual pp_def_fields : record printer method virtual op_not : cmode -> op method virtual op_and : cmode -> op method virtual op_or : cmode -> op method virtual op_imply : cmode -> op method virtual op_equiv : cmode -> op method pp_not : term printer method pp_imply : formatter -> term list -> term -> unit method pp_equal : term printer2 method pp_noteq : term printer2 method virtual pp_conditional : formatter -> term -> term -> term -> unit method virtual pp_forall : tau -> string list printer method virtual pp_exists : tau -> string list printer method virtual pp_lambda : (string * tau) list printer method shared : term -> bool method shareable : term -> bool method subterms : (term -> unit) -> term -> unit method virtual pp_let : formatter -> pmode -> string -> term -> unit method pp_atom : term printer method pp_flow : term printer method pp_repr : term printer method pp_tau : tau printer method pp_var : string printer method pp_term : term printer method pp_prop : term printer method pp_sort : term printer method pp_expr : tau -> term printer end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export_altergo.ml����������������������������������������������0000666�0000000�0000000�00000035661�13571573400�017637� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Exportation Engine for Alt-Ergo --- *) (* -------------------------------------------------------------------------- *) open Logic open Format open Plib open Engine open Export module Make(T : Term) = struct open T module E = Export_whycore.Make(T) module Env = E.Env module ADT = T.ADT module Field = T.Field module Fun = T.Fun type trigger = (T.var,Fun.t) ftrigger type typedef = (tau,Field.t,Fun.t) Engine.ftypedef class virtual engine = object(self) inherit E.engine (* -------------------------------------------------------------------------- *) (* --- Types --- *) (* -------------------------------------------------------------------------- *) method t_atomic (_:tau) = true method pp_array fmt data = fprintf fmt "%a farray" self#pp_tau data method pp_farray fmt key data = fprintf fmt "(%a,%a) farray" self#pp_tau key self#pp_tau data method virtual get_typedef : ADT.t -> tau option method virtual set_typedef : ADT.t -> tau -> unit method pp_datatype adt fmt ts = match self#get_typedef adt with | Some def -> let t = Kind.tmap (Array.of_list ts) def in self#pp_tau fmt t | None -> match ts with | [] -> pp_print_string fmt (self#datatype adt) | [t] -> fprintf fmt "%a@ %s" self#pp_tau t (self#datatype adt) | t::ts -> fprintf fmt "@[<hov 2>(%a" self#pp_tau t ; List.iter (fun t -> fprintf fmt ",@,%a" self#pp_tau t) ts ; fprintf fmt ")@ %s@]" (self#datatype adt) (* -------------------------------------------------------------------------- *) (* --- Primitives --- *) (* -------------------------------------------------------------------------- *) method callstyle = CallVar method pp_array_cst fmt (key : tau) v = try let elt = T.typeof v in let tau = Array(key,elt) in fprintf fmt "@[<hov 2>(const(%a)@ : %a)@]" self#pp_flow v self#pp_tau tau with Not_found -> fprintf fmt "const(%a)" self#pp_flow v (* -------------------------------------------------------------------------- *) (* --- Arithmetics --- *) (* -------------------------------------------------------------------------- *) method pp_int amode fmt z = match amode with | Aint -> pp_print_string fmt (Z.to_string z) | Areal -> fprintf fmt "%s.0" (Z.to_string z) method pp_real fmt r = if Z.equal r.Q.den Z.one then self#pp_int Areal fmt r.Q.num else fprintf fmt "(%a@ / %a)" (self#pp_int Areal) r.Q.num (self#pp_int Areal) r.Q.den method op_real_of_int = Call "real_of_int" method op_minus (_:amode) = Op "-" method op_add (_:amode) = Assoc "+" method op_sub (_:amode) = Assoc "-" method op_mul (_:amode) = Assoc "*" method op_div = function Aint -> Call "div" | Areal -> Op "/" method op_mod = function Aint -> Call "mod" | Areal -> Call "rmod" method op_eq cmode _amode = match cmode with | Cprop -> Op "=" | Cterm -> Call "eqb" method op_neq cmode _amode = match cmode with | Cprop -> Op "<>" | Cterm -> Call "neqb" method op_lt cmode amode = match cmode , amode with | Cprop , _ -> Op "<" | Cterm , Aint -> Call "zlt" | Cterm , Areal -> Call "rlt" method op_leq cmode amode = match cmode , amode with | Cprop , _ -> Op "<=" | Cterm , Aint -> Call "zleq" | Cterm , Areal -> Call "rleq" (* -------------------------------------------------------------------------- *) (* --- Logical Connectives --- *) (* -------------------------------------------------------------------------- *) method e_true _ = "true" method e_false _ = "false" method op_not = function Cprop -> Op "not" | Cterm -> Call "notb" method op_and = function Cprop -> Assoc "and" | Cterm -> Call "andb" method op_or = function Cprop -> Assoc "or" | Cterm -> Call "orb" method op_imply = function Cprop -> Assoc "->" | Cterm -> Call "implb" method op_equiv = function Cprop -> Op "<->" | Cterm -> Call "eqb" method op_equal = function Cprop -> Op "=" | Cterm -> Call "eqb" method op_noteq = function Cprop -> Op "<>" | Cterm -> Call "neqb" (* -------------------------------------------------------------------------- *) (* --- Conditional --- *) (* -------------------------------------------------------------------------- *) method pp_conditional fmt a b c = match Export.pmode self#mode with | Negative -> let cond = T.e_and [T.e_imply [a] b ; T.e_imply [T.e_not a] c] in self#pp_flow fmt cond | Positive -> let cond = T.e_or [T.e_and [a;b] ; T.e_and [T.e_not a;c]] in self#pp_flow fmt cond | Boolean -> begin fprintf fmt "@[<hov 2>match_bool(" ; self#with_mode Mterm (fun _ -> self#pp_atom fmt a) ; fprintf fmt ",@ %a" self#pp_atom b ; fprintf fmt ",@ %a" self#pp_atom c ; fprintf fmt ")@]" ; end (* -------------------------------------------------------------------------- *) (* --- Records --- *) (* -------------------------------------------------------------------------- *) method op_record = "{" , "}" (* -------------------------------------------------------------------------- *) (* --- Atomicity --- *) (* -------------------------------------------------------------------------- *) method op_spaced = is_identifier method is_atomic e = match T.repr e with | Kint z -> Z.leq Z.zero z | Kreal _ -> true | Apply _ -> true | Acst _ | Aset _ | Aget _ | Fun _ -> true | _ -> T.is_simple e (* -------------------------------------------------------------------------- *) (* --- Lets --- *) (* -------------------------------------------------------------------------- *) method typeof e = T.typeof e val mutable quantify_let = false method set_quantify_let e = quantify_let <- e method pp_let fmt pmode x e = try let tau = self#typeof e in match pmode with | Positive when quantify_let -> fprintf fmt "@[<hov 4>forall %s : %a. %s = %a ->@]@ " x self#pp_tau tau x self#pp_flow e | Negative when quantify_let -> fprintf fmt "@[<hov 4>exists %s : %a. %s = %a and@]@ " x self#pp_tau tau x self#pp_flow e | _ -> fprintf fmt "@[<hov 4>let %s = %a : %a in@]@ " x self#pp_atom e self#pp_tau tau with Not_found -> fprintf fmt "@[<hov 4>let %s = %a in@]@ " x self#pp_flow e (* -------------------------------------------------------------------------- *) (* --- Binders --- *) (* -------------------------------------------------------------------------- *) method pp_forall tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>forall %a" self#pp_var x ; List.iter (fun x -> fprintf fmt ",@,%a" self#pp_var x) xs ; fprintf fmt "@ : %a.@]" self#pp_tau tau ; method pp_intros tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>forall %a" self#pp_var x ; List.iter (fun x -> fprintf fmt ",@,%a" self#pp_var x) xs ; fprintf fmt "@ : %a@]" self#pp_tau tau ; method pp_exists tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>exists %a" self#pp_var x ; List.iter (fun x -> fprintf fmt ",@,%a" self#pp_var x) xs ; fprintf fmt "@ : %a.@]" self#pp_tau tau ; method pp_trigger fmt t = let rec pretty fmt = function | TgAny -> assert false | TgVar x -> self#pp_var fmt (self#find x) | TgGet(t,k) -> fprintf fmt "@[<hov 2>%a[%a]@]" pretty t pretty k | TgSet(t,k,v) -> fprintf fmt "@[<hov 2>%a[%a@ <- %a]@]" pretty t pretty k pretty v | TgFun(f,ts) -> call Cterm f fmt ts | TgProp(f,ts) -> call Cprop f fmt ts and call mode f fmt ts = match self#link f, mode with | F_call f, _ | F_bool_prop (f,_), Cterm | F_bool_prop (_,f), Cprop -> Plib.pp_call_var ~f pretty fmt ts | F_left f, _ -> Plib.pp_fold_call ~f pretty fmt ts | F_right f, _ -> Plib.pp_fold_call_rev ~f pretty fmt (List.rev ts) | F_assoc op, _ -> Plib.pp_assoc ~e:"?" ~op pretty fmt ts | F_subst s, _ -> Plib.substitute_list pretty s fmt ts | F_list(fc,fn) , _ -> let rec plist fc fn fmt = function | [] -> pp_print_string fmt fn | x::xs -> fprintf fmt "[<hov 2>%s(@,%a,@,%a)@]" fc pretty x (plist fc fn) xs in plist fc fn fmt ts in fprintf fmt "@[<hov 2>%a@]" pretty t method pp_goal fmt p = self#pp_prop fmt p (* -------------------------------------------------------------------------- *) (* --- Declarations --- *) (* -------------------------------------------------------------------------- *) method pp_declare_adt fmt adt = function | 0 -> fprintf fmt "type %s" (self#datatype adt) | 1 -> fprintf fmt "type %a %s" self#pp_tvar 1 (self#datatype adt) | n -> begin fprintf fmt "type (%a" self#pp_tvar 1 ; for i=2 to n do fprintf fmt ",%a" self#pp_tvar i done ; fprintf fmt ") %s" (self#datatype adt) ; end method pp_declare_def fmt adt n def = begin fprintf fmt "(* @[<hov 4>inlined type " ; self#pp_declare_adt fmt adt n ; fprintf fmt "@ = %a@] *)" self#pp_tau def ; self#set_typedef adt def ; end method pp_declare_sum fmt adt n cases = let is_enum = function (_,[]) -> true | _ -> false in if List.for_all is_enum cases then begin fprintf fmt "@[<hov 4>" ; self#pp_declare_adt fmt adt n ; Plib.iteri (fun index (c,_) -> match index with | Ifirst | Isingle -> fprintf fmt " = %s" (link_name (self#link c)) | Imiddle | Ilast -> fprintf fmt "@ | %s" (link_name (self#link c)) ) cases ; fprintf fmt "@]" end else begin self#pp_declare_adt fmt adt n ; pp_print_newline fmt () ; let result = Data(adt,Kind.type_params n) in List.iter (fun (c,ts) -> self#declare_signature fmt c ts result ) cases ; let rank = "rank_" ^ self#datatype adt in fprintf fmt "logic %s : %a -> int@\n" rank self#pp_tau result ; Plib.iterk (fun k (c,ts) -> fprintf fmt "@[<hov 2>axiom %s_%d:@ " rank k ; let xs = Plib.mapk (fun k t -> fprintf fmt "forall x%d:%a.@ " k self#pp_tau t ; Printf.sprintf "x%d" k) ts in let f = link_name (self#link c) in fprintf fmt "%s(%a)=%d@]@\n" rank (Plib.pp_call_var ~f pp_print_string) xs k ) cases ; end method declare_signature fmt f ts t = begin fprintf fmt "@[<hv 4>logic %s :@ " (link_name (self#link f)) ; if ts <> [] then begin Plib.pp_listcompact ~sep:"," self#pp_tau fmt ts ; fprintf fmt "@ -> " ; end ; fprintf fmt "%a@]@\n" self#pp_tau t end method declare_definition fmt f xs t e = self#global begin fun () -> let cmode = Export.ctau t in fprintf fmt "@[<hv 4>%a@,(" (self#pp_declare_symbol cmode) f ; Plib.pp_listsep ~sep:"," (fun fmt x -> let a = self#bind x in let t = T.tau_of_var x in fprintf fmt "%a:%a" self#pp_var a self#pp_tau t ) fmt xs ; match cmode with | Cprop -> fprintf fmt ") =@ @[<hov 0>%a@]@]@\n" self#pp_prop e | Cterm -> fprintf fmt ") :@ %a =@ @[<hov 0>%a@]@]@\n" self#pp_tau t (self#pp_expr t) e end end end �������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export_altergo.mli���������������������������������������������0000666�0000000�0000000�00000006653�13571573400�020007� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Logic open Format open Plib open Engine (** Exportation Engine for Alt-Ergo. Provides a full {{:Export.S.engine-c.html}engine} from a {{:Export.S.linker-c.html}linker}. *) module Make(T : Term) : sig open T module Env : Engine.Env with type term := term type trigger = (T.var,Fun.t) Engine.ftrigger type typedef = (tau,Field.t,Fun.t) Engine.ftypedef class virtual engine : object method set_quantify_let : bool -> unit method virtual get_typedef : ADT.t -> tau option method virtual set_typedef : ADT.t -> tau -> unit method typeof : term -> tau (** Defaults to T.typeof *) inherit [Z.t,ADT.t,Field.t,Fun.t,tau,var,term,Env.t] Engine.engine method marks : Env.t * T.marks method op_spaced : string -> bool method op_record : string * string method pp_forall : tau -> string list printer method pp_intros : tau -> string list printer method pp_exists : tau -> string list printer method pp_param : (string * tau) printer method pp_trigger : (var,Fun.t) ftrigger printer method pp_declare_symbol : cmode -> Fun.t printer method pp_declare_adt : formatter -> ADT.t -> int -> unit method pp_declare_def : formatter -> ADT.t -> int -> tau -> unit method pp_declare_sum : formatter -> ADT.t -> int -> (Fun.t * tau list) list -> unit method pp_goal : formatter -> term -> unit method declare_type : formatter -> ADT.t -> int -> typedef -> unit method declare_prop : kind:string -> formatter -> string -> T.var list -> trigger list list -> term -> unit method declare_axiom : formatter -> string -> var list -> trigger list list -> term -> unit method declare_signature : formatter -> Fun.t -> tau list -> tau -> unit method declare_definition : formatter -> Fun.t -> var list -> tau -> term -> unit end end �������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export_coq.ml��������������������������������������������������0000666�0000000�0000000�00000035611�13571573400�016757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Exportation Engine for Coq --- *) (* -------------------------------------------------------------------------- *) open Logic open Format open Plib open Engine open Export module Make(T : Term) = struct module T = T module E = Export.Make(T) module Env = E.Env open T type tau = (Field.t,ADT.t) datatype type trigger = (var,Fun.t) ftrigger type typedef = (tau,Field.t,Fun.t) ftypedef class virtual engine = object(self) inherit E.engine (* -------------------------------------------------------------------------- *) (* --- Types --- *) (* -------------------------------------------------------------------------- *) method t_int = "Z" method t_real = "R" method t_bool = "bool" method t_prop = "Prop" method t_atomic = function | Int | Real | Bool | Prop | Tvar _ -> true | Array _ -> false | Data(_,[]) -> true | Data _ -> false | Record _ -> true method pp_array fmt t = fprintf fmt "array %a" self#pp_subtau t method pp_farray fmt a b = fprintf fmt "farray %a %a" self#pp_subtau a self#pp_subtau b method pp_tvar fmt k = if 1 <= k && k <= 26 then let c = int_of_char 'A' + (k-1) in pp_print_char fmt (char_of_int c) else fprintf fmt "A%d" k method virtual datatype : T.ADT.t -> string method pp_datatype adt fmt = function | [] -> pp_print_string fmt (self#datatype adt) | ts -> Plib.pp_call_apply ~f:(self#datatype adt) self#pp_subtau fmt ts (* -------------------------------------------------------------------------- *) (* --- Primitives --- *) (* -------------------------------------------------------------------------- *) method callstyle = CallApply method op_scope = function Aint -> Some "%Z" | Areal -> Some "%R" method pp_int _amode fmt z = pp_print_string fmt (Z.to_string z) method pp_real fmt q = fprintf fmt "( %s / %s )%%R" (Z.to_string q.Q.num) (Z.to_string q.Q.den) method e_true = function Cterm -> "true" | Cprop -> "True" method e_false = function Cterm -> "false" | Cprop -> "False" (* -------------------------------------------------------------------------- *) (* --- Arithmetics --- *) (* -------------------------------------------------------------------------- *) method op_add (_:amode) = Assoc "+" method op_sub (_:amode) = Assoc "-" method op_mul (_:amode) = Assoc "*" method op_div = function Aint -> Call "Cdiv" | Areal -> Call "Rdiv" method op_mod = function Aint -> Call "Cmod" | Areal -> Call "Rmod" method op_minus (_:amode) = Op "-" method op_real_of_int = Call "IZR" method op_eq (c:cmode) (a:amode) = match c , a with | Cprop , _ -> Op "=" | Cterm , Aint -> Call "Zeq_bool" | Cterm , Areal -> Call "Req_bool" method op_neq (c:cmode) (a:amode) = match c , a with | Cprop , _ -> Op "<>" | Cterm , Aint -> Call "Zneq_bool" | Cterm , Areal -> Call "Rneq_bool" method op_lt (c:cmode) (a:amode) = match c , a with | Cprop , _ -> Op "<" | Cterm , Aint -> Call "Zlt_bool" | Cterm , Areal -> Call "Rlt_bool" method op_leq (c:cmode) (a:amode) = match c , a with | Cprop , _ -> Op "<=" | Cterm , Aint -> Call "Zle_bool" | Cterm , Areal -> Call "Rle_bool" (* -------------------------------------------------------------------------- *) (* --- Connectives --- *) (* -------------------------------------------------------------------------- *) method op_not = function Cterm -> Call "negb" | Cprop -> Op "~" method op_or = function Cterm -> Call "orb" | Cprop -> Assoc "\\/" method op_and = function Cterm -> Call "andb" | Cprop -> Assoc "/\\" method op_imply = function Cterm -> Call "implb" | Cprop -> Assoc "->" method op_equiv = function Cterm -> Call "eqb" | Cprop -> Op "<->" method op_equal = function Cterm -> Call "Aeq_bool" | Cprop -> Op "=" method op_noteq = function Cterm -> Call "Aneq_bool" | Cprop -> Op "<>" (* -------------------------------------------------------------------------- *) (* --- Conditional --- *) (* -------------------------------------------------------------------------- *) method pp_conditional fmt a b c = match Export.pmode self#mode with | Negative -> begin fprintf fmt "branch@ %a@ %a@ %a" self#pp_atom a self#pp_atom b self#pp_atom c ; end | Positive -> begin fprintf fmt "itep@ %a@ %a@ %a" self#pp_atom a self#pp_atom b self#pp_atom c ; end | Boolean -> begin fprintf fmt "@[<hov 0>if " ; self#with_mode Mterm (fun _ -> self#pp_atom fmt a) ; fprintf fmt "@ then %a" self#pp_atom b ; fprintf fmt "@ else %a" self#pp_atom c ; fprintf fmt "@]" ; end (* -------------------------------------------------------------------------- *) (* --- Arrays --- *) (* -------------------------------------------------------------------------- *) method pp_array_cst fmt k v = let pp_domain fmt v = try self#pp_tau fmt (T.typeof v) with Not_found -> pp_print_string fmt "_" in fprintf fmt "@[<hov 2>(const@ %a :@ farray@ %a@ %a)@]" self#pp_atom v self#pp_tau k pp_domain v method pp_array_get fmt m k = fprintf fmt "%a.[ %a ]" self#pp_atom m self#pp_flow k method pp_array_set fmt m k v = fprintf fmt "%a.[ %a <- %a ]" self#pp_atom m self#pp_flow k self#pp_flow v (* -------------------------------------------------------------------------- *) (* --- Records --- *) (* -------------------------------------------------------------------------- *) method virtual field : T.Field.t -> string method pp_get_field fmt r f = fprintf fmt "%s@ %a" (self#field f) self#pp_atom r method pp_def_fields fmt fvs = begin fprintf fmt "@[<hov 2>{|" ; Plib.iteri (fun i (f,v) -> match i with | Ifirst | Imiddle -> fprintf fmt "@ @[<hov 2>%s := %a ;@]" (self#field f) self#pp_flow v | Isingle | Ilast -> fprintf fmt "@[<hov 2>%s := %a@]" (self#field f) self#pp_flow v ) fvs ; fprintf fmt "@ |}@]" ; end (* -------------------------------------------------------------------------- *) (* --- Atomicity --- *) (* -------------------------------------------------------------------------- *) method op_spaced = is_identifier method is_atomic e = match T.repr e with | Kint z -> Z.leq Z.zero z | Kreal _ -> true | Apply(_,[]) | Rdef _ -> true | Apply _ | Acst _ | Aset _ | Aget _ | Rget _ -> false | Eq _ | Neq _ | Lt _ | Leq _ | And _ | Or _ | Imply _ | Bind _ | Fun _ | If _ -> false | _ -> T.is_simple e method pp_let fmt (_:pmode) x e = fprintf fmt "@[<hov 4>let %s := %a in@]@ " x self#pp_flow e (* -------------------------------------------------------------------------- *) (* --- Higher Order --- *) (* -------------------------------------------------------------------------- *) method pp_apply _cmode e fmt es = begin fprintf fmt "@[<hov 3>(%a" self#pp_atom e ; List.iter (fun a -> fprintf fmt "@ %a" self#pp_atom a) es ; fprintf fmt ")@]" end method private pp_param fmt (x,t) = fprintf fmt "(%a : %a)" self#pp_var x self#pp_tau t method pp_forall tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>forall (%a" self#pp_var x ; List.iter (fun y -> fprintf fmt "@ %a" self#pp_var y) xs ; fprintf fmt "@ : %a),@]" self#pp_tau tau method pp_exists tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>exists %a : %a@]," self#pp_var x self#pp_tau tau ; List.iter (fun x -> fprintf fmt "@ @[<hov 2>exists %a : %a@]," self#pp_var x self#pp_tau tau) xs method pp_lambda fmt xs = Plib.iteri (fun i x -> match i with | Isingle -> fprintf fmt "@[<hov 2>fun %a =>@]@ " self#pp_param x | Ifirst -> fprintf fmt "@[<hov 2>fun %a" self#pp_param x | Imiddle -> fprintf fmt "@ %a" self#pp_param x | Ilast -> fprintf fmt "@ %a =>@]@ " self#pp_param x ) xs (* -------------------------------------------------------------------------- *) (* --- Declarations --- *) (* -------------------------------------------------------------------------- *) method private pp_declare_poly fmt n = if n > 0 then begin fprintf fmt " (" ; for i=1 to n do fprintf fmt "%a " self#pp_tvar i done ; fprintf fmt " : Type)" ; end ; method declare_type fmt adt n = function | Tabs -> begin fprintf fmt "Parameter %s" (self#datatype adt) ; self#pp_declare_poly fmt n ; fprintf fmt " : Type.@\n" end | Tdef def -> begin fprintf fmt "@[<hov 2>Definition %s" (self#datatype adt) ; self#pp_declare_poly fmt n ; fprintf fmt " : Type :=@ %a@].@\n" self#pp_tau def ; end | Trec fts -> begin fprintf fmt "@[<hv 0>Record %s" (self#datatype adt) ; self#pp_declare_poly fmt n ; fprintf fmt " : Type := {@[<hv 2>" ; Plib.iteri (fun idx (f,t) -> match idx with | Ifirst | Imiddle -> fprintf fmt "@ %s : %a ;" (self#field f) self#pp_tau t | Isingle | Ilast -> fprintf fmt "@ %s : %a" (self#field f) self#pp_tau t ) fts ; fprintf fmt "@]@ }@].@\n" ; end | Tsum cases -> begin fprintf fmt "@[<hv 0>Inductive %s" (self#datatype adt) ; self#pp_declare_poly fmt n ; fprintf fmt " : Type :=" ; let result = Data(adt,Kind.type_params n) in List.iter (fun (c,ts) -> fprintf fmt "@ | @[<hov 2>%s : " (link_name (self#link c)) ; List.iter (fun t -> fprintf fmt "@ %a ->" self#pp_tau t) ts ; fprintf fmt "@ %a@]" self#pp_tau result ; ) cases ; fprintf fmt ".@]@\n" ; end method declare_signature fmt f ts t = begin fprintf fmt "@[<hov 4>Parameter %s :" (link_name (self#link f)) ; List.iter (fun t -> fprintf fmt "@ %a ->" self#pp_tau t) ts ; fprintf fmt "@ %a.@]@\n" self#pp_tau t ; end method declare_inductive fmt f ts t l = begin fprintf fmt "@[<hov 4>Inductive %s :" (link_name (self#link f)) ; List.iter (fun t -> fprintf fmt "@ %a ->" self#pp_tau t) ts ; fprintf fmt "@ %a :=" self#pp_tau t ; List.iter (fun (lemma,xs,(_:trigger list list),p) -> fprintf fmt "@ | @[<hov 2>%s: %a@]" lemma self#pp_prop (T.e_forall xs p) ) l ; fprintf fmt ".@]@\n" end method declare_definition fmt f xs t e = self#global begin fun () -> fprintf fmt "@[<hov 4>Definition %s" (link_name (self#link f)) ; List.iter (fun x -> let a = self#bind x in let t = T.tau_of_var x in fprintf fmt "@ (%a : %a)" self#pp_var a self#pp_tau t ) xs ; fprintf fmt "@ : %a :=@ " self#pp_tau t ; fprintf fmt "@[<hov 2>%a@]@].@\n" (self#pp_expr t) e ; end method declare_fixpoint ~prefix fmt f xs t e = begin self#declare_signature fmt f (List.map tau_of_var xs) t ; let fix = prefix ^ (link_name (self#link f)) in self#declare_axiom fmt fix xs [] (e_eq (e_fun f (List.map e_var xs)) e) ; end method declare_axiom fmt lemma xs (_:trigger list list) p = self#global begin fun () -> fprintf fmt "@[<hov 2>Hypothesis %s: %a@].@\n" lemma self#pp_prop (T.e_forall xs p) end end end �����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export_coq.mli�������������������������������������������������0000666�0000000�0000000�00000005263�13571573400�017130� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Logic open Format (** Exportation Engine for Coq. Provides a full {{:Export.S.engine-c.html}engine} from a {{:Export.S.linker-c.html}linker}. *) module Make(T : Term) : sig open T module Env : Engine.Env with type term := term type trigger = (var,Fun.t) Engine.ftrigger type typedef = (tau,Field.t,Fun.t) Engine.ftypedef class virtual engine : object inherit [Z.t,ADT.t,Field.t,Fun.t,tau,var,term,Env.t] Engine.engine method marks : Env.t * T.marks method op_spaced : string -> bool method declare_type : formatter -> ADT.t -> int -> typedef -> unit method declare_axiom : formatter -> string -> var list -> trigger list list -> term -> unit method declare_fixpoint : prefix:string -> formatter -> Fun.t -> var list -> tau -> term -> unit method declare_signature : formatter -> Fun.t -> tau list -> tau -> unit method declare_inductive : formatter -> Fun.t -> tau list -> tau -> (string * var list * trigger list list * term) list -> unit method declare_definition : formatter -> Fun.t -> var list -> tau -> term -> unit end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export_why3.ml�������������������������������������������������0000666�0000000�0000000�00000031262�13571573400�017065� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Exportation Engine for Why-3 --- *) (* -------------------------------------------------------------------------- *) open Logic open Format open Export open Engine module Make(T : Term) = struct module T = T module E = Export_whycore.Make(T) module Env = E.Env open T type tau = (Field.t,ADT.t) datatype type trigger = (var,Fun.t) ftrigger type typedef = (tau,Field.t,Fun.t) ftypedef class virtual engine = object(self) inherit E.engine as super method! sanitize = Export.sanitize ~to_lowercase:true (* -------------------------------------------------------------------------- *) (* --- Types --- *) (* -------------------------------------------------------------------------- *) method! pp_tau fmt = function | Prop -> assert false (* prop should never be printed *) | x -> super#pp_tau fmt x method t_atomic = function | Int | Real | Bool | Prop | Tvar _ -> true | Array _ -> false | Data(_,[]) -> true | Data _ -> false | Record _ -> true method pp_farray fmt a b = fprintf fmt "map %a %a" self#pp_subtau a self#pp_subtau b method pp_array fmt b = fprintf fmt "map int %a" self#pp_subtau b method pp_datatype adt fmt = function | [] -> pp_print_string fmt (self#datatype adt) | ts -> Plib.pp_call_apply ~f:(self#datatype adt) self#pp_subtau fmt ts (* -------------------------------------------------------------------------- *) (* --- Primitives --- *) (* -------------------------------------------------------------------------- *) method callstyle = CallApply method op_spaced (_:string) = true method pp_array_cst fmt (key : tau) v = try let elt = T.typeof v in let tau = Array(key,elt) in fprintf fmt "@[<hov 2>(const@ %a@ : %a)@]" self#pp_atom v self#pp_tau tau with Not_found -> fprintf fmt "@[<hov 2>(const@ %a)@]" self#pp_atom v (* -------------------------------------------------------------------------- *) (* --- Arithmetics --- *) (* -------------------------------------------------------------------------- *) method pp_int amode fmt k = match amode with | Aint -> pp_print_string fmt (Z.to_string k) | Areal -> if Z.lt k Z.zero then (* unary minus is -. instead of - in Why3... *) fprintf fmt "-.%s.0" (Z.to_string (Z.neg k)) else fprintf fmt "%s.0" (Z.to_string k) method pp_real fmt r = if Z.equal r.Q.den Z.one then self#pp_int Areal fmt r.Q.num else fprintf fmt "(%a@ /. %a)" (self#pp_int Areal) r.Q.num (self#pp_int Areal) r.Q.den method op_real_of_int = Call "real_of_int" method op_add = function Aint -> Assoc "+" | Areal -> Assoc "+." method op_sub = function Aint -> Assoc "-" | Areal -> Assoc "-." method op_mul = function Aint -> Assoc "*" | Areal -> Assoc "*." method op_div = function Aint -> Call "div" | Areal -> Op "/." method op_mod = function Aint -> Call "mod" | Areal -> Call "rmod" method op_minus = function Aint -> Op "-" | Areal -> Op "-." method op_eq cmode (_:amode) = match cmode with | Cprop -> Op "=" | Cterm -> Call "eqb" method op_neq cmode (_:amode) = match cmode with | Cprop -> Op "<>" | Cterm -> Call "neqb" method op_lt cmode amode = match cmode , amode with | Cprop , Aint -> Op "<" | Cprop , Areal -> Op "<." | Cterm , Aint -> Call "zlt" | Cterm , Areal -> Call "rlt" method op_leq cmode amode = match cmode , amode with | Cprop , Aint -> Op "<=" | Cprop , Areal -> Op "<=." | Cterm , Aint -> Call "zleq" | Cterm , Areal -> Call "rleq" (* -------------------------------------------------------------------------- *) (* --- Logical Connectives --- *) (* -------------------------------------------------------------------------- *) method e_true = function Cterm -> "True" | Cprop -> "true" method e_false = function Cterm -> "False" | Cprop -> "false" method op_equal = function Cterm -> Call "eqb" | Cprop -> Op "=" method op_noteq = function Cterm -> Call "neqb" | Cprop -> Op "<>" method op_not = function Cprop -> Op "not" | Cterm -> Call "notb" method op_and = function Cprop -> Assoc "/\\" | Cterm -> Call "andb" method op_or = function Cprop -> Assoc "\\/" | Cterm -> Call "orb" method op_imply = function Cprop -> Assoc "->" | Cterm -> Call "implb" method op_equiv = function Cprop -> Op "<->" | Cterm -> Op "=" (* -------------------------------------------------------------------------- *) (* --- Conditional --- *) (* -------------------------------------------------------------------------- *) method pp_conditional fmt a b c = begin fprintf fmt "@[<hov 0>if " ; self#with_mode Mpositive (fun _ -> self#pp_atom fmt a) ; fprintf fmt "@ then %a" self#pp_atom b ; fprintf fmt "@ else %a" self#pp_atom c ; fprintf fmt "@]" ; end (* -------------------------------------------------------------------------- *) (* --- Atomicity --- *) (* -------------------------------------------------------------------------- *) method is_atomic e = match T.repr e with | Kint z -> Z.leq Z.zero z | Apply(_,[]) -> false | Apply _ -> true | Acst _ | Aset _ | Aget _ -> true | _ -> T.is_simple e (* -------------------------------------------------------------------------- *) (* --- Records --- *) (* -------------------------------------------------------------------------- *) method op_record = "{" , "}" (* -------------------------------------------------------------------------- *) (* --- Binders --- *) (* -------------------------------------------------------------------------- *) method pp_let fmt (_:pmode) x e = fprintf fmt "@[<hov 4>let %s = %a in@]@ " x self#pp_flow e method pp_forall tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>forall %a" self#pp_var x ; List.iter (fun x -> fprintf fmt "@ %a" self#pp_var x) xs ; fprintf fmt "@ : %a.@]" self#pp_tau tau ; method pp_intros tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>forall %a" self#pp_var x ; List.iter (fun x -> fprintf fmt "@ %a" self#pp_var x) xs ; fprintf fmt "@ : %a@]" self#pp_tau tau ; method pp_exists tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>exists %a" self#pp_var x ; List.iter (fun x -> fprintf fmt "@ %a" self#pp_var x) xs ; fprintf fmt "@ : %a.@]" self#pp_tau tau ; method pp_trigger fmt t = let rec pretty fmt = function | TgAny -> assert false | TgVar x -> self#pp_var fmt (self#find x) | TgGet(t,k) -> fprintf fmt "@[<hov 2>%a[%a]@]" pretty t pretty k | TgSet(t,k,v) -> fprintf fmt "@[<hov 2>%a[%a@ <- %a]@]" pretty t pretty k pretty v | TgFun(f,ts) -> call Cterm f fmt ts | TgProp(f,ts) -> call Cprop f fmt ts and call mode f fmt ts = match self#link f, mode with | F_call f, _ | F_bool_prop (f,_), Cterm | F_bool_prop (_,f), Cprop -> Plib.pp_call_apply ~f pretty fmt ts | F_left f, _ -> Plib.pp_fold_apply ~f pretty fmt ts | F_right f, _ -> Plib.pp_fold_apply_rev ~f pretty fmt (List.rev ts) | F_assoc op, _ -> Plib.pp_assoc ~op pretty fmt ts | F_subst s, _ -> Plib.substitute_list pretty s fmt ts | F_list(fc,fn) , _ -> let rec plist fc fn fmt = function | [] -> pp_print_string fmt fn | x::xs -> fprintf fmt "[<hov 2>(%s@ %a@ %a)@]" fc pretty x (plist fc fn) xs in plist fc fn fmt ts in fprintf fmt "@[<hov 2>%a@]" pretty t (* -------------------------------------------------------------------------- *) (* --- Declarations --- *) (* -------------------------------------------------------------------------- *) method pp_declare_adt fmt adt n = begin fprintf fmt "type %s" (self#datatype adt) ; for i=1 to n do self#pp_tvar fmt i done ; end method pp_declare_def fmt adt n def = begin fprintf fmt "@[<hov 4>" ; self#pp_declare_adt fmt adt n ; fprintf fmt "@ = %a@]" self#pp_tau def ; end method pp_declare_sum fmt adt n cases = begin fprintf fmt "@[<hv 1>" ; self#pp_declare_adt fmt adt n ; List.iter (fun (c,ts) -> fprintf fmt "@ @[<hov 4>| %s@]" (link_name (self#link c)) ; List.iter (fun t -> fprintf fmt "@ %a" self#pp_tau t) ts ; ) cases ; fprintf fmt "@]" end method declare_signature fmt f ts t = begin let cmode = Export.ctau t in fprintf fmt "@[<hov 4>%a" (self#pp_declare_symbol cmode) f ; List.iter (fun t -> fprintf fmt "@ %a" self#pp_subtau t) ts ; match t with | Prop -> fprintf fmt "@]@\n" | _ -> fprintf fmt "@ : %a@]@\n" self#pp_tau t ; end method declare_definition fmt f xs t e = self#global begin fun () -> let cmode = Export.ctau t in fprintf fmt "@[<hov 4>%a" (self#pp_declare_symbol cmode) f ; List.iter (fun x -> let a = self#bind x in let t = T.tau_of_var x in fprintf fmt "@ (%a : %a)" self#pp_var a self#pp_tau t ) xs ; match cmode with | Cprop -> fprintf fmt " =@ @[<hov 0>%a@]@]@\n" self#pp_prop e | Cterm -> fprintf fmt " : %a =@ @[<hov 0>%a@]@]@\n" self#pp_tau t (self#pp_expr t) e end method declare_fixpoint ~prefix fmt f xs t e = begin self#declare_signature fmt f (List.map tau_of_var xs) t ; let fix = prefix ^ (link_name (self#link f)) in self#declare_axiom fmt fix xs [] (e_eq (e_fun f (List.map e_var xs)) e) ; end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export_why3.mli������������������������������������������������0000666�0000000�0000000�00000006375�13571573400�017245� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Logic open Format open Plib open Engine (** Exportation Engine for Why-3. Provides a full {{:Export.S.engine-c.html}engine} from a {{:Export.S.linker-c.html}linker}. *) module Make(T : Term) : sig open T module Env : Engine.Env with type term := term type trigger = (var,Fun.t) Engine.ftrigger type typedef = (tau,Field.t,Fun.t) Engine.ftypedef class virtual engine : object inherit [Z.t,ADT.t,Field.t,Fun.t,tau,var,term,Env.t] Engine.engine method marks : Env.t * T.marks method op_spaced : string -> bool method op_record : string * string method pp_forall : tau -> string list printer method pp_intros : tau -> string list printer method pp_exists : tau -> string list printer method pp_param : (string * tau) printer method pp_trigger : (var,Fun.t) ftrigger printer method pp_declare_symbol : cmode -> Fun.t printer method pp_declare_adt : formatter -> ADT.t -> int -> unit method pp_declare_def : formatter -> ADT.t -> int -> tau -> unit method pp_declare_sum : formatter -> ADT.t -> int -> (Fun.t * tau list) list -> unit method declare_type : formatter -> ADT.t -> int -> typedef -> unit method declare_prop : kind:string -> formatter -> string -> T.var list -> trigger list list -> term -> unit method declare_axiom : formatter -> string -> var list -> trigger list list -> term -> unit method declare_fixpoint : prefix:string -> formatter -> Fun.t -> var list -> tau -> term -> unit method declare_signature : formatter -> Fun.t -> tau list -> tau -> unit method declare_definition : formatter -> Fun.t -> var list -> tau -> term -> unit end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export_whycore.ml����������������������������������������������0000666�0000000�0000000�00000022653�13571573400�017657� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Common Exportation Engine for Alt-Ergo and Why3 --- *) (* -------------------------------------------------------------------------- *) open Logic open Format open Plib open Engine open Export module Make(T : Term) = struct open T module T = T module E = Export.Make(T) module Env = E.Env type trigger = (T.var,Fun.t) ftrigger type typedef = (tau,Field.t,Fun.t) ftypedef let rec full_trigger = function | TgAny -> false | TgVar _ -> true | TgGet(a,k) -> full_trigger a && full_trigger k | TgSet(a,k,v) -> full_trigger a && full_trigger k && full_trigger v | TgFun(_,xs) | TgProp(_,xs) -> List.for_all full_trigger xs let rec full_triggers = function | [] -> [] | ts :: tgs -> match List.filter full_trigger ts with | [] -> full_triggers tgs | ts -> ts :: full_triggers tgs class virtual engine = object(self) inherit E.engine (* -------------------------------------------------------------------------- *) (* --- Types --- *) (* -------------------------------------------------------------------------- *) method t_int = "int" method t_real = "real" method t_bool = "bool" method t_prop = "prop" method pp_tvar fmt k = if 1 <= k && k <= 26 then fprintf fmt "'%c" (char_of_int (int_of_char 'a' + k - 1)) else fprintf fmt "'_%d" k (* -------------------------------------------------------------------------- *) (* --- Scope --- *) (* -------------------------------------------------------------------------- *) method op_scope _ = None (* -------------------------------------------------------------------------- *) (* --- Arrays --- *) (* -------------------------------------------------------------------------- *) method pp_array_get fmt a k = fprintf fmt "@[<hov 2>%a[%a]@]" self#pp_atom a self#pp_flow k method pp_array_set fmt a k v = fprintf fmt "@[<hov 2>%a[%a@ <- %a]@]" self#pp_atom a self#pp_atom k self#pp_flow v (* -------------------------------------------------------------------------- *) (* --- Records --- *) (* -------------------------------------------------------------------------- *) method virtual op_record : string * string method pp_get_field fmt r f = fprintf fmt "%a.%s" self#pp_atom r (self#field f) method pp_def_fields fmt fvs = let base,fvs = match T.record_with fvs with | None -> None,fvs | Some(r,fvs) -> Some r,fvs in begin let (left,right) = self#op_record in fprintf fmt "@[<hov 2>%s" left ; Plib.iteri (fun i (f,v) -> ( match i , base with | (Isingle | Ifirst) , Some r -> fprintf fmt "@ %a with" self#pp_flow r | _ -> () ) ; ( match i with | Ifirst | Imiddle -> fprintf fmt "@ @[<hov 2>%s = %a ;@]" (self#field f) self#pp_flow v | Isingle | Ilast -> fprintf fmt "@ @[<hov 2>%s = %a@]" (self#field f) self#pp_flow v ) ) fvs ; fprintf fmt "@ %s@]" right ; end (* -------------------------------------------------------------------------- *) (* --- Higher Order --- *) (* -------------------------------------------------------------------------- *) method pp_apply (_:cmode) (_:term) (_:formatter) (_:term list) = failwith "Qed.Export.Why: higher-order application" (* -------------------------------------------------------------------------- *) (* --- Higher Order --- *) (* -------------------------------------------------------------------------- *) method pp_param fmt ((x,t) : string * tau) = fprintf fmt "%a:%a" self#pp_var x self#pp_tau t method pp_lambda (_:formatter) (_: (string * tau) list) = failwith "Qed.Export.Why : lambda abstraction" (* -------------------------------------------------------------------------- *) (* --- Declarations --- *) (* -------------------------------------------------------------------------- *) method virtual pp_declare_adt : formatter -> ADT.t -> int -> unit method virtual pp_declare_def : formatter -> ADT.t -> int -> tau -> unit method virtual pp_declare_sum : formatter -> ADT.t -> int -> (Fun.t * tau list) list -> unit method declare_type fmt adt n = function | Tabs -> self#pp_declare_adt fmt adt n ; pp_print_newline fmt () | Tdef def -> self#pp_declare_def fmt adt n def ; pp_print_newline fmt () | Tsum cases -> self#pp_declare_sum fmt adt n cases ; pp_print_newline fmt () | Trec fts -> begin Format.fprintf fmt "@[<hv 0>@[<hv 2>" ; self#pp_declare_adt fmt adt n ; let left,right = self#op_record in fprintf fmt " = %s" left ; Plib.iteri (fun index (f,t) -> match index with | Isingle | Ilast -> fprintf fmt "@ @[<hov 2>%s : %a@]" (self#field f) self#pp_tau t | Imiddle | Ifirst -> fprintf fmt "@ @[<hov 2>%s : %a@] ;" (self#field f) self#pp_tau t ) fts ; fprintf fmt "@] %s@]@\n" right ; end method pp_declare_symbol t fmt f = let name = link_name (self#link f) in match t with | Cprop -> fprintf fmt "predicate %s" name | Cterm -> fprintf fmt "function %s" name method virtual pp_trigger : trigger printer method virtual pp_intros : tau -> string list printer (* forall with no separator *) method declare_prop ~kind fmt lemma xs tgs (p : term) = self#global begin fun () -> fprintf fmt "@[<hv 2>%s %s:" kind lemma ; let groups = List.fold_left (fun groups x -> let a = self#bind x in let t = T.tau_of_var x in let xs = try E.TauMap.find t groups with Not_found -> [] in E.TauMap.add t (a::xs) groups ) E.TauMap.empty xs in let order = E.TauMap.fold (fun t xs order -> (t,List.sort String.compare xs)::order) groups [] in let tgs = full_triggers tgs in Plib.iteri (fun index (t,xs) -> let do_triggers = match index with | Ifirst | Imiddle -> false | Isingle | Ilast -> tgs<>[] in if do_triggers then begin let pp_or = Plib.pp_listcompact ~sep:"|" in let pp_and = Plib.pp_listcompact ~sep:"," in let pp_triggers = pp_or (pp_and self#pp_trigger) in fprintf fmt "@ @[<hov 2>%a@]" (self#pp_intros t) xs ; fprintf fmt "@ @[<hov 2>[%a].@]" pp_triggers tgs ; end else fprintf fmt "@ @[<hov 2>%a.@]" (self#pp_intros t) xs ) order ; fprintf fmt "@ @[<hov 2>%a@]@]@\n" self#pp_prop p end method declare_axiom = self#declare_prop ~kind:"axiom" end end �������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/export_whycore.mli���������������������������������������������0000666�0000000�0000000�00000014745�13571573400�020033� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Common Exportation Engine for Alt-Ergo and Why3 --- *) (* -------------------------------------------------------------------------- *) open Logic open Format open Plib open Engine (** Common Exportation Engine for Why-3 and Alt-Ergo *) module Make(T : Term) : sig open T module Env : Engine.Env with type term := term type trigger = (T.var,Fun.t) ftrigger type typedef = (tau,Field.t,Fun.t) ftypedef class virtual engine : object method sanitize : string -> string method virtual datatype : ADT.t -> string method virtual field : Field.t -> string method virtual link : Fun.t -> link method env : Env.t method set_env : Env.t -> unit method marks : Env.t * T.marks method lookup : t -> scope method scope : Env.t -> (unit -> unit) -> unit method local : (unit -> unit) -> unit method global : (unit -> unit) -> unit method t_int : string method t_real : string method t_bool : string method t_prop : string method virtual t_atomic : tau -> bool method pp_tvar : int printer method virtual pp_array : tau printer method virtual pp_farray : tau printer2 method virtual pp_datatype : ADT.t -> tau list printer method pp_subtau : tau printer method mode : mode method with_mode : mode -> (mode -> unit) -> unit method virtual e_true : cmode -> string method virtual e_false : cmode -> string method virtual pp_int : amode -> Z.t printer method virtual pp_real : Q.t printer method virtual is_atomic : term -> bool method virtual op_spaced : string -> bool method virtual callstyle : callstyle method pp_apply : cmode -> term -> term list printer method pp_fun : cmode -> Fun.t -> term list printer method op_scope : amode -> string option method virtual op_real_of_int : op method virtual op_add : amode -> op method virtual op_sub : amode -> op method virtual op_mul : amode -> op method virtual op_div : amode -> op method virtual op_mod : amode -> op method virtual op_minus : amode -> op method pp_times : formatter -> Z.t -> term -> unit method virtual op_equal : cmode -> op method virtual op_noteq : cmode -> op method virtual op_eq : cmode -> amode -> op method virtual op_neq : cmode -> amode -> op method virtual op_lt : cmode -> amode -> op method virtual op_leq : cmode -> amode -> op method virtual pp_array_cst : formatter -> tau -> term -> unit method pp_array_get : formatter -> term -> term -> unit method pp_array_set : formatter -> term -> term -> term -> unit method virtual op_record : string * string method pp_get_field : formatter -> term -> Field.t -> unit method pp_def_fields : record printer method virtual op_not : cmode -> op method virtual op_and : cmode -> op method virtual op_or : cmode -> op method virtual op_imply : cmode -> op method virtual op_equiv : cmode -> op method pp_not : term printer method pp_imply : formatter -> term list -> term -> unit method pp_equal : term printer2 method pp_noteq : term printer2 method virtual pp_conditional : formatter -> term -> term -> term -> unit method virtual pp_forall : tau -> string list printer method virtual pp_intros : tau -> string list printer method virtual pp_exists : tau -> string list printer method pp_lambda : (string * tau) list printer method bind : var -> string method find : var -> string method virtual pp_let : formatter -> pmode -> string -> term -> unit method shared : term -> bool method shareable : term -> bool method subterms : (term -> unit) -> term -> unit method pp_atom : term printer method pp_flow : term printer method pp_repr : term printer method pp_tau : tau printer method pp_var : string printer method pp_term : term printer method pp_prop : term printer method pp_sort : term printer method pp_expr : tau -> term printer method pp_param : (string * tau) printer method virtual pp_trigger : trigger printer method virtual pp_declare_adt : formatter -> ADT.t -> int -> unit method virtual pp_declare_def : formatter -> ADT.t -> int -> tau -> unit method virtual pp_declare_sum : formatter -> ADT.t -> int -> (Fun.t * tau list) list -> unit method pp_declare_symbol : cmode -> formatter -> Fun.t -> unit method declare_type : formatter -> ADT.t -> int -> typedef -> unit method declare_axiom : formatter -> string -> T.var list -> trigger list list -> term -> unit method declare_prop : kind:string -> formatter -> string -> T.var list -> trigger list list -> term -> unit end end ���������������������������frama-c-20.0-Calcium/src/plugins/qed/hcons.ml�������������������������������������������������������0000666�0000000�0000000�00000010517�13571573400�015704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Hash Consing Utilities --- *) (* -------------------------------------------------------------------------- *) let primes = [| 2 ; 3 ; 5 ; 7 ; 11 ; 13 ; 17 ; 19 ; 23 ; 29 ; 31 ; 37 ; 41 ; 43 ; 47 ; 53 ; 59 ; 61 ; 67 ; 71 ; 73 ; 79 ; 83 ; 89 ; 97 ; 101 ; 103 ; 107 ; 109 ; 113 ; 127 ; 131 ; 137 ; 139 ; 149 ; 151 ; 157 ; 163 ; 167 ; 173 ; 179 ; 181 ; 191 ; 193 ; 197 ; 199 ; 211 ; 223 ; 227 ; 229 ; 233 ; 239 ; 241 ; 251 ; 257 ; 263 ; 269 ; 271 ; 277 ; 281 |] let n_primes = Array.length primes let hash_int t = if t < n_primes then primes.(t) else 1 let hash_tag x = hash_int (Obj.tag (Obj.repr x)) let hash_pair x y = x * 599 + y * 799 let hash_triple x y z = x * 281 + y * 599 + z * 799 let rec hash_list f h = function | [] -> h | x::xs -> hash_list f (h * 599 + f x) xs let hash_opt f h = function | None -> h | Some x -> h * 281 + f x let hash_array f h xs = let rec collect h xs i = if i < Array.length xs then collect (h * 599 + f xs.(i)) xs (succ i) else h in collect h xs 0 let rec compare_list cmp xs ys = if xs == ys then 0 else match xs , ys with | [] , [] -> 0 | [] , _ :: _ -> -1 | _ :: _ , [] -> 1 | x::xs , y::ys -> let c = cmp x y in if c = 0 then compare_list cmp xs ys else c let rec equal_list eq xs ys = xs == ys || match xs , ys with | [] , [] -> true | [] , _ :: _ | _ :: _ , [] -> false | x::xs , y::ys -> eq x y && equal_list eq xs ys let equal_array eq xs ys = let n = Array.length xs in let m = Array.length ys in n = m && begin try for i=0 to n-1 do if not (eq xs.(i) ys.(i)) then raise Exit done ; true with Exit -> false end let exists_array f xs = try for i=0 to Array.length xs - 1 do if f xs.(i) then raise Exit done ; false with Exit -> true let forall_array f xs = try for i=0 to Array.length xs - 1 do if not (f xs.(i)) then raise Exit done ; true with Exit -> false let rec eq_list xs ys = match xs, ys with | [] , [] -> true | [] , _::_ | _::_ , [] -> false | x::xs , y::ys -> x==y && eq_list xs ys let eq_array xs ys = let n = Array.length xs in let m = Array.length ys in n = m && begin try for i=0 to n-1 do if not (xs.(i) == ys.(i)) then raise Exit done ; true with Exit -> false end let rec fold_list op f a = function | [] -> a | x::xs -> fold_list op f (op a (f x)) xs let fold_array op f a xs = let rec collect op f a xs i = if i < Array.length xs then collect op f (op a (f xs.(i))) xs (succ i) else a in collect op f a xs 0 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/hcons.mli������������������������������������������������������0000666�0000000�0000000�00000005272�13571573400�016057� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Hash-Consing Utilities *) (* -------------------------------------------------------------------------- *) val primes : int array val hash_int : int -> int val hash_tag : 'a -> int val hash_pair : int -> int -> int val hash_triple : int -> int -> int -> int val hash_list : ('a -> int) -> int -> 'a list -> int val hash_array : ('a -> int) -> int -> 'a array -> int val hash_opt : ('a -> int) -> int -> 'a option -> int val eq_list : 'a list -> 'a list -> bool (** Uses [==]. *) val eq_array : 'a array -> 'a array -> bool (** Uses [==]. *) val equal_list : ('a -> 'a -> bool) -> 'a list -> 'a list -> bool val equal_array : ('a -> 'a -> bool) -> 'a array -> 'a array -> bool val compare_list : ('a -> 'a -> int) -> 'a list -> 'a list -> int val exists_array : ('a -> bool) -> 'a array -> bool val forall_array : ('a -> bool) -> 'a array -> bool val fold_list : ('a -> 'a -> 'a) -> ('b -> 'a) -> 'a -> 'b list -> 'a val fold_array : ('a -> 'a -> 'a) -> ('b -> 'a) -> 'a -> 'b array -> 'a ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/idxmap.ml������������������������������������������������������0000666�0000000�0000000�00000014233�13571573400�016053� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type S = sig type key type 'a t val is_empty : 'a t -> bool val empty : 'a t val add : key -> 'a -> 'a t -> 'a t val mem : key -> 'a t -> bool val find : key -> 'a t -> 'a val remove : key -> 'a t -> 'a t val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val iter : (key -> 'a -> unit) -> 'a t -> unit val map : (key -> 'a -> 'b) -> 'a t -> 'b t val mapf : (key -> 'a -> 'b option) -> 'a t -> 'b t val mapq : (key -> 'a -> 'a option) -> 'a t -> 'a t val filter : (key -> 'a -> bool) -> 'a t -> 'a t val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val union : (key -> 'a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t val inter : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val interf : (key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t val interq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val diffq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t val iter2 : (key -> 'a option -> 'b option -> unit) -> 'a t -> 'b t -> unit val subset : (key -> 'a -> 'b -> bool) -> 'a t -> 'b t -> bool (** [insert (fun key v old -> ...) key v map] *) val insert : (key -> 'a -> 'a -> 'a) -> key -> 'a -> 'a t -> 'a t val change : (key -> 'b -> 'a option -> 'a option) -> key -> 'b -> 'a t -> 'a t end module type IndexedKey = sig type t val id : t -> int (** unique per t *) end module Make( K : IndexedKey ) = struct type key = K.t type 'a t = (key * 'a) Intmap.t let is_empty = Intmap.is_empty let empty = Intmap.empty (* good sharing *) let add k x m = Intmap.add (K.id k) (k,x) m let _pack k = function None -> None | Some v -> Some (k,v) let _packold ((k,old) as o) w = if w==old then o else k,w let _oldpack o = function None -> None | Some w -> Some (_packold o w) (* good sharing *) let insert f k v m = Intmap.insert (fun _k (k,v) ((_,old) as o) -> _packold o (f k v old)) (K.id k) (k,v) m (* good sharing *) let change f k v m = Intmap.change (fun _k (k,v) -> function | None -> _pack k (f k v None) | Some ((_,old) as o) -> _oldpack o (f k v (Some old))) (K.id k) (k,v) m let mem k m = Intmap.mem (K.id k) m let find k m = snd (Intmap.find (K.id k) m) let compare f m1 m2 = Intmap.compare (fun (_,a) (_,b) -> f a b) m1 m2 let equal f m1 m2 = Intmap.equal (fun (_,a) (_,b) -> f a b) m1 m2 let iter f m = Intmap.iter (fun (k,v) -> f k v) m let fold f m w = Intmap.fold (fun (k,v) w -> f k v w) m w let map f m = Intmap.map (fun (k,v) -> k,f k v) m let mapf f m = Intmap.mapf (fun _ (k,v) -> _pack k (f k v)) m (* good sharing *) let mapq f = Intmap.mapq (fun _ ((k,old) as o) -> _oldpack o (f k old)) (* good sharing *) let partition f = Intmap.partition (fun _ (k,v) -> f k v) (* good sharing *) let remove k = Intmap.remove (K.id k) (* good sharing *) let filter f = Intmap.filter (fun _ (k,v) -> f k v) (* good sharing *) let union f = Intmap.union (fun _ ((k,v) as x) ((_,v') as y) -> let w = f k v v' in if w==v then x else if w==v then y else k,w ) let inter f = Intmap.inter (fun _ (k,v) (_,v') -> k,f k v v') let interf f = Intmap.interf (fun _ (k,v) (_,v') -> _pack k (f k v v')) (* good sharing *) let interq f = Intmap.interq (fun _ ((k,v) as x) ((_,v') as y) -> match f k v v' with None -> None | Some w -> Some (if w==v then x else if w==v then y else k,w)) (* good sharing *) let diffq f = Intmap.diffq (fun _ ((k,v) as x) ((_,v') as y) -> match f k v v' with None -> None | Some w -> Some (if w==v then x else if w==v then y else k,w)) let merge f a b = Intmap.merge (fun _ u v -> match u , v with | None , None -> None | Some(k,v) , None -> _pack k (f k (Some v) None) | None , Some(k,v) -> _pack k (f k None (Some v)) | Some(k,v) , Some(_,v') -> _pack k (f k (Some v) (Some v')) ) a b let iter2 f a b = Intmap.iter2 (fun _ u v -> match u,v with | None , None -> () | Some (k,v) , None -> f k (Some v) None | None , Some (k,v) -> f k None (Some v) | Some (k,v) , Some(_,v') -> f k (Some v) (Some v') ) a b exception SUPERSET let subset f a b = try Intmap.iter2 (fun _ u v -> match u,v with | None , _ -> () | Some _ , None -> raise SUPERSET | Some (k,v) , Some(_,v') -> if not (f k v v') then raise SUPERSET ) a b ; true with SUPERSET -> false end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/idxmap.mli�����������������������������������������������������0000666�0000000�0000000�00000006303�13571573400�016223� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Map with indexed keys *) module type S = sig type key type 'a t val is_empty : 'a t -> bool val empty : 'a t val add : key -> 'a -> 'a t -> 'a t val mem : key -> 'a t -> bool val find : key -> 'a t -> 'a val remove : key -> 'a t -> 'a t val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val iter : (key -> 'a -> unit) -> 'a t -> unit val map : (key -> 'a -> 'b) -> 'a t -> 'b t val mapf : (key -> 'a -> 'b option) -> 'a t -> 'b t val mapq : (key -> 'a -> 'a option) -> 'a t -> 'a t val filter : (key -> 'a -> bool) -> 'a t -> 'a t val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val union : (key -> 'a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t val inter : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val interf : (key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t val interq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val diffq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t val iter2 : (key -> 'a option -> 'b option -> unit) -> 'a t -> 'b t -> unit val subset : (key -> 'a -> 'b -> bool) -> 'a t -> 'b t -> bool (** [insert (fun key v old -> ...) key v map] *) val insert : (key -> 'a -> 'a -> 'a) -> key -> 'a -> 'a t -> 'a t val change : (key -> 'b -> 'a option -> 'a option) -> key -> 'b -> 'a t -> 'a t end module type IndexedKey = sig type t val id : t -> int (** unique per t *) end module Make( K : IndexedKey ) : S with type key = K.t �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/idxset.ml������������������������������������������������������0000666�0000000�0000000�00000010014�13571573400�016062� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type S = sig type elt type t val empty : t val is_empty : t -> bool val mem : elt -> t -> bool val find : elt -> t -> elt val add : elt -> t -> t val singleton : elt -> t val remove : elt -> t -> t val union : t -> t -> t val inter : t -> t -> t val diff : t -> t -> t val compare : t -> t -> int val equal : t -> t -> bool val subset : t -> t -> bool val iter : (elt -> unit) -> t -> unit val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a val for_all : (elt -> bool) -> t -> bool val exists : (elt -> bool) -> t -> bool val filter : (elt -> bool) -> t -> t val partition : (elt -> bool) -> t -> t * t val cardinal : t -> int val elements : t -> elt list val map : (elt -> elt) -> t -> t val mapf : (elt -> elt option) -> t -> t val intersect : t -> t -> bool end module type IndexedElements = sig type t val id : t -> int (* unique per t *) end module Make(E : IndexedElements) = struct type t = E.t Intmap.t type elt = E.t let empty = Intmap.empty let singleton x = Intmap.singleton (E.id x) x (* good sharing *) let add x = Intmap.add (E.id x) x (* good sharing *) let remove x = Intmap.remove (E.id x) let is_empty = Intmap.is_empty let mem x m = Intmap.mem (E.id x) m let find x m = Intmap.find (E.id x) m let cardinal = Intmap.size let compare m1 m2 = Intmap.compare (fun _ _ -> 0) m1 m2 let equal m1 m2 = Intmap.equal (fun _ _ -> true) m1 m2 let _keep _ x _ = x let _keepq _ x _ = Some x let _same _ _ _ = true (* good sharing *) let union m1 m2 = Intmap.union _keep m1 m2 (* good sharing *) let inter m1 m2 = Intmap.interq _keepq m1 m2 (* good sharing *) let diff m1 m2 = Intmap.diffq _keepq m1 m2 let subset m1 m2 = Intmap.subset _same m1 m2 let intersect m1 m2 = Intmap.intersectf _same m1 m2 (* increasing order on id *) let iter f m = Intmap.iteri (fun _i x -> f x) m (* increasing order on id *) let fold f m i = Intmap.foldi (fun _i x e -> f x e) m i (* good sharing *) let filter f m = Intmap.filter (fun _i x -> f x) m (* good sharing *) let partition f m = Intmap.partition (fun _i x -> f x) m let for_all f m = Intmap.for_all (fun _i x -> f x) m let exists f m = Intmap.exists (fun _i x -> f x) m (* increasing order on id *) let elements m = Intmap.mapl (fun _i x -> x) m (* good sharing *) let mapf f m = Intmap.mapq (fun _i x -> f x) m (* good sharing *) let map f m = Intmap.mapq (fun _i x -> Some (f x)) m end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/idxset.mli�����������������������������������������������������0000666�0000000�0000000�00000005127�13571573400�016244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Set of indexed elements implemented as Patricia sets. *) module type S = sig type elt type t val empty : t val is_empty : t -> bool val mem : elt -> t -> bool val find : elt -> t -> elt val add : elt -> t -> t val singleton : elt -> t val remove : elt -> t -> t val union : t -> t -> t val inter : t -> t -> t val diff : t -> t -> t val compare : t -> t -> int val equal : t -> t -> bool val subset : t -> t -> bool val iter : (elt -> unit) -> t -> unit val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a val for_all : (elt -> bool) -> t -> bool val exists : (elt -> bool) -> t -> bool val filter : (elt -> bool) -> t -> t val partition : (elt -> bool) -> t -> t * t val cardinal : t -> int val elements : t -> elt list val map : (elt -> elt) -> t -> t val mapf : (elt -> elt option) -> t -> t val intersect : t -> t -> bool end module type IndexedElements = sig type t val id : t -> int (** unique per t *) end module Make( E : IndexedElements ) : S with type elt = E.t �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/intmap.ml������������������������������������������������������0000666�0000000�0000000�00000067324�13571573400�016072� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ---------------------------------------------------------------------- *) (* --- Patricia Trees By L. Correnson & P. Baudin --- *) (* ---------------------------------------------------------------------- *) type 'a t = | Empty | Lf of int * 'a | Br of int * 'a t * 'a t (* -------------------------------------------------------------------------- *) (* --- Bit library --- *) (* -------------------------------------------------------------------------- *) let hsb = let hsb p = if p land 2 != 0 then 1 else 0 in let hsb p = let n = p lsr 2 in if n != 0 then 2 + hsb n else hsb p in let hsb p = let n = p lsr 4 in if n != 0 then 4 + hsb n else hsb p in let hsb = Array.init 256 hsb in let hsb p = let n = p lsr 8 in if n != 0 then 8 + hsb.(n) else hsb.(p) in let hsb p = let n = p lsr 16 in if n != 0 then 16 + hsb n else hsb p in match Sys.word_size with | 32 -> hsb | 64 -> (function p -> let n = p lsr 32 in if n != 0 then 32 + hsb n else hsb p) | _ -> assert false let highest_bit x = 1 lsl (hsb x) let lowest_bit x = x land (-x) let decode_mask p = lowest_bit (lnot p) (* -------------------------------------------------------------------------- *) (* --- Debug --- *) (* -------------------------------------------------------------------------- *) let pp_mask m fmt p = begin let bits = Array.make 63 false in let last = ref 0 in for i = 0 to 62 do let u = 1 lsl i in if u land p <> 0 then bits.(i) <- true ; if u == m then last := i ; done ; Format.pp_print_char fmt '*' ; for i = !last - 1 downto 0 do Format.pp_print_char fmt (if bits.(i) then '1' else '0') ; done ; end let pp_bits fmt k = begin let bits = Array.make 63 false in let last = ref 0 in for i = 0 to 62 do if (1 lsl i) land k <> 0 then ( bits.(i) <- true ; if i > !last then last := i ) ; done ; for i = !last downto 0 do Format.pp_print_char fmt (if bits.(i) then '1' else '0') ; done ; end let rec pp_tree tab fmt = function | Empty -> () | Lf(k,_) -> Format.fprintf fmt "%sL%a=%d@\n" tab pp_bits k k | Br(p,l,r) -> let next = tab ^ " " in pp_tree next fmt l ; Format.fprintf fmt "%s@@%a@\n" tab (pp_mask (decode_mask p)) p ; pp_tree next fmt r (* -------------------------------------------------------------------------- *) (* --- Bit utilities --- *) (* -------------------------------------------------------------------------- *) let decode_mask p = lowest_bit (lnot p) let branching_bit p0 p1 = highest_bit (p0 lxor p1) let mask p m = (p lor (m-1)) land (lnot m) let zero_bit_int k m = (k land m) == 0 let zero_bit k p = zero_bit_int k (decode_mask p) let match_prefix_int k p m = (mask k m) == p let match_prefix k p = match_prefix_int k p (decode_mask p) let included_mask_int m n = (* m mask is strictly included into n *) (* can not use (m < n) when n is (1 lsl 62) = min_int < 0 *) (* must use (0 < (n-m) instead *) 0 > n - m let included_prefix p q = let m = decode_mask p in let n = decode_mask q in included_mask_int m n && match_prefix_int q p m (* -------------------------------------------------------------------------- *) (* --- Smart Constructors --- *) (* -------------------------------------------------------------------------- *) let empty = Empty let singleton k x = Lf(k,x) let lf k = function None -> Empty | Some x -> Lf(k,x) (* good sharing *) let lf0 k x' t' = function None -> Empty | Some x -> if x == x' then t' else Lf(k,x) (* good sharing *) let br0 p t0' t1' t' = function | Empty -> t1' | t0 -> if t0' == t0 then t' else Br(p,t0,t1') (* good sharing *) let br1 p t0' t1' t' = function | Empty -> t0' | t1 -> if t1' == t1 then t' else Br(p,t0',t1) let join p t0 q t1 = let m = branching_bit p q in let r = mask p m in if zero_bit p r then Br(r,t0,t1) else Br(r,t1,t0) (* t0 and t1 has different prefix, but best common prefix is unknown *) let glue t0 t1 = match t0 , t1 with | Empty,t | t,Empty -> t | (Lf(p,_) | Br(p,_,_)) , (Lf(q,_) | Br(q,_,_)) -> join p t0 q t1 let glue0 t0 t0' t1' t' = if t0 == t0' then t' else glue t0 t1' let glue1 t1 t0' t1' t' = if t1 == t1' then t' else glue t0' t1 let glue01 t0 t1 t0' t1' t' = if t0 == t0' && t1 == t1' then t' else glue t0 t1 let glue2 t0 t1 t0' t1' t' s0' s1' s' = if t0 == s0' && t1 == s1' then s' else if t0 == t0' && t1 == t1' then t' else glue t0 t1 (* -------------------------------------------------------------------------- *) (* --- Access API --- *) (* -------------------------------------------------------------------------- *) let is_empty = function | Empty -> true | Lf _ | Br _ -> false let size t = let rec walk n = function | Empty -> n | Lf _ -> succ n | Br(_,a,b) -> walk (walk n a) b in walk 0 t let rec mem k = function | Empty -> false | Lf(i,_) -> i=k | Br(p,t0,t1) -> match_prefix k p && mem k (if zero_bit k p then t0 else t1) let rec findq k = function | Empty -> raise Not_found | Lf(i,x) as t -> if k = i then (x,t) else raise Not_found | Br(p,t0,t1) -> if match_prefix k p then findq k (if zero_bit k p then t0 else t1) else raise Not_found let find k m = fst (findq k m) (* -------------------------------------------------------------------------- *) (* --- Comparison --- *) (* -------------------------------------------------------------------------- *) let rec compare cmp s t = if s == t then 0 else match s , t with | Empty , Empty -> 0 | Empty , _ -> (-1) | _ , Empty -> 1 | Lf(i,x) , Lf(j,y) -> let ck = Transitioning.Stdlib.compare i j in if ck = 0 then cmp x y else ck | Lf _ , _ -> (-1) | _ , Lf _ -> 1 | Br(p,s0,s1) , Br(q,t0,t1) -> let cp = Transitioning.Stdlib.compare p q in if cp <> 0 then cp else let c0 = compare cmp s0 t0 in if c0 <> 0 then c0 else compare cmp s1 t1 let rec equal eq s t = if s == t then true else match s , t with | Empty , Empty -> true | Empty , _ -> false | _ , Empty -> false | Lf(i,x) , Lf(j,y) -> i == j && eq x y | Lf _ , _ -> false | _ , Lf _ -> false | Br(p,s0,s1) , Br(q,t0,t1) -> p==q && equal eq s0 t0 && equal eq s1 t1 (* -------------------------------------------------------------------------- *) (* --- Addition, Insert, Change, Remove --- *) (* -------------------------------------------------------------------------- *) (* good sharing *) let rec change phi k x = function | Empty as t -> (match phi k x None with | None -> t | Some w -> Lf(k,w)) | Lf(i,y) as t -> if i = k then lf0 k y t (phi k x (Some y)) else (match phi k x None with | None -> t | Some w -> let s = Lf(k,w) in join k s i t) | Br(p,t0,t1) as t -> if match_prefix k p then (* k belongs to tree *) if zero_bit k p then br0 p t0 t1 t (change phi k x t0) (* k is in t0 *) else br1 p t0 t1 t (change phi k x t1) (* k is in t1 *) else (* k is disjoint from tree *) (match phi k x None with | None -> t | Some w -> let s = Lf(k,w) in join k s p t) (* good sharing *) let insert f k x = change (fun _k x -> function | None -> Some x | Some old -> Some (f k x old)) k x (* good sharing *) let add k x = change (fun _k x _old -> Some x) k x (* good sharing *) let remove k = change (fun _k () _old -> None) k () (* -------------------------------------------------------------------------- *) (* --- Map --- *) (* -------------------------------------------------------------------------- *) let mapi phi = let rec mapi phi = function | Empty -> Empty | Lf(k,x) -> Lf(k,phi k x) | Br(p,t0,t1) -> let t0 = mapi phi t0 in let t1 = mapi phi t1 in Br(p,t0,t1) in function (* to be sorted *) | Empty -> Empty | Lf(k,x) -> Lf(k,phi k x) | Br(p,t0,t1) when p = max_int -> let t1 = mapi phi t1 in let t0 = mapi phi t0 in Br(p,t0,t1) | Br(p,t0,t1) -> let t0 = mapi phi t0 in let t1 = mapi phi t1 in Br(p,t0,t1) let map phi = mapi (fun _ x -> phi x) let mapf phi = let rec mapf phi = function | Empty -> Empty | Lf(k,x) -> lf k (phi k x) | Br(_,t0,t1) -> glue (mapf phi t0) (mapf phi t1) in function (* to be sorted *) | Empty -> Empty | Lf(k,x) -> lf k (phi k x) | Br(p,t0,t1) when p = max_int -> let t1 = mapf phi t1 in let t0 = mapf phi t0 in glue t0 t1 | Br(_,t0,t1) -> let t0 = mapf phi t0 in let t1 = mapf phi t1 in glue t0 t1 (* good sharing *) let mapq phi = let rec mapq phi = function | Empty as t -> t | Lf(k,x) as t -> lf0 k x t (phi k x) | Br(_,t0,t1) as t-> let t0' = mapq phi t0 in let t1' = mapq phi t1 in glue01 t0' t1' t0 t1 t in function (* to be sorted *) | Empty as t -> t | Lf(k,x) as t -> lf0 k x t (phi k x) | Br(p,t0,t1) as t when p = max_int -> let t1' = mapq phi t1 in let t0' = mapq phi t0 in glue01 t0' t1' t0 t1 t | Br(_,t0,t1) as t-> let t0' = mapq phi t0 in let t1' = mapq phi t1 in glue01 t0' t1' t0 t1 t (* good sharing *) let filter f m = mapq (fun k v -> if f k v then Some v else None) m (* good sharing *) let rec partition p = function | Empty as t -> (t,t) | Lf(k,x) as t -> if p k x then t,Empty else Empty,t | Br(_,t0,t1) as t-> let (t0',u0') = partition p t0 in let (t1',u1') = partition p t1 in if t0'==t0 && t1'==t1 then (t, u0') (* u0' and u1' are empty *) else if u0'==t0 && u1'==t1 then (t0', t) (* t0' and t1' are empty *) else (glue t0' t1'),(glue u0' u1') (* good sharing *) let rec partition_split p = function | Empty as t -> (t,t) | Lf(k,x) as t -> let u,v = p k x in (lf0 k x t u), (lf0 k x t v) | Br(_,t0,t1) as t-> let t0',u0' = partition_split p t0 in let t1',u1' = partition_split p t1 in if t0'==t0 && t1'==t1 then (t, u0') (* u0' and u1' are empty *) else if u0'==t0 && u1'==t1 then (t0', t) (* t0' and t1' are empty *) else (glue t0' t1'),(glue u0' u1') (* -------------------------------------------------------------------------- *) (* --- Iter --- *) (* -------------------------------------------------------------------------- *) let iteri phi = let rec aux = function | Empty -> () | Lf(k,x) -> phi k x | Br(_,t0,t1) -> aux t0 ; aux t1 in function (* to be sorted *) | Empty -> () | Lf(k,x) -> phi k x | Br(p,t0,t1) when p = max_int -> aux t1 ; aux t0 | Br(_,t0,t1) -> aux t0 ; aux t1 let iter phi = iteri (fun _ x -> phi x) let foldi phi t e = (* increasing order *) let rec aux t e = match t with | Empty -> e | Lf(i,x) -> phi i x e | Br(_,t0,t1) -> aux t1 (aux t0 e) in match t with (* to be sorted *) | Empty -> e | Lf(i,x) -> phi i x e | Br(p,t0,t1) when p = max_int -> aux t0 (aux t1 e) | Br(_,t0,t1) -> aux t1 (aux t0 e) let fold phi = foldi (fun _ x e -> phi x e) let foldd phi t e = (* decreasing order *) let rec aux t e = match t with | Empty -> e | Lf(i,x) -> phi i x e | Br(_,t0,t1) -> aux t0 (aux t1 e) in match t with (* to be sorted *) | Empty -> e | Lf(i,x) -> phi i x e | Br(p,t0,t1) when p = max_int -> aux t1 (aux t0 e) | Br(_,t0,t1) -> aux t0 (aux t1 e) (* decreasing order on f to have the list in increasing order *) let mapl f m = foldd (fun k v a -> (f k v)::a) m [] let for_all phi = (* increasing order *) let rec aux = function | Empty -> true | Lf(k,x) -> phi k x | Br(_,t0,t1) -> aux t0 && aux t1 in function (* to be sorted *) | Empty -> true | Lf(k,x) -> phi k x | Br(p,t0,t1) when p = max_int -> aux t1 && aux t0 | Br(_,t0,t1) -> aux t0 && aux t1 let exists phi = (* increasing order *) let rec aux = function | Empty -> false | Lf(k,x) -> phi k x | Br(_,t0,t1) -> aux t0 || aux t1 in function (* to be sorted *) | Empty -> false | Lf(k,x) -> phi k x | Br(p,t0,t1) when p = max_int -> aux t1 || aux t0 | Br(_,t0,t1) -> aux t0 || aux t1 (* -------------------------------------------------------------------------- *) (* --- Inter --- *) (* -------------------------------------------------------------------------- *) let occur i t = try Some (find i t) with Not_found -> None let rec interi lf_phi s t = match s , t with | Empty , _ -> Empty | _ , Empty -> Empty | Lf(i,x) , Lf(j,y) -> if i = j then lf_phi i x y else Empty | Lf(i,x) , Br _ -> (match occur i t with None -> Empty | Some y -> lf_phi i x y) | Br _ , Lf(j,y) -> (match occur j s with None -> Empty | Some x -> lf_phi j x y) | Br(p,s0,s1) , Br(q,t0,t1) -> if p == q then (* prefixes agree *) glue (interi lf_phi s0 t0) (interi lf_phi s1 t1) else if included_prefix p q then (* q contains p. Intersect t with a subtree of s *) if zero_bit q p then interi lf_phi s0 t (* t has bit m = 0 => t is inside s0 *) else interi lf_phi s1 t (* t has bit m = 1 => t is inside s1 *) else if included_prefix q p then (* p contains q. Intersect s with a subtree of t *) if zero_bit p q then interi lf_phi s t0 (* s has bit n = 0 => s is inside t0 *) else interi lf_phi s t1 (* t has bit n = 1 => s is inside t1 *) else (* prefix disagree *) Empty let inter phi = interi (fun i x y -> Lf(i,phi i x y)) let interf phi = interi (fun i x y -> lf i (phi i x y)) (* good sharing with s *) let lfq phi i x y s t = match phi i x y with None -> Empty | Some w -> if w == x then s else if w == y then t else Lf(i,w) let occur0 phi i x s t = try let (y,t) = findq i t in lfq phi i x y s t with Not_found -> Empty let occur1 phi j y s t = try let (x,s) = findq j s in lfq phi j x y s t with Not_found -> Empty (* good sharing with s *) let rec interq phi s t = match s , t with | Empty , _ -> s | _ , Empty -> t | Lf(i,x) , Lf(j,y) -> if i = j then lfq phi i x y s t else Empty | Lf(i,x) , Br _ -> occur0 phi i x s t | Br _ , Lf(j,y) -> occur1 phi j y s t | Br(p,s0,s1) , Br(q,t0,t1) -> if p == q then (* prefixes agree *) glue2 (interq phi s0 t0) (interq phi s1 t1) s0 s1 s t0 t1 t else if included_prefix p q then (* q contains p. Intersect t with a subtree of s *) if zero_bit q p then interq phi s0 t (* t has bit m = 0 => t is inside s0 *) else interq phi s1 t (* t has bit m = 1 => t is inside s1 *) else if included_prefix q p then (* p contains q. Intersect s with a subtree of t *) if zero_bit p q then interq phi s t0 (* s has bit n = 0 => s is inside t0 *) else interq phi s t1 (* t has bit n = 1 => s is inside t1 *) else (* prefix disagree *) Empty (* -------------------------------------------------------------------------- *) (* --- Union --- *) (* -------------------------------------------------------------------------- *) (* good sharing with s *) let br2u p s0' s1' s' t0' t1' t' t0 t1= if s0'==t0 && s1'== t1 then s' else if t0'==t0 && t1'== t1 then t' else Br(p, t0, t1) (* good sharing with s *) let br0u p t0' t1' t' t0 = if t0'==t0 then t' else Br(p, t0, t1') let br1u p t0' t1' t' t1 = if t1'==t1 then t' else Br(p, t0', t1) (* good sharing with s *) let rec union phi s t = match s , t with | Empty , _ -> t | _ , Empty -> s | Lf(i,x) , Lf(j,y) -> if i = j then let w = phi i x y in if w == x then s else if w == y then t else Lf(i,w) else join i s j t | Lf(i,x) , Br _ -> insert phi i x t | Br _ , Lf(j,y) -> insert (fun j y x -> phi j x y) j y s | Br(p,s0,s1) , Br(q,t0,t1) -> if p == q then (* prefixes agree *) br2u p s0 s1 s t0 t1 t (union phi s0 t0) (union phi s1 t1) else if included_prefix p q then (* q contains p. Merge t with a subtree of s *) if zero_bit q p then br0u p s0 s1 s (union phi s0 t) (* t has bit m = 0 => t is inside s0 *) else br1u p s0 s1 s (union phi s1 t) (* t has bit m = 1 => t is inside s1 *) else if included_prefix q p then (* p contains q. Merge s with a subtree of t *) if zero_bit p q then br0u q t0 t1 t (union phi s t0) (* s has bit n = 0 => s is inside t0 *) else br1u q t0 t1 t (union phi s t1) (* t has bit n = 1 => s is inside t1 *) else (* prefix disagree *) join p s q t (* -------------------------------------------------------------------------- *) (* --- Merge --- *) (* -------------------------------------------------------------------------- *) let map1 phi s = mapf (fun i x -> phi i (Some x) None) s let map2 phi t = mapf (fun j y -> phi j None (Some y)) t let rec merge phi s t = match s , t with | Empty , _ -> map2 phi t | _ , Empty -> map1 phi s | Lf(i,x) , Lf(j,y) -> if i = j then lf i (phi i (Some x) (Some y)) else let a = lf i (phi i (Some x) None) in let b = lf j (phi j None (Some y)) in glue a b | Lf(i,x) , Br(q,t0,t1) -> if match_prefix i q then (* leaf i is in tree t *) if zero_bit i q then glue (merge phi s t0) (map2 phi t1) (* s=i is in t0 *) else glue (map2 phi t0) (merge phi s t1) (* s=i is in t1 *) else (* leaf i does not appear in t *) glue (lf i (phi i (Some x) None)) (map2 phi t) | Br(p,s0,s1) , Lf(j,y) -> if match_prefix j p then (* leaf j is in tree s *) if zero_bit j p then glue (merge phi s0 t) (map1 phi s1) (* t=j is in s0 *) else glue (map1 phi s0) (merge phi s1 t) (* t=j is in s1 *) else (* leaf j does not appear in s *) glue (map1 phi s) (lf j (phi j None (Some y))) | Br(p,s0,s1) , Br(q,t0,t1) -> if p == q then (* prefixes agree *) glue (merge phi s0 t0) (merge phi s1 t1) else if included_prefix p q then (* q contains p. Merge t with a subtree of s *) if zero_bit q p then (* t has bit m = 0 => t is inside s0 *) glue (merge phi s0 t) (map1 phi s1) else (* t has bit m = 1 => t is inside s1 *) glue (map1 phi s0) (merge phi s1 t) else if included_prefix q p then (* p contains q. Merge s with a subtree of t *) if zero_bit p q then (* s has bit n = 0 => s is inside t0 *) glue (merge phi s t0) (map2 phi t1) else (* s has bit n = 1 => s is inside t1 *) glue (map2 phi t0) (merge phi s t1) else glue (map1 phi s) (map2 phi t) (* good sharing with s *) let rec diffq phi s t = match s , t with | Empty , _ -> s | _ , Empty -> s | Lf(i,x) , Lf(j,y) -> if i = j then lfq phi i x y s t else s | Lf(i,x) , Br _ -> (match occur i t with None -> s | Some y -> lfq phi i x y s t) | Br _ , Lf(j,y) -> change (fun j y x -> match x with None -> None | Some x -> phi j x y) j y s | Br(p,s0,s1) , Br(q,t0,t1) -> if p == q then (* prefixes agree *) let t0' = (diffq phi s0 t0) in let t1' = (diffq phi s1 t1) in glue01 t0' t1' s0 s1 s else if included_prefix p q then (* q contains p. *) if zero_bit q p then (* t has bit m = 0 => t is inside s0 *) let s0' = (diffq phi s0 t) in glue0 s0' s0 s1 s else (* t has bit m = 1 => t is inside s1 *) let s1' = (diffq phi s1 t) in glue1 s1' s0 s1 s else if included_prefix q p then (* p contains q. *) if zero_bit p q then diffq phi s t0 (* s has bit n = 0 => s is inside t0 *) else diffq phi s t1 (* t has bit n = 1 => s is inside t1 *) else (* prefix disagree *) s (* -------------------------------------------------------------------------- *) (* --- Iter Kernel --- *) (* -------------------------------------------------------------------------- *) let rec iterk phi s t = match s , t with | Empty , _ | _ , Empty -> () | Lf(i,x) , Lf(j,y) -> if i = j then phi i x y | Lf(i,x) , Br _ -> (match occur i t with None -> () | Some y -> phi i x y) | Br _ , Lf(j,y) -> (match occur j s with None -> () | Some x -> phi j x y) | Br(p,s0,s1) , Br(q,t0,t1) -> if p == q then (* prefixes agree *) (iterk phi s0 t0 ; iterk phi s1 t1) else if included_prefix p q then (* q contains p. Intersect t with a subtree of s *) if zero_bit q p then iterk phi s0 t (* t has bit m = 0 => t is inside s0 *) else iterk phi s1 t (* t has bit m = 1 => t is inside s1 *) else if included_prefix q p then (* p contains q. Intersect s with a subtree of t *) if zero_bit p q then iterk phi s t0 (* s has bit n = 0 => s is inside t0 *) else iterk phi s t1 (* t has bit n = 1 => s is inside t1 *) else (* prefix disagree *) () (* -------------------------------------------------------------------------- *) (* --- Iter2 --- *) (* -------------------------------------------------------------------------- *) let iter21 phi s = iteri (fun i x -> phi i (Some x) None) s let iter22 phi t = iteri (fun j y -> phi j None (Some y)) t let rec iter2 phi s t = match s , t with | Empty , _ -> iter22 phi t | _ , Empty -> iter21 phi s | Lf(i,x) , Lf(j,y) -> if i = j then phi i (Some x) (Some y) else ( phi i (Some x) None ; phi j None (Some y) ) | Lf(i,x) , Br(q,t0,t1) -> if match_prefix i q then (* leaf i is in tree t *) if zero_bit i q then (iter2 phi s t0 ; iter22 phi t1) (* s=i is in t0 *) else (iter22 phi t0 ; iter2 phi s t1) (* s=i is in t1 *) else (* leaf i does not appear in t *) (phi i (Some x) None ; iter22 phi t) | Br(p,s0,s1) , Lf(j,y) -> if match_prefix j p then (* leaf j is in tree s *) if zero_bit j p then (iter2 phi s0 t ; iter21 phi s1) (* t=j is in s0 *) else (iter21 phi s0 ; iter2 phi s1 t) (* t=j is in s1 *) else (* leaf j does not appear in s *) (iter21 phi s ; phi j None (Some y)) | Br(p,s0,s1) , Br(q,t0,t1) -> if p == q then (* prefixes agree *) (iter2 phi s0 t0 ; iter2 phi s1 t1) else if included_prefix p q then (* q contains p. Merge t with a subtree of s *) if zero_bit q p then (* t has bit m = 0 => t is inside s0 *) (iter2 phi s0 t ; iter21 phi s1) else (* t has bit m = 1 => t is inside s1 *) (iter21 phi s0 ; iter2 phi s1 t) else if included_prefix q p then (* p contains q. Merge s with a subtree of t *) if zero_bit p q then (* s has bit n = 0 => s is inside t0 *) (iter2 phi s t0 ; iter22 phi t1) else (* s has bit n = 1 => s is inside t1 *) (iter22 phi t0 ; iter2 phi s t1) else (iter21 phi s ; iter22 phi t) (* -------------------------------------------------------------------------- *) (* --- Intersects --- *) (* -------------------------------------------------------------------------- *) let rec intersectf phi s t = match s , t with | Empty , _ -> false | _ , Empty -> false | Lf(i,x) , Lf(j,y) -> if i = j then phi i x y else false | Lf(i,x) , Br _ -> (match occur i t with None -> false | Some y -> phi i x y) | Br _ , Lf(j,y) -> (match occur j s with None -> false | Some x -> phi j x y) | Br(p,s0,s1) , Br(q,t0,t1) -> if p == q then (* prefixes agree *) (intersectf phi s0 t0) || (intersectf phi s1 t1) else if included_prefix p q then (* q contains p. Intersect t with a subtree of s *) if zero_bit q p then intersectf phi s0 t (* t has bit m = 0 => t is inside s0 *) else intersectf phi s1 t (* t has bit m = 1 => t is inside s1 *) else if included_prefix q p then (* p contains q. Intersect s with a subtree of t *) if zero_bit p q then intersectf phi s t0 (* s has bit n = 0 => s is inside t0 *) else intersectf phi s t1 (* t has bit n = 1 => s is inside t1 *) else (* prefix disagree *) false let intersect s t = intersectf (fun _i _x _y -> true) s t (* -------------------------------------------------------------------------- *) (* --- Subset --- *) (* -------------------------------------------------------------------------- *) let rec subsetf phi s t = match s , t with | Empty , _ -> true | _ , Empty -> false | Lf(i,x) , Lf(j,y) -> if i = j then phi i x y else false | Lf(i,x) , Br _ -> (match occur i t with None -> false | Some y -> phi i x y) | Br _ , Lf _ -> false | Br(p,s0,s1) , Br(q,t0,t1) -> if p == q then (* prefixes agree *) (subsetf phi s0 t0 && subsetf phi s1 t1) else if included_prefix p q then (* q contains p: t is included in a (strict) subtree of s *) false else if included_prefix q p then (* p contains q: s is included in a subtree of t *) if zero_bit p q then subsetf phi s t0 (* s has bit n = 0 => s is inside t0 *) else subsetf phi s t1 (* t has bit n = 1 => s is inside t1 *) else (* prefix disagree *) false let subset = subsetf let subsetk s t = subsetf (fun _i _x _y -> true) s t (* -------------------------------------------------------------------------- *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/intmap.mli�����������������������������������������������������0000666�0000000�0000000�00000007504�13571573400�016235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Maps with integers keys using Patricia Trees. From the paper of Chris Okasaki and Andrew Gill: 'Fast Mergeable Integer Maps'. *) type 'a t val empty : 'a t val singleton : int -> 'a -> 'a t val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val is_empty : 'a t -> bool val size : 'a t -> int val mem : int -> 'a t -> bool val find : int -> 'a t -> 'a (** or raise Not_found *) val add : int -> 'a -> 'a t -> 'a t val remove : int -> 'a t -> 'a t (** [insert (fun key v old -> ...) key v map] *) val insert : (int -> 'a -> 'a -> 'a) -> int -> 'a -> 'a t -> 'a t val change : (int -> 'b -> 'a option -> 'a option) -> int -> 'b -> 'a t -> 'a t val iter : ('a -> unit) -> 'a t -> unit val iteri : (int -> 'a -> unit) -> 'a t -> unit val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b val foldi : (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val mapl : (int -> 'a -> 'b) -> 'a t -> 'b list val map : ('a -> 'b) -> 'a t -> 'b t val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t val mapf : (int -> 'a -> 'b option) -> 'a t -> 'b t val mapq : (int -> 'a -> 'a option) -> 'a t -> 'a t val filter : (int -> 'a -> bool) -> 'a t -> 'a t val partition : (int -> 'a -> bool) -> 'a t -> 'a t * 'a t val partition_split : (int -> 'a -> 'a option * 'a option) -> 'a t -> 'a t * 'a t val for_all: (int -> 'a -> bool) -> 'a t -> bool val exists: (int -> 'a -> bool) -> 'a t -> bool val union : (int -> 'a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t val inter : (int -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val interf : (int -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t val interq : (int -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val diffq : (int -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val subsetk : 'a t -> 'b t -> bool val subset : (int -> 'a -> 'b -> bool) -> 'a t -> 'b t -> bool val intersect : 'a t -> 'b t -> bool val intersectf : (int -> 'a -> 'b -> bool) -> 'a t -> 'b t -> bool val merge : (int -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t val iter2 : (int -> 'a option -> 'b option -> unit) -> 'a t -> 'b t -> unit val iterk : (int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit val pp_bits : Format.formatter -> int -> unit val pp_tree : string -> Format.formatter -> 'a t -> unit ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/intset.ml������������������������������������������������������0000666�0000000�0000000�00000005271�13571573400�016101� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ---------------------------------------------------------------------- *) (* --- Patricia Sets By L. Correnson & P. Baudin --- *) (* ---------------------------------------------------------------------- *) type t = unit Intmap.t let empty = Intmap.empty let singleton x = Intmap.singleton x () let add x = Intmap.add x () let remove x = Intmap.remove x let is_empty = Intmap.is_empty let mem = Intmap.mem let cardinal = Intmap.size let compare = Intmap.compare (fun () () -> 0) let equal = Intmap.equal (fun () () -> true) let _keep _ _ _ = () let _keepq _ _ _ = Some () let _same _ () () = true let union = Intmap.union _keep let inter = Intmap.interq _keepq let diff = Intmap.diffq _keepq let subset = Intmap.subset _same let intersect = Intmap.intersectf _same let iter f = Intmap.iteri (fun i () -> f i) let fold f = Intmap.foldi (fun i () e -> f i e) let filter f = Intmap.filter (fun i () -> f i) let partition f = Intmap.partition (fun i () -> f i) let for_all f = Intmap.for_all (fun i () -> f i) let exists f = Intmap.exists (fun i () -> f i) let elements = Intmap.mapl (fun i () -> i) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/intset.mli�����������������������������������������������������0000666�0000000�0000000�00000004530�13571573400�016247� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Set of integers using Patricia Trees. From the paper of Chris Okasaki and Andrew Gill: 'Fast Mergeable Integer Maps'. *) type t val compare : t -> t -> int val equal : t -> t -> bool val empty : t val singleton : int -> t val is_empty : t -> bool val cardinal : t -> int val elements : t -> int list val mem : int -> t -> bool val add : int -> t -> t val remove :int -> t -> t val union : t -> t -> t val inter : t -> t -> t val diff : t -> t -> t val subset : t -> t -> bool val iter : (int -> unit) -> t -> unit val fold : (int -> 'a -> 'a) -> t -> 'a -> 'a val for_all : (int -> bool) -> t -> bool val exists : (int -> bool) -> t -> bool val filter : (int -> bool) -> t -> t val partition : (int -> bool) -> t -> t * t val intersect : t -> t -> bool ������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/kind.ml��������������������������������������������������������0000666�0000000�0000000�00000017236�13571573400�015524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Tau & Sort Manipulations --- *) (* -------------------------------------------------------------------------- *) open Logic let rec of_poly alpha = function | Prop -> Sprop | Bool -> Sbool | Int -> Sint | Real -> Sreal | Tvar x -> alpha x | Data _ -> Sdata | Array(_,d) -> Sarray (of_poly alpha d) | Record _ -> Sdata let of_tau t = of_poly (fun _ -> Sdata) t let rec merge a b = match a,b with | Sprop , _ | _ , Sprop -> Sprop | Sbool , _ | _ , Sbool -> Sbool | Sarray x , Sarray y -> Sarray (merge x y) | Sarray _ , _ | _ , Sarray _ -> Sdata | Sint , Sint -> Sint | Sint , Sreal | Sreal , Sint -> Sreal | Sreal , Sreal -> Sreal | Sdata , _ | _ , Sdata -> Sdata let image = function Sarray s -> s | _ -> Sdata let rec merge_list f s = function | [] -> s | x::xs -> if s = Sprop then Sprop else merge_list f (merge s (f x)) xs let pretty fmt = function | Sprop -> Format.pp_print_string fmt "Prop" | Sbool -> Format.pp_print_string fmt "Bool" | Sdata -> Format.pp_print_string fmt "Term" | Sint -> Format.pp_print_string fmt "Int" | Sreal -> Format.pp_print_string fmt "Real" | Sarray _ -> Format.pp_print_string fmt "Array" let basename = function | Sprop | Sbool -> "P" | Sdata -> "a" | Sint -> "x" | Sreal -> "r" | Sarray _ -> "m" let rec degree_of_tau = function | Tvar n -> n | Int | Real | Bool | Prop -> 0 | Data(_,ts) -> degree_of_list ts | Array(a,b) -> max (degree_of_tau a) (degree_of_tau b) | Record fts -> List.fold_left (fun r (_,t) -> max r (degree_of_tau t)) 0 fts and degree_of_list = function | [] -> 0 | t::ts -> max (degree_of_tau t) (degree_of_list ts) and degree_of_sig f = max (degree_of_tau f.result) (degree_of_list f.params) let rec tmap xs = function | Int -> Int | Real -> Real | Bool -> Bool | Prop -> Prop | Tvar k -> xs.(k-1) | Array(a,b) -> Array(tmap xs a,tmap xs b) | Data(a,ts) -> Data(a,List.map (tmap xs) ts) | Record fts -> Record(List.map (fun (f,t) -> f,tmap xs t) fts) let type_params n = let rec vars k n = if k <= n then Tvar k :: vars (succ k) n else [] in vars 1 n let pp_data pdata ptau fmt a = function | [] -> pdata fmt a | [t] -> Format.fprintf fmt "%a %a" ptau t pdata a | t::ts -> Format.fprintf fmt "@[(@[<hov 2>%a" ptau t ; List.iter (fun t -> Format.fprintf fmt ",@,%a" ptau t) ts ; Format.fprintf fmt ")@]@ %a@]" pdata a let pp_record pfield ptau fmt ?(opened=false) fts = Format.fprintf fmt "@[<hv 0>{@[<hv 2>" ; List.iter (fun (f,t) -> Format.fprintf fmt "@ @[<hov 2>%a : %a ;@]" pfield f ptau t) fts ; if opened then Format.fprintf fmt "@ ..." ; Format.fprintf fmt "@]@ }@]" let rec pp_tau pvar pfield pdata fmt = function | Int -> Format.pp_print_string fmt "int" | Real -> Format.pp_print_string fmt "real" | Bool -> Format.pp_print_string fmt "bool" | Prop -> Format.pp_print_string fmt "prop" | Tvar x -> pvar fmt x | Array(Int,te) -> Format.fprintf fmt "%a[]" (pp_tau pvar pfield pdata) te | Array(tk,te) -> Format.fprintf fmt "%a[%a]" (pp_tau pvar pfield pdata) te (pp_tau pvar pfield pdata) tk | Data(a,ts) -> pp_data pdata (pp_tau pvar pfield pdata) fmt a ts | Record fts -> pp_record pfield (pp_tau pvar pfield pdata) fmt fts let rec hash_tau hfield hadt = function | Int -> 0 | Real -> 1 | Bool -> 2 | Prop -> 3 | Tvar k -> 4+k | Array(tk,te) -> 7 * Hcons.hash_pair (hash_tau hfield hadt tk) (hash_tau hfield hadt te) | Data(a,te) -> 11 * Hcons.hash_list (hash_tau hfield hadt) (hadt a) te | Record fts -> Hcons.hash_list (hash_field hfield hadt) 13 fts and hash_field hfield hadt (f,t) = Hcons.hash_pair (hfield f) (hash_tau hfield hadt t) let rec eq_tau cfield cadt t1 t2 = match t1 , t2 with | (Bool|Int|Real|Prop|Tvar _) , (Bool|Int|Real|Prop|Tvar _) -> t1 = t2 | Array(ta,tb) , Array(ta',tb') -> eq_tau cfield cadt ta ta' && eq_tau cfield cadt tb tb' | Array _ , _ | _ , Array _ -> false | Data(a,ts) , Data(b,ts') -> cadt a b && Hcons.equal_list (eq_tau cfield cadt) ts ts' | Data _ , _ | _ , Data _ -> false | Record fts , Record gts -> Hcons.equal_list (fun (f,t) (g,t') -> cfield f g && eq_tau cfield cadt t t') fts gts | Record _ , _ | _ , Record _ -> false let rec compare_tau cfield cadt t1 t2 = match t1 , t2 with | Bool , Bool -> 0 | Bool , _ -> (-1) | _ , Bool -> 1 | Int , Int -> 0 | Int , _ -> (-1) | _ , Int -> 1 | Real , Real -> 0 | Real , _ -> (-1) | _ , Real -> 1 | Prop , Prop -> 0 | Prop , _ -> (-1) | _ , Prop -> 1 | Tvar k , Tvar k' -> Transitioning.Stdlib.compare k k' | Tvar _ , _ -> (-1) | _ , Tvar _ -> 1 | Array(ta,tb) , Array(ta',tb') -> let c = compare_tau cfield cadt ta ta' in if c = 0 then compare_tau cfield cadt tb tb' else c | Array _ , _ -> (-1) | _ , Array _ -> 1 | Data(a,ts) , Data(b,ts') -> let c = cadt a b in if c = 0 then Hcons.compare_list (compare_tau cfield cadt) ts ts' else c | Data _ , _ -> (-1) | _ , Data _ -> 1 | Record fts , Record gts -> Hcons.compare_list (fun (f,t) (g,t') -> let c = cfield f g in if c = 0 then compare_tau cfield cadt t t' else c ) fts gts module MakeTau(F : Field)(A : Data) = struct type t = (F.t,A.t) datatype let equal = eq_tau F.equal A.equal let compare = compare_tau F.compare A.compare let hash = hash_tau F.hash A.hash let pretty = pp_tau (fun fmt k -> Format.fprintf fmt "`%d" k) F.pretty A.pretty let debug f = let buffer = Buffer.create 80 in let fmt = Format.formatter_of_buffer buffer in pretty fmt f ; Format.pp_print_flush fmt () ; Buffer.contents buffer let basename = function | Int -> "i" | Real -> "r" | Prop -> "p" | Bool -> "p" | Data(a,_) -> A.basename a | Array _ -> "t" | Tvar 1 -> "a" | Tvar 2 -> "b" | Tvar 3 -> "c" | Tvar 4 -> "d" | Tvar 5 -> "e" | Tvar _ -> "f" | Record _ -> "r" end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/kind.mli�������������������������������������������������������0000666�0000000�0000000�00000006220�13571573400�015664� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Sort and Types Tools --- *) (* -------------------------------------------------------------------------- *) (** Logic Types Utilities *) open Logic val of_tau : ('f,'a) datatype -> sort val of_poly : (int -> sort) -> ('f,'a) datatype -> sort val image : sort -> sort val degree_of_tau : ('f,'a) datatype -> int val degree_of_list : ('f,'a) datatype list -> int val degree_of_sig : ('f,'a) funtype -> int val type_params : int -> ('f,'a) datatype list val merge : sort -> sort -> sort val merge_list : ('a -> sort) -> sort -> 'a list -> sort val tmap : ('a,'f) datatype array -> ('a,'f) datatype -> ('a,'f) datatype val basename : sort -> string val pretty : Format.formatter -> sort -> unit val pp_tau : (Format.formatter -> int -> unit) -> (Format.formatter -> 'f -> unit) -> (Format.formatter -> 'a -> unit) -> Format.formatter -> ('f,'a) datatype -> unit val pp_data : (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> Format.formatter -> 'a -> 'b list -> unit val pp_record: (Format.formatter -> 'f -> unit) -> (Format.formatter -> 'b -> unit) -> Format.formatter -> ?opened:bool -> ('f * 'b) list -> unit val eq_tau : ('f -> 'f -> bool) -> ('a -> 'a -> bool) -> ('f,'a) datatype -> ('f,'a) datatype -> bool val compare_tau: ('f -> 'f -> int) -> ('a -> 'a -> int) -> ('f,'a) datatype -> ('f,'a) datatype -> int module MakeTau(F : Field)(A : Data) : Data with type t = (F.t,A.t) datatype ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/listmap.ml�����������������������������������������������������0000666�0000000�0000000�00000024320�13571573400�016240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Merging List-map Functor --- *) (* -------------------------------------------------------------------------- *) module type Key = sig type t val equal : t -> t -> bool val compare : t -> t -> int end module Make(K : Key) = struct (* Should be implemented using listset *) type key = K.t type 'a t = (key * 'a) list let compare cmp = Hcons.compare_list (fun (i,x) (j,y) -> let r = K.compare i j in if r != 0 then r else cmp x y) let equal eq = Hcons.equal_list (fun (i,x) (j,y) -> K.equal i j && eq x y) let empty = [] let is_empty = function [] -> true | _ -> false (* used for better sharing between a list and a modified list *) let rev_append_until i l1 l2 = let rec aux acc = function | [] -> acc | i'::_ when i'==i -> acc | i'::l -> aux (i'::acc) l in aux l2 l1 (* used for better sharing between a list and a modified list *) let append_until i l1 l2 = List.rev_append (rev_append_until i l1 []) l2 (* good sharing *) let mapq f l = let rec aux ((res,rest) as acc) = function | [] -> List.rev_append res rest | ((k,v) as i) :: resti -> (match f k v with | None -> (* remove *) aux ((rev_append_until i rest res),resti) resti | Some v' -> if v'==v then (* add idem *) aux acc resti else (* add new *) aux (((k,v')::(rev_append_until i rest res)),resti) resti) in aux ([],l) l (* good sharing *) (* idem List.filter, but returns l if no element is removed. *) let filter f l = let rec aux ((res,rest) as acc) = function | [] -> List.rev_append res rest | i :: resti -> if f i then (* add idem *) aux acc resti else (* remove *) aux ((rev_append_until i rest res),resti) resti in aux ([],l) l (* good sharing *) (* idem List.partition, better sharing. *) let partition f l = let rec aux ((res,rest) as acc) ((res',rest') as acc') = function | [] -> (List.rev_append res rest), (List.rev_append res' rest') | ((k,v) as i) :: resti -> if f k v then aux acc ((rev_append_until i rest' res'),resti) resti else aux ((rev_append_until i rest res),resti) acc' resti in aux ([],l) ([],l) l (* good sharing *) let change f k v l = let rec aux = function | [] -> (match f k v None with None -> l | Some w -> l @ [k,w]) | ((k',v') as a)::next-> let c = K.compare k k' in if c < 0 then l else if c = 0 then match f k v (Some v') with | None -> append_until a l next | Some w -> if w==v' then l else append_until a l ((k, w) :: next) else (* c > 0 *) aux next in aux l (* good sharing *) let insert f k v l = let rec aux = function | [] -> l @ [k,v] | (((k',v') as a)::next) as w -> let c = K.compare k k' in if c < 0 then append_until a l ((k,v) :: w) else if c = 0 then let w = f k v v' in if w==v' then l else append_until a l ((k, w) :: next) else (* c > 0 *) aux next in aux l (* good sharing *) let add k x = insert (fun _k x _old -> x) k x let rec findk k = function | [] -> raise Not_found | ((k0,_) as e) :: next -> let c = K.compare k k0 in if c < 0 then raise Not_found else if c > 0 then findk k next else e let find k m = snd (findk k m) let mem k m = try ignore (find k m) ; true with Not_found -> false let mapi f = List.map (fun (k,v) -> k,f k v) let map f = mapi (fun _k v -> f v) let iter f = List.iter (fun (k,v) -> f k v) (* good sharing *) let remove k m = change (fun _ _ _ -> None) k () m (* good sharing *) let filter f m = filter (fun (k,x) -> f k x) m let rec mapf f = function | [] -> [] | (k,x)::m -> match f k x with | Some y -> (k,y)::mapf f m | None -> mapf f m let fold f m a = List.fold_left (fun a (k,v) -> f k v a) a m let rec inter f w1 w2 = match w1 , w2 with | [] , _ | _ , [] -> [] | (k1,v1)::r1 , (k2,v2)::r2 -> let c = K.compare k1 k2 in if c < 0 then inter f r1 w2 else if c > 0 then inter f w1 r2 else (k1,f k1 v1 v2) :: inter f r1 r2 let rec interf f w1 w2 = match w1 , w2 with | [] , _ | _ , [] -> [] | (k1,v1)::r1 , (k2,v2)::r2 -> let c = K.compare k1 k2 in if c < 0 then interf f r1 w2 else if c > 0 then interf f w1 r2 else match f k1 v1 v2 with | None -> interf f r1 r2 | Some v12 -> (k1,v12) :: interf f r1 r2 (* good sharing with w1 *) let interq f w1 w2 = let rec aux ((res,o1) as acc) w1 w2 = match w1 , w2 with | [] , _ -> (* no addition *) List.rev_append res o1 | a1::_, [] -> (* no addition *) List.rev_append res (List.rev (rev_append_until a1 o1 [])) | ((k1,v1) as a1)::r1 , (k2,v2)::r2 -> let c = K.compare k1 k2 in if c < 0 then (* remove a1 *) aux ((rev_append_until a1 o1 res),r1) r1 w2 else if c > 0 then (* remove a2 *) aux acc w1 r2 else match f k1 v1 v2 with | None -> (* remove a1 *) aux ((rev_append_until a1 o1 res),r1) r1 r2 | Some w -> if w==v1 then (* adding a1 *) aux acc r1 r2 else (* adding w *) aux (((k1,w)::(rev_append_until a1 o1 res)), r1) r1 r2 in aux ([],w1) w1 w2 (* good sharing with w1 *) let diffq f w1 w2 = let rec aux ((res,o1) as acc) w1 w2 = match w1 , w2 with | [] , _ -> (* no addition *) List.rev_append res o1 | _ , [] -> (* adding w1 *) List.rev_append res o1 | ((k1,v1) as a1)::r1 , (k2,v2)::r2 -> let c = K.compare k1 k2 in if c < 0 then (* adding a1 *) aux acc r1 w2 else if c > 0 then (* skip *) aux acc w1 r2 else match f k1 v1 v2 with | None -> (* remove a1 *) aux ((rev_append_until a1 o1 res),r1) r1 r2 | Some w -> if w==v1 then (* adding a1 *) aux acc r1 r2 else (* adding w *) aux (((k1,w)::(rev_append_until a1 o1 res)), r1) r1 r2 in aux ([],w1) w1 w2 (* good sharing with w1 *) let union f w1 w2 = let rec aux ((res,o1) as acc) w1 w2 = match w1 , w2 with | [] , _ -> (* adding w2 *) List.rev_append res (List.append o1 w2) | _ , [] -> (* adding w1 *) List.rev_append res o1 | ((k1,v1) as a1)::r1 , ((k2,v2) as a2)::r2 -> let c = K.compare k1 k2 in if c < 0 then (* adding a1 *) aux acc r1 w2 else if c = 0 then let w = f k1 v1 v2 in if w==v1 then (* adding a1 *) aux acc r1 r2 else (* adding w *) aux (((k1,w)::(rev_append_until a1 o1 res)), r1) r1 r2 else (* c > 0 *) (* adding a2 *) aux ((a2::(rev_append_until a1 o1 res)),w1) w1 r2 in aux ([],w1) w1 w2 let rec subset f w1 w2 = match w1 , w2 with | [] , _ -> true | _::_ , [] -> false | (k1,v1)::r1 , (k2,v2)::r2 -> let c = K.compare k1 k2 in if c < 0 then false else if c > 0 then subset f w1 r2 else f k1 v1 v2 && subset f r1 r2 let rec iterk (f : K.t -> 'a -> 'b -> unit) (w1 : (K.t * 'a) list) (w2 : (K.t * 'b) list) = match w1 , w2 with | [] , _ | _ , [] -> () | (k1,v1)::r1 , (k2,v2)::r2 -> let c = K.compare k1 k2 in if c < 0 then iterk f r1 w2 else if c > 0 then iterk f w1 r2 else (f k1 v1 v2 ; iterk f r1 r2) let rec iter2 (f : K.t -> 'a option -> 'b option -> unit) (w1 : (K.t * 'a) list) (w2 : (K.t * 'b) list) = match w1 , w2 with | [] , [] -> () | _ , [] -> List.iter (fun (k1,v1) -> f k1 (Some v1) None) w1 | [] , _ -> List.iter (fun (k2,v2) -> f k2 None (Some v2)) w2 | (k1,v1)::r1 , (k2,v2)::r2 -> let c = K.compare k1 k2 in if c < 0 then (f k1 (Some v1) None ; iter2 f r1 w2) else if c > 0 then (f k2 None (Some v2) ; iter2 f w1 r2) else (f k1 (Some v1) (Some v2) ; iter2 f r1 r2) let cons k v w = match v with | None -> w | Some x -> (k,x) :: w let rec merge (f : K.t -> 'a option -> 'b option -> 'c option) w1 w2 = match w1 , w2 with | [] , [] -> [] | _ , [] -> mapf (fun k1 v1 -> f k1 (Some v1) None) w1 | [] , _ -> mapf (fun k2 v2 -> f k2 None (Some v2)) w2 | (k1,v1)::r1 , (k2,v2)::r2 -> let c = K.compare k1 k2 in if c < 0 then cons k1 (f k1 (Some v1) None) (merge f r1 w2) else if c > 0 then cons k2 (f k2 None (Some v2)) (merge f w1 r2) else cons k1 (f k1 (Some v1) (Some v2)) (merge f r1 r2) end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/listmap.mli����������������������������������������������������0000666�0000000�0000000�00000006773�13571573400�016425� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Merging List-Association Functor *) (* -------------------------------------------------------------------------- *) module type Key = sig type t val equal : t -> t -> bool val compare : t -> t -> int end module Make(K : Key) : sig type key = K.t type 'a t = (key * 'a) list val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val empty : 'a t val is_empty : 'a t -> bool val add : key -> 'a -> 'a t -> 'a t val mem : key -> 'a t -> bool val find : key -> 'a t -> 'a val findk : key -> 'a t -> key * 'a val remove : key -> 'a t -> 'a t (** [insert (fun key v old -> ...) key v map] *) val insert : (key -> 'a -> 'a -> 'a) -> key -> 'a -> 'a t -> 'a t val change : (key -> 'b -> 'a option -> 'a option) -> key -> 'b -> 'a t -> 'a t val filter : (key -> 'a -> bool) -> 'a t -> 'a t val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t val map : ('a -> 'b) -> 'a t -> 'b t val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t val mapf : (key -> 'a -> 'b option) -> 'a t -> 'b t val mapq : (key -> 'a -> 'a option) -> 'a t -> 'a t val iter : (key -> 'a -> unit) -> 'a t -> unit val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val union : (key -> 'a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t val inter : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val interf : (key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t val interq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val diffq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val subset : (key -> 'a -> 'b -> bool) -> 'a t -> 'b t -> bool val iterk : (key -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit val iter2 : (key -> 'a option -> 'b option -> unit) -> 'a t -> 'b t -> unit val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t end �����frama-c-20.0-Calcium/src/plugins/qed/listset.ml�����������������������������������������������������0000666�0000000�0000000�00000015602�13571573400�016261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Merging List-Set Functor --- *) (* -------------------------------------------------------------------------- *) module type Elt = sig type t val equal : t -> t -> bool val compare : t -> t -> int end module Make(E : Elt) = struct type elt = E.t type t = E.t list let compare = Hcons.compare_list E.compare let equal = Hcons.equal_list E.equal let empty = [] let is_empty = function [] -> true | _ -> false (* used for better sharing between a list and a modified list *) let rev_append_until i l1 l2 = let rec aux acc = function | [] -> acc | i'::_ when i'==i -> acc | i'::l -> aux (i'::acc) l in aux l2 l1 (* used for better sharing between a list and a modified list *) let append_until i l1 l2 = List.rev_append (rev_append_until i l1 []) l2 (* good sharing *) (* idem List.filter, but returns l if no element is removed. *) let filter f l = let rec aux ((res,rest) as acc) = function | [] -> List.rev_append res rest | i :: resti -> if f i then aux acc resti else aux ((rev_append_until i rest res),resti) resti in aux ([],l) l (* good sharing *) let partition f l = let rec aux ((res,rest) as acc) ((res',rest') as acc') = function | [] -> (List.rev_append res rest), (List.rev_append res' rest') | i :: resti -> if f i then aux acc ((rev_append_until i rest' res'),resti) resti else aux ((rev_append_until i rest res),resti) acc' resti in aux ([],l) ([],l) l (* good sharing *) let add k l = let rec aux = function | [] -> l @ [k] | (k'::next) as w -> let c = E.compare k k' in if c < 0 then append_until k' l (k::w) else if c = 0 then l else (* c > 0 *) aux next in aux l (* good sharing *) let remove k l = let rec aux = function | [] -> l | (k'::next) as w -> let c = E.compare k k' in if c > 0 then append_until k' l w else if c = 0 then append_until k' l next else (* c > 0 *) aux next in aux l let rec mem x = function | [] -> false | e::es -> let c = E.compare x e in if c < 0 then false else if c > 0 then mem x es else true let iter = List.iter let fold = List.fold_right (* good sharing with w1 *) let union w1 w2 = let rec aux ((res,o1) as acc) w1 w2 = match w1 , w2 with | [] , _ -> (* adding w2 *) List.rev_append res (List.append o1 w2) | _ , [] -> (* adding w1 *) List.rev_append res o1 | a1::r1 , a2::r2 -> let c = E.compare a1 a2 in if c < 0 then (* adding a1 *) aux acc r1 w2 else if c = 0 then (* adding a1 *) aux acc r1 r2 else (* c > 0 *) (* adding a2 *) aux ((a2::(rev_append_until a1 o1 res)),w1) w1 r2 in aux ([],w1) w1 w2 (* good sharing with w1 *) let interf f w1 w2 = let rec aux ((res,o1) as acc) w1 w2 = match w1 , w2 with | [] , _ -> (* no addition *) List.rev_append res o1 | a1::_, [] -> (* no addition *) List.rev_append res (List.rev (rev_append_until a1 o1 [])) | a1::r1 , a2::r2 -> let c = E.compare a1 a2 in if c < 0 then (* remove a1 *) aux ((rev_append_until a1 o1 res),r1) r1 w2 else if c > 0 then (* skip a2 *) aux acc w1 r2 else if not (f a1) then (* remove a1 *) aux ((rev_append_until a1 o1 res),r1) r1 r2 else (* adding a1 *) aux acc r1 r2 in aux ([],w1) w1 w2 let inter = interf (fun _ -> true) (* good sharing with w1 *) let diff w1 w2 = let rec aux ((res,o1) as acc) w1 w2 = match w1 , w2 with | [] , _ -> (* no addition *) List.rev_append res o1 | _ , [] -> (* adding w1 *) List.rev_append res o1 | a1::r1 , a2::r2 -> let c = E.compare a1 a2 in if c < 0 then (* adding a1 *) aux acc r1 w2 else if c > 0 then (* skip *) aux acc w1 r2 else (* remove a1 *) aux ((rev_append_until a1 o1 res),r1) r1 r2 in aux ([],w1) w1 w2 let rec subsetf f xs ys = match xs , ys with | [] , _ -> true | _::_ , [] -> false | (x::xtail) , (y::ytail) -> let c = E.compare x y in if c < 0 then false else if c > 0 then subsetf f xs ytail else (f x && subsetf f xtail ytail) let subset = subsetf (fun _ -> true) let rec intersectf f xs ys = match xs , ys with | [] , _ | _ , [] -> false | (x::xtail) , (y::ytail) -> let c = E.compare x y in if c < 0 then intersectf f xtail ys else if c > 0 then intersectf f xs ytail else f x let intersect = intersectf (fun _ -> true) let rec fact rxs cxs rys xs ys = match xs , ys with | [] , _ | _ , [] -> List.rev_append rxs xs , List.rev cxs , List.rev_append rys ys | x::xtail , y::ytail -> let c = E.compare x y in if c < 0 then fact (x::rxs) cxs rys xtail ys else if c > 0 then fact rxs cxs (y::rys) xs ytail else fact rxs (x::cxs) rys xtail ytail let factorize xs ys = fact [] [] [] xs ys let rec big_union = function | [] -> [] | e::es -> union e (big_union es) let rec big_inter = function | [] -> [] | [e] -> e | e::es -> inter e (big_inter es) end ������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/listset.mli����������������������������������������������������0000666�0000000�0000000�00000005267�13571573400�016440� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Merging Set Functor *) (* -------------------------------------------------------------------------- *) module type Elt = sig type t val equal : t -> t -> bool val compare : t -> t -> int end module Make(E : Elt) : sig type elt = E.t type t = elt list val equal : t -> t -> bool val compare : t -> t -> int val empty : t val is_empty : t -> bool (* good sharing *) val add : elt -> t -> t (* good sharing *) val remove : elt -> t -> t val mem : elt -> t -> bool val iter : (elt -> unit) -> t -> unit val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a (* good sharing *) val filter : (elt -> bool) -> t -> t val partition : (elt -> bool) -> t -> t * t (* good sharing *) val union : t -> t -> t (* good sharing *) val inter : t -> t -> t (* good sharing *) val diff : t -> t -> t val subset : t -> t -> bool val intersect : t -> t -> bool val factorize : t -> t -> t * t * t (** Returns (left,common,right) *) val big_union : t list -> t val big_inter : t list -> t end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/logic.ml�������������������������������������������������������0000666�0000000�0000000�00000045127�13571573400�015674� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** {1 First Order Logic Definition} *) (* -------------------------------------------------------------------------- *) type 'a element = | E_none | E_true | E_false | E_int of int | E_fun of 'a * 'a element list (** Algebraic properties for user operators. *) type 'a operator = { invertible : bool ; (* x+y = x+z <-> y=z (on both side) *) associative : bool ; (* x+(y+z)=(x+y)+z *) commutative : bool ; (* x+y=y+x *) idempotent : bool ; (* x+x = x *) neutral : 'a element ; absorbant : 'a element ; } (** Algebraic properties for functions. *) type 'a category = | Function (** logic function *) | Constructor (** [f xs = g ys] iff [f=g && xi=yi] *) | Injection (** [f xs = f ys] iff [xi=yi] *) | Operator of 'a operator (** Quantifiers and Binders *) type binder = | Forall | Exists | Lambda type ('f,'a) datatype = | Prop | Bool | Int | Real | Tvar of int (** ranges over [1..arity] *) | Array of ('f,'a) datatype * ('f,'a) datatype | Record of ('f * ('f,'a) datatype) list | Data of 'a * ('f,'a) datatype list type sort = | Sprop | Sbool | Sint | Sreal | Sdata | Sarray of sort type maybe = Yes | No | Maybe (** Ordered, hash-able and pretty-printable symbols *) module type Symbol = sig type t val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int val pretty : Format.formatter -> t -> unit val debug : t -> string (** for printing during debug *) end (** {2 Abstract Data Types} *) module type Data = sig include Symbol val basename : t -> string (** hint for generating fresh names *) end (** {2 Field for Record Types} *) module type Field = sig include Symbol val sort : t -> sort (** of field *) end (** {2 User Defined Functions} *) module type Function = sig include Symbol val category : t -> t category val params : t -> sort list (** params ; exceeding params use Sdata *) val sort : t -> sort (** result *) end (** {2 Bound Variables} *) module type Variable = sig include Symbol val sort : t -> sort val basename : t -> string val dummy : t end (** {2 Representation of Patterns, Functions and Terms} *) type ('f,'a) funtype = { result : ('f,'a) datatype ; (** Type of returned value *) params : ('f,'a) datatype list ; (** Type of parameters *) } (** representation of terms. type arguments are the following: - 'z: representation of integral constants - 'f: representation of fields - 'a: representation of abstract data types - 'd: representation of functions - 'x: representation of free variables - 'b: representation of bound term (phantom type equal to 'e) - 'e: sub-expression *) type ('f,'a,'d,'x,'b,'e) term_repr = | True | False | Kint of Z.t | Kreal of Q.t | Times of Z.t * 'e (** mult: k1 * e2 *) | Add of 'e list (** add: e11 + ... + e1n *) | Mul of 'e list (** mult: e11 * ... * e1n *) | Div of 'e * 'e | Mod of 'e * 'e | Eq of 'e * 'e | Neq of 'e * 'e | Leq of 'e * 'e | Lt of 'e * 'e | Aget of 'e * 'e (** access: array1[idx2] *) | Aset of 'e * 'e * 'e (** update: array1[idx2 -> elem3] *) | Acst of ('f,'a) datatype * 'e (** constant array [ type -> value ] *) | Rget of 'e * 'f | Rdef of ('f * 'e) list | And of 'e list (** and: e11 && ... && e1n *) | Or of 'e list (** or: e11 || ... || e1n *) | Not of 'e | Imply of 'e list * 'e (** imply: (e11 && ... && e1n) ==> e2 *) | If of 'e * 'e * 'e (** ite: if c1 then e2 else e3 *) | Fun of 'd * 'e list (** Complete call (no partial app.) *) | Fvar of 'x | Bvar of int * ('f,'a) datatype | Apply of 'e * 'e list (** High-Order application (Cf. binder) *) | Bind of binder * ('f,'a) datatype * 'b type 'a affine = { constant : Z.t ; factors : (Z.t * 'a) list } (** {2 Formulae} *) module type Term = sig module ADT : Data module Field : Field module Fun : Function module Var : Variable type term type lc_term (** Loosely closed terms. *) module Term : Symbol with type t = term (** Non-structural, machine dependent, but fast comparison and efficient merges *) module Tset : Idxset.S with type elt = term (** Non-structural, machine dependent, but fast comparison and efficient merges *) module Tmap : Idxmap.S with type key = term (** Structuraly ordered, but less efficient access and non-linear merges *) module STset : Set.S with type elt = term (** Structuraly ordered, but less efficient access and non-linear merges *) module STmap : Map.S with type key = term (** {3 Variables} *) type var = Var.t type tau = (Field.t,ADT.t) datatype module Tau : Data with type t = tau module Vars : Idxset.S with type elt = var module Vmap : Idxmap.S with type key = var type pool val pool : ?copy:pool -> unit -> pool val add_var : pool -> var -> unit val add_vars : pool -> Vars.t -> unit val add_term : pool -> term -> unit val fresh : pool -> ?basename:string -> tau -> var val alpha : pool -> var -> var val tau_of_var : var -> tau val sort_of_var : var -> sort val base_of_var : var -> string (** {3 Terms} *) type 'a expression = (Field.t,ADT.t,Fun.t,var,lc_term,'a) term_repr type repr = term expression type record = (Field.t * term) list val decide : term -> bool (** Return [true] if and only the term is [e_true]. Constant time. *) val is_true : term -> maybe (** Constant time. *) val is_false : term -> maybe (** Constant time. *) val is_prop : term -> bool (** Boolean or Property *) val is_int : term -> bool (** Integer sort *) val is_real : term -> bool (** Real sort *) val is_arith : term -> bool (** Integer or Real sort *) val are_equal : term -> term -> maybe (** Computes equality *) val eval_eq : term -> term -> bool (** Same as [are_equal] is [Yes] *) val eval_neq : term -> term -> bool (** Same as [are_equal] is [No] *) val eval_lt : term -> term -> bool (** Same as [e_lt] is [e_true] *) val eval_leq : term -> term -> bool (** Same as [e_leq] is [e_true] *) val repr : term -> repr (** Constant time *) val sort : term -> sort (** Constant time *) val vars : term -> Vars.t (** Constant time *) (** Path-positioning access This part of the API is DEPRECATED *) type path = int list (** position of a subterm in a term. *) val subterm: term -> path -> term [@@deprecated "Path-access might be unsafe in presence of binders"] val change_subterm: term -> path -> term -> term [@@deprecated "Path-access might be unsafe in presence of binders"] (** {3 Basic constructors} *) val e_true : term val e_false : term val e_bool : bool -> term val e_literal : bool -> term -> term val e_int : int -> term val e_float : float -> term val e_zint : Z.t -> term val e_real : Q.t -> term val e_var : var -> term val e_opp : term -> term val e_times : Z.t -> term -> term val e_sum : term list -> term val e_prod : term list -> term val e_add : term -> term -> term val e_sub : term -> term -> term val e_mul : term -> term -> term val e_div : term -> term -> term val e_mod : term -> term -> term val e_eq : term -> term -> term val e_neq : term -> term -> term val e_leq : term -> term -> term val e_lt : term -> term -> term val e_imply : term list -> term -> term val e_equiv : term -> term -> term val e_and : term list -> term val e_or : term list -> term val e_not : term -> term val e_if : term -> term -> term -> term val e_const : tau -> term -> term val e_get : term -> term -> term val e_set : term -> term -> term -> term val e_getfield : term -> Field.t -> term val e_record : record -> term val e_fun : ?result:tau -> Fun.t -> term list -> term val e_repr : ?result:tau -> repr -> term (** @raise Invalid_argument on [Bvar] and [Bind] *) (** {3 Quantifiers and Binding} *) val e_forall : var list -> term -> term val e_exists : var list -> term -> term val e_lambda : var list -> term -> term val e_apply : term -> term list -> term val e_bind : binder -> var -> term -> term (** Bind the given variable if it appears free in the term, or return the term unchanged. *) val lc_open : var -> lc_term -> term [@@deprecated "Use e_unbind instead"] val e_unbind : var -> lc_term -> term (** Opens the top-most bound variable with a (fresh) variable. Can be only applied on top-most lc-term from `Bind(_,_,_)`, thanks to typing. *) val e_open : pool:pool -> ?forall:bool -> ?exists:bool -> ?lambda:bool -> term -> (binder * var) list * term (** Open all the specified binders (flags default to `true`, so all consecutive top most binders are opened by default). The pool must contain all free variables of the term. *) val e_close : (binder * var) list -> term -> term (** Closes all specified binders *) (** {3 Generalized Substitutions} *) type sigma val sigma : ?pool:pool -> unit -> sigma module Subst : sig type t = sigma val create : ?pool:pool -> unit -> t val fresh : t -> tau -> var val get : t -> term -> term val filter : t -> term -> bool val add : t -> term -> term -> unit (** Must bind lc-closed terms, or raise Invalid_argument *) val add_map : t -> term Tmap.t -> unit (** Must bind lc-closed terms, or raise Invalid_argument *) val add_fun : t -> (term -> term) -> unit (** Must bind lc-closed terms, or raise Invalid_argument *) val add_filter : t -> (term -> bool) -> unit (** Only modifies terms that {i pass} the filter. *) val add_var : t -> var -> unit (** To the pool *) val add_vars : t -> Vars.t -> unit (** To the pool *) val add_term : t -> term -> unit (** To the pool *) end val e_subst : sigma -> term -> term (** The environment sigma must be prepared with the desired substitution. Its pool of fresh variables must covers the entire domain and co-domain of the substitution, and the transformed values. *) val e_subst_var : var -> term -> term -> term (** {3 Locally Nameless Representation} These functions can be {i unsafe} because they might expose terms that contains non-bound b-vars. Never use such terms to build substitutions (sigma). *) val lc_vars : term -> Bvars.t val lc_closed : term -> bool (** All bound variables are under their binder *) val lc_repr : lc_term -> term (** Calling this function is {i unsafe} unless the term is lc_closed *) val lc_iter : (term -> unit) -> term -> unit (** Similar to [f_iter] but exposes non-closed sub-terms of `Bind` as regular [term] values instead of [lc_term] ones. *) (** {3 Iteration Scheme} *) val f_map : ?pool:pool -> ?forall:bool -> ?exists:bool -> ?lambda:bool -> (term -> term) -> term -> term (** Pass and open binders, maps its direct sub-terms and then close then opened binders Raises Invalid_argument in case of a bind-term without pool. The optional pool must contain all free variables of the term. *) val f_iter : ?pool:pool -> ?forall:bool -> ?exists:bool -> ?lambda:bool -> (term -> unit) -> term -> unit (** Iterates over its direct sub-terms (pass and open binders) Raises Invalid_argument in case of a bind-term without pool. The optional pool must contain all free variables of the term. *) (** {3 Partial Typing} *) (** Try to extract a type of term. Parameterized by optional extractors for field and functions. Extractors may raise [Not_found] ; however, they are only used when the provided kinds for fields and functions are not precise enough. @param field type of a field value @param record type of the record containing a field @param call type of the values returned by the function @raise Not_found if no type is found. *) val typeof : ?field:(Field.t -> tau) -> ?record:(Field.t -> tau) -> ?call:(Fun.t -> tau option list -> tau) -> term -> tau (** {3 Support for Builtins} *) val set_builtin : Fun.t -> (term list -> term) -> unit (** Register a simplifier for function [f]. The computation code may raise [Not_found], in which case the symbol is not interpreted. If [f] is an operator with algebraic rules (see type [operator]), the children are normalized {i before} builtin call. Highest priority is [0]. Recursive calls must be performed on strictly smaller terms. *) val set_builtin' : Fun.t -> (term list -> tau option -> term) -> unit val set_builtin_map : Fun.t -> (term list -> term list) -> unit (** Register a builtin for rewriting [f a1..an] into [f b1..bm]. This is short cut for [set_builtin], where the head application of [f] avoids to run into an infinite loop. *) val set_builtin_get : Fun.t -> (term list -> tau option -> term -> term) -> unit (** [set_builtin_get f rewrite] register a builtin for rewriting [(f a1..an)[k]] into [rewrite (a1..an) k]. The type given is the type of (f a1..an). *) val set_builtin_eq : Fun.t -> (term -> term -> term) -> unit (** Register a builtin equality for comparing any term with head-symbol. {b Must} only use recursive comparison for strictly smaller terms. The recognized term with head function symbol is passed first. Highest priority is [0]. Recursive calls must be performed on strictly smaller terms. *) val set_builtin_leq : Fun.t -> (term -> term -> term) -> unit (** Register a builtin for comparing any term with head-symbol. {b Must} only use recursive comparison for strictly smaller terms. The recognized term with head function symbol can be on both sides. Strict comparison is automatically derived from the non-strict one. Highest priority is [0]. Recursive calls must be performed on strictly smaller terms. *) (** {3 Specific Patterns} *) val consequence : term -> term -> term (** Knowing [h], [consequence h a] returns [b] such that [h -> (a<->b)] *) val literal : term -> bool * term val affine : term -> term affine val record_with : record -> (term * record) option (** {3 Symbol} *) type t = term val id : t -> int (** unique identifier (stored in t) *) val hash : t -> int (** constant access (stored in t) *) val equal : t -> t -> bool (** physical equality *) val compare : t -> t -> int (** atoms are lower than complex terms ; otherwise, sorted by id. *) val pretty : Format.formatter -> t -> unit val weigth : t -> int (** Informal size *) (** {3 Utilities} *) val is_closed : t -> bool (** No bound variables *) val is_simple : t -> bool (** Constants, variables, functions of arity 0 *) val is_atomic : t -> bool (** Constants and variables *) val is_primitive : t -> bool (** Constants only *) val is_neutral : Fun.t -> t -> bool val is_absorbant : Fun.t -> t -> bool val size : t -> int val basename : t -> string val debug : Format.formatter -> t -> unit val pp_id : Format.formatter -> t -> unit (** internal id *) val pp_rid : Format.formatter -> t -> unit (** head symbol with children id's *) val pp_repr : Format.formatter -> repr -> unit (** head symbol with children id's *) (** {2 Shared sub-terms} *) val is_subterm : term -> term -> bool (** Occurrence check. [is_subterm a b] returns [true] iff [a] is a subterm of [b]. Optimized {i wrt} shared subterms, term size, and term variables. *) val shared : ?shared:(term -> bool) -> ?shareable:(term -> bool) -> ?subterms:((term -> unit) -> term -> unit) -> term list -> term list (** Computes the sub-terms that appear several times. [shared marked linked e] returns the shared subterms of [e]. The list of shared subterms is consistent with order of definition: each trailing terms only depend on heading ones. The traversal is controlled by two optional arguments: - [shared] those terms are not traversed (considered as atomic, default to none) - [shareable] those terms ([is_simple] excepted) that can be shared (default to all) - [subterms] those sub-terms a term to be considered during traversal ([lc_iter] by default) *) (** Low-level shared primitives: [shared] is actually a combination of building marks, marking terms, and extracting definitions: {[ let share ?... e = let m = marks ?... () in List.iter (mark m) es ; defs m ]} *) type marks (** Create a marking accumulator. Same defaults than [shared]. *) val marks : ?shared:(term -> bool) -> ?shareable:(term -> bool) -> ?subterms:((term -> unit) -> term -> unit) -> unit -> marks (** Mark a term to be printed *) val mark : marks -> term -> unit (** Mark a term to be explicitly shared *) val share : marks -> term -> unit (** Returns a list of terms to be shared among all {i shared} or {i marked} subterms. The order of terms is consistent with definition order: head terms might be used in tail ones. *) val defs : marks -> term list end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/mergemap.ml����������������������������������������������������0000666�0000000�0000000�00000012145�13571573400�016366� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Merging Map Functor --- *) (* -------------------------------------------------------------------------- *) module type Key = sig type t val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int end module Make(K : Key) = struct module Lmap = Listmap.Make(K) type key = K.t type 'a t = 'a Lmap.t Intmap.t (* sorted collisions *) let is_empty m = try Intmap.iteri (fun _ m -> if m<>[] then raise Exit) m ; true with Exit -> false let empty = Intmap.empty let _nonempty = function [] -> None | l -> Some l let _nonempty_inv = function None -> [] | Some l -> l (* good sharing *) let insert f k v m = let h = K.hash k in Intmap.insert (fun _h kv old -> match kv with | [k,v] -> Lmap.insert f k v old | _ -> assert false) h [k,v] m (* good sharing *) (* val change : (key -> 'b -> 'a option -> 'a option) -> key -> 'b -> 'a t -> 'a t*) let change (f:key -> 'b -> 'a option -> 'a option) (k:key) (v:'b) (m:'a t) = let h = K.hash k in Intmap.change (fun _h (k,v) -> function | None -> (match f k v None with | None -> None | Some w -> Some [k,w]) | Some old -> _nonempty (Lmap.change f k v old)) h (k,v) m (* good sharing *) let add k v = insert (fun _k x _old -> x) k v let find k m = Lmap.find k (Intmap.find (K.hash k) m) let findk k m = Lmap.findk k (Intmap.find (K.hash k) m) let mem k m = try ignore (find k m) ; true with Not_found -> false let map f m = Intmap.map (Lmap.map f) m let mapi f m = Intmap.map (Lmap.mapi f) m let mapf f = Intmap.mapf (fun _h w -> _nonempty (Lmap.mapf f w)) (* good sharing *) let mapq f = Intmap.mapq (fun _h w -> _nonempty (Lmap.mapq f w)) (* good sharing *) let filter f = Intmap.mapq (fun _k w -> _nonempty (Lmap.filter f w)) (* good sharing *) let remove k m = let h = K.hash k in Intmap.change (fun _h k -> function | None -> None | Some old -> _nonempty (Lmap.remove k old)) h k m let iter f m = Intmap.iter (Lmap.iter f) m let iter_sorted f m = let xs = Intmap.fold (List.merge (fun a b -> K.compare (fst a) (fst b))) m [] in List.iter (fun (k,v) -> f k v) xs let fold f m a = Intmap.fold (Lmap.fold f) m a let fold_sorted f m a = let xs = Intmap.fold (List.merge (fun a b -> K.compare (fst a) (fst b))) m [] in List.fold_left (fun acc (k,v) -> f k v acc) a xs let size m = fold (fun _ _ w -> succ w) m 0 (* good sharing *) let partition p = Intmap.partition_split (fun _k w -> let u,v = Lmap.partition p w in (_nonempty u), (_nonempty v)) (* good sharing *) let union f = Intmap.union (fun _h -> Lmap.union f) let inter f = Intmap.inter (fun _h -> Lmap.inter f) let interf f = Intmap.interf (fun _h a b -> _nonempty (Lmap.interf f a b)) (* good sharing *) let interq f = Intmap.interq (fun _h a b -> _nonempty (Lmap.interq f a b)) (* good sharing *) let diffq f = Intmap.diffq (fun _h a b -> _nonempty (Lmap.diffq f a b)) let subset f = Intmap.subset (fun _h -> Lmap.subset f) let equal eq m1 m2 = Intmap.equal (Lmap.equal eq) m1 m2 let iterk f = Intmap.iterk (fun _h -> Lmap.iterk f) let iter2 f = Intmap.iter2 (fun _h u1 u2 -> Lmap.iter2 f (_nonempty_inv u1) (_nonempty_inv u2)) (* good sharing *) let merge f = Intmap.merge (fun _h u1 u2 -> _nonempty (Lmap.merge f (_nonempty_inv u1) (_nonempty_inv u2))) end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/mergemap.mli���������������������������������������������������0000666�0000000�0000000�00000007143�13571573400�016541� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Merging Map Functor *) (* -------------------------------------------------------------------------- *) module type Key = sig type t val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int end module Make(K : Key) : sig type key = K.t type 'a t = (key * 'a) list Intmap.t val is_empty : 'a t -> bool val empty : 'a t val add : key -> 'a -> 'a t -> 'a t val mem : key -> 'a t -> bool val find : key -> 'a t -> 'a val findk : key -> 'a t -> key * 'a val remove : key -> 'a t -> 'a t val size : 'a t -> int (** [insert (fun key v old -> ...) key v map] *) val insert : (key -> 'a -> 'a -> 'a) -> key -> 'a -> 'a t -> 'a t val change : (key -> 'b -> 'a option -> 'a option) -> key -> 'b -> 'a t -> 'a t val filter : (key -> 'a -> bool) -> 'a t -> 'a t val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t val map : ('a -> 'b) -> 'a t -> 'b t val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t val mapf : (key -> 'a -> 'b option) -> 'a t -> 'b t val mapq : (key -> 'a -> 'a option) -> 'a t -> 'a t val iter : (key -> 'a -> unit) -> 'a t -> unit val iter_sorted : (key -> 'a -> unit) -> 'a t -> unit val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val fold_sorted: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val union : (key -> 'a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t val inter : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val interf : (key -> 'a -> 'b -> 'c option) -> 'a t -> 'b t -> 'c t val interq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val diffq : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t val subset : (key -> 'a -> 'b -> bool) -> 'a t -> 'b t -> bool val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val iterk : (key -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit val iter2 : (key -> 'a option -> 'b option -> unit) -> 'a t -> 'b t -> unit val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/mergeset.ml����������������������������������������������������0000666�0000000�0000000�00000010401�13571573400�016375� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Merging Set Functor --- *) (* -------------------------------------------------------------------------- *) module type Elt = sig type t val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int end module Make(E : Elt) = struct module Lset = Listset.Make(E) type elt = E.t type t = E.t list Intmap.t let _nonempty = function [] -> None | l -> Some l let is_empty es = try Intmap.iteri (fun _ s -> if s <> [] then raise Exit) es ; true with Exit -> false let empty = Intmap.empty let add e m = let h = E.hash e in let w = try Lset.add e (Intmap.find h m) with Not_found -> [e] in Intmap.add h w m let singleton e = let h = E.hash e in Intmap.add h [e] Intmap.empty let mem e m = try Lset.mem e (Intmap.find (E.hash e) m) with Not_found -> false let elements m = Intmap.fold (fun w xs -> List.merge E.compare w xs) m [] let iter_sorted f m = List.iter f (elements m) let fold_sorted f m a = List.fold_left (fun acc x -> f x acc) a (elements m) (* good sharing *) let filter f m = Intmap.mapq (fun _ l -> _nonempty (Lset.filter f l)) m (* good sharing *) let remove k m = let h = E.hash k in Intmap.change (fun _h k -> function | None -> None | Some old -> _nonempty (Lset.remove k old)) h k m (* good sharing *) let partition f = Intmap.partition_split (fun _k w -> let u,v = Lset.partition f w in (_nonempty u), (_nonempty v)) exception BREAK let iter f = Intmap.iter (Lset.iter f) let fold f = Intmap.fold (Lset.fold f) let for_all f m = try iter (fun x -> if not (f x) then raise BREAK) m ; true with BREAK -> false let exists f m = try iter (fun x -> if f x then raise BREAK) m ; false with BREAK -> true (* good sharing *) let diff = Intmap.diffq (fun _h a b -> match Lset.diff a b with | [] -> None | l -> Some l ) (* good sharing *) let union = Intmap.union (fun _h -> Lset.union) (* good sharing *) let inter = Intmap.inter (fun _h -> Lset.inter) (* good sharing *) let subset = Intmap.subset (fun _h -> Lset.subset) let intersect m1 m2 = try Intmap.iter2 (fun _h xs ys -> match xs , ys with | None , _ | _ , None -> () | Some w1 , Some w2 -> if Lset.intersect w1 w2 then raise Exit ) m1 m2 ; false with Exit -> true let equal = Intmap.equal Lset.equal let compare = Intmap.compare Lset.compare let of_list l = List.fold_left (fun acc e -> add e acc) empty l end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/mergeset.mli���������������������������������������������������0000666�0000000�0000000�00000005414�13571573400�016556� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Merging Set Functor *) (* -------------------------------------------------------------------------- *) module type Elt = sig type t val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int end module Make(E : Elt) : sig type elt = E.t type t = elt list Intmap.t val equal : t -> t -> bool val compare : t -> t -> int val is_empty : t -> bool val empty : t (* good sharing *) val add : elt -> t -> t val singleton : elt -> t val elements : t -> elt list (* good sharing *) val remove : elt -> t -> t val mem : elt -> t -> bool val iter : (elt -> unit) -> t -> unit val iter_sorted : (elt -> unit) -> t -> unit val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a val fold_sorted: (elt -> 'a -> 'a) -> t -> 'a -> 'a val filter : (elt -> bool) -> t -> t val partition : (elt -> bool) -> t -> t * t val for_all : (elt -> bool) -> t -> bool val exists : (elt -> bool) -> t -> bool val union : t -> t -> t val inter : t -> t -> t val diff : t -> t -> t val subset : t -> t -> bool val intersect : t -> t -> bool val of_list : elt list -> t end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/partition.ml���������������������������������������������������0000666�0000000�0000000�00000010056�13571573400�016601� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type Elt = sig type t val equal : t -> t -> bool val compare : t -> t -> int end module type Set = sig type t type elt val singleton : elt -> t val iter : (elt -> unit) -> t -> unit val union : t -> t -> t val inter : t -> t -> t end module type Map = sig type 'a t type key val empty : 'a t val is_empty : 'a t -> bool val find : key -> 'a t -> 'a val add : key -> 'a -> 'a t -> 'a t val remove : key -> 'a t -> 'a t val iter : (key -> 'a -> unit) -> 'a t -> unit end module Make(E : Elt) (S : Set with type elt = E.t) (M : Map with type key = E.t) = struct type elt = E.t type set = S.t type t = { mutable dag : E.t M.t ; members : S.t M.t ; size : int ; } let empty = { size = 0 ; dag = M.empty ; members = M.empty } let rec lookup p a = try let a0 = M.find a p.dag in let a1 = lookup p a0 in p.dag <- M.add a a1 p.dag ; a1 with Not_found -> a let equal t a b = E.equal (lookup t a) (lookup t b) let members p e = try M.find e p.members with Not_found -> S.singleton e let merge p a b = let a = lookup p a in let b = lookup p b in let cmp = E.compare a b in if cmp = 0 then p else let c = S.union (members p a) (members p b) in let size = succ p.size in if cmp < 0 then { size ; dag = M.add b a p.dag ; members = M.add a c (M.remove b p.members) ; } else { size ; dag = M.add a b p.dag ; members = M.add b c (M.remove a p.members) ; } let rec merge_with p e = function | [] -> p | e'::es -> merge_with (merge p e e') e es let merge_list p = function | [] -> p | e::es -> merge_with p e es let merge_set p s = let p = ref p in let w = ref None in S.iter (fun e -> match !w with | None -> w := Some e | Some u -> p := merge !p u e ) s ; !p let iter f p = M.iter f p.members let unstable_iter f p = M.iter f p.dag let map f p = let r = ref empty in M.iter (fun a b -> r := merge !r (f a) (f b)) p.dag ; !r let merge_dag p dag = let r = ref p in M.iter (fun a b -> r := merge !r a b) dag ; !r let union p q = if p.size < q.size then merge_dag q p.dag else merge_dag p q.dag let inter p q = let r = ref empty in M.iter (fun _ ca -> M.iter (fun _ cb -> r := merge_set !r (S.inter ca cb) ) q.members ) p.members ; !r let is_empty p = M.is_empty p.dag end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/partition.mli��������������������������������������������������0000666�0000000�0000000�00000005276�13571573400�016762� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Union-find based partitions *) module type Elt = sig type t val equal : t -> t -> bool val compare : t -> t -> int end module type Set = sig type t type elt val singleton : elt -> t val iter : (elt -> unit) -> t -> unit val union : t -> t -> t val inter : t -> t -> t end module type Map = sig type 'a t type key val empty : 'a t val is_empty : 'a t -> bool val find : key -> 'a t -> 'a val add : key -> 'a -> 'a t -> 'a t val remove : key -> 'a t -> 'a t val iter : (key -> 'a -> unit) -> 'a t -> unit end module Make(E : Elt) (S : Set with type elt = E.t) (M : Map with type key = E.t) : sig type t type elt = E.t type set = S.t val empty : t val equal : t -> elt -> elt -> bool val merge : t -> elt -> elt -> t val merge_list : t -> elt list -> t val merge_set : t -> set -> t val lookup : t -> elt -> elt val members : t -> elt -> set val iter : (elt -> set -> unit) -> t -> unit val unstable_iter : (elt -> elt -> unit) -> t -> unit val map : (elt -> elt) -> t -> t val union : t -> t -> t val inter : t -> t -> t val is_empty : t -> bool end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/plib.ml��������������������������������������������������������0000666�0000000�0000000�00000015076�13571573400�015525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Pretty Printing Library --- *) (* -------------------------------------------------------------------------- *) open Format let kprintf f text = let buffer = Buffer.create 80 in kfprintf (fun fmt -> pp_print_flush fmt () ; f (Buffer.contents buffer) ) (formatter_of_buffer buffer) text let sprintf text = kprintf (fun s -> s) text let failure text = kprintf (fun s -> failwith s) text let to_string pp x = let buffer = Buffer.create 80 in let fmt = formatter_of_buffer buffer in pp fmt x ; pp_print_flush fmt () ; Buffer.contents buffer type 'a printer = formatter -> 'a -> unit type 'a printer2 = formatter -> 'a -> 'a -> unit let pp_call_var ~f pp fmt = function | [] -> pp_print_string fmt f | x::xs -> fprintf fmt "@[<hov 2>%s(%a" f pp x ; List.iter (fun y -> fprintf fmt ",@ %a" pp y) xs ; fprintf fmt ")@]" let pp_call_void ~f pp fmt = function | [] -> fprintf fmt "%s()" f | x::xs -> fprintf fmt "@[<hov 2>%s(%a" f pp x ; List.iter (fun y -> fprintf fmt ",@ %a" pp y) xs ; fprintf fmt ")@]" let pp_call_apply ~f pp fmt = function | [] -> pp_print_string fmt f | xs -> fprintf fmt "@[<hov 2>(%s" f ; List.iter (fun y -> fprintf fmt "@ %a" pp y) xs ; fprintf fmt ")@]" let pp_binop ~op pp fmt a b = fprintf fmt "%a@ %s %a" pp a op pp b let print_not_empty s fmt = function | Some e -> pp_print_string fmt e | None -> invalid_arg ("Plib.print_not_empty: invariant broken: empty list for " ^ s) (** neutral element not given but the list is empty *) let pp_assoc ?e ~op pp fmt = function | [] -> print_not_empty op fmt e | x::xs -> pp fmt x ; List.iter (fun y -> fprintf fmt " %s@ %a" op pp y) xs let rec pp_fold_binop ?e ~op pp fmt = function | [] -> print_not_empty op fmt e | [x] -> pp fmt x | x::xs -> fprintf fmt "(%a %s@ %a)" pp x op (pp_fold_binop ?e ~op pp) xs let rec pp_fold_call ?e ~f pp fmt = function | [] -> print_not_empty f fmt e | [x] -> pp fmt x | x::xs -> fprintf fmt "%s(%a,@ %a)" f pp x (pp_fold_call ?e ~f pp) xs let rec pp_fold_apply ?e ~f pp fmt = function | [] -> print_not_empty f fmt e | [x] -> pp fmt x | x::xs -> fprintf fmt "(%s@ %a@ %a)" f pp x (pp_fold_apply ?e ~f pp) xs let rec pp_fold_call_rev ?e ~f pp fmt = function | [] -> print_not_empty f fmt e | [x] -> pp fmt x | x::xs -> fprintf fmt "%s(%a,@ %a)" f (pp_fold_call_rev ?e ~f pp) xs pp x let rec pp_fold_apply_rev ?e ~f pp fmt = function | [] -> print_not_empty f fmt e | [x] -> pp fmt x | x::xs -> fprintf fmt "(%s@ %a@ %a)" f pp x (pp_fold_apply_rev ?e ~f pp) xs let pp_listcompact ~sep pp fmt = function | [] -> () | x::xs -> pp fmt x ; List.iter (fun x -> fprintf fmt "%s@,%a" sep pp x) xs let pp_listsep ~sep pp fmt = function | [] -> () | x::xs -> pp fmt x ; List.iter (fun x -> fprintf fmt "%s@ %a" sep pp x) xs type index = Isingle | Ifirst | Ilast | Imiddle let iteri f = function | [] -> () | [x] -> f Isingle x | x::xs -> let rec iterk f = function | [] -> () | [x] -> f Ilast x | x::xs -> f Imiddle x ; iterk f xs in f Ifirst x ; iterk f xs let iterk f xs = let rec step f k = function | [] -> () | x::xs -> f k x ; step f (succ k) xs in step f 0 xs let mapk f xs = let rec step f k = function | [] -> [] | x::xs -> let y = f k x in y :: step f (succ k) xs in step f 0 xs (** the regexp shouldn't match empty *) let global_substitute_fmt regexp repl_fun fmt text = let rec replace start = if start < String.length text then try let pos = Str.search_forward regexp text start in let end_pos = Str.match_end () in assert (start <= pos && pos < end_pos); if start < pos then pp_print_string fmt (String.sub text start (pos - start)); repl_fun fmt (Str.matched_group 1 text); replace end_pos with Not_found -> pp_print_string fmt (Str.string_after text start) in replace 0 let regexp_arg_pos = Str.regexp "%\\([0-9]+\\)" let is_template p = try let _ = Str.search_forward regexp_arg_pos p 0 in true with Not_found -> false let substitute_list print s fmt l = let args = Array.of_list l in let repl_fun fmt grp = let i = int_of_string grp in let v = try args.(i-1) with Invalid_argument _ -> let msg = "Qed.Plib.substitute_list %" ^ string_of_int (i-1) in raise (Invalid_argument msg) in print fmt v in global_substitute_fmt regexp_arg_pos repl_fun fmt s (** the regexp shouldn't match empty *) let iter_group regexp iter_fun text = let rec iter start = if start < String.length text then try let pos = Str.search_forward regexp text start in let end_pos = Str.match_end () in assert (start <= pos && pos < end_pos); iter_fun (Str.matched_group 1 text); iter end_pos with Not_found -> () in iter 0 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/plib.mli�������������������������������������������������������0000666�0000000�0000000�00000010117�13571573400�015665� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Pretty Printing Utilities. *) (* -------------------------------------------------------------------------- *) (** Message Formatters *) val kprintf : (string -> 'b) -> ('a,Format.formatter,unit,'b) format4 -> 'a val sprintf : ('a,Format.formatter,unit,string) format4 -> 'a val failure : ('a,Format.formatter,unit,'b) format4 -> 'a val to_string : (Format.formatter -> 'a -> unit) -> 'a -> string (** Pretty printers *) type 'a printer = Format.formatter -> 'a -> unit type 'a printer2 = Format.formatter -> 'a -> 'a -> unit (** Function calls *) val pp_call_var : f:string -> 'a printer -> 'a list printer val pp_call_void : f:string -> 'a printer -> 'a list printer val pp_call_apply : f:string -> 'a printer -> 'a list printer (** Operators *) val pp_assoc : ?e:string -> op:string -> 'a printer -> 'a list printer val pp_binop : op:string -> 'a printer -> 'a printer2 val pp_fold_binop : ?e:string -> op:string -> 'a printer -> 'a list printer val pp_fold_call : ?e:string -> f:string -> 'a printer -> 'a list printer val pp_fold_apply : ?e:string -> f:string -> 'a printer -> 'a list printer val pp_fold_call_rev : ?e:string -> f:string -> 'a printer -> 'a list printer val pp_fold_apply_rev : ?e:string -> f:string -> 'a printer -> 'a list printer (** Iterations *) type index = Isingle | Ifirst | Ilast | Imiddle val iteri : (index -> 'a -> unit) -> 'a list -> unit val iterk : (int -> 'a -> unit) -> 'a list -> unit val mapk : (int -> 'a -> 'b) -> 'a list -> 'b list val pp_listcompact : sep:string -> 'a printer -> 'a list printer val pp_listsep : sep:string -> 'a printer -> 'a list printer (** string substitution *) val global_substitute_fmt : Str.regexp -> string printer -> Format.formatter -> string -> unit (** substitute the result of the given printer for each non-overlapping part of the given string that match the regexp *) val iter_group : Str.regexp -> (string -> unit) -> string -> unit (** call the given function for each non-overlapping part of the given string that match the regexp *) val substitute_list : 'a printer -> string -> 'a list printer (** [substitute_list templ print_arg fmt l] prints in the formatter [fmt] the list [l] using the template [templ] and the printer [print_arg]. The template use [%[0-9]+] hole. *) val is_template : string -> bool (** Check whether the string contains [%[0-9]+] holes to be used with [substitute_list]. *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/pool.ml��������������������������������������������������������0000666�0000000�0000000�00000007226�13571573400�015546� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Fresh Variable Management --- *) (* -------------------------------------------------------------------------- *) module type Type = sig type t val dummy : t val equal : t -> t -> bool end module Make(T : Type) = struct type var = { vid : int ; vbase : string ; vrank : int ; vtau : T.t ; } let hash_var x = Hcons.hash_pair x.vrank (Hashtbl.hash x.vbase) let pretty fmt x = Format.fprintf fmt "%s_%d" x.vbase x.vrank (* HASHCONSING *) module W = Weak.Make (struct type t = var let hash = hash_var let equal x y = x.vbase = y.vbase && x.vrank = y.vrank && T.equal x.vtau y.vtau end) let kid = ref 0 let hmap = W.create 32993 (* 3-th Leyland Prime number *) let insert base rank tau = let x0 = { vid = 0 ; vbase = base ; vrank = rank ; vtau = tau ; } in try W.find hmap x0 with Not_found -> let k = let i = !kid in (assert (i <> -1) ; incr kid ; i) in let x = { x0 with vid = k } in W.add hmap x ; x let dummy = insert "" 0 T.dummy let hash x = x.vid let equal = (==) let compare x y = let cmp = String.compare x.vbase y.vbase in if cmp <> 0 then cmp else let cmp = Transitioning.Stdlib.compare x.vrank y.vrank in if cmp <> 0 then cmp else Transitioning.Stdlib.compare x.vid y.vid (* POOL *) type pool = (string,int ref) Hashtbl.t let create ?copy () = match copy with | None -> Hashtbl.create 131 | Some pool -> Hashtbl.copy pool let counter pool base = try Hashtbl.find pool base with Not_found -> let c = ref 0 in Hashtbl.add pool base c ; c let add pool x = let c = counter pool x.vbase in if !c <= x.vrank then c := succ x.vrank let next pool base = let c = counter pool base in let k = !c in incr c ; k let fresh pool base tau = let rank = next pool base in insert base rank tau let alpha pool x = fresh pool x.vbase x.vtau end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/pool.mli�������������������������������������������������������0000666�0000000�0000000�00000004635�13571573400�015720� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Variable Management --- *) (* -------------------------------------------------------------------------- *) module type Type = sig type t val dummy : t val equal : t -> t -> bool end module Make(T : Type) : sig type var = (** Hashconsed *) private { vid : int ; vbase : string ; vrank : int ; vtau : T.t ; } val dummy : var (** null vid *) val hash : var -> int (** [vid] *) val equal : var -> var -> bool (** [==] *) val compare : var -> var -> int val pretty : Format.formatter -> var -> unit type pool val create : ?copy:pool -> unit -> pool val add : pool -> var -> unit val fresh : pool -> string -> T.t -> var val alpha : pool -> var -> var end ���������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/pretty.ml������������������������������������������������������0000666�0000000�0000000�00000043213�13571573400�016120� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Pretty Printer with sharing --- *) (* -------------------------------------------------------------------------- *) open Logic open Format open Plib module Make(T : Term) = struct open T (* -------------------------------------------------------------------------- *) (* --- Types --- *) (* -------------------------------------------------------------------------- *) let pp_tvarn fmt n = fprintf fmt "?%d" n let pp_alpha fmt = function | 0 -> pp_print_string fmt "'a" | 1 -> pp_print_string fmt "'b" | 2 -> pp_print_string fmt "'c" | 3 -> pp_print_string fmt "'d" | 4 -> pp_print_string fmt "'e" | n -> fprintf fmt "?%d" (n-4) let pp_tau fmt t = let n = Kind.degree_of_tau t in if 0<=n && n<5 then Kind.pp_tau pp_alpha Field.pretty ADT.pretty fmt t else Kind.pp_tau pp_tvarn Field.pretty ADT.pretty fmt t (* -------------------------------------------------------------------------- *) (* --- Shareable --- *) (* -------------------------------------------------------------------------- *) let shareable e = match T.repr e with | And _ | Or _ | Not _ | Imply _ | Eq _ | Neq _ | Leq _ | Lt _ -> false | Fun(f,_) -> (Fun.sort f <> Sprop && Fun.sort f <> Sbool) | _ -> true let subterms f e = match T.repr e with | Rdef fts -> begin match T.record_with fts with | None -> T.lc_iter f e | Some(a,fts) -> f a ; List.iter (fun (_,e) -> f e) fts end | _ -> T.lc_iter f e (* -------------------------------------------------------------------------- *) (* --- Variables --- *) (* -------------------------------------------------------------------------- *) module Idx = Map.Make(String) module Ids = Set.Make(String) type env = { mutable bound : string Intmap.t ; (* bound var *) mutable named : string Tmap.t ; (* named terms *) mutable index : int Idx.t ; (* index names *) mutable known : Ids.t ; (* known names *) } (* -------------------------------------------------------------------------- *) (* --- Environment --- *) (* -------------------------------------------------------------------------- *) let empty = { bound = Intmap.empty ; named = Tmap.empty ; index = Idx.empty ; known = Ids.empty ; } let copy env = { bound = env.bound ; named = env.named ; index = env.index ; known = env.known ; } (* -------------------------------------------------------------------------- *) (* --- Fresh --- *) (* -------------------------------------------------------------------------- *) let freshname env base = let rec scan env base k = let a = Printf.sprintf "%s_%d" base k in if Ids.mem a env.known then scan env base (succ k) else (env.index <- Idx.add base (succ k) env.index ; a) in scan env base (try Idx.find base env.index with Not_found -> 0) let known env xs = let env = copy env in Vars.iter (fun x -> let x = Plib.to_string Var.pretty x in env.known <- Ids.add x env.known ) xs ; env let marks env = T.marks ~shareable ~subterms ~shared:(fun t -> Tmap.mem t env.named) () let bind x t env = let env = copy env in env.named <- Tmap.add t x env.named ; env.known <- Ids.add x env.known ; env let fresh env t = let env = copy env in let x = freshname env (T.basename t) in env.named <- Tmap.add t x env.named ; env.known <- Ids.add x env.known ; x , env let bind_var env k t = let x = freshname env (Tau.basename t) in env.known <- Ids.add x env.known ; env.bound <- Intmap.add k x env.bound ; x let find_var env k = try Intmap.find k env.bound with Not_found -> Printf.sprintf "#%d" k (* -------------------------------------------------------------------------- *) (* --- Groups of Quantifiers --- *) (* -------------------------------------------------------------------------- *) module TauMap = Map.Make(T.Tau) let group_var t k = TauMap.add t [k] TauMap.empty let group_add t k tks = let ks = k :: try TauMap.find t tks with Not_found -> [] in TauMap.add t ks tks let rec group_binders k = function | [] -> [] | (q,t)::qts -> group_collect q (succ k) (group_var t k) qts and group_collect q k kts = function | [] -> [q,kts] | (q0,t) :: qts -> if q = q0 && q0 <> Lambda then group_collect q (succ k) (group_add t k kts) qts else (q,kts) :: group_collect q0 (succ k) (group_var t k) qts (* -------------------------------------------------------------------------- *) (* --- Output Form --- *) (* -------------------------------------------------------------------------- *) type out = | Sum of term list | Atom of string | Hbox of string * term list | Vbox of string * term list | Unop of string * term | Binop of ( term * string * term ) | Cond of ( term * term * term ) | Call of Fun.t * term list | Closure of term * term list | Const of term | Access of term * term | Update of term * term * term | Record of field list | GetField of term * Field.t | Abstraction of (binder * tau) list * term | Bind of int and field = | With of term | Field of Field.t * term | Last of Field.t * term let rec fields = function | [] -> [] | [f,v] -> [Last(f,v)] | (f,v)::fvs -> Field(f,v)::fields fvs let rec abstraction qxs e = match T.repr e with | Logic.Bind(q,x,t) -> abstraction ((q,x)::qxs) (lc_repr t) | _ -> Abstraction( List.rev qxs , e ) let out e = match T.repr e with | Bvar(k,_) -> Bind k | Fvar x -> Atom( Plib.to_string Var.pretty x ) | True -> Atom "true" | False -> Atom "false" | Kint z -> Atom (Z.to_string z) | Kreal r -> Atom (Q.to_string r) | Times(z,e) when Z.equal z Z.minus_one -> Unop("-",e) | Times(z,e) -> Hbox("*",[e_zint z;e]) | Add es -> Sum es | Mul es -> Hbox("*",es) | Div(a,b) -> Binop(a,"div",b) | Mod(a,b) -> Binop(a,"mod",b) | And es -> Vbox("/\\",es) | Or es -> Vbox("\\/",es) | Not e -> Unop("not ",e) | Imply(hs,p) ->Vbox("->",hs@[p]) | Eq(a,b) -> if T.sort e = Sprop then Vbox("<->",[a;b]) else Hbox("=",[a;b]) | Lt(a,b) -> Hbox("<",[a;b]) | Neq(a,b) -> Hbox("!=",[a;b]) | Leq(a,b) -> Hbox("<=",[a;b]) | Fun(a,es) -> Call(a,es) | Apply(e,es) -> Closure(e,es) | If(c,a,b) -> Cond(c,a,b) | Acst(_,v) -> Const(v) | Aget(a,b) -> Access(a,b) | Aset(a,b,c) -> Update(a,b,c) | Logic.Bind(q,x,e) -> abstraction [q,x] (lc_repr e) | Rget(e,f) -> GetField(e,f) | Rdef fvs -> Record begin match T.record_with fvs with | None -> fields fvs | Some(base,fothers) -> With base :: fields fothers end let named_out env e = try Atom(Tmap.find e env.named) with Not_found -> out e (* -------------------------------------------------------------------------- *) (* --- Atom printer --- *) (* -------------------------------------------------------------------------- *) let rec pp_atom (env:env) (fmt:formatter) e = pp_atom_out env fmt (named_out env e) and pp_atom_out env fmt = function | Bind k -> pp_print_string fmt (find_var env k) | Atom x -> pp_print_string fmt x | Call(f,es) -> pp_call env fmt f es | Sum es -> fprintf fmt "@[<hov 1>(%a)@]" (pp_sum false env) es | Hbox(op,es) -> fprintf fmt "@[<hov 1>(%a)@]" (pp_hbox env op) es | Vbox(op,es) -> fprintf fmt "@[<hov 1>(%a)@]" (pp_vbox env op) es | Unop(op,e) -> fprintf fmt "@[<hov 3>(%s%a)@]" op (pp_atom env) e | Binop op -> fprintf fmt "@[<hov 3>(%a)@]" (pp_binop env) op | Cond c -> fprintf fmt "@[<hv 1>(%a)@]" (pp_cond env) c | Closure(e,es) -> pp_closure env fmt e es | Abstraction(qts,abs) -> fprintf fmt "@[<v 1>(%t)@]" (pp_abstraction env qts abs) | Const(v) -> fprintf fmt "@[<hov 2>[%a..]@]" (pp_free env) v | Access(a,b) -> fprintf fmt "@[<hov 2>%a@,[%a]@]" (pp_atom env) a (pp_free env) b | Update(a,b,c) -> fprintf fmt "@[<hov 2>%a@,[%a@,->%a]@]" (pp_atom env) a (pp_atom env) b (pp_free env) c | GetField(e,f) -> fprintf fmt "%a.%a" (pp_atom env) e Field.pretty f | Record fs -> pp_fields env fmt fs and pp_free_out env fmt = function | Bind k -> pp_print_string fmt (find_var env k) | Atom x -> pp_print_string fmt x | Call(f,es) -> pp_call env fmt f es | Sum es -> fprintf fmt "@[<hov 1>%a@]" (pp_sum true env) es | Hbox(op,es) -> fprintf fmt "@[<hov 0>%a@]" (pp_hbox env op) es | Vbox(op,es) -> fprintf fmt "@[<hov 0>%a@]" (pp_vbox env op) es | Unop(op,e) -> fprintf fmt "@[<hov 2>%s%a@]" op (pp_atom env) e | Binop op -> fprintf fmt "@[<hov 2>%a@]" (pp_binop env) op | Cond c -> fprintf fmt "@[<hv 0>%a@]" (pp_cond env) c | Closure(e,es) -> pp_closure env fmt e es | Abstraction(qts,abs) -> fprintf fmt "@[<hv 0>%t@]" (pp_abstraction env qts abs) | (Const _ | Access _ | Update _ | Record _ | GetField _) as a -> pp_atom_out env fmt a and pp_fields (env:env) (fmt:formatter) fs = fprintf fmt "@[<hv 0>{@[<hv 2>" ; List.iter (function | With r -> fprintf fmt "@ %a with" (pp_atom env) r | Field (f,v) -> fprintf fmt "@ @[<hov 2>%a =@ %a ;@]" Field.pretty f (pp_free env) v | Last (f,v) -> fprintf fmt "@ @[<hov 2>%a =@ %a@]" Field.pretty f (pp_free env) v ) fs ; fprintf fmt "@]@ }@]" (* -------------------------------------------------------------------------- *) (* --- Free printer --- *) (* -------------------------------------------------------------------------- *) and pp_free (env:env) (fmt:formatter) e = pp_free_out env fmt (named_out env e) and pp_freedef (env:env) (fmt:formatter) e = pp_free_out env fmt (out e) (* -------------------------------------------------------------------------- *) (* --- Call printer --- *) (* -------------------------------------------------------------------------- *) and pp_call (env:env) (fmt:formatter) f = function | [] -> Fun.pretty fmt f | es -> fprintf fmt "@[<hov 2>(%a" Fun.pretty f ; List.iter (fun e -> fprintf fmt "@ %a" (pp_atom env) e) es ; fprintf fmt ")@]" (* -------------------------------------------------------------------------- *) (* --- Sum printer --- *) (* -------------------------------------------------------------------------- *) and pp_sum free (env:env) (fmt:formatter) es = let ps,ns = List.fold_right (fun e (ps,ns) -> match T.repr e with | Times(k,n) when Z.equal k Z.minus_one -> (ps,n::ns) | Kint k when Z.lt k Z.zero -> (ps,e_zint (Z.neg k) :: ns) | Kreal r when Q.lt r Q.zero -> (ps,e_real (Q.neg r) :: ns) | _ -> e::ps , ns) es ([],[]) in match ps , ns with | [] , [] -> pp_print_string fmt "0" | [] , _ -> if free then fprintf fmt "(%a)" (pp_factor env "-") ns else pp_factor env "-" fmt ns | p::ps , ns -> fprintf fmt "%a%a%a" (pp_atom env) p (pp_factor env "+") ps (pp_factor env "-") ns and pp_factor env op fmt es = List.iter (fun e -> fprintf fmt "%s@,%a" op (pp_atom env) e) es (* -------------------------------------------------------------------------- *) (* --- Horizontal Boxes --- *) (* -------------------------------------------------------------------------- *) and pp_hbox (env:env) (sep:string) (fmt:formatter) = function | [] -> pp_print_string fmt "()" | e::es -> fprintf fmt "%a%a" (pp_atom env) e (pp_factor env sep) es (* -------------------------------------------------------------------------- *) (* --- Vertical Boxes --- *) (* -------------------------------------------------------------------------- *) and pp_vbox (env:env) (sep:string) (fmt:formatter) = function | [] -> () | e::es -> pp_atom env fmt e ; List.iter (fun e -> fprintf fmt "@ %s %a" sep (pp_atom env) e) es (* -------------------------------------------------------------------------- *) (* --- Specific Operators --- *) (* -------------------------------------------------------------------------- *) and pp_binop (env:env) (fmt:formatter) (a,op,b) = fprintf fmt "%a@ %s %a" (pp_atom env) a op (pp_atom env) b and pp_cond (env:env) (fmt:formatter) (c,a,b) = fprintf fmt "if %a@ then %a@ else %a" (pp_atom env) c (pp_atom env) a (pp_atom env) b and pp_closure (env:env) (fmt:formatter) e es = fprintf fmt "@[<hov 3>(%a" (pp_atom env) e ; List.iter (fun e -> fprintf fmt "@ %a" (pp_atom env) e) es ; fprintf fmt ")@]" (* -------------------------------------------------------------------------- *) (* --- Abstraction --- *) (* -------------------------------------------------------------------------- *) and pp_abstraction (env:env) qts abs (fmt:formatter) = let env = copy env in let groups = group_binders 0 qts in let size = List.length qts in let last = Bvars.order (lc_vars abs) + size - 1 in List.iter (fun (q,m) -> match q with | Forall -> fprintf fmt "@[<hov 4>forall %a.@]@ " (pp_group env last) m | Exists -> fprintf fmt "@[<hov 4>exists %a.@]@ " (pp_group env last) m | Lambda -> fprintf fmt "@[<hov 4>fun %a ->@]@ " (pp_group env last) m ) groups ; pp_share env fmt abs and pp_group (env:env) (last:int) (fmt:formatter) m = let sep = ref false in TauMap.iter (fun t ks -> if !sep then fprintf fmt ",@," ; Plib.iteri (fun idx k -> let x = bind_var env (last - k) t in match idx with | Isingle | Ifirst -> pp_print_string fmt x | Imiddle | Ilast -> fprintf fmt ",@,%s" x ) (List.rev ks) ; fprintf fmt ":%a" pp_tau t ; sep := true ; ) m (* -------------------------------------------------------------------------- *) (* --- Sharing --- *) (* -------------------------------------------------------------------------- *) and pp_share (env:env) (fmt:formatter) t = begin fprintf fmt "@[<hv 0>" ; let shared t = Tmap.mem t env.named in let ts = T.shared ~shareable ~shared ~subterms [t] in let env = List.fold_left (fun env t -> let x,env_x = fresh env t in fprintf fmt "@[<hov 4>let %s =@ %a in@]@ " x (pp_atom env) t ; env_x) env ts in pp_free env fmt t ; fprintf fmt "@]" ; end (* -------------------------------------------------------------------------- *) (* --- Entry Point --- *) (* -------------------------------------------------------------------------- *) let pp_term_env (env:env) (fmt:formatter) t = pp_share env fmt t let pp_def_env (env:env) (fmt:formatter) t = pp_freedef env fmt t let pp_term (env:env) (fmt:formatter) t = pp_term_env (copy env) fmt t let pp_def (env:env) (fmt:formatter) t = pp_def_env (copy env) fmt t end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/pretty.mli�����������������������������������������������������0000666�0000000�0000000�00000004714�13571573400�016274� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Pretty Printer for Qed Output. *) (* -------------------------------------------------------------------------- *) open Logic open Format module Make(T : Term) : sig open T type env (** environment for pretty printing *) val empty : env val marks : env -> marks val known : env -> Vars.t -> env val fresh : env -> term -> string * env val bind : string -> term -> env -> env val pp_tau : formatter -> tau -> unit (** print with the given environment without modifying it *) val pp_term : env -> formatter -> term -> unit val pp_def : env -> formatter -> term -> unit (** print with the given environment and update it *) val pp_term_env : env -> formatter -> term -> unit val pp_def_env : env -> formatter -> term -> unit end ����������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/term.ml��������������������������������������������������������0000666�0000000�0000000�00000271121�13571573400�015541� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- First Order Logic --- *) (* -------------------------------------------------------------------------- *) open Hcons open Logic module Make (ADT : Logic.Data) (Field : Logic.Field) (Fun : Logic.Function) = struct (* -------------------------------------------------------------------------- *) type tau = (Field.t,ADT.t) Logic.datatype type path = int list module Tau = Kind.MakeTau(Field)(ADT) module POOL = Pool.Make (struct type t = tau let dummy = Prop let equal = Kind.eq_tau Field.equal ADT.equal end) open POOL type var = POOL.var module VID = struct type t = var let id x = x.vid end module Vars = Idxset.Make(VID) module Vmap = Idxmap.Make(VID) type term = { id : int ; hash : int ; size : int ; vars : Vars.t ; bind : Bvars.t ; sort : sort ; repr : repr ; tau : tau option; } and repr = (Field.t,ADT.t,Fun.t,var,term,term) term_repr let pretty_debug : (_ -> term -> unit) ref = ref (fun _ _ -> ()) type lc_term = term type 'a expression = (Field.t,ADT.t,Fun.t,var,lc_term,'a) term_repr (* ------------------------------------------------------------------------ *) (* --- Term Set,Map and Vars --- *) (* ------------------------------------------------------------------------ *) module E = struct type t = term let id t = t.id end module Tset = Idxset.Make(E) module Tmap = Idxmap.Make(E) (* ------------------------------------------------------------------------ *) (* --- Parameters --- *) (* ------------------------------------------------------------------------ *) module ADT = ADT module Field = Field module Fun = Fun module Var : Variable with type t = var = struct type t = var let hash x = x.vid let equal = (==) let compare = POOL.compare let pretty = POOL.pretty let debug x = Printf.sprintf "%s_%d" x.vbase x.vid let basename x = x.vbase let sort x = Kind.of_tau x.vtau let dummy = POOL.dummy end (* -------------------------------------------------------------------------- *) (* --- Variables --- *) (* -------------------------------------------------------------------------- *) let tau_of_var x = x.vtau let sort_of_var x = Kind.of_tau x.vtau let base_of_var x = x.vbase type pool = POOL.pool let pool = POOL.create let add_var pool x = POOL.add pool x let add_vars pool xs = Vars.iter (POOL.add pool) xs let add_term pool t = Vars.iter (POOL.add pool) t.vars let fresh pool ?basename tau = let base = match basename with | Some base -> base | None -> Tau.basename tau in POOL.fresh pool base tau let alpha pool x = POOL.alpha pool x let rec basename t = match t.repr with | Kint _ -> "x" | Kreal _ -> "r" | Aset(a,_,_) -> basename a | Acst _ -> "a" | _ -> Kind.basename t.sort (* -------------------------------------------------------------------------- *) (* --- Representation --- *) (* -------------------------------------------------------------------------- *) let repr e = e.repr let hash e = e.hash let id e = e.id let hash_subterms = function | False -> 0 | True -> 0 | Kint n -> Z.hash n | Kreal x -> hash_pair (Z.hash x.Q.num) (Z.hash x.Q.den) | Times(n,t) -> Z.hash n * t.hash | Add xs | Mul xs | And xs | Or xs -> hash_list hash 0 xs | Div(x,y) | Mod(x,y) | Eq(x,y) | Neq(x,y) | Leq(x,y) | Lt(x,y) | Aget(x,y) -> hash_pair x.hash y.hash | Acst(_,v) -> v.hash | Not e -> succ e.hash | Imply(hs,p) -> hash_list hash p.hash hs | If(e,a,b) | Aset(e,a,b) -> hash_triple e.hash a.hash b.hash | Fun(f,xs) -> hash_list hash (Fun.hash f) xs | Rdef fxs -> hash_list (fun (f,x) -> hash_pair (Field.hash f) x.hash) 0 fxs | Rget(e,f) -> hash_pair e.hash (Field.hash f) | Fvar x -> Var.hash x | Bvar(k,_) -> k | Bind(Forall,_,e) -> 1 + 31 * e.hash | Bind(Exists,_,e) -> 2 + 31 * e.hash | Bind(Lambda,_,e) -> 3 + 31 * e.hash | Apply(a,xs) -> hash_list hash a.hash xs let hash_head = function | False -> 0 | True -> 1 | Kint _ -> 2 | Kreal _ -> 3 | Times _ -> 4 | Add _ -> 5 | Mul _ -> 6 | And _ -> 7 | Or _ -> 8 | Div _ -> 9 | Mod _ -> 10 | Eq _ -> 11 | Neq _ -> 12 | Leq _ -> 13 | Lt _ -> 14 | Not _ -> 15 | Imply _ -> 16 | If _ -> 17 | Fun _ -> 18 | Fvar _ -> 19 | Bvar _ -> 20 | Bind _ -> 21 | Apply _ -> 22 | Aset _ -> 23 | Aget _ -> 24 | Acst _ -> 25 | Rdef _ -> 26 | Rget _ -> 27 let hash_repr t = hash_head t + 31 * hash_subterms t let equal_repr a b = match a,b with | True , True -> true | False , False -> true | Kint n , Kint m -> Z.equal n m | Kreal x , Kreal y -> Q.equal x y | Times(n,x) , Times(m,y) -> x==y && Z.equal n m | Add xs , Add ys | Mul xs , Mul ys | And xs , And ys | Or xs , Or ys -> eq_list xs ys | Div(x,y) , Div(x',y') | Mod(x,y) , Mod(x',y') | Eq(x,y) , Eq(x',y') | Neq(x,y) , Neq(x',y') | Leq(x,y) , Leq(x',y') | Lt(x,y) , Lt(x',y') | Aget(x,y) , Aget(x',y') -> x==x' && y==y' | Not a , Not b -> a==b | Imply(hs,p) , Imply(hs',q) -> p==q && eq_list hs hs' | If(e,a,b) , If(e',a',b') | Aset(e,a,b) , Aset(e',a',b') -> e==e' && a==a' && b==b' | Fun(f,xs) , Fun(g,ys) -> Fun.equal f g && eq_list xs ys | Fvar x , Fvar y -> Var.equal x y | Bvar(k,t) , Bvar(k',t') -> k = k' && Tau.equal t t' | Bind(q,t,e) , Bind(q',t',e') -> q=q' && Tau.equal t t' && e==e' | Acst(t,v) , Acst(t',v') -> Tau.equal t t' && v==v' | Apply(x,ys) , Apply(x',ys') -> x==x' && eq_list ys ys' | Rget(x,f) , Rget(x',g) -> x==x' && Field.equal f g | Rdef fxs , Rdef gys -> equal_list (fun (f,x) (g,y) -> x==y && Field.equal f g) fxs gys | _ -> assert (hash_head a <> hash_head b) ; false let sort x = x.sort let vars x = x.vars let bvars x = x.bind let vars_repr = function | True | False | Kint _ | Kreal _ -> Vars.empty | Times(_,x) | Not x | Rget(x,_) | Acst(_,x) -> x.vars | Add xs | Mul xs | And xs | Or xs | Fun(_,xs) -> Hcons.fold_list Vars.union (fun x -> x.vars) Vars.empty xs | Div(x,y) | Mod(x,y) | Eq(x,y) | Neq(x,y) | Leq(x,y) | Lt(x,y) | Aget(x,y) -> Vars.union x.vars y.vars | Imply(xs,a) | Apply(a,xs) -> Hcons.fold_list Vars.union vars a.vars xs | If(e,a,b) | Aset(e,a,b) -> Vars.union e.vars (Vars.union a.vars b.vars) | Fvar x -> Vars.singleton x | Bvar _ -> Vars.empty | Bind(_,_,e) -> e.vars | Rdef fxs -> List.fold_left (fun s (_,x) -> Vars.union s x.vars) Vars.empty fxs let bind_repr = function | True | False | Kint _ | Kreal _ -> Bvars.empty | Times(_,x) | Not x | Rget(x,_) | Acst(_,x) -> x.bind | Add xs | Mul xs | And xs | Or xs | Fun(_,xs) -> Hcons.fold_list Bvars.union (fun x -> x.bind) Bvars.empty xs | Div(x,y) | Mod(x,y) | Eq(x,y) | Neq(x,y) | Leq(x,y) | Lt(x,y) | Aget(x,y) -> Bvars.union x.bind y.bind | Imply(xs,a) | Apply(a,xs) -> Hcons.fold_list Bvars.union bvars a.bind xs | If(e,a,b) | Aset(e,a,b) -> Bvars.union e.bind (Bvars.union a.bind b.bind) | Bvar(k,_) -> Bvars.singleton k | Fvar _ -> Bvars.empty | Bind(_,_,e) -> Bvars.bind e.bind | Rdef fxs -> List.fold_left (fun s (_,x) -> Bvars.union s x.bind) Bvars.empty fxs let sort_repr = function | True | False -> Sbool | Kint _ -> Sint | Kreal _ -> Sreal | Times(_,x) -> Kind.merge Sint x.sort | Add xs | Mul xs -> Kind.merge_list sort Sint xs | And xs | Or xs -> Kind.merge_list sort Sbool xs | Imply(hs,p) -> Kind.merge_list sort p.sort hs | Not x -> x.sort | Fun(f,_) -> Fun.sort f | Aget(m,_) -> Kind.image m.sort | Aset(m,_,_) -> m.sort | Acst(_,v) -> Sarray v.sort | Rget(_,f) -> Field.sort f | Rdef _ -> Sdata | Div(x,y) | Mod(x,y) -> Kind.merge x.sort y.sort | Leq _ | Lt _ -> Sbool | Apply(x,_) -> x.sort | If(_,a,b) -> Kind.merge a.sort b.sort | Fvar x -> Kind.of_tau x.vtau | Bvar(_,t) -> Kind.of_tau t | Bind((Forall|Exists),_,_) -> Sprop | Bind(Lambda,_,e) -> e.sort | Eq(a,b) | Neq(a,b) -> match a.sort , b.sort with | Sprop , _ | _ , Sprop -> Sprop | _ -> Sbool let rec size_list n w = function | [] -> n+w | x::xs -> size_list (succ n) (max w x.size) xs let rec size_rdef n w = function | [] -> n+w | (_,x)::fxs -> size_rdef (succ n) (max w x.size) fxs let size_repr = function | True | False | Kint _ -> 0 | Fvar _ | Bvar _ | Kreal _ -> 1 | Times(_,x) -> succ x.size | Add xs | Mul xs | And xs | Or xs -> size_list 1 0 xs | Imply(hs,p) -> size_list 1 p.size hs | Not x -> succ x.size | Fun(_,xs) -> size_list 1 0 xs | Aget(a,b) -> 1 + max a.size b.size | Aset(a,b,c) -> 1 + max a.size (max b.size c.size) | Acst(_,v) -> succ v.size | Rget(a,_) -> succ a.size | Rdef fxs -> 1 + size_rdef 0 0 fxs | Div(x,y) | Mod(x,y) -> 2 + max x.size y.size | Eq(x,y) | Neq(x,y) | Lt(x,y) | Leq(x,y) -> 1 + max x.size y.size | Apply(x,xs) -> size_list 1 x.size xs | If(a,b,c) -> 2 + max a.size (max b.size c.size) | Bind(_,_,p) -> 3 + p.size let repr_iter f = function | True | False | Kint _ | Kreal _ | Fvar _ | Bvar _ -> () | Times(_,e) | Not e | Rget(e,_) | Acst(_,e) -> f e | Add xs | Mul xs | And xs | Or xs -> List.iter f xs | Mod(x,y) | Div(x,y) | Eq(x,y) | Neq(x,y) | Leq(x,y) | Lt(x,y) | Aget(x,y) -> f x ; f y | Rdef fvs -> List.iter (fun (_,v) -> f v) fvs | If(e,a,b) | Aset(e,a,b) -> f e ; f a ; f b | Imply(xs,x) -> List.iter f xs ; f x | Fun(_,xs) -> List.iter f xs | Apply(x,xs) -> f x ; List.iter f xs | Bind(_,_,e) -> f e (* -------------------------------------------------------------------------- *) (* --- DEBUG --- *) (* -------------------------------------------------------------------------- *) let pp_bind fmt = function | Forall -> Format.pp_print_string fmt "Forall" | Exists -> Format.pp_print_string fmt "Exists" | Lambda -> Format.pp_print_string fmt "Lambda" let pp_var fmt x = Format.fprintf fmt "X%03d(%s:%d)" x.vid x.vbase x.vrank let pp_id fmt x = Format.fprintf fmt " #%03d" x.id let pp_ids fmt xs = List.iter (pp_id fmt) xs let pp_field fmt (f,x) = Format.fprintf fmt "@ %a:%a;" Field.pretty f pp_id x let pp_record fmt fxs = List.iter (pp_field fmt) fxs let pp_repr fmt = function | Kint z -> Format.fprintf fmt "constant %s" (Z.to_string z) | Kreal z -> Format.fprintf fmt "real constant %s" (Q.to_string z) | True -> Format.pp_print_string fmt "true" | False -> Format.pp_print_string fmt "false" | Times(z,x) -> Format.fprintf fmt "times %s%a" (Z.to_string z) pp_id x | Add xs -> Format.fprintf fmt "add%a" pp_ids xs | Mul xs -> Format.fprintf fmt "mul%a" pp_ids xs | And xs -> Format.fprintf fmt "and%a" pp_ids xs | Div(a,b) -> Format.fprintf fmt "div%a%a" pp_id a pp_id b | Mod(a,b) -> Format.fprintf fmt "mod%a%a" pp_id a pp_id b | Or xs -> Format.fprintf fmt "or%a" pp_ids xs | If(e,a,b) -> Format.fprintf fmt "if%a%a%a" pp_id e pp_id a pp_id b | Imply(hs,p) -> Format.fprintf fmt "imply%a =>%a" pp_ids hs pp_id p | Neq(a,b) -> Format.fprintf fmt "neq%a%a" pp_id a pp_id b | Eq(a,b) -> Format.fprintf fmt "eq%a%a" pp_id a pp_id b | Leq(a,b) -> Format.fprintf fmt "leq%a%a" pp_id a pp_id b | Lt(a,b) -> Format.fprintf fmt "lt%a%a" pp_id a pp_id b | Not e -> Format.fprintf fmt "not%a" pp_id e | Fun(f,es) -> Format.fprintf fmt "fun %a%a" Fun.pretty f pp_ids es | Apply(phi,es) -> Format.fprintf fmt "apply%a%a" pp_id phi pp_ids es | Fvar x -> Format.fprintf fmt "var %a" pp_var x | Bvar(k,_) -> Format.fprintf fmt "bvar #%d" k | Bind(q,t,e) -> Format.fprintf fmt "bind %a %a. %a" pp_bind q Tau.pretty t pp_id e | Rdef fxs -> Format.fprintf fmt "@[<hov 2>record {%a }@]" pp_record fxs | Rget(e,f) -> Format.fprintf fmt "field %a.%a" pp_id e Field.pretty f | Aset(m,k,v) -> Format.fprintf fmt "array%a[%a :=%a ]" pp_id m pp_id k pp_id v | Aget(m,k) -> Format.fprintf fmt "array%a[%a ]" pp_id m pp_id k | Acst(t,v) -> Format.fprintf fmt "const[%a ->%a]" Tau.pretty t pp_id v let pp_rid fmt e = pp_repr fmt e.repr let rec pp_debug disp fmt e = if not (Intset.mem e.id !disp) then begin Format.fprintf fmt "%a{%a} = %a@." pp_id e Bvars.pretty e.bind pp_repr e.repr ; disp := Intset.add e.id !disp ; pp_children disp fmt e ; end and pp_children disp fmt e = repr_iter (pp_debug disp fmt) e.repr let debug fmt e = Format.fprintf fmt "%a with:@." pp_id e ; pp_debug (ref Intset.empty) fmt e let pretty = debug (* -------------------------------------------------------------------------- *) (* --- Symbols --- *) (* -------------------------------------------------------------------------- *) type t = term let equal = (==) let is_atomic e = match e.repr with | True | False | Kint _ | Kreal _ | Fvar _ | Bvar _ -> true | _ -> false let is_simple e = match e.repr with | True | False | Kint _ | Kreal _ | Fvar _ | Bvar _ | Fun(_,[]) -> true | _ -> false let is_closed e = Vars.is_empty e.vars let is_prop e = match e.sort with | Sprop | Sbool -> true | _ -> false let is_int e = match e.sort with | Sint -> true | _ -> false let is_real e = match e.sort with | Sreal -> true | _ -> false let is_arith e = match e.sort with | Sreal | Sint -> true | _ -> false (* -------------------------------------------------------------------------- *) (* --- Recursion Breakers --- *) (* -------------------------------------------------------------------------- *) let cached_not = ref (fun _ -> assert false) let extern_not = ref (fun _ -> assert false) let extern_ite = ref (fun _ -> assert false) let extern_eq = ref (fun _ -> assert false) let extern_neq = ref (fun _ -> assert false) let extern_leq = ref (fun _ -> assert false) let extern_lt = ref (fun _ -> assert false) let extern_fun = ref (fun _ -> assert false) (* -------------------------------------------------------------------------- *) (* --- Comparison --- *) (* -------------------------------------------------------------------------- *) module COMPARE = struct let fun_rank f = match Fun.category f with | Function -> 3 | Injection -> 2 | Constructor -> 1 | Operator _ -> 0 let cmp_size a b = Transitioning.Stdlib.compare a.size b.size let rank_bind = function Forall -> 0 | Exists -> 1 | Lambda -> 2 let cmp_bind p q = rank_bind p - rank_bind q let cmp_field phi (f,x) (g,y) = let cmp = Field.compare f g in if cmp <> 0 then cmp else phi x y let cmp_struct phi a b = match a.repr , b.repr with | True , True -> 0 | True , _ -> (-1) | _ , True -> 1 | False , False -> 0 | False , _ -> (-1) | _ , False -> 1 | Kint a , Kint b -> Z.compare a b | Kint _ , _ -> (-1) | _ , Kint _ -> 1 | Kreal a , Kreal b -> Q.compare a b | Kreal _ , _ -> (-1) | _ , Kreal _ -> 1 | Fvar x , Fvar y -> Var.compare x y | Fvar _ , _ -> (-1) | _ , Fvar _ -> 1 | Bvar(k1,_) , Bvar(k2,_) -> k1 - k2 | Bvar _ , _ -> (-1) | _ , Bvar _ -> 1 | Eq(a1,b1) , Eq(a2,b2) | Neq(a1,b1) , Neq(a2,b2) | Lt(a1,b1) , Lt(a2,b2) | Leq(a1,b1) , Leq(a2,b2) | Div(a1,b1) , Div(a2,b2) | Mod(a1,b1) , Mod(a2,b2) -> let cmp = cmp_size a b in if cmp <> 0 then cmp else let cmp = phi a1 a2 in if cmp <> 0 then cmp else phi b1 b2 | Fun(f,xs) , Fun(g,ys) -> let cmp = fun_rank f - fun_rank g in if cmp <> 0 then cmp else let cmp = cmp_size a b in if cmp <> 0 then cmp else let cmp = Fun.compare f g in if cmp <> 0 then cmp else Hcons.compare_list phi xs ys | Fun (_,[]) , _ -> (-1) (* (a) as a variable *) | _ , Fun (_,[]) -> 1 | Eq _ , _ -> (-1) (* (b) equality *) | _ , Eq _ -> 1 | Neq _ , _ -> (-1) (* (c) other comparison *) | _ , Neq _ -> 1 | Lt _ , _ -> (-1) | _ , Lt _ -> 1 | Leq _ , _ -> (-1) | _ , Leq _ -> 1 | Fun _ , _ -> (-1) (* (d) predicate *) | _ , Fun _ -> 1 | Times(a1,x) , Times(a2,y) -> let cmp = cmp_size a b in if cmp <> 0 then cmp else let cmp = Z.compare a1 a2 in if cmp <> 0 then cmp else phi x y | Times _ , _ -> (-1) | _ , Times _ -> 1 | Not x , Not y -> let cmp = cmp_size a b in if cmp <> 0 then cmp else phi x y | Not _ , _ -> (-1) | _ , Not _ -> 1 | Imply(h1,p1) , Imply(h2,p2) -> let cmp = cmp_size a b in if cmp <> 0 then cmp else Hcons.compare_list phi (p1::h1) (p2::h2) | Imply _ , _ -> (-1) | _ , Imply _ -> 1 | Add xs , Add ys | Mul xs , Mul ys | And xs , And ys | Or xs , Or ys -> let cmp = cmp_size a b in if cmp <> 0 then cmp else Hcons.compare_list phi xs ys | Add _ , _ -> (-1) | _ , Add _ -> 1 | Mul _ , _ -> (-1) | _ , Mul _ -> 1 | And _ , _ -> (-1) | _ , And _ -> 1 | Or _ , _ -> (-1) | _ , Or _ -> 1 | Div _ , _ -> (-1) | _ , Div _ -> 1 | Mod _ , _ -> (-1) | _ , Mod _ -> 1 | If(a1,b1,c1) , If(a2,b2,c2) -> let cmp = cmp_size a b in if cmp <> 0 then cmp else let cmp = phi a1 a2 in if cmp <> 0 then cmp else let cmp = phi b1 b2 in if cmp <> 0 then cmp else phi c1 c2 | If _ , _ -> (-1) | _ , If _ -> 1 | Acst(t1,v1) , Acst(t2,v2) -> let cmp = Tau.compare t1 t2 in if cmp<>0 then cmp else phi v1 v2 | Acst _ , _ -> (-1) | _ , Acst _ -> 1 | Aget(a1,b1) , Aget(a2,b2) -> let cmp = cmp_size a b in if cmp <> 0 then cmp else let cmp = phi a1 a2 in if cmp <> 0 then cmp else phi b1 b2 | Aget _ , _ -> (-1) | _ , Aget _ -> 1 | Aset(a1,k1,v1) , Aset(a2,k2,v2) -> let cmp = cmp_size a b in if cmp <> 0 then cmp else let cmp = phi a1 a2 in if cmp <> 0 then cmp else let cmp = phi k1 k2 in if cmp <> 0 then cmp else phi v1 v2 | Aset _ , _ -> (-1) | _ , Aset _ -> 1 | Rget(r1,f1) , Rget(r2,f2) -> let cmp = cmp_size a b in if cmp <> 0 then cmp else let cmp = phi r1 r2 in if cmp <> 0 then cmp else Field.compare f1 f2 | Rget _ , _ -> (-1) | _ , Rget _ -> 1 | Rdef fxs , Rdef gys -> let cmp = cmp_size a b in if cmp <> 0 then cmp else Hcons.compare_list (cmp_field phi) fxs gys | Rdef _ , _ -> (-1) | _ , Rdef _ -> 1 | Apply(a,xs) , Apply(b,ys) -> let cmp = cmp_size a b in if cmp <> 0 then cmp else Hcons.compare_list phi (a::xs) (b::ys) | Apply _ , _ -> (-1) | _ , Apply _ -> 1 | Bind(q1,t1,p1) , Bind(q2,t2,p2) -> let cmp = cmp_size a b in if cmp <> 0 then cmp else let cmp = cmp_bind q1 q2 in if cmp <> 0 then cmp else let cmp = phi p1 p2 in if cmp <> 0 then cmp else Tau.compare t1 t2 let rec compare a b = if a == b then 0 else let cmp = cmp_struct compare a b in if cmp <> 0 then cmp else Extlib.opt_compare Tau.compare a.tau b.tau end let weigth e = e.size let atom_min a b = if 0 < COMPARE.compare a b then b else a let compare a b = if a == b then 0 else let a' = if is_prop a then !extern_not a else a in let b' = if is_prop b then !extern_not b else b in if a == b' || a' == b then COMPARE.compare a b else COMPARE.compare (atom_min a a') (atom_min b b') exception Absorbant let compare_raising_absorbant a b = if a == b then 0 else let negate ~abs e = let ne = !extern_not e in if abs == ne then raise Absorbant ; ne in let a' = if is_prop a then negate ~abs:b a else a in let b' = if is_prop b then negate ~abs:a b else b in if a == b' || a' == b then COMPARE.compare a b else COMPARE.compare (atom_min a a') (atom_min b b') (* -------------------------------------------------------------------------- *) (* --- Hconsed --- *) (* -------------------------------------------------------------------------- *) module W = Weak.Make (struct type t = term let hash t = t.hash let equal t1 t2 = equal_repr t1.repr t2.repr end) (* -------------------------------------------------------------------------- *) (* --- Builtins --- *) (* -------------------------------------------------------------------------- *) module BUILTIN = Map.Make(Fun) (* -------------------------------------------------------------------------- *) (* --- Cache --- *) (* -------------------------------------------------------------------------- *) type cmp = EQ | NEQ | LT | LEQ type operation = | NOT of term (* Only AND, OR and IMPLY *) | CMP of cmp * term * term | FUN of Fun.t * term list * tau option module C = Cache.Unary (struct type t = operation let hash_op = function | EQ -> 2 | NEQ -> 3 | LT -> 5 | LEQ -> 7 let hash = function | NOT p -> 5 * p.hash | CMP(c,a,b) -> hash_op c * Hcons.hash_pair a.hash b.hash | FUN(f,es,_) -> Hcons.hash_list hash (Fun.hash f) es let equal a b = match a,b with | NOT p,NOT q -> p==q | CMP(c,a,b),CMP(c',a',b') -> c=c' && a==a' && b==b' | FUN(f,xs,t) , FUN(g,ys,t') -> Fun.equal f g && Hcons.equal_list (==) xs ys && Extlib.opt_equal Tau.equal t t' | _ -> false end) module STRUCTURAL = struct type t = term let compare = COMPARE.compare end module STmap = Map.Make(STRUCTURAL) module STset = Set.Make(STRUCTURAL) (* -------------------------------------------------------------------------- *) (* --- Global State --- *) (* -------------------------------------------------------------------------- *) type state = { mutable kid : int ; weak : W.t ; cache : term C.cache ; mutable builtins_fun : (term list -> tau option -> term) BUILTIN.t ; mutable builtins_get : (term list -> tau option -> term -> term) BUILTIN.t ; mutable builtins_eq : (term -> term -> term) BUILTIN.t ; mutable builtins_leq : (term -> term -> term) BUILTIN.t ; } let empty () = { kid = 0 ; weak = W.create 32993 ; (* 3-th Leyland Prime number *) cache = C.create ~size:0x1000 ; (* 4096 entries *) builtins_fun = BUILTIN.empty ; builtins_get = BUILTIN.empty ; builtins_eq = BUILTIN.empty ; builtins_leq = BUILTIN.empty ; } let state = ref (empty ()) let get_state () = !state let set_state st = state := st let release () = C.clear !state.cache let in_state st f x = let old = !state in Extlib.try_finally ~finally:(fun () -> state := old) (fun x -> state := st; f x) x let clock = ref true let constants = ref Tset.empty let constant c = assert !clock ; constants := Tset.add c !constants ; c let create () = begin clock := false ; let s = empty () in let add s c = W.add s.weak c ; s.kid <- max s.kid (succ c.id) in Tset.iter (add s) !constants ; s end let clr_state st = st.kid <- 0 ; W.clear st.weak; C.clear st.cache; st.builtins_fun <- BUILTIN.empty ; st.builtins_get <- BUILTIN.empty ; st.builtins_eq <- BUILTIN.empty ; st.builtins_leq <- BUILTIN.empty ; let add s c = W.add s.weak c ; s.kid <- max s.kid (succ c.id) in Tset.iter (add st) !constants (* -------------------------------------------------------------------------- *) (* --- Hconsed insertion --- *) (* -------------------------------------------------------------------------- *) let insert ?tau r = let h = hash_repr r in (* Only [hash] and [repr] an [tau] are significant for lookup in weak hmap *) let e0 = { id = 0 ; hash = h ; repr = r ; size = 0; vars = Vars.empty ; bind = Bvars.empty ; sort = Sdata ; tau; } in try W.find !state.weak e0 with Not_found -> let k = !state.kid in !state.kid <- succ k ; assert (k <> -1) ; let e = { id = k ; hash = h ; repr = r ; vars = vars_repr r ; bind = bind_repr r ; sort = sort_repr r ; size = size_repr r ; tau; } in W.add !state.weak e ; e (* -------------------------------------------------------------------------- *) (* --- Constructors for normalized terms --- *) (* -------------------------------------------------------------------------- *) let e_false = constant (insert False) let e_true = constant (insert True) let e_zero = constant (insert (Kint Z.zero)) let e_one = constant (insert (Kint Z.one)) let e_int n = insert (Kint (Z.of_int n)) let e_float r = insert (Kreal (Q.of_float r)) let e_zint z = insert (Kint z) let e_real x = insert (Kreal x) let e_var x = insert(Fvar x) let c_bvar k t = insert(Bvar(k,t)) let c_div x y = insert (Div(x,y)) let c_mod x y = insert (Mod(x,y)) let c_leq x y = insert (Leq(x,y)) let c_lt x y = insert (Lt (x,y)) let insert_eq x y = insert (Eq (x,y)) let insert_neq x y = insert (Neq(x,y)) let sym c x y = if compare x y < 0 then c y x else c x y let compare_field (f,x) (g,y) = let cmp = Field.compare f g in if cmp = 0 then compare x y else cmp let c_eq = sym insert_eq let c_neq = sym insert_neq let c_fun f xs tau = insert ?tau (Fun(f,xs)) let c_add = function | [] -> e_zero | [x] -> x | xs -> insert(Add(List.sort compare xs)) let c_mul = function | [] -> e_one | [x] -> x | xs -> insert(Mul(List.sort compare xs)) let c_times z t = insert(Times(z,t)) let c_and = function | [] -> e_true | [x] -> x | xs -> insert(And(xs)) let c_or = function | [] -> e_false | [x] -> x | xs -> insert(Or(xs)) let c_imply hs p = match hs with | [] -> p | hs -> insert(Imply(hs,p)) let c_not x = insert(Not x) let c_if e a b = insert(If(e,a,b)) let c_apply a es = if es=[] then a else insert(Apply(a,es)) let c_bind q t e = if Bvars.closed e.bind then e else insert(Bind(q,t,e)) let c_const t v = insert(Acst(t,v)) let c_get m k = insert(Aget(m,k)) let c_set m k v = insert(Aset(m,k,v)) let c_getfield m f = insert(Rget(m,f)) let c_record fxs = match fxs with | [] | [_] -> insert(Rdef fxs) | fx::gys -> try let base (f,v) = match v.repr with | Rget(r,g) when Field.equal f g -> r | _ -> raise Exit in let r = base fx in List.iter (fun gy -> if base gy != r then raise Exit) gys ; r with Exit -> insert(Rdef (List.sort compare_field fxs)) [@@@ warning "-32"] let insert _ = assert false (* [insert] should not be used afterwards *) [@@@ warning "+32"] let rec subterm e = function [] -> e | n :: l -> let children = match e.repr with | True | False | Kint _ | Kreal _ | Bvar _ | Fvar _ -> [] | Times (n,e) -> [ e_zint n; e] | Add l | Mul l | And l | Or l | Fun (_,l) -> l | Div (e1,e2) | Mod (e1,e2) | Eq(e1,e2) | Neq(e1,e2) | Leq (e1,e2) | Lt(e1,e2) | Aget(e1,e2) -> [e1;e2] | Not e | Bind(_,_,e) | Acst(_,e) -> [e] | Imply(l,e) -> l @ [e] | If(e1,e2,e3) | Aset(e1,e2,e3) -> [e1;e2;e3] | Rget(e,_) -> [e] | Rdef fxs -> List.map snd fxs | Apply(e,es) -> e::es in subterm (List.nth children n) l let is_primitive e = match e.repr with | True | False | Kint _ | Kreal _ -> true | _ -> false (* -------------------------------------------------------------------------- *) (* --- Cache & Builtin Simplifiers --- *) (* -------------------------------------------------------------------------- *) let builtin_fun ?tau f es = try (BUILTIN.find f !state.builtins_fun) es tau with Not_found -> c_fun f es tau let simplify_eq e a b = match e.repr with | Fun(f,_) -> BUILTIN.find f !state.builtins_eq a b | _ -> raise Not_found let simplify_leq e a b = match e.repr with | Fun(f,_) -> BUILTIN.find f !state.builtins_leq a b | _ -> raise Not_found let builtin_eq a b = try simplify_eq a a b with Not_found -> simplify_eq b a b let builtin_leq a b = try simplify_leq a a b with Not_found -> simplify_leq b a b let builtin_cmp cmp a b = try match cmp with | EQ -> builtin_eq a b | LEQ -> builtin_leq a b | NEQ -> !extern_not (builtin_eq a b) | LT -> !extern_not (builtin_leq b a) with Not_found -> match cmp with | EQ -> c_eq a b | NEQ -> c_neq a b | LT -> c_lt a b | LEQ -> c_leq a b let dispatch = function | NOT p -> !cached_not p.repr | CMP(cmp,a,b) -> builtin_cmp cmp a b | FUN(f,es,tau) -> builtin_fun ?tau f es let operation op = C.compute !state.cache dispatch op let distribute_if_over_operation force op x y f a b = match a.repr, b.repr with | If(ac,a1,a2), If(bc,b1,b2) when ac == bc -> !extern_ite ac (f a1 b1) (f a2 b2) | If(ac,a1,a2), _ when force || ((is_primitive a1 || is_primitive a2) && is_primitive b) -> !extern_ite ac (f a1 b) (f a2 b) | _, If(bc,b1,b2) when force || ((is_primitive b1 || is_primitive b2) && is_primitive a) -> !extern_ite bc (f a b1) (f a b2) | If(ac,a1,a2), If(_,b1,b2) when (is_primitive a1 && is_primitive a2) && (is_primitive b1 || is_primitive b2) -> !extern_ite ac (f a1 b) (f a2 b) | If(_,a1,a2), If(bc,b1,b2) when (is_primitive a1 || is_primitive a2) && (is_primitive b1 && is_primitive b2) -> !extern_ite bc (f a b1) (f a b2) | _ -> op x y let distribute f tau = function | x::[] as xs -> begin match x.repr with | If(c,a,b) -> !extern_ite c (!extern_fun f [a]) (!extern_fun f [b]) | _ -> operation (FUN(f,xs,tau)) end | a::b::[] as xs -> distribute_if_over_operation false (fun f xs -> operation (FUN(f,xs,tau))) f xs (fun a b -> !extern_fun f [a;b]) a b | xs -> operation (FUN(f,xs,tau)) let c_builtin_fun f xs tau = distribute f tau xs let c_builtin_eq a b = distribute_if_over_operation true (fun a b -> operation (CMP(EQ ,a,b))) a b !extern_eq a b let c_builtin_neq a b = distribute_if_over_operation true (fun a b -> operation (CMP(NEQ,a,b))) a b !extern_neq a b let c_builtin_lt a b = distribute_if_over_operation true (fun a b -> operation (CMP(LT ,a,b))) a b !extern_lt a b let c_builtin_leq a b = distribute_if_over_operation true (fun a b -> operation (CMP(LEQ,a,b))) a b !extern_leq a b let prepare_builtin f m = release () ; if BUILTIN.mem f m then let msg = Printf.sprintf "Builtin already registered for '%s'" (Fun.debug f) in raise (Failure msg) let set_builtin' f p = begin prepare_builtin f !state.builtins_fun ; !state.builtins_fun <- BUILTIN.add f p !state.builtins_fun ; end let set_builtin f p = set_builtin' f (fun es _ -> p es) let set_builtin_get f p = begin prepare_builtin f !state.builtins_get ; !state.builtins_get <- BUILTIN.add f p !state.builtins_get ; end let set_builtin_eq f p = begin prepare_builtin f !state.builtins_eq ; !state.builtins_eq <- BUILTIN.add f p !state.builtins_eq ; end let set_builtin_leq f p = begin prepare_builtin f !state.builtins_leq ; !state.builtins_leq <- BUILTIN.add f p !state.builtins_leq ; end let set_builtin_map f phi = set_builtin' f (fun es tau -> c_fun f (phi es) tau) (* -------------------------------------------------------------------------- *) (* --- Negation --- *) (* -------------------------------------------------------------------------- *) let rec e_not p = match p.repr with | True -> e_false | False -> e_true | Lt(x,y) -> !extern_leq y x | Leq(x,y) -> !extern_lt y x | Eq(x,y) -> c_neq x y | Neq(x,y) -> c_eq x y | Not x -> x | (And _ | Or _ | Imply _) -> operation (NOT p) | Bind(Forall,t,p) -> c_bind Exists t (e_not p) | Bind(Exists,t,p) -> c_bind Forall t (e_not p) | _ -> c_not p let () = extern_not := e_not (* -------------------------------------------------------------------------- *) (* --- User Operators --- *) (* -------------------------------------------------------------------------- *) let rec op_revassoc phi xs = function | [] -> xs | e::es -> match e.repr with | Fun(f,ts) when Fun.equal f phi -> op_revassoc phi (op_revassoc f xs ts) es | _ -> op_revassoc phi (e::xs) es let rec op_idempotent = function | [] -> [] | [_] as l -> l | x::( (y::_) as w ) -> if x==y then op_idempotent w else x :: op_idempotent w let op_invertible ~ac xs ys = if ac then let modified = ref false in let rxs = ref [] in let rys = ref [] in let rec walk xs ys = match xs , ys with | x::txs , y::tys -> let cmp = compare x y in if cmp < 0 then (rxs := x :: !rxs ; walk txs ys) else if cmp > 0 then (rys := y :: !rys ; walk xs tys) else ( modified := true ; walk txs tys ) | _ -> begin rxs := List.rev_append !rxs xs ; rys := List.rev_append !rys ys ; end in walk xs ys ; !modified , !rxs , !rys else let rec simpl modified turn xs ys = match xs , ys with | x::xs , y::ys when x==y -> simpl true turn xs ys | _ -> let xs = List.rev xs in let ys = List.rev ys in if turn then simpl modified false xs ys else modified,xs,ys in simpl false true xs ys let rec element = function | E_none -> assert false | E_int k -> e_int k | E_true -> e_true | E_false -> e_false | E_fun (f,l) -> c_fun f (List.map element l) None let rec is_element e x = match e , x.repr with | E_int k , Kint z -> Z.equal (Z.of_int k) z | E_true , True -> true | E_false , False -> false | E_fun (f,fl) , Fun(g,gl) -> Fun.equal f g && List.length fl = List.length gl && List.for_all2 is_element fl gl | _ -> false let isnot_element e x = not (is_element e x) let is_neutral f e = match Fun.category f with | Operator op -> is_element op.neutral e | _ -> false let is_absorbant f e = match Fun.category f with | Operator op -> is_element op.absorbant e | _ -> false let op_fun f op xs tau = let xs = if op.associative then let xs = op_revassoc f [] xs in if op.commutative then List.sort compare xs else List.rev xs else if op.commutative then List.sort compare xs else xs in if op.absorbant <> E_none && List.exists (is_element op.absorbant) xs then element op.absorbant else let xs = if op.neutral <> E_none then List.filter (isnot_element op.neutral) xs else xs in let xs = if op.idempotent then op_idempotent xs else xs in match xs with | [] when op.neutral <> E_none -> element op.neutral | [x] when op.associative -> x | _ -> c_builtin_fun f xs tau let e_fungen f xs tau = match Fun.category f with | Logic.Operator op -> op_fun f op xs tau | _ -> c_builtin_fun f xs tau let e_fun ?result f xs = e_fungen f xs result let () = extern_fun := e_fun (* -------------------------------------------------------------------------- *) (* --- Ground & Arithmetics --- *) (* -------------------------------------------------------------------------- *) let rec i_ground f c xs = function | {repr=Kint n}::ts -> i_ground f (f c n) xs ts | x::ts -> i_ground f c (x::xs) ts | [] -> c , xs let rec r_ground f c xs = function | {repr=Kreal z}::ts -> r_ground f (f c z) xs ts | {repr=Kint n}::ts -> r_ground f (f c (Q.of_bigint n)) xs ts | x::ts -> r_ground f c (x::xs) ts | [] -> c , xs type sign = Null | Negative | Positive let sign z = if Z.lt z Z.zero then Negative else if Z.lt Z.zero z then Positive else Null let r_affine_rel fz fe c xs ys = let a , xs = r_ground Q.add (Q.of_bigint c) [] xs in let b , ys = r_ground Q.add Q.zero [] ys in let c = Q.sub a b in match xs , ys with | [] , [] -> if fz c Q.zero then e_true else e_false | [] , _ -> fe (e_real c) (c_add ys) | _ , [] -> fe (c_add xs) (e_real (Q.neg c)) | _ -> let s = Q.sign c in if s < 0 then fe (c_add xs) (c_add (e_real (Q.neg c) :: ys)) else if s > 0 then fe (c_add (e_real c :: xs)) (c_add ys) else fe (c_add xs) (c_add ys) let i_affine_rel fc fe c xs ys = match xs , ys with | [] , [] -> if fc c Z.zero then e_true else e_false | [] , _ -> fe (e_zint c) (c_add ys) (* c+0 R ys <-> c R ys *) | _ , [] -> fe (c_add xs) (e_zint (Z.neg c)) (* c+xs R 0 <-> xs R -c *) | _ -> match sign c with (* 0+xs R ys <-> xs R ys *) | Null -> fe (c_add xs) (c_add ys) (* c+xs R ys <-> xs R (-c+ys) *) | Negative -> fe (c_add xs) (c_add (e_zint (Z.neg c) :: ys)) (* c+xs R ys <-> (c+xs) R ys *) | Positive -> fe (c_add (e_zint c :: xs)) (c_add ys) let i_affine xs ys = not (List.exists is_real xs || List.exists is_real ys) let affine_eq c xs ys = if i_affine xs ys then i_affine_rel Z.equal c_builtin_eq c xs ys else r_affine_rel Q.equal c_builtin_eq c xs ys let affine_neq c xs ys = if i_affine xs ys then i_affine_rel (fun x y -> not (Z.equal x y)) c_builtin_neq c xs ys else r_affine_rel (fun x y -> not (Q.equal x y)) c_builtin_neq c xs ys let affine_leq c xs ys = if i_affine xs ys then if Z.equal c Z.one then i_affine_rel Z.lt c_builtin_lt Z.zero xs ys else i_affine_rel Z.leq c_builtin_leq c xs ys else r_affine_rel Q.leq c_builtin_leq c xs ys let affine_lt c xs ys = if i_affine xs ys then if not (Z.equal c Z.zero) then i_affine_rel Z.leq c_builtin_leq (Z.succ c) xs ys else i_affine_rel Z.lt c_builtin_lt c xs ys else r_affine_rel Q.lt c_builtin_lt c xs ys let affine_cmp = function | EQ -> affine_eq | LT -> affine_lt | NEQ -> affine_neq | LEQ -> affine_leq (* --- Times --- *) let q_times k z = if Z.equal k Z.one then z else if Z.equal k Z.zero then Q.zero else Q.(make (Z.mul k z.num) z.den) let rec times z e = if Z.equal z Z.one then e else if Z.equal z Z.zero then e_zint Z.zero else match e.repr with | Kint z' -> e_zint (Z.mul z z') | Kreal r -> e_real (q_times z r) | Times(z',t) -> times (Z.mul z z') t | _ -> c_times z e (* --- Additions --- *) let rec unfold_affine acc k = function | [] -> acc | t::others -> unfold_affine (unfold_affine1 acc k t) k others and unfold_affine1 acc k t = match t.repr with | Times(n,t) -> unfold_affine1 acc (Z.mul k n) t | Kint z -> if z == Z.zero then acc else (Z.mul k z , e_one) :: acc | Add ts -> unfold_affine acc k ts | Kreal r when Q.(equal r zero) -> acc | Kreal r -> (Z.one , e_real (q_times k r)) :: acc | _ -> (k,t) :: acc (* sorts monoms by terms *) let compare_monoms (_,t1) (_,t2) = Transitioning.Stdlib.compare t1.id t2.id (* factorized monoms *) let fold_monom ts k t = if Z.equal Z.zero k then ts else if Z.equal Z.one k then t::ts else times k t :: ts (* monoms sorted by terms *) let rec fold_affine f a = function | (n1,t1)::(n2,t2)::kts when t1 == t2 -> fold_affine f a ((Z.add n1 n2,t1)::kts) | (k,t)::kts -> begin match t.repr , kts with | Kreal z , ( k' , { repr = Kreal z' } ) :: kts' -> let q = Q.add (q_times k z) (q_times k' z') in fold_affine f a ((Z.one,e_real q) :: kts') | _ -> fold_affine f (f a k t) kts end | [] -> a let affine a = let kts = unfold_affine1 [] Z.one a in let fact,const = List.partition (fun (_,base) -> base.id = e_one.id) kts in let base = List.fold_left (fun z (k,_) -> Z.add z k) Z.zero const in { constant = base ; factors = fact } (* ts normalized *) let addition ts = let kts = unfold_affine [] Z.one ts in let kts = List.sort compare_monoms kts in c_add (fold_affine fold_monom [] kts) (* --- Relations --- *) let is_affine e = match e.repr with | Kint _ | Kreal _ | Times _ | Add _ -> true | _ -> false let fold_coef g xs k t = fold_monom xs (Z.div k g) t let rec coef_monoms c = function | [] -> c , Z.one | (n,e)::w -> if e == e_one then coef_monoms (Z.add c n) w else let rec coef_gcd c p = function | [] -> c , p | (n,e)::w -> if e == e_one then coef_gcd (Z.add c n) p w else coef_gcd c Z.(gcd p (abs n)) w in coef_gcd c (Z.abs n) w let rec partition_monoms phi xs ys = function | [] -> xs,ys | (k,t) :: kts -> if t == e_one then partition_monoms phi xs ys kts else if Z.leq Z.zero k then partition_monoms phi (phi xs k t) ys kts else partition_monoms phi xs (phi ys (Z.neg k) t) kts let collect_monoms xs k t = if Z.(equal k zero) then xs else (k,t)::xs (* Congruence Theorem: (proved with Alt-Ergo for B in -10..10) Assumes 0 < |r| < g Then: CONG-EQ: gB+r = 0 <-> false CONG-NEQ: gB+r <> 0 <-> true CONG-LEQ-POS: 0 < r -> gB+r <= 0 <-> B < 0 CONG-LEQ-NEG: r < 0 -> gB+r <= 0 <-> B <= 0 CONG-LT-POS: 0 < r -> gB+r < 0 <-> B < 0 CONG-LT-NEG: r < 0 -> gB+r < 0 <-> B <= 0 *) let relation rel cmp x y = if is_affine x || is_affine y then let kts = unfold_affine1 (unfold_affine1 [] Z.one x) Z.minus_one y in let kts = List.sort compare_monoms kts in let kts = fold_affine collect_monoms [] kts in let k,g = coef_monoms Z.zero kts in if Z.(equal g one) || List.exists (fun (_,e) -> not (is_int e)) kts then let xs,ys = partition_monoms fold_monom [] [] kts in affine_cmp cmp k xs ys else let k,r = Z.div_rem k g in if Z.(equal r zero) then let xs,ys = partition_monoms (fold_coef g) [] [] kts in affine_cmp cmp k xs ys else match cmp with | EQ -> e_false (* CONG-EQ *) | NEQ -> e_true (* CONG-NEQ *) | LT | LEQ -> let xs,ys = partition_monoms (fold_coef g) [] [] kts in (* CONG-LEQ|LT-POS|NEQ *) let cmp = if Z.(lt zero r) then LT else LEQ in affine_cmp cmp k xs ys else rel x y (* --- Multiplications --- *) let rec mul_unfold acc = function | [] -> acc | t::others -> match t.repr with | Times(z,t) -> mul_unfold (e_zint z :: acc) (t::others) | Mul ts -> mul_unfold (mul_unfold acc ts) others | _ -> mul_unfold (t::acc) others let multiplication ts = (* ts normalized *) let ts = mul_unfold [] ts in if List.exists is_real ts then let r,ts = r_ground Q.mul Q.one [] ts in if Q.equal Q.zero r then e_real Q.zero else if ts=[] then e_real r else if Q.equal r Q.one then c_mul ts else c_mul (e_real r :: ts) else let s,ts = i_ground Z.mul Z.one [] ts in if Z.equal Z.zero s then e_zint Z.zero else if ts=[] then e_zint s else let t = c_mul ts in if Z.equal s Z.one then t else c_times s t (* --- Divisions --- *) let e_times k x = if Z.equal k Z.zero then e_zero else if Z.equal k Z.one then x else times k x let e_div a b = match a.repr , b.repr with | _ , Kint z when Z.equal z Z.one -> a | _ , Kint z when Z.equal z Z.minus_one -> times Z.minus_one a | Times(k,e) , Kint k' when not (Z.equal k' Z.zero) -> let q,r = Z.div_rem k k' in if Z.equal r Z.zero then e_times q e else c_div a b | Kint k , Kint k' when not (Z.equal k' Z.zero) -> e_zint (Z.div k k') | Kreal r , Kint a when not (Z.equal a Z.zero) -> e_real Q.(make r.num (Z.mul a r.den)) | Kint a , Kreal b when not (Q.equal b Q.zero) -> e_real Q.(make (Z.mul a b.den) b.num) | Kreal a , Kreal b when not (Q.equal b Q.zero) -> e_real (Q.div a b) | _ -> c_div a b let e_mod a b = match a.repr , b.repr with | _ , Kint z when Z.equal z Z.one -> e_zero | Times(k,e) , Kint k' when not (Z.equal k' Z.zero) -> let r = Z.rem k k' in if Z.equal r Z.zero then e_zero else c_mod (e_times r e) b | Kint k , Kint k' when not (Z.equal k' Z.zero) -> e_zint (Z.rem k k') | _ -> c_mod a b (* --- Comparisons --- *) let e_lt x y = if x==y then e_false else relation c_builtin_lt LT x y let () = extern_lt := e_lt let e_leq x y = if x==y then e_true else relation c_builtin_leq LEQ x y let () = extern_leq := e_leq (* -------------------------------------------------------------------------- *) (* --- Logical --- *) (* -------------------------------------------------------------------------- *) let decide e = (e == e_true) let is_true e = match e.repr with | True -> Logic.Yes | False -> Logic.No | _ -> Logic.Maybe let is_false e = match e.repr with | True -> Logic.No | False -> Logic.Yes | _ -> Logic.Maybe let rec fold_and acc xs = match xs with | [] -> acc | x::others -> match x.repr with | False -> raise Absorbant | True -> fold_and acc others | And xs -> fold_and (fold_and acc xs) others | _ -> fold_and (x::acc) others let rec fold_or acc xs = match xs with | [] -> acc | x::others -> match x.repr with | True -> raise Absorbant | False -> fold_or acc others | Or xs -> fold_or (fold_or acc xs) others | _ -> fold_or (x::acc) others let conjunction ts = try let ms = fold_and [] ts in let ms = List.sort_uniq compare_raising_absorbant ms in c_and ms with Absorbant -> e_false let disjunction ts = try let ms = fold_or [] ts in let ms = List.sort_uniq compare_raising_absorbant ms in c_or ms with Absorbant -> e_true module Consequence = struct type p = CONJ | DISJ type t = { mutable modif : bool ; polarity : p } let mark w = w.modif <- true ; w let rec gen w hs ts = match hs with | [] -> ts | h :: hws -> match w.polarity with | CONJ -> aux w ~absorb:(e_not h) ~filter:h hws ts | DISJ -> aux w ~absorb:h ~filter:(e_not h) hws ts and aux w ~absorb ~filter hws ts = match ts with | [] -> ts | t :: tws -> if absorb == t then raise Absorbant ; let cmp = compare filter t in if cmp < 0 then gen w hws ts else if cmp > 0 then t :: aux (mark w) ~absorb ~filter hws tws else gen (mark w) hws tws let filter polarity hs ts = let w = { modif = false ; polarity } in let ws = gen w hs ts in if w.modif then ws else ts end let consequence_and = Consequence.(filter CONJ) let consequence_or = Consequence.(filter DISJ) let merge hs hs0 = List.sort_uniq compare_raising_absorbant (hs@hs0) let rec implication hs b = match b.repr with | Imply(hs0,b0) -> implication_imply hs b hs0 b0 | And bs -> implication_and [] hs b bs | Or bs -> implication_or [] hs b bs | _ -> c_imply hs b and implication_and hs0 hs b0 bs = try let hs'= merge hs0 hs in try match consequence_and hs bs with | [] -> e_true (* [And hs] implies [b0] *) | [b] -> implication hs' b | bs' -> c_imply hs' (if bs'==bs then b0 else c_and bs') with Absorbant -> implication_false hs' (* [And hs] implies [Not b0] *) with Absorbant -> e_true (* [False = And (hs@hs0)] *) and implication_or hs0 hs b0 bs = try let hs'= merge hs0 hs in match consequence_or hs bs with | [] -> implication_false hs' (* [And hs] implies [Not b0] *) | [b] -> implication hs' b | bs' -> c_imply hs' (if bs'==bs then b0 else c_or bs') with Absorbant -> e_true (* [False = And (hs@hs0)] or [And hs] implies [b] *) and implication_imply hs b hs0 b0 = try match consequence_and hs [b0] with | [] -> e_true (* [And hs] implies [b0] *) | _ -> try match consequence_and hs0 hs with | [] -> b (* [And hs0] implies [And hs] *) | hs -> match b0.repr with | And bs -> implication_and hs0 hs b0 bs | Or bs -> implication_or hs0 hs b0 bs | _ -> c_imply (merge hs0 hs) b0 with Absorbant -> e_true (* [False = And (hs@hs0)] *) with Absorbant -> (* [And hs] implies [Not b0] *) try implication_false (merge hs hs0) with Absorbant -> e_true (* [False = And (hs@hs0)] *) and implication_false hs = e_not (c_and hs) let rec consequence_aux hs x = match x.repr with | And xs -> begin try match consequence_and hs xs with | [] -> e_true | [x] -> consequence_aux hs x | hs -> if hs==xs then x else c_and hs with Absorbant -> e_false end | Or xs -> begin try match consequence_and hs xs with | [] -> e_false | [x] -> consequence_aux hs x | hs -> if hs==xs then x else c_or hs with Absorbant -> e_true end | Not x -> e_not (consequence_aux hs x) | Imply (xs, b) -> begin let b' = consequence_aux hs b in match b'.repr with | True -> b' | _ -> begin try let xs' = consequence_and hs xs in match b==b', xs==xs', xs' with | true, true, _ -> x | _, false, [] -> b' | true, false, _ -> c_imply xs' b' | false, _, _ -> implication xs' b' with Absorbant -> e_false end end | _ -> x let consequence h x = let not_x = e_not x in match h.repr with | True -> x | False -> (* what_ever *) x | _ when h == x -> e_true | _ when h == not_x -> e_false | And hs -> consequence_aux hs x | _ -> consequence_aux [h] x type structural = | S_diff (* different constructors *) | S_injection (* same injective function *) | S_invertible (* same invertible function *) | S_invertible_both (* both functions (different ones) are invertible *) | S_invertible_left (* left function is invertible *) | S_invertible_right (* right function is invertible *) | S_functions (* general functions *) let is_ac f = match Fun.category f with | Logic.Operator op -> op.associative && op.commutative | _ -> false let is_invertible_assoc = function | { invertible=true ; associative=true } -> true | _ -> false let structural f g = if Fun.equal f g then match Fun.category f with | Logic.Operator { invertible=true } -> S_invertible | Logic.Injection | Logic.Constructor -> S_injection | Logic.Function | Logic.Operator _ -> S_functions else match Fun.category f , Fun.category g with | Logic.Constructor , Logic.Constructor -> S_diff | Logic.Operator fop , Logic.Operator gop when (is_invertible_assoc fop) && (is_invertible_assoc gop) -> S_invertible_both | Logic.Operator op , _ when is_invertible_assoc op -> S_invertible_left | _ , Logic.Operator op when is_invertible_assoc op -> S_invertible_right | _ -> S_functions let contrary x y = (is_prop x || is_prop y) && (e_not x == y) (* -------------------------------------------------------------------------- *) (* --- List All2/Any2 --- *) (* -------------------------------------------------------------------------- *) let e_all2 phi xs ys = let n = List.length xs in let m = List.length ys in if n <> m then e_false else conjunction (List.map2 phi xs ys) let e_any2 phi xs ys = let n = List.length xs in let m = List.length ys in if n <> m then e_true else disjunction (List.map2 phi xs ys) (* -------------------------------------------------------------------------- *) (* --- Equality --- *) (* -------------------------------------------------------------------------- *) let rec e_eq x y = if x == y then e_true else relation eq_symb EQ x y and eq_symb x y = match x.repr , y.repr with | Kint z , Kint z' -> if Z.equal z z' then e_true else e_false | Kreal z , Kreal z' -> if Q.equal z z' then e_true else e_false | Kint a , Kreal r | Kreal r , Kint a -> if Q.equal r (Q.of_bigint a) then e_true else e_false | True , _ -> y | _ , True -> x | False , _ -> e_not y | _ , False -> e_not x | Fun(f,xs) , Fun(g,ys) -> begin match structural f g with | S_diff -> e_false | S_injection -> e_all2 e_eq xs ys | S_functions -> c_builtin_eq x y | S_invertible -> eq_invertible x y f xs ys | S_invertible_left -> eq_invertible x y f xs [y] | S_invertible_right -> eq_invertible x y g [x] ys | S_invertible_both -> eq_invertible_both x y f g xs ys end | Rdef fxs , Rdef gys -> begin try e_all2 eq_field fxs gys with Exit -> e_false end | Acst(_,a) , Acst(_,b) -> e_eq a b | Acst(_,v0) , Aset(m,_,v) -> conjunction [e_eq v v0 ; e_eq x m] | Aset(m,_,v) , Acst(_,v0) -> conjunction [e_eq v v0 ; e_eq m y] | _ when contrary x y -> e_false | Fun _ , _ | _ , Fun _ -> c_builtin_eq x y | _ -> c_eq x y and eq_invertible x y f xs ys = let modified,xs,ys = op_invertible ~ac:(is_ac f) xs ys in if modified then eq_symb (e_fun f xs ?result:x.tau) (e_fun f ys ?result:y.tau) else c_builtin_eq x y and eq_invertible_both x y f g xs ys = let modified,xs',ys' = op_invertible ~ac:(is_ac f) xs [y] in if modified then eq_symb (e_fun f xs' ?result:x.tau) (e_fun f ys' ?result:y.tau) else eq_invertible x y g [x] ys and eq_field (f,x) (g,y) = if Field.equal f g then e_eq x y else raise Exit let () = extern_eq := e_eq (* -------------------------------------------------------------------------- *) (* --- Disequality --- *) (* -------------------------------------------------------------------------- *) let rec e_neq x y = if x == y then e_false else relation neq_symb NEQ x y and neq_symb x y = match x.repr , y.repr with | Kint z , Kint z' -> if Z.equal z z' then e_false else e_true | Kreal z , Kreal z' -> if Q.equal z z' then e_false else e_true | Kreal r , Kint a | Kint a , Kreal r -> if Q.equal r (Q.of_bigint a) then e_false else e_true | True , _ -> e_not y | _ , True -> e_not x | False , _ -> y | _ , False -> x | Fun(f,xs) , Fun(g,ys) -> begin match structural f g with | S_diff -> e_true | S_injection -> e_any2 e_neq xs ys | S_functions -> c_builtin_neq x y | S_invertible -> neq_invertible x y f xs ys | S_invertible_left -> neq_invertible x y f xs [y] | S_invertible_right -> neq_invertible x y g [x] ys | S_invertible_both -> neq_invertible_both x y f g xs ys end | Rdef fxs , Rdef gys -> begin try e_any2 neq_field fxs gys with Exit -> e_true end | Acst(_,a) , Acst(_,b) -> e_neq a b | Acst(_,v0) , Aset(m,_,v) -> disjunction [e_neq v v0 ; e_neq x m] | Aset(m,_,v) , Acst(_,v0) -> disjunction [e_neq v v0 ; e_neq m y] | _ when contrary x y -> e_true | Fun _ , _ | _ , Fun _ -> c_builtin_neq x y | _ -> c_neq x y and neq_invertible x y f xs ys = let modified,xs,ys = op_invertible ~ac:(is_ac f) xs ys in if modified then neq_symb (e_fun f xs) (e_fun f ys) else c_builtin_neq x y and neq_invertible_both x y f g xs ys = let modified,xs',ys' = op_invertible ~ac:(is_ac f) xs [y] in if modified then neq_symb (e_fun f xs') (e_fun f ys') else neq_invertible x y g [x] ys and neq_field (f,x) (g,y) = if Field.equal f g then e_neq x y else raise Exit let () = extern_neq := e_neq (* -------------------------------------------------------------------------- *) (* --- Boolean Simplifications --- *) (* -------------------------------------------------------------------------- *) let e_or = function | [] -> e_false | [t] -> t | ts -> disjunction ts let e_and = function | [] -> e_true | [t] -> t | ts -> conjunction ts let rec imply1 a b = match a.repr , b.repr with | _ , False -> e_not a | Not p , Not q -> imply1 q p | _ when a == b -> e_true | _ when a == e_not b -> b | _, _ -> implication [a] b let imply2 hs b = match b.repr with | And bs -> implication_and [] hs b bs | _ -> try match consequence_and hs [b] with | [] -> e_true (* [And hs] implies [b] *) | _ -> match b.repr with | Or bs -> implication_or [] hs b bs | Imply(hs0,b0) -> implication_imply hs b hs0 b0 | _ -> c_imply hs b with Absorbant -> implication_false hs (* [And hs] implies [Not b] *) let e_imply hs p = match p.repr with | True -> e_true | _ -> try let hs = fold_and [] hs in let hs = List.sort_uniq compare_raising_absorbant hs in match hs with | [] -> p | [a] -> imply1 a p | _ -> imply2 hs p with Absorbant -> e_true let () = cached_not := function | And xs -> e_or (List.map e_not xs) | Or xs -> e_and (List.map e_not xs) | Imply(hs,p) -> e_and (e_not p :: hs) | _ -> assert false let e_if e a b = match e.repr with | True -> a | False -> b | _ -> if a == b then a else match a.repr , b.repr with | True , _ -> disjunction [e;b] | _ , False -> conjunction [e;a] | False , _ -> conjunction [e_not e;b] | _ , True -> disjunction [e_not e;a] | _ -> match e.repr with | Not e0 -> c_if e0 b a | Neq(u,v) -> c_if (e_eq u v) b a | _ -> c_if e a b let () = extern_ite := e_if let e_bool = function true -> e_true | false -> e_false let e_literal v p = if v then p else e_not p let literal p = match p.repr with | Neq(a,b) -> false , c_eq a b | Lt(x,y) -> false , c_leq y x | Not q -> false , q | _ -> true , p let are_equal a b = is_true (e_eq a b) let eval_eq a b = (e_eq a b == e_true) let eval_neq a b = (e_eq a b == e_false) let eval_lt a b = (e_lt a b == e_true) let eval_leq a b = (e_leq a b == e_true) (* -------------------------------------------------------------------------- *) (* --- Arrays --- *) (* -------------------------------------------------------------------------- *) let rec e_get m k = match m.repr with | Acst(_,v) -> v | Aset(m0,k0,v0) -> begin match are_equal k k0 with | Yes -> v0 | No -> e_get m0 k | Maybe -> c_get m k end | Fun (g,xs) -> begin try (BUILTIN.find g !state.builtins_get) xs m.tau k with Not_found -> c_get m k end | _ -> c_get m k let rec e_set m k v = match m.repr with | Acst(_,v0) -> begin match are_equal v v0 with | Yes -> m | No | Maybe -> c_set m k v end | Aset(m0,k0,_) -> begin match are_equal k k0 with | Yes -> e_set m0 k0 v | No | Maybe -> c_set m k v end | _ -> c_set m k v let e_const (k:tau) v = c_const k v (* -------------------------------------------------------------------------- *) (* --- Records --- *) (* -------------------------------------------------------------------------- *) let rec get_field m0 f = function | [] -> c_getfield m0 f | (g,y)::gys -> if Field.equal f g then y else get_field m0 f gys let e_getfield m f = match m.repr with | Rdef gys -> get_field m f gys | _ -> c_getfield m f let e_record fxs = c_record fxs type record = (Field.t * term) list (* -------------------------------------------------------------------------- *) (* --- Smart Constructors --- *) (* -------------------------------------------------------------------------- *) let e_equiv = e_eq let e_sum = addition let e_prod = multiplication let e_opp x = times Z.minus_one x let e_add x y = addition [x;y] let e_sub x y = addition [x;e_opp y] let e_mul x y = multiplication [x;y] (* -------------------------------------------------------------------------- *) (* --- Caches --- *) (* -------------------------------------------------------------------------- *) let cache () = ref Tmap.empty let get mu f e = try Tmap.find e !mu with Not_found -> let v = f e in mu := Tmap.add e v !mu ; v let set mu e v = mu := Tmap.add e v !mu (* -------------------------------------------------------------------------- *) (* --- Locally Nameless --- *) (* -------------------------------------------------------------------------- *) let lc_closed e = Bvars.closed e.bind let lc_closed_at n e = Bvars.closed_at n e.bind let lc_vars e = e.bind let lc_repr e = e (* Warning: must only be used for alpha-conversion Never re-compute simplifications, only renormalize with respect to hash-consing. *) let lc_alpha f e0 = match e0.repr with | Kint _ | Kreal _ | Fvar _ | Bvar _ | True | False -> e0 | Not e -> c_not (f e) | Add xs -> c_add (List.map f xs) | Mul xs -> c_mul (List.map f xs) | And xs -> c_and (List.map f xs) | Or xs -> c_or (List.map f xs) | Mod(x,y) -> c_mod (f x) (f y) | Div(x,y) -> c_div (f x) (f y) | Eq(x,y) -> c_eq (f x) (f y) | Neq(x,y) -> c_neq (f x) (f y) | Lt(x,y) -> c_lt (f x) (f y) | Leq(x,y) -> c_leq (f x) (f y) | Times(z,t) -> c_times z (f t) | If(e,a,b) -> c_if (f e) (f a) (f b) | Imply(hs,p) -> c_imply (List.map f hs) (f p) | Fun(g,xs) -> c_fun g (List.map f xs) e0.tau | Acst(t,v) -> c_const t v | Aget(x,y) -> c_get (f x) (f y) | Aset(x,y,z) -> c_set (f x) (f y) (f z) | Rget(x,g) -> c_getfield (f x) g | Rdef gxs -> c_record (List.map (fun (g,x) -> g, f x) gxs) | Apply(e,es) -> c_apply (f e) (List.map f es) | Bind(q,t,e) -> c_bind q t (f e) (* Alpha-convert free-variable x with the top-most bound variable *) let lc_close x (lc : lc_term) : lc_term = let rec walk mu x lc = if Vars.mem x lc.vars then get mu (lc_alpha (walk mu x)) lc else lc in let k = Bvars.order lc.bind in let t = tau_of_var x in let mu = cache () in set mu (e_var x) (c_bvar k t) ; walk mu x lc (* Alpha-convert top-most bound variable with free-variable x *) let lc_open x (lc : lc_term) : lc_term = let rec walk mu k lc = if Bvars.contains k lc.bind then get mu (lc_alpha (walk mu k)) lc else lc in let k = Bvars.order lc.bind in let t = tau_of_var x in let mu = cache () in set mu (c_bvar k t) (e_var x) ; walk mu k lc (* -------------------------------------------------------------------------- *) (* --- Non-Binding Morphism --- *) (* -------------------------------------------------------------------------- *) let rebuild f e0 = match e0.repr with | Kint _ | Kreal _ | Fvar _ | Bvar _ | True | False -> e0 | Not e -> e_not (f e) | Add xs -> e_sum (List.map f xs) | Mul xs -> e_prod (List.map f xs) | And xs -> e_and (List.map f xs) | Or xs -> e_or (List.map f xs) | Mod(x,y) -> e_mod (f x) (f y) | Div(x,y) -> e_div (f x) (f y) | Eq(x,y) -> e_eq (f x) (f y) | Neq(x,y) -> e_neq (f x) (f y) | Lt(x,y) -> e_lt (f x) (f y) | Leq(x,y) -> e_leq (f x) (f y) | Times(z,t) -> e_times z (f t) | If(e,a,b) -> e_if (f e) (f a) (f b) | Imply(hs,p) -> e_imply (List.map f hs) (f p) | Fun(g,xs) -> e_fun ?result:e0.tau g (List.map f xs) | Acst(t,v) -> e_const t v | Aget(x,y) -> e_get (f x) (f y) | Aset(x,y,z) -> e_set (f x) (f y) (f z) | Rget(x,g) -> e_getfield (f x) g | Rdef gxs -> e_record (List.map (fun (g,x) -> g, f x) gxs) | Bind(q,t,a) -> c_bind q t (f a) | Apply(e,es) -> c_apply (f e) (List.map f es) (* -------------------------------------------------------------------------- *) (* --- General Substitution --- *) (* -------------------------------------------------------------------------- *) type sigma = { pool : pool ; mutable filter : (term -> bool) list ; mutable shared : sfun ; } and sfun = | EMPTY | FUN of (term -> term) * sfun | MAP of term Tmap.t * sfun module Subst = struct type t = sigma let create ?pool () = { pool = POOL.create ?copy:pool () ; shared = EMPTY ; filter = [] ; } let validate fn e = if not (lc_closed e) then begin Format.eprintf "Invalid %s: %a@." fn pretty e ; raise (Invalid_argument (fn ^ ": non lc-closed binding")) end let cache sigma = ref begin match sigma.shared with MAP( m , _ ) -> m | _ -> Tmap.empty end let fresh sigma t = fresh sigma.pool t let call f e = let v = f e in validate "Qed.Subst.add_fun" v ; v let rec compute e = function | EMPTY -> raise Not_found | FUN(f,EMPTY) -> call f e | MAP(m,EMPTY) -> Tmap.find e m | FUN(f,s) -> (try call f e with Not_found -> compute e s) | MAP(m,s) -> (try Tmap.find e m with Not_found -> compute e s) let get sigma a = compute a sigma.shared let filter sigma a = List.for_all (fun f -> f a) sigma.filter let add sigma a b = validate "Qed.Subst.add (domain)" a ; validate "Qed.Subst.add (codomain)" b ; sigma.shared <- match sigma.shared with | MAP(m,s) -> MAP (Tmap.add a b m,s) | (FUN _ | EMPTY) as s -> MAP (Tmap.add a b Tmap.empty,s) let add_map sigma m = if not (Tmap.is_empty m) then begin Tmap.iter (fun a b -> validate "Qed.Subst.add_map (domain)" a ; validate "Qed.Subst.add_map (codomain)" b ; ) m ; sigma.shared <- MAP(m,sigma.shared) end let add_fun sigma f = sigma.shared <- FUN(f,sigma.shared) let add_filter sigma f = sigma.filter <- f :: sigma.filter let add_var sigma x = add_var sigma.pool x let add_term sigma e = add_vars sigma.pool e.vars let add_vars sigma xs = add_vars sigma.pool xs end let sigma = Subst.create let filter sigma e = Subst.filter sigma e || not (Bvars.is_empty e.bind) let rec subst sigma alpha e = if filter sigma e then incache (Subst.cache sigma) sigma alpha e else e and incache mu sigma alpha e = if filter sigma e then get mu (compute mu sigma alpha) e else e and compute mu sigma alpha e = try Subst.get sigma e with Not_found -> let r = match e.repr with | Bvar(k,_) -> Intmap.find k alpha | Bind _ -> (* Not in cache *) bind sigma alpha [] e | Apply(e,es) -> let phi = incache mu sigma alpha in apply sigma Intmap.empty (phi e) (List.map phi es) | _ -> rebuild (incache mu sigma alpha) e in (* Only put closed terms in cache *) (if lc_closed e && lc_closed r then Subst.add sigma e r) ; (* Finally returns result *) r and bind sigma alpha qs e = match e.repr with | Bind(q,t,a) -> let k = Bvars.order a.bind in let x = Subst.fresh sigma t in let alpha = Intmap.add k (e_var x) alpha in let qs = (q,x) :: qs in bind sigma alpha qs a | _ -> (* HERE: This final binding of variables could be parallelized if Bvars is precise enough *) List.fold_left (fun e (q,x) -> if Vars.mem x e.vars then let t = tau_of_var x in (* HERE: possible to insert a recursive call to let-intro it will use a new instance of e_subst_var that will work on a different sigma *) c_bind q t (lc_close x e) else e ) (subst sigma alpha e) qs and apply sigma beta f vs = match f.repr, vs with | Bind(_,_,g) , v::vs -> let k = Bvars.order g.bind in apply sigma (Intmap.add k v beta) g vs | _ -> let f' = if Intmap.is_empty beta then f else subst sigma beta f in c_apply f' vs let e_subst sigma e = Subst.validate "Qed.e_subst (target)" e ; subst sigma Intmap.empty e let e_subst_var x v e = Subst.validate "Qed.e_subst_var (value)" v ; Subst.validate "Qed.e_subst_var (target)" e ; let filter e = Vars.mem x e.vars in if not (filter e) then e else if Bvars.is_empty v.bind && Bvars.is_empty e.bind then let rec walk mu e = if filter e then get mu (rebuild (walk mu)) e else e in let cache = cache () in set cache (e_var x) v ; walk cache e else let sigma = Subst.create () in Subst.add sigma (e_var x) v ; Subst.add_term sigma v ; Subst.add_term sigma e ; Subst.add_filter sigma filter ; subst sigma Intmap.empty e let e_apply e es = let sigma = Subst.create () in Subst.add_term sigma e ; List.iter (Subst.add_term sigma) es ; apply sigma Intmap.empty e es (* -------------------------------------------------------------------------- *) (* --- convert between states --- *) (* -------------------------------------------------------------------------- *) let rebuild_in_state to_state ?(cache=Tmap.empty) e = let cache_find m e = Tmap.find e !m in let cache_bind m e v = m := Tmap.add e v !m ; v in let m = ref cache in let rec aux e = try cache_find m e with Not_found -> let r = match e.repr with | Kint i -> e_zint i | Kreal r -> e_real r | Fvar v -> e_var v | Bvar (v,t) -> c_bvar v t | True -> e_true | False -> e_false | Not e -> e_not (aux e) | Add xs -> addition (List.map aux xs) | Mul xs -> multiplication (List.map aux xs) | And xs -> e_and (List.map aux xs) | Or xs -> e_or (List.map aux xs) | Mod(x,y) -> e_mod (aux x) (aux y) | Div(x,y) -> e_div (aux x) (aux y) | Eq(x,y) -> e_eq (aux x) (aux y) | Neq(x,y) -> e_neq (aux x) (aux y) | Lt(x,y) -> e_lt (aux x) (aux y) | Leq(x,y) -> e_leq (aux x) (aux y) | Times(z,t) -> times z (aux t) | If(e,a,b) -> e_if (aux e) (aux a) (aux b) | Imply(hs,p) -> e_imply (List.map aux hs) (aux p) | Fun(g,xs) -> e_fun ?result:e.tau g (List.map aux xs) | Acst(t,v) -> e_const t (aux v) | Aget(x,y) -> e_get (aux x) (aux y) | Aset(x,y,z) -> e_set (aux x) (aux y) (aux z) | Rget(x,g) -> e_getfield (aux x) g | Rdef gxs -> e_record (List.map (fun (g,x) -> g, aux x) gxs) | Apply(e,es) -> c_apply (aux e) (List.map aux es) | Bind(q,t,e) -> c_bind q t (aux e) in cache_bind m e r in let r = in_state to_state aux e in r, !m (* -------------------------------------------------------------------------- *) (* --- Binders --- *) (* -------------------------------------------------------------------------- *) let let_intro_case q x a = let res = ref None in let found_term t = assert (!res = None); assert (not (Vars.mem x t.vars)); if not (lc_closed t) then false else (res := Some t; true) in let is_term_ok a b = match a.repr with | Fvar w -> assert (Var.equal x w); found_term b | Add e -> let is_var t = match t.repr with|Fvar v -> Var.equal x v|_->false in let rec add_case es = match es with | [] -> assert false (* because [x] is in [e] *) | t::ts -> if not (Vars.mem x t.vars) then add_case ts else if not (is_var t) then false (* [x] is too far in [t] *) else if not (List.for_all (fun t -> not (Vars.mem x t.vars)) ts) then false (* [x] is also in [ts] *) else begin (* var [x] is only in [t] that is also exactly [x] *) let rec fold_until_es acc ys = match ys with | [] -> assert false | _ when ys==es -> acc (* first terms until [es] *) | y::ys -> fold_until_es (y::acc) ys in let extracted = List.rev_append (fold_until_es [] e) ts in let reverse = e_sum (b::(List.map e_opp extracted)) in found_term reverse end in add_case e | _ -> false in let is_var_ok u v = match (Vars.mem x u.vars), (Vars.mem x v.vars) with | true,false -> is_term_ok u v | false,true -> is_term_ok v u | _,_ -> false in let is_boolean_var polarity_term = function | Fvar w when Var.equal x w -> found_term polarity_term | _ -> false in let is_eq e = match e.repr with | Eq(u,v) -> is_var_ok u v | Not q -> is_boolean_var e_false q.repr | rep -> is_boolean_var e_true rep in let is_neq e = match e.repr with | Neq(u,v)-> is_var_ok u v | Not q -> is_boolean_var e_true q.repr | rep -> is_boolean_var e_false rep in match q with | Lambda -> None | Forall -> let rec forall_case e = match e.repr with | Or b -> List.exists is_neq b | Imply (hs,b) -> List.exists is_eq hs || is_neq b | Bind(Forall,_,b) -> forall_case b (* skip intermediate forall *) | _ -> is_neq e in ignore(forall_case a); !res | Exists -> let rec exists_case e = match e.repr with | And b -> List.exists is_eq b | Bind(Exists,_,b) -> exists_case b (* skip intermediate exists *) | _ -> is_eq e in ignore(exists_case a); !res let e_open ~pool ?(forall=true) ?(exists=true) ?(lambda=true) a = match a.repr with | Bind _ -> let filter = function | Forall -> forall | Exists -> exists | Lambda -> lambda in let rec walk qs a = match a.repr with | Bind(q,t,b) when filter q -> let x = fresh pool t in walk ((q,x)::qs) (lc_open x b) | _ -> qs , a in walk [] a | _ -> [],a let e_unbind x (lc : lc_term) : term = assert (not (Vars.mem x lc.vars)); lc_open x lc let e_bind q x (e : term) = let do_bind = match q with Forall | Exists -> Vars.mem x e.vars | Lambda -> true in if do_bind then match let_intro_case q x e with | Some v -> e_subst_var x v e (* case [let x = v ; e] *) | _ -> c_bind q (tau_of_var x) (lc_close x e) else e let e_close qs a = List.fold_left (fun b (q,x) -> e_bind q x b) a qs let rec bind_xs q xs e = match xs with [] -> e | x::xs -> e_bind q x (bind_xs q xs e) let e_forall = bind_xs Forall let e_exists = bind_xs Exists let e_lambda = bind_xs Lambda (* -------------------------------------------------------------------------- *) (* --- Iterators --- *) (* -------------------------------------------------------------------------- *) let e_repr ?result = function | Bvar _ | Bind _ -> raise (Invalid_argument "Qed.e_repr") | True -> e_true | False -> e_false | Kint z -> e_zint z | Kreal r -> e_real r | Fvar x -> e_var x | Apply(a,xs) -> e_apply a xs | Times(k,e) -> e_times k e | Not e -> e_not e | Add xs -> e_sum xs | Mul xs -> e_prod xs | And xs -> e_and xs | Or xs -> e_or xs | Mod(x,y) -> e_mod x y | Div(x,y) -> e_div x y | Eq(x,y) -> e_eq x y | Neq(x,y) -> e_neq x y | Lt(x,y) -> e_lt x y | Leq(x,y) -> e_leq x y | If(e,a,b) -> e_if e a b | Imply(hs,p) -> e_imply hs p | Fun(g,xs) -> e_fun ?result g xs | Acst(t,v) -> e_const t v | Aget(m,k) -> e_get m k | Aset(m,k,v) -> e_set m k v | Rget(r,f) -> e_getfield r f | Rdef fvs -> e_record fvs let lc_iter f e = repr_iter f e.repr let f_map ?pool ?forall ?exists ?lambda f e = match e.repr with | Apply(a,xs) -> e_apply (f a) (List.map f xs) | Bind _ -> let pool = match pool with | None -> raise (Invalid_argument "Qed.ogic.Term.f_map") | Some pool -> pool in let ctx,a = e_open ~pool ?forall ?exists ?lambda e in e_close ctx (rebuild f a) | _ -> rebuild f e let f_iter ?pool ?forall ?exists ?lambda f e = match e.repr with | Bind _ -> let pool = match pool with | None -> raise (Invalid_argument "Qed.ogic.Term.f_iter") | Some pool -> pool in let _,a = e_open ~pool ?forall ?exists ?lambda e in f a | _ -> repr_iter f e.repr (* -------------------------------------------------------------------------- *) (* --- Sub-terms --- *) (* -------------------------------------------------------------------------- *) let change_subterm e pos child = let bad_position () = failwith "cannot replace subterm at given position" in let rec change_in_list children cur_pos rest = match children, cur_pos with | [], _ -> bad_position () | e::l, 0 -> (aux e rest) :: l | e::l, n -> e :: (change_in_list l (n-1) rest) (* since all repr might be shared, better work on an immutable copy than on the original array. *) and aux e pos = match pos with [] -> child | i::l -> begin match e.repr with | True | False | Kint _ | Kreal _ | Fvar _ | Bvar _ -> bad_position () | Times (_,e) when i = 0 && l = [] -> begin match child.repr with Kint n -> times n e | _ -> e_mul child e end | Times(n,e) when i = 1 -> times n (aux e l) | Times _ -> bad_position () | Add ops -> e_sum (change_in_list ops i l) | Mul ops -> e_prod (change_in_list ops i l) | Div (e1,e2) when i = 0 -> e_div (aux e1 l) e2 | Div (e1,e2) when i = 1 -> e_div e1 (aux e2 l) | Div _ -> bad_position () | Mod (e1,e2) when i = 0 -> e_mod (aux e1 l) e2 | Mod (e1,e2) when i = 1 -> e_mod e1 (aux e2 l) | Mod _ -> bad_position () | Eq (e1,e2) when i = 0 -> e_eq (aux e1 l) e2 | Eq (e1,e2) when i = 1 -> e_eq e1 (aux e2 l) | Eq _ -> bad_position () | Neq (e1,e2) when i = 0 -> e_neq (aux e1 l) e2 | Neq (e1,e2) when i = 1 -> e_neq e1 (aux e2 l) | Neq _ -> bad_position () | Leq (e1,e2) when i = 0 -> e_leq (aux e1 l) e2 | Leq (e1,e2) when i = 1 -> e_leq e1 (aux e2 l) | Leq _ -> bad_position () | Lt (e1,e2) when i = 0 -> e_lt (aux e1 l) e2 | Lt (e1,e2) when i = 1 -> e_lt e1 (aux e2 l) | Lt _ -> bad_position () | Acst (k,v) when i = 0 -> e_const k v | Acst _ -> bad_position () | Aget (e1,e2) when i = 0 -> e_get (aux e1 l) e2 | Aget (e1,e2) when i = 1 -> e_get e1 (aux e2 l) | Aget _ -> bad_position () | And ops -> e_and (change_in_list ops i l) | Or ops -> e_or (change_in_list ops i l) | Not e when i = 0 -> e_not (aux e l) | Not _ -> bad_position () | Imply(ops,e) -> let nb = List.length ops in if i < nb then e_imply (change_in_list ops i l) e else if i = nb then e_imply ops (aux e l) else bad_position () | If(e1,e2,e3) when i = 0 -> e_if (aux e1 l) e2 e3 | If(e1,e2,e3) when i = 1 -> e_if e1 (aux e2 l) e3 | If(e1,e2,e3) when i = 2 -> e_if e1 e2 (aux e3 l) | If _ -> bad_position () | Aset(e1,e2,e3) when i = 0 -> e_set (aux e1 l) e2 e3 | Aset(e1,e2,e3) when i = 1 -> e_set e1 (aux e2 l) e3 | Aset(e1,e2,e3) when i = 2 -> e_set e1 e2 (aux e3 l) | Aset _ -> bad_position () | Rdef _ | Rget _ -> failwith "change in place for records not yet implemented" | Fun (f,ops) -> e_fun ?result:e.tau f (change_in_list ops i l) | Bind(q,x,t) when i = 0 -> c_bind q x (aux t l) | Bind _ -> bad_position () | Apply(f,args) when i = 0 -> e_apply (aux f l) args | Apply (f,args) -> e_apply f (change_in_list args i l) end in aux e pos let () = pretty_debug := debug (* ------------------------------------------------------------------------ *) (* --- Record Decomposition --- *) (* ------------------------------------------------------------------------ *) let record_with fvs = let bases = ref Tmap.empty in let best = ref None in List.iter (fun (f,v) -> match v.repr with | Rget(base,g) when Field.equal f g -> let count = try succ (Tmap.find base !bases) with Not_found -> 1 in bases := Tmap.add base count !bases ; ( match !best with | Some(_,c) when c < count -> () | _ -> best := Some(base,count) ) | _ -> () ) fvs ; match !best with | None -> None | Some(base,_) -> let fothers = List.filter (fun (f,v) -> match v.repr with | Rget( other , g ) -> other != base || not (Field.equal f g) | _ -> true) fvs in Some ( base , fothers ) (* ------------------------------------------------------------------------ *) (* --- Symbol --- *) (* ------------------------------------------------------------------------ *) module Term = struct type t = term let hash = hash let equal = equal let compare = compare let pretty = pretty let debug e = Printf.sprintf "E%03d" e.id end (* ------------------------------------------------------------------------ *) (* --- Sizing Terms --- *) (* ------------------------------------------------------------------------ *) let rec count k m e = if not (Tset.mem e !m) then begin incr k ; m := Tset.add e !m ; lc_iter (count k m) e ; end let size e = let k = ref 0 in count k (ref Tset.empty) e ; !k (* ------------------------------------------------------------------------ *) (* --- Sub Term Test --- *) (* ------------------------------------------------------------------------ *) let rec scan_subterm m a e = if a == e then raise Exit ; if a.size <= e.size && not (Tset.mem e !m) then begin m := Tset.add e !m ; if Vars.subset a.vars e.vars then lc_iter (scan_subterm m a) e end let is_subterm a e = (a == e) || try scan_subterm (ref Tset.empty) a e ; false with Exit -> true (* ------------------------------------------------------------------------ *) (* --- Shared Sub-Terms --- *) (* ------------------------------------------------------------------------ *) type mark = | Unmarked (* first traversal *) | FirstMark (* second traversal *) | Marked (* finished *) type marks = { marked : (term -> bool) ; (* context-letified terms *) shareable : (term -> bool) ; (* terms that can be shared *) subterms : (term -> unit) -> term -> unit ; (* subterm iterator *) mutable mark : mark Tmap.t ; (* current marks during traversal *) mutable shared : Tset.t ; (* marked several times *) mutable roots : term list ; (* added as marked roots *) } let get_mark m e = try Tmap.find e m.mark with Not_found -> Unmarked let set_mark m e t = m.mark <- Tmap.add e t m.mark (* r is the order of the root term being marked, it is constant during the recursive traversal. This is also the floor of bound variables ; bvars k > r can not be shared, as they are not free in the term. *) let rec walk m r e = if not (is_simple e) then begin match get_mark m e with | Unmarked -> if m.marked e then set_mark m e Marked else begin set_mark m e FirstMark ; m.subterms (walk m r) e ; end | FirstMark -> if m.shareable e && lc_closed_at r e then m.shared <- Tset.add e m.shared else m.subterms (walk m r) e ; set_mark m e Marked | Marked -> () end let mark m e = m.roots <- e :: m.roots ; walk m (Bvars.order e.bind) e let share m e = if lc_closed e then begin m.roots <- e :: m.roots ; m.shared <- Tset.add e m.shared ; m.mark <- Tmap.add e Marked m.mark ; m.subterms (walk m (Bvars.order e.bind)) e end else mark m e type defs = { mutable stack : term list ; mutable defined : Tset.t ; } let rec collect shared defs e = if not (Tset.mem e defs.defined) then begin lc_iter (collect shared defs) e ; if Tset.mem e shared then defs.stack <- e :: defs.stack ; defs.defined <- Tset.add e defs.defined ; end let none = fun _ -> false let all = fun _ -> true let marks ?(shared=none) ?(shareable=all) ?(subterms=lc_iter) () = { shareable ; subterms ; marked = shared ; (* already shared are set to be marked *) shared = Tset.empty ; (* accumulator initially empty *) mark = Tmap.empty ; roots = [] ; } let defs m = let defines = { stack=[] ; defined=Tset.empty } in List.iter (collect m.shared defines) m.roots ; List.rev defines.stack let shared ?shared ?shareable ?subterms es = let m = marks ?shared ?shareable ?subterms () in List.iter (mark m) es ; defs m (* -------------------------------------------------------------------------- *) (* --- Typing --- *) (* -------------------------------------------------------------------------- *) let tau_of_sort = function | Sint -> Int | Sreal -> Real | Sbool -> Bool | Sprop | Sdata | Sarray _ -> raise Not_found let tau_of_arraysort = function | Sarray s -> tau_of_sort s | _ -> raise Not_found let tau_merge a b = match a,b with | Bool , Bool -> Bool | (Bool|Prop) , (Bool|Prop) -> Prop | Int , Int -> Int | (Int|Real) , (Int|Real) -> Real | _ -> if Tau.equal a b then a else raise Not_found let rec merge_list t f = function | [] -> t | e::es -> merge_list (tau_merge t (f e)) f es type env = { field : Field.t -> tau ; record : Field.t -> tau ; call : Fun.t -> tau option list -> tau ; } let rec typecheck env e = match e.tau with | Some tau -> tau | None -> match e.sort with | Sint -> Int | Sreal -> Real | Sbool -> Bool | Sprop -> Prop | Sdata | Sarray _ -> match e.repr with | Bvar (_,ty) -> ty | Fvar x -> tau_of_var x | Acst(t,v) -> Array(t,typecheck env v) | Aset(m,k,v) -> (try typecheck env m with Not_found -> Array(typecheck env k,typecheck env v)) | Fun(f,es) -> (try tau_of_sort (Fun.sort f) with Not_found -> env.call f (List.map (typeof env) es)) | Aget(m,_) -> (try match typecheck env m with | Array(_,v) -> v | _ -> raise Not_found with Not_found -> tau_of_arraysort m.sort) | Rdef [] -> raise Not_found | Rdef ((f,_)::_) -> env.record f | Rget (_,f) -> (try tau_of_sort (Field.sort f) with Not_found -> env.field f) | True | False -> Bool | Kint _ -> Int | Kreal _ -> Real | Times(_,e) -> typecheck env e | Add es | Mul es -> merge_list Int (typecheck env) es | Div (a,b) | Mod (a,b) | If(_,a,b) -> tau_merge (typecheck env a) (typecheck env b) | Eq _ | Neq _ | Leq _ | Lt _ | And _ | Or _ | Not _ | Imply _ -> Bool | Bind((Forall|Exists),_,_) -> Prop | Apply _ | Bind(Lambda,_,_) -> raise Not_found and typeof env e = try Some (typecheck env e) with Not_found -> None let undefined _ = raise Not_found let typeof ?(field=undefined) ?(record=undefined) ?(call=undefined) e = typecheck { field ; record ; call } e end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/qed/term.mli�������������������������������������������������������0000666�0000000�0000000�00000005510�13571573400�015707� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Logic expressions *) module Make ( ADT : Logic.Data ) ( Field : Logic.Field ) ( Fun : Logic.Function ) : sig (** Logic API *) include Logic.Term with module ADT = ADT and module Field = Field and module Fun = Fun (** Prints term in debug mode. *) val debug : Format.formatter -> term -> unit (** {2 Global State} One given [term] has valid meaning only for one particular state. *) type state (** Hash-consing, cache, rewriting rules, etc. *) val create : unit -> state (** Create a new fresh state. Local state is not modified. *) val get_state : unit -> state (** Return local state. *) val set_state : state -> unit (** Update local state. *) val clr_state : state -> unit (** Clear local state. *) val in_state : state -> ('a -> 'b) -> 'a -> 'b (** execute in a particular state. *) val rebuild_in_state : state -> ?cache:term Tmap.t -> term -> term * term Tmap.t (** rebuild a term in the given state *) (** Register a constant in the global state. *) val constant : term -> term (** {2 Context Release} *) val release : unit -> unit (** Clear caches and checks. Global builtins are kept. *) end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014776� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/Makefile.in�������������������������������������������������0000666�0000000�0000000�00000005307�13571573400�017050� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif ################### # Plug-in Setting # ################### PLUGIN_DIR ?=. PLUGIN_ENABLE:=@ENABLE_REPORT@ PLUGIN_NAME:=Report PLUGIN_CMO:= report_parameters scan dump csv classify register PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure #PLUGIN_NO_DEFAULT_TEST:=no PLUGIN_TESTS_DIRS:=report ################ # Generic part # ################ include $(FRAMAC_SHARE)/Makefile.dynamic ifeq ($(FRAMAC_INTERNAL),yes) # To allow testing with WP Report_DEFAULT_TESTS: create_share_link endif ##################################### # Regenerating the Makefile on need # ##################################### ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif $(Report_DIR)/Makefile: $(Report_DIR)/Makefile.in \ $(CONFIG_STATUS_DIR)/config.status cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/Report.mli��������������������������������������������������0000666�0000000�0000000�00000003345�13571573400�016761� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Pretty prints a report about the status of all properties. @since Sulfur-20171101 *) module Register : sig val print : unit -> unit end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/classify.ml�������������������������������������������������0000666�0000000�0000000�00000045401�13571573400�017151� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module R = Report_parameters type action = SKIP | INFO | ERROR | REVIEW let action s = match String.uppercase_ascii s with | "INFO" -> INFO | "ERROR" -> ERROR | "REVIEW" -> REVIEW | "SKIP" | "NONE" -> SKIP | a -> R.abort "Invalid action (%S)" a let string_of_action = function | SKIP -> "SKIP" | INFO -> "INFO" | REVIEW -> "REVIEW" | ERROR -> "ERROR" let pp_action fmt a = Format.pp_print_string fmt (string_of_action a) let pp_source fmt = function None -> () | Some lex -> Cil_datatype.Position.pretty fmt lex type rule = { r_id: string ; r_plugin: string ; r_category: string ; r_regexp: Str.regexp ; r_action: action ; r_title: string ; r_descr: string ; } type rules = { rs_rules : (string,rule Queue.t) Hashtbl.t ; (* indexed by plug-in *) rs_action : (unit -> string) ; rs_name : string ; } let warnings = { rs_rules = Hashtbl.create 0 ; rs_action = R.Warning.get ; rs_name = "warning" ; } let errors = { rs_rules = Hashtbl.create 0 ; rs_action = R.Error.get ; rs_name = "error" ; } type props = { ps_name : string ; ps_rules : rule Queue.t ; ps_action : (unit -> string) ; (* plugin option getter *) } let props ps_name ps_action = { ps_rules = Queue.create () ; ps_action ; ps_name } let untried = props "untried" R.UntriedStatus.get let unknown = props "unknown" R.UnknownStatus.get let invalid = props "invalid" R.InvalidStatus.get (* -------------------------------------------------------------------------- *) (* --- Configure Rules --- *) (* -------------------------------------------------------------------------- *) exception WrongFormat of string let failwith msg = Pretty_utils.ksfprintf (fun s -> raise (WrongFormat s)) msg let default = `NONE , { r_id = "unclassified" ; r_plugin = "kernel" ; r_category = "*" ; (* all *) r_title = "\\0" ; r_descr = "\\*" ; r_action = REVIEW ; r_regexp = Str.regexp "" } let has_pattern = function | `NONE | `CATEGORY -> false | _ -> true let rule_of_regexp t0 r t value = if has_pattern t0 then failwith "Duplicate rule pattern" ; t , { r with r_regexp = value |> Str.regexp } let rule_of_category t0 r = match t0 with | `NONE -> `CATEGORY , r | `CATEGORY -> failwith "Duplicate category" | `ERROR | `WARNING -> t0 , r | _ -> failwith "No category for status rule" let rule_of_fields (t,r) (field,jvalue) = try let value = Json.string jvalue in match field with | "classid" -> t,{ r with r_id = value } | "plugin" -> t,{ r with r_plugin = value } | "title" -> t,{ r with r_title = value } | "descr" -> t,{ r with r_descr = value } | "action" -> t,{ r with r_action = value |> action } | "category" -> rule_of_category t { r with r_category = value } | "error" -> rule_of_regexp t r `ERROR value | "warning" -> rule_of_regexp t r `WARNING value | "unknown" -> rule_of_regexp t r `UNKNOWN value | "untried" -> rule_of_regexp t r `UNTRIED value | "invalid" -> rule_of_regexp t r `INVALID value | "unproved" -> rule_of_regexp t r `UNPROVED value | _ -> failwith "unexpected field" with | Invalid_argument _ -> failwith "Unexpected value for '%s'" field | WrongFormat msg -> failwith "for '%s': %s" field msg let get_queue env plugin = try Hashtbl.find env.rs_rules plugin with Not_found -> let q = Queue.create () in Hashtbl.add env.rs_rules plugin q ; q let add_rule jvalue = try match jvalue with | `Assoc fields -> let tgt , rule = List.fold_left rule_of_fields default fields in let properties p = if rule.r_plugin <> (snd default).r_plugin then failwith "Unexpected 'plugin' for property-rule" ; p.ps_rules in let queues = match tgt with | `NONE -> failwith "Missing pattern" | `ERROR -> [get_queue errors rule.r_plugin] | `WARNING | `CATEGORY -> [get_queue errors rule.r_plugin ; get_queue warnings rule.r_plugin] | `UNTRIED -> [properties untried] | `UNKNOWN -> [properties unknown] | `INVALID -> [properties invalid] | `UNPROVED -> List.map properties [untried;unknown;invalid] in List.iter (Queue.add rule) queues | _ -> failwith "Classification rule expected" with WrongFormat msg -> failwith "@[<hv 0>%s@ @[<hov 2>in: %a@]@]" msg Json.pp jvalue let configure file = begin let path = Datatype.Filepath.of_string file in R.feedback "Loading '%a'" Datatype.Filepath.pretty path; try match Json.load_file file with | `List values -> List.iter add_rule values | _ -> failwith "Array expected" with | Json.Error(file,line,msg) -> let source = Log.source ~file ~line in R.abort ~source "%s" msg | WrongFormat msg -> let file = Datatype.Filepath.of_string file in let source = Log.source ~file ~line:1 in R.abort ~source "%s" msg | Sys_error msg -> R.abort "%s" msg | Invalid_argument msg | Failure msg -> R.abort "@[<hov 2>Parsing '%s' failed@ (%s)@]" file msg end (* -------------------------------------------------------------------------- *) (* --- Reporting Events --- *) (* -------------------------------------------------------------------------- *) type event = { e_classified : bool ; e_id : string ; e_action : action ; e_title : string ; e_descr : string ; e_source : Filepath.position option ; } let unclassified = { e_classified = false ; e_id = "" ; e_action = SKIP ; e_title = "" ; e_descr = "" ; e_source = None ; } let json_of_source = function | None -> [] | Some pos -> let file = if R.AbsolutePath.get () then (pos.Filepath.pos_path :> string) else Filepath.Normalized.to_pretty_string pos.Filepath.pos_path in [ "file" , Json.of_string file ; "line" , Json.of_int pos.Filepath.pos_lnum ; ] let json_of_event e = `Assoc begin [ "classid" , Json.of_string e.e_id ; "action" , Json.of_string @@ string_of_action e.e_action ; "title" , Json.of_string e.e_title ; "descr" , Json.of_string e.e_descr ; ] @ json_of_source e.e_source end module EVENTS = Set.Make (struct type t = event let compare = Transitioning.Stdlib.compare end) let events_queue = Queue.create () let events_pool = ref EVENTS.empty let nb_reviews = ref 0 let nb_errors = ref 0 let nb_unclassified = ref 0 let keep = function | SKIP -> R.debug_atleast 2 | INFO | REVIEW | ERROR -> true let push_event evt = if not (EVENTS.mem evt !events_pool) then begin events_pool := EVENTS.add evt !events_pool ; if not evt.e_classified then incr nb_unclassified ; if evt.e_action = REVIEW then incr nb_reviews ; if evt.e_action = ERROR then incr nb_errors ; Queue.push evt events_queue ; end let clear_events () = begin nb_reviews := 0 ; nb_errors := 0 ; nb_unclassified := 0 ; events_pool := EVENTS.empty ; Queue.clear events_queue ; end (* -------------------------------------------------------------------------- *) (* --- Matching a Rule --- *) (* -------------------------------------------------------------------------- *) let matches ~category ~msg r = (Log.is_subcategory category (Log.split_category r.r_category)) && (Str.string_match r.r_regexp msg 0) let replace ~msg text = let buffer = Buffer.create 80 in let rec scan k n = if k < n then let c = text.[k] in if k < n-1 && text.[k] = '\\' then (begin match text.[k+1] with | '*' -> Buffer.add_string buffer msg | 'n' -> Buffer.add_char buffer '\n' | '0'..'9' as a -> let i = int_of_char a - int_of_char '0' in ( try Buffer.add_string buffer (Str.matched_group i msg) with Not_found | Invalid_argument _ -> () ) | _ as a -> Buffer.add_char buffer a end ; scan (k+2) n) else ( Buffer.add_char buffer c ; scan (k+1) n ) in scan 0 (String.length text) ; Buffer.contents buffer exception FOUND of rule let find queue ~category ~msg = try Queue.iter (fun r -> if matches ~category ~msg r then raise (FOUND r)) queue ; raise Not_found with FOUND r -> r (* -------------------------------------------------------------------------- *) (* --- Monitoring --- *) (* -------------------------------------------------------------------------- *) let monitor ~lookup ~category ~msg ~source unclassified = try let rule = lookup ~category ~msg in if keep rule.r_action then let title = replace ~msg rule.r_title in let descr = replace ~msg rule.r_descr in push_event { e_classified = true ; e_id = rule.r_id ; e_title = title ; e_descr = descr ; e_action = rule.r_action ; e_source = source ; } with Not_found -> let event = unclassified () in if keep event.e_action then let descr = if event.e_descr = "" then msg else event.e_descr in push_event { event with e_descr = descr ; e_source = source } (* -------------------------------------------------------------------------- *) (* --- Monitoring Events --- *) (* -------------------------------------------------------------------------- *) let monitor_log_event (evt : Log.event) = let open Log in try let env = match evt.evt_kind with | Warning -> warnings | Error | Failure -> errors | Result | Feedback | Debug -> raise Exit in let msg = evt.evt_message in let source = evt.evt_source in let category = Log.evt_category evt in let lookup ~category ~msg = find (Hashtbl.find env.rs_rules evt.evt_plugin) ~category ~msg in let unclassified () = let e_id = Printf.sprintf "%s.unclassified.%s" evt.evt_plugin env.rs_name in let e_title = Printf.sprintf "Unclassified %s (Plugin '%s')" (String.capitalize_ascii env.rs_name) evt.evt_plugin in let e_action = action (env.rs_action ()) in { unclassified with e_id ; e_title ; e_action } in monitor ~lookup ~category ~msg ~source unclassified with Exit -> () let hooked = ref false let monitor_log () = if not !hooked then begin hooked := true ; R.feedback "Monitoring events" ; R.Rules.iter configure ; R.debug "Unclassified warnings: %s" (R.Warning.get ()) ; R.debug "Unclassified errors: %s" (R.Error.get ()) ; Log.add_listener ~kind:[Log.Warning;Log.Error;Log.Failure] monitor_log_event ; end (* -------------------------------------------------------------------------- *) (* --- Report on Property Status --- *) (* -------------------------------------------------------------------------- *) module E = Emitter.Usable_emitter module Pset = Property.Set module Status = Property_status.Consolidation let status ip = let open Status in match Status.get ip with | Never_tried -> `UNTRIED | Unknown _ -> `UNKNOWN | Considered_valid | Valid _ | Valid_but_dead _ | Unknown_but_dead _ | Invalid_but_dead _ -> `PROVED | Valid_under_hyp pending | Invalid_under_hyp pending -> `PENDING pending | Invalid _ | Inconsistent _ -> `INVALID let pending f pending = E.Map.iter (fun _ m -> E.Map.iter (fun _ ips -> Property.Set.iter f ips) m) pending let rec monitored_property ip = let open Cil_types in let open Property in match ip with | IPBehavior _ -> false | IPPredicate {ip_kind = PKAssumes _} -> false | IPPredicate {ip_kind = PKRequires _} -> true | IPPredicate {ip_kind = PKEnsures _} -> true | IPPredicate {ip_kind = PKTerminates} -> true | IPAllocation _ -> true | IPAssigns _ -> true | IPFrom _-> true | IPDecrease _ -> true | IPCodeAnnot {ica_ca = { annot_content = AStmtSpec _ }} -> false | IPCodeAnnot {ica_ca = { annot_content = APragma _ }} -> false | IPCodeAnnot {ica_ca = { annot_content = AExtended _ }} -> true | IPCodeAnnot {ica_ca = { annot_content = AAssert _ }} -> true | IPCodeAnnot {ica_ca = { annot_content = AInvariant _ }} -> true | IPCodeAnnot {ica_ca = { annot_content = AVariant _ }} -> true | IPCodeAnnot {ica_ca = { annot_content = AAssigns _ }} -> true | IPCodeAnnot {ica_ca = { annot_content = AAllocation _ }} -> true | IPComplete _ -> true | IPDisjoint _ -> true | IPReachable {ir_kf=None} -> false | IPReachable {ir_kf=Some _} -> true | IPAxiomatic _ | IPAxiom _ -> false | IPLemma _ -> true | IPTypeInvariant _ | IPGlobalInvariant _ -> true | IPOther _ -> true | IPExtended _ -> true | IPPropertyInstance {ii_ip} -> monitored_property ii_ip let monitor_status properties ip = if monitored_property ip then let name = Property.Names.get_prop_name_id ip in let lookup = find properties.ps_rules in let source = Property.source ip in let unclassified () = let e_id = "unclassified." ^ properties.ps_name in let e_title = name in let e_action = properties.ps_action () |> action in let e_descr = String.capitalize_ascii properties.ps_name ^ " status" in { unclassified with e_id ; e_action ; e_title ; e_descr } in monitor ~lookup ~category:[] ~msg:name ~source unclassified let monitor_property pool push ip = begin pool := Pset.add ip !pool ; match status ip with | `PENDING ips -> pending push ips | `PROVED -> () | `UNTRIED -> monitor_status untried ip | `UNKNOWN -> monitor_status unknown ip | `INVALID -> monitor_status invalid ip end let consolidate () = let pool = ref Pset.empty in let queue = Queue.create () in let push ip = if not (Pset.mem ip !pool) then Queue.push ip queue in begin Scan.source_properties (monitor_property pool push) ; while not (Queue.is_empty queue) do let ip = Queue.take queue in if not (Pset.mem ip !pool) then monitor_property pool push ip done end (* -------------------------------------------------------------------------- *) (* --- Run Classification --- *) (* -------------------------------------------------------------------------- *) let report_fmt ~long fmt = begin let bar = String.make 80 '-' in Queue.iter (fun e -> if long then Format.fprintf fmt "%s@." bar ; Format.fprintf fmt "@[<hv 0>@[<hov 0>" ; if long && e.e_source <> None then ( pp_source fmt e.e_source ; Format.pp_print_space fmt () ) ; Format.fprintf fmt "[%a:%s]@ %s@]" pp_action e.e_action e.e_id e.e_title ; if long && e.e_descr <> "" && e.e_descr <> e.e_title then ( Format.pp_print_space fmt () ; Format.pp_print_string fmt e.e_descr ) ; Format.fprintf fmt "@]@." ; ) events_queue ; if long then Format.fprintf fmt "%s@." bar end let report_console () = let long = R.Stdout.get () || R.verbose_atleast 2 in Log.print_on_output (report_fmt ~long) let report_stderr () = report_fmt ~long:true Format.err_formatter let report_dump fmt = begin Format.fprintf fmt "[" ; let sep = ref false in Queue.iter (fun e -> if !sep then Format.fprintf fmt "," ; Format.fprintf fmt "@. @[<hov 2>%a@]" Json.pp (json_of_event e) ; sep := true ; ) events_queue ; Format.fprintf fmt "@\n]@." ; end let report_output file = R.feedback "Output %s@." file ; Command.print_file file report_dump let report_number name nb opt = if nb > 0 then R.feedback "%s%4d" name nb ; let file = opt () in if file <> "" then let out = open_out file in output_string out (string_of_int nb) ; flush out ; close_out out let classify () = begin R.feedback "Classification" ; if R.Status.get () then consolidate () ; if R.Stderr.get () then report_stderr () ; if R.Stdout.get () || R.verbose_atleast 2 || (not (R.Stderr.get ()) && not (R.Output.is_set ())) then report_console () ; let file = R.Output.get () in if file <> "" then report_output file ; report_number "Reviews : " !nb_reviews R.OutputReviews.get ; report_number "Errors : " !nb_errors R.OutputErrors.get ; report_number "Unclassified: " !nb_unclassified R.OutputUnclassified.get ; if !nb_errors > 0 && R.Exit.get () then R.abort "Classified errors found" ; if not !Config.is_gui then clear_events () ; end (* -------------------------------------------------------------------------- *) (* --- Plug-in Registration --- *) (* -------------------------------------------------------------------------- *) let classify, _ = State_builder.apply_once "Report.classify_once" [ R.Classify.self; R.Output.self; Property_status.self; Ast.self; ] classify let register () = if R.Rules.is_set () || R.Warning.is_set () || R.Error.is_set () then monitor_log () let main () = if R.Classify.get () then classify () let () = begin Cmdline.run_after_configuring_stage register ; Db.Main.extend main ; end (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/classify.mli������������������������������������������������0000666�0000000�0000000�00000003161�13571573400�017317� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val classify : unit -> unit ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/configure���������������������������������������������������0000777�0000000�0000000�00000272071�13571573400�016716� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS ENABLE_REPORT ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_report ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-report support for report plug-in (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-report was given. if test "${enable_report+set}" = set; then : enableval=$enable_report; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "report is not available" "$LINENO" 5 fi FORCE_REPORT=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_REPORT ENABLE_REPORT=$ENABLE NAME_REPORT=report if test "$default" = "no" -a "$FORCE" = "no"; then INFO_REPORT=" (not available by default)" fi echo "report... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/configure.ac������������������������������������������������0000666�0000000�0000000�00000004316�13571573400�017270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # E-ACSL as a standard Frama-C plug-in # ######################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)]) check_plugin(report,PLUGIN_RELATIVE_PATH(plugin_file), [support for report plug-in],yes) ####################### # Generating Makefile # ####################### write_plugin_config(Makefile) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/csv.ml������������������������������������������������������0000666�0000000�0000000�00000010622�13571573400�016124� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Split the location into 'dir,file,line number,char number' in this order *) let split_loc loc = let file = Filepath.Normalized.to_pretty_string loc.Filepath.pos_path in let dir = Filename.dirname file in let dir = Filepath.relativize dir in let file = Filename.basename file in dir, file, loc.Filepath.pos_lnum, loc.Filepath.pos_cnum (* For properties that we want to skip *) exception Skip let kf_of_property ip = match Property.get_kf ip with | Some kf -> kf | None -> fst (Globals.entry_point ()) let to_string ip = let status = Description.status_feedback (Property_status.Feedback.get ip) in let loc = Property.location ip in match Description.property_kind_and_node ip with | None -> raise Skip | Some (kind, txt) -> let kf = kf_of_property ip in let loc = if Cil_datatype.Location.(equal loc unknown) then Kernel_function.get_location kf else loc in let loc = split_loc (fst loc) in (loc, Kernel_function.get_name kf, kind, status, txt) (* Compute the lines to export as a .csv, then sorts them *) let lines () = let do_one_ip ip l = if Scan.report_ip ip then try to_string ip :: l with Skip -> l else l in let l = Property_status.fold do_one_ip [] in (* This [sort] removes fully identical lines, including identical alarms emitted on statements copied through loop unrolling. This is the desired semantics for now. However, since we compare entire locations, textually identical lines that refer to different expressions are kept separate *) Extlib.sort_unique Transitioning.Stdlib.compare l let output file = let ch = open_out file in let fmt = Format.formatter_of_out_channel ch in Format.pp_set_margin fmt 1000000; Format.fprintf fmt "@[<v>"; Format.fprintf fmt "@[directory\tfile\tline\tfunction\tproperty kind\tstatus\tproperty@]@ "; let pp ((dir, file, lnum, _), kf, kind, status, txt) = Format.fprintf fmt "@[<h>%s\t%s\t%d\t%s\t%s\t%s\t%s@]@ " dir file lnum kf kind status txt; in List.iter pp (lines ()); Format.fprintf fmt "@]%!" (** Registration of non-free options *) let print_csv = Dynamic.register ~plugin:"Report" ~journalize:true "print_csv" (Datatype.func Datatype.string Datatype.unit) output let print_csv_once () = let file = Report_parameters.CSVFile.get () in Report_parameters.feedback "Dumping properties in '%s'" file; print_csv file let print_csv, _ = State_builder.apply_once "Report.print_csv_once" [ Report_parameters.PrintProperties.self; Report_parameters.Specialized.self; Report_parameters.CSVFile.self; Property_status.self ] print_csv_once let main () = if Report_parameters.CSVFile.get () <> "" then print_csv () let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/csv.mli�����������������������������������������������������0000666�0000000�0000000�00000003157�13571573400�016302� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Nothing is exported *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/dump.ml�����������������������������������������������������0000666�0000000�0000000�00000021761�13571573400�016304� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Dump Report on Output --- *) (* -------------------------------------------------------------------------- *) open Property_status let bar = String.make 80 '-' let dim = 9 (* Size for status [----] *) let tab = String.make (dim+3) ' ' let pp_status fmt s = let n = String.length s in if n < dim then let m = Bytes.make dim ' ' in let p = (dim - n) / 2 in Bytes.blit_string s 0 m p n ; Format.fprintf fmt "[%s]" (Bytes.to_string m) else Format.fprintf fmt "[%s]" s open Consolidation module E = Emitter.Usable_emitter class dumper out = object(self) val mutable st_unknown = 0 ; (* no status *) val mutable st_partial = 0 ; (* locally valid but missing hyp *) val mutable st_extern = 0 ; (* considered valid *) val mutable st_complete = 0 ; (* valid and complete *) val mutable st_bug = 0 ; (* invalid and complete *) val mutable st_alarm = 0 ; (* invalid but missing hyp *) val mutable st_dead = 0 ; (* under invalid hyp *) val mutable st_maybe_unreachable = 0 ; (* possible unreachable *) val mutable st_unreachable = 0 ; (* confirmed unreachable *) val mutable st_reachable = 0 ; (* confirmed reachable *) val mutable st_inconsistent = 0 ; (* unsound *) val mutable kf : Description.kf = `Always method started = () method global_section = Format.fprintf out "%s@\n--- Global Properties@\n%s@\n@." bar bar method function_section thekf = Format.fprintf out "@\n%s@\n--- Properties of Function '%s'@\n%s@\n@." bar (Kernel_function.get_name thekf) bar ; kf <- `Context thekf method category ip st = match ip, st with (* Special display for unreachable *) | Property.IPReachable _, Invalid _ -> st_unreachable <- succ st_unreachable; "Unreachable" | Property.IPReachable _, (Valid _ | Considered_valid) -> st_reachable <- succ st_reachable; "Reachable" | Property.IPReachable _, _ -> st_maybe_unreachable <- succ st_maybe_unreachable; "-r-" (* All other cases *) | _, (Never_tried | Unknown _) -> st_unknown <- succ st_unknown ; "-" | _, Considered_valid -> st_extern <- succ st_extern ; "Extern" | _, Valid _ -> st_complete <- succ st_complete ; "Valid" | _, Invalid _ -> st_bug <- succ st_bug ; "Bug" | _, Valid_under_hyp _ -> st_partial <- succ st_partial ; "Partial" | _, Invalid_under_hyp _ -> st_alarm <- succ st_alarm ; "Alarm" | _, (Valid_but_dead _ | Invalid_but_dead _ | Unknown_but_dead _) -> st_dead <- succ st_dead ; "Dead" | _, Inconsistent _ -> st_inconsistent <- succ st_inconsistent ; "Unsound" method emitter e = Format.fprintf out "%s@[<hov 2>by %a.@]@\n" tab E.pretty e method emitters es = E.Set.iter self#emitter es method tried_emitters ps = let es = E.Map.fold (fun e _ es -> e::es) ps [] in match es with | [] -> () | e::es -> Format.fprintf out "%s@[<hov 2>tried with %a" tab E.pretty e ; List.iter (fun e -> Format.fprintf out ",@ %a" E.pretty e) es ; Format.fprintf out ".@]@\n" method dead_reasons ps = E.Map.iter (fun e ps -> Format.fprintf out "%s@[<hov 2>By %a because:@]@\n" tab E.pretty e ; Property.Set.iter (fun p -> Format.fprintf out "%s@[<hov 3> - %a@]@\n" tab (Description.pp_localized ~kf ~ki:true ~kloc:true) p) ps ) (Scan.partial_pending ps) method partial_pending ps = E.Map.iter (fun e ps -> Format.fprintf out "%s@[<hov 2>By %a, with pending:@]@\n" tab E.pretty e ; Property.Set.iter (fun p -> Format.fprintf out "%s@[<hov 3> - %a@]@\n" tab (Description.pp_localized ~kf ~ki:true ~kloc:true) p) ps ) (Scan.partial_pending ps) method property ip st = begin Format.fprintf out "%a @[%a@]@\n" pp_status (self#category ip st) (Description.pp_localized ~kf:`Never ~ki:true ~kloc:true) ip ; if Report_parameters.PrintProperties.get () then Format.fprintf out "%s@[%a@]@\n" tab Property.pretty ip; match st with | Never_tried -> () | Unknown emitters -> self#tried_emitters emitters | Valid emitters -> self#emitters emitters | Invalid emitters -> self#emitters emitters | Invalid_but_dead pending -> Format.fprintf out "%sLocally invalid, but unreachable.@\n" tab ; self#dead_reasons pending | Valid_but_dead pending -> Format.fprintf out "%sLocally valid, but unreachable.@\n" tab ; self#dead_reasons pending | Unknown_but_dead pending -> Format.fprintf out "%sLocally unknown, but unreachable.@\n"tab ; self#dead_reasons pending | Invalid_under_hyp pending | Valid_under_hyp pending -> self#partial_pending pending | Considered_valid -> Format.fprintf out "%sUnverifiable but considered Valid.@\n" tab | Inconsistent s -> let p = ref 0 in let n = String.length s in while !p < n do try let k = String.index_from s !p '\n' in Format.fprintf out "%s%s@\n" tab (String.sub s !p (k - !p)) ; p := succ k ; with Not_found -> Format.fprintf out "%s%s@\n" tab (String.sub s !p (n - !p)) ; p := n ; done end method finished = Format.fprintf out "@\n%s@\n--- Status Report Summary@\n%s@\n" bar bar ; if st_complete > 0 then Format.fprintf out " %4d Completely validated@\n" st_complete ; if st_partial > 0 then Format.fprintf out " %4d Locally validated@\n" st_partial ; if st_extern > 0 then Format.fprintf out " %4d Considered valid@\n" st_extern ; if st_unknown > 0 then Format.fprintf out " %4d To be validated@\n" st_unknown ; if st_alarm = 1 then Format.fprintf out " %4d Alarm emitted@\n" st_alarm ; if st_alarm > 1 then Format.fprintf out " %4d Alarms emitted@\n" st_alarm ; if st_bug > 0 then Format.fprintf out " %4d Bugs found@\n" st_bug ; if st_dead > 1 then Format.fprintf out " %4d Dead properties@\n" st_dead ; if st_dead = 1 then Format.fprintf out " 1 Dead property@\n" ; if st_reachable > 0 then Format.fprintf out " %4d Reachable@\n" st_reachable ; if st_maybe_unreachable > 0 then Format.fprintf out " %4d Unconfirmed unreachable@\n" st_maybe_unreachable ; if st_unreachable > 0 then Format.fprintf out " %4d Unreachable@\n" st_unreachable ; if st_inconsistent > 1 then Format.fprintf out " %4d Inconsistencies@\n" st_inconsistent ; if st_inconsistent = 1 then Format.fprintf out " 1 Inconsistency@\n" ; let total = st_complete + st_partial + st_extern + st_unknown + st_alarm + st_bug + st_dead + st_reachable + st_unreachable + st_maybe_unreachable + st_inconsistent in Format.fprintf out " %5d Total@\n%s@." total bar ; method empty = Format.fprintf out "%s@\n--- No status to report@\n%s@." bar bar ; end let create out = (new dumper out :> Scan.inspector) (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������frama-c-20.0-Calcium/src/plugins/report/dump.mli����������������������������������������������������0000666�0000000�0000000�00000003205�13571573400�016446� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val create : Format.formatter -> Scan.inspector �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/register.ml�������������������������������������������������0000666�0000000�0000000�00000004756�13571573400�017170� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Plug-in Implementation --- *) (* -------------------------------------------------------------------------- *) let print () = Report_parameters.feedback "Computing properties status..." ; Log.print_on_output (fun fmt -> Scan.iter (Dump.create fmt)) let print = Dynamic.register ~plugin:"Report" ~journalize:true "print" (Datatype.func Datatype.unit Datatype.unit) print let print, _ = State_builder.apply_once "Report.print_once" [ Report_parameters.Print.self; Report_parameters.PrintProperties.self; Report_parameters.Specialized.self; Property_status.self ] print let main () = if Report_parameters.Print.get () then print () let () = Db.Main.extend main; (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������frama-c-20.0-Calcium/src/plugins/report/register.mli������������������������������������������������0000666�0000000�0000000�00000003643�13571573400�017333� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Report Properties Status --- *) (* -------------------------------------------------------------------------- *) val print : unit -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/report_parameters.ml����������������������������������������0000666�0000000�0000000�00000016275�13571573400�021101� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "report" let shortname = "report" let help = "Properties Status Report (experimental)" end) module Print = False (struct let option_name = "-report" let help = "display a summary of properties status" end) let printing = add_group "Printing Property Report" let () = Parameter_customize.set_group printing module PrintProperties = False (struct let option_name = "-report-print-properties" let help = "print not only the locations, but also the \ properties themselves" end) let () = Parameter_customize.set_group printing module Untried = False (struct let option_name = "-report-untried" let help = "display properties which no plug-in tried to prove" end) let () = Parameter_customize.set_group printing module Specialized = True (struct let option_name = "-report-specialized" let help = "display properties that are auxiliary instances of other \ properties." end) let () = Parameter_customize.set_group printing module Proven = True (struct let option_name = "-report-proven" let help = "if set, output proven properties. Otherwise, only unproven \ ones are shown." end) let () = Parameter_customize.set_group printing module CSVFile = String (struct let option_name = "-report-csv" let arg_name = "name" let default = "" let help = "if set, output properties as a csv file of the given name" end) let monitoring = add_group "Monitoring of Properties, Errors and Warnings" let () = Parameter_customize.set_group monitoring module Classify = False (struct let option_name = "-report-classify" let help = "Report classification of all properties, errors and warnings" end) let () = Parameter_customize.set_group monitoring module Rules = String_list (struct let option_name = "-report-rules" let arg_name = "*.json,..." let help = "Configure the rules to apply for classification,\ and start monitoring." end) let () = Parameter_customize.set_group monitoring module Warning = String (struct let option_name = "-report-unclassified-warning" let arg_name = "action" let default = "REVIEW" let help = "Action to be taken on unclassified warnings\ (default is: 'REVIEW')" end) let () = Parameter_customize.set_group monitoring module Error = String (struct let option_name = "-report-unclassified-error" let arg_name = "action" let default = "ERROR" let help = "Action to be taken on unclassified errors\ (default is: 'ERROR')" end) let () = Parameter_customize.set_group monitoring module Status = True (struct let option_name = "-report-status" let help = "Classify also property statuses" end) let () = Parameter_customize.set_group monitoring module UntriedStatus = String (struct let option_name = "-report-unclassified-untried" let arg_name = "action" let default = "SKIP" let help = "Action to be taken on untried properties \ (default is: 'SKIP')" end) let () = Parameter_customize.set_group monitoring module UnknownStatus = String (struct let option_name = "-report-unclassified-unknown" let arg_name = "action" let default = "REVIEW" let help = "Action to be taken on unknown properties\ (default is: 'REVIEW')" end) let () = Parameter_customize.set_group monitoring module InvalidStatus = String (struct let option_name = "-report-unclassified-invalid" let arg_name = "action" let default = "ERROR" let help = "Action to be taken on invalid properties\ (default is: 'ERROR')" end) let () = Parameter_customize.set_group monitoring module Output = String (struct let option_name = "-report-output" let arg_name = "*.json" let help = "Output -report-classify in JSON format" let default = "" end) let () = Parameter_customize.set_group monitoring module AbsolutePath = False (struct let option_name = "-report-absolute-path" let help = "Report absolute path locations" end) let () = Parameter_customize.set_group monitoring module OutputReviews = String (struct let option_name = "-report-output-reviews" let arg_name = "file" let help = "Output number of reviews to <file>" let default = "" end) let () = Parameter_customize.set_group monitoring module OutputErrors = String (struct let option_name = "-report-output-errors" let arg_name = "file" let help = "Output number of errors to <file>" let default = "" end) let () = Parameter_customize.set_group monitoring module OutputUnclassified = String (struct let option_name = "-report-output-unclassified" let arg_name = "file" let help = "Output number of unclassified to <file>" let default = "" end) let () = Parameter_customize.set_group monitoring module Stderr = False (struct let option_name = "-report-stderr" let help = "Output detailed textual classification on stderr" end) let () = Parameter_customize.set_group monitoring module Stdout = False (struct let option_name = "-report-stdout" let help = "Force detailed textual classification on stdout" end) let () = Parameter_customize.set_group monitoring module Exit = True (struct let option_name = "-report-exit" let help = "Exit on error" end) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/report_parameters.mli���������������������������������������0000666�0000000�0000000�00000004702�13571573400�021242� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.General_services module Print: Parameter_sig.Bool module PrintProperties: Parameter_sig.Bool module Untried: Parameter_sig.Bool module Specialized: Parameter_sig.Bool module Proven: Parameter_sig.Bool module CSVFile: Parameter_sig.String module Classify: Parameter_sig.Bool module Rules: Parameter_sig.String_list module Warning: Parameter_sig.String module Error: Parameter_sig.String module Status: Parameter_sig.Bool module UntriedStatus: Parameter_sig.String module UnknownStatus: Parameter_sig.String module InvalidStatus: Parameter_sig.String module Output: Parameter_sig.String module OutputReviews: Parameter_sig.String module OutputErrors: Parameter_sig.String module OutputUnclassified: Parameter_sig.String module AbsolutePath: Parameter_sig.Bool module Stdout: Parameter_sig.Bool module Stderr: Parameter_sig.Bool module Exit: Parameter_sig.Bool ��������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/scan.ml�����������������������������������������������������0000666�0000000�0000000�00000015413�13571573400�016260� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Iterator for Report --- *) (* -------------------------------------------------------------------------- *) open Property_status module E = Emitter.Usable_emitter class type inspector = object method empty : unit method started : unit method global_section : unit method function_section : Kernel_function.t -> unit method property : Property.t -> Consolidation.t -> unit method finished : unit end let dead_reasons (ps:Consolidation.pending) = E.Map.fold (fun _ -> E.Map.fold (fun _ -> Property.Set.union)) ps Property.Set.empty let partial_pending (ps:Consolidation.pending) = E.Map.map (fun best -> E.Map.fold (fun _ -> Property.Set.union) best Property.Set.empty) ps (** Filters on which properties should be reported *) (* someone has tried to prove [ip], or show ips that no one attempted *) let report_untried ip = match Consolidation.get ip with | Consolidation.Never_tried -> Report_parameters.Untried.get () | _ -> true (* ip is not the specialization of a property, or those specializations should be shown. *) let report_specialized ip = (Report_parameters.Specialized.get ()) || (match ip with Property.IPPropertyInstance _ -> false | _ -> true) let report_proven ip = let open Consolidation in Report_parameters.Proven.get () || match get ip with | Considered_valid | Valid _ | Invalid_but_dead _ | Valid_but_dead _ | Unknown_but_dead _ | Valid_under_hyp _ -> false | Never_tried | Unknown _ | Invalid _ | Invalid_under_hyp _ | Inconsistent _ -> true let report_ip ip = report_untried ip && report_specialized ip && report_proven ip let rec add_property ips ip = if report_ip ip && not (Property.Set.mem ip !ips) then begin ips := Property.Set.add ip !ips ; add_consolidation ips (Consolidation.get ip) end and add_consolidation ips = function | Consolidation.Never_tried | Consolidation.Considered_valid | Consolidation.Valid _ | Consolidation.Invalid _ | Consolidation.Inconsistent _ -> () | Consolidation.Valid_under_hyp ps | Consolidation.Unknown ps | Consolidation.Invalid_under_hyp ps | Consolidation.Valid_but_dead ps | Consolidation.Invalid_but_dead ps | Consolidation.Unknown_but_dead ps -> add_pending ips ps and add_pending ipref (ps:Consolidation.pending) = E.Map.iter (fun _ m -> E.Map.iter (fun _ ips -> Property.Set.iter (add_property ipref) ips ) m ) ps let iter (inspector:inspector) = begin (* Collect noticeable properties (tried + their pending) *) let properties = ref Property.Set.empty in Property_status.iter (fun ip -> add_property properties ip) ; let globals = ref Property.Set.empty in let functions = ref Kernel_function.Map.empty in (* Dispatch properties into globals and per-function map *) Property.Set.iter (fun ip -> match Property.get_kf ip with | None -> globals := Property.Set.add ip !globals | Some kf -> if not (Ast_info.is_frama_c_builtin (Kernel_function.get_name kf)) then try let fips = Kernel_function.Map.find kf !functions in fips := Property.Set.add ip !fips with Not_found -> let ips = Property.Set.singleton ip in functions := Kernel_function.Map.add kf (ref ips) !functions) !properties ; (* Report a set of ip in a section *) let report s f ips = if not (Property.Set.is_empty ips) then ( s () ; Property.Set.iter (fun ip -> f ip (Consolidation.get ip)) ips ) in if Property.Set.is_empty !globals && Kernel_function.Map.is_empty !functions then inspector#empty else begin inspector#started ; report (fun () -> inspector#global_section) inspector#property !globals ; Kernel_function.Map.iter (fun kf ips -> let vi = Kernel_function.get_vi kf in if not (Cil.is_unused_builtin vi) then report (fun () -> inspector#function_section kf) inspector#property !ips) !functions ; inspector#finished ; end end (* -------------------------------------------------------------------------- *) (* --- Source Visitor --- *) (* -------------------------------------------------------------------------- *) class visit_properties (phi : Property.t -> unit) = object(self) inherit Visitor.frama_c_inplace (* --- Visits --- *) method! vspec fspec = Property.ip_of_spec (Extlib.the self#current_kf) self#current_kinstr ~active:[] fspec |> List.iter phi ; Cil.DoChildren method! vcode_annot ca = Property.ip_of_code_annot (Extlib.the self#current_kf) (Extlib.the self#current_stmt) ca |> List.iter phi ; Cil.DoChildren method! vannotation ga = Property.ip_of_global_annotation ga |> List.iter phi ; Cil.DoChildren end let source_properties phi = let v = new visit_properties phi in Visitor.visitFramacFile (v :> Visitor.frama_c_visitor) (Ast.get ()) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/scan.mli����������������������������������������������������0000666�0000000�0000000�00000005002�13571573400�016422� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Iterator for Report --- *) (* -------------------------------------------------------------------------- *) open Property_status class type inspector = object method empty : unit method started : unit method global_section : unit method function_section : Kernel_function.t -> unit method property : Property.t -> Consolidation.t -> unit method finished : unit end val dead_reasons : Consolidation.pending -> Property.Set.t val partial_pending : Consolidation.pending -> Property.Set.t Emitter.Usable_emitter.Map.t val iter : inspector -> unit val report_ip: Property.t -> bool (** Should this property be part of the final report according to the users filters. *) val source_properties : (Property.t -> unit) -> unit (** Visit all source properties from the AST *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016140� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/�����������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017453� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/classify.c�������������������������������������0000666�0000000�0000000�00000002260�13571573400�021434� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config CMD: @frama-c@ -kernel-warn-key=annot-error=active -no-autoload-plugins -load-module wp,report -report-output @PTEST_RESULT@/classified.@PTEST_NUMBER@.json -wp -wp-msg-key no-time-info LOG: classified.@PTEST_NUMBER@.json OPT: -wp-prover qed -report-unclassified-untried REVIEW -then -report-classify LOG: classified.@PTEST_NUMBER@.json OPT: -wp-prover qed -report-unclassified-warning ERROR -then -report-classify LOG: classified.@PTEST_NUMBER@.json OPT: -wp-prover qed -report-unclassified-warning ERROR -report-no-status -then -report-classify LOG: classified.@PTEST_NUMBER@.json OPT: -wp-prover qed -report-rules @PTEST_DIR@/classify.json -report-unclassified-warning ERROR -then -report-classify LOG: classified.@PTEST_NUMBER@.json OPT: -wp-prover qed -report-rules @PTEST_DIR@/classify.json -report-unclassified-untried REVIEW -then -report-classify LOG: classified.@PTEST_NUMBER@.json OPT: -wp-prover none -report-rules @PTEST_DIR@/classify.json -report-unclassified-untried REVIEW -then -report-classify */ int a ; /*@ requires a >= 0 ; ensures a > 0 ; assigns a ; */ void f(void) { //@ assert ignored-annotation; a++ ; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/classify.json����������������������������������0000666�0000000�0000000�00000001043�13571573400�022161� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "classid": "Parsing", "category": "annot-error", "action": "ERROR" }, { "classid": "RTE", "plugin": "wp", "warning": "Missing RTE guards", "descr": "Shall run Eva plug-in" }, { "classid": "GOAL", "untried": "\([a-z]\)*_ensures[a-z_]*", "title": "Postcondition '\1'", "descr": "Property Untried", "action": "ERROR" }, { "classid": "UNIT", "untried": "\([a-z]\)*_requires[a-z_]*", "title": "Precondition '\1'", "descr": "Property Untried", "action": "INFO" } ] ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/csv.c������������������������������������������0000666�0000000�0000000�00000002415�13571573400�020414� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config LOG: csv.csv OPT: -no-autoload-plugins -load-module from,inout,report,scope,eva -eva-warn-copy-indeterminate=-main4 -eva -eva-show-progress -remove-redundant-alarms -eva-warn-key=alarm=inactive -then -report-csv @PTEST_RESULT@/csv.csv -report-no-proven -then -report-csv= -eva-warn-key=alarm -slevel 1 COMMENT: first, do an analysis without any message, but check that the .csv is complete. Then, redo the analysis with value warnings. slevel 1 is just there to force Value to restart */ volatile v; void main1(int x) { int t[10]; int u[15]; x = x * x; u[x] = 1; t[u[x]] = 2; t[u[x]] = 3; } //@ requires x >= 1; int f(int x); void main2(int x) { f(x); f(x-1); f(x-2); f(x); } #include "math.h" void main3() { double f1 = v; double f2 = v; double r = pow(f1, f2); } /*@ requires \false; terminates \false; assigns \nothing; */ void __FC_assert(const char* file,int line,const char*expr); #define assert(e) ((e)?(void)0:__FC_assert(__FILE__,__LINE__,#e)) //@ assigns \result \from \nothing; double any_double(void); void main4() { double d = any_double(); assert (d >= 1.); // Check location of alarm on non-finite float, which may be wrong because of macros } void main() { main1(v); main2(v); main3(); main4(); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/hyp.i������������������������������������������0000666�0000000�0000000�00000000713�13571573400�020426� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -no-autoload-plugins -load-module report -load-script tests/report/one_hyp.ml OPT: -no-autoload-plugins -load-module report -load-script tests/report/several_hyps.ml */ void f(void); void f2(void); void g() { /*@ assert \true; */ } void h() { /*@ assert \false; */ } void i() { /*@ assert 1 == 2; */ } void j() { /*@ assert 2 == 3; */ } void main() { /*@ assert 0 == 1; */ f(); f2(); g(); h(); i(); j(); } �����������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/multi_emitters.ml������������������������������0000666�0000000�0000000�00000003644�13571573400�023062� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������let emitter1 = Emitter.create "Test1" [ Emitter.Property_status ] ~correctness:[] ~tuning:[] let emitter2 = Emitter.create "Test2" [ Emitter.Property_status ] ~correctness:[] ~tuning:[] let set_status e s = Kernel.feedback "%a SET STATUS TO %a" Emitter.pretty e Property_status.Emitted_status.pretty s; Annotations.iter_all_code_annot (fun stmt _ ca -> let kf = Kernel_function.find_englobing_kf stmt in let ps = Property.ip_of_code_annot kf stmt ca in List.iter (fun p -> Property_status.emit e p ~hyps:[] s) ps) let print_status = Dynamic.get ~plugin:"Report" "print" (Datatype.func Datatype.unit Datatype.unit) let clear () = Kernel.feedback "CLEARING"; Project.clear ~selection:(State_selection.Static.with_dependencies Property_status.self) () let main () = Ast.compute (); print_status (); set_status emitter1 Property_status.Dont_know; set_status emitter2 Property_status.Dont_know; (* unknown /\ unknown *) print_status (); (* unknown /\ true *) set_status emitter1 Property_status.True; print_status (); (* true /\ true *) set_status emitter2 Property_status.True; print_status (); clear (); (* true /\ false_if_reachable *) set_status emitter1 Property_status.Dont_know; set_status emitter2 Property_status.False_if_reachable; print_status (); (* true /\ false *) set_status emitter2 Property_status.False_and_reachable; print_status (); clear (); (* false_if_reachable /\ false_if_reachable *) set_status emitter1 Property_status.False_if_reachable; set_status emitter2 Property_status.False_if_reachable; print_status (); (* false_if_reachable /\ false *) set_status emitter1 Property_status.False_if_reachable; set_status emitter2 Property_status.False_and_reachable; print_status (); (* false /\ false *) set_status emitter1 Property_status.False_and_reachable; print_status () let () = Db.Main.extend main ��������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/no_hyp.ml��������������������������������������0000666�0000000�0000000�00000002707�13571573400�021307� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������let emitter = Emitter.create "Test" [ Emitter.Property_status ] ~correctness:[] ~tuning:[] let set_status s = Annotations.iter_all_code_annot (fun stmt _ ca -> let kf = Kernel_function.find_englobing_kf stmt in let ps = Property.ip_of_code_annot kf stmt ca in List.iter (fun p -> Property_status.emit emitter p ~hyps:[] s) ps) let print_status = Dynamic.get ~plugin:"Report" "print" (Datatype.func Datatype.unit Datatype.unit) let clear () = Project.clear ~selection:(State_selection.Static.with_dependencies Property_status.self) () let main () = Ast.compute (); Kernel.feedback "SETTING STATUS TO dont_know"; set_status Property_status.Dont_know; print_status (); Kernel.feedback "SETTING STATUS TO true"; set_status Property_status.True; print_status (); Kernel.feedback "SETTING STATUS TO false_if_reachable"; (try set_status Property_status.False_if_reachable with Property_status.Inconsistent_emitted_status(s1, s2) -> Kernel.result "inconsistency between %a and %a" Property_status.Emitted_status.pretty s1 Property_status.Emitted_status.pretty s2); Kernel.feedback "CLEARING"; clear (); Kernel.feedback "SETTING STATUS TO false_if_reachable"; set_status Property_status.False_if_reachable; print_status (); Kernel.feedback "SETTING STATUS TO false_and_reachable"; set_status Property_status.False_and_reachable; print_status () let () = Db.Main.extend main ���������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/one_hyp.ml�������������������������������������0000666�0000000�0000000�00000015777�13571573400�021467� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_types let emitter = Emitter.create "Test" [ Emitter.Property_status ] ~correctness:[] ~tuning:[] let emitter2 = Emitter.create "Test2" [ Emitter.Property_status ] ~correctness:[] ~tuning:[] let set_status ?(emitter=emitter) p hyps s = Kernel.feedback "SETTING STATUS OF %a TO %a" Property.pretty p Property_status.Emitted_status.pretty s; Property_status.emit emitter p ~hyps s let print_status = Dynamic.get ~plugin:"Report" "print" (Datatype.func Datatype.unit Datatype.unit) let clear () = Kernel.feedback "CLEARING"; Project.clear ~selection:(State_selection.with_dependencies Property_status.self) () let main () = Ast.compute (); print_status (); let main, _, _, h, g = let l = Annotations.fold_all_code_annot (fun stmt _ ca acc -> let kf = Kernel_function.find_englobing_kf stmt in let ps = Property.ip_of_code_annot kf stmt ca in match ps with | [ p ] -> p :: acc | _ -> assert false) [] in match l with | [ p1; p2; p3; p4; p5 ] -> p1, p2, p3, p4, p5 | _ -> assert false in let ensures = let kf = Globals.Functions.find_by_name "f" in let spec = Annotations.funspec kf in Property.ip_post_cond_of_spec kf Kglobal ~active:[] spec in (* *********************************************************************** *) (* hyp = never_tried *) (* unknown *) set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = considered_valid *) clear (); (* unknown *) set_status h ensures Property_status.Dont_know; print_status (); (* true *) set_status h ensures Property_status.True; print_status (); clear (); (* false *) set_status h [] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = valid *) clear (); (* unknown *) set_status main [] Property_status.True; set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status main [] Property_status.True; set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = valid under hyp *) clear (); (* unknown *) set_status g [] Property_status.Dont_know; set_status main [ g ] Property_status.True; set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status g [] Property_status.Dont_know; set_status main [ g ] Property_status.True; set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = dont_know *) clear (); (* unknown *) set_status main [] Property_status.Dont_know; set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status main [] Property_status.Dont_know; set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = invalid *) clear (); (* unknown *) set_status main [] Property_status.False_and_reachable; set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status main [] Property_status.False_and_reachable; set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = invalid under hyp *) clear (); (* unknown *) set_status g [] Property_status.Dont_know; set_status main [ ] Property_status.False_and_reachable; set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status g [] Property_status.Dont_know; set_status main [ ] Property_status.False_and_reachable; set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = invalid but dead *) clear (); (* unknown *) set_status g [] Property_status.False_and_reachable; set_status main [ ] Property_status.False_and_reachable; set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status g [] Property_status.False_and_reachable; set_status main [ ] Property_status.False_and_reachable; set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = valid but dead *) clear (); (* unknown *) set_status g [] Property_status.False_and_reachable; set_status main [ g ] Property_status.True; set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status g [] Property_status.False_and_reachable; set_status main [ g ] Property_status.True; set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = unknown but dead *) clear (); (* unknown *) set_status g [] Property_status.False_and_reachable; set_status main [ g ] Property_status.Dont_know; set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status g [] Property_status.False_and_reachable; set_status main [ g ] Property_status.Dont_know; set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) (* hyp = inconsistent *) clear (); (* unknown *) set_status main [] Property_status.True; set_status ~emitter:emitter2 main [] Property_status.False_and_reachable; set_status h [ main ] Property_status.Dont_know; print_status (); (* true *) set_status h [ main ] Property_status.True; print_status (); clear (); (* false *) set_status main [] Property_status.True; set_status ~emitter:emitter2 main [] Property_status.False_and_reachable; set_status h [ ] Property_status.False_and_reachable; print_status (); (* *********************************************************************** *) () let () = Db.Main.extend main �frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/����������������������������������������0000777�0000000�0000000�00000000000�13571573400�020720� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classified.0.json�����������������������0000666�0000000�0000000�00000000251�13571573400�024055� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "classid": "unclassified.untried", "action": "REVIEW", "title": "f_requires", "descr": "Untried status", "file": "tests/report/classify.c", "line": 22 } ] �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classified.1.json�����������������������0000666�0000000�0000000�00000000616�13571573400�024063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "classid": "kernel.unclassified.warning", "action": "ERROR", "title": "Unclassified Warning (Plugin 'kernel')", "descr": "unbound logic variable ignored. Ignoring code annotation", "file": "tests/report/classify.c", "line": 27 }, { "classid": "wp.unclassified.warning", "action": "ERROR", "title": "Unclassified Warning (Plugin 'wp')", "descr": "Missing RTE guards" } ] ������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classified.2.json�����������������������0000666�0000000�0000000�00000000616�13571573400�024064� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "classid": "kernel.unclassified.warning", "action": "ERROR", "title": "Unclassified Warning (Plugin 'kernel')", "descr": "unbound logic variable ignored. Ignoring code annotation", "file": "tests/report/classify.c", "line": 27 }, { "classid": "wp.unclassified.warning", "action": "ERROR", "title": "Unclassified Warning (Plugin 'wp')", "descr": "Missing RTE guards" } ] ������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classified.3.json�����������������������0000666�0000000�0000000�00000000710�13571573400�024060� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "classid": "Parsing", "action": "ERROR", "title": "", "descr": "unbound logic variable ignored. Ignoring code annotation", "file": "tests/report/classify.c", "line": 27 }, { "classid": "RTE", "action": "REVIEW", "title": "Missing RTE guards", "descr": "Shall run Eva plug-in" }, { "classid": "UNIT", "action": "INFO", "title": "Precondition 'f'", "descr": "Property Untried", "file": "tests/report/classify.c", "line": 22 } ] ��������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classified.4.json�����������������������0000666�0000000�0000000�00000000710�13571573400�024061� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "classid": "Parsing", "action": "ERROR", "title": "", "descr": "unbound logic variable ignored. Ignoring code annotation", "file": "tests/report/classify.c", "line": 27 }, { "classid": "RTE", "action": "REVIEW", "title": "Missing RTE guards", "descr": "Shall run Eva plug-in" }, { "classid": "UNIT", "action": "INFO", "title": "Precondition 'f'", "descr": "Property Untried", "file": "tests/report/classify.c", "line": 22 } ] ��������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classified.5.json�����������������������0000666�0000000�0000000�00000001413�13571573400�024063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "classid": "Parsing", "action": "ERROR", "title": "", "descr": "unbound logic variable ignored. Ignoring code annotation", "file": "tests/report/classify.c", "line": 27 }, { "classid": "RTE", "action": "REVIEW", "title": "Missing RTE guards", "descr": "Shall run Eva plug-in" }, { "classid": "UNIT", "action": "INFO", "title": "Precondition 'f'", "descr": "Property Untried", "file": "tests/report/classify.c", "line": 22 }, { "classid": "GOAL", "action": "ERROR", "title": "Postcondition 'f'", "descr": "Property Untried", "file": "tests/report/classify.c", "line": 23 }, { "classid": "unclassified.untried", "action": "REVIEW", "title": "f_assigns", "descr": "Untried status", "file": "tests/report/classify.c", "line": 24 } ] �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classify.0.res.oracle�������������������0000666�0000000�0000000�00000001015�13571573400�024647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/report/classify.c (with preprocessing) [kernel:annot-error] tests/report/classify.c:27: Warning: unbound logic variable ignored. Ignoring code annotation [wp] Running WP plugin... [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_f_assigns : Valid [wp] [Qed] Goal typed_f_ensures : Valid [wp] Proved goals: 2 / 2 Qed: 2 [report] Classification [report] Output tests/report/result/classified.0.json [report] Reviews : 1 [report] Unclassified: 1 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classify.1.res.oracle�������������������0000666�0000000�0000000�00000001212�13571573400�024647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[report] Monitoring events [kernel] Parsing tests/report/classify.c (with preprocessing) [kernel:annot-error] tests/report/classify.c:27: Warning: unbound logic variable ignored. Ignoring code annotation [wp] Running WP plugin... [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_f_assigns : Valid [wp] [Qed] Goal typed_f_ensures : Valid [wp] Proved goals: 2 / 2 Qed: 2 [report] Classification [report] Output tests/report/result/classified.1.json [report] Errors : 2 [report] Unclassified: 2 [report] User Error: Classified errors found [kernel] Plug-in report aborted: invalid user input. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classify.2.res.oracle�������������������0000666�0000000�0000000�00000001212�13571573400�024650� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[report] Monitoring events [kernel] Parsing tests/report/classify.c (with preprocessing) [kernel:annot-error] tests/report/classify.c:27: Warning: unbound logic variable ignored. Ignoring code annotation [wp] Running WP plugin... [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_f_assigns : Valid [wp] [Qed] Goal typed_f_ensures : Valid [wp] Proved goals: 2 / 2 Qed: 2 [report] Classification [report] Output tests/report/result/classified.2.json [report] Errors : 2 [report] Unclassified: 2 [report] User Error: Classified errors found [kernel] Plug-in report aborted: invalid user input. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classify.3.res.oracle�������������������0000666�0000000�0000000�00000001270�13571573400�024655� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[report] Monitoring events [report] Loading 'tests/report/classify.json' [kernel] Parsing tests/report/classify.c (with preprocessing) [kernel:annot-error] tests/report/classify.c:27: Warning: unbound logic variable ignored. Ignoring code annotation [wp] Running WP plugin... [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_f_assigns : Valid [wp] [Qed] Goal typed_f_ensures : Valid [wp] Proved goals: 2 / 2 Qed: 2 [report] Classification [report] Output tests/report/result/classified.3.json [report] Reviews : 1 [report] Errors : 1 [report] User Error: Classified errors found [kernel] Plug-in report aborted: invalid user input. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classify.4.res.oracle�������������������0000666�0000000�0000000�00000001270�13571573400�024656� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[report] Monitoring events [report] Loading 'tests/report/classify.json' [kernel] Parsing tests/report/classify.c (with preprocessing) [kernel:annot-error] tests/report/classify.c:27: Warning: unbound logic variable ignored. Ignoring code annotation [wp] Running WP plugin... [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_f_assigns : Valid [wp] [Qed] Goal typed_f_ensures : Valid [wp] Proved goals: 2 / 2 Qed: 2 [report] Classification [report] Output tests/report/result/classified.4.json [report] Reviews : 1 [report] Errors : 1 [report] User Error: Classified errors found [kernel] Plug-in report aborted: invalid user input. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/classify.5.res.oracle�������������������0000666�0000000�0000000�00000001206�13571573400�024656� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[report] Monitoring events [report] Loading 'tests/report/classify.json' [kernel] Parsing tests/report/classify.c (with preprocessing) [kernel:annot-error] tests/report/classify.c:27: Warning: unbound logic variable ignored. Ignoring code annotation [wp] Running WP plugin... [wp] Warning: Missing RTE guards [wp] Goal typed_f_ensures : not tried [wp] Goal typed_f_assigns : trivial [report] Classification [report] Output tests/report/result/classified.5.json [report] Reviews : 2 [report] Errors : 2 [report] Unclassified: 1 [report] User Error: Classified errors found [kernel] Plug-in report aborted: invalid user input. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/csv.csv���������������������������������0000666�0000000�0000000�00000002237�13571573400�022234� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������directory file line function property kind status property FRAMAC_SHARE/libc math.h 522 pow precondition Unknown finite_logic_res: \is_finite(pow(x, y)) tests/report csv.c 11 main1 signed_overflow Unknown -2147483648 ≤ x * x tests/report csv.c 11 main1 signed_overflow Unknown x * x ≤ 2147483647 tests/report csv.c 12 main1 index_bound Unknown 0 ≤ x tests/report csv.c 12 main1 index_bound Unknown x < 15 tests/report csv.c 13 main1 initialization Unknown \initialized(&u[x]) tests/report csv.c 17 f precondition Unknown x ≥ 1 tests/report csv.c 18 f assigns clause Unknown assigns \nothing; tests/report csv.c 18 f from clause Unknown assigns \result \from x; tests/report csv.c 21 main2 precondition of f Unknown x ≥ 1 tests/report csv.c 22 main2 precondition of f Unknown x ≥ 1 tests/report csv.c 23 main2 precondition of f Unknown x ≥ 1 tests/report csv.c 33 main3 precondition of pow Unknown finite_logic_res: \is_finite(pow(x, y)) tests/report csv.c 37 __FC_assert precondition Invalid or unreachable \false tests/report csv.c 50 main4 is_nan_or_infinite Unknown \is_finite(d) tests/report csv.c 50 main4 precondition of __FC_assert Invalid or unreachable \false �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/csv.res.oracle��������������������������0000666�0000000�0000000�00000020566�13571573400�023503� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/report/csv.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/report/csv.c:54. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/report/csv.c:55. [eva] computing for function f <- main2 <- main. Called from tests/report/csv.c:21. [kernel] tests/report/csv.c:21: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] computing for function f <- main2 <- main. Called from tests/report/csv.c:22. [eva] Done for function f [eva] computing for function f <- main2 <- main. Called from tests/report/csv.c:23. [eva] Done for function f [eva] computing for function f <- main2 <- main. Called from tests/report/csv.c:24. [eva] tests/report/csv.c:24: function f: precondition got status valid. [eva] Done for function f [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/report/csv.c:56. [eva] tests/report/csv.c:33: Call to builtin pow [eva] tests/report/csv.c:33: function pow: precondition 'finite_args' got status valid. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/report/csv.c:57. [eva] computing for function any_double <- main4 <- main. Called from tests/report/csv.c:49. [eva] using specification for function any_double [eva] Done for function any_double [eva] computing for function __FC_assert <- main4 <- main. Called from tests/report/csv.c:50. [eva] using specification for function __FC_assert [eva] Done for function __FC_assert [eva] Recording results for main4 [eva] Done for function main4 [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: x ∈ [0..14] t[0] ∈ UNINITIALIZED [1] ∈ {3} [2..9] ∈ UNINITIALIZED u[0..14] ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function main2: [eva:final-states] Values at end of function main4: d ∈ [1. .. 1.79769313486e+308] [eva:final-states] Values at end of function main3: f1 ∈ [-2147483648. .. 2147483647.] f2 ∈ [-2147483648. .. 2147483647.] r ∈ [-1.79769313486e+308 .. 1.79769313486e+308] [eva:final-states] Values at end of function main: [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 5 functions analyzed (out of 5): 100% coverage. In these functions, 23 statements reached (out of 23): 100% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 0 warnings by the Frama-C kernel: 0 errors 1 warning ---------------------------------------------------------------------------- 7 alarms generated by the analysis: 2 accesses out of bounds index 2 integer overflows 2 accesses to uninitialized left-values 1 nan or infinite floating-point value ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 0 valid 0 unknown 0 invalid 0 total Preconditions 2 valid 4 unknown 1 invalid 7 total 28% of the logical properties reached have been proven. ---------------------------------------------------------------------------- [report] Dumping properties in 'tests/report/result/csv.csv' [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/report/csv.c:54. [eva:alarm] tests/report/csv.c:11: Warning: signed overflow. assert -2147483648 ≤ x * x; [eva:alarm] tests/report/csv.c:11: Warning: signed overflow. assert x * x ≤ 2147483647; [eva:alarm] tests/report/csv.c:12: Warning: accessing out of bounds index. assert 0 ≤ x; [eva:alarm] tests/report/csv.c:12: Warning: accessing out of bounds index. assert x < 15; [eva:alarm] tests/report/csv.c:13: Warning: accessing uninitialized left-value. assert \initialized(&u[x]); [eva:alarm] tests/report/csv.c:14: Warning: accessing uninitialized left-value. assert \initialized(&u[x]); [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/report/csv.c:55. [eva] computing for function f <- main2 <- main. Called from tests/report/csv.c:21. [eva:alarm] tests/report/csv.c:21: Warning: function f: precondition got status unknown. [eva] Done for function f [eva] computing for function f <- main2 <- main. Called from tests/report/csv.c:22. [eva:alarm] tests/report/csv.c:22: Warning: function f: precondition got status unknown. [eva] Done for function f [eva] computing for function f <- main2 <- main. Called from tests/report/csv.c:23. [eva:alarm] tests/report/csv.c:23: Warning: function f: precondition got status unknown. [eva] Done for function f [eva] computing for function f <- main2 <- main. Called from tests/report/csv.c:24. [eva] Done for function f [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/report/csv.c:56. [eva] tests/report/csv.c:33: Call to builtin pow [eva:alarm] tests/report/csv.c:33: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/report/csv.c:57. [eva] computing for function any_double <- main4 <- main. Called from tests/report/csv.c:49. [eva] Done for function any_double [eva:alarm] tests/report/csv.c:50: Warning: non-finite double value. assert \is_finite(d); [eva] computing for function __FC_assert <- main4 <- main. Called from tests/report/csv.c:50. [eva:alarm] tests/report/csv.c:50: Warning: function __FC_assert: precondition got status invalid. [eva] Done for function __FC_assert [eva] Recording results for main4 [eva] Done for function main4 [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: x ∈ [0..14] t[0] ∈ UNINITIALIZED [1] ∈ {3} [2..9] ∈ UNINITIALIZED u[0..14] ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function main2: [eva:final-states] Values at end of function main4: d ∈ [1. .. 1.79769313486e+308] [eva:final-states] Values at end of function main3: f1 ∈ [-2147483648. .. 2147483647.] f2 ∈ [-2147483648. .. 2147483647.] r ∈ [-1.79769313486e+308 .. 1.79769313486e+308] [eva:final-states] Values at end of function main: [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 5 functions analyzed (out of 5): 100% coverage. In these functions, 23 statements reached (out of 23): 100% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 0 warnings by the Frama-C kernel: 0 errors 1 warning ---------------------------------------------------------------------------- 7 alarms generated by the analysis: 2 accesses out of bounds index 2 integer overflows 2 accesses to uninitialized left-values 1 nan or infinite floating-point value ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 0 valid 0 unknown 0 invalid 0 total Preconditions 2 valid 4 unknown 1 invalid 7 total 28% of the logical properties reached have been proven. ---------------------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/hyp.0.res.oracle������������������������0000666�0000000�0000000�00000144511�13571573400�023643� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/report/hyp.i (no preprocessing) [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- [kernel:annot:missing-spec] tests/report/hyp.i:25: Warning: Neither code nor specification for function f, generating default assigns from the prototype [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ - ] Assigns nothing tried with Inferred annotations. [ - ] Default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 To be validated 3 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ - ] Assigns nothing tried with Inferred annotations. [ - ] Default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 26) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Locally validated 2 To be validated 3 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 Bugs found 3 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 To be validated 3 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Considered valid 3 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 Bugs found 3 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Considered valid 1 To be validated 4 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Considered valid 4 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Considered valid 1 Bugs found 4 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Locally validated 1 Considered valid 2 To be validated 5 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 2 Locally validated 1 Considered valid 1 To be validated 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Locally validated 1 Considered valid 1 To be validated 1 Bugs found 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 2 To be validated 4 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 26) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Locally validated 1 Considered valid 1 To be validated 4 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 To be validated 1 Bugs found 4 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 26) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 Bugs found 1 Dead property 4 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 26) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 Bugs found 1 Dead property 4 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 2 Bugs found 4 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 26) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 To be validated 1 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 26) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 To be validated 1 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 To be validated 2 Bugs found 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 26) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 2 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 26) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 2 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 3 Bugs found 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 To be validated 1 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Considered valid 1 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 2 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 To be validated 1 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Considered valid 1 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 2 Bugs found 1 Dead property 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 26) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 To be validated 1 Inconsistency 4 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert \false; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 26) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 26) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Locally validated 1 Considered valid 1 Inconsistency 4 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 26) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Considered valid 1 Bugs found 1 Inconsistency 4 Total -------------------------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/hyp.1.res.oracle������������������������0000666�0000000�0000000�00001534206�13571573400�023651� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/report/hyp.i (no preprocessing) [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- [kernel:annot:missing-spec] tests/report/hyp.i:25: Warning: Neither code nor specification for function f, generating default assigns from the prototype [kernel:annot:missing-spec] tests/report/hyp.i:25: Warning: Neither code nor specification for function f2, generating default assigns from the prototype [kernel] NEVER_TRIED + NEVER_TRIED [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 5 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 5 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + CONSIDERED_VALID [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 5 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 5 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + VALID [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + VALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Locally validated 2 Considered valid 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + UNKNOWN [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 To be validated 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + INVALID [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + INVALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + INVALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + VALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] NEVER_TRIED + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 10) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Inconsistency 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 10) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Inconsistency 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 10) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Inconsistency 6 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + CONSIDERED_VALID [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 5 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 5 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 5 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + VALID [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + VALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Locally validated 2 Considered valid 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + UNKNOWN [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 To be validated 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + INVALID [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + INVALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 6 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + INVALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + VALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CONSIDERED_VALID + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 10) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Inconsistency 6 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 10) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Inconsistency 6 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 10) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Inconsistency 6 Total -------------------------------------------------------------------------------- [kernel] VALID + VALID [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 1 To be validated 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 Completely validated 2 Considered valid 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] VALID + VALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Locally validated 2 Considered valid 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] VALID + UNKNOWN [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 To be validated 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] VALID + INVALID [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] VALID + INVALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] VALID + INVALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 3 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] VALID + VALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 Completely validated 2 Considered valid 1 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 2 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] VALID + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] VALID + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 Bugs found 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] VALID_UNDER_HYP + VALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Locally validated 2 Considered valid 1 To be validated 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 3 Locally validated 2 Considered valid 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 14) By Test, with pending: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Locally validated 2 Considered valid 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] VALID_UNDER_HYP + UNKNOWN [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 2 To be validated 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Locally validated 2 Considered valid 1 To be validated 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] VALID_UNDER_HYP + INVALID [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 2 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] VALID_UNDER_HYP + INVALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 2 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] VALID_UNDER_HYP + INVALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 3 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] VALID_UNDER_HYP + VALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 1 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Locally validated 2 Considered valid 1 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 2 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] VALID_UNDER_HYP + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Locally validated 2 Considered valid 1 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] VALID_UNDER_HYP + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Locally validated 2 Considered valid 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 10) By Test, with pending: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] UNKNOWN + UNKNOWN [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 To be validated 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 2 To be validated 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 14) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 To be validated 1 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] UNKNOWN + INVALID [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 2 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] UNKNOWN + INVALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 2 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] UNKNOWN + INVALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 3 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] UNKNOWN + VALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 To be validated 1 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 1 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 2 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] UNKNOWN + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 To be validated 1 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] UNKNOWN + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 To be validated 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 To be validated 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 10) tried with Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] INVALID + INVALID [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] INVALID + INVALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] INVALID + INVALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 4 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] INVALID + VALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 3 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] INVALID + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 2 Dead properties 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 2 Dead properties 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] INVALID + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] INVALID_UNDER_HYP + INVALID_UNDER_HYP [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 7 Total -------------------------------------------------------------------------------- [kernel] INVALID_UNDER_HYP + INVALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 4 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] INVALID_UNDER_HYP + VALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 3 Bugs found 8 Total -------------------------------------------------------------------------------- [kernel] INVALID_UNDER_HYP + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 2 Dead properties 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 2 Dead properties 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 1 Dead property 8 Total -------------------------------------------------------------------------------- [kernel] INVALID_UNDER_HYP + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 1 Dead property 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Inconsistency 7 Total -------------------------------------------------------------------------------- [kernel] INVALID_BUT_DEAD + INVALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 4 Bugs found 1 Dead property 9 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 4 Bugs found 1 Dead property 9 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 5 Bugs found 9 Total -------------------------------------------------------------------------------- [kernel] INVALID_BUT_DEAD + VALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 3 Bugs found 1 Dead property 9 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 3 Bugs found 1 Dead property 9 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 4 Bugs found 9 Total -------------------------------------------------------------------------------- [kernel] INVALID_BUT_DEAD + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 2 Dead properties 9 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 2 Dead properties 9 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 4 Bugs found 1 Dead property 9 Total -------------------------------------------------------------------------------- [kernel] INVALID_BUT_DEAD + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 1 Inconsistency 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 26) Locally valid, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 10) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 1 Inconsistency 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 1 Inconsistency 8 Total -------------------------------------------------------------------------------- [kernel] VALID_BUT_DEAD + VALID_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 1 To be validated 2 Bugs found 9 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 Completely validated 2 Considered valid 2 Bugs found 9 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 14) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 3 Bugs found 9 Total -------------------------------------------------------------------------------- [kernel] VALID_BUT_DEAD + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 2 Bugs found 1 Dead property 9 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 9 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 3 Bugs found 1 Dead property 9 Total -------------------------------------------------------------------------------- [kernel] VALID_BUT_DEAD + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Inconsistency 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 1 Inconsistency 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 10) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 1 Inconsistency 8 Total -------------------------------------------------------------------------------- [kernel] UNKNOWN_BUT_DEAD + UNKNOWN_BUT_DEAD [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 2 Bugs found 2 Dead properties 9 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 3 Completely validated 2 Considered valid 2 Bugs found 2 Dead properties 9 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert 2 ≡ 3; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO unknown [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 14) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'j' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 22) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 3 Bugs found 2 Dead properties 9 Total -------------------------------------------------------------------------------- [kernel] UNKNOWN_BUT_DEAD + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 1 Bugs found 1 Dead property 1 Inconsistency 8 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 1 Bugs found 1 Dead property 1 Inconsistency 8 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert 1 ≡ 2; TO **NOT** VALID [kernel] SETTING STATUS OF assert \true; TO unknown [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/report/hyp.i, line 10) Locally unknown, but unreachable. By Test because: - Assertion (file tests/report/hyp.i, line 18) -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'i' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 18) by Test. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 2 Bugs found 1 Dead property 1 Inconsistency 8 Total -------------------------------------------------------------------------------- [kernel] INCONSISTENT + INCONSISTENT [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 10) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/hyp.i, line 26) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 To be validated 2 Inconsistencies 7 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS OF assert 0 ≡ 1; TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 10) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Partial ] Assertion (file tests/report/hyp.i, line 26) By Test, with pending: - Assertion (file tests/report/hyp.i, line 10) - Assertion (file tests/report/hyp.i, line 14) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 Locally validated 2 Considered valid 2 Inconsistencies 7 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] SETTING STATUS OF assert \true; TO VALID [kernel] SETTING STATUS OF assert \true; TO **NOT** VALID [kernel] SETTING STATUS OF assert \false; TO VALID [kernel] SETTING STATUS OF assert \false; TO **NOT** VALID [kernel] SETTING STATUS OF assert 0 ≡ 1; TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 10) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Unsound ] Assertion (file tests/report/hyp.i, line 14) inconsistent status: VALID according to Test but **NOT** VALID according to Test2 -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/hyp.i, line 26) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 1 Bugs found 2 Inconsistencies 7 Total -------------------------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/single.0.res.oracle���������������������0000666�0000000�0000000�00000013564�13571573400�024327� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/report/single.i (no preprocessing) [kernel] SETTING STATUS TO unknown IN p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/single.i, line 9) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 To be validated 1 Total -------------------------------------------------------------------------------- [kernel] CHANGING DEFAULT PROJECT TO p' [kernel] GOING BACK TO PROJECT p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/single.i, line 9) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 To be validated 1 Total -------------------------------------------------------------------------------- [kernel] CREATING p2 by COPYING p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/single.i, line 9) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 To be validated 1 Total -------------------------------------------------------------------------------- [kernel] CHANGING DEFAULT PROJECT TO p2 [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- [kernel] SETTING STATUS TO false_and_reachable [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/single.i, line 9) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Bugs found 1 Total -------------------------------------------------------------------------------- [kernel] CHANGING DEFAULT PROJECT TO p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/single.i, line 9) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 To be validated 1 Total -------------------------------------------------------------------------------- [kernel] SETTING A CORRECTNESS PARAMETER [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- [kernel] SETTING STATUS TO unknown IN p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/single.i, line 9) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 To be validated 1 Total -------------------------------------------------------------------------------- [kernel] SETTING A TUNING PARAMETER [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/single.i, line 9) tried with Test (v1). -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 To be validated 1 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS TO unknown IN p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/single.i, line 9) tried with Test (v2), Test (v1). -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 To be validated 1 Total -------------------------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/single.1.res.oracle���������������������0000666�0000000�0000000�00000005565�13571573400�024332� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/report/single.i (no preprocessing) [kernel] SETTING STATUS TO dont_know [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/single.i, line 9) tried with Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 To be validated 1 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS TO true [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/single.i, line 9) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS TO false_if_reachable [kernel] inconsistency between **NOT** VALID and VALID [kernel] CLEARING [kernel] SETTING STATUS TO false_if_reachable [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Alarm ] Assertion (file tests/report/single.i, line 9) By Test, with pending: - Unreachable program point (file tests/report/single.i, line 9) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Alarm emitted 1 Total -------------------------------------------------------------------------------- [kernel] SETTING STATUS TO false_and_reachable [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/single.i, line 9) by Test. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Bugs found 1 Total -------------------------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/oracle/single.2.res.oracle���������������������0000666�0000000�0000000�00000014006�13571573400�024321� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/report/single.i (no preprocessing) [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- [kernel] Test1 SET STATUS TO unknown [kernel] Test2 SET STATUS TO unknown [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/report/single.i, line 9) tried with Test2, Test1. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 To be validated 1 Total -------------------------------------------------------------------------------- [kernel] Test1 SET STATUS TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/single.i, line 9) by Test1. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Total -------------------------------------------------------------------------------- [kernel] Test2 SET STATUS TO VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/report/single.i, line 9) by Test1. by Test2. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 1 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] Test1 SET STATUS TO unknown [kernel] Test2 SET STATUS TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Alarm ] Assertion (file tests/report/single.i, line 9) By Test2, with pending: - Unreachable program point (file tests/report/single.i, line 9) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Alarm emitted 1 Total -------------------------------------------------------------------------------- [kernel] Test2 SET STATUS TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/single.i, line 9) by Test2. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Bugs found 1 Total -------------------------------------------------------------------------------- [kernel] CLEARING [kernel] Test1 SET STATUS TO **NOT** VALID [kernel] Test2 SET STATUS TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Alarm ] Assertion (file tests/report/single.i, line 9) By Test1, with pending: - Unreachable program point (file tests/report/single.i, line 9) By Test2, with pending: - Unreachable program point (file tests/report/single.i, line 9) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Alarm emitted 1 Total -------------------------------------------------------------------------------- [kernel] Test1 SET STATUS TO **NOT** VALID [kernel] Test2 SET STATUS TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/single.i, line 9) by Test2. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Bugs found 1 Total -------------------------------------------------------------------------------- [kernel] Test1 SET STATUS TO **NOT** VALID [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion (file tests/report/single.i, line 9) by Test1. by Test2. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Bugs found 1 Total -------------------------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/projectified_status.ml�������������������������0000666�0000000�0000000�00000003475�13571573400�024070� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������let emitter = Emitter.create "Test" [ Emitter.Property_status ] ~correctness:[ Kernel.LibEntry.parameter ] ~tuning:[ Kernel.SafeArrays.parameter ] let set_status s = Annotations.iter_all_code_annot (fun stmt _ ca -> let kf = Kernel_function.find_englobing_kf stmt in let ps = Property.ip_of_code_annot kf stmt ca in List.iter (fun p -> Property_status.emit emitter p ~hyps:[] s) ps) let print_status = Dynamic.get ~plugin:"Report" "print" (Datatype.func Datatype.unit Datatype.unit) let main () = Ast.compute (); Kernel.feedback "SETTING STATUS TO unknown IN p"; set_status Property_status.Dont_know; print_status (); let p' = Project.create "foobar" in Kernel.feedback "CHANGING DEFAULT PROJECT TO p'"; Project.on p' (fun () -> ()) (); Project.remove ~project:p' (); Kernel.feedback "GOING BACK TO PROJECT p"; print_status (); let p = Project.current () in Kernel.feedback "CREATING p2 by COPYING p"; let p2 = File.create_project_from_visitor "p2" (new Visitor.frama_c_copy) in print_status (); Kernel.feedback "CHANGING DEFAULT PROJECT TO p2"; Project.set_current p2; print_status (); Kernel.feedback "SETTING STATUS TO false_and_reachable"; set_status Property_status.False_and_reachable; print_status (); Kernel.feedback "CHANGING DEFAULT PROJECT TO p"; Project.set_current p; print_status (); Kernel.feedback "SETTING A CORRECTNESS PARAMETER"; Kernel.LibEntry.on (); print_status (); Kernel.feedback "SETTING STATUS TO unknown IN p"; set_status Property_status.Dont_know; print_status (); Kernel.feedback "SETTING A TUNING PARAMETER"; Kernel.SafeArrays.off (); print_status (); Kernel.feedback "SETTING STATUS TO unknown IN p"; set_status Property_status.Dont_know; print_status () let () = Db.Main.extend main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/several_hyps.ml��������������������������������0000666�0000000�0000000�00000020734�13571573400�022517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_types let emitter = Emitter.create "Test" [ Emitter.Property_status ] ~correctness:[] ~tuning:[] let emitter2 = Emitter.create "Test2" [ Emitter.Property_status ] ~correctness:[] ~tuning:[] let set_status ?(emitter=emitter) p hyps s = Kernel.feedback "SETTING STATUS OF %a TO %a" Property.pretty p Property_status.Emitted_status.pretty s; Property_status.emit emitter p ~hyps s let print_status = Dynamic.get ~plugin:"Report" "print" (Datatype.func Datatype.unit Datatype.unit) let clear () = Kernel.feedback "CLEARING"; Project.clear ~selection:(State_selection.Static.with_dependencies Property_status.self) () let main () = Ast.compute (); print_status (); let main, j, i, h, g = let l = Annotations.fold_all_code_annot (fun stmt _ ca acc -> let kf = Kernel_function.find_englobing_kf stmt in let ps = Property.ip_of_code_annot kf stmt ca in match ps with | [ p ] -> p :: acc | _ -> assert false) [] in match l with | [ p1; p2; p3; p4; p5 ] -> p1, p2, p3, p4, p5 | _ -> assert false in let hyps = [ g; h ] in let ensures = let kf = Globals.Functions.find_by_name "f" in let spec = Annotations.funspec kf in Property.ip_post_cond_of_spec kf Kglobal ~active:[] spec in let ensures2 = let kf = Globals.Functions.find_by_name "f2" in let spec = Annotations.funspec kf in Property.ip_post_cond_of_spec kf Kglobal ~active:[] spec in let reset f = clear (); f () in let test msg ?(hyps=hyps) set_status_hyps = Kernel.feedback msg; reset set_status_hyps; (* unknown *) set_status main hyps Property_status.Dont_know; print_status (); (* true *) set_status main hyps Property_status.True; print_status (); reset set_status_hyps; (* false *) set_status main [] Property_status.False_and_reachable; print_status () in let nothing () = () in let valid ?(g=g) ?(i=i) () = let _i = i in set_status g [] Property_status.True in let valid_under_hyp ?(g=g) ?(i=i) () = set_status g [ i ] Property_status.True in let unknown ?(g=g) ?(i=i) () = let _i = i in set_status g [] Property_status.Dont_know in let invalid ?(g=g) ?(i=i) () = let _i = i in set_status g [] Property_status.False_and_reachable in let invalid_under_hyp ?(g=g) ?i:_ () = set_status g [ ] Property_status.False_and_reachable in let invalid_but_dead ?(g=g) ?(i=i) () = set_status i [] Property_status.False_and_reachable; set_status g [ ] Property_status.False_and_reachable in let valid_but_dead ?(g=g) ?(i=i) () = set_status i [] Property_status.False_and_reachable; set_status g [ ] Property_status.True in let unknown_but_dead ?(g=g) ?(i=i) () = set_status i [] Property_status.False_and_reachable; set_status g [ i ] Property_status.Dont_know in let inconsistent ?(g=g) ?(i=i) () = let _i = i in set_status g [ ] Property_status.True; set_status ~emitter:emitter2 g [] Property_status.False_and_reachable in (***************************************************************************) test "NEVER_TRIED + NEVER_TRIED" nothing; test "NEVER_TRIED + CONSIDERED_VALID" ~hyps:(g :: ensures) nothing; test "NEVER_TRIED + VALID" valid; test "NEVER_TRIED + VALID_UNDER_HYP" valid_under_hyp; test "NEVER_TRIED + UNKNOWN" unknown; test "NEVER_TRIED + INVALID" invalid; test "NEVER_TRIED + INVALID_UNDER_HYP" invalid_under_hyp; test "NEVER_TRIED + INVALID_BUT_DEAD" invalid_but_dead; test "NEVER_TRIED + VALID_BUT_DEAD" valid_but_dead; test "NEVER_TRIED + UNKNOWN_BUT_DEAD" unknown_but_dead; test "NEVER_TRIED + INCONSISTENT" inconsistent; (***************************************************************************) test "CONSIDERED_VALID + CONSIDERED_VALID" ~hyps:(ensures @ ensures2) nothing; let hyps = g :: ensures in test "CONSIDERED_VALID + VALID" ~hyps valid; test "CONSIDERED_VALID + VALID_UNDER_HYP" ~hyps valid_under_hyp; test "CONSIDERED_VALID + UNKNOWN" ~hyps unknown; test "CONSIDERED_VALID + INVALID" ~hyps invalid; test "CONSIDERED_VALID + INVALID_UNDER_HYP" ~hyps invalid_under_hyp; test "CONSIDERED_VALID + INVALID_BUT_DEAD" ~hyps invalid_but_dead; test "CONSIDERED_VALID + VALID_BUT_DEAD" ~hyps valid_but_dead; test "CONSIDERED_VALID + UNKNOWN_BUT_DEAD" ~hyps unknown_but_dead; test "CONSIDERED_VALID + INCONSISTENT" ~hyps inconsistent; (***************************************************************************) let set status_g status_h () = (* (status_h: ?g:Property.t -> ?i:Property.t -> unit -> unit) () =*) status_g (); (* status_h ~g:h ~i:j ()*) status_h ?g:(Some h) ?i:(Some j) () in test "VALID + VALID" (set valid valid); test "VALID + VALID_UNDER_HYP" (set valid valid_under_hyp); test "VALID + UNKNOWN" (set valid unknown); test "VALID + INVALID" (set valid invalid); test "VALID + INVALID_UNDER_HYP" (set valid invalid_under_hyp); test "VALID + INVALID_BUT_DEAD" (set valid invalid_but_dead); test "VALID + VALID_BUT_DEAD" (set valid valid_but_dead); test "VALID + UNKNOWN_BUT_DEAD" (set valid unknown_but_dead); test "VALID + INCONSISTENT" (set valid inconsistent); (***************************************************************************) test "VALID_UNDER_HYP + VALID_UNDER_HYP" (set valid_under_hyp valid_under_hyp); test "VALID_UNDER_HYP + UNKNOWN" (set valid_under_hyp unknown); test "VALID_UNDER_HYP + INVALID" (set valid_under_hyp invalid); test "VALID_UNDER_HYP + INVALID_UNDER_HYP" (set valid_under_hyp invalid_under_hyp); test "VALID_UNDER_HYP + INVALID_BUT_DEAD" (set valid_under_hyp invalid_but_dead); test "VALID_UNDER_HYP + VALID_BUT_DEAD" (set valid_under_hyp valid_but_dead); test "VALID_UNDER_HYP + UNKNOWN_BUT_DEAD" (set valid_under_hyp unknown_but_dead); test "VALID_UNDER_HYP + INCONSISTENT" (set valid_under_hyp inconsistent); (***************************************************************************) test "UNKNOWN + UNKNOWN" (set unknown unknown); test "UNKNOWN + INVALID" (set unknown invalid); test "UNKNOWN + INVALID_UNDER_HYP" (set unknown invalid_under_hyp); test "UNKNOWN + INVALID_BUT_DEAD" (set unknown invalid_but_dead); test "UNKNOWN + VALID_BUT_DEAD" (set unknown valid_but_dead); test "UNKNOWN + UNKNOWN_BUT_DEAD" (set unknown unknown_but_dead); test "UNKNOWN + INCONSISTENT" (set unknown inconsistent); (***************************************************************************) test "INVALID + INVALID" (set invalid invalid); test "INVALID + INVALID_UNDER_HYP" (set invalid invalid_under_hyp); test "INVALID + INVALID_BUT_DEAD" (set invalid invalid_but_dead); test "INVALID + VALID_BUT_DEAD" (set invalid valid_but_dead); test "INVALID + UNKNOWN_BUT_DEAD" (set invalid unknown_but_dead); test "INVALID + INCONSISTENT" (set invalid inconsistent); (***************************************************************************) test "INVALID_UNDER_HYP + INVALID_UNDER_HYP" (set invalid_under_hyp invalid_under_hyp); test "INVALID_UNDER_HYP + INVALID_BUT_DEAD" (set invalid_under_hyp invalid_but_dead); test "INVALID_UNDER_HYP + VALID_BUT_DEAD" (set invalid_under_hyp valid_but_dead); test "INVALID_UNDER_HYP + UNKNOWN_BUT_DEAD" (set invalid_under_hyp unknown_but_dead); test "INVALID_UNDER_HYP + INCONSISTENT" (set invalid_under_hyp inconsistent); (***************************************************************************) test "INVALID_BUT_DEAD + INVALID_BUT_DEAD" (set invalid_but_dead invalid_but_dead); test "INVALID_BUT_DEAD + VALID_BUT_DEAD" (set invalid_but_dead valid_but_dead); test "INVALID_BUT_DEAD + UNKNOWN_BUT_DEAD" (set invalid_but_dead unknown_but_dead); test "INVALID_BUT_DEAD + INCONSISTENT" (set invalid_but_dead inconsistent); (***************************************************************************) test "VALID_BUT_DEAD + VALID_BUT_DEAD" (set valid_but_dead valid_but_dead); test "VALID_BUT_DEAD + UNKNOWN_BUT_DEAD" (set valid_but_dead unknown_but_dead); test "VALID_BUT_DEAD + INCONSISTENT" (set valid_but_dead inconsistent); (***************************************************************************) test "UNKNOWN_BUT_DEAD + UNKNOWN_BUT_DEAD" (set unknown_but_dead unknown_but_dead); test "UNKNOWN_BUT_DEAD + INCONSISTENT" (set unknown_but_dead inconsistent); (***************************************************************************) test "INCONSISTENT + INCONSISTENT" (set inconsistent inconsistent) let () = Db.Main.extend main ������������������������������������frama-c-20.0-Calcium/src/plugins/report/tests/report/single.i���������������������������������������0000666�0000000�0000000�00000000532�13571573400�021106� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -no-autoload-plugins -load-module report -load-script tests/report/projectified_status.ml OPT: -no-autoload-plugins -load-module report -load-script tests/report/no_hyp.ml OPT: -no-autoload-plugins -load-module report -load-script tests/report/multi_emitters.ml */ void main() { int x = 1; /*@ assert \true; */ } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/���������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014255� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/RteGen.mli�����������������������������������������������������0000666�0000000�0000000�00000005437�13571573400�016155� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Consult internal plug-in documentation for more details *) (** Flags for filtering Alarms *) module Flags : module type of Flags (** RTE Generator Status & Emitters *) module Generator : module type of Generator (** Visitors to iterate over Alarms and/or generate Code-Annotations *) module Visit : sig open Cil_types val annotate: ?flags:Flags.t -> kernel_function -> unit val get_annotations_kf: ?flags:Flags.t -> kernel_function -> code_annotation list val get_annotations_stmt: ?flags:Flags.t -> kernel_function -> stmt -> code_annotation list val get_annotations_exp: ?flags:Flags.t -> kernel_function -> stmt -> exp -> code_annotation list val get_annotations_lval: ?flags:Flags.t -> kernel_function -> stmt -> lval -> code_annotation list type on_alarm = kernel_function -> stmt -> invalid:bool -> Alarms.alarm -> unit type 'a iterator = ?flags:Flags.t -> on_alarm -> Kernel_function.t -> Cil_types.stmt -> 'a -> unit val iter_lval : lval iterator val iter_exp : exp iterator val iter_instr : instr iterator val iter_stmt : stmt iterator val register : Emitter.t -> kernel_function -> stmt -> invalid:bool -> Alarms.alarm -> code_annotation * bool end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/flags.ml�������������������������������������������������������0000666�0000000�0000000�00000011054�13571573400�015704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Fine Tuning Visitors --- *) (* -------------------------------------------------------------------------- *) type t = { remove_trivial: bool; initialized: bool; mem_access: bool; div_mod: bool; shift: bool; left_shift_negative: bool; right_shift_negative: bool; signed_overflow: bool; unsigned_overflow: bool; signed_downcast: bool; unsigned_downcast: bool; float_to_int: bool; finite_float: bool; pointer_call: bool; bool_value: bool; } let all = { remove_trivial = true; initialized = true; mem_access = true; div_mod = true; shift = true; left_shift_negative = true; right_shift_negative = true; signed_overflow = true; unsigned_overflow = true; signed_downcast = true; unsigned_downcast = true; float_to_int = true; finite_float = true; pointer_call = true; bool_value = true; } let none = { remove_trivial = false; initialized = false; mem_access = false; div_mod = false; shift = false; left_shift_negative = false; right_shift_negative = false; signed_overflow = false; unsigned_overflow = false; signed_downcast = false; unsigned_downcast = false; float_to_int = false; finite_float = false; pointer_call = false; bool_value = false; } (* Which annotations should be added, from local options, or deduced from the options of RTE and the kernel *) let option (get : unit -> bool) = function None -> get () | Some flag -> flag let default ?remove_trivial ?initialized ?mem_access ?div_mod ?shift ?left_shift_negative ?right_shift_negative ?signed_overflow ?unsigned_overflow ?signed_downcast ?unsigned_downcast ?float_to_int ?finite_float ?pointer_call ?bool_value () = { remove_trivial = option (fun () -> not (Options.Trivial.get ())) remove_trivial ; initialized = option Options.DoInitialized.get initialized ; mem_access = option Options.DoMemAccess.get mem_access ; div_mod = option Options.DoDivMod.get div_mod ; shift = option Options.DoShift.get shift; left_shift_negative = option Kernel.LeftShiftNegative.get left_shift_negative ; right_shift_negative = option Kernel.RightShiftNegative.get right_shift_negative ; signed_overflow = option Kernel.SignedOverflow.get signed_overflow ; unsigned_overflow = option Kernel.UnsignedOverflow.get unsigned_overflow ; signed_downcast = option Kernel.SignedDowncast.get signed_downcast ; unsigned_downcast = option Kernel.UnsignedDowncast.get unsigned_downcast ; float_to_int = option Options.DoFloatToInt.get float_to_int ; finite_float = option (fun () -> Kernel.SpecialFloat.get () <> "none") finite_float ; pointer_call = option Options.DoPointerCall.get pointer_call ; bool_value = option Kernel.InvalidBool.get bool_value ; } (* -------------------------------------------------------------------------- *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/flags.mli������������������������������������������������������0000666�0000000�0000000�00000005611�13571573400�016057� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Filtering Categories of Alarms *) (* -------------------------------------------------------------------------- *) (** Flags for controling the low-level API. Each flag control whether a category of alarms will be visited or not. *) type t = { remove_trivial: bool; initialized: bool; mem_access: bool; div_mod: bool; shift: bool; left_shift_negative: bool; right_shift_negative: bool; signed_overflow: bool; unsigned_overflow: bool; signed_downcast: bool; unsigned_downcast: bool; float_to_int: bool; finite_float: bool; pointer_call: bool; bool_value: bool; } (** Defaults flags are taken from the Kernel and RTE plug-in options. *) val default : ?remove_trivial:bool -> ?initialized:bool -> ?mem_access:bool -> ?div_mod:bool -> ?shift:bool -> ?left_shift_negative:bool -> ?right_shift_negative:bool -> ?signed_overflow:bool -> ?unsigned_overflow:bool -> ?signed_downcast:bool -> ?unsigned_downcast:bool -> ?float_to_int:bool -> ?finite_float:bool -> ?pointer_call:bool -> ?bool_value:bool -> unit -> t (** All flags set to [true]. *) val all : t (** All flags set to [false]. *) val none : t (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/generator.ml���������������������������������������������������0000666�0000000�0000000�00000013375�13571573400�016606� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module type S = sig val is_computed: kernel_function -> bool val set: kernel_function -> bool -> unit val accessor: Db.RteGen.status_accessor end let states : State.t list ref = ref [] let accessors : Db.RteGen.status_accessor list ref = ref [] module Make (M:sig val name:string val parameter: Typed_parameter.t val additional_parameters: Typed_parameter.t list end) = struct module H = Kernel_function.Make_Table (Datatype.Bool) (struct let name = "RTE.Computed." ^ M.name let size = 17 let dependencies = let extract p = State.get p.Typed_parameter.name in Ast.self :: Options.Trivial.self :: List.map extract (M.parameter :: M.additional_parameters) end) let is_computed = (* Nothing to do for functions without body. *) let default kf = not (Kernel_function.is_definition kf) in fun kf -> H.memo default kf let set = H.replace let self = H.self let accessor = M.name, set, is_computed let () = states := self :: !states; accessors := accessor :: !accessors; end module Initialized = Make (struct let name = "initialized" let parameter = Options.DoInitialized.parameter let additional_parameters = [ ] end) module Mem_access = Make (struct let name = "mem_access" let parameter = Options.DoMemAccess.parameter let additional_parameters = [ Kernel.SafeArrays.parameter ] end) module Pointer_call = Make (struct let name = "pointer_call" let parameter = Options.DoPointerCall.parameter let additional_parameters = [] end) module Div_mod = Make (struct let name = "division_by_zero" let parameter = Options.DoDivMod.parameter let additional_parameters = [] end) module Shift = Make (struct let name = "shift_value_out_of_bounds" let parameter = Options.DoShift.parameter let additional_parameters = [] end) module Left_shift_negative = Make (struct let name = "left_shift_negative" let parameter = Kernel.LeftShiftNegative.parameter let additional_parameters = [] end) module Right_shift_negative = Make (struct let name = "right_shift_negative" let parameter = Kernel.RightShiftNegative.parameter let additional_parameters = [] end) module Signed_overflow = Make (struct let name = "signed_overflow" let parameter = Kernel.SignedOverflow.parameter let additional_parameters = [] end) module Signed_downcast = Make (struct let name = "downcast" let parameter = Kernel.SignedDowncast.parameter let additional_parameters = [] end) module Unsigned_overflow = Make (struct let name = "unsigned_overflow" let parameter = Kernel.UnsignedOverflow.parameter let additional_parameters = [] end) module Unsigned_downcast = Make (struct let name = "unsigned_downcast" let parameter = Kernel.UnsignedDowncast.parameter let additional_parameters = [] end) module Float_to_int = Make (struct let name = "float_to_int" let parameter = Options.DoFloatToInt.parameter let additional_parameters = [] end) module Finite_float = Make (struct let name = "finite_float" let parameter = Kernel.SpecialFloat.parameter let additional_parameters = [] end) module Bool_value = Make (struct let name = "bool_value" let parameter = Kernel.InvalidBool.parameter let additional_parameters = [] end) (** DO NOT CALL Make AFTER THIS POINT *) let proxy = State_builder.Proxy.create "RTE" State_builder.Proxy.Backward !states let self = State_builder.Proxy.get proxy let () = Db.RteGen.self := self let all_statuses = !accessors let emitter = Emitter.create "rte" [ Emitter.Property_status; Emitter.Alarm ] ~correctness:[ Kernel.SafeArrays.parameter ] ~tuning:[] let get_registered_annotations stmt = Annotations.fold_code_annot (fun e a acc -> if Emitter.equal e emitter then a ::acc else acc) stmt [] (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/generator.mli��������������������������������������������������0000666�0000000�0000000�00000004740�13571573400�016753� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type S = sig val is_computed: Kernel_function.t -> bool val set: Kernel_function.t -> bool -> unit val accessor: Db.RteGen.status_accessor end (* No module for Trivial: dependency added for generators below *) module Initialized: S module Mem_access: S module Pointer_call: S module Div_mod: S module Shift: S module Left_shift_negative: S module Right_shift_negative: S module Signed_overflow: S module Signed_downcast: S module Unsigned_overflow: S module Unsigned_downcast: S module Float_to_int: S module Finite_float: S module Bool_value: S val all_statuses: Db.RteGen.status_accessor list (** The Emitter for Annotations registered by RTE *) val emitter: Emitter.t open Cil_types (** Returns all annotations actually {i registered} by RTE so far *) val get_registered_annotations: stmt -> code_annotation list (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������frama-c-20.0-Calcium/src/plugins/rte/options.ml�����������������������������������������������������0000666�0000000�0000000�00000011446�13571573400�016310� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let help_msg = "generates annotations for runtime error checking and \ preconditions at call sites" include Plugin.Register (struct let name = "rtegen" let shortname = "rte" let help = help_msg end) (* enabling/disabling plugin *) module Enabled = False (struct let option_name = "-rte" let help = "when on (off by default), " ^ help_msg end) (* annotates division by zero (undefined behavior) *) module DoDivMod = True (struct let option_name = "-rte-div" let help = "when on (default), annotate for modulo and division by zero" end) (* annotates left and right shifts (undefined behavior) *) module DoShift = True (struct let option_name = "-rte-shift" let help = "when on (default), annotate for left and right shifts by a value out of bounds" end) (* annotates casts from floating-point to integer (undefined behavior) *) module DoFloatToInt = True (struct let option_name = "-rte-float-to-int" let help = "when on (default), annotate casts from floating-point to \ integer" end) (* annotates local variables and pointers read (aside from globals) initialization *) module DoInitialized = False (struct let option_name = "-rte-initialized" let help = "when on, annotates local variables and pointers \ reads with initialization tests" end) (* annotates invalid memory access (undefined behavior) *) module DoMemAccess = True (struct let option_name = "-rte-mem" let help = "when on (default), annotate for valid pointer or \ array access" end) (* annotates calls through pointers *) module DoPointerCall = True (struct let option_name = "-rte-pointer-call" let help = "when on, annotate functions calls through pointers" end) (* uses results of basic constant propagation in order to check validity / invalidity of generated assertions, emitting a status if possible. Notice that annotations that can be considered valid from syntaxical rules are also considered as trivial. *) module Trivial = False (struct let option_name = "-rte-trivial-annotations" let help = "generate all annotations even if they trivially hold \ (from evaluation of constant expressions, syntactical rules...)" (* if on, evaluates constants in order to check if assertions are trivially true / false *) end) (* emits a warning when an assertion generated by rte is clearly invalid (using constant folding, see ConstFold *) module Warn = True (struct let option_name = "-rte-warn" let help = "when on (default), emits warning on broken asserts" end) (* this option allows the user to select a set of functions on which the plug-in performs its jobs (and only those). By default all functions are annotated *) module FunctionSelection = Kernel_function_set (struct let option_name = "-rte-select" let arg_name = "fun" let help = "select <fun> for analysis (default all functions)" end) let warn ?source fmt = warning ?source ~current:true ~once:true fmt (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/options.mli����������������������������������������������������0000666�0000000�0000000�00000004216�13571573400�016456� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module Enabled: Parameter_sig.Bool module DoShift : Parameter_sig.Bool module DoDivMod : Parameter_sig.Bool module DoFloatToInt : Parameter_sig.Bool module DoInitialized : Parameter_sig.Bool module DoMemAccess : Parameter_sig.Bool module DoPointerCall : Parameter_sig.Bool module Trivial : Parameter_sig.Bool module Warn : Parameter_sig.Bool module FunctionSelection: Parameter_sig.Kernel_function_set val warn: ?source:Filepath.position -> ('a, Format.formatter, unit) format -> 'a (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/register.ml����������������������������������������������������0000666�0000000�0000000�00000014357�13571573400�016445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* dedicated computations *) (* -------------------------------------------------------------------------- *) (* annotate for all rte + unsigned overflows (which are not rte), for a given function *) let do_all_rte kf = let flags = { Flags.all with Flags.signed_downcast = false; unsigned_downcast = false; } in Visit.annotate ~flags kf (* annotate for rte only (not unsigned overflows and downcasts) for a given function *) let do_rte kf = let flags = { Flags.all with Flags.unsigned_overflow = false; signed_downcast = false; unsigned_downcast = false; } in Visit.annotate ~flags kf let compute () = (* compute RTE annotations, whether Enabled is set or not *) Ast.compute () ; let include_function kf = let fsel = Options.FunctionSelection.get () in Kernel_function.Set.is_empty fsel || Kernel_function.Set.mem kf fsel in Globals.Functions.iter (fun kf -> if include_function kf then !Db.RteGen.annotate_kf kf) (* journal utilities *) let journal_register ?comment is_dyn name ty_arg fctref fct = let ty = Datatype.func ty_arg Datatype.unit in Db.register (Db.Journalize("RteGen." ^ name, ty)) fctref fct; if is_dyn then let _ignore = Dynamic.register ?comment ~plugin:"RteGen" name ty ~journalize:true fct in () let nojournal_register fctref fct = Db.register Db.Journalization_not_required fctref (fun () -> fct) let () = journal_register false "annotate_kf" Kernel_function.ty Db.RteGen.annotate_kf Visit.annotate; journal_register false "compute" Datatype.unit Db.RteGen.compute compute; journal_register true ~comment:"Generate all RTE annotations in the \ given function." "do_all_rte" Kernel_function.ty Db.RteGen.do_all_rte do_all_rte; journal_register false ~comment:"Generate all RTE annotations except pre-conditions \ in the given function." "do_rte" Kernel_function.ty Db.RteGen.do_rte do_rte; let open Generator in let open Db.RteGen in nojournal_register get_signedOv_status Signed_overflow.accessor; nojournal_register get_divMod_status Div_mod.accessor; nojournal_register get_initialized_status Initialized.accessor; nojournal_register get_signed_downCast_status Signed_downcast.accessor; nojournal_register get_memAccess_status Mem_access.accessor; nojournal_register get_pointerCall_status Pointer_call.accessor; nojournal_register get_unsignedOv_status Unsigned_overflow.accessor; nojournal_register get_unsignedDownCast_status Unsigned_downcast.accessor; nojournal_register get_float_to_int_status Float_to_int.accessor; nojournal_register get_finite_float_status Finite_float.accessor; nojournal_register get_bool_value_status Bool_value.accessor ; nojournal_register get_all_status all_statuses; ;; (* dynamic registration *) let _ = Dynamic.register ~comment:"The emitter used for generating RTE annotations" ~plugin:"RteGen" "emitter" Emitter.ty ~journalize:false Generator.emitter (* retrieve list of generated rte annotations (not precond) for a given stmt *) let _ignore = Dynamic.register ~comment:"Get the list of annotations previously emitted by RTE for the \ given statement." ~plugin:"RteGen" "get_rte_annotations" (Datatype.func Cil_datatype.Stmt.ty (let module L = Datatype.List(Cil_datatype.Code_annotation) in L.ty)) ~journalize:true Generator.get_registered_annotations let _ignore = Dynamic.register ~comment:"Generate RTE annotations corresponding to the given stmt of \ the given function." ~plugin:"RteGen" "stmt_annotations" (Datatype.func2 Kernel_function.ty Cil_datatype.Stmt.ty (let module L = Datatype.List(Cil_datatype.Code_annotation) in L.ty)) ~journalize:false Visit.get_annotations_stmt let _ignore = Dynamic.register ~comment:"Generate RTE annotations corresponding to the given exp \ of the given stmt in the given function." ~plugin:"RteGen" "exp_annotations" (Datatype.func3 Kernel_function.ty Cil_datatype.Stmt.ty Cil_datatype.Exp.ty (let module L = Datatype.List(Cil_datatype.Code_annotation) in L.ty)) ~journalize:false Visit.get_annotations_exp let main () = (* reset "rte generated"/"called precond generated" properties for all functions *) if Options.Enabled.get () then begin Options.feedback ~level:2 "generating annotations"; !Db.RteGen.compute (); Options.feedback ~level:2 "annotations computed" end let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/rte.ml���������������������������������������������������������0000666�0000000�0000000�00000047246�13571573400�015416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type 'a alarm_gen = remove_trivial:bool -> on_alarm:(invalid:bool -> Alarms.alarm -> unit) -> 'a -> unit type bound_kind = Alarms.bound_kind = Lower_bound | Upper_bound (* Tries to evaluate expr as a constant value (Int64.t). Uses Cil constant folding (e.g. for (-0x7ffffff -1) => Some (-2147483648)) on 32 bits *) let get_expr_val expr = Cil.constFoldToInt expr (* Creates [0 <= e] and [e < size] assertions *) let valid_index ~remove_trivial ~on_alarm e size = let alarm bk = let b = match bk with | Lower_bound -> None | Upper_bound -> Some size in (* Do not create upper-bound check on GNU zero-length arrays *) if not (bk == Upper_bound && Cil.isZero size) then begin on_alarm ~invalid:false (Alarms.Index_out_of_bound(e, b)) end in if remove_trivial then begin (* See if the two assertions do not trivially hold. In this case, do not return then *) let v_e = get_expr_val e in let v_size = get_expr_val size in let neg_ok = Extlib.may_map ~dft:false (Integer.le Integer.zero) v_e || Cil.isUnsignedInteger (Cil.typeOf e) in if not neg_ok then alarm Lower_bound; let pos_ok = match v_e, v_size with | Some v_e, Some v_size -> Integer.lt v_e v_size | None, _ | _, None -> false in if not pos_ok then alarm Upper_bound end else begin alarm Lower_bound; alarm Upper_bound; end (* returns the assertion associated with an lvalue: returns non empty assertions only on pointer dereferencing and array access. The validity assertions are emitted using [valid] if [~read_only] is false, or with [valid_read] otherwise *) let lval_assertion ~read_only ~remove_trivial ~on_alarm lv = (* For accesses to known arrays we generate an assertions that constrains the index. This is simpler than the [\valid] assertion *) let rec check_array_access default off typ in_struct = match off with | NoOffset -> if default then on_alarm ~invalid:false (Alarms.Memory_access(lv, read_only)) | Field (fi, off) -> (* Mark that we went through a struct field, then recurse *) check_array_access default off fi.ftype true | Index (e, off) -> match Cil.unrollType typ with | TArray (bt, Some size, _, _) -> if Kernel.SafeArrays.get () || not in_struct then begin (* Generate an assertion for this access, then go deeper in case other accesses exist *) valid_index ~remove_trivial ~on_alarm e size; check_array_access default off bt in_struct end else (* Access to an array embedded in a struct with option [-unsafe-arrays]. Honor the option and generate only the default [\valid] assertion *) check_array_access true off bt in_struct | TArray (bt, None, _, _) -> check_array_access true off bt in_struct | _ -> assert false in match lv with | Var vi , off -> check_array_access false off vi.vtype false | (Mem _ as lh), off -> if not (Cil.isFunctionType (Cil.typeOfLval lv)) then check_array_access true off (Cil.typeOfLhost lh) false (* assertion for lvalue initialization *) let lval_initialized_assertion ~remove_trivial:_ ~on_alarm lv = let rec check_array_initialized default off typ in_struct l = match off with | NoOffset -> begin match typ with | TComp({cstruct = false; cfields} ,_,_) -> (match cfields with | [] -> () (* empty union, supported by gcc with size 0. Trivially initialized. *) | _ -> let llv = List.map (fun fi -> Cil.addOffsetLval (Field (fi, NoOffset)) lv) cfields in if default then on_alarm ~invalid:false (Alarms.Uninitialized_union llv)) | _ -> if default then on_alarm ~invalid:false (Alarms.Uninitialized lv) end | Field (fi, off) -> (* Mark that we went through a struct field, then recurse *) check_array_initialized default off fi.ftype true l | Index (_e, off) -> match Cil.unrollType typ with | TArray (bt, Some _size, _, _) -> check_array_initialized true off bt in_struct l | TArray (bt, None, _, _) -> check_array_initialized true off bt in_struct l | _ -> assert false in match lv with | Var vi , off -> let loc = fst vi.vdecl in let ignored_cases = vi.vglob || vi.vformal || vi.vtemp in check_array_initialized (not ignored_cases) off vi.vtype false loc | (Mem e as lh), off -> let loc = fst e.eloc in if not (Cil.isFunctionType (Cil.typeOfLval lv)) then check_array_initialized true off (Cil.typeOfLhost lh) false loc (* assertion for unary minus signed overflow *) let uminus_assertion ~remove_trivial ~on_alarm exp = (* - expr overflows if exp is TYPE_MIN *) let t = Cil.unrollType (Cil.typeOf exp) in let size = Cil.bitsSizeOf t in let min_ty = Cil.min_signed_number size in (* alarm is bound <= exp, hence bound must be MIN_INT+1 *) let bound = Integer.add Integer.one min_ty in let alarm ?(invalid=false) () = let a = Alarms.Overflow(Alarms.Signed, exp, bound, Lower_bound) in on_alarm ~invalid a in if remove_trivial then begin match get_expr_val exp with | None -> alarm () | Some a64 -> (* constant operand *) if Integer.equal a64 min_ty then alarm ~invalid:true () end else alarm () (* assertions for multiplication/addition/subtraction overflows *) let mult_sub_add_assertion ~signed ~remove_trivial ~on_alarm (exp,op,lexp,rexp) = (* signed multiplication/addition/subtraction: the expression overflows iff its integer value is strictly more than [max_ty] or strictly less than [min_ty] *) let t = Cil.unrollType (Cil.typeOf exp) in let size = Cil.bitsSizeOf t in let min_ty, max_ty = if signed then Cil.min_signed_number size, Cil.max_signed_number size else Integer.zero, Cil.max_unsigned_number size in let alarm ?(invalid=false) bk = let bound = match bk with | Upper_bound -> max_ty | Lower_bound -> min_ty in let signed = if signed then Alarms.Signed else Alarms.Unsigned in on_alarm ~invalid (Alarms.Overflow (signed, exp, bound, bk)); in let alarms () = alarm Lower_bound; alarm Upper_bound; in if remove_trivial then begin match get_expr_val lexp, get_expr_val rexp, op with | Some l, Some r, _ -> (* both operands are constant *) let warn r = let warn bk = alarm ~invalid:true bk in if Integer.gt r max_ty then warn Upper_bound else if Integer.lt r min_ty then warn Lower_bound in (match op with | MinusA -> warn (Integer.sub l r) | PlusA -> warn (Integer.add l r) | Mult -> warn (Integer.mul l r) | _ -> assert false) | _, Some v , PlusA | Some v, _, PlusA -> if Integer.(gt v zero) then alarm Upper_bound else if Integer.(lt v zero) then alarm Lower_bound (* signed only *) | _, Some r , MinusA -> if Integer.(gt r zero) then alarm Lower_bound else if Integer.(lt r zero) then alarm Upper_bound (* signed only *) | Some l, None , MinusA -> if signed then begin (* The possible range for [-r] is [-max_int .. -min_int] i.e. [min_int+1..max_int+1]; we need to check [l] w.r.t [-1]. *) if Integer.(gt l minus_one) then alarm Upper_bound else if Integer.(lt l minus_one) then alarm Lower_bound end else begin (* Only negative overflows are possible, since r is positive. (TODO: nothing can happen on [max_int]. *) alarm Lower_bound end | Some v, None, Mult | None, Some v, Mult when Integer.is_zero v || Integer.is_one v -> () | None, None, _ | Some _, None, _ | None, Some _, _ -> alarms () end else alarms () (* assertions for division and modulo (divisor is 0) *) let divmod_assertion ~remove_trivial ~on_alarm divisor = (* division or modulo: overflow occurs when divisor is equal to zero *) let alarm ?(invalid=false) () = on_alarm ~invalid (Alarms.Division_by_zero divisor); in if remove_trivial then begin match get_expr_val divisor with | None -> (* divisor is not a constant *) alarm (); | Some v64 -> if Integer.equal v64 Integer.zero then (* divide by 0 *) alarm ~invalid:true () (* else divide by constant which is not 0: nothing to assert *) end else alarm () (* assertion for signed division overflow *) let signed_div_assertion ~remove_trivial ~on_alarm (exp, lexp, rexp) = (* Signed division: overflow occurs when dividend is equal to the the minimum (negative) value for the signed integer type, and divisor is equal to -1. Under the hypothesis (cf Value) that integers are represented in two's complement. Nothing done for modulo (the result of TYPE_MIN % -1 is 0, which does not overflow). Still it may be dangerous on a number of compilers / architectures (modulo may be performed in parallel with division) *) let t = Cil.unrollType (Cil.typeOf rexp) in let size = Cil.bitsSizeOf t in (* check dividend_expr / divisor_expr : if constants ... *) (* compute smallest representable "size bits" (signed) integer *) let max_ty = Cil.max_signed_number size in let alarm ?(invalid=false) () = let a = Alarms.Overflow(Alarms.Signed, exp, max_ty, Alarms.Upper_bound) in on_alarm ~invalid a; in if remove_trivial then begin let min = Cil.min_signed_number size in match get_expr_val lexp, get_expr_val rexp with | Some e1, _ when not (Integer.equal e1 min) -> (* dividend is constant, with an unproblematic value *) () | _, Some e2 when not (Integer.equal e2 Integer.minus_one) -> (* divisor is constant, with an unproblematic value *) () | Some _, Some _ -> (* invalid constant division *) alarm ~invalid:true () | None, Some _ | Some _, None | None, None -> (* at least one is not constant: cannot conclude *) alarm () end else alarm () (* Assertions for the left and right operands of left and right shift. *) let shift_assertion ~remove_trivial ~on_alarm (exp, upper_bound) = let alarm ?(invalid=false) () = let a = Alarms.Invalid_shift(exp, upper_bound) in on_alarm ~invalid a ; in if remove_trivial then begin match get_expr_val exp with | None -> alarm () | Some c64 -> (* operand is constant: check it is nonnegative and strictly less than the upper bound (if any) *) let upper_bound_ok = match upper_bound with | None -> true | Some u -> Integer.lt c64 (Integer.of_int u) in if not (Integer.ge c64 Integer.zero && upper_bound_ok) then alarm ~invalid:true () end else alarm () (* The right operand of shifts should be nonnegative and strictly less than the width of the promoted left operand. *) let shift_width_assertion ~remove_trivial ~on_alarm (exp, typ) = let size = Cil.bitsSizeOf typ in shift_assertion ~remove_trivial ~on_alarm (exp, Some size) (* The left operand of signed shifts should be nonnegative: implementation defined for right shift, undefined behavior for left shift. *) let shift_negative_assertion ~remove_trivial ~on_alarm exp = shift_assertion ~remove_trivial ~on_alarm (exp, None) (* Assertion for left and right shift overflow: the result should be representable in the result type. *) let shift_overflow_assertion ~signed ~remove_trivial ~on_alarm (exp, op, lexp, rexp) = let t = Cil.unrollType (Cil.typeOf exp) in let size = Cil.bitsSizeOf t in if size <> Cil.bitsSizeOf (Cil.typeOf lexp) then (* size of result type should be size of left (promoted) operand *) Options.warn "problem with bitsSize of %a: not treated" Printer.pp_exp exp; if op = Shiftlt then (* compute greatest representable "size bits" (signed) integer *) let maxValResult = if signed then Cil.max_signed_number size else Cil.max_unsigned_number size in let overflow_alarm ?(invalid=false) () = let signed = if signed then Alarms.Signed else Alarms.Unsigned in let a = Alarms.Overflow (signed, exp, maxValResult, Alarms.Upper_bound) in on_alarm ~invalid a; in if remove_trivial then begin match get_expr_val lexp, get_expr_val rexp with | None,_ | _, None -> overflow_alarm () | Some lval64, Some rval64 -> (* both operands are constant: check result is representable in result type *) if Integer.ge rval64 Integer.zero && Integer.gt (Integer.shift_left lval64 rval64) maxValResult then overflow_alarm ~invalid:true () end else overflow_alarm () (* assertion for downcasting an integer to an unsigned integer type without requiring modification of value to reach target domain (well-defined behavior though) *) let unsigned_downcast_assertion ~remove_trivial ~on_alarm (ty, exp) = let e_typ = Cil.unrollType (Cil.typeOf exp) in match e_typ with | TInt (kind,_) -> let szTo = Cil.bitsSizeOfBitfield ty in let szFrom = Cil.bitsSizeOf e_typ in (if szTo < szFrom || Cil.isSigned kind then (* case signed to unsigned: requires signed to be >= 0 and also <= max of unsigned size *) (* cast unsigned to unsigned: ok is same bit size ; if target is <, requires <= max target *) let max_ty = Cil.max_unsigned_number szTo in let alarm ?(invalid=false) bk = let b = match bk with | Lower_bound -> Integer.zero | Upper_bound -> max_ty in let a = Alarms.Overflow (Alarms.Unsigned_downcast, exp, b, bk) in on_alarm ~invalid a; in let alarms () = if Cil.isSigned kind then begin (* signed to unsigned *) alarm Upper_bound; alarm Lower_bound; end else (* unsigned to unsigned; cannot overflow in the negative *) alarm Upper_bound; in if remove_trivial then begin match get_expr_val exp with | None -> alarms () | Some a64 -> if Integer.lt a64 Integer.zero then alarm ~invalid:true Lower_bound else if Integer.gt a64 max_ty then alarm ~invalid:true Upper_bound end else alarms ()) | _ -> () (* assertion for downcasting an integer to a signed integer type which can raise an implementation defined behavior *) let signed_downcast_assertion ~remove_trivial ~on_alarm (ty, exp) = let e_typ = Cil.unrollType (Cil.typeOf exp) in match e_typ with | TInt (kind,_) -> (let szTo = Cil.bitsSizeOfBitfield ty in let szFrom = Cil.bitsSizeOf e_typ in if szTo < szFrom || (szTo == szFrom && not (Cil.isSigned kind)) then (* downcast: the expression result should fit on szTo bits *) let min_ty = Cil.min_signed_number szTo in let max_ty = Cil.max_signed_number szTo in let alarm ?(invalid=false) bk = let b = match bk with | Lower_bound -> min_ty | Upper_bound -> max_ty in let a = Alarms.Overflow (Alarms.Signed_downcast, exp, b, bk) in on_alarm ~invalid a; in let alarms () = if Cil.isSigned kind then begin (* signed to signed *) alarm Upper_bound; alarm Lower_bound end else (* (unsigned to signed; cannot overflow in the negative *) alarm Upper_bound in if remove_trivial then begin match get_expr_val exp with | None -> alarms () | Some a64 -> (if Integer.lt a64 min_ty then alarm ~invalid:true Lower_bound else if Integer.gt a64 max_ty then alarm ~invalid:true Upper_bound) end else alarms ()) | _ -> () (* assertion for casting a floating-point value to an integer *) let float_to_int_assertion ~remove_trivial ~on_alarm (ty, exp) = let e_typ = Cil.unrollType (Cil.typeOf exp) in match e_typ, ty with | TFloat _, TInt (ikind,_) -> let szTo = Cil.bitsSizeOfBitfield ty in let min_ty, max_ty = if Cil.isSigned ikind then Cil.min_signed_number szTo, Cil.max_signed_number szTo else Integer.zero, Cil.max_unsigned_number szTo in let alarm ?(invalid=false) bk = let b = match bk with | Lower_bound -> min_ty | Upper_bound -> max_ty in on_alarm ~invalid (Alarms.Float_to_int (exp, b, bk)) in let f = match exp.enode with | Const (CReal (f, _, _)) -> Some f | UnOp (Neg, { enode = Const (CReal (f, _, _))}, _) -> Some (-. f) | _ -> None in (match remove_trivial, f with | true, Some f -> begin try let fint = Floating_point.truncate_to_integer f in if Integer.lt fint min_ty then alarm ~invalid:true Lower_bound else if Integer.gt fint max_ty then alarm ~invalid:true Upper_bound with Floating_point.Float_Non_representable_as_Int64 sign -> match sign with | Floating_point.Neg -> alarm Lower_bound | Floating_point.Pos -> alarm Upper_bound end | _ -> alarm Upper_bound; alarm Lower_bound; ) | _ -> () (* assertion for checking only finite float are used *) let finite_float_assertion ~remove_trivial:_ ~on_alarm (fkind, exp) = let invalid = false in match Kernel.SpecialFloat.get () with | "none" -> () | "nan" -> on_alarm ~invalid (Alarms.Is_nan (exp, fkind)) | "non-finite" -> on_alarm ~invalid (Alarms.Is_nan_or_infinite (exp, fkind)) | _ -> assert false (* assertion for a pointer call [( *e )(args)]. *) let pointer_call ~remove_trivial:_ ~on_alarm (e, args) = on_alarm ~invalid:false (Alarms.Function_pointer (e, Some args)) let bool_value ~remove_trivial ~on_alarm lv = match remove_trivial, lv with | true, (Var vi, NoOffset) when (* consider as trivial accesses to ... *) (not vi.vglob) && (* local variable or formal parameter when ... *) (not vi.vaddrof) (* their address is not taken *) -> () | _ -> on_alarm ~invalid:false (Alarms.Invalid_bool lv) (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/rte.mli��������������������������������������������������������0000666�0000000�0000000�00000005437�13571573400�015563� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type 'a alarm_gen = remove_trivial:bool -> on_alarm:(invalid:bool -> Alarms.alarm -> unit) -> 'a -> unit (** ['a alarm_gen] is an abstraction over the process of generating a certain kind of RTEs over something of type ['a]. The [on_alarm] argument receives all corresponding alarms, with optionally a status indicating that the alarm is red. *) val lval_assertion: read_only: Alarms.access_kind -> lval alarm_gen val lval_initialized_assertion: lval alarm_gen val divmod_assertion: exp alarm_gen val signed_div_assertion: (exp * exp * exp) alarm_gen val shift_width_assertion: (exp * typ) alarm_gen val shift_negative_assertion: exp alarm_gen val shift_overflow_assertion: signed:bool -> (exp * binop * exp * exp) alarm_gen val mult_sub_add_assertion: signed:bool -> (exp * binop * exp * exp) alarm_gen val uminus_assertion: exp alarm_gen val signed_downcast_assertion: (typ * exp) alarm_gen val unsigned_downcast_assertion: (typ * exp) alarm_gen val float_to_int_assertion: (typ * exp) alarm_gen val finite_float_assertion: (fkind * exp) alarm_gen val pointer_call: (exp * exp list) alarm_gen val bool_value: lval alarm_gen (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/rte/visit.ml�������������������������������������������������������0000666�0000000�0000000�00000045744�13571573400�015763� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Runtime Error annotation generation plugin *) open Cil_types open Cil_datatype (* AST inplace visitor for runtime annotation generation *) (** [kf]: function to annotate [flags]: which RTE to generate. [register]: the action to perform on each RTE alarm *) class annot_visitor kf flags on_alarm = object (self) inherit Visitor.frama_c_inplace val mutable skip_set = Exp.Set.empty val mutable skip_initialized_set = Lval.Set.empty method private mark_to_skip exp = skip_set <- Exp.Set.add exp skip_set method private must_skip exp = Exp.Set.mem exp skip_set method private mark_to_skip_initialized lv = skip_initialized_set <- Lval.Set.add lv skip_initialized_set method private must_skip_initialized lv = (* Will return true only once per mark_to_skip_initialized for the same lval *) let r = Lval.Set.mem lv skip_initialized_set in if r then skip_initialized_set <- Lval.Set.remove lv skip_initialized_set; r method private do_initialized () = flags.Flags.initialized && not (Generator.Initialized.is_computed kf) method private do_mem_access () = flags.Flags.mem_access && not (Generator.Mem_access.is_computed kf) method private do_div_mod () = flags.Flags.div_mod && not (Generator.Div_mod.is_computed kf) method private do_shift () = flags.Flags.shift && not (Generator.Shift.is_computed kf) method private do_left_shift_negative () = flags.Flags.left_shift_negative && not (Generator.Left_shift_negative.is_computed kf) method private do_right_shift_negative () = flags.Flags.right_shift_negative && not (Generator.Right_shift_negative.is_computed kf) method private do_signed_overflow () = flags.Flags.signed_overflow && not (Generator.Signed_overflow.is_computed kf) method private do_unsigned_overflow () = flags.Flags.unsigned_overflow && not (Generator.Unsigned_overflow.is_computed kf) method private do_signed_downcast () = flags.Flags.signed_downcast && not (Generator.Signed_downcast.is_computed kf) method private do_unsigned_downcast () = flags.Flags.unsigned_downcast && not (Generator.Unsigned_downcast.is_computed kf) method private do_float_to_int () = flags.Flags.float_to_int && not (Generator.Float_to_int.is_computed kf) method private do_finite_float () = flags.Flags.finite_float && not (Generator.Finite_float.is_computed kf) method private do_pointer_call () = flags.Flags.pointer_call && not (Generator.Pointer_call.is_computed kf) method private do_bool_value () = flags.Flags.bool_value && not (Generator.Bool_value.is_computed kf) method private queue_stmt_spec spec = let stmt = Extlib.the (self#current_stmt) in Queue.add (fun () -> let annot = Logic_const.new_code_annotation (AStmtSpec ([], spec)) in Annotations.add_code_annot Generator.emitter ~kf stmt annot) self#get_filling_actions method private generate_assertion: 'a. 'a Rte.alarm_gen -> 'a -> unit = fun fgen -> let curr_stmt = self#current_stmt in let on_alarm ~invalid a = match curr_stmt with | None -> Options.warning ~current:true "Alarm generated outside any statement:@ %a" Alarms.pretty a | Some stmt -> on_alarm stmt ~invalid a in fgen ~remove_trivial:flags.Flags.remove_trivial ~on_alarm (* Do not visit variable declarations, as no alarm should be emitted here, and there is no statement to emit an alarm anyway ([generate_assertion] or [Alarms.register] would then crash). *) method !vvdec _ = Cil.SkipChildren method! vstmt s = match s.skind with | UnspecifiedSequence l -> (* UnspecifiedSequences may contain lvals for side-effects, that give rise to spurious assertions *) let no_lval = List.map (fun (s, _, _, _, sref) -> s, [], [], [], sref) l in let s' = { s with skind = UnspecifiedSequence no_lval } in Cil.ChangeDoChildrenPost (s', fun _ -> s) | _ -> Cil.DoChildren method private treat_call ret_opt = match ret_opt, self#do_mem_access () with | None, _ | Some _, false -> () | Some ret, true -> Options.debug "lval %a: validity of potential mem access checked\n" Printer.pp_lval ret; self#generate_assertion (Rte.lval_assertion ~read_only:Alarms.For_writing) ret method private check_uchar_assign dest src = if self#do_mem_access () then begin Options.debug "lval %a: validity of potential mem access checked\n" Printer.pp_lval dest; self#generate_assertion (Rte.lval_assertion ~read_only:Alarms.For_writing) dest end; begin match src.enode with | Lval src_lv -> let typ1 = Cil.typeOfLval src_lv in let typ2 = Cil.typeOfLval dest in let isUChar t = Cil.isUnsignedInteger t && Cil.isAnyCharType t in if isUChar typ1 && isUChar typ2 then self#mark_to_skip_initialized src_lv | _ -> () end ; Cil.DoChildren (* assigned left values are checked for valid access *) method! vinst = function | Set (lval,exp,_) -> self#check_uchar_assign lval exp | Call (ret_opt,funcexp,argl,_) -> (* Do not emit alarms on Eva builtins such as Frama_C_show_each, that should have no effect on analyses. *) let is_builtin, is_va_start = match funcexp.enode with | Lval (Var vinfo, NoOffset) -> let kf = Globals.Functions.get vinfo in let frama_b = Ast_info.is_frama_c_builtin (Kernel_function.get_name kf) in let va_start = Kernel_function.get_name kf = "__builtin_va_start" in (frama_b, va_start) | _ -> (false, false) in if is_va_start then begin match (List.nth argl 0).enode with | Lval lv -> self#mark_to_skip_initialized lv | _ -> () end ; if is_builtin then Cil.SkipChildren else begin self#treat_call ret_opt; (* Alarm if the call is through a pointer. Done in DoChildrenPost to get a more pleasant ordering of annotations. *) let do_ptr () = if self#do_pointer_call () then match funcexp.enode with | Lval (Mem e, _) -> self#generate_assertion Rte.pointer_call (e, argl) | _ -> () in Cil.DoChildrenPost (fun res -> do_ptr (); res) end | Local_init (v,ConsInit(f,args,kind),loc) -> let do_call lv _e _args _loc = self#treat_call lv in Cil.treat_constructor_as_func do_call v f args kind loc; Cil.DoChildren | Local_init (v,AssignInit (SingleInit exp),_) -> self#check_uchar_assign (Cil.var v) exp | Local_init (_,AssignInit _,_) | Asm _ | Skip _ | Code_annot _ -> Cil.DoChildren method! vexpr exp = Options.debug "considering exp %a\n" Printer.pp_exp exp; match exp.enode with | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> Cil.SkipChildren | _ -> let generate () = match exp.enode with | BinOp((Div | Mod) as op, lexp, rexp, ty) -> (match Cil.unrollType ty with | TInt(kind,_) -> (* add assertion "divisor not zero" *) if self#do_div_mod () then self#generate_assertion Rte.divmod_assertion rexp; if self#do_signed_overflow () && op = Div && Cil.isSigned kind then (* treat the special case of signed division overflow (no signed modulo overflow) *) self#generate_assertion Rte.signed_div_assertion (exp, lexp, rexp) | TFloat(fkind,_) when self#do_finite_float () -> self#generate_assertion Rte.finite_float_assertion (fkind,exp); | _ -> ()) | BinOp((Shiftlt | Shiftrt) as op, lexp, rexp,ttype ) -> (match Cil.unrollType ttype with | TInt(kind,_) -> (* 0 <= rexp <= width *) if self#do_shift () then begin let typ = Cil.unrollType (Cil.typeOf exp) in (* Not really a problem of overflow, but almost a similar to self#do_div_mod *) self#generate_assertion Rte.shift_width_assertion (rexp, typ); end; let signed = Cil.isSigned kind in (* 0 <= lexp *) if signed && (op = Shiftlt && self#do_left_shift_negative () || op = Shiftrt && self#do_right_shift_negative ()) then self#generate_assertion Rte.shift_negative_assertion lexp; (* Signed or unsigned overflow. *) if self#do_signed_overflow () && signed || self#do_unsigned_overflow () && not signed then self#generate_assertion (Rte.shift_overflow_assertion ~signed) (exp, op, lexp, rexp) | _ -> ()) | BinOp((PlusA |MinusA | Mult) as op, lexp, rexp, ttype) -> (* may be skipped if the enclosing expression is a downcast to a signed type *) (match Cil.unrollType ttype with | TInt(kind,_) when Cil.isSigned kind -> if self#do_signed_overflow () && not (self#must_skip exp) then self#generate_assertion (Rte.mult_sub_add_assertion ~signed:true) (exp, op, lexp, rexp) | TInt(kind,_) when not (Cil.isSigned kind) -> if self#do_unsigned_overflow () then self#generate_assertion (Rte.mult_sub_add_assertion ~signed:false) (exp, op, lexp, rexp) | TFloat(fkind,_) when self#do_finite_float () -> self#generate_assertion Rte.finite_float_assertion (fkind,exp) | _ -> ()) | UnOp(Neg, exp, ty) -> (* Note: if unary minus on unsigned integer is to be understood as "subtracting the promoted value from the largest value of the promoted type and adding one", the result is always representable: so no overflow *) (match Cil.unrollType ty with | TInt(kind,_) when Cil.isSigned kind -> if self#do_signed_overflow () then self#generate_assertion Rte.uminus_assertion exp; | TFloat(fkind,_) when self#do_finite_float () -> self#generate_assertion Rte.finite_float_assertion (fkind,exp) | _ -> ()) | Lval lval -> (match Cil.(unrollType (typeOfLval lval)) with | TInt (IBool,_) when self#do_bool_value () -> self#generate_assertion Rte.bool_value lval | _ -> ()); (* left values are checked for valid access *) if self#do_mem_access () then begin Options.debug "exp %a is an lval: validity of potential mem access checked" Printer.pp_exp exp; self#generate_assertion (Rte.lval_assertion ~read_only:Alarms.For_reading) lval end; if self#do_initialized () && not (self#must_skip_initialized lval) then begin Options.debug "exp %a is an lval: initialization of potential mem access checked" Printer.pp_exp exp; self#generate_assertion Rte.lval_initialized_assertion lval end ; | CastE (ty, e) -> (match Cil.unrollType ty, Cil.unrollType (Cil.typeOf e) with (* to , from *) | TInt(kind,_), TInt (_, _) -> if Cil.isSigned kind then begin if self#do_signed_downcast () then begin self#generate_assertion Rte.signed_downcast_assertion (ty, e); self#mark_to_skip e; end end else if self#do_unsigned_downcast () then self#generate_assertion Rte.unsigned_downcast_assertion (ty, e) | TInt _, TFloat _ -> if self#do_float_to_int () then self#generate_assertion Rte.float_to_int_assertion (ty, e) | TFloat (to_fkind,_), TFloat (from_fkind,_) when self#do_finite_float () && Cil.frank to_fkind < Cil.frank from_fkind -> self#generate_assertion Rte.finite_float_assertion (to_fkind,exp) | _ -> ()); | Const (CReal(f,fkind,_)) when self#do_finite_float () -> begin match classify_float f with | FP_normal | FP_subnormal | FP_zero -> () | FP_infinite | FP_nan -> self#generate_assertion Rte.finite_float_assertion (fkind,exp) end | StartOf _ | AddrOf _ | Info _ | UnOp _ | Const _ | BinOp _ -> () | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> assert false in (* Use Cil.DoChildrenPost so that inner expression and lvals are checked first. The order of resulting assertions will be better. *) Cil.DoChildrenPost (fun new_e -> generate (); new_e) end (** {2 Iterate over Alarms on Cil elements} *) type on_alarm = kernel_function -> stmt -> invalid:bool -> Alarms.alarm -> unit let filter = function None -> Flags.default () | Some flags -> flags let iter_alarms visit ?flags (on_alarm:on_alarm) kf stmt element = let visitor = object (self) inherit annot_visitor kf (filter flags) (on_alarm kf) initializer self#push_stmt stmt end in ignore (visit (visitor :> Cil.cilVisitor) element) type 'a iterator = ?flags:Flags.t -> on_alarm -> Kernel_function.t -> Cil_types.stmt -> 'a -> unit let iter_lval : lval iterator = iter_alarms Cil.visitCilLval let iter_exp : exp iterator = iter_alarms Cil.visitCilExpr let iter_instr : instr iterator = iter_alarms Cil.visitCilInstr let iter_stmt : stmt iterator = iter_alarms Cil.visitCilStmt (** {2 Regitration} *) let status ~invalid = if invalid then Some Property_status.False_if_reachable else None let register emitter kf stmt ~invalid alarm = let status = status ~invalid in Alarms.register emitter ~kf (Kstmt stmt) ?status alarm (* -------------------------------------------------------------------------- *) (* --- List Code Annotations --- *) (* -------------------------------------------------------------------------- *) let collector () = let pool = ref [] in let on_alarm stmt ~invalid:_ alarm = let ca, _ = Alarms.to_annot (Kstmt stmt) alarm in pool := ca :: !pool ; in pool , on_alarm let get_annotations_kf ?flags kf = match kf.fundec with | Declaration _ -> [] | Definition(f, _) -> let pool,on_alarm = collector () in let visitor = new annot_visitor kf (filter flags) on_alarm in ignore (Visitor.visitFramacFunction visitor f) ; !pool let collect from flags kf stmt elt = let pool,on_alarm = collector () in let visitor = object (self) inherit annot_visitor kf (filter flags) on_alarm initializer self#push_stmt stmt end in ignore (from (visitor :> Cil.cilVisitor) elt); !pool let get_annotations_stmt ?flags kf stmt = collect Cil.visitCilStmt flags kf stmt stmt let get_annotations_exp ?flags kf stmt exp = collect Cil.visitCilExpr flags kf stmt exp let get_annotations_lval ?flags kf stmt lv = collect Cil.visitCilLval flags kf stmt lv (** {2 Annotations of kernel_functions for a given type of RTE} *) (* generates annotation for function kf on the basis of [flags] *) let annotate ?flags kf = let flags = filter flags in Options.debug "annotating function %a" Kernel_function.pretty kf; match kf.fundec with | Declaration _ -> () | Definition(f, _) -> (* This reference contains all the RTE statuses that should be positioned once this function has been annotated. *) let to_update = ref [] in (* Check whether there is something to compute + lists all the statuses that will be ultimately updated *) let comp (_name, set, is_computed) should_compute = if should_compute && not (is_computed kf) then begin to_update := (fun () -> set kf true) :: !to_update; true end else false in (* Strict version of ||, because [comp] has side-effects *) let (|||) a b = a || b in let open Generator in let open Flags in if comp Initialized.accessor flags.initialized ||| comp Mem_access.accessor flags.mem_access ||| comp Pointer_call.accessor flags.pointer_call ||| comp Div_mod.accessor flags.div_mod ||| comp Shift.accessor flags.shift ||| comp Left_shift_negative.accessor flags.left_shift_negative ||| comp Right_shift_negative.accessor flags.right_shift_negative ||| comp Signed_overflow.accessor flags.signed_overflow ||| comp Signed_downcast.accessor flags.signed_downcast ||| comp Unsigned_overflow.accessor flags.unsigned_overflow ||| comp Unsigned_downcast.accessor flags.unsigned_downcast ||| comp Float_to_int.accessor flags.float_to_int ||| comp Finite_float.accessor flags.finite_float ||| comp Bool_value.accessor flags.bool_value then begin Options.feedback "annotating function %a" Kernel_function.pretty kf; let warn = Options.Warn.get () in let on_alarm stmt ~invalid alarm = let ca, _ = register Generator.emitter kf stmt ~invalid alarm in if warn && invalid then Options.warn "@[guaranteed RTE:@ %a@]" Printer.pp_code_annotation ca in let vis = new annot_visitor kf flags on_alarm in let nkf = Visitor.visitFramacFunction vis f in assert(nkf == f); List.iter (fun f -> f ()) !to_update; end (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������frama-c-20.0-Calcium/src/plugins/rte/visit.mli������������������������������������������������������0000666�0000000�0000000�00000010351�13571573400�016116� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* --- Synchronized with RteGen.mli --- *) open Cil_types (** {2 RTE Generator API} *) (** Annotate kernel-function with respect to options and current generator status. *) val annotate: ?flags:Flags.t -> kernel_function -> unit (** Returns annotations associated to alarms {i without} registering them. *) val get_annotations_kf: ?flags:Flags.t -> kernel_function -> code_annotation list (** Returns annotations associated to alarms {i without} registering them. *) val get_annotations_stmt: ?flags:Flags.t -> kernel_function -> stmt -> code_annotation list (** Returns annotations associated to alarms {i without} registering them. *) val get_annotations_exp: ?flags:Flags.t -> kernel_function -> stmt -> exp -> code_annotation list (** Returns annotations associated to alarms {i without} registering them. *) val get_annotations_lval: ?flags:Flags.t -> kernel_function -> stmt -> lval -> code_annotation list (** {2 Low-Level RTE Iterators} RTE Iterators allow to traverse a Cil AST fragment (stmt, expr, l-value) and reveal its potential Alarms. Each alarm will be presented to a callback with type [on_alarm], that you can use in turn to generate an annotation or perform any other treatment. Flags can be used to select which alarm categories to visit, with defaults derived from Kernel and RTE plug-in parameters. *) (** Alarm callback. The [on_alarm kf stmt ~invalid alarm] callback is invoked on each alarm visited by an RTE iterator, provided it fits the selected categories. The [kf] and [stmt] designates the statement originating the alarm, while [~invalid:true] is set when the alarm trivially evaluates to false. In this later case, the corresponding annotation shall be assigned the status [False_if_reachable]. *) type on_alarm = kernel_function -> stmt -> invalid:bool -> Alarms.alarm -> unit (** Type of low-level iterators visiting an element ['a] of the AST *) type 'a iterator = ?flags:Flags.t -> on_alarm -> Kernel_function.t -> Cil_types.stmt -> 'a -> unit val iter_lval : lval iterator val iter_exp : exp iterator val iter_instr : instr iterator val iter_stmt : stmt iterator (** {2 Alarm Helpers} *) (** Returns a [False_if_reachable] status when invalid. *) val status : invalid:bool -> Property_status.emitted_status option (** Registers and returns the annotation associated with the alarm, and a boolean flag indicating whether it has been freshly generated or not. Simple wrapper over [Alarms.register]. *) val register : Emitter.t -> kernel_function -> stmt -> invalid:bool -> Alarms.alarm -> code_annotation * bool (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/scope/�������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014574� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/scope/Scope.mli����������������������������������������������������0000666�0000000�0000000�00000007750�13571573400�016361� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype (** Scope analysis. *) (** Interface for the Scope plugin. @see <index.html> internal documentation. *) module Defs : sig val get_defs : Kernel_function.t -> stmt -> lval -> (Stmt.Hptset.t * Locations.Zone.t option) option (** @return the set of statements that define [lval] before [stmt] in [kf]. Also returns the zone that is possibly not defined. Can return [None] when the information is not available (Pdg missing). *) val get_defs_with_type : Kernel_function.t -> stmt -> lval -> ((bool * bool) Stmt.Map.t * Locations.Zone.t option) option (** @return a map from the statements that define [lval] before [stmt] in [kf]. The first boolean indicates the possibility of a direct modification at this statement, ie. [lval = ...] or [lval = f()]. The second boolean indicates a possible indirect modification through a call. Also returns the zone that is possibly not defined. Can return [None] when the information is not available (Pdg missing). *) end module Datascope : sig val get_data_scope_at_stmt : Kernel_function.t -> stmt -> lval -> Stmt.Hptset.t * (Stmt.Hptset.t * Stmt.Hptset.t) (** @raise Kernel_function.No_Definition if [kf] has no definition. @return 3 statement sets related to the value of [lval] before [stmt] : - the forward selection, - the both way selection, - the backward selection. *) val get_prop_scope_at_stmt : kernel_function -> stmt -> code_annotation -> Stmt.Hptset.t * code_annotation list (** compute the set of statements where the given annotation has the same value as before the given stmt. Also returns the eventual code annotations that are implied by the one given as argument. *) val check_asserts : unit -> code_annotation list (** Print how many assertions could be removed based on the previous analysis ([get_prop_scope_at_stmt]) and return the annotations that can be removed. *) val rm_asserts : unit -> unit (** Same analysis than [check_asserts] but mark the assertions as proven. *) end (** {3 Zones} *) module Zones : sig type t_zones = Locations.Zone.t Stmt.Hashtbl.t val build_zones : kernel_function -> stmt -> lval -> Stmt.Hptset.t * t_zones val pretty_zones : Format.formatter -> t_zones -> unit val get_zones : t_zones -> Cil_types.stmt -> Locations.Zone.t end ������������������������frama-c-20.0-Calcium/src/plugins/scope/datascope.ml�������������������������������������������������0000666�0000000�0000000�00000060353�13571573400�017100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** The aim here is to select the statements where a data D * has the same value then a given starting program point L. *) open Cil_types let cat_rm_asserts_name = "rm_asserts" let () = Plugin.default_msg_keys [cat_rm_asserts_name] module R = Plugin.Register (struct let name = "scope" let shortname = "scope" let help = "data dependencies higher level functions" end) let cat_rm_asserts = R.register_category cat_rm_asserts_name (** {2 Computing a mapping between zones and modifying statements} We first go through all the function statements in other to build a mapping between each zone and the statements that are modifying it. **) (** Statement identifier *) module StmtDefault = struct include Cil_datatype.Stmt let id s = s.sid end (** set of values to store for each data *) module StmtSetLattice = struct include Abstract_interp.Make_Hashconsed_Lattice_Set(StmtDefault)(Cil_datatype.Stmt.Hptset) let default: t = empty let single s = inject_singleton s end (** A place to map each data to the state of statements that modify it. *) module InitSid = struct module LM = Lmap_bitwise.Make_bitwise (StmtSetLattice) (* Clear the (non-project compliant) internal caches each time the ast changes, which includes every time we switch project. *) let () = Ast.add_hook_on_update LM.clear_caches let empty = LM.empty let find = LM.find let add_zone lmap zone sid = let new_val = StmtSetLattice.single sid in LM.add_binding ~exact:false lmap zone new_val let pretty fmt lmap = Format.fprintf fmt "Lmap = %a@\n" LM.pretty lmap end let get_lval_zones ~for_writing stmt lval = let state = Db.Value.get_stmt_state stmt in let dpds, zone, exact = !Db.Value.lval_to_zone_with_deps_state state ~deps:(Some Locations.Zone.bottom) ~for_writing lval in dpds, exact, zone (** Add to [stmt] to [lmap] for all the locations modified by the statement. * Something to do only for calls and assignments. * *) let register_modified_zones lmap stmt = let register lmap zone = InitSid.add_zone lmap zone stmt in let aux_out kf out = let inout= !Db.Operational_inputs.get_internal_precise ~stmt kf in Locations.Zone.join out inout.Inout_type.over_outputs in match stmt.skind with | Instr (Set (lval, _, _)) -> let _dpds, _, zone = get_lval_zones ~for_writing:true stmt lval in register lmap zone | Instr (Local_init(v, i, _)) -> let _, _, zone = get_lval_zones ~for_writing:true stmt (Cil.var v) in let lmap_init = register lmap zone in (match i with | AssignInit _ -> lmap_init | ConsInit(f,_,_) -> let kf = Globals.Functions.get f in let out = aux_out kf Locations.Zone.bottom in register lmap_init out) | Instr (Call (dst,funcexp,_args,_)) -> begin let lmap = match dst with | None -> lmap | Some lval -> let _dpds, _, zone = get_lval_zones ~for_writing:true stmt lval in register lmap zone in let _, kfs = !Db.Value.expr_to_kernel_function ~deps:None (Kstmt stmt) funcexp in let out = Kernel_function.Hptset.fold aux_out kfs Locations.Zone.bottom in register lmap out end | _ -> lmap (** compute the mapping for the function * @raise Kernel_function.No_Definition if [kf] has no definition *) let compute kf = R.debug ~level:1 "computing for function %a" Kernel_function.pretty kf; let f = Kernel_function.get_definition kf in let do_stmt lmap s = Cil.CurrentLoc.set (Cil_datatype.Stmt.loc s); if Db.Value.is_reachable_stmt s then register_modified_zones lmap s else lmap in let f_datas = List.fold_left do_stmt InitSid.empty f.sallstmts in R.debug ~level:2 "data init stmts : %a" InitSid.pretty f_datas; f.sallstmts, f_datas (* TODO : store it ! *) (** {2 Computing Scopes} *) module State = struct (* The algorithm starts by defining the "modified" function, that tells for each statement if it changes the lvalue under consideration. We want to add a "temporal" information on top of modified, i.e. we want to know for each statement s', whether for each path from the starting statement s to s', the lvalue has been modified. To make this computable, we overapproximate, and the dataflow computes if the statement may have been modified (Modif) or has not been modified in any case (SameVal). The simple boolean lattice with Modif and SameVal does not suffice: if we initialized the dataflow with "SameVal" for all statements, "join_and_is_included" would return true and the dataflow could stop before having visited all statements. This explains why a value of Bottom is needed, to distinguish statements not yet visited (or unreachable) from the others. Now another problem in the dataflow is the representation of loop. In a program such has: while(1) { s1; s2; s3; s4; } Where "modified" is false except for s4. We start the forward dataflow on s2. We would compute that s2 is not modified, then s3 is not modified, then s4 is modified, then s1 is modified... but then we would compute that s3 and s4 are modified (and indeed, they are in further iterations of the loop). To cope with this problem, s2 is initialized to the Start state. The Start state is not propagated (transfer Start = SameVal), and cannot be removed from s2 (Start = Top). Thus the Hasse diagram of the lattice is simply: : Start = Top : | : Modif : | : SameVal : | : NotSeen = Bottom *) type t = Start | NotSeen | Modif | SameVal let pretty fmt b = Format.fprintf fmt "%s" (match b with | Start -> "Start" | NotSeen -> "NotSeen" | Modif -> "Modif" | SameVal -> "SameVal") let bottom = NotSeen (* Just compute the "max" between elements of the lattice. *) let merge b1 b2 = let b = match b1, b2 with | Start, _ | _, Start -> Start | NotSeen, b | b, NotSeen -> b | Modif, _ | _, Modif -> Modif | SameVal, SameVal -> SameVal in b let join = merge;; let equal (b1 : t) (b2: t) = (b1 = b2) let join_and_is_included a b = let j = join a b in (j, equal j b) let is_included a b = snd (join_and_is_included a b) (* Note: the transfer function "if m = Start then SameVal else if modif then Modif else m" suits better visualisation by scope, since it does not consider the "current statement" as "modifying". But this gives incorrect results for remove-redundant-alarms. *) let transfer modif m = if modif then Modif else if m = Start then SameVal else m end module BackwardScope (X : sig val modified : stmt -> bool end ) = struct let transfer_stmt stmt state = match stmt.skind with | Instr _ -> State.transfer (X.modified stmt) state | _ -> state include State end let backward_data_scope modif_stmts s kf = let modified s = StmtSetLattice.mem s modif_stmts in let module Fenv = (val Dataflows.function_env kf: Dataflows.FUNCTION_ENV) in let module Arg = struct include BackwardScope(struct let modified = modified end) let init = [(s,State.Start)];; end in let module Compute = Dataflows.Simple_backward(Fenv)(Arg) in Compute.pre_state ;; module ForwardScope (X : sig (* Effects of the statement itself *) val modified : stmt -> bool (* Effects of scope change *) val modified_by_edge: stmt -> stmt -> bool end) = struct include State;; let transfer_stmt s state = let map_on_all_succs new_state = let do_succ s' = (s', State.transfer (X.modified_by_edge s s') new_state) in List.map do_succ s.succs in match s.skind with | Instr _ -> map_on_all_succs (State.transfer (X.modified s) state) | If _ | Switch _ -> map_on_all_succs (State.transfer false state) | Return _ | Throw _ -> [] | UnspecifiedSequence _ | Loop _ | Block _ | Goto _ | Break _ | Continue _ | TryExcept _ | TryFinally _ | TryCatch _ -> map_on_all_succs state ;; end let forward_data_scope modif_stmts modif_edge s kf = let modified s = StmtSetLattice.mem s modif_stmts in let module Fenv = (val Dataflows.function_env kf: Dataflows.FUNCTION_ENV) in let module Arg = struct include ForwardScope(struct let modified = modified let modified_by_edge = modif_edge end) let init = [(s,State.Start)];; end in let module Compute = Dataflows.Simple_forward(Fenv)(Arg) in Compute.pre_state, Compute.post_state ;; (* Add only 'simple' statements. *) let add_s s acc = match s.skind with | Instr _ | Return _ | Continue _ | Break _ | Goto _ | Throw _ -> Cil_datatype.Stmt.Hptset.add s acc | Block _ | Switch _ | If _ | UnspecifiedSequence _ | Loop _ | TryExcept _ | TryFinally _ | TryCatch _ -> acc (** Do backward and then forward propagations and compute the 3 statement sets : * - forward only, * - forward and backward, * - backward only. *) let find_scope allstmts modif_stmts modif_edge s kf = (* Add only statements for which the lvalue certainly did not change. *) let add get_state acc s = match get_state s with | State.Start | State.SameVal -> add_s s acc | _ -> acc in let _, fw_post = forward_data_scope modif_stmts modif_edge s kf in let fw = List.fold_left (add fw_post) Cil_datatype.Stmt.Hptset.empty allstmts in let bw_pre = backward_data_scope modif_stmts s kf in let bw = List.fold_left (add bw_pre) Cil_datatype.Stmt.Hptset.empty allstmts in let fb = Cil_datatype.Stmt.Hptset.inter bw fw in let fw = Cil_datatype.Stmt.Hptset.diff fw fb in let bw = Cil_datatype.Stmt.Hptset.diff bw fb in fw, fb, bw (* Computes the memory zones that points to a base in [escaping] in a state. *) let gather_escaping_zones escaping = function | Cvalue.Model.Top -> Locations.Zone.top | Cvalue.Model.Bottom -> Locations.Zone.bottom | Cvalue.Model.Map m -> let aux base offsm zone = let test b = Base.Hptset.mem b escaping in let gather (_, _ as itv) (v, _, _) acc = let v = Cvalue.V_Or_Uninitialized.get_v v in if Cvalue.V.contains_addresses_of_locals test v then let z = Locations.Zone.inject base (Int_Intervals.inject_itv itv) in Locations.Zone.join acc z else acc in Cvalue.V_Offsetmap.fold gather offsm zone in Cvalue.Model.fold aux m Locations.Zone.bottom (* compute the memory zones that are changed into ESCAPING ADDRESS when taking the cfg edge s1->s2 *) let compute_escaping_zones s1 s2 = let closed_blocks = Kernel_function.blocks_closed_by_edge s1 s2 in let locals = List.flatten (List.map (fun b -> b.blocals) closed_blocks) in let filter acc v = if v.vtemp || not v.vreferenced then acc else Base.Hptset.add (Base.of_varinfo v) acc in let bases = List.fold_left filter Base.Hptset.empty locals in if Base.Hptset.is_empty bases then Locations.Zone.bottom else gather_escaping_zones bases (Db.Value.get_stmt_state s1) (* type pair_stmts = stmt * stmt *) module PairStmts = Datatype.Pair_with_collections (Cil_datatype.Stmt)(Cil_datatype.Stmt) (struct let module_name = "Scope.Datascope.PairStmts" end) (* Hashtbl from pairs of stmts to zone. Used as maps from Cfg edges to the memory zones that are 'modified' by thescope change. *) module HashPairStmtsZone = PairStmts.Hashtbl.Make(Locations.Zone) type modified_by_edge = HashPairStmtsZone.t (* compute the {!modified_by_edge} hashtbl for the fundec [fdec] *) let compute_modif_edge fdec : modified_by_edge = let modifs_edge = PairStmts.Hashtbl.create 17 in let do_stmt stmt = let do_succ stmt' = let z = compute_escaping_zones stmt stmt' in PairStmts.Hashtbl.add modifs_edge (stmt, stmt') z in List.iter do_succ stmt.succs in List.iter do_stmt fdec.sallstmts; modifs_edge module ModifEdge = Cil_state_builder.Kernel_function_hashtbl(HashPairStmtsZone) (struct let name = "Scope.Datatscope.ModifsEdge" let dependencies = [Db.Value.self] let size = 16 end) let modified_by_edge_kf = ModifEdge.memo (fun kf -> compute_modif_edge (Kernel_function.get_definition kf)) (* Does the Cfg edge [s1->s2] has an effect on [z]? *) let is_modified_by_edge kf z s1 s2 = let modifs_edge = modified_by_edge_kf kf in Locations.Zone.intersects z (PairStmts.Hashtbl.find modifs_edge (s1, s2)) (** Try to find the statement set where [data] has the same value than * before [stmt]. * @raise Kernel_function.No_Definition if [kf] has no definition *) let get_data_scope_at_stmt kf stmt lval = let dpds, _, zone = get_lval_zones ~for_writing:false stmt lval in (* TODO : is there something to do with 'exact' ? *) let zone = Locations.Zone.join dpds zone in let allstmts, info = compute kf in let modif_stmts = InitSid.find info zone in let modifs_edge = is_modified_by_edge kf zone in let (f_scope, fb_scope, b_scope) = find_scope allstmts modif_stmts modifs_edge stmt kf in R.debug "@[<hv 4>get_data_scope_at_stmt %a at %d @\n\ modified by = %a@\n\ f = %a@\nfb = %a@\nb = %a@]" (* stmt at *) Locations.Zone.pretty zone stmt.sid (* modified by *) (Pretty_utils.pp_iter StmtSetLattice.iter ~sep:",@ " Cil_datatype.Stmt.pretty_sid) modif_stmts (* scope *) Cil_datatype.Stmt.Hptset.pretty f_scope Cil_datatype.Stmt.Hptset.pretty fb_scope Cil_datatype.Stmt.Hptset.pretty b_scope; (f_scope, (fb_scope, b_scope)) exception ToDo let get_annot_zone kf stmt annot = let add_zone z info = let s = info.Db.Properties.Interp.To_zone.ki in let before = info.Db.Properties.Interp.To_zone.before in let zone = info.Db.Properties.Interp.To_zone.zone in R.debug ~level:2 "[forward_prop_scope] need %a %s stmt %d@." Locations.Zone.pretty zone (if before then "before" else "after") s.sid; if before && stmt.sid = s.sid then Locations.Zone.join zone z else (* TODO *) raise ToDo in let (info, _), _ = !Db.Properties.Interp.To_zone.from_stmt_annot annot (stmt, kf) in match info with | None -> raise ToDo | Some info -> let zone = List.fold_left add_zone Locations.Zone.bottom info in R.debug "[get_annot_zone] need %a" Locations.Zone.pretty zone ; zone module CA_Map = Cil_datatype.Code_annotation.Map type proven = (stmt * code_annotation * stmt) CA_Map.t (** Type of the properties proven so far. A binding [ca -> (stmt_ca, ca_because, stmt_because)] must be read as "[ca] at statement [stmt_ca] is a logical consequence of [ca_because] at statement [stmt_because]". Currently, [ca] and [ca_because] are always exactly the same ACSL assertion, although this may be extended in the future. *) (** Assertions proven so far, as a list *) let list_proven (m:proven) = CA_Map.fold (fun ca _ acc -> ca :: acc) m [] (** [add_proven_annot proven because] add the fact that [proven] is proven thanks to [because]. This function also returns a boolean indicating that [proven] was not already proven. *) let add_proven_annot (ca, stmt_ca) (ca_because, stmt_because) acc = if CA_Map.mem ca acc then (* already proven *) acc, false else CA_Map.add ca (stmt_ca, ca_because, stmt_because) acc, true (** Check if an assertion at [stmt] is identical to [ca] (itself emitted at [stmt_ca]). Add them to acc if any *) let check_stmt_annots (ca, stmt_ca) stmt acc = let check _ annot acc = match ca.annot_content, annot.annot_content with | AAssert (_, Assert, p'), AAssert (_, _, p) -> if Logic_utils.is_same_predicate_node p.pred_content p'.pred_content then let acc, added = add_proven_annot (annot, stmt) (ca, stmt_ca) acc in if added then R.debug "annot at stmt %d could be removed: %a" stmt.sid Printer.pp_code_annotation annot; acc else acc | _ -> acc in Annotations.fold_code_annot check stmt acc exception VolatileFound (* This visitor detects the presence of a volatile logic l-value. Such a l-value may evaluate differently at different program point. *) class containsVolatile = object inherit Visitor.frama_c_inplace method! vterm t = match t.term_node with | TLval tlv -> if Cil.isVolatileTermLval tlv then raise VolatileFound ; Cil.DoChildren | _ -> Cil.DoChildren end let code_annot_is_volatile ca = let vis = new containsVolatile in try ignore (Visitor.visitFramacCodeAnnotation vis ca); false with VolatileFound -> true (** Return the set of stmts ([scope]) where [annot] has the same value as at [stmt], and adds to [proven] the annotations that are identical to [annot] at statements that are both in [scope] and dominated by [stmt]. [stmt] is not added to the set, and [annot] is not added to [proven]. *) let get_prop_scope_at_stmt ~warn kf stmt ?(proven=CA_Map.empty) annot = R.debug "[get_prop_scope_at_stmt] at stmt %d in %a : %a" stmt.sid Kernel_function.pretty kf Printer.pp_code_annotation annot; let acc = (Cil_datatype.Stmt.Hptset.empty, proven) in if code_annot_is_volatile annot then acc else try let zone = get_annot_zone kf stmt annot in let allstmts, info = compute kf in let modif_stmts = InitSid.find info zone in let modifs_edge = is_modified_by_edge kf zone in let pre_state, _ = forward_data_scope modif_stmts modifs_edge stmt kf in begin match annot.annot_content with | AAssert _ -> () | _ -> R.abort "only 'assert' are handled by get_prop_scope_at_stmt" end; let add ((acc_scope, acc_to_be_rm) as acc) s = match pre_state s with | State.SameVal -> if Dominators.dominates stmt s && not (Cil_datatype.Stmt.equal stmt s) then let acc_scope = add_s s acc_scope in let acc_to_be_rm = check_stmt_annots (annot, stmt) s acc_to_be_rm in (acc_scope, acc_to_be_rm) else acc | _ -> acc in List.fold_left add acc allstmts with ToDo -> if warn then R.warning ~current:true ~once:true "[get_annot_zone] don't know how to compute zone: skip this annotation"; acc (** Collect the annotations that can be removed because they are redundant. *) class check_annot_visitor = object(self) inherit Visitor.frama_c_inplace val mutable proven = CA_Map.empty method proven () = proven method! vcode_annot annot = let kf = Extlib.the self#current_kf in let stmt = Visitor_behavior.Get_orig.stmt self#behavior (Extlib.the self#current_stmt) in begin match annot.annot_content with | AAssert _ -> R.debug ~level:2 "[check] annot %d at stmt %d in %a : %a@." annot.annot_id stmt.sid Kernel_function.pretty kf Printer.pp_code_annotation annot; let _scope, proven' = get_prop_scope_at_stmt ~warn:false kf stmt ~proven annot in proven <- proven' | _ -> () end; Cil.SkipChildren method! vglob_aux g = match g with | GFun (fdec, _loc) when !Db.Value.is_called (Extlib.the self#current_kf) && not (!Db.Value.no_results fdec) -> Cil.DoChildren | _ -> Cil.SkipChildren method! vexpr _ = Cil.SkipChildren end (* class check_annot_visitor *) let redundant_assertions () = let visitor = new check_annot_visitor in ignore (Visitor.visitFramacFile (visitor:>Visitor.frama_c_visitor) (Ast.get ())); visitor#proven () let check_asserts () = R.feedback "check if there are some redundant assertions..."; let to_be_removed = redundant_assertions () in let n = CA_Map.cardinal to_be_removed in R.result "[check_asserts] %d assertion(s) could be removed@." n; (list_proven to_be_removed) (* erasing optional arguments, plus return a list*) let get_prop_scope_at_stmt kf stmt annot = let s, m = get_prop_scope_at_stmt ~warn:true kf stmt annot in s, list_proven m (* Currently lazy, because we need to define it after Value as been registered in Db *) let emitter = lazy ( let conv = List.map Typed_parameter.get in let correctness = conv (Emitter.correctness_parameters !Db.Value.emitter) in let tuning = conv (Emitter.tuning_parameters !Db.Value.emitter) in Emitter.create "RedundantAlarms" [Emitter.Property_status] ~correctness ~tuning) (** Mark as proved the annotations collected by [check_asserts]. *) let rm_asserts () = let to_be_removed = redundant_assertions () in let n = CA_Map.cardinal to_be_removed in if n > 0 then begin R.feedback ~dkey:cat_rm_asserts "removing %d assertion(s)@." n; let aux ca (stmt_ca, ca_because, stmt_because) = let loc = Cil_datatype.Stmt.loc stmt_ca in R.result ~source:(fst loc) ~dkey:cat_rm_asserts ~level:2 "@[removing redundant@ %a@]" Printer.pp_code_annotation ca; let kf = Kernel_function.find_englobing_kf stmt_ca in let ip_ca = Property.ip_of_code_annot_single kf stmt_ca ca in let ip_because = Property.ip_of_code_annot_single kf stmt_because ca_because in let e = Lazy.force emitter in Property_status.emit e ~hyps:[ip_because] ip_ca Property_status.True in CA_Map.iter aux to_be_removed end let get_data_scope_at_stmt = Journal.register "Scope.Datascope.get_data_scope_at_stmt" (Datatype.func3 Kernel_function.ty Cil_datatype.Stmt.ty Cil_datatype.Lval.ty (Datatype.pair Cil_datatype.Stmt.Hptset.ty (Datatype.pair Cil_datatype.Stmt.Hptset.ty Cil_datatype.Stmt.Hptset.ty))) get_data_scope_at_stmt let get_prop_scope_at_stmt = Journal.register "Scope.Datascope.get_prop_scope_at_stmt" (Datatype.func3 Kernel_function.ty Cil_datatype.Stmt.ty Cil_datatype.Code_annotation.ty (Datatype.pair (Cil_datatype.Stmt.Hptset.ty) (Datatype.list Cil_datatype.Code_annotation.ty))) get_prop_scope_at_stmt let check_asserts = Journal.register "Scope.Datascope.check_asserts" (Datatype.func Datatype.unit (Datatype.list Cil_datatype.Code_annotation.ty)) check_asserts let rm_asserts = Journal.register "Scope.Datascope.rm_asserts" (Datatype.func Datatype.unit Datatype.unit) rm_asserts let () = Db.register (Db.Journalize ("Value.rm_asserts", Datatype.func Datatype.unit Datatype.unit)) Db.Value.rm_asserts rm_asserts (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/scope/datascope.mli������������������������������������������������0000666�0000000�0000000�00000004156�13571573400�017250� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype val get_data_scope_at_stmt : Kernel_function.t -> stmt -> lval -> Stmt.Hptset.t * (Stmt.Hptset.t * Stmt.Hptset.t) val get_prop_scope_at_stmt : kernel_function -> stmt -> code_annotation -> Stmt.Hptset.t * code_annotation list val check_asserts : unit -> code_annotation list val rm_asserts : unit -> unit (** for internal use *) module R: Plugin.General_services val get_lval_zones: for_writing:bool -> Cil_types.stmt -> Cil_types.lval -> Locations.Zone.t * bool * Locations.Zone.t ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/scope/defs.ml������������������������������������������������������0000666�0000000�0000000�00000024324�13571573400�016054� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Find the statements that defines a given data at a program point, * ie. in each backward path starting from this point, find the statement * the the data has been assigned for the last time. *) open Cil_datatype open Cil_types let debug1 fmt = Datascope.R.debug ~level:1 fmt module Interproc = Datascope.R.True(struct let option_name = "-scope-defs-interproc" let help = "interprocedural defs computation" end) module NSet = PdgTypes.Node.Set let add_list_to_set l s = List.fold_left (fun r n -> NSet.add n r) s l let _pp_list_node_underout prefix fmt = Pretty_utils.pp_list ~pre:(prefix ^^ " @[") ~suf:"@]@." ~sep:"@ " (fun fmt (n, undef) -> match undef with | None -> PdgTypes.Node.pretty fmt n | Some undef -> Format.fprintf fmt "%a {underout %a}" PdgTypes.Node.pretty n Locations.Zone.pretty undef) fmt let _pp_set prefix fmt = Pretty_utils.pp_iter ~pre:(prefix ^^ " @[") ~suf:"@]@." ~sep:"@ " NSet.iter PdgTypes.Node.pretty fmt (** The nodes [nodes] define the searched location [z]. If those nodes are calls to functions, go inside those calls, and find which nodes are relevant. *) let rec add_callee_nodes z acc nodes = let new_nodes, acc = NSet.fold (fun node acc2 -> match !Db.Pdg.node_key node with | PdgIndex.Key.SigCallKey (cid, PdgIndex.Signature.Out out_key) -> let callees = Db.Value.call_to_kernel_function (PdgIndex.Key.call_from_id cid) in Kernel_function.Hptset.fold (fun kf (new_nodes, acc) -> let callee_pdg = !Db.Pdg.get kf in let outputs = match out_key with | PdgIndex.Signature.OutLoc out -> (* [out] might be an over-approximation of the location we are searching for. We refine the search if needed. *) let z = Locations.Zone.narrow out z in fst (!Db.Pdg.find_location_nodes_at_end callee_pdg z) | PdgIndex.Signature.OutRet -> (* probably never occurs *) fst (!Db.Pdg.find_output_nodes callee_pdg out_key) in let outputs = List.map fst outputs in add_list_to_set outputs new_nodes, add_list_to_set outputs acc) callees acc2 | _ -> acc2) nodes (NSet.empty, acc) in if NSet.is_empty new_nodes then acc else add_callee_nodes z acc new_nodes (** [kf] doesn't define all the data that we are looking for: the [undef] zone must have been defined in its caller, let's find it. [z] is the initial zone that we are looking for, so that we do not look for more than it. *) (* BYTODO: maybe [undef] could be used instead of [z] altogether *) let rec add_caller_nodes z kf acc (undef, nodes) = let join_undef u u' = match u, u' with | _, None -> u | None, Some _ -> u' | Some z, Some z' -> Some (Locations.Zone.join z z') in let add_one_call_nodes pdg (acc_undef, acc) stmt = let acc_undef, acc = match undef with | None -> acc_undef, acc | Some undef -> let nodes_for_undef, undef' = !Db.Pdg.find_location_nodes_at_stmt pdg stmt ~before:true undef in let acc_undef = join_undef acc_undef undef' in let acc = add_list_to_set (List.map fst nodes_for_undef) acc in acc_undef, acc in let add_call_input_nodes node (acc_undef, acc) = match !Db.Pdg.node_key node with | PdgIndex.Key.SigKey (PdgIndex.Signature.In in_key) -> begin match in_key with | PdgIndex.Signature.InCtrl -> (* We only look for the values *) acc_undef, acc | PdgIndex.Signature.InNum n_param -> let n = !Db.Pdg.find_call_input_node pdg stmt n_param in acc_undef, NSet.add n acc | PdgIndex.Signature.InImpl z' -> let z = Locations.Zone.narrow z z' in let nodes, undef'= !Db.Pdg.find_location_nodes_at_stmt pdg stmt ~before:true z in let acc_undef = join_undef acc_undef undef' in acc_undef, add_list_to_set (List.map fst nodes) acc end | _ -> acc_undef, acc in NSet.fold add_call_input_nodes nodes (acc_undef, acc) in let add_one_caller_nodes acc (kf, stmts) = let pdg = !Db.Pdg.get kf in let acc_undef, caller_nodes = List.fold_left (add_one_call_nodes pdg) (None, NSet.empty) stmts in add_caller_nodes z kf (NSet.union caller_nodes acc) (acc_undef, caller_nodes) in List.fold_left add_one_caller_nodes acc (!Db.Value.callers kf) let compute_aux kf stmt zone = debug1 "[Defs.compute] for %a at sid:%d in '%a'@." Locations.Zone.pretty zone stmt.sid Kernel_function.pretty kf; try let pdg = !Db.Pdg.get kf in let nodes, undef = !Db.Pdg.find_location_nodes_at_stmt pdg stmt ~before:true zone in let nodes = add_list_to_set (List.map fst nodes) NSet.empty in let nodes = if Interproc.get () then begin let caller_nodes = add_caller_nodes zone kf nodes (undef, nodes) in add_callee_nodes zone caller_nodes caller_nodes end else nodes in Some (nodes, undef) with Db.Pdg.Bottom | Db.Pdg.Top | Not_found -> None let compute kf stmt lval = let extract (nodes, undef) = let add_node node defs = match PdgIndex.Key.stmt (!Db.Pdg.node_key node) with | None -> defs | Some s -> Stmt.Hptset.add s defs in (* select corresponding stmts *) let defs = NSet.fold add_node nodes Stmt.Hptset.empty in (defs, undef) in !Db.Value.compute (); let zone = !Db.Value.lval_to_zone (Kstmt stmt) lval in Extlib.opt_map extract (compute_aux kf stmt zone) (* Variation of the function above. For each PDG node that has been found, we find whether it directly modifies [zone] through an affectation (statements [Set] or [Call (lv, _)], or if the change is indirect through the body of a call. *) let compute_with_def_type_zone kf stmt zone = let extract (nodes, undef) = let add_node node acc = let change stmt (direct, indirect) = let (prev_d, pred_i) = try Stmt.Map.find stmt acc with Not_found -> (false, false) in let after = (direct || prev_d, indirect || pred_i) in Stmt.Map.add stmt after acc in match !Db.Pdg.node_key node with | PdgIndex.Key.Stmt s -> change s (true, false) | PdgIndex.Key.CallStmt _ -> assert false | PdgIndex.Key.SigCallKey (s, sign) -> (match sign with | PdgIndex.Signature.Out (PdgIndex.Signature.OutRet) -> change s (true, false) (* defined by affectation in 'v = f()' *) | PdgIndex.Signature.In _ -> change s (true, false) (* defined by formal v in 'f(v)' *) | PdgIndex.Signature.Out (PdgIndex.Signature.OutLoc _) -> begin match s.skind with | Instr (Call (_, { enode = Lval (Var vi, NoOffset)}, _, _) | Local_init (_, ConsInit(vi,_,_),_)) when let kf = Globals.Functions.get vi in !Db.Value.use_spec_instead_of_definition kf -> (* defined through a call, but function has no body *) change s (true, false) | _ -> (* defined within call to a function with a body*) change s (false, true) end ) | PdgIndex.Key.SigKey _ -> acc | s -> Format.printf "## %a@." PdgIndex.Key.pretty s; acc in let stmts = NSet.fold add_node nodes Stmt.Map.empty in (stmts, undef) in Extlib.opt_map extract (compute_aux kf stmt zone) let compute_with_def_type kf stmt lval = !Db.Value.compute (); let zone = !Db.Value.lval_to_zone (Kstmt stmt) lval in compute_with_def_type_zone kf stmt zone (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) module D = Datatype.Option (Datatype.Pair(Stmt.Hptset)(Datatype.Option(Locations.Zone))) module DT = Datatype.Option (Datatype.Pair (Stmt.Map.Make(Datatype.Pair(Datatype.Bool)(Datatype.Bool))) (Datatype.Option(Locations.Zone))) let get_defs = Journal.register "Scope.Defs.get_defs" (Datatype.func3 Kernel_function.ty Stmt.ty Lval.ty (D.ty)) compute let get_defs_with_type = Journal.register "Scope.Defs.get_defs_with_type" (Datatype.func3 Kernel_function.ty Stmt.ty Lval.ty (DT.ty)) compute_with_def_type ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/scope/defs.mli�����������������������������������������������������0000666�0000000�0000000�00000004327�13571573400�016226� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val get_defs : Kernel_function.t -> Cil_datatype.Stmt.t -> Cil_datatype.Lval.t -> (Cil_datatype.Stmt.Hptset.t * Locations.Zone.t option) option val get_defs_with_type : Kernel_function.t -> Cil_datatype.Stmt.t -> Cil_datatype.Lval.t -> ((bool * bool) Cil_datatype.Stmt.Map.t * Locations.Zone.t option) option (* internal use *) val compute_with_def_type_zone: Cil_types.kernel_function -> Cil_types.stmt -> Locations.Zone.t -> ((bool * bool) Cil_datatype.Stmt.Map.t * Locations.Zone.t option) option (** This function is similar to {get_defs_with_type}, except that it receives a zone as argument, instead of an l-value *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/scope/dpds_gui.ml��������������������������������������������������0000666�0000000�0000000�00000047126�13571573400�016736� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Pretty_source open Cil_types open Cil_datatype let update_column = ref (fun _ -> ()) let add_tag buffer (name, tag_prop) start stop = let tag = Gtk_helper.make_tag buffer ~name tag_prop in Gtk_helper.apply_tag buffer tag start stop let scope_start_tag = ("startscope", [`UNDERLINE `DOUBLE]) let zones_used_tag = ("zones", [`BACKGROUND "#FFeeCC"]) let show_def_direct_tag = ("show_def", [`BACKGROUND "#FFca63"]) let show_def_indirect_tag = ("show_def_indirect", [`BACKGROUND "#FFdb74"]) let scope_b_tag = ("b_scope", [`BACKGROUND "#CCFFff"]) let scope_fb_tag = ("fb_scope", [`BACKGROUND "#CCFFee"]) let scope_f_tag = ("f_scope", [`BACKGROUND "#CCFFbb"]) let scope_p_tag = ("p_scope", [`BACKGROUND "#FFFFab"]) let scope_p_warn_tag = ("p_warn_scope", [`BACKGROUND "#D5FFAb"]) let empty_tag = ("", []) let add_msg (main_ui:Design.main_window_extension_points) txt = main_ui#pretty_information "%s@." txt let pretty_zone fmt z = Format.fprintf fmt "@[<h 1>%a@]" Locations.Zone.pretty z let ask_for_lval (main_ui:Design.main_window_extension_points) kf = let txt = Gtk_helper.input_string ~parent:main_ui#main_window ~title:"Input lvalue expression" "" in match txt with None | Some "" -> None | Some txt -> try let term_lval = !Db.Properties.Interp.term_lval kf txt in let lval = !Db.Properties.Interp.term_lval_to_lval ~result:None term_lval in Some (txt, lval) with e -> main_ui#error "[ask for lval] '%s' invalid expression: %s@." txt (Printexc.to_string e); None let get_annot_opt localizable = match localizable with | Pretty_source.PIP(Property.(IPCodeAnnot {ica_ca})) -> Some ica_ca | _ -> None (** [kf_opt] is used if we want to ask the lval to the user in a popup *) let get_lval_opt main_ui kf_opt localizable = match localizable with | Pretty_source.PLval (Some _kf, (Kstmt _stmt), lv) -> let lv_txt = Format.asprintf "%a" Printer.pp_lval lv in Some (lv_txt, lv) | PTermLval (Some _kf, Kstmt _stmt, _, tlv) -> begin try let lv = !Db.Properties.Interp.term_lval_to_lval ~result:None tlv in let lv_txt = Format.asprintf "%a" Printer.pp_term_lval tlv in Some (lv_txt, lv) with Invalid_argument _ -> None end | _ -> ( match kf_opt with None -> None | Some kf -> match (ask_for_lval main_ui kf) with None -> None | Some (lv_txt, lv) -> Some (lv_txt, lv)) let eval_lval = let typ_lval_to_zone_gui = Datatype.func2 Stmt.ty Lval.ty Locations.Zone.ty in Dynamic.get ~plugin:"Value" "lval_to_zone_gui" typ_lval_to_zone_gui module Kf_containing_highlighted_stmt = Kernel_function.Make_Table (Datatype.String.Set) (struct let name = "Dpds_gui.Kf_containing_highlighted_stmt" let size = 7 let dependencies = [ (*Dependencies are managed manually by Make_StmtSetState*) ] end) let default_icon_name = "gtk-apply" let default_icon = Datatype.String.Set.singleton default_icon_name module Make_StmtSetState (Info:sig val name: string end) = struct include State_builder.Ref (Stmt.Hptset) (struct let name = Info.name let dependencies = [ Db.Value.self ] let default () = Stmt.Hptset.empty end) let set s = set s; Kf_containing_highlighted_stmt.clear (); Stmt.Hptset.iter (fun stmt -> Kf_containing_highlighted_stmt.replace (Kernel_function.find_englobing_kf stmt) default_icon) s; !update_column `Contents end module Make_StmtMapState (Info:sig val name: string end) = struct module D = Datatype include State_builder.Ref (Stmt.Map.Make(Datatype.String.Set)) (struct let name = Info.name let dependencies = [ Db.Value.self ] let default () = Stmt.Map.empty end) let set s = set s; Kf_containing_highlighted_stmt.clear (); Stmt.Map.iter (fun stmt s -> let kf = Kernel_function.find_englobing_kf stmt in let prev = try Kf_containing_highlighted_stmt.find kf with Not_found -> D.String.Set.empty in let union = D.String.Set.union prev s in Kf_containing_highlighted_stmt.replace kf union) s; !update_column `Contents end module type DpdCmdSig = sig type t_in val help : string val get_info : (Kernel_function.t * Cil_types.stmt) option -> string val compute : Kernel_function.t -> Cil_types.stmt -> t_in -> string val tag_stmt : Cil_types.stmt -> (string * GText.tag_property list) val clear: unit -> unit end module DataScope : (DpdCmdSig with type t_in = lval) = struct type t_in = lval module Fscope = Make_StmtSetState (struct let name = "Dpds_gui.Highlighter.Fscope" end) module FBscope = Make_StmtSetState (struct let name = "Dpds_gui.Highlighter.FBscope" end) module Bscope = Make_StmtSetState (struct let name = "Dpds_gui.Highlighter.Bscope" end) let clear () = Fscope.clear(); FBscope.clear(); Bscope.clear() let help = ("[data_scope] " ^"highlight the statements where the value of D is the same " ^"than at its value at L.\n\t" ^"For more information, please look at the Scope plugin documentation.") let get_info _kf_stmt_opt = if Stmt.Hptset.is_empty (Fscope.get ()) && Stmt.Hptset.is_empty (FBscope.get ()) && Stmt.Hptset.is_empty (Bscope.get ()) then "" else "[scope] selected" let compute kf stmt lval = let f, (fb, b) = Datascope.get_data_scope_at_stmt kf stmt lval in Fscope.set f; FBscope.set fb; Bscope.set b; "[scope] computed" let tag_stmt stmt = if Stmt.Hptset.mem stmt (Fscope.get()) then scope_f_tag else if Stmt.Hptset.mem stmt (FBscope.get()) then scope_fb_tag else if Stmt.Hptset.mem stmt (Bscope.get()) then scope_b_tag else empty_tag end module Pscope (* : (DpdCmdSig with type t_in = code_annotation) *) = struct type t_in = code_annotation module Pscope = Make_StmtSetState (struct let name = "Dpds_gui.Highlighter.Pscope" end) module Pscope_warn = State_builder.List_ref (Code_annotation) (struct let name = "Dpds_gui.Highlighter.Pscope_warn" let dependencies = [ Db.Value.self ] end) let clear () = Pscope.clear(); Pscope_warn.clear() let help = ("[prop_scope] " ^"highlight the statements where the value of the assertion is also ok\n\t" ^"For more information, please look at the Scope plugin documentation.") let get_info _kf_stmt_opt = if Stmt.Hptset.is_empty (Pscope.get ()) then "" else "[prop_scope] selected" let compute kf stmt annot = let s1, s2 = Datascope.get_prop_scope_at_stmt kf stmt annot in Pscope.set s1; Pscope_warn.set s2; "[prop_scope] computed" let tag_stmt stmt = (*if Stmt.Hptset.mem stmt (Pscope_warn.get()) then scope_p_warn_tag else*) if Stmt.Hptset.mem stmt (Pscope.get()) then scope_p_tag else empty_tag let tag_annot annot = let tag = List.exists (fun a -> a.annot_id = annot.annot_id) (Pscope_warn.get()) in if tag then scope_p_warn_tag else empty_tag end module ShowDef : (DpdCmdSig with type t_in = lval) = struct type t_in = lval module ShowDefState = Make_StmtMapState (struct let name = "Dpds_gui.Highlighter.ShowDef" end) let clear () = ShowDefState.clear() let help = ("[show_def] " ^"highlight the statements that define the value of D at L,\n\t" ^"and print a message if a part of D might be undefined.\n\t" ^"Notice that 'undefined' only means here " ^"not defined on some path from the beginning of the function.") let get_info _kf_stmt_opt = if Stmt.Map.is_empty (ShowDefState.get()) then "" else "[show_def] selected" let indirect_icon = Datatype.String.Set.singleton "gtk-jump-to" let conv m = let aux stmt (direct, indirect) acc = let empty = Datatype.String.Set.empty in let direct = if direct then default_icon else empty in let indirect = if indirect then indirect_icon else empty in let s = Datatype.String.Set.union direct indirect in if Datatype.String.Set.is_empty s then acc else Stmt.Map.add stmt s acc in Stmt.Map.fold aux m Stmt.Map.empty let compute kf stmt lv = let z = eval_lval stmt lv in let r = Defs.compute_with_def_type_zone kf stmt z in Datascope.R.feedback "Defs computed"; match r with | None -> clear (); "[Show Defs] nothing found. The information about some functions \ may be missing." | Some (defs, undef) -> let msg = match undef with | None -> "" | Some undef -> Format.asprintf "[Show Defs] notice that %a %s" pretty_zone undef "may not be defined by this function at this point" in ShowDefState.set (conv defs); msg let tag_stmt stmt = try let s = Stmt.Map.find stmt (ShowDefState.get()) in if Datatype.String.Set.mem default_icon_name s then show_def_direct_tag else show_def_indirect_tag with Not_found -> empty_tag end module Zones : (DpdCmdSig with type t_in = lval) = struct type t_in = lval module ZonesState = struct include State_builder.Option_ref (Datatype.Pair (Stmt.Hashtbl.Make(Locations.Zone)) (Stmt.Hptset)) (struct let name = "Dpds_gui.Highlighter.ZonesState" let dependencies = [ Db.Value.self ] end) let set s = set s; Kf_containing_highlighted_stmt.clear (); Stmt.Hptset.iter (fun stmt -> Kf_containing_highlighted_stmt.replace (Kernel_function.find_englobing_kf stmt) default_icon) (snd s); !update_column `Contents end let clear () = ZonesState.clear () let help = ("[zones] computes, for each point Li of the function, " ^"the data Di needed to know the value of D at L.\n" ^"\tAfter this computation, the result Di will be printed in the " ^" information window each time a statement Li is selected.") let get_info kf_stmt_opt = try let zones, _ = ZonesState.get () in match kf_stmt_opt with | None -> "[zones] no information for this point" | Some (_kf, stmt) -> let z = Zones.get_zones zones stmt in let txt = Format.asprintf "[zones] needed before stmt %d = %a" stmt.sid pretty_zone z in txt with Not_found -> "" let compute kf stmt lval = let used_stmts, zones = Zones.build_zones kf stmt lval in ZonesState.set (zones, used_stmts); "[zones] computed" let tag_stmt stmt = let is_used = try let _zones, used = ZonesState.get () in Stmt.Hptset.mem stmt used with Not_found -> false in if is_used then zones_used_tag else empty_tag end let help (main_ui:Design.main_window_extension_points) = let add txt = add_msg main_ui txt in add ("General : " ^"each of these commands starts from a data D at a program point L.\n\t" ^"The program point is the one that is before the selected statement,\n\t" ^"and the data is the one that is selected if any, " ^"or it can be given via a popup.\n" ^"\tIf the text given in the popup is empty, or 'Cancel' is chosen, " ^"the selection of the command is reset."); add (ShowDef.help); add (Zones.help); add (DataScope.help); add (Pscope.help); add ("Reset : reset the internal state for all the previous commands.") module DpdsState = State_builder.Option_ref (Stmt) (struct let name = "Dpds_gui.Highlighter.DpdsState" let dependencies = [ Db.Value.self ] end) let reset () = DpdsState.clear (); ShowDef.clear (); Zones.clear (); DataScope.clear (); Pscope.clear (); Kf_containing_highlighted_stmt.clear (); !update_column `Contents (* Functions available in the contextual menu. One function disables the others *) type funct = Defs | Zones | Scope | Pscope let callbacks funct main_ui (kf, stmt, localizable) = (* The messages printed here are (1) not really informative; (2) too short lived: after the 'information' panel has been cleared, they are never printed again. (And if the filetree filter is active, they are cleared just after having been written.) Because of (1), no effort has been made to correct (2). *) let compute f arg = let msg = f kf stmt arg in if msg <> "" then add_msg main_ui msg in let set_txt x = let txt = Format.asprintf "[dependencies] for %s before stmt %d in %a" x stmt.sid Kernel_function.pretty kf in DpdsState.set stmt; add_msg main_ui txt in let aux_on_lval funct_compute = match get_lval_opt main_ui (Some kf) localizable with | None -> () | Some (lval_txt, lval) -> set_txt lval_txt; compute funct_compute lval in reset (); begin match funct with | Pscope -> begin match get_annot_opt localizable with | Some ({annot_content = (AAssert _)} as annot) -> set_txt ("annotation "^(string_of_int annot.annot_id)); compute Pscope.compute annot | _ -> () end | Defs -> aux_on_lval ShowDef.compute | Zones -> aux_on_lval Zones.compute | Scope -> aux_on_lval DataScope.compute end; main_ui#rehighlight () let highlighter (buffer:Design.reactive_buffer) localizable ~start ~stop = try let buffer = buffer#buffer in let start_s = DpdsState.get () in let put_tag tag = match tag with ("",[]) -> () | _ -> add_tag buffer tag start stop in match localizable with | PStmt (_,stmt) -> if start_s.sid = stmt.sid then put_tag scope_start_tag; put_tag (Pscope.tag_stmt stmt); put_tag (DataScope.tag_stmt stmt); put_tag (Zones.tag_stmt stmt ); put_tag (ShowDef.tag_stmt stmt) | PIP (Property.(IPCodeAnnot {ica_ca})) -> put_tag (Pscope.tag_annot ica_ca) | PStmtStart _ | PExp _ | PVDecl _ | PTermLval _ | PLval _ | PGlobal _ | PIP _ -> () with Not_found -> () let check_value (main_ui:Design.main_window_extension_points) = if Db.Value.is_computed () then true else let answer = GToolbox.question_box ~title:("Eva Needed") ~buttons:[ "Run"; "Cancel" ] ("Eva has to be run first.\nThis can take some time.\n" ^"Do you want to run Eva with its current settings now?") in if answer = 1 then match main_ui#full_protect ~cancelable:true !Db.Value.compute with | Some _ -> main_ui#redisplay (); (* New alarms *) true | None -> false else false (** To add a sensitive/insensitive menu item to a [factory]. * The menu item is insensitive when [arg_opt = None], * else, when the item is selected, the callback is called with the argument. * If [~use_values], check if the value analysis has been computed. *) let add_item (main_ui:Design.main_window_extension_points) ~use_values (factory:GMenu.menu GMenu.factory) name arg_opt callback = match arg_opt with | None -> (* add the menu item, but it isn't sensitive *) let item = factory#add_item name ~callback: (fun () -> ()) in item#misc#set_sensitive false | Some arg -> (* add the menu item with its callback *) let cb arg = if use_values then if check_value main_ui then callback arg else () else callback arg in ignore (factory#add_item name ~callback: (fun () -> cb arg)) let selector (popup_factory:GMenu.menu GMenu.factory) (main_ui:Design.main_window_extension_points) ~button localizable = if button = 3 then begin let submenu = popup_factory#add_submenu "Dependencies" in let submenu_factory = new GMenu.factory submenu in let arg = match (Pretty_source.kf_of_localizable localizable, Pretty_source.ki_of_localizable localizable) with | Some kf, Kstmt st -> Some(kf, st, localizable) | Some _, Kglobal | None, _ -> None in let add_zones_item name funct = add_item main_ui ~use_values:true submenu_factory name arg (fun arg -> main_ui#protect ~cancelable:true (fun () -> callbacks funct main_ui arg)) in add_zones_item "Show defs" Defs; add_zones_item "Zones" Zones; add_zones_item "DataScope" Scope; add_zones_item "PropScope" Pscope; ignore (submenu_factory#add_separator ()); add_item main_ui ~use_values:false submenu_factory "Reset All" (Some()) (fun _ -> reset () ; main_ui#rehighlight ()); ignore (submenu_factory#add_separator ()); add_item main_ui ~use_values:false submenu_factory "Help" (Some()) (fun _ -> help main_ui) ; end let filetree_decorate main_ui = main_ui#file_tree#append_pixbuf_column ~title:"Scope" (fun globs -> let icons = function | GFun ({svar = v }, _) -> (try Kf_containing_highlighted_stmt.find (Globals.Functions.get v) with Not_found -> Datatype.String.Set.empty) | _ -> Datatype.String.Set.empty in let ids = if Kf_containing_highlighted_stmt.length () <> 0 then let icons = List.fold_left (fun acc glob -> Datatype.String.Set.union (icons glob) acc) Datatype.String.Set.empty globs in if Datatype.String.Set.is_empty icons then Datatype.String.Set.singleton "" else icons else Datatype.String.Set.singleton "" in let icons = if Datatype.String.Set.mem default_icon_name ids then [default_icon_name] else Datatype.String.Set.elements (Datatype.String.Set.remove default_icon_name ids) in List.map (fun icon -> `STOCK_ID icon) icons ) (fun _ -> Kf_containing_highlighted_stmt.length () <>0) let main main_ui = main_ui#register_source_selector selector; main_ui#register_source_highlighter highlighter; update_column := (filetree_decorate main_ui) let () = Design.register_extension main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/scope/zones.ml�����������������������������������������������������0000666�0000000�0000000�00000034350�13571573400�016271� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module R = Datascope.R let debug1 fmt = R.debug ~level:1 fmt let debug2 fmt = R.debug ~level:2 fmt open Cil_datatype open Cil_types type t_zones = Locations.Zone.t Stmt.Hashtbl.t module Data = struct type t = Locations.Zone.t let bottom = Locations.Zone.bottom let equal = Locations.Zone.equal let intersects = Locations.Zone.valid_intersects let merge = Locations.Zone.join (* over-approx *) let diff = Locations.Zone.diff (* over-approx *) let pretty fmt z = Format.fprintf fmt "@[<h 1>%a@]" Locations.Zone.pretty z let exp_zone stmt exp = !Db.From.find_deps_no_transitivity stmt exp end module Ctx = struct type t = Data.t Stmt.Hashtbl.t let create = Stmt.Hashtbl.create let find = Stmt.Hashtbl.find let add ctx k d = let d = try let old_d = find ctx k in Data.merge old_d d with Not_found -> d in Stmt.Hashtbl.replace ctx k d (* let mem = Stmt.Hashtbl.mem : useless because Ctx has to be initialized to bot *) let _pretty fmt infos = Stmt.Hashtbl.iter (fun k d -> Format.fprintf fmt "Stmt:%d -> %a@\n" k.sid Data.pretty d) infos end let compute_new_data old_zone l_zone l_dpds exact r_dpds = if (Data.intersects old_zone l_zone) then let zone = if exact then Data.diff old_zone l_zone else old_zone in let zone = Data.merge zone l_dpds in let zone = Data.merge zone r_dpds in (true, zone) else (false, old_zone) (* the call result can be processed like a normal assignment *) let process_call_res data stmt lvaloption froms = let data = match lvaloption with | None -> false, data | Some lval -> let ret_dpds = froms.Function_Froms.deps_return in let r_dpds = Function_Froms.Memory.collapse_return ret_dpds in let r_dpds = Function_Froms.Deps.to_zone r_dpds in let l_dpds, exact, l_zone = Datascope.get_lval_zones ~for_writing:true stmt lval in compute_new_data data l_zone l_dpds exact r_dpds in data (* we need [data_after] zone after the call, so we need to add the dpds * of each output that intersects this zone. * Moreover, we need to add the part of [data_after] that has not been * modified for sure. *) let process_froms data_after froms = let from_table = froms.Function_Froms.deps_table in let process_out_call out deps (to_prop, used, new_data) = let out_dpds = Function_Froms.DepsOrUnassigned.to_zone deps in let default = Function_Froms.DepsOrUnassigned.may_be_unassigned deps in let exact = not default in (* be careful to compare out with data_after and not new_data *) if (Data.intersects data_after out) then let to_prop = if exact then Data.diff to_prop out else to_prop in let new_data = Data.merge new_data out_dpds in (to_prop, true, new_data) else (to_prop, used, new_data) in let to_prop = (* part of data_after that we need to compute before call : * = data_after minus all exact outputs. * Don't use [data_after - (merge out)] to avoid approximation in merge *) data_after in let new_data = Data.bottom in (* add out_dpds when out intersects data_after*) let used = false in (* is the call needed ? *) let to_prop, used, new_data = match from_table with | Function_Froms.Memory.Bottom -> to_prop, used, new_data | Function_Froms.Memory.Top -> let v = Function_Froms.DepsOrUnassigned.top in process_out_call Locations.Zone.top v (to_prop, used, new_data) | Function_Froms.Memory.Map m -> Function_Froms.Memory.fold process_out_call m (to_prop, used, new_data) in let data = Data.merge to_prop new_data in (used, data) let process_call_args data called_kf stmt args = let param_list = Kernel_function.get_formals called_kf in let asgn_arg_to_param data param arg = let param_zone = Locations.zone_of_varinfo param in let arg_dpds = Data.exp_zone stmt arg in let exact = true in (* param is always a variable so asgn is exact *) let _used, data = compute_new_data data param_zone Data.bottom exact arg_dpds in (* can ignore 'used' because if we need param, we already know that the * call is needed *) data in let rec do_param_arg data param_list args = match param_list, args with | [], [] -> data | p :: param_list, a :: args -> let data = asgn_arg_to_param data p a in do_param_arg data param_list args | [], _ -> (* call to a variadic function *) (* warning already sent during 'from' computation. *) (* TODO : merge the remaining args in data ?... *) data | _, [] -> R.abort "call to a function with to few arguments" in do_param_arg data param_list args let process_one_call data stmt lvaloption froms = let res_used, data = process_call_res data stmt lvaloption froms in let out_used, data = process_froms data froms in let used = res_used || out_used in used, data let process_call data_after stmt lvaloption funcexp args _loc = let funcexp_dpds, called_functions = !Db.Value.expr_to_kernel_function (Kstmt stmt) ~deps:(Some Data.bottom) funcexp in let used, data = try let froms = !Db.From.Callwise.find (Kstmt stmt) in process_one_call data_after stmt lvaloption froms with Not_found -> (* don't have callwise (-calldeps option) *) let do_call kf acc = (* notice that we use the same old data for each possible call *) (process_one_call data_after stmt lvaloption (!Db.From.get kf))::acc in let l = Kernel_function.Hptset.fold do_call called_functions [] in (* in l, we have one result for each possible function called *) List.fold_left (fun (acc_u,acc_d) (u,d) -> (acc_u || u), Data.merge acc_d d) (false, Data.bottom) l in if used then let data = (* no problem of order because parameters are disjoint for sure *) Kernel_function.Hptset.fold (fun kf data -> process_call_args data kf stmt args) called_functions data in let data = Data.merge funcexp_dpds data in used, data else begin assert (R.verify (Data.equal data data_after) "if statement not used, data doesn't change !"); used, data end module Computer (Param:sig val states : Ctx.t end) = struct let name = "Zones" let debug = false let used_stmts = ref [] let add_used_stmt stmt = used_stmts := stmt :: !used_stmts let get_and_reset_used_stmts () = let stmts = !used_stmts in used_stmts := [] ; stmts type t = Data.t let pretty = Data.pretty module StmtStartData = struct type data = t let clear () = Stmt.Hashtbl.clear Param.states let mem = Stmt.Hashtbl.mem Param.states let find = Stmt.Hashtbl.find Param.states let replace = Stmt.Hashtbl.replace Param.states let add = Stmt.Hashtbl.add Param.states let iter f = Stmt.Hashtbl.iter f Param.states let length () = Stmt.Hashtbl.length Param.states end let combineStmtStartData _stmt ~old new_ = if Data.equal new_ old then None else Some new_ let combineSuccessors = Data.merge let doStmt _stmt = Dataflow2.Default let do_assign stmt lval exp data = let l_dpds, exact, l_zone = Datascope.get_lval_zones ~for_writing:true stmt lval in let r_dpds = Data.exp_zone stmt exp in let used, data = compute_new_data data l_zone l_dpds exact r_dpds in let _ = if used then add_used_stmt stmt in data let doInstr stmt instr data = match instr with | Set (lval, exp, _) -> Dataflow2.Done (do_assign stmt lval exp data) | Local_init (v, AssignInit i, _) -> let rec aux lv i acc = match i with | SingleInit e -> do_assign stmt lv e data | CompoundInit(ct, initl) -> let implicit = true in let doinit o i _ data = aux (Cil.addOffsetLval o lv) i data in Cil.foldLeftCompound ~implicit ~doinit ~ct ~initl ~acc in Dataflow2.Done (aux (Cil.var v) i data) | Call (lvaloption,funcexp,args,loc) -> let used, data = process_call data stmt lvaloption funcexp args loc in let _ = if used then add_used_stmt stmt in Dataflow2.Done data | Local_init(v, ConsInit(f, args, k), l) -> let used, data = Cil.treat_constructor_as_func (process_call data stmt) v f args k l in if used then add_used_stmt stmt; Dataflow2.Done data | Skip _ | Code_annot _ | Asm _ -> Dataflow2.Default let filterStmt _stmt _next = true let funcExitData = Data.bottom end let compute_ctrl_info pdg ctrl_part used_stmts = let module CtrlComputer = Computer (struct let states = ctrl_part end) in let module CtrlCompute = Dataflow2.Backwards(CtrlComputer) in let seen = Stmt.Hashtbl.create 50 in let rec add_node_ctrl_nodes new_stmts node = let ctrl_nodes = !Db.Pdg.direct_ctrl_dpds pdg node in List.fold_left add_ctrl_node new_stmts ctrl_nodes and add_ctrl_node new_stmts ctrl_node = debug2 "[zones] add ctrl node %a@." PdgTypes.Node.pretty ctrl_node; match PdgTypes.Node.stmt ctrl_node with | None -> (* node without stmt : add its ctrl_dpds *) add_node_ctrl_nodes new_stmts ctrl_node | Some stmt -> debug2 "[zones] node %a is stmt %d@." PdgTypes.Node.pretty ctrl_node stmt.sid; if Stmt.Hashtbl.mem seen stmt then new_stmts else let ctrl_zone = match stmt.skind with | Switch (exp,_,_,_) | If (exp,_,_,_) -> Data.exp_zone stmt exp | _ -> Data.bottom in Ctx.add ctrl_part stmt ctrl_zone; Stmt.Hashtbl.add seen stmt (); debug2 "[zones] add ctrl zone %a at stmt %d@." Data.pretty ctrl_zone stmt.sid; stmt::new_stmts and add_stmt_ctrl new_stmts stmt = debug1 "[zones] add ctrl of stmt %d@." stmt.sid; if Stmt.Hashtbl.mem seen stmt then new_stmts else begin Stmt.Hashtbl.add seen stmt (); match !Db.Pdg.find_simple_stmt_nodes pdg stmt with | [] -> [] | n::_ -> add_node_ctrl_nodes new_stmts n end in let rec add_stmts_ctrl stmts all_used_stmts = let all_used_stmts = stmts @ all_used_stmts in let new_stmts = List.fold_left add_stmt_ctrl [] stmts in let preds = List.fold_left (fun acc s -> s.preds @ acc) [] new_stmts in if preds <> [] then CtrlCompute.compute preds; let used_stmts = CtrlComputer.get_and_reset_used_stmts () in if used_stmts = [] then all_used_stmts else add_stmts_ctrl used_stmts all_used_stmts in add_stmts_ctrl used_stmts [] let compute kf stmt lval = let f = Kernel_function.get_definition kf in let dpds, _exact, zone = Datascope.get_lval_zones ~for_writing:false stmt lval in let zone = Data.merge dpds zone in debug1 "[zones] build for %a before %d in %a@\n" Data.pretty zone stmt.sid Kernel_function.pretty kf; let data_part = Ctx.create 50 in List.iter (fun s -> Ctx.add data_part s Data.bottom) f.sallstmts; let _ = Ctx.add data_part stmt zone in let module DataComputer = Computer (struct let states = data_part end) in let module DataCompute = Dataflow2.Backwards(DataComputer) in let _ = DataCompute.compute stmt.preds in let ctrl_part = data_part (* Ctx.create 50 *) in (* it is confusing to have 2 part in the provided information, * because in fact, it means nothing to separate them. * So let's put everything in the same object *) let used_stmts = DataComputer.get_and_reset_used_stmts () in let all_used_stmts = if used_stmts = [] then [] else compute_ctrl_info (!Db.Pdg.get kf) ctrl_part used_stmts in let all_used_stmts = List.fold_left (fun e acc -> Stmt.Hptset.add acc e) Stmt.Hptset.empty all_used_stmts in all_used_stmts, data_part let get stmt_zones stmt = try Ctx.find stmt_zones stmt with Not_found -> Data.bottom let pretty fmt stmt_zones = let pp s d = Format.fprintf fmt "Stmt:%d -> %a@." s.sid Data.pretty d in (* Sort output so that it does not depend on the OCaml hash function. Can be removed when OCaml 4.01 is mandatory *) let sorted = Stmt.Hashtbl.fold Stmt.Map.add stmt_zones Stmt.Map.empty in Stmt.Map.iter pp sorted (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let build_zones = (* TODO: Journal.register *) (* (Datatype.func Kernel_type.kernel_function (Datatype.func Kernel_type.stmt (Datatype.func Kernel_type.lval (Datatype.couple Kernel_type.stmt_set zones_ty))))) *) compute let get_zones = (* TODO: Journal.register *) (*(Datatype.func zones_ty (Datatype.func Kernel_type.stmt data_ty)))*) get let pretty_zones = (* TODO: Journal.register *) (*( Datatype.func Datatype.formatter (Datatype.func zones_ty Datatype.unit)))*) pretty ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/scope/zones.mli����������������������������������������������������0000666�0000000�0000000�00000003553�13571573400�016443� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype type t_zones = Locations.Zone.t Stmt.Hashtbl.t val build_zones : kernel_function -> stmt -> lval -> Stmt.Hptset.t * t_zones val pretty_zones : Format.formatter -> t_zones -> unit val get_zones : t_zones -> Cil_types.stmt -> Locations.Zone.t �����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/��������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017042� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/Makefile.in���������������������������������������0000666�0000000�0000000�00000004720�13571573400�021112� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif PLUGIN_DIR ?=. PLUGIN_ENABLE:=@ENABLE_SECURITY_SLICING@ PLUGIN_NAME:=Security_slicing PLUGIN_CMO:= security_slicing_parameters components PLUGIN_GUI_CMO:= register_gui PLUGIN_UNDOC:= analysis PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure PLUGIN_NO_TEST:=yes include $(FRAMAC_SHARE)/Makefile.dynamic # Regenerating the Makefile on need ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif $(Security_slicing_DIR)/Makefile: $(Security_slicing_DIR)/Makefile.in \ $(CONFIG_STATUS_DIR)/config.status cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ ������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/Security_slicing.mli������������������������������0000666�0000000�0000000�00000003372�13571573400�023071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Security slicing. *) (** No function is directly exported: they are dynamically registered. *) (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/components.ml�������������������������������������0000666�0000000�0000000�00000077277�13571573400�021605� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype (* ************************************************************************* *) (** {2 Searching security annotations} *) (* ************************************************************************* *) (* (** The state of statement for which a security verification should occur. *) module Security_Annotations = Cil_computation.StmtSetRef (struct let name = "Components.Annotations" let dependencies = [ Ast.self ] end) let rec is_security_predicate p = match p.content with | Pand(p1, p2) -> is_security_predicate p1 || is_security_predicate p2 | (* [state(lval) op term] *) Prel(_, { term_node = Tapp(f1, _ , ([ _ ])) }, { term_node = TLval(TVar _,_) }) when f1.l_var_info.lv_name = Model.state_name -> true | (* [state(lval) op term] *) Prel(_, { term_node = Tapp(f1, _, [ _ ]) }, { term_node = _ }) when f1.l_var_info.lv_name = Model.state_name -> assert false | _ -> false let has_security_requirement kf = List.exists (is_security_predicate $ Logic_const.pred_of_id_pred) (Kernel_function.get_spec kf).spec_requires (* Do not called twice. *) let search_security_requirements () = if Security_Annotations.is_empty () then begin Security_slicing_parameters.feedback ~level:3 "searching security annotations"; (* TODO: chercher dans les GlobalAnnotations *) let is_security_annotation a = (match a.annot_content with | AAssert (_behav,p,_) -> is_security_predicate p | AStmtSpec { spec_requires = l } -> List.exists (is_security_predicate $ Logic_const.pred_of_id_pred) l | APragma _ | AInvariant _ (* | ALoopBehavior _ *) (* [JS 2008/02/26] may contain a security predicate *) | AVariant _ | AAssigns _ -> false) in Annotations.iter (fun s annotations -> if Value.is_reachable_stmt s && List.exists (function Before a | After a -> is_security_annotation a) !annotations then Security_Annotations.add s); Globals.Functions.iter (fun kf -> if has_security_requirement kf then List.iter (fun (_, callsites) -> List.iter Security_Annotations.add callsites) (!Value.callers kf)); end *) (* ************************************************************************* *) (** {2 Computing security components} *) (* ************************************************************************* *) open PdgIndex let get_node_stmt node = Key.stmt (!Db.Pdg.node_key node) module NodeKf = Datatype.Pair(PdgTypes.Node)(Kernel_function) (* type bwd_kind = Direct | Indirect type fwd_kind = Impact | Security type kind = | Backward of bwd_kind | Forward of fwd_kind (** Debugging purpose only *) let pretty_kind fmt = function | Backward Direct -> Format.fprintf fmt "backward direct" | Backward Indirect -> Format.fprintf fmt "backward indirect" | Forward Security -> Format.fprintf fmt "forward" | Forward Impact -> Format.fprintf fmt "impact" *) (* Never plugged in. To be tested. module Memo : sig val init: kind -> kernel_function -> unit val push_function: stmt -> kernel_function -> unit val pop_function: unit -> unit val memo: Pdg.t_node -> (unit -> (Pdg.t_node * kernel_function) list) -> (Pdg.t_node * kernel_function) list end = struct module Callstack = struct type t = { mutable stack: (stmt * kernel_function) list; mutable current_kf: kernel_function } let init kf callstack = callstack.stack <- []; callstack.current_kf <- kf let push stmt kf stack = stack.stack <- (stmt, stack.current_kf) :: stack.stack; stack.current_kf <- kf let pop stack = let kf = match stack.stack with [] -> assert false | (_, k) :: _ -> k in stack.current_kf <- kf let equal s1 s2 = Kernel_function.equal s1.current_kf s2.current_kf && try List.iter2 (fun (s1, kf1) (s2, kf2) -> if not (s1.sid = s2.sid && Kernel_function.equal kf1 kf2) then raise Exit) s1.stack s2.stack; true with Exit -> false let hash = Hashtbl.hash end (* *********************************************************************** *) (* state: kind -> callstack -> (node * kf) -> (node * kf) list *) module Nodekfs = Hashtbl.Make(NodeKf) (* (node * kf) -> (node * kf) list *) module Callstacks = struct include Hashtbl.Make(Callstack) (* callstack -> nodekfs *) let memo tbl c = try find tbl c with Not_found -> let t = Nodekfs.create 7 in replace tbl c t; t end module Memo = struct include Hashtbl let memo tbl k callstack = try let callstacks = find tbl k in Callstacks.memo callstacks callstack with Not_found -> let callstacks = Callstacks.create 7 in let t = Nodekfs.create 7 in Callstacks.replace callstacks callstack t; replace tbl k callstacks; t end type local_tbl = (Pdg.t_node * kernel_function) list Nodekfs.t type state = { mutable kind: kind; mutable callstack: Callstack.t; mutable local_tbl: local_tbl; memo_tbl: (kind, local_tbl Callstacks.t) Memo.t; } (* *********************************************************************** *) let state = let spec = Cil.empty_funspec () in { kind = Backward Direct; callstack = { Callstack.stack = []; current_kf = { fundec = (* do not use Cil.emptyFunction here since it changes the numbering of variables *) Declaration (spec, Cil_datatype.Varinfo.dummy, None, Cil_datatype.Location.unknown); return_stmt = None; spec = Cil.empty_funspec () } }; local_tbl = Nodekfs.create 0; memo_tbl = Hashtbl.create 5 } let update () = state.local_tbl <- Memo.memo state.memo_tbl state.kind state.callstack let init k kf = state.kind <- k; Callstack.init kf state.callstack; update () let push_function stmt kf = Callstack.push stmt kf state.callstack; update () let pop_function () = Callstack.pop state.callstack; update () let memo node f = let key = node, state.callstack.Callstack.current_kf in try Nodekfs.find state.local_tbl key with Not_found -> let value = f () in Nodekfs.replace state.local_tbl key value; value end *) (* used to enforce an invariant on [add] *) module Todolist : sig type todo = private { node: PdgTypes.Node.t; kf: kernel_function; pdg: Db.Pdg.t; callstack_length: int; from_deep: bool } type t = todo list val mk_init: kernel_function -> Db.Pdg.t -> PdgTypes.Node.t list -> todo list val add: PdgTypes.Node.t -> kernel_function -> Db.Pdg.t -> int -> bool -> t -> t end = struct type todo = { node: PdgTypes.Node.t; kf: kernel_function; pdg: Db.Pdg.t; callstack_length: int; from_deep: bool } type t = todo list let add n kf pdg len fd list = match !Db.Pdg.node_key n with | Key.SigKey (Signature.In Signature.InCtrl) -> (* do not consider node [InCtrl] *) list | Key.VarDecl vi when not (Kernel.LibEntry.get () && vi.vglob) -> (* do not consider variable declaration, except if libEntry is set and they are globals (i.e. we could have no further info about them) *) list | _ -> Security_slicing_parameters.debug ~level:2 "adding node %a (in %s)" (!Db.Pdg.pretty_node false) n (Kernel_function.get_name kf); { node = n; kf = kf; pdg = pdg; callstack_length = len; from_deep = fd } :: list let mk_init kf pdg = List.fold_left (fun acc n -> add n kf pdg 0 false acc) [] end module Component = struct (* not optimal implementation: no memoization (bts#006) *) module M = FCMap.Make(NodeKf) type fwd_kind = Impact | Security type kind = | Direct | Indirect_Backward | Forward of fwd_kind type value = { pdg: Db.Pdg.t; mutable callstack_length: int; mutable direct: bool; mutable indirect_backward: bool; mutable forward: bool } type t = value M.t let is_direct v = v.direct let is_indirect_backward v = v.indirect_backward && not v.direct let is_forward v = not (v.direct || v.indirect_backward) (** Returns [found, new_already] with: - [found] is [true] iff [elt] was previously added for [kind] - [new_already] is [already] updated with [elt] and its (new) associated value. *) let check_and_add first elt kind pdg len (already: t) = try (* Format.printf "[security] check node %a (in %s, kind %a)@." (!Pdg.pretty_node true) (fst elt) (Kernel_function.get_name (snd elt)) pretty_kind kind;*) let v = M.find elt already in let found, dir, up, down = match kind with | Direct -> true, true, false, false | Indirect_Backward -> v.indirect_backward, v.direct, true, false | Forward _ -> v.forward, v.direct, v.indirect_backward, true in v.callstack_length <- min v.callstack_length len; v.direct <- dir; v.indirect_backward <- up; v.forward <- down; found, already with Not_found -> let dir, up, down = match kind with | Direct -> true, false, false | Indirect_Backward -> false, true, false | Forward _ -> false, false, true in let v = { pdg = pdg; callstack_length = len; direct = dir; indirect_backward = up; forward = down } in false, if first && kind = Forward Impact then (* do not add the initial selected stmt for an impact analysis. fixed FS#411 *) already else M.add elt v already let one_step_related_nodes kind pdg node = (* do not consider address dependencies now (except for impact analysis): just consider them during the last slicing pass (for semantic preservation of pointers) *) let direct node = !Db.Pdg.direct_data_dpds pdg node in match kind with | Direct -> direct node | Indirect_Backward -> direct node @ !Db.Pdg.direct_ctrl_dpds pdg node | Forward Security -> !Db.Pdg.direct_data_uses pdg node @ !Db.Pdg.direct_ctrl_uses pdg node | Forward Impact -> !Db.Pdg.direct_data_uses pdg node @ !Db.Pdg.direct_ctrl_uses pdg node @ !Db.Pdg.direct_addr_uses pdg node let search_input kind kf lazy_l = try match kind with | Forward _ -> Lazy.force lazy_l | Direct | Indirect_Backward -> if !Db.Value.use_spec_instead_of_definition kf then Lazy.force lazy_l else [] with Not_found -> [] let add_from_deep caller todo n = Todolist.add n caller (!Db.Pdg.get caller) 0 true todo let forward_caller kf node todolist = let pdg = !Db.Pdg.get kf in List.fold_left (fun todolist (caller, callsites) -> (* foreach caller *) List.fold_left (fun todolist callsite -> let nodes = !Db.Pdg.find_call_out_nodes_to_select pdg (PdgTypes.NodeSet.singleton node) (!Db.Pdg.get caller) callsite in List.fold_left (add_from_deep caller) todolist nodes) todolist callsites) todolist (!Db.Value.callers kf) let related_nodes_of_nodes kind result nodes = let initial_nodes = List.map (fun n -> n.Todolist.node, n.Todolist.kf) nodes in let rec aux first result = function | [] -> result | { Todolist.node = node; kf = kf; pdg = pdg; callstack_length = callstack_length; from_deep = from_deep } :: todolist -> let elt = node, kf in let found, result = check_and_add first elt kind pdg callstack_length result in let todolist = if found then begin todolist end else begin Security_slicing_parameters.debug ~level:2 "considering node %a (in %s)" (!Db.Pdg.pretty_node false) node (Kernel_function.get_name kf); (* intraprocedural related_nodes *) let related_nodes = one_step_related_nodes kind pdg node in Security_slicing_parameters.debug ~level:3 "intraprocedural part done"; let todolist = List.fold_left (fun todo n -> Todolist.add n kf pdg callstack_length false todo) todolist related_nodes in (* interprocedural part *) let backward_from_deep compute_nodes = (* [TODO optimisation:] en fait, regarder from_deep: si vrai, faire pour chaque caller sinon, faire uniquement pour le caller d'où on vient *) match kind, callstack_length with | (Direct | Indirect_Backward), 0 -> (* input of a deep security annotation: foreach call to [kf], compute its related nodes *) let do_caller todolist (caller, callsites) = (* Format.printf "[security of %s] search callers in %s for zone %a@." (Kernel_function.get_name kf) (Kernel_function.get_name caller) Locations.Zone.pretty zone;*) let pdg_caller = !Db.Pdg.get caller in let do_call todolist callsite = match kind with | Direct | Indirect_Backward -> let nodes = compute_nodes pdg_caller callsite in List.fold_left (add_from_deep caller) todolist nodes | Forward _ -> todolist (* not considered here, see at end *) in List.fold_left do_call todolist callsites in List.fold_left do_caller todolist (!Db.Value.callers kf) | _ -> todolist in let todolist = match !Db.Pdg.node_key node with | Key.SigKey (Signature.In Signature.InCtrl) -> assert false | Key.SigKey (Signature.In (Signature.InImpl zone)) -> let compute_nodes pdg_caller callsite = let nodes, _undef_zone = !Db.Pdg.find_location_nodes_at_stmt pdg_caller callsite ~before:true zone (* TODO : use undef_zone (see FS#201)? *) in let nodes = List.map (fun (n, _z_part) -> n) nodes in (* TODO : use _z_part ? *) nodes in backward_from_deep compute_nodes | Key.SigKey key -> let compute_nodes pdg_caller callsite = [ match key with | Signature.In (Signature.InNum n) -> !Db.Pdg.find_call_input_node pdg_caller callsite n | Signature.Out Signature.OutRet -> !Db.Pdg.find_call_output_node pdg_caller callsite | Signature.In (Signature.InCtrl | Signature.InImpl _) | Signature.Out _ -> assert false ] in backward_from_deep compute_nodes | Key.SigCallKey(id, key) -> (* the node is a call: search the related nodes inside the called function (see FS#155) *) if from_deep then (* already come from a deeper annotation: do not go again inside it *) todolist else let stmt = Key.call_from_id id in let called_kfs = Kernel_function.Hptset.elements (try Db.Value.call_to_kernel_function stmt with Db.Value.Not_a_call -> assert false) in let todolist = List.fold_left (fun todolist called_kf -> (* foreach called kf *) (*Format.printf "[security] search inside %s (from %s)@." (Kernel_function.get_name called_kf) (Kernel_function.get_name kf);*) let called_pdg = !Db.Pdg.get called_kf in let nodes = try match kind, key with | (Direct | Indirect_Backward), Signature.Out out_key -> let nodes, _undef_zone = !Db.Pdg.find_output_nodes called_pdg out_key (* TODO: use undef_zone (see FS#201) *) in let nodes = List.map (fun (n, _z_part) -> n) nodes in (* TODO : use _z_part ? *) nodes | _, Signature.In (Signature.InNum n) -> search_input kind called_kf (lazy [!Db.Pdg.find_input_node called_pdg n]) | _, Signature.In Signature.InCtrl -> search_input kind called_kf (lazy [!Db.Pdg.find_entry_point_node called_pdg]) | _, Signature.In (Signature.InImpl _) -> assert false | Forward _, Signature.Out _ -> [] with | Db.Pdg.Top -> Security_slicing_parameters.warning "no precise pdg for function %s. \n\ Ignoring this function in the analysis (potentially incorrect results)." (Kernel_function.get_name called_kf); [] | Db.Pdg.Bottom | Not_found -> assert false in List.fold_left (fun todo n -> (*Format.printf "node %a inside %s@." (!Db.Pdg.pretty_node false) n (Kernel_function.get_name called_kf);*) Todolist.add n called_kf called_pdg (callstack_length + 1) false todo) todolist nodes) todolist called_kfs in (match kind with | Direct | Indirect_Backward -> todolist | Forward _ -> List.fold_left (fun todolist called_kf -> let compute_from_stmt fold = fold (fun (n, kfn) _ acc -> if Kernel_function.equal kfn kf then n :: acc else acc) in let from_stmt = compute_from_stmt M.fold result [] in let from_stmt = (* initial nodes may be not in results *) compute_from_stmt (fun f e acc -> List.fold_left (fun acc e -> f e [] acc) acc e) initial_nodes from_stmt in let from_stmt = List.fold_left (fun s n -> PdgTypes.NodeSet.add n s) PdgTypes.NodeSet.empty from_stmt in let called_pdg = !Db.Pdg.get called_kf in let nodes = try !Db.Pdg.find_in_nodes_to_select_for_this_call pdg from_stmt stmt called_pdg with | Db.Pdg.Top -> (* warning already emitted in the previous fold *) [] | Db.Pdg.Bottom | Not_found -> assert false in List.fold_left (fun todo n -> Todolist.add n called_kf called_pdg (callstack_length + 1) false todo) todolist nodes) todolist called_kfs) | Key.CallStmt _ | Key.VarDecl _ -> assert false | Key.Stmt _ | Key.Label _ -> todolist in (* [TODO optimisation:] voir commentaire plus haut *) match kind with | (Direct | Indirect_Backward) -> todolist | Forward _ -> forward_caller kf node todolist end in (* recursive call *) aux false result todolist in aux true result nodes let initial_nodes kf stmt = Security_slicing_parameters.debug ~level:3 "computing initial nodes for %d" stmt.sid; let pdg = !Db.Pdg.get kf in let nodes = if Db.Value.is_reachable_stmt stmt then try !Db.Pdg.find_simple_stmt_nodes pdg stmt with Not_found -> assert false else begin Security_slicing_parameters.debug ~level:3 "stmt %d is dead. skipping." stmt.sid; [] end in Todolist.mk_init kf pdg nodes let direct kf stmt = try let nodes = initial_nodes kf stmt in Security_slicing_parameters.debug "computing direct component %d" stmt.sid; let res = related_nodes_of_nodes Direct M.empty nodes in (* add the initial node, fix FS#180 *) let mk p = { pdg = p; callstack_length = 0; direct = true; indirect_backward = false; forward = false } in let res = List.fold_left (fun acc { Todolist.node=n; kf=f; pdg=p } -> M.add (n,f) (mk p) acc) res nodes in res with Db.Pdg.Top | Db.Pdg.Bottom -> Security_slicing_parameters.warning "PDG is not manageable. skipping."; M.empty let backward kf stmt = try let nodes = initial_nodes kf stmt in let res = direct kf stmt in Security_slicing_parameters.debug "computing backward indirect component for %d" stmt.sid; related_nodes_of_nodes Indirect_Backward res nodes with Db.Pdg.Top | Db.Pdg.Bottom -> Security_slicing_parameters.warning "PDG is not manageable. skipping."; M.empty let whole kf stmt = let res = backward kf stmt in let from = M.fold (fun (n,kf) v acc -> Todolist.add n kf v.pdg v.callstack_length false(*?*) acc) res [] in Security_slicing_parameters.debug "computing forward component for stmt %d" stmt.sid; related_nodes_of_nodes (Forward Security) res from (* is exactly an impact analysis iff [fwd_kind = Impact] *) let forward fwd_kind kf stmt = let nodes = initial_nodes kf stmt in Security_slicing_parameters.debug "computing forward component for stmt %d" stmt.sid; let res = related_nodes_of_nodes (Forward fwd_kind) M.empty nodes in let set = M.fold (fun (n,_) _ acc -> Extlib.may_map ~dft:acc (fun s -> Stmt.Set.add s acc) (get_node_stmt n)) res Stmt.Set.empty in Stmt.Set.elements set let get_component kind stmt = let kf = Kernel_function.find_englobing_kf stmt in let action, check = match kind with | Direct -> direct, is_direct | Indirect_Backward -> backward, is_indirect_backward | Forward _ -> whole, is_forward in let set = M.fold (fun (n,_) v acc -> if check v then Extlib.may_map ~dft:acc (fun s -> Stmt.Set.add s acc) (get_node_stmt n) else acc) (action kf stmt) Stmt.Set.empty in Stmt.Set.elements set (* let iter use_ctrl_dpds f kf stmt = let action = if use_ctrl_dpds then whole else direct in M.iter (fun elt _ -> f elt) (action kf stmt) *) end (* ************************************************************************ *) (* Dynamic registration *) (* ************************************************************************ *) let register name arg = Dynamic.register ~journalize:true ~plugin:"Security_slicing" name (Datatype.func Stmt.ty (Datatype.list Stmt.ty)) (Component.get_component arg) let get_direct_component = register "get_direct_component" Component.Direct let get_indirect_backward_component = register "get_indirect_backward_component" Component.Indirect_Backward let get_forward_component = register "get_forward_component" (Component.Forward Component.Security) let impact_analysis = Dynamic.register ~plugin:"Security_slicing" "impact_analysis" ~journalize:true (Datatype.func2 Kernel_function.ty Stmt.ty (Datatype.list Stmt.ty)) (Component.forward Component.Impact) (* ************************************************************************ *) (* (* type t = stmt *) (** Security component table: a security component is represented by the statement at which a security verification should occur. It is associated with the list of its statements. *) module Components : sig (*val add: t -> stmt -> unit val find: t -> stmt list val self: State.t val fold_fold: ('b -> t -> 'a -> 'b) -> ('a -> Cil_types.stmt -> 'a) -> 'b -> 'a -> 'b *) end = struct module S = State_builder.Hashtbl (Stmt.Hashtbl) (Datatype.Ref(Datatype.List(Stmt))) (struct let name = "Components" let size = 7 let dependencies = [ Ast.self; Db.Value.self ] end) let () = Cmdline.run_after_extended_stage (fun () -> State_dependency_graph.add_codependencies ~onto:S.self [ !Db.Pdg.self ]) (* let add c = let l = S.memo (fun _ -> ref []) c in fun s -> l := s :: !l let find s = !(S.find s) let self = S.self let fold_fold f g init_f init_g = S.fold (fun c l acc -> f acc c (List.fold_left g init_g !l)) init_f *) end module Nodes = State_builder.SetRef (struct include NodeKf.Datatype let compare = NodeKf.compare end) (struct let name = "Components.Nodes" let dependencies = [ Security_Annotations.self ] end) let use_ctrl_dependencies = ref false (** Set tables [Components] and [Stmts]. *) let compute, self = State_builder.apply_once "Components.compute" [ Security_Annotations.self ] (fun () -> search_security_requirements (); let add_component stmt = Security_slicing_parameters.debug "computing security component %d" stmt.sid; let add_one = Components.add stmt in let kf = Kernel_function.find_englobing_kf stmt in Component.iter !use_ctrl_dependencies (fun (n, _ as elt) -> Nodes.add elt; Extlib.may add_one (get_node_stmt n)) kf stmt in Security_Annotations.iter add_component) let () = Cmdline.run_after_extended_stage (fun () -> Project.State_builder.add_dependency self !Pdg.self; Project.State_builder.add_dependency Nodes.self self; Project.State_builder.add_dependency Components.self self) let get_component = Dynamic.register ~journalize:true "Security.get_component" (Datatype.func Kernel_type.stmt (Datatype.list Kernel_type.stmt)) (fun s -> compute (); Components.find s) (* ************************************************************************ *) (** {2 Security slicing} *) (* ************************************************************************ *) let slice ctrl = use_ctrl_dependencies := ctrl; Security_slicing_parameters.feedback ~level:2 "beginning slicing"; compute (); let name = "security slicing" in let slicing = !Slicing.Project.mk_project name in let select (n, kf) sel = Security_slicing_parameters.debug ~level:2 "selecting %a (of %s)" (!Db.Pdg.pretty_node false) n (Kernel_function.get_name kf); !Slicing.Select.select_pdg_nodes sel (!Slicing.Mark.make ~data:true ~addr:true ~ctrl) [ n ] kf in let sel = Nodes.fold select Slicing.Select.empty_selects in Security_slicing_parameters.debug "adding selection"; !Slicing.Request.add_persistent_selection slicing sel; Security_slicing_parameters.debug "applying slicing request"; !Slicing.Request.apply_all_internal slicing; !Slicing.Slice.remove_uncalled slicing; let p = !Slicing.Project.extract name slicing in (* Project.copy ~only:(Options.get_selection_after_slicing ()) p;*) Security_slicing_parameters.feedback ~level:2 "slicing done"; p let slice = Dynamic.register "Security_slicing.slice" ~journalize:true (Datatype.func Datatype.bool Project.ty) slice *) (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/components.mli������������������������������������0000666�0000000�0000000�00000003656�13571573400�021744� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Security slicing. *) open Cil_types val get_direct_component: stmt -> stmt list val get_indirect_backward_component: stmt -> stmt list val get_forward_component: stmt -> stmt list val impact_analysis: Kernel_function.t -> stmt -> stmt list (* val slice: bool -> Project.t *) (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/configure�����������������������������������������0000777�0000000�0000000�00000273717�13571573400�020772� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS ENABLE_SECURITY_SLICING ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_security_slicing ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-security_slicing support for Security_slicing plug-in (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-security_slicing was given. if test "${enable_security_slicing+set}" = set; then : enableval=$enable_security_slicing; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "security_slicing is not available" "$LINENO" 5 fi FORCE_SECURITY_SLICING=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_SECURITY_SLICING ENABLE_SECURITY_SLICING=$ENABLE NAME_SECURITY_SLICING=security_slicing if test "$default" = "no" -a "$FORCE" = "no"; then INFO_SECURITY_SLICING=" (not available by default)" fi echo "security_slicing... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_SLICING=$REQUIRE_SLICING" "security_slicing REQUIRED_SECURITY_SLICING=$REQUIRED_SECURITY_SLICING" "slicing REQUIRE_EVA=$REQUIRE_EVA" "security_slicing REQUIRED_SECURITY_SLICING=$REQUIRED_SECURITY_SLICING" "eva REQUIRE_PDG=$REQUIRE_PDG" "security_slicing REQUIRED_SECURITY_SLICING=$REQUIRED_SECURITY_SLICING" "pdg REQUIRE_GUI=$REQUIRE_GUI" "security_slicing REQUIRED_SECURITY_SLICING=$REQUIRED_SECURITY_SLICING" "gui # First, initialize some variables for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` TODOLIST=$TODOLIST" "$plugin eval MARK_$plugin= eval REMEMBER_$plugin= fi done # main call compute_dependency ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi �������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/configure.ac��������������������������������������0000666�0000000�0000000�00000004317�13571573400�021335� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS],[m4_include(FRAMAC_SHARE/configure.ac)]) check_plugin(security_slicing,PLUGIN_RELATIVE_PATH(plugin_file), [support for Security_slicing plug-in],yes) plugin_require(security_slicing,slicing) plugin_require(security_slicing,eva) plugin_require(security_slicing,pdg) plugin_require(security_slicing,gui) check_plugin_dependencies write_plugin_config(Makefile) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/register_gui.ml�����������������������������������0000666�0000000�0000000�00000007701�13571573400�022071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Pretty_source open Gtk_helper open Cil_types module Make_HighlighterState(Info:sig val name: string end) = State_builder.List_ref (Cil_datatype.Stmt) (struct let name = Info.name let dependencies = [ Ast.self ] end) module ForwardHighlighterState = Make_HighlighterState(struct let name = "Security_gui.Forward" end) module IndirectBackwardHighlighterState = Make_HighlighterState(struct let name = "Security_gui.Indirectb" end) module DirectHighlighterState = Make_HighlighterState(struct let name = "Security_gui.Direct" end) let security_highlighter buffer loc ~start ~stop = let buffer = buffer#buffer in match loc with | PStmt (_,s) -> let f = ForwardHighlighterState.get () in if List.exists (fun k -> k.sid=s.sid) f then begin let tag = make_tag buffer"forward" [`BACKGROUND "orange" ] in apply_tag buffer tag start stop end; let i = IndirectBackwardHighlighterState.get () in if List.exists (fun k -> k.sid=s.sid) i then begin let tag = make_tag buffer"indirect_backward" [`BACKGROUND "cyan" ] in apply_tag buffer tag start stop end; let d = DirectHighlighterState.get () in if List.exists (fun k -> k.sid=s.sid) d then begin let tag = make_tag buffer"direct" [`BACKGROUND "green" ] in apply_tag buffer tag start stop end | PStmtStart _ | PExp _ | PVDecl _ | PTermLval _ | PLval _ | PGlobal _ | PIP _ -> () let security_selector (popup_factory:GMenu.menu GMenu.factory) main_ui ~button localizable = if button = 3 && Security_slicing_parameters.Slicing.get () then match localizable with | PStmt (_kf, ki) -> ignore (popup_factory#add_item "_Security component" ~callback: (fun () -> ForwardHighlighterState.set (Components.get_forward_component ki); IndirectBackwardHighlighterState.set (Components.get_indirect_backward_component ki); DirectHighlighterState.set (Components.get_direct_component ki); main_ui#rehighlight ())) | _ -> () let main main_ui = main_ui#register_source_selector security_selector; main_ui#register_source_highlighter security_highlighter let () = Design.register_extension main (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/register_gui.mli����������������������������������0000666�0000000�0000000�00000003431�13571573400�022236� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Extension of the GUI for the security plugin. *) (** No function is directly exported: this module simply extends the GUI. *) (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/security_slicing_parameters.ml��������������������0000666�0000000�0000000�00000003742�13571573400�025204� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "security-slicing" let shortname = "security-slicing" let help = "security slicing (experimental, undocumented)" end) module Slicing = False (struct let option_name = "-security-slicing" let help = "perform the security slicing analysis" end) (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������frama-c-20.0-Calcium/src/plugins/security_slicing/security_slicing_parameters.mli�������������������0000666�0000000�0000000�00000003677�13571573400�025364� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************* *) (** {2 Security parameters} *) (* ************************************************************************* *) include Plugin.S module Slicing: Parameter_sig.Bool (** Perform the security slicing pre-analysis. *) (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014771� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/Makefile.in�������������������������������������������������0000666�0000000�0000000�00000007353�13571573400�017046� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif ################### # Plug-in Setting # ################### PLUGIN_DIR ?=. PLUGIN_ENABLE:=@ENABLE_SERVER@ PLUGIN_NAME:=Server PLUGIN_CMO:= \ server_parameters \ jbuffer \ doc syntax data main request \ server_batch \ kernel_main \ kernel_project \ kernel_ast PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure PLUGIN_TESTS_DIRS := batch PLUGIN_REQUIRES:= yojson PLUGIN_UNDOC:= server_batch.ml server_zmq.ml PLUGIN_GENERATED:= $(PLUGIN_DIR)/Server.mli ################## # ZeroMQ Support # ################## ifeq (@SERVER_ZMQ@,yes) PLUGIN_REQUIRES+= zmq PLUGIN_CMO+= server_zmq else PLUGIN_DISTRIB_EXTERNAL+= server_zmq.ml endif ################ # Generic part # ################ include $(FRAMAC_SHARE)/Makefile.dynamic ############## # Server API # ############## SERVER_API= \ doc.mli syntax.mli data.mli request.mli define Capitalize $(shell printf "%s%s" \ $$($(ECHO) $(1) | cut -c 1 | tr '[:lower:]' '[:upper:]') $$($(ECHO) $(1) | cut -c 2-)) endef define ExportModule $(ECHO) "module $(call Capitalize, $(basename $(notdir $(1)))) : sig" >> $(2); $(ECHO) '# 1 "$(1)"' >> $(2); $(CAT) $(1) >> $(2); $(ECHO) "end" >> $(2); endef SERVER_MLI=$(addprefix $(Server_DIR)/, $(SERVER_API)) $(Server_DIR)/Server.mli: $(Server_DIR)/Makefile $(SERVER_MLI) $(PRINT_MAKING) $@ "from" $(SERVER_MLI) $(RM) $@ $@.tmp $(ECHO) "(* This file is generated. Do not edit. *)" >> $@.tmp $(ECHO) "(** {b Server Public API} *)" >> $@.tmp $(foreach file,$(SERVER_MLI),$(call ExportModule,$(file),$@.tmp)) $(CHMOD_RO) $@.tmp $(MV) $@.tmp $@ ##################################### # Regenerating the Makefile on need # ##################################### ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif $(Server_DIR)/Makefile: $(Server_DIR)/Makefile.in \ $(CONFIG_STATUS_DIR)/config.status cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/configure���������������������������������������������������0000777�0000000�0000000�00000277035�13571573400�016716� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS SERVER_ZMQ HAS_OCAML_ZMQ OCAML_ZMQ ENABLE_SERVER ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_server enable_server_zmq ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-server Server plug-in (default: yes) --enable-server-zmq Server ZeroMQ support (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-server was given. if test "${enable_server+set}" = set; then : enableval=$enable_server; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "server is not available" "$LINENO" 5 fi FORCE_SERVER=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_SERVER ENABLE_SERVER=$ENABLE NAME_SERVER=server if test "$default" = "no" -a "$FORCE" = "no"; then INFO_SERVER=" (not available by default)" fi echo "server... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ######################################## # Server ZMQ Configuration # ######################################## # Check whether --enable-server-zmq was given. if test "${enable_server_zmq+set}" = set; then : enableval=$enable_server_zmq; SERVER_ZMQ=$enableval else SERVER_ZMQ=yes fi if test "$SERVER_ZMQ" = "yes" ; then HAS_OCAML_ZMQ= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCaml package zmq" >&5 $as_echo_n "checking for OCaml package zmq... " >&6; } OCAML_ZMQ=$(ocamlfind query zmq -format %v 2>/dev/null) if test -z "$OCAML_ZMQ" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found via ocamlfind." >&5 $as_echo "not found via ocamlfind." >&6; } HAS_OCAML_ZMQ=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 $as_echo "found." >&6; } HAS_OCAML_ZMQ=yes fi USE_OCAML_ZMQ=$USE_OCAML_ZMQ" "server SERVER_ZMQ=$HAS_OCAML_ZMQ fi ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi if test -n "$REQUIRE_OCAML_ZMQ" -o -n "$USE_OCAML_ZMQ" -o "$force_check" = "yes"; then if test "$HAS_OCAML_ZMQ" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Server support for ZeroMQ disabled (try 'opam install zmq')." >&5 $as_echo "$as_me: WARNING: Server support for ZeroMQ disabled (try 'opam install zmq')." >&2;} reason="zmq missing" for p in $REQUIRE_OCAML_ZMQ; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ zmq\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_OCAML_ZMQ; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ zmq\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done else OCAML_ZMQ=ZMQ fi fi ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/configure.ac������������������������������������������������0000666�0000000�0000000�00000005274�13571573400�017267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # Server as a standard Frama-C plug-in # ######################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)]) check_plugin(server,PLUGIN_RELATIVE_PATH(plugin_file),[Server plug-in],yes) ######################################## # Server ZMQ Configuration # ######################################## AC_ARG_ENABLE( server-zmq, [ --enable-server-zmq Server ZeroMQ support (default: yes)], SERVER_ZMQ=$enableval, SERVER_ZMQ=yes ) if test "$SERVER_ZMQ" = "yes" ; then configure_pkg([zmq], [Server support for ZeroMQ disabled (try 'opam install zmq').]) plugin_use_pkg(server,zmq) SERVER_ZMQ=$HAS_OCAML_ZMQ fi AC_SUBST(SERVER_ZMQ) ####################### # Generating Makefile # ####################### write_plugin_config(Makefile) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/data.ml�����������������������������������������������������0000666�0000000�0000000�00000041465�13571573400�016246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Data Encoding --- *) (* -------------------------------------------------------------------------- *) module Js = Yojson.Basic module Ju = Yojson.Basic.Util type json = Js.t let pretty = Js.pretty_print ~std:false module type S = sig type t val syntax : Syntax.t val of_json : json -> t val to_json : t -> json end module type Info = sig val page : Doc.page val name : string val descr : Markdown.text end type 'a data = (module S with type t = 'a) exception InputError of string let failure ?json msg = let add_json msg = let msg = match json with | None -> msg | Some json -> Format.asprintf "@[%s:@ %s@]" msg (Js.pretty_to_string json) in raise(InputError(msg)) in Pretty_utils.ksfprintf add_json msg let failure_from_type_error msg json = failure ~json "%s" msg (* -------------------------------------------------------------------------- *) (* --- Option --- *) (* -------------------------------------------------------------------------- *) module Joption(A : S) : S with type t = A.t option = struct type t = A.t option let nullable = try ignore (A.of_json `Null) ; true with _ -> false let syntax = Syntax.option (if nullable then A.syntax else Syntax.tuple [A.syntax]) let to_json = function | None -> `Null | Some v -> if nullable then `List [A.to_json v] else A.to_json v let of_json = function | `Null -> None | `List [js] when nullable -> Some (A.of_json js) | js -> Some (A.of_json js) end (* -------------------------------------------------------------------------- *) (* --- Tuples --- *) (* -------------------------------------------------------------------------- *) module Jpair(A : S)(B : S) : S with type t = A.t * B.t = struct type t = A.t * B.t let syntax = Syntax.tuple [A.syntax;B.syntax] let to_json (x,y) = `List [ A.to_json x ; B.to_json y ] let of_json = function | `List [ ja ; jb ] -> A.of_json ja , B.of_json jb | js -> failure ~json:js "Expected list with 2 elements" end module Jtriple(A : S)(B : S)(C : S) : S with type t = A.t * B.t * C.t = struct type t = A.t * B.t * C.t let syntax = Syntax.tuple [A.syntax;B.syntax;C.syntax] let to_json (x,y,z) = `List [ A.to_json x ; B.to_json y ; C.to_json z ] let of_json = function | `List [ ja ; jb ; jc ] -> A.of_json ja , B.of_json jb , C.of_json jc | js -> failure ~json:js "Expected list with 3 elements" end (* -------------------------------------------------------------------------- *) (* --- Lists --- *) (* -------------------------------------------------------------------------- *) module Jlist(A : S) : S with type t = A.t list = struct type t = A.t list let syntax = Syntax.array A.syntax let to_json xs = `List (List.map A.to_json xs) let of_json js = List.map A.of_json (Ju.to_list js) end (* -------------------------------------------------------------------------- *) (* --- Arrays --- *) (* -------------------------------------------------------------------------- *) module Jarray(A : S) : S with type t = A.t array = struct type t = A.t array let syntax = Syntax.array A.syntax let to_json xs = `List (List.map A.to_json (Array.to_list xs)) let of_json js = Array.of_list @@ List.map A.of_json (Ju.to_list js) end (* -------------------------------------------------------------------------- *) (* --- Collections --- *) (* -------------------------------------------------------------------------- *) module type S_collection = sig include S module Joption : S with type t = t option module Jlist : S with type t = t list module Jarray : S with type t = t array end module Collection(A : S) : S_collection with type t = A.t = struct include A module Joption = Joption(A) module Jlist = Jlist(A) module Jarray = Jarray(A) end (* -------------------------------------------------------------------------- *) (* --- Atomic Types --- *) (* -------------------------------------------------------------------------- *) module Junit : S with type t = unit = struct type t = unit let syntax = Syntax.unit let of_json _js = () let to_json () = `Null end module Jany : S with type t = json = struct type t = json let syntax = Syntax.any let of_json js = js let to_json js = js end module Jbool : S_collection with type t = bool = Collection (struct type t = bool let syntax = Syntax.boolean let of_json = Ju.to_bool let to_json b = `Bool b end) module Jint : S_collection with type t = int = Collection (struct type t = int let syntax = Syntax.int let of_json = Ju.to_int let to_json n = `Int n end) module Jfloat : S_collection with type t = float = Collection (struct type t = float let syntax = Syntax.number let of_json = Ju.to_number let to_json v = `Float v end) module Jstring : S_collection with type t = string = Collection (struct type t = string let syntax = Syntax.string let of_json = Ju.to_string let to_json s = `String s end) module Jident : S_collection with type t = string = Collection (struct type t = string let syntax = Syntax.ident let of_json = Ju.to_string let to_json s = `String s end) let text_page = Doc.page `Kernel ~title:"Rich Text Format" ~filename:"text.md" module Jtext = struct include Jany let syntax = Syntax.publish ~page:text_page ~name:"text" ~synopsis:Syntax.any ~descr:(Markdown.plain "Formatted text.") () end (* -------------------------------------------------------------------------- *) (* --- Records --- *) (* -------------------------------------------------------------------------- *) module Fmap = Map.Make(String) type 'a record = json Fmap.t type ('r,'a) field = { member : 'r record -> bool ; getter : 'r record -> 'a ; setter : 'r record -> 'a -> 'r record ; } type 'a signature = { page : Doc.page ; name : string ; descr : Markdown.text ; mutable fields : Syntax.field list ; mutable default : 'a record ; mutable published : bool ; } module Record = struct module type S = sig type r include S with type t = r record val default : t val has : (r,'a) field -> t -> bool val get : (r,'a) field -> t -> 'a val set : (r,'a) field -> 'a -> t -> t end let signature ~page ~name ~descr () = { page ; name ; descr ; published = false ; fields = [] ; default = Fmap.empty ; } let field (type a r) (s : r signature) ~name ~descr ?default (d : a data) : (r,a) field = if s.published then raise (Invalid_argument "Server.Data.Record.field") ; let module D = (val d) in begin match default with | None -> () | Some v -> s.default <- Fmap.add name (D.to_json v) s.default end ; let field = Syntax.{ name ; syntax = D.syntax ; descr } in s.fields <- field :: s.fields ; let member r = Fmap.mem name r in let getter r = D.of_json (Fmap.find name r) in let setter r v = Fmap.add name (D.to_json v) r in { member ; getter ; setter } let option (type a r) (s : r signature) ~name ~descr (d : a data) : (r,a option) field = if s.published then raise (Invalid_argument "Server.Data.Record.option") ; let module D = (val d) in let field = Syntax.{ name ; syntax = option D.syntax ; descr } in s.fields <- field :: s.fields ; let member r = Fmap.mem name r in let getter r = try Some (D.of_json (Fmap.find name r)) with Not_found -> None in let setter r = function | None -> Fmap.remove name r | Some v -> Fmap.add name (D.to_json v) r in { member ; getter ; setter } let publish (type r) (s : r signature) = if s.published then raise (Invalid_argument "Server.Data.Record.publish") ; let module M = struct type nonrec r = r type t = r record let descr = s.descr let syntax = let fields = Syntax.fields ~title:"Field" (List.rev s.fields) in Syntax.publish ~page:s.page ~name:s.name ~descr ~synopsis:(Syntax.record []) ~details:[fields] () let default = s.default let has fd r = fd.member r let get fd r = fd.getter r let set fd v r = fd.setter r v let of_json js = List.fold_left (fun r (fd,js) -> Fmap.add fd js r) default (Ju.to_assoc js) let to_json r : json = `Assoc (Fmap.fold (fun fd js fds -> (fd,js) :: fds) r []) end in begin s.default <- Fmap.empty ; s.fields <- [] ; s.published <- true ; (module M : S with type r = r) end end (* -------------------------------------------------------------------------- *) (* --- Index --- *) (* -------------------------------------------------------------------------- *) (** Simplified [Map.S] *) module type Map = sig type 'a t type key val empty : 'a t val add : key -> 'a -> 'a t -> 'a t val find : key -> 'a t -> 'a end module type Index = sig include S_collection val get : t -> int val find : int -> t val clear : unit -> unit end let publish_id (module A : Info) = Syntax.publish ~page:A.page ~name:A.name ~synopsis:Syntax.int ~descr:A.descr () module INDEXER(M : Map)(I : Info) : sig type index val create : unit -> index val clear : index -> unit val get : index -> M.key -> int val find : index -> int -> M.key val to_json : index -> M.key -> json val of_json : index -> json -> M.key end = struct type index = { mutable kid : int ; mutable index : int M.t ; lookup : (int,M.key) Hashtbl.t ; } let create () = { kid = 0 ; index = M.empty ; lookup = Hashtbl.create 0 ; } let clear m = begin m.kid <- 0 ; m.index <- M.empty ; Hashtbl.clear m.lookup ; end let get m a = try M.find a m.index with Not_found -> let id = m.kid in m.kid <- succ id ; m.index <- M.add a id m.index ; Hashtbl.add m.lookup id a ; id let find m id = Hashtbl.find m.lookup id let to_json m a = `Int (get m a) let of_json m js = let id = Ju.to_int js in try find m id with Not_found -> failure "[%s] No registered id #%d" I.name id end module Static(M : Map)(I : Info) : Index with type t = M.key = struct module INDEX = INDEXER(M)(I) let index = INDEX.create () let clear () = INDEX.clear index let get = INDEX.get index let find = INDEX.find index include Collection (struct type t = M.key let syntax = publish_id (module I) let of_json = INDEX.of_json index let to_json = INDEX.to_json index end) end module Index(M : Map)(I : Info) : Index with type t = M.key = struct module INDEX = INDEXER(M)(I) module TYPE : Datatype.S with type t = INDEX.index = Datatype.Make (struct type t = INDEX.index include Datatype.Undefined let reprs = [INDEX.create()] let name = "Server.Data.Index.Type." ^ I.name let mem_project = Datatype.never_any_project end) module STATE = State_builder.Ref(TYPE) (struct let name = "Server.Data.Index.State." ^ I.name let dependencies = [] let default = INDEX.create end) let index () = STATE.get () let clear () = INDEX.clear (index()) let get a = INDEX.get (index()) a let find id = INDEX.find (index()) id include Collection (struct type t = M.key let syntax = publish_id (module I) let of_json js = INDEX.of_json (index()) js let to_json v = INDEX.to_json (index()) v end) end module type IdentifiedType = sig type t val id : t -> int include Info end module Identified(A : IdentifiedType) : Index with type t = A.t = struct type index = (int,A.t) Hashtbl.t module TYPE : Datatype.S with type t = index = Datatype.Make (struct type t = index include Datatype.Undefined let reprs = [Hashtbl.create 0] let name = "Server.Data.Identified.Type." ^ A.name let mem_project = Datatype.never_any_project end) module STATE = State_builder.Ref(TYPE) (struct let name = "Server.Data.Identified.State." ^ A.name let dependencies = [] let default () = Hashtbl.create 0 end) let lookup () = STATE.get () let clear () = Hashtbl.clear (lookup()) let get = A.id let find id = Hashtbl.find (lookup()) id include Collection (struct type t = A.t let syntax = publish_id (module A) let to_json a = `Int (get a) let of_json js = let k = Ju.to_int js in try find k with Not_found -> failure "[%s] No registered id #%d" A.name k end) end (* -------------------------------------------------------------------------- *) (* --- Dictionnary --- *) (* -------------------------------------------------------------------------- *) module type Enum = sig type t val values : (t * string * Markdown.text) list include Info end module Dictionary(E : Enum) = struct let registered = ref false let index = Hashtbl.create 0 let lookup = Hashtbl.create 0 let register () = if not !registered then begin registered := true ; let invalid msg tag = let msg = Printf.sprintf "Server.Data.Enum.%s: duplicate %s (%S)" E.name msg tag in raise (Invalid_argument msg) in List.iter (fun (value,tag,_) -> if Hashtbl.mem index value then invalid "value" tag ; Hashtbl.add index value tag ; if Hashtbl.mem lookup tag then invalid "tag" tag ; Hashtbl.add lookup tag value ; ) E.values end let values = let open Markdown in let caption = Some (plain "Values description") in let header = [ plain E.name, Left; plain "Description", Left ] in let content = List.map (fun (_,tag,descr) -> [ format "`%S`" tag ; descr ]) E.values in Table { caption; header; content } include Collection (struct type t = E.t let syntax = Syntax.publish ~page:E.page ~name:E.name ~synopsis:Syntax.ident ~descr:E.descr ~details:[values] () let to_json value = register () ; try `String (Hashtbl.find index value) with Not_found -> raise (Invalid_argument (Printf.sprintf "[%s] Unregistered value" E.name)) let of_json js = register () ; let tag = Ju.to_string js in try Hashtbl.find lookup tag with Not_found -> let msg = Printf.sprintf "[%s] Unregistered tag %S" E.name tag in raise (Ju.Type_error(msg,js)) end) end (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/data.mli����������������������������������������������������0000666�0000000�0000000�00000017704�13571573400�016416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Data Encoding *) (* -------------------------------------------------------------------------- *) type json = Json.t val pretty : Format.formatter -> json -> unit module type S = sig type t val syntax : Syntax.t val of_json : json -> t val to_json : t -> json end (** Datatype registration. Name and page must be consistent with each other: - The name must be lowercase, dash-separated list of identifiers - Protocol data must start with ["<server>-*"] - Plugin data must start with ["<plugin>-*"] *) module type Info = sig val page : Doc.page val name : string val descr : Markdown.text end type 'a data = (module S with type t = 'a) (* -------------------------------------------------------------------------- *) (** {2 Collections} *) (* -------------------------------------------------------------------------- *) module type S_collection = sig include S module Joption : S with type t = t option module Jlist : S with type t = t list module Jarray : S with type t = t array end module Collection(A : S) : S_collection with type t = A.t (* -------------------------------------------------------------------------- *) (** {2 Constructors} *) (* -------------------------------------------------------------------------- *) module Joption(A : S) : S with type t = A.t option module Jpair(A : S)(B : S) : S with type t = A.t * B.t module Jtriple(A : S)(B : S)(C : S) : S with type t = A.t * B.t * C.t module Jlist(A : S) : S with type t = A.t list module Jarray(A : S) : S with type t = A.t array (* -------------------------------------------------------------------------- *) (** {2 Atomic Data} *) (* -------------------------------------------------------------------------- *) module Junit : S with type t = unit module Jany : S with type t = json module Jbool : S_collection with type t = bool module Jint : S_collection with type t = int module Jfloat : S_collection with type t = float module Jstring : S_collection with type t = string module Jident : S_collection with type t = string (** Syntax is {i ident}. *) module Jtext : S with type t = json (** Rich text encoding, see [Jbuffer] *) (* -------------------------------------------------------------------------- *) (** {2 Records} *) (* -------------------------------------------------------------------------- *) type 'a record (** Records of type 'a *) type 'a signature (** Opened signature for record of type ['a] *) type ('a,'b) field (** Field of type ['b] for a record of type ['a] *) (** Record factory. You shall start by declaring a (ghost) type [r] and call [Record.signature] to create a signature of type [r]. Then, populate the record with [Record.field] or [Record.option]. Finally, you shall call [Record.publish] to obtain a new data module of type [Record with type r = r], which gives you a [Data] with an opaque type [t = r record] with fields of type [(r,a) field]. {[ (* ---- Exemple of Record Data --- *) type r let s = Record.signature ~page ~kind ~name ~descr () in let fd_a = Record.field s ~name:"a" ~descr:"..." (module A) in let fd_b = Record.field s ~name:"b" ~descr:"..." (module B) in module M = (val (Record.publish s) : Record with type r = r) let make a b = M.default |> M.set fd_a a |> M.set fd_b b ]} *) module Record : sig (** Data with [type t = r record]. Also contains getters and setters for fields. *) module type S = sig type r include S with type t = r record val default : t val has : (r,'a) field -> t -> bool val get : (r,'a) field -> t -> 'a val set : (r,'a) field -> 'a -> t -> t end (** Create a new, opened record type *) val signature : page:Doc.page -> name:string -> descr:Markdown.text -> unit -> 'a signature (** Adds a field to an opened record *) val field : 'r signature -> name:string -> descr:Markdown.text -> ?default:'a -> 'a data -> ('r,'a) field (** Adds a optional field to an opened record *) val option : 'r signature -> name:string -> descr:Markdown.text -> 'a data -> ('r,'a option) field (** Publish and close an opened record *) val publish : 'a signature -> (module S with type r = 'a) end (* -------------------------------------------------------------------------- *) (** {2 Indexed Values} *) (* -------------------------------------------------------------------------- *) (** Simplified [Map.S] *) module type Map = sig type 'a t type key val empty : 'a t val add : key -> 'a -> 'a t -> 'a t val find : key -> 'a t -> 'a end module type Index = sig include S_collection val get : t -> int val find : int -> t (** @raise Not_found if not registered *) val clear : unit -> unit (** Clear index tables. Use with extreme care. *) end (** Builds an indexer that {i does not} depend on current project. *) module Static(M : Map)(I : Info) : Index with type t = M.key (** Builds a {i projectified} index. *) module Index(M : Map)(I : Info) : Index with type t = M.key (* -------------------------------------------------------------------------- *) (** {2 Identified Types} *) (* -------------------------------------------------------------------------- *) module type IdentifiedType = sig type t val id : t -> int include Info end (** Builds a {i projectified} index on types with {i unique} identifiers *) module Identified(A : IdentifiedType) : Index with type t = A.t (* -------------------------------------------------------------------------- *) (** {2 Dictionary} *) (* -------------------------------------------------------------------------- *) module type Enum = sig type t val values : (t * string * Markdown.text) list include Info end module Dictionary(E : Enum) : S_collection with type t = E.t (* -------------------------------------------------------------------------- *) (** {2 Error handling} *) (* -------------------------------------------------------------------------- *) (** Exception thrown during the decoding of a request's inputs *) exception InputError of string val failure : ?json:json -> ('a, Format.formatter, unit, 'b) format4 -> 'a (** @raise InputError with provided message *) val failure_from_type_error : string -> json -> 'a (** @raise InputError from Yojson.Basic.Util.Type_error arguments *) (* -------------------------------------------------------------------------- *) ������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/doc.ml������������������������������������������������������0000666�0000000�0000000�00000020463�13571573400�016075� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Server Documentation --- *) (* -------------------------------------------------------------------------- *) open Markdown type json = Yojson.Basic.t module Senv = Server_parameters module Pages = Map.Make(String) type chapter = [ `Protocol | `Kernel | `Plugin of string ] type page = { path : string ; rootdir : string ; (* path to document root *) chapter : chapter ; title : string ; order : int ; intro : Markdown.elements ; mutable sections : Markdown.elements list ; } let order = ref 0 let pages : page Pages.t ref = ref Pages.empty let plugins : string list ref = ref [] let entries : (string * Markdown.href) list ref = ref [] let path page = page.path let href page name : Markdown.href = Section( page.path , name ) (* -------------------------------------------------------------------------- *) (* --- Page Collection --- *) (* -------------------------------------------------------------------------- *) let chapter pg = pg.chapter let page chapter ~title ~filename = let rootdir,path = match chapter with | `Protocol -> "." , filename | `Kernel -> ".." , Printf.sprintf "kernel/%s" filename | `Plugin name -> "../.." , Printf.sprintf "plugins/%s/%s" name filename in try let other = Pages.find path !pages in Senv.failure "Duplicate page '%s' path@." path ; other with Not_found -> let intro = match chapter with | `Protocol -> Printf.sprintf "%s/server/protocol/%s" Config.datadir filename | `Kernel -> Printf.sprintf "%s/server/kernel/%s" Config.datadir filename | `Plugin name -> if not (List.mem name !plugins) then plugins := name :: !plugins ; Printf.sprintf "%s/%s/server/%s" Config.datadir name filename in let intro = if Sys.file_exists intro then Markdown.rawfile intro else Markdown.(section ~title []) in let order = incr order ; !order in let page = { order ; rootdir ; path ; chapter ; title ; intro ; sections=[] } in pages := Pages.add path page !pages ; page let publish ~page ?name ?(index=[]) ~title content sections = let id = match name with Some id -> id | None -> title in let href = Section( page.path , id ) in let section = Markdown.section ?name ~title (content @ sections) in List.iter (fun entry -> entries := (entry , href) :: !entries) index ; page.sections <- section :: page.sections ; href let _ = page `Protocol ~title:"Architecture" ~filename:"server.md" (* -------------------------------------------------------------------------- *) (* --- Tables of Content --- *) (* -------------------------------------------------------------------------- *) let title_of_chapter = function | `Protocol -> "Server Protocols" | `Kernel -> "Kernel Services" | `Plugin name -> "Plugin " ^ String.capitalize_ascii name let pages_of_chapter c = let w = ref [] in Pages.iter (fun _ p -> if p.chapter = c then w := p :: !w) !pages ; List.sort (fun p q -> p.order - q.order) !w let table_of_chapter c = [H2 (Markdown.plain (title_of_chapter c), None); Block (list (List.map (fun p -> text (link ~text:(plain p.title) ~page:p.path ())) (pages_of_chapter c)))] let table_of_contents () = table_of_chapter `Protocol @ table_of_chapter `Kernel @ List.concat (List.map (fun p -> table_of_chapter (`Plugin p)) (List.sort String.compare !plugins)) let index () = List.map (fun (title,entry) -> Markdown.href ~text:(plain title) entry) (List.sort (fun (a,_) (b,_) -> String.compare a b) !entries) let link ~toc ~title ~href : json = let link = [ "title" , `String title ; "href" , `String href ] in `Assoc (if not toc then link else ( "toc" , `Bool true ) :: link) let link_page page : json list = List.fold_right (fun p links -> if p.chapter = page.chapter then let toc = (p.path = page.path) in let href = Filename.basename p.path in link ~toc ~title:p.title ~href :: links else links ) (pages_of_chapter page.chapter) [] let maindata : json = `Assoc [ "document", `String "Frama-C Server" ; "title",`String "Documentation" ; "root", `String "." ; ] let metadata page : json = `Assoc [ "document", `String "Frama-C Server" ; "chapter", `String (title_of_chapter page.chapter) ; "title", `String page.title ; "root", `String page.rootdir ; "link",`List (link_page page) ; ] (* -------------------------------------------------------------------------- *) (* --- Dump Documentation --- *) (* -------------------------------------------------------------------------- *) let pp_one_page ~root ~page ~title body = let full_path = Filepath.normalize (root ^ "/" ^ page) in let dir = Filename.dirname full_path in if not (Sys.file_exists dir) then Extlib.mkdir ~parents:true dir 0o755; try let chan = open_out full_path in let fmt = Format.formatter_of_out_channel chan in let title = plain title in Markdown.(pp_pandoc ~page fmt (pandoc ~title body)) with Sys_error e -> Senv.fatal "Could not open file %s for writing: %s" full_path e let dump ~root ?(meta=true) () = begin Pages.iter (fun path page -> Senv.feedback "[doc] Page: '%s'" path ; let body = Markdown.subsections page.intro (List.rev page.sections) in let title = page.title in pp_one_page ~root ~page:path ~title body ; if meta then let path = Printf.sprintf "%s/%s.json" root path in Yojson.Basic.to_file path (metadata page) ; ) !pages ; Senv.feedback "[doc] Page: 'readme.md'" ; if meta then let path = Printf.sprintf "%s/readme.md.json" root in Yojson.Basic.to_file path maindata ; let body = [ H1 (plain "Documentation", None); Block (text (format "Version %s" Config.version))] @ table_of_contents () @ [H2 (plain "Index", None); Block (list (List.map text (index ())))] in let title = "Documentation" in pp_one_page ~root ~page:"readme.md" ~title body end let () = Db.Main.extend begin fun () -> let root = Senv.Doc.get () in if root <> "" then if Sys.file_exists root && Sys.is_directory root then begin Senv.feedback "[doc] Root: '%s'" root ; dump ~root () ; end else Senv.error "[doc] File '%s' is not a directory" root end (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/doc.mli�����������������������������������������������������0000666�0000000�0000000�00000006051�13571573400�016243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Server Documentation *) (* -------------------------------------------------------------------------- *) open Markdown (** The main chapters of the documentation. *) type chapter = [ `Protocol | `Kernel | `Plugin of string ] (** A page of the server documentation. *) type page val path : page -> string val href : page -> string -> href val chapter : page -> chapter (** Obtain the given page in the server documentation. The page initially contains an introductory section read from the share directory: - [frama-c/share/protocol/<filename>] for protocol pages, - [frama-c/share/server/kernel/<filename>] for kernel pages, - [frama-c/share/<plugin>/server/<filename>] for plugin's pages. *) val page : chapter -> title:string -> filename:string -> page (** Adds a section in the corresponding page. Returns an href to the published section. If index items are provided, they are added to the server documentation index. *) val publish : page:page -> ?name:string -> ?index:string list -> title:string -> Markdown.elements -> Markdown.elements -> Markdown.href (** Dumps all published pages of documentations. Unless [~meta:false], also generates METADATA for each page in [<filename>.json] for each page. *) val dump : root:string -> ?meta:bool -> unit -> unit (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/jbuffer.ml��������������������������������������������������0000666�0000000�0000000�00000011504�13571573400�016747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type json = Yojson.Basic.t type buffer = { text : FCBuffer.t ; mutable rjson : json list ; (* Current op-codes in reverse order *) mutable stack : ( string * json list ) list ; mutable fmt : Format.formatter ; } let append buffer s k n = FCBuffer.add_substring buffer.text s k n let flush buffer () = let t = buffer.text in let n = FCBuffer.length t in if n > 0 then let js = `String (FCBuffer.contents t) in buffer.rjson <- js :: buffer.rjson ; FCBuffer.clear t let push_tag buffer tag = flush buffer () ; buffer.stack <- ( tag , buffer.rjson ) :: buffer.stack ; buffer.rjson <- [] let pop_tag buffer _tag = match buffer.stack with | [] -> () | (tag,rjson)::stack -> flush buffer () ; buffer.stack <- stack ; let content = List.rev buffer.rjson in buffer.rjson <- if content = [] then rjson else let block = `List ( `String tag :: content ) in block :: rjson let no_mark _tag = () let mark_open_tag buffer tg = push_tag buffer tg ; "" let mark_close_tag buffer tg = pop_tag buffer tg ; "" let create ?indent ?margin () = let buffer = { fmt = Format.err_formatter ; text = FCBuffer.create 80 ; rjson = [] ; stack = [] } in let fmt = Format.make_formatter (append buffer) (flush buffer) in buffer.fmt <- fmt ; begin match indent , margin with | None , None -> () | Some k , None -> let m = Format.pp_get_margin fmt () in Format.pp_set_max_indent fmt (max 0 (min k m)) | None , Some m -> Format.pp_set_margin fmt (max 0 m) ; let k = Format.pp_get_max_indent fmt () in if k < m-10 then Format.pp_set_max_indent fmt (max 0 (m-10)) | Some k , Some m -> Format.pp_set_margin fmt (max 0 m) ; Format.pp_set_max_indent fmt (max 0 (min k (m-10))) end ; begin let open Format in pp_set_formatter_tag_functions fmt { print_open_tag = no_mark ; print_close_tag = no_mark ; mark_open_tag = mark_open_tag buffer ; mark_close_tag = mark_close_tag buffer ; } ; pp_set_print_tags fmt false ; pp_set_mark_tags fmt true ; end ; buffer let bprintf buffer msg = Format.fprintf buffer.fmt msg let formatter buffer = buffer.fmt let contents buffer : json = flush buffer () ; while buffer.stack <> [] do pop_tag buffer "" done ; match List.rev buffer.rjson with | [] -> `Null | [`String _ as text] -> text | content -> `List ( `String "" :: content ) let format ?indent ?margin msg = let buffer = create ?indent ?margin () in Format.kfprintf (fun fmt -> Format.pp_print_flush fmt () ; contents buffer) buffer.fmt msg let to_json ?indent ?margin pp a = let buffer = create ?indent ?margin () in pp buffer.fmt a ; Format.pp_print_flush buffer.fmt () ; contents buffer let rec fprintf fmt = function | `Null -> () | `String text -> Format.pp_print_string fmt text | `List ( `String tag :: content ) -> if tag <> "" then begin Format.fprintf fmt "@{<%s>" tag ; List.iter (fprintf fmt) content ; Format.fprintf fmt "@}" ; end else List.iter (fprintf fmt) content | js -> raise (Yojson.Basic.Util.Type_error("Invalid rich-text format",js)) (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/jbuffer.mli�������������������������������������������������0000666�0000000�0000000�00000005746�13571573400�017133� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type json = Json.t (** All-in-one formatter. Return the JSON encoding of formatted text. *) val format : ?indent:int -> ?margin:int -> ('a,Format.formatter,unit,json) format4 -> 'a (** All-in-one formatter. Return the JSON encoding of formatted text. *) val to_json : ?indent:int -> ?margin:int -> (Format.formatter -> 'a -> unit) -> 'a -> json (** Buffer for encoding formatted text. *) type buffer (** Create a formatter with [~indent] maximum indentation and [~margin] right-margin. Defaults are those of [Format.make_formatter], which are [~indent:68] and [~margin:78] with OCaml 4.05. *) val create : ?indent:int -> ?margin:int -> unit -> buffer (** The underlying formatter of a buffer. *) val formatter : buffer -> Format.formatter (** Prints into the buffer's formatter. *) val bprintf : buffer -> ('a,Format.formatter,unit) format -> 'a val append : buffer -> string -> int -> int -> unit val flush : buffer -> unit -> unit val push_tag : buffer -> Format.tag -> unit val pop_tag : buffer -> Format.tag -> unit (** Flushes the buffer and returns its JSON enoding. This pops all pending tags. *) val contents : buffer -> json (** Prints back a JSON encoding onto the provided formatter. @raise Yojson.Basic.Util.Type_error in case of ill formatted buffer. *) val fprintf : Format.formatter -> json -> unit (* -------------------------------------------------------------------------- *) ��������������������������frama-c-20.0-Calcium/src/plugins/server/kernel_ast.ml�����������������������������������������������0000666�0000000�0000000�00000014316�13571573400�017457� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Data module Sy = Syntax module Md = Markdown module Js = Yojson.Basic.Util open Cil_types let page = Doc.page `Kernel ~title:"Ast Services" ~filename:"ast.md" (* -------------------------------------------------------------------------- *) (* --- Compute Ast --- *) (* -------------------------------------------------------------------------- *) let () = Request.register ~page ~kind:`EXEC ~name:"kernel.ast.compute" ~descr:(Md.plain "Ensures that AST is computed") ~input:(module Junit) ~output:(module Junit) Ast.compute (* -------------------------------------------------------------------------- *) (* --- Printers --- *) (* -------------------------------------------------------------------------- *) module Tag = struct open Printer_tag type index = (string,localizable) Hashtbl.t let kid = ref 0 let index () = Hashtbl.create 0 module TYPE : Datatype.S with type t = index = Datatype.Make (struct type t = index include Datatype.Undefined let reprs = [index()] let name = "Server.Jprinter.Index" let mem_project = Datatype.never_any_project end) module STATE = State_builder.Ref(TYPE) (struct let name = "Server.Jprinter.State" let dependencies = [] let default = index end) let of_stmt s = Printf.sprintf "#s%d" s.sid let of_start s = Printf.sprintf "#k%d" s.sid let of_varinfo v = Printf.sprintf "#v%d" v.vid let create_tag = function | PStmt(_,st) -> of_stmt st | PStmtStart(_,st) -> of_start st | PVDecl(_,_,vi) -> of_varinfo vi | PLval _ -> Printf.sprintf "#l%d" (incr kid ; !kid) | PExp _ -> Printf.sprintf "#e%d" (incr kid ; !kid) | PTermLval _ -> Printf.sprintf "#t%d" (incr kid ; !kid) | PGlobal _ -> Printf.sprintf "#g%d" (incr kid ; !kid) | PIP _ -> Printf.sprintf "#p%d" (incr kid ; !kid) let create item = let tag = create_tag item in let index = STATE.get () in Hashtbl.add index tag item ; tag let lookup = Hashtbl.find (STATE.get()) end module PP = Printer_tag.Make(Tag) (* -------------------------------------------------------------------------- *) (* --- Ast Data --- *) (* -------------------------------------------------------------------------- *) module Stmt = Data.Collection (struct type t = stmt let syntax = Sy.publish ~page ~name:"stmt" ~synopsis:Sy.ident ~descr:(Md.plain "Code statement identifier") () let to_json st = `String (Tag.of_stmt st) let of_json js = let id = Js.to_string js in try let open Printer_tag in match Tag.lookup id with | PStmt(_,st) -> st | _ -> raise Not_found with Not_found -> Data.failure "Unknown stmt id: '%s'" id end) module Ki = Data.Collection (struct type t = kinstr let syntax = Sy.union [ Sy.tag "global" ; Stmt.syntax ] let to_json = function | Kglobal -> `String "global" | Kstmt st -> `String (Tag.of_stmt st) let of_json = function | `String "global" -> Kglobal | js -> Kstmt (Stmt.of_json js) end) module Kf = Data.Collection (struct type t = kernel_function let syntax = Sy.publish ~page ~name:"fct-id" ~synopsis:Sy.ident ~descr:(Md.plain "Function identified by its global name.") () let to_json kf = `String (Kernel_function.get_name kf) let of_json js = let key = Js.to_string js in try Globals.Functions.find_by_name key with Not_found -> Data.failure "Undefined function '%s'" key end) (* -------------------------------------------------------------------------- *) (* --- Functions --- *) (* -------------------------------------------------------------------------- *) let () = Request.register ~page ~kind:`GET ~name:"kernel.ast.getFunctions" ~descr:(Md.plain "Collect all functions in the AST") ~input:(module Junit) ~output:(module Kf.Jlist) begin fun () -> let pool = ref [] in Globals.Functions.iter (fun kf -> pool := kf :: !pool) ; List.rev !pool end let () = Request.register ~page ~kind:`GET ~name:"kernel.ast.printFunction" ~descr:(Md.plain "Print the AST of a function") ~input:(module Kf) ~output:(module Jtext) (fun kf -> Jbuffer.to_json PP.pp_global (Kernel_function.get_global kf)) (* -------------------------------------------------------------------------- *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/kernel_ast.mli����������������������������������������������0000666�0000000�0000000�00000004051�13571573400�017623� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* -------------------------------------------------------------------------- *) (** Ast Data *) (* -------------------------------------------------------------------------- *) module PP : Printer_tag.S_pp module Kf : Data.S_collection with type t = kernel_function module Ki : Data.S_collection with type t = kinstr module Stmt : Data.S_collection with type t = stmt (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/kernel_main.ml����������������������������������������������0000666�0000000�0000000�00000020515�13571573400�017612� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Data module Sy = Syntax module Md = Markdown module Senv = Server_parameters (* -------------------------------------------------------------------------- *) (* --- Frama-C Kernel Services --- *) (* -------------------------------------------------------------------------- *) let page = Doc.page `Kernel ~title:"Kernel Services" ~filename:"kernel.md" (* -------------------------------------------------------------------------- *) (* --- Config --- *) (* -------------------------------------------------------------------------- *) let () = let get_config = Request.signature ~page ~kind:`GET ~name:"kernel.getConfig" ~descr:(Md.plain "Frama-C Kernel configuration") ~input:(module Junit) () in let result name descr = Request.result get_config ~name ~descr:(Md.plain descr) (module Jstring) in let set_version = result "version" "Frama-C version" in let set_datadir = result "datadir" "Shared directory (FRAMAC_SHARE)" in let set_libdir = result "libdir" "Lib directory (FRAMAC_LIB)" in let set_pluginpath = Request.result get_config ~name:"pluginpath" ~descr:(Md.plain "Plugin directories (FRAMAC_PLUGIN)") (module Jstring.Jlist) in Request.register_sig get_config begin fun rq () -> set_version rq Config.version ; set_datadir rq Config.datadir ; set_libdir rq Config.libdir ; set_pluginpath rq Config.plugin_dir ; end (* -------------------------------------------------------------------------- *) (* --- File Positions --- *) (* -------------------------------------------------------------------------- *) module RawSource = struct type t = Filepath.position let syntax = Sy.publish ~page ~name:"source" ~synopsis:(Sy.record [ "file" , Sy.string ; "line" , Sy.int ]) ~descr:(Md.plain "Source file positions.") ~details:Md.([Block [Text (plain "The file path is normalized, \ and the line number starts at one.")]]) () let to_json p = `Assoc [ "file" , `String (p.Filepath.pos_path :> string) ; "line" , `Int p.Filepath.pos_lnum ; ] let of_json = function | `Assoc [ "file" , `String path ; "line" , `Int line ] | `Assoc [ "line" , `Int line ; "file" , `String path ] -> Log.source ~file:(Filepath.Normalized.of_string path) ~line | js -> failure_from_type_error "Invalid source format" js end module LogSource = Collection(RawSource) (* -------------------------------------------------------------------------- *) (* --- Log Lind --- *) (* -------------------------------------------------------------------------- *) module RawKind = struct type t = Log.kind let page = page let name = "kind" let descr = Md.plain "Frama-C message category." let values = [ Log.Error, "ERROR", Md.plain "User Error" ; Log.Warning, "WARNING", Md.plain "User Warning" ; Log.Feedback, "FEEDBACK", Md.plain "Analyzer Feedback" ; Log.Result, "RESULT", Md.plain "Analyzer Result" ; Log.Failure, "FAILURE", Md.plain "Analyzer Failure" ; Log.Debug, "DEBUG", Md.plain "Analyser Debug" ; ] end module LogKind = Dictionary(RawKind) (* -------------------------------------------------------------------------- *) (* --- Log Events --- *) (* -------------------------------------------------------------------------- *) module RawEvent = struct type rlog let jlog : rlog signature = Record.signature ~page ~name:"log" ~descr:(Md.plain "Message event record.") () let kind = Record.field jlog ~name:"kind" ~descr:(Md.plain "Message kind") (module LogKind) let plugin = Record.field jlog ~name:"plugin" ~descr:(Md.plain "Emitter plugin") (module Jstring) let message = Record.field jlog ~name:"message" ~descr:(Md.plain "Message text") (module Jstring) let category = Record.option jlog ~name:"category" ~descr:(Md.plain "Message category (DEBUG or WARNING)") (module Jstring) let source = Record.option jlog ~name:"source" ~descr:(Md.plain "Source file position") (module LogSource) module R = (val (Record.publish jlog) : Record.S with type r = rlog) type t = Log.event let syntax = R.syntax let to_json evt = R.default |> R.set plugin evt.Log.evt_plugin |> R.set kind evt.Log.evt_kind |> R.set category evt.Log.evt_category |> R.set source evt.Log.evt_source |> R.set message evt.Log.evt_message |> R.to_json let of_json js = let r = R.of_json js in { Log.evt_plugin = R.get plugin r ; Log.evt_kind = R.get kind r ; Log.evt_category = R.get category r ; Log.evt_source = R.get source r ; Log.evt_message = R.get message r ; } end module LogEvent = Collection(RawEvent) (* -------------------------------------------------------------------------- *) (* --- Log Monitoring --- *) (* -------------------------------------------------------------------------- *) let monitoring = ref false let monitored = ref false let events : Log.event Queue.t = Queue.create () let monitor flag = if flag != !monitoring then ( if flag then Senv.feedback "Start logs monitoring." else Senv.feedback "Stop logs monitoring." ) ; monitoring := flag ; if !monitoring && not !monitored then begin monitored := true ; Log.add_listener (fun evt -> if !monitoring then Queue.add evt events) end let monitor_logs () = monitor (Senv.Log.get ()) let monitor_server activity = if activity then monitor true else monitor_logs () let () = Main.on monitor_server ; Cmdline.run_after_configuring_stage monitor_logs (* -------------------------------------------------------------------------- *) (* --- Log Requests --- *) (* -------------------------------------------------------------------------- *) let () = Request.register ~page ~kind:`SET ~name:"kernel.setLogs" ~descr:(Md.plain "Turn logs monitoring on/off") ~input:(module Jbool) ~output:(module Junit) monitor let () = Request.register ~page ~kind:`GET ~name:"kernel.getLogs" ~descr:(Md.plain "Flush the last emitted logs since last call (max 100)") ~input:(module Junit) ~output:(module LogEvent.Jlist) begin fun () -> let pool = ref [] in let count = ref 100 in while not (Queue.is_empty events) && !count > 0 do decr count ; pool := Queue.pop events :: !pool done ; List.rev !pool end (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/kernel_main.mli���������������������������������������������0000666�0000000�0000000�00000003742�13571573400�017766� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Kernel Services *) (* -------------------------------------------------------------------------- *) module LogSource : Data.S_collection with type t = Filepath.position module LogEvent : Data.S_collection with type t = Log.event (* -------------------------------------------------------------------------- *) ������������������������������frama-c-20.0-Calcium/src/plugins/server/kernel_project.ml�������������������������������������������0000666�0000000�0000000�00000012424�13571573400�020334� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Data module Sy = Syntax module Md = Markdown module Js = Yojson.Basic.Util let page = Doc.page `Kernel ~title:"Project Management" ~filename:"project.md" (* -------------------------------------------------------------------------- *) (* --- Project Info --- *) (* -------------------------------------------------------------------------- *) module ProjectInfo = Collection (struct type t = Project.t let syntax = Sy.publish ~page ~name:"project-info" ~descr:(Md.plain "Project informations") ~synopsis:Sy.(record[ "id",ident; "name",string; "current",boolean ]) () let of_json js = Js.member "id" js |> Js.to_string |> Project.from_unique_name let to_json p = `Assoc [ "id", `String (Project.get_unique_name p) ; "name", `String (Project.get_name p) ; "current", `Bool (Project.is_current p) ; ] end) (* -------------------------------------------------------------------------- *) (* --- Project Requests --- *) (* -------------------------------------------------------------------------- *) module ProjectRequest = struct type t = Project.t * string * json let syntax = Sy.publish ~page ~name:"project-request" ~synopsis:(Sy.(record[ "project",ident; "request",string; "data",any; ])) ~descr:(Md.plain "Request to be executed on the specified project.") () let of_json js = begin Project.from_unique_name Js.(member "project" js |> to_string) , Js.(member "request" js |> to_string) , Js.(member "data" js) end let process kind (project,request,data) = match Main.find request with | Some(kd,handler) when kd = kind -> Project.on project handler data | Some _ -> failwith (Printf.sprintf "Incompatible kind for '%s'" request) | None -> failwith (Printf.sprintf "Request '%s' undefined" request) end (* -------------------------------------------------------------------------- *) (* --- Project Requests --- *) (* -------------------------------------------------------------------------- *) let () = Request.register ~page ~kind:`GET ~name:"kernel.project.getCurrent" ~descr:(Md.plain "Returns the current project") ~input:(module Junit) ~output:(module ProjectInfo) Project.current let () = Request.register ~page ~kind:`SET ~name:"kernel.project.setCurrent" ~descr:(Md.plain "Switches the current project") ~input:(module Jident) ~output:(module Junit) (fun pid -> Project.(set_current (from_unique_name pid))) let () = Request.register ~page ~kind:`GET ~name:"kernel.project.getList" ~descr:(Md.plain "Returns the list of all projects") ~input:(module Junit) ~output:(module ProjectInfo.Jlist) (fun () -> Project.fold_on_projects (fun ids p -> p :: ids) []) let () = Request.register ~page ~kind:`GET ~name:"kernel.project.getOn" ~descr:(Md.plain "Execute a GET request within the given project") ~input:(module ProjectRequest) ~output:(module Jany) (ProjectRequest.process `GET) let () = Request.register ~page ~kind:`SET ~name:"kernel.project.setOn" ~descr:(Md.plain "Execute a SET request within the given project") ~input:(module ProjectRequest) ~output:(module Jany) (ProjectRequest.process `SET) let () = Request.register ~page ~kind:`EXEC ~name:"kernel.project.execOn" ~descr:(Md.plain "Execute an EXEC request within the given project") ~input:(module ProjectRequest) ~output:(module Jany) (ProjectRequest.process `EXEC) (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/kernel_project.mli������������������������������������������0000666�0000000�0000000�00000003757�13571573400�020516� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Data (* -------------------------------------------------------------------------- *) (** Project Services *) (* -------------------------------------------------------------------------- *) module ProjectInfo : Data.S with type t = Project.t module ProjectRequest : Request.Input with type t = Project.t * string * json (* -------------------------------------------------------------------------- *) �����������������frama-c-20.0-Calcium/src/plugins/server/main.ml�����������������������������������������������������0000666�0000000�0000000�00000025731�13571573400�016257� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Server Main Process --- *) (* -------------------------------------------------------------------------- *) module Senv = Server_parameters let option f = function None -> () | Some x -> f x (* -------------------------------------------------------------------------- *) (* --- Registry --- *) (* -------------------------------------------------------------------------- *) type kind = [ `GET | `SET | `EXEC ] let string_of_kind = function `GET -> "GET" | `SET -> "SET" | `EXEC -> "EXEC" let pp_kind fmt kd = Format.pp_print_string fmt (string_of_kind kd) let registry = Hashtbl.create 32 let register (kind : kind) request handler = if Hashtbl.mem registry request then Server_parameters.failure "Request '%s' already registered" request else Hashtbl.add registry request (kind,handler) let find request = try Some (Hashtbl.find registry request) with Not_found -> None let exec request data = (snd (Hashtbl.find registry request)) data (* -------------------------------------------------------------------------- *) (* --- Public API --- *) (* -------------------------------------------------------------------------- *) type json = Json.t type 'a request = [ | `Poll | `Request of 'a * string * json | `Kill of 'a | `Shutdown ] type 'a response = [ | `Data of 'a * json | `Error of 'a * string | `Killed of 'a | `Rejected of 'a ] type 'a message = { requests : 'a request list ; callback : 'a response list -> unit ; } (* Private API: *) type 'a exec = { id : 'a ; request : string ; data : json ; handler : json -> json ; yield : bool ; mutable killed : bool ; } type 'a server = { rate : int ; pretty : Format.formatter -> 'a -> unit ; equal : 'a -> 'a -> bool ; fetch : unit -> 'a message option ; q_in : 'a exec Queue.t ; q_out : 'a response Stack.t ; mutable shutdown : bool ; mutable coins : int ; mutable running : 'a exec option ; } exception Killed (* -------------------------------------------------------------------------- *) (* --- Debug --- *) (* -------------------------------------------------------------------------- *) let pp_request pp fmt (r : _ request) = match r with | `Poll -> Format.fprintf fmt "Poll" | `Shutdown -> Format.fprintf fmt "Shutdown" | `Kill id -> Format.fprintf fmt "Kill %a" pp id | `Request(id,request,data) -> if Senv.debug_atleast 2 then Format.fprintf fmt "@[<hov 2>Request %s:%a@ %a@]" request pp id Data.pretty data else Format.fprintf fmt "Request %s:%a" request pp id let pp_response pp fmt (r : _ response) = match r with | `Error(id,err) -> Format.fprintf fmt "Error %a: %s" pp id err | `Rejected id -> Format.fprintf fmt "Rejected %a" pp id | `Killed id -> Format.fprintf fmt "Killed %a" pp id | `Data(id,data) -> if Senv.debug_atleast 2 then Format.fprintf fmt "@[<hov 2>Response %a@ %a@]" pp id Data.pretty data else Format.fprintf fmt "Response %a" pp id (* -------------------------------------------------------------------------- *) (* --- Request Handling --- *) (* -------------------------------------------------------------------------- *) let no_yield () = () let execute exec : _ response = try let data = exec.handler exec.data in `Data(exec.id,data) with | Killed -> `Killed exec.id | Data.InputError msg -> `Error(exec.id,msg) | Sys.Break as exn -> raise exn (* Silently pass the exception *) | exn when Cmdline.catch_at_toplevel exn -> Senv.warning "[%s] Uncaught exception:@\n%s" exec.request (Cmdline.protect exn) ; `Error(exec.id,Printexc.to_string exn) let execute_with_yield yield exec = let db = !Db.progress in Db.progress := if exec.yield then yield else no_yield ; Extlib.try_finally ~finally:(fun () -> Db.progress := db) execute exec let execute_debug pp yield exec = if Senv.debug_atleast 1 then Senv.debug "Trigger %s:%a" exec.request pp exec.id ; execute_with_yield yield exec let reply_debug server resp = if Senv.debug_atleast 1 then Senv.debug "%a" (pp_response server.pretty) resp ; Stack.push resp server.q_out (* -------------------------------------------------------------------------- *) (* --- Processing Requests --- *) (* -------------------------------------------------------------------------- *) let raise_if_killed = function { killed } -> if killed then raise Killed let kill_exec e = e.killed <- true let kill_request eq id e = if eq id e.id then e.killed <- true let process_request (server : 'a server) (request : 'a request) : unit = if Senv.debug_atleast 1 then Senv.debug "%a" (pp_request server.pretty) request ; match request with | `Poll -> () | `Shutdown -> begin option kill_exec server.running ; Queue.clear server.q_in ; Stack.clear server.q_out ; server.shutdown <- true ; end | `Kill id -> begin let kill = kill_request server.equal id in Queue.iter kill server.q_in ; option kill server.running ; end | `Request(id,request,data) -> begin match find request with | None -> reply_debug server (`Rejected id) | Some( `GET , handler ) -> let exec = { id ; request ; handler ; data ; yield = false ; killed = false } in reply_debug server (execute exec) | Some( `SET , handler ) -> let exec = { id ; request ; handler ; data ; yield = false ; killed = false } in Queue.push exec server.q_in | Some( `EXEC , handler ) -> let exec = { id ; request ; handler ; data ; yield = true ; killed = false } in Queue.push exec server.q_in end (* -------------------------------------------------------------------------- *) (* --- Fetching a Bunck of Messages --- *) (* -------------------------------------------------------------------------- *) let communicate server = match server.fetch () with | None -> false | Some message -> let error = try List.iter (process_request server) message.requests ; None with exn -> Some exn in (* re-raised after message reply *) let pool = ref [] in Stack.iter (fun r -> pool := r :: !pool) server.q_out ; Stack.clear server.q_out ; message.callback !pool ; option raise error ; true (* -------------------------------------------------------------------------- *) (* --- Yielding --- *) (* -------------------------------------------------------------------------- *) let do_yield server () = begin option raise_if_killed server.running ; let n = server.coins in if n < server.rate then server.coins <- succ n else ( server.coins <- 0 ; ignore ( communicate server ) ) ; end (* -------------------------------------------------------------------------- *) (* --- One Step Process --- *) (* -------------------------------------------------------------------------- *) let rec fetch_exec q = if Queue.is_empty q then None else let e = Queue.pop q in if e.killed then fetch_exec q else Some e let process server = match fetch_exec server.q_in with | None -> communicate server | Some exec -> server.running <- Some exec ; try reply_debug server (execute_debug server.pretty (do_yield server) exec) ; server.running <- None ; true with exn -> server.running <- None ; raise exn (* -------------------------------------------------------------------------- *) (* --- Server Main Loop --- *) (* -------------------------------------------------------------------------- *) let in_range ~min:a ~max:b v = min (max a v) b let kill () = raise Killed let yield () = !Db.progress () let demons = ref [] let on callback = demons := !demons @ [ callback ] let signal activity = List.iter (fun f -> try f activity with _ -> ()) !demons let run ~pretty ?(equal=(=)) ~fetch () = begin let rate = in_range ~min:1 ~max:200 (Senv.Rate.get ()) in let idle_ms = in_range ~min:1 ~max:2000 (Senv.Idle.get ()) in let idle_s = float_of_int idle_ms /. 1000.0 in let server = { fetch ; coins = 0 ; rate ; equal ; pretty ; q_in = Queue.create () ; q_out = Stack.create () ; running = None ; shutdown = false ; } in try (* TODO: remove the following line once the Why3 signal handler is not used anymore. *) Sys.catch_break true; signal true ; Senv.feedback "Server running." ; begin try while not server.shutdown do let activity = process server in if not activity then Unix.sleepf idle_s ; done ; with Sys.Break -> () (* Ctr+C, just leave the loop normally *) end; Senv.feedback "Server shutdown." ; signal false ; with exn -> Senv.feedback "Server interruped (fatal error)." ; signal false ; raise exn end (* -------------------------------------------------------------------------- *) ���������������������������������������frama-c-20.0-Calcium/src/plugins/server/main.mli����������������������������������������������������0000666�0000000�0000000�00000007711�13571573400�016426� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Server Main Process *) (* -------------------------------------------------------------------------- *) type json = Json.t type kind = [ `GET | `SET | `EXEC ] val string_of_kind : kind -> string val pp_kind : Format.formatter -> kind -> unit (* -------------------------------------------------------------------------- *) (** {2 Request Registry} *) (* -------------------------------------------------------------------------- *) val register : kind -> string -> (json -> json) -> unit val find : string -> (kind * (json -> json)) option val exec : string -> json -> json (** @raises Not_found if not registered *) (* -------------------------------------------------------------------------- *) (** {2 Server Main Process} *) (* -------------------------------------------------------------------------- *) (** Type of request messages. Parametrized by the type of request identifiers. *) type 'a request = [ | `Poll | `Request of 'a * string * json | `Kill of 'a | `Shutdown ] (** Type of response messages. Parametrized by the type of request identifiers. *) type 'a response = [ | `Data of 'a * json | `Error of 'a * string | `Killed of 'a | `Rejected of 'a ] (** A paired request-response message. The callback will be called exactly once for each received message. *) type 'a message = { requests : 'a request list ; callback : 'a response list -> unit ; } (** Run a server with the provided low-level network primitives to actually exchange data. The function does not return until the server is explicitely Shutdown. Logs are monitored unless [~logs:false] is specified. Default equality is the standard `(=)` one. *) val run : pretty:(Format.formatter -> 'a -> unit) -> ?equal:('a -> 'a -> bool) -> fetch:(unit -> 'a message option) -> unit -> unit (** Yield the server during the currently running request. Actually, calls [!Db.progress()]. *) val yield : unit -> unit (** Kills the currently running request. Actually raises an exception. *) val kill : unit -> 'a (** Register a callback to listen for server activity. All callbacks would be executed in their order of registration. They shall {i never} raise any exception. *) val on : (bool -> unit) -> unit (* -------------------------------------------------------------------------- *) �������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/request.ml��������������������������������������������������0000666�0000000�0000000�00000027701�13571573400�017022� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Senv = Server_parameters module Jutil = Yojson.Basic.Util (* -------------------------------------------------------------------------- *) (* --- Request Registry --- *) (* -------------------------------------------------------------------------- *) type json = Data.json type kind = [ `GET | `SET | `EXEC ] module type Input = sig type t val syntax : Syntax.t val of_json : json -> t end module type Output = sig type t val syntax : Syntax.t val to_json : t -> json end type 'a input = (module Input with type t = 'a) type 'a output = (module Output with type t = 'a) (* -------------------------------------------------------------------------- *) (* --- Sanity Checks --- *) (* -------------------------------------------------------------------------- *) let re_name = Str.regexp_case_fold "[a-zA-Z0-9._]+$" let wpage = Senv.register_warn_category "inconsistent-page" let wkind = Senv.register_warn_category "inconsistent-kind" let check_name name = if not (Str.string_match re_name name 0) then Senv.warning ~wkey:Senv.wname "Request %S is not a dot-separated list of (camlCased) identifiers" name let check_plugin plugin name = let p = String.lowercase_ascii plugin in let n = String.lowercase_ascii name in let k = String.length plugin in if not (String.length name > k && String.sub n 0 k = p && String.get n k = '.') then Senv.warning ~wkey:wpage "Request '%s' shall be named « %s.* »" name (String.capitalize_ascii plugin) let check_page page name = match Doc.chapter page with | `Kernel -> check_plugin "kernel" name | `Plugin plugin -> check_plugin plugin name | `Protocol -> Senv.warning ~wkey:wkind "Request '%s' shall not be published in protocol pages" name (* -------------------------------------------------------------------------- *) (* --- Multiple Fields Requests --- *) (* -------------------------------------------------------------------------- *) module Fmap = Map.Make(String) type rq = { mutable param : json Fmap.t ; mutable result : json Fmap.t ; } let fmap_of_json r js = List.fold_left (fun r (fd,js) -> Fmap.add fd js r) r (Jutil.to_assoc js) let fmap_to_json r = `Assoc (Fmap.fold (fun fd js r -> (fd,js)::r) r []) type 'a param = rq -> 'a type 'a result = rq -> 'a -> unit (* -------------------------------------------------------------------------- *) (* --- Input/Output Request Processing --- *) (* -------------------------------------------------------------------------- *) type _ rq_input = | Pnone | Pdata : 'a input -> 'a rq_input | Pfields : Syntax.field list -> unit rq_input type _ rq_output = | Rnone | Rdata : 'a output -> 'a rq_output | Rfields : Syntax.field list -> unit rq_output (* json input syntax *) let sy_input (type a) (input : a rq_input) : Syntax.t = match input with | Pnone -> assert false | Pdata d -> let module D = (val d) in D.syntax | Pfields _ -> Syntax.record [] (* json output syntax *) let sy_output (type b) (output : b rq_output) : Syntax.t = match output with | Rnone -> assert false | Rdata d -> let module D = (val d) in D.syntax | Rfields _ -> Syntax.record [] (* json input documentation *) let doc_input (type a) (input : a rq_input) = match input with | Pnone -> assert false | Pdata _ -> [] | Pfields fs -> [Syntax.fields ~title:"Input" (List.rev fs)] (* json output syntax *) let doc_output (type b) (output : b rq_output) = match output with | Rnone -> assert false | Rdata _ -> [] | Rfields fs -> [Syntax.fields ~title:"Output" (List.rev fs)] (* -------------------------------------------------------------------------- *) (* --- Multi-Parameters Requests --- *) (* -------------------------------------------------------------------------- *) type ('a,'b) signature = { page : Doc.page ; kind : kind ; name : string ; descr : Markdown.text ; details : Markdown.block ; mutable defined : bool ; mutable defaults : json Fmap.t ; mutable required : string list ; mutable input : 'a rq_input ; mutable output : 'b rq_output ; } let failure_missing fmap name = Data.failure ~json:(fmap_to_json fmap) "Missing parameter '%s'" name let check_required fmap fd = if not (Fmap.mem fd fmap) then failure_missing fmap fd (* -------------------------------------------------------------------------- *) (* --- Named Input Parameters Definitions --- *) (* -------------------------------------------------------------------------- *) (* current input fields *) let fds_input s : Syntax.field list = if s.defined then Senv.failure "Request '%s' has been finalized." s.name ; match s.input with | Pdata _ -> Senv.fatal "Can not define named parameters for request '%s'" s.name | Pnone -> [] | Pfields fds -> fds let param (type a b) (s : (unit,b) signature) ~name ~descr ?default (input : a input) : a param = let module D = (val input) in let syntax = if default = None then D.syntax else Syntax.option D.syntax in let fd = Syntax.{ name ; syntax ; descr } in s.input <- Pfields (fd :: fds_input s) ; fun rq -> try D.of_json (Fmap.find name rq.param) with Not_found -> match default with | None -> failure_missing rq.param name | Some v -> v let param_opt (type a b) (s : (unit,b) signature) ~name ~descr (input : a input) : a option param = let module D = (val input) in let fd = Syntax.{ name ; syntax = Syntax.option D.syntax ; descr } in s.input <- Pfields (fd :: fds_input s) ; fun rq -> try Some(D.of_json (Fmap.find name rq.param)) with Not_found -> None (* -------------------------------------------------------------------------- *) (* --- Named Output Parameters Definitions --- *) (* -------------------------------------------------------------------------- *) (* current output fields *) let fds_output s : Syntax.field list = if s.defined then Senv.failure "Request '%s' has been finalized." s.name ; match s.output with | Rdata _ -> Senv.fatal "Can not define named results request '%s'" s.name | Rnone -> [] | Rfields fds -> fds let result (type a b) (s : (a,unit) signature) ~name ~descr ?default (output : b output) : b result = let module D = (val output) in let fd = Syntax.{ name ; syntax = D.syntax ; descr } in s.output <- Rfields (fd :: fds_output s) ; begin match default with | None -> s.required <- name :: s.required | Some v -> s.defaults <- Fmap.add name (D.to_json v) s.defaults end ; fun rq v -> rq.result <- Fmap.add name (D.to_json v) rq.result let result_opt (type a b) (s : (a,unit) signature) ~name ~descr (output : b output) : b option result = let module D = (val output) in let fd = Syntax.{ name ; syntax = option D.syntax ; descr } in s.output <- Rfields (fd :: fds_output s) ; fun rq opt -> match opt with None -> () | Some v -> rq.result <- Fmap.add name (D.to_json v) rq.result (* -------------------------------------------------------------------------- *) (* --- Opened Signature Definition --- *) (* -------------------------------------------------------------------------- *) let signature ~page ~kind ~name ~descr ?(details=[]) ?input ?output () = check_name name ; check_page page name ; let input = match input with None -> Pnone | Some d -> Pdata d in let output = match output with None -> Rnone | Some d -> Rdata d in { page ; kind ; name ; descr ; details ; defaults = Fmap.empty ; required = [] ; input ; output ; defined = false ; } (* -------------------------------------------------------------------------- *) (* --- Opened Signature Process --- *) (* -------------------------------------------------------------------------- *) (* json input processing *) let mk_input (type a) name defaults (input : a rq_input) : (rq -> json -> a) = match input with | Pnone -> Senv.fatal "No input defined for request '%s'" name | Pdata d -> let module D = (val d) in begin fun rq js -> rq.result <- defaults ; try D.of_json js with Jutil.Type_error (msg, js) -> Data.failure_from_type_error msg js end | Pfields _ -> begin fun rq js -> try rq.param <- fmap_of_json rq.param js with Jutil.Type_error (msg, js) -> Data.failure_from_type_error msg js end (* json output processing *) let mk_output (type b) name required (output : b rq_output) : (rq -> b -> json) = match output with | Rnone -> Senv.fatal "No output defined for request '%s'" name | Rdata d -> let module D = (val d) in (fun _rq v -> D.to_json v) | Rfields _ -> (fun rq () -> List.iter (check_required rq.result) required ; fmap_to_json rq.result) let register_sig (type a b) (s : (a,b) signature) (process : rq -> a -> b) = let open Markdown in if s.defined then Senv.fatal "Request '%s' is defined twice" s.name ; let input = mk_input s.name s.defaults s.input in let output = mk_output s.name s.required s.output in let processor js = let rq = { param = Fmap.empty ; result = Fmap.empty } in js |> input rq |> process rq |> output rq in let skind = Main.string_of_kind s.kind in let title = Printf.sprintf "`%s` %s" skind s.name in let header = [ plain "Input", Center; plain "Output", Center] in let content = [[ Syntax.text @@ sy_input s.input ; Syntax.text @@ sy_output s.output ]] in let synopsis = Table { caption=None ; header; content } in let description = [ Block [Text s.descr ] ; synopsis ; Block s.details] @ doc_input s.input @ doc_output s.output in let _ = Doc.publish ~page:s.page ~name:s.name ~title description [] in Main.register s.kind s.name processor ; s.defined <- true (* -------------------------------------------------------------------------- *) (* --- Request Registration --- *) (* -------------------------------------------------------------------------- *) let register ~page ~kind ~name ~descr ?details ~input ~output process = register_sig (signature ~page ~kind ~name ~descr ?details ~input ~output ()) (fun _rq v -> process v) (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/request.mli�������������������������������������������������0000666�0000000�0000000�00000015561�13571573400�017174� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Request Registry *) (* -------------------------------------------------------------------------- *) type json = Data.json type kind = [ `GET | `SET | `EXEC ] module type Input = sig type t val syntax : Syntax.t val of_json : json -> t end module type Output = sig type t val syntax : Syntax.t val to_json : t -> json end type 'a input = (module Input with type t = 'a) type 'b output = (module Output with type t = 'b) (** {2 Simple Requests Registration} *) (** Register a simple request of type [(a -> b)]. Name, page and kind must be consistent with each others: - No publication on [`Protocol] pages - Kernel requests shall starts with ["Kernel.*"] - Plugin requests shall starts with ["<Plugin>.*"] - SET requests must contain ["set"] (case insensitive) - GET requests must contain ["get"] or ["print"] (case insensitive) - EXEC requests must contain ["exec"] or ["compute"] (case insensitive) *) val register : page:Doc.page -> kind:kind -> name:string -> descr:Markdown.text -> ?details:Markdown.block -> input:'a input -> output:'b output -> ('a -> 'b) -> unit (** {2 Requests with Named Parameters} The API below allows for creating requests with named and optional parameters. Although such requests could be defined with simple registration and {i record} datatypes, the helpers below allow more flexibility and a better correspondance between optional parameters and OCaml option types. To register a request with named parameters and/or named results, you first create a {i signature}. Then you define named parameters and results, and finally you {i register} the processing function: {[ (* ---- Exemple of Request Registration --- *) let () = let s = Request.signature ~page ~kind ~name ~descr () in let get_a = Request.param s ~name:"a" ~descr:"..." (module A) in let get_b = Request.param s ~name:"b" ~descr:"..." (module B) in let set_c = Request.result s ~name:"c" ~descr:"..." (module C) in let set_d = Request.result s ~name:"d" ~descr:"..." (module D) in Request.register_sig s (fun rq () -> let (c,d) = some_job (get_a rq) (get_b rq) in set_c rq c ; set_d rq d) ]} *) (** Under definition request signature. *) type ('a,'b) signature (** Create an opened request signature. Depending on whether [~input] and [~output] datatype are provided, you shall define named parameters and results before registering the request processing function. *) val signature : page:Doc.page -> kind:kind -> name:string -> descr:Markdown.text -> ?details:Markdown.block -> ?input:'a input -> ?output:'b output -> unit -> ('a,'b) signature (** Request JSON parameters. *) type rq (** Named input parameter. *) type 'a param = rq -> 'a (** Named output parameter. *) type 'b result = rq -> 'b -> unit (** Register the request JSON processing function. This call finalize the signature definition and shall be called once on the signature. *) val register_sig : ('a,'b) signature -> (rq -> 'a -> 'b) -> unit (** {2 Named Parameters and Results} The functions bellow must be called on a freshly created signature {i before} its final registration. The obtained getters and setters shall be only used within the registered process. The correspondance between input/output JSON syntax and OCaml values is summarized in the tables below.Abstract_domain For named input parameters: [ API: Input JSON OCaml Getter ----------------------------------------------------------------------- Request.param { f: a } 'a (* might raise an exception *) Request.param ~default { f: a? } 'a (* defined by default *) Request.param_opt { f: a? } 'a option ] For named output parameters: [ API: Input JSON OCaml Setter ---------------------------------------------------------------------- Request.result { f: a } 'a (* shall be set by process *) Request.result ~default { f: a } 'a (* defined by default *) Request.result_opt { f: a? } 'a option ] *) (** Named input parameter. If a default value is provided, the JSON input field becomes optional. Otherwized, it is required. *) val param : (unit,'b) signature -> name:string -> descr:Markdown.text -> ?default:'a -> 'a input -> 'a param (** Named optional input parameter. *) val param_opt : (unit,'b) signature -> name:string -> descr:Markdown.text -> 'a input -> 'a option param (** Named output parameter. If a default value is provided, the JSON output field is initialized with it. Otherwized, it shall be set at each invocation of the request processing funciton. *) val result : ('a,unit) signature -> name:string -> descr:Markdown.text -> ?default:'b -> 'b output -> 'b result (** Named optional output parameter. The initial value is set to [None]. *) val result_opt : ('a,unit) signature -> name:string -> descr:Markdown.text -> 'b output -> 'b option result (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/server_batch.ml���������������������������������������������0000666�0000000�0000000�00000012242�13571573400�017773� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Only Compiled when package Zmq is installed *) (* No interface, registered via side-effects *) (* -------------------------------------------------------------------------- *) (* --- ZeroMQ Server Options --- *) (* -------------------------------------------------------------------------- *) module Senv = Server_parameters let batch_group = Senv.add_group "Protocol BATCH" let () = Parameter_customize.set_group batch_group module Batch = Senv.String_list (struct let option_name = "-server-batch" let arg_name = "file.json,..." let help = "Executes all requests in each <file.json>, and save the \ associated results in <file.out.json>." end) let () = Parameter_customize.set_group batch_group let () = Parameter_customize.do_not_save () module BatchOutputDir = Senv.Empty_string (struct let option_name = "-server-batch-output-dir" let arg_name = "path" let help = "Outputs the results of -server-batch in <path> instead of the input \ directory." end) let _ = Doc.page `Protocol ~title:"Batch Protocol" ~filename:"server_batch.md" (* -------------------------------------------------------------------------- *) (* --- Execute JSON --- *) (* -------------------------------------------------------------------------- *) module Js = Yojson.Basic module Ju = Yojson.Basic.Util let pretty = Js.pretty_print ~std:false let execute_command js = let request = Ju.member "request" js |> Ju.to_string in let id = Ju.member "id" js in let data = Ju.member "data" js in match Main.find request with | None -> Senv.error "[batch] %a: request %S not found" pretty id request ; `Assoc [ "id" , id ; "error" , `String "request not found" ] | Some (kind,handler) -> try Senv.feedback "[%a] %s" Main.pp_kind kind request ; `Assoc [ "id" , id ; "data" , handler data ] with Data.InputError(msg) -> Senv.error "[%s] %s@." request msg ; `Assoc [ "id" , id ; "error" , `String msg ; "at" , js ] let rec execute_batch js = match js with | `Null -> `Null | `List js -> `List (List.map execute_batch js) | js -> try execute_command js with Ju.Type_error(msg,js) -> Senv.error "[batch] incorrect encoding:@\n%s@\n@[<hov 2>At: %a@]@." msg pretty js ; `Null (* -------------------------------------------------------------------------- *) (* --- Execute the Scripts --- *) (* -------------------------------------------------------------------------- *) let execute () = begin let files = Batch.get () in Batch.clear () ; (* clear in any case *) List.iter begin fun file -> Senv.feedback "Script %S" file ; let response = execute_batch (Js.from_file file) in let output = Filename.remove_extension file ^ ".out.json" in let output = match BatchOutputDir.get () with | "" -> output | dir -> Filename.(dir ^ dir_sep ^ basename output) in Senv.feedback "Output %S" output ; let out = open_out output in Js.pretty_to_channel out response ; close_out out end files end (* -------------------------------------------------------------------------- *) (* --- Run the Server from the Command line --- *) (* -------------------------------------------------------------------------- *) let () = Db.Main.extend execute (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/server_parameters.ml����������������������������������������0000666�0000000�0000000�00000005667�13571573400�021072� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Server Plugin & Options --- *) (* -------------------------------------------------------------------------- *) module P = Plugin.Register (struct let name = "Server" let shortname = "server" let help = "Frama-C Request Server" end) include P module Idle = P.Int (struct let option_name = "-server-idle" let arg_name = "ms" let default = 10 let help = "Waiting time (in milliseconds) when idle" end) module Rate = P.Int (struct let option_name = "-server-rate" let arg_name = "n" let default = 100 let help = "Number of analysis steps between server communications" end) module Doc = P.String (struct let option_name = "-server-doc" let arg_name = "dir" let default = "" let help = "Output a markdown documentation of the server in <dir>" end) module Log = P.False (struct let option_name = "-server-logs" let help = "Start (or stop) monitoring logs" end) let wpage = register_warn_category "inconsistent-page" let wkind = register_warn_category "inconsistent-kind" let wname = register_warn_category "invalid-name" (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/server_parameters.mli���������������������������������������0000666�0000000�0000000�00000004213�13571573400�021225� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Server Plugin & Options *) include Plugin.General_services module Idle : Parameter_sig.Int (** Idle waiting time (in ms) *) module Rate : Parameter_sig.Int (** Number of fetch per yield *) module Doc : Parameter_sig.String (** Generate documentation *) module Log : Parameter_sig.Bool (** Monitor logs *) val wpage : warn_category (** Inconsistent page warning *) val wkind : warn_category (** Inconsistent category warning *) val wname : warn_category (** Invalid name warning *) (**************************************************************************) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/server_zmq.ml�����������������������������������������������0000666�0000000�0000000�00000013634�13571573400�017527� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Only Compiled when package Zmq is installed *) (* No interface, registered via side-effects *) (* -------------------------------------------------------------------------- *) (* --- ZeroMQ Server Options --- *) (* -------------------------------------------------------------------------- *) module Senv = Server_parameters let zmq_group = Senv.add_group "Protocol ZeroMQ" let () = Parameter_customize.set_group zmq_group module Enabled = Senv.String (struct let option_name = "-server-zmq" let arg_name = "url" let default = "" let help = "Establish a ZeroMQ server and listen for connections" end) let _ = Doc.page `Protocol ~title:"ZeroMQ Protocol" ~filename:"server_zmq.md" (* -------------------------------------------------------------------------- *) (* --- ZMQ Context --- *) (* -------------------------------------------------------------------------- *) let context = let zmq = ref None in fun () -> match !zmq with | Some ctxt -> ctxt | None -> let major,minor,patch = Zmq.version () in Senv.feedback "ZeroMQ %d.%d.%d" major minor patch ; let ctxt = Zmq.Context.create () in at_exit (fun () -> Zmq.Context.terminate ctxt) ; zmq := Some ctxt ; ctxt (* -------------------------------------------------------------------------- *) (* --- Decoding Requests --- *) (* -------------------------------------------------------------------------- *) exception WrongEncoding of string let jdecode txt = try Yojson.Basic.from_string txt with exn -> (* Exception if purely local from Yojson *) raise (WrongEncoding (Printexc.to_string exn)) let jencode js = try Yojson.Basic.to_string ~std:false js with exn -> (* Exception if purely local from Yojson *) raise (WrongEncoding (Printexc.to_string exn)) let rec decode = function | ("GET"|"SET"|"EXEC")::id::request::data :: w -> `Request(id,request,jdecode data) :: decode w | "KILL"::id:: w -> `Kill id :: decode w | "POLL" :: w -> `Poll :: decode w | "SHUTDOWN" :: _ -> [`Shutdown] | cmd::_ -> raise (WrongEncoding cmd) | [] -> [] let rec encode = function | `Data(id,data) :: w -> "DATA" :: id :: jencode data :: encode w | `Error(id,msg) :: w -> "ERROR" :: id :: msg :: encode w | `Killed id :: w -> "KILLED" :: id :: encode w | `Rejected id :: w -> "REJECTED" :: id :: encode w | [] -> [] (* -------------------------------------------------------------------------- *) (* --- ZMQ Messages --- *) (* -------------------------------------------------------------------------- *) let callback socket responses = try let msg = encode responses in Zmq.Socket.send_all socket (if msg = [] then ["NONE"] else msg) with WrongEncoding msg -> Zmq.Socket.send_all socket [ "WRONG" ; msg ] let fetch socket () = try let msg = Zmq.Socket.recv_all ~block:false socket in try Some Main.{ requests = decode msg ; callback = callback socket } with WrongEncoding msg -> Zmq.Socket.send_all socket [ "WRONG" ; msg ] ; None with | Unix.Unix_error( Unix.EAGAIN , _ , _ ) -> None | Zmq.ZMQ_exception(_,msg) -> Senv.fatal "ZeroMQ error: %s" msg (* -------------------------------------------------------------------------- *) (* --- Establish the Server --- *) (* -------------------------------------------------------------------------- *) let establish url = if url <> "" then begin let context = context () in let socket = Zmq.Socket.(create context rep) in try Zmq.Socket.bind socket url ; Senv.feedback "ZeroMQ [%s]" url ; Main.run ~pretty:Format.pp_print_string ~fetch:(fetch socket) () ; Zmq.Socket.close socket ; with exn -> Zmq.Socket.close socket ; raise exn end (* -------------------------------------------------------------------------- *) (* --- Establish the Server from Command line --- *) (* -------------------------------------------------------------------------- *) let () = Db.Main.extend (fun () -> establish (Enabled.get ())) (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/syntax.ml���������������������������������������������������0000666�0000000�0000000�00000011345�13571573400�016655� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) module Senv = Server_parameters let check_plugin plugin name = let p = String.lowercase_ascii plugin in let n = String.lowercase_ascii name in let k = String.length plugin in if not (String.length name > k && String.sub n 0 k = p && String.get n k = '-') then Senv.warning ~wkey:Senv.wpage "Data %S shall be named « %s-* »" name plugin let check_page page name = match Doc.chapter page with | `Kernel -> () | `Plugin plugin -> check_plugin plugin name | `Protocol -> check_plugin "server" name let re_name = Str.regexp "[a-z0-9-]+$" let check_name name = if not (Str.string_match re_name name 0) then Senv.warning ~wkey:Senv.wname "Data name %S is not a dash-separated list of lowercase identifiers" name (* -------------------------------------------------------------------------- *) type t = { atomic:bool ; text:Markdown.text } let atom md = { atomic=true ; text=md } let flow md = { atomic=false ; text=md } let text { text } = text let protect a = if a.atomic then a.text else Markdown.(plain "(" @ a.text @ plain ")") let publish ~page ~name ~descr ~synopsis ?(details = []) () = check_name name ; check_page page name ; let id = Printf.sprintf "data-%s" name in let title = Printf.sprintf "`DATA` %s" name in let dref = Doc.href page id in let dlink = Markdown.href ~text:(Markdown.emph name) dref in let syntax = Markdown.(glue [ plain "<" ; dlink ; plain ">" ; plain ":=" ; synopsis.text ]) in let content = Markdown.(Block ( text descr @ text syntax ) :: details) in let _href = Doc.publish ~page ~name:id ~title ~index:[name] content [] in atom dlink let unit = atom @@ Markdown.plain "-" let any = atom @@ Markdown.emph "any" let int = atom @@ Markdown.emph "int" let ident = atom @@ Markdown.emph "ident" let string = atom @@ Markdown.emph "string" let number = atom @@ Markdown.emph "number" let boolean = atom @@ Markdown.emph "boolean" let escaped name = Markdown.code (Printf.sprintf "'%s'" @@ String.escaped name) let tag name = atom @@ escaped name let array a = atom @@ Markdown.(code "[" @ protect a @ code ", … ]") let tuple ts = atom @@ Markdown.( code "[" @ glue ~sep:(code ",") (List.map protect ts) @ code "]" ) let union ts = flow @@ Markdown.(glue ~sep:(plain "|") (List.map protect ts)) let option t = atom @@ Markdown.(protect t @ code "?") let field (a,t) = Markdown.( escaped a @ code ":" @ t.text ) let record fds = let fields = if fds = [] then Markdown.plain "…" else Markdown.(glue ~sep:(code ";") (List.map field fds)) in atom @@ Markdown.(code "{" @ fields @ code "}") type field = { name : string ; syntax : t ; descr : Markdown.text ; } let fields ~title (fds : field list) = let open Markdown in let header = [ plain title, Left; plain "Format", Center; plain "Description", Left ] in let column f = [ code f.name ; f.syntax.text ; f.descr ] in Markdown.Table { caption = None ; header ; content = List.map column fds ; } (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/server/syntax.mli��������������������������������������������������0000666�0000000�0000000�00000005304�13571573400�017024� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** JSON Encoding Documentation *) (* -------------------------------------------------------------------------- *) type t val text : t -> Markdown.text (** The provided synopsis must be very short, to fit in one line. Extended definition, like record fields and such, must be detailed in the description block. *) val publish : page:Doc.page -> name:string -> descr:Markdown.text -> synopsis:t -> ?details:Markdown.elements -> unit -> t val unit : t val any : t val int : t (* small, non-decimal, number *) val ident : t (* integer of string *) val string : t val number : t val boolean : t val tag : string -> t val array : t -> t val tuple : t list -> t val union : t list -> t val option : t -> t val record : (string * t) list -> t type field = { name : string ; syntax : t ; descr : Markdown.text } (** Builds a table with fields column named with [~title] (shall be capitalized) *) val fields : title:string -> field list -> Markdown.element (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/�����������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015113� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/Slicing.mli������������������������������������������������0000666�0000000�0000000�00000057726�13571573400�017227� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype (** Slicing API. *) module Api:sig val self: State.t (** Internal state of the slicing tool from project viewpoints. *) val set_modes : ?calls:int -> ?callers:bool -> ?sliceUndef:bool -> ?keepAnnotations:bool -> unit -> unit (** Sets slicing parameters related to command line options [-slicing-level], [-slice-callers], [-slice-undef-functions], [-slicing-keep-annotations]. @modify Sulfur-20171101 the optional argument and the related deprecated option [-slice-print] have been removed. *) (* ---------------------------------------------------------------------- *) (** Slicing project management. *) module Project : sig val reset_slicing : unit -> unit (** Function that can be used for: - initializing the slicing tool before starting a slicing project; - removing all computed slices and all internal pending requests of the current slicing project. *) (** {3 Kernel function} *) val is_called : kernel_function -> bool (** Return [true] iff the source function is called (even indirectly via transitivity) from a [Slice.t]. *) val has_persistent_selection : kernel_function -> bool (** Return [true] iff the source function has persistent selection *) val change_slicing_level : kernel_function -> int -> unit (** Change the slicing level of this function (see the [-slicing-level] option documentation to know the meaning of the number). @raise SlicingTypes.ExternalFunction if [kf] has no definition. @raise SlicingTypes.WrongSlicingLevel if [n] is not valid. *) (** {3 Extraction} *) val default_slice_names : kernel_function -> bool -> int -> string (** Default function used for the optional [?f_slice_names] argument of [extract] function. *) val extract : ?f_slice_names:(kernel_function -> bool -> int -> string) -> string -> Project.t (** Build a new [Db.Project.t] from all [Slice.t] of a project. The string argument is used for naming the new project. Can optionally specify how to name the sliced functions by defining [f_slice_names]. [f_slice_names kf src_visi num_slice] has to return the name of the exported functions based on the source function [kf]. - [src_visi] tells if the source function name is used (if not, it can be used for a slice) - [num_slice] gives the number of the slice to name. The entry point function is only exported once : it is VERY recommended to give to it its original name, even if it is sliced. @modify Sulfur-20171101 argument order and arity. *) (** {3 Not for casual users} *) val is_directly_called_internal : kernel_function -> bool (** Return [true] if the source function is directly (even via pointer function) called from a [Slice.t]. *) val print_dot : filename:string -> title:string -> unit (** May be used to for debugging... Pretty print a representation of the slicing project (call graph) in a dot file which name is the given string. *) val pretty : Format.formatter -> unit (** May be used for debugging... Pretty print project information. *) end (* ---------------------------------------------------------------------- *) (** Access to slicing results. *) module Mark : sig type t (** Abstract data type for mark value. *) val dyn_t : t Type.t (** For dynamic type checking and journalization. *) val make : data:bool -> addr:bool -> ctrl:bool -> t (** To construct a mark such as [(is_ctrl result, is_data result, isaddr result) = (~ctrl, ~data, ~addr)], [(is_bottom result) = false] and [(is_spare result) = not (~ctrl || ~data || ~addr)]. *) val compare : t -> t -> int (** A total ordering function similar to the generic structural comparison function [compare]. Can be used to build a map from [t] marks to, for example, colors for the GUI. *) val is_bottom : t -> bool (** [true] iff the mark is empty: it is the only case where the associated element is invisible. *) val is_spare : t -> bool (** Smallest visible mark. Usually used to mark element that need to be visible for compilation purpose, not really for the selected computations. *) val is_data : t -> bool (** The element is used to compute selected data. Notice that a mark can be [is_data] and/or [is_ctrl] and/or [is_addr] at the same time. *) val is_ctrl : t -> bool (** The element is used to control the program point of a selected data. *) val is_addr : t -> bool (** The element is used to compute the address of a selected data. *) val get_from_src_func : kernel_function -> t (** The mark [m] related to all statements of a source function [kf]. Property : [is_bottom (get_from_func proj kf) = not (Project.is_called proj kf) ] *) (** {3 Not for casual users} *) val pretty : Format.formatter -> t -> unit (** May be used for debugging... Pretty mark information. *) end (* ---------------------------------------------------------------------- *) (** Slicing selections. *) module Select : sig type t (** Internal selection. *) val dyn_t : t Type.t (** For dynamic type checking and journalization. *) type set (** Set of colored selections. *) val dyn_set : set Type.t (** For dynamic type checking and journalization. *) (** {3 Journalized selectors} *) val empty_selects : set (** Empty selection. *) val select_stmt : set -> spare:bool -> stmt -> kernel_function -> set (** To select a statement. *) val select_stmt_ctrl : set -> spare:bool -> stmt -> kernel_function -> set (** To select a statement reachability. Note: add also a transparent selection on the whole statement. *) val select_stmt_lval_rw : (set -> Mark.t -> rd:Datatype.String.Set.t -> wr:Datatype.String.Set.t -> stmt -> eval:stmt -> kernel_function -> set) (** To select rw accesses to lvalues (given as a string) related to a statement. Variable names used in the sets of strings [~rd] and [~wr] are relative to the function scope. The interpretation of the address of the lvalues is done just before the execution of the statement [~eval]. The selection preserves the [~rd] and ~[wr] accesses contained into the statement [ki]. Note: add also a transparent selection on the whole statement. @modify Magnesium-20151001 argument [~scope] removed. *) val select_stmt_lval : (set -> Mark.t -> Datatype.String.Set.t -> before:bool -> stmt -> eval:stmt -> kernel_function -> set) (** To select lvalues (given as string) related to a statement. Variable names used in the sets of strings [~rd] and [~wr] are relative to the function scope. The interpretation of the address of the lvalue is done just before the execution of the statement [~eval]. The selection preserve the value of these lvalues before or after (c.f. boolean [~before]) the statement [ki]. Note: add also a transparent selection on the whole statement. @modify Magnesium-20151001 argument [~scope] removed. *) val select_stmt_annots : (set -> Mark.t -> spare:bool -> threat:bool -> user_assert:bool -> slicing_pragma:bool -> loop_inv:bool -> loop_var:bool -> stmt -> kernel_function -> set) (** To select the annotations related to a statement. Note: add also a transparent selection on the whole statement. *) val select_func_lval_rw : (set -> Mark.t -> rd:Datatype.String.Set.t -> wr:Datatype.String.Set.t -> eval:stmt -> kernel_function -> set) (** To select rw accesses to lvalues (given as a string) related to a function. Variable names used in the sets of strings [~rd] and [~wr] are relative to the function scope. The interpretation of the address of the lvalues is done just before the execution of the statement [~eval]. The selection preserve the value of these lvalues into the whole project. @modify Magnesium-20151001 argument [~scope] removed. *) val select_func_lval : (set -> Mark.t -> Datatype.String.Set.t -> kernel_function -> set) (** To select lvalues (given as a string) related to a function. Variable names used in the sets of strings [lval_str] string are relative to the scope of the first statement of [kf]. The interpretation of the address of the lvalues is done just before the execution of the first statement [kf]. The selection preserve the value of these lvalues before execution of the return statement. *) val select_func_return : set -> spare:bool -> kernel_function -> set (** To select the function result (returned value). *) val select_func_calls_to : set -> spare:bool -> kernel_function -> set (** To select every calls to the given function, i.e. the call keeps its semantics in the slice. *) val select_func_calls_into : set -> spare:bool -> kernel_function -> set (** To select every calls to the given function without the selection of its inputs/outputs. *) val select_func_annots : (set -> Mark.t -> spare:bool -> threat:bool -> user_assert:bool -> slicing_pragma:bool -> loop_inv:bool -> loop_var:bool -> kernel_function -> set) (** To select the annotations related to a function. *) (** {3 Selectors that are not journalized} *) val select_func_zone : (set -> Mark.t -> Locations.Zone.t -> kernel_function -> set) (** To select an output zone related to a function. *) val select_stmt_zone : (set -> Mark.t -> Locations.Zone.t -> before:bool -> stmt -> kernel_function -> set) (** To select a zone value related to a statement. Note: add also a transparent selection on the whole statement. *) val select_stmt_term : (set -> Mark.t -> term -> stmt -> kernel_function -> set) (** To select a predicate value related to a statement. Note: add also a transparent selection on the whole statement. *) val select_stmt_pred : (set -> Mark.t -> predicate -> stmt -> kernel_function -> set) (** To select a predicate value related to a statement. Note: add also a transparent selection on the whole statement. *) val select_stmt_annot : (set -> Mark.t -> spare:bool -> code_annotation -> stmt -> kernel_function -> set) (** To select the annotations related to a statement. Note: add also a transparent selection on the whole statement. *) val select_pdg_nodes : (set -> Mark.t -> PdgTypes.Node.t list -> kernel_function -> set) (** To select nodes of the PDG - if [is_ctrl_mark m], propagate ctrl_mark on ctrl dependencies - if [is_addr_mark m], propagate addr_mark on addr dependencies - if [is_data_mark m], propagate data_mark on data dependencies - mark the node with a spare_mark and propagate so that the dependencies that were not selected yet will be marked spare. *) (** {3 Not for casual users and not journalized} *) val get_function : t -> kernel_function (** May be used to get the function related to an internal selection. *) val merge_internal : t -> t -> t val add_to_selects_internal : t -> set -> set val iter_selects_internal : (t -> unit) -> set -> unit val fold_selects_internal : ('a -> t -> 'a) -> 'a -> set -> 'a val select_stmt_internal : (kernel_function -> ?select:t -> stmt -> Mark.t -> t) (** May be used to select a statement : - if [is_ctrl_mark m], propagates ctrl_mark on ctrl dependencies of the statement - if [is_addr_mark m], propagates addr_mark on addr dependencies of the statement - if [is_data_mark m], propagates data_mark on data dependencies of the statement - otherwise, marks the node with a spare_mark and propagate so that the dependencies that were not selected yet will be marked spare. When the statement is a call, its functional inputs/outputs are also selected (The call is still selected even it has no output). When the statement is a composed one (block, if, etc...), all the sub-statements are selected. @raise SlicingTypes.NoPdg when there is no PDG for the [kernel_function] (related to [PdgTypes.Pdg.is_top]). *) val select_label_internal : (kernel_function -> ?select:t -> Logic_label.t -> Mark.t -> t) (** May be used to select a label. *) val select_min_call_internal : (kernel_function -> ?select:t -> stmt -> Mark.t -> t) (** May be used to select a statement call without its inputs/outputs so that it doesn't select the statements computing the inputs of the called function as [select_stmt_internal] would do. @raise Invalid_argument when the [stmt] isn't a call. @raise SlicingTypes.NoPdg when there is no PDG for the [kernel_function] (related to [PdgTypes.Pdg.is_top]). *) val select_stmt_zone_internal : (kernel_function -> ?select:t -> stmt -> before:bool -> Locations.Zone.t -> Mark.t -> t) (** May be used to select a zone value at a program point. @raise SlicingTypes.NoPdg when there is no PDG for the [kernel_function] (related to [PdgTypes.Pdg.is_top]). *) val select_zone_at_entry_point_internal : (kernel_function -> ?select:t -> Locations.Zone.t -> Mark.t -> t) (** May be used to select a zone value at the beginning of a function. For a defined function, it is similar to [select_stmt_zone_internal] with the initial statement, but it can also be used for undefined functions. @raise SlicingTypes.NoPdg when there is no PDG for the [kernel_function] (related to [PdgTypes.Pdg.is_top]). *) val select_zone_at_end_internal : (kernel_function -> ?select:t -> Locations.Zone.t -> Mark.t -> t) (** May be used to select a zone value at the end of a function. For a defined function, it is similar to [select_stmt_zone_internal] with the return statement, but it can also be used for undefined functions. @raise SlicingTypes.NoPdg when there is no PDG for the [kernel_function] (related to [PdgTypes.Pdg.is_top]). *) val select_modified_output_zone_internal : (kernel_function -> ?select:t -> Locations.Zone.t -> Mark.t -> t) (** May be used to select the statements that modify the given zone considered as in output. Be careful that it is NOT the same as selecting the zone at the end! (the 'undef' zone is not propagated...). *) val select_stmt_ctrl_internal : kernel_function -> ?select:t -> stmt -> t (** May be used to select a statement reachability : Only propagate a ctrl_mark on the statement control dependencies. @raise SlicingTypes.NoPdg when there is no PDG for the [kernel_function] (related to [PdgTypes.Pdg.is_top]). *) val select_entry_point_internal : (kernel_function -> ?select:t -> Mark.t -> t) val select_return_internal : (kernel_function -> ?select:t -> Mark.t -> t) val select_decl_var_internal : (kernel_function -> ?select:t -> Cil_types.varinfo -> Mark.t -> t) val select_pdg_nodes_internal : (kernel_function -> ?select:t -> PdgTypes.Node.t list -> Mark.t -> t) (** May be used to select PDG nodes. *) val pretty : Format.formatter -> t -> unit (** May be used for debugging... Pretty mark information. *) end (* ---------------------------------------------------------------------- *) (** Function slice. *) module Slice : sig type t (** Abstract data type for function slice. *) val dyn_t : t Type.t (** For dynamic type checking and journalization. *) val create : kernel_function -> t (** Used to get an empty slice (nothing selected) related to a function. *) val remove : t -> unit (** Remove the slice from the project. The slice shouldn't be called. *) val remove_uncalled : unit -> unit (** Remove the uncalled slice from the project. *) (** {3 Getters} *) val get_all: kernel_function -> t list (** Get all slices related to a function. *) val get_function : t -> kernel_function (** To get the function related to a slice *) val get_callers : t -> t list (** Get the slices having direct calls to a slice. *) val get_called_slice : t -> stmt -> t option (** To get the slice directly called by the statement of a slice. Returns None when the statement mark is bottom, or else the statement isn't a call or else the statement is a call to one or several (via pointer) source functions. *) val get_called_funcs : t -> stmt -> kernel_function list (** To get the source functions called by the statement of a slice. Returns an empty list when the statement mark is bottom, or else the statement isn't a call or else the statement is a call to a function slice. *) val get_mark_from_stmt : t -> stmt -> Mark.t (** Get the mark value of a statement. *) val get_mark_from_label : t -> stmt -> Cil_types.label -> Mark.t (** Get the mark value of a label. *) val get_mark_from_local_var : t -> varinfo -> Mark.t (** Get the mark value of local variable. *) val get_mark_from_formal : t -> varinfo -> Mark.t (** Get the mark from the formal of a function. *) val get_user_mark_from_inputs : t -> Mark.t (** Get a mark that is the merged user inputs marks of the slice *) (** {3 Not for casual users} *) val get_num_id : t -> int val from_num_id : kernel_function -> int -> t val pretty : Format.formatter -> t -> unit (** May be used for debugging... Pretty print slice information. *) end (* ---------------------------------------------------------------------- *) (** Requests for slicing jobs. Slicing requests are part of a slicing project. So, user requests affect slicing project. *) module Request : sig (** {3 Applying the added requests} *) val apply_all: propagate_to_callers:bool -> unit (** Apply all slicing requests. *) (** {3 Adding slicing requests} *) val add_selection: Select.set -> unit (** Add a selection request to all (existing) slices of a function to the project requests. *) val add_persistent_selection: Select.set -> unit (** Add a persistent selection request to all slices (already existing or created later) of a function to the project requests. *) val add_persistent_cmdline : unit -> unit (** Add persistent selection from the command line. *) (** {3 Not for casual users and not journalized} *) val add_slice_selection_internal:Slice.t -> Select.t -> unit (** May be used to add a selection request for a function slice to the project requests. *) val add_selection_internal: Select.t -> unit (** May be used to add a selection request to the project requests. This selection will be applied to every slicies of the function (already existing or created later). *) val add_call_slice:caller:Slice.t -> to_call:Slice.t -> unit (** May be used to change every call to any [to_call] source or specialisation in order to call [to_call] in [caller]. *) val add_call_fun: caller:Slice.t -> to_call:kernel_function -> unit (** May be used to change every call to any [to_call] source or specialisation in order to call the source function [to_call] in [caller]. *) val add_call_min_fun: caller:Slice.t -> to_call:kernel_function -> unit (** May be used to change each call to [to_call] in [caller] such that, at least, it will be visible at the end, ie. call either the source function or one of [to_call] slice (depending on the [slicing_level]). *) val is_request_empty_internal: unit -> bool (** May be used to know if internal requests are pending. *) (* REMOVED: val is_already_selected_internal: Slice.t -> Select.t -> bool *) (** Return true when the requested selection is already selected into the slice. *) val apply_all_internal: unit -> unit (** May be used to apply all slicing requests. *) val apply_next_internal: unit -> unit (** May be used to apply the first slicing request of the project list and remove it from the list. That may modify the contents of the remaining list. For example, new requests may be added to the list. *) val merge_slices: Slice.t -> Slice.t -> replace:bool -> Slice.t (** May be used to build a new slice which marks is a merge of the two given slices. [choose_call] requests are added to the project in order to choose the called functions for this new slice. If [replace] is true, more requests are added to call this new slice instead of the two original slices. When these requests will be applied, the user will be able to remove those two slices using [Db.Slicing.Slice.remove]. *) val copy_slice: Slice.t -> Slice.t (** May be used to copy the input slice. The new slice is not called, so it is the user responsibility to change the calls if he wants to. *) val split_slice: Slice.t -> Slice.t list (** May be used to copy the input slice to have one slice for each call of the original slice and generate requests in order to call them. @return the newly created slices. *) val propagate_user_marks : unit -> unit (** May be used to apply pending request then propagate user marks to callers recursively then apply pending requests *) val pretty : Format.formatter -> unit (** May be used for debugging... Pretty print the request list. *) end end (* ---------------------------------------------------------------------- *) (** For debugging purpose only. API used by the tests of slicing (see tests/slicing/libSelect.ml). *) module PrintSlice: sig val print_fct_stmts: Format.formatter -> kernel_function -> unit end (* Local Variables: compile-command: "make -C ../.." End: *) ������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/api.ml�����������������������������������������������������0000666�0000000�0000000�00000047706�13571573400�016234� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype (* ---------------------------------------------------------------------- *) (** Global data management *) let split_slice s = SlicingParameters.debug ~level:1 "[Api.split_slice]"; SlicingProject.split_slice s let merge_slices ff_1 ff_2 ~replace = SlicingParameters.debug ~level:1 "[Api.merge_slices]"; SlicingProject.merge_slices ff_1 ff_2 replace let copy_slice ff = SlicingParameters.debug ~level:1 "[Api.copy_slice]"; Fct_slice.copy_slice ff (* ---------------------------------------------------------------------- *) (** {1 Global setting } *) let self = SlicingState.self (* ---------------------------------------------------------------------- *) (** {2 Functions with journalized side effects } *) let set_modes calls callers sliceUndef keepAnnotations () = SlicingParameters.Mode.Calls.set calls ; SlicingParameters.Mode.Callers.set callers ; SlicingParameters.Mode.SliceUndef.set sliceUndef; SlicingParameters.Mode.KeepAnnotations.set keepAnnotations let set_modes = Journal.register "Slicing.Api.set_modes" (Datatype.func4 ~label1:("calls", None) Datatype.int ~label2:("callers", None) Datatype.bool ~label3:("sliceUndef", None) Datatype.bool ~label4:("keepAnnotations", None) Datatype.bool (Datatype.func Datatype.unit Datatype.unit)) set_modes let set_modes ?(calls=SlicingParameters.Mode.Calls.get ()) ?(callers=SlicingParameters.Mode.Callers.get ()) ?(sliceUndef=SlicingParameters.Mode.SliceUndef.get ()) ?(keepAnnotations=SlicingParameters.Mode.KeepAnnotations.get ()) () = set_modes calls callers sliceUndef keepAnnotations () (* ---------------------------------------------------------------------- *) (** {1 Slicing project } *) module Project = struct (** {2 Values } *) let default_slice_names = SlicingTransform.default_slice_names let () = Journal.Binding.add (Datatype.func3 Kernel_function.ty Datatype.bool Datatype.int Datatype.string) default_slice_names "Slicing.Api.Project.default_slice_names" (** {2 Functions with journalized side effects } *) let reset_slicing = Journal.register "Slicing.Api.Project.reset_slicing" (Datatype.func Datatype.unit Datatype.unit) SlicingState.reset_slicing let extract f_slice_names = SlicingTransform.extract ~f_slice_names let extract = Journal.register "Slicing.Api.Project.extract" (Datatype.func2 ~label1:("f_slice_names", Some (fun () -> default_slice_names)) (Datatype.func3 Kernel_function.ty Datatype.bool Datatype.int Datatype.string) Datatype.string Project.ty) extract let extract ?(f_slice_names=default_slice_names) new_proj_name = extract f_slice_names new_proj_name let print_dot = PrintSlice.build_dot_project let print_dot = Journal.register "Slicing.Api.Project.print_dot" (Datatype.func2 ~label1:("filename", None) Datatype.string ~label2:("title", None) Datatype.string Datatype.unit) print_dot let print_dot ~filename ~title = print_dot filename title let change_slicing_level = Journal.register "Slicing.Api.Project.change_slicing_level" (Datatype.func2 Kernel_function.ty Datatype.int Datatype.unit) SlicingMacros.change_slicing_level (** {2 No needs of Journalization} *) let is_directly_called_internal = SlicingMacros.is_src_fun_called let is_called = Fct_slice.is_src_fun_called let has_persistent_selection = SlicingMacros.has_persistent_selection (** {2 Debug} *) let pretty = SlicingProject.print_project_and_worklist end (* ---------------------------------------------------------------------- *) (** {1 Mark} *) module Mark = struct type t = SlicingTypes.sl_mark let dyn_t = SlicingTypes.dyn_sl_mark (** {2 No needs of Journalization} *) let compare = SlicingMarks.compare_marks let pretty = SlicingMarks.pretty_mark let make = SlicingMarks.mk_user_mark let is_bottom = SlicingMarks.is_bottom_mark let is_spare = SlicingMarks.is_spare_mark let is_ctrl = SlicingMarks.is_ctrl_mark let is_data = SlicingMarks.is_addr_mark let is_addr = SlicingMarks.is_data_mark let get_from_src_func = Fct_slice.get_mark_from_src_fun end (* ---------------------------------------------------------------------- *) (** {1 Selection} *) module Select = struct type t = SlicingTypes.sl_select let dyn_t = SlicingTypes.Sl_select.ty type set = SlicingCmds.set module S = Cil_datatype.Varinfo.Map.Make(SlicingTypes.Fct_user_crit) let dyn_set = S.ty (** {2 Journalized selectors } *) let empty_selects = Journal.register "Slicing.Api.Select.empty_selects" dyn_set Cil_datatype.Varinfo.Map.empty let select_stmt set spare = SlicingCmds.select_stmt set ~spare let select_stmt = Journal.register "Slicing.Api.Select.select_stmt" (Datatype.func4 dyn_set ~label2:("spare", None) Datatype.bool Stmt.ty Kernel_function.ty dyn_set) select_stmt let select_stmt set ~spare = select_stmt set spare let select_stmt_ctrl set spare = SlicingCmds.select_stmt_ctrl set ~spare let select_stmt_ctrl = Journal.register "Slicing.Api.Select.select_stmt_ctrl" (Datatype.func4 dyn_set ~label2:("spare", None) Datatype.bool Stmt.ty Kernel_function.ty dyn_set) select_stmt_ctrl let select_stmt_ctrl set ~spare = select_stmt_ctrl set spare let select_stmt_lval_rw set mark rd wr stmt eval = SlicingCmds.select_stmt_lval_rw set mark ~rd ~wr stmt ~eval let select_stmt_lval_rw = Journal.register "Slicing.ApiSelect.select_stmt_lval_rw" (Datatype.func4 dyn_set SlicingTypes.dyn_sl_mark ~label3:("rd", None) Datatype.String.Set.ty ~label4:("wr", None) Datatype.String.Set.ty (Datatype.func3 Stmt.ty ~label2:("eval", None) Stmt.ty Kernel_function.ty dyn_set)) select_stmt_lval_rw let select_stmt_lval_rw set mark ~rd ~wr stmt ~eval = select_stmt_lval_rw set mark rd wr stmt eval let select_stmt_lval set mark lval before stmt eval = SlicingCmds.select_stmt_lval set mark lval ~before stmt ~eval let select_stmt_lval = Journal.register "Slicing.Api.Select.select_stmt_lval" (Datatype.func4 dyn_set Mark.dyn_t Datatype.String.Set.ty ~label4:("before", None) Datatype.bool (Datatype.func3 Stmt.ty ~label2:("eval", None) Stmt.ty Kernel_function.ty dyn_set)) select_stmt_lval let select_stmt_lval set mark lval ~before stmt ~eval = select_stmt_lval set mark lval before stmt eval let select_stmt_annots set mark spare threat user_assert slicing_pragma loop_inv loop_var = SlicingCmds.select_stmt_annots set mark ~spare ~threat ~user_assert ~slicing_pragma ~loop_inv ~loop_var let select_stmt_annots = Journal.register "Slicing.Api.Select.select_stmt_annots" (Datatype.func4 dyn_set Mark.dyn_t ~label3:("spare", None) Datatype.bool ~label4:("threat", None) Datatype.bool (Datatype.func4 ~label1:("user_assert", None) Datatype.bool ~label2:("slicing_pragma", None) Datatype.bool ~label3:("loop_inv", None) Datatype.bool ~label4:("loop_var", None) Datatype.bool (Datatype.func2 Stmt.ty Kernel_function.ty dyn_set))) select_stmt_annots let select_stmt_annots set mark ~spare ~threat ~user_assert ~slicing_pragma ~loop_inv ~loop_var = select_stmt_annots set mark spare threat user_assert slicing_pragma loop_inv loop_var let select_func_lval = Journal.register "Slicing.Api.Select.select_func_lval" (Datatype.func4 dyn_set Mark.dyn_t Datatype.String.Set.ty Kernel_function.ty dyn_set) SlicingCmds.select_func_lval let select_func_lval_rw set mark rd wr eval = SlicingCmds.select_func_lval_rw set mark ~rd ~wr ~eval let select_func_lval_rw = Journal.register "Slicing.Api.Select.select_func_lval_rw" (Datatype.func4 dyn_set Mark.dyn_t ~label3:("rd", None) Datatype.String.Set.ty ~label4:("wr", None) Datatype.String.Set.ty (Datatype.func2 ~label1:("eval", None) Stmt.ty Kernel_function.ty dyn_set)) select_func_lval_rw let select_func_lval_rw set mark ~rd ~wr ~eval = select_func_lval_rw set mark rd wr eval let select_func_return set spare = SlicingCmds.select_func_return set ~spare let select_func_return = Journal.register "Slicing.Api.Select.select_func_return" (Datatype.func3 dyn_set ~label2:("spare", None) Datatype.bool Kernel_function.ty dyn_set) select_func_return let select_func_return set ~spare = select_func_return set spare let select_func_calls_to set spare = SlicingCmds.select_func_calls_to set ~spare let select_func_calls_to = Journal.register "Slicing.Api.Select.select_func_calls_to" (Datatype.func3 dyn_set ~label2:("spare", None) Datatype.bool Kernel_function.ty dyn_set) select_func_calls_to let select_func_calls_to set ~spare = select_func_calls_to set spare let select_func_calls_into set spare = SlicingCmds.select_func_calls_into set ~spare let select_func_calls_into = Journal.register "Slicing.Api.Select.select_func_calls_into" (Datatype.func3 dyn_set ~label2:("spare", None) Datatype.bool Kernel_function.ty dyn_set) select_func_calls_into let select_func_calls_into set ~spare = select_func_calls_into set spare let select_func_annots set mark spare threat user_assert slicing_pragma loop_inv loop_var = SlicingCmds.select_func_annots set mark ~spare ~threat ~user_assert ~slicing_pragma ~loop_inv ~loop_var let select_func_annots = Journal.register "Slicing.Api.Select.select_func_annots" (Datatype.func4 dyn_set Mark.dyn_t ~label3:("spare", None) Datatype.bool ~label4:("threat", None) Datatype.bool (Datatype.func4 ~label1:("user_assert", None) Datatype.bool ~label2:("slicing_pragma", None) Datatype.bool ~label3:("loop_inv", None) Datatype.bool ~label4:("loop_var", None) Datatype.bool (Datatype.func Kernel_function.ty dyn_set))) select_func_annots let select_func_annots set mark ~spare ~threat ~user_assert ~slicing_pragma ~loop_inv ~loop_var = select_func_annots set mark spare threat user_assert slicing_pragma loop_inv loop_var (** {2 No Journalization} *) let select_func_zone = SlicingCmds.select_func_zone let select_stmt_term = SlicingCmds.select_stmt_term let select_stmt_pred = SlicingCmds.select_stmt_pred let select_stmt_annot = SlicingCmds.select_stmt_annot let select_stmt_zone = SlicingCmds.select_stmt_zone let select_pdg_nodes = SlicingCmds.select_pdg_nodes (** {2 No Journalization} *) let get_function = SlicingCmds.get_select_kf let merge_internal = SlicingSelect.merge_db_select let add_to_selects_internal = SlicingSelect.Selections.add_to_selects let iter_selects_internal = SlicingSelect.Selections.iter_selects_internal let fold_selects_internal = SlicingSelect.Selections.fold_selects_internal let select_stmt_internal = SlicingSelect.select_stmt_computation let select_label_internal = SlicingSelect.select_label let select_min_call_internal = SlicingSelect.select_minimal_call let select_stmt_zone_internal = SlicingSelect.select_stmt_zone let select_zone_at_entry_point_internal = SlicingSelect.select_zone_at_entry let select_zone_at_end_internal = SlicingSelect.select_zone_at_end let select_modified_output_zone_internal = SlicingSelect.select_modified_output_zone let select_stmt_ctrl_internal = SlicingSelect.select_stmt_ctrl let select_entry_point_internal = SlicingSelect.select_entry_point let select_return_internal = SlicingSelect.select_return let select_decl_var_internal = SlicingSelect.select_decl_var let select_pdg_nodes_internal = SlicingSelect.select_pdg_nodes (** {2 Debug} *) let pretty = SlicingSelect.print_select end (* ---------------------------------------------------------------------- *) (** {1 Slice} *) module Slice = struct type t = SlicingTypes.sl_fct_slice let dyn_t = SlicingTypes.dyn_sl_fct_slice (** {2 Functions with journalized side effects } *) let create = Journal.register "Slicing.Api.Slice.create" (Datatype.func Kernel_function.ty dyn_t) SlicingProject.create_slice let remove = Journal.register "Slicing.Api.Slice.remove" (Datatype.func dyn_t Datatype.unit) SlicingProject.remove_ff let remove_uncalled = Journal.register "Slicing.Api.Slice.remove_uncalled" (Datatype.func Datatype.unit Datatype.unit) SlicingProject.remove_uncalled_slices (** {2 No needs of Journalization} *) let get_all = SlicingProject.get_slices let get_function = SlicingMacros.get_ff_kf let get_callers = SlicingProject.get_slice_callers let get_called_slice ff stmt = match stmt.skind with | Instr (Call _ | Local_init (_, ConsInit _, _)) -> fst (Fct_slice.get_called_slice ff stmt) | _ -> None let get_called_funcs ff stmt = match stmt.skind with | Instr (Call (_,expr_f,_,_)) -> if snd (Fct_slice.get_called_slice ff stmt) then Kernel_function.Hptset.elements (snd (!Db.Value.expr_to_kernel_function (Kstmt stmt) ~deps:None expr_f)) else [] | Instr (Local_init (_, ConsInit (f, _, _), _)) -> [ Globals.Functions.get f ] | _ -> [] let get_mark_from_stmt = Fct_slice.get_stmt_mark let get_mark_from_label = Fct_slice.get_label_mark let get_mark_from_local_var = Fct_slice.get_local_var_mark let get_mark_from_formal ff var = let kf = SlicingMacros.get_ff_kf ff in let param_list = Kernel_function.get_formals kf in let rec find n var_list = match var_list with | [] -> raise Not_found | v :: var_list -> if Cil_datatype.Varinfo.equal v var then n else find (n+1) var_list in let n = find 1 param_list in Fct_slice.get_param_mark ff n let get_user_mark_from_inputs = Fct_slice.merge_inputs_m1_mark let get_num_id = SlicingMacros.get_ff_id let from_num_id kf num = List.find (fun f -> num = SlicingMacros.get_ff_id f) (SlicingProject.get_slices kf) (** {2 Debug} *) let pretty = SlicingProject.pretty_slice end (* ---------------------------------------------------------------------- *) (** {1 Slicing request} *) module Request = struct (** {2 Functions with journalized side effects } *) let apply_all propagate_to_callers = SlicingCmds.apply_all ~propagate_to_callers let apply_all = Journal.register "Slicing.Api.Request.apply_all" (Datatype.func ~label:("propagate_to_callers", None) Datatype.bool Datatype.unit) apply_all let apply_all ~propagate_to_callers = apply_all propagate_to_callers let apply_all_internal = Journal.register "Slicing.Api.Request.apply_all_internal" (Datatype.func Datatype.unit Datatype.unit) SlicingCmds.apply_all_actions let apply_next_internal = Journal.register "Slicing.Api.Request.apply_next_internal" (Datatype.func Datatype.unit Datatype.unit) SlicingCmds.apply_next_action let propagate_user_marks = Journal.register "Slicing.Api.Request.propagate_user_marks" (Datatype.func Datatype.unit Datatype.unit) SlicingCmds.topologic_propagation let copy_slice = Journal.register "Slicing.Api.Request.copy_slice" (Datatype.func Slice.dyn_t Slice.dyn_t) copy_slice let split_slice = Journal.register "Slicing.Api.Request.split_slice" (Datatype.func Slice.dyn_t (Datatype.list Slice.dyn_t)) split_slice let merge_slices ff_1 ff_2 replace = merge_slices ff_1 ff_2 ~replace let merge_slices = Journal.register "Slicing.Api.Request.merge_slices" (Datatype.func3 Slice.dyn_t Slice.dyn_t ~label3:("replace", None) Datatype.bool Slice.dyn_t) merge_slices let merge_slices ff_1 ff_2 ~replace = merge_slices ff_1 ff_2 replace let add_call_slice caller to_call = SlicingSelect.call_ff_in_caller ~caller ~to_call let add_call_slice = Journal.register "Slicing.Api.Request.add_call_slice" (Datatype.func2 ~label1:("caller", None) Slice.dyn_t ~label2:("to_call", None) Slice.dyn_t Datatype.unit) add_call_slice let add_call_slice ~caller ~to_call = add_call_slice caller to_call let add_call_fun caller to_call = SlicingSelect.call_fsrc_in_caller ~caller ~to_call let add_call_fun = Journal.register "Slicing.Api.Request.add_call_fun" (Datatype.func2 ~label1:("caller", None) Slice.dyn_t ~label2:("to_call", None) Kernel_function.ty Datatype.unit) add_call_fun let add_call_fun ~caller ~to_call = add_call_fun caller to_call let add_call_min_fun caller to_call = SlicingSelect.call_min_f_in_caller ~caller ~to_call let add_call_min_fun = Journal.register "Slicing.Api.Request.add_call_min_fun" (Datatype.func2 ~label1:("caller", None) Slice.dyn_t ~label2:("to_call", None) Kernel_function.ty Datatype.unit) add_call_min_fun let add_call_min_fun ~caller ~to_call = add_call_min_fun caller to_call let add_selection = Journal.register "Slicing.Request.add_selection" (Datatype.func Select.dyn_set Datatype.unit) SlicingCmds.add_selection let add_persistent_selection = Journal.register "Slicing.Request.add_persistent_selection" (Datatype.func Select.dyn_set Datatype.unit) SlicingCmds.add_persistent_selection let add_persistent_cmdline = Journal.register "Slicing.Request.add_persistent_cmdline" (Datatype.func Datatype.unit Datatype.unit) SlicingCmds.add_persistent_cmdline (** {2 No needs of Journalization} *) let is_request_empty_internal = SlicingProject.is_request_empty let add_slice_selection_internal = SlicingSelect.add_ff_selection let add_selection_internal = SlicingSelect.add_fi_selection (** {2 Debug} *) let pretty = SlicingProject.print_proj_worklist end (* ---------------------------------------------------------------------- *) (* Local Variables: compile-command: "make -C ../.." End: *) ����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/fct_slice.ml�����������������������������������������������0000666�0000000�0000000�00000172222�13571573400�017406� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module deals with slice computation. * It computes a mapping between the PDG nodes and some marks * (see {!module:Fct_slice.FctMarks}), * and also manage interprocedural propagation ({!module:Fct_slice.CallInfo}). * * Most high level function, named [apply_xxx], * like [apply_change_call], [apply_missing_outputs], ..., * correspond the actions defined in the * {{:../../slicing/index.html}specification report}. * * Many functions are modifying the marks of a slice, * so they can return a list of actions to be applied in order to deal with * the propagation in the calls and callers. * * Moreover, some function (named [get_xxx_mark]) are provided to retrieve * the mark of the slice elements. * *) (**/**) open Cil_types (**/**) (* Look at (only once) the callers of [kf] ([kf] included). *) let exists_fun_callers fpred kf = let table = ref Kernel_function.Set.empty in let rec exists_fun_callers kf = if fpred kf then true else if Kernel_function.Set.mem kf !table then false (* no way to call the initial [kf]. *) else begin table := Kernel_function.Set.add kf !table ; List.exists (fun (kf,_) -> exists_fun_callers kf) (!Db.Value.callers kf) end in exists_fun_callers kf let is_src_fun_visible = exists_fun_callers SlicingMacros.is_src_fun_visible let is_src_fun_called kf = let kf_entry, _library = Globals.entry_point () in let fpred f = if (kf_entry == f) then SlicingMacros.is_src_fun_visible f (* for the entry point *) else SlicingMacros.is_src_fun_called f (* for the others *) in exists_fun_callers fpred kf (** Manage the information related to a function call in a slice. * It is composed of the called function if it has been established yet, * and the call signature. Also deals with the [called_by] information. *) module CallInfo : sig type call_id = SlicingInternals.fct_slice * Cil_types.stmt type t val get_info_call : call_id -> t val fold_calls : (Cil_types.stmt -> t -> 'a -> 'a) -> SlicingInternals.fct_slice -> SlicingInternals.marks_index -> 'a -> 'a val get_call_f_called : call_id -> SlicingInternals.called_fct option val get_call_sig : t -> SlicingMarks.sig_marks val get_f_called : t -> SlicingInternals.called_fct option val something_visible : t -> bool val remove_called_by : call_id -> t -> unit val is_call_to_change : t -> SlicingInternals.called_fct option -> bool val change_call : SlicingInternals.marks_index -> call_id -> SlicingInternals.called_fct option -> unit end = struct type call_id = SlicingInternals.fct_slice * Cil_types.stmt type t = call_id * SlicingInternals.called_fct option * SlicingMarks.sig_marks let empty = (None, SlicingMarks.empty_sig) let get_f_called (_id,f,_sgn) = f let get_sig (_id,_f,sgn) = sgn (** find call information (ff_called option + signature of a call) *) let get_info_call call_id = let ff, call = call_id in let f, sgn = try let _, marks = ff.SlicingInternals.ff_marks in match PdgIndex.FctIndex.find_call marks call with | None, sgn -> None, sgn | Some (None), sgn -> None, sgn | Some (Some f), sgn -> Some f, sgn with Not_found -> empty in (call_id, f, sgn) let get_call_f_called call_id = get_f_called (get_info_call call_id) let get_call_sig call_info = get_sig call_info let fold_calls f ff ff_marks acc = let do_it call (c_opt,sgn) a = let info = match c_opt with | None | Some (None) -> ((ff, call), None, sgn) | Some (Some f) -> ((ff, call), Some f, sgn) in f call info a in PdgIndex.FctIndex.fold_calls do_it ff_marks acc let something_visible ci = SlicingMarks.something_visible (get_sig ci) let is_call_to_change ci f_to_call = let old_called = get_f_called ci in match old_called, f_to_call with | None, None -> false | None, _ -> true | Some (SlicingInternals.CallSrc _), Some (SlicingInternals.CallSrc _) -> false | Some (SlicingInternals.CallSrc _), _ -> true | Some (SlicingInternals.CallSlice _), Some (SlicingInternals.CallSrc _) -> true | Some (SlicingInternals.CallSlice _), None -> true | Some (SlicingInternals.CallSlice ff_called), Some (SlicingInternals.CallSlice ff_to_call) -> if (SlicingMacros.equal_ff ff_called ff_to_call) then false else true let indirectly_called_src_functions call_id = let _, stmt = call_id in let funcexp = match stmt.skind with | Instr (Call (_,funcexp,_,_)) -> funcexp | Instr (Local_init (_, ConsInit (f, _, _), _)) -> Cil.evar f | _ -> assert false in let _, called_functions = !Db.Value.expr_to_kernel_function (Kstmt stmt) ~deps:(Some Locations.Zone.bottom) funcexp in Kernel_function.Hptset.elements called_functions (** [call_id] is a call to [g] in [f]. * we don't want [f] to call [g] anymore, so we have to update [g] [called_by] * field. * *) let remove_called_by call_id call_info = let rec remove called_by = match called_by with | [] -> [] | e :: called_by -> if (SlicingMacros.same_ff_call call_id e) then called_by else e::(remove called_by) in SlicingParameters.debug ~level:2 "[Fct_Slice.CallInfo.remove_called_by] -> remove old_called"; let old_called = get_f_called call_info in match old_called with | None -> () | Some (SlicingInternals.CallSlice g) -> g.SlicingInternals.ff_called_by <- remove g.SlicingInternals.ff_called_by | Some (SlicingInternals.CallSrc (Some old_fi)) -> old_fi.SlicingInternals.f_called_by <- remove old_fi.SlicingInternals.f_called_by | Some (SlicingInternals.CallSrc (None)) -> let called = indirectly_called_src_functions call_id in let update kf = let old_fi = SlicingMacros.get_kf_fi kf in old_fi.SlicingInternals.f_called_by <- remove old_fi.SlicingInternals.f_called_by in List.iter update called (** very low level function to change information of a call : * no checks at all (they must have been done before). * [call] in [ff] is changed in order to call [to_call]. If some function was * previously called, update its [called_by] information. *) let change_call ff_marks call_id to_call = SlicingParameters.debug ~level:2 "[Fct_Slice.CallInfo.change_call]"; let call_info = get_info_call call_id in let something_to_do = is_call_to_change call_info to_call in if something_to_do then begin SlicingParameters.debug ~level:2 " -> remove old_called"; remove_called_by call_id call_info; SlicingParameters.debug ~level:2 " -> add new_called"; begin match to_call with | None -> () (* nothing to do *) | Some f -> begin match f with | (SlicingInternals.CallSrc None) -> let called = indirectly_called_src_functions call_id in let update kf = let fi = SlicingMacros.get_kf_fi kf in fi.SlicingInternals.f_called_by <- call_id :: fi.SlicingInternals.f_called_by in List.iter update called | (SlicingInternals.CallSlice g) -> g.SlicingInternals.ff_called_by <- call_id :: g.SlicingInternals.ff_called_by | (SlicingInternals.CallSrc (Some fi)) -> fi.SlicingInternals.f_called_by <- call_id :: fi.SlicingInternals.f_called_by end end; let _ff, call = call_id in let new_call_info = to_call in PdgIndex.FctIndex.add_info_call ff_marks call new_call_info true end end (** [FctMarks] manages the mapping between a function elements and their * marks. See {!module:PdgIndex.FctIndex} to know what an element is. *) module FctMarks : sig type t (* = SlicingInternals.marks_index *) type to_prop val empty_to_prop : to_prop (** build a new, empty, slice for the function *) val new_empty_slice : SlicingInternals.fct_info -> SlicingInternals.fct_slice val new_copied_slice : SlicingInternals.fct_slice -> SlicingInternals.fct_slice val new_empty_fi_marks : SlicingInternals.fct_info -> t val fi_marks : SlicingInternals.fct_info -> t option val get_fi_node_mark : SlicingInternals.fct_info -> PdgIndex.Key.t -> SlicingTypes.sl_mark (** build a new, slice for the function with some initial marks (they will be * copied)*) val new_init_slice : SlicingInternals.fct_info -> SlicingInternals.ff_marks -> SlicingInternals.fct_slice val get_ff_marks : SlicingInternals.fct_slice -> t (** merge the marks and clear all the calls : * they will have to be processed by examine_calls. *) val merge : SlicingInternals.fct_slice -> SlicingInternals.fct_slice -> SlicingInternals.ff_marks val get_node_mark : SlicingInternals.fct_slice -> PdgIndex.Key.t -> SlicingTypes.sl_mark val get_node_marks : SlicingInternals.fct_slice -> PdgIndex.Key.t -> SlicingTypes.sl_mark list val get_sgn : SlicingInternals.fct_slice -> SlicingMarks.sig_marks option val get_new_marks: SlicingInternals.fct_slice -> SlicingTypes.sl_mark PdgMarks.select -> SlicingTypes.sl_mark PdgMarks.select val get_all_input_marks : t -> to_prop val get_matching_input_marks : t -> Locations.Zone.t -> to_prop (** add the given mark to the node, and propagate to its dependencies *) val mark_and_propagate : t -> ?to_prop:to_prop -> SlicingTypes.sl_mark PdgMarks.select -> to_prop (** add a [Spare] mark to all the input nodes of the call and propagate *) val mark_spare_call_nodes : SlicingInternals.fct_slice -> Cil_types.stmt -> to_prop (** Mark the output nodes can be made visible due to marks in their * dependencies. This can occurs if, for instance, * the user asked to select a data at the last point of a function. *) val mark_visible_output : t -> unit (** Some inputs must be visible when a parameter is used as a local variable. * ie. its input value is not used. * TODO : handle the difference between input value/decl in [Signature] *) val mark_visible_inputs : t -> to_prop -> to_prop val marks_for_caller_inputs : PdgTypes.Pdg.t -> t -> Cil_types.stmt -> to_prop -> SlicingInternals.fct_info -> (SlicingTypes.sl_mark PdgMarks.select) * bool val marks_for_call_outputs : to_prop -> (Cil_types.stmt * (PdgIndex.Signature.out_key * SlicingTypes.sl_mark) list) list val get_call_output_marks : ?spare_info:CallInfo.call_id option -> CallInfo.t -> (PdgIndex.Signature.out_key * SlicingTypes.sl_mark) list val persistent_in_marks_to_prop : SlicingInternals.fct_info -> to_prop -> SlicingTypes.sl_mark PdgMarks.pdg_select (** [f] calls [g] and the call marks have been modified in [f]. * Compute the marks that should be propagated in [g]. * * This function is also use to choose the slice of [g] to call : * in that case, the first parameter holds the call output marks * that can be given by [get_call_output_marks]. * *) val check_called_marks : (PdgIndex.Signature.out_key * SlicingTypes.sl_mark) list -> SlicingInternals.fct_slice -> (SlicingTypes.sl_mark PdgMarks.select) * bool val fold_calls : (Cil_types.stmt -> CallInfo.t -> 'a -> 'a) -> SlicingInternals.fct_slice -> 'a -> 'a val change_call : SlicingInternals.fct_slice -> Cil_types.stmt -> SlicingInternals.called_fct option -> unit val debug_marked_ff : Format.formatter -> SlicingInternals.fct_slice -> unit end = struct module Marks4Pdg = struct type t = SlicingTypes.sl_mark type call_info = SlicingInternals.call_info let is_bottom = SlicingMarks.is_bottom_mark let merge m1 m2 = SlicingMarks.merge_marks [m1; m2] let combine = SlicingMarks.combine_marks let pretty = SlicingMarks.pretty_mark end module PropMark = PdgMarks.F_Fct (Marks4Pdg) type t = PropMark.t (* = SlicingInternals.ff_marks*) type to_prop = PropMark.mark_info_inter let empty_to_prop = PropMark.empty_to_prop (** @raise SlicingTypes.NoPdg when the function PDG couldn't have been * computed. *) let new_slice fi marks = let ff_num = fi.SlicingInternals.fi_next_ff_num in let pdg = SlicingMacros.get_fi_pdg fi in if (PdgTypes.Pdg.is_top pdg) then raise SlicingTypes.NoPdg; let marks = match marks with None -> PropMark.create pdg | Some (pdg, marks) -> (pdg, PdgIndex.FctIndex.copy marks) in let ff = { SlicingInternals.ff_fct = fi ; SlicingInternals.ff_id = ff_num ; SlicingInternals.ff_marks = marks ; SlicingInternals.ff_called_by = [] } in fi.SlicingInternals.fi_slices <- ff :: fi.SlicingInternals.fi_slices ; fi.SlicingInternals.fi_next_ff_num <- ff_num + 1; ff let new_copied_slice ff = try let fi = ff.SlicingInternals.ff_fct in new_slice fi (Some ff.SlicingInternals.ff_marks) with SlicingTypes.NoPdg -> assert false (** @raise SlicingTypes.NoPdg (see [new_slice]) *) let new_init_slice fi marks = new_slice fi (Some marks) (** @raise SlicingTypes.NoPdg (see [new_slice]) *) let new_empty_slice fi = new_slice fi None let new_empty_fi_marks fi = let marks = PropMark.create (SlicingMacros.get_fi_pdg fi) in fi.SlicingInternals.fi_init_marks <- Some marks ; marks let fi_marks fi = fi.SlicingInternals.fi_init_marks let get_ff_marks ff = ff.SlicingInternals.ff_marks let get_marks (fm:t) = PropMark.get_idx fm let merge ff1 ff2 = let pdg1, fm1 = ff1.SlicingInternals.ff_marks in let pdg2, fm2 = ff2.SlicingInternals.ff_marks in assert (Db.Pdg.from_same_fun pdg1 pdg2) ; let merge_marks m1 m2 = SlicingMarks.merge_marks [m1; m2] in let merge_call_info _c1 _c2 = None in let fm = PdgIndex.FctIndex.merge fm1 fm2 merge_marks merge_call_info in (pdg1, fm) let get_mark fm node_key = try PdgIndex.FctIndex.find_info (get_marks fm) node_key with Not_found -> SlicingMarks.bottom_mark let get_node_mark ff node_key = let fm = ff.SlicingInternals.ff_marks in get_mark fm node_key let get_fi_node_mark fi node_key = match fi_marks fi with None -> SlicingMarks.bottom_mark | Some fm -> get_mark fm node_key let get_node_marks ff node_key = let fm = ff.SlicingInternals.ff_marks in PdgIndex.FctIndex.find_all (get_marks fm) node_key let get_sgn ff = let fm = ff.SlicingInternals.ff_marks in Some (PdgIndex.FctIndex.sgn (get_marks fm)) let get_all_input_marks fm = let fm = get_marks fm in let in_marks = SlicingMarks.get_all_input_marks (PdgIndex.FctIndex.sgn fm) in let out_marks = [] in (in_marks, out_marks) let get_matching_input_marks fm z = let fm = get_marks fm in let in_marks = SlicingMarks.get_matching_input_marks (PdgIndex.FctIndex.sgn fm) z in let out_marks = [] in (in_marks, out_marks) let fold_calls process ff acc = let fm = ff.SlicingInternals.ff_marks in CallInfo.fold_calls process ff (get_marks fm) acc let change_call ff call newf = let ff_marks = get_ff_marks ff in let marks = get_marks ff_marks in CallInfo.change_call marks (ff, call) newf (** mark the node with the given mark and propagate it to its dependencies *) let mark_and_propagate (fct_marks:t) ?(to_prop=PropMark.empty_to_prop) to_select = PropMark.mark_and_propagate fct_marks ~to_prop to_select (** compute the marks to propagate in [pdg_caller] when the called function * have the [to_prop] marks. * @param fi_to_call is used to compute [more_inputs] only : * a persistent input mark is not considered as a new input. * *) let marks_for_caller_inputs pdg_caller old_marks call (in_info,_ as _to_prop) fi_to_call = assert (not (PdgTypes.Pdg.is_top pdg_caller)); let new_input = ref false in let m2m s m = let key = match s with | PdgMarks.SelIn loc -> PdgIndex.Key.implicit_in_key loc | PdgMarks.SelNode (n,_z) -> !Db.Pdg.node_key n in let old_m = get_mark old_marks key in let add_mark = let kf = fi_to_call.SlicingInternals.fi_kf in let op_inputs = !Db.Operational_inputs.get_internal_precise ~stmt:call kf in let z = op_inputs.Inout_type.over_inputs in match s with | PdgMarks.SelNode (_, None) -> true | PdgMarks.SelIn z' | PdgMarks.SelNode (_,Some z') -> Locations.Zone.intersects z z' in if add_mark then let new_m = SlicingMarks.missing_input_mark ~call:old_m ~called:m in SlicingParameters.debug ~level:2 "[Fct_Slice.FctMarks.marks_for_caller_inputs] for %a : \ old=%a new=%a -> %a" !Db.Pdg.pretty_key key SlicingMarks.pretty_mark old_m SlicingMarks.pretty_mark m SlicingMarks.pretty_mark (match new_m with None -> SlicingMarks.bottom_mark | Some m -> m); begin match new_m with | Some _new_m when SlicingMarks.is_bottom_mark old_m -> let init_m = get_fi_node_mark fi_to_call key in if SlicingMarks.is_bottom_mark init_m then new_input := true | _ -> () end; new_m else None in let new_input_marks = Pdg.Register.in_marks_to_caller pdg_caller call m2m in_info in new_input_marks, !new_input let marks_for_call_outputs (_, out_info) = out_info let get_call_output_marks ?(spare_info=None) call_info = let sig_call = CallInfo.get_call_sig call_info in let add1 acc (k,m) = (k,m)::acc in let call_out_marks = PdgIndex.Signature.fold_all_outputs add1 [] sig_call in match spare_info with | None -> call_out_marks | Some (ff_call, call) -> let pdg = SlicingMacros.get_ff_pdg ff_call in let spare = SlicingMarks.mk_gen_spare in let rec add2 marks n = match !Db.Pdg.node_key n with | PdgIndex.Key.SigCallKey (_, (PdgIndex.Signature.In _)) -> marks | PdgIndex.Key.SigCallKey (_, (PdgIndex.Signature.Out key)) -> begin match marks with | [] -> [(key, spare)] | (k, m):: marks -> if PdgIndex.Signature.equal_out_key k key then let m = if SlicingMarks.is_bottom_mark m then spare else m in (k, m):: marks else (k, m)::(add2 marks n) end | _ -> assert false in PdgTypes.Pdg.fold_call_nodes add2 call_out_marks pdg call let check_called_marks new_call_marks ff_called = let ff_marks = get_ff_marks ff_called in let ff_pdg, _ = ff_marks in let new_output = ref false in let m2m s m = match s with | PdgMarks.SelIn _ -> (* let nkey = PdgIndex.Key.implicit_in_key l in *) (* As we are looking for some call output node, * even if the data is not entirely defined by the function, * it has already been taken into account in the "from". *) None | PdgMarks.SelNode (n, _z_opt) -> let nkey = !Db.Pdg.node_key n in (* let nkey = match z_opt with None -> nkey | Some z -> match nkey with | PdgIndex.Key.SigCallKey (call_id, (PdgIndex.Signature.Out _)) -> let call = PdgIndex.Key.call_from_id call_id in PdgIndex.Key.call_output_key call z | _ -> nkey in *) let old_m = get_mark ff_marks nkey in let m_opt = SlicingMarks.missing_output_mark ~call:m ~called:old_m in let new_out = match m_opt with | Some _new_m when SlicingMarks.is_bottom_mark old_m -> new_output := true; true | _ -> (); false in SlicingParameters.debug ~level:2 "[Fct_Slice.FctMarks.check_called_marks] for %a : old=%a new=%a -> %a %s" !Db.Pdg.pretty_key nkey SlicingMarks.pretty_mark old_m SlicingMarks.pretty_mark m SlicingMarks.pretty_mark (match m_opt with None -> SlicingMarks.bottom_mark | Some m -> m) (if new_out then "(new out)" else ""); m_opt in let new_called_marks = Pdg.Register.call_out_marks_to_called ff_pdg m2m new_call_marks in new_called_marks, !new_output let persistent_in_marks_to_prop fi to_prop = let in_info, _ = to_prop in SlicingParameters.debug ~level:2 "[Fct_Slice.FctMarks.persistent_in_marks_to_prop] from %s" (SlicingMacros.fi_name fi); let m2m _call _pdg_caller _n m = (* SlicingParameters.debug ~level:2 " in_m2m %a in %s ?@." PdgIndex.Key.pretty (!Db.Pdg.node_key n) (SlicingMacros.pdg_name pdg_caller); *) SlicingMarks.missing_input_mark ~call:SlicingMarks.bottom_mark ~called:m in let pdg = SlicingMacros.get_fi_pdg fi in let pdg_node_marks = Pdg.Register.translate_in_marks pdg ~m2m in_info [] in pdg_node_marks let get_new_marks ff nodes_marks = let fm = get_ff_marks ff in let add_if_new acc (n, m) = let nkey = match n with | PdgMarks.SelNode (n, _z_opt) -> (* TODO : something to do for z_opt ? *) !Db.Pdg.node_key n | PdgMarks.SelIn l -> PdgIndex.Key.implicit_in_key l in let oldm = get_mark fm nkey in let newm = SlicingMarks.minus_marks m oldm in (* Format.printf "get_new_marks for %a : old=%a new=%a -> %a@." !Db.Pdg.pretty_key nkey SlicingMarks.pretty_mark oldm SlicingMarks.pretty_mark m SlicingMarks.pretty_mark newm; *) if not (SlicingMarks.is_bottom_mark newm) then (n, newm)::acc else acc in List.fold_left add_if_new [] nodes_marks (** We know that the 'call' element is visible. * We have to check that all the associated nodes and * the dependencies of these nodes are, at least, marked as 'spare'. *) let mark_spare_nodes ff nodes = let ff_marks = get_ff_marks ff in let m_spare = SlicingMarks.mk_gen_spare in let node_marks = List.map (fun n -> (PdgMarks.mk_select_node n, m_spare)) nodes in let to_prop = mark_and_propagate ff_marks node_marks in to_prop let mark_spare_call_nodes ff call = let pdg = SlicingMacros.get_ff_pdg ff in let nodes = !Db.Pdg.find_simple_stmt_nodes pdg call in mark_spare_nodes ff nodes (** TODO : * this function should disappear when the parameter declarations will * be handled... * See TODO in Pdg.Build.do_param * *) let mark_visible_inputs _ff_marks to_prop = (* let pdg, _ = ff_marks in let kf = SlicingMacros.get_pdg_kf pdg in let param_list = Kernel_function.get_formals kf in let rec check_in_params n params = match params with | [] -> [] | _ :: params -> let node = !Db.Pdg.find_input_node pdg n in let dpds = !Db.Pdg.direct_dpds pdg node in let get_n_mark n = get_mark ff_marks (PdgTypes.Node.elem_key n) in let dpds_marks = List.map get_n_mark dpds in let m = SlicingMarks.inter_marks dpds_marks in let marks = check_in_params (n+1) params in if not (SlicingMarks.is_bottom_mark m) then begin SlicingKernel.debug ~level:2 "[Fct_Slice.FctMarks.mark_visible_inputs] %a -> %a" (!Db.Pdg.pretty_node true) node SlicingMarks.pretty_mark m; PdgMarks.add_node_to_select marks (node, None) m end else marks in let new_marks = check_in_params 1 param_list in mark_and_propagate ff_marks ~to_prop new_marks *) to_prop let mark_visible_output ff_marks = let pdg, _ = ff_marks in try let out_node = !Db.Pdg.find_ret_output_node pdg in let dpds = !Db.Pdg.direct_dpds pdg out_node in let get_n_mark n = get_mark ff_marks (PdgTypes.Node.elem_key n) in let dpds_marks = List.map get_n_mark dpds in let m = SlicingMarks.inter_marks dpds_marks in if not (SlicingMarks.is_bottom_mark m) then begin SlicingParameters.debug ~level:2 "[Fct_Slice.FctMarks.mark_visible_outputs] %a -> %a" (!Db.Pdg.pretty_node true) out_node SlicingMarks.pretty_mark m; let select = PdgMarks.add_node_to_select [] (out_node, None) m in let to_prop = mark_and_propagate ff_marks select in assert (to_prop = PropMark.empty_to_prop); () end with Not_found -> () let debug_ff_marks fmt fm = let pdg, fm = fm in let print_node node = let node_key = PdgTypes.Node.elem_key node in let m = try try PdgIndex.FctIndex.find_info fm node_key with PdgIndex.CallStatement -> assert false with Not_found -> SlicingMarks.bottom_mark in Format.fprintf fmt "%a : %a" (!Db.Pdg.pretty_node true) node SlicingMarks.pretty_mark m in !Db.Pdg.iter_nodes print_node pdg let debug_marked_ff fmt ff = Format.fprintf fmt "@[<hv>Print slice =@ %s@]" (SlicingMacros.ff_name ff); let ff_marks = ff.SlicingInternals.ff_marks in debug_ff_marks fmt ff_marks end (*-----------------------------------------------------------------------*) (** {2 xxx } *) (** Inform about the called slice or else calls to source functions. *) let get_called_slice ff call = let call_id = (ff, call) in let f_called = CallInfo.get_call_f_called call_id in match f_called with | None -> None, false | Some (SlicingInternals.CallSrc _) -> None, true | Some (SlicingInternals.CallSlice g) -> Some g, false (*-----------------------------------------------------------------------*) (** {2 xxx } *) let _pretty_node_marks fmt marks = let print fmt (n, m) = (!Db.Pdg.pretty_node true) fmt n; SlicingMarks.pretty_mark fmt m in Format.fprintf fmt "%a" (fun fmt x -> List.iter (print fmt) x) marks let check_outputs call_id called_ff add_spare = let (ff_call, call) = call_id in SlicingParameters.debug ~level:2 "[Fct_Slice.check_outputs] %s outputs for call %d in %s" (SlicingMacros.ff_name called_ff) call.sid (SlicingMacros.ff_name ff_call); let call_info = CallInfo.get_info_call call_id in let spare_info = if add_spare then Some call_id else None in let out_call = FctMarks.get_call_output_marks ~spare_info call_info in let new_marks, more = FctMarks.check_called_marks out_call called_ff in SlicingParameters.debug ~level:2 " -> %d more marks. %s more outputs" (List.length new_marks) (if more then "some" else "no"); (new_marks, more) (** [ff] marks have changed : check if the call to [ff_called] is still ok. *) let check_ff_called ff call new_marks_in_call_outputs ff_called = let call_id = (ff, call) in let is_this_call (c, _) = (c.sid = call.sid) in let new_call_marks = try let _, new_call_marks = List.find is_this_call new_marks_in_call_outputs in new_call_marks with Not_found -> (* no new marks for this call *) [] in let missing_outputs = match new_call_marks with | [] -> (* why do we check this if there is no new mark ??? *) check_outputs call_id ff_called false | _ -> FctMarks.check_called_marks new_call_marks ff_called in match missing_outputs with | ([], false) -> None | _ -> let missing_out_act = SlicingActions.mk_crit_missing_outputs ff call missing_outputs in Some missing_out_act (** Examine the call statements after the modification of [ff] marks. * If one node is visible we have to choose which function to call, * or to check if it is ok is something is called already. * * @return a list of actions if needed. *) let examine_calls ff new_marks_in_call_outputs = SlicingParameters.debug ~level:2 "[Fct_Slice.examine_calls]"; let process_this_call call call_info filter_list = if CallInfo.something_visible call_info then begin SlicingParameters.debug ~level:2 " examine visible call %d" call.sid; let f_called = CallInfo.get_f_called call_info in let filter_list = match f_called with | None -> (* have to chose a function to call here *) SlicingParameters.debug ~level:2 " -> add choose_call"; (SlicingActions.mk_crit_choose_call ff call) :: filter_list | Some (SlicingInternals.CallSrc _) -> (* the source function compute every outputs, so nothing to do *) SlicingParameters.debug ~level:2 " -> source called : nothing to do"; filter_list | Some (SlicingInternals.CallSlice ff_called) -> (* call to a sliced function : check if it's still ok, * or create new [missing_output] action *) SlicingParameters.debug ~level:2 " -> slice called -> check"; let new_filter = check_ff_called ff call new_marks_in_call_outputs ff_called in match new_filter with None -> filter_list | Some f -> f :: filter_list in filter_list end else (* the call is not visible : nothing to do *) begin SlicingParameters.debug ~level:2 " invisible call -> OK"; filter_list end in FctMarks.fold_calls process_this_call ff [] (** build a new empty slice in the given [fct_info]. * If the function has some persistent selection, let's copy it in the new slice. * Notice that there can be at most one slice for the application entry point * (main), but we allow to have several slice for a library entry point. * @param build_actions (bool) is useful if the function has some persistent * selection : if the new slice marks will be modified just after that, * it is not useful to do [examine_calls], but if it is finished, * we must generate those actions to choose the calls. @raise SlicingTypes.NoPdg (see [new_slice]) *) let make_new_ff fi build_actions = let new_ff fi = let some_marks, ff = match fi.SlicingInternals.fi_init_marks with | None -> false, FctMarks.new_empty_slice fi | Some marks -> true, FctMarks.new_init_slice fi marks in let new_filters = (if build_actions && some_marks then examine_calls ff [] else []) in SlicingParameters.debug ~level:1 "[Fct_Slice.make_new_ff] = %s@." (SlicingMacros.ff_name ff); (ff, new_filters) in let fname = SlicingMacros.fi_name fi in let kf_entry, _ = Globals.entry_point () in if fname = Kernel_function.get_name kf_entry then match fi.SlicingInternals.fi_slices with | [] -> new_ff fi | ff :: [] -> ff, [] | _ -> assert false (* Entry point shouldn't have several slices *) else new_ff fi let copy_slice ff = let kf_entry, _ = Globals.entry_point () in if (SlicingMacros.ff_src_name ff) = Kernel_function.get_name kf_entry then raise SlicingTypes.OnlyOneEntryPointSlice else FctMarks.new_copied_slice ff (** [ff] marks have just been modified : * check if the [calls] to [ff] compute enough inputs, * and create [MissingInputs] actions if not. *) let add_missing_inputs_actions ff calls to_prop actions = let fi = ff.SlicingInternals.ff_fct in let check_call actions (ff_call, call as call_id) = let call_info = CallInfo.get_info_call call_id in let ff_called = CallInfo.get_f_called call_info in let _ = match ff_called with | Some (SlicingInternals.CallSlice ff_called) -> assert (SlicingMacros.equal_ff ff_called ff) | _ -> assert false in let pdg_caller = SlicingMacros.get_ff_pdg ff_call in assert (not (PdgTypes.Pdg.is_top pdg_caller)); (* we cannot have a top pdg here, because it is a sliced pdg *) let old_marks = FctMarks.get_ff_marks ff_call in let missing_inputs = FctMarks.marks_for_caller_inputs pdg_caller old_marks call to_prop fi in match missing_inputs with | ([], false) -> SlicingParameters.debug ~level:2 "[Fct_Slice.add_missing_inputs_actions] call %a, \ no missing inputs@." Printer.pp_location (Cil_datatype.Stmt.loc call); actions | _ -> SlicingParameters.debug ~level:2 "[Fct_Slice.add_missing_inputs_actions] call %a, \ missing inputs@." Printer.pp_location (Cil_datatype.Stmt.loc call); let new_action = SlicingActions.mk_crit_missing_inputs ff_call call missing_inputs in new_action :: actions in SlicingParameters.debug ~level:2 "[Fct_Slice.add_missing_inputs_actions] Called, calls %a" (Pretty_utils.pp_list (fun fmt (_, s) -> Printer.pp_location fmt (Cil_datatype.Stmt.loc s))) calls; let actions = List.fold_left check_call actions calls in SlicingParameters.debug ~level:2 "[Fct_Slice.add_missing_inputs_actions] %s" (match actions with | [] -> " -> no missing input" | _ -> " -> add missing inputs actions"); actions (** {2 Adding marks} *) (** [ff] marks have been modified : we have to check if the calls and the * callers are ok. Create new actions if there is something to do. * Notice that the action creations are independent from the options. * They will by used during the applications. * *) let after_marks_modifications ff to_prop = SlicingParameters.debug ~level:2 "[Fct_Slice.after_marks_modifications] before: %a" FctMarks.debug_marked_ff ff; let new_filters = [] in let calls = ff.SlicingInternals.ff_called_by in let new_filters = add_missing_inputs_actions ff calls to_prop new_filters in let call_outputs = FctMarks.marks_for_call_outputs to_prop in let new_filters = (SlicingActions.mk_crit_examines_calls ff call_outputs)::new_filters in SlicingParameters.debug ~level:2 "[Fct_Slice.after_marks_modifications] after: %s new filters" (match new_filters with | [] -> "no" | _ -> "some"); new_filters let apply_examine_calls ff call_outputs = examine_calls ff call_outputs (** quite internal function that only computes the marks. * Don't use it alone because it doesn't take care of the calls and so on. * See [apply_add_marks] or [add_marks_to_fi] for higher level functions. *) let add_marks fct_marks nodes_marks = SlicingParameters.debug ~level:2 "add_marks@."; let to_prop = FctMarks.mark_and_propagate fct_marks nodes_marks in FctMarks.mark_visible_output fct_marks; let to_prop = FctMarks.mark_visible_inputs fct_marks to_prop in to_prop (** main function to build or modify a slice. * @return a list of the filters to add to the worklist. *) let apply_add_marks ff nodes_marks = SlicingParameters.debug ~level:3 "[Fct_Slice.apply_add_marks]@\n-BEFORE:@\n%a" FctMarks.debug_marked_ff ff; (*let pdg = SlicingMacros.get_ff_pdg ff in*) let to_prop = add_marks (FctMarks.get_ff_marks ff) nodes_marks in let new_filters = after_marks_modifications ff to_prop in new_filters (** a function that doesn't modify anything but test if the [nodes_marks] * are already in the slice or not. * @return the [nodes_marks] that are not already in. *) let filter_already_in ff selection = FctMarks.get_new_marks ff selection (** when the user adds persistent marks to a function, * he might want to propagate them to the callers, * but, anyway, we don't want to propagate persistent marks to the calls * for the same reason (if we mark [x = g ();] in [f], we don't necessarily want * all versions of [g] to have a visible [return] for instance). **) let prop_persistent_marks fi to_prop actions = let pdg_node_marks = FctMarks.persistent_in_marks_to_prop fi to_prop in let add_act acc (pdg, node_marks) = let kf = SlicingMacros.get_pdg_kf pdg in let fi = SlicingMacros.get_kf_fi kf in let a = match node_marks with | PdgMarks.SelList node_marks -> SlicingActions.mk_crit_prop_persit_marks fi node_marks | PdgMarks.SelTopMarks marks -> assert (PdgTypes.Pdg.is_top pdg); let m = SlicingMarks.merge_marks marks in SlicingActions.mk_crit_fct_top fi m in a::acc in List.fold_left add_act actions pdg_node_marks (** add the marks to the persistent marks to be used when new slices will be * created. The actions to add the marks to the existing slices are generated * in slicingProject. * If it is the first persistent selection for this function, * and [propagate=true], also generates the actions to make every calls to this * function visible. *) let add_marks_to_fi fi nodes_marks propagate actions = SlicingParameters.debug ~level:2 "[Fct_Slice.add_marks_to_fi] (persistent)"; let marks, are_new_marks = match FctMarks.fi_marks fi with | Some m -> m, false | None -> let init_marks = FctMarks.new_empty_fi_marks fi in init_marks, true in let to_prop = add_marks marks nodes_marks in let actions = if propagate then prop_persistent_marks fi to_prop actions else actions in are_new_marks, actions let add_top_mark_to_fi fi m propagate actions = let new_top = match fi.SlicingInternals.fi_top with | None -> fi.SlicingInternals.fi_top <- Some m; true | Some old_m -> fi.SlicingInternals.fi_top <- Some (SlicingMarks.merge_marks [old_m; m]); false in let actions = if propagate && new_top then (SlicingActions.mk_appli_select_calls fi)::actions else actions in actions (** {3 Choosing the function to call} *) (** Build a new action [ChangeCall] (if needed) *) let add_change_call_action ff call call_info f_to_call actions = SlicingParameters.debug ~level:2 "[Fct_Slice.add_change_call_action]:"; let add_change_call = CallInfo.is_call_to_change call_info (Some f_to_call) in if add_change_call then begin let change_call_action = SlicingActions.mk_crit_change_call ff call f_to_call in SlicingParameters.debug ~level:2 " -> %a" SlicingActions.print_crit change_call_action; change_call_action :: actions end else begin SlicingParameters.debug ~level:2 " -> not needed"; actions end (* (** This function doesn't use the PDG call dependencies on purpose ! * See explanations in [add_spare_call_inputs] *) let get_called_needed_input called_kf need_out0 needed_out_zone = let froms = !Db.From.get called_kf in let from_table = froms.Function_Froms.deps_table in let acc_in_zones out (default, from_out) in_zones = if Locations.Zone.valid_intersects needed_out_zone out then let in_zones = Locations.Zone.join in_zones from_out in let in_zones = if default then Locations.Zone.join in_zones out else in_zones in in_zones else in_zones in let in_zones = Function_Froms.Memory.fold acc_in_zones from_table Locations.Zone.bottom in let in_zones = if need_out0 then let from0 = froms.Function_Froms.deps_return in let z_return = Function_Froms.Memory.collapse_return from0 in Locations.Zone.join in_zones z_return else in_zones in in_zones let get_call_in_nodes called_kf call_info called_in_zone = let (ff_caller, call_stmt) = CallInfo.get_call_id call_info in let pdg_caller = SlicingMacros.get_ff_pdg ff_caller in let pdg_idx = PdgTypes.InternalPdg.get_index pdg_caller in let _, pdg_sig_call = PdgIndex.FctIndex.find_call pdg_idx call_stmt in (* In the input zones, we have the formal parameters, not the arguments *) let param_list = Kernel_function.get_formals called_kf in let check_param (n, nodes, called_in_zone) param = let param_loc = Locations.loc_of_varinfo param in let param_zone = Locations.enumerate_valid_bits param_loc in let nodes, called_in_zone = if Locations.Zone.valid_intersects param_zone called_in_zone then let node = PdgIndex.Signature.find_input pdg_sig_call n in let called_in_zone = Locations.Zone.diff called_in_zone param_zone in ((node, None)::nodes, called_in_zone) else (nodes, called_in_zone) in (n+1, nodes, called_in_zone) in let _, nodes, in_zone = List.fold_left check_param (1, [], called_in_zone) param_list in let impl_in_nodes, undef = !Db.Pdg.find_location_nodes_at_stmt pdg_caller call_stmt ~before:true in_zone in (nodes @ impl_in_nodes), undef (** This function is used to prevent [choose_precise_slice] from looping * (see #335) because sometimes, when the [-calldeps] option is used, * the dependencies of the call in the PDG are more precise than what we * can get by slicing, and so, when we ask for the most precise slice, * we always reject the result. * So, when [choose_precise_slice] build a new slice for a call, * we first add some spare marks to the inputs of the call that are needed * by the marked outputs according to the froms of the called function. * The computed function won't be rejected then because we will * have to add some marks, but no new inputs. *) let add_spare_call_inputs called_kf call_info = let (ff_caller, _call) = CallInfo.get_call_id call_info in SlicingKernel.debug ~level:2 "[slicing] add_spare_call_inputs in %s@." (SlicingMacros.ff_name ff_caller); let sig_call = CallInfo.get_call_sig call_info in let out0, marked_out_zone = SlicingMarks.get_marked_out_zone sig_call in let called_in_zone = get_called_needed_input called_kf out0 marked_out_zone in SlicingKernel.debug ~level:2 "\tneed %a inputs : %a@." Kernel_function.pretty called_kf Locations.Zone.pretty called_in_zone; let needed_nodes, undef = get_call_in_nodes called_kf call_info called_in_zone in let m_spare = SlicingMarks.mk_gen_spare in let to_select = List.fold_left (fun marks n -> PdgMarks.add_node_to_select marks n m_spare) [] needed_nodes in let to_select = PdgMarks.add_undef_in_to_select to_select undef m_spare in let actions = apply_add_marks ff_caller to_select in actions *) (** choose among the already computed slice if there is a function that computes * just enough outputs (what ever their marks are). If not, create a new one *) let choose_precise_slice fi_to_call call_info = let out_call = FctMarks.get_call_output_marks call_info in let rec find slices = match slices with | [] -> let ff, actions = make_new_ff fi_to_call true in (* let called_kf = SlicingMacros.get_fi_kf fi_to_call in let new_actions = add_spare_call_inputs called_kf call_info in let actions = new_actions @ actions in *) ff, actions | ff :: slices -> let _missing_outputs, more_outputs = FctMarks.check_called_marks out_call ff in if more_outputs then (* not enough outputs in [ff] *) begin SlicingParameters.debug ~level:2 "[Fct_Slice.choose_precise_slice] %s ? not enough outputs" (SlicingMacros.ff_name ff); find slices end else begin (* let ff_marks = FctMarks.get_ff_marks ff in let input_marks = FctMarks.get_all_input_marks ff_marks in let (caller, call) = CallInfo.get_call_id call_info in let pdg_caller = SlicingMacros.get_ff_pdg caller in let caller_marks = FctMarks.get_ff_marks caller in let _ , more_inputs = FctMarks.marks_for_caller_inputs pdg_caller caller_marks call input_marks fi_to_call in if more_inputs then (* [ff] needs too many inputs *) begin SlicingKernel.debug ~level:2 "[Fct_Slice.choose_precise_slice] %s ? too many inputs" (SlicingMacros.ff_name ff); find slices end else *) begin SlicingParameters.debug ~level:2 "[Fct_Slice.choose_precise_slice] %s ? ok" (SlicingMacros.ff_name ff); ff , [] end end in let slices = SlicingMacros.fi_slices fi_to_call in find slices (** choose the function to call according to the slicing level of the function * to call *) let choose_f_to_call fbase_to_call call_info = SlicingParameters.debug ~level:2 "[Fct_Slice.choose_f_to_call]"; let choose_min_slice fi_to_call = SlicingParameters.debug ~level:2 "MinimizeNbSlice -> choose_min_slice"; let slices = SlicingMacros.fi_slices fi_to_call in match slices with | [] -> make_new_ff fi_to_call true | ff :: [] -> ff, [] | _ -> (* TODO : choose a slice *) SlicingParameters.not_yet_implemented "choose_min_slice with several slices" in let choose_full_slice fi_to_call = SlicingParameters.debug ~level:2 "PropagateMarksOnly -> choose_full_slice"; match SlicingMacros.fi_slices fi_to_call with | [] -> make_new_ff fi_to_call true (* the signature is computed in [apply_choose_call] * (missing_outputs) *) | ff :: [] -> ff, [] | _ -> (* TODO : choose a slice *) SlicingParameters.not_yet_implemented "choose_full_slice with several slices" in let to_call, new_filters = match fbase_to_call with | None -> (* if we don't know the called function : either it is a call through a pointer or an external or variadic function => we don't try to slice it, so we keep the source call *) SlicingParameters.debug ~level:1 "unknown called function -> keep src"; SlicingInternals.CallSrc None, [] | Some fi_to_call -> try let slicing_level = fi_to_call.SlicingInternals.fi_level_option in SlicingParameters.debug ~level:1 "choose_call with level %s" (SlicingMacros.str_level_option slicing_level); match slicing_level with | SlicingInternals.DontSlice -> SlicingParameters.debug ~level:2 "DontSliceCalls -> call src"; SlicingInternals.CallSrc fbase_to_call, [] | SlicingInternals.DontSliceButComputeMarks -> let ff_to_call, new_filters = choose_full_slice fi_to_call in (SlicingInternals.CallSlice ff_to_call), new_filters | SlicingInternals.MinNbSlice -> let ff_to_call, new_filters = choose_min_slice fi_to_call in (SlicingInternals.CallSlice ff_to_call), new_filters | SlicingInternals.MaxNbSlice -> let ff_to_call, new_filters = choose_precise_slice fi_to_call call_info in (SlicingInternals.CallSlice ff_to_call), new_filters with SlicingTypes.NoPdg -> SlicingParameters.feedback "unable to compute %s PDG : call source function" (SlicingMacros.fi_name fi_to_call); SlicingInternals.CallSrc None, [] in to_call, new_filters (** we are about to call [ff] for [sig_call] : let's first add some more output * marks in [ff] if needed. *) let check_called_outputs call_id ff actions = let level = SlicingMacros.ff_slicing_level ff in let add_spare = (level = SlicingInternals.DontSliceButComputeMarks) in let missing_outputs, _more_outputs = check_outputs call_id ff add_spare in let actions = match missing_outputs with | [] -> actions | _ -> let add_outputs = SlicingActions.mk_crit_add_output_marks ff missing_outputs in add_outputs :: actions in actions (** Choose the function (slice or source) to call according to the * slicing level of the called function. * Does nothing if there is already a called function : * this is useful because we can sometime generate several [choose_call] * for the same call, and we want to do something only the first time. * Build an action [change_call] to really call it. * If the chosen function doesn't compute enough output, * build an action to add outputs to it. * *) let apply_choose_call ff call = SlicingParameters.debug ~level:2 "[Fct_Slice.apply_choose_call] for call-%d" call.sid; let call_id = ff, call in let call_info = CallInfo.get_info_call (ff, call) in if ((CallInfo.get_f_called call_info) = None) then begin if CallInfo.something_visible call_info then let fbase_to_call = SlicingMacros.get_fi_call call in let f_to_call, actions = choose_f_to_call fbase_to_call call_info in let actions = add_change_call_action ff call call_info f_to_call actions in let actions = match f_to_call with | SlicingInternals.CallSrc _ -> actions | SlicingInternals.CallSlice ff -> check_called_outputs call_id ff actions in actions else begin SlicingParameters.debug ~level:2 " -> invisible call : nothing to do"; [] end end else begin SlicingParameters.debug ~level:2 " -> already call something : nothing to do"; [] end (** {4 Calls input/output marks} *) (** propagate the [input_marks] in the inputs of [call] in [ff]. *) let modif_call_inputs ff _call input_marks = (* SlicingParameters.debug ~level:1 "modif_call_inputs : %a" pretty_node_marks input_marks; *) add_marks (FctMarks.get_ff_marks ff) input_marks (** [modif_call_inputs] and then, check the calls and the callers *) let apply_modif_call_inputs ff call missing_inputs = SlicingParameters.debug ~level:2 "apply_modif_call_inputs@."; let input_marks, _more_inputs = missing_inputs in let to_prop = modif_call_inputs ff call input_marks in let new_filters = after_marks_modifications ff to_prop in new_filters (** [ff] calls a slice [g] that needs more inputs than those computed by [ff]. * The slicing level of [ff] is used in order to know if we have to modify [ff] * or to call another function. *) let apply_missing_inputs ff call missing_inputs = let _input_marks, more_inputs = missing_inputs in SlicingParameters.debug ~level:1 "[Fct_Slice.apply_missing_inputs] (%s)" (if more_inputs then "more" else "marks"); (* let rec visible_top in_marks = match in_marks with | [] -> false | (sel, m)::tl -> assert (not (SlicingMarks.is_bottom_mark m)); match sel with | PdgMarks.SelNode (n, _) when (!Db.Pdg.node_key n = PdgIndex.Key.top_input) -> true | _ -> visible_top tl in let is_top_visible = visible_top input_marks in *) let level = SlicingMacros.ff_slicing_level ff in if more_inputs && level = SlicingInternals.MaxNbSlice then (* if adding marks doesn't change the visibility of the inputs, * let's keep the same called function. If it adds visible inputs, * let's choose another one *) begin FctMarks.change_call ff call None; apply_choose_call ff call end else apply_modif_call_inputs ff call missing_inputs (** [ff] calls a slice [g] that doesn't compute enough outputs for the [call]. * The missing marks are [output_marks]. * The slicing level has to be used to choose either to modify the called * function [g] or to change it. *) let apply_missing_outputs ff call output_marks more_outputs = SlicingParameters.debug ~level:2 "[Fct_Slice.apply_missing_outputs]"; let ff_g = match CallInfo.get_call_f_called (ff, call) with | Some (SlicingInternals.CallSlice g) -> g | _ -> (* we shouldn't be here *) assert false in let g_slicing_level = SlicingMacros.ff_slicing_level ff_g in if more_outputs && g_slicing_level = SlicingInternals.MaxNbSlice then begin (* the easiest way is to ignore the called function and to use * [choose_call] *) FctMarks.change_call ff call None; apply_choose_call ff call end else apply_add_marks ff_g output_marks (** {3 Changing the function to call} *) (** check if [f_to_call] is ok for this call, and if so, * change the function call and propagate missing marks in the inputs * if needed. * @raise ChangeCallErr if [f_to_call] doesn't compute enough outputs. *) let apply_change_call ff call f_to_call = SlicingParameters.debug ~level:1 "[Fct_Slice.apply_change_call]"; let pdg = SlicingMacros.get_ff_pdg ff in let to_call, to_prop = match f_to_call with | SlicingInternals.CallSlice ff_to_call -> (* let to_call_sig = FctMarks.get_sgn ff_to_call in let top = match to_call_sig with None -> false | Some to_call_sig -> SlicingMarks.is_topin_visible to_call_sig in if top then begin Cil.log "[slicing] top input in %s -> call source function" (SlicingMacros.ff_name ff_to_call); let to_prop = FctMarks.mark_spare_call_nodes ff call in SlicingInternals.CallSrc (Some (SlicingMacros.ff_fi ff_to_call)), to_prop end else *) begin let f = match check_outputs (ff, call) ff_to_call false with | ([], false) -> f_to_call | _ -> raise (SlicingTypes.ChangeCallErr "not enough computed output") in (* find [f_to_call] input marks *) let marks = FctMarks.get_ff_marks ff_to_call in let input_marks = try let kf = ff_to_call.SlicingInternals.ff_fct.SlicingInternals.fi_kf in let op_inputs = !Db.Operational_inputs.get_internal_precise ~stmt:call kf in let z = op_inputs.Inout_type.over_inputs in (*Format.printf "##Call at %a,@ kf %a,@ @[Z %a@]@." Cil.d_loc (Cil_datatype.Stmt.loc call) Kernel_function.pretty kf Locations.Zone.pretty z; *) FctMarks.get_matching_input_marks marks z with Not_found -> FctMarks.get_all_input_marks marks in let ff_marks = FctMarks.get_ff_marks ff in let missing_inputs, _more = FctMarks.marks_for_caller_inputs pdg ff_marks call input_marks ff_to_call.SlicingInternals.ff_fct in let to_prop = modif_call_inputs ff call missing_inputs in f, to_prop end | SlicingInternals.CallSrc _ -> let to_prop = FctMarks.mark_spare_call_nodes ff call in f_to_call, to_prop in FctMarks.change_call ff call (Some to_call); let new_filters = after_marks_modifications ff to_prop in new_filters (** When the user wants to make a [change_call] to a function that doesn't * compute enough outputs, he can call [check_outputs_before_change_call] in * order to build the action the add those outputs. *) let check_outputs_before_change_call caller call ff_to_call = let call_id = caller, call in let actions = [] in let actions = check_called_outputs call_id ff_to_call actions in actions (*-----------------------------------------------------------------------*) (** {2 Merge, remove, ...} *) (** Build a new slice which marks are a join between [ff1] marks and [ff2] * marks. The result [ff] is not called at the end of this action. * [examine_calls] is called to generate the actions to choose the calls. *) let merge_slices ff1 ff2 = let fi = ff1.SlicingInternals.ff_fct in assert (SlicingMacros.equal_fi fi ff2.SlicingInternals.ff_fct); (* TODO : raise exception *) let ff, _ = try make_new_ff fi false (* [ff] can already have some persistent selection, * but we can safely forget then because they then have to also be in * [ff1] and [ff2]. *) with SlicingTypes.NoPdg -> assert false in ff.SlicingInternals.ff_marks <- FctMarks.merge ff1 ff2; let to_prop = FctMarks.empty_to_prop (* ff is new, so it isn't called, and all its calls are reset to None... *) in let new_filters = after_marks_modifications ff to_prop in ff, new_filters (** [ff] has to be removed. We have to check if it is not called * and to remove the called function in [ff]. * @raise SlicingTypes.CantRemoveCalledFf if the slice is called. * *) let clear_ff ff = let clear_call call_stmt call_info _ = CallInfo.remove_called_by (ff, call_stmt) call_info in match ff.SlicingInternals.ff_called_by with | [] -> FctMarks.fold_calls clear_call ff () | _ -> raise SlicingTypes.CantRemoveCalledFf (*-----------------------------------------------------------------------*) (** {2 Getting the slice marks} *) let get_node_key_mark ff k = try FctMarks.get_node_mark ff k with Not_found -> SlicingMarks.bottom_mark let get_node_mark ff node = get_node_key_mark ff (PdgTypes.Node.elem_key node) let get_local_var_mark ff var = get_node_key_mark ff (PdgIndex.Key.decl_var_key var) let get_param_mark ff n = try match FctMarks.get_sgn ff with None -> SlicingMarks.bottom_mark | Some sgn -> SlicingMarks.get_input_mark sgn n with Not_found -> SlicingMarks.bottom_mark let get_label_mark ff label_stmt label = let key = PdgIndex.Key.label_key label_stmt label in get_node_key_mark ff key let get_stmt_mark ff stmt = try let stmt_key = PdgIndex.Key.stmt_key stmt in let marks = FctMarks.get_node_marks ff stmt_key in let marks = match stmt_key with | PdgIndex.Key.Stmt _ -> marks | PdgIndex.Key.CallStmt _ -> marks | _ -> assert false in SlicingMarks.merge_marks marks with Not_found -> match stmt.Cil_types.skind with | Cil_types.Block _ | Cil_types.UnspecifiedSequence _ -> (* block are always visible for syntactic reasons *) SlicingMarks.mk_gen_spare | _ -> SlicingMarks.bottom_mark let get_top_input_mark fi = try let key = PdgIndex.Key.top_input in FctMarks.get_fi_node_mark fi key with Not_found -> SlicingMarks.bottom_mark let merge_inputs_m1_mark ff = let ff_sig = match FctMarks.get_sgn ff with Some s -> s | None -> assert false (* "Should have a signature !" *) in SlicingMarks.merge_inputs_m1_mark ff_sig let get_input_loc_under_mark ff loc = let ff_sig = match FctMarks.get_sgn ff with Some s -> s | None -> assert false (* "Should have a signature !" *) in SlicingMarks.get_input_loc_under_mark ff_sig loc (*-----------------------------------------------------------------------*) (** {2 Getting the source function marks} *) exception StopMerging let merge_fun_callers get_list get_value merge is_top acc kf = if is_top acc then acc else begin let acc = ref acc in let table = ref Cil_datatype.Varinfo.Set.empty in try let merge m = acc := merge m !acc ; if is_top !acc then raise StopMerging (* acceleration when top is reached *) in let rec merge_fun_callers kf = let merge_fun_caller (kf,_) = merge_fun_callers kf in let vf = Kernel_function.get_vi kf in if not (Cil_datatype.Varinfo.Set.mem vf !table) then begin table := Cil_datatype.Varinfo.Set.add vf !table ; List.iter (fun x -> merge (get_value x)) (get_list kf) ; List.iter merge_fun_caller (!Db.Value.callers kf) end (* else no way to add something, the [kf] contribution is already accumulated. *) in merge_fun_callers kf; !acc with StopMerging -> !acc end (** The mark [m] related to all statements of a source function [kf]. Property : [is_bottom (get_from_func kf) = not (is_src_fun_called kf) ] *) let get_mark_from_src_fun kf = let kf_entry, _library = Globals.entry_point () in if is_src_fun_called kf_entry then SlicingMarks.mk_user_mark ~data:true ~addr:true ~ctrl:true else let directly_called kf = (SlicingMacros.get_kf_fi kf).SlicingInternals.f_called_by in let get_call_mark (ff,stmt) = get_stmt_mark ff stmt in let merge m1 m2 = SlicingMarks.merge_marks [m1 ; m2] in let is_top = SlicingMarks.is_top_mark in let bottom = SlicingMarks.bottom_mark in merge_fun_callers directly_called get_call_mark merge is_top bottom kf (*-----------------------------------------------------------------------*) (** {2 Printing} (see also {!PrintSlice}) *) let print_ff_sig fmt ff = Format.fprintf fmt "%s:@ " (SlicingMacros.ff_name ff); match FctMarks.get_sgn ff with | None -> Format.fprintf fmt "<not computed>" | Some s -> SlicingMarks.pretty_sig fmt s (*-----------------------------------------------------------------------*) (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/fct_slice.mli����������������������������������������������0000666�0000000�0000000�00000007742�13571573400�017563� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open SlicingInternals open Cil_types (** Return [true] if the source function is called * (even indirectly via transitivity) from a [Slice.t]. *) val is_src_fun_called : Cil_types.kernel_function -> bool (** Return [true] if the source function is visible * (even indirectly via transitivity) from a [Slice.t]. *) val is_src_fun_visible : Cil_types.kernel_function -> bool (** * @raise SlicingTypes.ExternalFunction if the function has no source code, * because there cannot be any slice for it. * @raise SlicingTypes.NoPdg when there is no PDG for the function. *) val make_new_ff : fct_info -> bool -> fct_slice * criterion list val merge_slices : fct_slice -> fct_slice -> fct_slice * criterion list val copy_slice : fct_slice -> fct_slice val filter_already_in : fct_slice -> fct_base_criterion -> fct_base_criterion val apply_add_marks : fct_slice -> fct_base_criterion -> criterion list val add_marks_to_fi : fct_info -> fct_base_criterion -> bool -> criterion list -> bool * criterion list val add_top_mark_to_fi : fct_info -> pdg_mark -> bool -> criterion list -> criterion list val check_outputs_before_change_call : fct_slice -> stmt -> fct_slice -> criterion list val apply_change_call : fct_slice -> stmt -> called_fct -> criterion list val apply_choose_call : fct_slice -> stmt -> criterion list val apply_missing_inputs : fct_slice -> stmt -> (fct_base_criterion * bool) -> criterion list val apply_missing_outputs : fct_slice -> stmt -> fct_base_criterion -> bool -> criterion list val apply_examine_calls : fct_slice -> pdg_mark PdgMarks.info_called_outputs -> criterion list val get_called_slice : fct_slice -> stmt -> (fct_slice option * bool) val get_node_mark : fct_slice -> PdgTypes.Node.t -> pdg_mark val get_node_key_mark : fct_slice -> PdgIndex.Key.t -> pdg_mark val get_top_input_mark : fct_info -> pdg_mark val get_stmt_mark : fct_slice -> stmt -> pdg_mark val get_label_mark : fct_slice -> stmt -> label -> pdg_mark val get_param_mark : fct_slice -> int -> pdg_mark val get_local_var_mark : fct_slice -> varinfo -> pdg_mark val get_input_loc_under_mark : fct_slice -> Locations.Zone.t -> pdg_mark val get_mark_from_src_fun : Kernel_function.t -> pdg_mark val merge_inputs_m1_mark : fct_slice -> pdg_mark val clear_ff : fct_slice -> unit val print_ff_sig : Format.formatter -> fct_slice -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������frama-c-20.0-Calcium/src/plugins/slicing/printSlice.ml����������������������������������������������0000666�0000000�0000000�00000030643�13571573400�017567� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Everything needed to print the result *) (**/**) open Cil_types (**/**) let find_sub_stmts st = match st.skind with | If(_,bl1,bl2,_) | TryExcept (bl1, _, bl2, _) | TryFinally (bl1, bl2, _) -> bl1.bstmts@bl2.bstmts | Block bl | Loop (_,bl, _, _, _) | Switch (_, bl, _, _) -> bl.bstmts | UnspecifiedSequence seq -> List.map (fun (x,_,_,_,_) -> x) seq | TryCatch(t,c,_) -> List.fold_left (fun acc (_,b) -> acc @ b.bstmts) t.bstmts c | Continue _|Break _|Goto (_, _)|Return (_, _)|Instr _|Throw _ -> [] let str_call_sig ff call fmt = try let _, ff_marks = ff.SlicingInternals.ff_marks in let called, sgn = PdgIndex.FctIndex.find_call ff_marks call in let print_called fmt = match called with | None | Some (None) -> Format.fprintf fmt "@[/* undetermined call */@]" | Some (Some (SlicingInternals.CallSlice ff)) -> Format.fprintf fmt "@[<hov 2>/* call to %a */@]" Fct_slice.print_ff_sig ff | Some (Some(SlicingInternals.CallSrc _)) -> Format.fprintf fmt "@[/* call to source function */@]" in Format.fprintf fmt "@[<v>@[<hov 2>/* sig call:@ %a */@]@ %t@]" SlicingMarks.pretty_sig sgn print_called with Not_found -> Format.fprintf fmt "@[/* invisible call */@]" class printerClass optional_ff = object(self) inherit Printer.extensible_printer () as super val opt_ff = optional_ff method! vdecl fmt var = match opt_ff with | None -> super#vdecl fmt var | Some ff -> if var.vglob then Format.fprintf fmt "@[/**/%a@]" super#vdecl var else let str_m = try let m = Fct_slice.get_local_var_mark ff var in SlicingMarks.mark_to_string m with Not_found -> "[---]" in Format.fprintf fmt "@[<hv>/* %s */@ %a@]" str_m super#vdecl var method! stmtkind sattr next fmt kind = let stmt_info fmt stmt = match opt_ff with | None -> Format.fprintf fmt "@[/* %d */@]" stmt.Cil_types.sid | Some ff -> let str_m = try let m = Fct_slice.get_stmt_mark ff stmt in SlicingMarks.mark_to_string m with Not_found -> "[---]" in if (SlicingMacros.is_call_stmt stmt)then Format.fprintf fmt "@[<hv>%t@ /* %s */@]" (str_call_sig ff stmt) str_m else Format.fprintf fmt "@[/* %s */@]" str_m in let s = Extlib.the self#current_stmt in try Format.fprintf fmt "@[<v>%a@ %a@]" stmt_info s (fun fmt -> super#stmtkind sattr next fmt) kind with Not_found -> (* some sub statements may be visible *) let sub_stmts = find_sub_stmts s in List.iter (self#stmt fmt) sub_stmts method! label fmt l = let label_info = match opt_ff with | None -> "label" | Some ff -> let m = Fct_slice.get_label_mark ff (Extlib.the self#current_stmt) l in SlicingMarks.mark_to_string m in Format.fprintf fmt "@[<hv>/* %s */@ %a@]" label_info super#label l method! private require_braces _ _ = true end let print_fct_from_pdg fmt ?ff pdg = let kf = PdgTypes.Pdg.get_kf pdg in let fct = Kernel_function.get_definition kf in let loc = Cil_datatype.Location.unknown in let glob = Cil_types.GFun (fct, loc) in (* TODO : make it cleaner *) let printer = new printerClass ff in printer#global fmt glob let print_marked_ff fmt ff = let pdg = SlicingMacros.get_ff_pdg ff in Format.fprintf fmt "@[<v>@[<hv>Print slice =@ %a@]@ @ %a@]" Fct_slice.print_ff_sig ff (print_fct_from_pdg ~ff) pdg let print_original_glob fmt glob = let printer = new printerClass None in printer#global fmt glob (*----------------------------------------------------------------------------*) module PrintProject = struct (* Type project is left, instead of being replaced by calls to !Db.Slicing.Project.get_project everywhere. Not sure which solution is the best one. *) type t = string * SlicingInternals.project type node = | Src of SlicingInternals.fct_info | Slice of SlicingInternals.fct_slice | OptSlicingLevel of SlicingInternals.level_option | OptSliceCallers of bool | Action of (int * SlicingInternals.criterion) module V = struct type t = node end module E = struct type t = (node * node) * Cil_types.stmt option let src (e, _) = fst e let dst (e, _) = snd e end type tfi = Undef | PersistSelect | Other let fi_type fi = match fi.SlicingInternals.fi_def with | Some _f -> if SlicingMacros.fi_has_persistent_selection fi then PersistSelect else Other | None -> Undef let node_slice_callers () = (OptSliceCallers (SlicingParameters.Mode.Callers.get ())) let node_slice_calls () = (OptSlicingLevel (SlicingMacros.get_default_level_option true)) let iter_vertex f (_, proj) = f (node_slice_calls ()); f (node_slice_callers ()); let rec do_act n rq_list = match rq_list with | [] -> () | rq :: rq_list -> f (Action (n, rq)) ; do_act (n+1) rq_list in do_act 1 proj.SlicingInternals.actions; let do_kf kf = let fi = SlicingMacros.get_kf_fi kf in let slices = SlicingMacros.fi_slices fi in List.iter (fun ff -> f (Slice ff)) slices; f (Src fi) in Globals.Functions.iter do_kf let iter_edges_slices f proj = let do_edge dest (ff_caller, call) = f ((Slice ff_caller, dest), Some call) in let do_f _f_var fi = List.iter (do_edge (Src fi)) fi.SlicingInternals.f_called_by; let do_ff ff = List.iter (do_edge (Slice ff)) ff.SlicingInternals.ff_called_by in List.iter do_ff (SlicingMacros.fi_slices fi) in Cil_datatype.Varinfo.Hashtbl.iter do_f proj.SlicingInternals.functions let iter_edges_actions f proj = let rec do_act_edge n rq_list = match rq_list with | [] -> () | _ :: [] -> () | rq1 :: rq2 :: rq_list -> f (((Action (n, rq1)), (Action (n+1, rq2))), None); do_act_edge (n+1) (rq2 :: rq_list) in do_act_edge 1 proj.SlicingInternals.actions let iter_edges_src_fun f = let do_kf_calls kf = let fi = SlicingMacros.get_kf_fi kf in let doit (kf_caller,_) = let fi_caller = SlicingMacros.get_kf_fi kf_caller in f ((Src fi_caller, Src fi), None) in List.iter doit (!Db.Value.callers kf) in Globals.Functions.iter do_kf_calls let iter_edges_e f (_, proj) = match proj.SlicingInternals.actions with [] -> () | rq :: _ -> f ((node_slice_callers (), (Action (1, rq))), None); iter_edges_slices f proj; iter_edges_actions f proj; iter_edges_src_fun f let color_soft_green = (0x7FFFD4) let color_medium_green = (0x00E598) let _color_soft_blue = (0x7FAAFF) let color_soft_orange = (0xFFD57F) let color_medium_orange = (0xFFB57F) let _color_green_yellow = (0xAAFF7F) let color_soft_yellow = (0xFFFFC3) let color_medium_yellow = (0xFFFF5D) let _color_pale_orange = (0xFFE1C3) let color_soft_pink = (0xFACDEF) let color_medium_pink = (0xF070D1) let color_soft_purple = (0xE2CDFA) let graph_attributes (name, _) = [`Label name] let default_vertex_attributes _ = [`Style `Filled] let vertex_name v = match v with | Src fi -> SlicingMacros.fi_name fi | Slice ff -> SlicingMacros.ff_name ff | Action (n, _) -> ("rq_"^(string_of_int n)) | OptSlicingLevel _ -> "slicing_level" | OptSliceCallers _ -> "slice_callers" let vertex_attributes v = match v with | Src fi -> let color = match fi_type fi with | Undef -> (`Fillcolor color_soft_yellow) | PersistSelect -> (`Fillcolor color_soft_orange) | Other -> (`Fillcolor color_soft_green) in color::[`Shape `Plaintext] | Slice ff -> let color = match fi_type ff.SlicingInternals.ff_fct with | Undef -> assert false | PersistSelect -> (`Fillcolor color_soft_orange) | Other -> (`Fillcolor color_soft_green) in color ::[`Shape `Ellipse] | Action (_, crit) -> let label = Format.asprintf "%a" SlicingActions.print_crit crit in let attrib = [] in let attrib = (`Label label)::attrib in let attrib = (`Fillcolor color_soft_pink)::attrib in let attrib = (`Shape `Box)::attrib in attrib | OptSlicingLevel mode -> let label = ("SliceCalls = "^(SlicingMacros.str_level_option mode)) in let attrib = [] in let attrib = (`Label label)::attrib in let attrib = (`Fillcolor color_soft_purple)::attrib in let attrib = (`Shape `Ellipse)::attrib in let attrib = (`Fontsize 10)::attrib in attrib | OptSliceCallers b -> let label = ("SliceCallers = "^(if b then "true" else "false")) in let attrib = [] in let attrib = (`Label label)::attrib in let attrib = (`Fillcolor color_soft_purple)::attrib in let attrib = (`Shape `Ellipse)::attrib in let attrib = (`Fontsize 10)::attrib in attrib let default_edge_attributes _ = let attrib = [] in let attrib = (`Fontsize 10)::attrib in attrib let edge_attributes (e, call) = let attrib = match e with | (Src _, Src _) -> [`Style `Invis] | (OptSliceCallers _, _) -> [`Style `Invis] | (_, OptSliceCallers _) -> [`Style `Invis] | _ -> [] in match call with None -> attrib | Some call -> (`Label (string_of_int call.sid)):: attrib let get_subgraph v = let mk_subgraph name attrib = let attrib = (*(`Label name) ::*) (`Style `Filled) :: attrib in Some { Graph.Graphviz.DotAttributes.sg_name= name; sg_parent = None; sg_attributes = attrib } in let f_subgraph fi = let name = SlicingMacros.fi_name fi in let attrib = [`Label ""] in let color = match fi_type fi with | Undef -> (`Fillcolor color_medium_yellow) | PersistSelect -> (`Fillcolor color_medium_orange) | Other -> (`Fillcolor color_medium_green) in let attrib = color :: attrib in mk_subgraph name attrib in let rq_subgraph = let name = "Requests" in let attrib = [] in let attrib = (`Fillcolor color_medium_pink) :: attrib in let attrib = (`Label name) :: attrib in mk_subgraph name attrib in match v with | Src fi -> f_subgraph fi | Slice ff -> f_subgraph ff.SlicingInternals.ff_fct | Action _ -> rq_subgraph | OptSlicingLevel _ | OptSliceCallers _ -> rq_subgraph end module PrintProjGraph = Graph.Graphviz.Dot(PrintProject) let build_dot_project filename title = let project = SlicingState.get () in let file = open_out filename in PrintProjGraph.output_graph file (title, project); close_out file let print_fct_stmts fmt kf = try let pdg = !Db.Pdg.get kf in print_fct_from_pdg fmt pdg; Format.pp_print_flush fmt () with Not_found -> () (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/printSlice.mli���������������������������������������������0000666�0000000�0000000�00000003732�13571573400�017737� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val print_fct_from_pdg : Format.formatter -> ?ff:SlicingInternals.fct_slice -> PdgTypes.Pdg.t -> unit val print_marked_ff : Format.formatter -> SlicingInternals.fct_slice -> unit val print_original_glob : Format.formatter -> Cil_types.global -> unit val print_fct_stmts : Format.formatter -> Cil_types.kernel_function -> unit val build_dot_project : string -> string -> unit ��������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/register.ml������������������������������������������������0000666�0000000�0000000�00000006356�13571573400�017303� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let main () = if SlicingParameters.is_on () then begin SlicingParameters.feedback ~level:1 "slicing requests in progress..."; (* have to do the value analysis before the selections * because some functions use its results, * and the value analysis is not launched automatically. *) !Db.Value.compute (); let project_name = SlicingParameters.ProjectName.get () in Api.Project.reset_slicing (); Api.Request.add_persistent_cmdline (); (* Apply all pending requests. *) if Api.Request.is_request_empty_internal () then begin SlicingParameters.warning "No internal slicing request from the command line." ; if SlicingParameters.Mode.Callers.get () then let kf_entry, _library = Globals.entry_point () in SlicingParameters.warning "Adding an extra request on the entry point of function: %a." Kernel_function.pretty kf_entry; let set = Api.Select.empty_selects in let set = Api.Select.select_func_calls_into set true kf_entry in Api.Request.add_persistent_selection set end; Api.Request.apply_all_internal (); if SlicingParameters.Mode.Callers.get () then Api.Slice.remove_uncalled (); let sliced_project_name = project_name ^ (SlicingParameters.ExportedProjectPostfix.get ()) in SlicingParameters.set_off (); let sliced_project = Api.Project.extract sliced_project_name in Project.on sliced_project SlicingParameters.clear (); SlicingParameters.feedback ~level:2 "done (slicing requests in progress)."; end (** Register the function [main] as a main entry point. *) let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/register_gui.ml��������������������������������������������0000666�0000000�0000000�00000055400�13571573400�020141� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* Update the 'Slicing' column of the gui filetree. *) let update_column = ref (fun _ -> ()) (* Are results shown? *) module Enabled = struct include State_builder.Ref (Datatype.Bool) (struct let name = "Slicing_gui.State" let dependencies = [Api.self] let default () = false end) end (* for slicing callback *) let mk_selection fselect = fselect Api.Select.empty_selects (* for slicing callback *) let mk_selection_cad fselect = mk_selection fselect (Api.Mark.make ~ctrl:true ~addr:true ~data:true) (* for slicing callback *) let mk_selection_all fselect = mk_selection fselect ~spare:false (* for slicing callback *) let mk_slice selection = Enabled.set true; Api.Project.reset_slicing (); Api.Request.add_persistent_selection selection ; Api.Request.apply_all_internal (); if SlicingParameters.Mode.Callers.get () then Api.Slice.remove_uncalled (); let sliced_project_name = SlicingParameters.ProjectName.get () ^ SlicingParameters.ExportedProjectPostfix.get () in Api.Project.extract sliced_project_name (* To add a sensitive/insensitive menu item to a [factory] *) let add_item (factory:GMenu.menu GMenu.factory) ~callback name arg_opt = match arg_opt with | None -> (* add the menu item, but it isn't sensitive *) let item = factory#add_item name ~callback:(fun () -> ()) in item#misc#set_sensitive false | Some arg -> (* add the menu item with its callback *) ignore (factory#add_item name ~callback:(fun () -> callback arg)) (* To inform the user about a status. *) let gui_annot_info (main_ui:Design.main_window_extension_points) ?(level=2) txt= if (SlicingParameters.verbose_atleast level) then begin main_ui#pretty_information "%t.@." txt end (* To inform the user about an error. *) let gui_mk_slice (main_ui:Design.main_window_extension_points) selection ~info = gui_annot_info main_ui info; let new_project = mk_slice selection in (* ... slicing computation *) gui_annot_info main_ui (fun fmt -> Format.fprintf fmt "Slice exported to project: %s" (Project.get_unique_name new_project)); main_ui#rehighlight () let msg_help_enable_gui = "Enables/Disables the Slicing GUI." let msg_help_libraries = "Allows/Disallows the use of the -slicing-level option for calls to \ undefined functions." let check_value_computed (main_ui:Design.main_window_extension_points) = if Db.Value.is_computed () then true else let answer = GToolbox.question_box ~title:("Eva Needed") ~buttons:[ "Run"; "Cancel" ] ("Eva has to be run first.\nThis can take some time and may \ require some special settings.\n" ^"Do you want to run Eva with its current settings now?") in if answer = 1 then match main_ui#full_protect ~cancelable:true !Db.Value.compute with | Some _ -> main_ui#redisplay (); (* New alarms *) true | None -> false else false (* To do an action and inform the user. *) let gui_apply_action (main_ui:Design.main_window_extension_points) f x ~info = f x ; gui_annot_info main_ui info let slicing_selector (popup_factory:GMenu.menu GMenu.factory) (main_ui:Design.main_window_extension_points) ~button localizable = if (not (Db.Value.is_computed ())) then ignore (popup_factory#add_item "Enable _slicing" ~callback: (fun () -> let enable () = Enabled.set true; !update_column `Visibility in if (not (Db.Value.is_computed ())) then begin if check_value_computed main_ui then enable () end else enable () )) else if button = 1 then begin let level = 1 in let slicing_view () = gui_annot_info main_ui ~level (fun fmt -> Format.fprintf fmt "Highlighting.") in SlicingState.may slicing_view; if SlicingParameters.verbose_atleast level then begin let slicing_mark () = let slicing_mark kf get_mark = (* use -slicing-debug -verbose to get slicing mark information *) let add_mark_info txt = gui_annot_info ~level main_ui (fun fmt -> Format.fprintf fmt "Tag: %s" (txt ())) in let slices = Api.Slice.get_all kf in match slices with | [] -> (* No slice for this kf *) add_mark_info (fun () -> if Api.Project.is_called kf then (* but the source function is called *) (Format.asprintf "<src>%a" Api.Mark.pretty (Api.Mark.get_from_src_func kf)) else "< >< >") | slices -> if Api.Project.is_called kf then begin (* The source function is also called *) assert (not (kf == fst (Globals.entry_point ()))) ; add_mark_info (fun () -> Format.asprintf "<src>%a" Api.Mark.pretty (Api.Mark.get_from_src_func kf)) end ; let mark_slice slice = add_mark_info (fun () -> Format.asprintf "%a" Api.Mark.pretty (get_mark slice)) in List.iter mark_slice slices in match localizable with | Pretty_source.PTermLval(Some kf,(Kstmt ki),_,_) | Pretty_source.PLval (Some kf,(Kstmt ki),_) | Pretty_source.PStmt (kf,ki) -> slicing_mark kf (fun slice -> Api.Slice.get_mark_from_stmt slice ki) | Pretty_source.PVDecl (Some kf,_,vi) -> slicing_mark kf (fun slice -> Api.Slice.get_mark_from_local_var slice vi) | _ -> () in SlicingState.may slicing_mark end end else if button = 3 then begin let submenu = popup_factory#add_submenu "Slicing" in let slicing_factory = new Design.protected_menu_factory (main_ui:>Gtk_helper.host) submenu in (* definitions for slicing plug-in *) let add_slicing_item name ~callback v = let callback v = callback v; !update_column `Contents in add_item slicing_factory name ~callback v in let mk_slice = gui_mk_slice main_ui in let add_slice_menu kf_opt kf_ki_lv_opt = (let callback kf = mk_slice ~info:(fun fmt -> Format.fprintf fmt "Request for slicing effects of function %a" Kernel_function.pretty kf) (mk_selection_all Api.Select.select_func_calls_to kf) in add_slicing_item "Slice calls to" kf_opt ~callback); (let callback kf = mk_slice ~info:(fun fmt -> Format.fprintf fmt "Request for slicing entrance into function %a" Kernel_function.pretty kf) (mk_selection_all Api.Select.select_func_calls_into kf) in add_slicing_item "Slice calls into" kf_opt ~callback); (let callback kf = mk_slice ~info:(fun fmt -> Format.fprintf fmt "Request for returned value of function %a" Kernel_function.pretty kf) (mk_selection_all Api.Select.select_func_return kf) in add_slicing_item "Slice result" (Extlib.opt_filter (fun kf -> let is_not_void_kf x = match x.Cil_types.vtype with | Cil_types.TFun (Cil_types.TVoid (_),_,_,_) -> false | _ -> true in is_not_void_kf (Kernel_function.get_vi kf)) kf_opt) ~callback); (let callback (kf, ki, _) = mk_slice ~info:(fun fmt -> Format.fprintf fmt "Request for slicing effects of statement %d" ki.sid) (mk_selection_all Api.Select.select_stmt ki kf) in add_slicing_item "Slice stmt" kf_ki_lv_opt ~callback); let get_lv lvopt text = match lvopt with | None -> Gtk_helper.input_string ~parent:main_ui#main_window ~title:"Enter an lvalue" text | Some lv -> (* For probably dubious reasons, the functions in Api.Select require strings instead of directly a lvalue. Thus, we convert our shiny lvalue to string, so that it may be parsed back... *) Some (Pretty_utils.to_string Printer.pp_lval lv) in (let callback (kf, ki, lvopt) = let do_with_txt txt = try let lval_str = Datatype.String.Set.add txt Datatype.String.Set.empty in mk_slice ~info:(fun fmt -> Format.fprintf fmt "Request for slicing lvalue %s before statement %d" txt ki.sid) (mk_selection_cad Api.Select.select_stmt_lval lval_str ~before:true ki ~eval:ki kf) with e -> main_ui#error "Invalid expression: %s" (Printexc.to_string e) in let txt = get_lv lvopt "Input a lvalue to slice on its value before the current statement." in Extlib.may do_with_txt txt in add_slicing_item "Slice lval" kf_ki_lv_opt ~callback); (let callback (kf, ki, lvopt) = let do_with_txt txt = try let lval_str = Datatype.String.Set.add txt Datatype.String.Set.empty in mk_slice ~info:(fun fmt -> Format.fprintf fmt "Request for slicing read accesses to lvalue %s" txt) (mk_selection_cad Api.Select.select_func_lval_rw ~rd:lval_str ~wr:Datatype.String.Set.empty ~eval:ki kf) with e -> main_ui#error "Invalid expression: %s" (Printexc.to_string e) in let txt = get_lv lvopt "Input a lvalue to slice on its read accesses." in Extlib.may do_with_txt txt in add_slicing_item "Slice rd" kf_ki_lv_opt ~callback); (let callback (kf, ki, lvopt) = let do_with_txt txt = try let lval_str = Datatype.String.Set.add txt Datatype.String.Set.empty in mk_slice ~info:(fun fmt -> Format.fprintf fmt "Request for slicing written accesses to lvalue %s" txt) (mk_selection_cad Api.Select.select_func_lval_rw ~rd:Datatype.String.Set.empty ~wr:lval_str ~eval:ki kf) with e -> main_ui#error "Invalid expression: %s" (Printexc.to_string e) in let txt = get_lv lvopt "Input a lvalue to slice on its write accesses." in Extlib.may do_with_txt txt in add_slicing_item "Slice wr" kf_ki_lv_opt ~callback); let callback (kf, ki, _) = mk_slice ~info:(fun fmt -> Format.fprintf fmt "Request for slicing accessibility to statement %d" ki.sid) (mk_selection_all Api.Select.select_stmt_ctrl ki kf) in add_slicing_item "Slice ctrl" kf_ki_lv_opt ~callback in let some_kf_from_vi vi = try let kf = Globals.Functions.get vi in if !Db.Value.is_called kf then Some kf else None with Not_found -> None in let some_kf_from_lv lv = match lv with | Var vi,_ -> some_kf_from_vi vi | _ -> None in let some_kf_ki_lv kf stmt lvopt = if !Db.Value.is_called kf && Db.Value.is_reachable_stmt stmt then Some (kf, stmt, lvopt) else None in begin (* add menu for slicing and scope plug-in *) match localizable with | Pretty_source.PLval (Some kf,(Kstmt stmt),lv)-> add_slice_menu (some_kf_from_lv lv) (some_kf_ki_lv kf stmt (Some lv)) (* | Pretty_source.PTermLval(Some kf,_,Kstmt ki,_) (* as for 'statement' localizable. We currently ignore the term-lval *) *) | Pretty_source.PStmt (kf, stmt) -> add_slice_menu None (some_kf_ki_lv kf stmt None) | Pretty_source.PVDecl (kfopt,ki,vi) -> begin add_slice_menu (some_kf_from_vi vi) None; match kfopt, ki with | Some kf, Kstmt stmt -> add_slice_menu None (some_kf_ki_lv kf stmt None) | _ -> () end | _ -> add_slice_menu None None end; ignore (slicing_factory#add_separator ()); end let slicing_highlighter(buffer:Design.reactive_buffer) localizable ~start ~stop= if Enabled.get () then begin (* Definition for highlight 'Slicing' *) let highlight () = let buffer = buffer#buffer in let ki = Pretty_source.ki_of_localizable localizable in if Db.Value.is_accessible ki then let unused_code_area = Gtk_helper.make_tag buffer ~name:"slicing_unused" [`STRIKETHROUGH true ] in let spare_code_area = Gtk_helper.make_tag buffer ~name:"slicing_spare" [`UNDERLINE `LOW] in let necessary_code_area = Gtk_helper.make_tag buffer ~name:"slicing_necessary" [`BACKGROUND "green"] in let apply_on_one_project_and_merge_slices kf pb pe mark_of_slice = let apply_mark mark = if SlicingParameters.debug_atleast 1 then SlicingParameters.debug "Got mark: %a" Api.Mark.pretty mark; if Api.Mark.is_bottom mark then Gtk_helper.apply_tag buffer unused_code_area pb pe; if Api.Mark.is_spare mark then Gtk_helper.apply_tag buffer spare_code_area pb pe; if (Api.Mark.is_ctrl mark || Api.Mark.is_data mark || Api.Mark.is_addr mark) then Gtk_helper.apply_tag buffer necessary_code_area pb pe in let slices = Api.Slice.get_all kf in begin match slices with | [] -> (* No slice for this kf *) if Api.Project.is_called kf then begin SlicingParameters.debug "Got source code@." ; apply_mark (Api.Mark.get_from_src_func kf) end else Gtk_helper.apply_tag buffer unused_code_area pb pe | slices -> if Api.Project.is_called kf then begin assert (not (kf == fst (Globals.entry_point ()))) ; SlicingParameters.debug "Got source code" ; apply_mark (Api.Mark.get_from_src_func kf) end ; if SlicingParameters.debug_atleast 1 then begin let l = List.length slices in if l >=2 then SlicingParameters.debug "Got %d slices" (List.length slices) end; let mark_slice slice = let mark = mark_of_slice slice in apply_mark mark in List.iter mark_slice slices end in let tag_stmt kf stmt pb pe = assert (Db.Value.is_reachable_stmt stmt) ; apply_on_one_project_and_merge_slices kf pb pe (fun slice -> Api.Slice.get_mark_from_stmt slice stmt) in let tag_vdecl kf vi pb pe = if not vi.vglob then apply_on_one_project_and_merge_slices kf pb pe (fun slice -> Api.Slice.get_mark_from_local_var slice vi) in match localizable with | Pretty_source.PStmt (kf,stmt) -> tag_stmt kf stmt start stop | Pretty_source.PVDecl (Some kf,_,vi) -> tag_vdecl kf vi start stop | Pretty_source.PStmtStart _ | Pretty_source.PVDecl (None,_,_) | Pretty_source.PLval _ | Pretty_source.PTermLval _ | Pretty_source.PGlobal _ | Pretty_source.PIP _ | Pretty_source.PExp _ -> () in (* 2. Highlights the 'Slicing' *) SlicingState.may highlight end (* Not used *) (* let none_text = "<i>None</i>" *) let pretty_setting_option fmt = Format.fprintf fmt "@[Setting option %s@ %s@ for the current project@]" let gui_set_slicing_debug (main_ui:Design.main_window_extension_points) v = let old = SlicingParameters.Verbose.get () in if v <> old then (* Otherwise set is done at every refreshing *) gui_apply_action main_ui SlicingParameters.Verbose.set v ~info:(fun fmt -> pretty_setting_option fmt "-slicing-verbose" (string_of_int v)) let gui_set_slicing_level (main_ui:Design.main_window_extension_points) v = let old = SlicingParameters.Mode.Calls.get () in if v != old then (* Otherwise set is done at every refreshing *) gui_apply_action main_ui SlicingParameters.Mode.Calls.set v ~info:(fun fmt -> pretty_setting_option fmt "-slicing-level" (string_of_int v)) let gui_set_slicing_undef_functions (main_ui:Design.main_window_extension_points) v = let old = SlicingParameters.Mode.SliceUndef.get () in if v != old then (* Otherwise set is done at every refreshing *) gui_apply_action main_ui SlicingParameters.Mode.SliceUndef.set v ~info:(fun fmt -> pretty_setting_option fmt (if v then "-slice-undef-functions" else "-no-slice-undef-functions") "") let slicing_panel (main_ui:Design.main_window_extension_points) = let w = GPack.vbox () in let table = GPack.table ~columns:2 ~rows:2 ~homogeneous:true ~packing:w#pack () in let hbox2 = GPack.hbox ~packing:(table#attach ~left:1 ~top:0) () in (* [enabled_button] to give slicing menu available *) let do_refresh to_enable = if to_enable then ignore (check_value_computed main_ui); !update_column `Visibility; main_ui#rehighlight (); in let enabled_button = let b = GButton.check_button ~label:"Enable" ~active:(Enabled.get ()) ~packing:(table#attach ~left:0 ~top:0) () in main_ui#help_message b "%s" msg_help_enable_gui ; ignore (b#connect#toggled ~callback:(fun () -> Enabled.set b#active; do_refresh b#active)); b in let verbose_refresh = Gtk_helper.on_int ~lower:0 ~upper:3 hbox2 "Verbosity" ~sensitive:Enabled.get SlicingParameters.Verbose.get (gui_set_slicing_debug main_ui) in let hbox3 = GPack.hbox ~packing:(table#attach ~left:1 ~top:1) () in (* [slice_undef_button] related to -slice-undef option *) let slice_undef_button = let b = GButton.check_button ~label:"Libraries" ~active:(Enabled.get ()) ~packing:(table#attach ~left:0 ~top:1) () in main_ui#help_message b "%s" msg_help_libraries ; ignore (b#connect#toggled (fun () -> gui_set_slicing_undef_functions main_ui b#active)); b in let level_refresh = Gtk_helper.on_int ~lower:0 ~upper:3 hbox3 "Level" ~sensitive:Enabled.get SlicingParameters.Mode.Calls.get (gui_set_slicing_level main_ui) in let refresh () = let value_is_computed = Db.Value.is_computed () in let enabled = Enabled.get () in enabled_button#misc#set_sensitive value_is_computed ; slice_undef_button#misc#set_sensitive enabled ; verbose_refresh (); level_refresh (); if Enabled.get () <> enabled_button#active then ( enabled_button#set_active (Enabled.get ()); !update_column `Contents; ); slice_undef_button#set_active (SlicingParameters.Mode.SliceUndef.get()); in refresh () ; "Slicing",w#coerce,Some refresh let file_tree_decorate (file_tree:Filetree.t) = update_column := file_tree#append_pixbuf_column ~title:"Slicing" (fun globs -> SlicingState.may_map ~dft:[`STOCK_ID ""] (fun () -> if List.exists (fun glob -> match glob with | GFun ({svar = vi},_ ) -> begin try let kf = Globals.Functions.get vi in (Api.Project.is_called kf) || ( [] != (Api.Slice.get_all kf)) with Not_found -> false end | _ -> false) globs then [`STOCK_ID "gtk-apply"] else [`STOCK_ID ""])) (fun () -> Enabled.get ()); !update_column `Visibility let main (main_ui:Design.main_window_extension_points) = main_ui#register_source_selector slicing_selector; main_ui#register_source_highlighter slicing_highlighter; main_ui#register_panel slicing_panel; file_tree_decorate main_ui#file_tree let () = Design.register_extension main (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/register_gui.mli�������������������������������������������0000666�0000000�0000000�00000003372�13571573400�020313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Extension of the GUI in order to support slicing visualization. No function is exported. *) (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingActions.ml������������������������������������������0000666�0000000�0000000�00000027237�13571573400�020431� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module deals with the action management. * It consists of the definitions of the different kinds of actions, * and the management of the action list. *) (**/**) type select = SlicingTypes.sl_mark PdgMarks.select type n_or_d_marks = (SlicingInternals.node_or_dpds * SlicingInternals.pdg_mark) list (**/**) (*============================================================================*) (** {2 Build} *) (** {3 How the elements will be selected} *) (** Build a description to tell that the associated nodes have to be marked * with the given mark, and than the same one will be propagated through * their dependencies. (see also {!build_node_and_dpds_selection}) *) let build_simple_node_selection ?(nd_marks=[]) mark = (SlicingInternals.CwNode, mark)::nd_marks (** Only the control dependencies of the nodes will be marked *) let build_addr_dpds_selection ?(nd_marks=[]) mark = (SlicingInternals.CwAddrDpds, mark)::nd_marks (** Only the control dependencies of the nodes will be marked *) let build_data_dpds_selection ?(nd_marks=[]) mark = (SlicingInternals.CwDataDpds, mark)::nd_marks (** Only the control dependencies of the nodes will be marked *) let build_ctrl_dpds_selection ?(nd_marks=[]) mark = (SlicingInternals.CwCtrlDpds, mark)::nd_marks (** Build a description to tell how the selected PDG nodes and their * dependencies will have to be marked * (see {!type:SlicingTypes.Internals.node_or_dpds}). * This description depend on the mark that has been asked for. * First of all, whatever the mark is, the node is selected as [spare], * so that it will be visible, and so will its dependencies. Then, * if [is_ctrl mark] propagate a m1 control mark through the control dependencies * and do a similar thing for [addr] and [data] *) let build_node_and_dpds_selection ?(nd_marks=[]) mark = let m_spare = SlicingMarks.mk_user_spare in let nd_marks = build_simple_node_selection ~nd_marks:nd_marks m_spare in let nd_marks = if SlicingMarks.is_ctrl_mark mark then let m_ctrl = SlicingMarks.mk_user_mark ~ctrl:true ~data:false ~addr:false in build_ctrl_dpds_selection ~nd_marks:nd_marks m_ctrl else nd_marks in let nd_marks = if SlicingMarks.is_addr_mark mark then let m_addr = SlicingMarks.mk_user_mark ~ctrl:false ~data:false ~addr:true in build_addr_dpds_selection ~nd_marks:nd_marks m_addr else nd_marks in let nd_marks = if SlicingMarks.is_data_mark mark then let m_data = SlicingMarks.mk_user_mark ~ctrl:false ~data:true ~addr:false in build_data_dpds_selection ~nd_marks:nd_marks m_data else nd_marks in nd_marks (** {3 Translations to a mapping between marks and program elements} *) let translate_crit_to_select pdg ?(to_select=[]) list_crit = let translate acc (nodes, nd_mark) = let add_pdg_mark acc (nd, mark) = let add_nodes m acc nodes = let add m acc nodepart = PdgMarks.add_node_to_select acc nodepart m in List.fold_left (add m) acc nodes in let add_node_dpds dpd_mark f_dpds acc (node, _node_z_part) = let nodes = f_dpds node in add_nodes dpd_mark acc nodes in let acc = match nd with | SlicingInternals.CwNode -> add_nodes mark acc nodes | SlicingInternals.CwAddrDpds -> let f = PdgTypes.Pdg.get_x_direct_dpds PdgTypes.Dpd.Addr pdg in List.fold_left (add_node_dpds mark f) acc nodes | SlicingInternals.CwCtrlDpds -> let f = PdgTypes.Pdg.get_x_direct_dpds PdgTypes.Dpd.Ctrl pdg in List.fold_left (add_node_dpds mark f) acc nodes | SlicingInternals.CwDataDpds -> let f = PdgTypes.Pdg.get_x_direct_dpds PdgTypes.Dpd.Data pdg in List.fold_left (add_node_dpds mark f) acc nodes in acc in List.fold_left add_pdg_mark acc nd_mark in List.fold_left translate to_select list_crit (** {3 Function criteria} *) (** build an action to apply the criteria to the persistent selection of the * function. It means that it will be applied to all slices. *) let mk_fct_crit fi crit = SlicingInternals.CrFct { SlicingInternals.cf_fct = SlicingInternals.FctSrc fi ; SlicingInternals.cf_info = crit } let mk_fct_user_crit fi crit = mk_fct_crit fi (SlicingInternals.CcUserMark crit) let mk_crit_fct_top fi m = mk_fct_user_crit fi (SlicingInternals.CuTop m) let mk_crit_fct_user_select fi select = mk_fct_user_crit fi (SlicingInternals.CuSelect select) let mk_crit_prop_persit_marks fi node_marks = mk_fct_crit fi (SlicingInternals.CcPropagate node_marks) (** build an action to apply the criteria to the given slice. *) let mk_ff_crit ff crit = SlicingInternals.CrFct { SlicingInternals.cf_fct = SlicingInternals.FctSliced ff ; SlicingInternals.cf_info = crit } let mk_ff_user_select ff crit = mk_ff_crit ff (SlicingInternals.CcUserMark (SlicingInternals.CuSelect crit)) let mk_crit_choose_call ff call = mk_ff_crit ff (SlicingInternals.CcChooseCall call) let mk_crit_change_call ff call f = mk_ff_crit ff (SlicingInternals.CcChangeCall (call, f)) let mk_crit_missing_inputs ff call (input_marks, more_inputs) = mk_ff_crit ff (SlicingInternals.CcMissingInputs (call, input_marks, more_inputs)) let mk_crit_missing_outputs ff call (output_marks, more_outputs) = mk_ff_crit ff (SlicingInternals.CcMissingOutputs (call, output_marks, more_outputs)) let mk_crit_examines_calls ff call_out_marks = mk_ff_crit ff (SlicingInternals.CcExamineCalls call_out_marks) let mk_appli_select_calls fi = SlicingInternals.CrAppli (SlicingInternals.CaCall fi) (** {3 Shortcut functions for previous things} *) let mk_crit_mark_calls fi_caller to_call mark = let select = try let caller = SlicingMacros.get_fi_kf fi_caller in let pdg_caller = !Db.Pdg.get caller in let call_stmts = !Db.Pdg.find_call_stmts ~caller to_call in let stmt_mark stmt = let stmt_ctrl_node = !Db.Pdg.find_call_ctrl_node pdg_caller stmt in (PdgMarks.mk_select_node stmt_ctrl_node, mark) in let select = List.map stmt_mark call_stmts in SlicingInternals.CuSelect select with PdgTypes.Pdg.Top -> SlicingInternals.CuTop mark in mk_fct_user_crit fi_caller select let mk_crit_add_output_marks ff select = (* let pdg = SlicingMacros.get_ff_pdg ff in let add acc (out, m) = let nd_m = build_simple_node_selection m in let node = out in mk_mark_nodes pdg ~marks:acc [node] nd_m in let select = List.fold_left add [] output_marks in *) mk_ff_user_select ff select (* let mk_crit_add_all_outputs_mark ff mark = let pdg = SlicingMacros.get_ff_pdg ff in let nodes = !Db.Pdg.find_all_outputs_nodes pdg in let nd_m = build_simple_node_selection mark in let select = mk_mark_nodes nodes nd_m in mk_ff_user_crit ff select *) (*============================================================================*) (** {2 Print} *) let print_nd_and_mark f (nd, m) = let str = match nd with | SlicingInternals.CwNode -> "" | SlicingInternals.CwAddrDpds -> "addr->" | SlicingInternals.CwDataDpds -> "data->" | SlicingInternals.CwCtrlDpds -> "ctrl->" in Format.fprintf f "%s%a" str SlicingMarks.pretty_mark m let rec print_nd_and_mark_list fmt ndm_list = match ndm_list with | [] -> () | x :: ndm_list -> print_nd_and_mark fmt x; print_nd_and_mark_list fmt ndm_list let print_nodes fmt nodes = let print n = Format.fprintf fmt "%a " (!Db.Pdg.pretty_node true) n in List.iter print nodes let print_node_mark fmt n z m = Format.fprintf fmt "(%a ,%a)" (PdgTypes.Node.pretty_with_part) (n, z) SlicingMarks.pretty_mark m let print_sel_marks_list fmt to_select = let print_sel (s, m) = match s with | PdgMarks.SelNode (n, z) -> print_node_mark fmt n z m | PdgMarks.SelIn l -> Format.fprintf fmt "(UndefIn %a:%a)" Locations.Zone.pretty l SlicingMarks.pretty_mark m in match to_select with [] -> Format.fprintf fmt "<empty>" | _ -> List.iter print_sel to_select let _print_ndm fmt (nodes, ndm_list) = Format.fprintf fmt "(%a,%a)" print_nodes nodes print_nd_and_mark_list ndm_list let print_f_crit fmt f_crit = match f_crit with | SlicingInternals.CuTop m -> Format.fprintf fmt "top(%a)" SlicingMarks.pretty_mark m | SlicingInternals.CuSelect to_select -> print_sel_marks_list fmt to_select let print_crit fmt crit = match crit with | SlicingInternals.CrFct fct_crit -> let fct = fct_crit.SlicingInternals.cf_fct in let name = SlicingMacros.f_name fct in Format.fprintf fmt "[%s = " name; let _ = match fct_crit.SlicingInternals.cf_info with | SlicingInternals.CcUserMark info -> print_f_crit fmt info | SlicingInternals.CcMissingInputs (call, _input_marks, more_inputs) -> Format.fprintf fmt "missing_inputs for call %d (%s)" call.Cil_types.sid (if more_inputs then "more_inputs" else "marks only") | SlicingInternals.CcMissingOutputs (call, _output_marks, more_outputs) -> Format.fprintf fmt "missing_outputs for call %d (%s)" call.Cil_types.sid (if more_outputs then "more_outputs" else "marks only") | SlicingInternals.CcChooseCall call -> Format.fprintf fmt "choose_call for call %d" call.Cil_types.sid | SlicingInternals.CcChangeCall (call,f) -> let fname = match f with | SlicingInternals.CallSlice ff -> SlicingMacros.ff_name ff | SlicingInternals.CallSrc (Some fi) -> ("(src:"^( SlicingMacros.fi_name fi)^")") | SlicingInternals.CallSrc None -> "(src)" in Format.fprintf fmt "change_call for call %d -> %s" call.Cil_types.sid fname | SlicingInternals.CcPropagate nl -> Format.fprintf fmt "propagate %a" print_sel_marks_list nl | SlicingInternals.CcExamineCalls _ -> Format.fprintf fmt "examine_calls" in Format.fprintf fmt "]" | SlicingInternals.CrAppli (SlicingInternals.CaCall fi) -> let name = SlicingMacros.fi_name fi in Format.fprintf fmt "[Appli : calls to %s]" name | _ -> SlicingParameters.not_yet_implemented "Printing this slicing criterion " let print_list_crit fmt list_crit = List.iter (print_crit fmt) list_crit (*============================================================================*) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingActions.mli�����������������������������������������0000666�0000000�0000000�00000007161�13571573400�020574� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open SlicingTypes open Cil_types open SlicingInternals type select = sl_mark PdgMarks.select (** selection mode (ie which mark to associate to the node and how to propagate in the different kinds of dependencies) *) type n_or_d_marks val build_simple_node_selection : ?nd_marks:n_or_d_marks -> sl_mark -> n_or_d_marks val build_addr_dpds_selection : ?nd_marks:n_or_d_marks -> sl_mark -> n_or_d_marks val build_data_dpds_selection : ?nd_marks:n_or_d_marks -> sl_mark -> n_or_d_marks val build_ctrl_dpds_selection : ?nd_marks:n_or_d_marks -> sl_mark -> n_or_d_marks val build_node_and_dpds_selection : ?nd_marks:n_or_d_marks -> sl_mark -> n_or_d_marks val translate_crit_to_select : Db.Pdg.t -> ?to_select:select -> ((PdgTypes.Node.t * Locations.Zone.t option) list * n_or_d_marks) list -> select val mk_fct_crit : fct_info -> fct_crit -> criterion val mk_crit_fct_user_select : fct_info -> select -> criterion val mk_crit_fct_top : fct_info -> sl_mark -> criterion val mk_crit_prop_persit_marks : fct_info -> select -> criterion val mk_ff_user_select : fct_slice -> select -> criterion val mk_crit_choose_call : fct_slice -> stmt -> criterion val mk_crit_change_call : fct_slice -> stmt -> called_fct -> criterion val mk_crit_missing_inputs : fct_slice -> stmt -> select * bool -> criterion val mk_crit_missing_outputs : fct_slice -> stmt -> select * bool -> criterion val mk_crit_examines_calls : fct_slice -> sl_mark PdgMarks.info_called_outputs -> criterion val mk_appli_select_calls : fct_info -> criterion val mk_crit_mark_calls : fct_info -> kernel_function -> sl_mark -> criterion val mk_crit_add_output_marks : fct_slice -> select -> criterion (** Printing *) val print_nd_and_mark_list : Format.formatter -> n_or_d_marks -> unit val print_nodes : Format.formatter -> PdgTypes.Node.t list -> unit val print_sel_marks_list : Format.formatter -> select -> unit val print_crit : Format.formatter -> criterion -> unit val print_f_crit : Format.formatter -> fct_user_crit -> unit val print_list_crit : Format.formatter -> criterion list -> unit ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingCmds.ml���������������������������������������������0000666�0000000�0000000�00000073234�13571573400�017715� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Those functions were previously outside the slicing module to show how to * use the slicing API. So, they are supposed to use the slicing module through * Db.Slicing only. There are mainly high level functions which make easier * to achieve simple tasks. *) open Cil_types type set = SlicingTypes.Fct_user_crit.t Cil_datatype.Varinfo.Map.t let apply_all_actions () = SlicingParameters.debug ~level:1 "[Api.apply_all_internal]"; SlicingParameters.feedback ~level:1 "applying all slicing requests..."; SlicingParameters.debug ~level:2 "pending requests:@\n %t@\n" SlicingProject.print_proj_worklist; let r = SlicingProject.apply_all_actions () in SlicingParameters.feedback ~level:2 "done (applying all slicing requests)."; r let apply_next_action () = SlicingParameters.debug ~level:1 "[Api.apply_next_internal]"; SlicingProject.apply_next_action () let apply_all ~propagate_to_callers = SlicingParameters.debug ~level:1 "[Api.apply_all]"; assert (not propagate_to_callers) ; try while (true) do (* Format.printf "@\napply_next_internal@."; *) apply_next_action () done with Not_found -> () let get_select_kf (fvar, _select) = Globals.Functions.get fvar (** Utilities for [kinstr]. *) module Kinstr: sig val iter_from_func : (stmt -> unit) -> kernel_function -> unit val is_rw_zone : (Locations.Zone.t option * Locations.Zone.t option) -> stmt -> Locations.Zone.t option * Locations.Zone.t option end = struct (** Iter on statements of a kernel function *) let iter_from_func f kf = let definition = Kernel_function.get_definition kf in List.iter f definition.sallstmts (** Get directly read/written [Zone.t] by the statement. * i.e. directly means when [ki] is a call, it doesn't don't look at the assigns clause of the called function. *) let get_rw_zone stmt = (* returns [Zone.t read],[Zone.t written] *) assert (Db.Value.is_computed ()); let lval_process read_zone stmt lv = (* returns [read_zone] joined to [Zone.t read] by [lv], [Zone.t written] by [lv] *) (* The modified locations are [looking_for], those address are function of [deps]. *) let state = Db.Value.get_stmt_state stmt in let deps, zloc, _exact = !Db.Value.lval_to_zone_with_deps_state state ~deps:(Some read_zone) ~for_writing:true lv in deps, zloc in let call_process lv f args _loc = (* returns [Zone.t read] by [lv, f, args], [Zone.t written] by [lv] *) let read_zone = !Db.From.find_deps_no_transitivity stmt f in let add_args arg inputs = Locations.Zone.join inputs (!Db.From.find_deps_no_transitivity stmt arg) in let read_zone = List.fold_right add_args args read_zone in let read_zone,write_zone = match lv with | None -> read_zone , Locations.Zone.bottom | Some lv -> lval_process read_zone stmt lv in read_zone,write_zone in match stmt.skind with | Switch (exp,_,_,_) | If (exp,_,_,_) -> (* returns [Zone.t read] by condition [exp], [Zone.bottom] *) !Db.From.find_deps_no_transitivity stmt exp, Locations.Zone.bottom | Instr (Set (lv,exp,_)) -> (* returns [Zone.t read] by [exp, lv], [Zone.t written] by [lv] *) let read_zone = !Db.From.find_deps_no_transitivity stmt exp in lval_process read_zone stmt lv | Instr (Local_init (v, AssignInit i, _)) -> let rec collect zone i = match i with | SingleInit e -> Locations.Zone.join zone (!Db.From.find_deps_no_transitivity stmt e) | CompoundInit (_,l) -> List.fold_left (fun acc (_,i) -> collect acc i) zone l in let read_zone = collect Locations.Zone.bottom i in lval_process read_zone stmt (Cil.var v) | Instr (Call (lvaloption,funcexp,argl,l)) -> call_process lvaloption funcexp argl l | Instr (Local_init(v, ConsInit(f, args, k),l)) -> Cil.treat_constructor_as_func call_process v f args k l | _ -> Locations.Zone.bottom, Locations.Zone.bottom (** Look at intersection of [rd_zone_opt]/[wr_zone_opt] with the directly read/written [Zone.t] by the statement. * i.e. directly means when [ki] is a call, it doesn't don't look at the assigns clause of the called function. *) let is_rw_zone (rd_zone_opt, wr_zone_opt) stmt = let rd_zone, wr_zone = get_rw_zone stmt in let inter_zone zone_opt zone = match zone_opt with | None -> zone_opt | Some zone_requested -> if Locations.Zone.intersects zone_requested zone then let inter = Locations.Zone.narrow zone_requested zone in Some inter else None in inter_zone rd_zone_opt rd_zone, inter_zone wr_zone_opt wr_zone end (** Topologically propagate user marks to callers in whole project *) let topologic_propagation project = apply_all_actions project; Callgraph.Uses.iter_in_rev_order (fun kf -> SlicingParameters.debug ~level:3 "doing topologic propagation for function: %a" Kernel_function.pretty kf; apply_all_actions project) let add_to_selection set selection = SlicingSelect.Selections.add_to_selects selection set (** Registered as a slicing selection function: Add a selection of the pdg nodes. *) let select_pdg_nodes set mark nodes kf = let selection = SlicingSelect.select_pdg_nodes kf nodes mark in add_to_selection set selection (** Registered as a slicing selection function: Add a selection of the statement. *) let select_stmt set ~spare stmt kf = let stmt_mark = SlicingMarks.mk_user_mark ~data:(not spare) ~addr:(not spare) ~ctrl:(not spare) in let selection = SlicingSelect.select_stmt_computation kf stmt stmt_mark in add_to_selection set selection (** Add a selection to the entrance of the function [kf] and add a selection to its return if [~return] is true and add a selection to [~inputs] parts of its inputs and add a selection to [~outputs] parts of its outputs*) let select_entry_point_and_some_inputs_outputs set ~mark kf ~return ~outputs ~inputs = SlicingParameters.debug ~level:3 "select_entry_point_and_some_inputs_outputs %a" Kernel_function.pretty kf ; let set = let selection = SlicingSelect.select_entry_point kf mark in add_to_selection set selection in let set = if (Locations.Zone.equal Locations.Zone.bottom inputs) then set else let selection = SlicingSelect.select_zone_at_entry kf inputs mark in add_to_selection set selection in if ((Locations.Zone.equal Locations.Zone.bottom outputs) && not return) || (try let ki = Kernel_function.find_return kf in if Db.Value.is_reachable_stmt ki then false else begin SlicingParameters.feedback "@[Nothing to select for unreachable return stmt of %a@]" Kernel_function.pretty kf; true end with Kernel_function.No_Statement -> false) then set else let set = if (Locations.Zone.equal Locations.Zone.bottom outputs) then set else let selection = SlicingSelect.select_modified_output_zone kf outputs mark in add_to_selection set selection in if return then let selection = SlicingSelect.select_return kf mark in add_to_selection set selection else set (* apply [select ~spare] on each callsite of [kf] and add the returned selection to [set]. *) let generic_select_func_calls select_stmt set ~spare kf = assert (Db.Value.is_computed ()); let callers = !Db.Value.callers kf in let select_calls acc (caller, stmts) = List.fold_left (fun acc s -> select_stmt acc ~spare s caller) acc stmts in List.fold_left select_calls set callers (** Registered as a slicing selection function: Add a selection of calls to a [kf]. *) let select_func_calls_into set ~spare kf = let add_to_select set ~spare select = let mark = let nspare = not spare in SlicingMarks.mk_user_mark ~data:nspare ~addr:nspare ~ctrl:nspare in add_to_selection set (select mark) in let kf_entry, _library = Globals.entry_point () in if Kernel_function.equal kf_entry kf then add_to_select set ~spare (SlicingSelect.select_entry_point kf) else let select_min_call set ~spare ki kf = add_to_select set ~spare (SlicingSelect.select_minimal_call kf ki) in generic_select_func_calls select_min_call set ~spare kf (** Registered as a slicing selection function: Add a selection of calls to a [kf]. *) let select_func_calls_to set ~spare kf = let kf_entry, _library = Globals.entry_point () in if Kernel_function.equal kf_entry kf then begin let mark = let nspare = not spare in SlicingMarks.mk_user_mark ~data:nspare ~addr:nspare ~ctrl:nspare in assert (Db.Value.is_computed ()); let outputs = !Db.Outputs.get_external kf in select_entry_point_and_some_inputs_outputs set ~mark kf ~return:true ~outputs ~inputs:Locations.Zone.bottom end else generic_select_func_calls select_stmt set ~spare kf (** Registered as a slicing selection function: Add selection of function outputs. *) let select_func_zone set mark zone kf = let selection = SlicingSelect.select_zone_at_end kf zone mark in add_to_selection set selection (** Registered as a slicing selection function: Add a selection of the [kf] return statement. *) let select_func_return set ~spare kf = try let ki = Kernel_function.find_return kf in select_stmt set ~spare ki kf with Kernel_function.No_Statement -> let mark = SlicingMarks.mk_user_mark ~data:(not spare) ~addr:(not spare) ~ctrl:(not spare) in select_entry_point_and_some_inputs_outputs set ~mark kf ~return:true ~outputs:Locations.Zone.bottom ~inputs:Locations.Zone.bottom (** Registered as a slicing selection function: Add a selection of the statement reachability. Note: add also a transparent selection on the whole statement. *) let select_stmt_ctrl set ~spare ki kf = let ctrl_mark = SlicingMarks.mk_user_mark ~data:false ~addr:false ~ctrl:(not spare) in let selection = SlicingSelect.select_stmt_computation kf ki ctrl_mark in add_to_selection set selection (** Registered as a slicing selection function: Add a selection of data relative to a statement. Note: add also a transparent selection on the whole statement. *) let select_stmt_zone set mark zone ~before ki kf = let selection = SlicingSelect.select_stmt_zone kf ki ~before zone mark in let set = add_to_selection set selection in select_stmt_ctrl set ~spare:true ki kf (** Registered as a slicing selection function: Add a selection of data relative to a statement. Variables of [lval_str] string are bounded relatively to the whole scope of the function [kf]. The interpretation of the address of the lvalues is done just before the execution of the statement [~eval]. The selection preserve the value of these lvalues before or after (c.f. boolean [~before]) the statement [ki]. Note: add also a transparent selection on the whole statement. *) let select_stmt_lval set mark lval_str ~before ki ~eval kf = assert (Db.Value.is_computed ()); if Datatype.String.Set.is_empty lval_str then set else let zone = Datatype.String.Set.fold (fun lval_str acc -> let lval_term = !Db.Properties.Interp.term_lval kf lval_str in let lval = !Db.Properties.Interp.term_lval_to_lval ~result:None lval_term in let state = Db.Value.get_stmt_state eval in let _deps, zone, _exact = !Db.Value.lval_to_zone_with_deps_state ~deps:None ~for_writing:false state lval in Locations.Zone.join zone acc) lval_str Locations.Zone.bottom in select_stmt_zone set mark zone ~before ki kf (** Add a selection of data relative to read/write accesses. Interpret the [~rd] lvalues and the [~wr] lvalues from [~eval] statements of [kf]: - Variables of [lval_str] string are bounded relatively to the whole scope of the function [kf]. - The interpretation of the address of the lvalues is done just before the execution of the statement [~eval]. Find read/write accesses from the whole project if [ki_opt]=None. Otherwise, restrict the research among the direct effect of [ki_opt] statement. i.e. when [ki_opt] is a call, the selection doesn't look at the assigns clause of a call. *) let select_lval_rw set mark ~rd ~wr ~eval kf ki_opt= assert (Db.Value.is_computed ()); let zone_option ~for_writing lval_str = if Datatype.String.Set.is_empty lval_str then None else let zone = Datatype.String.Set.fold (fun lval_str acc -> let lval_term = !Db.Properties.Interp.term_lval kf lval_str in let lval = !Db.Properties.Interp.term_lval_to_lval ~result:None lval_term in let state = Db.Value.get_stmt_state eval in let _deps, zone, _exact = !Db.Value.lval_to_zone_with_deps_state state ~for_writing ~deps:None lval in Locations.Zone.join zone acc) lval_str Locations.Zone.bottom in SlicingParameters.debug ~level:3 "select_lval_rw %a zone=%a" Kernel_function.pretty kf Locations.Zone.pretty zone; Some zone in let zone_rd_opt = zone_option ~for_writing:false rd in let zone_wr_opt = zone_option ~for_writing:true wr in match zone_rd_opt, zone_wr_opt with | None, None -> set | (_, _) as zone_option_rw -> let ac = ref set in let select_rw_from_stmt kf ki = let rd_zone_opt, wr_zone_opt = Kinstr.is_rw_zone zone_option_rw ki in let select_zone ~before zone_opt = match zone_opt with | None -> !ac | Some zone -> SlicingParameters.debug ~level:3 "select_lval_rw sid=%d before=%b zone=%a" ki.sid before Locations.Zone.pretty zone; select_stmt_zone !ac mark zone ~before ki kf ; in ac := select_zone ~before:true rd_zone_opt ; ac := select_zone ~before:false wr_zone_opt in (match ki_opt with | Some ki -> select_rw_from_stmt kf ki | None -> Globals.Functions.iter (fun kf -> if !Db.Value.is_called kf then if not (!Db.Value.use_spec_instead_of_definition kf) then (* Called function with source code: just looks at its stmt *) Kinstr.iter_from_func (select_rw_from_stmt kf) kf else begin (* Called function without source code: looks at its effect *) let select_inter_zone fsel zone_opt zone = match zone_opt with | None -> () | Some zone_requested -> (* Format.printf "@\nselect_lval_rw zone_req=%a zone=%a@." Locations.Zone.pretty zone_requested Locations.Zone.pretty zone; *) if Locations.Zone.intersects zone_requested zone then let inter = Locations.Zone.narrow zone_requested zone in fsel inter else () in let select_wr outputs = ac := select_entry_point_and_some_inputs_outputs !ac ~mark kf ~return:false ~outputs ~inputs:Locations.Zone.bottom and select_rd inputs = ac := select_entry_point_and_some_inputs_outputs !ac ~mark kf ~return:false ~inputs ~outputs:Locations.Zone.bottom in assert (!Db.Value.is_called kf) ; (* otherwise [!Db.Outputs.get_external kf] gives weird results *) select_inter_zone select_wr zone_wr_opt (!Db.Outputs.get_external kf) ; select_inter_zone select_rd zone_rd_opt (!Db.Inputs.get_external kf) end )); !ac (** Registered as a slicing selection function: Add a selection of rw accesses to lvalues relative to a statement. Variables of [~rd] and [~wr] string are bounded relatively to the whole scope of the function [kf]. The interpretation of the address of the lvalues is done just before the execution of the statement [~eval]. The selection preserve the [~rd] and ~[wr] accesses directly contained into the statement [ki]. i.e. when [ki] is a call, the selection doesn't look at the assigns clause of the called function. Note: add also a transparent selection on the whole statement.*) let select_stmt_lval_rw set mark ~rd ~wr ki ~eval kf = select_lval_rw set mark ~rd ~wr ~eval kf (Some ki) (** Add a selection of the declaration of [vi]. *) let select_decl_var set mark vi kf = let selection = SlicingSelect.select_decl_var kf vi mark in add_to_selection set selection let select_ZoneAnnot_pragmas set ~spare pragmas kf = let set = Cil_datatype.Stmt.Set.fold (* selection related to statement assign and //@ slice pragma stmt *) (fun ki' acc -> select_stmt acc ~spare ki' kf) pragmas.Db.Properties.Interp.To_zone.stmt set in Cil_datatype.Stmt.Set.fold (* selection related to //@ slice pragma ctrl/expr *) (fun ki' acc -> select_stmt_ctrl acc ~spare ki' kf) pragmas.Db.Properties.Interp.To_zone.ctrl set let select_ZoneAnnot_zones_decl_vars set mark (zones,decl_vars) kf = let set = Cil_datatype.Varinfo.Set.fold (fun vi acc -> select_decl_var acc mark vi kf) decl_vars.Db.Properties.Interp.To_zone.var set in let set = Cil_datatype.Logic_label.Set.fold (fun l acc -> let selection = SlicingSelect.select_label kf l mark in add_to_selection acc selection) decl_vars.Db.Properties.Interp.To_zone.lbl set in List.fold_right (fun z acc -> (* selection related to the parsing/compilation of the annotation *) select_stmt_zone acc mark z.Db.Properties.Interp.To_zone.zone ~before:z.Db.Properties.Interp.To_zone.before z.Db.Properties.Interp.To_zone.ki kf) zones set let get_or_raise (info_data_opt, info_decl) = match info_data_opt with | None -> (* TODO: maybe we can know how to use [info_decl] ? *) SlicingParameters.not_yet_implemented "%s" !Logic_interp.To_zone.not_yet_implemented | Some info_data -> info_data, info_decl (** Registered as a slicing selection function: Add selection of the annotations related to a statement. Note: add also a transparent selection on the whole statement. *) let select_stmt_pred set mark pred ki kf = let zones_decl_vars = !Db.Properties.Interp.To_zone.from_pred pred (!Db.Properties.Interp.To_zone.mk_ctx_stmt_annot kf ki) in select_ZoneAnnot_zones_decl_vars set mark (get_or_raise zones_decl_vars) kf (** Registered as a slicing selection function: Add selection of the annotations related to a statement. Note: add also a transparent selection on the whole statement. *) let select_stmt_term set mark term ki kf = let zones_decl_vars = !Db.Properties.Interp.To_zone.from_term term (!Db.Properties.Interp.To_zone.mk_ctx_stmt_annot kf ki) in select_ZoneAnnot_zones_decl_vars set mark (get_or_raise zones_decl_vars) kf (** Registered as a slicing selection function: Add selection of the annotations related to a statement. Note: add also a transparent selection on the whole statement. *) let select_stmt_annot set mark ~spare annot ki kf = let zones_decl_vars,pragmas = !Db.Properties.Interp.To_zone.from_stmt_annot annot (ki, kf) in let set = select_ZoneAnnot_pragmas set ~spare pragmas kf in select_ZoneAnnot_zones_decl_vars set mark (get_or_raise zones_decl_vars) kf (** Registered as a slicing selection function: Add selection of the annotations related to a statement. Note: add also a transparent selection on the whole statement. *) let select_stmt_annots set mark ~spare ~threat ~user_assert ~slicing_pragma ~loop_inv ~loop_var ki kf = let zones_decl_vars,pragmas = !Db.Properties.Interp.To_zone.from_stmt_annots (Some (!Db.Properties.Interp.To_zone.code_annot_filter ~threat ~user_assert ~slicing_pragma ~loop_inv ~loop_var ~others:false)) (ki, kf) in let set = select_ZoneAnnot_pragmas set ~spare pragmas kf in select_ZoneAnnot_zones_decl_vars set mark (get_or_raise zones_decl_vars) kf (** Registered as a slicing selection function: Add a selection of the annotations related to a function. *) let select_func_annots set mark ~spare ~threat ~user_assert ~slicing_pragma ~loop_inv ~loop_var kf = let zones_decl_vars,pragmas = !Db.Properties.Interp.To_zone.from_func_annots Kinstr.iter_from_func (Some (!Db.Properties.Interp.To_zone.code_annot_filter ~threat ~user_assert ~slicing_pragma ~loop_inv ~loop_var ~others:false)) kf in let set = select_ZoneAnnot_pragmas set ~spare pragmas kf in select_ZoneAnnot_zones_decl_vars set mark (get_or_raise zones_decl_vars) kf (** Registered as a slicing selection function: Add selection of function outputs. Variables of [lval_str] string are bounded relatively to the whole scope of the function [kf]. The interpretation of the address of the lvalues is done just before the execution of the first statement [kf]. The selection preserve the value of these lvalues before execution of the return statement. *) let select_func_lval set mark lval_str kf = if Datatype.String.Set.is_empty lval_str then set else let ki_scope_eval = Kernel_function.find_first_stmt kf in select_stmt_lval set mark lval_str ~before:false (Kernel_function.find_return kf) ~eval:ki_scope_eval kf (** Registered as a slicing selection function: Add a selection of data relative to read/write accesses. Interpret the [~rd] lvalues and the [~wr] lvalues from [~eval] statements of [kf]: - Variables of [lval_str] string are bounded relatively to the whole scope of the function [kf]. - The interpretation of the address of the lvalues is done just before the execution of the statement [~eval]. Find read/write accesses from the whole project if [ki_opt]=None. *) let select_func_lval_rw set mark ~rd ~wr ~eval kf = if Datatype.String.Set.is_empty rd && Datatype.String.Set.is_empty wr then set else select_lval_rw set mark ~rd ~wr ~eval kf None (** Registered as a slicing request function: Add selections to all concerned slices, as slicing requests and apply them, kernel function by kernel function. Note: - the function begins by applying the remaining internal requests. - the requests added for the last kernel function are not applied. *) let add_selection set = let add_selection prev selection = let kf = get_select_kf selection in let r = match prev with None -> apply_all_actions () ; Some (kf) | Some prev_kf -> if prev_kf == kf then prev else None and make_request slice = SlicingSelect.add_ff_selection slice selection and slices = let slices = SlicingProject.get_slices kf in if slices = [] then [SlicingProject.create_slice kf] else slices in List.iter make_request slices ; r in ignore (SlicingSelect.Selections.fold_selects_internal add_selection None set) (** Registered as a slicing request function: Add selections that will be applied to all the slices of the function (already existing or created later) Note: - the function begins by applying the remaining internal requests. - the requests added for the last kernel function are not applied. *) let add_persistent_selection set = (* Format.printf "@\nadd_persistent_selection@."; *) let add_selection prev selection = let kf = get_select_kf selection in let r = match prev with None -> apply_all_actions () ; Some (kf) | Some prev_kf -> if prev_kf == kf then prev else None in SlicingSelect.add_fi_selection selection; r in ignore (SlicingSelect.Selections.fold_selects_internal add_selection None set) (** Registered as a slicing request function: Add selections that will be applied to all the slices of the function (already existing or created later) Note: - the function begins by applying the remaining internal requests. - the requests added for the last kernel function are not applied. *) let add_persistent_cmdline () = SlicingParameters.feedback ~level:1 "interpreting slicing requests from the command line..."; begin try let selection = ref Cil_datatype.Varinfo.Map.empty in let top_mark = SlicingMarks.mk_user_mark ~addr:true ~ctrl:true ~data:true in Globals.Functions.iter (fun kf -> let add_selection opt select = if Kernel_function.Set.mem kf (opt ()) then selection := select !selection ~spare:false kf in add_selection SlicingParameters.Select.Return.get select_func_return; add_selection SlicingParameters.Select.Calls.get select_func_calls_to; add_selection SlicingParameters.Select.Pragma.get (fun s -> select_func_annots s top_mark ~threat:false ~user_assert:false ~slicing_pragma:true ~loop_inv:false ~loop_var:false); add_selection SlicingParameters.Select.Threat.get (fun s -> select_func_annots s top_mark ~threat:true ~user_assert:false ~slicing_pragma:false ~loop_inv:false ~loop_var:false); add_selection SlicingParameters.Select.Assert.get (fun s -> select_func_annots s top_mark ~threat:false ~user_assert:true ~slicing_pragma:false ~loop_inv:false ~loop_var:false); add_selection SlicingParameters.Select.LoopInv.get (fun s -> select_func_annots s top_mark ~threat:false ~user_assert:false ~slicing_pragma:false ~loop_inv:true ~loop_var:false); add_selection SlicingParameters.Select.LoopVar.get (fun s -> select_func_annots s top_mark ~threat:false ~user_assert:false ~slicing_pragma:false ~loop_inv:false ~loop_var:true); ); if not (Datatype.String.Set.is_empty (SlicingParameters.Select.Value.get ())) || not (Datatype.String.Set.is_empty (SlicingParameters.Select.RdAccess.get ())) || not (Datatype.String.Set.is_empty (SlicingParameters.Select.WrAccess.get ())) then begin (* fprintf fmt "@\n[-slice-value] Select %s at end of the entry point %a@." lval_str Db.pretty_name kf; *) let kf = fst (Globals.entry_point ()) in let ki_scope_eval = Kernel_function.find_first_stmt kf in selection := select_func_lval !selection top_mark (SlicingParameters.Select.Value.get ()) kf; selection := select_func_lval_rw !selection top_mark ~rd:(SlicingParameters.Select.RdAccess.get ()) ~wr:(SlicingParameters.Select.WrAccess.get ()) ~eval:ki_scope_eval kf ; SlicingParameters.Select.Value.clear () ; SlicingParameters.Select.RdAccess.clear () ; SlicingParameters.Select.WrAccess.clear () ; end; add_persistent_selection !selection; with Logic_interp.Error(_loc,msg) -> SlicingParameters.warning ~wkey:SlicingParameters.wkey_cmdline "%s. Slicing requests from the command line are ignored." msg end; SlicingParameters.feedback ~level:2 "done (interpreting slicing requests from the command line)." (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingCmds.mli��������������������������������������������0000666�0000000�0000000�00000011007�13571573400�020054� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* TODO: This .mli exists mainly to avoid problems with 'make -j'. This API is too vast and must be simplified. For example, functions should not receive variables as names (ie. strings) but directly as zones, possibly with a hint to the function that does to conversion. Also, most functions are slightly modified in Register, then registered in Db. This module and Register should be fused. *) type set = SlicingTypes.Fct_user_crit.t Cil_datatype.Varinfo.Map.t val get_select_kf : SlicingTypes.sl_select -> kernel_function val topologic_propagation : unit -> unit val select_pdg_nodes : set -> SlicingTypes.sl_mark -> PdgTypes.Node.t list -> kernel_function -> set val select_stmt : set -> spare:bool -> stmt -> kernel_function -> set val select_func_calls_to : set -> spare:bool -> Kernel_function.t -> set val select_func_calls_into : set -> spare:bool -> Kernel_function.t -> set val select_func_zone : set -> SlicingTypes.sl_mark -> Locations.Zone.t -> kernel_function -> set val select_func_return : set -> spare:bool -> Kernel_function.t -> set val select_stmt_ctrl : set -> spare:bool -> stmt -> kernel_function -> set val select_stmt_zone : set -> SlicingTypes.sl_mark -> Locations.Zone.t -> before:bool -> stmt -> kernel_function -> set val select_stmt_lval : set -> SlicingTypes.sl_mark -> Datatype.String.Set.t -> before:bool -> stmt -> eval:stmt -> kernel_function -> set val select_stmt_lval_rw : set -> SlicingTypes.sl_mark -> rd:Datatype.String.Set.t -> wr:Datatype.String.Set.t -> stmt -> eval:stmt -> Kernel_function.t -> set val select_stmt_pred : set -> SlicingTypes.sl_mark -> predicate -> stmt -> kernel_function -> set val select_stmt_term : set -> SlicingTypes.sl_mark -> term -> stmt -> kernel_function -> set val select_stmt_annot : set -> SlicingTypes.sl_mark -> spare:bool -> code_annotation -> stmt -> kernel_function -> set val select_stmt_annots : set -> SlicingTypes.sl_mark -> spare:bool -> threat:bool -> user_assert:bool -> slicing_pragma:bool -> loop_inv:bool -> loop_var:bool -> stmt -> kernel_function -> set val select_func_annots : set -> SlicingTypes.sl_mark -> spare:bool -> threat:bool -> user_assert:bool -> slicing_pragma:bool -> loop_inv:bool -> loop_var:bool -> kernel_function -> set val select_func_lval : set -> SlicingTypes.sl_mark -> Datatype.String.Set.t -> Kernel_function.t -> set val select_func_lval_rw : set -> SlicingTypes.sl_mark -> rd:Datatype.String.Set.t -> wr:Datatype.String.Set.t -> eval:stmt -> Kernel_function.t -> set val add_selection : set -> unit val add_persistent_selection : set -> unit val add_persistent_cmdline : unit -> unit val apply_all : propagate_to_callers:bool -> unit val apply_all_actions : unit -> unit val apply_next_action : unit -> unit �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingInternals.ml����������������������������������������0000666�0000000�0000000�00000022702�13571573400�020760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {2 Internals types} Internals type definitions should be hidden to the outside world, but it is not really possible to have abstract types since Slicing has to use Db.Slicing functions... *) open Cil_datatype (** {3 About options} *) (** associate a level to each function in order to control how it will be * specialized. This is only a hint used when the tool has to make a choice, * but it doesn't forbid to the user to do whatever he wants * (like building slices for a [DontSlice] function). *) type level_option = | DontSlice (** don't build slice for the function : ie. always call the source function. *) | DontSliceButComputeMarks (** don't slice the called functions, * but compute the marks for them *) | MinNbSlice (** try to use existing slices, create at most one *) | MaxNbSlice (** most precise slices (but merge slices with the same visibility, even if they don't have the same marks) *) (** {3 About function slice} *) (** Kinds of elementary marks. *) type mark = Cav of PdgTypes.Dpd.t | Spare let compare_mark m1 m2 = if m1 == m2 then 0 else match m1, m2 with | Spare, Spare -> 0 | Cav d1, Cav d2 -> PdgTypes.Dpd.compare d1 d2 | Cav _, Spare -> -1 | Spare, Cav _ -> 1 (** Each PDG element has 2 marks to deal with interprocedural propagation *) type pdg_mark = {m1 : mark ; m2 : mark } let pdg_mark_packed_descr = Structural_descr.p_abstract (* Ok: Dpd.t is in fact int *) let compare_pdg_mark p1 p2 = if p1 == p2 then 0 else let r = compare_mark p1.m1 p2.m1 in if r = 0 then compare_mark p1.m2 p2.m2 else r (** Type for all the informations related to any function, * even if we don't have its definition. *) type fct_info = { fi_kf : Cil_types.kernel_function; fi_def : Cil_types.fundec option; mutable fi_top : pdg_mark option; (** indicates if the function is marked top (=> src visible) *) mutable fi_level_option : level_option; (** level of specialisation for this function *) mutable fi_init_marks : ff_marks option; (** the marks that must be in every slices of that function *) mutable fi_slices : fct_slice list ; (** the list of the slices already computed for this function. *) mutable fi_next_ff_num : int; (** the number to assign to the next slice. *) mutable f_called_by : called_by; (** calls in slices that call source fct *) } and (** to represent where a function is called. *) called_by = (fct_slice * Cil_types.stmt) list and (** Function slice : created as soon as there is a criterion to compute it, even if the slice itself hasn't been computed yet. *) fct_slice = { ff_fct : fct_info ; ff_id : int ; mutable ff_marks : ff_marks; mutable ff_called_by : called_by } and (** [fct_id] is used to identify either a source function or a sliced one.*) fct_id = | FctSrc of fct_info (** source function *) | FctSliced of fct_slice (** sliced function *) and called_fct = | CallSrc of fct_info option (** call the source function (might be unknown if the call uses pointer) *) | CallSlice of fct_slice and (** information about a call in a slice which gives the function to call *) call_info = called_fct option and (** main part of a slice = mapping between the function elements * and information about them in the slice. *) marks_index = (pdg_mark, call_info) PdgIndex.FctIndex.t and ff_marks = PdgTypes.Pdg.t * marks_index and project = { functions : fct_info Varinfo.Hashtbl.t; mutable actions : criterion list; } and (** Slicing criterion at the application level. When applied, they are translated into [fct_criterion] *) appli_criterion = | CaGlobalData of Locations.Zone.t (** select all that is necessary to compute the given location. *) | CaCall of fct_info (** select all that is necessary to call the given function. * Its application generates requests to add persistent selection * to all the function callers. *) | CaOther and (** Base criterion for the functions. These are the only one that can really generate function slices. All the other criteria are translated in more basic ones. Note that to build such a base criterion, the PDG has to be already computed. *) fct_base_criterion = pdg_mark PdgMarks.select and (** Used to identify a location (zone) at a given program point. * The boolean tell if the point is before (true) or after the statement *) loc_point = Cil_types.stmt * Locations.Zone.t * bool (** List of pdg nodes to be selected (see {!fct_user_crit})*) (*type nodes = pdg_node list*) and (** [node_or_dpds] tells how we want to select nodes, * or some of their dependencies (see {!fct_user_crit}). *) node_or_dpds = CwNode | CwAddrDpds | CwDataDpds | CwCtrlDpds and (** Tells which marks we want to put in the slice of a function *) fct_user_crit = (* | CuNodes of (pdg_node list * (node_or_dpds * pdg_mark) list) list *) | CuSelect of pdg_mark PdgMarks.select | CuTop of pdg_mark (** the function has probably no PDG, but we nonetheless give a mark to propagate *) and (** kinds of actions that can be apply to a function *) fct_crit = | CcUserMark of fct_user_crit (** add marks to a slice *) | CcChooseCall of Cil_types.stmt (** have to choose what function to call here. *) | CcChangeCall of Cil_types.stmt * called_fct (** call the [called_fct] for the given call [Cil_types.stmt] *) | CcMissingOutputs of Cil_types.stmt * (pdg_mark PdgMarks.select) * bool (** this call is affected to a function that doesn't compute enough * outputs : we will have to choose between adding outputs to that slice, * or call another one. The boolean tells if the modifications would * change the visibility of some outputs. *) | CcMissingInputs of Cil_types.stmt * (pdg_mark PdgMarks.select) * bool (** the function calls a slice that has been modified : * and doesn't compute not enough inputs. * We will have to choose between adding marks to this function, * and call another slice. * The boolean tells if the modifications would * change the visibility of some inputs. *) | CcPropagate of (pdg_mark PdgMarks.select) (** simply propagate the given marks *) | CcExamineCalls of pdg_mark PdgMarks.info_called_outputs and (** Slicing criterion for a function. *) fct_criterion = { cf_fct : fct_id ; (** Identification of the {b RESULT} of this filter. * When it a a slice, it might be an existing slice that will be modified, * or a new one will be created during application. * When it is the source function, it means what the criterion has to be * applied on each existing slice, and stored into the initial marks of * the function. *) cf_info : fct_crit } and (** A slicing criterion is either an application level criterion, * or a function level one. *) criterion = CrAppli of appli_criterion | CrFct of fct_criterion (** {2 Internals values} *) (** {3 For the journalization of these internals types} *) let dummy_pdg_mark = {m1 = Spare ; m2 = Spare } (** The whole project. *) let dummy_project = { functions = Varinfo.Hashtbl.create 0; actions = [] } let dummy_fct_info = { fi_kf = Kernel_function.dummy () ; fi_def = None; fi_top = None; fi_level_option = DontSlice; fi_init_marks = None; fi_slices = [] ; fi_next_ff_num =0; f_called_by = []; } let dummy_marks_index = PdgIndex.FctIndex.create 0 let dummy_ff_marks = (PdgTypes.Pdg.top (Kernel_function.dummy ()), dummy_marks_index) let dummy_fct_slice = { ff_fct = dummy_fct_info ; ff_id = 0 ; ff_marks = dummy_ff_marks ; ff_called_by = [] } let dummy_fct_user_crit = CuTop dummy_pdg_mark (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingMacros.ml�������������������������������������������0000666�0000000�0000000�00000016525�13571573400�020253� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Slicing module public macros that should be used to avoid using the type * concrete definition from other modules. *) (**/**) open Cil_types (**/**) (** {2 Options} *) let str_level_option opt = match opt with | SlicingInternals.DontSlice -> "DontSlice" | SlicingInternals.DontSliceButComputeMarks -> "DontSliceButComputeMarks" | SlicingInternals.MinNbSlice -> "MinNbSlice" | SlicingInternals.MaxNbSlice -> "MaxNbSlice" let translate_num_to_slicing_level n = match n with | 0 -> SlicingInternals.DontSlice | 1 -> SlicingInternals.DontSliceButComputeMarks | 2 -> SlicingInternals.MinNbSlice | 3 -> SlicingInternals.MaxNbSlice | _ -> raise SlicingTypes.WrongSlicingLevel let get_default_level_option defined_function = if defined_function || (SlicingParameters.Mode.SliceUndef.get ()) then translate_num_to_slicing_level (SlicingParameters.Mode.Calls.get ()) else SlicingInternals.DontSlice (** {2 Getting [fct_info] and others } *) (** {4 getting [svar]} *) let fi_svar fi = Kernel_function.get_vi fi.SlicingInternals.fi_kf let ff_svar ff = fi_svar (ff.SlicingInternals.ff_fct) (** {4 getting [fct_info]} *) (** Get the fct_info if it exists or build a new fct_info. *) let get_kf_fi kf = let fct_var = Kernel_function.get_vi kf in let proj = SlicingState.get () in try Cil_datatype.Varinfo.Hashtbl.find proj.SlicingInternals.functions fct_var with Not_found -> let fi_def, is_def = match kf.fundec with | Declaration _ -> None, false | Definition _ when !Db.Value.use_spec_instead_of_definition kf -> None, false | Definition (def, _) -> Some def, true in let new_fi = { SlicingInternals.fi_kf = kf; SlicingInternals.fi_def = fi_def; SlicingInternals.fi_top = None; SlicingInternals.fi_level_option = get_default_level_option is_def; SlicingInternals.fi_init_marks = None ; SlicingInternals.fi_slices = [] ; SlicingInternals.fi_next_ff_num = 1; SlicingInternals.f_called_by = [] } in Cil_datatype.Varinfo.Hashtbl.add proj.SlicingInternals.functions fct_var new_fi; new_fi let fold_fi f acc = let proj = SlicingState.get () in Cil_datatype.Varinfo.Hashtbl.fold (fun _v fi acc -> f acc fi) proj.SlicingInternals.functions acc (** {4 getting num id} *) let get_ff_id ff = ff.SlicingInternals.ff_id (** {4 getting names} *) let fi_name fi = let svar = fi_svar fi in svar.Cil_types.vname (** get the name of the function corresponding to that slice. *) let ff_name ff = let fi = ff.SlicingInternals.ff_fct in let ff_id = get_ff_id ff in let fct_name = fi_name fi in (fct_name ^ "_slice_" ^ (string_of_int (ff_id))) let f_name f = match f with | SlicingInternals.FctSrc fct -> fi_name fct | SlicingInternals.FctSliced ff -> ff_name ff let ff_src_name ff = fi_name ff.SlicingInternals.ff_fct (** {4 getting [kernel_function]} *) let get_fi_kf fi = fi.SlicingInternals.fi_kf let get_ff_kf ff = let fi = ff.SlicingInternals.ff_fct in get_fi_kf fi let get_pdg_kf pdg = PdgTypes.Pdg.get_kf pdg (** {4 getting PDG} *) let get_fi_pdg fi = let kf = get_fi_kf fi in !Db.Pdg.get kf let get_ff_pdg ff = get_fi_pdg ff.SlicingInternals.ff_fct (** {4 getting the slicing level} *) let ff_slicing_level ff = ff.SlicingInternals.ff_fct.SlicingInternals.fi_level_option let change_fi_slicing_level fi slicing_level = fi.SlicingInternals.fi_level_option <- slicing_level (** @raise SlicingTypes.WrongSlicingLevel if [n] is not valid. * *) let change_slicing_level kf n = let slicing_level = translate_num_to_slicing_level n in let fi = get_kf_fi kf in (* build if if it doesn't exist *) change_fi_slicing_level fi slicing_level (** {2 functions and slices} *) let fi_slices fi = fi.SlicingInternals.fi_slices (** {4 Comparisons} *) let equal_fi fi1 fi2 = let v1 = fi_svar fi1 in let v2 = fi_svar fi2 in Cil_datatype.Varinfo.equal v1 v2 let equal_ff ff1 ff2 = (equal_fi ff1.SlicingInternals.ff_fct ff2.SlicingInternals.ff_fct) && ((get_ff_id ff1) = (get_ff_id ff2)) (** {2 Calls} *) let same_call c1 c2 = (c1.sid = c2.sid) let same_ff_call (f1,c1) (f2,c2) = equal_ff f1 f2 && same_call c1 c2 let is_call_stmt stmt = match stmt.skind with | Instr (Call _ | Local_init(_, ConsInit _,_)) -> true | _ -> false let get_called_kf call_stmt = match call_stmt.skind with | Instr (Call (_, funcexp,_,_)) -> let _funcexp_dpds, called_functions = !Db.Value.expr_to_kernel_function ~deps:None (Kstmt call_stmt) funcexp in (match Kernel_function.Hptset.contains_single_elt called_functions with | Some kf -> kf | _ -> raise SlicingTypes.PtrCallExpr) | Instr (Local_init(_, ConsInit (f, _, _), _)) -> Globals.Functions.get f | _ -> invalid_arg "Not a call statement !" let is_variadic kf = let varf = Kernel_function.get_vi kf in match varf.vtype with | TFun (_, _, is_variadic, _) -> is_variadic | _ -> assert false (** get the [fct_info] of the called function, if we know it *) let get_fi_call call = try let kf = get_called_kf call in if is_variadic kf then None else let fct_info = get_kf_fi kf in Some fct_info with SlicingTypes.PtrCallExpr -> None let is_src_fun_called kf = let fi = get_kf_fi kf in match fi.SlicingInternals.f_called_by with [] -> false | _ -> true let is_src_fun_visible kf = let is_fi_top fi = match fi.SlicingInternals.fi_top with None -> false | Some _ -> true in is_src_fun_called kf || is_fi_top (get_kf_fi kf) let fi_has_persistent_selection fi = (match fi.SlicingInternals.fi_init_marks with None -> false | _ -> true) let has_persistent_selection kf = let fi = get_kf_fi kf in fi_has_persistent_selection fi (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingMacros.mli������������������������������������������0000666�0000000�0000000�00000006213�13571573400�020415� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This .mli exists mainly to facilitate 'make -j'. A lot of the [get_] functions below should be inlined, as there is no good reason to treat those types as semi-private *) open SlicingInternals val str_level_option : level_option -> string val get_default_level_option : bool -> level_option val fi_svar : fct_info -> Cil_types.varinfo val ff_svar : fct_slice -> Cil_types.varinfo val get_kf_fi : Kernel_function.t -> fct_info val fold_fi : ('a -> fct_info -> 'a) -> 'a -> 'a val get_ff_id : fct_slice -> int val fi_name : fct_info -> string val ff_name : fct_slice -> string val f_name : fct_id -> string val ff_src_name : fct_slice -> string val get_fi_kf : fct_info -> Cil_types.kernel_function val get_ff_kf : fct_slice -> Cil_types.kernel_function val get_pdg_kf : PdgTypes.Pdg.t -> Kernel_function.t val get_fi_pdg : fct_info -> Db.Pdg.t val get_ff_pdg : fct_slice -> Db.Pdg.t val ff_slicing_level : fct_slice -> level_option val change_fi_slicing_level : fct_info -> level_option -> unit val change_slicing_level : Kernel_function.t -> int -> unit val fi_slices : fct_info -> fct_slice list val equal_fi : fct_info -> fct_info -> bool val equal_ff : fct_slice -> fct_slice -> bool val same_ff_call : fct_slice * Cil_types.stmt -> fct_slice * Cil_types.stmt -> bool val is_call_stmt : Cil_types.stmt -> bool val get_fi_call : Cil_types.stmt -> fct_info option val is_src_fun_called : Kernel_function.t -> bool val is_src_fun_visible : Kernel_function.t -> bool val fi_has_persistent_selection : fct_info -> bool val has_persistent_selection : Kernel_function.t -> bool �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingMarks.ml��������������������������������������������0000666�0000000�0000000�00000041116�13571573400�020076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Everything related with the marks. Mainly quite low level function. *) (**/**) let debug = false (**/**) (** a [Mark] is used to represent some information about the status of * a PDG element in a slice. *) module Mark : sig val bottom : SlicingInternals.mark val spare : SlicingInternals.mark val data : SlicingInternals.mark val ctrl : SlicingInternals.mark val addr : SlicingInternals.mark val mk_adc : bool -> bool -> bool -> SlicingInternals.mark val is_bottom : SlicingInternals.mark -> bool val is_top : SlicingInternals.mark -> bool val is_included : SlicingInternals.mark -> SlicingInternals.mark -> bool (** this operation has to be commutative. It is used to merge two slices into one. *) val merge : SlicingInternals.mark -> SlicingInternals.mark -> SlicingInternals.mark val inter : SlicingInternals.mark -> SlicingInternals.mark -> SlicingInternals.mark (** this operation add a new information to the old value. * @return (new_mark, is_new) where is_new=true if the new_mark is not included in the old one. *) val combine : old:SlicingInternals.mark -> SlicingInternals.mark -> bool * SlicingInternals.mark (** [minus m1 m2] provides the mark [m] that you have to merge with [m2] to * get at least [m1]. So : [m1 <= m U m2] * If [m1 <= m2] then [m = bot]. * *) val minus : SlicingInternals.mark -> SlicingInternals.mark -> SlicingInternals.mark val pretty : Format.formatter -> SlicingInternals.mark -> unit end = struct let spare = SlicingInternals.Spare (* Internal constructor *) let create_adc a d c = SlicingInternals.Cav (PdgTypes.Dpd.make ~a ~d ~c ()) let bottom = SlicingInternals.Cav PdgTypes.Dpd.bottom let top = SlicingInternals.Cav PdgTypes.Dpd.top let addr = create_adc true false false let data = create_adc false true false let ctrl = create_adc false false true let m_ad = create_adc true true false let m_ac = create_adc true false true let m_dc = create_adc false true true let create adc = match adc with | false, false, false -> bottom | true, false, false -> addr | false, true, false -> data | false, false, true -> ctrl | true, true, false -> m_ad | true, false, true -> m_ac | false, true, true -> m_dc | true, true, true -> top (* External constructor sharing same values *) let mk_adc a d c = create (a, d, c) let mk_mark dpd = create (PdgTypes.Dpd.adc_value dpd) let is_bottom m = (m = bottom) let is_top m = (m = top) let is_included m1 m2 = match m1,m2 with | SlicingInternals.Spare, SlicingInternals.Spare -> true | SlicingInternals.Spare, SlicingInternals.Cav _ -> not (is_bottom m2) | SlicingInternals.Cav _, SlicingInternals.Spare -> is_bottom m1 | SlicingInternals.Cav d1, SlicingInternals.Cav d2 -> PdgTypes.Dpd.is_included d1 d2 let merge m1 m2 = match m1,m2 with | SlicingInternals.Spare, SlicingInternals.Spare -> m1 | SlicingInternals.Spare, SlicingInternals.Cav _ -> if is_bottom m2 then m1 else m2 | SlicingInternals.Cav _, SlicingInternals.Spare -> if is_bottom m1 then m2 else m1 | SlicingInternals.Cav d1, SlicingInternals.Cav d2 -> mk_mark (PdgTypes.Dpd.combine d1 d2) let inter m1 m2 = if is_bottom m1 then m1 else if is_bottom m2 then m2 else (* m1 and m2 are not bottom => the result cannot be bottom *) match m1,m2 with | SlicingInternals.Spare, _ -> m1 | _, SlicingInternals.Spare -> m2 | SlicingInternals.Cav d1, SlicingInternals.Cav d2 -> let m = mk_mark (PdgTypes.Dpd.inter d1 d2) in if is_bottom m then spare else m let combine ~old m = match old, m with | SlicingInternals.Spare, SlicingInternals.Spare -> (false, old) | SlicingInternals.Cav old_d, SlicingInternals.Spare -> if PdgTypes.Dpd.is_bottom old_d then (true, m) else (false, old) | SlicingInternals.Spare, SlicingInternals.Cav new_d -> if PdgTypes.Dpd.is_bottom new_d then (false, old) else (true, m) | SlicingInternals.Cav old_d, SlicingInternals.Cav new_d -> let new_d = PdgTypes.Dpd.combine old_d new_d in if old_d = new_d then (false, old) else (true, mk_mark new_d) let minus m1 m2 = match m1,m2 with | SlicingInternals.Spare, SlicingInternals.Spare -> bottom | SlicingInternals.Spare, SlicingInternals.Cav d2 -> if PdgTypes.Dpd.is_bottom d2 then m1 else bottom | SlicingInternals.Cav _, SlicingInternals.Spare -> m1 (* even if [PdgTypes.Dpd.is_bottom d1] because m1 = bot *) | SlicingInternals.Cav d1, SlicingInternals.Cav d2 -> mk_mark (PdgTypes.Dpd.minus d1 d2) let pretty fmt m = match m with | SlicingInternals.Cav d -> PdgTypes.Dpd.pretty fmt d | SlicingInternals.Spare -> Format.fprintf fmt "[ S ]" end (** a [SlicingInternals.pdg_mark] is associated with each element of the PDG in a slice. * The first component gives the mark propagated from a user request, while * the second one is used to propagate informations to the called functions. *) let mk_m1 m1 = { SlicingInternals.m1 = m1 ; m2 = Mark.bottom } let mk_m2 m2 = { SlicingInternals.m1 = Mark.bottom ; m2 = m2} let bottom_mark = { SlicingInternals.m1 = Mark.bottom ; m2 = Mark.bottom } let user_mark m = Mark.merge m.SlicingInternals.m1 m.SlicingInternals.m2 let is_bottom_mark m = (Mark.is_bottom (user_mark m)) module MarkPair = struct let mk_m1_spare = mk_m1 Mark.spare let mk_gen_spare = mk_m2 Mark.spare let is_top m = (Mark.is_top m.SlicingInternals.m1) && (Mark.is_top m.SlicingInternals.m2) let is_ctrl m = (Mark.is_included Mark.ctrl (user_mark m)) let is_addr m = (Mark.is_included Mark.addr (user_mark m)) let is_data m = (Mark.is_included Mark.data (user_mark m)) let is_spare m = not (is_bottom_mark m) && not (is_ctrl m || is_addr m || is_data m) let compare = SlicingInternals.compare_pdg_mark let _is_included ma mb = Mark.is_included ma.SlicingInternals.m1 mb.SlicingInternals.m1 && Mark.is_included ma.SlicingInternals.m2 mb.SlicingInternals.m2 let pretty fmt m = Format.fprintf fmt "@[<hv><%a,@ %a>@]" Mark.pretty m.SlicingInternals.m1 Mark.pretty m.SlicingInternals.m2 let to_string m = Format.asprintf "%a" pretty m let minus ma mb = { SlicingInternals.m1 = Mark.minus ma.SlicingInternals.m1 mb.SlicingInternals.m1; m2 = Mark.minus ma.SlicingInternals.m2 mb.SlicingInternals.m2 } (** see {! Mark.merge} *) let merge ma mb = let m1 = Mark.merge ma.SlicingInternals.m1 mb.SlicingInternals.m1 in let m2 = Mark.merge ma.SlicingInternals.m2 mb.SlicingInternals.m2 in { SlicingInternals.m1 = m1 ; m2 = m2 } (** merge only ma_1 et mb_1, m_2 is always bottom *) let merge_user_marks ma mb = let m1 = Mark.merge ma.SlicingInternals.m1 mb.SlicingInternals.m1 in { SlicingInternals.m1 = m1 ; m2 = Mark.bottom } let rec merge_all marks = match marks with | [] -> bottom_mark | m :: [] -> m (* to avoid merging with bottom every time ! *) | m :: tl -> merge m (merge_all tl) let inter ma mb = let m1 = Mark.inter ma.SlicingInternals.m1 mb.SlicingInternals.m1 in let m2 = Mark.inter ma.SlicingInternals.m2 mb.SlicingInternals.m2 in { SlicingInternals.m1 = m1 ; m2 = m2 } let rec inter_all marks = match marks with | [] -> bottom_mark | m :: [] -> m | m :: tl -> inter m (inter_all tl) (** [combine ma mb] is used to add the [mb] to the [ma]. * @return two marks : the first one is the new mark (= merge), * and the second is the one to propagate. * Notice that if the mark to propagate is bottom, * it means that [mb] was included in [ma]. *) let combine ma mb = let combine_m ma mb = let is_new, mr = Mark.combine ma mb in let m_to_prop = if is_new then mr else Mark.bottom in mr, m_to_prop in let new_m1, prop1 = combine_m ma.SlicingInternals.m1 mb.SlicingInternals.m1 in let new_m2, prop2 = combine_m ma.SlicingInternals.m2 mb.SlicingInternals.m2 in { SlicingInternals.m1 = new_m1 ; m2 = new_m2 }, { SlicingInternals.m1 = prop1 ; m2 = prop2 } (** we want to know if the called function [g] with output marks * [m_out_called] compute enough things to be used in [f] call * with output marks [m_out_call]. * Remember the [mf1] marks propagates as [mg2] and the marks to add * can only be [m2] marks. * TODO : write this down in the specification * and check with Patrick if it is ok. * *) let missing_output ~call:m_out_call ~called:m_out_called = if debug then Format.printf "check_out : call=%a called=%a\n" pretty m_out_call pretty m_out_called; let mf1 = m_out_call.SlicingInternals.m1 in let mf2 = m_out_call.SlicingInternals.m2 in let mg1 = m_out_called.SlicingInternals.m1 in let mg2 = m_out_called.SlicingInternals.m2 in let needed_mg2 = (* we need (mf1 + mf2) for this out in the call *) Mark.merge mf1 mf2 in let min_mg2 = (* let remove from needed_mg2 what we have in mg1 *) Mark.minus needed_mg2 mg1 in if Mark.is_included min_mg2 mg2 then None else let m2 = mk_m2 min_mg2 in if debug then Format.printf "check_out missing output -> %a\n" pretty m2; (Some m2) (** tells if the caller ([f]) computes enough inputs for the callee ([g]). * Remember that [mg1] has to be propagated as [mf1], * but [mg2] has to be propagated as [mf2=spare] *) let missing_input ~call:m_in_call ~called:m_in_called = let mf1 = m_in_call.SlicingInternals.m1 in let mf2 = m_in_call.SlicingInternals.m2 in let mg1 = m_in_called.SlicingInternals.m1 in let mg2 = m_in_called.SlicingInternals.m2 in let new_mf1 = if Mark.is_included mg1 mf1 then Mark.bottom else mg1 in let new_mf2 = if (not (Mark.is_bottom mg2)) && (Mark.is_bottom mf2) then Mark.spare else Mark.bottom in let new_m = { SlicingInternals.m1 = new_mf1 ; m2 = new_mf2 } in if is_bottom_mark new_m then None else Some new_m end (** [SigMarks] works on the marks in function signatures. *) module SigMarks = struct open PdgIndex type t = SlicingInternals.pdg_mark Signature.t let pretty = Signature.pretty MarkPair.pretty let get_input_mark (sgn:t) n = Signature.find_input sgn n let get_in_ctrl_mark (sgn:t) = Signature.find_in_ctrl sgn let get_in_top_mark (sgn:t) = Signature.find_in_top sgn let get_all_input_marks (sgn:t) = Signature.fold_all_inputs (fun acc (k, m) -> (k, m)::acc) [] sgn let get_matching_input_marks (sgn:t) z = Signature.fold_all_inputs (fun acc (k, m) -> match k with | PdgIndex.Signature.InCtrl | PdgIndex.Signature.InNum _ -> (k, m) :: acc | PdgIndex.Signature.InImpl z' -> if Locations.Zone.intersects z z' then (k, m) :: acc else acc ) [] sgn exception Visible let raise_if_visible () (_, m) = if is_bottom_mark m then () else raise Visible let some_visible_out cm = try Signature.fold_all_outputs raise_if_visible () cm ; false with Visible -> true let is_topin_visible cm = try let m = get_in_top_mark cm in not (is_bottom_mark m) with Not_found -> false let ctrl_visible cm = try let ctrl_m = get_in_ctrl_mark cm in not (is_bottom_mark ctrl_m) with Not_found -> false let some_visible_in cm = try Signature.fold_num_inputs raise_if_visible () cm ; ctrl_visible cm with Visible -> true let merge_inputs_m1_mark cm = Signature.fold_all_inputs (fun acc (_, m) -> MarkPair.merge_user_marks acc m) bottom_mark cm (** @return an under-approximation of the mark for the given location. * If the location is not included in the union of the implicit inputs, * it returns bottom. * Else, it returns the intersection of the inputs that intersect the location. *) let get_input_loc_under_mark cm loc = if debug then Format.printf "get_input_loc_under_mark of %a" Locations.Zone.pretty loc; assert (not (Locations.Zone.equal Locations.Zone.bottom loc)); let do_in (marked_inputs, marks) (in_loc, m) = if is_bottom_mark m then (marked_inputs, []) else if Locations.Zone.intersects in_loc loc then let marked_inputs = Locations.Zone.link marked_inputs in_loc in let marks = m::marks in (marked_inputs, marks) else (marked_inputs, marks) in let marked_inputs = Locations.Zone.bottom in let marked_inputs, marks = Signature.fold_impl_inputs do_in (marked_inputs, []) cm in let m = if Locations.Zone.is_included loc marked_inputs then MarkPair.inter_all marks else bottom_mark in if debug then Format.printf "get_input_loc_under_mark : m = %a" MarkPair.pretty m; m let something_visible cm = some_visible_out cm || some_visible_in cm || ctrl_visible cm let get_marked_out_zone call_marks = let add (out0, out_zone) (out_key, m_out) = if is_bottom_mark m_out then (out0, out_zone) else match out_key with | PdgIndex.Signature.OutRet -> true, out_zone | PdgIndex.Signature.OutLoc z -> out0, Locations.Zone.join out_zone z in Signature.fold_all_outputs add (false, Locations.Zone.bottom) call_marks end (** The mark associated with a call stmt is composed of * marks for the call inputs (numbered form 1 to [max_in]) * and marks for the call outputs (numbered from 0 to [max_out] *) (** {2 Exported things} *) (** {3 on marks} *) let mk_gen_spare = MarkPair.mk_gen_spare let mk_user_spare = MarkPair.mk_m1_spare let mk_user_mark ~data ~addr ~ctrl = if addr || data || ctrl then mk_m1 (Mark.mk_adc addr data ctrl) else mk_user_spare let is_top_mark = MarkPair.is_top let is_spare_mark = MarkPair.is_spare let is_ctrl_mark = MarkPair.is_ctrl let is_addr_mark = MarkPair.is_addr let is_data_mark = MarkPair.is_data let merge_marks = MarkPair.merge_all let combine_marks = MarkPair.combine let inter_marks = MarkPair.inter_all let minus_marks = MarkPair.minus let compare_marks = MarkPair.compare let pretty_mark = MarkPair.pretty let mark_to_string = MarkPair.to_string let missing_input_mark = MarkPair.missing_input let missing_output_mark = MarkPair.missing_output (** {3 on signatures} *) type sig_marks = SigMarks.t let empty_sig = PdgIndex.Signature.empty let get_input_mark = SigMarks.get_input_mark let get_all_input_marks = SigMarks.get_all_input_marks let get_matching_input_marks = SigMarks.get_matching_input_marks let merge_inputs_m1_mark = SigMarks.merge_inputs_m1_mark let get_input_loc_under_mark = SigMarks.get_input_loc_under_mark (*let same_output_visibility = SigMarks.same_output_visibility*) let get_in_ctrl_mark = SigMarks.get_in_ctrl_mark let something_visible = SigMarks.something_visible let some_visible_out = SigMarks.some_visible_out let is_topin_visible = SigMarks.is_topin_visible let get_marked_out_zone = SigMarks.get_marked_out_zone let pretty_sig = SigMarks.pretty (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingMarks.mli�������������������������������������������0000666�0000000�0000000�00000006553�13571573400�020255� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open SlicingTypes val bottom_mark : sl_mark val mk_user_mark : data:bool -> addr:bool -> ctrl:bool -> sl_mark (** generated [spare] = the smallest visible mark *) val mk_gen_spare : sl_mark val mk_user_spare : sl_mark val is_bottom_mark : sl_mark -> bool val is_top_mark : sl_mark -> bool val is_spare_mark : sl_mark -> bool val is_ctrl_mark : sl_mark -> bool val is_addr_mark : sl_mark -> bool val is_data_mark : sl_mark -> bool val merge_marks : sl_mark list -> sl_mark val inter_marks : sl_mark list -> sl_mark (** [combine_marks] add a new information to the old value. * @return (new_mark, is_new) where [is_new=true] if the new mark is not included in the old one. *) val combine_marks : sl_mark -> sl_mark -> (sl_mark * sl_mark) val minus_marks : sl_mark -> sl_mark -> sl_mark val compare_marks : sl_mark -> sl_mark -> int val mark_to_string : sl_mark -> string val pretty_mark : Format.formatter -> sl_mark -> unit val missing_input_mark : call:sl_mark -> called:sl_mark -> sl_mark option val missing_output_mark : call:sl_mark -> called:sl_mark -> sl_mark option type sig_marks = sl_mark PdgIndex.Signature.t val empty_sig : sig_marks val get_input_mark : sig_marks -> int -> sl_mark val get_all_input_marks : sig_marks -> (PdgIndex.Signature.in_key * sl_mark) list val get_matching_input_marks : sig_marks -> Locations.Zone.t -> (PdgIndex.Signature.in_key * sl_mark) list val merge_inputs_m1_mark : sig_marks -> sl_mark val get_input_loc_under_mark : sig_marks -> Locations.Zone.t -> sl_mark val get_in_ctrl_mark : sig_marks -> sl_mark val something_visible : sig_marks -> bool val some_visible_out : sig_marks -> bool val is_topin_visible : sig_marks -> bool val get_marked_out_zone : sig_marks -> bool * Locations.Zone.t val pretty_sig : Format.formatter -> sig_marks -> unit �����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingParameters.ml���������������������������������������0000666�0000000�0000000�00000021216�13571573400�021123� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************* *) (** {2 Slicing options} *) (* ************************************************************************* *) include Plugin.Register (struct let name = "slicing" let shortname = "slicing" let help = "code slicer" end) module Select = struct let () = Parameter_customize.argument_may_be_fundecl () module Calls = Kernel_function_set (struct let option_name = "-slice-calls" let arg_name = "f1, ..., fn" let help = "select every calls to functions f1,...,fn, and all their effect" end) let () = Parameter_customize.argument_may_be_fundecl () module Return = Kernel_function_set (struct let option_name = "-slice-return" let arg_name = "f1, ..., fn" let help = "select the result (returned value) of functions f1,...,fn" end) let () = Parameter_customize.argument_may_be_fundecl () module Threat = Kernel_function_set (struct let option_name = "-slice-threat" let arg_name = "f1, ..., fn" let help = "select the threats of functions f1,...,fn" end) module Assert = Kernel_function_set (struct let option_name = "-slice-assert" let arg_name = "f1, ..., fn" let help = "select the assertions of functions f1,...,fn" end) module LoopInv = Kernel_function_set (struct let option_name = "-slice-loop-inv" let arg_name = "f1, ..., fn" let help = "select the loop invariants of functions f1,...,fn" end) module LoopVar = Kernel_function_set (struct let option_name = "-slice-loop-var" let arg_name = "f1, ..., fn" let help = "select the loop variants of functions f1,...,fn" end) module Pragma = Kernel_function_set (struct let option_name = "-slice-pragma" let arg_name = "f1, ..., fn" let help = "use the slicing pragmas in the code of functions f1,...,fn as \ slicing criteria:\n\ //@ slice pragma ctrl; to reach this control-flow point\n\ //@ slice pragma expr <expr_desc;> to preserve the value of an expression at \ this control-flow point\n\ //@ slice pragma stmt; to preserve the effect of the next statement" end) module RdAccess = String_set (struct let option_name = "-slice-rd" let arg_name = "v1, ..., vn" let help = "select the read accesses to left-values v1,...,vn \ (addresses are evaluated at the beginning of the function given as \ entry point)" end) module WrAccess = String_set (struct let option_name = "-slice-wr" let arg_name = "v1, ..., vn" let help = "select the write accesses to left-values v1,...,vn \ (addresses are evaluated at the beginning of the function given as\ entry point)" end) module Value = String_set (struct let option_name = "-slice-value" let arg_name = "v1, ..., vn" let help = "select the result of left-values v1,...,vn at the end of the \ function given as entry point (addresses are evaluated at the beginning of \ the function given as entry point)" end) end module Mode = struct module Callers = True(struct let option_name = "-slice-callers" let help = "propagate the slicing to the function callers" end) module Calls = Int (struct let option_name = "-slicing-level" let default = 2 let arg_name = "" let help = "set the default level of slicing used to propagate to \ the calls\n\ 0 : don't slice the called functions\n\ 1 : don't slice the called functions but propagate the marks anyway\n\ 2 : try to use existing slices, create at most one\n\ 3 : most precise slices\n\ note: this value (defaults to 2) is not used for calls to undefined \ functions\n\ except when '-slice-undef-functions' option is set" end) let () = Calls.set_range ~min:0 ~max:3 module SliceUndef = False(struct let option_name = "-slice-undef-functions" let help = "allow the use of the -slicing-level option for calls \ to undefined functions" end) module KeepAnnotations = False(struct let option_name = "-slicing-keep-annotations" let help = "keep annotations as long as the used variables are \ declared and the accessibility of the program point is preserved (even if the \ value of the data is not preserved)" end) end module ProjectName = String(struct let option_name = "-slicing-project-name" let arg_name = "ident" let help = "name of the slicing project (defaults to \"Slicing\").\ This name is used as basename when building the name of the exported project (see -slicing-exported-project-postfix option)" let default = "Slicing" end) module ExportedProjectPostfix = String(struct let option_name = "-slicing-exported-project-postfix" let arg_name = "postfix" let help = "postfix added to the slicing project name for building \ the name of the exported project (defaults to \" export\")" let default = " export" end) module Force = True(struct let option_name = "-slice-force" let help = "force slicing" end) module OptionModified = State_builder.Ref (Datatype.Bool) (struct let name = "Slicing.OptionModified" let dependencies = [] let default () = true end) let wkey_cmdline = register_warn_category "cmdline" let () = set_warn_status wkey_cmdline Log.Wabort let () = State_dependency_graph.add_codependencies ~onto:OptionModified.self [ Select.Calls.self; Select.Return.self; Select.Threat.self; Select.Assert.self; Select.LoopInv.self; Select.LoopVar.self; Select.Pragma.self; Select.RdAccess.self; Select.WrAccess.self; Select.Value.self; Mode.Callers.self; Mode.Calls.self; Mode.SliceUndef.self; Mode.KeepAnnotations.self ] let is_on () = (Force.get () || OptionModified.get ()) && (not (Select.Calls.is_empty () && Select.Return.is_empty () && Select.Threat.is_empty () && Select.Assert.is_empty () && Select.LoopInv.is_empty () && Select.LoopVar.is_empty () && Select.Pragma.is_empty () && Select.RdAccess.is_empty () && Select.WrAccess.is_empty () && Select.Value.is_empty ())) let set_off () = Force.off () ; OptionModified.set false let clear () = Force.clear () ; Select.Calls.clear () ; Select.Return.clear () ; Select.Threat.clear () ; Select.Assert.clear () ; Select.LoopInv.clear () ; Select.LoopVar.clear () ; Select.Pragma.clear () ; Select.RdAccess.clear () ; Select.WrAccess.clear () ; Select.Value.clear () ; OptionModified.clear () (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingParameters.mli��������������������������������������0000666�0000000�0000000�00000005275�13571573400�021303� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Slicing *) (* include Log.Messages *) include Plugin.S (* modules related to the command line options *) module Select : sig module Calls: Parameter_sig.Kernel_function_set module Return: Parameter_sig.Kernel_function_set module Threat: Parameter_sig.Kernel_function_set module Assert: Parameter_sig.Kernel_function_set module Pragma: Parameter_sig.Kernel_function_set module LoopInv: Parameter_sig.Kernel_function_set module LoopVar: Parameter_sig.Kernel_function_set module RdAccess: Parameter_sig.String_set module WrAccess: Parameter_sig.String_set module Value: Parameter_sig.String_set end module Mode : sig module Callers: Parameter_sig.Bool module Calls: Parameter_sig.Int module SliceUndef: Parameter_sig.Bool module KeepAnnotations: Parameter_sig.Bool end (** @since Carbon-20110201 *) module ProjectName: Parameter_sig.String (** @since Carbon-20110201 *) module ExportedProjectPostfix: Parameter_sig.String val is_on: unit -> bool val set_off: unit -> unit val clear: unit -> unit val wkey_cmdline: warn_category (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingProject.ml������������������������������������������0000666�0000000�0000000�00000034605�13571573400�020434� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Handle the project global object. *) (**/**) module T = SlicingInternals module M = SlicingMacros (**/**) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Managing the slices} *) let add_proj_actions actions = let proj = SlicingState.get () in proj.T.actions <- actions @ proj.T.actions (** Add a new slice for the function. It can be the case that it create actions * if the function has some persistent selection, that make function calls to * choose. * @raise SlicingTypes.NoPdg when the function has no PDG. * *) let create_slice kf = let ff, actions = Fct_slice.make_new_ff (M.get_kf_fi kf) true in add_proj_actions actions; ff (** Delete [ff_to_remove] if it is not called. * @raise T.CantRemoveCalledFf if it is. *) let remove_ff ff_to_remove = let rec remove ff_list ff_num = match ff_list with | [] -> raise Not_found | ff :: tail -> if ff.T.ff_id = ff_num then (Fct_slice.clear_ff ff; tail) else ff :: (remove tail ff_num) in let fi = ff_to_remove.T.ff_fct in let ff_num = ff_to_remove.T.ff_id in let new_ff_list = remove fi.T.fi_slices ff_num in fi.T.fi_slices <- new_ff_list let call_src_and_remove_all_ff fi = let do_call actions (ff_caller, call_id) = let new_actions = Fct_slice.apply_change_call ff_caller call_id (T.CallSrc (Some fi)) in new_actions @ actions in let do_ff actions ff = let calls = ff.SlicingInternals.ff_called_by in let actions = List.fold_left do_call actions calls in remove_ff ff; actions in List.fold_left do_ff [] fi.T.fi_slices let rec remove_uncalled_slices () = let kf_entry, _ = Globals.entry_point () in let entry_name = Kernel_function.get_name kf_entry in let check_ff changes ff = match ff.T.ff_called_by with [] -> remove_ff ff; true | _ -> changes in let check_fi changes fi = if (M.fi_name fi) <> entry_name then List.fold_left check_ff changes (M.fi_slices fi) else changes in let changes = M.fold_fi check_fi false in if changes then remove_uncalled_slices () else () (** Build a new slice [ff] which contains the marks of [ff1] and [ff2] * and generate everything that is needed to choose the calls in [ff]. * If [replace] also generate requests call [ff] instead of [ff1] and [ff2]. *) let merge_slices ff1 ff2 replace = let ff, ff_actions = Fct_slice.merge_slices ff1 ff2 in if replace then begin let add actions (caller, call) = let rq = SlicingActions.mk_crit_change_call caller call (T.CallSlice ff) in rq :: actions in let actions = List.fold_left add [] ff2.T.ff_called_by in let actions = List.fold_left add actions ff1.T.ff_called_by in add_proj_actions actions end; add_proj_actions ff_actions; ff let split_slice ff = let add (actions, slices) (caller, call) = let new_ff = Fct_slice.copy_slice ff in let rq = SlicingActions.mk_crit_change_call caller call (T.CallSlice new_ff) in rq::actions, new_ff::slices in let calls = List.tl ff.T.ff_called_by in (* keep ff for the first call *) let actions, slices = List.fold_left add ([], [ff]) calls in add_proj_actions actions; slices (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Getting information } *) let get_slices kf = M.fi_slices (M.get_kf_fi kf) let get_slice_callers ff = List.map (fun (ff, _) -> ff) ff.T.ff_called_by (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Adding requests } *) let add_filter filter = let proj = SlicingState.get () in proj.T.actions <- filter :: proj.T.actions (* let add_fct_filter proj f_id criterion = let ff_res = match f_id with | T.FctSrc fi -> Fct_slice.make_new_ff fi | T.FctSliced ff -> ff in let filter = SlicingActions.mk_ff_user_crit ff_res criterion in let _ = add_filter proj filter in ff_res *) (** Add an action to the action list to filter the function [fct_id] with the given criterion. The filter gives a name to the result of the filter which is a new slice if the function to filter is the source one, or the given slice otherwise. *) let add_fct_src_filter fi to_select = match to_select with (* T.CuSelect [] : don't ignore empty selection because the input control node has to be selected anyway... *) | T.CuSelect select -> let filter = SlicingActions.mk_crit_fct_user_select fi select in add_filter filter | T.CuTop m -> let filter = SlicingActions.mk_crit_fct_top fi m in add_filter filter (* let add_fct_src_filters proj fi actions = List.iter (fun a -> ignore (add_fct_src_filter proj fi a)) actions *) let add_fct_ff_filter ff to_select = match to_select with | T.CuSelect [] -> SlicingParameters.debug ~level:1 "[SlicingProject.add_fct_ff_filter] (ignored empty selection)" | T.CuSelect select -> let filter = SlicingActions.mk_ff_user_select ff select in add_filter filter | T.CuTop _ -> assert false (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Print} *) let print_project fmt = let get_slices var_fct = let kf = Globals.Functions.get var_fct in let fct_info = M.get_kf_fi kf in M.fi_slices fct_info in let print glob = match glob with | Cil_types.GFun (func, _) -> (* function definition *) let slices = get_slices func.Cil_types.svar in List.iter (PrintSlice.print_marked_ff fmt) slices (* TODO see if we have to print the original function *) | _ -> PrintSlice.print_original_glob fmt glob in let source = Ast.get () in let global_decls = source.Cil_types.globals in List.iter print global_decls let print_proj_worklist fmt = let proj = SlicingState.get () in Format.fprintf fmt "Slicing project worklist [%s] =@\n%a@.@." (Project.get_name (Project.current ())) SlicingActions.print_list_crit proj.T.actions let print_project_and_worklist fmt = print_project fmt; print_proj_worklist fmt let pretty_slice fmt ff = PrintSlice.print_marked_ff fmt ff; Format.pp_print_newline fmt () (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Managing (and applying) requests} *) (** apply the given criterion and returns the list of new criteria to add to the project worklist. *) let apply_fct_crit ff to_select = let actions = Fct_slice.apply_add_marks ff to_select in actions let apply_appli_crit appli_crit = match appli_crit with | T.CaCall fi_to_call -> let kf_to_call = M.get_fi_kf fi_to_call in let add_actions actions (kf_caller,_) = let fi_caller = M.get_kf_fi kf_caller in let mark = SlicingMarks.mk_user_spare in let action = SlicingActions.mk_crit_mark_calls fi_caller kf_to_call mark in action :: actions in List.fold_left add_actions [] (!Db.Value.callers kf_to_call) | _ -> SlicingParameters.not_yet_implemented "This slicing criterion on application" (** Add persistent the marks [node_marks] in [fi] and also add the marks * to existing slices if any. * If the propagation is ON, some actions are generated to propagate the * persistent marks to the callers, and other actions are generated to * make all the calls to [fi] visible. * If there is no slice for [fi] we create a new one * if it is the original request. * It will be automatically created with the persistent marks. * If it is a propagation, no need to create a new slice * because it will be created when the call will be selected anyway. * *) let add_persistent_marks fi node_marks orig propagate actions = let new_fi_marks, actions = Fct_slice.add_marks_to_fi fi node_marks propagate actions in let actions = match M.fi_slices fi with | [] -> (* no slice *) let actions = if orig then let _ff, new_actions = Fct_slice.make_new_ff fi true in (* TODO catch NoPdg and mark fi as Top *) new_actions @ actions else actions in actions | slices -> let add_filter acc ff = let a = SlicingActions.mk_ff_user_select ff node_marks in a::acc in List.fold_left add_filter actions slices in let actions = if propagate && new_fi_marks then let a = SlicingActions.mk_appli_select_calls fi in actions @ [a] else actions in actions let apply_fct_action fct_crit = match fct_crit.T.cf_fct with | T.FctSliced ff -> let _ = M.get_ff_pdg ff in let new_filters = match fct_crit.T.cf_info with | T.CcUserMark (T.CuSelect []) -> SlicingParameters.debug ~level:1 "[apply_fct_action] ignore empty selection on existing slice"; [] | T.CcUserMark (T.CuSelect crit) -> apply_fct_crit ff crit | T.CcUserMark (T.CuTop _) -> assert false (* impossible on ff ! *) | T.CcChangeCall (call, f) -> Fct_slice.apply_change_call ff call f | T.CcChooseCall call -> Fct_slice.apply_choose_call ff call | T.CcMissingInputs (call, input_marks, more_inputs) -> Fct_slice.apply_missing_inputs ff call (input_marks, more_inputs) | T.CcMissingOutputs (call, output_marks, more_outputs) -> Fct_slice.apply_missing_outputs ff call output_marks more_outputs | T.CcPropagate _ -> assert false (* not for ff at the moment *) | T.CcExamineCalls marks -> Fct_slice.apply_examine_calls ff marks in SlicingParameters.debug ~level:4 "[slicingProject.apply_fct_action] result =@\n%a" PrintSlice.print_marked_ff ff; new_filters | T.FctSrc fi -> (* the marks have to be added to all slices *) let propagate = SlicingParameters.Mode.Callers.get () in match fct_crit.T.cf_info with | T.CcUserMark (T.CuSelect to_select) -> add_persistent_marks fi to_select true propagate [] | T.CcUserMark (T.CuTop m) -> SlicingParameters.result ~level:1 "unable to slice %s (-> TOP)" (M.fi_name fi); let filters = call_src_and_remove_all_ff fi in Fct_slice.add_top_mark_to_fi fi m propagate filters | T.CcPropagate [] -> SlicingParameters.debug ~level:1 "[apply_fct_action] nothing to propagate"; [] | T.CcPropagate node_marks -> add_persistent_marks fi node_marks false propagate [] | T.CcExamineCalls _ | _ -> SlicingParameters.not_yet_implemented "This slicing criterion on source function" (** apply [filter] and return a list of generated filters *) let apply_action filter = SlicingParameters.debug ~level:1 "[SlicingProject.apply_action] : %a" SlicingActions.print_crit filter; let new_filters = try match filter with | T.CrFct fct_crit -> begin try (apply_fct_action fct_crit) with PdgTypes.Pdg.Bottom -> SlicingParameters.debug ~level:1 " -> action ABORTED (PDG is bottom)" ; [] end | T.CrAppli appli_crit -> apply_appli_crit appli_crit with Not_found -> (* catch unprocessed Not_found here *) assert false in SlicingParameters.debug ~level:1 " -> %d generated filters : %a@." (List.length new_filters) SlicingActions.print_list_crit new_filters; new_filters let get_next_filter () = let proj = SlicingState.get () in match proj.T.actions with | [] -> SlicingParameters.debug ~level:2 "[SlicingProject.get_next_filter] No more filter"; raise Not_found | f :: tail -> proj.T.actions <- tail; f let apply_next_action () = SlicingParameters.debug ~level:2 "[SlicingProject.apply_next_action]"; let proj = SlicingState.get () in let filter = get_next_filter () in let new_filters = apply_action filter in proj.T.actions <- new_filters @ proj.T.actions let is_request_empty () = let proj = SlicingState.get () in proj.T.actions = [] let apply_all_actions () = let proj = SlicingState.get () in let nb_actions = List.length proj.T.actions in let rec apply actions = match actions with [] -> () | a::actions -> SlicingParameters.feedback ~level:2 "applying sub action..."; let new_filters = apply_action a in apply new_filters; apply actions in SlicingParameters.feedback ~level:1 "applying %d actions..." nb_actions; let rec apply_user n = try let a = get_next_filter () in SlicingParameters.feedback ~level:1 "applying actions: %d/%d..." n nb_actions; let new_filters = apply_action a in apply new_filters; apply_user (n+1) with Not_found -> if nb_actions > 0 then SlicingParameters.feedback ~level:2 "done (applying %d actions." nb_actions in apply_user 1 (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingProject.mli�����������������������������������������0000666�0000000�0000000�00000005050�13571573400�020575� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* TODO: This .mli exists mainly to avoid problems with 'make -j'. Most of those functions are only exported to be registered in Register, and this should be done here instead. *) open SlicingInternals val create_slice : Kernel_function.t -> fct_slice val remove_ff : fct_slice -> unit val remove_uncalled_slices : unit -> unit val merge_slices : fct_slice -> fct_slice -> bool -> fct_slice val split_slice : fct_slice -> fct_slice list val get_slices : Kernel_function.t -> fct_slice list val get_slice_callers : fct_slice -> fct_slice list val add_filter : criterion -> unit val add_fct_src_filter : fct_info -> fct_user_crit -> unit val add_fct_ff_filter : fct_slice -> fct_user_crit -> unit val print_proj_worklist : Format.formatter -> unit val print_project_and_worklist : Format.formatter -> unit val pretty_slice : Format.formatter -> fct_slice -> unit val apply_next_action : unit -> unit val is_request_empty : unit -> bool val apply_all_actions : unit -> unit ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingSelect.ml�������������������������������������������0000666�0000000�0000000�00000043767�13571573400�020256� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype (* ---------------------------------------------------------------------- *) (** {1 For internal use} *) let check_call stmt is_call = let err = match stmt.skind with | Instr (Call _ | Local_init(_, ConsInit _,_)) -> not is_call | _ -> is_call in if err then let str = if is_call then "not" else "" in let msg = "This statement is "^str^" a call" in raise (Invalid_argument msg) else stmt let print_select fmt db_select = let db_fvar, select = db_select in Format.fprintf fmt "In %a : %a" Varinfo.pretty db_fvar SlicingActions.print_f_crit select let get_select_kf (fvar, _select) = Globals.Functions.get fvar let check_db_select fvar db_select = let db_fvar, select = db_select in if not (Cil_datatype.Varinfo.equal db_fvar fvar) then begin SlicingParameters.debug "slice name = %s <> select = %a@." (fvar.vname) print_select db_select ; raise (Invalid_argument "This selection doesn't belong to the given function"); end; fvar, select let empty_db_select kf = (Kernel_function.get_vi kf, SlicingInternals.CuSelect []) let top_db_select kf m = (Kernel_function.get_vi kf, SlicingInternals.CuTop m) let check_kf_db_select kf = check_db_select (Kernel_function.get_vi kf) let _check_fi_db_select fi = check_db_select (SlicingMacros.fi_svar fi) let check_ff_db_select ff = check_db_select (SlicingMacros.ff_svar ff) let bottom_msg kf = SlicingParameters.feedback "bottom PDG for function '%s': ignore selection" (Kernel_function.get_name kf) let basic_add_select kf select nodes ?(undef) nd_marks = let fvar, sel = check_kf_db_select kf select in match sel with | SlicingInternals.CuTop _ -> select | SlicingInternals.CuSelect sel -> let pdg = !Db.Pdg.get kf in let nodes = List.map (fun n -> (n, None) (*TODO: add z_part ? *)) nodes in (* let nd_marks = SlicingActions.build_node_and_dpds_selection mark in *) (* let nd_marks = SlicingActions.build_simple_node_selection mark in *) let crit = [(nodes, nd_marks)] in let sel = SlicingActions.translate_crit_to_select pdg ~to_select:sel crit in let sel = match undef with None -> sel | Some (undef, mark) -> PdgMarks.add_undef_in_to_select sel undef mark in let sel = SlicingInternals.CuSelect sel in (fvar, sel) let select_pdg_nodes kf ?(select=empty_db_select kf) nodes mark = SlicingParameters.debug ~level:1 "[Register.select_pdg_nodes]" ; let nd_marks = SlicingActions.build_node_and_dpds_selection mark in try basic_add_select kf select nodes nd_marks with Db.Pdg.Top | Db.Pdg.Bottom -> assert false (* if we have node, we must have a pdg somewhere ! *) let mk_select pdg sel nodes undef mark = let nd_marks = SlicingActions.build_simple_node_selection mark in let crit = [(nodes, nd_marks)] in let sel = SlicingActions.translate_crit_to_select pdg ~to_select:sel crit in let sel = PdgMarks.add_undef_in_to_select sel undef mark in let sel = SlicingInternals.CuSelect sel in sel let select_stmt_zone kf ?(select=empty_db_select kf) stmt ~before loc mark = SlicingParameters.debug ~level:1 "[Register.select_stmt_zone] %a %s stmt %d (m=%a)" Locations.Zone.pretty loc (if before then "before" else "after") stmt.sid SlicingMarks.pretty_mark mark; if not (Db.Value.is_reachable_stmt stmt) then begin SlicingParameters.feedback "@[Nothing to select for @[%a@]@ %s unreachable stmt of %a@]" Locations.Zone.pretty loc (if before then "before" else "after") Kernel_function.pretty kf; select end else let fvar, sel = check_kf_db_select kf select in match sel with | SlicingInternals.CuTop _ -> select | SlicingInternals.CuSelect sel -> try let pdg = !Db.Pdg.get kf in let nodes, undef = !Db.Pdg.find_location_nodes_at_stmt pdg stmt before loc in let sel = mk_select pdg sel nodes undef mark in (fvar, sel) with | Not_found -> (* stmt probably unreachable *) SlicingParameters.feedback "@[Nothing to select for @[%a@]@ %s required stmt in %a@]" Locations.Zone.pretty loc (if before then "before" else "after") Kernel_function.pretty kf; SlicingParameters.debug "@[Nothing to select for @[%a@]@ %s stmt %d in %a@]" Locations.Zone.pretty loc (if before then "before" else "after") stmt.sid Kernel_function.pretty kf; select | Db.Pdg.Top -> top_db_select kf mark | Db.Pdg.Bottom -> bottom_msg kf; select (** this one is similar to [select_stmt_zone] with the return statement * when the function is defined, but it can also be used for undefined functions. *) let select_in_out_zone ~at_end ~use_undef kf select loc mark = SlicingParameters.debug "[Register.select_in_out_zone] select zone %a (m=%a) at %s of %a" Locations.Zone.pretty loc SlicingMarks.pretty_mark mark (if at_end then "end" else "begin") Kernel_function.pretty kf; let fvar, sel = check_kf_db_select kf select in match sel with | SlicingInternals.CuTop _ -> select | SlicingInternals.CuSelect sel -> try let pdg = !Db.Pdg.get kf in let find = if at_end then !Db.Pdg.find_location_nodes_at_end else !Db.Pdg.find_location_nodes_at_begin in let nodes, undef = find pdg loc in let undef = if use_undef then undef else None in let sel = mk_select pdg sel nodes undef mark in (fvar, sel) with | Not_found -> (* in or out unreachable ? *) SlicingParameters.feedback "@[Nothing to select for zone %a (m=%a) at %s of %a@]" Locations.Zone.pretty loc SlicingMarks.pretty_mark mark (if at_end then "end" else "begin") Kernel_function.pretty kf; select | Db.Pdg.Top -> top_db_select kf mark | Db.Pdg.Bottom -> bottom_msg kf; select let select_zone_at_end kf ?(select=empty_db_select kf) loc mark = select_in_out_zone ~at_end:true ~use_undef:true kf select loc mark let select_modified_output_zone kf ?(select=empty_db_select kf) loc mark = select_in_out_zone ~at_end:true ~use_undef:false kf select loc mark let select_zone_at_entry kf ?(select=empty_db_select kf) loc mark = select_in_out_zone ~at_end:false ~use_undef:true kf select loc mark let stmt_nodes_to_select pdg stmt = try let stmt_nodes = !Db.Pdg.find_stmt_and_blocks_nodes pdg stmt in SlicingParameters.debug ~level:2 "[Register.stmt_nodes_to_select] results on stmt %d (%a)" stmt.sid (fun fmt l -> List.iter (!Db.Pdg.pretty_node true fmt) l) stmt_nodes; stmt_nodes with Not_found -> SlicingParameters.debug ~level:2 "[Register.stmt_nodes_to_select] no results for stmt %d, probably unreachable" stmt.sid; [] let select_stmt_computation kf ?(select=empty_db_select kf) stmt mark = SlicingParameters.debug ~level:1 "[Register.select_stmt_computation] on stmt %d" stmt.sid; if not (Db.Value.is_reachable_stmt stmt) then begin SlicingParameters.feedback "@[Nothing to select for an unreachable stmt of %a@]" Kernel_function.pretty kf; select end else try let pdg = !Db.Pdg.get kf in let stmt_nodes = stmt_nodes_to_select pdg stmt in let nd_marks = SlicingActions.build_node_and_dpds_selection mark in basic_add_select kf select stmt_nodes nd_marks with Db.Pdg.Top -> top_db_select kf mark | Db.Pdg.Bottom -> bottom_msg kf; select let select_label kf ?(select=empty_db_select kf) label mark = SlicingParameters.debug ~level:1 "[Register.select_label] on label " (* Logic_label.pretty label *); try let pdg = !Db.Pdg.get kf in let nodes = let add_label_nodes l acc = match l with | StmtLabel stmt -> let add acc l = try !Db.Pdg.find_label_node pdg !stmt l :: acc with Not_found -> acc in List.fold_left add acc (!stmt).labels | FormalLabel _ | BuiltinLabel _ -> acc in (* Logic_label.Set.fold add_label_nodes labels [] *) add_label_nodes label [] in let nd_marks = SlicingActions.build_node_and_dpds_selection mark in basic_add_select kf select nodes nd_marks with Db.Pdg.Top -> top_db_select kf mark | Db.Pdg.Bottom -> bottom_msg kf; select (** marking a call node means that a [choose_call] will have to decide that to * call according to the slicing-level, but anyway, the call will be visible. *) let select_minimal_call kf ?(select=empty_db_select kf) stmt m = SlicingParameters.debug ~level:1 "[Register.select_minimal_call]"; try let pdg = !Db.Pdg.get kf in let call = check_call stmt true in let call_node = !Db.Pdg.find_call_ctrl_node pdg call in let nd_marks = SlicingActions.build_simple_node_selection m in basic_add_select kf select [call_node] nd_marks with Db.Pdg.Top -> top_db_select kf m | Db.Pdg.Bottom -> bottom_msg kf; select let select_stmt_ctrl kf ?(select=empty_db_select kf) stmt = SlicingParameters.debug ~level:1 "[Register.select_stmt_ctrl] of sid:%d" stmt.sid; let mark = SlicingMarks.mk_user_mark ~ctrl:true ~data:false ~addr:false in try let pdg = !Db.Pdg.get kf in let stmt_nodes = !Db.Pdg.find_simple_stmt_nodes pdg stmt in let nd_marks = SlicingActions.build_ctrl_dpds_selection mark in basic_add_select kf select stmt_nodes nd_marks with Db.Pdg.Top -> top_db_select kf mark | Db.Pdg.Bottom -> bottom_msg kf; empty_db_select kf let select_entry_point kf ?(select=empty_db_select kf) mark = SlicingParameters.debug ~level:1 "[Register.select_entry_point] of %a" Kernel_function.pretty kf; try let pdg = !Db.Pdg.get kf in let node = !Db.Pdg.find_entry_point_node pdg in let nd_marks = SlicingActions.build_simple_node_selection mark in basic_add_select kf select [node] nd_marks with Db.Pdg.Top -> top_db_select kf mark | Db.Pdg.Bottom -> bottom_msg kf; empty_db_select kf let select_return kf ?(select=empty_db_select kf) mark = SlicingParameters.debug ~level:1 "[Register.select_return] of %a" Kernel_function.pretty kf; try let pdg = !Db.Pdg.get kf in let node = !Db.Pdg.find_ret_output_node pdg in let nd_marks = SlicingActions.build_simple_node_selection mark in basic_add_select kf select [node] nd_marks with | Not_found -> (* unreachable ? *) SlicingParameters.feedback "@[Nothing to select for return stmt of %a@]" Kernel_function.pretty kf; select | Db.Pdg.Top -> top_db_select kf mark | Db.Pdg.Bottom -> bottom_msg kf; empty_db_select kf let select_decl_var kf ?(select=empty_db_select kf) vi mark = SlicingParameters.debug ~level:1 "[Register.select_decl_var] of %s in %a@." vi.Cil_types.vname Kernel_function.pretty kf; if vi.Cil_types.vglob (* no slicing request on globals *) then select else try let pdg = !Db.Pdg.get kf in let node = !Db.Pdg.find_decl_var_node pdg vi in let nd_marks = SlicingActions.build_simple_node_selection mark in basic_add_select kf select [node] nd_marks with | Not_found -> SlicingParameters.feedback "@[Nothing to select for %s declarationin %a@]" vi.Cil_types.vname Kernel_function.pretty kf; select | Db.Pdg.Top -> top_db_select kf mark | Db.Pdg.Bottom -> bottom_msg kf; empty_db_select kf let merge_select select1 select2 = let select = match select1, select2 with | SlicingInternals.CuTop m, _ | _, SlicingInternals.CuTop m -> SlicingInternals.CuTop m | SlicingInternals.CuSelect select1, SlicingInternals.CuSelect select2 -> (* TODO : we can probably do better...*) SlicingInternals.CuSelect (select1 @ select2) in select let merge_db_select db_select1 db_select2 = let fvar, select1 = db_select1 in let _, select2 = check_db_select fvar db_select2 in let select = merge_select select1 select2 in (fvar, select) module Selections = struct let add_to_selects db_select set = let vf, select = db_select in let select = try merge_select (Cil_datatype.Varinfo.Map.find vf set) select with Not_found -> select in Cil_datatype.Varinfo.Map.add vf select set let iter_selects_internal f set = Cil_datatype.Varinfo.Map.iter (fun v sel -> f (v, sel)) set let fold_selects_internal f acc selections = let r = ref acc in let dof select = r := f !r select in iter_selects_internal dof selections; !r end let add_crit_ff_change_call ff_caller call f_to_call = let crit = SlicingActions.mk_crit_change_call ff_caller call f_to_call in SlicingProject.add_filter crit (** change the call to call the given slice. * This is a user request, so it might be the case that * the new function doesn't compute enough outputs : * in that case, add outputs first. *) let call_ff_in_caller ~caller ~to_call = let kf_caller = SlicingMacros.get_ff_kf caller in let kf_to_call = SlicingMacros.get_ff_kf to_call in let call_stmts = !Db.Pdg.find_call_stmts ~caller:kf_caller kf_to_call in let ff_to_call = SlicingInternals.CallSlice to_call in let add_change_call stmt = add_crit_ff_change_call caller stmt ff_to_call ; match Fct_slice.check_outputs_before_change_call caller stmt to_call with | [] -> () | [c] -> SlicingProject.add_filter c | _ -> assert false in List.iter add_change_call call_stmts let call_fsrc_in_caller ~caller ~to_call = let kf_caller = SlicingMacros.get_ff_kf caller in let fi_to_call = SlicingMacros.get_kf_fi to_call in let kf_to_call = SlicingMacros.get_fi_kf fi_to_call in let call_stmts = !Db.Pdg.find_call_stmts ~caller:kf_caller kf_to_call in let add_change_call stmt = add_crit_ff_change_call caller stmt (SlicingInternals.CallSrc (Some fi_to_call)) in List.iter add_change_call call_stmts let call_min_f_in_caller ~caller ~to_call = let kf_caller = SlicingMacros.get_ff_kf caller in let pdg = SlicingMacros.get_ff_pdg caller in let call_stmts = !Db.Pdg.find_call_stmts ~caller:kf_caller to_call in let call_nodes = List.map (fun call -> (!Db.Pdg.find_call_ctrl_node pdg call),None) call_stmts in let m = SlicingMarks.mk_user_spare in let nd_marks = SlicingActions.build_simple_node_selection m in let select = SlicingActions.translate_crit_to_select pdg [(call_nodes, nd_marks)] in SlicingProject.add_fct_ff_filter caller (SlicingInternals.CuSelect select) let is_already_selected ff db_select = let _, select = check_ff_db_select ff db_select in match select with | SlicingInternals.CuTop _ -> assert false | SlicingInternals.CuSelect to_select -> (* let pdg = !Db.Pdg.get (Globals.Functions.get fvar) in *) let new_marks = Fct_slice.filter_already_in ff to_select in let ok = if new_marks = [] then true else false in if ok then SlicingParameters.debug ~level:1 "[Api.is_already_selected] %a ?\t--> yes" print_select db_select else SlicingParameters.debug ~level:1 "[Api.is_already_selected] %a ?\t--> no (missing %a)" print_select db_select SlicingActions.print_sel_marks_list new_marks; ok let add_ff_selection ff db_select = SlicingParameters.debug ~level:1 "[Api.add_ff_selection] %a to %s" print_select db_select (SlicingMacros.ff_name ff); let _, select = check_ff_db_select ff db_select in SlicingProject.add_fct_ff_filter ff select (** add a persistent selection to the function. * This might change its slicing level in order to call slices later on. *) let add_fi_selection db_select = SlicingParameters.debug ~level:1 "[Api.add_fi_selection] %a" print_select db_select; let kf = get_select_kf db_select in let fi = SlicingMacros.get_kf_fi kf in let _, select = db_select in SlicingProject.add_fct_src_filter fi select; match fi.SlicingInternals.fi_level_option with | SlicingInternals.DontSlice | SlicingInternals.DontSliceButComputeMarks -> SlicingMacros.change_fi_slicing_level fi SlicingInternals.MinNbSlice; SlicingParameters.debug ~level:1 "[Register.add_fi_selection] changing %s slicing level to %s@." (SlicingMacros.fi_name fi) (SlicingMacros.str_level_option fi.SlicingInternals.fi_level_option) | SlicingInternals.MinNbSlice | SlicingInternals.MaxNbSlice -> () ���������frama-c-20.0-Calcium/src/plugins/slicing/slicingState.ml��������������������������������������������0000666�0000000�0000000�00000005511�13571573400�020100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module P = State_builder.Option_ref (SlicingTypes.Sl_project) (struct let name = "Slicing.Project" let dependencies = [] (* others delayed in Register *) end) let self = P.self let () = Cmdline.run_after_extended_stage (fun () -> State_dependency_graph.add_codependencies ~onto:self [ !Db.Pdg.self; !Db.Inputs.self_external; !Db.Outputs.self_external ]) let get () = try P.get () with Not_found -> SlicingParameters.fatal "slicing not initialized." let may f = match P.get_option () with | None -> () | Some _ -> f () let may_map ~dft f = match P.get_option () with | None -> dft | Some _ -> f () let reset_slicing () = !Db.Value.compute () ; let initialized = match P.get_option () with | None -> false | Some _ -> true in if not initialized then SlicingParameters.feedback ~level:1 "initializing slicing ..." else SlicingParameters.feedback ~level:1 "reinitializing slicing ..."; P.set SlicingInternals.{ functions = Cil_datatype.Varinfo.Hashtbl.create 17; actions = [] }; if not initialized then SlicingParameters.feedback ~level:2 "done (initializing slicing)." else SlicingParameters.feedback ~level:2 "done (reinitializing slicing)." ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingState.mli�������������������������������������������0000666�0000000�0000000�00000004767�13571573400�020265� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** State of the slicing. @since Phosphorus-20170501-beta1 *) val get: unit -> SlicingTypes.sl_project (** Get the state of the slicing project. Assume it has already been initialized through {!Db.Slicing.reset_slice}. *) val may: (unit -> unit) -> unit (** apply the given closure if the slicing project has been initialized through {!Db.Slicing.reset_slice}. *) val may_map: dft:'a -> (unit -> 'a) -> 'a (** apply the given closure if the slicing project has been initialized through {!Db.Slicing.reset_slice}, or else return the default value.*) val self: State.t (** Internal state of the slicing tool from project viewpoints. @since Sulfur-20171101 *) val reset_slicing: unit -> unit (** Function that can be used for: - initializing the slicing tool before starting a slicing project; - removing all computed slices and all internal pending requests of the current slicing project. *) ���������frama-c-20.0-Calcium/src/plugins/slicing/slicingTransform.ml����������������������������������������0000666�0000000�0000000�00000045332�13571573400�021000� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Export the slicing project *) (**/**) open Cil_types open Cil (**/**) module Visibility (SliceName : sig val get : kernel_function -> bool -> int -> string end) = struct exception EraseAssigns exception EraseAllocation type proj = unit type transform = { slice: SlicingInternals.fct_slice; src_visible: bool (* whether the src function of the slice is visible and can be used to give names *); keep_body: bool (* if false and the function has a body, the body will be removed. Ignored otherwise *); } type fct = | Iff of transform | Isrc of bool (* same meaning as keep_body *) | Iproto let keep_body kf = Kernel_function.is_definition kf && not (!Db.Value.use_spec_instead_of_definition kf) (* _project is left to comply with a module signature defined outside the slicing module (in filter) *) let fct_info _proj kf = let fi = SlicingMacros.get_kf_fi kf in let slices = SlicingMacros.fi_slices fi in let src_visible = Fct_slice.is_src_fun_visible kf in SlicingParameters.debug ~level:1 "[SlicingTransform.Visibility.fct_info] processing %a (%d slices/src %svisible)" Kernel_function.pretty kf (List.length slices) (if src_visible then "" else "not "); let need_addr = (Kernel_function.get_vi kf).vaddrof in let src_name_used = src_visible || need_addr in let keep_body = keep_body kf in let info_list = List.map (fun ff -> Iff {slice = ff; src_visible = src_name_used; keep_body}) slices in if src_visible then Isrc keep_body :: info_list else if need_addr then Iproto :: info_list (* TODO for #344 *) else info_list let fct_name svar ff = let name = match ff with | Isrc _ | Iproto -> let kf_entry,_ = Globals.entry_point () in let vi_entry = Kernel_function.get_vi kf_entry in if Cil_datatype.Varinfo.equal svar vi_entry then svar.vname ^ "_orig" else svar.vname | Iff {slice = ff; src_visible} -> let kf = SlicingMacros.get_ff_kf ff in let ff_num = ff.SlicingInternals.ff_id in SliceName.get kf src_visible ff_num in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fct_name] get fct_name = %s" name; name let visible_mark m = not (SlicingMarks.is_bottom_mark m) let param_visible ff_opt n = match ff_opt with | Isrc _ | Iproto -> true | Iff {slice = ff} -> visible_mark (Fct_slice.get_param_mark ff n) let body_visible ff_opt = match ff_opt with | Iproto -> false | Isrc keep -> keep | Iff {keep_body} -> keep_body let inst_visible ff_opt inst = match ff_opt with | Isrc _ -> true | Iproto -> false | Iff {slice = ff} -> let m = Fct_slice.get_stmt_mark ff inst in visible_mark m let label_visible ff_opt inst label = match ff_opt with | Isrc _ -> true | Iproto -> false | Iff {slice = ff} -> let m = Fct_slice.get_label_mark ff inst label in let v = visible_mark m in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.label_visible] label %a is %svisible" Printer.pp_label label (if v then "" else "in"); v let data_in_visible ff data_in = match data_in with | None -> true | Some data_in -> (* it is too difficult to know if the callers of this slice * compute [data_in] or not, but let's see if, by chance, * some data have been selected manually... *) let m = Fct_slice.get_input_loc_under_mark ff data_in in let v = visible_mark m in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.data_in_visible] data %a is %svisible" Locations.Zone.pretty data_in (if v then "" else "in"); v let all_nodes_visible ff nodes = let is_visible visi n = let m = Fct_slice.get_node_mark ff n in if SlicingMarks.is_bottom_mark m then begin SlicingParameters.debug ~level:3 "[SlicingTransform.Visibility.all_nodes_visible] node %a invisible" (!Db.Pdg.pretty_node true) n; false end else visi in List.fold_left is_visible true nodes exception NoDataInfo let data_nodes_visible ff (decl_nodes, data_info) = let keep_annots = SlicingParameters.Mode.KeepAnnotations.get () in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.data_nodes_visible (with keep_annots = %s)] ?" (if keep_annots then "true" else "false"); let decls_visible = all_nodes_visible ff decl_nodes in if keep_annots then decls_visible else match data_info with | None -> raise NoDataInfo | Some (data_nodes, data_in) -> let is_data_visible visi (n,z) = let key = PdgTypes.Node.elem_key n in let key = match z, key with | Some z, PdgIndex.Key.SigCallKey (call, PdgIndex.Signature.Out (PdgIndex.Signature.OutLoc out_z)) -> let z = Locations.Zone.narrow z out_z in PdgIndex.Key.call_output_key (PdgIndex.Key.call_from_id call) z | _, _ -> key in let m = Fct_slice.get_node_key_mark ff key in if SlicingMarks.is_bottom_mark m then begin SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.data_nodes_visible]@\n\ node %a invisible" (!Db.Pdg.pretty_node true) n; false end else visi in let visible = decls_visible && data_in_visible ff data_in in let data_visible = List.fold_left is_data_visible visible data_nodes in data_visible (* work-around to avoid outputting annotations with type errors: in case we end up with NotImplemented somewhere, we keep the annotation iff all C variables occurring in there are visible. *) let all_logic_var_visible, all_logic_var_visible_identified_term, all_logic_var_visible_term, all_logic_var_visible_assigns, all_logic_var_visible_deps = let module Exn = struct exception Invisible end in let vis ff = object inherit Visitor.frama_c_inplace method! vlogic_var_use v = match v.lv_origin with None -> DoChildren | Some v when v.vformal && not (visible_mark (Fct_slice.get_param_mark ff (Kernel_function.get_formal_position v (SlicingMacros.get_ff_kf ff)+1))) (* For some reason, pdg counts parameters starting from 1 *) -> raise Exn.Invisible | Some v when not v.vglob && not (visible_mark (Fct_slice.get_local_var_mark ff v)) -> raise Exn.Invisible | Some _ -> DoChildren end in (fun ff pred -> try ignore (Visitor.visitFramacPredicate (vis ff) pred); true with Exn.Invisible -> false), (fun ff term -> try ignore (Visitor.visitFramacIdTerm (vis ff) term); true with Exn.Invisible -> false), (fun ff term -> try ignore (Visitor.visitFramacTerm (vis ff) term); true with Exn.Invisible -> false), (fun ff (b,_) -> try ignore (Visitor.visitFramacTerm (vis ff) b.it_content); true with Exn.Invisible -> false), (fun ff d -> try ignore (Visitor.visitFramacTerm (vis ff) d.it_content); true with Exn.Invisible -> false) let annotation_visible ff_opt stmt annot = SlicingParameters.debug ~current:true ~level:2 "[SlicingTransform.Visibility.annotation_visible] ?"; Db.Value.is_reachable_stmt stmt && Alarms.find annot = None && (* Always drop alarms: the alarms table in the new project is not synchronized *) match ff_opt with | Isrc _ -> true | Iproto -> false | Iff {slice = ff} -> let kf = SlicingMacros.get_ff_kf ff in let pdg = !Db.Pdg.get kf in try let ctrl_nodes, decl_nodes, data_info = !Db.Pdg.find_code_annot_nodes pdg stmt annot in let data_visible = data_nodes_visible ff (decl_nodes, data_info) in let visible = ((all_nodes_visible ff ctrl_nodes) && data_visible) in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.annotation_visible] -> %s" (if visible then "yes" else "no"); visible with | NoDataInfo -> SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.annotation_visible] \ not implemented -> invisible"; false | Logic_interp.To_zone.NYI msg -> SlicingParameters.warning ~current:true ~once:true "Dropping unsupported ACSL annotation"; SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.annotation_visible] \ %s -> invisible" msg; false let fun_precond_visible ff_opt p = SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_precond_visible] %a ?" Printer.pp_predicate p; let visible = match ff_opt with | Isrc _ -> true | Iproto -> true | Iff {slice = ff} -> let kf = SlicingMacros.get_ff_kf ff in let pdg = !Db.Pdg.get kf in try let nodes = !Db.Pdg.find_fun_precond_nodes pdg p in data_nodes_visible ff nodes with NoDataInfo -> all_logic_var_visible ff p in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.precond_visible] -> %s" (if visible then "yes" else "no"); visible let fun_postcond_visible ff_opt p = SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_postcond_visible] %a ?" Printer.pp_predicate p; let visible = match ff_opt with | Isrc _ -> true | Iproto -> true | Iff {slice = ff} -> let kf = SlicingMacros.get_ff_kf ff in let pdg = !Db.Pdg.get kf in try let nodes = !Db.Pdg.find_fun_postcond_nodes pdg p in data_nodes_visible ff nodes with NoDataInfo -> all_logic_var_visible ff p in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_postcond_visible] -> %s" (if visible then "yes" else "no"); visible let fun_variant_visible ff_opt v = SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_variant_visible] %a ?" Printer.pp_term v ; let visible = match ff_opt with | Isrc _ -> true | Iproto -> true | Iff {slice = ff} -> let kf = SlicingMacros.get_ff_kf ff in let pdg = !Db.Pdg.get kf in try let nodes = !Db.Pdg.find_fun_variant_nodes pdg v in data_nodes_visible ff nodes with NoDataInfo -> all_logic_var_visible_term ff v in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_variant_visible] -> %s" (if visible then "yes" else "no"); visible let fun_frees_visible ff_opt v = let keep_annots = SlicingParameters.Mode.KeepAnnotations.get () in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_frees_visible \ (with keep_annots = %B)] ?" keep_annots; if not keep_annots then raise EraseAllocation; let visible = match ff_opt with | Isrc _ -> true | Iproto -> true | Iff {slice = ff} -> all_logic_var_visible_identified_term ff v in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_frees_visible] -> %s" (if visible then "yes" else "no"); visible let fun_allocates_visible ff_opt v = let keep_annots = SlicingParameters.Mode.KeepAnnotations.get () in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_allocates_visible \ (with keep_annots = %B)] ?" keep_annots; if not keep_annots then raise EraseAllocation; let visible = match ff_opt with | Isrc _ -> true | Iproto -> true | Iff {slice = ff} -> all_logic_var_visible_identified_term ff v in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_allocates_visible] -> %s" (if visible then "yes" else "no"); visible let fun_assign_visible ff_opt v = let keep_annots = SlicingParameters.Mode.KeepAnnotations.get () in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_assign_visible \ (with keep_annots = %B)] ?" keep_annots; if not keep_annots then raise EraseAssigns; let visible = match ff_opt with | Isrc _ -> true | Iproto -> true | Iff {slice = ff} -> all_logic_var_visible_assigns ff v in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_assign_visible] -> %s" (if visible then "yes" else "no"); visible let fun_deps_visible ff_opt v = let keep_annots = SlicingParameters.Mode.KeepAnnotations.get () in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_deps_visible \ (with keep_annots = %B)] ?" keep_annots; let visible = match ff_opt with | Isrc _ -> true | Iproto -> true | Iff {slice = ff} -> all_logic_var_visible_deps ff v in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.fun_deps_visible] -> %s" (if visible then "yes" else "no"); visible let loc_var_visible ff_opt var = match ff_opt with | Isrc _ -> true | Iproto -> false | Iff {slice = ff} -> let m = Fct_slice.get_local_var_mark ff var in visible_mark m let res_call_visible ff call_stmt = match ff with | Isrc _ -> true | Iproto -> false | Iff {slice = ff} -> let key = PdgIndex.Key.call_outret_key call_stmt in let _, ff_marks = ff.SlicingInternals.ff_marks in try let m = PdgIndex.FctIndex.find_info ff_marks key in visible_mark m with Not_found -> false let result_visible _kf ff = match ff with | Isrc _ | Iproto -> true | Iff {slice = ff} -> let key = PdgIndex.Key.output_key in let _, ff_marks = ff.SlicingInternals.ff_marks in try let m = PdgIndex.FctIndex.find_info ff_marks key in visible_mark m with Not_found -> false (* _project is left to comply with a module signature defined outside the slicing module (in filter) *) let called_info (_project, ff) call_stmt = let info = match ff with | Isrc _ | Iproto -> None | Iff {slice = ff} -> try let _, ff_marks = ff.SlicingInternals.ff_marks in let called, _ = PdgIndex.FctIndex.find_call ff_marks call_stmt in match called with | None | Some (None) -> SlicingParameters.error "Undefined called function call-%d\n" call_stmt.sid; assert false | Some (Some (SlicingInternals.CallSrc _)) -> None | Some (Some (SlicingInternals.CallSlice ff)) -> let kf_ff = SlicingMacros.get_ff_kf ff in (* BY: no idea why this is not the same code as in fct_info *) let src_visible = Fct_slice.is_src_fun_visible kf_ff in let keep_body = keep_body kf_ff in Some (kf_ff, Iff { slice = ff; src_visible; keep_body}) with Not_found -> (* the functor should call [called_info] only for visible calls *) assert false in SlicingParameters.debug ~level:2 "[SlicingTransform.Visibility.called_info] called_info stmt %d -> %s@." call_stmt.sid (if info = None then "src" else "some slice"); info let cond_edge_visible _ff_opt s = Db.Value.condition_truth_value s end let default_slice_names kf _src_visible ff_num = let fname = Kernel_function.get_name kf in let kf_entry,_ = Globals.entry_point () in if Kernel_function.equal kf kf_entry then fname else Printf.sprintf "%s_slice_%d" fname ff_num let extract ~f_slice_names new_proj_name = SlicingParameters.feedback ~level:1 "exporting project to '%s'..." new_proj_name; SlicingParameters.feedback ~level:1 "applying all slicing requests..."; SlicingProject.apply_all_actions (); SlicingParameters.feedback ~level:2 "done (applying all slicing requests)."; let module S = struct let get = f_slice_names end in let module Visi = Visibility (S) in let module Transform = Filter.F (Visi) in let tmp_prj = Transform.build_cil_file (new_proj_name ^ " tmp") () in let new_prj = Sparecode.Register.rm_unused_globals ~new_proj_name ~project:tmp_prj () in Project.remove ~project:tmp_prj (); let ctx = Parameter_state.get_selection_context () in Project.copy ~selection:ctx new_prj; SlicingParameters.feedback ~level:2 "done (exporting project to '%s')." new_proj_name; new_prj (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingTransform.mli���������������������������������������0000666�0000000�0000000�00000004034�13571573400�021143� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Export a CIL application from a slicing project *) val default_slice_names:(Cil_types.kernel_function -> bool -> int -> string) (** Apply the actions still waiting in the project * and transform the program (CIL AST) using slicing results * Can optionally specify how to name the sliced functions using [f_slice_names]. * (see db.mli) *) val extract : f_slice_names:(Cil_types.kernel_function -> bool -> int -> string) -> string -> Project.t ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/slicing/slicingTypes.ml��������������������������������������������0000666�0000000�0000000�00000016073�13571573400�020131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Slicing module types. *) exception Slicing_Internal_Error of string exception ChangeCallErr of string exception PtrCallExpr exception CantRemoveCalledFf exception WrongSlicingLevel (** raised when someone tries to build more than one slice for the entry point. * *) exception OnlyOneEntryPointSlice (** raised when one tries to select something in a function where we are not * able to compute the Pdg. *) exception NoPdg (** {2 Public types} * These types are the only one that should be used by the API functions. * Public type definitions should be hidden to the outside world, * but it is not really possible to have abstract types since Slicing has to * use Db.Slicing functions... So, it is up to the user of this module to use * only this public part. *) (** contains global things that has been computed so far for the slicing project. This includes : - the slices of the functions, - and the queue of actions to be applied. *) type sl_project = SlicingInternals.project (** Type of the selections * (we store the varinfo because we cannot use the kernel_function in this file) * *) type sl_select = Cil_types.varinfo * SlicingInternals.fct_user_crit module Fct_user_crit = Datatype.Make (struct include Datatype.Undefined (* TODO: unmarshal *) type t = SlicingInternals.fct_user_crit let reprs = [ SlicingInternals.dummy_fct_user_crit ] let name = "SlicingTypes.Fct_user_crit" let mem_project = Datatype.never_any_project let varname _ = "user_criteria" end) (** Function slice *) type sl_fct_slice = SlicingInternals.fct_slice (** Marks : used to put 'colors' in the result *) type sl_mark = SlicingInternals.pdg_mark (** {3 For the journalization of values of these types} *) let pp_sl_project p_caller fmt _p = let pp fmt = Format.fprintf fmt "@[<hv 2>Extlib.the@;~exn:Db.Slicing.No_Project@;@[<hv 2>(!Db.Slicing.Project.get_project@;())@]@]" in Type.par p_caller Type.Call fmt pp module Sl_project = Datatype.Make (struct include Datatype.Undefined (* TODO: unmarshal *) type t = sl_project let reprs = [ SlicingInternals.dummy_project ] let name = "SlicingTypes.Sl_project" let internal_pretty_code = pp_sl_project let varname _s = "sl_project_" let mem_project = Datatype.never_any_project end) module Sl_select = Datatype.Make (struct include Datatype.Undefined (* TODO: unmarshal *) type t = sl_select let reprs = List.map (fun v -> v, SlicingInternals.dummy_fct_user_crit) Cil_datatype.Varinfo.reprs let name = "SlicingTypes.Sl_select" let varname _s = "sl_select" let mem_project = Datatype.never_any_project end) let pp_sl_fct_slice p_caller fmt ff = let pp fmt = Format.fprintf fmt "@[<hv 2>!Db.Slicing.Slice.from_num_id@;%a@;%d@]" (Kernel_function.internal_pretty_code Type.Call) ff.SlicingInternals.ff_fct.SlicingInternals.fi_kf ff.SlicingInternals.ff_id in Type.par p_caller Type.Call fmt pp module Sl_fct_slice = Datatype.Make (struct include Datatype.Undefined (* TODO: unmarshal *) open SlicingInternals type t = fct_slice let name = "SlicingTypes.Sl_fct_slice" let reprs = [ dummy_fct_slice ] let internal_pretty_code = pp_sl_fct_slice let mem_project = Datatype.never_any_project end) let dyn_sl_fct_slice = Sl_fct_slice.ty let pp_sl_mark p fmt m = let pp = match m.SlicingInternals.m1, m.SlicingInternals.m2 with | SlicingInternals.Spare, _ -> None | _, SlicingInternals.Spare -> None | SlicingInternals.Cav mark1, SlicingInternals.Cav mark2 -> if (PdgTypes.Dpd.is_bottom mark2) then (* use [!Db.Slicing.Mark.make] constructor *) Some (fun fmt -> Format.fprintf fmt "@[<hv 2>!Db.Slicing.Mark.make@;~addr:%b@;~data:%b@;~ctrl:%b@]" (PdgTypes.Dpd.is_addr mark1) (PdgTypes.Dpd.is_data mark1) (PdgTypes.Dpd.is_ctrl mark1)) else None in let pp = match pp with | Some pp -> pp | None -> let pp fmt sub_m = match sub_m with (* use internals constructors *) | SlicingInternals.Spare -> Format.fprintf fmt "SlicingInternals.Spare" | SlicingInternals.Cav pdg_m -> Format.fprintf fmt "@[<hv 2>(SlicingInternals.Cav@;@[<hv 2>(PdgTypes.Dpd.make@;~a:%b@;~d:%b@;~c:%b@;())@])@]" (PdgTypes.Dpd.is_addr pdg_m) (PdgTypes.Dpd.is_data pdg_m) (PdgTypes.Dpd.is_ctrl pdg_m) in fun fmt -> Format.fprintf fmt "@[<hv 2>SlicingInternals.create_sl_mark@;~m1:%a@;~m2:%a@]" pp m.SlicingInternals.m1 pp m.SlicingInternals.m2 in Type.par p Type.Call fmt pp module Sl_mark = Datatype.Make_with_collections (struct type t = SlicingInternals.pdg_mark let name = "SlicingTypes.Sl_mark" let structural_descr = Structural_descr.t_unknown let reprs = [ SlicingInternals.dummy_pdg_mark ] let compare = SlicingInternals.compare_pdg_mark let equal : t -> t -> bool = ( = ) let hash = Hashtbl.hash let copy = Datatype.undefined let rehash = Datatype.undefined let internal_pretty_code = pp_sl_mark let pretty = Datatype.from_pretty_code let mem_project = Datatype.never_any_project let varname = Datatype.undefined end) let dyn_sl_mark = Sl_mark.ty (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/sparecode/���������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015430� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/sparecode/Sparecode.mli��������������������������������������������0000666�0000000�0000000�00000004673�13571573400�020052� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Sparecode analysis. *) (** Interface for the unused code detection. @see <../sparecode/index.html> internal documentation. *) module Register: sig val get: select_annot:bool -> select_slice_pragma:bool -> Project.t (** Remove in each function what isn't used to compute its outputs, * or its annotations when [select_annot] is true, * or its slicing pragmas when [select_slice_pragmas] is true. * @return a new project where the sparecode has been removed. *) val rm_unused_globals : ?new_proj_name:string -> ?project:Project.t -> unit -> Project.t (** Remove unused global types and variables from the given project * (the current one if no project given). * The source project is not modified. * The result is in the returned new project. * @modify Carbon-20110201 optional argument [new_proj_name] added * *) end ���������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/sparecode/globs.ml�������������������������������������������������0000666�0000000�0000000�00000015254�13571573400�017077� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil let dkey = Sparecode_params.register_category "globs" let debug format = Sparecode_params.debug ~dkey ~level:2 format let debug' format = Sparecode_params.debug ~dkey ~level:3 format let used_variables = Hashtbl.create 257 let var_init = Hashtbl.create 257 let used_typeinfo = Hashtbl.create 257 let used_compinfo = Hashtbl.create 257 let used_enuminfo = Hashtbl.create 257 let clear_tables () = Hashtbl.clear used_variables; Hashtbl.clear var_init; Hashtbl.clear used_typeinfo; Hashtbl.clear used_compinfo; Hashtbl.clear used_enuminfo class collect_visitor = object (self) inherit Visitor.frama_c_inplace method! vtype t = match t with | TNamed(ti,_) -> (* we use the type name because direct typeinfo comparison * doesn't wok. Anyway, CIL renames types if several type have the same * name... *) if Hashtbl.mem used_typeinfo ti.tname then SkipChildren else begin debug "add used typedef %s@." ti.tname; Hashtbl.add used_typeinfo ti.tname (); ignore (visitCilType (self:>Cil.cilVisitor) ti.ttype); DoChildren end | TEnum(ei,_) -> if Hashtbl.mem used_enuminfo ei.ename then SkipChildren else begin debug "add used enum %s@." ei.ename; Hashtbl.add used_enuminfo ei.ename (); DoChildren end | TComp(ci,_,_) -> if Hashtbl.mem used_compinfo ci.cname then SkipChildren else begin debug "add used comp %s@." ci.cname; Hashtbl.add used_compinfo ci.cname (); List.iter (fun f -> ignore (visitCilType (self:>Cil.cilVisitor) f.ftype)) ci.cfields; DoChildren end | _ -> DoChildren method! vvrbl v = if v.vglob && not (Hashtbl.mem used_variables v) then begin debug "add used var %s@." v.vname; Hashtbl.add used_variables v (); ignore (visitCilType (self:>Cil.cilVisitor) v.vtype); try let init = Hashtbl.find var_init v in ignore (visitCilInit (self:>Cil.cilVisitor) v NoOffset init) with Not_found -> () end; DoChildren method! vglob_aux g = match g with | GFun (f, _) -> debug "add function %s@." f.svar.vname; Hashtbl.add used_variables f.svar (); Cil.DoChildren | GAnnot _ -> Cil.DoChildren | GVar (v, init, _) -> let _ = match init.init with | None -> () | Some init -> begin Hashtbl.add var_init v init; if Hashtbl.mem used_variables v then (* already used before its initialization (see bug #758) *) ignore (visitCilInit (self:>Cil.cilVisitor) v NoOffset init) end in Cil.SkipChildren | GFunDecl _ -> DoChildren | _ -> Cil.SkipChildren end class filter_visitor prj = object inherit Visitor.generic_frama_c_visitor (Visitor_behavior.copy prj) method! vglob_aux g = match g with | GFun (_f, _loc) (* function definition *) -> Cil.DoChildren (* keep everything *) | GVar (v, _, _) (* variable definition *) | GVarDecl (v, _) | GFunDecl (_, v, _) -> (* variable/function declaration *) if Hashtbl.mem used_variables v then DoChildren else begin debug "remove var %s@." v.vname; ChangeTo [] end | GType (ti, _loc) (* typedef *) -> if Hashtbl.mem used_typeinfo ti.tname then DoChildren else begin debug "remove typedef %s@." ti.tname; ChangeTo [] end | GCompTag (ci, _loc) (* struct/union definition *) | GCompTagDecl (ci, _loc) (* struct/union declaration *) -> if Hashtbl.mem used_compinfo ci.cname then DoChildren else begin debug "remove comp %s@." ci.cname; ChangeTo [] end | GEnumTag (ei, _loc) (* enum definition *) | GEnumTagDecl (ei, _loc) (* enum declaration *) -> if Hashtbl.mem used_enuminfo ei.ename then DoChildren else begin debug "remove enum %s@." ei.ename; DoChildren (* ChangeTo [] *) end | _ -> Cil.DoChildren end module Result = State_builder.Hashtbl (Datatype.String.Hashtbl) (Project.Datatype) (struct let name = "Sparecode without unused globals" let size = 7 let dependencies = [ Ast.self ] (* delayed, see below *) end) let () = Cmdline.run_after_extended_stage (fun () -> State_dependency_graph.add_codependencies ~onto:Result.self [ !Db.Pdg.self; !Db.Outputs.self_external ]) let rm_unused_decl = Result.memo (fun new_proj_name -> clear_tables (); let visitor = new collect_visitor in Visitor.visitFramacFileSameGlobals visitor (Ast.get ()); debug "filtering done@."; let visitor = new filter_visitor in let new_prj = File.create_project_from_visitor new_proj_name visitor in let ctx = Parameter_state.get_selection_context () in Project.copy ~selection:ctx new_prj; new_prj) (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/sparecode/register.ml����������������������������������������������0000666�0000000�0000000�00000011722�13571573400�017611� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {2 Internal State} *) module Result_pair = Datatype.Pair_with_collections(Datatype.Bool)(Datatype.Bool) (struct let module_name = "Sparecode.Register.Result_pair.t" end) module Result = State_builder.Hashtbl (Datatype.Hashtbl (Result_pair.Hashtbl) (Result_pair) (struct let module_name = "Sparecode" end)) (Project.Datatype) (struct let name = "Sparecode" let size = 7 let dependencies = [ Ast.self; Db.Value.self ] (* delayed, see below *) end) let () = Cmdline.run_after_extended_stage (fun () -> State_dependency_graph.add_codependencies ~onto:Result.self [ !Db.Pdg.self; !Db.Outputs.self_external ]) module P = Sparecode_params (** {2 State_builder} *) let unjournalized_rm_unused_globals new_proj_name project = P.feedback "remove unused global declarations from project '%s'" (Project.get_name project); P.result "removed unused global declarations in new project '%s'" new_proj_name; Project.on project Globs.rm_unused_decl new_proj_name let journalized_rm_unused_globals = Journal.register "Sparecode.Register.rm_unused_globals" (Datatype.func2 ~label1:("new_proj_name", None) Datatype.string ~label2:("project", Some Project.current) Project.ty Project.ty) unjournalized_rm_unused_globals let rm_unused_globals ?new_proj_name ?(project=Project.current ()) () = let new_proj_name = match new_proj_name with | Some name -> name | None -> (Project.get_name project)^ " (without unused globals)" in journalized_rm_unused_globals new_proj_name project let run select_annot select_slice_pragma = P.feedback "remove unused code..."; (*let initial_file = Ast.get () in*) let kf_entry, _library = Globals.entry_point () in let proj = Spare_marks.select_useful_things ~select_annot ~select_slice_pragma kf_entry in let old_proj_name = Project.get_name (Project.current ()) in let new_proj_name = (old_proj_name^" without sparecode") in P.feedback "remove unused global declarations..."; let tmp_prj = Transform.Info.build_cil_file ~last:false "tmp_prj" proj in let new_prj = Project.on tmp_prj Globs.rm_unused_decl new_proj_name in P.result "result in new project '%s'." (Project.get_name new_prj); Project.remove ~project:tmp_prj (); let ctx = Parameter_state.get_selection_context () in Project.copy ~selection:ctx new_prj; new_prj let journalized_get = Journal.register "Sparecode.Register.get" (Datatype.func2 ~label1:("select_annot", None) Datatype.bool ~label2:("select_slice_pragma", None) Datatype.bool Project.ty) (fun select_annot select_slice_pragma -> Result.memo (fun _ -> run select_annot select_slice_pragma) (select_annot, select_slice_pragma)) (* add labels *) let get ~select_annot ~select_slice_pragma = journalized_get select_annot select_slice_pragma let main () = if Sparecode_params.Analysis.get () then begin let select_annot = Sparecode_params.Annot.get () in let select_slice_pragma = true in let new_proj = get select_annot select_slice_pragma in File.pretty_ast ~prj:new_proj () end else if Sparecode_params.GlobDecl.get () then begin let new_proj = rm_unused_globals () in File.pretty_ast ~prj:new_proj () end let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������frama-c-20.0-Calcium/src/plugins/sparecode/spare_marks.ml�������������������������������������������0000666�0000000�0000000�00000034734�13571573400�020304� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let debug n format = Sparecode_params.debug ~level:n format let fatal fmt = Sparecode_params.fatal fmt (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** The project is composed of [FctIndex] marked with [BoolMark] * to be used by [Pdg.Register.F_Proj], and another table to store if a function * is visible (useful for Top PDG). *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) module BoolMark = struct type prop_mode = Glob | Loc type t = bool * prop_mode type call_info = unit let bottom = false,Loc let top = true,Glob let visible (b,_) = b let mk glob = if glob then top else (true, Loc) let merge (b1,p1) (b2,p2) = let b = b1 || b2 in let p = match p1, p2 with | Glob, _ | _, Glob -> Glob | Loc, Loc -> Loc in (b, p) let equal (b1,p1:t) (b2,p2) = (b1 = b2) && (p1 = p2) let combine old_m new_m = let new_m = merge old_m new_m in let m_to_prop = if equal old_m new_m then bottom else new_m in (new_m, m_to_prop) let is_bottom b = (b = bottom) let pretty fmt (b,p) = Format.fprintf fmt "%s(%s)" (if b then "true" else "false") (match p with Glob -> "Glob" | Loc -> "Loc") end module KfTopVisi = struct include Cil_datatype.Kf.Hashtbl let add proj kf b = add (snd proj) kf b let find proj kf = find (snd proj) kf (** as soon as a TOP function is called, all its callees are called. *) let rec set proj kf = try find proj kf with Not_found -> add proj kf (); debug 1 "select '%a' as fully visible (top or called by top)" Kernel_function.pretty kf; let callees = Users.Users_register.get kf in Kernel_function.Hptset.iter (set proj) callees let get proj kf = try find proj kf; true with Not_found -> false end (** when we first compute marks to select outputs, * we don't immediately propagate input marks to the calls, * because some calls may be useless and we don't want to compute * their inputs. We will check calls later on. * But when we select annotations, we want to preserve all the calls that can * lead to them : so, we propagate... * *) let call_in_to_check = ref [] let called_top = ref [] module Config = struct module M = BoolMark let mark_to_prop_to_caller_input call_opt pdg_caller sel_elem m = match m with | true, M.Glob -> Some m | true, M.Loc -> call_in_to_check := (pdg_caller, call_opt, sel_elem, m) :: !call_in_to_check; None | _ -> fatal "cannot propagate invisible mark@." let mark_to_prop_to_called_output _call called_pdg = if PdgTypes.Pdg.is_top called_pdg then begin let kf = PdgTypes.Pdg.get_kf called_pdg in called_top := kf :: !called_top; debug 1 "memo call to TOP '%a'" Kernel_function.pretty kf; (fun _ _ -> None) end else fun _n m -> match m with | true, M.Glob -> Some (true, M.Loc) | true, M.Loc -> Some m | _ -> fatal "cannot propagate invisible mark of called function '%a'@." Kernel_function.pretty (PdgTypes.Pdg.get_kf called_pdg) end module ProjBoolMarks = Pdg.Register.F_Proj (Config) type proj = ProjBoolMarks.t * unit KfTopVisi.t type fct = ProjBoolMarks.fct let new_project () = (ProjBoolMarks.empty (), KfTopVisi.create 10) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** Get stored information *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let proj_marks proj = fst proj (** @raise Not_found when the function is not marked. It might be the case * that it is nonetheless visible, but has no marks because of a Top PDG. *) let get_marks proj kf = try KfTopVisi.find proj kf ; None with Not_found -> ProjBoolMarks.find_marks (proj_marks proj) (Kernel_function.get_vi kf) (** Useful only if there has been some Pdg.Top *) let kf_visible proj kf = try KfTopVisi.find proj kf ; true with Not_found -> get_marks proj kf <> None let rec key_visible fm key = try match key with | PdgIndex.Key.CallStmt call_id -> let call = PdgIndex.Key.call_from_id call_id in call_visible fm call | _ -> let m = PdgIndex.FctIndex.find_info fm key in BoolMark.visible m with Not_found -> false and (** the call is visible if its control node is visible *) call_visible fm call = let key = PdgIndex.Key.call_ctrl_key call in key_visible fm key (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** Build selections and propagate. *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** Doesn't mark yet, but add what has to be marked in the selection, * and keep things sorted. *) let rec add_pdg_selection to_select pdg sel_mark = match to_select with | [] -> let l = match sel_mark with None -> [] | Some m -> [m] in [(pdg, l)] | (p, ln) :: tl -> if Db.Pdg.from_same_fun p pdg then let ln = match sel_mark with None -> ln | Some sel_mark -> sel_mark::ln in (p, ln)::tl else (p, ln)::(add_pdg_selection tl pdg sel_mark) let add_node_to_select glob to_select z_opt node = PdgMarks.add_node_to_select to_select (node, z_opt) (BoolMark.mk glob) let add_nodes_and_undef_to_select glob (ctrl_nodes, decl_nodes, data_info) to_select = match data_info with | None -> to_select (* don't select anything (computation failed) *) | Some (data_nodes, undef) -> let to_select = List.fold_left (fun s n -> add_node_to_select glob s None n) to_select ctrl_nodes in let to_select = List.fold_left (fun s n -> add_node_to_select glob s None n) to_select decl_nodes in let to_select = List.fold_left (fun s (n,z_opt) -> add_node_to_select glob s z_opt n) to_select data_nodes in let m = (BoolMark.mk glob) in let to_select = PdgMarks.add_undef_in_to_select to_select undef m in to_select (** Mark the function as visible * and add the marks according to the selection. Notice that if the function has been marked as called by a visible top, we can skip the selection since the function has to be fully visible anyway. **) let select_pdg_elements proj pdg to_select = let kf = PdgTypes.Pdg.get_kf pdg in try KfTopVisi.find proj kf; debug 1 "function '%a' selected for top: skip selection" Kernel_function.pretty kf with Not_found -> debug 1 "add selection in function '%a'@." Kernel_function.pretty kf; ProjBoolMarks.mark_and_propagate (proj_marks proj) pdg to_select; List.iter (KfTopVisi.set proj) !called_top; called_top := [] (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** First step is finished: propagate in the calls. *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** [proj] contains some function marks and [!call_in_to_check] * is a list of call input marks to propagate when the call is visible. * These marks come from the called function selection, * but they are not automatically propagated because when a function is visible * it doesn't mean that all the calls to that function are visible. * * So we first split the todo list ([!call_in_to_check]) into the nodes to mark * which correspond to inputs of visible calls * and the others that do not yet correspond to visible call * but we keep them because it can happen later *) let rec process_call_inputs proj = let rec process (to_select, unused) todo = match todo with | [] -> (to_select, unused) | (pdg_caller, call, sel, m) as e :: calls -> let kf_caller = PdgTypes.Pdg.get_kf pdg_caller in let visible, select = match call with | Some call -> let visible = match get_marks proj kf_caller with | None -> (* the caller have no marks! *) debug 1 "the caller '%a' is a spare function" Kernel_function.pretty kf_caller; false | Some fm -> call_visible fm call in visible, Some (sel, m) | None -> (* let see if the function is visible or not *) assert (PdgTypes.Pdg.is_top pdg_caller); KfTopVisi.get proj kf_caller, None in let res = if visible then let to_select = add_pdg_selection to_select pdg_caller select in (to_select, unused) else (to_select, e::unused) in process res calls in let to_select, new_list = process ([], []) !call_in_to_check in match to_select with | [] -> call_in_to_check := [] (* nothing more to mark : finished ! we can forget [new_list] *) | _ -> call_in_to_check := new_list; List.iter (fun (pdg, sel) -> select_pdg_elements proj pdg sel) to_select; process_call_inputs proj (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** Main selection: select starting points and propagate. *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let select_entry_point proj _kf pdg = let ctrl = !Db.Pdg.find_entry_point_node pdg in let to_select = add_node_to_select true [] None ctrl in select_pdg_elements proj pdg to_select let select_all_outputs proj kf pdg = let outputs = !Db.Outputs.get_external kf in debug 1 "@[selecting output zones %a@]" Locations.Zone.pretty outputs; try let nodes, undef = !Db.Pdg.find_location_nodes_at_end pdg outputs in let nodes = try ((!Db.Pdg.find_ret_output_node pdg),None) :: nodes with Not_found -> nodes in let nodes_and_co = ([], [], Some (nodes, undef)) in let to_select = add_nodes_and_undef_to_select false nodes_and_co [] in select_pdg_elements proj pdg to_select with Not_found -> (* end is unreachable *) () (** used to visit all the annotations of a given function * and to find the PDG nodes to select so that the reachable annotations * can be visible *) class annot_visitor ~filter pdg = object (self) inherit Visitor.frama_c_inplace val mutable to_select = [] method get_select = to_select method! vcode_annot annot = let () = if filter annot then try let stmt = Extlib.the self#current_stmt in debug 1 "selecting annotation : %a @." Printer.pp_code_annotation annot; let info = !Db.Pdg.find_code_annot_nodes pdg stmt annot in to_select <- add_nodes_and_undef_to_select true info to_select with Not_found -> () (* unreachable *) | Logic_interp.To_zone.NYI _ -> Sparecode_params.warning ~current:true ~once:true "Dropping annotation"; () in Cil.SkipChildren end let select_annotations ~select_annot ~select_slice_pragma proj = let visit_fun kf = debug 1 "look for annotations in function %a@." Kernel_function.pretty kf; let pdg = !Db.Pdg.get kf in if PdgTypes.Pdg.is_top pdg then debug 1 "pdg top: skip annotations" else if PdgTypes.Pdg.is_bottom pdg then debug 1 "pdg bottom: skip annotations" else begin let filter annot = match annot.Cil_types.annot_content with | Cil_types.APragma (Cil_types.Slice_pragma _) -> select_slice_pragma | Cil_types.AAssert _-> (* Never select alarms, they are not useful *) (match Alarms.find annot with | None -> select_annot | Some _ -> false) | _ -> select_annot in try let f = Kernel_function.get_definition kf in let visit = new annot_visitor ~filter pdg in let fc_visit = (visit:>Visitor.frama_c_visitor) in let _ = Visitor.visitFramacFunction fc_visit f in let to_select = visit#get_select in if to_select <> [] then select_pdg_elements proj pdg to_select with Kernel_function.No_Definition -> () (* nothing to do *) end in Globals.Functions.iter visit_fun let finalize proj = debug 1 "finalize call input propagation@."; process_call_inputs proj; assert (!call_in_to_check = []) let select_useful_things ~select_annot ~select_slice_pragma kf_entry = let proj = new_project () in assert (!call_in_to_check = []); debug 1 "selecting function %a outputs and entry point@." Kernel_function.pretty kf_entry; let pdg = !Db.Pdg.get kf_entry in if PdgTypes.Pdg.is_top pdg then KfTopVisi.set proj kf_entry else if PdgTypes.Pdg.is_bottom pdg then debug 1 "unreachable entry point ?" else begin select_entry_point proj kf_entry pdg; select_all_outputs proj kf_entry pdg; if (select_annot || select_slice_pragma) then select_annotations ~select_annot ~select_slice_pragma proj; finalize proj end; proj (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������frama-c-20.0-Calcium/src/plugins/sparecode/spare_marks.mli������������������������������������������0000666�0000000�0000000�00000003756�13571573400�020455� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type proj type fct val select_useful_things : select_annot:bool -> select_slice_pragma:bool -> kernel_function -> proj val get_marks : proj -> kernel_function -> fct option val key_visible : fct -> PdgIndex.Key.t -> bool (** Useful mainly if there has been some Pdg.Top *) val kf_visible : proj -> kernel_function -> bool (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������frama-c-20.0-Calcium/src/plugins/sparecode/sparecode_params.ml��������������������������������������0000666�0000000�0000000�00000004542�13571573400�021277� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "sparecode" let shortname = "sparecode" let help = "code cleaner" end) module Analysis = False(struct let option_name = "-sparecode" let help = "perform a spare code analysis" end) let () = Analysis.add_aliases ["-sparecode-analysis"] module Annot = True(struct let option_name = "-sparecode-annot" let help = "select more things to keep every reachable annotation" end) module GlobDecl = False(struct let option_name = "-sparecode-rm-unused-globals" let help = ("only remove unused global types and variables "^ "(automatically done by -sparecode-analysis)") end) (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/sparecode/sparecode_params.mli�������������������������������������0000666�0000000�0000000�00000003673�13571573400�021454� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S module Analysis: Parameter_sig.Bool (** Whether to perform spare code detection or not. *) module Annot : Parameter_sig.Bool (** keep more things to keep all reachable annotations. *) module GlobDecl : Parameter_sig.Bool (** remove unused global types and variables *) (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/sparecode/transform.ml���������������������������������������������0000666�0000000�0000000�00000014557�13571573400�020011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil module BoolInfo = struct type proj = Spare_marks.proj type fct = Spare_marks.fct option * Kernel_function.t exception EraseAssigns exception EraseAllocation let fct_info project kf = match Spare_marks.get_marks project kf with | None -> if Spare_marks.kf_visible project kf then [None, kf] else [] | Some fm -> [Some fm, kf] let key_visible txt fm key = let visible = match fm with None -> true | Some fm -> Spare_marks.key_visible fm key in Sparecode_params.debug ~level:3 "%s : %a -> %b" txt !Db.Pdg.pretty_key key visible; visible let param_visible (fm,_) n = let key = PdgIndex.Key.param_key n in key_visible "param_visible" fm key let loc_var_visible (fm,_) var = let key = PdgIndex.Key.decl_var_key var in key_visible "loc_var_visible" fm key let term_visible (fm,kf) t = let module M = struct exception Invisible end in let visitor = object inherit Visitor.frama_c_inplace method! vlogic_var_use v = match v.lv_origin with | None -> DoChildren | Some v when v.vformal -> let n_param = Kernel_function.get_formal_position v kf + 1 in if not (param_visible (fm,kf) n_param) then raise M.Invisible else DoChildren | Some v when not v.vglob -> if not (loc_var_visible (fm, kf) v) then raise M.Invisible else DoChildren | Some _ -> DoChildren end in try ignore (Visitor.visitFramacTerm visitor t); true with M.Invisible -> false let body_visible _fm = true let label_visible (fm,_) stmt label = let lab_key = PdgIndex.Key.label_key stmt label in key_visible "label_visible" fm lab_key let annotation_visible _ stmt annot = Db.Value.is_reachable_stmt stmt && Alarms.find annot = None (* Keep annotations on reachable, but not alarms: they can be resynthesized, and the alarms table is not synchronized in the new project anyway *) (* TODO: does not seem really coherent with the fact that almost everything else in the logic is cleared... *) let fun_precond_visible _ _p = (* TODO : we say that they are removed in order to get correct results, * but in fact, we should select them ! *) false let fun_postcond_visible _ _p = (* TODO : we say that they are removed in order to get correct results, * but in fact, we should select them ! *) false let fun_variant_visible _ _p = (* TODO : we say that they are removed in order to get correct results, * but in fact, we should select them ! *) false let fun_frees_visible _ _b = (* TODO : we say that they are removed in order to get correct results, * but in fact, we should select them ! *) false let fun_allocates_visible _ _b = (* TODO : we say that they are removed in order to get correct results, * but in fact, we should select them ! *) false let fun_assign_visible fm_kf (b,_) = (* [VP 2011-02-01] Removing all assigns is incorrect! this would lead to say assigns \nothing for all functions. *) term_visible fm_kf b.it_content let fun_deps_visible fm_kf t = term_visible fm_kf t.it_content let res_call_visible (fm,_) call_stmt = let key = PdgIndex.Key.call_outret_key call_stmt in key_visible "res_call_visible" fm key let called_info (project, _fm) call_stmt = match call_stmt.skind with | Instr (Call (_, _, _, _) | Local_init(_, ConsInit _, _)) -> let called_functions = Db.Value.call_to_kernel_function call_stmt in let call_info = match Kernel_function.Hptset.contains_single_elt called_functions with | None -> None | Some kf -> match Spare_marks.get_marks project kf with | None -> if Spare_marks.kf_visible project kf then Some (kf, (None,kf)) else None | Some fm -> Some (kf, (Some fm,kf)) in call_info | _ -> Sparecode_params.fatal "this call is not a call" let inst_visible (fm,_) stmt = match stmt.Cil_types.skind with | Cil_types.Block _ -> (* block are always visible for syntactic reasons *) true | _ -> let stmt_key = PdgIndex.Key.stmt_key stmt in key_visible "inst_visible" fm stmt_key let fct_name v _fm = v.Cil_types.vname let result_visible kf fm_kf = try inst_visible fm_kf (Kernel_function.find_return kf) with Kernel_function.No_Statement -> true let cond_edge_visible _ s = Db.Value.condition_truth_value s end module Info = Filter.F (BoolInfo) (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014754� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/Makefile.in�������������������������������������������������0000666�0000000�0000000�00000005150�13571573400�017022� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif ################### # Plug-in Setting # ################### PLUGIN_DIR ?=. PLUGIN_ENABLE:=@ENABLE_STUDIA@ PLUGIN_NAME:=Studia PLUGIN_CMO:= options writes reads PLUGIN_GUI_CMO:= studia_gui PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure PLUGIN_DEPENDENCIES:=Eva PLUGIN_NO_TEST:=no ################ # Generic part # ################ include $(FRAMAC_SHARE)/Makefile.dynamic ##################################### # Regenerating the Makefile on need # ##################################### ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif $(Studia_DIR)/Makefile: $(Studia_DIR)/Makefile.in \ $(CONFIG_STATUS_DIR)/config.status cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/Studia.mli��������������������������������������������������0000666�0000000�0000000�00000005343�13571573400�016715� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Computations of the statements that write a given memory zone. *) module Writes: sig (** Given an effect [e], something is directly modified by [e] (through an affectation, or through a call to a leaf function) if [direct] holds, and indirectly (through the effects of a call) otherwise. *) type effects = { direct: bool (** Direct affectation [lv = ...], or modification through a call to a leaf function. *); indirect: bool (** Modification inside the body of called function [f(...)]*); } val compute: Locations.Zone.t -> (Cil_types.stmt * effects) list (** [compute z] finds all the statements that modifies [z], and for each statement, indicates whether the modification is direct or indirect. *) end (** Computations of the statements that read a given memory zone. *) module Reads: sig val compute: Locations.Zone.t -> (Cil_types.stmt * Writes.effects) list (** [compute z] finds all the statements that read [z]. The [effects] information indicates whether the read occur on the given statement, or through an inner call for [Call] instructions. *) end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/configure���������������������������������������������������0000777�0000000�0000000�00000272234�13571573400�016675� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS ENABLE_STUDIA ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_studia ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-studia support for studia plug-in (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-studia was given. if test "${enable_studia+set}" = set; then : enableval=$enable_studia; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "studia is not available" "$LINENO" 5 fi FORCE_STUDIA=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_STUDIA ENABLE_STUDIA=$ENABLE NAME_STUDIA=studia if test "$default" = "no" -a "$FORCE" = "no"; then INFO_STUDIA=" (not available by default)" fi echo "studia... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) REQUIRE_EVA=$REQUIRE_EVA" "studia REQUIRED_STUDIA=$REQUIRED_STUDIA" "eva ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/configure.ac������������������������������������������������0000666�0000000�0000000�00000004370�13571573400�017246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ######################################## # Studia as a standard Frama-C plug-in # ######################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)]) check_plugin(studia,PLUGIN_RELATIVE_PATH(plugin_file), [support for studia plug-in],yes) plugin_require(studia,eva) ####################### # Generating Makefile # ####################### write_plugin_config(Makefile) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/options.ml��������������������������������������������������0000666�0000000�0000000�00000003446�13571573400�017010� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.Register (struct let name = "Studia" let shortname = "studia" let help = "Tools for Eva case studies" end) (* Local Variables: compile-command: "make" End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/options.mli�������������������������������������������������0000666�0000000�0000000�00000003253�13571573400�017155� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.General_services (* Local Variables: compile-command: "make" End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/reads.ml����������������������������������������������������0000666�0000000�0000000�00000011460�13571573400�016406� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Find the statements that reads a given zone, using Inout. (Thus, only operational reads are found.) *) open Cil_types open Locations open Writes class find_read zlval = object inherit Visitor.frama_c_inplace val mutable res = ([] : (stmt * effects) list) method! vstmt_aux stmt = let aux_call lvopt _kf args _loc = let z = !Db.Inputs.statement stmt in if Zone.intersects z zlval then begin (* Computes what is read to evaluate [args] and [lvopt] *) let deps = List.map (!Db.Inputs.expr stmt) args in let deps = List.fold_left Zone.join Zone.bottom deps in let deps = match lvopt with | None -> deps | Some lv -> let dlv, _ = !Db.Value.lval_to_loc_with_deps (Kstmt stmt) ~deps:Zone.bottom lv in Zone.join dlv deps in let direct = Zone.intersects deps zlval in (* now determine if the functions called at [stmt] read directly or indirectly [zlval] *) let aux_kf kf effects = let inputs = !Db.Inputs.get_internal kf in (* TODO: change to this once we can get "full" inputs through Inout. Currently, non operational inputs disappear, and this function is not suitable. let inout = !Db.Operational_inputs.get_internal_precise ~stmt kf in let inputs = inout.Inout_type.over_inputs in *) if Zone.intersects inputs zlval then if !Db.Value.use_spec_instead_of_definition kf then (* Direst, as there is no body for this funtion. *) { effects with direct = true } else { effects with indirect = true } (* Indirect effect *) else effects (* this function pointer does not read [zlval] *) in let kfs = Db.Value.call_to_kernel_function stmt in let effects = Kernel_function.Hptset.fold aux_kf kfs {direct; indirect = false} in res <- (stmt, effects) :: res end in match stmt.skind with | Instr (Call (lvopt, f, args, loc)) -> aux_call lvopt f args loc; Cil.SkipChildren | Instr (Local_init(v, ConsInit(f, args, k), l)) -> Cil.treat_constructor_as_func aux_call v f args k l; Cil.SkipChildren | Instr _ -> let z = !Db.Inputs.statement stmt in if Zone.intersects z zlval then begin res <- (stmt, {direct = true; indirect = false}) :: res end; Cil.SkipChildren | If (e, _, _, _) | Switch (e, _, _, _) -> let z = !Db.Inputs.expr stmt e in if Zone.intersects z zlval then begin res <- (stmt, {direct = true; indirect = false}) :: res end; Cil.DoChildren | _ -> Cil.DoChildren method result = res end let compute z = let vis = new find_read z in let aux_kf_fundec kf = let all_in = !Db.Inputs.get_internal kf in if Zone.intersects all_in z then begin let fundec = Kernel_function.get_definition kf in ignore (Visitor.visitFramacFunction (vis :> Visitor.frama_c_visitor) fundec;) end in let aux_kf kf = if Kernel_function.is_definition kf then aux_kf_fundec kf in Globals.Functions.iter aux_kf; vis#result ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/reads.mli���������������������������������������������������0000666�0000000�0000000�00000003653�13571573400�016564� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Computations of the statements that read a given memory zone. *) val compute: Locations.Zone.t -> (Cil_types.stmt * Writes.effects) list (** [compute z] finds all the statements that read [z]. The [effects] information indicates whether the read occur on the given statement, or through an inner call for [Call] instructions. *) �������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/studia_gui.ml�����������������������������������������������0000666�0000000�0000000�00000030566�13571573400�017455� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Pretty_source open Cil_types open Cil_datatype let update_column = ref (fun _ -> ()) let add_tag buffer (name, tag_prop) start stop = let tag = Gtk_helper.make_tag buffer ~name tag_prop in Gtk_helper.apply_tag buffer tag start stop let studia_start_tag = ("startstudia", [`UNDERLINE `DOUBLE]) let show_direct_tag = ("show_direct", [`BACKGROUND "#FFca63"]) let show_indirect_tag = ("show_indirect", [`BACKGROUND "#FFdb74"]) let empty_tag = ("", []) let ask_for_lval (main_ui:Design.main_window_extension_points) kf = let txt = Gtk_helper.input_string ~parent:main_ui#main_window ~title:"Input lvalue expression" "" in match txt with None | Some "" -> None | Some txt -> try let term_lval = !Db.Properties.Interp.term_lval kf txt in Some (txt, term_lval) with e -> main_ui#error "[ask for lval] '%s' invalid expression: %s@." txt (Printexc.to_string e); None (** [kf_stmt_opt] is used if we want to ask the lval to the user in a popup *) let get_lval_opt main_ui kf localizable = match localizable with | Pretty_source.PLval (Some _kf, (Kstmt _stmt), lv) -> let lv_txt = Pretty_utils.to_string Printer.pp_lval lv in let tlv = Logic_utils.lval_to_term_lval ~cast:false lv in Some (lv_txt, tlv) | Pretty_source.PTermLval (Some _kf, (Kstmt _stmt), _, tlv) -> let tlv_txt = Pretty_utils.to_string Printer.pp_term_lval tlv in Some (tlv_txt, tlv) | _ -> match ask_for_lval main_ui kf with | None -> None | Some (lv_txt, lv) -> Some (lv_txt, lv) let eval_tlval = let typ_lval_to_zone_gui = Datatype.func2 Stmt.ty Term.ty Locations.Zone.ty in Dynamic.get ~plugin:"Value" "tlval_to_zone_gui" typ_lval_to_zone_gui module Kfs_containing_highlighted_stmt = Kernel_function.Make_Table (Datatype.String.Set) (struct let name = "Studia.Kf_containing_highlighted_stmt" let size = 7 let dependencies = [ (*Dependencies are managed manually by Make_StmtSetState*) ] end) let default_icon_name = "gtk-apply" let default_icon = Datatype.String.Set.singleton default_icon_name module Make_StmtMapState (Info:sig val name: string end) = struct module D = Datatype include State_builder.Ref (Stmt.Map.Make(Datatype.String.Set)) (struct let name = Info.name let dependencies = [ Db.Value.self ] let default () = Stmt.Map.empty end) let set s = set s; Kfs_containing_highlighted_stmt.clear (); Stmt.Map.iter (fun stmt s -> let kf = Kernel_function.find_englobing_kf stmt in let prev = try Kfs_containing_highlighted_stmt.find kf with Not_found -> D.String.Set.empty in let union = D.String.Set.union prev s in Kfs_containing_highlighted_stmt.replace kf union) s; !update_column `Contents end (* module type StudiaCmdSig = sig type input val help : string val compute : Kernel_function.t -> Cil_types.stmt -> input -> string (** Returns a text to be displayed in the GUI *) val tag_stmt : Cil_types.stmt -> (string * GText.tag_property list) val clear: unit -> unit end *) module WritesOrReads = struct (* type input = term_lval *) module State = Make_StmtMapState (struct let name = "Studia.Highlighter.WritesOrRead" end) let clear () = State.clear() let help_writes = ("[writes] " ^"highlight the statements that writes to the location pointed to \ by D at L") let help_reads = ("[reads] " ^"highlight the statements that reads the location pointed to \ by D at L") let indirect_icon = Datatype.String.Set.singleton "gtk-jump-to" let conv l = let aux acc (stmt, effects) = let empty = Datatype.String.Set.empty in let direct = if effects.Writes.direct then default_icon else empty in let indirect = if effects.Writes.indirect then indirect_icon else empty in let s = Datatype.String.Set.union direct indirect in if Datatype.String.Set.is_empty s then acc else Stmt.Map.add stmt s acc in List.fold_left aux Stmt.Map.empty l let compute op _kf stmt tlv = let t = Logic_const.term (TLval tlv) (Cil.typeOfTermLval tlv) in let z = eval_tlval stmt t in let r, s = match op with | `Reads -> Reads.compute z, "Reads" | `Writes -> Writes.compute z, "Writes" in Options.feedback "%s computed" s; match r with | [] -> clear (); s ^ " computed; no statement found." | defs -> State.set (conv defs); s ^ " computed" let tag_stmt stmt = try let s = Stmt.Map.find stmt (State.get()) in if Datatype.String.Set.mem default_icon_name s then show_direct_tag else show_indirect_tag with Not_found -> empty_tag end let help (main_ui:Design.main_window_extension_points) = main_ui#pretty_information "%s@." WritesOrReads.help_writes; main_ui#pretty_information "%s@." WritesOrReads.help_reads; main_ui#pretty_information "%s@." "Reset : reset the internal state for all the previous commands." module StudiaState = State_builder.Option_ref (Stmt) (struct let name = "Studia.Highlighter.StudiaState" let dependencies = [ Db.Value.self ] end) let reset () = StudiaState.clear (); WritesOrReads.clear (); Kfs_containing_highlighted_stmt.clear (); !update_column `Contents let callback op (main_ui:Design.main_window_extension_points) (kf, stmt, localizable) = let compute f arg = let msg = f kf stmt arg in if msg <> "" then main_ui#pretty_information "%s@." msg in begin match get_lval_opt main_ui kf localizable with | None -> reset () | Some (lval_txt, lval) -> begin let txt = Format.asprintf "[studia] query %s" lval_txt in StudiaState.set stmt; main_ui#pretty_information "%s@." txt; compute (WritesOrReads.compute op) lval end; end; main_ui#rehighlight () let highlighter (buffer:Design.reactive_buffer) localizable ~start ~stop = try let start_s = StudiaState.get () in let put_tag tag = match tag with | ("",[]) -> () | _ -> add_tag buffer#buffer tag start stop in match localizable with | PStmt (_,stmt) -> if start_s.sid = stmt.sid then put_tag studia_start_tag; put_tag (WritesOrReads.tag_stmt stmt); | _ -> () with Not_found -> () let check_value (main_ui:Design.main_window_extension_points) = Db.Value.is_computed () || let answer = GToolbox.question_box ~title:("Eva Needed") ~buttons:[ "Run"; "Cancel" ] ("Eva has to be run first.\nThis can take some time.\n" ^"Do you want to run Eva now ?") in answer = 1 && match main_ui#full_protect ~cancelable:true !Db.Value.compute with | Some _ -> true | None -> false (** To add a sensitive/unsensitive menu item to a [factory]. The menu item is insensitive when [arg_opt = None], else, when the item is selected, the callback is called with the argument. If [uses_value] is true, check if the value analysis has been computed. *) let add_item (main_ui:Design.main_window_extension_points) ~uses_value menu name arg_opt callback = (* add the menu item *) let item = GMenu.menu_item ~label:name () in menu#add item; match arg_opt with | None -> (* item must not be sensitive *) item#misc#set_sensitive false | Some arg -> (* add callback to the menu item *) let callback () = if not uses_value || check_value main_ui then callback arg else () in (* The following code circumvents a bug where submenu items are not properly activated, by also binding the callback to the button_press event. See http://stackoverflow.com/questions/5221326/submenu-item-does-not-call-function-with-working-solution/15309826 For mysterious reasons, this bug only happens in the contextual menu of the Information panel, but not in the source panel. So we need to avoid creating two input windows for the source panel menu. *) let only_once = ref true in let callback () = if !only_once then begin only_once := false; callback (); only_once := true end in (* Needed anyway for keyboard selection. *) ignore (item#connect#activate ~callback); (* Needed for the menu in the Information panel. *) ignore (item#event#connect#button_press (fun evt -> if GdkEvent.Button.button evt = 1 then (callback (); true) else false)) let selector (popup_factory:GMenu.menu GMenu.factory) (main_ui:Design.main_window_extension_points) ~button localizable = if button = 3 then begin let submenu = popup_factory#add_submenu "Studia" in let submenu_factory = new GMenu.factory submenu in let arg = match (Pretty_source.kf_of_localizable localizable, Pretty_source.ki_of_localizable localizable) with | Some kf, Kstmt stmt -> Some (kf, stmt, localizable) | Some _, Kglobal | None, _ -> None in let add_menu_item name callback = add_item main_ui ~uses_value:true submenu name arg (fun arg -> main_ui#protect ~cancelable:true (fun () -> callback main_ui arg)) in add_menu_item "Writes" (callback `Writes); add_menu_item "Reads" (callback `Reads); ignore (submenu_factory#add_separator ()); add_item main_ui ~uses_value:false submenu "Reset All" (Some()) (fun _ -> reset () ; main_ui#rehighlight ()); ignore (submenu_factory#add_separator ()); add_item main_ui ~uses_value:false submenu "Help" (Some()) (fun _ -> help main_ui) ; end let filetree_decorate main_ui = main_ui#file_tree#append_pixbuf_column ~title:"Studia" (fun globs -> let icons = function | GFun ({svar = v }, _) -> (try Kfs_containing_highlighted_stmt.find (Globals.Functions.get v) with Not_found -> Datatype.String.Set.empty) | _ -> Datatype.String.Set.empty in let ids = if Kfs_containing_highlighted_stmt.length () <> 0 then let icons = List.fold_left (fun acc glob -> Datatype.String.Set.union (icons glob) acc) Datatype.String.Set.empty globs in if Datatype.String.Set.is_empty icons then Datatype.String.Set.singleton "" else icons else Datatype.String.Set.singleton "" in let icons = if Datatype.String.Set.mem default_icon_name ids then [default_icon_name] else Datatype.String.Set.elements (Datatype.String.Set.remove default_icon_name ids) in List.map (fun icon -> `STOCK_ID icon) icons ) (fun _ -> Kfs_containing_highlighted_stmt.length () <> 0) let main main_ui = main_ui#register_source_selector selector; main_ui#register_source_highlighter highlighter; update_column := (filetree_decorate main_ui) let () = Design.register_extension main ������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/studia_gui.mli����������������������������������������������0000666�0000000�0000000�00000003125�13571573400�017615� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/studia/writes.ml���������������������������������������������������0000666�0000000�0000000�00000010763�13571573400�016632� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Find the statements that writes a given zone. This is a lightweight version of module [Scope.Defs]. Instead of using PDGs (that may be very costly to compute), we only use Inout. This also means that we can find effects *after* the stmt the user has chosen. *) open Cil_types open Locations type effects = { direct: bool; indirect: bool; } (** Does the functions called at [stmt] modify directly or indirectly [zlval] *) let effects_of_call stmt zlval effects = let aux_kf kf effects = let inout = !Db.Operational_inputs.get_internal_precise ~stmt kf in let out = inout.Inout_type.over_outputs in if Zone.intersects out zlval then if !Db.Value.use_spec_instead_of_definition kf then { effects with direct = true } (* Mark the effect as direct, there is no body for this funtion. *) else { effects with indirect = true } (* Indirect effect *) else effects in let kfs = Db.Value.call_to_kernel_function stmt in Kernel_function.Hptset.fold aux_kf kfs effects class find_write zlval = object (self) inherit Visitor.frama_c_inplace val mutable res = ([] : (stmt * effects) list) method! vinst i = let stmt = Extlib.the self#current_stmt in begin let aux_call lvopt _kf _args _loc = (* Direct effect through the writing of [lvopt], or indirect inside the call. *) let z = !Db.Outputs.statement stmt in if Zone.intersects z zlval then let direct_write = match lvopt with | None -> false | Some lv -> let zlv = !Db.Value.lval_to_zone (Kstmt stmt) lv in Zone.intersects zlv zlval in let effects = effects_of_call stmt zlval {direct = direct_write; indirect =false} in res <- (stmt, effects) :: res in match i with | Set _ | Local_init(_, AssignInit _, _) -> (* Effect only throuh the written l-value *) let z = !Db.Outputs.statement stmt in if Zone.intersects z zlval then begin res <- (stmt, {direct = true; indirect = false}) :: res end | Call (lvopt, f, args, loc) -> aux_call lvopt f args loc | Local_init(v, ConsInit(f, args, k), l) -> Cil.treat_constructor_as_func aux_call v f args k l | _ -> () (* No effect *) end; Cil.SkipChildren method result = res end let compute z = let vis = new find_write z in let aux_kf_fundec kf = let all_out = !Db.Operational_inputs.get_internal_precise kf in let zout = all_out.Inout_type.over_outputs in if Zone.intersects zout z then begin let fundec = Kernel_function.get_definition kf in ignore (Visitor.visitFramacFunction (vis :> Visitor.frama_c_visitor) fundec;) end in let aux_kf kf = if Kernel_function.is_definition kf then aux_kf_fundec kf in Globals.Functions.iter aux_kf; vis#result �������������frama-c-20.0-Calcium/src/plugins/studia/writes.mli��������������������������������������������������0000666�0000000�0000000�00000004452�13571573400�017001� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Computations of the statements that write a given memory zone. *) (** Given an effect [e], something is directly modified by [e] (through an affectation, or through a call to a leaf function) if [direct] holds, and indirectly (through the effects of a call) otherwise. *) type effects = { direct: bool (** Direct affectation [lv = ...], or modification through a call to a leaf function. *); indirect: bool (** Modification inside the body of called function [f(...)]*); } val compute: Locations.Zone.t -> (Cil_types.stmt * effects) list (** [compute z] finds all the statements that modifies [z], and for each statement, indicates whether the modification is direct or indirect. *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/users/�������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014624� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/users/Users.mli����������������������������������������������������0000666�0000000�0000000�00000003563�13571573400�016437� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* $Id: Users.mli,v 1.5 2008-04-01 09:25:22 uid568 Exp $ *) open Cil_types (** Users analysis. *) (** Functions used by another function. @see <../users/index.html> internal documentation. *) module Users_register : sig val get: (kernel_function -> Kernel_function.Hptset.t) end ���������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/users/users_register.ml��������������������������������������������0000666�0000000�0000000�00000010743�13571573400�020230� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** @plugin development guide *) include Plugin.Register (struct let name = "users" let shortname = "users" let help = "function callees" end) (** @plugin development guide *) module ForceUsers = False (struct let option_name = "-users" let help = "compute function callees" end) module Users = Kernel_function.Make_Table (Kernel_function.Hptset) (struct let name = "Users" let size = 17 let dependencies = [ Db.Value.self; ForceUsers.self ] end) let call_for_users (_state, call_stack) = match call_stack with | [] -> assert false | (current_function, _call_site) :: tail -> if tail = [] then begin (* End of Value analysis, we record that Users has run. We should not do this after the explicit call to Db.Value.compute later in this file, as Value can run on its own and execute Users while doing so.*) Users.mark_as_computed () end; let treat_element (user, _call_site) = ignore (Users.memo ~change:(Kernel_function.Hptset.add current_function) (fun _ -> Kernel_function.Hptset.singleton current_function) user) in List.iter treat_element tail let add_value_hook () = Db.Value.Call_Value_Callbacks.extend_once call_for_users let init () = if ForceUsers.get () then add_value_hook () let () = Cmdline.run_after_configuring_stage init let get kf = let find kf = try Users.find kf with Not_found -> Kernel_function.Hptset.empty in if Users.is_computed () then find kf else begin if Db.Value.is_computed () then begin feedback "requiring again the computation of the value analysis"; Project.clear ~selection:(State_selection.with_dependencies Db.Value.self) () end else feedback ~level:2 "requiring the computation of the value analysis"; add_value_hook (); !Db.Value.compute (); find kf end let get = Journal.register "Users.get" (Datatype.func Kernel_function.ty Kernel_function.Hptset.ty) get let print () = if ForceUsers.get () then result "@[<v>====== DISPLAYING USERS ======@ %t\ ====== END OF USERS ==========" (fun fmt -> Callgraph.Uses.iter_in_rev_order (fun kf -> let callees = get kf in if not (Kernel_function.Hptset.is_empty callees) then Format.fprintf fmt "@[<hov 4>%a: %a@]@ " Kernel_function.pretty kf (Pretty_utils.pp_iter ~pre:"" ~sep:"@ " ~suf:"" Kernel_function.Hptset.iter Kernel_function.pretty) callees)) let print_once, _self_print = State_builder.apply_once "Users_register.print" [ Users.self ] print let () = Db.Main.extend print_once (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������frama-c-20.0-Calcium/src/plugins/value/�������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014577� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/Eva.mli������������������������������������������������������0000666�0000000�0000000�00000003717�13571573400�016025� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Analysis for values and pointers *) (** No function is directly exported: they are registered in {!Db.Value}. *) module Value_results: sig type results val get_results: unit -> results val set_results: results -> unit val merge: results -> results -> results val change_callstacks: (Value_types.callstack -> Value_types.callstack) -> results -> results end �������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/alarmset.ml��������������������������������������������������0000666�0000000�0000000�00000035657�13571573400�016761� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module M = Alarms.Map type alarm = Alarms.t type status = Abstract_interp.Comp.result = True | False | Unknown type s = status M.t type t = Just of s | AllBut of s type 'a if_consistent = [ `Value of 'a | `Inconsistent ] let string_of_predicate_status = function | Unknown -> "unknown" | True -> "valid" | False -> "invalid" let pretty_status fmt v = Format.fprintf fmt "%s" (string_of_predicate_status v) module Status = struct include Datatype.Make_with_collections (struct type t = status include Datatype.Serializable_undefined let name = "Alarmset.status" let reprs = [ True; False; False; Unknown ] let mem_project = Datatype.never_any_project let pretty = pretty_status let compare (s1:t) (s2:t) = Transitioning.Stdlib.compare s1 s2 let equal (s1:t) (s2:t) = s1 = s2 let hash (s:t) = Hashtbl.hash s end) let join x y = match x, y with | True, True -> True | False, False -> False | True, False | False, True | Unknown, _ | _, Unknown -> Unknown let inter x y = match x, y with | Unknown, _ -> `Value y | _, Unknown -> `Value x | True, True -> `Value True | False, False -> `Value False | True, False | False, True -> `Inconsistent exception Stop let join_list l = try let r = List.fold_left (fun acc e -> match e, acc with | Unknown, _ -> raise Stop | e, None -> Some e | e, Some eacc -> Some (join eacc e) ) None l in match r with | None -> True | Some r -> r with Stop -> Unknown end module D = Alarms.Map.Make (Status) let pretty fmt = function | Just m -> Format.fprintf fmt "Just %a" D.pretty m | AllBut m -> Format.fprintf fmt "AllBut %a" D.pretty m let none = Just M.empty let all = AllBut M.empty let equal a b = match a, b with | Just m, Just n | AllBut m, AllBut n -> M.equal Status.equal m n | _, _ -> false let get = function Just m | AllBut m -> m let is_empty = function | AllBut _ -> false | Just m -> M.is_empty m let singleton ?(status=Unknown) a = if status = True then Just M.empty else Just (M.singleton a status) let set alarm status = function | Just m -> if status = True then Just (M.remove alarm m) else Just (M.add alarm status m) | AllBut m -> if status = Unknown then AllBut (M.remove alarm m) else AllBut (M.add alarm status m) let default = function | Just _ -> True | AllBut _ -> Unknown let find alarm set = try match set with | Just m | AllBut m -> M.find alarm m with Not_found -> default set (* Merges two alarm maps [s1] and [s2], using [merge_status] to merge merge the statuses bound to a same alarm. If [combine] is true, both alarm maps [s1] and [s2] have been produced in the same state but for different expressions [e1] and [e2]: they may contain different alarms, but should always have the same status bound to a same alarm. Do not use the default status for alarms in [s1] missing in [s2] (and vice versa): such alarms may have no meaning for [e2], and should have the same status in [s2] than in [s1] anyway. If [combine] is false, both maps come from the evaluation of the same expression in different states. In this case, use the default status for any alarm missing in one side. *) let merge ~combine merge_status s1 s2 = let d1 = default s1 and d2 = default s2 in let m1 = get s1 and m2 = get s2 in let closed_set = match merge_status d1 d2 with | True -> true | Unknown -> false | False -> assert false in let return = if closed_set then function True -> None | p -> Some p else function Unknown -> None | p -> Some p in let merge _ p1 p2 = match p1, p2 with | None, None -> assert false | Some p, None -> if combine then Some p else return (merge_status p d2) | None, Some p -> if combine then Some p else return (merge_status d1 p) | Some p1, Some p2 -> return (merge_status p1 p2) in if closed_set then Just (M.merge merge m1 m2) else AllBut (M.merge merge m1 m2) let union = merge ~combine:false Status.join exception Inconsistent let intersect status1 status2 = match Status.inter status1 status2 with | `Value status -> status | `Inconsistent -> raise Inconsistent let inter s1 s2 = try `Value (merge ~combine:false intersect s1 s2) with Inconsistent -> `Inconsistent let combine s1 s2 = (* [intersect] is only applied if both maps explicitely contain the same alarm. As both maps have been produced in the same state, the statuses for this alarm should be consistent. *) try merge ~combine:true intersect s1 s2 with Inconsistent -> Value_parameters.fatal ~current:true "Inconsistent combination of two alarm maps %a and %a." pretty s1 pretty s2 let iter f = function | Just m -> M.iter f m | AllBut _ -> assert false let exists test ~default = function | Just m -> M.exists test m || default True | AllBut m -> M.exists test m || default Unknown let for_all test ~default = function | Just m -> M.for_all test m && default True | AllBut m -> M.for_all test m && default Unknown (* -------------------------------------------------------------------------- Alarms ------------------------------------------------------------------------ *) open CilE let emitter = Value_util.emitter (* Printer that shows additional information about temporaries *) let local_printer: Printer.extensible_printer = let open Cil_types in object (self) inherit Printer.extensible_printer () as super (* Temporary variables for which we want to print more information *) val mutable temporaries = Cil_datatype.Varinfo.Set.empty method! code_annotation fmt ca = temporaries <- Cil_datatype.Varinfo.Set.empty; match ca.annot_content with | AAssert (_, _, p) -> (* ignore the ACSL name *) Format.fprintf fmt "@[<v>@[assert@ %a;@]" self#predicate_node p.pred_content; (* print temporary variables information *) if not (Cil_datatype.Varinfo.Set.is_empty temporaries) then begin Format.fprintf fmt "@ @[(%t)@]" self#pp_temporaries end; Format.fprintf fmt "@]"; | _ -> assert false method private pp_temporaries fmt = let pp_var fmt vi = Format.fprintf fmt "%s from@ @[%s@]" vi.vname (Extlib.the vi.vdescr) in Pretty_utils.pp_iter Cil_datatype.Varinfo.Set.iter ~pre:"" ~suf:"" ~sep:",@ " pp_var fmt temporaries method! logic_var fmt lvi = (match lvi.lv_origin with | None | Some { vdescr = None }-> () | Some ({ vdescr = Some _ } as vi) -> temporaries <- Cil_datatype.Varinfo.Set.add vi temporaries ); super#logic_var fmt lvi end let pr_annot = local_printer#code_annotation (* Default behaviour: print one alarm per kinstr. *) module Alarm_key = Datatype.Pair_with_collections (Cil_datatype.Kinstr) (Alarms) (struct let module_name = "Alarm_key" end) module Alarm_cache = State_builder.Hashtbl (Alarm_key.Hashtbl) (Datatype.Unit) (struct let name = "Value_messages.Alarm_cache" let dependencies = [Db.Value.self] let size = 35 end) let loc = function | Cil_types.Kglobal -> (* can occur in case of obscure bugs (already happened) with wacky initializers. Module Initial_state of value analysis correctly positions the loc *) Cil.CurrentLoc.get () | Cil_types.Kstmt s -> Cil_datatype.Stmt.loc s let report_alarm ki annot msg = Value_util.alarm_report ~source:(fst (loc ki)) "@[%s.@ @[<hov 2>%a@]@]%t" msg pr_annot annot Value_util.pp_callstack let string_fkind = function | Cil_types.FFloat -> "float" | Cil_types.FDouble -> "double" | Cil_types.FLongDouble -> "long double" (** Emitting alarms *) let register_alarm ki alarm status str = let status = match status with | True -> Property_status.True | False -> (* We cannot soundly emit a red status on an alarm, because we may have emitted a green status earlier on. Thus we store the information for logging purposes, and emit an Unknown status. *) Red_statuses.add_red_alarm ki alarm; Property_status.Dont_know | Unknown -> Property_status.Dont_know in let annot, _is_new = Alarms.register ~loc:(loc ki) ~status emitter ki alarm in (* Report each alarm only once per analysis. The boolean [is_new] returned by {{Alarms.register}} is inadequate, as an alarm emitted by another plugin or by a previous run of Eva would be considered as not new. *) Alarm_cache.memo (fun (_ki,_alarm) -> report_alarm ki annot str) (ki, alarm) let emit_alarm kinstr alarm (status:status) = let register_alarm = register_alarm kinstr alarm status in match alarm with | Alarms.Pointer_comparison (_, _) -> register_alarm "pointer comparison" | Alarms.Division_by_zero _ -> register_alarm "division by zero" | Alarms.Overflow (kind, _, _, _) -> let str = match kind with | Alarms.Signed -> "signed overflow" | Alarms.Unsigned -> "unsigned overflow" | Alarms.Signed_downcast -> "signed downcast" | Alarms.Unsigned_downcast -> "unsigned downcast" in register_alarm str | Alarms.Float_to_int _ -> register_alarm "overflow in conversion from floating-point to integer" | Alarms.Invalid_shift (_, Some _) -> register_alarm "invalid RHS operand for shift" | Alarms.Invalid_shift (_, None) -> register_alarm "invalid LHS operand for left shift" | Alarms.Memory_access (_, access_kind) -> let access = match access_kind with | Alarms.For_reading -> "read" | Alarms.For_writing -> "write" in register_alarm (Format.sprintf "out of bounds %s" access) | Alarms.Index_out_of_bound _ -> register_alarm "accessing out of bounds index" | Alarms.Differing_blocks _ -> register_alarm "pointer subtraction" | Alarms.Is_nan_or_infinite (_, fkind) -> let sfkind = string_fkind fkind in register_alarm (Format.sprintf "non-finite %s value" sfkind) | Alarms.Is_nan (_, fkind) -> let sfkind = string_fkind fkind in register_alarm (Format.sprintf "NaN %s value" sfkind) | Alarms.Uninitialized _ -> register_alarm "accessing uninitialized left-value" | Alarms.Dangling _ -> register_alarm "accessing left-value that contains escaping addresses" | Alarms.Not_separated _ -> register_alarm "undefined multiple accesses in expression" | Alarms.Overlap _ -> register_alarm "partially overlapping lvalue assignment" | Alarms.Function_pointer _ -> register_alarm "pointer to function with incompatible type" | Alarms.Uninitialized_union _ -> register_alarm "accessing uninitialized union" | Alarms.Invalid_bool _ -> register_alarm "trap representation of a _Bool lvalue" let height_alarm = let open Value_util in function | Alarms.Division_by_zero e | Alarms.Index_out_of_bound (e,_) | Alarms.Invalid_shift (e,_) | Alarms.Overflow (_,e,_,_) | Alarms.Float_to_int (e,_,_) | Alarms.Function_pointer (e, _) | Alarms.Pointer_comparison (None,e) -> height_expr e + 2 | Alarms.Memory_access (lv,_) | Alarms.Dangling lv | Alarms.Invalid_bool lv -> height_lval lv + 1 | Alarms.Uninitialized lv -> height_lval lv | Alarms.Pointer_comparison (Some e1, e2) -> max (height_expr e1) (height_expr e2) + 2 | Alarms.Differing_blocks (e1, e2) -> max (height_expr e1) (height_expr e2) + 1 | Alarms.Not_separated (lv1,lv2) | Alarms.Overlap (lv1,lv2) -> max (height_lval lv1) (height_lval lv2) + 1 | Alarms.Is_nan_or_infinite (e, fkind) | Alarms.Is_nan (e, fkind) -> let trivial = match Cil.typeOf e with | TFloat (fk, _) -> fk = fkind | _ -> false in if trivial then height_expr e else height_expr e + 1 | Alarms.Uninitialized_union llv -> List.fold_left max 0 (List.map height_lval llv) let cmp a1 a2 = Datatype.Int.compare (height_alarm (fst a1)) (height_alarm (fst a2)) let emit_alarms kinstr map = let list = M.bindings map in let sorted_list = List.sort cmp list in List.iter (fun (alarm, status) -> emit_alarm kinstr alarm status) sorted_list; if Alarm_cache.length () >= Value_parameters.StopAtNthAlarm.get () then begin Value_parameters.log "Stopping at nth alarm" ; raise Db.Value.Aborted end let emit kinstr = function | Just map -> if not (M.is_empty map) then emit_alarms kinstr map (* TODO: use GADT to avoid this assert false ? *) | AllBut _ -> Value_parameters.abort ~current:true ~once:true "All alarms may arise: \ abstract state too imprecise to continue the analysis." let warn_alarm warn_mode = function | Alarms.Uninitialized _ | Alarms.Dangling _ -> warn_mode.unspecified () | Alarms.Pointer_comparison _ | Alarms.Differing_blocks _ -> warn_mode.defined_logic () | Alarms.Division_by_zero _ | Alarms.Overflow _ | Alarms.Float_to_int _ | Alarms.Invalid_shift _ | Alarms.Memory_access _ | Alarms.Index_out_of_bound _ | Alarms.Is_nan_or_infinite _ | Alarms.Is_nan _ | Alarms.Not_separated _ | Alarms.Overlap _ | Alarms.Function_pointer _ | Alarms.Uninitialized_union _ | Alarms.Invalid_bool _ -> warn_mode.others () let notify warn_mode alarms = iter (fun alarm _status -> warn_alarm warn_mode alarm) alarms (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/alarmset.mli�������������������������������������������������0000666�0000000�0000000�00000012211�13571573400�017107� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Map from alarms to status. Returned by the abstract semantics to report the possible undefined behaviors. *) (** An alarm is a guard against an undesirable behavior. If the status of an assertion is true, then its corresponding undesirable behavior never occurs. Otherwise, the undesirable behavior may occur (unknown status) or definitely happens if the program point is reachable (false status). *) (** The maps are partial. Missing assertions are implicitly bound to a default status. There are two kinds of alarm maps: - closed maps [Just s], where all missing assertions are considered as true: [s] contains the only alarms that can occur. - open maps [AllBut s], where all missing assertions are considered as unknown: [s] contains the only alarms whose status is known. *) type s type t = private Just of s | AllBut of s type alarm = Alarms.t type status = Abstract_interp.Comp.result = True | False | Unknown type 'a if_consistent = [ `Value of 'a | `Inconsistent ] (* Logical status bound to assertions. *) module Status : sig include Datatype.S_with_collections with type t := status val join: status -> status -> status val join_list: status list -> status val inter: status -> status -> status if_consistent end (** no alarms: all potential assertions have a True status. = Just empty *) val none : t (** all alarms: all potential assertions have a Unknown status. = AllBut empty *) val all : t (** [set alarm status t] binds the [alarm] to the [status] in the map [t]. *) val set : alarm -> status -> t -> t (** Returns the status of a given alarm. *) val find : alarm -> t -> status (** Are two maps equal? *) val equal : t -> t -> bool (** Is there an assertion with a non True status ? *) val is_empty : t -> bool (** [singleton ?status alarm] creates the map [set alarm status none]: [alarm] has a by default an unkown status (which can be overridden through [status]), and all others have a True status. *) val singleton : ?status:status -> alarm -> t (** Combines two alarm maps carrying different sets of alarms. If [t1] and [t2] are sound alarm maps for the evaluation in the same state of the expressions [e1] and [e2] respectively, then [combine t1 t2] is a sound alarm map for both evaluations of [e1] and [e2]. *) val combine: t -> t -> t (** Pointwise union of property status: the least precise status is kept. If [t1] and [t2] are sound alarm maps for a same expression [e] in states [s1] and [s2] respectively, then [union t1 t2] is a sound alarm map for [e] in states [s1] and [s2]. *) val union: t -> t -> t (** Pointwise intersection of property status: the most precise status is kept. May return Inconsistent in case of incompatible status bound to an alarm. If [t1] and [t2] are both sound alarm maps for a same expression [e] in the same state, then [inter t1 t2] is also a sound alarm map for [e]. *) val inter: t -> t -> t if_consistent val exists: (alarm -> status -> bool) -> default:(status -> bool) -> t -> bool val for_all: (alarm -> status -> bool) -> default:(status -> bool) -> t -> bool val iter: (alarm -> status -> unit) -> t -> unit (** Emits the alarms according to the given warn mode, at the given instruction. *) val emit: Cil_types.kinstr -> t -> unit (** Calls the functions registered in the [warn_mode] according to the set of alarms. *) val notify: CilE.warn_mode -> t -> unit val pretty : Format.formatter -> t -> unit val pretty_status : Format.formatter -> status -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/�����������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016231� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/abstract_domain.mli����������������������������������0000666�0000000�0000000�00000051075�13571573400�022076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Abstract domains of the analysis. *) (** An abstract domain is a collection of abstract states propagated through the control flow graph by a dataflow analysis. At a program point, they are abstractions of the set of possible concrete states that may arise during any execution of the program. In Eva, different abstract domains may communicate through alarms, values and locations. Alarms report undesirable behaviors that may occur during an execution of the program. They are defined in {!Alarmset}, while values and locations depend on the domain. Values are numerical and non-relational abstractions of the set of the possible values of expressions at a program point. Locations are similar abstractions for memory locations. The main values and locations used in the analyzer are respectively available in {!Main_values} and {!Main_locations}. Values and locations abstractions are extensible, should a domain requires new abstractions. Their signature are in {!Abstract_value.S} and {!Abstract_location.S}. Lvalues and expressions are cooperatively evaluated into locations and values using all the information provided by all domains. These computed values and locations are then available for the domain transformers which model the action of statements on abstract states. However, a domain could ignore this mechanism; its values and locations should then be the unit type. This file gathers the definition of the module types for an abstract domain. The module type {!S} requires all the functions to be implemented to define the abstract semantics of a domain, divided in three categories: - {!Lattice} gives a semi-lattice structure to the abstract states; - {!Queries} extracts information from a state, by giving a value to an expression. - {!Transfer} are the transfer functions of the domain for assignments, assumptions and function calls. It is a functor from a {!Valuation} module, which are maps containing all locations and values computed by the evaluation of the expressions involved in the considered statement. The module type {!S_with_Structure} is {!S}, plus a special OCaml value describing the internal structure of the domain and identifying it. This structure enables automatic accessors to the domain when combined to others. See {!Structure} for details. {!S_with_Structure} is the interface to implement in order to introduce a now domain in Eva. The module type {!Internal} contains some other functionalities needed by the analyzer, but that can be automatically generated from the previous one. The functor {!Domain_builder.Complete} produces an {!Internal} module from a {!S_with_Structure} one. {!Internal} modules can then be lifted on more general values and locations through {!Domain_lift.Make}, and be combined through {!Domain_product.Make}. Finally, {!External} is the type of the final modules built and used by Eva. It contains the generic accessors to specific domains, described in {!Interface}. *) (* The types of the Cil AST. *) open Cil_types (* Definition of the types frequently used in Eva. *) open Eval (** Lattice structure of a domain. *) module type Lattice = sig type state val top: state (** Greatest element. *) val is_included: state -> state -> bool (** Inclusion test. *) val join: state -> state -> state (** Semi-lattice structure. *) val widen: kernel_function -> stmt -> state -> state -> state (** [widen h t1 t2] is an over-approximation of [join t1 t2]. Assumes [is_included t1 t2] *) val narrow: state -> state -> state or_bottom (** Over-approximation of the intersection of two abstract states (called meet in the literature). Used only to gain some precision when interpreting the complete behaviors of a function specification. Can be very imprecise without impeding the analysis: [meet x y = `Value x] is always sound. *) end (** Extraction of information: queries for values or locations inferred by a domain about expressions and lvalues. Used in the evaluation of expressions and lvalues. *) module type Queries = sig type state (** Domain state. *) type value (** Numerical values to which the expressions are evaluated. *) type location (** Abstract memory locations associated to left values. *) (** The [origin] is used by the domain combiners to track the origin of a value. An abstract domain can always use a dummy type unit for origin, or use it to encode some specific information about a value. *) type origin (** Queries functions return a pair of: - the set of alarms that ensures the of the soundness of the evaluation of [exp]. [Alarmset.all] is always a sound over-approximation of these alarms. - a value for the expression, which can be: – `Bottom if its evaluation is infeasible; – `Value (v, o) where [v] is an over-approximation of the abstract value of the expression [exp], and [o] is the origin of the value. *) (** Query function for compound expressions: [eval oracle t exp] returns the known value of [exp] by the state [t]. [oracle] is an evaluation function and can be used to find the answer by evaluating some others expressions, especially by relational domain. No recursive evaluation should be done by this function. *) val extract_expr : (exp -> value evaluated) -> state -> exp -> (value * origin) evaluated (** Query function for lvalues: [find oracle t lval typ loc] returns the known value stored at the location [loc] of the left value [lval] of type [typ]. *) val extract_lval : (exp -> value evaluated) -> state -> lval -> typ -> location -> (value * origin) evaluated (** [backward_location state lval typ loc v] reduces the location [loc] of the lvalue [lval] of type [typ], so that only the locations that may have value [v] are kept. The returned location must be included in [loc], but it is always sound to return [loc] itself. Also returns the value that may have the returned location, if not bottom. *) val backward_location : state -> lval -> typ -> location -> value -> (location * value) or_bottom (** Given a reduction [expr] = [value], provides more reductions that may be performed. *) val reduce_further : state -> exp -> value -> (exp * value) list end (** Results of an evaluation: the results of all intermediate calculation (the value of each expression and the location of each lvalue) are cached in a map. *) module type Valuation = sig type t type value (** Abstract value. *) type origin (** Origin of abstract values. *) type loc (** Abstract memory location. *) val find : t -> exp -> (value, origin) record_val or_top val fold : (exp -> (value, origin) record_val -> 'a -> 'a) -> t -> 'a -> 'a val find_loc : t -> lval -> loc record_loc or_top end (** Transfer function of the domain. *) module type Transfer = sig type state type value type location type valuation (** [update valuation t] updates the state [t] by the values of expressions and the locations of lvalues stored in [valuation]. *) val update : valuation -> state -> state or_bottom (** [assign kinstr lv expr v valuation state] is the transfer function for the assignment [lv = expr] for [state]. It must return the state where the assignment has been performed. - [kinstr] is the statement of the assignment, or Kglobal for the initialization of a global variable. - when the kinstr is a function call, [expr] is the special variable in [!Eval.call.return]. - [v] carries the value being assigned to [lv], i.e. the value of the expression [expr]. [v] also denotes the kind of assignment: Assign for the default assignment of the value, or Copy for the exact copy of a location if the right expression [expr] is a lvalue. - [valuation] is a cache of all sub-expressions and locations computed for the evaluation of [lval] and [expr]; it can also be used to reduce the state. *) val assign : kinstr -> location left_value -> exp -> (location, value) assigned -> valuation -> state -> state or_bottom (** Transfer function for an assumption. [assume stmt expr bool valuation state] returns a state in which the boolean expression [expr] evaluates to [bool]. - [stmt] is the statement of the assumption. - [valuation] is a cache of all sub-expressions and locations computed for the evaluation and the reduction of [expr]; it can also be used to reduce the state *) val assume : stmt -> exp -> bool -> valuation -> state -> state or_bottom (** [start_call stmt call valuation state] returns an initial state for the analysis of a called function. In particular, this function should introduce the formal parameters in the state, if necessary. - [stmt] is the statement of the call site; - [call] represents the call: the called function and the arguments; - [state] is the abstract state at the call site, before the call; - [valuation] is a cache for all values and locations computed during the evaluation of the function and its arguments. *) val start_call: stmt -> (location, value) call -> valuation -> state -> state or_bottom (** [finalize_call stmt call ~pre ~post] computes the state after a function call, given the state [pre] before the call, and the state [post] at the end of the called function. - [stmt] is the statement of the call site; - [call] represents the function call and its arguments. - [pre] and [post] are the states before and at the end of the call respectively. *) val finalize_call: stmt -> (location, value) call -> pre:state -> post:state -> state or_bottom (** Called on the Frama_C_show_each directives. Prints the internal properties inferred by the domain in the [state] about the expression [exp]. Can use the [valuation] resulting from the cooperative evaluation of the expression. *) val show_expr: valuation -> state -> Format.formatter -> exp -> unit end (** Environment for the logical evaluation of predicates. *) type 'state logic_environment = { (** The logic can refer to the states at other points of the program using labels. [states] associates a state (which can be top) to each label. *) states: logic_label -> 'state; (** [result] contains the variable corresponding to \result. It is None when \result is meaningless. *) result: varinfo option; } (** Value for the initialization of variables. Can be either zero or top. *) type init_value = Zero | Top (* Kind of variable being initialized by initialize_variable_using_type. *) type init_kind = Main_Formal | Library_Global | Spec_Return of kernel_function (** MemExec is a global cache for the complete analysis of functions. It avoids repeating the analysis of a function in equivalent entry states. It uses an over-approximation of the locations possibly read and written by a function, and compare the entry states for these locations. *) module type Recycle = sig type t (** Type of states. *) (** [relate kf bases state] returns the set of bases [bases] in relation with [bases] in [state] — i.e. all bases other than [bases] whose value may affect the properties inferred on [bases] in [state]. [state] is the initial state of an analysis of [kf]. For a non-relational domain, it is always safe to return [empty]. For a relational domain, it is always safe to return [top], but it disables MemExec. *) val relate: kernel_function -> Base.Hptset.t -> t -> Base.SetLattice.t (** [filter kf kind bases states] reduces the state [state] to only keep properties about [bases] — it is a projection on the set of [bases]. It allows reusing an analysis of [kf] from an initial state [pre] to a final state [post]. If [kind] is `Pre, [state] is the initial state [pre], and [bases] includes all inputs of [kf] and satisfies [relate kf bases state = bases]. If [kind] is `Post, [state] is the final state [post], and [bases] includes all inputs and outputs of [kf]. Afterwards, the two resulting states [reduced_pre] and [reduced_post] are used as follow: when [kf] should be analyzed with the initial state [s], if [filter kf `Pre s = reduced_pre], then the analysis is skipped, and [reuse kf s reduced_post] is used as its final state instead. *) val filter: kernel_function -> [`Pre | `Post] -> Base.Hptset.t -> t -> t (** [reuse kf bases current_input previous_output] merges the initial state [current_input] with a final state [previous_output] from a previous analysis of [kf] started with an equivalent initial state. [reuse] must overwrite the properties on [bases] in [current_input] with the ones in [previous_output]. Properties on other bases must be left unchanged from [current_input]. *) val reuse: kernel_function -> Base.Hptset.t -> current_input:t -> previous_output:t -> t (** The simplest implementation of [filter] and [reuse] is: let filter _ _ _ state = state let reuse _ _ ~current_input:_ ~previous_output = previous_output This is correct as the cache will be triggered only for an initial state exactly equal to the previous initial state, in which case the previous output state is indeed a correct final state on its own. *) end (** Signature for the abstract domains of the analysis. *) module type S = sig type state include Datatype.S_with_collections with type t = state (** {3 Lattice Structure } *) include Lattice with type state := t (** {3 Queries } *) include Queries with type state := t (** {3 Transfer Functions } *) (** Transfer functions from the result of evaluations. See {eval.mli} for more details about valuation. *) module Transfer (Valuation: Valuation with type value = value and type origin = origin and type loc = location) : Transfer with type state := t and type value := value and type location := location and type valuation := Valuation.t (** {3 Logic } *) (** Logical evaluation. This API is subject to changes. *) (* TODO: cooperative evaluation of predicates in the engine. *) (** [logic_assign from loc_asgn pre state] applies the effect of the [assigns ... \from ...] clause [from] to [state]. [pre] is the state before the assign clauses, in which the terms of the clause are evaluated. [loc_asgn] is the result of the evaluation of the [assigns] part of [from] in [pre]. *) val logic_assign: logic_assign -> location -> pre:state -> state -> state (** Evaluates a [predicate] to a logical status in the current [state]. The [logic_environment] contains the states at some labels and the potential variable for \result. *) val evaluate_predicate: state logic_environment -> state -> predicate -> Alarmset.status (** [reduce_by_predicate env state pred b] reduces the current [state] by assuming that the predicate [pred] evaluates to [b]. [env] contains the states at some labels and the potential variable for \result. *) val reduce_by_predicate: state logic_environment -> state -> predicate -> bool -> state or_bottom (** {3 Miscellaneous } *) (** Scoping: abstract transformers for entering and exiting blocks. [kf] is the englobing function, and the variables of the list [vars] should be added or removed from the abstract state here. Note that the formals of a function enter the scope through the transfer function {!Transfer.start_call}, but leave it through a call to {!leave_scope}. *) val enter_scope: kernel_function -> varinfo list -> t -> t val leave_scope: kernel_function -> varinfo list -> t -> t val enter_loop: stmt -> state -> state val incr_loop_counter: stmt -> state -> state val leave_loop: stmt -> state -> state (** Initialization *) (** The initial state with which the analysis start. *) val empty: unit -> t (** Introduces the list of global variables in the state. At this point, these variables are uninitialized: they will be initialized through the two functions below.*) val introduce_globals: varinfo list -> t -> t (** [initialize_variable lval loc ~initialized init_value state] initializes the value of the location [loc] of lvalue [lval] in [state] with: – bits 0 if init_value = Zero; – any bits if init_value = Top. The boolean initialized is true if the location is initialized, and false if the location may be not initialized. *) val initialize_variable: lval -> location -> initialized:bool -> init_value -> t -> t (** Initializes a variable according to its type. TODO: move some parts of the cvalue implementation of this function in the generic engine. *) val initialize_variable_using_type: init_kind -> varinfo -> t -> t include Recycle with type t := t (** Category for the messages about the domain. Must be created through {!Value_parameters.register_category}. *) val log_category : Value_parameters.category end (** Automatic storage of the states computed during the analysis. *) module type Store = sig type state val register_global_state: state or_bottom -> unit val register_initial_state: Value_types.callstack -> state -> unit val register_state_before_stmt: Value_types.callstack -> stmt -> state -> unit val register_state_after_stmt: Value_types.callstack -> stmt -> state -> unit (** Allows accessing the states inferred by an Eva analysis after it has been computed with the domain enabled. *) val get_global_state: unit -> state or_bottom val get_initial_state: kernel_function -> state or_bottom val get_initial_state_by_callstack: kernel_function -> state Value_types.Callstack.Hashtbl.t or_top_or_bottom val get_stmt_state: after:bool -> stmt -> state or_bottom val get_stmt_state_by_callstack: after:bool -> stmt -> state Value_types.Callstack.Hashtbl.t or_top_or_bottom end (** Full implementation of domains. Automatically built by {!Domain_builder.Complete} from an {!S_with_Structure} domain. *) module type Internal = sig include S module Store: Store with type state := state (** This function is called after the analysis. The argument is the state computed at the return statement of the main function. The function can also access all states stored in the Store module during the analysis. If the analysis aborted, this function is not called. *) val post_analysis: t or_bottom -> unit end type 't key = 't Structure.Key_Domain.key (** Signature for a leaf module of a domain. *) module type Leaf = sig include Internal (** The key identifies the domain and the type [t] of its states. *) val key: t key end (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/apron/�����������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017350� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/apron/apron_domain.ml��������������������������������0000666�0000000�0000000�00000070267�13571573400�022364� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval open Apron let dkey = Value_parameters.register_category "d-apron" let debug = false let abort exclog = let open Manager in Value_parameters.fatal "Apron manager error : %a in function %a.@.%s" print_exc exclog.exn print_funid exclog.funid exclog.msg let is_relevant_varinfo varinfo = not (Cil.typeHasQualifier "volatile" varinfo.vtype) && (true || not varinfo.vglob) let is_relevant_lval = function | Var varinfo, NoOffset -> is_relevant_varinfo varinfo | _ -> false let rec contains_relevant_lval expr = match expr.enode with | Lval lval -> is_relevant_lval lval | UnOp (_, e, _) | CastE (_, e) -> contains_relevant_lval e | BinOp (_, e1, e2, _) -> contains_relevant_lval e1 || contains_relevant_lval e2 | _ -> false let is_relevant expr = match expr.enode with | Lval _ -> true | UnOp (_, e, _) | CastE (_, e) -> contains_relevant_lval e | BinOp (_, e1, e2, _) -> contains_relevant_lval e1 && contains_relevant_lval e2 | _ -> false (** All conversion functions may fail with this exception. *) exception Out_of_Scope of string (* -------------------------------------------------------------------------- *) (* Conversion of integers *) (* -------------------------------------------------------------------------- *) (* Apron Scalar to Apron integer. *) let scalar_to_mpzf = function | Scalar.Mpqf rational -> let num, den = Mpqf.to_mpzf2 rational in if Mpzf.cmp_int den 1 = 0 then num else raise (Out_of_Scope "scalar_to_mpzf rational") | Scalar.Float _ | Scalar.Mpfrf _ -> raise (Out_of_Scope "scalar_to_mpzf non integer") let scalar_to_int s = if Scalar.is_infty s <> 0 then None else match s with | Scalar.Mpqf q -> (* TODO: extract to Integer directly, without intermediate smaller type *) let i = int_of_float (Mpqf.to_float q) in if Scalar.equal_int s i then Some i else raise (Out_of_Scope "scalar_to_int rational") | Scalar.Float _ | Scalar.Mpfrf _-> raise (Out_of_Scope "scalar_to_int non_integer") (* -------------------------------------------------------------------------- *) (* Translation of the AST from Cil to Apron *) (* -------------------------------------------------------------------------- *) (* Rounding mode used in the file. [Rnd] corresponds to rounding in all directions. Only useful for floating-point values. *) let round = Texpr1.Rnd type integer_range = Eval_typ.integer_range = { i_bits: int; i_signed: bool } let bounds_of_typ range = let bitsize = range.i_bits in let size = Mpz.init () in Mpz.ui_pow_ui size 2 bitsize; let size = Mpzf.of_mpz size in if range.i_signed then let half = Mpz.init () in Mpz.ui_pow_ui half 2 (bitsize - 1); let half = Mpzf.of_mpz half in Mpzf.neg half, Mpzf.sub_int half 1, size else Mpzf.of_int 0, Mpzf.sub_int size 1, size (* Mapping from the names of the Apron variables to their range *) module VarRanges = State_builder.Hashtbl(Datatype.String.Hashtbl)(Eval_typ.DatatypeIntegerRange) (struct let name = "Value.Apron_domain.VarRanges" let dependencies = [Ast.self] (* through the varinfos names and ids *) let size = 32 end) (* is [expr] guaranteed to (statically) fit within [range] *) let expr_fits_in_range (expr: Apron.Texpr1.expr) range = let open Apron.Texpr1 in match expr with | Var v -> let name = Apron.Var.to_string v in let range_v = VarRanges.find name in Eval_typ.range_inclusion range_v range | Cst _ | Unop (_,_,_,_) | Binop (_,_,_,_,_) -> false (* TODO? Unclear whether those cases would add expressivity. *) (* Auxiliary function for {!coerce} below. It normalizes [expr] in an expression that is guaranteed to fit within the integer type [range], or returns an interval covering the entire range. Algorithm from Verasco. See section 6.5 of the paper 'A Formally-Verified C Static Analyzer'. *) let reduce eval expr range = if expr_fits_in_range expr range then expr else let interval = eval expr in if Interval.is_bottom interval then expr else let inf, sup, size = bounds_of_typ range in let top () = let coeff = Coeff.i_of_mpqf (Mpqf.of_mpz inf) (Mpqf.of_mpz sup) in Texpr1.Cst coeff in (* top intervals have bounds [-1/0; 1/0], standing for [-infty, +infty]. Since the denominator is not 1, the translation will fail later in [scalar_to_mpzf]. Thus we should catch this case here. *) if Interval.is_top interval then begin if debug then Value_parameters.result ~current:true ~once:true "imprecise expr %a" Apron.Texpr1.print_expr expr; top () end else try let min = scalar_to_mpzf interval.Interval.inf and max = scalar_to_mpzf interval.Interval.sup in if Mpzf.cmp (Mpzf.sub min max) size >= 0 then top () (* [expr] covers more than [size]. Give up *) else (* [factor*size] is the amount by which we must shift [expr] *) let factor = Mpzf.fdiv_q (Mpzf.sub min inf) size in let shift = Mpzf.mul factor size in if Mpzf.cmp (Mpzf.sub max shift) sup > 0 then top () (* [expr] overlaps on two ranges of [size] size. Give up. *) else if Mpzf.cmp_int factor 0 = 0 then expr (* Optimization *) else let coeff = Coeff.s_of_mpqf (Mpqf.of_mpz shift) in let e_coeff = Texpr1.Cst coeff in Texpr1.Binop (Texpr1.Sub, expr, e_coeff, Texpr1.Int, round) with Out_of_memory -> top () (* [coerce eval typ texpr] returns a normalized apron expression [e] such that its evaluation in the mathematical world and its evaluation with machine number are equivalent. [eval] is the mathematical evaluation function. If overflows are not allowed for the type [typ], then [texpr = e]. *) let coerce ?(cast=false) eval typ texpr = match Cil.unrollType typ with | TInt (ikind, attrs) | TEnum ({ ekind = ikind}, attrs) -> let signed = Cil.isSigned ikind in if not cast && ((signed && Kernel.SignedOverflow.get ()) || ((not signed) && Kernel.UnsignedOverflow.get ())) then texpr else let range = Eval_typ.ik_attrs_range ikind attrs in reduce eval texpr range | _ -> raise (Out_of_Scope "coerce not integer") let translate_typ typ = match Cil.unrollType typ with | TInt _ | TEnum _ -> Texpr1.Int | _ -> raise (Out_of_Scope "translate_typ not int") let translate_binop = function | PlusA -> Texpr1.Add | MinusA -> Texpr1.Sub | Mult -> Texpr1.Mul | Div -> Texpr1.Div | Mod -> Texpr1.Mod | _ -> raise (Out_of_Scope "translate_binop unhandled") let translate_relation expr typ = let open Abstract_interp.Comp in function | Le -> let expr = Texpr1.unop Texpr1.Neg expr typ round in Tcons1.make expr Tcons1.SUPEQ | Lt -> let expr = Texpr1.unop Texpr1.Neg expr typ round in Tcons1.make expr Tcons1.SUP | Ge -> Tcons1.make expr Tcons1.SUPEQ | Gt -> Tcons1.make expr Tcons1.SUP | Eq -> Tcons1.make expr Tcons1.EQ | Ne -> Tcons1.make expr Tcons1.DISEQ let translate_varinfo varinfo = if not (is_relevant_varinfo varinfo) then raise (Out_of_Scope "translate_varinfo irrelevant") else match Cil.unrollType varinfo.vtype with | TInt (ik, _) | TEnum ({ekind=ik}, _) -> let id = "_" ^ string_of_int varinfo.vid in let name = varinfo.vname ^ id in let var = Var.of_string name in if not (VarRanges.mem name) then VarRanges.replace name (Eval_typ.ik_range ik); var | _ -> raise (Out_of_Scope "translate_varinfo not integer") let translate_lval = function | Var varinfo, NoOffset -> translate_varinfo varinfo | _ -> raise (Out_of_Scope "translate_lval not Var") let translate_constant = function | CInt64 (i, _, _) -> begin try Coeff.s_of_int (Integer.to_int i) (* TODO: skip OCaml int type *) with Z.Overflow | Failure _ -> raise (Out_of_Scope "translate_constant big int") end | _ -> raise (Out_of_Scope "translate_constant not integer") (* Translation of expressions from cil to apron. *) let rec translate_expr eval oracle expr = match expr.enode with | Const cst -> Texpr1.Cst (translate_constant cst) | Lval lval -> Texpr1.Var (translate_lval lval) | UnOp (Neg, e1, typ) -> let e1' = translate_expr_linearize eval oracle e1 in Texpr1.(Unop (Neg, e1', translate_typ typ, round)) | UnOp ((BNot | LNot), _, _) -> raise (Out_of_Scope "translate_expr bitwise unop") | BinOp (op, e1, e2, typ) -> let e1' = translate_expr_linearize eval oracle e1 in let e2' = translate_expr_linearize eval oracle e2 in let need_coercion = op = Mod || op = Div in let e1' = if need_coercion then coerce eval (Cil.typeOf e1) e1' else e1' in let e2' = if need_coercion then coerce eval (Cil.typeOf e2) e2' else e2' in let op' = translate_binop op in Texpr1.(Binop (op', e1', e2', translate_typ typ, round)) | CastE (typ, e)-> coerce ~cast:true eval typ (translate_expr_linearize eval oracle e) | Info (e, _) -> translate_expr eval oracle e | AddrOf _ | StartOf _ -> raise (Out_of_Scope "translate_expr addr") | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> match Cil.constFoldToInt expr with | None -> raise (Out_of_Scope "translate_expr sizeof alignof") | Some i -> Texpr1.Cst (Coeff.s_of_int (Integer.to_int i)) (* Expressions that cannot be translated by [translate_expr] are replaced using an oracle. Of course, this oracle must be sound!. If the oracle cannot find a suitable replacement, it can re-raise the expresssion. *) and translate_expr_linearize eval oracle expr = try translate_expr eval oracle expr with Out_of_Scope _ as e -> oracle expr e (* Express a cil expression into an apron constraint. *) let rec constraint_expr eval oracle env expr positive = match expr.enode with | UnOp (LNot, e, _) -> constraint_expr eval oracle env e (not positive) | BinOp ((Le|Ne|Eq|Gt|Lt|Ge as binop), e1, e2, typ) -> let e1' = translate_expr_linearize eval oracle e1 in let e2' = translate_expr_linearize eval oracle e2 in let e1'' = coerce eval (Cil.typeOf e1) e1' in let e2'' = coerce eval (Cil.typeOf e2) e2' in let typ = translate_typ (Cil.unrollType typ) in let e = Texpr1.Binop (Texpr1.Sub, e1'', e2'', typ, round) in let expr = Texpr1.of_expr env e in let binop = Value_util.conv_comp binop in let binop = if positive then binop else Abstract_interp.Comp.inv binop in translate_relation expr typ binop | _ -> raise (Out_of_Scope "constraint_expr not handled") (* Expresses the constraint [expr ∈ interval] as an Apron constraint. *) let constraint_reduction env expr interval = let coeff = Texpr1.Cst (Coeff.Interval interval) in let expr = Texpr1.(Binop (Sub, expr, coeff, Int, round)) in let texpr = Texpr1.of_expr env expr in Tcons1.make texpr Tcons1.EQ let truncate_interval typ interval = match Cil.unrollType typ with | TInt (ikind, attrs) | TEnum ({ ekind = ikind }, attrs) -> let signed = Cil.isSigned ikind in if (signed && not (Kernel.SignedOverflow.get ())) || ((not signed) && not (Kernel.UnsignedOverflow.get ())) then let range = Eval_typ.ik_attrs_range ikind attrs in let inf, sup, _size = bounds_of_typ range in let inf = Scalar.of_mpqf (Mpqf.of_mpz inf) and sup = Scalar.of_mpqf (Mpqf.of_mpz sup) in let min = interval.Interval.inf and max = interval.Interval.sup in let min = if Scalar.cmp min inf < 0 then inf else min and max = if Scalar.cmp max sup > 0 then sup else max in Interval.of_scalar min max else interval | _ -> interval (* TODO: avoid OCaml int type during conversion *) let interval_to_ival interval = let inf = scalar_to_int interval.Interval.inf and sup = scalar_to_int interval.Interval.sup in let inf = Extlib.opt_map Integer.of_int inf and sup = Extlib.opt_map Integer.of_int sup in Some (Ival.inject_range inf sup) let int_to_scalar positive = function | None -> Scalar.of_infty positive | Some integer -> Scalar.of_mpqf (Mpqf.of_string (Integer.to_string integer)) let ival_to_interval = function | None -> Interval.top | Some ival -> let min, max = Ival.min_and_max ival in let min = int_to_scalar (-1) min and max = int_to_scalar 1 max in Interval.of_scalar min max (* -------------------------------------------------------------------------- *) (* Abstract Domain Functor *) (* -------------------------------------------------------------------------- *) module type Input = sig type t val manager: t Manager.t val name: string end module Make (Man : Input) = struct type state = Man.t Abstract1.t type value = Main_values.Interval.t type location = Precise_locs.precise_location let man = Man.manager let log_category = dkey let empty_env = Environment.make [||] [||] let top = Abstract1.top man empty_env let make_top env = Abstract1.top man env include Datatype.Make_with_collections ( struct include Datatype.Undefined type t = state let name = Manager.get_library Man.manager let reprs = [top] let structural_descr = Structural_descr.t_unknown (* Abstract1.is_eq raises an error when the environments of the two states are incompatible. *) let equal a b = Environment.equal (Abstract1.env a) (Abstract1.env b) && Abstract1.is_eq man a b let hash = Abstract1.hash man (* BIGTODO: this function is not quite a total order, because [is_leq] is only a partial order. Using the hash as a first comparison is only a doubtful hack. *) let compare a b = if equal a b then 0 else let cmp = compare (hash a) (hash b) in if cmp <> 0 then cmp else if Abstract1.is_leq man a b then 1 else -1 let rehash = Datatype.identity let copy = Abstract1.copy man let pretty = Abstract1.print let mem_project = Datatype.never_any_project end ) let name = Man.name let is_included = Abstract1.is_leq man let join s1 s2 = let env1 = Abstract1.env s1 and env2 = Abstract1.env s2 in if Environment.equal env1 env2 then Abstract1.join man s1 s2 else (* The two states may have different environments only in the joins at the end of a function call, for the recording of one state at each statement. *) let env1 = Abstract1.env s1 and env2 = Abstract1.env s2 in let env = Environment.lce env1 env2 in let s1 = Abstract1.change_environment man s1 env false and s2 = Abstract1.change_environment man s2 env false in Abstract1.join man s1 s2 let widen _kf _stmt s1 s2 = Abstract1.widening man s1 s2 let narrow s1 s2 = let s = Abstract1.meet man s1 s2 in if Abstract1.is_bottom man s then `Bottom else `Value s type origin = unit let make_eval state = let env = Abstract1.env state in fun e -> let texp = Texpr1.of_expr env e in Abstract1.bound_texpr man state texp (* Meet the state with all the constraints. *) let meet_with_constraints env state constraints = let array = Tcons1.array_make env (List.length constraints) in List.iteri (fun i c -> Tcons1.array_set array i c) constraints; let st = Abstract1.meet_tcons_array man state array in if Abstract1.is_bottom man st then `Bottom else `Value st let _constraint_to_typ env state vars = let aux (var_apron, vi) = match Eval_typ.classify_as_scalar vi.vtype with | Some (Eval_typ.TSInt range) -> let inf, sup, _size = bounds_of_typ range in let inf = Scalar.of_mpqf (Mpqf.of_mpz inf) and sup = Scalar.of_mpqf (Mpqf.of_mpz sup) in let interval = Interval.of_scalar inf sup in let e = Texpr1.Var var_apron in constraint_reduction env e interval | _ -> assert false (* variable has been translated, and have int type *) in let constraints = List.map aux vars in meet_with_constraints env state constraints (* Constraining a variable to the bounds of its type does not seem useful anymore. *) let constraint_to_typ _env state _vars = state let dummy_oracle _ exn = raise exn let compute state expr typ = let top = `Value (None, ()), Alarmset.all in if not (is_relevant expr) then top else try let eval = make_eval state in let oracle = dummy_oracle in let exp = coerce eval typ (translate_expr_linearize eval oracle expr) in let interval = eval exp in let interval = truncate_interval typ interval in let value = if Interval.is_bottom interval then `Bottom else `Value (interval_to_ival interval, ()) in (* TODO: remove alarms if computation does not overflow *) value, Alarmset.all with | Out_of_Scope _ -> top (* May happen when evaluating an expression in the GUI, while the states of Apron have not been saved. In this case, we evaluate in the top apron state, whose environment raises the Failure exception. *) | Z.Overflow | Failure _ -> top let extract_expr _oracle state expr = compute state expr (Cil.typeOf expr) let extract_lval _oracle state lval typ _loc = let expr = Value_util.lval_to_exp lval in compute state expr typ let reduce_further _ _ _ = [] let backward_location _state _lv _typ loc value = `Value (loc, value) let maybe_bottom state = if Abstract1.is_bottom man state then `Bottom else `Value state let forget_varinfo_list ~remove vars state = let env = state.Abstract1.env in let filter acc varinfo = try let apron_var = translate_varinfo varinfo in if Environment.mem_var env apron_var then (apron_var, varinfo) :: acc else acc with Out_of_Scope _ -> acc in let ok_vars = List.fold_left filter [] vars in let vars = Array.of_list (List.map fst ok_vars) in let state = Abstract1.forget_array man state vars false in if remove then let env = Environment.remove (Abstract1.env state) vars in Abstract1.change_environment man state env false else constraint_to_typ env state ok_vars let kill_bases loc state = let aux_ploc loc state = let bases = Locations.Location_Bits.get_bases loc.Locations.loc in match bases with | Base.SetLattice.Set set -> let var_of_base base acc = try (Base.to_varinfo base) :: acc with Base.Not_a_C_variable -> acc in let vars = Base.Hptset.fold var_of_base set [] in forget_varinfo_list ~remove:false vars state | Base.SetLattice.Top -> make_top (Abstract1.env state) in Precise_locs.fold aux_ploc loc state let enter_scope vars state = let translate acc varinfo = try translate_varinfo varinfo :: acc with Out_of_Scope _ -> acc in let vars = List.fold_left translate [] vars in let env = Environment.add (Abstract1.env state) (Array.of_list vars) [||] in Abstract1.change_environment man state env false let leave_scope _kf vars state = forget_varinfo_list ~remove:true vars state let enter_loop _ state = state let incr_loop_counter _ state = state let leave_loop _ state = state module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type loc = location) = struct (* make an oracle for the translation Cil->Apron, using the valuation. Translate integer expressions that have been evaluated (which should be all of them if the translation is called on a source expression!) into Apron intervals. *) let make_oracle valuation = fun exp exn -> if Cil.isIntegralType (Cil.typeOf exp) then match Valuation.find valuation exp with | `Value { value = { v = `Value itv } } -> let interval = ival_to_interval itv in Texpr1.Cst (Coeff.Interval interval) | _ -> raise exn else raise exn let update valuation state = let eval = make_eval state in let oracle = make_oracle valuation in let env = Abstract1.env state in (* Makes a list of apron constraints from a valuation: for each value marked as Reduced for an expression, creates the apron constraint [expression = value]. *) let gather_constraints exp record acc = if record.reductness = Reduced then try let expr = translate_expr_linearize eval oracle exp in let expr = coerce eval (Cil.typeOf exp) expr in (* When the value is top or bottom, no constraint is expressible. *) let cons = record.value.v >>- fun ival -> let interval = ival_to_interval ival in if Interval.is_top interval then `Bottom else `Value (constraint_reduction env expr interval) in Bottom.add_to_list cons acc with Out_of_Scope _ -> acc else acc in let constraints = Valuation.fold gather_constraints valuation [] in if constraints = [] then `Value state else meet_with_constraints env state constraints let assign _stmt lvalue expr _value valuation state = update valuation state >>- fun state -> try let state = try let eval = make_eval state in let oracle = make_oracle valuation in let var = translate_lval lvalue.lval in let expr = expr in let exp = translate_expr_linearize eval oracle expr in let exp = coerce eval lvalue.ltyp exp in let exp = Texpr1.of_expr (Abstract1.env state) exp in (* TODO: currently, all variables are present in the environment at all times. Change to a dynamic environment, in which new variables are added here, and removed when the scope changes. *) Abstract1.assign_texpr man state var exp None with | Out_of_Scope _ -> kill_bases lvalue.lloc state in maybe_bottom state with Manager.Error exclog -> abort exclog let assume _stmt exp bool valuation state = update valuation state >>- fun state -> try let env = Abstract1.env state in let eval = make_eval state in let oracle = make_oracle valuation in let cons = constraint_expr eval oracle env exp bool in let array = Tcons1.array_make env 1 in Tcons1.array_set array 0 cons; let state = Abstract1.meet_tcons_array man state array in maybe_bottom state with | Out_of_Scope _ -> `Value state let start_call _stmt call valuation state = update valuation state >>- fun state -> let eval = make_eval state in let oracle = make_oracle valuation in let process_argument (vars, acc) arg = try let env = Abstract1.env state in let var = translate_varinfo arg.formal in let vars = var :: vars in let acc = try let exp = translate_expr_linearize eval oracle arg.concrete in let texp = Texpr1.of_expr env exp in (var, texp) :: acc with Out_of_Scope _ -> acc in vars, acc with | Out_of_Scope _ -> (vars, acc) in let vars, list = List.fold_left process_argument ([], []) call.arguments in let env = Abstract1.env state in let vars_array = Array.of_list vars in let env = Environment.add env vars_array [||] in let vars, texprs = List.split list in let vars_array = Array.of_list vars and texprs_array = Array.of_list texprs in let state = Abstract1.change_environment man state env false in let state = Abstract1.assign_texpr_array man state vars_array texprs_array None in if Abstract1.is_bottom man state then `Bottom else `Value state let finalize_call _stmt _call ~pre:_ ~post = `Value post let show_expr _valuation _state _fmt _expr = () end let logic_assign _assigns location ~pre:_ state = kill_bases location state let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ state _ _ = `Value state let empty () = top let introduce_globals vars state = enter_scope vars state let enter_scope _kf vars state = enter_scope vars state let initialize_variable _lval _loc ~initialized:_ _init_value state = state let initialize_variable_using_type _kind varinfo state = try let var = translate_varinfo varinfo in let env = Abstract1.env state in if Environment.mem_var env var then state else let env = Environment.add env [|var|] [||] in let state = Abstract1.change_environment man state env false in constraint_to_typ env state [(var, varinfo)] with | Out_of_Scope _ -> state let relate _ _ _ = Base.SetLattice.top let filter _ _ _ state = state let reuse _ _ ~current_input:_ ~previous_output = previous_output let storage = Value_parameters.ApronStorage.get end module Apron_Octagon = struct type t = Oct.t let manager = Oct.manager_alloc () let name = "Apron octagon domain" end module Apron_Box = struct type t = Box.t let manager = Box.manager_alloc () let name = "Apron box domain" end module Apron_Polka_Loose = struct type t = Polka.loose Polka.t let manager = Polka.manager_alloc_loose () let name = "Polka loose polyhedra domain" end module Apron_Polka_Strict = struct type t = Polka.strict Polka.t let manager = Polka.manager_alloc_strict () let name = "Polka strict polyhedra domain" end module Apron_Polka_Equalities = struct type t = Polka.equalities Polka.t let manager = Polka.manager_alloc_equalities () let name = "Polka linear equalities domain" end (** Apron manager allocation changes the rounding mode. *) let () = Floating_point.set_round_nearest_even () let make name enable (module Man: Input) = let module Domain = Domain_builder.Complete (Make (Man)) in let open Abstractions in register ~enable { name; priority = 1; values = Single (module Main_values.Interval); domain = Domain (module Domain); } let () = let open Value_parameters in make "apron octagons" ApronOctagon.get (module Apron_Octagon); make "apron box" ApronBox.get (module Apron_Box); make "polka loose" PolkaLoose.get (module Apron_Polka_Loose); make "polka strict" PolkaStrict.get (module Apron_Polka_Strict); make "polka equalities" PolkaEqualities.get (module Apron_Polka_Equalities); register_apron () (* Local Variables: compile-command: "make -C ../../../../.. -j" End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/apron/apron_domain.mli�������������������������������0000666�0000000�0000000�00000003540�13571573400�022523� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Experimental binding for the numerical abstract domains provided by the APRON library: http://apron.cri.ensmp.fr/library For now, this binding only processes scalar integer variables. *) (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/����������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017510� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins.ml�����������������������������������0000666�0000000�0000000�00000023276�13571573400�021705� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cvalue exception Invalid_nb_of_args of int (* 'Always' means the builtin will always be used to replace a function with its name. 'OnAuto' means that the function will be replaced only if -val-builtins-auto is set. *) type use_builtin = Always | OnAuto let table = Hashtbl.create 17 let register_builtin name ?replace f = Hashtbl.replace table name (f, None, Always); match replace with | None -> () | Some fname -> Hashtbl.replace table fname (f, Some name, OnAuto) let () = Db.Value.register_builtin := register_builtin (* The functions in _builtin must only return the 'Always' builtins *) let registered_builtins () = let l = Hashtbl.fold (fun name (f, _, u) acc -> if u = Always then (name, f) :: acc else acc) table [] in List.sort (fun (name1, _) (name2, _) -> String.compare name1 name2) l let () = Db.Value.registered_builtins := registered_builtins let builtin_names_and_replacements () = let stand_alone, replacements = Hashtbl.fold (fun name (_, replaced_by, _) (acc1, acc2) -> match replaced_by with | None -> name :: acc1, acc2 | Some rep_by -> acc1, (name, rep_by) :: acc2 ) table ([], []) in List.sort String.compare stand_alone, List.sort (fun (name1, _) (name2, _) -> String.compare name1 name2) replacements let () = Cmdline.run_after_configuring_stage (fun () -> if Value_parameters.BuiltinsList.get () then begin let stand_alone, replacements = builtin_names_and_replacements () in Log.print_on_output (fun fmt -> Format.fprintf fmt "@[*** LIST OF EVA BUILTINS@\n@\n\ ** Replacements set by -val-builtins-auto:\ @\n unless otherwise specified, \ function <f> is replaced by builtin \ Frama_C_<f>:@\n@\n @[%a@]@]@\n" (Pretty_utils.pp_list ~sep:",@ " (fun fmt (name, rep_by) -> if rep_by = "Frama_C_" ^ name then Format.fprintf fmt "%s" name else Format.fprintf fmt "%s (replaced by: %s)" name rep_by)) replacements); Log.print_on_output (fun fmt -> Format.fprintf fmt "@\n@[** Full list of builtins \ (configurable via -val-builtin):@\n\ @\n @[%a@]@]@\n" (Pretty_utils.pp_list ~sep:",@ " Format.pp_print_string) stand_alone); raise Cmdline.Exit end) let mem_builtin name = try let _, _, u = Hashtbl.find table name in u = Always with Not_found -> false let () = Db.Value.mem_builtin := mem_builtin (* Returns the builtin with its specification, used to evaluate preconditions and to transfer the states of other domains. *) let find_builtin_specification kf = let spec = Annotations.funspec kf in (* The specification can be empty if [kf] has a body but no specification, in which case [Annotations.funspec] does not generate a specification. TODO: check that the specification is the frama-c libc specification? *) if spec.spec_behavior <> [] then Some spec else None let find_builtin_override kf = let name = try Value_parameters.BuiltinsOverrides.find kf with Not_found -> Kernel_function.get_name kf in try let f, _, u = Hashtbl.find table name in if u = Always || Value_parameters.BuiltinsAuto.get () then Extlib.opt_map (fun s -> name, f, s) (find_builtin_specification kf) else None with Not_found -> None let warn_builtin_override bname kf = let source = fst (Kernel_function.get_location kf) in if find_builtin_specification kf = None then Value_parameters.warning ~source ~once:true ~wkey:Value_parameters.wkey_builtins_missing_spec "The builtin for function %a will not be used, as its frama-c libc \ specification is not available." Kernel_function.pretty kf else let internal = let pos = fst (Kernel_function.get_location kf) in (*TODO: treat this 'internal'*) let file = pos.Filepath.pos_path in Filepath.is_relative ~base_name:Config.datadir (file :> string) in if Kernel_function.is_definition kf && not internal then let fname = Kernel_function.get_name kf in Value_parameters.warning ~source ~once:true ~wkey:Value_parameters.wkey_builtins_override "function %s: definition will be overridden by %s" fname (if fname = bname then "its builtin" else "builtin " ^ bname) let warn_definitions_overridden_by_builtins () = Value_parameters.BuiltinsOverrides.iter (fun (kf, name) -> warn_builtin_override (Extlib.the name) kf); let autobuiltins = Value_parameters.BuiltinsAuto.get () in Hashtbl.iter (fun name (_, _, u) -> if autobuiltins || u = Always then try let kf = Globals.Functions.find_by_name name in warn_builtin_override name kf with Not_found -> ()) table (* -------------------------------------------------------------------------- *) (* --- Returning a clobbered set --- *) (* -------------------------------------------------------------------------- *) let clobbered_set_from_ret state ret = let aux b _ acc = match Model.find_base_or_default b state with | `Top -> Base.SetLattice.top | `Bottom -> acc | `Value m -> if Locals_scoping.offsetmap_contains_local m then Base.SetLattice.(join (inject_singleton b) acc) else acc in try V.fold_topset_ok aux ret Base.SetLattice.bottom with Abstract_interp.Error_Top -> Base.SetLattice.top (* -------------------------------------------------------------------------- *) (* --- Applying a builtin --- *) (* -------------------------------------------------------------------------- *) type call = (Precise_locs.precise_location, Cvalue.V.t) Eval.call type result = Cvalue.Model.t * Locals_scoping.clobbered_set type builtin = Db.Value.builtin_sig open Eval let unbottomize = function | `Bottom -> Cvalue.V.bottom | `Value v -> v let offsetmap_of_formals state arguments rest = let compute expr assigned = let offsm = Cvalue_offsetmap.offsetmap_of_assignment state expr assigned in let value = unbottomize (Eval.value_assigned assigned) in expr, value, offsm in let treat_one_formal arg = compute arg.concrete arg.avalue in let treat_one_rest (exp, v) = compute exp v in let list = List.map treat_one_formal arguments in let rest = List.map treat_one_rest rest in list @ rest let compute_builtin name builtin state actuals = try builtin state actuals with | Invalid_nb_of_args n -> Value_parameters.error ~current:true "Invalid number of arguments for builtin %s: %d expected, %d found" name n (List.length actuals); raise Db.Value.Aborted | Db.Value.Outside_builtin_possibilities -> Value_parameters.warning ~once:true ~current:true "Call to builtin %s failed, aborting." name; raise Db.Value.Aborted let apply_builtin builtin call state = let name = Kernel_function.get_name call.kf in let actuals = offsetmap_of_formals state call.arguments call.rest in let res = compute_builtin name builtin state actuals in let call_stack = Value_util.call_stack () in Db.Value.Call_Type_Value_Callbacks.apply (`Builtin res, state, call_stack); let clob = Locals_scoping.bottom () in Locals_scoping.remember_bases_with_locals clob res.Value_types.c_clobbered; let process_one_return acc (ret, post_state) = if Cvalue.Model.is_reachable post_state then let state = match ret, call.return with | Some offsm_ret, Some vi_ret -> let b_ret = Base.of_varinfo vi_ret in Cvalue.Model.add_base b_ret offsm_ret post_state | _, _ -> post_state in (state, clob) :: acc else acc in let list = List.fold_left process_one_return [] res.Value_types.c_values in list, res.Value_types.c_cacheable (* Local Variables: compile-command: "make -C ../../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins.mli����������������������������������0000666�0000000�0000000�00000006175�13571573400�022055� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Value analysis builtin shipped with Frama-C, more efficient than their equivalent in C *) exception Invalid_nb_of_args of int (** Register the given OCaml function as a builtin, that will be used instead of the Cil C function of the same name *) val register_builtin: string -> ?replace:string -> Db.Value.builtin_sig -> unit (** [clobbered_set_from_ret state ret] can be used for functions that return a pointer to where they have written some data. It returns all the bases of [ret] whose contents may contain local variables. *) val clobbered_set_from_ret: Cvalue.Model.t -> Cvalue.V.t -> Base.SetLattice.t (** Emits warnings for each function definition that will be overridden by an Eva built-in. Does not include definitions in the Frama-C stdlib. @since Phosphorus-20170501-beta1 *) val warn_definitions_overridden_by_builtins: unit -> unit type builtin type call = (Precise_locs.precise_location, Cvalue.V.t) Eval.call type result = Cvalue.Model.t * Locals_scoping.clobbered_set (** Returns the cvalue builtin for a function, if any. Also returns the name of the builtin and the specification of the function; the preconditions must be evaluated along with the builtin. *) val find_builtin_override: Cil_types.kernel_function -> (string * builtin * Cil_types.funspec) option (* Applies a cvalue builtin for the given call, in the given cvalue state. *) val apply_builtin: builtin -> call -> Cvalue.Model.t -> result list * Value_types.cacheable (* Local Variables: compile-command: "make -C ../../../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_float.ml�����������������������������0000666�0000000�0000000�00000013232�13571573400�023061� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cvalue let wrap_fk r = function | Cil_types.FFloat -> Eval_op.wrap_float r | Cil_types.FDouble -> Eval_op.wrap_double r | _ -> assert false let restrict_float ~assume_finite fkind value = let truth = Cvalue_forward.assume_not_nan ~assume_finite fkind value in match truth with | `True -> value | `Unknown reduced_value -> reduced_value | `False -> Cvalue.V.bottom | _ -> assert false (* Alarms should be handled by the preconditions of the builtin. This function only removes the forbidden floating-point values. *) let remove_special_float fk value = match Kernel.SpecialFloat.get () with | "none" -> value | "nan" -> restrict_float ~assume_finite:false fk value | "non-finite" -> restrict_float ~assume_finite:true fk value | _ -> assert false let arity2 fk caml_fun state actuals = match actuals with | [_, arg1, _; _, arg2, _] -> begin let r = try let i1 = Cvalue.V.project_ival arg1 in let f1 = Ival.project_float i1 in let i2 = Cvalue.V.project_ival arg2 in let f2 = Ival.project_float i2 in let f' = Cvalue.V.inject_float (caml_fun (Fval.kind fk) f1 f2) in remove_special_float fk f' with Cvalue.V.Not_based_on_null -> Cvalue.V.topify_arith_origin (V.join arg1 arg2) in { Value_types.c_values = if V.is_bottom r then [] else [wrap_fk r fk, state ]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } end | _ -> raise (Builtins.Invalid_nb_of_args 2) let register_arity2 c_name fk f = let name = "Frama_C_" ^ c_name in Builtins.register_builtin name ~replace:c_name (arity2 fk f); ;; let () = let open Fval in register_arity2 "atan2" Cil_types.FDouble atan2; register_arity2 "atan2f" Cil_types.FFloat atan2; register_arity2 "pow" Cil_types.FDouble pow; register_arity2 "powf" Cil_types.FFloat pow; register_arity2 "fmod" Cil_types.FDouble fmod; register_arity2 "fmodf" Cil_types.FFloat fmod; ;; let arity1 name fk caml_fun state actuals = match actuals with | [_, arg, _] -> begin let r = try let i = Cvalue.V.project_ival arg in let f = Ival.project_float i in let f' = Cvalue.V.inject_float (caml_fun (Fval.kind fk) f) in remove_special_float fk f' with | Cvalue.V.Not_based_on_null -> if Cvalue.V.is_bottom arg then begin V.bottom end else begin Value_parameters.result ~once:true ~current:true "function %s applied to address" name; Cvalue.V.topify_arith_origin arg end in { Value_types.c_values = if V.is_bottom r then [] else [wrap_fk r fk, state ]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } end | _ -> raise (Builtins.Invalid_nb_of_args 1) let register_arity1 c_name fk f = let name = "Frama_C_" ^ c_name in Builtins.register_builtin name ~replace:c_name (arity1 name fk f); ;; let () = let open Fval in register_arity1 "cos" Cil_types.FDouble cos; register_arity1 "sin" Cil_types.FDouble sin; register_arity1 "log" Cil_types.FDouble log; register_arity1 "log10" Cil_types.FDouble log10; register_arity1 "exp" Cil_types.FDouble exp; register_arity1 "sqrt" Cil_types.FDouble sqrt; register_arity1 "floor" Cil_types.FDouble floor; register_arity1 "ceil" Cil_types.FDouble ceil; register_arity1 "trunc" Cil_types.FDouble trunc; register_arity1 "round" Cil_types.FDouble fround; register_arity1 "cosf" Cil_types.FFloat cos; register_arity1 "sinf" Cil_types.FFloat sin; register_arity1 "logf" Cil_types.FFloat log; register_arity1 "log10f" Cil_types.FFloat log10; register_arity1 "expf" Cil_types.FFloat exp; register_arity1 "sqrtf" Cil_types.FFloat sqrt; register_arity1 "floorf" Cil_types.FFloat floor; register_arity1 "ceilf" Cil_types.FFloat ceil; register_arity1 "truncf" Cil_types.FFloat trunc; register_arity1 "roundf" Cil_types.FFloat fround; ;; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_float.mli����������������������������0000666�0000000�0000000�00000003455�13571573400�023240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Builtins for standard floating-point functions. Nothing is exported, all the builtins are registered through {Builtins.register_builtin} *) (* Local Variables: compile-command: "make -C ../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_malloc.ml����������������������������0000666�0000000�0000000�00000104426�13571573400�023231� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Abstract_interp open Locations open Cvalue let dkey = Value_parameters.register_category "malloc" let wkey_weak_alloc = Value_parameters.register_warn_category "malloc:weak" let () = Value_parameters.set_warn_status wkey_weak_alloc Log.Winactive (** {1 Dynamically allocated bases} *) module Base_hptmap = Hptmap.Make (Base.Base) (Value_types.Callstack) (Hptmap.Comp_unused) (struct let v = [ [ ] ] end) (struct let l = [ Ast.self ] end) module Dynamic_Alloc_Bases = State_builder.Ref (Base_hptmap) (struct let dependencies = [Ast.self] (* TODO: should probably depend on Value itself *) let name = "Value.Builtins_malloc.Dynamic_Alloc_Bases" let default () = Base_hptmap.empty end) let () = Ast.add_monotonic_state Dynamic_Alloc_Bases.self (** {1 Auxiliary functions} *) (* Remove some parts of the callstack: - Remove the bottom of the call tree until we get to the call site of the call to the first malloc function. The idea is that each of these call site correspond to a different use of a malloc function, so it is interesting to keep their bases separated. *) let call_stack_no_wrappers () = let stack = Value_util.call_stack () in assert (stack != []); let wrappers = Value_parameters.MallocFunctions.get() in let rec bottom_filter = function | [] -> assert false | [_] as stack -> stack (* Do not empty the stack completely *) | (kf,_)::((kf', _):: _ as rest) as stack -> if Datatype.String.Set.mem (Kernel_function.get_name kf) wrappers then if Datatype.String.Set.mem (Kernel_function.get_name kf') wrappers then bottom_filter rest else stack else stack in bottom_filter stack ;; let register_malloced_base ?(stack=call_stack_no_wrappers ()) b = let stack_without_top = List.tl stack in Dynamic_Alloc_Bases.set (Base_hptmap.add b stack_without_top (Dynamic_Alloc_Bases.get ())) let fold_dynamic_bases (f: Base.t -> Value_types.Callstack.t -> 'a -> 'a) init = Base_hptmap.fold f (Dynamic_Alloc_Bases.get ()) init let is_automatically_deallocated base = match base with | Base.Allocated (_, (Base.Alloca | Base.VLA), _) -> true | Base.Allocated (_, Base.Malloc, _) | Base.Var _ | Base.CLogic_Var _ | Base.Null | Base.String _ -> false (* Extracts the minimum/maximum sizes (in bytes) for malloc/realloc/calloc, respecting the bounds of size_t. Note that the value returned for maximum size corresponds to one past the last valid index. *) let extract_size sizev_bytes = let max = Bit_utils.max_byte_size () in try let sizei_bytes = Cvalue.V.project_ival sizev_bytes in begin match Ival.min_and_max sizei_bytes with | Some smin, Some smax -> assert (Integer.(ge smin zero)); smin, Integer.min smax max | _ -> assert false (* Cil invariant: cast to size_t *) end with V.Not_based_on_null -> (* size is a garbled mix *) Integer.zero, max (* Name of the base that will be given to a malloced variable, determined using the callstack. *) let base_name prefix stack = let stmt_line stmt = (fst (Cil_datatype.Stmt.loc stmt)).Filepath.pos_lnum in match stack with | [] -> assert false | [kf, Kglobal] -> (* Degenerate case *) Format.asprintf "__%s_%a" prefix Kernel_function.pretty kf | (_, Kglobal) :: _ :: _ -> assert false | (_, Kstmt callsite) :: qstack -> (* Use the whole call-stack to generate the name *) let rec loop_full = function | [_, Kglobal] -> Format.sprintf "_%s" (Kernel.MainFunction.get ()) | (_, Kglobal) :: _ :: _ -> assert false | [] -> assert false (* impossible, we should have seen a Kglobal *) | (kf, Kstmt line)::b -> let line = stmt_line line in let node_str = Format.asprintf "_l%d__%a" line Kernel_function.pretty kf in (loop_full b) ^ node_str in (* Use only the name of the caller to malloc for the name *) let caller = function | [] -> assert false (* caught above *) | (kf, _) :: _ -> Format.asprintf "_%a" Kernel_function.pretty kf in let full_name = false in Format.asprintf "__%s%s_l%d" prefix (if full_name then loop_full qstack else caller qstack) (stmt_line callsite) ;; type var = Weak | Strong let create_new_var stack prefix type_base weak = let prefix = match weak with | Weak -> prefix ^ "_w" | Strong -> prefix in let name = Cabs2cil.fresh_global (base_name prefix stack) in Value_util.create_new_var name type_base (* This function adds a "_w" information to a variable. It should be used when a variable becomes weak, and supposes that the variable has been created by one of the functions of this module. Mutating variables name is not a good idea in general, but we take the risk here. *) let mutate_name_to_weak vi = Value_parameters.warning ~wkey:wkey_weak_alloc ~current:true ~once:false "@[marking variable `%s' as weak@]%t" vi.vname Value_util.pp_callstack; try let prefix, remainder = Scanf.sscanf vi.vname "__%s@_%s" (fun s1 s2 -> (s1, s2)) in let name' = Printf.sprintf "__%s_w_%s" prefix remainder in vi.vname <- name' with End_of_file | Scanf.Scan_failure _ -> () (* This type represents the size requested to malloc/realloc and co. *) type typed_size = { min_bytes: Integer.t (* minimum size requested, in bytes *); max_bytes: Integer.t (* maximum size requested, in bytes *); elem_typ: typ (* "guessed type" for the elements of the new variable *); nb_elems: Integer.t option (* number of elements of size [sizeof(elem_typ)]. None if [min<>max] *); } (* Guess the intended type for the cell returned by malloc, given [sizev == [size_min .. size_max] (in bytes). We look for [T *v = malloc(foo)], then check that [size_min] and [size_max] are multiples of [sizeof(T)]. Note that [sizeof(T)] can be zero (e.g. an empty struct). If no information can be found, we use char for the base type. If the size cannot change later ([constant_size]), we also compute the number of elements that are allocated. *) (* TODO: this is not perfect because we can have an overflow in computations such as [foo * t = malloc (i * sizeof(foo))] *) let guess_intended_malloc_type stack sizev constant_size = let size_min, size_max = extract_size sizev in let nb_elems elem_size = if constant_size && Int.equal size_min size_max then Some (if Int.(equal elem_size zero) then Int.zero else Int.e_div size_min elem_size) else None in let mk_typed_size t = match Cil.unrollType t with | TPtr (t, _) when not (Cil.isVoidType t) -> let s = Int.of_int (Cil.bytesSizeOf t) in if Int.(equal s zero) || (Int.equal (Int.e_rem size_min s) Int.zero && Int.equal (Int.e_rem size_max s) Int.zero) then { min_bytes = size_min; max_bytes = size_max; elem_typ = t; nb_elems = nb_elems s } else raise Exit | _ -> raise Exit in try match snd (List.hd stack) with | Kstmt {skind = Instr (Call (Some lv, _, _, _))} -> mk_typed_size (Cil.typeOfLval lv) | Kstmt {skind = Instr(Local_init(vi, _, _))} -> mk_typed_size vi.vtype | _ -> raise Exit with Exit | Cil.SizeOfError _ -> (* Default, use char *) { min_bytes = size_min; max_bytes = size_max; elem_typ = Cil.charType; nb_elems = nb_elems Int.one } (* Helper function to create the best type for a new base. Builds an array type with the appropriate number of elements if needed. When the number of elements cannot be determined, build an array with imprecise size. This is not a problem in practice, because in C you annot obtain the size of an allocated block, and \block_length handles Allocated variables through their validity. *) let type_from_nb_elems tsize = let typ = tsize.elem_typ in match tsize.nb_elems with | None -> TArray (typ, None, Cil.empty_size_cache (), []) | Some nb -> if Int.equal Int.one nb then typ else let loc = Cil.CurrentLoc.get () in let esize_arr = Cil.kinteger64 ~loc nb in (* [nb] fits in size_t *) TArray (typ, Some esize_arr, Cil.empty_size_cache (), []) (* Generalize a type into an array type without size. Useful for variables whose size is mutated. *) let weaken_type typ = match Cil.unrollType typ with | TArray (_, None, _, _) -> typ | TArray (typ, Some _, _, _) | typ -> TArray (typ, None, Cil.empty_size_cache (), []) (* size for which the base is certain to be valid *) let size_sure_valid b = match Base.validity b with | Base.Invalid | Base.Empty | Base.Unknown (_, None, _) -> Integer.zero | Base.Known (_, up) | Base.Unknown (_, Some up, _) | Base.Variable { Base.min_alloc = up } -> Integer.succ up ;; (* Create a new offsetmap initialized to [bottom] on the entire allocable range, with the first [max_alloc] bits set to [v]. [v] must be an isotropic value. *) let offsm_with_v v validity max_alloc = let size = Bottom.non_bottom (V_Offsetmap.size_from_validity validity) in let offsm = V_Offsetmap.create_isotropic ~size V_Or_Uninitialized.bottom in (* max_alloc is -1 when allocating an empty base *) if Int.(lt max_alloc zero) then (* malloc(0) => nothing to uninitialize *) offsm else (* malloc(i > 0) => uninitialize i bytes *) V_Offsetmap.add ~exact:true (Int.zero, max_alloc) (v, Int.one, Rel.zero) offsm (* add [v] as a possible value for the bits [0..max_valid_bits] of [base] in [state]. [v] must be an isotropic value. *) let add_v v state base max_valid_bits = let validity = Base.validity base in let offsm = offsm_with_v v validity max_valid_bits in let new_offsm = try let cur = match Model.find_base_or_default base state with | `Top -> assert false (* Value never passes Top as state *) | `Bottom -> assert false (* offsm_with_v never returns Bottom *) | `Value m -> m in V_Offsetmap.join offsm cur with Not_found -> offsm in Model.add_base base new_offsm state let add_uninitialized = add_v V_Or_Uninitialized.uninitialized let add_zeroes = add_v (V_Or_Uninitialized.initialized Cvalue.V.singleton_zero) (* Applies the possibility of failure when allocating/reallocating a base. [ret]: result in case of success (e.g. a new base in case of malloc); [orig_state]: state before any allocation, returned in case of failure; [state_after_alloc]: state in case the allocation is successful; [returns_null]: if given, forces the result to consider/ignore the possibility of failure, despite -val-alloc-returns-null. *) let wrap_fallible_alloc ?returns_null ret orig_state state_after_alloc = let default_returns_null = Value_parameters.AllocReturnsNull.get () in let returns_null = Extlib.opt_conv default_returns_null returns_null in let success = Eval_op.wrap_ptr ret, state_after_alloc in if returns_null then let failure = Eval_op.wrap_ptr Cvalue.V.singleton_zero, orig_state in [ success ; failure ] else [ success ] let pp_validity fmt (v1, v2) = if Int.equal v1 v2 then Format.fprintf fmt "0..%a" Int.pretty v1 else Format.fprintf fmt "0..%a/%a" Int.pretty v1 Int.pretty v2 (** {1 Malloc} *) (* Create a new variable of size [sizev] with deallocation type [deallocation], using [stack] to infer a type. Returns the new base, and its maximum validity. Note that [_state] is not used, but it is present to ensure a compatible signature with [alloc_by_stack]. *) let alloc_abstract weak deallocation stack prefix sizev _state = let tsize = guess_intended_malloc_type stack sizev (weak = Strong) in let type_base = type_from_nb_elems tsize in let var = create_new_var stack prefix type_base weak in Value_parameters.result ~current:true ~once:true "@[allocating %svariable %a@]%t" (if weak = Weak then "weak " else "") Printer.pp_varinfo var Value_util.pp_callstack; let size_char = Bit_utils.sizeofchar () in (* Sizes are in bits *) let min_alloc = Int.(pred (mul size_char tsize.min_bytes)) in let max_alloc = Int.(pred (mul size_char tsize.max_bytes)) in (* NOTE: min_alloc/max_alloc may be -1 if the size is zero *) assert Int.(ge min_alloc Int.minus_one); assert Int.(ge max_alloc min_alloc); (* note that min_alloc may be negative (-1) if the allocated size is 0 *) let weak = match weak with Weak -> true | Strong -> false in let variable_v = Base.create_variable_validity ~weak ~min_alloc ~max_alloc in let new_base = Base.register_allocated_var var deallocation (Base.Variable variable_v) in register_malloced_base ~stack new_base; new_base, max_alloc (* Simplest allocation function: a new base each time, of the required size. *) let alloc_fresh ?(prefix="malloc") weak region state actuals = match actuals with | [_, size, _] -> let stack = call_stack_no_wrappers () in let base, max_valid = alloc_abstract weak region stack prefix size state in let new_state = add_uninitialized state base max_valid in let ret = V.inject base Ival.zero in let c_values = wrap_fallible_alloc ret state new_state in { Value_types.c_values = c_values ; c_clobbered = Base.SetLattice.bottom; c_cacheable = Value_types.NoCacheCallers; c_from = None; } | _ -> raise (Builtins.Invalid_nb_of_args 1) let () = Builtins.register_builtin "Frama_C_malloc_fresh" (alloc_fresh Strong Base.Malloc) let () = Builtins.register_builtin "Frama_C_malloc_fresh_weak" (alloc_fresh Weak Base.Malloc) let alloc_size_ok intended_size = try let size = Cvalue.V.project_ival intended_size in let ok_size = Ival.inject_range (Some Integer.zero) (Some (Bit_utils.max_byte_size ())) in if Ival.is_included size ok_size then Alarmset.True else if Ival.intersects size ok_size then Alarmset.Unknown else Alarmset.False with Cvalue.V.Not_based_on_null -> Alarmset.Unknown (* garbled mix in size *) (* Generic function used both by [calloc_size] and [calloc_by_stack]. [calloc_f] is the actual function used (calloc_size or calloc_by_stack). *) let calloc_abstract calloc_f state actuals = let stack = call_stack_no_wrappers () in let nmemb, sizev = match actuals with | [(_exp, nmemb, _); (_, size, _)] -> nmemb, size | _ -> raise (Builtins.Invalid_nb_of_args 2) in let alloc_size = Cvalue.V.mul nmemb sizev in let size_ok = alloc_size_ok alloc_size in if size_ok <> Alarmset.True then Value_util.warning_once_current "calloc out of bounds: assert(nmemb * size <= SIZE_MAX)"; if size_ok = Alarmset.False then (* size always overflows *) { Value_types.c_values = [Eval_op.wrap_ptr Cvalue.V.singleton_zero, state]; c_clobbered = Base.SetLattice.bottom; c_cacheable = Value_types.NoCacheCallers; c_from = None; } else let base, max_valid = calloc_f stack "calloc" alloc_size state in let new_state = add_zeroes state base max_valid in let returns_null = if size_ok = Alarmset.Unknown then Some true else None in let ret = V.inject base Ival.zero in let c_values = wrap_fallible_alloc ?returns_null ret state new_state in { Value_types.c_values = c_values ; c_clobbered = Base.SetLattice.bottom; c_cacheable = Value_types.NoCacheCallers; c_from = None; } (* Equivalent to [malloc_fresh], but for [calloc]. *) let calloc_fresh weak state actuals = calloc_abstract (alloc_abstract weak Base.Malloc) state actuals let () = Builtins.register_builtin "Frama_C_calloc_fresh" (calloc_fresh Strong) let () = Builtins.register_builtin "Frama_C_calloc_fresh_weak" (calloc_fresh Weak) (* Variables that have been returned by a call to an allocation function at this callstack. The first allocated variable is at the top of the stack. Currently, the callstacks are truncated according to [-val-malloc-functions]. *) module MallocedByStack = (* varinfo list Callstack.hashtbl *) State_builder.Hashtbl(Value_types.Callstack.Hashtbl) (Datatype.List(Base)) (struct let name = "Value.Builtins_malloc.MallocedByStack" let size = 17 let dependencies = [Ast.self] end) let () = Ast.add_monotonic_state MallocedByStack.self (* Performs an abstract allocation on an existing allocated variable, its validity. If [make_weak], the variable is marked as being weak. *) let update_variable_validity ?(make_weak=false) base sizev = let size_min, size_max = extract_size sizev in match base with | Base.Allocated (vi, _deallocation, (Base.Variable variable_v)) -> if make_weak && (variable_v.Base.weak = false) then mutate_name_to_weak vi; let min_sure_bits = Int.(pred (mul eight size_min)) in let max_valid_bits = Int.(pred (mul eight size_max)) in if not (Int.equal variable_v.Base.min_alloc min_sure_bits) || not (Int.equal variable_v.Base.max_alloc max_valid_bits) then begin Value_parameters.result ~dkey ~current:true ~once:false "@[resizing variable `%a'@ (%a) to fit %a@]" Printer.pp_varinfo vi pp_validity (variable_v.Base.min_alloc, variable_v.Base.max_alloc) pp_validity (min_sure_bits, max_valid_bits); (* Mutating the type of a varinfo is not exactly a good idea. This is probably fine here, because the type of a malloced variable is almost never used. *) vi.vtype <- weaken_type vi.vtype; end; Base.update_variable_validity variable_v ~weak:make_weak ~min_alloc:min_sure_bits ~max_alloc:max_valid_bits; base, max_valid_bits | _ -> Value_parameters.fatal "base is not Allocated: %a" Base.pretty base let alloc_by_stack_aux region stack prefix sizev state = let max_level = Value_parameters.MallocLevel.get () in let all_vars = try MallocedByStack.find stack with Not_found -> [] in let rec aux nb vars = match vars with | [] -> (* must allocate a new variable *) let b, _ as r = alloc_abstract Strong region stack prefix sizev state in MallocedByStack.replace stack (all_vars @ [b]); r | b :: q -> try ignore (Model.find_base b state); if nb = max_level then begin (* variable already used *) update_variable_validity ~make_weak:true b sizev end else aux (nb+1) q with Not_found -> (* Can reuse this (strong) variable *) update_variable_validity ~make_weak:false b sizev in aux 0 all_vars (* For each callstack, the first MallocPrecision.get() are precise fresh distinct locations. The following allocations all return the same base, first strong, then weak, and which is extended as needed. *) let alloc_by_stack ?(prefix="malloc") region ?returns_null : Db.Value.builtin_sig = fun state actuals-> let stack = call_stack_no_wrappers () in let sizev = match actuals with | [_,size,_] -> size | _ -> raise (Builtins.Invalid_nb_of_args 1) in let base, max_valid = alloc_by_stack_aux region stack prefix sizev state in let new_state = add_uninitialized state base max_valid in let ret = V.inject base Ival.zero in let c_values = wrap_fallible_alloc ?returns_null ret state new_state in { Value_types.c_values = c_values ; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.NoCacheCallers } ;; let () = Builtins.register_builtin ~replace:"malloc" "Frama_C_malloc_by_stack" (alloc_by_stack Base.Malloc) let () = Builtins.register_builtin ~replace:"__fc_vla_alloc" "Frama_C_vla_alloc_by_stack" (alloc_by_stack Base.VLA ~returns_null:false) let () = Builtins.register_builtin ~replace:"alloca" "Frama_C_alloca" (alloc_by_stack ~prefix:"alloca" Base.Alloca ~returns_null:false) (* Equivalent to [alloc_by_stack], but for [calloc]. *) let calloc_by_stack : Db.Value.builtin_sig = fun state actuals -> calloc_abstract (alloc_by_stack_aux Base.Malloc) state actuals let () = Builtins.register_builtin ~replace:"calloc" "Frama_C_calloc_by_stack" calloc_by_stack (** {1 Free} *) (* Change all references to bases into ESCAPINGADDR into the given state, and remove those bases from the state entirely when [exact] holds *) let free ~exact bases state = let changed = ref Locations.Zone.bottom in (* Uncomment this code to simulate the fact that free "writes" the bases it deallocates Base_hptmap.iter (fun b -> changed := Zone.join !changed (enumerate_bits (loc_of_base b)) ) bases; *) (* No need to remove the freed bases from the state if [exact] is false, because they must remain for the 'inexact' case *) let state = if exact then Base.Hptset.fold Cvalue.Model.remove_base bases state else state in let escaping = bases in let on_escaping ~b ~itv ~v:_ = let z = Locations.Zone.inject b (Int_Intervals.inject_itv itv) in changed := Locations.Zone.join !changed z in let within = Base.SetLattice.top in let state = Locals_scoping.make_escaping ~exact ~escaping ~on_escaping ~within state in let from_changed = let open Function_Froms in let m = Memory.(add_binding ~exact empty !changed Deps.bottom) in { deps_table = m; deps_return = Deps.bottom } in state, (from_changed, if exact then !changed else Zone.bottom) let freeable arg = (* Categorizes the bases in arg *) let f base offset (all_ok, one_ok) = if Base_hptmap.mem base (Dynamic_Alloc_Bases.get ()) && not (is_automatically_deallocated base) then all_ok && Ival.is_zero offset, one_ok || Ival.contains_zero offset else (false, one_ok) in match Cvalue.V.fold_topset_ok f arg (true, false) with | true, true -> True | false, true -> Unknown | false, false -> False | true, false -> assert (V.is_bottom arg); True let resolve_bases_to_free arg = (* Categorizes the bases in arg *) let f base offset (acc, card, null) = let allocated_base = Base_hptmap.mem base (Dynamic_Alloc_Bases.get ()) in (* Collect the bases to remove from the memory state. Also count the number of freeable bases (including NULL). *) if Ival.contains_zero offset then begin let base_card = match Base.validity base with | Base.Variable { Base.weak = true } -> 2 (* weak validity has "infinite" cardinality; but here we use 2 since any value > 1 leads to a weak update anyway *) | _ -> 1 in if allocated_base then Base.Hptset.add base acc, card + base_card, null else if Base.is_null base then acc, card + base_card, true else acc, card, null end else acc, card, null in Cvalue.V.fold_topset_ok f arg (Base.Hptset.empty, 0, false) let free_aux state ~strong bases_to_remove = (* TODO: reduce on arg if it is an lval *) if strong then begin Value_parameters.debug ~current:true ~dkey "strong free on bases: %a" Base.Hptset.pretty bases_to_remove; free ~exact:true bases_to_remove state end else begin Value_parameters.debug ~current:true ~dkey "weak free on bases: %a" Base.Hptset.pretty bases_to_remove; free ~exact:false bases_to_remove state end (* Builtin for [free] function *) let frama_c_free state actuals = match actuals with | [ _, arg, _ ] -> let bases_to_remove, card_to_remove, _null = resolve_bases_to_free arg in if card_to_remove = 0 then { Value_types.c_values = []; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } else let strong = card_to_remove <= 1 in let state, changed = free_aux state ~strong bases_to_remove in { Value_types.c_values = [None, state]; c_clobbered = Base.SetLattice.bottom; c_from = Some changed; c_cacheable = Value_types.Cacheable; } | _ -> raise (Builtins.Invalid_nb_of_args 1) let () = Builtins.register_builtin ~replace:"free" "Frama_C_free" frama_c_free (* built-in for [__fc_vla_free] function. By construction, VLA should always be mapped to a single base. *) let frama_c_vla_free state actuals = match actuals with | [ _, arg, _] -> let bases_to_remove, _card_to_remove, _null = resolve_bases_to_free arg in let state, changed = free_aux state ~strong:true bases_to_remove in { Value_types.c_values = [None, state]; c_clobbered = Base.SetLattice.bottom; c_from = Some changed; c_cacheable = Value_types.Cacheable; } | _ -> raise (Builtins.Invalid_nb_of_args 1) let () = Builtins.register_builtin ~replace:"__fc_vla_free" "Frama_C_vla_free" frama_c_vla_free let free_automatic_bases stack state = (* free automatic bases that were allocated in the current function *) let bases_to_free = Base_hptmap.fold (fun base stack' acc -> if is_automatically_deallocated base && Value_types.Callstack.equal stack stack' then Base.Hptset.add base acc else acc ) (Dynamic_Alloc_Bases.get ()) Base.Hptset.empty in if Base.Hptset.is_empty bases_to_free then state else begin Value_parameters.result ~current:true ~once:true "freeing automatic bases: %a" Base.Hptset.pretty bases_to_free; let state', _changed = free_aux state ~strong:true bases_to_free in (* TODO: propagate 'freed' bases for From? *) state' end (** {1 Realloc} *) (* Note: realloc never fails during read/write operations, hence we can always ignore the validity of locations. (We craft them ourselves anyway.) The only possible cause of failure is a pointer that was not malloced. *) (* Auxiliary function for [realloc], that copies the [size] first bytes of [b] (or less if [b] is too small) in [src_state], then pastes them in [new_base] in [dst_state], which is supposed to be big enough for [size]. This function always perform weak updates, in case multiple bases are copied to [new_base]. *) let realloc_copy_one size ~src_state ~dst_state new_base b = let size_char = Bit_utils.sizeofchar () in let size_bits = Integer.mul size size_char in let up = match Base.validity b with | Base.Known (_, up) | Base.Unknown (_, _, up) | Base.Variable { Base.max_alloc = up } -> up | Base.Invalid | Base.Empty -> Integer.zero in let size_to_copy = Int.min (Int.succ up) size_bits in let src = Location_Bits.inject b Ival.zero in match Cvalue.Model.copy_offsetmap src size_to_copy src_state with | `Bottom -> assert false | `Value offsetmap -> if Int.gt size_to_copy Int.zero then Cvalue.Model.paste_offsetmap ~from:offsetmap ~dst_loc:new_base ~size:size_to_copy ~exact:false dst_state else dst_state (* Auxiliary function for [realloc], that performs the allocation of a new variable, and copy the pointers being reallocated inside the new base. [size] is the size to realloc. [bases_to_realloc] are the pointers to the memory to copy. [null_in_arg] indicates that [realloc] was called with [null] in its argument. [weak] indicates which type of variable must be created: if [Weak], convergence is ensured using a malloc builtin that converges. If [Strong], a new base is created for each call. *) let realloc_alloc_copy weak bases_to_realloc null_in_arg sizev state = Value_parameters.debug ~dkey "bases_to_realloc: %a" Base.Hptset.pretty bases_to_realloc; assert (not (Model.(equal state bottom || equal state top))); let _size_valid, size_max = extract_size sizev in (* bytes everywhere *) let stack = call_stack_no_wrappers () in let base, max_valid = let prefix = "realloc" in match weak with | Strong -> alloc_abstract Strong Base.Malloc stack prefix sizev state | Weak -> alloc_by_stack_aux Base.Malloc stack prefix sizev state in (* Make sure that [ret] will be present in the result: we bind it at least to bottom everywhere *) let dst_state = add_uninitialized state base Int.minus_one in let ret = V.inject base Ival.zero in let loc_bits = Locations.loc_bytes_to_loc_bits ret in (* get bases to free and copy *) let lbases = Base.Hptset.elements bases_to_realloc in let dst_state = (* uninitialized on all reallocated valid bits *) let offsm = offsm_with_v V_Or_Uninitialized.uninitialized (Base.validity base) max_valid in let offsm = if null_in_arg then offsm (* In this case, realloc may copy nothing *) else (* Compute the maximal size that is guaranteed to be copied across all bases *) let aux_valid size b = Integer.min size (size_sure_valid b) in let size_new_loc = Integer.mul size_max (Bit_utils.sizeofchar ()) in let size_sure_valid = List.fold_left aux_valid size_new_loc lbases in (* Replace the bits [0..size_sure_valid] by [bottom]. Those [bottom] will be overwritten in the call to [realloc_copy_one]. *) if Int.gt size_sure_valid Int.zero then V_Offsetmap.add (Int.zero, Int.pred size_sure_valid) (V_Or_Uninitialized.bottom, Int.one, Rel.zero) offsm else offsm in Cvalue.Model.paste_offsetmap ~from:offsm ~dst_loc:loc_bits ~size:(Int.succ max_valid) ~exact:false dst_state in (* Copy the old bases *) let copy_one dst_state b = realloc_copy_one size_max ~src_state:state ~dst_state loc_bits b in let state = List.fold_left copy_one dst_state lbases in ret, state (* Auxiliary function for [realloc]. All the bases in [bases] are realloced one by one, plus NULL if [null] holds. This function acts as if we had first made a disjunction on the pointer passed to [realloc]. *) let realloc_multiple state size bases null = (* this function should never be used with weak allocs *) let aux_bases b acc = Base.Hptset.singleton b :: acc in let lbases = Base.Hptset.fold aux_bases bases [] in (* This function reallocates the base [b] alone, but does not free it. We cannot free yet, because [b] would leak in the states corresponding to the variables different from [b]. *) let realloc_one_base b = realloc_alloc_copy Strong b false size state in let join (ret1, st1) (ret2, st2) = V.join ret1 ret2, Model.join st1 st2 in let aux_one_base acc b = join (realloc_one_base b) acc in let res = List.fold_left aux_one_base (V.bottom, state) lbases in (* Add another base for realloc(NULL) if needed. *) if null then join res (realloc_alloc_copy Strong Base.Hptset.empty true size state) else res (* Multiple indicates that existing bases are reallocated into as many new bases. *) let realloc ~multiple state args = match args with | [ (_,ptr,_); (_,size,_) ] -> let (bases, card_ok, null) = resolve_bases_to_free ptr in if card_ok > 0 then let orig_state = state in let ret, state = if multiple then realloc_multiple state size bases null else realloc_alloc_copy Weak bases null size state in (* Maybe the calls above made [ret] weak, and it was among the arguments. In this case, do not free it entirely! *) let weak = Base.Hptset.exists Base.is_weak bases in let strong = card_ok <= 1 && not weak in (* free old bases. *) let state, changed = free_aux state ~strong bases in let c_values = wrap_fallible_alloc ret orig_state state in { Value_types.c_values; c_clobbered = Builtins.clobbered_set_from_ret state ret; c_cacheable = Value_types.NoCacheCallers; c_from = Some changed; } else (* Invalid call. *) { Value_types.c_values = [] ; c_clobbered = Base.SetLattice.bottom; c_cacheable = Value_types.NoCacheCallers; c_from = None; } | _ -> raise (Builtins.Invalid_nb_of_args 2) let () = Builtins.register_builtin ~replace:"realloc" "Frama_C_realloc" (realloc ~multiple:false) let () = Builtins.register_builtin "Frama_C_realloc_multiple" (realloc ~multiple:true) (** {1 Leak detection} *) (* Experimental, not to be released, leak detection built-in. *) (* Check if the base_to_check is present in one of the offsetmaps of the state *) exception Not_leaked let check_if_base_is_leaked base_to_check state = match state with | Model.Bottom -> false | Model.Top -> true | Model.Map m -> try Cvalue.Model.fold (fun base offsetmap () -> if not (Base.equal base_to_check base) then Cvalue.V_Offsetmap.iter_on_values (fun v -> if Locations.Location_Bytes.may_reach base_to_check (V_Or_Uninitialized.get_v v) then raise Not_leaked) offsetmap) m (); true with Not_leaked -> false (* Does not detect leaked cycles within malloc'ed bases. The complexity is very far from being optimal. *) let check_leaked_malloced_bases state _ = let alloced_bases = Dynamic_Alloc_Bases.get () in Base_hptmap.iter (fun base _ -> if check_if_base_is_leaked base state then Value_util.warning_once_current "memory leak detected for %a" Base.pretty base) alloced_bases; { Value_types.c_values = [None,state] ; c_clobbered = Base.SetLattice.bottom; c_cacheable = Value_types.NoCacheCallers; c_from = None; } let () = Builtins.register_builtin "Frama_C_check_leak" check_leaked_malloced_bases (* Local Variables: compile-command: "make -C ../../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_malloc.mli���������������������������0000666�0000000�0000000�00000006036�13571573400�023400� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Dynamic allocation related builtins. Most functionality is exported as builtins. *) val fold_dynamic_bases: (Base.t -> Value_types.Callstack.t -> 'a -> 'a) -> 'a -> 'a (** [fold_dynamic_bases f init] folds [f] to each dynamically allocated base, with initial accumulator [init]. Note that this also includes bases created by [alloca] and [VLAs]. *) val alloc_size_ok: Cvalue.V.t -> Alarmset.status (* [alloc_size_ok size] checks that [size] represents a valid allocation size w.r.t. the total address space. [True] means that the requested size is small enough, [False] that the allocation is guaranteed to fail (because the size is always greater than SIZE_MAX). *) val free_automatic_bases: Value_types.Callstack.t -> Cvalue.Model.t -> Cvalue.Model.t (** Performs the equivalent of [free] for each location that was allocated via [alloca()] in the current function (as per [Value_util.call_stack ()]). This function must be called during finalization of a function call. *) val freeable: Cvalue.V.t -> Abstract_interp.truth (** Evaluates the ACSL predicate \freeable(value): holds if and only if the value points to an allocated memory block that can be safely released using the C function free. Note that \freeable(\null) does not hold, despite NULL being a valid argument to the C function free. *) (**/**) val register_malloced_base: ?stack:Value_types.Callstack.t -> Base.t -> unit (* Should not be used by casual users. *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_memory.ml����������������������������0000666�0000000�0000000�00000071660�13571573400�023275� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cvalue open Abstract_interp open Locations open Value_util let register_builtin = Builtins.register_builtin let dkey = Value_parameters.register_category "imprecision" exception Found_misaligned_base let frama_C_is_base_aligned state actuals = try begin match actuals with | [_,x,_; _,y,_] -> let i = Cvalue.V.project_ival y in begin match i with | Ival.Set si -> Location_Bytes.fold_i (fun b _o () -> Array.iter (fun int -> if not (Base.is_aligned_by b int) then raise Found_misaligned_base) si) x (); { Value_types.c_values = [ Eval_op.wrap_int Cvalue.V.singleton_one, state]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } | _ -> raise Found_misaligned_base end | _ -> raise (Builtins.Invalid_nb_of_args 2) end with | Found_misaligned_base | Not_found (* from project_ival *) | Abstract_interp.Error_Top (* from fold_i *) -> { Value_types.c_values = [Eval_op.wrap_int Cvalue.V.zero_or_one, state]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } let () = register_builtin "Frama_C_is_base_aligned" frama_C_is_base_aligned let frama_c_offset state actuals = match actuals with | [_,x,_] -> let value = try let offsets = Location_Bytes.fold_i (fun _b o a -> Ival.join a o) x Ival.bottom in Cvalue.V.inject_ival offsets with Abstract_interp.Error_Top -> Value_parameters.error ~current:true "Builtin Frama_C_offset is applied to a value not \ guaranteed to be an address"; Cvalue.V.top_int in { Value_types.c_values = [Eval_op.wrap_size_t value, state]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } | _ -> raise (Builtins.Invalid_nb_of_args 1) let () = register_builtin "Frama_C_offset" frama_c_offset exception Memcpy_result of (Cvalue.Model.t * Function_Froms.froms * Zone.t) exception Indeterminate of V_Or_Uninitialized.t (* Called by the [memcpy] builtin. Warns when the offsetmap contains an indeterminate value, when the imprecision category is enabled *) let memcpy_check_indeterminate_offsetmap offsm = if Value_parameters.is_debug_key_enabled dkey then try let aux_offset _ (v, _, _) = match v with | V_Or_Uninitialized.C_init_noesc _ -> () | _ -> raise (Indeterminate v) in V_Offsetmap.iter aux_offset offsm with Indeterminate v -> Value_parameters.debug ~current:true ~dkey ~once:true "@[In memcpy@ builtin:@ precise@ copy of@ indeterminate@ values %a@]%t" V_Or_Uninitialized.pretty v Value_util.pp_callstack (* Create a dependency [\from arg_n] where n is the nth argument of the currently called function. *) let deps_nth_arg n = let open Function_Froms in let (kf,_) = List.hd (Value_util.call_stack()) in try let vi = List.nth (Kernel_function.get_formals kf) n in Deps.add_data_dep Deps.bottom (Locations.zone_of_varinfo vi) with Failure _ -> Kernel.fatal "%d arguments expected" n let frama_c_memcpy state actuals = let compute (_exp_dst,dst_bytes,_) (_exp_src,src_bytes,_) (_exp_size,size,_) = let plevel = Value_parameters.ArrayPrecisionLevel.get() in let size = try Cvalue.V.project_ival size with Cvalue.V.Not_based_on_null -> Ival.top (* TODO: use size_t *) in let min,max = Ival.min_and_max size in let min = match min with None -> Int.zero | Some m -> Int.max m Int.zero in let char_bits = Bit_utils.sizeofchar() in let size_min = Int.mul char_bits min in let src = loc_bytes_to_loc_bits src_bytes in let dst = loc_bytes_to_loc_bits dst_bytes in (* Remove read-only destinations *) let dst_bits = Location_Bits.filter_base (fun b -> not (Base.is_read_only b)) dst in let deps_return = deps_nth_arg 0 in let empty_cfrom = Function_Froms.({ deps_table = Memory.empty; deps_return }) in let precise_copy state = (* First step: copy the bytes we are sure to copy *) if Int.gt size_min Int.zero then begin match Cvalue.Model.copy_offsetmap src size_min state with | `Bottom -> (* Read failed. Source was invalid, but must be read, we stop the analysis *) raise (Memcpy_result (Cvalue.Model.bottom,empty_cfrom,Zone.bottom)) | `Value offsetmap -> let loc_dst = make_loc dst_bits (Int_Base.inject size_min) in memcpy_check_indeterminate_offsetmap offsetmap; (* Read succeeded. We write the result *) let loc_src = make_loc src (Int_Base.inject size_min) in let new_state = Cvalue.Model.paste_offsetmap ~from:offsetmap ~dst_loc:dst_bits ~size:size_min ~exact:true state in let (deps_table, sure_zone) = let zone_dst = enumerate_valid_bits Locations.Write loc_dst in let zone_src = enumerate_valid_bits Locations.Read loc_src in let deps = Function_Froms.(Deps.add_data_dep Deps.bottom zone_src) in (* Note: actually a part may be written for sure (if the difference between the offsets in loc_dst is smaller than size), but keeping it imprecise reflects more the imprecision of the value analysis here. *) let exact = Location_Bits.cardinal_zero_or_one dst_bits in let deps_table = Function_Froms.Memory.add_binding ~exact Function_Froms.Memory.empty zone_dst deps in let sure_zone = if exact then zone_dst else Zone.bottom in (deps_table, sure_zone) in new_state, deps_table, sure_zone end else (* Nothing certain can be copied *) (state, Function_Froms.Memory.empty, Zone.bottom) in let imprecise_copy new_state precise_deps_table sure_zone = (* Second step. Size is imprecise, we will now copy some bits that we are not sure to copy *) let size_min_ival = Ival.inject_singleton size_min in let dst = Location_Bits.shift size_min_ival dst_bits in let src = Location_Bits.shift size_min_ival src in (* Size remaining to copy imprecisely *) let diff = match max with | Some max -> Some (Int.mul char_bits (Int.pred (Int.sub max min))) | None -> None in (* Imprecise locations remaining to be read/written. By using ranges modulo char_bits, we read and write byte-by-byte, which can preserve some precision in the fallback. If sufficiently few sizes need to be copied, we use a more precise method (see do_size below). However, in all cases, those locations are used to compute the read and written bits. *) let range = Ival.inject_interval (Some Int.zero) diff Int.zero char_bits in let size_char = Int_Base.inject char_bits in let loc_src = make_loc (Location_Bits.shift range src) size_char in let loc_dst = make_loc (Location_Bits.shift range dst) size_char in let c_from = let open Function_Froms in let zone_src = enumerate_valid_bits Locations.Read loc_src in let zone_dst = enumerate_valid_bits Locations.Write loc_dst in let deps = Deps.add_data_dep Deps.bottom zone_src in let deps_table = Memory.add_binding ~exact:false precise_deps_table zone_dst deps in { deps_table; deps_return } in try (* We try to iter on all the slices inside the value of slice. If there are more too many of them, we use a backup solution *) ignore (Ival.cardinal_less_than size (plevel / 10)); let do_size s (dst, src, prev_size, state) = let s = Int.mul char_bits s in let diff = Int.sub s prev_size in if Int.equal s size_min then (* occurs the very first time. This copy has already been performed at the beginning, skip *) (dst, src, s, state) else begin (* Copy data between prev_size and s *) match Cvalue.Model.copy_offsetmap src diff state with | `Bottom -> (* This size is completely invalid. The following ones will also be invalid, stop now with current result *) raise (Memcpy_result (state,c_from,sure_zone)) | `Value offsetmap -> memcpy_check_indeterminate_offsetmap offsetmap; let new_state = Cvalue.Model.paste_offsetmap ~from:offsetmap ~dst_loc:dst ~size:diff ~exact:false state in if Db.Value.is_reachable new_state then let diffi = Ival.inject_singleton diff in let dst = Location_Bits.shift diffi dst in let src = Location_Bits.shift diffi src in (dst, src, s, new_state) else (* As above, invalid size, this time for the destination. We stop there *) raise (Memcpy_result (state,c_from,sure_zone)) end in let _, _, _, state = Ival.fold_int do_size size (dst, src, Int.zero, new_state) in raise (Memcpy_result (state,c_from,sure_zone)) with | Abstract_interp.Not_less_than -> Value_parameters.debug ~dkey ~once:true ~current:true "In memcpy builtin: too many sizes to enumerate, \ possible loss of precision"; (* Too many slices in the size. We read the entire range src+(size_min..size_max-1) in one step, as one byte, and write the result as one byte in dst+(size_min..size_max-1) *) let v = (* conflate_bottom=false: we want to copy padding bits *) Model.find_indeterminate ~conflate_bottom:false state loc_src in begin match v with | V_Or_Uninitialized.C_init_noesc _ -> () | _ -> Value_parameters.result ~dkey ~current:true ~once:true "@[In memcpy@ builtin:@ imprecise@ copy of@ indeterminate@ values@]%t" Value_util.pp_callstack end; let updated_state = Cvalue.Model.add_indeterminate_binding ~exact:false new_state loc_dst v in (* Beware that all the imprecise sizes may be invalid, in which case [add_binding] will return [Bottom]. In this case, return the previously computed state *) if Model.is_reachable updated_state then raise (Memcpy_result (updated_state,c_from,sure_zone)) else raise (Memcpy_result (new_state,c_from,sure_zone)) in try if Ival.is_zero size then raise (Memcpy_result (state, empty_cfrom, Zone.bottom)); let (precise_state,precise_deps_table,sure_zone) = precise_copy state in if Extlib.may_map ~dft:false (Int.equal min) max then (let open Function_Froms in let c_from = { deps_table = precise_deps_table; deps_return } in raise (Memcpy_result (precise_state, c_from, sure_zone))); imprecise_copy precise_state precise_deps_table sure_zone with | Memcpy_result (new_state,c_from,sure_zone) -> if Model.is_reachable new_state then (* Copy at least partially succeeded (with perhaps an alarm for some of the sizes *) { Value_types.c_values = [Eval_op.wrap_ptr dst_bytes, new_state]; c_clobbered = Builtins.clobbered_set_from_ret new_state dst_bytes; c_from = Some(c_from, sure_zone); c_cacheable = Value_types.Cacheable } else { Value_types.c_values = [ None, Cvalue.Model.bottom]; c_clobbered = Base.SetLattice.bottom; c_from = Some(c_from, sure_zone); c_cacheable = Value_types.Cacheable } in match actuals with | [dst; src; size] -> compute dst src size | _ -> raise (Builtins.Invalid_nb_of_args 3) let () = register_builtin ~replace:"memcpy" "Frama_C_memcpy" frama_c_memcpy let () = register_builtin ~replace:"memmove" "Frama_C_memmove" frama_c_memcpy (* Implementation of [memset] that accepts imprecise arguments. *) let frama_c_memset_imprecise state dst v size = let size_char = Bit_utils.sizeofchar () in let size_min, size_max_bytes = try let size = Cvalue.V.project_ival size in let min,max = Ival.min_and_max size in let min = match min with | None -> Int.zero | Some m -> Int.mul size_char (Int.max m Int.zero) and max = match max with | None -> Bit_utils.max_bit_address () | Some m -> m in min, max with V.Not_based_on_null -> Int.zero, Bit_utils.max_bit_address () in let left = loc_bytes_to_loc_bits dst in (* Write [v] everywhere that might be written, ie between [dst] and [dst+size-1]. *) let (new_state,over_zone) = if Int.gt size_max_bytes Int.zero then let shift = Ival.inject_range (Some Int.zero) (Some (Int.pred size_max_bytes)) in let loc = Location_Bytes.shift shift dst in let loc = loc_bytes_to_loc_bits loc in let loc = make_loc loc (Int_Base.inject size_char) in let state = Cvalue.Model.add_binding ~exact:false state loc v in (state,enumerate_valid_bits Locations.Write loc) else (state,Zone.bottom) in (* Write "sure" bytes in an exact way: they exist only if there is only one base, and within it, size_min+leftmost_loc > rightmost_loc *) let (new_state',sure_zone) = try let base, offset = Location_Bits.find_lonely_key left in let minb, maxb = match Ival.min_and_max offset with | Some minb, Some maxb -> minb, maxb | _ -> raise Not_found in let sure = Int.sub (Int.add minb size_min) maxb in if Int.gt sure Int.zero then let left' = Location_Bits.inject base (Ival.inject_singleton maxb) in let vuninit = V_Or_Uninitialized.initialized v in let from = V_Offsetmap.create ~size:sure vuninit ~size_v:size_char in let state = Cvalue.Model.paste_offsetmap ~from ~dst_loc:left' ~size:sure ~exact:true new_state in let sure_loc = make_loc left' (Int_Base.inject sure) in let sure_zone = enumerate_valid_bits Locations.Write sure_loc in (state,sure_zone) else (new_state,Zone.bottom) with Not_found -> (new_state,Zone.bottom) (* from find_lonely_key + explicit raise *) in let c_from = let open Function_Froms in let value_dep = deps_nth_arg 1 in let deps_table = Memory.add_binding ~exact:false Memory.empty over_zone value_dep in let deps_table = Memory.add_binding ~exact:true deps_table sure_zone value_dep in let deps_return = deps_nth_arg 0 in { deps_table; deps_return } in { Value_types.c_values = [Eval_op.wrap_ptr dst, new_state']; c_clobbered = Base.SetLattice.bottom; c_from = Some(c_from,sure_zone); c_cacheable = Value_types.Cacheable; } (* let () = register_builtin "Frama_C_memset" frama_c_memset_imprecise *) (* Type that describes why the 'precise memset' builtin may fail. *) type imprecise_memset_reason = | UnsupportedType | ImpreciseTypeSize | NoTypeForDest | NotSingletonLoc | SizeMismatch | ImpreciseValue | ImpreciseSize | NegativeOrNullSize (* The zero case is licit, but it is simpler to handle through the imprecise builtin. See bts #1799 *) exception ImpreciseMemset of imprecise_memset_reason let pretty_imprecise_memset_reason fmt = function | UnsupportedType -> Format.pp_print_string fmt "destination has an unknown type" | ImpreciseTypeSize -> Format.pp_print_string fmt "destination has a type with unknown size" | NoTypeForDest -> Format.pp_print_string fmt "destination has an unknown form" | NotSingletonLoc -> Format.pp_print_string fmt "destination is not exact" | SizeMismatch -> Format.pp_print_string fmt "destination type and size differ" | ImpreciseValue -> Format.pp_print_string fmt "value to write is imprecise" | ImpreciseSize -> Format.pp_print_string fmt "size is imprecise" | NegativeOrNullSize -> Format.pp_print_string fmt "size is negative or null" (* [memset_typ_offsm typ i] returns an offsetmap of size [sizeof(typ)] that maps each byte to the integer [i]. The shape of the type is respected: the fields in [typ] are bound to values of the good type, not just to 'i%repeated modulo 8'. May raise ImpreciseMemset. *) let memset_typ_offsm_int full_typ i = try let size = Int.of_int (Cil.bitsSizeOf full_typ) in let vi = V_Or_Uninitialized.initialized (Cvalue.V.inject_int i) in let size_char = Bit_utils.sizeofchar () in let full_offsm = V_Offsetmap.create ~size vi ~size_v:size_char in if Int.is_zero i then full_offsm (* Shortcut: no need to follow the type, this offsetmap is optimally precise *) else let validity = Base.validity_from_size size in let rec aux styp offset offsm = (* Read [full_offsm] between [offset] and [offset+size-1], and return the value stored there. *) let find size = V_Offsetmap.find ~validity ~offsets:(Ival.inject_singleton offset) ~size full_offsm in (* Update [full_offsm] between [offset] and [offset+size-1], and store exactly [v] there *) let update size v = let bounds = (offset, Int.(pred (add offset size))) in let vinit = V_Or_Uninitialized.initialized v in V_Offsetmap.add bounds (vinit, size, Rel.zero) offsm in match Cil.unrollType styp with | TInt _ | TEnum _ | TPtr _ -> let size = Eval_typ.sizeof_lval_typ styp (* handles bitfields *) in let size = Int_Base.project size in let v = V_Or_Uninitialized.get_v (find size) in let signed = Bit_utils.is_signed_int_enum_pointer styp in let v = Cvalue.V.cast_int_to_int ~size ~signed v in update size v | TFloat _ -> let size = Int.of_int (Cil.bitsSizeOf styp) in let v = V_Or_Uninitialized.get_v (find size) in let v' = Cvalue_forward.reinterpret styp v in let f = Ival.project_float (Cvalue.V.project_ival v') in (* Do not produce NaN or infinites here (unless they are accepted by the engine). *) if Fval.is_finite f = True then update size v' else update size v | TComp ({ cstruct = true ; cfields = l}, _, _) as tcomp -> (* struct *) let aux_field offsm fi = let field = Field (fi, NoOffset) in let offset_fi = Int.of_int (fst (Cil.bitsOffset tcomp field)) in aux fi.ftype (Int.add offset offset_fi) offsm in List.fold_left aux_field offsm l | TComp ({ cstruct = false ; cfields = l}, _, _) -> (* union *) (* Use only the first field. This is somewhat arbitrary *) aux (List.hd l).ftype offset offsm | TArray (typelt, nb, _, _) -> begin let nb = Cil.lenOfArray64 nb in (* always succeeds, we computed the size of the entire type earlier *) if Integer.(gt nb zero) then begin let sizeelt = Int.of_int (Cil.bitsSizeOf typelt) in (* Do the first cell *) let offsm' = aux typelt offset offsm in if Integer.(gt nb one) then begin (* Copy the result *) let src = Ival.inject_singleton offset in let copy = V_Offsetmap.copy_slice ~validity ~offsets:src ~size:sizeelt offsm' in (* Paste on all offsets > 1 *) let dst = let idx = Ival.inject_range (Some Int.one) (Some (Int.pred nb)) in let idx_size = Ival.scale sizeelt idx in Ival.add_singleton_int offset idx_size in match copy with | `Bottom -> assert false (* the copy is within bounds *) | `Value copy -> let r = V_Offsetmap.paste_slice ~validity ~exact:true ~from:copy ~size:sizeelt ~offsets:dst offsm' in match r with | `Bottom -> assert false (* so is the write *) | `Value r -> r end else offsm' (* size = 1 *) end else offsm (* size = 0. Do nothing, this is supposed to be invalid anyway *) end | TVoid _ | TFun _ | TBuiltin_va_list _ -> raise (ImpreciseMemset UnsupportedType) | TNamed _ -> assert false (* unrolled *) in aux full_typ Int.zero full_offsm with Cil.SizeOfError _ | Abstract_interp.Error_Top -> raise (ImpreciseMemset ImpreciseTypeSize) (* Type-aware memset on an entire type. Same as [memset_typ_offsm_int], but with a [Cvalue.V] instead of an integer. We accept [-ilevel] different possible values in [v] before falling back to the imprecise memset. May raise {!ImpreciseMemset}. *) let memset_typ_offsm typ v = try let i = V.project_ival v in ignore (Ival.cardinal_less_than i (Ival.get_small_cardinal ())); let aux_i i offsm = let offsm_i = memset_typ_offsm_int typ i in match offsm with | None -> Some offsm_i | Some o -> Some (Cvalue.V_Offsetmap.join o offsm_i) in begin match Ival.fold_int aux_i i None with | None -> (* v == Ival.bottom *) raise (ImpreciseMemset ImpreciseValue) | Some o -> o end with V.Not_based_on_null | Not_less_than -> raise (ImpreciseMemset ImpreciseValue) (* Precise memset builtin, that requires its arguments to be sufficiently precise abstract values. *) let frama_c_memset_precise state dst v (exp_size, size) = try let size_char = Bit_utils.sizeofchar () in (* We want an exact size, Otherwise, we can use the imprecise memset as a fallback *) let isize = V.project_ival size in let size = Ival.project_int isize in let size_bits = Integer.mul size_char size in (* Extract the location, check that it is precise. *) if not (Location_Bytes.cardinal_zero_or_one dst) then raise (ImpreciseMemset NotSingletonLoc); if not (Int.gt size Int.zero) then raise (ImpreciseMemset NegativeOrNullSize); (* Now, try to find a type that matches [size]. *) let typ = (* If [exp_size] is a sizeof, use this type. *) let rec find_sizeof e = match e.enode with | SizeOf typ -> Some typ | SizeOfE e -> Some (Cil.typeOf e) | CastE (_, e) -> find_sizeof e | _ -> None in match find_sizeof exp_size with | Some typ -> typ | None -> (* No such luck. Use the base and the offset of [dst] to resynthesize a type *) let base_dst, offset_dst = Location_Bytes.find_lonely_binding dst in let offset_dst = Ival.project_int offset_dst in let offset_dst_bits = Int.mul offset_dst size_char in let vi_dst = Base.to_varinfo base_dst in let mo = Bit_utils.MatchSize size_bits in snd (Bit_utils.(find_offset vi_dst.vtype offset_dst_bits mo)) in let offsm = memset_typ_offsm typ v in let dst_loc = Locations.loc_bytes_to_loc_bits dst in let (c_from,dst_zone) = let input = deps_nth_arg 1 in let open Function_Froms in let size_bits = Integer.mul size (Bit_utils.sizeofchar ())in let dst_location = Locations.make_loc dst_loc (Int_Base.Value size_bits) in let dst_zone = Locations.(enumerate_valid_bits Write dst_location) in let deps_table = Function_Froms.Memory.add_binding ~exact:true Function_Froms.Memory.empty dst_zone input in let deps_return = deps_nth_arg 0 in let c_from = { deps_table; deps_return } in c_from,dst_zone in let _ = c_from in let state' = Cvalue.Model.paste_offsetmap ~from:offsm ~dst_loc ~size:size_bits ~exact:true state in { Value_types.c_values = [Eval_op.wrap_ptr dst, state']; c_clobbered = Base.SetLattice.bottom; c_from = Some (c_from,dst_zone); c_cacheable = Value_types.Cacheable; } with | Bit_utils.NoMatchingOffset -> raise (ImpreciseMemset SizeMismatch) | Base.Not_a_C_variable -> raise (ImpreciseMemset NoTypeForDest) | Cil.SizeOfError _ -> raise (ImpreciseMemset ImpreciseTypeSize) | Ival.Not_Singleton_Int | V.Not_based_on_null -> raise (ImpreciseMemset ImpreciseSize) (* let () = register_builtin "Frama_C_memset_precise" frama_c_memset_precise *) let frama_c_memset state actuals = match actuals with | [(_exp_dst, dst, _); (_, v, _); (exp_size, size, _)] -> begin (* Remove read-only destinations *) let dst = V.filter_base (fun b -> not (Base.is_read_only b)) dst in (* Keep only the first byte of the value argument *) let _, v = Cvalue.V.extract_bits ~topify:Origin.K_Misalign_read ~start:Int.zero ~stop:(Int.pred (Bit_utils.sizeofchar ())) ~size:(Int.of_int (Cil.bitsSizeOfInt IInt)) v in try frama_c_memset_precise state dst v (exp_size, size) with ImpreciseMemset reason -> Value_parameters.debug ~dkey ~current:true "Call to builtin precise_memset(%a) failed; %a%t" pretty_actuals actuals pretty_imprecise_memset_reason reason Value_util.pp_callstack; frama_c_memset_imprecise state dst v size end | _ -> raise (Builtins.Invalid_nb_of_args 3) let () = register_builtin ~replace:"memset" "Frama_C_memset" frama_c_memset let frama_c_interval_split state actuals = try begin match actuals with | [_,lower,_; _,upper,_] -> let upper = Ival.project_int (Cvalue.V.project_ival upper) in let lower = Ival.project_int (Cvalue.V.project_ival lower) in let i = ref lower in let r = ref [] in while (Int.le !i upper) do r := (Eval_op.wrap_int (Cvalue.V.inject_int !i), state) :: !r; i := Int.succ !i; done; { Value_types.c_values = !r; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } | _ -> raise (Builtins.Invalid_nb_of_args 2) end with | Cvalue.V.Not_based_on_null | Ival.Not_Singleton_Int -> Value_parameters.error "Invalid call to Frama_C_interval_split%a" pretty_actuals actuals; raise Db.Value.Aborted let () = register_builtin "Frama_C_interval_split" frama_c_interval_split (* Transforms a garbled mix into Top_int. Let other values unchanged. Remark: this currently returns an int. Maybe we need multiple versions? *) let frama_c_ungarble state actuals = begin match actuals with | [_,i,_] -> let v = try ignore (V.project_ival i); i with V.Not_based_on_null -> V.inject_ival Ival.top in { Value_types.c_values = [ Eval_op.wrap_int v, state ]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } | _ -> raise (Builtins.Invalid_nb_of_args 1) end let () = register_builtin "Frama_C_ungarble" frama_c_ungarble (* Local Variables: compile-command: "make -C ../../../../.." End: *) ��������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_memory.mli���������������������������0000666�0000000�0000000�00000003401�13571573400�023432� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Nothing is exported, all the builtins are registered through {Builtins.register_builtin} *) (* Local Variables: compile-command: "make -C ../../../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_misc.ml������������������������������0000666�0000000�0000000�00000005051�13571573400�022707� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Value_util let frama_C_assert state actuals = let do_bottom () = warning_once_current "Frama_C_assert: false"; Cvalue.Model.bottom in match actuals with | [arg_exp, arg, _arg_offsm] -> begin let state = if Cvalue.V.is_zero arg then do_bottom () else if Cvalue.V.contains_zero arg then begin let state = !Db.Value.reduce_by_cond state arg_exp true in if Cvalue.Model.is_reachable state then (warning_once_current "Frama_C_assert: unknown"; state) else do_bottom () end else begin warning_once_current "Frama_C_assert: true"; state end in { Value_types.c_values = [ None, state ] ; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.NoCache; } end | _ -> raise (Builtins.Invalid_nb_of_args 1) let () = Builtins.register_builtin "Frama_C_assert" frama_C_assert ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_misc.mli�����������������������������0000666�0000000�0000000�00000003330�13571573400�023056� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Builtins for normalization and dumping of values or state. Builtins are registered directly, and are not exported here. *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_print_c.ml���������������������������0000666�0000000�0000000�00000031015�13571573400�023411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Abstract_interp open Cvalue let substitute_space_by_underscore s = String.map (fun c -> assert (c <> '*'); if c = ' ' then '_' else c) s let c_string_of_int n = if Int.equal n (Int.of_string "-2147483648") then "-2147483648LL" else if Int.equal n (Int.of_string "-9223372036854775808") then "(long long)-9223372036854775808ULL" else Int.to_string n let pretty_assignment_expression_ival typname fmt v = match Ival.min_and_max v with | Some mn, Some mx -> let mn_repr = c_string_of_int mn in if Int.equal mn mx then Format.fprintf fmt "%s" mn_repr else let mx_repr = c_string_of_int mx in Format.fprintf fmt "Frama_C_%s_interval(%s, %s)" (substitute_space_by_underscore typname) mn_repr mx_repr | _, _ -> assert false let pretty_assignment_expression typname fmt v = match v with | Locations.Location_Bytes.Top (Base.SetLattice.Top, _) -> Format.fprintf fmt "{{ ANYTHING }}" | Locations.Location_Bytes.Top (t, _) -> Format.fprintf fmt "{{ garbled mix of &%a }}" Base.SetLattice.pretty t | Locations.Location_Bytes.Map m -> let print_binding fmt k v = if Ival.equal Ival.zero v then Format.fprintf fmt "%a" Base.pretty_addr k else begin Format.fprintf fmt "(char*)%a + %a" Base.pretty_addr k (pretty_assignment_expression_ival typname) v end in Pretty_utils.pp_iter ~pre:" " ~suf:" " ~sep:" ;@ " (fun pp map -> Locations.Location_Bytes.M.iter (fun k v -> pp (k, v)) map) (fun fmt (k, v) -> print_binding fmt k v) fmt m let pretty_int_range fmt print_ampamp typname lv v = let v = V.project_ival v in match Ival.min_and_max v with | Some mn, Some mx -> let mn_repr = c_string_of_int mn in if Int.equal mn mx then begin print_ampamp(); Format.fprintf fmt "(*(%s*)%s == %s || (printf(\"%%d\\n\", __LINE__), 0))" typname lv mn_repr end else begin let mx_repr = c_string_of_int mx in print_ampamp(); Format.fprintf fmt "((%s <= *(%s*)%s && *(%s*)%s <= %s) || (printf(\"%%d\\n\", __LINE__), 0))" mn_repr typname lv typname lv mx_repr end | _ -> () let pretty_int_assignment fmt typname lv v = Format.fprintf fmt "*(%s*)%s = %a;\n" typname lv (pretty_assignment_expression_ival typname) (V.project_ival v) let pretty_float_range fmt print_ampamp typname lv v = let use_hex = true in let pp_float = Fval.F.pretty_normal ~use_hex in let i = V.project_ival v in match Ival.min_and_max_float i with | None, _ | Some _, true (* contains NaN, unsupported for now *) -> () | Some (mn, mx), false -> if Fval.F.equal mn mx then begin print_ampamp(); Format.fprintf fmt "(*(%s*)%s == %a || (printf(\"%%d\\n\", __LINE__), 0))" typname lv pp_float mn end else begin print_ampamp(); Format.fprintf fmt "((%a <= *(%s*)%s && *(%s*)%s <= %a) || (printf(\"%%d\\n\", __LINE__), 0))" pp_float mn typname lv typname lv pp_float mx; end let pretty_float_assignment fmt typname lv v = let use_hex = true in let pp_float = Fval.F.pretty_normal ~use_hex in let i = V.project_ival v in match Ival.min_and_max_float i with | None, _ | Some _, true (* contains NaN, unsupported for now *) -> () | Some (mn, mx), false -> if Fval.F.equal mn mx then begin Format.fprintf fmt "*(%s*)%s = %a;\n" typname lv pp_float mn end else begin Format.fprintf fmt "*(%s*)%s = Frama_C_%s_interval(%a, %a);\n" typname lv (substitute_space_by_underscore typname) pp_float mn pp_float mx end let pretty_pointer_assignment fmt typname lv v = if V.cardinal_zero_or_one v then Format.fprintf fmt "*(void * *)%s = %a;\n" lv (pretty_assignment_expression typname) v else Kernel.abort ~current:true "pretty_pointer_assignment expected cardinal zero or one@ \ for value %a (lv %s);@ \ (did you forget -val-no-alloc-returns-null?)" Cvalue.V.pretty v lv let types = Hashtbl.create 7;; let () = Hashtbl.add types 1 [V.inject_ival (Ival.inject_range (Some Int.zero) (Some (Int.of_int 255))), "unsigned char", pretty_int_range, pretty_int_assignment; V.inject_ival (Ival.inject_range (Some (Int.of_int (-128))) (Some (Int.of_int 127))), "char", pretty_int_range, pretty_int_assignment]; Hashtbl.add types 2 [V.inject_ival (Ival.inject_range (Some Int.zero) (Some (Int.of_int 65535))), "unsigned short", pretty_int_range, pretty_int_assignment; V.inject_ival (Ival.inject_range (Some (Int.of_int (-32768))) (Some (Int.of_int 32767))), "short", pretty_int_range, pretty_int_assignment]; Hashtbl.add types 4 [ V.top_float, "float", pretty_float_range, pretty_float_assignment; V.inject_ival (Ival.inject_range (Some Int.zero) (Some (Int.of_string "4294967295"))), "unsigned int", pretty_int_range, pretty_int_assignment; V.inject_ival (Ival.inject_range (Some (Int.of_string "-2147483648")) (Some (Int.of_string "2147483647"))), "int", pretty_int_range, pretty_int_assignment; V.top, "void *", (fun _ _ _ _ _ -> ()) , pretty_pointer_assignment ]; Hashtbl.add types 8 [ V.top_float, "double", pretty_float_range, pretty_float_assignment; V.inject_ival(Ival.inject_range (Some (Int.of_string "0")) (Some (Int.of_string "18446744073709551615"))), "unsigned long long", pretty_int_range, pretty_int_assignment; V.inject_ival (Ival.inject_range (Some (Int.of_string "-9223372036854775808")) (Some (Int.of_string "9223372036854775807"))), "long long", pretty_int_range, pretty_int_assignment] ;; exception Too_large_to_enumerate let value_pretty cas print_ampamp lv s_bytes fmt v = try let candidate_types = Hashtbl.find types s_bytes in let rec find_typ = function | [] -> () | (range, _, _, _) :: t when not (V.is_included v range) -> find_typ t | (_range, typname, pr, _) :: _ -> pr fmt print_ampamp typname lv v in let rec find_typ_assignment = function | [] -> () | (range, _, _, _) :: t when not (V.is_included v range) -> find_typ_assignment t | (_range, typname, _, pr) :: _ -> pr fmt typname lv v in if cas then find_typ candidate_types else find_typ_assignment candidate_types with | V.Not_based_on_null -> () | Not_found -> Value_parameters.result "Unknown size %d for %s" s_bytes lv let value_uninit_pretty cas prampamp lv s fmt = function | V_Or_Uninitialized.C_init_noesc v -> value_pretty cas prampamp lv s fmt v | _ -> () let offsetmap_pretty cas name print_ampamp fmt offsm = let pretty_binding (bk,ek) (v, modu, offset) = let iso = V_Or_Uninitialized.is_isotropic v in if Integer.is_zero (Integer.e_rem bk Integer.eight) && (Rel.is_zero offset) && (iso || (Integer.is_zero (Integer.e_rem modu Integer.eight))) then let ek = Integer.succ ek in if Integer.is_zero (Integer.e_rem ek Integer.eight) then let step = if iso then 1 else (Integer.to_int modu) / 8 in let start = ref ((Integer.to_int bk) / 8) in let ek = Integer.to_int ek in let ek = ek / 8 in if ek / step > 1_000_000 (* arbitrary limit *) then raise Too_large_to_enumerate; while !start + step <= ek do let lv = if !start = 0 then Format.sprintf "&%s" name else Format.sprintf "((unsigned char*)&%s+%d)" name !start in value_uninit_pretty cas print_ampamp lv step fmt v; start := !start + step done; else () else () in Cvalue.V_Offsetmap.iter pretty_binding offsm let state_pretty cas fmt m = Format.fprintf fmt "@["; (match m with | Model.Bottom -> Format.fprintf fmt "0" | Model.Map m -> let first = ref true in let print_ampamp () = if !first then first := false else Format.fprintf fmt "@\n&& "; in Model.iter (fun base offs -> match base with | Base.Allocated (v,_,_) | Base.Var(v,_) -> let name = v.Cil_types.vname in if name <> "crc32_tab" (* Specialized for Csmith *) then begin try offsetmap_pretty cas name print_ampamp fmt offs with | Z.Overflow | Too_large_to_enumerate -> Value_parameters.warning "base %s too large, \ will not print it" name end | _ -> ()) m | Model.Top -> Format.fprintf fmt "1" ); Format.fprintf fmt "@]" let pretty_state_as_c_assert = state_pretty true let print_declarations_for_malloc_bases fmt = let pretty_declaration base _cs () = match base with | Base.Allocated (var, _, validity) | Base.Var (var, validity) -> let name = var.Cil_types.vname in let dim = match validity with | Base.Known (l,u) when (Int.is_zero l)-> Int.e_div (Int.succ u) Int.eight | Base.Variable { Base.min_alloc; max_alloc } when Int.(ge min_alloc zero && equal min_alloc max_alloc) -> Int.e_div (Int.succ min_alloc) Int.eight | _ -> Kernel.abort ~current:true "got unexpected validity: %a" Base.pretty_validity validity in Format.fprintf fmt "char %s[%a];\n" name Int.pretty dim | _ -> Kernel.abort ~current:true "got non-Var, non-Allocated base: %a" Base.pretty base in Builtins_malloc.fold_dynamic_bases pretty_declaration () let pretty_state_as_c_assignments fmt state = print_declarations_for_malloc_bases fmt ; Format.fprintf fmt "void Frama_C_dump_assignments(void)\n{%a}" (state_pretty false) state let frama_c_dump_assert state _actuals = Value_parameters.result ~current:true "Frama_C_dump_assert_each called:@\n(%a)@\nEnd of Frama_C_dump_assert_each output" pretty_state_as_c_assert state; { Value_types.c_values = [None, state]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.NoCache; } let () = Builtins.register_builtin "Frama_C_dump_assert_each" frama_c_dump_assert let frama_c_dump_assignments state _actuals = Value_parameters.result ~current:true "Frama_C_dump_assignment_each called:@\n%a@\nEnd of Frama_C_dump_assignment_each output" pretty_state_as_c_assignments state; { Value_types.c_values = [None, state]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.NoCache; } let () = Builtins.register_builtin "Frama_C_dump_assignments_each" frama_c_dump_assignments (* Local Variables: compile-command: "make -C ../../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_print_c.mli��������������������������0000666�0000000�0000000�00000003734�13571573400�023571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Translate a Value state into a bunch of C assertions *) (** This file is experimental, and partly tuned to Csmith programs. In particular, it might not follow your machdep, or fail to translate some variables. Use at your own risk *) val pretty_state_as_c_assert: Cvalue.Model.t Pretty_utils.formatter val pretty_state_as_c_assignments: Cvalue.Model.t Pretty_utils.formatter ������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_split.ml�����������������������������0000666�0000000�0000000�00000021404�13571573400�023107� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Abstract_interp open Cvalue (** Enumeration *) (** Cardinal of an abstract value (-1 if not enumerable). Beware this builtin is not monotonic *) let frama_c_cardinal state actuals = match actuals with | [_, v, _] -> begin let nb = match Cvalue.V.cardinal v with | None -> Cvalue.V.inject_int Integer.minus_one | Some i -> Cvalue.V.inject_int i in { Value_types.c_values = [Eval_op.wrap_long_long nb, state]; c_clobbered = Base.SetLattice.empty; c_cacheable = Value_types.Cacheable; c_from = None; } end | _ -> Kernel.abort ~current:true "Incorrect argument for Frama_C_cardinal" let () = !Db.Value.register_builtin "Frama_C_abstract_cardinal" frama_c_cardinal (** Minimum or maximum of an integer abstract value, Top_int otherwise. Also not monotonic. *) let frama_c_min_max f state actuals = match actuals with | [_, v, _] -> begin let nb = try match f (Ival.min_and_max (V.project_ival v)) with | None -> Cvalue.V.top_int | Some i -> Cvalue.V.inject_int i with V.Not_based_on_null -> Cvalue.V.top_int in { Value_types.c_values = [Eval_op.wrap_long_long nb, state]; c_clobbered = Base.SetLattice.empty; c_cacheable = Value_types.Cacheable; c_from = None; } end | _ -> Kernel.abort ~current:true "Incorrect argument for Frama_C_min/max" let () = !Db.Value.register_builtin "Frama_C_abstract_min" (frama_c_min_max fst); !Db.Value.register_builtin "Frama_C_abstract_max" (frama_c_min_max snd); ;; (** Splitting values *) let warning warn s = if warn then Value_parameters.result ~current:true ~once:true s else Pretty_utils.nullprintf s (* Split the contents of lv (by using multiple states), provided that [lv] is a singleton location with an arithmetic type, and that it contains no more than [max_card] elements. *) let split_v ~warn lv state max_card = if Cil.isArithmeticOrPointerType (Cil.typeOfLval lv) then let loc = !Db.Value.lval_to_loc_state state lv in if Locations.Location_Bits.cardinal_zero_or_one loc.Locations.loc then let v_indet = Cvalue.Model.find_indeterminate state loc in let v = Cvalue.V_Or_Uninitialized.get_v v_indet in if V.is_bottom v then (* Alarm. *) [state] (* Cannot split, but cardinal '0' anyway *) else try ignore (V.cardinal_less_than v max_card); let aux_v v states = let v_indet = (* Restore original dangling/unitialized flags *) Cvalue.V_Or_Uninitialized.map (fun _ -> v) v_indet in let state' = Model.add_indeterminate_binding ~exact:true state loc v_indet in state' :: states in V.fold_enum aux_v v [] with Not_less_than -> warning warn "Location %a points to too many values (%a). \ Cannot split." Printer.pp_lval lv V.pretty v; [state] else begin warning warn "Location %a is not a singleton (%a). Cannot split." Printer.pp_lval lv Locations.pretty loc; [state] end else begin warning warn "Cannot split on lvalue %a of non-arithmetic type" Printer.pp_lval lv; [state] end (* For an lvalue '*p' or 'p->off', split the values of 'p'. Do not split anything else. *) let split_pointer ~warn lv state max_card = match lv with | (Mem {enode = Lval lv}, _) -> split_v ~warn lv state max_card | _ -> warning warn "cannot split on non-pointer %a" Printer.pp_lval lv; [state] (** The three functions below gather all lvalues with integral type that appear in an expression, an lvalue, or the offset of an lvalue (respectively). We use a recursive descent instead of a visitor because we want to impose an order to the visit. In particular, we want to see 'i' before 't[i]' when examing 't[i]+1', as it is important to proceed by case analysis on 'i' first, then on 't[i]'. *) let rec gather_lv_in_exp acc e = match e.enode with | Const _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> acc | Lval lv | AddrOf lv | StartOf lv -> gather_lv_in_lv acc lv | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> gather_lv_in_exp acc e | BinOp (_, e1, e2, _) -> gather_lv_in_exp (gather_lv_in_exp acc e1) e2 and gather_lv_in_lv acc (host, offset as lv) = let acc = if Cil.isArithmeticOrPointerType (Cil.typeOfLval lv) then lv :: acc else acc in let acc = match host with | Var _ -> acc | Mem e -> gather_lv_in_exp acc e in let acc = gather_lv_in_offset acc offset in (* All variants (host, o) where [o] is a strict prefix of [offset] have type [union], [struct] or [array], thus we have covered all combinations *) acc and gather_lv_in_offset acc offset = match offset with | NoOffset -> acc | Field (_, o) -> gather_lv_in_offset acc o | Index (e, o) -> gather_lv_in_offset (gather_lv_in_exp acc e) o (** Split recursively all the lvalues that appear in [lv], including [lv] itself if possible. *) let split_all ~warn lv state max_card = let lvs = gather_lv_in_lv [] lv in (* split all the lvalues in [lvs], in all the states in [states]. May create *many* states. *) let rec split lvs states = match lvs with | [] -> states | lv :: q -> let aux_state states state = let states_lv = split_v ~warn lv state max_card in states_lv @ states in let states = List.fold_left aux_state [] states in split q states in split lvs [state] (* Auxiliary function, used to register a 'Frama_C_split' variant. Only the parsing and the error handling is shared; all the hard work is done by [f] *) let aux_split f state actuals = match actuals with | [({ enode = (Lval lv | CastE (_, {enode = Lval lv}))}, _, _); (_, card, _)] -> begin try let max_card = Integer.to_int (Ival.project_int (V.project_ival_bottom card)) in let states = f ~warn:true lv state max_card in (* Add empty return *) let states = List.map (fun state -> None, state) states in { Value_types.c_values = states; c_clobbered = Base.SetLattice.bottom; c_cacheable = Value_types.Cacheable; c_from = None; } with V.Not_based_on_null | Ival.Not_Singleton_Int -> Value_parameters.warning ~current:true ~once:true "Cannot use non-constant split level %a" V.pretty card; { Value_types.c_values = [(None, state)]; c_clobbered = Base.SetLattice.bottom; c_cacheable = Value_types.Cacheable; c_from = None; } end | _ -> Value_parameters.warning ~current:true ~once:true "Cannot interpret split directive. Ignoring"; { Value_types.c_values = [(None, state)]; c_clobbered = Base.SetLattice.bottom; c_cacheable = Value_types.Cacheable; c_from = None; } let () = !Db.Value.register_builtin "Frama_C_builtin_split" (aux_split split_v) let () = !Db.Value.register_builtin "Frama_C_builtin_split_pointer" (aux_split split_pointer) let () = !Db.Value.register_builtin "Frama_C_builtin_split_all" (aux_split split_all) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_split.mli����������������������������0000666�0000000�0000000�00000003245�13571573400�023263� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Nothing exported, the various functions are registered as Value builtins. *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_string.ml����������������������������0000666�0000000�0000000�00000050440�13571573400�023264� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Comp = Abstract_interp.Comp (* Definition of a search. *) type kind = { search: Ival.t; (* Set of possible characters searched. *) stop_at_0: bool; (* Does the search stop when encountering \0. *) size: Integer.t; (* Size in bits of a character. *) signed: bool; (* Whether the characters are signed. *) limit: Ival.t option; } (* Limit in bits of the search. *) (* Result of a search. We always compute in bits both the offset and the length. The null field is true if the search may end normally but empty-handed. *) type t = { null: bool; (* Is null a possible resulting pointer? *) offset: Ival.t; (* Offsets of the found characters. *) length: Ival.t; (* Distance between [offset] and the start of the search. *) alarm: bool; } (* True if possible undefined behavior. *) let empty = { null = false; offset = Ival.bottom; length = Ival.bottom; alarm = false } let join a b = { null = a.null || b.null; offset = Ival.join a.offset b.offset; length = Ival.join a.length b.length; alarm = a.alarm || b.alarm } (* Accumulator propagated through a search in an offsetmap. *) type acc = { read: t; (* The result of the search. *) from: Ival.t; (* The offsets from which the current search has begun. *) stop: bool; } (* True if the search is completely done. *) let the_max_int ival = Extlib.the (Ival.max_int ival) let pos_min_int ival = match Ival.min_int ival with | None -> Integer.zero | Some i -> Integer.(max zero i) (* Backward reduction of an ival against an integer.*) let backward_comp_left comp ival integer = Ival.backward_comp_int_left comp ival (Ival.inject_singleton integer) (* The search stops at [offset]. If the search always starts before [offset], the search is stopped. Otherwise, the search continues beyond [offset], but we reduce [from] to remove offsets before [offset]; this improves the precision of the computed length. This reduction assumes that all the reads at [offset] are consecutive. *) let break ~offset ~from read = let from = backward_comp_left Comp.Gt from (the_max_int offset) in { read; from; stop = Ival.is_bottom from } (* Computes the precise offset and length when reading exactly the searched character at [offset]. The offset can be reduced to the first offset beyond the last offset in which the search may start. The maximal length is the length for the first offset or the period of [offset]. *) let read_exact_char ~offset ~from = let min = Integer.max (the_max_int from) (pos_min_int offset) in let offset = backward_comp_left Comp.Le offset min in let length = Ival.sub_int offset from in match offset with | Ival.Top (_min, _max, _rem, modu) -> let start_length = Integer.sub (pos_min_int offset) (pos_min_int from) in let max_length = Integer.max start_length modu in let length = backward_comp_left Comp.Lt length max_length in offset, length | _ -> offset, length (* Checks if some limits are reached after a read at [offset]. In this case, adds these limits as possible lengths in [t], and adds null to [t]. *) let check_limit kind ~offset ~from t = match kind.limit with | None -> t | Some limit -> let offset = Ival.add_singleton_int kind.size offset in let length = Ival.sub_int offset from in let limit_reached = Ival.backward_comp_int_left Comp.Le limit length in if Ival.is_bottom limit_reached then t else let length = Ival.join t.length limit_reached in { t with null = true; length } (* Reads the character [cvalue] at offsets [offset]. [kind] describes the search, [from] are the offsets from which the current search has begun, and is used to compute the length. The reduction of [from] assumes that the reads at [offset] are consecutive. *) let read_one_char kind ~offset ~from cvalue = let alarm = Cvalue.V_Or_Uninitialized.is_indeterminate cvalue in let cvalue = Cvalue.V_Or_Uninitialized.get_v cvalue in (* If no value can be read here, break the search. *) if Cvalue.V.is_bottom cvalue then break ~offset ~from { empty with alarm } else let ival = Cvalue.V.project_ival cvalue in (* Casts the ival into the proper type. *) let size, signed = kind.size, kind.signed in let ival = Ival.reinterpret_as_int ~size ~signed ival in (* May the search reach a terminating character here? *) let null = kind.stop_at_0 && Ival.contains_zero ival in (* Compares [ival] with the searched characters. *) let read, found = if not (Ival.intersects ival kind.search) then { empty with null; alarm }, false else let exact = Ival.(equal ival kind.search && is_singleton_int ival) in let offset, length = if exact then read_exact_char ~offset ~from else offset, Ival.sub_int offset from in { null; offset; length; alarm }, exact in (* Breaks the search if it always reaches a searched or a terminating character here. Otherwise, checks if a limit has been reached. *) if found || (kind.stop_at_0 && Ival.is_zero ival) then break ~offset ~from read else let read = check_limit kind ~from ~offset read in { read; from; stop = false } (* Reads the character [cvalue] at [offset], and updates [acc] accordingly. *) let read_char kind offset cvalue acc = let new_acc = read_one_char kind ~offset ~from:acc.from cvalue in { new_acc with read = join acc.read new_acc.read } (* Reads the [offsetmap] character by character, starting from [index], with a period of [kind.size], until reaching [max]. Precise but inefficient. *) let rec search_each_index kind ~validity ~index ~max offsetmap acc = let offsets = Ival.inject_singleton index in let size = kind.size in let cvalue = Cvalue.V_Offsetmap.find ~validity ~offsets ~size offsetmap in let acc = read_char kind offsets cvalue acc in let index = Integer.add index size in if acc.stop || Integer.gt index max then acc else search_each_index kind ~validity ~index ~max offsetmap acc (* Reads at once the characters of size [kind.size] in the range [min..max] in the [offsetmap], that contains the repeated value [v] of size [v_size]. Assumes that [min] and [max] match the start and the end of the values. *) let search_range kind ~min ~max (v, v_size, _v_shift) acc = let make_interval ~min ~max = Ival.inject_interval ~min:(Some min) ~max:(Some max) in (* Case where only one read is needed. *) if Cvalue.V_Or_Uninitialized.is_isotropic v || Integer.equal kind.size v_size then let offset = make_interval ~min ~max ~rem:Integer.zero ~modu:kind.size in read_char kind offset v acc else (* The value [v] contains [nb_chars] characters: need [nb_chars] reads. *) let nb_chars = Integer.e_div v_size kind.size in (* Reads the [count]-nth character in [v]. *) let rec do_one_char count ~max res = let start = Integer.mul kind.size count in let min = Integer.add min start in if Integer.ge count nb_chars || Integer.gt min max then res else let stop = Integer.(add start (pred kind.size)) in let _, cvalue = Cvalue.V_Or_Uninitialized.extract_bits ~topify:Origin.K_Misalign_read ~start ~stop ~size:v_size v in let rem = Integer.mul count kind.size in let offset = make_interval ~min ~max ~rem ~modu:v_size in (* Be careful to not use this result [t] for the reads of the next characters, as the reduction of [acc.from] assumes that the reads at [offset] are consecutive, which is not the case here. Thus, we always read with the initial [acc], and accumulate the result in [res]. *) let t = read_char kind offset cvalue acc in let read = join res.read t.read in (* At the end, the [nb_chars] reads are indeed consecutive, and we can use the narrow of the [from] for the next ranges of the offsetmap. *) let from = Ival.narrow res.from t.from in let res = { read; from; stop = res.stop || t.stop; } in do_one_char (Integer.succ count) ~max res in (* The maximal offset we are sure to read. *) let sure_offset = Integer.max (the_max_int acc.from) min in let sure_max = Integer.add sure_offset v_size in (* If one of the read characters stops the search, the other characters will lead to imprecise results — as they are all periodic until [max]. Thus we perform a first read until the maximal sure read offset. *) let acc = if Integer.lt sure_max max then do_one_char Integer.zero ~max:sure_max acc else acc in if acc.stop then acc else do_one_char Integer.zero ~max acc (* Folds the [offsetmap] from [start] to [max]. *) let fold_offsm kind ~validity ~start ~max offsetmap acc = let modu = kind.size in let process_range (start, max) (v, v_size, v_shift) acc = if acc.stop then acc else let index = Integer.round_up_to_r ~min:start ~r:Integer.zero ~modu in let v_start = Abstract_interp.Rel.add_abs start v_shift in (* Process the whole range at once when: - the ending cut is aligned with the reads, meaning that no read overlaps between two ranges of the offsetmap. - and either the value is isotropic, or the reads are aligned with the repeated values. *) if Integer.is_zero (Integer.e_rem (Integer.succ max) modu) && (Cvalue.V_Or_Uninitialized.is_isotropic v || Integer.(equal index v_start && is_zero (e_rem v_size kind.size))) then search_range kind ~min:index ~max (v, v_size, v_shift) acc else search_each_index kind ~validity ~index ~max offsetmap acc in Cvalue.V_Offsetmap.fold_between ~entire:false (start, max) process_range offsetmap acc (* Performs the search in the [offsetmap]. *) let search_offsm kind ~validity ~offset offsetmap = let start = pos_min_int offset in (* Compute the maximal bit that can be read in the offsetmap. *) let base_max = match Base.valid_range validity with | Base.Invalid_range -> Integer.zero (* should not happen *) | Base.Valid_range None -> Bit_utils.max_bit_address () | Base.Valid_range (Some (_min, max)) -> max in (* Uses [kind.limit] to bound the read. *) let limit_max = Extlib.opt_bind Ival.max_int kind.limit in let max = match Ival.max_int offset, limit_max with | Some max_start, Some max_limit -> let max = Integer.(add max_start (pred max_limit)) in Integer.min base_max max | _, _ -> base_max in (* Starts the search with an empty accumulator. *) let acc = { read = empty; from = offset; stop = false } in let acc = fold_offsm kind ~validity ~start ~max offsetmap acc in (* Alarm if the search does not stop before the end of the offsetmap. *) if not acc.stop && Integer.gt (Integer.add max kind.size) base_max then { acc.read with alarm = true } else acc.read (* Generic function to fold a search according to a small set of integers. *) let search_by_folding ival search = if Ival.cardinal_is_less_than ival (Ival.get_small_cardinal ()) then Ival.fold_enum (fun ival acc -> join acc (search ival)) ival empty else search ival (* Performs the search at offsets [offset] in the [base] offsetmap of [state]. Folds the search according to the offset and the search characters, if they are small enough. *) let search_base kind ~offset base state = let offsetmap = Cvalue.Model.find_base_or_default base state in match offsetmap with | `Bottom -> { empty with alarm = true } | `Top -> assert false | `Value offsetmap -> let validity = Base.validity base in let search_one_char offset char = let kind = { kind with search = char } in search_offsm kind ~validity ~offset offsetmap in let search_one_offset offset = search_by_folding kind.search (search_one_char offset) in search_by_folding offset search_one_offset (* Returns a map binding a result for each base of [str]. *) let search_by_base kind str state = Locations.Location_Bits.fold_i (fun base offset acc -> let t = search_base kind ~offset base state in Base.Map.add base t acc) str Base.Map.empty (* Computes a length from a map returned by [search_by_base]. [zero] is true if the limit may have been 0, in which case the length 0 is possible. *) let return_length kind ~zero basemap = let positions = if zero then Ival.zero else Ival.bottom in let positions = Base.Map.fold (fun _ t acc -> Ival.join t.length acc) basemap positions in (* The computed length and the limit are expressed in bits. *) let positions = match kind.limit with | None -> positions | Some l -> Ival.backward_comp_int_left Comp.Le positions l in (* The returned length is expressed in number of characters. *) let positions = Ival.scale_div ~pos:false kind.size positions in let positions = Ival.backward_comp_int_left Comp.Ge positions Ival.zero in Cvalue.V.inject_ival positions (* Computes a pointer to the characters found by [search_by_base]. Adds the null pointer if necessary. [zero] is true if the limit may have been 0. *) let return_pointer ~zero basemap = let loc_bits = Base.Map.fold (fun base t acc -> Locations.Location_Bits.add base t.offset acc) basemap Locations.Location_Bits.bottom in let cvalue = Locations.loc_bits_to_loc_bytes loc_bits in if zero || Base.Map.exists (fun _base t -> t.null) basemap then Cvalue.V.add Base.null Ival.zero cvalue else cvalue (* Returns a completely imprecise result, when the builtin fails. *) let return_top ~length str = if length then Cvalue.V.top_int else let null = Cvalue.V.(add Base.null Ival.zero bottom) in Cvalue.V.fold_bases (fun b acc -> Cvalue.V.add b Ival.top acc) str null (* The complete search. Returns the length if [length] is true, and a pointer to the found characters otherwise. Handles the case of a limit 0. *) let search_char kind ~length state str = let basemap = if Extlib.may_map Ival.is_zero ~dft:false kind.limit then Base.Map.empty else search_by_base kind str state in let alarm = Base.Map.exists (fun _base t -> t.alarm) basemap in let zero = Extlib.may_map Ival.contains_zero ~dft:false kind.limit in if length then return_length kind ~zero basemap, alarm else return_pointer ~zero basemap, alarm (* Reduces a pointer to a string to its valid part. Also returns a boolean indicating whether the pointer was completely valid or not. *) let reduce_by_validity ~size cvalue = let loc_bits = Locations.loc_bytes_to_loc_bits cvalue in let loc = Locations.make_loc loc_bits (Int_Base.inject size) in if Locations.(is_valid Read loc) then loc.Locations.loc, true else let valid_loc = Locations.(valid_part Read ~bitfield:true loc) in valid_loc.Locations.loc, false type char = Char | Wide let bits_size = function | Char -> Integer.eight | Wide -> Integer.of_int (Cil.bitsSizeOf Cil.theMachine.Cil.wcharType) let signed_char = function | Char -> not Cil.(theMachine.theMachine.Cil_types.char_is_unsigned) | Wide -> Cil.isSignedInteger Cil.theMachine.Cil.wcharType (* Converts the searched characters into char; needed for strchr and memchr. *) let searched_char ~size ~signed cvalue = let ival = Cvalue.V.project_ival cvalue in if size = Integer.eight then Ival.cast_int_to_int ~size ~signed ival else ival (* Interprets the arguments [args], builds the [kind] and runs the search. [search] are the searched characters, unless it is bottom, in which case the searched characters are the second argument. [size] is the type of the characters. [stop_at_0] is true if the search stops unsuccessfully on character 0. [limit] indicates which argument contains the limit, if any. The resulting function is the one exported. *) let do_search ~search ~stop_at_0 ~typ ~length ?limit = fun state args -> let size = bits_size typ in let signed = signed_char typ in let str = List.nth args 0 in let result, alarm = try let str, valid = reduce_by_validity ~size str in let search = if Ival.is_bottom search then searched_char ~size ~signed (List.nth args 1) else search in (* When searching exactly 0, the search naturally stops at 0. *) let stop_at_0 = if Ival.is_zero search then false else stop_at_0 in let interpret_limit n = let cvalue = List.nth args n in let limit = Ival.scale size (Cvalue.V.project_ival cvalue) in Ival.(narrow positive_integers limit) in let limit = Extlib.opt_map interpret_limit limit in let kind = { search; stop_at_0; size; signed; limit } in let result, alarm = search_char kind ~length state str in result, alarm || not valid with | Abstract_interp.Error_Top | Cvalue.V.Not_based_on_null -> return_top ~length str, true in let wrapper = if length then Eval_op.wrap_size_t else Eval_op.wrap_ptr in if Cvalue.V.is_bottom result then None, alarm else wrapper result, alarm (* Applies the [builtin] built by [do_search]. *) let apply_builtin _name builtin = fun state args -> let args = List.map (fun (_, v, _) -> v) args in let result, _alarm = builtin state args in let res_cvalue = match result with | None -> None, Cvalue.Model.bottom | Some _ -> result, state in { Value_types.c_values = [ res_cvalue ]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } (* Builds, registers and exports a builtin for the C function [c_name]. *) let register_builtin c_name ~search ~stop_at_0 ~typ ~length ?limit = let name = "Frama_C_" ^ c_name in let f = do_search ~search ~stop_at_0 ~typ ~length ?limit in let builtin = apply_builtin name f in Builtins.register_builtin name ~replace:c_name builtin; f type str_builtin_sig = Cvalue.Model.t -> Cvalue.V.t list -> Cvalue.V_Offsetmap.t option * bool let frama_c_strlen_wrapper : str_builtin_sig = register_builtin "strlen" ~search:Ival.zero ~stop_at_0:false ~typ:Char ~length:true ?limit:None let _frama_c_strnlen_wrapper = register_builtin "strnlen" ~search:Ival.zero ~stop_at_0:false ~typ:Char ~length:true ~limit:1 let _frama_c_memchr_wrapper = register_builtin "memchr" ~search:Ival.bottom ~stop_at_0:false ~typ:Char ~length:false ~limit:2 let _frama_c_rawmemchr_wrapper = register_builtin "rawmemchr" ~search:Ival.bottom ~stop_at_0:false ~typ:Char ~length:false ?limit:None let frama_c_strchr_wrapper = register_builtin "strchr" ~search:Ival.bottom ~stop_at_0:true ~typ:Char ~length:false ?limit:None let frama_c_wcslen_wrapper = register_builtin "wcslen" ~search:Ival.zero ~stop_at_0:false ~typ:Wide ~length:true ?limit:None let frama_c_wcschr_wrapper = register_builtin "wcschr" ~search:Ival.bottom ~stop_at_0:true ~typ:Wide ~length:false ?limit:None let _frama_c_wmemchr_wrapper = register_builtin "wmemchr" ~search:Ival.bottom ~stop_at_0:false ~typ:Wide ~length:false ~limit:2 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_string.mli���������������������������0000666�0000000�0000000�00000004055�13571573400�023436� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** A builtin takes the state and a list of values for the arguments, and returns the offsetmap of the return value (None if bottom), and a boolean indicating the possibility of alarms. *) type str_builtin_sig = Cvalue.Model.t -> Cvalue.V.t list -> Cvalue.V_Offsetmap.t option * bool val frama_c_strlen_wrapper: str_builtin_sig val frama_c_wcslen_wrapper: str_builtin_sig val frama_c_strchr_wrapper: str_builtin_sig val frama_c_wcschr_wrapper: str_builtin_sig �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_watchpoint.ml������������������������0000666�0000000�0000000�00000012332�13571573400�024134� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Abstract_interp open Cvalue type watch = Value of V.t | Cardinal of int let equal_watch w1 w2 = match w1, w2 with Value v1, Value v2 -> V.equal v1 v2 | Cardinal c1, Cardinal c2 -> c1 = c2 | _ -> false type watchpoint = { name_lv : Cil_types.exp; loc: Locations.location; v: watch; mutable remaining_count: Integer.t; mutable stmts: Cil_datatype.Stmt.Set.t } let watch_table : watchpoint list ref = ref [] let new_watchpoint name_lv loc v n = { name_lv = name_lv; loc = loc; v = v; remaining_count = n; stmts = Cil_datatype.Stmt.Set.empty } let add_watch make_watch state actuals = match actuals with | [(dst_e, dst, _); (_, size, _); (_, target_value, _); (_, number, _)] -> let size = try let size = Cvalue.V.project_ival size in Int.mul Int.eight (Ival.project_int size) with V.Not_based_on_null | Ival.Not_Singleton_Int -> raise Db.Value.Outside_builtin_possibilities in let number = try let number = Cvalue.V.project_ival number in Ival.project_int number with V.Not_based_on_null | Ival.Not_Singleton_Int -> raise Db.Value.Outside_builtin_possibilities in let loc_bits = Locations.loc_bytes_to_loc_bits dst in let loc = Locations.make_loc loc_bits (Int_Base.inject size) in let target_w = make_watch target_value in let current = !watch_table in if List.for_all (fun {loc=l; v=w} -> not (Locations.loc_equal l loc && equal_watch w target_w)) current then watch_table := (new_watchpoint dst_e loc target_w number) :: current; { Value_types.c_values = [None, state]; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable } | _ -> raise (Builtins.Invalid_nb_of_args 4) let make_watch_value target_value = Value target_value let make_watch_cardinal target_value = try let target_value = Cvalue.V.project_ival target_value in Cardinal (Integer.to_int (Ival.project_int target_value)) with V.Not_based_on_null | Ival.Not_Singleton_Int | Z.Overflow (* from Integer.to_int *) -> raise Db.Value.Outside_builtin_possibilities let () = Builtins.register_builtin "Frama_C_watch_value" (add_watch make_watch_value) let () = Builtins.register_builtin "Frama_C_watch_cardinal" (add_watch make_watch_cardinal) let watch_hook (stmt, _callstack, states) = let treat ({name_lv = name; loc=loc; v=wa; remaining_count=current; stmts=set} as w) = List.iter (fun state -> let vs = Model.find ~conflate_bottom:false state loc in let watching = match wa with Value v -> V.intersects vs v | Cardinal n -> ( try ignore (V.cardinal_less_than vs n) ; false with Not_less_than -> true) in if watching then begin Value_parameters.feedback ~once:true ~current:true "Watchpoint: %a %a%t" Printer.pp_exp name V.pretty vs Value_util.pp_callstack; if Integer.is_zero current || (Cil_datatype.Stmt.Set.mem stmt set) then () else let current = Integer.pred current in if Integer.is_zero current then raise Db.Value.Aborted; w.remaining_count <- current; w.stmts <- Cil_datatype.Stmt.Set.add stmt set; end) states in List.iter treat !watch_table let () = Db.Value.Compute_Statement_Callbacks.extend_once watch_hook (* Local Variables: compile-command: "make -C ../../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/builtins_watchpoint.mli�����������������������0000666�0000000�0000000�00000003247�13571573400�024312� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Empty interface. Builtins are registered directly in the implementation. *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_domain.ml������������������������������0000666�0000000�0000000�00000054353�13571573400�022662� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval let dkey_card = Value_parameters.register_category "cardinal" module Model = struct include Cvalue.Model type value = Main_values.CVal.t type location = Main_locations.PLoc.location (* The origin is the value stored in the state for a lvalue, when this value has a type incompatible with the type of the lvalue. This may happen on union with fields of different types, or on code pattern such as int x = v; float f = *(float* )&x In this case, the value stored in the state and the value computed for the lvalue can be incomparable. The origin is then used to store the value from the state, to later choose which value to keep. This is done by the update function in cvalue_transfer. *) type origin = value option let extract_expr _ _ _ = `Value (Cvalue.V.top, None), Alarmset.all let indeterminate_alarms lval v = let open Cvalue.V_Or_Uninitialized in let status = if Cvalue.V.is_bottom (get_v v) then Alarmset.False else Alarmset.Unknown in match v with | C_uninit_noesc _ -> Alarmset.singleton ~status (Alarms.Uninitialized lval) | C_init_esc _ -> Alarmset.singleton ~status (Alarms.Dangling lval) | C_uninit_esc _ -> (* Unknown alarms: [v] can be either dangling or uninit *) Alarmset.(set (Alarms.Dangling lval) Unknown (set (Alarms.Uninitialized lval) Unknown none)) | C_init_noesc _ -> Alarmset.none let eval_one_loc state lval typ = let eval_one_loc single_loc = let v = Cvalue.Model.find_indeterminate state single_loc in Cvalue.V_Or_Uninitialized.get_v v, indeterminate_alarms lval v in (* We have no good neutral element for "no alarm emitted yet", so we use [None] instead. *) let join_alarms acc alarms = match acc with | None -> Some alarms | Some acc -> Some (Alarmset.union alarms acc) in fun loc (acc_result, acc_alarms) -> let result, alarms = eval_one_loc loc in let result = Cvalue_forward.make_volatile ~typ:typ result in Cvalue.V.join result acc_result, join_alarms acc_alarms alarms (* The zero singleton is shared between float and integer representations in ival, and is thus untyped. *) let is_float v = Cvalue.V.(is_included v top_float) && Cvalue.V.contains_non_zero v let extract_scalar_lval state lval typ loc = let process_one_loc = eval_one_loc state lval typ in let acc = Cvalue.V.bottom, None in let value, alarms = Precise_locs.fold process_one_loc loc acc in let alarms = match alarms with None -> Alarmset.none | Some a -> a in (* The origin is set to false when the value stored in the memory has not the same type as the read lvalue. In this case, we don't update the state with the new value stemming from the evaluation, even if it has been reduced, in order to not propagate incompatible type. *) let incompatible_type = is_float value <> Cil.isFloatingType typ in let origin = if incompatible_type then Some value else None in let value = Cvalue_forward.reinterpret typ value in if Cvalue.V.is_bottom value then `Bottom, alarms else `Value (value, origin), alarms (* Imprecise version for aggregate types that cvalues are unable to precisely represent. The initialization alarms must remain sound, though. *) let extract_aggregate_lval state lval _typ ploc = let loc = Precise_locs.imprecise_location ploc in match loc.Locations.size with | Int_Base.Top -> `Value (Cvalue.V.top, None), Alarmset.all | Int_Base.Value size -> let offsm = Cvalue.Model.copy_offsetmap loc.Locations.loc size state in match offsm with | `Bottom -> `Bottom, Alarmset.none | `Value offsm -> let value = Cvalue.V_Offsetmap.find_imprecise_everywhere offsm in let alarms = indeterminate_alarms lval value in let v = Cvalue.V_Or_Uninitialized.get_v value in let v = if Cvalue.V.is_bottom v then `Bottom else `Value (v, None) in v, alarms let extract_lval _oracle state lval typ loc = if Cil.isArithmeticOrPointerType typ then extract_scalar_lval state lval typ loc else extract_aggregate_lval state lval typ loc let backward_location state _lval typ precise_loc value = let size = Precise_locs.loc_size precise_loc in let upto = succ (Ival.get_small_cardinal()) in let loc = Precise_locs.imprecise_location precise_loc in let eval_one_loc single_loc = let v = Cvalue.Model.find state single_loc in let v = Cvalue_forward.make_volatile ~typ v in Cvalue_forward.reinterpret typ v in let process_ival base ival (acc_loc, acc_val as acc) = let loc_bits = Locations.Location_Bits.inject base ival in let single_loc = Locations.make_loc loc_bits size in let v = eval_one_loc single_loc in if Cvalue.V.intersects v value then Locations.Location_Bits.join loc_bits acc_loc, Cvalue.V.join v acc_val else acc in let fold_ival base ival acc = if Ival.cardinal_is_less_than ival upto then Ival.fold_enum (process_ival base) ival acc else process_ival base ival acc in let fold_location loc acc = try let loc = loc.Locations.loc in Locations.Location_Bits.fold_i fold_ival loc acc with Abstract_interp.Error_Top -> loc.Locations.loc, value in let acc = Locations.Location_Bits.bottom, Cvalue.V.bottom in let loc_bits, value = fold_location loc acc in if Locations.Location_Bits.is_bottom loc_bits then `Bottom else let loc = Precise_locs.inject_location_bits loc_bits in `Value (Precise_locs.make_precise_loc loc ~size, value) end module State = struct type state = Model.t * Locals_scoping.clobbered_set let log_category = Value_parameters.dkey_cvalue_domain include Datatype.Make_with_collections ( struct include Datatype.Serializable_undefined type t = state let name = Model.name ^ "+clobbered_set" let reprs = List.map (fun s -> s, Locals_scoping.bottom ()) Model.reprs let structural_descr = Structural_descr.( t_tuple [| Model.packed_descr; pack Locals_scoping.structural_descr |]) let pretty fmt (s, _) = Model.pretty fmt s let equal (a, _) (b, _) = Model.equal a b let compare (a, _) (b, _) = Model.compare a b let hash (s, _) = Model.hash s let rehash = Datatype.identity let copy = Datatype.undefined let mem_project = Datatype.never_any_project end ) let name = "Cvalue domain" let key = Structure.Key_Domain.create_key "cvalue_domain" type value = Model.value type location = Model.location let top = Model.top, Locals_scoping.bottom () let is_included (a, _) (b, _) = Model.is_included a b let join (a, clob) (b, _) = Model.join a b, clob let widen kf stmt (a, clob) (b, _) = let hint = Widen.getWidenHints kf stmt in Model.widen hint a b, clob let narrow (a, clob) (b, _) = let s = Model.narrow a b in if Model.(equal bottom s) then `Bottom else `Value (s, clob) type origin = Model.origin let extract_expr evaluate (s, _) expr = Model.extract_expr evaluate s expr let extract_lval oracle (s, _) lval typ loc = Model.extract_lval oracle s lval typ loc let backward_location (state, _) lval typ precise_loc value = Model.backward_location state lval typ precise_loc value let reduce_further _ _ _ = [] module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = origin and type loc = location) = struct module T = Cvalue_transfer.Transfer (Valuation) let update valuation (s, clob) = T.update valuation s >>-: fun s -> s, clob let assign stmt lv expr assigned valuation (s, clob) = T.assign stmt lv expr assigned valuation s >>-: fun s -> (* TODO: use the value in assignment *) let _ = Eval.value_assigned assigned >>-: fun value -> let location = Precise_locs.imprecise_location lv.lloc in Locals_scoping.remember_if_locals_in_value clob location value in s, clob let assume stmt expr positive valuation (s, clob) = T.assume stmt expr positive valuation s >>-: fun s -> s, clob let start_call stmt call valuation (s, _clob) = T.start_call stmt call valuation s >>-: fun state -> state, Locals_scoping.bottom () let finalize_call stmt call ~pre ~post = let (post_state, post_clob) = post and pre_state, clob = pre in Locals_scoping.(remember_bases_with_locals clob post_clob.clob); T.finalize_call stmt call ~pre:pre_state ~post:post_state >>-: fun state -> state, clob let show_expr valuation (state, _) = T.show_expr valuation state end (* ------------------------------------------------------------------------ *) (* Mem Exec *) (* ------------------------------------------------------------------------ *) let relate _kf _bases _state = Base.SetLattice.empty (* Auxiliary function that keeps only some bases inside a memory state *) let filter _kf _kind bases (state, clob) = Cvalue.Model.filter_by_shape (Base.Hptset.shape bases) state, clob let reuse _ _ ~current_input:(state, _) ~previous_output:(output, clob) = Cvalue.Model.merge ~into:state output, clob (* ------------------------------------------------------------------------ *) (* Logic *) (* ------------------------------------------------------------------------ *) let lift_env logic_env = Abstract_domain.{ states = (fun label -> fst (logic_env.states label)); result = logic_env.result; } let evaluate_predicate logic_env (state, _clob) pred = let eval_env = Eval_terms.make_env (lift_env logic_env) state in match Eval_terms.eval_predicate eval_env pred with | Eval_terms.True -> Alarmset.True | Eval_terms.False -> Alarmset.False | Eval_terms.Unknown -> Alarmset.Unknown let reduce_by_predicate logic_env (state, clob) pred b = let eval_env = Eval_terms.make_env (lift_env logic_env) state in let eval_env = Eval_terms.reduce_by_predicate eval_env b pred in let state = Eval_terms.env_current_state eval_env in if Cvalue.Model.is_reachable state then `Value (state, clob) else `Bottom let pp_eval_error fmt e = if e <> Eval_terms.CAlarm then Format.fprintf fmt "@ (%a)" Eval_terms.pretty_logic_evaluation_error e let evaluate_from_clause env (_, ins as assign) = let open Cil_types in match ins with | FromAny -> Cvalue.V.top_int | From l -> try (* Evaluates the contents of one element of the from clause, topify them, and add them to the current state of the evaluation in acc. *) let one_from_contents acc { it_content = t } = let loc = Eval_terms.(eval_tlval_as_location ~alarm_mode:Ignore env t) in let state = Eval_terms.env_current_state env in let v = Cvalue.Model.find ~conflate_bottom:false state loc in Cvalue.V.join acc (Cvalue.V.topify_leaf_origin v) in let filter x = not (List.mem "indirect" x.it_content.term_name) in let direct = List.filter filter l in List.fold_left one_from_contents Cvalue.V.top_int direct with Eval_terms.LogicEvalError e -> Value_util.warning_once_current "@[<hov 0>cannot interpret 'from'@ @[<hov 2>clause '%a'@]%a" Printer.pp_from assign pp_eval_error e; Cvalue.V.top let logic_assign logic_assign location ~pre:(pre_state, _) (state, sclob) = match logic_assign with | Assigns assign -> let location = Precise_locs.imprecise_location location in let env = Eval_terms.env_assigns pre_state in let value = evaluate_from_clause env assign in Locals_scoping.remember_if_locals_in_value sclob location value; Cvalue.Model.add_binding ~exact:false state location value, sclob | Frees _ | Allocates _ -> state, sclob (* ------------------------------------------------------------------------ *) (* Initialization *) (* ------------------------------------------------------------------------ *) let introduce_globals vars (state, clob) = let introduce state varinfo = let base = Base.of_varinfo varinfo in let loc = Locations.loc_of_base base in let value = Cvalue.V_Or_Uninitialized.uninitialized in Model.add_indeterminate_binding ~exact:true state loc value in List.fold_left introduce state vars, clob let initialize_variable _lval loc ~initialized init_value (state, clob) = let value = match init_value with | Abstract_domain.Top -> Cvalue.V.top_int | Abstract_domain.Zero -> Cvalue.V.singleton_zero in let cvalue = if initialized then Cvalue.V_Or_Uninitialized.C_init_noesc value else Cvalue.V_Or_Uninitialized.C_uninit_noesc value in let loc = Precise_locs.imprecise_location loc in Model.add_indeterminate_binding ~exact:true state loc cvalue, clob let empty () = let open Cvalue in let state = Model.empty_map in let min_valid = Base.min_valid_absolute_address () in let max_valid = Base.max_valid_absolute_address () in if Integer.le min_valid max_valid then begin (* Bind everything between [0..max] to bottom. Offsetmaps cannot contain holes, which can happen when min > 0 holds. *) let bot = V_Offsetmap.create_isotropic ~size:max_valid (V_Or_Uninitialized.initialized V.bottom) in let v = if true (* TODO: command line option *) then V_Or_Uninitialized.initialized V.top_int else V_Or_Uninitialized.uninitialized in let offsm = V_Offsetmap.add (min_valid, max_valid) (v, Integer.one, Abstract_interp.Rel.zero) bot in Cvalue.Model.add_base Base.null offsm state, Locals_scoping.bottom () end else state, Locals_scoping.bottom () let initialize_variable_using_type kind varinfo (state, clob) = match kind with | Abstract_domain.Main_Formal | Abstract_domain.Library_Global -> Cvalue_init.initialize_var_using_type varinfo state, clob | Abstract_domain.Spec_Return kf -> let value = Library_functions.returned_value kf in let loc = Locations.loc_of_varinfo varinfo in Model.add_binding ~exact:true state loc value, clob (* ------------------------------------------------------------------------ *) (* Misc *) (* ------------------------------------------------------------------------ *) let enter_scope _kf vars (state, clob) = let bind_local state vi = let b = Base.of_varinfo vi in let offsm = if Value_parameters.InitializedLocals.get () then let v = Cvalue.(V_Or_Uninitialized.initialized V.top_int) in match Cvalue.V_Offsetmap.size_from_validity (Base.validity b) with | `Bottom -> assert false | `Value size -> Cvalue.V_Offsetmap.create_isotropic ~size v else Bottom.non_bottom (Cvalue.Default_offsetmap.default_offsetmap b) in Model.add_base b offsm state in List.fold_left bind_local state vars, clob let leave_scope kf vars (state, clob) = let state = Model.remove_variables vars state in try let fdec = Kernel_function.get_definition kf in Locals_scoping.make_escaping_fundec fdec clob vars state, clob with Kernel_function.No_Definition -> state, clob let enter_loop _stmt (s, clob) = s, clob let leave_loop _stmt (s, clob) = s, clob let incr_loop_counter _stmt (s, clob) = s, clob (* ------------------------------------------------------------------------ *) (* Storage *) (* ------------------------------------------------------------------------ *) module Store = struct module Storage = State_builder.Ref (Datatype.Bool) (struct let dependencies = [Db.Value.self] let name = name ^ ".Storage" let default () = false end) let register_global_state _ = Storage.set true let register_initial_state callstack (state, _clob) = Db.Value.merge_initial_state callstack state let register_state_before_stmt callstack stmt (state, _clob) = Db.Value.update_callstack_table ~after:false stmt callstack state let register_state_after_stmt callstack stmt (state, _clob) = Db.Value.update_callstack_table ~after:true stmt callstack state let return state = if Cvalue.Model.(equal state bottom) then `Bottom else `Value (state, Locals_scoping.top ()) let lift_tbl tbl = let open Value_types in let h = Callstack.Hashtbl.create 7 in let process callstack state = Callstack.Hashtbl.replace h callstack (state, Locals_scoping.top ()) in Callstack.Hashtbl.iter process tbl; h let get_global_state () = return (Db.Value.globals_state ()) let get_initial_state kf = return (Db.Value.get_initial_state kf) let get_initial_state_by_callstack kf = if Storage.get () then match Db.Value.get_initial_state_callstack kf with | Some tbl -> `Value (lift_tbl tbl) | None -> `Bottom else `Top let get_stmt_state ~after stmt = return (Db.Value.get_stmt_state ~after stmt) let get_stmt_state_by_callstack ~after stmt = if Storage.get () then match Db.Value.get_stmt_state_callstack ~after stmt with | Some tbl -> `Value (lift_tbl tbl) | None -> `Bottom else `Top end let display ?fmt kf = let open Cil_types in (* Do not pretty Cil-generated variables or out-of-scope local variables *) let filter_generated_and_locals base = match base with | Base.Var (v, _) -> if v.vtemp then v.vname = "__retres" else ((not (Kernel_function.is_local v kf)) (* only locals of outermost block *) || List.exists (fun x -> x.vid = v.vid) (Kernel_function.get_definition kf).sbody.blocals ) | _ -> true in try let values = Db.Value.get_stmt_state (Kernel_function.find_return kf) in let fst_values = Db.Value.get_stmt_state (Kernel_function.find_first_stmt kf) in if Cvalue.Model.is_reachable fst_values && not (Cvalue.Model.is_top fst_values) then begin let print_cardinal = Value_parameters.is_debug_key_enabled dkey_card in let estimate = if print_cardinal then Cvalue.Model.cardinal_estimate values else Cvalue.CardinalEstimate.one in let outs = !Db.Outputs.get_internal kf in let outs = Locations.Zone.filter_base filter_generated_and_locals outs in let header fmt = Format.fprintf fmt "Values at end of function %a:%t" Kernel_function.pretty kf (fun fmt -> if print_cardinal then Format.fprintf fmt " (~%a states)" Cvalue.CardinalEstimate.pretty estimate) in let body fmt = Format.fprintf fmt "@[%t@]@[ %t@]" (fun fmt -> match outs with | Locations.Zone.Top (Base.SetLattice.Top, _) -> Format.fprintf fmt "@[Cannot filter: dumping raw memory \ (including unchanged variables)@]@\n" | _ -> ()) (fun fmt -> Cvalue.Model.pretty_filter fmt values outs) in match fmt with | None -> Value_parameters.printf ~dkey:Value_parameters.dkey_final_states ~header "%t" body | Some fmt -> Format.fprintf fmt "%t@.%t@," header body end with Kernel_function.No_Statement -> () let display_results () = Value_parameters.result "====== VALUES COMPUTED ======"; Callgraph.Uses.iter_in_rev_order display; Value_parameters.result "%t" Value_perf.display let post_analysis _state = if Value_parameters.ForceValues.get () && Value_parameters.verbose_atleast 1 then Value_parameters.ForceValues.output display_results end let () = Db.Value.display := (fun fmt kf -> State.display ~fmt kf) type prefix = Hptmap.prefix module Subpart = struct type t = Model.subtree let hash = Model.hash_subtree let equal = Model.equal_subtree end let distinct_subpart (a, _) (b, _) = if Model.equal a b then None else try Model.comp_prefixes a b; None with Model.Found_prefix (p, s1, s2) -> Some (p, s1, s2) let find_subpart (s, _) prefix = Model.find_prefix s prefix (* Local Variables: compile-command: "make -C ../../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_domain.mli�����������������������������0000666�0000000�0000000�00000004207�13571573400�023024� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Main domain of the Value Analysis. *) module State : Abstract_domain.Leaf with type value = Main_values.CVal.t and type location = Main_locations.PLoc.location and type state = Cvalue.Model.t * Locals_scoping.clobbered_set (** Specific functions for partitioning optimizations. *) type prefix module Subpart : Hashtbl.HashedType val distinct_subpart : State.t -> State.t -> (prefix * Subpart.t * Subpart.t) option val find_subpart : State.t -> prefix -> Subpart.t option (* Local Variables: compile-command: "make -C ../../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_init.ml��������������������������������0000666�0000000�0000000�00000035641�13571573400�022355� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Creation of the initial state for Value *) open Cil_types open Locations let dkey = Value_parameters.register_category "initial-state" let add_initialized state loc v = Cvalue.Model.add_binding ~exact:true state loc v let make_well hidden_base state loc = let size = Bit_utils.max_bit_size () in let well = Cvalue.V.inject_top_origin Origin.Well (Base.Hptset.singleton hidden_base) in let well_loc = Locations.make_loc (Location_Bits.inject hidden_base Ival.zero) (Int_Base.inject size) in let state = add_initialized state well_loc well in add_initialized state loc well let warn_unknown_size_aux pp v (messt, t) = Value_parameters.warning ~once:true ~current:true "@[during initialization@ of %a,@ size of@ type '%a'@ cannot be@ computed@ \ (%s)@]" pp v Printer.pp_typ t messt let warn_unknown_size = warn_unknown_size_aux (fun fmt v -> Format.fprintf fmt "variable '%a'" Printer.pp_varinfo v) type validity_hidden_base = | UnknownValidity (* Base is maybe invalid on its entire validity *) | KnownThenUnknownValidity of Integer.t (* Base is valid on i bits, then maybe invalid on the remainder of its validity *) let stdlib_attribute = Attr ("fc_stdlib_generated", []) let create_hidden_base ~libc ~valid ~hidden_var_name ~name_desc pointed_typ = let hidden_var = Value_util.create_new_var hidden_var_name pointed_typ in if libc then hidden_var.vattr <- Cil.addAttribute stdlib_attribute hidden_var.vattr; hidden_var.vdescr <- Some name_desc; let validity = (* Add a special case for void* pointers: we do not want to compute the size of void *) let validity = match Cil.unrollType pointed_typ with | TVoid _ -> Base.Unknown (Integer.zero, None, Bit_utils.max_bit_address ()) | _ -> Base.validity_from_type hidden_var in match validity with | Base.Known (a,b) when not (Value_parameters.AllocatedContextValid.get ()) -> (* Weaken validity, because the created variables are not supposed to be valid *) (match valid with | KnownThenUnknownValidity size -> (*except here, for size bits*) let size = Integer.pred size in assert (Integer.le size b); Base.Unknown (a, Some size, b) | UnknownValidity -> Base.Unknown (a, None, b) ) | Base.Unknown _ -> (* Unknown validity is caused by strange type *) Value_parameters.result ~dkey "creating variable %s with imprecise \ size (type %a)" hidden_var_name Printer.pp_typ pointed_typ; validity | Base.Empty | Base.Known _ | Base.Invalid -> validity | Base.Variable _ -> (* should never happen (validity_from_type cannot return Weak) *) assert false in Base.register_memory_var hidden_var validity let reject_empty_struct b offset typ = match Cil.unrollType typ with | TComp (ci, _, _) -> if ci.cfields = [] && ci.cdefined && not (Cil.gccMode () || Cil.msvcMode ()) then Value_parameters.abort ~current:true "@[empty %ss@ are unsupported@ (type '%a',@ location %a%a)@ \ in C99 (only allowed as GCC/MSVC extension).@ Aborting.@]" (if ci.cstruct then "struct" else "union") Printer.pp_typ typ Base.pretty b Printer.pp_offset offset | _ -> () (** [initialize_var_using_type varinfo state] uses the type of [varinfo] to create an initial value in [state]. *) let initialize_var_using_type varinfo state = Cil.CurrentLoc.set varinfo.vdecl; let rec add_offsetmap depth b name_desc name typ offset_orig typ_orig state = let typ = Cil.unrollType typ in let loc = lazy (loc_of_typoffset b typ_orig offset_orig) in let bind_entire_loc ?(state=state) v = (* Shortcut *) add_initialized state (Lazy.force loc) v in match typ with | TInt _ | TEnum (_, _)-> bind_entire_loc Cvalue.V.top_int | TFloat (fkind, _) -> begin (** TODO: depend on the option for finitness *) bind_entire_loc (Cvalue.V.inject_float (Fval.top_finite (Fval.kind fkind))) end | TFun _ -> state | TPtr (typ, _) as full_typ when depth <= Value_parameters.AutomaticContextMaxDepth.get () -> let attr = Cil.typeAttrs full_typ in let libc = Cil.hasAttribute "fc_stdlib" varinfo.vattr in let context_max_width = Value_parameters.AutomaticContextMaxWidth.get () in begin match Cil.isVoidType typ, Cil.isFunctionType typ with | false, false -> (* non-void, non-function *) let i = match Cil.findAttribute "arraylen" attr with | [AInt i] -> i | _ -> Integer.of_int context_max_width in let arr_pointed_typ = TArray(typ, Some (Cil.kinteger64 ~loc:varinfo.vdecl i), Cil.empty_size_cache (), []) in let hidden_var_name = Cabs2cil.fresh_global ("S_" ^ name) in let name_desc = "*"^name_desc in (* Make first cell of the array valid. The NULL pointer takes care of a potential invalid pointer. *) let valid = try KnownThenUnknownValidity (Integer.of_int (Cil.bitsSizeOf typ)) with Cil.SizeOfError _ -> UnknownValidity in let hidden_base = create_hidden_base ~libc ~valid ~hidden_var_name ~name_desc arr_pointed_typ in let state = add_offsetmap (depth + 1) hidden_base name_desc hidden_var_name arr_pointed_typ NoOffset arr_pointed_typ state in let value = Cvalue.V.inject hidden_base (Ival.zero) in let value = if Value_parameters.AllocatedContextValid.get () then value else Cvalue.V.join Cvalue.V.singleton_zero value in bind_entire_loc ~state value | true, false -> (* void *) let hidden_var_name = Cabs2cil.fresh_global ("S_" ^ name) in let name_desc = "*"^name_desc in let valid = UnknownValidity in let hidden_base = create_hidden_base ~libc ~valid ~hidden_var_name ~name_desc typ in make_well hidden_base state (Lazy.force loc) | false, true -> (* function *) (* Generating functions is next to useless for the user (what does the function do), and too dangerous for the AST. *) bind_entire_loc ~state Cvalue.V.singleton_zero | true, true -> assert false (* inconsistent *) end | TArray (typ, len, _, _) -> begin try let size = Cil.lenOfArray len in let size_elt = Integer.of_int (Cil.bitsSizeOf typ) in let psize = pred size in let state = ref state in let typ = Cil.unrollType typ in let max_precise_size = Value_parameters.AutomaticContextMaxWidth.get () in let locs = ref [] in for i = 0 to min psize (pred max_precise_size) do (* Cells that are treated really precisely. We create new pointers (if needed) for each distinct cell *) let offset = Cil.addOffset (Index (Cil.integer ~loc:varinfo.vdecl i, NoOffset)) offset_orig in let name = string_of_int i ^ "_" ^ name in let name_desc = name_desc ^ "[" ^ string_of_int i ^ "]" in state := add_offsetmap depth b name_desc name typ offset typ_orig !state; let loc = loc_of_typoffset b typ_orig offset in locs := loc :: !locs; done; if max_precise_size < size then begin (* Some elements remain to be initialized *) let offsm_of_loc loc = (* This rereads one of the first cells*) let offsm = Cvalue.Model.copy_offsetmap loc size_elt !state in match offsm with `Bottom -> assert false | `Value m -> m in let last_loc, locs = match !locs with | [] -> assert false (* AutomaticContextMaxWidth is at least 1*) | l :: ll -> l, ll in let last_offsm = offsm_of_loc last_loc.loc in (* Join of the contents of the first elements *) let aux_loc offsm loc = Cvalue.V_Offsetmap.join offsm (offsm_of_loc loc.loc) in let offsm_joined = List.fold_left aux_loc last_offsm locs in (* TODO: add Offsetmap.paste_repeated_slices to Offsetmap, and replace everything below by a call to it. *) let nb_fields = Cvalue.V_Offsetmap.fold (fun _itv _ -> succ) offsm_joined 0 in if nb_fields = 1 then (* offsm_joined is very regular (typically Top_int, or some pointers). We read its contents and copy it everywhere else. The periodicity of the contents may be smaller than the size of a cell; take this into account. *) let v, modu, offset = Extlib.the (Cvalue.V_Offsetmap.fold (fun _itv v _ -> Some v) offsm_joined None) in assert (Abstract_interp.Rel.(equal offset zero)); let ncells = size - max_precise_size in let total_size = Integer.mul size_elt (Integer.of_int ncells) in let offsm_repeat = Cvalue.V_Offsetmap.create ~size_v:modu ~size:total_size v in let loc = Location_Bits.shift (Ival.inject_singleton size_elt) last_loc.loc; in (* paste [size - max_precise_size] elements, starting from the last location initialized + 1 *) state := Cvalue.Model.paste_offsetmap ~from:offsm_repeat ~dst_loc:loc ~size:total_size ~exact:true !state else ( (* We have probably initialized a struct with different fields. We must perform offsetmap copies, that are slower *) if nb_fields * psize >= 5000 then Value_parameters.result ~once:true ~current:true "Initializing a complex array of %d elements. This may \ take some time" size; let loc = ref last_loc.loc in for _i = max_precise_size to psize do loc := Location_Bits.shift (Ival.inject_singleton size_elt) !loc; state := Cvalue.Model.paste_offsetmap ~from:offsm_joined ~dst_loc:!loc ~size:size_elt ~exact:true !state done); end; !state with | Cil.LenOfArray -> Value_parameters.result ~once:true ~current:true "no size specified for array, assuming 0"; (* This is either a flexible array member (for which Cil implicitly returns a size of 0, so we are doing the proper thing), or an incomplete array (which is forbidden) *) state | Cil.SizeOfError (s, t) -> warn_unknown_size varinfo (s, t); bind_entire_loc Cvalue.V.top_int; end | TComp ({cstruct=true;} as compinfo, _, _) -> (* Struct *) reject_empty_struct b offset_orig typ; let treat_field state field = match field.fbitfield with | Some 0 -> state (* skip the field, nothing to initialize *) | _ -> let new_offset = Field (field, NoOffset) in let offset = Cil.addOffset new_offset offset_orig in let nd = name_desc ^ "." ^ field.fname in let n = field.fname ^ "_" ^ name in add_offsetmap depth b nd n field.ftype offset typ_orig state in begin try List.fold_left treat_field state compinfo.cfields with Cil.SizeOfError (s, t) -> warn_unknown_size varinfo (s, t); bind_entire_loc Cvalue.V.top_int; end | TComp ({cstruct=false}, _, _) when Cil.is_fully_arithmetic typ -> reject_empty_struct b offset_orig typ; (* Union of arithmetic types *) bind_entire_loc Cvalue.V.top_int | TPtr _ when Value_parameters.AllocatedContextValid.get () -> (* deep pointers map to NULL in this case *) bind_entire_loc Cvalue.V.singleton_zero | TBuiltin_va_list _ | TComp _ | TVoid _ | TPtr _ -> reject_empty_struct b offset_orig typ; (* variable arguments or union with non-arithmetic type or deep pointers *) (* first create a new varid and offsetmap for the "hidden location" *) let hidden_var_name = Cabs2cil.fresh_global ("WELL_"^name) in let hidden_var = Value_util.create_new_var hidden_var_name Cil.charType in hidden_var.vdescr <- Some (name_desc^"_WELL"); let validity = Base.Known (Integer.zero, Bit_utils.max_bit_address ()) in let hidden_base = Base.register_memory_var hidden_var validity in make_well hidden_base state (Lazy.force loc) | TNamed (_, _) -> assert false in add_offsetmap 0 (Base.of_varinfo varinfo) varinfo.vname varinfo.vname varinfo.vtype NoOffset varinfo.vtype state (* Local Variables: compile-command: "make -C ../../../../.." End: *) �����������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_init.mli�������������������������������0000666�0000000�0000000�00000003370�13571573400�022520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types val initialize_var_using_type: varinfo -> Cvalue.Model.t -> Cvalue.Model.t (* Local Variables: compile-command: "make -C ../../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_offsetmap.ml���������������������������0000666�0000000�0000000�00000005622�13571573400�023372� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval exception Got_imprecise of Cvalue.V.t let offsetmap_contains_imprecision offs = try Cvalue.V_Offsetmap.iter_on_values (fun v -> match Cvalue.V_Or_Uninitialized.get_v v with | Locations.Location_Bytes.Map _ -> () | Locations.Location_Bytes.Top _ as v -> raise (Got_imprecise v) ) offs; None with Got_imprecise v -> Some v let warn_right_imprecision lval loc offsetmap = match offsetmap_contains_imprecision offsetmap with | Some v -> Warn.warn_right_exp_imprecision lval loc v | None -> () let warn_if_imprecise lval loc offsm = match offsetmap_contains_imprecision offsm with | Some v -> let loc = Precise_locs.imprecise_location loc in Warn.warn_imprecise_lval_read lval loc v | None -> () let offsetmap_of_lval state lval loc = let offsm = Bottom.non_bottom (Eval_op.offsetmap_of_loc loc state) in warn_if_imprecise lval loc offsm; offsm let offsetmap_of_v ~typ v = let size = Integer.of_int (Cil.bitsSizeOf typ) in let v = Cvalue.V.anisotropic_cast ~size v in let v = Cvalue.V_Or_Uninitialized.initialized v in Cvalue.V_Offsetmap.create ~size v ~size_v:size let offsetmap_of_assignment state expr = function | Copy (lv, _value) -> offsetmap_of_lval state lv.lval lv.lloc | Assign value -> offsetmap_of_v ~typ:(Cil.typeOf expr) value ��������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_offsetmap.mli��������������������������0000666�0000000�0000000�00000005033�13571573400�023537� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Auxiliary functions on cvalue offsetmaps, used by the cvalue domain. *) open Cil_types open Cvalue (** [warn_right_imprecision lval loc offsm] is used for the assignment of the lvalue [lval] pointing to the location [loc]; it warns if the offsetmap [offsm] contains a garbled mix. *) val warn_right_imprecision: lval -> Locations.location -> V_Offsetmap.t -> unit (** [offsetmap_of_lval state lval loc] extracts from state [state] the offsetmap at location [loc], corresponding to the lvalue [lval]. Warns if this offsetmap contains a garbled mix. *) val offsetmap_of_lval: Model.t -> lval -> Precise_locs.precise_location -> V_Offsetmap.t (** Computes the offsetmap for an assignment: - in case of a copy, extracts the offsetmap from the state; - otherwise, translates the value assigned into an offsetmap. *) val offsetmap_of_assignment: Model.t -> exp -> (Precise_locs.precise_location, V.t) Eval.assigned -> V_Offsetmap.t �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_specification.ml�����������������������0000666�0000000�0000000�00000020305�13571573400�024221� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module AB = Transfer_logic.ActiveBehaviors (* Eval: under-approximation of the term. Note that ACSL states that assigns clauses are evaluated in the pre-state. We skip [\result]: it is meaningless when evaluating the 'assigns' part, and a special treatment must be done in [from] clauses anyway. *) let eval_assigns_from pre_state it = let term = it.it_content in if Logic_utils.is_result it.it_content then Locations.Zone.bottom else let eval_env = Eval_terms.env_assigns pre_state in let under, _ = Eval_terms.eval_tlval_as_zone_under_over ~alarm_mode:Eval_terms.Ignore Locations.Read eval_env term in under (** Compute the validity status for [from] in [pre_state], assuming the entire clause is [assigns asgn \from from]. The inferred dependencies are [found_froms], while [asgn] evaluates to [assigns_zone]. *) let check_from pre_state asgn assigns_zone from found_froms = let open Locations in let found_deps = let open Function_Froms in if Logic_utils.is_result asgn.it_content then found_froms.deps_return else Memory.find_precise found_froms.deps_table assigns_zone in let (indirect_deps,direct_deps) = let filter x = List.mem "indirect" x.it_content.term_name in List.partition filter from in (* Under-approximation of the union. *) let link zones = List.fold_left Zone.link Zone.bottom zones in let eval = eval_assigns_from pre_state in let stated_indirect_deps = link (List.map eval indirect_deps) in let stated_direct_deps = link (List.map eval direct_deps) in let found_direct_deps = found_deps.Function_Froms.Deps.data in let found_indirect_deps = found_deps.Function_Froms.Deps.indirect in let res_for_unknown txt = Value_parameters.debug "found_direct deps %a stated_direct_deps %a \ found_indirect_deps %a stated_indirect_deps %a" Zone.pretty found_direct_deps Zone.pretty stated_direct_deps Zone.pretty found_indirect_deps Zone.pretty stated_indirect_deps; "unknown (cannot validate "^txt^" dependencies)", Alarmset.Unknown in match (Zone.is_included found_direct_deps stated_direct_deps, Zone.is_included found_indirect_deps stated_indirect_deps) with | true,true -> "valid", Alarmset.True | false,true -> res_for_unknown "direct" | false,false -> res_for_unknown "direct and indirect" | true,false -> res_for_unknown "indirect" (* Display the message as result/warning depending on [status] *) let msg_status status ?current ?once ?source fmt = if status = Alarmset.True then if Value_parameters.ValShowProgress.get () then Value_parameters.result ?current ?once ?source fmt else Value_parameters.result ?current ?once ?source ~level:2 fmt else Value_parameters.warning ~wkey:Value_parameters.wkey_alarm ?current ?once ?source fmt let pp_bhv fmt b = if not (Cil.is_default_behavior b) then Format.fprintf fmt ", behavior %s" b.b_name let pp_header kf fmt b = Format.fprintf fmt "function %a%a" Kernel_function.pretty kf pp_bhv b let conv_status = function | Alarmset.False -> Property_status.False_if_reachable; | Alarmset.True -> Property_status.True; | Alarmset.Unknown -> Property_status.Dont_know let check_fct_assigns kf ab ~pre_state found_froms = let open Locations in let open Alarmset in let behaviors = Annotations.behaviors kf in (* Under-approximation of the union. *) let link zones = List.fold_left Zone.link Zone.bottom zones in let outputs = Function_Froms.outputs found_froms in let check_for_behavior b = let activity = AB.is_active ab b in match activity with | False -> () | True | Unknown -> let pp_activity fmt activity = match activity with | False -> assert false | True -> () (* If unknown, the error may be because we did not notice that the behavior is inactive. *) | Unknown -> Format.fprintf fmt "(the behavior may be inactive)" in (match b.b_assigns with | WritesAny -> () | Writes(assigns_deps) -> let bol = Property.Id_contract (Datatype.String.Set.empty,b) in let ip = Extlib.the (Property.ip_of_assigns kf Kglobal bol b.b_assigns) in let source = fst (Property.location ip) in (* First, check the assigns. *) let assigns = List.map fst assigns_deps in let assigns_zones = List.map (eval_assigns_from pre_state) assigns in let assigns_union = link assigns_zones in let status_txt, vstatus, status = if not (Zone.is_included outputs assigns_union) then ( Value_parameters.debug "@[Cannot prove assigns clause@]@ \ @[<2>found assigns: %a@]@ @[<2>stated assigns: %a@]" Zone.pretty outputs Zone.pretty assigns_union; "unknown", Unknown, Property_status.Dont_know) else "valid", True, Property_status.True in msg_status vstatus ~once:true ~source "%a: assigns got status %s.%a%t" (pp_header kf) b status_txt pp_activity activity Value_util.pp_callstack; let emit_status ppt status = Property_status.emit ~distinct:true Value_util.emitter ~hyps:[] ppt status in emit_status ip status; (* Now, checks the individual froms. *) let check_from ((asgn,deps) as from) assigns_zone = match deps with | FromAny -> () | From deps -> let status_txt, status = check_from pre_state asgn assigns_zone deps found_froms in let ip = Extlib.the (Property.ip_of_from kf Kglobal bol from) in let source = fst (asgn.it_content.term_loc) in msg_status status ~once:true ~source "%a: \\from ... part in assign clause got status %s.%a%t" (pp_header kf) b status_txt pp_activity activity Value_util.pp_callstack; emit_status ip (conv_status status) in List.iter2 check_from assigns_deps assigns_zones) in List.iter check_for_behavior behaviors let verify_assigns_from kf ~pre froms = let funspec = Annotations.funspec kf in let env = Eval_terms.env_pre_f ~pre () in let eval_predicate pred = match Eval_terms.eval_predicate env pred with | Eval_terms.True -> Alarmset.True | Eval_terms.False -> Alarmset.False | Eval_terms.Unknown -> Alarmset.Unknown in let ab = AB.create eval_predicate funspec in check_fct_assigns kf ab ~pre_state:pre froms;; Db.Value.verify_assigns_froms := verify_assigns_from;; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_specification.mli����������������������0000666�0000000�0000000�00000003232�13571573400�024372� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** No function exported. Registers Db.Value.verify_assigns_from. *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_transfer.ml����������������������������0000666�0000000�0000000�00000024336�13571573400�023235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval open Cvalue.Model type value = Main_values.CVal.t type location = Main_locations.PLoc.location let unbottomize = function | `Bottom -> Cvalue.V.bottom | `Value v -> v module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = value option and type loc = location) = struct type state = Cvalue.Model.t (* ---------------------------------------------------------------------- *) (* Assumptions *) (* ---------------------------------------------------------------------- *) let reduce valuation lval value t = let typ = Cil.typeOfLval lval in if Cil.typeHasQualifier "volatile" typ then t else match Valuation.find_loc valuation lval with | `Value record -> let loc = Precise_locs.imprecise_location record.loc in if Locations.cardinal_zero_or_one loc then reduce_indeterminate_binding t loc value else t | `Top -> t (* Cannot reduce without the location of the lvalue. *) let is_smaller_value typ v1 v2 = let size = Integer.of_int (Cil.bitsSizeOf typ) in let card1 = Cvalue.V.cardinal_estimate v1 ~size and card2 = Cvalue.V.cardinal_estimate v2 ~size in Integer.lt card1 card2 (* Update the state according to a Valuation. *) let update valuation t = let process exp record t = match exp.enode with | Lval lv -> if record.reductness = Reduced then let {v; initialized; escaping} = record.value in let v = unbottomize v in let v = (* The origin contains the value already stored in the state, when its type is incompatible with the lvalue [lv]. The precision of this previous value and [v] are then incomparable (none is included in the other). We use some notion of cardinality of abstract values to choose the best value to keep. *) match record.origin with | Some (Some previous_v) -> let typ = Cil.typeOfLval lv in if is_smaller_value typ v previous_v then v else previous_v | _ -> v in let value = Cvalue.V_Or_Uninitialized.make ~initialized ~escaping v in reduce valuation lv value t else t | _ -> t in Valuation.fold process valuation t (* ---------------------------------------------------------------------- *) (* Assignments *) (* ---------------------------------------------------------------------- *) let write_abstract_value state (lval, loc, typ) assigned_value = let {v; initialized; escaping} = assigned_value in let value = unbottomize v in Warn.warn_right_exp_imprecision lval loc value; let value = if Cil.typeHasQualifier "volatile" typ then Cvalue_forward.make_volatile value else value in match loc.Locations.loc with | Locations.Location_Bits.Top (Base.SetLattice.Top, orig) -> Value_parameters.result "State before degeneration:@\n======%a@\n=======" Cvalue.Model.pretty state; Value_util.warning_once_current "writing at a completely unknown address@[%a@].@\nAborting." Origin.pretty_as_reason orig; raise Db.Value.Aborted | _ -> let exact = Locations.cardinal_zero_or_one loc in let value = Cvalue.V_Or_Uninitialized.make ~initialized ~escaping value in (* let value = Cvalue.V_Or_Uninitialized.initialized value in *) add_indeterminate_binding ~exact state loc value exception Do_assign_imprecise_copy let copy_one_loc state left_lv right_lv = let left_lval, left_loc, left_typ = left_lv and right_lval, right_loc, right_typ = right_lv in (* Warn if right_loc is imprecise *) Warn.warn_imprecise_lval_read right_lval right_loc Cvalue.V.bottom; (* top size is tested before this function is called, in which case the imprecise copy mode is used. *) let size = Int_Base.project right_loc.Locations.size in let offsetmap = copy_offsetmap right_loc.Locations.loc size state in let make_volatile = Cil.typeHasQualifier "volatile" left_typ || Cil.typeHasQualifier "volatile" right_typ in match offsetmap with | `Bottom -> `Bottom | `Value offsm -> (* TODO: this is the good place to handle partially volatile struct, whether as source or destination *) let offsetmap = if make_volatile then Cvalue.V_Offsetmap.map_on_values (Cvalue.V_Or_Uninitialized.map Cvalue_forward.make_volatile) offsm else offsm in if not (Eval_typ.offsetmap_matches_type left_typ offsetmap) then raise Do_assign_imprecise_copy; Cvalue_offsetmap.warn_right_imprecision left_lval left_loc offsetmap; `Value (paste_offsetmap ~exact:true ~from:offsetmap ~dst_loc:left_loc.Locations.loc ~size state) let make_determinate value = { v = `Value value; initialized = true; escaping = false } let copy_right_lval state left_lv right_lv copied_value = let lval, loc, typ = left_lv in (* Size mismatch between left and right size, or imprecise size. This cannot be done by copies, but require a conversion *) let right_size = Main_locations.PLoc.size right_lv.lloc and left_size = Main_locations.PLoc.size loc in if not (Int_Base.equal left_size right_size) || Int_Base.is_top right_size then fun loc -> write_abstract_value state (lval, loc, typ) copied_value else fun loc -> try let process right_loc acc = let left_lv = lval, loc, typ and right_lv = right_lv.lval, right_loc, right_lv.ltyp in match copy_one_loc state left_lv right_lv with | `Bottom -> acc | `Value state -> join acc state in Precise_locs.fold process right_lv.lloc bottom with Do_assign_imprecise_copy -> write_abstract_value state (lval, loc, typ) copied_value let assign _stmt { lval; ltyp; lloc } _expr assigned valuation state = let state = update valuation state in let assign_one_loc = match assigned with | Assign value -> let assigned_value = make_determinate value in fun loc -> write_abstract_value state (lval, loc, ltyp) assigned_value | Copy (right_lv, copied_value) -> copy_right_lval state (lval, lloc, ltyp) right_lv copied_value in let aux_loc loc acc_state = let s = assign_one_loc loc in join acc_state s in let state = Precise_locs.fold aux_loc lloc bottom in if not (is_reachable state) then `Bottom else `Value state (* ---------------------------------------------------------------------- *) (* Function Calls *) (* ---------------------------------------------------------------------- *) let actualize_formals state arguments = let treat_one_formal state arg = let offsm = Cvalue_offsetmap.offsetmap_of_assignment state arg.concrete arg.avalue in Cvalue.Model.add_base (Base.of_varinfo arg.formal) offsm state in List.fold_left treat_one_formal state arguments let start_call _stmt call valuation state = let state = update valuation state in let with_formals = actualize_formals state call.arguments in let stack_with_call = Value_util.call_stack () in Db.Value.Call_Value_Callbacks.apply (with_formals, stack_with_call); `Value with_formals let finalize_call stmt call ~pre:_ ~post:state = (* Deallocate memory allocated via alloca(). To minimize computations, only do it for function definitions. *) let state' = if Kernel_function.is_definition call.kf then let stack = (call.kf, Kstmt stmt) :: (Value_util.call_stack ()) in Builtins_malloc.free_automatic_bases stack state else state in `Value state' let show_expr valuation state fmt expr = match expr.enode with | Lval lval -> let record = match Valuation.find_loc valuation lval with | `Value record -> record | `Top -> assert false in let offsm = Cvalue_offsetmap.offsetmap_of_lval state lval record.loc in let typ = Cil.typeOf expr in Eval_op.pretty_offsetmap typ fmt offsm | _ -> Format.fprintf fmt "%s" (Unicode.top_string ()) (* ----------------- Export assumption functions -------------------------- *) let update valuation state = `Value (update valuation state) let assume _stmt _expr _positive = update end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/cvalue_transfer.mli���������������������������0000666�0000000�0000000�00000004332�13571573400�023400� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Transfer functions for the main domain of the Value analysis. *) type value = Main_values.CVal.t type location = Main_locations.PLoc.location module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = value option and type loc = location) : sig include Abstract_domain.Transfer with type state = Cvalue.Model.t and type value := value and type location := location and type valuation := Valuation.t end (* Local Variables: compile-command: "make -C ../../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/locals_scoping.ml�����������������������������0000666�0000000�0000000�00000012370�13571573400�023044� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Locations type clobbered_set = { mutable clob: Base.SetLattice.t } let structural_descr = let open Structural_descr in t_record [| Base.SetLattice.packed_descr |] let bottom () = { clob = Base.SetLattice.bottom } let top () = { clob = Base.SetLattice.top } let remember_bases_with_locals clob new_clob = clob.clob <- Base.SetLattice.join new_clob clob.clob let remember_if_locals_in_value clob left_loc v = if Cvalue.V.contains_addresses_of_any_locals v then let new_clob = Location_Bits.get_bases left_loc.loc in remember_bases_with_locals clob new_clob let offsetmap_contains_local offm = try Cvalue.V_Offsetmap.iter_on_values (fun v -> if Cvalue.V.contains_addresses_of_any_locals (Cvalue.V_Or_Uninitialized.get_v v) then raise Exit ) offm; false with Exit -> true (* Rebuild [offsm] by applying [f] to the bindings that verify [test]. Also call [warn] in this case. *) let rebuild_offsetmap f warn offsm = Cvalue.V_Offsetmap.fold (fun (_,_ as itv) (v, m, r) acc -> let changed, v' = f v in if changed then begin warn ~itv ~v:(Cvalue.V_Or_Uninitialized.get_v v); Cvalue.V_Offsetmap.add itv (v', m, r) acc end else acc) offsm offsm (* make escaping the ranges of [offsetmap] that verify [test]. Honor [exact], and warn using [warn] on those ranges. *) let make_escaping_offsetmap test warn ~exact offsetmap = let make_escaping v = Cvalue.V_Or_Uninitialized.unspecify_escaping_locals ~exact test v in rebuild_offsetmap make_escaping warn offsetmap let make_escaping ~exact ~escaping ~on_escaping ~within state = (* Clean [offsm], and bind it to [base] if it is modified. *) let aux base offsm state = let test b = Base.Hptset.mem b escaping in let on_escaping = on_escaping ~b:base in let offsm' = make_escaping_offsetmap test on_escaping ~exact offsm in if Cvalue.V_Offsetmap.equal offsm' offsm then state else Cvalue.Model.add_base base offsm' state in (* Clean the offsetmap bound to [base] in [state] *) let aux' base state = try match Cvalue.Model.find_base base state with | `Top | `Bottom -> state | `Value offsm -> aux base offsm state with Not_found -> state in try (* Iterate on all the bases that might contain a variable to clean *) Base.SetLattice.fold aux' within (aux' Base.null state) with Abstract_interp.Error_Top -> (* [bases] is too imprecise. Iterate on the entire memory state instead, which is much slower *) match state with | Cvalue.Model.Top | Cvalue.Model.Bottom -> state | Cvalue.Model.Map m -> Cvalue.Model.fold aux m state let make_escaping_fundec fundec clob vars state = let filter acc v = if v.vtemp || not v.vreferenced then acc else Base.Hptset.add (Base.of_varinfo v) acc in let vars = List.fold_left filter Base.Hptset.empty vars in if Base.Hptset.is_empty vars then state else (* Detect whether we are deallocating an inner block of the function, or a formal/a toplevel local. This is used for the warning message. *) let is_inner_block = let b = Base.Hptset.choose vars in not (Base.is_formal b fundec || Base.is_block_local b fundec.sbody) in let escaping = vars in let on_escaping ~b ~itv:_ ~v = let bases = match Cvalue.V.get_bases v with | Base.SetLattice.Top -> escaping | Base.SetLattice.Set bases -> Base.Hptset.inter bases escaping in Warn.warn_locals_escape is_inner_block fundec b bases in make_escaping ~exact:true ~escaping ~on_escaping ~within:clob.clob state (* Local Variables: compile-command: "make -C ../../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/locals_scoping.mli����������������������������0000666�0000000�0000000�00000007402�13571573400�023215� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Auxiliary functions to mark invalid (more precisely 'escaping') the references to a variable whose scope ends. *) (** Set of bases that might contain a reference to a local or formal variable. Those references must be marked as dangling once we leave the scope of those local or formals. *) type clobbered_set = { mutable clob: Base.SetLattice.t } val structural_descr: Structural_descr.t val bottom: unit -> clobbered_set val top: unit -> clobbered_set val remember_bases_with_locals: clobbered_set -> Base.SetLattice.t -> unit (** Add the given set of bases to an existing clobbered set *) val remember_if_locals_in_value: clobbered_set -> Locations.location -> Cvalue.V.t -> unit (** [remember_locals_in_value clob loc v] adds all bases pointed to by [loc] to [clob] if [v] contains the address of a local or formal *) val offsetmap_contains_local: Cvalue.V_Offsetmap.t -> bool val make_escaping: exact:bool -> escaping:Base.Hptset.t -> on_escaping:(b:Base.t -> itv:Integer.t * Integer.t -> v:Cvalue.V.t -> unit) -> within:Base.SetLattice.t -> Cvalue.Model.t -> Cvalue.Model.t (** [make_escaping ~exact ~escaping ~on_escaping ~within state] changes all references to the variables in [escaping] to "escaping address". All such references must be in the offsetmaps bound to [within]. [on_escaping b itv v] is called when a reference is found: [v] is the value that refers to [escaping], [b] is the base in which [v] appears (included in [within]) and [itv] is the offset at which [v] appears. If [exact] holds, a strong update is performed. Otherwise, only a week update is executed. *) val make_escaping_fundec: Cil_types.fundec -> clobbered_set -> Cil_types.varinfo list -> Cvalue.Model.t -> Cvalue.Model.t (** [make_escaping_fundec fdec clob l state] changes all references to the local or formal variables in [l] to "escaping". All pointers to [l] should be in the offsetmap bound to the variables contained in [clob]. [fdec] is used to detect whether we are deallocating the outer scope of a function, in which case a different warning is emitted. *) (* Local Variables: compile-command: "make -C ../../../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/warn.ml���������������������������������������0000666�0000000�0000000�00000012344�13571573400�021015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Locations let warn_locals_escape is_block fundec k locals = let pretty_base = Base.pretty in let pretty_block fmt = Pretty_utils.pp_cond is_block fmt "a block of " in let sv = fundec.svar in Value_parameters.warning ~wkey:Value_parameters.wkey_locals_escaping ~current:true ~once:true "locals %a escaping the scope of %t%a through %a" Base.Hptset.pretty locals pretty_block Printer.pp_varinfo sv pretty_base k let warn_imprecise_lval_read lv loc contents = if Value_parameters.verbose_atleast 1 then let pretty_gm fmt s = let s = Base.SetLattice.(inject (O.remove Base.null s)) in Base.SetLattice.pretty fmt s in let pretty_param fmt param = match param with | Base.SetLattice.Top -> Format.fprintf fmt "is imprecise" | Base.SetLattice.Set s -> Format.fprintf fmt "is a garbled mix of %a" pretty_gm s in let pretty_param_b fmt param = match param with | Base.SetLattice.Top -> Format.fprintf fmt "The contents@ are imprecise" | Base.SetLattice.Set s -> Format.fprintf fmt "It contains@ a garbled@ mix@ of@ %a" pretty_gm s in let something_to_warn = match loc.loc with | Location_Bits.Top _ -> true | Location_Bits.Map _ -> match contents with | Location_Bytes.Top _ -> true | Location_Bytes.Map _ -> false in if something_to_warn then Value_parameters.result ~current:true ~once:true "@[<v>@[Reading left-value %a.@]@ %t%t%t@]" Printer.pp_lval lv (fun fmt -> match loc.loc with | Location_Bits.Top (param,o) when Origin.equal o Origin.top -> Format.fprintf fmt "@[The location %a.@]@ " pretty_param param | Location_Bits.Top (param,orig) -> Format.fprintf fmt "@[The location @[%a@]@ because of@ %a.@]@ " pretty_param param Origin.pretty orig | Location_Bits.Map _ -> match lv with | Mem _, _ -> Format.fprintf fmt "@[The location is @[%a@].@]@ " Location_Bits.pretty loc.loc | Var _, _ -> () ) (fun fmt -> match contents with | Location_Bytes.Top (param,o) when Origin.equal o Origin.top -> Format.fprintf fmt "@[%a.@]" pretty_param_b param | Location_Bytes.Top (param,orig) -> Format.fprintf fmt "@[%a@ because of@ %a.@]" pretty_param_b param Origin.pretty orig | Location_Bytes.Map _ -> ()) Value_util.pp_callstack (* Auxiliary function for [do_assign] below. When computing the result of [lv = exp], warn if the evaluation of [exp] results in an imprecision. [loc_lv] is the location pointed to by [lv]. [exp_val] is the part of the evaluation of [exp] that is imprecise. *) let warn_right_exp_imprecision lv loc_lv exp_val = match exp_val with | Location_Bytes.Top(_topparam,origin) -> Value_parameters.result ~once:true ~current:true "@[<v>@[Assigning imprecise value to %a%t.@]%a%t@]" Printer.pp_lval lv (fun fmt -> match lv with | (Mem _, _) -> Format.fprintf fmt "@ (pointing to %a)" (Locations.pretty_english ~prefix:false) loc_lv | (Var _, _) -> ()) (fun fmt org -> if not (Origin.is_top origin) then Format.fprintf fmt "@ @[The imprecision@ originates@ from@ %a@]" Origin.pretty org) origin Value_util.pp_callstack | Location_Bytes.Map _ -> () (* Local Variables: compile-command: "make -C ../../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/cvalue/warn.mli��������������������������������������0000666�0000000�0000000�00000003625�13571573400�021170� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Alarms and imprecision warnings emitted during the analysis. *) open Cil_types open Locations val warn_locals_escape: bool -> fundec -> Base.t -> Base.Hptset.t -> unit val warn_imprecise_lval_read: lval -> location -> Location_Bytes.t -> unit val warn_right_exp_imprecision: lval -> location -> Cvalue.V.t -> unit �����������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/domain_builder.ml������������������������������������0000666�0000000�0000000�00000021166�13571573400�021546� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type InputDomain = sig include Abstract_domain.S val storage: unit -> bool end module Complete (Domain: InputDomain) = struct include Domain module Store = Domain_store.Make (Domain) let key: Domain.t Structure.Key_Domain.key = Structure.Key_Domain.create_key Domain.name let post_analysis _state = () end open Simpler_domains let simplify_argument argument = { formal = argument.Eval.formal; concrete = argument.Eval.concrete } let simplify_call call = { kf = call.Eval.kf; arguments = List.map simplify_argument call.Eval.arguments; rest = List.map fst call.Eval.rest; return = call.Eval.return; recursive = call.Eval.recursive } module Make_Minimal (Value: Abstract_value.S) (Location: Abstract_location.S) (Domain: Simpler_domains.Minimal) = struct include Domain let log_category = Value_parameters.register_category ("d-" ^ name) type value = Value.t type location = Location.location type state = Domain.t type origin = unit let narrow x _y = `Value x let top_answer = `Value (Value.top, ()), Alarmset.all let extract_expr _oracle _state _expr = top_answer let extract_lval _oracle _state _lval _typ _location = top_answer let backward_location _state _lval _typ location value = `Value (location, value) let reduce_further _sttae _expr _value = [] module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = origin and type loc = location) = struct let update _valuation state = `Value state let assign kinstr lv expr _value _valuation state = Domain.assign kinstr lv.Eval.lval expr state let assume stmt expr positive _valuation state = Domain.assume stmt expr positive state let start_call stmt call _valuation state = `Value (Domain.start_call stmt (simplify_call call) state) let finalize_call stmt call ~pre ~post = Domain.finalize_call stmt (simplify_call call) ~pre ~post let show_expr _valuation = Domain.show_expr end let enter_loop _stmt state = state let incr_loop_counter _stmt state = state let leave_loop _stmt state = state let initialize_variable lval _location ~initialized value state = Domain.initialize_variable lval ~initialized value state let initialize_variable_using_type _kind varinfo state = let lval = Cil.var varinfo in let state = introduce_globals [varinfo] state in Domain.initialize_variable lval ~initialized:true Abstract_domain.Top state let logic_assign _assigns _location ~pre:_ _state = top let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ t _ _ = `Value t let relate _kf _bases _state = Base.SetLattice.top let filter _kf _ _bases state = state let reuse _kf _bases ~current_input:_ ~previous_output = previous_output end module Complete_Minimal (Value: Abstract_value.S) (Location: Abstract_location.S) (Domain: Simpler_domains.Minimal) = struct module D = struct include Make_Minimal (Value) (Location) (Domain) include (Datatype.Make_with_collections (struct include Datatype.Undefined type t = Domain.t let name = Domain.name let reprs = [ Domain.top ] let equal x y = Domain.compare x y = 0 let compare = Domain.compare let hash = Domain.hash let pretty = Domain.pretty let mem_project = Datatype.never_any_project end) : Datatype.S_with_collections with type t := t) let storage () = false end include Complete (D) end module Complete_Minimal_with_datatype (Value: Abstract_value.S) (Location: Abstract_location.S) (Domain: Minimal_with_datatype) = struct module D = struct include Make_Minimal (Value) (Location) (Domain) include (Datatype.With_collections (Domain) (struct let module_name = Domain.name end) : Datatype.S_with_collections with type t := t) let storage () = false end include Complete (D) end open Eval module Complete_Simple_Cvalue (Domain: Simpler_domains.Simple_Cvalue) = struct module D = struct include Domain include (Datatype.With_collections (Domain) (struct let module_name = Domain.name end) : Datatype.S_with_collections with type t := t) let log_category = Value_parameters.register_category ("d-" ^ name) type value = Cvalue.V.t type location = Precise_locs.precise_location type state = Domain.t type origin = unit let narrow x _y = `Value x let extract_expr _oracle state expr = let v = Domain.extract_expr state expr >>-: fun v -> v, () in v, Alarmset.all let extract_lval _oracle state lval typ location = let v = Domain.extract_lval state lval typ location >>-: fun v -> v, () in v, Alarmset.all let backward_location _state _lval _typ location value = `Value (location, value) let reduce_further _state _expr _value = [] module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = origin and type loc = location) = struct let find valuation expr = match Valuation.find valuation expr with | `Top -> `Top | `Value record -> `Value record.value let find_loc valuation lval = match Valuation.find_loc valuation lval with | `Top -> `Top | `Value record -> `Value record.loc let record valuation = { find = find valuation; find_loc = find_loc valuation; } let update _valuation state = `Value state let assign kinstr lv expr value valuation state = Domain.assign kinstr lv expr value (record valuation) state let assume stmt expr positive valuation state = Domain.assume stmt expr positive (record valuation) state let start_call stmt call valuation state = `Value (Domain.start_call stmt call (record valuation) state) let finalize_call = Domain.finalize_call let show_expr _valuation = Domain.show_expr end let enter_loop _stmt state = state let incr_loop_counter _stmt state = state let leave_loop _stmt state = state let initialize_variable lval _location ~initialized value state = Domain.initialize_variable lval ~initialized value state let initialize_variable_using_type _kind varinfo state = let lval = Cil.var varinfo in let state = introduce_globals [varinfo] state in Domain.initialize_variable lval ~initialized:true Abstract_domain.Top state let logic_assign _assigns _location ~pre:_ _state = top let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ t _ _ = `Value t let relate _kf _bases _state = Base.SetLattice.top let filter _kf _ _bases state = state let reuse _kf _bases ~current_input:_ ~previous_output = previous_output let storage () = false end include Complete (D) end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/domain_builder.mli�����������������������������������0000666�0000000�0000000�00000005527�13571573400�021722� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Automatic builders to complete abstract domains from different simplified interfaces. *) module type InputDomain = sig include Abstract_domain.S val storage: unit -> bool end module Complete (Domain: InputDomain) : Abstract_domain.Leaf with type state = Domain.state and type value = Domain.value and type location = Domain.location module Complete_Minimal (Value: Abstract_value.S) (Location: Abstract_location.S) (Domain: Simpler_domains.Minimal) : Abstract_domain.Leaf with type value = Value.t and type location = Location.location and type state = Domain.t module Complete_Minimal_with_datatype (Value: Abstract_value.S) (Location: Abstract_location.S) (Domain: Simpler_domains.Minimal_with_datatype) : Abstract_domain.Leaf with type value = Value.t and type location = Location.location and type state = Domain.t module Complete_Simple_Cvalue (Domain: Simpler_domains.Simple_Cvalue) : Abstract_domain.Leaf with type value = Cvalue.V.t and type location = Precise_locs.precise_location and type state = Domain.t �������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/domain_lift.ml���������������������������������������0000666�0000000�0000000�00000015150�13571573400�021052� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval module type Conversion = sig type extended_value type extended_location type internal_value type internal_location val extend_val : internal_value -> extended_value val restrict_val : extended_value -> internal_value val extend_loc : internal_location -> extended_location val restrict_loc : extended_location -> internal_location end module Make (Domain: Abstract_domain.Leaf) (Convert : Conversion with type internal_value := Domain.value and type internal_location := Domain.location) = struct include (Domain : Datatype.S_with_collections with type t = Domain.t) include (Domain : Abstract_domain.Lattice with type state = Domain.state) let structure = Abstract.Domain.Leaf (Domain.key, (module Domain)) let log_category = Domain.log_category type value = Convert.extended_value type location = Convert.extended_location type origin = Domain.origin let extract_expr oracle state exp = let oracle exp = oracle exp >>=: Convert.restrict_val in Domain.extract_expr oracle state exp >>=: fun (value, origin) -> Convert.extend_val value, origin let extract_lval oracle state lval typ loc = let oracle exp = oracle exp >>=: Convert.restrict_val in let loc = Convert.restrict_loc loc in Domain.extract_lval oracle state lval typ loc >>=: fun (value, origin) -> Convert.extend_val value, origin let backward_location state lval typ loc value = Domain.backward_location state lval typ (Convert.restrict_loc loc) (Convert.restrict_val value) >>-: fun (loc, value) -> Convert.extend_loc loc, Convert.extend_val value let reduce_further state expr value = let list = Domain.reduce_further state expr (Convert.restrict_val value) in List.map (fun (e, v) -> e, Convert.extend_val v) list let lift_left left = { left with lloc = Convert.restrict_loc left.lloc } let lift_flagged_value value = { value with v = value.v >>-: Convert.restrict_val } let lift_assigned = function | Assign value -> Assign (Convert.restrict_val value) | Copy (lval, value) -> Copy (lift_left lval, lift_flagged_value value) let lift_argument arg = { arg with avalue = lift_assigned arg.avalue } let lift_call call = let arguments = List.map lift_argument call.arguments in let rest = List.map (fun (exp, assigned) -> exp, lift_assigned assigned) call.rest in { call with arguments; rest } module Transfer (Valuation: Abstract_domain.Valuation with type value = Convert.extended_value and type origin = Domain.origin and type loc = Convert.extended_location) = struct module Internal_Valuation = struct type t = Valuation.t type value = Domain.value type origin = Domain.origin type loc = Domain.location let lift_record record = { record with value = lift_flagged_value record.value } let find valuation expr = match Valuation.find valuation expr with | `Value record -> `Value (lift_record record) | `Top -> `Top let fold f valuation acc = Valuation.fold (fun exp record acc -> f exp (lift_record record) acc) valuation acc let find_loc valuation loc = match Valuation.find_loc valuation loc with | `Value r -> `Value {r with loc = Convert.restrict_loc r.loc} | `Top -> `Top end module Internal_Transfer = Domain.Transfer (Internal_Valuation) let update = Internal_Transfer.update let assign stmt lv expr value valuation state = Internal_Transfer.assign stmt (lift_left lv) expr (lift_assigned value) valuation state let assume = Internal_Transfer.assume let start_call stmt call valuation state = let call = lift_call call in Internal_Transfer.start_call stmt call valuation state let finalize_call stmt call ~pre ~post = let call = lift_call call in Internal_Transfer.finalize_call stmt call ~pre ~post let show_expr = Internal_Transfer.show_expr end let logic_assign assigns location ~pre state = Domain.logic_assign assigns (Convert.restrict_loc location) ~pre state let evaluate_predicate = Domain.evaluate_predicate let reduce_by_predicate = Domain.reduce_by_predicate let enter_scope = Domain.enter_scope let leave_scope = Domain.leave_scope let enter_loop = Domain.enter_loop let incr_loop_counter = Domain.incr_loop_counter let leave_loop = Domain.leave_loop let empty = Domain.empty let introduce_globals = Domain.introduce_globals let initialize_variable lval loc ~initialized init_value state = let loc = Convert.restrict_loc loc in Domain.initialize_variable lval loc ~initialized init_value state let initialize_variable_using_type = Domain.initialize_variable_using_type let relate = Domain.relate let filter = Domain.filter let reuse = Domain.reuse module Store = Domain.Store let post_analysis = Domain.post_analysis end (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/domain_lift.mli��������������������������������������0000666�0000000�0000000�00000004706�13571573400�021230� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type Conversion = sig type extended_value type extended_location type internal_value type internal_location val extend_val : internal_value -> extended_value val restrict_val : extended_value -> internal_value val extend_loc : internal_location -> extended_location val restrict_loc : extended_location -> internal_location end module Make (Domain: Abstract_domain.Leaf) (Convert : Conversion with type internal_value := Domain.value and type internal_location := Domain.location) : Abstract.Domain.Internal with type state = Domain.state and type value = Convert.extended_value and type location = Convert.extended_location and type origin = Domain.origin (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/domain_product.ml������������������������������������0000666�0000000�0000000�00000036554�13571573400�021607� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval let counter = ref 0 let product_category = Value_parameters.register_category "domain_product" module Make (Value: Abstract_value.S) (Left: Abstract.Domain.Internal with type value = Value.t) (Right: Abstract.Domain.Internal with type value = Left.value and type location = Left.location) = struct type value = Left.value type location = Left.location type origin = { left: reductness * Left.origin; right: reductness * Right.origin; } let () = incr counter let name = Left.name ^ "*" ^ Right.name ^ "(" ^ string_of_int !counter ^ ")" include Datatype.Pair_with_collections (Left) (Right) (struct let module_name = name end) type state = t let structure = Abstract.Domain.Node (Left.structure, Right.structure) let log_category = product_category let top = Left.top, Right.top let is_included (left1, right1) (left2, right2) = Left.is_included left1 left2 && Right.is_included right1 right2 let join (left1, right1) (left2, right2) = Left.join left1 left2, Right.join right1 right2 let widen kf stmt (left1, right1) (left2, right2) = Left.widen kf stmt left1 left2, Right.widen kf stmt right1 right2 let narrow (left1, right1) (left2, right2) = Left.narrow left1 left2 >>- fun left -> Right.narrow right1 right2 >>-: fun right -> (left, right) let merge (eval1, alarms1) (eval2, alarms2) = match Alarmset.inter alarms1 alarms2 with | `Inconsistent -> `Bottom, Alarmset.none | `Value alarms -> let value = eval1 >>- fun (v1, o1) -> eval2 >>- fun (v2, o2) -> Value.narrow v1 v2 >>-: fun value -> let left = if Value.equal value v1 then Unreduced else if Value.equal v1 Value.top then Created else Reduced and right = if Value.equal value v2 then Unreduced else if Value.equal v2 Value.top then Created else Reduced in let origin = {left = left, o1; right = right, o2} in value, origin in value, alarms let extract_expr oracle (left, right) expr = merge (Left.extract_expr oracle left expr) (Right.extract_expr oracle right expr) let extract_lval oracle (left, right) lval typ location = merge (Left.extract_lval oracle left lval typ location) (Right.extract_lval oracle right lval typ location) let backward_location (left, right) lval typ loc value = (* TODO: Loc.narrow *) Left.backward_location left lval typ loc value >>- fun (loc, value1) -> Right.backward_location right lval typ loc value >>- fun (loc, value2) -> Value.narrow value1 value2 >>-: fun value -> loc, value let reduce_further (left, right) expr value = List.append (Left.reduce_further left expr value) (Right.reduce_further right expr value) module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = origin and type loc = location) = struct module type Lift = sig type o val side : origin -> reductness * o end module Lift_Valuation (Lift: Lift) = struct type t = Valuation.t type value = Value.t type origin = Lift.o type loc = Valuation.loc let lift_record record = let origin = Extlib.opt_map Lift.side record.origin in let reductness = match record.reductness, origin with | Unreduced, Some (reduced, _) -> reduced | Unreduced, None -> Unreduced (* This case should not happen. *) | Reduced, Some (Created, _) -> Created | _ as x, _ -> x in let origin = Extlib.opt_map snd origin in { record with origin; reductness } let find valuation expr = match Valuation.find valuation expr with | `Value record -> `Value (lift_record record) | `Top -> `Top let fold f valuation acc = Valuation.fold (fun exp record acc -> f exp (lift_record record) acc) valuation acc let find_loc = Valuation.find_loc end module Left_Valuation = Lift_Valuation (struct type o = Left.origin let side o = o.left end) module Right_Valuation = Lift_Valuation (struct type o = Right.origin let side o = o.right end) module Left_Transfer = Left.Transfer (Left_Valuation) module Right_Transfer = Right.Transfer (Right_Valuation) let update valuation (left, right) = Left_Transfer.update valuation left >>- fun left -> Right_Transfer.update valuation right >>-: fun right -> left, right let assign stmt lv expr value valuation (left, right) = Left_Transfer.assign stmt lv expr value valuation left >>- fun left -> Right_Transfer.assign stmt lv expr value valuation right >>-: fun right -> left, right let assume stmt expr positive valuation (left, right) = Left_Transfer.assume stmt expr positive valuation left >>- fun left -> Right_Transfer.assume stmt expr positive valuation right >>-: fun right -> left, right let finalize_call stmt call ~pre ~post = let pre_left, pre_right = pre and left_state, right_state = post in Left_Transfer.finalize_call stmt call ~pre:pre_left ~post:left_state >>- fun left -> Right_Transfer.finalize_call stmt call ~pre:pre_right ~post:right_state >>-: fun right -> left, right let start_call stmt call valuation (left, right) = Left_Transfer.start_call stmt call valuation left >>- fun left -> Right_Transfer.start_call stmt call valuation right >>-: fun right -> left, right let show_expr = let (|-) f g = fun fmt exp -> f fmt exp; g fmt exp in let show_expr_one_side category name show_expr = fun fmt exp -> if Value_parameters.is_debug_key_enabled category then Format.fprintf fmt "@,@]@[<v># %s: @[<hov>%a@]" name show_expr exp in let right_log = Right.log_category and left_log = Left.log_category in match left_log = product_category, right_log = product_category with | true, true -> (fun valuation (left, right) -> Left_Transfer.show_expr valuation left |- Right_Transfer.show_expr valuation right) | true, false -> (fun valuation (left, right) -> Left_Transfer.show_expr valuation left |- show_expr_one_side right_log Right.name (Right_Transfer.show_expr valuation right)) | false, true -> (fun valuation (left, right) -> show_expr_one_side left_log Left.name (Left_Transfer.show_expr valuation left) |- Right_Transfer.show_expr valuation right) | false, false -> (fun valuation (left, right) -> show_expr_one_side left_log Left.name (Left_Transfer.show_expr valuation left) |- show_expr_one_side right_log Right.name (Right_Transfer.show_expr valuation right)) end let pretty = let print_one_side fmt category name dump state = if Value_parameters.is_debug_key_enabled category then Format.fprintf fmt "# %s:@ @[<hv>%a@]@ " name dump state in let right_log = Right.log_category and left_log = Left.log_category in match left_log = product_category, right_log = product_category with | true, true -> (fun fmt (left, right) -> Left.pretty fmt left; Right.pretty fmt right) | true, false -> (fun fmt (left, right) -> Left.pretty fmt left; print_one_side fmt right_log Right.name Right.pretty right) | false, true -> (fun fmt (left, right) -> print_one_side fmt left_log Left.name Left.pretty left; Right.pretty fmt right) | false, false -> (fun fmt (left, right) -> print_one_side fmt left_log Left.name Left.pretty left; print_one_side fmt right_log Right.name Right.pretty right) let logic_assign assign location ~pre:(left_pre, right_pre) (left, right) = Left.logic_assign assign location ~pre:left_pre left, Right.logic_assign assign location ~pre:right_pre right let lift_logic_env f logic_env = Abstract_domain.{ states = (fun label -> f (logic_env.states label)); result = logic_env.result; } let split_logic_env logic_env = lift_logic_env fst logic_env, lift_logic_env snd logic_env let evaluate_predicate logic_environment (left, right) pred = let left_env, right_env = split_logic_env logic_environment in let left_status = Left.evaluate_predicate left_env left pred and right_status = Right.evaluate_predicate right_env right pred in match Alarmset.Status.inter left_status right_status with | `Inconsistent -> (* This may happen when the product of states has no concretization. We would need an "Inconsistent" status to be precise, but it should not be usable by the domains. *) Abstract_interp.Comp.True | `Value status -> status let reduce_by_predicate logic_environment (left, right) pred positive = let left_env, right_env = split_logic_env logic_environment in Left.reduce_by_predicate left_env left pred positive >>- fun left -> Right.reduce_by_predicate right_env right pred positive >>-: fun right -> left, right let enter_scope kf vars (left, right) = Left.enter_scope kf vars left, Right.enter_scope kf vars right let leave_scope kf vars (left, right) = Left.leave_scope kf vars left, Right.leave_scope kf vars right let enter_loop stmt (left, right) = Left.enter_loop stmt left, Right.enter_loop stmt right let incr_loop_counter stmt (left, right) = Left.incr_loop_counter stmt left, Right.incr_loop_counter stmt right let leave_loop stmt (left, right) = Left.leave_loop stmt left, Right.leave_loop stmt right let empty () = Left.empty (), Right.empty () let introduce_globals vars (left, right) = Left.introduce_globals vars left, Right.introduce_globals vars right let initialize_variable lval loc ~initialized init_value (left, right) = Left.initialize_variable lval loc ~initialized init_value left, Right.initialize_variable lval loc ~initialized init_value right let initialize_variable_using_type kind varinfo (left, right) = Left.initialize_variable_using_type kind varinfo left, Right.initialize_variable_using_type kind varinfo right let relate kf bases (left, right) = Base.SetLattice.join (Left.relate kf bases left) (Right.relate kf bases right) let filter kf kind bases (left, right) = Left.filter kf kind bases left, Right.filter kf kind bases right let reuse kf bases ~current_input ~previous_output = let left_input, right_input = current_input and left_output, right_output = previous_output in Left.reuse kf bases ~current_input:left_input ~previous_output:left_output, Right.reuse kf bases ~current_input:right_input ~previous_output:right_output let merge_tbl left_tbl right_tbl = let open Value_types in let tbl = Callstack.Hashtbl.create 7 in let merge callstack left = try let right = Callstack.Hashtbl.find right_tbl callstack in Callstack.Hashtbl.replace tbl callstack (left, right) with Not_found -> () in Callstack.Hashtbl.iter merge left_tbl; if Callstack.Hashtbl.length tbl > 0 then `Value tbl else `Bottom let lift_tbl f tbl = let open Value_types in let new_tbl = Callstack.Hashtbl.create 7 in let lift cs t = Callstack.Hashtbl.replace new_tbl cs (f t) in Callstack.Hashtbl.iter lift tbl; `Value new_tbl let merge_callstack_tbl left right = match left, right with | `Top, `Top -> `Top | `Value left, `Value right -> merge_tbl left right | `Top, `Value right -> lift_tbl (fun t -> Left.top, t) right | `Value left, `Top -> lift_tbl (fun t -> t, Right.top) left | `Bottom, _ | _, `Bottom -> `Bottom module Store = struct let register_global_state state = Left.Store.register_global_state (state >>-: fst); Right.Store.register_global_state (state >>-: snd) let register_initial_state callstack (left, right) = Left.Store.register_initial_state callstack left; Right.Store.register_initial_state callstack right let register_state_before_stmt callstack stmt (left, right) = Left.Store.register_state_before_stmt callstack stmt left; Right.Store.register_state_before_stmt callstack stmt right let register_state_after_stmt callstack stmt (left, right) = Left.Store.register_state_after_stmt callstack stmt left; Right.Store.register_state_after_stmt callstack stmt right let get_global_state () = Left.Store.get_global_state () >>- fun left -> Right.Store.get_global_state () >>-: fun right -> left, right let get_initial_state kf = Left.Store.get_initial_state kf >>- fun left -> Right.Store.get_initial_state kf >>-: fun right -> left, right let get_initial_state_by_callstack kf = let left_tbl = Left.Store.get_initial_state_by_callstack kf and right_tbl = Right.Store.get_initial_state_by_callstack kf in merge_callstack_tbl left_tbl right_tbl let get_stmt_state ~after stmt = Left.Store.get_stmt_state ~after stmt >>- fun left -> Right.Store.get_stmt_state ~after stmt >>-: fun right -> left, right let get_stmt_state_by_callstack ~after stmt = let left_tbl = Left.Store.get_stmt_state_by_callstack ~after stmt and right_tbl = Right.Store.get_stmt_state_by_callstack ~after stmt in merge_callstack_tbl left_tbl right_tbl end let post_analysis = function | `Bottom -> Left.post_analysis `Bottom; Right.post_analysis `Bottom | `Value (left, right) -> Left.post_analysis (`Value left); Right.post_analysis (`Value right) end (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/domain_product.mli�����������������������������������0000666�0000000�0000000�00000004177�13571573400�021754� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val product_category: Value_parameters.category module Make (Value: Abstract_value.S) (Left: Abstract.Domain.Internal with type value = Value.t) (Right: Abstract.Domain.Internal with type value = Left.value and type location = Left.location) : Abstract.Domain.Internal with type value = Value.t and type location = Left.location and type state = Left.state * Right.state (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/domain_store.ml��������������������������������������0000666�0000000�0000000�00000020720�13571573400�021247� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval module type InputDomain = sig include Abstract_domain.Lattice include Datatype.S with type t = state val storage: unit -> bool end module Make (Domain: InputDomain) = struct let name = Domain.name ^ ".Store" (* This module stores the resulting states of an Eva analysis. They depends on the set of parameters with which the analysis has been run, and must be cleared each time one of this parameter is changed. Thus, the tables of this module have as dependencies Db.Value.self, the internal state of Eva (all parameters of Eva are added as codependencies of this state). *) let dependencies = [ Db.Value.self ] let size = 16 module type Ref = sig val get : unit -> bool val set : bool -> unit end (* Boolean reference saved on the disk. *) module Bool_Ref_State = State_builder.Ref (Datatype.Bool) (struct let dependencies = dependencies let name = name ^ ".Storage" let default () = false end) (* Boolean reference. Not saved on the disk. *) module Bool_Ref = struct let x = ref false let set y = x := y let get () = !x end (* A boolean reference indicating whether the states of the domain have been saved. False by default, it becomes true when the engine calls [register_global_state] at the start of the analysis. If the domain is unmarshallable, its states cannot be saved on the disk, and this boolean should not be saved either. *) module Storage = (val (if Descr.is_unmarshable Domain.descr then (module Bool_Ref) else (module Bool_Ref_State)) : Ref) module Global_State = State_builder.Option_ref (Domain) (struct let dependencies = dependencies let name = name ^ ".Global_State" end) module States_by_callstack = Value_types.Callstack.Hashtbl.Make (Domain) module Table_By_Callstack = Cil_state_builder.Stmt_hashtbl(States_by_callstack) (struct let name = name ^ ".Table_By_Callstack" let size = size let dependencies = dependencies end) module Table = Cil_state_builder.Stmt_hashtbl (Domain) (struct let name = name ^ ".Table" let size = size let dependencies = [ Table_By_Callstack.self ] end) module AfterTable_By_Callstack = Cil_state_builder.Stmt_hashtbl (States_by_callstack) (struct let name = name ^ ".AfterTable_By_Callstack" let size = size let dependencies = dependencies end) module AfterTable = Cil_state_builder.Stmt_hashtbl (Domain) (struct let name = name ^ ".AfterTable" let size = size let dependencies = [ AfterTable_By_Callstack.self ] end) module Called_Functions_By_Callstack = State_builder.Hashtbl (Kernel_function.Hashtbl) (States_by_callstack) (struct let name = name ^ ".Called_Functions_By_Callstack" let size = 11 let dependencies = dependencies end) module Called_Functions_Memo = State_builder.Hashtbl (Kernel_function.Hashtbl) (Domain) (struct let name = name ^ ".Called_Functions_Memo" let size = 11 let dependencies = [ Called_Functions_By_Callstack.self ] end) let update_callstack_table ~after stmt callstack v = let open Value_types in let find,add = if after then AfterTable_By_Callstack.find, AfterTable_By_Callstack.add else Table_By_Callstack.find, Table_By_Callstack.add in try let by_callstack = find stmt in begin try let o = Callstack.Hashtbl.find by_callstack callstack in Callstack.Hashtbl.replace by_callstack callstack (Domain.join o v) with Not_found -> Callstack.Hashtbl.add by_callstack callstack v end; with Not_found -> let r = Callstack.Hashtbl.create 7 in Callstack.Hashtbl.add r callstack v; add stmt r let register_global_state state = let storage = Domain.storage () in Storage.set storage; if storage then match state with | `Bottom -> () | `Value state -> Global_State.set state let register_initial_state callstack state = if Storage.get () then let open Value_types in let kf = match callstack with (kf, _) :: _ -> kf | _ -> assert false in let by_callstack = try Called_Functions_By_Callstack.find kf with Not_found -> let h = Callstack.Hashtbl.create 7 in Called_Functions_By_Callstack.add kf h; h in try let old = Callstack.Hashtbl.find by_callstack callstack in Callstack.Hashtbl.replace by_callstack callstack (Domain.join old state) with Not_found -> Callstack.Hashtbl.add by_callstack callstack state let get_global_state () = if not (Storage.get ()) then `Value Domain.top else match Global_State.get_option () with | None -> `Bottom | Some state -> `Value state let get_initial_state kf = if not (Storage.get ()) then `Value Domain.top else try `Value (Called_Functions_Memo.find kf) with Not_found -> try let by_callstack = Called_Functions_By_Callstack.find kf in let state = Value_types.Callstack.Hashtbl.fold (fun _cs state acc -> Bottom.join Domain.join acc (`Value state)) by_callstack `Bottom in ignore (state >>-: Called_Functions_Memo.add kf); state with Not_found -> `Bottom let get_initial_state_by_callstack kf = if not (Storage.get ()) then `Top else try `Value (Called_Functions_By_Callstack.find kf) with Not_found -> `Bottom let get_stmt_state ~after s = if not (Storage.get ()) then `Value Domain.top else let (find, add), find_by_callstack = if after then AfterTable.(find, add), AfterTable_By_Callstack.find else Table.(find, add), Table_By_Callstack.find in try `Value (find s) with Not_found -> let ho = try Some (find_by_callstack s) with Not_found -> None in let state = match ho with | None -> `Bottom | Some h -> Value_types.Callstack.Hashtbl.fold (fun _cs state acc -> Bottom.join Domain.join acc (`Value state)) h `Bottom in ignore (state >>-: add s); state let get_stmt_state_by_callstack ~after stmt = if not (Storage.get ()) then `Top else try `Value (if after then AfterTable_By_Callstack.find stmt else Table_By_Callstack.find stmt) with Not_found -> `Bottom let register_state_before_stmt callstack stmt state = if Storage.get () then update_callstack_table ~after:false stmt callstack state let register_state_after_stmt callstack stmt state = if Storage.get () then update_callstack_table ~after:true stmt callstack state end ������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/domain_store.mli�������������������������������������0000666�0000000�0000000�00000003500�13571573400�021415� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type InputDomain = sig include Abstract_domain.Lattice include Datatype.S with type t = state val storage: unit -> bool end module Make (Domain : InputDomain) : Abstract_domain.Store with type state := Domain.state ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/equality/��������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020066� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/equality/equality.ml���������������������������������0000666�0000000�0000000�00000041007�13571573400�022257� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Hcexprs type 'a trivial = Trivial | NonTrivial of 'a type 'a tree = Empty | Leaf of 'a | Node of 'a tree * 'a tree type elt = Hcexprs.HCE.t (* ------------------------------ Equality ---------------------------------- *) module Equality = struct include HCESet (* cardinality less or equal to 1: not a real equivalence class *) let is_trivial s = try fold (fun _ acc -> if acc = 0 then 1 else raise Exit) s 0 <= 1 with Exit -> false let return s = if is_trivial s then Trivial else NonTrivial s (* TODO: consistency *) let pair e1 e2 = if HCE.equal e1 e2 then Trivial else NonTrivial (add e2 (singleton e1)) let remove e s = return (remove e s) let inter s s' = return (inter s s') let filter f s = return (filter f s) let pretty fmt s = Pretty_utils.pp_iter ~pre:"@[<hov 3>{" ~sep:"@ =@ " ~suf:"}@]" iter (fun fmt a -> HCE.pretty fmt a) fmt s end type equality = Equality.t (* --------------------------- Equality Sets -------------------------------- *) module Set = struct module Initial_Values = struct let v = [[]] end module Dependencies = struct let l = [ HCE.self ] end (* A set of equalities between lvalues and expressions is encoded as a map from each lvalue or expression to: - the equality in which it is involved; - for a lvalue [lv], the set of expressions that contain [lv] in the map. This last information is needed when removing a lvalue, to remove or replace all expressions containing this lvalue. *) module Data = struct (* For a lvalue [lv], the first set gathers the expressions that depends on the value of [lv], and the second set gathers the expressions that contains [&lv]. *) include Datatype.Triple (Equality) (HCESet) (HCESet) let pretty_debug = pretty let inter (left_eq, left_set, left_set') (right_eq, right_set, right_set') = let equality = Equality.inter left_eq right_eq and set = HCESet.inter left_set right_set and set' = HCESet.inter left_set' right_set' in match equality with | NonTrivial eq -> Some (eq, set, set') | Trivial -> if HCESet.is_empty set && HCESet.is_empty set' then None else Some (Equality.empty, set, set') let union (left_eq, left_set, left_set') (right_eq, right_set, right_set') = Equality.union left_eq right_eq, HCESet.union left_set right_set, HCESet.union left_set' right_set' end include Hptmap.Make (HCE) (Data) (Hptmap.Comp_unused) (Initial_Values) (Dependencies) let find_option elt map = try let equality, _, _ = find elt map in if Equality.is_empty equality then None else Some equality with Not_found -> None let contains = mem let mem equality map = let head = Equality.choose equality in match find_option head map with | None -> false | Some eq -> Equality.subset equality eq let subset = binary_predicate (Hptmap_sig.PersistentCache "Equality.Set.subset") UniversalPredicate ~decide_fast:decide_fast_inclusion ~decide_fst:(fun _ (e, _, _) -> Equality.is_empty e) ~decide_snd:(fun _ _ -> true) ~decide_both:(fun _ (e1, _, _) (e2, _, _) -> Equality.subset e1 e2) let equal = binary_predicate (Hptmap_sig.PersistentCache "Equality.Set.subset") UniversalPredicate ~decide_fast:(fun s t -> if s == t then PTrue else PUnknown) ~decide_fst:(fun _ (e, _, _) -> Equality.is_empty e) ~decide_snd:(fun _ (e, _, _) -> Equality.is_empty e) ~decide_both:(fun _ (e1, _, _) (e2, _, _) -> Equality.equal e1 e2) (* TODO: replace all occurrences of Equality.fold by an heterogeneous iteration on the equality and the set of equalities. *) let register lvalues term map = let add_read = function | None -> Some (Equality.empty, HCESet.singleton term, HCESet.empty) | Some (equality, set, set') -> Some (equality, HCESet.add term set, set') and add_addr = function | None -> Some (Equality.empty, HCESet.empty, HCESet.singleton term) | Some (equality, set, set') -> Some (equality, set, HCESet.add term set') in let map = HCESet.fold (replace add_read) lvalues.Hcexprs.read map in HCESet.fold (replace add_addr) lvalues.Hcexprs.addr map (* Binds each element of [equality] into [equality] in [map], without changing dependances. *) let update_equality equality map = let update = function | Some (_, set, set') -> Some (equality, set, set') | None -> Some (equality, HCESet.empty, HCESet.empty) in Equality.fold (replace update) equality map let unite (a, a_lvalues) (b, b_lvalues) map = match Equality.pair a b with | Trivial -> map | NonTrivial equality -> (* Computes the transitive closure of [equality], taking the equalities already in [map] into account. *) let overall_equality, map = Equality.fold (fun elt (equality, map) -> match find_option elt map with | None -> let map = if HCE.equal elt a then register a_lvalues a map else register b_lvalues b map in equality, map | Some eq -> Equality.union eq equality, map) equality (equality, map) in (* Binds each element of this transitive closure to the closure itself. *) update_equality overall_equality map (* ----------------------- Remove or replace ---------------------------- *) (* When replacing a lvalue by an equal term, we pick the lvalue or expression with the smallest height possible. [set] must not be empty. *) let pick_representative set = let choose elt (current, height) = let elt = HCE.to_exp elt in let h = Value_util.height_expr elt in if h < height then (elt, h) else (current, height) in let head = HCESet.choose set in let current = HCE.to_exp head in let height = Value_util.height_expr current in fst (HCESet.fold choose (HCESet.remove head set) (current, height)) (* Binds the terms of the [equality] to [equality] in the [map]. [equality] may be trivial, in which case its element is removed. *) let replace_by_equality equality map = let replace key = let update = function | None -> assert false | Some (_, set, set') -> if Equality.is_trivial equality then (* Do not remove an lvalue that is related to other expressions in the map. *) if HCE.is_lval key && not HCESet.(is_empty set && is_empty set') then Some (Equality.empty, set, set') else None else Some (equality, set, set') in replace update key in Equality.fold replace equality map (* Removes [elt] from the equalities of the [map], where [elt] is not a lvalue. Does not update the dependencies of [elt] (the lvalues that [elt] contains still link to [elt]). *) let remove_from_equalities elt map = match find_option elt map with | None -> map | Some eq -> let map = replace_by_equality (HCESet.remove elt eq) map in remove elt map (* In the expression [elt], replaces [late] by [heir] and updates the map accordingly (the equality involving [elt] and the lvalues pointing to [elt]. *) let replace_in_element kind elt ~late ~heir map = if contains elt map then try (* Replaces [late] by [heir] in [elt]. *) let new_elt = HCE.replace kind ~late ~heir elt in let empty_lvalues = Hcexprs.empty_lvalues in let new_lvalues = if HCE.is_lval new_elt then empty_lvalues else syntactic_lvalues (HCE.to_exp new_elt) in (* Unite [elt] and [new_elt] before removing [elt].*) let map = unite (elt, empty_lvalues) (new_elt, new_lvalues) map in (* Removes [elt] from the new equality and the map. TODO: updates lvals to remove [elt] from their binding? *) let equality, _, _ = find elt map in let equality = HCESet.remove elt equality in let map = remove elt map in (* Updates the new equality in the map. *) replace_by_equality equality map with NonExchangeable -> remove_from_equalities elt map else map (* [remove lval map] removes any occurence of the lvalue [lval] in the [map]. When possible, [lval] is replaced by an equal lvalue or expression in any term of [map] that contains [lval]. Otherwise, these terms are simply removed as well. *) let remove kind lval map = let elt = HCE.of_lval lval in try let (equality, deps, addr_deps) = find elt map in (* If [lval] is out of scope, removes all terms that contain &lval. *) let map = if kind = Hcexprs.Deleted then HCESet.fold remove_from_equalities addr_deps map else map in (* Removes [lval] from [equality] and from the [map]. *) let equality = HCESet.remove elt equality in let map = replace_by_equality equality map in let map = remove elt map in (* If possible, replaces [lval] by an equal term (namely a term from [equality] that is not [lval] itself, nor contains [lval]). Otherwise, removes all terms containing [lval]. *) let equality = HCESet.diff equality deps in if HCESet.is_empty equality then HCESet.fold remove_from_equalities deps map else (* Replaces all occurrences of [lval] by [rep]. *) let rep = pick_representative equality in let process elt map = replace_in_element kind elt ~late:lval ~heir:rep map in HCESet.fold process deps map with (* If [lval] is not bound in the [map], nothing to do. *) Not_found -> map let find elt map = let equality, _, _ = find elt map in if Equality.is_empty equality then raise Not_found else equality (* ---------------------- Merges and iterators -------------------------- *) (* The pointwise union of the maps is incomplete: the naive union of [a=b] and [b=c] binds [b] to [a=b=c], but binds [a] to [a=b] and [c] to [b=c]. This function computes properly the join of separated equalities, as well as the connections between lvalues and expressions. It must however be completed by the transitive closure of equalities. *) let naive_union = let decide _key left right = Data.union left right in join ~cache:(Hptmap_sig.PersistentCache "Equality.Set.union") ~symmetric:true ~idempotent:true ~decide (* Computes the transitive closure of the equalities from two maps. Ignores the equalities that do not involve a same term in both maps, as they are properly handled by [naive_union]. Thus, this function only considers the keys that belongs to both maps (and their bound equalities). It does not update the connections between lvalues and expressions, as they are properly computed by [naive_union]. *) let transitive_closure = (* The terms present in only one set are ignored. *) let empty_left _ = empty and empty_right _ = empty in (* If the equalities bound to [key] are different and non empty in both maps, join them. The [naive_union] has correctly join the equal equalities.*) let both key (eq, _, _) (eq', _, _) = if Equality.is_empty eq || Equality.is_empty eq' || Equality.equal eq eq' then empty else let join = Equality.union eq eq' in singleton key (join, HCESet.empty, HCESet.empty) in (* The join of two sets computes the transitive closure of their equalities. *) let join set set' = (* Adds an equality to a set. If the equality contains some terms bound to other equalities in the set, then performs the union of all these equalities, and updates these terms with the resulting equality. Does not handle connections between lvalues and expressions. *) let add key equality set = let process elt (list, eq as acc) = match find_option elt set with | None -> acc | Some eq' -> elt :: list, Equality.union eq eq' in (* [keys] are the keys to update with the new [equality]. *) let keys, equality = Equality.fold process equality ([key], equality) in let data = equality, HCESet.empty, HCESet.empty in List.fold_left (fun acc key -> add key data acc) set keys in (* Addition of each equality from the right set to the left set. *) fold (fun elt (eq, _, _) acc -> add elt eq acc) set' set in fold2_join_heterogeneous ~cache:(Hptmap_sig.PersistentCache "Equality.Set.in_both") ~empty_left ~empty_right ~both ~join ~empty let union a b = (* Naive pointwise union of maps. *) let r = naive_union a b in (* Computes the equalities that are missing in [r]. *) let missing_equalities = transitive_closure a (shape b) in (* Binds the equalities of [missing_equalities] in [r]. [processed] is the set of the terms that have been already updated. *) let update key (equality, _, _) (map, processed) = if HCESet.mem key processed then map, processed else update_equality equality map, HCESet.union equality processed in fst (fold update missing_equalities (r, HCESet.empty)) let inter = inter ~cache:(Hptmap_sig.PersistentCache "Equality.Set.inter") ~symmetric:true ~idempotent:true ~decide:(fun _ a b -> Data.inter a b) let choose map = let equality, _, _ = snd (min_binding map) in equality (* is representative? *) let is_rep elt eq = if Equality.is_empty eq then false else HCE.equal (Equality.choose eq) elt let fold f map acc = fold (fun elt (eq, _, _) acc -> if is_rep elt eq then f eq acc else acc) map acc let elements map = fold (fun eq acc -> eq :: acc) map [] let iter f map = iter (fun elt (eq, _, _) -> if is_rep elt eq then f eq) map let exists f map = exists (fun elt (eq, _, _) -> if is_rep elt eq then f eq else false) map let for_all f map = for_all (fun elt (eq, _, _) -> if is_rep elt eq then f eq else true) map let deep_fold f map acc = fold (fun eq accu -> Equality.fold (f eq) eq accu) map acc let pretty fmt map = Pretty_utils.pp_iter ~pre:"@[" ~sep:"@ " ~suf:"@]" iter (fun fmt eq -> Format.fprintf fmt "@[%a@]" Equality.pretty eq) fmt map let keys = let cache_name = "Equality.Set.keys" in let temporary = false in let f k _ = if HCE.is_lval k then Leaf k else Empty in let joiner t1 t2 = Node (t1, t2) in let empty = Empty in cached_fold ~cache_name ~temporary ~f ~joiner ~empty let lvalues_only_left = let cache = Hptmap_sig.PersistentCache "Equality.Set.elements_only_left" in let empty_left _ = Empty in let empty_right t = keys t in let both _ _ _ = Empty in let join t1 t2 = Node (t1, t2) in let empty = Empty in let f = fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty in fun eqs1 eqs2 -> f eqs1 (shape eqs2) end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/equality/equality.mli��������������������������������0000666�0000000�0000000�00000012734�13571573400�022435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Equalities between syntactic lvalues and expressions. *) open Cil_types type 'a trivial = Trivial | NonTrivial of 'a type 'a tree = Empty | Leaf of 'a | Node of 'a tree * 'a tree type elt = Hcexprs.HCE.t (** The type of the equality elements. *) (** Representation of an equality between a set of elements. The signatures is roughly a subset of Ocaml's [Set.S]. An equality always contains at least two elements; operations that break this invariant return Trivial. *) module Equality : sig include Datatype.S val pair : elt -> elt -> t trivial (** The equality between two elements. *) val mem: elt -> t -> bool (** [mem x s] tests whether [x] belongs to the equality [s]. *) val add: elt -> t -> t (** [add x s] returns the equality between all elements of [s] and [x]. *) val remove: elt -> t -> t trivial (** [remove x s] returns the equality between all elements of [s], except [x]. *) val union: t -> t -> t (** Union. *) val inter: t -> t -> t trivial (** Intersection. *) val intersects : t -> t -> bool (** [intersect s s'] = true iff the two equalities both involve the same element. *) val compare: t -> t -> int val equal: t -> t -> bool val subset: t -> t -> bool val iter: (elt -> unit) -> t -> unit (** [iter f s] applies [f] in turn to all elements of [s]. *) val fold: (elt -> 'a -> 'a) -> t -> 'a -> 'a (** [fold f s a] computes [(f xN ... (f x2 (f x1 a))...)], where [x1 ... xN] are the elements of [s], in increasing order. *) val for_all: (elt -> bool) -> t -> bool (** [for_all p s] checks if all elements of the equality satisfy the predicate [p]. *) val exists: (elt -> bool) -> t -> bool (** [exists p s] checks if at least one element of the equality satisfies the predicate [p]. *) val filter: (elt -> bool) -> t -> t trivial (** [filter p s] returns the equality between all elements in [s] that satisfy predicate [p]. *) val cardinal: t -> int (** Return the number of elements of the equality. *) val choose: t -> elt (** Return the representative of the equality. *) end type equality = Equality.t (** Sets of equalities. *) module Set : sig include Datatype.S (** The set operators are redefined so that equalities involving a same term are joined: ∀ e₁, e₂ ∈ Set, e₁ ≠ e₂ ⇔ e₁ ∩ e₂ = ∅ *) val empty: t val is_empty: t -> bool val union: t -> t -> t val inter: t -> t -> t val compare: t -> t -> int val equal: t -> t -> bool val subset: t -> t -> bool val iter: (equality -> unit) -> t -> unit val fold: (equality -> 'a -> 'a) -> t -> 'a -> 'a val for_all: (equality -> bool) -> t -> bool val exists: (equality -> bool) -> t -> bool val elements: t -> equality list val choose : t -> equality (** [remove lval set] remove any expression [e] such that [lval] belongs to [syntactic_lval e] from the set of equalities [set]. *) val remove : Hcexprs.kill_type -> lval -> t -> t (** [unite (a, a_set) (b, b_set) map] unites [a] and [b] in [map]. [a_set] must be equal to [syntactic_lval a], and [b_set] to [syntactic_lval b]. *) val unite : (elt * Hcexprs.lvalues) -> (elt * Hcexprs.lvalues) -> t -> t (** [find elt set] return the (single) equality involving [elt] that belongs to [set], or raise Not_found if no such equality exists. *) val find : elt -> t -> equality (** Same as [find], but return None in the last case. *) val find_option : elt -> t -> equality option (** [mem equality set] = true iff ∃ eq ∈ set, equality ⊆ eq *) val mem : equality -> t -> bool (** [contains elt set] = true iff [elt] belongs to an equality of [set]. *) val contains : elt -> t -> bool val deep_fold : (equality -> elt -> 'a -> 'a) -> t -> 'a -> 'a val cardinal : t -> int (* Returns the set of lvalues only present in the left tree. *) val lvalues_only_left: t -> t -> elt tree end ������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/equality/equality_domain.ml��������������������������0000666�0000000�0000000�00000050127�13571573400�023611� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval type call_init_state = | ISCaller | ISFormals | ISEmpty let call_init_state kf = let str = try Value_parameters.EqualityCallFunction.find kf with Not_found -> Value_parameters.EqualityCall.get () in match str with | "all" -> ISCaller | "formals" -> ISFormals | "none" -> ISEmpty | _ -> assert false let dkey = Value_parameters.register_category "d-eq" open Hcexprs (* ------------------------- Dependences ------------------------------------ *) module Deps = struct include Datatype.Pair (HCEToZone) (BaseToHCESet) (* Map from expression to its dependencies, and inverse map from the bases of the dependencies to the expressions *) let empty = HCEToZone.empty, BaseToHCESet.empty let join (m1, i1) (m2, i2) = HCEToZone.inter m1 m2, BaseToHCESet.inter i1 i2 let is_included (m1, _) (m2, _) = HCEToZone.is_included m1 m2 let concat (m1, i1) (m2, i2) = HCEToZone.union m1 m2, BaseToHCESet.union i1 i2 let intersects (m, i: t) z = let aux_e e acc = try let z_e = HCEToZone.find e m in if Locations.Zone.intersects z z_e then e :: acc else acc with Not_found -> acc in let aux_base b _ acc = let set = BaseToHCESet.find_default b i in HCESet.fold aux_e set acc in (* TODO: a recursive descent would be much more effective *) Locations.Zone.fold_topset_ok aux_base z [] let add e z (m, i : t) = let aux_base b _ acc = let set = BaseToHCESet.find_default b i in let set = HCESet.add e set in BaseToHCESet.add b set acc in let i = Locations.Zone.fold_topset_ok aux_base z i in let m = HCEToZone.add e z m in (m, i : t) let remove e (m, i as state : t) = try let z = HCEToZone.find e m in let aux_base b _ i = let s = BaseToHCESet.find_default b i in let s = HCESet.remove e s in if HCESet.is_empty s then BaseToHCESet.remove b i else BaseToHCESet.add b s i in let i = Locations.Zone.fold_topset_ok aux_base z i in let m = HCEToZone.remove e m in (m, i) with Not_found -> (* cannot find [e] in [m] *) state end (* --------------------- Internal Types of the Domain ----------------------- *) module Internal = struct include Datatype.Triple_with_collections (Equality.Set) (Deps) (Locations.Zone) (* memory zones that have been overwritten since the beginning of the function. Not used when the state of the caller is used as initial state. *) (struct let module_name = "equality_domain_reloaded" end) type state = t let name = "Equality domain" let log_category = dkey let key = Structure.Key_Domain.create_key "equality_domain" type equalities = Equality.Set.t let project (t, _, _) = t let pretty fmt (eqs, _, _) = Equality.Set.pretty fmt eqs let pretty_debug fmt (eqs, deps, modified) = Format.fprintf fmt "@[<v>@[<hov 2>Eqs: %a@]@.@[<hov 2>Deps: %a@]@.@[<hov 2>Changed: %a@]@]" Equality.Set.pretty eqs Deps.pretty deps Locations.Zone.pretty modified let empty = Equality.Set.empty, Deps.empty, Locations.Zone.bottom let top = Equality.Set.empty, Deps.empty, Locations.Zone.top let rec fold_tree f t acc = match t with | Equality.Empty -> acc | Equality.Leaf v -> f v acc | Equality.Node (t1, t2) -> fold_tree f t2 (fold_tree f t1 acc) let is_included (a, m, y) (b, n, z) = Equality.Set.subset b a && Deps.is_included m n && Locations.Zone.is_included y z let join (e1, d1, z1) (e2, d2, z2) = let e' = Equality.Set.inter e1 e2 in let z' = Locations.Zone.join z1 z2 in let removed1 = Equality.Set.lvalues_only_left e1 e' in let removed2 = Equality.Set.lvalues_only_left e2 e' in let d1' = fold_tree Deps.remove removed1 d1 in let d2' = fold_tree Deps.remove removed2 d2 in let d' = Deps.join d1' d2' in e', d', z' (* Can we define a more efficient widening? *) let widen _kf _stmt a b = join a b let concat (e1, d1, z1) (e2, d2, z2) = Equality.Set.union e1 e2, Deps.concat d1 d2, Locations.Zone.join z1 z2 let narrow (e1, d1, z1) (e2, d2, z2) = if Deps.equal d1 d2 then `Value (Equality.Set.union e1 e2, d1, Locations.Zone.narrow z1 z2) else `Value (e1, d1, z1) let storage = Value_parameters.EqualityStorage.get let post_analysis _state = () end module Store = Domain_store.Make (Internal) (* ------------------------- Abstract Domain -------------------------------- *) module Make (Value : Abstract.Value.External) = struct include Internal module Store = Store let get_cvalue = Value.get Main_values.CVal.key type value = Value.t type location = Precise_locs.precise_location type origin = unit let reduce_further (equalities, _, _) expr value = let atom = HCE.of_exp expr in match Equality.Set.find_option atom equalities with | Some equality -> Equality.Equality.fold (fun atom acc -> let e = HCE.to_exp atom in if Cil_datatype.ExpStructEq.equal e expr then acc else (e, value) :: acc) equality [] | None -> [] let backward_location _state _lv _typ loc value = `Value (loc, value) (* Remove all 'origin' information from the Cvalue component of a value. Since we perform evaluations at the current statement, the origin information we compute is incompatible with the one obtained from e.g. the Cvalue domain. *) let imprecise_origin = match get_cvalue with | None -> fun v -> v | Some get -> fun v -> let c = get v in if Cvalue.V.is_imprecise c then let c' = Cvalue.V.topify_with_origin Origin.top c in Value.set Main_values.CVal.key c' v else v let coop_eval oracle equalities atom_src = match Equality.Set.find_option atom_src equalities with | Some equality -> let aux_eq atom acc = if HCE.equal atom atom_src then acc (* avoid trivial recursion *) else let e = HCE.to_exp atom in let v', _alarms = oracle e in Bottom.narrow Value.narrow acc v' in let v = Equality.Equality.fold aux_eq equality (`Value Value.top) in (* Remove the 'origin' information of garbled mixes. *) let v = v >>-: fun v -> imprecise_origin v, () in (* All expressions used by the equality domain have already been evaluated before during the analysis; alarms about those expressions have already been emitted. *) v, Alarmset.none | None -> `Value (Value.top, ()), Alarmset.all let extract_expr (oracle: exp -> Value.t evaluated) (equalities, _, _) expr = let expr = Cil.constFold true expr in let atom_e = HCE.of_exp expr in coop_eval oracle equalities atom_e let extract_lval oracle (equalities, _, _) lval _typ _location = let atom_lv = HCE.of_lval lval in coop_eval oracle equalities atom_lv let kill kt zone (equalities, deps, modified_zone) = if Locations.Zone.(equal zone top) then top else let modified_zone = match kt with | Hcexprs.Modified -> Locations.Zone.join modified_zone zone | Hcexprs.Deleted -> Locations.Zone.diff modified_zone zone in match Deps.intersects deps zone with | [] -> equalities, deps, modified_zone | atoms -> let extract_lval h = Extlib.the (HCE.to_lval h) in let atoms = List.map extract_lval atoms in let process eq atom = Equality.Set.remove kt atom eq in let equalities' = List.fold_left process equalities atoms in let disappeared = Equality.Set.lvalues_only_left equalities equalities' in let deps = fold_tree Deps.remove disappeared deps in let s' = equalities', deps, modified_zone in s' (* assume that [vars] go out of scope, and remove them from the list of equalities *) let unscope state vars = let aux_vi zones vi = let z = Locations.zone_of_varinfo vi in Locations.Zone.join z zones in let zone = List.fold_left aux_vi Locations.Zone.bottom vars in kill Hcexprs.Deleted zone state module Transfer (Valuation: Abstract_domain.Valuation with type value = Value.t and type loc = Precise_locs.precise_location) = struct let find_val valuation expr = match Valuation.find valuation expr with | `Top -> Value.top | `Value record -> Bottom.non_bottom record.value.v let minus_zero = Cvalue.V.inject_float Fval.minus_zero let plus_zero = Cvalue.V.inject_float Fval.plus_zero let incompatible_zeros v1 v2 = let aux v1 v2 = Cvalue.V.(is_included minus_zero v1 && is_included plus_zero v2) in aux v1 v2 || aux v2 v1 (* Does the equality between two expressions imply they have the same object representation, allowing the narrow of their abstract values? *) let is_safe_equality = match get_cvalue with | None -> fun _ _ _ -> false | Some get_cvalue -> fun valuation e1 e2 -> let cval1 = get_cvalue (find_val valuation e1) and cval2 = get_cvalue (find_val valuation e2) in Cvalue_forward.are_comparable Abstract_interp.Comp.Eq cval1 cval2 && not (incompatible_zeros cval1 cval2) exception Top_location let find_loc valuation = fun lval -> match Valuation.find_loc valuation lval with | `Top -> raise Top_location | `Value record -> record.loc let add_one_dep valuation lval deps = match HCE.get lval with | E _ -> assert false | LV lv -> let zone = match lv with | Var vi, NoOffset -> Locations.zone_of_varinfo vi | _ -> let expr = Cil.dummy_exp (Lval lv) in Value_util.zone_of_expr (find_loc valuation) expr in Deps.add lval zone deps let add_deps valuation lvalues deps = let deps = HCESet.fold (add_one_dep valuation) lvalues.read deps in HCESet.fold (add_one_dep valuation) lvalues.addr deps let update _valuation state = `Value state let is_singleton = match get_cvalue with | None -> fun _ -> false | Some get -> function | `Bottom -> true | `Value v -> Cvalue.V.cardinal_zero_or_one (get v) let expr_cardinal_zero_or_one valuation e = match Valuation.find valuation e with | `Top -> false (* should not happen *) | `Value { value = { v } } -> is_singleton v let expr_is_cardinal_zero_or_one_loc valuation e = match e.enode with | Lval lv -> begin let loc = Valuation.find_loc valuation lv in match loc with | `Top -> false (* should not happen *) | `Value loc -> Precise_locs.cardinal_zero_or_one loc.loc end | _ -> false (* TODO: handle upcasts *) let register expr valuation deps = let term = HCE.of_exp expr in if HCE.is_lval term then let deps = add_one_dep valuation term deps in term, Hcexprs.empty_lvalues, deps else let lvalues = Hcexprs.syntactic_lvalues expr in term, lvalues, add_deps valuation lvalues deps let indeterminate_copy = function | Assign _ -> false | Copy (_loc, value) -> not value.initialized || value.escaping (* Auxiliary function for [assign]. The equality is inferred, unless: - some of the expressions involved are volatile - the value has an aggregate type (as the current Eva values have no meaning for such type, the equality would be useless or misleading). - it is an assignment by copy, and the copied value is possibly unitialized or escaping. In this case, when using the equality later, the reevaluation of [right_expr] would reduce it incorrectly, by removing indeterminate flags without emitting alarms. *) let assign_eq left_lval right_expr value valuation state = if Eval_typ.lval_contains_volatile left_lval || Eval_typ.expr_contains_volatile right_expr || not (Cil.isArithmeticOrPointerType (Cil.typeOfLval left_lval)) || indeterminate_copy value then state else let (equalities, deps, modified_zone: t) = state in let lterm = HCE.of_lval left_lval in let lterm_lvals = Hcexprs.empty_lvalues in let deps = add_one_dep valuation lterm deps in let rterm, rterm_lvals, deps = register right_expr valuation deps in let equalities = Equality.Set.unite (lterm, lterm_lvals) (rterm, rterm_lvals) equalities in (equalities, deps, modified_zone: t) let assign _stmt left_value right_expr value valuation state = let open Locations in let left_loc = Precise_locs.imprecise_location left_value.lloc in let direct_left_zone = Locations.(enumerate_valid_bits Write left_loc) in let state = kill Hcexprs.Modified direct_left_zone state in let right_expr = Cil.constFold true right_expr in try let indirect_left_zone = Value_util.indirect_zone_of_lval (find_loc valuation) left_value.lval and right_zone = Value_util.zone_of_expr (find_loc valuation) right_expr in (* After an assignment lv = e, the equality [lv == eq] holds iff the value of [e] and the location of [lv] are not modified by the assignment, i.e. iff the dependencies of [e] and of the lhost and offset of [lv] do not intersect the assigned location. Moreover, the domain do not store the equality when the abstract location of [lv] and the abstract value of [e] are singleton, as in this case, the main cvalue domain is able to infer the equality. *) if (Zone.intersects direct_left_zone right_zone) || (Zone.intersects direct_left_zone indirect_left_zone) || (is_singleton (Eval.value_assigned value) && Locations.cardinal_zero_or_one left_loc) then `Value state else `Value (assign_eq left_value.lval right_expr value valuation state) with Top_location -> `Value state (* Add the equalities between the formals of a function and the actuals at the call. *) let assign_formals valuation call state = let assign_formal state arg = if is_singleton (Eval.value_assigned arg.avalue) then state else try let left_value = Var arg.formal, NoOffset in assign_eq left_value arg.concrete arg.avalue valuation state with Top_location -> state in List.fold_left assign_formal state call.arguments (* The domain infers equalities [e1 = e2] stemming from assignments, meaning that e1 and e2 have not only the same value, but also the same object representation — their values can thus be safely narrowed, which is used by the domain to regain precision when possible. The domain can also infer equalities from conditions, but C values with different object representations may be equal, invalidating this reasoning. This is the case for equalities between 0. and -0., and between non-comparable pointers, so we need to skip such equalities. *) let assume _stmt expr positive valuation (eqs, deps, modified_zone as state) = match positive, expr.enode with | true, BinOp (Eq, e1, e2, _) | false, BinOp (Ne, e1, e2, _) -> begin if not (is_safe_equality valuation e1 e2) then `Value state else let e1 = Cil.constFold true e1 and e2 = Cil.constFold true e2 in if Eval_typ.expr_contains_volatile e1 || Eval_typ.expr_contains_volatile e2 || not (Cil.isArithmeticOrPointerType (Cil.typeOf e1)) || (expr_is_cardinal_zero_or_one_loc valuation e1 && expr_cardinal_zero_or_one valuation e2) || (expr_is_cardinal_zero_or_one_loc valuation e2 && expr_cardinal_zero_or_one valuation e1) then `Value state else try let a1, a1_lvals, deps = register e1 valuation deps in let a2, a2_lvals, deps = register e2 valuation deps in let eqs = Equality.Set.unite (a1, a1_lvals) (a2, a2_lvals) eqs in `Value (eqs, deps, modified_zone) with Top_location -> `Value state end | _ -> `Value state let start_call _stmt call valuation state = let state = match call_init_state call.kf with | ISCaller -> assign_formals valuation call state | ISFormals -> assign_formals valuation call empty | ISEmpty -> empty in `Value state let finalize_call _stmt call ~pre ~post = if call_init_state call.kf = ISCaller then `Value post (* [pre] was the state inferred in the caller, and it has been updated during the analysis of [kf] into [post]. Send all the equalities back to the caller. *) else (* [pre] contains the equalities from the caller, but [post] was computed starting from an essentially empty state. We must restore the equalities of [pre]. *) let (_, _, modif) = post in (* Invalidate the equalities that are no longer true. *) let pre' = kill Hcexprs.Modified modif pre in (* then merge the two sets of equalities *) `Value (concat pre' post) let show_expr _valuation (equalities, _, _) fmt expr = let atom = Hcexprs.HCE.of_exp expr in match Equality.Set.find_option atom equalities with | Some equality -> Equality.Equality.pretty fmt equality | None -> () end let logic_assign _assigns location ~pre:_ state = let loc = Precise_locs.imprecise_location location in let zone = Locations.(enumerate_valid_bits Write loc) in kill Hcexprs.Modified zone state let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ state _ _ = `Value state let enter_scope _kf _vars state = state let leave_scope _kf vars state = unscope state vars let enter_loop _ state = state let incr_loop_counter _ state = state let leave_loop _ state = state let empty () = empty let introduce_globals _vars state = state let initialize_variable _ _ ~initialized:_ _ state = state let initialize_variable_using_type _ _ state = state let relate kf _bases _state = match call_init_state kf with | ISEmpty | ISFormals -> Base.SetLattice.empty | ISCaller -> Base.SetLattice.top let filter _kf _kind _bases state = state let reuse _kf _bases ~current_input:_ ~previous_output:state = state end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/equality/equality_domain.mli�������������������������0000666�0000000�0000000�00000004646�13571573400�023767� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Initial abstract state at the beginning of a call. From most precise to less precise. *) type call_init_state = | ISCaller (** information from the caller is propagated in the callee. May be more precise, but problematic w.r.t Memexec because it increases cache miss dramatically. *) | ISFormals (** empty state, except for the equalities between a formal and the corresponding actual. Lesser impact on Memexec. *) | ISEmpty (** completely empty state, without impact on Memexec. *) module Make (Value : Abstract.Value.External) : sig include Abstract_domain.Leaf with type value = Value.t and type location = Precise_locs.precise_location val pretty_debug : Format.formatter -> t -> unit type equalities val project : t -> equalities end ������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/gauges/����������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017504� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/gauges/gauges_domain.ml������������������������������0000666�0000000�0000000�00000141267�13571573400�022653� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval type function_calls = | FullInterprocedural (* The state in the caller is inlined in the callee. Cannot remain precise in presence of calls to functions without a body. Makes Memexec really slow. *) | IntraproceduralAll (* Intraprocedural analysis only, we start a new function with an empty state ; this state is dropped at the end of a function, and we resume with the original state. Good for memexec. Unsound (see comments). *) | IntraproceduralNonReferenced (* Same as IntraproceduralAll, but only on non-global variables that are not referenced. Those variables cannot be modified by a callee, so this analysis is sound. Good for memexec. *) (* Silence warning *) let () = ignore [FullInterprocedural; IntraproceduralAll; IntraproceduralNonReferenced] let function_calls_handling = IntraproceduralNonReferenced module G = struct let opt2 f o1 o2 = match o1, o2 with | Some o1, Some o2 -> Some (f o1 o2) | _ -> None let cache_name s = Hptmap_sig.PersistentCache ("Value.Gauges." ^ s) module Bounds = struct include Datatype.Pair (Datatype.Option(Datatype.Integer)) (* lower bound, or -infty *) (Datatype.Option(Datatype.Integer)) (* upper bound, or +infty *) let pretty fmt (min, max: t) = match min, max with | Some min, Some max when Integer.equal min max -> Format.fprintf fmt "{%a}" Abstract_interp.Int.pretty min | _ -> let pp_bound sign fmt = function | None -> Format.fprintf fmt "%coo" sign | Some i -> Abstract_interp.Int.pretty fmt i in Format.fprintf fmt "[%a .. %a]" (pp_bound '-') min (pp_bound '+') max let pretty_debug = pretty let inject_range n1 n2 : t = Some (Integer.of_int (min n1 n2)), Some (Integer.of_int (max n1 n2)) let enlarge i (b1, b2: t) : t = (Extlib.opt_map (Integer.min i) b1, Extlib.opt_map (Integer.max i) b2) let lift fmin fmax (bmin1, bmax1: t) (bmin2, bmax2: t) : t = (opt2 fmin bmin1 bmin2, opt2 fmax bmax1 bmax2) let equal (bmin1, bmax1: t) (bmin2, bmax2: t) = Extlib.opt_equal Integer.equal bmin1 bmin2 && Extlib.opt_equal Integer.equal bmax1 bmax2 let is_included (bmin1, bmax1: t) (bmin2, bmax2: t) = (match bmin1, bmin2 with | _, None -> true | None, Some _ -> false | Some b1, Some b2 -> Integer.le b2 b1) && (match bmax1, bmax2 with | _, None -> true | None, Some _ -> false | Some b1, Some b2 -> Integer.le b1 b2) (* This function computes how much the bounds of [i2] have increased from those of [i1], i.e. [diff [1 .. 4] [-2 .. 8]] is [-3 .. 4] and [diff [-2 .. 8] [1 .. 4]] is [-4 .. 3]. *) let delta (i1: t) (i2: t) : t = let min1, max1 = i1 in let min2, max2 = i2 in let delta_min = opt2 Integer.sub min2 min1 in let delta_max = opt2 Integer.sub max2 max1 in (* we may need to reorder the pointwise subtractions. See the second example above. *) let min = opt2 Integer.min delta_min delta_max in let max = opt2 Integer.max delta_min delta_max in min, max let join = lift Integer.min Integer.max let add = lift Integer.add Integer.add let narrow (min1, max1: t) (min2, max2: t) : t Bottom.or_bottom = let minb = match min1, min2 with | Some i1, Some i2 -> Some (Integer.max i1 i2) | None, i | i, None -> i in let maxb = match max1, max2 with | Some i1, Some i2 -> Some (Integer.min i1 i2) | None, i | i, None -> i in match minb, maxb with | Some min, Some max when Integer.lt max min -> `Bottom | min, max -> `Value (min, max) let succ (b1, b2: t): t = (Extlib.opt_map Integer.succ b1, Extlib.opt_map Integer.succ b2) let neg (bmin, bmax: t) : t = Extlib.opt_map Integer.neg bmax, Extlib.opt_map Integer.neg bmin let mul_ct k (bmin, bmax: t) : t = let mul = Integer.mul k in if Integer.le k Integer.zero then Extlib.opt_map mul bmax, Extlib.opt_map mul bmin else Extlib.opt_map mul bmin, Extlib.opt_map mul bmax let mul (bmin1, bmax1: t) (bmin2, bmax2 as b2: t) : t = (* multiplication by infty *) let mul_inf = function | None -> None | Some i as v -> if Integer.equal i Integer.zero then v else None in (* b2 * bmin1 *) let mulmin = match bmin1 with | None -> mul_inf bmax2, mul_inf bmin2 | Some bmin1 -> mul_ct bmin1 b2 in (* b2 * bmax1 *) let mulmax = match bmax1 with | None -> mul_inf bmin2, mul_inf bmax2 | Some bmax1 -> mul_ct bmax1 b2 in join mulmin mulmax let zero = Some Integer.zero, Some Integer.zero (* Widening between two bounds. Unstable bounds are widened to infty aggressively, unless [threshold] is supplied. This widening does not assumes that [is_included i1 i2] holds, unlike the widening of Ival. *) let widen ?threshold (min1, max1: t) (min2, max2: t) : t = let widen_unstable_min b1 b2 = if Extlib.opt_equal Integer.equal b1 b2 then b1 else None in let widen_unstable_max b1 b2 = match threshold with | None -> widen_unstable_min b1 b2 | Some n -> (* more involved version that stops at n. *) match b1, b2 with | None, _ | _, None -> None | Some ib1, Some ib2 -> if Integer.equal ib1 ib2 then b1 else if Integer.le ib1 n && Integer.le ib2 n then Some n else None in (widen_unstable_min min1 min2, widen_unstable_max max1 max2) let to_ival (b1, b2: t) = Ival.inject_range b1 b2 let from_ival (i: Ival.t) : t = Ival.min_and_max i type classify = | ContainsZero | Positive (* strictly *) of Integer.t * Integer.t option | Negative (* strictly *) of Integer.t option * Integer.t let classify_sign (min, max: t) = match min, max with | None, None -> ContainsZero | Some min, Some max -> if Integer.gt min Integer.zero then Positive (min, Some max) else if Integer.lt max Integer.zero then Negative (Some min, max) else ContainsZero | Some min, max -> if Integer.gt min Integer.zero then Positive (min, max) else ContainsZero | min, Some max -> if Integer.lt max Integer.zero then Negative (min, max) else ContainsZero let div_towards_minus_infty x y = if Integer.gt y Integer.zero then Integer.e_div x y else Integer.(e_div (neg x) (neg y)) let div_towards_plus_infty x y = if Integer.lt y Integer.zero then Integer.e_div x y else Integer.(e_div (neg x) (neg y)) (* Computes the possible [n] such that [(add b)^n = r], when [f^n] is [f] consecutive applications of [f]. *) let backward_nb ~(b:t) ~(r:Ival.t) = let r = from_ival r in let nb_max = match classify_sign b with | ContainsZero -> None (* it is always possible to do any number of steps that do not bring us closer to the goal *) | Positive (minb, _maxb) -> begin (* b is strictly positive, each iteration strictly increases *) match snd r with | None -> (* r is unbounded, an infinite number of iterations is possible *) None | Some maxr -> if Integer.gt maxr Integer.zero then Some (div_towards_minus_infty maxr minb) else Some Integer.zero (* each iteration pulls us away *) end | Negative (_minb, maxb) -> begin (* Symmetric case *) match fst r with | None -> None | Some minr -> if Integer.lt minr Integer.zero then Some (div_towards_minus_infty minr maxb) else Some Integer.zero end in let nb_min = match classify_sign r with | ContainsZero -> Some Integer.zero (* already reached with 0 iterations *) | Positive (minr, _maxr) -> begin match snd b with | None -> (* max increment is variable, we cannot derive a bound *) Some Integer.zero | Some maxb -> if Integer.gt maxb Integer.zero then Some (div_towards_plus_infty minr maxb) else None (* bottom. Not currently returned *) end | Negative (_minr, maxr) -> begin (* symmetric *) match fst b with | None -> Some Integer.zero | Some minb -> if Integer.lt minb Integer.zero then Some (div_towards_plus_infty maxr minb) else None end in `Value (nb_min, nb_max) end (* A MV contains (usual) values for the different bases that are incremented in a loop. 1. for missing bases, no information is stored (i.e. Top) 2. bases are mapped to an interger range, or to a pointer 2.1. bases can only be mapped to a pointer with a single base address *) module MV = struct include Hptmap.Make(Base)(Cvalue.V)(Hptmap.Comp_unused) (struct let v = [] end) (struct let l = [Ast.self] end) (* This function computes a pointwise union on two MVs assumed to have disjoint set of keys. *) let merge_disjoint = let cache = cache_name "MV.merge_disjoint" in let decide _ _ _ = assert false in join ~cache ~symmetric:true ~idempotent:false ~decide let empty_wh = Integer.zero, (fun _ -> Ival.Widen_Hints.empty, Fc_float.Widen_Hints.empty) let widen = let cache = cache_name "MV.widen" in let decide _ b1 b2 = Some (Cvalue.V.widen empty_wh b1 b2) in inter ~cache ~symmetric:false ~idempotent:true ~decide let is_included = let cache = cache_name "MV.is_included" in let decide_fst _b _v1 = true (* v2 is top *) in let decide_snd _b _v2 = false (* v1 is top, v2 is not *) in let decide_both _ v1 v2 = Cvalue.V.is_included v1 v2 in let decide_fast s t = if s == t || is_empty t (*all bases present in s but not in t are implicitly bound to Top in t, hence the inclusion holds *) then PTrue else PUnknown in binary_predicate cache UniversalPredicate ~decide_fast ~decide_fst ~decide_snd ~decide_both end (* A MC contains, for interesting variables, the coefficient that is associated to one lambda, represented as an integer interval. Missing coefficients are 0. This is useful for variables that are not incremented in one inner, but only in outemost one. *) module MC = struct include Hptmap.Make(Base)(Bounds)(Hptmap.Comp_unused) (struct let v = [] end) (struct let l = [Ast.self] end) (* This function computes a pointwise union on two MCs assumed to have disjoint set of keys. *) let merge_disjoint = let cache = cache_name "MC.merge_disjoint" in let decide _ _ _ = assert false in join ~cache ~symmetric:true ~idempotent:false ~decide (* For the "standard" join and widen, keys present in one map but not in the other are assumed to be 0. *) let default = function None -> Bounds.zero | Some b -> b let widen = let cache = cache_name "MC.widen" in let decide _ b1 b2 = Bounds.widen (default b1) (default b2) in generic_join ~cache ~symmetric:false ~idempotent:true ~decide let join = let cache = cache_name "MC.join" in let decide _ b1 b2 = Bounds.join (default b1) (default b2) in generic_join ~cache ~symmetric:true ~idempotent:true ~decide let is_included = let cache = cache_name "MC.is_included" in let decide_fst _b v1 = Bounds.(equal zero v1) in let decide_snd _b v2 = Bounds.(is_included zero v2) in let decide_both _ v1 v2 = Bounds.is_included v1 v2 in let decide_fast s t = if s == t then PTrue else PUnknown in binary_predicate cache UniversalPredicate ~decide_fast ~decide_fst ~decide_snd ~decide_both end (* This function computes how much the bounds of [v2] have increased from those of [v1]. On pointers, we return a result in bytes, and only if the two variables point to the same base (invariant 2.1) *) let delta_min_max_cvalue v1 v2 = try let b1, i1 = Cvalue.V.find_lonely_key v1 in let b2, i2 = Cvalue.V.find_lonely_key v2 in if Base.equal b1 b2 then Some (Bounds.delta (Ival.min_and_max i1) (Ival.min_and_max i2)) else None with Not_found -> assert false (* invariant 2.1 of MV must already hold *) (* This function takes two mv, and 'subtracts' them for the [inc] operation of gauges. More precisely, for each base present in both maps, we subtract pointwise the min and max or their possible values. This is used to compute the 'difference' during one loop iteration. *) let delta_mv = let cache = cache_name "delta_mv" in let empty = MC.empty in let empty_left _ = empty in let empty_right _ = empty in let both b v1 v2 = match delta_min_max_cvalue v1 v2 with | None -> MC.empty (* drop the base from the result *) | Some i -> MC.singleton b i in let join = MC.merge_disjoint in let f = MV.fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty in fun mv1 mv2 -> f mv1 (MV.shape mv2) (* compute pointwise [mv - mc] *) let mv_minus_mc = let cache = cache_name "mv_minus_mc" in let empty = MV.empty in let empty_left _ = empty in let empty_right v = v in let both b v i = let bv, iv = try Cvalue.V.find_lonely_key v with Not_found -> assert false (* invariant 2.1 of MV *) in let i'_min, i'_max = Bounds.delta i (Ival.min_and_max iv) in let i' = Ival.inject_range i'_min i'_max in let v' = Cvalue.V.inject bv i' in MV.singleton b v' in let join = MV.merge_disjoint in let f = MV.fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty in fun mv mc -> f mv (MC.shape mc) (* Implementation of the 'forget' operation. [nb] loop iterations have elapsed, and during one iteration, variables are incremented by [coeffs]. Add [nb * coeffs] to [mv]. *) let forget nb mv mc = let cache = Hptmap_sig.NoCache in let empty = MV.empty in (* mv empty means that the variable is not tracked *) let empty_left _ = empty in (* mc empty means that the coefficient for the variable is 0. Return the [mv] component unchanged. *) let empty_right left = left in let both b v i = let p = Cvalue.V.inject_ival (Bounds.to_ival (Bounds.mul nb i)) in let v' = Cvalue.V.add_untyped ~factor:Int_Base.one v p in MV.singleton b v' in let join = MV.merge_disjoint in MV.fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty mv (MC.shape mc) type multiple_iterations = { nb: Bounds.t; coeffs: MC. t} module MultipleIterations = struct let compare i1 i2 = let c = Bounds.compare i1.nb i2.nb in if c = 0 then MC.compare i1.coeffs i2.coeffs else c let _equal i1 i2 = Bounds.equal i1.nb i2.nb && MC.equal i1.coeffs i2.coeffs let hash i = Bounds.hash i.nb + 17 * MC.hash i.coeffs let structural_descr = Structural_descr.t_record [| Bounds.packed_descr; MC.packed_descr|] let succ i = { i with nb = Bounds.succ i.nb } let join i1 i2 = { nb = Bounds.join i1.nb i2.nb; coeffs = MC.join i1.coeffs i2.coeffs } (* Widen [i1] and [i2]. The number of iterations is widened only if [widen_nb] holds. *) let widen _stmt ~widen_nb i1 i2 = let nb = if widen_nb then let threshold = None (* LoopAnalysis.Loop_analysis.get_bounds _stmt *) in (* TODO: since we cannot easily use LoopAnalysis here, we should instead: - collect the conditionals that exit the loop, as done for syntactic hints, if possible in a structured way (i.e. base + interval for which we exit the loop) - invert this interval using the gauges domain, to deduce the number of iterations from which we exit - use the max of those values as threshold. *) let threshold = Extlib.opt_map Integer.of_int threshold in let (min, max as w) = Bounds.widen ?threshold i1.nb i2.nb in (* Limit min bound to 0 *) if min = None then (Some Integer.zero, max) else w else Bounds.join i1.nb i2.nb in { nb; coeffs = MC.widen i1.coeffs i2.coeffs } (* Keep only the variables of [mi.coeffs] already present in [mv]. *) let restrict mv mi = { mi with coeffs = MC.inter_with_shape (MV.shape mv) mi.coeffs } end type iteration_info = PreciseIteration of int | MultipleIterations of multiple_iterations module IterationInfo = struct include Datatype.Make(struct type t = iteration_info let name = "Value.Gauges.IterationInfo" let reprs = [PreciseIteration 0] include Datatype.Serializable_undefined let compare ii1 ii2 = match ii1, ii2 with | PreciseIteration i1, PreciseIteration i2 -> Transitioning.Stdlib.compare i1 i2 | MultipleIterations i1, MultipleIterations i2 -> MultipleIterations.compare i1 i2 | PreciseIteration _, MultipleIterations _ -> -1 | MultipleIterations _, PreciseIteration _ -> 1 let hash = function | PreciseIteration i -> i | MultipleIterations i -> MultipleIterations.hash i let equal = Datatype.from_compare let structural_descr = Structural_descr.t_sum [| [| Datatype.Int.packed_descr|]; [| Structural_descr.pack MultipleIterations.structural_descr |] |] end) let is_included i1 i2 = match i1, i2 with | PreciseIteration _, MultipleIterations _ | MultipleIterations _, PreciseIteration _ -> false | PreciseIteration i1, PreciseIteration i2 -> i1 = i2 | MultipleIterations m1, MultipleIterations m2 -> Bounds.is_included m1.nb m2.nb && MC.is_included m1.coeffs m2.coeffs let restrict mv = function | PreciseIteration _ as pi -> pi | MultipleIterations mi -> MultipleIterations (MultipleIterations.restrict mv mi) end (* type t = MV.t * (stmt * iteration_info) list *) include Datatype.Pair_with_collections (MV) (Datatype.List(Datatype.Pair(Cil_datatype.Stmt)(IterationInfo))) (struct let module_name = "Values.Gauges_domain.G" end) let empty = MV.empty, [] let top (state: t) : t = let top_iteration_info = function | PreciseIteration _ as p -> p | MultipleIterations m -> MultipleIterations { m with coeffs = MC.empty } in MV.empty, List.map (fun (s, ii) -> (s, top_iteration_info ii)) (snd state) let pretty_iteration_info fmt = function | PreciseIteration i -> Format.fprintf fmt "%s(%d)" "λ" i | MultipleIterations i -> Format.fprintf fmt "@[<v>@<1>%s(%a)@ @[%a@]@]" "λ" Bounds.pretty i.nb MC.pretty i.coeffs let pretty_loop_step fmt (stmt, ii) = Format.fprintf fmt "s%d: %a" stmt.sid pretty_iteration_info ii let pretty_loop_info = Pretty_utils.pp_list ~pre:"@[<v>" ~suf:"@]" ~sep:"@ " pretty_loop_step let pretty fmt (ct, l: t) = Format.fprintf fmt "@[<v>@[V: [%a]@]@ @[%a@]@]" MV.pretty ct pretty_loop_info l (* Abstract operation when returning at the start of a loop. Increment the counter for this loop, or correct the constants if the loop coefficients have already been found. *) let inc (s:t) : t = match s with | _, [] -> assert false | ct, ((stmt, i) :: q) -> match i with | PreciseIteration i -> (* Just increase the number of iterations *) ct, (stmt, PreciseIteration (i+1)) :: q | MultipleIterations i -> (* Correct the constant part w.r.t the coefficients *) let ct' = mv_minus_mc ct i.coeffs in let i' = MultipleIterations.succ i in ct', (stmt, MultipleIterations i') :: q (* We have determined that [coeffs] is going to be used for [ct], and [l] iterations have occurred. Remove [coeffs] [l] times. *) let remove_coeffs coeffs l ct = let rec aux l ct = if l = 0 then ct else aux (l-1) (mv_minus_mc ct coeffs) in aux l ct (* Remove from the coefficient maps the variables for which we have no initial value, for canonicity purposes. This occurs for example when a pointer points to multiple variables through multiple iterations. *) let restrict mv l = List.map (fun (s, mi) -> s, IterationInfo.restrict mv mi) l (* [l] is the number iteration in [s1], while it is [l+1] in [s2]. Compute a slope, then remove [l] and [l+1] iterations from [ct1] and [ct2] accordingly. *) let join_consecutive_lambda l ct1 ct2 = let coeffs = delta_mv ct1 ct2 in coeffs, remove_coeffs coeffs l ct1, remove_coeffs coeffs (l+1) ct2 (* join pointwise values. keys not present in one of the maps are dropped. *) let join_same_lambda = let cache = cache_name "join_same_lambda" in let decide _ v1 v2 = (* Forbid multiple pointers in the result *) try let b1, _i1 = Cvalue.V.find_lonely_key v1 in let b2, _i2 = Cvalue.V.find_lonely_key v2 in if Base.equal b1 b2 then Some (Cvalue.V.join v1 v2) else None with Not_found -> assert false (* invariant 2.1 of MV must already hold *) in MV.inter ~cache ~symmetric:true ~idempotent:true ~decide exception MessyJoin (* This function equalizes recursively the number of iterations in all the loops of [s1/s2]. When different precise number of iterations are merged, coefficients are computed. Returns the initial values for [s1] and [s2], the (common) join for the number of iterations, and a boolean indicating that at least one precise number of iterations has been generalized into multiple iterations. *) let rec join_iterations (s1: t) (s2: t) = match s1, s2 with | (_, []), (_, _ :: _) | (_, _ :: _) , (_, []) -> raise MessyJoin (* should always be in the same number of loops *) | (ct1, []), (ct2, []) -> (** out of any loop *) ct1, ct2, [], false | (ct1, (stmt1, nb1) :: q1), (ct2, (stmt2, nb2) :: q2) -> if not (stmt1 == stmt2) then raise MessyJoin; let ct1, ct2, q, joined_iter = join_iterations (ct1, q1) (ct2, q2) in match nb1, nb2 with | MultipleIterations i1, MultipleIterations i2 -> (** Coefficients have already been found. Just merge the number of iterations. *) let i = MultipleIterations (MultipleIterations.join i1 i2) in ct1, ct2, (stmt1, i) :: q, joined_iter | PreciseIteration n1, PreciseIteration n2 -> (** Two exact number of iterations. If equal, do nothing. If not, infer coefficients, or go to top. *) let nb = Bounds.inject_range n1 n2 in let (ct1, ct2), nb, joined_iter = match n1 - n2 with | 0 -> (** Same number of iterations *) (ct1, ct2), PreciseIteration n1, false | 1 -> (** One more iteration in s1 *) let coeffs, ct1, ct2 = join_consecutive_lambda n2 ct2 ct1 in (ct1, ct2), MultipleIterations { nb; coeffs }, true | -1 -> (** One more iteration in s2 *) let coeffs, ct1, ct2 = join_consecutive_lambda n1 ct1 ct2 in (ct1, ct2), MultipleIterations { nb; coeffs }, true | _ -> (** difference > 1. This case does not happen with the current iteration engine, and requires a division function in module Bounds. Go to top *) (MV.empty, MV.empty), MultipleIterations { nb; coeffs = MC.empty }, true in ct1, ct2, (stmt1, nb) :: q, joined_iter | PreciseIteration i1, MultipleIterations m2 -> (** Normalizes the initial values [ct1] according to the coefficients computed in [m2] *) let ct1 = remove_coeffs m2.coeffs i1 ct1 in let nb = Bounds.enlarge (Integer.of_int i1) m2.nb in let ii = MultipleIterations { m2 with nb } in ct1, ct2, (stmt1, ii) :: q, true | MultipleIterations m1, PreciseIteration i2 -> let ct2 = remove_coeffs m1.coeffs i2 ct2 in let nb = Bounds.enlarge (Integer.of_int i2) m1.nb in let ii = MultipleIterations { m1 with nb } in ct1, ct2, (stmt1, ii) :: q, true (* full join: join the number of iterations, then join the initial values *) let join (s1: t) (s2: t) : t = try let ct1, ct2, q, _ = join_iterations s1 s2 in let ct = join_same_lambda ct1 ct2 in let q = restrict ct q in let r = (ct, q) in (* Kernel.result ~current:true "JOIN@.%a@.@.%a@.R@.%a" pretty s1 pretty s2 pretty r; *) r with MessyJoin -> empty let is_included (ct1, l1: t) (ct2, l2: t) = MV.is_included ct1 ct2 && List.for_all2 (fun (_, i1) (_, i2) -> IterationInfo.is_included i1 i2) l1 l2 (* debug version *) let _is_included s1 s2 = let r = is_included s1 s2 in Kernel.result ~current:true "INCL %b@.%a@.@.%a" r pretty s1 pretty s2; r (* hypothesis from Value: s2 is supposed to happen 'after' s1. This widening function is full of heuristics to maintain some precision, i.e. do not widen everything to Top immediately. Basically: - when coefficients have not yet been found in [s1], do not widen values. (Because they have incompatible shape. We can have <(l=4) x=8> in s1 and <l=[0..4], x=0+2l>, and it would be almost meaningless to widen 8 and [0]. - widen the number of iterations only for the current loop - widen coefficients only if values have not been widened. *) let widen _kf stmt (_ct1, l1 as s1: t) (_ct2, _l2 as s2: t): t = (* We first perform a join, which will generalize the coefficients *) let ct1, ct2, lj, joined_iter = join_iterations s1 s2 in let ctj = join_same_lambda ct1 ct2 in let stmt_is_in_state = List.exists (fun (s', _) -> stmt == s') lj in (* Now we widen the bounds unstable between s1 and the join. We do so only if the coefficients are compatible enough, meaning that no precise iterations were generalized. This is to regain some precision, but may theoretically endanger termination. *) let ct = if joined_iter then ctj else MV.widen ct1 ctj in let rec widen_l l1 lj = match l1, lj with | [], [] -> [] | [], _ | _, [] -> assert false | (stmt', i1) :: q1, (stmt'', ij) :: qj -> assert (stmt' == stmt''); let i = match i1, ij with | MultipleIterations _, PreciseIteration _ -> assert false | PreciseIteration _, PreciseIteration _ -> ij | PreciseIteration _, MultipleIterations _ -> ij (* do nothing in this case, the real widening will occur in later iterations *) | MultipleIterations i1, MultipleIterations ij -> (* Only widen the loop counter if we are widening this loop. We make an exception when [stmt] appears nowhere in the list of loops, meaning that we are widening somewhere in a non-natural loop. *) let widen_nb = stmt == stmt' || not stmt_is_in_state in MultipleIterations (MultipleIterations.widen stmt ~widen_nb i1 ij) in if IterationInfo.equal i ij then (stmt', i) :: widen_l q1 qj (* find something to widen deeper *) else (stmt', i) :: qj in (* Widen list if coefficients have not been widened only. This may help precision, and should not endanger convergence. *) let l = if MV.equal ctj ct2 then widen_l l1 lj else lj in let l = restrict ct l in ct, l let narrow x _y = `Value x let enter_loop stmt (ct, l: t) : t = ct, (stmt, PreciseIteration 0) :: l let leave_loop stmt (ct, l:t) : t = match l with | [] -> assert false | (stmt', ii) :: q -> assert (stmt == stmt'); match ii with | PreciseIteration _ -> (* the domain has not inferred anything yet *) (ct, q) | MultipleIterations mi -> (* increment [ct] by [mi.nb] iterations *) let ct' = forget mi.nb ct mi.coeffs in ct', q (* This function returns [true] if [vi] _may_ be tracked. Variables for which we return [false] will never be part of a state. *) let tracked_variable vi = Cil.isIntegralOrPointerType vi.vtype && (match function_calls_handling with | FullInterprocedural -> true | IntraproceduralAll -> not vi.vglob | IntraproceduralNonReferenced -> not vi.vglob && not vi.vaddrof ) && not (Cil.typeHasQualifier "volatile" vi.vtype) let kill_base b (ct, l as state: t): t = let aux = function | (_, PreciseIteration _ as i) -> i | (s, MultipleIterations m) -> (s, MultipleIterations { m with coeffs = MC.remove b m.coeffs }) in (* Synchronize this function with in_memory_variable *) match b with | Base.Var (vi, _) when tracked_variable vi -> MV.remove b ct, List.map aux l | _ -> state exception Untranslatable module Gauge = struct type t = Cvalue.V.t * Bounds.t list let pretty fmt (v, l: t) = Format.fprintf fmt "@[(%a,@ %a)@]" Cvalue.V.pretty v (Pretty_utils.pp_list ~pre:"" ~suf:"" ~sep:",@ " Bounds.pretty) l let _ = pretty (* silence warning *) (* assumes that [f x 0] = x *) let rec map2 f l1 l2 = match l1, l2 with | [], l | l, [] -> l (* all other coefficients are implicitly 0 *) | b1 :: l1, b2 :: l2 -> f b1 b2 :: map2 f l1 l2 let on_cvalue_ival f v = try let v = Cvalue.V.project_ival v in Cvalue.V.inject_ival (f v) with Cvalue.V.Not_based_on_null -> raise Untranslatable let neg (ct, l: t) : t = on_cvalue_ival Ival.neg_int ct, List.map Bounds.neg l let mul_ct k (ct, l: t) : t = on_cvalue_ival (Ival.mul (Ival.inject_singleton k)) ct, List.map (Bounds.mul_ct k) l (* Try to find a multiplication by a constant, or give up *) let mul (ct1, l1 as g1 : t) (ct2, l2 as g2: t) = try match l1 with | [] -> let k = Ival.project_int (Cvalue.V.project_ival ct1) in mul_ct k g2 | _ -> match l2 with | [] -> let k = Ival.project_int (Cvalue.V.project_ival ct2) in mul_ct k g1 | _ -> raise Untranslatable with Cvalue.V.Not_based_on_null | Ival.Not_Singleton_Int -> raise Untranslatable (* Check that [v] is an integer, or a single pointer (invariant 2 of MV). Pointers to a single base with variable validity are also ruled out, as the base may become weak, making the pointer imprecise and thus breaking invariant 2.1. *) let sanitize_v v = try let b, i = Cvalue.V.find_lonely_key v in let validity = Base.validity b in match validity, i with | Base.Variable _, _ | _, Ival.Float _ -> raise Untranslatable | _, _ -> () with Not_found -> raise Untranslatable let add (ct1, l1: t) (ct2, l2: t) : t = let ct = Cvalue.V.add_untyped ~factor:Int_Base.one ct1 ct2 in let l = map2 Bounds.add l1 l2 in sanitize_v ct; ct, l let sub g1 g2 = add g1 (neg g2) let ct x : t = sanitize_v x; (x, []) end (* Extract from [ct, l] the gauge corresponding to the variable [b]. The gauge contains one coefficient per loop in the state. *) let extract_gauge (ct, l: t) b : Gauge.t option = try let ctb = MV.find b ct in let rec aux = function | [] -> [] | (_, i) :: q -> let coeff = match i with | PreciseIteration _ -> Bounds.zero (* information is stored in [ctb] *) | MultipleIterations m -> try MC.find b m.coeffs with Not_found -> Bounds.zero in coeff :: aux q in Some (ctb, aux l) with Not_found -> None (* Evaluation of a gauge in a given state. The state is only used to find the current values for the loop counters. *) let eval_gauge (_ct, l: t) (ctg, lg: Gauge.t) = let rec aux l lg = match l, lg with | [], _ :: _ -> assert false | _, [] -> Bounds.zero | (_, PreciseIteration _) :: q, coeff :: qg -> assert (Bounds.equal coeff Bounds.zero); aux q qg | (_, MultipleIterations m) :: q, coeff :: qg -> (* [shift_b] is the amount [b] is incremented by the current loop *) let shift_b = Bounds.mul coeff m.nb in Bounds.add shift_b (aux q qg) in let shift = Cvalue.V.inject_ival (Bounds.to_ival (aux l lg)) in Cvalue.V.add_untyped ctg ~factor:Int_Base.one shift (* Assuming [b] has value [v], backward-propagate this information to the number of iterations in [t]. Reduce [None] if no reduction occurred. *) let backward_loop (ct, l: t) b v : t or_bottom option = (* This function gather the non-zero coefficients for [b], together with the number of iterations of the relevant loops. *) let rec gather = function | [] -> [] | (_, PreciseIteration _) :: q -> gather q (* for this loop, the information is still stored in [ct] *) | (stmt, MultipleIterations m) :: q -> try let c = MC.find b m.coeffs in if Bounds.equal c Bounds.zero then raise Not_found; (stmt, c, m.nb) :: gather q with Not_found -> (* not bound is equivalent to a coefficient of 0. Hence this loop does not modify [b] *) gather q in let rec replace stmt nb = function | [] -> assert false | (_, PreciseIteration _ as h) :: q -> h :: replace stmt nb q | (stmt', MultipleIterations m as h) :: q -> if stmt == stmt' then (stmt, MultipleIterations { m with nb }) :: q else h :: replace stmt nb q in try let ctb = MV.find b ct in (* compatibility between the bases should be ensured by the Cvalue domain, that will only allow values compatible with [b] *) let d = Cvalue.V.sub_pointwise v ctb in match gather l with | [] -> None | _ :: _ :: _ -> None (* TODO: linearize and solve *) | [(stmt, c, nb)] -> match Bounds.backward_nb ~b:c ~r:d with | `Bottom -> Some `Bottom | `Value n_iter -> match Bounds.narrow n_iter nb with | `Bottom -> Some `Bottom | `Value n_iter -> if not (Bounds.equal nb n_iter) then let l' = replace stmt n_iter l in Some (`Value (ct, l')) else None with Not_found -> None (* Convert a location into a supported variable, i.e. scalar. The location must assign the entire variable. Also check that the type of the variable fits [typ] *) let loc_to_base loc typ = try let locb = loc.Locations.loc in (* Single pointer *) let b, o = Locations.Location_Bits.find_lonely_binding locb in match b with | Base.Var (vi, Base.Known (_, max)) -> (* "standard" varinfos only *) if tracked_variable vi && Cil_datatype.Typ.equal typ vi.vtype && Ival.is_zero o && (match loc.Locations.size with | Int_Base.Value size -> Integer.equal size (Integer.succ max) | Int_Base.Top -> false) then b else raise Untranslatable | _ -> raise Untranslatable with Not_found -> raise Untranslatable let gauge_from_state b (ct, l: t) : Gauge.t = try let ct = MV.find b ct in let rec aux = function | [] -> [] | (_, iteration) :: q -> try match iteration with | PreciseIteration _ -> Bounds.zero :: aux q | MultipleIterations m -> MC.find b m.coeffs :: aux q with Not_found -> [] in ct, aux l with Not_found -> raise Untranslatable let translate_exp state to_loc to_v e = let ptr_size e = let typ_pointed = Cil.typeOf_pointed (Cil.typeOf e) in try Integer.of_int (Cil.bytesSizeOf typ_pointed) with Cil.SizeOfError _ -> raise Untranslatable in (* This function translates the expression as a precise gauge. For any expression that cannot be handled, [Untranslatable] is raised. *) let rec aux_gauge e = match e.enode with | Const _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ | AddrOf _ | StartOf _ -> raise Untranslatable (* constant: using linearization directly *) | CastE (typ_dst ,e) -> fits_in_type ~is_cast:true typ_dst (aux e) | Lval lv -> let b = loc_to_base (to_loc lv) (Cil.typeOfLval lv) in gauge_from_state b state | UnOp (Neg , e, _) -> fits_in_type (Cil.typeOf e) (Gauge.neg (aux e)) | UnOp ((BNot | LNot) ,_,_) -> raise Untranslatable | BinOp (op, e1, e2, _) -> aux_binop (Cil.typeOf e) op e1 e2 | Info _ -> assert false and aux_binop typ_res op e1 e2 = let g = match op with | PlusA -> Gauge.add (aux e1) (aux e2) | Mult -> Gauge.mul (aux e1) (aux e2) | MinusA -> Gauge.sub (aux e1) (aux e2) | PlusPI | IndexPI -> Gauge.add (aux e1) (Gauge.mul_ct (ptr_size e1) (aux e2)) | MinusPI -> Gauge.add (aux e1) (Gauge.neg (Gauge.mul_ct (ptr_size e1) (aux e2))) | Mod | Lt | Gt | Le | Ge | Eq | Ne | BAnd | BXor | BOr | LAnd | LOr | MinusPP | Shiftlt | Shiftrt | Div -> raise Untranslatable in fits_in_type typ_res g (* This function also translates an expression as a gauge, but it also performs an on-the-fly linearization if the precise translation fails. Notice that this function may still raise [Untranslatable], in case the collaboratively computed value cannot be represented (floating-point, multiple pointers.). *) and aux e = try aux_gauge e with Untranslatable -> Gauge.ct (to_v e) (* Returns [g] if its evaluation fits into [typ], or raise [Untranslatable]. If [is_cast] is false, assumes the operation is not a cast, in which case overflows that raise alarms are not considered as overflowing. *) and fits_in_type ?(is_cast=false) typ g = let open Eval_typ in match classify_as_scalar typ with | None | Some (TSFloat _) -> raise Untranslatable | Some (TSInt ir | TSPtr ir) -> if not is_cast && ((ir.i_signed && Kernel.SignedOverflow.get ()) || (not ir.i_signed && Kernel.UnsignedOverflow.get ())) then g (* Overflows are checked for this operation *) else let v = eval_gauge state g in try let b, i = Cvalue.V.find_lonely_key v in if Base.equal Base.null b then let min = range_lower_bound ir in let max = range_upper_bound ir in let range = Ival.inject_range (Some min) (Some max) in if Ival.is_included i range then g else raise Untranslatable else g (* we consider pointers offsets never overflow *) with Not_found -> assert false (* invariant 2.1 of MV *) in aux e (* Store the gauge [g] for [b] in [state]. Recursively update the different maps until [g] is empty, then set all coefficients to 0. *) let store_gauge b (g: Gauge.t) (state: t): t = let (ct, l) = state in let (ctg, lg) = g in let rec aux l lg = match l, lg with | [], [] -> [] | [], _ :: _ -> assert false (* impossible by construction *) | _, [] -> (* TODO: once 0 is not stored anymore in coeffs, just remove the key from the map. *) aux l [Bounds.zero] | (stmt, i) :: ql, cb :: qlg -> match i with | PreciseIteration _ -> assert (Bounds.equal cb Bounds.zero); (stmt, i) :: aux ql qlg | MultipleIterations m -> let coeffs = MC.add b cb m.coeffs in (stmt, MultipleIterations {m with coeffs}) :: aux ql qlg in let ct' = MV.add b ctg ct in let l' = aux l lg in (ct', l') let assign to_loc to_v lv e state = let loc = to_loc lv in try let b = loc_to_base loc (Cil.typeOfLval lv) in let g = translate_exp state to_loc to_v e in store_gauge b g state with Untranslatable -> try Locations.Location_Bits.fold_topset_ok (fun b _ state -> kill_base b state) loc.Locations.loc state with Abstract_interp.Error_Top -> top state end let dkey = Value_parameters.register_category "d-gauges" module D_Impl : Abstract_domain.S with type state = G.t and type value = Cvalue.V.t and type location = Precise_locs.precise_location = struct type value = Cvalue.V.t type state = G.t type location = Precise_locs.precise_location include G let name = "Gauges domain" let log_category = dkey let empty _ = G.empty let pretty = G.pretty let enter_scope _kf _vars state = state (* default is Top, nothing to do *) let remove_variables vars (state:state) = let remove_variable state v = G.kill_base (Base.of_varinfo v) state in List.fold_left remove_variable state vars let leave_scope _kf vars state = (* reverts implicitly to Top *) remove_variables vars state type origin = unit let kill loc state = let loc = Precise_locs.imprecise_location loc in let loc = loc.Locations.loc in let aux_base b _ acc = try Base.to_varinfo b :: acc with Base.Not_a_C_variable (* NULL *) -> acc in let vars = Locations.Location_Bits.fold_topset_ok aux_base loc [] in remove_variables vars state module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = origin and type loc = location) : Abstract_domain.Transfer with type state := state and type value := value and type location := location and type valuation := Valuation.t = struct let assume_exp valuation e r state = if r.reductness = Created || r.reductness = Reduced then match e.enode with | Lval lv -> begin match Valuation.find_loc valuation lv with | `Top -> `Value state | `Value {loc} -> let loc = Precise_locs.imprecise_location loc in try let b = loc_to_base loc (Cil.typeOfLval lv) in match r.value.v with | `Bottom -> `Value state | `Value v -> match backward_loop state b v with | Some `Bottom -> `Bottom | Some (`Value _ as s) -> s | None -> `Value state with Untranslatable -> `Value state end | _ -> `Value state else `Value state let assume_exp_bot valuation e r state = state >>- assume_exp valuation e r let update valuation state = let assume_one = assume_exp_bot valuation in Valuation.fold assume_one valuation (`Value state) let assume _ _ _ = update exception Unassignable let assign _kinstr lv e _assignment valuation (state:state) = update valuation state >>- fun state -> let to_loc lv = match Valuation.find_loc valuation lv with | `Value r -> Precise_locs.imprecise_location r.loc | `Top -> raise Unassignable in let to_val e = match Valuation.find valuation e with | `Top -> raise Unassignable | `Value v -> match v.value.initialized, v.value.escaping, v.value.v with | true, false, `Value v -> v | _ -> raise Unassignable in try `Value (G.assign to_loc to_val lv.lval e state) with Unassignable -> `Value (kill lv.lloc state) let finalize_call _stmt _call ~pre ~post = let state = match function_calls_handling with | FullInterprocedural -> post | IntraproceduralNonReferenced -> pre | IntraproceduralAll -> pre (* unsound here *) in `Value state let start_call _stmt call valuation state = let state = match function_calls_handling with | FullInterprocedural -> update valuation state | IntraproceduralAll | IntraproceduralNonReferenced -> `Value G.empty in state >>- fun state -> (* track [arg.formal] into [state]. Important for functions that receive a size as argument. *) let aux_arg state arg = try let vi = arg.formal in if not (tracked_variable vi) then raise Untranslatable; let b = Base.of_varinfo vi in let v = match arg.avalue with | Assign v -> v | Copy (_, v) -> match v.initialized, v.escaping, v.v with | true, false, `Value v -> v | _ -> raise Untranslatable in let g = Gauge.ct v in store_gauge b g state with Untranslatable -> state in let state = List.fold_left aux_arg state call.arguments in `Value state let show_expr _valuation _state _fmt _expr = () end let enter_loop = G.enter_loop let incr_loop_counter _ = G.inc let leave_loop = G.leave_loop (* TODO: it would be interesting to return something here, but we currently need a valuation to perform the translation. *) let extract_expr _oracle _state _exp = `Value (Cvalue.V.top, ()), Alarmset.all let extract_lval _oracle state _lv typ loc = let v = try let b = loc_to_base (Precise_locs.imprecise_location loc) typ in match extract_gauge state b with | Some g -> eval_gauge state g | None -> Cvalue.V.top with Untranslatable -> Cvalue.V.top in (* We can probably return an empty set of alarms when the value is known, but the only possible alarms on lvalues are about indeterminateness, and it is not clear that we know more than the Cvalue domain. *) `Value (v, ()), Alarmset.all let backward_location _state _lval _typ loc value = `Value (loc, value) let reduce_further _state _expr _value = [] (* Memexec *) let relate _kf _bases _state = match function_calls_handling with | FullInterprocedural -> Base.SetLattice.top | IntraproceduralAll | IntraproceduralNonReferenced -> Base.SetLattice.empty let filter _kf _kind _bases state = state let reuse _kf _bases ~current_input:_ ~previous_output = previous_output (* Initial state *) let introduce_globals _ state = state let initialize_variable_using_type _ _ state = state let initialize_variable _ _ ~initialized:_ _ state = state (* Logic *) let logic_assign _assigns location ~pre:_ state = kill location state let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ state _ _ = `Value state let top = G.empty (* must not be used, not neutral w.r.t. join (because join crashes...)!! *) end module D = Domain_builder.Complete (struct include D_Impl let storage = Value_parameters.GaugesStorage.get end) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/gauges/gauges_domain.mli�����������������������������0000666�0000000�0000000�00000003502�13571573400�023011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Gauges domain ("Arnaud Venet: The Gauge Domain: Scalable Analysis of Linear Inequality Invariants. CAV 2012") *) module D: Abstract_domain.Leaf with type value = Cvalue.V.t and type location = Precise_locs.precise_location ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/hcexprs.ml�������������������������������������������0000666�0000000�0000000�00000017303�13571573400�020243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Exp = Cil_datatype.ExpStructEq module Lval = Cil_datatype.LvalStructEq (* lvalues are never stored under a constructor [E]. *) type unhashconsed_exprs = E of Exp.t | LV of Lval.t (* The replacement of an lvalue by another term in an expression fails (raises an exception) if the height of the resulting expression exceeds this limit. *) let height_limit = 8 exception NonExchangeable type kill_type = Modified | Deleted module E = struct include Datatype.Make (struct include Datatype.Serializable_undefined type t = unhashconsed_exprs let name = "Value.Symbolic_exprs.key" let reprs = [ E Cil_datatype.Exp.dummy ] let structural_descr = Structural_descr.t_sum [| [| Exp.packed_descr |] ; [| Lval.packed_descr |] ; |] let equal a b = match a, b with | E e1, E e2 -> Exp.equal e1 e2 | LV lv1, LV lv2 -> Lval.equal lv1 lv2 | (E _ | LV _), _ -> false let compare a b = match a, b with | E e1, E e2 -> Exp.compare e1 e2 | LV lv1, LV lv2 -> Lval.compare lv1 lv2 | LV _, E _ -> -1 | E _, LV _ -> 1 let pretty fmt = function | E e -> Format.fprintf fmt "%a" Exp.pretty e | LV lv -> Format.fprintf fmt "%a" Lval.pretty lv let hash = function | E e -> Exp.hash e | LV lv -> Lval.hash lv let copy c = c end) let replace_visitor kind ~late ~heir = object inherit Visitor.frama_c_copy (Project.current ()) method! vexpr expr = match expr.enode with | Lval lval -> if Lval.equal lval late then Cil.ChangeTo heir else Cil.JustCopy | StartOf lval | AddrOf lval -> if kind = Modified then Cil.JustCopy else if Lval.equal lval late then raise NonExchangeable else Cil.JustCopy | AlignOfE _ -> raise NonExchangeable | _ -> Cil.DoChildren end let replace kind ~late ~heir expr = let visitor = replace_visitor kind ~late ~heir in Visitor.visitFramacExpr visitor expr end module HCE = struct module S = State_builder.Hashcons(E) (struct let dependencies = [Ast.self] let name = "" let initial_values = [] end) include S let pretty_debug = pretty let of_lval lv = hashcons (LV lv) let of_exp exp = match exp.enode with | Lval lv -> of_lval lv | _ -> hashcons (E exp) let to_exp h = match get h with | E e -> e | LV lv -> Value_util.lval_to_exp lv let to_lval h = match get h with | E _ -> None | LV lv -> Some lv let is_lval h = match get h with | E _ -> false | LV _ -> true let replace kind ~late ~heir h = match get h with | E e -> let e = E.replace kind ~late ~heir e in if Value_util.height_expr e > height_limit then raise NonExchangeable else of_exp e | LV lval -> if Lval.equal lval late then of_exp heir else h end module HCESet = Hptset.Make (HCE) (struct let v = [] end) (struct let l = [Ast.self] end) type lvalues = { read : HCESet.t; addr : HCESet.t; } let empty_lvalues = { read = HCESet.empty; addr = HCESet.empty; } let syntactic_lvalues expr = let rec gather expr lvalues = match expr.enode with | Lval lv -> { lvalues with read = HCESet.add (HCE.of_lval lv) lvalues.read } | AddrOf lv | StartOf lv -> { lvalues with addr = HCESet.add (HCE.of_lval lv) lvalues.addr } | AlignOfE e | SizeOfE e -> (* The lvalues appearing in [e] are not read, and must all be in addr. *) let new_lvalues = gather e empty_lvalues in let new_addr = HCESet.union new_lvalues.read new_lvalues.addr in { lvalues with addr = HCESet.union new_addr lvalues.addr } | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> gather e lvalues | BinOp (_, e1, e2, _) -> gather e1 (gather e2 lvalues) | _ -> lvalues in gather expr empty_lvalues module HCEToZone = struct let cache_prefix = "Value.Symbolic_exprs.K2Z" include Hptmap.Make(HCE)(Locations.Zone)(Hptmap.Comp_unused) (struct let v = [] end)(struct let l = [Ast.self] end) let is_included = let cache_name = cache_prefix ^ ".is_included" in let decide_fst _b _v1 = true in let decide_snd _b _v2 = false in let decide_both _ v1 v2 = Locations.Zone.is_included v1 v2 in let decide_fast s t = if s == t then PTrue else PUnknown in binary_predicate (Hptmap_sig.PersistentCache cache_name) UniversalPredicate ~decide_fast ~decide_fst ~decide_snd ~decide_both let inter = let cache_name = cache_prefix ^ ".inter" in let cache = Hptmap_sig.PersistentCache cache_name in let symmetric = true in let idempotent = true in let decide _ v1 v2 = Some (Locations.Zone.join v1 v2) in inter ~cache ~symmetric ~idempotent ~decide let union = let cache_name = cache_prefix ^ ".union" in let cache = Hptmap_sig.PersistentCache cache_name in let symmetric = true in let idempotent = true in let decide _ v1 v2 = Locations.Zone.join v1 v2 in join ~cache ~symmetric ~idempotent ~decide let merge = let cache_name = cache_prefix ^ ".merge" in let cache = Hptmap_sig.PersistentCache cache_name in let decide _ _ v2 = v2 in join ~cache ~symmetric:false ~idempotent:true ~decide let merge ~into v = merge into v end module BaseToHCESet = struct include Hptmap.Make (Base.Base) (HCESet) (Hptmap.Comp_unused) (struct let v = [] end)(struct let l = [Ast.self] end) let cache_prefix = "Value.Symbolic_exprs.B2K" let inter = let cache_name = cache_prefix ^ ".inter" in let cache = Hptmap_sig.PersistentCache cache_name in let symmetric = true in let idempotent = true in let decide _ v1 v2 = let s = HCESet.inter v1 v2 in if HCESet.is_empty s then None else Some s in inter ~cache ~symmetric ~idempotent ~decide let union = let cache_name = cache_prefix ^ ".union" in let cache = Hptmap_sig.PersistentCache cache_name in let symmetric = true in let idempotent = true in let decide _ v1 v2 = HCESet.union v1 v2 in join ~cache ~symmetric ~idempotent ~decide let find_default b m = try find b m with Not_found -> HCESet.empty end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/hcexprs.mli������������������������������������������0000666�0000000�0000000�00000011162�13571573400�020411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Hash-consed expressions and lvalues. *) open Cil_types type unhashconsed_exprs = private E of exp | LV of lval (** lvalues are never stored under a constructor [E], only [LV] *) (** Raised when the replacement of an lvalue in an expression is impossible. *) exception NonExchangeable (** Reason of the replacement of an lvalue [lval]: [Modified] means that the value of [lval] has been modified (in which case &lval is unchanged), and [Deleted] means that [lval] is no longer in scope (in which case &lval raises the NonExchangeable error). *) type kill_type = Modified | Deleted module E: Datatype.S with type t = unhashconsed_exprs (** Datatype + utilities functions for hashconsed exprsessions. *) module HCE: sig include Datatype.S_with_collections val self: State.t val pretty_debug: t Pretty_utils.formatter val id: t -> int (** Conversions between type [t] and Cil lvalues and expressions. *) val of_lval: lval -> t val of_exp: exp -> t val get: t -> unhashconsed_exprs val to_exp: t -> exp val to_lval: t -> lval option val is_lval: t -> bool (** Replaces all occurrences of the lvalue [late] by the expression [heir]. @raise NonExchangeable if the replacement is not feasible. *) val replace: kill_type -> late:lval -> heir:exp -> t -> t end (** Hashconsed sets of symbolic expressions. *) module HCESet: Hptset.S with type elt = HCE.t and type 'a shape = 'a Hptmap.Shape(HCE).t (* Sets of lvalues that appear in an expression. The [addr] field gathers the lvalues [lv] appearing as addresses &lv, while the [read] field gathers the lvalues whose value is read during the evaluation of the expression. *) type lvalues = { read : HCESet.t; addr : HCESet.t; } (* Empty sets of lvalues. *) val empty_lvalues: lvalues (** [syntactic_lvalues e] returns the set of lvalues that appear in the expression [e]. This is used by the equality domain: the expression [e] will be removed from an equality if a lvalue from [syntactic_lvalues e] is removed. This function only computes the first lvalues of the expression, and does not go through the lvalues (for the expression t[i]+1, only the lvalue t[i] is returned). *) val syntactic_lvalues: Cil_types.exp -> lvalues (** Maps from symbolic expressions to their memory dependencies, expressed as a {!Locations.Zone.t}. *) module HCEToZone: sig include Hptmap_sig.S with type key = HCE.t and type v = Locations.Zone.t and type 'a shape = 'a Hptmap.Shape(HCE).t val is_included: t -> t -> bool val union: t -> t -> t val inter: t -> t -> t val merge: into:t -> t -> t end (** Maps froms {!Base.t} to set of {!HCE.t}. *) module BaseToHCESet: sig include Hptmap_sig.S with type key = Base.t and type v = HCESet.t and type 'a shape = 'a Hptmap.Shape(Base.Base).t val union: t -> t -> t val inter: t -> t -> t val find_default: Base.t -> t -> HCESet.t (** returns the empty set when the key is not bound *) end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/inout_domain.ml��������������������������������������0000666�0000000�0000000�00000025737�13571573400�021266� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Locations type inout = { (* over-approximation of the memory locations written by the function *) over_outputs: Zone.t; (* over-approximation of the memory locations read by the function *) over_inputs: Zone.t; (* under-approximation of the memory locations written by the function *) under_outputs: Zone.t; (* over-approximation of the memory locations parts read by the function that are parts of its inputs (i.e. that the function has not written previously) *) operational_inputs: Zone.t; } (* Lattice structure for the abstract state above *) module LatticeInout = struct (* Frama-C "datatype" for type [inout] *) include Datatype.Make_with_collections(struct include Datatype.Serializable_undefined type t = inout let name = "Value.Inout.t" let reprs = [ { over_outputs = List.hd Zone.reprs; over_inputs = List.hd Zone.reprs; under_outputs = List.hd Zone.reprs; operational_inputs = List.hd Zone.reprs; } ] let structural_descr = Structural_descr.t_record [| Zone.packed_descr; Zone.packed_descr; Zone.packed_descr; Zone.packed_descr; |] let compare m1 m2 = let c = Zone.compare m1.over_outputs m2.over_outputs in if c <> 0 then c else let c = Zone.compare m1.over_inputs m2.over_inputs in if c <> 0 then c else let c = Zone.compare m1.under_outputs m2.under_outputs in if c <> 0 then c else Zone.compare m1.operational_inputs m2.operational_inputs let equal = Datatype.from_compare let pretty fmt c = Format.fprintf fmt "@[<v 2>Over outputs:@ @[<hov>%a@]@]@.\ @[<v 2>Over inputs:@ @[<hov>%a@]@]@.\ @[<v 2>Sure outputs:@ @[<hov>%a@]@]@.\ @[<v 2>Operational inputs:@ @[<hov>%a@]@]" Zone.pretty c.over_outputs Zone.pretty c.over_inputs Zone.pretty c.under_outputs Zone.pretty c.operational_inputs let hash m = Hashtbl.hash (Zone.hash m.over_outputs, Zone.hash m.over_inputs, Zone.hash m.under_outputs, Zone.hash m.operational_inputs) let copy c = c end) (* Initial abstract at the beginning of the computation: nothing written or read so far. *) let empty = { over_outputs = Zone.bottom; over_inputs = Zone.bottom; under_outputs = Zone.bottom; operational_inputs = Zone.bottom; } (* Top state: everything read or written, nothing written in a sure way *) let top = { over_outputs = Zone.top; over_inputs = Zone.top; under_outputs = Zone.bottom; operational_inputs = Zone.top; } (* Join: over-approximation are joined, under-approximation are met. *) let join c1 c2 = { over_outputs = Zone.join c1.over_outputs c2.over_outputs; over_inputs = Zone.join c1.over_inputs c2.over_inputs; under_outputs = Zone.meet c1.under_outputs c2.under_outputs; operational_inputs = Zone.join c1.operational_inputs c2.operational_inputs; } (* The memory locations are finite, so the ascending chain property is already verified. We simply use a join. *) let widen _ _ c1 c2 = join c1 c2 let narrow c1 c2 = `Value { over_outputs = Zone.narrow c1.over_outputs c2.over_outputs; over_inputs = Zone.narrow c1.over_inputs c2.over_inputs; under_outputs = Zone.link c1.under_outputs c2.under_outputs; operational_inputs = Zone.narrow c1.operational_inputs c2.operational_inputs; } (* Inclusion testing: pointwise for over-approximations, counter-pointwise for under-approximations *) let is_included c1 c2 = Zone.is_included c1.over_outputs c2.over_outputs && Zone.is_included c1.over_inputs c2.over_inputs && Zone.is_included c2.under_outputs c1.under_outputs && Zone.is_included c1.operational_inputs c2.operational_inputs end module Transfer = struct (* Approximations of two consecutive statements [s1; s2], respectively abstracted as [c1] and [c2]. The result is immediate, except for operational inputs. For those, we subtract from the inputs of [c2] the memory locations that have been written in a sure way in [c1], then perform the join. *) let catenate c1 c2 = { over_outputs = Zone.join c1.over_outputs c2.over_outputs; over_inputs = Zone.join c1.over_inputs c2.over_inputs; under_outputs = Zone.link c1.under_outputs c2.under_outputs; operational_inputs = Zone.join c1.operational_inputs (Zone.diff c2.operational_inputs c1.under_outputs); } (* Effects of a conditional [if (e)]. [to_z] converts the lvalues present in [e] into locations. Nothing is written, the memory locations present in [e] are read. *) let effects_assume to_z e = let inputs = Value_util.zone_of_expr to_z e in { over_outputs = Zone.bottom; over_inputs = inputs; under_outputs = Zone.bottom; operational_inputs = inputs; } (* Effects of an assigment [lv = e]. [to_z] converts the lvalues present in [lv] and [e] into locations. *) let effects_assign to_z lv e = let inputs_e = Value_util.zone_of_expr to_z e in let inputs_lv = Value_util.indirect_zone_of_lval to_z lv.Eval.lval in let inputs = Zone.join inputs_e inputs_lv in let outputs = Precise_locs.enumerate_valid_bits Locations.Write lv.Eval.lloc in let exact_outputs = Precise_locs.cardinal_zero_or_one lv.Eval.lloc in { over_outputs = outputs; over_inputs = inputs; under_outputs = if exact_outputs then outputs else Zone.bottom; operational_inputs = inputs; } (* Removes a list of variables from a state. Used to model exiting a scope. *) let remove_variables vars state = let bases = List.fold_left (fun acc v -> Base.Set.add (Base.of_varinfo v) acc) Base.Set.empty vars in let rm = Zone.filter_base (fun b -> not (Base.Set.mem b bases)) in { over_outputs = rm state.over_outputs; over_inputs = rm state.over_inputs; under_outputs = rm state.under_outputs; operational_inputs = rm state.operational_inputs; } end module Internal (*: Domain_builder.InputDomain with type state = inout and type value = Cvalue.V.t and type location = Precise_locs.precise_location *) = struct type state = inout type value = Cvalue.V.t type location = Precise_locs.precise_location include (LatticeInout: sig include Datatype.S_with_collections with type t = state include Abstract_domain.Lattice with type state := state end) let name = "inout" let log_category = Value_parameters.register_category "d-inout" let enter_scope _kf _vars state = state let leave_scope _kf vars state = Transfer.remove_variables vars state type origin = unit module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = origin and type loc = Precise_locs.precise_location) : Abstract_domain.Transfer with type state = state and type value = Cvalue.V.t and type location = Precise_locs.precise_location and type valuation = Valuation.t = struct type value = Cvalue.V.t type state = inout type location = Precise_locs.precise_location type valuation = Valuation.t let to_z valuation lv = match Valuation.find_loc valuation lv with | `Value loc -> loc.Eval.loc | `Top -> Precise_locs.loc_top (* should not occur *) let assign _ki lv e _v valuation state = let to_z = to_z valuation in let effects = Transfer.effects_assign to_z lv e in `Value (Transfer.catenate state effects) let assume _stmt e _pos valuation state = let to_z = to_z valuation in let effects = Transfer.effects_assume to_z e in `Value (Transfer.catenate state effects) let start_call _stmt _call _valuation _state = `Value LatticeInout.empty let finalize_call _stmt _call ~pre ~post = `Value (Transfer.catenate pre post) let update _valuation state = `Value state let show_expr _valuation _state _fmt _expr = () end (* Memexec *) let relate _kf _bases _state = Base.SetLattice.empty let filter _kf _kind _bases state = state let reuse _kf _bases ~current_input:_ ~previous_output = previous_output (* Initial state. Initializers are singletons, so we store nothing. *) let empty () = LatticeInout.empty let introduce_globals _vars state = state let initialize_variable _ _ ~initialized:_ _ state = state let initialize_variable_using_type _ _ state = state (* TODO *) let logic_assign _assign _location ~pre:_ _state = top (* Logic *) let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ state _ _ = `Value state let storage () = true let top_query = `Value (Cvalue.V.top, ()), Alarmset.all let extract_expr _oracle _state _expr = top_query let extract_lval _oracle _state _lv _typ _locs = top_query let backward_location _state _lval _typ loc value = `Value (loc, value) let enter_loop _ state = state let incr_loop_counter _ state = state let leave_loop _ state = state let reduce_further _state _expr _value = [] (*Nothing intelligent to suggest*) end module D = Domain_builder.Complete (Internal) (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/inout_domain.mli�������������������������������������0000666�0000000�0000000�00000003362�13571573400�021425� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Computation of inputs of outputs. *) module D: Abstract_domain.Leaf with type value = Cvalue.V.t and type location = Precise_locs.precise_location ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/numerors/��������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020103� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/numerors/numerors_domain.ml��������������������������0000666�0000000�0000000�00000014707�13571573400�023647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval open Cil_types (* The numerors values, plus some builtin functions. *) module Numerors_Value = struct include Numerors_value (* In this domain, we only track floating-point variables. *) let track_variable vi = Cil.isFloatingType vi.vtype (* No widen in the domain for now *) let widen _ _ = top let dbetween = function | min :: max :: [] -> Numerors_value.dbetween min max | _ -> `Value Numerors_value.top let rbetween = function | min :: max :: [] -> Numerors_value.rbetween min max | _ -> `Value Numerors_value.top let sqrt = function | x :: [] -> Numerors_value.sqrt x | _ -> `Value Numerors_value.top let log = function | x :: [] -> Numerors_value.log x | _ -> `Value Numerors_value.top let exp = function | x :: [] -> Numerors_value.exp x | _ -> `Value Numerors_value.top let dprint_callstack = ref [] let dprint = function | x :: [] -> let call fmt () = let abs = Numerors_value.get_max_absolute_error x in let rel = Numerors_value.get_max_relative_error x in match abs, rel with | Some x, Some y -> Format.fprintf fmt "@[%a@]@.@[%a@]@." Numerors_float.pretty x Numerors_float.pretty y | _, _ -> () (* Format.fprintf fmt "@[%a@]@.@." Numerors_value.pretty x *) in dprint_callstack := !dprint_callstack @ [call] ; `Value Numerors_value.top | _ -> `Value Numerors_value.top let builtins = [ ("Frama_C_double_interval", dbetween) ; ("Frama_C_real_interval_as_double", rbetween) ; ("log", log) ; ("exp", exp) ; ("sqrt", sqrt) ; ("DPRINT", dprint) ] end (* The numerors domain: a simple memory over the numerors value. *) module Domain = struct module Name = struct let name = "numerors" end include Simple_memory.Make_Domain (Name) (Numerors_Value) let post_analysis f = match f, Value_parameters.NumerorsLogFile.get () with | _, s when s = "" -> () | `Value _, s -> let log = open_out s in let fmt = Format.formatter_of_out_channel log in List.iter (fun f -> f fmt ()) !Numerors_Value.dprint_callstack ; close_out log | _, _ -> () end (* Reduced product between the cvalue values and the numerors values. *) let reduce_error cvalue error = try let ival = Cvalue.V.project_ival cvalue in match ival with | Ival.Float fval -> begin match Numerors_value.reduce fval error with | `Value error -> cvalue, error | `Bottom -> cvalue, error (* TODO: we should be able to reduce to bottom. *) end | _ -> cvalue, error with Cvalue.V.Not_based_on_null -> cvalue, error (* Reduction of the numerors value resulting from a cast from int to float type, using the cvalue component of value abstractions. *) let reduce_cast (module Abstract: Abstractions.S) = let module Val = struct include Abstract.Val (* Redefines the [forward_cast] function of the value component. *) let forward_cast = (* If cvalue or numerors do not belong to the abstraction, no reduction: the [forward_cast] function is unchanged. *) match get Main_values.CVal.key, mem Numerors_value.key with | None, _ | _, false -> forward_cast | Some get_cvalue, true -> (* Otherwise, applies the [forward_cast] function, but updates the numerors component of the result. *) fun ~src_type ~dst_type value -> forward_cast ~src_type ~dst_type value >>-: fun result -> match src_type, dst_type with | Eval_typ.TSInt _, Eval_typ.TSFloat fkind -> begin try let cvalue = get_cvalue value in let ival = Cvalue.V.project_ival cvalue in match Ival.min_and_max ival with | Some min, Some max -> let min, max = Integer.to_int min, Integer.to_int max in let prec = Numerors_utils.Precisions.of_fkind fkind in let num = Numerors_value.of_ints ~prec min max in set Numerors_value.key num result | _, _ -> result (* Integer.to_int may fail for too big integers. *) with Cvalue.V.Not_based_on_null | Z.Overflow -> result end | _, _ -> result end in (module struct module Val = Val module Loc = Abstract.Loc module Dom = Abstract.Dom end: Abstractions.S) (* Register the domain as an Eva abstractions. *) let () = let open Abstractions in let domain = { name = "numerors"; priority = 0; values = Single (module Numerors_value); domain = Domain (module Domain); } in let reduced_product = Main_values.CVal.key, Numerors_value.key, reduce_error in register ~enable:Value_parameters.NumerorsDomain.get domain; register_value_reduction reduced_product; register_hook reduce_cast; Value_parameters.register_numerors () ���������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/numerors/numerors_domain.mli�������������������������0000666�0000000�0000000�00000003534�13571573400�024014� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Numerors domain: computes over-approximations of the rounding errors bounds of floating-point computations. Nothing is exported: the domain is registered as an analysis abstraction in the Eva engine, enabled by the -eva-numerors-domain option. *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/octagons.ml������������������������������������������0000666�0000000�0000000�00000137475�13571573400�020421� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval (* If [true], checks invariants of the states created by most functions. *) let debug = false (* Whether the domain infers non-relational intervals (ivals) to improve the precision of the join operation: this avoids losing all relations that have been inferred in only one side of the join. Enhances the domain accuracy for a minimal drop in efficiency. *) let infer_intervals = true (* Whether the domain saturates the octagons: from a relation between (x, y) and a relation between (y, z), infers the relation between (x, z). The saturation is currently partial. Improves the domain accuracy for a minimal drop in efficiency. *) let saturate_octagons = true (* Is the domain intraprocedural, according to the -eva-octagon-through-calls option. In this case, the analysis of each function starts with an empty state, and the relations inferred in a function are not propagated back to the caller either. *) let intraprocedural () = not (Value_parameters.OctagonCall.get ()) (* -------------------------------------------------------------------------- *) (* Basic types: pair of variables and Ival.t *) (* -------------------------------------------------------------------------- *) (* Variables of the octagons. Should be extended later to also include symbolic lvalues. *) module Variable = struct include Cil_datatype.Varinfo let id v = v.vid end module VariableSet = struct include Variable.Set let pretty_debug = pretty end (* Pairs of related variables in an octagon. This module imposes an order between the two variables X and Y in a pair to avoid creating octagons about X±Y *and* about Y±X. *) module Pair = struct module D = Datatype.Pair (Variable) (Variable) module Info = struct let name = "Octagons.Pair" let dependencies = [ Ast.self ] let initial_values = [] end include State_builder.Hashcons (D) (Info) (* Creates a pair, and also returns a boolean that is [true] if x, y are swapped in the pair. *) let make x y = assert (x.vid <> y.vid); let pair, swap = if x.vid < y.vid then (x, y), false else (y, x), true in hashcons pair, swap let fst t = fst (get t) end (* Kind of relation between two variables X and Y: X+Y or X-Y. *) type operation = Add | Sub (* Extended arithmetic operations over Ival.t. *) module Arith = struct open Ival let top_float = Ival.inject_float Fval.top let narrow x y = let r = narrow x y in if is_bottom r then `Bottom else `Value r let widen = let hints = Integer.zero, (Ival.Widen_Hints.default_widen_hints, Fc_float.Widen_Hints.default_widen_hints) in Ival.widen hints (* TODO: do not use Ival.top on floating-point value? *) let project_float ival = if Ival.(equal top ival) then Fval.top else project_float ival let neg = function | Float f -> inject_float (Fval.neg f) | ival -> neg_int ival let int_or_float_operation i_op f_op = fun typ -> match Cil.unrollType typ with | TInt _ | TEnum _ -> i_op | TFloat _ -> fun i1 i2 -> inject_float (f_op Fval.Real (project_float i1) (project_float i2)) | _ -> assert false let sub = int_or_float_operation Ival.sub_int Fval.sub let add = int_or_float_operation Ival.add_int Fval.add let apply = function | Add -> add | Sub -> sub (* Creates the ival covering the integer range [range]. *) let make_range range = let min = Eval_typ.range_lower_bound range in let max = Eval_typ.range_upper_bound range in Ival.inject_range (Some min) (Some max) (* Does an ival represent all values of a C type [typ]? *) let is_top_for_typ typ ival = let open Eval_typ in Ival.(equal top ival) || match classify_as_scalar typ with | None -> assert false | Some (TSFloat _) -> Ival.equal top_float ival | Some (TSInt range | TSPtr range) -> (* TODO: this could be more efficient. *) let range = make_range range in Ival.is_included range ival || Ival.is_included range (neg_int ival) (* Does an ival represent all possible values of a pair of variables? *) let is_top_for_pair pair = let x, y = Pair.get pair in if Cil_datatype.Typ.equal x.vtype y.vtype then is_top_for_typ x.vtype else fun ival -> is_top_for_typ x.vtype ival && is_top_for_typ y.vtype ival end (* -------------------------------------------------------------------------- *) (* Rewriting Cil expressions into mathematical octagons *) (* -------------------------------------------------------------------------- *) (* An octagonal relation between two variables : b ≤ X±Y ≤ e *) type octagon = { variables: Pair.t; (* The two related variables X and Y. *) operation: operation; (* Whether the relation is about X+Y or X-Y. *) value: Ival.t; (* The interval of X±Y. *) } let _pretty_octagon fmt octagon = let x, y = Pair.get octagon.variables in let op = match octagon.operation with Add -> "+" | Sub -> "-" in Format.fprintf fmt "%a %s %a %s %a" Printer.pp_varinfo x op Printer.pp_varinfo y (Unicode.inset_string ()) Ival.pretty octagon.value (* Transforms Cil expressions into mathematical octagons. Use Ival.t to evaluate expressions. *) module Rewriting = struct (* Checks if the interval [ival] fits in the C type [typ]. This is used to ensure that an expression cannot overflow: this module uses the mathematical semantics of arithmetic operations, and cannot soundly translate overflows in the C semantics. *) let may_overflow typ ival = let open Eval_typ in match classify_as_scalar typ with | None -> assert false (* This should not happen here. *) | Some (TSFloat _) -> false | Some (TSInt range | TSPtr range) -> not ((range.i_signed && Kernel.SignedOverflow.get ()) || (not range.i_signed && Kernel.UnsignedOverflow.get ()) || Ival.is_included ival (Arith.make_range range)) (* Simplified form [±X-coeff] for expressions, where X is a variable and coeff an interval. *) type var_coeff = { varinfo: varinfo; sign: bool; coeff: Ival.t; } (* Negates a simplified form. *) let neg { varinfo; sign; coeff } = { varinfo; sign = not sign; coeff = Arith.neg coeff } (* Is the interval computed for a variable a singleton? *) let is_singleton = function | `Top -> false | `Value ival -> Ival.cardinal_zero_or_one ival (* If a needed interval is unknown, stop the current computation and return an empty list. *) let (>>) value f = match value with | `Top -> [] | `Value ival -> f ival (* Apply [f typ v1 v2] if the operation [e1 op e2] does not overflow, where [v1] and [v2] are the intervals for [e1] and [e2], and [typ] is the type of [e1]. Returns the empty list otherwise. *) let apply_binop f evaluate typ e1 op e2 = evaluate e1 >> fun v1 -> evaluate e2 >> fun v2 -> let typ_e1 = Cil.typeOf e1 in let result = Arith.apply op typ_e1 v1 v2 in if may_overflow typ result then [] else f typ_e1 v1 v2 (* Rewrites the Cil expression [expr] into the simplified form [±x-coeff], where [x] is a non-singleton variable and [coeff] is an interval. The result follows the mathematical semantics. If such a simplified form cannot be found, the function returns an empty list. If multiple variables occur in the expression, the function tries to compute a list of equivalent forms [±x-coeff], one for each variable. The function relies on an evaluation function linking each sub-expression into an interval, used for computing sound coefficients. The evaluation may return Top for some sub-expression, thus preventing the computation. *) let rec rewrite evaluate expr = match expr.enode with | Lval (Var varinfo, NoOffset) -> if Cil.isIntegralType varinfo.vtype && not (Cil.typeHasQualifier "volatile" varinfo.vtype) && not (is_singleton (evaluate expr)) then [ { varinfo; sign = true; coeff = Ival.zero } ] else [] | UnOp (Neg, e, typ) -> evaluate e >> fun v -> if may_overflow typ (Arith.neg v) then [] else List.map neg (rewrite evaluate e) | BinOp ((PlusA | MinusA as binop), e1, e2, typ) -> let op = if binop = PlusA then Add else Sub in let rewrite_binop typ v1 v2 = let inverse_op = if binop = PlusA then Arith.sub else Arith.add in let add_v2 var = { var with coeff = inverse_op typ var.coeff v2 } in let add_v1 var = let var = if binop = MinusA then neg var else var in { var with coeff = Arith.sub typ var.coeff v1 } in List.map add_v2 (rewrite evaluate e1) @ List.map add_v1 (rewrite evaluate e2) in apply_binop rewrite_binop evaluate typ e1 op e2 | CastE (typ, e) -> if Cil.(isIntegralType typ && isIntegralType (typeOf e)) then evaluate e >> fun v -> if may_overflow typ v then [] else rewrite evaluate e else [] | Info (e, _) -> rewrite evaluate e | _ -> [] (* Rewrites the operation [e1 ± e2] into equivalent octagons ±(X±Y-value). *) let rewrite_binop evaluate e1 binop e2 = let vars1 = rewrite evaluate e1 in let vars2 = rewrite evaluate e2 in let vars2 = if binop = Sub then List.map neg vars2 else vars2 in let aux acc var1 var2 = if Cil_datatype.Varinfo.equal var1.varinfo var2.varinfo then acc else let variables, swap = Pair.make var1.varinfo var2.varinfo in let operation = if var1.sign = var2.sign then Add else Sub in let sign = match operation with | Add -> var1.sign | Sub -> if swap then var2.sign else var1.sign in let value = Arith.add (Cil.typeOf e1) var1.coeff var2.coeff in let value = if sign then value else Arith.neg value in (* Do not include this rewriting if the [value] exceeds all possible values for the type of [var1] and [var2]. *) if Arith.is_top_for_pair variables value then acc else (sign, { variables; operation; value }) :: acc in Extlib.product_fold aux [] vars1 vars2 (* Returns the range of the expression X-Y when the comparison X#Y holds. *) let comparison_range = let open Abstract_interp.Comp in function | Lt -> Ival.inject_range None (Some Integer.minus_one) | Gt -> Ival.inject_range (Some Integer.one) None | Le -> Ival.inject_range None (Some Integer.zero) | Ge -> Ival.inject_range (Some Integer.zero) None | Eq -> Ival.zero | Ne -> Ival.top (* Transforms the constraint [expr] ∈ [ival] into a list of octagonal constraints. *) let make_octagons evaluate expr ival = let make_octagons_from_binop typ e1 op e2 ival = (* equivalent octagonal forms ±(X±Y-v) for [e1 op e2]. *) let rewritings = rewrite_binop evaluate e1 op e2 in (* create the final octagon, knowning that [e1 op e2] ∈ [ival]. *) let make_octagon (sign, octagon) = let ival = if sign then ival else Arith.neg ival in let value = Arith.add typ ival octagon.value in { octagon with value } in List.map make_octagon rewritings in match expr.enode with | BinOp ((PlusA | MinusA as binop), e1, e2, typ) -> let op = if binop = PlusA then Add else Sub in let make_octagons typ _ _ = make_octagons_from_binop typ e1 op e2 ival in apply_binop make_octagons evaluate typ e1 op e2 | BinOp ((Lt | Gt | Le | Ge | Eq | Ne as binop), e1, e2, _typ) -> let typ = Cil.typeOf e1 in if not (Cil.isIntegralType typ) || (Ival.contains_zero ival && Ival.contains_non_zero ival) then [] else let comp = Value_util.conv_comp binop in let comp = if Ival.is_zero ival then Abstract_interp.Comp.inv comp else comp in let range = comparison_range comp in make_octagons_from_binop typ e1 Sub e2 range | _ -> [] let overflow_alarms typ expr ival = match Eval_typ.classify_as_scalar typ with | Some (Eval_typ.TSInt range) -> let signed = range.Eval_typ.i_signed in let overflow = if signed then Alarms.Signed else Alarms.Unsigned in let max_bound = Eval_typ.range_upper_bound range in let min_bound = Eval_typ.range_lower_bound range in let ival_range = Ival.inject_range (Some min_bound) (Some max_bound) in let aux has_better_bound bound bound_kind alarms = if has_better_bound ival ival_range >= 0 then let alarm = Alarms.Overflow (overflow, expr, bound, bound_kind) in Alarmset.set alarm Alarmset.True alarms else alarms in let alarms = Alarmset.all in let alarms = aux Ival.has_greater_min_bound min_bound Alarms.Lower_bound alarms in aux Ival.has_smaller_max_bound max_bound Alarms.Upper_bound alarms | _ -> Alarmset.all (* Evaluates the Cil expression [expr], by rewriting it into octagonal constraints using [evaluate_expr] to evaluate sub-expressions, and then using [evaluate_octagon] to evaluate the octagons. *) let evaluate_through_octagons evaluate_expr evaluate_octagon expr = let evaluate_octagon acc (sign, octagon) = match evaluate_octagon octagon with | None -> acc | Some ival -> let ival = if sign then ival else Arith.neg ival in Ival.narrow acc ival in let evaluate_octagons octagons = List.fold_left evaluate_octagon Ival.top octagons in let default = Ival.top, Alarmset.all in match expr.enode with | BinOp ((PlusA | MinusA as binop), e1, e2, typ) -> let op = if binop = PlusA then Add else Sub in let octagons = rewrite_binop evaluate_expr e1 op e2 in let ival = evaluate_octagons octagons in if Ival.(equal top ival) then default else let typ_e1 = Cil.typeOf e1 in let ival2 = match evaluate_expr e1, evaluate_expr e2 with | `Value v1, `Value v2 -> Arith.apply op typ_e1 v1 v2 | _, _ -> Ival.top in let ival = Ival.narrow ival ival2 in if may_overflow typ ival then default else ival, overflow_alarms typ expr ival | BinOp ((Lt | Gt | Le | Ge | Eq as binop), e1, e2, _typ) when Cil.isIntegralType (Cil.typeOf e1) -> let comp = Value_util.conv_comp binop in (* Evaluate [e1 - e2] and compare the resulting interval to the interval for which the comparison [e1 # e2] holds. *) let range = comparison_range comp in let octagons = rewrite_binop evaluate_expr e1 Sub e2 in let ival = evaluate_octagons octagons in if Ival.is_included ival range then Ival.one, Alarmset.all else if not (Ival.intersects ival range) then Ival.zero, Alarmset.all else default | _ -> default end (* -------------------------------------------------------------------------- *) (* Diamonds and octagons: relations between two variables *) (* -------------------------------------------------------------------------- *) (* This domain infers relations between pairs of variables (X, Y), by inferring intervals for the mathematical operations X+Y and X-Y. It also infers non-relational intervals for the separate variables X and Y (they could be seen as intervals for X+X and Y+Y, but we chose to store them in another way). These intervals are used to make the join more precise. Geometrically, in a plan, intervals for X and Y shape a straight rectangle, while intervals for X+Y and X-Y shape a "leaning" rectangle; the intersection of these rectangles shapes an octagon. Using a misnomer, we call diamonds the intervals for X+Y and X-Y, and octagons the maps from variables to diamonds, even if they do not exactly shape octagons. *) (* Relation between a pair of variables (X, Y). [add] is an interval for X+Y, and [sub] is an interval for [X-Y]. *) type diamond = { add: Ival.t; sub: Ival.t } module DiamondDatatype = struct type t = diamond include Datatype.Serializable_undefined let name = "Octagons.Diamond" let structural_descr = Structural_descr.t_record [| Ival.packed_descr; Ival.packed_descr |] let reprs = [ { add = Ival.top; sub = Ival.top } ] let compare x y = let c = Ival.compare x.add y.add in if c <> 0 then c else Ival.compare x.sub y.sub let equal = Datatype.from_compare let hash { add; sub } = Hashtbl.hash (Ival.hash add, Ival.hash sub) let pretty fmt { add; sub } = Format.fprintf fmt "@[<hov>ADD: @[%a@] ; SUB: @[%a@]@]" Ival.pretty add Ival.pretty sub end module Diamond = struct include Datatype.Make (DiamondDatatype) let pretty_debug = pretty let top = { add = Ival.top; sub = Ival.top } let is_included x y = Ival.is_included x.add y.add && Ival.is_included x.sub y.sub let join x y = { add = Ival.join x.add y.add; sub = Ival.join x.sub y.sub } let widen x y = { add = Arith.widen x.add y.add; sub = Arith.widen x.sub y.sub } let narrow x y = Arith.narrow x.add y.add >>- fun add -> Arith.narrow x.sub y.sub >>-: fun sub -> {add; sub} (* If [swap] is true, makes a diamond about (X, Y) from a diamond about (Y, X). *) let reverse_variables swap t = if swap then { t with sub = Arith.neg t.sub } else t (* Normalizes a diamond for the pair of variables [pair]: replaces too large ivals by Ival.top. Returns None if both ivals are meaningless. *) let trim pair t = let is_top = Arith.is_top_for_pair pair in match is_top t.add, is_top t.sub with | true, true -> None | true, false -> Some { t with add = Ival.top } | false, true -> Some { t with sub = Ival.top } | false, false -> Some t end (* Maps linking pairs of variables (X, Y) to intervals for X+Y and X-Y. *) module Octagons = struct module Initial_Values = struct let v = [[]] end module Dependencies = struct let l = [ Ast.self ] end include Hptmap.Make (Pair) (Diamond) (Hptmap.Comp_unused) (Initial_Values) (Dependencies) let internal_join = join let pretty fmt t = let iter f = iter (fun k v -> f (k, v)) in let pretty fmt (pair, diamond) = let x, y = Pair.get pair in let pretty_one op ival = if not Ival.(equal top ival) then Format.fprintf fmt "@[@[%a %s %a@] %s @[%a@]@]@," Variable.pretty x op Variable.pretty y (Unicode.inset_string ()) Ival.pretty ival in pretty_one "+" diamond.add; pretty_one "-" diamond.sub in Pretty_utils.pp_iter ~pre:"@[<v 3>{[ " ~suf:" ]}@]" ~sep:"" iter pretty fmt t let top = empty let is_included = let cache = Hptmap_sig.PersistentCache "Octagons.Octagons.is_included" in let decide_fst _ _ = true in let decide_snd _ _ = false in let decide_both _ x y = Diamond.is_included x y in let decide_fast t1 t2 = decide_fast_inclusion t2 t1 in binary_predicate cache UniversalPredicate ~decide_fast ~decide_fst ~decide_snd ~decide_both exception EBottom let narrow_exc = let cache = Hptmap_sig.NoCache in let decide _pair x y = match Diamond.narrow x y with | `Value v -> v | `Bottom -> raise EBottom in join ~cache ~symmetric:true ~idempotent:true ~decide let narrow x y = try `Value (narrow_exc x y) with EBottom -> `Bottom let simple_join = let cache = Hptmap_sig.PersistentCache "Octagons.Octagons.join" in let decide pair x y = Diamond.trim pair (Diamond.join x y) in inter ~cache ~symmetric:true ~idempotent:true ~decide let join ~decide_left ~decide_right = let cache = Hptmap_sig.NoCache in let decide_left = Traversing decide_left and decide_right = Traversing decide_right in let decide_both pair x y = Diamond.trim pair (Diamond.join x y) in merge ~cache ~symmetric:false ~idempotent:true ~decide_left ~decide_right ~decide_both let simple_widen = let cache = Hptmap_sig.PersistentCache "Octagons.Octagons.widen" in let decide pair x y = Diamond.trim pair (Diamond.widen x y) in inter ~cache ~symmetric:false ~idempotent:true ~decide let widen ~decide_left ~decide_right = let cache = Hptmap_sig.NoCache in let decide_left = Traversing decide_left and decide_right = Traversing decide_right in let decide_both pair x y = Diamond.trim pair (Diamond.widen x y) in merge ~cache ~symmetric:false ~idempotent:true ~decide_left ~decide_right ~decide_both let unsafe_add = add let add variables diamond t = try Diamond.narrow diamond (find variables t) >>-: fun diamond -> add variables diamond t with Not_found -> `Value (add variables diamond t) let add_octagon { variables; operation; value; } t = let diamond = try find variables t with Not_found -> Diamond.top in let diamond = match operation with | Add -> Arith.narrow diamond.add value >>-: fun add -> { diamond with add } | Sub -> Arith.narrow diamond.sub value >>-: fun sub -> { diamond with sub } in diamond >>-: fun diamond -> unsafe_add variables diamond t let evaluate octagon t = try let diamond = find octagon.variables t in let ival = match octagon.operation with | Add -> diamond.add | Sub -> diamond.sub in if Ival.(equal top ival) then None else let typ = (Pair.fst octagon.variables).vtype in let ival = Arith.sub typ ival octagon.value in Some ival with Not_found -> None end (* -------------------------------------------------------------------------- *) (* Relations *) (* -------------------------------------------------------------------------- *) (* Keep track of related variables in an octagon state. *) module Relations = struct module Initial_Values = struct let v = [[]] end module Dependencies = struct let l = [ Ast.self ] end include Hptmap.Make (Variable) (VariableSet) (Hptmap.Comp_unused) (Initial_Values) (Dependencies) let inter = let cache = Hptmap_sig.PersistentCache "Octagons.Relations.inter" in let decide _pair x y = let r = Variable.Set.inter x y in if Variable.Set.is_empty r then None else Some r in inter ~cache ~symmetric:true ~idempotent:true ~decide let union = let cache = Hptmap_sig.PersistentCache "Octagons.Relations.union" in let decide _pair x y = Variable.Set.union x y in join ~cache ~symmetric:true ~idempotent:true ~decide (* Marks y as related to x. *) let relate_aux x y t = let related = try find x t with Not_found -> VariableSet.empty in let updated = VariableSet.add y related in add x updated t (* Marks x and y as mutually related. *) let relate pair t = let x, y = Pair.get pair in relate_aux y x (relate_aux x y t) let add variable set t = if VariableSet.is_empty set then remove variable t else add variable set t end (* -------------------------------------------------------------------------- *) (* Non-relational intervals *) (* -------------------------------------------------------------------------- *) module Intervals = struct module Initial_Values = struct let v = [[]] end module Dependencies = struct let l = [ Ast.self ] end include Hptmap.Make (Variable) (Ival) (Hptmap.Comp_unused) (Initial_Values) (Dependencies) let internal_join = join let top = empty let is_included = let cache = Hptmap_sig.PersistentCache "Octagons.Intervals.is_included" in let decide_fst _ _ = true in let decide_snd _ _ = false in let decide_both _ x y = Ival.is_included x y in let decide_fast t1 t2 = decide_fast_inclusion t2 t1 in binary_predicate cache UniversalPredicate ~decide_fast ~decide_fst ~decide_snd ~decide_both exception EBottom let narrow_exc = let cache = Hptmap_sig.NoCache in let decide _varinfo x y = let ival = Ival.narrow x y in if Ival.is_bottom ival then raise EBottom else ival in join ~cache ~symmetric:true ~idempotent:true ~decide let narrow x y = try `Value (narrow_exc x y) with EBottom -> `Bottom let join = let cache = Hptmap_sig.PersistentCache "Octagons.Intervals.join" in let decide _varinfo x y = let r = Ival.join x y in if Ival.(equal top r) then None else Some r in inter ~cache ~symmetric:true ~idempotent:true ~decide let widen = let cache = Hptmap_sig.PersistentCache "Octagons.Intervals.widen" in let decide _varinfo x y = let r = Arith.widen x y in if Ival.(equal top r) then None else Some r in inter ~cache ~symmetric:false ~idempotent:true ~decide end (* -------------------------------------------------------------------------- *) (* Octagon states *) (* -------------------------------------------------------------------------- *) module Zone = Locations.Zone module State = struct type state = { octagons: Octagons.t; (* The intervals for X±Y. *) intervals: Intervals.t; (* The intervals for the variables X,Y… *) relations: Relations.t; (* The related variables in [octagons]. *) modified: Locations.Zone.t; (* The memory zone modified by a function. *) } include Datatype.Make_with_collections (struct type t = state include Datatype.Serializable_undefined let name = "Octagons.State" let structural_descr = Structural_descr.t_record [| Octagons.packed_descr; Intervals.packed_descr; Relations.packed_descr; Zone.packed_descr |] let reprs = [ { octagons = Octagons.top; intervals = Intervals.empty; relations = Relations.empty; modified = Zone.bottom } ] let compare s1 s2 = let c = Octagons.compare s1.octagons s2.octagons in if c <> 0 then c else let c = Intervals.compare s1.intervals s2.intervals in if c <> 0 then c else Zone.compare s1.modified s2.modified let equal = Datatype.from_compare let hash t = Hashtbl.hash (Octagons.hash t.octagons, Relations.hash t.relations, Zone.hash t.modified) let pretty fmt { octagons } = Format.fprintf fmt "@[%a@]" Octagons.pretty octagons end) let pretty_debug fmt { octagons; intervals; relations } = Format.fprintf fmt "@[<v> Octagons: %a@; Intervals: %a@; Relations: %a@]" Octagons.pretty octagons Intervals.pretty intervals Relations.pretty relations (* Verify the internal structure of a state [t], depending on the boolean variable [debug]. *) let check = if not debug then fun _ t -> t else fun msg t -> (* Checks that an octagon is properly registered in [t.relations]. This is mandatory for the soundness of the domain. On the other hand, two variables can be related in [t.relations] without an actual octagon between them. *) let check_octagon pair _ = let x, y = Pair.get pair in try VariableSet.mem x (Relations.find y t.relations) && VariableSet.mem y (Relations.find x t.relations) with Not_found -> false in if Octagons.for_all check_octagon t.octagons then t else Value_parameters.abort "Incorrect octagon state computed by function %s:@ %a" msg pretty_debug t (* ------------------------------ Lattice --------------------------------- *) let top = { octagons = Octagons.top; intervals = Intervals.top; relations = Relations.empty; modified = Zone.top; } let empty () = { octagons = Octagons.top; intervals = Intervals.top; relations = Relations.empty; modified = Zone.bottom; } let is_included t1 t2 = Octagons.is_included t1.octagons t2.octagons && Intervals.is_included t1.intervals t2.intervals && Zone.is_included t1.modified t2.modified let join t1 t2 = let octagons = if not infer_intervals then Octagons.simple_join t1.octagons t2.octagons else let decide_empty intervals pair diamond = let v1, v2 = Pair.get pair in try let i1 = Intervals.find v1 intervals and i2 = Intervals.find v2 intervals in let add = Arith.add v1.vtype i1 i2 and sub = Arith.sub v1.vtype i1 i2 in let diamond = Diamond.join diamond { add; sub } in Diamond.trim pair diamond with Not_found -> None in let decide_left = decide_empty t2.intervals and decide_right = decide_empty t1.intervals in Octagons.join ~decide_left ~decide_right t1.octagons t2.octagons in let relations = if infer_intervals then Relations.union t1.relations t2.relations else Relations.inter t1.relations t2.relations in let state = { octagons; relations; intervals = Intervals.join t1.intervals t2.intervals; modified = Zone.join t1.modified t2.modified; } in check "join" state let widen _kf _hints t1 t2 = let octagons = if not infer_intervals then Octagons.simple_widen t1.octagons t2.octagons else let decide_empty b intervals pair diamond = let v1, v2 = Pair.get pair in try let i1 = Intervals.find v1 intervals and i2 = Intervals.find v2 intervals in let add = Arith.add v1.vtype i1 i2 and sub = Arith.sub v1.vtype i1 i2 in let diamond = if b then Diamond.widen { add; sub } diamond else Diamond.widen diamond { add; sub } in Diamond.trim pair diamond with Not_found -> None in let decide_left = decide_empty false t2.intervals and decide_right = decide_empty true t1.intervals in Octagons.widen ~decide_left ~decide_right t1.octagons t2.octagons in let relations = if infer_intervals then Relations.union t1.relations t2.relations else Relations.inter t1.relations t2.relations in let state = { octagons; relations; intervals = Intervals.widen t1.intervals t2.intervals; modified = Zone.join t1.modified t2.modified; } in check "widen" state let narrow t1 t2 = Octagons.narrow t1.octagons t2.octagons >>- fun octagons -> Intervals.narrow t1.intervals t2.intervals >>- fun intervals -> let relations = Relations.union t1.relations t2.relations in let modified = Zone.narrow t1.modified t2.modified in `Value { octagons; intervals; relations; modified; } (* -------------- Transitive closure when adding an octagon --------------- *) type relation = { vars: varinfo * varinfo; diamond: diamond; } let add_diamond state pair diamond = match Diamond.trim pair diamond with | None -> `Value state | Some diamond -> Octagons.add pair diamond state.octagons >>-: fun octagons -> let relations = Relations.relate pair state.relations in { state with octagons; relations } let inverse { vars; diamond } = let var1, var2 = vars in { vars = var2, var1; diamond = Diamond.reverse_variables true diamond } let transitive_relation y rel1 rel2 = let rel1 = if Variable.equal y (snd rel1.vars) then rel1 else inverse rel1 and rel2 = if Variable.equal y (fst rel2.vars) then rel2 else inverse rel2 in (* rel1 is about X±Y, rel2 is about Y±Z. *) let typ = y.vtype in (* X+Z = (X+Y) - (Y-Z) and X+Y = (X-Y) + (Y+Z) *) let add = Ival.narrow (Arith.sub typ rel1.diamond.add rel2.diamond.sub) (Arith.add typ rel1.diamond.sub rel2.diamond.add) (* X-Z = (X+Y) - (Y+Z) and X-Z = (X-Y) + (Y-Z) *) and sub = Ival.narrow (Arith.sub typ rel1.diamond.add rel2.diamond.add) (Arith.add typ rel1.diamond.sub rel2.diamond.sub) in let diamond = {add; sub} in let pair, swap = Pair.make (fst rel1.vars) (snd rel2.vars) in let diamond = Diamond.reverse_variables swap diamond in pair, diamond let saturate state x y rel1 = try let y_related = Relations.find y state.relations in let y_related = VariableSet.remove x y_related in let aux z state = state >>- fun state -> try let pair, _ = Pair.make y z in let diamond = Octagons.find pair state.octagons in let vars = Pair.get pair in let rel2 = { vars; diamond } in let pair, diamond = transitive_relation y rel1 rel2 in add_diamond state pair diamond with Not_found -> `Value state in VariableSet.fold aux y_related (`Value state) with Not_found -> `Value state let add_octagon state octagon = if Arith.is_top_for_pair octagon.variables octagon.value then `Value state else let state = if saturate_octagons then let x, y = Pair.get octagon.variables in let diamond = match octagon.operation with | Add -> { add = octagon.value; sub = Ival.top } | Sub -> { add = Ival.top; sub = octagon.value } in let relation = { vars = x, y; diamond } in saturate state y x relation >>- fun state -> saturate state x y relation else `Value state in state >>- fun state -> Octagons.add_octagon octagon state.octagons >>-: fun octagons -> let relations = Relations.relate octagon.variables state.relations in { state with octagons; relations } let remove state x = let intervals = Intervals.remove x state.intervals in let state = { state with intervals } in try let relations = Relations.find x state.relations in let remove_one y state = try let yrelations = Relations.find y state.relations in let yrelations = VariableSet.remove x yrelations in let relations = Relations.add y yrelations state.relations in let pair, _ = Pair.make x y in let octagons = Octagons.remove pair state.octagons in { state with octagons; relations } with Not_found -> state in let state = VariableSet.fold remove_one relations state in let relations = Relations.remove x state.relations in { state with relations } with Not_found -> state let related_octagons state x = try let related = Relations.find x state.relations in let aux y acc = let pair, swap = Pair.make x y in try let diamond = Octagons.find pair state.octagons in let diamond = Diamond.reverse_variables swap diamond in (y, diamond) :: acc with Not_found -> acc in VariableSet.fold aux related [] with Not_found -> [] (* x' = ±x - delta *) let sub_delta ~inverse state x delta = let intervals = Intervals.remove x state.intervals in let state = { state with intervals } in let x_related = Relations.find x state.relations in let aux y state = let pair, swap = Pair.make x y in try let diamond = Octagons.find pair state.octagons in let diamond = if inverse then let op = if swap then fun x -> x else Arith.neg in { add = op diamond.sub; sub = op diamond.add } else diamond in let typ = x.vtype in let op = if swap then Arith.add else Arith.sub in let add = if Ival.(equal top diamond.add) then diamond.add else Arith.sub typ diamond.add delta and sub = if Ival.(equal top diamond.sub) then diamond.sub else op typ diamond.sub delta in let diamond' = { add; sub } in let octagons = Octagons.unsafe_add pair diamond' state.octagons in { state with octagons } with Not_found -> state in VariableSet.fold aux x_related state end (* -------------------------------------------------------------------------- *) (* Octagon domain *) (* -------------------------------------------------------------------------- *) module Domain = struct include State type value = Cvalue.V.t type location = Precise_locs.precise_location type origin = unit let top_value = `Value (Cvalue.V.top, ()), Alarmset.all let extract_expr oracle state expr = let evaluate_expr expr = match fst (oracle expr) with | `Bottom -> `Top (* should not happen *) | `Value cvalue -> try `Value (Cvalue.V.project_ival cvalue) with Cvalue.V.Not_based_on_null -> `Top in let evaluate_octagon octagon = Octagons.evaluate octagon state.octagons in let ival, alarms = Rewriting.evaluate_through_octagons evaluate_expr evaluate_octagon expr in if Ival.(equal ival top) then top_value else if Ival.is_bottom ival then `Bottom, Alarmset.all else `Value (Cvalue.V.inject_ival ival, ()), alarms let extract_lval _oracle _t _lval _typ _loc = top_value let backward_location _t _lval _typ loc value = `Value (loc, value) let reduce_further state expr value = match expr.enode with | Lval (Var x, NoOffset) when Cil.isIntegralType x.vtype -> begin try let x_ival = Cvalue.V.project_ival value in let octagons = State.related_octagons state x in let reduce acc (y, octagons) = let y_ival1 = if Ival.(equal top octagons.add) then Ival.top else Arith.sub x.vtype octagons.add x_ival in let y_ival2 = if Ival.(equal top octagons.sub) then Ival.top else Arith.sub x.vtype x_ival octagons.sub in let y_ival = Ival.narrow y_ival1 y_ival2 in if Ival.(equal top y_ival) then acc else let y_enode = Lval (Var y, NoOffset) in let y_expr = Cil.new_exp ~loc:expr.eloc y_enode in let y_cvalue = Cvalue.V.inject_ival y_ival in (y_expr, y_cvalue) :: acc in List.fold_left reduce [] octagons with Cvalue.V.Not_based_on_null -> [] end | _ -> [] let kill_base base state = try let varinfo = Base.to_varinfo base in State.remove state varinfo with Base.Not_a_C_variable -> state let kill zone state = if Locations.Zone.(equal zone top) then top else let modified = Locations.Zone.join state.modified zone in let state = Zone.fold_bases kill_base zone state in { state with modified } module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type loc = location) = struct (* Evaluation function of expressions to ival, from a [valuation]. *) let evaluation_function valuation = fun expr -> match Valuation.find valuation expr with | `Top -> `Top | `Value record -> match record.Eval.value.v with | `Bottom -> `Top (* TODO: why this keeps happening? *) | `Value cvalue -> try `Value (Cvalue.V.project_ival cvalue) with Cvalue.V.Not_based_on_null -> `Top exception EBottom let infer_octagons evaluate expr ival state = let octagons = Rewriting.make_octagons evaluate expr ival in let add_octagon state octagon = match State.add_octagon state octagon with | `Bottom -> raise EBottom | `Value state -> state in List.fold_left add_octagon state octagons let infer_interval expr ival state = if not infer_intervals then state else match expr.enode with | Lval (Var varinfo, NoOffset) when Cil.isIntegralType varinfo.vtype -> let intervals = Intervals.add varinfo ival state.intervals in { state with intervals } | _ -> state let update valuation state = let evaluate = evaluation_function valuation in let aux expr record state = let value = record.Eval.value in match record.reductness, value.v, value.initialized, value.escaping with | (Created | Reduced), `Value cvalue, true, false -> begin try let ival = Cvalue.V.project_ival cvalue in let state = infer_octagons evaluate expr ival state in infer_interval expr ival state with Cvalue.V.Not_based_on_null -> state end | _ -> state in try `Value (check "update" (Valuation.fold aux valuation state)) with EBottom -> `Bottom let assign_interval varinfo assigned state = if not infer_intervals then state else match assigned with | Assign v | Copy (_, { v = `Value v; initialized = true; escaping = false }) -> begin try let ival = Cvalue.V.project_ival v in let intervals = Intervals.add varinfo ival state.intervals in { state with intervals } with Cvalue.V.Not_based_on_null -> state end | _ -> state let assign_variable varinfo expr assigned valuation state = let evaluate = evaluation_function valuation in (* TODO: redundant with rewrite_binop below. *) let vars = Rewriting.rewrite evaluate expr in let equal_varinfo v = Variable.equal varinfo v.Rewriting.varinfo in let state = try let var = List.find equal_varinfo vars in let inverse = not var.Rewriting.sign in State.sub_delta ~inverse state varinfo var.Rewriting.coeff with Not_found -> State.remove state varinfo in let state = assign_interval varinfo assigned state in let enode = Lval (Var varinfo, NoOffset) in let left_expr = Cil.new_exp ~loc:expr.eloc enode in (* On the assignment X = E; if X-E can be rewritten as ±(X±Y-v), then the octagonal constraint [X±Y ∈ v] holds. *) let octagons = Rewriting.rewrite_binop evaluate left_expr Sub expr in let state = List.fold_left (fun acc (_sign, octagon) -> acc >>- fun state -> State.add_octagon state octagon) (`Value state) octagons in state >>-: check "precise assign" let assign _kinstr left_value expr assigned valuation state = update valuation state >>- fun state -> match left_value.lval with | Var varinfo, NoOffset when Cil.isIntegralType varinfo.vtype -> assign_variable varinfo expr assigned valuation state | _ -> let written_loc = Precise_locs.imprecise_location left_value.lloc in let written_zone = Locations.(enumerate_valid_bits Write written_loc) in let state = kill written_zone state in `Value (check "imprecise assign" state) let assume _stmt _exp _bool = update let start_call _stmt call valuation state = if intraprocedural () then `Value (empty ()) else let state = { state with modified = Locations.Zone.bottom } in let assign_formal state { formal; concrete; avalue } = state >>- assign_variable formal concrete avalue valuation in List.fold_left assign_formal (`Value state) call.arguments let finalize_call _stmt _call ~pre ~post = if intraprocedural () then `Value (kill post.modified pre) else let modified = Locations.Zone.join post.modified pre.modified in `Value { post with modified } let show_expr _valuation _state _fmt _expr = () end let logic_assign _logic_assign location ~pre:_ state = let loc = Precise_locs.imprecise_location location in let zone = Locations.(enumerate_valid_bits Write loc) in let state = kill zone state in check "logic_assign" state let evaluate_predicate _env _state _pred = Alarmset.Unknown let reduce_by_predicate _env state _pred _positive = `Value state let enter_scope _kf _varinfos state = state let leave_scope _kf varinfos state = let state = List.fold_left State.remove state varinfos in check "leave_scope" state let enter_loop _stmt state = state let incr_loop_counter _stmt state = state let leave_loop _stmt state = state let introduce_globals _varinfos state = state let initialize_variable _lval _location ~initialized:_ _value state = state let initialize_variable_using_type _kind _varinfo state = state let relate _kf bases state = if intraprocedural () then Base.SetLattice.empty else let aux base acc = try let varinfo = Base.to_varinfo base in let varset = Relations.find varinfo state.relations in let baseset = VariableSet.fold (fun vi acc -> Base.Hptset.add (Base.of_varinfo vi) acc) varset Base.Hptset.empty in Base.SetLattice.(join (inject baseset) acc) with Base.Not_a_C_variable | Not_found -> acc in Base.Hptset.fold aux bases Base.SetLattice.empty let filter _kf _kind bases state = if intraprocedural () then state else let mem_vi varinfo = Base.Hptset.mem (Base.of_varinfo varinfo) bases in let mem_pair pair = let x, y = Pair.get pair in mem_vi x && mem_vi y in let octagons = Octagons.filter mem_pair state.octagons in let intervals = Intervals.filter mem_vi state.intervals in let relations = Relations.filter mem_vi state.relations in { state with octagons; intervals; relations; } let reuse = let cache = Hptmap_sig.PersistentCache "Octagons.reuse" and symmetric = false and idempotent = true and decide _key left _right = left in let join_oct = Octagons.internal_join ~cache ~symmetric ~idempotent ~decide and join_itv = Intervals.internal_join ~cache ~symmetric ~idempotent ~decide and join_rel = Relations.union in fun _kf _bases ~current_input ~previous_output -> if intraprocedural () then previous_output else let current_input = kill previous_output.modified current_input in let prev_output = previous_output in check "reuse result" { octagons = join_oct prev_output.octagons current_input.octagons; intervals = join_itv prev_output.intervals current_input.intervals; relations = join_rel prev_output.relations current_input.relations; modified = current_input.modified } let name = "Octagon domain" let log_category = Value_parameters.register_category "d-octagon" let storage () = true end include Domain_builder.Complete (Domain) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/octagons.mli�����������������������������������������0000666�0000000�0000000�00000003306�13571573400�020553� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Abstract_domain.Leaf with type value = Cvalue.V.t and type location = Precise_locs.precise_location ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/offsm_domain.ml��������������������������������������0000666�0000000�0000000�00000020750�13571573400�021230� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval open Offsm_value let store_redundant = false (** If [true], the offsetmap domain stores information that can probably be re-synthesized from the value domain. Otherwise, we try to avoid such redundancies. Setting this variable to [true] is helpful to find unsoundnesses in the domain through testing, because many more expressions end up being handled. *) let dkey = Value_parameters.register_category "d-bitwise" module Default_offsetmap = struct open Cvalue let is_top m = V_Offsetmap.is_same_value m V_Or_Uninitialized.top let default_offsetmap b = match b with | Base.String _ -> Cvalue.Default_offsetmap.default_offsetmap b | Base.Var _ | Base.CLogic_Var _ | Base.Null | Base.Allocated _ -> let validity = Base.validity b in match V_Offsetmap.size_from_validity validity with | `Bottom -> `Bottom | `Value size -> `Value (V_Offsetmap.create_isotropic ~size V_Or_Uninitialized.top) let default_contents = Lmap.Top V_Or_Uninitialized.top let name = "Eval_Offsm.Default_offsetmap" end (** This domain ignores initialization and danglingness alarms entirely. During pretty-printing, we skip them altogether. (In fact, it should be possible to prove inductively that everything is initialized except Top, because no computation introduces initialized bits, and nothing is initially uninitialized. *) module V_Or_Uninitialized = struct include Cvalue.V_Or_Uninitialized let pretty_typ typ fmt v = let v = get_v v in if Cvalue.V.is_bottom v then Format.pp_print_string fmt "INDET" else pretty_typ typ fmt (initialized v) let pretty fmt v = pretty_typ None fmt v end module V_Offsetmap = struct include Cvalue.V_Offsetmap let pretty_generic ?typ ?pretty_v ?skip_v ?sep () fmt t = let pretty_v = Extlib.opt_conv V_Or_Uninitialized.pretty_typ pretty_v in pretty_generic ?typ ~pretty_v ?skip_v ?sep () fmt t end module Memory = struct include Lmap.Make_LOffset(V_Or_Uninitialized)(V_Offsetmap)(Default_offsetmap) let widen kf stmt s1 s2 = let wh = Widen.getWidenHints kf stmt in widen wh s1 s2 let narrow x _y = `Value x end module Internal : Domain_builder.InputDomain with type state = Memory.t and type value = offsm_or_top and type location = Precise_locs.precise_location = struct type value = offsm_or_top type state = Memory.t type location = Precise_locs.precise_location include (Memory: sig include Datatype.S_with_collections with type t = state include Abstract_domain.Lattice with type state := state end) let name = "Bitwise domain" let log_category = dkey let empty _ = Memory.empty_map let enter_scope _kf _vars state = state (* default is Top, nothing to do *) let leave_scope _kf vars state = Memory.remove_variables vars state let enter_loop _ state = state let incr_loop_counter _ state = state let leave_loop _ state = state type origin = unit (* ???? *) let kill loc state = Memory.add_binding ~exact:true state loc V_Or_Uninitialized.top module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = origin and type loc = Precise_locs.precise_location) : Abstract_domain.Transfer with type state := state and type value := offsm_or_top and type location := Precise_locs.precise_location and type valuation := Valuation.t = struct let update _valuation st = `Value st (* TODO? *) let store loc state v = let state' = match v with | Top -> kill loc state | O o -> if not store_redundant && V_Offsetmap.is_single_interval o then kill loc state else match loc.Locations.size with | Int_Base.Top -> assert false | Int_Base.Value size -> Memory.paste_offsetmap ~from:o ~dst_loc:loc.Locations.loc ~size ~exact:true state in match state' with | Memory.Bottom -> `Bottom | _ -> `Value state' let generic_assign lv value state = let loc = Precise_locs.imprecise_location lv.lloc in let v = Eval.value_assigned value in let v = match v with | `Value v -> v (* Copy of fully indeterminate bits. We could store an uninitialized bottom, or something like that. Since this would be redundant with the legacy domain, we just drop the value. *) | `Bottom -> Top in store loc state v let assign _kinstr lv _e assignment _valuation state = generic_assign lv assignment state let assume _ _ _ _ state = `Value state let finalize_call _stmt _call ~pre:_ ~post = `Value post let start_call _stmt _call valuation state = update valuation state let show_expr _valuation _state _fmt _expr = () end let extract_expr _oracle _state _exp = `Value (Offsm_value.Offsm.top, ()), Alarmset.all (* Basic 'find' on a location *) let find_loc state loc = let size = Int_Base.project loc.Locations.size in let o = Memory.copy_offsetmap loc.Locations.loc size state in o >>-: fun o -> if Default_offsetmap.is_top o || (not store_redundant && V_Offsetmap.is_single_interval o) then Offsm_value.Offsm.top else O o let extract_lval _oracle state _lv typ locs = let o = if Cil.typeHasQualifier "volatile" typ || not (Cil.isArithmeticOrPointerType typ) then `Value (Top, ()) else try let aux_loc loc o = let o' = find_loc state loc in Bottom.join Offsm_value.Offsm.join o o' in Precise_locs.fold aux_loc locs `Bottom >>-: fun v -> v, () with Abstract_interp.Error_Top -> `Value (Top, ()) in o, Alarmset.all let backward_location _state _lval _typ loc value = `Value (loc, value) let reduce_further _state _expr _value = [] (* Memexec *) let relate _kf _bases _state = Base.SetLattice.empty let filter _kf _kind bases state = Memory.filter_by_shape (Base.Hptset.shape bases) state let reuse _kf _bases ~current_input:state ~previous_output:output = let state = match output with | Memory.Bottom | Memory.Top as state -> state | Memory.Map outputs -> Memory.fold Memory.add_base outputs state in state (* Initial state *) let introduce_globals _ state = state let initialize_variable_using_type _ _ state = state let initialize_variable _ _ ~initialized:_ _ state = state (* Logic *) let logic_assign _assign location ~pre:_ state = let loc = Precise_locs.imprecise_location location in kill loc state let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ state _ _ = `Value state let storage = Value_parameters.BitwiseOffsmStorage.get end module D = Domain_builder.Complete (Internal) ������������������������frama-c-20.0-Calcium/src/plugins/value/domains/offsm_domain.mli�������������������������������������0000666�0000000�0000000�00000003327�13571573400�021402� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module D : Abstract_domain.Leaf with type value = Offsm_value.offsm_or_top and type location = Precise_locs.precise_location ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/powerset.ml������������������������������������������0000666�0000000�0000000�00000007516�13571573400�020444� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval module type Domain = sig include Abstract_domain.Lattice include Datatype.S_with_collections with type t = state end module type S = sig type state type t val empty: t val is_empty: t -> bool val singleton: state -> t val singleton': state or_bottom -> t val uncheck_add: state -> t -> t val add: state -> t -> t val add': state or_bottom -> t -> t val length: t -> int val merge: into:t -> t -> t * bool val join: ?into:state or_bottom -> t -> state or_bottom val fold: (state -> 'a -> 'a) -> t -> 'a -> 'a val iter: (state -> unit) -> t -> unit val map: (state -> state) -> t -> t val map_or_bottom: (state -> state or_bottom) -> t -> t val reorder: t -> t val of_list: state list -> t val to_list: t -> state list val pretty : Format.formatter -> t -> unit end (** Set of states, propagated through the edges by the dataflow analysis. *) module Make (Domain : Domain) = struct type state = Domain.t type t = Domain.t list let empty = [] let is_empty = function [] -> true | _ -> false let singleton s = [s] let singleton' s = match s with `Bottom -> [] | `Value s -> [s] let uncheck_add s states = s :: states let length = List.length let join ?(into=`Bottom) states = List.fold_left (fun acc v -> Bottom.join Domain.join acc (`Value v)) into states let fold f states acc = List.fold_left (fun acc s -> f s acc) acc states let iter = List.iter let map = List.map let map_or_bottom f l = let aux l d = match f d with | `Bottom -> l | `Value d' -> d' :: l in let l = List.fold_left aux [] l in List.rev l (* preserve original order *) let of_list l = l let to_list l = l exception Unchanged let add_exn v s = if (List.exists (fun e -> Domain.is_included v e) s) then raise Unchanged; v :: s let add v s = try add_exn v s with Unchanged -> s let add' v s = match v with | `Bottom -> s | `Value v -> add v s let merge ~into set = let f e (acc, unchanged) = try add_exn e acc, false with Unchanged -> acc, unchanged in fold f set (into, true) let reorder = List.rev let pretty fmt state = iter (fun s -> Format.fprintf fmt "set contains %a@\n" Domain.pretty s) state end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/powerset.mli�����������������������������������������0000666�0000000�0000000�00000004721�13571573400�020610� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval module type Domain = sig include Abstract_domain.Lattice include Datatype.S_with_collections with type t = state end module type S = sig type state type t val empty: t val is_empty: t -> bool val singleton: state -> t val singleton': state or_bottom -> t val uncheck_add: state -> t -> t val add: state -> t -> t val add': state or_bottom -> t -> t val length: t -> int val merge: into:t -> t -> t * bool val join: ?into:state or_bottom -> t -> state or_bottom val fold: (state -> 'a -> 'a) -> t -> 'a -> 'a val iter: (state -> unit) -> t -> unit val map: (state -> state) -> t -> t val map_or_bottom: (state -> state or_bottom) -> t -> t val reorder: t -> t val of_list: state list -> t val to_list: t -> state list val pretty : Format.formatter -> t -> unit end module Make (Domain: Domain) : S with type state = Domain.t �����������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/printer_domain.ml������������������������������������0000666�0000000�0000000�00000010542�13571573400�021577� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval (** An abstract domain based on Simple_Cvalue that will litterally just print what goes through it. *) module Simple : Simpler_domains.Simple_Cvalue = struct let feedback = Value_parameters.feedback ~current:true (* --- Datatype --- *) (* In this domain, the states contain nothing. We use [unit] as type formal the state and we reuse [Datatype.Unit] as a base for our domain. *) include Datatype.Unit let name = "Printer domain" (* --- Lattice operators --- *) let top = () let is_included _v1 _v2 = feedback "is_included"; true let join _v1 _v2 = feedback "join"; top let widen _kf _stmt _v1 v2 = feedback "widen"; v2 (* --- Query functions --- *) let extract_expr _state _exp = `Value (Cvalue.V.top) let extract_lval _state _lval _typ _loc = `Value (Cvalue.V.top) (* --- Transfer functions --- *) let pp_list = Pretty_utils.pp_list ~sep:",@ " let pp_cvalue fmt value = Bottom.pretty Cvalue.V.pretty fmt value let pp_cvalue_assigned fmt value = pp_cvalue fmt (Eval.value_assigned value) let pp_arg fmt arg = Format.fprintf fmt "%a = %a" Printer.pp_exp arg.concrete pp_cvalue_assigned arg.avalue let assign _kinstr loc exp cvalue_assigned _valuation state = feedback "assign %a with %a = %a" Printer.pp_lval loc.lval Printer.pp_exp exp pp_cvalue_assigned cvalue_assigned; `Value state let assume _stmt exp truth _valuation state = feedback "assume %a is %b" Printer.pp_exp exp truth; `Value state let start_call _stmt call _valuation state = feedback "start call %s(%a)" (Kernel_function.get_name call.kf) (pp_list pp_arg) call.arguments; state let finalize_call _stmt call ~pre:_ ~post = feedback "finalize call to %s" (Kernel_function.get_name call.kf); `Value post (* --- Initialization of variables --- *) let pp_vi_list fmt l = pp_list Printer.pp_varinfo fmt l let pp_init_val fmt = function | Abstract_domain.Zero -> Format.fprintf fmt "0" | Abstract_domain.Top -> Format.fprintf fmt "Top" let empty () = feedback "empty"; () let introduce_globals vi_list state = feedback "introduce_globals %a" pp_vi_list vi_list; state let initialize_variable lval ~initialized:_ init state = feedback "initialize_variable %a with %a" Printer.pp_lval lval pp_init_val init; state let enter_scope _kf vi_list state = feedback "enter_scope %a" pp_vi_list vi_list; state let leave_scope _kf vi_list state = feedback "leave_scope %a" pp_vi_list vi_list; state (* --- Pretty printer --- *) let show_expr _state _fmt exp = feedback "show_expr %a" Printer.pp_exp exp end include Domain_builder.Complete_Simple_Cvalue (Simple) ��������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/printer_domain.mli�����������������������������������0000666�0000000�0000000�00000003616�13571573400�021754� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** An abstract domain built on top of the Simpler_domains.Simple_Cvalue interface that just prints the transfer functions called by the engine during an analysis. *) include Abstract_domain.Leaf with type value = Cvalue.V.t and type location = Precise_locs.precise_location ������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/sign_domain.ml���������������������������������������0000666�0000000�0000000�00000003711�13571573400�021054� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Sign_Value = struct include Sign_value (* In this domain, we only track integer variables. *) let track_variable vi = Cil.isIntegralType vi.vtype (* The base lattice is finite, we can use join to perform widening *) let widen = join let builtins = [] end include Simple_memory.Make_Domain (struct let name = "sign" end) (Sign_Value) �������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/sign_domain.mli��������������������������������������0000666�0000000�0000000�00000003427�13571573400�021231� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Abstraction of the sign of integer variables. *) include Abstract_domain.Leaf with type value = Sign_value.t and type location = Precise_locs.precise_location �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/simple_memory.ml�������������������������������������0000666�0000000�0000000�00000031640�13571573400�021450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval type 'value builtin = 'value list -> 'value or_bottom module type Value = sig include Datatype.S val top : t val join : t -> t -> t val widen : t -> t -> t val narrow : t -> t -> t or_bottom val is_included : t -> t -> bool val track_variable: Cil_types.varinfo -> bool val pretty_debug: t Pretty_utils.formatter val builtins: (string * t builtin) list end module type S = sig type t type value val add: Precise_locs.precise_location -> Cil_types.typ -> value -> t -> t val find: Precise_locs.precise_location -> Cil_types.typ -> t -> value val remove: Precise_locs.precise_location -> t -> t val remove_variables: Cil_types.varinfo list -> t -> t val fold: (Base.t -> value -> 'a -> 'a) -> t -> 'a -> 'a end module Make_Memory (Value: Value) = struct module Initial_Values = struct let v = [] end module Deps = struct let l = [Ast.self] end include Hptmap.Make (Base) (Value)(Hptmap.Comp_unused) (Initial_Values) (Deps) let cache_name s = Hptmap_sig.PersistentCache ("Value." ^ Value.name ^ "." ^ s) let narrow = let module E = struct exception Bottom end in let cache = cache_name "narrow" in let decide _ v1 v2 = match Value.narrow v1 v2 with | `Bottom -> raise E.Bottom | `Value v -> v in fun a b -> try `Value (join ~cache ~symmetric:true ~idempotent:true ~decide a b) with E.Bottom -> `Bottom let join = let cache = cache_name "join" in let decide _ v1 v2 = let r = Value.join v1 v2 in if Value.(equal top r) then None else Some r in inter ~cache ~symmetric:true ~idempotent:true ~decide let widen = let cache = cache_name "widen" in let decide _ b1 b2 = let r = Value.widen b1 b2 in if Value.(equal top r) then None else Some r in inter ~cache ~symmetric:false ~idempotent:true ~decide let is_included = let cache = cache_name "is_included" in let decide_fst _b _v1 = true (* v2 is top *) in let decide_snd _b _v2 = false (* v1 is top, v2 is not *) in let decide_both _ v1 v2 = Value.is_included v1 v2 in let decide_fast s t = if s == t then PTrue else PUnknown in binary_predicate cache UniversalPredicate ~decide_fast ~decide_fst ~decide_snd ~decide_both let top = empty type loc_for_base = Precise | Imprecise (* Checks whether the offset [o] and the size [size] corresponds to the tracked location for [b]. The conditions are as follow: - the variable corresponding to [b] is not volatile. - the variable corresponding to [b] must be tracked. - the location must assign the entire variable. - the type of the variable matches [typ]. *) let covers_base b o size typ = match b with | Base.Var (vi, Base.Known (_, max)) -> (* "standard" varinfos only *) if not (Cil.typeHasQualifier "volatile" vi.vtype) && Value.track_variable vi && Cil_datatype.Typ.equal typ vi.vtype && Ival.is_zero o && (match size with | Int_Base.Value size -> Integer.equal size (Integer.succ max) | Int_Base.Top -> false) then Precise else Imprecise | _ -> Imprecise let find_or_top b state = try find b state with Not_found -> Value.top let add loc typ v state = let open Locations in let {loc; size} = Precise_locs.imprecise_location loc in (* exact means that the location is precise and that we can perform a strong update. *) let exact = Location_Bits.cardinal_zero_or_one loc in let aux_base b o state = match covers_base b o size typ with | Precise -> (* The location exactly matches [b]: we are able to store the result. If the location is not exact, performs a weak update: join [v] with the current value for [b]. *) let v = if exact then v else Value.join v (find_or_top b state) in (* Store the new value unless it is top. In this case, drop it for canonicity. *) if Value.(equal v top) then remove b state else add b v state | Imprecise -> remove b state in try Location_Bits.fold_topset_ok aux_base loc state with Abstract_interp.Error_Top -> empty let remove_variables vars state = let remove_variable state v = remove (Base.of_varinfo v) state in List.fold_left remove_variable state vars let remove loc state = let loc = Precise_locs.imprecise_location loc in Locations.(Location_Bits.fold_bases remove loc.loc state) let find loc typ state = let open Locations in let {loc; size} = Precise_locs.imprecise_location loc in let aux_base b o r = (* We degenerate to Top as soon as we find an imprecise location, or a base which is not bound in the map. *) match covers_base b o size typ with | Precise -> Bottom.join Value.join r (`Value (find_or_top b state)) | Imprecise -> `Value Value.top in try match Location_Bits.fold_topset_ok aux_base loc `Bottom with | `Bottom -> Value.top (* does not happen if the location is not empty *) | `Value v -> v with Abstract_interp.Error_Top -> Value.top end module Make_Internal (Info: sig val name: string end) (Value: Value) = struct let table = Hashtbl.create 17 let () = List.iter (fun (name, f) -> Hashtbl.replace table name f) Value.builtins let find_builtin name = try Some (Hashtbl.find table name) with Not_found -> None include Make_Memory (Value) let name = Info.name type state = t type value = Value.t type location = Precise_locs.precise_location let log_category = Value_parameters.register_category ("d-" ^ Info.name) let widen _kf _stmt = widen (* This function returns the information known about the location corresponding to [_lv], so that it may be used by the engine during evaluation. *) let extract_lval _oracle state _lv typ loc = let v = find loc typ state in `Value (v, ()), Alarmset.all let extract_expr _oracle _state _expr = `Value (Value.top, ()), Alarmset.all let backward_location state _lval typ loc _value = let new_value = find loc typ state in `Value (loc, new_value) let reduce_further _state _expr _value = [] type origin = unit module Transfer (Valuation: Abstract_domain.Valuation with type value := value and type origin := origin and type loc := location) = struct (* This function binds [loc] to [v], of type [typ], in [state]. [v] can be [`Bottom], which means that its contents are guaranteed to be indeterminate (e.g. unitialized data). *) let bind_loc loc typ v state = match v with (* We are adding a "good" value. Store it in the state. *) | `Value v -> add loc typ v state (* Indeterminate value. Drop the information known for loc. *) | `Bottom -> remove loc state (* This function updates [state] with information for [expr], only possible when it is an lvalue. In this case, we can update the corresponding location with the result of the evaluation of [exp]. Both the value and the location are found in the [valuation]. *) let assume_exp valuation expr record state = match expr.enode with | Lval lv -> begin match Valuation.find_loc valuation lv with | `Top -> state | `Value {loc; typ} -> if Precise_locs.cardinal_zero_or_one loc then bind_loc loc typ record.value.v state else state end | _ -> state (* This function fills [state] according to the information available in [valuation]. This information is computed by Eva's engine for all the expressions involved in the current statement. *) let assume_valuation valuation state = Valuation.fold (assume_exp valuation) valuation state (* Abstraction of an assignment. *) let assign _kinstr lv _expr value valuation state = (* Update the state with the information obtained from evaluating [lv] and [e] *) let state = assume_valuation valuation state in (* Extract the abstract value *) let value = Eval.value_assigned value in (* Store the information [lv = e;] in the state *) let state = bind_loc lv.lloc lv.ltyp value state in `Value state let update valuation state = `Value (assume_valuation valuation state) (* Abstraction of a conditional. All information inferred by the engine is present in the valuation, and must be stored in the memory abstraction of the domain itself. *) let assume _stmt _expr _pos = update let start_call _stmt call _valuation state = let bind_argument state argument = let typ = argument.formal.vtype in let loc = Main_locations.PLoc.eval_varinfo argument.formal in let value = Eval.value_assigned argument.avalue in bind_loc loc typ value state in let state = List.fold_left bind_argument state call.arguments in `Value state let finalize_call _stmt call ~pre:_ ~post = let kf_name = Kernel_function.get_name call.kf in match find_builtin kf_name, call.return with | None, _ | _, None -> `Value post | Some f, Some return -> let extract_value arg = Eval.value_assigned arg.avalue in let args = List.map extract_value call.arguments in if List.exists (function `Bottom -> true | `Value _ -> false) args then `Bottom else let args = List.map Bottom.non_bottom args in f args >>-: fun result -> let return_loc = Main_locations.PLoc.eval_varinfo return in bind_loc return_loc return.vtype (`Value result) post let show_expr valuation state fmt expr = match expr.enode with | Lval lval -> begin match Valuation.find_loc valuation lval with | `Top -> () | `Value {loc; typ} -> Value.pretty fmt (find loc typ state) end | _ -> () end let enter_scope _kf _vars state = state let leave_scope _kf vars state = remove_variables vars state let enter_loop _ state = state let incr_loop_counter _ state = state let leave_loop _ state = state let logic_assign _assign location ~pre:_ state = remove location state let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ state _ _ = `Value state let empty () = top let introduce_globals _varinfos state = state let initialize_variable _lval _location ~initialized:_ _value state = state let initialize_variable_using_type _kind _varinfo state = state let relate _kf _bases _state = Base.SetLattice.empty let filter _kf _kind bases state = filter (fun elt -> Base.Hptset.mem elt bases) state let reuse _kf bases ~current_input ~previous_output = let cache = Hptmap_sig.NoCache in let decide_both _key _v1 v2 = Some v2 in let decide_left key v1 = if Base.Hptset.mem key bases then None else Some v1 in merge ~cache ~symmetric:false ~idempotent:true ~decide_both ~decide_left:(Traversing decide_left) ~decide_right:Neutral current_input previous_output let storage () = true end module Make_Domain (Info: sig val name: string end) (Value: Value) = struct module M = Make_Internal (Info) (Value) include Domain_builder.Complete (M) let add = M.add let find = M.find let remove = M.remove let remove_variables = M.remove_variables let fold = M.fold end ������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/simple_memory.mli������������������������������������0000666�0000000�0000000�00000011322�13571573400�021614� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Simple memory abstraction for scalar non-volatile variables, built upon a value abstraction. Basically a map from variable to values. *) (** A builtin is an ocaml function for the interpretation of a whole C function: it takes the list of value arguments, and returns the result (that can be bottom). *) type 'value builtin = 'value list -> 'value Eval.or_bottom (** Abstraction of the values variables are mapped to. *) module type Value = sig include Datatype.S (** Lattice structure. *) val top : t val join : t -> t -> t val widen : t -> t -> t val narrow : t -> t -> t Eval.or_bottom val is_included : t -> t -> bool (** This function must return [true] if the given variable should be tracked by the domain. All untracked variables are implicitely mapped to [V.top]. *) val track_variable: Cil_types.varinfo -> bool (** Can be equal to {!pretty} *) val pretty_debug: t Pretty_utils.formatter (** A list of builtins for the domain: each builtin is associated with the name of the C function it interprets. *) val builtins: (string * t builtin) list end (** Signature of a simple memory abstraction for scalar variables. *) module type S = sig type t type value (** [add loc typ v state] binds [loc] to [v] in state. If [typ] does not match the effective type of the location pointed, [V.top] is bound instead. This function automatically handles the case where [loc] abstracts multiple locations, or when some locations are not tracked by the domain. *) val add: Precise_locs.precise_location -> Cil_types.typ -> value -> t -> t (** [find loc typ state] returns the join of the abstract values stored in the locations abstracted to by [loc] in [state], assuming the result has type [typ]. When [loc] includes untracked locations, or when [typ] does not match the type of the locations in [loc], the result is approximated. *) val find: Precise_locs.precise_location -> Cil_types.typ -> t -> value (** [remove loc state] drops all information on the locations pointed to by [loc] from [state]. *) val remove: Precise_locs.precise_location -> t -> t (** [remove_variables list state] drops all information about the variables in [list] from state. *) val remove_variables: Cil_types.varinfo list -> t -> t (** Fold on base value pairs. *) val fold: (Base.t -> value -> 'a -> 'a) -> t -> 'a -> 'a end (* Builds a memory from a value abstraction. *) module Make_Memory (Value: Value) : sig include Datatype.S_with_collections include S with type t := t and type value := Value.t val top: t (** The top abstraction, which maps all variables to {!V.top}. *) val join: t -> t -> t val widen: t -> t -> t val is_included: t -> t -> bool end (* Builds a complete Eva domain from a value abstraction. *) module Make_Domain (Info: sig val name: string end) (Value: Value) : sig include Abstract_domain.Leaf with type value = Value.t and type location = Precise_locs.precise_location include S with type t := t and type value := Value.t end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/simpler_domains.mli����������������������������������0000666�0000000�0000000�00000013317�13571573400�022126� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Simplified interfaces for abstract domains. Complete abstract domains can be built from these interfaces through the functors in {!Domain_builder}. More documentation can be found on the complete interface of abstract domains, in {!Abstract_domain}. *) open Cil_types open Eval (** Both the formal argument of a called function and the concrete argument at a call site. *) type simple_argument = { formal: varinfo; concrete: exp; } (** Simple information about a function call. *) type simple_call = { kf: kernel_function; (* The called function. *) arguments: simple_argument list; (* The list of arguments of the call. *) rest: exp list; (* Extra arguments. *) return: varinfo option; (* Fake varinfo where the result of the call is stored. *) recursive: bool; (* Is the call recursive? *) } (** Simplest interface for an abstract domain. No exchange of information with the other abstractions of Eva. *) module type Minimal = sig type t val name: string val compare: t -> t -> int val hash: t -> int (** Lattice structure. *) val top: t val is_included: t -> t -> bool val join: t -> t -> t val widen: kernel_function -> stmt -> t -> t -> t (** Transfer functions. *) val assign: kinstr -> lval -> exp -> t -> t or_bottom val assume: stmt -> exp -> bool -> t -> t or_bottom val start_call: stmt -> simple_call -> t -> t val finalize_call: stmt -> simple_call -> pre:t -> post:t -> t or_bottom (** Initialization of variables. *) val empty: unit -> t val introduce_globals: varinfo list -> t -> t val initialize_variable: lval -> initialized:bool -> Abstract_domain.init_value -> t -> t val enter_scope: kernel_function -> varinfo list -> t -> t val leave_scope: kernel_function -> varinfo list -> t -> t (** Pretty printers. *) val pretty: Format.formatter -> t -> unit val show_expr: t -> Format.formatter -> exp -> unit end (** The simplest interface of domains, equipped with a frama-c datatype. *) module type Minimal_with_datatype = sig include Minimal include Datatype.S with type t := t end (** A simpler functional interface for valuations. *) type cvalue_valuation = { find: exp -> Cvalue.V.t flagged_value or_top; find_loc: lval -> Precise_locs.precise_location or_top } type precise_loc = Precise_locs.precise_location type cvalue = Cvalue.V.t (** A simple interface allowing the abstract domain to use the value and location abstractions computed by the other domains. Only the {!Cvalue.V} and the the {!Precise_locs} abstractions are available in this interface, on the transfer functions for assignment, assumption and at the call sites. On the other hand, the abstract domain cannot assist the computation of these value and location abstractions. The communication is thus unidirectional, from other domains to these simpler domains. *) module type Simple_Cvalue = sig include Datatype.S (** Lattice structure. *) val top: t val is_included: t -> t -> bool val join: t -> t -> t val widen: kernel_function -> stmt -> t -> t -> t (** Query functions. *) val extract_expr: t -> exp -> cvalue or_bottom val extract_lval: t -> lval -> typ -> precise_loc -> cvalue or_bottom (** Transfer functions. *) val assign: kinstr -> Precise_locs.precise_location left_value -> exp -> (precise_loc, cvalue) assigned -> cvalue_valuation -> t -> t or_bottom val assume: stmt -> exp -> bool -> cvalue_valuation -> t -> t or_bottom val start_call: stmt -> (precise_loc, cvalue) call -> cvalue_valuation -> t -> t val finalize_call: stmt -> (precise_loc, cvalue) call -> pre:t -> post:t -> t or_bottom (** Initialization of variables. *) val empty: unit -> t val introduce_globals: varinfo list -> t -> t val initialize_variable: lval -> initialized:bool -> Abstract_domain.init_value -> t -> t val enter_scope: kernel_function -> varinfo list -> t -> t val leave_scope: kernel_function -> varinfo list -> t -> t (** Pretty printer. *) val show_expr: t -> Format.formatter -> exp -> unit end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/symbolic_locs.ml�������������������������������������0000666�0000000�0000000�00000060712�13571573400�021432� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval open Locations let dkey = Value_parameters.register_category "d-symblocs" module K = Hcexprs module V = Cvalue.V (* TODO: functorize (with locations too ?) *) (* Map from expressions/lvalues to abstract values *) module K2V = struct module M = Hptmap.Make(K.HCE)(V)(Hptmap.Comp_unused) (struct let v = [] end)(struct let l = [Ast.self] end) include M let cache_prefix = "Value.Symbolic_locs.K2V" let join = (* Missing keys are bound to top -> use inter as base function *) let cache_name = cache_prefix ^ ".join" in let cache = Hptmap_sig.PersistentCache cache_name in let symmetric = true in let idempotent = true in let decide _ v1 v2 = Some (V.join v1 v2) in M.inter ~cache ~symmetric ~idempotent ~decide let widen = let cache = Hptmap_sig.NoCache in let symmetric = false in let idempotent = true in let wh = Integer.zero, (fun _b -> Ival.Widen_Hints.empty, Fc_float.Widen_Hints.empty) in let decide _ v1 v2 = Some (V.widen wh v1 v2) in M.inter ~cache ~symmetric ~idempotent ~decide let _narrow = let module E = struct exception Bottom end in let cache_name = cache_prefix ^ ".narrow" in let cache = Hptmap_sig.PersistentCache cache_name in let symmetric = true in let idempotent = true in let decide _ v1 v2 = let v = V.narrow v1 v2 in if V.is_bottom v then raise E.Bottom else v in fun a b -> try `Value (M.join ~cache ~symmetric ~idempotent ~decide a b) with E.Bottom -> `Bottom let merge = let cache_name = cache_prefix ^ ".join" in let cache = Hptmap_sig.PersistentCache cache_name in let decide _ _ _ = assert false in M.join ~cache ~symmetric:true ~idempotent:false ~decide let is_included = let cache_name = cache_prefix ^ ".is_included" in let decide_fst _b _v1 = true (* v2 is top *) in let decide_snd _b _v2 = false (* v1 is top, v2 should not be *) in let decide_both _ v1 v2 = V.is_included v1 v2 in let decide_fast s t = (* All bases present in s but not in t are implicitly bound to Top in t, so an empty t implies that the inclusion holds. *) if s == t || M.is_empty t then M.PTrue else M.PUnknown in M.binary_predicate (Hptmap_sig.PersistentCache cache_name) M.UniversalPredicate ~decide_fast ~decide_fst ~decide_snd ~decide_both (* Return the subtrees of the left map whose keys are *not* present in the right map. Values are ignored *) let only_in_left = let cache_name = cache_prefix ^ ".only_left" in let cache = Hptmap_sig.PersistentCache cache_name in let symmetric = false in let idempotent = false in let decide_both _ _ _ = None in let decide_left = M.Neutral in let decide_right = M.Absorbing in M.merge ~cache ~symmetric ~idempotent ~decide_both ~decide_left ~decide_right end (* (* not used for now: too costly *) let rec interesting_exp (e: exp) = match e.enode with | Const _ | SizeOf _ | SizeOfStr _ | SizeOfE _ | AlignOf _ | AlignOfE _ | StartOf _ | AddrOf _ -> false | Lval lv -> true | CastE (_,e) | UnOp (_,e,_) | Info (e,_) -> interesting_exp e | BinOp (op,e1,e2,_) -> match op with | Eq | Ne | Le | Ge | Lt | Gt -> false | _ -> interesting_exp e1 || interesting_exp e2 *) (* computes whether an expression depends on a location with an imprecise location *) let rec multiple_loc_exp get_locs (e: exp) = match e.enode with | Const _ | SizeOf _ | SizeOfStr _ | SizeOfE _ | AlignOf _ | AlignOfE _ | StartOf _ | AddrOf _ -> false | Lval lv -> not (Precise_locs.cardinal_zero_or_one (get_locs lv)) | CastE (_,e) | UnOp (_,e,_) | Info (e,_) -> multiple_loc_exp get_locs e | BinOp (_,e1,e2,_) -> multiple_loc_exp get_locs e1 || multiple_loc_exp get_locs e2 let is_cond exp = match exp.enode with | BinOp ((Eq | Ne | Le | Ge | Lt | Gt), _, _, _) -> true | _ -> false (* Locals and formals syntactically present in an expression or lvalue *) let rec vars_lv (h, o) = Base.Set.union (vars_host h) (vars_offset o) and vars_exp (e: exp) = match e.enode with | Const _ | SizeOf _ | AlignOf _ | SizeOfStr _ -> Base.Set.empty | AddrOf lv | StartOf lv | Lval lv -> vars_lv lv | SizeOfE e | AlignOfE e | CastE (_,e) | UnOp (_,e,_) | Info (e,_) -> vars_exp e | BinOp (_,e1,e2,_) -> Base.Set.union (vars_exp e1) (vars_exp e2) and vars_host = function | Var vi -> (* Global variables never go out of scope, no need to track them *) if vi.vglob then Base.Set.empty else Base.(Set.singleton (of_varinfo vi)) | Mem e -> vars_exp e and vars_offset = function | NoOffset -> Base.Set.empty | Field (_, o) -> vars_offset o | Index (e, o) -> Base.Set.union (vars_exp e) (vars_offset o) (* Legacy names *) module B2K = K.BaseToHCESet module K2Z = K.HCEToZone module Memory = struct (* This is the abstract state for the 'Symbolic location' domains *) type memory = { values: K2V.t (* map from expressions/lvalues to their abstract value *); zones: K2Z.t (* map from expressions/lvalues to the memory location they depend on *); deps: B2K.t (* map from bases to the expressions/lvalues that depend on them according to [zones] *); syntactic_deps: B2K.t (* map from bases to the expressions/lvalues that syntactically refer to them *); } (* Invariants: [values] and [zones] have exactly the same keys. [deps] and [syntactic_deps] are caches that can be rebuilt from [values] and [vars_exp/lv] for [syntactic_deps], and from [zones] for [deps]. *) include Datatype.Make_with_collections(struct include Datatype.Serializable_undefined type t = memory let name = "Value.Symbolic_locs.Memory.t" let reprs = [ { values = List.hd K2V.M.reprs; zones = List.hd K2Z.reprs; deps = List.hd B2K.reprs; syntactic_deps = List.hd B2K.reprs; } ] let structural_descr = Structural_descr.t_record [| K2V.packed_descr; K2Z.packed_descr; B2K.packed_descr; B2K.packed_descr; |] let compare m1 m2 = let c = K2V.compare m1.values m2.values in if c <> 0 then c else K2Z.compare m1.zones m2.zones let equal = Datatype.from_compare let pretty fmt m = Format.fprintf fmt "@[<v>V: @[%a@]@ Z: @[%a@]@ I: @[%a@]@ S: @[%a@]@]" K2V.M.pretty m.values K2Z.pretty m.zones B2K.pretty m.deps B2K.pretty m.syntactic_deps let hash m = Hashtbl.hash (K2V.hash m.values, K2Z.hash m.zones) let copy c = c end) let top = { values = K2V.M.empty; zones = K2Z.empty; deps = B2K.empty; syntactic_deps = B2K.empty; } let empty_map = top let is_included m1 m2 = K2V.is_included m1.values m2.values && K2Z.is_included m1.zones m2.zones (* No need to check the two other fields, that are only inverse mappings from the first two ones *) (* bases on which a Cvalue.V depends *) let v_deps v = let aux b acc = let add = match b with | Base.Var (vi, _) -> not vi.vglob | Base.Allocated _ -> true (* can be freed. TODO: handle free *) | Base.Null | Base.CLogic_Var _ -> false (* does not appear yet *) | Base.String _ -> false (* can be seen as a global*) in if add then Base.Set.add b acc else acc in V.fold_bases aux v Base.Set.empty let key_deps k = match K.HCE.get k with | K.E e -> vars_exp e | K.LV lv -> vars_lv lv let add_deps k v z state = let add_dep b deps = let s = B2K.find_default b deps in let s' = K.HCESet.add k s in B2K.add b s' deps in let deps = Zone.fold_bases add_dep z state.deps in let bases = Base.Set.union (key_deps k) (v_deps v) in let syntactic_deps = Base.Set.fold add_dep bases state.syntactic_deps in { state with deps; syntactic_deps } (* Auxiliary function that add [k] to [state]. [v] is the value bound to [k], [z] the dependency information. *) let add_key k v z state = let values = K2V.add k v state.values in let zones = K2Z.add k z state.zones in try add_deps k v z { state with values; zones } with Abstract_interp.Error_Top (* unknown dependencies *) -> state (* rebuild the state from scratch, especially [deps] and [syntactic_deps]. For debugging purposes. *) let rebuild state = let aux k v acc = let z = try K2Z.find k state.zones with Not_found -> Value_parameters.abort "Missing zone for %a@.%a" K.HCE.pretty k pretty state in add_deps k v z acc in let state = { state with deps = B2K.empty; syntactic_deps = B2K.empty } in K2V.fold aux state.values state (* check that a state is correct w.r.t. the invariants on [deps] and [syntactic_deps]. *) let _check state = assert (equal state (rebuild state)) (* inverse operation of [add_key] *) let remove_key k state = try let v = K2V.find k state.values in let values = K2V.remove k state.values in let zones = K2Z.remove k state.zones in let aux_deps b d = let set_b = try B2K.find b d with Not_found -> assert false in let set_b' = K.HCESet.remove k set_b in if K.HCESet.is_empty set_b' then B2K.remove b d else B2K.add b set_b' d in (* there exists a dependency associated to k because d(values)=d(zones) *) let z = try K2Z.find k state.zones with Not_found -> assert false in let deps = Zone.fold_bases aux_deps z state.deps in let syn_deps = Base.Set.union (key_deps k) (v_deps v) in let syntactic_deps = Base.Set.fold aux_deps syn_deps state.syntactic_deps in { values; zones; deps; syntactic_deps } with Not_found -> state let remove_keys keys state = K.HCESet.fold remove_key keys state let join m1 m2 = if K2V.equal m1.values m2.values && K2Z.equal m1.zones m2.zones then m1 else let remove_m1 = K2V.only_in_left m1.values m2.values in let remove_m2 = K2V.only_in_left m2.values m1.values in let m1 = K2V.fold (fun k _ m -> remove_key k m) remove_m1 m1 in let m2 = K2V.fold (fun k _ m -> remove_key k m) remove_m2 m2 in { values = K2V.join m1.values m2.values; zones = K2Z.union m1.zones m2.zones; deps = B2K.union m1.deps m2.deps; syntactic_deps = B2K.union m1.syntactic_deps m2.syntactic_deps; } let widen _kf _wh m1 m2 = if K2V.equal m1.values m2.values && K2Z.equal m1.zones m2.zones then m1 else { m2 with values = K2V.widen m1.values m2.values } (* TODO *) let narrow m1 _m2 = `Value m1 (* ------------------------------------------------------------------------ *) (* --- High-level functions --- *) (* ------------------------------------------------------------------------ *) (* fold on all the keys of [state] overwritten when [z] is written *) let fold_overwritten f state z acc = (* Check if [k] is overwritten *) let aux_key k acc = try let z_k = K2Z.find k state.zones in if Zone.intersects z z_k then f k acc else acc with Not_found -> acc in (* Check the keys overwritten among those depending on [b] *) let aux_base b acc = let keys = B2K.find_default b state.deps in K.HCESet.fold aux_key keys acc in try (* Check all the keys overwritten *) Zone.fold_bases aux_base z acc with Abstract_interp.Error_Top -> top (* remove the keys that depend on the variables in [l] *) let remove_variables l state = let aux_vi state vi = let b = Base.of_varinfo vi in let keys = B2K.find_default b state.syntactic_deps in remove_keys keys state in List.fold_left aux_vi state l let kill loc state = let z = Locations.(enumerate_valid_bits Read loc) in fold_overwritten remove_key state z state (* Add the the mapping [lv --> v] to [state] when possible. [get_z] is a function that computes dependencies. *) let add_lv state get_z lv v = if Eval_typ.lval_contains_volatile lv then state else let k = K.HCE.of_lval lv in let z_lv = Precise_locs.enumerate_valid_bits Locations.Read (get_z lv) in let z_lv_indirect = Value_util.indirect_zone_of_lval get_z lv in if Locations.Zone.intersects z_lv z_lv_indirect then (* The location of [lv] intersects with the zones needed to compute itself, the equality would not hold. *) state else let z = Zone.join z_lv z_lv_indirect in add_key k v z state (* Add the mapping [e --> v] to [state] when possible and useful. [get_z] is a function that computes dependencies. *) let add_exp state get_z e v = if Eval_typ.expr_contains_volatile e then state else let k = K.HCE.of_exp e in let z = Value_util.zone_of_expr get_z e in add_key k v z state let find k state = try Some (K2V.find k state.values) with Not_found -> None let find_lval lv state = find (K.HCE.of_lval lv) state let find_expr expr state = find (K.HCE.of_exp expr) state (* [gather_keys bases t] returns the set of keys bound to a base in [bases] in [t.deps] or [t.syntactic_deps]. *) let gather_keys = let fold2 = B2K.fold2_join_heterogeneous ~cache:Hptmap_sig.NoCache ~empty_left:(fun _ -> K.HCESet.empty) ~empty_right:(fun _ -> K.HCESet.empty) ~both:(fun _ keys _ -> keys) ~join:K.HCESet.union ~empty:K.HCESet.empty in fun bases t -> let shape = Base.Hptset.shape bases in K.HCESet.union (fold2 t.syntactic_deps shape) (fold2 t.deps shape) (* Projects a state [t] onto the set of bases [bases]; used by MemExec to efficiently compare different entry states for a function analysis. Dependencies are left empty, as they are redundant with the [values] and [zones] map – they could be rebuilt from the zones map. The maps produced by [filter] should never be propagated, and a proper map is rebuild by [reuse] if needed. *) let filter bases t = let keys = gather_keys bases t in let key_shape = K.HCESet.shape keys in let zones = K2Z.inter_with_shape key_shape t.zones in let values = K2V.inter_with_shape key_shape t.values in { values; zones; deps = B2K.empty; syntactic_deps = B2K.empty } (* Removes from [t] all information about keys whose dependencies intersect the set of bases [bases]. Note that dependencies are not minimal in the result. *) let diff bases t = let keys = gather_keys bases t in let key_shape = K.HCESet.shape keys in let values = K2V.diff_with_shape key_shape t.values in let zones = K2Z.diff_with_shape key_shape t.zones in let base_shape = Base.Hptset.shape bases in let deps = B2K.diff_with_shape base_shape t.deps in let syntactic_deps = B2K.diff_with_shape base_shape t.syntactic_deps in { values; zones; deps; syntactic_deps } (* Merges all properties from [t] into [into]. *) let merge ~into t = { values = K2V.merge into.values t.values; zones = K2Z.merge ~into:into.zones t.zones; deps = B2K.union into.deps t.deps; syntactic_deps = B2K.union into.syntactic_deps t.syntactic_deps } end module Internal : Domain_builder.InputDomain with type state = Memory.t and type value = V.t and type location = Precise_locs.precise_location = struct type state = Memory.t type value = V.t type location = Precise_locs.precise_location include (Memory: sig include Datatype.S_with_collections with type t = state include Abstract_domain.Lattice with type state := state end) let name = "Symbolic locations domain" let log_category = dkey let empty _ = Memory.empty_map let enter_scope _kf _vars state = state let leave_scope _kf vars state = (* removed variables revert implicitly to Top *) Memory.remove_variables vars state let enter_loop _ state = state let incr_loop_counter _ state = state let leave_loop _ state = state type origin = unit module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = origin and type loc = Precise_locs.precise_location) : Abstract_domain.Transfer with type state := state and type value := V.t and type location := Precise_locs.precise_location and type valuation := Valuation.t = struct (* build a [get_locs] function from a valuation *) let get_locs valuation = fun lv -> let r = match Valuation.find_loc valuation lv with | `Top -> Precise_locs.loc_top | `Value loc -> loc.Eval.loc in if Precise_locs.(equal_loc loc_top r) then Value_parameters.fatal "Unknown location for %a" Printer.pp_lval lv else r (* update the state according to the information known in the valuation. Important, because on statements such as [if (t[i] + j <= 3)], the interesting information on [t[i]] is only in the valuation. *) let update valuation state = let aux e r state = let v = r.value in (* TODO: incorporate DB criterion: only expressions that are immediate lvalues, or that embed two non-singleton lvalues for the first time. *) match r.reductness, v.v, v.initialized, v.escaping with | (Created | Reduced), `Value v, true, false -> if not (is_cond e) && multiple_loc_exp (get_locs valuation) e then begin let k = K.HCE.of_exp e in (* remove the existing binding: the key may already be in the state, and [add_exp] assumes it is not the case. The new dependencies may not be the same (in rare cases where one dependency has disappeared by reduction), so we need to update the dependency inverse maps. *) (* TODO: it would be more efficient to use a function that compares the previous and current dependencies, and update the inverse maps accordingly. *) let state = Memory.remove_key k state in Memory.add_exp state (get_locs valuation) e v end else state | _ -> state in `Value (Valuation.fold aux valuation state) let store_value valuation lv loc state v = let loc = Precise_locs.imprecise_location loc in (* Remove the keys that are overwritten because [loc] is written *) let state = Memory.kill loc state in if Locations.cardinal_zero_or_one loc then (* Stored by the standard domain. Skip *) `Value state else (* Add the new binding *) `Value (Memory.add_lv state (get_locs valuation) lv v) (* Assume we may be copying indeterminate bits. Kill existing information *) let store_indeterminate state loc = let loc = Precise_locs.imprecise_location loc in `Value (Memory.kill loc state) let store_copy valuation lv loc state fv = if Cil.isArithmeticOrPointerType lv.ltyp then match fv.v, fv.initialized, fv.escaping with | `Value v, true, false -> store_value valuation lv.lval loc state v | _ -> store_indeterminate state loc else store_indeterminate state loc (* perform [lv = e] in [state] *) let assign _kinstr lv _e v valuation state = update valuation state >>- fun state -> match v with | Copy (_, vc) -> store_copy valuation lv lv.lloc state vc | Assign v -> store_value valuation lv.lval lv.lloc state v let assume _stmt _exp _pos valuation state = update valuation state let start_call _stmt _call valuation state = update valuation state let finalize_call _stmt _call ~pre:_ ~post = `Value post let show_expr _valuation _state _fmt _expr = () end let top_query = `Value (V.top, ()), Alarmset.all (* For extraction functions, if we have an information about the value, this means that the key has been evaluated in all the paths that reach this point. Hence, the alarms have already been emitted, and we can return [Alarmset.none]. *) let extract_expr _oracle state expr = match Memory.find_expr expr state with | None -> top_query | Some v -> `Value (v, ()), Alarmset.none let extract_lval _oracle state lv _typ _locs = match Memory.find_lval lv state with | None -> top_query | Some v -> `Value (v, ()), Alarmset.none let backward_location _state _lval _typ loc value = (* Nothing to do. We could check if [[lval]] intersects [value] and return [`Bottom] if it is not the case, but we have already supplied [[lval]] during the forward propagation, so the intersection is probably always non-empty. *) `Value (loc, value) let reduce_further _state _expr _value = [] (*Nothing intelligent to suggest*) (* Memexec: the symbolic locations domain is relational, as it may infer a value for an expression or lvalue involving two different variables. However, such values are only used when the expression or lvalue is evaluated as it is: during the analysis of f, this domain cannot relate by itself a variable read or written by f to a variable that is not. *) let relate _kf _bases _state = Base.SetLattice.empty let filter _kf _kind = Memory.filter (* Efficient version of [reuse], but the resulting state does not satisfy the [_check state], as some extra dependenies of keys removed from the [current_input] may remain. *) let reuse _kf bases ~current_input ~previous_output = let into = Memory.diff bases current_input in let state = Memory.merge ~into (Memory.rebuild previous_output) in state (* Less efficient version of [reuse], using successive applications of [Memory.remove] and [Memory.add]. The resulting state is canonical and satisfies [_check state]. *) let _reuse _kf bases ~current_input ~previous_output = let keys = Memory.gather_keys bases current_input in let state = Memory.remove_keys keys current_input in let keys = Memory.gather_keys bases previous_output in K.HCESet.fold (fun elt acc -> let value = K2V.find elt previous_output.Memory.values in let zone = K2Z.find elt previous_output.Memory.zones in Memory.add_key elt value zone acc) keys state (* Initial state. Initializers are singletons, so we store nothing. *) let introduce_globals _ state = state let initialize_variable_using_type _ _ state = state let initialize_variable _ _ ~initialized:_ _ state = state (* Logic *) let logic_assign _assigns location ~pre:_ state = let loc = Precise_locs.imprecise_location location in Memory.kill loc state let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ state _ _ = `Value state let storage = Value_parameters.SymbolicLocsStorage.get end module D = Domain_builder.Complete (Internal) ������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/symbolic_locs.mli������������������������������������0000666�0000000�0000000�00000003477�13571573400�021610� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Domain that store information on non-precise l-values such as [t[i]] or [*p] when [i] or [p] is not exact. *) module D: Abstract_domain.Leaf with type value = Cvalue.V.t and type location = Precise_locs.precise_location �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/traces_domain.ml�������������������������������������0000666�0000000�0000000�00000140051�13571573400�021374� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** traces domain *) (** This domain build an over-approximation of all the traces that leads to a statement. These sets of traces is represented using CFGs. *) module OCamlGraph = Graph module Frama_c_File = File open Cil_types open Cil_datatype [@@@ warning "-40-42"] module Node : sig include Datatype.S_with_collections val id: t -> int val start: t val dumb: t val next: unit -> t end = struct include Datatype.Int let id x = x let start = 0 let dumb = (- 1) module Counter = State_builder.Counter (struct let name = "Value.Traces_domain.Node.Counter" end) let next () = Counter.next () end (** Can't use Graph.t it needs an impossible recursive module *) module GraphShape = Hptmap.Shape(Node) type node = Node.t type transition = | Assign of kinstr * lval * typ * exp | Assume of stmt * exp * bool | EnterScope of kernel_function * varinfo list | LeaveScope of kernel_function * varinfo list (** For call of functions without definition *) | CallDeclared of kernel_function * exp list * lval option | Loop of stmt * node (** start *) * edge list GraphShape.t | Msg of string and edge = { edge_trans : transition; edge_dst : node; } module rec Edge : sig include Datatype.S_with_collections with type t = edge val succ : t -> node val change_next : node -> t -> t val has_transition : transition -> edge -> bool val pretty_list : t list Pretty_utils.formatter end = struct module T = struct type t = edge let name = "Value.Traces_domain.Edge" include Datatype.Serializable_undefined let reprs = [ { edge_trans = Msg "msg"; edge_dst = Node.start; }] let structural_descr = Structural_descr.t_abstract let compare (e1: t) (e2 : t) = let c = Node.compare e1.edge_dst e2.edge_dst in if c <> 0 then c else Transition.compare e1.edge_trans e2.edge_trans let equal = Datatype.from_compare let pretty fmt e = Format.fprintf fmt "@[<hv 2>%a @[-> %a@]@]" Transition.pretty e.edge_trans Node.pretty e.edge_dst let hash e = Hashtbl.seeded_hash (Node.hash e.edge_dst) (Transition.hash e.edge_trans) end include Datatype.Make_with_collections(T) let has_transition t e = Transition.equal t e.edge_trans let pretty_list fmt l = Pretty_utils.pp_list ~sep:";@ " pretty fmt l let succ e = e.edge_dst let change_next n e = { e with edge_dst = n } end and Transition : sig type t = transition val compare : t -> t -> int val equal : t -> t -> bool val hash : t -> int val pretty : t Pretty_utils.formatter end = struct type t = transition let compare (t1: t) (t2: t) = match t1, t2 with | Assign (_, loc1, typ1, exp1), Assign (_, loc2, typ2, exp2) -> let c = Lval.compare loc1 loc2 in if c <> 0 then c else let c = Typ.compare typ1 typ2 in if c <> 0 then c else ExpStructEq.compare exp1 exp2 | Assume (_, e1, b1), Assume (_, e2, b2) -> let c = ExpStructEq.compare e1 e2 in if c <> 0 then c else Transitioning.Stdlib.compare b1 b2 | EnterScope (_, vs1), EnterScope (_, vs2) -> Extlib.list_compare Varinfo.compare vs1 vs2 | LeaveScope (_, vs1), LeaveScope (_, vs2) -> Extlib.list_compare Varinfo.compare vs1 vs2 | CallDeclared (kf1, es1, lv1), CallDeclared (kf2, es2, lv2) -> let c = Kernel_function.compare kf1 kf2 in if c <> 0 then c else let c = Extlib.list_compare ExpStructEq.compare es1 es2 in if c <> 0 then c else Extlib.opt_compare Lval.compare lv1 lv2 | Msg s1, Msg s2 -> String.compare s1 s2 | Loop (stmt1, s1, g1), Loop (stmt2, s2, g2) -> let c = Stmt.compare stmt1 stmt2 in if c <> 0 then c else let c = Node.compare s1 s2 in if c <> 0 then c else GraphShape.compare (Extlib.list_compare Edge.compare) g1 g2 | Assign _, _ -> -1 | _ , Assign _ -> 1 | Assume _, _ -> -1 | _ , Assume _ -> 1 | EnterScope _, _ -> -1 | _ , EnterScope _ -> 1 | LeaveScope _, _ -> -1 | _ , LeaveScope _ -> 1 | CallDeclared _, _ -> -1 | _ , CallDeclared _ -> 1 | Msg _, _ -> -1 | _, Msg _ -> 1 let equal t1 t2 = (compare t1 t2 = 0) let pretty fmt = function | Assign (_, loc, _typ, exp) -> Format.fprintf fmt "Assign:@ %a = %a" Lval.pretty loc ExpStructEq.pretty exp | Assume (_, e, b) -> Format.fprintf fmt "Assume:@ %a %b" ExpStructEq.pretty e b | EnterScope (_, vs) -> Format.fprintf fmt "EnterScope:@ %a" (Pretty_utils.pp_list ~sep:"@ " Varinfo.pretty) vs | LeaveScope (_, vs) -> Format.fprintf fmt "LeaveScope:@ %a" (Pretty_utils.pp_list ~sep:"@ " Varinfo.pretty) vs | CallDeclared(kf1, exp1, lval1) -> Format.fprintf fmt "CallDeclared:@ %a%s(%a)" (Pretty_utils.pp_opt ~pre:"" ~suf:" =@ " Lval.pretty) lval1 (Kernel_function.get_name kf1) (Pretty_utils.pp_list ~sep:",@ " ExpStructEq.pretty) exp1 | Msg s -> Format.fprintf fmt "%s" s | Loop(stmt, s, g) -> Format.fprintf fmt "@[Loop(%a) %a@] %a" Stmt.pretty_sid stmt Node.pretty s (GraphShape.pretty (Edge.pretty_list)) g let hash = function | Assume (_, e, b) -> Hashtbl.seeded_hash (Hashtbl.hash b) (ExpStructEq.hash e) | Assign (_, lv, t, e) -> Hashtbl.seeded_hash (ExpStructEq.hash e) (Hashtbl.seeded_hash (Typ.hash t) (Hashtbl.seeded_hash 2 (Lval.hash lv))) | EnterScope (_, vs) -> List.fold_left (fun acc e -> Hashtbl.seeded_hash acc (Varinfo.hash e)) 3 vs | LeaveScope (_, vs) -> List.fold_left (fun acc e -> Hashtbl.seeded_hash acc (Varinfo.hash e)) 5 vs | CallDeclared (kf, es, lv) -> let x = Kernel_function.hash kf in let x = Hashtbl.seeded_hash x (Extlib.opt_hash Lval.hash lv) in List.fold_left (fun acc e -> Hashtbl.seeded_hash acc (ExpStructEq.hash e)) x es | Msg s -> Hashtbl.seeded_hash 7 s | Loop (stmt, s, g) -> Hashtbl.seeded_hash (Stmt.hash stmt) (Hashtbl.seeded_hash (GraphShape.hash g) (Hashtbl.seeded_hash 11 (Node.hash s))) end module EdgeList = struct include Datatype.List_with_collections(Edge) (struct let module_name = "Value.Traces_domain.EdgeList" end) let pretty = Edge.pretty_list let pretty_debug = pretty end module Graph = struct include Hptmap.Make(Node)(EdgeList)(Hptmap.Comp_unused) (struct let v = [[]] end) (struct let l = [Ast.self] end) let is_included = let cache = Hptmap_sig.NoCache in let decide_fast = decide_fast_inclusion in let decide_fst _n _v1 = false in let decide_snd _n _v2 = true in let rec decide_both k l1 l2 = match l1, l2 with | [], _ -> true | _, [] -> false | h1 :: t1, h2 :: t2 -> let c = Edge.compare h1 h2 in if c = 0 then decide_both k t1 t2 else if c < 0 then false else decide_both k l1 t2 in binary_predicate cache UniversalPredicate ~decide_fast ~decide_fst ~decide_snd ~decide_both let join = let cache = Hptmap_sig.NoCache in let rec merge_edge k l1 l2 = match l1, l2 with | [], l2 -> l2 | l1, [] -> l1 | h1 :: t1, h2 :: t2 -> let c = Edge.compare h1 h2 in if c = 0 then h1 :: merge_edge k t1 t2 else if c < 0 then h1 :: merge_edge k t1 l2 else h2 :: merge_edge k l1 t2 in join ~cache ~symmetric:true ~idempotent:true ~decide:merge_edge let diff = let cache = Hptmap_sig.NoCache in let decide_left = Neutral in let decide_right = Absorbing in let rec diff_list k l1 l2 = match l1, l2 with | [], _ -> [] | l1, [] -> l1 | h1 :: t1, h2 :: t2 -> let c = Edge.compare h1 h2 in if c = 0 then diff_list k t1 t2 else if c < 0 then h1 :: diff_list k t1 l2 else diff_list k l1 t2 in let decide_both k l1 l2 = match diff_list k l1 l2 with [] -> None | l -> Some l in merge ~cache ~symmetric:false ~idempotent:false ~decide_both ~decide_left ~decide_right let succs (n : Node.t) g = try find n g with Not_found -> [] let rec epsilon_path current stop g = Node.equal current stop || begin Node.compare current stop <= 0 && match find current g with | exception Not_found -> false | l -> let exists = function | { edge_dst; edge_trans = Msg _ } -> epsilon_path edge_dst stop g | _ -> false in List.exists exists l end end let create_edge all_edges_ever_created current e = let m = Graph.singleton current [e] in let old = !all_edges_ever_created in let new_ = Graph.join old m in (* if not (Graph.equal old new_) then *) (* Format.printf "@[<hv>@[create_edge: %a ->@]@ %a@]@." *) (* Node.pretty current Edge.pretty e; *) all_edges_ever_created := new_; m let join_path ~all_edges_ever_created g c1 c2 = if Graph.epsilon_path c1 c2 g then (c2, g) else if Graph.epsilon_path c2 c1 g then (c1, g) else let t_join = Msg "join" in let is_join e = Transition.equal e.edge_trans t_join in let e = let succs1 = Graph.succs c1 !all_edges_ever_created in let succs2 = Graph.succs c2 !all_edges_ever_created in let succs1 = List.filter is_join succs1 in let find s1 = List.exists (Edge.equal s1) succs2 in begin match List.find find succs1 with | exception Not_found -> { edge_dst = Node.next () ; edge_trans = t_join } | m -> { edge_dst = Edge.succ m ; edge_trans = t_join } end in let m1 = create_edge all_edges_ever_created c1 e in let m2 = create_edge all_edges_ever_created c2 e in let g = Graph.join (Graph.join m1 g) m2 in (e.edge_dst, g) (* A loop .*) type loops = | Base of Node.t * Graph.t (* current last *) | OpenLoop of Cil_types.stmt * Node.t (* start node *) * Graph.t (* last iteration *) * Node.t (** current *) * Graph.t * loops | UnrollLoop of Cil_types.stmt * loops module Loops = struct type t = loops let rec is_included l1 l2 = match l1, l2 with | Base _, (OpenLoop _ | UnrollLoop _) | (OpenLoop _ | UnrollLoop _), Base _ -> (* not in the same number of loops *) false | Base (c1,_), Base (c2,g2) -> Graph.epsilon_path c1 c2 g2 | (OpenLoop(stmt1,_,_,_,_,_) | UnrollLoop(stmt1,_)), (OpenLoop(stmt2,_,_,_,_,_) | UnrollLoop(stmt2,_)) when not (Stmt.equal stmt1 stmt2) -> (* not same loop *) false | OpenLoop(_,s1,_,_,_,_), OpenLoop(_,s2,_,_,_,_) when not (Node.equal s1 s2) -> (* not entered in the loop at the same time, take arbitrarily one of them *) false | OpenLoop(_,_,last1,c1,g1,l1), OpenLoop(_,_,last2,c2,g2,l2) -> let g2' = Graph.join last2 g2 in is_included l1 l2 && Graph.is_included last1 last2 && Graph.is_included g1 g2' && Graph.epsilon_path c1 c2 g2' | UnrollLoop(_,l1), UnrollLoop(_,l2) -> is_included l1 l2 | OpenLoop(_,_,_,_,_,_), UnrollLoop(_,_) -> false | UnrollLoop(_,l1), OpenLoop(_,_,_,_,_,l2) -> is_included l1 l2 let rec diff l1 l2 = match l1, l2 with | Base _, (OpenLoop _ | UnrollLoop _) | (OpenLoop _ | UnrollLoop _), Base _ -> (* not in the same number of loops *) `Bottom | Base (c1,g1), Base (_,g2) -> let g = Graph.diff g1 g2 in `Value (Base (c1, g)) | (OpenLoop(stmt1,_,_,_,_,_) | UnrollLoop(stmt1,_)), (OpenLoop(stmt2,_,_,_,_,_) | UnrollLoop(stmt2,_)) when not (Stmt.equal stmt1 stmt2) -> (* not same loop *) `Bottom | OpenLoop(stmt1,s1,last1,c1,g1,l1), OpenLoop(_,s2,_,_,_,l2) when not (Node.equal s1 s2) -> (* not entered in the loop at the same time, take arbitrarily one of them *) begin match diff l1 l2 with | `Bottom -> `Bottom | `Value(l) -> `Value(OpenLoop(stmt1,s1,last1,c1,g1,l)) end | OpenLoop(stmt,s,last1,c1,g1,l1), OpenLoop(_,_,last2,_,g2,l2) -> begin match diff l1 l2 with | `Bottom -> `Bottom | `Value(l) -> let last = Graph.diff last1 last2 in let g = Graph.diff g1 g2 in `Value(OpenLoop(stmt,s,last,c1,g,l)) end | UnrollLoop(stmt,l1), UnrollLoop(_,l2) -> begin match diff l1 l2 with | `Bottom -> `Bottom | `Value l -> `Value (UnrollLoop(stmt,l)) end | (OpenLoop(stmt,s,last,c,g,l1), UnrollLoop(_,l2)) -> begin match diff l1 l2 with | `Bottom -> `Bottom | `Value l -> `Value (OpenLoop(stmt,s,last,c,g,l)) end | (UnrollLoop(stmt,l2), OpenLoop(_,_,_,_,_,l1)) -> begin match diff l1 l2 with | `Bottom -> `Bottom | `Value l -> `Value (UnrollLoop(stmt,l)) end let rec compare l1 l2 = match l1, l2 with | Base (c1,g1), Base (c2,g2) -> let c = Node.compare c1 c2 in if c <> 0 then c else Graph.compare g1 g2 | OpenLoop(stmt1,s1, last1, c1, g1, l1), OpenLoop(stmt2,s2, last2, c2, g2, l2) -> let c = Stmt.compare stmt1 stmt2 in if c <> 0 then c else let c = Node.compare s1 s2 in if c <> 0 then c else let c = Graph.compare last1 last2 in if c <> 0 then c else let c = Node.compare c1 c2 in if c <> 0 then c else let c = Graph.compare g1 g2 in if c <> 0 then c else compare l1 l2 | UnrollLoop(stmt1,l1), UnrollLoop(stmt2,l2) -> let c = Stmt.compare stmt1 stmt2 in if c <> 0 then c else compare l1 l2 | Base _, _ -> -1 | _, Base _ -> 1 | OpenLoop _, _ -> -1 | _, OpenLoop _ -> 1 let rec pretty fmt = function | Base (c,g) -> Format.fprintf fmt "@[<hv>%a @[at %a@]@]" Graph.pretty g Node.pretty c | OpenLoop(stmt,s,last,c,g,l) -> Format.fprintf fmt "@[<hv 1>@[loop(%a) %a@]@ @[<hv 1>@[last:@]@ %a@]@ @[<hv 1>@[c:@]@ %a@]@ @[at %a@]@]@ %a" Stmt.pretty_sid stmt Node.pretty s Graph.pretty last Graph.pretty g Node.pretty c pretty l | UnrollLoop(stmt,l) -> Format.fprintf fmt "@[<hv>@[unroll(%a)@]@ %a" Stmt.pretty_sid stmt pretty l let rec hash = function | Base (c,g) -> Hashtbl.seeded_hash (Hashtbl.seeded_hash 1 (Graph.hash g)) (Node.hash c) | OpenLoop(stmt,s,last,c,g,l) -> Hashtbl.seeded_hash 2 (Stmt.hash stmt, Node.hash s, Graph.hash last, Node.hash c, Graph.hash g, hash l) | UnrollLoop(stmt,l) -> Hashtbl.seeded_hash 2 (Stmt.hash stmt, hash l) end let rec join_loops ~all_edges_ever_created l1 l2 = match l1, l2 with | Base _, (OpenLoop _ | UnrollLoop _) | (OpenLoop _ | UnrollLoop _), Base _ -> (* not in the same number of loops *) `Top | Base (c1,g1), Base (c2,g2) -> let g = Graph.join g1 g2 in let (n,g) = join_path ~all_edges_ever_created g c1 c2 in `Value( Base (n, g)) | (OpenLoop(stmt1,_,_,_,_,_) | UnrollLoop(stmt1,_)), (OpenLoop(stmt2,_,_,_,_,_) | UnrollLoop(stmt2,_)) when not (Stmt.equal stmt1 stmt2) -> (* not same loop *) `Top | OpenLoop(stmt1,s1,last1,c1,g1,l1), OpenLoop(_,s2,_,_,_,l2) when not (Node.equal s1 s2) -> (* not entered in the loop at the same time, take arbitrarily one of them *) begin match join_loops ~all_edges_ever_created l1 l2 with | `Top -> `Top | `Value(l) -> `Value(OpenLoop(stmt1,s1,last1,c1,g1,l)) end | OpenLoop(stmt,s,last1,c1,g1,l1), OpenLoop(_,_,last2,c2,g2,l2) -> begin match join_loops ~all_edges_ever_created l1 l2 with | `Top -> `Top | `Value(l) -> let last = Graph.join last1 last2 in let g = Graph.join g1 g2 in let (n,g) = join_path ~all_edges_ever_created g c1 c2 in `Value(OpenLoop(stmt,s,last,n,g,l)) end | UnrollLoop(stmt,l1), UnrollLoop(_,l2) -> begin match join_loops ~all_edges_ever_created l1 l2 with | `Top -> `Top | `Value l -> `Value (UnrollLoop(stmt,l)) end | (OpenLoop(stmt,s,last,c,g,l1), UnrollLoop(_,l2)) | (UnrollLoop(_,l2), OpenLoop(stmt,s,last,c,g,l1)) -> begin match join_loops ~all_edges_ever_created l1 l2 with | `Top -> `Top | `Value l -> `Value (OpenLoop(stmt,s,last,c,g,l)) end type state = { start : Node.t; current : loops; call_declared_function: bool; globals : Cil_types.varinfo list; main_formals : Cil_types.varinfo list; (** kind of memoization of the edges *) all_edges_ever_created : Graph.t ref; all_loop_start : (Node.t * Graph.t) Stmt.Hashtbl.t; } let start s = s.start let current s = s.current let globals s = s.globals let entry_formals s = s.main_formals (* Lattice structure for the abstract state above *) module Traces = struct (** impossible for normal values start must be bigger than current *) let new_empty () = { start = Node.start; current = Base (Node.start, Graph.empty); call_declared_function = false; globals = []; main_formals = []; all_edges_ever_created = ref Graph.empty; all_loop_start = Stmt.Hashtbl.create 10; } let empty = new_empty () let top = { (new_empty ()) with current = Base (Node.dumb, Graph.empty); } (* Frama-C "datatype" for type [inout] *) include Datatype.Make_with_collections(struct include Datatype.Serializable_undefined type t = state let name = "Value.Traces_domain.Traces.state" let reprs = [empty] let structural_descr = Structural_descr.t_record [| Descr.pack Datatype.Int.descr; Descr.pack Datatype.Int.descr; Descr.pack Graph.descr; Descr.pack Datatype.Bool.descr; Structural_descr.pack Structural_descr.t_abstract; Structural_descr.pack Structural_descr.t_abstract; |] let compare m1 m2 = let c = Node.compare m1.start m2.start in if c <> 0 then c else let c = Loops.compare m1.current m2.current in if c <> 0 then c else let c = Datatype.Bool.compare m1.call_declared_function m2.call_declared_function in if c <> 0 then c else 0 let equal = Datatype.from_compare let pretty fmt m = if m == top then Format.fprintf fmt "TOP" else Format.fprintf fmt "@[<hv>@[@[start: %a;@]@ @[globals = %a;@]@ @[main_formals = %a;@]@]@ %a@]" Node.pretty m.start (Pretty_utils.pp_list ~sep:",@ " Varinfo.pretty) m.globals (Pretty_utils.pp_list ~sep:",@ " Varinfo.pretty) m.main_formals Loops.pretty m.current let hash m = Hashtbl.seeded_hash (Node.hash m.start) (Loops.hash m.current) let copy c = c end) let view m = if m == top then `Top else `Other m let map_base f state = let rec aux = function | Base (c, g) -> let c, g = f (c, g) in Base (c, g) | OpenLoop (stmt, s, last, c, g, l) -> let c, g = f (c, g) in OpenLoop(stmt, s, last, c, g, l) | UnrollLoop (stmt, l) -> UnrollLoop (stmt, aux l) in { state with current = aux state.current } let move_to c g = map_base (fun _ -> c, g) let replace_to c = map_base (fun (_, g) -> c, g) let get_current state = let rec aux = function | Base (c,g) -> (c,g) | OpenLoop(_,_,_,c,g,_) -> (c,g) | UnrollLoop(_,l) -> aux l in aux state.current let add_trans_aux state t = let add_edge (current, graph) = let e = (** try to reuse an edge from the pool *) let succs = Graph.succs current !(state.all_edges_ever_created) in try List.find (Edge.has_transition t) succs with Not_found -> (** create a new edge *) { edge_trans = t; edge_dst = Node.next () } in let n = e.edge_dst in let m = create_edge state.all_edges_ever_created current e in let graph = Graph.join m graph in (n, graph) in map_base add_edge state let add_trans c t = if c == top then c else if c.call_declared_function then c (** forget intermediary state *) else let c = if c == empty then new_empty () else c in add_trans_aux c t let copy_edges s old_current_node g state = let cache = Node.Hashtbl.create 10 in let rec aux old_current_node state = let current_node = (fst (get_current state)) in let succs = Graph.succs old_current_node g in let fold state e = let next_old = Edge.succ e in let state = match Node.Hashtbl.find cache next_old with | exception Not_found -> let state = add_trans state e.edge_trans in Node.Hashtbl.add cache next_old (fst (get_current state)); let state = aux next_old state in replace_to current_node state | next -> let (_,g) = get_current state in let e = Edge.change_next next e in let m = create_edge state.all_edges_ever_created current_node e in let g = Graph.join m g in move_to next g state in replace_to current_node state in List.fold_left fold state succs in let state = aux s state in let c = Node.Hashtbl.find cache old_current_node in replace_to c state let is_included c1 c2 = (* start is the same *) let r = c1.start = c2.start && Loops.is_included c1.current c2.current in if not r && compare c1 c2 = 0 then Printf.printf "bad is_included@."; r let not_same_origin c1 c2 = c1.start != c2.start || c1.globals != c2.globals || c1.main_formals != c2.main_formals || c1.all_edges_ever_created != c2.all_edges_ever_created let join c1 c2 = if c1.call_declared_function <> c2.call_declared_function then Value_parameters.fatal "@[<hv>@[At the same time inside and outside a function call:@]@ %a@ %a@]" pretty c1 pretty c2 else match view c1, view c2 with | `Top, _ -> c1 | _, `Top -> c2 | `Other c1, `Other c2 when is_included c1 c2 -> c2 | `Other c1, `Other c2 when is_included c2 c1 -> c1 | `Other c1, `Other c2 -> if not_same_origin c1 c2 then assert false else let all_edges_ever_created = c1.all_edges_ever_created in match join_loops ~all_edges_ever_created c1.current c2.current with | `Top -> top | `Value(current) -> {c1 with current} let add_loop stmt state = let (n,g) = get_current state in let succs = Graph.succs n g in let rec find_same_loop = function | [] -> Stmt.Hashtbl.memo state.all_loop_start stmt (fun _ -> Node.next (),Graph.empty) | edge :: tl -> match edge.edge_trans with | Loop (stmt',s,last) when Stmt.equal stmt' stmt -> s, Graph.from_shape_id last | _ -> find_same_loop tl in let s,last = find_same_loop succs in let current = OpenLoop(stmt,s,last,s,Graph.empty,state.current) in { state with current } let widen _ stmt' c1 c2 = if false then begin if Loops.compare c1.current c2.current = 0 then Format.printf "@[<hv 2>@[widen %a: same loops, states are%s equal @]@]@." Stmt.pretty_sid stmt' (if compare c1 c2 = 0 then "" else " not") else let c1' = Loops.diff c1.current c2.current in let c2' = Loops.diff c2.current c1.current in if (Bottom.compare Loops.compare) c1' c2' = 0 then Format.printf "@[<hv 2>@[widen %a diff equal:@]@ @[<hv 1>@[c1:@]@ %a@]@ @[<hv 1>@[c2:@]@ %a@]@]@." Stmt.pretty_sid stmt' Loops.pretty c1.current Loops.pretty c2.current else Format.printf "@[<hv 2>@[widen %a diff different:@]@ @[<hv 1>@[c1':@]@ %a@]@ @[<hv 1>@[c2':@]@ %a@]@]@." Stmt.pretty_sid stmt' (Bottom.pretty Loops.pretty) c1' (Bottom.pretty Loops.pretty) c2' end; if false then begin if Loops.compare c1.current c2.current = 0 then Format.printf "@[<hv 2>@[widen %a: same loops, states are%s equal @]@]@." Stmt.pretty_sid stmt' (if compare c1 c2 = 0 then "" else " not") else Format.printf "@[<hv 2>@[widen %a@]@]@." Stmt.pretty_sid stmt' end; if not (Value_parameters.TracesUnrollLoop.get ()) then c2 else begin match c2.current with | Base _ -> assert false (** must be in a loop *) | OpenLoop(stmt,_,_,_,_,_) -> assert (Stmt.equal stmt' stmt); c2 | UnrollLoop(stmt,l) -> assert (Stmt.equal stmt' stmt); add_loop stmt' {c2 with current = l} end let narrow _c1 c2 = `Value c2 end module GraphDot = OCamlGraph.Graphviz.Dot(struct module V = struct type t = {node : Node.t; loops : Node.t list} end module E = struct open V type t = | Usual of Node.t * Edge.t * Node.t list | Head of Node.t * Node.t list * Node.t * Node.t list | Back of Node.t * Node.t list * Node.t let src = function | Usual (src,_,loops) -> {node=src;loops} | Head (src,loops,_,_) -> {node=src;loops} | Back (_,loops,src) -> {node=src;loops} let dst = function | Usual (_,edge,loops) -> {node=Edge.succ edge;loops} | Head (_,_,s,loops) -> {node=s;loops} | Back (dst,loops,_) -> {node=dst;loops} end open V open E type t = Graph.t let iter_vertex f g = let rec iter_edge k (l: Node.t list) e = match e.edge_trans with | Loop(_,_,g) -> iter_vertex (k::l) g | _ -> () and iter_vertex l g = GraphShape.iter (fun k e -> f {node=k;loops=l}; List.iter (iter_edge k l) e) g in iter_vertex [] (Graph.shape g) let iter_edges_e f g = let rec iter_edge k l e = f (Usual(k,e,l)); match e.edge_trans with | Loop(_,s,g) -> let l' = (k::l) in f (Head(k,l,s,l')); iter_vertex (Some s) l' g | _ -> () and iter_vertex back l g = GraphShape.iter (fun k e -> match e, back with | [], Some back -> f (Back(back,l,k)) | e, _ -> List.iter (iter_edge k l) e) g in iter_vertex None [] (Graph.shape g) let graph_attributes _ = [] let default_vertex_attributes : t -> OCamlGraph.Graphviz.DotAttributes.vertex list = fun _ -> [] let subgraph_name loops = Format.asprintf "S%a" (fun fmt -> List.iter (fun s -> Format.fprintf fmt "L%a" Node.pretty s)) loops let vertex_name v = Format.asprintf "n%a%s" Node.pretty v.node (subgraph_name v.loops) let vertex_attributes : V.t -> OCamlGraph.Graphviz.DotAttributes.vertex list = fun n -> [`Label (Format.asprintf "%a" Node.pretty n.node)] let get_subgraph v = match v.loops with | [] -> None | _::l -> Some {OCamlGraph.Graphviz.DotAttributes.sg_name = subgraph_name v.loops; sg_attributes = []; sg_parent = if l = [] then None else Some (subgraph_name l); } let default_edge_attributes : t -> OCamlGraph.Graphviz.DotAttributes.edge list = fun _ -> [] let edge_attributes : E.t -> OCamlGraph.Graphviz.DotAttributes.edge list = function | Usual(_,{edge_trans = Loop _},_) -> [`Label (Format.asprintf "leave_loop")] | Usual(_,e,_) -> [`Label (Format.asprintf "@[<h>%a@]" Transition.pretty e.edge_trans)] | Head _ -> [] | Back(_,_,_) -> [`Constraint false] end) (** adds n -> [] for leaves *) let rec complete_graph (graph:Graph.t) = Graph.fold (fun k l graph -> let graph, l = Extlib.fold_map (fun graph e -> let m = Graph.singleton (Edge.succ e) [] in let e = match e.edge_trans with | Assign (_, _,_,_) | Assume (_, _,_) | EnterScope _ | LeaveScope _ | CallDeclared (_,_,_) | Msg _ -> e | Loop (stmt,s,g) -> let n = e.edge_dst in let g = Graph.shape (complete_graph (Graph.from_shape_id g)) in { edge_dst = n; edge_trans = Loop(stmt,s,g) } in Graph.join graph m, e) graph l in Graph.join graph (Graph.singleton k l) ) graph Graph.empty module Internal = struct type nonrec state = state type value = Cvalue.V.t type location = Precise_locs.precise_location include (Traces: sig include Datatype.S_with_collections with type t = state include Abstract_domain.Lattice with type state := state end) let log_category = Value_parameters.register_category "d-traces" type origin = unit module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type origin = origin and type loc = Precise_locs.precise_location) : Abstract_domain.Transfer with type state = state and type value = Cvalue.V.t and type location = Precise_locs.precise_location and type valuation = Valuation.t = struct type value = Cvalue.V.t type state = t type location = Precise_locs.precise_location type valuation = Valuation.t let assign ki lv e _v _valuation state = let trans = Assign (ki, lv.Eval.lval, lv.Eval.ltyp, e) in `Value (Traces.add_trans state trans) let assume stmt e pos _valuation state = let trans = Assume (stmt, e, pos) in `Value (Traces.add_trans state trans) let start_call stmt call _valuation state = let kf = call.Eval.kf in if Kernel_function.is_definition kf then let msg = Format.asprintf "start_call: %s (%b)" (Kernel_function.get_name call.Eval.kf) (Kernel_function.is_definition call.Eval.kf) in let state = Traces.add_trans state (Msg msg) in let formals = List.map (fun arg -> arg.Eval.formal) call.Eval.arguments in let state = Traces.add_trans state (EnterScope (kf, formals)) in let state = List.fold_left (fun state arg -> Traces.add_trans state (Assign (Kstmt stmt, Cil.var arg.Eval.formal, arg.Eval.formal.Cil_types.vtype, arg.Eval.concrete))) state call.Eval.arguments in `Value state else (** enter the scope of the dumb result variable *) let var = call.Eval.return in let state = match var with | Some var -> Traces.add_trans state (EnterScope (kf, [var])) | None -> state in let exps = List.map (fun arg -> arg.Eval.concrete) call.Eval.arguments in let state = Traces.add_trans state (CallDeclared (call.Eval.kf, exps, Extlib.opt_map Cil.var var)) in `Value {state with call_declared_function = true} let finalize_call _stmt call ~pre:_ ~post = if post.call_declared_function then `Value {post with call_declared_function = false} else let msg = Format.asprintf "finalize_call: %s" (Kernel_function.get_name call.Eval.kf) in let state = Traces.add_trans post (Msg msg) in `Value state let update _valuation state = `Value state let show_expr _valuation state fmt _expr = Traces.pretty fmt state end (* Memexec *) (* This domains infers no relation between variables. *) let relate _kf _bases _state = Base.SetLattice.bottom (* Do not filter the state: the memexec cache will be applied only on function calls for which the entry states are equal. This almost completely disable memexec, but is always sound. *) let filter _kf _kind _bases state = state (* As memexec cache is only applied on equal entry states, the previous output state is a correct output for the current input state. *) let reuse _kf _bases ~current_input:_ ~previous_output:state = state let empty () = Traces.empty let introduce_globals vars state = {state with globals = vars @ state.globals} let initialize_variable lv _ ~initialized:_ _ state = Traces.add_trans state (Msg(Format.asprintf "initialize variable: %a" Printer.pp_lval lv )) let initialize_variable_using_type init_kind varinfo state = let state = match init_kind with | Abstract_domain.Main_Formal -> {state with main_formals = varinfo::state.main_formals} | _ -> state in let msg = Format.asprintf "initialize@ variable@ using@ type@ %a@ %a" (fun fmt init_kind -> match init_kind with | Abstract_domain.Main_Formal -> Format.pp_print_string fmt "Main_Formal" | Abstract_domain.Library_Global -> Format.pp_print_string fmt "Library_Global" | Abstract_domain.Spec_Return kf -> Format.fprintf fmt "Spec_Return(%s)" (Kernel_function.get_name kf)) init_kind Varinfo.pretty varinfo in Traces.add_trans state (Msg msg) (* TODO *) let logic_assign _assign _location ~pre:_ state = Traces.add_trans state (Msg "logic assign") (* Logic *) let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ state _ _ = `Value state let storage () = true let top_query = `Value (Cvalue.V.top, ()), Alarmset.all let extract_expr _oracle _state _expr = top_query let extract_lval _oracle _state _lv _typ _locs = top_query let backward_location _state _lval _typ loc value = `Value (loc, value) let enter_loop stmt state = let state = Traces.add_trans state (Msg "enter_loop") in let state = if not (Value_parameters.TracesUnrollLoop.get ()) then Traces.add_loop stmt state else { state with current = UnrollLoop(stmt,state.current) } in state let incr_loop_counter _ state = match state.current with | Base _ -> assert false | UnrollLoop(_,_) -> state | OpenLoop(stmt,s,last,_,g,l) -> let last = Graph.join last g in let last = if Value_parameters.TracesUnifyLoop.get () then let s',old_last = Stmt.Hashtbl.find state.all_loop_start stmt in let last = Graph.join last old_last in assert (Node.equal s s'); Stmt.Hashtbl.add state.all_loop_start stmt (s,last); last else last in let current = OpenLoop(stmt,s,last,s,Graph.empty,l) in let state = { state with current } in (* Traces.add_trans state (Msg("incr_loop_counter")) *) state let leave_loop stmt' state = match state.current with | Base _ -> assert false (* absurd: we are in at least a loop *) | UnrollLoop(_,l) -> { state with current = l } | OpenLoop(stmt,s,last,old_current_node,g,current) -> assert (Stmt.equal stmt stmt'); let state = { state with current } in let last = if Value_parameters.TracesUnifyLoop.get () then let s',old_last = Stmt.Hashtbl.find state.all_loop_start stmt in let last = Graph.join last old_last in assert (Node.equal s s'); Stmt.Hashtbl.add state.all_loop_start stmt (s,last); last else last in let state = if Graph.is_empty last then state else Traces.add_trans state (Loop(stmt,s,Graph.shape last)) in let state = Traces.copy_edges s old_current_node g state in Traces.add_trans state (Msg "leave_loop") let enter_scope kf vars state = Traces.add_trans state (EnterScope (kf, vars)) let leave_scope kf vars state = Traces.add_trans state (LeaveScope (kf, vars)) let reduce_further _state _expr _value = [] (*Nothing intelligent to suggest*) end let dummy_loc = Location.unknown let subst_in_full var_mapping = let visit = Visitor_behavior.copy (Project.current ()) in visit, object inherit Cil.genericCilVisitor (visit) method! vvrbl vi = match Varinfo.Map.find vi var_mapping with | exception Not_found -> Cil.DoChildren | v -> Cil.ChangeTo v method! vlogic_var_use lv = match lv.Cil_types.lv_origin with | None -> Cil.DoChildren | Some vi -> match Varinfo.Map.find vi var_mapping with | exception Not_found -> Cil.DoChildren | v -> Cil.ChangeTo (Cil.cvar_to_lvar v) end let subst_in var_mapping = (snd (subst_in_full var_mapping)) let sanitize_name s = String.map (fun c -> if ('0' <= c && c <= '9') || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') then c else '_') s let subst_in_exp var_map exp = Cil.visitCilExpr (subst_in var_map) exp let subst_in_lval var_map exp = Cil.visitCilLval (subst_in var_map) exp let subst_in_varinfo var_map v = match Varinfo.Map.find v var_map with | exception Not_found -> v | v -> v let fresh_varinfo var_map v = let v' = Cil.copyVarinfo v (sanitize_name v.Cil_types.vname) in v'.Cil_types.vdefined <- false; Varinfo.Map.add v v' var_map let valid_sid = true let rec stmts_of_cfg cfg current var_map locals return_exp acc = match Graph.find current cfg with | exception Not_found -> begin match return_exp with | None -> List.rev acc | Some (var,exp) -> let exp = subst_in_exp var_map exp in let return_stmt = Cil.mkStmtOneInstr ~valid_sid (Cil_types.Set(Cil.var var,exp,dummy_loc)) in List.rev (return_stmt::acc) end | [] -> assert false | [a] -> begin let n = a.edge_dst in match a.edge_trans with | Assign (_, lval,_typ,exp) -> let exp = subst_in_exp var_map exp in let lval = subst_in_lval var_map lval in let stmt = Cil.mkStmtOneInstr ~valid_sid (Cil_types.Set(lval,exp,dummy_loc)) in stmts_of_cfg cfg n var_map locals return_exp (stmt::acc) | Assume (_, exp,b) -> let exp = subst_in_exp var_map exp in let predicate = (Logic_utils.expr_to_predicate ~cast:true exp).Cil_types.ip_content in let predicate = if b then predicate else Logic_const.pnot predicate in let code_annot = Logic_const.new_code_annotation(Cil_types.AAssert([],Assert,predicate)) in let stmt = Cil.mkStmtOneInstr ~valid_sid (Cil_types.Code_annot(code_annot,dummy_loc)) in stmts_of_cfg cfg n var_map locals return_exp (stmt::acc) | EnterScope (_, vs) -> (** all our variables are assigned, not defined *) let var_map = List.fold_left fresh_varinfo var_map vs in let vs = List.map (subst_in_varinfo var_map) vs in locals := vs @ !locals; let block = { Cil_types.battrs = []; bscoping = true; blocals = vs; bstatics = []; bstmts = stmts_of_cfg cfg n var_map locals return_exp [] } in let stmt = Cil.mkStmt ~valid_sid (Cil_types.Block(block)) in List.rev (stmt::acc) | LeaveScope _ -> stmts_of_cfg cfg n var_map locals return_exp acc | CallDeclared (kf,exps,lval) -> let exps = List.map (subst_in_exp var_map) exps in let lval = Extlib.opt_map (subst_in_lval var_map) lval in let call = Cil.evar ~loc:dummy_loc (subst_in_varinfo var_map (Kernel_function.get_vi kf)) in let stmt = Cil.mkStmtOneInstr ~valid_sid (Cil_types.Call(lval,call,exps,dummy_loc)) in stmts_of_cfg cfg n var_map locals return_exp (stmt::acc) | Msg _ -> stmts_of_cfg cfg n var_map locals return_exp acc | Loop (_,s,g) -> let g = Graph.from_shape (fun _ v -> v) g in let is_while = match Graph.succs s g, Graph.succs n cfg with | [{ edge_dst = n1'; edge_trans = Assume(_,exp1,b1) }], [{ edge_dst = n2'; edge_trans = Assume(_,exp2,b2) }] when ExpStructEq.equal exp1 exp2 && b1 != b2 -> Some (exp1, n1', b1, n2') | _ -> None in match is_while with | None -> Value_parameters.not_yet_implemented "Traces_domain: Loop without condition" | Some(exp,nloop,bloop,n2) -> let exp = subst_in_exp var_map exp in let exp = if bloop then exp else Cil.new_exp ~loc:dummy_loc (UnOp(LNot,exp,Cil.intType)) in let body = stmts_of_cfg g nloop var_map locals None [] in let acc = (List.rev (Cil.mkLoop ?sattr:None ~guard:exp ~body)) @ acc in stmts_of_cfg cfg n2 var_map locals return_exp acc end | l -> let is_if = match l with | [] | [_] -> assert false (* absurd *) | [{ edge_dst = n1'; edge_trans = Assume(_,exp1,b1) } ; { edge_dst = n2'; edge_trans = Assume(_,exp2,b2) }] when ExpStructEq.equal exp1 exp2 && b1 != b2 -> if b1 then Some (exp1, n1', n2') else Some (exp1,n2',n1') | _ -> None in let stmt = match is_if with | None -> Value_parameters.not_yet_implemented "Traces_domain: switch at node(%a)" Node.pretty current | Some(exp,n1,n2) -> let exp = subst_in_exp var_map exp in let block1 = Cil.mkBlock (stmts_of_cfg cfg n1 var_map locals return_exp []) in let block2 = Cil.mkBlock (stmts_of_cfg cfg n2 var_map locals return_exp []) in Cil.mkStmt ~valid_sid (Cil_types.If(exp,block1,block2,dummy_loc)) in List.rev (stmt::acc) let project_of_cfg vreturn s = let main = Kernel_function.get_vi (fst (Globals.entry_point ())) in let visit project = let visitor = object (self) inherit Visitor.frama_c_copy project method! vglob_aux global = match global with | Cil_types.GFun(fundec,_) when Varinfo.equal fundec.svar main -> Cil.DoChildren | Cil_types.GFun _ -> Cil.ChangeTo([]) | _ -> Cil.JustCopy method! vfunc fundec = if Varinfo.equal (Visitor_behavior.Get_orig.varinfo self#behavior fundec.Cil_types.svar) main then begin (** copy of the fundec structure has already been done *) fundec.slocals <- []; let var_map = Varinfo.Map.empty in let return_stmt, return_equal, blocals = match vreturn with | None -> Cil.mkStmt ~valid_sid (Cil_types.Return(None,dummy_loc)), None, [] | Some exp -> let var = Cil.makeVarinfo false false "__traces_domain_return" (Cil.typeOf exp) in Cil.mkStmt ~valid_sid (Cil_types.Return(Some (Cil.evar var),dummy_loc)), Some (var,exp), [var] in let locals = ref [] in let graph = match s.current with | Base (_,g) -> g | _ -> Value_parameters.fatal "Traces.project_of_cfg used with open loops" in let stmts = stmts_of_cfg graph s.start var_map locals return_equal [] in let sbody = Cil.mkBlock (stmts@[return_stmt]) in sbody.Cil_types.blocals <- blocals; fundec.sbody <- sbody; fundec.slocals <- blocals @ !locals @ fundec.slocals; Cil.setMaxId fundec; let fundec = {fundec with sbody} in Cil.ChangeDoChildrenPost(fundec,(fun x -> x)) end else Cil.JustCopy end in visitor in let _project = Frama_c_File.create_project_from_visitor "Eva.Traces_domain" visit in () (* let selection = *) (* State_selection.diff *) (* State_selection.full *) (* (State_selection.list_union *) (* (List.map State_selection.with_dependencies *) (* [Cil.Builtin_functions.self; *) (* Ast.self; *) (* Frama_c_File.files_pre_register_state])) *) (* in *) (* let project = Project.create_by_copy ~selection ~last:true "Eva.Traces_domain" in *) (* let fundecls = *) (* let l = ref [] in *) (* Globals.Functions.iter (fun kf -> *) (* if not (Kernel_function.is_definition kf) then *) (* l := (kf.Cil_types.spec, Kernel_function.get_vi kf)::!l *) (* ); *) (* !l in *) (* Project.on project (fun () -> *) (* let var_map = Varinfo.Map.empty in *) (* let var_map = List.fold_left fresh_varinfo var_map s.globals in *) (* let var_map = List.fold_left fresh_varinfo var_map s.main_formals in *) (* let fundecls, var_map = List.fold_left (fun (fundecls,var_map) (funspec,v) -> *) (* let fundecl = Cil_types.GFunDecl(funspec,v,dummy_loc) in *) (* let behavior,visitor = subst_in_full var_map in *) (* let fundecl = Cil.visitCilGlobal visitor fundecl in *) (* let v' = Cil.get_varinfo behavior v in *) (* (fundecl @ fundecls), Varinfo.Map.add v v' var_map *) (* (\* (fundecl :: fundecls, var_map) *\) *) (* ) ([],var_map) fundecls in *) (* let globals = [] in *) (* (\** main function *\) *) (* let var_map = fresh_varinfo var_map main in *) (* let main = subst_in_varinfo var_map main in *) (* let fundec = Cil.emptyFunctionFromVI main in *) (* fundec.Cil_types.sformals <- List.map (subst_in_varinfo var_map) s.main_formals; *) (* let stmts = Cil.mkBlock (stmts_of_cfg s.graph s.start var_map vreturn []) in *) (* fundec.Cil_types.sbody <- stmts; *) (* let globals = Cil_types.GFun(fundec,dummy_loc) :: globals in *) (* (\* declared functions *\) *) (* let globals = fundecls @ globals in *) (* (\* globals *\) *) (* let globals = (List.map (fun v -> Cil_types.GVarDecl(subst_in_varinfo var_map v,dummy_loc)) s.globals) @ globals in *) (* let file = { Cil_types.fileName = "Traces_domain"; *) (* globals; *) (* globinit = None; *) (* globinitcalled = false; } in *) (* Globals.set_entry_point (main.Cil_types.vname) false; *) (* Format.printf "@[<2>@[file1:@] %a@]@." Printer.pp_file file; *) (* (\* let file = Cil.visitCilFileCopy (new Cil.genericCilVisitor (Cil.refresh_visit project)) file in *\) *) (* Format.printf "@[<2>@[file2:@] %a@]@." Printer.pp_file file; *) (* Ast.set_file file; *) (* Format.printf "@[<2>@[file3:@] %a@]@." Printer.pp_file file; *) (* ) () *) let output_dot filename state = let out = open_out filename in Value_parameters.feedback ~dkey:Internal.log_category "@[Output dot produced to %s.@]" filename; (** *) GraphDot.output_graph out (complete_graph (snd (Traces.get_current state))); close_out out module D = struct include Domain_builder.Complete (Internal) let post_analysis state = let return_stmt = Kernel_function.find_return (fst (Globals.entry_point ())) in let return_exp = match return_stmt.Cil_types.skind with | Cil_types.Return (oexp,_) -> oexp | _ -> assert false in let header fmt = Format.fprintf fmt "Trace domains:" in let body = Bottom.pretty Traces.pretty in Value_parameters.printf ~dkey:Internal.log_category ~header " @[%a@]" body state; if Value_parameters.TracesProject.get () || not (Value_parameters.TracesDot.is_default ()) then match state with | `Bottom -> Value_parameters.failure "The trace is Bottom can't generate code" | `Value state when state ==Traces.top -> Value_parameters.failure "The trace is TOP can't generate code" | `Value state -> if not (Value_parameters.TracesDot.is_default ()) then output_dot (Value_parameters.TracesDot.get ()) state; if Value_parameters.TracesProject.get () then project_of_cfg return_exp state end (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/domains/traces_domain.mli������������������������������������0000666�0000000�0000000�00000005743�13571573400�021555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Traces domain *) open Cil_types module Node : Datatype.S module GraphShape : sig type 'value t end type node = Node.t type transition = | Assign of kinstr * lval * typ * exp | Assume of stmt * exp * bool | EnterScope of kernel_function * varinfo list | LeaveScope of kernel_function * varinfo list (** For call of functions without definition *) | CallDeclared of kernel_function * exp list * lval option | Loop of stmt * node (** start *) * edge list GraphShape.t | Msg of string and edge = { edge_trans : transition; edge_dst : node; } module Edge : Datatype.S with type t = edge module Graph : sig include Hptmap_sig.S with type key = Node.t and type v = edge list and type 'a shape = 'a GraphShape.t val join : t -> t -> t end (** stack of open loops *) type loops = | Base of Node.t * Graph.t (* current last *) | OpenLoop of Cil_types.stmt * Node.t (* start node *) * Graph.t (* last iteration *) * Node.t (** current *) * Graph.t * loops | UnrollLoop of Cil_types.stmt * loops module Loops : sig type t = loops end type state val start: state -> Node.t val current: state -> loops val globals: state -> Cil_types.varinfo list val entry_formals: state -> Cil_types.varinfo list module D: Abstract_domain.Leaf with type value = Cvalue.V.t and type location = Precise_locs.precise_location and type state = state �����������������������������frama-c-20.0-Calcium/src/plugins/value/domains/unit_domain.ml���������������������������������������0000666�0000000�0000000�00000006763�13571573400�021105� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let log_key = Value_parameters.register_category "unit-domain" module Static = struct module D = struct include Datatype.Unit type state = t let name = "Unit domain" let log_category = log_key let structure = Abstract.Domain.Unit let top = () let is_included _ _ = true let join _ _ = () let widen _ _ _ _ = () let narrow _ _ = `Value () let storage () = false end include D module Store = Domain_store.Make (D) end module Make (Value: Abstract_value.S) (Loc: Abstract_location.S) = struct include Static type value = Value.t type location = Loc.location type origin = unit let eval_top = `Value (Value.top, ()), Alarmset.all let extract_expr _ _ _ = eval_top let extract_lval _ _ _ _ _ = eval_top let backward_location _ _ _ loc value = `Value (loc, value) let reduce_further _ _ _ = [] module Transfer (Valuation: Abstract_domain.Valuation with type value = value and type loc = location) = struct let update _ _ = `Value () let assign _ _ _ _ _ _ = `Value () let assume _ _ _ _ _ = `Value () let start_call _ _ _ _ = `Value () let finalize_call _ _ ~pre:_ ~post:_ = `Value () let show_expr _ _ _ _ = () end let logic_assign _ _ ~pre:_ _ = () let evaluate_predicate _ _ _ = Alarmset.Unknown let reduce_by_predicate _ _ _ _ = `Value () let enter_scope _ _ _ = () let leave_scope _ _ _ = () let enter_loop _ _ = () let incr_loop_counter _ _ = () let leave_loop _ _ = () let empty () = () let introduce_globals _ () = () let initialize_variable _ _ ~initialized:_ _ _ = () let initialize_variable_using_type _ _ _ = () let relate _ _ () = Base.SetLattice.empty let filter _ _ _ () = () let reuse _ _ ~current_input:() ~previous_output:() = () let post_analysis _ = () end (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������frama-c-20.0-Calcium/src/plugins/value/domains/unit_domain.mli��������������������������������������0000666�0000000�0000000�00000003615�13571573400�021247� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Make (Value: Abstract_value.S) (Loc: Abstract_location.S) : Abstract.Domain.Internal with type state = unit and type value = Value.t and type location = Loc.location (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016044� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/abstractions.ml���������������������������������������0000666�0000000�0000000�00000036514�13571573400�021103� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* --- Registration types --------------------------------------------------- *) type 'v value = | Single of (module Abstract_value.Leaf with type t = 'v) | Struct of 'v Abstract.Value.structure type precise_loc = Precise_locs.precise_location module type leaf_domain = Abstract_domain.Leaf with type location = precise_loc module type domain_functor = functor (Value: Abstract.Value.External) -> (leaf_domain with type value = Value.t) type 'v domain = | Domain: (module leaf_domain with type value = 'v) -> 'v domain | Functor: (module domain_functor) -> _ domain type 'v abstraction = { name: string; priority: int; values: 'v value; domain: 'v domain; } (* --- Config and registration ---------------------------------------------- *) module Config = struct type flag = Flag: 'v abstraction -> flag module Flag = struct type t = flag (* Flags are sorted by increasing priority order, and then by name. *) let compare (Flag f1) (Flag f2) = let c = Datatype.Int.compare f1.priority f2.priority in if c <> 0 then c else Datatype.String.compare f1.name f2.name end include Set.Make (Flag) type dynamic = Dynamic: (unit -> 'a option) * ('a -> 'v abstraction) -> dynamic let abstractions = ref [] let dynamic_abstractions : dynamic list ref = ref [] let register ~enable abstraction = abstractions := (enable, Flag abstraction) :: !abstractions let dynamic_register ~configure ~make = dynamic_abstractions := Dynamic (configure, make) :: !dynamic_abstractions let configure () = let aux config (enable, flag) = if enable () then add flag config else config in let config = List.fold_left aux empty !abstractions in let aux config (Dynamic (configure, make)) = match configure () with | None -> config | Some c -> add (Flag (make c)) config in List.fold_left aux config !dynamic_abstractions (* --- Register default abstractions -------------------------------------- *) let create ~enable abstract = register ~enable abstract; Flag abstract let create_domain priority name enable values domain = create ~enable { name; priority; values = Single values; domain = Domain domain } open Value_parameters (* Register standard domains over cvalues. *) let make rank name enable = create_domain rank name enable (module Main_values.CVal) let cvalue = make 9 "cvalue" CvalueDomain.get (module Cvalue_domain.State) let gauges = make 6 "gauges" GaugesDomain.get (module Gauges_domain.D) let octagon = make 6 "octagon" OctagonDomain.get (module Octagons) let inout = make 5 "inout" InoutDomain.get (module Inout_domain.D) let traces = make 2 "traces" TracesDomain.get (module Traces_domain.D) let printer = make 2 "printer" PrinterDomain.get (module Printer_domain) let symbolic_locations = make 7 "symbolic_locations" SymbolicLocsDomain.get (module Symbolic_locs.D) let sign = create_domain 4 "sign" SignDomain.get (module Sign_value) (module Sign_domain) let bitwise = create_domain 3 "bitwise" BitwiseOffsmDomain.get (module Offsm_value.Offsm) (module Offsm_domain.D) let equality_domain = { name = "equality"; priority = 8; values = Struct Abstract.Value.Unit; domain = Functor (module Equality_domain.Make); } let equality = create ~enable:EqualityDomain.get equality_domain (* --- Default and legacy configurations ---------------------------------- *) let default = configure () let legacy = singleton cvalue end let register = Config.register let dynamic_register = Config.dynamic_register (* --- Building value abstractions ------------------------------------------ *) module Leaf_Value (V: Abstract_value.Leaf) = struct include V let structure = Abstract.Value.Leaf (V.key, (module V)) end module Leaf_Location (Loc: Abstract_location.Leaf) = struct include Loc let structure = Abstract.Location.Leaf (Loc.key, (module Loc)) end module Leaf_Domain (D: Abstract_domain.Leaf) = struct include D let structure = Abstract.Domain.Leaf (D.key, (module D)) end module type Acc = sig module Val : Abstract.Value.External module Loc : Abstract.Location.Internal with type value = Val.t and type location = precise_loc module Dom : Abstract.Domain.Internal with type value = Val.t and type location = Loc.location end module Internal_Value = struct open Abstract.Value type value_key_module = V : 'v key * 'v data -> value_key_module let open_value_abstraction (module Value : Internal) = (module struct include Value include Structure.Open (Abstract.Value) (Value) end : Abstract.Value.External) let add_value_leaf value (V (key, v)) = let module Value = (val open_value_abstraction value) in if Value.mem key then value else (module struct include Value_product.Make (Value) (val v) let structure = Node (Value.structure, Leaf (key, v)) end) let add_value_structure value internal = let rec aux: type v. (module Internal) -> v structure -> (module Internal) = fun value -> function | Leaf (key, v) -> add_value_leaf value (V (key, v)) | Node (s1, s2) -> aux (aux value s1) s2 | Unit -> value in aux value internal let build_values config initial_value = let build (Config.Flag abstraction) acc = match abstraction.values with | Struct structure -> add_value_structure acc structure | Single (module V) -> add_value_leaf acc (V (V.key, (module V))) in let value = Config.fold build config initial_value in open_value_abstraction value module Convert (Value: Abstract.Value.External) (Struct: sig type v val s : v value end) = struct let structure = match Struct.s with | Single (module V) -> Abstract.Value.Leaf (V.key, (module V)) | Struct s -> s type extended_value = Value.t let replace_val = let rec set: type v. v structure -> v -> Value.t -> Value.t = function | Leaf (key, _) -> Value.set key | Node (s1, s2) -> let set1 = set s1 and set2 = set s2 in fun (v1, v2) value -> set1 v1 (set2 v2 value) | Unit -> fun () value -> value in set structure let extend_val v = replace_val v Value.top let restrict_val = let rec get: type v. v structure -> Value.t -> v = function | Leaf (key, _) -> Extlib.the (Value.get key) | Node (s1, s2) -> let get1 = get s1 and get2 = get s2 in fun v -> get1 v, get2 v | Unit -> fun _ -> () in get structure type extended_location = Main_locations.PLoc.location let restrict_loc = fun x -> x let extend_loc = fun x -> x end end (* --- Building domain abstractions ----------------------------------------- *) module type internal_loc = Abstract.Location.Internal with type location = precise_loc module type internal_domain = Abstract.Domain.Internal with type location = precise_loc let eq_value: type a b. a Abstract.Value.structure -> b value -> (a,b) Structure.eq option = fun structure -> function | Struct s -> Abstract.Value.eq_structure structure s | Single (module V) -> match structure with | Abstract.Value.Leaf (key, _) -> Abstract.Value.eq_type key V.key | _ -> None let add_domain (type v) (abstraction: v abstraction) (module Acc: Acc) = let domain : (module internal_domain with type value = Acc.Val.t) = match abstraction.domain with | Functor make -> let module Make = (val make: domain_functor) in (module Leaf_Domain (Make (Acc.Val))) | Domain domain -> match eq_value Acc.Val.structure abstraction.values with | Some Structure.Eq -> let module Domain = (val domain) in (module Leaf_Domain (Domain)) | None -> let module Domain = (val domain : leaf_domain with type value = v) in let module Struct = struct type v = Domain.value let s = abstraction.values end in let module Convert = Internal_Value.Convert (Acc.Val) (Struct) in (module Domain_lift.Make (Domain) (Convert)) in let domain : (module internal_domain with type value = Acc.Val.t) = match Abstract.Domain.(eq_structure Acc.Dom.structure Unit) with | Some _ -> domain | None -> (* The new [domain] becomes the left leaf of the domain product, and will be processed before the domains from [Acc.Dom] during the analysis. *) (module Domain_product.Make (Acc.Val) ((val domain)) (Acc.Dom)) in (module struct module Val = Acc.Val module Loc = Acc.Loc module Dom = (val domain) end : Acc) let build_domain config abstract = let build (Config.Flag abstraction) acc = add_domain abstraction acc in (* Domains in the [config] are sorted by increasing priority: domains with higher priority are added last: they will be at the top of the domains tree, and thus will be processed first during the analysis. *) Config.fold build config abstract (* --- Value reduced product ----------------------------------------------- *) module type Value = sig include Abstract.Value.External val reduce : t -> t end module type S = sig module Val : Value module Loc : Abstract.Location.External with type value = Val.t module Dom : Abstract.Domain.External with type value = Val.t and type location = Loc.location end module type Eva = sig include S module Eval: Evaluation.S with type state = Dom.t and type value = Val.t and type loc = Loc.location and type origin = Dom.origin end type ('a, 'b) value_reduced_product = 'a Abstract.Value.key * 'b Abstract.Value.key * ('a -> 'b -> 'a * 'b) type v_reduced_product = R: ('a, 'b) value_reduced_product -> v_reduced_product let value_reduced_product = ref [] let register_value_reduction reduced_product = value_reduced_product := (R reduced_product) :: !value_reduced_product (* When the value abstraction contains both a cvalue and an interval component (coming currently from an Apron domain), reduce them from each other. If the Cvalue is not a scalar do nothing, because we do not currently use Apron for pointer offsets. *) let reduce_apron_itv cvalue ival = match ival with | None -> begin try cvalue, Some (Cvalue.V.project_ival cvalue) with Cvalue.V.Not_based_on_null -> cvalue, ival end | Some ival -> try let ival' = Cvalue.V.project_ival cvalue in (match ival' with | Ival.Float _ -> raise Cvalue.V.Not_based_on_null | _ -> ()); let reduced_ival = Ival.narrow ival ival' in let cvalue = Cvalue.V.inject_ival reduced_ival in cvalue, Some reduced_ival with Cvalue.V.Not_based_on_null -> cvalue, Some ival let () = register_value_reduction (Main_values.CVal.key, Main_values.Interval.key, reduce_apron_itv) module Reduce (Value : Abstract.Value.External) = struct include Value let make_reduction acc (R (key1, key2, f)) = match Value.get key1, Value.get key2 with | Some get1, Some get2 -> let set1 = Value.set key1 and set2 = Value.set key2 in let reduce v = let v1, v2 = f (get1 v) (get2 v) in set1 v1 (set2 v2 v) in reduce :: acc | _, _ -> acc let reduce = let list = List.fold_left make_reduction [] !value_reduced_product in fun v -> List.fold_left (fun v reduce -> reduce v) v list end (* --- Final hook ----------------------------------------------------------- *) let final_hooks = ref [] let register_hook f = final_hooks := f :: !final_hooks let apply_final_hooks abstractions = List.fold_left (fun acc f -> f acc) abstractions !final_hooks (* --- Building abstractions ------------------------------------------------ *) module Open (Acc: Acc) : S = struct module Val = Reduce (Acc.Val) module Loc = struct include Acc.Loc include Structure.Open (Abstract.Location) (struct include Acc.Loc type t = location end) end module Dom = struct include Acc.Dom include Structure.Open (Abstract.Domain) (Acc.Dom) let get_cvalue = match get Cvalue_domain.State.key with | None -> None | Some get -> Some (fun s -> fst (get s)) let get_cvalue_or_top = match get Cvalue_domain.State.key with | None -> fun _ -> Cvalue.Model.top | Some get -> fun s -> fst (get s) let get_cvalue_or_bottom = function | `Bottom -> Cvalue.Model.bottom | `Value state -> get_cvalue_or_top state end end module CVal = Leaf_Value (Main_values.CVal) let unit_acc (module Value: Abstract.Value.External) = let loc : (module internal_loc with type value = Value.t) = match Abstract.Value.eq_structure Value.structure CVal.structure with | Some Structure.Eq -> (module Leaf_Location (Main_locations.PLoc)) | _ -> let module Struct = struct type v = Cvalue.V.t let s = Single (module Main_values.CVal) end in let module Conv = Internal_Value.Convert (Value) (Struct) in (module Location_lift.Make (Main_locations.PLoc) (Conv)) in (module struct module Val = Value module Loc = (val loc) module Dom = Unit_domain.Make (Val) (Loc) end : Acc) let build_abstractions config = let initial_value : (module Abstract.Value.Internal) = if Config.mem Config.bitwise config then (module Offsm_value.CvalueOffsm) else (module CVal) in let value = Internal_Value.build_values config initial_value in let acc = unit_acc value in build_domain config acc let configure = Config.configure let make config = let abstractions = build_abstractions config in let abstractions = (module Open (val abstractions): S) in apply_final_hooks abstractions module Default = (val make Config.default) module Legacy = (val make Config.legacy) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/abstractions.mli��������������������������������������0000666�0000000�0000000�00000015506�13571573400�021252� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Registration and building of the analysis abstractions. *) (** {2 Registration of abstractions.} *) (** Dynamic registration of the abstractions to be used in an Eva analysis: - value abstractions, detailled in the {Abstract_value} signature; - location abstractions, detailled in the {Abstract_location} signature; - state abstractions, or abstract domains, detailled in {Abstract_domain}. *) (** Module types of value abstractions: either a single leaf module, or a compound of several modules described by a structure. *) type 'v value = | Single of (module Abstract_value.Leaf with type t = 'v) | Struct of 'v Abstract.Value.structure (** For the moment, all domains must use [precise_loc] as their location abstraction, and no new location abstraction can be registered for an analysis. If you need to build a new location abstraction, please contact us. *) type precise_loc = Precise_locs.precise_location (** Module type of a leaf domain over precise_loc abstraction. *) module type leaf_domain = Abstract_domain.Leaf with type location = precise_loc (** Module type of a functor building a leaf domain from a value abstraction. The resulting domain must use the input value as value abstraction. *) module type domain_functor = functor (Value: Abstract.Value.External) -> (leaf_domain with type value = Value.t) (** Type of domain to be registered: either a leaf module with ['v] as value abstraction, or a functor building a domain from any value abstraction. *) type 'v domain = | Domain: (module leaf_domain with type value = 'v) -> 'v domain | Functor: (module domain_functor) -> _ domain (** Abstraction to be registered. The name of each abstraction must be unique. The priority can be any integer; domains with higher priority are always processed first. The domains currently provided by Eva have priority ranging between 1 and 19, so a priority of 0 (respectively 20) ensures that a new domain is processed after (respectively before) the classic Eva domains. *) type 'v abstraction = { name: string; (** Name of the abstraction. Must be unique. *) priority: int; (** Domains with higher priority are processed first. *) values: 'v value; (** The value abstraction. *) domain: 'v domain; (** The domain over the value abstraction. *) } (** Register an abstraction. The abstraction is used in an Eva analysis only if [enable ()] returns true at the start of the analysis. *) val register: enable:(unit -> bool) -> 'v abstraction -> unit (** Register a dynamic abstraction: the abstraction is built by applying [make (configure ())] at the start of each analysis. *) val dynamic_register: configure:(unit -> 'a option) -> make:('a -> 'v abstraction) -> unit (** Value reduced product between two value abstractions, identified by their keys. *) type ('a, 'b) value_reduced_product = 'a Abstract.Value.key * 'b Abstract.Value.key * ('a -> 'b -> 'a * 'b) (** Register a reduction function for a value reduced product. *) val register_value_reduction: ('a, 'b) value_reduced_product -> unit (** {2 Types used in the engine.} *) (** The external signature of value abstractions, plus the reduction function of the reduced product. *) module type Value = sig include Abstract.Value.External val reduce : t -> t end (** The three abstractions used in an Eva analysis. *) module type S = sig module Val : Value module Loc : Abstract.Location.External with type value = Val.t module Dom : Abstract.Domain.External with type value = Val.t and type location = Loc.location end (** The three abstractions plus an evaluation engine for these abstractions. *) module type Eva = sig include S module Eval: Evaluation.S with type state = Dom.t and type value = Val.t and type loc = Loc.location and type origin = Dom.origin end (** Register a hook modifying the three abstractions after their building by the engine, before the start of each analysis. *) val register_hook: ((module S) -> (module S)) -> unit (** {2 Configuration of an analysis.} *) (** Configuration defining the abstractions to be used in an analysis. *) module Config : sig (** Flag for an abstraction. *) type flag = Flag: 'v abstraction -> flag (** A configuration is a set of flags, i.e. a set of enabled abstractions. *) include Set.S with type elt = flag (** Flags for the standard domains currently provided in Eva. *) val cvalue: flag val equality: flag val symbolic_locations: flag val gauges: flag val octagon: flag val bitwise: flag val inout: flag val sign: flag val traces: flag val printer: flag val default: t (** The default configuration of Eva. *) val legacy: t (** The configuration corresponding to the old "Value" analysis, with only the cvalue domain enabled. *) end (** Creates the configuration according to the analysis parameters. *) val configure: unit -> Config.t (** Builds the abstractions according to a configuration. *) val make: Config.t -> (module S) (** Two abstractions are instantiated at compile time for the default and legacy configurations (which may be the same). *) module Legacy : S module Default : S ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/analysis.ml�������������������������������������������0000666�0000000�0000000�00000016043�13571573400�020225� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval module type Results = sig type state type value type location val get_stmt_state : after:bool -> stmt -> state or_bottom val get_kinstr_state: after:bool -> kinstr -> state or_bottom val get_stmt_state_by_callstack: after:bool -> stmt -> state Value_types.Callstack.Hashtbl.t or_top_or_bottom val get_initial_state_by_callstack: kernel_function -> state Value_types.Callstack.Hashtbl.t or_top_or_bottom val eval_expr : state -> exp -> value evaluated val copy_lvalue: state -> lval -> value flagged_value evaluated val eval_lval_to_loc: state -> lval -> location evaluated val eval_function_exp: state -> ?args:exp list -> exp -> kernel_function list evaluated end module type S = sig include Abstractions.S include Results with type state := Dom.state and type value := Val.t and type location := Loc.location end module type Analyzer = sig include S val compute_from_entry_point : kernel_function -> lib_entry:bool -> unit val compute_from_init_state: kernel_function -> Dom.t -> unit val initial_state: lib_entry:bool -> Dom.t or_bottom end module Make (Abstract: Abstractions.S) = struct module Abstract = struct include Abstract module Eval = Evaluation.Make (Abstract.Val) (Abstract.Loc) (Abstract.Dom) end include Abstract include Compute_functions.Make (Abstract) let get_stmt_state ~after stmt = let fundec = Kernel_function.(get_definition (find_englobing_kf stmt)) in if Mark_noresults.should_memorize_function fundec && Db.Value.is_computed () then Abstract.Dom.Store.get_stmt_state ~after stmt else `Value Abstract.Dom.top let get_kinstr_state ~after = function | Kglobal -> Abstract.Dom.Store.get_global_state () | Kstmt stmt -> get_stmt_state ~after stmt let get_stmt_state_by_callstack = Abstract.Dom.Store.get_stmt_state_by_callstack let get_initial_state_by_callstack = Abstract.Dom.Store.get_initial_state_by_callstack let eval_expr state expr = Eval.evaluate state expr >>=: snd let copy_lvalue state expr = Eval.copy_lvalue state expr >>=: snd let eval_lval_to_loc state lv = let get_loc (_, loc, _) = loc in let for_writing = false in Eval.lvaluate ~for_writing state lv >>=: get_loc let eval_function_exp state ?args e = Eval.eval_function_exp e ?args state >>=: (List.map fst) end module Legacy = Make (Abstractions.Legacy) module Default = (val (if Abstractions.Config.(equal default legacy) then (module Legacy) else (module Make (Abstractions.Default))) : Analyzer) (* Reference to the current configuration (built by Abstractions.configure from the parameters of Eva regarding the abstractions used in the analysis) and the current Analyzer module. *) let ref_analyzer = ref (Abstractions.Config.default, (module Default : Analyzer)) (* Returns the current Analyzer module. *) let current_analyzer () = (module (val (snd !ref_analyzer)): S) (* Set of hooks called whenever the current Analyzer module is changed. Useful for the GUI parts that depend on it. *) module Analyzer_Hook = Hook.Build (struct type t = (module S) end) (* Register a new hook. *) let register_hook = Analyzer_Hook.extend (* Sets the current Analyzer module for a given configuration. Calls the hooks above. *) let set_current_analyzer config (analyzer: (module Analyzer)) = Analyzer_Hook.apply (module (val analyzer): S); ref_analyzer := (config, analyzer) let cvalue_initial_state () = let module A = (val snd !ref_analyzer) in let _, lib_entry = Globals.entry_point () in A.Dom.get_cvalue_or_bottom (A.initial_state ~lib_entry) (* Builds the Analyzer module corresponding to a given configuration, and sets it as the current analyzer. *) let make_analyzer config = let analyzer = if Abstractions.Config.(equal config legacy) then (module Legacy: Analyzer) else if Abstractions.Config.(equal config default) then (module Default) else let module Abstract = (val Abstractions.make config) in let module Analyzer = Make (Abstract) in (module Analyzer) in set_current_analyzer config analyzer (* Builds the analyzer according to the parameters of Eva. *) let reset_analyzer () = let config = Abstractions.configure () in (* If the configuration has not changed, do not reset the Analyzer but uses the reference instead. *) if not (Abstractions.Config.equal config (fst !ref_analyzer)) then make_analyzer config (* Builds the analyzer if needed, and run the analysis. *) let force_compute () = Ast.compute (); Value_parameters.configure_precision (); let kf, lib_entry = Globals.entry_point () in reset_analyzer (); let module Analyzer = (val snd !ref_analyzer) in Analyzer.compute_from_entry_point ~lib_entry kf let set_hook_on_parameter parameter = let open Typed_parameter in match parameter.accessor with | Bool (accessor, _) -> accessor.add_set_hook (fun _ _ -> reset_analyzer ()) | Int (accessor, _) -> accessor.add_set_hook (fun _ _ -> reset_analyzer ()) | String (accessor, _) -> accessor.add_set_hook (fun _ _ -> reset_analyzer ()) (* Resets the Analyzer whenever an abstraction parameter or the current project is changed. This maintains the analyzer consistent with the Eva parameters. *) let () = List.iter set_hook_on_parameter Value_parameters.parameters_abstractions; Project.register_after_set_current_hook ~user_only:true (fun _ -> reset_analyzer ()); Project.register_after_global_load_hook reset_analyzer ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/analysis.mli������������������������������������������0000666�0000000�0000000�00000006657�13571573400�020410� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval module type Results = sig type state type value type location val get_stmt_state : after:bool -> stmt -> state or_bottom val get_kinstr_state: after:bool -> kinstr -> state or_bottom val get_stmt_state_by_callstack: after:bool -> stmt -> state Value_types.Callstack.Hashtbl.t or_top_or_bottom val get_initial_state_by_callstack: kernel_function -> state Value_types.Callstack.Hashtbl.t or_top_or_bottom val eval_expr : state -> exp -> value evaluated val copy_lvalue: state -> lval -> value flagged_value evaluated val eval_lval_to_loc: state -> lval -> location evaluated val eval_function_exp: state -> ?args:exp list -> exp -> kernel_function list evaluated end module Make (Abstract: Abstractions.S) : sig val compute_from_entry_point : kernel_function -> lib_entry:bool -> unit val compute_from_init_state: kernel_function -> Abstract.Dom.t -> unit include Results with type state := Abstract.Dom.state and type value := Abstract.Val.t and type location := Abstract.Loc.location end module type S = sig include Abstractions.S include Results with type state := Dom.state and type value := Val.t and type location := Loc.location end val current_analyzer : unit -> (module S) (** The abstractions used in the latest analysis, and its results. *) val register_hook: ((module S) -> unit) -> unit (** Registers a hook that will be called each time the [current] analyzer is changed. This happens when a new analysis is run with different abstractions than before, or when the current project is changed. *) val force_compute : unit -> unit (** Perform a full analysis, starting from the [main] function. *) val cvalue_initial_state: unit -> Cvalue.Model.t (** Return the initial state of the cvalue domain only. *) ���������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/compute_functions.ml����������������������������������0000666�0000000�0000000�00000040535�13571573400�022151� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval let dkey = Value_parameters.register_category "callbacks" let floats_ok () = let u = min_float /. 2. in let u = u /. 2. in assert (0. < u && u < min_float) let need_assigns kf = let spec = Annotations.funspec ~populate:false kf in match Cil.find_default_behavior spec with | None -> true | Some bhv -> bhv.b_assigns = WritesAny let options_ok () = (* Check that we can parse the values specified for the options that require advanced parsing. Just make a query, as this will force the kernel to parse them. *) let check f = try ignore (f ()) with Not_found -> () in check Value_parameters.SplitReturnFunction.get; check Value_parameters.BuiltinsOverrides.get; check Value_parameters.SlevelFunction.get; check Value_parameters.EqualityCallFunction.get; let check_assigns kf = if need_assigns kf then Value_parameters.error "@[no assigns@ specified@ for function '%a',@ for \ which@ a builtin@ or the specification@ will be used.@ \ Potential unsoundness.@]" Kernel_function.pretty kf in Value_parameters.BuiltinsOverrides.iter (fun (kf, _) -> check_assigns kf); Value_parameters.UsePrototype.iter (fun kf -> check_assigns kf) (* Do something tasteless in case the user did not put a spec on functions for which he set [-val-use-spec]: generate an incorrect one ourselves *) let generate_specs () = let aux kf = if need_assigns kf then begin let spec = Annotations.funspec ~populate:false kf in Value_parameters.warning "Generating potentially incorrect assigns \ for function '%a' for which option %s is set" Kernel_function.pretty kf Value_parameters.UsePrototype.option_name; (* The function populate_spec may emit a warning. Position a loc. *) Cil.CurrentLoc.set (Kernel_function.get_location kf); ignore (!Annotations.populate_spec_ref kf spec) end in Value_parameters.UsePrototype.iter aux let pre_analysis () = floats_ok (); options_ok (); Split_return.pretty_strategies (); generate_specs (); Widen.precompute_widen_hints (); if Value_parameters.WarnBuiltinOverride.get () then Builtins.warn_definitions_overridden_by_builtins (); Value_perf.reset (); (* We may be resuming Value from a previously crashed analysis. Clear degeneration states *) Value_util.DegenerationPoints.clear (); Cvalue.V.clear_garbled_mix (); Value_util.clear_call_stack (); Db.Value.mark_as_computed () let post_analysis_cleanup ~aborted = Value_util.clear_call_stack (); (* Precompute consolidated states if required *) if Value_parameters.JoinResults.get () then Db.Value.Table_By_Callstack.iter (fun s _ -> ignore (Db.Value.get_stmt_state s)); if not aborted then begin (* Keep memexec results for users that want to resume the analysis *) Mem_exec.cleanup_results (); if not (Value_parameters.SaveFunctionState.is_empty ()) then State_import.save_globals_state (); end let post_analysis () = (* Garbled mix must be dumped here -- at least before the call to mark_green_and_red -- because fresh ones are created when re-evaluating all the alarms, and we get an unpleasant "ghost effect". *) Value_util.dump_garbled_mix (); (* Mark unreachable and RTE statuses. Only do this there, not when the analysis was aborted (hence, not in post_cleanup), because the propagation is incomplete. Also do not mark unreachable statutes if there is an alarm in the initializers (bottom initial state), as we would end up marking the alarm as dead. *) Eval_annots.mark_unreachable (); (* Try to refine the 'Unknown' statuses that have been emitted during this analysis. *) Eval_annots.mark_green_and_red (); Eval_annots.mark_rte (); post_analysis_cleanup ~aborted:false; (* Remove redundant alarms *) if Value_parameters.RmAssert.get () then !Db.Value.rm_asserts () (* Register a signal handler for SIGUSR1, that will be used to abort Value *) let () = let prev = ref (fun _ -> ()) in let handler (_signal: int) = !prev Sys.sigusr1; (* Call previous signal handler *) Value_parameters.warning "Stopping analysis at user request@."; Iterator.signal_abort () in try match Sys.signal Sys.sigusr1 (Sys.Signal_handle handler) with | Sys.Signal_default | Sys.Signal_ignore -> () | Sys.Signal_handle f -> prev := f with Invalid_argument _ -> () (* Ignore: SIGURSR1 is not available on Windows, and possibly on other platforms. *) module Make (Abstract: Abstractions.Eva) = struct module PowersetDomain = Powerset.Make (Abstract.Dom) module Transfer = Transfer_stmt.Make (Abstract) module Logic = Transfer_logic.Make (Abstract.Dom) (PowersetDomain) module Spec = Transfer_specification.Make (Abstract) (PowersetDomain) (Logic) module Init = Initialization.Make (Abstract.Dom) (Abstract.Eval) (Transfer) module Computer = Iterator.Computer (Abstract) (PowersetDomain) (Transfer) (Init) (Logic) (Spec) let initial_state = Init.initial_state let get_cval = match Abstract.Val.get Main_values.CVal.key with | None -> fun _ -> assert false | Some get -> fun value -> get value let get_ploc = match Abstract.Loc.get Main_locations.PLoc.key with | None -> fun _ -> assert false | Some get -> fun location -> get location (* Compute a call to [kf] in the state [state]. The evaluation will be done either using the body of [kf] or its specification, depending on whether the body exists and on option [-val-use-spec]. [call_kinstr] is the instruction at which the call takes place, and is used to update the statuses of the preconditions of [kf]. If [show_progress] is true, the callstack and additional information are printed. *) let compute_using_spec_or_body call_kinstr call state = let kf = call.kf in Value_results.mark_kf_as_called kf; let global = match call_kinstr with Kglobal -> true | _ -> false in let pp = not global && Value_parameters.ValShowProgress.get () in let call_stack = Value_util.call_stack () in if pp then Value_parameters.feedback "@[computing for function %a.@\nCalled from %a.@]" Value_types.Callstack.pretty_short call_stack Cil_datatype.Location.pretty (Cil_datatype.Kinstr.loc call_kinstr); let use_spec = if call.recursive then `Spec (Recursion.empty_spec_for_recursive_call kf) else match kf.fundec with | Declaration (_,_,_,_) -> `Spec (Annotations.funspec kf) | Definition (def, _) -> if Kernel_function.Set.mem kf (Value_parameters.UsePrototype.get ()) then `Spec (Annotations.funspec kf) else `Def def in let cvalue_state = Abstract.Dom.get_cvalue_or_top state in let resulting_states, cacheable = match use_spec with | `Spec spec -> Db.Value.Call_Type_Value_Callbacks.apply (`Spec spec, cvalue_state, call_stack); if Value_parameters.InterpreterMode.get () then Value_parameters.abort "Library function call. Stopping."; Value_parameters.feedback ~once:true "@[using specification for function %a@]" Kernel_function.pretty kf; let vi = Kernel_function.get_vi kf in if Cil.hasAttribute "fc_stdlib" vi.vattr then Library_functions.warn_unsupported_spec vi.vorig_name; Spec.compute_using_specification ~warn:true call_kinstr call spec state, Value_types.Cacheable | `Def _fundec -> Db.Value.Call_Type_Value_Callbacks.apply (`Def, cvalue_state, call_stack); Computer.compute kf call_kinstr state in if pp then Value_parameters.feedback "Done for function %a" Kernel_function.pretty kf; Transfer.{ states = resulting_states; cacheable; builtin=false } (* Mem Exec *) module MemExec = Mem_exec.Make (Abstract.Val) (Abstract.Dom) let compute_and_cache_call stmt call init_state = let default () = compute_using_spec_or_body (Kstmt stmt) call init_state in if Value_parameters.MemExecAll.get () then let args = List.map (fun {avalue} -> Eval.value_assigned avalue) call.arguments in match MemExec.reuse_previous_call call.kf init_state args with | None -> let call_result = default () in let () = if not (!Db.Value.use_spec_instead_of_definition call.kf) && call_result.Transfer.cacheable = Value_types.Cacheable then let final_states = call_result.Transfer.states in MemExec.store_computed_call call.kf init_state args final_states in call_result | Some (states, i) -> let stack = Value_util.call_stack () in let cvalue = Abstract.Dom.get_cvalue_or_top init_state in Db.Value.Call_Type_Value_Callbacks.apply (`Memexec, cvalue, stack); (* Evaluate the preconditions of kf, to update the statuses at this call. *) let spec = Annotations.funspec call.kf in if not (Value_util.skip_specifications call.kf) && Eval_annots.has_requires spec then begin let ab = Logic.create init_state call.kf in ignore (Logic.check_fct_preconditions (Kstmt stmt) call.kf ab init_state); end; if Value_parameters.ValShowProgress.get () then begin Value_parameters.feedback ~current:true "Reusing old results for call to %a" Kernel_function.pretty call.kf; Value_parameters.debug ~dkey "calling Record_Value_New callbacks on saved previous result"; end; let stack_with_call = Value_util.call_stack () in Db.Value.Record_Value_Callbacks_New.apply (stack_with_call, Value_types.Reuse i); (* call can be cached since it was cached once *) Transfer.{states; cacheable = Value_types.Cacheable; builtin=false} else default () let get_cvalue_call call = let lift_left left = { left with lloc = get_ploc left.lloc } in let lift_flagged_value value = { value with v = value.v >>-: get_cval } in let lift_assigned = function | Assign value -> Assign (get_cval value) | Copy (lval, value) -> Copy (lift_left lval, lift_flagged_value value) in let lift_argument arg = { arg with avalue = lift_assigned arg.avalue } in let arguments = List.map lift_argument call.arguments in let rest = List.map (fun (e, assgn) -> e, lift_assigned assgn) call.rest in { call with arguments; rest } let join_states = function | [] -> `Bottom | [state] -> `Value state | s :: l -> `Value (List.fold_left Abstract.Dom.join s l) let compute_call_or_builtin stmt call state = match Builtins.find_builtin_override call.kf with | None -> compute_and_cache_call stmt call state | Some (name, builtin, spec) -> Value_results.mark_kf_as_called call.kf; let kinstr = Kstmt stmt in let kf_name = Kernel_function.get_name call.kf in if Value_parameters.ValShowProgress.get () then Value_parameters.feedback ~current:true "Call to builtin %s%s" name (if kf_name = name then "" else " for function " ^ kf_name); (* Do not track garbled mixes created when interpreting the specification, as the result of the cvalue builtin will overwrite them. *) Locations.Location_Bytes.do_track_garbled_mix false; let states = Spec.compute_using_specification ~warn:false kinstr call spec state in Locations.Location_Bytes.do_track_garbled_mix true; let final_state = states >>- join_states in let cvalue_state = Abstract.Dom.get_cvalue_or_top state in match final_state with | `Bottom -> let cs = Value_util.call_stack () in Db.Value.Call_Type_Value_Callbacks.apply (`Spec spec, cvalue_state, cs); let cacheable = Value_types.Cacheable in Transfer.{states; cacheable; builtin=true} | `Value final_state -> let cvalue_call = get_cvalue_call call in let cvalue_states, cacheable = Builtins.apply_builtin builtin cvalue_call cvalue_state in let insert cvalue_state = Abstract.Dom.set Cvalue_domain.State.key cvalue_state final_state in let states = Bottom.bot_of_list (List.map insert cvalue_states) in Transfer.{states; cacheable; builtin=true} let compute_call = if Abstract.Dom.mem Cvalue_domain.State.key && Abstract.Val.mem Main_values.CVal.key && Abstract.Loc.mem Main_locations.PLoc.key then compute_call_or_builtin else compute_and_cache_call let () = Transfer.compute_call_ref := compute_call let store_initial_state kf init_state = Abstract.Dom.Store.register_initial_state (Value_util.call_stack ()) init_state; let cvalue_state = Abstract.Dom.get_cvalue_or_top init_state in Db.Value.Call_Value_Callbacks.apply (cvalue_state, [kf, Kglobal]) let compute kf init_state = try Value_util.push_call_stack kf Kglobal; store_initial_state kf init_state; let call = {kf; arguments = []; rest = []; return = None; recursive = false} in let final_result = compute_using_spec_or_body Kglobal call init_state in let final_states = final_result.Transfer.states in let final_state = PowersetDomain.(final_states >>-: of_list >>- join) in Value_util.pop_call_stack (); Value_parameters.feedback "done for function %a" Kernel_function.pretty kf; post_analysis (); Abstract.Dom.post_analysis final_state; Value_results.print_summary (); with | Db.Value.Aborted -> post_analysis_cleanup ~aborted:true; (* Signal that a degeneration occurred *) if Value_util.DegenerationPoints.length () > 0 then Value_parameters.error "Degeneration occurred:@\nresults are not correct for lines of code \ that can be reached from the degeneration point.@." let compute_from_entry_point kf ~lib_entry = pre_analysis (); Value_parameters.feedback "Analyzing a%scomplete application starting at %a" (if lib_entry then "n in" else " ") Kernel_function.pretty kf; let initial_state = try Init.initial_state_with_formals ~lib_entry kf with Db.Value.Aborted -> post_analysis_cleanup ~aborted:true; Value_parameters.abort "Degeneration occurred during initialization, aborting." in match initial_state with | `Bottom -> Value_parameters.result "Eva not started because globals \ initialization is not computable."; Eval_annots.mark_invalid_initializers () | `Value init_state -> compute kf init_state let compute_from_init_state kf init_state = pre_analysis (); Abstract.Dom.Store.register_global_state (`Value init_state); compute kf init_state end (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/compute_functions.mli���������������������������������0000666�0000000�0000000�00000004075�13571573400�022321� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Value analysis of entire functions, using Eva engine. *) open Cil_types open Eval module Make (Abstract: Abstractions.Eva) : sig (** Compute a call to the main function. *) val compute_from_entry_point: kernel_function -> lib_entry:bool -> unit (** Compute a call to the main function from the given initial state. *) val compute_from_init_state: kernel_function -> Abstract.Dom.t -> unit val initial_state: lib_entry:bool -> Abstract.Dom.t or_bottom end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/evaluation.ml�����������������������������������������0000666�0000000�0000000�00000203136�13571573400�020552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Evaluation of expressions to values. *) open Cil_types open Eval (* The forward evaluation of an expression [e] gives a value to each subterm of [e], from its variables to the root expression [e]. It also computes the set of alarms which may occur in the evaluation of each subterm. All these intermediate results of an evaluation are stored in a cache, whose type is described in eval.mli. The cache is the complete result of the evaluation. *) (* The forward evaluation of an expression relies on queries of the abstract domain, which must be able to assign a value to some expression (see abstract_domain.mli for more details). An oracle for the value of expressions is also given to the domain, which may use it to build its answer. This oracle is the main forward evaluation function itself, so the domain may initiate the evaluation of some new expressions. To avoid loops in the use of the oracle: - before any computation or an expression [e], Value.top is stored in the cache; this dummy value will be erased at the end of the computation, but in the meantime, any evaluation of [e] (by the oracle) returns top immediately. - fuel is used to limit the depth of the use of the oracle. The fuel level is decremented at each use of the oracle up to zero, where the oracle returns top. The fuel level with which an expression has been evaluated is stored in the cache. The recomputation of an expression may be performed with a higher fuel than before, if needed. *) (* Reductions may happen in the forward evaluation when: – a domain returns a value more precise than the one internally computed; – alarms are emitted by an operation on values. In particular, locations are reduced to their valid part for a read or write operation. These reductions are propagated to the sub-expressions by a backward evaluation, after the forward evaluation has finished. The backward evaluation also propagates the reduction stemming from an if statement, where the condition may be reduced to zero or non-zero. *) (* An expression is deemed volatile if it contains an access to a volatile location. The forward evaluation computes this syntactically, by checking for volatile qualifiers on sub-lvalues and intermediate types. A 'volatile' flag is propagated through the expression. This flag prevents the update of the value computed by the initial forward evaluation. *) (* When a backward reduction has been successfully performed, the domain may initiate new reductions, via the reduce_further function. A fuel level is used in the same way as for the forward evaluation to avoid reduction loops. *) (* The fuel level with which an expression has been evaluated. *) type fuel = | Loop (* No evaluation at all: the value in the cache is a dummy value, set to avoid a loop in the use of the oracle. *) | Finite of int (* An evaluation with a finite level of fuel, which has been consumed. *) | Infty (* The evaluation never used all its fuel. *) let less_fuel_than n = function | Loop -> true | Finite f -> f >= n | Infty -> true type reduction_kind = | Neither | Forward | Backward let update_reduction reduction b = match reduction with | Neither -> if b then Neither else Forward | x -> x (* Some information about a forward evaluation. *) type forward_report = { fuel: fuel; (* The fuel used for the evaluation. *) reduction: reduction_kind; (* Whether a reduction has occur, which may be propagated to the sub-terms. *) volatile: bool; (* If true, the expression may contain an access to a volatile location, and thus cannot be safely reduced. *) } (* Parameters of the evaluation of the location of a left value. *) type loc_report = { for_writing: bool; with_reduction: bool; } (* If a value is cached by an external source, we assume that it was computed with infty fuel, that possible reduction have been propagated backward, and that the expression cannot be volatile. *) let extern_report = { fuel = Infty; reduction = Neither; volatile = false } (* Report used when the cache is filled with a dummy value to avoid evaluation loops. *) let dummy_report = { fuel = Loop; reduction = Neither; volatile = false } let no_fuel = -1 let root_fuel () = Value_parameters.OracleDepth.get () let backward_fuel () = Value_parameters.ReductionDepth.get () let already_precise_loc_report ~for_writing ~reduction loc_report = (not for_writing || loc_report.for_writing) && (not reduction || loc_report.with_reduction) let rec may_be_reduced_offset = function | NoOffset -> false | Field (_, offset) -> may_be_reduced_offset offset | Index _ -> true let may_be_reduced_lval (host, offset) = match host with | Var _ -> may_be_reduced_offset offset | Mem _ -> true let warn_pointer_comparison typ = match Value_parameters.WarnPointerComparison.get () with | "none" -> false | "all" -> true | "pointer" -> Cil.isPointerType (Cil.unrollType typ) | _ -> assert false let propagate_all_pointer_comparison typ = not (Cil.isPointerType typ) || Value_parameters.UndefinedPointerComparisonPropagateAll.get () let comparison_kind = function | Eq | Ne -> Some Abstract_value.Equality | Le | Lt | Ge | Gt -> Some Abstract_value.Relation | _ -> None let signed_ikind = function | IBool -> IBool | IChar | ISChar | IUChar -> ISChar | IInt | IUInt -> IInt | IShort | IUShort -> IShort | ILong | IULong -> ILong | ILongLong | IULongLong -> ILongLong let rec signed_counterpart typ = match Cil.unrollType typ with | TInt (ik, attrs) -> TInt (signed_ikind ik, attrs) | TEnum ({ekind = ik} as info, attrs) -> let info = { info with ekind = signed_ikind ik} in TEnum (info, attrs) | TPtr _ -> signed_counterpart Cil.(theMachine.upointType) | _ -> assert false module MemoDowncastConvertedAlarm = State_builder.Hashtbl (Cil_datatype.Exp.Hashtbl) (Cil_datatype.Exp) (struct let name = "Value.Evaluation.MemoDowncastConvertedAlarm" let size = 16 let dependencies = [ Ast.self ] end) let exp_alarm_signed_converted_downcast = MemoDowncastConvertedAlarm.memo (fun exp -> let src_typ = Cil.typeOf exp in let signed_typ = signed_counterpart src_typ in let signed_exp = Cil.new_exp ~loc:exp.eloc (CastE (signed_typ, exp)) in signed_exp) module type S = sig type state type value type origin type loc module Valuation : Valuation with type value = value and type origin = origin and type loc = loc val evaluate : ?valuation:Valuation.t -> ?reduction:bool -> state -> exp -> (Valuation.t * value) evaluated val copy_lvalue : ?valuation:Valuation.t -> state -> lval -> (Valuation.t * value flagged_value) evaluated val lvaluate : ?valuation:Valuation.t -> for_writing:bool -> state -> lval -> (Valuation.t * loc * typ) evaluated val reduce: ?valuation:Valuation.t -> state -> exp -> bool -> Valuation.t evaluated val assume: ?valuation:Valuation.t -> state -> exp -> value -> Valuation.t or_bottom val eval_function_exp: exp -> ?args:exp list -> state -> (Kernel_function.t * Valuation.t) list evaluated val interpret_truth: alarm:(unit -> Alarms.t) -> 'a -> 'a Abstract_value.truth -> 'a evaluated end let return t = `Value t, Alarmset.none (* Intersects [alarms] with the only possible alarms from the dereference of the left-value [lval] of type [typ]. Useful if the abstract domain returns a non-closed AllBut alarmset for some lvalues. *) let close_dereference_alarms lval alarms = let init_alarm = Alarms.Uninitialized lval and escap_alarm = Alarms.Dangling lval in let init_status = Alarmset.find init_alarm alarms and escap_status = Alarmset.find escap_alarm alarms in let closed_alarms = Alarmset.set init_alarm init_status Alarmset.none in let closed_alarms = Alarmset.set escap_alarm escap_status closed_alarms in closed_alarms let define_value value = { v = `Value value; initialized = true; escaping = false } (* [record] and [alarms] must be the value and the alarms resulting from the evaluation of the lvalue [lval]. This function removes the alarms about the initialization and the escaping of [lval], and sets accordingly the initialized and escaping flags of the computed value. *) let indeterminate_copy lval result alarms = let init_alarm = Alarms.Uninitialized lval and escap_alarm = Alarms.Dangling lval in let initialized = Alarmset.find init_alarm alarms = Alarmset.True and escaping = not (Alarmset.find escap_alarm alarms = Alarmset.True) in let alarms = if not (initialized) then Alarmset.set init_alarm Alarmset.True alarms else alarms in let alarms = if escaping then Alarmset.set escap_alarm Alarmset.True alarms else alarms in let reductness = Unreduced in let v, origin = match result with | `Bottom -> `Bottom, None | `Value (v, origin) -> `Value v, Some origin in let value = { v; initialized; escaping } in let record = { value; origin; reductness; val_alarms = alarms} in record, alarms module type Value = sig include Abstract.Value.External val reduce : t -> t end module type Queries = sig include Abstract_domain.Queries include Datatype.S with type t = state end module Make (Value : Value) (Loc : Abstract_location.S with type value = Value.t) (Domain : Queries with type value = Value.t and type location = Loc.location) = struct type state = Domain.state type value = Value.t type origin = Domain.origin type loc = Loc.location module ECache = Cil_datatype.ExpStructEq.Map module LCache = Cil_datatype.LvalStructEq.Map (* Imperative cache for the evaluation: all intermediate results of an evaluation are cached here. See [eval.mli] for more details. *) module Cache = struct type value = Value.t type origin = Domain.origin type loc = Loc.location (* For expression, the forward_report about the evaluation is also stored. *) type t = ((value, origin) record_val * forward_report) ECache.t * (loc record_loc * (forward_report * loc_report)) LCache.t (* Interface of Context.Valuation *) let empty : t = ECache.empty, LCache.empty let find (cache:t) exp = try `Value (fst (ECache.find exp (fst cache))) with Not_found -> `Top let add (cache:t) exp record = let s, t = cache in ECache.add exp (record, extern_report) s, t let fold f (cache:t) acc = ECache.fold (fun e (r, _) acc -> f e r acc) (fst cache) acc (* Functions used by the evaluator, with the boolean for backward reduction. *) let find' (cache:t) exp = ECache.find exp (fst cache) let add' (cache:t) exp record = let s, t = cache in ECache.add exp record s, t (* Locations of lvalue. *) let find_loc (cache:t) lval = try `Value (fst (LCache.find lval (snd cache))) with Not_found -> `Top (* Locations of lvalue. *) let find_loc' (cache:t) lval = try `Value (LCache.find lval (snd cache)) with Not_found -> `Top let add_loc' (cache:t) lval record = let s, t = cache in s, LCache.add lval record t let remove (s, t) expr = ECache.remove expr s, t let remove_loc (s, t) lval = s, LCache.remove lval t end (* Imperative cache for the evaluator. A reference is mandatory here, because the cache must be also filled by the evaluations initiated by a domain through the oracle, but should not leak in the domain queries signature. *) let cache = ref Cache.empty (* Was the fuel entirely consumed? *) let fuel_consumed = ref false let top_record = let flagged_top = { v = `Value Value.top; initialized = false; escaping = true } in { value = flagged_top; origin = None; reductness = Dull; val_alarms = Alarmset.all } (* Updates the abstractions stored in the cache for the expression [expr] with the given record, report and value. [kind] is the type of the reduction (forward or backward). *) let reduce_expr_recording kind expr (record, report) value = (* Avoids reduction of volatile expressions. *) if report.volatile then () else let red = record.reductness in let reductness = if red = Unreduced && kind <> Neither then Reduced else red in (* TODO: allow to reduce initialized and escaping flags? *) let record = { record with value = define_value value; reductness } in let report = { report with reduction = kind } in cache := Cache.add' !cache expr (record, report) (* Updates the abstractions stored in the cache for the expression [expr] with the value [value]. [kind] is the type of the reduction.*) let reduce_expr_value kind expr value = let record, report = Cache.find' !cache expr in reduce_expr_recording kind expr (record, report) value let reduce_value record = let v = record.value.v >>-: Value.reduce in { record with value = {record.value with v = v} } (* ------------------------------------------------------------------------ Forward Operations, Alarms and Reductions ------------------------------------------------------------------------ *) (* Handles the result of an [assume] function from value abstractions (see abstract_values.mli for more details), applied to the initial [value]. If the value could have been reduced, [reduce] is applied on the new value. If the status is not true, [alarm] is used to create the alarm. *) let process_truth ~reduce ~alarm value = let build_alarm status = Alarmset.singleton ~status (alarm ()) in function | `Unreachable -> `Bottom, Alarmset.none | `False -> `Bottom, build_alarm Alarmset.False | `Unknown v -> reduce v; `Value v, build_alarm Alarmset.Unknown | `TrueReduced v -> reduce v; `Value v, Alarmset.none | `True -> `Value value, Alarmset.none (* Does not register the possible reduction, as the initial [value] has not been saved yet. *) let interpret_truth ~alarm value truth = let reduce _ = () in process_truth ~reduce ~alarm value truth let reduce_argument (e, v) new_value = if not (Value.equal v new_value) then reduce_expr_value Forward e new_value (* Registers the new value if it has been reduced. *) let reduce_by_truth ~alarm (expr, value) truth = let reduce = reduce_argument (expr, value) in process_truth ~reduce ~alarm value truth (* Processes the results of assume_comparable, that affects both arguments of the comparison. *) let reduce_by_double_truth ~alarm (e1, v1) (e2, v2) truth = let reduce (new_value1, new_value2) = Extlib.may (fun e1 -> reduce_argument (e1, v1) new_value1) e1; reduce_argument (e2, v2) new_value2; in process_truth ~reduce ~alarm (v1, v2) truth let is_true = function | `True | `TrueReduced _ -> true | _ -> false let may_overflow = function | Shiftlt | Mult | MinusPP | MinusPI | IndexPI | PlusPI | PlusA | Div | Mod | MinusA -> true | _ -> false let truncate_bound overflow_kind bound bound_kind expr value = let alarm () = Alarms.Overflow (overflow_kind, expr, bound, bound_kind) in let bound = Abstract_value.Int bound in let truth = Value.assume_bounded bound_kind bound value in interpret_truth ~alarm value truth let truncate_lower_bound overflow_kind expr range value = let min_bound = Eval_typ.range_lower_bound range in let bound_kind = Alarms.Lower_bound in truncate_bound overflow_kind min_bound bound_kind expr value let truncate_upper_bound overflow_kind expr range value = let max_bound = Eval_typ.range_upper_bound range in let bound_kind = Alarms.Upper_bound in truncate_bound overflow_kind max_bound bound_kind expr value let truncate_integer overflow_kind expr range value = truncate_lower_bound overflow_kind expr range value >>= fun value -> truncate_upper_bound overflow_kind expr range value let handle_integer_overflow expr range value = let signed = range.Eval_typ.i_signed in if (signed && Kernel.SignedOverflow.get ()) || (not signed && Kernel.UnsignedOverflow.get ()) then let overflow_kind = if signed then Alarms.Signed else Alarms.Unsigned in truncate_integer overflow_kind expr range value else let v = Value.rewrap_integer range value in if range.Eval_typ.i_signed && not (Value.equal value v) then Value_parameters.warning ~wkey:Value_parameters.wkey_signed_overflow ~current:true ~once:true "2's complement assumed for overflow"; return v let restrict_float ?(reduce=false) ~assume_finite expr fkind value = let truth = Value.assume_not_nan ~assume_finite fkind value in let alarm () = if assume_finite then Alarms.Is_nan_or_infinite (expr, fkind) else Alarms.Is_nan (expr, fkind) in if reduce then reduce_by_truth ~alarm (expr, value) truth else interpret_truth ~alarm value truth let remove_special_float expr fk value = match Kernel.SpecialFloat.get () with | "none" -> return value | "nan" -> restrict_float ~assume_finite:false expr fk value | "non-finite" -> restrict_float ~assume_finite:true expr fk value | _ -> assert false let handle_overflow ~may_overflow expr typ value = match Eval_typ.classify_as_scalar typ with | Some (Eval_typ.TSInt range) -> (* If the operation cannot overflow, truncates the abstract value to the range of the type (without emitting alarms). This can regain some precision when the abstract operator was too imprecise. Otherwise, truncates or rewraps the abstract value according to the parameters of the analysis. *) if not may_overflow then fst (truncate_integer Alarms.Signed expr range value), Alarmset.none else handle_integer_overflow expr range value | Some (Eval_typ.TSFloat fk) -> remove_special_float expr fk value | Some (Eval_typ.TSPtr _) | None -> return value (* Removes NaN and infinite floats from the value read from a lvalue. *) let remove_special_float_lvalue typ lval res = match typ with | TFloat (fkind, _) -> res >>= fun (value, origin) -> let expr = Value_util.lval_to_exp lval in remove_special_float expr fkind value >>=: fun new_value -> new_value, origin | _ -> res (* Removes invalid bool values from a lvalue. *) let assume_valid_bool typ lval res = if not (Kernel.InvalidBool.get ()) then res else match typ with | TInt (IBool, _) -> res >>= fun (value, origin) -> let one = Abstract_value.Int Integer.one in let truth = Value.assume_bounded Alarms.Upper_bound one value in let alarm () = Alarms.Invalid_bool lval in interpret_truth ~alarm value truth >>=: fun new_value -> new_value, origin | _ -> res (* Reduce the rhs argument of a shift so that it fits inside [size] bits. *) let reduce_shift_rhs typ expr value = let size = Cil.bitsSizeOf typ in let size_int = Abstract_value.Int (Integer.of_int (size - 1)) in let zero_int = Abstract_value.Int Integer.zero in let alarm () = Alarms.Invalid_shift (expr, Some size) in let truth = Value.assume_bounded Alarms.Lower_bound zero_int value in reduce_by_truth ~alarm (expr, value) truth >>= fun value -> let truth = Value.assume_bounded Alarms.Upper_bound size_int value in reduce_by_truth ~alarm (expr, value) truth (* Reduces the right argument of a shift, and if [warn_negative] is true, also reduces its left argument to a positive value. *) let reduce_shift ~warn_negative typ (e1, v1) (e2, v2) = reduce_shift_rhs typ e2 v2 >>= fun v2 -> if warn_negative && Bit_utils.is_signed_int_enum_pointer typ then (* Cannot shift a negative value *) let zero_int = Abstract_value.Int Integer.zero in let alarm () = Alarms.Invalid_shift (e1, None) in let truth = Value.assume_bounded Alarms.Lower_bound zero_int v1 in reduce_by_truth ~alarm (e1, v1) truth >>=: fun v1 -> v1, v2 else return (v1, v2) (* Emits alarms for an index out of bound, and reduces its value. *) let assume_valid_index ~size ~size_expr ~index_expr value = let size_int = Abstract_value.Int (Integer.pred size) in let zero_int = Abstract_value.Int Integer.zero in let alarm () = Alarms.Index_out_of_bound (index_expr, None) in let truth = Value.assume_bounded Alarms.Lower_bound zero_int value in reduce_by_truth ~alarm (index_expr, value) truth >>= fun value -> let alarm () = Alarms.Index_out_of_bound (index_expr, Some size_expr) in let truth = Value.assume_bounded Alarms.Upper_bound size_int value in reduce_by_truth ~alarm (index_expr, value) truth let assume_valid_binop typ (e1, v1 as arg1) op (e2, v2 as arg2) = if Cil.isIntegralType typ then match op with | Div | Mod -> let truth = Value.assume_non_zero v2 in let alarm () = Alarms.Division_by_zero e2 in reduce_by_truth ~alarm arg2 truth >>=: fun v2 -> v1, v2 | Shiftrt -> let warn_negative = Kernel.RightShiftNegative.get () in reduce_shift ~warn_negative typ arg1 arg2 | Shiftlt -> let warn_negative = Kernel.LeftShiftNegative.get () in reduce_shift ~warn_negative typ arg1 arg2 | MinusPP when Value_parameters.WarnPointerSubstraction.get () -> let kind = Abstract_value.Subtraction in let truth = Value.assume_comparable kind v1 v2 in let alarm () = Alarms.Differing_blocks (e1, e2) in let arg1 = Some e1, v1 in reduce_by_double_truth ~alarm arg1 arg2 truth | _ -> return (v1, v2) else return (v1, v2) (* Pretty prints the result of a comparison independently of the value abstractions used. *) let pretty_zero_or_one fmt v = let str = if Value.(equal v zero) then "{0}" else if Value.(equal v one) then "{1}" else "{0; 1}" in Format.fprintf fmt "%s" str let forward_comparison ~compute typ kind (e1, v1) (e2, v2) = let truth = Value.assume_comparable kind v1 v2 in let alarm () = Alarms.Pointer_comparison (e1, e2) in let propagate_all = propagate_all_pointer_comparison typ in let args, alarms = if warn_pointer_comparison typ then if propagate_all then `Value (v1, v2), snd (interpret_truth ~alarm (v1, v2) truth) else reduce_by_double_truth ~alarm (e1, v1) (e2, v2) truth else `Value (v1, v2), Alarmset.none in let result = args >>- fun (v1, v2) -> compute v1 v2 in let value = if is_true truth || not propagate_all then result else let zero_or_one = Value.(join zero one) in if Cil.isPointerType typ then Value_parameters.result ~current:true ~once:true ~dkey:Value_parameters.dkey_pointer_comparison "evaluating condition to {0; 1} instead of %a because of UPCPA" (Bottom.pretty pretty_zero_or_one) result; `Value zero_or_one in value, alarms let forward_binop typ (e1, v1 as arg1) op arg2 = let typ_e1 = Cil.unrollType (Cil.typeOf e1) in match comparison_kind op with | Some kind -> let compute v1 v2 = Value.forward_binop typ_e1 op v1 v2 in (* Detect zero expressions created by the evaluator *) let e1 = if Value_util.is_value_zero e1 then None else Some e1 in forward_comparison ~compute typ_e1 kind (e1, v1) arg2 | None -> assume_valid_binop typ arg1 op arg2 >>=. fun (v1, v2) -> Value.forward_binop typ_e1 op v1 v2 let forward_unop unop (e, v as arg) = let typ = Cil.unrollType (Cil.typeOf e) in if unop = LNot then let kind = Abstract_value.Equality in let compute _ v = Value.forward_unop typ unop v in forward_comparison ~compute typ kind (None, Value.zero) arg else Value.forward_unop typ unop v, Alarmset.none (* ------------------------------------------------------------------------ Casts ------------------------------------------------------------------------ *) type integer_range = Eval_typ.integer_range = { i_bits: int; i_signed: bool } let cast_integer overflow_kind expr ~src ~dst value = let value = if Eval_typ.(Integer.lt (range_lower_bound src) (range_lower_bound dst)) then truncate_lower_bound overflow_kind expr dst value else return value in value >>= fun value -> if Eval_typ.(Integer.gt (range_upper_bound src) (range_upper_bound dst)) then truncate_upper_bound overflow_kind expr dst value else return value (* Relaxed semantics for downcasts into signed types: first converts the value to the signed counterpart of the source type, and then downcasts it into the signed destination type. Emits only alarms for the second cast. *) let relaxed_signed_downcast expr ~src ~dst value = let expr, src, value = if not src.i_signed then let signed_src = { src with i_signed = true } in let signed_v = Value.rewrap_integer signed_src value in let signed_exp = exp_alarm_signed_converted_downcast expr in signed_exp, signed_src, signed_v else expr, src, value in cast_integer Alarms.Signed_downcast expr ~src ~dst value let cast_int_to_int expr ~src ~dst value = (* Regain some precision in case a transfer function was imprecise. This should probably be done in the transfer function, though. *) let value = if Value.(equal top_int value) then Value.rewrap_integer src value else value in if Eval_typ.range_inclusion src dst then return value (* Upcast, nothing to check. *) else if dst.i_signed then (* Signed downcast. *) if Kernel.SignedDowncast.get () then cast_integer Alarms.Signed_downcast expr ~src ~dst value else if Value_parameters.WarnSignedConvertedDowncast.get () then relaxed_signed_downcast expr ~src ~dst value else return (Value.rewrap_integer dst value) else (* Unsigned downcast. *) if Kernel.UnsignedDowncast.get () then cast_integer Alarms.Unsigned_downcast expr ~src ~dst value else return (Value.rewrap_integer dst value) (* Re-export type here *) type scalar_typ = Eval_typ.scalar_typ = | TSInt of integer_range | TSPtr of integer_range | TSFloat of fkind let round fkind f = match fkind with | FFloat -> Floating_point.round_to_single_precision_float f | FDouble | FLongDouble -> f let truncate_float_bound fkind bound bound_kind expr value = let next_int, prev_float, is_beyond = match bound_kind with | Alarms.Upper_bound -> Integer.succ, Fval.F.prev_float, Integer.ge | Alarms.Lower_bound -> Integer.pred, Fval.F.next_float, Integer.le in let ibound = next_int bound in let fbound = round fkind (Integer.to_float ibound) in let float_bound = if is_beyond (Integer.of_float fbound) ibound then prev_float (Fval.kind fkind) fbound else fbound in let alarm () = Alarms.Float_to_int (expr, bound, bound_kind) in let bound = Abstract_value.Float (float_bound, fkind) in let truth = Value.assume_bounded bound_kind bound value in reduce_by_truth ~alarm (expr, value) truth let truncate_float fkind dst_range expr value = let max_bound = Eval_typ.range_upper_bound dst_range in let bound_kind = Alarms.Upper_bound in truncate_float_bound fkind max_bound bound_kind expr value >>= fun value -> let min_bound = Eval_typ.range_lower_bound dst_range in let bound_kind = Alarms.Lower_bound in truncate_float_bound fkind min_bound bound_kind expr value let forward_cast ~dst expr value = let src = Cil.typeOf expr in match Eval_typ.(classify_as_scalar src, classify_as_scalar dst) with | None, _ | _, None -> return value (* Unclear whether this happens. *) | Some src_type, Some dst_type -> let value, alarms = match src_type, dst_type with | (TSInt src | TSPtr src), (TSInt dst | TSPtr dst) -> cast_int_to_int ~src ~dst expr value | TSFloat src, (TSInt dst | TSPtr dst) -> restrict_float ~reduce:true ~assume_finite:true expr src value >>= truncate_float src dst expr | (TSInt _ | TSPtr _), TSFloat _ -> (* Cannot overflow with 32 bits float. *) `Value value, Alarmset.none | TSFloat _, TSFloat _ -> `Value value, Alarmset.none in value >>- Value.forward_cast ~src_type ~dst_type, alarms (* ------------------------------------------------------------------------ Forward Evaluation ------------------------------------------------------------------------ *) (* Makes the oracle for the domain queries, called by the forward evaluation. Defined below, after applying the subdivided_evaluation to the forward evaluation function. *) let make_oracle = ref (fun _ _ _ -> `Value Value.top, Alarmset.all) (* Returns the cached value and alarms for the evaluation if it exists; call [coop_forward_eval] and caches its result otherwise. Also returns a boolean indicating whether the expression is volatile. *) let rec root_forward_eval fuel state expr = (* Search in the cache for the result of a previous computation. *) try let record, report = Cache.find' !cache expr in (* If the record was computed with more fuel than [fuel], return it. *) if report.fuel = Loop then fuel_consumed := true; if less_fuel_than fuel report.fuel then (record.value.v >>-: fun v -> v, report.volatile), record.val_alarms else raise Not_found (* If no result found, evaluate the expression. *) with Not_found -> let previous_fuel_consumed = !fuel_consumed in (* Fuel not consumed for this new evaluation. *) fuel_consumed := false; (* Fill the cache to avoid loops in the use of the oracle. *) cache := Cache.add' !cache expr (top_record, dummy_report); (* Evaluation of [expr]. *) let result, alarms = coop_forward_eval fuel state expr in let value = result >>- fun (record, reduction, volatile) -> (* Put the alarms in the record. *) let record = { record with val_alarms = alarms } in (* Inter-reduction of the value (in case of a reduced product). *) let record = reduce_value record in (* Cache the computed result with an appropriate report. *) let fuel = if !fuel_consumed then Finite fuel else Infty in let report = {fuel; reduction; volatile} in cache := Cache.add' !cache expr (record, report); record.value.v >>-: fun v -> v, volatile in (* Reset the flag fuel_consumed. *) fuel_consumed := previous_fuel_consumed || !fuel_consumed; value, alarms and forward_eval fuel state expr = root_forward_eval fuel state expr >>=: fst (* The functions below returns, along with the computed value (when it is not bottom): - the state of reduction of the current expression: Neither if it has not been reduced, Forward otherwise. - a boolean indicating whether the expression is volatile. *) (* Asks the abstract domain for abstractions (value and alarms) of [expr], and performs the narrowing with the abstractions computed by [internal_forward_eval]. *) and coop_forward_eval fuel state expr = match expr.enode with | Lval lval -> eval_lval fuel state lval | BinOp _ | UnOp _ | CastE _ -> begin let intern_value, alarms = internal_forward_eval fuel state expr in let oracle = !make_oracle fuel state in let domain_value, alarms' = Domain.extract_expr oracle state expr in (* Intersection of alarms, as each sets of alarms are correct and "complete" for the evaluation of [expr]. *) match Alarmset.inter alarms alarms' with | `Inconsistent -> (* May happen for a product of states with no concretization. Such cases are reported to the user by transfer_stmt. *) `Bottom, Alarmset.none | `Value alarms -> let v = intern_value >>- fun (intern_value, reduction, volatile) -> domain_value >>- fun (domain_value, origin) -> Value.narrow intern_value domain_value >>-: fun result -> let reductness = if Value.equal domain_value result then Unreduced else if Value.(equal domain_value top) then Created else Reduced in let reduction = update_reduction reduction (Value.equal intern_value result) and origin = Some origin and value = define_value result in (* The proper alarms will be set in the record by forward_eval. *) {value; origin; reductness; val_alarms = Alarmset.all}, reduction, volatile in v, alarms end | _ -> internal_forward_eval fuel state expr >>=: fun (value, reduction, volatile) -> let value = define_value value and origin = None and reductness = Dull in {value; origin; reductness; val_alarms = Alarmset.all}, reduction, volatile (* Recursive descent in the sub-expressions. *) and internal_forward_eval fuel state expr = let compute_reduction (v, a) volatile = (v, a) >>=: fun v -> let reduction = if Alarmset.is_empty a then Neither else Forward in v, reduction, volatile in match expr.enode with | Info (e, _) -> internal_forward_eval fuel state e | Const constant -> internal_forward_eval_constant fuel state expr constant | Lval _lval -> assert false | AddrOf v | StartOf v -> lval_to_loc fuel ~for_writing:false ~reduction:false state v >>=: fun (loc, _, _) -> Loc.to_value loc, Neither, false | UnOp (op, e, typ) -> root_forward_eval fuel state e >>= fun (v, volatile) -> forward_unop op (e, v) >>= fun v -> let may_overflow = op = Neg in let v = handle_overflow ~may_overflow expr typ v in compute_reduction v volatile | BinOp (op, e1, e2, typ) -> root_forward_eval fuel state e1 >>= fun (v1, volatile1) -> root_forward_eval fuel state e2 >>= fun (v2, volatile2) -> forward_binop typ (e1, v1) op (e2, v2) >>= fun v -> let may_overflow = may_overflow op in let v = handle_overflow ~may_overflow expr typ v in compute_reduction v (volatile1 || volatile2) | CastE (dst, e) -> root_forward_eval fuel state e >>= fun (value, volatile) -> let v = forward_cast ~dst e value in let v = match Cil.unrollType dst with | TFloat (fkind, _) -> v >>= remove_special_float expr fkind | _ -> v in compute_reduction v volatile | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> match Cil.constFoldToInt expr with | Some v -> return (Value.inject_int (Cil.typeOf expr) v, Neither, false) | _ -> return (Value.top_int, Neither, false) and internal_forward_eval_constant fuel state expr constant = let eval = match constant with | CEnum {eival = e} -> forward_eval fuel state e | CReal (_f, fkind, _fstring) -> let value = Value.constant expr constant in remove_special_float expr fkind value (* Integer constants never overflow, because the front-end chooses a suitable type. *) | _ -> return (Value.constant expr constant) in eval >>=: fun value -> value, Neither, false (* ------------------------------------------------------------------------ Lvalue evaluation ------------------------------------------------------------------------ *) (* Calls the internal evaluation of an lvalue to a location, and stores the result in the cache. If the result is already in the cache, the computation is avoided, unless if it may reduce the cache. If [reduction] is false, don't reduce the location and the offset by their valid parts, and don't emit alarms about their validity. If the location is not bottom, the function also returns the typ of the lvalue, and a boolean indicating that the lvalue contains a sub-expression with volatile qualifier (in its host or offset). *) and lval_to_loc fuel ~for_writing ~reduction state lval = let compute () = let res, alarms = reduced_lval_to_loc fuel ~for_writing ~reduction state lval in let res = res >>-: fun (loc, typ_offs, red, volatile) -> let record = { loc; typ = typ_offs; loc_alarms = alarms } and report = { fuel = Finite fuel; reduction = red; volatile } and loc_report = { for_writing; with_reduction = reduction } in cache := Cache.add_loc' !cache lval (record, (report, loc_report)); (loc, typ_offs, volatile) in res, alarms in match Cache.find_loc' !cache lval with | `Value (record, (report, loc_report)) -> if already_precise_loc_report ~for_writing ~reduction loc_report && less_fuel_than fuel report.fuel then `Value (record.loc, record.typ, report.volatile), record.loc_alarms else compute () | `Top -> compute () (* If [reduction] is false, don't reduce the location and the offset by their valid parts, and don't emit alarms about their validity. *) and reduced_lval_to_loc fuel ~for_writing ~reduction state lval = internal_lval_to_loc fuel ~for_writing ~reduction state lval >>= fun (loc, typ, volatile) -> if not reduction then `Value (loc, typ, Neither, volatile), Alarmset.none else let bitfield = Cil.isBitfield lval in let truth = Loc.assume_valid_location ~for_writing ~bitfield loc in let alarm () = let access_kind = if for_writing then Alarms.For_writing else Alarms.For_reading in Alarms.Memory_access (lval, access_kind) in interpret_truth ~alarm loc truth >>=: fun valid_loc -> let reduction = if Loc.equal_loc valid_loc loc then Neither else Forward in valid_loc, typ, reduction, volatile (* Internal evaluation of a lvalue to an abstract location. Combination of the evaluation of the right part of an lval (an host) with an offset, to obtain a location *) and internal_lval_to_loc fuel ~for_writing ~reduction state lval = let host, offset = lval in let typ = match host with | Var host -> host.vtype | Mem x -> Cil.typeOf_pointed (Cil.typeOf x) in eval_offset fuel ~reduce_valid_index:reduction typ state offset >>= fun (offs, typ_offs, offset_volatile) -> if for_writing && Value_util.is_const_write_invalid typ_offs then `Bottom, Alarmset.singleton ~status:Alarmset.False (Alarms.Memory_access (lval, Alarms.For_writing)) else eval_host fuel state typ_offs offs host >>=: fun (loc, host_volatile) -> loc, typ_offs, offset_volatile || host_volatile (* Host evaluation. Also returns a boolean which is true if the host contains a volatile sub-expression. *) and eval_host fuel state typ_offset offs = function | Var host -> (Loc.forward_variable typ_offset host offs >>-: fun loc -> loc, false), Alarmset.none | Mem x -> root_forward_eval fuel state x >>=. fun (loc_lv, volatile) -> Loc.forward_pointer typ_offset loc_lv offs >>-: fun loc -> loc, volatile (* Offset evaluation. Also returns a boolean which is true if the offset contains a volatile sub-expression. *) and eval_offset fuel ~reduce_valid_index typ state = function | NoOffset -> return (Loc.no_offset, typ, false) | Index (index_expr, remaining) -> let typ_pointed, array_size = match Cil.unrollType typ with | TArray (t, size, _, _) -> t, size | t -> Value_parameters.fatal ~current:true "Got type '%a'" Printer.pp_typ t in eval_offset fuel ~reduce_valid_index typ_pointed state remaining >>= fun (roffset, typ_offs, remaining_volatile) -> root_forward_eval fuel state index_expr >>= fun (index, volatile) -> let valid_index = if not (Kernel.SafeArrays.get ()) || not reduce_valid_index then `Value index, Alarmset.none else try (* If possible, reduce the index value by the array size. *) let size = Cil.lenOfArray64 array_size in (* Handle the special GCCism of zero-sized arrays: Frama-C pretends their size is unknown, exactly like GCC. *) if Integer.is_zero size then `Value index, Alarmset.none else let size_expr = Extlib.the array_size in (* array_size exists *) assume_valid_index ~size ~size_expr ~index_expr index with | Cil.LenOfArray -> `Value index, Alarmset.none (* unknown array size *) in valid_index >>=: fun index -> Loc.forward_index typ_pointed index roffset, typ_offs, remaining_volatile || volatile | Field (fi, remaining) -> let attrs = Cil.filter_qualifier_attributes (Cil.typeAttrs typ) in let typ_fi = Cil.typeAddAttributes attrs fi.ftype in eval_offset fuel ~reduce_valid_index typ_fi state remaining >>=: fun (r, typ_res, volatile) -> let off = Loc.forward_field typ fi r in off, typ_res, volatile and eval_lval ?(indeterminate=false) fuel state lval = (* Computes the location of [lval]. *) lval_to_loc fuel ~for_writing:false ~reduction:true state lval >>= fun (loc, typ_lv, volatile_expr) -> let typ_lv = Cil.unrollType typ_lv in (* the lvalue is volatile: - if it has qualifier volatile (lval_to_loc propagates qualifiers in the proper way through offsets) - if it contains a sub-expression which is volatile (volatile_expr) *) let volatile = volatile_expr || Cil.typeHasQualifier "volatile" typ_lv in (* Find the value of the location, if not bottom. *) let oracle = !make_oracle fuel state in let v, alarms = Domain.extract_lval oracle state lval typ_lv loc in let alarms = close_dereference_alarms lval alarms in if indeterminate then let record, alarms = indeterminate_copy lval v alarms in `Value (record, Neither, volatile), alarms else let v, alarms = remove_special_float_lvalue typ_lv lval (v, alarms) in let v, alarms = assume_valid_bool typ_lv lval (v, alarms) in (v, alarms) >>=: fun (value, origin) -> let value = define_value value and origin = Some origin and reductness, reduction = if Alarmset.is_empty alarms then Unreduced, Neither else Reduced, Forward in (* The proper alarms will be set in the record by forward_eval. *) {value; origin; reductness; val_alarms = Alarmset.all}, reduction, volatile (* ------------------------------------------------------------------------ Subdivided Forward Evaluation ------------------------------------------------------------------------ *) (* These two modules could be implemented as mutually recursive, to avoid the reference for the oracle given to the domains. *) module Forward_Evaluation = struct type state = Domain.t let evaluate ?(valuation=Cache.empty) ~fuel state expr = cache := valuation; root_forward_eval fuel state expr >>=: fun (value, _) -> !cache, value end module Subdivided_Evaluation = Subdivided_evaluation.Make (Value) (Loc) (Cache) (Forward_Evaluation) let () = make_oracle := fun fuel state -> let fuel = pred fuel in if fuel > 0 then fun expr -> let valuation = !cache in Subdivided_Evaluation.evaluate ~valuation ~fuel state expr >>=: fun (valuation, value) -> cache := valuation; value else fun _ -> fuel_consumed := true; `Value Value.top, Alarmset.all let subdivided_forward_eval valuation state expr = let fuel = root_fuel () in Subdivided_Evaluation.evaluate ~valuation ~fuel state expr (* ------------------------------------------------------------------------ Backward Evaluation ------------------------------------------------------------------------ *) (* Find the value of a previously evaluated expression. *) let find_val expr = match Cache.find !cache expr with | `Value record -> record.value.v | `Top -> assert false (* [expr] must have been evaluated already. *) (* Find the record computed for an lvalue. Return None if no reduction can be performed. *) let find_loc_for_reduction lval = if not (may_be_reduced_lval lval) then None else let record, report = match Cache.find_loc' !cache lval with | `Value all -> all | `Top -> assert false in if (snd report).with_reduction then Some (record, report) else None (* Evaluate an expression before any reduction, if needed. Also return the report indicating if a forward reduction during the forward evaluation may be propagated backward. *) let evaluate_for_reduction state expr = try `Value (Cache.find' !cache expr) with Not_found -> fst (forward_eval no_fuel state expr) >>-: fun _ -> try Cache.find' !cache expr with Not_found -> assert false (* The backward propagation at a step is relevant only if: - the new value (if any) is more precise than the old one. Then the latter is reduced by the former, and the reduction kind is set to [Backward]. - or the old value has been reduced during the forward evaluation. Then, [report.reduced] is [Forward], and must be set to [Neither] as the reduction is propagated but the value of the current expression is unchanged. *) let backward_reduction old_value latter_reduction value = let propagate_forward_reduction () = if latter_reduction = Forward then Some (old_value, Neither) else None in match value with | None -> `Value (propagate_forward_reduction ()) | Some new_value -> Value.narrow old_value new_value >>-: fun value -> if Value.is_included old_value value then propagate_forward_reduction () else Some (value, Backward) (* [backward_eval state expr value] reduces the the expression [expr] and its subterms in the cache, according to the state [state]: - the reductions performed during the forward evaluation (due to alarms or abstract domains) are propagated backward to the subexpressions; - if [value = Some v], then [expr] is assumed to evaluate to [v] (and is reduced accordingly). *) let rec backward_eval fuel state expr value = (* Evaluate the expression if needed. *) evaluate_for_reduction state expr >>- fun (record, report) -> (* Reduction of [expr] by [value]. Also performs further reductions requested by the domains. Returns Bottom if one of these reductions leads to bottom. *) let reduce kind value = let continue = `Value () in (* Avoids reduction of volatile expressions. *) if report.volatile then continue else let value = Value.reduce value in reduce_expr_recording kind expr (record, report) value; (* If enough fuel, asks the domain for more reductions. *) if fuel > 0 then (* The reductions requested by the domains. *) let reductions_list = Domain.reduce_further state expr value in let reduce acc (expr, v) = acc >>- fun () -> backward_eval (pred fuel) state expr (Some v) in List.fold_left reduce continue reductions_list else continue in record.value.v >>- fun old_value -> (* Determines the need of a backward reduction. *) backward_reduction old_value report.reduction value >>- function | None -> (* If no reduction to be propagated, just visit the subterms. *) recursive_descent fuel state expr | Some (value, kind) -> (* Otherwise, backward propagation to the subterms. *) match expr.enode with | Lval lval -> begin (* For a lvalue, we try to reduce its location according to the value; this operation may lead to a more precise value for this lvalue, which is then reduced accordingly. *) backward_loc state lval value >>- function | None -> reduce kind value >>- fun () -> recursive_descent_lval fuel state lval | Some (loc, new_value) -> let kind = if Value.is_included old_value new_value then Neither else Backward in reduce kind new_value >>- fun () -> internal_backward_lval fuel state loc lval end | _ -> reduce kind value >>- fun () -> internal_backward fuel state expr value (* Backward propagate the reduction [expr] = [value] to the subterms of the compound expression [expr]. *) and internal_backward fuel state expr value = match expr.enode with | Lval _lv -> assert false | UnOp (LNot, e, _) -> let cond = Value_util.normalize_as_cond e false in (* TODO: should we compute the meet with the result of the call to Value.backward_unop? *) backward_eval fuel state cond (Some value) | UnOp (op, e, _typ) -> let typ_e = Cil.unrollType (Cil.typeOf e) in find_val e >>- fun v -> Value.backward_unop ~typ_arg:typ_e op ~arg:v ~res:value >>- fun v -> backward_eval fuel state e v | BinOp (binop, e1, e2, typ) -> let typ_res = Cil.unrollType typ and typ_e1 = Cil.typeOf e1 in find_val e1 >>- fun v1 -> find_val e2 >>- fun v2 -> Value.backward_binop ~input_type:typ_e1 ~resulting_type:typ_res binop ~left:v1 ~right:v2 ~result:value >>- fun (v1, v2) -> backward_eval fuel state e1 v1 >>- fun () -> backward_eval fuel state e2 v2 | CastE (typ, e) -> begin let dst_typ = Cil.unrollType typ in let src_typ = Cil.unrollType (Cil.typeOf e) in find_val e >>- fun src_val -> Value.backward_cast ~src_typ ~dst_typ ~src_val ~dst_val:value >>- function v -> backward_eval fuel state e v end | Info (e, _) -> backward_eval fuel state e None | _ -> `Value () and recursive_descent fuel state expr = match expr.enode with | Lval lval -> backward_lval fuel state lval | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> backward_eval fuel state e None | BinOp (_binop, e1, e2, _typ) -> backward_eval fuel state e1 None >>- fun () -> backward_eval fuel state e2 None | _ -> `Value () and recursive_descent_lval fuel state (host, offset) = recursive_descent_host fuel state host >>- fun () -> recursive_descent_offset fuel state offset and recursive_descent_host fuel state = function | Var _ -> `Value () | Mem expr -> backward_eval fuel state expr None >>-: fun _ -> () and recursive_descent_offset fuel state = function | NoOffset -> `Value () | Field (_, remaining) -> recursive_descent_offset fuel state remaining | Index (exp, remaining) -> backward_eval fuel state exp None >>- fun __ -> recursive_descent_offset fuel state remaining (* Even if the value of an lvalue has not been reduced, its memory location could have been, and this can be propagated backward. Otherwise, continue the recursive descent. *) and backward_lval fuel state lval = match find_loc_for_reduction lval with | None -> recursive_descent_lval fuel state lval | Some (record, report) -> if (fst report).reduction = Forward then internal_backward_lval fuel state record.loc lval else recursive_descent_lval fuel state lval (* [backward_loc state lval value] tries to reduce the memory location of the lvalue [lval] according to its value [value] in the state [state]. *) and backward_loc state lval value = match find_loc_for_reduction lval with | None -> `Value None | Some (record, report) -> Domain.backward_location state lval record.typ record.loc value >>- fun (loc, new_value) -> Value.narrow new_value value >>-: fun value -> let b = not (Loc.equal_loc record.loc loc) in (* Avoids useless reductions and reductions of volatile expressions. *) if b && not (fst report).volatile then let record = { record with loc } in let report = { (fst report) with reduction = Backward }, snd report in cache := Cache.add_loc' !cache lval (record, report); else (); if b || (fst report).reduction = Forward then Some (loc, value) else None and internal_backward_lval fuel state location = function | Var host, offset -> Loc.backward_variable host location >>- fun loc_offset -> backward_offset fuel state host.vtype offset loc_offset | Mem expr, offset -> match offset with | NoOffset -> let loc_value = Loc.to_value location in backward_eval fuel state expr (Some loc_value) >>-: fun _ -> () | _ -> let reduce_valid_index = true in let typ_lval = Cil.typeOf_pointed (Cil.typeOf expr) in fst (eval_offset no_fuel ~reduce_valid_index typ_lval state offset) >>- fun (loc_offset, _, _) -> find_val expr >>- fun value -> Loc.backward_pointer value loc_offset location >>- fun (pointer_value, loc_offset) -> backward_eval fuel state expr (Some pointer_value) >>- fun _ -> backward_offset fuel state typ_lval offset loc_offset and backward_offset fuel state typ offset loc_offset = match offset with | NoOffset -> `Value () | Field (field, remaining) -> Loc.backward_field typ field loc_offset >>- fun rem -> backward_offset fuel state field.ftype remaining rem | Index (exp, remaining) -> find_val exp >>- fun v -> let typ_pointed = Cil.typeOf_array_elem typ in fst (eval_offset no_fuel ~reduce_valid_index:true typ_pointed state remaining) >>- fun (rem, _, _) -> Loc.backward_index typ_pointed v rem loc_offset >>- fun (v', rem') -> let reduced_v = if Value.is_included v v' then None else Some v' in backward_eval fuel state exp reduced_v >>- fun _ -> backward_offset fuel state typ_pointed remaining rem' (* ------------------------------------------------------------------------ Second Pass of Forward Evaluation ------------------------------------------------------------------------ *) exception Not_Exact_Reduction (** Second forward evaluation after a backward propagation for the condition of an if statement. Allows to forward propagate the backward reductions. Uses the internal forward functions to actually perform the computation instead of relying on the cache. However, the internal evaluation uses the cache for the sub- expressions, so this evaluation is still bottom-up, and update the cache progressively. Stops the descent as soon as there is no backward propagation to recover for an expression. However, more backward reduction could have been done below for other reasons (due to alarms or domains). Raises Not_Exact_Reduction if at any point, the forward evaluation leads to a less precise value than the one stored after the backward evaluation. This means that the backward propagation has not been precise enough. *) let rec second_forward_eval state expr = let record, report = try Cache.find' !cache expr with Not_found -> assert false in if report.reduction <> Backward then `Value () else record.value.v >>- fun value -> recursive_descent state expr >>- fun () -> let new_value = match expr.enode with | Lval lval -> second_eval_lval state lval value | _ -> fst (internal_forward_eval no_fuel state expr) >>-: fun (v, _, _) -> v in new_value >>- fun evaled -> let evaled = Value.reduce evaled in Value.narrow value evaled >>-: fun new_value -> if not (Value.is_included evaled value) then raise Not_Exact_Reduction else let kind = if Value.equal value new_value then Neither else Forward in reduce_expr_value kind expr new_value and second_eval_lval state lval value = if not (may_be_reduced_lval lval) then `Value value else let record, report = match Cache.find_loc' !cache lval with | `Value all -> all | `Top -> assert false in let evaloc = if (fst report).reduction = Backward then let for_writing = false and reduction = true in fst (reduced_lval_to_loc no_fuel ~for_writing ~reduction state lval) >>-: fun (loc, _, _, _) -> (* TODO: Loc.narrow *) let record = { record with loc } in let reduction = if Loc.equal_loc record.loc loc then Neither else Forward in let report = { (fst report) with reduction }, snd report in cache := Cache.add_loc' !cache lval (record, report); else `Value () in evaloc >>- fun () -> fst (eval_lval no_fuel state lval) >>- fun (record, _, _) -> record.value.v and recursive_descent state expr = match expr.enode with | Lval lval -> recursive_descent_lval state lval | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> second_forward_eval state e | BinOp (_binop, e1, e2, _typ) -> second_forward_eval state e1 >>- fun () -> second_forward_eval state e2 | _ -> `Value () and recursive_descent_lval state (host, offset) = recursive_descent_host state host >>- fun () -> recursive_descent_offset state offset and recursive_descent_host state = function | Var _ -> `Value () | Mem expr -> second_forward_eval state expr and recursive_descent_offset state = function | NoOffset -> `Value () | Field (_, remaining) -> recursive_descent_offset state remaining | Index (exp, remaining) -> second_forward_eval state exp >>- fun () -> recursive_descent_offset state remaining (* ------------------------------------------------------------------------ Generic Interface ------------------------------------------------------------------------ *) module Valuation = Cache let evaluate ?(valuation=Cache.empty) ?(reduction=true) state expr = let eval, alarms = subdivided_forward_eval valuation state expr in let result = if not reduction || Alarmset.is_empty alarms then eval else eval >>- fun (valuation, value) -> cache := valuation; backward_eval (backward_fuel ()) state expr None >>-: fun _ -> !cache, value in result, alarms let copy_lvalue ?(valuation=Cache.empty) state lval = let expr = Value_util.lval_to_exp lval and fuel = root_fuel () in try let record, report = Cache.find' valuation expr in if less_fuel_than fuel report.fuel then `Value (valuation, record.value), record.val_alarms else raise Not_found with Not_found -> cache := valuation; eval_lval ~indeterminate:true fuel state lval >>=: fun (record, _, volatile) -> let record = reduce_value record in (* Cache the computed result with an appropriate report. *) let report = { fuel = Finite (root_fuel ()); reduction = Neither; volatile } in let valuation = Cache.add' !cache expr (record, report) in valuation, record.value (* When evaluating an lvalue, we use the subdivided evaluation for the expressions included in the lvalue. *) let rec evaluate_offsets valuation state = function | NoOffset -> `Value valuation, Alarmset.none | Field (_, offset) -> evaluate_offsets valuation state offset | Index (expr, offset) -> subdivided_forward_eval valuation state expr >>= fun (valuation, _value) -> evaluate_offsets valuation state offset let evaluate_host valuation state = function | Var _ -> `Value valuation, Alarmset.none | Mem expr -> subdivided_forward_eval valuation state expr >>=: fst let lvaluate ?(valuation=Cache.empty) ~for_writing state lval = (* If [for_writing] is true, the location of [lval] is reduced by removing const bases. Use [for_writing:false] if const bases can be written through a mutable field or an initializing function. *) let for_writing = for_writing && not (Cil.is_mutable_or_initialized lval) in let host, offset = lval in evaluate_host valuation state host >>= fun valuation -> evaluate_offsets valuation state offset >>= fun valuation -> cache := valuation; lval_to_loc (root_fuel ()) ~for_writing ~reduction:true state lval >>=. fun (_, typ, _) -> backward_lval (backward_fuel ()) state lval >>-: fun _ -> match Cache.find_loc !cache lval with | `Value record -> !cache, record.loc, typ | `Top -> assert false let reduce ?valuation:(valuation=Cache.empty) state expr positive = (* Generate [e == 0] *) let expr = Value_util.normalize_as_cond expr (not positive) in cache := valuation; root_forward_eval (root_fuel ()) state expr >>=. fun (_v, volatile) -> (* Reduce by [(e == 0) == 0] *) backward_eval (backward_fuel ()) state expr (Some Value.zero) >>- fun () -> try second_forward_eval state expr >>-: fun () -> !cache with Not_Exact_Reduction -> (* Avoids reduce_by_cond_enumerate on volatile expressions. *) if volatile then `Value !cache else Subdivided_Evaluation.reduce_by_enumeration !cache state expr false let assume ?valuation:(valuation=Cache.empty) state expr value = cache := valuation; backward_eval (backward_fuel ()) state expr (Some value) >>-: fun _ -> !cache (* ------------------------------------------------------------------------ Misc ------------------------------------------------------------------------ *) (* Aborts the analysis when a function pointer is completely imprecise. *) let top_function_pointer funcexp = if Mark_noresults.no_memoization_enabled () then Value_parameters.abort ~current:true "Function pointer evaluates to anything. Try deactivating \ option(s) -no-results, -no-results-function and -obviously-terminates." else Value_parameters.fatal ~current:true "Function pointer evaluates to anything. function %a" Printer.pp_exp funcexp (* For pointer calls, we retro-propagate which function is being called in the abstract state. This may be useful: - inside the call for languages with OO (think 'self') - everywhere, because we may remove invalid values for the pointer - after if enough slevel is available, as states obtained in different functions are not merged by default. *) let backward_function_pointer valuation state expr kf = (* Builds the expression [exp_f != &f], and assumes it is false. *) let vi_f = Kernel_function.get_vi kf in let addr = Cil.mkAddrOfVi vi_f in let expr = Cil.mkBinOp ~loc:expr.eloc Ne expr addr in fst (reduce ~valuation state expr false) let eval_function_exp funcexp ?args state = match funcexp.enode with | Lval (Var vinfo, NoOffset) -> `Value [Globals.Functions.get vinfo, Valuation.empty], Alarmset.none | Lval (Mem v, NoOffset) -> begin evaluate state v >>= fun (valuation, value) -> let kfs, alarm = Value.resolve_functions value in match kfs with | `Top -> top_function_pointer funcexp | `Value kfs -> let typ = Cil.typeOf funcexp in let kfs, alarm' = Eval_typ.compatible_functions typ ?args kfs in let reduce = backward_function_pointer valuation state v in let process acc kf = let res = reduce kf >>-: fun valuation -> kf, valuation in Bottom.add_to_list res acc in let list = List.fold_left process [] kfs in let status = if kfs = [] then Alarmset.False else if alarm || alarm' then Alarmset.Unknown else Alarmset.True in let alarm = Alarms.Function_pointer (v, args) in let alarms = Alarmset.singleton ~status alarm in Bottom.bot_of_list list, alarms end | _ -> assert false end (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/evaluation.mli����������������������������������������0000666�0000000�0000000�00000014357�13571573400�020730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval (** Generic evaluation and reduction of expressions and left values. *) module type S = sig type state (** State of abstract domain. *) type value (** Numeric values to which the expressions are evaluated. *) type origin (** Origin of values. *) type loc (** Location of an lvalue. *) (** Results of an evaluation: the results of all intermediate calculation (the value of each expression and the location of each lvalue) are cached here. See {eval.mli} for more details. *) module Valuation : Valuation with type value = value and type origin = origin and type loc = loc (** [evaluate ~valuation state expr] evaluates the expression [expr] in the state [state], and returns the pair [result, alarms], where: - [alarms] are the set of alarms ensuring the soundness of the evaluation; - [result] is either `Bottom if the evaluation leads to an error, or `Value (valuation, value), where [value] is the numeric value computed for the expression [expr], and [valuation] contains all the intermediate results of the evaluation. The [valuation] argument is a cache of already computed expressions. It is empty by default. The [reduction] argument allows deactivating the backward reduction performed after the forward evaluation. *) val evaluate : ?valuation:Valuation.t -> ?reduction:bool -> state -> exp -> (Valuation.t * value) evaluated (** Computes the value of a lvalue, with possible indeterminateness: the returned value may be uninitialized, or contain escaping addresses. Also returns the alarms resulting of the evaluation of the lvalue location, and a valuation containing all the intermediate results of the evaluation. The [valuation] argument is a cache of already computed expressions. It is empty by default. *) val copy_lvalue : ?valuation:Valuation.t -> state -> lval -> (Valuation.t * value flagged_value) evaluated (** [lvaluate ~valuation ~for_writing state lval] evaluates the left value [lval] in the state [state]. Same general behavior as [evaluate] above but evaluates the lvalue into a location and its type. The boolean [for_writing] indicates whether the lvalue is evaluated to be read or written. It is useful for the emission of the alarms, and for the reduction of the location. *) val lvaluate : ?valuation:Valuation.t -> for_writing:bool -> state -> lval -> (Valuation.t * loc * typ) evaluated (** [reduce ~valuation state expr positive] evaluates the expression [expr] in the state [state], and then reduces the [valuation] such that the expression [expr] evaluates to a zero or a non-zero value, according to [positive]. By default, the empty valuation is used. *) val reduce: ?valuation:Valuation.t -> state -> exp -> bool -> Valuation.t evaluated (** [assume ~valuation state expr value] assumes in the [valuation] that the expression [expr] has the value [value] in the state [state], and backward propagates this information to the subterm of [expr]. If [expr] has not been already evaluated in the [valuation], its forward evaluation takes place first, but the alarms are dismissed. By default, the empty valuation is used. The function returns the updated valuation, or bottom if it discovers a contradiction. *) val assume: ?valuation:Valuation.t -> state -> exp -> value -> Valuation.t or_bottom val eval_function_exp: exp -> ?args:exp list -> state -> (Kernel_function.t * Valuation.t) list evaluated (** Evaluation of the function argument of a [Call] constructor *) val interpret_truth: alarm:(unit -> Alarms.t) -> 'a -> 'a Abstract_value.truth -> 'a evaluated end module type Value = sig include Abstract.Value.External (** Inter-reduction of values. Useful when the value module is a reduced product of several abstraction. The value computed by the forward evaluation for each sub-expression or lvalue is reduced by this function. *) val reduce : t -> t end module type Queries = sig include Abstract_domain.Queries include Datatype.S with type t = state end (** Generic functor. *) module Make (Value : Value) (Loc : Abstract_location.S with type value = Value.t) (Domain : Queries with type value = Value.t and type location = Loc.location) : S with type state = Domain.state and type value = Value.t and type origin = Domain.origin and type loc = Loc.location (* Local Variables: compile-command: "make -C ../../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/initialization.ml�������������������������������������0000666�0000000�0000000�00000040552�13571573400�021433� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Creation of the initial state of abstract domains. *) open Cil_types open Eval module type S = sig type state val initial_state : lib_entry:bool -> state or_bottom val initial_state_with_formals : lib_entry:bool -> kernel_function -> state or_bottom val initialize_local_variable: stmt -> varinfo -> Cil_types.init -> state -> state or_bottom end type padding_initialization = [ | `Initialized | `Uninitialized | `MaybeInitialized ] (* There are two different options for locals and for globals variables: a three-valued parameter of Eva for globals, and a boolean parameter of the kernel for locals. Please don't ask. *) let padding_initialization ~local : padding_initialization = if local then if Kernel.InitializedPaddingLocals.get () then `Initialized else `Uninitialized else match Value_parameters.InitializationPaddingGlobals.get () with | "yes" -> `Initialized | "maybe" -> `MaybeInitialized | "no" -> `Uninitialized | _ -> assert false (* Warn if the size is unknown. *) let warn_unknown_size vi = try ignore (Cil.bitsSizeOf vi.vtype); false with Cil.SizeOfError (s, t)-> let pp fmt v = Format.fprintf fmt "variable '%a'" Printer.pp_varinfo v in Value_parameters.warning ~once:true ~current:true "@[during initialization@ of %a,@ size of@ type '%a'@ cannot be@ \ computed@ (%s)@]" pp vi Printer.pp_typ t s; true (* A bottom in any part of an initializer results in a bottom for the whole initialization. Thus, the following monad raises an exception on a bottom case; the exception is catched by the root initialization functions to return a proper `Bottom. *) exception Initialization_failed let (>>>) t f = match t with | `Bottom -> raise Initialization_failed | `Value v -> f v let counter = ref 0 module Make (Domain: Abstract.Domain.External) (Eva: Evaluation.S with type state = Domain.state and type loc = Domain.location) (Transfer: Transfer_stmt.S with type state = Domain.t) = struct incr counter;; (* Evaluation in the top state: we do not want a location to depend on other globals. *) let lval_to_loc lval = fst (Eva.lvaluate ~for_writing:false Domain.top lval) >>> fun (_valuation, loc, _typ) -> loc (* ------------------------- Apply initializer ---------------------------- *) (* Conventions: - functions in *_var_* act on the entire variables, and receive only the corresponding varinfo - other functions act on a lvalue, which they directly receive *) (* Initializes an entire variable [vi], in particular padding bits, according to [local] and [lib_entry] mode. *) let initialize_var_padding ~local ~lib_entry vi state = let lval = Cil.var vi in match padding_initialization ~local with | `Uninitialized -> state | `Initialized | `MaybeInitialized as i -> let initialized = i = `Initialized in let init_value = if not local && lib_entry then Abstract_domain.Top else Abstract_domain.Zero in let location = lval_to_loc lval in Domain.initialize_variable lval location ~initialized init_value state (* Initializes a volatile lvalue to top. *) let initialize_top_volatile lval state = let location = lval_to_loc lval in let init_value = Abstract_domain.Top in Domain.initialize_variable lval location ~initialized:true init_value state (* Applies a single Cil initializer, using the standard transfer function on assignments. Warns if the results is bottom. *) let apply_cil_single_initializer kinstr state lval expr = match Transfer.assign state kinstr lval expr with | `Bottom -> if kinstr = Kglobal then Value_parameters.warning ~once:true ~source:(fst expr.eloc) "evaluation of initializer '%a' failed@." Printer.pp_exp expr; raise Initialization_failed | `Value v -> v (* Applies an initializer. If [top_volatile] is true, sets volatile locations to top without applying the initializer. Otherwise, lets the standard transfer function on assignments handle volatile locations. *) let rec apply_cil_initializer ~top_volatile kinstr lval init state = if top_volatile && Cil.typeHasQualifier "volatile" (Cil.typeOfLval lval) then initialize_top_volatile lval state else match init with | SingleInit exp -> apply_cil_single_initializer kinstr state lval exp | CompoundInit (typ, l) -> let doinit off init _typ state = let lval = Cil.addOffsetLval off lval in apply_cil_initializer ~top_volatile kinstr lval init state in Cil.foldLeftCompound ~implicit:false ~doinit ~ct:typ ~initl:l ~acc:state (* Field by field initialization of a variable to zero, or top if volatile. Very inefficient. *) let initialize_var_zero_or_volatile kinstr vi state = let loc = Cil_datatype.Location.unknown in let zero_init = Cil.makeZeroInit ~loc vi.vtype in apply_cil_initializer ~top_volatile:true kinstr (Cil.var vi) zero_init state (* ----------------------- Non Lib-entry mode ----------------------------- *) (* Initializes a varinfo, padding bits + optionaly an initializer. *) let initialize_var_not_lib_entry kinstr ~local vi init state = ignore (warn_unknown_size vi); let typ = vi.vtype in let lval = Cil.var vi in let volatile_everywhere = Cil.typeHasQualifier "volatile" typ in let state = if volatile_everywhere && padding_initialization ~local = `Initialized then initialize_top_volatile lval state else (* Initializes padding bits everywhere (non padding bits are overwritten afterwards). *) let state = initialize_var_padding vi ~local ~lib_entry:false state in (* Initializes everything except padding bits: non-volatile locations to zero, volatile locations to top. We only do so if the variable must be different from zero somewhere. This is a not-so minor optimization. *) if padding_initialization ~local = `Initialized && not (Cil.isVolatileType typ) then state else initialize_var_zero_or_volatile kinstr vi state in (* Applies the real initializer on top. *) match init with | None -> state | Some init -> apply_cil_initializer ~top_volatile:false kinstr lval init state (* --------------------------- Lib-entry mode ----------------------------- *) (* Special application of an initializer: only non-volatile lval with attributes 'const' are initialized. *) let rec apply_cil_const_initializer kinstr state lval = function | SingleInit exp -> let typ_lval = Cil.typeOfLval lval in if Cil.typeHasQualifier "const" typ_lval && not (Cil.typeHasQualifier "volatile" typ_lval) && not (Cil.is_mutable_or_initialized lval) then apply_cil_single_initializer kinstr state lval exp else state | CompoundInit (typ, l) -> if Cil.typeHasQualifier "volatile" typ || not (Cil.isConstType typ) then state (* initializer is not useful *) else let doinit off init _typ state = apply_cil_const_initializer kinstr state (Cil.addOffsetLval off lval) init in Cil.foldLeftCompound ~implicit:true ~doinit ~ct:typ ~initl:l ~acc:state (* Initializes [vi] as if in [-lib-entry] mode. Active when [-lib-entry] is set, or when [vi] is extern. [const] initializers, explicit or implicit, are taken into account *) let initialize_var_lib_entry kinstr vi init state = if Cil.typeHasQualifier "const" vi.vtype && not (vi.vstorage = Extern) && not (Cil.typeHasAttributeMemoryBlock Cil.frama_c_mutable vi.vtype) then (* Fully const base. Ignore -lib-entry altogether. *) initialize_var_not_lib_entry kinstr ~local:false vi init state else let unknown_size = warn_unknown_size vi in let state = if unknown_size then (* the type is unknown, initialize everything to Top *) let lval = Cil.var vi in let loc = lval_to_loc lval in let v = Abstract_domain.Top in Domain.initialize_variable lval loc ~initialized:true v state else (* Add padding everywhere. *) let state = initialize_var_padding vi ~local:false ~lib_entry:true state in (* Then initialize non-padding bits according to the type. *) let kind = Abstract_domain.Library_Global in Domain.initialize_variable_using_type kind vi state in (* If needed, initializes const fields according to the initializer (or generate one if there are none). In the first phase, they have been set to generic values. *) if Cil.isConstType vi.vtype && not (vi.vstorage = Extern) then let init = match init with | None -> Cil.makeZeroInit ~loc:vi.vdecl vi.vtype | Some init -> init in apply_cil_const_initializer kinstr state (Cil.var vi) init else state (* ------------- Adds formal argument of the main function --------------- *) (* Compute values for the formals of [kf] (as if those were variables in lib-entry mode) and add them to [state] *) let compute_main_formals kf state = match kf.fundec with | Declaration (_, _, None, _) -> state | Declaration (_, _, Some l, _) | Definition ({ sformals = l }, _) -> if l <> [] && Value_parameters.InterpreterMode.get () then Value_parameters.abort "Entry point %a has arguments" Kernel_function.pretty kf else let kind = Abstract_domain.Main_Formal in List.fold_right (Domain.initialize_variable_using_type kind) l state (* Use the values supplied in [actuals] for the formals of [kf], and bind them in [state] *) let add_supplied_main_formals kf actuals state = match Domain.get_cvalue with | None -> Value_parameters.abort "Function Db.Value.fun_set_args cannot be \ used without the Cvalue domain" | Some get_cvalue -> let formals = Kernel_function.get_formals kf in if (List.length formals) <> List.length actuals then raise Db.Value.Incorrect_number_of_arguments; let cvalue_state = get_cvalue state in let add_actual state actual formal = let actual = Eval_op.offsetmap_of_v ~typ:formal.vtype actual in Cvalue.Model.add_base (Base.of_varinfo formal) actual state in let cvalue_state = List.fold_left2 add_actual cvalue_state actuals formals in let set_domain = Domain.set Cvalue_domain.State.key in set_domain (cvalue_state, Locals_scoping.bottom ()) state let add_main_formals kf state = match Db.Value.fun_get_args () with | None -> compute_main_formals kf state | Some actuals -> add_supplied_main_formals kf actuals state (* ------------------------ High-level functions -------------------------- *) let initialize_local_variable stmt vi init state = try `Value (initialize_var_not_lib_entry (Kstmt stmt) ~local:true vi (Some init) state) with Initialization_failed -> `Bottom let initialize_global_variable ~lib_entry vi init state = Cil.CurrentLoc.set vi.vdecl; let state = Domain.introduce_globals [vi] state in if vi.vsource then let initialize = if lib_entry || (vi.vstorage = Extern) then initialize_var_lib_entry else initialize_var_not_lib_entry ~local:false in initialize Kglobal vi init.init state else state (* Compute the initial state with all global variable initialized. *) let compute_global_state ~lib_entry () = Value_parameters.debug ~level:2 "Computing globals values"; let state = Domain.empty () in let initialize = initialize_global_variable ~lib_entry in try `Value (Globals.Vars.fold_in_file_order initialize state) with Initialization_failed -> `Bottom (* Dependencies for the Frama-C states containing the initial states of Eva: all correctness parameters of Eva, plus the AST itself. We cannot use [Db.Value.self] directly, because we do not want to depend on the tuning parameters. Previously, we use a more fine-grained list, but this lead to bugs. See mantis #2277. *) let correctness_deps = Ast.self :: List.map (fun p -> State.get p.Typed_parameter.name) Value_parameters.parameters_correctness module InitialState = State_builder.Option_ref (Bottom.Make_Datatype (Domain)) (struct let name = "Value.Initialization" ^ "(" ^ string_of_int !counter ^ ")" let dependencies = correctness_deps end) let () = Ast.add_monotonic_state InitialState.self (* The computation depends on the lib_entry option, which is a corrrectness parameter of the analyzer: the InitialState memoization is thus safely cleaned when lib_entry changes. *) let global_state ~lib_entry = InitialState.memo (compute_global_state ~lib_entry) (* The global cvalue state may be supplied by the user. *) let supplied_state () = let cvalue_state = Db.Value.globals_state () in if Cvalue.Model.is_reachable cvalue_state then let cvalue_state = cvalue_state, Locals_scoping.bottom () in `Value (Domain.set Cvalue_domain.State.key cvalue_state Domain.top) else `Bottom let initial_state ~lib_entry = if Db.Value.globals_use_supplied_state () then supplied_state () else global_state ~lib_entry let print_initial_cvalue_state state = let cvalue_state = Domain.get_cvalue_or_bottom state in (* Do not show variables from the frama-c libc specifications. *) let print_base base = try let varinfo = Base.to_varinfo base in not (Cil.hasAttribute "fc_stdlib" varinfo.vattr || Cil.hasAttribute "fc_stdlib_generated" varinfo.vattr) with Base.Not_a_C_variable -> true in let cvalue_state = if Kernel.PrintLibc.get () then cvalue_state else Cvalue.Model.filter_base print_base cvalue_state in Value_parameters.printf ~dkey:Value_parameters.dkey_initial_state ~header:(fun fmt -> Format.pp_print_string fmt "Values of globals at initialization") "@[ %a@]" Cvalue.Model.pretty cvalue_state let initial_state_with_formals ~lib_entry kf = let init_state = if Db.Value.globals_use_supplied_state () then begin Value_parameters.feedback "Initial state supplied by user"; supplied_state () end else begin Value_parameters.feedback "Computing initial state"; let state = global_state ~lib_entry in Value_parameters.feedback "Initial state computed"; state end in Domain.Store.register_global_state init_state; print_initial_cvalue_state init_state; init_state >>-: add_main_formals kf end (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/initialization.mli������������������������������������0000666�0000000�0000000�00000005303�13571573400�021577� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Creation of the initial state of abstract domain. *) open Cil_types open Bottom.Type module type S = sig type state (** Compute the initial state for an analysis. The initial state is generated according to the options of Value governing the shape of this state. All global variables are bound in the resulting abstract state. *) val initial_state : lib_entry:bool -> state or_bottom (** Compute the initial state for an analysis (as in {!initial_state}), but also bind the formal parameters of the function given as argument. *) val initial_state_with_formals : lib_entry:bool -> kernel_function -> state or_bottom (** Initializes a local variable in the current state. *) val initialize_local_variable: stmt -> varinfo -> init -> state -> state or_bottom end module Make (Domain: Abstract.Domain.External) (Eva: Evaluation.S with type state = Domain.state and type loc = Domain.location) (Transfer: Transfer_stmt.S with type state = Domain.t) : S with type state := Domain.t (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/iterator.ml�������������������������������������������0000666�0000000�0000000�00000071443�13571573400�020240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Interpreted_automata open Bottom.Type [@@@warning "-42"] let check_signals, signal_abort = let signal_emitted = ref false in (fun () -> if !signal_emitted then begin signal_emitted := false; raise Db.Value.Aborted end), (fun () -> signal_emitted := true) let dkey = Value_parameters.dkey_iterator let dkey_callbacks = Value_parameters.dkey_callbacks let blocks_share_locals b1 b2 = match b1.blocals, b2.blocals with | [], [] -> true | v1 :: _, v2 :: _ -> v1.vid = v2.vid | _, _ -> false module Make_Dataflow (Abstract : Abstractions.Eva) (States : Powerset.S with type state = Abstract.Dom.t) (Transfer : Transfer_stmt.S with type state = Abstract.Dom.t) (Init: Initialization.S with type state := Abstract.Dom.t) (Logic : Transfer_logic.S with type state = Abstract.Dom.t and type states = States.t) (Spec: sig val treat_statement_assigns: assigns -> Abstract.Dom.t -> Abstract.Dom.t end) (AnalysisParam : sig val kf: kernel_function val call_kinstr: kinstr val initial_state : Abstract.Dom.t end) () = struct module Domain = Abstract.Dom (* --- Analysis parameters --- *) let kf = AnalysisParam.kf let fundec = Kernel_function.get_definition kf let cacheable = ref Value_types.Cacheable (* --- Plugin parameters --- *) type descending_strategy = NoIteration | FullIteration | ExitIteration let descending_iteration : descending_strategy = match Value_parameters.DescendingIteration.get () with | "no" -> NoIteration | "exits" -> ExitIteration | "full" -> FullIteration | _ -> assert false let hierachical_convergence : bool = Value_parameters.HierarchicalConvergence.get () let interpreter_mode = Value_parameters.InterpreterMode.get () (* Ideally, the slevel parameter should not be used anymore in this file but it is still required for logic interpretation *) let slevel = let module P = Partitioning_parameters.Make (AnalysisParam) in P.slevel (* --- Abstract values storage --- *) module Partition = Trace_partitioning.Make (Abstract) (Transfer) (AnalysisParam) type store = Partition.store type flow = Partition.flow type tank = Partition.tank type widening = Partition.widening type edge_info = { mutable fireable : bool (* Does any states survive the transition ? *) } (* --- Interpreted automata --- *) let automaton = get_automaton kf let graph = automaton.graph let control_point_count = G.nb_vertex graph let transition_count = G.nb_edges graph (* --- Initial state --- *) let active_behaviors = Logic.create AnalysisParam.initial_state kf (* Compute the locals that we must enter in scope when we start the analysis of [block]. The other ones will be introduced on the fly, when we encounter a [Local_init] instruction. *) let block_toplevel_locals block = List.filter (fun vi -> not vi.vdefined) block.blocals let initial_states = let state = AnalysisParam.initial_state and call_kinstr = AnalysisParam.call_kinstr and ab = active_behaviors in if Value_util.skip_specifications kf then States.singleton state else match Logic.check_fct_preconditions call_kinstr kf ab state with | `Bottom -> States.empty | `Value set -> set let initial_state = match States.join initial_states with | `Bottom -> Domain.top (* No analysis in this case. *) | `Value state -> state let initial_tank = Partition.initial_tank (States.to_list initial_states) let get_initial_flow () = -1 (* Dummy edge id *), Partition.drain initial_tank let post_conditions = ref false (* --- Analysis state --- *) (* Reference to the current statement processed by the analysis. Only needed when the analysis aborts, to mark the current statement as the degeneration point.*) let current_ki = ref Kglobal module VertexTable = struct include Interpreted_automata.Vertex.Hashtbl let find_or_add (t : 'a t) (key : key) ~(default : unit -> 'a) : 'a = try find t key with Not_found -> let x = default () in add t key x; x end module EdgeTable = struct include Interpreted_automata.Edge.Hashtbl let find_or_add (t : 'a t) (key : key) ~(default : unit -> 'a) : 'a = try find t key with Not_found -> let x = default () in add t key x; x end (* The stored state on vertex and edges *) let v_table : store VertexTable.t = VertexTable.create control_point_count let w_table : widening VertexTable.t = VertexTable.create 7 let e_table : (tank * edge_info) EdgeTable.t = EdgeTable.create transition_count (* Default (Initial) stores on vertex and edges *) let default_vertex_store (v : vertex) () : store = Partition.empty_store ~stmt:v.vertex_start_of let default_vertex_widening (v : vertex) () : widening = Partition.empty_widening ~stmt:v.vertex_start_of let default_edge_tank () : tank * edge_info = Partition.empty_tank (), { fireable = false } (* Get the stores associated to a control point or edge *) let get_vertex_store (v : vertex) : store = VertexTable.find_or_add v_table v ~default:(default_vertex_store v) let get_vertex_widening (v : vertex) : widening = VertexTable.find_or_add w_table v ~default:(default_vertex_widening v) let get_edge_data (e : vertex edge) : tank * edge_info = EdgeTable.find_or_add e_table e ~default:default_edge_tank let get_succ_tanks (v : vertex) : tank list = List.map (fun (_,e,_) -> fst (get_edge_data e)) (G.succ_e graph v) module StmtTable = struct include Cil_datatype.Stmt.Hashtbl let map (f : key -> 'a -> 'b) (t : 'a t) : 'b t = let r = create (length t) in iter (fun k v -> add r k (f k v)) t; r let map' (f : key -> 'a -> 'b or_bottom) (t : 'a t) : 'b t = let r = create (length t) in let aux k v = match f k v with | `Bottom -> () | `Value x -> add r k x in iter aux t; r end (* --- Transfer functions application --- *) type state = Domain.t type transfer_function = state -> state list let id : transfer_function = fun x -> [x] (* Thse lifting function helps to uniformize the transfer functions to a common signature *) let lift (f : state -> state) : transfer_function = fun x -> [f x] let lift' (f : state -> state or_bottom) : transfer_function = fun x -> Bottom.to_list (f x) let sequence (f1 : transfer_function) (f2 : transfer_function) : transfer_function = fun x -> List.fold_left (fun acc y -> f2 y @ acc) [] (f1 x) (* Tries to evaluate \assigns … \from … clauses for assembly code. *) let transfer_asm (stmt : stmt) : transfer_function = let asm_contracts = Annotations.code_annot stmt in match Logic_utils.extract_contract asm_contracts with | [] -> Value_util.warning_once_current "assuming assembly code has no effects in function %t" Value_util.pretty_current_cfunction_name; id (* There should be only one statement contract, if any. *) | (_, spec) :: _ -> let assigns = Ast_info.merge_assigns_from_spec ~warn:false spec in lift (Spec.treat_statement_assigns assigns) let transfer_assume (stmt : stmt) (exp : exp) (kind : guard_kind) : transfer_function = let positive = (kind = Then) in lift' (fun s -> Transfer.assume s stmt exp positive) let transfer_assign (stmt : stmt) (dest : Cil_types.lval) (exp : exp) : transfer_function = lift' (fun s -> Transfer.assign s (Kstmt stmt) dest exp) let transfer_enter (block : block) : transfer_function = let vars = block_toplevel_locals block in if vars = [] then id else lift (Transfer.enter_scope kf vars) let transfer_leave (block : block) : transfer_function = let vars = block.blocals in if vars = [] then id else lift (Domain.leave_scope kf vars) let transfer_call (stmt : stmt) (dest : lval option) (callee : exp) (args : exp list) (state : state) : state list = let result, call_cacheable = Transfer.call stmt dest callee args state in if call_cacheable = Value_types.NoCacheCallers then (* Propagate info that the current call cannot be cached either *) cacheable := Value_types.NoCacheCallers; Bottom.list_of_bot result let transfer_instr (stmt : stmt) (instr : instr) : transfer_function = match instr with | Local_init (vi, AssignInit exp, _loc) -> let transfer state = let state = Domain.enter_scope kf [vi] state in Init.initialize_local_variable stmt vi exp state in lift' transfer | Local_init (vi, ConsInit (f, args, k), loc) -> let as_func dest callee args _loc state = (* This variable enters the scope too early, as it should be introduced after the call to [f] but before the assignment to [v]. This is currently not possible, at least without splitting Transfer.call in two. *) let state = Domain.enter_scope kf [vi] state in transfer_call stmt dest callee args state in Cil.treat_constructor_as_func as_func vi f args k loc | Set (dest, exp, _loc) -> transfer_assign stmt dest exp | Call (dest, callee, args, _loc) -> transfer_call stmt dest callee args | Asm _ -> transfer_asm stmt | Skip _loc -> id | Code_annot (_,_loc) -> id (* already done in process_statement from the annotation table *) let transfer_return (stmt : stmt) (return_exp : exp option) : transfer_function = (* Deconstruct return statement *) let return_var = match return_exp with | Some {enode = Lval (Var v, NoOffset)} -> Some v | None -> None | _ -> assert false (* Cil invariant *) in (* Check postconditions *) let check_postconditions = fun state -> post_conditions := true; if Value_util.skip_specifications kf then [state] else match Logic.check_fct_postconditions kf active_behaviors Normal ~pre_state:initial_state ~post_states:(States.singleton state) ~result:return_var with | `Bottom -> [] | `Value v -> States.to_list v (* Assign the return value *) and assign_retval = match return_exp with | None -> id | Some return_exp -> let vi_ret = Extlib.the (Library_functions.get_retres_vi kf) in let return_lval = Var vi_ret, NoOffset in let kstmt = Kstmt stmt in fun state -> let state = Domain.enter_scope kf [vi_ret] state in let state' = Transfer.assign state kstmt return_lval return_exp in Bottom.to_list state' in sequence check_postconditions assign_retval let transfer_transition (t : vertex transition) : transfer_function = match t with | Skip -> id | Return (return_exp,stmt) -> transfer_return stmt return_exp | Guard (exp,kind,stmt) -> transfer_assume stmt exp kind | Instr (instr,stmt) -> transfer_instr stmt instr | Enter (block) -> transfer_enter block | Leave (block) when blocks_share_locals fundec.sbody block -> (* The variables from the toplevel block will be removed by the caller *) id | Leave (block) -> transfer_leave block | Prop _ -> id (* Annotations are interpreted in [transfer_statement]. *) let transfer_annotations (stmt : stmt) ~(record : bool) : transfer_function = let annots = (* We do not interpret annotations that come from statement contracts and everything previously emitted by Value (currently, alarms) *) let filter e ca = not (Logic_utils.is_contract ca || Emitter.equal e Value_util.emitter) in List.map fst (Annotations.code_annot_emitter ~filter stmt) in fun state -> let interp_annot states ca = Logic.interp_annot ~limit:(slevel stmt) ~record kf active_behaviors stmt ca ~initial_state states in States.to_list (List.fold_left interp_annot (States.singleton state) annots) let transfer_statement (stmt : stmt) (state : state) : state list = (* Interpret annotations *) let states = transfer_annotations stmt ~record:true state in (* Check unspecified sequences *) match stmt.skind with | UnspecifiedSequence seq when Kernel.UnspecifiedAccess.get () -> let check s = Transfer.check_unspecified_sequence stmt s seq = `Value () in List.filter check states | _ -> states (* --- Iteration strategy ---*) let process_partitioning_transitions (v1 : vertex) (v2 : vertex) (transition : vertex transition) (flow : flow) : flow = (* Split return *) let flow = match transition with | Return (return_exp, _) -> Partition.split_return flow return_exp | _ -> flow in (* Loop transitions *) let the_stmt v = Extlib.the v.vertex_start_of in let enter_loop f v = let f = Partition.enter_loop f (the_stmt v) in Partition.transfer (lift (Domain.enter_loop (the_stmt v))) f and leave_loop f v = let f = Partition.leave_loop f (the_stmt v) in Partition.transfer (lift (Domain.leave_loop (the_stmt v))) f and incr_loop_counter f v = let f = Partition.next_loop_iteration f (the_stmt v) in Partition.transfer (lift (Domain.incr_loop_counter (the_stmt v))) f in let loops_left, loops_entered = Interpreted_automata.get_wto_index_diff kf v1 v2 and loop_incr = Interpreted_automata.is_back_edge kf (v1,v2) in let flow = List.fold_left leave_loop flow loops_left in let flow = List.fold_left enter_loop flow loops_entered in if loop_incr then incr_loop_counter flow v2 else flow let process_edge (v1,e,v2 : G.edge) : flow = let {edge_transition=transition; edge_kinstr=kinstr} = e in let tank,edge_info = get_edge_data e in let flow = Partition.drain tank in !Db.progress (); check_signals (); current_ki := kinstr; Cil.CurrentLoc.set e.edge_loc; let flow = Partition.transfer (transfer_transition transition) flow in let flow = process_partitioning_transitions v1 v2 transition flow in if not (Partition.is_empty_flow flow) then edge_info.fireable <- true; flow let gather_cvalues states = match Domain.get_cvalue with | Some get -> List.map get states | None -> [] let call_statement_callbacks (stmt : stmt) (f : flow) : unit = (* TODO: apply on all domains. *) let states = Partition.contents f in let cvalue_states = gather_cvalues states in Db.Value.Compute_Statement_Callbacks.apply (stmt, Value_util.call_stack (), cvalue_states) let update_vertex ?(widening : bool = false) (v : vertex) (sources : ('branch * flow) list) : bool = begin match v.vertex_start_of with | Some stmt -> (* Set location *) current_ki := Kstmt stmt; let current_loc = Cil_datatype.Stmt.loc stmt in Cil.CurrentLoc.set current_loc | None -> () end; (* Get vertex store *) let store = get_vertex_store v in (* Join incoming s tates *) let flow = Partition.join sources store in let flow = match v.vertex_start_of with | Some stmt -> (* Callbacks *) call_statement_callbacks stmt flow; (* Transfer function associated to the statement *) Partition.transfer (transfer_statement stmt) flow | _ -> flow in (* Widen if necessary *) let flow = if widening && not (Partition.is_empty_flow flow) then begin let flow = Partition.widen (get_vertex_widening v) flow in (* Try to correct over-widenings *) let correct_over_widening stmt = (* Do *not* record the status after interpreting the annotation here. Possible unproven assertions have already been recorded when the assertion has been interpreted the first time higher in this function. *) Partition.transfer (transfer_annotations stmt ~record:false) flow in Extlib.may_map correct_over_widening ~dft:flow v.vertex_start_of end else flow in (* Dispatch to successors *) List.iter (fun into -> Partition.fill flow ~into) (get_succ_tanks v); (* Return whether the iterator should stop or not *) Partition.is_empty_flow flow let process_vertex ?(widening : bool = false) (v : vertex) : bool = (* Process predecessors *) let process_source (_,e,_ as edge) = e.edge_key, process_edge edge in let sources = List.map process_source (G.pred_e graph v) in (* Add initial source *) let sources = if v <> automaton.entry_point then sources else get_initial_flow () :: sources in (* Update the vertex *) update_vertex ~widening v sources let rec simulate (v : vertex) (source : 'branch * flow) : unit = (* Update the current vertex *) ignore (update_vertex v [source]); (* Try every possible successor *) let add_if_fireable (_,e,succ as edge) acc = let f = process_edge edge in if Partition.is_empty_flow f then acc else (e.edge_key,f,succ) :: acc in let successors = G.fold_succ_e add_if_fireable graph v [] in (* How many possible successors ? *) match successors with | [] -> () (* No successor - end of simulation *) | [b,f,succ] -> (* One successor - continue simulation *) simulate succ (b,f) | _ -> (* Several successors - failure *) Value_parameters.abort "Do not know which branch to take. Stopping." let reset_component (vertex_list : vertex list) : unit = let reset_edge (_,e,_) = let t,_ = get_edge_data e in Partition.reset_tank t in let reset_vertex v = let s = get_vertex_store v and w = get_vertex_widening v in Partition.reset_store s; Partition.reset_widening w; List.iter reset_edge (G.succ_e graph v) in List.iter reset_vertex vertex_list let rec iterate_list (l : wto) = List.iter iterate_element l and iterate_element = function | Wto.Node v -> ignore (process_vertex v) | Wto.Component (v, w) as component -> (* Reset the component if hierachical_convergence is set. Otherwise, only resets the widening counter for this component. This is especially useful for nested loops. *) if hierachical_convergence then reset_component (v :: Wto.flatten w) else Partition.reset_widening_counter (get_vertex_widening v); (* Iterate until convergence *) let iteration_count = ref 0 in while not (process_vertex ~widening:true v) || !iteration_count = 0 do Value_parameters.debug ~dkey "iteration %d" !iteration_count; iterate_list w; incr iteration_count; done; (* Descending sequence *) let l = match descending_iteration with | NoIteration -> [] | ExitIteration -> Value_parameters.debug ~dkey "propagating descending values through exit paths"; Wto.flatten (exit_strategy graph component) | FullIteration -> Value_parameters.debug ~dkey "propagating descending values through the loop"; v :: Wto.flatten w in List.iter (fun v -> ignore (process_vertex v)) l (* Walk through all the statements for which [needs_propagation] returns true. Those statements are marked as "not fully propagated", for ulterior display in the gui. Also mark the current statement as root if relevant.*) let mark_degeneration () = let f stmt (v,_) = let l = get_succ_tanks v in if not (List.for_all Partition.is_empty_tank l) then Value_util.DegenerationPoints.replace stmt false in StmtTable.iter f automaton.stmt_table; match !current_ki with | Kglobal -> () | Kstmt s -> let englobing_kf = Kernel_function.find_englobing_kf s in if Kernel_function.equal englobing_kf kf then ( Value_util.DegenerationPoints.replace s true) (* If the postconditions have not been evaluated, mark them as true. *) let mark_postconds_as_true () = ignore (Logic.check_fct_postconditions kf active_behaviors Normal ~pre_state:initial_state ~post_states:States.empty ~result:None) let compute () : state list or_bottom = if interpreter_mode then simulate automaton.entry_point (get_initial_flow ()) else begin let wto = Interpreted_automata.get_wto kf in iterate_list wto end; if not !post_conditions then mark_postconds_as_true (); let final_store = get_vertex_store automaton.return_point in Bottom.bot_of_list (Partition.expanded final_store) (* --- Results conversion --- *) let merge_conditions () = let table = StmtTable.create 5 in let fill (_,e,_) = match e.edge_transition with | Guard (_exp,kind,stmt) -> let mask = match kind with | Then -> Db.Value.mask_then | Else -> Db.Value.mask_else in let edge_info = snd (get_edge_data e) in let old_status = try StmtTable.find table stmt with Not_found -> 0 and status = if edge_info.fireable then mask else 0 in let new_status = old_status lor status in StmtTable.replace table stmt new_status; | _ -> () in G.iter_edges_e fill graph; Db.Value.merge_conditions table let is_instr s = match s.skind with Instr _ -> true | _ -> false let states_after_stmt states_before states_after = let return_stmt = Kernel_function.find_return kf in let states_before = Lazy.force states_before in let states_after = Lazy.force states_after in StmtTable.iter (fun stmt state -> List.iter (fun pred -> if not (is_instr pred) then try let cur = StmtTable.find states_after pred in let state = Domain.join state cur in StmtTable.replace states_after pred state with Not_found -> StmtTable.add states_after pred state ) stmt.preds; ) states_before; (* Since the return instruction has no successor, it is not visited by the iter above. We fill it manually *) (try let s = StmtTable.find states_before return_stmt in StmtTable.add states_after return_stmt s with Kernel_function.No_Statement | Not_found -> () ); states_after let merge_results () = let get_merged_states = let merged_states = VertexTable.create control_point_count and get_smashed_store v = let store = get_vertex_store v in Partition.smashed store in fun ~all stmt (v : vertex) -> if all || is_instr stmt then VertexTable.memo merged_states v get_smashed_store else `Bottom and lift_to_cvalues table = StmtTable.map (fun _ s -> Domain.get_cvalue_or_top s) (Lazy.force table) in let merged_pre_states = lazy (StmtTable.map' (fun s (v,_) -> get_merged_states ~all:true s v) automaton.stmt_table) in let merged_post_states = lazy (StmtTable.map' (fun s (_,v) -> get_merged_states ~all:false s v) automaton.stmt_table) in let merged_post_states = lazy (states_after_stmt merged_pre_states merged_post_states) in let unmerged_pre_cvalues = lazy (StmtTable.map (fun _stmt (v,_) -> let store = get_vertex_store v in let states = Partition.expanded store in List.map (fun x -> Domain.get_cvalue_or_top x) states) automaton.stmt_table) in let merged_pre_cvalues = lazy (lift_to_cvalues merged_pre_states) and merged_post_cvalues = lazy (lift_to_cvalues merged_post_states) in let callstack = Value_util.call_stack () in if Mark_noresults.should_memorize_function fundec then begin let register_pre = Domain.Store.register_state_before_stmt callstack and register_post = Domain.Store.register_state_after_stmt callstack in StmtTable.iter register_pre (Lazy.force merged_pre_states); StmtTable.iter register_post (Lazy.force merged_post_states); merge_conditions (); end; if not (Db.Value.Record_Value_Superposition_Callbacks.is_empty ()) then begin if Value_parameters.ValShowProgress.get () then Value_parameters.debug ~dkey:dkey_callbacks "now calling Record_Value_Superposition callbacks"; Db.Value.Record_Value_Superposition_Callbacks.apply (callstack, unmerged_pre_cvalues); end; if not (Db.Value.Record_Value_Callbacks.is_empty ()) then begin if Value_parameters.ValShowProgress.get () then Value_parameters.debug ~dkey:dkey_callbacks "now calling Record_Value callbacks"; Db.Value.Record_Value_Callbacks.apply (callstack, merged_pre_cvalues) end; if not (Db.Value.Record_Value_Callbacks_New.is_empty ()) then begin if Value_parameters.ValShowProgress.get () then Value_parameters.debug ~dkey:dkey_callbacks "now calling Record_Value_New callbacks"; if Value_parameters.MemExecAll.get () then Db.Value.Record_Value_Callbacks_New.apply (callstack, Value_types.NormalStore ((merged_pre_cvalues, merged_post_cvalues), (Mem_exec.new_counter ()))) else Db.Value.Record_Value_Callbacks_New.apply (callstack, Value_types.Normal (merged_pre_cvalues, merged_post_cvalues)) end; if not (Db.Value.Record_Value_After_Callbacks.is_empty ()) then begin if Value_parameters.ValShowProgress.get () then Value_parameters.debug ~dkey:dkey_callbacks "now calling Record_After_Value callbacks"; Db.Value.Record_Value_After_Callbacks.apply (callstack, merged_post_cvalues); end; end module Computer (Abstract : Abstractions.Eva) (States : Powerset.S with type state = Abstract.Dom.t) (Transfer : Transfer_stmt.S with type state = Abstract.Dom.t) (Init: Initialization.S with type state := Abstract.Dom.t) (Logic : Transfer_logic.S with type state = Abstract.Dom.t and type states = States.t) (Spec: sig val treat_statement_assigns: assigns -> Abstract.Dom.t -> Abstract.Dom.t end) = struct let compute kf call_kinstr state = let module Dataflow = Make_Dataflow (Abstract) (States) (Transfer) (Init) (Logic) (Spec) (struct let kf = kf let call_kinstr = call_kinstr let initial_state = state end) () in try let results = Dataflow.compute () in if Value_parameters.ValShowProgress.get () then Value_parameters.feedback "Recording results for %a" Kernel_function.pretty kf; Dataflow.merge_results (); let f = Kernel_function.get_definition kf in (match results with | `Value (_::_) when Cil.hasAttribute "noreturn" f.svar.vattr -> Value_util.warning_once_current "function %a may terminate but has the noreturn attribute" Kernel_function.pretty kf; | _ -> ()); results, !Dataflow.cacheable with Db.Value.Aborted as e -> (* analysis was aborted: pop the call stack and inform the caller *) Dataflow.mark_degeneration (); Db.Value.mark_as_computed (); Dataflow.merge_results (); raise e end (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/iterator.mli������������������������������������������0000666�0000000�0000000�00000005320�13571573400�020400� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval (** Mark the analysis as aborted. It will be stopped at the next safe point *) val signal_abort: unit -> unit module Computer (* Abstractions with the evaluator. *) (Abstract: Abstractions.Eva) (* Set of states of abstract domain. *) (States : Powerset.S with type state = Abstract.Dom.t) (* Transfer functions for statement on the abstract domain. *) (Transfer : Transfer_stmt.S with type state = Abstract.Dom.t and type value = Abstract.Val.t) (* Initialization of local variables. *) (Init: Initialization.S with type state := Abstract.Dom.t) (* Transfer functions for the logic on the abstract domain. *) (Logic : Transfer_logic.S with type state = Abstract.Dom.t and type states = States.t) (Spec: sig val treat_statement_assigns: assigns -> Abstract.Dom.t -> Abstract.Dom.t end) : sig val compute: kernel_function -> kinstr -> Abstract.Dom.t -> Abstract.Dom.t list or_bottom * Value_types.cacheable end (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/mem_exec.ml�������������������������������������������0000666�0000000�0000000�00000026742�13571573400�020173� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type Domain = sig include Datatype.S_with_collections include Abstract_domain.Recycle with type t := t end module SaveCounter = State_builder.SharedCounter(struct let name = "Mem_exec.save_counter" end) let new_counter, current_counter = let cur = ref (-1) in (fun () -> cur := SaveCounter.next (); !cur), (fun () -> !cur) let cleanup_ref = ref (fun () -> ()) (* TODO: it would be great to clear also the tables within the plugins. Export self and add dependencies *) let cleanup_results () = !cleanup_ref () exception TooImprecise (* Extract all the bases from a zone *) let bases = function | Locations.Zone.Top (Base.SetLattice.Top, _) -> raise TooImprecise | Locations.Zone.Top (Base.SetLattice.Set s, _) -> s | Locations.Zone.Map m -> Base.Hptset.from_shape (Locations.Zone.shape m) let counter = ref 0 module Make (Value : Datatype.S) (Domain : Domain) = struct incr counter; module CallOutput = Datatype.List (Domain) module StoredResult = Datatype.Triple (Base.Hptset) (* Set of bases possibly read or written by the call. *) (CallOutput) (* The resulting states of the call. *) (Datatype.Int) (* Call number, for plugins *) (* Map from input states to outputs (summary and state). *) module CallEffect = Domain.Hashtbl.Make (StoredResult) (* Map from useful input bases to call effects. *) module InputBasesToCallEffect = Base.Hptset.Hashtbl.Make (CallEffect) (* List of the arguments of a call. *) module ActualArgs = Datatype.List_with_collections (Datatype.Option (Value)) (* None is bottom *) (struct let module_name = "Mem_exec.ActualArgs(" ^ string_of_int !counter ^ ")" end) (* Map from the arguments of a call to stored results. *) module ArgsToStoredCalls = ActualArgs.Map.Make (InputBasesToCallEffect) module PreviousCalls = Kernel_function.Make_Table (ArgsToStoredCalls) (struct let size = 17 let dependencies = [Db.Value.self] let name = "Mem_exec.PreviousCalls(" ^ string_of_int !counter ^ ")" end) let cleanup = !cleanup_ref let () = cleanup_ref := fun () -> cleanup (); PreviousCalls.clear () (** [diff_base_full_zone bases zones] remove from the set of bases [bases] those of which all bits are present in [zones] *) let diff_base_full_zone = let cache = Hptmap_sig.PersistentCache "Mem_exec.diff_base_full_zone" in let empty_left _ = Base.Hptset.empty (* nothing left to clear *) in let empty_right v = v (* return all bases unchanged *) in (* Check whether [range] covers the validity of [b]. If so, remove [b] (hence, return an empty set). Otherwise, keep [b]. Variable bases are always kept, because they may be changed into weak variables later. This is specific to the way this function is used later in this file. *) let both b range = begin match Base.validity b with | Base.Invalid -> assert false | Base.Empty -> Base.Hptset.empty | Base.Variable _ -> Base.Hptset.singleton b | Base.Known (min, max) | Base.Unknown (min, _, max) -> match Int_Intervals.project_singleton range with | Some (min', max') -> if Integer.equal min min' && Integer.equal max max' then Base.Hptset.empty else Base.Hptset.singleton b | None -> Base.Hptset.singleton b end in let join = Base.Hptset.union in let empty = Base.Hptset.empty in let f = Base.Hptset.fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty in fun bases z -> match z with | Locations.Zone.Map m -> f bases (Locations.Zone.shape m) | Locations.Zone.Top _ -> bases (* Never happens anyway *) (* Extends the input [bases] of a function [kf] by adding all bases related to these inputs in state [state]. We perform a fixpoint over [Domain.relate] to compute the transitive closure of the relations in [state] on [bases]. Indeed, if a domain D1 relates x and y, and a domain D2 relates y and z, then x and z are also related. All bases related to the input [bases] should be taken into account when applying the memexec cache, as their values may impact the analysis of [kf] starting from state [state]. As a full fixpoint computation could be costly, we stop after [count] calls to [Domain.relate] and we disable memexec if a fixpoint is not reached. *) let rec expand_inputs_with_relations count kf bases state = let related_bases = Domain.relate kf bases state in match related_bases with | Base.SetLattice.Top -> related_bases | Base.SetLattice.Set new_bases -> let expanded_bases = Base.Hptset.union new_bases bases in if Base.Hptset.equal expanded_bases bases then Base.SetLattice.inject expanded_bases else if count <= 0 then Base.SetLattice.top else expand_inputs_with_relations (count - 1) kf expanded_bases state let store_computed_call kf input_state args (call_result: Domain.t list Bottom.or_bottom) = match Transfer_stmt.current_kf_inout () with | None -> () | Some inout -> try let output_bases = bases inout.Inout_type.over_outputs_if_termination and input_bases = bases inout.Inout_type.over_inputs in (* There are two strategies to compute the 'inputs' for a memexec function: either we take all inputs_bases+outputs_bases (outputs_bases are important because of weak updates), or we remove the sure outputs from the outputs, as sure outputs by definition strong updated. The latter will enable memexec to fire more often, but requires more computations. *) let remove_sure_outputs = true in let input_bases = if remove_sure_outputs then let uncertain_output_bases = (* Remove outputs whose base is completely overwritten *) diff_base_full_zone output_bases inout.Inout_type.under_outputs_if_termination in Base.Hptset.union input_bases uncertain_output_bases else Base.Hptset.union input_bases output_bases in let input_bases = expand_inputs_with_relations 2 kf input_bases input_state in let input_bases = match input_bases with | Base.SetLattice.Top -> raise TooImprecise | Base.SetLattice.Set bases -> bases in let state_input = Domain.filter kf `Pre input_bases input_state in (* Outputs bases, that is bases that are copy-pasted, also include input bases. Indeed, those may get reduced during the call. *) let all_output_bases = if remove_sure_outputs then Base.Hptset.union input_bases output_bases else input_bases in (* Adds the fake varinfo used for the result of [kf] to the output_bases. *) let return_varinfo = Library_functions.get_retres_vi kf in let return_base = Extlib.opt_map Base.of_varinfo return_varinfo in let all_output_bases = Extlib.opt_fold Base.Hptset.add return_base all_output_bases in let clear state = Domain.filter kf `Post all_output_bases state in let call_result = match call_result with | `Bottom -> [] | `Value list -> list in let outputs = List.map clear call_result in let call_number = current_counter () in let map_a = try PreviousCalls.find kf with Not_found -> ActualArgs.Map.empty in let hkf = let args = List.map (function `Bottom -> None | `Value v -> Some v) args in try ActualArgs.Map.find args map_a with Not_found -> let h = Base.Hptset.Hashtbl.create 11 in let map_a = ActualArgs.Map.add args h map_a in PreviousCalls.replace kf map_a; h in let hkb = try Base.Hptset.Hashtbl.find hkf input_bases with Not_found -> let h = Domain.Hashtbl.create 11 in Base.Hptset.Hashtbl.add hkf input_bases h; h in Domain.Hashtbl.add hkb state_input (all_output_bases, outputs, call_number); with | TooImprecise | Kernel_function.No_Statement | Not_found -> () exception Result_found of CallOutput.t * int (** Find a previous execution in [map_inputs] that matches [st]. raise [Result_found] when this execution exists, or do nothing. *) let find_match_in_previous kf (map_inputs: InputBasesToCallEffect.t) state = let aux_previous_call binputs hstates = let brelated = Domain.relate kf binputs state in if not Base.SetLattice.(is_included brelated (inject binputs)) then () else (* restrict [state] to the inputs of this call *) let st_filtered = Domain.filter kf `Pre binputs state in try let bases, outputs, i = Domain.Hashtbl.find hstates st_filtered in (* We have found a previous execution, in which the outputs are [outputs]. Copy them in [state] and return this result. *) let process output = Domain.reuse kf bases ~current_input:state ~previous_output:output in let outputs = List.map process outputs in raise (Result_found (outputs, i)) with Not_found -> () in Base.Hptset.Hashtbl.iter aux_previous_call map_inputs let reuse_previous_call kf state args = try let previous_kf = PreviousCalls.find kf in let args = List.map (function `Bottom -> None | `Value v -> Some v) args in let previous = ActualArgs.Map.find args previous_kf in find_match_in_previous kf previous state; None with | Not_found -> None | Result_found (outputs, i) -> let call_result = outputs in Some (Bottom.bot_of_list call_result, i) end (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/mem_exec.mli������������������������������������������0000666�0000000�0000000�00000006077�13571573400�020343� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval module type Domain = sig include Datatype.S_with_collections include Abstract_domain.Recycle with type t := t end (** Counter that must be used each time a new call is analyzed, in order to refer to it later *) val new_counter : unit -> int (** Clean all previously stored results *) val cleanup_results: unit -> unit module Make (Value : Datatype.S) (Domain : Domain) : sig (** [store_computed_call kf init_state args call_results] memoizes the fact that calling [kf] with initial state [init_state] and arguments [args] resulted in the results [call_results]. Those information are intended to be reused in subsequent calls *) val store_computed_call: kernel_function -> Domain.t -> Value.t or_bottom list -> Domain.t list or_bottom -> unit (** [reuse_previous_call kf init_state args] searches amongst the previous analyzes of [kf] one that matches the initial state [init_state] and the values of arguments [args]. If none is found, [None] is returned. Otherwise, the results of the analysis are returned, together with the index of the matching call. (This last information is intended to be used by the plugins that have registered Value callbacks.) *) val reuse_previous_call: kernel_function -> Domain.t -> Value.t or_bottom list -> (Domain.t list or_bottom * int) option end (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/recursion.ml������������������������������������������0000666�0000000�0000000�00000011721�13571573400�020411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Recursion *) (* Our current treatment for recursion -- use the specification for the function that begins the recursive cycle -- is incorrect for function with formals whose address is taken. Indeed, we do not know which "instance" of the formal is updated by the specification. In this case, warn the user. *) let check_formals_non_referenced kf = let formals = Kernel_function.get_formals kf in if List.exists (fun vi -> vi.vaddrof) formals then Value_parameters.error ~current:true ~once:true "function '%a' (involved in a recursive call) has a formal parameter \ whose address is taken. Analysis may be unsound." Kernel_function.pretty kf let warn_recursive_call kf call_stack = if Value_parameters.IgnoreRecursiveCalls.get () then begin Value_util.warning_once_current "@[recursive call@ during@ value@ analysis@ of %a \ @[(%a <- %a)@].@ Assuming@ the call@ has@ no effect.@ \ The analysis@ will@ be@ unsound.@]" Kernel_function.pretty kf Kernel_function.pretty kf Value_types.Callstack.pretty call_stack ; check_formals_non_referenced kf; Db.Value.recursive_call_occurred kf; end else begin Value_parameters.error ~once:true ~current:true "@[@[detected@ recursive@ call@ (%a <- %a)@]@;@[Use %s@ to@ \ ignore@ (beware@ this@ will@ make@ the analysis@ unsound)@]@]" Kernel_function.pretty kf Value_types.Callstack.pretty call_stack Value_parameters.IgnoreRecursiveCalls.option_name; raise Db.Value.Aborted end (* Check whether the function at the top of the call-stack starts a recursive call. *) let is_recursive_call kf = let call_stack = Value_util.call_stack () in if List.exists (fun (f, _) -> f == kf) call_stack then (warn_recursive_call kf call_stack; true) else false (* Find a spec for a function [kf] that begins a recursive call. If [kf] has no existing specification, generate (an incorrect) one, and warn loudly. *) let _spec_for_recursive_call kf = let initial_spec = Annotations.funspec ~populate:false kf in match Cil.find_default_behavior initial_spec with | Some bhv when bhv.b_assigns <> WritesAny -> initial_spec | _ -> let assigns = Infer_annotations.assigns_from_prototype kf in let bhv = Cil.mk_behavior ~assigns:(Writes assigns) () in let spec = { (Cil.empty_funspec ()) with spec_behavior = [bhv] } in Value_parameters.error ~once:true "@[recursive@ call@ on@ an unspecified@ \ function.@ Using@ potentially@ invalid@ inferred assigns '%t'@]" (fun fmt -> match assigns with | [] -> Format.pp_print_string fmt "assigns \\nothing" | _ :: _ -> Pretty_utils.pp_list ~sep:"@ " Printer.pp_from fmt assigns); (* Merge existing spec into our custom one with assigns *) Logic_utils.merge_funspec ~silent_about_merging_behav:true spec initial_spec; spec let empty_spec_for_recursive_call kf = let typ_res = Kernel_function.get_return_type kf in let empty = Cil.empty_funspec () in let assigns = if Cil.isVoidType typ_res then Writes [] else let res = TResult typ_res, TNoOffset in let res = Logic_const.term (TLval res) (Ctype typ_res) in let res = Logic_const.new_identified_term res in Writes [res, From []] in let bhv = Cil.mk_behavior ~assigns ~name:Cil.default_behavior_name () in empty.spec_behavior <- [bhv]; empty �����������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/recursion.mli�����������������������������������������0000666�0000000�0000000�00000004037�13571573400�020564� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Handling of recursion cycles in the callgraph *) open Cil_types val is_recursive_call: kernel_function -> bool (** Given the current state of the call stack, detect whether the given given function would start a recursive cycle. *) val empty_spec_for_recursive_call: kernel_function -> spec (** Generate an empty spec [assigns \nothing] or [assigns \result \from \nothing], to be used to "approximate" the results of a recursive call. *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/subdivided_evaluation.ml������������������������������0000666�0000000�0000000�00000116325�13571573400�022757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval let dkey = Value_parameters.register_category "nonlin" (* ----------------- Occurrences of lvalues in expressions ------------------ *) module LvalMap = Cil_datatype.LvalStructEq.Map module LvalSet = Cil_datatype.LvalStructEq.Set (* An expression [e] is non-linear on [x] if [x] appears multiple times in [e]. When evaluating such an expression, a disjunction over the possible values of [x] may gain some precision with respect to the interval semantics. An expression can be non-linear on several variables. On expressions such as [x*x+y*y] or [(x+x)*y + y], we want to subdivide on x and on y separately (and for the second expression, we want to subdivide on x before y). For expressions such as [x*x - 2*x*y + y*y], we want to subdivide on x and y simultaneously. When evaluating an expression [e] by subdividing the values of a list of lvalues [lvals]: - we evaluate the entire expression [e], and removes the values that lead to bottom from the possible values for [lvals]; - we join the result of all subdivisions, and we reduce accordingly the possible values for [e] and for the smallest subexpression that contains all occurrences of [lvals]. Indeed, the more precise value computed for [e] could be erased by a subdivision on others variables: when [e = x*x + y*y], the subdivision on [y] overwrites the value of [e] computed by subdivision on [x], but not the value of [x*x]. *) (* To detect non-linearity in an expression [expr], we browse [expr] by computing a maps that link any lvalue [lval] in [expr] to: - a subexpression of [expr] that contains all occurrences of [lval]; - the depth of the subexpression in [expr]; we want to subdivide first on lvalues whose depth is higher. - a set of all lvalues [x] such that [lval] appears in the subexpression that contains all occurrences of [x]. If the inverse is also true, we want to subdivide on [x] and [lval] simultaneously. *) (* Union of two maps (see above) for the expression [expr] of depth [depth]. Both maps have been computed for the direct sub-expressions of [expr]. *) let union expr depth map1 map2 = (* Lvalues for which [expr] is the new subexpression (see above). *) let top = ref LvalSet.empty in (* Lvalues such that a lvalue from [!top] appears in their subexpression. *) let deps = ref LvalSet.empty in let merge lval a b = match a, b with | None, None -> None | Some x, None | None, Some x -> Some x | Some (_, _, deps1), Some (_, _, deps2) -> top := LvalSet.add lval !top; deps := LvalSet.union (LvalSet.union deps1 deps2) !deps; Some (expr, depth, LvalSet.union deps1 deps2) in let map = LvalMap.merge merge map1 map2 in LvalMap.mapi (fun lval (e, d, lvs) -> (* Alls lvalues in [expr] now appear in the subexpression of [!top]. *) let lvs = LvalSet.union lvs !top in (* Lvalues in [!deps] should be subdivided with the lvalues in [!top]. *) if LvalSet.mem lval !deps then (expr, depth, lvs) else (e, d, lvs)) map (* [gather_non_linear expr] computes a map from the lvalues [lval] in [expr] to the smallest subexpressions of [expr] that contains all occurrence of [lval]. The depth of each subexpressions (w.r.t. lvalues and binop operations) is also stored in the map. If a lvalue is bound to itself, then it appears only once in [expr]. Otherwise, we say that the expression is non linear on this lvalue. *) let gather_non_linear expr = let rec compute depth expr = match expr.enode with | Lval (host, offset as lv) -> let d = succ depth in let map1 = compute_from_offset d expr offset in let map2 = compute_from_host d host in let map = union expr depth map1 map2 in if LvalMap.is_empty map && Cil.isArithmeticType (Cil.typeOfLval lv) then LvalMap.singleton lv (expr, d, LvalSet.empty) else map | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> compute depth e | BinOp (_, e1, e2, _) -> (* Lvalues that appear in [e1] and [e2] are bound to [expr]. *) let d = succ depth in union expr d (compute d e1) (compute d e2) | _ -> LvalMap.empty and compute_from_host depth = function | Mem e -> compute depth e | Var _ -> LvalMap.empty and compute_from_offset depth lval = function | NoOffset -> LvalMap.empty | Field (_, offset) -> compute_from_offset depth lval offset | Index (e, offset) -> let map1 = compute_from_offset depth lval offset in let map2 = compute depth e in union lval depth map1 map2 in compute 0 expr (* Map from subexpressions to the list of their non-linear lvalues. *) module ExpMap = struct include Cil_datatype.ExpStructEq.Map let add expr lv map = try let list = find expr map in add expr (lv :: list) map with Not_found -> add expr [lv] map end (* Map from the depth of subexpression to ExpMap. *) module DepthMap = struct include Datatype.Int.Map let add depth expr lv map = let expmap = try let expmap = find depth map in ExpMap.add expr lv expmap with Not_found -> ExpMap.singleton expr [lv] in add depth expmap map end let same lval expr = match expr.enode with | Lval lv -> Cil_datatype.LvalStructEq.equal lv lval | _ -> false (* Converts a map from lvalues to expressions and depth into an association list from expressions to list of lvalues, sorted by decreasing depth of expressions. The lvalues bound to themselves are ignored. *) let reverse_map map = let fill lval (expr, depth, _) acc = if same lval expr then acc else DepthMap.add depth expr lval acc in let depthmap = LvalMap.fold fill map DepthMap.empty in let concat _depth map acc = ExpMap.bindings map @ acc in DepthMap.fold concat depthmap [] module LvalList = Datatype.List (Cil_datatype.LvalStructEq) module NonLinear = Datatype.Pair (Cil_datatype.Exp) (LvalList) module NonLinears = Datatype.List (NonLinear) module Non_linear_expressions = State_builder.Hashtbl (Cil_datatype.ExpStructEq.Hashtbl) (NonLinears) (struct let name = "Value.Subdivided_evaluation.Non_linear_expressions" let size = 16 let dependencies = [ Ast.self ] end) (* Computes the non-linear subexpressions of [expr], and the lvalues on which they are non-linear. Returns an association list from such subexpressions to lists of involved lvalues, sorted by decreasing depth of the subexpressions. *) let compute_non_linear expr = try Non_linear_expressions.find expr with Not_found -> let map = gather_non_linear expr in let list = reverse_map map in List.iter (fun (e, lval) -> Value_parameters.result ~current:true ~once:true ~dkey "non-linear '%a', lv '%a'" Printer.pp_exp e (Pretty_utils.pp_list ~sep:", " Printer.pp_lval) lval) list; Non_linear_expressions.replace expr list; list (* ------------------------ Operations on cvalues --------------------------- *) let can_be_subdivided cvalue = Cvalue.V.is_arithmetic cvalue && not (Cvalue.V.cardinal_zero_or_one cvalue) (* All the functions below assume that their arguments are arithmetic (no pointer values). *) (* The [bounds_] function are used to stop the subdivision as an optimization. They must return singleton values, but not necessarily the bounds of the argument, in case this is not really possible. *) let bounds_float v = try let i = Cvalue.V.project_ival v in match Ival.min_and_max_float i with | None, _ -> let v = Cvalue.V.inject_float Fval.nan in v, v | Some (f1, f2), _ -> Cvalue.V.inject_float (Fval.inject_singleton f1), Cvalue.V.inject_float (Fval.inject_singleton f2) with Cvalue.V.Not_based_on_null -> assert false let bounds_int v = try let i = Cvalue.V.project_ival v in match Ival.min_and_max i with | None, None -> let v = Cvalue.V.inject_int Integer.zero in v, v | Some i, None | None, Some i -> let v = Cvalue.V.inject_int i in v, v | Some i1, Some i2 -> Cvalue.V.inject_int i1, Cvalue.V.inject_int i2 with Cvalue.V.Not_based_on_null -> assert false let bounds_cvalue cvalue = if Cvalue.V.(is_included cvalue top_float) then bounds_float cvalue else if Cvalue.V.(is_included cvalue top_int) then bounds_int cvalue else assert false (* pointers *) let compare_bound ival_compare_bound v1 v2 = if v1 == v2 then 0 else if Cvalue.V.is_bottom v2 then -1 else if Cvalue.V.is_bottom v1 then 1 else try let f1 = Cvalue.V.project_ival v1 in let f2 = Cvalue.V.project_ival v2 in ival_compare_bound f1 f2 with Cvalue.V.Not_based_on_null -> assert false let has_greater_min_bound = compare_bound Ival.has_greater_min_bound let has_smaller_max_bound = compare_bound Ival.has_smaller_max_bound let subdivide size cvalue = try let ival = Cvalue.V.project_ival cvalue in let ival1, ival2 = Ival.subdivide size ival in Cvalue.V.inject_ival ival1, Cvalue.V.inject_ival ival2 with Cvalue.V.Not_based_on_null -> assert false (* -------------------------- Length indexed lists -------------------------- *) (* We subdivide the evaluation of an expression by splitting the possible values of a list of lvalues. Each disjunct of a subdivision contains its hypothesis, that is the list of values asssumed for these lvalues. For a given subdivison, all these hypothesis lists should have the same length (the number of lvalues on which the subdivision is done). We ensure this invariant through length indexed lists, by using GADT. *) module Hypotheses = struct type zero type 'a succ = S let _ = S type ('a, 'length) llist = | Nil: ('a, zero) llist | Cons: 'a * ('a, 'b) llist -> ('a, 'b succ) llist let rec fold : type l. ('a -> 'b -> 'b) -> ('a, l) llist -> 'b -> 'b = fun f list acc -> match list with | Nil -> acc | Cons (x, tl) -> fold f tl (f x acc) let rec fold2: type l. ('a -> 'b -> 'c -> 'c) -> ('a, l) llist -> ('b, l) llist -> 'c -> 'c = fun f l1 l2 acc -> match l1, l2 with | Nil, Nil -> acc | Cons (x1, tl1), Cons (x2, tl2) -> fold2 f tl1 tl2 (f x1 x2 acc) let rec map: type l. ('a -> 'b) -> ('a, l) llist -> ('b, l) llist = fun f -> function | Nil -> Nil | Cons (x, tl) -> Cons (f x, map f tl) type 'a l = L: ('a, 'l) llist -> 'a l let from_list list = List.fold_left (fun (L acc) elt -> L (Cons (elt, acc))) (L Nil) list (* The hypothesis of a disjunct is a list of cvalues for the subdivided lvalues.*) type 'length subvalues = (Cvalue.V.t, 'length) llist (* Makes a list of bottom cvalues. *) let rec bottom: type l. l subvalues -> l subvalues = function | Nil -> Nil | Cons (_, tl) -> Cons (Cvalue.V.bottom, bottom tl) (* Pointwise comparison of two lists of subvalues. *) let rec compare_subvalues: type l. l subvalues -> l subvalues -> int = fun hyp1 hyp2 -> match hyp1, hyp2 with | Nil, Nil -> 0 | Cons (v1, tail1), Cons (v2, tail2) -> let n = Cvalue.V.compare v1 v2 in if n = 0 then compare_subvalues tail1 tail2 else n (* Pointwise join of two lists of subvalues. *) let rec join_subvalues: type l. l subvalues -> l subvalues -> l subvalues = fun l1 l2 -> match l1, l2 with | Nil, Nil -> Nil | Cons (x1, tl1), Cons (x2, tl2) -> Cons (Cvalue.V.join x1 x2, join_subvalues tl1 tl2) (* Extract the extremum of each subvalue of a list. Returns a list of lists of values (one for each combination of extremum of the initial values). *) let rec bound_subvalues: type l. l subvalues -> l subvalues list = function | Nil -> [ Nil ] | Cons (cvalue, tl) -> let min, max = bounds_cvalue cvalue in let list = bound_subvalues tl in let prepend acc tl = Cons (min, tl) :: Cons (max, tl) :: acc in List.fold_left prepend [] list (* Are all cvalues in the list a singleton? *) let rec cardinal_zero_or_one: type l. l subvalues -> bool = function | Nil -> true | Cons (cvalue, tl) -> Cvalue.V.cardinal_zero_or_one cvalue && cardinal_zero_or_one tl (* Split each subvalue of a list. Returns a list of subvalues lists. If n subvalues of the initial list have been split, the returned list contains 2^n lists of subvalues. Raises Can_not_subdiv if no subvalue of the initial list can be split. *) let split sizes subvalues = let rec split: type l. (Integer.t, l) llist -> l subvalues -> l subvalues list = fun sizes subvalues -> match sizes, subvalues with | Nil, Nil -> [ Nil ] | Cons (size, tl_size), Cons (v, tl) -> let append = try let v1, v2 = subdivide size v in fun acc tl -> Cons (v1, tl) :: Cons (v2, tl) :: acc (* Other subvalues could be split; keep this initial value. *) with Abstract_interp.Can_not_subdiv -> fun acc tl -> Cons (v, tl) :: acc in let list = split tl_size tl in List.fold_left append [] list in let list = split sizes subvalues in (* If the final list contains only one element, no value has been split. *) if List.length list <= 1 then raise Abstract_interp.Can_not_subdiv else list end module type Forward_Evaluation = sig type value type valuation type state val evaluate: ?valuation:valuation -> fuel:int -> state -> exp -> (valuation * value) evaluated end module Make (Value : Abstract.Value.External) (Loc : Abstract_location.S with type value = Value.t) (Valuation: Valuation with type value = Value.t and type loc = Loc.location) (Eva: Forward_Evaluation with type value := Value.t and type valuation := Valuation.t) = struct (* Values are converted to {!Cvalue.V.t}, because those are currently the only values on which we can split. *) let get_cval = match Value.get Main_values.CVal.key with | Some get -> get | None -> fun _ -> Cvalue.V.top let set_cval = let set = Value.set Main_values.CVal.key in fun cval v -> set cval v let activated = Value.mem Main_values.CVal.key module Clear = Clear_Valuation (Valuation) (* These two functions assume that the given expression or lvalue have been evaluated in the valuation. *) let find_val valuation expr = match Valuation.find valuation expr with | `Value record -> record | `Top -> assert false let find_loc valuation lval = match Valuation.find_loc valuation lval with | `Value record -> record | `Top -> assert false (* --------------------- Types for the subdivision ------------------------ *) (* Information about a subdivided lvalue: the lvalue expression, its record and initial value from a first evaluation. These are needed to update the lvalue after the subdivision. *) type lval_info = { lval: lval; lv_expr: exp; lv_record: (Value.t, Valuation.origin) record_val; lv_value: Value.t } (* A length indexed list of lvalues on which the subdivision is done. *) type 'l sub_lvals = (lval_info, 'l) Hypotheses.llist (* A length indexed list of sub-values for the lvalues on which the subdivision is done. *) type 'l subvalues = 'l Hypotheses.subvalues (* A disjunct of a subdivision: - the hypotheses of the disjunct are the subvalues used for the considered lvalues to perform the evaluation; - the result and alarms resulting from the evaluation with these subvalues; - the subresult is the value of the subexpression containing all occurrences of the considered lvalues. *) type 'l disjunct = { hypotheses: 'l subvalues; result: Value.t or_bottom; alarms: Alarmset.t; subresult: Value.t or_bottom; } (* Type of the function that splits subvalues into a partition of smaller subvalues. *) type 'l split = 'l subvalues -> 'l subvalues list (* Type of the function that computes a disjunct from subvalues. *) type 'l compute = 'l subvalues -> 'l disjunct (* A subdivision of the evaluation is stored by a working list of disjuncts, implemented as a heap. The order of the heap is chosen so that the head is always the most relevant disjunct to subdivide next, i.e. the disjunct with the most imprecise result. The set of subvalues for the considered lvalues must be a partition of the initial abstract value initially computed for these lvalues. *) module Subdivision = struct (* We use this reference because we need to change the "direction" of the comparison function, but it is convenient to have the same module in both cases. *) let cmp_result = ref (fun _ _ -> 0) (* If the results are equal, the relative order between disjuncts is unimportant. We just need an ordering function that does not make equal disjuncts with equal images but different subvalues. The current order has been chosen to mimic the results of the previous implementations. *) let compare disjunct1 disjunct2 = let n = !cmp_result disjunct1.result disjunct2.result in if n <> 0 then n else let n = !cmp_result disjunct1.subresult disjunct2.subresult in if n <> 0 then n else Hypotheses.compare_subvalues disjunct2.hypotheses disjunct1.hypotheses type 'l t = E | T of int * 'l disjunct * 'l t * 'l t let rank = function E -> 0 | T (r, _, _, _) -> r let make x a b = let ra = rank a and rb = rank b in if ra >= rb then T (rb + 1, x, a, b) else T (ra + 1, x, b, a) let rec merge h1 h2 = match h1, h2 with | E, h | h, E -> h | T (_, x, a1, b1), T (_, y, a2, b2) -> if compare x y <= 0 then make x a1 (merge b1 h2) else make y a2 (merge h1 b2) let insert x h = merge (T (1, x, E, E)) h let singleton x = insert x E exception Empty let min = function E -> raise Empty | T (_,x,_,_) -> x let extract_min = function | E -> raise Empty | T (_, x, a, b) -> x, merge a b let rec fold f h acc = match h with | E -> acc | T (_, x, h1, h2) -> fold f h2 (f x (fold f h1 acc)) (* Used to reorder the elements of the heap when the comparison function has changed. *) let reorder t = fold (fun elt t -> insert elt t) t E end (* ------------------------------ Subdivision ----------------------------- *) (* Makes the split function for a list of lvalues. The split function depends on the size of each lvalue, computed from their type. *) let make_split valuation (lvals: 'l sub_lvals) : 'l split = let compute_size info = (* The size is defined, as [lv] is a scalar *) let record = find_loc valuation info.lval in Int_Base.project (Eval_typ.sizeof_lval_typ record.typ) in let sizes = Hypotheses.map compute_size lvals in Hypotheses.split sizes (* Joins all the disjuncts of a subdivision into one disjunct. Used to consolidate the results of a subdivision, before updating the valuation with the new values. For the subdivided lvalues, do not include the subvalues that led to bottom. *) let flatten (subdivision: 'l Subdivision.t) : 'l disjunct = let join disjunct acc = let hypotheses = if disjunct.result = `Bottom then acc.hypotheses else Hypotheses.join_subvalues acc.hypotheses disjunct.hypotheses in { hypotheses; result = Bottom.join Value.join acc.result disjunct.result; alarms = Alarmset.union acc.alarms disjunct.alarms; subresult = Bottom.join Value.join acc.subresult disjunct.subresult } in let disjunct, subdivision = Subdivision.extract_min subdivision in let disjunct = if disjunct.result = `Bottom then { disjunct with hypotheses = Hypotheses.bottom disjunct.hypotheses } else disjunct in Subdivision.fold join subdivision disjunct (* Updates the valuation with the new subvalues for the lvalues on which the subdivision is performed. *) let update_variables valuation (lvals: 'l sub_lvals) (subvalues: 'l subvalues) = let update lv_info subvalue valuation = let value = set_cval subvalue lv_info.lv_value in let value = { lv_info.lv_record.value with v = `Value value } in let record = { lv_info.lv_record with value; reductness = Reduced } in Valuation.add valuation lv_info.lv_expr record in Hypotheses.fold2 update lvals subvalues valuation (* Reduces the values of the lvalues on which the subdivision has been done. *) let reduce_variables valuation (lvals: 'l sub_lvals) (subvalues: 'l subvalues) = let update lv_info subvalue valuation = let value = if Cvalue.V.is_bottom subvalue then `Bottom else `Value (set_cval subvalue Value.top) in (* Narrow the new value with the old value, that could have been reduced during the first forward evaluation. *) let record = find_val valuation lv_info.lv_expr in let value = Bottom.narrow Value.narrow value record.value.v in let value = { record.value with v = value } in let record = { record with value; reductness = Reduced } in Valuation.add valuation lv_info.lv_expr record in Hypotheses.fold2 update lvals subvalues valuation (* Updates the valuation with the final value (and alarms if provided) computed for an expression during the subdivision. *) let update_expr valuation expr ?alarms value = let record = find_val valuation expr in let value = { record.value with v = value } in let record = { record with value; reductness = Reduced } in let record = match alarms with | None -> record | Some val_alarms -> { record with val_alarms } in Valuation.add valuation expr record (* Computes the image of the bounds of [subvalues]. Since those bounds are singletons, their image must be in the result of the subdivision. *) let compute_sure_bounds (compute: 'l compute) (subvalues: 'l subvalues) = let singleton_subvalues = Hypotheses.bound_subvalues subvalues in let compute_result subvalues = (compute subvalues).result in let results = List.map compute_result singleton_subvalues in List.fold_left (Bottom.join Value.join) `Bottom results (* Performs a subdivision by applying successively [split] and [compute] on the initial [subdivision]. [has_better_bound] defines the order of the subdivision. At each step, this function takes the smallest disjunct of the current subdivision according to [has_better_bound], then [split] its subvalues into smaller subvalues, and [compute] the disjuncts for each. The process is repeated [subdivnb] times, or until we detect no more improvement is possible. Note that [compute] is applied to each subvalues produced by [split]. If split produces [n] subvalues each time, then [compute] is applied [subdivnb * n] times. *) let do_subdiv subdivnb subdivision has_better_bound split compute = Subdivision.cmp_result := has_better_bound; let working_list = ref (Subdivision.reorder subdivision) in let min = Subdivision.min !working_list in (* We will never be able to improve further than these bounds. *) let bound = ref (compute_sure_bounds compute min.hypotheses) in (* Computes the image of [subvalues], and insert it in [subdivision] for further refinement. If [subvalues] is a singleton, also refines our criterion for stopping. *) let compute_disjunct subdivision subvalues = let disjunct = compute subvalues in if Hypotheses.cardinal_zero_or_one subvalues then bound := Bottom.join Value.join disjunct.result !bound; Subdivision.insert disjunct subdivision; in try for _i = 1 to subdivnb do let disjunct, subdiv = Subdivision.extract_min !working_list in if has_better_bound disjunct.result !bound >= 0 then (* The bound of this disjunct result is already better than [!bound], which must be in the final result. Thus, there is no point in subdividing [disjunct]. And since [subdivision] is sorted, all the other subdivisions also have a better bound. Thus, we stop. *) raise Abstract_interp.Can_not_subdiv; let subvalues_list = split disjunct.hypotheses in let subdiv = List.fold_left compute_disjunct subdiv subvalues_list in working_list := subdiv; done; !working_list with Abstract_interp.Can_not_subdiv -> !working_list let better_bound compare_bound e1 e2 = match e1, e2 with | `Bottom, `Bottom -> 0 | `Bottom, _ -> 1 | _, `Bottom -> -1 | `Value v1, `Value v2 -> compare_bound (get_cval v1) (get_cval v2) (* These function make orders over the disjuncts of a subdivision. They respectively try to reduce the infimum and the supremum of the resulting value of the evaluation. *) let better_min_bound = better_bound has_greater_min_bound let better_max_bound = better_bound has_smaller_max_bound (* Subdivision of the evaluation of the expression [expr], according to the values of a list of lvalues [lvals], in the state [state]. [subexpr] is the smallest subexpression of [expr] containing all occurrences of the lvalues in [lvals]. At the end of the subdivision, we reduce the final value of [expr], [subexpr], and of the lvalues in [lvals]. [valuation] is the result of the evaluation of [expr] without subdivision. This function returns the alarms and the valuation resulting from the subdivided evaluation. *) let subdivide_lvals ~fuel subdivnb valuation state expr subexpr lvals = let Hypotheses.L variables = Hypotheses.from_list lvals in (* Split function for the subvalues of [lvals]. *) let split = make_split valuation variables in (* Clear the valuation to force the evaluation on top of [lvals]. *) let clear lv_info valuation = Clear.clear_englobing_exprs valuation ~expr ~subexpr:lv_info.lv_expr in let cleared_valuation = Hypotheses.fold clear variables valuation in let eq_equal_subexpr = Cil_datatype.ExpStructEq.equal expr subexpr in (* Computes a disjunct from subvalues for [lvals]. *) let compute subvalues = (* Updates [variables] with their new [subvalues]. *) let valuation = update_variables cleared_valuation variables subvalues in (* Evaluates [expr] with this new valuation. *) let eval, alarms = Eva.evaluate ~fuel ~valuation state expr in let result = eval >>-: snd in (* Optimization if [subexpr] = [expr]. *) if eq_equal_subexpr then { hypotheses = subvalues; result; alarms; subresult = result } else (* Retrieve the value of [subexpr] from the valuation. *) let subresult = eval >>- fun (valuation, _) -> let record = find_val valuation subexpr in record.value.v in { hypotheses = subvalues; result; alarms; subresult } in let initial_cvalues = Hypotheses.map (fun info -> get_cval info.lv_value) variables in let initial_disjunct = compute initial_cvalues in (* The initial subdivision, with only one disjunct. *) let subdiv = Subdivision.singleton initial_disjunct in (* Subdivision to reduce the infimum of the result value. *) let subdiv = do_subdiv subdivnb subdiv better_min_bound split compute in (* Subdivision to reduce the supremum of the result value. *) let subdiv = do_subdiv subdivnb subdiv better_max_bound split compute in (* Join the resulting subdivision. *) let disjunct = flatten subdiv in let alarms = disjunct.alarms in (* Updates the initial valuation with the new values for [lvals], [expr] and [subexpr]. *) let eval_result = disjunct.result >>-: fun value -> let valuation = reduce_variables valuation variables disjunct.hypotheses in let valuation = update_expr valuation expr ~alarms disjunct.result in let valuation = if eq_equal_subexpr then valuation else update_expr valuation subexpr disjunct.subresult in valuation, value in eval_result, alarms (* Builds the information for an lvalue. *) let get_info ~fuel valuation state lval = let lv_expr = Value_util.lval_to_exp lval in (* Reevaluates the lvalue in the initial state, as its value could have been reduced in the evaluation of the complete expression, and we cannot omit the alarms for the removed values. *) fst (Eva.evaluate ~fuel ~valuation state lv_expr) >>- fun (valuation, _) -> let lv_record = find_val valuation lv_expr in lv_record.value.v >>-: fun lv_value -> { lval; lv_expr; lv_record; lv_value } (* Makes a list of lvalue information from a list of lvalues. Removes lvalues whose cvalue is singleton or contains addresses, as we cannot subdivide on such values. *) let make_info_list ~fuel valuation state lvals = let get_info = get_info ~fuel valuation state in let get_info acc lval = Bottom.add_to_list (get_info lval) acc in let list = List.fold_left get_info [] lvals in List.filter (fun info -> can_be_subdivided (get_cval info.lv_value)) list (* Before any subdivision, a first evaluation is needed. If it leads to bottom, then returns bottom and the alarms. Otherwise, do the subdivision and only return its result, which is sound and may be more precise than the previous evaluation. *) let (>>>) (t, alarms) f = match t with | `Bottom -> `Bottom, alarms | `Value (valuation, result) -> f valuation result alarms (* Subdivided evaluation of [expr] in state [state]. *) let subdivide_evaluation ~fuel subdivnb initial_valuation state expr = (* Evaluation of [expr] without subdivision. *) let default = Eva.evaluate ~fuel ~valuation:initial_valuation state expr in default >>> fun valuation result alarms -> (* Do not try to subdivide if the result is singleton or contains some pointers: the better_bound heuristic only works on numerical values. *) if not (can_be_subdivided (get_cval result)) then default else (* List of non-linear subexpressions [subexpr], with the lvalues that appear multiple times in [subexpr], candidates for the subdivision. *) let vars = compute_non_linear expr in let rec subdivide_subexpr vars valuation result alarms = match vars with | [] -> `Value (valuation, result), alarms | (subexpr, lvals) :: tail -> (* Retrieve necessary information about the lvalues. Also remove lvalues with pointer or singleton values. *) let lvals_info = make_info_list ~fuel initial_valuation state lvals in match lvals_info with | [] -> subdivide_subexpr tail valuation result alarms | _ -> let lvals = List.map (fun info -> info.lval) lvals_info in let nb = List.length lvals in (* When subdividing on [nb] variables, each split produces 2^n subvalues that are all evaluated. Limits the number of splits to keep the number of evaluations linear on [nb]. *) let subdivnb = if nb > 3 then let pow = Integer.power_int_positive_int in (subdivnb * nb) / (Integer.to_int (pow 2 (nb - 1))) else subdivnb in Value_parameters.result ~current:true ~once:true ~dkey "subdividing on %a" (Pretty_utils.pp_list ~sep:", " Printer.pp_lval) lvals; subdivide_lvals ~fuel subdivnb valuation state expr subexpr lvals_info >>> subdivide_subexpr tail in subdivide_subexpr vars valuation result alarms let evaluate ?(valuation=Valuation.empty) ~fuel state expr = let subdivnb = Value_parameters.LinearLevel.get () in if subdivnb = 0 || not activated then Eva.evaluate ~valuation ~fuel state expr else subdivide_evaluation ~fuel subdivnb valuation state expr (* ---------------------- Reduction by enumeration ------------------------ *) (* Reduce by cond enumerate : when a backward evaluation is not precise enough, tries to reduce further by enumerating the value of some "influential" lvalues. As we can enumerate only on cvalues, extracts the cvalue component of the value module. *) (* Find the value of a previously evaluated expression. *) let find_val valuation expr = match Valuation.find valuation expr with | `Value record -> record.value.v | `Top -> assert false (* [expr] must have been evaluated already. *) let find_loc valuation lval = match Valuation.find_loc valuation lval with | `Value record -> record.loc | `Top -> assert false (* We want to enumerate on imprecise but non-completely imprecise cvalues: reject singleton values, garbled mixes, and values pointing to too many bases. *) let is_enumerable value = not (Cvalue.V.cardinal_zero_or_one value || Cvalue.V.is_imprecise value) && let bases_number = Cvalue.V.fold_bases (fun _ acc -> acc + 1) value 0 in bases_number < 5 (* arbitrary limit *) (* split on a value if it has less than [upto] abstract values, or enumerate only on its bounds. *) let fold_enumerate upto op v acc = try ignore (Cvalue.V.cardinal_less_than v upto); Cvalue.V.fold_enum op v acc with Abstract_interp.Not_less_than -> (* Enumerate on the possible bases, then on the min and max of the offsets *) Cvalue.V.fold_i (fun b i acc -> Ival.fold_int_bounds (fun i acc -> op (Cvalue.V.inject b i) acc) i acc) v acc (* Find locations on which it is interesting to proceed by case disjunction to evaluate the expression: locations which are singletons (on which the cvalue domain can reduce) and has an enumerable value. *) let rec get_influential_vars valuation exp acc = match exp.enode with | Lval (host, off as lval) -> if Cil.typeHasQualifier "volatile" (Cil.typeOfLval lval) then `Value acc else let loc = find_loc valuation lval in if Cvalue.V.cardinal_zero_or_one (get_cval (Loc.to_value loc)) then (* no variable in the host or in the offset can be influential. Check the contents of the location, on which we might want to enumerate*) find_val valuation exp >>-: fun contents -> if is_enumerable (get_cval contents) then exp :: acc else acc else (* A variable in the host or in the offset may be influential. The contents themselves are not influential, because we would need to split both on the location and by content in sync. *) get_vars_host valuation host acc >>- fun acc -> get_vars_offset valuation off acc | BinOp (_, e1, e2, _) -> get_influential_vars valuation e1 acc >>- fun acc -> get_influential_vars valuation e2 acc | UnOp (_, e, _) -> get_influential_vars valuation e acc | CastE (_, exp) -> get_influential_vars valuation exp acc | _ -> `Value acc and get_vars_host valuation host acc = match host with | Var _v -> `Value acc | Mem e -> get_influential_vars valuation e acc and get_vars_offset valuation offset acc = match offset with | NoOffset -> `Value acc | Field (_, off) -> get_vars_offset valuation off acc | Index (ind, off) -> get_influential_vars valuation ind acc >>- fun acc -> get_vars_offset valuation off acc let get_influential_exprs valuation expr = get_influential_vars valuation expr [] let reduce_by_cond_enumerate valuation state cond positive influentials = (* Test whether the condition [expr] may still be true when the sub-expression [e] has the value [v]. *) let condition_may_still_be_true valuation expr record value = let value = { record.value with v = `Value value } in let valuation = Valuation.add valuation expr { record with value } in let eval, _alarms = Eva.evaluate ~valuation ~fuel:0 state cond in match eval with | `Bottom -> false | `Value (_valuation, value) -> let v = get_cval value in if positive then Cvalue.V.contains_non_zero v else if Value_parameters.UndefinedPointerComparisonPropagateAll.get () then Cvalue.V.contains_zero v else Cvalue.V.is_included Cvalue.V.singleton_zero v in let enumerate subexpr = match Valuation.find valuation subexpr with | `Top -> `Value valuation | `Value record -> record.value.v >>- fun v -> let cleared_valuation = Clear.clear_englobing_exprs valuation ~expr:cond ~subexpr in let process sub_cvalue acc = let subvalue = set_cval sub_cvalue v in if condition_may_still_be_true cleared_valuation subexpr record subvalue then Bottom.join Value.join (`Value subvalue) acc else acc in let cvalue = get_cval v in let upto = succ (Ival.get_small_cardinal ()) in fold_enumerate upto process cvalue `Bottom >>-: fun value -> if Value.equal v value then valuation else let reductness = if record.reductness = Created then Created else Reduced in let value = { record.value with v = `Value value } in let record = { record with value; reductness } in Valuation.add valuation subexpr record in match influentials with | [] -> `Value valuation | expr :: _ -> enumerate expr (* If the value module contains no cvalue component, this function is inoperative. Otherwise, it calls reduce_by_cond_enumerate with the value accessor for the cvalue component. *) let reduce_by_enumeration valuation state expr positive = if activated && Value_parameters.EnumerateCond.get () then get_influential_exprs valuation expr >>- fun split_on -> reduce_by_cond_enumerate valuation state expr positive split_on else `Value valuation end (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/subdivided_evaluation.mli�����������������������������0000666�0000000�0000000�00000005225�13571573400�023124� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Subdivision of the evaluation on non-linear expressions: for expressions in which some l-values appear multiple times, proceed by disjunction on their abstract value, in order to gain precision. *) open Cil_types module type Forward_Evaluation = sig type value type valuation type state val evaluate: ?valuation:valuation -> fuel:int -> state -> exp -> (valuation * value) Eval.evaluated end module Make (Value : Abstract.Value.External) (Loc: Abstract_location.S with type value = Value.t) (Valuation: Eval.Valuation with type value = Value.t and type loc = Loc.location) (Eva: Forward_Evaluation with type value := Value.t and type valuation := Valuation.t) : sig val evaluate: ?valuation:Valuation.t -> fuel:int -> Eva.state -> exp -> (Valuation.t * Value.t) Eval.evaluated val reduce_by_enumeration: Valuation.t -> Eva.state -> exp -> bool -> Valuation.t Eval.or_bottom end (* Local Variables: compile-command: "make -C ../../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/transfer_logic.ml�������������������������������������0000666�0000000�0000000�00000067230�13571573400�021407� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval (* Eva ignores predicates with a "no_eva" tag. *) let ignore_predicate named_pred = List.exists (fun tag -> tag = "no_eva") named_pred.Cil_types.pred_name (* -------------------------- Message emission ------------------------------ *) (* The function that puts statuses on pre- and post-conditions is essentially agnostic as to which kind of property it operates on. However, the messages that get emitted are quite different. The types below distinguish between the various possibilities. *) type postcondition_kf_kind = | PostLeaf (* The function has no body in the AST *) | PostBody (* The function has a body, which is used for the evaluation *) | PostBuiltin (* A cvalue builtin is used for the function. *) | PostUseSpec (* The function has a body, but its specification is used instead *) type p_kind = Precondition | Postcondition of postcondition_kf_kind | Assumes let emit_postcond_status = function | PostLeaf | PostBuiltin -> false | PostBody | PostUseSpec -> true let pp_p_kind fmt = function | Precondition -> Format.pp_print_string fmt "precondition" | Postcondition _ -> Format.pp_print_string fmt "postcondition" | Assumes -> Format.pp_print_string fmt "assumes" let post_kind kf = if Builtins.find_builtin_override kf <> None then PostBuiltin else if !Db.Value.use_spec_instead_of_definition kf then if Kernel_function.is_definition kf then PostUseSpec else PostLeaf else PostBody let conv_status = function | Alarmset.False -> Property_status.False_if_reachable; | Alarmset.True -> Property_status.True; | Alarmset.Unknown -> Property_status.Dont_know let emit_status ppt status = if status = Property_status.False_if_reachable then begin Red_statuses.add_red_property (Property.get_kinstr ppt) ppt; end; Property_status.emit ~distinct:true Value_util.emitter ~hyps:[] ppt status (* Display the message as result/warning depending on [status] *) let msg_status status ?current ?once ?source fmt = if status = Alarmset.True then if Value_parameters.ValShowProgress.get () then Value_parameters.result ?current ?once ?source fmt else Value_parameters.result ?current ?once ?source ~level:2 fmt else Value_util.alarm_report ?current ?once ?source fmt let behavior_inactive fmt = Format.fprintf fmt " (Behavior may be inactive, no reduction performed.)" let pp_behavior fmt b = if not (Cil.is_default_behavior b) then Format.fprintf fmt ", behavior %s" b.b_name let pp_header kf fmt behavior = Format.fprintf fmt "function %a%a" Kernel_function.pretty kf pp_behavior behavior (* The location displayed for a precondition is the call site. To distinguish between different preconditions of a behavior, this function: - prints the name of the precondition, if it exists; - otherwise, inlines the precondition, if the behavior contains more than one precondition. *) let pp_requires behavior fmt named_pred = if named_pred.Cil_types.pred_name <> [] then Description.pp_named fmt named_pred else if List.length behavior.b_requires > 1 then Format.fprintf fmt " %a" Printer.pp_predicate named_pred (* To identify a predicate, prints the function, the behavior (if non default), the kind of predicate and the name of the predicate (if any). *) let pp_predicate behavior kind fmt named_pred = let pp_predicate = match kind with | Precondition -> pp_requires behavior | _ -> Description.pp_named in Format.fprintf fmt "%a%a" pp_p_kind kind pp_predicate named_pred let emit_message_and_status kind kf behavior ~active ~empty property named_pred status = let pp_predicate = pp_predicate behavior kind in let source = fst (Property.location property) in match kind with | Precondition | Postcondition PostBody -> msg_status status ~once:true ~source "%a: %s%a got status %a.%t%t" (pp_header kf) behavior (if empty then "no state left, " else "") pp_predicate named_pred Alarmset.Status.pretty status (if active then (fun _ -> ()) else behavior_inactive) Value_util.pp_callstack; emit_status property (conv_status status); | Postcondition postk -> (* Do not emit a status for leaf functions or builtins. Otherwise, we would overwrite the "considered valid" status of the kernel. *) if emit_postcond_status postk then emit_status property (conv_status status) | Assumes -> (* No statuses are emitted for 'assumes' clauses, and for the moment we do not emit text either *) () let create_conjunction l= let loc = match l with | [] -> None | p :: _ -> Some p.ip_content.pred_loc in Logic_const.(List.fold_right (fun p1 p2 -> pand ?loc (p1, p2)) (List.map pred_of_id_pred l) ptrue) (* -------------------------- Active behaviors ------------------------------ *) module ActiveBehaviors = struct type t = { funspec: funspec; is_active: funbehavior -> Alarmset.status } module HashBehaviors = Hashtbl.Make( struct type t = funbehavior let equal b1 b2 = b1.b_name = b2.b_name let hash b = Hashtbl.hash b.b_name end) let is_active eval_predicate b = let assumes = create_conjunction b.b_assumes in eval_predicate assumes let create eval_predicate funspec = let h = HashBehaviors.create 3 in let is_active = fun b -> try HashBehaviors.find h b with Not_found -> let active = is_active eval_predicate b in HashBehaviors.add h b active; active in { is_active; funspec } let is_active ab behavior = ab.is_active behavior let active_behaviors ab = List.filter (fun b -> is_active ab b != Alarmset.False) ab.funspec.spec_behavior let is_active_from_name ab name = try let list = ab.funspec.spec_behavior in let behavior = List.find (fun b' -> b'.b_name = name) list in is_active ab behavior (* This case happens for behaviors of statement contract, that are not handled by this module. *) with Not_found -> Alarmset.Unknown end let () = Db.Value.valid_behaviors := (fun kf state -> let funspec = Annotations.funspec kf in let eval_predicate pred = match Eval_terms.(eval_predicate (env_pre_f ~pre:state ()) pred) with | Eval_terms.True -> Alarmset.True | Eval_terms.False -> Alarmset.False | Eval_terms.Unknown -> Alarmset.Unknown in let ab = ActiveBehaviors.create eval_predicate funspec in ActiveBehaviors.active_behaviors ab ) let ip_from_precondition kf call_ki b pre = let ip_precondition = Property.ip_of_requires kf Kglobal b pre in match call_ki with | Kglobal -> (* status of the main function. We update the global status, and pray that there is no recursion. TODO: check what the WP does.*) ip_precondition | Kstmt stmt -> (* choose the copy of the precondition on the call point [stmt]. *) Statuses_by_call.setup_precondition_proxy kf ip_precondition; Statuses_by_call.precondition_at_call kf ip_precondition stmt (* Emits informative messages about inactive behaviors, and emits a valid status for requires and ensures that have not been evaluated. *) let process_inactive_behavior kf call_ki behavior = let emitted = ref false in (* We emit a valid status for every requires and ensures of the behavior. *) List.iter (fun (tk, _ as post) -> if tk = Normal then begin emitted := true; if emit_postcond_status (post_kind kf) then let ip = Property.ip_of_ensures kf Kglobal behavior post in emit_status ip Property_status.True; end ) behavior.b_post_cond; List.iter (fun pre -> emitted := true; let ip = ip_from_precondition kf call_ki behavior pre in emit_status ip Property_status.True; ) behavior.b_requires; if !emitted then Value_parameters.result ~once:true ~current:true ~level:2 "%a: assumes got status invalid; behavior not evaluated.%t" (pp_header kf) behavior Value_util.pp_callstack let process_inactive_behaviors call_ki kf behaviors = List.iter (process_inactive_behavior kf call_ki) behaviors (* Emits informative messages about behavior postconditions not evaluated because the _requires_ of the behavior are invalid. *) let process_inactive_postconds kf inactive_bhvs = List.iter (fun b -> let emitted = ref false in List.iter (fun (tk, _ as post) -> if tk = Normal then begin emitted := true; if emit_postcond_status (post_kind kf) then let ip = Property.ip_of_ensures kf Kglobal b post in emit_status ip Property_status.True; end ) b.b_post_cond; if !emitted then Value_parameters.result ~once:true ~current:true ~level:2 "%a: requires got status invalid; postconditions not evaluated.%t" (pp_header kf) b Value_util.pp_callstack; ) inactive_bhvs (* -------------------------------- Functor --------------------------------- *) module type S = sig type state type states val create: state -> kernel_function -> ActiveBehaviors.t val create_from_spec: state -> spec -> ActiveBehaviors.t val check_fct_preconditions_for_behaviors: kinstr -> kernel_function -> behavior list -> Alarmset.status -> states -> states val check_fct_preconditions: kinstr -> kernel_function -> ActiveBehaviors.t -> state -> states or_bottom val check_fct_postconditions_for_behaviors: kernel_function -> behavior list -> Alarmset.status -> pre_state:state -> post_states:states -> result:varinfo option -> states val check_fct_postconditions: kernel_function -> ActiveBehaviors.t -> termination_kind -> pre_state:state -> post_states:states -> result:varinfo option -> states or_bottom val evaluate_assumes_of_behavior: state -> behavior -> Alarmset.status val interp_annot: limit:int -> record:bool -> kernel_function -> ActiveBehaviors.t -> stmt -> code_annotation -> initial_state:state -> states -> states end module type LogicDomain = sig type t val top: t val equal: t -> t -> bool val evaluate_predicate: t Abstract_domain.logic_environment -> t -> predicate -> Alarmset.status val reduce_by_predicate: t Abstract_domain.logic_environment -> t -> predicate -> bool -> t or_bottom end module Make (Domain: LogicDomain) (States: Powerset.S with type state = Domain.t) = struct type state = Domain.t type states = States.t let pre_env ~pre = let states = function | BuiltinLabel Pre -> pre | BuiltinLabel Here -> pre | BuiltinLabel _ | FormalLabel _ | StmtLabel _ -> Domain.top in Abstract_domain.{ states; result = None } let post_env ~pre ~post ~result = let states = function | BuiltinLabel Pre -> pre | BuiltinLabel Old -> pre | BuiltinLabel Post -> post | BuiltinLabel Here -> post | BuiltinLabel _ | FormalLabel _ | StmtLabel _ -> Domain.top in Abstract_domain.{ states; result } let here_env ~pre ~here = let states = function | BuiltinLabel Pre -> pre | BuiltinLabel Here -> here | BuiltinLabel _ | FormalLabel _ | StmtLabel _ -> Domain.top in Abstract_domain.{ states; result = None } let create_from_spec pre funspec = let eval_predicate = Domain.evaluate_predicate (pre_env ~pre) pre in ActiveBehaviors.create eval_predicate funspec let create init_state kf = let funspec = Annotations.funspec kf in create_from_spec init_state funspec exception Does_not_improve let rec fold_on_disjunction f p acc = match p.pred_content with | Por (p1,p2 ) -> fold_on_disjunction f p2 (fold_on_disjunction f p1 acc) | _ -> f p acc let count_disjunction p = fold_on_disjunction (fun _pred -> succ) p 0 let split_disjunction_and_reduce ~reduce ~limit env state pred = let nb = count_disjunction pred in if nb <= 1 && not reduce then States.singleton state (* reduction not required, nothing to split *) else if nb <= limit then begin (* Can split and maybe reduce *) let treat_subpred pred acc = match Domain.reduce_by_predicate env state pred true with | `Bottom -> acc | `Value current_state -> if Domain.equal current_state state then (* This part of the disjunction will contain the entire state. Reduction has failed, there is no point in propagating the smaller states in acc, that are contained in this one. *) raise Does_not_improve else States.add current_state acc in try fold_on_disjunction treat_subpred pred States.empty with Does_not_improve -> States.singleton state end else if reduce then (* Not enough slevel to split, but we should reduce in a global way *) match Domain.reduce_by_predicate env state pred true with | `Bottom -> States.empty | `Value s -> States.singleton s else (* Not enough slevel to split, and reduction not required *) States.singleton state let eval_split_and_reduce limit active pred build_env state = let env = build_env state in let status = Domain.evaluate_predicate env state pred in let reduced_states = if active then match status with | Alarmset.False -> States.empty | Alarmset.True -> (* Reduce in case [pre] is a disjunction *) split_disjunction_and_reduce ~reduce:false ~limit env state pred | Alarmset.Unknown -> (* Reduce in all cases *) split_disjunction_and_reduce ~reduce:true ~limit env state pred else States.singleton state in status, reduced_states (* Do not display anything for postconditions of leaf functions that receive status valid (very rare) or unknown: this brings no information. However, warn the user if the status is invalid. (unless this is on purpose, using [assert \false]) *) let check_ensures_false kf behavior active pr kind statuses = let source = fst pr.Cil_types.pred_loc in let pp_header = pp_header kf in let pp_behavior_inactive fmt = Format.fprintf fmt ",@ the behavior@ was@ inactive" in if (Alarmset.Status.join_list statuses) = Alarmset.False && (match kind with | Postcondition (PostLeaf | PostUseSpec) -> true | _ -> false) && pr.pred_content <> Pfalse then Value_parameters.warning ~once:true ~source "@[%a:@ this postcondition@ evaluates to@ false@ in this@ context.\ @ If it is valid,@ either@ a precondition@ was not@ verified@ \ for this@ call%t,@ or some assigns/from@ clauses@ are \ incomplete@ (or incorrect).@]%t" pp_header behavior (if active then (fun _ -> ()) else pp_behavior_inactive) Value_util.pp_callstack (* [per_behavior] indicates if we are processing each behavior separately. If this is the case, then [Unknown] and [True] behaviors are treated in the same way. *) let refine_active ~per_behavior behavior status = match status with | Alarmset.True -> Some true | Alarmset.Unknown -> Some (per_behavior || Cil.is_default_behavior behavior) | Alarmset.False -> None (* [eval_and_reduce_p_kind kf b active p_kind ips states build_prop build_env] evaluates the identified predicates [ips] of [kf] in the states [states]. The states are used simultaneously for evaluation and reduction: if one predicate is not valid in one of the states, the status of the predicate is set to [Unknown] or [Invalid]. In this case, the state is simultaneously reduced (when possible). - [p_pkind] indicates the kind of clause being evaluated. - [b] is the behavior to which [ips] belong. - [active] indicates whether [b] is guaranteed to be active, or maybe active. - [build_prop] builds the [Property.t] that corresponds to the pre/post being evaluated. - [build_env] is used to build the environment evaluation, in particular the pre- and post-states. *) let eval_and_reduce kf behavior active kind ips states build_prop build_env = let limit = Value_util.get_slevel kf in let emit = emit_message_and_status kind kf behavior ~active in let aux_pred states pred = let pr = Logic_const.pred_of_id_pred pred in let ip = build_prop pred in if ignore_predicate pr then states else if States.is_empty states then begin emit ~empty:true ip pr Alarmset.True; states end else let (statuses, reduced_states) = States.fold (fun state (acc_status, acc_states) -> let status, reduced_states = eval_split_and_reduce limit active pr build_env state in (status :: acc_status, fst (States.merge ~into:acc_states reduced_states))) states ([], States.empty) in List.iter (fun status -> emit ~empty:false ip pr status) statuses; check_ensures_false kf behavior active pr kind statuses; States.reorder reduced_states in List.fold_left aux_pred states ips (** Check the postcondition of [kf] for the list of [behaviors]. This may result in splitting [post_states] if the postconditions contain disjunctions. *) let check_fct_postconditions_of_behaviors kf behaviors is_active kind ~per_behavior ~pre_state ~post_states ~result = if behaviors = [] then post_states else let build_env s = post_env ~pre:pre_state ~post:s ~result in let k = Postcondition (post_kind kf) in let check_one_behavior states b = match refine_active ~per_behavior b (is_active b) with | None -> states | Some active -> let posts = List.filter (fun (x, _) -> x = kind) b.b_post_cond in let posts = List.map snd posts in let build_prop p = Property.ip_of_ensures kf Kglobal b (kind, p) in eval_and_reduce kf b active k posts states build_prop build_env in List.fold_left check_one_behavior post_states behaviors (** Check the postcondition of [kf] for the list [behaviors] and for the default behavior, treating them separately if [per_behavior] is [true], merging them otherwise. *) let check_fct_postconditions_for_behaviors kf behaviors status ~pre_state ~post_states ~result = let behaviors = if List.exists Cil.is_default_behavior behaviors && behaviors <> [] then behaviors else match Cil.find_default_behavior kf.spec with | None -> behaviors | Some default -> default :: behaviors in let is_active _ = status in let kind = Normal in check_fct_postconditions_of_behaviors kf behaviors is_active kind ~per_behavior:true ~pre_state ~post_states ~result (** Check the postcondition of [kf] for every behavior. The postcondition of the global behavior is applied for each behavior, to help reduce the final state. *) let check_fct_postconditions kf ab kind ~pre_state ~post_states ~result = let behaviors = Annotations.behaviors kf in let is_active = ActiveBehaviors.is_active ab in let states = check_fct_postconditions_of_behaviors kf behaviors is_active kind ~per_behavior:false ~pre_state ~post_states ~result in if States.is_empty states then `Bottom else `Value states let check_fct_preconditions_of_behaviors call_ki kf ~per_behavior behaviors is_active states = if behaviors = [] then states else let build_env pre = pre_env ~pre in let k = Precondition in let check_one_behavior states b = match refine_active ~per_behavior b (is_active b) with | None -> process_inactive_behavior kf call_ki b; states | Some active -> let build_prop assume = Property.ip_of_assumes kf Kglobal b assume in let states = eval_and_reduce kf b active Assumes b.b_assumes states build_prop build_env in let build_prop = ip_from_precondition kf call_ki b in let states = eval_and_reduce kf b active k b.b_requires states build_prop build_env in if States.is_empty states then process_inactive_postconds kf [b]; states in List.fold_left check_one_behavior states behaviors (** Check the precondition of [kf] for a given behavior [b]. This may result in splitting [states] if the precondition contains disjunctions. *) let check_fct_preconditions_for_behaviors call_ki kf behaviors status states = let is_active _ = status in check_fct_preconditions_of_behaviors call_ki kf ~per_behavior:true behaviors is_active states (* Check the precondition of [kf]. This may result in splitting [init_state] into multiple states if the precondition contains disjunctions. *) let check_fct_preconditions call_ki kf ab init_state = let init_states = States.singleton init_state in let behaviors = Annotations.behaviors kf in let is_active = ActiveBehaviors.is_active ab in let states = check_fct_preconditions_of_behaviors call_ki kf ~per_behavior:false behaviors is_active init_states in if States.is_empty states then `Bottom else `Value states let evaluate_assumes_of_behavior state = let pre_env = pre_env ~pre:state in fun behavior -> let assumes = create_conjunction behavior.b_assumes in Domain.evaluate_predicate pre_env state assumes let code_annotation_text ca = match ca.annot_content with | AAssert (_, Assert, _) -> "assertion" | AAssert (_, Check, _) -> "check" | AInvariant _ -> "loop invariant" | APragma _ | AVariant _ | AAssigns _ | AAllocation _ | AStmtSpec _ | AExtended _ -> assert false (* currently not treated by Value *) (* location of the given code annotation. If unknown, use the location of the statement instead. *) let code_annotation_loc ca stmt = match Cil_datatype.Code_annotation.loc ca with | Some loc when not (Cil_datatype.Location.(equal loc unknown)) -> loc | _ -> Cil_datatype.Stmt.loc stmt (* Reduce the given states according to the given code annotations. If [record] is true, update the proof state of the code annotation. DO NOT PASS record=false unless you know what your are doing *) let interp_annot ~limit ~record kf ab stmt code_annot ~initial_state states = let ips = Property.ip_of_code_annot kf stmt code_annot in let source, _ = code_annotation_loc code_annot stmt in let aux_interp ~reduce code_annot behav p = let text = code_annotation_text code_annot in let in_behavior = match behav with | [] -> `True | behavs -> let aux acc b = match ActiveBehaviors.is_active_from_name ab b with | Alarmset.True -> `True | Alarmset.Unknown -> if acc = `True then `True else `Unknown | Alarmset.False -> acc in List.fold_left aux `False behavs in match in_behavior with | `False -> states | `True | `Unknown as in_behavior -> let emit status = let change_status st = List.iter (fun p -> emit_status p st) ips in let message = match status, in_behavior with | Alarmset.Unknown, _ -> change_status Property_status.Dont_know; "unknown" | Alarmset.True, _ -> change_status Property_status.True; "valid" | Alarmset.False, `True -> change_status Property_status.False_if_reachable; "invalid" ^ (if reduce then " (stopping propagation)" else "") | Alarmset.False, `Unknown -> change_status Property_status.False_if_reachable; "invalid" in msg_status status ~once:true ~source "%s%a got status %s." text Description.pp_named p message in let reduce_state here res accstateset = match res, in_behavior with | _, `Unknown -> (* Cannot conclude because behavior might be inactive *) States.add here accstateset | Alarmset.False, `True -> (* Dead/invalid branch *) accstateset | (Alarmset.Unknown | Alarmset.True), `True -> let env = here_env ~pre:initial_state ~here in (* Reduce by p if it is a disjunction, or if it did not evaluate to True *) let reduce = res = Alarmset.Unknown in let reduced_states = split_disjunction_and_reduce ~reduce ~limit env here p in fst (States.merge reduced_states ~into:accstateset) in let reduced_states = States.fold (fun (here: Domain.t) accstateset -> let env = here_env ~pre:initial_state ~here in let res = Domain.evaluate_predicate env here p in (* if [record] holds, emit kernel status and print a message *) if record then emit res; (* if [reduce] holds, reduce the state. *) if reduce then reduce_state here res accstateset else accstateset) states States.empty in (* States resulting from disjunctions are reversed compared to the 'nice' ordering *) if reduce then States.reorder reduced_states else states in let aux code_annot ~reduce behav p = if ignore_predicate p then states else if States.is_empty states then ( if record then begin let text = code_annotation_text code_annot in List.iter (fun p -> emit_status p Property_status.True) ips; msg_status Alarmset.True ~once:true ~source "no state left, %s%a got status valid." text Description.pp_named p; end; states ) else aux_interp ~reduce code_annot behav p in match code_annot.annot_content with | AAssert (behav, Check, p) -> aux ~reduce:false code_annot behav p | AAssert (behav, Assert, p) | AInvariant (behav, true, p) -> aux ~reduce:true code_annot behav p | APragma _ | AInvariant (_, false, _) | AVariant _ | AAssigns _ | AAllocation _ | AExtended _ | AStmtSpec _ (*TODO*) -> states end (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/transfer_logic.mli������������������������������������0000666�0000000�0000000�00000006715�13571573400�021561� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval module ActiveBehaviors : sig type t val is_active: t -> behavior -> Alarmset.status val active_behaviors: t -> behavior list val create: (predicate -> Alarmset.status) -> spec -> t end (* Marks all behaviors of the list as inactive. *) val process_inactive_behaviors: kinstr -> kernel_function -> behavior list -> unit module type S = sig type state type states val create: state -> kernel_function -> ActiveBehaviors.t val create_from_spec: state -> spec -> ActiveBehaviors.t val check_fct_preconditions_for_behaviors: kinstr -> kernel_function -> behavior list -> Alarmset.status -> states -> states val check_fct_preconditions: kinstr -> kernel_function -> ActiveBehaviors.t -> state -> states or_bottom val check_fct_postconditions_for_behaviors: kernel_function -> behavior list -> Alarmset.status -> pre_state:state -> post_states:states -> result:varinfo option -> states val check_fct_postconditions: kernel_function -> ActiveBehaviors.t -> termination_kind -> pre_state:state -> post_states:states -> result:varinfo option -> states or_bottom val evaluate_assumes_of_behavior: state -> behavior -> Alarmset.status val interp_annot: limit:int -> record:bool -> kernel_function -> ActiveBehaviors.t -> stmt -> code_annotation -> initial_state:state -> states -> states end module type LogicDomain = sig type t val top: t val equal: t -> t -> bool val evaluate_predicate: t Abstract_domain.logic_environment -> t -> predicate -> Alarmset.status val reduce_by_predicate: t Abstract_domain.logic_environment -> t -> predicate -> bool -> t or_bottom end module Make (Domain: LogicDomain) (States: Powerset.S with type state = Domain.t) : S with type state = Domain.t and type states = States.t (* Local Variables: compile-command: "make -C ../../../.." End: *) ���������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/transfer_specification.ml�����������������������������0000666�0000000�0000000�00000061643�13571573400�023134� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval (* Applied to the list of behaviors of a function specification, returns the default behavior and the list of non-default behaviors. The incoming list should not be empty (it contains at least the default behavior). *) let extract_default_behavior = let rec extract acc = function | [] -> assert false | behavior :: tail -> if behavior.b_name = Cil.default_behavior_name then behavior, acc @ tail else extract (behavior :: acc) tail in extract [] let find_default_behavior spec = List.find (fun b' -> b'.b_name = Cil.default_behavior_name) spec.spec_behavior let warn_empty_assigns () = Value_util.warning_once_current "Cannot handle empty assigns clause. Assuming assigns \\nothing: \ be aware this is probably incorrect." (* Warn for assigns clauses without \from. *) let warn_empty_from list = let no_from = List.filter (fun (_, from) -> from = FromAny) list in match no_from with | [] -> () | (out, _) :: _ -> let source = fst out.it_content.term_loc in Value_parameters.warning ~source ~once:true "@[no \\from part@ for clause '%a'@]" Printer.pp_assigns (Writes no_from) let treat_assigns = function | WritesAny -> warn_empty_assigns (); [] | Writes list -> warn_empty_from list; List.map (fun a -> Assigns a) list (* Returns the assigns clause to be used during per-behavior processing. The specification states that, if a behavior has no assigns clause, then the assigns clause of the default behavior must be used instead. *) let get_assigns_for_behavior spec b = let assigns = match b.b_assigns with | WritesAny -> (find_default_behavior spec).b_assigns | assigns -> assigns in treat_assigns assigns (* Returns the allocation clause for the behavior [b]. *) let get_allocation_for_behavior spec b = let allocations = match b.b_allocation with | FreeAllocAny -> (find_default_behavior spec).b_allocation | allocation -> allocation in match allocations with | FreeAllocAny -> [] (* TODO: warning. *) | FreeAlloc (free, alloc) -> List.map (fun f -> Frees f) free @ List.map (fun a -> Allocates a) alloc let pp_eval_error fmt e = if e <> Eval_terms.CAlarm then Format.fprintf fmt "@ (%a)" Eval_terms.pretty_logic_evaluation_error e let pp_assign_free_alloc fmt = function | Assigns (term, _) -> Format.fprintf fmt "assigns clause %a" Printer.pp_term term.it_content | Frees term -> Format.fprintf fmt "frees clause %a" Printer.pp_term term.it_content | Allocates term -> Format.fprintf fmt "allocates clause %a" Printer.pp_term term.it_content (* Warns in case the 'assigns \result' clause is missing in a behavior (only if the return is used at the call site). *) let warn_on_missing_result_assigns kinstr kf spec = let return_used = match kinstr with | Kglobal -> true | Kstmt {skind = Instr (Call (lv, _, _, _))} -> lv <> None || Value_util.postconditions_mention_result spec | Kstmt {skind = Instr (Local_init(_,ConsInit(_,_,Constructor),_)) } -> Value_util.postconditions_mention_result spec | Kstmt {skind=Instr(Local_init(_,ConsInit(_,_,Plain_func),_))} -> true | _ -> assert false in let for_result (out, _) = Logic_utils.is_result out.it_content in let assigns_result behavior = match behavior.b_assigns with | WritesAny -> true | Writes l -> List.exists for_result l in if return_used && not (List.for_all assigns_result spec.spec_behavior) then let source = fst (Kernel_function.get_location kf) in Value_parameters.warning ~once:true ~source "@[no 'assigns \\result@ \\from ...'@ clause@ specified for@ function %a@]" Kernel_function.pretty kf let is_assigns = function | Assigns _ -> true | Frees _ | Allocates _ -> false let reduce_to_valid_location out loc = if Locations.(Location_Bits.(equal top loc.loc)) then begin Value_parameters.error ~once:true ~current:true "Cannot@ handle@ %a,@ location@ is@ too@ imprecise@ \ (%a).@ Assuming@ it@ is@ not@ assigned,@ but@ be@ aware@ this\ @ is@ incorrect." pp_assign_free_alloc out Locations.pretty loc; None end else let valid = Locations.(valid_part Write loc) in if Locations.is_bottom_loc valid then begin if is_assigns out && not (Locations.is_bottom_loc loc) then Value_parameters.warning ~current:true ~once:true ~wkey:Value_parameters.wkey_invalid_assigns "@[Completely invalid destination@ for %a.@ \ Ignoring.@]" pp_assign_free_alloc out; None end else Some loc let precise_loc_of_assign env assign_or_allocation = try (* TODO: warn about errors during evaluation. *) let alarm_mode = Eval_terms.Ignore in let loc = match assign_or_allocation with | Assigns (term, _) -> Eval_terms.eval_tlval_as_location ~alarm_mode env term.it_content | Frees term | Allocates term -> let result = Eval_terms.eval_term ~alarm_mode env term.it_content in let loc_bits = Locations.loc_bytes_to_loc_bits result.Eval_terms.eover in Locations.make_loc loc_bits Int_Base.top in reduce_to_valid_location assign_or_allocation loc with Eval_terms.LogicEvalError e -> Value_util.warning_once_current "@[<hov 0>@[<hov 2>cannot interpret %a@]%a;@ effects will be ignored@]" pp_assign_free_alloc assign_or_allocation pp_eval_error e; None module Make (Abstract: Abstractions.S) (States: Powerset.S with type state = Abstract.Dom.t) (Logic : Transfer_logic.S with type state = Abstract.Dom.t and type states = States.t) = struct module Domain = Abstract.Dom module Location = Abstract.Loc (* Most transfer functions about logic return a set of states instead of a single state, and States.empty instead of bottom. We thus use this monad to turn `Bottom into States.empty in the following for consistency. *) let (>>-) state f = match state with | `Bottom -> States.empty | `Value state -> f state (* The precise narrowing of disjunctive sets of states is the disjunction between the narrowing of each combination of states from each sets. The complexity is quadratic. *) let precise_narrow_states_list states_list = let fold = States.fold in let fold2 f set1 set2 acc = fold (fun s1 acc -> fold (fun s2 acc -> f s1 s2 acc) set2 acc) set1 acc in let rec disjunctive_narrow states = function | [] -> states | set :: tail -> let narrow s s' acc = States.add' (Domain.narrow s s') acc in let states = fold2 narrow states set States.empty in disjunctive_narrow states tail in disjunctive_narrow (List.hd states_list) (List.tl states_list) (* Approximate narrowing of disjunctive sets: we narrow the join of each set, and we use this single state to reduce each state of one set, chosen arbitrarily. TODO: it would be useful to have an heuristic to choose the set to be kept. *) let approximate_narrow_states_list states_list = let joined_list = List.map States.join states_list in let narrowed_state = match joined_list with | [] -> assert false | hd :: tl -> List.fold_left (Bottom.narrow Domain.narrow) hd tl in narrowed_state >>- fun narrowed_state -> States.fold (fun state acc -> States.add' (Domain.narrow state narrowed_state) acc) (List.hd states_list) States.empty (* Narrowing of a list of disjunctive sets of states. *) let narrow_states_list = function | [] -> States.empty | [x] -> x | states_list -> if true then approximate_narrow_states_list states_list else precise_narrow_states_list states_list (* Extraction of the precise location and of the cvalue domain: needed to evaluate the location of an assigns clause. *) let get_ploc = match Location.get Main_locations.PLoc.key with | None -> fun _ -> Main_locations.PLoc.top | Some get -> get let set_ploc = Location.set Main_locations.PLoc.key let set_location loc = set_ploc (Main_locations.PLoc.make loc) let make_env state = Eval_terms.env_assigns (Domain.get_cvalue_or_top state) let is_result = function | Assigns (term, _) | Allocates term -> Logic_utils.is_result term.it_content | Frees _ -> false (* Evaluates the location affected by an assigns, allocates or frees clause. Returns None if the clause cannot be interpreted. *) let evaluate_location env retres_loc logic_assign = if is_result logic_assign then retres_loc else let ploc = precise_loc_of_assign env logic_assign in Extlib.opt_map (fun ploc -> set_location ploc Location.top) ploc (* From a list of assigns, allocates or frees clauses, builds a list associating each clause to the location it affects. Removes clauses that cannot be interpreted. *) let evaluate_locations env retres_loc list = let process acc logic_assign = match evaluate_location env retres_loc logic_assign with | None -> acc | Some location -> (logic_assign, location) :: acc in List.rev (List.fold_left process [] list) (* Applies the [assigns] list of assigns, allocates and frees clauses to the state [state]. *) let apply_assigns_and_allocations retres_loc assigns state = let pre = state in let env = make_env state in let assigns_with_locations = evaluate_locations env retres_loc assigns in let transfer state (logic_assign, location) = Domain.logic_assign logic_assign location ~pre state in List.fold_left transfer state assigns_with_locations let treat_statement_assigns assigns state = let assigns = treat_assigns assigns in apply_assigns_and_allocations None assigns state (* After reduction by the postconditions, checks that the locations assigned by assigns clauses are not garbled mixes — and warn otherwise. *) let check_post_assigns kf retres_loc spec behavior ~pre states = let env = make_env pre in let assigns = get_assigns_for_behavior spec behavior in let assigns = evaluate_locations env retres_loc assigns in let check_one_assign cvalue_state (assign, location) = let loc = Precise_locs.imprecise_location (get_ploc location) in let cvalue = Cvalue.Model.find cvalue_state loc in if Cvalue.V.is_imprecise cvalue then begin ignore (Locations.Location_Bytes.track_garbled_mix cvalue); Value_parameters.warning ~current:true ~once:true ~wkey:Value_parameters.wkey_garbled_mix "The specification of function %a has generated a garbled mix \ for assigns clause %a." Kernel_function.pretty kf pp_assign_free_alloc assign end in let check_one_state state = let cvalue_state = Domain.get_cvalue_or_top state in List.iter (check_one_assign cvalue_state) assigns in States.iter check_one_state states (* Computes the effects of a list of [behaviors] as one: apply the assigns and allocations clauses of the first behavior, and reduces the resulting states by the ensures clauses of all [behaviors]. [kf] is the called function, [spec] is its specification, [result] is the \result varinfo it returns, and [status] the status of the behaviors. *) let compute_effects ~warn kf spec result behaviors status states = States.join states >>- fun pre_state -> Locations.Location_Bytes.do_track_garbled_mix false; let behavior = List.hd behaviors in let retres_loc = Extlib.opt_map Location.eval_varinfo result in let assigns = get_assigns_for_behavior spec behavior in let allocs = get_allocation_for_behavior spec behavior in let compute = apply_assigns_and_allocations retres_loc (assigns @ allocs) in let states = States.map compute states in let states = Logic.check_fct_postconditions_for_behaviors kf behaviors status ~result ~pre_state ~post_states:states in (* Warn on garbled mixes created by specifications, except on builtins. *) if warn then check_post_assigns kf retres_loc spec behavior ~pre:pre_state states; Locations.Location_Bytes.do_track_garbled_mix true; states (* Reduces the [states] by the assumes and requires clauses of the [behavior] of function [kf]. Warns about inactive postconditions if [states] are reduced to bottom. *) let reduce_by_preconditions = Logic.check_fct_preconditions_for_behaviors module Behaviors = struct type t = funbehavior let equal b1 b2 = b1.b_name = b2.b_name let hash b = Hashtbl.hash b.b_name end module HashBehaviors = Hashtbl.Make (Behaviors) (* [behaviors] is a list of complete sets of behaviors. This function interprets each complete set of behaviors in [states], and thus returns a list of sets of states (each one being the result of a complete set). [kf] is the related function, [kinstr] the call site, and [result] the \result varinfo returned by the function, if any. All behaviors in [behaviors] must have an Unknown status. False behaviors should have been removed, and true behaviors should be interpreted by [compute_true_behaviors]. *) let compute_complete_behaviors ~warn kinstr kf spec result behaviors states = (* As a behavior may be included in several complete sets, we use a local cache for the interpretation of each behavior. *) let cache = HashBehaviors.create 3 in let compute_behavior behavior = try HashBehaviors.find cache behavior with Not_found -> let s = Alarmset.Unknown in let states = reduce_by_preconditions kinstr kf [behavior] s states in let states = compute_effects ~warn kf spec result [behavior] s states in HashBehaviors.add cache behavior states; states in let compute_complete_set behaviors = List.fold_left (fun acc b -> fst (States.merge (compute_behavior b) ~into:acc)) States.empty behaviors in List.map compute_complete_set behaviors (* Interprets a list of behaviors as if they was merged into a single behavior. Uses all the preconditions and postconditinos at once to reduce the states, and uses the assigns clauses of the first behavior only (ideally, we want the intersection of assigns clauses). *) let compute_true_behaviors ~warn kinstr kf spec result behaviors states = let status = Alarmset.True in let states = reduce_by_preconditions kinstr kf behaviors status states in compute_effects ~warn kf spec result behaviors status states (* Auxiliary function for promote_complete_behaviors. Replaces the status of a behavior in an association list binding behaviors to statuses. *) let rec replace_in_list elt assoc = function | [] -> [] | (key, data) :: tail -> if String.compare key.b_name elt.b_name = 0 then (elt, assoc) :: tail else (key, data) :: replace_in_list elt assoc tail (* If a complete set of behaviors contains only one active behavior (whose assumes clauses are not false), then this behavior is true. If [behaviors] is an association list binding each behavior to the status of its assumes clauses, and [complete_list] is the list of complete sets of behaviors, then [promote_complete_behaviors] removes false behaviors from [complete_list], and binds single active behaviors from complete sets to true in [behaviors]. Returns `Bottom if a all the behaviors of a complete set have a false \assumes clause. *) let promote_complete_behaviors behaviors complete_list = let module E = struct exception Bottom end in let is_not_false b = List.assoc b behaviors <> Alarmset.False in let complete_list = List.map (List.filter is_not_false) complete_list in let promote acc = function (* If a complete set of behaviors is empty here, then it contains only false behaviors, and thus its interpretation is bottom. *) | [] -> raise E.Bottom | [b] -> replace_in_list b Alarmset.True acc | _ -> acc in try `Value (List.fold_left promote behaviors complete_list, complete_list) with E.Bottom -> `Bottom (* Evaluates the \assumes of each behavior, and returns an association list between behaviors and their status. Also removes false behaviors from the list of complete behaviors [complete_behaviors], and promotes complete sets of one behavior as true behaviors. This function also evaluates the \requires clauses of the behaviors that will not be used in the interpretation of the specification: false behaviors, and unknown behaviors that do not belong to any complete set. This ensures that the preconditions of all behaviors will have been evaluated, and that consistent status will have been emitted at the end of the interpretation of the specification. *) let evaluate_preconditions kinstr kf behaviors complete_behaviors states = (* Processes all behaviors as inactive and returns bottom. *) let all_inactive () = Transfer_logic.process_inactive_behaviors kinstr kf behaviors; `Bottom in match States.join states with (* If the preconditions of the default behavior led to bottom, all other behaviors are inactive. *) | `Bottom -> all_inactive () | `Value pre_state -> (* Evaluate all assumes clauses, and compute the association list between behaviors and their status. *) let evaluate = Logic.evaluate_assumes_of_behavior pre_state in let behaviors = List.map (fun b -> b, evaluate b) behaviors in (* Remove false behaviors from complete sets of behaviors, and promotes complete sets of one behavior as true behaviors. *) match promote_complete_behaviors behaviors complete_behaviors with (* If all behaviors of a complete set have false \assumes, all behaviors are inactive. *) | `Bottom -> all_inactive () | `Value (behaviors, complete_behaviors) -> (* Evaluates \requires for false or non-complete unknown behaviors. *) let evaluate_requires (behavior, status) = if status = Alarmset.False then Transfer_logic.process_inactive_behaviors kinstr kf [behavior] else if status = Alarmset.Unknown && not (List.exists (List.mem behavior) complete_behaviors) then ignore (reduce_by_preconditions kinstr kf [behavior] status states) in List.iter evaluate_requires behaviors; `Value (behaviors, complete_behaviors) let warn_allocates kf behaviors = (* TODO: remove the special case 'FC_BUILTIN' when the new warning mechanism will be in place *) List.iter (fun b -> match b.b_allocation with | FreeAllocAny -> () | _ -> let vi = Kernel_function.get_vi kf in if not (Cil.hasAttribute "FC_BUILTIN" vi.vattr) then Value_parameters.warning ~current:true ~once:true "ignoring unsupported \\allocates clause" ) behaviors (* Sound over-approximations of the effects of a function can be computed through its specification in three different ways: – the default behavior is always an over-approximation of the function effects, but can be very imprecise. We use it only if the two other ways are inapplicable (both are strictly more precise). – any behavior whose assumes clause is true in the current state is also a sound approximation of the function effects applied to this state. – the union of any complete set of behaviors is an over-approximation of the function effects. To obtain the highest precision, the states resulting from the interpretation of any true behavior and of any complete set should be intersected. *) let compute_specification ~warn kinstr kf result spec state = if warn then warn_allocates kf spec.spec_behavior; (* The default behavior, and the list of other behaviors. *) let default_bhv, behaviors = extract_default_behavior spec.spec_behavior in let find_behavior name = List.find (fun b -> b.b_name = name) behaviors in (* List of complete sets of behaviors. *) let complete_behaviors = List.map (List.map find_behavior) spec.spec_complete_behaviors in (* Reduction by the preconditions of the default behavior. The resulting state is the pre state for any further computation. *) let states = Logic.check_fct_preconditions_for_behaviors kinstr kf [default_bhv] Alarmset.True (States.singleton state) in evaluate_preconditions kinstr kf behaviors complete_behaviors states >>- fun (behaviors, complete_behaviors) -> (* List of true behaviors other than the default behavior. *) let true_behaviors = Extlib.filter_map (fun (_b, st) -> st = Alarmset.True) fst behaviors in (* Without any true behaviors or complete sets, compute the effects of the default behavior. *) if true_behaviors = [] && spec.spec_complete_behaviors = [] then compute_effects ~warn kf spec result [default_bhv] Alarmset.True states else (* Remove complete sets that contain a true behavior: such behaviors are treated afterwards. *) let is_true b = List.assoc b behaviors = Alarmset.True in let complete_behaviors = List.filter (fun l -> not (List.exists is_true l)) complete_behaviors in (* Interpret each complete set of behaviors. The result is a list of state sets, one for each set. The join of each state set is a sound approximation at the end of the function call. *) let complete_states = compute_complete_behaviors ~warn kinstr kf spec result complete_behaviors states in (* If there is some true behaviors, interpret them and add the resulting state set to the list. All true behaviors have their clauses computed as in the case of a single specification. *) let sound_states = if true_behaviors = [] then complete_states else let true_states = compute_true_behaviors ~warn kinstr kf spec result true_behaviors states in true_states :: complete_states in (* As each state set in this list is a sound approximation, narrow them. *) narrow_states_list sound_states (* Interprets the [call] at [kinstr] in [state], using the specification [spec] of the called function. It first reduces by the preconditions, then evaluates the assigns, and finally reduces by the post-conditions. [warn] is false for the specification of cvalue builtins — in this case, some warnings are disabled, such as warnings about new garbled mixes. *) let compute_using_specification ~warn kinstr call spec state = let vi = Kernel_function.get_vi call.kf in if Cil.hasAttribute "noreturn" vi.vattr then `Bottom else (* Initializes the variable returned by the function. *) let state = match call.return with | None -> state | Some retres_vi -> (* Notify the user about missing assigns \result. *) if warn then warn_on_missing_result_assigns kinstr call.kf spec; let state = Domain.enter_scope call.kf [retres_vi] state in let init_kind = Abstract_domain.Spec_Return call.kf in Domain.initialize_variable_using_type init_kind retres_vi state in let states = compute_specification ~warn kinstr call.kf call.return spec state in if States.is_empty states then `Bottom else `Value (States.to_list states) end ���������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/transfer_specification.mli����������������������������0000666�0000000�0000000�00000004142�13571573400�023274� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval module Make (Abstract: Abstractions.S) (States: Powerset.S with type state = Abstract.Dom.t) (Logic : Transfer_logic.S with type state = Abstract.Dom.t and type states = States.t) : sig val treat_statement_assigns: assigns -> Abstract.Dom.t -> Abstract.Dom.t val compute_using_specification: warn:bool -> kinstr -> (Abstract.Loc.location, Abstract.Val.t) call -> spec -> Abstract.Dom.t -> Abstract.Dom.t list or_bottom end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/transfer_stmt.ml��������������������������������������0000666�0000000�0000000�00000106252�13571573400�021277� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype open Eval module type S = sig type state type value type location val assign: state -> kinstr -> lval -> exp -> state or_bottom val assume: state -> stmt -> exp -> bool -> state or_bottom val call: stmt -> lval option -> exp -> exp list -> state -> state list or_bottom * Value_types.cacheable val check_unspecified_sequence: stmt -> state -> (stmt * lval list * lval list * lval list * stmt ref list) list -> unit or_bottom val enter_scope: kernel_function -> varinfo list -> state -> state type call_result = { states: state list or_bottom; cacheable: Value_types.cacheable; builtin: bool; } val compute_call_ref: (stmt -> (location, value) call -> state -> call_result) ref end (* Reference filled in by the callwise-inout callback *) module InOutCallback = State_builder.Option_ref (Inout_type) (struct let dependencies = [Db.Value.self] let name = "Transfer_stmt.InOutCallback" end) let register_callback () = Db.Operational_inputs.Record_Inout_Callbacks.extend_once (fun (_stack, inout) -> InOutCallback.set inout) let () = Cmdline.run_after_configuring_stage register_callback let current_kf_inout = InOutCallback.get_option (* Should we warn about indeterminate copies in the function [kf] ? *) let warn_indeterminate kf = let params = Value_parameters.WarnCopyIndeterminate.get () in Kernel_function.Set.mem kf params (* An assignment from a right scalar lvalue is interpreted as a copy when indeterminate copies are allowed. Otherwise, such assignments are interpreted through the evaluation of the right lvalue, possibly leading to alarms about non initialization and dangling pointers. *) let do_copy_at = function | Kglobal -> false | Kstmt stmt -> try let kf = Kernel_function.find_englobing_kf stmt in not (warn_indeterminate kf) with Not_found -> assert false (* Warn for arguments that contain uninitialized/escaping if: - kf is a non-special leaf function (TODO: should we keep this?) - the user asked for this *) let is_determinate kf = let name = Kernel_function.get_name kf in warn_indeterminate kf || not (Kernel_function.is_definition kf (* Should we keep this? *) || (name >= "Frama_C" && name < "Frama_D") || Builtins.find_builtin_override kf <> None) (* Used to disambiguate files for Frama_C_dump_each_file directives. *) module DumpFileCounters = State_builder.Hashtbl (Datatype.String.Hashtbl) (Datatype.Int) (struct let size = 3 let dependencies = [ Db.Value.self ] let name = "Transfer_stmt.DumpFileCounters" end) module Make (Abstract: Abstractions.Eva) = struct module Value = Abstract.Val module Location = Abstract.Loc module Domain = Abstract.Dom module Eval = Abstract.Eval type state = Domain.t type value = Value.t type location = Location.location (* Transfer functions. *) module TF = Domain.Transfer (Eval.Valuation) (* When using a product of domains, a product of states may have no concretization (if the domains have inferred incompatible properties) without being bottom (if the inter-reduction between domains are insufficient to prove the incompatibility). In such a state, an evaluation can lead to bottom without any alarm (the evaluation reveals the incompatibility). We report these cases to the user, as they could also reveal a bug in some Eva's abstractions. Note that they should not happen when only one domain is enabled. *) let notify_unreachability fmt = if Domain.log_category = Domain_product.product_category then Value_parameters.feedback ~level:1 ~current:true ~once:true "The evaluation of %(%a%)@ led to bottom without alarms:@ at this point \ the product of states has no possible concretization.@." fmt else Value_parameters.warning ~current:true "The evaluation of %(%a%)@ led to bottom without alarms:@ at this point \ the abstract state has no possible concretization,@ which is probably \ a bug." fmt let report_unreachability state (result, alarms) fmt = if result = `Bottom && Alarmset.is_empty alarms then begin Value_parameters.debug ~current:true ~once:true ~level:1 ~dkey:Value_parameters.dkey_incompatible_states "State without concretization: %a" Domain.pretty state; notify_unreachability fmt end else Format.ifprintf Format.std_formatter fmt (* The three functions below call evaluation functions and notify the user if they lead to bottom without alarms. *) let evaluate_and_check ?valuation state expr = let res = Eval.evaluate ?valuation state expr in report_unreachability state res "the expression %a" Printer.pp_exp expr; res let lvaluate_and_check ~for_writing ?valuation state lval = let res = Eval.lvaluate ~for_writing ?valuation state lval in report_unreachability state res "the lvalue %a" Printer.pp_lval lval; res let copy_lvalue_and_check ?valuation state lval = let res = Eval.copy_lvalue ?valuation state lval in report_unreachability state res "the copy of %a" Printer.pp_lval lval; res (* ------------------------------------------------------------------------ *) (* Assignments *) (* ------------------------------------------------------------------------ *) (* Default assignment: evaluates the right expression. *) let assign_by_eval state valuation expr = evaluate_and_check ~valuation state expr >>=: fun (valuation, value) -> Assign value, valuation (* Assignment by copying the value of a right lvalue. *) let assign_by_copy state valuation lval lloc ltyp = (* This code about garbled mix is specific to the Cvalue domain. Unfortunately, the current API for abstract_domain does not permit distinguishing between an evaluation or a copy. *) Locations.Location_Bytes.do_track_garbled_mix false; let r = copy_lvalue_and_check ~valuation state lval in Locations.Location_Bytes.do_track_garbled_mix true; r >>=: fun (valuation, value) -> Copy ({lval; lloc; ltyp}, value), valuation (* For an initialization, use for_writing:false for the evaluation of the left location, as the written variable could be const. This is only useful for local initializations through function calls, as other initializations are handled by initialization.ml. *) let for_writing kinstr = match kinstr with | Kglobal -> false | Kstmt stmt -> match stmt.skind with | Instr (Local_init _) -> false | _ -> true (* Find a lvalue hidden under identity casts. This function correctly detects bitfields (thanks to [need_cast]) and will never expose the underlying field. *) let rec find_lval expr = match expr.enode with | Lval lv -> Some lv | CastE (typ, e) -> if Eval_typ.need_cast typ (Cil.typeOf e) then None else find_lval e | _ -> None (* Emits an alarm if the left and right locations of a struct or union copy overlap. *) let check_overlap typ (lval, loc) (right_lval, right_loc) = if Cil.isStructOrUnionType typ then let truth = Location.assume_no_overlap ~partial:true loc right_loc in let alarm () = Alarms.Overlap (lval, right_lval) in Eval.interpret_truth ~alarm (loc, right_loc) truth else `Value (loc, right_loc), Alarmset.none (* Checks the compatibility between the left and right locations of a copy. *) let are_compatible loc right_loc = let size1 = Location.size loc and size2 = Location.size right_loc in Int_Base.equal size1 size2 && not (Int_Base.is_top size1) (* Assignment. *) let assign_lv_or_ret ~is_ret state kinstr lval expr = let for_writing = for_writing kinstr in let eval, alarms_loc = lvaluate_and_check ~for_writing state lval in Alarmset.emit kinstr alarms_loc; match eval with | `Bottom -> Kernel.warning ~current:true ~once:true "@[<v>@[all target addresses were invalid. This path is \ assumed to be dead.@]%t@]" Value_util.pp_callstack; `Bottom | `Value (valuation, lloc, ltyp) -> (* Tries to interpret the assignment as a copy for the returned value of a function call, on struct and union types, and when -val-warn-copy-indeterminate is disabled. *) let lval_copy = if is_ret || Cil.isStructOrUnionType ltyp || do_copy_at kinstr then find_lval expr else None in let eval, alarms = match lval_copy with | None -> assert (not is_ret); assign_by_eval state valuation expr | Some right_lval -> (* In case of a copy, checks that the left and right locations are compatible and that they do not overlap. *) lvaluate_and_check ~for_writing:false ~valuation state right_lval >>= fun (valuation, right_loc, right_typ) -> check_overlap ltyp (lval, lloc) (right_lval, right_loc) >>= fun (lloc, right_loc) -> if are_compatible lloc right_loc then assign_by_copy state valuation right_lval right_loc right_typ else assign_by_eval state valuation expr in if is_ret then assert (Alarmset.is_empty alarms); Alarmset.emit kinstr alarms; eval >>- fun (assigned, valuation) -> TF.assign kinstr {lval; ltyp; lloc} expr assigned valuation state let assign = assign_lv_or_ret ~is_ret:false let assign_ret = assign_lv_or_ret ~is_ret:true (* ------------------------------------------------------------------------ *) (* Assumption *) (* ------------------------------------------------------------------------ *) (* Assumption. *) let assume state stmt expr positive = let eval, alarms = Eval.reduce state expr positive in (* TODO: check not comparable. *) Alarmset.emit (Kstmt stmt) alarms; eval >>- fun valuation -> TF.assume stmt expr positive valuation state (* ------------------------------------------------------------------------ *) (* Function Calls *) (* ------------------------------------------------------------------------ *) type call_result = { states: state list or_bottom; cacheable: Value_types.cacheable; builtin: bool; } (* Forward reference to [Eval_funs.compute_call] *) let compute_call_ref : (stmt -> (location, value) call -> Domain.state -> call_result) ref = ref (fun _ -> assert false) (* Returns the result of a call, and a boolean that indicates whether a builtin has been used to interpret the call. *) let process_call stmt call valuation state = Value_util.push_call_stack call.kf (Kstmt stmt); let cleanup () = Value_util.pop_call_stack (); (* Changed by compute_call_ref, called from process_call *) Cil.CurrentLoc.set (Cil_datatype.Stmt.loc stmt); in try let res = (* Process the call according to the domain decision. *) match TF.start_call stmt call valuation state with | `Value state -> Domain.Store.register_initial_state (Value_util.call_stack ()) state; !compute_call_ref stmt call state | `Bottom -> { states = `Bottom; cacheable = Value_types.Cacheable; builtin=false } in cleanup (); res with Db.Value.Aborted as e -> InOutCallback.clear (); cleanup (); raise e (* ------------------- Retro propagation on formals ----------------------- *) let get_precise_location = Location.get Main_locations.PLoc.key (* [is_safe_argument valuation expr] is true iff the expression [expr] could not have been written during the last call. If the Location module includes precise_locs, and if the inout plugins is run callwise, then the function uses the precise_locs of the [valuation] and the results of inout. An argument is safe if its dependencies (the locations on which its value depends) do not intersect with the zones written by the called function. If precise_locs or the callwise inout is not available, a syntactic criterion is used. See {!Backward_formals.safe_argument}. *) let is_safe_argument = let default _ expr = Backward_formals.safe_argument expr in match get_precise_location with | None -> default | Some get -> fun valuation expr -> match InOutCallback.get_option () with | None -> default valuation expr | Some inout -> let find_loc lval = match Eval.Valuation.find_loc valuation lval with | `Top -> Precise_locs.loc_top | `Value record -> get record.loc in let expr_zone = Value_util.zone_of_expr find_loc expr in let written_zone = inout.Inout_type.over_outputs_if_termination in not (Locations.Zone.intersects expr_zone written_zone) (* Removes from the list of arguments of a call the arguments whose concrete or formal argument could have been written during the call, as well as arguments of non arithmetic or non pointer type. *) let filter_safe_arguments valuation call = let written_formals = Backward_formals.written_formals call.kf in let is_safe argument = not (Varinfo.Set.mem argument.formal written_formals) && Cil.isArithmeticOrPointerType argument.formal.vtype && is_safe_argument valuation argument.concrete in List.filter is_safe call.arguments (* At the end of a call, this function gathers the arguments whose value can be reduced at the call site. These are the arguments such that: – the formal has not been written during the call, but its value has been reduced; – no variable of the concrete argument has been written during the call (thus the concrete argument is still equal to the formal). [state] is the state at the return statement of the called function; it is used to evaluate the formals; their values are then compared to the ones at the beginning of the call. The function returns an association list between the argument that can be reduced, and their new (more precise) value. *) let gather_reduced_arguments call valuation state = let safe_arguments = filter_safe_arguments valuation call in let empty = Eval.Valuation.empty in let reduce_one_argument acc argument = acc >>- fun acc -> let pre_value = match argument.avalue with | Assign pre_value -> `Value pre_value | Copy (_lv, pre_value) -> pre_value.v in let lval = Cil.var argument.formal in (* We use copy_lvalue instead of evaluate to get the escaping flag: if a formal is escaping at the end of the called function, it may have been freed, which is not detected as a write. We prevent the backward propagation in that case. If the call has copied the argument, it may be uninitialized. Thus, we also avoid the backward propagation if the formal is uninitialized here. This should not happen in the Assign case above. *) fst (Eval.copy_lvalue ~valuation:empty state lval) >>- fun (_valuation, post_value) -> if Bottom.is_included Value.is_included pre_value post_value.v || post_value.escaping || not post_value.initialized then `Value acc else post_value.v >>-: fun post_value -> (argument, post_value) :: acc in List.fold_left reduce_one_argument (`Value []) safe_arguments (* [reductions] is an association list between expression and value. This function reduces the [state] by assuming [expr = value] for each pair (expr, value) of [reductions]. *) let reduce_arguments reductions state = let valuation = `Value Eval.Valuation.empty in let reduce_one_argument valuation (argument, post_value) = valuation >>- fun valuation -> Eval.assume ~valuation state argument.concrete post_value in List.fold_left reduce_one_argument valuation reductions >>- fun valuation -> TF.update valuation state (* -------------------- Treat the results of a call ----------------------- *) (* Treat the assignment of the return value in the caller: if the function has a non-void type, perform the assignment if there is a lvalue at the callsite, and in all cases, remove the pseudo-variable from scope. *) let treat_return ~kf_callee lv return stmt state = match lv, return with | None, None -> `Value state | None, Some vi_ret -> `Value (Domain.leave_scope kf_callee [vi_ret] state) | Some _, None -> assert false | Some lval, Some vi_ret -> let exp_ret_caller = Value_util.lval_to_exp (Var vi_ret, NoOffset) in assign_ret state (Kstmt stmt) lval exp_ret_caller >>-: fun state -> Domain.leave_scope kf_callee [vi_ret] state (* ---------------------- Make a one function call ------------------------ *) (* The variables leaving scope at the end of a call to [kf]: the formals, and the locals of the body of kf, if any. *) let leaving_vars kf = let locals = try let fundec = Kernel_function.get_definition kf in fundec.sbody.blocals with Kernel_function.No_Definition -> [] in Kernel_function.get_formals kf @ locals (* Do the call to one function. *) let do_one_call valuation stmt lv call state = let kf_callee = call.kf in let pre = state in (* Process the call according to the domain decision. *) let call_result = process_call stmt call valuation state in call_result.cacheable, call_result.states >>- fun result -> let leaving_vars = leaving_vars kf_callee in (* Do not try to reduce concrete arguments if a builtin was used. *) let gather_reduced_arguments = if call_result.builtin then fun _ _ _ -> `Value [] else gather_reduced_arguments in (* Treat each result one by one. *) let process state = (* Gathers the possible reductions on the value of the concrete arguments at the call site, according to the value of the formals at the post state of the called function. *) gather_reduced_arguments call valuation state >>- fun reductions -> (* The formals (and the locals) of the called function leave scope. *) let post = Domain.leave_scope kf_callee leaving_vars state in (* Computes the state after the call, from the post state at the end of the called function, and the pre state at the call site. *) TF.finalize_call stmt call ~pre ~post >>- fun state -> (* Backward propagates the [reductions] on the concrete arguments. *) reduce_arguments reductions state >>- fun state -> treat_return ~kf_callee lv call.return stmt state and process_recursive state = (* When the call is recursive, formals have not been added to the domains. Do not reduce them, and more importantly, do not remove them from the scope. (Because the instance from the initial, non-recursive, call are still present.) *) TF.finalize_call stmt call ~pre ~post:state >>- fun state -> treat_return ~kf_callee lv call.return stmt state in let states = let process = if call.recursive then process_recursive else process in List.fold_left (fun acc return -> Bottom.add_to_list (process return) acc) [] result in InOutCallback.clear (); Bottom.bot_of_list states (* ------------------- Evaluation of the arguments ------------------------ *) (* [evaluate_argument ~determinate valuation state expr] evaluates the call argument [expr] in the state [state] and the valuation [valuation]. Returns the value assigned, and the updated valuation. TODO: share more code with [assign]. *) let evaluate_actual ~determinate valuation state expr = match expr.enode with | Lval lv -> lvaluate_and_check ~for_writing:false ~valuation state lv >>= fun (valuation, loc, typ) -> if Int_Base.is_top (Location.size loc) then Value_parameters.abort ~current:true "Function argument %a has unknown size. Aborting" Printer.pp_exp expr; if determinate && Cil.isArithmeticOrPointerType (Cil.typeOfLval lv) then assign_by_eval state valuation expr else assign_by_copy state valuation lv loc typ | _ -> assign_by_eval state valuation expr (* Evaluates the list of the actual arguments of a call. Returns the list of each argument expression associated to its assigned value, and the valuation resulting of the evaluations. *) let compute_actuals determinate valuation state arguments = let process expr acc = acc >>= fun (args, valuation) -> evaluate_actual ~determinate valuation state expr >>=: fun (assigned, valuation) -> (expr, assigned) :: args, valuation in List.fold_right process arguments (`Value ([], valuation), Alarmset.none) (* ------------------------- Make an Eval.call ---------------------------- *) (* Create an Eval.call *) let create_call kf args = let recursive = Recursion.is_recursive_call kf in let return = Library_functions.get_retres_vi kf in let arguments, rest = if recursive then (* For recursive calls, we evaluate 'assigns \result \from \nothing' using a specification. We generate a dummy [call] object in which formals are not present. This way, domains will not overwrite the formals of the recursive function (which would be present in scope twice). *) [], [] else let formals = Kernel_function.get_formals kf in let rec format_arguments acc args formals = match args, formals with | _, [] -> acc, args | [], _ -> assert false | (concrete, avalue) :: args, formal :: formals -> let argument = { formal ; concrete; avalue } in format_arguments (argument :: acc) args formals in let arguments, rest = format_arguments [] args formals in let arguments = List.rev arguments in arguments, rest in {kf; arguments; rest; return; recursive} let make_call kf arguments valuation state = (* Evaluate the arguments of the call. *) let determinate = is_determinate kf in compute_actuals determinate valuation state arguments >>=: fun (args, valuation) -> let call = create_call kf args in call, valuation (* ----------------- show_each and dump_each directives ------------------- *) (* The product of domains formats the printing of each leaf domains, by checking their log_category and adding their name before the dump. If the domain is not a product, this needs to be done here. *) let print_state = if Domain.log_category = Domain_product.product_category then Domain.pretty else if Value_parameters.is_debug_key_enabled Domain.log_category then fun fmt state -> Format.fprintf fmt "# %s:@ @[<hv>%a@]@ " Domain.name Domain.pretty state else fun _ _ -> () (* Frama_C_dump_each functions. *) let dump_state name state = Value_parameters.result ~current:true "%s:@\n@[<v>%a@]==END OF DUMP==%t" name print_state state Value_util.pp_callstack (* Idem as for [print_state]. *) let show_expr = if Domain.log_category = Domain_product.product_category then TF.show_expr else if Value_parameters.is_debug_key_enabled Domain.log_category then fun valuation state fmt exp -> Format.fprintf fmt "# %s: @[<hov>%a@]" Domain.name (TF.show_expr valuation state) exp else fun _ _ _ _ -> () (* Frama_C_domain_show_each functions. *) let domain_show_each name arguments state = let pretty fmt expr = let pp fmt = match fst (Eval.evaluate state expr) with | `Bottom -> Format.fprintf fmt "%s" (Unicode.bottom_string ()) | `Value (valuation, _value) -> show_expr valuation state fmt expr in Format.fprintf fmt "%a : @[<h>%t@]" Printer.pp_exp expr pp in let pp = Pretty_utils.pp_list ~pre:"@[<v>" ~sep:"@ " ~suf:"@]" pretty in Value_parameters.result ~current:true "@[<v>%s:@ %a@]%t" name pp arguments Value_util.pp_callstack (* For non scalar expressions, prints the offsetmap of the cvalue domain. *) let show_offsm = match Domain.get_cvalue, Location.get Main_locations.PLoc.key with | None, _ | _, None -> fun fmt _ _ -> Format.fprintf fmt "%s" (Unicode.top_string ()) | Some get_cvalue, Some get_ploc -> fun fmt expr state -> match expr.enode with | Lval lval -> begin try let offsm = fst (Eval.lvaluate ~for_writing:false state lval) >>- fun (_, loc, _) -> Eval_op.offsetmap_of_loc (get_ploc loc) (get_cvalue state) in let typ = Cil.typeOf expr in (Bottom.pretty (Eval_op.pretty_offsetmap typ)) fmt offsm with Abstract_interp.Error_Top -> Format.fprintf fmt "%s" (Unicode.top_string ()) end | _ -> assert false (* For scalar expressions, prints the cvalue component of their values. *) let show_value = match Value.get Main_values.CVal.key with | None -> fun fmt _ _ -> Format.fprintf fmt "%s" (Unicode.top_string ()) | Some get_cval -> fun fmt expr state -> let value = fst (Eval.evaluate state expr) >>-: snd >>-: get_cval in (Bottom.pretty Cvalue.V.pretty) fmt value let pretty_arguments state arguments = let pretty fmt expr = if Cil.isArithmeticOrPointerType (Cil.typeOf expr) then show_value fmt expr state else show_offsm fmt expr state in Pretty_utils.pp_list ~pre:"@[<hv>" ~sep:",@ " ~suf:"@]" pretty arguments (* Frama_C_show_each functions. *) let show_each name arguments state = Value_parameters.result ~current:true "@[<hv>%s:@ %a@]%t" name (pretty_arguments state) arguments Value_util.pp_callstack (* Frama_C_dump_each_file functions. *) let dump_state_file_exc name arguments state = let size = String.length name in let name = if size > 23 (* Frama_C_dump_each_file_ + 'something' *) then String.sub name 23 (size - 23) else failwith "no filename specified" in let n = try DumpFileCounters.find name with Not_found -> 0 in DumpFileCounters.add name (n+1); let file = Format.sprintf "%s_%d" name n in let ch = open_out file in let fmt = Format.formatter_of_out_channel ch in let l = fst (Cil.CurrentLoc.get ()) in Value_parameters.feedback ~current:true "Dumping state in file '%s'%t" file Value_util.pp_callstack; Format.fprintf fmt "DUMPING STATE at file %a line %d@." Datatype.Filepath.pretty l.Filepath.pos_path l.Filepath.pos_lnum; if arguments <> [] then Format.fprintf fmt "Args: %a@." (pretty_arguments state) arguments; Format.fprintf fmt "@[<v>%a@]@?" print_state state; close_out ch let dump_state_file name arguments state = try dump_state_file_exc name arguments state with e -> Value_parameters.warning ~current:true ~once:true "Error during, or invalid call to Frama_C_dump_each_file (%s). Ignoring" (Printexc.to_string e) (** Applies the show_each or dump_each directives. *) let apply_special_directives kf arguments state = let name = Kernel_function.get_name kf in if Ast_info.can_be_cea_function name then if Ast_info.is_cea_function name then (show_each name arguments state; true) else if Ast_info.is_cea_domain_function name then (domain_show_each name arguments state; true) else if Ast_info.is_cea_dump_file_function name then (dump_state_file name arguments state; true) else if Ast_info.is_cea_dump_function name then (dump_state name state; true) else false else false (* Legacy callbacks for the cvalue domain, usually called by {Cvalue_transfer.start_call}. *) let apply_cvalue_callback kf ki_call state = let stack_with_call = (kf, ki_call) :: Value_util.call_stack () in let cvalue_state = Domain.get_cvalue_or_top state in Db.Value.Call_Value_Callbacks.apply (cvalue_state, stack_with_call); Db.Value.merge_initial_state (Value_util.call_stack ()) cvalue_state; let result = { Value_types.c_values = [ None, cvalue_state] ; c_clobbered = Base.SetLattice.bottom; c_from = None; c_cacheable = Value_types.Cacheable; } in Db.Value.Call_Type_Value_Callbacks.apply (`Builtin result, cvalue_state, stack_with_call) (* --------------------- Process the call statement ---------------------- *) let call stmt lval_option funcexp args state = let ki_call = Kstmt stmt in let cacheable = ref Value_types.Cacheable in let eval = (* Resolve [funcexp] into the called kernel functions. *) let functions, alarms = Eval.eval_function_exp funcexp ~args state in Alarmset.emit ki_call alarms; functions >>- fun functions -> let current_kf = Value_util.current_kf () in let process_one_function kf valuation = (* The special Frama_C_ functions to print states are handled here. *) if apply_special_directives kf args state then let () = apply_cvalue_callback kf ki_call state in `Value ([state]) else (* Create the call. *) let eval, alarms = make_call kf args valuation state in Alarmset.emit ki_call alarms; eval >>- fun (call, valuation) -> (* Register the call. *) Value_results.add_kf_caller call.kf ~caller:(current_kf, stmt); (* Do the call. *) let c, states = do_one_call valuation stmt lval_option call state in (* If needed, propagate that callers cannot be cached. *) if c = Value_types.NoCacheCallers then cacheable := Value_types.NoCacheCallers; states in (* Process each possible function apart, and append the result list. *) let process acc (kf, valuation) = let res = process_one_function kf valuation in (Bottom.list_of_bot res) @ acc in let states_list = List.fold_left process [] functions in Bottom.bot_of_list states_list in eval, !cacheable (* ------------------------------------------------------------------------ *) (* Unspecified Sequence *) (* ------------------------------------------------------------------------ *) exception EBottom of Alarmset.t let process_truth ~alarm = let build_alarm status = Alarmset.singleton ~status (alarm ()) in function | `Unreachable -> raise (EBottom Alarmset.none) | `False -> raise (EBottom (build_alarm Alarmset.False)) | `Unknown _ -> build_alarm Alarmset.Unknown | `True | `TrueReduced _ -> Alarmset.none let check_non_overlapping state lvs1 lvs2 = let eval_loc (acc, valuation) lval = match fst (Eval.lvaluate ~valuation ~for_writing:false state lval) with | `Bottom -> acc, valuation | `Value (valuation, loc, _) -> (lval, loc) :: acc, valuation in let eval_list valuation lvs = List.fold_left eval_loc ([], valuation) lvs in let list1, valuation = eval_list Eval.Valuation.empty lvs1 in let list2, _ = eval_list valuation lvs2 in let check acc (lval1, loc1) (lval2, loc2) = let truth = Location.assume_no_overlap ~partial:false loc1 loc2 in let alarm () = Alarms.Not_separated (lval1, lval2) in let alarm = process_truth ~alarm truth in Alarmset.combine alarm acc in Extlib.product_fold check Alarmset.none list1 list2 (* Not currently taking advantage of calls information. But see plugin Undefined Order by VP. *) let check_unspecified_sequence stmt state seq = let check_stmt_pair acc statement1 statement2 = let stmt1, _, writes1, _, _ = statement1 in let stmt2, modified2, writes2, reads2, _ = statement2 in if stmt1 == stmt2 then acc else (* Values that cannot be read, as they are modified in the statement (but not by the whole sequence itself) *) let unauthorized_reads = List.filter (fun x -> List.for_all (fun y -> not (LvalStructEq.equal x y)) modified2) writes1 in let alarms1 = check_non_overlapping state unauthorized_reads reads2 in let alarms = if stmt1.sid >= stmt2.sid then alarms1 else let alarms2 = check_non_overlapping state writes1 writes2 in Alarmset.combine alarms1 alarms2 in Alarmset.combine alarms acc in try let alarms = Extlib.product_fold check_stmt_pair Alarmset.none seq seq in Alarmset.emit (Kstmt stmt) alarms; `Value () with EBottom alarms -> Alarmset.emit (Kstmt stmt) alarms; `Bottom (* ------------------------------------------------------------------------ *) (* Enter Scope *) (* ------------------------------------------------------------------------ *) (* Makes the local variables [variables] enter the scope in [state]. Also initializes volatile variable to top. *) let enter_scope kf variables state = let state = Domain.enter_scope kf variables state in let is_volatile varinfo = Cil.typeHasQualifier "volatile" varinfo.vtype in let vars = List.filter is_volatile variables in let initialized = false in let init_value = Abstract_domain.Top in let initialize_volatile state varinfo = let lval = Cil.var varinfo in let location = Location.eval_varinfo varinfo in Domain.initialize_variable lval location ~initialized init_value state in List.fold_left initialize_volatile state vars end (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/engine/transfer_stmt.mli�������������������������������������0000666�0000000�0000000�00000005215�13571573400�021445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval val current_kf_inout: unit -> Inout_type.t option module type S = sig type state type value type location val assign: state -> kinstr -> lval -> exp -> state or_bottom val assume: state -> stmt -> exp -> bool -> state or_bottom val call: stmt -> lval option -> exp -> exp list -> state -> state list or_bottom * Value_types.cacheable val check_unspecified_sequence: Cil_types.stmt -> state -> (* TODO *) (stmt * lval list * lval list * lval list * stmt ref list) list -> unit or_bottom val enter_scope: kernel_function -> varinfo list -> state -> state type call_result = { states: state list or_bottom; cacheable: Value_types.cacheable; builtin: bool; } val compute_call_ref: (stmt -> (location, value) call -> state -> call_result) ref end module Make (Abstract: Abstractions.Eva) : S with type state = Abstract.Dom.t and type value = Abstract.Val.t and type location = Abstract.Loc.location (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/eval.ml������������������������������������������������������0000666�0000000�0000000�00000022351�13571573400�016063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** *) (* -------------------------------------------------------------------------- *) (** {2 Lattice structure } *) (* -------------------------------------------------------------------------- *) include Bottom.Type type 'a or_top = [ `Value of 'a | `Top ] type 'a or_top_or_bottom = [ `Value of 'a | `Top | `Bottom ] (* -------------------------------------------------------------------------- *) (** {2 Types for the evaluations } *) (* -------------------------------------------------------------------------- *) (* Forward evaluation. *) type 't with_alarms = 't * Alarmset.t type 't evaluated = 't or_bottom with_alarms (* This monad propagates the `Bottom value if needed and join the potential alarms returned during the evaluation. *) let (>>=) (t, a) f = match t with | `Bottom -> `Bottom, a | `Value t -> let t', a' = f t in t', Alarmset.combine a a' (* Use this monad if the following function returns a simple value. *) let (>>=:) (t, a) f = match t with | `Bottom -> `Bottom, a | `Value t -> let t' = f t in `Value t', a (* Use this monad if the following function returns no alarms. *) let (>>=.) (t, a) f = match t with | `Bottom -> `Bottom, a | `Value t -> let t' = f t in t', a (* Backward evaluation. *) type 'a reduced = [ `Bottom | `Unreduced | `Value of 'a ] (* -------------------------------------------------------------------------- *) (** {2 Cache for the evaluations } *) (* -------------------------------------------------------------------------- *) (* State of the reduction of an abstract value. *) type reductness = | Unreduced (* No reduction. *) | Reduced (* A reduction has been performed for this expression. *) | Created (* The abstract value has been created. *) | Dull (* Reduction is pointless for this expression. *) (* Right values with 'undefined' and 'escaping addresses' flags. *) type 'a flagged_value = { v: 'a or_bottom; initialized: bool; escaping: bool; } module Flagged_Value = struct let bottom = {v = `Bottom; initialized=true; escaping=false; } let equal equal v1 v2 = Bottom.equal equal v1.v v2.v && v1.initialized = v2.initialized && v1.escaping = v2.escaping let join join v1 v2 = { v = Bottom.join join v1.v v2.v; initialized = v1.initialized && v2.initialized; escaping = v1.escaping || v2.escaping } let pretty_flags fmt value = match value.initialized, value.escaping with | false, true -> Format.pp_print_string fmt "UNINITIALIZED or ESCAPINGADDR" | false, false -> Format.pp_print_string fmt "UNINITIALIZED" | true, true -> Format.pp_print_string fmt "ESCAPINGADDR" | true, false -> Format.pp_print_string fmt "BOTTOM" let pretty pp fmt value = match value.v with | `Bottom -> pretty_flags fmt value | `Value v -> if value.initialized && not value.escaping then pp fmt v else Format.fprintf fmt "%a or %a" pp v pretty_flags value end (* Data record associated to each evaluated expression. *) type ('a, 'origin) record_val = { value : 'a flagged_value; (* The resulting abstract value *) origin: 'origin option; (* The origin of the abstract value *) reductness : reductness; (* The state of reduction. *) val_alarms : Alarmset.t (* The emitted alarms during the evaluation. *) } (* Data record associated to each evaluated left-value. *) type 'a record_loc = { loc: 'a; (* The location of the left-value. *) typ: typ; (* *) loc_alarms: Alarmset.t (* The emitted alarms during the evaluation. *) } (* Results of an evaluation: the results of all intermediate calculation (the value of each expression and the location of each lvalue) are cached in a map. *) module type Valuation = sig type t type value (* Abstract value. *) type origin (* Origin of values. *) type loc (* Abstract memory location. *) val empty : t val find : t -> exp -> (value, origin) record_val or_top val add : t -> exp -> (value, origin) record_val -> t val fold : (exp -> (value, origin) record_val -> 'a -> 'a) -> t -> 'a -> 'a val find_loc : t -> lval -> loc record_loc or_top val remove : t -> exp -> t val remove_loc : t -> lval -> t end (* Returns the list of the subexpressions of [expr] that contain [subexpr], without [subexpr] itself. *) let compute_englobing_subexpr ~subexpr ~expr = let merge = Extlib.merge_opt (fun _ -> (@)) () in (* Returns [Some] of the list of subexpressions of [expr] that contain [subexpr], apart from [expr] and [subexpr] themselves, or [None] if [subexpr] does not appear in [expr]. *) let rec compute expr = if Cil_datatype.ExpStructEq.equal expr subexpr then Some [] else let sublist = match expr.enode with | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> compute e | BinOp (_, e1, e2, _) -> merge (compute e1) (compute e2) | Lval (host, offset) -> merge (compute_host host) (compute_offset offset) | _ -> None in Extlib.opt_map (fun l -> expr :: l) sublist and compute_host = function | Var _ -> None | Mem e -> compute e and compute_offset offset = match offset with | NoOffset -> None | Field (_, offset) -> compute_offset offset | Index (index, offset) -> merge (compute index) (compute_offset offset) in Extlib.opt_conv [] (compute expr) module Englobing = Datatype.Pair_with_collections (Cil_datatype.ExpStructEq) (Cil_datatype.ExpStructEq) (struct let module_name = "Subexpressions" end) module SubExprs = Datatype.List (Cil_datatype.Exp) module EnglobingSubexpr = State_builder.Hashtbl (Englobing.Hashtbl) (SubExprs) (struct let name = "Value.Eval.Englobing_subexpressions" let size = 32 let dependencies = [ Ast.self ] end) let compute_englobing_subexpr ~subexpr ~expr= EnglobingSubexpr.memo (fun (expr, subexpr) -> compute_englobing_subexpr ~subexpr ~expr) (expr, subexpr) module Clear_Valuation (Valuation : Valuation) = struct let clear_englobing_exprs valuation ~expr ~subexpr = let englobing = compute_englobing_subexpr ~subexpr ~expr in let remove valuation expr = let valuation = Valuation.remove valuation expr in match expr.enode with | Lval lval -> Valuation.remove_loc valuation lval | _ -> valuation in List.fold_left remove valuation englobing end (* -------------------------------------------------------------------------- *) (** {2 Types of assignments } *) (* -------------------------------------------------------------------------- *) type 'loc left_value = { lval: lval; lloc: 'loc; ltyp: typ; } (* Assigned values. *) type ('loc, 'value) assigned = | Assign of 'value | Copy of 'loc left_value * 'value flagged_value let value_assigned = function | Assign v -> `Value v | Copy (_, copied) -> copied.v type logic_assign = | Assigns of from | Allocates of identified_term | Frees of identified_term (* -------------------------------------------------------------------------- *) (** {2 Interprocedural Analysis } *) (* -------------------------------------------------------------------------- *) type ('loc, 'value) argument = { formal: varinfo; concrete: exp; avalue: ('loc, 'value) assigned; } type ('loc, 'value) call = { kf: kernel_function; arguments: ('loc, 'value) argument list; rest: (exp * ('loc, 'value) assigned) list; return: varinfo option; recursive: bool; } (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/eval.mli�����������������������������������������������������0000666�0000000�0000000�00000022640�13571573400�016235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Types and functions related to evaluations. Heavily used by abstract values and domains, evaluation of expressions, transfer functions of instructions and the dataflow analysis. *) (* -------------------------------------------------------------------------- *) (** {2 Lattice structure } *) (* -------------------------------------------------------------------------- *) include module type of Bottom.Type (** For some functions, the special value top (denoting no information) is managed separately. *) type 'a or_top = [ `Value of 'a | `Top ] type 'a or_top_or_bottom = [ `Value of 'a | `Top | `Bottom ] (* -------------------------------------------------------------------------- *) (** {2 Types for the evaluations } *) (* -------------------------------------------------------------------------- *) (** A type and a set of alarms. *) type 't with_alarms = 't * Alarmset.t (** Most forward evaluation functions return the set of alarms resulting from the operations, and a result which can be `Bottom, if the evaluation fails, or the expected value. *) type 't evaluated = 't or_bottom with_alarms (** This monad propagates the `Bottom value if needed, and join the alarms of each evaluation. *) val (>>=) : 'a evaluated -> ('a -> 'b evaluated) -> 'b evaluated (** Use this monad of the following function returns no alarms. *) val (>>=.) : 'a evaluated -> ('a -> 'b or_bottom) -> 'b evaluated (** Use this monad if the following function returns a simple value. *) val (>>=:) : 'a evaluated -> ('a -> 'b) -> 'b evaluated (** Most backward evaluation function returns `Bottom if the reduction leads to an invalid state, `Unreduced if no reduction can be performed, or the reduced value. *) type 'a reduced = [ `Bottom | `Unreduced | `Value of 'a ] (* -------------------------------------------------------------------------- *) (** {2 Cache for the evaluations } *) (* -------------------------------------------------------------------------- *) (** The evaluation of an expression stores in a cache the result of all intermediate computation. This cache is the outcome of the evaluation, and is used by abstract domains for transfer functions. It contains - the abstract value of each sub-expression, as well as its origin (see below), its reduction (see below), and the alarms produced by its evaluation. - the abstract location of each lvalue of the expression, as well as its type, and the alarms produced by its dereference. The evaluation queries the abstract domain the value of some sub-expressions. The origin of an abstract value is then provided by the abstract domain, and kept in the cache. The origin is None if the value has been internally computed without calling the domain. Also, a value provided by the domain may be reduced by the internal computation of the forward and backward evaluation. Such a reduction is tracked by the evaluator and reported to the domain, in the cache. States of reduction are: - Unreduced: the value provided by the domain could not be reduced; - Reduced: the value provided by the domain has been reduced; - Created: the domain has returned `Top for the given expression; - Dull: the domain was not queried for the given expression. *) (** State of reduction of an abstract value. *) type reductness = | Unreduced (** No reduction. *) | Reduced (** A reduction has been performed for this expression. *) | Created (** The abstract value has been created. *) | Dull (** Reduction is pointless for this expression. *) (** Right values with 'undefined' and 'escaping addresses' flags. *) (* TODO: find a better name. *) type 'a flagged_value = { v: 'a or_bottom; initialized: bool; escaping: bool; } module Flagged_Value : sig val bottom: 'a flagged_value val equal: ('a -> 'a -> bool) -> 'a flagged_value -> 'a flagged_value -> bool val join: ('a -> 'a -> 'a) -> 'a flagged_value -> 'a flagged_value -> 'a flagged_value val pretty: (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a flagged_value -> unit end (** Data record associated to each evaluated expression. *) type ('a, 'origin) record_val = { value: 'a flagged_value; (** The resulting abstract value *) origin: 'origin option; (** The origin of the abstract value *) reductness : reductness; (** The state of reduction. *) val_alarms : Alarmset.t (** The emitted alarms during the evaluation. *) } (** Data record associated to each evaluated left-value. *) type 'a record_loc = { loc: 'a; (** The location of the left-value. *) typ: typ; (** *) loc_alarms: Alarmset.t (** The emitted alarms during the evaluation. *) } (** Results of an evaluation: the results of all intermediate calculation (the value of each expression and the location of each lvalue) are cached in a map. *) module type Valuation = sig type t type value (** Abstract value. *) type origin (** Origin of values. *) type loc (** Abstract memory location. *) val empty : t val find : t -> exp -> (value, origin) record_val or_top val add : t -> exp -> (value, origin) record_val -> t val fold : (exp -> (value, origin) record_val -> 'a -> 'a) -> t -> 'a -> 'a val find_loc : t -> lval -> loc record_loc or_top val remove : t -> exp -> t val remove_loc : t -> lval -> t end module Clear_Valuation (Valuation: Valuation) : sig (** Removes from the valuation all the subexpressions of [expr] that contain [subexpr], except [subexpr] itself. *) val clear_englobing_exprs : Valuation.t -> expr:exp -> subexpr:exp -> Valuation.t end (* -------------------------------------------------------------------------- *) (** {2 Types of assignments } *) (* -------------------------------------------------------------------------- *) (** Lvalue with its location and type. *) type 'loc left_value = { lval: lval; lloc: 'loc; ltyp: typ; } (** Assigned values. *) type ('loc, 'value) assigned = | Assign of 'value (** Default assignment of a value. *) | Copy of 'loc left_value * 'value flagged_value (** Copy of the location of a lvalue, that contains the given flagged value. The value is copied exactly, with possible indeterminateness. *) (* Extract the assigned value from a [value assigned]. *) val value_assigned : ('loc, 'value) assigned -> 'value or_bottom type logic_assign = | Assigns of from | Allocates of identified_term | Frees of identified_term (* -------------------------------------------------------------------------- *) (** {2 Interprocedural Analysis } *) (* -------------------------------------------------------------------------- *) (** Argument of a function call. *) type ('loc, 'value) argument = { formal: varinfo; (** The formal argument of the called function. *) concrete: exp; (** The concrete argument at the call site *) avalue: ('loc, 'value) assigned; (** The value of the concrete argument. *) } (** A function call. *) type ('loc, 'value) call = { kf: kernel_function; (** The called function. *) arguments: ('loc, 'value) argument list; (** The arguments of the call. *) rest: (exp * ('loc, 'value) assigned) list; (** Extra-arguments. *) return: varinfo option; (** Fake varinfo to store the return value of the call. Same varinfo for every call to a given function. *) recursive: bool; } (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/���������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016545� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_callstacks_filters.ml��������������������������0000666�0000000�0000000�00000013254�13571573400�023624� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type rcallstack = Value_types.callstack let empty = [] let from_callstack = List.rev let callstack_matches_callstack (rcs1:rcallstack) (rcs2:rcallstack) = let rec aux q1 q2 = match q1, q2 with | [], _ | _, [] -> true | call1 :: q1, call2 :: q2 -> Value_types.Callsite.equal call1 call2 && aux q1 q2 in aux rcs1 rcs2 type filter = rcallstack list option let callsite_matches_callstack stmt (rcs: rcallstack) = let ki = Kstmt stmt in List.exists (fun (_, ki') -> Cil_datatype.Kinstr.equal ki ki') rcs let callstack_matches csf rcs = match csf with | None -> true | Some lrcs -> List.exists (callstack_matches_callstack rcs) lrcs let callsite_matches csf stmt = match csf with | None -> true | Some lrcs -> List.exists (callsite_matches_callstack stmt) lrcs let focus = ref None let focused_callstacks () = !focus let focus_on_callstacks cs = focus := cs let has_matching_callstack ~after csf stmt = let module Results = (val Analysis.current_analyzer ()) in match Results.get_stmt_state_by_callstack ~after stmt with | `Top -> true | `Bottom -> false | `Value h -> try Value_types.Callstack.Hashtbl.iter (fun cs' _state -> let rcs' = from_callstack cs' in if callstack_matches csf rcs' then raise Exit ) h; false with | Exit -> true let is_reachable_stmt csf stmt = has_matching_callstack ~after:false csf stmt (* Called only when the statement is reachable *) let is_non_terminating_instr csf stmt = match stmt.skind with | Instr _ -> not (has_matching_callstack ~after:true csf stmt) | _ -> false (* The two functions below depends on the abstractions used in the Eva analysis, but must be registered only once through the Dynamic module. We thus use references to the function, that are changed by the Make functor. *) let lval_to_zone_callstacks_ref = ref (fun _ _ _ -> Locations.Zone.top) let tlval_to_zone_callstacks_ref = ref (fun _ _ _ -> Locations.Zone.top) exception Top let register_to_zone_functions (module Eval: Gui_eval.S) = (* This function evaluates [v] using [ev] at [stmt] (in the pre-state), but only for the callstacks matching [csf]. *) let eval_filter csf stmt ev v = match Eval.Analysis.get_stmt_state_by_callstack ~after:false stmt with | `Value h -> Value_types.Callstack.Hashtbl.fold (fun cs state acc -> let rcs' = from_callstack cs in if callstack_matches csf rcs' then let env = ev.Eval.env state cs in let r, _, _ = ev.Eval.eval_and_warn env v in ev.Eval.join acc r else acc ) h ev.Eval.bottom | `Bottom -> ev.Eval.bottom | `Top -> raise Top in let lval_to_zone_callstacks csf stmt lv = try eval_filter csf stmt Eval.lval_zone_ev lv with Top -> Locations.Zone.top and tlval_to_zone_callstacks csf stmt tlv = try let kf = Kernel_function.find_englobing_kf stmt in let ev = Eval.tlval_zone_ev (Gui_types.GL_Stmt (kf, stmt)) in eval_filter csf stmt ev tlv with Top -> Locations.Zone.top in lval_to_zone_callstacks_ref := lval_to_zone_callstacks; tlval_to_zone_callstacks_ref := tlval_to_zone_callstacks (* Register evaluation functions that depend on the currently focused callstacks. *) let () = let open Cil_datatype in let lval_to_zone_gui stmt lv = let filter = focused_callstacks () in !lval_to_zone_callstacks_ref filter stmt lv in let tlval_to_zone_gui stmt tlv = let filter = focused_callstacks () in !tlval_to_zone_callstacks_ref filter stmt tlv in let _eval_lv = Dynamic.register ~comment:"Evaluation of a l-value on the callstacks focused in the GUI" ~plugin:"Value" "lval_to_zone_gui" (Datatype.func2 Stmt.ty Lval.ty Locations.Zone.ty) ~journalize:false lval_to_zone_gui in let _eval_tlv = Dynamic.register ~comment:"Evaluation of a term, supposed to be a location, on the callstacks focused in the GUI" ~plugin:"Value" "tlval_to_zone_gui" (Datatype.func2 Stmt.ty Term.ty Locations.Zone.ty) ~journalize:false tlval_to_zone_gui in () ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_callstacks_filters.mli�������������������������0000666�0000000�0000000�00000005202�13571573400�023767� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Filtering on analysis callstacks *) (** List.rev on a callstack, enforced by strong typing outside of this module *) type rcallstack val empty: rcallstack val from_callstack: Value_types.callstack -> rcallstack (** Filters on callstacks. [None] means that all callstacks are active *) type filter = rcallstack list option val callstack_matches: filter -> rcallstack -> bool val callsite_matches: filter -> Cil_types.stmt -> bool (* Callstacks currently being focused. *) val focused_callstacks: unit -> filter (* Focuses on the given callstacks. *) val focus_on_callstacks: filter -> unit val is_reachable_stmt: filter -> Cil_types.stmt -> bool val is_non_terminating_instr: filter -> Cil_types.stmt -> bool (* This function must be called each time a new Gui_eval.S is built over the abstractions used for an Eva analysis. It registers the two functions [lval_to_zone_gui] and [tlval_to_zone_gui], that depend on the abstractions used by the analysis and on the focused callstacks. *) val register_to_zone_functions : (module Gui_eval.S) -> unit ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_callstacks_manager.ml��������������������������0000666�0000000�0000000�00000125765�13571573400�023601� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Gui_types type main_ui = Design.main_window_extension_points type 'v data_by_callstack = (gui_callstack * 'v Gui_eval.gui_selection_data) list type 'v display_data_by_callstack = gui_loc -> gui_selection -> 'v data_by_callstack -> unit module type Input = sig include Gui_types.S val make_data_for_lvalue : Cil_types.lval -> gui_loc -> value data_by_callstack end let rec list_assoc f e = function | [] -> raise Not_found | (e', v) :: q -> if f e e' then v else list_assoc f e q let rec list_mem f e = function | [] -> false | e' :: q -> f e e' || list_mem f e q let rec list_remove f e = function | [] -> [] | e' :: q -> if f e e' then list_remove f e q else e' :: list_remove f e q let rec list_mem_assoc f e = function | [] -> false | (e', _) :: q -> f e e' || list_mem_assoc f e q (* Selection of a row; [RSelectedCallstackCol] corresponds to the fact that both the row _and_ the 'Callstacks' column are selected. *) type row_selected = RUnselected | RSelected | RSelectedCallstackCol (* Information shown in a single row *) type 'value row = { callstack: gui_callstack; rev_callstack: Gui_callstacks_filters.rcallstack (* cache *); mutable exprs: (gui_selection * 'value Gui_eval.gui_selection_data) list (* if a column exists in the view, it expects to find some data for itself in each row here. *); mutable selected: row_selected; } let row_unfocused () = { callstack = GC_Filtered; rev_callstack = Gui_callstacks_filters.empty; exprs = []; selected = RUnselected; } type 'value rows = 'value row GCallstackMap.t let find_data row expr = try list_assoc gui_selection_equal expr row.exprs with Not_found -> (* should happen only for the "results hidden" special row, and in case of an evaluation error *) Gui_eval.gui_selection_data_empty let (!!) = Lazy.force let add_expr_to_row row expr data = if not (list_mem_assoc gui_selection_equal expr row.exprs) then row.exprs <- (expr, data) :: row.exprs let add_data_to_rows rows callstack expr data = try let cur_row = GCallstackMap.find callstack rows in add_expr_to_row cur_row expr data; rows with Not_found -> let row = { callstack; exprs = []; selected = RUnselected; rev_callstack = (match callstack with | GC_Consolidated | GC_Filtered -> Gui_callstacks_filters.empty | GC_Single s | GC_Callstack s -> Gui_callstacks_filters.from_callstack s); } in add_expr_to_row row expr data; GCallstackMap.add callstack row rows type 'value filter_column = | FilterAlarm of bool | FilterRed of bool | FilterBefore of 'value gui_res | FilterAfter of 'value gui_after type 'value filter = gui_selection * bool * 'value filter_column let rec remove_filter e : 'v filter list -> _ = function | [] -> [] | (e', _, _ as hd) :: q as l -> let q' = remove_filter e q in if gui_selection_equal e e' then q' else if q == q' then l else hd :: q' module GColumn = struct type t = GTree.view_column let hash c = c#misc#get_oid let equal c1 c2 = (c1#misc#get_oid = c2#misc#get_oid) end (* Hash tables indexed by GTree columns *) module HColumns = FCHashtbl.Make(GColumn) (* Description of the columns of the widget. The [gui_selection] information refers to what the column is displaying *) type column_type = | CCallstack | CBefore of gui_selection | CAfter of gui_selection | CAlarm of gui_selection | CRed of gui_selection | CEmpty (* empty column at the end, for aesthetic purposes *) let equal_column_type ct1 ct2 = match ct1, ct2 with | CCallstack, CCallstack | CEmpty, CEmpty -> true | CBefore e1, CBefore e2 | CAfter e1, CAfter e2 | CAlarm e1, CAlarm e2 | CRed e1, CRed e2 -> gui_selection_equal e1 e2 | (CCallstack | CBefore _ | CAfter _ | CAlarm _ | CRed _ | CEmpty), _ -> false (* This is an hybrid between the model and the view. *) type 'value model = { mutable loc: gui_loc option (* model: loc which is being visualized *); mutable all_exprs: gui_selection list (* G expressions that are currently being displayed *); mutable columns_type: (column_type * (filtered:bool -> unit)) HColumns.t (* mapping from GTK columns to the data they display, plus a function whose argument indicates whether the column is filtered *); mutable rows: 'value rows (* model: rows to display. Sorted, unfiltered (the view does the filtering *); mutable row_selected: (int * 'value row) option (* view: row currently selected *); mutable focused_rev_callstacks: Gui_callstacks_filters.filter (* reverse of the callstacks currently being focused. On all tabs, the focused callstacks are the only ones that are shown. On the 'Selection' tab, they are also used to refine the states that are being shown, as well as 'go to callers', etc. *); mutable filters: 'value filter list; mutable full_callstacks_height: bool (* Set to 'true' to expand rows so that the entire callstacks are shown *); mutable show_consolidated: bool (* show results in consolidated state *); mutable show_by_callstacks: bool (* show results by callstacks *); mutable hidden_columns: column_type list (* columns hidden by the user *); } (* Is there a filter on the column? *) let column_has_filter model col_type = match col_type with | CEmpty -> false | CCallstack -> model.focused_rev_callstacks <> None | CBefore e | CAfter e | CAlarm e | CRed e -> let has (e', _, f) = gui_selection_equal e e' && (match f, col_type with | FilterBefore _, CBefore _ | FilterAfter _, CAfter _ | FilterAlarm _, CAlarm _ | FilterRed _, CRed _ -> true | _ -> false) in List.exists has model.filters class type ['value] cm_panel = object method model: 'value model method start_session: gui_loc -> multiple:bool -> unit (* clear the model, except in "multiple" view, in which case multiple localizable on the same location are stacked *) method add_data: gui_selection -> gui_callstack -> 'value Gui_eval.gui_selection_data -> unit method render_session: unit -> unit (* display the current model, taking current filter settings into account *) method clear: unit -> unit (* reset both model and widget *) method expand_row_for_callstacks: bool -> unit method show_consolidated: bool -> unit method show_by_callstacks: bool -> unit (* These three methods are called by the 'Values' panel when the corresponding checkboxes are set or unset *) method clone: 'value model -> unit end (* Fetch the internal (hidden) GtkButton of the column header. *) let get_column_header_button (col: GTree.view_column) = let rec get_button = function | None -> None | Some w -> if w#misc#get_type = "GtkButton" then let but_props = GtkButtonProps.Button.cast w#as_widget in Some (new GButton.button but_props) else get_button w#misc#parent in get_button col#widget let show_icon (icon: GMisc.image) = fun ~filtered -> match filtered with | true -> icon#misc#show () | false -> icon#misc#hide () module Make (Input: Input) = struct type value = Input.value let pretty_filter_column fmt = function | FilterRed b -> Format.fprintf fmt "%s" (if b then "red" else " ") | FilterAlarm b -> Format.fprintf fmt "%s" (if b then "!" else " ") | FilterBefore r -> Format.fprintf fmt "%a" Input.pretty_gui_res r | FilterAfter r -> Format.fprintf fmt "%a" Input.pretty_gui_after r let data_matches_filter data pos col = let ok = match col with | FilterRed r -> data.Gui_eval.red = r | FilterAlarm a -> data.Gui_eval.alarm = a | FilterBefore r -> Input.equal_gui_res r data.Gui_eval.before | FilterAfter r -> Input.equal_gui_after r data.Gui_eval.after in if pos then ok else not ok let row_matches_filter row (expr, pos, col: value filter) = try let data = list_assoc gui_selection_equal expr row.exprs in data_matches_filter data pos col with Not_found -> (* should not happen *) false let filters_match row filters = List.for_all (row_matches_filter row) filters module Data = Indexer.Make( struct type t = int * value row let compare (x,_) (y,_) = Transitioning.Stdlib.compare x y end) (* This function creates a single GTree that displays per-callstack results *) let make_panel (main_ui:main_ui) ~callback_focus_callstack ~show_consolidated ~show_by_callstacks ~full_callstacks_height = let gtk_model = object(self) val mutable m = Data.empty val mutable age = 0 method data = m method size = Data.size m method index i = Data.index i m method get i = Data.get i m method add i = age<-age+1; m <- Data.add (age,i) m;age,i method reload = age<-0; m <- Data.empty method coerce = (self:> (int * value row) Wtable.listmodel) end in let frame = GBin.frame ~shadow_type:`ETCHED_OUT () in let w = new Wtable.list ~packing:frame#add ~headers:true ~rules:true gtk_model#coerce in w#view#set_fixed_height_mode false; let model = { loc = None; rows = GCallstackMap.empty; row_selected = None; focused_rev_callstacks = None; filters = []; full_callstacks_height; all_exprs = []; columns_type = HColumns.create 8; show_by_callstacks; show_consolidated; hidden_columns = []; } in let row_is_visible row = match row.callstack, model.show_consolidated, model.show_by_callstacks, model.focused_rev_callstacks with | GC_Consolidated, false, _, _ | GC_Callstack _, _, false, _ | GC_Single _, false, false, _ | GC_Consolidated, _, _, Some _ -> false | (GC_Single _ | GC_Callstack _), _, _, (Some _ as cs') -> Gui_callstacks_filters.callstack_matches cs' row.rev_callstack && filters_match row model.filters | _ -> filters_match row model.filters in (* Context menu to hide and show columns *) let filter_menu (menu: GMenu.menu Lazy.t) = let process column (col_type, _icon) = try let txt = match col_type with | CBefore e -> Format.asprintf "'%a' (before)" pretty_gui_selection e | CAfter e -> Format.asprintf "'%a' (after)" pretty_gui_selection e | CAlarm e -> Format.asprintf "'%a' (alarms)" pretty_gui_selection e | CRed e -> Format.asprintf "'%a' (red)" pretty_gui_selection e | CCallstack | CEmpty -> raise Not_found in if column#visible || list_mem equal_column_type col_type model.hidden_columns then let show = GMenu.check_menu_item ~label:txt () in show#set_active column#visible; (* Hide this column. Keep it alive for filters and co. *) let callback_show_hide () = if column#visible then begin model.hidden_columns <- col_type :: model.hidden_columns; column#set_visible false end else begin model.hidden_columns <- list_remove equal_column_type col_type model.hidden_columns; column#set_visible true end; in ignore (show#connect#activate callback_show_hide); (!!menu)#add (show :> GMenu.menu_item); with Not_found -> () in HColumns.iter process model.columns_type; in (* Add a custom title to the column: a text, an icon indicating that the column is filtered, and a tooltip. Returns the filter icon *) let add_column_header (col: GTree.view_column) text tooltip = col#set_min_width 25; col#set_clickable true; let h = GPack.hbox () in let _lbl = GMisc.label ~text ~packing:h#pack () in let icon = GMisc.image ~xpad:10 ~stock:`COLOR_PICKER ~packing:h#pack () in icon#misc#hide (); Gtk_helper.do_tooltip ~tooltip h; (* set_widget forces Gtk to create a header button for the view_column. *) col#set_widget (Some h#coerce); icon in let add_column_header_callback col mk_menu = let pop_menu () = let menu = lazy (GMenu.menu ()) in List.iter (fun elem -> elem menu) mk_menu; if Lazy.is_val menu then begin let time = GtkMain.Main.get_current_event_time () in (!!menu)#popup ~button:3 ~time end in match get_column_header_button col with | None -> ignore (col#connect#clicked pop_menu) (* TODO: warn *) | Some button -> (* Connect the callback to a right-click *) let callback evt = if GdkEvent.Button.button evt = 3 then begin pop_menu (); true end else false in ignore (button#event#connect#button_release ~callback) in let col_callstack = w#add_column_text ~title:"Callstack" [`YALIGN 0.0] (fun (_,{callstack=stack; selected}) -> let height = if selected <> RUnselected || model.full_callstacks_height then -1 else 1 in let text = match stack with | GC_Filtered -> [`TEXT "filters active"; `STYLE `ITALIC] | GC_Consolidated -> [`TEXT "all"; `STYLE `ITALIC] | GC_Single stack | GC_Callstack stack -> let pp_text = if selected = RSelectedCallstackCol then Pretty_utils.to_string pretty_callstack else Pretty_utils.to_string ~margin:50 pretty_callstack_short in [`TEXT (pp_text stack); `STYLE `NORMAL] in [`HEIGHT height] @ text) in let col_empty = w#add_column_empty in let clear_widget remove_columns = Extlib.may (fun (_, r) -> r.selected <- RUnselected) model.row_selected; model.row_selected <- None; if remove_columns then begin model.all_exprs <- []; (* Clear out all columns except 'Callstacks' and "empty": clear everything, then restore those two. *) let data_col_cs = HColumns.find model.columns_type col_callstack in let data_col_empty = HColumns.find model.columns_type col_empty in HColumns.iter (fun column (col_typ, _) -> if col_typ <> CCallstack && col_typ <> CEmpty then ignore (w#view#remove_column column) ) model.columns_type; HColumns.clear model.columns_type; HColumns.add model.columns_type col_callstack data_col_cs; HColumns.add model.columns_type col_empty data_col_empty; end; (* Post a reload request before clearing. The current model is used to know how many rows must be deleted. *) w#reload ; in let clear_model () = clear_widget true; model.loc <- None; model.rows <- GCallstackMap.empty; model.filters <- []; model.hidden_columns <- []; in let start_session loc ~multiple = if not (multiple && Extlib.opt_equal gui_loc_equal (Some loc) model.loc) then begin clear_model (); model.loc <- Some loc; end in let rec add_columns expr = let expr_string = Pretty_utils.to_string pretty_gui_selection expr in let _expr_string_short = if String.length expr_string >= 15 then String.sub expr_string 0 15 ^ ".." else expr_string in (* 'Before' column *) let col_before = w#add_column_text [`YALIGN 0.0] (fun (_, row) -> let data = find_data row expr in [`TEXT !!(data.Gui_eval.before_string)]) in let tip_before = Printf.sprintf "Value of '%s' before the current point" expr_string in (* 'Alarm column *) let show_alarm_col = ref (fun () -> ()) in let col_alarm = w#add_column_pixbuf [`YALIGN 0.0;`XALIGN 0.5] (fun (_, row) -> let data = find_data row expr in if data.Gui_eval.alarm then begin !show_alarm_col (); [`STOCK_ID "gtk-dialog-warning"] end else [`STOCK_ID ""]) in show_alarm_col := (fun () -> let ct = CAlarm expr in if not (list_mem equal_column_type ct model.hidden_columns) then col_alarm#set_visible true); col_alarm#set_visible false; let tip_alarm = Printf.sprintf "Does evaluation of '%s' always succeed?" expr_string in (* 'Red' column *) let show_red_col = ref (fun () -> ()) in let col_red = w#add_column_pixbuf [`YALIGN 0.0;`XALIGN 0.5] (fun (_, row) -> let data = find_data row expr in if data.Gui_eval.red then begin !show_red_col (); let i = Gtk_helper.Icon.Feedback Property_status.Feedback.Invalid in [`PIXBUF (Gtk_helper.Icon.get i)] end else [`STOCK_ID ""]) in show_red_col := (fun () -> let ct = CRed expr in if not (list_mem equal_column_type ct model.hidden_columns) then col_red#set_visible true); col_red#set_visible false; let tip_red = Printf.sprintf "Did evaluation of '%s' entirely failed once?" expr_string in (* 'After column *) let show_after_col = ref (fun () -> ()) in let col_after = w#add_column_text [`YALIGN 0.0] (fun (_, row) -> let data = find_data row expr in match data.Gui_eval.after with | GA_Bottom -> [`TEXT "BOTTOM"; `STYLE `NORMAL] | GA_NA -> [`TEXT "n/a"; `STYLE `ITALIC] | GA_Unchanged -> [`TEXT "unchanged"; `STYLE `ITALIC] | GA_After _ -> !show_after_col (); [`TEXT !!(data.Gui_eval.after_string); `STYLE `NORMAL]) in col_after#set_visible false; let title_after = expr_string ^ " (after)" in let tip_after = Printf.sprintf "Value of '%s' after the current point" expr_string in show_after_col := (fun () -> let ct = CAfter expr in if not (list_mem equal_column_type ct model.hidden_columns) then col_after#set_visible true); (* This is the menu displayed when the user left-clicks on the header of one of the three columns *) let menu_on_expr col_type (icon: GMisc.image) (menu: GMenu.menu Lazy.t)= let has_filters = column_has_filter model col_type in let txt_remove_col = Format.asprintf "Remove all columns for '%a'%s" pretty_gui_selection expr (if has_filters then " (including filters)" else "") in let remove = GMenu.menu_item ~label:txt_remove_col () in (!!menu)#add remove; let callback_remove_filters () = icon#misc#hide (); let filters' = remove_filter expr model.filters in let filters_changed = filters' != model.filters in model.filters <- filters'; if filters_changed then render_session () in (* Remove all the columns related to 'expr' *) let callback_remove () = model.all_exprs <- list_remove gui_selection_equal expr model.all_exprs; HColumns.iter (fun col (col_type, _) -> match col_type with | CBefore e | CAfter e | CAlarm e | CRed e when gui_selection_equal expr e -> ignore (w#view#remove_column col); HColumns.remove model.columns_type col; | _ -> () ) model.columns_type; callback_remove_filters (); in ignore (remove#connect#activate callback_remove); if has_filters then begin let txt_unfilter = "Remove filters on this column" in let unfilter = GMenu.menu_item ~label:txt_unfilter () in (!!menu)#add unfilter; ignore (unfilter#connect#activate callback_remove_filters); end; in let aux_expr_column (col: GTree.view_column) coltype txt tip = let icon = add_column_header col txt tip in let mk_menu = [ menu_on_expr coltype icon; filter_menu ] in add_column_header_callback col mk_menu; HColumns.add model.columns_type col (coltype, show_icon icon); in aux_expr_column col_before (CBefore expr) expr_string tip_before; aux_expr_column col_alarm (CAlarm expr) " " tip_alarm; aux_expr_column col_red (CRed expr) " " tip_red; aux_expr_column col_after (CAfter expr) title_after tip_after; and add_data expr callstack data = (* If the expression has never been displayed before, create the columns *) if not (list_mem gui_selection_equal expr model.all_exprs) then begin add_columns expr; model.all_exprs <- expr :: model.all_exprs end; model.rows <- add_data_to_rows model.rows callstack expr data and render_session () = clear_widget false; let has_visible_row = ref false in GCallstackMap.iter (fun _cs row -> if row_is_visible row then begin has_visible_row := true; w#insert_row (gtk_model#add row); end; ) model.rows; if not !has_visible_row && not (GCallstackMap.is_empty model.rows) then (* Add a special row to indicate that some things are hidden by filters. This row is intentionally only added to the view, but not to the model *) w#insert_row (gtk_model#add (row_unfocused ())); GtkTree.TreeView.columns_autosize w#view#as_tree_view; in (* Callback called when a callstack is focused or unfocused *) let callback_focus_unfocus lcs icon () = let conv = List.map Gui_callstacks_filters.from_callstack in let lrcs = Extlib.opt_map conv lcs in callback_focus_callstack lrcs; icon ~filtered:(lcs <> None); model.focused_rev_callstacks <- lrcs; render_session (); in (* Add 'Unfocus callstacks' option to menu. *) let add_unfocus_callstacks menu icon = if Extlib.has_some model.focused_rev_callstacks then begin let unfocus = GMenu.menu_item ~label:"Unfocus callstack(s)" () in (!!menu)#add unfocus; ignore (unfocus#connect#activate (callback_focus_unfocus None icon)) end; in (* Add 'Focus on all displayed callstacks' to menu *) let add_focus_all_callstacks menu icon = let visible_callstack cs row acc = match cs with | GC_Single cs | GC_Callstack cs -> if row_is_visible row then cs :: acc else acc | _ -> acc in let callstacks = GCallstackMap.fold visible_callstack model.rows [] in if List.length callstacks > 1 then let focus_all = GMenu.menu_item ~label:"Focus on all \ displayed callstacks" () in (!!menu)#add focus_all; ignore (focus_all#connect#activate (callback_focus_unfocus (Some callstacks) icon)); in let tip_callstack = "Callstacks at which the selection was analyzed" in let icon_callstack = add_column_header col_callstack "Callstack" tip_callstack in let mk_menu_header_callstack menu = add_unfocus_callstacks menu (show_icon icon_callstack); add_focus_all_callstacks menu (show_icon icon_callstack); filter_menu menu; in add_column_header_callback col_callstack [mk_menu_header_callstack]; HColumns.add model.columns_type col_callstack (CCallstack, show_icon icon_callstack); HColumns.add model.columns_type col_empty (CEmpty, (fun ~filtered:_ -> ())); let clone model' = clear_model () (* resets row_selected + the widget itself *); model.loc <- model'.loc; model.all_exprs <- model'.all_exprs; (* Recreate the columns, in particular the field 'columns_type' *) List.iter add_columns (List.rev model'.all_exprs); model.rows <- GCallstackMap.map (fun r -> { r with selected = RUnselected}) model'.rows; model.focused_rev_callstacks <- model'.focused_rev_callstacks; model.filters <- model'.filters; HColumns.iter (fun _col (coltype, icon) -> icon ~filtered:(column_has_filter model' coltype) ) model.columns_type; model.full_callstacks_height <- model'.full_callstacks_height; model.show_consolidated <- model'.show_consolidated; model.show_by_callstacks <- model'.show_by_callstacks; render_session () in (* This is the menu which is displayed when the user right-clicks on a data column. It can be used to filter lines *) let popup_menu_filter expr v icon vars_to_display = let menu = GMenu.menu () in let callback_copy () = (* we copy to both PRIMARY and CLIPBOARD clipboards, for easier pasting *) (* for a more readable result, add a separator between the expression and its value when necessary *) let value_str = Format.asprintf "%a" pretty_filter_column v in let text = Format.asprintf "%a%s%a" pretty_gui_selection expr (if String.get value_str 0 = ' ' then "" else " -> ") pretty_filter_column v in let clipboard = GtkBase.Clipboard.get Gdk.Atom.clipboard in GtkBase.Clipboard.set_text clipboard text; let primary = GtkBase.Clipboard.get Gdk.Atom.primary in GtkBase.Clipboard.set_text primary text in let callback_only_except oe () = let filter = expr, oe, v in model.filters <- filter :: model.filters; icon ~filtered:true; render_session (); in let copy = GMenu.menu_item ~label:"Copy to clipboard" () in let equal = GMenu.menu_item ~label:"Only equal" () in let different = GMenu.menu_item ~label:"Only different" () in menu#add copy; menu#add (GMenu.separator_item ()); menu#add equal; menu#add different; ignore (copy#connect#activate callback_copy); ignore (equal#connect#activate (callback_only_except true)); ignore (different#connect#activate (callback_only_except false)); (* add menu items for variables present in the selected expression *) let callback_display_var vi () = Extlib.may (fun loc -> let lval = Cil.var vi in let selection = GS_LVal lval in let list = Input.make_data_for_lvalue lval loc in let append (callstack, data) = add_data selection callstack data in List.iter append list; render_session () ) model.loc in (* To avoid slowing down the GUI, limit maximum number of displayed values *) let nb_max = 30 in let len = List.length vars_to_display in let vars_to_display, nb_omitted = if len > nb_max then Extlib.list_slice ~last:nb_max vars_to_display, len - nb_max else vars_to_display, 0 in List.iter (fun vi -> let label = Format.asprintf "Display values for '%a'" Printer.pp_varinfo vi in let varmenuitem = GMenu.menu_item ~label () in menu#add varmenuitem; ignore (varmenuitem#connect#activate (callback_display_var vi)); ) vars_to_display; if nb_omitted > 0 then begin let label = Format.asprintf "... plus other %d values (omitted)" nb_omitted in let varmenuitem = GMenu.menu_item ~label () in menu#add varmenuitem; varmenuitem#misc#set_sensitive false end; let time = GtkMain.Main.get_current_event_time () in menu#popup ~button:3 ~time in (* Updates the selection state of the given row. *) let update_selected select (_, row as irow) = row.selected <- select; w#update_row irow; in w#on_click (fun (_, row as irow) column -> (* Update the height of the selected and deselected rows. *) (* First, unselect the previous row, if it was not 'row' itself (avoids flickering *) begin match model.row_selected with | Some (_, row_old as irow_old) when row_old != row -> update_selected RUnselected irow_old; | _ -> () end; (* Newt, update 'row' *) update_selected (if GColumn.equal column col_callstack then RSelectedCallstackCol else RSelected) irow; model.row_selected <- Some irow; (* Dump the clicked cell on the "Information" tab, for copy-pasting and/or selection *) let dump s pp v = main_ui#pretty_information "@.%s:@.%a@." s pp v in match HColumns.find model.columns_type column with | CCallstack, _ -> begin match row.callstack with | GC_Single stack | GC_Callstack stack -> dump "Stack" pretty_callstack stack | GC_Consolidated | GC_Filtered -> () end | CBefore expr, _ -> let data = find_data row expr in dump "Value before" Input.pretty_gui_res data.Gui_eval.before | CAfter expr, _ -> begin let data = find_data row expr in match data.Gui_eval.after with | GA_After after -> dump "Value after" Input.pretty_gui_res after | GA_NA | GA_Unchanged | GA_Bottom -> () end | CAlarm _, _ | CEmpty, _ | CRed _, _ -> () ); let gui_res_of_after f after = match after with | GA_After r -> f r | GA_NA | GA_Unchanged | GA_Bottom -> [] in w#on_right_click (fun (_, row) column -> match HColumns.find model.columns_type column with | CCallstack, icon -> begin let menu = lazy (GMenu.menu ()) in (* Add 'Focus' option when a callstack is selected *) begin match row.callstack with | GC_Single cs | GC_Callstack cs -> let focus = GMenu.menu_item ~label:"Focus on this callstack"() in (!!menu)#add focus; ignore (focus#connect#activate (callback_focus_unfocus (Some [cs]) icon)); | GC_Filtered | GC_Consolidated -> () end; add_focus_all_callstacks menu icon; add_unfocus_callstacks menu icon; (* Popup the menu only if something as been added *) if Lazy.is_val menu then let time = GtkMain.Main.get_current_event_time () in (!!menu)#popup ~button:3 ~time end | CBefore expr, icon -> let data = find_data row expr in if data.Gui_eval.before <> GR_Empty then popup_menu_filter expr (FilterBefore data.Gui_eval.before) icon (Input.vars_in_gui_res data.Gui_eval.before); | CAfter expr, icon -> let data = find_data row expr in if data.Gui_eval.before <> GR_Empty then popup_menu_filter expr (FilterAfter data.Gui_eval.after) icon (gui_res_of_after Input.vars_in_gui_res data.Gui_eval.after) | CAlarm expr, icon -> let data = find_data row expr in if data.Gui_eval.before <> GR_Empty then popup_menu_filter expr (FilterAlarm data.Gui_eval.alarm) icon [] | CRed expr, icon -> let data = find_data row expr in if data.Gui_eval.before <> GR_Empty then popup_menu_filter expr (FilterRed data.Gui_eval.red) icon [] | CEmpty, _ -> () ); frame, (object method model = model method add_data = add_data method render_session = render_session method start_session = start_session method clear = clear_model method clone = clone method expand_row_for_callstacks expand = if model.full_callstacks_height <> expand then begin model.full_callstacks_height <- expand; render_session () end method show_by_callstacks show = if model.show_by_callstacks <> show then begin model.show_by_callstacks <- show; render_session () end method show_consolidated show = if model.show_consolidated <> show then begin model.show_consolidated <- show; render_session () end end: value cm_panel) end module HWidget = Hashtbl.Make(struct type t = GObj.widget let hash w = Gobject.get_oid w#as_widget let equal w1 w2 = Gobject.get_oid w1#as_widget = Gobject.get_oid w2#as_widget end) type 'v result = { widget: GObj.widget; reset: unit -> unit; clear_default: unit -> unit; focus_selection_tab: unit -> unit; display_data_by_callstack: 'v display_data_by_callstack } (* This function creates the buttons at the top of "Values" tab, plus a tab control suitable for displaying multiple cm_panel *) let make_widget (main_ui:main_ui) ~packing make_panel = let vpaned = GPack.vbox ~homogeneous:false () ~packing in let hbox_filters = GPack.hbox ~packing:(vpaned#pack ~expand:false) () in let chk_multiple = new Widget.checkbox ~label:"Multiple selections" ~tooltip:"Allow the selection of multiple expressions on the same \ statement" () in let chk_consolidated = new Widget.checkbox ~label:"Consolidated value" ~tooltip:"Show values consolidated across all callstacks" () in let chk_callstacks = new Widget.checkbox ~label:"Per callstack" ~tooltip:"Show values per callstack" () in let chk_rows_height = new Widget.checkbox ~label:"Expand rows" ~tooltip:"Expand rows to fit the 'Callstack' column" () in let key_multiple = "Value.multiple_selections" in let key_consolidated = "Value.show_consolidated" in let key_by_callstacks = "Value.show_by_callstacks" in let key_rows_height = "Value.expand_rows" in let get_bool k default = Gtk_helper.Configuration.find_bool ~default k in let save_bool k v = Gtk_helper.Configuration.(set k (ConfBool v)) in chk_multiple#set (get_bool key_multiple false); chk_consolidated#set (get_bool key_consolidated true); chk_callstacks#set (get_bool key_by_callstacks true); chk_rows_height#set (get_bool key_rows_height false); hbox_filters#pack chk_multiple#coerce; hbox_filters#pack ~from:`END chk_callstacks#coerce; hbox_filters#pack ~from:`END chk_consolidated#coerce; (* let lbl_filters = GMisc.label ~markup:"Filters: " () in hbox_filters#pack ~from:`END lbl_filters#coerce; *) hbox_filters#pack ~from:`END chk_rows_height#coerce; let tabs = GPack.notebook ~scrollable:true ~packing:(vpaned#pack ~expand:true) () in vpaned#misc#set_sensitive (Db.Value.is_computed ()); let pack_tab ?lbl w = ignore (tabs#insert_page ?tab_label:lbl w) in let lbl_pane_default = GPack.hbox () in let clear_button = new Widget.button ~icon:`CLEAR ~tooltip:"Clear" () in clear_button#set_enabled false; let save_button = new Widget.button ~icon:`SAVE ~tooltip:"Save" () in save_button#set_enabled false; let lbl = GMisc.label ~markup:"Selection" () in lbl_pane_default#pack lbl#coerce; lbl_pane_default#pack clear_button#coerce; lbl_pane_default#pack save_button#coerce; let focus_selection_tab () = let n = main_ui#lower_notebook#page_num vpaned#coerce in main_ui#lower_notebook#goto_page n; tabs#goto_page 0 in (* Callback for the "Selection" tab: set the selected callstacks as filters, plus rehighlight the source text (for dead code, etc) *) let callback_focus_callstack lrcs = Gui_callstacks_filters.focus_on_callstacks lrcs; main_ui#rehighlight () in let make_panel ?(callback_focus_callstack=fun _ -> ()) () = make_panel main_ui ~callback_focus_callstack ~show_consolidated:chk_consolidated#get ~show_by_callstacks:chk_callstacks#get ~full_callstacks_height:chk_rows_height#get in let pane_default, model_default = make_panel ~callback_focus_callstack () in pack_tab ~lbl:lbl_pane_default#coerce pane_default#coerce; let hash_tabs = HWidget.create 16 in let notify_switch_page n = (* Hide the buttons of all the tabs not focused *) HWidget.iter (fun _ (_, bt1, bt2) -> bt1#hide (); bt2#hide ()) hash_tabs; if n = 0 then begin (* 'Selection' tab is focused *) clear_button#coerce#misc#show (); save_button#coerce#misc#show (); end else let w = tabs#get_nth_page n in clear_button#coerce#misc#hide (); save_button#coerce#misc#hide (); try (* Show the buttons of the current tab *) let _, bt1, bt2 = HWidget.find hash_tabs w in bt1#show (); bt2#show (); with Not_found -> () (* should not happen *) in ignore (tabs#connect#switch_page ~callback:notify_switch_page); let callback_save_button () = let model = model_default#model in match model.loc with | Some loc -> let txt = match loc with | GL_Stmt (kf, stmt) -> Format.asprintf "%a:%d" Kernel_function.pretty kf (fst (Cil_datatype.Stmt.loc stmt)).Filepath.pos_lnum | GL_Pre kf -> Format.asprintf "pre %a" Kernel_function.pretty kf | GL_Post kf -> Format.asprintf "post %a" Kernel_function.pretty kf in let hb = GPack.hbox () in ignore (GMisc.label ~packing:hb#pack ~markup:txt ()); let button_delete = new Widget.button ~icon:`DELETE ~tooltip:"Delete" () in hb#pack button_delete#coerce; button_delete#coerce#misc#hide (); let button_edit = new Widget.button ~icon:`EDIT ~tooltip:"Edit" () in hb#pack button_edit#coerce; button_edit#coerce#misc#hide (); let tab, model_tab = make_panel () in button_delete#connect (fun () -> let n = tabs#page_num tab#coerce in tabs#remove_page n ); button_edit#connect (fun () -> let loc = match loc with | GL_Stmt (kf, stmt) -> Pretty_source.PStmt (kf, stmt) | GL_Pre kf | GL_Post kf -> let vi = Kernel_function.get_vi kf in Pretty_source.PVDecl (Some kf, Cil_types.Kglobal, vi) in main_ui#scroll loc; model_default#clone model_tab#model; tabs#goto_page 0; callback_focus_callstack model_default#model.focused_rev_callstacks; ); HWidget.add hash_tabs tab#coerce (model_tab, button_edit#coerce#misc, button_delete#coerce#misc); pack_tab ~lbl:hb#coerce tab#coerce; model_tab#clone model_default#model | None -> () in save_button#connect callback_save_button; let on_all f = f model_default; HWidget.iter (fun _ (model, _, _) -> f model) hash_tabs; in (* Clear the 'default' tab *) let clear_default () = clear_button#set_enabled false; save_button#set_enabled false; model_default#clear () in clear_button#connect clear_default; chk_multiple#connect (fun b -> save_bool key_multiple b); chk_consolidated#connect (fun b -> save_bool key_consolidated b; on_all (fun model -> model#show_consolidated b)); chk_callstacks#connect (fun b -> save_bool key_by_callstacks b; on_all (fun model -> model#show_by_callstacks b)); chk_rows_height#connect (fun b -> save_bool key_rows_height b; on_all (fun model -> model#expand_row_for_callstacks b)); (* Clear all the tabs *) let reset () = (* the method get_n_pages is missing in Lablgtk. Instead, we iterate over the hash tables of panels to remove the non-'Selection' ones *) HWidget.iter (fun w _ -> tabs#remove_page (tabs#page_num w)) hash_tabs; HWidget.clear hash_tabs; clear_default (); vpaned#misc#set_sensitive (Db.Value.is_computed ()); in let display_data_by_callstack loc selection content = clear_button#set_enabled true; save_button#set_enabled true; model_default#start_session loc ~multiple:chk_multiple#get; let append (callstack, data) = model_default#add_data selection callstack data in List.iter append content; model_default#render_session () in { widget = vpaned#coerce; reset; clear_default; focus_selection_tab; display_data_by_callstack } (* Reference to the final widget. Used to remove it properly when rebuilding the panel for a new analysis. *) let widget_ref: GObj.widget option ref = ref None let reset_ref = ref (fun () -> ()) let clear_default_ref = ref (fun () -> ()) let focus_selection_tab_ref = ref (fun _ -> ()) let reset () = !reset_ref () let clear_default () = !clear_default_ref () let focus_selection_tab () = !focus_selection_tab_ref () (* Removes the previous panel, if any. Returns the position of the panel in the lower notebook, and a boolean indicating whether the panel had the focus before being removed. Used to keep the same position and focus when renewing the panel. *) let remove main_ui = match !widget_ref with | None -> -1, false | Some widget -> let num = main_ui#lower_notebook#page_num widget in let focused = main_ui#lower_notebook#current_page = num in if num <> -1 then main_ui#lower_notebook#remove_page num; num, focused (* Creates the panel, sets the references to widget, clear_default and focus_selection_tab, and returns the display_by_callstack function. *) let create (type v) (main_ui: main_ui) (module I: Input with type value = v) = let num, focused = remove main_ui in let module CM = Make (I) in let packing w = let tab_label = (GMisc.label ~text:"Values" ())#coerce in ignore (main_ui#lower_notebook#insert_page ~pos:num ~tab_label w#coerce) in let result = make_widget main_ui ~packing CM.make_panel in if focused then main_ui#lower_notebook#goto_page num; widget_ref := Some result.widget; reset_ref := result.reset; clear_default_ref := result.clear_default; focus_selection_tab_ref := result.focus_selection_tab; result.display_data_by_callstack �����������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_callstacks_manager.mli�������������������������0000666�0000000�0000000�00000006653�13571573400�023744� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module creates and manages the "Values" panel on the lower notebook of the GUI. It mainly displays the values computed by the analysis for selected expressions and lvalues, and thus depends on the value abstractions used for the analysis. It is able to display different values by callstacks in a table, in accordance with the callstacks focused by the user (handled in gui_callstacks_filters.ml). *) open Gui_types (* List associating callstacks and data related to them. Each element of such a list is intended to be displayed in a separate row. *) type 'v data_by_callstack = (gui_callstack * 'v Gui_eval.gui_selection_data) list (* Type of the function that displays some data by callstacks for a selection (expression, lvalue or term) at a location (statement, precondition or postcondition of a function). This is the main feature of the "Values" panel, returned by the [create] function below. *) type 'v display_data_by_callstack = gui_loc -> gui_selection -> 'v data_by_callstack -> unit (* Module needed to create the panel. *) module type Input = sig include Gui_types.S val make_data_for_lvalue : Cil_types.lval -> gui_loc -> value data_by_callstack end (** Creates the panel, attaches it to the lower notebook, and returns the display_by_callstack function allowing to display data on it. If a previous panel was previously created through this function, the new panel replaces it. *) val create: Design.main_window_extension_points -> (module Input with type value = 'v) -> 'v display_data_by_callstack (* Should be called when the main_ui is reset. *) val reset: unit -> unit (* Clear the 'default' tab of the panel, for example on selection change. *) val clear_default: unit -> unit (* Set focus on the 'Selection' tab of the panel. *) val focus_selection_tab: unit -> unit �������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_eval.ml����������������������������������������0000666�0000000�0000000�00000055074�13571573400�020705� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Gui_types let results_kf_computed kf = Db.Value.is_computed () && match kf with | { fundec = Definition (fundec, _) } -> Mark_noresults.should_memorize_function fundec | { fundec = Declaration _ } -> true (* This value is not really used *) let term_c_type t = Logic_const.plain_or_set (fun ltyp -> match Logic_utils.unroll_type ltyp with | Ctype typ -> Some typ | _ -> None ) (Logic_utils.unroll_type t.term_type) let classify_pre_post kf ip = let open Property in match ip with | IPPredicate {ip_kind = PKEnsures (_, Normal)} -> Some (GL_Post kf) | IPPredicate {ip_kind=PKEnsures _} | IPAxiom _ | IPAxiomatic _ | IPLemma _ | IPTypeInvariant _ | IPGlobalInvariant _ | IPOther _ | IPCodeAnnot _ | IPAllocation _ | IPReachable _ | IPExtended _ | IPBehavior _ -> None | IPPropertyInstance {ii_kf; ii_stmt} -> Some (GL_Stmt (ii_kf, ii_stmt)) | IPPredicate {ip_kind=PKRequires _ | PKAssumes _ | PKTerminates} | IPComplete _ | IPDisjoint _ | IPAssigns _ | IPFrom _ | IPDecrease _ -> Some (GL_Pre kf) let gui_loc_logic_env lm = (* According to the ACSL spec, 'Pre' is not available in preconditions, but in practice it is parsed *) let pre () = let e = Logic_typing.Lenv.empty () in Logic_typing.(append_pre_label (append_init_label (append_here_label e))) in let stmt () = pre () in (*TODO: add LoopEntry and LoopCurrent when supported*) let post () = Logic_typing.append_old_and_post_labels (stmt ()) in match lm with | GL_Stmt _ -> stmt () | GL_Pre _ -> pre () | GL_Post _ -> post () type 'a gui_selection_data = { alarm: bool; red: bool; before: 'a gui_res; before_string: string Lazy.t; after: 'a gui_after; after_string: string Lazy.t; } let gui_selection_data_empty = { alarm = false; red = false; before = GR_Empty; before_string = lazy ""; after = GA_NA; after_string = lazy ""; } let clear_caches () = Cvalue.V_Offsetmap.clear_caches (); Cvalue.Model.clear_caches (); Locations.Location_Bytes.clear_caches (); Locations.Zone.clear_caches (); Function_Froms.Memory.clear_caches () module type S = sig module Analysis : Analysis.S type ('env, 'expr, 'v) evaluation_functions = { eval_and_warn: 'env -> 'expr -> 'v * bool (* alarm *) * bool (* red *); env: Analysis.Dom.t -> Value_types.callstack -> 'env; equal: 'v -> 'v -> bool; bottom: 'v; join: 'v -> 'v -> 'v; expr_to_gui_selection: 'expr -> gui_selection; res_to_gui_res: 'expr -> 'v -> Analysis.Val.t gui_res; } val lval_as_offsm_ev: (Analysis.Dom.t, lval, gui_offsetmap_res) evaluation_functions val lval_zone_ev: (Analysis.Dom.t, lval, Locations.Zone.t) evaluation_functions val null_ev: (Analysis.Dom.t, unit, gui_offsetmap_res) evaluation_functions val exp_ev: (Analysis.Dom.t, exp, Analysis.Val.t Bottom.or_bottom) evaluation_functions val lval_ev: (Analysis.Dom.t, lval, Analysis.Val.t Eval.flagged_value) evaluation_functions val tlval_ev: gui_loc -> (Eval_terms.eval_env, term, gui_offsetmap_res) evaluation_functions val tlval_zone_ev: gui_loc -> (Eval_terms.eval_env, term, Locations.Zone.t) evaluation_functions val term_ev: gui_loc -> (Eval_terms.eval_env, term, Analysis.Val.t Bottom.or_bottom) evaluation_functions val predicate_ev: gui_loc -> (Eval_terms.eval_env, predicate, Eval_terms.predicate_status Bottom.or_bottom ) evaluation_functions val predicate_with_red: gui_loc -> (Eval_terms.eval_env * (kinstr * Value_types.callstack), Red_statuses.alarm_or_property * predicate, Eval_terms.predicate_status Bottom.or_bottom ) evaluation_functions val make_data_all_callstacks: ('a, 'b, 'c) evaluation_functions -> gui_loc -> 'b -> (gui_callstack * Analysis.Val.t gui_selection_data) list * exn list end module Make (X: Analysis.S) = struct module Analysis = X let get_precise_loc = match X.Loc.get Main_locations.PLoc.key with | None -> fun _ -> Precise_locs.loc_top | Some get -> fun loc -> get loc module AGui_types = Gui_types.Make (X.Val) open AGui_types type ('env, 'expr, 'v) evaluation_functions = { eval_and_warn: 'env -> 'expr -> 'v * bool * bool; env: X.Dom.t -> Value_types.callstack -> 'env; equal: 'v -> 'v -> bool; bottom: 'v; join: 'v -> 'v -> 'v; expr_to_gui_selection: 'expr -> gui_selection; res_to_gui_res: 'expr -> 'v -> X.Val.t gui_res; } (* Special function for l-values (Var vi, NoOffset). Since allocated variables may have an incomplete array type, it is simpler to extract the entire offsetmap and return it (instead of performing a copy of the offsetmap with a wacky size). For "normal" variables, this code is correct too. The returned boolean 'ok' means that the operation was possible. *) let extract_single_var state vi = let b = Base.of_varinfo vi in try match Cvalue.Model.find_base b state with | `Bottom -> GO_InvalidLoc, false | `Value m -> GO_Offsetmap m, true | `Top -> GO_Top, false with Not_found -> GO_InvalidLoc, false (* Evaluate the given location in [state]. Catch an unreachable state, an invalid location, or another error during the evaluation. The returned boolean means 'ok', i.e. that no error occurred. *) let reduce_loc_and_eval state loc = if Cvalue.Model.is_top state then GO_Top, false else if Cvalue.Model.is_reachable state then if Int_Base.(equal loc.Locations.size zero) then GO_Empty, true else let loc' = Locations.(valid_part Read loc) in if Locations.is_bottom_loc loc' then GO_InvalidLoc, false else try let size = Int_Base.project loc'.Locations.size in match Cvalue.Model.copy_offsetmap loc'.Locations.loc size state with | `Bottom -> GO_Bottom, false | `Value offsm -> let ok = Locations.(is_valid Read loc) in GO_Offsetmap offsm, ok with Abstract_interp.Error_Top -> GO_Top, false else (* Bottom state *) GO_Bottom, true let lval_to_offsetmap state lv = let loc, alarms = X.eval_lval_to_loc state lv in let ok = Alarmset.is_empty alarms in let state = X.Dom.get_cvalue_or_top state in let aux loc (acc_res, acc_ok) = let res, ok = match lv with (* catch simplest pattern *) | Var vi, NoOffset -> extract_single_var state vi | _ -> reduce_loc_and_eval state loc in match acc_res, res with | GO_Offsetmap o1, GO_Offsetmap o2 -> GO_Offsetmap (Cvalue.V_Offsetmap.join o1 o2), acc_ok && ok | GO_Bottom, v | v, GO_Bottom -> v, acc_ok && ok | GO_Empty, v | v, GO_Empty -> v, acc_ok && ok | GO_Top, GO_Top -> GO_Top, acc_ok && ok | GO_InvalidLoc, GO_InvalidLoc -> GO_InvalidLoc, false | GO_InvalidLoc, GO_Offsetmap _ -> res, false | GO_Offsetmap _, GO_InvalidLoc -> acc_res, false | GO_Top, (GO_InvalidLoc | GO_Offsetmap _ as r) | (GO_InvalidLoc | GO_Offsetmap _ as r), GO_Top -> r, acc_ok && ok (* cannot happen, we should get Top everywhere *) in match loc with | `Bottom -> GO_InvalidLoc, ok, false | `Value loc -> let ploc = get_precise_loc loc in let r, ok = Precise_locs.fold aux ploc (GO_Bottom, ok) in r, ok, false let lv_offsetmap_res_to_gui_res lv offsm = let typ = Some (Cil.unrollType (Cil.typeOfLval lv)) in GR_Offsm (offsm, typ) let id_env state _ = state let lval_as_offsm_ev = {eval_and_warn=lval_to_offsetmap; env = id_env; equal=equal_gui_offsetmap_res; bottom=GO_Bottom; join=join_gui_offsetmap_res; expr_to_gui_selection = (fun lv -> GS_LVal lv); res_to_gui_res = lv_offsetmap_res_to_gui_res; } let lval_zone_ev = let lv_to_zone state lv = let loc, _alarms = X.eval_lval_to_loc state lv in match loc with | `Bottom -> Locations.Zone.bottom, false, false | `Value loc -> let ploc = get_precise_loc loc in let z = Precise_locs.enumerate_valid_bits Locations.Read ploc in z, false, false in {eval_and_warn=lv_to_zone; env = id_env; equal=Locations.Zone.equal; bottom=Locations.Zone.bottom; join=Locations.Zone.join; expr_to_gui_selection = (fun lv -> GS_LVal lv); res_to_gui_res = (fun _ z -> GR_Zone z); } let null_to_offsetmap state (_:unit) = let state = X.Dom.get_cvalue_or_top state in match Cvalue.Model.find_base_or_default Base.null state with | `Bottom -> GO_InvalidLoc, false, false | `Top -> GO_Top, false, false | `Value m -> GO_Offsetmap m, true, false let null_ev = {eval_and_warn=null_to_offsetmap; env = id_env; equal=equal_gui_offsetmap_res; bottom=GO_Bottom; join=join_gui_offsetmap_res; expr_to_gui_selection = (fun _ -> GS_AbsoluteMem); res_to_gui_res = (fun _ offsm -> GR_Offsm (offsm, None)); } let exp_ev = let eval_exp_and_warn state e = let r = X.eval_expr state e in fst r, Alarmset.is_empty (snd r), false in let res_to_gui_res e v = let flagged_value = Eval.{v; initialized=true; escaping=false; } in GR_Value (flagged_value, Some (Cil.typeOf e)) in {eval_and_warn=eval_exp_and_warn; env = id_env; equal=Bottom.equal X.Val.equal; bottom=`Bottom; join=Bottom.join X.Val.join; expr_to_gui_selection = (fun e -> GS_Expr e); res_to_gui_res; } let lval_ev = let eval_and_warn state lval = let r = X.copy_lvalue state lval in let flagged_value = match fst r with | `Bottom -> Eval.Flagged_Value.bottom | `Value v -> v in flagged_value, Alarmset.is_empty (snd r), false in { eval_and_warn; env = id_env; bottom = Eval.Flagged_Value.bottom; equal = Eval.Flagged_Value.equal X.Val.equal; join = Eval.Flagged_Value.join X.Val.join; expr_to_gui_selection = (fun lv -> GS_LVal lv); res_to_gui_res = (fun lv v -> GR_Value (v, Some (Cil.typeOfLval lv))); } let pre_kf kf callstack = match Db.Value.get_initial_state_callstack kf with | None -> Cvalue.Model.top (* should not happen *) | Some h -> try Value_types.Callstack.Hashtbl.find h callstack with Not_found -> Cvalue.Model.top (* should not happen either *) let env_here kf here callstack = let pre = pre_kf kf callstack in let here = X.Dom.get_cvalue_or_top here in let c_labels = Eval_annots.c_labels kf callstack in Eval_terms.env_annot ~c_labels ~pre ~here () let env_pre _kf here _callstack = let here = X.Dom.get_cvalue_or_top here in Eval_terms.env_pre_f ~pre:here () let env_post kf post callstack = let pre = pre_kf kf callstack in let post = X.Dom.get_cvalue_or_top post in let result = if !Db.Value.use_spec_instead_of_definition kf then None else let ret_stmt = Kernel_function.find_return kf in match ret_stmt.skind with | Return (Some ({enode = Lval (Var vi, NoOffset)}),_) -> Some vi | Return (None,_) -> None | _ -> assert false in let c_labels = Eval_annots.c_labels kf callstack in Eval_terms.env_post_f ~c_labels ~pre ~post ~result () (* Maps from callstacks to Value states before and after a GUI location. The 'after' map is not always available. *) type states_by_callstack = { states_before: X.Dom.t Value_types.Callstack.Hashtbl.t Eval.or_top_or_bottom; states_after: X.Dom.t Value_types.Callstack.Hashtbl.t Eval.or_top_or_bottom; } let top_states_by_callstacks = { states_before = `Top; states_after = `Top } (* For statements: results are available only if the statement is reachable. After states are available only for instructions. *) let callstacks_at_stmt kf stmt = if results_kf_computed kf then (* Show 'after' states only in instructions. On blocks and if/switch statements, the notion of 'after' is counter-intuitive. *) let is_instr = match stmt.skind with Instr _ -> true | _ -> false in let states_before = X.get_stmt_state_by_callstack ~after:false stmt in let states_after = match states_before with | `Top | `Bottom as x -> x | `Value _ -> if is_instr then X.get_stmt_state_by_callstack ~after:true stmt else `Top in { states_before; states_after } else top_states_by_callstacks (* For pre-states: results are available only if the function is called, and correspond to the states before reduction by any precondition. After states are not available. *) let callstacks_at_pre kf = if results_kf_computed kf then let states_before = X.get_initial_state_by_callstack kf in { states_before; states_after = `Top } else top_states_by_callstacks (* For post-states: results are available only for functions with a body, for normal termination, and only when the function is called. After states are not available. *) let callstacks_at_post kf = if not (!Db.Value.use_spec_instead_of_definition kf) && results_kf_computed kf then let ret = Kernel_function.find_return kf in let states_before = X.get_stmt_state_by_callstack ~after:true ret in { states_before; states_after = `Top } else top_states_by_callstacks let callstacks_at_gui_loc = function | GL_Stmt (kf, stmt) -> callstacks_at_stmt kf stmt | GL_Pre kf -> callstacks_at_pre kf | GL_Post kf -> callstacks_at_post kf let env_gui_loc = function | GL_Stmt (kf, _) -> env_here kf | GL_Pre kf -> env_pre kf | GL_Post kf -> env_post kf let tlval_ev lm = let tlval_to_offsetmap env tlv = let alarms = ref false in let alarm_mode = Eval_terms.Track alarms in let loc = Eval_terms.eval_tlval_as_location env ~alarm_mode tlv in let state = Eval_terms.env_current_state env in let offsm, ok = reduce_loc_and_eval state loc in offsm, not !alarms && ok, false in {eval_and_warn=tlval_to_offsetmap; env = env_gui_loc lm; equal=equal_gui_offsetmap_res; bottom=GO_Bottom; join=join_gui_offsetmap_res; expr_to_gui_selection = (fun tlv -> GS_TLVal tlv); res_to_gui_res = (fun tlv offsm -> GR_Offsm (offsm, term_c_type tlv)) } let tlval_zone_ev gl = let tlv_to_zone env tlv = let alarms = ref false in let alarm_mode = Eval_terms.Track alarms in let z = Eval_terms.eval_tlval_as_zone Locations.Read env ~alarm_mode tlv in z, not !alarms, false in {eval_and_warn=tlv_to_zone; env = env_gui_loc gl; equal=Locations.Zone.equal; bottom=Locations.Zone.bottom; join=Locations.Zone.join; expr_to_gui_selection = (fun tlv -> GS_TLVal tlv); res_to_gui_res = (fun _ z -> GR_Zone z); } let term_ev lm = let eval_term_and_warn env t = let alarms = ref false in let alarm_mode = Eval_terms.Track alarms in let r = Eval_terms.(eval_term ~alarm_mode env t) in `Value (from_cvalue r.Eval_terms.eover), not !alarms, false in let res_to_gui_res t v = let flagged_value = Eval.{v; initialized=true; escaping=false; } in GR_Value (flagged_value, term_c_type t) in {eval_and_warn=eval_term_and_warn; env = env_gui_loc lm; equal=Bottom.equal X.Val.equal; bottom=`Bottom; join=Bottom.join X.Val.join; expr_to_gui_selection = (fun t -> GS_Term t); res_to_gui_res; } let predicate_ev lm = let eval_predicate_and_warn env t = let r = Eval_terms.eval_predicate env t in `Value r, true (* TODO *), false in let to_status = function | `Bottom -> Eval_terms.True | `Value s -> s in {eval_and_warn = eval_predicate_and_warn; env = env_gui_loc lm; equal = (=); bottom = `Bottom; join = Bottom.join Eval_terms.join_predicate_status; expr_to_gui_selection = (fun p -> GS_Predicate p); res_to_gui_res = (fun _ s -> GR_Status (to_status s)); } (* Evaluation of a predicate, while tracking red alarms inside the dedicated column. *) let predicate_with_red lm = (* We need the statement and the callstack in the environment to determine whether a red status was emitted then during the analysis. *) let env_alarm_loc lm state cs = env_gui_loc lm state cs, match lm with | GL_Stmt (_, stmt) -> Kstmt stmt, cs | GL_Pre _| GL_Post _ -> Kglobal, cs in let eval_alarm_and_warn (env, (kinstr, cs)) (ap, p) = let r = Eval_terms.eval_predicate env p in let red = Red_statuses.is_red_in_callstack kinstr ap cs in `Value r, true (* TODO *), red in let to_status = function | `Bottom -> Eval_terms.True | `Value s -> s in {eval_and_warn = eval_alarm_and_warn; env = env_alarm_loc lm; equal = (=); bottom = `Bottom; join = Bottom.join Eval_terms.join_predicate_status; expr_to_gui_selection = (fun (_, p) -> GS_Predicate p); res_to_gui_res = (fun _ s -> GR_Status (to_status s)); } let data ~ok ~before ~after ~red = { before; after; alarm = not ok; red; before_string = lazy (Pretty_utils.to_string pretty_gui_res before); after_string = (match after with | GA_NA | GA_Unchanged | GA_Bottom -> lazy "" (* won't be used *) | GA_After after -> lazy (Pretty_utils.to_string pretty_gui_res after)); } type before_after = BABefore | BAAfter (* Evaluation of [exp] in [before] and [after] using [ev]. [set_ba] must be called before each evaluation, with the state in which the evaluation will be done. *) let make_data ev set_ba ~before ~after exp = set_ba BABefore; let vbefore, ok, red = ev.eval_and_warn before exp in let before = ev.res_to_gui_res exp vbefore in match after with | `Top -> data ~before ~after:GA_NA ~ok ~red | `Bottom -> data ~before ~after:(GA_Bottom) ~ok ~red | `Value after -> set_ba BAAfter; (* Currently, we do not warn for alarms in the post-state. *) let vafter, _okafter, _redafter = ev.eval_and_warn after exp in if ev.equal vbefore vafter then data ~before ~after:GA_Unchanged ~ok ~red else data ~before ~after:(GA_After (ev.res_to_gui_res exp vafter)) ~ok ~red let make_data_all_callstacks_from_states ev ~before ~after expr = let exn = ref [] in let single_callstack = (Value_types.Callstack.Hashtbl.length before) = 1 in let v_join_before = ref ev.bottom in let v_join_after = ref ev.bottom in let ok_join = ref true in let red_join = ref false in let rba = ref BABefore in let set_ba ba = rba := ba in (* Change [ev] to store intermediate results for 'consolidated' line *) let eval_and_warn states e = let v, ok, red as r = ev.eval_and_warn states e in begin match !rba with | BABefore -> v_join_before := ev.join !v_join_before v; ok_join := !ok_join && ok; red_join := !red_join || red; | BAAfter -> v_join_after := ev.join !v_join_after v; end; r in let ev = { ev with eval_and_warn } in (* Rows by callstack *) let list = Value_types.Callstack.Hashtbl.fold (fun callstack before acc -> let before = ev.env before callstack in let after = match after with | `Top | `Bottom as x -> x | `Value after -> try let after = Value_types.Callstack.Hashtbl.find after callstack in `Value (ev.env after callstack) (* If a callstack exists before the statement but is not found after, then the post state for this callstack is bottom. *) with Not_found -> `Bottom in let callstack = if single_callstack then GC_Single callstack else GC_Callstack callstack in try (callstack, (make_data ev set_ba ~before ~after expr)) :: acc with e -> exn := e :: !exn; acc ) before [] in (* Consolidated row, only if there are multiple callstacks *) let list = if single_callstack then list else let callstack = GC_Consolidated in let before = ev.res_to_gui_res expr !v_join_before in let after = match after with | `Top | `Bottom -> GA_NA | `Value _ -> if ev.equal !v_join_before !v_join_after then GA_Unchanged else GA_After (ev.res_to_gui_res expr !v_join_after) in (callstack, (data ~before ~after ~ok:!ok_join ~red:!red_join)) :: list in list, !exn let make_data_all_callstacks ev loc v = let {states_before; states_after} = callstacks_at_gui_loc loc in match states_before with | `Top -> [], [] (* Happens if none of the domains has saved its states. In this case, nothing is displayed by the GUI. *) | `Bottom -> [], [] (* Bottom case: nothing is displayed either. *) | `Value before -> Cil.CurrentLoc.set (gui_loc_loc loc); clear_caches (); make_data_all_callstacks_from_states ev ~before ~after:states_after v end (* Local Variables: compile-command: "make -C ../../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_eval.mli���������������������������������������0000666�0000000�0000000�00000011361�13571573400�021045� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module defines an abstraction to evaluate various things across multiple callstacks. Currently, l-values, NULL, expressions, term-lvalues, terms and predicates can be evaluated *) open Cil_types open Gui_types (** Catch the fact that we are in a function for which [-no-results] or one of its variants is set. Without this check, we would display much non-sensical information. *) val results_kf_computed: kernel_function -> bool (** State in which the predicate, found in the given function, should be evaluated *) val classify_pre_post: kernel_function -> Property.t -> gui_loc option val gui_loc_logic_env: gui_loc -> Logic_typing.Lenv.t (** Logic labels valid at the given location. C labels are _not_ added, even if the location is a statement. *) type 'a gui_selection_data = { alarm: bool; red: bool; before: 'a gui_res; before_string: string Lazy.t; after: 'a gui_after; after_string: string Lazy.t; } val gui_selection_data_empty: 'a gui_selection_data (** Default value. All the fields contain empty or dummy values *) (** The types and function below depend on the abstract domains and values currently available in Eva. *) module type S = sig module Analysis : Analysis.S (** This is the record that encapsulates all evaluation functions *) type ('env, 'expr, 'v) evaluation_functions = { eval_and_warn: 'env -> 'expr -> 'v * bool (* alarm *) * bool (* red *); env: Analysis.Dom.t -> Value_types.callstack -> 'env; equal: 'v -> 'v -> bool; bottom: 'v; join: 'v -> 'v -> 'v; expr_to_gui_selection: 'expr -> gui_selection; res_to_gui_res: 'expr -> 'v -> Analysis.Val.t gui_res; } val lval_as_offsm_ev: (Analysis.Dom.t, lval, gui_offsetmap_res) evaluation_functions val lval_zone_ev: (Analysis.Dom.t, lval, Locations.Zone.t) evaluation_functions val null_ev: (Analysis.Dom.t, unit, gui_offsetmap_res) evaluation_functions val exp_ev: (Analysis.Dom.t, exp, Analysis.Val.t Bottom.or_bottom) evaluation_functions val lval_ev: (Analysis.Dom.t, lval, Analysis.Val.t Eval.flagged_value) evaluation_functions (** Evaluation of logic-originating objects is parameterized by a location information, which is used to build the evaluation environment *) val tlval_ev: gui_loc -> (Eval_terms.eval_env, term, gui_offsetmap_res) evaluation_functions val tlval_zone_ev: gui_loc -> (Eval_terms.eval_env, term, Locations.Zone.t) evaluation_functions val term_ev: gui_loc -> (Eval_terms.eval_env, term, Analysis.Val.t Bottom.or_bottom) evaluation_functions val predicate_ev: gui_loc -> (Eval_terms.eval_env, predicate, Eval_terms.predicate_status Bottom.or_bottom ) evaluation_functions val predicate_with_red: gui_loc -> (Eval_terms.eval_env * (kinstr * Value_types.callstack), Red_statuses.alarm_or_property * predicate, Eval_terms.predicate_status Bottom.or_bottom ) evaluation_functions val make_data_all_callstacks: ('a, 'b, 'c) evaluation_functions -> gui_loc -> 'b -> (gui_callstack * Analysis.Val.t gui_selection_data) list * exn list end module Make (X: Analysis.S) : S with module Analysis = X �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_red.ml�����������������������������������������0000666�0000000�0000000�00000017244�13571573400�020525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Design let all_alarms () = let all_red_statuses = Red_statuses.get_all () in let all = List.map (fun (kinstr, ap, number) -> let kf_name = match kinstr with | Kstmt stmt -> Kernel_function.(get_name (find_englobing_kf stmt)) | Kglobal -> match ap with | Red_statuses.Alarm _ -> "<global>" | Red_statuses.Prop p -> match Property.get_kf p with | Some kf -> Kernel_function.get_name kf | None -> "<global>" in (kf_name, kinstr, ap, number) ) all_red_statuses in let kf_name_compare kfname = String.uncapitalize_ascii kfname in (* Sort by function names, then stmt, then alarms *) let cmp (k1, ki1, ap1, _) (k2, ki2, ap2, _) = let n = String.(compare (kf_name_compare k1) (kf_name_compare k2)) in if n <> 0 then n else let n = Cil_datatype.Kinstr.compare ki1 ki2 in if n <> 0 then n else Red_statuses.AlarmOrProp.compare ap1 ap2 in List.sort cmp all type red_alarm = { function_name:string; kind:string; acsl: string; alarm_or_prop: Red_statuses.alarm_or_property; (* Status here means 'final' status as emitted by all plugins. Currentlt not shown. *) ip: Property.t; callstacks: int; (* Number of callstacks in which the red alarm occured. *) } let get_predicate ca = match ca.annot_content with | AAssert (_, _, p) -> { p with pred_name = [] } | _ -> assert false let make_red_alarm function_name ki alarm callstacks = let kf, stmt = match ki with | Kstmt s -> Kernel_function.find_englobing_kf s, s | Kglobal -> (* Bug in initializer. Do the same thing as the kernel. *) let main = fst (Globals.entry_point ()) in let first_stmt = Kernel_function.find_first_stmt main in main, first_stmt in let ca, _ = Alarms.to_annot (Kstmt stmt) alarm in let ip = Property.ip_of_code_annot_single kf stmt ca in let kind = String.capitalize_ascii (Alarms.get_name alarm) in let p = get_predicate ca in let acsl = Format.asprintf "@[<hov>%a@]" Cil_datatype.Predicate.pretty p in let alarm_or_prop = Red_statuses.Alarm alarm in { function_name; ip; kind; alarm_or_prop; acsl; callstacks } let make_red_prop function_name ip callstacks = let kind = "property" (* TODO *) in let acsl = Format.asprintf "@[<hov>%a@]" Property.pretty ip in let alarm_or_prop = Red_statuses.Prop ip in { function_name; ip; kind; alarm_or_prop; acsl; callstacks } (* Semi generic-code for the model of Gtk list of red alarms *) type row = red_alarm type t = { widget: (int*row) Wtable.columns; append : row -> unit; clear : unit -> unit;} module Data = Indexer.Make( struct type t = int*row let compare (x,_) (y,_) = Transitioning.Stdlib.compare x y end) let append t message = t.append message let clear t = t.clear () let information = "This panel lists the properties which were invalid in at least one state \ of the Eva analysis. The consolidated status of these properties for \ all states may not be Invalid, but these properties should often be \ investigated first — either as potential true alarms, or to make the \ analysis more precise. \n\ It should be noted that this list depends on the state partitioning \ performed during the analysis." let build_list () = let model = object(self) val mutable m = Data.empty val mutable age = 0 method data = m method size = Data.size m method index i = Data.index i m method get i = Data.get i m method add i = age<-age+1; m <- Data.add (age,i) m;age,i method reload = age<-0; m <- Data.empty method coerce = (self:> (int*row) Wtable.listmodel) end in let w = new Wtable.list ~headers:true ~rules:true model#coerce in let c = w#add_column_empty (* for alignment *) in (* Sets an help icon with an explanatory tooltip to the right of the last column header. *) let help = GMisc.image ~stock:`HELP () in help#misc#set_tooltip_text information; c#set_alignment 1.; c#set_widget (Some help#coerce); let append e = w#insert_row (model#add e) in let clear () = (* Post a reload request before clearing. The current model is used to know how many rows must be deleted. *) w#reload ; in let r = {widget=w; append; clear} in (** End of generic code *) let props = [`YALIGN 0.0] in let _ = w#add_column_text ~title:"Function" props (function (_, {function_name}) -> [`TEXT function_name]) in let _ = w#add_column_text ~title:"Kind" props (function (_, {kind}) -> [`TEXT kind]) in let _ = w#add_column_text ~title:"Alarm" props (function (_, {acsl}) -> [`TEXT acsl]) in let _ = w#add_column_text ~title:"Nb contexts" props (function (_, {callstacks}) -> [`TEXT (string_of_int callstacks)]) in r (* Fill the table of red alarms from scratch *) let fill t = clear t; let alarms = all_alarms () in let aux (kf_name, ki, ap, cs) = match ap with | Red_statuses.Alarm a -> append t (make_red_alarm kf_name ki a cs) | Red_statuses.Prop ip -> append t (make_red_prop kf_name ip cs) in List.iter aux alarms let make_panel (main_ui:main_window_extension_points) = let w = build_list () in w.widget#on_click (fun (_, {ip}) _col -> (* Same code is found in Design, in the callback for the warning_manager *) ignore (main_ui#scroll (Pretty_source.PIP ip)); main_ui#view_original (Property.location ip) ); let tab_label = (GMisc.label ~text:"Red Alarms" ())#coerce in (* This panel is automatically refreshed *) Design.register_reset_extension (fun _ -> fill w); (* Fill the table when it is created. We are probably missing a call to 'reset' once the saved state is loaded through -load... *) let (_:GtkSignal.id) = w.widget#coerce#misc#connect#after#realize (fun () -> fill w) in (* Insert the page in the notebook, then return *) let n = main_ui#lower_notebook#append_page ~tab_label w.widget#coerce in main_ui#lower_notebook#get_nth_page n (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_red.mli����������������������������������������0000666�0000000�0000000�00000003610�13571573400�020666� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Extension of the GUI in order to display red alarms emitted during the value analysis *) (** Add a tab to the main GUI (for red alarms), and return its widget. *) val make_panel: Design.main_window_extension_points -> GObj.widget (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_types.ml���������������������������������������0000666�0000000�0000000�00000024604�13571573400�021115� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type gui_callstack = | GC_Filtered (* Some results have been hidden by a filter *) | GC_Consolidated (* Join of all possible callstacks *) | GC_Single of Value_types.callstack (* Only one callstack possible here *) | GC_Callstack of Value_types.callstack (* One of multiple callstacks *) let hash_gui_callstack = function | GC_Filtered -> 0 | GC_Consolidated -> 1 | GC_Single cs -> 2 * Value_types.Callstack.hash cs | GC_Callstack cs -> 4 * Value_types.Callstack.hash cs let compare_gui_callstack cs1 cs2 = match cs1, cs2 with | GC_Filtered, GC_Filtered -> 0 | GC_Consolidated, GC_Consolidated -> 0 | GC_Single cs1, GC_Single cs2 | GC_Callstack cs1, GC_Callstack cs2 -> Value_types.Callstack.compare cs1 cs2 | _, GC_Filtered -> 1 | GC_Filtered, _ -> -1 | _, GC_Consolidated -> 1 | GC_Consolidated, _ -> -1 | _, GC_Single _ -> 1 | GC_Single _, _ -> -1 module GCallstackMap = FCMap.Make(struct type t = gui_callstack let compare = compare_gui_callstack end) type gui_selection = | GS_TLVal of term | GS_LVal of lval | GS_AbsoluteMem | GS_Expr of exp | GS_Term of term | GS_Predicate of Cil_types.predicate let pretty_gui_selection fmt = function | GS_TLVal t | GS_Term t -> Printer.pp_term fmt t | GS_LVal l -> Printer.pp_lval fmt l | GS_AbsoluteMem -> Format.pp_print_string fmt "NULL" | GS_Expr e -> Printer.pp_exp fmt e | GS_Predicate p -> Printer.pp_predicate_node fmt p.pred_content let gui_selection_equal e1 e2 = match e1, e2 with | GS_TLVal t1, GS_TLVal t2 | GS_Term t1, GS_Term t2 -> Cil_datatype.Term.equal t1 t2 | GS_LVal lv1, GS_LVal lv2 -> Cil_datatype.Lval.equal lv1 lv2 | GS_AbsoluteMem, GS_AbsoluteMem -> true | GS_Expr e1, GS_Expr e2 -> Cil_datatype.Exp.equal e1 e2 | GS_Predicate p1, GS_Predicate p2 -> (* Cil_datatype.Predicate.equal not implemented *) p1.pred_content == p2.pred_content | (GS_TLVal _ | GS_LVal _ | GS_AbsoluteMem | GS_Expr _ | GS_Term _ | GS_Predicate _) , _ -> false type gui_offsetmap_res = | GO_Bottom (* Bottom memory state *) | GO_Empty (* Location with Empty validity (e.g. empty struct) *) | GO_Top (* State or size was Top *) | GO_InvalidLoc (* Location is always invalid *) | GO_Offsetmap of Cvalue.V_Offsetmap.t (* Normal result *) let equal_gui_offsetmap_res r1 r2 = match r1, r2 with | GO_Bottom, GO_Bottom -> true | GO_Empty, GO_Empty -> true | GO_Top, GO_Top -> true | GO_InvalidLoc, GO_InvalidLoc -> true | GO_Offsetmap o1, GO_Offsetmap o2 -> Cvalue.V_Offsetmap.equal o1 o2 | (GO_Bottom | GO_Empty | GO_Top | GO_InvalidLoc | GO_Offsetmap _), _ -> false let pretty_gui_offsetmap_res ?typ fmt r = match r with | GO_Bottom -> Format.pp_print_string fmt "<BOTTOM>" | GO_Empty -> Format.pp_print_string fmt "<EMPTY>" | GO_InvalidLoc -> Format.pp_print_string fmt "<INVALID LOCATION>" | GO_Top -> Format.pp_print_string fmt "<NO INFORMATION>" | GO_Offsetmap off -> Cvalue.V_Offsetmap.pretty_generic ?typ () fmt off; match typ with | None -> () | Some typ -> Eval_op.pretty_stitched_offsetmap fmt typ off (* Some cases are impossible because of conflicting sizes *) let join_gui_offsetmap_res r1 r2 = match r1, r2 with | GO_Top, _ | _, GO_Top -> GO_Top | GO_Bottom, x | x, GO_Bottom -> x | GO_InvalidLoc, x | x, GO_InvalidLoc -> x | GO_Empty, x | x, GO_Empty -> x | GO_Offsetmap o1, GO_Offsetmap o2 -> GO_Offsetmap (Cvalue.V_Offsetmap.join o1 o2) type 'a gui_res = | GR_Empty | GR_Offsm of gui_offsetmap_res * Cil_types.typ option | GR_Value of 'a Eval.flagged_value * Cil_types.typ option | GR_Status of Eval_terms.predicate_status | GR_Zone of Locations.Zone.t type 'a gui_after = | GA_After of 'a gui_res | GA_Bottom | GA_NA | GA_Unchanged module type S = sig type value val pretty_gui_res : Format.formatter -> value gui_res -> unit val equal_gui_res : value gui_res -> value gui_res -> bool val vars_in_gui_res : value gui_res -> Cil_types.varinfo list val pretty_gui_after : Format.formatter -> value gui_after -> unit val equal_gui_after : value gui_after -> value gui_after -> bool end module Make (V: Abstractions.Value) = struct let pretty_gui_res fmt = function | GR_Empty -> () | GR_Offsm (offsm, typ) -> pretty_gui_offsetmap_res ?typ fmt offsm | GR_Value (v, typ) -> Eval.Flagged_Value.pretty (V.pretty_typ typ) fmt v | GR_Status s -> Eval_terms.pretty_predicate_status fmt s | GR_Zone z -> Locations.Zone.pretty fmt z let equal_gui_res r1 r2 = match r1, r2 with | GR_Empty, GR_Empty -> true | GR_Offsm (o1, typ1), GR_Offsm (o2, typ2) -> equal_gui_offsetmap_res o1 o2 && Extlib.opt_equal Cil_datatype.Typ.equal typ1 typ2 | GR_Value (v1, typ1), GR_Value (v2, typ2) -> Eval.Flagged_Value.equal V.equal v1 v2 && Extlib.opt_equal Cil_datatype.Typ.equal typ1 typ2 | GR_Status s1, GR_Status s2 -> Extlib.compare_basic s1 s2 = 0 | GR_Zone z1, GR_Zone z2 -> Locations.Zone.equal z1 z2 | (GR_Empty | GR_Offsm _ | GR_Value _ | GR_Status _ | GR_Zone _), _ -> false let pretty_gui_after fmt = function | GA_After r -> Format.fprintf fmt "%a" pretty_gui_res r | GA_Bottom -> Format.fprintf fmt "BOTTOM" | GA_NA -> Format.fprintf fmt "n/a" | GA_Unchanged -> Format.fprintf fmt "unchanged" let equal_gui_after a1 a2 = match a1, a2 with | GA_NA, GA_NA | GA_Unchanged, GA_Unchanged | GA_Bottom, GA_Bottom -> true | GA_After r1, GA_After r2 -> equal_gui_res r1 r2 | (GA_After _ | GA_NA | GA_Unchanged | GA_Bottom), _ -> false let get_cvalue = V.get Main_values.CVal.key let from_cvalue v = V.set Main_values.CVal.key v V.top let var_of_base base acc = try let vi = Base.to_varinfo base in (* if it is a function, do not add it *) if Cil.isFunctionType vi.vtype then acc else vi :: acc with Base.Not_a_C_variable -> acc (* [vars_in_gui_res r] returns a list of non-function C variables present in [r]. *) let vars_in_gui_res r = let rev_vars = match r with | GR_Offsm (m_res, _) -> begin match m_res with | GO_Offsetmap m -> Cvalue.V_Offsetmap.fold_on_values (fun vu acc -> Cvalue.V.fold_bases var_of_base (Cvalue.V_Or_Uninitialized.get_v vu) acc ) m [] | _ -> [] end | GR_Value (value, _) -> begin match value.Eval.v with | `Bottom -> [] | `Value v -> match get_cvalue with | None -> [] | Some get -> Cvalue.V.fold_bases var_of_base (get v) [] end | GR_Zone z -> Locations.Zone.fold_bases var_of_base z [] | GR_Status _ | GR_Empty -> [] in (* inverse the list to preserve the order of the offsetmap *) List.rev rev_vars end type gui_loc = | GL_Stmt of kernel_function * stmt | GL_Pre of kernel_function (* pre-state of a function *) | GL_Post of kernel_function (* post-state of a function *) let gui_loc_equal lm1 lm2 = match lm1, lm2 with | GL_Stmt (_, s1), GL_Stmt (_, s2) -> Cil_datatype.Stmt.equal s1 s2 | GL_Pre kf1, GL_Pre kf2 | GL_Post kf1, GL_Post kf2 -> Kernel_function.equal kf1 kf2 | (GL_Stmt _ | GL_Pre _ | GL_Post _), _ -> false let gui_loc_loc = function | GL_Stmt (_, stmt) -> Cil_datatype.Stmt.loc stmt | GL_Pre kf | GL_Post kf -> Kernel_function.get_location kf let kf_of_gui_loc = function | GL_Stmt (kf, _) | GL_Pre kf | GL_Post kf -> kf (* This pretty-printer drops the toplevel kf, which is always the function in which we are pretty-printing the expression/term *) let pretty_callstack fmt cs = match cs with | [_, Kglobal] -> () | (_kf_cur, Kstmt callsite) :: q -> begin let rec aux callsite = function | (kf, callsite') :: q -> begin Format.fprintf fmt "%a (%a%t)" Kernel_function.pretty kf Cil_datatype.Location.pretty (Cil_datatype.Stmt.loc callsite) (fun fmt -> if Gui_parameters.debug_atleast 1 then Format.fprintf fmt ", %d" callsite.sid); match callsite' with | Kglobal -> () | Kstmt callsite' -> Format.fprintf fmt " ←@ "; aux callsite' q end | _ -> assert false in Format.fprintf fmt "@[<hv>%a" Value_types.Callstack.pretty_hash cs; aux callsite q; Format.fprintf fmt "@]" end | _ -> assert false (* This pretty-printer prints only the lists of the functions, not the locations *) let pretty_callstack_short fmt cs = match cs with | [_, Kglobal] -> () | (_kf_cur, Kstmt _callsite) :: q -> Format.fprintf fmt "%a" Value_types.Callstack.pretty_hash cs; Pretty_utils.pp_flowlist ~left:"@[" ~sep:" ←@ " ~right:"@]" (fun fmt (kf, _) -> Kernel_function.pretty fmt kf) fmt q | _ -> assert false (* Local Variables: compile-command: "make -C ../.." End: *) ����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/gui_types.mli��������������������������������������0000666�0000000�0000000�00000007753�13571573400�021274� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type gui_callstack = | GC_Filtered | GC_Consolidated | GC_Single of Value_types.callstack | GC_Callstack of Value_types.callstack val hash_gui_callstack : gui_callstack -> int val compare_gui_callstack : gui_callstack -> gui_callstack -> int module GCallstackMap : FCMap.S with type key = gui_callstack type gui_selection = | GS_TLVal of Cil_types.term | GS_LVal of Cil_types.lval | GS_AbsoluteMem | GS_Expr of Cil_types.exp | GS_Term of Cil_types.term | GS_Predicate of Cil_types.predicate val pretty_gui_selection : Format.formatter -> gui_selection -> unit val gui_selection_equal : gui_selection -> gui_selection -> bool type gui_offsetmap_res = | GO_Bottom | GO_Empty | GO_Top | GO_InvalidLoc | GO_Offsetmap of Cvalue.V_Offsetmap.t val equal_gui_offsetmap_res : gui_offsetmap_res -> gui_offsetmap_res -> bool val pretty_gui_offsetmap_res : ?typ:Cil_types.typ -> Format.formatter -> gui_offsetmap_res -> unit val join_gui_offsetmap_res : gui_offsetmap_res -> gui_offsetmap_res -> gui_offsetmap_res type gui_loc = | GL_Stmt of Cil_types.kernel_function * Cil_types.stmt | GL_Pre of Cil_types.kernel_function | GL_Post of Cil_types.kernel_function val gui_loc_equal : gui_loc -> gui_loc -> bool val gui_loc_loc : gui_loc -> Cil_types.location val kf_of_gui_loc : gui_loc -> Cil_types.kernel_function val pretty_callstack : Format.formatter -> Value_types.callstack -> unit val pretty_callstack_short : Format.formatter -> Value_types.callstack -> unit type 'a gui_res = | GR_Empty | GR_Offsm of gui_offsetmap_res * Cil_types.typ option | GR_Value of 'a Eval.flagged_value * Cil_types.typ option | GR_Status of Eval_terms.predicate_status | GR_Zone of Locations.Zone.t type 'a gui_after = | GA_After of 'a gui_res | GA_Bottom | GA_NA | GA_Unchanged module type S = sig type value val pretty_gui_res : Format.formatter -> value gui_res -> unit val equal_gui_res : value gui_res -> value gui_res -> bool val vars_in_gui_res : value gui_res -> Cil_types.varinfo list val pretty_gui_after : Format.formatter -> value gui_after -> unit val equal_gui_after : value gui_after -> value gui_after -> bool end (** The types below depend on the abstract values currently available. *) module Make (V : Abstractions.Value) : sig include S with type value := V.t val get_cvalue : (V.t -> Main_values.CVal.t) option val from_cvalue : Main_values.CVal.t -> V.t end ���������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/register_gui.ml������������������������������������0000666�0000000�0000000�00000072257�13571573400�021604� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Pretty_source open Gui_types type main_ui = Design.main_window_extension_points type menu = GMenu.menu GMenu.factory (* ------------------------ Eva panel and filetree -------------------------- *) module UsedVarState = Cil_state_builder.Varinfo_hashtbl (Datatype.Bool) (struct let size = 17 let name = "Value.Gui.UsedVarState" let dependencies = [ Db.Value.self ] (* [!Db.Inputs.self_external; !Db.Outputs.self_external] would be better dependencies, but this introduces a very problematic recursion between Value and Inout *) end) let used_var = UsedVarState.memo (fun var -> Mark_noresults.no_memoization_enabled () || try let f = fst (Globals.entry_point ()) in let inputs = !Db.Inputs.get_external f in let outputs = !Db.Outputs.get_external f in let b = Base.of_varinfo var in Locations.Zone.mem_base b inputs || Locations.Zone.mem_base b outputs with e -> Gui_parameters.error ~once:true "Exception during usability analysis of var %s: %s" var.vname (Printexc.to_string e); true (* No really sane value, so in doubt... *) ) (* Set when the callback is installed *) let hide_unused = ref (fun () -> false) let sync_filetree (filetree:Filetree.t) = if not (!hide_unused ()) then (Globals.Functions.iter (fun kf -> try let vi = Kernel_function.get_vi kf in let strikethrough = Db.Value.is_computed () && not (!Db.Value.is_called kf) in filetree#set_global_attribute ~strikethrough vi with Not_found -> ()); Globals.Vars.iter (fun vi _ -> if vi.vsource = true then filetree#set_global_attribute ~strikethrough:(Db.Value.is_computed () && not (used_var vi)) vi ); if not (filetree#flat_mode) then List.iter (fun file -> (* the display name removes the path *) let globals_state = filetree#get_file_globals file in filetree#set_file_attribute ~strikethrough:(Db.Value.is_computed () && List.for_all snd globals_state) file ) (Globals.FileIndex.get_files ()) ) else (* Some lines may have disappeared. We should reset the entire filetree, but the method reset of design.ml already does this. *) () let hide_unused_function_or_var g = !hide_unused () && Db.Value.is_computed () && (match g with | GFun ({svar = vi}, _) | GFunDecl (_, vi, _) -> let kf = Globals.Functions.get vi in not (!Db.Value.is_called kf) | GVarDecl (vi, _) | GVar (vi, _, _) -> not (used_var vi) | _ -> false ) let value_panel pack (main_ui:main_ui) = let box = GPack.vbox () in let run_button = GButton.button ~label:"Run" ~packing:(box#pack) () in let w = GPack.table ~packing:(box#pack ~expand:true ~fill:true) ~columns:2 () in let box_1_1 = GPack.hbox ~packing:(w#attach ~left:1 ~top:1) () in let precision_refresh = let tooltip = Value_parameters.Precision.parameter.Typed_parameter.help in Gtk_helper.on_int ~lower:(-1) ~upper:11 ~tooltip box_1_1 "precision (meta-option)" Value_parameters.Precision.get Value_parameters.Precision.set in let box_1_2 = GPack.hbox ~packing:(w#attach ~left:1 ~top:2) () in let slevel_refresh = let tooltip = Value_parameters.SemanticUnrollingLevel.parameter.Typed_parameter.help in Gtk_helper.on_int ~lower:0 ~upper:1000000 ~tooltip box_1_2 "slevel" Value_parameters.SemanticUnrollingLevel.get Value_parameters.SemanticUnrollingLevel.set in let box_1_3 = GPack.hbox ~packing:(w#attach ~left:1 ~top:3) () in let validator s = not (Kernel_function.Set.is_empty (Parameter_customize.get_c_ified_functions s)) in let main_refresh = Gtk_helper.on_string ~tooltip:Kernel.MainFunction.parameter.Typed_parameter.help ~validator box_1_3 "main" Kernel.MainFunction.get Kernel.MainFunction.set in let refresh () = precision_refresh (); slevel_refresh (); main_refresh() in ignore (run_button#connect#pressed (fun () -> main_ui#protect ~cancelable:true (fun () -> refresh (); !Db.Value.compute (); main_ui#reset ()); )); pack box; "Eva", box#coerce, Some refresh (* ---------------------------- Highlighter --------------------------------- *) let active_highlighter buffer localizable ~start ~stop = let open Gtk_helper in let buffer = buffer#buffer in (* highlight dead code areas, non-terminating calls, and degeneration points if Value has run.*) if Db.Value.is_computed () then match localizable with | PStmt (kf, stmt) -> begin let degenerate = try Some ( if Value_util.DegenerationPoints.find stmt then (make_tag buffer ~name:"degeneration" [`BACKGROUND "orange"]) else (make_tag buffer ~name:"unpropagated" [`BACKGROUND "yellow"]) ) with Not_found -> None in match degenerate with | Some color_area -> apply_tag buffer color_area start stop | None -> if Gui_eval.results_kf_computed kf then begin let csf = Gui_callstacks_filters.focused_callstacks () in if Gui_callstacks_filters.is_reachable_stmt csf stmt then begin if Gui_callstacks_filters.is_non_terminating_instr csf stmt then let non_terminating = Gtk_helper.make_tag buffer ~name:"value_non_terminating" [`BACKGROUND "tomato"] in apply_tag buffer non_terminating (stop-1) stop end else let dead_code_area = make_tag buffer "deadcode" [`BACKGROUND "tomato";`STYLE `ITALIC] in apply_tag buffer dead_code_area start stop end end | _ -> () (* ------------------------ Responses to selections ------------------------- *) let display_eval_errors (main_ui:main_ui) l = let pp = function | Eval_terms.LogicEvalError ee -> main_ui#pretty_information "Cannot evaluate: %a@." Eval_terms.pretty_logic_evaluation_error ee | e -> main_ui#pretty_information "Unknown error during evaluation (%s)@." (Printexc.to_string e) in List.iter pp l let pretty_kf_escaped kf = Pretty_utils.(escape_underscores (to_string Kernel_function.pretty kf)) (* popup a menu to jump the definitions of the given functions *) let menu_go_to_fun_definition (main_ui:main_ui) (popup_factory:menu) funs = let aux kf = try let g = Kernel_function.get_global kf in ignore (popup_factory#add_item ("Go to definition of " ^ pretty_kf_escaped kf ^ " (indirect)") ~callback:(fun () -> main_ui#select_or_display_global g)) with Not_found -> () in List.iter aux funs let gui_compute_values (main_ui:main_ui) = if not (Db.Value.is_computed ()) then main_ui#launcher () let cleaned_outputs kf s = let outs = Db.Outputs.kinstr (Kstmt s) in let accept = Callgraph.Uses.accept_base ~with_formals:true ~with_locals:true kf in let filter = Locations.Zone.filter_base accept in Extlib.opt_map filter outs let pretty_stmt_info (main_ui:main_ui) kf stmt = (* Is it an accessible statement ? *) if Db.Value.is_reachable_stmt stmt then begin if Value_results.is_non_terminating_instr stmt then match stmt.skind with | Instr (Call (_, _, _, _) | Local_init (_, ConsInit _, _)) -> (* This is not 100% accurate: the instr can also fail when storing the result in [lvopt] *) main_ui#pretty_information "This call never terminates.@." | Instr _ -> main_ui#pretty_information "This instruction always fail.@." | _ -> () else (* Out for this statement *) let outs = cleaned_outputs kf stmt in match outs with | Some outs -> main_ui#pretty_information "Modifies @[<hov>%a@]@." Db.Outputs.pretty outs | _ -> () end else main_ui#pretty_information "This code is dead@." type term_or_pred = Term | Pred let pp_term_or_pred fmt = function | Term -> Format.pp_print_string fmt "term" | Pred -> Format.pp_print_string fmt "predicate" let last_evaluate_acsl_request = ref "" (* ------- Make the responses from the abstractions used in analysis ------- *) (** Responses of the GUI to user actions. Built by the Select functor. *) module type Responses = sig val eval_acsl_term_pred: main_ui -> gui_loc -> term_or_pred -> unit -> unit val left_click_values_computed: main_ui -> localizable -> unit val right_click_values_computed: main_ui -> menu -> localizable -> unit end (** A "no response" module, when the GUI has not been built. *) module No_Response = struct let eval_acsl_term_pred _ _ _ () = () let left_click_values_computed _ _ = () let right_click_values_computed _ _ _ = () end (* Module argument of the Select functor: it is the module resulting from Gui_eval.A, plus the function display_at_loc coming from gui_callstacks_manager. *) module type Eval = sig include Gui_eval.S val display_data_by_callstack: Analysis.Val.t Gui_callstacks_manager.display_data_by_callstack end (* Builds the responses of the GUI to user actions. *) module Select (Eval: Eval) = struct let select_loc main_ui ev loc v = let data, errors = Eval.make_data_all_callstacks ev loc v in display_eval_errors main_ui errors; let selection = ev.Eval.expr_to_gui_selection v in Eval.display_data_by_callstack loc selection data let is_scalar typ = match Cil.unrollType typ with | TInt _ | TEnum _ | TPtr _ | TFloat _ -> true | _ -> false let select_lv main_ui loc lv = if is_scalar (Cil.typeOfLval lv) then select_loc main_ui Eval.lval_ev loc lv else select_loc main_ui Eval.lval_as_offsm_ev loc lv let select_null main_ui loc = select_loc main_ui Eval.null_ev loc () let select_exp main_ui loc exp = select_loc main_ui Eval.exp_ev loc exp let select_term main_ui loc t = select_loc main_ui (Eval.term_ev loc) loc t let select_tlv main_ui loc tlv = select_loc main_ui (Eval.tlval_ev loc) loc tlv let select_predicate main_ui loc p = select_loc main_ui (Eval.predicate_ev loc) loc p let select_predicate_with_red main_ui loc a = select_loc main_ui (Eval.predicate_with_red loc) loc a (* Evaluate the user-supplied term contained in the string [txt] *) let eval_user_term_predicate (main_ui:main_ui) loc tp txt = let kf = kf_of_gui_loc loc in try Gui_callstacks_manager.focus_selection_tab (); let env = Gui_eval.gui_loc_logic_env loc in match tp with | Term -> begin if txt = "NULL" then select_null main_ui loc else let term = !Db.Properties.Interp.term ~env kf txt in match term.term_node with | TLval _ | TStartOf _ -> select_tlv main_ui loc term | _ -> select_term main_ui loc term end | Pred -> let pred = !Db.Properties.Interp.predicate ~env kf txt in select_predicate main_ui loc pred with | Logic_interp.Error (_, mess) -> main_ui#error "Invalid %a: %s" pp_term_or_pred tp mess | Parsing.Parse_error -> main_ui#error "Invalid %a: Parse error" pp_term_or_pred tp | Eval_terms.LogicEvalError ee -> main_ui#error "Cannot evaluate %a (%a)" pp_term_or_pred tp Eval_terms.pretty_logic_evaluation_error ee | Log.AbortFatal s when s = "kernel" -> let bt = Printexc.get_backtrace () in (* possibly a typing error, avoid an error message too drastic *) main_ui#error "Invalid %a (see the 'Console' tab for more details)." pp_term_or_pred tp; (* print the backtrace only if in debugging mode *) Gui_parameters.debug "%s" bt | e -> main_ui#error "Invalid %a: %s" pp_term_or_pred tp (Cmdline.protect e) (* Opens a modal dialog asking for an ACSL expression and evaluates it at location [loc]. *) let eval_acsl_term_pred main_ui loc tp () = let txt = Gtk_helper.input_string ~title:"Evaluate" ~parent:main_ui#main_window ~text:!last_evaluate_acsl_request (Format.asprintf " Enter an ACSL %a to evaluate " pp_term_or_pred tp) (* the spaces at beginning and end should not be necessary but are the quickest fix for an aesthetic GTK problem *) in match txt with | None -> () | Some txt -> last_evaluate_acsl_request:=txt; eval_user_term_predicate main_ui loc tp txt (* popup a menu to jump to the definitions of the callers *) let menu_go_to_callers (main_ui:main_ui) (menu:menu) csf kf = try let aux (menu:menu) (kf, call_sites) = let nb_sites = List.length call_sites in let label = "Go to caller " ^ pretty_kf_escaped kf in let label = if nb_sites > 1 then label ^ " (" ^ (string_of_int nb_sites) ^ " call sites)" else label in let callback () = let g = Kernel_function.get_global kf in main_ui#select_or_display_global g; (* We put the cursor in the first call site and add the others (if any) to the forward history. *) match call_sites with | first_call_site :: rest -> main_ui#view_stmt first_call_site; let other_call_sites = List.map (fun call -> let kf = Kernel_function.find_englobing_kf call in History.Localizable (PStmt (kf, call)) ) rest in History.set_forward other_call_sites | [] -> assert false (* list was not empty *) in ignore (menu#add_item ~callback label) in let aux_focus (acc_focus, acc_unfocus) (kf, call_sites) = let focus, unfocus = List.partition (Gui_callstacks_filters.callsite_matches csf) call_sites in (if focus <> [] then (kf, focus) :: acc_focus else acc_focus), (if unfocus <> [] then (kf, unfocus) :: acc_unfocus else acc_unfocus) in let focused, unfocused = List.fold_left aux_focus ([], []) (!Db.Value.callers kf) in List.iter (aux menu) focused; if unfocused <> [] then let submenu = GMenu.menu () in let item = GMenu.menu_item ~label:"Callers in unselected callstack(s)" () in item#set_submenu submenu; menu#menu#add item; let factory = new GMenu.factory submenu in List.iter (aux factory) unfocused with Not_found -> () (* Actions to perform when the user has left-clicked, and Value is computed. Maintain synchronized with [can_eval_acsl_expr_selector] later in this file.*) let left_click_values_computed main_ui localizable = try let open Property in match localizable with | PStmt (kf,stmt) -> if Gui_eval.results_kf_computed kf then pretty_stmt_info main_ui kf stmt | PLval (Some kf, Kstmt stmt,lv) -> if not (Cil.isFunctionType (Cil.typeOfLval lv)) then select_lv main_ui (GL_Stmt (kf, stmt)) lv | PLval (Some kf, Kglobal, lv) -> (* see can_eval_acsl_expr_selector *) if not (Cil.isFunctionType (Cil.typeOfLval lv)) then select_lv main_ui (GL_Pre kf) lv | PExp (Some kf, Kstmt stmt,e) -> select_exp main_ui (GL_Stmt (kf, stmt)) e | PTermLval (Some kf, Kstmt stmt, _, tlv) -> let term = Logic_const.term (TLval tlv) (Cil.typeOfTermLval tlv) in select_tlv main_ui (GL_Stmt (kf, stmt)) term | PTermLval (Some kf, Kglobal, ip, tlv) -> begin match Gui_eval.classify_pre_post kf ip with | Some loc -> let term = Logic_const.term (TLval tlv) (Cil.typeOfTermLval tlv) in select_tlv main_ui loc term | None -> () end | PVDecl (Some kf, _, vi) when vi.vformal -> let lv = (Var vi, NoOffset) in select_lv main_ui (GL_Pre kf) lv | PVDecl (Some kf, Kstmt stmt, vi) -> let lv = (Var vi, NoOffset) in select_lv main_ui (GL_Stmt (kf, stmt)) lv | PIP (IPCodeAnnot {ica_kf = kf; ica_stmt = stmt; ica_ca = {annot_content = AAssert (_, _, p) | AInvariant (_, true, p)} as ca } as ip) -> begin let loc = GL_Stmt (kf, stmt) in let alarm_or_property = match Alarms.find ca with | None -> Red_statuses.Prop ip | Some a -> Red_statuses.Alarm a in select_predicate_with_red main_ui loc (alarm_or_property, p) end; | PIP (IPPredicate {ip_kf=kf; ip_kinstr=Kglobal; ip_pred=p} as ip) -> begin match Gui_eval.classify_pre_post kf ip with | None -> () | Some loc -> select_predicate_with_red main_ui loc (Red_statuses.Prop ip, Logic_const.pred_of_id_pred p) end | PIP (IPPropertyInstance {ii_kf=kf;ii_stmt=stmt; ii_pred=Some pred;ii_ip=ip}) -> let loc = GL_Stmt (kf, stmt) in select_predicate_with_red main_ui loc (Red_statuses.Prop ip, Logic_const.pred_of_id_pred pred) | PLval (None , _, _) | PExp ((_,Kglobal,_) | (None, Kstmt _, _)) | PTermLval (None, _, _, _)-> () | PVDecl (_kf,_ki,_vi) -> () | PGlobal _ | PIP _ | PStmtStart _ -> () with | Eval_terms.LogicEvalError ee -> main_ui#pretty_information "Cannot evaluate term: %a@." Eval_terms.pretty_logic_evaluation_error ee (* Actions to perform when the user has right-clicked, and Value is computed *) let right_click_values_computed main_ui menu localizable = match localizable with | PVDecl (Some kf, _, _) -> let filter = Gui_callstacks_filters.focused_callstacks () in menu_go_to_callers main_ui menu filter kf | PStmt (kf,stmt) -> if Gui_eval.results_kf_computed kf then ignore (menu#add_item "_Evaluate ACSL term" ~callback:(eval_acsl_term_pred main_ui (GL_Stmt (kf, stmt)) Term)) | PLval (_kfopt, ki, lv) -> let ty = Cil.typeOfLval lv in (* Do special actions for functions *) begin (match lv with | Var _,NoOffset when Cil.isFunctionType ty -> () (* direct calls are handled by [Design]. *) | Mem _, NoOffset when Cil.isFunctionType ty -> begin (* Function pointers *) (* get the list of functions in the values *) let e = Value_util.lval_to_exp lv in match Eval.Analysis.get_kinstr_state ~after:false ki with | `Bottom -> () | `Value state -> let funs, _ = Eval.Analysis.eval_function_exp state e in match funs with | `Bottom -> () | `Value funs -> menu_go_to_fun_definition main_ui menu funs end | _ -> () ) end | PStmtStart _ | PVDecl (None, _, _) | PExp _ | PTermLval _ | PGlobal _ | PIP _ -> () let _right_click_value_not_computed (main_ui:main_ui) (menu:menu) localizable = match localizable with | PVDecl (_,_,_) -> begin ignore (menu#add_item "Compute callers" ~callback:(fun () -> (gui_compute_values main_ui))) end | _ -> () end (* ----------------- Reference to responses, and use it -------------------- *) (* This reference contains the responses of the GUI built by the Select functor. It is updated each time the abstractions used in Eva are changed. *) let responses_ref = ref (module No_Response: Responses) let to_do_on_select (menu:menu) (main_ui:main_ui) ~button selected = let module Responses = (val !responses_ref) in if Db.Value.is_computed () then if button = 1 then Responses.left_click_values_computed main_ui selected else if button = 3 then Responses.right_click_values_computed main_ui menu selected (* Find a location in which to evaluate things, when the given block is selected. *) let find_loc kf fdec block = if block == fdec.sbody then Some (GL_Pre kf) else match block.bstmts with | [] -> None | s :: _ -> Some (GL_Stmt (kf, s)) let add_keybord_shortcut_evaluate main_ui = (* The currently selected statement is stored to enable a keyboard shortcut to activate it. [None] means that there is no selection or the selected element is not part of a statement. *) let selected_loc_for_acsl = ref None in (* If we happen to go to another project that happens to share vids with the previous one, comparing the new loc with the cached one might lead to a crash dialog when the kernel will detect that we're trying to use two distinct globals with the same id. Thus, changing project will clear the selection once and for all. *) let () = Project.register_after_set_current_hook ~user_only:false (fun _ -> selected_loc_for_acsl := None) in (* This function must be maintained synchronized with [left_click_values_computed] above. *) let can_eval_acsl_expr_selector _menu _main ~button:_ selected = (* We add a selector to enable a keyboard shortcut for evaluating ACSL expressions. This selector listens to modification events and updates selected_loc_for_acsl to the stmt of the selected element. *) let clear () = Gui_callstacks_manager.clear_default () in let select new_loc = begin match new_loc, !selected_loc_for_acsl with | None, None -> () | None, Some _ | Some _, None -> clear () | Some new_loc, Some old_loc -> if not (gui_loc_equal new_loc old_loc) then clear (); end; selected_loc_for_acsl := new_loc in match selected with | PStmt (kf, stmt) | PLval (Some kf, Kstmt stmt, _) | PExp (Some kf, Kstmt stmt, _) | PTermLval (Some kf, Kstmt stmt, _, _) -> if Gui_eval.results_kf_computed kf then select (Some (GL_Stmt (kf, stmt))) else select None | PLval (Some kf, Kglobal, _) -> (* We are either on a formal, or on the declaration of the variables of [kf] at body scope. *) if Gui_eval.results_kf_computed kf then select (Some (GL_Pre kf)) else select None | PTermLval (Some kf, Kglobal, ip, _) -> select (Gui_eval.classify_pre_post kf ip) | PVDecl (Some kf, _, vi) when vi.vformal -> select (Some (GL_Pre kf)) | PVDecl (Some kf, ki, vi) when not (vi.vformal || vi.vglob) (* local *) -> begin match ki with | Kstmt stmt -> (* local with initializers *) select (Some (GL_Stmt (kf, stmt))) | Kglobal -> (* no initializer. Find the declaration block *) (* Notice that Pretty_source focuses on the statement containing the block itself most of the time. The case handled here happens only when you directly select the declaration of a variable, between the type and the name *) let fdec = Kernel_function.get_definition kf in let bl = Ast_info.block_of_local fdec vi in select (find_loc kf fdec bl) end | PIP (Property.(IPCodeAnnot {ica_kf = kf; ica_stmt = stmt; ica_ca = {annot_content = AAssert _ | AInvariant (_, true, _)}})) -> select (Some (GL_Stmt (kf, stmt))) | PIP (Property.(IPPredicate {ip_kf; ip_kinstr=Kglobal} as ip)) -> select (Gui_eval.classify_pre_post ip_kf ip) | _ -> select None in main_ui#register_source_selector can_eval_acsl_expr_selector; (* We add a keyboard shortcut (Ctrl+E) to open the "Evaluate ACSL expression" popup. This only works if the current selection is on a statement, otherwise it does nothing. *) let accel_group = GtkData.AccelGroup.create () in let register_accel modi kind = GtkData.AccelGroup.connect accel_group ~key:GdkKeysyms._E ~modi ~callback:(fun _ -> match !selected_loc_for_acsl with | None -> () | Some loc -> let module Responses = (val !responses_ref) in Responses.eval_acsl_term_pred main_ui loc kind () ); in register_accel [`CONTROL] Term; register_accel [`CONTROL; `SHIFT] Pred; main_ui#main_window#add_accel_group accel_group ;; (* ----------------------------- Build the GUI ------------------------------ *) (* Resets the GUI parts that depend on the abstractions used for the Eva analysis. This needs to be done each time the abstractions are changed. The module [A] is the current analysis module; it contains the abstractions used by Eva for the current analysis. *) let reset (main_ui:main_ui) (module A: Analysis.S) = (* Types of the GUI depending on the abstractions used for the analysis. *) let module Gui_Types = Gui_types.Make (A.Val) in (* Evaluation functions for the GUI. *) let module Gui_Eval = Gui_eval.Make (A) in (* Mandatory: registers the functions that perform an evaluation by callstack. *) Gui_callstacks_filters.register_to_zone_functions (module Gui_Eval); (* Input module for building the callstack manager. *) let module Input = struct type value = A.Val.t include Gui_Types let make_data_for_lvalue lval loc = fst (Gui_Eval.make_data_all_callstacks Gui_Eval.lval_as_offsm_ev loc lval) end in (* Builds the "Values" panel on the lower notebook of the GUI. The resulting function is used to display data by callstacks on the user demand. *) let display_data_by_callstack = Gui_callstacks_manager.create main_ui (module Input) in (* Input module for builting the responses of the GUI. *) let module Eval : Eval = struct include Gui_Eval let display_data_by_callstack = display_data_by_callstack end in let module Responses = Select (Eval) in (* Stores the Responses module as a reference. *) responses_ref := (module Responses) (* Checkbox to display/hide the list of red alarms. [panel] is the panel 'Red alarms' created in {!Red}. [box] is the vbox in which the checkbox will be added. *) let red_checkbox (panel: GObj.widget) (box: GPack.box) = let tooltip = "Panel listing the properties which were invalid for some states" in let chk = new Widget.checkbox ~label:"Show list of red alarms" ~tooltip () in box#pack chk#coerce; let key_red = "Value.show_red" in chk#connect (fun b -> Gtk_helper.Configuration.(set key_red (ConfBool b)); if b then panel#misc#show () else panel#misc#hide () ); chk#set (Gtk_helper.Configuration.find_bool ~default:true key_red); ;; let main (main_ui:main_ui) = (* Hide unused functions and variables. Must be registered only once *) let hide, _filter_menu = main_ui#file_tree#add_global_filter ~text:"Analyzed by Value only" ~key:"value_hide_unused" hide_unused_function_or_var in hide_unused := hide; main_ui#file_tree#register_reset_extension sync_filetree; (* Very first display, we need to do a few things by hand *) if !hide_unused () then main_ui#file_tree#reset () else sync_filetree main_ui#file_tree; reset main_ui (Analysis.current_analyzer ()); Analysis.register_hook (reset main_ui); Design.register_reset_extension (fun _ -> Gui_callstacks_manager.reset ()); main_ui#register_source_selector (to_do_on_select ); main_ui#register_source_highlighter active_highlighter; let panel_red = Gui_red.make_panel main_ui in main_ui#register_panel (value_panel (red_checkbox panel_red)); add_keybord_shortcut_evaluate main_ui; ;; let () = Design.register_extension main ;; (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/gui_files/register_gui.mli�����������������������������������0000666�0000000�0000000�00000003372�13571573400�021745� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Extension of the GUI in order to support the value analysis. No function is exported. *) (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/legacy/������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016043� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/legacy/eval_annots.ml����������������������������������������0000666�0000000�0000000�00000026122�13571573400�020711� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval_terms let has_requires spec = let behav_has_requires b = b.b_requires <> [] in List.exists behav_has_requires spec.spec_behavior let code_annotation_text ca = match ca.annot_content with | AAssert (_, Assert, _) -> "assertion" | AAssert (_, Check, _) -> "check" | AInvariant _ -> "loop invariant" | APragma _ | AVariant _ | AAssigns _ | AAllocation _ | AStmtSpec _ | AExtended _ -> assert false (* currently not treated by Value *) (* location of the given code annotation. If unknown, use the location of the statement instead. *) let code_annotation_loc ca stmt = match Cil_datatype.Code_annotation.loc ca with | Some loc when not (Cil_datatype.Location.(equal loc unknown)) -> loc | _ -> Cil_datatype.Stmt.loc stmt let mark_unreachable () = let mark ppt = if not (Property_status.automatically_proven ppt) then begin Value_parameters.debug "Marking property %a as dead" Description.pp_property ppt; let emit = Property_status.emit ~distinct:false Value_util.emitter ~hyps:[] in let reach_p = Property.ip_reachable_ppt ppt in emit ppt Property_status.True; emit reach_p Property_status.False_and_reachable end in (* Mark standard code annotations *) let do_code_annot stmt _emit ca = if not (Db.Value.is_reachable_stmt stmt) then begin let kf = Kernel_function.find_englobing_kf stmt in let ppts = Property.ip_of_code_annot kf stmt ca in List.iter mark ppts; end in (* Mark preconditions of dead calls *) let unreach = object inherit Visitor.frama_c_inplace method! vstmt_aux stmt = if not (Db.Value.is_reachable_stmt stmt) then begin let mark_status kf = (* Do not mark preconditions as dead if they are not analyzed in non-dead code. Otherwise, the consolidation does strange things. *) if not (Value_util.skip_specifications kf) || Builtins.find_builtin_override kf <> None then begin (* Setup all precondition statuses for [kf]: maybe it has never been called anywhere. *) Statuses_by_call.setup_all_preconditions_proxies kf; (* Now mark the statuses at this particular statement as dead*) let preconds = Statuses_by_call.all_call_preconditions_at ~warn_missing:false kf stmt in List.iter (fun (_, p) -> mark p) preconds end in match stmt.skind with | Instr (Call (_, e, _, _)) -> Extlib.may mark_status (Kernel_function.get_called e) | Instr(Local_init(_, ConsInit(f,_,_),_)) -> mark_status (Globals.Functions.get f) | _ -> () end; Cil.DoChildren method! vinst _ = Cil.SkipChildren end in Annotations.iter_all_code_annot do_code_annot; Visitor.visitFramacFile unreach (Ast.get ()) let mark_rte () = let _, mem, _ = !Db.RteGen.get_memAccess_status () in let _, arith, _ = !Db.RteGen.get_divMod_status () in let _, signed_ovf, _ = !Db.RteGen.get_signedOv_status () in let _, unsigned_ovf, _ = !Db.RteGen.get_unsignedOv_status () in let _, signed_downcast, _ = !Db.RteGen.get_signed_downCast_status () in let _, unsigned_downcast, _ = !Db.RteGen.get_unsignedDownCast_status () in let _, pointer_call, _ = !Db.RteGen.get_pointerCall_status () in let _, float_to_int, _ = !Db.RteGen.get_float_to_int_status () in let _, finite_float, _ = !Db.RteGen.get_finite_float_status () in let b_signed_ovf = Kernel.SignedOverflow.get () in let b_unsigned_ovf = Kernel.UnsignedOverflow.get () in let b_signed_downcast = Kernel.SignedDowncast.get () in let b_unsigned_downcast = Kernel.UnsignedDowncast.get () in Globals.Functions.iter (fun kf -> if !Db.Value.is_called kf then ( mem kf true; arith kf true; pointer_call kf true; if b_signed_ovf then signed_ovf kf true; if b_unsigned_ovf then unsigned_ovf kf true; if b_signed_downcast then signed_downcast kf true; if b_unsigned_downcast then unsigned_downcast kf true; float_to_int kf true; finite_float kf true; ) ) let c_labels kf cs = if !Db.Value.use_spec_instead_of_definition kf then Cil_datatype.Logic_label.Map.empty else let fdec = Kernel_function.get_definition kf in let aux acc stmt = if stmt.labels != [] then try let hstate = Db.Value.Table_By_Callstack.find stmt in let state = Value_types.Callstack.Hashtbl.find hstate cs in Cil_datatype.Logic_label.Map.add (StmtLabel (ref stmt)) state acc with Not_found -> acc else acc in List.fold_left aux Cil_datatype.Logic_label.Map.empty fdec.sallstmts (* Evaluates [p] at [stmt], using per callstack states for maximum precision. *) (* TODO: we can probably factor some code with the GUI *) let eval_by_callstack kf stmt p = (* This is actually irrelevant for alarms: they never use \old *) let pre = Db.Value.get_initial_state kf in let aux_callstack callstack state acc_status = let c_labels = c_labels kf callstack in let env = Eval_terms.env_annot ~c_labels ~pre ~here:state () in let status = Eval_terms.eval_predicate env p in let join = Eval_terms.join_predicate_status in match Bottom.join join acc_status (`Value status) with | `Value Unknown -> raise Exit (* shortcut *) | _ as r -> r in match Db.Value.get_stmt_state_callstack ~after:false stmt with | None -> (* dead; ignore, those will be marked 'unreachable' elsewhere *) Unknown | Some states -> try match Value_types.Callstack.Hashtbl.fold aux_callstack states `Bottom with | `Bottom -> Eval_terms.Unknown (* probably never reached *) | `Value status -> status with Exit -> Eval_terms.Unknown (* Detection of terms \at(_, L) where L is a C label *) class contains_c_at = object inherit Visitor.frama_c_inplace method! vterm t = match t.term_node with | Tat (_, StmtLabel _) -> raise Exit | _ -> Cil.DoChildren end let contains_c_at ca = let vis = new contains_c_at in let loc = Cil.CurrentLoc.get () in let r = try ignore (Visitor.visitFramacCodeAnnotation vis ca); false with Exit -> true in Cil.CurrentLoc.set loc; r (* Re-evaluate all alarms, and see if we can put a 'green' or 'red' status, which would be more precise than those we have emitted during the current analysis. *) let mark_green_and_red () = let do_code_annot stmt _e ca = (* We reevaluate only alarms, in the hope that we can emit an 'invalid' status, or user assertions that mention a C label. The latter are currently skipped during evaluation. *) if contains_c_at ca || (Alarms.find ca <> None) then match ca.annot_content with | AAssert (_, _, p) | AInvariant (_, true, p) -> let loc = code_annotation_loc ca stmt in Cil.CurrentLoc.set loc; let kf = Kernel_function.find_englobing_kf stmt in let ip = Property.ip_of_code_annot_single kf stmt ca in (* This status is exact: we are _not_ refining the statuses previously emitted, but writing a synthetic more precise status. *) let distinct = false in let emit status = let status, text_status = match status with | `True -> Property_status.True, "valid" | `False -> Property_status.False_if_reachable, "invalid" in Property_status.emit ~distinct Value_util.emitter ~hyps:[] ip status; let source = fst loc in let text_ca = code_annotation_text ca in Value_parameters.result ~once:true ~source "%s%a got final status %s." text_ca Description.pp_named p text_status; in begin match eval_by_callstack kf stmt p with | Eval_terms.False -> emit `False | Eval_terms.True -> (* Should not happen for an alarm that has been emitted during this analysis. However, this is possible for an 'old' alarm. *) emit `True | Eval_terms.Unknown -> () end | AInvariant (_, false, _) | AStmtSpec _ | AVariant _ | AAssigns _ | AAllocation _ | APragma _ | AExtended _ -> () in Annotations.iter_all_code_annot do_code_annot (* Special evaluation for the alarms on the very first statement of the main function. We put 'Invalid' statuses on them using this function. *) let mark_invalid_initializers () = let kf = fst (Globals.entry_point ()) in let first_stmt = Kernel_function.find_first_stmt kf in let do_code_annot _e ca = match Alarms.find ca with (* We only check alarms *) | None -> () | Some _ -> match ca.annot_content with | AAssert (_, _, p) -> let ip = Property.ip_of_code_annot_single kf first_stmt ca in (* Evaluate in a fully empty state. Only predicates that do not depend on the memory will result in 'False' *) let bot = Cvalue.Model.bottom in let env = Eval_terms.env_annot ~pre:bot ~here:bot () in begin match Eval_terms.eval_predicate env p with | True | Unknown -> () | False -> let status = Property_status.False_and_reachable in let distinct = false (* see comment in mark_green_and_red above *) in Red_statuses.add_red_property Kglobal ip; Property_status.emit ~distinct Value_util.emitter ~hyps:[] ip status; end | _ -> () in Annotations.iter_code_annot do_code_annot first_stmt (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/legacy/eval_annots.mli���������������������������������������0000666�0000000�0000000�00000003546�13571573400�021067� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types val has_requires: spec -> bool val mark_invalid_initializers: unit -> unit val mark_unreachable: unit -> unit val mark_green_and_red: unit -> unit val mark_rte: unit -> unit val c_labels: kernel_function -> Value_types.callstack -> Eval_terms.labels_states ����������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/legacy/eval_op.ml��������������������������������������������0000666�0000000�0000000�00000024574�13571573400�020036� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cvalue open Cil_types open Abstract_interp let offsetmap_of_v ~typ v = let size = Int.of_int (Cil.bitsSizeOf typ) in let v = V_Or_Uninitialized.initialized v in V_Offsetmap.create ~size v ~size_v:size let offsetmap_of_loc location state = let aux loc offsm_res = let open Locations in let size = Int_Base.project loc.size in let copy = Cvalue.Model.copy_offsetmap loc.loc size state in Bottom.join Cvalue.V_Offsetmap.join copy offsm_res in Precise_locs.fold aux location `Bottom let wrap_int i = Some (offsetmap_of_v ~typ:Cil.intType i) let wrap_ptr p = Some (offsetmap_of_v ~typ:Cil.intPtrType p) let wrap_double d = Some (offsetmap_of_v ~typ:Cil.doubleType d) let wrap_float d = Some (offsetmap_of_v ~typ:Cil.floatType d) let wrap_size_t i = Some (offsetmap_of_v ~typ:(Cil.theMachine.Cil.typeOfSizeOf) i) let wrap_long_long i = Some (offsetmap_of_v ~typ:Cil.longLongType i) let v_uninit_of_offsetmap ~typ offsm = let size = Eval_typ.sizeof_lval_typ typ in match size with | Int_Base.Top -> V_Offsetmap.find_imprecise_everywhere offsm | Int_Base.Value size -> let validity = Base.validity_from_size size in let offsets = Ival.zero in V_Offsetmap.find ~validity ~conflate_bottom:false ~offsets ~size offsm let backward_comp_int_left positive comp l r = if (Value_parameters.UndefinedPointerComparisonPropagateAll.get()) && not (Cvalue_forward.are_comparable comp l r) then l else let binop = if positive then comp else Comp.inv comp in V.backward_comp_int_left binop l r let backward_comp_float_left fkind positive comp l r = let back = if positive then V.backward_comp_float_left_true else V.backward_comp_float_left_false in back comp fkind l r let backward_comp_left_from_type t = match Cil.unrollType t with | TInt _ | TEnum _ | TPtr _ -> backward_comp_int_left | TFloat (fk, _) -> backward_comp_float_left (Fval.kind fk) | _ -> (fun _ _ v _ -> v) (* should never occur anyway *) exception Unchanged exception Reduce_to_bottom let reduce_by_initialized_defined f loc state = try let base, offset = Locations.Location_Bits.find_lonely_key loc.Locations.loc in if Base.is_weak base then raise Unchanged; let size = Int_Base.project loc.Locations.size in let ll = Ival.project_int offset in let lh = Int.pred (Int.add ll size) in let offsm = match Model.find_base_or_default base state with | `Bottom | `Top -> raise Unchanged | `Value offsm -> offsm in let aux (offl, offh) (v, modu, shift) acc = let v' = f v in if v' != v then begin if V_Or_Uninitialized.is_bottom v' then raise Reduce_to_bottom; let il = Int.max offl ll and ih = Int.min offh lh in let abs_shift = Integer.e_rem (Rel.add_abs offl shift) modu in (* il and ih are the bounds of the interval to reduce. We change the initialized flags in the following cases: - either we overwrite entire values, or the partly overwritten value is at the beginning or at the end of the subrange - or we do not lose information on misaligned or partial values: the result is a singleton *) if V_Or_Uninitialized.(cardinal_zero_or_one v' || is_isotropic v') || ((Int.equal offl il || Int.equal (Int.e_rem ll modu) abs_shift) && (Int.equal offh ih || Int.equal (Int.e_rem (Int.succ lh) modu) abs_shift)) then let diff = Rel.sub_abs il offl in let shift_il = Rel.e_rem (Rel.sub shift diff) modu in V_Offsetmap.add (il, ih) (v', modu, shift_il) acc else acc end else acc in let noffsm = V_Offsetmap.fold_between ~entire:true (ll, lh) aux offsm offsm in Model.add_base base noffsm state with | Reduce_to_bottom -> Model.bottom | Unchanged -> state | Abstract_interp.Error_Top (* from Int_Base.project *) | Not_found (* from find_lonely_key *) | Ival.Not_Singleton_Int (* from Ival.project_int *) -> state let reduce_by_valid_loc ~positive access loc typ state = try let value = Cvalue.Model.find state loc in if Cvalue.V.is_imprecise value then (* we won't reduce anything anyway, and we may lose information if loc contains misaligned data *) raise Exit; let loc_bits = Locations.loc_bytes_to_loc_bits value in let size = Bit_utils.sizeof_pointed typ in let value_as_loc = Locations.make_loc loc_bits size in let reduced_value = Locations.loc_to_loc_without_size (if positive then Locations.valid_part access value_as_loc else Locations.invalid_part value_as_loc ) in if V.equal value reduced_value then state else begin if V.equal V.bottom reduced_value then Cvalue.Model.bottom else Cvalue.Model.reduce_previous_binding state loc reduced_value end with Exit -> state let make_loc_contiguous loc = try let base, offset = Locations.Location_Bits.find_lonely_key loc.Locations.loc in match offset, loc.Locations.size with | Ival.Top (Some min, Some max, _rem, modu), Int_Base.Value size when Int.equal modu size -> let size' = Int.add (Int.sub max min) modu in let i = Ival.inject_singleton min in let loc_bits = Locations.Location_Bits.inject base i in Locations.make_loc loc_bits (Int_Base.inject size') | _ -> loc with Not_found -> loc let apply_on_all_locs f loc state = match loc.Locations.size with | Int_Base.Top -> state | Int_Base.Value _ as size -> try let loc = Locations.valid_part Locations.Read loc in let loc = loc.Locations.loc in let plevel = Value_parameters.ArrayPrecisionLevel.get() in ignore (Locations.Location_Bits.cardinal_less_than loc plevel); Locations.Location_Bits.fold_enum (fun l acc -> f (Locations.make_loc l size) acc) loc state with Not_less_than | Abstract_interp.Error_Top -> state (* Display [o] as a single value, when this is more readable and more precise than the standard display. *) let pretty_stitched_offsetmap fmt typ o = if Cil.isArithmeticOrPointerType typ && not (Cvalue.V_Offsetmap.is_single_interval o) then let v = v_uninit_of_offsetmap ~typ o in if not (Cvalue.V_Or_Uninitialized.is_isotropic v) then Format.fprintf fmt "@\nThis amounts to: %a" Cvalue.V_Or_Uninitialized.pretty v let pretty_offsetmap typ fmt offsm = (* YYY: catch pointers to arrays, and print the contents of the array *) Format.fprintf fmt "@["; if Cvalue.V_Offsetmap.(equal empty offsm) then Format.fprintf fmt "%s" (Unicode.emptyset_string ()) else begin match Cvalue.V_Offsetmap.single_interval_value offsm with | Some value -> Cvalue.V_Or_Uninitialized.pretty fmt value; | None -> Cvalue.V_Offsetmap.pretty_generic ~typ () fmt offsm; pretty_stitched_offsetmap fmt typ offsm end; Format.fprintf fmt "@]" (* ------------------------- Under-approximation ---------------------------- *) let add_if_singleton value acc = if Cvalue.V_Or_Uninitialized.cardinal_zero_or_one value then Cvalue.V_Or_Uninitialized.link value acc else acc let find_offsm_under validity ival size offsm acc = let offsets = Tr_offset.trim_by_validity ival size validity in match offsets with | Tr_offset.Invalid | Tr_offset.Overlap _ -> acc | Tr_offset.Set list -> let find acc offset = let offsets = Ival.inject_singleton offset in let value = Cvalue.V_Offsetmap.find ~validity ~offsets ~size offsm in add_if_singleton value acc in List.fold_left find acc list | Tr_offset.Interval (min, max, modu) -> let process (start, _stop) (v, v_size, v_offset) acc = if Rel.(equal v_offset zero) && Int.equal v_size size && Int.equal (Int.e_rem (Int.sub start min) modu) Int.zero then add_if_singleton v acc else acc in Cvalue.V_Offsetmap.fold_between ~entire:true (min, max) process offsm acc exception CannotComputeUnder let find_lmap_under state location = match location.Locations.size with | Int_Base.Top -> raise CannotComputeUnder | Int_Base.Value size -> match location.Locations.loc with | Locations.Location_Bits.Top _ -> raise CannotComputeUnder | Locations.Location_Bits.Map map -> let process base offset acc = let offsm = Cvalue.Model.find_base_or_default base state in match offsm with | `Bottom -> acc | `Top -> raise CannotComputeUnder | `Value offsm -> let validity = Base.validity base in find_offsm_under validity offset size offsm acc in let acc = Cvalue.V_Or_Uninitialized.bottom in Locations.Location_Bits.M.fold process map acc let find_under_approximation state location = try Some (find_lmap_under state location) with CannotComputeUnder -> None (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/legacy/eval_op.mli�������������������������������������������0000666�0000000�0000000�00000010215�13571573400�020172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Numeric evaluation. Factored with evaluation in the logic. *) open Cil_types open Cvalue (** Transformation a value into an offsetmap of size [sizeof(typ)] bytes. *) val offsetmap_of_v: typ:Cil_types.typ -> V.t -> V_Offsetmap.t (** Returns the offsetmap at a precise_location from a state. May raise Abstract_interp.Error_Top. *) val offsetmap_of_loc: Precise_locs.precise_location -> Model.t -> V_Offsetmap.t Eval.or_bottom (** Specialization of the function above for standard types *) val wrap_size_t: V.t -> V_Offsetmap.t option val wrap_int: V.t -> V_Offsetmap.t option val wrap_ptr: V.t -> V_Offsetmap.t option val wrap_double: V.t -> V_Offsetmap.t option val wrap_float: V.t -> V_Offsetmap.t option val wrap_long_long: V.t -> V_Offsetmap.t option val backward_comp_left_from_type: Cil_types.typ -> (bool -> Abstract_interp.Comp.t -> Cvalue.V.t -> Cvalue.V.t -> Cvalue.V.t) (** Reduction of a {!Cvalue.V.t} by [==], [!=], [>=], [>], [<=] and [<]. [backward_comp_left_from_type positive op l r] reduces [l] so that the relation [l op r] holds. [typ] is the type of [l]. *) val reduce_by_initialized_defined : (V_Or_Uninitialized.t -> V_Or_Uninitialized.t) -> Locations.location -> Model.t -> Model.t val apply_on_all_locs: (Locations.location -> 'a -> 'a) -> Locations.location -> 'a -> 'a (** [apply_all_locs f loc state] folds [f] on all the atomic locations in [loc], provided there are less than [plevel]. Useful mainly when [loc] is exact or an over-approximation. *) val reduce_by_valid_loc: positive:bool -> Locations.access -> Locations.location -> typ -> Model.t -> Model.t (* [reduce_by_valid_loc positive ~for_writing loc typ state] reduces [state] so that [loc] contains a pointer [p] such that [(typ* )p] is valid if [positive] holds (or invalid otherwise). *) val make_loc_contiguous: Locations.location -> Locations.location (** 'Simplify' the location if it represents a contiguous zone: instead of multiple offsets with a small size, change it into a single offset with a size that covers the entire range. *) val pretty_stitched_offsetmap: Format.formatter -> typ -> V_Offsetmap.t -> unit val pretty_offsetmap: typ -> Format.formatter -> V_Offsetmap.t -> unit (* Given an under-approximation of a location, finds an under-approximation of the value at this location in the given state. Returns None if no under-approximation can be computed. *) val find_under_approximation: Cvalue.Model.t -> Locations.location -> Cvalue.V_Or_Uninitialized.t option (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/legacy/eval_terms.ml�����������������������������������������0000666�0000000�0000000�00000274467�13571573400�020562� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype open Locations open Abstract_interp open Cvalue open Bit_utils (* Truth values for a predicate analyzed by the value analysis *) type predicate_status = Comp.result = True | False | Unknown let string_of_predicate_status = function | Unknown -> "unknown" | True -> "valid" | False -> "invalid" let pretty_predicate_status fmt v = Format.fprintf fmt "%s" (string_of_predicate_status v) let join_predicate_status x y = match x, y with | True, True -> True | False, False -> False | True, False | False, True | Unknown, _ | _, Unknown -> Unknown exception Stop let _join_list_predicate_status l = try let r = List.fold_left (fun acc e -> match e, acc with | Unknown, _ -> raise Stop | e, None -> Some e | e, Some eacc -> Some (join_predicate_status eacc e) ) None l in match r with | None -> True | Some r -> r with Stop -> Unknown (* Type of possible errors during evaluation. See pretty-printer for details *) type logic_evaluation_error = | Unsupported of string | UnsupportedLogicVar of logic_var | AstError of string | NoEnv of logic_label | NoResult | CAlarm let pretty_logic_evaluation_error fmt = function | Unsupported s -> Format.fprintf fmt "unsupported ACSL construct: %s" s | UnsupportedLogicVar tv -> Format.fprintf fmt "unsupported logic var %s" tv.lv_name | AstError s -> Format.fprintf fmt "error in AST: %s; please report" s | NoEnv (FormalLabel s) -> Format.fprintf fmt "no environment to evaluate \\at(_,%s)" s | NoEnv (BuiltinLabel l) -> Format.fprintf fmt "no environment to evaluate \\at(_,%a)" Printer.pp_logic_builtin_label l | NoEnv (StmtLabel _) -> Format.fprintf fmt "\\at() on a C label is unsupported" | NoResult -> Format.fprintf fmt "meaning of \\result not specified" | CAlarm -> Format.fprintf fmt "alarm during evaluation" exception LogicEvalError of logic_evaluation_error let unsupported s = raise (LogicEvalError (Unsupported s)) let unsupported_lvar v = raise (LogicEvalError (UnsupportedLogicVar v)) let ast_error s = raise (LogicEvalError (AstError s)) let no_env lbl = raise (LogicEvalError (NoEnv lbl)) let no_result () = raise (LogicEvalError NoResult) let c_alarm () = raise (LogicEvalError CAlarm) (** Three modes to handle the alarms when evaluating a logical term. *) type alarm_mode = | Ignore (* Ignores all alarms. *) | Fail (* Raises a LogicEvalError when an alarm is encountered. *) | Track of bool ref (* Tracks the possibility of an alarm in the boolean. *) (* Process the possibility of an alarm according to the alarm_mode. The boolean [b] is true when an alarm is possible. *) let track_alarms b = function | Ignore -> () | Fail -> if b then c_alarm () | Track bref -> if b then bref := true let display_evaluation_error ~loc = function | CAlarm -> () | pa -> Value_parameters.result ~source:(fst loc) ~once:true "cannot evaluate ACSL term, %a" pretty_logic_evaluation_error pa (* Warning mode use when performing _reductions_ in the logic ( ** not ** evaluation). "Logic alarms" are ignored, and the reduction proceeds as if they had not occurred. *) let alarm_reduce_mode () = if Value_parameters.ReduceOnLogicAlarms.get () then Ignore else Fail let find_or_alarm ~alarm_mode state loc = let is_invalid = not Locations.(is_valid Read loc) in track_alarms is_invalid alarm_mode; let v = Model.find_indeterminate ~conflate_bottom:true state loc in let is_indeterminate = Cvalue.V_Or_Uninitialized.is_indeterminate v in track_alarms is_indeterminate alarm_mode; V_Or_Uninitialized.get_v v (* Evaluation environments. Used to evaluate predicate on \at nodes *) (* Labels: pre: pre-state of the function. Equivalent to \old in the postcondition (and displayed as such) here: current location, always the intuitive meaning. Assertions are evaluated before the statement. post: forbidden in preconditions; In postconditions: in function contracts, state of in the post-state in statement contracts, state after the evaluation of the statement old: forbidden in assertions. In statement contracts post, means the state before the statement In functions contracts post, means the pre-state *) (* TODO: evaluating correctly Pat with the current Value domain is tricky, and only works reliably for the four labels below, that are either invariant during the course of the program, or fully local. The program below shows the problem: if (c) x = 1; else x = 3; L: x = 1; \assert \at(x == 1, L); A naive implementation of assertions involving C labels is likely to miss the fact that the assertion is false after the else branch. A good solution is to use a dummy edge that flows from L to the assertion, to force its re-evaluation. *) type labels_states = Cvalue.Model.t Logic_label.Map.t let join_label_states m1 m2 = let aux _ s1 s2 = match s1, s2 with | None, None -> None | Some s, None | None, Some s -> Some s | Some s1, Some s2 -> Some (Cvalue.Model.join s1 s2) in if m1 == m2 then m1 else Logic_label.Map.merge aux m1 m2 (* The logic can refer to the state at other points of the program using labels. [e_cur] indicates the current label (in changes when evaluating the term in a \at(label,term). [e_states] associates a memory state to each label. [result] contains the variable corresponding to \result; this works even with leaf functions without a body. [result] is None when \result is meaningless (e.g. the function returns void, logic outside of a function contract, etc.) *) type eval_env = { e_cur: logic_label; e_states: labels_states; result: varinfo option; } let join_env e1 e2 = { e_cur = (assert (Logic_label.equal e1.e_cur e2.e_cur); e1.e_cur); e_states = join_label_states e1.e_states e2.e_states; result = (assert (e1.result == e2.result); e1.result); } let env_state env lbl = try Logic_label.Map.find lbl env.e_states with Not_found -> no_env lbl let env_current_state e = env_state e e.e_cur let overwrite_state env state lbl = { env with e_states = Logic_label.Map.add lbl state env.e_states } let overwrite_current_state env state = overwrite_state env state env.e_cur let lbl_here = Logic_const.here_label let add_logic ll state (states: labels_states): labels_states = Logic_label.Map.add ll state states let add_here = add_logic Logic_const.here_label let add_pre = add_logic Logic_const.pre_label let add_post = add_logic Logic_const.post_label let add_old = add_logic Logic_const.old_label (* Init is a bit special, it is constant and always added to the initial state*) let add_init state = add_logic Logic_const.init_label (Db.Value.globals_state ()) state let make_env logic_env state = let transfer label map = Logic_label.Map.add label (logic_env.Abstract_domain.states label) map in let map = Logic_label.Map.add lbl_here state (transfer Logic_const.pre_label (transfer Logic_const.old_label (transfer Logic_const.post_label (add_init Logic_label.Map.empty)))) in { e_cur = lbl_here; e_states = map; result = logic_env.Abstract_domain.result } let env_pre_f ~pre () = { e_cur = lbl_here; e_states = add_here pre (add_pre pre (add_init Logic_label.Map.empty)); result = None (* Never useful in a pre *); } let env_post_f ?(c_labels=Logic_label.Map.empty) ~pre ~post ~result () = { e_cur = lbl_here; e_states = add_post post (add_here post (add_pre pre (add_old pre (add_init c_labels)))); result = result; } let env_annot ?(c_labels=Logic_label.Map.empty) ~pre ~here () = { e_cur = lbl_here; e_states = add_here here (add_pre pre (add_init c_labels)); result = None (* Never useful in a 'assert'. TODO: will be needed for stmt contracts *); } let env_assigns ~pre = { e_cur = lbl_here; (* YYY: Post label is missing, but is too difficult in the current evaluation scheme, since we build it by evaluating the assigns... *) e_states = add_old pre (add_here pre (add_pre pre (add_init Logic_label.Map.empty))); result = None (* Treated in a special way in callers *) } let env_only_here state = { e_cur = lbl_here; e_states = add_here state (add_init Logic_label.Map.empty); result = None (* Never useful in a 'assert'. TODO: will be needed for stmt contracts *); } (* Return the base and the type corresponding to the logic var if it is within the scope of the supported ones. Fail otherwise. *) let supported_logic_var lvi = match Logic_utils.unroll_type lvi.lv_type with | Ctype ty when Cil.isIntegralType ty -> (Base.of_c_logic_var lvi), ty | _ -> unsupported_lvar lvi let bind_logic_vars env lvs = let bind_one state lv = try let b, cty = supported_logic_var lv in let size = Int.of_int (Cil.bitsSizeOf cty) in let v = Cvalue.V_Or_Uninitialized.initialized V.top_int in Model.add_base_value b ~size v ~size_v:Int.one state with Cil.SizeOfError _ -> unsupported_lvar lv in let state = env_current_state env in let state = List.fold_left bind_one state lvs in overwrite_current_state env state let unbind_logic_vars env lvs = let unbind_one state lv = let b, _ = supported_logic_var lv in Model.remove_base b state in let state = env_current_state env in let state = List.fold_left unbind_one state lvs in overwrite_current_state env state let lop_to_cop op = match op with | Req -> Eq | Rneq -> Ne | Rle -> Le | Rge -> Ge | Rlt -> Lt | Rgt -> Gt (* Types currently understood in the evaluation of the logic: no arrays, structs, logic arrays or subtle ACSL types. Sets of sets seem to be flattened, so the current treatment of them is correct. *) let rec isLogicNonCompositeType t = match t with | Lvar _ | Larrow _ -> false | Ltype (info, _) -> Logic_const.is_boolean_type t || info.lt_name = "sign" || (try isLogicNonCompositeType (Logic_const.type_of_element t) with Failure _ -> false) | Linteger | Lreal -> true | Ctype t -> Cil.isArithmeticOrPointerType t let rec infer_type = function | Ctype t -> (match t with | TInt _ -> Cil.intType | TFloat _ -> Cil.doubleType | _ -> t) | Lvar _ -> Cil.voidPtrType (* For polymorphic empty sets *) | Linteger -> Cil.intType | Lreal -> Cil.doubleType | Ltype _ | Larrow _ as t -> if Logic_const.is_plain_type t then unsupported (Pretty_utils.to_string Cil_datatype.Logic_type.pretty t) else Logic_const.plain_or_set infer_type t (* Best effort for comparing the types currently understood by Value: ignore differences in integer and floating-point sizes, that are meaningless in the logic *) let same_etype t1 t2 = match Cil.unrollType t1, Cil.unrollType t2 with | (TInt _ | TEnum _), (TInt _ | TEnum _) -> true | TFloat _, TFloat _ -> true | TPtr (p1, _), TPtr (p2, _) -> Cil_datatype.Typ.equal p1 p2 | _, _ -> Cil_datatype.Typ.equal t1 t2 let infer_binop_res_type op targ = match op with | PlusA | MinusA | Mult | Div -> targ | PlusPI | MinusPI | IndexPI -> assert (Cil.isPointerType targ); targ | MinusPP -> Cil.intType | Mod | Shiftlt | Shiftrt | BAnd | BXor | BOr -> (* can only be applied on integral arguments *) assert (Cil.isIntegralType targ); Cil.intType | Lt | Gt | Le | Ge | Eq | Ne | LAnd | LOr -> Cil.intType (* those operators always return a boolean *) (* This function could probably be in Logic_utils. It computes [*tsets], assuming that [tsets] has a pointer type. *) let deref_tsets tsets = let star_tsets = Cil.mkTermMem ~addr:tsets ~off:TNoOffset in let typ = Logic_typing.type_of_pointed tsets.term_type in Logic_const.term (TLval star_tsets) typ type logic_deps = Zone.t Logic_label.Map.t let deps_at lbl (ld:logic_deps) = try Logic_label.Map.find lbl ld with Not_found -> Zone.bottom let add_deps lbl ldeps deps = let prev_deps = deps_at lbl ldeps in let deps = Zone.join prev_deps deps in let ldeps : logic_deps = Logic_label.Map.add lbl deps ldeps in ldeps let join_logic_deps (ld1:logic_deps) (ld2: logic_deps) : logic_deps = let aux _ d1 d2 = match d1, d2 with | None as d, None | (Some _ as d), None | None, (Some _ as d) -> d | Some d1, Some d2 -> Some (Zone.join d1 d2) in Logic_label.Map.merge aux ld1 ld2 let empty_logic_deps = Logic_label.Map.add lbl_here Zone.bottom Logic_label.Map.empty (* Type holding the result of an evaluation. Currently, 'a is either [Cvalue.V.t] for [eval_term], and [Location_Bits.t] for [eval_tlval_as_loc], and [Ival.t] for [eval_toffset]. [eover] contains an over-approximation of the evaluation. [eunder] contains an under-approximation, under the hypothesis that the state in which we evaluate is not Bottom. (Otherwise, all under-approximations would be Bottom themselves). The following two invariants should hold: (1) eunder \subset eover. (2) when evaluating something that is not a Tset, either eunder = Bottom, or eunder = eover, and cardinal(eover) <= 1. This is due to the fact that under-approximations are not propagated as an abstract domain, but only created from Trange or inferred from exact over-approximations. *) type 'a eval_result = { etype: Cil_types.typ; eunder: 'a; eover: 'a; ldeps: logic_deps; } (* When computing an under-approximation, we make the hypothesis that the state is not Bottom. Hence, over-approximations of cardinal <= 1 are actually of cardinal 1, and are thus exact. *) let under_from_over eover = if Cvalue.V.cardinal_zero_or_one eover then eover else Cvalue.V.bottom ;; let under_loc_from_over eover = if Locations.Location_Bits.cardinal_zero_or_one eover then eover else Locations.Location_Bits.bottom ;; let is_noop_cast ~src_typ ~dst_typ = let src_typ = Logic_const.plain_or_set (fun lt -> match Logic_utils.unroll_type lt with | Ctype typ -> Eval_typ.classify_as_scalar typ | _ -> None ) (Logic_utils.unroll_type src_typ) in let open Eval_typ in match src_typ, Eval_typ.classify_as_scalar dst_typ with | Some (TSInt rsrc), Some (TSInt rdst) -> Eval_typ.range_inclusion rsrc rdst | Some (TSFloat srckind), Some (TSFloat destkind) -> Cil.frank srckind <= Cil.frank destkind | Some (TSPtr _), Some (TSPtr _) -> true | _ -> false (* Note: non-constant integers can happen e.g. for sizeof of structures of an unknown size. *) let einteger v = { etype = Cil.intType; eunder = under_from_over v; eover = v; ldeps = empty_logic_deps } (* Note: some reals cannot be exactly represented as floats; in which case we do not know their under-approximation. *) let efloating_point etype fval = let v = V.inject_float fval in let eunder = under_from_over v in { etype; eunder; eover = v; ldeps = empty_logic_deps } let ereal = efloating_point Cil.doubleType let efloat = efloating_point Cil.floatType let is_true = function | `True | `TrueReduced _ -> true | `Unknown _ | `False | `Unreachable -> false (* Check "logic alarms" when evaluating [v1 op v2]. All operators shifts are defined unambiguously in ACSL. *) let check_logic_alarms ~alarm_mode typ (_v1: V.t eval_result) op v2 = match op with | Div | Mod when Cil.isIntegralOrPointerType typ -> let truth = Cvalue_forward.assume_non_zero v2.eover in let division_by_zero = not (is_true truth) in track_alarms division_by_zero alarm_mode | Shiftlt | Shiftrt -> begin (* Check that [e2] is positive. [e1] can be arbitrary, we use the arithmetic vision of shifts *) try let i2 = Cvalue.V.project_ival_bottom v2.eover in let valid = Ival.is_included i2 Ival.positive_integers in track_alarms (not valid) alarm_mode with Cvalue.V.Not_based_on_null -> track_alarms true alarm_mode end | _ -> () (* Constrain the ACSL range [idx] when it is used to access an array of [size_arr] cells, and it is a Trange in which one size is not specified. (E.g. t[1..] is transformed into t[1..9] when t has size 10). *) let constraint_trange idx size_arr = if Kernel.SafeArrays.get () then match idx.term_node with | Trange ((None as low), up) | Trange (low, (None as up)) -> begin let loc = idx.term_loc in match Extlib.opt_bind Cil.constFoldToInt size_arr with | None -> idx | Some size -> let low = match low with (* constrained l.h.s *) | Some _ -> low | None -> Some (Logic_const.tint ~loc Integer.zero) in let up = match up with (* constrained r.h.s *) | Some _ -> up | None -> Some (Logic_const.tint ~loc (Int.pred size)) in Logic_const.trange ~loc (low, up) end | _ -> idx else idx (* Note: "charlen" stands for either strlen or wcslen *) (* Evaluates the logical predicates [strlen/wcslen] using str* builtins. Returns [res, alarms], where [res] is the return value of [strlen] ([None] the evaluation results in [bottom]). *) let logic_charlen_builtin wrapper state v = (* the call below could in theory return Builtins.Invalid_nb_of_args, but logic typing constraints prevent that. *) let res, alarms = wrapper state [v] in match res with | None -> None | Some offsm -> Some (offsm, alarms) (* Never raises exceptions; instead, returns [-1,+oo] in case of alarms (most imprecise result possible for the logic strlen/wcslen predicates). *) let eval_logic_charlen wrapper env v ldeps = let eover = match logic_charlen_builtin wrapper (env_current_state env) v with | None -> Cvalue.V.bottom | Some (offsm, alarms) -> if alarms then Cvalue.V.inject_ival (Ival.inject_range (Some Int.minus_one) None) else let v = Extlib.the (Cvalue.V_Offsetmap.single_interval_value offsm) in Cvalue.V_Or_Uninitialized.get_v v in let eunder = under_from_over eover in (* the C strlen function has type size_t, but the logic strlen function has type ℤ (signed) *) let etype = Cil.intType in { etype; ldeps; eover; eunder } (* Evaluates the logical predicates strchr/wcschr. *) let eval_logic_charchr builtin env s c ldeps_s ldeps_c = let eover = match builtin (env_current_state env) [s; c] with | None, _ -> Cvalue.V.bottom | Some offsm, alarms -> if alarms then Cvalue.V.zero_or_one else let v = Extlib.the (Cvalue.V_Offsetmap.single_interval_value offsm) in let r = Cvalue.V_Or_Uninitialized.get_v v in let ctrue = Cvalue.V.contains_non_zero r and cfalse = Cvalue.V.contains_zero r in match ctrue, cfalse with | true, true -> Cvalue.V.zero_or_one | true, false -> Cvalue.V.singleton_one | false, true -> Cvalue.V.singleton_zero | false, false -> assert false (* a logic alarm would have been raised*) in let eunder = under_from_over eover in (* the C strchr function has type char*, but the logic strchr predicate has type 𝔹 *) let etype = TInt (IBool, []) in let ldeps = join_logic_deps ldeps_s ldeps_c in { etype; ldeps; eover; eunder } (* Evaluates the logical predicate is_allocable, according to the following logic: - if the size to allocate is always too large (> SIZE_MAX), allocation fails; - otherwise, if AllocReturnsNull is true or if the size may exceed SIZE_MAX, returns Unknown (to simulate non-determinism); - otherwise, allocation always succeeds. *) let eval_is_allocable size = let size_ok = Builtins_malloc.alloc_size_ok size in match size_ok, Value_parameters.AllocReturnsNull.get () with | Alarmset.False, _ -> False | Alarmset.Unknown, _ | _, true -> Unknown | Alarmset.True, false -> True (* returns true iff the logic variable is defined by the Frama-C standard library *) let comes_from_fc_stdlib lvar = Cil.hasAttribute "fc_stdlib" lvar.lv_attr || match lvar.lv_origin with | None -> false | Some vi -> Cil.hasAttribute "fc_stdlib" vi.vattr (* As usual in this file, [dst_typ] may be misleading: the 'size' is meaningless, because [src_typ] may actually be a logic type. Thus, this size must not be used below. *) let cast ~src_typ ~dst_typ v = let open Eval_typ in match classify_as_scalar dst_typ, classify_as_scalar src_typ with | None, _ | _, None -> v (* unclear whether this happens. *) | Some dst, Some src -> match dst, src with | TSFloat fkind, (TSInt _ | TSPtr _) -> Cvalue.V.cast_int_to_float (Fval.kind fkind) v | (TSInt dst | TSPtr dst), TSFloat fkind -> (* This operation is not fully defined in ACSL. We raise an alarm in case of overflow. *) if is_true (Cvalue_forward.assume_not_nan ~assume_finite:true fkind v) then Cvalue_forward.cast_float_to_int dst v else c_alarm () | (TSInt dst | TSPtr dst), (TSInt _ | TSPtr _) -> let size = Integer.of_int dst.i_bits in let signed = dst.i_signed in V.cast_int_to_int ~signed ~size v | TSFloat fkind, TSFloat _ -> Cvalue.V.cast_float_to_float (Fval.kind fkind) v (* V.cast_int_to_int is unsound when the destination type is _Bool. Use this function instead. *) let cast_to_bool r = let contains_zero = V.contains_zero r.eover and contains_non_zero = V.contains_non_zero r.eover in let eover = V.interp_boolean ~contains_zero ~contains_non_zero in { eover; eunder = under_from_over eover; ldeps = r.ldeps; etype = TInt (IBool, []) } (* -------------------------------------------------------------------------- *) (* --- Inlining of defined logic functions and predicates --- *) (* -------------------------------------------------------------------------- *) type pred_fun_origin = ACSL | Libc let known_logic_funs = [ "strlen", Libc; "wcslen", Libc; "strchr", Libc; "wcschr", Libc; "atan2", ACSL; "atan2f", ACSL; "pow", ACSL; "powf", ACSL; "fmod", ACSL; "fmodf", ACSL; "\\sign", ACSL; "\\min", ACSL; "\\max", ACSL; ] let known_predicates = [ "\\warning", ACSL; "\\is_finite", ACSL; "\\is_plus_infinity", ACSL; "\\is_minus_infinity", ACSL; "\\is_NaN", ACSL; "\\eq_float", ACSL; "\\ne_float", ACSL; "\\lt_float", ACSL; "\\le_float", ACSL; "\\gt_float", ACSL; "\\ge_float", ACSL; "\\eq_double", ACSL; "\\ne_double", ACSL; "\\lt_double", ACSL; "\\le_double", ACSL; "\\gt_double", ACSL; "\\ge_double", ACSL; "\\subset", ACSL; "valid_read_string", Libc; "valid_string", Libc; "valid_read_wstring", Libc; "valid_wstring", Libc; "is_allocable", Libc; ] let is_known_logic_fun_pred known lvi = try let origin = List.assoc lvi.lv_name known in match origin with | ACSL -> true | Libc -> comes_from_fc_stdlib lvi with Not_found -> false let is_known_logic_fun = is_known_logic_fun_pred known_logic_funs let is_known_predicate = is_known_logic_fun_pred known_predicates let inline logic_info = let logic_var = logic_info.l_var_info in not (is_known_logic_fun logic_var || is_known_predicate logic_var) (* We evaluate the ACSL sign type as integers 1 or -1. Sign values can only be constructed through the \sign function (handled in eval_known_logic_function) and the \Positive and \Negative constructors (handled in eval_term). They can only be compared through equality and disequality; no other operation exists on this type, so our interpretation remains correct. *) let positive_cvalue = Cvalue.V.inject_int Int.one let negative_cvalue = Cvalue.V.inject_int Int.minus_one (* -------------------------------------------------------------------------- *) (* --- Evaluation of terms --- *) (* -------------------------------------------------------------------------- *) let int_or_float_op typ int_op float_op = match typ with | TInt _ | TPtr _ | TEnum _ -> int_op | TFloat (_fkind, _) -> float_op | _ -> ast_error (Format.asprintf "binop on incorrect type %a" Printer.pp_typ typ) let forward_binop_by_type typ = let forward_int = Cvalue_forward.forward_binop_int ~typ and forward_float = Cvalue_forward.forward_binop_float Fval.Real in int_or_float_op typ forward_int forward_float let forward_binop typ v1 op v2 = match op with | Eq | Ne | Le | Lt | Ge | Gt -> let comp = Value_util.conv_comp op in if Cil.isPointerType typ || Cvalue_forward.are_comparable comp v1 v2 then forward_binop_by_type typ v1 op v2 else Cvalue.V.zero_or_one | _ -> forward_binop_by_type typ v1 op v2 let rec eval_term ~alarm_mode env t = match t.term_node with | Tat (t, lab) -> ignore (env_state env lab); eval_term ~alarm_mode { env with e_cur = lab } t | TConst (Integer (v, _)) -> einteger (Cvalue.V.inject_int v) | TConst (LEnum e) -> (match Cil.constFoldToInt e.eival with | Some v -> einteger (Cvalue.V.inject_int v) | _ -> ast_error "non-evaluable constant") | TConst (LChr c) -> einteger (Cvalue.V.inject_int (Cil.charConstToInt c)) | TConst (LReal { r_nearest; r_lower ; r_upper }) -> begin if Fc_float.is_nan r_nearest then ereal Fval.nan else let r_lower = Fval.F.of_float r_lower in let r_upper = Fval.F.of_float r_upper in let f = Fval.inject Fval.Real r_lower r_upper in ereal f end (* | TConst ((CStr | CWstr) Missing cases *) | TAddrOf (thost, toffs) -> let r = eval_thost_toffset ~alarm_mode env thost toffs in { etype = TPtr (r.etype, []); ldeps = r.ldeps; eunder = loc_bits_to_loc_bytes_under r.eunder; eover = loc_bits_to_loc_bytes r.eover } | TStartOf (thost, toffs) -> let r = eval_thost_toffset ~alarm_mode env thost toffs in { etype = TPtr (Cil.typeOf_array_elem r.etype, []); ldeps = r.ldeps; eunder = loc_bits_to_loc_bytes_under r.eunder; eover = loc_bits_to_loc_bytes r.eover } (* Special case for the constants \pi, \e, \infinity and \NaN. *) | TLval (TVar {lv_name = "\\pi"}, _) -> ereal Fval.pi | TLval (TVar {lv_name = "\\e"}, _) -> ereal Fval.e | TLval (TVar {lv_name = "\\plus_infinity"}, _) -> efloat Fval.(pos_infinity Single) | TLval (TVar {lv_name = "\\minus_infinity"}, _) -> efloat Fval.(neg_infinity Single) | TLval (TVar {lv_name = "\\NaN"}, _) -> efloat Fval.nan | TLval _ -> let lval = eval_tlval ~alarm_mode env t in let typ = lval.etype in let size = Eval_typ.sizeof_lval_typ typ in let state = env_current_state env in let eover_loc = make_loc (lval.eover) size in let eover = find_or_alarm ~alarm_mode state eover_loc in let eover = Cvalue_forward.make_volatile ~typ eover in let eover = Cvalue_forward.reinterpret typ eover in (* Skip dependencies if state is dead *) let deps = if Cvalue.Model.is_reachable state then add_deps env.e_cur empty_logic_deps (enumerate_valid_bits Locations.Read eover_loc) else empty_logic_deps in let eunder_loc = make_loc (lval.eunder) size in let eunder = match Eval_op.find_under_approximation state eunder_loc with | Some eunder -> V_Or_Uninitialized.get_v eunder | None -> under_from_over eover in { etype = typ; ldeps = join_logic_deps deps (lval.ldeps); eunder; eover } (* TBinOp ((LOr | LAnd), _t1, _t2) -> TODO: a special case would be useful. But this requires reducing the state after having evaluated t1 by a term that is in fact a predicate *) | TBinOp (op,t1,t2) -> eval_binop ~alarm_mode env op t1 t2 | TUnOp (op, t) -> let r = eval_term ~alarm_mode env t in let typ' = match op with | Neg -> r.etype | BNot -> r.etype (* can only be used on an integer type *) | LNot -> Cil.intType in let v = Cvalue_forward.forward_unop r.etype op r.eover in let eover = v in { etype = typ'; ldeps = r.ldeps; eover; eunder = under_from_over eover } | Trange(otlow, othigh) -> (* The overapproximation is the range [min(low.eover)..max(high.eover)]. The underapproximation is the range [max(low.eover)..min(high.eover)]. Perhaps surprisingly, we do not use the under-approximations of otlow and othigh to compute the underapproximation. We could potentially compute [min(max(low.over), min(low.under) .. max(min(high.over), max(high.under)] However, tsets cannot be used as bounds of ranges. By invariant (2), eunder is either Bottom, or equal to eover, both being of cardinal one. In both cases, using eover is more precise. *) let deps = ref empty_logic_deps in let min v = try (match Ival.min_int (Cvalue.V.project_ival v) with | None -> `Approx | Some(x) -> `Finite(x)) with Cvalue.V.Not_based_on_null -> `Approx in let max v = try (match Ival.max_int (Cvalue.V.project_ival v) with | None -> `Approx | Some(x) -> `Finite(x)) with Cvalue.V.Not_based_on_null -> `Approx in (* Evaluate a bound: - [sure_bound_under] is returned for the under-approximation when the bound is explicitly omitted in the ACSL term - [min_max_*] is the function to retrieve the bound from the over_approximation, for both the underapproximation and the overapproximation. *) let eval_bound sure_bound_under min_max_under min_max_over = function | None -> sure_bound_under, `Approx | Some(result) -> try let result = eval_term ~alarm_mode env result in deps := join_logic_deps !deps result.ldeps; let under = min_max_under result.eover in let over = min_max_over result.eover in under, over with LogicEvalError e -> if e <> CAlarm then Value_parameters.result ~source:(fst t.term_loc) ~once:true "@[<hov 0>Cannot evaluate@ range bound %a@ (%a). Approximating@]" Printer.pp_term result pretty_logic_evaluation_error e; `Approx, `Approx in let min_under, min_over = eval_bound `MinusInf max min otlow in let max_under, max_over = eval_bound `PlusInf min max othigh in let to_bound = function | `Finite x -> Some x | `PlusInf | `MinusInf | `Approx -> None in let eunder = match (min_under, max_under) with | `Approx, _ | _, `Approx -> Cvalue.V.bottom | (`MinusInf | `Finite _), (`PlusInf | `Finite _) -> Cvalue.V.inject_ival (Ival.inject_range (to_bound min_under) (to_bound max_under)) in let eover = Cvalue.V.inject_ival (Ival.inject_range (to_bound min_over) (to_bound max_over)) in { ldeps = !deps; etype = Cil.intType; eunder; eover } | TCastE (typ, t) -> let r = eval_term ~alarm_mode env t in (* See if the cast does something. If not, we can keep eunder as is.*) if is_noop_cast ~src_typ:t.term_type ~dst_typ:typ then { r with etype = typ } else if Cil.isBoolType typ then cast_to_bool r else let eover = cast ~src_typ:r.etype ~dst_typ:typ r.eover in { etype = typ; ldeps = r.ldeps; eunder = under_from_over eover; eover } | Tif (tcond, ttrue, tfalse) -> eval_tif eval_term Cvalue.V.join Cvalue.V.meet ~alarm_mode env tcond ttrue tfalse | TSizeOf _ | TSizeOfE _ | TSizeOfStr _ | TAlignOf _ | TAlignOfE _ -> let e = Cil.constFoldTerm true t in let v = match e.term_node with | TConst (Integer (v, _)) -> Cvalue.V.inject_int v | _ -> V.top_int in einteger v | Tunion l -> let eunder, eover, deps = List.fold_left (fun (accunder, accover, accdeps) t -> let r = eval_term ~alarm_mode env t in (Cvalue.V.link accunder r.eunder, Cvalue.V.join accover r.eover, join_logic_deps accdeps r.ldeps)) (Cvalue.V.bottom, Cvalue.V.bottom, empty_logic_deps) l in { etype = infer_type t.term_type; ldeps = deps; eunder; eover } | Tempty_set -> { etype = infer_type t.term_type; ldeps = empty_logic_deps; eunder = Cvalue.V.bottom; eover = Cvalue.V.bottom } | Tnull -> { etype = Cil.voidPtrType; ldeps = empty_logic_deps; eunder = Cvalue.V.singleton_zero; eover = Cvalue.V.singleton_zero } | TLogic_coerce(ltyp, t) -> let r = eval_term ~alarm_mode env t in (* we must handle coercion from singleton to set, for which there is nothing to do, AND coercion from an integer type to a floating-point type, that require a conversion. *) (match Logic_const.plain_or_set Extlib.id ltyp with | Linteger when Logic_typing.is_integral_type t.term_type || Logic_const.is_boolean_type t.term_type -> r | Ctype typ when Cil.isIntegralOrPointerType typ -> r | Lreal -> if Logic_typing.is_integral_type t.term_type then (* Needs to be converted to reals *) let eover = V.cast_int_to_float Fval.Real r.eover in { etype = Cil.longDoubleType; (** hack until logic type *) ldeps = r.ldeps; eunder = under_from_over eover; eover; } else let eover = V.cast_float_to_float Fval.Real r.eover in { etype = Cil.longDoubleType; (** hack until logic type *) ldeps = r.ldeps; eunder = under_from_over eover; eover; } | _ -> if Logic_const.is_boolean_type ltyp && Logic_typing.is_integral_type t.term_type then cast_to_bool r else unsupported (Format.asprintf "logic coercion %a -> %a@." Printer.pp_logic_type t.term_type Printer.pp_logic_type ltyp) ) (* TODO: the meaning of the label in \offset and \base_addr is not obvious at all *) | Toffset (_lbl, t) -> let r = eval_term ~alarm_mode env t in let add_offset _ offs acc = Ival.join offs acc in let offs = Location_Bytes.fold_topset_ok add_offset r.eover Ival.bottom in let eover = Cvalue.V.inject_ival offs in { etype = Cil.intType; ldeps = r.ldeps; eover; eunder = under_from_over eover } | Tbase_addr (_lbl, t) -> let r = eval_term ~alarm_mode env t in let add_base b acc = V.join acc (V.inject b Ival.zero) in let eover = Location_Bytes.fold_bases add_base r.eover V.bottom in { etype = Cil.charPtrType; ldeps = r.ldeps; eover; eunder = under_from_over eover } | Tblock_length (_lbl, t) -> (* TODO: take label into account for locals *) let r = eval_term ~alarm_mode env t in let add_block_length b acc = let bl = (* Convert the validity frontiers into a range of bytes. The frontiers are always 0 or 8*k-1 (because validity is in bits and starts on zero), so we add 1 everywhere, then divide by eight. *) let convert start_bits end_bits = let congr_succ i = Int.(equal zero (e_rem (succ i) eight)) in let congr_or_zero i = Int.(equal zero i || congr_succ i) in assert (congr_or_zero start_bits || congr_or_zero end_bits); let start_bytes = Int.(e_div (Int.succ start_bits) eight) in let end_bytes = Int.(e_div (Int.succ end_bits) eight) in Ival.inject_range (Some start_bytes) (Some end_bytes) in match Base.validity b with | Base.Empty -> Ival.zero | Base.Invalid -> Ival.top (* we may also emit an alarm *) | Base.Known (_, ma) -> convert ma ma | Base.Unknown (mi, None, ma) -> convert mi ma | Base.Unknown (_, Some mi, ma) -> convert mi ma | Base.Variable weak_v -> convert weak_v.Base.min_alloc weak_v.Base.max_alloc in Ival.join acc bl in let bl = Location_Bytes.fold_bases add_block_length r.eover Ival.bottom in let eover = V.inject_ival bl in { etype = Cil.charPtrType; ldeps = r.ldeps; eover; eunder = under_from_over eover } | Tapp (li, labels, args) -> begin if is_known_logic_fun li.l_var_info then eval_known_logic_function ~alarm_mode env li labels args else match Inline.inline_term ~inline ~current:env.e_cur t with | Some t' -> eval_term ~alarm_mode env t' | None -> let s = Format.asprintf "logic function %a" Printer.pp_logic_var li.l_var_info in unsupported s end | TDataCons (ctor_info, _) -> begin match ctor_info.ctor_name with | "\\Positive" -> einteger positive_cvalue | "\\Negative" -> einteger negative_cvalue | "\\true" -> einteger Cvalue.V.singleton_one | "\\false" -> einteger Cvalue.V.singleton_zero | _ -> unsupported "logic inductive types" end | Tlambda _ -> unsupported "logic functions or predicates" | TUpdate _ -> unsupported "functional updates" | Ttype _ -> unsupported "\\type operator" | Ttypeof _ -> unsupported "\\typeof operator" | Tcomprehension _ -> unsupported "sets defined by comprehension" | Tinter _ -> unsupported "set intersection" | Tlet _ -> unsupported "\\let bindings" | TConst (LStr _) -> unsupported "constant strings" | TConst (LWStr _) -> unsupported "wide constant strings" and eval_binop ~alarm_mode env op t1 t2 = if not (isLogicNonCompositeType t1.term_type) then if Value_parameters.debug_atleast 1 then unsupported (Format.asprintf "operation (%a) %a (%a) on non-supported type %a" Printer.pp_term t1 Printer.pp_binop op Printer.pp_term t2 Printer.pp_logic_type t1.term_type) else unsupported (Format.asprintf "%a operation on non-supported type %a" Printer.pp_binop op Printer.pp_logic_type t1.term_type) else let r1 = eval_term ~alarm_mode env t1 in let r2 = eval_term ~alarm_mode env t2 in let te1 = Cil.unrollType r1.etype in check_logic_alarms ~alarm_mode te1 r1 op r2; let typ_res = infer_binop_res_type op te1 in let eover = forward_binop te1 r1.eover op r2.eover in let default _r1 _r2 = under_from_over eover in let add_untyped_op factor = int_or_float_op te1 (V.add_untyped_under ~factor) default in let eunder_op = match op with | PlusPI | IndexPI -> begin match Bit_utils.osizeof_pointed te1 with | Int_Base.Top -> fun _ _ -> V.bottom | Int_Base.Value _ as size -> add_untyped_op size end | PlusA -> add_untyped_op (Int_Base.one) | MinusA -> add_untyped_op (Int_Base.minus_one) | _ -> fun _ _ -> under_from_over eover in let eunder = eunder_op r1.eunder r2.eunder in { etype = typ_res; ldeps = join_logic_deps r1.ldeps r2.ldeps; eunder; eover } and eval_tlhost ~alarm_mode env lv = match lv with | TVar { lv_origin = Some v } -> let loc = Location_Bits.inject (Base.of_varinfo v) Ival.zero in { etype = v.vtype; ldeps = empty_logic_deps; eover = loc; eunder = under_loc_from_over loc } | TResult typ -> (match env.result with | Some v -> let loc = Location_Bits.inject (Base.of_varinfo v) Ival.zero in { etype = typ; ldeps = empty_logic_deps; eunder = loc; eover = loc } | None -> no_result ()) | TVar ({ lv_origin = None } as tlv) -> let b, ty = supported_logic_var tlv in let loc = Location_Bits.inject b Ival.zero in { etype = ty; ldeps = empty_logic_deps; eover = loc; eunder = under_loc_from_over loc } | TMem t -> let r = eval_term ~alarm_mode env t in let tres = match Cil.unrollType r.etype with | TPtr (t, _) -> t | _ -> ast_error "*p where p is not a pointer" in { etype = tres; ldeps = r.ldeps; eunder = loc_bytes_to_loc_bits r.eunder; eover = loc_bytes_to_loc_bits r.eover } and eval_toffset ~alarm_mode env typ toffset = match toffset with | TNoOffset -> { etype = typ; ldeps = empty_logic_deps; eunder = Ival.zero; eover = Ival.zero } | TIndex (idx, remaining) -> let typ_e, size = match Cil.unrollType typ with | TArray (t, size, _, _) -> t, size | _ -> ast_error "index on a non-array" in let idx = constraint_trange idx size in let idxs = eval_term ~alarm_mode env idx in let offsrem = eval_toffset ~alarm_mode env typ_e remaining in let size_e = Bit_utils.sizeof typ_e in let eover = let offset = try Cvalue.V.project_ival_bottom idxs.eover with Cvalue.V.Not_based_on_null -> Ival.top in let offset = Ival.scale_int_base size_e offset in Ival.add_int offset offsrem.eover in let eunder = let offset = try Cvalue.V.project_ival idxs.eunder with Cvalue.V.Not_based_on_null -> Ival.bottom in let offset = match size_e with | Int_Base.Top -> Ival.bottom (* Note: scale_int_base would overapproximate when given a Float. Should never happen. *) | Int_Base.Value f -> (match offset with | Ival.Float _ -> assert false | _ -> ()); Ival.scale f offset in Ival.add_int_under offset offsrem.eunder in { etype = offsrem.etype; ldeps = join_logic_deps idxs.ldeps offsrem.ldeps; eunder; eover } | TField (fi, remaining) -> let size_current default = try Ival.of_int (fst (Cil.bitsOffset typ (Field(fi, NoOffset)))) with Cil.SizeOfError _ -> default in let attrs = Cil.filter_qualifier_attributes (Cil.typeAttrs typ) in let typ_fi = Cil.typeAddAttributes attrs fi.ftype in let offsrem = eval_toffset ~alarm_mode env typ_fi remaining in { etype = offsrem.etype; ldeps = offsrem.ldeps; eover = Ival.add_int (size_current Ival.top) offsrem.eover; eunder = Ival.add_int_under (size_current Ival.bottom) offsrem.eunder } | TModel _ -> unsupported "model fields" and eval_thost_toffset ~alarm_mode env thost toffs = let rhost = eval_tlhost ~alarm_mode env thost in let roffset = eval_toffset ~alarm_mode env rhost.etype toffs in { etype = roffset.etype; ldeps = join_logic_deps rhost.ldeps roffset.ldeps; eunder = Location_Bits.shift_under roffset.eunder rhost.eunder; eover = Location_Bits.shift roffset.eover rhost.eover; } and eval_tlval ~alarm_mode env t = match t.term_node with | TLval (thost, toffs) -> eval_thost_toffset ~alarm_mode env thost toffs | Tunion l -> let eunder, eover, deps = List.fold_left (fun (accunder, accover, accdeps) t -> let r = eval_tlval ~alarm_mode env t in Location_Bits.link accunder r.eunder, Location_Bits.join accover r.eover, join_logic_deps accdeps r.ldeps ) (Location_Bits.top, Location_Bits.bottom, empty_logic_deps) l in { etype = infer_type t.term_type; ldeps = deps; eover; eunder } | Tempty_set -> { etype = infer_type t.term_type; ldeps = empty_logic_deps; eunder = Location_Bits.bottom; eover = Location_Bits.bottom } | Tat (t, lab) -> ignore (env_state env lab); eval_tlval ~alarm_mode { env with e_cur = lab } t | TLogic_coerce (_lt, t) -> (* Logic coerce on locations (that are pointers) can only introduce sets, that do not change the abstract value. *) eval_tlval ~alarm_mode env t | Tif (tcond, ttrue, tfalse) -> eval_tif eval_tlval Location_Bits.join Location_Bits.meet ~alarm_mode env tcond ttrue tfalse | _ -> ast_error (Format.asprintf "non-lval term %a" Printer.pp_term t) and eval_tif : 'a. (alarm_mode:_ -> _ -> _ -> 'a eval_result) -> ('a -> 'a -> 'a) -> ('a -> 'a -> 'a) -> alarm_mode:_ -> _ -> _ -> _ -> _ -> 'a eval_result = fun eval join meet ~alarm_mode env tcond ttrue tfalse -> let r = eval_term ~alarm_mode env tcond in let ctrue = Cvalue.V.contains_non_zero r.eover and cfalse = Cvalue.V.contains_zero r.eover in match ctrue, cfalse with | true, true -> let vtrue = eval ~alarm_mode env ttrue in let vfalse = eval ~alarm_mode env tfalse in if not (same_etype vtrue.etype vfalse.etype) then Value_parameters.failure ~current:true "Incoherent types in conditional: %a vs. %a. \ Please report" Printer.pp_typ vtrue.etype Printer.pp_typ vfalse.etype; let eover = join vtrue.eover vfalse.eover in let eunder = meet vtrue.eunder vfalse.eunder in { etype = vtrue.etype; ldeps = join_logic_deps vtrue.ldeps vfalse.ldeps; eunder; eover } | true, false -> eval ~alarm_mode env ttrue | false, true -> eval ~alarm_mode env tfalse | false, false -> assert false (* a logic alarm would have been raised*) (* if you add something here, update known_logic_funs above also *) and eval_known_logic_function ~alarm_mode env li labels args = let lvi = li.l_var_info in match lvi.lv_name, li.l_type, labels, args with | ("strlen" | "wcslen") as b, _, [lbl], [arg] -> let r = eval_term ~alarm_mode env arg in let builtin = if b = "strlen" then Builtins_string.frama_c_strlen_wrapper else Builtins_string.frama_c_wcslen_wrapper in eval_logic_charlen builtin { env with e_cur = lbl } r.eover r.ldeps | ("strchr" | "wcschr") as b, _, [lbl], [arg_s; arg_c] -> let s = eval_term ~alarm_mode env arg_s in let c = eval_term ~alarm_mode env arg_c in let builtin = if b = "strchr" then Builtins_string.frama_c_strchr_wrapper else Builtins_string.frama_c_wcschr_wrapper in eval_logic_charchr builtin { env with e_cur = lbl } s.eover c.eover s.ldeps c.ldeps | ("atan2" | "atan2f" | "fmod" | "fmodf" | "pow" | "powf"), _, _, [arg1; arg2] -> eval_float_builtin_arity2 ~alarm_mode env lvi.lv_name arg1 arg2 | "\\sign", _, _, [arg] -> begin let r = eval_term ~alarm_mode env arg in try let fval = Cvalue.V.project_float r.eover in let sign = match Fval.is_negative fval with | True -> negative_cvalue | False -> positive_cvalue | Unknown -> Cvalue.V.join negative_cvalue positive_cvalue in { (einteger sign) with ldeps = r.ldeps } with Cvalue.V.Not_based_on_null -> c_alarm () end | "\\min", Some Linteger, _, [t1; t2] -> let backward = Cvalue.V.backward_comp_int_left Comp.Le in eval_extremum Cil.intType backward ~alarm_mode env t1 t2 | "\\max", Some Linteger, _, [t1; t2] -> let backward = Cvalue.V.backward_comp_int_left Comp.Ge in eval_extremum Cil.intType backward ~alarm_mode env t1 t2 | "\\min", Some Lreal, _, [t1; t2] -> let backward = Cvalue.V.backward_comp_float_left_true Comp.Le Fval.Real in eval_extremum Cil.floatType backward ~alarm_mode env t1 t2 | "\\max", Some Lreal, _, [t1; t2] -> let backward = Cvalue.V.backward_comp_float_left_true Comp.Ge Fval.Real in eval_extremum Cil.doubleType backward ~alarm_mode env t1 t2 | _ -> assert false and eval_float_builtin_arity2 ~alarm_mode env name arg1 arg2 = let fcaml = match name with | "atan2" -> Fval.atan2 Fval.Double | "atan2f" -> Fval.atan2 Fval.Single | "fmod" -> Fval.fmod Fval.Double | "fmodf" -> Fval.fmod Fval.Single | "pow" -> Fval.pow Fval.Double | "powf" -> Fval.pow Fval.Single | _ -> assert false in let r1 = eval_term ~alarm_mode env arg1 in let r2 = eval_term ~alarm_mode env arg2 in let v = try let i1 = Cvalue.V.project_ival r1.eover in let f1 = Ival.project_float i1 in let i2 = Cvalue.V.project_ival r2.eover in let f2 = Ival.project_float i2 in Cvalue.V.inject_float (fcaml f1 f2) with Cvalue.V.Not_based_on_null -> Cvalue.V.topify_arith_origin (V.join r1.eover r2.eover) in let eunder = under_from_over v in let ldeps = join_logic_deps r1.ldeps r2.ldeps in { etype = r1.etype; eunder; eover = v; ldeps } (* Evaluates the max (resp. the min) between the terms [t1] and [t2], according to [backward_left v1 v2] that reduces [v1] by assuming it is greater than (resp. lower than) [v2]. *) and eval_extremum etype backward_left ~alarm_mode env t1 t2 = let r1 = eval_term ~alarm_mode env t1 and r2 = eval_term ~alarm_mode env t2 in let reduced_v1 = backward_left r1.eover r2.eover and reduced_v2 = backward_left r2.eover r1.eover in let eover = Cvalue.V.join reduced_v1 reduced_v2 in let eunder = Cvalue.V.meet r1.eunder r2.eunder in let ldeps = join_logic_deps r1.ldeps r2.ldeps in {eover; eunder; ldeps; etype} let eval_tlval_as_location ~alarm_mode env t = let r = eval_tlval ~alarm_mode env t in let s = Eval_typ.sizeof_lval_typ r.etype in make_loc r.eover s let eval_tlval_as_location_with_deps ~alarm_mode env t = let r = eval_tlval ~alarm_mode env t in let s = Eval_typ.sizeof_lval_typ r.etype in (make_loc r.eover s, r.ldeps) (* Return a pair of (under-approximating, over-approximating) zones. *) let eval_tlval_as_zone_under_over ~alarm_mode access env t = let r = eval_tlval ~alarm_mode env t in let s = Eval_typ.sizeof_lval_typ r.etype in let under = enumerate_valid_bits_under access (make_loc r.eunder s) in let over = enumerate_valid_bits access (make_loc r.eover s) in (under, over) let eval_tlval_as_zone ~alarm_mode access env t = let _under, over = eval_tlval_as_zone_under_over ~alarm_mode access env t in over (* If casting [trm] to [typ] has no effect in terms of the values contained in [trm], do nothing. Otherwise, raise [exn]. Adapted from [pass_cast] *) let pass_logic_cast exn typ trm = match Logic_utils.unroll_type typ, Logic_utils.unroll_type trm.term_type with | Linteger, Ctype (TInt _ | TEnum _) -> () (* Always inclusion *) | Ctype (TInt _ | TEnum _ as typ), Ctype (TInt _ | TEnum _ as typeoftrm) -> let sztyp = sizeof typ in let szexpr = sizeof typeoftrm in let styp, sexpr = match sztyp, szexpr with | Int_Base.Value styp, Int_Base.Value sexpr -> styp, sexpr | _ -> raise exn in let sityp = is_signed_int_enum_pointer typ in let sisexpr = is_signed_int_enum_pointer typeoftrm in if (Int.ge styp sexpr && sityp = sisexpr) (* larger, same signedness *) || (Int.gt styp sexpr && sityp) (* strictly larger and signed *) then () else raise exn | Lreal, Ctype (TFloat _) -> () (* Always inclusion *) | Ctype (TFloat (f1,_)), Ctype (TFloat (f2, _)) -> if Cil.frank f1 < Cil.frank f2 then raise exn | _ -> raise exn (* Not a scalar type *) exception Not_an_exact_loc (* Evaluate a term as a non-empty under-approximated location, or raise [Not_an_exact_loc]. *) let rec eval_term_as_exact_locs ~alarm_mode env t = match t with | { term_node = TLval _ } -> let loc = eval_tlval ~alarm_mode env t in let typ = loc.etype in (* eval_term_as_exact_loc is only used for reducing values, and we must NOT reduce volatile locations. *) if Cil.typeHasQualifier "volatile" typ then raise Not_an_exact_loc; let loc = Locations.make_loc loc.eunder (Eval_typ.sizeof_lval_typ typ)in if Locations.is_bottom_loc loc then raise Not_an_exact_loc; typ, loc | { term_node = TLogic_coerce(Lreal, t)} -> (* Real is not a supertype of non-finite floats because of NaN and infinites, we do not want to go in the case below. Instead, we check that there are no NaN/infinite, so that the subtyping relation indeed holds. *) let (_, locs) as r = eval_term_as_exact_locs ~alarm_mode env t in let aux loc () = let state = env_current_state env in let v = find_or_alarm ~alarm_mode state loc in let v = Cvalue_forward.reinterpret Cil.longDoubleType v in let is_finite = match V.project_float v with | exception Cvalue.V.Not_based_on_null -> Unknown | f -> Fval.is_finite f in match is_finite with | True -> () | False | Unknown -> raise Not_an_exact_loc in Eval_op.apply_on_all_locs aux locs (); r | { term_node = TLogic_coerce(_, t)} -> (* Otherwise it is always ok to pass through a TLogic_coerce, as the destination type is always a supertype *) eval_term_as_exact_locs ~alarm_mode env t | { term_node = TCastE (ctype, t') } -> pass_logic_cast Not_an_exact_loc (Ctype ctype) t'; eval_term_as_exact_locs ~alarm_mode env t' | { term_node = Tunion [t] } -> eval_term_as_exact_locs ~alarm_mode env t | _ -> raise Not_an_exact_loc (* -------------------------------------------------------------------------- *) (* --- Evaluation and reduction by predicates --- *) (* -------------------------------------------------------------------------- *) (** Auxiliary functions *) let is_same_term_coerce t1 t2 = match t1.term_node, t2.term_node with | TLogic_coerce _, TLogic_coerce _ -> Logic_utils.is_same_term t1 t2 | TLogic_coerce (_,t1), _ -> Logic_utils.is_same_term t1 t2 | _, TLogic_coerce(_,t2) -> Logic_utils.is_same_term t1 t2 | _ -> Logic_utils.is_same_term t1 t2 (* Evaluates a [valid_read_string] or [valid_read_wstring] predicate using str* builtins. - if [bottom] is obtained, return False; - otherwise, if no alarms are emitted, return True; - otherwise, return [Unknown]. *) let eval_valid_read_str ~wide env v = let wrapper = if wide then Builtins_string.frama_c_wcslen_wrapper else Builtins_string.frama_c_strlen_wrapper in match logic_charlen_builtin wrapper (env_current_state env) v with | None -> (* bottom state => string always invalid *) False | Some (_res, alarms) -> if alarms then (* alarm => string possibly invalid *) Unknown else (* no alarm => string always valid for reading *) True (* Evaluates a [valid_string] or [valid_wstring] predicate. First, we check the constness of the arguments. Then, we evaluate [valid_read_string/valid_read_wstring] on non-const ones. *) let eval_valid_str ~wide env v = assert (not (Cvalue.V.is_bottom v)); (* filter const bases *) let v' = Cvalue.V.filter_base (fun b -> not (Base.is_read_only b)) v in if Cvalue.V.is_bottom v' then False (* all bases were const *) else if Cvalue.V.equal v v' then eval_valid_read_str ~wide env v (* all bases non-const *) else (* at least one base was const *) match eval_valid_read_str ~wide env v with | True -> Unknown (* weaken result *) | False | Unknown as r -> r (* Do all the possible values of a location in [state] satisfy [test]? [loc] is an over-approximation of the location, so the answer cannot be [False] even if some parts of [loc] do not satisfy [test]. Thus, this function does not fold the location, but instead applies [test] to the join of all values stored in [loc] in [state]. *) let forall_in_over_location state loc test = let v = Model.find_indeterminate state loc in test v exception EFalse (* Do all the possible values of a location in [state] satisfy [test]? [loc] is an under-approximation of the location, so the answer cannot be [True], as the values of some other parts of the location may not satisfy [test]. However, it is [False] as soon as some part of [loc] contradicts [test]. *) let forall_in_under_location state loc test = let inspect_value (_, _) (value, _, _) acc = match test value with | True | Unknown -> acc | False -> raise EFalse in let inspect_itv base itv acc = match Cvalue.Model.find_base_or_default base state with | `Top | `Bottom -> Unknown | `Value offsm -> Cvalue.V_Offsetmap.fold_between ~entire:true itv inspect_value offsm acc in let inspect_base base intervals acc = Int_Intervals.fold (inspect_itv base) intervals acc in let zone = Locations.enumerate_bits loc in try Zone.fold_i inspect_base zone Unknown with EFalse -> False | Abstract_interp.Error_Top -> Unknown (* Evaluates an universal predicate about the values of a location evaluated to [r] in [state]. The predicates holds whenever all the possible values at the location satisfy [test]. *) let eval_forall_predicate state r test = let size_bits = Eval_typ.sizeof_lval_typ r.etype in let make_loc loc = make_loc loc size_bits in let over_loc = make_loc r.eover in if not Locations.(is_valid Read over_loc) then c_alarm (); match forall_in_over_location state over_loc test with | Unknown -> let under_loc = make_loc r.eunder in forall_in_under_location state under_loc test | True -> True | False -> False (* Evaluation of an \initialized predicate on a location evaluated to [r] in the state [state]. *) let eval_initialized state r = let test = function | V_Or_Uninitialized.C_init_esc _ | V_Or_Uninitialized.C_init_noesc _ -> True | V_Or_Uninitialized.C_uninit_esc _ -> Unknown | V_Or_Uninitialized.C_uninit_noesc v -> if Location_Bytes.is_bottom v then False else Unknown in eval_forall_predicate state r test (* Evaluation of a \dangling predicate on a location evaluated to [r] in the state [state]. *) let eval_dangling state r = let test = function | V_Or_Uninitialized.C_init_esc v -> if Location_Bytes.is_bottom v then True else Unknown | V_Or_Uninitialized.C_uninit_esc _ -> Unknown | V_Or_Uninitialized.C_init_noesc _ | V_Or_Uninitialized.C_uninit_noesc _ -> False in eval_forall_predicate state r test let is_rel_binop = function | Lt | Gt | Le | Ge | Eq | Ne -> true | _ -> false let rel_of_binop = function | Lt -> Rlt | Gt -> Rgt | Le -> Rle | Ge -> Rge | Eq -> Req | Ne -> Rneq | _ -> assert false exception DoNotReduce exception Reduce_to_bottom let reduce_by_valid env positive access (tset: term) = (* Auxiliary function that reduces \valid(lv+offs), where lv is atomic (no more tsets), and offs is a bits-expressed constant offset. [offs_typ] is supposed to be the type of the pointed location after [offs] has been applied; it can be different from [typeOf_pointed lv], for example if offset is a field access. *) let aux lv env (offs_typ, offs) = try if not (Location_Bits.cardinal_zero_or_one lv.eover) || not (Ival.cardinal_zero_or_one offs) then raise DoNotReduce; let state = env_current_state env in let lvloc = make_loc lv.eover (Eval_typ.sizeof_lval_typ lv.etype) in (* [p] is the range that we attempt to reduce *) let alarm_mode = alarm_reduce_mode () in let p_orig = find_or_alarm ~alarm_mode state lvloc in let pb = Locations.loc_bytes_to_loc_bits p_orig in let shifted_p = Location_Bits.shift offs pb in let lshifted_p = make_loc shifted_p (Eval_typ.sizeof_lval_typ offs_typ) in let valid = (* reduce the shifted pointer to the wanted part *) if positive then Locations.valid_part access lshifted_p else Locations.invalid_part lshifted_p in let valid = valid.loc in if Location_Bits.equal shifted_p valid then env else (* Shift back *) let shift = Ival.neg_int offs in let pb = Location_Bits.shift shift valid in let p = Locations.loc_bits_to_loc_bytes pb in (* Store the result *) let state = Model.reduce_previous_binding state lvloc p in overwrite_current_state env state with | DoNotReduce | V.Not_based_on_null | Cil.SizeOfError _ | LogicEvalError _ -> env in (* Auxiliary function to reduce by the under-approximation of an offset. Since validities are contiguous, we simply reduce by the minimum and maximum of the under-approximation. *) let aux_min_max_offset f env off = try let env = match Ival.min_int off with | None -> env | Some min -> f env (Ival.inject_singleton min) in match Ival.max_int off with | None -> env | Some max -> f env (Ival.inject_singleton max) with Abstract_interp.Error_Bottom -> env in (* reduce [loc] so that its contents are a valid pointer to [typ] *) let aux_one_lval typ loc env = try let state = Eval_op.reduce_by_valid_loc ~positive access loc typ (env_current_state env) in overwrite_current_state env state with LogicEvalError _ -> env in (* reduce [t], which must be valid term-lval, so that its contents are a valid pointer to [typ]. If [typ] is not supplied, it is inferred from the type of [t]. *) let aux_lval ?typ t env = try let alarm_mode = alarm_reduce_mode () in let r = eval_tlval ~alarm_mode env t in let typ = match typ with None -> r.etype | Some t -> t in let loc = make_loc r.eunder (Eval_typ.sizeof_lval_typ typ) in let r = Eval_op.apply_on_all_locs (aux_one_lval typ) loc env in r with LogicEvalError _ -> env in let rec do_one env t = match t.term_node with | Tunion l -> List.fold_left do_one env l | TLval _ -> aux_lval t env | TCastE (typ, ({term_node = TLval _} as t)) -> aux_lval ~typ t env | TAddrOf (TMem ({term_node = TLval _} as t), offs) -> (try let alarm_mode = alarm_reduce_mode () in let lt = eval_tlval ~alarm_mode env t in let typ = lt.etype in (* Compute the offsets, that depend on the type of the lval. The computed list is exactly what [aux] requires *) let roffs = eval_toffset ~alarm_mode env (Cil.typeOf_pointed typ) offs in let aux env offs = aux lt env (roffs.etype, offs) in aux_min_max_offset aux env roffs.eunder with LogicEvalError _ -> env) | TBinOp ((PlusPI | MinusPI) as op, ({term_node = TLval _} as tlv), i) -> (try let alarm_mode = alarm_reduce_mode () in let rtlv = eval_tlval ~alarm_mode env tlv in let ri = eval_term ~alarm_mode env i in (* Convert offsets to a simpler form if [op] is [MinusPI] *) let li = try V.project_ival ri.eunder with V.Not_based_on_null -> raise Exit in let li = if op = PlusPI then li else Ival.neg_int li in let typ_p = Cil.typeOf_pointed rtlv.etype in let sbits = Int.of_int (Cil.bitsSizeOf typ_p) in (* Compute the offsets expected by [aux], which are [i * 8 * sizeof( *tlv)] *) let li = Ival.scale sbits li in (* Now reduce [tlv] by values possible for [i] *) let aux env offs = aux rtlv env (typ_p, offs) in aux_min_max_offset aux env li with | LogicEvalError _ | Exit -> env ) | _ -> env in do_one env tset (* reduce [tl] so that [rl rel tr] holds *) let reduce_by_left_relation ~alarm_mode env positive tl rel tr = try let debug = false in if debug then Format.printf "#Left term %a@." Printer.pp_term tl; let typ_loc, locs = eval_term_as_exact_locs ~alarm_mode env tl in let reduce = Eval_op.backward_comp_left_from_type typ_loc in let rtl = eval_term ~alarm_mode env tr in let cond_v = rtl.eover in if debug then Format.printf "#Val right term %a@." V.pretty cond_v; let aux loc env = let state = env_current_state env in if debug then Format.printf "#Left term as lv loc %a, typ %a@." Locations.pretty loc Printer.pp_typ typ_loc; let v = find_or_alarm ~alarm_mode state loc in if debug then Format.printf "#Val left lval %a@." V.pretty v; let v = Cvalue_forward.reinterpret typ_loc v in if debug then Format.printf "#Cast left lval %a@." V.pretty v; let comp = Value_util.conv_relation rel in let v' = reduce positive comp v cond_v in if debug then Format.printf "#Val reduced %a@." V.pretty v'; (* TODOBY: if loc is an int that has been silently cast to real, we end up reducing an int according to a float. Instead, we should convert v to real, then cast back v_asym to the good range *) if V.is_bottom v' then raise Reduce_to_bottom; if V.equal v' v then env else let state' = Cvalue.Model.reduce_previous_binding state loc v' in overwrite_current_state env state' in Eval_op.apply_on_all_locs aux locs env with Not_an_exact_loc | LogicEvalError _ -> env let rec reduce_by_relation ~alarm_mode env positive t1 rel t2 = (* special case: t1 is a term of the form "a rel' b", and is compared to "== 0" or "!= 0" => evaluate t1 directly; note: such terms may be created by other evaluation/reduction functions e.g. eval_predicate, reduce_by_predicate_content *) match t1.term_node, rel with | TBinOp (bop, t1', t2'), Rneq when is_rel_binop bop && Cil.isLogicZero t2 -> reduce_by_relation ~alarm_mode env positive t1' (rel_of_binop bop) t2' | TBinOp (bop, t1', t2'), Req when is_rel_binop bop && Cil.isLogicZero t2 -> reduce_by_relation ~alarm_mode env (not positive) t1' (rel_of_binop bop) t2' | _ -> let env = reduce_by_left_relation ~alarm_mode env positive t1 rel t2 in let sym_rel = match rel with | Rgt -> Rlt | Rlt -> Rgt | Rle -> Rge | Rge -> Rle | Req -> Req | Rneq -> Rneq in reduce_by_left_relation ~alarm_mode env positive t2 sym_rel t1 (* if you add something here, update [known_predicates] above also (and of course [eval_known_papp] below). May raise LogicEvalError or Not_an_exact_loc, when no reduction can be done, and Reduce_to_bottom, in which case the reduction leads to bottom. *) let reduce_by_known_papp ~alarm_mode env positive li _labels args = (* If the term [arg] is a floating-point lvalue with an exact location, reduces its value in [env] by using the backward propagator on fval [fval_reduce]. *) let reduce_float fval_reduce arg = try let typ_loc, locs = eval_term_as_exact_locs ~alarm_mode env arg in let aux loc env = let state = env_current_state env in let v = find_or_alarm ~alarm_mode state loc in let v = Cvalue_forward.reinterpret typ_loc v in let v = match Cil.unrollType typ_loc with | TFloat (fkind,_) -> begin let v = Cvalue.V.project_float v in let kind = Fval.kind fkind in match fval_reduce kind v with | `Value f -> V.inject_float f | `Bottom -> V.bottom end | _ -> (* Better safe than sorry, we may have e.g. en int location here *) raise Not_an_exact_loc in let state' = Cvalue.Model.reduce_previous_binding state loc v in overwrite_current_state env state' in Eval_op.apply_on_all_locs aux locs env with Cvalue.V.Not_based_on_null -> env in (* Reduces [f] to positive or negative infinity (according to [pos]), or to the complement if [positive] is false. *) let reduce_by_infinity ~pos prec f = let inf = if pos then Fval.pos_infinity prec else Fval.neg_infinity prec in let fval = if positive then inf else Fval.(join nan (join (Fval.neg inf) (top_finite prec))) in Fval.narrow fval f in match li.l_var_info.lv_name, args with | "\\is_finite", [arg] -> reduce_float (Fval.backward_is_finite ~positive) arg | "\\is_plus_infinity", [arg] -> reduce_float (reduce_by_infinity ~pos:true) arg | "\\is_minus_infinity", [arg] -> reduce_float (reduce_by_infinity ~pos:false) arg | "\\is_NaN", [arg] -> reduce_float (fun _fkind -> Fval.backward_is_nan ~positive) arg | ("\\eq_float" | "\\eq_double"), [t1;t2] -> reduce_by_relation ~alarm_mode env positive t1 Req t2 | ("\\ne_float" | "\\ne_double"), [t1;t2] -> reduce_by_relation ~alarm_mode env positive t1 Rneq t2 | ("\\lt_float" | "\\lt_double"), [t1;t2] -> reduce_by_relation ~alarm_mode env positive t1 Rlt t2 | ("\\le_float" | "\\le_double"), [t1;t2] -> reduce_by_relation ~alarm_mode env positive t1 Rle t2 | ("\\gt_float" | "\\gt_double"), [t1;t2] -> reduce_by_relation ~alarm_mode env positive t1 Rgt t2 | ("\\ge_float" | "\\ge_double"), [t1;t2] -> reduce_by_relation ~alarm_mode env positive t1 Rge t2 | "\\subset", [argl;argr] when positive -> let alarm_mode = alarm_reduce_mode () in let vr = (eval_term ~alarm_mode env argr).eover in let _typ, locsl = eval_term_as_exact_locs ~alarm_mode env argl in let aux locl env = let state = env_current_state env in let vl = find_or_alarm ~alarm_mode state locl in let reduced = V.narrow vl vr in if V.equal V.bottom reduced then raise Reduce_to_bottom; let state' = Cvalue.Model.reduce_previous_binding state locl reduced in overwrite_current_state env state' in Eval_op.apply_on_all_locs aux locsl env | _ -> (* Do not fail here. We can be asked to reduce on predicates that we can evaluate, but on which we are not able to reduce on (yet ?).*) env (** Big recursive functions for predicates *) let rec reduce_by_predicate ~alarm_mode env positive p = let loc = p.pred_loc in let rec reduce_by_predicate_content env positive p_content = match positive,p_content with | true,Ptrue | false,Pfalse -> env | true,Pfalse | false,Ptrue -> overwrite_current_state env Cvalue.Model.bottom (* desugared form of a <= b <= c <= d *) | true, Pand ( {pred_content=Pand ( {pred_content=Prel ((Rlt | Rgt | Rle | Rge | Req as op),_ta,tb) as p1}, {pred_content=Prel (op', tb',tc) as p2})}, {pred_content=Prel (op'',tc',_td) as p3}) when op = op' && op' = op'' && is_same_term_coerce tb tb' && is_same_term_coerce tc tc' -> let red env p = reduce_by_predicate_content env positive p in let env = red env p1 in let env = red env p3 in let env = red env p2 in (*Not really useful in practice*) (*let env = red env (Prel (op, ta, tc)) in let env = red env (Prel (op, tb, td)) in *) env | true,Pand (p1,p2) | false,Por(p1,p2)-> let r1 = reduce_by_predicate ~alarm_mode env positive p1 in reduce_by_predicate ~alarm_mode r1 positive p2 | true,Por (p1,p2 ) | false,Pand (p1, p2) -> let env1 = reduce_by_predicate ~alarm_mode env positive p1 in let env2 = reduce_by_predicate ~alarm_mode env positive p2 in join_env env1 env2 | true,Pimplies (p1,p2) -> let env1 = reduce_by_predicate ~alarm_mode env false p1 in let env2 = reduce_by_predicate ~alarm_mode env true p2 in join_env env1 env2 | false,Pimplies (p1,p2) -> reduce_by_predicate ~alarm_mode (reduce_by_predicate ~alarm_mode env true p1) false p2 | _,Pnot p -> reduce_by_predicate ~alarm_mode env (not positive) p | true,Piff (p1, p2) -> let red1 = reduce_by_predicate_content env true (Pand (p1, p2)) in let red2 = reduce_by_predicate_content env false (Por (p1, p2)) in join_env red1 red2 | false,Piff (p1, p2) -> reduce_by_predicate ~alarm_mode env true (Logic_const.por ~loc (Logic_const.pand ~loc (p1, Logic_const.pnot ~loc p2), Logic_const.pand ~loc (Logic_const.pnot ~loc p1, p2))) | _,Pxor(p1,p2) -> reduce_by_predicate ~alarm_mode env (not positive) (Logic_const.piff ~loc (p1, p2)) | _,Prel (op,t1,t2) -> begin try (* ugly, but eval_predicate_content does not exist yet *) let p = Logic_const.unamed ~loc p_content in let p' = if positive then p else Logic_const.pnot ~loc p in (* Evaluate the predicate before reducing. In some cases, although evaluation results in Bottom, reduction fails to reduce the resulting env to Bottom, and we lose precision. *) match eval_predicate env p' with | True -> env | False -> overwrite_current_state env Cvalue.Model.bottom | Unknown -> reduce_by_relation ~alarm_mode env positive t1 op t2 with | DoNotReduce | LogicEvalError _ -> env | Reduce_to_bottom -> overwrite_current_state env Cvalue.Model.bottom (* if the exception was obtained without an alarm emitted, it is correct to return the bottom state *) end | _,Pvalid (_label,tsets) -> (* TODO: label should not be ignored. Instead, we should clear variables that are not in scope at the label. *) reduce_by_valid env positive Write tsets | _,Pvalid_read (_label,tsets) -> reduce_by_valid env positive Read tsets | _,Pvalid_function _tsets -> env (* TODO *) | _,(Pinitialized (lbl_initialized,tsets) | Pdangling (lbl_initialized,tsets)) -> begin try let alarm_mode = alarm_reduce_mode () in (* See comments in the code for the evaluation of Pinitialized *) let star_tsets = deref_tsets tsets in let rlocb = eval_tlval ~alarm_mode env star_tsets in (* No reduction on negations of \initialized or \dangling on multiple locations: at least one of them is non initialized/dangling, but which one? Reduction would only be possible in the rare case where only one of the locations might be non initialized/dangling. *) if not (positive || Location_Bits.cardinal_zero_or_one rlocb.eover) then env else let size = Eval_typ.sizeof_lval_typ rlocb.etype in let state = env_state env lbl_initialized in let fred = match p_content with | Pinitialized _ -> V_Or_Uninitialized.reduce_by_initializedness | Pdangling _ -> V_Or_Uninitialized.reduce_by_danglingness | _ -> assert false in let fred = Eval_op.reduce_by_initialized_defined (fred positive) in let state_reduced = let loc = make_loc rlocb.eunder size in let loc = Eval_op.make_loc_contiguous loc in Eval_op.apply_on_all_locs fred loc state in overwrite_state env state_reduced lbl_initialized with LogicEvalError _ -> env end | _,Pat (p, lbl) -> (try let env_at = { env with e_cur = lbl } in let env' = reduce_by_predicate ~alarm_mode env_at positive p in { env' with e_cur = env.e_cur } with LogicEvalError _ -> env) | true, Pforall (varl, p) | false, Pexists (varl, p) -> begin try (* TODO: add case analysis on the variables of the quantification that are constrained *) let env = bind_logic_vars env varl in let env_result = reduce_by_predicate ~alarm_mode env true p in unbind_logic_vars env_result varl with LogicEvalError _ -> env end | _,Papp (li, labels, args) -> begin if is_known_predicate li.l_var_info then try reduce_by_known_papp ~alarm_mode env positive li labels args with | Reduce_to_bottom -> overwrite_current_state env Model.bottom | LogicEvalError _ | Not_an_exact_loc -> env else match Inline.inline_predicate ~inline ~current:env.e_cur p with | None -> env | Some p' -> reduce_by_predicate_content env positive p'.pred_content end | _,Pif (tcond, ptrue, pfalse) -> begin let reduce = reduce_by_predicate ~alarm_mode in let r = eval_term ~alarm_mode env tcond in let ctrue = Cvalue.V.contains_non_zero r.eover in let cfalse = Cvalue.V.contains_zero r.eover in match ctrue, cfalse with | true, true -> let reduce_by_rel = reduce_by_relation ~alarm_mode env positive tcond in let env_true = reduce_by_rel Cil_types.Rneq (Cil.lzero ()) in let env_false = reduce_by_rel Cil_types.Req (Cil.lzero ()) in let env_true = reduce env_true positive ptrue in let env_false = reduce env_false positive pfalse in join_env env_true env_false | true, false -> reduce env positive ptrue | false, true -> reduce env positive pfalse | false, false -> assert false (* a logic alarm would have been raised*) end | true, Pexists (_, _) | false, Pforall (_, _) | _,Plet (_, _) | _,Pallocable (_,_) | _,Pfreeable (_,_) | _,Pfresh (_,_,_,_) | _, Pseparated _ -> env in reduce_by_predicate_content env positive p.pred_content and eval_predicate env pred = let alarm_mode = Fail in let loc = pred.pred_loc in let rec do_eval env p = match p.pred_content with | Ptrue -> True | Pfalse -> False | Pand (p1,p2 ) -> begin match do_eval env p1 with | True -> do_eval env p2 | False -> False | Unknown -> let reduced = reduce_by_predicate ~alarm_mode env true p1 in match do_eval reduced p2 with | False -> False | _ -> Unknown end | Por (p1,p2 ) -> let val_p1 = do_eval env p1 in (*Format.printf "Disjunction: state %a p1:%a@." Cvalue.Model.pretty (env_current_state env) Printer.pp_predicate p1; *) begin match val_p1 with | True -> True | False -> do_eval env p2 | Unknown -> begin let reduced_state = reduce_by_predicate ~alarm_mode env false p1 in (* Format.printf "Disjunction: reduced to %a to eval %a@." Cvalue.Model.pretty (env_current_state reduced_state) Printer.pp_predicate p2; *) match do_eval reduced_state p2 with | True -> True | _ -> Unknown end end | Pxor (p1,p2) -> begin match do_eval env p1, do_eval env p2 with | True, True -> False | False, False -> False | True, False | False, True -> True | Unknown, _ | _, Unknown -> Unknown end | Piff (p1,p2 ) -> begin match do_eval env p1,do_eval env p2 with | True, True | False, False -> True | Unknown, _ | _, Unknown -> Unknown | _ -> False end | Pat (p, lbl) -> begin ignore (env_state env lbl); try do_eval { env with e_cur = lbl } p with LogicEvalError ee -> display_evaluation_error ~loc:p.pred_loc ee; Unknown end | Pvalid (_label, tsets) | Pvalid_read (_label, tsets) -> begin (* TODO: see same constructor in reduce_by_predicate *) try let access = match p.pred_content with Pvalid_read _ -> Read | _ -> Write in let state = env_current_state env in let typ_pointed = Logic_typing.ctype_of_pointed tsets.term_type in (* Check if we are trying to write in a const l-value *) if access = Write && Value_util.is_const_write_invalid typ_pointed then raise Stop; let size = Eval_typ.sizeof_lval_typ typ_pointed in (* Check that the given location is valid *) let valid ~over:locbytes_over ~under:locbytes_under = let loc = loc_bytes_to_loc_bits locbytes_over in let loc = Locations.make_loc loc size in if not Locations.(is_valid access loc) then ( (* \valid does not hold if the over-approximation is invalid everywhere, or if a part of the under-approximation is invalid *) let valid = valid_part access loc in if Locations.is_bottom_loc valid then raise Stop; let loc_under = loc_bytes_to_loc_bits locbytes_under in let loc_under = Locations.make_loc loc_under size in let valid_loc_under = Locations.valid_part access loc_under in if not (Location.equal loc_under valid_loc_under) then raise Stop; raise DoNotReduce (* In any case *)) in (match tsets.term_node with | TLval _ -> (* Evaluate the left-value, and check that it is initialized and not an escaping pointer *) let loc = eval_tlval_as_location ~alarm_mode env tsets in if not Locations.(is_valid Read loc) then c_alarm (); let v = Model.find_indeterminate state loc in let v, ok = match v with | Cvalue.V_Or_Uninitialized.C_uninit_esc v | Cvalue.V_Or_Uninitialized.C_uninit_noesc v | Cvalue.V_Or_Uninitialized.C_init_esc v -> v, false | Cvalue.V_Or_Uninitialized.C_init_noesc v -> v, true in if Cvalue.V.is_bottom v && not ok then raise Stop; valid ~over:v ~under:V.bottom (*No precise under-approximation*); if not ok then raise DoNotReduce | _ -> let v = eval_term ~alarm_mode env tsets in valid ~over:v.eover ~under:v.eunder ); True with | DoNotReduce -> Unknown | LogicEvalError ee -> display_evaluation_error ~loc:p.pred_loc ee; Unknown | Stop -> False end | Pvalid_function tsets -> begin try let v = eval_term ~alarm_mode env tsets in let funs, warn = Main_values.CVal.resolve_functions v.eover in match funs with | `Top -> Unknown | `Value funs -> let typ = Cil.typeOf_pointed v.etype in let funs, warn' = Eval_typ.compatible_functions typ funs in if warn || warn' then (* No function possible -> signal hard error. Otherwise, follow Eva's convention, which is not to stop on semi-ok functions. *) if funs = [] then False else Unknown else True with | LogicEvalError ee -> display_evaluation_error ~loc:p.pred_loc ee; Unknown end | Pinitialized (label,tsets) | Pdangling (label,tsets) -> begin try (* Create [*tsets] and compute its location. This is important in case [tsets] points to the address of a bitfield, which we cannot evaluate as a pointer (indexed on bytes) *) let star_tsets = deref_tsets tsets in let locb = eval_tlval ~alarm_mode env star_tsets in let state = env_state env label in match p.pred_content with | Pinitialized _ -> eval_initialized state locb | Pdangling _ -> eval_dangling state locb | _ -> assert false with | LogicEvalError ee -> display_evaluation_error ~loc:p.pred_loc ee; Unknown end | Prel (op,t1,t2) -> begin try let r = eval_binop ~alarm_mode env (lop_to_cop op) t1 t2 in if V.equal V.singleton_zero r.eover then False else if V.equal V.singleton_one r.eover then True else Unknown with | LogicEvalError ee -> display_evaluation_error ~loc:p.pred_loc ee; Unknown end | Pforall (varl, p') | Pexists (varl, p') -> begin try let env = bind_logic_vars env varl in let r = do_eval env p' in match p.pred_content with | Pexists _ -> if r = False then False else Unknown | Pforall _ -> if r = True then True else Unknown | _ -> assert false with | LogicEvalError _ee -> (*display_evaluation_error ~loc ee;*) Unknown end | Pnot p -> begin match do_eval env p with | True -> False | False -> True | Unknown -> Unknown end | Pimplies (p1,p2) -> do_eval env (Logic_const.por ~loc ((Logic_const.pnot ~loc p1), p2)) | Pseparated ltsets -> (try let to_zones tset = (* Create [*tset] and compute its location. This is important in case [tset] points to the address of a bitfield, which we cannot evaluate as a pointer (indexed on bytes). *) let star_tset = deref_tsets tset in let rtset = eval_tlval ~alarm_mode env star_tset in let size = Eval_typ.sizeof_lval_typ rtset.etype in let loc_over = rtset.eover in let loc_under = rtset.eunder in Locations.enumerate_bits (Locations.make_loc loc_over size), Locations.enumerate_bits_under (Locations.make_loc loc_under size) in let lz = List.map to_zones ltsets in let unknown = ref false in (* Are those two lists of locations separated? *) let do_two (z1, zu1) l2 = let combine (z2, zu2) = if Zone.intersects z1 z2 then begin unknown := true; if Zone.intersects zu1 zu2 then raise Exit; end in List.iter combine l2 in let rec aux = function | [] | [_] -> () | loc :: qlocs -> do_two loc qlocs; aux qlocs in aux lz; if !unknown then Unknown else True with | Exit -> False | LogicEvalError ee -> display_evaluation_error ~loc:p.pred_loc ee; Unknown) | Papp (li, labels, args) -> begin if is_known_predicate li.l_var_info then eval_known_papp env li labels args else match Inline.inline_predicate ~inline ~current:env.e_cur p with | None -> Unknown | Some p' -> do_eval env p' end | Pif (tcond, ptrue, pfalse) -> begin let r = eval_term ~alarm_mode env tcond in let ctrue = Cvalue.V.contains_non_zero r.eover and cfalse = Cvalue.V.contains_zero r.eover in match ctrue, cfalse with | true, true -> let reduce_by_rel = reduce_by_relation ~alarm_mode env true tcond in let env_true = reduce_by_rel Cil_types.Rneq (Cil.lzero ()) in let env_false = reduce_by_rel Cil_types.Req (Cil.lzero ()) in join_predicate_status (do_eval env_true ptrue) (do_eval env_false pfalse) | true, false -> do_eval env ptrue | false, true -> do_eval env pfalse | false, false -> assert false (* a logic alarm would have been raised*) end | Pfreeable (BuiltinLabel Here, t) -> let r = eval_term ~alarm_mode env t in Builtins_malloc.freeable r.eover | Pfresh (_,_,_,_) | Pallocable _ | Pfreeable _ | Plet (_,_) -> Unknown (* Logic predicates. Update the list known_predicates above if you add something here. *) and eval_known_papp env li _labels args = let unary_float unary_fun arg = try let eval_result = eval_term ~alarm_mode env arg in unary_fun (V.project_float eval_result.eover) with | V.Not_based_on_null -> Unknown | LogicEvalError ee -> display_evaluation_error ~loc ee; Unknown in let fval_cmp comp arg1 arg2 = try let e1 = eval_term ~alarm_mode env arg1 and e2 = eval_term ~alarm_mode env arg2 in let f1 = V.project_float e1.eover and f2 = V.project_float e2.eover in Fval.forward_comp comp f1 f2 with | V.Not_based_on_null -> Unknown | LogicEvalError ee -> display_evaluation_error ~loc ee; Unknown in match li.l_var_info.lv_name, args with | "\\is_finite", [arg] -> unary_float Fval.is_finite arg | "\\is_plus_infinity", [arg] -> let pos_inf = Fval.pos_infinity Float_sig.Single in unary_float (fun f -> Fval.forward_comp Comp.Eq f pos_inf) arg | "\\is_minus_infinity", [arg] -> let neg_inf = Fval.neg_infinity Float_sig.Single in unary_float (fun f -> Fval.forward_comp Comp.Eq f neg_inf) arg | "\\is_NaN", [arg] -> inv_truth (unary_float Fval.is_not_nan arg) | ("\\eq_float" | "\\eq_double"), [arg1;arg2] -> fval_cmp Comp.Eq arg1 arg2 | ("\\ne_float" | "\\ne_double"), [arg1;arg2] -> fval_cmp Comp.Ne arg1 arg2 | ("\\lt_float" | "\\lt_double"), [arg1;arg2] -> fval_cmp Comp.Lt arg1 arg2 | ("\\le_float" | "\\le_double"), [arg1;arg2] -> fval_cmp Comp.Le arg1 arg2 | ("\\gt_float" | "\\gt_double"), [arg1;arg2] -> fval_cmp Comp.Gt arg1 arg2 | ("\\ge_float" | "\\ge_double"), [arg1;arg2] -> fval_cmp Comp.Ge arg1 arg2 | "\\warning", _ -> begin match args with | [{ term_node = TConst(LStr(str))}] -> Value_parameters.warning "reached \\warning(\"%s\")" str; Unknown | _ -> Value_parameters.abort "Wrong argument: \\warning expects a constant string" end | "\\subset", [argl;argr] -> begin try let l = eval_term ~alarm_mode env argl in let r = eval_term ~alarm_mode env argr in if V.is_included l.eover r.eunder then True (* all elements of [l] are included in the guaranteed elements of [r] *) else if not (V.is_included l.eunder r.eover) || not (V.intersects l.eover r.eover) then False (* one guaranteed element of [l] is not included in [r], or [l] and [r] are disjoint, in which case there is an element of [l] not in [r]. (Here, [l] is not bottom, as [V.is_included bottom r.eunder] holds. *) else Unknown with | LogicEvalError ee -> display_evaluation_error ~loc ee; Unknown end | "valid_read_string", [arg] -> begin try let r = eval_term ~alarm_mode env arg in eval_valid_read_str ~wide:false env r.eover with LogicEvalError ee -> display_evaluation_error ~loc ee; Unknown end | "valid_string", [arg] -> begin try let r = eval_term ~alarm_mode env arg in eval_valid_str ~wide:false env r.eover with LogicEvalError ee -> display_evaluation_error ~loc ee; Unknown end | "valid_read_wstring", [arg] -> begin try let r = eval_term ~alarm_mode env arg in eval_valid_read_str ~wide:true env r.eover with LogicEvalError ee -> display_evaluation_error ~loc ee; Unknown end | "valid_wstring", [arg] -> begin try let r = eval_term ~alarm_mode env arg in eval_valid_str ~wide:true env r.eover with LogicEvalError ee -> display_evaluation_error ~loc ee; Unknown end | "is_allocable", [arg] when comes_from_fc_stdlib li.l_var_info -> begin try let r = eval_term ~alarm_mode env arg in eval_is_allocable r.eover with LogicEvalError ee -> display_evaluation_error ~loc ee; Unknown end | _, _ -> assert false in try (* Each case of the matching above should handle evaluation errors. This is just an additional security. *) do_eval env pred with LogicEvalError ee -> display_evaluation_error ~loc ee; Unknown (* -------------------------------------------------------------------------- *) (* --- Dependencies of predicates --- *) (* -------------------------------------------------------------------------- *) (* Currently unused (and untested *) let predicate_deps env pred = let alarm_mode = Ignore in let rec do_eval env p = match p.pred_content with | Ptrue | Pfalse -> empty_logic_deps | Pand (p1, p2) | Por (p1, p2 ) | Pxor (p1, p2) | Piff (p1, p2 ) | Pimplies (p1, p2) -> join_logic_deps (do_eval env p1) (do_eval env p2) | Prel (_, t1, t2) -> join_logic_deps (eval_term ~alarm_mode env t1).ldeps (eval_term ~alarm_mode env t2).ldeps | Pif (c, p1, p2) -> join_logic_deps (eval_term ~alarm_mode env c).ldeps (join_logic_deps (do_eval env p1) (do_eval env p2)) | Pat (p, lbl) -> do_eval { env with e_cur = lbl } p | Pvalid (_, tsets) | Pvalid_read (_, tsets) | Pvalid_function tsets-> (eval_tlval ~alarm_mode env tsets).ldeps | Pinitialized (lbl, tsets) | Pdangling (lbl, tsets) -> let loc, deploc = eval_tlval_as_location_with_deps ~alarm_mode env tsets in let zone = enumerate_valid_bits Locations.Read loc in Logic_label.Map.add lbl zone deploc | Pnot p -> do_eval env p | Pseparated ltsets -> let evaled = List.map (eval_tlval ~alarm_mode env) ltsets in List.fold_left (fun acc e -> join_logic_deps acc e.ldeps) empty_logic_deps evaled | Pexists (l, p) | Pforall (l, p) -> let env = bind_logic_vars env l in (* TODO: unbind all references to l in the results? If so, clean up Logic_interp.do_term_lval. *) do_eval env p | Plet (_v, p) -> do_eval env p (* will this work when when we need [_v] to evaluate [p] ?.. *) | Papp (li, _labels, _args) -> begin if is_known_predicate li.l_var_info then assert false (* TODO! Must evaluate the arguments, plus the dependencies of the predicate itself. *) else match Inline.inline_predicate ~inline ~current:env.e_cur p with | None -> assert false | Some p' -> do_eval env p' end | Pfresh _ | Pallocable _ | Pfreeable _ -> assert false in do_eval env pred (* -------------------------------------------------------------------------- *) (* --- Export --- *) (* -------------------------------------------------------------------------- *) (* Position default value for ~alarm_mode *) let reduce_by_predicate env positive p = let alarm_mode = alarm_reduce_mode () in reduce_by_predicate ~alarm_mode env positive p let () = (* TODO: deprecate loc_to_loc, move loc_to_locs into Value *) Db.Properties.Interp.loc_to_loc := (fun ~result state t -> let env = env_post_f ~pre:state ~post:state ~result () in try eval_tlval_as_location ~alarm_mode:Ignore env t with LogicEvalError _ -> raise Db.Properties.Interp.No_conversion ); (* TODO: specify better evaluation environment *) Db.Properties.Interp.loc_to_loc_under_over := (fun ~result state t -> let env = env_post_f ~pre:state ~post:state ~result () in try let r= eval_tlval ~alarm_mode:Ignore env t in let s = Eval_typ.sizeof_lval_typ r.etype in make_loc r.eunder s, make_loc r.eover s, deps_at lbl_here r.ldeps with LogicEvalError _ -> raise Db.Properties.Interp.No_conversion ); (* Local Variables: compile-command: "make -C ../../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/legacy/eval_terms.mli����������������������������������������0000666�0000000�0000000�00000010637�13571573400�020716� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Evaluation of terms and predicates *) open Cil_types open Locations open Cvalue (** Evaluating a predicate. [Unknown] is the Top of the lattice *) type predicate_status = Abstract_interp.Comp.result = True | False | Unknown val pretty_predicate_status : Format.formatter -> predicate_status -> unit val join_predicate_status : predicate_status -> predicate_status -> predicate_status (* val join_list_predicate_status : predicate_status list -> predicate_status *) (** Error during the evaluation of a term or a predicate *) type logic_evaluation_error = | Unsupported of string | UnsupportedLogicVar of logic_var | AstError of string | NoEnv of logic_label | NoResult | CAlarm val pretty_logic_evaluation_error : Format.formatter -> logic_evaluation_error -> unit exception LogicEvalError of logic_evaluation_error type labels_states = Cvalue.Model.t Cil_datatype.Logic_label.Map.t (** Evaluation environment. Currently available are function Pre and Post, or the environment to evaluate an annotation *) type eval_env val make_env: Model.t Abstract_domain.logic_environment -> Model.t -> eval_env val env_pre_f : pre:Model.t -> unit -> eval_env val env_annot : ?c_labels:labels_states -> pre:Model.t -> here:Model.t -> unit -> eval_env val env_post_f : ?c_labels:labels_states -> pre:Model.t -> post:Model.t -> result:varinfo option -> unit -> eval_env val env_assigns: pre:Model.t -> eval_env (** Used by auxiliary plugins, that do not supply the other states *) val env_only_here: Model.t -> eval_env val env_current_state: eval_env -> Model.t (** Dependencies needed to evaluate a term or a predicate *) type logic_deps = Zone.t Cil_datatype.Logic_label.Map.t (** Three modes to handle the alarms when evaluating a logical term. *) type alarm_mode = | Ignore (* Ignores all alarms. *) | Fail (* Raises a LogicEvalError when an alarm is encountered. *) | Track of bool ref (* Tracks the possibility of an alarm in the boolean: the boolean is set to true if an alarm is encountered. *) (** Return a pair of (under-approximating, over-approximating) zones. *) val eval_tlval_as_zone_under_over: alarm_mode:alarm_mode -> Locations.access -> eval_env -> term -> Zone.t * Zone.t (* ML: Should not be exported. *) type 'a eval_result = { etype: Cil_types.typ; eunder: 'a; eover: 'a; ldeps: logic_deps; } val eval_term : alarm_mode:alarm_mode -> eval_env -> term -> V.t eval_result val eval_tlval_as_location : alarm_mode:alarm_mode -> eval_env -> term -> location val eval_tlval_as_zone : alarm_mode:alarm_mode -> Locations.access -> eval_env -> term -> Zone.t val eval_predicate : eval_env -> predicate -> predicate_status val predicate_deps: eval_env -> predicate -> logic_deps val reduce_by_predicate : eval_env -> bool -> predicate -> eval_env �������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/legacy/function_args.ml��������������������������������������0000666�0000000�0000000�00000006775�13571573400�021255� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types exception Actual_is_bottom exception WrongFunctionType (* at a call through a pointer *) let rec fold_left2_best_effort f acc l1 l2 = match l1,l2 with | _,[] -> acc | [],_ -> raise WrongFunctionType (* Too few arguments *) | (x1::r1),(x2::r2) -> fold_left2_best_effort f (f acc x1 x2) r1 r2 let actualize_formals kf state actuals = let formals = Kernel_function.get_formals kf in let treat_one_formal acc actual_o formal = Cvalue.Model.add_base (Base.of_varinfo formal) actual_o acc in fold_left2_best_effort treat_one_formal state actuals formals let offsetmap_of_lv state lv = let open Locations in let state, loc_to_read, _typ = !Db.Value.lval_to_precise_loc_state state lv in let aux loc offsm_res = let size = Int_Base.project loc.size in let copy = Cvalue.Model.copy_offsetmap loc.loc size state in Bottom.join Cvalue.V_Offsetmap.join copy offsm_res in Precise_locs.fold aux loc_to_read `Bottom let compute_actual state e = match e with | { enode = Lval lv } when not (Eval_typ.is_bitfield (Cil.typeOfLval lv)) -> let o = try offsetmap_of_lv state lv with Abstract_interp.Error_Top -> Value_parameters.abort ~current:true "Function argument %a has unknown size. Aborting" Printer.pp_exp e; in begin match o with | `Value o -> o | `Bottom -> raise Actual_is_bottom end | _ -> let interpreted_expr = !Db.Value.eval_expr state e in if Cvalue.V.is_bottom interpreted_expr then raise Actual_is_bottom; let typ = Cil.typeOf e in Eval_op.offsetmap_of_v ~typ interpreted_expr let () = Db.Value.add_formals_to_state := (fun state kf exps -> try let actuals = List.map (fun e -> compute_actual state e) exps in actualize_formals kf state actuals with Actual_is_bottom | WrongFunctionType -> Cvalue.Model.bottom) (* Local Variables: compile-command: "make -C ../../../.." End: *) ���frama-c-20.0-Calcium/src/plugins/value/legacy/function_args.mli�������������������������������������0000666�0000000�0000000�00000003260�13571573400�021410� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Nothing is exported; the function [compute_atual] is registered in {!Db.Value}. *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017306� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/auto_loop_unroll.ml�����������������������������0000666�0000000�0000000�00000050402�13571573400�023235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Heuristic for automatic loop unrolling: when the number of iterations of a loop can be bounded under a given limit, then unroll the loop. The limit is defined by the option -eva-auto-loop-unroll. *) (* Gist of the heuristic: - find a loop exit condition, in the form of a statement "if(cond) break;". such that exactly one lvalue [lval] in the condition [cond] is modified within the loop; all other lvalues must be constant in the loop. - find a value [v_exit] such that [lval] ∈ [v_exit] ⇒ [cond] holds. - evaluate [lval] to its initial value [v_init] in the loop entry state. - compute an over-approximation of the increment [v_delta] of [lval] in one iteration of the loop. If [v_init] + k × [v_delta] ⊂ [v_exit], then the number of iterations is bounded by the limit [k]. The heuristic is syntactic and limited to the current function: it does not handle assignment through pointers or function calls. Thus, the condition [cond] should only contains direct accesses to variables whose address is never taken (they cannot be modified through pointers). If the loop contains a function call, the condition [cond] should not contain global variables (as they may be modified in the function called). A first analyze of the loop gathers all such variables modified within the loop; all others are constant, and can be evaluated in the loop entry state. When computing the increment [v_delta] of a lvalue [v] in the loop, the heuristic searches assignments "v = v ± i;". Any other assignment of [v] cancels the heuristic. *) open Cil_types (* Is a statement a loop exit condition? If so, returns the condition and whether the condition must hold to exit the loop. Otherwise, returns None. *) let is_conditional_break stmt = match stmt.skind with | If (cond, {bstmts=[{skind=Break _}]}, _, _) -> Some (cond, true) | If (cond, _, {bstmts=[{skind=Break _}]}, _) -> Some (cond, false) | _ -> None (* Returns a loop exit condition, as the conditional expression and whether the condition must be zero or non-zero to exit the loop. *) let find_loop_exit_condition loop = let rec aux = function | [] -> None | stmt :: tl -> match is_conditional_break stmt with | Some _ as x -> x | None -> aux tl in aux loop.bstmts (* Effects of a loop: - set of varinfos that are directly modified within the loop. Pointer accesses are ignored. - does the loop contain a call? If so, any global variable may also be modified in the loop. *) type loop_effect = { written_vars: Cil_datatype.Varinfo.Set.t; call: bool; } (* Visitor to compute the effects of a loop. *) let loop_effect_visitor = object (self) inherit Visitor.frama_c_inplace val mutable written_vars = Cil_datatype.Varinfo.Set.empty val mutable call = false val mutable assembly = false (* Returns None if the loop contains assembly code. *) method compute_effect block = written_vars <- Cil_datatype.Varinfo.Set.empty; call <- false; assembly <- false; ignore Visitor.(visitFramacBlock (self :> frama_c_inplace) block); if assembly then None else Some { written_vars; call; } method !vinst instr = let () = match instr with | Set ((Var varinfo, _), _, _) | Call (Some (Var varinfo, _), _, _, _) -> written_vars <- Cil_datatype.Varinfo.Set.add varinfo written_vars; | _ -> () in let () = match instr with | Asm _ -> assembly <- true | Call _ -> call <- true | _ -> () in Cil.SkipChildren end (* The status of a lvalue for the automatic loop unroll heuristic. *) type var_status = | Constant (* The lvalue is probably constant within the loop. *) | Candidate (* The lvalue is a good candidate for the heuristic: integer type, access to a varinfo whose address is not taken, modified within the loop but not in another function called in the loop. *) | Unsuitable (* Cannot be used for the heuristic. *) let is_integer lval = Cil.isIntegralType (Cil.typeOfLval lval) (* Computes the status of a lvalue for the heuristic, according to the loop effects. *) let classify loop_effect lval = let rec is_const_expr expr = match expr.enode with | Lval lval -> classify_lval lval = Constant | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> is_const_expr e | BinOp (_, e1, e2, _) -> is_const_expr e1 && is_const_expr e2 | Const _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ | AddrOf _ | StartOf _ -> true and classify_lval = function | Var varinfo, offset -> if (varinfo.vglob && loop_effect.call) || not (is_const_offset offset) then Unsuitable else if Cil_datatype.Varinfo.Set.mem varinfo loop_effect.written_vars then if is_integer lval && not varinfo.vaddrof then Candidate else Unsuitable else (* If the address of the variable is taken, it could be modified within the loop. We suppose here that this is not the case, but this could lead to some loop unrolling. *) Constant | Mem _, _ -> Unsuitable (* Pointers are not supported by the heuristic. *) and is_const_offset = function | NoOffset -> true | Field (_, offset) -> is_const_offset offset | Index (e, offset) -> is_const_expr e && is_const_offset offset in classify_lval lval (* Returns the list of all lvalues appearing in an expression. *) let rec get_lvalues expr = match expr.enode with | Lval lval -> [ lval ] | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> get_lvalues e | BinOp (_op, e1, e2, _typ) -> get_lvalues e1 @ get_lvalues e2 | Const _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ | AddrOf _ | StartOf _ -> [] (* Finds the unique candidate lvalue for the automatic loop unrolling heuristic in the expression [expr], if it exists. Returns None otherwise. *) let find_lonely_candidate loop_effect expr = let lvalues = get_lvalues expr in let rec aux acc list = match list with | [] -> acc | lval :: tl -> match classify loop_effect lval with | Unsuitable -> None | Constant -> aux acc tl | Candidate -> if acc = None then aux (Some lval) tl else None in aux None lvalues (* Returns true if the instruction assigns [lval]. *) let is_safe_instruction lval = function | Set (lv, _, _) | Call (Some lv, _, _, _) -> not (Cil_datatype.LvalStructEq.equal lval lv) | Call (None, _, _, _) | Local_init _ | Skip _ | Code_annot _ -> true | Asm _ -> false (* Returns true if the statement may assign [lval] during an iteration of the loop [loop]. [lval] is a candidate for the automatic loop unroll heuristic, and thus is modified within the loop. *) let is_safe lval ~loop stmt = (* The current block being checked for a goto statement. *) let current_block = ref None in let rec is_safe_stmt stmt = match stmt.skind with | Instr instr -> is_safe_instruction lval instr | Return _ | Break _ | Continue _ -> true | If (_, b_then, b_else, _) -> is_safe_block b_then && is_safe_block b_else | Block b | Switch (_, b, _, _) | Loop (_, b, _, _, _) -> is_safe_block b | UnspecifiedSequence list -> List.for_all (fun (stmt, _, _, _, _) -> is_safe_stmt stmt) list | Goto (dest, _) -> begin let dest_blocks = Kernel_function.find_all_enclosing_blocks !dest in (* If the goto leaves the loop, then it is safe. *) if List.mem loop dest_blocks then true else (* If the goto moves into the block currently being checked, then it is safe if the block is safe (which we are currently checking). *) match !current_block with | Some current_block when List.mem current_block dest_blocks -> true | _ -> (* Otherwise, we need to check that the whole block englobing both the source and the destination of the goto is safe. *) let block = Kernel_function.common_block !dest stmt in current_block := Some block; (* If this block is the loop itself, then it is not safe, as [lval] is modified within the loop. *) not (block = loop) && is_safe_block block end | _ -> false (* A block is safe if all its statements are safe. *) and is_safe_block block = List.for_all is_safe_stmt block.bstmts in is_safe_stmt stmt module Make (Abstract: Abstractions.Eva) = struct open Eval open Abstract module Valuation = Abstract.Eval.Valuation module Clear_Valuation = Clear_Valuation (Valuation) let (>>) v f = match v with `Value v -> f v | _ -> None let (>>=) v f = match v with Some v -> f v | None -> None let cvalue_complement typ cvalue = let open Eval_typ in match Eval_typ.classify_as_scalar typ with | Some (TSFloat _ | TSPtr _) | None -> None | Some (TSInt ik) -> try let ival = Cvalue.V.project_ival cvalue in Ival.complement_int_under ~size:ik.i_bits ~signed:ik.i_signed ival >> fun ival -> Some (Cvalue.V.inject_ival ival) with Cvalue.V.Not_based_on_null -> None (* Reduces the condition "[condition] = [positive]" to a sufficient hypothesis on the value of the expression [expr]: computes a value [v] such that if the expression [expr] evaluates to [v], then [condition] = [positive]. [valuation] contains additional hypotheses, i.e. the value of some constant lvalues of the [condition]. All computations must be done in the top state and in the given valuation. *) let reduce_to_expr valuation ~expr ~condition ~positive = let state = Abstract.Dom.top in (* Reduces [expr] by assuming that [condition] is [positive]. *) let reduce positive = (* Assumes that [condition] is [positive]. *) fst (Eval.reduce ~valuation state condition positive) >> fun valuation -> (* Finds the value of [expr] in the resulting valuation. *) Valuation.find valuation expr >> fun record -> record.value.v >> fun value -> (* If the new value of [expr] is top, no reduction has been performed. *) if Val.(equal top value) then None else Some (value, record) in (* Different strategies whether cvalue is present. *) match Val.get Main_values.CVal.key with | Some get_cvalue -> (* Assumes that [condition] is NOT [positive]. *) reduce (not positive) >>= fun (value, _record) -> (* [value] is an over-approximation of the values of [expr] for which [condition] is NOT positive; its complement is an under-approximation of the values for which [condition] is positive. *) let cvalue = get_cvalue value in cvalue_complement (Cil.typeOf expr) cvalue >>= fun cvalue -> Some (Val.set Main_values.CVal.key cvalue Val.top) | None -> (* Assumes that [condition] is [positive]. Returns an over-approximation of the values for which [condition] is [positive]. *) reduce positive >>= fun (value, record) -> (* Evaluates [condition] with the hypothesis [expr] ∈ [value], to check whether [expr] ∈ [value] ⇒ [condition] = [positive]. *) let valuation = Valuation.add valuation expr record in fst (Eval.evaluate ~valuation ~reduction:false state condition) >> fun (_valuation, v) -> let satisfied = if positive then not Val.(is_included zero v) else Val.(equal zero v) in if satisfied then Some value else None (* Same as [reduce_to_expr] above, but builds the proper valuation from the [state]. [state] is the entry state of the loop, and [expr] is the only part of [condition] that is not constant within the loop. [state] can thus be used to evaluate all other subparts of [condition], before computing the value of [expr] that satisfies [condition]. *) let reduce_to_lval_from_state state lval condition positive = let expr = Cil.new_exp ~loc:condition.eloc (Lval lval) in (* Evaluate the [condition] in the given [state]. *) fst (Eval.evaluate state condition) >> fun (valuation, _v) -> (* In the resulting valuation, replace the value of [expr] by [top_int] and removes all expressions depending on [expr]. *) Valuation.find valuation expr >> fun record -> let value = { record.value with v = `Value Val.top_int } in let record = { record with value } in let valuation = Clear_Valuation.clear_englobing_exprs valuation ~expr:condition ~subexpr:expr in let valuation = Valuation.add valuation expr record in reduce_to_expr valuation ~expr ~condition ~positive (* Over-approximation of the increment of a lvalue in one loop iteration.*) type delta = { current: Val.t or_bottom; (* current delta being computed*) final: Val.t or_bottom; (* final delta after a continue statement. *) } let join_delta d1 d2 = { current = Bottom.join Val.join d1.current d2.current; final = Bottom.join Val.join d1.final d2.final; } let final_delta delta = Bottom.join Val.join delta.current delta.final (* Raised when no increment can be computed for the given lvalue in one loop iteration. *) exception NoIncrement (* Adds or subtracts the integer value of [expr] to the current delta [delta.current], according to [binop] which can be PlusA or MinusA. Raises NoIncrement if [expr] is not a constant integer expression. *) let add_to_delta binop delta expr = let typ = Cil.typeOf expr in match Cil.constFoldToInt expr with | None -> raise NoIncrement | Some i -> let value = Val.inject_int typ i in let current = match delta.current with | `Bottom -> `Value value | `Value v -> Val.forward_binop typ binop v value in { delta with current } (* Adds to [delta] the increment from the assignement of [lval] to the value of [expr]. Raises NoIncrement if this is not an increment of [lval]. *) let rec delta_assign lval delta expr = (* Is the expression [e] equal to the lvalue [lval] (modulo cast)? *) let rec is_lval e = match e.enode with | Lval lv -> Cil_datatype.LvalStructEq.equal lval lv | CastE (typ, e) -> Cil.isIntegralType typ && is_lval e | Info (e, _) -> is_lval e | _ -> false in match expr.enode with | BinOp ((PlusA | MinusA) as binop, e1, e2, _) -> if is_lval e1 then add_to_delta binop delta e2 else if is_lval e2 && binop = PlusA then add_to_delta binop delta e1 else raise NoIncrement | CastE (typ, e) when Cil.isIntegralType typ -> delta_assign lval delta e | Info (e, _) -> delta_assign lval delta e | _ -> raise NoIncrement let delta_instruction lval delta = function | Set (lv, expr, _loc) -> if Cil_datatype.LvalStructEq.equal lval lv then delta_assign lval delta expr else delta | Call (Some lv, _, _, _) -> if Cil_datatype.LvalStructEq.equal lval lv then raise NoIncrement (* No increment can be computed for a call. *) else delta | Call (None, _, _, _) | Local_init _ | Skip _ | Code_annot _ -> delta | Asm _ -> raise NoIncrement (* Computes an over-approximation of the increment of [lval] in the block [loop]. Only syntactic assignments of [lval] are considered, so [lval] should be a direct access to a variable whose address is not taken, and which should not be global if the loop contains function calls. Returns None if no increment can be computed. *) let compute_delta lval loop = let rec delta_stmt acc stmt = match stmt.skind with | Instr instr -> delta_instruction lval acc instr | Break _ -> (* No increment, as the statement leaves the loop. *) { current = `Bottom; final = `Bottom } | Continue _ -> (* The current increment becomes the final increment. *) { current = `Bottom; final = final_delta acc } | If (_e, b1, b2, _loc) -> join_delta (delta_block acc b1) (delta_block acc b2) | Block b -> delta_block acc b | _ -> (* For other statements, we only check that they do not modify [lval]. *) if is_safe lval ~loop stmt then acc else raise NoIncrement and delta_block acc block = List.fold_left delta_stmt acc block.bstmts in try let zero_delta = { current = `Value Val.zero; final = `Bottom; } in let delta = delta_block zero_delta loop in final_delta delta >> fun d -> Some d with NoIncrement -> None (* Evaluates the lvalue [lval] in the state [state]. Returns None if the value may be undeterminate. *) let evaluate_lvalue state lval = fst (Eval.copy_lvalue state lval) >> fun (_valuation, flagged_value) -> if not flagged_value.initialized || flagged_value.escaping then None else flagged_value.v >> fun v -> Some v (* Is the number of iterations of a loop bounded by [limit]? [state] is the loop entry state, and [loop_block] the block of the loop. *) let is_bounded_loop state limit loop_block = (* Computes the effect of the loop. Stops if it contains assembly code. *) loop_effect_visitor#compute_effect loop_block >>= fun loop_effect -> (* Finds the first loop exit condition, or stops. *) find_loop_exit_condition loop_block >>= fun (condition, positive) -> (* Finds the unique integer lvalue modified within the loop in [condition]. Stops if it does not exist is not a good candidate for the heuristic. *) find_lonely_candidate loop_effect condition >>= fun lval -> (* Reduce [condition] to a sufficient hypothesis over the [lval] value: if [lval] ∈ [v_exit] then [condition = positive]. *) reduce_to_lval_from_state state lval condition positive >>= fun v_exit -> (* Evaluates the initial value [v_init] of [lval] in the loop entry state. *) evaluate_lvalue state lval >>= fun v_init -> (* Computes an over-approximation [v_delta] of the increment of [lval] in one iteration of the loop. *) compute_delta lval loop_block >>= fun v_delta -> let typ = Cil.typeOfLval lval in let limit = Val.inject_int typ (Integer.of_int limit) in (* Checks whether [v_init] + [limit] × [v_delta] ⊂ [v_exit]. *) let binop op v1 v2 = Bottom.non_bottom (Val.forward_binop typ op v1 v2) in let value = binop PlusA v_init (binop Mult limit v_delta) in Some (Val.is_included value v_exit) (* Computes an automatic loop unrolling for statement [stmt] in state [state], with a maximum limit. Returns None for no automatic loop unrolling. *) let compute ~max_unroll state stmt = try let kf = Kernel_function.find_englobing_kf stmt in let loop_stmt = Kernel_function.find_enclosing_loop kf stmt in match loop_stmt.skind with | Loop (_code_annot, block, _loc, _, _) -> is_bounded_loop state max_unroll block >>= fun bounded -> if bounded then Some max_unroll else None | _ -> None with Not_found -> None end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/auto_loop_unroll.mli����������������������������0000666�0000000�0000000�00000003416�13571573400�023411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Heuristic for automatic loop unrolling. *) module Make (Abstract: Abstractions.Eva) : sig val compute: max_unroll:int -> Abstract.Dom.t -> Cil_types.stmt -> int option end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/partition.ml������������������������������������0000666�0000000�0000000�00000044076�13571573400�021664� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Bottom.Type (* --- Split monitors --- *) type split_monitor = { split_limit : int; mutable split_values : Datatype.Integer.Set.t; } let new_monitor ~split_limit = { split_limit; split_values = Datatype.Integer.Set.empty; } (* --- Stamp rationing --- *) (* Stamps used to label states according to slevel. The second integer is used to keep separate the different states resulting from a transfer function producing a state list before a new stamping. *) type stamp = (int * int) option (* store stamp / transfer stamp *) (* Stamp rationing according to the slevel. *) type rationing = { current: int ref; (* last used stamp. *) limit: int; (* limit of available stamps; after, stamps are [None]. *) merge: bool (* on merge slevel annotations or -eva-merge-after-loop, merge the incoming states with one unique stamp. *) } let new_rationing ~limit ~merge = { current = ref 0; limit; merge } (* --- Keys --- *) module ExpMap = Cil_datatype.ExpStructEq.Map module IntPair = Datatype.Pair (Datatype.Int) (Datatype.Int) module LoopList = Datatype.List (IntPair) module BranchList = Datatype.List (Datatype.Int) type branch = int (* The key have several fields, one for each kind of partitioning: - Ration stamps: These modelize the legacy slevel. Each state is given a ration stamp (represented by two integers) until there is no slevel left. The first number is attributed by the store it comes from, the second one is attributed by the last transfer. It is an option type, when there is no more ration stamp, this field is set to None; each new state will not be distinguished by this field. - Branches: This field enumerate the last junctions points passed through. The partitioning may chose how the branches are identified, but it is a First-In-First-Out set. - Loops: This field stores the loop iterations needed to reach this state for each loop we are currently in. It is stored in reverse order (innermost loop first) It also stores the maximum number of unrolling ; this number varies from a state to another, as it is computed from an expression evaluated when we enter the loop. - Static/Dynamic splits: track the splits applied to the state as a map from the expression of the split to the value of this expression. Since the split creates states in which the expression evalutates to a singleton, the values of the map are integers. Static splits are only evaluated when the annotation is encountered whereas dynamic splits are reevaluated regularly. *) type key = { ration_stamp : stamp; branches : branch list; loops : (int * int) list; (* current iteration / max unrolling *) static_split : (Integer.t*split_monitor) ExpMap.t; (* exp->value*monitor *) dynamic_split : (Integer.t*split_monitor) ExpMap.t; (* exp->value*monitor *) } module Key = struct type t = key (* Initial key, before any partitioning *) let zero = { ration_stamp = None; branches = []; loops = []; static_split = ExpMap.empty; dynamic_split = ExpMap.empty; } let compare k1 k2 = let (<?>) c (cmp,x,y) = if c = 0 then cmp x y else c in let compare_split (i1,_m1) (i2,_m2) = Integer.compare i1 i2 in Extlib.opt_compare IntPair.compare k1.ration_stamp k2.ration_stamp <?> (LoopList.compare, k1.loops, k2.loops) <?> (ExpMap.compare compare_split, k1.static_split, k2.static_split) <?> (ExpMap.compare compare_split, k1.dynamic_split, k2.dynamic_split) <?> (BranchList.compare, k1.branches, k2.branches) let pretty fmt key = begin match key.ration_stamp with | Some (n,_) -> Format.fprintf fmt "#%d" n | None -> () end; Pretty_utils.pp_list ~pre:"[@[" ~sep:" ;@ " ~suf:"@]]" Format.pp_print_int fmt key.branches; Pretty_utils.pp_list ~pre:"(@[" ~sep:" ;@ " ~suf:"@])" (fun fmt (i,_j) -> Format.pp_print_int fmt i) fmt key.loops; Pretty_utils.pp_list ~pre:"{@[" ~sep:" ;@ " ~suf:"@]}" (fun fmt (e,(i,_m)) -> Format.fprintf fmt "%a:%a" Cil_printer.pp_exp e (Integer.pretty ~hexa:false) i) fmt (ExpMap.bindings key.static_split @ ExpMap.bindings key.dynamic_split) let exceed_rationing key = key.ration_stamp = None end (* --- Partitions --- *) module KMap = Map.Make (Key) type 'a partition = 'a KMap.t let empty = KMap.empty let find = KMap.find let replace = KMap.add let is_empty = KMap.is_empty let size = KMap.cardinal let iter = KMap.iter let map = KMap.map let filter = KMap.filter let merge = KMap.merge let to_list (p : 'a partition) : 'a list = KMap.fold (fun _k x l -> x :: l) p [] (* --- Partitioning actions --- *) type unroll_limit = | ExpLimit of Cil_types.exp | IntLimit of int | AutoUnroll of Cil_types.stmt * int * int type split_kind = Static | Dynamic type action = | Enter_loop of unroll_limit | Leave_loop | Incr_loop | Branch of branch * int | Ration of rationing | Restrict of Cil_types.exp * Integer.t list | Split of Cil_types.exp * split_kind * split_monitor | Merge of Cil_types.exp * split_kind | Update_dynamic_splits exception InvalidAction (* --- Flows --- *) module MakeFlow (Abstract: Abstractions.Eva) = struct type state = Abstract.Dom.t type t = (key * state) list let empty = [] let initial (p : 'a list) : t = List.map (fun state -> Key.zero, state) p let to_list (f : t) : state list = List.map snd f let of_partition (p : state partition) : t = KMap.fold (fun k x l -> (k,x) :: l) p [] let to_partition (p : t) : state partition = let add p (k,x) = (* Join states with the same key *) let x' = try Abstract.Dom.join (KMap.find k p) x with Not_found -> x in KMap.add k x' p in List.fold_left add KMap.empty p let is_empty (p : t) = p = [] let size (p : t) = List.length p let union (p1 : t) (p2 : t) : t = p1 @ p2 (* --- Automatic loop unrolling ------------------------------------------- *) module AutoLoopUnroll = Auto_loop_unroll.Make (Abstract) (* --- Evaluation and split functions ------------------------------------- *) (* Domains transfer functions. *) module TF = Abstract.Dom.Transfer (Abstract.Eval.Valuation) exception Operation_failed let fail ~exp message = let source = fst exp.Cil_types.eloc in let warn_and_raise message = Value_parameters.warning ~source ~once:true "%s" message; raise Operation_failed in Pretty_utils.ksfprintf warn_and_raise message let evaluate_exp_to_ival ?valuation state exp = (* Evaluate the expression *) let valuation, value = match Abstract.Eval.evaluate ?valuation ~reduction:false state exp with | `Value (valuation, value), alarms when Alarmset.is_empty alarms -> valuation, value | _ -> fail ~exp "this partitioning parameter cannot be evaluated safely on \ all states" in (* Get the cvalue *) let cvalue = match Abstract.Val.get Main_values.CVal.key with | Some get_cvalue -> get_cvalue value | None -> fail ~exp "partitioning is disabled when the CValue domain is \ not active" in (* Extract the ival *) let ival = try Cvalue.V.project_ival cvalue with Cvalue.V.Not_based_on_null -> fail ~exp "this partitioning parameter must evaluate to an integer" in valuation, ival exception Split_limit of Integer.t option let split_by_value ~monitor state exp = let module SplitValues = Datatype.Integer.Set in let valuation, ival = evaluate_exp_to_ival state exp in (* Build a state with the lvalue set to a singleton *) let build i acc = let value = Abstract.Val.inject_int (Cil.typeOf exp) i in let state = Abstract.Eval.assume ~valuation state exp value >>- fun valuation -> (* Check the reduction *) TF.update valuation state in match state with | `Value state -> let _,new_ival = evaluate_exp_to_ival state exp in if not (Ival.is_singleton_int new_ival) then fail ~exp "failing to learn perfectly from split" ; monitor.split_values <- SplitValues.add i monitor.split_values; (i, state) :: acc | `Bottom -> (* This value cannot be set in the state ; the evaluation of expr was unprecise *) acc in try (* Check the size of the ival *) begin match Ival.cardinal ival with | None -> raise (Split_limit None) | Some c as count -> if Integer.(gt c (of_int monitor.split_limit)) then raise (Split_limit count) end; (* For each integer of the ival, build a new state *) try let result = Ival.fold_int build ival [] in let c = SplitValues.cardinal monitor.split_values in if c > monitor.split_limit then raise (Split_limit (Some (Integer.of_int c))); result with Abstract_interp.Error_Top -> (* The ival is float *) raise (Split_limit None) with | Split_limit count -> let pp_count fmt = match count with | None -> () | Some c -> Format.fprintf fmt " (%a)" (Integer.pretty ~hexa:false) c in fail ~exp "split on more than %d values%t prevented ; try to improve \ the analysis precision or look at the option -eva-split-limit \ to increase this limit." monitor.split_limit pp_count let eval_exp_to_int state exp = let _valuation, ival = evaluate_exp_to_ival state exp in try Integer.to_int (Ival.project_int ival) with | Ival.Not_Singleton_Int -> fail ~exp "this partitioning parameter must evaluate to a singleton" | Failure _ -> fail ~exp "this partitioning parameter is too big" (* --- Applying partitioning actions onto flows --------------------------- *) let stamp_by_value = match Abstract.Val.get Main_values.CVal.key with | None -> fun _ _ _ -> None | Some get -> fun expr expected_values state -> let typ = Cil.typeOf expr in let make stamp i = stamp, i, Abstract.Val.inject_int typ i in let expected_values = List.mapi make expected_values in match fst (Abstract.Eval.evaluate state expr) with | `Bottom -> None | `Value (_cache, value) -> let is_included (_, _, v) = Abstract.Val.is_included v value in match List.find_opt is_included expected_values with | None -> None | Some (stamp, i, _) -> if Cvalue.V.cardinal_zero_or_one (get value) then Some (stamp, 0) else begin Value_parameters.result ~once:true ~current:true "cannot properly split on \\result == %a" Abstract_interp.Int.pretty i; None end let split_state ~monitor (kind : split_kind) (exp : Cil_types.exp) (key : key) (state : state) : (key * state) list = try let add value map = ExpMap.add exp (value, monitor) map in let update_key (v,x) = let k = match kind with | Static -> { key with static_split = add v key.static_split } | Dynamic -> { key with dynamic_split = add v key.dynamic_split } in (k,x) in List.map update_key (split_by_value ~monitor state exp) with Operation_failed -> [(key,state)] let split ~monitor (kind : split_kind) (exp : Cil_types.exp) (p : t) = let add_split acc (key,state) = split_state ~monitor kind exp key state @ acc in List.fold_left add_split [] p let update_dynamic_splits p = (* Update one state *) let update_state acc (key,state) = (* Split the states in the list l for the given exp *) let update_exp exp (_i,monitor) l = let resplit acc (k,x) = split_state ~monitor Dynamic exp k x @ acc in List.fold_left resplit [] l in (* Foreach exp in original state: split *) ExpMap.fold update_exp key.dynamic_split [(key,state)] @ acc in List.fold_left update_state [] p let map_keys (f : key -> state -> key) (p : t) : t = List.map (fun (k,x) -> f k x, x) p let transfer_keys p = function | Split (expr, kind, monitor) -> split ~monitor kind expr p | Update_dynamic_splits -> update_dynamic_splits p | action -> (* Simple map transfer functions *) let transfer = match action with | Split _ | Update_dynamic_splits -> assert false (* Handled above *) | Enter_loop limit_kind -> fun k x -> let limit = try match limit_kind with | ExpLimit exp -> eval_exp_to_int x exp | IntLimit i -> i | AutoUnroll (stmt, min_unroll, max_unroll) -> match AutoLoopUnroll.compute ~max_unroll x stmt with | None -> min_unroll | Some i -> Value_parameters.warning ~once:true ~current:true ~wkey:Value_parameters.wkey_loop_unroll "Automatic loop unrolling."; i with | Operation_failed -> 0 in { k with loops = (0,limit) :: k.loops } | Leave_loop -> fun k _x -> begin match k.loops with | [] -> raise InvalidAction | _ :: tl -> { k with loops = tl } end | Incr_loop -> fun k _x -> begin match k.loops with | [] -> raise InvalidAction | (h, limit) :: tl -> if h >= limit then begin if limit > 0 then Value_parameters.warning ~once:true ~current:true ~wkey:Value_parameters.wkey_loop_unroll "loop not completely unrolled"; k end else { k with loops = (h + 1, limit) :: tl } end | Branch (b,max) -> fun k _x -> if max > 0 then { k with branches = b :: Extlib.list_first_n (max - 1) k.branches } else if k.branches <> [] then { k with branches = [] } else k | Ration { current; limit; merge } -> let length = List.length p in (* The incoming states exceed the rationing limit: no more stamps. *) if !current + length > limit then begin current := limit; fun k _ -> { k with ration_stamp = None } end (* If merge, a unique ration stamp for all incoming states. *) else if merge then begin current := !current + length; fun k _ -> { k with ration_stamp = Some (!current, 0) } end (* Default case: a different stamp for each incoming state. *) else let stamp () = incr current; Some (!current, 0) in fun k _ -> { k with ration_stamp = stamp () } | Restrict (expr, expected_values) -> fun k s -> { k with ration_stamp = stamp_by_value expr expected_values s} | Merge (exp, Static) -> fun k _x -> { k with static_split = ExpMap.remove exp k.static_split } | Merge (exp, Dynamic) -> fun k _x -> { k with dynamic_split = ExpMap.remove exp k.dynamic_split } in map_keys transfer p let transfer_states (f : state -> state list) (p : t) : t = let n = ref 0 in let transfer acc (k,x) = let add = match k.ration_stamp with (* No ration stamp, just add the state to the list *) | None -> fun l y -> (k,y) :: l (* There is a ration stamp, set the second part of the stamp to a unique transfer number *) | Some (s,_) -> fun l y -> let k' = { k with ration_stamp = Some (s, !n) } in incr n; (k',y) :: l in List.fold_left add acc (f x) in List.fold_left transfer [] p let iter (f : state -> unit) (p : t) : unit = List.iter (fun (_k,x) -> f x) p let join_duplicate_keys (p : t) : t = let cmp (k, _) (k', _) = Key.compare k k' in let p = List.fast_sort cmp p in let rec aux acc (key, state) = function | [] -> (key, state) :: acc | (key', state') :: tl -> if Key.compare key key' = 0 then aux acc (key, Abstract.Dom.join state state') tl else aux ((key, state) :: acc) (key', state') tl in match p with | [] | [_] -> p | e :: tl -> aux [] e tl let filter_map (f: key -> state -> state option) (p : t) : t = let rec aux = function | [] -> [] | (key, x) :: tl -> match f key x with | Some y -> (key, y) :: (aux tl) | None -> aux tl in aux p end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/partition.mli�����������������������������������0000666�0000000�0000000�00000021173�13571573400�022026� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** A partition is a collection of states, each identified by a unique key. The keys define the states partition: states with identical keys are joined together, while states with different keys are maintained separate. A key contains the reason for which a state must be kept separate from others, or joined with similar states. Partitioning actions allow updating the keys or spliting some states to define or change the partition. Actions are applied to flows, in which states with the same key are *not* automatically joined. This allows applying mutliple actions before recomputing the partitions. Flows can then be converted into partitions, thus merging states with identical keys. Flows are used to transfer states from one partition to another. Transfer functions can be applied to flows; keys are maintained through transfer functions, until partitioning actions update them. *) (** {2 Keys and partitions.} *) (** Partitioning keys attached to states. *) type key module Key : sig val zero : key (** Initial key: no partitioning. *) val compare : key -> key -> int val pretty : Format.formatter -> key -> unit val exceed_rationing: key -> bool end (** Collection of states, each identified by a unique key. *) type 'state partition val empty : 'a partition val is_empty : 'a partition -> bool val size : 'a partition -> int val to_list : 'a partition -> 'a list val find : key -> 'a partition -> 'a val replace : key -> 'a -> 'a partition -> 'a partition val merge : (key -> 'a option -> 'b option -> 'c option) -> 'a partition -> 'b partition -> 'c partition val iter : (key -> 'a -> unit) -> 'a partition -> unit val filter : (key -> 'a -> bool) -> 'a partition -> 'a partition val map : ('a -> 'a) -> 'a partition -> 'a partition (** {2 Partitioning actions.} *) type branch = int (** Junction branch id in the control flow *) (** Rationing are used to keep separate the [n] first states propagated at a point, by creating unique stamp until the limit is reached. Implementation of the option -eva-slevel. *) type rationing (** Creates a new rationing, that can be used successively on several flows. *) val new_rationing: limit:int -> merge:bool -> rationing (** The unroll limit of a loop. *) type unroll_limit = | ExpLimit of Cil_types.exp (** Value of the expression for each incoming state. The expression must evaluate to a singleton integer in each state. *) | IntLimit of int (** Integer limit. *) | AutoUnroll of Cil_types.stmt * int * int (** [AutoUnroll(stmt, min, max)] requests to find a "good" unrolling limit between [min] and [max] for the loop [stmt]. *) (** Splits on an expression can be static or dynamic: - static splits are processed once: the expression is only evaluated at the split point, and the key is then kept unchanged until a merge. - dynamic splits are regularly redone: the expression is re-evaluated, and states are then split or merged accordingly. *) type split_kind = Static | Dynamic (** Split monitor: prevents splits from generating too many states. *) type split_monitor (** Creates a new monitor that allows to split up to [split_limit] states. *) val new_monitor: split_limit:int -> split_monitor (** These actions redefine the partitioning by updating keys or spliting states. They are applied to all the pair (key, state) in a flow. *) type action = | Enter_loop of unroll_limit (** Enters a loop in which the n first iterations will be kept separate: creates an iteration counter at 0 for each states in the flow; states at different iterations will be kept separate, untill reaching the [unroll_limit]. Counters are incremented by the [Incr_loop] action. *) | Leave_loop (** Leaves the current loop: removes its iteration counter. States that were kept separate only by this iteration counter will be joined together. *) | Incr_loop (** Increments the iteration counter of the current loop for all states in the flow. States with different iteration counter are kept separate. *) | Branch of branch * int (** Identifies all the states in the flow as coming from [branch]. They will be kept separated from states coming from other branches. The integer is the maximum number of successive branches kept in the keys: this action also removes the oldest branches from the keys to meet this constraint. *) | Ration of rationing (** Ensures that the first states encountered are kept separate, by creating a unique ration stamp for each new state until the [limit] is reached. The same rationing can be used on multiple flows. Applying a new rationing replaces the previous one. If the rationing has been created with [merge:true], all the states from each flow receive the same stamp, but states from different flows receive different stamps, until [limit] states have been tagged. *) | Restrict of Cil_types.exp * Integer.t list (** [Restrict (exp, list)] restricts the rationing according to the evaluation of the expression [exp]: – for each integer [i] in [list], states in which [exp] evaluates exactly to the singleton [i] receive the same unique stamp, and will thus be joined together but kept separate from other states; – all other states are joined together. Previous rationing is erased and replaced by this new stamping. Implementation of the option -eva-split-return. *) | Split of Cil_types.exp * split_kind * split_monitor (** [Split (exp, kind, monitor)] tries to separate states such as the [exp] evaluates to a singleton value in each state in the flow. If necessary and possible, splits states into multiple states. States in which the [exp] evaluates to different values will be kept separate. Gives up the split if [exp] evaluates to more than [limit] values, [limit] being the split limit of the [monitor]. A same monitor can be used for successive splits on different flows. *) | Merge of Cil_types.exp * split_kind (** Forgets the split of an expression: states that were kept separate only by the split of this expression will be joined together. *) | Update_dynamic_splits (** Updates dynamic splits by evaluating the expression and spliting the states accordingly. *) exception InvalidAction (** {2 Flows.} *) (** Flows are used to transfer states from one partition to another, by applying transfer functions and partitioning actions. They do not enforce the unicity of keys. *) module MakeFlow (Abstract: Abstractions.Eva) : sig type state = Abstract.Dom.t type t val empty : t val initial : state list -> t val to_list : t -> state list val of_partition : state partition -> t val to_partition : t -> state partition val is_empty : t -> bool val size : t -> int val union : t -> t -> t val transfer_keys : t -> action -> t val transfer_states : (state -> state list) -> t -> t val iter : (state -> unit) -> t -> unit val filter_map: (key -> state -> state option) -> t -> t val join_duplicate_keys: t -> t end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/partitioning_index.ml���������������������������0000666�0000000�0000000�00000011044�13571573400�023536� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type Domain = sig include Abstract_domain.Lattice include Datatype.S_with_collections with type t = state include Abstract.Interface with type t := state and type 'a key := 'a Abstract_domain.key end (** Partition of the abstract states, computed for each node by the dataflow analysis. *) module Make (Domain : Domain) = struct module Index = Hashtbl.Make (Cvalue_domain.Subpart) type t = { mutable states : Domain.t Index.t; (* Indexed states. *) mutable prefix : Cvalue_domain.prefix option; (* Prefix for the index. *) mutable others : Domain.t list (* States not indexed. *) } let sentinel = Index.create 1 let empty () = { states = sentinel ; prefix = None ; others = [] } (* Optimizations relying on specific features of the cvalue domain. *) let distinct_subpart = match Domain.get Cvalue_domain.State.key with | None -> fun _ _ -> None | Some get -> fun s1 s2 -> Cvalue_domain.distinct_subpart (get s1) (get s2) let find_subpart = match Domain.get Cvalue_domain.State.key with | None -> fun _ _ -> None | Some get -> fun state prefix -> Cvalue_domain.find_subpart (get state) prefix let add state partition = let {states; prefix; others} = partition in match prefix with | None -> begin match others with | [] -> partition.others <- [state]; true | s :: tail -> if List.exists (fun s -> Domain.is_included state s) others then false else match distinct_subpart state s with | None -> partition.others <- state :: others; true | Some (prefix, part1, part2) -> let states = Index.create 13 in Index.add states part1 state; Index.add states part2 s; let others = List.fold_left (fun acc s -> match find_subpart s prefix with | None -> s :: acc | Some part -> Index.add states part s; acc) [] tail in partition.states <- states; partition.prefix <- Some prefix; partition.others <- others; true end | Some prefix -> match find_subpart state prefix with | None -> if List.exists (fun s -> Domain.is_included state s) others then false else (partition.others <- state :: others; true) | Some prefix -> let candidates = Index.find_all states prefix in if List.exists (fun s -> Domain.is_included state s) candidates then false else (Index.add states prefix state; true) let iter f { states; others } = Index.iter (fun _k v -> f v) states; List.iter f others let pretty fmt s = iter (fun state -> Format.fprintf fmt "set contains %a@\n" Domain.pretty state) s end (* Local Variables: compile-command: "make -C ../../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/partitioning_index.mli��������������������������0000666�0000000�0000000�00000005374�13571573400�023720� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** A partitioning index is a collection of states optimized to determine if a new state is included in one of the states it contains — in a more efficient way than to test the inclusion with all stored states. Such an index is used to keep track of all the states already propagated through a control point, and to rule out new incoming states included in previous ones. Partitioning index relies on an heuristics on the cvalue domain, and is very inefficient without it. *) module type Domain = sig include Abstract_domain.Lattice include Datatype.S_with_collections with type t = state include Abstract.Interface with type t := state and type 'a key := 'a Abstract_domain.key end module Make (Domain: Domain) : sig type t (** Creates an empty index. *) val empty: unit -> t (** Adds a state into an index. Returns true if the state did not belong to the index (and has indeed been added), and false if the index already contained the state. *) val add : Domain.t -> t -> bool val pretty : Format.formatter -> t -> unit end (* Local Variables: compile-command: "make -C ../../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/partitioning_parameters.ml����������������������0000666�0000000�0000000�00000012613�13571573400�024575� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Value_parameters open Partitioning_annots open Cil_types let is_return s = match s.skind with Return _ -> true | _ -> false let is_loop s = match s.skind with Loop _ -> true | _ -> false let warn ?(current = true) = Kernel.warning ~once:true ~current module Make (Kf : sig val kf: kernel_function end) = struct let kf = Kf.kf let widening_delay = WideningDelay.get () let widening_period = WideningPeriod.get () let interpreter_mode = InterpreterMode.get () let slevel stmt = if is_return stmt || interpreter_mode then max_int else match Per_stmt_slevel.local kf with | Per_stmt_slevel.Global i -> i | Per_stmt_slevel.PerStmt f -> f stmt let merge_after_loop = SlevelMergeAfterLoop.mem kf let merge stmt = is_loop stmt && merge_after_loop || match Per_stmt_slevel.merge kf with | Per_stmt_slevel.NoMerge -> false | Per_stmt_slevel.Merge f -> f stmt let term_to_exp term = !Db.Properties.Interp.term_to_exp ~result:None term let min_loop_unroll = MinLoopUnroll.get () let auto_loop_unroll = AutoLoopUnroll.get () let default_loop_unroll = DefaultLoopUnroll.get () let warn_no_loop_unroll stmt = let is_attribute a = Cil.hasAttribute a stmt.sattr in match List.filter is_attribute ["for" ; "while" ; "dowhile"] with | [] -> () | loop_kind :: _ -> let wkey = if loop_kind = "for" then Value_parameters.wkey_missing_loop_unroll_for else Value_parameters.wkey_missing_loop_unroll in Value_parameters.warning ~wkey ~source:(fst (Cil_datatype.Stmt.loc stmt)) ~once:true "%s loop without unroll annotation" loop_kind let unroll stmt = let default = if auto_loop_unroll > min_loop_unroll then Partition.AutoUnroll (stmt, min_loop_unroll, auto_loop_unroll) else Partition.IntLimit min_loop_unroll in match get_unroll_annot stmt with | [] -> warn_no_loop_unroll stmt; default | [None] -> Partition.IntLimit default_loop_unroll | [(Some t)] -> begin (* Inlines the value of const variables in [t]. *) let global_init vi = try (Globals.Vars.find vi).init with Not_found -> None in let t = Cil.visitCilTerm (new Logic_utils.simplify_const_lval global_init) t in match Logic_utils.constFoldTermToInt t with | Some n -> Partition.IntLimit (Integer.to_int n) | None -> try Partition.ExpLimit (term_to_exp t) with Db.Properties.Interp.No_conversion -> warn "loop unrolling parameters must be valid expressions"; default end | _ -> warn "ignoring invalid unroll annotation"; default let history_size = HistoryPartitioning.get () let split_limit = SplitLimit.get () let universal_splits = let add name l = try let vi = Globals.Vars.find_from_astinfo name VGlobal in let monitor = Partition.new_monitor ~split_limit in Partition.Split (Cil.evar vi, Partition.Dynamic, monitor) :: l with Not_found -> warn ~current:false "cannot find the global variable %s for value \ partitioning" name; l in ValuePartitioning.fold add [] let flow_actions stmt = let kind = Partition.Static in let map_annot acc t = try let monitor = Partition.new_monitor ~split_limit in let action = match t with | FlowSplit t -> Partition.Split (term_to_exp t, kind, monitor) | FlowMerge t -> Partition.Merge (term_to_exp t, kind) in action :: acc with Db.Properties.Interp.No_conversion -> warn "split/merge expressions must be valid expressions"; acc (* Impossible to convert term to lval *) in List.fold_left map_annot [] (get_flow_annot stmt) end ���������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/partitioning_parameters.mli���������������������0000666�0000000�0000000�00000003670�13571573400�024751� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Make (Kf : sig val kf: kernel_function end) : sig val widening_delay : int val widening_period : int val slevel : stmt -> int val merge : stmt -> bool val unroll : stmt -> Partition.unroll_limit val history_size : int val universal_splits : Partition.action list val flow_actions : stmt -> Partition.action list end ������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/per_stmt_slevel.ml������������������������������0000666�0000000�0000000�00000013211�13571573400�023045� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Partitioning_annots module G = struct type t = kernel_function let is_directed = true module V = Cil_datatype.Stmt let fold_vertex f kf acc = f (Kernel_function.find_first_stmt kf) acc let iter_vertex f kf = f (Kernel_function.find_first_stmt kf) let succs s = s.succs let iter_succ f _ v = List.iter f (succs v) let fold_succ f _ v acc = List.fold_right f (succs v) acc end module Dfs = Graph.Traverse.Dfs(G) type slevel = | Global of int | PerStmt of (stmt -> int) module DatatypeSlevel = Datatype.Make(struct include Datatype.Undefined type t = slevel let reprs = [Global 0] let name = "Value.Local_slevel.DatatypeSlevel" let mem_project = Datatype.never_any_project end) type merge = | NoMerge | Merge of (stmt -> bool) module DatatypeMerge = Datatype.Make(struct include Datatype.Undefined type t = merge let reprs = [NoMerge] let name = "Value.Local_slevel.DatatypeMerge" let mem_project = Datatype.never_any_project end) let kf_contains_slevel_directive kf = List.exists (fun stmt -> get_slevel_annot stmt <> None) (Kernel_function.get_definition kf).sallstmts let compute kf = let default_slevel = Value_util.get_slevel kf in if not (kf_contains_slevel_directive kf) then Global default_slevel (* No slevel directive *), NoMerge else let h_local = Cil_datatype.Stmt.Hashtbl.create 16 in let h_merge = Cil_datatype.Stmt.Hashtbl.create 16 in let local_slevel = Stack.create () in Stack.push default_slevel local_slevel; let debug = false in (* Before visiting the successors of the statement: push or pop according to directive *) let pre s = match get_slevel_annot s with | None | Some SlevelMerge as d -> Cil_datatype.Stmt.Hashtbl.add h_local s (Stack.top local_slevel); if d <> None then Cil_datatype.Stmt.Hashtbl.add h_merge s (); | Some (SlevelLocal i) -> if debug then Format.printf "Vising split %d, pushing %d@." s.sid i; Cil_datatype.Stmt.Hashtbl.add h_local s i; Stack.push i local_slevel; | Some SlevelDefault -> let top = Stack.pop local_slevel in if debug then Format.printf "Visiting merge %d, poping (prev %d)@." s.sid top; (* Store top, ie. the slevel value above s, in h. We will use this value in the post function *) Cil_datatype.Stmt.Hashtbl.add h_local s top (* after the visit of a statement and its successors. Do the converse operation of pre *) and post s = match get_slevel_annot s with | None | Some SlevelMerge -> () | Some (SlevelLocal _) -> if debug then Format.printf "Leaving split %d, poping@." s.sid; ignore (Stack.pop local_slevel); | Some SlevelDefault -> (* slevel on nodes above s *) let above = Cil_datatype.Stmt.Hashtbl.find h_local s in (* slevel on s and on the nodes below *) let cur = Stack.top local_slevel in if debug then Format.printf "Leaving merge %d, restoring %d@." s.sid above; Stack.push above local_slevel; Cil_datatype.Stmt.Hashtbl.replace h_local s cur in try Dfs.iter ~pre ~post kf; PerStmt (fun s -> try Cil_datatype.Stmt.Hashtbl.find h_local s (* All accessible statements have been visited. Returns 0 for syntactically dead code. *) with Not_found -> 0), (if Cil_datatype.Stmt.Hashtbl.length h_merge = 0 then NoMerge else Merge (fun s -> Cil_datatype.Stmt.Hashtbl.mem h_merge s)) with Stack.Empty -> Value_parameters.abort "Incorrectly nested slevel directives in function %a" Kernel_function.pretty kf module ForKf = Kernel_function.Make_Table (Datatype.Pair(DatatypeSlevel)(DatatypeMerge)) (struct let size = 17 let dependencies = [Ast.self; Value_parameters.SemanticUnrollingLevel.self;] let name = "Value.Local_slevel.ForKf" end) let memo = ForKf.memo compute let local kf = fst (memo kf) let merge kf = snd (memo kf) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/per_stmt_slevel.mli�����������������������������0000666�0000000�0000000�00000004345�13571573400�023226� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Fine-tuning for slevel, according to [//@ slevel] directives. *) open Cil_types type slevel = | Global of int (** Same slevel i in the entire function *) | PerStmt of (stmt -> int) (** Different slevel for different statements *) (** Slevel to use in this function *) val local: kernel_function -> slevel type merge = | NoMerge (** Propagate states according to slevel in the entire function. *) | Merge of (stmt -> bool) (** Statements on which multiple states should be merged (instead of being propagated separately) *) (** Slevel merge strategy for this function *) val merge: kernel_function -> merge �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/split_return.ml���������������������������������0000666�0000000�0000000�00000030041�13571573400�022370� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Abstract_interp (* Auxiliary module for inference of split criterion. We collect all the usages of a function call, and all places where they are compared against an integral constant *) module ReturnUsage = struct let debug = false module MapLval = Cil_datatype.Lval.Map (* Uses of a given lvalue *) type return_usage_by_lv = { ret_callees: Kernel_function.Hptset.t (* all the functions that put their results in this lvalue *); ret_compared: Datatype.Integer.Set.t (* all the constant values this lvalue is compared against *); } (* Per-function usage: all interesting lvalues are mapped to the way they are used *) and return_usage_per_fun = return_usage_by_lv MapLval.t module RUDatatype = Kernel_function.Map.Make(Datatype.Integer.Set) let find_or_default uf lv = try MapLval.find lv uf with Not_found -> { ret_callees = Kernel_function.Hptset.empty; ret_compared = Datatype.Integer.Set.empty; } (* Treat a [Call] instruction. Immediate calls (no functions pointers) are added to the current usage store *) let add_call (uf: return_usage_per_fun) lv_opt e_fun = match e_fun.enode, lv_opt with | Lval (Var vi, NoOffset), Some lv when Cil.isIntegralOrPointerType (Cil.typeOfLval lv) -> let kf = Globals.Functions.get vi in let u = find_or_default uf lv in let funs = Kernel_function.Hptset.add kf u.ret_callees in let u = { u with ret_callees = funs } in if debug then Format.printf "[Usage] %a returns %a@." Kernel_function.pretty kf Printer.pp_lval lv; MapLval.add lv u uf | _ -> uf (* Treat a [Set] instruction [lv = (cast) lv']. Useful for return codes that are stored inside values of a slightly different type *) let add_alias (uf: return_usage_per_fun) lv_dest e = match e.enode with | CastE (typ, { enode = Lval lve }) when Cil.isIntegralOrPointerType typ && Cil.isIntegralOrPointerType (Cil.typeOfLval lve) -> let u = find_or_default uf lve in MapLval.add lv_dest u uf | _ -> uf (* add a comparison with the integer [i] to the lvalue [lv] *) let add_compare_ct uf i lv = if Cil.isIntegralOrPointerType (Cil.typeOfLval lv) then let u = find_or_default uf lv in let v = Datatype.Integer.Set.add i u.ret_compared in let u = { u with ret_compared = v } in if debug then Format.printf "[Usage] Comparing %a to %a@." Printer.pp_lval lv Int.pretty i; MapLval.add lv u uf else uf (* Treat an expression [lv == ct], [lv != ct] or [!lv], possibly with some cast. [ct] is added to the store of usages. *) let add_compare (uf: return_usage_per_fun) cond = (* if [ct] is an integer constant, memoize it is compared to [lv] *) let add ct lv = (match Cil.constFoldToInt ct with | Some i -> add_compare_ct uf i lv | _ -> uf) in (match cond.enode with | BinOp ((Eq | Ne), {enode = Lval lv}, ct, _) | BinOp ((Eq | Ne), ct, {enode = Lval lv}, _) -> add ct lv | BinOp ((Eq | Ne), {enode = CastE (typ, {enode = Lval lv})}, ct, _) | BinOp ((Eq | Ne), ct, {enode = CastE (typ, {enode = Lval lv})}, _) -> if Cil.isIntegralOrPointerType typ && Cil.isIntegralOrPointerType (Cil.typeOfLval lv) then add ct lv else uf | UnOp (LNot, {enode = Lval lv}, _) -> add_compare_ct uf Int.zero lv | UnOp (LNot, {enode = CastE (typ, {enode = Lval lv})}, _) when Cil.isIntegralOrPointerType typ && Cil.isIntegralOrPointerType (Cil.typeOfLval lv) -> add_compare_ct uf Int.zero lv | _ -> uf) (* Treat an expression [v] or [e1 && e2] or [e1 || e2]. This expression is supposed to be just inside an [if(...)], so that we may recognize patterns such as [if (f() && g())]. Patterns such as [if (f() == 1 && !g())] are handled in another way: the visitor recognizes comparison operators and [!], and calls {!add_compare}. *) let rec add_direct_comparison uf e = match e.enode with | Lval lv -> add_compare_ct uf Int.zero lv | CastE (typ, {enode = Lval lv}) when Cil.isIntegralOrPointerType typ && Cil.isIntegralOrPointerType (Cil.typeOfLval lv) -> add_compare_ct uf Int.zero lv | BinOp ((LAnd | LOr), e1, e2, _) -> add_direct_comparison (add_direct_comparison uf e1) e2 | _ -> uf (* Per-program split strategy. Functions are mapped to the values their return code should be split against. *) type return_split = Datatype.Integer.Set.t Kernel_function.Map.t (* add to [kf] hints to split on all integers in [s]. *) let add_split kf s (ru:return_split) : return_split = let cur = try Kernel_function.Map.find kf ru with Not_found -> Datatype.Integer.Set.empty in let s = Datatype.Integer.Set.union cur s in Kernel_function.Map.add kf s ru (* Extract global usage: map functions to integers their return values are tested against *) let summarize_by_lv (uf: return_usage_per_fun): return_split = let aux _lv u acc = if Datatype.Integer.Set.is_empty u.ret_compared then acc else let aux_kf kf ru = add_split kf u.ret_compared ru in Kernel_function.Hptset.fold aux_kf u.ret_callees acc in MapLval.fold aux uf Kernel_function.Map.empty class visitorVarUsage = object inherit Visitor.frama_c_inplace val mutable usage = MapLval.empty method! vinst i = (match i with | Set (lv, e, _) -> usage <- add_alias usage lv e | Call (lv_opt, e, _, _) -> usage <- add_call usage lv_opt e | Local_init(v, AssignInit i, _) -> let rec aux lv i = match i with | SingleInit e -> usage <- add_alias usage lv e | CompoundInit (_, l) -> List.iter (fun (o,i) -> aux (Cil.addOffsetLval o lv) i) l in aux (Cil.var v) i | Local_init(v, ConsInit(f,_,Plain_func), _) -> usage <- add_call usage (Some (Cil.var v)) (Cil.evar f) | Local_init(_, ConsInit _,_) -> () (* not a real assignment. *) | Asm _ | Skip _ | Code_annot _ -> () ); Cil.DoChildren method! vstmt_aux s = (match s.skind with | If (e, _, _, _) | Switch (e, _, _, _) -> usage <- add_direct_comparison usage e | _ -> () ); Cil.DoChildren method! vexpr e = usage <- add_compare usage e; Cil.DoChildren method result () = summarize_by_lv usage end (* For functions returning pointers, add a split on NULL/non-NULL *) let add_null_pointers_split (ru: return_split): return_split = let null_set = Datatype.Integer.Set.singleton Integer.zero in let aux kf acc = if Cil.isPointerType (Kernel_function.get_return_type kf) then add_split kf null_set acc else acc in Globals.Functions.fold aux ru let compute file = let vis = new visitorVarUsage in Visitor.visitFramacFileSameGlobals (vis:> Visitor.frama_c_visitor) file; let split_compared = vis#result () in let split_null_pointers = add_null_pointers_split split_compared in split_null_pointers end module AutoStrategy = State_builder.Option_ref (ReturnUsage.RUDatatype) (struct let name = "Value.Split_return.Autostrategy" let dependencies = [Ast.self] end) let () = Ast.add_monotonic_state AutoStrategy.self let compute_auto () = if AutoStrategy.is_computed () then AutoStrategy.get () else begin let s = ReturnUsage.compute (Ast.get ()) in AutoStrategy.set s; AutoStrategy.mark_as_computed (); s end (* Auto-strategy for one given function *) let find_auto_strategy kf = try let s = Kernel_function.Map.find kf (compute_auto ()) in Split_strategy.SplitEqList (Datatype.Integer.Set.elements s) with Not_found -> Split_strategy.NoSplit module KfStrategy = Kernel_function.Make_Table(Split_strategy) (struct let size = 17 let dependencies = [Value_parameters.SplitReturnFunction.self; Value_parameters.SplitGlobalStrategy.self; AutoStrategy.self] let name = "Value.Split_return.Kfstrategy" end) (* Invariant: this function never returns Split_strategy.SplitAuto *) let kf_strategy = KfStrategy.memo (fun kf -> try (* User strategies take precedence *) match Value_parameters.SplitReturnFunction.find kf with | Split_strategy.SplitAuto -> find_auto_strategy kf | s -> s with Not_found -> match Value_parameters.SplitGlobalStrategy.get () with | Split_strategy.SplitAuto -> find_auto_strategy kf | s -> s ) let pretty_strategies fmt = Format.fprintf fmt "@[<v>"; let open Split_strategy in let pp_list = Pretty_utils.pp_list ~sep:",@ " Int.pretty in let pp_one user_auto pp = function | NoSplit -> () | FullSplit -> Format.fprintf fmt "@[\\full_split(%t)@]@ " pp | SplitEqList l -> Format.fprintf fmt "@[\\return(%t) == %a (%s)@]@ " pp pp_list l user_auto | SplitAuto -> assert false (* should have been replaced by SplitEqList *) in let pp_kf kf fmt = Kernel_function.pretty fmt kf in let pp_user (kf, strategy) = match strategy with | None -> () | Some SplitAuto -> pp_one "auto" (pp_kf kf) (kf_strategy kf) | Some s -> pp_one "user" (pp_kf kf) s in Value_parameters.SplitReturnFunction.iter pp_user; if not (Value_parameters.SplitReturnFunction.is_empty ()) && match Value_parameters.SplitGlobalStrategy.get () with | Split_strategy.NoSplit | Split_strategy.SplitAuto -> false | _ -> true then Format.fprintf fmt "@[other functions:@]@ "; begin match Value_parameters.SplitGlobalStrategy.get () with | SplitAuto -> let pp_auto kf s = if not (Value_parameters.SplitReturnFunction.mem kf) then let s = SplitEqList (Datatype.Integer.Set.elements s) in pp_one "auto" (pp_kf kf) s in let auto = compute_auto () in Kernel_function.Map.iter pp_auto auto; | s -> pp_one "auto" (fun fmt -> Format.pp_print_string fmt "@all") s end; Format.fprintf fmt "@]" let pretty_strategies () = if not (Value_parameters.SplitReturnFunction.is_empty ()) || (Value_parameters.SplitGlobalStrategy.get () != Split_strategy.NoSplit) then Value_parameters.result "Splitting return states on:@.%t" pretty_strategies (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/split_return.mli��������������������������������0000666�0000000�0000000�00000003615�13571573400�022550� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module is used to merge together the final states of a function according to a given strategy. Default is to merge all states together *) val pretty_strategies: unit -> unit val kf_strategy: Kernel_function.t -> Split_strategy.t (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/split_strategy.ml�������������������������������0000666�0000000�0000000�00000007204�13571573400�022720� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Abstract_interp type split_strategy = | NoSplit | SplitAuto | SplitEqList of Datatype.Integer.t list | FullSplit (* To be completed with more involved strategies *) include Datatype.Make_with_collections(struct type t = split_strategy let name = "Value.Split_strategy" let rehash = Datatype.identity let structural_descr = Structural_descr.t_abstract let reprs = [NoSplit] let compare s1 s2 = match s1, s2 with | NoSplit, NoSplit -> 0 | NoSplit, _ -> -1 | _, NoSplit -> 1 | SplitAuto, SplitAuto -> 0 | SplitAuto, _ -> -1 | _, SplitAuto -> 1 | FullSplit, FullSplit -> 0 | FullSplit, _ -> -1 | _, FullSplit -> 1 | SplitEqList l1, SplitEqList l2 -> Extlib.list_compare Int.compare l1 l2 let equal = Datatype.from_compare let hash = function | NoSplit -> 17 | SplitAuto -> 47 | FullSplit -> 19 | SplitEqList l -> List.fold_left (fun acc i -> acc * 13 + 57 * Int.hash i) 1 l let copy = Datatype.identity let internal_pretty_code = Datatype.undefined let pretty fmt = function | NoSplit -> Format.pp_print_string fmt "no split" | SplitAuto -> Format.pp_print_string fmt "auto split" | FullSplit -> Format.pp_print_string fmt "full split" | SplitEqList l -> Format.fprintf fmt "Split on \\result == %a" (Pretty_utils.pp_list ~sep:",@ " Datatype.Integer.pretty) l let varname _ = "v" let mem_project = Datatype.never_any_project end) exception ParseFailure of string let of_string s = match s with | "" -> NoSplit | "full" -> FullSplit | "auto" -> SplitAuto | _ -> let r = Str.regexp ":" in let conv s = try Integer.of_string s with Invalid_argument _ -> raise (ParseFailure s) in SplitEqList (List.map conv (Str.split r s)) let to_string = function | NoSplit -> "" | SplitAuto -> "auto" | FullSplit -> "full" | SplitEqList l -> Format.asprintf "%t" (fun fmt -> Pretty_utils.pp_list ~sep:":" Datatype.Integer.pretty fmt l) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/split_strategy.mli������������������������������0000666�0000000�0000000�00000003564�13571573400�023076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type split_strategy = | NoSplit | SplitAuto | SplitEqList of Datatype.Integer.t list | FullSplit include Datatype.S_with_collections with type t = split_strategy exception ParseFailure of string val of_string: string -> t (* @raise ParseFailure *) val to_string: t -> string ��������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/trace_partitioning.ml���������������������������0000666�0000000�0000000�00000030606�13571573400�023532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Bottom.Type open Partition module Make (Abstract: Abstractions.Eva) (Transfer : Transfer_stmt.S with type state = Abstract.Dom.t) (Kf : sig val kf: kernel_function end) = struct module Parameters = Partitioning_parameters.Make (Kf) open Kf open Parameters module Domain = Abstract.Dom module Index = Partitioning_index.Make (Domain) module Flow = Partition.MakeFlow (Abstract) type state = Domain.t type store = { rationing: Partition.rationing; (* slevel rationing at this point *) flow_actions : action list; (* partitioning actions to be applied *) store_stmt : stmt option; store_index : Index.t; (* Index of all states stored: used to quickly remove new states that have already been propagated. *) mutable store_partition : state partition; (* partition of states *) mutable incoming_states : int; (* number of incoming states. *) } type flow = Flow.t type tank = { mutable tank_states : state partition; } type widening_state = { mutable widened_state : state option; mutable previous_state : state; mutable widening_counter : int; } type widening = { widening_stmt : stmt; mutable widening_partition : widening_state partition; } (* Constructors *) let empty_store ~(stmt : stmt option) : store = let limit, merge, flow_actions = match stmt with | None -> max_int, false, [] | Some stmt -> slevel stmt, merge stmt, flow_actions stmt in let rationing = Partition.new_rationing ~limit ~merge in { rationing; flow_actions; store_stmt = stmt; store_index = Index.empty (); store_partition = Partition.empty; incoming_states = 0; } let empty_flow : flow = Flow.empty let empty_tank () : tank = { tank_states = Partition.empty } let empty_widening ~(stmt : stmt option) : widening = { widening_stmt = Extlib.opt_conv Cil.invalidStmt stmt; widening_partition = Partition.empty; } let initial_tank (states : state list) : tank = let flow = Flow.initial states in (* Split the initial partition according to the global split seetings *) let states = List.fold_left Flow.transfer_keys flow universal_splits in { tank_states = Flow.to_partition states } (* Pretty printing *) let pretty_store (fmt : Format.formatter) (s : store) : unit = Partition.iter (fun _key state -> Domain.pretty fmt state) s.store_partition let pretty_flow (fmt : Format.formatter) (flow : flow) = Flow.iter (Domain.pretty fmt) flow (* Accessors *) let expanded (s : store) : state list = Partition.to_list s.store_partition let smashed (s : store) : state or_bottom = match expanded s with | [] -> `Bottom | v1 :: l -> `Value (List.fold_left Domain.join v1 l) let contents (flow : flow) : state list = Flow.to_list flow let is_empty_store (s : store) : bool = Partition.is_empty s.store_partition let is_empty_flow (flow : flow) : bool = Flow.is_empty flow let is_empty_tank (t : tank) : bool = Partition.is_empty t.tank_states let store_size (s : store) : int = Partition.size s.store_partition let flow_size (flow : flow) : int = Flow.size flow let tank_size (t : tank) : int = Partition.size t.tank_states (* Partition transfer functions *) let enter_loop (flow : flow) (i : stmt) : flow = Flow.transfer_keys flow (Enter_loop (unroll i)) let leave_loop (flow : flow) (_i : stmt) : flow = Flow.transfer_keys flow Leave_loop let next_loop_iteration (flow : flow) (_i : stmt) : flow = Flow.transfer_keys flow Incr_loop let empty_rationing = new_rationing ~limit:0 ~merge:false let split_return (flow : flow) (return_exp : exp option) : flow = let strategy = Split_return.kf_strategy kf in if strategy = Split_strategy.FullSplit then flow else let apply action = Flow.join_duplicate_keys (Flow.transfer_keys flow action) in match Split_return.kf_strategy kf with (* SplitAuto already transformed into SplitEqList. *) | Split_strategy.FullSplit | Split_strategy.SplitAuto -> assert false | Split_strategy.NoSplit -> apply (Ration empty_rationing) | Split_strategy.SplitEqList i -> match return_exp with | None -> apply (Ration empty_rationing) | Some return_exp -> if Cil.isIntegralOrPointerType (Cil.typeOf return_exp) then apply (Restrict (return_exp, i)) else apply (Ration empty_rationing) (* Reset state (for hierchical convergence) *) let reset_store (s : store) : unit = let is_eternal key _state = not (Key.exceed_rationing key) in s.store_partition <- Partition.filter is_eternal s.store_partition let reset_tank (t : tank) : unit = t.tank_states <- Partition.empty let reset_widening (w : widening) : unit = w.widening_partition <- Partition.empty let reset_widening_counter (w : widening) : unit = let reset w = { w with widening_counter = max w.widening_counter (widening_period - 1) } in w.widening_partition <- Partition.map reset w.widening_partition (* Operators *) let drain (t : tank) : flow = let flow = Flow.of_partition t.tank_states in t.tank_states <- Partition.empty; flow let fill ~(into : tank) (flow : flow) : unit = let new_states = Flow.to_partition flow in let join _key dest src = match dest, src with | Some dest, Some src -> Some (Domain.join dest src) | Some v, None | None, Some v -> Some v | None, None -> None in into.tank_states <- Partition.merge join into.tank_states new_states let transfer = Flow.transfer_states let output_slevel : int -> unit = let slevel_display_step = Value_parameters.ShowSlevel.get () in let max_displayed = ref 0 in fun x -> if x >= !max_displayed + slevel_display_step then let rounded = x / slevel_display_step * slevel_display_step in Value_parameters.feedback ~once:true ~current:true "Trace partitioning superposing up to %d states" rounded; max_displayed := rounded let partitioning_feedback dest flow stmt = output_slevel dest.incoming_states; (* Debug information. *) Value_parameters.debug ~dkey:Value_parameters.dkey_iterator ~current:true "reached statement %d with %d incoming states, %d to propagate" stmt.sid dest.incoming_states (flow_size flow) let join (sources : (branch*flow) list) (dest : store) : flow = let is_loop_head = match dest.store_stmt with | Some {skind=Cil_types.Loop _} -> true | _ -> false in (* Get every source flow *) let sources_states = match sources with | [(_,flow)] -> [flow] | sources -> (* Several branches -> partition according to the incoming branch *) let get (b,flow) = Flow.transfer_keys flow (Branch (b,history_size)) in List.map get sources in (* Merge incomming flows *) let flow_states = List.fold_left Flow.union Flow.empty sources_states in (* Handle ration stamps *) dest.incoming_states <- dest.incoming_states + Flow.size flow_states; let rationing_action = Ration dest.rationing in (* Handle Split / Merge operations *) let flow_actions = Update_dynamic_splits :: dest.flow_actions in (* Execute actions *) let actions = rationing_action :: flow_actions in let flow_states = List.fold_left Flow.transfer_keys flow_states actions in (* Add states to the store but filter out already propagated states *) let update key current_state = (* Inclusion test *) let state = try let previous_state = Partition.find key dest.store_partition in if Domain.is_included current_state previous_state then (* The current state is included in the previous; stop *) None else begin (* Propagate the join of the two states *) if is_loop_head then Value_parameters.feedback ~level:1 ~once:true ~current:true "starting to merge loop iterations"; Some (Domain.join previous_state current_state) end with (* There is no previous state, propagate normally *) Not_found -> Some current_state in (* Add the propagated state to the store *) let add s = dest.store_partition <- Partition.replace key s dest.store_partition; in Extlib.may add state; (* Filter out already propagated states (only at statements). *) if dest.store_stmt = None then state else Extlib.opt_filter (fun s -> Index.add s dest.store_index) state in let flow = Flow.join_duplicate_keys flow_states in let flow = Flow.filter_map update flow in Extlib.may (partitioning_feedback dest flow) dest.store_stmt; flow let widen (w : widening) (flow : flow) : flow = let stmt = w.widening_stmt in (* Apply widening to each leaf *) let widen_one key curr = try (* Search for an already existing widening state *) let w = Partition.find key w.widening_partition in let previous_state = w.previous_state in (* Update the widening state *) w.previous_state <- curr; w.widening_counter <- w.widening_counter - 1; (* Propagated state decreases, stop propagating *) if Domain.is_included curr previous_state then None (* Widening is delayed *) else if w.widening_counter >= 0 then Some curr (* Apply widening *) else begin Value_parameters.feedback ~level:1 ~once:true ~current:true ~dkey:Value_parameters.dkey_widening "applying a widening at this point"; (* We join the previous widening state with the previous iteration state so as to allow the intermediate(s) iteration(s) (between two widenings) to stabilize at least a part of the state. *) let prev = match w.widened_state with | Some v -> Domain.join previous_state v | None -> previous_state in let next = Domain.widen kf stmt prev (Domain.join prev curr) in w.previous_state <- next; w.widened_state <- Some next; w.widening_counter <- widening_period - 1; Some next end with Not_found -> (* The key is not in the widening state; add the state if slevel is exceeded. *) if Key.exceed_rationing key then begin let ws = { widened_state = None; previous_state = curr; widening_counter = widening_delay - 1; } in w.widening_partition <- Partition.replace key ws w.widening_partition end; Some curr in let flow = Flow.join_duplicate_keys flow in Flow.filter_map widen_one flow end ��������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/partitioning/trace_partitioning.mli��������������������������0000666�0000000�0000000�00000012070�13571573400�023676� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Bottom.Type module Make (Abstract : Abstractions.Eva) (Transfer : Transfer_stmt.S with type state = Abstract.Dom.t) (Kf : sig val kf: Cil_types.kernel_function end) : sig type state = Abstract.Dom.t (** The states being partitioned *) type store (** The storage of all states ever met at a control point *) type tank (** The set of states that remains to propagate from a control point. *) type flow (** A set of states which are currently propagated *) type widening (** Widening information *) (* --- Constructors --- *) val empty_store : stmt:Cil_types.stmt option -> store val empty_flow : flow val empty_tank : unit -> tank val empty_widening : stmt:Cil_types.stmt option -> widening (** Build the initial tank for the entry point of a function. *) val initial_tank : state list -> tank (* --- Pretty printing --- *) val pretty_store : Format.formatter -> store -> unit val pretty_flow : Format.formatter -> flow -> unit (* --- Accessors --- *) val expanded : store -> state list val smashed : store -> state or_bottom val contents : flow -> state list val is_empty_store : store -> bool val is_empty_flow : flow -> bool val is_empty_tank : tank -> bool val store_size : store -> int val flow_size : flow -> int val tank_size : tank -> int (* --- Reset state (for hierchical convergence) --- *) (* These functions reset the part of the state of the analysis which has been obtained after a widening. *) val reset_store : store -> unit val reset_tank : tank -> unit val reset_widening : widening -> unit (** Resets (or just delays) the widening counter. Used on nested loops, to postpone the widening of the inner loop when iterating on the outer loops. This is especially useful when the inner loop fixpoint does not depend on the outer loop. *) val reset_widening_counter : widening -> unit (* --- Partition transfer functions --- *) val enter_loop : flow -> Cil_types.stmt -> flow val leave_loop : flow -> Cil_types.stmt -> flow val next_loop_iteration : flow -> Cil_types.stmt -> flow val split_return : flow -> Cil_types.exp option -> flow (* --- Operators --- *) (** Remove all states from the tank, leaving it empty as if it was just created by [empty_tank] *) val drain : tank -> flow (** Fill the states of the flow into the tank, modifying [into] inplace. *) val fill : into:tank -> flow -> unit (** Apply a transfer function to all the states of a propagation. *) val transfer : (state -> state list) -> flow -> flow (** Join all incoming propagations into the given store. This function returns a set of states which still need to be propagated past the store. If a state from the propagations is included in another state which has already been propagated, it may be removed from the output propagation. Likewise, if a state from a propagation is included in a state from another propagation of the list (coming from another edge or iteration), it may also be removed. This function also interprets partitioning annotations at the store vertex (slevel, splits, merges, ...) which will generally change the current partitioning. *) val join : (Partition.branch * flow) list -> store -> flow (** Widen a flow. The widening object keeps track of the previous widenings and previous propagated states to ensure termination. *) val widen : widening -> flow -> flow end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/register.ml��������������������������������������������������0000666�0000000�0000000�00000043643�13571573400�016767� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Locations let compute () = (* Nothing to recompute when Value has already been computed. This boolean is automatically cleared when an option of Value changes, because they are registered as dependencies on [Db.Value.self] in {!Value_parameters}.*) if not (Db.Value.is_computed ()) then Analysis.force_compute () let _self = Db.register_compute "Value.compute" [ Db.Value.self ] Db.Value.compute compute let () = Value_parameters.ForceValues.set_output_dependencies [Db.Value.self] let main () = (* Value computations *) if Value_parameters.ForceValues.get () then !Db.Value.compute (); if Db.Value.is_computed () then Red_statuses.report () let () = Db.Main.extend main (* Functions to register in Db.Value *) let eval_error_reason fmt e = if e <> Eval_terms.CAlarm then Eval_terms.pretty_logic_evaluation_error fmt e let assigns_inputs_to_zone state assigns = let env = Eval_terms.env_assigns ~pre:state in let treat_asgn acc (_,ins as asgn) = match ins with | FromAny -> Zone.top | From l -> try List.fold_left (fun acc t -> let z = Eval_terms.eval_tlval_as_zone ~alarm_mode:Eval_terms.Ignore Read env t.it_content in Zone.join acc z) acc l with Eval_terms.LogicEvalError e -> Value_parameters.warning ~current:true ~once:true "Failed to interpret inputs in assigns clause '%a'%a" Printer.pp_from asgn eval_error_reason e; Zone.top in match assigns with | WritesAny -> Zone.top | Writes l -> List.fold_left treat_asgn Zone.bottom l let assigns_outputs_aux ~eval ~bot ~top ~join state ~result assigns = let env = Eval_terms.env_post_f state state result () in let treat_asgn acc ({it_content = out},_) = if Logic_utils.is_result out && result = None then acc else try let z = eval env out in join z acc with Eval_terms.LogicEvalError e -> Value_parameters.warning ~current:true ~once:true "Failed to interpret assigns clause '%a'%a" Printer.pp_term out eval_error_reason e; join top acc in match assigns with | WritesAny -> join top bot | Writes l -> List.fold_left treat_asgn bot l let assigns_outputs_to_zone = let eval env term = Eval_terms.eval_tlval_as_zone ~alarm_mode:Eval_terms.Ignore Write env term in assigns_outputs_aux ~eval ~bot:Locations.Zone.bottom ~top:Locations.Zone.top ~join:Locations.Zone.join let assigns_outputs_to_locations = let eval env term = Eval_terms.eval_tlval_as_location ~alarm_mode:Eval_terms.Ignore env term in assigns_outputs_aux ~eval ~bot:[] ~top:(Locations.make_loc Locations.Location_Bits.top Int_Base.top) ~join:(fun v l -> v :: l) (* "access" functions before evaluation, registered in Db.Value *) let access_value_of_lval kinstr lv = let state = Db.Value.get_state kinstr in snd (!Db.Value.eval_lval None state lv) let access_value_of_expr kinstr e = let state = Db.Value.get_state kinstr in !Db.Value.eval_expr state e let access_value_of_location kinstr loc = let state = Db.Value.get_state kinstr in Db.Value.find state loc let find_deps_term_no_transitivity_state state t = try let env = Eval_terms.env_only_here state in let r = Eval_terms.eval_term ~alarm_mode:Eval_terms.Ignore env t in r.Eval_terms.ldeps with Eval_terms.LogicEvalError _ -> raise Db.From.Not_lval (* If the function is a builtin, or if the user has requested it, use \assigns and \from clauses, that give an approximation of the result *) let use_spec_instead_of_definition kf = not (Kernel_function.is_definition kf) || Ast_info.is_frama_c_builtin (Kernel_function.get_name kf) || Builtins.find_builtin_override kf <> None || Kernel_function.Set.mem kf (Value_parameters.UsePrototype.get ()) || Value_parameters.LoadFunctionState.mem kf let eval_predicate ~pre ~here p = let open Eval_terms in let env = env_annot ~pre ~here () in match eval_predicate env p with | True -> Property_status.True | False -> Property_status.False_if_reachable | Unknown -> Property_status.Dont_know let () = (* Pretty-printing *) Db.Value.use_spec_instead_of_definition := use_spec_instead_of_definition; Db.Value.assigns_outputs_to_zone := assigns_outputs_to_zone; Db.Value.assigns_outputs_to_locations := assigns_outputs_to_locations; Db.Value.assigns_inputs_to_zone := assigns_inputs_to_zone; Db.Value.access := access_value_of_lval; Db.Value.access_location := access_value_of_location; Db.Value.access_expr := access_value_of_expr; Db.Value.Logic.eval_predicate := eval_predicate; Db.From.find_deps_term_no_transitivity_state := find_deps_term_no_transitivity_state; (* -------------------------------------------------------------------------- *) (* Register Evaluation Functions *) (* -------------------------------------------------------------------------- *) open Eval module CVal = struct include Main_values.CVal let structure = Abstract.Value.Leaf (key, (module Main_values.CVal)) end module Val = struct include CVal include Structure.Open (Abstract.Value) (CVal) let reduce t = t end module Eva = Evaluation.Make (Val) (Main_locations.PLoc) (Cvalue_domain.State) module Transfer = Cvalue_domain.State.Transfer (Eva.Valuation) let inject_cvalue state = state, Locals_scoping.bottom () let bot_value = function | `Bottom -> Cvalue.V.bottom | `Value v -> v let bot_state = function | `Bottom -> Cvalue.Model.bottom | `Value s -> s let update valuation state = bot_state (Transfer.update valuation state >>-: fst) let rec eval_deps state e = match e.enode with | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ | Const _ -> Locations.Zone.bottom | Lval lv -> eval_deps_lval state lv | BinOp (_,e1,e2,_) -> Locations.Zone.join (eval_deps state e1) (eval_deps state e2) | CastE (_,e) | UnOp (_,e,_) | Info (e,_) -> eval_deps state e | AddrOf lv | StartOf lv -> eval_deps_addr state lv and eval_deps_lval state lv = let for_writing = false in let deps = eval_deps_addr state lv in let loc = fst (Eva.lvaluate ~for_writing state lv) >>-: fun (_valuation, loc, _typ) -> loc in match loc with | `Bottom -> deps | `Value loc -> let deps_lv = Precise_locs.enumerate_valid_bits Read loc in Locations.Zone.join deps deps_lv and eval_deps_addr state (h, o:lval) = Locations.Zone.join (eval_deps_host state h) (eval_deps_offset state o) and eval_deps_host state h = match h with | Var _ -> Locations.Zone.bottom | Mem e -> eval_deps state e and eval_deps_offset state o = match o with | NoOffset -> Locations.Zone.bottom | Field (_, o) -> eval_deps_offset state o | Index (i, o) -> Locations.Zone.join (eval_deps state i) (eval_deps_offset state o) let notify_opt with_alarms alarms = Extlib.may (fun mode -> Alarmset.notify mode alarms) with_alarms let eval_expr_with_valuation ?with_alarms deps state expr= let state = inject_cvalue state in let deps = match deps with | None -> None | Some deps -> let deps' = eval_deps state expr in Some (Locations.Zone.join deps' deps) in let eval, alarms = Eva.evaluate state expr in notify_opt with_alarms alarms; match eval with | `Bottom -> (Cvalue.Model.bottom, deps, Cvalue.V.bottom), None | `Value (valuation, result) -> let state = update valuation state in (state, deps, result), Some valuation (* Compatibility layer between the old API of eval_exprs and the new evaluation scheme. *) module Eval = struct let eval_expr ?with_alarms state expr = let state = inject_cvalue state in let eval, alarms = Eva.evaluate ~reduction:false state expr in notify_opt with_alarms alarms; bot_value (eval >>-: snd) let eval_lval ?with_alarms deps state lval = let expr = Value_util.lval_to_exp lval in let res, valuation = eval_expr_with_valuation ?with_alarms deps state expr in let typ = match valuation with | None -> Cil.typeOfLval lval | Some valuation -> match Eva.Valuation.find_loc valuation lval with | `Value record -> record.typ | `Top -> Cil.typeOfLval lval in let state, deps, v = res in state, deps, v, typ let eval_expr_with_deps_state ?with_alarms deps state expr = fst (eval_expr_with_valuation ?with_alarms deps state expr) let reduce_by_cond state expr positive = let state = inject_cvalue state in let eval, _alarms = Eva.reduce state expr positive in bot_state (eval >>-: fun valuation -> update valuation state) let lval_to_precise_loc_deps_state ?with_alarms ~deps state ~reduce_valid_index:(_:bool) lval = if not (Cvalue.Model.is_reachable state) then state, deps, Precise_locs.loc_bottom, (Cil.typeOfLval lval) else let state = inject_cvalue state in let deps = match deps with | None -> None | Some deps -> let deps' = eval_deps_addr state lval in Some (Locations.Zone.join deps' deps) in let eval, alarms = Eva.lvaluate ~for_writing:false state lval in notify_opt with_alarms alarms; match eval with | `Bottom -> Cvalue.Model.bottom, deps, Precise_locs.loc_bottom, (Cil.typeOfLval lval) | `Value (valuation, loc, typ) -> update valuation state, deps, loc, typ let lval_to_loc_deps_state ?with_alarms ~deps state ~reduce_valid_index lv = let state, deps, pl, typ = lval_to_precise_loc_deps_state ?with_alarms ~deps state ~reduce_valid_index lv in state, deps, Precise_locs.imprecise_location pl, typ let lval_to_precise_loc_state ?with_alarms state lv = let state, _, r, typ = lval_to_precise_loc_deps_state ?with_alarms ~deps:None ~reduce_valid_index:(Kernel.SafeArrays.get ()) state lv in state, r, typ and lval_to_loc_state ?with_alarms state lv = let state, _, r, typ = lval_to_loc_deps_state ?with_alarms ~deps:None ~reduce_valid_index:(Kernel.SafeArrays.get ()) state lv in state, r, typ let lval_to_precise_loc ?with_alarms state lv = let _, r, _typ = lval_to_precise_loc_state ?with_alarms state lv in r let lval_to_loc ?with_alarms state lv = let _, r, _typ = lval_to_loc_state ?with_alarms state lv in r let resolv_func_vinfo ?with_alarms deps state funcexp = let open Cil_types in let state = inject_cvalue state in let deps = match funcexp.enode with | Lval (Var _, NoOffset) -> deps | Lval (Mem v, _) -> begin match deps with | None -> None | Some deps -> let deps' = eval_deps state v in Some (Locations.Zone.join deps' deps) end | _ -> assert false in let kfs, alarms = Eva.eval_function_exp funcexp state in notify_opt with_alarms alarms; let kfs = match kfs with | `Bottom -> Kernel_function.Hptset.empty | `Value kfs -> List.fold_left (fun acc (kf, _) -> Kernel_function.Hptset.add kf acc) Kernel_function.Hptset.empty kfs in kfs, deps end module type Eval = module type of Eval (* Functions to register in Db.Value that depend on evaluation functions. *) module Export (Eval : Eval) = struct open Eval let lval_to_loc_with_deps_state ?with_alarms state ~deps lv = let _state, deps, r, _ = lval_to_loc_deps_state ?with_alarms ~deps:(Some deps) ~reduce_valid_index:(Kernel.SafeArrays.get ()) state lv in Extlib.opt_conv Locations.Zone.bottom deps, r let lval_to_loc_with_deps kinstr ?with_alarms ~deps lv = let state = Db.Value.noassert_get_state kinstr in lval_to_loc_with_deps_state ?with_alarms state ~deps lv let lval_to_loc_kinstr kinstr ?with_alarms lv = let state = Db.Value.noassert_get_state kinstr in lval_to_loc ?with_alarms state lv let lval_to_precise_loc_with_deps_state_alarm ?with_alarms state ~deps lv = let _state, deps, ploc, _ = lval_to_precise_loc_deps_state ?with_alarms ~deps ~reduce_valid_index:(Kernel.SafeArrays.get ()) state lv in let deps = Extlib.opt_conv Locations.Zone.bottom deps in deps, ploc let lval_to_precise_loc_with_deps_state = lval_to_precise_loc_with_deps_state_alarm ?with_alarms:None let lval_to_zone kinstr ?with_alarms lv = let state_to_joined_zone state acc = let _, r = lval_to_precise_loc_with_deps_state_alarm ?with_alarms state ~deps:None lv in let zone = Precise_locs.enumerate_valid_bits Read r in Locations.Zone.join acc zone in Db.Value.fold_state_callstack state_to_joined_zone Locations.Zone.bottom ~after:false kinstr let lval_to_zone_state state lv = let _, r = lval_to_precise_loc_with_deps_state state ~deps:None lv in Precise_locs.enumerate_valid_bits Read r let lval_to_zone_with_deps_state state ~for_writing ~deps lv = let deps, r = lval_to_precise_loc_with_deps_state state ~deps lv in let r = (* No write effect if [lv] is const *) if for_writing && (Value_util.is_const_write_invalid (Cil.typeOfLval lv)) then Precise_locs.loc_bottom else r in let access = if for_writing then Write else Read in let zone = Precise_locs.enumerate_valid_bits access r in let exact = Precise_locs.valid_cardinal_zero_or_one ~for_writing r in deps, zone, exact let lval_to_offsetmap_aux ?with_alarms state lv = let loc = Locations.valid_part Read (lval_to_loc ?with_alarms state lv) in match loc.Locations.size with | Int_Base.Top -> None | Int_Base.Value size -> match Cvalue.Model.copy_offsetmap loc.Locations.loc size state with | `Bottom -> None | `Value m -> Some m let lval_to_offsetmap kinstr ?with_alarms lv = let state = Db.Value.noassert_get_state kinstr in lval_to_offsetmap_aux ?with_alarms state lv let lval_to_offsetmap_state state lv = lval_to_offsetmap_aux state lv let expr_to_kernel_function_state ?with_alarms state ~deps exp = let r, deps = resolv_func_vinfo ?with_alarms deps state exp in Extlib.opt_conv Locations.Zone.bottom deps, r let expr_to_kernel_function kinstr ?with_alarms ~deps exp = let state_to_joined_kernel_function state (z_acc, kf_acc) = let z, kf = expr_to_kernel_function_state ?with_alarms state ~deps exp in Locations.Zone.join z z_acc, Kernel_function.Hptset.union kf kf_acc in Db.Value.fold_state_callstack state_to_joined_kernel_function ((match deps with None -> Locations.Zone.bottom | Some z -> z), Kernel_function.Hptset.empty) ~after:false kinstr let expr_to_kernel_function_state = expr_to_kernel_function_state ?with_alarms:None end module type Export = module type of (Export (Eval)) let register (module Eval: Eval) (module Export: Export) = let open Export in Db.Value.eval_expr := Eval.eval_expr; Db.Value.eval_expr_with_state := (fun ?with_alarms state expr -> let (s, _, v) = Eval.eval_expr_with_deps_state ?with_alarms None state expr in s, v); Db.Value.reduce_by_cond := Eval.reduce_by_cond; Db.Value.eval_lval := (fun ?with_alarms deps state lval -> let _, deps, r, _ = Eval.eval_lval ?with_alarms deps state lval in deps, r); Db.Value.lval_to_loc_with_deps := lval_to_loc_with_deps; Db.Value.lval_to_loc_with_deps_state := lval_to_loc_with_deps_state ?with_alarms:None; Db.Value.lval_to_loc := lval_to_loc_kinstr; Db.Value.lval_to_loc_state := Eval.lval_to_loc ?with_alarms:None; Db.Value.lval_to_zone_state := lval_to_zone_state; Db.Value.lval_to_zone := lval_to_zone; Db.Value.lval_to_zone_with_deps_state := lval_to_zone_with_deps_state; Db.Value.lval_to_precise_loc_state := Eval.lval_to_precise_loc_state; Db.Value.lval_to_precise_loc_with_deps_state := lval_to_precise_loc_with_deps_state; Db.Value.lval_to_offsetmap := lval_to_offsetmap; Db.Value.lval_to_offsetmap_state := lval_to_offsetmap_state; Db.Value.expr_to_kernel_function := expr_to_kernel_function; Db.Value.expr_to_kernel_function_state := expr_to_kernel_function_state; () let () = Db.Value.initial_state_only_globals := Analysis.cvalue_initial_state let () = let eval = (module Eval : Eval) in let export = (module Export ((val eval : Eval)) : Export) in register eval export;; (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/register.mli�������������������������������������������������0000666�0000000�0000000�00000003251�13571573400�017127� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Functions of the Value plugin registered in {!Db}. Nothing is exported. *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/�������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015737� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/abstract.ml��������������������������������������������0000666�0000000�0000000�00000006420�13571573400�020076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** External interface of an abstraction, built by {!Structure.Open}. *) module type Interface = sig type t type 'a key val mem : 'a key -> bool val get : 'a key -> (t -> 'a) option val set : 'a key -> 'a -> t -> t end module Value = struct module V = struct type 'a t = (module Abstract_value.S with type t = 'a) end include Structure.Shape (Structure.Key_Value) (V) module type Internal = sig include Abstract_value.S val structure: t structure end module type External = sig include Internal include Structure.External with type t := t and type 'a key := 'a key end end module Location = struct module L = struct type 'a t = (module Abstract_location.S with type location = 'a) end include Structure.Shape (Structure.Key_Location) (L) module type Internal = sig include Abstract_location.S val structure: location structure end module type External = sig include Internal include Structure.External with type t := location and type 'a key := 'a key end end module Domain = struct module D = struct type 'a t = (module Abstract_domain.Internal with type state = 'a) end include Structure.Shape (Structure.Key_Domain) (D) module type Internal = sig include Abstract_domain.Internal val structure: t structure end module type External = sig include Internal include Structure.External with type t := t and type 'a key := 'a key val get_cvalue: (t -> Cvalue.Model.t) option val get_cvalue_or_top: t -> Cvalue.Model.t val get_cvalue_or_bottom: t Bottom.or_bottom -> Cvalue.Model.t end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/abstract.mli�������������������������������������������0000666�0000000�0000000�00000011420�13571573400�020243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Internal and External signature of abstractions used in the Eva engine. *) (** Internal modules contains a [structure] value that describes the internal structure of the abstraction. This structure is used to automatically generate efficient accessors from a generic compound abstraction to specific leaf abstractions. *) (** External modules export direct accessors to their leaf components. When a generic abstraction is a product of several specific abstractions, they allow interacting with each leaf abstraction identified by a key. Note that their behavior is undefined if an abstraction contains several times the same leaf module. *) (** External interface of an abstraction, built by {!Structure.Open}. *) module type Interface = sig type t type 'a key (** Tests whether a key belongs to the module. *) val mem : 'a key -> bool (** For a key of type [k key]: - if the values of type [t] contain a subpart of type [k] from a module identified by the key, then [get key] returns an accessor for it. - otherwise, [get key] returns None. *) val get : 'a key -> (t -> 'a) option (** For a key of type [k key]: - if the values of type [t] contain a subpart of type [k] from a module identified by the key, then [set key v t] returns the value [t] in which this subpart has been replaced by [v]. - otherwise, [set key _] is the identity function. *) val set : 'a key -> 'a -> t -> t end (** Key and structure for abstract values. See {structure.mli} for more details. *) module Value : sig include Structure.Shape with type 'a key = 'a Structure.Key_Value.key and type 'a data = (module Abstract_value.S with type t = 'a) module type Internal = sig include Abstract_value.S val structure: t structure end module type External = sig include Internal include Interface with type t := t and type 'a key := 'a key end end (** Key and structure for abstract locations. See {structure.mli} for more details. *) module Location : sig include Structure.Shape with type 'a key = 'a Structure.Key_Location.key and type 'a data = (module Abstract_location.S with type location = 'a) module type Internal = sig include Abstract_location.S val structure: location structure end module type External = sig include Internal include Interface with type t := location and type 'a key := 'a key end end (** Key and structure for abstract domains. See {structure.mli} for more details. *) module Domain : sig include Structure.Shape with type 'a key = 'a Structure.Key_Domain.key and type 'a data = (module Abstract_domain.Internal with type state = 'a) module type Internal = sig include Abstract_domain.Internal val structure: t structure end module type External = sig include Internal include Interface with type t := t and type 'a key := 'a key (** Special accessors for the main cvalue domain. *) val get_cvalue: (t -> Cvalue.Model.t) option val get_cvalue_or_top: t -> Cvalue.Model.t val get_cvalue_or_bottom: t Bottom.or_bottom -> Cvalue.Model.t end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/backward_formals.ml������������������������������������0000666�0000000�0000000�00000006576�13571573400�021610� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types exception Unsafe (* This visitor checks that an expression is guaranteed to evaluate in the same way before and after a call. We restrict ourselves to lvalues that are unreferenced locals or formals, because they cannot be changed by the callee. *) let safe_argument_visitor = object(self) inherit Visitor.frama_c_inplace method! vlval = function | Var vi, NoOffset -> if vi.vaddrof || Cil.typeHasQualifier "volatile" vi.vtype || vi.vglob then raise Unsafe; Cil.DoChildren | _, _ -> raise Unsafe method inspect expr = try ignore (Visitor.visitFramacExpr (self:>Visitor.frama_c_inplace) expr); true with Unsafe -> false end let safe_argument = safe_argument_visitor#inspect let written_formals kf = let module S = Cil_datatype.Varinfo.Set in match kf.fundec with | Declaration _ -> S.empty | Definition (fdec, _) -> let add_addr_taken acc vi = if vi.vaddrof then S.add vi acc else acc in let referenced_formals = ref (List.fold_left add_addr_taken S.empty fdec.sformals) in let obj = object inherit Visitor.frama_c_inplace method! vinst i = begin match i with | Call (Some (Var vi, _), _, _, _) | Set ((Var vi, _), _, _) -> if Kernel_function.is_formal vi kf then referenced_formals := S.add vi !referenced_formals | _ -> () end; Cil.SkipChildren end in ignore (Visitor.visitFramacFunction (obj :> Visitor.frama_c_visitor) fdec); !referenced_formals module WrittenFormals = Kernel_function.Make_Table(Cil_datatype.Varinfo.Set) (struct let size = 17 let dependencies = [Ast.self] let name = "Value_util.WrittenFormals" end) let written_formals = WrittenFormals.memo written_formals ����������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/backward_formals.mli�����������������������������������0000666�0000000�0000000�00000004262�13571573400�021747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Functions related to the backward propagation of the value of formals at the end of a call. When possible, this value is propagated to the actual parameter. *) val written_formals: Cil_types.kernel_function -> Cil_datatype.Varinfo.Set.t (** [written_formals kf] is an over-approximation of the formals of [kf] which may be internally overwritten by [kf] during its call. *) val safe_argument: Cil_types.exp -> bool (** [safe_argument e] returns [true] if [e] (which is supposed to be an actual parameter) is guaranteed to evaluate in the same way before and after the call. *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/eval_typ.ml��������������������������������������������0000666�0000000�0000000�00000021460�13571573400�020117� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cvalue let is_bitfield typlv = match Cil.unrollType typlv with | TInt (_, attrs) | TEnum (_, attrs) -> (match Cil.findAttribute Cil.bitfield_attribute_name attrs with | [AInt _] -> true | _ -> false) | _ -> false let bitfield_size_attributes attrs = match Cil.findAttribute Cil.bitfield_attribute_name attrs with | [AInt size] -> Some size | _ -> None let sizeof_lval_typ typlv = match Cil.unrollType typlv with | TInt (_, attrs) | TEnum (_, attrs) as t -> (match Cil.findAttribute Cil.bitfield_attribute_name attrs with | [AInt i] -> Int_Base.Value i | _ -> Bit_utils.sizeof t) | t -> Bit_utils.sizeof t let offsetmap_matches_type typ_lv o = let aux typ_matches = match V_Offsetmap.single_interval_value o with | None -> true (* multiple bindings. Assume that type matches *) | Some v -> let v = V_Or_Uninitialized.get_v v in try typ_matches (V.project_ival_bottom v) with V.Not_based_on_null -> true (* Do not mess with pointers *) in let is_float = function | Ival.Float _ -> true | Ival.Top _ -> false | Ival.Set _ as i -> Ival.(equal zero i || equal bottom i) in let is_int = function | Ival.Top _ | Ival.Set _ -> true | Ival.Float _ -> false in match Cil.unrollType typ_lv with | TFloat _ -> aux is_float | TInt _ | TEnum _ | TPtr _ -> aux is_int | _ -> true type fct_pointer_compatibility = | Compatible | Incompatible | Incompatible_but_accepted let is_compatible_function ~typ_pointed ~typ_fun = (* our own notion of weak compatibility: - attributes and qualifiers are always ignored - all pointers types are considered compatible - enums and integer types with the same signedness and size are equal *) let weak_compatible t1 t2 = Cabs2cil.areCompatibleTypes t1 t2 || match Cil.unrollType t1, Cil.unrollType t2 with | TVoid _, TVoid _ -> true | TPtr _, TPtr _ -> true | (TInt (ik1, _) | TEnum ({ekind = ik1}, _)), (TInt (ik2, _) | TEnum ({ekind = ik2}, _)) -> Cil.isSigned ik1 = Cil.isSigned ik2 && Cil.bitsSizeOfInt ik1 = Cil.bitsSizeOfInt ik2 | TFloat (fk1, _), TFloat (fk2, _) -> fk1 = fk2 | TComp (ci1, _, _), TComp (ci2, _, _) -> Cil_datatype.Compinfo.equal ci1 ci2 | _ -> false in if Cabs2cil.areCompatibleTypes typ_fun typ_pointed then Compatible else let continue = match Cil.unrollType typ_pointed, Cil.unrollType typ_fun with | TFun (ret1, args1, var1, _), TFun (ret2, args2, var2, _) -> (* Either both functions are variadic, or none. Otherwise, it will be too complicated to make the argument match *) var1 = var2 && (* Both functions return something weakly compatible *) weak_compatible ret1 ret2 && (* Argument lists of the same length, with compatible arguments or unspecified argument lists *) (match args1, args2 with | None, None | None, Some _ | Some _, None -> true | Some lp, Some lf -> (* See corresponding function fold_left2_best_effort in Function_args *) let rec comp lp lf = match lp, lf with | _, [] -> true (* accept too many arguments passed *) | [], _ :: _ -> false (* fail on too few arguments *) | (_, tp, _) :: qp, (_, tf, _) :: qf -> weak_compatible tp tf && comp qp qf in comp lp lf ) | _ -> false in if continue then Incompatible_but_accepted else Incompatible let refine_fun_ptr typ args = match Cil.unrollType typ, args with | TFun (_, Some _, _, _), _ | _, None -> typ | TFun (ret, None, var, attrs), Some l -> let ltyps = List.map (fun arg -> "", Cil.typeOf arg, []) l in TFun (ret, Some ltyps, var, attrs) | _ -> assert false (* Filters the list of kernel function [kfs] to only keep functions compatible with the type [typ_pointer]. *) let compatible_functions typ_pointer ?args kfs = let typ_pointer = refine_fun_ptr typ_pointer args in let check_pointer (list, alarm) kf = let typ = Kernel_function.get_type kf in if Cil.isFunctionType typ then match is_compatible_function typ_pointer typ with | Compatible -> kf :: list, alarm | Incompatible_but_accepted -> kf :: list, true | Incompatible -> list, true else list, true in List.fold_left check_pointer ([], false) kfs (* Does the expr contains a lval having a volatile part ? *) let rec expr_contains_volatile expr = let rec aux expr = match expr.enode with | Lval lval -> lval_contains_volatile lval | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> aux e | AddrOf lv | StartOf lv -> lval_contains_volatile lv | BinOp (_, e1, e2, _) -> aux e1 || aux e2 | _ -> false in aux expr (* Does the lval (or sub expr) has a volatile part ? *) and lval_contains_volatile lval = Cil.isVolatileLval lval || expr_in_lval_contains_volatile lval and expr_in_lval_contains_volatile (lhost, offset) = expr_in_host_contains_volatile lhost || expr_in_offset_contains_volatile offset and expr_in_host_contains_volatile = function | Var _ -> false | Mem e -> expr_contains_volatile e and expr_in_offset_contains_volatile = function | NoOffset -> false | Field (_, o) -> expr_in_offset_contains_volatile o | Index (e, o) -> expr_in_offset_contains_volatile o || expr_contains_volatile e (* Scalar types *) type integer_range = { i_bits: int; i_signed: bool } module DatatypeIntegerRange = Datatype.Make(struct include Datatype.Serializable_undefined type t = integer_range let reprs = [{i_bits = 1; i_signed = true}] let name = "Value.Eval_typ.DatatypeIntegerRange" let mem_project = Datatype.never_any_project end) let ik_range ik : integer_range = { i_bits = Cil.bitsSizeOfInt ik; i_signed = Cil.isSigned ik } let ik_attrs_range ik attrs = let i_bits = match bitfield_size_attributes attrs with | None -> Cil.bitsSizeOfInt ik | Some size -> Integer.to_int size in { i_bits; i_signed = Cil.isSigned ik } let range_inclusion r1 r2 = match r1.i_signed, r2.i_signed with | true, true | false, false -> r1.i_bits <= r2.i_bits | true, false -> false | false, true -> r1.i_bits <= r2.i_bits-1 let range_lower_bound r = if r.i_signed then Cil.min_signed_number r.i_bits else Integer.zero let range_upper_bound r = if r.i_signed then Cil.max_signed_number r.i_bits else Cil.max_unsigned_number r.i_bits type scalar_typ = | TSInt of integer_range | TSPtr of integer_range | TSFloat of fkind let classify_as_scalar typ = match Cil.unrollType typ with | TInt (ik, attrs) | TEnum ({ekind=ik}, attrs) -> Some (TSInt (ik_attrs_range ik attrs)) | TPtr _ -> let range = { i_bits = Cil.bitsSizeOfInt Cil.theMachine.Cil.upointKind; i_signed = Cil.isSigned Cil.theMachine.Cil.upointKind } in Some (TSPtr range) | TFloat (fk, _) -> Some (TSFloat fk) | _ -> None let need_cast t1 t2 = match classify_as_scalar t1, classify_as_scalar t2 with | None, _ | _, None -> false | Some st1, Some st2 -> match st1, st2 with | (TSInt ir1 | TSPtr ir1), (TSInt ir2 | TSPtr ir2) -> ir1 <> ir2 | TSFloat fk1, TSFloat fk2 -> fk1 <> fk2 | (TSInt _ | TSPtr _ | TSFloat _), (TSInt _ | TSPtr _ | TSFloat _) -> true ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/eval_typ.mli�������������������������������������������0000666�0000000�0000000�00000010656�13571573400�020275� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** Functions related to type conversions *) (** Bitfields *) val is_bitfield: typ -> bool val sizeof_lval_typ: typ -> Int_Base.t (** Size of the type of a lval, taking into account that the lval might have been a bitfield. *) (** [offsetmap_matches_type t o] returns true if either: - [o] contains a single scalar binding, of the expected scalar type [t] (float or integer) - [o] contains multiple bindings, pointers, etc. - [t] is not a scalar type. *) val offsetmap_matches_type: typ -> Cvalue.V_Offsetmap.t -> bool val need_cast: typ -> typ -> bool (** return [true] if the two types are statically distinct, and a cast from one to the other may have an effect on an abstract value. *) (* [compatible_functions typ kfs] filters the list [kfs] to only keep functions compatible with the type [typ]. The returned boolean is true if some functions were incompatible. If a list of arguments [args] is provided, also removes functions incompatible with them. Used to verify a call through a function pointer is ok. In theory, we could only check that both types are compatible as defined by C99, 6.2.7. However, some industrial codes do not strictly follow the norm, and we must be more lenient. Thus, some functions are also kept when Eva can ignore more or less safely the incompatibility in the types (which is however reported in the returned boolean). *) val compatible_functions: typ -> ?args:exp list -> Kernel_function.t list -> Kernel_function.t list * bool val expr_contains_volatile: exp -> bool val lval_contains_volatile: lval -> bool (** Those two expressions indicate that one l-value contained inside the arguments (and the l-value itself for [lval_contains_volatile]) has volatile qualifier. Relational analyses should not learn anything on such values. *) (** Abstraction of an integer type, more convenient than an [ikind] because it can also be used for bitfields. *) type integer_range = { i_bits: int; i_signed: bool } module DatatypeIntegerRange: Datatype.S with type t = integer_range val ik_range: ikind -> integer_range val ik_attrs_range: ikind -> attributes -> integer_range (** Range for an integer type with some attributes. The attribute {!Cil.bitfield_attribute_name} influences the width of the type. *) val range_inclusion: integer_range -> integer_range -> bool (** Checks inclusion of two integer ranges. *) val range_lower_bound: integer_range -> Integer.t val range_upper_bound: integer_range -> Integer.t (** Abstraction of scalar types -- in particular, all those that can be involved in a cast. Enum and integers are coalesced. *) type scalar_typ = | TSInt of integer_range | TSPtr of integer_range | TSFloat of fkind (* Classifies a cil type as a scalar type; returns None for non-scalar types. *) val classify_as_scalar: typ -> scalar_typ option ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/library_functions.ml�����������������������������������0000666�0000000�0000000�00000010363�13571573400�022030� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Retres = Kernel_function.Make_Table (Datatype.Option(Cil_datatype.Varinfo)) (struct let name = "Value.Library_functions.Retres" let size = 9 let dependencies = [Ast.self] end) let () = Ast.add_monotonic_state Retres.self let () = State_dependency_graph.add_dependencies ~from:Retres.self [ Db.Value.self ] let get_retres_vi = Retres.memo (fun kf -> let vi = Kernel_function.get_vi kf in let typ = Cil.getReturnType vi.vtype in if Cil.isVoidType typ then None else try ignore (Cil.bitsSizeOf typ); let name = Format.asprintf "\\result<%a>" Kernel_function.pretty kf in Some (Cil.makeVarinfo false false name typ) with Cil.SizeOfError _ -> Value_parameters.abort ~current:true "function %a returns a value of unknown size. Aborting" Kernel_function.pretty kf ) let returned_value kf = let return_type = Cil.unrollType (Kernel_function.get_return_type kf) in match return_type with | TComp _ when Cil.is_fully_arithmetic return_type -> Cvalue.V.top_int | TPtr _ | TComp _ -> Cvalue.V.inject Base.null Ival.zero | TInt _ | TEnum _ -> Cvalue.V.top_int | TFloat (FFloat, _) -> Cvalue.V.top_single_precision_float | TFloat (FDouble, _) | TFloat (FLongDouble, _) -> Cvalue.V.top_float | TBuiltin_va_list _ -> Value_parameters.error ~current:true ~once:true "functions returning variadic arguments must be stubbed%t" Value_util.pp_callstack; Cvalue.V.top_int | TVoid _ -> Cvalue.V.top (* this value will never be used *) | TFun _ | TNamed _ | TArray _ -> assert false let unsupported_specifications = [ "glob", "glob.c"; "globfree", "glob.c"; "getaddrinfo", "netdb.c"; "getline", "stdio.c"; "strerror", "string.c"; "strdup", "string.c"; "strndup", "string.c"; "getenv", "stdlib.c"; "posix_memalign", "stdlib.c"; "putenv", "stdlib.c"; "setenv", "stdlib.c"; "unsetenv", "stdlib.c" ] let unsupported_specs_tbl = let tbl = Hashtbl.create 10 in List.iter (fun (name, file) -> Hashtbl.replace tbl name file) unsupported_specifications; tbl let warn_unsupported_spec name = try let header = Hashtbl.find unsupported_specs_tbl name in Value_parameters.warning ~once:true ~current:true ~wkey:Value_parameters.wkey_libc_unsupported_spec "@[The specification of function '%s' is currently not supported by Eva.@ \ Consider adding %s@ to the analyzed source files.@]" name (Config.datadir ^ "/libc/" ^ header) with Not_found -> () (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/library_functions.mli����������������������������������0000666�0000000�0000000�00000004012�13571573400�022173� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cvalue val get_retres_vi: kernel_function -> varinfo option (** Fake varinfo used by Value to store the result of functions. Returns [None] if the function has a void type. *) val returned_value: kernel_function -> V.t val warn_unsupported_spec : string -> unit (** Warns on functions from the frama-c libc with unsupported specification. *) (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/mark_noresults.ml��������������������������������������0000666�0000000�0000000�00000004206�13571573400�021343� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let should_memorize_function f = Value_parameters.ResultsAll.get () && not (Cil_datatype.Fundec.Set.mem f (Value_parameters.NoResultsFunctions.get ())) let () = Db.Value.no_results := (fun fd -> not (should_memorize_function fd)) (* Signal that some results are not stored. The gui, or some calls to Db.Value, may fail ungracefully *) let no_memoization_enabled () = not (Value_parameters.ResultsAll.get ()) || not (Value_parameters.NoResultsFunctions.is_empty ()) (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/partitioning_annots.ml���������������������������������0000666�0000000�0000000�00000016407�13571573400�022372� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Logic_ptree [@@@ warning "-42"] type slevel_annotation = | SlevelMerge | SlevelDefault | SlevelLocal of int type unroll_annotation = term option type flow_annotation = | FlowSplit of term | FlowMerge of term (* We use two representations for annotations : - the high level representation (HL) which is exported from this module - the low level representation (Cil) which is used by the kernel to store any annotation Annotations in this module define the export and import function to go from one to another. Then, the parse and print functions works directly on the high level representation. add --+ | ACSL --> parse --+--> HL --> export --> Cil --> import --+--> HL --> print | +--> get *) exception Parse_error module type Annotation = sig type t val name : string val is_loop_annot : bool val parse : typing_context:Logic_typing.typing_context -> lexpr list -> t val export : t -> acsl_extension_kind val import : acsl_extension_kind -> t val print : Format.formatter -> t -> unit end module Register (M : Annotation) = struct include M let typing_ext ~typing_context ~loc args = try export (parse ~typing_context args) with Parse_error -> typing_context.Logic_typing.error loc "Invalid %s directive" name let printer_ext _pp fmt lp = print fmt (import lp) let () = if is_loop_annot then begin Logic_typing.register_code_annot_next_loop_extension name false typing_ext; Cil_printer.register_loop_annot_extension name printer_ext end else begin Logic_typing.register_code_annot_next_stmt_extension name false typing_ext; Cil_printer.register_code_annot_extension name printer_ext end let get stmt = let filter_add _emitter annot acc = match annot.annot_content with | Cil_types.AExtended (_, is_loop_annot', {ext_name=name'; ext_kind}) when name' = name && is_loop_annot' = is_loop_annot -> import ext_kind :: acc | _ -> acc in List.rev (Annotations.fold_code_annot filter_add stmt []) let add ~emitter ~loc stmt annot = let param = M.export annot in let extension = Logic_const.new_acsl_extension "slevel" loc false param in let annot_node = Cil_types.AExtended ([], false, extension) in let code_annotation = Logic_const.new_code_annotation annot_node in Annotations.add_code_annot emitter stmt code_annotation end module Slevel = Register (struct type t = slevel_annotation let name = "slevel" let is_loop_annot = false let parse ~typing_context:_ = function | [{lexpr_node = PLvar "default"}] -> SlevelDefault | [{lexpr_node = PLvar "merge"}] -> SlevelMerge | [{lexpr_node = PLconstant (IntConstant i)}] -> let i = try int_of_string i with Failure _ -> raise Parse_error in if i < 0 then raise Parse_error; SlevelLocal i | _ -> raise Parse_error let export = function | SlevelDefault -> Ext_terms [Logic_const.tstring "default"] | SlevelMerge -> Ext_terms [Logic_const.tstring "merge"] | SlevelLocal i -> Ext_terms [Logic_const.tinteger i] let import = function | Ext_terms [{term_node}] -> begin match term_node with | TConst (LStr "default") -> SlevelDefault | TConst (LStr "merge") -> SlevelMerge | TConst (Integer (i, _)) -> SlevelLocal (Integer.to_int i) | _ -> SlevelDefault (* be kind. Someone is bound to write a visitor that will simplify our term into something unrecognizable... *) end | _ -> assert false let print fmt = function | SlevelDefault -> Format.pp_print_string fmt "default" | SlevelMerge -> Format.pp_print_string fmt "merge" | SlevelLocal i -> Format.pp_print_int fmt i end) module SimpleTermAnnotation = struct type t = term let parse ~typing_context = function | [t] -> let open Logic_typing in typing_context.type_term typing_context typing_context.pre_state t | _ -> raise Parse_error let export t = Ext_terms [t] let import = function | Ext_terms [t] -> t | _ -> assert false let print = Printer.pp_term end module OptionalTermAnnotation = struct type t = term option let parse ~typing_context = function | [] -> None | [t] -> let open Logic_typing in Some (typing_context.type_term typing_context typing_context.pre_state t) | _ -> raise Parse_error let export t = Ext_terms (Extlib.list_of_opt t) let import = function | Ext_terms l -> Extlib.opt_of_list l | _ -> assert false let print = Pretty_utils.pp_opt Printer.pp_term end module Unroll = Register (struct include OptionalTermAnnotation let name = "unroll" let is_loop_annot = true end) module Split = Register (struct include SimpleTermAnnotation let name = "split" let is_loop_annot = false end) module Merge = Register (struct include SimpleTermAnnotation let name = "merge" let is_loop_annot = false end) let get_slevel_annot stmt = try Some (List.hd (Slevel.get stmt)) with Failure _ -> None let get_unroll_annot stmt = Unroll.get stmt let get_flow_annot stmt = List.map (fun a -> FlowSplit a) (Split.get stmt) @ List.map (fun a -> FlowMerge a) (Merge.get stmt) let add_slevel_annot = Slevel.add let add_unroll_annot = Unroll.add let add_flow_annot ~emitter ~loc stmt = function | FlowSplit annot -> Split.add ~emitter ~loc stmt annot | FlowMerge annot -> Merge.add ~emitter ~loc stmt annot ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/partitioning_annots.mli��������������������������������0000666�0000000�0000000�00000004507�13571573400�022541� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type slevel_annotation = | SlevelMerge | SlevelDefault | SlevelLocal of int type unroll_annotation = Cil_types.term option type flow_annotation = | FlowSplit of Cil_types.term | FlowMerge of Cil_types.term val get_slevel_annot : Cil_types.stmt -> slevel_annotation option val get_unroll_annot : Cil_types.stmt -> unroll_annotation list val get_flow_annot : Cil_types.stmt -> flow_annotation list val add_slevel_annot : emitter:Emitter.t -> loc:Cil_types.location -> Cil_types.stmt -> slevel_annotation -> unit val add_unroll_annot : emitter:Emitter.t -> loc:Cil_types.location -> Cil_types.stmt -> unroll_annotation -> unit val add_flow_annot : emitter:Emitter.t -> loc:Cil_types.location -> Cil_types.stmt -> flow_annotation -> unit �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/red_statuses.ml����������������������������������������0000666�0000000�0000000�00000016267�13571573400�021012� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type alarm_or_property = Alarm of Alarms.t | Prop of Property.t (* Datatype for [alarm_or_property]. *) module AlarmOrProp = Datatype.Make_with_collections(struct include Datatype.Serializable_undefined type t = alarm_or_property let reprs = [Alarm (List.hd Alarms.reprs); Prop (List.hd Property.reprs)] let name = "Value.Red_statuses.AlarmOrProp" let pretty fmt = function | Alarm a -> Alarms.pretty fmt a | Prop p -> Property.pretty fmt p let compare v1 v2 = match v1, v2 with | Alarm a1, Alarm a2 -> Alarms.compare a1 a2 | Prop p1, Prop p2 -> Property.compare p1 p2 | Alarm _, Prop _ -> -1 | Prop _, Alarm _ -> 1 let equal = Datatype.from_compare let hash = function | Alarm a -> 3 + Alarms.hash a | Prop p -> 175 + Property.hash p end) module Callstacks = Value_types.Callstack.Set (* For each alarm or predicate, stores the set of callstacks for which it was evaluated to False. *) module RedStatuses = AlarmOrProp.Map.Make (Callstacks) (* Stores the set of red statuses at each program point. *) module RedStatusesTable = Cil_state_builder.Kinstr_hashtbl (RedStatuses) (struct let name = "Value.Red_statuses.RedStatusesTable" let size = 16 let dependencies = [ Db.Value.self ] end) let add_red_ap kinstr ap = let current_map = try RedStatusesTable.find kinstr with Not_found -> AlarmOrProp.Map.empty in let callstacks = try AlarmOrProp.Map.find ap current_map with Not_found -> Callstacks.empty in let new_callstacks = Callstacks.add (Value_util.call_stack ()) callstacks in let new_map = AlarmOrProp.Map.add ap new_callstacks current_map in RedStatusesTable.replace kinstr new_map let add_red_alarm ki a = add_red_ap ki (Alarm a) let add_red_property ki ip = if false then add_red_ap ki (Prop ip) else (* Collapses preconditions-at-callsites into the precondition itself, by modifying the callstack. Results in a better display *) let open Property in match ip with | IPPropertyInstance {ii_ip=IPPredicate {ip_kind=PKRequires _} as ip'} -> add_red_ap Kglobal (Prop ip') | _ -> add_red_ap ki (Prop ip) let is_red_in_callstack kinstr ap callstack = try let map = RedStatusesTable.find kinstr in let callstacks = AlarmOrProp.Map.find ap map in Callstacks.mem callstack callstacks with Not_found -> false let get_all () = let gather kinstr map acc = AlarmOrProp.Map.fold (fun ap callstacks acc -> let number = Callstacks.cardinal callstacks in (kinstr, ap, number) :: acc) map acc in RedStatusesTable.fold gather [] (* Information to print on the csv file for each property with a red status. *) type information = { loc: location; (* Source-code location of the property. *) kf: kernel_function; (* Function including the property. *) alarm: bool; (* Is the property an Eva alarm or another logic property? *) kind: string; (* Name of the property. *) text: string; (* Node of the property. *) status: Property_status.Feedback.t; (* Final status of the property. *) contexts: int; (* Number of contexts in which the property had a red status. *) } let kinstr_to_stmt = function | Kglobal -> let kf = fst (Globals.entry_point ()) in kf, Kernel_function.find_first_stmt kf | Kstmt stmt -> Kernel_function.find_englobing_kf stmt, stmt let kf_of_property ip = match Property.get_kf ip with | Some kf -> kf | None -> fst (Globals.entry_point ()) let loc_of_property kf ip = let loc = Property.location ip in if Cil_datatype.Location.(equal loc unknown) then Kernel_function.get_location kf else loc (* For properties that we want to skip *) exception Skip let compute_information (kinstr, alarm_or_prop, contexts) = let kf, property, alarm = match alarm_or_prop with | Alarm alarm -> let kf, stmt = kinstr_to_stmt kinstr in let code_annot, _ = Alarms.to_annot kinstr alarm in let property = Property.ip_of_code_annot_single kf stmt code_annot in kf, property, true | Prop ip -> kf_of_property ip, ip, false in let kind, text = match Description.property_kind_and_node property with | None -> raise Skip | Some (kind, text) -> kind, text in let loc = loc_of_property kf property in let status = Property_status.Feedback.get property in { loc; kf; alarm; kind; text; status; contexts } let print_information fmt { loc; kf; alarm; kind; text; status; contexts } = let pos = fst loc in let file = Filepath.Normalized.to_pretty_string pos.Filepath.pos_path in let dir = Filepath.relativize (Filename.dirname file) in let file = Filename.basename file in let lnum = pos.Filepath.pos_lnum in let kf = Kernel_function.get_name kf in let alarm = if alarm then "Alarm" else "Property" in let status = Description.status_feedback status in Format.fprintf fmt "@[<h>%s\t%s\t%d\t%s\t%s\t%s\t%i\t%s\t%s@]@," dir file lnum kf alarm kind contexts status text let output file = Value_parameters.feedback "Listing red statuses in file %s" file; let channel = open_out file in let fmt = Format.formatter_of_out_channel channel in Format.pp_set_margin fmt 1000000; Format.fprintf fmt "@[<v>"; Format.fprintf fmt "@[directory\tfile\tline\tfunction\tkind\tname\t#contexts\tstatus\tproperty@]@,"; let list = get_all () in let compute e acc = try compute_information e :: acc with Skip -> acc in let infos = List.fold_right compute list [] in List.iter (print_information fmt) infos; Format.fprintf fmt "@]%!" let report () = let file = Value_parameters.ReportRedStatuses.get () in if file <> "" then output file �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/red_statuses.mli���������������������������������������0000666�0000000�0000000�00000005201�13571573400�021145� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** This modules stores the alarms and properties for which a red status has been emitted. *) (* Remembers that a red status has been emitted for an alarm or a property at the given kinstr. *) val add_red_alarm: kinstr -> Alarms.t -> unit val add_red_property: kinstr -> Property.t -> unit type alarm_or_property = Alarm of Alarms.t | Prop of Property.t module AlarmOrProp : Datatype.S with type t := alarm_or_property (* Whether a red status has been emitted for an alarm or a property at the given kinstr in the given callstack. *) val is_red_in_callstack: kinstr -> alarm_or_property -> Value_types.callstack -> bool (* Returns the unsorted list of all alarms and properties for which a red status has been emitted during the analysis. Also returns the kinstr of the alarm or property, and the number of callstacks in which is was invalid.*) val get_all: unit -> (kinstr * alarm_or_property * int) list (* If option -eva-report-red-statuses has been set, reports red statuses in a csv file. *) val report: unit -> unit �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/state_import.ml����������������������������������������0000666�0000000�0000000�00000027442�13571573400�021014� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cvalue open Cil_types let dkey = Value_parameters.register_category "restart" let base_cache : (int, Base.t) Hashtbl.t = Hashtbl.create 41 let v_cache = V.Hashtbl.create 53 (* Used to identify and remove escaping values from globals *) exception Possibly_escaping_value let import_varinfo (vi : varinfo) ~importing_value = try if Cil.isFunctionType vi.vtype then let kf = Globals.Functions.find_by_name vi.vname in Kernel_function.get_vi kf else begin let vi' = Globals.Vars.find_from_astinfo vi.vname VGlobal in if vi.vstorage = Static then Value_parameters.warning ~once:true "loaded state contains static variables;@ AST ordering@ \ cannot be enforced and must be manually checked for soundness@ \ (e.g. ensure that files are processed in the same order)"; vi' end with Not_found -> (* search in the state *) if importing_value then begin (* Variable may be an escaping local value *) Value_parameters.warning "variable `%a' is not global, \ possibly an escaping value; ignoring" Printer.pp_varinfo vi; raise Possibly_escaping_value end else Value_parameters.abort "global not found: `%a'" Printer.pp_varinfo vi let import_validity = function | Base.Empty | Base.Known _ | Base.Unknown _ | Base.Invalid as v -> v | Base.Variable { Base.weak; min_alloc; max_alloc; max_allocable } -> let var = Base.create_variable_validity ~weak ~min_alloc ~max_alloc in if Integer.equal max_allocable var.Base.max_allocable then Base.Variable var else Kernel.abort "Incompatible maximum size for variable %a vs. %a" Abstract_interp.Int.pretty max_allocable Abstract_interp.Int.pretty var.Base.max_allocable let import_base (base : Base.t) ~importing_value = let make_base = function | Base.Var (vi, _validity) -> Base.of_varinfo (import_varinfo vi ~importing_value) | Base.CLogic_Var (lv, _ty, _validity) -> (* Value states do not contain logic variables anyway (except when evaluating ACSL clauses, which is not the case here *) Value_parameters.fatal "importing logic variables (%a) is unsupported" Printer.pp_logic_var lv | Base.Null -> Base.null | Base.String (_, s) -> (* TODO: currently, we recreate a new string unrelated to the original one. This is probably not the good solution *) let c = match s with | Base.CSString s -> Const (CStr s) | Base.CSWstring s -> Const (CWStr s) in let e = Cil.new_exp Cil_datatype.Location.unknown c in Base.of_string_exp e | Base.Allocated (vi, deallocation, validity) -> Value_parameters.feedback ~dkey "recreating allocated base for alloc: `%a'" Printer.pp_varinfo vi; let new_vi = Value_util.create_new_var vi.vname vi.vtype in let validity = import_validity validity in let new_base = Base.register_allocated_var new_vi deallocation validity in Builtins_malloc.register_malloced_base new_base; new_base in let id = Base.id base in try let res = Hashtbl.find base_cache id in res with Not_found -> let base' = make_base base in Hashtbl.replace base_cache id base'; base' let import_base_setlattice (sl : Base.SetLattice.t) ~importing_value = Base.SetLattice.fold (fun base acc -> let b' = import_base base ~importing_value in Base.Hptset.add b' acc ) sl Base.Hptset.empty let import_ival = Ival.rehash let import_map (m : Cvalue.V.M.t) = let add base ival m = let new_base = import_base base ~importing_value:true in let new_ival = import_ival ival in Cvalue.V.add new_base new_ival m in Cvalue.V.M.fold add m Cvalue.V.bottom let import_v (v : Cvalue.V.t) = match v with | Cvalue.V.Top (sl, o) -> Value_parameters.warning ~once:true "importing garbled mix, locations may have changed"; (*let o' = import_origin o in*) let s = import_base_setlattice sl ~importing_value:true in Cvalue.V.inject_top_origin o s | Cvalue.V.Map m -> import_map m let import_v_or_uninit (vu : Cvalue.V_Or_Uninitialized.t) = let find v = try let res = V.Hashtbl.find v_cache v in res with Not_found -> let v' = import_v v in V.Hashtbl.replace v_cache v v'; v' in try V_Or_Uninitialized.map find vu with Possibly_escaping_value -> (* replace variable with ESCAPINGADDR *) Cvalue.V_Or_Uninitialized.C_init_esc V.bottom let import_offsetmap (offsetmap : V_Offsetmap.t) = V_Offsetmap.map_on_values import_v_or_uninit offsetmap let import_model (state : Model.t) = match state with | Model.Bottom -> Model.bottom | Model.Top -> Model.top | Model.Map map -> let add base offsetmap map = let new_offsetmap = import_offsetmap offsetmap in let new_base = import_base base ~importing_value:false in Model.add_base new_base new_offsetmap map in Model.fold add map Model.empty_map (*and import_origin (o : Origin.t) = (* the "new" origin location is arbitrary, since no guarantees about the actual location can be given *) let loc = Origin.LocationSetLattice.currentloc_singleton () in match o with | Origin.Misalign_read _ -> Origin.Misalign_read loc | Origin.Leaf _ -> Origin.Leaf loc | Origin.Merge _ -> Origin.Merge loc | Origin.Arith _ -> Origin.Arith loc | Origin.Well | Origin.Unknown -> o*) let load_globals_from_file filename : Model.t = let ic = open_in_bin filename in let (state : Model.t) = Marshal.from_channel ic in close_in ic; Value_parameters.feedback ~dkey "DE-MARSHALLED STATE (before import):@.%a" Cvalue.Model.pretty state; import_model state let save_globals_to_file kf state_with_locals filename = Value_parameters.feedback "Saving globals state after call to function: %a" Kernel_function.pretty kf; let state = Model.filter_base Base.is_global state_with_locals in Value_parameters.feedback ~dkey "SAVED STATE:@.%a" Model.pretty state; let oc = open_out_bin filename in Marshal.to_channel oc state []; close_out oc let load_and_merge_function_state state : Model.t = let (kf, filename) = Value_parameters.get_LoadFunctionState () in Value_parameters.feedback "@[<hov 0>Skipping call to %a,@ loading globals state from file:@ %s@]" Kernel_function.pretty kf filename; let saved_state = load_globals_from_file filename in Value_parameters.debug ~dkey "LOADED STATE:@.%a" Cvalue.Model.pretty saved_state; (* warn about missing globals in the new AST, and add new globals that were not present before *) let saved_map = match saved_state with | Model.Map m -> m | _ -> assert false in let locals = Model.filter_base (fun base -> not (Base.is_global base)) state in let state_without_locals = Model.filter_base (fun base -> Base.is_global base) state in Value_parameters.debug ~dkey "Merging state with locals: %a@." Model.pretty locals; let new_globals = Model.filter_base (fun base -> try let _ = Model.find_base base saved_state in false (* previously existing global *) with | Not_found -> Value_parameters.warning "found new global variable `%a'" Base.pretty base; true (* new global *) ) state_without_locals in let merged_globals_state = Model.fold (fun new_base offsm acc -> Model.add_base new_base offsm acc ) saved_map new_globals in let map_with_globals = match merged_globals_state with | Model.Map m -> m | _ -> Value_parameters.fatal "invalid saved state: %a" Model.pretty saved_state in let merged_globals_and_locals = Model.fold (fun new_base offsm acc -> Model.add_base new_base offsm acc ) map_with_globals locals in merged_globals_and_locals let save_globals_state () : unit = let (kf, filename) = Value_parameters.get_SaveFunctionState () in let ret_stmt = Kernel_function.find_return kf in try let ret_state = Db.Value.get_stmt_state ret_stmt in match ret_state with | Model.Top -> Value_parameters.abort "cannot save state at return statement of %a \ (too imprecise)" Kernel_function.pretty kf | Model.Bottom -> Value_parameters.abort "cannot save state at return statement of %a \ (bottom)" Kernel_function.pretty kf | Model.Map _ -> save_globals_to_file kf ret_state filename with Not_found -> if Value_parameters.LoadFunctionState.is_set () then let (load_kf, _) = Value_parameters.get_LoadFunctionState () in Value_parameters.abort "could not find saved state for function `%a';@ \ this can happen if it is called from `%a'" Kernel_function.pretty kf Kernel_function.pretty load_kf; else Value_parameters.failure "could not find saved state for function `%a'" Kernel_function.pretty kf exception Warn_local_addresses (* visitor used by frama_c_load_state *) class locals_visitor = object(_self) inherit Visitor.frama_c_inplace method! vlval (lhost, _) = match lhost with | Var vi -> if not vi.vglob then raise Warn_local_addresses; Cil.DoChildren | Mem _ -> Cil.DoChildren end (* Builtin to load a saved analysis state *) let frama_c_load_state state actuals = (* Warn if arguments contain pointers to local variables, in which case the loaded state may be unsound. *) begin try List.iter (fun (exp_arg, arg, _) -> let vis = new locals_visitor in if Cil.isPointerType (Cil.typeOf exp_arg) then ignore (Visitor.visitFramacExpr vis exp_arg); if Cvalue.V.contains_addresses_of_any_locals arg then raise Warn_local_addresses ) actuals; with Warn_local_addresses -> Value_parameters.warning ~current:true ~once:true "arguments to loaded function state contain local addresses,@ \ possible unsoundness"; end; let merged_loaded_state = load_and_merge_function_state state in { Value_types.c_values = [None, merged_loaded_state]; c_clobbered = Base.SetLattice.empty; c_cacheable = Value_types.NoCacheCallers; c_from = None } let () = Builtins.register_builtin "Frama_C_load_state" frama_c_load_state ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/state_import.mli���������������������������������������0000666�0000000�0000000�00000005337�13571573400�021164� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Saving/loading of Value states, possibly among different ASTs. Used by the command-line options defined by [Value_parameters.SaveFunctionState] and [Value_parameters.LoadFunctionState]. @since Aluminium-20160501 *) (** Loads the saved initial global state, and merges it with the given state (locals plus new globals which were not present in the original AST). The saved state may come from a different project. Note that, to ensure soundness of the merge, some constraints must be respected according to where the merge takes place. The intended use is to replace costly function calls, in which case the state of local variables should not be modified by the function. *) val load_and_merge_function_state: Cvalue.Model.t -> Cvalue.Model.t (** Saves the final state of globals variables after the return statement of the function defined via [Value_parameters.SaveFunctionState]. The result is saved in the file defined by the same option. The function must have been called exactly once during the value analysis, otherwise the saved state is unspecified. *) val save_globals_state: unit -> unit �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/structure.ml�������������������������������������������0000666�0000000�0000000�00000014161�13571573400�020334� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type (_,_) eq = Eq : ('a,'a) eq module type Key = sig type 'a key val create_key: string -> 'a key val eq_type : 'a key -> 'b key -> ('a, 'b) eq option val print: 'a key Pretty_utils.formatter val compare: 'a key -> 'b key -> int val equal: 'a key -> 'b key -> bool val hash : 'a key -> int val tag: 'a key -> int end module Make (X : sig end) = struct type 'a key = { tag: int; name: string } let c = ref (-1) let id () = incr c; !c let create_key name = { tag = id (); name } let equal x y = x.tag = y.tag let eq_type : type a b. a key -> b key -> (a,b) eq option = fun a b -> if equal a b then Some ((Obj.magic (Eq : (a,a) eq)) : (a,b) eq) else None let compare x y = Transitioning.Stdlib.compare x.tag y.tag let hash x = x.tag let tag x = x.tag let print fmt x = Format.pp_print_string fmt x.name end module Key_Value = Make (struct end) module Key_Location = Make (struct end) module Key_Domain = Make (struct end) module type Shape = sig include Key type 'a data type 'a structure = | Unit : unit structure | Leaf : 'a key * 'a data -> 'a structure | Node : 'a structure * 'b structure -> ('a * 'b) structure val eq_structure: 'a structure -> 'b structure -> ('a, 'b) eq option end module Shape (Key: Key) (Data: sig type 'a t end) = struct include Key type 'a data = 'a Data.t type 'a structure = | Unit : unit structure | Leaf : 'a key * 'a data -> 'a structure | Node : 'a structure * 'b structure -> ('a * 'b) structure let rec eq_structure : type a b. a structure -> b structure -> (a, b) eq option = fun a b -> match a, b with | Leaf (key1, _), Leaf (key2, _) -> Key.eq_type key1 key2 | Node (l1, r1), Node (l2, r2) -> begin match eq_structure l1 l2, eq_structure r1 r2 with | Some Eq, Some Eq -> Some Eq | _, _ -> None end | Unit, Unit -> Some Eq | _, _ -> None end module type Internal = sig type t type 'a structure val structure : t structure end module type External = sig type t type 'a key val mem : 'a key -> bool val get : 'a key -> (t -> 'a) option val set : 'a key -> 'a -> t -> t end module Open (Shape : Shape) (M : sig type t val structure : t Shape.structure end) = struct module KMap = struct include Map.Make (Datatype.Int) let singleton key data = singleton (Shape.tag key) data let find k map = try Some (find (Shape.tag k) map) with Not_found -> None end open Shape let rec mem : type a. 'v Shape.key -> a structure -> bool = fun key -> function | Unit -> false | Leaf (k, _) -> Shape.equal key k | Node (left, right) -> mem key left || mem key right let mem key = mem key M.structure type ('a, 'b) get = 'b Shape.key * ('a -> 'b) type 'a getter = Get : ('a, 'b) get -> 'a getter let merge _k a b = match a, b with | Some _, _ -> a | _, Some _ -> b | None, None -> assert false let lift_get f (Get (key, get)) = Get (key, fun t -> get (f t)) let rec compute_getters : type a. a structure -> (a getter) KMap.t = function | Unit -> KMap.empty | Leaf (key, _) -> KMap.singleton key (Get (key, fun (t : a) -> t)) | Node (left, right) -> let l = compute_getters left and r = compute_getters right in let l = KMap.map (lift_get fst) l and r = KMap.map (lift_get snd) r in KMap.merge merge l r let getters = compute_getters M.structure let get (type a) (key: a Shape.key) : (M.t -> a) option = match KMap.find key getters with | None -> None | Some (Get (k, get)) -> match Shape.eq_type key k with | None -> None | Some Eq -> Some get type ('a, 'b) set = 'b Shape.key * ('b -> 'a -> 'a) type 'a setter = Set : ('a, 'b) set -> 'a setter let lift_set f (Set (key, set)) = Set (key, fun v b -> f (fun a -> set v a) b) let rec compute_setters : type a. a structure -> (a setter) KMap.t = function | Unit -> KMap.empty | Leaf (key, _) -> KMap.singleton key (Set (key, fun v _t -> v)) | Node (left, right) -> let l = compute_setters left and r = compute_setters right in let l = KMap.map (lift_set (fun set (l, r) -> set l, r)) l and r = KMap.map (lift_set (fun set (l, r) -> l, set r)) r in KMap.merge merge l r let setters = compute_setters M.structure let set (type a) (key: a Shape.key) : (a -> M.t -> M.t) = match KMap.find key setters with | None -> fun _ t -> t | Some (Set (k, set)) -> match Shape.eq_type key k with | None -> fun _ t -> t | Some Eq -> set end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/structure.mli������������������������������������������0000666�0000000�0000000�00000007742�13571573400�020514� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Gadt describing the structure of a tree of different data types, and providing fast accessors of its nodes. The leafs must provide a key from a Key module, see key.mli for details. *) (** Equality witness between types. *) type (_,_) eq = Eq : ('a,'a) eq (** Keys identifying datatypes. *) module type Key = sig type 'a key val create_key: string -> 'a key val eq_type : 'a key -> 'b key -> ('a, 'b) eq option val print: 'a key Pretty_utils.formatter val compare: 'a key -> 'b key -> int val equal: 'a key -> 'b key -> bool val hash : 'a key -> int val tag: 'a key -> int end module Make (X : sig end) : Key (** Keys module for the abstract values of Eva. *) module Key_Value : Key (** Keys module for the abstract locations of Eva. *) module Key_Location : Key (** Keys module for the abstract domains of Eva. *) module Key_Domain : Key (** A Key module with its structure type. *) module type Shape = sig include Key type 'a data (** The gadt, based on keys giving the type of each node. Describes the internal structure of a data type. Used internally to automatically generate efficient accessors of its nodes. *) type 'a structure = | Unit : unit structure | Leaf : 'a key * 'a data -> 'a structure | Node : 'a structure * 'b structure -> ('a * 'b) structure val eq_structure: 'a structure -> 'b structure -> ('a, 'b) eq option end module Shape (Key: Key) (Data: sig type 'a t end) : Shape with type 'a key = 'a Key.key and type 'a data = 'a Data.t (** Internal view of the tree, with the structure. *) module type Internal = sig type t type 'a structure val structure : t structure end (** External view of the tree, with accessors. Automatically built by the functor {!Open} from an {!Internal} datatype. When a generic datatype is a combination of several other datatypes, these functions allow interacting with its subparts. Note that their behavior is undefined if the overall datatype contains several times the same datatype. *) module type External = sig type t type 'a key val mem : 'a key -> bool val get : 'a key -> (t -> 'a) option val set : 'a key -> 'a -> t -> t end (** Opens an internal tree module into an external one. *) module Open (Shape : Shape) (Data : Internal with type 'a structure := 'a Shape.structure) : External with type t := Data.t and type 'a key := 'a Shape.key ������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/value_perf.ml������������������������������������������0000666�0000000�0000000�00000040756�13571573400�020435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (****************************************************************) (* Configuration *) (* Period between two consecutive displays, in seconds. *) let display_interval = 60.0;; (* Do not show functions that execute for less than that percent of the total running time. The value is 1/60, i.e. does not display functions that execute for longer than 3s after it has run for 3 minutes. *) let does_not_account_smaller_than = 1.667 (* OCaml time is not always increasing, so we use max to fix this. *) let duration a b = max (b -. a) 0.0 (****************************************************************) (* The metrics being computed and displayed. *) (* Performance information regarding a called function. *) module Call_info = struct type t = { (* How many times the function was called. *) mutable nb_calls: int; (* How many times the call had to be computed (i.e. with calls cached with memexec removed) *) mutable nb_effective_calls: int; (* The accumulated execution time for past calls. *) mutable total_duration: float; (* If we are executing the function, since when. It is a list because of the recursive calls. *) mutable since: float list; } ;; let create() = { nb_calls = 0; nb_effective_calls = 0; total_duration = 0.0; since = [] };; (* Represents the calls to the main function. *) let main = create();; (* Also accounts for currently executing time. *) let total_duration current_time call_info = let additional_time = match call_info.since with | [] -> 0.0 | since::_ -> duration since current_time in assert (additional_time >= 0.0); additional_time +. call_info.total_duration ;; let print fmt kf call_info current_time = let bullet = match call_info.since with | [] -> "+" | _::_ -> "*" in Format.fprintf fmt "%s %a: executed: %dx total: %.3fs\n" bullet Kernel_function.pretty kf call_info.nb_calls (total_duration current_time call_info) ;; (* Sorts call_infos by decreasing execution time. *) let cmp current_time ci1 ci2 = - (Transitioning.Stdlib.compare (total_duration current_time ci1) (total_duration current_time ci2)) ;; (* From an iteration, filter and sort by call_info, and returns the sorted list. *) let filter_and_sort iter get_ci _parent_duration current_time = let analysis_total_time = total_duration current_time main in let threshold = analysis_total_time *. (does_not_account_smaller_than /. 100.0) in let list = ref [] in iter (fun elt -> let ci = get_ci elt in if total_duration current_time ci > threshold then list := elt::!list); let sorted_list = List.fast_sort (fun elt1 elt2 -> (cmp current_time) (get_ci elt1) (get_ci elt2)) !list in sorted_list ;; (* before/after pair. *) let before_call t since = t.since <- since::t.since ;; let after_call t to_ = let since = List.hd t.since in let duration = duration since to_ in assert (duration >= 0.0); t.total_duration <- t.total_duration +. duration; t.nb_calls <- t.nb_calls + 1; t.since <- List.tl t.since ;; end (****************************************************************) (* Flat and DAG views of performance. *) (* Note: since need to be stored only in the flat view. *) type flat_perf_info = { (* The grand total performance information for the function. *) call_info: Call_info.t; (* For DAG-view: the per-caller performance information. *) called_functions: Call_info.t Kernel_function.Hashtbl.t; } ;; let flat_perf_create() = { call_info = Call_info.create(); called_functions = Kernel_function.Hashtbl.create 17; };; let flat = Kernel_function.Hashtbl.create 17;; let flat_print current_time fmt = Format.fprintf fmt "Long running functions (does not include current running time):\n"; Format.fprintf fmt "===============================================================\n"; let each_flat_entry (kf, pi) = Call_info.print fmt kf pi.call_info current_time; Format.fprintf fmt " "; let caller_duration = Call_info.total_duration current_time pi.call_info in let total_sub = ref 0.0 in let total_others = ref 0.0 in let nb_others = ref 0 in let each_called_entry kf ci = let callee_duration = Call_info.total_duration current_time ci in total_sub := !total_sub +. callee_duration; let percentage = (100.0 *. (callee_duration /. caller_duration)) in if percentage > 5.0 then Format.fprintf fmt "| %a %dx %.3fs (%.1f%%) " Kernel_function.pretty kf ci.Call_info.nb_calls callee_duration percentage else (total_others := !total_others +. callee_duration; incr nb_others) in Kernel_function.Hashtbl.iter_sorted_by_value ~cmp:(Call_info.cmp current_time) each_called_entry pi.called_functions; (if !nb_others > 0 then Format.fprintf fmt "| %d others: %.3fs (%.1f%%) " !nb_others !total_others (100.0 *. !total_others /. caller_duration)); let self_duration = duration !total_sub caller_duration in Format.fprintf fmt "| self: %.3fs (%.1f%%)|\n" self_duration (100.0 *. (self_duration /. caller_duration)) in let flat_entries = Call_info.filter_and_sort (fun f -> Kernel_function.Hashtbl.iter (fun k v -> f(k,v)) flat) (fun (_,v) -> v.call_info) (Call_info.total_duration current_time Call_info.main) current_time in List.iter each_flat_entry flat_entries ;; (****************************************************************) (* Per-callstack performance. *) module Call_site = Datatype.Pair(Kernel_function)(Cil_datatype.Kinstr) module Imperative_callstack_trie(M:sig type t val default:unit -> t end) = struct module Hashtbl = Hashtbl.Make(Call_site) type elt = { mutable self: M.t ; subtree: t } and t = elt Hashtbl.t ;; let empty() = Hashtbl.create 7;; let reset t = Hashtbl.clear t;; let create_node init = { self = init; subtree = empty() } let rec find_subtree t callstack res = match callstack with | [] -> (match res with | None -> failwith "Called findsubtree with an empty callstack" | Some x -> x) | a::b -> let subnode = try Hashtbl.find t a with Not_found -> let n = create_node (M.default()) in Hashtbl.add t a n; n in find_subtree subnode.subtree b (Some subnode) let find_subtree t callstack = find_subtree t (List.rev callstack) None let find t callstack = (find_subtree t callstack).self let _add t callstack smth = let node = find_subtree t callstack in node.self <- smth ;; let _update t callstack f = let node = find_subtree t callstack in node.self <- f node.self ;; end type perf_info = { call_info_per_stack: Call_info.t; } module Perf_by_callstack = Imperative_callstack_trie(struct type t = perf_info let default() = { call_info_per_stack = Call_info.create() } end) (* Head of the tree. Only the subtree field il really used. *) let perf = Perf_by_callstack.empty();; let last_time_displayed = ref 0.0;; let print_indentation fmt n = for _i = 0 to n-1 do Format.fprintf fmt "| " done; ;; let rec display_node fmt kf indentation node curtime = print_indentation fmt indentation; Call_info.print fmt kf node.Perf_by_callstack.self.call_info_per_stack curtime; display_subtree fmt (indentation+1) node.Perf_by_callstack.subtree (Call_info.total_duration curtime node.Perf_by_callstack.self.call_info_per_stack) curtime and display_subtree fmt indentation subtree parent_duration curtime = let entries = Call_info.filter_and_sort (fun f -> Perf_by_callstack.Hashtbl.iter (fun k v -> f(k,v)) subtree) (fun (_,node) -> node.Perf_by_callstack.self.call_info_per_stack) parent_duration curtime in List.iter (fun ((kf,_),node) -> display_node fmt kf indentation node curtime) entries; ;; let display fmt = if Value_parameters.ValShowPerf.get() then begin Format.fprintf fmt "####### Value execution feedback #########\n"; let current_time = (Sys.time()) in flat_print current_time fmt; Format.fprintf fmt "\n"; Format.fprintf fmt "Execution time per callstack (includes current running time):\n"; Format.fprintf fmt "=============================================================\n"; display_subtree fmt 0 perf (Call_info.total_duration current_time Call_info.main) current_time; Format.fprintf fmt "################\n" end ;; let caller_callee_callinfo = function | (callee_kf,_)::(caller_kf,_)::_ -> (let caller_flat = Kernel_function.Hashtbl.find flat caller_kf in try Kernel_function.Hashtbl.find caller_flat.called_functions callee_kf with Not_found -> let call_info = Call_info.create() in Kernel_function.Hashtbl.add caller_flat.called_functions callee_kf call_info; call_info) | [_] -> Call_info.main | [] -> assert false ;; let start_doing_perf callstack = if Value_parameters.ValShowPerf.get() then begin let time = Sys.time() in assert (callstack != []); let kf = fst (List.hd callstack) in let flat_info = try Kernel_function.Hashtbl.find flat kf with Not_found -> let flatp = flat_perf_create() in Kernel_function.Hashtbl.add flat kf flatp; flatp in Call_info.before_call flat_info.call_info time; Call_info.before_call (caller_callee_callinfo callstack) time; let node = Perf_by_callstack.find perf callstack in Call_info.before_call node.call_info_per_stack time; if (duration !last_time_displayed time) > display_interval then (last_time_displayed := time; Kernel.feedback "%t" display) end ;; let stop_doing_perf callstack = if Value_parameters.ValShowPerf.get() then begin let time = Sys.time() in let kf = fst (List.hd callstack) in let flat_info = Kernel_function.Hashtbl.find flat kf in Call_info.after_call flat_info.call_info time; let node = Perf_by_callstack.find perf callstack in Call_info.after_call node.call_info_per_stack time; Call_info.after_call (caller_callee_callinfo callstack) time; end ;; let reset_perf () = let reset_callinfo ci = ci.Call_info.nb_calls <- 0; ci.Call_info.nb_effective_calls <- 0; ci.Call_info.total_duration <- 0.0; ci.Call_info.since <- [] in reset_callinfo Call_info.main; Kernel_function.Hashtbl.clear flat; last_time_displayed := 0.0; Perf_by_callstack.reset perf ;; (* -------------------------------------------------------------------------- *) (* --- Flamegraphs --- *) (* -------------------------------------------------------------------------- *) (* Set to [Some _] if option [-val-dump-flamegraph] is set and [main] is currently being analyzed and the file is ok. Otherwise, set to [None]. *) let oc_flamegraph = ref None let stack_flamegraph = ref [] (* Callstack for flamegraphs. The most recent function is at the top of the list. The elements of the list are [(starting_time, self_total_time)]. [starting_time] is the time when we started analyzing the function. [total_time] is the time spent so far in the function itself, _without the callees_. [total_time] is updated from [starting_time] when we start a callee, or when the analysis of the function ends. This stack is never empty when an analysis is in progress. *) (* pretty-prints the functions in a Value callstack, starting by main (i.e. in reverse order). *) let pretty_callstack oc l = let rec aux oc = function | [] -> () (* does not happen in theory *) | [main, _] -> Printf.fprintf oc "%s" (Kernel_function.get_name main) | (f, _) :: q -> Printf.fprintf oc "%a;%s" aux q (Kernel_function.get_name f) in aux oc l (* update the [self_total_time] information for the function being analyzed, assuming that the current time is [time] *) let update_self_total_time time = match !stack_flamegraph with | [] -> assert false | (start_caller, total) :: q -> let d = duration start_caller time in stack_flamegraph := (start_caller, d +. total) :: q (* called when a new function is being analyzed *) let start_doing_flamegraph callstack = match callstack with | [] -> assert false | [_] -> (* Analysis of main *) let file = Value_parameters.ValPerfFlamegraphs.get () in if file <> "" then begin try (* Flamegraphs must be computed. Set up the stack and the output file *) let oc = open_out file in oc_flamegraph := Some oc; stack_flamegraph := [ (Sys.time (), 0.) ] with e -> Value_parameters.error "cannot open flamegraph file: %s" (Printexc.to_string e); oc_flamegraph := None (* to be on the safe side *) end | _ :: _ :: _ -> if !oc_flamegraph <> None then (* Flamegraphs are being computed. Update time spent in current function so far, then push a slot for the analysis of the new function *) let time = Sys.time () in update_self_total_time time; stack_flamegraph := (time, 0.) :: !stack_flamegraph; ;; (* called when the analysis of a function ends. This function is at the top of [callstack] *) let stop_doing_flamegraph callstack = match !oc_flamegraph with | None -> () | Some oc -> (* Flamegraphs are being recorded *) let time = Sys.time() in update_self_total_time time; (* update current function *) match !stack_flamegraph with | [] -> assert false | (_, total) :: q -> (* dump the total time (that we just updated) for the current function *) Printf.fprintf oc "%a %.3f\n%!" pretty_callstack callstack (total *. 1000.); match q with | [] -> stack_flamegraph := [] (* we are back to the main function *) | (_, total_caller) :: q' -> (* drop the current function from the flamegraph stack AND update the 'current time' information, so that the time spent in the callee is not counted. *) stack_flamegraph := (time, total_caller) :: q' ;; let reset_flamegraph () = match !oc_flamegraph with | None -> () | Some fd -> close_out fd; stack_flamegraph := [] (* -------------------------------------------------------------------------- *) (* --- Exported interface --- *) (* -------------------------------------------------------------------------- *) let start_doing callgraph = start_doing_perf callgraph; start_doing_flamegraph callgraph; ;; let stop_doing callgraph = stop_doing_perf callgraph; stop_doing_flamegraph callgraph; ;; let reset () = reset_perf (); reset_flamegraph (); ;; (* TODO: Output files with more graphical outputs, such as Gprof2dot-like output: (directory output the dot) http://code.google.com/p/jrfonseca/wiki/Gprof2Dot The latter would be useful to see when imbricated loops multiply the number of calls to leaf functions. TODO: Also account for the memexec hit rate; and for the individual execution time of derived plugins. *) ������������������frama-c-20.0-Calcium/src/plugins/value/utils/value_perf.mli�����������������������������������������0000666�0000000�0000000�00000004256�13571573400�020601� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Call [start_doing] when starting analyzing a new function. The new function is on the top of the call stack.*) val start_doing: Value_types.callstack -> unit (** Call [start_doing] when finishing analyzing a function. The function must still be on the top of the call stack. *) val stop_doing: Value_types.callstack -> unit (** Display a complete summary of performance informations. Can be called during the analysis. *) val display: Format.formatter -> unit (** Reset the internal state of the module; to call at the very beginning of the analysis. *) val reset: unit -> unit ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/value_results.ml���������������������������������������0000666�0000000�0000000�00000050774�13571573400�021203� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_datatype (* {2 Is called} *) module Is_Called = Kernel_function.Make_Table (Datatype.Bool) (struct let name = "Value.Value_results.is_called" let dependencies = [ Db.Value.self ] let size = 17 end) let is_called = Is_Called.memo (fun kf -> try Db.Value.is_reachable_stmt (Kernel_function.find_first_stmt kf) with Kernel_function.No_Statement -> false) let mark_kf_as_called kf = Is_Called.replace kf true (* {2 Callers} *) module Callers = Kernel_function.Make_Table (Kernel_function.Map.Make(Stmt.Set)) (struct let name = "Value.Value_results.Callers" let dependencies = [ Db.Value.self ] let size = 17 end) let add_kf_caller ~caller:(caller_kf, call_site) kf = let add m = Kernel_function.Map.add caller_kf (Stmt.Set.singleton call_site) m in let change m = try let call_sites = Kernel_function.Map.find caller_kf m in Kernel_function.Map.add caller_kf (Stmt.Set.add call_site call_sites) m with Not_found -> add m in ignore (Callers.memo ~change (fun _kf -> add Kernel_function.Map.empty) kf) let callers kf = try let m = Callers.find kf in Kernel_function.Map.fold (fun key v acc -> (key, Stmt.Set.elements v) :: acc) m [] with Not_found -> [] (* {2 Termination.} *) let partition_terminating_instr stmt = let ho = try Some (Db.Value.AfterTable_By_Callstack.find stmt) with Not_found -> None in match ho with | None -> ([], []) | Some h -> let terminating = ref [] in let non_terminating = ref [] in let add x xs = xs := x :: !xs in Value_types.Callstack.Hashtbl.iter (fun cs state -> if Db.Value.is_reachable state then add cs terminating else add cs non_terminating) h; (!terminating, !non_terminating) let is_non_terminating_instr stmt = match partition_terminating_instr stmt with | [], _ -> true | _, _ -> false (* {2 Registration.} *) let () = Db.Value.is_called := is_called; Db.Value.callers := callers; ;; (* {2 Saving and restoring state} *) type stmt_by_callstack = Cvalue.Model.t Value_types.Callstack.Hashtbl.t module AlarmsStmt = Datatype.Pair_with_collections (Alarms) (Stmt) (struct let module_name = "Value.Value_results.AlarmStmt" end) type results = { main: Kernel_function.t option (** None means multiple functions *); before_states: stmt_by_callstack Stmt.Hashtbl.t; after_states: stmt_by_callstack Stmt.Hashtbl.t; kf_initial_states: stmt_by_callstack Kernel_function.Hashtbl.t; kf_is_called: bool Kernel_function.Hashtbl.t; kf_callers: Stmt.Set.t Kernel_function.Map.t Kernel_function.Hashtbl.t; initial_state: Cvalue.Model.t; initial_args: Cvalue.V.t list option; alarms: Property_status.emitted_status AlarmsStmt.Hashtbl.t; statuses: Property_status.emitted_status Property.Hashtbl.t (** alarms are _not_ present here *); (* conditions then/else *) } let get_results () = let vue = Emitter.get Value_util.emitter in let main = Some (fst (Globals.entry_point ())) in let module CS = Value_types.Callstack in let copy_states iter = let h = Stmt.Hashtbl.create 128 in let copy stmt hstack = Stmt.Hashtbl.add h stmt (CS.Hashtbl.copy hstack) in iter copy; h in let before_states = copy_states Db.Value.Table_By_Callstack.iter in let after_states = copy_states Db.Value.AfterTable_By_Callstack.iter in let kf_initial_states = let h = Kernel_function.Hashtbl.create 128 in let copy kf = match Db.Value.get_initial_state_callstack kf with | None -> () | Some hstack -> Kernel_function.Hashtbl.add h kf (CS.Hashtbl.copy hstack) in Globals.Functions.iter copy; h in let kf_is_called = let h = Kernel_function.Hashtbl.create 128 in Is_Called.iter (Kernel_function.Hashtbl.add h); h in let kf_callers = let h = Kernel_function.Hashtbl.create 128 in Callers.iter (Kernel_function.Hashtbl.add h); h in let initial_state = Db.Value.globals_state () in let initial_args = Db.Value.fun_get_args () in let aux_statuses f_status ip = let aux_any_status e status = if Emitter.Usable_emitter.equal vue e.Property_status.emitter then f_status status in Property_status.iter_on_statuses aux_any_status ip in let alarms = AlarmsStmt.Hashtbl.create 128 in let aux_alarms _emitter kf stmt ~rank:_ alarm ca = let ip = Property.ip_of_code_annot_single kf stmt ca in let f_status st = AlarmsStmt.Hashtbl.add alarms (alarm, stmt) st in aux_statuses f_status ip in Alarms.iter aux_alarms; let statuses = Property.Hashtbl.create 128 in let aux_ip (ip: Property.t) = let add () = aux_statuses (fun st -> Property.Hashtbl.add statuses ip st) ip in match ip with | Property.IPCodeAnnot {Property.ica_ca} -> begin match Alarms.find ica_ca with | None -> (* real property *) add () | Some _ -> (* alarm; do not save it here *) () end | Property.IPReachable _ -> () (* TODO: save them properly, and restore them *) | _ -> add () in Property_status.iter aux_ip; { before_states; after_states; kf_initial_states; kf_is_called; kf_callers; initial_state; initial_args; alarms; statuses; main } let set_results results = let selection = State_selection.with_dependencies Db.Value.self in Project.clear ~selection (); (* Those two functions may clear Db.Value.self. Start by them *) (* Initial state *) Db.Value.globals_set_initial_state results.initial_state; (* Initial args *) begin match results.initial_args with | None -> Db.Value.fun_use_default_args () | Some l -> Db.Value.fun_set_args l end; (* Pre- and post-states *) let aux_states ~after stmt (h:stmt_by_callstack) = let aux_callstack callstack state = Db.Value.update_callstack_table ~after stmt callstack state; in Value_types.Callstack.Hashtbl.iter aux_callstack h in Stmt.Hashtbl.iter (aux_states ~after:false) results.before_states; Stmt.Hashtbl.iter (aux_states ~after:true) results.after_states; (* Kf initial state *) let aux_initial_state _kf h = let aux_callstack callstack state = Db.Value.merge_initial_state callstack state in Value_types.Callstack.Hashtbl.iter aux_callstack h in Kernel_function.Hashtbl.iter aux_initial_state results.kf_initial_states; (* Kf is_called *) Kernel_function.Hashtbl.iter Is_Called.replace results.kf_is_called; (* Kf callers *) let aux_callers callee m = let aux_caller caller stmts = let aux_stmt callsite = add_kf_caller ~caller:(caller, callsite) callee in Stmt.Set.iter aux_stmt stmts in Kernel_function.Map.iter aux_caller m in Kernel_function.Hashtbl.iter aux_callers results.kf_callers; (* Alarms *) let aux_alarms (alarm, stmt) st = let ki = Cil_types.Kstmt stmt in ignore (Alarms.register Value_util.emitter ki ~status:st alarm) in AlarmsStmt.Hashtbl.iter aux_alarms results.alarms; (* Statuses *) let aux_statuses ip st = Property_status.emit Value_util.emitter ~hyps:[] ip st in Property.Hashtbl.iter aux_statuses results.statuses; Db.Value.mark_as_computed (); ;; module HExt (H: Hashtbl.S) = struct let map ?(fkey=fun k _v -> k) ?(fvalue = fun _k v -> v) h = let h' = H.create (H.length h) in let aux cs v = H.add h' (fkey cs v) (fvalue cs v) in H.iter aux h; h' let merge merge h1 h2 = let h = H.create (H.length h1 + H.length h2) in let aux1 key v = let v' = try merge key v (H.find h2 key) with Not_found -> v in H.add h key v' in let aux2 key v = if not (H.mem h1 key) then H.add h key v in H.iter aux1 h1; H.iter aux2 h2; h include H end module CallstackH = HExt(Value_types.Callstack.Hashtbl) module StmtH = HExt(Stmt.Hashtbl) module KfH = HExt(Kernel_function.Hashtbl) module PropertyH = HExt(Property.Hashtbl) module AlarmsStmtH = HExt(AlarmsStmt.Hashtbl) let change_callstacks f results = let change_callstack h = let fkey cs _ = f cs in CallstackH.map ~fkey h in let fvalue _key hcs = change_callstack hcs in let change_states h = StmtH.map ~fvalue h in let change_kf h = KfH.map ~fvalue h in { results with before_states = change_states results.before_states; after_states = change_states results.after_states; kf_initial_states = change_kf results.kf_initial_states } let merge r1 r2 = let merge_cs _ = CallstackH.merge (fun _ -> Cvalue.Model.join) in (* Keep the "most informative" status. This is not what we do usually, because here False + Unknown = False, instead of Unknown *) let merge_statuses _ s1 s2 = let open Property_status in match s1, s2 with | False_and_reachable, _ | _, False_and_reachable -> False_and_reachable | False_if_reachable, _ | _, False_if_reachable -> False_if_reachable | Dont_know, _ | _, Dont_know -> Dont_know | True, True -> True in let merge_callers _ m1 m2 = let aux _kf s1 s2 = match s1, s2 with | None, None -> None | None, s | s, None -> s | Some s1, Some s2 -> Some (Stmt.Set.union s1 s2) in Kernel_function.Map.merge aux m1 m2 in let merge_s_cs = StmtH.merge merge_cs in let main = match r1.main, r2.main with | None, _ | _, None -> None | Some kf1, Some kf2 -> if Kernel_function.equal kf1 kf2 then Some kf1 else None in let before_states = merge_s_cs r1.before_states r2.before_states in let after_states = merge_s_cs r1.after_states r2.after_states in let kf_initial_states = KfH.merge merge_cs r1.kf_initial_states r2.kf_initial_states in let kf_is_called = KfH.merge (fun _ -> (||)) r1.kf_is_called r2.kf_is_called in let kf_callers = KfH.merge merge_callers r1.kf_callers r2.kf_callers in let alarms = AlarmsStmtH.merge merge_statuses r1.alarms r2.alarms in let statuses = PropertyH.merge merge_statuses r1.statuses r2.statuses in let initial_state = Cvalue.Model.join r1.initial_state r2.initial_state in let initial_args = match main, r1.initial_args, r2.initial_args with | None, _, _ | _, None, _ | _, _, None -> None | Some _kf, Some args1, Some args2 -> (* same number of arguments : arity of [_kf] *) try Some (List.map2 Cvalue.V.join args1 args2) with Invalid_argument _ -> None (* should not occur *) in { main; before_states; after_states; kf_initial_states; kf_is_called; initial_state; initial_args; alarms; statuses; kf_callers } (* ---------------------- Printing an analysis summary ---------------------- *) open Cil_types let plural count = if count = 1 then "" else "s" let consider_function vi = not (Cil.is_builtin vi || Cil.is_special_builtin vi.vname || Cil.hasAttribute "fc_stdlib" vi.vattr || Cil.hasAttribute "fc_stdlib_generated" vi.vattr) let print_coverage fmt = let dead_function, reachable_function = ref 0, ref 0 and dead_stmt, reachable_stmt = ref 0, ref 0 in let do_stmt stmt = incr (if Db.Value.is_reachable_stmt stmt then reachable_stmt else dead_stmt) in let visit fundec = if consider_function fundec.svar then if is_called (Globals.Functions.get fundec.svar) then (incr reachable_function; List.iter do_stmt fundec.sallstmts) else incr dead_function in Globals.Functions.iter_on_fundecs visit; let total_function = !dead_function + !reachable_function in if total_function = 0 then Format.fprintf fmt "No function to be analyzed.@;" else Format.fprintf fmt "%i function%s analyzed (out of %i): %i%% coverage.@;" !reachable_function (plural !reachable_function) total_function (!reachable_function * 100 / total_function); let total_stmt = !dead_stmt + !reachable_stmt in if !reachable_function > 0 && total_stmt > 0 then Format.fprintf fmt "In %s, %i statements reached (out of %i): %i%% coverage.@;" (if !reachable_function > 1 then "these functions" else "this function") !reachable_stmt total_stmt (!reachable_stmt * 100 / total_stmt) let print_warning fmt = let eva_warnings, eva_errors = ref 0, ref 0 and kernel_warnings, kernel_errors = ref 0, ref 0 in let report_event event = let open Log in match event.evt_kind, event.evt_plugin with | Warning, "eva" when event.evt_category <> Some "alarm" -> incr eva_warnings | Warning, name when name = Log.kernel_label_name -> incr kernel_warnings | Error, "eva" when event.evt_category <> Some "alarm" -> incr eva_errors | Error, name when name = Log.kernel_label_name -> incr kernel_errors | _ -> () in Messages.iter report_event; let total = !eva_errors + !eva_warnings + !kernel_errors + !kernel_warnings in if total = 0 then Format.fprintf fmt "No errors or warnings raised during the analysis.@;" else let print str errors warnings = Format.fprintf fmt " by %-19s %3i error%s %3i warning%s@;" (str ^ ":") errors (plural errors) warnings (plural warnings) in Format.fprintf fmt "Some errors and warnings have been raised during the analysis:@;"; print "the Eva analyzer" !eva_errors !eva_warnings; print "the Frama-C kernel" !kernel_errors !kernel_warnings type alarms = { division_by_zero: int ref; memory_access: int ref; index_out_of_bound: int ref; overflow: int ref; invalid_shift: int ref; uninitialized: int ref; dangling: int ref; nan_or_infinite: int ref; float_to_int: int ref; others: int ref; } type statuses = { valid: int ref; unknown: int ref; invalid: int ref; } type report = { alarms: statuses * alarms; assertions: statuses; preconds: statuses; } let empty_report () = let empty () = { valid = ref 0; unknown = ref 0; invalid = ref 0 } in let empty_alarms = { division_by_zero = ref 0; memory_access = ref 0; index_out_of_bound = ref 0; overflow = ref 0; invalid_shift = ref 0; uninitialized = ref 0; dangling = ref 0; nan_or_infinite = ref 0; float_to_int = ref 0; others = ref 0; } in { alarms = empty (), empty_alarms; assertions = empty (); preconds = empty (); } let report_alarm report alarm = let open Alarms in let counter = match alarm with | Division_by_zero _ -> report.division_by_zero | Memory_access _ -> report.memory_access | Index_out_of_bound _ -> report.index_out_of_bound | Invalid_shift _ -> report.invalid_shift | Overflow _ -> report.overflow | Uninitialized _ -> report.uninitialized | Dangling _ -> report.dangling | Is_nan_or_infinite _ | Is_nan _ -> report.nan_or_infinite | Float_to_int _ -> report.float_to_int | _ -> report.others in incr counter let eva_emitter = Value_util.emitter let get_status ip = let aux_status emitter status acc = let emitter = Emitter.Usable_emitter.get emitter.Property_status.emitter in if Emitter.equal eva_emitter emitter then Some status else acc in Property_status.fold_on_statuses aux_status ip None let report_status acc = function | None -> () | Some status -> match status with | Property_status.Dont_know -> incr acc.unknown | Property_status.True -> incr acc.valid | Property_status.False_if_reachable | Property_status.False_and_reachable -> incr acc.invalid let make_report () = let report = empty_report () in let report_property ip = match ip with | Property.IPCodeAnnot Property.{ ica_ca; ica_stmt; } when Db.Value.is_reachable_stmt ica_stmt -> begin let status = get_status ip in match Alarms.find ica_ca with | None -> report_status report.assertions status | Some alarm -> let acc_status, acc_alarms = report.alarms in report_status acc_status status; match status with | None | Some Property_status.True -> () | _ -> report_alarm acc_alarms alarm end | Property.IPPropertyInstance {Property.ii_stmt} when Db.Value.is_reachable_stmt ii_stmt -> report_status report.preconds (get_status ip) | _ -> () in Property_status.iter report_property; report let print_alarms_kind fmt kind = let print count str plural str' = if !count > 0 then Format.fprintf fmt " %4i %s%s%s@;" !count str (if !count > 1 then plural else "") str' in print kind.division_by_zero "division" "s" " by zero"; print kind.memory_access "invalid memory access" "es" ""; print kind.index_out_of_bound "access" "es" " out of bounds index"; print kind.overflow "integer overflow" "s" ""; print kind.invalid_shift "invalid shift" "s" ""; print kind.uninitialized "access" "es" " to uninitialized left-values"; print kind.dangling "escaping address" "es" ""; print kind.nan_or_infinite "nan or infinite floating-point value" "s" ""; print kind.float_to_int "illegal conversion" "s" " from floating-point to integer"; print kind.others "other" "s" "" let print_alarms fmt report = let alarms, kind = report.alarms in let total = !(alarms.unknown) + !(alarms.invalid) in Format.fprintf fmt "%i alarm%s generated by the analysis" total (plural total); if total = !(kind.others) then Format.fprintf fmt ".@;" else Format.fprintf fmt ":@;%a" print_alarms_kind kind; let invalid = !(alarms.invalid) in if invalid > 0 then Format.fprintf fmt "%i of them %s sure alarm%s (invalid status).@;" invalid (if invalid = 1 then "is a" else "are") (plural invalid) let print_properties fmt report = let { assertions; preconds } = report in let total acc = !(acc.valid) + !(acc.unknown) + !(acc.invalid) in let total_assertions = total assertions and total_preconds = total preconds in let total = total_assertions + total_preconds in if total = 0 then Format.fprintf fmt "No logical properties have been reached by the analysis.@;" else let print_line header status total = Format.fprintf fmt " %-14s %4d valid %4d unknown %4d invalid %4d total@;" header !(status.valid) !(status.unknown) !(status.invalid) total; in Format.fprintf fmt "Evaluation of the logical properties reached by the analysis:@;"; print_line "Assertions" assertions total_assertions; print_line "Preconditions" preconds total_preconds; let proven = !(assertions.valid) + !(preconds.valid) in let proven = proven * 100 / total in Format.fprintf fmt "%i%% of the logical properties reached have been proven.@;" proven let print_summary fmt = let bar = String.make 76 '-' in let report = make_report () in Format.fprintf fmt "%s@;" bar; print_coverage fmt; Format.fprintf fmt "%s@;" bar; print_warning fmt; Format.fprintf fmt "%s@;" bar; print_alarms fmt report; Format.fprintf fmt "%s@;" bar; print_properties fmt report; Format.fprintf fmt "%s" bar let print_summary () = let dkey = Value_parameters.dkey_summary in let header fmt = Format.fprintf fmt " ====== ANALYSIS SUMMARY ======" in Value_parameters.printf ~header ~dkey ~level:1 " @[<v>%t@]" print_summary (* Local Variables: compile-command: "make -C ../../../.." End: *) ����frama-c-20.0-Calcium/src/plugins/value/utils/value_results.mli��������������������������������������0000666�0000000�0000000�00000005167�13571573400�021350� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This file will ultimately contain all the results computed by Value (which must be moved out of Db.Value), both per stack and globally. *) open Cil_types val mark_kf_as_called: kernel_function -> unit val add_kf_caller: caller:kernel_function * stmt -> kernel_function -> unit val is_non_terminating_instr: stmt -> bool (** Returns [true] iff there exists executions of the statement that does not always fail/loop (for function calls). Must be called *only* on statements that are instructions. *) (** {2 Results} *) type results val get_results: unit -> results val set_results: results -> unit val merge: results -> results -> results val change_callstacks: (Value_types.callstack -> Value_types.callstack) -> results -> results (** Change the callstacks for the results for which this is meaningful. For technical reasons, the top of the callstack must currently be preserved. *) (** Prints a summary of the analysis. *) val print_summary: unit -> unit (* Local Variables: compile-command: "make -C ../../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/value_util.ml������������������������������������������0000666�0000000�0000000�00000024567�13571573400�020460� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (* Callstacks related types and functions *) (* Function called, and calling instruction. *) type call_site = (kernel_function * kinstr) type callstack = call_site list let call_stack : callstack ref = ref [] (* let call_stack_for_callbacks : (kernel_function * kinstr) list ref = ref [] *) let clear_call_stack () = call_stack := [] let pop_call_stack () = Value_perf.stop_doing !call_stack; call_stack := List.tl !call_stack ;; let push_call_stack kf ki = call_stack := (kf,ki) :: !call_stack; Value_perf.start_doing !call_stack ;; let current_kf () = let (kf,_) = (List.hd !call_stack) in kf;; let call_stack () = !call_stack let pp_callstack fmt = if Value_parameters.PrintCallstacks.get () then Format.fprintf fmt "@ stack: %a" Value_types.Callstack.pretty (call_stack()) ;; (* Assertions emitted during the analysis *) let emitter = Emitter.create "Eva" [ Emitter.Property_status; Emitter.Alarm ] ~correctness:Value_parameters.parameters_correctness ~tuning:Value_parameters.parameters_tuning let () = Db.Value.emitter := emitter let get_slevel kf = try Value_parameters.SlevelFunction.find kf with Not_found -> Value_parameters.SemanticUnrollingLevel.get () let pretty_actuals fmt actuals = let pp fmt (e,x,_) = Cvalue.V.pretty_typ (Some (Cil.typeOf e)) fmt x in Pretty_utils.pp_flowlist pp fmt actuals let pretty_current_cfunction_name fmt = Kernel_function.pretty fmt (current_kf()) let warning_once_current fmt = Value_parameters.warning ~current:true ~once:true fmt (* Emit alarms in "non-warning" mode *) let alarm_report ?current ?source ?emitwith ?echo ?once ?append = Value_parameters.warning ~wkey:Value_parameters.wkey_alarm ?current ?source ?emitwith ?echo ?once ?append module DegenerationPoints = Cil_state_builder.Stmt_hashtbl (Datatype.Bool) (struct let name = "Value_util.Degeneration" let size = 17 let dependencies = [ Db.Value.self ] end) let register_new_var v typ = if Cil.isFunctionType typ then Globals.Functions.replace_by_declaration (Cil.empty_funspec()) v v.vdecl else Globals.Vars.add_decl v let create_new_var name typ = let vi = Cil.makeGlobalVar ~source:false ~temp:false name typ in register_new_var vi typ; vi let is_const_write_invalid typ = Cil.typeHasQualifier "const" typ (* Find if a postcondition contains [\result] *) class postconditions_mention_result = object inherit Visitor.frama_c_inplace method! vterm_lhost = function | TResult _ -> raise Exit | _ -> Cil.DoChildren end let postconditions_mention_result spec = (* We save the current location because the visitor modifies it. *) let loc = Cil.CurrentLoc.get () in let vis = new postconditions_mention_result in let aux_bhv bhv = let aux (_, post) = ignore (Visitor.visitFramacIdPredicate vis post) in List.iter aux bhv.b_post_cond in let res = try List.iter aux_bhv spec.spec_behavior; false with Exit -> true in Cil.CurrentLoc.set loc; res let conv_comp op = let module C = Abstract_interp.Comp in match op with | Eq -> C.Eq | Ne -> C.Ne | Le -> C.Le | Lt -> C.Lt | Ge -> C.Ge | Gt -> C.Gt | _ -> assert false let conv_relation rel = let module C = Abstract_interp.Comp in match rel with | Req -> C.Eq | Rneq -> C.Ne | Rle -> C.Le | Rlt -> C.Lt | Rge -> C.Ge | Rgt -> C.Gt let loc_dummy_value = let l = { Cil_datatype.Position.unknown with Filepath.pos_path = Datatype.Filepath.of_string "_value_" } in l, l let zero e = let loc = loc_dummy_value in let typ = Cil.unrollType (Cil.typeOf e) in match typ with | TFloat (fk, _) -> Cil.new_exp ~loc (Const (CReal (0., fk, None))) | TEnum ({ekind = ik },_) | TInt (ik, _) -> Cil.new_exp ~loc (Const (CInt64 (Integer.zero, ik, None))) | TPtr _ -> let ik = Cil.(theMachine.upointKind) in let zero = Cil.new_exp ~loc (Const (CInt64 (Integer.zero, ik, None))) in Cil.mkCast ~force:true ~e:zero ~newt:typ | typ -> Value_parameters.fatal ~current:true "non-scalar type %a" Printer.pp_typ typ let eq_with_zero positive e = let op = if positive then Eq else Ne in let loc = Cil_datatype.Location.unknown in Cil.new_exp ~loc (BinOp (op, zero e, e, Cil.intType)) let is_value_zero e = e.eloc == loc_dummy_value let inv_rel = function | Gt -> Le | Lt -> Ge | Le -> Gt | Ge -> Lt | Eq -> Ne | Ne -> Eq | _ -> assert false (* Transform an expression supposed to be [positive] into an equivalent one in which the root expression is a comparison operator. *) let rec normalize_as_cond expr positive = match expr.enode with | UnOp (LNot, e, _) -> normalize_as_cond e (not positive) | BinOp ((Le|Ne|Eq|Gt|Lt|Ge as binop), e1, e2, typ) -> if positive then expr else let binop = inv_rel binop in let enode = BinOp (binop, e1, e2, typ) in Cil.new_exp ~loc:expr.eloc enode | _ -> eq_with_zero (not positive) expr module PairExpBool = Datatype.Pair_with_collections(Cil_datatype.Exp)(Datatype.Bool) (struct let module_name = "Value.Value_util.PairExpBool" end) module MemoNormalizeAsCond = State_builder.Hashtbl (PairExpBool.Hashtbl) (Cil_datatype.Exp) (struct let name = "Value_util.MemoNormalizeAsCond" let size = 64 let dependencies = [ Ast.self ] end) let normalize_as_cond e pos = MemoNormalizeAsCond.memo (fun (e, pos) -> normalize_as_cond e pos) (e, pos) module MemoLvalToExp = Cil_state_builder.Lval_hashtbl (Cil_datatype.Exp) (struct let name = "Value_util.MemoLvalToExp" let size = 64 let dependencies = [ Ast.self ] end) let lval_to_exp = MemoLvalToExp.memo (fun lv -> Cil.new_exp ~loc:Cil_datatype.Location.unknown (Lval lv)) let dump_garbled_mix () = let l = Cvalue.V.get_garbled_mix () in if l <> [] then let pp_one fmt v = Format.fprintf fmt "@[<hov 2>%a@]" Cvalue.V.pretty v in Value_parameters.warning ~wkey:Value_parameters.wkey_garbled_mix "Garbled mix generated during analysis:@.\ @[<v>%a@]" (Pretty_utils.pp_list ~pre:"" ~suf:"" ~sep:"@ " pp_one) l (* Computation of the inputs of an expression. *) let rec zone_of_expr find_loc expr = let rec process expr = match expr.enode with | Lval lval -> (* Dereference of an lvalue. *) zone_of_lval find_loc lval | UnOp (_, e, _) | CastE (_, e) | Info (e, _) -> (* Unary operators. *) process e | BinOp (_, e1, e2, _) -> (* Binary operators. *) Locations.Zone.join (process e1) (process e2) | StartOf lv | AddrOf lv -> (* computation of an address: the inputs of the lvalue whose address is computed are read to compute said address. *) indirect_zone_of_lval find_loc lv | Const _ | SizeOf _ | AlignOf _ | SizeOfStr _ | SizeOfE _ | AlignOfE _ -> (* static constructs, nothing is read to evaluate them. *) Locations.Zone.bottom in process expr (* dereference of an lvalue: first, its address must be computed, then its contents themselves are read *) and zone_of_lval find_loc lval = let ploc = find_loc lval in let loc = Precise_locs.imprecise_location ploc in let zone = Locations.(enumerate_valid_bits Read loc) in Locations.Zone.join zone (indirect_zone_of_lval find_loc lval) (* Computations of the inputs of a lvalue : union of the "host" part and the offset. *) and indirect_zone_of_lval find_loc (lhost, offset) = (Locations.Zone.join (zone_of_lhost find_loc lhost) (zone_of_offset find_loc offset)) (* Computation of the inputs of a host. Nothing for a variable, and the inputs of [e] for a dereference [*e]. *) and zone_of_lhost find_loc = function | Var _ -> Locations.Zone.bottom | Mem e -> zone_of_expr find_loc e (* Computation of the inputs of an offset. *) and zone_of_offset find_loc = function | NoOffset -> Locations.Zone.bottom | Field (_, o) -> zone_of_offset find_loc o | Index (e, o) -> Locations.Zone.join (zone_of_expr find_loc e) (zone_of_offset find_loc o) let rec height_expr expr = match expr.enode with | Const _ | SizeOf _ | SizeOfStr _ | AlignOf _ -> 0 | Lval lv | AddrOf lv | StartOf lv -> height_lval lv + 1 | UnOp (_,e,_) | CastE (_, e) | Info (e,_) | SizeOfE e | AlignOfE e -> height_expr e + 1 | BinOp (_,e1,e2,_) -> max (height_expr e1) (height_expr e2) + 1 and height_lval (host, offset) = let h1 = match host with | Var _ -> 0 | Mem e -> height_expr e + 1 in max h1 (height_offset offset) + 1 and height_offset = function | NoOffset -> 0 | Field (_,r) -> height_offset r + 1 | Index (e,r) -> max (height_expr e) (height_offset r) + 1 let skip_specifications kf = Value_parameters.SkipLibcSpecs.get () && Kernel_function.is_definition kf && Cil.hasAttribute "fc_stdlib" (Kernel_function.get_vi kf).vattr (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/value_util.mli�����������������������������������������0000666�0000000�0000000�00000012335�13571573400�020617� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (** {2 Callstacks related types and functions} *) (** A call_stack is a list, telling which function was called at which site. The head of the list tells about the latest call. *) type call_site = (kernel_function * kinstr) type callstack = call_site list (** Functions dealing with call stacks. *) val clear_call_stack : unit -> unit val pop_call_stack : unit -> unit val push_call_stack : kernel_function -> kinstr -> unit (** The current function is the one on top of the call stack. *) val current_kf : unit -> kernel_function val call_stack : unit -> callstack (** Prints the current callstack. *) val pp_callstack : Format.formatter -> unit (** {2 Others} *) (* TODO: Document the rest of this file. *) val emitter : Emitter.t val get_slevel : Kernel_function.t -> Value_parameters.SlevelFunction.value val pretty_actuals : Format.formatter -> (Cil_types.exp * Cvalue.V.t * 'b) list -> unit val pretty_current_cfunction_name : Format.formatter -> unit val warning_once_current : ('a, Format.formatter, unit) format -> 'a (** Emit an alarm, either as warning or as a result, according to status associated to {!Value_parameters.wkey_alarm} *) val alarm_report: 'a Log.pretty_printer (* Statements for which the analysis has degenerated. [true] means that this is the statement on which the degeneration occurred, or a statement above in the callstack *) module DegenerationPoints: State_builder.Hashtbl with type key = stmt and type data = bool val create_new_var: string -> typ -> varinfo (** Create and register a new variable inside Frama-C. The variable has its [vlogic] field set, meaning it is not a source variable. The freshness of the name must be ensured by the user. *) val is_const_write_invalid: typ -> bool (** Detect that the type is const, and that option [-global-const] is set. In this case, we forbid writing in a l-value that has this type. *) val postconditions_mention_result: Cil_types.funspec -> bool (** Does the post-conditions of this specification mention [\result]? *) val conv_comp: binop -> Abstract_interp.Comp.t val conv_relation: relation -> Abstract_interp.Comp.t val normalize_as_cond: exp -> bool -> exp (** [normalize_as_cond e positive] returns the expression corresponding to [e != 0] when [positive] is true, and [e == 0] otherwise. The resulting expression will always have a comparison operation at its root. *) val is_value_zero: exp -> bool (** Return [true] iff the argument has been created by {!normalize_as_cond} *) val lval_to_exp: lval -> exp (** This function is memoized to avoid creating too many expressions *) val dump_garbled_mix: unit -> unit (** print information on the garbled mix created during evaluation *) (** Dependences of expressions and lvalues. *) val zone_of_expr: (lval -> Precise_locs.precise_location) -> exp -> Locations.Zone.t (** Given a function computing the location of lvalues, computes the memory zone on which the value of an expression depends. *) val indirect_zone_of_lval: (lval -> Precise_locs.precise_location) -> lval -> Locations.Zone.t (** Given a function computing the location of lvalues, computes the memory zone on which the offset and the pointer expression (if any) of an lvalue depend. *) (** Computes the height of an expression, that is the maximum number of nested operations in this expression. *) val height_expr: exp -> int (** Computes the height of an lvalue. *) val height_lval: lval -> int val skip_specifications: kernel_function -> bool (** Should we skip the specifications of this function, according to [-eva-skip-stdlib-specs] *) (* Local Variables: compile-command: "make -C ../../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/widen.ml�����������������������������������������������0000666�0000000�0000000�00000056276�13571573400�017417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype let dkey = Widen_hints_ext.dkey (* Note concerning all visitors and hints related to statements: currently, [stmt] is always [None]. Because our dataflow does not stabilize inner loop before the outer ones, we sometimes end up widening an inner variable inside an outer loop. Hence, we need to have the inner widening hints in the outer loops. To do so, the simplest is to avoid specifying statements altogether. This may be inefficient for codes that reuse loop indexes... *) let rec constFoldTermToLogicReal = function | TConst (LReal r) -> Some r | TUnOp (Neg,e) -> begin match (constFoldTermToLogicReal e.term_node) with | None -> None | Some e -> Some { r_literal = if String.get e.r_literal 0 = '-' then String.sub e.r_literal 1 (String.length e.r_literal - 1) else "-" ^ e.r_literal; r_nearest = -. e.r_nearest; r_lower = -. e.r_upper; r_upper = -. e.r_lower; } end | _ -> None class pragma_widen_visitor init_widen_hints init_enclosing_loops = object(self) inherit Visitor.frama_c_inplace val widen_hints = init_widen_hints val enclosing_loops = init_enclosing_loops method private add_int_thresholds ?base int_thresholds = widen_hints := Widen_type.join (Widen_type.num_hints None(*see note*) base int_thresholds) !widen_hints method private add_float_thresholds ?base float_thresholds = widen_hints := Widen_type.join (Widen_type.float_hints None(*see note*) base float_thresholds) !widen_hints method private add_var_hints ~stmt hints = widen_hints := Widen_type.join (Widen_type.var_hints stmt hints) !widen_hints method private process_loop_pragma stmt p = match p with | Widen_variables l -> begin let f (lv, lt) t = match t with | { term_node= TLval (TVar {lv_origin = Some vi}, _)} -> (Base.Set.add (Base.of_varinfo vi) lv, lt) | _ -> (lv, t::lt) in match List.fold_left f (Base.Set.empty, []) l with | (var_hints, []) -> (* the annotation is empty or contains only variables *) self#add_var_hints ~stmt var_hints | (_lv, _lt) -> Value_parameters.warning ~once:true "could not interpret loop pragma relative to widening variables" end | Widen_hints l -> begin let f (lv, lint, lfloat, lt) t = match t with | { term_node= TLval (TVar { lv_origin = Some vi}, _)} -> (Base.of_varinfo vi :: lv, lint, lfloat, lt) | { term_node= TConst (Integer(v,_))} -> (lv, Ival.Widen_Hints.add v lint, lfloat, lt) | _ -> match constFoldTermToLogicReal t.term_node with | Some f -> (lv, lint, Fc_float.Widen_Hints.add f lfloat, lt) | None -> (lv, lint, lfloat, t::lt) in match List.fold_left f ([], Ival.Widen_Hints.empty, Fc_float.Widen_Hints.empty, []) l with | (vars, int_thresholds, float_thresholds, []) -> (* the annotation is empty or contains only variables *) if vars = [] then begin self#add_int_thresholds int_thresholds; self#add_float_thresholds float_thresholds end else List.iter (fun base -> self#add_int_thresholds ~base int_thresholds; self#add_float_thresholds ~base float_thresholds; ) vars | _ -> Value_parameters.warning ~once:true "could not interpret loop pragma relative to widening hint" end | _ -> () method! vstmt (s:stmt) = match s.skind with | Loop (_, bl, _, _, _) -> begin (* ZZZ: this code does not handle loops that are created using gotos. We could improve this by finding the relevant statements using a traversal of the CFG. *) let annot = Annotations.code_annot s in let pragmas = Logic_utils.extract_loop_pragma annot in List.iter (self#process_loop_pragma s) pragmas; let new_loop_info = s :: enclosing_loops in let visitor = new pragma_widen_visitor widen_hints new_loop_info in ignore (Visitor.visitFramacBlock visitor bl); Cil.SkipChildren (* Otherwise the inner statements are visited multiple times needlessly *) end | If (exp, bl_then, bl_else, _) -> begin (* Look for if-goto and if-break statements. The variables of the condition are added to the early widening variable set for this loop.*) let aux_loop loop = let loop_stmts = Stmts_graph.get_stmt_stmts loop in let rec aux_block_loop bl = match bl with | {bstmts = []} -> () | {bstmts = [{skind = Block bl}]} -> aux_block_loop bl | {bstmts = ({skind = Break _; succs = [stmt]}| {skind = Goto ({contents=stmt},_)}) ::_} when not (Stmt.Set.mem stmt loop_stmts) -> (* This block goes out of [loop]. The variables of [exp] are hints*) let varinfos = Cil.extract_varinfos_from_exp exp in let var_hints = Varinfo.Set.fold (fun vi set -> Base.Set.add (Base.of_varinfo vi) set) varinfos Base.Set.empty in self#add_var_hints ~stmt:loop var_hints | _ -> () in aux_block_loop bl_then; aux_block_loop bl_else in List.iter aux_loop enclosing_loops; Cil.DoChildren end | _ -> Cil.DoChildren method! vexpr (e:exp) = begin let with_succ v = [v ; Integer.succ v] and with_pred v = [Integer.pred v ; v ] and with_s_p_ v = [Integer.pred v; v; Integer.succ v] and default_visit _e = Cil.DoChildren and unop_visit e = match e with | {enode=(CastE(_, { enode=Lval (Var varinfo, _)}) | Lval (Var varinfo, _))} -> let int_thresholds = Ival.Widen_Hints.singleton Integer.zero in let base = Base.of_varinfo varinfo in self#add_int_thresholds ~base int_thresholds; Cil.DoChildren | _ -> Cil.DoChildren and comparison_visit add1 add2 e1 e2 = let add base set = let int_thresholds = List.fold_right Ival.Widen_Hints.add set Ival.Widen_Hints.empty in self#add_int_thresholds ~base int_thresholds in let i1, i2 = Cil.constFoldToInt e1, Cil.constFoldToInt e2 in begin match i1, i2, e1, e2 with | Some int64, _, _, {enode=(CastE(_, { enode=Lval (Var varinfo, _)}) | Lval (Var varinfo, _))}-> add (Base.of_varinfo varinfo) (add1 int64) | _, Some int64, {enode=(CastE(_, { enode=Lval (Var varinfo, _)}) | Lval (Var varinfo, _))}, _ -> add (Base.of_varinfo varinfo) (add2 int64) | _ -> () end; Cil.DoChildren in match e.enode with | BinOp (Lt, e1, e2, _) | BinOp (Gt, e2, e1, _) | BinOp (Le, e2, e1, _) | BinOp (Ge, e1, e2, _) -> comparison_visit with_succ with_pred e1 e2 | BinOp (Eq, e1, e2, _) | BinOp (Ne, e1, e2, _) -> comparison_visit with_s_p_ with_s_p_ e1 e2 | UnOp (Neg, e, _) -> unop_visit e | Lval _ -> unop_visit e | _ -> default_visit e end (* [idx] is an expression that serves as index in an access to an array of size [size]. When possible, add hints for the variables in [idx] *) method private add_index_hints size idx = (* add the bounds [size-shift, size-shift-1] to the hints for [vidx] *) let add_hint vidx size shift = let bound1 = Integer.sub size shift in let bound2 = Integer.(sub bound1 one) in let int_thresholds = Ival.Widen_Hints.of_list [bound1; bound2] in self#add_int_thresholds ~base:(Base.of_varinfo vidx) int_thresholds in (* Find inside [idx] a variable on which we will add hints. [shift] is an integer that indicates that we access to [idx+shift], instead of to [idx] directly *) let rec aux_idx idx shift = match idx.enode with | Lval (Var vidx, _) -> add_hint vidx size shift | CastE (typ, e') when Cil.isIntegralType typ -> (* It is safe to ignore casts: hints do not need to be sound. *) aux_idx e' shift | BinOp ((PlusA | MinusA as op), e1, e2, _) -> begin (* See if either [e1] or [e2] is constant. If so, find a variable in the other expression and add a hint for this variable, shifted. *) let shift' s = if op = PlusA then Integer.add shift s else Integer.sub shift s in match Cil.constFoldToInt e1 with | Some shift1 -> aux_idx e2 (shift' shift1) | None -> begin match Cil.constFoldToInt e2 with | None -> () | Some shift2 -> aux_idx e1 (shift' shift2) end end | _ -> () in aux_idx idx Integer.zero (* Find an array access and infer hints for the variables involved. We visit the l-value ourselves. This way, we catch all accesses, including in sub-structures. *) method private find_array_accesses (host, off) = let rec aux_offset typ offs = match offs with | NoOffset -> () | Field (fi, off) -> aux_offset fi.ftype off | Index (idx, off) -> begin match Cil.unrollType typ with | TArray (typ_e, size, _, _) -> begin aux_offset typ_e off; try let size = Cil.lenOfArray64 size in if Integer.(gt size zero) then self#add_index_hints size idx with Cil.LenOfArray -> () end | _ -> () end in aux_offset (Cil.typeOfLhost host) off method! vlval lv = self#find_array_accesses lv; Cil.DoChildren end (* returns the (static) bases associated to [hvars], which must not be [HintMem]. *) let base_of_static_hvars hvars = match hvars with | Widen_hints_ext.HintAllVars -> None | Widen_hints_ext.HintVar vi -> Some (Base.of_varinfo vi) | Widen_hints_ext.HintMem (e, offset) -> (* syntactic constraints prevent this from happening *) Value_parameters.fatal "unsupported lhost: %a" Printer.pp_lval (Mem e, offset) type threshold = Int_th of Integer.t | Real_th of logic_real (* try parsing as int, then as float *) let threshold_of_threshold_term ht = let global_find_init vi = try (Globals.Vars.find vi).init with Not_found -> None in let ht = Cil.visitCilTerm (new Logic_utils.simplify_const_lval global_find_init) ht in match Logic_utils.constFoldTermToInt ht with | Some i -> Int_th i | None -> match constFoldTermToLogicReal ht.term_node with | Some f -> Real_th f | None -> Value_parameters.abort ~source:(fst ht.term_loc) "could not parse widening hint: %a@ \ If it contains variables, they must be global const integers." Printer.pp_term ht let thresholds_of_threshold_terms hts = let has_int = ref false in let has_float = ref false in List.fold_left (fun (int_acc, float_acc) ht -> match threshold_of_threshold_term ht with | Int_th i -> if !has_float then Value_parameters.abort ~source:(fst ht.term_loc) "widening hint mixing integers and floats: %a" Printer.pp_term ht; has_int := true; Ival.Widen_Hints.add i int_acc, float_acc | Real_th f -> if !has_int then Value_parameters.abort ~source:(fst ht.term_loc) "widening hint mixing integers and floats: %a" Printer.pp_term ht; has_float := true; int_acc, Fc_float.Widen_Hints.add f float_acc ) (Ival.Widen_Hints.empty, Fc_float.Widen_Hints.empty) hts class hints_visitor init_widen_hints global = object(self) inherit Visitor.frama_c_inplace val widen_hints = init_widen_hints method private iter_static_hints ~global hints = let static_hints = List.filter (fun h -> not (Widen_hints_ext.is_dynamic h)) hints in List.iter (fun ({Widen_hints_ext.vars; loc}, wh_terms) -> let base = base_of_static_hvars vars in let int_thresholds, float_thresholds = thresholds_of_threshold_terms wh_terms in Value_parameters.feedback ~source:(fst loc) ~dkey "adding%s hint from annotation: %a, %t (for all statements)" (if global then " global" else "") (Pretty_utils.pp_opt ~none:(format_of_string "for all variables") Base.pretty) base (fun fmt -> if Ival.Widen_Hints.is_empty int_thresholds then Format.fprintf fmt "float:%a" Fc_float.Widen_Hints.pretty float_thresholds else Ival.Widen_Hints.pretty fmt int_thresholds); let new_int_hints = Widen_type.num_hints None (* see note above *) base int_thresholds in widen_hints := Widen_type.join new_int_hints !widen_hints; let new_float_hints = Widen_type.float_hints None (* see note above *) base float_thresholds in widen_hints := Widen_type.join new_float_hints !widen_hints ) static_hints method! vstmt s = let all_hints = Widen_hints_ext.get_stmt_widen_hint_terms s in let global_hints = List.filter (fun ht -> Widen_hints_ext.is_global ht = global) all_hints in self#iter_static_hints ~global global_hints; Cil.DoChildren end module Global_Static_Hints = State_builder.Ref (Widen_type) (struct let dependencies = [ Ast.self ] let name = "Widen.Global_Static_Hints" let default = Widen_type.default end) let () = Ast.add_monotonic_state Global_Static_Hints.self (* Global widen hints, used for all functions *) let global_widen_hints () = if (not (Global_Static_Hints.is_computed ())) then begin Value_parameters.debug ~dkey "computing global widen hints"; let global_widen_hints = ref (Widen_type.default ()) in Globals.Functions.iter_on_fundecs (fun fd -> let visitor = new hints_visitor global_widen_hints true in ignore (Visitor.visitFramacFunction visitor fd) ); Global_Static_Hints.set !global_widen_hints; Global_Static_Hints.mark_as_computed (); !global_widen_hints end else Global_Static_Hints.get () let per_function_static_hints fdec = let widen_hints = ref (global_widen_hints ()) in let visitor_pragma = new pragma_widen_visitor widen_hints [] in ignore (Visitor.visitFramacFunction visitor_pragma fdec); let visitor_local = new hints_visitor widen_hints false in ignore (Visitor.visitFramacFunction visitor_local fdec); !widen_hints module Per_Function_Static_Hints = State_builder.Hashtbl (Cil_datatype.Fundec.Hashtbl) (Widen_type) (struct let name = "Widen.Per_Function_Static_Hints" let size = 97 let dependencies = [ Ast.self ] end) let () = Ast.add_monotonic_state Per_Function_Static_Hints.self (* parse and precompute global and local static hints *) let precompute_widen_hints () = Globals.Functions.iter_on_fundecs (fun fd -> Per_Function_Static_Hints.replace fd (per_function_static_hints fd)) type dynamic_hint = { mutable bases : Base.Hptset.t (* dynamic, used to detect when a new base needs to be added to the global widening hints *); lv : exp * offset; (* static, parsed once from the AST *) int_thresholds : Ival.Widen_Hints.t; (* static, computed only once *) float_thresholds : Fc_float.Widen_Hints.t; (* static, computed only once *) } module ExpOffset = Datatype.Pair(Exp)(Offset) module DynamicHintDatatype = Datatype.Make(struct include Datatype.Serializable_undefined type t = dynamic_hint let name = "Widen.DynamicHintDatatype" let structural_descr = Structural_descr.t_tuple [| Base.Hptset.packed_descr; ExpOffset.packed_descr; Ival.Widen_Hints.packed_descr; Fc_float.Widen_Hints.packed_descr |] let reprs = Extlib.product (fun wh fh -> { bases = Base.Hptset.empty; lv = (Exp.dummy, NoOffset); int_thresholds = wh; float_thresholds = fh }) Ival.Widen_Hints.reprs Fc_float.Widen_Hints.reprs let mem_project = Datatype.never_any_project end) (* use a list of hints instead of multiple entries in a hashtable because we need to replace one entry (e.g. one hint for which a base was added) but not all, so Hashtbl.replace will not work. *) module StmtDynamicHint = Datatype.List(DynamicHintDatatype) (** Stores a mapping from statements to parsed dynamic hint terms. Only stores mappings for statements with annotations, to avoid wasting memory. The dataflow iteration consults this table each time it reaches a statement with an annotation. It must quickly evaluate the bases related to the annotations, to see if there are new bases that should be added to the global widening hints. Therefore, we store, for each annotation, the set of bases computed so far, plus the thresholds (to avoid recomputing them). *) module Parsed_Dynamic_Hints = State_builder.Hashtbl (Stmt.Hashtbl) (StmtDynamicHint) (struct let name = "Widen.Parsed_Dynamic_Hints" let size = 7 let dependencies = [ Ast.self; Db.Value.self ] end) let dynamic_bases_of_lval states e offset = let lv = (Mem e, offset) in List.fold_left (fun acc' state -> let location = !Db.Value.lval_to_loc_state state lv in Locations.Location_Bits.fold_bases (fun base acc'' -> Base.Hptset.add base acc'') location.Locations.loc acc' ) Base.Hptset.empty states (* Find syntactically the dynamic hints on [stmt]. *) let extract_dynamic_hints stmt = let source = fst (Stmt.loc stmt) in Value_parameters.debug ~source ~dkey "computing dynamic hints for statement %d" stmt.sid; let wh = Widen_hints_ext.get_stmt_widen_hint_terms stmt in let aux l (hlv, threshold_terms) = let open Widen_hints_ext in match hlv.vars with | HintMem (e, offset) -> let int_thresholds, float_thresholds = thresholds_of_threshold_terms threshold_terms in let bases = Base.Hptset.empty in { bases; lv = (e, offset); int_thresholds; float_thresholds; } :: l | _-> l in List.fold_left aux [] wh let parsed_dynamic_hints = Parsed_Dynamic_Hints.memo extract_dynamic_hints module Dynamic_Hints = State_builder.Ref (Widen_type) (struct let dependencies = [ Ast.self; Db.Value.self ] let name = "Widen.Dynamic_Hints" let default = Widen_type.default end) let () = Ast.add_monotonic_state Global_Static_Hints.self (* The contents of this table should always be the join Dynamic_hints and Per_Function_Static_Hints, for the functions that have been computed. It must be cleared when Dynamic_Hints is changed. *) module Per_Function_Hints = State_builder.Hashtbl (Cil_datatype.Fundec.Hashtbl) (Widen_type) (struct let name = "Widen.Per_Function_Hints" let size = 97 let dependencies = [ Ast.self; Dynamic_Hints.self ] end) let () = Ast.add_monotonic_state Per_Function_Hints.self let extract_per_function_hints fdec = let for_fdec = try Per_Function_Static_Hints.find fdec with Not_found -> assert false in let dynamic = Dynamic_Hints.get () in Widen_type.join for_fdec dynamic let per_function_hints = Per_Function_Hints.memo extract_per_function_hints let dynamic_widen_hints_hook (stmt, _callstack, states) = if Annotations.has_code_annot stmt then let hs = parsed_dynamic_hints stmt in if hs <> [] then let source = fst (Stmt.loc stmt) in let modified, new_hints = List.fold_right (fun dhint (_acc_modified, acc_hints as acc) -> let old_bases = dhint.bases in let exp, offset = dhint.lv in let bases = dynamic_bases_of_lval states exp offset in let new_bases = Base.Hptset.diff bases old_bases in if Base.Hptset.is_empty new_bases then acc else let new_hints = Base.Hptset.fold (fun base acc -> Value_parameters.debug ~source ~dkey "adding new base due to dynamic widen hint: %a, %a%a" Base.pretty base Ival.Widen_Hints.pretty dhint.int_thresholds Fc_float.Widen_Hints.pretty dhint.float_thresholds; let int_hint_for_base = Widen_type.num_hints None (Some base) dhint.int_thresholds in let float_hint_for_base = Widen_type.float_hints None (Some base) dhint.float_thresholds in let acc = Widen_type.join acc int_hint_for_base in Widen_type.join acc float_hint_for_base ) new_bases acc_hints in dhint.bases <- Base.Hptset.union dhint.bases new_bases; true, new_hints ) hs (false, Widen_type.empty) in if modified then begin Per_Function_Hints.clear (); let hints = Widen_type.join (Dynamic_Hints.get ()) new_hints in Dynamic_Hints.set hints; end let () = Db.Value.Compute_Statement_Callbacks.extend_once dynamic_widen_hints_hook let getWidenHints (kf:kernel_function) (stmt:stmt) = let hints = match kf.fundec with | Declaration _ -> Widen_type.empty | Definition (fdec, _) -> per_function_hints fdec in Widen_type.hints_from_keys stmt hints (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/widen.mli����������������������������������������������0000666�0000000�0000000�00000004155�13571573400�017555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Per-function computation of widening hints. *) open Cil_types (** [getWidenHints kf s] retrieves the set of widening hints related to function [kf] and statement [s]. *) val getWidenHints: kernel_function -> stmt -> Base.Set.t * (Base.t -> Locations.Location_Bytes.numerical_widen_hint) (** Parses all widening hints defined via the widen_hint syntax extension. The result is memoized for subsequent calls. *) val precompute_widen_hints: unit -> unit (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/widen_hints_ext.ml�������������������������������������0000666�0000000�0000000�00000016232�13571573400�021470� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types let dkey = Value_parameters.register_category "widen-hints" let error ?msg loc typing_context = typing_context.Logic_typing.error loc "invalid widen_hints annotation%a" (Pretty_utils.pp_opt ~pre:": " Format.pp_print_string) msg type hint_vars = | HintAllVars (* "all" vars: static hint *) | HintVar of varinfo (* static hint *) | HintMem of exp * offset (* dynamic hint *) type hint_lval = { vars : hint_vars; names : string list; loc : Cil_datatype.Location.t; } type t = hint_lval * term list (* Textual representation of the hint corresponding to "widen all variables". *) let all_vars_str = "\"all\"" let pp_hvars fmt = function | HintAllVars -> Format.fprintf fmt "%s" all_vars_str | HintVar vi -> Format.fprintf fmt "%a" Printer.pp_varinfo vi | HintMem (e, offset) -> Format.fprintf fmt "%a" Printer.pp_lval (Mem e, offset) exception Parse_error of string option let parse_error ?msg () = raise (Parse_error msg) (* Converts a [lexpr] list into a [term] list. Requires a non-empty list. Note that the hints are not actually parsed, i.e. they may be syntactically invalid. We cannot parse them here because global variables are not available yet, so we defer parsing to Value. *) let terms_of_hints typing_context hints = if hints = [] then parse_error ~msg:"no hints" () else List.map (fun hint -> (typing_context.Logic_typing.type_term typing_context typing_context.Logic_typing.pre_state hint)) hints (* Parses [arg] using [typing_context]. This function filters special cases ("all" variables, global label) to parse them using specific rules. All other cases are redispatched to the standard logic typer. *) let rec parse_lval typing_context loc arg = let open Logic_ptree in match arg.lexpr_node with | PLnamed (name, node) (* global:x *) -> if name <> "global" then parse_error ~msg:("invalid label " ^ name) () else let term = parse_lval typing_context loc node in { term with term_name = [name] } | PLconstant (StringConstant str) when str = "all" (* "all" variables *) -> Logic_const.tstring ~loc all_vars_str | _ -> let open Logic_typing in typing_context.type_term typing_context typing_context.pre_state arg (* Converts the parsing tokens to a list of terms. May raise Kernel.error. *) let terms_of_parsed_widen_hints typing_context loc args = try match args with | arg :: hints -> let var = parse_lval typing_context loc arg in var, terms_of_hints typing_context hints | [] -> parse_error () with Parse_error msg -> error ?msg loc typing_context exception Invalid_hint (* given a list of terms [var_term :: hint_terms], returns Some (var_string, hint_terms) or None in case of an error. *) let widen_hint_terms_of_terms terms = try match terms with | lval_term :: hint_thresholds -> begin match lval_term with | {term_name; term_node = TConst (LStr s)} when s = all_vars_str -> let named_lval = {names = term_name; loc = lval_term.term_loc; vars = HintAllVars} in Some (named_lval, hint_thresholds) | {term_node = TLval tlv} -> let (lhost, offset) = !Db.Properties.Interp.term_lval_to_lval ~result:None tlv in let hint_vars = match lhost with | Mem e -> HintMem (e, offset) | Var vi -> HintVar vi in let hint_lval = { names = lval_term.term_name; loc = lval_term.term_loc; vars = hint_vars } in Some (hint_lval, hint_thresholds) | _ -> Value_parameters.debug ~source:(fst lval_term.term_loc) ~dkey "invalid var_term: %a@." Printer.pp_term lval_term; raise Invalid_hint end | _ -> Value_parameters.debug ~dkey "invalid terms: %a@." (Pretty_utils.pp_list ~sep:", " Printer.pp_term) terms; raise Invalid_hint with Invalid_hint -> None let () = Logic_typing.register_code_annot_next_both_extension "widen_hints" false (fun ~typing_context ~loc args -> let var_term, hint_terms = terms_of_parsed_widen_hints typing_context loc args in let terms = var_term :: hint_terms in Ext_terms terms ) let () = Cil_printer.register_code_annot_extension "widen_hints" (fun _pp fmt ext -> match ext with | Ext_id _ -> assert false | Ext_preds _ -> assert false | Ext_terms terms -> match widen_hint_terms_of_terms terms with | Some (hint_lval, hint_terms) -> Format.fprintf fmt "%a%a, %a" (Pretty_utils.pp_list ~sep:" " ~suf:":" Format.pp_print_string) hint_lval.names pp_hvars hint_lval.vars (Pretty_utils.pp_list ~sep:", " Printer.pp_term) hint_terms | None -> Format.fprintf fmt "<invalid widen_hints>" ) let get_widen_hints_annots stmt = Annotations.fold_code_annot (fun _emitter annot acc -> match annot with | {annot_content = AExtended (_, _, {ext_name = "widen_hints"; ext_kind = Ext_terms terms})} -> (* loop widen_hints *) acc @ [terms] | _ -> acc ) stmt [] let get_stmt_widen_hint_terms s = let terms = get_widen_hints_annots s in let filter_opt l = List.fold_left (fun acc o -> match o with | None -> acc | Some e -> e :: acc ) [] l in filter_opt (List.map widen_hint_terms_of_terms terms) let is_global (hlv, _wh) = List.mem "global" hlv.names let is_dynamic (hlv, _wh) = match hlv.vars with | HintMem _ -> true | _ -> false ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/utils/widen_hints_ext.mli������������������������������������0000666�0000000�0000000�00000004770�13571573400�021645� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Syntax extension for widening hints, used by Value. *) open Cil_types val dkey: Value_parameters.category type hint_vars = | HintAllVars (* "all" vars: static hint *) | HintVar of varinfo (* static hint *) | HintMem of exp * offset (* dynamic hint *) val pp_hvars : Format.formatter -> hint_vars -> unit (** Type of widening hints: a special kind of lval for which the hints will apply and a list of names (e.g. global). *) type hint_lval = { vars : hint_vars; names : string list; loc : Cil_datatype.Location.t; } type t = hint_lval * term list (** [get_stmt_widen_hint_terms s] returns the list of widen hints associated to [s]. *) val get_stmt_widen_hint_terms : stmt -> t list (** [is_global wh] returns true iff widening hint [wh] has a "global" prefix. *) val is_global : t -> bool (** [is_dynamic wh] returns true iff widening hint [wh] has a "dynamic" prefix. *) val is_dynamic : t -> bool ��������frama-c-20.0-Calcium/src/plugins/value/value_parameters.ml������������������������������������������0000666�0000000�0000000�00000166146�13571573400�020506� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Dependencies to kernel options *) let kernel_parameters_correctness = [ Kernel.MainFunction.parameter; Kernel.LibEntry.parameter; Kernel.AbsoluteValidRange.parameter; Kernel.SafeArrays.parameter; Kernel.UnspecifiedAccess.parameter; Kernel.SignedOverflow.parameter; Kernel.UnsignedOverflow.parameter; Kernel.LeftShiftNegative.parameter; Kernel.RightShiftNegative.parameter; Kernel.SignedDowncast.parameter; Kernel.UnsignedDowncast.parameter; ] let parameters_correctness = ref Typed_parameter.Set.empty let parameters_tuning = ref Typed_parameter.Set.empty let add_dep p = State_dependency_graph.add_codependencies ~onto:Db.Value.self [State.get p.Typed_parameter.name] let add_correctness_dep p = if Typed_parameter.Set.mem p !parameters_correctness then Kernel.abort "adding correctness parameter %a twice" Typed_parameter.pretty p; add_dep p; parameters_correctness := Typed_parameter.Set.add p !parameters_correctness let add_precision_dep p = if Typed_parameter.Set.mem p !parameters_tuning then Kernel.abort "adding tuning parameter %a twice" Typed_parameter.pretty p; add_dep p; parameters_tuning := Typed_parameter.Set.add p !parameters_tuning let () = List.iter add_correctness_dep kernel_parameters_correctness include Plugin.Register (struct let name = "Eva" let shortname = "eva" let help = "automatically computes variation domains for the variables of the program" end) let () = Help.add_aliases [ "-value-h"; "-val-h" ] let () = add_plugin_output_aliases [ "value" ] (* Debug categories. *) let dkey_initial_state = register_category "initial-state" let dkey_final_states = register_category "final-states" let dkey_summary = register_category "summary" let dkey_pointer_comparison = register_category "pointer-comparison" let dkey_cvalue_domain = register_category "d-cvalue" let dkey_incompatible_states = register_category "incompatible-states" let dkey_iterator = register_category "iterator" let dkey_callbacks = register_category "callbacks" let dkey_widening = register_category "widening" let dkey_experimental = register_category "experimental-ok" let () = let activate dkey = add_debug_keys dkey in List.iter activate [dkey_initial_state; dkey_final_states; dkey_summary; dkey_cvalue_domain] (* Warning categories. *) let wkey_alarm = register_warn_category "alarm" let wkey_locals_escaping = register_warn_category "locals-escaping" let wkey_garbled_mix = register_warn_category "garbled-mix" let () = set_warn_status wkey_garbled_mix Log.Winactive let wkey_builtins_missing_spec = register_warn_category "builtins:missing-spec" let wkey_builtins_override = register_warn_category "builtins:override" let wkey_libc_unsupported_spec = register_warn_category "libc:unsupported-spec" let wkey_loop_unroll = register_warn_category "loop-unroll" let () = set_warn_status wkey_loop_unroll Log.Wfeedback let wkey_missing_loop_unroll = register_warn_category "missing-loop-unroll" let () = set_warn_status wkey_missing_loop_unroll Log.Winactive let wkey_missing_loop_unroll_for = register_warn_category "missing-loop-unroll:for" let () = set_warn_status wkey_missing_loop_unroll_for Log.Winactive let wkey_signed_overflow = register_warn_category "signed-overflow" let wkey_invalid_assigns = register_warn_category "invalid-assigns" let () = set_warn_status wkey_invalid_assigns Log.Wfeedback module ForceValues = WithOutput (struct let option_name = "-eva" let help = "compute values" let output_by_default = true end) let () = ForceValues.add_aliases ["-val"] let domains = add_group "Abstract Domains" let precision_tuning = add_group "Precision vs. time" let initial_context = add_group "Initial Context" let performance = add_group "Results memoization vs. time" let interpreter = add_group "Deterministic programs" let alarms = add_group "Propagation and alarms " let malloc = add_group "Dynamic allocation" (* -------------------------------------------------------------------------- *) (* --- Eva domains --- *) (* -------------------------------------------------------------------------- *) (* Set of parameters defining the abstractions used in an Eva analysis. *) let parameters_abstractions = ref Typed_parameter.Set.empty (* This functor must be used to create parameters for new domains of Eva. *) module Domain_Parameter (X:sig include Parameter_sig.Input val default: bool end) = struct Parameter_customize.set_group domains; module Parameter = Bool (X);; add_precision_dep Parameter.parameter; parameters_abstractions := Typed_parameter.Set.add Parameter.parameter !parameters_abstractions; include Parameter end module CvalueDomain = Domain_Parameter (struct let option_name = "-eva-cvalue-domain" let help = "Use the default domain of eva." let default = true end) module EqualityDomain = Domain_Parameter (struct let option_name = "-eva-equality-domain" let help = "Use the equality domain of Eva." let default = false end) module GaugesDomain = Domain_Parameter (struct let option_name = "-eva-gauges-domain" let help = "Use the gauges domain of Eva." let default = false end) module SymbolicLocsDomain = Domain_Parameter (struct let option_name = "-eva-symbolic-locations-domain" let help = "Use a dedicated domain for symbolic equalities." let default = false end) module OctagonDomain = Domain_Parameter (struct let option_name = "-eva-octagon-domain" let help = "Use the octagon domain of Eva." let default = false end) module BitwiseOffsmDomain = Domain_Parameter (struct let option_name = "-eva-bitwise-domain" let help = "Use the bitwise abstractions of Eva." let default = false end) let numerors_available = ref false let register_numerors () = numerors_available := true let numerors_hook _ _ = if not !numerors_available then abort "The numerors domain has been requested but is not available,@ \ as Frama-C did not found the MPFR library. The analysis is aborted." else if not (is_debug_key_enabled dkey_experimental) then warning "The numerors domain is experimental."; module NumerorsDomain = Domain_Parameter (struct let option_name = "-eva-numerors-domain" let help = "Experimental. Use the numerors domain of Eva. This domain \ computes rounding error bounds for the floating point \ computations" let default = false end) let () = NumerorsDomain.add_set_hook numerors_hook let apron_help = "Experimental binding of the numerical domains provided \ by the APRON library: http://apron.cri.ensmp.fr/library \n" let apron_available = ref false let register_apron () = apron_available := true let apron_hook _ _ = if not !apron_available then abort "an Apron domain is requested but the apron binding is not available." else if not (is_debug_key_enabled dkey_experimental) then warning "The Apron domains binding is experimental."; module ApronOctagon = Domain_Parameter (struct let option_name = "-eva-apron-oct" let help = apron_help ^ "Use the octagon domain of apron." let default = false end) let () = ApronOctagon.add_set_hook apron_hook module ApronBox = Domain_Parameter (struct let option_name = "-eva-apron-box" let help = apron_help ^ "Use the box domain of apron." let default = false end) let () = ApronBox.add_set_hook apron_hook module PolkaLoose = Domain_Parameter (struct let option_name = "-eva-polka-loose" let help = apron_help ^ "Use the loose polyhedra domain of apron." let default = false end) let () = PolkaLoose.add_set_hook apron_hook module PolkaStrict = Domain_Parameter (struct let option_name = "-eva-polka-strict" let help = apron_help ^ "Use the strict polyhedra domain of apron." let default = false end) let () = PolkaStrict.add_set_hook apron_hook module PolkaEqualities = Domain_Parameter (struct let option_name = "-eva-polka-equalities" let help = apron_help ^ "Use the linear equalities domain of apron." let default = false end) let () = PolkaEqualities.add_set_hook apron_hook module InoutDomain = Domain_Parameter (struct let option_name = "-eva-inout-domain" let help = "Compute inputs and outputs within Eva. Experimental." let default = false end) module SignDomain = Domain_Parameter (struct let option_name = "-eva-sign-domain" let help = "Use the sign domain of Eva. For demonstration purposes only." let default = false end) module TracesDomain = Domain_Parameter (struct let option_name = "-eva-traces-domain" let help = "Use a domain to record traces of Eva. Experimental." let default = false end) module PrinterDomain = Domain_Parameter (struct let option_name = "-eva-printer-domain" let help = "Use the printer domain of eva. Useful for the developpers \ of new abstract domains, as it prints the domain functions \ that are called by Eva during an analysis." let default = false end) let () = Parameter_customize.set_group domains module EqualityCall = String (struct let option_name = "-eva-equality-through-calls" let help = "Equalities propagated through function calls (from the caller \ to the called function): none, only equalities between formal \ parameters and concrete arguments, or all. " let default = "formals" let arg_name = "none|formals|all" end) let () = add_precision_dep EqualityCall.parameter let () = Parameter_customize.set_group domains module EqualityCallFunction = Kernel_function_map (struct include Datatype.String type key = Cil_types.kernel_function let of_string ~key:_ ~prev:_ = function | None | Some ("none" | "formals" | "all") as x -> x | _ -> raise (Cannot_build "must be 'none', 'formals' or 'all'.") let to_string ~key:_ s = s end) (struct let option_name = "-eva-equality-through-calls-function" let help = "Equalities propagated through calls to specific functions. \ Overrides -eva-equality-call." let default = Kernel_function.Map.empty let arg_name = "f:none|formals|all" end) let () = add_precision_dep EqualityCallFunction.parameter let () = Parameter_customize.set_group domains module OctagonCall = Bool (struct let option_name = "-eva-octagon-through-calls" let help = "Whether the relations inferred by the octagon domain are \ propagated through function calls. Disabled by default: \ the octagon analysis is intra-procedural, starting \ each function with an empty octagon state, \ and losing the octagons inferred at the end. \ The interprocedural analysis is more precise but slower." let default = false end) let () = add_precision_dep OctagonCall.parameter let () = Parameter_customize.set_group domains module Numerors_Real_Size = Int (struct let default = 128 let option_name = "-eva-numerors-real-size" let arg_name = "n" let help = "set <n> as the significand size of the MPFR representation \ of reals used by the numerors domain (defaults to 128)" end) let () = add_precision_dep Numerors_Real_Size.parameter let () = Parameter_customize.set_group domains module Numerors_Mode = String (struct let option_name = "-eva-numerors-interaction" let help = "defines how the numerors domain infers the absolute and the \ relative errors:\n\ - relative: the relative is deduced from the absolute;\n\ - absolute: the absolute is deduced from the relative;\n\ - none: absolute and relative are computed separately;\n\ - both: reduced product between absolute and relative." let default = "both" let arg_name = "relative|absolute|none|both" end) let () = Numerors_Mode.set_possible_values ["relative"; "absolute"; "none"; "both"] let () = add_precision_dep Numerors_Mode.parameter let () = Parameter_customize.set_group domains module TracesUnrollLoop = Bool (struct let option_name = "-eva-traces-unroll-loop" let help = "Specify if the traces domain should unroll the loops." let default = true end) let () = add_precision_dep TracesUnrollLoop.parameter let () = Parameter_customize.set_group domains module TracesUnifyLoop = Bool (struct let option_name = "-eva-traces-unify-loop" let help = "Specify if all the instances of a loop should try \ to share theirs traces." let default = false end) let () = add_precision_dep TracesUnifyLoop.parameter let () = Parameter_customize.set_group domains module TracesDot = Empty_string (struct let option_name = "-eva-traces-dot" let help = "Output to the given filename the Cfg in dot format." let arg_name = "FILENAME" end) let () = Parameter_customize.set_group domains module TracesProject = Bool (struct let option_name = "-eva-traces-project" let help = "Try to convert the Cfg into a program in a new project." let default = false end) (* -------------------------------------------------------------------------- *) (* --- Performance options --- *) (* -------------------------------------------------------------------------- *) let () = Parameter_customize.set_group performance module NoResultsFunctions = Fundec_set (struct let option_name = "-eva-no-results-function" let arg_name = "f" let help = "do not record the values obtained for the statements of \ function f" end) let () = add_dep NoResultsFunctions.parameter let () = NoResultsFunctions.add_aliases ["-no-results-function"] let () = Parameter_customize.set_group performance module ResultsAll = True (struct let option_name = "-eva-results" let help = "record values for any of the statements of the program." end) let () = add_dep ResultsAll.parameter let () = ResultsAll.add_aliases ["-results"] let () = Parameter_customize.set_group performance module JoinResults = Bool (struct let option_name = "-eva-join-results" let help = "precompute consolidated states once value is computed" let default = true end) let () = JoinResults.add_aliases ["-val-join-results"] let () = Parameter_customize.set_group performance module EqualityStorage = Bool (struct let option_name = "-eva-equality-storage" let help = "Stores the states of the equality domain during \ the analysis." let default = true end) let () = add_precision_dep EqualityStorage.parameter let () = Parameter_customize.set_group performance module SymbolicLocsStorage = Bool (struct let option_name = "-eva-symbolic-locations-storage" let help = "Stores the states of the symbolic locations domain during \ the analysis." let default = true end) let () = add_precision_dep SymbolicLocsStorage.parameter let () = Parameter_customize.set_group performance module GaugesStorage = Bool (struct let option_name = "-eva-gauges-storage" let help = "Stores the states of the gauges domain during the analysis." let default = true end) let () = add_precision_dep GaugesStorage.parameter let () = Parameter_customize.set_group performance module ApronStorage = Bool (struct let option_name = "-eva-apron-storage" let help = "Stores the states of the apron domains during the \ analysis." let default = false end) let () = add_precision_dep ApronStorage.parameter let () = Parameter_customize.set_group performance module BitwiseOffsmStorage = Bool (struct let option_name = "-eva-bitwise-storage" let help = "Stores the states of the bitwise domain during the \ analysis." let default = true end) let () = add_precision_dep BitwiseOffsmStorage.parameter (* ------------------------------------------------------------------------- *) (* --- Non-standard alarms --- *) (* ------------------------------------------------------------------------- *) let () = Parameter_customize.set_group alarms module AllRoundingModesConstants = False (struct let option_name = "-eva-all-rounding-modes-constants" let help = "Take into account the possibility of constants not being converted to the nearest representable value, or being converted to higher precision" end) let () = add_correctness_dep AllRoundingModesConstants.parameter let () = AllRoundingModesConstants.add_aliases ["-all-rounding-modes-constants"] let () = Parameter_customize.set_group alarms module UndefinedPointerComparisonPropagateAll = False (struct let option_name = "-eva-undefined-pointer-comparison-propagate-all" let help = "if the target program appears to contain undefined pointer comparisons, propagate both outcomes {0; 1} in addition to the emission of an alarm" end) let () = add_correctness_dep UndefinedPointerComparisonPropagateAll.parameter let () = UndefinedPointerComparisonPropagateAll.add_aliases ["-undefined-pointer-comparison-propagate-all"] let () = Parameter_customize.set_group alarms module WarnPointerComparison = String (struct let option_name = "-eva-warn-undefined-pointer-comparison" let help = "warn on all pointer comparisons, on comparisons where \ the arguments have pointer type (default), or never warn" let default = "pointer" let arg_name = "all|pointer|none" end) let () = WarnPointerComparison.set_possible_values ["all"; "pointer"; "none"] let () = add_correctness_dep WarnPointerComparison.parameter let () = WarnPointerComparison.add_aliases ["-val-warn-undefined-pointer-comparison"] let () = Parameter_customize.set_group alarms let () = Parameter_customize.is_invisible () module WarnLeftShiftNegative = True (struct let option_name = "-val-warn-left-shift-negative" let help = "Emit alarms when left-shifting negative integers" end) let () = add_correctness_dep WarnLeftShiftNegative.parameter let () = WarnLeftShiftNegative.add_update_hook (fun _ v -> warning "This option is deprecated. Use %s instead" Kernel.LeftShiftNegative.name; Kernel.LeftShiftNegative.set v) let () = Parameter_customize.set_group alarms module WarnSignedConvertedDowncast = False (struct let option_name = "-eva-warn-signed-converted-downcast" let help = "Signed downcasts are decomposed into two operations: \ a conversion to the signed type of the original width, \ then a downcast. Warn when the downcast may exceed the \ destination range." end) let () = add_correctness_dep WarnSignedConvertedDowncast.parameter let () = WarnSignedConvertedDowncast.add_aliases ["-val-warn-signed-converted-downcast"] let () = Parameter_customize.set_group alarms module WarnPointerSubstraction = True (struct let option_name = "-eva-warn-pointer-subtraction" let help = "Warn when subtracting two pointers that may not be in the same \ allocated block, and return the pointwise difference between the \ offsets. When unset, do not warn but generate imprecise offsets." end) let () = add_correctness_dep WarnPointerSubstraction.parameter let () = WarnPointerSubstraction.add_aliases ["-val-warn-pointer-subtraction"] let () = Parameter_customize.set_group alarms module IgnoreRecursiveCalls = False (struct let option_name = "-eva-ignore-recursive-calls" let help = "Pretend function calls that would be recursive do not happen. Causes unsoundness" end) let () = add_correctness_dep IgnoreRecursiveCalls.parameter let () = IgnoreRecursiveCalls.add_aliases ["-val-ignore-recursive-calls"] let () = Parameter_customize.set_group alarms module WarnCopyIndeterminate = Kernel_function_set (struct let option_name = "-eva-warn-copy-indeterminate" let arg_name = "f | @all" let help = "warn when a statement of the specified functions copies a \ value that may be indeterminate (uninitialized or containing escaping address). \ Set by default; can be deactivated for function 'f' by '=-f', or for all \ functions by '=-@all'." end) let () = add_correctness_dep WarnCopyIndeterminate.parameter let () = WarnCopyIndeterminate.add_aliases ["-val-warn-copy-indeterminate"] let () = WarnCopyIndeterminate.Category.(set_default (all ())) let () = Parameter_customize.set_group alarms module ReduceOnLogicAlarms = False (struct let option_name = "-eva-reduce-on-logic-alarms" let help = "Force reductions by a predicate to ignore logic alarms \ emitted while the predicated is evaluated (experimental)" end) let () = add_correctness_dep ReduceOnLogicAlarms.parameter let () = ReduceOnLogicAlarms.add_aliases ["-val-reduce-on-logic-alarms"] let () = Parameter_customize.set_group alarms module InitializedLocals = False (struct let option_name = "-eva-initialized-locals" let help = "Local variables enter in scope fully initialized. \ Only useful for the analysis of programs buggy w.r.t. \ initialization." end) let () = add_correctness_dep InitializedLocals.parameter let () = InitializedLocals.add_aliases ["-val-initialized-locals"] (* ------------------------------------------------------------------------- *) (* --- Initial context --- *) (* ------------------------------------------------------------------------- *) let () = Parameter_customize.set_group initial_context module AutomaticContextMaxDepth = Int (struct let option_name = "-eva-context-depth" let default = 2 let arg_name = "n" let help = "use <n> as the depth of the default context for Eva. (defaults to 2)" end) let () = add_correctness_dep AutomaticContextMaxDepth.parameter let () = AutomaticContextMaxDepth.add_aliases ["-context-depth"] let () = Parameter_customize.set_group initial_context module AutomaticContextMaxWidth = Int (struct let option_name = "-eva-context-width" let default = 2 let arg_name = "n" let help = "use <n> as the width of the default context for Eva. (defaults to 2)" end) let () = AutomaticContextMaxWidth.set_range ~min:1 ~max:max_int let () = add_correctness_dep AutomaticContextMaxWidth.parameter let () = AutomaticContextMaxWidth.add_aliases ["-context-width"] let () = Parameter_customize.set_group initial_context module AllocatedContextValid = False (struct let option_name = "-eva-context-valid-pointers" let help = "only allocate valid pointers until context-depth, and then use NULL (defaults to false)" end) let () = add_correctness_dep AllocatedContextValid.parameter let () = AllocatedContextValid.add_aliases ["-context-valid-pointers"] let () = Parameter_customize.set_group initial_context module InitializationPaddingGlobals = String (struct let default = "yes" let option_name = "-eva-initialization-padding-globals" let arg_name = "yes|no|maybe" let help = "Specify how padding bits are initialized inside global \ variables. Possible values are <yes> (padding is fully initialized), \ <no> (padding is completely uninitialized), or <maybe> \ (padding may be uninitialized). Default is <yes>." end) let () = InitializationPaddingGlobals.set_possible_values ["yes"; "no"; "maybe"] let () = add_correctness_dep InitializationPaddingGlobals.parameter let () = InitializationPaddingGlobals.add_aliases ["-val-initialization-padding-globals"] (* ------------------------------------------------------------------------- *) (* --- Tuning --- *) (* ------------------------------------------------------------------------- *) (* --- Iteration strategy --- *) let () = Parameter_customize.set_group precision_tuning let () = Parameter_customize.is_invisible () module DescendingIteration = String (struct let default = "no" let option_name = "-eva-descending-iteration" let arg_name = "no|exits|full" let help = "Experimental. After hitting a postfix point, try to improve \ the precision with either a <full> iteration or an iteration from loop \ head to exit paths (<exits>) or do not try anything (<no>). Default \ is <no>." end) let () = DescendingIteration.set_possible_values ["no" ; "exits" ; "full"] let () = add_precision_dep DescendingIteration.parameter let () = Parameter_customize.set_group precision_tuning let () = Parameter_customize.is_invisible () module HierarchicalConvergence = False (struct let option_name = "-eva-hierarchical-convergence" let help = "Experimental and unsound. Separate the convergence process \ of each levels of nested loops. This implies that the convergence of \ inner loops will be completely recomputed when doing another iteration \ of the outer loops." end) let () = add_precision_dep HierarchicalConvergence.parameter let () = Parameter_customize.set_group precision_tuning module WideningDelay = Int (struct let default = 3 let option_name = "-eva-widening-delay" let arg_name = "n" let help = "do not widen before the <n>-th iteration (defaults to 3)" end) let () = WideningDelay.set_range ~min:1 ~max:max_int let () = WideningDelay.add_aliases ["-wlevel"] let () = add_precision_dep WideningDelay.parameter let () = Parameter_customize.set_group precision_tuning module WideningPeriod = Int (struct let default = 2 let option_name = "-eva-widening-period" let arg_name = "n" let help = "after the first widening, widen each <n> iterations (defaults to 2)" end) let () = WideningDelay.set_range ~min:1 ~max:max_int let () = add_precision_dep WideningPeriod.parameter (* --- Partitioning --- *) let () = Parameter_customize.set_group precision_tuning module SemanticUnrollingLevel = Zero (struct let option_name = "-eva-slevel" let arg_name = "n" let help = "superpose up to <n> states when unrolling control flow. The larger n, the more precise and expensive the analysis (defaults to 0)" end) let () = add_precision_dep SemanticUnrollingLevel.parameter let () = SemanticUnrollingLevel.add_aliases ["-slevel"] let () = Parameter_customize.set_group precision_tuning let () = Parameter_customize.argument_may_be_fundecl () module SlevelFunction = Kernel_function_map (struct include Datatype.Int type key = Cil_types.kernel_function let of_string ~key:_ ~prev:_ s = Extlib.opt_map (fun s -> try int_of_string s with Failure _ -> raise (Cannot_build ("'" ^ s ^ "' is not an integer"))) s let to_string ~key:_ = Extlib.opt_map string_of_int end) (struct let option_name = "-eva-slevel-function" let arg_name = "f:n" let help = "override slevel with <n> when analyzing <f>" let default = Kernel_function.Map.empty end) let () = add_precision_dep SlevelFunction.parameter let () = SlevelFunction.add_aliases ["-slevel-function"] let () = Parameter_customize.set_group precision_tuning module SlevelMergeAfterLoop = Kernel_function_set (struct let option_name = "-eva-slevel-merge-after-loop" let arg_name = "f | @all" let help = "when set, the different execution paths that originate from the body \ of a loop are merged before entering the next excution." end) let () = add_precision_dep SlevelMergeAfterLoop.parameter let () = SlevelMergeAfterLoop.add_aliases ["-val-slevel-merge-after-loop"] let () = Parameter_customize.set_group precision_tuning module MinLoopUnroll = Int (struct let option_name = "-eva-min-loop-unroll" let arg_name = "n" let default = 0 let help = "unroll <n> loop iterations for each loop, regardless of the slevel \ settings and the number of states already propagated. \ Can be overwritten on a case by case basis by loop unroll annotations." end) let () = add_precision_dep MinLoopUnroll.parameter let () = MinLoopUnroll.set_range 0 max_int let () = Parameter_customize.set_group precision_tuning module AutoLoopUnroll = Int (struct let option_name = "-eva-auto-loop-unroll" let arg_name = "n" let default = 0 let help = "limit of the automatic loop unrolling: all loops whose \ number of iterations can be easily bounded by <n> \ are completely unrolled." end) let () = add_precision_dep AutoLoopUnroll.parameter let () = AutoLoopUnroll.set_range 0 max_int let () = Parameter_customize.set_group precision_tuning module DefaultLoopUnroll = Int (struct let option_name = "-eva-default-loop-unroll" let arg_name = "n" let default = 100 let help = "defines the default limit for loop unroll annotations that do\ not explicitely provide a limit." end) let () = add_precision_dep DefaultLoopUnroll.parameter let () = DefaultLoopUnroll.set_range 0 max_int let () = Parameter_customize.set_group precision_tuning module HistoryPartitioning = Int (struct let option_name = "-eva-partition-history" let arg_name = "n" let default = 0 let help = "keep states distincts as long as the <n> last branching in their\ traces are also distinct. (A value of 0 deactivates this feature)" end) let () = add_precision_dep HistoryPartitioning.parameter let () = HistoryPartitioning.set_range 0 max_int let () = Parameter_customize.set_group precision_tuning module ValuePartitioning = String_set (struct let option_name = "-eva-partition-value" let help = "partition the space of reachable states according to the \ possible values of the global(s) variable(s) V." let arg_name = "V" end) let () = add_precision_dep ValuePartitioning.parameter let () = Parameter_customize.set_group precision_tuning module SplitLimit = Int (struct let option_name = "-eva-split-limit" let arg_name = "N" let default = 100 let help = "prevents the split annotations or -eva-partition-value to \ enumerate more than N cases" end) let () = add_precision_dep SplitLimit.parameter let () = SplitLimit.set_range 0 max_int let () = Parameter_customize.set_group precision_tuning let () = Parameter_customize.argument_may_be_fundecl () module SplitReturnFunction = Kernel_function_map (struct (* this type is ad-hoc: cannot use Kernel_function_multiple_map here *) include Split_strategy type key = Cil_types.kernel_function let of_string ~key:_ ~prev:_ s = try Extlib.opt_map Split_strategy.of_string s with Split_strategy.ParseFailure s -> raise (Cannot_build ("unknown split strategy " ^ s)) let to_string ~key:_ v = Extlib.opt_map Split_strategy.to_string v end) (struct let option_name = "-eva-split-return-function" let arg_name = "f:n" let help = "split return states of function <f> according to \ \\result == n and \\result != n" let default = Kernel_function.Map.empty end) let () = add_precision_dep SplitReturnFunction.parameter let () = SplitReturnFunction.add_aliases ["-val-split-return-function"] let () = Parameter_customize.set_group precision_tuning module SplitReturn = String (struct let option_name = "-eva-split-return" let arg_name = "mode" let default = "" let help = "when 'mode' is a number, or 'full', this is equivalent \ to -val-split-return-function f:mode for all functions f. \ When mode is 'auto', automatically split states at the end \ of all functions, according to the function return code" end) module SplitGlobalStrategy = State_builder.Ref (Split_strategy) (struct let default () = Split_strategy.NoSplit let name = "Value_parameters.SplitGlobalStrategy" let dependencies = [SplitReturn.self] end) let () = SplitReturn.add_set_hook (fun _ x -> SplitGlobalStrategy.set (try Split_strategy.of_string x with Split_strategy.ParseFailure s -> abort "@[@[incorrect argument for option %s@ (%s).@]" SplitReturn.name s)) let () = add_precision_dep SplitReturn.parameter let () = SplitReturn.add_aliases ["-val-split-return"] (* --- Misc --- *) let () = Parameter_customize.set_group precision_tuning module ILevel = Int (struct let option_name = "-eva-ilevel" let default = 8 let arg_name = "n" let help = "Sets of integers are represented as sets up to <n> elements. \ Above, intervals with congruence information are used \ (defaults to 8, must be between 4 and 128)" end) let () = add_precision_dep ILevel.parameter let () = ILevel.add_aliases ["-val-ilevel"] let () = ILevel.add_update_hook (fun _ i -> Ival.set_small_cardinal i) let () = ILevel.set_range 4 256 let () = Parameter_customize.set_group precision_tuning let () = Parameter_customize.argument_may_be_fundecl () module BuiltinsOverrides = Kernel_function_map (struct include Datatype.String type key = Cil_types.kernel_function let of_string ~key:kf ~prev:_ nameopt = begin match nameopt with | Some name -> if not (!Db.Value.mem_builtin name) then abort "option '-val-builtin %a:%s': undeclared builtin '%s'@.\ declared builtins: @[%a@]" Kernel_function.pretty kf name name (Pretty_utils.pp_list ~sep:",@ " Format.pp_print_string) (List.map fst (!Db.Value.registered_builtins ())) | _ -> abort "option '-val-builtin':@ \ no builtin associated to function '%a',@ use '%a:<builtin>'" Kernel_function.pretty kf Kernel_function.pretty kf end; nameopt let to_string ~key:_ name = name end) (struct let option_name = "-eva-builtin" let arg_name = "f:ffc" let help = "when analyzing function <f>, try to use Frama-C builtin \ <ffc> instead. \ Fall back to <f> if <ffc> cannot handle its arguments." let default = Kernel_function.Map.empty end) let () = add_precision_dep BuiltinsOverrides.parameter let () = BuiltinsOverrides.add_aliases ["-val-builtin"] let () = Parameter_customize.set_group precision_tuning module BuiltinsAuto = True (struct let option_name = "-eva-builtins-auto" let help = "When set, builtins will be used automatically to replace \ known C functions" end) let () = add_correctness_dep BuiltinsAuto.parameter let () = BuiltinsAuto.add_aliases ["-val-builtins-auto"] let () = Parameter_customize.set_group precision_tuning module BuiltinsList = False (struct let option_name = "-eva-builtins-list" let help = "Lists the existing builtins, and which functions they \ are automatically associated to (if any)" end) let () = BuiltinsList.add_aliases ["-val-builtins-list"] let () = Parameter_customize.set_group precision_tuning module LinearLevel = Zero (struct let option_name = "-eva-subdivide-non-linear" let arg_name = "n" let help = "Improve precision when evaluating expressions in which a variable \ appears multiple times, by splitting its value at most n times. \ Defaults to 0." end) let () = add_precision_dep LinearLevel.parameter let () = LinearLevel.add_aliases ["-val-subdivide-non-linear"] let () = Parameter_customize.set_group precision_tuning let () = Parameter_customize.argument_may_be_fundecl () module UsePrototype = Kernel_function_set (struct let option_name = "-eva-use-spec" let arg_name = "f1,..,fn" let help = "use the ACSL specification of the functions instead of their definitions" end) let () = add_precision_dep UsePrototype.parameter let () = UsePrototype.add_aliases ["-val-use-spec"] let () = Parameter_customize.set_group precision_tuning module SkipLibcSpecs = True (struct let option_name = "-eva-skip-stdlib-specs" let help = "skip ACSL specifications on functions originating from the \ standard library of Frama-C, when their bodies are evaluated" end) let () = add_precision_dep SkipLibcSpecs.parameter let () = SkipLibcSpecs.add_aliases ["-val-skip-stdlib-specs"] let () = Parameter_customize.set_group precision_tuning module RmAssert = True (struct let option_name = "-eva-remove-redundant-alarms" let help = "after the analysis, try to remove redundant alarms, so that the user needs inspect fewer of them" end) let () = add_precision_dep RmAssert.parameter let () = RmAssert.add_aliases ["-remove-redundant-alarms"] let () = Parameter_customize.set_group precision_tuning module MemExecAll = True (struct let option_name = "-eva-memexec" let help = "Speed up analysis by not recomputing functions already \ analyzed in the same context. Forces -inout-callwise. \ Callstacks for which the analysis has not been recomputed \ are incorrectly shown as dead in the GUI." end) let () = MemExecAll.add_aliases ["-memexec-all"] let () = MemExecAll.add_set_hook (fun _bold bnew -> if bnew then try Dynamic.Parameter.Bool.set "-inout-callwise" true with Dynamic.Unbound_value _ | Dynamic.Incompatible_type _ -> abort "Cannot set option -eva-memexec. Is plugin Inout registered?" ) let () = Parameter_customize.set_group precision_tuning module ArrayPrecisionLevel = Int (struct let default = 200 let option_name = "-eva-plevel" let arg_name = "n" let help = "use <n> as the precision level for arrays accesses. \ Array accesses are precise as long as the interval for the index contains \ less than n values. (defaults to 200)" end) let () = add_precision_dep ArrayPrecisionLevel.parameter let () = ArrayPrecisionLevel.add_aliases ["-plevel"] let () = ArrayPrecisionLevel.add_update_hook (fun _ v -> Offsetmap.set_plevel v) (* Options SaveFunctionState and LoadFunctionState are related and mutually dependent for sanity checking. Also, they depend on BuiltinsOverrides, so they cannot be defined before it. *) let () = Parameter_customize.set_group initial_context module SaveFunctionState = Kernel_function_map (struct include Datatype.String type key = Cil_types.kernel_function let of_string ~key:_ ~prev:_ file = file let to_string ~key:_ file = file end) (struct let option_name = "-eva-save-fun-state" let arg_name = "function:filename" let help = "save state of function <function> in file <filename>" let default = Kernel_function.Map.empty end) let () = SaveFunctionState.add_aliases ["-val-save-fun-state"] let () = Parameter_customize.set_group initial_context module LoadFunctionState = Kernel_function_map (struct include Datatype.String type key = Cil_types.kernel_function let of_string ~key:_ ~prev:_ file = file let to_string ~key:_ file = file end) (struct let option_name = "-eva-load-fun-state" let arg_name = "function:filename" let help = "load state of function <function> from file <filename>" let default = Kernel_function.Map.empty end) let () = LoadFunctionState.add_aliases ["-val-load-fun-state"] let () = add_correctness_dep SaveFunctionState.parameter let () = add_correctness_dep LoadFunctionState.parameter (* checks that SaveFunctionState has a unique argument pair, and returns it. *) let get_SaveFunctionState () = let is_first = ref true in let (kf, filename) = SaveFunctionState.fold (fun (kf, opt_filename) _acc -> if !is_first then is_first := false else abort "option `%s' requires a single function:filename pair" SaveFunctionState.name; let filename = Extlib.the opt_filename in kf, filename ) (Kernel_function.dummy (), "") in if filename = "" then abort "option `%s' requires a function:filename pair" SaveFunctionState.name else kf, filename (* checks that LoadFunctionState has a unique argument pair, and returns it. *) let get_LoadFunctionState () = let is_first = ref true in let (kf, filename) = LoadFunctionState.fold (fun (kf, opt_filename) _acc -> if !is_first then is_first := false else abort "option `%s' requires a single function:filename pair" LoadFunctionState.name; let filename = Extlib.the opt_filename in kf, filename ) (Kernel_function.dummy (), "") in if filename = "" then abort "option `%s' requires a function:filename pair" LoadFunctionState.name else kf, filename (* perform early sanity checks to avoid aborting the analysis only at the end *) let () = Ast.apply_after_computed (fun _ -> (* check the function to save returns 'void' *) if SaveFunctionState.is_set () then begin let (kf, _) = get_SaveFunctionState () in if not (Kernel_function.returns_void kf) then abort "option `%s': function `%a' must return void" SaveFunctionState.name Kernel_function.pretty kf end; if SaveFunctionState.is_set () && LoadFunctionState.is_set () then begin (* check that if both save and load are set, they do not specify the same function name (note: cannot compare using function ids) *) let (save_kf, _) = get_SaveFunctionState () in let (load_kf, _) = get_LoadFunctionState () in if Kernel_function.equal save_kf load_kf then abort "options `%s' and `%s' cannot save/load the same function `%a'" SaveFunctionState.name LoadFunctionState.name Kernel_function.pretty save_kf end; if LoadFunctionState.is_set () then let (kf, _) = get_LoadFunctionState () in BuiltinsOverrides.add (kf, Some "Frama_C_load_state"); ) (* ------------------------------------------------------------------------- *) (* --- Messages --- *) (* ------------------------------------------------------------------------- *) let () = Parameter_customize.set_group messages module ValShowProgress = False (struct let option_name = "-eva-show-progress" let help = "Show progression messages during analysis" end) let () = ValShowProgress.add_aliases ["-val-show-progress"] let () = Parameter_customize.set_group messages let () = Parameter_customize.is_invisible () module ValShowInitialState = True (struct let option_name = "-val-show-initial-state" (* deprecated in Silicon *) let help = "[deprecated] Show initial state before analysis starts. \ This option has been replaced by \ -value-msg-key=[-]initial-state and has no effect anymore." end) let () = ValShowInitialState.add_set_hook (fun _ new_ -> if new_ then Kernel.warning "@[Option -val-show-initial-state has no effect, \ it has been replaced by -eva-msg-key=initial-state@]" else Kernel.warning "@[Option -no-val-show-initial-state has no effect, \ it has been replaced by -eva-msg-key=-initial-state@]" ) let () = Parameter_customize.set_group messages module ValShowPerf = False (struct let option_name = "-eva-show-perf" let help = "Compute and shows a summary of the time spent analyzing function calls" end) let () = ValShowPerf.add_aliases ["-val-show-perf"] let () = Parameter_customize.set_group messages module ValPerfFlamegraphs = String (struct let option_name = "-eva-flamegraph" let help = "Dumps a summary of the time spent analyzing function calls \ in a format suitable for the Flamegraph tool \ (http://www.brendangregg.com/flamegraphs.html)" let arg_name = "file" let default = "" end) let () = ValPerfFlamegraphs.add_aliases ["-val-flamegraph"] let () = Parameter_customize.set_group messages module ShowSlevel = Int (struct let option_name = "-eva-show-slevel" let default = 100 let arg_name = "n" let help = "Period for showing consumption of the alloted slevel during analysis" end) let () = ShowSlevel.add_aliases ["-val-show-slevel"] let () = ShowSlevel.set_range ~min:1 ~max:max_int let () = Parameter_customize.set_group messages module PrintCallstacks = False (struct let option_name = "-eva-print-callstacks" let help = "When printing a message, also show the current call stack" end) let () = PrintCallstacks.add_aliases ["-val-print-callstacks"] let () = Parameter_customize.set_group messages let () = Parameter_customize.is_invisible () module AlarmsWarnings = True (struct let option_name = "-val-warn-on-alarms" let help = "[DEPRECATED: use warning key alarm to manage alarms] \ if set (default), possible alarms are printed in \ the analysis log as warnings, otherwise as plain feedback" end) let () = AlarmsWarnings.add_set_hook (fun _ f -> match get_warn_status wkey_alarm with | Log.Wabort | Log.Werror | Log.Werror_once -> warning "alarms already set to produce an error. \ Ignoring -val-warn-on-alarms" | Log.Winactive | Log.Wactive | Log.Wfeedback -> set_warn_status wkey_alarm (if f then Log.Wactive else Log.Wfeedback) | Log.Wonce | Log.Wfeedback_once -> (* Keep the 'once' status. Note that this will only happen if user is mixing old and new style of warning management, thus it becomes difficult to interpret the desired action. *) set_warn_status wkey_alarm (if f then Log.Wonce else Log.Wfeedback_once)) let () = Parameter_customize.set_group messages module ReportRedStatuses = String (struct let option_name = "-eva-report-red-statuses" let arg_name = "filename" let default = "" let help = "output the list of \"red properties\" in a csv file of the \ given name. These are the properties which were invalid for \ some states. Their consolidated status may not be invalid, \ but they should often be investigated first." end) let () = Parameter_customize.set_group messages module NumerorsLogFile = String (struct let option_name = "-eva-numerors-log-file" let help = "The Numerors Domain will save each call to the DPRINT \ function in the given file" let arg_name = "file" let default = "" end) let () = Parameter_customize.set_group alarms let () = Parameter_customize.is_invisible () module WarnBuiltinOverride = True(struct let option_name = "-val-warn-builtin-override" let help = "[DEPRECATED: use warning category key '" ^ (wkey_name wkey_builtins_override) ^ "' to control] Warn when Eva built-ins will override function \ definitions" end) let () = add_correctness_dep WarnBuiltinOverride.parameter let () = WarnBuiltinOverride.add_update_hook (fun _ v -> warning "Option %s is deprecated. \ Use warning category key '%a' instead" WarnBuiltinOverride.option_name pp_warn_category wkey_builtins_override; set_warn_status wkey_builtins_override (if v then Log.Wonce else Log.Winactive)) (* ------------------------------------------------------------------------- *) (* --- Interpreter mode --- *) (* ------------------------------------------------------------------------- *) let () = Parameter_customize.set_group interpreter module InterpreterMode = False (struct let option_name = "-eva-interpreter-mode" let help = "Stop at first call to a library function, if main() has \ arguments, on undecided branches" end) let () = InterpreterMode.add_aliases ["-val-interpreter-mode"] let () = Parameter_customize.set_group interpreter let () = Parameter_customize.is_invisible () module ObviouslyTerminatesFunctions = Fundec_set (struct let option_name = "-obviously-terminates-function" let arg_name = "f" let help = "deprecated" end) let () = add_dep ObviouslyTerminatesFunctions.parameter let () = ObviouslyTerminatesFunctions.add_update_hook (fun _ _ -> warning "Option -obviously-terminates-function is no longer supported. \ Ignoring.") let () = Parameter_customize.set_group interpreter let () = Parameter_customize.is_invisible () module ObviouslyTerminatesAll = False (struct let option_name = "-obviously-terminates" let help = "undocumented and deprecated" end) let () = add_dep ObviouslyTerminatesAll.parameter let () = ObviouslyTerminatesAll.add_update_hook (fun _ _ -> warning "Option -obviously-terminates is no longer supported. \ Ignoring.") let () = Parameter_customize.set_group interpreter module StopAtNthAlarm = Int(struct let option_name = "-eva-stop-at-nth-alarm" let default = max_int let arg_name = "n" let help = "Aborts the analysis when the nth alarm is emitted." end) let () = StopAtNthAlarm.add_aliases ["-val-stop-at-nth-alarm"] (* -------------------------------------------------------------------------- *) (* --- Ugliness required for correctness --- *) (* -------------------------------------------------------------------------- *) let () = Parameter_customize.is_invisible () module InitialStateChanged = Int (struct let option_name = "-eva-new-initial-state" let default = 0 let arg_name = "n" let help = "" end) (* Changing the user-supplied initial state (or the arguments of main) through the API of Db.Value does reset the state of Value, but *not* the property statuses that Value has positioned. Currently, statuses can only depend on a command-line parameter. We use the dummy one above to force a reset when needed. *) let () = add_correctness_dep InitialStateChanged.parameter; Db.Value.initial_state_changed := (fun () -> InitialStateChanged.set (InitialStateChanged.get () + 1)) (* -------------------------------------------------------------------------- *) (* --- Eva options --- *) (* -------------------------------------------------------------------------- *) let () = Parameter_customize.set_group precision_tuning module EnumerateCond = Bool (struct let option_name = "-eva-enumerate-cond" let help = "Activate reduce_by_cond_enumerate." let default = true end) let () = add_precision_dep EnumerateCond.parameter let () = Parameter_customize.set_group precision_tuning module OracleDepth = Int (struct let option_name = "-eva-oracle-depth" let help = "Maximum number of successive uses of the oracle by the domain \ for the evaluation of an expression. Set 0 to disable the \ oracle." let default = 2 let arg_name = "" end) let () = add_precision_dep OracleDepth.parameter let () = Parameter_customize.set_group precision_tuning module ReductionDepth = Int (struct let option_name = "-eva-reduction-depth" let help = "Maximum number of successive backward reductions that the \ domain may initiate." let default = 4 let arg_name = "" end) let () = add_precision_dep ReductionDepth.parameter (* -------------------------------------------------------------------------- *) (* --- Dynamic allocation --- *) (* -------------------------------------------------------------------------- *) let () = Parameter_customize.set_group malloc module MallocFunctions= Filled_string_set (struct let option_name = "-eva-malloc-functions" let arg_name = "f1,...,fn" let help = "The malloc builtins use the call site of malloc() to know \ where to create new bases. This detection does not work for \ custom allocators or wrappers on top of malloc, unless they \ are listed here. By default, only contains malloc." let default = Datatype.String.Set.singleton "malloc" end) let () = MallocFunctions.add_aliases ["-val-malloc-functions"] let () = Parameter_customize.set_group malloc module AllocReturnsNull= True (struct let option_name = "-eva-alloc-returns-null" let help = "Memory allocation built-ins (malloc, calloc, realloc) are \ modeled as nondeterministically returning a null pointer" end) let () = AllocReturnsNull.add_aliases ["-val-alloc-returns-null"] let () = Parameter_customize.set_group malloc module MallocLevel = Int (struct let option_name = "-eva-mlevel" let default = 0 let arg_name = "m" let help = "sets to [m] the number of precise dynamic allocations \ besides the initial one, for each callstack (defaults to 0)" end) let () = MallocLevel.add_aliases ["-val-mlevel"] (* -------------------------------------------------------------------------- *) (* --- Meta options --- *) (* -------------------------------------------------------------------------- *) module Precision = Int (struct let option_name = "-eva-precision" let arg_name = "n" let default = -1 let help = "Meta-option that automatically sets up some Eva parameters \ for a quick configuration of an analysis, \ from 0 (fastest but rather imprecise analysis) \ to 11 (accurate but potentially slow analysis)." end) let () = Precision.set_range (-1) 11 let () = add_precision_dep Precision.parameter (* Sets a parameter [P] to [t], unless it has already been set by any other means. *) let set (type t) (module P: Parameter_sig.S with type t = t) = let previous = ref (P.get ()) in fun ~default t -> let already_set = P.is_set () && not (P.equal !previous (P.get ())) in if not already_set then begin if default then P.clear () else P.set t; previous := P.get (); end; let str = Typed_parameter.get_value P.parameter in let str = match P.parameter.Typed_parameter.accessor with | Typed_parameter.String _ -> "\'" ^ str ^ "\'" | _ -> str in printf " option %s %sset to %s%s." P.name (if already_set then "already " else "") str (if already_set && not (P.equal t (P.get ())) then " (not modified)" else if P.is_default () then " (default value)" else "") (* List of configure functions to be called for -eva-precision. *) let configures = ref [] (* Binds the parameter [P] to the function [f] that gives the parameter value for a precision n. *) let bind (type t) (module P: Parameter_sig.S with type t = t) f = let set = set (module P) in configures := (fun n -> set ~default:(n < 0) (f n)) :: !configures (* power 0 1 2 3 4 5 6 7 8 9 10 11 *) let slevel_power = [| 0; 10; 20; 35; 60; 100; 160; 250; 500; 1000; 2000; 5000 |] let ilevel_power = [| 8; 12; 16; 24; 32; 48; 64; 128; 192; 256; 256; 256 |] let plevel_power = [| 10; 20; 40; 70; 100; 150; 200; 300; 500; 700; 1000; 2000 |] let auto_unroll = [| 0; 16; 32; 64; 96; 128; 192; 256; 384; 512; 768; 1024 |] let get array n = if n < 0 then 0 else array.(n) let () = bind (module MinLoopUnroll) (fun n -> max 0 (n - 7)); bind (module AutoLoopUnroll) (get auto_unroll); bind (module WideningDelay) (fun n -> 1 + n / 2); bind (module HistoryPartitioning) (fun n -> (n - 1) / 5); bind (module SemanticUnrollingLevel) (get slevel_power); bind (module ILevel) (get ilevel_power); bind (module ArrayPrecisionLevel) (get plevel_power); bind (module LinearLevel) (fun n -> n * 20); bind (module RmAssert) (fun n -> n > 0); bind (module SymbolicLocsDomain) (fun n -> n > 0); bind (module EqualityDomain) (fun n -> n > 1); bind (module GaugesDomain) (fun n -> n > 2); bind (module SplitReturn) (fun n -> if n > 3 then "auto" else ""); bind (module OctagonDomain) (fun n -> n > 4); bind (module EqualityCall) (fun n -> if n > 4 then "formals" else "none"); bind (module OctagonCall) (fun n -> n > 6); () let set_analysis n = feedback "Option %s %i detected, \ automatic configuration of the analysis:" Precision.name n; List.iter ((|>) n) (List.rev !configures) let configure_precision () = if Precision.is_set () then set_analysis (Precision.get ()) (* -------------------------------------------------------------------------- *) (* --- Freeze parameters. MUST GO LAST --- *) (* -------------------------------------------------------------------------- *) let parameters_correctness = Typed_parameter.Set.elements !parameters_correctness let parameters_tuning = Typed_parameter.Set.elements !parameters_tuning let parameters_abstractions = Typed_parameter.Set.elements !parameters_abstractions (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/value_parameters.mli�����������������������������������������0000666�0000000�0000000�00000022174�13571573400�020647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.General_services module ForceValues: Parameter_sig.With_output module EnumerateCond: Parameter_sig.Bool module OracleDepth: Parameter_sig.Int module ReductionDepth: Parameter_sig.Int module CvalueDomain: Parameter_sig.Bool module EqualityDomain: Parameter_sig.Bool module GaugesDomain: Parameter_sig.Bool module SymbolicLocsDomain: Parameter_sig.Bool module OctagonDomain: Parameter_sig.Bool module BitwiseOffsmDomain: Parameter_sig.Bool module InoutDomain: Parameter_sig.Bool module SignDomain: Parameter_sig.Bool module PrinterDomain: Parameter_sig.Bool module NumerorsDomain: Parameter_sig.Bool module TracesDomain: Parameter_sig.Bool module ApronOctagon: Parameter_sig.Bool module ApronBox: Parameter_sig.Bool module PolkaLoose: Parameter_sig.Bool module PolkaStrict: Parameter_sig.Bool module PolkaEqualities: Parameter_sig.Bool module EqualityCall: Parameter_sig.String module EqualityCallFunction: Parameter_sig.Map with type key = Cil_types.kernel_function and type value = string module OctagonCall: Parameter_sig.Bool module TracesUnrollLoop: Parameter_sig.Bool module TracesUnifyLoop: Parameter_sig.Bool module TracesDot: Parameter_sig.String module TracesProject: Parameter_sig.Bool module EqualityStorage: Parameter_sig.Bool module SymbolicLocsStorage: Parameter_sig.Bool module GaugesStorage: Parameter_sig.Bool module ApronStorage: Parameter_sig.Bool module BitwiseOffsmStorage: Parameter_sig.Bool module AutomaticContextMaxDepth: Parameter_sig.Int module AutomaticContextMaxWidth: Parameter_sig.Int module AllRoundingModesConstants: Parameter_sig.Bool module NoResultsFunctions: Parameter_sig.Fundec_set module ResultsAll: Parameter_sig.Bool module JoinResults: Parameter_sig.Bool module WarnSignedConvertedDowncast: Parameter_sig.Bool module WarnPointerSubstraction: Parameter_sig.Bool module WarnCopyIndeterminate: Parameter_sig.Kernel_function_set module IgnoreRecursiveCalls: Parameter_sig.Bool module DescendingIteration: Parameter_sig.String module HierarchicalConvergence: Parameter_sig.Bool module WideningDelay: Parameter_sig.Int module WideningPeriod: Parameter_sig.Int module SemanticUnrollingLevel: Parameter_sig.Int module SlevelFunction: Parameter_sig.Map with type key = Cil_types.kernel_function and type value = int module SlevelMergeAfterLoop: Parameter_sig.Kernel_function_set module MinLoopUnroll : Parameter_sig.Int module AutoLoopUnroll : Parameter_sig.Int module DefaultLoopUnroll : Parameter_sig.Int module HistoryPartitioning : Parameter_sig.Int module ValuePartitioning : Parameter_sig.String_set module SplitLimit : Parameter_sig.Int module ArrayPrecisionLevel: Parameter_sig.Int module AllocatedContextValid: Parameter_sig.Bool module InitializationPaddingGlobals: Parameter_sig.String module SaveFunctionState: Parameter_sig.Map with type key = Cil_types.kernel_function and type value = string module LoadFunctionState: Parameter_sig.Map with type key = Cil_types.kernel_function and type value = string val get_SaveFunctionState : unit -> Cil_types.kernel_function * string val get_LoadFunctionState : unit -> Cil_types.kernel_function * string module Numerors_Real_Size : Parameter_sig.Int module Numerors_Mode : Parameter_sig.String module UndefinedPointerComparisonPropagateAll: Parameter_sig.Bool module WarnPointerComparison: Parameter_sig.String module ReduceOnLogicAlarms: Parameter_sig.Bool module InitializedLocals: Parameter_sig.Bool module UsePrototype: Parameter_sig.Kernel_function_set module SkipLibcSpecs: Parameter_sig.Bool module RmAssert: Parameter_sig.Bool module LinearLevel: Parameter_sig.Int module BuiltinsOverrides: Parameter_sig.Map with type key = Cil_types.kernel_function and type value = string module BuiltinsAuto: Parameter_sig.Bool module BuiltinsList: Parameter_sig.Bool module SplitReturnFunction: Parameter_sig.Map with type key = Cil_types.kernel_function and type value = Split_strategy.t module SplitGlobalStrategy: State_builder.Ref with type data = Split_strategy.t module ValShowProgress: Parameter_sig.Bool module ValShowInitialState: Parameter_sig.Bool module ValShowPerf: Parameter_sig.Bool module ValPerfFlamegraphs: Parameter_sig.String module ShowSlevel: Parameter_sig.Int module PrintCallstacks: Parameter_sig.Bool module AlarmsWarnings: Parameter_sig.Bool module ReportRedStatuses: Parameter_sig.String module NumerorsLogFile: Parameter_sig.String module WarnBuiltinOverride: Parameter_sig.Bool module MemExecAll: Parameter_sig.Bool module InterpreterMode: Parameter_sig.Bool module StopAtNthAlarm: Parameter_sig.Int (** Dynamic allocation *) module MallocFunctions: Parameter_sig.String_set module AllocReturnsNull: Parameter_sig.Bool module MallocLevel: Parameter_sig.Int (** Meta-option *) module Precision: Parameter_sig.Int (* Automatically sets some parameters according to the meta-option -eva-precision. *) val configure_precision: unit -> unit val parameters_correctness: Typed_parameter.t list val parameters_tuning: Typed_parameter.t list val parameters_abstractions: Typed_parameter.t list (** Debug categories responsible for printing initial and final states of Value. Enabled by default, but can be disabled via the command-line: -value-msg-key="-initial_state,-final_state" *) val dkey_initial_state : category val dkey_final_states : category val dkey_summary : category (** Warning category used when emitting an alarm in "warning" mode. *) val wkey_alarm: warn_category (** Warning category used for the warning "locals escaping scope". *) val wkey_locals_escaping: warn_category (** Warning category used to print garbled mix *) val wkey_garbled_mix: warn_category (** Warning category used for "cannot use builtin due to missing spec" *) val wkey_builtins_missing_spec: warn_category (** Warning category used for "definition overridden by builtin" *) val wkey_builtins_override: warn_category (** Warning category used for calls to libc functions whose specification is currently unsupported. *) val wkey_libc_unsupported_spec : warn_category (** Warning category used for "loop not completely unrolled" *) val wkey_loop_unroll : warn_category (** Warning category used to identify loops without unroll annotations *) val wkey_missing_loop_unroll : warn_category (** Warning category used to identify for loops without unroll annotations *) val wkey_missing_loop_unroll_for : warn_category (** Warning category for signed overflows *) val wkey_signed_overflow : warn_category (** Warning category for 'completely invalid' assigns clause *) val wkey_invalid_assigns : warn_category (** Debug category used to print information about invalid pointer comparisons*) val dkey_pointer_comparison: category (** Debug category used to print the cvalue domain on Frama_C_[dump|show]_each functions. *) val dkey_cvalue_domain: category (* Print non-bottom product of states with no concretization, revealed by an evaluation leading to bottom without alarms. *) val dkey_incompatible_states: category (** Debug category used to print information about the iteration *) val dkey_iterator : category (** Debug category used when using Eva callbacks when recording the results of a function analysis. *) val dkey_callbacks : category (** Debug category used to print the usage of widenings. *) val dkey_widening : category (** Notifies that the binding to Apron domains is available. *) val register_apron: unit -> unit (** Notifies that the numerors domain is available. *) val register_numerors: unit -> unit (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016076� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/abstract_location.mli���������������������������������0000666�0000000�0000000�00000013175�13571573400�022303� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Abstract memory locations of the analysis. *) open Cil_types open Eval type 'v truth = 'v Abstract_value.truth (** Signature of abstract memory locations. *) module type S = sig type value type location (** abstract locations *) type offset (** abstract offsets *) val top: location val equal_loc: location -> location -> bool val equal_offset: offset -> offset -> bool val pretty_loc: Format.formatter -> location -> unit val pretty_offset : Format.formatter -> offset -> unit val to_value : location -> value val size : location -> Int_Base.t (** {3 Alarms } *) (** These functions are used to create the alarms that report undesirable behaviors, when a location abstraction does not meet the prerequisites of an operation. Thereafter, the location is assumed to meet them to continue the analysis. See the documentation of {!Abstract_value.truth} for more details. *) (** Assumes that two locations do not overlap. If [partial] is true, the concrete locations may be equal, but different locations must not overlap. Otherwise, the locations must be completely separate. *) val assume_no_overlap: partial:bool -> location -> location -> (location * location) truth (** Assumes that the given location is valid for a read or write operation, according to the [for_writing] boolean. Used to emit memory access alarms. If the location is not completely valid, reduces it to its valid part. [bitfield] indicates whether the location may be the one of a bitfield; if it is false, the location can be assumed to be byte aligned. *) val assume_valid_location: for_writing:bool -> bitfield:bool -> location -> location truth (** {3 Forward Offset Operations } *) val no_offset : offset (** Computes the field offset of a fieldinfo, with the given remaining offset. The given type must the one of the structure or the union. *) val forward_field : typ -> fieldinfo -> offset -> offset (** [forward_index typ value offset] computes the array index offset of (Index (ind, off)), where the index expression [ind] evaluates to [value] and the remaining offset [off] evaluates to [offset]. [typ] must be the type pointed by the array. *) val forward_index : typ -> value -> offset -> offset (** {3 Forward Locations Operations } *) (** Evaluation of the location of an lvalue, when the offset has already been evaluated. In case of a pointer, its expression has also been evaluated to a value. *) (** Var case in the AST: the host is a variable. *) val forward_variable : typ -> varinfo -> offset -> location or_bottom (** Mem case in the AST: the host is a pointer. *) val forward_pointer : typ -> value -> offset -> location or_bottom val eval_varinfo : varinfo -> location (** {3 Backward Operations } *) (** For an unary forward operation F, the inverse backward operator B tries to reduce the argument values of the operation, given its result. It must satisfy: if [B arg res] = v then ∀ a ⊆ arg such that [F a] ⊆ res, a ⊆ v i.e. [B arg res] returns a value [v] larger than all subvalues of [arg] whose result through F is included in [res]. If [F arg] ∈ [res] is impossible, then [v] should be bottom. Any n-ary operator may be considered as a unary operator on a vector of values, the inclusion being lifted pointwise. *) val backward_variable : varinfo -> location -> offset or_bottom val backward_pointer : value -> offset -> location -> (value * offset) or_bottom val backward_field : typ -> fieldinfo -> offset -> offset or_bottom val backward_index : typ -> index:value -> remaining:offset -> offset -> (value * offset) or_bottom end type 'loc key = 'loc Structure.Key_Location.key (** Signature for a leaf module of abstract locations. *) module type Leaf = sig include S (** The key identifies the module and the type [t] of abstract locations. *) val key: location key end (* Local Variables: compile-command: "make -C ../../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/abstract_value.mli������������������������������������0000666�0000000�0000000�00000021326�13571573400�021604� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Abstract numeric values of the analysis. *) open Cil_types open Eval (** Type for the truth value of an assertion in a value abstraction. The two last tags should be used only for a product of value abstractions. *) type 'v truth = [ `False (* The assertion is always false for the value abstraction, leading to bottom and a red alarm. *) | `Unknown of 'v (* The assertion may be true or false for different concretization of the abstraction. The value is reduced by assuming the assertion. *) | `True (* The assertion is always true for the value abstraction (that cannot be reduced). *) | `TrueReduced of 'v (* The assertion is always true according to a component of a product of values, but other components have been reduced by assuming the assertion. *) | `Unreachable ] (* A product of values was incompatible and has led to inconsistent truth value for the assertion. *) type bound_kind = Alarms.bound_kind = Lower_bound | Upper_bound type bound = Int of Integer.t | Float of float * fkind type pointer_comparison = Equality | Relation | Subtraction (** Signature of abstract numerical values. *) module type S = sig include Datatype.S val pretty_typ: typ option -> t Pretty_utils.formatter (** Pretty the abstract value assuming it has the type given as argument. *) (** {3 Lattice Structure} *) val top : t val is_included : t -> t -> bool val join : t -> t -> t val narrow : t -> t -> t or_bottom (** {3 Constructors } *) val zero: t val one: t val top_int : t val inject_int : typ -> Integer.t -> t (** Abstract address for the given varinfo. (With type "pointer to the type of the variable" if the abstract values are typed.) *) (** {3 Alarms } *) (** These functions are used to create the alarms that report undesirable behaviors, when a value abstraction does not meet the prerequisites of an operation. Thereafter, the value is assumed to meet them to continue the analysis. See the documentation of the [truth] type for more details. *) (* Assumes that the integer value represents only non zero values. *) val assume_non_zero: t -> t truth (* [assume_bounded Lower_bound b v] assumes that the value [v] represents only values greater or equal to the lower bound [b]. [assume_bounded Upper_bound b v] assumes that the value [v] represents only values lower or equal to the greater bound [b]. Depending on the bound, [v] is an integer or a floating-point value. *) val assume_bounded: bound_kind -> bound -> t -> t truth (* Assumes that the floating-point value does not represent NaN. If [assume_finite] is true, assumes that the value represents only finite floating-point values. *) val assume_not_nan: assume_finite:bool -> fkind -> t -> t truth (* [assume_comparable cmp v1 v2] assumes that the integer or pointer values [v1] and [v2] are comparable for [cmp]. Integers are always comparable. If one value is a pointer, then both values should be pointers, and: and according to [cmp]: - if [cmp] is Equality: either one pointer is NULL, or both pointers are valid (pointing into their object), or both pointers are nearly valid (pointing into or just beyond their object) and point to the same object. - if [cmp] is Relation: both pointers should point into or just beyond the same object; - if [cmp] is Subtraction: both pointers should point to the same object, without any restriction on their offsets. *) val assume_comparable: pointer_comparison -> t -> t -> (t * t) truth (** {3 Forward Operations } *) (** Embeds C constants into value abstractions: returns an abstract value for the given constant. The constant cannot be an enumeration constant. *) val constant : exp -> constant -> t (** [forward_unop typ unop v] evaluates the value [unop v], resulting from the application of the unary operator [unop] to the value [v]. [typ] is the type of [v]. *) val forward_unop : typ -> unop -> t -> t or_bottom (** [forward_binop typ binop v1 v2] evaluates the value [v1 binop v2], resulting from the application of the binary operator [binop] to the values [v1] and [v2]. [typ] is the type of [v1]. *) val forward_binop : typ -> binop -> t -> t -> t or_bottom (** [rewrap_integer irange t] wraps around the abstract value [t] to fit the integer range [irange], assuming 2's complement. *) val rewrap_integer: Eval_typ.integer_range -> t -> t (** Abstract evaluation of casts operators from [src_type] to [dst_type]. *) val forward_cast : src_type: Eval_typ.scalar_typ -> dst_type: Eval_typ.scalar_typ -> t -> t or_bottom (** {3 Backward Operations } *) (** For an unary forward operation F, the inverse backward operator B tries to reduce the argument values of the operation, given its result. It must satisfy: if [B arg res] = v then ∀ a ⊆ arg such that [F a] ⊆ res, a ⊆ v i.e. [B arg res] returns a value [v] larger than all subvalues of [arg] whose result through F is included in [res]. If [F arg] ∈ [res] is impossible, then [v] should be bottom. If the value [arg] cannot be reduced, then [v] should be None. Any n-ary operator may be considered as a unary operator on a vector of values, the inclusion being lifted pointwise. *) (** Backward evaluation of the binary operation [left binop right = result]; tries to reduce the argument [left] and [right] according to [result]. [input_type] is the type of [left], [resulting_type] the type of [result]. *) val backward_binop : input_type:typ -> resulting_type:typ -> binop -> left:t -> right:t -> result:t -> (t option * t option) or_bottom (** Backward evaluation of the unary operation [unop arg = res]; tries to reduce the argument [arg] according to [res]. [typ_arg] is the type of [arg]. *) val backward_unop : typ_arg:typ -> unop -> arg:t -> res:t -> t option or_bottom (** Backward evaluation of the cast of the value [src_val] of type [src_typ] into the value [dst_val] of type [dst_typ]. Tries to reduce [scr_val] according to [dst_val]. *) val backward_cast: src_typ: typ -> dst_typ: typ -> src_val: t -> dst_val: t -> t option or_bottom val resolve_functions : t -> Kernel_function.t list or_top * bool (** [resolve_functions v] returns the list of functions that may be pointed to by the abstract value [v] (representing a function pointer). The returned boolean must be [true] if some of the values represented by [v] do not correspond to functions. It is always safe to return [`Top, true]. *) end type 'v key = 'v Structure.Key_Value.key (** Signature for a leaf module of abstract values. *) module type Leaf = sig include S (** The key identifies the module and the type [t] of abstract values. *) val key: t key end (* Local Variables: compile-command: "make -C ../../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/cvalue_backward.ml������������������������������������0000666�0000000�0000000�00000036544�13571573400�021561� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cvalue let propagate_all_comparison typ = not (Cil.isPointerType typ) || Value_parameters.UndefinedPointerComparisonPropagateAll.get () let backward_int_relation typ op v1 v2 = let v1' = V.backward_comp_int_left op v1 v2 in let op' = Abstract_interp.Comp.sym op in let v2' = V.backward_comp_int_left op' v2 v1 in if propagate_all_comparison typ && not (Cvalue_forward.are_comparable op v1 v2) then begin if not (Cvalue.V.equal v1 v1' || Cvalue.V.is_bottom v1') then Value_parameters.result ~current:true ~once:true ~dkey:Value_parameters.dkey_pointer_comparison "not reducing %a to %a because of UPCPA" V.pretty v1 V.pretty v1'; if not (Cvalue.V.equal v2 v2' || Cvalue.V.is_bottom v2') then Value_parameters.result ~current:true ~once:true ~dkey:Value_parameters.dkey_pointer_comparison "not reducing %a to %a because of UPCPA" V.pretty v2 V.pretty v2'; None end else Some (v1', v2') let backward_float_relation fkind ~positive op v1 v2 = let backward_comp = if positive then V.backward_comp_float_left_true else V.backward_comp_float_left_false in let v1' = backward_comp op fkind v1 v2 in let op' = Abstract_interp.Comp.sym op in let v2' = backward_comp op' fkind v2 v1 in Some (v1', v2') let backward_relation typ ~positive op = match Cil.unrollType typ with | TInt _ | TEnum _ | TPtr _ -> let op = if positive then op else Abstract_interp.Comp.inv op in backward_int_relation typ op | TFloat (fk, _) -> backward_float_relation (Fval.kind fk) ~positive op | _ -> assert false (* should never occur anyway *) (* res == v1 +/- v2 *) let backward_add_int typ ~res_value ~v1 ~v2 pos = (* v1 == res -/+ v2 *) let v1' = V.add_untyped Int_Base.(if pos then minus_one else one) res_value v2 (* +/- v2 == res - v1 *) and v2' = if pos then V.add_untyped Int_Base.minus_one res_value v1 else V.add_untyped Int_Base.minus_one v1 res_value in (* TODO: no need for reinterpret if no overflow. *) Some (Cvalue_forward.reinterpret typ v1', Cvalue_forward.reinterpret typ v2') let backward_add_float fk ~res_value ~v1 ~v2 (pos: [`Add|`Sub]) = try let left = V.project_float v1 in let right = V.project_float v2 in let result = V.project_float res_value in let backward = if pos = `Add then Fval.backward_add else Fval.backward_sub in match backward fk ~left ~right ~result with | `Bottom -> Some (V.bottom, V.bottom) | `Value (v1,v2) -> Some (V.inject_float v1, V.inject_float v2) with V.Not_based_on_null -> None (* Backward reduction for (v1 +/- size * v2 == res), where the non-null bases of v1 and v2 cannot interfere with each other, and where res is not a garbled-mix. Decompose each operand into its integer part and its address part. As address part cannot interfere, new integer parts are computed pointwise, and new addresses are computed from the integer part of the other side. *) let unsafe_backward_add_ptr size ~res_value ~v1 ~v2 pos = let scale = Int_Base.project size in let i1 = V.find Base.null v1 in (* Compute the reduced value for v2 = (+/- (res - v1)) / size. *) let i2' = if pos then V.sub_untyped_pointwise res_value v1 else V.sub_untyped_pointwise v1 res_value in let i2' = Ival.scale_div ~pos:false scale i2' in let p2' = (* If the operation is v1 + v2, the offset v2 may be a precise pointer. Otherwise, we would be multiplying an address by a constant, which makes no sense for pointer arithmetics. *) if (Int_Base.equal size Int_Base.one && pos) || (Int_Base.equal size Int_Base.minus_one && not pos) then let factor = Int_Base.minus_one in if pos then V.add_untyped ~factor res_value (Cvalue.V.inject_ival i1) else V.add_untyped ~factor (Cvalue.V.inject_ival i1) res_value else (* Otherwise, the offset may be a garbled mix, if v1 can be an integer. *) if V.is_imprecise v2 && not (Ival.is_bottom i1) then v2 else V.bottom in let v2' = V.add Base.null i2' p2' in let v2 = Cvalue.V.narrow v2 v2' in (* Compute the reduced value for v1 = res +/- size * v2. *) let i2 = V.find Base.null v2 in let factor = if pos then size else Int_Base.neg size in let i1' = V.sub_untyped_pointwise ~factor res_value v2 in let factor = if pos then Int_Base.neg size else size in let p1' = V.add_untyped ~factor res_value (Cvalue.V.inject_ival i2) in let v1 = V.add Base.null i1' p1' in v1, v2 (* v1 +/- v2 == res *) let backward_add_ptr typ ~res_value ~v1 ~v2 pos = (* Remove non-null bases from v1 and v2 which don't appear in the result nor the other operand. *) let reduced = ref false in let remove_lonely_bases ~other:v' v = let test base = let b = Base.is_null base || V.may_reach base v' || V.may_reach base res_value in if not b then reduced := true; b in try V.filter_base test v with Abstract_interp.Error_Top -> v in let v1 = remove_lonely_bases ~other:v2 v1 and v2 = remove_lonely_bases ~other:v1 v2 in let default = if !reduced then Some (v1, v2) else None in (* If the result is imprecise, or the size is zero or top, no more reduction is possible. *) let size = Bit_utils.osizeof_pointed typ in if Int_Base.is_zero size || Int_Base.is_top size || V.is_imprecise res_value then default else match v1, v2 with | V.Map _, V.Map _ -> Some (unsafe_backward_add_ptr size ~res_value ~v1 ~v2 pos) | (V.Top _ as t), V.Map m | V.Map m, (V.Top _ as t) -> (* If the garbled mix contains some non-null base of the map, no further reduction. *) let intersects = V.M.fold (fun b _ acc -> acc || (not (Base.is_null b) && V.may_reach b t)) m false in if intersects then default else Some (unsafe_backward_add_ptr size ~res_value ~v1 ~v2 pos) | V.Top _, V.Top _ -> default let convert default = function | `Bottom -> V.bottom | `Value None -> default | `Value (Some v) -> v (* Correct only when no overflow occurs. *) let _backward_mult typ v1 v2 res_value = let result = res_value in let v1' = Cvalue.V.backward_mult_int_left ~right:v2 ~result and v2' = Cvalue.V.backward_mult_int_left ~right:v1 ~result in let v1 = convert v1 v1' and v2 = convert v2 v2' in Cvalue_forward.reinterpret typ v1, Cvalue_forward.reinterpret typ v2 let backward_band ~v1 ~v2 ~res typ = let size = Cil.bitsSizeOf typ in let signed = Bit_utils.is_signed_int_enum_pointer typ in (* Reduction of a when a & b = res. *) let backward_band_aux a b = (* For each bit, if a & _ = 1 then a = 1. [a1] is [a] with all such bits at 1 (for the others, res = 0 and this bitwise_or has no effect on a). *) let a1 = V.bitwise_or res a in (* For each bit, if a & 1 = 0 then a = 0. [a2] is [a] with all such bits at 0 (for the others, not (xor res b) = 1 and this bitwise_and has no effect on a). *) let a2 = V.bitwise_and a (V.bitwise_not ~size ~signed (V.bitwise_xor res b)) in V.narrow a1 a2 in backward_band_aux v1 v2, backward_band_aux v2 v1 let backward_bor ~v1 ~v2 ~res = (* Reduction of a when a | b = res. *) let backward_bor_aux a b = (* For each bit, if a | _ = 0 then a = 0. [a1] is [a] with all such bits at 0 (for the others, res = 1 and this bitwise_and has no effect on a). *) let a1 = V.bitwise_and res a in (* For each bit, if a | 0 = 1 then a = 1. [a2] is [a] with all such bits at 1 (for the others, xor res b = 0 and this bitwise_or has no effect on a). *) let a2 = V.bitwise_or (V.bitwise_xor res b) a in V.narrow a1 a2 in backward_bor_aux v1 v2, backward_bor_aux v2 v1 let backward_binop ~typ_res ~res_value ~typ_e1 v1 binop v2 = let typ = Cil.unrollType typ_res in match binop, typ with | PlusA, TInt _ -> backward_add_int typ ~res_value ~v1 ~v2 true | MinusA, TInt _ -> backward_add_int typ ~res_value ~v1 ~v2 false | PlusA, TFloat (fk, _) -> backward_add_float (Fval.kind fk) ~res_value ~v1 ~v2 `Add | MinusA, TFloat (fk, _) -> backward_add_float (Fval.kind fk) ~res_value ~v1 ~v2 `Sub | (PlusPI | IndexPI), TPtr _ -> backward_add_ptr typ ~res_value ~v1 ~v2 true | MinusPI, TPtr _ -> backward_add_ptr typ ~res_value ~v1 ~v2 false | MinusPP, TInt _ -> let factor = Bit_utils.osizeof_pointed typ_e1 in let v1 = V.add_untyped factor v2 res_value and v2 = V.add_untyped (Int_Base.neg factor) v1 res_value in Some (v1, v2) (* comparison operators *) | (Eq | Ne | Le | Lt | Ge | Gt), _ -> begin let binop = Value_util.conv_comp binop in match V.is_included V.singleton_zero res_value, V.is_included V.singleton_one res_value with | true, true -> (* comparison evaluates to {0;1}, cannot reduce *) None | false, true -> (* comparison relation holds *) backward_relation (Cil.unrollType typ_e1) ~positive:true binop v1 v2 | true, false -> (* comparison relation does not hold *) backward_relation (Cil.unrollType typ_e1) ~positive:false binop v1 v2 | _ -> assert false (* bottom *) end | (Shiftrt | Shiftlt), TFloat _ -> None | Shiftrt, _ | Shiftlt, _ -> None | Mod, TInt _ -> (* the following equality only holds when v1 does not change sign, which is why we split its range: v1 == (v1 / v2) * v2 + res *) let v1' v1 res = V.add_untyped Int_Base.one res (V.mul (V.div v1 v2) v2) in let ge = Abstract_interp.Comp.Ge and le = Abstract_interp.Comp.Le in let v1_pos = V.backward_comp_int_left ge v1 V.singleton_zero in let res_pos = V.backward_comp_int_left ge res_value V.singleton_zero in let v1'_pos = v1' v1_pos res_pos in let v1_neg = V.backward_comp_int_left le v1 V.singleton_zero in let res_neg = V.backward_comp_int_left le res_value V.singleton_zero in let v1'_neg = v1' v1_neg res_neg in let v1' = V.join v1'_pos v1'_neg in (* v2 *) let v2' = if V.intersects v1 res_value then (* v1 % v2 == v1 => always true for v2 farthest from 0 than v1 *) v2 else (* v2 = (v1 - res) / (v1 / v2) *) V.div (V.add_untyped Int_Base.minus_one v1 res_value) (V.div v1 v2) in Some (v1', v2') (* | Mult, TInt _ -> Some (backward_mult typ v1 v2 res_value) *) | BAnd, TInt _ -> Some (backward_band ~v1 ~v2 ~res:res_value typ) | BOr, TInt _ -> Some (backward_bor ~v1 ~v2 ~res:res_value) | _, _ -> None let backward_unop ~typ_arg op ~arg:_ ~res = match op with | LNot -> None (* handled by the generic mechanism *) | BNot -> None (* No real idea of what should be done *) | Neg -> try let v = V.project_ival res in if Cil.isIntegralType typ_arg then let v = V.inject_ival (Ival.neg_int v) in Some (Cvalue_forward.reinterpret typ_arg v) else begin assert (Cil.isFloatingType typ_arg); let f = Ival.project_float v in Some (V.inject_ival (Ival.inject_float (Fval.neg f))) end with V.Not_based_on_null -> None (* ikind of an (unrolled) integer type *) let ikind = function | TInt (ik, _) | TEnum ({ekind = ik}, _) -> ik | TPtr _ -> Cil.(theMachine.upointKind) | _ -> assert false (* does [v] fits in the integer type corresponding to [ik]? *) let fits_in_ikind ik v = let size = Cil.bitsSizeOfInt ik in let signed = Cil.isSigned ik in let all_values = V.create_all_values ~size ~signed in V.is_included v all_values let downcast_enabled ~ik_src ~ik_dst = if Cil.isSigned ik_dst then Kernel.SignedDowncast.get () || (* In this case, -val-warn-signed-converted-downcast behaves exactly as -warn-signed-downcast *) (Cil.isSigned ik_src && Value_parameters.WarnSignedConvertedDowncast.get ()) else Kernel.UnsignedDowncast.get () (* see .mli *) let backward_cast ~src_typ ~dst_typ ~src_val ~dst_val = (* Kernel.result "%a %a %a %a" Printer.pp_typ src_typ Printer.pp_typ dst_typ V.pretty src_val V.pretty dst_val; *) match dst_typ, src_typ with | (TInt _ | TEnum _ | TPtr _), (TInt _ | TEnum _ | TPtr _) -> let ik_dst = ikind dst_typ in let ik_src = ikind src_typ in if Cil.intTypeIncluded ik_src ik_dst (*the cast is statically the identity*) || downcast_enabled ~ik_src ~ik_dst (* the cast may not be the identity, but the alarms on downcasts ensure that [src_val] must fit in [dst_typ] *) || fits_in_ikind ik_dst src_val (* the cast is dynamically the identity*) then (* in each case, the cast to [dst_typ] is the identity on [src_val]*) Some dst_val else None | TFloat (fk_dst, _), TFloat (fk_src, _) -> begin let f_dst = Fval.kind fk_dst in let f_src = Fval.kind fk_src in match V.project_float dst_val with | exception V.Not_based_on_null -> None | dst_f -> match f_dst, f_src with | (Fval.Double | Fval.Real | Fval.Long_Double), Fval.Single -> begin match Fval.backward_cast_float_to_double dst_f with | `Bottom -> Some V.bottom | `Value fval -> Some (V.inject_float fval) end | (Fval.Real | Fval.Long_Double), Fval.Double -> Some (V.inject_float (Fval.backward_cast_double_to_real dst_f)) | _, _ -> (* downcasts or dummy casts. *) (* beware that we must return a float32 when f_src is float32, so that the result remains "well-typed". This is the case here. *) Some dst_val end | TInt _, TFloat (fkind, _) -> let single_precision = fkind = FFloat in V.cast_float_to_int_inverse ~single_precision dst_val | TFloat (fkind, _), TInt _ -> let single_precision = fkind = FFloat in V.cast_int_to_float_inverse ~single_precision dst_val | _ -> None (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/cvalue_backward.mli�����������������������������������0000666�0000000�0000000�00000005354�13571573400�021725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Abstract reductions on Cvalue.V.t *) open Cvalue open Cil_types (** See !{abstract_value.mli} for details about backward operations. *) (** This function tries to reduce the argument values of a binary operation, given its result. [typ_res] is a type of [res_value], and [typ_e1] the type of [v1]. *) val backward_binop: typ_res:typ -> res_value: V.t -> typ_e1:typ -> V.t -> binop -> V.t -> (V.t * V.t) option (** This function tries to reduce the argument value of an unary operation, given its result. [typ_arg] is the type of [arg]. *) val backward_unop: typ_arg:typ -> unop -> arg: V.t -> res: V.t -> V.t option (** This function tries to reduce the argument of a cast, given the result of the cast. [src_typ] is the type of [src_val], [dst_typ] the type of the cast and of [dst_val]. Returning [None] means that not reduction was possible. Remember that the engine will intersect the result with [src_val], no need to do this ourself. *) val backward_cast: src_typ: typ -> dst_typ: typ -> src_val: V.t -> dst_val: V.t -> V.t option (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/cvalue_forward.ml�������������������������������������0000666�0000000�0000000�00000046535�13571573400�021450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cvalue open Cil_types open Abstract_value (* -------------------------------------------------------------------------- Comparison -------------------------------------------------------------------------- *) (* Literal strings can only be compared if their contents are recognizably different (or the strings are physically the same). *) let are_comparable_string pointer1 pointer2 = try Locations.Location_Bytes.iter_on_strings ~skip:None (fun base1 s1 offs1 len1 -> Locations.Location_Bytes.iter_on_strings ~skip:(Some base1) (fun _ s2 offs2 len2 -> let delta = offs1 - offs2 in let start = if delta <= 0 then -delta else 0 and max = min len2 (len1 - delta) in let length = max - start + 1 in let sub1 = String.sub s1 (start + delta) length and sub2 = String.sub s2 start length in if String.compare sub1 sub2 = 0 then raise Not_found) pointer1) pointer2; true with | Not_found -> false | Invalid_argument _s -> assert false (* Under-approximation of the fact that a pointer is actually correct w.r.t. what can be created through pointer arithmetics. See C99 6.5.6 and 6.5.8 for the definition of possible pointers, and in particular the definition of "one past". Value does not currently check that all pointers are possible, but flags impossible ones using pointer_comparable alarms when performing a comparison. In practice, function pointers are considered possible or one past when their offset is 0. For object pointers, the offset is checked against the validity of each base, taking past-one into account. *) let possible_pointer access location = let location = Locations.loc_bytes_to_loc_bits location in let is_possible_offset base offs = if Base.is_function base then Ival.is_zero offs else Base.is_valid_offset access base offs in Locations.Location_Bits.for_all is_possible_offset location (* Are [ev1] and [ev2] safely comparable, or does their comparison involves invalid pointers, or is undefined (typically pointers in different bases). *) let are_comparable_reason kind ev1 ev2 = let open Locations in (* If both of the operands have arithmetic type, the comparison is valid. *) if Location_Bytes.is_included ev1 Location_Bytes.top_int && Location_Bytes.is_included ev2 Location_Bytes.top_int then true, `Ok else let null_1, rest_1 = Location_Bytes.split Base.null ev1 and null_2, rest_2 = Location_Bytes.split Base.null ev2 in (* Note that here, rest_1 and rest_2 cannot be both bottom. *) let is_bottom1 = Location_Bytes.is_bottom rest_1 and is_bottom2 = Location_Bytes.is_bottom rest_2 in let arith_compare_ok, reason = if kind = Abstract_value.Equality then (* A pointer can be compared to a null pointer constant by equality operators. *) if (Ival.is_included null_1 Ival.zero || is_bottom2) && (Ival.is_included null_2 Ival.zero || is_bottom1) then true, `Ok else false, `Eq_Different_bases_including_null else (* Pointers cannot be compared to arithmetic values by relational operators. *) if Ival.is_bottom null_1 && Ival.is_bottom null_2 then true, `Ok else false, `Rel_Different_bases_including_null in if not arith_compare_ok then false, reason else (* Both pointers have to be almost valid (they can be pointers to one past an array object. *) if (not (possible_pointer Base.No_access rest_1)) || (not (possible_pointer Base.No_access rest_2)) then false, `Invalid_pointer else (* Equality operators allow the comparison between an almost valid pointer and the null pointer (other cases where is_bottom1 or is_bottom2 have been managed by arith_compare_ok). *) if is_bottom1 || is_bottom2 then true, `Ok else (* If both pointers point to the same base, the comparison is valid. *) let single_base_ok = try let base_1, _ = Location_Bytes.find_lonely_key rest_1 and base_2, _ = Location_Bytes.find_lonely_key rest_2 in Base.equal base_1 base_2 with Not_found -> false in if single_base_ok then true, `Ok else if not (kind = Abstract_value.Equality) (* For relational operators, the comparison of pointers on different bases is undefined. *) then false, `Rel_different_bases else (* If both addresses are valid, they can be compared for equality. *) if (possible_pointer (Base.Read Integer.one) rest_1) && (possible_pointer (Base.Read Integer.one) rest_2) then (* But beware of the comparisons of literal strings. *) if are_comparable_string rest_1 rest_2 then true, `Ok else false, `Shareable_strings else false, `Invalid_pointer let pp_incomparable_reason fmt = function | `Ok -> () | `Shareable_strings -> Format.pp_print_string fmt "equality between pointers to strings that may overlap" | `Invalid_pointer -> Format.pp_print_string fmt "invalid pointer(s)" | `Rel_different_bases -> Format.pp_print_string fmt "relational comparison to pointers in different bases" | `Eq_Different_bases_including_null -> Format.pp_print_string fmt "equality between a pointer and a constant" | `Rel_Different_bases_including_null -> Format.pp_print_string fmt "relational comparison between a pointer and a constant" let assume_comparable comparison v1 v2 = let ok = match comparison with | Abstract_value.Equality | Abstract_value.Relation -> let truth, reason = are_comparable_reason comparison v1 v2 in if reason <> `Ok then Value_parameters.result ~current:true ~once:true ~dkey:Value_parameters.dkey_pointer_comparison "invalid pointer comparison: %a" pp_incomparable_reason reason; truth | Abstract_value.Subtraction -> (* TODO: we may be able to reduce the bases that appear only on one side *) try let b1, _ = Cvalue.V.find_lonely_key v1 and b2, _ = Cvalue.V.find_lonely_key v2 in Base.equal b1 b2 with Not_found -> false in if ok then `True else `Unknown (v1, v2) let are_comparable op ev1 ev2 = let kind = match op with | Abstract_interp.Comp.Eq | Abstract_interp.Comp.Ne -> Abstract_value.Equality | _ -> Abstract_value.Relation in fst (are_comparable_reason kind ev1 ev2) (* -------------------------------------------------------------------------- Alarms -------------------------------------------------------------------------- *) let assume_non_zero value = if Cvalue.V.contains_zero value then if Cvalue.V.is_zero value then `False else let value = Cvalue.V.(diff value singleton_zero) in `Unknown value else `True let assume_not_nan ~assume_finite fkind v = let kind = Fval.kind fkind in let evaluate, backward_propagate = if assume_finite then Fval.is_finite, Fval.backward_is_finite ~positive:true else Fval.is_not_nan, fun _fkind -> Fval.backward_is_nan ~positive:false in match Cvalue.V.project_float v with | exception Cvalue.V.Not_based_on_null -> if Cvalue.V.is_bottom v then `True else `Unknown v | res -> match evaluate res with | Abstract_interp.Comp.False -> `False | Abstract_interp.Comp.True -> `True | Abstract_interp.Comp.Unknown -> let res = Bottom.non_bottom (backward_propagate kind res) in `Unknown (V.inject_float res) (* -------------------------------------------------------------------------- Integer overflow -------------------------------------------------------------------------- *) let assume_bounded_fval bound_kind fval_bound fval = let open Abstract_interp.Comp in match bound_kind with | Lower_bound -> Fval.forward_comp Ge fval fval_bound | Upper_bound -> Fval.forward_comp Le fval fval_bound let assume_bounded_float fkind bound_kind bound value = let open Abstract_interp.Comp in try let fval = V.project_float value in let fval_bound = Fval.inject_singleton (Fval.F.of_float bound) in match assume_bounded_fval bound_kind fval_bound fval with | False -> `False | True -> `True | Unknown -> let kind = Fval.kind fkind in let fval = match bound_kind with | Lower_bound -> Fval.backward_comp_left_true Ge kind fval fval_bound | Upper_bound -> Fval.backward_comp_left_true Le kind fval fval_bound in let fval = Bottom.non_bottom fval in `Unknown (Cvalue.V.inject_float fval) with V.Not_based_on_null -> `Unknown value let assume_bounded_ival bound_kind bound ival = let open Abstract_interp.Comp in match bound_kind with | Lower_bound -> Ival.forward_comp_int Ge ival (Ival.inject_singleton bound) | Upper_bound -> Ival.forward_comp_int Le ival (Ival.inject_singleton bound) (* Only reduces the integer part of the cvalue; pointer values are left unchanged. *) let assume_bounded_int bound_kind bound value = let open Abstract_interp.Comp in let ival, pointer = V.split Base.null value in let status = if V.is_bottom pointer then assume_bounded_ival bound_kind bound ival else Unknown in match status with | False -> `False | True -> `True | Unknown -> let range = match bound_kind with | Lower_bound -> Ival.inject_range (Some bound) None | Upper_bound -> Ival.inject_range None (Some bound) in let ival = Ival.narrow ival range in let value = V.add Base.null ival value in assert (not (V.is_bottom value)); `Unknown value let assume_bounded bound_kind bound value = match bound with | Float (fbound, fkind) -> assume_bounded_float fkind bound_kind fbound value | Int ibound -> assume_bounded_int bound_kind ibound value type integer_range = Eval_typ.integer_range = { i_bits: int; i_signed: bool } let rewrap_integer range value = let size = Integer.of_int range.i_bits in V.cast_int_to_int ~signed:range.i_signed ~size value (* -------------------------------------------------------------------------- Binary Operators Evaluation -------------------------------------------------------------------------- *) let forward_minus_pp ~typ ev1 ev2 = let conv minus_offs = try let size = Int_Base.project (Bit_utils.osizeof_pointed typ) in if Integer.is_one size then minus_offs else Ival.scale_div ~pos:true size minus_offs with Abstract_interp.Error_Top -> Ival.top in if not (Value_parameters.WarnPointerSubstraction.get ()) then (* Generate garbled mix if the two pointers disagree on their base *) let minus_val = V.add_untyped Int_Base.minus_one ev1 ev2 in try V.inject_ival (conv (Cvalue.V.project_ival minus_val)) with Cvalue.V.Not_based_on_null -> V.join (V.topify_arith_origin ev1) (V.topify_arith_origin ev2) else (* Pointwise arithmetics.*) let v = V.sub_pointer ev1 ev2 in try V.inject_ival (conv (Cvalue.V.project_ival v)) (* [sub_pointer] returns an ival or a garbled mix. In the later case, no need to topify the result. *) with Cvalue.V.Not_based_on_null -> v (* Evaluation of some operations on Cvalue.V. [typ] is the type of [ev1]. The function must behave as if it was acting on unbounded integers *) let forward_binop_int ~typ ev1 op ev2 = match op with | PlusPI | IndexPI -> V.add_untyped (Bit_utils.osizeof_pointed typ) ev1 ev2 | MinusPI -> let int_base = Int_Base.neg (Bit_utils.osizeof_pointed typ) in V.add_untyped int_base ev1 ev2 | PlusA -> V.add_untyped (Int_Base.one) ev1 ev2 | MinusA -> V.add_untyped Int_Base.minus_one ev1 ev2 | MinusPP -> forward_minus_pp ~typ ev1 ev2 | Mod -> V.c_rem ev1 ev2 | Div -> V.div ev1 ev2 | Mult -> V.mul ev1 ev2 | Shiftrt -> V.shift_right ev1 ev2 | Shiftlt -> V.shift_left ev1 ev2 | BXor -> V.bitwise_xor ev1 ev2 | BOr -> V.bitwise_or ev1 ev2 | BAnd -> V.bitwise_and ev1 ev2 (* Strict evaluation. The caller of this function is supposed to take into account the laziness of those operators itself *) | LOr -> V.interp_boolean ~contains_zero:(V.contains_zero ev1 && V.contains_zero ev2) ~contains_non_zero:(V.contains_non_zero ev1 || V.contains_non_zero ev2) | LAnd -> V.interp_boolean ~contains_zero: (V.contains_zero ev1 || V.contains_zero ev2) ~contains_non_zero:(V.contains_non_zero ev1 && V.contains_non_zero ev2) | Eq | Ne | Ge | Le | Gt | Lt -> let op = Value_util.conv_comp op in let signed = Bit_utils.is_signed_int_enum_pointer (Cil.unrollType typ) in V.inject_comp_result (V.forward_comp_int ~signed op ev1 ev2) let forward_binop_float fkind ev1 op ev2 = match V.project_float ev1, V.project_float ev2 with | exception V.Not_based_on_null -> V.join (V.topify_arith_origin ev1) (V.topify_arith_origin ev2) | f1, f2 -> let binary_float_floats (_name: string) f = V.inject_float (f fkind f1 f2) in match op with | PlusA -> binary_float_floats "+." Fval.add | MinusA -> binary_float_floats "-." Fval.sub | Mult -> binary_float_floats "*." Fval.mul | Div -> binary_float_floats "/." Fval.div | Eq | Ne | Lt | Gt | Le | Ge -> let op = Value_util.conv_comp op in V.inject_comp_result (Fval.forward_comp op f1 f2) | _ -> assert false (* -------------------------------------------------------------------------- Unary Operators Evaluation -------------------------------------------------------------------------- *) (* This function evaluates a unary minus, but does _not_ check for overflows. This is left to the caller *) let forward_uneg v t = try match Cil.unrollType t with | TFloat _ -> let v = V.project_float v in V.inject_ival (Ival.inject_float (Fval.neg v)) | _ -> let v = V.project_ival v in V.inject_ival (Ival.neg_int v) with V.Not_based_on_null -> if Cvalue.V.is_bottom v then v else V.topify_arith_origin v let forward_unop typ op value = match op with | Neg -> forward_uneg value typ | BNot -> begin match Cil.unrollType typ with | TInt (ik, _) | TEnum ({ekind=ik}, _) -> let size = Cil.bitsSizeOfInt ik in let signed = Cil.isSigned ik in V.bitwise_not ~signed ~size value | _ -> assert false end | LNot -> let eq = Abstract_interp.Comp.Eq in (* [!c] holds iff [c] is equal to [O] *) if Cil.isFloatingType typ then try let i = V.project_ival value in let f = Ival.project_float i in V.inject_comp_result (Fval.forward_comp eq f Fval.plus_zero) with V.Not_based_on_null -> V.zero_or_one else let signed = Bit_utils.is_signed_int_enum_pointer typ in V.inject_comp_result (V.forward_comp_int ~signed eq value V.singleton_zero) (* -------------------------------------------------------------------------- Cast -------------------------------------------------------------------------- *) (* Re-export type here *) type scalar_typ = Eval_typ.scalar_typ = | TSInt of integer_range | TSPtr of integer_range | TSFloat of fkind let reinterpret_as_int range v = let size = Integer.of_int range.i_bits in Cvalue.V.reinterpret_as_int ~signed:range.i_signed ~size v let reinterpret typ v = match Eval_typ.classify_as_scalar typ with | Some (TSInt ik | TSPtr ik) -> reinterpret_as_int ik v | Some (TSFloat fk) -> Cvalue.V.reinterpret_as_float fk v | None -> v (* Cast from floating-point to integer. [context] is the expression being cast and its size, to build the alarms. *) let cast_float_to_int irange v = let size = irange.i_bits in let signed = irange.i_signed in Cvalue.V.cast_float_to_int ~signed ~size v let forward_cast ~src_type ~dst_type v = match src_type, dst_type with | TSFloat _, TSFloat dst -> Cvalue.V.cast_float_to_float (Fval.kind dst) v | TSFloat _, (TSInt dst | TSPtr dst) -> cast_float_to_int dst v | (TSInt _ | TSPtr _), TSFloat dst -> Cvalue.V.cast_int_to_float (Fval.kind dst) v | (TSInt _ | TSPtr _), (TSInt _ | TSPtr _) -> v (* -------------------------------------------------------------------------- Misc -------------------------------------------------------------------------- *) let make_volatile ?typ v = let is_volatile = match typ with | None -> true | Some typ -> Cil.typeHasQualifier "volatile" typ in if is_volatile && not (V.is_bottom v) then match v with | V.Top _ -> v | V.Map m -> let aux b _ acc = V.join acc (V.inject b Ival.top) in V.M.fold aux m V.bottom else v let eval_float_constant f fkind fstring = if Fc_float.is_nan f then V.inject_float Fval.nan else let fl, fu = match fstring with | Some string when fkind = Cil_types.FLongDouble || Value_parameters.AllRoundingModesConstants.get () -> let open Floating_point in let {f_lower; f_upper} = snd (parse string) in (* Computations are done in double. For long double constants, if we reach infinity, we must use the interval [max_double..infty] to be sound. Here we even use [-infty..infty]. *) if Fc_float.is_infinite f_lower && Fc_float.is_infinite f_upper then begin Value_util.warning_once_current "cannot parse floating-point constant, returning imprecise result"; neg_infinity, infinity end else f_lower, f_upper | None | Some _ -> f, f in let fl = Fval.F.of_float fl and fu = Fval.F.of_float fu in let af = Fval.inject (Fval.kind fkind) fl fu in V.inject_float af (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/cvalue_forward.mli������������������������������������0000666�0000000�0000000�00000005432�13571573400�021610� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Forward operations on Cvalue.V.t *) open Cvalue open Cil_types open Abstract_value val are_comparable: Abstract_interp.Comp.t -> V.t -> V.t -> bool val assume_non_zero: V.t -> V.t truth val assume_bounded: bound_kind -> bound -> V.t -> V.t truth val assume_not_nan: assume_finite:bool -> fkind -> V.t -> V.t truth val assume_comparable: pointer_comparison -> V.t -> V.t -> (V.t * V.t) truth val forward_binop_int: typ: typ -> V.t -> binop -> V.t -> V.t val forward_binop_float: Fval.kind -> V.t -> binop -> V.t -> V.t val forward_unop: typ -> unop -> V.t -> V.t val rewrap_integer: Eval_typ.integer_range -> V.t -> V.t val reinterpret: typ -> V.t -> V.t val cast_float_to_int: Eval_typ.integer_range -> V.t -> V.t (* Cast from floating-point to integer. *) val forward_cast: src_type:Eval_typ.scalar_typ -> dst_type:Eval_typ.scalar_typ -> V.t -> V.t (** [make_volatile ?typ v] makes the value [v] more general (to account for external modifications), whenever [typ] is [None] or when it has type qualifier [volatile]. *) val make_volatile: ?typ:typ -> V.t -> V.t val eval_float_constant: float -> fkind -> string option -> V.t (* Local Variables: compile-command: "make -C ../../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/location_lift.ml��������������������������������������0000666�0000000�0000000�00000006111�13571573400�021255� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval module type Conversion = sig type extended_value type internal_value val extend_val : internal_value -> extended_value val replace_val : internal_value -> extended_value -> extended_value val restrict_val : extended_value -> internal_value end module Make (Loc: Abstract_location.Leaf) (Convert : Conversion with type internal_value := Loc.value) = struct (* Import most of [Loc] *) include (Loc: Abstract_location.S with type value := Loc.value (* we are converting this type *) and type location = Loc.location and type offset = Loc.offset) type value = Convert.extended_value let structure = Abstract.Location.Leaf (Loc.key, (module Loc)) (* Now lift the functions that contain {!value} in their type. *) let to_value loc = Convert.extend_val (Loc.to_value loc) let forward_index typ value offset = Loc.forward_index typ (Convert.restrict_val value) offset let forward_pointer typ value offset = Loc.forward_pointer typ (Convert.restrict_val value) offset let backward_pointer value offset loc = let v = Convert.restrict_val value in Loc.backward_pointer v offset loc >>-: fun (v, off) -> Convert.replace_val v value, off let backward_index typ ~index:value ~remaining offset = let index = Convert.restrict_val value in Loc.backward_index typ ~index ~remaining offset >>-: fun (v, off) -> Convert.replace_val v value, off end (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/location_lift.mli�������������������������������������0000666�0000000�0000000�00000004317�13571573400�021434� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module type Conversion = sig type extended_value type internal_value val extend_val : internal_value -> extended_value val replace_val : internal_value -> extended_value -> extended_value val restrict_val : extended_value -> internal_value end module Make (Loc: Abstract_location.Leaf) (Convert : Conversion with type internal_value := Loc.value) : Abstract.Location.Internal with type location = Loc.location and type offset = Loc.offset and type value = Convert.extended_value (* Local Variables: compile-command: "make -C ../../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/main_locations.ml�������������������������������������0000666�0000000�0000000�00000024631�13571573400�021435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module PLoc = struct type value = Cvalue.V.t type location = Precise_locs.precise_location type offset = | Precise of Precise_locs.precise_offset | Imprecise of Cvalue.V.t (* when the offset contains addresses *) let key = Structure.Key_Location.create_key "precise_locs" let equal_loc = Precise_locs.equal_loc let equal_offset o1 o2 = match o1, o2 with | Precise o1, Precise o2 -> Precise_locs.equal_offset o1 o2 | Imprecise v1, Imprecise v2 -> Cvalue.V.equal v1 v2 | _, _ -> false let pretty_loc = Precise_locs.pretty_loc let pretty_offset fmt = function | Precise offset -> Precise_locs.pretty_offset fmt offset | Imprecise v -> Format.fprintf fmt "(Imprecise of %a)" Cvalue.V.pretty v let to_value t = let loc = Precise_locs.imprecise_location t in Locations.loc_to_loc_without_size loc let size loc = Precise_locs.loc_size loc let make loc = let ploc_bits = Precise_locs.inject_location_bits loc.Locations.loc in Precise_locs.make_precise_loc ploc_bits ~size:loc.Locations.size let top = make (Locations.make_loc Locations.Location_Bits.top Int_Base.Top) let assume_no_overlap ~partial l1 l2 = let loc1 = Precise_locs.imprecise_location l1 and loc2 = Precise_locs.imprecise_location l2 in if Locations.overlaps ~partial loc1 loc2 then if Locations.(cardinal_zero_or_one loc1 && cardinal_zero_or_one loc2) then `False else `Unknown (l1, l2) else `True (* ------------------------------------------------------------------------ *) (* Offsets *) (* ------------------------------------------------------------------------ *) let no_offset = Precise Precise_locs.offset_zero let forward_field typ field = function | Precise offset -> begin try let field = fst (Cil.bitsOffset typ (Field (field, NoOffset))) in let field_i = Integer.of_int field in Precise (Precise_locs.shift_offset_by_singleton field_i offset) with Cil.SizeOfError _ -> Precise (Precise_locs.offset_top) end | x -> x let forward_index typ_pointed index remaining = match remaining with | Imprecise offset -> let bases = Cvalue.V.topify_arith_origin index in Imprecise (Cvalue.V.join bases offset) | Precise offset -> try let index_i = Cvalue.V.project_ival index in let size = Bit_utils.sizeof typ_pointed in (* Index offsets expressed in terms of the array elements size *) let index_i = Ival.scale_int_base size index_i in (* Combine the two offsets *) Precise (Precise_locs.shift_offset index_i offset) with Cvalue.V.Not_based_on_null -> (* result will be a garbled mix: collect all the bases involved in the evaluation of [offset], and raise an exception *) Imprecise (Cvalue.V.topify_arith_origin index) (* ------------------------------------------------------------------------ *) (* Locations *) (* ------------------------------------------------------------------------ *) let make_precise_loc loc typ_offs = let size = Eval_typ.sizeof_lval_typ typ_offs in let loc = Precise_locs.make_precise_loc loc ~size in if Precise_locs.is_bottom_loc loc then `Bottom else `Value loc let join_loc value loc = let loc = Locations.(Location_Bits.join loc (loc_bytes_to_loc_bits value)) in Precise_locs.inject_location_bits loc let forward_variable typ_offset host offset = let base = Base.of_varinfo host in match offset with | Precise offset -> let loc_pr = Precise_locs.combine_base_precise_offset base offset in make_precise_loc loc_pr typ_offset | Imprecise value -> let loc_b = Locations.Location_Bits.inject base Ival.zero in let loc_pr = join_loc value loc_b in make_precise_loc loc_pr typ_offset let forward_pointer typ_offset loc_lv offset = let loc_bits = Locations.loc_bytes_to_loc_bits loc_lv in match offset with | Precise offset -> let loc_pr = Precise_locs.combine_loc_precise_offset loc_bits offset in make_precise_loc loc_pr typ_offset | Imprecise value -> let loc_pr = join_loc value loc_bits in make_precise_loc loc_pr typ_offset let eval_varinfo varinfo = make (Locations.loc_of_varinfo varinfo) let is_valid access loc = Locations.is_valid access (Precise_locs.imprecise_location loc) let assume_valid_location ~for_writing ~bitfield loc = let access = Locations.(if for_writing then Write else Read) in if not (is_valid access loc) then let loc = Precise_locs.valid_part access ~bitfield loc in if Precise_locs.is_bottom_loc loc then `False else `Unknown loc else `True (* ------------------------------------------------------------------------ *) (* Backward propagators *) (* ------------------------------------------------------------------------ *) (* No backward reduction when the offset is Imprecise. Backward reducers compute offsets as ival. As they are only used to reduce indexes expressions, more precise offsets will be pointless. *) let backward_variable varinfo location = let loc = Precise_locs.imprecise_location location in let base = Base.of_varinfo varinfo in let ival = Locations.(Location_Bits.find base loc.loc) in if Ival.is_bottom ival then `Bottom else `Value (Precise (Precise_locs.inject_ival ival)) let backward_pointer mem offset location = match offset with | Imprecise value -> (* If the offset contains addresses, no reduction. *) `Value (value, offset) | Precise offset -> (* Offsets and locations are expressed in bits but values in bytes, so mem * 8 + offset == location *) let off_ival = Precise_locs.imprecise_offset offset in let loc = Precise_locs.imprecise_location location in let loc = loc.Locations.loc in (* new_off = location - (mem * 8) As the offset does not contain addresses, we can make the pointwise subtraction between the two locations. *) let value_bits = Locations.loc_bytes_to_loc_bits mem in let new_off = Locations.Location_Bits.sub_pointwise loc value_bits in let new_off = Ival.narrow new_off off_ival in let new_off = Precise_locs.inject_ival new_off in (* new_mem = (location - offset) * 8 *) let new_mem = Locations.Location_Bits.shift (Ival.neg_int off_ival) loc in let new_mem = Locations.loc_bits_to_loc_bytes new_mem in if Cvalue.V.is_bottom new_mem || Precise_locs.is_bottom_offset new_off then `Bottom else `Value (new_mem, Precise new_off) let backward_field typ field = function | Imprecise _ as x -> `Value x | Precise offset -> begin try let offset_ival = Precise_locs.imprecise_offset offset in let field = fst (Cil.bitsOffset typ (Field (field, NoOffset))) in let field_i = Integer.of_int (- field) in let ival = Ival.add_singleton_int field_i offset_ival in if Ival.is_bottom ival then `Bottom else `Value (Precise (Precise_locs.inject_ival ival)) with Cil.SizeOfError _ -> `Value (Precise (Precise_locs.offset_top)) end let backward_index typ_pointed ~index ~remaining offset = try match remaining, offset with | Imprecise _, _ | _, Imprecise _ -> `Value (index, remaining) | Precise remaining, Precise offset -> (* Index offsets are expressed in terms of the array elements size, so index * size + remaining == offset *) let off_ival = Precise_locs.imprecise_offset offset in let rem_ival = Precise_locs.imprecise_offset remaining in let index_ival = Cvalue.V.project_ival index in let size = Bit_utils.sizeof typ_pointed in (* new_index = (offset - remaining) / size Beware of zero size. *) let new_index = Ival.sub_int off_ival rem_ival in let new_index = match size with | Int_Base.Top -> Ival.top | Int_Base.Value size -> if Integer.is_zero size then Ival.top else Ival.scale_div ~pos:true size new_index in (* new_remaining = offset - index * size *) let index_i = Ival.scale_int_base size index_ival in let new_rem = Ival.sub_int off_ival index_i in if Ival.is_bottom new_index || Ival.is_bottom new_rem then `Bottom else let index = Cvalue.V.inject_ival new_index and rem = Precise (Precise_locs.inject_ival new_rem) in `Value (index, rem) (* No reduction if the offsets are not arithmetics. *) with Cvalue.V.Not_based_on_null -> `Value (index, remaining) end (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/main_locations.mli������������������������������������0000666�0000000�0000000�00000003657�13571573400�021613� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Main memory locations of Eva: *) (** Abstract locations built over Precise_locs. *) module PLoc : sig include Abstract_location.Leaf with type value = Cvalue.V.t and type location = Precise_locs.precise_location val make: Locations.location -> location end (* Local Variables: compile-command: "make -C ../../../.." End: *) ���������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/main_values.ml����������������������������������������0000666�0000000�0000000�00000015412�13571573400�020736� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module CVal = struct include Cvalue.V let key = Structure.Key_Value.create_key "cvalue" let zero = Cvalue.V.singleton_zero let one = Cvalue.V.singleton_one let top = Cvalue.V.top let top_int = Cvalue.V.top_int let inject_int _typ = Cvalue.V.inject_int let equal = Cvalue.V.equal let is_included = Cvalue.V.is_included let join = Cvalue.V.join let narrow a b = let n = Cvalue.V.narrow a b in if Cvalue.V.is_bottom n then `Bottom else `Value n let assume_non_zero = Cvalue_forward.assume_non_zero let assume_bounded = Cvalue_forward.assume_bounded let assume_not_nan = Cvalue_forward.assume_not_nan let assume_comparable = Cvalue_forward.assume_comparable let constant exp = function | CInt64 (i,_k,_s) -> Cvalue.V.inject_int i | CChr c -> Cvalue.V.inject_int (Cil.charConstToInt c) | CWStr _ | CStr _ -> Cvalue.V.inject (Base.of_string_exp exp) Ival.zero | CReal (f, fkind, fstring) -> Cvalue_forward.eval_float_constant f fkind fstring | CEnum _ -> assert false let forward_unop typ unop value = let value = Cvalue_forward.forward_unop typ unop value in (* TODO: `Bottom must be in CValue and Cvalue_forward. *) if Cvalue.V.is_bottom value then `Bottom else `Value value let forward_binop typ binop v1 v2 = let value = match typ with | TFloat (fkind, _) -> Cvalue_forward.forward_binop_float (Fval.kind fkind) v1 binop v2 | TInt _ | TPtr _ | _ as typ -> Cvalue_forward.forward_binop_int ~typ v1 binop v2 in if Cvalue.V.is_bottom value then `Bottom else `Value value let rewrap_integer = Cvalue_forward.rewrap_integer let forward_cast ~src_type ~dst_type v = let v = Cvalue_forward.forward_cast ~src_type ~dst_type v in if Cvalue.V.is_bottom v then `Bottom else `Value v let backward_binop ~input_type ~resulting_type binop ~left ~right ~result = let reduction = Cvalue_backward.backward_binop ~typ_res:resulting_type ~res_value:result ~typ_e1:input_type left binop right in match reduction with | None -> `Value (None, None) | Some (v1, v2) -> if Cvalue.V.is_bottom v1 || Cvalue.V.is_bottom v2 then `Bottom else `Value (Some v1, Some v2) let backward_unop ~typ_arg op ~arg ~res = let reduction = Cvalue_backward.backward_unop ~typ_arg op ~arg ~res in match reduction with | None -> `Value None | Some v as r -> if Cvalue.V.is_bottom v then `Bottom else `Value r let backward_cast ~src_typ ~dst_typ ~src_val ~dst_val = let reduction = Cvalue_backward.backward_cast ~src_typ ~dst_typ ~src_val ~dst_val in match reduction with | None -> `Value None | Some v -> if Cvalue.V.is_bottom v then `Bottom else if Cvalue.V.is_included src_val v then `Value None else `Value (Some v) let resolve_functions v = let aux base offs (acc, alarm) = match base with | Base.String (_,_) | Base.Null | Base.CLogic_Var _ | Base.Allocated _ -> acc, true | Base.Var (v,_) -> if Cil.isFunctionType v.vtype then let alarm = alarm || Ival.contains_non_zero offs in let kf = Globals.Functions.get v in let list = if Ival.contains_zero offs then kf :: acc else acc in list, alarm else acc, true in try let init = [], false in let kfs, alarm = Locations.Location_Bytes.fold_topset_ok aux v init in `Value kfs, alarm with Abstract_interp.Error_Top -> `Top, true end module Interval = struct include Datatype.Option (Ival) let key = Structure.Key_Value.create_key "interval" let pretty_typ _ = pretty let top = None let is_included a b = match a, b with | _, None -> true | None, _ -> false | Some a, Some b -> Ival.is_included a b let join a b = match a, b with | None, _ | _, None -> None | Some a, Some b -> Some (Ival.join a b) let narrow a b = match a, b with | None, x | x, None -> `Value x | Some a, Some b -> let res = Ival.narrow a b in if Ival.is_bottom res then `Bottom else `Value (Some res) let zero = None let one = None let top_int = None let inject_int _typ i = Some (Ival.inject_singleton i) let assume_non_zero v = `Unknown v let assume_bounded _ _ v = `Unknown v let assume_not_nan ~assume_finite:_ _ v = `Unknown v let assume_comparable _ v1 v2 = `Unknown (v1, v2) let constant _ _ = top let forward_unop _ _ _ = `Value top let forward_binop _ _ _ _ = `Value top let forward_cast ~src_type:_ ~dst_type:_ _ = `Value top let resolve_functions _ = `Top, true let rewrap_integer range value = match value with | None -> value | Some value -> let size = Integer.of_int range.Eval_typ.i_bits in let signed = range.Eval_typ.i_signed in Some (Ival.cast_int_to_int ~signed ~size value) let backward_unop ~typ_arg:_ _unop ~arg:_ ~res:_ = `Value None let backward_binop ~input_type:_ ~resulting_type:_ _binop ~left:_ ~right:_ ~result:_ = `Value (None, None) let backward_cast ~src_typ:_ ~dst_typ:_ ~src_val:_ ~dst_val:_ = `Value None end (* Local Variables: compile-command: "make -C ../../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/main_values.mli���������������������������������������0000666�0000000�0000000�00000003666�13571573400�021117� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Main numeric values of Eva. *) (** Abstract values built over Cvalue.V *) module CVal : Abstract_value.Leaf with type t = Cvalue.V.t (** Dummy interval: no forward nor backward propagations. [None] is top. *) module Interval : Abstract_value.Leaf with type t = Ival.t option (* Local Variables: compile-command: "make -C ../../../.." End: *) ��������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/���������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017750� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_arithmetics.ml����������������������0000666�0000000�0000000�00000065140�13571573400�024556� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval open Numerors_utils module P = Precisions module F = Numerors_float module I = Numerors_interval (* Type declaration *) type t = { exact : I.t ; approx : I.t ; abs_err : I.t ; rel_err : I.t } (* Printer *) let pretty fmt t = Format.fprintf fmt "@[Exact : %a@ Approx : %a :: %a@ Abs Err : %a@ Rel Err : %a@]" I.pretty t.exact I.pretty t.approx P.pretty (I.prec t.approx) I.pretty t.abs_err I.pretty t.rel_err (* Zero *) let zero t = let z = I.zero ~prec:P.Real in let prec = I.prec t.approx in { exact = z ; approx = I.zero ~prec ; abs_err = z ; rel_err = z } (* Precision *) let prec t = I.prec t.approx (* Creation *) let create exact approx abs_err rel_err = { exact ; approx ; abs_err ; rel_err } (*----------------------------------------------------------------------------- * Iterator *---------------------------------------------------------------------------*) let iterate (facc, init) felt t1 t2 = let to_l t = [ t.exact ; t.approx ; t.abs_err ; t.rel_err ] in List.fold_left2 (fun acc x y -> facc (felt x y) acc) init (to_l t1) (to_l t2) let apply f x y = { exact = f x.exact y.exact ; approx = f x.approx y.approx ; abs_err = f x.abs_err y.abs_err ; rel_err = f x.rel_err y.rel_err } (*----------------------------------------------------------------------------- * Lattice methods *---------------------------------------------------------------------------*) let is_included = iterate ((&&), true) (I.is_included) let join = apply I.join let narrow x y = I.narrow x.exact y.exact >>- fun exact -> I.narrow x.approx y.approx >>- fun approx -> I.narrow x.abs_err y.abs_err >>- fun abs_err -> I.narrow x.rel_err y.rel_err >>- fun rel_err -> `Value { exact ; approx ; abs_err ; rel_err } (*----------------------------------------------------------------------------- * Comparison *---------------------------------------------------------------------------*) let compare x y = let f c acc = if acc = 0 then c else acc in iterate (f, 0) I.compare x y (*----------------------------------------------------------------------------- * Miscellaneous *---------------------------------------------------------------------------*) (* Returns the precision of all the elements of <l> if they all share the * same. Stop the program if not. *) let ( >>+ ) l f = assert (l != []) ; let p = I.prec (List.hd l).approx in let iterator x = assert (P.eq p (I.prec x.approx)) in List.iter iterator (List.tl l) ; f p (* Use to return the results of the backward operators *) let generic_backward (a, a') (b, b') = let x = I.narrow a a' in let y = I.narrow b b' in x >>- fun x -> y >>- fun y -> `Value (x, y) (* Returns the narrow of the operands at the precision of reals. * Asserts that it does not result in a bottom *) let non_bottom_narrow a b = match I.narrow a b with | `Value v -> v | `Bottom -> Value_parameters.fatal "Numerors: a narrowing leads incorrectly to bottom.@ \ Narrow between %a@ and %a." I.pretty a I.pretty b (* NaN have no meaning for absolute or relative errors: if the computation of an error leads to NaN, use top instead to ensure soundness. *) let handle_nan_errors r = if I.contains_nan r then I.top ~prec:P.Real else r (* Narrow errors [x] and [y]. *) let narrow_errors x y = non_bottom_narrow (handle_nan_errors x) (handle_nan_errors y) (* Interval containing the singleton 1.0 *) let one = I.of_ints ~prec:P.Real (1, 1) (* Internal : constant 2 *) let two = F.of_int 2 (* Change the precisions *) let change_prec prec t = let approx = I.change_prec prec t.approx in if I.is_nan t.approx then { t with approx ; abs_err = I.top P.Real ; rel_err = I.top P.Real } else let epsilon = F.machine_epsilon prec in let abs_err = let diff = let calc = I.sub approx t.approx in let default = let ufp = F.pow_int two (I.get_max_exponent t.approx) in let t = F.mul ufp epsilon in I.of_numerors_floats (F.neg t, t) in narrow_errors calc default in I.add diff t.abs_err and rel_err = I.of_numerors_floats (F.neg epsilon, epsilon) in { exact = t.exact ; approx ; abs_err ; rel_err } (* Rounding error of transcendental functions. We suppose that this rounding error can be seen using the rounding model of the article amplified by a coefficient. Actually, this coefficient is set to one, but it will become a parameter of Numerors in the future. *) let rnd_err prec exact = let lambda = I.of_floats ~prec:P.Real (1., 1.) in let epsilon = let e = F.machine_epsilon prec in I.mul lambda @@ I.of_numerors_floats (F.neg e, e) and delta = let d = F.machine_delta prec in I.mul lambda @@ I.of_numerors_floats (F.neg d, d) in I.add (I.mul epsilon exact) delta (* Elementary Rounding Errors *) module Elementary : sig val abs : prec:P.t -> I.t -> I.t val rel : prec:P.t -> I.t -> I.t end = struct (* Get machine constants depending of the input interval *) let machine_constants p itv = if not (I.is_zero itv) then (* Computation of the smallest normalized number in the format *) let norm = F.pow two (F.sub two (F.pow_int two ((P.exponent p) - 1))) in (* This value will be set to the machine delta of the precision if the interval contains at least a subnormal number *) let machine_delta = let del_itv = I.of_numerors_floats (F.neg norm, norm) in match I.narrow del_itv itv with | `Value _ -> Some (F.machine_delta p) | `Bottom -> None in (* This value will be set to the machine epsilon of the precision if the interval contains at least a normalized number *) let machine_epsilon = let neg_part = I.of_numerors_floats (F.neg_inf P.Real, F.neg norm) in let pos_part = I.of_numerors_floats (norm, F.pos_inf P.Real) in match I.narrow neg_part itv, I.narrow itv pos_part with | `Value _, _ | _, `Value _ -> Some (F.machine_epsilon p) | `Bottom, `Bottom -> None in machine_epsilon, machine_delta else None, None (* Elementary absolute rounding error *) let abs ~prec old_itv = match I.make_finite ~prec old_itv with | `Bottom -> I.nan ~prec:P.Real | `Value itv -> let epsilon_opt, delta_opt = machine_constants prec itv in let epsilon_part = match epsilon_opt with | Some epsilon -> (* As developped in the corresponding article, the normalized part of the elementary rounding error is computed as ufp([x])*[machine_epsilon] *) let ufp = F.pow_int two (I.get_max_exponent itv) in let t = F.mul ufp epsilon in I.of_numerors_floats (F.neg t, t) | None -> I.zero P.Real in let delta_part = match delta_opt with | Some delta -> I.of_numerors_floats (F.neg delta, delta) | None -> I.zero P.Real in let res = I.join epsilon_part delta_part in if not (I.eq old_itv itv) then I.add_nan res else res (* Elementary relative rounding error *) let rel ~prec old_itv = match I.make_finite ~prec old_itv with | `Bottom -> I.nan ~prec:P.Real | `Value itv -> let epsilon_opt, delta_opt = machine_constants prec itv in let epsilon_part = match epsilon_opt with | Some epsilon -> (* The maximum of (ufp([x])/[x]) can be optimized for intervals of values of the same exponent. *) let max_ufp = let one = F.of_int 1 and x, y = I.get_bounds (I.abs itv) in let is_framed = F.exponent x = F.exponent y in if is_framed && not (I.contains_a_zero itv) then F.div one @@ F.significand x else one in let t = F.mul max_ufp epsilon in I.of_numerors_floats (F.neg t, t) | None -> I.zero P.Real in let delta_part = match delta_opt with | Some delta -> let one = I.of_ints ~prec:P.Real (-1, 1) in let r = I.div (I.of_numerors_floats (F.neg delta, delta)) itv in non_bottom_narrow r one | None -> I.zero P.Real in let res = I.join epsilon_part delta_part in if not (I.eq old_itv itv) then I.add_nan res else res end (*----------------------------------------------------------------------------- * Interaction mode handling *---------------------------------------------------------------------------*) let forward_interaction t = let fzero a b c = if I.is_zero a && I.is_zero b then a else if (I.is_pos_inf b || I.is_neg_inf b) && I.is_zero a then a else c in let abs = fzero t.rel_err t.exact (I.mul t.rel_err t.exact) in let rel = fzero t.abs_err t.exact (I.div t.abs_err t.exact) in let abs_err, rel_err = match Mode.get () with | Mode.No_Interaction -> t.abs_err, t.rel_err | Mode.Abs_From_Rel -> abs, t.rel_err | Mode.Rel_From_Abs -> t.abs_err, rel | Mode.With_Interactions -> non_bottom_narrow t.abs_err abs, non_bottom_narrow t.rel_err rel in create t.exact t.approx abs_err rel_err (*----------------------------------------------------------------------------- * Arithmetic definition *---------------------------------------------------------------------------*) module type Arithmetic = sig (* Type returned by the forward operations *) type forward module Forward : sig val neg : t -> forward val log : t -> forward val exp : t -> forward val sqrt : t -> forward val add : t -> t -> forward val sub : t -> t -> forward val mul : t -> t -> forward val div : t -> t -> forward end module Backward : sig val neg : t -> t -> I.t or_bottom val add : t -> t -> t -> (I.t * I.t) or_bottom val sub : t -> t -> t -> (I.t * I.t) or_bottom val mul : t -> t -> t -> (I.t * I.t) or_bottom val div : t -> t -> t -> (I.t * I.t) or_bottom end end (*----------------------------------------------------------------------------- * Arithmetic for the calculations on reals *---------------------------------------------------------------------------*) module Exact : Arithmetic with type forward = I.t = struct type forward = I.t module Forward = struct let neg v = I.neg v.exact let log v = I.log v.exact let exp v = I.exp v.exact let sqrt v = I.sqrt v.exact let add x y = [x ; y] >>+ fun _ -> I.add x.exact y.exact let sub x y = [x ; y] >>+ fun _ -> I.sub x.exact y.exact let mul x y = [x ; y] >>+ fun _ -> I.mul x.exact y.exact let div x y = [x ; y] >>+ fun _ -> I.div x.exact y.exact end module Backward = struct let neg x r = [x ; r] >>+ fun _ -> I.narrow x.exact (I.neg r.exact) let add x y r = [x ; y ; r] >>+ fun _ -> I.backward_add ~prec:P.Real ~left:x.exact ~right:y.exact ~result:r.exact let sub x y r = [x ; y ; r] >>+ fun _ -> I.backward_sub ~prec:P.Real ~left:x.exact ~right:y.exact ~result:r.exact let mul x y r = [x ; y ; r] >>+ fun _ -> I.backward_mul ~prec:P.Real ~left:x.exact ~right:y.exact ~result:r.exact let div x y r = [x ; y ; r] >>+ fun _ -> I.backward_div ~prec:P.Real ~left:x.exact ~right:y.exact ~result:r.exact end end (*----------------------------------------------------------------------------- * Arithmetic for the calculations on reals *---------------------------------------------------------------------------*) module Approx : Arithmetic with type forward = I.t = struct type forward = I.t module Forward = struct let neg v = I.neg v.approx let log v = I.log ~prec:(I.prec v.approx) v.approx let exp v = I.exp ~prec:(I.prec v.approx) v.approx let sqrt v = I.sqrt ~prec:(I.prec v.approx) v.approx let add x y = [x ; y] >>+ fun prec -> I.add ~prec x.approx y.approx let sub x y = [x ; y] >>+ fun prec -> I.sub ~prec x.approx y.approx let mul x y = [x ; y] >>+ fun prec -> I.mul ~prec x.approx y.approx let div x y = [x ; y] >>+ fun prec -> I.div ~prec x.approx y.approx end module Backward = struct let neg x r = [x ; r] >>+ fun _ -> I.narrow x.approx (I.neg r.approx) let add x y r = [x ; y ; r] >>+ fun prec -> I.backward_add ~prec ~left:x.approx ~right:y.approx ~result:r.approx let sub x y r = [x ; y ; r] >>+ fun prec -> I.backward_sub ~prec ~left:x.approx ~right:y.approx ~result:r.approx let mul x y r = [x ; y ; r] >>+ fun prec -> I.backward_mul ~prec ~left:x.approx ~right:y.approx ~result:r.approx let div x y r = [x ; y ; r] >>+ fun prec -> I.backward_div ~prec ~left:x.approx ~right:y.approx ~result:r.approx end end (*----------------------------------------------------------------------------- * Arithmetic for the calculations on absolute errors *---------------------------------------------------------------------------*) module Abs_Err : Arithmetic with type forward = exact:I.t -> approx:I.t -> I.t = struct type forward = exact:I.t -> approx:I.t -> I.t module Forward = struct let neg v ~exact:_ ~approx:_ = I.neg v.abs_err let log v ~exact ~approx = let naive = I.sub approx exact in let rnd = rnd_err (I.prec v.approx) exact in let err = I.add (I.log (I.add one v.rel_err)) rnd in narrow_errors naive err let exp v ~exact ~approx = let naive = I.sub approx exact in let rnd = rnd_err (I.prec v.approx) exact in let err = I.add (I.mul (I.sub (I.exp v.abs_err) one) v.exact) rnd in narrow_errors naive err let sqrt v ~exact ~approx = let naive = I.sub approx exact in let t = match Mode.get () with | Mode.With_Interactions -> I.sqrt (I.add v.rel_err one) | _ -> I.sqrt (I.add (I.div v.abs_err v.exact) one) in let g = Elementary.abs ~prec:(I.prec v.approx) (I.sqrt v.approx) in let err = I.add (I.mul (I.sqrt v.exact) (I.sub t one)) g in narrow_errors naive err let add x y ~exact ~approx = [x ; y] >>+ fun p -> let naive = I.sub approx exact in let ulp = Elementary.abs ~prec:p (I.add x.approx y.approx) in let err = I.add (I.add x.abs_err y.abs_err) ulp in narrow_errors naive err let sub x y ~exact ~approx = [x ; y] >>+ fun p -> let naive = I.sub approx exact in let ulp = Elementary.abs ~prec:p (I.sub x.approx y.approx) in let err = I.add (I.sub x.abs_err y.abs_err) ulp in narrow_errors naive err let mul x y ~exact ~approx = [x ; y] >>+ fun p -> let naive = I.sub approx exact in let ulp = Elementary.abs ~prec:p (I.mul x.approx y.approx) in let res = I.add (I.mul x.exact y.abs_err) (I.mul y.exact x.abs_err) in let err = I.add (I.add res (I.mul x.abs_err y.abs_err)) ulp in (* let err_2 = let f x y = let fxey = I.mul x.approx y.abs_err in let ryex = I.mul y.exact x.abs_err in I.add (I.add fxey ryex) ulp in narrow_errors (f x y) (f y x) in narrow_errors (narrow_errors err_1 err_2) naive *) narrow_errors naive err let div x y ~exact ~approx = [x ; y] >>+ fun p -> let naive = I.sub approx exact in let ulp = Elementary.abs ~prec:p (I.div x.approx y.approx) in let err = if Mode.get () = Mode.With_Interactions then let num = I.sub x.abs_err (I.mul x.exact y.rel_err) in I.add (I.div num y.approx) ulp else let h = let a = I.div x.abs_err y.approx in let num = I.mul x.exact y.abs_err in let ry2 = I.square y.exact in let den = I.mul ry2 (I.add one (I.div y.abs_err y.exact)) in I.sub a (I.div num den) in let g = let t = I.mul (I.div x.exact y.exact) y.abs_err in I.div (I.sub x.abs_err t) y.approx in I.add (narrow_errors h g) ulp in narrow_errors naive err end module Backward = struct let neg x r = [x ; r] >>+ fun _ -> I.narrow x.abs_err (I.neg r.abs_err) let add x y r = [x ; y ; r] >>+ fun p -> let ulp = Elementary.abs ~prec:p (I.add x.approx y.approx) in let r = I.sub r.abs_err ulp in let x' = x.abs_err, I.sub r y.abs_err in let y' = y.abs_err, I.sub r x.abs_err in generic_backward x' y' let sub x y r = [x ; y ; r] >>+ fun p -> let ulp = Elementary.abs ~prec:p (I.sub x.approx y.approx) in let r = I.sub r.abs_err ulp in let x' = x.abs_err, I.add r y.abs_err in let y' = y.abs_err, I.sub x.abs_err r in generic_backward x' y' let mul x y r = [x ; y ; r] >>+ fun p -> let ulp = Elementary.abs ~prec:p (I.mul x.approx y.approx) in let r = I.sub r.abs_err ulp in let err_1 x y = I.div (I.sub r (I.mul x.approx y.abs_err)) y.exact in let err_2 x y = I.div (I.sub r (I.mul x.exact y.abs_err)) y.approx in let calc x y = x.abs_err, non_bottom_narrow (err_1 x y) (err_2 x y) in generic_backward (calc x y) (calc y x) let div x y r = [x ; y ; r] >>+ fun p -> let ulp = Elementary.abs ~prec:p (I.div x.approx y.approx) in let r = I.sub r.abs_err ulp in let t = I.mul (I.div x.exact y.exact) y.abs_err in let err_1_x = I.add (I.mul y.approx r) t in let t = I.add one (I.div y.abs_err y.exact) in let t = I.mul (I.square y.exact) t in let t = I.div (I.mul x.exact y.abs_err) t in let err_2_x = I.mul y.approx (I.add r t) in let x' = x.abs_err, non_bottom_narrow err_1_x err_2_x in let t = I.div y.exact x.exact in let err_1_y = I.mul t (I.sub x.abs_err (I.mul y.approx r)) in let t1 = I.mul y.exact (I.sub (I.div x.abs_err y.approx) r) in let e1 = I.div y.exact (I.sub (I.div x.exact t1) one) in let t2 = I.square y.exact in let t2 = I.mul t2 (I.sub (I.div x.abs_err y.approx) r) in let e2 = I.div t2 (I.sub x.exact t1) in let err_2_y = non_bottom_narrow e1 e2 in let y' = y.abs_err, non_bottom_narrow err_1_y err_2_y in generic_backward x' y' end end (*----------------------------------------------------------------------------- * Arithmetic for the calculations on relative errors *---------------------------------------------------------------------------*) module Rel_Err : Arithmetic with type forward = exact:I.t -> abs_err:I.t -> I.t = struct type forward = exact:I.t -> abs_err:I.t -> I.t (* Verify if the input are exactly zero *) let is_perfect_zero x = I.is_zero x.exact && I.is_zero x.approx && I.is_zero x.abs_err && I.is_zero x.rel_err (* Type of an operator *) type operator = ?prec:P.t -> I.t -> I.t -> I.t module Forward = struct (* Generic function for forward addition and substraction *) let add_or_sub_forward (op : operator) x y p = let g = Elementary.rel ~prec:p (op x.approx y.approx) in let den = op one (I.div y.exact x.exact) in let num = I.sub x.rel_err y.rel_err in let t = I.add g one in I.add (I.mul (I.add (I.div num den) y.rel_err) t) g let neg v ~exact:_ ~abs_err:_ = v.rel_err let log _v ~exact ~abs_err = let naive = I.div abs_err exact in handle_nan_errors naive let exp _v ~exact ~abs_err = let naive = I.div abs_err exact in handle_nan_errors naive let sqrt v ~exact ~abs_err = let p = I.prec v.approx in let naive = I.div abs_err exact in let g = I.add (Elementary.rel p (I.sqrt v.approx)) one in let err = I.sub (I.mul (I.sqrt (I.add v.rel_err one)) g) one in narrow_errors naive err let add x y ~exact ~abs_err = [x ; y] >>+ fun p -> if not (is_perfect_zero x && is_perfect_zero y) then let naive = I.div abs_err exact in let err_1 = add_or_sub_forward I.add x y p in let err_2 = add_or_sub_forward I.add y x p in List.fold_left narrow_errors naive [err_1 ; err_2] else I.zero ~prec:P.Real let sub x y ~exact ~abs_err = [x ; y] >>+ fun p -> if not (is_perfect_zero x && is_perfect_zero y) then let naive = I.div abs_err exact in let err_1 = add_or_sub_forward I.sub x y p in let err_2 = add_or_sub_forward I.sub y x p in List.fold_left narrow_errors naive [err_1 ; err_2] else I.zero ~prec:P.Real let mul x y ~exact ~abs_err = [x ; y] >>+ fun p -> if not ((I.is_zero exact) && (I.is_zero abs_err)) then let g = I.add (Elementary.rel ~prec:p (I.mul x.approx y.approx)) one in let ex, ey = I.add x.rel_err one, I.add y.rel_err one in let err = I.sub (I.mul (I.mul ex ey) g) one in let naive = I.div abs_err exact in narrow_errors err naive else exact let div x y ~exact ~abs_err = [x ; y] >>+ fun p -> if not (I.is_zero abs_err) || not (I.is_zero exact) then let g = I.add (Elementary.rel ~prec:p (I.div x.approx y.approx)) one in let ex, ey = I.add x.rel_err one, I.add y.rel_err one in let err = I.sub (I.mul (I.div ex ey) g) one in let naive = I.div abs_err exact in narrow_errors err naive else I.zero ~prec:P.Real end module Backward = struct (* Generic function for backward addition and substraction *) let add_or_sub_backward (op : operator) x y r p = let g = Elementary.rel ~prec:p (op x.approx y.approx) in let t = I.div (I.sub r.rel_err g) (I.add one g) in let d = I.div y.exact x.exact in let e = match Mode.get () with | Mode.With_Interactions -> I.div y.abs_err x.exact | _ -> I.mul y.rel_err d in I.sub (I.mul t (op one d)) e let neg x r = [x ; r] >>+ fun _ -> I.narrow x.rel_err r.rel_err let add x y r = [x ; y ; r] >>+ fun p -> let x' = x.rel_err, add_or_sub_backward I.add x y r p in let y' = y.rel_err, add_or_sub_backward I.add y x r p in generic_backward x' y' let sub x y r = [x ; y ; r] >>+ fun p -> let x' = x.rel_err, add_or_sub_backward I.sub x y r p in let y' = y.rel_err, add_or_sub_backward I.sub x y r p in generic_backward x' y' let mul x y r = [x ; y ; r] >>+ fun p -> let g = I.add (Elementary.rel ~prec:p (I.mul x.approx y.approx)) one in let d x = I.mul (I.add x.rel_err one) g in let n = I.add r.rel_err one in let ex = I.sub (I.div n (d y)) one in let ey = I.sub (I.div n (d x)) one in generic_backward (x.rel_err, ex) (y.rel_err, ey) let div x y r = [x ; y ; r] >>+ fun p -> let g = I.add (Elementary.rel ~prec:p (I.mul x.approx y.approx)) one in let dr = I.add r.rel_err one in let dx = I.add x.rel_err one in let dy = I.add y.rel_err one in let ex = I.sub (I.div (I.mul dr dy) g) one in let ey = I.sub (I.div (I.mul g dx) dr) one in generic_backward (x.rel_err, ex) (y.rel_err, ey) end end (*----------------------------------------------------------------------------- * Backward comparison operators *---------------------------------------------------------------------------*) module Backward_Comparisons = struct let backward_interaction x y = let f x = non_bottom_narrow x.abs_err (I.mul x.exact x.rel_err) in let x_abs_err, y_abs_err = match Mode.get () with | Mode.With_Interactions | Mode.Abs_From_Rel -> f x, f y | Mode.Rel_From_Abs | Mode.No_Interaction -> x.abs_err, y.abs_err in { x with abs_err = x_abs_err }, { y with abs_err = y_abs_err } let lt x y = [x ; y] >>+ fun p -> I.backward_le x.exact y.exact >>- fun x_exact -> I.backward_ge y.exact x.exact >>- fun y_exact -> I.backward_lt ~prec:p x.approx y.approx >>- fun x_approx -> I.backward_ge ~prec:p y.approx x.approx >>- fun y_approx -> let bx = { x with exact = x_exact ; approx = x_approx } in let by = { y with exact = y_exact ; approx = y_approx } in `Value (backward_interaction bx by) let le x y = [x ; y] >>+ fun p -> I.backward_le x.exact y.exact >>- fun x_exact -> I.backward_ge y.exact x.exact >>- fun y_exact -> I.backward_le ~prec:p x.approx y.approx >>- fun x_approx -> I.backward_ge ~prec:p y.approx x.approx >>- fun y_approx -> let bx = { x with exact = x_exact ; approx = x_approx } in let by = { y with exact = y_exact ; approx = y_approx } in `Value (backward_interaction bx by) let ge x y = [x ; y] >>+ fun p -> I.backward_ge x.exact y.exact >>- fun x_exact -> I.backward_le y.exact x.exact >>- fun y_exact -> I.backward_ge ~prec:p x.approx y.approx >>- fun x_approx -> I.backward_le ~prec:p y.approx x.approx >>- fun y_approx -> let bx = { x with exact = x_exact ; approx = x_approx } in let by = { y with exact = y_exact ; approx = y_approx } in `Value (backward_interaction bx by) let gt x y = [x ; y] >>+ fun p -> I.backward_ge x.exact y.exact >>- fun x_exact -> I.backward_le y.exact x.exact >>- fun y_exact -> I.backward_gt ~prec:p x.approx y.approx >>- fun x_approx -> I.backward_le ~prec:p y.approx x.approx >>- fun y_approx -> let bx = { x with exact = x_exact ; approx = x_approx } in let by = { y with exact = y_exact ; approx = y_approx } in `Value (backward_interaction bx by) end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_arithmetics.mli���������������������0000666�0000000�0000000�00000010425�13571573400�024723� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval open Numerors_utils module I = Numerors_interval (** Type manipulated by the arithmetics *) type t = { exact : I.t ; approx : I.t ; abs_err : I.t ; rel_err : I.t } (** Pretty printer *) val pretty : Format.formatter -> t -> unit (** Return a value with all fields to zero. The <approx> field will use the precision of the approx field of the parameter *) val zero : t -> t (** Return the precision of the <approx> field *) val prec : t -> Precisions.t (** Create a record from intervals *) val create : I.t -> I.t -> I.t -> I.t -> t (** Apply an operation on each fields of the operands *) val apply : (I.t -> I.t -> I.t) -> t -> t -> t (** Return a new value with the same fields as the input but with an <approx> field with the given precision *) val change_prec : Precisions.t -> t -> t (** Handling of forward interactions *) val forward_interaction : t -> t (** Lattice methods *) val join : t -> t -> t val narrow : t -> t -> t or_bottom val compare : t -> t -> int val is_included : t -> t -> bool (** Signature of an arithmetic *) module type Arithmetic = sig (* Type returned by the forward operations *) type forward module Forward : sig val neg : t -> forward val log : t -> forward val exp : t -> forward val sqrt : t -> forward val add : t -> t -> forward val sub : t -> t -> forward val mul : t -> t -> forward val div : t -> t -> forward end module Backward : sig val neg : t -> t -> I.t or_bottom val add : t -> t -> t -> (I.t * I.t) or_bottom val sub : t -> t -> t -> (I.t * I.t) or_bottom val mul : t -> t -> t -> (I.t * I.t) or_bottom val div : t -> t -> t -> (I.t * I.t) or_bottom end end (** Modules which implement the previous signature for each field of <t> *) module Exact : Arithmetic with type forward = I.t module Approx : Arithmetic with type forward = I.t (* The forward type of Abs_Err forces to pass two aditionnal parameters to the functions. The first one is the exact computation of the current expression while the second one is its approx computation. *) module Abs_Err : Arithmetic with type forward = exact:I.t -> approx:I.t -> I.t (* The forward type of Rel_Err forces to pass two aditionnal parameters to the functions. The first one is the exact computation of the current expression while the second one is its absolute error computation. *) module Rel_Err : Arithmetic with type forward = exact:I.t -> abs_err:I.t -> I.t (** Backward comparisons *) module Backward_Comparisons : sig val lt : t -> t -> (t * t) or_bottom val le : t -> t -> (t * t) or_bottom val gt : t -> t -> (t * t) or_bottom val ge : t -> t -> (t * t) or_bottom end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_float.ml����������������������������0000666�0000000�0000000�00000022662�13571573400�023351� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Numerors_utils module P = Precisions (* Type declaration *) type t = P.t * Mpfrf.t (* Pretty printer *) let pretty fmt (_, f) = Mpfrf.print fmt f (* Get back the MPFR rounding mode *) let rounding = function | Rounding.Near -> Mpfr.Near | Rounding.Down -> Mpfr.Down | Rounding.Up -> Mpfr.Up (* Apply an Mpfr function to an Mpfrf object *) let convert f = fun x rnd -> let x' = Mpfrf.to_mpfr x in let r = Mpfr.init () in let _ = f r x' rnd in Mpfrf.of_mpfr r (*----------------------------------------------------------------------------- * Internal functions to handle the precisions of MPFR numbers *---------------------------------------------------------------------------*) (* Set the default precision *) let set_precision = Mpfr.set_default_prec (P.get P.Real) ; let actual_precision = ref P.Real in fun prec -> if not (P.eq prec !actual_precision) then (Mpfr.set_default_prec (P.get prec) ; actual_precision := prec) (* Monad which sets the default precision before calling the given function f. Returns the tuple composed of the precision and the return of f. *) let ( >>- ) prec f = set_precision prec ; prec, f () [@@inline] (* Internal : change the precision *) let change_prec ?(rnd = Mpfr.Near) prec (p, x) = if not (P.eq p prec) then let r = Mpfr.init () in let _ = Mpfr.set r (Mpfrf.to_mpfr x) rnd in Mpfrf.of_mpfr r else x [@@inline] (* Returns a function which apply the rounding of its optionnal parameter rnd and change the precision according to its optionnal parameter prec before calling the unary function f on an input of type t *) let unary_mpfrf f = fun ?(rnd = Rounding.Near) ?(prec = P.Real) x -> prec >>- fun () -> f (change_prec prec x) (rounding rnd) (* Returns a function which apply the rounding of its optionnal parameter rnd and change the precision according to its optionnal parameter prec before calling the binary function f on two inputs of type t *) let binary_mpfrf f = fun ?(rnd = Rounding.Near) ?(prec = P.Real) x y -> prec >>- fun () -> f (change_prec prec x) (change_prec prec y) (rounding rnd) (*----------------------------------------------------------------------------- * Constructors *---------------------------------------------------------------------------*) let of_mpfr p f = p, f let of_int ?(rnd = Rounding.Near) ?(prec = P.Real) i = prec >>- fun () -> Mpfrf.of_int i (rounding rnd) let of_float ?(rnd = Rounding.Near) ?(prec = P.Real) f = prec >>- fun () -> Mpfrf.of_float f (rounding rnd) let of_string ?(rnd = Rounding.Near) ?(prec = P.Real) str = prec >>- fun () -> let l = String.length str - 1 in let last = Char.lowercase_ascii str.[l] in let str = if last = 'f' || last = 'd' || last = 'l' then String.sub str 0 l else str in (* base=0 to let Mpfr infer the base, depending of the encoding of s. *) Mpfrf.of_mpfr (Mpfr.init_set_str str ~base:0 (rounding rnd)) let pos_zero prec = of_float ~prec 0.0 let neg_zero prec = of_float ~prec (~-. 0.0) let pos_inf prec = of_mpfr prec @@ Mpfrf.of_float infinity Mpfr.Near let neg_inf prec = of_mpfr prec @@ Mpfrf.of_float neg_infinity Mpfr.Near (*----------------------------------------------------------------------------- * Comparison methods *---------------------------------------------------------------------------*) let compare (px, nx) (py, ny) = if not (Precisions.eq px py) then Value_parameters.fatal "Numerors: impossible to compare two numbers with different precisions" else Mpfrf.cmp nx ny let eq a b = compare a b = 0 let le a b = compare a b <= 0 let lt a b = compare a b < 0 let ge a b = compare a b >= 0 let gt a b = compare a b > 0 let min x y = if compare x y <= 0 then x else y let max x y = if compare x y <= 0 then y else x (*----------------------------------------------------------------------------- * Getters on floats *---------------------------------------------------------------------------*) let sign (_, x) = let s = Mpfrf.sgn x in if s = 0 then (* Ugly fix because the sign of a MPFR zero is zero ! FUCK IT *) let fx = Mpfrf.to_float x in Sign.of_int @@ int_of_float @@ copysign 1.0 fx else Sign.of_int s let prec (p, _) = p (* The minus 1 is mandatory because MPFR represents the float numbers with a significand between 0 and 1 in place of the standard in the IEEE-754 norm. This difference implies that the exponent of the MPFR representation is greater than the one of the standard representation by one. *) let exponent (prec, x as f) = if eq f (pos_zero prec) then min_int else (Mpfr.get_exp (Mpfrf.to_mpfr x)) - 1 let significand (prec, x) = prec >>- fun () -> let significand = Mpfrf.to_mpfr x in let _ = Mpfr.set_exp significand 1 in Mpfrf.abs (Mpfrf.of_mpfr significand) Mpfr.Near (*----------------------------------------------------------------------------- * Methods to check properties on floats *---------------------------------------------------------------------------*) let is_nan (_, x) = Mpfrf.nan_p x let is_inf (_, x) = Mpfrf.inf_p x let is_pos f = Sign.is_pos (sign f) let is_neg f = Sign.is_neg (sign f) let is_a_zero (prec, _ as f) = eq f @@ pos_zero prec let is_pos_zero f = is_pos f && is_a_zero f let is_neg_zero f = is_neg f && is_a_zero f let is_strictly_pos f = is_pos f && not (is_a_zero f) let is_strictly_neg f = is_neg f && not (is_a_zero f) (*----------------------------------------------------------------------------- * Functions without rounding errors *---------------------------------------------------------------------------*) let neg (p, x) = p >>- fun () -> Mpfrf.neg x Mpfr.Near let abs (p, x) = p >>- fun () -> Mpfrf.abs x Mpfr.Near (*----------------------------------------------------------------------------- * Operators *---------------------------------------------------------------------------*) let add = binary_mpfrf Mpfrf.add let sub = binary_mpfrf Mpfrf.sub let mul = binary_mpfrf Mpfrf.mul let div = binary_mpfrf Mpfrf.div let pow = binary_mpfrf Mpfrf.pow let pow_int = fun ?(rnd = Rounding.Near) ?(prec = P.Real) x n -> prec >>- fun () -> Mpfrf.pow_int (change_prec prec x) n (rounding rnd) (*----------------------------------------------------------------------------- * Functions with rounding errors *---------------------------------------------------------------------------*) let square = unary_mpfrf (fun x -> Mpfrf.mul x x) let sqrt = unary_mpfrf Mpfrf.sqrt let log = unary_mpfrf @@ convert Mpfr.log let exp = unary_mpfrf @@ convert Mpfr.exp let sin = unary_mpfrf @@ convert Mpfr.sin let cos = unary_mpfrf @@ convert Mpfr.cos let tan = unary_mpfrf @@ convert Mpfr.tan (*----------------------------------------------------------------------------- * Apply the sign of <src> on <dst> *---------------------------------------------------------------------------*) let apply_sign ~src ~dst = if not (Sign.eq (sign src) (sign dst)) then neg dst else dst (*----------------------------------------------------------------------------- * Next and prev float *---------------------------------------------------------------------------*) let next_float (p, x) = let x' = Mpfrf.to_mpfr x in Mpfr.nextabove x' ; p, Mpfrf.of_mpfr x' let prev_float (p, x) = let x' = Mpfrf.to_mpfr x in Mpfr.nextbelow x' ; p, Mpfrf.of_mpfr x' (*----------------------------------------------------------------------------- * Machine constants *---------------------------------------------------------------------------*) let machine_epsilon ?(prec = P.Real) p = pow_int ~rnd:Rounding.Up ~prec (of_int ~prec 2) (- P.get p) let machine_delta ?(prec = P.Real) p = pow_int ~rnd:Rounding.Up ~prec (of_int ~prec 2) @@ (P.denormalized p) - 1 let maximal_pos_float ~prec = prev_float @@ pos_inf prec let maximal_neg_float ~prec = next_float @@ neg_inf prec let change_prec ~rnd ~prec t = prec, change_prec ~rnd:(rounding rnd) prec t ������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_float.mli���������������������������0000666�0000000�0000000�00000014574�13571573400�023525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Numerors_utils (*----------------------------------------------------------------------------- * Generic signature for a module representing float numbers *---------------------------------------------------------------------------*) type t val pretty : Format.formatter -> t -> unit (** Returns a t element representing a positive infinite value *) val pos_inf : Precisions.t -> t (** Returns a t element representing a negative infinite value *) val neg_inf : Precisions.t -> t (** Returns a t element representing a positive zero value *) val pos_zero : Precisions.t -> t (** Returns a t element representing a negative zero value *) val neg_zero : Precisions.t -> t (** This function returns a float of precision ?prec containing the machine epsilon divided by two for the mandatory precision parameter. We divide it by two because we are only interested in the rounding to nearest mode. *) val machine_epsilon : ?prec:Precisions.t -> Precisions.t -> t (** This function returns a float of precision ?prec containing the machine delta of the mandatory precision parameter also divided by two for the same reason as machine_epsilon. *) val machine_delta : ?prec:Precisions.t -> Precisions.t -> t (** Maximal positive float in the precision *) val maximal_pos_float : prec:Precisions.t -> t (** Maximal negative float in the precision *) val maximal_neg_float : prec:Precisions.t -> t (** The functions of_<typ> ~rnd ~prec x return a float of precision <prec> containing the value of x (of type <typ>) rounding to <rnd>. The default values are prec=Precisions.Real and rnd=Rounding.Near *) val of_int : ?rnd:Rounding.t -> ?prec:Precisions.t -> int -> t val of_float : ?rnd:Rounding.t -> ?prec:Precisions.t -> float -> t val of_string : ?rnd:Rounding.t -> ?prec:Precisions.t -> string -> t (** Change the precision *) val change_prec : rnd:Rounding.t -> prec:Precisions.t -> t -> t (** Comparison functions *) val compare : t -> t -> int val eq : t -> t -> bool val le : t -> t -> bool val lt : t -> t -> bool val ge : t -> t -> bool val gt : t -> t -> bool val min : t -> t -> t val max : t -> t -> t (** Check if its input is a NaN *) val is_nan : t -> bool (** Check if its input is an infinite value *) val is_inf : t -> bool (** Check if its input is positive (is_pos NaN = true) *) val is_pos : t -> bool (** Check if its input is negative (is_neg NaN = false) *) val is_neg : t -> bool (** Check if its input is a zero (positive or negative) *) val is_a_zero : t -> bool (** Check if its input is a positive zero *) val is_pos_zero : t -> bool (** Check if its input is a negative zero *) val is_neg_zero : t -> bool (** Check if its input is strictly positive (non zero) *) val is_strictly_pos : t -> bool (** Check if its input is strictly negative (non zero) *) val is_strictly_neg : t -> bool (** Returns the sign of its input. The sign of a NaN is Positive *) val sign : t -> Sign.t (** Returns the precision of its input *) val prec : t -> Precisions.t (** Returns the exponent of its input *) val exponent : t -> int (** Returns the significand of its input. This function is known to generate a core dump if the version of your MPFR library is the 3.0.1. The version 4.0 of the library does not have the bug anymore. *) val significand : t -> t (** Returns a element containing the same value as <dst> but with the sign of <src> *) val apply_sign : src:t -> dst:t -> t (** Returns the previous floating point number of the same precision *) val prev_float : t -> t (** Returns the following floating point number of the same precision *) val next_float : t -> t (** Negation *) val neg : t -> t (** Absolute value *) val abs : t -> t (** The following functions perform floating-point arithmetic operations at the precision <prec> and using the rounding mode <rnd>. Their default values are prec=Precisions.Real and rnd=Rounding.Near. The inputs are "casted" to the asked precision if necessary before computing the operation *) val add : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t -> t val sub : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t -> t val mul : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t -> t val div : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t -> t val pow : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t -> t val pow_int : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> int -> t val square : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t val sqrt : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t val log : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t val exp : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t val sin : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t val cos : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t val tan : ?rnd:Rounding.t -> ?prec:Precisions.t -> t -> t ������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_interval.ml�������������������������0000666�0000000�0000000�00000046154�13571573400�024072� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Numerors_utils module F = Numerors_float (*----------------------------------------------------------------------------- * Interval representation *----------------------------------------------------------------------------- * Structure invariants : * - the two bounds in the constructor I must have the same precision * - the two bounds can not be a NaN *---------------------------------------------------------------------------*) type t = NaN of Precisions.t | I of F.t * F.t * bool (*----------------------------------------------------------------------------- * Pretty printer *---------------------------------------------------------------------------*) let pretty fmt itv = let pp_nan f n = if n then Format.fprintf f "{NaN}" in match itv with | NaN _ -> pp_nan fmt true | I (x, y, n) -> Format.fprintf fmt "%a[%a ; %a]" pp_nan n F.pretty x F.pretty y (*----------------------------------------------------------------------------- * Methods to get informations on intervals *---------------------------------------------------------------------------*) let prec = function NaN p -> p | I (x, _, _) -> F.prec x let get_max_exponent = function | NaN _ -> Value_parameters.fatal "Numerors: can't return the exponent of a NaN" | I (x, y, _) -> Transitioning.Stdlib.max (F.exponent x) (F.exponent y) let get_exponents = function | NaN _ -> Value_parameters.fatal "Numerors: can't return the exponent of a NaN" | I (x, y, _) -> F.exponent x, F.exponent y let get_bounds = function | NaN _ -> Value_parameters.fatal "Numerors: can't return the bounds of a NaN" | I (x, y, _) -> x, y (*----------------------------------------------------------------------------- * Internal functions *---------------------------------------------------------------------------*) (* Exception raised when operands have different precisions *) exception Different_Precisions (* Monad to handle NaN intervals *) let ( >>- ) a f = match a with I (x, y, n) -> f (x, y, n) | n -> n (* Monad to handle the precisions *) let ( >>+ ) (a, b) f = let pa = prec a and pb = prec b in if Precisions.eq pa pb then f pa else raise Different_Precisions (* Create a new I element *) let make ?(nan = false) x y = let there_a_nan = F.is_nan x || F.is_nan y in let bad_order = F.gt x y in let bad_precs = not @@ Precisions.eq (F.prec x) (F.prec y) in if there_a_nan || bad_order || bad_precs then Value_parameters.fatal "Numerors: impossible to create an interval with bounds %a and %a" F.pretty x F.pretty y else if F.is_pos_zero x && F.is_neg_zero y then I (y, x, nan) else I (x, y, nan) (* Add a NaN to an interval *) let add_nan itv = itv >>- fun (x, y, _) -> I (x, y, true) (* Change the infinite bounds into max float *) let make_finite ~prec = function | NaN _ -> `Bottom | I (x, y, _) when F.is_inf x && F.eq x y -> `Bottom | I (x, y, n) -> let make_finite x = if F.is_inf x then let rec pow = function | 0 -> 1 | 1 -> 2 | n -> let b = pow (n / 2) in b * b * (if n mod 2 = 0 then 1 else 2) in let exp = pow ((Precisions.exponent prec) - 1) in let exp = match F.sign x with Sign.Positive -> exp | Sign.Negative -> 2 - exp in F.pow_int (F.of_int ~prec 2) exp else x in `Value (I (make_finite x, make_finite y, n)) (* Change the precision *) let change_prec prec = function | NaN _ -> NaN prec | I (x, y, n) -> let x = F.change_prec ~rnd:Rounding.Down ~prec x in let y = F.change_prec ~rnd:Rounding.Up ~prec y in I (x, y, n) (*----------------------------------------------------------------------------- * Constructors *---------------------------------------------------------------------------*) let top ~prec = make ~nan:true (F.neg_inf prec) (F.pos_inf prec) let zero ~prec = make (F.neg_zero prec) (F.pos_zero prec) let nan ~prec = NaN prec let pos_inf ~prec = make (F.pos_inf prec) (F.pos_inf prec) let neg_inf ~prec = make (F.neg_inf prec) (F.neg_inf prec) let of_ints ~prec (x, y) = let fx = F.of_int ~rnd:Rounding.Down ~prec x in let fy = F.of_int ~rnd:Rounding.Up ~prec y in make fx fy let of_floats ~prec (x, y) = let fx = F.of_float ~rnd:Rounding.Down ~prec x in let fy = F.of_float ~rnd:Rounding.Up ~prec y in make fx fy let of_floats_without_rounding ~prec (x, y) = let fx = F.of_float ~rnd:Rounding.Near ~prec x in let fy = F.of_float ~rnd:Rounding.Near ~prec y in make fx fy let of_strings ~prec (x, y) = let fx = F.of_string ~rnd:Rounding.Down ~prec x in let fy = F.of_string ~rnd:Rounding.Up ~prec y in make fx fy let of_numerors_floats (x, y) = make x y let pos_zero ~prec = of_floats ~prec (0.0, 0.0) let epsilon p = let e = F.machine_epsilon p in of_numerors_floats (F.neg e, e) let enlarge itv = itv >>- fun (x, y, n) -> I (F.prev_float x, F.next_float y, n) (*----------------------------------------------------------------------------- * Comparison methods *---------------------------------------------------------------------------*) let compare a b = (a, b) >>+ fun _ -> match a, b with | NaN _, NaN _ -> 0 | NaN _, _ -> 1 | _, NaN _ -> -1 | I (x, y, n), I (x', y', n') -> let c = Transitioning.Stdlib.compare n n' in if c = 0 then let c = F.compare x x' in if c = 0 then F.compare y y' else c else c let eq a b = compare a b = 0 let le a b = compare a b <= 0 let lt a b = compare a b < 0 let ge a b = compare a b >= 0 let gt a b = compare a b > 0 (*----------------------------------------------------------------------------- * Lattice structure *---------------------------------------------------------------------------*) (* Two intervals with different precisions are not comparable. *) let is_included a b = try (a, b) >>+ fun _ -> match a, b with | I (x, y, n), I (x', y', n') -> F.ge x x' && F.le y y' && (not n || n') | NaN _, I (_, _, true) | NaN _, NaN _ -> true | _ -> false with Different_Precisions -> false (* The join of two intervals with different precisions * generates an exception *) let join a b = (a, b) >>+ fun _ -> match a, b with | I (x, y, n), I (x', y', n') -> make ~nan:(n || n') (F.min x x') (F.max y y') | NaN _, itv | itv, NaN _ -> add_nan itv (* The narrow of two intervals with different precisions * generates an exception *) let narrow a b = (a, b) >>+ fun prec -> match a, b with | I (x, y, n), I (x', y', n') -> let is_finite = F.le x' y && F.le x y' in let is_nan = n && n' in if is_finite then `Value (make ~nan:is_nan (F.max x x') (F.min y y')) else if is_nan then `Value (NaN prec) else `Bottom | (I (_, _, true) | NaN _), (NaN _ | I (_, _, true)) -> `Value (NaN prec) | _ -> `Bottom (*----------------------------------------------------------------------------- * Methods to check what is contained by an interval *---------------------------------------------------------------------------*) let ( >>: ) (itv, b) f = match itv with NaN _ -> b | I (x, y, n) -> f (x, y, n) let is_nan itv = (itv, true) >>: fun _ -> false let is_finite itv = (itv, false) >>: fun (x, y, _) -> not (F.is_inf x) && not (F.is_inf y) let is_pos_zero itv = (itv, false) >>: fun (x, y, _) -> F.is_pos_zero x && F.is_pos_zero y let is_neg_zero itv = (itv, false) >>: fun (x, y, _) -> F.is_neg_zero x && F.is_neg_zero y let is_zero itv = (itv, false) >>: fun (x, y, _) -> F.is_a_zero x && F.is_a_zero y let is_pos_inf itv = (itv, false) >>: fun (x, y, _) -> F.is_inf x && F.is_inf y && F.is_pos x let is_neg_inf itv = (itv, false) >>: fun (x, y, _) -> F.is_inf x && F.is_inf y && F.is_neg y let contains_infinity itv = (itv, false) >>: fun (x, y, _) -> F.is_inf x || F.is_inf y let contains_pos_infinity itv = (itv, false) >>: fun (x, y, _) -> let is_pos_inf x = F.is_inf x && F.is_pos x in is_pos_inf x || is_pos_inf y let contains_neg_infinity itv = (itv, false) >>: fun (x, y, _) -> let is_neg_inf x = F.is_inf x && F.is_neg x in is_neg_inf x || is_neg_inf y let contains_a_zero itv = (itv, false) >>: fun (x, y, _) -> let z = F.pos_zero (F.prec x) in F.le x z && F.le z y let contains_pos_zero itv = (itv, false) >>: fun (x, y, _) -> contains_a_zero itv && (F.is_pos x || F.is_pos y) let contains_neg_zero itv = (itv, false) >>: fun (x, y, _) -> contains_a_zero itv && (F.is_neg x || F.is_neg y) let contains_nan itv = (itv, true) >>: fun (_, _, n) -> n let contains_strictly_pos itv = (itv, false) >>: fun (_, y, _) -> F.is_strictly_pos y let contains_strictly_neg itv = (itv, false) >>: fun (x, _, _) -> F.is_strictly_neg x let is_strictly_pos itv = (itv, false) >>: fun (x, _, _) -> F.is_strictly_pos x let is_strictly_neg itv = (itv, false) >>: fun (_, y, _) -> F.is_strictly_neg y (*----------------------------------------------------------------------------- * Arithmetics. See Fval for further details. *---------------------------------------------------------------------------*) (* Normal calculation with NaN and precision handling *) let calc f ~prec a b = match a, b with | I (xa, ya, na), I (xb, yb, nb) -> f (xa, ya, na) (xb, yb, nb) prec | NaN _, _ | _, NaN _ -> NaN prec (* Monotonic calculation *) type operator = ?rnd:Rounding.t -> ?prec:Precisions.t -> F.t -> F.t -> F.t let monotonic ~prec (op : operator) a b = let exact = not @@ Precisions.eq prec Precisions.Real in let f (b1, e1, n1) (b2, e2, n2) prec = let nan = ref (n1 || n2) in let results = ref [] in let add r = results := r :: !results in let treat_nan x y = nan := true ; if F.is_inf x && not (F.eq b1 e1) then add @@ op ~prec (F.apply_sign x (F.of_int ~prec 1)) y ; if F.is_inf y && not (F.eq b2 e2) then add @@ op ~prec x (F.apply_sign y (F.of_int ~prec 1)) ; in let op rnd x y = let r = op ~rnd ~prec x y in if F.is_nan r then treat_nan x y else add r in let s = [b1 ; b1 ; e1 ; e1] and s' = [b2 ; e2 ; b2 ; e2] in if not exact then begin List.iter2 (op Rounding.Down) s s' ; List.iter2 (op Rounding.Up ) s s' ; end else List.iter2 (op Rounding.Near) s s' ; let min = List.fold_left F.min (F.pos_inf prec) !results in let max = List.fold_left F.max (F.neg_inf prec) !results in if F.compare min max > 0 then (assert !nan ; NaN prec) else make ~nan:!nan min max in calc f ~prec:prec a b let neg itv = (itv, itv) >>: fun (x, y, n) -> make ~nan:n (F.neg y) (F.neg x) let sqrt ?(prec = Precisions.Real) itv = (itv, NaN prec) >>: fun (x, y, n) -> let is_correct t = F.is_pos t || F.is_neg_zero t in if is_correct y then let y = F.sqrt ~rnd:Rounding.Up ~prec y in if is_correct x then let x = F.sqrt ~rnd:Rounding.Down ~prec x in make ~nan:n x y else make ~nan:true (F.neg_zero prec) y else NaN prec let square ?(prec = Precisions.Real) itv = (itv, NaN prec) >>: fun (x, y, n) -> let abs_x, abs_y = F.abs x, F.abs y in let max = F.square ~prec (F.max abs_x abs_y) in let min = if F.is_neg x && F.is_pos y then F.pos_zero prec else F.square ~prec (F.min abs_x abs_y) in make ~nan:n min max let add ?(prec = Precisions.Real) = monotonic ~prec F.add let sub ?(prec = Precisions.Real) = monotonic ~prec F.sub let mul ?(prec = Precisions.Real) a b = let r = monotonic ~prec F.mul a b in let nan_occurs x y = contains_infinity x && contains_a_zero y in if nan_occurs a b || nan_occurs b a then add_nan r else r let div ?(prec = Precisions.Real) a b = let r = monotonic ~prec F.div a b in let nan = contains_a_zero a && contains_a_zero b in let has_pinf = contains_pos_zero b && contains_strictly_pos a || contains_neg_zero b && contains_strictly_neg a and has_ninf = contains_pos_zero b && contains_strictly_neg a || contains_neg_zero b && contains_strictly_pos a in let r = if has_pinf then join (pos_inf ~prec) r else r in let r = if has_ninf then join (neg_inf ~prec) r else r in if nan then add_nan r else r let abs itv = (itv, itv) >>: fun (x, y, n) -> let prec = F.prec x in let z = F.pos_zero prec in if contains_a_zero itv then make ~nan:n z (F.max (F.abs x) (F.abs y)) else if F.is_strictly_neg y then make ~nan:n (F.neg y) (F.neg x) else itv let log ?(prec = Precisions.Real) itv = (itv, NaN prec) >>: fun (x, y, n) -> if F.is_pos y || F.is_neg_zero y then let y = F.log ~rnd:Rounding.Up ~prec y in if F.is_pos x || F.is_neg_zero x then let x = F.log ~rnd:Rounding.Down ~prec x in make ~nan:n x y else make ~nan:true (F.neg_inf prec) y else NaN prec let exp ?(prec = Precisions.Real) itv = (itv, NaN prec) >>: fun (x, y, n) -> let x = F.exp ~rnd:Rounding.Down ~prec x in let y = F.exp ~rnd:Rounding.Up ~prec y in make ~nan:n x y (*----------------------------------------------------------------------------- * Backward comparisons (be carefull that all those functions consider that y * is in the upper part of the comparison, i.e we handle x <= y or y >= x, * which change the order of the parameters of the functions). *---------------------------------------------------------------------------*) let backward_le ?prec:_ x y = match x, y with | I (ax, bx, nx), I (_, by, ny) -> let b = if F.eq bx by then bx else F.min bx by in if F.le ax b then `Value (I (ax, b, nx || ny)) else `Bottom | _, _ -> `Value x let backward_lt ?(prec = Precisions.Real) x y = let e = F.machine_epsilon prec in match x, y with | I (ax, bx, nx), I (_, by, ny) -> let b = let by = F.sub ~prec by (F.mul ~prec e by) in if F.eq bx by then bx else F.min bx by in if F.le ax b then `Value (I (ax, b, nx || ny)) else `Bottom | _, _ -> `Value x let backward_ge ?prec:_ y x = match x, y with | I (ax, _, nx), I (ay, by, ny) -> let a = if F.eq ax ay then ay else F.max ax ay in if F.le a by then `Value (I (a, by, nx || ny)) else `Bottom | _, _ -> `Value y let backward_gt ?(prec = Precisions.Real) y x = let e = F.machine_epsilon prec in match x, y with | I (ax, _, nx), I (ay, by, ny) -> let a = let ax = F.add ~prec ax (F.mul ~prec e ax) in if F.eq ax ay then ay else F.max ax ay in if F.le a by then `Value (I (a, by, nx || ny)) else `Bottom | _, _ -> `Value y (*----------------------------------------------------------------------------- * *---------------------------------------------------------------------------*) let finite_values ~prec = function | NaN _ -> None | I (x, y, _) -> let min = F.max (F.maximal_neg_float prec) x in let max = F.min (F.maximal_pos_float prec) y in if max < min then None else Some (min, max) let backward_op (op : operator) fnan ?(prec = Precisions.Real) value result = if contains_infinity result || (contains_nan value && contains_nan result) then `Value (top prec) else let reduced_for_nan = if contains_nan result then `Value (fnan value) else `Bottom and reduced_for_finite = match finite_values prec result, finite_values prec value with | None, _ | _, None -> `Bottom | Some (xres, yres), Some (xval, yval) -> if Precisions.eq prec Precisions.Real then let x = op ~rnd:Rounding.Up ~prec xres yval in let y = op ~rnd:Rounding.Down ~prec yres xval in `Value (make ~nan:false x y) else let xres = F.prev_float xres and yres = F.next_float yres in let x = op ~rnd:Rounding.Near ~prec xres yval in let y = op ~rnd:Rounding.Near ~prec yres xval in `Value (make ~nan:false x y) in Bottom.join join reduced_for_nan reduced_for_finite [@@inline] let synthetize left right = match left, right with | `Bottom, _ | _, `Bottom -> `Bottom | `Value left, `Value right -> `Value (left, right) [@@inline] let backward_add ?(prec = Precisions.Real) ~left ~right ~result = let reduce_for_nan value = match contains_pos_infinity value, contains_neg_infinity value with | true , true -> I (F.neg_inf prec, F.pos_inf prec, true) | true , false -> I (F.neg_inf prec, F.neg_inf prec, true) | false, true -> I (F.pos_inf prec, F.pos_inf prec, true) | false, false -> NaN prec in let right' = backward_op F.sub reduce_for_nan ~prec left result in let left' = backward_op F.sub reduce_for_nan ~prec right result in synthetize left' right' let backward_sub ?(prec = Precisions.Real) ~left ~right ~result = match backward_add ~prec ~left ~right:(neg right) ~result with | `Bottom -> `Bottom | `Value (left, right) -> `Value (left, neg right) let backward_mul ?(prec = Precisions.Real) ~left ~right ~result = let reduce_for_nan value = match contains_infinity value, contains_a_zero value with | true, _ | _, true -> I (F.neg_inf prec, F.pos_inf prec, true) | false, false -> NaN prec in let right' = backward_op F.div reduce_for_nan ~prec left result in let left' = backward_op F.div reduce_for_nan ~prec right result in synthetize left' right' let backward_div ?(prec = Precisions.Real) ~left ~right ~result = let reduce_for_nan value = match contains_infinity value, contains_a_zero value with | true, _ | _, true -> I (F.neg_inf prec, F.pos_inf prec, true) | false, false -> NaN prec in let right' = match backward_op F.div reduce_for_nan ~prec left result with | `Value right' -> let one = F.of_int ~prec 1 in let one = I (one, one, false) in `Value (div ~prec one right') | `Bottom -> `Bottom in let left' = backward_op F.div reduce_for_nan ~prec right result in synthetize left' right' ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_interval.mli������������������������0000666�0000000�0000000�00000017271�13571573400�024241� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Numerors_utils (** Opaque type of an interval. The type as an invariant : both bounds of the interval use the same precision *) type t val pretty : Format.formatter -> t -> unit (** Returns the precisions of the bounds of its input *) val prec : t -> Precisions.t (** Returns the biggest exponent of its input *) val get_max_exponent : t -> int (** Returns the exponent of the bounds ot its input *) val get_exponents : t -> int * int (** Returns the bounds of its inputs *) val get_bounds : t -> Numerors_float.t * Numerors_float.t (** Returns the interval [-oo ; +oo] with NaNs at the precision <prec> *) val top : prec:Precisions.t -> t (** Returns the interval [+oo ; +oo] at the precision <prec> *) val pos_inf : prec:Precisions.t -> t (** Returns the interval [-oo ; -oo] at the precision <prec> *) val neg_inf : prec:Precisions.t -> t (** Returns an interval containing only NaN values at the precision <prec> *) val nan : prec:Precisions.t -> t (** Returns the interval [-0 ; +0] at the precision <prec> *) val zero : prec:Precisions.t -> t (** Returns the interval [+0 ; +0] at the precision <prec> *) val pos_zero : prec:Precisions.t -> t (** Add NaN into the interval *) val add_nan : t -> t (** Replace the infinite bounds of its input into the maximum float of the precision. Does not change the interval if it is finite *) val make_finite : prec:Precisions.t -> t -> t Eval.or_bottom (** Enlarge the bounds of the interval by taking the previous float of the lower bound and the following float of the upper bound *) val enlarge : t -> t (** The function of_<typ> ~prec (x, y) returns the interval [x' ; y'] where x' is a Numerors float containing the value of x (of type <typ>) rounded toward -oo and y' is a Numerors float containing the value of y rounded toward +oo. Both use the precision <prec> *) val of_ints : prec:Precisions.t -> int * int -> t val of_floats : prec:Precisions.t -> float * float -> t val of_strings : prec:Precisions.t -> string * string -> t (** Returns the interval corresponding to the given bounds. Fails with an exception if the inputs do not have the same precision *) val of_numerors_floats : Numerors_float.t * Numerors_float.t -> t (** Works in the same way as of_floats but the bounds are rounded toward nearest *) val of_floats_without_rounding : prec:Precisions.t -> float * float -> t (** Change the precision of the bounds *) val change_prec : Precisions.t -> t -> t (** Returns the interval [-epsilon ; +epsilon] for the input precision *) val epsilon : Precisions.t -> t (** Comparison functions *) val compare : t -> t -> int val eq : t -> t -> bool val le : t -> t -> bool val lt : t -> t -> bool val ge : t -> t -> bool val gt : t -> t -> bool (** Lattice functions. Those functions work only if their inputs use the same precision. One can see this as if there is a lattice for each precision. *) val is_included : t -> t -> bool val join : t -> t -> t val narrow : t -> t -> t Eval.or_bottom (** Check if the interval contains only NaN values *) val is_nan : t -> bool (** Check if the bounds of its input are finite *) val is_finite : t -> bool (** Check if the bounds of its input are both zero (without considering their signs) *) val is_zero : t -> bool (** Check if the bounds of its input are positive zeros *) val is_pos_zero : t -> bool (** Check if the bounds of its input are negative zeros *) val is_neg_zero : t -> bool (** Check if the bounds of its input are positive infinites *) val is_pos_inf : t -> bool (** Check if the bounds of its input are negative infinites *) val is_neg_inf : t -> bool (** Check if its input contains at least a NaN value *) val contains_nan : t -> bool (** Check if there is a zero between the bounds of its input (without considering the signs *) val contains_a_zero : t -> bool (** Check if there is a positive zero between the bounds of its input *) val contains_pos_zero : t -> bool (** Check if there is a negative zero between the bounds of its input *) val contains_neg_zero : t -> bool (** Check if its input contains at least an infinite bound *) val contains_infinity : t -> bool (** Check if there is at least a strictly positive value in its input *) val contains_strictly_pos : t -> bool (** Check if there is at least a strictly negative value in its input *) val contains_strictly_neg : t -> bool (** Check if all the values of its input are positives *) val is_strictly_pos : t -> bool (** Check if all the values of its input are negatives *) val is_strictly_neg : t -> bool (** These functions perform arithmetic operations on intervals using the precision <prec>. If exact=true then the bounds are computed using rounding to nearest mode else they are computed using rounding toward +oo for the upper bound and toward -oo for the lower one *) val add : ?prec:Precisions.t -> t -> t -> t val sub : ?prec:Precisions.t -> t -> t -> t val mul : ?prec:Precisions.t -> t -> t -> t val div : ?prec:Precisions.t -> t -> t -> t (** These functions perform mathematic unidimensionnal operations of intervals using the precision <prec> *) val neg : t -> t val abs : t -> t val sqrt : ?prec:Precisions.t -> t -> t val square : ?prec:Precisions.t -> t -> t val log : ?prec:Precisions.t -> t -> t val exp : ?prec:Precisions.t -> t -> t (** These functions perform backward propagation on intervals using the precision <prec> *) val backward_le : ?prec:Precisions.t -> t -> t -> t Bottom.or_bottom val backward_lt : ?prec:Precisions.t -> t -> t -> t Bottom.or_bottom val backward_ge : ?prec:Precisions.t -> t -> t -> t Bottom.or_bottom val backward_gt : ?prec:Precisions.t -> t -> t -> t Bottom.or_bottom (** These functions perform backward propagation for arithmetic *) val backward_add : ?prec:Precisions.t -> left:t -> right:t -> result:t -> (t * t) Bottom.or_bottom val backward_sub : ?prec:Precisions.t -> left:t -> right:t -> result:t -> (t * t) Bottom.or_bottom val backward_mul : ?prec:Precisions.t -> left:t -> right:t -> result:t -> (t * t) Bottom.or_bottom val backward_div : ?prec:Precisions.t -> left:t -> right:t -> result:t -> (t * t) Bottom.or_bottom ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_utils.ml����������������������������0000666�0000000�0000000�00000011646�13571573400�023404� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types (*----------------------------------------------------------------------------- * Module describing the different precisions that will be manipulated *---------------------------------------------------------------------------*) module Precisions = struct type t = Simple | Double | Long_Double | Real let rp () = Value_parameters.Numerors_Real_Size.get () let pretty fmt = function | Simple -> Format.fprintf fmt "Simple" | Double -> Format.fprintf fmt "Double" | Long_Double -> Format.fprintf fmt "Long Double" | Real -> Format.fprintf fmt "Real" let of_fkind = function | FFloat -> Simple | FDouble -> Double | FLongDouble -> Long_Double (* Defined by the IEEE-754 standard *) let get = function | Simple -> 24 | Double -> 53 | Long_Double -> 113 | Real -> rp () (* Defined by the IEEE-754 standard *) let exponent = function | Simple -> 8 | Double -> 11 | Long_Double -> 15 | Real -> Transitioning.Stdlib.max_int (* Computed as - ((2 - 2^(e-1)) - (m - 1)) where e is the number of bits of the exponent and m is the number of bits of the significand *) let denormalized = function | Simple -> -149 | Double -> -1074 | Long_Double -> -16494 | Real -> Transitioning.Stdlib.min_int let compare a b = Transitioning.Stdlib.compare (get a) (get b) let eq a b = compare a b = 0 let max a b = if compare a b <= 0 then b else a let min a b = if compare a b <= 0 then a else b end (*----------------------------------------------------------------------------- * Sign type for infinites *---------------------------------------------------------------------------*) module Sign = struct type t = Positive | Negative let pretty fmt = function | Positive -> Format.fprintf fmt "+" | Negative -> Format.fprintf fmt "-" let of_int i = if i < 0 then Negative else Positive let compare a b = match a, b with | Positive, Positive | Negative, Negative -> 0 | Positive, Negative -> 1 | Negative, Positive -> -1 let eq a b = compare a b = 0 let neg s = if s = Positive then Negative else Positive let mul a b = if eq a b then Positive else Negative let is_pos = eq Positive let is_neg = eq Negative end (*----------------------------------------------------------------------------- * Rounding mode *---------------------------------------------------------------------------*) module Rounding = struct type t = Up | Down | Near let pretty fmt = function | Up -> Format.fprintf fmt "Up" | Down -> Format.fprintf fmt "Down" | Near -> Format.fprintf fmt "Near" let eq a b = match a, b with | Up, Up | Down, Down | Near, Near -> true | _, _ -> false end (*----------------------------------------------------------------------------- * Interaction mode *---------------------------------------------------------------------------*) module Mode = struct type t = Abs_From_Rel | Rel_From_Abs | No_Interaction | With_Interactions let get () = match Value_parameters.Numerors_Mode.get () with | "relative" -> Rel_From_Abs | "absolute" -> Abs_From_Rel | "none" -> No_Interaction | "both" -> With_Interactions | _ -> assert false end ������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_utils.mli���������������������������0000666�0000000�0000000�00000011037�13571573400�023547� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (*----------------------------------------------------------------------------- * Module describing the different precisions that will be manipulated *---------------------------------------------------------------------------*) module Precisions : sig (** We handle the format defined in C. The Real constructor represents the precision of the floats used as real *) type t = Simple | Double | Long_Double | Real val pretty : Format.formatter -> t -> unit (** Returns the precision associated to the Cil construction fkind, which represents the C floating point type *) val of_fkind : Cil_types.fkind -> t (** Returns the number of bits of the significand of the given precision, counting the implicit one. This size is fixed by the option -eva-numerors-real-size for the Real precision. *) val get : t -> int (** Returns the number of bits of the exponent of the given precision. The exponent of the Real precision is set to max int arbitrally. *) val exponent : t -> int (** Returns the integer corresponding to the exponent of the denormalized numbers of the given precision. The value 2^denormalized is the smallest denormalized number of the precision and is also the gap between two denormalized numbers. The returned integer is negative. For the Real precision, this integer is arbitrally set to min int. *) val denormalized : t -> int val compare : t -> t -> int val eq : t -> t -> bool val max : t -> t -> t val min : t -> t -> t end (*----------------------------------------------------------------------------- * Module describing signs of infinite values *---------------------------------------------------------------------------*) module Sign : sig type t = Positive | Negative val pretty : Format.formatter -> t -> unit val of_int : int -> t val compare : t -> t -> int val eq : t -> t -> bool val neg : t -> t val mul : t -> t -> t val is_pos : t -> bool val is_neg : t -> bool end (*----------------------------------------------------------------------------- * Module describing the used rounding modes *---------------------------------------------------------------------------*) module Rounding : sig (** We only use the rounding to nearest (represented by the constructor Near), the rounding toward +oo (represented by the constructor Up) and the rounding toward -oo (represented by the constructor Down) *) type t = Up | Down | Near val pretty : Format.formatter -> t -> unit val eq : t -> t -> bool end (*----------------------------------------------------------------------------- * Module describing the interaction mode *---------------------------------------------------------------------------*) module Mode : sig (** Those constructors corresponds to the possible values of the option -eva-numerors-mode *) type t = Abs_From_Rel | Rel_From_Abs | No_Interaction | With_Interactions val get : unit -> t end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_value.ml����������������������������0000666�0000000�0000000�00000040041�13571573400�023347� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval open Numerors_utils module I = Numerors_interval module P = Precisions module Arith = Numerors_arithmetics (*----------------------------------------------------------------------------- * Abstract value for numerical errors estimation *----------------------------------------------------------------------------- * The abstract value is a record with four fields : * - exact : interval abstraction of the real value * - approx : interval abstraction of the float value * - abs_err : interval abstraction of the absolute error value * - rel_err : interval abstraction of the relative error value * A zonotope abstraction for each of those fields may be added *---------------------------------------------------------------------------*) type err = Top | Zero | Elt of Arith.t (*----------------------------------------------------------------------------- * Pretty printer *---------------------------------------------------------------------------*) let pp_print fmt = function | Elt t -> Arith.pretty fmt t | Zero -> Format.fprintf fmt "{ZERO}" | Top -> Format.fprintf fmt "{TOP}" (*----------------------------------------------------------------------------- * Set errors to top *---------------------------------------------------------------------------*) let set_absolute_to_top = function | Elt e -> Elt { e with Arith.abs_err = I.top ~prec:P.Real } | err -> err let set_relative_to_top = function | Elt e -> Elt { e with Arith.rel_err = I.top ~prec:P.Real } | err -> err (*----------------------------------------------------------------------------- * Lattice structure *---------------------------------------------------------------------------*) let top = Top let is_included x y = match x, y with | Zero, Zero | _, Top -> true | Zero, Elt t -> Arith.is_included (Arith.zero t) t | Elt a, Elt b -> Arith.is_included a b | Elt _, Zero | Top, _ -> false let join x y = match x, y with | Zero, Zero -> Zero | Top, _ | _, Top -> Top | Elt a, Zero | Zero, Elt a -> Elt (Arith.join (Arith.zero a) a) | Elt a, Elt b -> Elt (Arith.join a b) let narrow x y = match x, y with | Zero, Zero -> `Value Zero | Top, t | t, Top -> `Value t | Elt a, Zero | Zero, Elt a -> Arith.narrow (Arith.zero a) a >>- fun t -> `Value (Elt t) | Elt a, Elt b -> Arith.narrow a b >>- fun t -> `Value (Elt t) let reduce _ t = `Value t (*----------------------------------------------------------------------------- * Elements needed for Eva core *---------------------------------------------------------------------------*) module T = struct type t = err include Datatype.Undefined let structural_descr = Structural_descr.t_unknown let compare x y = match x, y with | Elt a, Elt b -> Arith.compare a b | Top, Top | Zero, Zero -> 0 | Top, _ | _, Zero -> 1 | _, Top | Zero, _ -> -1 let equal = Datatype.from_compare let hash = Hashtbl.hash let reprs = [top] let name = "Value.Numerors_values.Numerors" let pretty = pp_print end include Datatype.Make(T) let pretty_debug = pretty let pretty_typ _ = pretty let key = Structure.Key_Value.create_key "numerors_values" (*----------------------------------------------------------------------------- * Constructors *---------------------------------------------------------------------------*) let zero = Zero let one = top let top_int = top let inject_int _ _ = top let create exact approx abs_err rel_err = Elt (Arith.create exact approx abs_err rel_err) let of_ints ~prec min max = let exact = I.of_ints ~prec:P.Real (min, max) in let approx = I.of_ints ~prec:prec (min, max) in let abs_err = I.zero ~prec:P.Real in let rel_err = I.zero ~prec:P.Real in create exact approx abs_err rel_err (*----------------------------------------------------------------------------- * Miscellaneous *---------------------------------------------------------------------------*) (* Handle the computation mode for the forward operations *) let mode_on_errors exact approx abs_err rel_err = Elt (Arith.forward_interaction (Arith.create exact approx abs_err rel_err)) (*----------------------------------------------------------------------------- * Arithmetic import *---------------------------------------------------------------------------*) module Exact = Arith.Exact module Approx = Arith.Approx module Abs_Err = Arith.Abs_Err module Rel_Err = Arith.Rel_Err (*----------------------------------------------------------------------------- * Numerors value of a constant *---------------------------------------------------------------------------*) let constant _ = function | CReal (r, fkind, opt) -> let prec = Precisions.of_fkind fkind in let exact = match opt with | Some s -> I.of_strings Precisions.Real (s, s) | None -> I.of_floats Precisions.Real (r, r) in let approx = I.of_floats_without_rounding prec (r, r) in let abs_err = I.sub approx exact in let rel_err = if I.is_zero exact then I.of_floats ~prec:P.Real (0.0, 0.0) else I.div abs_err exact in mode_on_errors exact approx abs_err rel_err | _ -> top (*----------------------------------------------------------------------------- * Forward unary operations on Numerors value *---------------------------------------------------------------------------*) let forward_unop _typ op v = match v, op with | Elt v, Neg -> let exact , approx = Exact.Forward.neg v, Approx.Forward.neg v in let abs_err = Abs_Err.Forward.neg v ~exact ~approx in let rel_err = Rel_Err.Forward.neg v ~exact ~abs_err in `Value (mode_on_errors exact approx abs_err rel_err) | Zero, Neg -> `Value zero | _, LNot | _, BNot | Top, _ -> `Value top (*----------------------------------------------------------------------------- * Forward cast on Numerors value *----------------------------------------------------------------------------- * The cast of integers into floats is actually handled by the Numerors * domain in the module <MakeNumerorsCValuesProduct>. *---------------------------------------------------------------------------*) let forward_cast ~src_type ~dst_type = function | Top -> `Value Top | Zero -> `Value Zero | Elt t -> match src_type, dst_type with | Eval_typ.TSFloat _, Eval_typ.TSFloat fk -> `Value (Elt (Arith.change_prec (Precisions.of_fkind fk) t)) | _, _ -> `Value top (*----------------------------------------------------------------------------- * Forward binary operations on Numerors values *---------------------------------------------------------------------------*) let forward_binop _typ op x y = match x, y, op with | Elt x, Elt y, PlusA -> let exact , approx = Exact.Forward.add x y, Approx.Forward.add x y in let abs_err = Abs_Err.Forward.add x y ~exact ~approx in let rel_err = Rel_Err.Forward.add x y ~exact ~abs_err in `Value (mode_on_errors exact approx abs_err rel_err) | Elt x, Elt y, MinusA -> let exact , approx = Exact.Forward.sub x y, Approx.Forward.sub x y in let abs_err = Abs_Err.Forward.sub x y ~exact ~approx in let rel_err = Rel_Err.Forward.sub x y ~exact ~abs_err in `Value (mode_on_errors exact approx abs_err rel_err) | Elt x, Elt y, Mult -> let exact , approx = Exact.Forward.mul x y, Approx.Forward.mul x y in let abs_err = Abs_Err.Forward.mul x y ~exact ~approx in let rel_err = Rel_Err.Forward.mul x y ~exact ~abs_err in `Value (mode_on_errors exact approx abs_err rel_err) | Elt x, Elt y, Div -> let exact , approx = Exact.Forward.div x y, Approx.Forward.div x y in let abs_err = Abs_Err.Forward.div x y ~exact ~approx in let rel_err = Rel_Err.Forward.div x y ~exact ~abs_err in `Value (mode_on_errors exact approx abs_err rel_err) | _, _, _ -> `Value top (*----------------------------------------------------------------------------- * Backward unary operations on Numerors values *---------------------------------------------------------------------------*) let backward_unop ~typ_arg:_ op ~arg ~res = match arg, res, op with | Elt x, Elt r, Neg -> Exact.Backward.neg x r >>- fun exact -> Approx.Backward.neg x r >>- fun approx -> Abs_Err.Backward.neg x r >>- fun abs_err -> Rel_Err.Backward.neg x r >>- fun rel_err -> `Value (Some (create exact approx abs_err rel_err)) | _, _, _ -> `Value None (*----------------------------------------------------------------------------- * Backward binary operations on Numerors values *---------------------------------------------------------------------------*) let backward_binop ~input_type:_ ~resulting_type:_ op ~left ~right ~result = match left, right, result, op with | Elt x, Elt y, Elt r, PlusA -> Exact.Backward.add x y r >>- fun (x_exact , y_exact ) -> Approx.Backward.add x y r >>- fun (x_approx , y_approx ) -> Abs_Err.Backward.add x y r >>- fun (x_abs_err , y_abs_err ) -> Rel_Err.Backward.add x y r >>- fun (x_rel_err , y_rel_err ) -> let x = create x_exact x_approx x_abs_err x_rel_err in let y = create y_exact y_approx y_abs_err y_rel_err in `Value (Some x, Some y) | Elt x, Elt y, Elt r, MinusA -> Exact.Backward.sub x y r >>- fun (x_exact , y_exact ) -> Approx.Backward.sub x y r >>- fun (x_approx , y_approx ) -> Abs_Err.Backward.sub x y r >>- fun (x_abs_err , y_abs_err ) -> Rel_Err.Backward.sub x y r >>- fun (x_rel_err , y_rel_err ) -> let x = create x_exact x_approx x_abs_err x_rel_err in let y = create y_exact y_approx y_abs_err y_rel_err in `Value (Some x, Some y) | Elt x, Elt y, Elt r, Mult -> Exact.Backward.mul x y r >>- fun (x_exact , y_exact ) -> Approx.Backward.mul x y r >>- fun (x_approx , y_approx ) -> Abs_Err.Backward.mul x y r >>- fun (x_abs_err , y_abs_err ) -> Rel_Err.Backward.mul x y r >>- fun (x_rel_err , y_rel_err ) -> let x = create x_exact x_approx x_abs_err x_rel_err in let y = create y_exact y_approx y_abs_err y_rel_err in `Value (Some x, Some y) | Elt x, Elt y, Elt r, Div -> Exact.Backward.div x y r >>- fun (x_exact , y_exact ) -> Approx.Backward.div x y r >>- fun (x_approx , y_approx ) -> Abs_Err.Backward.div x y r >>- fun (x_abs_err , y_abs_err ) -> Rel_Err.Backward.div x y r >>- fun (x_rel_err , y_rel_err ) -> let x = create x_exact x_approx x_abs_err x_rel_err in let y = create y_exact y_approx y_abs_err y_rel_err in `Value (Some x, Some y) (* x == y *) | _, _, Zero, Ne -> narrow left right >>-: fun t -> Some t, Some t (* x < y *) | Elt x, Elt y, Zero, Ge -> Arith.Backward_Comparisons.lt x y >>-: fun (x, y) -> Some (Elt x), Some (Elt y) (* x <= y *) | Elt x, Elt y, Zero, Gt -> (* x >= y *) Arith.Backward_Comparisons.le x y >>-: fun (x, y) -> Some (Elt x), Some (Elt y) (* x >= y *) | Elt x, Elt y, Zero, Lt -> Arith.Backward_Comparisons.ge x y >>-: fun (x, y) -> Some (Elt x), Some (Elt y) (* x > y *) | Elt x, Elt y, Zero, Le -> Arith.Backward_Comparisons.gt x y >>-: fun (x, y) -> Some (Elt x), Some (Elt y) | _ -> `Value (None, None) (*----------------------------------------------------------------------------- * Operations not handled on Numerors values *---------------------------------------------------------------------------*) let assume_non_zero v = `Unknown v let assume_bounded _kind _bound v = `Unknown v let assume_not_nan ~assume_finite:_ _fkind v = `Unknown v let assume_comparable _cmp v1 v2 = `Unknown (v1, v2) let rewrap_integer _ _ = top let backward_cast ~src_typ:_ ~dst_typ:_ ~src_val:_ ~dst_val:_ = `Value None let resolve_functions _ = `Top, true (*----------------------------------------------------------------------------- * Built-in to create values in a interval *---------------------------------------------------------------------------*) let dbetween min max = match min, max with | Elt min, Elt max -> let z = I.zero ~prec:P.Real in let f = I.join min.Arith.approx max.Arith.approx in let r = I.mul f (I.of_ints ~prec:P.Real (1, 1)) in let r = { Arith.exact = r ; Arith.approx = f ; Arith.abs_err = z ; Arith.rel_err = z } in `Value (Elt r) | _, _ -> `Value top let rbetween min max = match min, max with | Elt min, Elt max -> let approx = I.join min.Arith.approx max.Arith.approx in let exact = I.mul approx (I.of_ints ~prec:P.Real (1, 1)) in let rel_err = I.epsilon (I.prec min.Arith.approx) in let abs_err = I.mul rel_err exact in let res = { Arith.exact = exact ; Arith.approx = approx ; Arith.abs_err = abs_err ; Arith.rel_err = rel_err } in `Value (Elt res) | _, _ -> `Value top (*----------------------------------------------------------------------------- * Built-in for square root *---------------------------------------------------------------------------*) let sqrt = function | Elt x -> let exact = Exact.Forward.sqrt x in let approx = Approx.Forward.sqrt x in let abs_err = Abs_Err.Forward.sqrt x ~exact ~approx in let rel_err = Rel_Err.Forward.sqrt x ~exact ~abs_err in `Value (create exact approx abs_err rel_err) | _ -> `Value top (*----------------------------------------------------------------------------- * Built-in for transcendental functions *---------------------------------------------------------------------------*) let log = function | Elt x -> let exact = Exact.Forward.log x in let approx = Approx.Forward.log x in let abs_err = Abs_Err.Forward.log x ~exact ~approx in let rel_err = Rel_Err.Forward.log x ~exact ~abs_err in `Value (create exact approx abs_err rel_err) | _ -> `Value top let exp = function | Elt x -> let exact = Exact.Forward.exp x in let approx = Approx.Forward.exp x in let abs_err = Abs_Err.Forward.exp x ~exact ~approx in let rel_err = Rel_Err.Forward.exp x ~exact ~abs_err in `Value (create exact approx abs_err rel_err) | _ -> `Value top let get_max_absolute_error = function | Elt x -> Some (snd (I.get_bounds (I.abs (x.Arith.abs_err)))) | _ -> None let get_max_relative_error = function | Elt x -> Some (snd (I.get_bounds (I.abs (x.Arith.rel_err)))) | _ -> None �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/numerors/numerors_value.mli���������������������������0000666�0000000�0000000�00000005264�13571573400�023530� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Abstract_value.Leaf val pretty_debug : t Pretty_utils.formatter (** Reduction of an error value according to a floating-point interval. *) val reduce: Fval.t -> t -> t Eval.or_bottom val set_absolute_to_top : t -> t val set_relative_to_top : t -> t (** Returns the abstraction corresponding to the join of the approximation of the inputs. The real is set to the same abstraction and the errors are set to zero. *) val dbetween : t -> t -> t Eval.or_bottom (** Returns the abstraction corresponding to the join of the approximation of the inputs. The real is set to the same abstraction but for this function, we consider that the approximation is generated by rounding the exact and so the errors are set to the maximal error bounds for the real abstration. *) val rbetween : t -> t -> t Eval.or_bottom val of_ints : prec:Numerors_utils.Precisions.t -> int -> int -> t val sqrt : t -> t Eval.or_bottom val log : t -> t Eval.or_bottom val exp : t -> t Eval.or_bottom val get_max_absolute_error : t -> Numerors_float.t option val get_max_relative_error : t -> Numerors_float.t option ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/offsm_value.ml����������������������������������������0000666�0000000�0000000�00000045535�13571573400�020752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval open Cvalue open Abstract_interp let store_redundant = false (** Auxiliary functions *) let default size = let default_v = V_Or_Uninitialized.initialized V.singleton_zero in V_Offsetmap.create_isotropic ~size default_v (* This function creates a dummy validity, sufficient to read [size] bits starting from [start] *) let enough_validity ~start ~size = Base.Known (Int.zero, Int.(add start (pred size))) (* copy [size] bits from [start] in [o]. If [o] has size [size_o], [size+start <= size_o] must hold. *) let basic_copy ?(start=Int.zero) ~size o = let validity = enough_validity ~start ~size in let offsets = Ival.inject_singleton start in match V_Offsetmap.copy_slice ~validity ~offsets ~size o with | `Bottom -> assert false | `Value r -> r (* paste [src] of size [size_src] starting at [start] in [r]. If [r] has size [size_r], [size+start <= size_r] must hold. *) let basic_paste ?(start=Int.zero) ~src ~size_src dst = let size = size_src in let validity = enough_validity ~start ~size in let exact = true in let offsets = Ival.inject_singleton start in let from = src in match V_Offsetmap.paste_slice ~validity ~exact ~from ~size ~offsets dst with | `Bottom -> assert false | `Value r -> r (* Reads [size] bits starting at [start] in [o], as a single value *) let basic_find ?(start=Int.zero) ~size o = let validity = enough_validity ~start ~size in let offsets = Ival.inject_singleton start in let v = V_Offsetmap.find ~validity ~offsets ~size o in V_Or_Uninitialized.map (fun v -> V.reinterpret_as_int ~signed:false ~size v) v (* Paste [v] of size [size] at position [start] in [o] *) let basic_add ?(start=Int.zero) ~size v o = let validity = enough_validity ~start ~size in let offsets = Ival.inject_singleton start in let v = V_Or_Uninitialized.initialized v in match V_Offsetmap.update ~validity ~exact:true ~offsets ~size v o with | `Value m -> m | `Bottom -> assert false let inject ~size v = V_Offsetmap.create ~size ~size_v:size (V_Or_Uninitialized.initialized v) (** Reading a given bit *) let read_bit o bit = let v = basic_find ~start:bit ~size:Integer.one o in let v = V_Or_Uninitialized.get_v v in try let i = V.project_ival_bottom v in match Ival.contains_zero i, Ival.contains_non_zero i with | true, true -> `ZeroOne | true, false -> `Zero | false, true -> `One | false, false (* bottom *) -> `Zero with V.Not_based_on_null -> `ZeroOne (** Decompose the range [b..e] (inclusive) of [o] into ranges of consecutive equal bits. *) let explode_range o (b, e) = (* result. only [b..e] will be modified *) let r = ref o in let bit i = read_bit o (Integer.of_int i) in (* value + start of the constant interval *) let vstart = ref (bit b, b) in (* Write the current value between [snd !vstart] and [i] inclusive *) let write_current i = let v, start = !vstart in let start = Integer.of_int start in let size = Integer.length start i in match v with | `Zero -> r := basic_add ~start ~size V.singleton_zero !r | `One -> let v = V.inject_int (Integer.(pred (two_power size))) in r := basic_add ~start ~size v !r | `ZeroOne -> () (* keep the underlying value unchanged *) in for i = b+1 to e do let v = bit i in if v <> fst !vstart then begin (* previous interval finished, write it *) write_current (Integer.of_int (i-1)); vstart := (v, i); end done; write_current (Integer.of_int e); !r (** Decompose an offsetmap into ranges of consecutive equal bits. Non-constant subparts are left unchanged. *) let explode o = let r = ref o in let aux (e, b) _ = r := explode_range !r (Integer.to_int e, Integer.to_int b) in V_Offsetmap.iter aux o; List.rev (V_Offsetmap.fold (fun r v acc -> (r, v) :: acc) !r []) (** Subpart of an offsetmap (as understood by advanced iterators) *) type offsm_range = V_Or_Uninitialized.t * Int.t * Rel.t module V_OffsetmapSentinel = struct include Cvalue.V_Offsetmap let sentinel = Cvalue.V_Offsetmap.empty end module ExplodeRes = struct type t = (Int_Intervals_sig.itv * offsm_range) list let sentinel = [] end (* Cached version of {!explode} *) module CacheExplode = Binary_cache.Arity_One(V_OffsetmapSentinel)(ExplodeRes) let explode = CacheExplode.merge explode (** Read the contents of a value with repetition (i.e. a range of an offsetmap) as a single value. *) let extract size vv = let d = default size in let o = V_Offsetmap.add ~exact:true (Int.zero, Int.pred size) vv d in basic_find ~size o (** Offsetmap operations on ranges *) let equal_offsm_range (v1, s1, r1: offsm_range) (v2, s2, r2: offsm_range) = V_Or_Uninitialized.equal v1 v2 && Int.equal s1 s2 && Rel.equal r1 r2 (** Offsetmap as decomposed into a list of ranges *) type offsm_as_list = ((Int.t * Int.t) * offsm_range) list let rec merge_list (f: _ -> offsm_range -> offsm_range -> offsm_range) (l1: offsm_as_list) (l2: offsm_as_list) : offsm_as_list = match l1, l2 with | [], [] -> [] | [], _ :: _ | _ :: _, [] -> assert false | ((e1, b1 as i1), (v1, s1, r1 as vv1)) :: q1, ((e2, b2 as i2), (v2, s2, r2 as vv2)) :: q2 -> assert (Int.equal e1 e2); if b1 = b2 then (i1, f i1 vv1 vv2) :: merge_list f q1 q2 else if Int.lt b1 b2 then (* vv1 is shorter, split vv2 in two. The value for the second part (vv2') starts at [e1] while the second part itself starts at [b1 + 1]: correct the offset appropriately. *) let d = Rel.sub_abs e1 (Int.succ b1) in let vv2' = (Int.succ b1, b2), (v2, s2, Rel.add d r2) in ((e1, b1), f i1 vv1 vv2) :: merge_list f q1 (vv2' :: q2) else (* Reverse case: vv2 is shorter, split vv1 *) let d = Rel.sub_abs e1 (Int.succ b2) in let vv1' = (Int.succ b2, b1), (v1, s1, Rel.add d r1) in ((e1, b2), f i2 vv1 vv2) :: merge_list f (vv1' :: q1) q2 let map2 f o1 o2 = let l1 = explode o1 in let l2 = explode o2 in let l' = merge_list f l1 l2 in let aux acc (i, vv) = V_Offsetmap.add ~exact:true i vv acc in List.fold_left aux o1 l' (** Bitwise, pointwise operations *) (* This function detects if the [size] first bits of [(v, _size_v, off)] are all set to zero. TODO: currently, we make no attempt to return a precise answer when [v] is not zero, but its restriction to [size] bits with [off] offset would be. *) let is_zero = let zero = V_Or_Uninitialized.initialized V.singleton_zero in (fun _size (v, _size_v, _off) -> V_Or_Uninitialized.equal zero v) (* This function detects if the [size] first bits of [(v, _size_v, off)] are all set to one. TODO: currently, we make no attempt to return a precise answer when [off] is not [zero]. Also, we could improve the function by not creating V_Or_Uninitialized values, and instead directly reasoning on Ival. *) let is_all_ones size (v, _size_v, off) = Rel.equal Rel.zero off && let n = Int.(pred (two_power size)) in let one = V_Or_Uninitialized.initialized (V.inject_int n) in V_Or_Uninitialized.equal one v let lift f length (vv1: offsm_range) (vv2: offsm_range): offsm_range = let v1 = extract length vv1 in let v2 = extract length vv2 in (V_Or_Uninitialized.map2 f v1 v2, length, Rel.zero) let same_concr (v1, _, _ as vv1: offsm_range) (vv2: offsm_range) = equal_offsm_range vv1 vv2 && V_Or_Uninitialized.cardinal_zero_or_one v1 let aux_or (b, e) (vv1: offsm_range) (vv2: offsm_range) = let size = Int.length b e in if is_zero size vv1 || is_all_ones size vv2 || same_concr vv1 vv2 then vv2 else if is_zero size vv2 || is_all_ones size vv1 then vv1 else lift V.bitwise_or size vv1 vv2 let aux_and (b, e) (vv1: offsm_range) (vv2: offsm_range) = let size = Int.length b e in if is_zero size vv1 || is_all_ones size vv2 || same_concr vv1 vv2 then vv1 else if is_zero size vv2 || is_all_ones size vv1 then vv2 else (*TODO: this ~signed may be dangerous if for some reason we get two values of inverse sign. extract_bits generate always positive integers, which is good. The good solution would be have V.bitwise_and to accept both signs simultaneously. *) lift V.bitwise_and size vv1 vv2 (* O is neutral for xor, and v ^ v = 0 *) let aux_xor (b, e) (vv1: offsm_range) (vv2: offsm_range) = let size = Int.length b e in if is_zero size vv1 then vv2 else if is_zero size vv2 then vv1 else if same_concr vv1 vv2 then (V_Or_Uninitialized.initialized V.singleton_zero, Int.one, Rel.zero) else lift V.bitwise_xor size vv1 vv2 let bitwise_or = map2 aux_or let bitwise_and = map2 aux_and let bitwise_xor = map2 aux_xor module CacheOr = Binary_cache.Arity_Two (V_OffsetmapSentinel)(V_OffsetmapSentinel)(V_OffsetmapSentinel) module CacheAnd = Binary_cache.Arity_Two (V_OffsetmapSentinel)(V_OffsetmapSentinel)(V_OffsetmapSentinel) module CacheXor = Binary_cache.Arity_Two (V_OffsetmapSentinel)(V_OffsetmapSentinel)(V_OffsetmapSentinel) let bitwise_or = CacheOr.merge bitwise_or let bitwise_and = CacheAnd.merge bitwise_and let bitwise_xor = CacheXor.merge bitwise_xor (** Sign extension *) let offsm_sign_extension sign_bit size = let i = match sign_bit with | `Zero -> Ival.zero | `One -> Ival.minus_one | `ZeroOne -> Ival.(join zero minus_one) in let v_extend = V_Or_Uninitialized.initialized (V.inject_ival i) in V_Offsetmap.create ~size v_extend ~size_v:size (** Shifts *) type shift = SLeft of Int.t | SRight of Int.t * bool (* Shift implemented as an an offsetmap copy then paste. *) let shift size o shift = let r = default size in match shift with | SLeft n -> if Int.lt n size then let size_copy = Int.sub size n in let data = basic_copy ~size:size_copy o in basic_paste ~start:n ~src:data ~size_src:size_copy r else r (* Guaranteed undefined behavior ; we don't care about the result. *) | SRight (n, signed) -> if Int.lt n size then let size_copy = Int.sub size n in let data = basic_copy ~start:n ~size:size_copy o in let o' = basic_paste ~src:data ~size_src:size_copy r in if signed then let sign_bit = read_bit o (Int.pred size) in if sign_bit <> `Zero then (* We need to preserve the sign. Add {-1} or {0; -1} on the leftmost bits *) let size_ext = Int.sub size size_copy in let ext = offsm_sign_extension sign_bit size_ext in basic_paste ~start:size_copy ~src:ext ~size_src:size_ext o' else o' else o' else r (* Guaranteed undefined behavior ; we don't care about the result. *) (** Casts *) let cast ~old_size ~new_size ~signed o = if Int.equal old_size new_size then o else if Int.lt new_size old_size then (* Truncation *) basic_copy ~size:new_size o else (* Extension *) if signed then (* need to check the sign and extend accordingly *) (* Original bits, extended with zeros *) let r = default new_size in let r_o = basic_paste ~src:o ~size_src:old_size r in (* Bits of sign extension *) let sign_bit = read_bit o (Int.pred old_size) in let size_ext = Int.sub new_size old_size in let ext = offsm_sign_extension sign_bit size_ext in basic_paste ~start:old_size ~src:ext ~size_src:size_ext r_o else let r = default new_size in basic_paste ~src:o ~size_src:old_size r (** Binary not *) let bnot o = let aux itv (v, s, rel) o = let v' = V_Or_Uninitialized.map V.bitwise_signed_not v in V_Offsetmap.add ~exact:true itv (v', s, rel) o in V_Offsetmap.fold aux o o (** Datatype *) type offsm_or_top = O of V_Offsetmap.t | Top module Datatype_Offsm_or_top = Datatype.Make_with_collections(struct type t = offsm_or_top let name = "Eval_offsm.offsm_or_top" let rehash = Datatype.identity let structural_descr = Structural_descr.t_sum [| [| V_Offsetmap.packed_descr |] |] let reprs = [Top; O (List.hd V_Offsetmap.reprs)] let compare o1 o2 = match o1, o2 with | Top, Top -> 0 | O o1, O o2 -> V_Offsetmap.compare o1 o2 | O _, Top -> -1 | Top, O _ -> 1 let equal = Datatype.from_compare let hash = function | Top -> 7895 | O o -> V_Offsetmap.hash o let copy = Datatype.undefined let internal_pretty_code = Datatype.undefined let pretty fmt = function | Top -> Format.pp_print_string fmt "TopO" | O o -> Format.fprintf fmt "O @[%a@]" V_Offsetmap.pretty o let varname _ = "o" let mem_project = Datatype.never_any_project end) module Offsm : Abstract_value.Leaf with type t = offsm_or_top = struct include Datatype_Offsm_or_top let key = Structure.Key_Value.create_key "offsetmap_value" let pretty_typ typ fmt = function | Top as o -> pretty fmt o | O o -> Format.fprintf fmt "O @[%a@]" (V_Offsetmap.pretty_generic ?typ ()) o let top = Top let is_included o1 o2 = match o1, o2 with | _, Top -> true | O o1, O o2 -> V_Offsetmap.is_included o1 o2 | Top, O _ -> false let join o1 o2 = match o1, o2 with | Top, _ | _, Top -> Top | O o1, O o2 -> O (V_Offsetmap.join o1 o2) let narrow o1 o2 = match o1, o2 with | Top, o | o, Top -> `Value o | O o1, O o2 -> V_Offsetmap.narrow_reinterpret o1 o2 >>-: (fun o -> O o) (* Simple values cannot be injected because we do not known their type (hence size in bits *) let zero = Top let one = Top let top_int = Top let inject_int typ i = try let size = Integer.of_int (Cil.bitsSizeOf typ) in O (inject ~size (V.inject_int i)) with Cil.SizeOfError _ -> Top let assume_non_zero v = `Unknown v let assume_bounded _ _ v = `Unknown v let assume_not_nan ~assume_finite:_ _ v = `Unknown v let assume_comparable _ v1 v2 = `Unknown (v1, v2) let constant e _c = if store_redundant then match Cil.constFoldToInt e with | Some i -> inject_int (Cil.typeOf e) i | None -> Top else Top let resolve_functions _ = `Top, true (* TODO: extract value *) let forward_unop _typ op o = let o' = match o, op with | Top, _ | _, (Neg | LNot) -> Top | O o, BNot -> O (bnot o) in `Value o' let forward_binop _typ op o1 o2 = let o' = match o1, o2, op with | O _o1, O _o2, (Shiftlt | Shiftrt) -> (* It is inconvenient to handle shift here, because we need a constant for o2 *) Top | O o1, O o2, BAnd -> O (bitwise_and o1 o2) | O o1, O o2, BOr -> O (bitwise_or o1 o2) | O o1, O o2, BXor -> O (bitwise_xor o1 o2) | _ -> Top in `Value o' let backward_binop ~input_type:_ ~resulting_type:_ _op ~left:_ ~right:_ ~result:_ = `Value (None, None) let backward_unop ~typ_arg:_ _unop ~arg:_ ~res:_ = `Value None let backward_cast ~src_typ:_ ~dst_typ:_ ~src_val:_ ~dst_val:_ = `Value None let rewrap_integer _range o = o let forward_cast ~src_type ~dst_type o = let open Eval_typ in match o, src_type, dst_type with | O o, (TSInt src | TSPtr src), (TSInt dst | TSPtr dst) -> let old_size = Int.of_int src.i_bits in let new_size = Int.of_int dst.i_bits in let signed = src.i_signed in `Value (O (cast ~old_size ~new_size ~signed o)) | _ -> `Value Top end module CvalueOffsm : Abstract.Value.Internal with type t = V.t * offsm_or_top = struct include Value_product.Make (Main_values.CVal) (Offsm) let structure = Abstract.Value.(Node (Leaf (Main_values.CVal.key, (module Main_values.CVal)), Leaf (Offsm.key, (module Offsm)))) let size typ = Integer.of_int (Cil.bitsSizeOf typ) (* Extract an offsetmap from a pair, by converting the value when needed. *) let to_offsm typ (v, o : t) = match o with | Top -> inject ~size:(size typ) v | O o -> o (* Ensure that the offsetmap component is not empty *) let strengthen_offsm typ (v, o as p : t) : t = if o = Top then (v, O (to_offsm typ p)) else p (* Refine the value component according to the contents of the offsetmap *) let strengthen_v typ (v, o as p : t) : t or_bottom = match o with | Top -> `Value p | O o' -> let size = size typ in (* TODO: this should be done by the transfer function itself... *) let v = Cvalue_forward.reinterpret typ v in let v_o = V_Or_Uninitialized.get_v (basic_find ~size o') in let v_o = Cvalue_forward.reinterpret typ v_o in let v = V.narrow v v_o in if V.is_bottom v then `Bottom else `Value (v, o) let forward_unop typ op p = match op with | BNot -> let p' = strengthen_offsm typ p in forward_unop typ op p' >>- fun p'' -> strengthen_v typ p'' | _ -> forward_unop typ op p let forward_binop typ op l r = match op with | BAnd | BOr | BXor -> let l = strengthen_offsm typ l in let r = strengthen_offsm typ r in forward_binop typ op l r >>- fun p -> strengthen_v typ p | Shiftlt | Shiftrt -> let (v_r, _) = r in let (v_l, _) = l in begin try let i = V.project_ival v_r in let i = Ival.project_int i in let signed = Bit_utils.is_signed_int_enum_pointer typ in let shiftn = if op = Shiftlt then SLeft i else SRight (i, signed) in let o = shift (size typ) (to_offsm typ l) shiftn in Main_values.CVal.forward_binop typ op v_l v_r >>-: fun v -> v, O o with V.Not_based_on_null | Ival.Not_Singleton_Int -> forward_binop typ op l r end | _ -> forward_binop typ op l r end �������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/offsm_value.mli���������������������������������������0000666�0000000�0000000�00000003631�13571573400�021112� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type offsm_or_top = O of Cvalue.V_Offsetmap.t | Top val cast : old_size: Integer.t -> new_size: Integer.t -> signed: bool -> Cvalue.V_Offsetmap.t -> Cvalue.V_Offsetmap.t module Offsm : Abstract_value.Leaf with type t = offsm_or_top module CvalueOffsm : Abstract.Value.Internal with type t = Cvalue.V.t * offsm_or_top �������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/sign_value.ml�����������������������������������������0000666�0000000�0000000�00000023350�13571573400�020567� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Eval open Abstract_interp (** Sign domain: abstraction of integer numerical values by their signs. *) type signs = { pos: bool; (** true: maybe positive, false: never positive *) zero: bool; (** true: maybe zero, false: never zero *) neg: bool; (** true: maybe negative, false: never negative *) } let top = { pos = true; zero = true; neg = true } let pos_or_zero = { pos = true; zero = true; neg = false } let pos = { pos = true; zero = false; neg = false } let neg_or_zero = { pos = false; zero = true; neg = true } let neg = { pos = false; zero = false; neg = true } let zero = { pos = false; zero = true; neg = false } let one = { pos = true; zero = false; neg = false } let non_zero = { pos = true; zero = false; neg = true } let ge_zero v = not v.neg let le_zero v = not v.pos (* Bottom is a special value (`Bottom) in Eva, and need not be part of the lattice. Here, we have a value which is equivalent to it, defined there only for commodity. *) let empty = { pos = false; zero = false; neg = false } (* Datatypes are Frama-C specific modules used among other things for serialization. There is no need to understand them in detail. They are created mostly via copy/paste of templates. *) include Datatype.Make(struct type t = signs include Datatype.Serializable_undefined let compare = Transitioning.Stdlib.compare let equal = Datatype.from_compare let hash = Hashtbl.hash let reprs = [top] let name = "Value.Sign_values.signs" let pretty fmt v = Format.fprintf fmt "%s%s%s" (if v.neg then "-" else "") (if v.zero then "0" else "") (if v.pos then "+" else "") end) let pretty_debug = pretty let pretty_typ _ = pretty (* Inclusion: test inclusion of each field. *) let is_included v1 v2 = let bincl b1 b2 = (not b1) || b2 in bincl v1.pos v2.pos && bincl v1.zero v2.zero && bincl v1.neg v2.neg (* Join of the lattice: pointwise logical or. *) let join v1 v2 = { pos = v1.pos || v2.pos; zero = v1.zero || v2.zero; neg = v1.neg || v2.neg; } (* Meet of the lattice (called 'narrow' in Eva for historical reasons). We detect the case where the values have incompatible concretization, and report this as `Bottom. *) let narrow v1 v2 = let r = { pos = v1.pos && v2.pos; zero = v1.zero && v2.zero; neg = v1.neg && v2.neg; } in if r = empty then `Bottom else `Value r let top_int = top (* [inject_int] creates an abstract value corresponding to the singleton [i]. *) let inject_int _ i = if Integer.lt i Integer.zero then neg else if Integer.gt i Integer.zero then pos else zero let constant _ = function | CInt64 (i, _, _) -> inject_int () i | _ -> top (* Extracting function pointers from an abstraction. Not implemented precisely *) let resolve_functions _ = `Top, true (** {2 Alarms} *) let assume_non_zero v = if equal v zero then `False else if v.zero then `Unknown {v with zero = false} else `True (* TODO: use the bound to reduce the value when possible. *) let assume_bounded _ _ v = `Unknown v let assume_not_nan ~assume_finite:_ _ v = `Unknown v let assume_comparable _ v1 v2 = `Unknown (v1, v2) (** {2 Forward transfer functions} *) (* The three functions below are forward transformers for the mathematical operations +, *, /, and the unary negation -. The potential overflows for the operations on machine integers are taken into account by the functions [truncate_integer] and [rewrap_integer]. *) let neg_unop v = { v with neg = v.pos; pos = v.neg } let forward_unop _ op v = match op with | Neg -> `Value (neg_unop v) | _ -> `Value top let plus v1 v2 = let neg = v1.neg || v2.neg in let pos = v1.pos || v2.pos in let same_sign v1 v2 = (le_zero v1 && le_zero v2) || (ge_zero v1 && ge_zero v2) in let zero = not (same_sign v1 v2) || (v1.zero && v2.zero) in { neg; pos; zero } let mul v1 v2 = let pos = (v1.pos && v2.pos) || (v1.neg && v2.neg) in let neg = (v1.pos && v2.neg) || (v1.neg && v2.pos) in let zero = v1.zero || v2.zero in { neg; pos; zero } let div v1 v2 = let pos = (v1.pos && v2.pos) || (v1.neg && v2.neg) in let neg = (v1.pos && v2.neg) || (v1.neg && v2.pos) in let zero = true in (* zero can appear with large enough v2 *) { neg; pos; zero } let forward_binop _ op v1 v2 = match op with | PlusA -> `Value (plus v1 v2) | MinusA -> `Value (plus v1 (neg_unop v2)) | Mult -> `Value (mul v1 v2) | Div -> if equal zero v2 then `Bottom else `Value (div v1 v2) | _ -> `Value top let rewrap_integer range v = if equal v zero then v else if range.Eval_typ.i_signed then top else pos_or_zero (* Casts from type [src_typ] to type [dst_typ]. As downcasting can wrap, we only handle upcasts precisely *) let forward_cast ~src_type ~dst_type v = let open Eval_typ in match src_type, dst_type with | TSInt range_src, TSInt range_dst -> if equal v zero then `Value v else if range_inclusion range_src range_dst then `Value v (* upcast *) else if range_dst.i_signed then `Value top (*dst_typ is signed, return all possible values*) else `Value pos_or_zero (* dst_typ is unsigned *) | _ -> (* at least one non-integer type. not handled precisely. *) `Value top (** {2 Backward transfer functions} *) (* Backward transfer functions are used to reduce the abstraction of a value, knowing other information. For example '[0+] > [0]' means that the first value can only be [+]. In the OCaml signatures, 'None' means 'I cannot reduce'. *) (* Value to return when no reduction is possible *) let unreduced = `Value None (* Function to use when a reduction is possible *) let reduced v = `Value (Some v) (* This function must reduce the value [right] assuming that the comparison [left op right] holds. *) let backward_comp_right op ~left ~right = let open Abstract_interp.Comp in match op with | Eq -> narrow left right >>- reduced | Ne -> if equal left zero then narrow right non_zero >>- reduced else unreduced | Le -> if ge_zero left then (* [left] is positive or zero. Hence, [right] is at least also positive or zero. *) if left.zero then (* [left] may be zero, [right] is positive or zero *) narrow right pos_or_zero >>- reduced else (* [left] is strictly positive, hence so is [right] *) narrow right pos >>- reduced else unreduced | Lt -> if ge_zero left then narrow right pos >>- reduced else unreduced | Ge -> if le_zero left then if left.zero then narrow right neg_or_zero >>- reduced else narrow right neg >>- reduced else unreduced | Gt -> if le_zero left then narrow right neg >>- reduced else unreduced (* This functions must reduce the values [left] and [right], assuming that [left op right == result] holds. Currently, it is only implemented for comparison operators. *) let backward_binop ~input_type:_ ~resulting_type:_ op ~left ~right ~result = match op with | Ne | Eq | Le | Lt | Ge | Gt -> let op = Value_util.conv_comp op in if equal zero result then (* The comparison is false, as it always evaluate to false. Reduce by the fact that the inverse comparison is true. *) let op = Comp.inv op in backward_comp_right op ~left ~right >>- fun right' -> backward_comp_right (Comp.sym op) ~left:right ~right:left >>- fun left' -> `Value (left', right') else if not result.zero then (* The comparison always hold, as it never evaluates to false. *) backward_comp_right op ~left ~right >>- fun right' -> backward_comp_right (Comp.sym op) ~left:right ~right:left >>- fun left' -> `Value (left', right') else (* The comparison may or may not hold, it is not possible to reduce *) `Value (None, None) | _ -> `Value (None, None) (* Not implemented precisely *) let backward_unop ~typ_arg:_ _op ~arg:_ ~res:_ = `Value None (* Not implemented precisely *) let backward_cast ~src_typ:_ ~dst_typ:_ ~src_val:_ ~dst_val:_ = `Value None (** {2 Misc} *) (* Eva boilerplate, used to retrieve the domain. *) let key = Structure.Key_Value.create_key "sign_values" ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/sign_value.mli����������������������������������������0000666�0000000�0000000�00000003352�13571573400�020740� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Sign domain: abstraction of integer numerical values by their signs. *) include Abstract_value.Leaf val pretty_debug: t Pretty_utils.formatter ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/value_product.ml��������������������������������������0000666�0000000�0000000�00000015227�13571573400�021313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Eval module Make (Left: Abstract_value.S) (Right: Abstract_value.S) = struct include Datatype.Pair (Left) (Right) let pretty_typ typ = Pretty_utils.pp_pair ~pre:"@[" ~sep:",@ " ~suf:"@]" (Left.pretty_typ typ) (Right.pretty_typ typ) let top = Left.top, Right.top let is_included (l1, r1) (l2, r2) = Left.is_included l1 l2 && Right.is_included r1 r2 let join (l1, r1) (l2, r2) = Left.join l1 l2, Right.join r1 r2 let narrow (l1, r1) (l2, r2) = Left.narrow l1 l2 >>- fun left -> Right.narrow r1 r2 >>-: fun right -> left, right let zero = Left.zero, Right.zero let one = Left.one, Right.one let top_int = Left.top_int, Right.top_int let inject_int typ i = Left.inject_int typ i, Right.inject_int typ i (* Intersects the truth values [t1] and [t2] coming from [assume_] functions from both abstract values. [v1] and [v2] are the initial values leading to these truth values, that may be reduced by the assumption. [combine] combines values from both abstract values into values of the product. *) let narrow_any_truth combine (v1, t1) (v2, t2) = match t1, t2 with | `Unreachable, _ | _, `Unreachable | (`True | `TrueReduced _), `False | `False, (`True | `TrueReduced _) -> `Unreachable | `False, _ | _, `False -> `False | `Unknown v1, `Unknown v2 -> `Unknown (combine v1 v2) | (`Unknown v1 | `TrueReduced v1), `True -> `TrueReduced (combine v1 v2) | `True, (`Unknown v2 | `TrueReduced v2) -> `TrueReduced (combine v1 v2) | (`Unknown v1 | `TrueReduced v1), (`Unknown v2 | `TrueReduced v2) -> `TrueReduced (combine v1 v2) | `True, `True -> `True let narrow_truth = narrow_any_truth (fun left right -> left, right) let assume_non_zero (left, right) = let left_truth = Left.assume_non_zero left and right_truth = Right.assume_non_zero right in narrow_truth (left, left_truth) (right, right_truth) let assume_bounded kind bound (left, right) = let left_truth = Left.assume_bounded kind bound left and right_truth = Right.assume_bounded kind bound right in narrow_truth (left, left_truth) (right, right_truth) let assume_not_nan ~assume_finite fkind (left, right) = let left_truth = Left.assume_not_nan ~assume_finite fkind left and right_truth = Right.assume_not_nan ~assume_finite fkind right in narrow_truth (left, left_truth) (right, right_truth) let assume_comparable op (l1, r1) (l2, r2) = let left_truth = Left.assume_comparable op l1 l2 and right_truth = Right.assume_comparable op r1 r2 in let combine (l1, l2) (r1, r2) = (l1, r1), (l2, r2) in narrow_any_truth combine ((l1, l2), left_truth) ((r1, r2), right_truth) let constant expr constant = let left = Left.constant expr constant and right = Right.constant expr constant in left, right let forward_unop typ unop (left, right) = Left.forward_unop typ unop left >>- fun left -> Right.forward_unop typ unop right >>-: fun right -> left, right let forward_binop typ binop (l1, r1) (l2, r2) = Left.forward_binop typ binop l1 l2 >>- fun left -> Right.forward_binop typ binop r1 r2 >>-: fun right -> left, right let rewrap_integer range (left, right) = Left.rewrap_integer range left, Right.rewrap_integer range right let forward_cast ~src_type ~dst_type (left, right) = Left.forward_cast ~src_type ~dst_type left >>- fun left -> Right.forward_cast ~src_type ~dst_type right >>-: fun right -> left, right let resolve_functions (left, right) = let list1, b1 = Left.resolve_functions left and list2, b2 = Right.resolve_functions right in let list = match list1, list2 with | `Top, _ -> list2 | _, `Top -> list1 | `Value s1, `Value s2 -> `Value (List.filter (fun f -> List.mem f s1) s2) in list, b1 && b2 let reduce (orig_left, orig_right) left right = match left, right with | None, None -> None | Some left, None -> Some (left, orig_right) | None, Some right -> Some (orig_left, right) | Some left, Some right -> Some (left, right) let backward_unop ~typ_arg unop ~arg:(arg_l, arg_r as arg) ~res:(res_l, res_r) = Left.backward_unop ~typ_arg unop ~arg:arg_l ~res:res_l >>- fun left -> Right.backward_unop ~typ_arg unop ~arg:arg_r ~res:res_r >>-: fun right -> reduce arg left right let backward_binop ~input_type ~resulting_type binop ~left ~right ~result = let l1, r1 = left and l2, r2 = right and l3, r3 = result in Left.backward_binop ~input_type ~resulting_type binop ~left:l1 ~right:l2 ~result:l3 >>- fun (l1, l2) -> Right.backward_binop ~input_type ~resulting_type binop ~left:r1 ~right:r2 ~result:r3 >>-: fun (r1, r2) -> reduce left l1 r1, reduce right l2 r2 let backward_cast ~src_typ ~dst_typ ~src_val ~dst_val = let l1, r1 = src_val and l2, r2 = dst_val in Left.backward_cast ~src_typ ~dst_typ ~src_val:l1 ~dst_val:l2 >>- fun left -> Right.backward_cast ~src_typ ~dst_typ ~src_val:r1 ~dst_val:r2 >>-: fun right -> reduce src_val left right end (* Local Variables: compile-command: "make -C ../../../.." End: *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value/values/value_product.mli�������������������������������������0000666�0000000�0000000�00000003512�13571573400�021456� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Cartesian product of two value abstractions. *) module Make (Left: Abstract_value.S) (Right: Abstract_value.S) : Abstract_value.S with type t = Left.t * Right.t (* Local Variables: compile-command: "make -C ../../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/�������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016023� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/cilE.ml������������������������������������������������0000666�0000000�0000000�00000004327�13571573400�017237� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ************************************************************************* *) (* [JS 2011/03/11] All the below stuff manage warnings of the value analysis plug-in. Refactoring required. *) (* ************************************************************************* *) type alarm_behavior = unit -> unit let a_ignore = Extlib.nop type warn_mode = {defined_logic: alarm_behavior; unspecified: alarm_behavior; others: alarm_behavior;} let warn_none_mode = { defined_logic = a_ignore; unspecified = a_ignore; others = a_ignore; } (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/cilE.mli�����������������������������������������������0000666�0000000�0000000�00000005507�13571573400�017411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Value analysis alarms @plugin development guide *) (* ************************************************************************* *) (* [JS 2011/03/11] All the below stuff manage warnings of the value analysis plug-in. Refactoring required. *) (* ************************************************************************* *) type alarm_behavior = unit -> unit val a_ignore: alarm_behavior type warn_mode = { defined_logic: alarm_behavior (** operations that raise an error only in the C, not in the logic *); unspecified: alarm_behavior (** defined but unspecified behaviors *); others: alarm_behavior (** all the remaining undefined behaviors *); } (** An argument of type [warn_mode] can be supplied to some of the access functions in {!Db.Value} (the interface to the value analysis). Each field of {!warn_mode} indicates the action to perform for each category of alarm. These fields are not completely fixed yet. However, you can use the value {!warn_none_mode} below when you have to provide an argument of type [warn_mode]. *) val warn_none_mode : warn_mode (** Do not emit any message. *) (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/cvalue.ml����������������������������������������������0000666�0000000�0000000�00000111170�13571573400�017635� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Abstract_interp open Locations open Cil_types module CardinalEstimate = struct (* We store the estimation as the log10 of the actual number. This is necessary because the number of states gets huge. None denotes a cardinal of 0. *) type t = float option let zero = None let one = Some 0.0 let of_integer x = Some(log10 (Integer.to_float x)) let infinite = Some(infinity) let mul a b = match (a,b) with | None, _ | _, None -> None | Some(a), Some(b) -> Some(a +. b);; let power a b = match a with | None -> None | a when Integer.is_one b -> a | Some(a) -> Some( a *. (Integer.to_float b)) let pretty fmt a = match a with | None -> Format.fprintf fmt "0" | Some(a) -> let value = 10.0 ** a in if value < 10000.0 then Format.fprintf fmt "%.0f" value else if (classify_float value) = FP_infinite then Format.fprintf fmt "10^%.2f" a else Format.fprintf fmt "10^%.2f (%.3g)" a value let pretty_long_log10 fmt a = match a with | None -> Format.fprintf fmt "-inf" | Some(a) -> Format.fprintf fmt "%.0f" a end module V = struct include Location_Bytes exception Not_based_on_null let project_ival m = try let k, v = find_lonely_key m in if not (Base.is_null k) then raise Not_based_on_null else v with Not_found -> raise Not_based_on_null let is_arithmetic m = try let base, _ = find_lonely_key m in Base.is_null base with Not_found -> false let project_ival_bottom m = if is_bottom m then Ival.bottom else project_ival m let project_float v = Ival.project_float (project_ival v) let is_imprecise v = match v with | Top _ -> true | _ -> false let is_topint v = equal top_int v let is_bottom v = equal bottom v let is_isotropic v = match v with | Top _ -> true | Map _ -> is_topint v || is_bottom v || is_zero v let contains_zero loc = let offset_contains_zero base offset = if Base.is_null base then Ival.contains_zero offset else let bits_offset = Ival.scale (Bit_utils.sizeofchar()) offset in not Base.(is_valid_offset No_access base bits_offset) in Location_Bytes.exists offset_contains_zero loc let contains_non_zero v = not ((equal v bottom) || (is_zero v)) let of_char c = inject_ival (Ival.of_int (Char.code c)) let of_int64 i = inject_ival (Ival.of_int64 i) let inject_int (v:Int.t) = inject_ival (Ival.inject_singleton v) let inject_float f = inject_ival (Ival.inject_float f) let interp_boolean ~contains_zero ~contains_non_zero = match contains_zero, contains_non_zero with | true, true -> zero_or_one | true, false -> singleton_zero | false, true -> singleton_one | false, false -> bottom (* Pretty-printing *) (* Pretty the partial address [b(base)+i(offsets)] in a basic way, by printing [i] as an [Ival.t] *) let pretty_base_offsets_default fmt b i = if Ival.equal Ival.zero i then Format.fprintf fmt "@[%a@]" Base.pretty_addr b else Format.fprintf fmt "@[%a +@ %a@]" Base.pretty_addr b Ival.pretty i (* Pretty the partial address [b(base)+i(offsets)], supposing it has type [typ]. Whenever possible, we print real addresses instead of bytes offsets. *) let pretty_base_offsets_typ typ fmt b i = let typ_match = match Extlib.opt_map Cil.unrollType typ with | Some (TPtr (typ_pointed, _)) -> if Cil.isVoidType typ_pointed then None else Some typ_pointed | _ -> None in try let v_base = Base.to_varinfo b in let typ_base = v_base.vtype in (* Manually pretty a cast to [typ_pointed *] *) let pretty_cast fmt ok = if not ok then match typ with | None -> Format.fprintf fmt "(? *)" | Some typ -> Format.fprintf fmt "(%a)" Printer.pp_typ typ in (* Find an offset in [typ_base] at byte [ioffset] such that the offset is of type [typ_match]. If no such offset exists, find an offset that does not have the proper type. *) let conv_offset ioffset = let ioffsbits = Int.mul ioffset (Bit_utils.sizeofchar ()) in let find_match om = fst (Bit_utils.find_offset typ_base ~offset:ioffsbits om) in try match typ_match with | None -> raise Bit_utils.NoMatchingOffset | Some typ -> find_match Bit_utils.(MatchType typ), true with Bit_utils.NoMatchingOffset -> (* Backup solution: no type to match, or no offset with the proper type. Find a matching offset with potentially the wrong type *) find_match Bit_utils.MatchFirst, false in match i with | Ival.Set [|o|] -> (* One single offset. Use a short notation, and an even shorter one if we represent [&b] *) let o, ok = conv_offset o in if o = NoOffset then Format.fprintf fmt "@[%a%a@]" pretty_cast ok Base.pretty_addr b else Format.fprintf fmt "@[%a%a%a@]" pretty_cast ok Base.pretty_addr b Printer.pp_offset o | Ival.Set a -> (* Multiple offsets. We use a set notation *) (* Catch NoOffset, which we would be printed as '{, [1], [2]}. Instead, we find a slightly deeper offset. We should never be in a different case from array/comp, as the other types cannot have multiple offsets. *) let conv_offset' o = let o, ok = conv_offset o in if o = NoOffset then let o' = match Cil.unrollType typ_base with | TArray _ -> Index (Cil.(zero builtinLoc), NoOffset) | TComp (ci, _, _) -> Field (List.hd ci.cfields, NoOffset) | _ -> raise Bit_utils.NoMatchingOffset in o', ok else o, ok in let arr_off, ok = Array.fold_right (fun o (l, ok)-> let o', ok' = conv_offset' o in o' :: l, ok && ok') a ([], true) in Format.fprintf fmt "@[%a%a{%a}@]" pretty_cast ok Base.pretty_addr b (Pretty_utils.pp_iter ~sep:",@ " List.iter Printer.pp_offset) arr_off | Ival.Top _ -> (* Too many offsets. Currently, we use the basic notation. *) pretty_base_offsets_default fmt b i | Ival.Float _ -> assert false with (* Strange looking base, or no offset found. Use default printing *) | Base.Not_a_C_variable | Bit_utils.NoMatchingOffset -> pretty_base_offsets_default fmt b i (* Pretty-print a map of bases, using auxiliary function pp_base *) let pretty_pointers fmt pp_base m = Pretty_utils.pp_iter ~pre:"@[<hov 3>{{ " ~suf:" }}@]" ~sep:" ;@ " (fun pp map -> M.iter (fun k v -> pp (k, v)) map) (fun fmt (k, v) -> pp_base fmt k v) fmt m let pretty_typ typ fmt v = let pretty_org fmt org = if not (Origin.is_top org) then Format.fprintf fmt "@ @[(origin: %a)@]" Origin.pretty org in match v with | Top (Base.SetLattice.Top, a) -> Format.fprintf fmt "{{ ANYTHING%a }}" pretty_org a | Top (Base.SetLattice.Set t, a) -> let t = Base.SetLattice.(inject (O.remove Base.null t)) in Format.fprintf fmt "{{ garbled mix of &%a%a }}" Base.SetLattice.pretty t pretty_org a | Map m -> try Ival.pretty fmt (project_ival v) with | Not_based_on_null -> try pretty_pointers fmt (pretty_base_offsets_typ typ) m with Cil.SizeOfError _ -> (* Standard printing as a set of (base+ival) *) pretty_pointers fmt pretty_base_offsets_default m let pretty fmt v = match v with | Top _ -> pretty_typ None fmt v | Map m -> try Ival.pretty fmt (project_ival v) with | Not_based_on_null -> pretty_pointers fmt pretty_base_offsets_default m (** Comparisons *) open Bottom.Type let backward_mult_int_left ~right ~result = try let right = project_ival right in let result = project_ival result in Ival.backward_mult_int_left ~right ~result >>-: Extlib.opt_map inject_ival with Not_based_on_null -> `Value None let backward_rel_int_left op l r = let open Abstract_interp.Comp in match l with | Top _ -> l | Map m1 -> try let k,v2 = find_lonely_key r in let v1 = find_or_bottom k m1 in let v1' = Ival.backward_comp_int_left op v1 v2 in let r = add k v1' l in if (not (Base.equal k Base.null)) && (op = Ge || op = Gt) then diff_if_one r singleton_zero else r with Not_found -> l (* More aggressive reduction by relational pointer operators. This version assumes that \pointer_comparable alarms have been emitted, and that we want to reduce by them. For example, &a < &b reduces to bottom, which might be problematic if &a and &b have been cast to uintptr_t *) let _backward_rel_int_left op l r = let debug = false in (* Pointwise operation on the base [b], bound to [il] in [l] *) let aux_base b il acc = let ir = find b r in if Ival.is_bottom ir then acc else let il' = Ival.backward_comp_int_left op il ir in if not (Ival.is_bottom il') then add b il' acc else acc in if true then fold_topset_ok aux_base l bottom else (* Complicated version that accepts comparisons 0 < &p *) try let il, pl = split Base.null l in let ir, pr = split Base.null r in let zl = Ival.contains_zero il in let zr = Ival.contains_zero ir in let il' = Ival.backward_comp_int_left op il ir in let pl' = fold_topset_ok aux_base pl bottom in let open Abstract_interp.Comp in (* i1' and p1' are pointwise application of the comparison operator, and will be in the result in all cases. *) if debug then Kernel.result "%a %a %a %a %a -> %a %a" Ival.pretty il pretty pl pretty_comp op Ival.pretty ir pretty pr Ival.pretty il' pretty pl'; match op, zl, zr with | (Le | Lt), false, _ (* il + pl <~ (ir + ?0) + pr *) | (Ge | Gt), _, false (* (il + ?0) + pl >~ ir + pr *) -> add Base.null il' pl' | (Le | Lt), true, _ -> (* 0 + il + pl <~ ir + pr *) if is_bottom pr then add Base.null il' pl' else (* also keep the NULL pointer, that compares less than pr *) add Base.null (Ival.join Ival.zero il') pl' | (Ge | Gt), _, true -> (* il + pl >~ 0 + pr *) (* keep all of pl, as they are all greater than 0; this includes pl'*) add Base.null il' pl | _ -> assert false with Error_Top -> l let backward_comp_int_left op l r = let open Abstract_interp.Comp in match op with | Ne -> diff_if_one l r | Eq -> narrow l r | Le | Lt | Ge | Gt -> backward_rel_int_left op l r let backward_comp_float_left_true op fkind l r = try let vl = project_ival l in let vr = project_ival r in inject_ival (Ival.backward_comp_float_left_true op fkind vl vr) with Not_based_on_null -> l let backward_comp_float_left_false op fkind l r = try let vl = project_ival l in let vr = project_ival r in inject_ival (Ival.backward_comp_float_left_false op fkind vl vr) with Not_based_on_null -> l let inject_comp_result = function | Comp.True -> singleton_one | Comp.False -> singleton_zero | Comp.Unknown -> zero_or_one let forward_rel_int ~signed op e1 e2 = let open Abstract_interp.Comp in try let k1,v1 = find_lonely_key e1 in let k2,v2 = find_lonely_key e2 in if Base.equal k1 k2 then Ival.forward_comp_int op v1 v2 else begin if signed then Unknown else begin (* k1 -> v1, k2 -> v2, k1 <> k2 *) let e1_zero = equal e1 singleton_zero in let e2_zero = equal e2 singleton_zero in if (e1_zero && (op = Le || op = Lt)) || (e2_zero && (op = Ge || op = Gt)) then True (* if e1/e2 is NULL, then e2/e1 is a pointer *) else if (e2_zero && (op = Le || op = Lt)) || (e1_zero && (op = Ge || op = Gt)) then False else Unknown end end with Not_found -> Comp.Unknown let forward_eq_int e1 e2 = if (equal e1 e2) && (cardinal_zero_or_one e1) then Comp.True else if intersects e1 e2 then Comp.Unknown else Comp.False let forward_comp_int ~signed op v1 v2 = let open Abstract_interp.Comp in match op with | Eq -> forward_eq_int v1 v2 | Ne -> inv_truth (forward_eq_int v1 v2) | Le | Ge | Lt | Gt -> forward_rel_int ~signed op v1 v2 (** Casts and reinterpretation *) let reinterpret_as_float fkind v = try let i = project_ival v in let i = Ival.reinterpret_as_float fkind i in inject_ival i with Not_based_on_null -> if is_bottom v then bottom else topify_arith_origin v let cast_float_to_float fkind v = try let i = project_ival v in let i = Ival.cast_float_to_float fkind i in inject_ival i with Not_based_on_null -> if is_bottom v then bottom else topify_arith_origin v (* Auxiliary functions for cast and reinterpration to an integer type. [on_null] is the function to apply on the numerical part. *) let to_int on_null ~size ~signed v = let integer_part, pointer_part = split Base.null v in let integer_part'= on_null ~size ~signed integer_part in (* ok_garbled indicates that we do _not_ create a (new) garbled mix *) let pointer_part', ok_garbled = if Int.ge size (Int.of_int (Bit_utils.sizeofpointer ())) || is_bottom pointer_part || is_imprecise pointer_part then pointer_part, true else topify_arith_origin pointer_part, false in if ok_garbled && integer_part' == integer_part then v (* both pointer and integer part are unchanged *) else join (inject_ival integer_part') pointer_part' let cast_int_to_int ~size ~signed v = to_int Ival.cast_int_to_int ~size ~signed v let reinterpret_as_int ~signed ~size v = to_int Ival.reinterpret_as_int ~size ~signed v let cast_float_to_int ~signed ~size v = try let v1 = project_ival v in let r = Ival.cast_float_to_int ~signed ~size v1 in inject_ival r with Not_based_on_null -> if is_bottom v then v else topify_arith_origin v let cast_float_to_int_inverse ~single_precision i = try let v1 = project_ival i in let r = Ival.cast_float_to_int_inverse ~single_precision v1 in Some (inject_ival r) with Not_based_on_null -> None let cast_int_to_float kind v = try let i = project_ival v in let r = Ival.cast_int_to_float kind i in inject_ival r with Not_based_on_null -> if is_bottom v then bottom else topify_arith_origin v let cast_int_to_float_inverse ~single_precision vf = try let ivf = project_ival vf in let i = Ival.cast_int_to_float_inverse ~single_precision ivf in Some (inject_ival i) with Not_based_on_null -> None (** Binary functions *) let import_function ~topify f e1 e2 = try let v1 = project_ival e1 in let v2 = project_ival e2 in inject_ival (f v1 v2) with Not_based_on_null -> if is_bottom e1 || is_bottom e2 then bottom else begin join (topify_with_origin_kind topify e1) (topify_with_origin_kind topify e2) end let arithmetic_function = import_function ~topify:Origin.K_Arith (* Compute the pointwise difference between two Locations_Bytes.t. *) let sub_untyped_pointwise = sub_pointwise (* compute [e1+factor*e2] using C semantic for +, i.e. [ptr+v] is [add_untyped sizeof_in_octets( *ptr) ptr v]. This function handles simultaneously PlusA, MinusA, PlusPI, MinusPI and sometimes MinusPP, by setting [factor] accordingly. This is more precise than having multiple functions, as computations such as [(int)&t[1] - (int)&t[2]] would not be treated precisely otherwise. *) let add_untyped ~topify ~factor e1 e2 = try if Int_Base.equal factor (Int_Base.minus_one) then (* Either e1 and e2 have the same base, and it's a subtraction of pointers, or e2 is really an integer *) let b1, o1 = Location_Bytes.find_lonely_key e1 in let b2, o2 = Location_Bytes.find_lonely_key e2 in if Base.compare b1 b2 <> 0 then raise Not_found; inject_ival (Ival.sub_int o1 o2) else begin if not (Int_Base.equal factor (Int_Base.one)) then raise Not_found (* cannot multiply a pointer *); try Location_Bytes.shift (project_ival_bottom e2) e1 with Not_based_on_null -> try (* On the off chance that someone writes [i+(int)&p]... *) Location_Bytes.shift (project_ival_bottom e1) e2 with Not_based_on_null -> join (topify_with_origin_kind topify e1) (topify_with_origin_kind topify e2) end with Not_found -> (* we end up here if the only way left to make this addition is to convert e2 to an integer *) try let right = Ival.scale_int_base factor (project_ival_bottom e2) in Location_Bytes.shift right e1 with Not_based_on_null -> (* from [project_ival] *) join (topify_with_origin_kind topify e1) (topify_with_origin_kind topify e2) (* Under-approximating variant of add_untyped. Takes two under-approximation, and returns an under-approximation.*) let add_untyped_under ~factor e1 e2 = if Int_Base.equal factor (Int_Base.minus_one) then (* Note: we could do a "link" for each pair of matching bases in e1 and e2, so this is an underapproximation in the most common case. *) try let b1, o1 = Location_Bytes.find_lonely_key e1 in let b2, o2 = Location_Bytes.find_lonely_key e2 in if Base.compare b1 b2 <> 0 then bottom else inject_ival (Ival.sub_int_under o1 o2) with Not_found -> bottom else if Int_Base.equal factor Int_Base.one then try Location_Bytes.shift_under (project_ival_bottom e2) e1 with Not_based_on_null -> bottom else try let right = Ival.scale_int_base factor (project_ival_bottom e2) in Location_Bytes.shift_under right e1 with Not_based_on_null -> bottom ;; let div e1 e2 = arithmetic_function Ival.div e1 e2 let c_rem e1 e2 = arithmetic_function Ival.c_rem e1 e2 let mul e1 e2 = arithmetic_function Ival.mul e1 e2 let shift_left e1 e2 = arithmetic_function Ival.shift_left e1 e2 let bitwise_xor v1 v2 = arithmetic_function Ival.bitwise_xor v1 v2 let bitwise_or v1 v2 = if equal singleton_zero v1 then v2 else if equal singleton_zero v2 then v1 else if equal v1 v2 && cardinal_zero_or_one v1 then v1 else import_function ~topify:Origin.K_Arith Ival.bitwise_or v1 v2 let bitwise_and v1 v2 = if equal v1 v2 && cardinal_zero_or_one v1 then v1 else let f i1 i2 = Ival.bitwise_and i1 i2 in import_function ~topify:Origin.K_Arith f v1 v2 let shift_right e1 e2 = arithmetic_function Ival.shift_right e1 e2 let bitwise_signed_not v = try let i = project_ival v in inject_ival (Ival.bitwise_signed_not i) with Not_based_on_null -> topify_arith_origin v let bitwise_not ~size ~signed v = try let i = project_ival v in inject_ival (Ival.bitwise_not ~size ~signed i) with Not_based_on_null -> topify_arith_origin v let extract_bits ~topify ~start ~stop ~size v = try let i = project_ival_bottom v in false, inject_ival (Ival.extract_bits ~start ~stop ~size i) with Not_based_on_null -> if is_imprecise v then false, v else (* Keep precision if we are reading all the bits of an address *) let ptr_size = Integer.of_int (Cil.(bitsSizeOfInt theMachine.upointKind)) in if Int.equal start Int.zero && Int.equal (Int.succ stop) ptr_size && Int.equal size ptr_size then false, v else true, topify_with_origin_kind topify v (* Computes [e * 2^factor]. Auxiliary function for foo_endian_merge_bits *) let shift_left_by_integer ~topify factor v = try let i = project_ival_bottom v in inject_ival (Ival.scale (Int.two_power factor) i) with | Not_based_on_null -> if Integer.is_zero factor then v else topify_with_origin_kind topify v | Z.Overflow -> top_int let restrict_topint_to_size value size = if is_topint value then inject_ival (Ival.create_all_values ~signed:false ~size) else value let shift_bits ~topify ~offset ~size v = let v = restrict_topint_to_size v (Integer.to_int size) in shift_left_by_integer ~topify offset v let merge_distinct_bits ~topify ~conflate_bottom value acc = if is_bottom acc || is_bottom value then begin if conflate_bottom then bottom else join (topify_with_origin_kind topify acc) (topify_with_origin_kind topify value) end else add_untyped ~topify ~factor:Int_Base.one value acc (* neutral value for foo_endian_merge_bits *) let merge_neutral_element = singleton_zero let all_values ~size v = if Int.(equal size zero) then true else try let i = project_ival v in Ival.all_values ~size i with Not_based_on_null -> false let anisotropic_cast ~size v = if all_values ~size v then top_int else v let create_all_values ~signed ~size = inject_ival (Ival.create_all_values ~signed ~size) let cardinal_estimate lb ~size = match lb with | Top _ -> Int.two_power size (* TODO: this could be very slow when [size] is big *) | Map m -> let card = M.fold (fun _ v card -> Int.add card (Ival.cardinal_estimate v size) ) m Int.zero in Int.min card (Int.two_power size) let add_untyped ~factor v1 v2 = add_untyped ~topify:Origin.K_Arith ~factor v1 v2 end module V_Or_Uninitialized = struct (* Note: there is a "cartesian product" of the escape and init flags in the constructors, instead of having a tuple or two sum types, for performance reasons: this avoids an indirection. *) type t = | C_uninit_esc of V.t | C_uninit_noesc of V.t | C_init_esc of V.t | C_init_noesc of V.t let make ~initialized ~escaping v = match initialized, escaping with | true, false -> C_init_noesc v | true, true -> C_init_esc v | false, false -> C_uninit_noesc v | false, true -> C_uninit_esc v let mask_init = 2 let mask_noesc = 1 (* replace "noalloc" with [@@noalloc] for OCaml version >= 4.03.0 *) [@@@ warning "-3"] external get_flags : t -> int = "caml_obj_tag" "noalloc" [@@@ warning "+3"] let is_initialized v = (get_flags v land mask_init) <> 0 let is_noesc v = (get_flags v land mask_noesc) <> 0 let get_v = function | C_uninit_esc v | C_uninit_noesc v | C_init_esc v | C_init_noesc v -> v let is_indeterminate = function | C_init_noesc _ -> false | _ -> true let create : int -> V.t -> t = fun flags v -> match flags with | 0 -> C_uninit_esc v | 1 -> C_uninit_noesc v | 2 -> C_init_esc v | 3 -> C_init_noesc v | _ -> assert false (* let (==>) = (fun x y -> (not x) || y) *) type size_widen_hint = V.size_widen_hint type numerical_widen_hint = V.numerical_widen_hint type widen_hint = V.widen_hint let widen wh t1 t2 = create (get_flags t2) (V.widen wh (get_v t1) (get_v t2)) let equal t1 t2 = (get_flags t1) = (get_flags t2) && V.equal (get_v t1) (get_v t2) let join t1 t2 = create ((get_flags t1) land (get_flags t2)) (V.join (get_v t1) (get_v t2)) let narrow t1 t2 = create ((get_flags t1) lor (get_flags t2)) (V.narrow (get_v t1) (get_v t2)) let link t1 t2 = create ((get_flags t1) land (get_flags t2)) (V.link (get_v t1) (get_v t2)) let meet t1 t2 = create ((get_flags t1) lor (get_flags t2)) (V.meet (get_v t1) (get_v t2)) let map f v = create (get_flags v) (f (get_v v)) let map2 f v1 v2 = create ((get_flags v1) land (get_flags v2)) (f (get_v v1) (get_v v2)) let bottom = C_init_noesc V.bottom let top = C_uninit_esc V.top let top_opt = Some top let is_bottom = equal bottom let uninitialized = C_uninit_noesc V.bottom let initialized v = C_init_noesc v let is_included t1 t2 = (* (t2.initialized ==> t1.initialized) && (t2.no_escaping_adr ==> t1.no_escaping_adr) && V.is_included t1.v t2.v *) let flags1 = get_flags t1 in let flags2 = get_flags t2 in (lnot flags2) lor flags1 = -1 && V.is_included (get_v t1) (get_v t2) let pretty_aux pp fmt t = let no_escaping_adr = is_noesc t in let initialized = is_initialized t in let v = get_v t in match V.(equal bottom v), initialized, no_escaping_adr with | false, false, false -> Format.fprintf fmt "%a or UNINITIALIZED or ESCAPINGADDR" pp v | true, false, false -> Format.pp_print_string fmt "UNINITIALIZED or ESCAPINGADDR" | false, false, true -> Format.fprintf fmt "%a or UNINITIALIZED" pp v | true, false, true -> Format.pp_print_string fmt "UNINITIALIZED" | false, true, false -> Format.fprintf fmt "%a or ESCAPINGADDR" pp v | true, true, false -> Format.pp_print_string fmt "ESCAPINGADDR" | false, true, true -> pp fmt v | true, true, true -> Format.pp_print_string fmt "BOTVALUE" let pretty fmt v = pretty_aux V.pretty fmt v let pretty_typ typ fmt v = pretty_aux (fun fmt v -> V.pretty_typ typ fmt v) fmt v let cardinal_zero_or_one t = match t with C_init_noesc v -> V.cardinal_zero_or_one v | C_init_esc v | C_uninit_noesc v -> V.is_bottom v | C_uninit_esc _ -> false let hash t = (get_flags t) * 4513 + (V.hash (get_v t)) include (Datatype.Make (struct type uninitialized = t type t = uninitialized (* = | C_uninit_esc of V.t | C_uninit_noesc of V.t | C_init_esc of V.t | C_init_noesc of V.t *) let name = "Cvalue.V_Or_Uninitialized" let structural_descr = let v = V.packed_descr in Structural_descr.t_sum [| [| v |]; [| v |]; [| v |]; [| v |] |] let reprs = List.fold_left (fun acc v -> List.fold_left (fun acc v -> List.fold_left (fun acc v -> C_uninit_noesc v :: acc) (C_uninit_esc v :: acc) V.reprs) (C_init_noesc v :: acc) V.reprs) (List.map (fun v -> C_init_esc v) V.reprs) V.reprs let hash = hash let equal = equal let compare = Datatype.undefined let copy = Datatype.undefined let rehash = Datatype.identity let pretty = pretty let internal_pretty_code = Datatype.undefined let varname = Datatype.undefined let mem_project = Datatype.never_any_project end) : Datatype.S with type t := t) let is_isotropic t = V.is_isotropic (get_v t) let extract_bits ~topify ~start ~stop ~size t = let inform_extract_pointer_bits, v = V.extract_bits ~topify ~start ~stop ~size (get_v t) in inform_extract_pointer_bits, create (get_flags t) v let shift_bits ~topify ~offset ~size t = create (get_flags t) (V.shift_bits ~topify ~offset ~size (get_v t)) let merge_distinct_bits ~topify ~conflate_bottom value t = create ((get_flags t) land (get_flags value)) (V.merge_distinct_bits ~topify ~conflate_bottom (get_v value) (get_v t)) let topify_with_origin o t = create (get_flags t) (V.topify_with_origin o (get_v t)) let anisotropic_cast ~size t = create (get_flags t) (V.anisotropic_cast ~size (get_v t)) let singleton_zero = C_init_noesc (V.singleton_zero) let merge_neutral_element = singleton_zero let unspecify_escaping_locals ~exact is_local t = let flags = get_flags t in let v = get_v t in let removed, v' = V.remove_escaping_locals is_local v in let t' = if removed then let flags = flags land mask_init (* add escaping flag *) in (* perform a strong escaping if [exact] holds. Otherwise, [v'] is included in [v] by definition, so we just add the flag to [v]. *) if exact then create flags v' else create flags v else t (* no update needed *) in removed, t' let reduce_by_initializedness pos v = if pos then meet v (C_init_esc V.top) else meet v (C_uninit_noesc V.bottom) let reduce_by_danglingness pos v = if pos then narrow v (C_init_esc V.bottom) else narrow v (C_uninit_noesc V.top) let remove_indeterminateness = function | C_init_noesc _ as v -> v | (C_uninit_noesc v | C_uninit_esc v | C_init_esc v) -> C_init_noesc v let cardinal_estimate v ~size = let vcard v = V.cardinal_estimate v ~size in match v with | C_init_noesc(v) -> vcard v | C_uninit_noesc(v) | C_init_esc(v) -> Integer.add Integer.one (vcard v) | C_uninit_esc(v) -> Integer.add Integer.two (vcard v) let bottom_is_strict = true end module V_Offsetmap = struct include Offsetmap.Make(V_Or_Uninitialized) let from_string s = (* Iterate on s + null terminator; same signature as List.fold_left *) let fold_string f acc s = let acc = ref acc in for i = 0 to String.length s - 1 do let v = V_Or_Uninitialized.initialized (V.of_char s.[i]) in acc := f !acc v; done; f !acc V_Or_Uninitialized.singleton_zero (** add null terminator *) in let size_char = Integer.of_int (Cil.bitsSizeOfInt IChar) in of_list fold_string s size_char let from_wstring s = let conv v = V_Or_Uninitialized.initialized (V.of_int64 v) in let fold f acc l = List.fold_left (fun acc v -> f acc (conv v)) acc l in let size_wchar = Integer.of_int Cil.(bitsSizeOf theMachine.wcharType) in of_list fold (s @ [0L]) size_wchar let from_cstring = function | Base.CSWstring w -> from_wstring w | Base.CSString s -> from_string s (* Note: it may be surprising that an offsetmap of top_ival repeated on 32 bits gives a state space of size 3^32. Indeed each bit belongs to {-1,0,1}. *) let cardinal_estimate offsetmap = let f (start,stop) (value, size, _) accu = let cardinal = V_Or_Uninitialized.cardinal_estimate value ~size in (* There are some bottom values bound to offsetmaps, for instance before the minimum of absolute valid range, that have a cardinal of zero; we ignore them. *) let cardinal = if Integer.is_zero cardinal then Integer.one else cardinal in let cardinalf = CardinalEstimate.of_integer cardinal in let repeat = Integer.(e_div (length start stop) size) in (* If a value is "cut", we still count it as if it were whole. *) let repeat = Integer.(max repeat one) in let cardinalf_repeated = CardinalEstimate.power cardinalf repeat in CardinalEstimate.mul accu cardinalf_repeated in fold f offsetmap CardinalEstimate.one exception NarrowReturnsBottom module OffsetmapNarrow = Make_Narrow(struct let top = V_Or_Uninitialized.top (* Special definition of narrow that catches newly-introduced bottom *) let narrow x y = let r = V_Or_Uninitialized.narrow x y in if V_Or_Uninitialized.is_bottom r then raise NarrowReturnsBottom; r end) let narrow x y = try `Value (OffsetmapNarrow.narrow x y) with NarrowReturnsBottom -> `Bottom let narrow_reinterpret x y = try `Value (OffsetmapNarrow.narrow_reinterpret x y) with NarrowReturnsBottom -> `Bottom end module Default_offsetmap = struct module StringOffsetmaps = State_builder.Int_hashtbl (V_Offsetmap) (struct let name = "Cvalue.Default_offsetmap.StringOffsetmaps" let dependencies = [ Ast.self ] let size = 17 end) let () = Ast.add_monotonic_state StringOffsetmaps.self let default_offsetmap base = let aux validity v = match V_Offsetmap.size_from_validity validity with | `Bottom -> `Bottom | `Value size -> `Value (V_Offsetmap.create_isotropic ~size v) in match base with | Base.Allocated (_, _, validity) -> aux validity V_Or_Uninitialized.bottom | Base.Var (_, validity) | Base.CLogic_Var (_, _, validity) -> aux validity V_Or_Uninitialized.uninitialized | Base.Null -> let validity = Base.validity base in (* The map we create is not faithful for Null: this is not a problem in practice, because the Null base is always bound to something correct in module Value/Initial_state, or is invalid. *) aux validity V_Or_Uninitialized.bottom | Base.String (id,lit) -> try `Value (StringOffsetmaps.find id) with Not_found -> let o = V_Offsetmap.from_cstring lit in StringOffsetmaps.add id o; `Value o let default_contents = Lmap.Bottom (* this works because, currently: - during the analysis, we merge maps with the same variables (all locals are explicitly present) - after the analysis, for synthetic results, we merge maps with different sets of locals, but is is ok to have missing ones considered as being bound to Bottom. - for dynamic allocation, the default value is indeed Bottom *) let name = "Cvalue.Default_offsetmap" end module Model = struct include Lmap.Make_LOffset(V_Or_Uninitialized)(V_Offsetmap)(Default_offsetmap) include Make_Narrow(V_Or_Uninitialized) let find_indeterminate ?(conflate_bottom=true) state loc = find ~conflate_bottom state loc let find ?(conflate_bottom=true) state loc = let v = find_indeterminate ~conflate_bottom state loc in V_Or_Uninitialized.get_v v let add_indeterminate_binding ~exact mem loc v = add_binding ~exact mem loc v let reduce_previous_binding state l v = assert (Locations.cardinal_zero_or_one l); let v = V_Or_Uninitialized.initialized v in add_binding ~exact:true state l v let reduce_indeterminate_binding state l v = assert (Locations.cardinal_zero_or_one l); add_binding ~exact:true state l v (* Overwrites the definition of add_binding coming from Lmap, with a signature change. *) let add_binding ~exact acc loc value = add_binding ~exact acc loc (V_Or_Uninitialized.initialized value) let uninitialize_blocks_locals blocks state = List.fold_left (fun acc block -> remove_variables block.blocals acc) state blocks let cardinal_estimate state = match state with | Bottom -> CardinalEstimate.zero | Top -> CardinalEstimate.infinite | Map(m) -> let count = ref (CardinalEstimate.one) in let f _ offsetmap = let offsetmap_card = V_Offsetmap.cardinal_estimate offsetmap in count := CardinalEstimate.mul !count offsetmap_card in iter f m; !count end (* Local Variables: compile-command: "make -C ../../.." End: *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/cvalue.mli���������������������������������������������0000666�0000000�0000000�00000033532�13571573400�020013� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Representation of Value's abstract memory. *) open Abstract_interp open Locations (** Estimation of the cardinal of the concretization of an abstract state or value. *) module CardinalEstimate: sig type t val one: t val pretty: Format.formatter -> t -> unit val pretty_long_log10: Format.formatter -> t -> unit end (** Values. *) module V : sig (** Values are essentially bytes-indexed locations, the NULL base representing basic integers or float. Operations that are not related to locations (ie that are not present in [Location_Bytes]) are defined below. *) include module type of Location_Bytes (* Too many aliases, and OCaml module system is not able to keep track of all of them. Use some shortcuts *) with type M.t = Location_Bytes.M.t and type t = Location_Bytes.t and type numerical_widen_hint = Location_Bytes.numerical_widen_hint and type size_widen_hint = Location_Bytes.size_widen_hint include module type of Offsetmap_lattice_with_isotropy with type t := t and type numerical_widen_hint := numerical_widen_hint and type size_widen_hint := size_widen_hint and type widen_hint := widen_hint val pretty_typ: Cil_types.typ option -> t Pretty_utils.formatter (** Returns true if the value may not be a pointer. *) val is_arithmetic: t -> bool exception Not_based_on_null val project_ival : t -> Ival.t (** Raises [Not_based_on_null] if the value may be a pointer. *) val project_float : t -> Fval.t (** Raises [Not_based_on_null] if the value may be a pointer. *) val project_ival_bottom: t -> Ival.t (* Temporary API, will be merged with project_ival later *) val is_imprecise : t -> bool val is_topint : t -> bool val is_bottom : t -> bool val is_isotropic : t -> bool val contains_zero : t -> bool val contains_non_zero : t -> bool val of_char : char -> t val of_int64: int64 -> t val backward_mult_int_left: right:t -> result:t -> t option Bottom.or_bottom val backward_comp_int_left: Comp.t -> t -> t -> t val backward_comp_float_left_true: Comp.t -> Fval.kind -> t -> t -> t val backward_comp_float_left_false: Comp.t -> Fval.kind -> t -> t -> t val forward_comp_int: signed:bool -> Comp.t -> t -> t -> Comp.result val inject_comp_result: Comp.result -> t val inject_int : Int.t -> t val inject_float : Fval.t -> t val interp_boolean : contains_zero:bool -> contains_non_zero:bool -> t (** [cast_int_to_int ~size ~signed v] applies to the abstract value [v] the conversion to the integer type described by [size] and [signed]. Offsets of bases other than NULL are not clipped. If they were clipped, they should be clipped at the validity of the base. The C standard does not say that [p+(1ULL<<32+1)] is the same as [p+1], it says that [p+(1ULL<<32+1)] is invalid. *) val cast_int_to_int: size:Int.t -> signed:bool -> t -> t val reinterpret_as_float: Cil_types.fkind -> t -> t val reinterpret_as_int: signed:bool -> size:Integer.t -> t -> t val cast_float_to_float: Fval.kind -> t -> t val cast_float_to_int : signed:bool -> size:int -> t -> t val cast_float_to_int_inverse : single_precision:bool -> t -> t option val cast_int_to_float : Fval.kind -> t -> t val cast_int_to_float_inverse : single_precision:bool -> t -> t option val add_untyped : factor:Int_Base.t -> t -> t -> t (** [add_untyped ~factor e1 e2] computes [e1+factor*e2] using C semantic for +, i.e. [ptr+v] is [add_untyped ~factor:sizeof( *ptr ) ptr v]. (Thus, [factor] is in bytes.) This function handles simultaneously PlusA, MinusA, PlusPI, MinusPI and sometimes MinusPP, by setting [factor] accordingly. This is more precise than having multiple functions, as computations such as [(int)&t[1] - (int)&t[2]] would not be treated precisely otherwise. *) val add_untyped_under : factor:Int_Base.t -> t -> t -> t (** Under-approximating variant of {!add_untyped}. Takes two under-approximation, and returns an under-approximation.*) val sub_untyped_pointwise: ?factor:Int_Base.t -> t -> t -> Ival.t (** See {!Locations.sub_pointwise}. In this module, [factor] is expressed in bytes. *) val mul: t -> t -> t val div: t -> t -> t val c_rem: t -> t -> t val shift_right: t -> t -> t val shift_left: t -> t -> t val bitwise_and: t -> t -> t val bitwise_xor: t -> t -> t val bitwise_or : t -> t -> t val bitwise_signed_not: t -> t val bitwise_not: size:int -> signed:bool -> t -> t (** [all_values ~size v] returns true iff v contains all integer values representable in [size] bits. *) val all_values : size:Int.t -> t -> bool val create_all_values : signed:bool -> size:int -> t (** [cardinal_estimate v ~size] returns an estimation of the cardinal of [v], knowing that [v] fits in [size] bits. *) val cardinal_estimate: t -> size:Int.t -> Int.t end (** Values with 'undefined' and 'escaping addresses' flags. *) module V_Or_Uninitialized : sig (** Semantics of the constructors: - [C_init_*]: definitely initialized - [C_uninit_*]: possibly uninitialized - [C_*_noesc]: never contains escaping addresses - [C_*_esc]: may contain escaping addresses - [C_uninit_noesc V.bottom]: guaranteed to be uninitialized - [C_init_esc V.bottom]: guaranteed to be an escaping address - [C_uninit_esc V.bottom]: either uninitialized or an escaping address - [C_init_noesc V.bottom]: "real" bottom, with an empty concretization. Corresponds to an unreachable state. *) type t = | C_uninit_esc of V.t | C_uninit_noesc of V.t | C_init_esc of V.t | C_init_noesc of V.t include module type of Offsetmap_lattice_with_isotropy with type t := t and type size_widen_hint = Location_Bytes.size_widen_hint and type numerical_widen_hint = Location_Bytes.numerical_widen_hint and type widen_hint = Locations.Location_Bytes.widen_hint include Lattice_type.With_Under_Approximation with type t:= t include Lattice_type.With_Narrow with type t := t include Lattice_type.With_Top with type t := t include Lattice_type.With_Top_Opt with type t := t val get_v : t -> V.t val make : initialized: bool -> escaping: bool -> V.t -> t val is_bottom: t -> bool (** [is_initialized v = true] implies [v] is definitely initialized. [is_initialized v = false] implies [v] is possibly uninitialized. [is_initialized v = false && is_bottom v] implies [v] is definitely uninitialized. *) val is_initialized : t -> bool (** [is_noesc v = true] implies [v] has no escaping addresses. [is_noesc v = false] implies [v] may have escaping addresses. *) val is_noesc : t -> bool (** [is_indeterminate v = false] implies [v] only has definitely initialized values and non-escaping addresses. [is_indeterminate v = true] implies [v] may have uninitialized values and/or escaping addresses. *) val is_indeterminate: t -> bool (** Returns the canonical representant of a definitely uninitialized value. *) val uninitialized: t (** [initialized v] returns the definitely initialized, non-escaping representant of [v]. *) val initialized : V.t -> t val reduce_by_initializedness : bool -> t -> t (** [reduce_by_initializedness initialized v] reduces [v] so that its result [r] verifies [\initialized(r)] if [initialized] is [true], and [!\initialized(r)] otherwise. *) val reduce_by_danglingness : bool -> t -> t (** [reduce_by_danglingness dangling v] reduces [v] so that its result [r] verifies [\dangling(r)] if [dangling] is [true], and [!\dangling(r)] otherwise. *) val remove_indeterminateness: t -> t (** Remove 'uninitialized' and 'escaping addresses' flags from the argument *) val unspecify_escaping_locals : exact:bool -> (V.M.key -> bool) -> t -> bool * t val map: (V.t -> V.t) -> t -> t val map2: (V.t -> V.t -> V.t) -> t -> t -> t (** initialized/escaping information is the join of the information on each argument. *) end (** Memory slices. They are maps from intervals to values with flags. All sizes and intervals are in bits. *) module V_Offsetmap: sig include module type of Offsetmap_sig with type v = V_Or_Uninitialized.t and type widen_hint = V_Or_Uninitialized.numerical_widen_hint val narrow: t -> t -> t Bottom.Type.or_bottom val narrow_reinterpret: t -> t -> t Bottom.Type.or_bottom (** See the corresponding functions in {!Offsetmap_sig}. *) end (** Values bound by default to a variable. *) module Default_offsetmap: sig val default_offsetmap : Base.t -> V_Offsetmap.t Bottom.or_bottom end (** Memories. They are maps from bases to memory slices *) module Model: sig (** Functions inherited from [Lmap_sig] interface *) include module type of Lmap_sig with type v = V_Or_Uninitialized.t and type offsetmap = V_Offsetmap.t and type widen_hint_base = V_Or_Uninitialized.numerical_widen_hint include Lattice_type.With_Narrow with type t := t (** {2 Finding values *} *) (** [find_indeterminate ~conflate_bottom state loc] returns the value and flags associated to [loc] in [state]. The flags are the union of the flags at all the locations and offsets corresponding to [loc]. The value is the join of all the values pointed by [l..l+loc.size-1] for all [l] among the locations in [loc]. For an individual [l], the value pointed to is determined as such: - if no part of [l..l+loc.size-1] is [V.bottom], the value is the most precise value of [V] approximating the sequence of bits present at [l..l+loc.size-1] - if [l..l+loc.size-1] points to [V.bottom] everywhere, the value is [bottom]. - if [conflate_bottom] is [true] and at least one bit pointed to by [l..l+loc.size-1] is [V.bottom], the value is [V.bottom] - if [conflate_bottom] is [false] and at least one bit pointed to by [l..l+loc.size-1] is not [V.bottom], the value is an approximation of the join of all the bits at [l..l+loc.size-1]. As a rule of thumb, you must set [conflate_bottom=true] when the operation you abstract really accesses [loc.size] bits, and when undeterminate values are an error. This is typically the case when reading a scalar value. Conversely, if you are reading many bits at once (for example, to approximate the entire contents of a struct), set [conflate_bottom] to [false] -- to account for the possibility of padding bits. The default value is [true]. *) val find_indeterminate : ?conflate_bottom:bool -> t -> location -> V_Or_Uninitialized.t (** [find ?conflate_bottom state loc] returns the same value as [find_indeterminate], but removes the indeterminate flags from the result. *) val find : ?conflate_bottom:bool -> t -> location -> V.t (** {2 Writing values into the state} *) (** [add_binding state loc v] simulates the effect of writing [v] at location [loc] in [state]. If [loc] is not writable, {!bottom} is returned. For this function, [v] is an initialized value; the function {!add_indeterminate_binding} allows to write a possibly indeterminate value to [state]. *) val add_binding : exact:bool -> t -> location -> V.t -> t val add_indeterminate_binding : exact:bool -> t -> location -> V_Or_Uninitialized.t -> t (** {2 Reducing the state} *) (** The functions below can be used to refine the value bound to a given location. In both cases, the location must be exact. *) (** [reduce_previous_binding state loc v] reduces the value associated to loc in state; use with caution, as the inclusion between the new and the old value is not checked. *) val reduce_previous_binding : t -> location -> V.t -> t (** Same behavior as [reduce_previous_binding], but takes a value with 'undefined' and 'escaping addresses' flags. *) val reduce_indeterminate_binding: t -> location -> V_Or_Uninitialized.t -> t (** {2 Misc} *) val uninitialize_blocks_locals : Cil_types.block list -> t -> t val remove_variables : Cil_types.varinfo list -> t -> t (** For variables that are coming from the AST, this is equivalent to uninitializing them. *) val cardinal_estimate: t -> CardinalEstimate.t end (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/function_Froms.ml��������������������������������������0000666�0000000�0000000�00000051506�13571573400�021357� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Locations module Deps = struct type deps = { data: Zone.t; indirect: Zone.t; } let to_zone {data; indirect} = Zone.join data indirect module DatatypeFromDeps = Datatype.Make(struct type t = deps let name = "Function_Froms.Deps.from_deps" let hash fd = Zone.hash fd.data + 37 * Zone.hash fd.indirect let compare fd1 fd2 = let c = Zone.compare fd1.data fd2.data in if c <> 0 then c else Zone.compare fd1.indirect fd2.indirect let equal = Datatype.from_compare let pretty fmt d = Zone.pretty fmt (to_zone d) let reprs = List.map (fun z -> {data = z; indirect = z}) Zone.reprs let structural_descr = Structural_descr.t_record [| Zone.packed_descr; Zone.packed_descr; |] let rehash = Datatype.identity let mem_project = Datatype.never_any_project let varname _ = "da" let internal_pretty_code = Datatype.undefined let copy = Datatype.undefined end) include DatatypeFromDeps let pretty_precise fmt {data; indirect} = let bottom_data = Zone.is_bottom data in let bottom_indirect = Zone.is_bottom indirect in match bottom_indirect, bottom_data with | true, true -> Format.fprintf fmt "\\nothing" | true, false -> Format.fprintf fmt "direct: %a" Zone.pretty data | false, true -> Format.fprintf fmt "indirect: %a" Zone.pretty indirect | false, false -> Format.fprintf fmt "indirect: %a; direct: %a" Zone.pretty indirect Zone.pretty data let from_data_deps z = { data = z; indirect = Zone.bottom } let from_indirect_deps z = { data = Zone.bottom; indirect = z } let bottom = { data = Zone.bottom; indirect = Zone.bottom; } let top = { data = Zone.top; indirect = Zone.top; } let is_included fd1 fd2 = Zone.is_included fd1.data fd2.data && Zone.is_included fd1.indirect fd2.indirect let join fd1 fd2 = if fd1 == bottom then fd2 else if fd2 == bottom then fd1 else { data = Zone.join fd1.data fd2.data; indirect = Zone.join fd1.indirect fd2.indirect } let _narrow fd1 fd2 = { data = Zone.narrow fd1.data fd2.data; indirect = Zone.narrow fd1.indirect fd2.indirect } let add_data_dep fd data = { fd with data = Zone.join fd.data data } let add_indirect_dep fd indirect = { fd with indirect = Zone.join fd.indirect indirect } let map f fd = { data = f fd.data; indirect = f fd.indirect; } end module DepsOrUnassigned = struct type deps_or_unassigned = | DepsBottom | Unassigned | AssignedFrom of Deps.t | MaybeAssignedFrom of Deps.t module DatatypeDeps = Datatype.Make(struct type t = deps_or_unassigned let name = "Function_Froms.Deps.deps" let pretty fmt = function | DepsBottom -> Format.pp_print_string fmt "DEPS_BOTTOM" | Unassigned -> Format.pp_print_string fmt "UNASSIGNED" | AssignedFrom fd -> Deps.pretty_precise fmt fd | MaybeAssignedFrom fd -> (* '(or UNASSIGNED)' would be a better pretty-printer, we use '(and SELF)' only for compatibility reasons *) Format.fprintf fmt "%a (and SELF)" Deps.pretty_precise fd let hash = function | DepsBottom -> 3 | Unassigned -> 17 | AssignedFrom fd -> 37 + 13 * Deps.hash fd | MaybeAssignedFrom fd -> 57 + 123 * Deps.hash fd let compare d1 d2 = match d1, d2 with | DepsBottom, DepsBottom | Unassigned, Unassigned -> 0 | AssignedFrom fd1, AssignedFrom fd2 | MaybeAssignedFrom fd1, MaybeAssignedFrom fd2 -> Deps.compare fd1 fd2 | DepsBottom, (Unassigned | AssignedFrom _ | MaybeAssignedFrom _) | Unassigned, (AssignedFrom _ | MaybeAssignedFrom _) | AssignedFrom _, MaybeAssignedFrom _ -> -1 | (Unassigned | AssignedFrom _ | MaybeAssignedFrom _), DepsBottom | (AssignedFrom _ | MaybeAssignedFrom _), Unassigned | MaybeAssignedFrom _, AssignedFrom _ -> 1 let equal = Datatype.from_compare let reprs = Unassigned :: List.map (fun r -> AssignedFrom r) Deps.reprs let structural_descr = let d = Deps.packed_descr in Structural_descr.t_sum [| [| d |]; [| d |] |] let rehash = Datatype.identity let mem_project = Datatype.never_any_project let varname _ = "d" let internal_pretty_code = Datatype.undefined let copy = Datatype.undefined end) let join d1 d2 = match d1, d2 with | DepsBottom, d | d, DepsBottom -> d | Unassigned, Unassigned -> Unassigned | Unassigned, AssignedFrom fd | AssignedFrom fd, Unassigned -> MaybeAssignedFrom fd | Unassigned, (MaybeAssignedFrom _ as d) | (MaybeAssignedFrom _ as d), Unassigned -> d | AssignedFrom fd1, AssignedFrom fd2 -> AssignedFrom (Deps.join fd1 fd2) | AssignedFrom fd1, MaybeAssignedFrom fd2 | MaybeAssignedFrom fd1, AssignedFrom fd2 | MaybeAssignedFrom fd1, MaybeAssignedFrom fd2 -> MaybeAssignedFrom (Deps.join fd1 fd2) let narrow _ _ = assert false (* not used yet *) let is_included d1 d2 = match d1, d2 with | DepsBottom, (DepsBottom | Unassigned | AssignedFrom _ | MaybeAssignedFrom _) | Unassigned, (Unassigned | AssignedFrom _ | MaybeAssignedFrom _) -> true | MaybeAssignedFrom fd1, (AssignedFrom fd2 | MaybeAssignedFrom fd2) | AssignedFrom fd1, AssignedFrom fd2 -> Deps.is_included fd1 fd2 | (Unassigned | AssignedFrom _ | MaybeAssignedFrom _), DepsBottom | (AssignedFrom _ | MaybeAssignedFrom _), Unassigned | AssignedFrom _, MaybeAssignedFrom _ -> false let bottom = DepsBottom let top = MaybeAssignedFrom Deps.top let default = Unassigned include DatatypeDeps let subst f d = match d with | DepsBottom -> DepsBottom | Unassigned -> Unassigned | AssignedFrom fd -> let fd' = f fd in if fd == fd' then d else AssignedFrom fd' | MaybeAssignedFrom fd -> let fd' = f fd in if fd == fd' then d else MaybeAssignedFrom fd' let pretty_precise = pretty let to_zone = function | DepsBottom | Unassigned -> Zone.bottom | AssignedFrom fd | MaybeAssignedFrom fd -> Deps.to_zone fd let to_deps = function | DepsBottom | Unassigned -> Deps.bottom | AssignedFrom fd | MaybeAssignedFrom fd -> fd let extract_data = function | DepsBottom | Unassigned -> Zone.bottom | AssignedFrom fd | MaybeAssignedFrom fd -> fd.Deps.data let extract_indirect = function | DepsBottom | Unassigned -> Zone.bottom | AssignedFrom fd | MaybeAssignedFrom fd -> fd.Deps.indirect let may_be_unassigned = function | DepsBottom | AssignedFrom _ -> false | Unassigned | MaybeAssignedFrom _ -> true let compose d1 d2 = match d1, d2 with | DepsBottom, _ | _, DepsBottom -> DepsBottom (* could indicate dead code. Not used in practice anyway *) | Unassigned, _ -> d2 | AssignedFrom _, _ -> d1 | MaybeAssignedFrom _, Unassigned -> d1 | MaybeAssignedFrom d1, MaybeAssignedFrom d2 -> MaybeAssignedFrom (Deps.join d1 d2) | MaybeAssignedFrom d1, AssignedFrom d2 -> AssignedFrom (Deps.join d1 d2) (* for backwards compatibility *) let pretty fmt fd = match fd with | DepsBottom -> Format.pp_print_string fmt "DEPS_BOTTOM" | Unassigned -> Format.pp_print_string fmt "(SELF)" | AssignedFrom d -> Zone.pretty fmt (Deps.to_zone d) | MaybeAssignedFrom d -> Format.fprintf fmt "%a (and SELF)" Zone.pretty (Deps.to_zone d) end module Memory = struct (** A From table is internally represented as a Lmap of [DepsOrUnassigned]. However, the API mostly hides this fact, and exports access functions that take or return [Deps.t] values. This way, the user needs not understand the subtleties of DepsBottom/Unassigned/MaybeAssigned. *) include Lmap_bitwise.Make_bitwise(DepsOrUnassigned) let () = imprecise_write_msg := "dependencies to update" let pretty_skip = function | DepsOrUnassigned.DepsBottom -> true | DepsOrUnassigned.Unassigned -> true | DepsOrUnassigned.AssignedFrom _ -> false | DepsOrUnassigned.MaybeAssignedFrom _ -> false let pretty = pretty_generic_printer ~skip_v:pretty_skip ~pretty_v:DepsOrUnassigned.pretty ~sep:"FROM" () let pretty_ind_data = pretty_generic_printer ~skip_v:pretty_skip ~pretty_v:DepsOrUnassigned.pretty_precise ~sep:"FROM" () (** This is the auxiliary datastructure used to write the function [find]. When we iterate over a offsetmap of value [DepsOrUnassigned], we obtain two things: (1) some dependencies; (2) some intervals that may have not been assigned, and that will appear as data dependencies (once we know the base we are iterating on). *) type find_offsm = { fo_itvs: Int_Intervals.t; fo_deps: Deps.t; } (** Once the base is known, we can obtain something of type [Deps.t] *) let convert_find_offsm base fp = let z = Zone.inject base fp.fo_itvs in Deps.add_data_dep fp.fo_deps z let empty_find_offsm = { fo_itvs = Int_Intervals.bottom; fo_deps = Deps.bottom; } let join_find_offsm fp1 fp2 = if fp1 == empty_find_offsm then fp2 else if fp2 == empty_find_offsm then fp1 else { fo_itvs = Int_Intervals.join fp1.fo_itvs fp2.fo_itvs; fo_deps = Deps.join fp1.fo_deps fp2.fo_deps; } (** Auxiliary function that collects the dependencies on some intervals of an offsetmap. *) let find_precise_offsetmap : Int_Intervals.t -> LOffset.t -> find_offsm = let cache = Hptmap_sig.PersistentCache "Function_Froms.find_precise" in let aux_find_offsm ib ie v = (* If the interval can be unassigned, we collect its bound. We also return the dependencies stored at this interval. *) let default, v = match v with | DepsOrUnassigned.DepsBottom -> false, Deps.bottom | DepsOrUnassigned.Unassigned -> true, Deps.bottom | DepsOrUnassigned.MaybeAssignedFrom v -> true, v | DepsOrUnassigned.AssignedFrom v -> false, v in { fo_itvs = if default then Int_Intervals.inject_bounds ib ie else Int_Intervals.bottom; fo_deps = v } in (* Partial application is important *) LOffset.fold_join_itvs ~cache aux_find_offsm join_find_offsm empty_find_offsm (** Collecting dependencies on a given zone. *) let find_precise : t -> Zone.t -> Deps.t = let both = find_precise_offsetmap in let conv = convert_find_offsm in (* We are querying a zone for which no dependency is stored. Hence, every base is implicitly bound to [Unassigned]. *) let empty_map z = Deps.from_data_deps z in let join = Deps.join in let empty = Deps.bottom in (* Partial application is important *) let f = fold_join_zone ~both ~conv ~empty_map ~join ~empty in fun m z -> match m with | Top -> Deps.top | Bottom -> Deps.bottom | Map m -> try f z m with Abstract_interp.Error_Top -> Deps.top let find z m = Deps.to_zone (find_precise z m) let add_binding_precise_loc ~exact access m loc v = let aux_one_loc loc m = let loc = Locations.valid_part access loc in add_binding_loc ~exact m loc (DepsOrUnassigned.AssignedFrom v) in Precise_locs.fold aux_one_loc loc m let bind_var vi v m = let z = Locations.zone_of_varinfo vi in add_binding ~exact:true m z (DepsOrUnassigned.AssignedFrom v) let unbind_var vi m = remove_base (Base.of_varinfo vi) m let add_binding ~exact m z v = add_binding ~exact m z (DepsOrUnassigned.AssignedFrom v) let add_binding_loc ~exact m loc v = add_binding_loc ~exact m loc (DepsOrUnassigned.AssignedFrom v) let is_unassigned m = LOffset.is_same_value m DepsOrUnassigned.Unassigned (* Unassigned is a neutral value for compose, on both sides *) let decide_compose m1 m2 = if m1 == m2 || is_unassigned m1 then LOffset.ReturnRight else if is_unassigned m2 then LOffset.ReturnLeft else LOffset.Recurse let compose_map = let cache = Hptmap_sig.PersistentCache "Function_Froms.Memory.compose" in (* Partial application is important because of the cache. Idempotent, because [compose x x] is always equal to [x]. *) map2 ~cache ~symmetric:false ~idempotent:true ~empty_neutral:true decide_compose DepsOrUnassigned.compose let compose m1 m2 = match m1, m2 with | Top, _ | _, Top -> Top | Map m1, Map m2 -> Map (compose_map m1 m2) | Bottom, (Map _ | Bottom) | Map _, Bottom -> Bottom (** Auxiliary function that substitutes the data right-hand part of a dependency by a pre-existing From state. The returned result is a Deps.t: the data part will be the data part of the complete result, the indirect part will be added to the indirect part of the final result. *) (* This function iterates simultaneously on a From memory, and on a zone. It is cached. The definitions below are used to call the function that does the recursive descent. *) let substitute_data_deps = (* Nothing left to substitute, return z unchanged *) let empty_right z = Deps.from_data_deps z in (* Zone to substitute is empty *) let empty_left _ = Deps.bottom in (* [b] is in the zone and substituted. Rewrite appropriately *) let both b itvs offsm = let fp = find_precise_offsetmap itvs offsm in convert_find_offsm b fp in let join = Deps.join in let empty = Deps.bottom in let cache = Hptmap_sig.PersistentCache "From_compute.subst_data" in let f_map = Zone.fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty in fun call_site_froms z -> match call_site_froms with | Bottom -> Deps.bottom | Top -> Deps.top | Map m -> try f_map z (shape m) with Abstract_interp.Error_Top -> Deps.top (** Auxiliary function that substitutes the indirect right-hand part of a dependency by a pre-existing From state. The returned result is a zone, which will be added to the indirect part of the final result. *) let substitute_indirect_deps = (* Nothing left to substitute, z is directly an indirect dependency *) let empty_right z = z in (* Zone to substitute is empty *) let empty_left _ = Zone.bottom in let both b itvs offsm = (* Both the found data and indirect dependencies are computed for indirect dependencies: merge to a single zone *) let fp = find_precise_offsetmap itvs offsm in Deps.to_zone (convert_find_offsm b fp) in let join = Zone.join in let empty = Zone.bottom in let cache = Hptmap_sig.PersistentCache "From_compute.subst_indirect" in let f_map = Zone.fold2_join_heterogeneous ~cache ~empty_left ~empty_right ~both ~join ~empty in fun call_site_froms z -> match call_site_froms with | Bottom -> Zone.bottom | Top -> Zone.top | Map m -> try f_map z (shape m) with Abstract_interp.Error_Top -> Zone.top let substitute call_site_froms deps = let open Deps in let { data; indirect } = deps in (* depending directly on an indirect dependency -> indirect, depending indirectly on a direct dependency -> indirect *) let dirdeps = substitute_data_deps call_site_froms data in let inddeps = substitute_indirect_deps call_site_froms indirect in let dir = dirdeps.data in let ind = Zone.(join dirdeps.indirect inddeps) in { data = dir; indirect = ind } type return = Deps.t let default_return = Deps.bottom let top_return = Deps.top let add_to_return ?start:(_start=0) ~size:_size ?(m=default_return) v = Deps.join m v (* let start = Ival.of_int start in let itvs = Int_Intervals.from_ival_size start size in LOffset.add_iset ~exact:true itvs (DepsOrUnassigned.AssignedFrom v) m *) let top_return_size size = add_to_return ~size Deps.top let join_return = Deps.join let collapse_return x = x end type froms = { deps_return : Memory.return; deps_table : Memory.t } let top = { deps_return = Memory.top_return; deps_table = Memory.top; } let join x y = { deps_return = Memory.join_return x.deps_return y.deps_return ; deps_table = Memory.join x.deps_table y.deps_table } let outputs { deps_table = t } = match t with | Memory.Top -> Locations.Zone.top | Memory.Bottom -> Locations.Zone.bottom | Memory.Map(m) -> Memory.fold (fun z v acc -> let open DepsOrUnassigned in match v with | DepsBottom | Unassigned -> acc | AssignedFrom _ | MaybeAssignedFrom _ -> Locations.Zone.join z acc) m Locations.Zone.bottom let inputs ?(include_self=false) t = let aux b offm acc = Memory.LOffset.fold (fun itvs deps acc -> let z = DepsOrUnassigned.to_zone deps in let self = DepsOrUnassigned.may_be_unassigned deps in let acc = Zone.join z acc in match include_self, self, b with | true, true, Some b -> Zone.join acc (Zone.inject b itvs) | _ -> acc ) offm acc in let return = Deps.to_zone t.deps_return in let aux_table b = aux (Some b) in match t.deps_table with | Memory.Top -> Zone.top | Memory.Bottom -> Zone.bottom | Memory.Map m -> Memory.fold_base aux_table m return let pretty fmt { deps_return = r ; deps_table = t } = Format.fprintf fmt "%a@\n\\result FROM @[%a@]@\n" Memory.pretty t Deps.pretty r (** same as pretty, but uses the type of the function to output more precise information. @raise Error if the given type is not a function type *) let pretty_with_type ~indirect typ fmt { deps_return = r; deps_table = t } = let (rt_typ,_,_,_) = Cil.splitFunctionType typ in if Memory.is_bottom t then Format.fprintf fmt "@[NON TERMINATING - NO EFFECTS@]" else let map_pretty = if indirect then Memory.pretty_ind_data else Memory.pretty in if Cil.isVoidType rt_typ then begin if Memory.is_empty t then Format.fprintf fmt "@[NO EFFECTS@]" else map_pretty fmt t end else let pp_space fmt = if not (Memory.is_empty t) then Format.fprintf fmt "@ " in Format.fprintf fmt "@[<v>%a%t@[\\result FROM @[%a@]@]@]" map_pretty t pp_space (if indirect then Deps.pretty_precise else Deps.pretty) r let pretty_with_type_indirect = pretty_with_type ~indirect:true let pretty_with_type = pretty_with_type ~indirect:false let hash { deps_return = dr ; deps_table = dt } = Memory.hash dt + 197 * Deps.hash dr let equal { deps_return = dr ; deps_table = dt } { deps_return = dr' ; deps_table = dt' } = Memory.equal dt dt'&& Deps.equal dr dr' include Datatype.Make (struct type t = froms let reprs = List.fold_left (fun acc o -> List.fold_left (fun acc m -> { deps_return = o; deps_table = m } :: acc) acc Memory.reprs) [] Deps.reprs let structural_descr = Structural_descr.t_record [| Deps.packed_descr; Memory.packed_descr |] let name = "Function_Froms" let hash = hash let compare = Datatype.undefined let equal = equal let pretty = pretty let internal_pretty_code = Datatype.undefined let rehash = Datatype.identity let copy = Datatype.undefined let varname = Datatype.undefined let mem_project = Datatype.never_any_project end) (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/function_Froms.mli�������������������������������������0000666�0000000�0000000�00000016010�13571573400�021517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Datastructures and common operations for the results of the From plugin. *) module Deps : sig type deps = { data: Locations.Zone.t; indirect: Locations.Zone.t; } val bottom: deps val top: deps val join: deps -> deps -> deps val to_zone: deps -> Locations.Zone.t val add_data_dep: deps -> Locations.Zone.t -> deps val add_indirect_dep: deps -> Locations.Zone.t -> deps val from_data_deps: Locations.Zone.t -> deps val from_indirect_deps: Locations.Zone.t -> deps val map: (Locations.Zone.t -> Locations.Zone.t) -> deps -> deps include Datatype.S with type t = deps val pretty_precise : Format.formatter -> t -> unit end module DepsOrUnassigned : sig type deps_or_unassigned = | DepsBottom (** Bottom of the lattice, never bound inside a memory state at a valid location. (May appear for bases for which the validity does not start at 0, currently only NULL.) *) | Unassigned (** Location has never been assigned *) | AssignedFrom of Deps.t (** Location guaranteed to have been overwritten, its contents depend on the [Deps.t] value *) | MaybeAssignedFrom of Deps.t (** Location may or may not have been overwritten *) (** The lattice is [DepsBottom <= Unassigned], [DepsBottom <= AssignedFrom z], [Unassigned <= MaybeAssignedFrom] and [AssignedFrom z <= MaybeAssignedFrom z]. *) include Lmap_bitwise.With_default with type t = deps_or_unassigned val subst: (Deps.t -> Deps.t) -> t -> t val extract_data: t -> Locations.Zone.t val extract_indirect: t -> Locations.Zone.t val may_be_unassigned: t -> bool val compose: t -> t -> t (** [compose d1 d2] is the sequential composition of [d1] after [d2], ie. the dependencies needed to execute [d1] after having executed [d2]. It is computed as [d1] if [d1 = AssignedFrom _] (as executing [d1] completely overwrites what [d2] wrote), and as a partial join between [d1] and [d2] in the other cases. *) val pretty_precise : Format.formatter -> t -> unit val to_zone: t -> Locations.Zone.t val to_deps: t -> Deps.deps end module Memory : sig include Lmap_bitwise.Location_map_bitwise with type v = DepsOrUnassigned.t (** Prints the detail of address and data dependencies, as opposed to [pretty] that prints the backwards-compatible union of them *) val pretty_ind_data : Format.formatter -> t -> unit val find: t -> Locations.Zone.t -> Locations.Zone.t (** Imprecise version of find, in which data and indirect dependencies are not distinguished *) val find_precise: t -> Locations.Zone.t -> Deps.t (** Precise version of find *) val add_binding: exact:bool -> t -> Locations.Zone.t -> Deps.t -> t val add_binding_loc: exact:bool -> t -> Locations.location -> Deps.t -> t val add_binding_precise_loc: exact:bool -> Locations.access -> t -> Precise_locs.precise_location -> Deps.t -> t val bind_var: Cil_types.varinfo -> Deps.t -> t -> t val unbind_var: Cil_types.varinfo -> t -> t val map: (DepsOrUnassigned.t -> DepsOrUnassigned.t) -> t -> t val compose: t -> t -> t (** Sequential composition. See {!DepsOrUnassigned.compose}. *) val substitute: t -> Deps.t -> Deps.t (** [substitute m d] applies [m] to [d] so that any dependency in [d] is expressed using the dependencies already present in [m]. For example, [substitute 'x From y' 'x'] returns ['y']. *) (** Dependencies for [\result]. *) type return = Deps.t (* Currently, this type is equal to [Deps.t]. However, some of the functions below are more precise, and will be more useful when 'return' are represented by a precise offsetmap. *) (** Default value to use for storing the dependencies of [\result] *) val default_return: return (** Completely imprecise return *) val top_return: return (** Completely imprecise return of the given size *) val top_return_size: Int_Base.t -> return (** Add some dependencies to [\result], between bits [start] and [start+size-1], to the [Deps.t] value; default value for [start] is 0. If [m] is specified, the dependencies are added to it. Otherwise, {!default_return} is used. *) val add_to_return: ?start:int -> size:Int_Base.t -> ?m:return -> Deps.t -> return val collapse_return: return -> Deps.t end type froms = { deps_return : Memory.return (** Dependencies for the returned value *); deps_table : Memory.t (** Dependencies on all the zones modified by the function *); } include Datatype.S with type t = froms val join: froms -> froms -> froms val top: froms (** Display dependencies of a function, using the function's type to improve readability *) val pretty_with_type: Cil_types.typ -> froms Pretty_utils.formatter (** Display dependencies of a function, using the function's type to improve readability, separating direct and indirect dependencies *) val pretty_with_type_indirect: Cil_types.typ -> froms Pretty_utils.formatter (** Extract the left part of a from result, ie. the zones that are written *) val outputs: froms -> Locations.Zone.t (** Extract the right part of a from result, ie. the zones on which the written zones depend. If [include_self] is true, and the from is of the form [x FROM y (and SELF)], [x] is added to the result; default value is [false]. *) val inputs: ?include_self:bool -> froms -> Locations.Zone.t (* Local Variables: compile-command: "make -C ../../.." End: *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/inout_type.ml������������������������������������������0000666�0000000�0000000�00000012427�13571573400�020562� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type t = { over_inputs: Locations.Zone.t; over_inputs_if_termination: Locations.Zone.t; under_outputs_if_termination: Locations.Zone.t; over_outputs: Locations.Zone.t; over_outputs_if_termination: Locations.Zone.t; } let pretty_operational_inputs_aux fmt x = Format.fprintf fmt "@[<v 2>Operational inputs:@ @[<hov>%a@]@]@ " Locations.Zone.pretty (x.over_inputs); Format.fprintf fmt "@[<v 2>Operational inputs on termination:@ @[<hov>%a@]@]@ " Locations.Zone.pretty (x.over_inputs_if_termination); Format.fprintf fmt "@[<v 2>Sure outputs:@ @[<hov>%a@]@]@ " Locations.Zone.pretty (x.under_outputs_if_termination); ;; let pretty_outputs_aux fmt x = Format.fprintf fmt "@[<v 2>Over outputs:@ @[<hov>%a@]@]@ " Locations.Zone.pretty (x.over_outputs); Format.fprintf fmt "@[<v 2>Over outputs on termination:@ @[<hov>%a@]@]@ " Locations.Zone.pretty (x.over_outputs_if_termination); ;; let wrap_vbox f fmt x = Format.fprintf fmt "@[<v>"; f fmt x; Format.fprintf fmt "@]" let pretty_operational_inputs = wrap_vbox pretty_operational_inputs_aux let pretty_outputs = wrap_vbox pretty_outputs_aux open Locations include (Datatype.Make (struct include Datatype.Serializable_undefined type inout_t = t type t = inout_t let pretty fmt x = Format.fprintf fmt "@[<v>"; pretty_operational_inputs_aux fmt x; pretty_outputs_aux fmt x; Format.fprintf fmt "@]" let structural_descr = let z = Locations.Zone.packed_descr in Structural_descr.t_record [| z; z; z; z; z |] let reprs = List.map (fun z -> { over_inputs_if_termination = z; under_outputs_if_termination = z; over_inputs = z; over_outputs = z; over_outputs_if_termination = z; }) Locations.Zone.reprs let name = "Full.tt" let hash { over_inputs_if_termination = a; under_outputs_if_termination = b; over_inputs = c; over_outputs = d; over_outputs_if_termination = e; } = Zone.hash a + 17 * Zone.hash b + 587 * Zone.hash c + 1077 * Zone.hash d + 13119 * Zone.hash e let equal { over_inputs_if_termination = a; under_outputs_if_termination = b; over_inputs = c; over_outputs = d; over_outputs_if_termination = e; } { over_inputs_if_termination = a'; under_outputs_if_termination = b'; over_inputs = c'; over_outputs = d'; over_outputs_if_termination = e'; } = Zone.equal a a' && Zone.equal b b' && Zone.equal c c' && Zone.equal d d' && Zone.equal e e' let mem_project = Datatype.never_any_project end) : Datatype.S with type t := t) let map f v = { over_inputs_if_termination = f v.over_inputs_if_termination; under_outputs_if_termination = f v.under_outputs_if_termination; over_inputs = f v.over_inputs; over_outputs = f v.over_outputs; over_outputs_if_termination = f v.over_outputs_if_termination; } let bottom = { over_inputs = Zone.bottom; over_inputs_if_termination = Zone.bottom; under_outputs_if_termination = Zone.top; over_outputs = Zone.bottom; over_outputs_if_termination = Zone.bottom; } let join c1 c2 = { over_inputs = Zone.join c1.over_inputs c2.over_inputs; over_inputs_if_termination = Zone.join c1.over_inputs_if_termination c2.over_inputs_if_termination; over_outputs = Zone.join c1.over_outputs c2.over_outputs; over_outputs_if_termination = Zone.join c1.over_outputs_if_termination c2.over_outputs_if_termination; under_outputs_if_termination = Zone.meet c1.under_outputs_if_termination c2.under_outputs_if_termination; } (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/inout_type.mli�����������������������������������������0000666�0000000�0000000�00000004451�13571573400�020731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type t = { over_inputs: Locations.Zone.t; over_inputs_if_termination: Locations.Zone.t; under_outputs_if_termination: Locations.Zone.t; over_outputs: Locations.Zone.t; over_outputs_if_termination: Locations.Zone.t; } include Datatype.S with type t := t val pretty_operational_inputs: t Pretty_utils.formatter (** Pretty-print the fields [over_inputs_if_termination], [over_inputs] and [under_outputs_if_termination] *) val pretty_outputs: t Pretty_utils.formatter (** Pretty-print the fields [over_outputs] and [over_outputs_if_termination]. *) val map: (Locations.Zone.t -> Locations.Zone.t) -> t -> t val bottom: t val join: t -> t -> t (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/precise_locs.ml����������������������������������������0000666�0000000�0000000�00000033461�13571573400�021036� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Abstract_interp open Locations type precise_offset = | POBottom (* No offset *) | POZero (* Offset zero *) | POSingleton of Int.t (* Single offset *) | POPrecise of Ival.t * (Int.t (* cardinal *)) (* Offset exactly represented by an ival *) | POImprecise of Ival.t (* Offset that could not be represented precisely *) | POShift of (* Shifted offset *) Ival.t (* number of bits/bytes to shift *) * precise_offset * Int.t (* cardinal*) (* Cardinals are over-approximated: the combination [{0, 1} + {0, 1}] is considered as having cardinal 4 instead of 3. POBottom is the only way to represent Bottom (ie [POImprecise Ival.bottom] is forbidden). Other invariants, ie. [POSingleton i] means that [i] is non-zero, are not required for correction -- only for performance. *) let rec pretty_offset fmt = function | POBottom -> Format.fprintf fmt "<Bot>" | POZero -> Format.fprintf fmt "<0>" | POSingleton i -> Format.fprintf fmt "<%a>_0" Int.pretty i | POPrecise (po, _) -> Format.fprintf fmt "<%a>p" Ival.pretty po | POImprecise po -> Format.fprintf fmt "<%a>i" Ival.pretty po | POShift (i, po, _) -> Format.fprintf fmt "<%a+%a>" pretty_offset po Ival.pretty i let rec equal_offset o1 o2 = match o1, o2 with | POBottom, POBottom -> true | POZero, POZero -> true | POSingleton i1, POSingleton i2 -> Int.equal i1 i2 | POPrecise (i1, _), POPrecise (i2, _) -> Ival.equal i1 i2 | POImprecise i1, POImprecise i2 -> Ival.equal i1 i2 | POShift (shift1, o1, _), POShift (shift2, o2, _) -> Ival.equal shift1 shift2 && equal_offset o1 o2 | _, _ -> false let offset_zero = POZero let offset_bottom = POBottom let offset_top = POImprecise Ival.top let is_bottom_offset off = off = POBottom let cardinal_zero_or_one_offset = function | POBottom | POZero | POSingleton _ -> true | POPrecise (_, c) | POShift (_, _, c) -> Int.le c Int.one | POImprecise _ -> false let small_cardinal c = Int.le c (Int.of_int (Offsetmap.get_plevel ())) let _cardinal_offset = function | POBottom -> Some Int.zero | POZero | POSingleton _ -> Some Int.one | POPrecise (_, c) -> Some c | POImprecise _ -> None | POShift (_, _, c) -> Some c let rec imprecise_offset = function | POBottom -> Ival.bottom | POZero -> Ival.zero | POSingleton i -> Ival.inject_singleton i | POPrecise (i, _) | POImprecise i -> i | POShift (shift, po, _) -> Ival.add_int shift (imprecise_offset po) let rec _scale_offset scale po = assert (Int.gt scale Int.zero); match po with | POBottom -> POBottom | POZero -> POZero | POSingleton i -> POSingleton (Int.mul i scale) | POPrecise (i, c) -> POPrecise (Ival.scale scale i, c) | POImprecise i -> POImprecise (Ival.scale scale i) | POShift (shift, po, c) -> POShift (Ival.scale scale shift, _scale_offset scale po, c) let shift_offset_by_singleton shift po = if Int.is_zero shift then po else match po with | POBottom -> POBottom | POZero -> POSingleton shift | POSingleton i -> POSingleton (Int.add i shift) | POPrecise (i, c) -> POPrecise (Ival.add_singleton_int shift i, c) | POImprecise i -> POImprecise (Ival.add_singleton_int shift i) | POShift (shift', po, c) -> POShift (Ival.add_singleton_int shift shift', po, c) let inject_ival ival = if Ival.is_bottom ival then POBottom else match Ival.cardinal ival with | Some c when small_cardinal c -> if Int.equal c Int.one then let i = Ival.project_int ival in if Int.equal i Int.zero then POZero else POSingleton (Ival.project_int ival) else POPrecise (ival, c) | _ -> POImprecise ival let shift_offset shift po = if Ival.is_bottom shift then POBottom else match po with | POBottom -> POBottom | POZero -> inject_ival shift | POImprecise i -> POImprecise (Ival.add_int shift i) | POSingleton i -> (match Ival.cardinal shift with | Some c when small_cardinal c -> if Int.equal c Int.one then POSingleton (Int.add (Ival.project_int shift) i) else POPrecise (Ival.add_singleton_int i shift, c) | _ -> POImprecise (Ival.add_int shift (imprecise_offset po))) | POPrecise (_i, cpo) -> (match Ival.cardinal shift with | Some cs -> let new_card = Int.mul cs cpo in if small_cardinal new_card then POShift (shift, po, new_card) (* may be a POPrecise depending on ilevel *) else POImprecise (Ival.add_int shift (imprecise_offset po)) | None -> POImprecise (Ival.add_int shift (imprecise_offset po))) | POShift (_shift', _po', cpo) -> (match Ival.cardinal shift with | Some cs -> let new_card = Int.mul cs cpo in if small_cardinal new_card then POShift (shift, po, new_card) (* may be a single POShift depending on the cardinals of shift/shift'*) else POImprecise (Ival.add_int shift (imprecise_offset po)) | None -> POImprecise (Ival.add_int shift (imprecise_offset po))) type precise_location_bits = | PLBottom | PLLoc of Location_Bits.t | PLVarOffset of Base.t * precise_offset | PLLocOffset of Location_Bits.t * precise_offset let pretty_loc_bits fmt = function | PLBottom -> Format.fprintf fmt "[Bot]" | PLLoc loc -> Format.fprintf fmt "[%a]" Location_Bits.pretty loc | PLVarOffset (b, po) -> Format.fprintf fmt "[%a+%a]" Base.pretty b pretty_offset po | PLLocOffset (loc, po) -> Format.fprintf fmt "[%a+%a]" Location_Bits.pretty loc pretty_offset po let equal_loc_bits l1 l2 = match l1, l2 with | PLBottom, PLBottom -> true | PLLoc l1, PLLoc l2 -> Location_Bits.equal l1 l2 | PLVarOffset (b1, o1), PLVarOffset (b2, o2) -> Base.equal b1 b2 && equal_offset o1 o2 | PLLocOffset (l1, o1), PLLocOffset (l2, o2) -> Location_Bits.equal l1 l2 && equal_offset o1 o2 | _, _ -> false let bottom_location_bits = PLBottom let cardinal_zero_or_one_location_bits = function | PLBottom -> true | PLLoc loc -> Location_Bits.cardinal_zero_or_one loc | PLVarOffset (_, po) -> cardinal_zero_or_one_offset po | PLLocOffset (loc, po) -> Location_Bits.cardinal_zero_or_one loc && cardinal_zero_or_one_offset po let inject_location_bits loc = if Location_Bits.is_bottom loc then PLBottom else PLLoc loc let combine_base_precise_offset base po = match po with | POBottom -> PLBottom | _ -> PLVarOffset (base, po) let combine_loc_precise_offset loc po = try let base, ival = Location_Bits.find_lonely_key loc in begin match shift_offset ival po with | POBottom -> PLBottom | po -> PLVarOffset (base, po) end with Not_found -> match po with | POBottom -> PLBottom | POZero -> PLLoc loc | POImprecise i -> PLLoc (Location_Bits.shift i loc) | POSingleton i -> PLLoc (Location_Bits.shift (Ival.inject_singleton i) loc) | POPrecise (i, _c) when Location_Bits.cardinal_zero_or_one loc -> PLLoc (Location_Bits.shift i loc) | POPrecise (_, c) | POShift (_, _, c) -> match Location_Bits.cardinal loc with | Some card when small_cardinal (Int.mul card c) -> PLLocOffset (loc, po) | _ -> PLLoc (Location_Bits.shift (imprecise_offset po) loc) let imprecise_location_bits = function | PLBottom -> Location_Bits.bottom | PLLoc l -> l | PLVarOffset (b, po) -> Location_Bits.inject b (imprecise_offset po) | PLLocOffset (loc, po) -> Location_Bits.shift (imprecise_offset po) loc type precise_location = { loc: precise_location_bits; size: Int_Base.t } let equal_loc pl1 pl2 = equal_loc_bits pl1.loc pl2.loc && Int_Base.equal pl1.size pl2.size let imprecise_location pl = make_loc (imprecise_location_bits pl.loc) pl.size let make_precise_loc loc ~size = { loc; size } let loc_size loc = loc.size let loc_bottom = { loc = PLBottom; size = Int_Base.top; } let is_bottom_loc pl = pl.loc = PLBottom let loc_top = { loc = PLLoc Location_Bits.top; size = Int_Base.top; } let is_top_loc pl = equal_loc loc_top pl let rec fold_offset f po acc = match po with | POBottom -> f Ival.bottom acc | POZero -> f Ival.zero acc | POSingleton i -> f (Ival.inject_singleton i) acc | POPrecise (iv, _) | POImprecise iv -> f iv acc | POShift (shift, po', _) -> let aux_po ival acc = let aux_ival shift_i acc = let ival' = Ival.add_singleton_int shift_i ival in f ival' acc in Ival.fold_int aux_ival shift acc in fold_offset aux_po po' acc let fold f pl acc = match pl.loc with | PLBottom -> acc | PLLoc l -> f (make_loc l pl.size) acc | PLVarOffset (b, po) -> let aux_po ival acc = let loc_b = Location_Bits.inject b ival in let loc = make_loc loc_b pl.size in f loc acc in fold_offset aux_po po acc | PLLocOffset (loc, po) -> let aux_po ival_po acc = let aux_loc b ival_loc acc = let aux_ival_loc i acc = let ival = Ival.add_singleton_int i ival_po in let loc_b = Location_Bits.inject b ival in let loc = make_loc loc_b pl.size in f loc acc in Ival.fold_int aux_ival_loc ival_loc acc in Location_Bits.fold_i aux_loc loc acc in fold_offset aux_po po acc let enumerate_valid_bits access loc = let aux loc z = Zone.join z (enumerate_valid_bits access loc) in fold aux loc Zone.bottom let cardinal_zero_or_one pl = not (Int_Base.is_top pl.size) && cardinal_zero_or_one_location_bits pl.loc let valid_cardinal_zero_or_one ~for_writing pl = match pl.loc with | PLBottom -> true | PLLoc lb -> let loc = make_loc lb pl.size in Locations.valid_cardinal_zero_or_one ~for_writing loc | _ -> try ignore (fold (fun loc found_one -> let access = if for_writing then Write else Read in let valid = Locations.valid_part access loc in if Locations.is_bottom_loc loc then found_one else if Locations.cardinal_zero_or_one valid then if found_one then raise Exit else true else raise Exit ) pl false); true with Exit -> false let pretty_loc fmt loc = Format.fprintf fmt "%a (size:%a)" pretty_loc_bits loc.loc Int_Base.pretty loc.size let rec reduce_offset_by_range range offset = match offset with | POBottom -> offset | POZero -> if Ival.contains_zero range then offset else POBottom | POSingleton i -> let i = Ival.inject_singleton i in if Ival.is_included i range then offset else POBottom | POPrecise (ival, card) -> let ival = Ival.narrow range ival in if Ival.is_bottom ival then POBottom else POPrecise (ival, card) | POImprecise ival -> let ival = Ival.narrow range ival in if Ival.is_bottom ival then POBottom else POImprecise ival | POShift (shift, offset, card) -> let range = Ival.sub_int range shift in let offset = reduce_offset_by_range range offset in if offset = POBottom then offset else POShift (shift, offset, card) let reduce_offset_by_validity ~bitfield access size base offset = let access = Locations.base_access ~size access in let range = Base.valid_offset ~bitfield access base in if Ival.is_bottom range then POBottom else reduce_offset_by_range range offset let reduce_by_valid_part access ~bitfield precise_loc size = match precise_loc with | PLBottom -> precise_loc | PLLoc loc -> let loc = Locations.make_loc loc size in PLLoc Locations.((valid_part access ~bitfield loc).Locations.loc) | PLVarOffset (base, offset) -> begin match reduce_offset_by_validity ~bitfield access size base offset with | POBottom -> PLBottom | offset -> PLVarOffset (base, offset) end | PLLocOffset (_loc, _offset) -> (* Reduction is difficult in this case, because we must take into account simultaneously [loc] and [offset]. We do nothing for the time being. *) precise_loc let valid_part access ~bitfield {loc; size} = { loc = reduce_by_valid_part ~bitfield access loc size; size = size } (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/precise_locs.mli���������������������������������������0000666�0000000�0000000�00000011170�13571573400�021200� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** This module provides transient datastructures that may be more precise than an {!Ival.t}, {!Locations.Location_Bits.t} and {!Locations.location} respectively, typically for l-values such as [t[i][j]], [p->t[i]], etc. Those structures do not have a lattice structure, and cannot be stored as an abstract domain. However, they can be use to model more precisely read or write accesses to semi-imprecise l-values. *) (** {2 Precise offsets} *) type precise_offset val pretty_offset : Format.formatter -> precise_offset -> unit val equal_offset: precise_offset -> precise_offset -> bool val offset_zero : precise_offset val offset_bottom : precise_offset val offset_top : precise_offset val inject_ival : Ival.t -> precise_offset val is_bottom_offset : precise_offset -> bool val imprecise_offset : precise_offset -> Ival.t (*val _scale_offset : Integer.t -> precise_offset -> precise_offset*) val shift_offset_by_singleton : Integer.t -> precise_offset -> precise_offset val shift_offset : Ival.t -> precise_offset -> precise_offset (** {2 Precise location_bits} *) type precise_location_bits val pretty_loc_bits : Format.formatter -> precise_location_bits -> unit val bottom_location_bits : precise_location_bits val inject_location_bits : Locations.Location_Bits.t -> precise_location_bits val combine_base_precise_offset : Base.t -> precise_offset -> precise_location_bits val combine_loc_precise_offset : Locations.Location_Bits.t -> precise_offset -> precise_location_bits val imprecise_location_bits : precise_location_bits -> Locations.Location_Bits.t (** {2 Precise locations} *) type precise_location val equal_loc: precise_location -> precise_location -> bool val loc_size: precise_location -> Int_Base.t val make_precise_loc : precise_location_bits -> size:Int_Base.t -> precise_location val imprecise_location : precise_location -> Locations.location val loc_bottom : precise_location val is_bottom_loc: precise_location -> bool val loc_top : precise_location val is_top_loc: precise_location -> bool val fold: (Locations.location -> 'a -> 'a) -> precise_location -> 'a -> 'a val enumerate_valid_bits: Locations.access -> precise_location -> Locations.Zone.t val valid_cardinal_zero_or_one: for_writing:bool -> precise_location -> bool (** Is the restriction of the given location to its valid part precise enough to perform a strong read, or a strong update. *) val cardinal_zero_or_one: precise_location -> bool (** Should not be used, {!valid_cardinal_zero_or_one} is almost always more useful *) val pretty_loc: precise_location Pretty_utils.formatter val valid_part: Locations.access -> bitfield:bool -> precise_location -> precise_location (** Overapproximation of the valid part of the given location (without any access, or for a read or write access). [bitfield] indicates whether the location may be the one of a bitfield, and is true by default. If it is set to false, the location is assumed to be byte aligned, and its offset (expressed in bits) is reduced to be congruent to 0 modulo 8. *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/value_types.ml�����������������������������������������0000666�0000000�0000000�00000011334�13571573400�020717� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module OCamlHashtbl = Hashtbl open Cil_types type call_site = kernel_function * kinstr module Callsite = struct include Datatype.Pair_with_collections(Kernel_function)(Cil_datatype.Kinstr) (struct let module_name = "Value_callbacks.Callpoint" end) let pretty fmt (kf, ki) = Format.fprintf fmt "%a@@%t" Kernel_function.pretty kf (fun fmt -> match ki with | Kglobal -> Format.pp_print_string fmt "<main>" | Kstmt stmt -> Format.pp_print_int fmt stmt.sid ) end let dkey_callstack = Kernel.register_category "callstack" type callstack = call_site list module Callstack = struct include Datatype.With_collections (Datatype.List(Callsite)) (struct let module_name = "Value_types.Callstack" end) (* Use default Datatype printer for debug only *) let pretty_debug = pretty let stmt_hash s = let pos = fst (Cil_datatype.Stmt.loc s) in OCamlHashtbl.seeded_hash 0 (pos.Filepath.pos_path, pos.Filepath.pos_lnum) let kf_hash kf = let name = Kernel_function.get_name kf in OCamlHashtbl.seeded_hash 0 name let ki_hash = function | Kglobal -> 1 | Kstmt s -> 5 * stmt_hash s let rec hash = function | [] -> 0 | (kf, ki) :: r -> let p = OCamlHashtbl.seeded_hash 0 (kf_hash kf, ki_hash ki, hash r) in p mod 11_316_496 (* 58 ** 4 *) let base58_map = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" (* Converts [i] into a fixed-length, 4-wide string in base-58 *) let base58_of_int n = let buf = Bytes.create 4 in Bytes.set buf 0 (String.get base58_map (n mod 58)); let n = n / 58 in Bytes.set buf 1 (String.get base58_map (n mod 58)); let n = n / 58 in Bytes.set buf 2 (String.get base58_map (n mod 58)); let n = n / 58 in Bytes.set buf 3 (String.get base58_map (n mod 58)); Bytes.to_string buf let pretty_hash fmt callstack = if Kernel.is_debug_key_enabled dkey_callstack then Format.fprintf fmt "<%s> " (base58_of_int (hash callstack)) else Format.ifprintf fmt "" let pretty_short fmt callstack = Format.fprintf fmt "%a" pretty_hash callstack; Pretty_utils.pp_flowlist ~left:"" ~sep:" <- " ~right:"" (fun fmt (kf,_) -> Kernel_function.pretty fmt kf) fmt callstack let pretty fmt callstack = Format.fprintf fmt "@[<hv>%a" pretty_hash callstack; List.iter (fun (kf,ki) -> Kernel_function.pretty fmt kf; match ki with | Kglobal -> () | Kstmt stmt -> Format.fprintf fmt " :: %a <-@ " Cil_datatype.Location.pretty (Cil_datatype.Stmt.loc stmt) ) callstack; Format.fprintf fmt "@]" end type 'a callback_result = | Normal of 'a | NormalStore of 'a * int | Reuse of int type cacheable = | Cacheable | NoCache | NoCacheCallers type call_result = { c_values: (Cvalue.V_Offsetmap.t option * Cvalue.Model.t) list; c_clobbered: Base.SetLattice.t; c_cacheable: cacheable; c_from: (Function_Froms.froms * Locations.Zone.t) option } type logic_dependencies = Locations.Zone.t Cil_datatype.Logic_label.Map.t (* Local Variables: compile-command: "make -C ../../.." End: *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/value_types.mli����������������������������������������0000666�0000000�0000000�00000007607�13571573400�021100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Declarations that are useful for plugins written on top of the results of Value. *) open Cil_types (* TODO: These types are already defined in Value_util. *) type call_site = kernel_function * kinstr type callstack = call_site list (** Value callstacks, as used e.g. in Db.Value hooks *) module Callsite: Datatype.S_with_collections with type t = call_site module Callstack: sig include Datatype.S_with_collections with type t = callstack val pretty_debug : Format.formatter -> t -> unit (** Print a hash of the callstack when '-kernel-msg-key callstack' is enabled (prints nothing otherwise). *) val pretty_hash : Format.formatter -> t -> unit (** Print a call stack without displaying call sites. *) val pretty_short : Format.formatter -> t -> unit end type 'a callback_result = | Normal of 'a | NormalStore of 'a * int | Reuse of int type cacheable = | Cacheable (** Functions whose result can be safely cached *) | NoCache (** Functions whose result should not be cached, but for which the caller can still be cached. Typically, functions printing something during the analysis. *) | NoCacheCallers (** Functions for which neither the call, neither the callers, can be cached *) (** Results of a a call to a function *) type call_result = { c_values: (** Memory states after the call *) (Cvalue.V_Offsetmap.t option (** the value returned (ie. what is after the 'return' C keyword). *) * Cvalue.Model.t (** the memory state after the function has been executed *)) list; c_clobbered: Base.SetLattice.t (** An over-approximation of the bases in which addresses of local variables might have been written *); c_cacheable: cacheable (** Is it possible to cache the result of this call? *); c_from: (Function_Froms.froms * Locations.Zone.t) option (** If not None, the froms of the function, and its sure outputs; i.e. the dependencies of the result, and the dependencies of each zone written to. *) } (** Dependencies for the evaluation of a term or a predicate: for each program point involved, sets of zones that must be read *) type logic_dependencies = Locations.Zone.t Cil_datatype.Logic_label.Map.t (* Local Variables: compile-command: "make -C ../../.." End: *) �������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/widen_type.ml������������������������������������������0000666�0000000�0000000�00000027253�13571573400�020535� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_datatype module Num_hints_stmt = Stmt.Map.Make(Ival.Widen_Hints) module Float_hints_stmt = Stmt.Map.Make(Fc_float.Widen_Hints) module Num_hints_bases = Base.Map.Make(Ival.Widen_Hints) module Float_hints_bases = Base.Map.Make(Fc_float.Widen_Hints) module Num_hints_bases_stmt = Stmt.Map.Make(Num_hints_bases) module Float_hints_bases_stmt = Stmt.Map.Make(Float_hints_bases) module Priority_bases_stmt = Stmt.Map.Make(Base.Set) type widen_hints = { priority_bases: Base.Set.t Stmt.Map.t; default_hints: Ival.Widen_Hints.t; default_float_hints: Fc_float.Widen_Hints.t; default_hints_by_stmt: Ival.Widen_Hints.t Stmt.Map.t; default_float_hints_by_stmt: Fc_float.Widen_Hints.t Stmt.Map.t; hints_by_addr: Ival.Widen_Hints.t Base.Map.t; float_hints_by_addr: Fc_float.Widen_Hints.t Base.Map.t; hints_by_addr_by_stmt: Ival.Widen_Hints.t Base.Map.t Stmt.Map.t; float_hints_by_addr_by_stmt: Fc_float.Widen_Hints.t Base.Map.t Stmt.Map.t; } (* an [empty] set of hints *) let empty = { priority_bases = Stmt.Map.empty; default_hints = Ival.Widen_Hints.empty; default_float_hints = Fc_float.Widen_Hints.empty; default_hints_by_stmt = Stmt.Map.empty; default_float_hints_by_stmt = Stmt.Map.empty; hints_by_addr = Base.Map.empty; float_hints_by_addr = Base.Map.empty; hints_by_addr_by_stmt = Stmt.Map.empty; float_hints_by_addr_by_stmt = Stmt.Map.empty; } include Datatype.Make(struct include Datatype.Serializable_undefined type t = widen_hints let name = "Widen_type.widen_hints" let structural_descr = Structural_descr.t_tuple [| Priority_bases_stmt.packed_descr; Ival.Widen_Hints.packed_descr; Fc_float.Widen_Hints.packed_descr; Num_hints_stmt.packed_descr; Float_hints_stmt.packed_descr; Num_hints_bases.packed_descr; Float_hints_bases.packed_descr; Num_hints_bases_stmt.packed_descr; Float_hints_bases_stmt.packed_descr |] let reprs = Extlib.product (fun wh fh -> { priority_bases = Stmt.Map.empty; default_hints = wh; default_float_hints = fh; default_hints_by_stmt = Stmt.Map.empty; default_float_hints_by_stmt = Stmt.Map.empty; hints_by_addr = Base.Map.empty; float_hints_by_addr = Base.Map.empty; float_hints_by_addr_by_stmt = Stmt.Map.empty; hints_by_addr_by_stmt = Stmt.Map.empty }) Ival.Widen_Hints.reprs Fc_float.Widen_Hints.reprs let mem_project = Datatype.never_any_project end) let join wh1 wh2 = let map_merge s_join os1 os2 = match os1, os2 with | Some bs1, Some bs2 -> Some (s_join bs1 bs2) | Some bs, None | None, Some bs -> Some bs | None, None -> None in { priority_bases = Stmt.Map.merge (fun _key -> map_merge Base.Set.union) wh1.priority_bases wh2.priority_bases; default_hints = Ival.Widen_Hints.union wh1.default_hints wh2.default_hints; default_float_hints = Fc_float.Widen_Hints.union wh1.default_float_hints wh2.default_float_hints; default_hints_by_stmt = Stmt.Map.merge (fun _key -> map_merge Ival.Widen_Hints.union) wh1.default_hints_by_stmt wh2.default_hints_by_stmt; default_float_hints_by_stmt = Stmt.Map.merge (fun _key -> map_merge Fc_float.Widen_Hints.union) wh1.default_float_hints_by_stmt wh2.default_float_hints_by_stmt; hints_by_addr = Base.Map.merge (fun _key -> map_merge Ival.Widen_Hints.union) wh1.hints_by_addr wh2.hints_by_addr; float_hints_by_addr = Base.Map.merge (fun _key -> map_merge Fc_float.Widen_Hints.union) wh1.float_hints_by_addr wh2.float_hints_by_addr; hints_by_addr_by_stmt = Stmt.Map.merge (fun _key -> map_merge (Base.Map.merge (fun _key -> map_merge Ival.Widen_Hints.union))) wh1.hints_by_addr_by_stmt wh2.hints_by_addr_by_stmt; float_hints_by_addr_by_stmt = Stmt.Map.merge (fun _key -> map_merge (Base.Map.merge (fun _key -> map_merge Fc_float.Widen_Hints.union))) wh1.float_hints_by_addr_by_stmt wh2.float_hints_by_addr_by_stmt; } let pretty fmt wh = let pp_bindings pp_key pp_elt fmt l = Format.fprintf fmt "%a" (Pretty_utils.pp_list ~sep:",@ " (Pretty_utils.pp_pair ~sep:" -> " pp_key pp_elt)) l in let pp_base_map pp_elt fmt m = Format.fprintf fmt "%a" (pp_bindings Base.pretty pp_elt) (Base.Map.bindings m) in let pp_stmt fmt stmt = let stmt_str = Pretty_utils.sfprintf "%a" Stmt.pretty stmt in let len = String.length stmt_str in Format.fprintf fmt "[sid:%d<%s>]" stmt.Cil_types.sid (if len < 10 then stmt_str else String.sub stmt_str 0 10 ^ "...") in Format.fprintf fmt "@[priority bases: %a@\n\ default_hints: %a@\n\ default_float_hints: %a@\n\ default_hints_by_stmt: %a@\n\ default_float_hints_by_stmt: %a@\n\ hints_by_addr: %a@\n\ float_hints_by_addr: %a@\n\ hints_by_addr_by_stmt: %a@\n\ float_hints_by_addr_by_stmt: %a@]" (pp_bindings pp_stmt Base.Set.pretty) (Stmt.Map.bindings wh.priority_bases) Ival.Widen_Hints.pretty wh.default_hints Fc_float.Widen_Hints.pretty wh.default_float_hints (Pretty_utils.pp_list ~sep:",@ " (Pretty_utils.pp_pair ~sep:" -> " pp_stmt Ival.Widen_Hints.pretty)) (Stmt.Map.bindings wh.default_hints_by_stmt) (Pretty_utils.pp_list ~sep:",@ " (Pretty_utils.pp_pair ~sep:" -> " pp_stmt Fc_float.Widen_Hints.pretty)) (Stmt.Map.bindings wh.default_float_hints_by_stmt) (Pretty_utils.pp_list ~sep:",@ " (Pretty_utils.pp_pair ~sep:" -> " Base.pretty Ival.Widen_Hints.pretty)) (Base.Map.bindings wh.hints_by_addr) (Pretty_utils.pp_list ~sep:",@ " (Pretty_utils.pp_pair ~sep:" -> " Base.pretty Fc_float.Widen_Hints.pretty)) (Base.Map.bindings wh.float_hints_by_addr) (pp_bindings pp_stmt (pp_base_map Ival.Widen_Hints.pretty)) (Stmt.Map.bindings wh.hints_by_addr_by_stmt) (pp_bindings pp_stmt (pp_base_map Fc_float.Widen_Hints.pretty)) (Stmt.Map.bindings wh.float_hints_by_addr_by_stmt) let hints_for_base default_hints hints_by_base b = let widen_hints_null = try Ival.Widen_Hints.union (Base.Map.find b hints_by_base) default_hints with Not_found -> default_hints in let widen_zero = Ival.Widen_Hints.singleton Integer.zero in (function | Base.Null -> widen_hints_null | b -> let validity = Base.validity b in match validity with | Base.Known (_, m) | Base.Unknown (_, _, m) | Base.Variable { Base.max_alloc = m } -> (* Try the frontier of the block: further accesses are invalid anyway. This also works great for constant strings (this computes the offset of the null terminator). *) let bound = Integer.(pred (e_div (succ m) eight)) in Ival.Widen_Hints.add bound widen_zero | Base.Empty | Base.Invalid -> widen_zero ) let hints_from_keys stmt h = let int_hints_by_base = try let at_stmt = Stmt.Map.find stmt h.hints_by_addr_by_stmt in Base.Map.merge (fun _b os1 os2 -> match os1, os2 with | Some s1, Some s2 -> Some (Ival.Widen_Hints.union s1 s2) | Some s, None | None, Some s -> Some s | None, None -> None ) at_stmt h.hints_by_addr with Not_found -> h.hints_by_addr in let float_hints_by_base = try let at_stmt = Stmt.Map.find stmt h.float_hints_by_addr_by_stmt in Base.Map.merge (fun _b os1 os2 -> match os1, os2 with | Some s1, Some s2 -> Some (Fc_float.Widen_Hints.union s1 s2) | Some s, None | None, Some s -> Some s | None, None -> None ) at_stmt h.float_hints_by_addr with Not_found -> h.float_hints_by_addr in let prio = try Stmt.Map.find stmt h.priority_bases with Not_found -> Base.Set.empty in let int_default = try let at_stmt = Stmt.Map.find stmt h.default_hints_by_stmt in Ival.Widen_Hints.union h.default_hints at_stmt with Not_found -> h.default_hints in let float_default = try let at_stmt = Stmt.Map.find stmt h.default_float_hints_by_stmt in Fc_float.Widen_Hints.union h.default_float_hints at_stmt with Not_found -> h.default_float_hints in let float_hints_for_base b = try Fc_float.Widen_Hints.union (Base.Map.find b float_hints_by_base) float_default with Not_found -> float_default in prio, (fun b b' -> hints_for_base int_default int_hints_by_base b b', float_hints_for_base b) let var_hints stmt prio_bases = { empty with priority_bases = Stmt.Map.singleton stmt prio_bases } let num_hints stmto baseo hints = match stmto, baseo with | None, Some b -> (* Hints for a base at all statements *) { empty with hints_by_addr = Base.Map.singleton b hints } | Some stmt, Some b -> (* Hints for a base at a statement *) { empty with hints_by_addr_by_stmt = Stmt.Map.singleton stmt (Base.Map.singleton b hints) } | Some stmt, None -> (* Hints for all bases and a given statement *) { empty with default_hints_by_stmt = Stmt.Map.singleton stmt hints } | None, None -> (* Hints for all bases and all statements *) { empty with default_hints = hints } let float_hints stmto baseo hints = match stmto, baseo with | None, Some b -> (* Hints for a base at all statements *) { empty with float_hints_by_addr = Base.Map.singleton b hints } | Some stmt, Some b -> (* Hints for a base at a statement *) { empty with float_hints_by_addr_by_stmt = Stmt.Map.singleton stmt (Base.Map.singleton b hints) } | Some stmt, None -> (* Hints for all bases and a given statement *) { empty with default_float_hints_by_stmt = Stmt.Map.singleton stmt hints } | None, None -> (* Hints for all bases and all statements *) { empty with default_float_hints = hints } (* default set of hints. Depends on the machdep *) let default () = let int_default = Ival.Widen_Hints.default_widen_hints in let float_default = Fc_float.Widen_Hints.default_widen_hints in join (num_hints None None int_default) (float_hints None None float_default) (* Local Variables: compile-command: "make -C ../../.." End: *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/value_types/widen_type.mli�����������������������������������������0000666�0000000�0000000�00000005327�13571573400�020704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Widening hints for the Value Analysis datastructures. *) include Datatype.S (** An empty set of hints *) val empty : t (** A default set of hints *) val default : unit -> t val join: t -> t -> t (** Pretty-prints a set of hints (for debug purposes only). @since Silicon-20161101 *) val pretty : Format.formatter -> t -> unit (** Define numeric hints for one or all variables ([None]), for a certain stmt or for all statements ([None]). *) val num_hints: Cil_types.stmt option -> Base.t option -> Ival.Widen_Hints.t -> t (** Define floating hints for one or all variables ([None]), for a certain stmt or for all statements ([None]). *) val float_hints: Cil_types.stmt option -> Base.t option -> Fc_float.Widen_Hints.t -> t (** Define a set of bases to widen in priority for a given statement. *) val var_hints : Cil_types.stmt -> Base.Set.t -> t (** Widen hints for a given statement, suitable for function {!Cvalue.Model.widen}. *) val hints_from_keys : Cil_types.stmt -> t -> Base.Set.t * (Base.t -> Locations.Location_Bytes.numerical_widen_hint) (* Local Variables: compile-command: "make -C ../../.." End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/����������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015245� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/Makefile.in�����������������������������������������������0000666�0000000�0000000�00000005467�13571573400�017326� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif ################### # Plug-in Setting # ################### PLUGIN_DIR ?= . PLUGIN_ENABLE := @ENABLE_VARIADIC@ PLUGIN_NAME := Variadic PLUGIN_CMI := format_types va_types PLUGIN_CMO := options extends va_build environment \ format_string format_pprint format_typer format_parser \ generic standard classify translate \ register PLUGIN_DISTRIBUTED := $(PLUGIN_ENABLE) PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure #PLUGIN_NO_DEFAULT_TEST := no PLUGIN_TESTS_DIRS := declared defined known erroneous ################ # Generic part # ################ include $(FRAMAC_SHARE)/Makefile.dynamic ##################################### # Regenerating the Makefile on need # ##################################### ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif $(Variadic_DIR)/Makefile: $(Variadic_DIR)/Makefile.in \ $(CONFIG_STATUS_DIR)/config.status cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/Variadic.mli����������������������������������������������0000666�0000000�0000000�00000003173�13571573400�017476� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Nothing is exported statically. *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/classify.ml�����������������������������������������������0000666�0000000�0000000�00000015121�13571573400�017414� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Format_types open Va_types open Options module Typ = Extends.Typ (* ************************************************************************ *) (* Variadic classes builders *) (* ************************************************************************ *) let find_function env s = try Some (Environment.find_function env s) with Not_found -> Self.warning "Unable to locate function %s which should be in the Frama-C LibC." s; None let mk_overload env names = let vis = Extends.List.filter_map (find_function env) names in let overload = List.map (fun vi -> Typ.params_types vi.vtype, vi) vis in Overload overload let mk_aggregator env fun_name a_pos pname a_type = match find_function env fun_name with | None -> Misc | Some vi -> try (* Get the list of arguments *) let params = Typ.params vi.vtype in (* Check that pos is a valid position in the list *) assert (a_pos >= 0); if a_pos >= List.length params then begin Self.warning ~current:true "The standard function %s should have at least %d parameters." fun_name (a_pos + 1); raise Exit end; (* Get the aggregate type of elements *) let _,ptyp,_ = List.nth params a_pos in let a_param = pname, match ptyp with | TArray (typ,_,_,_) | TPtr (typ, _) -> typ | _ -> Self.warning ~current:true "The parameter %d of standard function %s should be \ of array type." (a_pos + 1) fun_name; raise Exit in Aggregator {a_target = vi; a_pos; a_type; a_param} (* In case of failure return Misc (apply generic translation) *) with Exit -> Misc let mk_format_fun vi f_kind f_buffer ~format_pos = let buffer_arguments = match f_buffer with | StdIO | Syslog -> [] | File i | Stream i | Arg (i, None) -> [i] | Arg (i, Some j) -> [i ; j] in let expected_args = buffer_arguments @ [ format_pos ] in let n_expected_args = (List.fold_left max (-1) expected_args) + 1 and n_actual_args = List.length (Typ.params vi.vtype) in if n_actual_args < n_expected_args then begin Self.warning ~current:true "The standard function %s was expected to have at least %d fixed \ parameters but only has %d.@ \ No variadic translation will be performed." vi.vname n_expected_args n_actual_args; Misc end else FormatFun { f_kind ; f_buffer ; f_format_pos = format_pos } (* ************************************************************************ *) (* Classification *) (* ************************************************************************ *) let classify_std env vi = match vi.vname with (* fcntl.h - Overloads of functions *) | "fcntl" -> mk_overload env ["__va_fcntl_void" ; "__va_fcntl_int" ; "__va_fcntl_flock"] | "open" -> mk_overload env ["__va_open_void" ; "__va_open_mode_t"] | "openat" -> mk_overload env ["__va_openat_void" ; "__va_openat_mode_t"] (* unistd.h *) | "execl" -> mk_aggregator env "execv" 1 "argv" EndedByNull | "execle" -> mk_aggregator env "execve" 1 "argv" EndedByNull | "execlp" -> mk_aggregator env "execvp" 1 "argv" EndedByNull | "syscall" -> Misc (* stdio.h *) | "fprintf" -> mk_format_fun vi PrintfLike ~format_pos:1 (Stream 0) | "printf" -> mk_format_fun vi PrintfLike ~format_pos:0 (StdIO) | "sprintf" -> mk_format_fun vi PrintfLike ~format_pos:1 (Arg (0, None)) | "snprintf" -> mk_format_fun vi PrintfLike ~format_pos:2 (Arg (0, Some 1)) | "dprintf" -> mk_format_fun vi PrintfLike ~format_pos:1 (File 0) | "fscanf" -> mk_format_fun vi ScanfLike ~format_pos:1 (Stream 0) | "scanf" -> mk_format_fun vi ScanfLike ~format_pos:0 (StdIO) | "sscanf" -> mk_format_fun vi ScanfLike ~format_pos:1 (Arg (0, None)) (* syslog.h *) | "syslog" -> mk_format_fun vi PrintfLike ~format_pos:1 (Syslog) (* wchar.h *) | "fwprintf" -> mk_format_fun vi PrintfLike ~format_pos:1 (Stream 0) | "swprintf" -> mk_format_fun vi PrintfLike ~format_pos:2 (Arg (0, Some 1)) | "wprintf" -> mk_format_fun vi PrintfLike ~format_pos:0 (StdIO) | "fwscanf" -> mk_format_fun vi ScanfLike ~format_pos:1 (Stream 0) | "swscanf" -> mk_format_fun vi ScanfLike ~format_pos:1 (Arg (0, None)) | "wscanf" -> mk_format_fun vi ScanfLike ~format_pos:0 (StdIO) (* stropts.h *) | "ioctl" -> mk_overload env ["__va_ioctl_void" ; "__va_ioctl_int" ; "__va_ioctl_ptr"] (* Anything else *) | _ -> Unknown let classify env vi = if Extends.Cil.is_variadic_function vi then begin Self.result ~level:2 ~current:true "Declaration of variadic function %s." vi.vname; Some { vf_decl = vi; vf_original_type = vi.vtype; vf_class = if vi.vdefined then Defined else classify_std env vi; vf_specialization_count = 0 } end else None �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/configure�������������������������������������������������0000777�0000000�0000000�00000272125�13571573400�017165� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS ENABLE_VARIADIC ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_variadic ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-variadic support for variadic plug-in (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-variadic was given. if test "${enable_variadic+set}" = set; then : enableval=$enable_variadic; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "variadic is not available" "$LINENO" 5 fi FORCE_VARIADIC=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_VARIADIC ENABLE_VARIADIC=$ENABLE NAME_VARIADIC=variadic if test "$default" = "no" -a "$FORCE" = "no"; then INFO_VARIADIC=" (not available by default)" fi echo "variadic... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) ####################### # Generating Makefile # ####################### ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/configure.ac����������������������������������������������0000666�0000000�0000000�00000004330�13571573400�017533� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat à l'énergie atomique et aux énergies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## ########################################## # Variadic as a standard Frama-C plug-in # ########################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)]) check_plugin(variadic,PLUGIN_RELATIVE_PATH(plugin_file), [support for variadic plug-in],yes) ####################### # Generating Makefile # ####################### write_plugin_config(Makefile) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/environment.ml��������������������������������������������0000666�0000000�0000000�00000010176�13571573400�020150� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Table = Datatype.String.Hashtbl type env = { globals: varinfo Table.t; functions: varinfo Table.t; typedefs: typeinfo Table.t; structs: compinfo Table.t; unions: compinfo Table.t; enums: enuminfo Table.t; } let empty () : env = { globals = Table.create 17; functions = Table.create 17; typedefs = Table.create 17; structs = Table.create 17; unions = Table.create 17; enums = Table.create 17; } let add_global (env : env) (vi : varinfo) : unit = Table.add env.globals vi.vname vi let add_function (env : env) (vi : varinfo) : unit = Table.add env.functions vi.vname vi let add_typeinfo (env : env) (typeinfo : typeinfo) : unit = Table.add env.typedefs typeinfo.torig_name typeinfo let add_compinfo (env : env) (compinfo : compinfo) : unit = let table = if compinfo.cstruct then env.structs else env.unions in Table.add table compinfo.corig_name compinfo let add_enuminfo (env : env) (enuminfo : enuminfo) : unit = Table.add env.enums enuminfo.eorig_name enuminfo let find_global (env : env) (vname : string) : varinfo = Table.find env.globals vname let find_function (env : env) (vname : string) : varinfo = Table.find env.functions vname let find_typedef (env : env) (tname : string) : typeinfo= Table.find env.typedefs tname let find_struct (env : env) (tname : string) : compinfo = Table.find env.structs tname let find_union (env : env) (tname : string) : compinfo = Table.find env.unions tname let find_enum (env : env) (tname : string) : enuminfo = Table.find env.enums tname let find_type (env : env) (namespace : Logic_typing.type_namespace) (tname : string) : typ = match namespace with | Logic_typing.Typedef -> TNamed (find_typedef env tname, []) | Logic_typing.Struct -> TComp (find_struct env tname, {scache=Not_Computed}, []) | Logic_typing.Union -> TComp (find_union env tname, {scache=Not_Computed}, []) | Logic_typing.Enum -> TEnum (find_enum env tname, []) let from_file (file : file) : env = let env = empty () in let v = object inherit Cil.nopCilVisitor method! vglob glob = begin match glob with | GFunDecl(_,vi,_) | GFun ({svar = vi}, _) -> add_function env vi | GVarDecl (vi,_) | GVar (vi, _, _) -> add_global env vi | GType (typeinfo,_) -> add_typeinfo env typeinfo | GCompTag (compinfo,_) -> add_compinfo env compinfo | GEnumTag (enuminfo,_) -> add_enuminfo env enuminfo | _ -> () end; Cil.SkipChildren end in Cil.visitCilFile v file; env ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/extends.ml������������������������������������������������0000666�0000000�0000000�00000017305�13571573400�017257� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Typ = struct let attributes_less_equal t1 t2 = let t1 = Cil.typeDeepDropAllAttributes t1 in let t2 = Cil.typeDeepDropAllAttributes t2 in Cil_datatype.Typ.equal t1 t2 let params typ = match Cil.unrollType typ with | TFun (_,args,_,_) -> Cil.argsToList args | _ -> invalid_arg "params" let ghost_partitioned_params typ = match Cil.unrollType typ with | TFun (_,args,_,_) -> Cil.argsToPairOfLists args | _ -> invalid_arg "params" let params_types typ = List.map (fun (_,typ,_) -> typ) (params typ) let params_count typ = List.length (params typ) let is_variadic typ = match Cil.unrollType typ with | TFun (_, _, b, _) -> b | _ -> false end module Cil = struct include Cil let ptrType typ = TPtr (typ, []) let constPtrType typ = TPtr (typ, [Attr("const", [])]) let shortType = TInt(IShort, []) let ushortType = TInt(IUShort, []) let shortPtrType = ptrType shortType let ushortPtrType = ptrType ushortType let longPtrType = ptrType longType let ulongPtrType = ptrType ulongType let longlongPtrType = ptrType longLongType let ulonglongPtrType = ptrType ulongLongType let doublePtrType = ptrType doubleType let signedIntegerTypes = [Cil.charType; shortType; Cil.intType; Cil.longType; longLongType] let unsignedIntegerTypes = [ucharType; ushortType; Cil.uintType; Cil.ulongType; Cil.ulongLongType] let signedIntegerPtrTypes = [Cil.charPtrType; shortPtrType; Cil.intPtrType; longPtrType; longlongPtrType] let unsignedIntegerPtrTypes = [ucharPtrType; ushortPtrType; Cil.uintPtrType; ulongPtrType; ulonglongPtrType] let signed_integers_ranking = Extlib.mapi (fun i t -> (t, i)) signedIntegerTypes let unsigned_integers_ranking = Extlib.mapi (fun i t -> (t, i)) unsignedIntegerTypes let is_signed_integer_type t = List.mem t signedIntegerTypes let is_unsigned_integer_type t = List.mem t unsignedIntegerTypes let is_integer_type t = is_signed_integer_type t || is_unsigned_integer_type t let is_signed_ptr_integer_type t = List.mem t signedIntegerPtrTypes let is_unsigned_ptr_integer_type t = List.mem t unsignedIntegerPtrTypes let is_integer_ptr_type t = is_signed_ptr_integer_type t || is_unsigned_ptr_integer_type t let integer_ranking_comp t1 t2 = let rt1, rt2 = if is_signed_integer_type t1 && is_signed_integer_type t2 then List.assoc t1 signed_integers_ranking, List.assoc t2 signed_integers_ranking else if is_unsigned_integer_type t1 && is_unsigned_integer_type t2 then List.assoc t1 unsigned_integers_ranking, List.assoc t2 unsigned_integers_ranking else raise (Invalid_argument "rank_comp") in rt1 - rt2 let integer_promotion t1 t2 = try (integer_ranking_comp t1 t2) < 0 with Invalid_argument _ -> false let is_folded_zero e = Cil.isZero (Cil.constFold false e) let is_function vi = match vi.vtype with | TFun _ -> true | _ -> false let is_variadic_function vi = Typ.is_variadic vi.vtype let get_fundec_return_type fd = match fd.svar.vtype with | TFun(rt, _, _, _) -> rt | _ -> Options.Self.fatal "Varinfo of fundec does not have function type." let get_kf_attributes kf = match kf.fundec with | Definition (fd, _) -> fd.svar.vattr | Declaration (_, vi, _, _) -> vi.vattr let get_inst_loc = Cil_datatype.Instr.loc let get_stmt_loc = Cil_datatype.Stmt.loc end module List = struct include List let rec make n a = if n <= 0 then [] else a :: make (n - 1) a let to_scalar = function | [a] -> a | _ -> failwith "to_scalar" let of_opt = function | None -> [] | Some x -> [x] let to_opt = function | [] -> None | [a] -> Some a | _ -> failwith "to_opt" let first = function | [] -> failwith "first" | a :: _ -> a exception EmptyList let rec last = function | [] -> raise EmptyList | [a] -> a | _ :: l -> last l let rec take n l = if n <= 0 then [] else match l with | [] -> [] | a :: l -> a :: take (n - 1) l let rec drop n l = if n <= 0 then l else match l with | [] -> [] | _ :: l -> drop (n - 1) l let rec break n l = if n <= 0 then ([], l) else match l with | [] -> ([], []) | a :: l -> let l1, l2 = break (n - 1) l in (a :: l1, l2) let rec filter_map f = function | [] -> [] | a :: l -> match f a with | Some r -> r :: filter_map f l | None -> filter_map f l let iteri f l = let i = ref 0 in iter (fun a -> f !i a; incr i) l let mapi f l = let i = ref 0 in map (fun a -> let r = f !i a in incr i; r) l let rev_mapi f l = let i = ref 0 in let rec aux acc = function | [] -> acc | a :: l -> let a' = f !i a in incr i; aux (a' :: acc) l in aux [] l let iteri2 f l1 l2 = let i = ref 0 in let rec aux l1 l2 = match l1, l2 with | [], [] -> () | a1 :: l1, a2 :: l2 -> f !i a1 a2; incr i; aux l1 l2 | _, _ -> invalid_arg "List.iteri2" in aux l1 l2 let mapi2 f l1 l2 = let i = ref 0 in let rec aux l1 l2 = match l1, l2 with | [], [] -> [] | a1 :: l1, a2 :: l2 -> let r = f !i a1 a2 in incr i; r :: aux l1 l2 | _, _ -> invalid_arg "List.mapi2" in aux l1 l2 let reduce_left f l = let rec aux acc = function | [] -> acc | a :: l -> aux (f acc a) l in match l with | [] -> failwith "reduce" | a :: l -> aux a l let rec reduce_right f = function | [] -> failwith "reduce" | [a] -> a | a :: l -> f a (reduce_right f l) let map_fold_left f acc l = let rec aux acc r = function | [] -> List.rev r, acc | a :: l -> let a, acc = f acc a in aux acc (a :: r) l in aux acc [] l let ifind f l = let i = ref 0 in let rec aux = function | [] -> raise Not_found | a :: l -> if not (f a) then (incr i; aux l) in aux l; !i let rec unique_sorted cmp = function | a1 :: a2 :: l when cmp a1 a2 = 0 -> unique_sorted cmp (a2 :: l) | [] -> [] | a :: l -> a :: unique_sorted cmp l let sort_unique cmp l = unique_sorted cmp (sort cmp l) let replace i v = Extlib.mapi (fun i' v' -> if i = i' then v else v') end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/extends.mli�����������������������������������������������0000666�0000000�0000000�00000012145�13571573400�017425� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Typ : sig val attributes_less_equal : typ -> typ -> bool val params : typ -> (string * typ * attributes) list val ghost_partitioned_params : typ -> (string * typ * attributes) list * (string * typ * attributes) list val params_types : typ -> typ list val params_count : typ -> int val is_variadic : typ -> bool end module Cil : sig include module type of Cil val ptrType : typ -> typ val constPtrType : typ -> typ val shortType : typ val ushortType : typ val shortPtrType : typ val ushortPtrType : typ val longPtrType : typ val ulongPtrType : typ val longlongPtrType : typ val ulonglongPtrType : typ val doublePtrType : typ val is_folded_zero : exp -> bool (** Standard integer types in C99 (Cf. 6.2.5) *) val signedIntegerTypes : typ list val unsignedIntegerTypes : typ list val signedIntegerPtrTypes : typ list val unsignedIntegerPtrTypes : typ list val is_signed_integer_type : typ -> bool val is_unsigned_integer_type : typ -> bool val is_integer_type : typ -> bool val is_integer_ptr_type : typ -> bool val is_function : varinfo -> bool (** @return [true] if varinfo is a variadic function, [false] if it is a non-variadic function or if it is not a function. *) val is_variadic_function : varinfo -> bool (** Does not use {! Globals.Functions.get} nor {! Kernel_function.get_return_type}. *) val get_fundec_return_type : fundec -> typ val get_kf_attributes : kernel_function -> attributes (** [integer_ranking_comp t1 t2] @return [<0] if [t1 < t2] [0] if [t1 = t2] [>0] if [t1 > t2] @raise Invalid_argument if t1 and t2 are not comparable. *) val integer_ranking_comp : typ -> typ -> int (** [integer_promotion t1 t2] returns [true] if [t1 < t2] *) val integer_promotion : typ -> typ -> bool val get_inst_loc : instr -> location val get_stmt_loc : stmt -> location end module List : sig include module type of List (* Constructors *) val make : int -> 'a -> 'a list exception EmptyList (* Get one element *) val to_scalar : 'a list -> 'a val of_opt : 'a option -> 'a list val to_opt : 'a list -> 'a option val first : 'a list -> 'a val last : 'a list -> 'a (** @raise EmptyList when the list is empty. *) (* Sublists *) val take : int -> 'a list -> 'a list val drop : int -> 'a list -> 'a list val break : int -> 'a list -> 'a list * 'a list (* Iterators *) val filter_map : ('a -> 'b option) -> 'a list -> 'b list val iteri : (int -> 'a -> unit) -> 'a list -> unit val mapi : (int -> 'a -> 'b) -> 'a list -> 'b list val rev_mapi : (int -> 'a -> 'b) -> 'a list -> 'b list val iteri2 : (int -> 'a -> 'b -> unit) -> 'a list -> 'b list -> unit val mapi2 : (int -> 'a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list val reduce_left : ('a -> 'a -> 'a) -> 'a list -> 'a val reduce_right : ('a -> 'a -> 'a) -> 'a list -> 'a val map_fold_left : ('b -> 'a -> 'c * 'b) -> 'b -> 'a list -> 'c list * 'b (* Search *) val ifind : ('a -> bool) -> 'a list -> int (* Sort *) val sort_unique : ('a -> 'a -> int) -> 'a list -> 'a list val unique_sorted : ('a -> 'a -> int) -> 'a list -> 'a list (* (** [split k l] when [l] = \[e{_1}; ...; e{_n}\]. @return (\[e{_1}; ...; e{_k}\], \[e{_k+1}; ...; e{_n}\]) if [0 < k < n], ([\[\]], [l]) if [k <= 0], ([l], [\[\]]) if [k >= n] *) val split : int -> 'a list -> 'a list * 'a list *) (** [replace i v l] returns a new list where [l.(i)] = [v] *) val replace : int -> 'a -> 'a list -> 'a list end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/format_parser.ml������������������������������������������0000666�0000000�0000000�00000025404�13571573400�020450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Format_types open Format_pprint exception Invalid_format let warn f = Options.Self.warning ~current:true f (* ************************************************************************ *) (* printf format verification *) (* ************************************************************************ *) (* true = valid and useful, false = valid but useless and Invalid_format = invalid *) let check_flag spec flag = let cs = spec.f_conversion_specifier in match flag, cs with | FSharp, #has_alternative_form -> true | FZero, #integer_specifier when Extlib.has_some spec.f_precision -> warn "Flag 0 is ignored when a precision is specified"; false | FZero, #numeric_specifier when List.mem FMinus spec.f_flags -> warn "Flag 0 is ignored when flag - is also specified."; false | FZero, #numeric_specifier -> true | FMinus, cs when cs <> `n -> true | FSpace, #signed_specifier when List.mem FPlus spec.f_flags -> warn "Flag ' ' is ignored when flag + is also specified."; false | FSpace, #signed_specifier -> true | FPlus, (#signed_specifier | #float_specifier) -> true | _ -> warn "Flag %a and conversion specififer %a are not compatibles." pp_flag flag pp_cs (spec.f_conversion_specifier,spec.f_capitalize); raise Invalid_format let check_cs_compatibility cs capitalized has_field_width has_precision = match cs with | (`n | `c | `p) as cs when has_precision -> warn "Conversion specifier %a does not expect a precision." pp_cs (cs, capitalized) ; raise Invalid_format | `n when has_field_width -> warn "Conversion specifier n does not expect a field width."; raise Invalid_format | _ -> () let rec make_flags_unique = function | [] -> [] | f :: l -> if List.mem f l then ( warn "Multiple usage of flag '%a'." pp_flag f; make_flags_unique l ) else f :: make_flags_unique l (* When checking, we don't really care which type are returned but only if it can be returned *) let find_typedef : Format_typer.typdef_finder = fun _namespace _name -> Cil.voidType let check_f_specification spec = (* Check the correctness of precision and field width fields *) check_cs_compatibility spec.f_conversion_specifier spec.f_capitalize (spec.f_precision <> None) (spec.f_field_width <> None); (* Check the combination of conversion specifier and length modifier *) begin try ignore (Format_typer.type_f_specifier ~find_typedef spec) with Format_typer.Invalid_specifier -> warn "Length modifier %a and conversion specifier %a \ are not compatibles." (Pretty_utils.pp_opt pp_lm) spec.f_length_modifier pp_cs (spec.f_conversion_specifier,spec.f_capitalize); raise Invalid_format end; (* Check and filter flags *) let flags = make_flags_unique spec.f_flags in let flags = List.filter (check_flag spec) flags in { spec with f_flags = flags} let check_s_specification spec = (* Check the correctness of field width *) check_cs_compatibility spec.s_conversion_specifier false false (spec.s_field_width <> None); (* Check the combination of conversion specifier and length modifier *) begin try ignore (Format_typer.type_s_specifier ~find_typedef spec) with Format_typer.Invalid_specifier -> warn "Length modifier %a and conversion specifier %a \ are not compatibles." (Pretty_utils.pp_opt pp_lm) spec.s_length_modifier pp_cs (spec.s_conversion_specifier,false); raise Invalid_format end; spec let check_token f = function | Char _ as c -> c | Specification s -> Specification (f s) let check_f_format format = List.map (check_token check_f_specification) format let check_s_format format = List.map (check_token check_s_specification) format let check_format = function | FFormat f -> FFormat (check_f_format f) | SFormat s -> SFormat (check_s_format s) (* ************************************************************************ *) (* Buffers *) (* ************************************************************************ *) module Buffer = struct type t = Format_string.t * int ref let create (s : Format_string.t) : t = (s,ref 0) let consume (_s,i : t) : unit = incr i let back (_s,i : t) : unit = decr i let get (s,i : t) : char = try let c = Format_string.get_char s !i in incr i; c with Format_string.OutOfBounds -> '\000' | Format_string.NotAscii _ -> '\026' let last (s,i : t) : char = try Format_string.get_char s (!i - 1) with Format_string.OutOfBounds -> '\000' | Format_string.NotAscii _ -> '\026' let peek (s,i : t) : char = try Format_string.get_char s !i with Format_string.OutOfBounds -> '\000' | Format_string.NotAscii _ -> '\026' let getall (f : char -> bool) (s,i as b : t) : string = let start = !i in let len = ref 0 in begin try while f (get b) do incr len; done; back b; (* last char has not been matched *) with _ -> () end; Format_string.sub_string s start !len end (* ************************************************************************ *) (* Parsing *) (* ************************************************************************ *) let is_uppercase = function | 'A'..'Z' -> true | _ -> false let rec parse_negative b = match Buffer.peek b with | '-' -> Buffer.consume b; not (parse_negative b) | _ -> false let parse_int b = let neg = parse_negative b in let s = Buffer.getall (function '0'..'9' -> true | _ -> false) b in let i = try int_of_string s with Failure _ -> warn "Invalid integer in format."; raise Invalid_format in if neg then -i else i let parse_assignement_suppression b = match Buffer.peek b with | '*' -> Buffer.consume b; true | _ -> false let rec parse_flags b = match Buffer.get b with | '-' -> FMinus :: parse_flags b | '+' -> FPlus :: parse_flags b | ' ' -> FSpace :: parse_flags b | '#' -> FSharp :: parse_flags b | '0' -> FZero :: parse_flags b | _ -> Buffer.back b; [] let parse_f_fw b = match Buffer.peek b with | '*' -> Buffer.consume b; Some `FWStar | '0'..'9' -> Some (`FWInt (parse_int b)) | _ -> None let parse_s_fw b = match Buffer.peek b with | '0'..'9' -> Some (`FWInt (parse_int b)) | _ -> None let parse_precision b = match Buffer.peek b with | '.' -> Buffer.consume b; Some begin match Buffer.peek b with | '*' -> Buffer.consume b; PStar | '-' | '0'..'9'-> PInt (parse_int b) | _ -> PInt 0 end | _ -> None let parse_lm b = match Buffer.get b, Buffer.peek b with | 'h', 'h' -> Buffer.consume b; Some `hh | 'h', _ -> Some `h | 'l', 'l' -> Buffer.consume b; Some `ll | 'l', _ -> Some `l | 'j', _ -> Some `j | 'z', _ -> Some `z | 't', _ -> Some `t | 'L', _ -> Some `L | _ -> Buffer.back b; None let parse_brackets_interior b = let first = ref true and circ = ref false in let matching = function | ']' when not !first -> false | '^' when !first && not !circ -> circ := true; true | '\000' -> warn "Unterminated brackets."; raise Invalid_format | _ -> first := false; true in let s = Buffer.getall matching b in Buffer.consume b; s let parse_f_cs b = match Buffer.get b with | 'd' -> `d | 'i' -> `i | 'o' -> `o | 'u' -> `u | 'c' -> `c | 's' -> `s | 'p' -> `p | 'n' -> `n | 'x' | 'X' -> `x | 'f' | 'F' -> `f | 'e' | 'E' -> `e | 'g' | 'G' -> `g | 'a' | 'A' -> `a | '\000' -> warn "Missing conversion specifier at the end of format."; raise Invalid_format | '\026' -> warn "Conversion specifiers must be ascii characters."; raise Invalid_format | c -> warn "Unknown conversion specifier %c." c; raise Invalid_format let parse_s_cs b = match Buffer.peek b with | '[' -> Buffer.consume b; `Brackets (parse_brackets_interior b) | _ -> parse_f_cs b let parse_f_spec b = let f_flags = parse_flags b in let f_field_width = parse_f_fw b in let f_precision = parse_precision b in let f_length_modifier = parse_lm b in let f_conversion_specifier = parse_f_cs b in let f_capitalize = is_uppercase (Buffer.last b) in check_f_specification { f_flags; f_field_width; f_precision; f_length_modifier; f_conversion_specifier; f_capitalize } let parse_s_spec b = let s_assignment_suppression = parse_assignement_suppression b in let s_field_width = parse_s_fw b in let s_length_modifier = parse_lm b in let s_conversion_specifier = parse_s_cs b in check_s_specification { s_assignment_suppression; s_field_width; s_length_modifier; s_conversion_specifier } let rec parse_aux f b = match Buffer.get b, Buffer.peek b with | '%', '%' -> Buffer.consume b; (Char '%') :: parse_aux f b | '%', _ -> let spec = f b in Specification spec :: parse_aux f b | '\000', _ -> [] | c, _ -> Char c :: parse_aux f b let parse_f_format s = parse_aux parse_f_spec (Buffer.create s) let parse_s_format s = parse_aux parse_s_spec (Buffer.create s) let parse_format typ s = match typ with | PrintfLike -> FFormat (parse_f_format s) | ScanfLike -> SFormat (parse_s_format s) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/format_parser.mli�����������������������������������������0000666�0000000�0000000�00000004104�13571573400�020613� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Format_types exception Invalid_format val check_f_specification : f_conversion_specification -> f_conversion_specification val check_s_specification : s_conversion_specification -> s_conversion_specification val check_f_format : f_format -> f_format val check_s_format : s_format -> s_format val check_format : format -> format val parse_f_format : Format_string.t -> f_format val parse_s_format : Format_string.t -> s_format val parse_format : format_kind -> Format_string.t -> format ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/format_pprint.ml������������������������������������������0000666�0000000�0000000�00000013254�13571573400�020470� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Format_types let string_of_flag = function | FMinus -> "-" | FPlus -> "+" | FSpace -> "' '" | FSharp -> "#" | FZero -> "0" let string_of_flags fl = let rec aux accu fl = match fl with | f::fl -> aux (accu ^ string_of_flag f) fl | [] -> accu in aux "" fl let pp_flag ff f = Format.fprintf ff "%s" (string_of_flag f) let pp_flags ff fl = Pretty_utils.pp_list ~sep:", " pp_flag ff fl let string_of_fw = function | `FWStar -> "*" | `FWInt i -> string_of_int i let pp_fw ff fw = Format.fprintf ff "%s" (string_of_fw fw) let string_of_precision = function | PStar -> "*" | PInt i -> string_of_int i let pp_precision ff p = Format.fprintf ff ".%s" (string_of_precision p) let string_of_lm = function | `hh -> "hh" | `h -> "h" | `l -> "l" | `ll -> "ll" | `j -> "j" | `z -> "z" | `t -> "t" | `L -> "L" let pp_lm ff lm = Format.fprintf ff "%s" (string_of_lm lm) let string_of_cs = function | `d -> "d" | `i -> "i" | `o -> "o" | `u -> "u" | `x -> "x" | `f -> "f" | `e -> "e" | `g -> "g" | `a -> "a" | `c -> "c" | `s -> "s" | `p -> "p" | `n -> "n" | `Brackets b -> "[" ^ b ^ "]" let pp_cs ff (cs,capitalize) = let s = string_of_cs cs in let s = if capitalize then String.capitalize_ascii s else s in Format.fprintf ff "%s" s let string_of_option ?pre:(pre="") ?suf:(suf="") f = function | Some o -> pre ^ (f o) ^ suf | None -> "" let pp_f_specification ff spec = let suf = "; " in Format.fprintf ff "<"; if List.length spec.f_flags <> 0 then (Format.fprintf ff "Flags: "; pp_flags ff spec.f_flags; Format.fprintf ff "%s" suf); Format.fprintf ff "%s%s%s" (string_of_option ~pre:"Field width: " ~suf:suf string_of_fw spec.f_field_width) (string_of_option ~pre:"Precision: " ~suf:suf string_of_precision spec.f_precision) (string_of_option ~pre:"Length modifier: " ~suf:suf string_of_lm spec.f_length_modifier); Format.fprintf ff "Conversion specifier: %s>" (string_of_cs spec.f_conversion_specifier) let pp_s_specification ff (spec: s_conversion_specification) = let suf = "; " in Format.fprintf ff "<%s; %s%s" ("Assignment: " ^ (string_of_bool (not spec.s_assignment_suppression))) (string_of_option ~pre:"Field width: " ~suf:suf string_of_fw spec.s_field_width) (string_of_option ~pre:"Length modifier: " ~suf:suf string_of_lm spec.s_length_modifier); Format.fprintf ff "Conversion specifier: %s>" (string_of_cs spec.s_conversion_specifier) let pp_f_format ff fl = let fl = Extends.List.filter_map (function | Specification s -> Some s | _ -> None) fl in Pretty_utils.pp_list ~sep:"@." (fun ff s -> pp_f_specification ff s) ff fl let pp_s_format ff (fl: s_format) = let fl = Extends.List.filter_map (function | Specification s -> Some s | _ -> None) fl in Pretty_utils.pp_list ~sep:"@." (fun ff s -> pp_s_specification ff s) ff fl let pp_format ff = function | FFormat s -> pp_f_format ff s | SFormat s -> pp_s_format ff s let rec f_format_to_cstring fl = let aux spec = "%" ^ (string_of_flags spec.f_flags) ^ (string_of_option string_of_fw spec.f_field_width) ^ (string_of_option ~pre: "." string_of_precision spec.f_precision) ^ (string_of_option string_of_lm spec.f_length_modifier) ^ (string_of_cs spec.f_conversion_specifier) in match fl with | [] -> "" | Char '%' :: fl -> "%%" ^ f_format_to_cstring fl | Char c :: fl -> (String.make 1 c) ^ f_format_to_cstring fl | Specification s :: fl -> (aux s) ^ f_format_to_cstring fl let rec s_format_to_cstring fl = let aux spec = "%" ^ (if spec.s_assignment_suppression then "*" else "") ^ (string_of_option string_of_fw spec.s_field_width) ^ (string_of_option string_of_lm spec.s_length_modifier) ^ (string_of_cs spec.s_conversion_specifier) in match fl with | [] -> "" | Char '%' :: fl -> "%%" ^ s_format_to_cstring fl | Char c :: fl -> (String.make 1 c) ^ s_format_to_cstring fl | Specification s :: fl -> (aux s) ^ s_format_to_cstring fl let format_to_cstring = function | FFormat s -> f_format_to_cstring s | SFormat s -> s_format_to_cstring s ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/format_pprint.mli�����������������������������������������0000666�0000000�0000000�00000004702�13571573400�020637� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Format_types val pp_flag : Format.formatter -> flag -> unit val pp_flags : Format.formatter -> flags -> unit val pp_fw : Format.formatter -> [< any_field_width] -> unit val pp_precision : Format.formatter -> precision -> unit val pp_lm : Format.formatter -> length_modifier -> unit val pp_cs : Format.formatter -> [< any_conversion_specifier] * bool -> unit val pp_f_specification : Format.formatter -> f_conversion_specification -> unit val pp_s_specification : Format.formatter -> s_conversion_specification -> unit val pp_f_format : Format.formatter -> f_format -> unit val pp_s_format : Format.formatter -> s_format -> unit val pp_format : Format.formatter -> format -> unit (** Rewrites the format as its string representation. *) val f_format_to_cstring : f_format -> string val s_format_to_cstring : s_format -> string val format_to_cstring : format -> string ��������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/format_string.ml������������������������������������������0000666�0000000�0000000�00000005111�13571573400�020453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type t = | String of string | WString of int64 list exception OutOfBounds exception NotAscii of int64 let get_char (s : t) (i : int) : char = match s with | String s -> begin try String.get s i with Invalid_argument _ -> raise OutOfBounds end | WString s -> begin try let c = List.nth s i in if (c >= Int64.zero && c<= (Int64.of_int 255)) then Char.chr (Int64.to_int c) else raise (NotAscii c) with Failure _ -> raise OutOfBounds end let get_wchar (s : t) (i : int) : int64 = match s with | String s -> begin try Int64.of_int (Char.code (String.get s i)) with Invalid_argument _ -> raise OutOfBounds end | WString s -> begin try List.nth s i with Failure _ -> raise OutOfBounds end let sub_string (s : t) (start : int) (len : int) : string = let init_char i = get_char s (start + i) in String.init len init_char �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/format_typer.ml�������������������������������������������0000666�0000000�0000000�00000015637�13571573400�020326� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Format_types open Cil_types exception Type_not_found of string exception Invalid_specifier type arg_dir = [ `ArgIn | `ArgInArray of precision option (* for '%.*s' or '%.42s' *) | `ArgOut | `ArgOutArray ] type typdef_finder = Logic_typing.type_namespace -> string -> Cil_types.typ let get_typedef ?(find_typedef = Globals.Types.find_type) s = try find_typedef Logic_typing.Typedef s with Not_found -> raise (Type_not_found s) let ptr typ = TPtr (typ, []) let type_f_specifier ?find_typedef spec = match spec.f_conversion_specifier, spec.f_length_modifier with | #signed_specifier, None -> Cil.intType | #signed_specifier, Some `hh -> Cil.scharType | #signed_specifier, Some `h -> Extends.Cil.shortType | #signed_specifier, Some `l -> Cil.longType | #signed_specifier, Some `ll -> Cil.longLongType | #signed_specifier, Some `j -> get_typedef ?find_typedef "intmax_t" | #signed_specifier, Some `z -> get_typedef ?find_typedef "size_t" | #signed_specifier, Some `t -> get_typedef ?find_typedef "ptrdiff_t" | #unsigned_specifier, None -> Cil.uintType | #unsigned_specifier, Some `hh -> Cil.ucharType | #unsigned_specifier, Some `h -> Extends.Cil.ushortType | #unsigned_specifier, Some `l -> Cil.ulongType | #unsigned_specifier, Some `ll -> Cil.ulongLongType | #unsigned_specifier, Some `j -> get_typedef ?find_typedef "uintmax_t" | #unsigned_specifier, Some `z -> get_typedef ?find_typedef "size_t" | #unsigned_specifier, Some `t -> get_typedef ?find_typedef "ptrdiff_t" | #float_specifier, None -> Cil.doubleType | #float_specifier, Some `l -> Cil.doubleType | #float_specifier, Some `L -> Cil.longDoubleType | `c, None -> Cil.intType | `c, Some `l -> get_typedef ?find_typedef "intmax_t" | `s, None -> Cil.charPtrType | `s, Some `l -> ptr (get_typedef ?find_typedef "wchar_t") | `p, None -> Cil.voidPtrType | `n, None -> ptr Cil.intType | `n, Some `hh -> ptr Cil.scharType | `n, Some `h -> ptr Extends.Cil.shortType | `n, Some `l -> ptr Cil.longType | `n, Some `ll -> ptr Cil.longLongType | `n, Some `j -> ptr (get_typedef ?find_typedef "intmax_t") | `n, Some `z -> ptr (get_typedef ?find_typedef "size_t") | `n, Some `t -> ptr (get_typedef ?find_typedef "ptrdiff_t") | _, _ -> raise Invalid_specifier let type_s_specifier ?find_typedef spec = match spec.s_conversion_specifier, spec.s_length_modifier with | #signed_specifier, None -> ptr Cil.intType | #signed_specifier, Some `hh -> ptr Cil.scharType | #signed_specifier, Some `h -> ptr Extends.Cil.shortType | #signed_specifier, Some `l -> ptr Cil.longType | #signed_specifier, Some `ll -> ptr Cil.longLongType | #signed_specifier, Some `j -> ptr (get_typedef ?find_typedef "intmax_t") | #signed_specifier, Some `z -> ptr (get_typedef ?find_typedef "size_t") | #signed_specifier, Some `t -> ptr (get_typedef ?find_typedef "ptrdiff_t") | #unsigned_specifier, None -> ptr Cil.uintType | #unsigned_specifier, Some `hh -> ptr Cil.ucharType | #unsigned_specifier, Some `h -> ptr Extends.Cil.ushortType | #unsigned_specifier, Some `l -> ptr Cil.ulongType | #unsigned_specifier, Some `ll -> ptr Cil.ulongLongType | #unsigned_specifier, Some `j -> ptr (get_typedef ?find_typedef "uintmax_t") | #unsigned_specifier, Some `z -> ptr (get_typedef ?find_typedef "size_t") | #unsigned_specifier, Some `t -> ptr (get_typedef ?find_typedef "ptrdiff_t") | #float_specifier, None -> ptr (Cil.floatType) | #float_specifier, Some `l -> ptr (Cil.doubleType) | #float_specifier, Some `L -> ptr (Cil.longDoubleType) | (`c | `s | `Brackets _), None -> Cil.charPtrType | (`c | `s | `Brackets _), Some `l -> ptr (get_typedef ?find_typedef "wchar_t") | `p, None -> ptr (Cil.voidPtrType) | `n, None -> ptr Cil.intType | `n, Some `hh -> ptr Cil.scharType | `n, Some `h -> ptr Extends.Cil.shortType | `n, Some `l -> ptr Cil.longType | `n, Some `ll -> ptr Cil.longLongType | `n, Some `j -> ptr (get_typedef ?find_typedef "intmax_t") | `n, Some `z -> ptr (get_typedef ?find_typedef "size_t") | `n, Some `t -> ptr (get_typedef ?find_typedef "ptrdiff_t") | _, _ -> raise Invalid_specifier let type_f_format ?find_typedef format = let r = ref [] in let add_types spec = match spec with | Char _ -> () | Specification s -> if s.f_field_width = Some `FWStar then r := (Cil.intType, `ArgIn) :: !r; if s.f_precision = Some PStar then r := (Cil.intType, `ArgIn) :: !r; let dir = match s.f_conversion_specifier with | `s -> `ArgInArray s.f_precision | `n -> `ArgOut | _ -> `ArgIn in r := (type_f_specifier ?find_typedef s, dir) :: !r; in List.iter add_types format; List.rev !r let type_s_format ?find_typedef format = let r = ref [] in let add_types spec = match spec with | Char _ -> () | Specification s -> let dir = match s.s_conversion_specifier with | `s -> `ArgOutArray | _ -> `ArgOut in if not s.s_assignment_suppression then r := (type_s_specifier ?find_typedef s, dir) :: !r; in List.iter add_types format; List.rev !r let type_format ?find_typedef = function | FFormat f -> type_f_format ?find_typedef f | SFormat s -> type_s_format ?find_typedef s �������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/format_typer.mli������������������������������������������0000666�0000000�0000000�00000004530�13571573400�020465� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Format_types open Cil_types exception Type_not_found of string exception Invalid_specifier type arg_dir = [ `ArgIn | `ArgInArray of precision option (* for '%.*s' or '%.42s' *) | `ArgOut | `ArgOutArray ] type typdef_finder = Logic_typing.type_namespace -> string -> Cil_types.typ val type_f_specifier : ?find_typedef : typdef_finder -> f_conversion_specification -> typ val type_s_specifier : ?find_typedef : typdef_finder -> s_conversion_specification -> typ val type_f_format : ?find_typedef : typdef_finder -> f_format -> (typ * arg_dir) list val type_s_format : ?find_typedef : typdef_finder -> s_format -> (typ * arg_dir) list val type_format : ?find_typedef : typdef_finder -> format -> (typ * arg_dir) list ������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/format_types.mli������������������������������������������0000666�0000000�0000000�00000006636�13571573400�020477� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** See C11, 7.21.6 *) type flag = FMinus | FPlus | FSpace | FSharp | FZero type flags = flag list type f_field_width = [ `FWStar | `FWInt of int (** positive integer *)] type s_field_width = [ `FWInt of int ] type any_field_width = [ f_field_width | s_field_width ] type precision = PStar | PInt of int type length_modifier = [ `hh | `h | `l | `ll | `j | `z | `t | `L ] type signed_specifier = [ `d | `i ] type unsigned_specifier = [ `u | `o | `x ] type integer_specifier = [ signed_specifier | unsigned_specifier ] type float_specifier = [ `f | `e | `g | `a ] type numeric_specifier = [ integer_specifier | float_specifier ] type capitalizable = [ `x | `f | `e | `g | `a ] type has_alternative_form = [ `o | `x | `f | `e | `g | `a ] type f_conversion_specifier = [ numeric_specifier | `c | `s | `p | `n ] type s_conversion_specifier = [ f_conversion_specifier | `Brackets of string ] type any_conversion_specifier = [ s_conversion_specifier | f_conversion_specifier ] type f_conversion_specification = { mutable f_flags: flags; mutable f_field_width: f_field_width option; mutable f_precision: precision option; mutable f_length_modifier: length_modifier option; mutable f_conversion_specifier: f_conversion_specifier; mutable f_capitalize: bool; } type s_conversion_specification = { mutable s_assignment_suppression: bool; mutable s_field_width: s_field_width option; mutable s_length_modifier: length_modifier option; mutable s_conversion_specifier: s_conversion_specifier; } (** A format element is either a character or a conversion specification. *) type 'spec token = | Char of char | Specification of 'spec type f_format = f_conversion_specification token list type s_format = s_conversion_specification token list type format = FFormat of f_format | SFormat of s_format type format_kind = PrintfLike | ScanfLike ��������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/generic.ml������������������������������������������������0000666�0000000�0000000�00000014602�13571573400�017216� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Options module List = Extends.List module Typ = Extends.Typ module Build = Va_build (* Types of variadic parameter and argument *) let vpar_typ attr = TPtr (TPtr (TVoid [], [Attr ("const", [])]), attr) let vpar_name = "__va_params" let vpar = (vpar_name, vpar_typ [], []) (* Translation of variadic types (not deeply) *) let translate_type = function | TFun (ret_typ, args, is_variadic, attributes) -> let new_args = if is_variadic then let ng_args, g_args = Cil.argsToPairOfLists args in Some (ng_args @ [vpar] @ g_args) else args in TFun (ret_typ, new_args, false, attributes) | TBuiltin_va_list attr -> vpar_typ attr | typ -> typ (* Adding the vpar parameter to variadic functions *) let add_vpar vi = let formals = Cil.getFormalsDecl vi in (* Add the vpar formal once *) if not (List.exists (fun vi -> vi.vname = vpar_name) formals) then begin (* Register the new formal *) let new_formal = Cil.makeFormalsVarDecl vpar in let new_formals = formals @ [new_formal] in Cil.unsafeSetFormalsDecl vi new_formals end (* Translation of va_* builtins *) let translate_va_builtin caller inst = let vi, args, loc = match inst with | Call(_, {enode = Lval(Var vi, _)}, args, loc) -> vi, args, loc | _ -> assert false in let translate_va_start () = let va_list = match args with | [{enode=Lval va_list}] -> va_list | _ -> Self.fatal "Unexpected arguments to va_start" and varg = try Extlib.last (Cil.getFormalsDecl caller.svar) with Invalid_argument _ -> Self.abort "Using va_start macro in a function which is not variadic." in [ Set (va_list, Cil.evar ~loc varg, loc) ] in let translate_va_copy () = let dest, src = match args with | [{enode=Lval dest}; src] -> dest, src | _ -> Self.fatal "Unexpected arguments to va_copy" in [ Set (dest, src, loc) ] in let translate_va_arg () = let va_list, typ, lval = match args with | [{enode=Lval va_list}; {enode=SizeOf typ}; {enode=CastE(_, {enode=AddrOf lval})}] -> va_list, typ, lval | _ -> Self.fatal "Unexpected arguments to va_arg" in (* Check validity of type *) if Cil.isIntegralType typ then begin let promoted_type = Cil.integralPromotion typ in if promoted_type <> typ then Self.warning ~current:true "Wrong type argument in va_start: %a is promoted to %a when used \ in the variadic part of the arguments. (You should pass %a to \ va_start)" Printer.pp_typ typ Printer.pp_typ promoted_type Printer.pp_typ promoted_type end; (* Build the replacing instruction *) let mk_lval_exp lval = Cil.new_exp ~loc (Lval lval) in let mk_mem exp = mk_lval_exp (Cil.mkMem ~addr:exp ~off:NoOffset) in let mk_cast exp typ = Cil.mkCast ~force:false ~e:exp ~newt:typ in let src = mk_mem (mk_cast (mk_mem (mk_lval_exp va_list)) (TPtr (typ,[]))) in [ Set (lval, src, loc); Set (va_list, Cil.increm (mk_lval_exp va_list) 1, loc) ] in begin match vi.vname with | "__builtin_va_start" -> translate_va_start () | "__builtin_va_copy" -> translate_va_copy () | "__builtin_va_arg" -> translate_va_arg () | "__builtin_va_end" -> [] (* No need to do anything for va_end *) | _ -> assert false end (* Translation of calls to variadic functions *) let translate_call ~fundec ~ghost block loc mk_call callee pars = (* Log translation *) Self.result ~current:true ~level:2 "Generic translation of call to variadic function."; (* Split params into static, variadic and ghost part *) let ng_params, g_params = Typ.ghost_partitioned_params (Cil.typeOf callee) in let static_size = List.length ng_params - 1 in let s_exps, r_exps = List.break static_size pars in let variadic_size = (List.length r_exps) - (List.length g_params) in let v_exps, g_exps = List.break variadic_size r_exps in (* Create temporary variables to hold parameters *) let add_var i exp = let typ = Cil.typeOf exp and name = "__va_arg" ^ string_of_int i in let res = Cil.makeLocalVar ~ghost fundec ~scope:block name typ in res.vdefined <- true; res in let vis = List.mapi add_var v_exps in (* Assign parameters to these *) let instrs = List.map2 (Build.vi_init ~loc) vis v_exps in (* Build an array to store addresses *) let addrs = List.map Cil.mkAddrOfVi vis in let vargs, assigns = Build.array_init ~loc fundec ~ghost block "__va_args" Cil.voidPtrType addrs in let instrs = instrs @ [assigns] in (* Translate the call *) let exp_vargs = Cil.mkAddrOrStartOf ~loc (Cil.var vargs) in let new_arg = Cil.mkCast ~force:false ~e:exp_vargs ~newt:(vpar_typ []) in let new_args = s_exps @ [new_arg] @ g_exps in let call = mk_call callee new_args in instrs @ [call] ������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/options.ml������������������������������������������������0000666�0000000�0000000�00000004450�13571573400�017275� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Self = Plugin.Register (struct let name = "Variadic" let shortname = "variadic" let help = "Variadic functions translation" end) module Enabled = Self.True (struct let option_name = "-variadic-translation" let help = "translate variadic functions and calls to semantic \ equivalents with only a fixed list of formal parameters" end) module Strict = Self.True (struct let option_name = "-variadic-strict" let help = "display warnings about non-portable implicit casts in the \ calls of standard variadic functions, i.e. casts between \ distinct integral types which have the same size and \ signedness" end) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/options.mli�����������������������������������������������0000666�0000000�0000000�00000003302�13571573400�017441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Self : Plugin.General_services module Enabled : Parameter_sig.Bool module Strict : Parameter_sig.Bool ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/register.ml�����������������������������������������������0000666�0000000�0000000�00000004111�13571573400�017420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let category = File.register_code_transformation_category "variadic" let () = Cmdline.run_after_extended_stage begin fun () -> State_dependency_graph.add_dependencies ~from:Options.Enabled.self [ Ast.self ] end; Cmdline.run_after_configuring_stage begin fun () -> let translate file = if Options.Enabled.get () then Translate.translate_variadics file in File.add_code_transformation_before_cleanup category translate end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/standard.ml�����������������������������������������������0000666�0000000�0000000�00000056123�13571573400�017406� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Va_types open Options module Cil = Extends.Cil module List = Extends.List module Typ = Extends.Typ module Build = Va_build let params_types params = List.map (fun (_,typ,_) -> typ) params let pp_prototype name fmt tparams = Format.fprintf fmt "%s(%a)" name (Pretty_utils.pp_list ~sep:", " Printer.pp_typ) tparams let pp_overload name fmt l = let prototypes = List.map fst l in Pretty_utils.pp_list ~sep:"@\n" (pp_prototype name) fmt prototypes let new_globals : (global list) ref = ref [] (* ************************************************************************ *) (* Call translation *) (* ************************************************************************ *) exception Translate_call_exn (* Extended integer types (e.g. int8_t, uint_least16_t, int_fast32_t) do not have their own character modifiers, but instead use macros that are converted into "standard" modifiers (e.g. "%hhd", "%hu", "%d", etc.). Therefore, we cannot enforce their types the same way as for e.g. size_t, which has its own modifier. We weaken the check, allowing a different name but still requiring same size and signedness. *) let extended_integer_typenames = ["int8_t"; "uint8_t"; "int_least8_t"; "uint_least8_t"; "int_fast8_t"; "uint_fast8_t"; "int16_t"; "uint16_t"; "int_least16_t"; "uint_least16_t"; "int_fast16_t"; "uint_fast16_t"; "int32_t"; "uint32_t"; "int_least32_t"; "uint_least32_t"; "int_fast32_t"; "uint_fast32_t"; "int64_t"; "uint64_t"; "int_least64_t"; "uint_least64_t"; "int_fast64_t"; "uint_fast64_t"] let is_extended_integer_type t = match t with | TNamed (ti, _) -> List.mem ti.tname extended_integer_typenames | _ -> false let integral_rep ikind = Cil.bitsSizeOfInt ikind, Cil.isSigned ikind let expose t = Cil.type_remove_attributes_for_c_cast (Cil.unrollType t) (* From most permissive to least permissive *) type castability = Strict (* strictly allowed by the C standard *) | Tolerated (* tolerated in practice *) | NonPortable (* non-portable minor deviation *) | NonStrict (* only allowed in non-strict mode *) | Never (* never allowed *) let can_cast given expected = match expose given, expose expected with | t1, t2 when Cil_datatype.Typ.equal t1 t2 -> Strict | (TInt (i1,a1) | TEnum({ekind=i1},a1)), (TInt (i2,a2) | TEnum({ekind=i2},a2)) -> if integral_rep i1 <> integral_rep i2 || not (Cil_datatype.Attributes.equal a1 a2) then Never else if is_extended_integer_type given then Tolerated else if i1 = i2 then NonPortable else NonStrict | TPtr _, TPtr _ -> Strict | _, _ -> Never let does_fit exp typ = match Cil.constFoldToInt exp, Cil.unrollType typ with | Some i, (TInt (ekind,_) | TEnum({ekind},_)) -> Cil.fitsInInt ekind i | _ -> false (* Variant of [pp_typ] which details the underlying type for enums *) let pretty_typ fmt t = match Cil.unrollType t with | TEnum (ei, _) -> Format.fprintf fmt "%a (%a)" Printer.pp_typ t Printer.pp_typ (TInt (ei.ekind, [])) | _ -> Printer.pp_typ fmt t (* cast the i-th argument exp to paramtyp *) let cast_arg i paramtyp exp = let argtyp = Cil.typeOf exp in if not (does_fit exp paramtyp) then begin match can_cast argtyp paramtyp with | Strict | Tolerated -> () | (NonPortable | NonStrict) when not (Strict.get ()) -> () | NonPortable -> Self.warning ~current:true "Possible portability issues with enum type for argument %d \ (use -variadic-no-strict to avoid this warning)." (i + 1) | NonStrict | Never -> Self.warning ~current:true "Incorrect type for argument %d. \ The argument will be cast from %a to %a." (i + 1) pretty_typ argtyp pretty_typ paramtyp end; Cil.mkCast ~force:false ~e:exp ~newt:paramtyp (* cast a list of args to the tparams list of types and remove unused args *) let match_args tparams args = (* Remove unused arguments *) let paramcount = List.length tparams and argcount = List.length args in if argcount > paramcount then Self.warning ~current:true "Too many arguments: expected %d, given %d. \ Superfluous arguments will be removed." paramcount argcount else if argcount < paramcount then ( Self.warning ~current:true "Not enough arguments: expected %d, given %d." paramcount argcount; raise Translate_call_exn ); (* Translate params *) let new_args, unused_args = List.break paramcount args in List.mapi2 cast_arg tparams new_args, unused_args (* translate a call by applying argument matching/pruning and changing callee *) let match_call ~loc ~fundec scope mk_call new_callee new_tparams args = let new_args, unused_args = match_args new_tparams args in let call = mk_call (Cil.evar ~loc new_callee) new_args in let reads = List.map (fun e -> Cil.mkPureExprInstr ~fundec ~scope e) unused_args in reads @ [call] (* ************************************************************************ *) (* Aggregator calls *) (* ************************************************************************ *) let find_null exp_list = List.ifind (fun e -> Cil.isZero (Cil.constFold false e)) exp_list let aggregator_call ~fundec ~ghost {a_target; a_pos; a_type; a_param} scope loc mk_call vf args = let name = vf.vf_decl.vorig_name and tparams = Typ.params_types a_target.vtype and pname, ptyp = a_param in (* Check argument count *) let argcount = List.length args and paramcount = List.length tparams in if argcount < paramcount then begin Self.warning ~current:true "Not enough arguments: expected %d, given %d." paramcount argcount; raise Translate_call_exn; end; (* Compute the size of the aggregation *) let size = match a_type with | EndedByNull -> begin try find_null (List.drop a_pos args) + 1 with Not_found -> Self.warning ~current:true "Failed to find a sentinel (NULL pointer) in the argument list."; raise Translate_call_exn; end in (* Convert arguments *) let tparams_left = List.take a_pos tparams in let tparams_right = List.drop (a_pos + 1) tparams in let new_tparams = tparams_left @ List.make size ptyp @ tparams_right in let new_args, unused_args = match_args new_tparams args in (* Split the arguments *) let args_left, args_rem = List.break a_pos new_args in let args_middle, args_right = List.break size args_rem in (* Create the call code *) Self.result ~current:true ~level:2 "Translating call to %s to a call to %s." name a_target.vorig_name; let pname = if pname = "" then "param" else pname in let vaggr, assigns = Build.array_init ~loc fundec ~ghost scope pname ptyp args_middle in let new_arg = Cil.mkAddrOrStartOf ~loc (Cil.var vaggr) in let new_args = args_left @ [new_arg] @ args_right in let new_args,_ = match_args tparams new_args in let call = mk_call (Cil.evar ~loc a_target) new_args in let reads = List.map (Cil.mkPureExprInstr ~fundec ~scope ~loc) unused_args in assigns :: reads @ [call] (* ************************************************************************ *) (* Overloads calls *) (* ************************************************************************ *) let rec check_arg_matching expected given = match Cil.unrollType given, Cil.unrollType expected with | (TInt _ | TEnum _), (TInt _ | TEnum _) -> true | TPtr _, _ when Cil.isVoidPtrType expected -> true | TPtr (t1, _), TPtr (t2, _) -> check_arg_matching t1 t2 | _, _ -> not (Cil.need_cast given expected) let rec check_call_matching tparams targs = match tparams, targs with | [], [] -> true | [], _ (* too many args: this is allowed by the standard (the extra arguments are ignored), but in practice this leads to disambiguation issues in some cases (e.g. last argument is 0 instead of NULL), so we prefer to be strict *) (* Not enough input args *) | _, [] -> false | a1 :: l1, a2 :: l2 -> check_arg_matching a1 a2 && check_call_matching l1 l2 let filter_matching_prototypes overload args = (* Find suitable candidates for this call *) let targs = List.map Cil.typeOf args in let check (tparams, _vi) = check_call_matching tparams targs in List.filter check overload let overloaded_call ~fundec overload block loc mk_call vf args = let name = vf.vf_decl.vorig_name in (* Find the matching prototype *) let tparams, new_callee = match filter_matching_prototypes overload args with | [] -> (* No matching prototype *) Self.warning ~current:true "@[No matching prototype found for this call to %s.@.\ Expected candidates:@.\ @[<v> %a@]@.\ Given arguments:@.\ @[<v> %a@]" name (pp_overload name) overload (pp_prototype name) (List.map Cil.typeOf args); raise Translate_call_exn; | [(tparams,vi)] -> (* Exactly one matching prototype *) tparams, vi | l -> (* Several matching prototypes *) Self.warning ~current:true "Ambiguous call to %s. Matching candidates are: \ %a" name (pp_overload name) l; raise Translate_call_exn; in (* Rebuild the call *) Self.result ~current:true ~level:2 "Translating call to the specialized version %a." (pp_prototype name) tparams; match_call ~loc ~fundec block mk_call new_callee tparams args (* ************************************************************************ *) (* Format functions calls *) (* ************************************************************************ *) (* --- Specification building --- *) let rec static_string a = match a.enode with | Const (CStr s) -> Some (Format_string.String s) | Const (CWStr s) -> Some (Format_string.WString s) | CastE (_, e) -> static_string e | _ -> None let find_global env name = try Some (Environment.find_global env name) with Not_found -> Self.warning ~once:true "Unable to locate global %s which should be in the Frama-C LibC. \ Correct specifications can't be generated." name; None let find_predicate name = match Logic_env.find_all_logic_functions name with | f :: _q -> Some f (* TODO: should we warn in case of overloading? *) | [] -> Self.warning ~once:true "Unable to locate ACSL predicate %s which should be in the Frama-C LibC. \ Correct specifications can't be generated." name; None let find_field env structname fieldname = try let compinfo = Environment.find_struct env structname in Some (Cil.getCompField compinfo fieldname) with Not_found -> Self.warning ~once:true "Unable to locate %s field %s." structname fieldname; None let find_predicate_by_width typ narrow_name wide_name = match Cil.unrollTypeDeep typ with | TPtr (TInt(IChar, _), _) -> find_predicate narrow_name | TPtr (t, _) when (* drop attributes to remove 'const' qualifiers and fc_stdlib attributes *) Cil_datatype.Typ.equal (Cil.typeDeepDropAllAttributes (Cil.unrollTypeDeep t)) Cil.theMachine.Cil.wcharType -> find_predicate wide_name | _ -> Self.warning ~current:true "expected single/wide character pointer type, got %a (%a, unrolled %a)" Printer.pp_typ typ Cil_types_debug.pp_typ typ Cil_types_debug.pp_typ (Cil.unrollTypeDeep typ); None let build_fun_spec env loc vf format_fun tvparams formals = let open Format_types in let _ = () in let fixed_params_count = Typ.params_count vf.vf_original_type in let sformals, vformals = List.break fixed_params_count formals in let here = Logic_const.here_label in (* Spec *) let sources = ref [] and dests = ref [] and requires = ref [] and ensures = ref [] in let iterm lval = Logic_const.new_identified_term (Build.tlval ~loc lval) and insert x t = t := x :: !t in let insert_source ?(indirect=false) lval = let itlval = iterm lval in let it_content = if indirect then { itlval.it_content with term_name = "indirect" :: itlval.it_content.term_name } else itlval.it_content in let itlval = { itlval with Cil_types.it_content } in insert itlval sources and insert_dest lval = insert (iterm lval) dests and insert_require pred = insert (Logic_const.new_predicate pred) requires and insert_ensure pred = insert (Normal, Logic_const.new_predicate pred) ensures in let add_lval ~indirect (lval,dir) = (* Add the lval to the list of sources/dests *) begin match dir with | (`ArgIn | `ArgInArray _) -> insert_source ~indirect lval | (`ArgOut | `ArgOutArray) -> insert_dest lval | `ArgInOut -> insert_source ~indirect lval; insert_dest lval end in let add_var ?pos (vi,dir) = (* Use the appropriate logical lval *) let lval = match dir with | `ArgIn -> Build.lvar vi | (`ArgInArray _ | `ArgOutArray) -> Build.trange_from_vi ~loc vi | (`ArgOut | `ArgInOut) -> Build.tvarmem ~loc vi in (* Build requires/ensures *) let term = Build.tvar ~loc vi in begin match dir with | `ArgInArray None -> let pred = find_predicate_by_width vi.vtype "valid_read_string" "valid_read_wstring" in begin match pred with | Some logic_info -> let labels = List.map (fun _ -> here) logic_info.l_labels in let p = Logic_const.papp ~loc (logic_info, labels, [term]) in insert_require p | None -> () end | `ArgInArray (Some precision) -> assert (pos <> None); let pred = find_predicate_by_width vi.vtype "valid_read_nstring" "valid_read_nwstring" in begin match pred with | Some logic_info -> let labels = List.map (fun _ -> here) logic_info.l_labels in let nterm = match precision with | PStar -> let n_vi = List.nth vformals (Extlib.the pos) in Logic_utils.numeric_coerce Linteger (Build.tvar ~loc n_vi) | PInt n -> Cil.lconstant ~loc (Integer.of_int n) in let p = Logic_const.papp ~loc (logic_info, labels, [term; nterm]) in insert_require p | None -> () end | `ArgOut -> insert_require (Logic_const.pvalid ~loc (here,term)); insert_ensure (Logic_const.pinitialized ~loc (here,term)) | _ -> () end; (* Cil.hasAttribute "const" *) add_lval (lval,dir) in let make_indirect iterm = (* Add "indirect" to an identified term, if it isn't already *) if List.mem "indirect" iterm.it_content.term_name then iterm else let it_content = { iterm.it_content with term_name = "indirect" :: iterm.it_content.term_name } in { iterm with it_content } in (* Build variadic parameter source/dest list *) let dirs = List.map snd tvparams in let l = List.combine vformals dirs in let pos = ref (-1) in List.iter (incr pos; add_var ~indirect:false ~pos:!pos) l; (* Add format source and additional parameters *) let fmt_vi = List.nth sformals format_fun.f_format_pos in add_var ~indirect:true (fmt_vi, `ArgInArray None); (* Add buffer source/dest *) let add_stream vi = (* assigns stream->__fc_FILE_data \from stream->__fc_FILE_data, __fc_FILE_id *) begin match find_field env "__fc_FILE" "__fc_FILE_data" with | Some fieldinfo -> let varfield = Build.tvarfield ~loc vi fieldinfo in add_lval ~indirect:false (varfield, `ArgInOut) | None -> add_var ~indirect:false (vi, `ArgInOut) end; begin match find_field env "__fc_FILE" "__fc_FILE_id" with | Some fieldinfo -> let varfield = Build.tvarfield ~loc vi fieldinfo in add_lval ~indirect:true (varfield, `ArgIn) | None -> () end in (* Add a bounded buffer *) let add_buffer vi_buffer vi_size = add_var ~indirect:true (vi_size, `ArgIn); (* this is an snprintf-like function; compute and add its precondition: \valid(s + (0..n-1)) || \valid(s + (0..format_length(format)-1)) *) let make_valid_range tvalid_length = let tvar = Build.tvar ~loc vi_buffer and tmin = Build.tzero ~loc and tmax = Build.tminus ~loc tvalid_length (Build.tone ~loc) in let toffs = Build.trange ~loc (Some tmin) (Some tmax) in let term = Build.tbinop ~loc PlusPI tvar toffs in Logic_const.pvalid ~loc (here, term) in let size_var = Build.tvar ~loc vi_size in let left_pred = make_valid_range size_var in let pred = find_predicate_by_width vi_buffer.vtype "format_length" "wformat_length" in match pred with | Some format_length -> let labels = List.map (fun _ -> here) format_length.l_labels in let fmt_var = Build.tvar ~loc fmt_vi in let flen_app = try Build.tapp ~loc format_length labels [fmt_var] with Build.NotAFunction -> Self.abort ~current:true "%a should be a logic function, not a predicate" Printer.pp_logic_var format_length.l_var_info in let right_pred = make_valid_range flen_app in let p = Logic_const.por ~loc (left_pred, right_pred) in insert_require p | None -> insert_require left_pred in begin match format_fun.f_buffer, format_fun.f_kind with | StdIO, ScanfLike -> begin match find_global env "__fc_stdin" with | Some vi -> add_stream vi | None -> () end | StdIO, PrintfLike -> begin match find_global env "__fc_stdout" with | Some vi -> add_stream vi | None -> () end | Arg (i, _), ScanfLike -> add_var ~indirect:true (List.nth sformals i, `ArgInArray None) | Arg (i, size_pos), PrintfLike -> add_var ~indirect:true (List.nth sformals i, `ArgOutArray); begin match size_pos with | Some n -> add_buffer (List.nth sformals i) (List.nth sformals n) | None -> () end | Stream i, _ -> add_stream (List.nth sformals i) | File i, _ -> let file = List.nth sformals i in add_var ~indirect:true (file, `ArgIn); | Syslog, _ -> () end; (* Build the assigns clause (without \result, for now; it will be added separately) *) let froms = List.map (fun iterm -> iterm, From !sources) !dests in (* Add return value dest: it is different from above since it is _indirectly_ assigned from all sources *) let rettyp = Cil.getReturnType vf.vf_decl.vtype in let froms_for_result = if Cil.isVoidType rettyp then [] else [iterm (Build.tresult rettyp), From (List.map make_indirect !sources)] in let assigns = Writes (froms_for_result @ froms) in (* Build the default behaviour *) let bhv = Cil.mk_behavior ~assigns ~requires:!requires ~post_cond:!ensures () in { (Cil.empty_funspec ()) with spec_behavior = [bhv] } (* --- Call translation --- *) let format_fun_call ~fundec env format_fun scope loc mk_call vf args = let name = vf.vf_decl.vorig_name and params = Typ.params vf.vf_decl.vtype in (* Remove the va_param parameter added during the declaration visit *) let fixed_params_count = Typ.params_count vf.vf_original_type in let sparams = List.take fixed_params_count params in (* Extract the format if possible *) let format = try let format_arg = List.nth args format_fun.f_format_pos in match static_string format_arg with | None -> Self.warning ~current:true "Call to function %s with non-static format argument:@ \ no specification will be generated." name; raise Translate_call_exn (* No syntactic hint *) | Some s -> Format_parser.parse_format format_fun.f_kind s with | Format_parser.Invalid_format -> raise Translate_call_exn in (* Try to type expected parameters if possible *) let find_typedef = Environment.find_type env in let tvparams = try Format_typer.type_format ~find_typedef format with Format_typer.Type_not_found type_name -> Self.warning ~current:true "Unable to find type %s in the source code which should be used in \ this call:@ no specification will be generated.@ \ Note that due to cleanup, the type may have been defined in the \ original code but not used anywhere." type_name; raise Translate_call_exn in let new_param i (typ,_dir) = let typ = if Cil.isIntegralType typ then Cil.integralPromotion typ else typ in "param" ^ string_of_int i, typ, [] in let vparams = List.mapi new_param tvparams in let new_params = sparams @ vparams in (* Create the new callee *) vf.vf_specialization_count <- vf.vf_specialization_count + 1; let ret_typ, _, _, attributes = Cil.splitFunctionType vf.vf_decl.vtype in let new_callee_typ = TFun (ret_typ, Some new_params, false, attributes) and new_name = name ^ "_va_" ^ (string_of_int vf.vf_specialization_count) and mk_spec formals = build_fun_spec env loc vf format_fun tvparams formals in let new_callee, glob = Build.function_declaration ~vattr:[Attr ("fc_stdlib_generated", [])] ~loc:vf.vf_decl.vdecl name new_callee_typ mk_spec in new_callee.vname <- new_name; new_globals := glob :: !new_globals; (* Translate the call *) Self.result ~current:true ~level:2 "Translating call to %s to a call to the specialized version %s." name new_callee.vname; let tparams = params_types new_params in match_call ~loc ~fundec scope mk_call new_callee tparams args ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/translate.ml����������������������������������������������0000666�0000000�0000000�00000021013�13571573400�017571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Va_types open Options open Extlib module Typ = Extends.Typ (* List of builtin function names to translate *) let va_builtins = [ "__builtin_va_start"; "__builtin_va_copy"; "__builtin_va_arg"; "__builtin_va_end"] let is_framac_builtin vi = Ast_info.is_frama_c_builtin vi.vname || Extlib.string_prefix "__FRAMAC_" vi.vname (* Mthread prefixes *) (* In place visitor for translation *) let translate_variadics (file : file) = (* Environment filled with global symbols. *) let env = Environment.from_file file in (* Table associating varinfo of variadic functions to a variadic_function description *) let module Table = Cil_datatype.Varinfo.Hashtbl in let classification : variadic_function Table.t = Table.create 17 in let v = object inherit Cil.nopCilVisitor method! vglob glob = begin match glob with | GFunDecl(_, vi, _) | GFun ({svar = vi}, _) when not (is_framac_builtin vi) -> if not (Table.mem classification vi) then begin let vf = Classify.classify env vi in may (Table.add classification vi) vf end; Cil.SkipChildren | _ -> Cil.SkipChildren end end in Cil.visitCilFile v file; (* The translating visitor *) let v = object (self) inherit Cil.nopCilVisitor val curr_block = Stack.create () method! vblock b = Stack.push b curr_block; Cil.DoChildrenPost (fun b -> ignore (Stack.pop curr_block); b) method private enclosing_block () = try Stack.top curr_block with Stack.Empty -> Options.Self.fatal "No enclosing block here" method! vtype _typ = Cil.DoChildrenPost (Generic.translate_type) (* Translate types and signatures *) method! vglob glob = begin match glob with | GFunDecl(_, vi, _) when is_framac_builtin vi -> Self.result ~level:2 ~current:true "Variadic builtin %s left untransformed." vi.vname; Cil.SkipChildren | GFunDecl(_, vi, _) -> if Table.mem classification vi then Generic.add_vpar vi; Cil.DoChildren | GFun ({svar = vi} as fundec, _) -> if Table.mem classification vi then begin Generic.add_vpar vi; fundec.sformals <- Cil.getFormalsDecl vi; end; Standard.new_globals := []; Cil.DoChildrenPost (fun globs -> List.rev (globs @ !Standard.new_globals)) | _ -> Cil.DoChildren end method! vstmt s = match s.skind with | Instr (Call _) -> (* Separate locals created by a variadic call in their own block. This can't be done for Local_init(x,ConsInit _,_), as this instruction must be kept a direct child of the enclosing block, that determines the scope of x. *) let block = Cil.mkBlock [] in Stack.push block curr_block; let keep_block_if_needed s = ignore (Stack.pop curr_block); match s.skind with | Block b' -> (* We have introduced several instructions, and potentially locals. Scope of locals is in [block], that will replace b'. *) block.bstmts <- b'.bstmts; s.skind <- Block block; s | _ -> s in Cil.DoChildrenPost keep_block_if_needed | _ -> Cil.DoChildren (* Replace variadic calls *) method! vinst i = let fundec = the self#current_func in let loc = Cil_datatype.Instr.loc i in let block = self#enclosing_block () in let ghost = (the self#current_stmt).ghost in let make_new_args mk_call f args = let vf = Table.find classification f in try let call_translator = match vf.vf_class with | Overload o -> Standard.overloaded_call ~fundec o | Aggregator a -> Standard.aggregator_call ~fundec ~ghost a | FormatFun f -> Standard.format_fun_call ~fundec env f | _ -> raise Standard.Translate_call_exn in call_translator block loc mk_call vf args with Standard.Translate_call_exn -> Generic.translate_call ~fundec ~ghost block loc mk_call (Cil.evar ~loc f) args in begin match i with | Call(_, {enode = Lval(Var vi, _)}, _, _) when List.mem vi.vname va_builtins -> File.must_recompute_cfg fundec; Cil.ChangeTo (Generic.translate_va_builtin fundec i) | Call(lv, {enode = Lval(Var vi, NoOffset)}, args, loc) -> begin try let mk_call f args = Call (lv, f, args, loc) in let res = make_new_args mk_call vi args in File.must_recompute_cfg fundec; Cil.ChangeTo res with Not_found -> Cil.DoChildren end | Call(lv, callee, args, loc) -> let is_variadic = try let args, _ = Typ.ghost_partitioned_params (Cil.typeOf callee) in let last = Extends.List.last args in last = Generic.vpar with Extends.List.EmptyList -> false in if is_variadic then begin let mk_call f args = Call (lv, f, args, loc) in let res = Generic.translate_call ~fundec ~ghost block loc mk_call callee args in File.must_recompute_cfg fundec; Cil.ChangeTo res end else Cil.DoChildren | Local_init(v, ConsInit(c, args, kind), loc) -> begin try let mk_call f args = let args = match kind, args with | Constructor, [] -> Options.Self.fatal "Constructor %a is expected to have at least one argument" Cil_printer.pp_varinfo c | Constructor, _::tl -> tl | Plain_func, args -> args in let f = match f.enode with | Lval (Var f, NoOffset) -> f | _ -> Options.Self.fatal "Constructor cannot be translated as indirect call" in Local_init(v,ConsInit(f,args,kind),loc) in let args = match kind with | Plain_func -> args | Constructor -> Cil.mkAddrOfVi v :: args in let res = make_new_args mk_call c args in File.must_recompute_cfg fundec; Cil.ChangeTo res with Not_found -> Cil.DoChildren end | _-> Cil.DoChildren end method! vexpr exp = begin match exp.enode with | AddrOf (Var vi, NoOffset) when Extends.Cil.is_variadic_function vi && is_framac_builtin vi -> Self.not_yet_implemented "The variadic plugin doesn't handle calls to a pointer to the \ variadic builtin %s." vi.vname | _ -> Cil.DoChildren end end in Cil.visitCilFile v file ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/va_build.ml�����������������������������������������������0000666�0000000�0000000�00000010010�13571573400�017354� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil (* --- Cil builders --- *) let function_declaration ?vattr ~loc name typ mk_spec = (* Build the varinfo *) let vi = makeGlobalVar ~referenced:true name typ in Extlib.may (fun extra_vattr -> vi.vattr <- vi.vattr @ extra_vattr) vattr; vi.vdecl <- loc; (* Build the formals *) setFormalsDecl vi typ; let formals = getFormalsDecl vi in let spec = mk_spec formals in (* Build the declaration statement *) let glob = GFunDecl (spec, vi, vi.vdecl) in vi, glob let vi_init ~loc vi exp = Local_init(vi, AssignInit (SingleInit exp), loc) let array_init ~loc fundec ~ghost scope name elem_typ values = let size = max (List.length values) 1 in (* In C, Array size >= 1 *) let esize = Cil.integer ~loc size in let typ = TArray (elem_typ, Some esize, Cil.empty_size_cache (), []) in let vi = Cil.makeLocalVar fundec ~ghost ~scope name typ in let initl = match values with | [] -> [ Index (Cil.zero ~loc, NoOffset), Cil.makeZeroInit ~loc elem_typ] | _ -> List.mapi (fun i exp -> Index (Cil.integer ~loc i, NoOffset), SingleInit exp) values in vi.vdefined <- true; vi, Local_init(vi, AssignInit(CompoundInit(typ,initl)), loc) let call ~loc lval callee args = let instr = Call (lval, (Cil.evar ~loc callee), args, loc) in Cil.mkStmtOneInstr ~valid_sid:true instr (* --- Logic builders --- *) let lvar vi = TVar (Cil.cvar_to_lvar vi), TNoOffset let tlval ~loc lval = Logic_const.term ~loc (TLval lval) (typeOfTermLval lval) let tvar ~loc vi = tlval ~loc (lvar vi) let tvarmem ~loc vi = TMem (tvar ~loc vi), TNoOffset let tvarfield ~loc vi fieldinfo = TMem (tvar ~loc vi), TField (fieldinfo, TNoOffset) let tresult typ = TResult typ, TNoOffset let tzero ~loc = Cil.lzero ~loc () let tone ~loc = Cil.lone ~loc () let tbinop ~loc binop t1 t2 = Logic_const.term ~loc (TBinOp (binop, t1, t2)) t1.term_type let tminus ~loc t1 t2 = tbinop ~loc MinusA t1 t2 let tplus ~loc t1 t2 = tbinop ~loc PlusA t1 t2 let trange ~loc tstart tend = Logic_const.trange ~loc (tstart, tend) let trange_from_vi ~loc vi = let var = tvar ~loc vi and range = trange ~loc (Some (tzero ~loc)) None in TMem (tbinop IndexPI ~loc var range), TNoOffset exception NotAFunction let tapp ~loc logic_info labels args = let ltyp = match logic_info.l_type with | None -> raise NotAFunction | Some ltyp -> ltyp in Logic_const.term ~loc (Tapp (logic_info, labels, args)) ltyp ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/variadic/va_types.mli����������������������������������������������0000666�0000000�0000000�00000006164�13571573400�017611� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat à l'énergie atomique et aux énergies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type variadic_class = | Unknown (** Function declared and not known by Frama-C *) | Defined (** Function for which we have the definition in the project *) | Misc (** Function from the Frama-C lib *) | Overload of overload (** Function from the Frama-C lib which declines into a finite number of possible prototypes whose names are given in the list *) | Aggregator of aggregator (** Function from the Frama-C lib which has a not-variadic equivalent with the variadic part replaced by an array. (The array is the aggregation of the arguments from the variadic part. *) | FormatFun of format_fun (** Function from the Frama-C lib for which the argument count and type is fixed by a format argument. *) and overload = (typ list * varinfo) list and aggregator = { a_target: varinfo; a_pos: int; a_type: aggregator_type; a_param: string * typ; } and aggregator_type = EndedByNull and format_fun = { f_kind : Format_types.format_kind; f_buffer : buffer; f_format_pos : int; } and buffer = | StdIO (** Standard input/output (stdin/stdout/stderr) *) | Arg of int * int option (* Position of the buffer and size arguments *) | Stream of int (* Position of the stream argument *) | File of int (* Position of the file argument *) | Syslog (* Output to some system log *) type variadic_function = { vf_decl: varinfo; vf_original_type: typ; vf_class: variadic_class; mutable vf_specialization_count: int; (* The number of specializations of this function built yet *) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/����������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014111� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Auto.ml���������������������������������������������������������0000666�0000000�0000000�00000021447�13571573400�015363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Built-in Tactics --- *) (* -------------------------------------------------------------------------- *) open Lang open Lang.F let (^) a b = if a="" then b else if b="" then a else Printf.sprintf "%s ; %s" a b let t_id s = ["",s] let t_absurd s = [ "Absurd" , (fst s,p_false) ] let t_descr d0 p s = List.map (fun (d,s) -> (d0 ^ d) , s) (p s) let t_finally d0 s = [ d0 , s ] let t_chain (p : Tactical.process) (q : Tactical.process) s = let pool = ref [] in List.iter (fun (d,s) -> List.iter (fun (d',s') -> pool := (d ^ d' , s') :: !pool ) (q s) ) (p s) ; List.rev !pool let t_split ?(pos="") ?(neg="") p (hs,g) = [ pos , (hs,p_imply p g) ; neg , (hs,p_imply (p_not p) g) ] let t_cut ?(by="") (p : F.pred) (pi : Tactical.process) (hs,g) = ( by , (hs,p) ) :: (pi (hs,p_imply p g)) let t_case (p : F.pred) (a : Tactical.process) (b : Tactical.process) = fun (hs,g) -> List.append (a (hs,F.p_imply p g)) (b (hs,F.p_imply (F.p_not p) g)) let t_cases ?(complete = "complete") (dps : (pred * Tactical.process) list) = fun (hs,g) -> let pool = ref [] in List.iter (fun (p,pi) -> List.iter (fun u -> pool := u :: !pool) (pi (hs , p_imply p g)) ) dps ; ( complete , (hs , p_any fst dps) ) :: List.rev !pool let t_range e a b ~upper ~lower ~range s = if (not (a <= b)) then raise (Invalid_argument "Wp.Auto.t_range") ; let cases = ref [] in for i = a to b do cases := (Printf.sprintf "Value %d" i , p_equal e (e_int i)) :: !cases ; done ; List.concat [ upper (fst s , p_lt e (e_int a)) ; lower (fst s , p_lt (e_int b) e) ; t_chain (Tactical.insert !cases) range s ; ] let t_replace ?(equal="equal") ~src ~tgt (pi : Tactical.process) s = let s' = Conditions.subst (fun e -> if e == src then tgt else raise Not_found) s in (equal , (fst s, p_equal src tgt)) :: (pi s') (* -------------------------------------------------------------------------- *) (* --- Built-in Strategies --- *) (* -------------------------------------------------------------------------- *) let array = TacArray.strategy let choice = TacChoice.Choice.strategy let absurd = TacChoice.Absurd.strategy let contrapose = TacChoice.Contrapose.strategy let compound = TacCompound.strategy let cut = TacCut.strategy let filter = TacFilter.strategy let havoc = TacHavoc.Havoc.strategy let separated = TacHavoc.Separated.strategy let intuition = TacNormalForm.strategy let range = TacRange.strategy let split = TacSplit.strategy let definition = TacUnfold.strategy let instance = TacInstance.strategy let lemma = TacLemma.strategy (* -------------------------------------------------------------------------- *) (* --- Auto-Range --- *) (* -------------------------------------------------------------------------- *) module Range = struct open Repr let update merge x v ofs map = match Repr.term v with | Int v -> let v0 = Integer.add v ofs in let v1 = try merge v0 (Tmap.find x map) with Not_found -> v0 in Tmap.add x v1 map | _ -> map type rg = { mutable vmin : Integer.t F.Tmap.t ; mutable vmax : Integer.t F.Tmap.t ; } let set_vmin rg x v ofs = rg.vmin <- update Integer.max x v ofs rg.vmin let set_vmax rg x v ofs = rg.vmax <- update Integer.min x v ofs rg.vmax let rec add_bound rg p = match Repr.term p with | And ps -> List.iter (add_bound rg) ps | Lt(a,b) when Lang.F.is_int a && Lang.F.is_int b -> set_vmax rg a b Integer.minus_one ; set_vmin rg b a Integer.one ; | Leq(a,b) when Lang.F.is_int a && Lang.F.is_int b -> set_vmax rg a b Integer.zero ; set_vmin rg b a Integer.zero ; | _ -> () let compute hs = let rg = { vmin = F.Tmap.empty ; vmax = F.Tmap.empty } in Conditions.iter (fun s -> let open Conditions in match s.condition with | Have p | When p | Core p -> add_bound rg (F.e_prop p) | _ -> ()) hs ; rg let ranges rg = Tmap.interf (fun _ a b -> try Some(Integer.to_int a,Integer.to_int b) with Z.Overflow -> None ) rg.vmin rg.vmax let small = function | None -> None | Some z -> try Some(Integer.to_int z) with Z.Overflow -> None let bounds rg = Tmap.merge (fun _ a b -> Some(small a,small b)) rg.vmin rg.vmax end (* -------------------------------------------------------------------------- *) (* --- Heuristics: Auto-Range --- *) (* -------------------------------------------------------------------------- *) class autorange = object method id = "wp:range" method title = "Auto Range" method descr = "Iterate over term constrained by a finite interval" method search push (hyps,goal) = let ranged = Range.ranges (Range.compute hyps) in Tmap.iter (fun e (a,b) -> if Strategy.occurs_p e goal && b-a <= 1024 then let selection = Tactical.(Inside(Goal goal,e)) in push (range selection ~vmin:a ~vmax:b) ) ranged end let auto_range = Strategy.export (new autorange) (* -------------------------------------------------------------------------- *) (* --- Heuristics: Auto-Split --- *) (* -------------------------------------------------------------------------- *) class autosplit = object(self) method id = "wp:split" method title = "Auto Split" method descr = "Split on goal or any branch (priority to goal variables)" method private search_goal push seq = let goal = snd seq in let is_split = let open Qed.Logic in match F.e_expr goal with | And _ | If _ -> true | Bind (Exists,_,phi) -> let rec is_split = function | Bind (Exists,_,phi) -> is_split (F.repr (F.QED.lc_repr phi)) | And _ | Or _ | If _ | Imply _ -> true | _ -> false in is_split (F.repr (F.QED.lc_repr phi)) | Neq(x,y) | Eq(x,y) -> (F.is_prop x) && (F.is_prop y) | _ -> false in if is_split then let selection = Tactical.(Clause (Goal goal)) in push (split ~priority:2.0 selection) method private search_branch push seq = let target = Lang.F.varsp (snd seq) in Conditions.iter (fun s -> let open Lang in let open Conditions in match s.condition with | Branch(_,sa,sb) -> let priority = if F.Vars.intersect target (Conditions.vars_hyp sa) || F.Vars.intersect target (Conditions.vars_hyp sb) then 1.0 else 0.5 in let selection = Tactical.(Clause(Step s)) in push (split ~priority selection) | _ -> () ) (fst seq) method search push seq = self#search_goal push seq ; self#search_branch push seq end let auto_split = Strategy.export (new autosplit) (**************************************************************************) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Auto.mli��������������������������������������������������������0000666�0000000�0000000�00000011553�13571573400�015531� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Tactical open Strategy (* -------------------------------------------------------------------------- *) (** {2 Basic Strategies} It is always safe to apply strategies to any goal. *) (* -------------------------------------------------------------------------- *) val array : ?priority:float -> selection -> strategy val choice : ?priority:float -> selection -> strategy val absurd : ?priority:float -> selection -> strategy val contrapose : ?priority:float -> selection -> strategy val compound : ?priority:float -> selection -> strategy val cut : ?priority:float -> ?modus:bool -> selection -> strategy val filter : ?priority:float -> ?anti:bool -> unit -> strategy val havoc : ?priority:float -> havoc:selection -> strategy val separated : ?priority:float -> selection -> strategy val instance : ?priority:float -> selection -> selection list -> strategy val lemma : ?priority:float -> ?at:selection -> string -> selection list -> strategy val intuition : ?priority:float -> selection -> strategy val range : ?priority:float -> selection -> vmin:int -> vmax:int -> strategy val split : ?priority:float -> selection -> strategy val definition : ?priority:float -> selection -> strategy (* -------------------------------------------------------------------------- *) (** {2 Registered Heuristics} *) (* -------------------------------------------------------------------------- *) val auto_split : Strategy.heuristic val auto_range : Strategy.heuristic module Range : sig type rg val compute : Conditions.sequence -> rg val ranges : rg -> (int * int) Lang.F.Tmap.t val bounds : rg -> (int option * int option) Lang.F.Tmap.t end (* -------------------------------------------------------------------------- *) (** {2 Trusted Tactical Process} Tacticals with hand-written process are not safe. However, the combinators below are guarantied to be sound. *) (* -------------------------------------------------------------------------- *) (** Find a contradiction. *) val t_absurd : process (** Keep goal unchanged. *) val t_id : process (** Apply a description to a leaf goal. Same as [t_descr "..." t_id]. *) val t_finally : string -> process (** Apply a description to each sub-goal *) val t_descr : string -> process -> process (** Split with [p] and [not p]. *) val t_split : ?pos:string -> ?neg:string -> Lang.F.pred -> process (** Prove condition [p] and use-it as a forward hypothesis. *) val t_cut : ?by:string -> Lang.F.pred -> process -> process (** Case analysis: [t_case p a b] applies process [a] under hypothesis [p] and process [b] under hypothesis [not p]. *) val t_case : Lang.F.pred -> process -> process -> process (** Complete analysis: applies each process under its guard, and proves that all guards are complete. *) val t_cases : ?complete:string -> (Lang.F.pred * process) list -> process (** Apply second process to every goal generated by the first one. *) val t_chain : process -> process -> process (** @raise Invalid_argument when range is empty *) val t_range : Lang.F.term -> int -> int -> upper:process -> lower:process -> range:process -> process (** Prove [src=tgt] then replace [src] by [tgt]. *) val t_replace : ?equal:string -> src:Lang.F.term -> tgt:Lang.F.term -> process -> process (**************************************************************************) �����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/CfgCompiler.ml��������������������������������������������������0000666�0000000�0000000�00000151726�13571573400�016651� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Sigs open Cil_types open Lang let dkey = Wp_parameters.register_category "cfg_compiler" let dumpkey = Wp_parameters.register_category "cfg_compiler_dump" type mode = [ | `Tree | `Bool_Backward | `Bool_Forward ] module type Cfg = sig module S : Sigma module Node : sig type t module Map : Qed.Idxmap.S with type key = t module Set : Qed.Idxset.S with type elt = t module Hashtbl : Hashtbl.S with type key = t val pp: Format.formatter -> t -> unit val create: unit -> t val equal: t -> t -> bool end type node = Node.t val node : unit -> node module C : sig type t val equal : t -> t -> bool val create : S.t -> F.pred -> t val get : t -> F.pred val reads : t -> S.domain val relocate : S.t -> t -> t end module P : sig type t val pretty : Format.formatter -> t -> unit val create : S.t Node.Map.t -> F.pred -> t val get: t -> F.pred val reads : t -> S.domain Node.Map.t val nodes : t -> Node.Set.t val relocate : S.t Node.Map.t -> t -> t val to_condition: t -> (C.t * Node.t option) option end module T : sig type t val pretty : Format.formatter -> t -> unit (** Bundle an equation with the sigma sequence that created it. *) val create : S.t Node.Map.t -> F.term -> t val get: t -> F.term val reads : t -> S.domain Node.Map.t val relocate : S.t Node.Map.t -> t -> t val init : Node.Set.t -> (S.t Node.Map.t -> F.term) -> t val init' : Node.t -> (S.t -> F.term) -> t end module E : sig type t val pretty: Format.formatter -> t -> unit val create : S.t sequence -> F.pred -> t val get : t -> F.pred val reads : t -> S.domain val writes : t -> S.domain val relocate : S.t sequence -> t -> t end type cfg val dump_env: name:string -> cfg -> unit val output_dot: out_channel -> ?checks:P.t Bag.t -> cfg -> unit val nop : cfg val add_tmpnode: node -> cfg val concat : cfg -> cfg -> cfg val meta : ?stmt:stmt -> ?descr:string -> node -> cfg val goto : node -> node -> cfg val branch : node -> C.t -> node -> node -> cfg val guard : node -> C.t -> node -> cfg val guard' : node -> C.t -> node -> cfg val either : node -> node list -> cfg val implies : node -> (C.t * node) list -> cfg val effect : node -> E.t -> node -> cfg val assume : P.t -> cfg val havoc : node -> effects:node sequence -> node -> cfg val compile : ?name:string -> ?mode:mode -> node -> Node.Set.t -> S.domain Node.Map.t -> cfg -> F.pred Node.Map.t * S.t Node.Map.t * Conditions.sequence end module Cfg (S:Sigma) : Cfg with module S = S = struct module S = S module Node : sig type t module Map : Qed.Idxmap.S with type key = t module Set : Qed.Idxset.S with type elt = t module Hashtbl : FCHashtbl.S with type key = t val tag: t -> int val compare: t -> t -> int val equal: t -> t -> bool val pp: Format.formatter -> t -> unit val create: unit -> t val node_internal: unit -> t end = struct type t = int module I = struct type t = int let id x = x end module Map = Qed.Idxmap.Make(I) module Set = Qed.Idxset.Make(I) module Hashtbl = Datatype.Int.Hashtbl let tag = I.id let compare = Datatype.Int.compare let equal = Datatype.Int.equal let pp fmt n = if n>=0 then Format.pp_print_int fmt n else Format.fprintf fmt "int%i" (-n) let node_compter = ref (-1) let create () = incr node_compter; !node_compter let node_internal_compter = ref 0 let node_internal () = decr node_internal_compter; !node_internal_compter end let node = Node.create let identify sigma ~src ~tgt = S.iter2 (fun _chunk u v -> match u,v with | Some x , Some y -> F.Subst.add sigma (F.e_var x) (F.e_var y) | _ -> ()) src tgt module E = struct type t = S.t sequence * F.pred let pretty fmt (_seq,p) = Format.fprintf fmt "effect: @[%a@]" F.pp_pred p let get : t -> F.pred = snd let create seq p = seq,p let relocate tgt (src,p) = let sigma = Lang.sigma () in identify sigma ~src:src.pre ~tgt:tgt.pre ; identify sigma ~src:src.post ~tgt:tgt.post ; tgt , F.p_subst sigma p let reads (seq,_) = S.domain seq.pre let writes (seq,_) = S.writes seq end module C = struct type t = S.t * F.pred let get = snd let create seq p = seq,p let relocate tgt (src,p) = let sigma = Lang.sigma () in identify sigma ~src ~tgt ; tgt , F.p_subst sigma p let reads (src,_) = S.domain src let equal (s1,p1) (s2,p2) = let sigma = Lang.sigma () in identify sigma ~src:s1 ~tgt:s2 ; F.eqp (F.p_subst sigma p1) p2 end module P = struct type t = S.t Node.Map.t * F.pred let pretty fmt (m,f) = Format.fprintf fmt "%a(%a)" F.pp_pred f (Pretty_utils.pp_iter2 Node.Map.iter ~between:",@ " Node.pp (fun _ _ -> ())) m let get = snd let create smap p = smap,p let relocate tgt (src,p) = let sigma = Lang.sigma () in Node.Map.iter2 (fun n src tgt -> match src,tgt with | Some src , Some tgt -> identify sigma ~src ~tgt | Some _, None -> invalid_arg (Format.asprintf "P.relocate: tgt is smaller than src at %a" Node.pp n) | _ -> ()) src tgt ; let tgt = Node.Map.inter (fun _ _ tgt -> tgt) src tgt in tgt , F.p_subst sigma p let reads (smap,_) = Node.Map.map (fun _ s -> S.domain s) smap let nodes (smap,_) = Node.Map.fold (fun k _ acc -> Node.Set.add k acc) smap Node.Set.empty let nodes_list (smap,_) = Node.Map.fold (fun k _ acc -> k::acc) smap [] let to_condition (m,p) = let l = Node.Map.fold (fun k e acc -> (k,e)::acc) m [] in match l with | [] -> Some ((S.create (),p), None) | [n,s] -> Some ((s,p), Some n) | _ -> None end module T = struct type t = S.t Node.Map.t * F.term let pretty fmt (m,f) = Format.fprintf fmt "%a(%a)" F.pp_term f (Pretty_utils.pp_iter2 Node.Map.iter ~between:",@ " Node.pp (fun _ _ -> ())) m let get = snd let create smap t = smap,t let reads (smap,_) = Node.Map.map (fun _ s -> S.domain s) smap let relocate tgt (src,p) = let sigma = Lang.sigma () in Node.Map.iter2 (fun _ src tgt -> match src,tgt with | Some src , Some tgt -> identify sigma ~src ~tgt | Some _, None -> invalid_arg "T.relocate: tgt is smaller than src" | _ -> ()) src tgt ; let tgt = Node.Map.inter (fun _ _ tgt -> tgt) src tgt in tgt , F.e_subst sigma p let init node_set f = let node_map = Node.Set.fold (fun x m -> Node.Map.add x (S.create ()) m ) node_set Node.Map.empty in let t = f node_map in (node_map,t) let init' node f = let src = S.create () in let t = f src in let node_map = Node.(Map.add node src Map.empty) in (node_map,t) end type node = Node.t type without_bindings = Without_Bindings type with_bindings = With_Bindings let _ = Without_Bindings let _ = With_Bindings type ('havoc,_) edge = | Goto of node | Branch of C.t * node option * node option | Either of node list | Implies of (C.t * node) list | Effect of E.t * node | Havoc of 'havoc * node | Binding : Passive.t * node -> ('havoc,with_bindings) edge (** Binding used for sigma merging *) type data = | Meta of stmt option * string option type ('havoc, 'bindings) env = { succs : ('havoc, 'bindings) edge Node.Map.t; datas : data Bag.t Node.Map.t; (* datas is always included in succs *) assumes : P.t Bag.t; tmpnodes : Node.Set.t; (* node that could be removed *) } type pre_env = (node sequence, without_bindings) env type restricted_env = (S.domain, without_bindings) env type localised_env = (S.domain, with_bindings) env type cfg = pre_env let iter_succs : type a b. (Node.t -> unit) -> (a,b) edge -> unit = fun f -> function | Goto n2 | Effect(_,n2) | Havoc(_,n2) -> f n2 | Branch(_,n2a,n2b) -> let f' = function None -> () | Some x -> f x in f' n2a; f' n2b | Either l -> List.iter f l | Implies l -> List.iter (fun (_,a) -> f a) l | Binding (_,n2) -> f n2 let iter_succs_e f cfg n = match Node.Map.find n cfg.succs with | exception Not_found -> () | e -> iter_succs f e let succs : type a b. (a,b) env -> Node.t -> Node.t list = fun cfg n -> match Node.Map.find n cfg.succs with | exception Not_found -> [] | Goto n2 | Effect(_,n2) | Havoc(_,n2) | Branch(_,Some n2,None) | Branch(_,None,Some n2) -> [n2] | Binding (_,n2) -> [n2] | Branch(_,Some n1,Some n2) -> [n1;n2] | Branch(_,None,None) -> [] | Either l -> l | Implies l -> List.map snd l let pretty_edge : type a. Format.formatter -> (_,a) edge -> unit = fun fmt edge -> match edge with | Goto(n) -> Format.fprintf fmt "goto(%a)" Node.pp n | Branch(c,n1,n2) -> Format.fprintf fmt "branch(%a,%a,%a)" Lang.F.pp_pred (C.get c) (Pretty_utils.pp_opt Node.pp) n1 (Pretty_utils.pp_opt Node.pp) n2 | Either l -> Format.fprintf fmt "either(%a)" (Pretty_utils.pp_list ~sep:",@ " Node.pp) l | Implies l -> Format.fprintf fmt "implies(%a)" (Pretty_utils.pp_list ~sep:",@ " (fun fmt (c,a) -> Format.fprintf fmt "%a=>%a" Lang.F.pp_pred (C.get c) Node.pp a)) l | Effect(_,n) -> Format.fprintf fmt "effect(%a)" Node.pp n | Havoc(_,n) -> Format.fprintf fmt "havoc(%a)" Node.pp n | Binding(_,n) -> Format.fprintf fmt "binding(%a)" Node.pp n let pretty_data fmt = function | Meta(s_opt,str_opt) -> Format.fprintf fmt "Meta(%a,%a)" (Pretty_utils.pp_opt ~none:"None" Cil_datatype.Stmt.pretty_sid) s_opt (Pretty_utils.pp_opt ~none:"None" Format.pp_print_string) str_opt let pretty_env : type a. Format.formatter -> (_,a) env -> unit = fun fmt env -> Context.bind Lang.F.context_pp (Lang.F.env Lang.F.Vars.empty) (fun () -> Format.fprintf fmt "@[<v>@[<3>@[succs:@]@ %a@]@,@[<3>@[datas:@]@ %a@]@,@[<3>@[assumes:@]@ %a@]@]@." (Pretty_utils.pp_iter2 ~between:"->@," ~sep:",@ " Node.Map.iter Node.pp pretty_edge) env.succs (Pretty_utils.pp_iter2 ~between:"->@," ~sep:",@ " Node.Map.iter Node.pp (Pretty_utils.pp_iter Bag.iter pretty_data)) env.datas (Pretty_utils.pp_iter ~sep:",@ " Bag.iter P.pretty) env.assumes ) () let dump_edge : type a. node -> Format.formatter -> (_, a) edge -> unit = fun n fmt edge -> let pp_edge ?(label="") n' = Format.fprintf fmt " %a -> %a [ label=\"%s\" ] ;@." Node.pp n Node.pp n' label in begin match edge with | Goto n1 -> pp_edge n1 | Branch (_, n1, n2)-> Extlib.may pp_edge n1; Extlib.may pp_edge n2 | Either ns -> List.iter pp_edge ns | Implies ns -> List.iter (fun (_,a) -> pp_edge a) ns | Effect (e, n') -> pp_edge ~label:(Format.asprintf "%a" E.pretty e) n' | Havoc (_, n') -> pp_edge ~label:"havoc" n' | Binding (_,n') -> pp_edge ~label:"binding" n' end let dump_node : data Bag.t -> Format.formatter -> node -> unit = fun datas fmt n -> Format.fprintf fmt " %a [ label=\"%a\n%a\" ] ;@." Node.pp n Node.pp n (Pretty_utils.pp_iter ~sep:"\n" Bag.iter pretty_data) datas let dump_succ : type a. (_, a) env -> Format.formatter -> node -> (_, a) edge -> unit = fun env fmt n e -> let datas = try Node.Map.find n env.datas with Not_found -> Bag.empty in Format.fprintf fmt "%a\n%a@\n" (dump_node datas) n (dump_edge n) e let dump_assume : Format.formatter -> P.t -> unit = let count = ref 0 in fun fmt p -> incr count; Format.fprintf fmt " subgraph cluster_%d {@\n" !count; Format.fprintf fmt " color=\"palegreen\";@\n"; Node.Map.iter (fun n _ -> Format.fprintf fmt " %a;\n" Node.pp n) (P.reads p); Format.fprintf fmt " label=\"%a\";" Lang.F.pp_pred (P.get p); Format.fprintf fmt " }@." let escape fmt = Pretty_utils.ksfprintf (fun s -> String.escaped s) fmt let output_dot : type a b. out_channel -> ?checks:_ -> (a,b) env -> unit = fun cout ?(checks=Bag.empty) env -> let count = let c = ref max_int in fun () -> decr c; !c in let module E = struct type t = Graph.Graphviz.DotAttributes.edge list let default = [] let compare x y = assert (x == y); 0 end in let module V = struct type t = | Node of Node.t | Assume of int * Lang.F.pred | Check of int * Lang.F.pred (* todo better saner comparison *) let tag = function | Node i -> Node.tag i | Assume (i,_) -> i | Check (i,_) -> i let pp fmt = function | Node i -> Node.pp fmt i | Assume (i,_) -> Format.fprintf fmt "ass%i" i | Check (i,_) -> Format.fprintf fmt "chk%i" i let equal x y = (tag x) = (tag y) let compare x y = Transitioning.Stdlib.compare (tag x) (tag y) let hash x = tag x end in let module G = Graph.Imperative.Digraph.ConcreteBidirectionalLabeled (V)(E) in let module Dot = Graph.Graphviz.Dot(struct let graph_attributes _g = [`Fontname "fixed"] let default_vertex_attributes _g = (* [`Shape `Point] *) [`Shape `Circle] let vertex_name v = Format.asprintf "cp%a" V.pp v let vertex_attributes = function | V.Node n -> [`Label (escape "%a" Node.pp n)] | V.Assume (_,p) -> [`Style `Dashed; `Label (escape "%a" Lang.F.pp_pred p)] | V.Check (_,p) -> [`Style `Dotted; `Label (escape "%a" Lang.F.pp_pred p)] let get_subgraph _ = None let default_edge_attributes _g = [] let edge_attributes ((_,e,_):G.E.t) : Graph.Graphviz.DotAttributes.edge list = e include G end) in let g = G.create () in let add_edge n1 l n2 = G.add_edge_e g (V.Node n1,l,V.Node n2) in let add_edges : type a b. Node.t -> (a,b) edge -> unit = fun n1 -> function | Goto n2 -> add_edge n1 [] n2 | Branch((_,c),n2,n2') -> let aux s = function | None -> () | Some n -> add_edge n1 [`Label (escape "%s%a" s Lang.F.pp_pred c)] n in aux "" n2; aux "!" n2' | Either l -> List.iter (add_edge n1 []) l | Implies l -> List.iter (fun (c,n) -> add_edge n1 [`Label (escape "%a" Lang.F.pp_pred (C.get c))] n) l | Effect ((_,e),n2) -> add_edge n1 [`Label (escape "%a" Lang.F.pp_pred e)] n2 | Havoc (_,n2) -> add_edge n1 [`Label (escape "havoc")] n2 | Binding (_,n2) -> add_edge n1 [`Label (escape "binding")] n2 in Node.Map.iter add_edges env.succs; (** assumes *) Bag.iter (fun (m,p) -> let n1 = V.Assume(count (), p) in let assume_label = [`Style `Dashed ] in Node.Map.iter (fun n2 _ -> G.add_edge_e g (n1,assume_label,V.Node n2)) m ) env.assumes; (** checks *) Bag.iter (fun (m,p) -> let n1 = V.Check(count (), p) in let label = [`Style `Dotted ] in Node.Map.iter (fun n2 _ -> G.add_edge_e g (V.Node n2,label,n1)) m ) checks; Dot.output_graph cout g let dump_env : type a. name:string -> (_, a) env -> unit = fun ~name env -> let file = (Filename.get_temp_dir_name ()) ^ "/cfg_" ^ name in let fout = open_out (file ^ ".dot") in if false then begin let out = Format.formatter_of_out_channel fout in Format.fprintf out "digraph %s {@\n" name; Format.fprintf out " rankdir = TB ;@\n"; Format.fprintf out " node [ style = filled, shape = circle ] ;@\n"; Node.Map.iter (dump_succ env out) env.succs; Bag.iter (dump_assume out) env.assumes; Format.fprintf out "}@."; end else begin output_dot fout env; end; close_out fout; ignore (Sys.command (Printf.sprintf "dot -Tpdf %s.dot > %s.pdf" file file)); Wp_parameters.debug ~dkey:dumpkey "Saving dump %s into %s.pdf" name file let env_union env1 env2 = { succs = Node.Map.union (fun _ _v1 _v2 -> invalid_arg "A node has more than one successor") env1.succs env2.succs; datas = Node.Map.union (fun _ -> Bag.concat) env1.datas env2.datas; assumes = Bag.concat env1.assumes env2.assumes; tmpnodes = Node.Set.union env1.tmpnodes env2.tmpnodes; } let new_env ?(succs=Node.Map.empty) ?(datas=Node.Map.empty) ?(assumes=Bag.empty) ?(tmpnodes=Node.Set.empty) () = {succs; datas; assumes; tmpnodes} let nop = new_env () let add_tmpnode node = new_env ~tmpnodes:(Node.Set.singleton node) () let concat a b = env_union a b let meta ?stmt ?descr n = let data = Meta(stmt,descr) in new_env ~datas:(Node.Map.add n (Bag.elt data) (Node.Map.empty)) () let edge n e = new_env ~succs:(Node.Map.add n e (Node.Map.empty)) () let goto node_orig node_target = edge node_orig (Goto(node_target)) let branch node_orig predicate node_target_then node_target_else = edge node_orig (Branch(predicate, Some node_target_then, Some node_target_else)) let guard node_orig predicate node_target_then = edge node_orig (Branch(predicate, Some node_target_then, None)) let guard' node_orig predicate node_target_else = edge node_orig (Branch(predicate, None, Some node_target_else )) let either node = function | [] -> nop | [dest] -> goto node dest | node_list -> edge node (Either(node_list)) let implies node = function | [] -> nop | [g,dest] -> guard node g dest | node_list -> edge node (Implies(node_list)) let effect node1 e node2 = edge node1 (Effect(e, node2)) let assume (predicate:P.t) = if F.is_ptrue (P.get predicate) = Qed.Logic.Yes then nop else new_env ~assumes:(Bag.elt predicate) () let havoc node1 ~effects:node_seq node2 = edge node1 (Havoc(node_seq,node2)) let option_bind ~f = function | None -> None | Some x -> f x let union_opt_or union d1 d2 = match d1, d2 with | Some d1, Some d2 -> Some (union d1 d2) | (Some _ as d), None | None, (Some _ as d) -> d | None, None -> None let union_opt_and union d1 d2 = match d1, d2 with | Some d1, Some d2 -> Some (union d1 d2) | _ -> None let add_only_if_alive union d1 = function | None -> None | Some d2 -> Some (union d1 d2) (** return None when post is not accessible from this node *) let rec effects : type a. (_,a) env -> node -> node -> S.domain option = fun env post node -> if node = post then Some S.empty else match Node.Map.find node env.succs with | exception Not_found -> None | Goto (node2) -> effects env post node2 | Branch (_, node2, node3) -> union_opt_or S.union (option_bind ~f:(effects env post) node2) (option_bind ~f:(effects env post) node3) | Either (l) -> (List.fold_left (fun acc node2 -> union_opt_or S.union acc (effects env post node2)) None l) | Implies (l) -> (List.fold_left (fun acc (_,node2) -> union_opt_or S.union acc (effects env post node2)) None l) | Effect (effect , node2) -> add_only_if_alive S.union (E.writes effect) (effects env post node2) | Havoc (m, node2) -> union_opt_and S.union (effects env m.post m.pre) (effects env post node2) | Binding (_,node2) -> effects env post node2 (** restrict a cfg to the nodes accessible from the pre post given, and compute havoc effect *) let restrict (cfg:pre_env) pre posts : restricted_env = let rec walk acc node : restricted_env option = if Node.Map.mem node acc.succs then Some acc else let new_env edge = new_env ~succs:(Node.Map.add node edge (Node.Map.empty)) () in let r = match Node.Map.find node cfg.succs with | exception Not_found -> None | (Goto (node2) | Effect (_ , node2)) as edge -> union_opt_and env_union (Some (new_env edge)) (walk acc node2) | Branch (pred, node2, node3) -> (** it is important to visit all the childrens *) let f acc node = match option_bind ~f:(walk acc) node with | None -> None, acc | Some acc -> node, acc in let node2, acc = f acc node2 in let node3, acc = f acc node3 in if node2 = None && node3 = None then None else Some (env_union acc (new_env (Branch(pred, node2, node3)))) | Either (l) -> let acc,l = List.fold_left (fun ((acc,l) as old) node2 -> match walk acc node2 with | None -> old | Some acc -> (acc,node2::l)) (acc,[]) l in if l = [] then None else Some (env_union acc (new_env (Either (List.rev l)))) | Implies (l) -> let acc,l = List.fold_left (fun ((acc,l) as old) ((_,node2) as e) -> match walk acc node2 with | None -> old | Some acc -> (acc,e::l)) (acc,[]) l in if l = [] then None else Some (env_union acc (new_env (Implies (List.rev l)))) | Havoc (m, node2) -> match effects cfg m.post m.pre with | None -> None | Some eff -> union_opt_and env_union (Some (new_env (Havoc(eff,node2)))) (walk acc node2) in if Node.Set.mem node posts && r = None then Some acc else r in match walk (new_env ()) pre with | None -> (new_env ()) | Some acc -> { succs = acc.succs; datas = Node.Map.inter (fun _ _ v -> v) acc.succs cfg.datas; assumes = Bag.filter (fun (seq,_) -> Node.Map.subset (fun _ _ _ -> true) seq acc.succs) cfg.assumes; tmpnodes = cfg.tmpnodes; } (** succ is decreasing for this order *) let topological (type a) (type b) (cfg:(a,b) env) = let module G = struct type t = (a,b) env module V = struct let hash = Hashtbl.hash include Node end let iter_vertex f cfg = let h = Node.Hashtbl.create 10 in let replace n = Node.Hashtbl.replace h n () in Node.Map.iter (fun k _ -> replace k; iter_succs_e replace cfg k) cfg.succs; Node.Hashtbl.iter (fun k () -> f k) h let iter_succ = iter_succs_e end in let module T = Graph.Topological.Make(G) in let h = Node.Hashtbl.create 10 in let h' = Datatype.Int.Hashtbl.create 10 in let c = ref (-1) in let l = ref [] in T.iter (fun n -> l := n::!l; incr c; Node.Hashtbl.add h n !c; Datatype.Int.Hashtbl.add h' !c n) cfg; h,h',List.rev !l (** topo_list: elements in topological order topo_order: post-order mapping nb: number of elements *) let idoms topo_list topo_order nb ~pred ~is_after = let a = Array.make nb (-1) in let iter n = let first,preds = match pred n with | [] -> topo_order n, [] | f::p -> topo_order f, List.map topo_order p in let rec find_common n1 n2 = if n1 = n2 then n1 else if is_after n1 n2 then find_common a.(n1) n2 else find_common n1 a.(n2) in let idom = List.fold_left find_common first preds in a.(topo_order n) <- idom in List.iter iter topo_list; a let find_def ~def x t = try Node.Map.find x t with Not_found -> def let rec remove_dumb_gotos (env:restricted_env) : Node.t Node.Map.t * restricted_env = let add_map m acc = Node.Map.fold (fun n _ acc -> Node.Set.add n acc) m acc in let used_nodes = Bag.fold_left (fun acc p -> add_map (P.reads p) acc) Node.Set.empty env.assumes in let used_nodes = add_map env.datas used_nodes in let how_many_preds = Node.Hashtbl.create 10 in let incr_how_many_preds n = Node.Hashtbl.replace how_many_preds n (succ (Node.Hashtbl.find_def how_many_preds n 0)) in let subst = Node.Map.fold (fun n e acc -> iter_succs incr_how_many_preds e; match (e:(_,without_bindings) edge) with | Goto n' when not (Node.Set.mem n used_nodes) -> Node.Map.add n n' acc | Goto _ | Branch (_,_,_) | Either _ | Implies _ | Effect (_,_) | Havoc (_,_) -> acc) env.succs Node.Map.empty in let subst = let rec compress n = match Node.Map.find n subst with | exception Not_found -> n | n -> compress n in Node.Map.map (fun _ n' -> compress n') subst in let find n = find_def ~def:n n subst in (** detect either that could be transformed in branch *) let to_remove = Node.Hashtbl.create 10 in Node.Map.iter (fun _ e -> match (e:(_,without_bindings) edge) with | Either [a;b] when Node.Hashtbl.find how_many_preds a = 1 && Node.Hashtbl.find how_many_preds b = 1 && not (Node.Set.mem a used_nodes) && not (Node.Set.mem b used_nodes) && Node.Set.mem a env.tmpnodes && Node.Set.mem b env.tmpnodes && true -> begin let find_opt k m = match Node.Map.find k m with | exception Not_found -> None | v -> Some v in match find_opt a env.succs, find_opt b env.succs with | Some Branch(c,Some n1, None), Some Branch(c',None, Some n2) | Some Branch(c,None, Some n2), Some Branch(c',Some n1,None) when C.equal c c' -> let n1 = find n1 in let n2 = find n2 in let br = Branch(c,Some n1, Some n2) in Node.Hashtbl.add to_remove a br; Node.Hashtbl.add to_remove b br | _ -> () end | Goto _ | Branch (_,_,_) | Effect (_,_) | Either _ | Implies _ | Havoc (_,_) -> () ) env.succs; (** substitute and remove *) let succs = Node.Map.mapq (fun n e -> match (e:(_,without_bindings) edge) with | _ when Node.Hashtbl.mem to_remove n -> None | Goto _ when not (Node.Set.mem n used_nodes) -> None | Goto n' -> let n'' = find n' in if Node.equal n' n'' then Some e else Some (Goto n'') | Branch (c,n1,n2) -> let n1' = Extlib.opt_map find n1 in let n2' = Extlib.opt_map find n2 in if Extlib.opt_equal Node.equal n1 n1' && Extlib.opt_equal Node.equal n2 n2' then Some e else Some (Branch(c,n1',n2')) | Either l -> let l' = List.map find l in let l' = List.sort_uniq Node.compare l' in begin match l' with | [] -> assert false (* absurd: Either after restricted has at least one successor *) | [a] -> Some (Goto a) | [a;_] when Node.Hashtbl.mem to_remove a -> let br = Node.Hashtbl.find to_remove a in Some br | l' -> Some (Either l') end | Implies l -> let l' = List.map (fun (g,n) -> (g,find n)) l in Some (Implies l') | Effect (ef,n') -> let n'' = find n' in if Node.equal n' n'' then Some e else Some (Effect(ef,n'')) | Havoc (h,n') -> let n'' = find n' in if Node.equal n' n'' then Some e else Some (Havoc(h,n'')) ) env.succs in let env = {env with succs} in if Node.Map.is_empty subst then subst, env else let subst', env = remove_dumb_gotos env in let subst = Node.Map.map (fun _ n' -> find_def ~def:n' n' subst') subst in Node.Map.merge (fun _ a b -> match a, b with | Some _, Some _ -> assert false (** the elements are remove in the new env *) | Some x, None | None, Some x -> Some x | None, None -> assert false ) subst subst', env let allocate domain sigma = S.Chunk.Set.iter (fun chunk -> ignore (S.get sigma chunk)) domain let domains (env : restricted_env) reads pre : localised_env * S.t Node.Map.t = let visited = ref Node.Map.empty in let new_succs = ref Node.Map.empty in let add_edge node edge = new_succs := Node.Map.add node edge !new_succs in let add_binding_edge n (p: Passive.t) = if Passive.is_empty p then n else let n' = Node.node_internal () in add_edge n' (Binding(p,n)); n' in let rec aux node : S.t = try Node.Map.find node !visited with Not_found -> let dom = find_def ~def:S.empty node reads in let ret = match Node.Map.find node env.succs with | exception Not_found -> (** posts node *) let s1 = S.create () in allocate dom s1; s1 | Goto (node2) -> let s1 = S.copy (aux node2) in allocate dom s1; add_edge node (Goto node2); s1 | Branch (pred, node2, node3) -> let dom = (S.union (C.reads pred) dom) in begin match node2, node3 with | (None, Some next) | (Some next, None) -> let s1 = S.copy (aux next) in allocate dom s1; let pred = C.relocate s1 pred in add_edge node (Branch(pred,node2,node3)); s1 | Some node2, Some node3 -> let s2 = aux node2 in let s3 = aux node3 in let s1,p2,p3 = S.merge s2 s3 in allocate dom s1; let node2' = add_binding_edge node2 p2 in let node3' = add_binding_edge node3 p3 in let pred = C.relocate s1 pred in add_edge node (Branch(pred,Some node2',Some node3')); s1 | _ -> assert false end | Either (l) -> let s1, pl = S.merge_list (List.map aux l) in allocate dom s1; let l = List.map2 add_binding_edge l pl in add_edge node (Either l); s1 | Implies (l) -> let dom = List.fold_left (fun acc (c,_) -> S.union (C.reads c) acc) dom l in let s1, pl = S.merge_list (List.map (fun (_,n) -> aux n) l) in allocate dom s1; let l = List.map2 (fun (c,a) b -> let a = add_binding_edge a b in let c = C.relocate s1 c in (c,a)) l pl in add_edge node (Implies l); s1 | Effect (effect , node2) -> let s2 = aux node2 in let s1 = S.remove_chunks s2 (E.writes effect) in allocate dom s1; allocate (E.reads effect) s1; let effect = E.relocate {pre=s1;post=s2} effect in add_edge node (Effect(effect,node2)); s1 | Havoc (eff, node2) -> let s2 = aux node2 in let s1 = S.havoc s2 eff in allocate dom s1; add_edge node (Havoc(eff,node2)); s1 in visited := Node.Map.add node ret !visited; ret in ignore (aux pre); let sigmas = !visited in let new_env = {succs = !new_succs; datas = env.datas; assumes = Bag.map (fun e -> P.relocate sigmas e) env.assumes; tmpnodes = env.tmpnodes; } in new_env, sigmas let compute_preds env = let h = Node.Hashtbl.create 10 in let add = Node.Hashtbl.add h in Node.Map.iter (fun n s -> match s with | Goto n1 | Havoc (_, n1) | Effect (_,n1) | Binding (_,n1) -> add n1 n | Branch (_,Some n1,Some n2) -> add n1 n; add n2 n | Branch(_,Some n1,None) -> add n1 n | Branch(_,None,Some n1) -> add n1 n | Branch(_,None,None) -> () | Either l -> List.iter (fun n1 -> add n1 n) l | Implies l -> List.iter (fun (_,n1) -> add n1 n) l ) env.succs; h let to_sequence_bool ~mode pre posts env : Conditions.sequence * F.pred Node.Map.t = let preds = Node.Hashtbl.create 10 in let access n = Node.Hashtbl.memo preds n (fun _ -> let v = F.fresh ~basename:"node" (get_pool ()) Qed.Logic.Bool in F.p_bool (F.e_var v)) in let (!.) c = (Conditions.sequence [Conditions.step c]) in let have_access n = !. (Conditions.Have (access n)) in let add_cond ?descr ?stmt f cond = Conditions.append (Conditions.sequence [Conditions.step ?descr ?stmt cond]) f in let either = function | [] -> !. (Conditions.Have F.p_false) | [a] -> a | l -> !. (Conditions.Either l) in let f = Conditions.empty in (** The start state is accessible *) let pre = Conditions.Have (access pre) in let f = add_cond f pre in (** The posts state are accessible *) let f = Node.Set.fold (fun n f -> add_cond f (Conditions.Have (access n))) posts f in (** The assumes are true if all their nodes are accessible *) let f = Bag.fold_left (fun f p -> let nodes_are_accessible = Node.Map.fold (fun n _ acc -> F.p_and (access n) acc) (P.reads p) F.p_true in let f' = F.p_imply nodes_are_accessible (P.get p) in add_cond f (Conditions.Have f') ) f env.assumes in (** compute predecessors *) let to_sequence_basic_backward f = let predecessors = Node.Map.fold (fun n s acc -> let add acc n' p = Node.Map.change (fun _ (n,p) -> function | None -> Some (Node.Map.add n p Node.Map.empty) | Some s -> Some (Node.Map.add n p s)) n' (n,p) acc in match s with | Goto n' | Havoc (_, n') -> add acc n' F.p_true | Branch (c,Some n1,Some n2) -> let c = P.get c in add (add acc n1 c) n2 (F.p_not c) | Branch(c,Some n1,None) -> add acc n1 (P.get c) | Branch(c,None,Some n1) -> add acc n1 (F.p_not (P.get c)) | Branch(_,None,None) -> acc | Either l -> List.fold_left (fun acc e -> add acc e F.p_true) acc l | Implies l -> List.fold_left (fun acc (c,e) -> add acc e (P.get c)) acc l | Effect (e,n') -> add acc n' (E.get e) | Binding (b,n') -> let b = F.p_conj (Passive.conditions b (fun _ -> true)) in add acc n' b ) env.succs Node.Map.empty in Node.Map.fold (fun n' preds f -> let l = Node.Map.fold (fun n p acc -> (Conditions.append (have_access n) (!. (Conditions.Have p)))::acc ) preds [] in let f' = Conditions.Branch(access n', either l, Conditions.empty) in let stmt,descr = let bag = match Node.Map.find n' env.datas with | exception Not_found -> Bag.empty | bag -> bag in Bag.fold_left (fun (os,od) b -> match b with | Meta(os',od') -> (if os = None then os' else os), (if od = None then od' else od) ) (None,None) bag in add_cond ?stmt ?descr f f' ) predecessors f in (** The transitions *) let to_sequence_basic_forward f = Node.Map.fold (fun n s f -> let node_is_accessible = access n in let f' = match s with | Goto n' | Havoc (_, n') -> (* The havoc is already taken into account during {!domains} *) Conditions.Branch(node_is_accessible, have_access n', Conditions.empty) | Branch (c,Some n1,Some n2) -> Conditions.Branch(node_is_accessible, !. (Conditions.Branch((C.get c), have_access n1, have_access n2)), Conditions.empty) | Branch(c,Some n1,None) -> Conditions.Branch(node_is_accessible, Conditions.append (!. (Conditions.Have (C.get c))) (have_access n1), Conditions.empty) | Branch(c,_,Some n1) -> Conditions.Branch(node_is_accessible, Conditions.append (!. (Conditions.Have (F.p_not (C.get c)))) (have_access n1), Conditions.empty) | Branch(_,None,None) -> assert false | Either l -> let l = List.map have_access l in Conditions.Branch(node_is_accessible, either l, Conditions.empty) | Implies l -> let l = List.map (fun (c,n) -> !. (Conditions.Branch (C.get c, have_access n, Conditions.empty))) l in Conditions.Branch(node_is_accessible, Conditions.concat l, Conditions.empty) | Effect (e,n) -> Conditions.Branch(node_is_accessible, Conditions.append (!. (Conditions.Have (E.get e))) (have_access n) , Conditions.empty) | Binding (b,n') -> (** For basic: all the variables are important *) let b = !. (Conditions.Have(F.p_conj (Passive.conditions b (fun _ -> true)))) in Conditions.Branch(node_is_accessible, Conditions.append b (have_access n'), Conditions.empty) in let stmt,descr = let bag = match Node.Map.find n env.datas with | exception Not_found -> Bag.empty | bag -> bag in Bag.fold_left (fun (os,od) b -> match b with | Meta(os',od') -> (if os = None then os' else os), (if od = None then od' else od) ) (None,None) bag in add_cond ?stmt ?descr f f' ) env.succs f in let f = match mode with | `Bool_Backward -> to_sequence_basic_backward f | `Bool_Forward -> to_sequence_basic_forward f in f,Node.Hashtbl.fold Node.Map.add preds Node.Map.empty module To_tree = struct (** Use a simplified version of "A New Elimination-Based Data Flow Analysis Framework Using Annotated Decomposition Trees" where there is no loop *) type tree = { c : F.pred (** condition for this tree *) ; q : tree Queue.t (** childrens *) ; mutable fact : F.pred list (** facts at this level *) ; } [@@@ warning "-32"] let rec pp_tree ?(pad : (string * string)= ("", "")) (tree : tree) : unit = let pd, pc = pad in Format.printf "%sNode condition: %a @." pd Lang.F.pp_pred tree.c; Format.printf "%sNode fact:%a@." pd (Pretty_utils.pp_list ~sep:"," ~pre:"[" ~suf:"]" Lang.F.pp_pred) tree.fact; let n = Queue.length tree.q - 1 in let _ = Queue.fold ( fun i c -> let pad = (pc ^ (if i = n then "`-- " else "|-- "), pc ^ (if i = n then " " else "| ")) in pp_tree ~pad c; i+1 ) 0 tree.q in () let pp_idoms fmt a = Pretty_utils.pp_array ~sep:";@ " (fun fmt i j -> Format.fprintf fmt "%i -> %i" i j) fmt a [@@@ warning "+32"] type env_to_sequence_tree = { env: localised_env; (** predecessors *) pred: Node.t -> Node.t list; (** topological order *) topo_order : Node.t -> int; (** Immediate dominator forward *) get_idom_forward: Node.t -> Node.t; (** Immediate dominator backward *) get_idom_backward: int -> int; (** For each node we are going to compute different formulas *) (** Necessary conditions of the node from start *) full_conds: Lang.F.pred Node.Hashtbl.t; (** Necessary conditions from its forward idiom *) conds: Lang.F.pred Node.Hashtbl.t; (** To which subtree corresponds this node *) subtrees: tree Node.Hashtbl.t; (** Root the full tree *) root: tree; (** Variable used for the non-deterministic choice of either *) eithers: Lang.F.pred Node.Hashtbl.t Node.Hashtbl.t; } let is_after n1 n2 = n1 > n2 let is_before n1 n2 = n1 < n2 let create_env_to_sequence_tree env = (** Compute topological order for immediate dominator computation and the main iteration on nodes *) let node_int,int_node,ordered = topological env in let nb = Node.Hashtbl.length node_int in (** We compute the forward immediate dominators (path that use succ) and the backward immediate dominators (path that use pred) *) let predecessors = compute_preds env in let pred n = Node.Hashtbl.find_all predecessors n in let succ n = succs env n in let topo_order = Node.Hashtbl.find node_int in let idoms_forward = idoms ordered topo_order nb ~pred ~is_after in let idoms_backward = idoms (List.rev ordered) topo_order nb ~pred:succ ~is_after:is_before in let get_idom_forward n = Datatype.Int.Hashtbl.find int_node idoms_forward.(topo_order n) in (* Format.printf "@[ordered: %a@]@." (Pretty_utils.pp_list ~sep:"@ " (fun fmt n -> Format.fprintf fmt "%a (%i)" Node.pp n (Node.Hashtbl.find node_int n))) ordered; * Format.printf "@[pred: %a@]@." * (Pretty_utils.pp_iter2 ~sep:"@ " ~between:":" Node.Hashtbl.iter Node.pp Node.pp) predecessors; * Format.printf "@[idoms forward: @[@[%a@]@]@." _pp_idoms idoms_forward; * Format.printf "@[idoms backward: @[@[%a@]@]@." _pp_idoms idoms_backward; *) { env; pred; topo_order; get_idom_forward; get_idom_backward = (fun i -> idoms_backward.(i)); full_conds = Node.Hashtbl.create 10; conds = Node.Hashtbl.create 10; subtrees = Node.Hashtbl.create 10; root = {c = Lang.F.p_true; q = Queue.create (); fact = [] }; eithers = Node.Hashtbl.create 10; }, ordered let either env n last = let h = Node.Hashtbl.memo env.eithers n (fun _ -> Node.Hashtbl.create 10) in Node.Hashtbl.memo h last (fun _ -> let v = F.fresh ~basename:"node" (get_pool ()) Qed.Logic.Bool in F.p_bool (F.e_var v) ) (** For a node n *) let iter env n = let idom = env.get_idom_forward n in let rec get_cond acc n' = if n' = idom then acc else let acc = F.p_and acc (Node.Hashtbl.find env.conds n') in get_cond acc (env.get_idom_forward n') in (** find all the conditions that keep the path toward n, i.e. the condition of the nodes that are not dominated backwardly (for which not all the nodes goes to n) *) let rec find_frontiere last acc n' = if (env.topo_order n) <= env.get_idom_backward (env.topo_order n') then let cond = get_cond F.p_true n' in let branch = match Node.Map.find n' env.env.succs with | exception Not_found -> F.p_true | Goto _ | Havoc (_, _) -> F.p_true | Branch (c,Some n'',Some _) when Node.equal n'' last -> C.get c | Branch (c,Some _,Some n'') when Node.equal n'' last -> F.p_not (C.get c) | Branch (_,_,_) -> F.p_true | Either _ -> either env n' last | Implies l -> List.fold_left (fun acc (c,n) -> if n = last then C.get c else acc) F.p_true l | Effect (_,_) -> F.p_true | Binding (_,_) -> F.p_true in F.p_or acc (F.p_and branch cond) else List.fold_left (find_frontiere n') acc (env.pred n') in let c, q = if Node.equal idom n then (** it is the root *) begin Node.Hashtbl.add env.full_conds n F.p_true; Node.Hashtbl.add env.conds n F.p_true; F.p_true, env.root.q end else let c = List.fold_left (find_frontiere n) F.p_false (env.pred n) in (* Format.printf "for %a c=%a@." Node.pp n Lang.F.pp_pred c; *) Node.Hashtbl.add env.conds n c; Node.Hashtbl.add env.full_conds n (F.p_and c (Node.Hashtbl.find env.full_conds idom)); let p = Node.Hashtbl.find env.subtrees idom in c,p.q in let fact = match Node.Map.find n env.env.succs with | exception Not_found -> F.p_true | Goto _ | Havoc (_, _) -> F.p_true | Branch (c,Some _,None) -> C.get c | Branch (c,None,Some _) -> F.p_not (C.get c) | Branch (_,_,_) -> F.p_true | Either _ -> F.p_true | Implies _ -> F.p_true | Effect (e,_) -> E.get e | Binding (b,_) -> F.p_conj (Passive.conditions b (fun _ -> true)) in (* Format.printf "Here: For %a idoms=%a c=%a fact=%a@." Node.pp n Node.pp idom F.pp_pred c F.pp_pred fact; *) let t = {c = c; q = Queue.create (); fact = [fact]} in Queue.push t q; Node.Hashtbl.add env.subtrees n t let add_cond ?descr ?stmt f cond = match cond with | Conditions.Have c when F.is_ptrue c = Qed.Logic.Yes -> f | _ -> Conditions.append (Conditions.sequence [Conditions.step ?descr ?stmt cond]) f let access env n = Node.Hashtbl.find env.full_conds n let get_latest_node env = function | [] -> env.root | a::l -> let n = List.fold_left (fun a e -> if env.topo_order a < env.topo_order e then e else a ) a l in Node.Hashtbl.find env.subtrees n (** Add each assume to the sub-tree corresponding to the latest node it uses. The assumes are true if all their nodes are accessible *) let add_assumes_fact env = Bag.iter (fun p -> let nodes = P.nodes_list p in let nodes_are_accessible = (** TODO: don't add the condition of access of the node that are dominators of latest *) List.fold_left (fun acc n -> F.p_and (access env n) acc) F.p_true nodes in let f' = F.p_imply nodes_are_accessible (P.get p) in let t = get_latest_node env nodes in t.fact <- f' :: t.fact ) env.env.assumes (** convert the tree to formula *) let rec convert t f = let f' = if t.fact = [] then Conditions.empty else List.fold_left (fun acc e -> add_cond acc (Conditions.Have e)) Conditions.empty t.fact in let f' = Queue.fold (fun f' t -> convert t f') f' t.q in match F.is_ptrue t.c with | Qed.Logic.Yes -> Conditions.concat [f;f'] | Qed.Logic.No -> f | Qed.Logic.Maybe -> add_cond f (Conditions.Branch(t.c,f',Conditions.empty)) let to_sequence_tree _ posts env = let env,ordered = create_env_to_sequence_tree env in (** Iterate in topo order the vertex. Except for root, the tree of the vertex is the one of its immediate dominator forward. *) List.iter (iter env) ordered; let f = Conditions.empty in (** The posts state are accessible *) let f = Node.Set.fold (fun n f -> add_cond f (Conditions.Have (access env n))) posts f in (** For all either one of the condition is true *) let f = Node.Hashtbl.fold (fun _ h f -> let p = Node.Hashtbl.fold (fun _ t p -> F.p_or p t) h F.p_false in add_cond f (Conditions.Have p) ) env.eithers f in add_assumes_fact env; let f = convert env.root f in f, Node.Hashtbl.fold Node.Map.add env.full_conds Node.Map.empty end let compile : ?name:string -> ?mode:mode -> node -> Node.Set.t -> S.domain Node.Map.t -> cfg -> F.pred Node.Map.t * S.t Node.Map.t * Conditions.sequence = fun ?(name="cfg") ?(mode=`Bool_Forward) pre posts user_reads env -> if Wp_parameters.has_dkey dkey then Format.printf "@[0) pre:%a post:%a@]@." Node.pp pre (Pretty_utils.pp_iter ~sep:"@ " Node.Set.iter Node.pp) posts; if Wp_parameters.has_dkey dkey then Format.printf "@[1) %a@]@." pretty_env env; (** restrict environment to useful node and compute havoc effects *) let env = restrict env pre posts in if Wp_parameters.has_dkey dkey then Format.printf "@[2) %a@]@." pretty_env env; if Node.Map.is_empty env.succs then Node.Map.empty,Node.Map.empty, Conditions.sequence [Conditions.step (Conditions.Have(F.p_false))] else (** Simplify *) let subst,env = if true then remove_dumb_gotos env else Node.Map.empty, env in let pre = find_def ~def:pre pre subst in (** Substitute in user_reads *) let user_reads = Node.Map.fold (fun n n' acc -> match Node.Map.find n user_reads with | exception Not_found -> acc | domain -> let domain' = try S.union (Node.Map.find n' acc) domain with Not_found -> domain in Node.Map.add n' domain' acc) subst user_reads in (** For each node what must be read for assumes *) let reads = Bag.fold_left (fun acc e -> Node.Map.union (fun _ -> S.union) acc (P.reads e)) user_reads env.assumes in (** compute sigmas and relocate them *) let env, sigmas = domains env reads pre in if Wp_parameters.has_dkey dkey then Format.printf "@[3) %a@]@." pretty_env env; if Wp_parameters.has_dkey dumpkey then dump_env ~name env; let f, preds = match mode with | `Tree -> (** Add a unique post node *) let final_node = node () in let env = Node.Set.fold (fun p cfg -> let s = {pre=S.create();post=S.create()} in let e = s,Lang.F.p_true in let goto = effect p e final_node in concat goto cfg ) posts env in To_tree.to_sequence_tree pre posts env | (`Bool_Backward | `Bool_Forward) as mode -> to_sequence_bool ~mode pre posts env in let predssigmas = Node.Map.merge (fun _ p s -> Some (Extlib.opt_conv F.p_false p, Extlib.opt_conv (S.create ()) s)) preds sigmas in (** readd simplified nodes *) let predssigmas = Node.Map.fold (fun n n' acc -> Node.Map.add n (Node.Map.find n' predssigmas) acc ) subst predssigmas in let preds = Node.Map.map(fun _ (x,_) -> x) predssigmas in let sigmas = Node.Map.map(fun _ (_,x) -> x) predssigmas in preds,sigmas,f end ������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/CfgCompiler.mli�������������������������������������������������0000666�0000000�0000000�00000024106�13571573400�017011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Sigs open Cil_types open Lang (** {2 Control Flow Graphs} The semantics of a {i cfg} is a collection of execution traces. We introduce the notion of {i node} which represent a program point. In case of loop unrolling of function inlining, a node generalize the notion of [stmt] : two distinct nodes may refer to the same instruction at different memory states. We introduce an interpretation I as a partial mapping from nodes [n:node] to memory states [s:M.sigma], denoted I(n). The notation I(n) seen as a predicate indicates if `n` is in the partial mapping. Given a cfg, a node can be associated to {i assumptions} to filter interpretation against the memory state at this point. Effects and predicates are defined {i wrt} some fresh memory states, and can be duplicated at different nodes, each instance being mapped to different memory states. *) type mode = [ | `Tree | `Bool_Backward | `Bool_Forward ] module type Cfg = sig (** The memory model used. *) module S : Sigma (** Program point along a trace. *) module Node : sig type t module Map : Qed.Idxmap.S with type key = t module Set : Qed.Idxset.S with type elt = t module Hashtbl : Hashtbl.S with type key = t val pp: Format.formatter -> t -> unit val create: unit -> t val equal: t -> t -> bool end type node = Node.t (** fresh node *) val node : unit -> node (** {2 Relocatable Formulae} Can be created once with fresh environment, and used several times on different memory states. *) (** Relocatable condition *) module C : sig type t val equal : t -> t -> bool (** Bundle an equation with the sigma sequence that created it. *) val create : S.t -> F.pred -> t val get : t -> F.pred val reads : t -> S.domain val relocate : S.t -> t -> t end (** Relocatable predicate *) module P : sig type t val pretty : Format.formatter -> t -> unit (** Bundle an equation with the sigma sequence that created it. [| create m p |] = [| p |] *) val create : S.t Node.Map.t -> F.pred -> t val get: t -> F.pred val reads : t -> S.domain Node.Map.t val nodes : t -> Node.Set.t val relocate : S.t Node.Map.t -> t -> t (** [| relocate m' (create m p) |] = [| p{ } |] *) val to_condition: t -> (C.t * Node.t option) option end (** Relocatable term *) module T : sig type t val pretty : Format.formatter -> t -> unit (** Bundle a term with the sigma sequence that created it. *) val create : S.t Node.Map.t -> F.term -> t val get: t -> F.term val reads : t -> S.domain Node.Map.t val relocate : S.t Node.Map.t -> t -> t val init : Node.Set.t -> (S.t Node.Map.t -> F.term) -> t val init' : Node.t -> (S.t -> F.term) -> t end (** Relocatable effect (a predicate that depend on two states). *) module E : sig type t val pretty: Format.formatter -> t -> unit (** Bundle an equation with the sigma sequence that created it *) val create : S.t sequence -> F.pred -> t val get : t -> F.pred val reads : t -> S.domain val writes : t -> S.domain (** as defined by S.writes *) val relocate : S.t sequence -> t -> t end type cfg (** Structured collection of traces. *) val dump_env: name:string -> cfg -> unit val output_dot: out_channel -> ?checks:P.t Bag.t -> cfg -> unit val nop : cfg (** Structurally, [nop] is an empty execution trace. Hence, [nop] actually denotes all possible execution traces. This is the neutral element of [concat]. Formally: all interpretations I verify nop: [| nop |]_I *) val add_tmpnode: node -> cfg (** Set a node as temporary. Information about its path predicate or sigma can be discarded during compilation *) val concat : cfg -> cfg -> cfg (** The concatenation is the intersection of all possible collection of traces from each cfg. [concat] is associative, commutative, has [nop] as neutral element. Formally: [| concat g1 g2 |]_I iff [| g1 |]_I and [| g2 |]_I *) val meta : ?stmt:stmt -> ?descr:string -> node -> cfg (** Attach meta informations to a node. Formally, it is equivalent to [nop]. *) val goto : node -> node -> cfg (** Represents all execution traces [T] such that, if [T] contains node [a], [T] also contains node [b] and memory states at [a] and [b] are equal. Formally: [| goto a b |]_I iff (I(a) iff I(b)) *) val branch : node -> C.t -> node -> node -> cfg (** Structurally corresponds to an if-then-else control-flow. The predicate [P] shall reads only memory state at label [Here]. Formally: [| branch n P a b |]_I iff ( (I(n) iff (I(a) \/ I(b))) /\ (I(n) implies (if P(I(n)) then I(a) else I(b))) ) *) val guard : node -> C.t -> node -> cfg (** Structurally corresponds to an assume control-flow. The predicate [P] shall reads only memory state at label [Here]. Formally: [| guard n P a |]_I iff ( (I(n) iff I(a)) /\ (I(n) implies [| P |]_I ) ) *) val guard' : node -> C.t -> node -> cfg (** Same than guard but the condition is negated *) val either : node -> node list -> cfg (** Structurally corresponds to an arbitrary choice among the different possible executions. [either] is associative and commutative. [either a []] is very special, since it denotes a cfg with {i no} trace. Technically, it is equivalent to attaching an [assert \false] annotation to node [a]. Formally: [| either n [a_1;...;a_n] } |]_I iff ( I(n) iff (I(a_1) \/ ... I(a_n))) *) val implies : node -> (C.t * node) list -> cfg (** implies is the dual of either. Instead of being a non-deterministic choice, it takes the choices that verify its predicate. Formally: [| either n [P_1,a_1;...;P_n,a_n] } |]_I iff ( I(n) iff (I(a_1) \/ ... I(a_n)) /\ I(n) implies [| P_k |]_I implies I(a_k) *) val effect : node -> E.t -> node -> cfg (** Represents all execution trace [T] such that, if [T] contains node [a], then [T] also contains [b] with the given effect on corresponding memory states. Formally: [| effect a e b |]_I iff (( I(a) iff I(b) ) /\ [| e |]_I ) *) val assume : P.t -> cfg (** Represents execution traces [T] such that, if [T] contains every node points in the label-map, then the condition holds over the corresponding memory states. If the node-map is empty, the condition must hold over all possible execution path. Formally: [| assume P |]_I iff [| P |]_I *) val havoc : node -> effects:node sequence -> node -> cfg (** Inserts an assigns effect between nodes [a] and [b], correspondings to all the written memory chunks accessible in execution paths delimited by the [effects] sequence of nodes. Formally: [| havoc a s b |]_I is verified if there is no path between s.pre and s.path, otherwise if (I(a) iff I(b) and if I(a) is defined then I(a) and I(b) are equal for all the chunks that are not in the written domain of an effect that can be found between [s.pre] to [s.post]. Note: the effects are collected in the {i final} control-flow, when {!compile} is invoked. The portion of the sub-graph in the sequence shall be concatenated to the [cfg] before compiling-it, otherwize it would be considered empty and [havoc] would be a nop (no connection between a and b). *) (** {2 Path-Predicates} The compilation of cfg control-flow into path predicate is performed by allocating fresh environments with optimized variable allocation. Only the relevant path between the nodes is extracted. Other paths in the cfg are pruned out. *) (** Extract the nodes that are between the start node and the final nodes and returns how to observe a collection of states indexed by nodes. The returned maps gives, for each reachable node, a predicate representing paths that reach the node and the memory state at this node. Nodes absent from the map are unreachable. Whenever possible, predicate [F.ptrue] is returned for inconditionally accessible nodes. ~name: identifier used for debugging *) val compile : ?name:string -> ?mode:mode -> node -> Node.Set.t -> S.domain Node.Map.t -> cfg -> F.pred Node.Map.t * S.t Node.Map.t * Conditions.sequence end module Cfg(S:Sigma) : Cfg with module S = S ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cfloat.ml�������������������������������������������������������0000666�0000000�0000000�00000036030�13571573400�015655� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Floats Arithmetic Model --- *) (* -------------------------------------------------------------------------- *) open Ctypes open Qed open Lang open Lang.F (* -------------------------------------------------------------------------- *) (* --- Library --- *) (* -------------------------------------------------------------------------- *) let library = "cfloat" let f32 = datatype ~library "f32" let f64 = datatype ~library "f64" let t32 = Lang.(t_datatype f32 []) let t64 = Lang.(t_datatype f64 []) let ftau = function | Float32 -> t32 | Float64 -> t64 let ft_suffix = function Float32 -> "f32" | Float64 -> "f64" let pp_suffix fmt ft = Format.pp_print_string fmt (ft_suffix ft) let link phi = Lang.infoprover (Qed.Engine.F_call phi) (* Qed exact representations, linked to f32/f64 *) let fq32 = extern_f ~library ~result:t32 ~link:(link "to_f32") "q32" let fq64 = extern_f ~library ~result:t64 ~link:(link "to_f64") "q64" let f_model ft = extern_f ~library ~result:(ftau ft) "model_%a" pp_suffix ft let f_delta ft = extern_f ~library ~result:(ftau ft) "delta_%a" pp_suffix ft let f_epsilon ft = extern_f ~library ~result:(ftau ft) "epsilon_%a" pp_suffix ft (* -------------------------------------------------------------------------- *) (* --- Model Setting --- *) (* -------------------------------------------------------------------------- *) type model = Real | Float let model = Context.create ~default:Float "Cfloat.model" let tau_of_float f = match Context.get model with | Real -> Logic.Real | Float -> ftau f (* -------------------------------------------------------------------------- *) (* --- Operators --- *) (* -------------------------------------------------------------------------- *) type op = | LT | EQ | LE | NE | NEG | ADD | MUL | DIV | REAL | ROUND | EXACT [@@@ warning "-32"] let op_name = function | LT -> "flt" | EQ -> "feq" | LE -> "fle" | NE -> "fne" | NEG -> "fneg" | ADD -> "fadd" | MUL -> "fmul" | DIV -> "fdiv" | REAL -> "freal" | ROUND -> "fround" | EXACT -> "fexact" [@@@ warning "+32"] (* -------------------------------------------------------------------------- *) (* --- Registry --- *) (* -------------------------------------------------------------------------- *) module REGISTRY = WpContext.Static (struct type key = lfun type data = op * c_float let name = "Wp.Cfloat.REGISTRY" include Lang.Fun end) let find = REGISTRY.find let () = Context.register begin fun () -> REGISTRY.define fq32 (EXACT,Float32) ; REGISTRY.define fq64 (EXACT,Float64) ; end (* -------------------------------------------------------------------------- *) (* --- Literals --- *) (* -------------------------------------------------------------------------- *) let rfloat = Floating_point.round_to_single_precision_float let fmake ulp value = match ulp with | Float32 -> F.e_fun fq32 [F.e_float (rfloat value)] | Float64 -> F.e_fun fq64 [F.e_float value] let qmake ulp q = fmake ulp (Transitioning.Q.to_float q) let re_mantissa = "\\([-+]?[0-9]*\\)" let re_comma = "\\(.\\(\\(0*[1-9]\\)*\\)0*\\)?" let re_exponent = "\\([eE]\\([-+]?[0-9]*\\)\\)?" let re_suffix = "\\([flFL]\\)?" let re_real = Str.regexp (re_mantissa ^ re_comma ^ re_exponent ^ re_suffix ^ "$") let parse_literal ~model v r = try if Str.string_match re_real r 0 then let has_suffix = try ignore (Str.matched_group 7 r) ; true with Not_found -> false in if has_suffix && model = Float then Q.of_float v else let ma = Str.matched_group 1 r in let mb = try Str.matched_group 3 r with Not_found -> "" in let me = try Str.matched_group 6 r with Not_found -> "0" in let n = int_of_string me - String.length mb in let d n = let s = Bytes.make (succ n) '0' in Bytes.set s 0 '1' ; Q.of_string (Bytes.to_string s) in let m = Q.of_string (ma ^ mb) in if n < 0 then Q.div m (d (-n)) else if n > 0 then Q.mul m (d n) else m else Q.of_float v with Failure _ -> Warning.error "Unexpected constant literal %S" r let acsl_lit l = let open Cil_types in F.e_real (parse_literal ~model:(Context.get model) l.r_nearest l.r_literal) let code_lit ulp value original = match Context.get model , ulp , original with | Float , Float32 , _ -> F.e_fun fq32 [F.e_float value] | Float , Float64 , _ -> F.e_fun fq64 [F.e_float value] | Real , _ , None -> F.e_float value | Real , _ , Some r -> F.e_real (parse_literal ~model:Real value r) (* -------------------------------------------------------------------------- *) (* --- Literal Output --- *) (* -------------------------------------------------------------------------- *) let printers = [ Printf.sprintf "%.0g" ; Printf.sprintf "%.1g" ; Printf.sprintf "%.2g" ; Printf.sprintf "%.3g" ; Printf.sprintf "%.4g" ; Printf.sprintf "%.5g" ; Printf.sprintf "%.6g" ; Printf.sprintf "%.9g" ; Printf.sprintf "%.12g" ; Printf.sprintf "%.15g" ; Printf.sprintf "%.18g" ; Printf.sprintf "%.21g" ; Printf.sprintf "%.32g" ; Printf.sprintf "%.64g" ; ] let re_int = Str.regexp "[0-9]+" let force_float r = if Str.string_match re_int r 0 && Str.match_end () = String.length r then (r ^ ".0") else r let float_lit ulp (q : Q.t) = let v = match ulp with | Float32 -> rfloat @@ Transitioning.Q.to_float q | Float64 -> Transitioning.Q.to_float q in let reparse ulp r = match ulp with | Float32 -> rfloat @@ float_of_string r | Float64 -> float_of_string r in let rec lookup ulp v = function | [] -> Pretty_utils.to_string Floating_point.pretty v | pp::pps -> let r = force_float @@ pp v in if reparse ulp r = v then r else lookup ulp v pps in lookup ulp v printers (* -------------------------------------------------------------------------- *) (* --- Finites --- *) (* -------------------------------------------------------------------------- *) let fclass value _args = match Context.get model with | Real -> F.e_bool value | Float -> raise Not_found let () = Context.register begin fun () -> LogicBuiltins.hack "\\is_finite" (fclass true) ; LogicBuiltins.hack "\\is_NaN" (fclass false) ; LogicBuiltins.hack "\\is_infinite" (fclass false) ; LogicBuiltins.hack "\\is_plus_infinity" (fclass false) ; LogicBuiltins.hack "\\is_minus_infinity" (fclass false) ; end (* -------------------------------------------------------------------------- *) (* --- Computations --- *) (* -------------------------------------------------------------------------- *) let rec exact e = match F.repr e with | Qed.Logic.Kreal r -> r | Qed.Logic.Kint z -> Q.of_bigint z | Qed.Logic.Fun( f , [ q ] ) when f == fq32 || f == fq64 -> exact q | _ -> raise Not_found let round ulp e = match F.repr e with | Qed.Logic.Fun( f , [ b ] ) -> begin match find f with | REAL , ulp2 when ulp2 = ulp -> b | _ -> qmake ulp (exact e ) end | _ -> qmake ulp (exact e) let compute_float op ulp xs = match op , xs with | NEG , [ x ] -> qmake ulp (Q.neg (exact x)) | ADD , [ x ; y ] -> qmake ulp (Q.add (exact x) (exact y)) | MUL , [ x ; y ] -> qmake ulp (Q.mul (exact x) (exact y)) | DIV , [ x ; y ] -> qmake ulp (Q.div (exact x) (exact y)) | ROUND , [ x ] -> round ulp x | REAL , [ x ] -> F.e_real (exact x) | LE , [ x ; y ] -> F.e_bool (Q.leq (exact x) (exact y)) | LT , [ x ; y ] -> F.e_bool (Q.lt (exact x) (exact y)) | EQ , [ x ; y ] -> F.e_bool (Q.equal (exact x) (exact y)) | NE , [ x ; y ] -> F.e_bool (not (Q.equal (exact x) (exact y))) | _ -> raise Not_found let compute_real op xs = match op , xs with | NEG , [ x ] -> F.e_opp x | ADD , [ x ; y ] -> F.e_add x y | MUL , [ x ; y ] -> F.e_mul x y | DIV , [ x ; y ] -> F.e_div x y | (ROUND|REAL) , [ x ] -> x | LE , [ x ; y ] -> F.e_leq x y | LT , [ x ; y ] -> F.e_lt x y | EQ , [ x ; y ] -> F.e_eq x y | NE , [ x ; y ] -> F.e_neq x y | _ -> raise Not_found let compute op ulp xs = match Context.get model with | Real -> compute_real op xs | Float -> compute_float op ulp xs (* -------------------------------------------------------------------------- *) (* --- Operations --- *) (* -------------------------------------------------------------------------- *) let make_fun_float ?result name op ft = let result = match result with None -> ftau ft | Some r -> r in let phi = extern_f ~library ~result "%s_%a" name pp_suffix ft in Lang.F.set_builtin phi (compute op ft) ; REGISTRY.define phi (op,ft) ; phi let make_pred_float name op ft = let prop = Pretty_utils.sfprintf "%s_%a" name pp_suffix ft in let bool = Pretty_utils.sfprintf "%s_%ab" name pp_suffix ft in let phi = extern_p ~library ~bool ~prop () in Lang.F.set_builtin phi (compute op ft) ; REGISTRY.define phi (op,ft) ; phi let f_memo = Ctypes.f_memo let real_of_flt = f_memo (make_fun_float ~result:Logic.Real "of" REAL) let flt_of_real = f_memo (make_fun_float "to" ROUND) let flt_add = f_memo (make_fun_float "add" ADD) let flt_mul = f_memo (make_fun_float "mul" MUL) let flt_div = f_memo (make_fun_float "div" DIV) let flt_neg = f_memo (make_fun_float "neg" NEG) let flt_lt = f_memo (make_pred_float "lt" LT) let flt_eq = f_memo (make_pred_float "eq" EQ) let flt_le = f_memo (make_pred_float "le" LE) let flt_neq = f_memo (make_pred_float "ne" NE) (* -------------------------------------------------------------------------- *) (* --- Builtins --- *) (* -------------------------------------------------------------------------- *) let register_builtin_comparison suffix ft = begin let open Qed.Logic in let params = [Sdata;Sdata] in let sort = Sprop in let gt = generated_f ~params ~sort "\\gt_%s" suffix in let ge = generated_f ~params ~sort "\\ge_%s" suffix in let open LogicBuiltins in let signature = [F ft;F ft] in add_builtin ("\\eq_" ^ suffix) signature (flt_eq ft) ; add_builtin ("\\ne_" ^ suffix) signature (flt_neq ft) ; add_builtin ("\\lt_" ^ suffix) signature (flt_lt ft) ; add_builtin ("\\le_" ^ suffix) signature (flt_le ft) ; add_builtin ("\\gt_" ^ suffix) signature gt ; add_builtin ("\\ge_" ^ suffix) signature ge ; let converse phi x y = e_fun phi [y;x] in Lang.F.set_builtin_2 gt (converse (flt_lt ft)) ; Lang.F.set_builtin_2 ge (converse (flt_le ft)) ; end let () = Context.register begin fun () -> register_builtin_comparison "float" Float32 ; register_builtin_comparison "double" Float64 ; end (* -------------------------------------------------------------------------- *) (* --- Models --- *) (* -------------------------------------------------------------------------- *) let () = Context.register begin fun () -> let open LogicBuiltins in let register_builtin ft = add_builtin "\\model" [F ft] (f_model ft) ; add_builtin "\\delta" [F ft] (f_delta ft) ; add_builtin "\\epsilon" [F ft] (f_epsilon ft) ; in register_builtin Float32 ; register_builtin Float64 ; end (* -------------------------------------------------------------------------- *) (* --- Conversion Symbols --- *) (* -------------------------------------------------------------------------- *) let real_of_float f a = match Context.get model with | Real -> a | Float -> e_fun (real_of_flt f) [a] let float_of_real f a = match Context.get model with | Real -> a | Float -> e_fun (flt_of_real f) [a] let float_of_int f a = float_of_real f (Cmath.real_of_int a) (* -------------------------------------------------------------------------- *) (* --- Float Arithmetics --- *) (* -------------------------------------------------------------------------- *) let fbinop rop fop f x y = match Context.get model with | Real -> rop x y | Float -> e_fun (fop f) [x;y] let fcmp rop fop f x y = match Context.get model with | Real -> rop x y | Float -> p_call (fop f) [x;y] let fadd = fbinop e_add flt_add let fmul = fbinop e_mul flt_mul let fdiv = fbinop e_div flt_div let fopp f x = match Context.get model with | Real -> e_opp x | Float -> e_fun (flt_neg f) [x] let fsub f x y = fadd f x (fopp f y) let flt = fcmp p_lt flt_lt let fle = fcmp p_leq flt_le let feq = fcmp p_equal flt_eq let fneq = fcmp p_neq flt_neq (* -------------------------------------------------------------------------- *) (* --- Registry --- *) (* -------------------------------------------------------------------------- *) let configure m = begin Context.set model m ; Context.set Lang.floats tau_of_float ; end (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cfloat.mli������������������������������������������������������0000666�0000000�0000000�00000006144�13571573400�016031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Floating Arithmetic Model *) (* -------------------------------------------------------------------------- *) open Ctypes open Lang open Lang.F val f32 : adt val f64 : adt val t32 : tau val t64 : tau type model = Real | Float val configure : model -> unit val ftau : c_float -> tau (** model independant *) val tau_of_float : c_float -> tau (** with respect to model *) type op = | LT | EQ | LE | NE | NEG | ADD | MUL | DIV | REAL | ROUND | EXACT (** same as round, but argument is exact representation *) val find : lfun -> op * c_float val code_lit : c_float -> float -> string option -> term val acsl_lit : Cil_types.logic_real -> term val float_lit : c_float -> Q.t -> string (** Returns a string literal in decimal notation (without suffix) that reparses to the same value (when added suffix). *) val float_of_int : c_float -> unop val float_of_real : c_float -> unop val real_of_float : c_float -> unop val fopp : c_float -> unop val fadd : c_float -> binop val fsub : c_float -> binop val fmul : c_float -> binop val fdiv : c_float -> binop val flt : c_float -> cmp val fle : c_float -> cmp val feq : c_float -> cmp val fneq : c_float -> cmp val f_model : c_float -> lfun val f_delta : c_float -> lfun val f_epsilon : c_float -> lfun val flt_of_real : c_float -> lfun val real_of_flt : c_float -> lfun val flt_add : c_float -> lfun val flt_mul : c_float -> lfun val flt_div : c_float -> lfun val flt_neg : c_float -> lfun ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Changelog�������������������������������������������������������0000666�0000000�0000000�00000061126�13571573400�015731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������############################################################################### # Preliminary notes: # # ------------------ # # Mark "-": change with an impact for users (and possibly developers). # # Mark "o": change with an impact for developers only. # # Mark "+": change for Frama-C-commits audience (not in html version) # # Mark "*": bug fixed. # # Mark "!": change that can break compatibility with existing development. # # '#nnn' : BTS entry #nnn # # '#!nnn' : BTS private entry #nnn # # For compatibility with old change log formats: # # '#?nnn' : OLD-BTS entry #nnn # ############################################################################### # Categories: # Cmd: command line interface # Gui: graphical user interface # Makefile: Makefile # WP: proof obligation calculus # <Model>: memory model # <Prover>: prover ############################################################################### ########################## Plugin WP 20.0 (Calcium) ########################## - TIP [2019/09/17] Using all selected Why-3 provers for proof search - Gui [2019/09/17] Updated panel for provers, models, cache, etc. - WP [2019/09/12] New cache mechanism for why3 provers, see -wp-cache option -! WP [2019/09/17] Deprecated native alt-ergo & coq output, see -wp-prover option - WP [2019/09/16] Deprecated & Renamed -wp-script into -wp-coq-script - WP [2019/09/16] Deprecated & Renamed -wp-update-script into -wp-update-coq-script - WP [2019/09/16] Deprecated & Renamed -wp-tactic into -wp-coq-tactic - WP [2019/09/16] Deprecated & Renamed -wp-tryhints into -wp-coq-tryhints - WP [2019/09/16] Deprecated & Renamed -wp-hints into -wp-coq-hints - WP [2019/09/16] Renamed -wp-why-opt into -wp-why3-opt - WP [2019/09/16] Renamed -wp-init-alias into -wp-alias-init - WP [2019/09/16] Removed -wp-include - WP [2019/09/16] Removed -wp-why3 - WP [2019/09/16] Removed -wp-why-lib - WP [2019/09/16] Removed -wp-depth - WP [2019/09/16] Default -wp-extensional changed to true - WP [2019/09/16] Default -wp-init-const changed to true -! WP [2019/07/05] Default -wp-prover <p> changed to <why3:p> (including default alt-ergo) -! WP [2019/07/05] Use native Why3 API (now requires why3 at compile time) - WP [2019/06/27] Improving Cint simplifier and quantifier introduction o Qed [2019/06/27] More secure API for quantifier management - Qed [2019/05/09] Transform (some) boolean quantifications into variable assignments ########################## Plugin WP 19.0 (Potassium) ########################## - Wp [2019/05/09] Fixes -wp-simplify-is-cint simplifier - Wp [2019/04/26] Now requires -warn-invalid-bool - Wp [2019/04/26] Removed option -wp-bool-range - Wp [2019/04/24] Support for Why3 1.* and Coq 8.{7-9} - Wp [2019/02/26] Support for @check ACSL annotations - WP [2018/02/16] Filter out some variables from separation - TIP [2018/02/15] Extend bitwise-eq auto-strategy on hypotheses - TIP [2018/02/15] Fix wrong reconciliation of sub-scripts during replay - Wp [2018/02/15] Better naming convention, consistent with report-classify - WP [2019/02/05] Auto filter properties with name "no_wp:" - Wp [2019/01/28] Now -wp-dynamic is set by default (annotation @calls) - Wp [2019/01/28] New floating-point model - Wp [2018/01/18] Auto-Search mode, see -wp-auto - TIP [2018/01/18] Auto-Search mode from the GUI - TIP [2018/01/18] New Strategies for bitwise and congruence operations - TIP [2017/12/17] Fix bug that makes the TIP wrongly reuse previous results - Wp [2017/12/17] Option -wp-print-separation changed into -wp-warn-separation - Wp [2017/12/17] Option -wp-unfold-assigns for proving assigns of aggregates field by field - TIP [2017/04/25] New tactical Congruence (divisions and products) - Qed [2017/10/30] Extends simplifications for lsl,lsr and div - Wp [2017/10/27] Fix soundness bug when assigning non-valid ranges - Qed [2017/10/27] New simplifications for validity and ranges - TIP [2017/10/27] New tacticals for validity and ranges ###################### Plugin WP 18.0 (Argon) ###################### - Wp [2018/10/25] Added support for ACSL \offset construct - Wp [2018/09/04] Option -wp-warn-separation changed into -wp-warn-memory-model Adding memory model hypotheses related to pointer validity - Wp [2018/06/28] Use functional havoc instead of a predicate in Typed model - Qed [2018/06/28] Added builtin simplification on array operations - Wp [2018/06/20] Added more simplifications on list operations - Qed [2018/06/20] Added more simplifications for invertible functions - TIP [2018/06/07] Extends tactical 'Split' to distribution of qualitifiers ######################### Plugin WP Sulfur-20171101 ######################### - Wp [2017/10/18] Support for LoopCurrent and LoopEntry - TIP [2017/04/25] Options -wp-time-{extra|margin} for more stability -* Gui [2017/04/25] Fixed bug when running prover from the TIP - Wp [2017/04/25] Improved model and simplifications of logical shifts - Wp [2017/04/25] New simplification logic functions (-wp-reduce) - Wp [2017/04/25] New simplification of unused variables (-wp-parasite) - Wp [2017/04/25] New simplification for ground terms (-wp-ground) - Wp [2017/04/25] Option -wp-prenex to normalize nested binders - Wp [2017/04/25] Option -wp-overflows to add explicit assumptions - TIP [2017/04/25] New tactical Overflow (to cope with modulus) - TIP [2017/04/25] New tactical Ratio (divisions and products) - TIP [2017/04/25] New tactical Bitwised, BitRange and Shift - TIP [2017/04/25] New tactical Rewrite (two apply equalities) - Wp [2017/03/12] Reduction of equalities with logic functions - Wp [2017/03/12] More simplifications wrt integer domains ########################### Plugin WP Chlorine-20180501 ########################### - WP [2018/03/08] Add the missing ACSL math builtins (see manual) - WP [2018/02/12] Experimental support for _Bool range (-wp-bool-range) - WP [2018/03/12] Better handling of \null and (void *)0L - WP [2018/02/16] Allow backtracking when using strategies (-wp-auto-backtrack) - WP [2018/02/16] Filter out some variables from separation - TIP [2018/02/15] Extend bitwise-eq auto-strategy on hypotheses - TIP [2018/02/15] Fix wrong reconciliation of sub-scripts during replay - WP [2018/01/15] Upgrade to Alt-Ergo 2.0.0 - WP [2018/01/15] Upgrade to Coq 8.7.1 - WP [2018/01/15] Upgrade to Why-3 0.88.3 - Qed [2017/12/13] Transforms some quantifications into let constructs - WP [2018/01/18] Auto-Search mode, see -wp-auto - TIP [2018/01/18] Auto-Search mode from the GUI - TIP [2018/01/18] New Strategies for bitwise and congruence operations - TIP [2017/12/17] Fix bug that makes the TIP wrongly reuse previous results - WP [2017/12/17] Option -wp-print-separation changed into -wp-warn-separation - WP [2017/12/17] Option -wp-unfold-assigns for proving assigns of aggregates field by field - TIP [2017/04/25] New tactical Congruence (divisions and products) - Qed [2017/10/30] Extends simplifications for lsl,lsr and div - WP [2017/10/27] Fix soundness bug when assigning non-valid ranges - Qed [2017/10/27] New simplifications for validirt and ranges - TIP [2017/10/27] New tacticals for validity and ranges ######################### Plugin WP Sulfur-20171101 ######################### - WP [2017/10/18] Support for LoopCurrent and LoopEntry - TIP [2017/04/25] Options -wp-time-{extra|margin} for more stability -* Gui [2017/04/25] Fixed bug when running prover from the TIP - WP [2017/04/25] Improved model and simplifications of logical shifts - WP [2017/04/25] New simplification logic functions (-wp-reduce) - WP [2017/04/25] New simplification of unused variables (-wp-parasite) - WP [2017/04/25] New simplification for ground terms (-wp-ground) - WP [2017/04/25] Option -wp-prenex to normalize nested binders - WP [2017/04/25] Option -wp-overflows to add explicit assumptions - TIP [2017/04/25] New tactical Overflow (to cope with modulus) - TIP [2017/04/25] New tactical Ratio (divisions and products) - TIP [2017/04/25] New tactical Bitwised, BitRange and Shift - TIP [2017/04/25] New tactical Rewrite (two apply equalities) - WP [2017/03/12] Reduction of equalities with logic functions - WP [2017/03/12] More simplifications wrt integer domains ############################# Plugin WP Phosphorus-20170501 ############################# - Qed [2017/12/13] Transforms some quantifications into let constructs - WP [2017/05/15] Extract inductive predicates as Inductive in Coq -! WP [2017/03/24] Remove support for generalized invariants (-wp-invariants) -o Ergo [2017/01/12] Update qualif tests to Alt-Ergo 1.30 - Qed [2016/12/09] Add E_fun constructor for neutral and absorbent - WP [2016/12/07] Trivial simplification for truncate - WP [2016/12/07] Fix bug on negative 0x float constants - WP [2016/11/04] Improved comparison of logic compounds - WP [2016/11/04] Improved filtering (prevents loss of init clauses) - WP [2016/10/26] Generated HTML API (make wp-doc-api) - WP [2016/10/26] Extensible Proof Engine -! WP [2016/10/11] Deprecated Dynamic API - WP [2016/09/20] Improved sequent simplifier - Qed [2016/09/02] Negation of forall/exists qualitifers - GUI [2016/08/26] Pretty-print of memory side effects - WP [2016/08/23] Fixed bug #2246 (unsound switch) - Gui [2016/07/23] Interactive Proof Engine - WP [2016/07/21] Improved Sequent API (Conditions) - WP [2016/05/26] Simplification of ACSL sequences - Qed [2016/05/17] Mutualized type inference in Term - Qed [2016/04/12] Improved simplifiers - WP [2016/11/17] Warn against access to volatile l-values - WP [2016/11/17] Fix volatile access (see -wp-no-volatile) ########################## Plugin WP Silicon-20161101 ########################## - WP [2016/04/08] Unified variable usage for all models - WP [2016/10/06] Simplification of arithmetics models - WP [2016/10/06] Use kernel options -warn-xxx in cint model - WP [2016/10/06] Use cint and cfloat models by default - WP [2016/10/06] Fix -wp-rte with respect to models and kernel options ################################ Plugin WP 1.0 Aluminium_20160502 ################################ - Coq [2016/03/30] Fixed bug #2214 (coq realbase) - WP [2016/03/29] Support for why3 0.87 (and ide) - WP [2016/03/25] Support for Why3 0.86 - WP [2016/03/25] Support for Coq 8.5 - WP [2016/02/24] Support for Alt-Ergo 1.01 - WP [2016/02/18] Fix behavior on ASM code - WP [2016/02/15] Now follows '-safe-arrays' when refining 'p+(..)' - WP [2016/02/02] Added support for ACSL let-predicate -! WP [2016/01/15] Removed alias '-wp-log' (use '-wp-msg-key' instead) - WP [2015/12/16] Strict parsing of -wp-model (stop on error) - Caveat [2015/12/02] Separation Hypotheses with -wp-print-separation - WP [2015/11/13] Exported OCaml API via Wp.mli - WP [2015/11/24] Added support for built-in ACSL lists - WP [2015/11/19] New options to set prover commands - Coq [2015/11/19] Support for Proof General 4.3 ################################ Plugin WP 0.9 Magnesium_20151002 ################################ - WP [2015/09/02] Added support for float-classification. (\is_NaN, \is_finite, \is_infinite, \is_plus_infinity, \is_minus_infinity). -* WP [2015/09/02] Fixed bug #2082 (crash with \is_infinite). -* WP [2015/08/19] Fixed bug #2040 (wrong label Here in assumes). -* WP [2015/08/18] Fixed bug #2110 (wrong premisses for structs assigns). -* WP [2015/08/18] Fixed bug #2141 (incorrect simplification of 'x%1'). -* WP [2015/08/18] Fixed bug #2144 (lost \result after explicit assignment). -* WP [2015/06/29] Fixed bug #2078 (ill typed PO with void*). -* WP [2015/06/29] Fixed bug #2127 (unsigned inequality). -* WP [2015/06/29] Fixed bug #2126 (0-shift rewriting). -* WP [2015/05/20] Fixed bug #1683 (multiply reported Qed proofs). -* WP [2015/03/20] Fixed bug #2079 (incorrect pointer arithmetics). - WP [2015/02/28] Handle global constants (-wp-init-const). - WP [2015/02/28] Quiet output on TTY (see -tty kernel option). - WP [2015/02/28] Added solver mean time to console output. -* Hoare [2015/02/28] Fixed incorrect partial assignments in compound objects. - WP [2015/02/28] Refactoring of compound objects modeling. - Qed [2015/02/28] Fold constant expressions in goals. - Qed [2015/02/28] More simplifications on strict inequalities. - Qed [2015/02/28] More aggressive filtering and pruning (-wp-filter). - Qed [2015/02/28] Aggressive ite-lifting. - Qed [2015/02/28] Automatic introduction of existentials. -! Coq [2015/02/28] Inductive if-then-else construct. - WP [2015/02/28] -wp-simplify-type remove some most type constraints (sound, incomplete). - WP [2015/02/28] -wp-simplify-forall of quantifier guards (unsound). - Qed [2015/02/28] Factorization of core equalities (-wp-core). - WP [2015/02/28] Improved -wp-check mode. -* WP [2015/02/28] Fixed bool-prop conversions. - WP [2015/02/28] Summarize initializers (-wp-init-summarize-array). - WP [2015/02/28] Simplifications of 'is_cint' with quantifiers. - Caveat [2015/02/28] New 'Caveat' memory model. - Typed [2015/02/28] Named shift operators (better triggers). - WP [2015/02/28] New integer model '+rg'. -* WP [2015/02/28] Fixed bug #1683 (duplicate Qed results). -* WP [2015/02/28] Improved typing for alt-ergo let-bindings. -* WP [2015/02/28] Fix sharing bug in proof obligation output. - Report [2015/02/28] Support for CVC4 reporting. -* WP [2015/02/28] Fix bugs with -wp-extern-arrays. - WP [2015/02/28] More lemmas for bitwise operations. - WP [2015/02/28] Options -wp-*-vars to tune memory model detection. -* WP [2015/02/18] Fixed bug #1785 (fixed pre-condition with Clang). - WP [2015/01/27] Support for \subset. - WP [2014/09/24] Now accept patterns in drivers. -* WP [2014/09/15] Fixed bug #1828 (separation of locals/formals/heap). ############################# Plugin WP 0.8 Sodium_20150201 ############################# - WP [2014/09/05] Drivers for min/max. - Typed [2014/09/04] Simplification of assigns and separated. -* Gui [2014/09/04] Fixed bug #1688 (recover results from cmdline). -! WP [2014/07/09] Next to the new way the kernel handles command line options, -wp-include +dir has to be replaced by -wp-include ++dir. Forward and backward compatibilities are broken. - WP [2014/06/11] Some improvements on bitwise operators. - Cmd [2014/05/22] Added option -wp-filename-truncation to truncate proof obligation filenames. ########################### Plugin WP 0.8 Neon_20140301 ########################### - Gui [2014/01/30] Edition of current proof script (right-click). - Gui [2014/01/30] Consistent icons with status. - Driver [2014/01/30] Refactoring of prover external libraries. (consult driver section in manual). -* WP [2014/01/16] Important bug-fix in CFG (missing hyps in goals). -* WP [2013/12/11] Major speed-up for huge functions. - WP [2014/01/30] Many improvements on reals and floats. - WP [2014/01/30] Many improvements on bitwise operators. - WP [2014/01/30] Better integration with Why-3 and Coq. - WP [2013/12/09] Clever assigns everything with formals and locals. - WP [2013/11/26] More type constraints in typed memory model. ############################### Plugin WP 0.7 Fluorine_20130501 ############################### -* Typed [2013/05/23] Better trigger generation for arrays with Alt-Ergo. -* Provers [2013/05/23] Fixed various bugs with drivers and provers. -* WP [2013/05/23] Fixed various bugs on floats. -* Typed [2013/05/23] Fixed bug on address differences and offsets. ############################### Plugin WP 0.7 Fluorine_20130401 ############################### -* Makefile [2013/04/17] Fixed bug #1385 about ocamllex.opt. -! Cmd [2013/04/15] Removed now useless options -wp-huge, -wp-dot, -wp-trace. - Cmd [2013/04/15] Added option -wp-skip-fct to exclude functions. - Cmd [2013/04/15] Using -wp-prover instead of -wp-proof (kept for compatibility). - Gui [2013/04/15] New Why3 provers selection, added -wp-detect to force detection. - WP [2013/02/29] Added support for string literals (-wp-literals). - WP [2013/02/01] New simplification engine (specific options). - WP [2013/02/01] New interface to model selection (unique -wp-model option). - WP [2013/02/01] Experimental float and machine-integer models. - WP [2013/02/01] 'Store' and 'Runtime' models abandoned. - WP [2013/01/09] 'Typed' becomes the default model. - Why3 [2012/12/18] Why3 output (-wp-proof why3:xxx). - Typed [2012/10/23] Extensions of Typed model (unsafe-casts). - WP [2012/10/09] Drivers for linking ACSL symbols to external libs (-wp-driver). ############################# Plugin WP 0.6 Oxygen_20120901 ############################# - WP [2012/09/14] Experimental simplifier with new 'Typed' model (see manual). o! WP [2012/09/05] Enhanced Ocaml API (see manual). Old bindings are preserved, but now emit a deprecated warning. -* WP [2012/07/31] Fixed issue about -ulevel option (bug #1244). - WP [2012/06/30] Truncating too long log filenames. - WP [2012/06/20] Enhanced statistics for -wp-report (see manual). -* Coq [2012/05/22] Better translation in Coq for floats and reals (fixed bugs #1174 and #1176). - Gui [2012/05/15] Graphical version of Alt-Ergo (altgr-ergo) can be launched from the 'Proof Obligation Panel'. - Cmd [2012/03/15] Extended selection language: -wp-prop [+|-][@]id to add or remove property category or name. - WP [2012/03/06] Better elimination of let constructs for -wp-norm Eqs option. - WP [2012/02/08] Limited support for triggers in axioms and lemmas. - Cmd [2012/02/03] Extended support for external libraries: Options -wp-coq-lib, -wp-why-lib and now -wp-alt-ergo-lib. ############################### Plugin WP 0.5 Nitrogen_20111001 ############################### +* Store [2012/01/03] Adding guard for 'fresh' axiomatization in Store. + WP [2011/12/23] Timing. - Gui [2011/12/19] Changes into Gui panel. - Cmd [2011/12/16] Adding support for reporting with option: -wp-report. +* WP [2011/11/25] Fixed bug #!1020 on arbitrary invariants. - Cmd [2011/11/22] Adding support for external proof libraries. See options -wp-include, -wp-tactic, -wp-coq-lib and -wp-why-lib. - Cmd [2011/11/21] Adding support for multi-provers in command line. ############################### Plugin WP 0.4 Nitrogen_20111001 ############################### - WP [2011/10/24] Further improvement for proof of assigns clauses. - WP [2011/10/14] A warning is now emitted for missing assigns clauses. +* WP [2011/09/30] Fixed bug #!572 for logic declaration without 'reads' clause. +* WP [2011/09/22] Fixed bug #!970 for labels that may escape the control flow. +* WP [2011/09/07] Fixed bug #!943 on translation of reals and floats - Cmd [2011/08/25] Optimization of arguments passing by reference with option: -wp-byreference. - WP [2011/09/15] Improvements of conversion between C-integers and Z-integers. - WP [2011/07/22] Optimization of arguments passing by reference. - WP [2011/07/22] Print of formula change. - Gui [2011/06/29] Feedback for proof of preconditions at call sites. - Gui [2011/06/29] New menu options to prove preconditions at one or all call sites. - Cmd [2011/06/17] Added option -wp-proof-trace to obtain more informations from provers when available (option 'Trace' in GUI). -! Ergo [2011/06/17] Alt-Ergo is always used with builtin arrays. Removed option -wp-arrays. - Vampire [2011/06/10] Support for Vampire as back-end prover. -* WP [2011/06/10] In some cases, a proof attempt could silently failed. It is now properly reported. - Gui [2011/06/07] Default output directory is set to <home>/.frama-c-wp in Gui. - Gui [2011/06/07] Enhancement of Proof-Obligation panel. -! WP [2011/05/20] Translation of axioms with labels (removed option -wp-axioms). + Caveat [2011/05/19] Suppression of legacy Caveat model. - Hoare [2011/05/19] New Hoare model (now implemented on top of logic variables). - WP [2011/05/19] Handling partial initializers in C global variables. - Cmd [2011/05/17] New engine to compute proof obligations for arbitrary invariants. See option -wp-invariants. -! Ergo [2011/05/17] Alt-Ergo 0.93 now required. -! Gui [2011/05/17] Removed 'Refresh' button from WP panel. +* Gui [2011/05/17] Fixed bug #!706 : property status not refreshed. +* Gui [2011/05/17] Fixed bug #!707 : unexpected run of wp provers after -then. +* WP [2011/05/02] Fixed bug #!708 (missing definitions in environments). - WP [2011/04/29] Alt-Ergo is now selected (and run) by default. -* WP [2011/04/29] Fixed problems with -wp-out <dir>. - WP [2011/04/21] Better representation of records and unions in logic. - WP [2011/04/21] No more logic generic pointers. Pointer arithmetics moved to memory models. -* Store [2011/04/21] Better representation of pointers (issue #796). -* Gui [2011/04/15] Fixed bug on PO status (wrong PO identification). -* Gui [2011/04/13] Fixed bug #711 (cyclic dependencies). ############################# Plugin WP 0.3 Carbon_20110201 ############################# -* Coq [2011/04/08] Fixed bug #740 for Coq on Windows. WP now uses directly coqtop -compile instead of coqc. - Runtime [2011/04/01] Optimization of effect-assigns. -* Store [2011/03/30] Fixed bug #766 about offsets in assigns. - Cmd [2011/03/23] Adding version in -wp-help. +* WP [2011/03/10] Proof of requires of the main entry point (bug #675). - Cmd [2011/01/31] Option -wp-warnings to display additional informations for 'Stronger' and 'Degenerated' goals. - WP [2011/01/24] New spliting algorithm. See option -wp-split. Option -wp-split-dim <n> to limit spliting up to 2**n sub-goals. - WP [2011/01/24] When -rte-precond is not used, wp generates a separate proof obligation for each call site. - Cmd [2011/01/20] Options -wp-status-xxx to refine goal selection - Cmd [2011/01/19] Clarification of -save/-then effect on WP -* Gui [2011/01/10] Fixed incorrect property status refresh in the GUI. -* Coq [2011/01/04] Fixed bug #702 on Coq output with large integers. -* WP [2011/03/10] Proof of requires of the main entry point (bug #675). ############################# Plugin WP 0.2 Carbon_20101202 ############################# -* Coq [2010/12/16] Fixed bug #639: no more compilation to shared directory. - Gui [2010/12/16] Accessibility of all provers from gui. ############################# Plugin WP 0.1 Carbon_20101201 ############################# - WP [2010/12/06] New WP plugin. ############################# ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cint.ml���������������������������������������������������������0000666�0000000�0000000�00000133352�13571573400�015347� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Integer Arithmetics Model --- *) (* -------------------------------------------------------------------------- *) open Qed open Qed.Logic open Lang open Lang.F module FunMap = FCMap.Make(Lang.Fun) (* -------------------------------------------------------------------------- *) (* --- Kernel Interface --- *) (* -------------------------------------------------------------------------- *) let is_overflow_an_error iota = if Ctypes.signed iota then Kernel.SignedOverflow.get () else Kernel.UnsignedOverflow.get () let is_downcast_an_error iota = if Ctypes.signed iota then Kernel.SignedDowncast.get () else Kernel.UnsignedDowncast.get () (* -------------------------------------------------------------------------- *) (* --- Library Cint --- *) (* -------------------------------------------------------------------------- *) let is_cint_map = ref FunMap.empty let to_cint_map = ref FunMap.empty let is_cint f = FunMap.find f !is_cint_map let to_cint f = FunMap.find f !to_cint_map let library = "cint" let make_fun_int op i = Lang.extern_f ~library ~result:Logic.Int "%s_%a" op Ctypes.pp_int i let make_pred_int op i = Lang.extern_f ~library ~result:Logic.Prop "%s_%a" op Ctypes.pp_int i (* let fun_int op = Ctypes.imemo (make_fun_int op) *) (* unused for now *) (* let pred_int op = Ctypes.imemo (make_pred_int op) *) (* unused for now *) (* Signature int,int -> int over Z *) let ac = { associative = true ; commutative = true ; idempotent = false ; invertible = false ; neutral = E_none ; absorbant = E_none ; } (* Functions -> Z *) let result = Logic.Int (* -------------------------------------------------------------------------- *) (* --- Library Cbits --- *) (* -------------------------------------------------------------------------- *) let library = "cbits" let balance = Lang.Left let op_lxor = { ac with neutral = E_int 0 ; invertible = true } let op_lor = { ac with neutral = E_int 0 ; absorbant = E_int (-1); idempotent = true } let op_land = { ac with neutral = E_int (-1); absorbant = E_int 0 ; idempotent = true } let f_lnot = Lang.extern_f ~library ~result "lnot" let f_lor = Lang.extern_f ~library ~result ~category:(Operator op_lor) ~balance "lor" let f_land = Lang.extern_f ~library ~result ~category:(Operator op_land) ~balance "land" let f_lxor = Lang.extern_f ~library ~result ~category:(Operator op_lxor) ~balance "lxor" let f_lsl = Lang.extern_f ~library ~result "lsl" let f_lsr = Lang.extern_f ~library ~result "lsr" let f_bitwised = [ f_lnot ; f_lor ; f_land ; f_lxor ; f_lsl ; f_lsr ] (* [f_bit_stdlib] is related to the function [bit_test] of Frama-C StdLib *) let f_bit_stdlib = Lang.extern_p ~library ~bool:"bit_testb" ~prop:"bit_test" () (* [f_bit_positive] is actually exported in forgoting the fact the position is positive *) let f_bit_positive = Lang.extern_p ~library ~bool:"bit_testb" ~prop:"bit_test" () (* At export, some constructs such as [e & (1 << k)] are written into [f_bit_export] construct *) let f_bit_export = Lang.extern_p ~library ~bool:"bit_testb" ~prop:"bit_test" () let () = let open LogicBuiltins in add_builtin "\\bit_test_stdlib" [Z;Z] f_bit_stdlib let () = let open LogicBuiltins in add_builtin "\\bit_test" [Z;Z] f_bit_positive (* -------------------------------------------------------------------------- *) (* --- Matching utilities for simplifications --- *) (* -------------------------------------------------------------------------- *) let is_leq a b = F.is_true (F.e_leq a b) let match_integer t = match F.repr t with | Logic.Kint c -> c | _ -> raise Not_found (* integration with qed should be improved! *) let rec is_positive_or_null e = match F.repr e with | Logic.Fun( f , [e] ) when Fun.equal f f_lnot -> is_negative e | Logic.Fun( f , es ) when Fun.equal f f_land -> List.exists is_positive_or_null es | Logic.Fun( f , es ) when Fun.equal f f_lor -> List.for_all is_positive_or_null es | Logic.Fun( f , es ) when Fun.equal f f_lxor -> (match xor_sign es with | Some b -> b | _ -> false) | Logic.Fun( f , es ) when Fun.equal f f_lsr || Fun.equal f f_lsl -> List.for_all is_positive_or_null es | _ -> (* try some improvement first then ask to qed *) let improved_is_positive_or_null e = match F.repr e with | Logic.Add es -> List.for_all is_positive_or_null es | _ -> false in if improved_is_positive_or_null e then true else match F.is_true (F.e_leq e_zero e) with | Logic.Yes -> true | Logic.No | Logic.Maybe -> false and is_negative e = match F.repr e with | Logic.Fun( f , [e] ) when Fun.equal f f_lnot -> is_positive_or_null e | Logic.Fun( f , es ) when Fun.equal f f_lor -> List.exists is_negative es | Logic.Fun( f , es ) when Fun.equal f f_land -> List.for_all is_negative es | Logic.Fun( f , es ) when Fun.equal f f_lxor -> (match xor_sign es with | Some b -> (not b) | _ -> false) | Logic.Fun( f , [k;n] ) when Fun.equal f f_lsr || Fun.equal f f_lsl -> is_positive_or_null n && is_negative k | _ -> (* try some improvement first then ask to qed *) let improved_is_negative e = match F.repr e with | Logic.Add es -> List.for_all is_negative es | _ -> false in if improved_is_negative e then true else match F.is_true (F.e_lt e e_zero) with | Logic.Yes -> true | Logic.No | Logic.Maybe -> false and xor_sign es = try Some (List.fold_left (fun acc e -> if is_positive_or_null e then acc (* as previous *) else if is_negative e then (not acc) (* opposite sign *) else raise Not_found) true es) with Not_found -> None let match_positive_or_null e = if not (is_positive_or_null e) then raise Not_found; e let match_power2, _match_power2_minus1 = let highest_bit_number = let hsb p = if p land 2 = 0 then 0 else 1 in let hsb p = let n = p lsr 2 in if n = 0 then hsb p else 2 + hsb n in let hsb p = let n = p lsr 4 in if n = 0 then hsb p else 4 + hsb n in let hsb = Array.init 256 hsb in let hsb p = let n = p lsr 8 in if n = 0 then hsb.(p) else 8 + hsb.(n) in let hsb p = let n = Integer.shift_right p Integer.sixteen in Integer.of_int (if Integer.is_zero n then hsb (Integer.to_int p) else 16 + hsb (Integer.to_int n)) in let rec hsb_aux p = let n = Integer.shift_right p Integer.thirtytwo in if Integer.is_zero n then hsb p else Integer.add Integer.thirtytwo (hsb_aux n) in hsb_aux in let is_power2 k = (* exists n such that k == 2**n? *) (Integer.gt k Integer.zero) && (Integer.equal k (Integer.logand k (Integer.neg k))) in let rec match_power2 e = match F.repr e with | Logic.Kint z when is_power2 z -> e_zint (highest_bit_number z) | Logic.Fun( f , [n;k] ) when Fun.equal f f_lsl && is_positive_or_null k -> e_add k (match_power2 n) | _ -> raise Not_found in let match_power2_minus1 e = match F.repr e with | Logic.Kint z when is_power2 (Integer.succ z) -> e_zint (highest_bit_number (Integer.succ z)) | _ -> raise Not_found in match_power2, match_power2_minus1 let match_fun op t = match F.repr t with | Logic.Fun( f , es ) when Fun.equal f op -> es | _ -> raise Not_found let match_ufun uop t = match F.repr t with | Logic.Fun( f , e::[] ) when Fun.equal f uop -> e | _ -> raise Not_found let match_positive_or_null_integer t = match F.repr t with | Logic.Kint c when Integer.le Integer.zero c -> c | _ -> raise Not_found let match_binop_arg1 match_f = function (* for binop *) | [e1;e2] -> (match_f e1),e2 | _ -> raise Not_found let match_binop_arg2 match_f = function (* for binop *) | [e1;e2] -> e1,(match_f e2) | _ -> raise Not_found let match_list_head match_f = function | [] -> raise Not_found | e::es -> (match_f e), es let match_binop_one_arg1 binop e = match F.repr e with | Logic.Fun( f , [one; e2] ) when Fun.equal f binop && one == e_one -> e2 | _ -> raise Not_found let match_list_extraction match_f = let match_f_opt n = try Some (match_f n) with Not_found -> None in let rec aux rs = function | [] -> raise Not_found | e::es -> match match_f_opt e with | Some k -> k, e, List.rev_append rs es | None -> aux (e::rs) es in aux [] let match_integer_arg1 = match_binop_arg1 match_integer let match_positive_or_null_arg2 = match_binop_arg2 match_positive_or_null let match_positive_or_null_integer_arg2 = match_binop_arg2 match_positive_or_null_integer let match_integer_extraction = match_list_head match_integer let match_power2_extraction = match_list_extraction match_power2 let match_binop_one_extraction binop = match_list_extraction (match_binop_one_arg1 binop) (* -------------------------------------------------------------------------- *) (* --- Conversion Symbols --- *) (* -------------------------------------------------------------------------- *) (* rule A: to_a(to_b x) = to_b x when domain(b) is all included in domain(a) *) (* rule B: to_a(to_b x) = to_a x when range(b) is a multiple of range(a) AND a is not bool *) (* to_iota(e) where e = to_iota'(e'), only ranges for iota *) let simplify_range_comp f iota e conv e' = let iota' = to_cint conv in let size' = Ctypes.i_bits iota' in let size = Ctypes.i_bits iota in if size <= size' then e_fun f [e'] (* rule B: iota' is multiple of iota -> keep iota(e') *) else if ((Ctypes.signed iota) || not (Ctypes.signed iota')) then e (* rule A: have iota > iota' check sign to apply rule. unsigned iota -> iota' must be unsigned signed iota -> iota' can have any sign *) else raise Not_found let simplify_f_to_bounds iota e = (* min(ctypes)<=y<=max(ctypes) ==> to_ctypes(y)=y *) let lower,upper = Ctypes.bounds iota in if (F.decide (F.e_leq e (e_zint upper))) && (F.decide (F.e_leq (e_zint lower) e)) then e else raise Not_found let f_to_int = Ctypes.i_memo (fun iota -> make_fun_int "to" iota) let configure_to_int iota = let simplify_range f iota e = begin try match F.repr e with | Logic.Kint value -> let size = Integer.of_int (Ctypes.i_bits iota) in let signed = Ctypes.signed iota in F.e_zint (Integer.cast ~size ~signed ~value) | Logic.Fun( fland , es ) when Fun.equal fland f_land && not (Ctypes.signed iota) && List.exists is_positive_or_null es -> (* to_uintN(a) == a & (2^N-1) when a >= 0 *) let m = F.e_zint (snd (Ctypes.bounds iota)) in F.e_fun f_land (m :: es) | Logic.Fun( flor , es ) when (Fun.equal flor f_lor) && not (Ctypes.signed iota) -> (* to_uintN(a|b) == (to_uintN(a) | to_uintN(b)) *) F.e_fun f_lor (List.map (fun e' -> e_fun f [e']) es) | Logic.Fun( flnot , [ e ] ) when (Fun.equal flnot f_lnot) && not (Ctypes.signed iota) -> begin match F.repr e with | Logic.Fun( f' , w ) when f' == f -> e_fun f [ e_fun f_lnot w ] | _ -> raise Not_found end | Logic.Fun( conv , [e'] ) -> (* unary op *) simplify_range_comp f iota e conv e' | _ -> raise Not_found with Not_found -> simplify_f_to_bounds iota e end in let simplify_conv f iota e = if iota = Ctypes.CBool then match F.is_equal e F.e_zero with | Yes -> F.e_zero | No -> F.e_one | Maybe -> raise Not_found else simplify_range f iota e in let simplify_leq f iota x y = let lower,upper = Ctypes.bounds iota in match F.repr y with | Logic.Fun( conv , [_] ) when (Fun.equal conv f) && (F.decide (F.e_leq x (e_zint lower))) -> (* x<=min(ctypes) ==> x<=to_ctypes(y) *) e_true | _ -> begin match F.repr x with | Logic.Fun( conv , [_] ) when (Fun.equal conv f) && (F.decide (F.e_leq (e_zint upper) y)) -> (* max(ctypes)<=y ==> to_ctypes(y)<=y *) e_true | _ -> raise Not_found end in let f = f_to_int iota in F.set_builtin_1 f (simplify_conv f iota) ; F.set_builtin_leq f (simplify_leq f iota) ; to_cint_map := FunMap.add f iota !to_cint_map let simplify_p_is_bounds iota e = let bounds = Ctypes.bounds iota in (* min(ctypes)<=y<=max(ctypes) <==> is_ctypes(y) *) match F.is_true (F.e_and [F.e_leq (e_zint (fst bounds)) e; F.e_leq e (e_zint (snd bounds))]) with | Logic.Yes -> e_true | Logic.No -> e_false | _ -> raise Not_found (* is_<cint> : int -> prop *) let p_is_int = Ctypes.i_memo (fun iota -> make_pred_int "is" iota) let configure_is_int iota = let f = p_is_int iota in let simplify = function | [e] -> begin match F.repr e with | Logic.Kint k -> let vmin,vmax = Ctypes.bounds iota in F.e_bool (Z.leq vmin k && Z.leq k vmax) | Logic.Fun( flor , es ) when (Fun.equal flor f_lor) && not (Ctypes.signed iota) -> (* is_uintN(a|b) == is_uintN(a) && is_uintN(b) *) F.e_and (List.map (fun e' -> e_fun f [e']) es) | _ -> simplify_p_is_bounds iota e end | _ -> raise Not_found in F.set_builtin f simplify; is_cint_map := FunMap.add f iota !is_cint_map let convert i a = e_fun (f_to_int i) [a] (* -------------------------------------------------------------------------- *) type model = | Natural (** Integer arithmetics with no upper-bound *) | Machine (** Integer/Module wrt Kernel options on RTE *) let () = Context.register begin fun () -> Ctypes.i_iter configure_to_int; Ctypes.i_iter configure_is_int; end let model = Context.create "Cint.model" let current () = Context.get model let configure = Context.set model let to_integer a = a let of_integer i a = convert i a let of_real i a = convert i (Cmath.int_of_real a) let range i a = match Context.get model with | Natural -> if Ctypes.signed i then F.p_true else F.p_leq F.e_zero a | Machine -> p_call (p_is_int i) [a] let ensures warn i a = if warn i then (if Lang.has_gamma () && Wp_parameters.get_overflows () then Lang.assume (range i a) ; a) else e_fun (f_to_int i) [a] let downcast = ensures is_downcast_an_error let overflow = ensures is_overflow_an_error (* -------------------------------------------------------------------------- *) (* --- Arithmetics --- *) (* -------------------------------------------------------------------------- *) let binop f i x y = overflow i (f x y) let unop f i x = overflow i (f x) (* C Code Semantics *) let iopp = unop e_opp let iadd = binop e_add let isub = binop e_sub let imul = binop e_mul let idiv = binop e_div let imod = binop e_mod (* -------------------------------------------------------------------------- *) (* --- Bits --- *) (* -------------------------------------------------------------------------- *) (* smp functions raise Not_found when simplification isn't possible *) let smp1 zf = (* f(c1) ~> zf(c1) *) function | [e] -> begin match F.repr e with | Logic.Kint c1 -> e_zint (zf c1) | _ -> raise Not_found end | _ -> raise Not_found let smp2 f zf = (* f(c1,c2) ~> zf(c1,c2), f(c1,c2,...) ~> f(zf(c1,c2),...) *) function | e1::e2::others -> begin match (F.repr e1), (F.repr e2) with (* integers should be at the beginning of the list *) | Logic.Kint c1, Logic.Kint c2 -> let z12 = ref (zf c1 c2) in let rec smp2 = function (* look at the other integers *) | [] -> [] | (e::r) as l -> begin match F.repr e with | Logic.Kint c -> z12 := zf !z12 c; smp2 r | _ -> l end in let others = smp2 others in let c12 = e_zint !z12 in if others = [] || F.is_absorbant f c12 then c12 else if F.is_neutral f c12 then e_fun f others else e_fun f (c12::others) | _ -> raise Not_found end | _ -> raise Not_found let bitk_positive k e = F.e_fun f_bit_positive [e;k] let smp_mk_bit_stdlib = function | [ a ; k ] when is_positive_or_null k -> (* No need to expand the logic definition of the ACSL stdlib symbol when [k] is positive (the definition must comply with that simplification). *) bitk_positive k a | [ a ; k ] -> (* TODO: expand the current logic definition of the ACSL stdlib symbol *) F.e_neq F.e_zero (F.e_fun f_land [a; (F.e_fun f_lsl [F.e_one;k])]) | _ -> raise Not_found let smp_bitk_positive = function | [ a ; k ] -> (* requires k>=0 *) begin try e_eq (match_power2 a) k with Not_found -> match F.repr a with | Logic.Kint za -> let zk = match_integer k (* simplifies constants *) in if Integer.is_zero (Integer.logand za (Integer.shift_left Integer.one zk)) then e_false else e_true | Logic.Fun( f , [e;n] ) when Fun.equal f f_lsr && is_positive_or_null n -> bitk_positive (e_add k n) e | Logic.Fun( f , [e;n] ) when Fun.equal f f_lsl && is_positive_or_null n -> begin match is_leq n k with | Logic.Yes -> bitk_positive (e_sub k n) e | Logic.No -> e_false | Logic.Maybe -> raise Not_found end | Logic.Fun( f , es ) when Fun.equal f f_land -> F.e_and (List.map (bitk_positive k) es) | Logic.Fun( f , es ) when Fun.equal f f_lor -> F.e_or (List.map (bitk_positive k) es) | Logic.Fun( f , [a;b] ) when Fun.equal f f_lxor -> F.e_neq (bitk_positive k a) (bitk_positive k b) | Logic.Fun( f , [a] ) when Fun.equal f f_lnot -> F.e_not (bitk_positive k a) | Logic.Fun( conv , [a] ) (* when is_to_c_int conv *) -> let iota = to_cint conv in let range = Ctypes.i_bits iota in let signed = Ctypes.signed iota in if signed then (* beware of sign-bit *) begin match is_leq k (e_int (range-2)) with | Logic.Yes -> bitk_positive k a | Logic.No | Logic.Maybe -> raise Not_found end else begin match is_leq (e_int range) k with | Logic.Yes -> e_false | Logic.No -> bitk_positive k a | Logic.Maybe -> raise Not_found end | _ -> raise Not_found end | _ -> raise Not_found let introduction_bit_test_positive es b = (* introduces bit_test(n,k) only when k>=0 *) let k,_,es = match_power2_extraction es in let es' = List.map (bitk_positive k) es in if b == e_zero then e_not (e_and es') else try let k' = match_power2 b in e_and ( e_eq k k' :: es' ) with Not_found -> let bs = match_fun f_land b in let k',_,bs = match_power2_extraction bs in let bs' = List.map (bitk_positive k') bs in match F.is_true (F.e_eq k k') with | Logic.Yes -> e_eq (e_and es') (e_and bs') | Logic.No -> e_and [e_not (e_and es'); e_not (e_and bs')] | Logic.Maybe -> raise Not_found let smp_land es = let introduction_bit_test_positive_from_land es = if true then raise Not_found; (* [PB] true: until alt-ergo 0.95.2 trouble *) let k,e,es = match_power2_extraction es in let t = match es with | x::[] -> x | _ -> e_fun f_land es in e_if (bitk_positive k t) e e_zero in try let r = smp2 f_land Integer.logand es in try match F.repr r with | Logic.Fun( f , es ) when Fun.equal f f_land -> introduction_bit_test_positive_from_land es | _ -> r with Not_found -> r with Not_found -> introduction_bit_test_positive_from_land es let smp_shift zf = (* f(e1,0)~>e1, c2>0==>f(c1,c2)~>zf(c1,c2), c2>0==>f(0,c2)~>0 *) function | [e1;e2] -> begin match (F.repr e1), (F.repr e2) with | _, Logic.Kint c2 when Z.equal c2 Z.zero -> e1 | Logic.Kint c1, Logic.Kint c2 when Z.leq Z.zero c2 -> (* undefined when c2 is negative *) e_zint (zf c1 c2) | Logic.Kint c1, _ when Z.equal c1 Z.zero && is_positive_or_null e2 -> (* undefined when c2 is negative *) e1 | _ -> raise Not_found end | _ -> raise Not_found let smp_leq_with_land a b = let es = match_fun f_land a in let a1,_ = match_list_head match_positive_or_null_integer es in if F.decide (F.e_leq (e_zint a1) b) then e_true else raise Not_found let smp_eq_with_land a b = let es = match_fun f_land a in try let b1 = match_integer b in try (* (b1&~a2)!=0 ==> (b1==(a2&e) <=> false) *) let a2,_ = match_integer_extraction es in if Integer.is_zero (Integer.logand b1 (Integer.lognot a2)) then raise Not_found ; e_false with Not_found when b == e_minus_one -> (* -1==(a1&a2) <=> (-1==a1 && -1==a2) *) F.e_and (List.map (e_eq b) es) with Not_found -> introduction_bit_test_positive es b let smp_eq_with_lor a b = let b1 = match_integer b in let es = match_fun f_lor a in try (* b1==(a2|t22) <==> (b1^a2)==(~a2&e) *) let a2,es = match_integer_extraction es in let k1 = Integer.logxor b1 a2 in let k2 = Integer.lognot a2 in e_eq (e_zint k1) (e_fun f_land ((e_zint k2)::es)) with Not_found when b == e_zero -> (* 0==(a1|a2) <=> (0==a1 && 0==a2) *) F.e_and (List.map (e_eq b) es) let smp_eq_with_lxor a b = (* b1==(a2^e) <==> (b1^a2)==e *) let b1 = match_integer b in let es = match_fun f_lxor a in try (* b1==(a2^e) <==> (b1^a2)==e *) let a2,es = match_integer_extraction es in let k1 = Integer.logxor b1 a2 in e_eq (e_zint k1) (e_fun f_lxor es) with Not_found when b == e_zero -> (* 0==(a1^a2) <=> (a1==a2) *) (match es with | e1::e2::[] -> e_eq e1 e2 | e1::((_::_) as e22) -> e_eq e1 (e_fun f_lxor e22) | _ -> raise Not_found) | Not_found when b == e_minus_one -> (* -1==(a1^a2) <=> (a1==~a2) *) (match es with | e1::e2::[] -> e_eq e1 (e_fun f_lnot [e2]) | e1::((_::_) as e22) -> e_eq e1 (e_fun f_lnot [e_fun f_lxor e22]) | _ -> raise Not_found) let smp_eq_with_lnot a b = (* b1==~e <==> ~b1==e *) let b1 = match_integer b in let e = match_ufun f_lnot a in let k1 = Integer.lognot b1 in e_eq (e_zint k1) e let two_power_k_minus1 k = try Integer.pred (Integer.two_power k) with Z.Overflow -> raise Not_found let smp_eq_with_lsl_cst a0 b0 = let b1 = match_integer b0 in let es = match_fun f_lsl a0 in try (* looks at the sd arg of a0 *) let e,a2= match_positive_or_null_integer_arg2 es in if not (Integer.is_zero (Integer.logand b1 (two_power_k_minus1 a2))) then (* a2>=0 && 0!=(b1 & ((2**a2)-1)) ==> ( (e<<a2)==b1 <==> false ) *) e_false else (* a2>=0 && 0==(b1 & ((2**a2)-1)) ==> ( (e<<a2)==b1 <==> e==(b1>>a2) ) *) e_eq e (e_zint (Integer.shift_right b1 a2)) with Not_found -> (* looks at the fistt arg of a0 *) let a1,e= match_integer_arg1 es in if is_negative e then raise Not_found ; (* [PB] can be generalized to any term for a1 *) if Integer.le Integer.zero a1 && Integer.lt b1 a1 then (* e>=0 && 0<=a1 && b1<a1 ==> ( (a1<<e)==b1 <==> false ) *) e_false else if Integer.ge Integer.zero a1 && Integer.gt b1 a1 then (* e>=0 && 0>=a1 && b1>a1 ==> ( (a1<<e)==b1 <==> false ) *) e_false else raise Not_found let smp_cmp_with_lsl cmp a0 b0 = if a0 == e_zero then let b,_ = match_fun f_lsl b0 |> match_positive_or_null_arg2 in cmp e_zero b (* q>=0 ==> ( (0 cmp(b<<q)) <==> (0 cmp b) ) *) else if b0 == e_zero then let a,_ = match_fun f_lsl a0 |> match_positive_or_null_arg2 in cmp a e_zero (* p>=0 ==> ( ((a<<p) cmp 0) <==> (a cmp 0) ) *) else let a,p = match_fun f_lsl a0 |> match_positive_or_null_arg2 in let b,q = match_fun f_lsl b0 |> match_positive_or_null_arg2 in if p == q then (* p>=0 && q>=0 && p==q ==> ( ((a<<p)cmp(b<<q)) <==> (a cmp b) ) *) cmp a b else if a == b && (cmp==e_eq || is_positive_or_null a) then (* p>=0 && q>=0 && a==b && a>=0 ==> ( ((a<<p)cmp(b<<q)) <==> (p cmp q) ) *) cmp p q else if a == b && is_negative a then (* p>=0 && q>=0 && a==b && a<0 ==> ( ((a<<p)<=(b<<q)) <==> (q cmp p) ) *) cmp q p else let p = match_integer p in let q = match_integer q in if Z.lt p q then (* p>=0 && q>=0 && p>q ==> ( ((a<<p)cmp(b<<q)) <==> (a cmp(b<<(q-p))) ) *) cmp a (e_fun f_lsl [b;e_zint (Z.sub q p)]) else if Z.lt q p then (* p>=0 && q>=0 && p<q ==> ( ((a<<p)cmp(b<<q)) <==> ((a<<(p-q)) cmp b) ) *) cmp (e_fun f_lsl [a;e_zint (Z.sub p q)]) b else (* p>=0 && q>=0 && p==q ==> ( ((a<<p)cmp(b<<q)) <==> (a cmp b) ) *) cmp a b let smp_eq_with_lsl a b = try smp_eq_with_lsl_cst a b with Not_found -> smp_cmp_with_lsl e_eq a b let smp_leq_with_lsl a0 b0 = smp_cmp_with_lsl e_leq a0 b0 let mk_cmp_with_lsr_cst cmp e x2 x1 = (* build (e&~((2**x2)-1)) cmp (x1<<x2) *) cmp (e_zint (Integer.shift_left x1 x2)) (e_fun f_land [e_zint (Integer.lognot (two_power_k_minus1 x2));e]) let smp_cmp_with_lsr cmp a0 b0 = try let b1 = match_integer b0 in let e,a2 = match_fun f_lsr a0 |> match_positive_or_null_integer_arg2 in (* (e>>a2) cmp b1 <==> (e&~((2**a2)-1)) cmp (b1<<a2) That rule is similar to e/A2 cmp b2 <==> (e/A2)*A2 cmp b2*A2) with A2==2**a2 So, A2>0 and (e/A2)*A2 == e&~((2**a2)-1) *) mk_cmp_with_lsr_cst cmp e a2 b1 with Not_found -> (* This rule takes into acount several cases. One of them is (a>>p) cmp (b>>(n+p)) <==> (a&~((2**p)-1)) cmp (b>>n)&~((2**p)-1) That rule is similar to (a/P)cmp(b/(N*P)) <==> (a/P)*P cmp ((b/N)/P)*P with P==2**p, N=2**n, q=p+n. So, (a/P)*P==a&~((2**p)-1), b/N==b>>n, ((b/N)/P)*P==(b>>n)&~((2**p)-1) *) let a,p = match_fun f_lsr a0 |> match_positive_or_null_integer_arg2 in let b,q = match_fun f_lsr b0 |> match_positive_or_null_integer_arg2 in let n = Integer.min p q in let a = if Integer.lt n p then e_fun f_lsr [a;e_zint (Z.sub p n)] else a in let b = if Integer.lt n q then e_fun f_lsr [b;e_zint (Z.sub q n)] else b in let m = F.e_zint (Integer.lognot (two_power_k_minus1 n)) in cmp (e_fun f_land [a;m]) (e_fun f_land [b;m]) let smp_eq_with_lsr a0 b0 = smp_cmp_with_lsr e_eq a0 b0 let smp_leq_with_lsr a0 b0 = try let bs = match_fun f_lsr b0 in if a0 == e_zero then let e,_ = match_positive_or_null_arg2 bs in (* b2>= 0 ==> (0<=(e>>b2) <==> 0<=e) (note: invalid for `e_eq`) *) e_leq e_zero e else let a1 = match_integer a0 in let e,b2 = match_positive_or_null_integer_arg2 bs in (* a1 <= (e>>b2) <==> (e&~((2**b2)-1)) >= (a1<<b2) *) mk_cmp_with_lsr_cst (fun a b -> e_leq b a) e b2 a1 with Not_found -> if b0 == e_zero then let e,_ = match_fun f_lsr a0 |> match_positive_or_null_arg2 in (* a2>= 0 ==> ((e>>a2)<=0 <==> e<=0) (note: invalid for `e_eq`) *) e_leq e e_zero else smp_cmp_with_lsr e_leq a0 b0 (* Rewritting at export *) let export_eq_with_land a b = let es = match_fun f_land a in if b == e_zero then let k,_,es = match_binop_one_extraction f_lsl es in (* e1 & ... & en & (1 << k) = 0 <==> !bit_test(e1 & ... & en, k) *) e_not (e_fun f_bit_export [e_fun f_land es ; k ]) else raise Not_found (* ACSL Semantics *) type l_builtin = { f: lfun ; eq: (term -> term -> term) option ; leq: (term -> term -> term) option ; smp: term list -> term ; } let () = Context.register begin fun () -> if Wp_parameters.Bits.get () then begin let mk_builtin n f ?eq ?leq smp = n, { f ; eq; leq; smp } in (* From [smp_mk_bit_stdlib], the built-in [f_bit_stdlib] is such that there is no creation of [e_fun f_bit_stdlib args] *) let bi_lbit_stdlib = mk_builtin "f_bit_stdlib" f_bit_stdlib smp_mk_bit_stdlib in let bi_lbit = mk_builtin "f_bit" f_bit_positive smp_bitk_positive in let bi_lnot = mk_builtin "f_lnot" f_lnot ~eq:smp_eq_with_lnot (smp1 Integer.lognot) in let bi_lxor = mk_builtin "f_lxor" f_lxor ~eq:smp_eq_with_lxor (smp2 f_lxor Integer.logxor) in let bi_lor = mk_builtin "f_lor" f_lor ~eq:smp_eq_with_lor (smp2 f_lor Integer.logor) in let bi_land = mk_builtin "f_land" f_land ~eq:smp_eq_with_land ~leq:smp_leq_with_land smp_land in let bi_lsl = mk_builtin "f_lsl" f_lsl ~eq:smp_eq_with_lsl ~leq:smp_leq_with_lsl (smp_shift Integer.shift_left) in let bi_lsr = mk_builtin "f_lsr" f_lsr ~eq:smp_eq_with_lsr ~leq:smp_leq_with_lsr (smp_shift Integer.shift_right) in List.iter begin fun (_name, { f; eq; leq; smp }) -> F.set_builtin f smp ; (match eq with | None -> () | Some eq -> F.set_builtin_eq f eq); (match leq with | None -> () | Some leq -> F.set_builtin_leq f leq) end [bi_lbit_stdlib ; bi_lbit; bi_lnot; bi_lxor; bi_lor; bi_land; bi_lsl; bi_lsr]; Lang.For_export.set_builtin_eq f_land export_eq_with_land end end (* ACSL Semantics *) let l_not a = e_fun f_lnot [a] let l_xor a b = e_fun f_lxor [a;b] let l_or a b = e_fun f_lor [a;b] let l_and a b = e_fun f_land [a;b] let l_lsl a b = e_fun f_lsl [a;b] let l_lsr a b = e_fun f_lsr [a;b] (* C Code Semantics *) (* we need a (forced) conversion to properly encode the semantics of C in terms of the semantics in Z(ACSL). Typically, lnot(128) becomes (-129), which must be converted to obtain an unsigned. *) let mask_unsigned i m = if Ctypes.signed i then m else convert i m let bnot i x = mask_unsigned i (l_not x) let bxor i x y = mask_unsigned i (l_xor x y) let bor _i = l_or (* no needs of range conversion *) let band _i = l_and (* no needs of range conversion *) let blsl i x y = overflow i (l_lsl x y) (* mult. by 2^y *) let blsr _i = l_lsr (* div. by 2^y, never overflow *) (** Simplifiers *) let c_int_bounds_ival f = let (umin,umax) = Ctypes.bounds f in Ival.inject_range (Some umin) (Some umax) let max_reduce_quantifiers = 1000 module Dom = struct type t = Ival.t Tmap.t let is_top_ival = Ival.equal Ival.top let top = Tmap.empty [@@@ warning "-32"] let pretty fmt dom = Tmap.iter (fun k v -> Format.fprintf fmt "%a: %a,@ " Lang.F.pp_term k Ival.pretty v) dom let find t dom = Tmap.find t dom let get t dom = try find t dom with Not_found -> Ival.top let narrow t v dom = if Ival.is_bottom v then raise Lang.Contradiction else if is_top_ival v then dom else Tmap.change (fun _ v old -> match old with | None -> Some v | (Some old) as old' -> let v = Ival.narrow v old in if Ival.is_bottom v then raise Lang.Contradiction; if Ival.equal v old then old' else Some v) t v dom let add t v dom = if Ival.is_bottom v then raise Lang.Contradiction; if is_top_ival v then dom else Tmap.add t v dom let remove t dom = Tmap.remove t dom let assume_cmp = let module Local = struct type t = Integer of Ival.t | Term of Ival.t option end in fun cmp t1 t2 dom -> let encode t = match Lang.F.repr t with | Kint z -> Local.Integer (Ival.inject_singleton z) | _ -> Local.Term (try Some (Tmap.find t dom) with Not_found -> None) in let term_dom = function | Some v -> v | None -> Ival.top in match encode t1, encode t2 with | Local.Integer cst1, Local.Integer cst2 -> (* assume cmp cst1 cst2 *) if Abstract_interp.Comp.False = Ival.forward_comp_int cmp cst1 cst2 then raise Lang.Contradiction; dom | Local.Term None, Local.Term None -> dom (* nothing can be collected *) | Local.Term opt1, Local.Integer cst2 -> let v1 = term_dom opt1 in add t1 (Ival.backward_comp_int_left cmp v1 cst2) dom | Local.Integer cst1, Local.Term opt2 -> let v2 = term_dom opt2 in let cmp_sym = Abstract_interp.Comp.sym cmp in add t2 (Ival.backward_comp_int_left cmp_sym v2 cst1) dom | Local.Term opt1, Local.Term opt2 -> let v1 = term_dom opt1 in let v2 = term_dom opt2 in let cmp_sym = Abstract_interp.Comp.sym cmp in add t1 (Ival.backward_comp_int_left cmp v1 v2) (add t2 (Ival.backward_comp_int_left cmp_sym v2 v1) dom) let assume_literal t dom = match Lang.F.repr t with | Eq(a,b) -> assume_cmp Abstract_interp.Comp.Eq a b dom | Leq(a,b) -> assume_cmp Abstract_interp.Comp.Le a b dom | Lt(a,b) -> assume_cmp Abstract_interp.Comp.Lt a b dom | Fun(g,[a]) -> begin try let ubound = c_int_bounds_ival (is_cint g) (* may raise Not_found *) in narrow a ubound dom with Not_found -> dom end | Not p -> begin match Lang.F.repr p with | Fun(g,[a]) -> begin try (* just checks for a contraction *) let ubound = c_int_bounds_ival (is_cint g) (* may raise Not_found *) in let v = Tmap.find a dom (* may raise Not_found *) in if Ival.is_included v ubound then raise Lang.Contradiction; dom with Not_found -> dom end | _ -> dom end | _ -> dom end let is_cint_simplifier = let reduce_bound ~add_bonus quant v tv dom t : term = (** Returns [new_t] such that [c_bind quant (alpha,t)] equals [c_bind quant v (alpha,new_t)] under the knowledge that [(not t) ==> (var in dom)]. Note: [~add_bonus] has not effect on the correctness of the transformation. It is a parameter that can be used in order to get better results. Bonus: Add additionnal hypothesis when we could deduce better constraint on the variable *) let module Tool = struct exception Stop exception Empty exception Unknown of Integer.t type t = { when_empty: unit -> term; add_hyp: term list -> term -> term; when_true: bool ref -> unit; when_false: bool ref -> unit; when_stop: unit -> term; } end in let tools = Tool.(match quant with | Forall -> { when_empty=(fun () -> e_true); add_hyp =(fun hyps t -> e_imply hyps t); when_true=(fun bonus -> bonus := add_bonus); when_false=(fun _ -> raise Stop); when_stop=(fun () -> e_false); } | Exists ->{ when_empty= (fun () -> e_false); add_hyp =(fun hyps t -> e_and (t::hyps)); when_true=(fun _ -> raise Stop); when_false=(fun bonus -> bonus := add_bonus); when_stop=(fun () -> e_true); } | _ -> assert false) in if Vars.mem v (vars t) then try let bonus_min = ref false in let bonus_max = ref false in let dom = if Ival.cardinal_is_less_than dom max_reduce_quantifiers then (* try to reduce the domain when [var] is still in [t] *) let red reduced i () = match repr (QED.e_subst_var v (e_zint i) t) with | True -> tools.Tool.when_true reduced | False -> tools.Tool.when_false reduced | _ -> raise (Tool.Unknown i) in let min_bound = try Ival.fold_int (red bonus_min) dom (); raise Tool.Empty with Tool.Unknown i -> i in let max_bound = try Ival.fold_int_decrease (red bonus_max) dom (); raise Tool.Empty with Tool.Unknown i -> i in let red_dom = Ival.inject_range (Some min_bound) (Some max_bound) in Ival.narrow dom red_dom else dom in begin match Ival.min_and_max dom with | None, None -> t (* Cannot be reduced *) | Some min, None -> (* May be reduced to [min ...] *) if !bonus_min then tools.Tool.add_hyp [e_leq (e_zint min) tv] t else t | None, Some max -> (* May be reduced to [... max] *) if !bonus_max then tools.Tool.add_hyp [e_leq tv (e_zint max)] t else t | Some min, Some max -> if Integer.equal min max then (* Reduced to only one value: [min] *) QED.e_subst_var v (e_zint min) t else if Integer.lt min max then let h = if !bonus_min then [e_leq (e_zint min) tv] else [] in let h = if !bonus_max then (e_leq tv (e_zint max))::h else h in tools.Tool.add_hyp h t else assert false (* Abstract_interp.Error_Bottom raised *) end with | Tool.Stop -> tools.Tool.when_stop () | Tool.Empty -> tools.Tool.when_empty () | Abstract_interp.Error_Bottom -> tools.Tool.when_empty () | Abstract_interp.Error_Top -> t else (* [alpha] is no more in [t] *) if Ival.is_bottom dom then tools.Tool.when_empty () else t in let module Polarity = struct type t = Pos | Neg | Both let flip = function | Pos -> Neg | Neg -> Pos | Both -> Both let from_bool = function | false -> Neg | true -> Pos end in object (self) val mutable domain : Dom.t = Dom.top method name = "Remove redundant is_cint" method copy = {< domain = domain >} method target _ = () method fixpoint = () method assume p = Lang.iter_consequence_literals (fun p -> domain <- Dom.assume_literal p domain) (Lang.F.e_prop p) method private simplify ~is_goal p = let pool = Lang.get_pool () in let reduce op var_domain base = let dom = match Lang.F.repr base with | Kint z -> Ival.inject_singleton z | _ -> try Tmap.find base domain with Not_found -> Ival.top in var_domain := Ival.backward_comp_int_left op !var_domain dom in let rec reduce_on_neg var var_domain t = match Lang.F.repr t with | _ when not (is_prop t) -> () | Leq(a,b) when Lang.F.equal a var -> reduce Abstract_interp.Comp.Le var_domain b | Leq(b,a) when Lang.F.equal a var -> reduce Abstract_interp.Comp.Ge var_domain b | Lt(a,b) when Lang.F.equal a var -> reduce Abstract_interp.Comp.Lt var_domain b | Lt(b,a) when Lang.F.equal a var -> reduce Abstract_interp.Comp.Gt var_domain b | And l -> List.iter (reduce_on_neg var var_domain) l | Not p -> reduce_on_pos var var_domain p | _ -> () and reduce_on_pos var var_domain t = match Lang.F.repr t with | Neq _ | Leq _ | Lt _ -> reduce_on_neg var var_domain (e_not t) | Imply (l,p) -> List.iter (reduce_on_neg var var_domain) l; reduce_on_pos var var_domain p | Or l -> List.iter (reduce_on_pos var var_domain) l; | Not p -> reduce_on_neg var var_domain p | _ -> () in (* [~term_pol] gives the polarity of the term [t] from the top level. That informs about how should be considered the quantifiers of [t] *) let rec walk ~term_pol t = let walk_flip_pol t = walk ~term_pol:(Polarity.flip term_pol) t and walk_same_pol t = walk ~term_pol t and walk_both_pol t = walk ~term_pol:Polarity.Both t in match repr t with | _ when not (is_prop t) -> t | Bind((Forall|Exists),_,_) -> let ctx,t = e_open ~pool ~lambda:false t in let ctx_with_dom = List.map (fun ((quant,var) as qv) -> match tau_of_var var with | Int -> let tvar = (e_var var) in let var_domain = ref Ival.top in if quant = Forall then reduce_on_pos tvar var_domain t else reduce_on_neg tvar var_domain t; domain <- Dom.add tvar !var_domain domain; qv, Some (tvar, var_domain) | _ -> qv, None) ctx in let t = walk_same_pol t in let f_close t = function | (quant,var), None -> e_bind quant var t | (quant,var), Some (tvar,var_domain) -> domain <- Dom.remove tvar domain; (** Bonus: Add additionnal hypothesis in forall when we could deduce better constraint on the variable *) let add_bonus = match term_pol with | Polarity.Both -> false | _ -> (term_pol=Polarity.Pos) = (quant=Forall) in let t = reduce_bound ~add_bonus quant var tvar !var_domain t in e_bind quant var t in List.fold_left f_close t ctx_with_dom | Fun(g,[a]) -> (** Here we simplifies the cints which are redoundant *) begin try let ubound = c_int_bounds_ival (is_cint g) in let dom = (Tmap.find a domain) in if Ival.is_included dom ubound then e_true else t with Not_found -> t end | Imply (l1,l2) -> e_imply (List.map walk_flip_pol l1) (walk_same_pol l2) | Not p -> e_not (walk_flip_pol p) | And _ | Or _ -> Lang.F.QED.f_map walk_same_pol t | _ -> Lang.F.QED.f_map ~pool ~forall:false ~exists:false walk_both_pol t in Lang.F.p_bool (walk ~term_pol:(Polarity.from_bool is_goal) (Lang.F.e_prop p)) method simplify_exp (e : term) = e method simplify_hyp p = self#simplify ~is_goal:false p method simplify_goal p = self#simplify ~is_goal:true p method simplify_branch p = p method infer = [] end let mask_simplifier = let update x m ctx = Tmap.insert (fun _ m old -> if Integer.lt m old then (*better*) m else old) x m ctx and rewrite ctx e = let reduce m x = match F.repr x with | Kint v -> F.e_zint (Integer.logand m v) | _ -> x and collect ctx d x = try let m = Tmap.find x ctx in match d with | None -> Some m | Some m0 -> if Integer.lt m m0 then Some m else d with Not_found -> d in match F.repr e with | Fun(f,es) when f == f_land -> begin match List.fold_left (collect ctx) None es with | None -> raise Not_found | Some m -> F.e_fun f_land (List.map (reduce m) es) end | _ -> raise Not_found in object (** Must be 2^n-1 *) val mutable magnitude : Integer.t Tmap.t = Tmap.empty method name = "Rewrite unsigned masks" method copy = {< magnitude = magnitude >} method target _ = () method infer = [] method fixpoint = () method assume p = Lang.iter_consequence_literals (fun p -> match F.repr p with | Fun(f,[x]) -> begin try let iota = is_cint f in if not (Ctypes.signed iota) then magnitude <- update x (snd (Ctypes.bounds iota)) magnitude with Not_found -> () end | _ -> ()) (F.e_prop p) method simplify_exp e = if Tmap.is_empty magnitude then e else Lang.e_subst (rewrite magnitude) e method simplify_hyp p = if Tmap.is_empty magnitude then p else Lang.p_subst (rewrite magnitude) p method simplify_branch p = if Tmap.is_empty magnitude then p else Lang.p_subst (rewrite magnitude) p method simplify_goal p = if Tmap.is_empty magnitude then p else Lang.p_subst (rewrite magnitude) p end (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cint.mli��������������������������������������������������������0000666�0000000�0000000�00000006063�13571573400�015516� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Integer Arithmetic Model *) (* -------------------------------------------------------------------------- *) open Ctypes open Lang open Lang.F val of_real : c_int -> unop val convert : c_int -> unop (** Independent from model *) val to_integer : unop val of_integer : c_int -> unop val to_cint : lfun -> c_int (** Raises [Not_found] if not. *) val is_cint : lfun -> c_int (** Raises [Not_found] if not. *) type model = Natural | Machine val configure : model -> unit val current : unit -> model val range : c_int -> term -> pred (** Dependent on model *) val downcast : c_int -> unop (** Dependent on model *) val iopp : c_int -> unop val iadd : c_int -> binop val isub : c_int -> binop val imul : c_int -> binop val idiv : c_int -> binop val imod : c_int -> binop val bnot : c_int -> unop val band : c_int -> binop val bxor : c_int -> binop val bor : c_int -> binop val blsl : c_int -> binop val blsr : c_int -> binop val l_not : unop val l_and : binop val l_xor : binop val l_or : binop val l_lsl : binop val l_lsr : binop val f_lnot : lfun val f_land : lfun val f_lxor : lfun val f_lor : lfun val f_lsl : lfun val f_lsr : lfun val f_bitwised : lfun list (** All except f_bit_positive *) (** Simplifiers *) val is_cint_simplifier: simplifier (** Remove the [is_cint] in formulas that are redundant with other conditions. *) val mask_simplifier: simplifier val is_positive_or_null: term -> bool �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cleaning.ml�����������������������������������������������������0000666�0000000�0000000�00000014051�13571573400�016164� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Variables Cleaning --- *) (* -------------------------------------------------------------------------- *) open Qed.Logic open Lang open Lang.F (* -------------------------------------------------------------------------- *) (* --- Lattice --- *) (* -------------------------------------------------------------------------- *) type 'a occur = | TOP | TRUE | FALSE | EQ of 'a let cup eq a y = match a with | EQ x when eq x y -> a | _ -> TOP let cup_true = function | TRUE -> TRUE | _ -> TOP let cup_false = function | FALSE -> FALSE | _ -> TOP let set_top m p = Vars.fold (fun x m -> Vmap.add x TOP m) (F.varsp p) m let add eq x d m = Vmap.add x (try cup eq (Vmap.find x m) d with Not_found -> EQ d) m let add_true m x = Vmap.add x (try cup_true (Vmap.find x m) with Not_found -> TRUE) m let add_false m x = Vmap.add x (try cup_false (Vmap.find x m) with Not_found -> FALSE) m let add_var = add Var.equal let add_fun = add Fun.equal (* -------------------------------------------------------------------------- *) (* --- Collector --- *) (* -------------------------------------------------------------------------- *) let rec add_pred m p = match F.p_expr p with | And ps -> List.fold_left add_pred m ps | If(e,a,b) -> add_pred (add_pred (set_top m e) a) b | Eq(a,b) -> begin match F.p_expr a , F.p_expr b with | Fvar x , Fvar y -> add_var x y (add_var y x m) | _ -> set_top m p end | Fvar x -> add_true m x | Not p -> begin match F.p_expr p with | Fvar x -> add_false m x | _ -> set_top m p end | _ -> set_top m p let rec add_type m p = match F.p_expr p with | And ps -> List.fold_left add_type m ps | Fun(f,[e]) -> begin match F.e_expr e with | Fvar x -> add_fun x f m | _ -> set_top m p end | _ -> set_top m p (* -------------------------------------------------------------------------- *) (* --- Usage --- *) (* -------------------------------------------------------------------------- *) type usage = { mutable eq_var : var occur Vmap.t ; mutable eq_fun : lfun occur Vmap.t ; } let create () = { eq_var = Vmap.empty ; eq_fun = Vmap.empty } let as_atom m p = m.eq_var <- set_top m.eq_var p let as_have m p = m.eq_var <- add_pred m.eq_var p let as_init m p = m.eq_fun <- add_type m.eq_fun p let as_type m p = m.eq_fun <- add_type m.eq_fun p (* -------------------------------------------------------------------------- *) (* --- Extraction --- *) (* -------------------------------------------------------------------------- *) let get x m = try Some (Vmap.find x m) with Not_found -> None let is_true x m = try match Vmap.find x m with TRUE -> true | _ -> false with Not_found -> false let is_false x m = try match Vmap.find x m with FALSE -> true | _ -> false with Not_found -> false let is_var x m = try match Vmap.find x m.eq_var with | EQ y -> begin match get x m.eq_fun , get y m.eq_fun with | None , _ -> true (* we eliminate x, which has no guard... *) | Some (EQ f) , Some (EQ g) -> Fun.equal f g | _ -> false end | _ -> false with Not_found -> false (* -------------------------------------------------------------------------- *) (* --- Filtering --- *) (* -------------------------------------------------------------------------- *) let rec filter_pred m p = match F.p_expr p with | And ps -> F.p_all (filter_pred m) ps | If(e,a,b) -> p_if e (filter_pred m a) (filter_pred m b) | Eq(a,b) -> begin match F.p_expr a , F.p_expr b with | Fvar x , Fvar y when is_var x m || is_var y m -> p_true | _ -> p end | Fvar x when is_true x m.eq_var -> p_true | Not q -> begin match F.p_expr q with | Fvar x when is_false x m.eq_var -> p_true | _ -> p end | _ -> p let rec filter_type m p = match F.p_expr p with | And ps -> F.p_all (filter_type m) ps | Fun(_,[e]) -> begin match F.p_expr e with | Fvar x when is_var x m -> p_true | _ -> p end | _ -> p ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cleaning.mli����������������������������������������������������0000666�0000000�0000000�00000004133�13571573400�016335� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Variables Cleaning --- *) (* -------------------------------------------------------------------------- *) open Lang.F type usage val create : unit -> usage val as_atom : usage -> pred -> unit val as_type : usage -> pred -> unit val as_have : usage -> pred -> unit val as_init : usage -> pred -> unit val filter_type : usage -> pred -> pred val filter_pred : usage -> pred -> pred �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cmath.ml��������������������������������������������������������0000666�0000000�0000000�00000035544�13571573400�015512� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Qed open Logic open Lang open Lang.F let f_builtin ~library ?(injective=false) ?(result=Real) ?(params=[Real]) ?ext name = assert (name.[0] == '\\') ; let call = match ext with Some call -> call | None -> String.sub name 1 (String.length name - 1) in let link = Lang.infoprover (Engine.F_call call) in let category = let open Qed.Logic in if injective then Injection else Function in let signature = List.map LogicBuiltins.kind_of_tau params in let params = List.map Kind.of_tau params in let lfun = extern_s ~library ~category ~result ~params ~link name in LogicBuiltins.(add_builtin name signature lfun) ; lfun (* -------------------------------------------------------------------------- *) (* --- Real Of Int --- *) (* -------------------------------------------------------------------------- *) let f_real_of_int = extern_f ~library:"qed" ~category:Qed.Logic.Injection ~result:Logic.Real ~params:[Logic.Sint] "real_of_int" let builtin_real_of_int e = match F.repr e with | Qed.Logic.Kint k -> F.e_real (Q.of_bigint k) | _ -> raise Not_found (* -------------------------------------------------------------------------- *) (* --- Truncate --- *) (* -------------------------------------------------------------------------- *) let f_truncate = f_builtin ~library:"truncate" ~result:Int "\\truncate" let f_ceil = f_builtin ~library:"truncate" ~result:Int "\\ceil" let f_floor = f_builtin ~library:"truncate" ~result:Int "\\floor" let builtin_truncate f e = let open Qed.Logic in match F.repr e with | Kint _ -> e | Kreal r when Q.(equal r zero) -> e_zero | Kreal r -> begin try (* Waiting for Z-Arith to have truncation to big-int *) let truncated = int_of_float (Transitioning.Q.to_float r) in let reversed = Q.of_int truncated in let base = F.e_int truncated in if Q.equal r reversed then base else if f == f_ceil && Q.(lt zero r) then F.(e_add base e_one) else if f == f_floor && Q.(lt r zero) then F.(e_sub base e_one) else base with _ -> raise Not_found end | Fun( f , [e] ) when f == f_real_of_int -> e | _ -> raise Not_found (* -------------------------------------------------------------------------- *) (* --- Conversions --- *) (* -------------------------------------------------------------------------- *) let int_of_real x = e_fun f_truncate [x] let real_of_int x = e_fun f_real_of_int [x] let int_of_bool a = e_neq a F.e_zero (* if a != 0 then true else false *) let bool_of_int a = e_if a F.e_one F.e_zero (* if a then 1 else 0 *) (* -------------------------------------------------------------------------- *) (* --- Sign --- *) (* -------------------------------------------------------------------------- *) (* rewrite a=b when a or b is f(x) for functions f such as 0 <= f(x) && ( f(x) = 0 <-> x = 0 ) *) let builtin_positive_eq lfun ~domain ~zero ~injective a b = let open Qed.Logic in begin match F.repr a , F.repr b with | Fun(f,[a]) , Fun(f',[b]) when injective && f == lfun && f' == lfun && domain a && domain b -> (* injective a in domain && b in domain -> ( f(a) = f(b) <-> a = b ) *) e_eq a b | Fun(f,[a]) , _ when f == lfun && domain a -> if QED.eval_lt b zero then (* a in domain && b < 0 -> ( f(a) = b <-> false ) *) e_false else if QED.eval_eq zero b then (* a in domain && b = 0 -> ( f(a) = 0 <-> a = 0 ) *) e_eq a zero else raise Not_found | _ -> raise Not_found end (* rewrite a<=b when a or b is f(x) for functions f such as 0 <= f(x) && f(x) = 0 <-> x = 0 *) let builtin_positive_leq lfun ~domain ~zero ~monotonic a b = let open Qed.Logic in begin match F.repr a , F.repr b with | Fun(f,[a]) , Fun(f',[b]) when monotonic && f == lfun && f' == lfun && domain a && domain b -> (* increasing && a in domain && b in domain -> ( f(a) <= f(b) <-> a <= b) *) e_leq a b | Fun(f,[a]) , _ when f == lfun && domain a -> if QED.eval_lt b zero then (* a in domain && b < 0 -> ( f(a) <= b <-> false ) *) e_false else if QED.eval_eq zero b then (* a in domain && b = 0 -> ( f(a) <= b <-> a = 0 )*) e_eq a zero else raise Not_found | _ , Fun(f,[b]) when f == lfun && domain b && QED.eval_leq a zero -> (* b in domain && a <= 0 -> ( a <= f(b) <-> true *) e_true | _ -> raise Not_found end (* rewrite a=b when a or b is f(x) for functions f such as 0 < f(x) *) let builtin_strict_eq lfun ~domain ~zero ~injective a b = let open Qed.Logic in begin match F.repr a , F.repr b with | Fun(f,[a]) , Fun(f',[b]) when injective && f == lfun && f' == lfun && domain a && domain b -> (* injective && a in domain && b in domain -> ( f(a) = f(b) <-> a = b ) *) e_eq a b | Fun(f,[a]) , _ when f == lfun && domain a && QED.eval_leq b zero -> (* a in domain && b <= 0 -> ( f(a) = b <-> false ) *) e_false | _ -> raise Not_found end (* rewrite a<=b when a or b is f(x) for functions f such as 0 < f(x) *) let builtin_strict_leq lfun ~domain ~zero ~monotonic a b = let open Qed.Logic in begin match F.repr a , F.repr b with | Fun(f,[a]) , Fun(f',[b]) when monotonic && f == lfun && f' == lfun && domain a && domain b -> (* increasing && a in domain && b in domain -> ( f(a) <= f(b) <-> a <= b ) *) e_leq a b | Fun(f,[a]) , _ when f == lfun && domain a && QED.eval_leq b zero -> (* a in domain && b <= 0 -> ( f(a) <= b <-> false ) *) e_false | _ , Fun(f,[b]) when f == lfun && domain b && QED.eval_leq a zero -> (* b in domain && a <= 0 -> ( a <= f(b) <-> true ) *) e_true | _ -> raise Not_found end (* -------------------------------------------------------------------------- *) (* --- Absolute --- *) (* -------------------------------------------------------------------------- *) let f_iabs = extern_f ~library:"cmath" ~link:{ altergo = Qed.Engine.F_call "abs_int"; why3 = Qed.Engine.F_call "IAbs.abs"; coq = Qed.Engine.F_call "Z.abs"; } "\\iabs" let f_rabs = extern_f ~library:"cmath" ~result:Real ~params:[Sreal] ~link:{ altergo = Qed.Engine.F_call "abs_real"; why3 = Qed.Engine.F_call "RAbs.abs"; coq = Qed.Engine.F_call "R.abs"; } "\\rabs" let () = begin LogicBuiltins.(add_builtin "\\abs" [Z] f_iabs) ; LogicBuiltins.(add_builtin "\\abs" [R] f_rabs) ; end let domain_abs _x = true let builtin_abs f z e = let open Qed.Logic in match F.repr e with | Times(k,a) -> e_times (Integer.abs k) (e_fun f [a]) | Kint k -> e_zint (Integer.abs k) | Kreal r when Q.lt r Q.zero -> e_real (Q.neg r) | _ -> match is_true (e_leq z e) with | Yes -> e | No -> e_opp e | Maybe -> raise Not_found let builtin_iabs_eq = builtin_positive_eq f_iabs ~domain:domain_abs ~zero:e_zero ~injective:false let builtin_iabs_leq = builtin_positive_leq f_iabs ~domain:domain_abs ~zero:e_zero ~monotonic:false let builtin_rabs_eq = builtin_positive_eq f_rabs ~domain:domain_abs ~zero:e_zero_real ~injective:false let builtin_rabs_leq = builtin_positive_leq f_rabs ~domain:domain_abs ~zero:e_zero_real ~monotonic:false (* -------------------------------------------------------------------------- *) (* --- Square Root --- *) (* -------------------------------------------------------------------------- *) let f_sqrt = f_builtin ~library:"sqrt" "\\sqrt" let domain_sqrt x = QED.eval_leq e_zero_real x let builtin_sqrt e = let open Qed.Logic in match F.repr e with | Kreal r when r == Q.zero -> F.e_zero_real (* srqt(0)==0 *) | Kreal r when r == Q.one -> F.e_one_real (* srqt(1)==1 *) | Mul[a;b] when eval_eq a b -> (* a==b ==> sqrt(a*b)==|a| *) e_fun f_rabs [a] (* a is smaller *) | _ -> raise Not_found let builtin_sqrt_eq = builtin_positive_eq f_sqrt ~domain:domain_sqrt ~zero:e_zero_real ~injective:true let builtin_sqrt_leq = builtin_positive_leq f_sqrt ~domain:domain_sqrt ~zero:e_zero_real ~monotonic:true (* -------------------------------------------------------------------------- *) (* --- Exponential --- *) (* -------------------------------------------------------------------------- *) let f_exp = f_builtin ~library:"exponential" ~injective:true "\\exp" let f_log = f_builtin ~library:"exponential" "\\log" let f_log10 = f_builtin ~library:"exponential" "\\log10" let f_pow = f_builtin ~library:"power" ~params:[Real;Real] "\\pow" let () = ignore f_log10 let domain_exp _x = true let domain_log x = QED.eval_lt e_zero_real x let builtin_exp e = let open Qed.Logic in match F.repr e with | Kreal r when r == Q.zero -> F.e_one_real (* exp(0)==1 *) | Times(n,r) when n == Z.minus_one -> (* exp(-r) = 1/exp(r) *) F.e_div F.e_one_real (F.e_fun f_exp [r]) | Fun( f , [x] ) when f == f_log && domain_log x -> (* 0<x ==> exp(log(x)) = x *) x | _ -> raise Not_found let builtin_log e = let open Qed.Logic in match F.repr e with | Kreal r when r == Q.one -> F.e_zero_real (* log(1) == 0 *) | Fun( f , [x] ) when f == f_exp -> x (* log(exp(x)) == x *) | Fun( f , [x;n] ) when f == f_pow && domain_log x -> (* 0<x ==> log(x^n) == n*log(x) *) F.e_mul n (F.e_fun f_log [x]) | _ -> raise Not_found (* a^n = e^(n.log a) *) let builtin_pow a n = let open Qed.Logic in match F.repr n with | Kreal r when Q.(equal r zero) -> F.e_one_real (* a^0 == 1 *) | Kreal r when Q.(equal r one) -> a (* a^1 == a *) | _ -> raise Not_found let builtin_exp_eq = builtin_strict_eq f_exp ~domain:domain_exp ~zero:e_zero_real ~injective:true let builtin_exp_leq = builtin_strict_leq f_exp ~domain:domain_exp ~zero:e_zero_real ~monotonic:true (* -------------------------------------------------------------------------- *) (* --- Trigonometry --- *) (* -------------------------------------------------------------------------- *) let f_sin = f_builtin ~library:"trigonometry" "\\sin" let f_cos = f_builtin ~library:"trigonometry" "\\cos" let f_tan = f_builtin ~library:"trigonometry" "\\tan" let f_asin = f_builtin ~library:"arctrigo" "\\asin" let f_acos = f_builtin ~library:"arctrigo" "\\acos" let f_atan = f_builtin ~library:"arctrigo" ~injective:true "\\atan" let domain_asin_acos x = QED.eval_leq x e_one_real && QED.eval_leq e_minus_one_real x let domain_atan _x = true let builtin_trigo f_arc ~domain e = match F.repr e with | Fun(f,[x]) when f == f_arc && domain x -> x | _ -> raise Not_found (* -------------------------------------------------------------------------- *) (* --- Hyperbolic --- *) (* -------------------------------------------------------------------------- *) let () = begin ignore (f_builtin ~library:"hyperbolic" "\\sinh") ; ignore (f_builtin ~library:"hyperbolic" "\\cosh") ; ignore (f_builtin ~library:"hyperbolic" "\\tanh") ; end (* -------------------------------------------------------------------------- *) (* --- Polar Coordinates --- *) (* -------------------------------------------------------------------------- *) let () = begin ignore (f_builtin ~library:"polar" ~params:[Real;Real] "\\atan2") ; ignore (f_builtin ~library:"polar" ~params:[Real;Real] "\\hypot") ; end (* -------------------------------------------------------------------------- *) (* --- Registry --- *) (* -------------------------------------------------------------------------- *) let () = Context.register begin fun () -> F.set_builtin_1 f_real_of_int builtin_real_of_int ; F.set_builtin_1 f_truncate (builtin_truncate f_truncate) ; F.set_builtin_1 f_ceil (builtin_truncate f_ceil) ; F.set_builtin_1 f_floor (builtin_truncate f_floor) ; F.set_builtin_1 f_iabs (builtin_abs f_iabs e_zero) ; F.set_builtin_1 f_rabs (builtin_abs f_rabs e_zero_real) ; F.set_builtin_eq f_iabs builtin_iabs_eq ; F.set_builtin_eq f_rabs builtin_rabs_eq ; F.set_builtin_leq f_iabs builtin_iabs_leq ; F.set_builtin_leq f_rabs builtin_rabs_leq ; F.set_builtin_1 f_sqrt builtin_sqrt ; F.set_builtin_eq f_sqrt builtin_sqrt_eq ; F.set_builtin_leq f_sqrt builtin_sqrt_leq ; F.set_builtin_1 f_log builtin_log ; F.set_builtin_1 f_exp builtin_exp ; F.set_builtin_eq f_exp builtin_exp_eq ; F.set_builtin_leq f_exp builtin_exp_leq ; F.set_builtin_2 f_pow builtin_pow ; F.set_builtin_1 f_sin (builtin_trigo f_asin ~domain:domain_asin_acos) ; F.set_builtin_1 f_cos (builtin_trigo f_acos ~domain:domain_asin_acos) ; F.set_builtin_1 f_tan (builtin_trigo f_atan ~domain:domain_atan) ; end (* -------------------------------------------------------------------------- *) ������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cmath.mli�������������������������������������������������������0000666�0000000�0000000�00000004061�13571573400�015651� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Math Operators *) (* -------------------------------------------------------------------------- *) open Lang open Lang.F val int_of_bool : unop val bool_of_int : unop val int_of_real : term -> term val real_of_int : term -> term val f_real_of_int : lfun val f_iabs : lfun val f_rabs : lfun val f_sqrt : lfun (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/CodeSemantics.ml������������������������������������������������0000666�0000000�0000000�00000057662�13571573400�017204� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- C-Code Translation --- *) (* -------------------------------------------------------------------------- *) open Cil_datatype open Cil_types open Ctypes open Qed open Sigs open Lang open Lang.F module WpLog = Wp_parameters let constfold_ctyp = function | TArray (_,Some {enode = (Const CInt64 _) },_,_) as ct -> ct | TArray (ty,Some len,cache,attr) as ct -> begin match Cil.constFold true len with | {enode = (Const CInt64 _) } as len -> TArray(ty,Some len,cache,attr) | _ -> ct end | ct -> ct let constfold_coffset = function | Index({enode=Const (CInt64 _)}, _) as off -> off | Index(idx, next) as off -> begin match Cil.constFold true idx with | {enode = (Const CInt64 _) } as idx -> Index(idx, next) | _ -> off end | off -> off module Make(M : Sigs.Model) = struct module M = M type loc = M.loc type value = M.loc Sigs.value type sigma = M.Sigma.t type result = loc Sigs.result let pp_value fmt = function | Val e -> Format.fprintf fmt "Val:%a" F.pp_term e | Loc l-> Format.fprintf fmt "Loc:%a" M.pretty l let cval = function | Val e -> e | Loc l -> M.pointer_val l let cloc = function | Loc l -> l | Val e -> M.pointer_loc e (* -------------------------------------------------------------------------- *) (* --- Initializers --- *) (* -------------------------------------------------------------------------- *) let is_zero_int = function | Val e -> p_equal e e_zero | Loc l -> M.is_null l let is_zero_float = function | Val e -> p_equal e e_zero_real | Loc l -> M.is_null l let is_zero_ptr v = M.is_null (cloc v) let rec is_zero sigma obj l = match obj with | C_int _ -> is_zero_int (M.load sigma obj l) | C_float _ -> is_zero_float (M.load sigma obj l) | C_pointer _ -> is_zero_ptr (M.load sigma obj l) | C_comp c -> p_all (fun f -> is_zero sigma (Ctypes.object_of f.ftype) (M.field l f)) c.cfields | C_array a -> (*TODO[LC] make zero-initializers model-dependent. For instance, a[N][M] becomes a[N*M] in MemTyped, but not in MemVar *) let x = Lang.freshvar ~basename:"k" Logic.Int in let k = e_var x in let obj = Ctypes.object_of a.arr_element in let range = match a.arr_flat with | None -> [] | Some f -> [ p_leq e_zero k ; p_lt k (e_int f.arr_size) ] in let init = is_zero sigma obj (M.shift l obj k) in p_forall [x] (p_hyps range init) let is_exp_range sigma l obj a b v = let x = Lang.freshvar ~basename:"k" Logic.Int in let k = e_var x in let range = [ p_leq a k ; p_lt k b ] in let init = match v with | None -> is_zero sigma obj (M.shift l obj k) | Some v -> let elt = (M.load sigma obj (M.shift l obj k)) in if Ctypes.is_pointer obj then M.loc_eq (cloc elt) (cloc v) else p_equal (cval elt) (cval v) in p_forall [x] (p_hyps range init) (* -------------------------------------------------------------------------- *) (* --- Recursion --- *) (* -------------------------------------------------------------------------- *) let s_exp : (sigma -> exp -> value) ref = ref (fun _ _ -> assert false) let s_cond : (sigma -> exp -> pred) ref = ref (fun _ _ -> assert false) let val_of_exp env e = cval (!s_exp env e) let loc_of_exp env e = cloc (!s_exp env e) (* -------------------------------------------------------------------------- *) (* --- L-Values --- *) (* -------------------------------------------------------------------------- *) let loc_of_lhost env = function | Var x -> M.cvar x | Mem e -> loc_of_exp env e let rec loc_of_offset env l typ = function | NoOffset -> l | Field(f,offset) -> loc_of_offset env (M.field l f) f.ftype offset | Index(e,offset) -> let k = val_of_exp env e in let te = Cil.typeOf_array_elem typ in let obj = Ctypes.object_of te in loc_of_offset env (M.shift l obj k) te offset let lval env (lhost,offset) = loc_of_offset env (loc_of_lhost env lhost) (Cil.typeOfLhost lhost) offset (* -------------------------------------------------------------------------- *) (* --- Unary Operator --- *) (* -------------------------------------------------------------------------- *) let exp_unop env typ unop e = let v = match Ctypes.object_of typ , unop with | C_int i , Neg -> Cint.iopp i (val_of_exp env e) | C_int i , BNot -> Cint.bnot i (val_of_exp env e) | C_float f , Neg -> Cfloat.fopp f (val_of_exp env e) | C_int _ , LNot -> Cvalues.bool_eq (val_of_exp env e) e_zero | C_float _ , LNot -> Cvalues.bool_eq (val_of_exp env e) e_zero_real | C_pointer _ , LNot -> Cvalues.is_true (M.is_null (loc_of_exp env e)) | _ -> Warning.error "Undefined unary operator (%a)" Printer.pp_typ typ in Val v (* -------------------------------------------------------------------------- *) (* --- Binary Operator --- *) (* -------------------------------------------------------------------------- *) let arith env tr iop fop e1 e2 = match Ctypes.object_of tr with | C_int i -> Val (iop i (val_of_exp env e1) (val_of_exp env e2)) | C_float f -> Val (fop f (val_of_exp env e1) (val_of_exp env e2)) | _ -> assert false let arith_int env tr iop e1 e2 = match Ctypes.object_of tr with | C_int i -> Val (iop i (val_of_exp env e1) (val_of_exp env e2)) | _ -> assert false let bool_of_comp env iop lop fop e1 e2 = let t1 = Cil.typeOf e1 in let t2 = Cil.typeOf e2 in if Cil.isPointerType t1 && Cil.isPointerType t2 then Cvalues.is_true (lop (loc_of_exp env e1) (loc_of_exp env e2)) else match Cil.unrollType t1 with | TFloat(f,_) -> let p = fop (Ctypes.c_float f) (val_of_exp env e1) (val_of_exp env e2) in e_if (F.e_prop p) e_one e_zero | _ -> iop (val_of_exp env e1) (val_of_exp env e2) let bool_of_exp env e = match Ctypes.object_of (Cil.typeOf e) with | C_int _ -> Cvalues.bool_neq (val_of_exp env e) e_zero | C_float _ -> Cvalues.bool_neq (val_of_exp env e) e_zero_real | C_pointer _ -> Cvalues.is_false (M.is_null (loc_of_exp env e)) | _ -> assert false let exp_binop env tr binop e1 e2 = match binop with | PlusA -> arith env tr Cint.iadd Cfloat.fadd e1 e2 | MinusA -> arith env tr Cint.isub Cfloat.fsub e1 e2 | Mult -> arith env tr Cint.imul Cfloat.fmul e1 e2 | Div -> arith env tr Cint.idiv Cfloat.fdiv e1 e2 | Mod -> arith_int env tr Cint.imod e1 e2 | Shiftlt -> arith_int env tr Cint.blsl e1 e2 | Shiftrt -> arith_int env tr Cint.blsr e1 e2 | BAnd -> arith_int env tr Cint.band e1 e2 | BOr -> arith_int env tr Cint.bor e1 e2 | BXor -> arith_int env tr Cint.bxor e1 e2 | Eq -> Val (bool_of_comp env Cvalues.bool_eq M.loc_eq Cfloat.feq e1 e2) | Ne -> Val (bool_of_comp env Cvalues.bool_neq M.loc_neq Cfloat.fneq e1 e2) | Lt -> Val (bool_of_comp env Cvalues.bool_lt M.loc_lt Cfloat.flt e1 e2) | Gt -> Val (bool_of_comp env Cvalues.bool_lt M.loc_lt Cfloat.flt e2 e1) | Le -> Val (bool_of_comp env Cvalues.bool_leq M.loc_leq Cfloat.fle e1 e2) | Ge -> Val (bool_of_comp env Cvalues.bool_leq M.loc_leq Cfloat.fle e2 e1) | LAnd -> Val (Cvalues.bool_and (bool_of_exp env e1) (bool_of_exp env e2)) | LOr -> Val (Cvalues.bool_or (bool_of_exp env e1) (bool_of_exp env e2)) | PlusPI | IndexPI -> let te = Cil.typeOf_pointed (Cil.typeOf e1) in let obj = Ctypes.object_of te in Loc(M.shift (loc_of_exp env e1) obj (val_of_exp env e2)) | MinusPI -> let te = Cil.typeOf_pointed (Cil.typeOf e1) in let obj = Ctypes.object_of te in Loc(M.shift (loc_of_exp env e1) obj (e_opp (val_of_exp env e2))) | MinusPP -> let te = Cil.typeOf_pointed (Cil.typeOf e1) in let obj = Ctypes.object_of te in Val(M.loc_diff obj (loc_of_exp env e1) (loc_of_exp env e2)) (* -------------------------------------------------------------------------- *) (* --- Cast --- *) (* -------------------------------------------------------------------------- *) let cast tr te ve = match Ctypes.object_of tr , Ctypes.object_of te with | C_int ir , C_int ie -> let v = cval ve in Val( if Ctypes.sub_c_int ie ir then v else Cint.downcast ir v ) | C_float fr , C_float fe -> let v = cval ve in Val( if Ctypes.equal_float fe fr then v else Cfloat.float_of_real fr (Cfloat.real_of_float fe v) ) | C_int ir , C_float fr -> Val(Cint.of_real ir (Cfloat.real_of_float fr (cval ve))) | C_float fr , C_int _ -> Val(Cfloat.float_of_real fr (Cmath.real_of_int (cval ve))) | C_pointer tr , C_pointer te -> let obj_r = Ctypes.object_of tr in let obj_e = Ctypes.object_of te in if Ctypes.compare obj_r obj_e = 0 then ve else Loc (M.cast {pre=obj_e;post=obj_r} (cloc ve)) | C_pointer te , C_int _ -> let e = cval ve in Loc(if F.equal e (F.e_zero) then M.null else M.loc_of_int (Ctypes.object_of te) e) | C_int ir , C_pointer _ -> Val (M.int_of_loc ir (cloc ve)) | t1, t2 when Ctypes.equal t1 t2 -> ve | _ -> Warning.error "cast (%a) into (%a) not yet implemented" Printer.pp_typ te Printer.pp_typ tr (* -------------------------------------------------------------------------- *) (* --- Undefined Exp --- *) (* -------------------------------------------------------------------------- *) let exp_undefined e = let ty = Cil.typeOf e in let x = Lang.freshvar ~basename:"w" (Lang.tau_of_ctype ty) in Val (e_var x) (* -------------------------------------------------------------------------- *) (* --- Exp-Node --- *) (* -------------------------------------------------------------------------- *) let exp_node env e = match e.enode with | Const (CStr s) -> Loc (M.literal ~eid:e.eid (Cstring.C_str s)) | Const (CWStr s) -> Loc (M.literal ~eid:e.eid (Cstring.W_str s)) | Const c -> Val (Cvalues.constant c) | Lval lv -> if Cil.isVolatileLval lv && Cvalues.volatile ~warn:"unsafe read-access to volatile l-value" () then exp_undefined e else let loc = lval env lv in let typ = Cil.typeOfLval lv in let obj = Ctypes.object_of typ in let data = M.load env obj loc in Lang.assume (Cvalues.is_object obj data) ; data | AddrOf lv -> Loc (lval env lv) | StartOf lv -> Loc (Cvalues.startof ~shift:M.shift (lval env lv) (Cil.typeOfLval lv)) | UnOp(op,e,ty) -> exp_unop env ty op e | BinOp(op,e1,e2,tr) -> exp_binop env tr op e1 e2 | Info(e,_) -> !s_exp env e | AlignOfE _ | AlignOf _ | SizeOfE _ | SizeOf _ | SizeOfStr _ -> Val (Cvalues.constant_exp e) | CastE(tr,e) -> cast tr (Cil.typeOf e) (!s_exp env e) let rec call_node env e = match e.enode with | CastE(_,e) -> call_node env e | AddrOf lv | StartOf lv | Lval lv -> lval env lv | _ -> Warning.error ~source:"call" "Unsupported function pointer" (* -------------------------------------------------------------------------- *) (* --- Exp with Error --- *) (* -------------------------------------------------------------------------- *) let exp_protected env e = Warning.handle ~handler:exp_undefined ~severe:false ~effect:"Hide sub-term definition" (exp_node env) e (* -------------------------------------------------------------------------- *) (* --- Condition-Node --- *) (* -------------------------------------------------------------------------- *) let eq_t is_ptr t v1 v2 = match v1 , v2 with | Loc p , Loc q -> M.loc_eq p q | Val a , Val b -> p_equal a b | _ -> if is_ptr t then M.loc_eq (cloc v1) (cloc v2) else p_equal (cval v1) (cval v2) let neq_t is_ptr t v1 v2 = match v1 , v2 with | Loc p , Loc q -> M.loc_neq p q | Val a , Val b -> p_neq a b | _ -> if is_ptr t then M.loc_neq (cloc v1) (cloc v2) else p_neq (cval v1) (cval v2) let equal_typ t v1 v2 = eq_t Cil.isPointerType t v1 v2 let equal_obj obj v1 v2 = eq_t Ctypes.is_pointer obj v1 v2 let not_equal_typ t v1 v2 = neq_t Cil.isPointerType t v1 v2 let not_equal_obj obj v1 v2 = neq_t Ctypes.is_pointer obj v1 v2 let compare env vop lop fop e1 e2 = let t1 = Ctypes.object_of (Cil.typeOf e1) in let t2 = Ctypes.object_of (Cil.typeOf e2) in if not (Ctypes.equal t1 t2) then Warning.error "Comparison with different types (%a) and (%a)" Ctypes.pretty t1 Ctypes.pretty t2 ; match t1 with | C_pointer _ -> lop (loc_of_exp env e1) (loc_of_exp env e2) | C_float f -> (fop f) (val_of_exp env e1) (val_of_exp env e2) | _ -> vop (val_of_exp env e1) (val_of_exp env e2) let cond_node env e = match e.enode with | UnOp( LNot, e,_) -> p_not (!s_cond env e) | BinOp( LAnd, e1,e2,_) -> p_and (!s_cond env e1) (!s_cond env e2) | BinOp( LOr, e1,e2,_) -> p_or (!s_cond env e1) (!s_cond env e2) | BinOp( Eq, e1,e2,_) -> compare env p_equal M.loc_eq Cfloat.feq e1 e2 | BinOp( Ne, e1,e2,_) -> compare env p_neq M.loc_neq Cfloat.fneq e1 e2 | BinOp( Lt, e1,e2,_) -> compare env p_lt M.loc_lt Cfloat.flt e1 e2 | BinOp( Gt, e1,e2,_) -> compare env p_lt M.loc_lt Cfloat.flt e2 e1 | BinOp( Le, e1,e2,_) -> compare env p_leq M.loc_leq Cfloat.fle e1 e2 | BinOp( Ge, e1,e2,_) -> compare env p_leq M.loc_leq Cfloat.fle e2 e1 | _ -> begin match Ctypes.object_of (Cil.typeOf e) with | C_int _ -> p_neq (val_of_exp env e) e_zero | C_float _ -> p_neq (val_of_exp env e) e_zero_real | C_pointer _ -> p_not (M.is_null (loc_of_exp env e)) | obj -> Warning.error "Condition from (%a)" Ctypes.pretty obj end (* -------------------------------------------------------------------------- *) (* --- BootStrapping --- *) (* -------------------------------------------------------------------------- *) let exp env e = Context.with_current_loc e.eloc (exp_protected env) e let cond env e = Context.with_current_loc e.eloc (cond_node env) e let call env e = Context.with_current_loc e.eloc (call_node env) e let result env tr = function | R_var x -> F.e_var x | R_loc l -> cval (M.load env (Ctypes.object_of tr) l) let return env tr e = cval (cast tr (Cil.typeOf e) (exp env e)) let () = s_exp := exp let () = s_cond := cond let instance_of floc kf = M.loc_eq floc (M.cvar (Kernel_function.get_vi kf)) (* -------------------------------------------------------------------------- *) (* --- Initializers --- *) (* -------------------------------------------------------------------------- *) let unchanged sa sb v = let obj = Ctypes.object_of v.vtype in let loc = M.cvar v in let va = M.load sa obj loc in let vb = M.load sb obj loc in equal_obj obj va vb let init_value ~sigma lv typ init = let obj = Ctypes.object_of typ in let outcome = Warning.catch ~severe:false ~effect:"Skip initializer" (fun () -> let l = lval sigma lv in match init with | Some e -> let v = M.load sigma obj l in p_equal (val_of_exp sigma e) (cval v) | None -> is_zero sigma obj l ) () in match outcome with | Warning.Failed warn -> warn , F.p_true | Warning.Result(warn , hyp) -> warn , hyp let init_range ~sigma lv typ a b value = let obj = Ctypes.object_of typ in let outcome = Warning.catch ~severe:false ~effect:"Skip initializer" (fun () -> let l = lval sigma lv in let e = Extlib.opt_map (exp sigma) value in is_exp_range sigma l obj (e_bigint a) (e_bigint b) e ) () in match outcome with | Warning.Failed warn -> warn , F.p_true | Warning.Result(warn , hyp) -> warn , hyp type warned_hyp = Warning.Set.t * Lang.F.pred (* Hypothesis for initialization of one variable *) let rec init_variable ~sigma lv init acc = match init with | SingleInit exp -> init_value ~sigma lv (Cil.typeOfLval lv) (Some exp) :: acc | CompoundInit ( ct , initl ) -> let ct = constfold_ctyp ct in let acc = (* updated acc with default init of structure *) match ct with | TComp (cp,_,_) when cp.cstruct && (* not for union... *) (List.length initl) < (List.length cp.cfields) -> (* default init for unintialized field of a struct *) List.fold_left (fun acc f -> if List.exists (function | Field(g,_),_ -> Fieldinfo.equal f g | _ -> WpLog.fatal "Kernel invariant broken into an initializer") initl then acc else let init = init_value ~sigma (Cil.addOffsetLval (Field(f, NoOffset)) lv) f.ftype None in init :: acc) acc (List.rev cp.cfields) | _ -> acc in match ct with | TArray (ty,len,_,_) -> let delayed = match len with (* number of required elements *) | Some {enode = (Const CInt64 (size,_,_))} -> (size, None) | _ -> (* CIL invariant broken. *) WpLog.fatal "CIL invariant broken: unknown initialized array size" in let make_quant acc = function (* adds delayed initializations from info about the last consecutive indices having the same value, but that have not yet initialized. *) | (_,None) -> acc (* nothing was delayed *) | (il,Some (i0,_,exp)) when Integer.lt il i0 -> (* Added pred: \forall i \in [il .. i0] ; t[i]==exp *) let i2 = Integer.succ i0 in init_range ~sigma lv ty il i2 (Some exp) :: acc | (_il,Some (_i0,off,exp)) -> (* case [_il=_i0], so uses [off] corresponding to [_i0] Added pred: t[i]==exp*) let lv = Cil.addOffsetLval off lv in init_value ~sigma lv ty (Some exp) :: acc in let add_missing_indices acc i0 = function (* adds eventual default value for missing indices. *) | (i1, _) -> if Integer.ge i0 i1 then (* no hole *) acc else (* defaults values Added pred: \forall i \in [i0 .. i1[ ; t[i]==default *) init_range ~sigma lv ty i0 i1 None :: acc in let acc, delayed = List.fold_left (fun (acc,delayed) (off,init) -> let off = constfold_coffset off in let idx,acc = match off with | Index({enode=Const CInt64 (idx,_,_)}, _) -> (match delayed with | (iprev, _) when Integer.lt iprev idx -> (* CIL invariant broken. without that invariant, an algo with a 2sd pass is required for introducing default values *) WpLog.fatal "CIL invariant broken: unordered initializer"; | _ -> ()) ; idx, (* adds default values for missing indices *) add_missing_indices acc (Integer.succ idx) delayed | _ -> (* CIL invariant broken. *) WpLog.fatal "CIL invariant broken: unknown initialized index" in match off, init with (* only simple init can be delayed *) | Index(_, NoOffset), SingleInit init -> begin match delayed with | (i_prev,(Some (_,_,init_delayed) as delayed_info)) when Wp_parameters.InitWithForall.get () && Integer.equal (Integer.pred i_prev) idx && ExpStructEq.equal init_delayed init -> acc, (idx,delayed_info) | _ -> (* flush the delayed init, and store the new one *) let acc = make_quant acc delayed in acc, (idx, Some (idx,off,init)) end | Index(_, _),_ -> (* flush the delayed init, and adds the current one *) let acc = make_quant acc delayed in let lv = Cil.addOffsetLval off lv in (init_variable ~sigma lv init acc), (idx, None) | _ -> WpLog.fatal "CIL invariant broken: not an index" ) (acc,delayed) (List.rev initl) in let acc = make_quant acc delayed in add_missing_indices acc Integer.zero delayed | _ -> List.fold_left (fun acc (off,init) -> let lv = Cil.addOffsetLval off lv in init_variable ~sigma lv init acc) acc (List.rev initl) let init ~sigma v = function | None -> [init_value ~sigma (Cil.var v) v.vtype None] | Some init -> List.rev (init_variable ~sigma (Cil.var v) init []) end ������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/CodeSemantics.mli�����������������������������������������������0000666�0000000�0000000�00000003612�13571573400�017337� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- C-Code Translation --- *) (* -------------------------------------------------------------------------- *) module Make(M : Sigs.Model) : Sigs.CodeSemantics with module M = M ����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Conditions.ml���������������������������������������������������0000666�0000000�0000000�00000162360�13571573400�016564� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Weakest Pre Accumulator --- *) (* -------------------------------------------------------------------------- *) open Qed.Logic open Cil_types open Lang open Lang.F let dkey_pruning = Wp_parameters.register_category "pruning" (* -------------------------------------------------------------------------- *) (* --- Category --- *) (* -------------------------------------------------------------------------- *) type category = | EMPTY (** Empty Sequence, equivalent to True, but with State. *) | TRUE (** Logically equivalent to True *) | FALSE (** Logically equivalent to False *) | MAYBE (** Any Hypothesis *) let c_and c1 c2 = match c1 , c2 with | FALSE , _ | _ , FALSE -> FALSE | MAYBE , _ | _ , MAYBE -> MAYBE | TRUE , _ | _ , TRUE -> TRUE | EMPTY , EMPTY -> EMPTY let c_or c1 c2 = match c1 , c2 with | FALSE , FALSE -> FALSE | EMPTY , EMPTY -> EMPTY | TRUE , TRUE -> TRUE | _ -> MAYBE let rec cfold_and a f = function | [] -> a | e::es -> cfold_and (c_and a (f e)) f es let rec cfold_or a f = function | [] -> a | e::es -> cfold_or (c_or a (f e)) f es let c_conj f es = cfold_and EMPTY f es let c_disj f = function [] -> FALSE | e::es -> cfold_or (f e) f es (* -------------------------------------------------------------------------- *) (* --- Datatypes --- *) (* -------------------------------------------------------------------------- *) type step = { mutable id : int ; (* step identifier *) size : int ; (* number of conditions *) vars : Vars.t ; stmt : stmt option ; descr : string option ; deps : Property.t list ; warn : Warning.Set.t ; condition : condition ; } and sequence = { seq_size : int ; seq_vars : Vars.t ; seq_core : Pset.t ; seq_catg : category ; seq_list : step list ; } and condition = | Type of pred | Have of pred | When of pred | Core of pred | Init of pred | Branch of pred * sequence * sequence | Either of sequence list | State of Mstate.state (* -------------------------------------------------------------------------- *) (* --- Variable Utilities --- *) (* -------------------------------------------------------------------------- *) let vars_seqs w = List.fold_left (fun xs s -> Vars.union xs s.seq_vars) Vars.empty w let vars_list s = List.fold_left (fun xs s -> Vars.union xs s.vars) Vars.empty s let size_list s = List.fold_left (fun n s -> n + s.size) 0 s let vars_cond = function | Type q | When q | Have q | Core q | Init q -> F.varsp q | Branch(p,sa,sb) -> Vars.union (F.varsp p) (Vars.union sa.seq_vars sb.seq_vars) | Either cases -> vars_seqs cases | State _ -> Vars.empty let size_cond = function | Type _ | When _ | Have _ | Core _ | Init _ | State _ -> 1 | Branch(_,sa,sb) -> 1 + sa.seq_size + sb.seq_size | Either cases -> List.fold_left (fun n s -> n + s.seq_size) 1 cases let vars_hyp hs = hs.seq_vars let vars_seq (hs,g) = Vars.union (F.varsp g) hs.seq_vars (* -------------------------------------------------------------------------- *) (* --- Core Utilities --- *) (* -------------------------------------------------------------------------- *) let is_core p = match F.e_expr p with (* | Qed.Logic.Eq (a,b) -> is_def a && is_def b *) | Qed.Logic.Eq _ -> true | _ -> false let rec add_core s p = match F.p_expr p with | Qed.Logic.And ps -> List.fold_left add_core Pset.empty ps | _ -> if is_core p then Pset.add p s else s let core_cond = function | Type _ | State _ -> Pset.empty | Have p | When p | Core p | Init p -> add_core Pset.empty p | Branch(_,sa,sb) -> Pset.inter sa.seq_core sb.seq_core | Either [] -> Pset.empty | Either (c::cs) -> List.fold_left (fun w s -> Pset.inter w s.seq_core) c.seq_core cs let add_core_step ps s = Pset.union ps (core_cond s.condition) let core_list s = List.fold_left add_core_step Pset.empty s (* -------------------------------------------------------------------------- *) (* --- Category --- *) (* -------------------------------------------------------------------------- *) let catg_seq s = s.seq_catg let catg_cond = function | State _ -> TRUE | Have p | Type p | When p | Core p | Init p -> begin match F.is_ptrue p with | No -> FALSE | Maybe -> MAYBE | Yes -> EMPTY end | Either cs -> c_disj catg_seq cs | Branch(_,a,b) -> c_or a.seq_catg b.seq_catg let catg_step s = catg_cond s.condition let catg_list l = c_conj catg_step l (* -------------------------------------------------------------------------- *) (* --- Sequence Constructor --- *) (* -------------------------------------------------------------------------- *) let sequence l = { seq_size = size_list l ; seq_vars = vars_list l ; seq_core = core_list l ; seq_catg = catg_list l ; seq_list = l ; } (* -------------------------------------------------------------------------- *) (* --- Sequence Comparator --- *) (* -------------------------------------------------------------------------- *) let rec equal_cond ca cb = match ca,cb with | State _ , State _ -> true | Type p , Type q | Have p , Have q | When p , When q | Core p , Core q | Init p , Init q -> p == q | Branch(p,a,b) , Branch(q,a',b') -> p == q && equal_seq a a' && equal_seq b b' | Either u, Either v -> Qed.Hcons.equal_list equal_seq u v | State _ , _ | _ , State _ | Type _ , _ | _ , Type _ | Have _ , _ | _ , Have _ | When _ , _ | _ , When _ | Core _ , _ | _ , Core _ | Init _ , _ | _ , Init _ | Branch _ , _ | _ , Branch _ -> false and equal_step a b = equal_cond a.condition b.condition and equal_list sa sb = Qed.Hcons.equal_list equal_step sa sb and equal_seq sa sb = equal_list sa.seq_list sb.seq_list (* -------------------------------------------------------------------------- *) (* --- Core Inference --- *) (* -------------------------------------------------------------------------- *) module Core = struct let rec fpred core p = match F.p_expr p with | Qed.Logic.And ps -> F.p_conj (List.map (fpred core) ps) | _ -> if Pset.mem p core then p_true else p let fcond core = function | Core p -> Core (fpred core p) | Have p -> Have (fpred core p) | When p -> When (fpred core p) | Init p -> Init (fpred core p) | (Type _ | Branch _ | Either _ | State _) as cond -> cond let fstep core step = let condition = fcond core step.condition in let vars = vars_cond condition in { step with condition ; vars } let factorize a b = if Wp_parameters.Core.get () then let core = Pset.inter a.seq_core b.seq_core in if Pset.is_empty core then None else let ca = List.map (fstep core) a.seq_list in let cb = List.map (fstep core) b.seq_list in Some (F.p_conj (Pset.elements core) , sequence ca , sequence cb) else None end (* -------------------------------------------------------------------------- *) (* --- Bundle (non-simplified conditions) --- *) (* -------------------------------------------------------------------------- *) module Bundle : sig type t val empty : t val vars : t -> Vars.t val is_empty : t -> bool val category : t -> category val add : step -> t -> t val factorize : t -> t -> t * t * t val big_inter : t list -> t val diff : t -> t -> t val head : t -> Mstate.state option val freeze: ?join:step -> t -> sequence val map : (condition -> 'a) -> t -> 'a list end = struct module SEQ = Qed.Listset.Make (struct type t = int * step let equal (k1,_) (k2,_) = k1 = k2 let compare (k1,s1) (k2,s2) = let rank = function | Type _ -> 0 | When _ -> 1 | _ -> 2 in let r = rank s1.condition - rank s2.condition in if r = 0 then Transitioning.Stdlib.compare k2 k1 else r end) type t = Vars.t * SEQ.t let vars = fst let cid = ref 0 let fresh () = incr cid ; assert (!cid > 0) ; !cid let add s (xs,t) = Vars.union xs s.vars , SEQ.add (fresh (),s) t let empty = Vars.empty , [] let is_empty = function (_,[]) -> true | _ -> false let head = function _,(_,{ condition = State s }) :: _ -> Some s | _ -> None let build seq = let xs = List.fold_left (fun xs (_,s) -> Vars.union xs s.vars) Vars.empty seq in xs , seq let factorize (_,a) (_,b) = let l,m,r = SEQ.factorize a b in build l , build m , build r let big_inter cs = build (SEQ.big_inter (List.map snd cs)) let diff (_,a) (_,b) = build (SEQ.diff a b) let freeze ?join (seq_vars,bundle) = let seq = List.map snd bundle in let seq_list = match join with None -> seq | Some s -> seq @ [s] in let seq_size = size_list seq in let seq_catg = catg_list seq in { seq_size ; seq_vars ; seq_core = Pset.empty ; seq_catg ; seq_list } let map f b = List.map (fun (_,s) -> f s.condition) (snd b) let category (_,bundle) = c_conj (fun (_,s) -> catg_step s) bundle end (* -------------------------------------------------------------------------- *) (* --- Hypotheses --- *) (* -------------------------------------------------------------------------- *) type bundle = Bundle.t type sequent = sequence * F.pred let pretty = ref (fun _fmt _seq -> ()) let is_true = function { seq_catg = TRUE | EMPTY } -> true | _ -> false let is_empty = function { seq_catg = EMPTY } -> true | _ -> false let is_absurd_h h = match h.condition with | (Core p | When p | Have p) -> p == F.p_false | _ -> false let is_trivial_h h = match h.condition with | State _ -> false | (Type p | Core p | When p | Have p | Init p) -> p == F.p_true | Branch(_,a,b) -> is_true a && is_true b | Either w -> List.for_all is_true w let is_trivial_hs_p hs p = p == F.p_true || List.exists is_absurd_h hs let is_trivial_hsp (hs,p) = is_trivial_hs_p hs p let is_trivial (s:sequent) = is_trivial_hs_p (fst s).seq_list (snd s) (* -------------------------------------------------------------------------- *) (* --- Extraction --- *) (* -------------------------------------------------------------------------- *) let rec pred_cond = function | State _ -> F.p_true | When p | Type p | Have p | Core p | Init p -> p | Branch(p,a,b) -> F.p_if p (pred_seq a) (pred_seq b) | Either cases -> F.p_any pred_seq cases and pred_seq seq = F.p_all (fun s -> pred_cond s.condition) seq.seq_list let extract bundle = Bundle.map pred_cond bundle let bundle = Bundle.freeze ?join:None let intersect p bundle = Vars.intersect (F.varsp p) (Bundle.vars bundle) let occurs x bundle = Vars.mem x (Bundle.vars bundle) (* -------------------------------------------------------------------------- *) (* --- Constructors --- *) (* -------------------------------------------------------------------------- *) let nil = Bundle.empty let noid = (-1) let step ?descr ?stmt ?(deps=[]) ?(warn=Warning.Set.empty) cond = { id = noid ; size = size_cond cond ; vars = vars_cond cond ; stmt = stmt ; descr = descr ; warn = warn ; deps = deps ; condition = cond ; } let update_cond ?descr ?(deps=[]) ?(warn=Warning.Set.empty) h c = let descr = match h.descr, descr with | None, _ -> descr ; | Some _, None -> h.descr ; | Some decr1, Some descr2 -> Some (decr1 ^ "-" ^ descr2) in { id = noid ; condition = c ; stmt = h.stmt ; size = size_cond c ; vars = vars_cond c ; descr = descr ; deps = deps@h.deps ; warn = Warning.Set.union h.warn warn ; } type 'a disjunction = D_TRUE | D_FALSE | D_EITHER of 'a list let disjunction phi es = let positives = ref false in (* TRUE or EMPTY items *) let remains = List.filter (fun e -> match phi e with | TRUE | EMPTY -> positives := true ; false | MAYBE -> true | FALSE -> false ) es in match remains with | [] -> if !positives then D_TRUE else D_FALSE | cs -> D_EITHER cs (* -------------------------------------------------------------------------- *) (* --- Prenex-Form Introduction --- *) (* -------------------------------------------------------------------------- *) let prenex_intro p = try let open Qed.Logic in (* invariant: xs <> []; result <-> forall xs, hs -> p *) let rec walk hs xs p = match F.p_expr p with | Imply(h,p) -> walk (h::hs) xs p | Bind(Forall,_,_) -> bind hs xs p | _ -> if hs = [] then raise Exit ; F.p_forall (List.rev xs) (F.p_hyps (List.concat hs) p) (* invariant: result <-> forall hs xs (\tau.bind) *) and bind hs xs p = let pool = Lang.get_pool () in let ctx,t = e_open ~pool ~forall:true ~exists:false ~lambda:false (e_prop p) in let xs = List.fold_left (fun xs (_,x) -> x::xs) xs (List.rev ctx) in walk hs xs (F.p_bool t) (* invariant: result <-> p *) and crawl p = match F.p_expr p with | Imply(h,p) -> F.p_hyps h (crawl p) | Bind(Forall,_,_) -> bind [] [] p | _ -> raise Exit in crawl p with Exit -> p (* -------------------------------------------------------------------------- *) (* --- Existential Introduction --- *) (* -------------------------------------------------------------------------- *) let rec exist_intro p = let open Qed.Logic in match F.p_expr p with | And ps -> F.p_all exist_intro ps | Bind(Exists,_,_) -> let pool = Lang.get_pool () in let _,t = e_open ~pool ~exists:true ~forall:false ~lambda:false (e_prop p) in exist_intro (F.p_bool t) | _ -> if Wp_parameters.Prenex.get () then prenex_intro p else p let rec exist_intros = function | [] -> [] | p::hs -> begin let open Qed.Logic in match F.p_expr p with | And ps -> exist_intros (ps@hs) | Bind(Exists,_,_) -> let pool = Lang.get_pool () in let _,t = F.QED.e_open ~pool ~exists:true ~forall:false ~lambda:false (e_prop p) in exist_intros ((F.p_bool t)::hs) | _ -> p::(exist_intros hs) end (* -------------------------------------------------------------------------- *) (* --- Universal Introduction --- *) (* -------------------------------------------------------------------------- *) let rec forall_intro p = let open Qed.Logic in match F.p_expr p with | Bind(Forall,_,_) -> let pool = Lang.get_pool () in let _,t = F.QED.e_open ~pool ~forall:true ~exists:false ~lambda:false (e_prop p) in forall_intro (F.p_bool t) | Imply(hs,p) -> let hs = exist_intros hs in let hp,p = forall_intro p in hs @ hp , p | Or qs -> (* analogy with Imply *) let hps,ps = List.fold_left (fun (hs,ps) q -> let hp,p = forall_intro q in (* q <==> (hp ==> p) *) (hp @ hs), (p::ps)) ([],[]) qs in (* ORs qs <==> ORs (hps ==> ps) <==> ((ANDs hps) ==> ORs ps) *) hps, (p_disj ps) | _ -> [] , p (* -------------------------------------------------------------------------- *) (* --- Constructors --- *) (* -------------------------------------------------------------------------- *) type 'a attributed = ( ?descr:string -> ?stmt:stmt -> ?deps:Property.t list -> ?warn:Warning.Set.t -> 'a ) let domain ps hs = if ps = [] then hs else Bundle.add (step (Type (p_conj ps))) hs let intros ps hs = if ps = [] then hs else let p = F.p_all exist_intro ps in Bundle.add (step ~descr:"Goal" (When p)) hs let state ?descr ?stmt state hs = let cond = State state in let s = step ?descr ?stmt cond in Bundle.add s hs let assume ?descr ?stmt ?deps ?warn ?(init=false) p hs = match F.is_ptrue p with | Yes -> hs | No -> let cond = if init then Init p else Have p in let s = step ?descr ?stmt ?deps ?warn cond in Bundle.add s Bundle.empty | Maybe -> begin match Bundle.category hs with | MAYBE | TRUE | EMPTY -> let p = exist_intro p in let cond = if init then Init p else Have p in let s = step ?descr ?stmt ?deps ?warn cond in Bundle.add s hs | FALSE -> hs end let join = function None -> None | Some s -> Some (step (State s)) let branch ?descr ?stmt ?deps ?warn p ha hb = match F.is_ptrue p with | Yes -> ha | No -> hb | Maybe -> match Bundle.category ha , Bundle.category hb with | TRUE , TRUE -> Bundle.empty | _ , FALSE -> assume ?descr ?stmt ?deps ?warn p ha | FALSE , _ -> assume ?descr ?stmt ?deps ?warn (p_not p) hb | _ -> let ha,hs,hb = Bundle.factorize ha hb in if Bundle.is_empty ha && Bundle.is_empty hb then hs else let join = join (Bundle.head hs) in let a = Bundle.freeze ?join ha in let b = Bundle.freeze ?join hb in let s = step ?descr ?stmt ?deps ?warn (Branch(p,a,b)) in Bundle.add s hs let either ?descr ?stmt ?deps ?warn cases = match disjunction Bundle.category cases with | D_TRUE -> Bundle.empty | D_FALSE -> let s = step ?descr ?stmt ?deps ?warn (Have p_false) in Bundle.add s Bundle.empty | D_EITHER cases -> let trunk = Bundle.big_inter cases in let cases = List.map (fun case -> Bundle.diff case trunk) cases in match disjunction Bundle.category cases with | D_TRUE -> trunk | D_FALSE -> let s = step ?descr ?stmt ?deps ?warn (Have p_false) in Bundle.add s Bundle.empty | D_EITHER cases -> let cases = List.map Bundle.freeze cases in let s = step ?descr ?stmt ?deps ?warn (Either cases) in Bundle.add s trunk let merge cases = either ~descr:"Merge" cases (* -------------------------------------------------------------------------- *) (* --- Flattening --- *) (* -------------------------------------------------------------------------- *) let rec flat_catg = function | [] -> EMPTY | s::cs -> match catg_step s with | EMPTY -> flat_catg cs | r -> r let flat_cons step tail = match flat_catg tail with | FALSE -> tail | _ -> step :: tail let flat_concat head tail = match flat_catg head with | EMPTY -> tail | FALSE -> head | MAYBE|TRUE -> match flat_catg tail with | EMPTY -> head | FALSE -> tail | MAYBE|TRUE -> head @ tail let core_residual step core = { id = noid ; size = 1 ; vars = F.varsp core ; condition = Core core ; descr = None ; warn = Warning.Set.empty ; deps = [] ; stmt = step.stmt ; } let core_branch step p a b = let condition = match a.seq_catg , b.seq_catg with | (TRUE | EMPTY) , (TRUE|EMPTY) -> Have p_true | _ -> Branch(p,a,b) in update_cond step condition let rec flatten_sequence m = function | [] -> [] | step :: seq -> match step.condition with | State _ -> flat_cons step (flatten_sequence m seq) | Have p | Type p | When p | Core p | Init p -> begin match F.is_ptrue p with | Yes -> m := true ; flatten_sequence m seq | No -> (* FALSE context *) if seq <> [] then m := true ; [step] | Maybe -> flat_cons step (flatten_sequence m seq) end | Branch(p,a,b) -> begin match F.is_ptrue p with | Yes -> m := true ; flat_concat a.seq_list (flatten_sequence m seq) | No -> m := true ; flat_concat b.seq_list (flatten_sequence m seq) | Maybe -> let sa = a.seq_list in let sb = b.seq_list in match a.seq_catg , b.seq_catg with | (TRUE|EMPTY) , (TRUE|EMPTY) -> m := true ; flatten_sequence m seq | _ , FALSE -> m := true ; let step = update_cond step (Have p) in step :: sa @ flatten_sequence m seq | FALSE , _ -> m := true ; let step = update_cond step (Have (p_not p)) in step :: sb @ flatten_sequence m seq | _ -> begin match Core.factorize a b with | None -> step :: flatten_sequence m seq | Some( core , a , b ) -> m := true ; let score = core_residual step core in let scond = core_branch step p a b in score :: scond :: flatten_sequence m seq end end | Either [] -> (* FALSE context *) if seq <> [] then m := true ; [step] | Either cases -> match disjunction catg_seq cases with | D_TRUE -> m := true ; flatten_sequence m seq | D_FALSE -> m := true ; [ update_cond step (Have p_false) ] | D_EITHER [hc] -> m := true ; flat_concat hc.seq_list (flatten_sequence m seq) | D_EITHER cs -> let step = update_cond step (Either cs) in flat_cons step (flatten_sequence m seq) (* -------------------------------------------------------------------------- *) (* --- Mapping --- *) (* -------------------------------------------------------------------------- *) let lift f e = F.e_prop (f (F.p_bool e)) let rec map_condition f = function | State s -> State (Mstate.apply (lift f) s) | Have p -> Have (f p) | Type p -> Type (f p) | When p -> When (f p) | Core p -> Core (f p) | Init p -> Init (f p) | Branch(p,a,b) -> Branch(f p,map_sequence f a,map_sequence f b) | Either cs -> Either (List.map (map_sequence f) cs) and map_step f h = update_cond h (map_condition f h.condition) and map_steplist f = function | [] -> [] | h::hs -> let h = map_step f h in let hs = map_steplist f hs in if is_trivial_h h then hs else h :: hs and map_sequence f s = sequence (map_steplist f s.seq_list) and map_sequent f (hs,g) = map_sequence f hs , f g (* -------------------------------------------------------------------------- *) (* --- Ground Simplifier --- *) (* -------------------------------------------------------------------------- *) module Ground = Letify.Ground let rec ground_flow ~fwd env h = match h.condition with | State s -> let s = Mstate.apply (Ground.e_apply env) s in update_cond h (State s) | Type _ | Have _ | When _ | Core _ | Init _ -> let phi = if fwd then Ground.forward else Ground.backward in let cond = map_condition (phi env) h.condition in update_cond h cond | Branch(p,a,b) -> let p,wa,wb = Ground.branch env p in let a = ground_flowseq ~fwd wa a in let b = ground_flowseq ~fwd wb b in update_cond h (Branch(p,a,b)) | Either ws -> let ws = List.map (fun w -> ground_flowseq ~fwd (Ground.copy env) w) ws in update_cond h (Either ws) and ground_flowseq ~fwd env hs = sequence (ground_flowlist ~fwd env hs.seq_list) and ground_flowlist ~fwd env hs = if fwd then ground_flowdir ~fwd env hs else List.rev (ground_flowdir ~fwd env (List.rev hs)) and ground_flowdir ~fwd env = function | [] -> [] | h::hs -> let h = ground_flow ~fwd env h in let hs = ground_flowdir ~fwd env hs in if is_trivial_h h then hs else h :: hs let ground (hs,g) = let hs = ground_flowlist ~fwd:true (Ground.top ()) hs in let hs = ground_flowlist ~fwd:false (Ground.top ()) hs in let env = Ground.top () in let hs = ground_flowlist ~fwd:true env hs in hs , Ground.p_apply env g (* -------------------------------------------------------------------------- *) (* --- Letify --- *) (* -------------------------------------------------------------------------- *) module Sigma = Letify.Sigma module Defs = Letify.Defs let used_of_dseq ds = Array.fold_left (fun ys (_,step) -> Vars.union ys step.vars) Vars.empty ds let bind_dseq target (di,_) sigma = Letify.bind (Letify.bind sigma di target) di (Defs.domain di) let locals sigma ~target ~required ?(step=Vars.empty) k dseq = (* returns ( target , export ) *) let t = ref target in let e = ref (Vars.union required step) in Array.iteri (fun i (_,step) -> if i > k then t := Vars.union !t step.vars ; if i <> k then e := Vars.union !e step.vars ; ) dseq ; Vars.diff !t (Sigma.domain sigma) , !e let dseq_of_step sigma step = let defs = match step.condition with | Init p | Have p | When p | Core p -> Defs.extract (Sigma.p_apply sigma p) | Type _ | Branch _ | Either _ | State _ -> Defs.empty in defs , step let letify_assume sref (_,step) = let current = !sref in begin match step.condition with | Type _ | Branch _ | Either _ | State _ -> () | Init p | Have p | When p | Core p -> if Wp_parameters.Simpl.get () then sref := Sigma.assume current p end ; current [@@@ warning "-32"] let rec letify_type sigma used p = match F.p_expr p with | And ps -> p_all (letify_type sigma used) ps | _ -> let p = Sigma.p_apply sigma p in if Vars.intersect used (F.varsp p) then p else F.p_true [@@@ warning "+32"] let rec letify_seq sigma0 ~target ~export (seq : step list) = let dseq = Array.map (dseq_of_step sigma0) (Array.of_list seq) in let sigma1 = Array.fold_right (bind_dseq target) dseq sigma0 in let sref = ref sigma1 in (* with definitions *) let dsigma = Array.map (letify_assume sref) dseq in let sigma2 = !sref in (* with assumptions *) let outside = Vars.union export target in let inside = used_of_dseq dseq in let used = Vars.diff (Vars.union outside inside) (Sigma.domain sigma2) in let required = Vars.union outside (Sigma.codomain sigma2) in let sequence = Array.mapi (letify_step dseq dsigma ~used ~required ~target) dseq in let modified = ref (not (Sigma.equal sigma0 sigma1)) in (* let sequence = if Wp_parameters.Ground.get () then fst (ground_hrp sequence) else sequence in *) let sequence = flatten_sequence modified (Array.to_list sequence) in !modified , sigma1 , sigma2 , sequence and letify_step dseq dsigma ~required ~target ~used i (d,s) = let sigma = dsigma.(i) in let cond = match s.condition with | State s -> State (Mstate.apply (Sigma.e_apply sigma) s) | Init p -> let p = Sigma.p_apply sigma p in let ps = Letify.add_definitions sigma d required [p] in Init (p_conj ps) | Have p -> let p = Sigma.p_apply sigma p in let ps = Letify.add_definitions sigma d required [p] in Have (p_conj ps) | Core p -> let p = Sigma.p_apply sigma p in let ps = Letify.add_definitions sigma d required [p] in Core (p_conj ps) | When p -> let p = Sigma.p_apply sigma p in let ps = Letify.add_definitions sigma d required [p] in When (p_conj ps) | Type p -> Type (letify_type sigma used p) | Branch(p,a,b) -> let p = Sigma.p_apply sigma p in let step = F.varsp p in let (target,export) = locals sigma ~target ~required ~step i dseq in let sa = Sigma.assume sigma p in let sb = Sigma.assume sigma (p_not p) in let a = letify_case sa ~target ~export a in let b = letify_case sb ~target ~export b in Branch(p,a,b) | Either cases -> let (target,export) = locals sigma ~target ~required i dseq in Either (List.map (letify_case sigma ~target ~export) cases) in update_cond s cond and letify_case sigma ~target ~export seq = let (_,_,_,s) = letify_seq sigma ~target ~export seq.seq_list in sequence s (* -------------------------------------------------------------------------- *) (* --- External Simplifier --- *) (* -------------------------------------------------------------------------- *) let simplify_exp solvers e = List.fold_left (fun e s -> s#simplify_exp e) e solvers let simplify_goal solvers p = List.fold_left (fun p s -> s#simplify_goal p) p solvers let simplify_hyp solvers p = List.fold_left (fun p s -> s#simplify_hyp p) p solvers let simplify_branch solvers p = List.fold_left (fun p s -> s#simplify_branch p) p solvers let apply_hyp modified solvers h = let simple p = let p' = simplify_hyp solvers p in if not (Lang.F.eqp p p') then modified := true; List.iter (fun s -> s#assume p') solvers; p' in match h.condition with | State s -> update_cond h (State (Mstate.apply (simplify_exp solvers) s)) | Init p -> update_cond h (Init (simple p)) | Type p -> update_cond h (Type (simple p)) | Have p -> update_cond h (Have (simple p)) | When p -> update_cond h (When (simple p)) | Core p -> update_cond h (Core (simple p)) | Branch(p,_,_) -> List.iter (fun s -> s#target p) solvers; h | Either _ -> h let decide_branch modified solvers h = match h.condition with | Branch(p,a,b) -> let q = simplify_branch solvers p in if q != p then ( modified := true ; update_cond h (Branch(q,a,b)) ) else h | _ -> h let add_infer modified s hs = let p = p_conj s#infer in if p != p_true then ( modified := true ; step ~descr:s#name (Have p) :: hs ) else hs type outcome = | NoSimplification | Simplified of hsp | Trivial and hsp = step list * pred let apply_simplifiers (solvers : simplifier list) (hs,g) = if solvers = [] then NoSimplification else try let modified = ref false in let solvers = List.map (fun s -> s#copy) solvers in let hs = List.map (apply_hyp modified solvers) hs in List.iter (fun s -> s#target g) solvers ; List.iter (fun s -> s#fixpoint) solvers ; let hs = List.map (decide_branch modified solvers) hs in let hs = List.fold_right (add_infer modified) solvers hs in let p = simplify_goal solvers g in if p != g || !modified then Simplified (hs,p) else NoSimplification with Contradiction -> Trivial (* -------------------------------------------------------------------------- *) (* --- Sequence Builder --- *) (* -------------------------------------------------------------------------- *) let empty = { seq_size = 0 ; seq_vars = Vars.empty ; seq_core = Pset.empty ; seq_catg = EMPTY ; seq_list = [] ; } let trivial = empty , F.p_true let append sa sb = if sa.seq_size = 0 then sb else if sb.seq_size = 0 then sa else let seq_size = sa.seq_size + sb.seq_size in let seq_vars = Vars.union sa.seq_vars sb.seq_vars in let seq_core = Pset.union sa.seq_core sb.seq_core in let seq_list = sa.seq_list @ sb.seq_list in let seq_catg = c_and sa.seq_catg sb.seq_catg in { seq_size ; seq_vars ; seq_core ; seq_catg ; seq_list } let concat slist = if slist = [] then empty else let seq_size = List.fold_left (fun n s -> n + s.seq_size) 0 slist in let seq_list = List.concat (List.map (fun s -> s.seq_list) slist) in let seq_vars = List.fold_left (fun w s -> Vars.union w s.seq_vars) Vars.empty slist in let seq_core = List.fold_left (fun w s -> Pset.union w s.seq_core) Pset.empty slist in let seq_catg = c_conj catg_seq slist in { seq_size ; seq_vars ; seq_core ; seq_catg ; seq_list } let seq_branch ?stmt p sa sb = sequence [step ?stmt (Branch(p,sa,sb))] (* -------------------------------------------------------------------------- *) (* --- Introduction Utilities --- *) (* -------------------------------------------------------------------------- *) let lemma g = let cc g = let hs,p = forall_intro g in let hs = List.map (fun p -> step (Have p)) hs in sequence hs , p in Lang.local ~vars:(F.varsp g) cc g let introduction (hs,g) = let flag = ref false in let intro p = let q = exist_intro p in if q != p then flag := true ; q in let hj = List.map (map_step intro) hs.seq_list in let hi,p = forall_intro g in let hi = List.map (fun p -> step (Have p)) hi in if not !flag && hi == [] then if p == g then None else Some (hs , p) else Some (sequence (hi @ hj) , p) let introduction_eq s = match introduction s with | Some s' -> s' | None -> s (* -------------------------------------------------------------------------- *) (* --- Constant Folder --- *) (* -------------------------------------------------------------------------- *) module ConstantFolder = struct open Qed type sigma = { mutable cst : bool Tmap.t ; mutable dom : Vars.t ; (* support of defs *) mutable def : term Tmap.t ; (* defs *) mutable cache : F.sigma option ; (* memo *) } let rec is_cst s e = match F.repr e with | True | False | Kint _ | Kreal _ -> true | Fun(_,es) -> begin try Tmap.find e s.cst with Not_found -> let cst = List.for_all (is_cst s) es in s.cst <- Tmap.add e cst s.cst ; cst end | _ -> false let set_def s p a e = try let e0 = Tmap.find a s.def in match F.is_true (F.e_eq e e0) with | Logic.Yes -> () | Logic.No -> raise Contradiction | Logic.Maybe -> if F.compare e e0 < 0 then s.def <- Tmap.add a e s.def with Not_found -> begin s.dom <- Vars.union (F.vars a) s.dom ; s.def <- Tmap.add a e s.def ; s.def <- Tmap.add p p s.def ; s.cache <- None ; end let collect_set_def s p = Lang.iter_consequence_literals (fun literal -> match Lang.F.repr literal with | Logic.Eq(a,b) -> if is_cst s a then set_def s literal b a ; if is_cst s b then set_def s literal a b ; | _ -> ()) p let collect s = function | Have p | When p | Core p | Init p -> collect_set_def s (F.e_prop p) | Type _ | Branch _ | Either _ | State _ -> () let subst s = match s.cache with | Some m -> m | None -> let m = Lang.sigma () in F.Subst.add_map m s.def ; s.cache <- Some m ; m let e_apply s e = F.e_subst (subst s) e let p_apply s p = F.p_subst (subst s) p let rec c_apply s = function | State m -> State (Mstate.apply (e_apply s) m) | Type p -> Type (p_apply s p) | Init p -> Init (p_apply s p) | Have p -> Have (p_apply s p) | When p -> When (p_apply s p) | Core p -> Core (p_apply s p) | Branch(p,sa,sb) -> Branch( p_apply s p , seq_apply s sa , seq_apply s sb ) | Either cs -> Either (List.map (seq_apply s) cs) and s_apply s (step : step) : step = update_cond step (c_apply s step.condition) and seq_apply s seq = sequence (List.map (s_apply s) seq.seq_list) let simplify (hs,p) = let s = { cst = Tmap.empty ; def = Tmap.empty ; dom = Vars.empty ; cache = None ; } in try List.iter (fun h -> collect s h.condition) hs ; let hs = List.map (s_apply s) hs in let p = p_apply s p in hs , p with Contradiction -> [] , F.p_true end (* -------------------------------------------------------------------------- *) (* --- Letify-Fixpoint --- *) (* -------------------------------------------------------------------------- *) let rec fixpoint limit solvers sigma s0 = if limit > 0 then compute limit solvers sigma s0 else s0 and compute limit solvers sigma s0 = !Db.progress (); let s1 = if Wp_parameters.Ground.get () then ground s0 else s0 in let hs,p = ConstantFolder.simplify s1 in let target = F.varsp p in let export = Vars.empty in let modified , sigma1 , sigma2 , hs = letify_seq sigma ~target ~export hs in let p = Sigma.p_apply sigma2 p in let s2 = ground (hs , p) in if is_trivial_hsp s2 then [],p_true else if modified || (limit > 0 && not (equal_list (fst s0) (fst s2))) then fixpoint (pred limit) solvers sigma1 s2 else match apply_simplifiers solvers s2 with | Simplified s3 -> fixpoint (pred limit) solvers sigma1 s3 | Trivial -> [],p_true | NoSimplification -> s2 let letify_hsp ?(solvers=[]) hsp = fixpoint 10 solvers Sigma.empty hsp let rec simplify ?(solvers=[]) ?(intros=10) (seq,p0) = let hs,p = fixpoint 10 solvers Sigma.empty (seq.seq_list,p0) in let sequent = sequence hs , p in match introduction sequent with | Some introduced -> if intros > 0 then simplify ~solvers ~intros:(pred intros) introduced else introduced | None -> sequent (* -------------------------------------------------------------------------- *) (* --- Pruning --- *) (* -------------------------------------------------------------------------- *) let residual p = { id = noid ; size = 1 ; vars = F.varsp p ; stmt = None ; descr = Some "Residual" ; deps = [] ; warn = Warning.Set.empty ; condition = When p ; } let rec add_case p = function | ( { condition = (Type _) } as step ):: tail -> step :: add_case p tail | hs -> residual p :: hs let test_case p (s:hsp) = let w = letify_hsp (add_case p (fst s) , snd s) in if is_trivial_hsp w then None else Some w let tc = ref 0 let rec test_cases (s : hsp) = function | [] -> s | (p,_) :: tail -> !Db.progress () ; match test_case p s , test_case (p_not p) s with | None , None -> incr tc ; [],F.p_true | Some w , None -> incr tc ; test_cases w tail | None , Some w -> incr tc ; test_cases w tail | Some _ , Some _ -> test_cases s tail let rec collect_cond m = function | When _ | Have _ | Type _ | Init _ | Core _ | State _ -> () | Branch(p,a,b) -> Letify.Split.add m p ; collect_seq m a ; collect_seq m b | Either cs -> List.iter (collect_seq m) cs and collect_seq m seq = collect_steps m seq.seq_list and collect_steps m steps = List.iter (fun s -> collect_cond m s.condition) steps let pruning ?(solvers=[]) seq = if is_trivial seq then seq else begin let hs = (fst seq).seq_list in let p = snd seq in ignore solvers ; let m = Letify.Split.create () in collect_steps m hs ; tc := 0 ; let hsp = test_cases (hs,p) (Letify.Split.select m) in if !tc > 0 && Wp_parameters.has_dkey dkey_pruning then if is_trivial_hsp hsp then Wp_parameters.feedback "[Pruning] Trivial" else Wp_parameters.feedback "[Pruning] %d branche(s) removed" !tc ; let hs,p = hsp in sequence hs , p end (* -------------------------------------------------------------------------- *) (* --- Cleaning --- *) (* -------------------------------------------------------------------------- *) let rec collect_cond u = function | State _ -> () | When p -> Cleaning.as_have u p | Have p -> Cleaning.as_have u p | Core p -> Cleaning.as_have u p | Type p -> Cleaning.as_type u p | Init p -> Cleaning.as_init u p | Branch(p,a,b) -> Cleaning.as_atom u p ; collect_seq u a ; collect_seq u b | Either cs -> List.iter (collect_seq u) cs and collect_seq u seq = collect_steps u seq.seq_list and collect_steps u steps = List.iter (fun s -> collect_cond u s.condition) steps let rec clean_cond u = function | State _ as cond -> cond | When p -> When (Cleaning.filter_pred u p) | Have p -> Have (Cleaning.filter_pred u p) | Core p -> Core (Cleaning.filter_pred u p) | Type p -> Type (Cleaning.filter_pred u p) | Init p -> Init (Cleaning.filter_pred u p) | Branch(p,a,b) -> Branch(p,clean_seq u a,clean_seq u b) | Either cases -> Either(List.map (clean_seq u) cases) and clean_seq u s = let s = clean_steps u s.seq_list in { seq_size = size_list s ; seq_vars = vars_list s ; seq_core = Pset.empty ; seq_catg = catg_list s ; seq_list = s } and clean_steps u = function | [] -> [] | s :: seq -> let c = clean_cond u s.condition in let seq = clean_steps u seq in match catg_cond c with | EMPTY -> seq | FALSE -> [update_cond s c] | TRUE | MAYBE -> update_cond s c :: seq let clean (s,p) = let u = Cleaning.create () in Cleaning.as_atom u p ; collect_steps u s.seq_list ; sequence (clean_steps u s.seq_list) , p (* -------------------------------------------------------------------------- *) (* --- Filter Used Variables --- *) (* -------------------------------------------------------------------------- *) module Filter = struct module Gmap = Qed.Mergemap.Make(Fun) module Gset = Qed.Mergeset.Make(Fun) module Fset = Qed.Mergeset.Make(Field) module FP = struct type t = Gset.t * Fset.t let empty = Gset.empty , Fset.empty let union (a,u) (b,v) = Gset.union a b , Fset.union u v let subset (a,u) (b,v) = Gset.subset a b && Fset.subset u v let intersect (a,u) (b,v) = Gset.intersect a b || Fset.intersect u v end type used = { mutable fixpoint : bool ; mutable footprint : FP.t Tmap.t ; (* memoized by terms *) mutable footcalls : Fset.t Gmap.t ; (* memorized by function *) mutable gs : FP.t ; (* used in sequent *) mutable xs : Vars.t ; (* used in sequent *) } [@@@ warning "-32"] let pp_gset fmt (u,v) = begin Format.fprintf fmt "@[<hov 2>{" ; Gset.iter (fun f -> Format.fprintf fmt "@ %a" Lang.Fun.pretty f) u ; Format.fprintf fmt "," ; Fset.iter (fun f -> Format.fprintf fmt "@ %a" Lang.Field.pretty f) v ; Format.fprintf fmt " }@]" ; end let pp_used fmt used = begin Format.fprintf fmt "@[<hov 2>{" ; Vars.iter (fun x -> Format.fprintf fmt "@ %a" Lang.F.Var.pretty x) used.xs ; Format.fprintf fmt "," ; Gset.iter (fun f -> Format.fprintf fmt "@ %a" Lang.Fun.pretty f) (fst used.gs) ; Format.fprintf fmt "," ; Fset.iter (fun f -> Format.fprintf fmt "@ %a" Lang.Field.pretty f) (snd used.gs) ; Format.fprintf fmt " }@]" ; end [@@@ warning "+32"] let fsetmap phi es = List.fold_left (fun fs e -> Fset.union fs (phi e)) Fset.empty es let rec gvars_of_term m t = try Tmap.find t m.footprint with Not_found -> match F.repr t with | Fun(f,[]) -> Gset.singleton f , Fset.empty | Fun(f,_) -> Gset.empty , fset_of_lfun m f | Rget(_,fd) -> Gset.empty , Fset.singleton fd | Rdef fts -> Gset.empty , List.fold_left (fun fs (f,_) -> Fset.add f fs) Fset.empty fts | _ -> let gs = ref FP.empty in let collect m gs e = gs := FP.union !gs (gvars_of_term m e) in F.lc_iter (collect m gs) t ; let s = !gs in m.footprint <- Tmap.add t s m.footprint ; s and gvars_of_pred m p = gvars_of_term m (F.e_prop p) and fset_of_tau (t : Lang.tau) = match t with | Qed.Logic.Array(ta,tb) -> Fset.union (fset_of_tau ta) (fset_of_tau tb) | Qed.Logic.Record fts -> fsetmap (fun (f,t) -> Fset.add f (fset_of_tau t)) fts | Qed.Logic.Data(adt,ts) -> Fset.union (fsetmap fset_of_tau ts) (fset_of_adt adt) | _ -> Fset.empty and fset_of_adt adt = fsetmap fset_of_field (Lang.fields_of_adt adt) and fset_of_field fd = let tf = Lang.tau_of_field fd in Fset.add fd (fset_of_tau tf) and fset_of_lemma m d = snd (gvars_of_pred m d.Definitions.l_lemma) and fset_of_var x = fset_of_tau (F.tau_of_var x) and fset_of_lfun m f = try Gmap.find f m.footcalls with Not_found -> (* bootstrap recursive calls *) m.footcalls <- Gmap.add f Fset.empty m.footcalls ; let fs = try let open Definitions in let d = Definitions.find_symbol f in let ds = fsetmap fset_of_var d.d_params in let df = match d.d_definition with | Logic _ -> Fset.empty | Function(_,_,t) -> snd (gvars_of_term m t) | Predicate(_,p) -> snd (gvars_of_pred m p) | Inductive ds -> fsetmap (fset_of_lemma m) ds in Fset.union ds df with Not_found -> Fset.empty in m.footcalls <- Gmap.add f fs m.footcalls ; fs let collect_have m p = begin m.gs <- FP.union m.gs (gvars_of_pred m p) ; m.xs <- Vars.union m.xs (F.varsp p) ; end let rec collect_condition m = function | Have p | When p | Core p -> collect_have m p | Type _ | Init _ | State _ -> () | Branch(p,sa,sb) -> collect_have m p ; collect_seq m sa ; collect_seq m sb | Either cs -> List.iter (collect_seq m) cs and collect_step m s = collect_condition m s.condition and collect_seq m s = List.iter (collect_step m) s.seq_list let rec filter_pred m p = match F.p_expr p with | And ps -> F.p_all (filter_pred m) ps | _ -> if Vars.subset (F.varsp p) m.xs then begin let gs = gvars_of_pred m p in if FP.subset gs m.gs then p else if FP.intersect gs m.gs then (m.fixpoint <- false ; m.gs <- FP.union gs m.gs ; p) else p_true end else p_true let rec filter_steplist m = function | [] -> [] | s :: w -> match s.condition with | State _ | Have _ | When _ | Core _ | Branch _ | Either _ -> s :: filter_steplist m w | Type p -> let p = filter_pred m p in let w = filter_steplist m w in if p != F.p_true then let s = update_cond s (Type p) in s :: w else w | Init p -> let p = filter_pred m p in let w = filter_steplist m w in if p != F.p_true then let s = update_cond s (Init p) in s :: w else w let make (seq,g) = let m = { gs = FP.empty ; xs = Vars.empty ; fixpoint = false ; footprint = Tmap.empty ; footcalls = Gmap.empty ; } in List.iter (collect_step m) seq.seq_list ; collect_have m g ; let rec loop () = m.fixpoint <- true ; let hs' = filter_steplist m seq.seq_list in if m.fixpoint then ( sequence hs' , g ) else loop () in loop () end let filter = Filter.make (* -------------------------------------------------------------------------- *) (* --- Filter Parasite Definitions --- *) (* -------------------------------------------------------------------------- *) module Parasite = struct open Qed.Logic type usage = Used | Def of F.term type domain = usage Vmap.t [@@@ warning "-32"] let pretty fmt w = Format.fprintf fmt "@[<hov 2>{" ; Vmap.iter (fun x u -> match u with | Used -> Format.fprintf fmt "@ %a" F.pp_var x | Def e -> Format.fprintf fmt "@ @[<hov 2>%a:=%a;@]" F.pp_var x F.pp_term e ) w ; Format.fprintf fmt " }@]" [@@@ warning "+32"] let cyclic w x e = let m = ref Vars.empty in let once x = if Vars.mem x !m then false else (m := Vars.add x !m ; true) in let rec walk_y w x y = if F.Var.equal x y then raise Exit ; if once x then let r = try Vmap.find x w with Not_found -> Used in match r with Used -> () | Def e -> walk_e w x e and walk_e w x e = Vars.iter (walk_y w x) (F.vars e) in try walk_e w x e ; false with Exit -> true (* let pivots w a b = let rec collect xs e = match F.repr e with | Fvar x -> x :: xs | Add es -> List.fold_left collect xs es | _ -> xs in let define w a b = let xs = collect [] a in let def r x = x , F.e_sub r (F.e_var x) in let filter w (x,e) = acyclic w x e in if xs = [] then [] else List.filter (filter w) (List.map (def (F.e_sub b a)) xs) in define w a b @ define w b a *) let rec add_used (w : domain) xs = Vars.fold add_usedvar xs w and add_usedvar x w = try match Vmap.find x w with | Used -> w | Def e -> add_used (Vmap.add x Used w) (F.vars e) with Not_found -> Vmap.add x Used w let add_def (w : domain) x e = try let xs = F.vars e in if cyclic w x e then add_used (add_usedvar x w) xs else match Vmap.find x w with | Used -> add_used w xs | Def e0 -> if F.equal e0 e then w else add_used (Vmap.add x Used w) xs with Not_found -> Vmap.add x (Def e) w let kind x w = try Some (Vmap.find x w) with Not_found -> None let add_eq (w : domain) x y = match kind x w , kind y w with | None , None -> let cmp = F.Var.compare x y in if cmp > 0 then add_def w x (F.e_var y) else if cmp < 0 then add_def w y (F.e_var x) else w | None , Some Used -> add_def w x (F.e_var y) | Some Used , None -> add_def w y (F.e_var x) | Some(Def e),(None | Some Used) | (None|Some Used),Some (Def e) -> add_usedvar x (add_usedvar y (add_used w (F.vars e))) | Some Used,Some Used -> w | Some(Def a),Some(Def b) -> let xs = Vars.union (F.vars a) (F.vars b) in add_usedvar x (add_usedvar y (add_used w xs)) let branch p wa wb = let pool = ref (F.varsp p) in let w0 = Vmap.union (fun _x u v -> match u,v with | Used,Used -> Used | Def a,Def b -> Def( F.e_if (F.e_prop p) a b ) | Def e,Used | Used,Def e -> pool := Vars.union !pool (F.vars e) ; Used ) wa wb in add_used w0 !pool let rec usage w p = match F.repr p with | And ps -> List.fold_left usage w ps | Eq(a,b) -> begin match F.repr a , F.repr b with | Fvar x , Fvar y -> add_eq w x y | Fvar x , _ -> add_def w x b | _ , Fvar y -> add_def w y a | _ -> add_used w (F.vars p) end | _ -> add_used w (F.vars p) let rec collect_step w s = match s.condition with | Type _ | State _ -> w | Have p | Core p | Init p | When p -> usage w (F.e_prop p) | Branch(p,a,b) -> let wa = collect_seq w a in let wb = collect_seq w b in branch p wa wb | Either ws -> List.fold_left collect_seq w ws and collect_seq w s = List.fold_left collect_step w s.seq_list let parasites w = Vmap.fold (fun x u xs -> match u with Used -> xs | Def _ -> Vars.add x xs) w Vars.empty let rec filter xs p = match F.p_expr p with | And ps -> p_all (filter xs) ps | _ -> if Vars.intersect (F.varsp p) xs then F.p_true else p let filter (hs,g) = let w = collect_seq (add_used Vmap.empty (F.varsp g)) hs in let xs = parasites w in if Vars.is_empty xs then (hs,g) else map_sequence (filter xs) hs , g end let parasite = Parasite.filter (* -------------------------------------------------------------------------- *) (* --- Finalization --- *) (* -------------------------------------------------------------------------- *) let close_cond = function | Type _ when Wp_parameters.SimplifyType.get () -> p_true | c -> pred_cond c let closure = ref [] let at_closure f = closure := f::!closure let alter_closure sequent = List.fold_left (fun seq f -> f seq) sequent !closure let hyps s = List.map (fun s -> close_cond s.condition) s.seq_list let head s = match s.condition with | Have p | When p | Core p | Init p | Type p | Branch(p,_,_) -> p | Either _ | State _ -> p_true let have s = match s.condition with | Have p | When p | Core p | Init p | Type p -> p | Branch _ | Either _ | State _ -> p_true let condition s = F.p_conj (hyps s) let close sequent = let s,goal = alter_closure sequent in F.p_close (F.p_hyps (hyps s) goal) (* -------------------------------------------------------------------------- *) (* --- Visitor --- *) (* -------------------------------------------------------------------------- *) let list seq = seq.seq_list let iter f seq = List.iter f seq.seq_list (* -------------------------------------------------------------------------- *) (* --- Index --- *) (* -------------------------------------------------------------------------- *) let rec index_list k = function | [] -> k | s::w -> index_list (index_step k s) w and index_step k s = s.id <- k ; let k = succ k in match s.condition with | Have _ | When _ | Type _ | Core _ | Init _ | State _ -> k | Branch(_,a,b) -> index_list (index_list k a.seq_list) b.seq_list | Either cs -> index_case k cs and index_case k = function | [] -> k | c::cs -> index_case (index_list k c.seq_list) cs let steps seq = index_list 0 seq.seq_list let index (seq,_) = ignore (steps seq) (* -------------------------------------------------------------------------- *) (* --- Access --- *) (* -------------------------------------------------------------------------- *) let rec at_list k = function | [] -> assert false | s::w -> if k = 0 then s else let n = s.size in if k < n then at_step (k-1) s.condition else at_list (k - n) w and at_step k = function | Have _ | When _ | Type _ | Core _ | Init _ | State _ -> assert false | Branch(_,a,b) -> let n = a.seq_size in if k < n then at_list k a.seq_list else at_list (k-n) b.seq_list | Either cs -> at_case k cs and at_case k = function | [] -> assert false | c::cs -> let n = c.seq_size in if k < n then at_list k c.seq_list else at_case (k - n) cs let step_at seq k = if 0 <= k && k < seq.seq_size then at_list k seq.seq_list else raise Not_found (* -------------------------------------------------------------------------- *) (* --- Insertion --- *) (* -------------------------------------------------------------------------- *) let in_sequence ~replace = let rec in_list k h w = if k = 0 then h :: (if replace then match w with | [] -> assert false | _::w -> w else w) else match w with | [] -> assert false | s::w -> let n = s.size in if k < n then let cond = in_step (k-1) h s.condition in update_cond s cond :: w else s :: in_list (k-n) h w and in_step k h = function | Have _ | When _ | Type _ | Core _ | Init _ | State _ -> assert false | Branch(p,a,b) -> let n = a.seq_size in if k < n then Branch(p,in_sequence k h a,b) else Branch(p,a,in_sequence (k-n) h b) | Either cs -> Either (in_case k h cs) and in_case k h = function | [] -> assert false | c::cs -> let n = c.seq_size in if k < n then in_sequence k h c :: cs else c :: in_case (k-n) h cs and in_sequence k h s = sequence (in_list k h s.seq_list) in in_sequence let size seq = seq.seq_size let insert ?at step sequent = let seq,goal = sequent in let at = match at with None -> seq.seq_size | Some k -> k in if 0 <= at && at <= seq.seq_size then in_sequence ~replace:false at step seq , goal else raise (Invalid_argument "Conditions.insert") let replace ~at step sequent = let seq,goal = sequent in if 0 <= at && at <= seq.seq_size then in_sequence ~replace:true at step seq , goal else raise (Invalid_argument "Conditions.insert") (* -------------------------------------------------------------------------- *) (* --- Replace --- *) (* -------------------------------------------------------------------------- *) let subst f s = map_sequent (Lang.p_subst f) s (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Conditions.mli��������������������������������������������������0000666�0000000�0000000�00000015743�13571573400�016737� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Weakest Pre Accumulator --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Lang open Lang.F (** Predicates *) val forall_intro: Lang.F.pred -> Lang.F.pred list * Lang.F.pred val exist_intro: Lang.F.pred -> Lang.F.pred (** Sequent *) type step = private { mutable id : int ; (** See [index] *) size : int ; vars : Vars.t ; stmt : stmt option ; descr : string option ; deps : Property.t list ; warn : Warning.Set.t ; condition : condition ; } and condition = | Type of pred | Have of pred | When of pred | Core of pred | Init of pred | Branch of pred * sequence * sequence | Either of sequence list | State of Mstate.state and sequence (** List of steps *) type sequent = sequence * F.pred val pretty : (Format.formatter -> sequent -> unit) ref val step : ?descr:string -> ?stmt:stmt -> ?deps:Property.t list -> ?warn:Warning.Set.t -> condition -> step (** Updates the condition of a step and merges [descr], [deps] and [warn] *) val update_cond : ?descr:string -> ?deps:Property.t list -> ?warn:Warning.Set.t -> step -> condition -> step val is_true : sequence -> bool (** Only true or empty steps *) val is_empty : sequence -> bool (** No step at all *) val vars_hyp : sequence -> Vars.t val vars_seq : sequent -> Vars.t val empty : sequence val trivial : sequent val sequence : step list -> sequence val seq_branch : ?stmt:stmt -> F.pred -> sequence -> sequence -> sequence val append : sequence -> sequence -> sequence val concat : sequence list -> sequence (** Iterate only over the head steps of the sequence *) val iter : (step -> unit) -> sequence -> unit (** The internal list of steps *) val list : sequence -> step list val size : sequence -> int val steps : sequence -> int (** Attributes unique indices to every [step.id] in the sequence, starting from zero. Returns the number of steps in the sequence. *) val index : sequent -> unit (** Compute steps' id of sequent left hand-side. Same as [ignore (steps (fst s))]. *) val step_at : sequence -> int -> step (** Retrieve a step by [id] in the sequence. The [index] function {i must} have been called on the sequence before retrieving the index properly. @raise Not_found if the index is out of bounds. *) val is_trivial : sequent -> bool (** {2 Transformations} *) val map_condition : (pred -> pred) -> condition -> condition val map_step : (pred -> pred) -> step -> step val map_sequence : (pred -> pred) -> sequence -> sequence val map_sequent : (pred -> pred) -> sequent -> sequent val insert : ?at:int -> step -> sequent -> sequent (** Insert a step in the sequent immediately [at] the specified position. Parameter [at] can be [size] to insert at the end of the sequent (default). @raise Invalid_argument if the index is out of bounds. *) val replace : at:int -> step -> sequent -> sequent (** replace a step in the sequent, the one [at] the specified position. @raise Invalid_argument if the index is out of bounds. *) val subst : (term -> term) -> sequent -> sequent (** Apply the atomic substitution recursively using [Lang.F.p_subst f]. Function [f] should only transform the head of the predicate, and can assume its sub-terms have been already substituted. The atomic substitution is also applied to predicates. [f] should raise [Not_found] on terms that must not be replaced *) val introduction : sequent -> sequent option (** Performs existential, universal and hypotheses introductions *) val introduction_eq : sequent -> sequent (** Same as [introduction] but returns the same sequent is None *) val lemma : pred -> sequent (** Performs existential, universal and hypotheses introductions *) val head : step -> pred (** Predicate for Have and such, Condition for Branch, True for Either *) val have : step -> pred (** Predicate for Have and such, True for any other *) val condition : sequence -> pred (** With free variables kept. *) val close : sequent -> pred (** With free variables {i quantified}. *) val at_closure : (sequent -> sequent ) -> unit (** register a transformation applied just before close *) (** {2 Bundles} Bundles are {i mergeable} pre-sequences. This the key structure for merging hypotheses with linear complexity during backward weakest pre-condition calculus. *) type bundle type 'a attributed = ( ?descr:string -> ?stmt:stmt -> ?deps:Property.t list -> ?warn:Warning.Set.t -> 'a ) val nil : bundle val occurs : F.var -> bundle -> bool val intersect : F.pred -> bundle -> bool val merge : bundle list -> bundle val domain : F.pred list -> bundle -> bundle val intros : F.pred list -> bundle -> bundle val state : ?descr:string -> ?stmt:stmt -> Mstate.state -> bundle -> bundle val assume : (?init:bool -> F.pred -> bundle -> bundle) attributed val branch : (F.pred -> bundle -> bundle -> bundle) attributed val either : (bundle list -> bundle) attributed val extract : bundle -> F.pred list val bundle : bundle -> sequence (** {2 Simplifier} *) val clean : sequent -> sequent val filter : sequent -> sequent val parasite : sequent -> sequent val simplify : ?solvers:simplifier list -> ?intros:int -> sequent -> sequent val pruning : ?solvers:simplifier list -> sequent -> sequent (* -------------------------------------------------------------------------- *) �����������������������������frama-c-20.0-Calcium/src/plugins/wp/Context.ml������������������������������������������������������0000666�0000000�0000000�00000007140�13571573400�016071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Location --- *) (* -------------------------------------------------------------------------- *) let with_current_loc loc phi x = let tmp = Cil_const.CurrentLoc.get () in try Cil_const.CurrentLoc.set loc ; let y = phi x in Cil_const.CurrentLoc.set tmp ; y with error -> Cil_const.CurrentLoc.set tmp ; raise error (* -------------------------------------------------------------------------- *) (* --- Local Context --- *) (* -------------------------------------------------------------------------- *) type 'a value = { name : string ; (* Descriptive *) mutable current : 'a option ; } let create ?default name = { name = name ; current = default } let name s = s.name let defined env = match env.current with None -> false | Some _ -> true let get env = match env.current with | Some e -> e | None -> Wp_parameters.fatal "Context '%s' non-initialized." env.name let get_opt env = env.current let set env s = env.current <- Some s let clear env = env.current <- None let update env f = match env.current with | Some e -> env.current <- Some (f e) | None -> Wp_parameters.fatal "Context '%s' non-initialized." env.name let bind_with env w f e = let tmp = env.current in env.current <- w ; try let e = f e in env.current <- tmp ; e with error -> env.current <- tmp ; raise error let bind env s f e = bind_with env (Some s) f e let free env f e = bind_with env None f e let push env x = let old = env.current in env.current <- Some x ; old let pop env old = env.current <- old let demon = ref [] let register f = demon := !demon @ [f] let configure = let closure,state = State_builder.apply_once "Wp.Context.configure" [ Ast.self ] (fun () -> List.iter (fun f -> f ()) !demon) in ignore state ; closure (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Context.mli�����������������������������������������������������0000666�0000000�0000000�00000005526�13571573400�016250� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Current Loc *) val with_current_loc : Cil_types.location -> ('a -> 'b) -> 'a -> 'b (** Contextual Values *) type 'a value val create : ?default:'a -> string -> 'a value (** Creates a new context with name *) val defined : 'a value -> bool (** The current value is defined. *) val get : 'a value -> 'a (** Retrieves the current value of the context. Raise an exception if not bound. *) val get_opt : 'a value -> 'a option (** Retrieves the current value of the context. Return [None] if not bound. *) val set : 'a value -> 'a -> unit (** Define the current value. Previous one is lost *) val update : 'a value -> ('a -> 'a) -> unit (** Modification of the current value *) val bind : 'a value -> 'a -> ('b -> 'c) -> 'b -> 'c (** Performs the job with local context bound to local value. *) val free : 'a value -> ('b -> 'c) -> 'b -> 'c (** Performs the job with local context cleared. *) val clear : 'a value -> unit (** Clear the current value. *) val push : 'a value -> 'a -> 'a option val pop : 'a value -> 'a option -> unit val name : 'a value -> string val register : (unit -> unit) -> unit (** Register a global configure, to be executed once per project/ast. *) val configure : unit -> unit (** Apply global configure hooks, once per project/ast. *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cstring.ml������������������������������������������������������0000666�0000000�0000000�00000010415�13571573400�016055� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- C Strings --- *) (* -------------------------------------------------------------------------- *) open Definitions open Qed.Logic open Lang type cst = | C_str of string | W_str of int64 list module STR = struct type t = cst let compare = Transitioning.Stdlib.compare (* only comparable types *) let pretty fmt = function | C_str s -> Format.fprintf fmt "%S" s | W_str _ -> Format.fprintf fmt "\"L<...>\"" let hash (c:t) = FCHashtbl.hash c land 0xFFFF end let pretty = STR.pretty let cluster () = Definitions.cluster ~id:"cstring" ~title:"String Literals" () module LIT = WpContext.Generator(STR) (struct type key = cst type data = int * F.term let name = "Cstring.Literals" let hid = Hashtbl.create 31 let rec lookup id = if id=0 || Hashtbl.mem hid id then lookup (succ id) else (Hashtbl.add hid id () ; id) let export_literal prefix lfun str = let chars = ref [] in let array = F.e_fun lfun [] in let n = String.length str in for i = 0 to n do let a = F.e_get array (F.e_int i) in let c = if i = n then F.e_zero else F.e_int (int_of_char str.[i]) in chars := (F.p_equal a c) :: !chars ; done ; define_lemma { l_name = prefix ^ "_literal" ; l_cluster = cluster () ; l_assumed = true ; l_types = 0 ; l_forall = [] ; l_triggers = [] ; l_lemma = F.p_conj (List.rev !chars) ; } let compile s = let id = lookup (STR.hash s) in let lfun = Lang.generated_f ~result:(Array(Int,Int)) "Lit_%04X" id in (** Since its a generated it is the unique name given ["Lit_%04X" id] *) let prefix = Lang.Fun.debug lfun in define_symbol { d_lfun = lfun ; d_cluster = cluster () ; d_types = 0 ; d_params = [] ; d_definition = Logic (Array(Int,Int)) ; } ; if Wp_parameters.Literals.get () then begin match s with | C_str str -> export_literal prefix lfun str | W_str _ -> Wp_parameters.warning ~current:false ~once:true "Content of wide string literals not exported." end ; id , F.e_fun lfun [] end) let str_id s = fst (LIT.get s) let str_val s = snd (LIT.get s) let str_len s n = match s with | C_str s -> F.p_equal n (F.e_int (String.length s)) | W_str _ -> F.p_lt F.e_zero n let char_at s k = F.e_get (str_val s) k ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cstring.mli�����������������������������������������������������0000666�0000000�0000000�00000004626�13571573400�016235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- String Constants --- *) (* -------------------------------------------------------------------------- *) open Lang.F type cst = | C_str of string (** String Literal *) | W_str of int64 list (** Wide String Literal *) val pretty : Format.formatter -> cst -> unit val str_len : cst -> term -> pred (** Property defining the size of the string in bytes, with [\0] terminator included. *) val str_val : cst -> term (** The array containing the [char] of the constant *) val str_id : cst -> int (** Non-zero integer, unique for each different string literal *) val char_at : cst -> term -> term val cluster : unit -> Definitions.cluster (** The cluster where all strings are defined. *) ����������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cvalues.ml������������������������������������������������������0000666�0000000�0000000�00000066147�13571573400�016063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Lifting Operations over Memory Values --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Ctypes open Qed open Lang open Lang.F open Sigs open Definitions (* -------------------------------------------------------------------------- *) (* --- C Constants --- *) (* -------------------------------------------------------------------------- *) let ainf = Some e_zero let asup n = Some (e_int (n-1)) let arange k n = p_and (p_leq e_zero k) (p_lt k (e_int n)) let equation = function | Set(a,b) -> p_equal a b | Assert p -> p let rec constant = function | CInt64(z,_,_) -> e_bigint z | CChr c -> e_int64 (Ctypes.char c) | CReal(f,fk,s) -> Cfloat.code_lit (Ctypes.c_float fk) f s | CEnum e -> constant_exp e.eival | CStr _ | CWStr _ -> Warning.error "String constants not yet implemented" and logic_constant = function | Integer(z,_) -> e_bigint z | LChr c -> e_int64 (Ctypes.char c) | LReal r -> Cfloat.acsl_lit r | LEnum e -> constant_exp e.eival | LStr _ | LWStr _ -> Warning.error "String constants not yet implemented" and constant_exp e = let e = Cil.constFold true e in match e.enode with | Const c -> constant c | _ -> Warning.error "constant(%a)" Printer.pp_exp e and constant_term t = let e = Cil.constFoldTerm true t in match e.term_node with | TConst c -> logic_constant c | _ -> Warning.error "constant(%a)" Printer.pp_term t (* -------------------------------------------------------------------------- *) (* The type contains C-integers *) let rec is_constrained typ = is_constrained_obj (Ctypes.object_of typ) and is_constrained_obj = function | C_int _ -> true | C_float _ -> false | C_pointer _ -> false | C_array a -> is_constrained a.arr_element | C_comp c -> is_constrained_comp c and is_constrained_comp c = List.exists (fun f -> is_constrained f.ftype) c.cfields module type CASES = sig val prefix : string val natural : bool (* natural: all types are constrained, but only with their natural values *) (* otherwise: only atomic types are constrained *) val is_int : c_int -> term -> pred val is_float : c_float -> term -> pred val is_pointer : term -> pred end module STRUCTURAL(C : CASES) = struct let constrained_elt ty = C.natural || is_constrained ty let constrained_comp c = C.natural || is_constrained_comp c let model_int fmt i = if C.natural then Format.pp_print_string fmt "int" else Ctypes.pp_int fmt i let array_name te ds = let dim = List.length ds in match te with | C_int i -> Format.asprintf "%sArray%d_%a" C.prefix dim model_int i | C_float _ -> Format.asprintf "%sArray%d_float" C.prefix dim | C_pointer _ -> Format.asprintf "%sArray%d_pointer" C.prefix dim | C_comp c -> Format.asprintf "%sArray%d%s" C.prefix dim (Lang.comp_id c) | C_array _ -> Wp_parameters.fatal "Unflatten array (%s %a)" C.prefix Ctypes.pretty te let rec is_obj obj t = match obj with | C_int i -> C.is_int i t | C_float f -> C.is_float f t | C_pointer _ty -> C.is_pointer t | C_comp c -> if constrained_comp c then is_record c t else p_true | C_array a -> if constrained_elt a.arr_element then let te,ds = Ctypes.array_dimensions a in is_array te ds t else p_true and is_typ typ t = is_obj (Ctypes.object_of typ) t and is_record c s = Definitions.call_pred (Lang.generated_p (C.prefix ^ Lang.comp_id c)) (fun lfun -> let basename = if c.cstruct then "S" else "U" in let s = Lang.freshvar ~basename (Lang.tau_of_comp c) in let def = p_all (fun f -> is_typ f.ftype (e_getfield (e_var s) (Lang.Cfield f))) c.cfields in { d_lfun = lfun ; d_types = 0 ; d_params = [s] ; d_cluster = Definitions.compinfo c ; d_definition = Predicate(Def,def) ; }) [s] and is_array te ds t = Definitions.call_pred (Lang.generated_p (array_name te ds)) (fun lfun -> let x = Lang.freshvar ~basename:"T" (Matrix.tau te ds) in let ks = List.map (fun _d -> Lang.freshvar ~basename:"k" Logic.Int) ds in let e = List.fold_left (fun a k -> e_get a (e_var k)) (e_var x) ks in let def = p_forall ks (is_obj te e) in { d_lfun = lfun ; d_types = 0 ; d_params = [x] ; d_cluster = Definitions.matrix te ; d_definition = Predicate(Def,def) ; } ) [t] end (* -------------------------------------------------------------------------- *) (* --- Null-Values --- *) (* -------------------------------------------------------------------------- *) let null = Context.create "Lang.null" module NULL = STRUCTURAL (struct let prefix = "Null" let natural = true let is_int _i = p_equal e_zero let is_float _f = p_equal e_zero_real let is_pointer p = Context.get null p end) let is_null = NULL.is_obj module TYPE = STRUCTURAL (struct let prefix = "Is" let natural = false let is_int = Cint.range let is_float _ _ = p_true let is_pointer _ = p_true end) let has_ctype = TYPE.is_typ let has_ltype ltype e = match Logic_utils.unroll_type ~unroll_typedef:false ltype with | Ctype typ -> has_ctype typ e | Ltype _ | Lvar _ | Linteger | Lreal | Larrow _ -> p_true let is_object obj = function | Loc _ -> p_true | Val e -> TYPE.is_obj obj e let cdomain obj = if is_constrained_obj obj then Some(TYPE.is_obj obj) else None let ldomain ltype = match Logic_utils.unroll_type ~unroll_typedef:false ltype with | Ctype typ -> cdomain (Ctypes.object_of typ) | Ltype _ | Lvar _ | Linteger | Lreal | Larrow _ -> None (* -------------------------------------------------------------------------- *) (* --- Volatile --- *) (* -------------------------------------------------------------------------- *) let volatile ?warn () = Wp_parameters.Volatile.get () || ( Extlib.may (fun w -> Warning.emit ~severe:false ~effect:"ignore volatile attribute" "%s" w) warn ; false ) (* -------------------------------------------------------------------------- *) (* --- ACSL Equality BootStrap --- *) (* -------------------------------------------------------------------------- *) let equal_rec = ref (fun _ _ _ -> assert false) (* recursion for equal_object *) let rec reduce_eqcomp = function | [a;b] when Lang.F.equal a b -> F.e_true | _::ws -> reduce_eqcomp ws | [] -> raise Not_found (* -------------------------------------------------------------------------- *) (* --- ACSL Array Equality --- *) (* -------------------------------------------------------------------------- *) module EQARRAY = WpContext.Generator(Matrix.NATURAL) (struct open Matrix let name = "Cvalues.EqArray" type key = matrix type data = lfun let compile (te,ds) = (* Contextual Symbol *) let lfun = Lang.generated_f ~context:true ~sort:Logic.Sprop "EqArray%s_%s" (Matrix.id ds) (Matrix.natural_id te) in (* Simplification of the symbol *) Lang.F.set_builtin lfun reduce_eqcomp ; (* Definition of the symbol *) let denv = Matrix.denv ds in let tau = Matrix.tau te ds in let xa = Lang.freshvar ~basename:"T" tau in let xb = Lang.freshvar ~basename:"T" tau in let ta = e_var xa in let tb = e_var xb in let ta_xs = List.fold_left e_get ta denv.index_val in let tb_xs = List.fold_left e_get tb denv.index_val in let property = p_hyps (denv.index_range) (!equal_rec te ta_xs tb_xs) in let definition = p_forall denv.index_var property in (* Registration *) Definitions.define_symbol { d_cluster = Definitions.matrix te ; d_lfun = lfun ; d_types = 0 ; d_params = denv.size_var @ [xa ; xb ] ; d_definition = Predicate(Def,definition) ; } ; lfun end) (* -------------------------------------------------------------------------- *) (* --- ACSL Compound Equality --- *) (* -------------------------------------------------------------------------- *) module EQCOMP = WpContext.Generator(Cil_datatype.Compinfo) (struct let name = "Cvalues.EqComp" type key = compinfo type data = lfun let compile c = (* Contextual Symbol *) let lfun = Lang.generated_p ~context:true ("Eq" ^ Lang.comp_id c) in (* Simplification of the symbol *) Lang.F.set_builtin lfun reduce_eqcomp ; (* Definition of the symbol *) let basename = if c.cstruct then "S" else "U" in let xa = Lang.freshvar ~basename (Lang.tau_of_comp c) in let xb = Lang.freshvar ~basename (Lang.tau_of_comp c) in let ra = e_var xa in let rb = e_var xb in let def = p_all (fun f -> let fd = Cfield f in !equal_rec (Ctypes.object_of f.ftype) (e_getfield ra fd) (e_getfield rb fd)) c.cfields in (* Registration *) Definitions.define_symbol { d_cluster = Definitions.compinfo c ; d_lfun = lfun ; d_types = 0 ; d_params = [xa;xb] ; d_definition = Predicate(Def,def) ; } ; lfun end) (* -------------------------------------------------------------------------- *) (* --- ACSL Equality --- *) (* -------------------------------------------------------------------------- *) let equal_comp c a b = p_call (EQCOMP.get c) [a;b] let equal_array m a b = match m with | _obj , [None] -> p_equal a b | m -> p_call (EQARRAY.get m) (Matrix.size m @ [a;b]) let equal_object obj a b = match obj with | C_int _ | C_float _ | C_pointer _ -> p_equal a b | C_comp c -> equal_comp c a b | C_array t -> equal_array (Matrix.of_array t) a b let () = equal_rec := equal_object (* -------------------------------------------------------------------------- *) (* --- Lifting Values --- *) (* -------------------------------------------------------------------------- *) let map_value f = function | Val t -> Val t | Loc l -> Loc (f l) let map_sloc f = function | Sloc l -> Sloc (f l) | Sarray(l,obj,n) -> Sarray(f l,obj,n) | Srange(l,obj,a,b) -> Srange(f l,obj,a,b) | Sdescr(xs,l,p) -> Sdescr(xs,f l,p) let map_logic f = function | Vexp t -> Vexp t | Vloc l -> Vloc (f l) | Vset s -> Vset s | Lset ls -> Lset (List.map (map_sloc f) ls) let plain lt e = if Logic_typing.is_set_type lt then let te = Logic_typing.type_of_set_elem lt in Vset [Vset.Set(tau_of_ltype te,e)] else Vexp e (* -------------------------------------------------------------------------- *) (* --- Printing Values --- *) (* -------------------------------------------------------------------------- *) type 'a printer = Format.formatter -> 'a -> unit let pp_bound fmt = function None -> () | Some p -> F.pp_term fmt p let pp_value pp fmt = function | Loc l -> pp fmt l | Val v -> F.pp_term fmt v let pp_logic pp fmt = function | Vexp e -> F.pp_term fmt e | Vloc l -> pp fmt l | Lset _ | Vset _ -> Format.pp_print_string fmt "<set>" let pp_rloc pp fmt = function | Rloc(obj,l) -> Format.fprintf fmt "@[<hov 2>%a:@,%a@]" pp l Ctypes.pretty obj | Rrange(l,obj,a,b) -> Format.fprintf fmt "@[<hov2>%a@,.(%a@,..%a):@,%a@]" pp l pp_bound a pp_bound b Ctypes.pretty obj let pp_sloc pp fmt = function | Sloc l -> pp fmt l | Sarray(l,_,n) -> Format.fprintf fmt "@[<hov2>%a@,.(..%d)@]" pp l (n-1) | Srange(l,_,a,b) -> Format.fprintf fmt "@[<hov2>%a@,.(%a@,..%a)@]" pp l pp_bound a pp_bound b | Sdescr(xs,l,p) -> Format.fprintf fmt "@[<hov2>{ %a | %a }@]" pp l F.pp_pred (F.p_forall xs p) let pp_region pp fmt sloc = List.iter (fun (_,s) -> Format.fprintf fmt "@ %a" (pp_sloc pp) s) sloc (* -------------------------------------------------------------------------- *) (* --- Int-As-Booleans --- *) (* -------------------------------------------------------------------------- *) let bool_eq a b = e_if (e_eq a b) e_one e_zero let bool_lt a b = e_if (e_lt a b) e_one e_zero let bool_neq a b = e_if (e_eq a b) e_zero e_one let bool_leq a b = e_if (e_leq a b) e_one e_zero let bool_and a b = e_and [e_neq a e_zero ; e_neq b e_zero] let bool_or a b = e_or [e_neq a e_zero ; e_neq b e_zero] let bool_val e = e_if e e_one e_zero let is_true p = e_if (e_prop p) e_one e_zero let is_false p = e_if (e_prop p) e_zero e_one (* -------------------------------------------------------------------------- *) (* --- Start Of Arrays --- *) (* -------------------------------------------------------------------------- *) let startof ~shift loc typ = if Cil.isArrayType typ then let t_elt = Cil.typeOf_array_elem typ in shift loc (Ctypes.object_of t_elt) e_zero else loc (* -------------------------------------------------------------------------- *) (* --- Lifting Memory Model to Values --- *) (* -------------------------------------------------------------------------- *) type polarity = [ `Positive | `Negative | `NoPolarity ] let negate = function | `Positive -> `Negative | `Negative -> `Positive | `NoPolarity -> `NoPolarity module Logic(M : Sigs.Model) = struct type logic = M.loc Sigs.logic type segment = c_object * M.loc Sigs.sloc type region = M.loc Sigs.region (* -------------------------------------------------------------------------- *) (* --- Projections --- *) (* -------------------------------------------------------------------------- *) let value = function | Vexp e -> e | Vloc l -> M.pointer_val l | Vset s -> Vset.concretize s | Lset _ -> Warning.error "T-Set of values not yet implemented" let loc = function | Vloc l -> l | Vexp e -> M.pointer_loc e | Vset _ -> Warning.error "Set of pointers not yet implemented" | Lset _ -> Warning.error "T-Set of regions not yet implemented" let rdescr = function | Sloc l -> [],l,p_true | Sdescr(xs,l,p) -> xs,l,p | Sarray(l,obj,n) -> let x = Lang.freshvar ~basename:"k" Logic.Int in let k = e_var x in [x],M.shift l obj k,arange k n | Srange(l,obj,a,b) -> let x = Lang.freshvar ~basename:"k" Logic.Int in let k = e_var x in [x],M.shift l obj k,Vset.in_range k a b let vset_of_sloc sloc = List.map (function | Sloc p -> Vset.Singleton (M.pointer_val p) | u -> let xs,l,p = rdescr u in Vset.Descr( xs , M.pointer_val l , p ) ) sloc let sloc_of_vset phi vset = List.map (function | Vset.Singleton e -> phi (Sloc (M.pointer_loc e)) | w -> let xs,t,p = Vset.descr w in phi (Sdescr(xs,M.pointer_loc t,p)) ) vset let vset = function | Vexp v -> Vset.singleton v | Vloc l -> Vset.singleton (M.pointer_val l) | Vset s -> s | Lset sloc -> vset_of_sloc sloc let sloc_map phi = function | Vexp e -> [phi (Sloc (M.pointer_loc e))] | Vloc l -> [phi (Sloc l)] | Lset locs -> List.map phi locs | Vset vset -> sloc_of_vset phi vset let region obj logic = sloc_map (fun s -> obj , s) logic let sloc logic = sloc_map (fun s -> s) logic (* -------------------------------------------------------------------------- *) (* --- Morphisms --- *) (* -------------------------------------------------------------------------- *) let is_single = function (Vexp _ | Vloc _) -> true | (Lset _ | Vset _) -> false let map_lift f1 f2 a = match a with | Vexp e -> Vexp (f1 e) | Vloc l -> Vexp (f1 (M.pointer_val l)) | _ -> Vset(f2 (vset a)) let apply_lift f1 f2 a b = if is_single a && is_single b then Vexp (f1 (value a) (value b)) else Vset (f2 (vset a) (vset b)) let map f = map_lift f (Vset.map f) let map_opp = map_lift e_opp Vset.map_opp let apply f = apply_lift f (Vset.lift f) let apply_add = apply_lift e_add Vset.lift_add let apply_sub = apply_lift e_sub Vset.lift_sub let map_loc f lv = if is_single lv then Vloc (f (loc lv)) else Lset (List.map (function | Sloc l -> Sloc (f l) | s -> let xs,l,p = rdescr s in Sdescr(xs,f l,p) ) (sloc lv)) let map_l2t f lv = if is_single lv then Vexp (f (loc lv)) else Vset (List.map (function | Sloc l -> Vset.Singleton (f l) | s -> let xs,l,p = rdescr s in Vset.Descr(xs,f l,p) ) (sloc lv)) let map_t2l f sv = if is_single sv then Vloc (f (value sv)) else Lset (List.map (function | Vset.Singleton e -> Sloc (f e) | s -> let xs,l,p = Vset.descr s in Sdescr(xs,f l,p) ) (vset sv)) (* -------------------------------------------------------------------------- *) (* --- Locations --- *) (* -------------------------------------------------------------------------- *) let field lv f = map_loc (fun l -> M.field l f) lv let restrict kset = function | None -> kset | Some s -> if Kernel.SafeArrays.get () then match kset with | Vset.Singleton _ | Vset.Set _ -> kset | Vset.Range(a,b) -> let cap l = function None -> Some l | u -> u in Vset.Range(cap e_zero a,cap (e_int (s-1)) b) | Vset.Descr(xs,k,p) -> let a = e_zero in let b = e_int s in Vset.Descr(xs,k,p_conj [p_leq a k;p_lt k b;p]) else kset let is_ainf = function | Some e -> e == e_zero | None -> false let is_asup n = function | Some e -> e == e_int (n-1) | None -> false let srange loc obj size a b = match size with | None -> Srange(loc,obj,a,b) | Some n -> if is_ainf a && is_asup n b then Sarray(loc,obj,n) else Srange(loc,obj,a,b) let shift_set sloc obj (size : int option) kset = match sloc , size , kset with | Sloc l , Some n , Vset.Range(None,None) when Kernel.SafeArrays.get () -> Sarray(l,obj,n) | _ -> match sloc , restrict kset size with | Sloc l , Vset.Singleton k -> Sloc(M.shift l obj k) | Sloc l , Vset.Range(a,b) -> srange l obj size a b | Srange(l,obj0,a0,b0) , Vset.Singleton k when Ctypes.equal obj0 obj -> let a = Vset.bound_add a0 (Some k) in let b = Vset.bound_add b0 (Some k) in srange l obj0 size a b | Srange(l,obj0,a0,b0) , Vset.Range(a1,b1) when Ctypes.equal obj0 obj -> let a = Vset.bound_add a0 a1 in let b = Vset.bound_add b0 b1 in srange l obj0 size a b | _ -> let xs,l,p = rdescr sloc in let ys,k,q = Vset.descr kset in Sdescr( xs @ ys , M.shift l obj k , p_and p q ) let shift lv obj ?size kv = if is_single kv then let k = value kv in map_loc (fun l -> M.shift l obj k) lv else let ks = vset kv in Lset(List.fold_left (fun s sloc -> List.fold_left (fun s kset -> shift_set sloc obj size kset :: s ) s ks ) [] (sloc lv)) (* -------------------------------------------------------------------------- *) (* --- Load in Memory --- *) (* -------------------------------------------------------------------------- *) type loader = { mutable sloc : M.loc sloc list ; mutable vset : Vset.vset list ; } let flush prefer_loc a = match a with | { vset=[] } -> Lset (List.rev a.sloc) | { sloc=[] } -> Vset (List.rev a.vset) | _ -> if prefer_loc then Lset (a.sloc @ sloc_of_vset (fun r -> r) a.vset) else Vset (vset_of_sloc a.sloc @ a.vset) let loadsloc a sigma obj = function | Sloc l -> begin match M.load sigma obj l with | Val t -> a.vset <- Vset.Singleton t :: a.vset | Loc l -> a.sloc <- Sloc l :: a.sloc end | (Sarray _ | Srange _ | Sdescr _) as s -> let xs , l , p = rdescr s in begin match M.load sigma obj l with | Val t -> a.vset <- Vset.Descr(xs,t,p) :: a.vset | Loc l -> a.sloc <- Sdescr(xs,l,p) :: a.sloc end let load sigma obj lv = if is_single lv then let data = M.load sigma obj (loc lv) in Lang.assume (is_object obj data) ; match data with | Val t -> Vexp t | Loc l -> Vloc l else let a = { vset=[] ; sloc=[] } in List.iter (loadsloc a sigma obj) (sloc_map (fun r -> r) lv) ; flush (Ctypes.is_pointer obj) a let union t vs = let a = { vset=[] ; sloc=[] } in List.iter (function | Vexp e -> a.vset <- Vset.Singleton e::a.vset | Vloc l -> a.sloc <- Sloc l :: a.sloc | Vset s -> a.vset <- List.rev_append s a.vset | Lset s -> a.sloc <- List.rev_append s a.sloc ) vs ; flush (Logic_typing.is_pointer_type t) a let inter t vs = match List.map (fun v -> Vset.concretize (vset v)) vs with | [] -> if Logic_typing.is_pointer_type t then Lset [] else Vset [] | v::vs -> let s = List.fold_left Vset.inter v vs in let t = Lang.tau_of_ltype t in Vset [Vset.Set(t,s)] (* -------------------------------------------------------------------------- *) (* --- Sloc to Rloc --- *) (* -------------------------------------------------------------------------- *) let rloc obj = function | Sloc l -> Rloc(obj,l) | Sarray(l,t,n) -> Rrange(l,t,ainf,asup n) | Srange(l,t,a,b) -> Rrange(l,t,a,b) | Sdescr _ -> raise Exit (* -------------------------------------------------------------------------- *) (* --- Separated --- *) (* -------------------------------------------------------------------------- *) let separated_region w (r1 : region) (r2 : region) = List.fold_left (fun w (o1,s1) -> List.fold_left (fun w (o2,s2) -> let cond = try M.separated (rloc o1 s1) (rloc o2 s2) with Exit -> let xs,l1,p1 = rdescr s1 in let ys,l2,p2 = rdescr s2 in let se1 = Rloc(o1,l1) in let se2 = Rloc(o2,l2) in p_forall (xs@ys) (p_hyps [p1;p2] (M.separated se1 se2)) in cond::w ) w r2 ) w r1 let rec separated_from w (r1 : region) = function | r2::rs -> separated_from (separated_region w r1 r2) r1 rs | [] -> w let rec separated_regions w = function | r::rs -> separated_regions (separated_from w r rs) rs | [] -> w let separated (regions : region list) = (* forall i<j, (tau_i,R_i)#(tau_j,R_j) *) (* forall i<j, forall p in R_j, forall q in R_j, p#q *) p_conj (separated_regions [] regions) (* -------------------------------------------------------------------------- *) (* --- Included --- *) (* -------------------------------------------------------------------------- *) let included (obj1,s1) (obj2,s2) = try M.included (rloc obj1 s1) (rloc obj2 s2) with Exit -> let xs,l1,p1 = rdescr s1 in let ys,l2,p2 = rdescr s2 in let se1 = Rloc(obj1,l1) in let se2 = Rloc(obj2,l2) in p_forall xs (p_imply p1 (p_exists ys (p_and p2 (M.included se1 se2)))) (* -------------------------------------------------------------------------- *) (* --- Valid --- *) (* -------------------------------------------------------------------------- *) let on_sloc phi (obj,sloc) = match sloc with | Sloc l -> phi (Rloc(obj,l)) | Sarray(l,t,n) -> phi (Rrange(l,t,ainf,asup n)) | Srange(l,t,a,b) -> phi (Rrange(l,t,a,b)) | Sdescr(xs,l,p) -> p_forall xs (p_imply p (phi (Rloc(obj,l)))) let valid sigma acs sloc = on_sloc (M.valid sigma acs) sloc let invalid sigma sloc = on_sloc (M.invalid sigma) sloc (* -------------------------------------------------------------------------- *) (* --- Subset --- *) (* -------------------------------------------------------------------------- *) let subset ta la tb lb = match la , lb with | Vexp x , Vexp y -> F.p_equal x y | Vexp e , Vset b -> Vset.member e b | Vset a , Vexp e -> Vset.subset a [Vset.Singleton e] | Vset a , Vset b -> Vset.subset a b | Vloc _ , _ | _ , Vloc _ | Lset _ , _ | _ , Lset _ -> let ta = Ctypes.object_of_logic_pointed ta in let tb = Ctypes.object_of_logic_pointed tb in let ra = List.map (fun s -> ta,s) (sloc la) in let rb = List.map (fun s -> tb,s) (sloc lb) in p_all (fun s -> p_any (included s) rb) ra end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Cvalues.mli�����������������������������������������������������0000666�0000000�0000000�00000013001�13571573400�016211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Lifting Operations over Memory Values --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Ctypes open Sigs open Lang.F val equation : Sigs.equation -> pred (** {2 Pretty Printing} *) type 'a printer = Format.formatter -> 'a -> unit val pp_bound : term option printer val pp_value : 'a printer -> 'a value printer val pp_logic : 'a printer -> 'a logic printer val pp_region : 'a printer -> 'a region printer val pp_sloc : 'a printer -> 'a sloc printer val pp_rloc : 'a printer -> 'a rloc printer (** {2 Int-As-Booleans} *) val bool_val : unop val bool_eq : binop val bool_lt : binop val bool_neq : binop val bool_leq : binop val bool_and : binop val bool_or : binop val is_true : pred -> term (** [p ? 1 : 0] *) val is_false : pred -> term (** [p ? 0 : 1] *) (** {2 Null Values} *) val null : (term -> pred) Context.value (** test for null pointer value *) val is_null : c_object -> term -> pred (** {2 Start of Arrays} *) (** Shift a location with 0-indices wrt to its array type *) val startof : shift:('a -> c_object -> term -> 'a) -> 'a -> typ -> 'a (** {2 Typing and Sub-Typing for C and ACSL Types} *) val is_object : c_object -> 'a value -> pred val has_ctype : typ -> term -> pred val has_ltype : logic_type -> term -> pred val cdomain : c_object -> (term -> pred) option val ldomain : logic_type -> (term -> pred) option (** {2 Volatile Access} *) val volatile : ?warn:string -> unit -> bool (** Check if a volatile access must be properly modelled or ignored. In case the volatile attribute comes to be ignored, the provided warning is emitted, if any. *) (** {2 ACSL Equality} *) val equal_object : c_object -> term -> term -> pred val equal_comp : compinfo -> term -> term -> pred val equal_array : Matrix.matrix -> term -> term -> pred (** {2 C and ACSL Constants} *) val ainf : term option (** Array lower-bound, ie `Some(0)` *) val asup : int -> term option (** Array upper-bound, ie `Some(n-1)` *) val constant : constant -> term val logic_constant : logic_constant -> term val constant_exp : exp -> term val constant_term : Cil_types.term -> term (** {2 Lifting Operations over Memory Values} *) val map_sloc : ('a -> 'b) -> 'a Sigs.sloc -> 'b Sigs.sloc val map_value : ('a -> 'b) -> 'a Sigs.value -> 'b Sigs.value val map_logic : ('a -> 'b) -> 'a Sigs.logic -> 'b Sigs.logic val plain : logic_type -> term -> 'a Sigs.logic (** {2 ACSL Utilities} *) (** positive goal negative hypothesis *) type polarity = [ `Positive | `Negative | `NoPolarity ] val negate : polarity -> polarity module Logic(M : Sigs.Model) : sig open M type logic = M.loc Sigs.logic type segment = c_object * loc Sigs.sloc type region = loc Sigs.region (** {3 Projections} *) val value : logic -> term val loc : logic -> loc val vset : logic -> Vset.set val region : c_object -> logic -> region val rdescr : loc sloc -> var list * loc * pred (** {3 Morphisms} *) val map : unop -> logic -> logic val map_opp : logic -> logic val map_loc : (loc -> loc) -> logic -> logic val map_l2t : (loc -> term) -> logic -> logic val map_t2l : (term -> loc) -> logic -> logic val apply : binop -> logic -> logic -> logic val apply_add : logic -> logic -> logic val apply_sub : logic -> logic -> logic (** {3 Locations} *) val field : logic -> fieldinfo -> logic val shift : logic -> c_object -> ?size:int -> logic -> logic val load : Sigma.t -> c_object -> logic -> logic (** {3 Sets of loc-or-values} *) val union : logic_type -> logic list -> logic val inter : logic_type -> logic list -> logic val subset : logic_type -> logic -> logic_type -> logic -> pred (** {3 Regions} *) val separated : region list -> pred val included : segment -> segment -> pred val valid : Sigma.t -> acs -> segment -> pred val invalid : Sigma.t -> segment -> pred end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Definitions.ml��������������������������������������������������0000666�0000000�0000000�00000040562�13571573400�016725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Logic Definitions --- *) (* -------------------------------------------------------------------------- *) open LogicUsage open Cil_types open Cil_datatype open Ctypes open Qed.Logic open Lang open Lang.F type trigger = (var,lfun) Qed.Engine.ftrigger type typedef = (tau,field,lfun) Qed.Engine.ftypedef let rec rev_iter f = function | [] -> () | x::w -> rev_iter f w ; f x type cluster = { c_id : string ; c_title : string ; c_position : Filepath.position option ; mutable c_age : int ; mutable c_records : compinfo list ; mutable c_types : logic_type_info list ; mutable c_symbols : dfun list ; mutable c_lemmas : dlemma list ; } and dlemma = { l_name : string ; l_cluster : cluster ; l_assumed : bool ; l_types : int ; l_forall : var list ; l_triggers : trigger list list (* OR of AND triggers *) ; l_lemma : pred ; } and dfun = { d_lfun : lfun ; d_cluster : cluster ; d_types : int ; d_params : var list ; d_definition : definition ; } and definition = | Logic of tau (* return type of an abstract function *) | Function of tau * recursion * term | Predicate of recursion * pred | Inductive of dlemma list and recursion = Def | Rec module Trigger = struct open Qed.Engine let rec of_exp mode t = match F.repr t with | Fvar x -> TgVar x | Aget(a,k) -> TgGet(of_exp Cterm a,of_exp Cterm k) | Aset(a,k,v) -> TgSet(of_exp Cterm a,of_exp Cterm k,of_exp Cterm v) | Fun(f,ts) -> let ts = List.map (of_exp Cterm) ts in begin match mode with | Cterm -> TgFun(f,ts) | Cprop -> TgProp(f,ts) end | _ -> TgAny let of_term t = of_exp Cterm t let of_pred p = of_exp Cprop (F.e_prop p) let rec collect xs = function | TgAny -> xs | TgVar x -> Vars.add x xs | TgGet(a,k) -> collect (collect xs a) k | TgSet(a,k,v) -> collect (collect (collect xs a) k) v | TgFun(_,ts) | TgProp(_,ts) -> List.fold_left collect xs ts let vars = collect Vars.empty (* let rec pretty fmt = function * | TgAny -> assert false * | TgVar x -> Lang.F.QED.Var.pretty fmt x * | TgGet(t,k) -> Format.fprintf fmt "@[<hov 2>%a[%a]@]" pretty t pretty k * | TgSet(t,k,v) -> Format.fprintf fmt "@[<hov 2>%a[%a@ <- %a]@]" pretty t pretty k pretty v * | TgFun(f,ts) -> * | TgProp(f,ts) -> call Cprop f fmt ts *) end (* -------------------------------------------------------------------------- *) (* --- Registry --- *) (* -------------------------------------------------------------------------- *) module Cluster = WpContext.Index (struct type key = string type data = cluster let name = "Definitions.Cluster" let compare = String.compare let pretty = Format.pp_print_string end) module Symbol = WpContext.Index (struct type key = lfun type data = dfun let name = "Definitions.Symbol" let compare = Lang.Fun.compare let pretty = Lang.Fun.pretty end) module Lemma = WpContext.Index (struct type key = string type data = dlemma let name = "Definitions.Lemma" let compare = String.compare let pretty = Format.pp_print_string end) let touch c = c.c_age <- succ c.c_age let () = begin Symbol.callback (fun _ f -> touch f.d_cluster ; f.d_cluster.c_symbols <- f :: f.d_cluster.c_symbols) ; Lemma.callback (fun _ a -> touch a.l_cluster ; a.l_cluster.c_lemmas <- a :: a.l_cluster.c_lemmas) ; end let find_symbol = Symbol.find let define_symbol f = Symbol.define f.d_lfun f let update_symbol f = Symbol.update f.d_lfun f let find_name = Lemma.find let find_lemma l = Lemma.find l.lem_name let compile_lemma cc l = Lemma.compile (fun _name -> cc l) l.lem_name let define_lemma l = Lemma.define l.l_name l let define_type c t = begin touch c ; c.c_types <- t :: c.c_types ; end let parameters f = if WpContext.is_defined () then try List.map Lang.F.QED.sort_of_var (Symbol.find f).d_params with Not_found -> [] else [] let () = Lang.parameters parameters (* -------------------------------------------------------------------------- *) (* --- Helpers --- *) (* -------------------------------------------------------------------------- *) let cluster_id c = c.c_id let cluster_title c = c.c_title let cluster_position c = c.c_position let cluster_age c = c.c_age let cluster_compare a b = String.compare a.c_id b.c_id let pp_cluster fmt c = Format.pp_print_string fmt c.c_id let iter f = Cluster.iter_sorted (fun _key c -> f c) let newcluster ~id ?title ?position () = { c_id = id ; c_title = (match title with Some t -> t | None -> id) ; c_position = position ; c_age = 0 ; c_types = [] ; c_records = [] ; c_symbols = [] ; c_lemmas = [] ; } let cluster ~id ?title ?position () = Cluster.memoize (fun id -> newcluster ~id ?title ?position ()) id let dummy () = cluster ~id:"dummy" () let axiomatic ax = Cluster.memoize (fun id -> let title = Printf.sprintf "Axiomatic '%s'" ax.ax_name in let position = ax.ax_position in let cluster = newcluster ~id ~title ~position () in cluster) (Printf.sprintf "A_%s" ax.ax_name) let section = function | Toplevel 0 -> cluster ~id:"Axiomatic" ~title:"Global Definitions" () | Toplevel n -> let id = "Axiomatic" ^ string_of_int n in let title = Printf.sprintf "Global Definitions (continued #%d)" n in cluster ~id ~title () | Axiomatic ax -> axiomatic ax let compinfo c = Cluster.memoize (fun id -> let title = if c.cstruct then Printf.sprintf "Struct '%s'" c.cname else Printf.sprintf "Union '%s'" c.cname in let cluster = newcluster ~id ~title () in cluster.c_records <- [c] ; cluster) (Lang.comp_id c) let matrix = function | C_array _ -> assert false | C_comp c -> compinfo c | C_int _ | C_float _ | C_pointer _ -> cluster ~id:"Matrix" ~title:"Basic Arrays" () let call_fun ~result lfun cc es = Symbol.compile (Lang.local cc) lfun ; e_fun ~result lfun es let call_pred lfun cc es = Symbol.compile (Lang.local cc) lfun ; p_call lfun es (* -------------------------------------------------------------------------- *) (* --- Cluster Dependencies --- *) (* -------------------------------------------------------------------------- *) module DT = Logic_type_info.Set module DR = Compinfo.Set module DS = Datatype.String.Set module DF = FCSet.Make(Lang.Fun) module DC = FCSet.Make (struct type t = cluster let compare = cluster_compare end) (* -------------------------------------------------------------------------- *) (* --- Markers (test and set) --- *) (* -------------------------------------------------------------------------- *) type axioms = cluster * logic_lemma list class virtual visitor main = object(self) val mutable terms = Tset.empty val mutable types = DT.empty val mutable comps = DR.empty val mutable symbols = DF.empty val mutable dlemmas = DS.empty val mutable lemmas = DS.empty val mutable clusters = DC.empty val mutable theories = DS.empty val mutable locals = DC.add main DC.empty method set_local c = locals <- DC.add c locals method do_local c = if DC.mem c locals then true else (self#vcluster c ; false) method private vtau_of_ltype lt = let tau = Lang.tau_of_ltype lt in self#vtau tau ; tau method vtype t = if not (DT.mem t types) then begin types <- DT.add t types ; let cluster = section (LogicUsage.section_of_type t) in if self#do_local cluster && not (Lang.is_builtin t) then begin let def = match t.lt_def with | None -> Qed.Engine.Tabs | Some (LTsyn lt) -> Qed.Engine.Tdef (self#vtau_of_ltype lt) | Some (LTsum cs) -> let cases = List.map (fun c -> Lang.CTOR c , List.map self#vtau_of_ltype c.ctor_params ) cs in Qed.Engine.Tsum cases in self#on_type t def ; end end method vcomp r = if not (DR.mem r comps) then begin comps <- DR.add r comps ; let c = compinfo r in if self#do_local c then begin let fts = List.map (fun f -> let t = Lang.tau_of_ctype f.ftype in self#vtau t ; Cfield f , t ) r.cfields in self#on_comp r fts ; end end method vfield = function | Mfield(a,_,_,_) -> self#vlibrary a.ext_library | Cfield f -> self#vcomp f.fcomp method vadt = function | Mtype a | Mrecord(a,_) -> self#vlibrary a.ext_library | Comp r -> self#vcomp r | Atype t -> self#vtype t method vtau = function | Prop | Bool | Int | Real | Tvar _ -> () | Array(a,b) -> self#vtau a ; self#vtau b | Record _ -> assert false | Data(a,ts) -> self#vadt a ; List.iter self#vtau ts method vparam x = self#vtau (tau_of_var x) method private repr ~bool x = self#vtau (Lang.F.typeof x); match F.repr x with | Fun(f,_) -> self#vsymbol f | Rget(_,f) -> self#vfield f | Rdef fts -> List.iter (fun (f,_) -> self#vfield f) fts | Fvar x -> self#vparam x | Bind(_,t,_) -> self#vtau t | True | False | Kint _ | Kreal _ | Bvar _ | Times _ | Add _ | Mul _ | Div _ | Mod _ | Aget _ | Aset _ | Apply _ -> () | Acst _ -> self#on_library "const" | Eq _ | Neq _ | Leq _ | Lt _ | And _ | Or _ | Not _ | Imply _ | If _ -> if bool then self#on_library "bool" method vterm t = if not (Tset.mem t terms) then begin terms <- Tset.add t terms ; self#repr ~bool:true t ; F.lc_iter self#vterm t ; end method vpred p = let t = F.e_prop p in if not (Tset.mem t terms) then begin self#repr ~bool:false t ; F.lc_iter (fun e -> if F.is_prop e then self#vpred (F.p_bool e) else self#vterm e) t end method private vdefinition = function | Logic t -> self#vtau t | Function(t,_,e) -> self#vtau t ; self#vterm e | Predicate(_,p) -> self#vpred p | Inductive _ -> () method private vproperties = function | Logic _ | Function _ | Predicate _ -> () | Inductive cases -> List.iter (fun l -> self#vdlemma l) cases method private vdfun d = begin List.iter self#vparam d.d_params ; self#vdefinition d.d_definition ; self#vproperties d.d_definition ; self#on_dfun d ; end method private vlfun f = match Symbol.find f with | exception Not_found -> Wp_parameters.fatal "Undefined symbol '%a'" Fun.pretty f | d -> let c = d.d_cluster in if self#do_local c then self#vdfun d method vsymbol f = if not (DF.mem f symbols) then begin symbols <- DF.add f symbols ; match f with | Model { m_source = Extern e } -> self#vlibrary e.ext_library | Model { m_source = Generated _ } | ACSL _ -> self#vlfun f | CTOR c -> self#vadt (Lang.atype c.ctor_type) end method private vtrigger = function | Qed.Engine.TgAny -> () | Qed.Engine.TgVar x -> self#vparam x | Qed.Engine.TgGet(a,k) -> begin self#vtrigger a ; self#vtrigger k ; end | Qed.Engine.TgSet(a,k,v) -> begin self#vtrigger a ; self#vtrigger k ; self#vtrigger v ; end | Qed.Engine.TgFun(f,tgs) | Qed.Engine.TgProp(f,tgs) -> self#vsymbol f ; List.iter self#vtrigger tgs method private vdlemma a = if not (DS.mem a.l_name dlemmas) then begin dlemmas <- DS.add a.l_name dlemmas ; List.iter self#vparam a.l_forall ; List.iter (List.iter self#vtrigger) a.l_triggers ; self#vpred a.l_lemma ; end method vlemma lem = let l = lem.lem_name in if not (DS.mem l lemmas) then begin lemmas <- DS.add l lemmas ; try let a = Lemma.find l in if self#do_local a.l_cluster then (self#vdlemma a; self#on_dlemma a) with Not_found -> Wp_parameters.fatal "Lemma '%s' undefined" l end method vcluster c = if not (DC.mem c clusters) then begin clusters <- DC.add c clusters ; self#on_cluster c ; end method vlibrary thy = if not (DS.mem thy theories) then begin theories <- DS.add thy theories ; try let deps = LogicBuiltins.dependencies thy in List.iter self#vlibrary deps ; self#on_library thy ; with Not_found -> Wp_parameters.fatal ~current:false "Unknown library '%s'" thy end method vgoal (axioms : axioms option) prop = match axioms with | None -> (* Visit a goal *) begin let hs = LogicUsage.proof_context () in List.iter self#vlemma hs ; self#vpred prop ; end | Some(cluster,hs) -> (* Visit the goal corresponding to a lemma *) begin self#section (cluster_title cluster) ; self#set_local cluster ; List.iter self#vlemma hs ; self#vpred prop ; end method vtypes = (* Visit the types *) rev_iter self#vcomp main.c_records ; rev_iter self#vtype main.c_types method vsymbols = (* Visit the definitions *) rev_iter (fun d -> self#vsymbol d.d_lfun) main.c_symbols ; method vlemmas = (* Visit the lemmas *) rev_iter (fun l -> self#vdlemma l; self#on_dlemma l) main.c_lemmas ; method vself = (* Visit a cluster *) begin self#vtypes ; self#vsymbols ; self#vlemmas ; end method virtual section : string -> unit method virtual on_library : string -> unit method virtual on_cluster : cluster -> unit method virtual on_type : logic_type_info -> typedef -> unit method virtual on_comp : compinfo -> (field * tau) list -> unit method virtual on_dlemma : dlemma -> unit method virtual on_dfun : dfun -> unit end (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Definitions.mli�������������������������������������������������0000666�0000000�0000000�00000012040�13571573400�017064� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open LogicUsage open Cil_types open Ctypes open Lang open Lang.F type cluster val dummy : unit -> cluster val cluster : id:string -> ?title:string -> ?position:Filepath.position -> unit -> cluster val axiomatic : axiomatic -> cluster val section : logic_section -> cluster val compinfo : compinfo -> cluster val matrix : c_object -> cluster val cluster_id : cluster -> string (** Unique *) val cluster_title : cluster -> string val cluster_position : cluster -> Filepath.position option val cluster_age : cluster -> int val cluster_compare : cluster -> cluster -> int val pp_cluster : Format.formatter -> cluster -> unit val iter : (cluster -> unit) -> unit type trigger = (var,lfun) Qed.Engine.ftrigger type typedef = (tau,field,lfun) Qed.Engine.ftypedef type dlemma = { l_name : string ; l_cluster : cluster ; l_assumed : bool ; l_types : int ; l_forall : var list ; l_triggers : trigger list list ; (** OR of AND-triggers *) l_lemma : pred ; } type definition = | Logic of tau | Function of tau * recursion * term | Predicate of recursion * pred | Inductive of dlemma list and recursion = Def | Rec type dfun = { d_lfun : lfun ; d_cluster : cluster ; d_types : int ; d_params : var list ; d_definition : definition ; } module Trigger : sig val of_term : term -> trigger val of_pred : pred -> trigger val vars : trigger -> Vars.t end val find_symbol : lfun -> dfun (** @raise Not_found if symbol is not compiled (yet) *) val define_symbol : dfun -> unit val update_symbol : dfun -> unit val find_name : string -> dlemma val find_lemma : logic_lemma -> dlemma (** @raise Not_found if lemma is not compiled (yet) *) val compile_lemma : (logic_lemma -> dlemma) -> logic_lemma -> unit val define_lemma : dlemma -> unit val define_type : cluster -> logic_type_info -> unit val call_fun : result:tau -> lfun -> (lfun -> dfun) -> term list -> term val call_pred : lfun -> (lfun -> dfun) -> term list -> pred type axioms = cluster * logic_lemma list class virtual visitor : cluster -> object (** {2 Locality} *) method set_local : cluster -> unit method do_local : cluster -> bool (** {2 Visiting items} *) method vadt : ADT.t -> unit method vtype : logic_type_info -> unit method vcomp : compinfo -> unit method vfield : Field.t -> unit method vtau : tau -> unit method vparam : var -> unit method vterm : term -> unit method vpred : pred -> unit method vsymbol : lfun -> unit method vlemma : logic_lemma -> unit method vcluster : cluster -> unit method vlibrary : string -> unit method vgoal : axioms option -> F.pred -> unit method vtypes : unit (** Visit all typedefs *) method vsymbols : unit (** Visit all definitions *) method vlemmas : unit (** Visit all lemmas *) method vself : unit (** Visit all records, types, defs and lemmas *) (** {2 Visited definitions} *) method virtual section : string -> unit (** Comment *) method virtual on_library : string -> unit (** External library to import *) method virtual on_cluster : cluster -> unit (** Outer cluster to import *) method virtual on_type : logic_type_info -> typedef -> unit (** This local type must be defined *) method virtual on_comp : compinfo -> (field * tau) list -> unit (** This local compinfo must be defined *) method virtual on_dlemma : dlemma -> unit (** This local lemma must be defined *) method virtual on_dfun : dfun -> unit (** This local function must be defined *) end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Factory.ml������������������������������������������������������0000666�0000000�0000000�00000032002�13571573400�016047� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Model Factory --- *) (* -------------------------------------------------------------------------- *) type mheap = Hoare | ZeroAlias | Region | Typed of MemTyped.pointer type mvar = Raw | Var | Ref | Caveat type setup = { mvar : mvar ; mheap : mheap ; cint : Cint.model ; cfloat : Cfloat.model ; } (*[LC] All types in [model] must be Pervasives-comparable *) type driver = LogicBuiltins.driver (* -------------------------------------------------------------------------- *) (* --- Description & Id --- *) (* -------------------------------------------------------------------------- *) let main (i,t) name = begin Buffer.add_string i name ; Buffer.add_string t (String.capitalize_ascii name) ; end let add (i,t) part = begin Buffer.add_char i '_' ; Buffer.add_string i part ; Buffer.add_char t ' ' ; Buffer.add_char t '(' ; Buffer.add_string t (String.capitalize_ascii part) ; Buffer.add_char t ')' ; end let descr_mtyped d = function | MemTyped.NoCast -> add d "nocast" | MemTyped.Unsafe -> add d "cast" | MemTyped.Fits -> () let descr_mheap d = function | Region -> main d "region" | ZeroAlias -> main d "zeroalias" | Hoare -> main d "hoare" | Typed p -> main d "typed" ; descr_mtyped d p let descr_mvar d = function | Var -> () | Ref -> add d "ref" | Raw -> add d "raw" | Caveat -> add d "caveat" let descr_cint d = function | Cint.Machine -> () | Cint.Natural -> add d "nat" let descr_cfloat d = function | Cfloat.Real -> add d "real" | Cfloat.Float -> () let descr_setup (s:setup) = begin let i = Buffer.create 40 in let t = Buffer.create 40 in let d = (i,t) in descr_mheap d s.mheap ; descr_mvar d s.mvar ; descr_cint d s.cint ; descr_cfloat d s.cfloat ; ( Buffer.contents i , Buffer.contents t ) end let descriptions = Hashtbl.create 31 (*[LC] Not projectified: simple strings *) let describe s = try Hashtbl.find descriptions s with Not_found -> let w = descr_setup s in Hashtbl.add descriptions s w ; w (* -------------------------------------------------------------------------- *) (* --- Variable Proxy --- *) (* -------------------------------------------------------------------------- *) module type Proxy = sig val datatype : string val param : Cil_types.varinfo -> MemoryContext.param val iter : ?kf:Kernel_function.t -> init:bool -> (Cil_types.varinfo -> unit) -> unit end module MakeVarUsage(V : Proxy) : MemVar.VarUsage = struct let datatype = "VarUsage." ^ V.datatype let param x = let get_addr = Wp_parameters.InHeap.get in let get_ctxt = Wp_parameters.InCtxt.get in let get_refs = Wp_parameters.ByRef.get in let get_vars = Wp_parameters.ByValue.get in let open Cil_types in let module S = Datatype.String.Set in let open MemoryContext in if S.mem x.vname (get_addr ()) then ByAddr else if S.mem x.vname (get_ctxt ()) then InContext else if S.mem x.vname (get_refs ()) then ByRef else if S.mem x.vname (get_vars ()) then ByValue else V.param x let hypotheses () = let kf,init = match WpContext.get_scope () with | WpContext.Global -> None,false | WpContext.Kf f -> Some f, WpStrategy.is_main_init f in let w = ref MemoryContext.empty in V.iter ?kf ~init (fun vi -> w := MemoryContext.set vi (param vi) !w) ; MemoryContext.requires !w end (* -------------------------------------------------------------------------- *) (* --- Static Proxy (no preliminary analysis) --- *) (* -------------------------------------------------------------------------- *) module Raw : Proxy = struct let datatype = "Raw" let param _x = MemoryContext.ByValue (* if x.vaddrof then Separation.InHeap else Separation.ByValue *) let iter ?kf ~init f = begin ignore init ; Globals.Vars.iter (fun x _initinfo -> f x) ; match kf with | None -> () | Some kf -> List.iter f (Kernel_function.get_formals kf) ; end end module Static : Proxy = struct let datatype = "Static" let param x = let open Cil_types in if x.vaddrof || Cil.isArrayType x.vtype || Cil.isPointerType x.vtype then MemoryContext.ByAddr else MemoryContext.ByValue let iter = Raw.iter end (* -------------------------------------------------------------------------- *) (* --- RefUsage-based Proxies --- *) (* -------------------------------------------------------------------------- *) let is_ptr x = Cil.isPointerType x.Cil_types.vtype let is_fun_ptr x = Cil.isFunctionType x.Cil_types.vtype let is_formal_ptr x = x.Cil_types.vformal && is_ptr x let is_init kf x = WpStrategy.is_main_init kf || Wp_parameters.AliasInit.get () || ( WpStrategy.isInitConst () && WpStrategy.isGlobalInitConst x ) let refusage_param ~byref ~context x = let kf,init = match WpContext.get_scope () with | WpContext.Global -> None , false | WpContext.Kf kf -> Some kf , is_init kf x in match RefUsage.get ?kf ~init x with | RefUsage.NoAccess -> MemoryContext.NotUsed | RefUsage.ByAddr -> MemoryContext.ByAddr | RefUsage.ByValue -> if context && is_formal_ptr x then MemoryContext.InContext else if is_ptr x && not (is_fun_ptr x) then MemoryContext.ByShift else MemoryContext.ByValue | RefUsage.ByRef -> if byref then MemoryContext.ByRef else MemoryContext.ByValue | RefUsage.ByArray -> if context && is_formal_ptr x then MemoryContext.InArray else MemoryContext.ByShift let refusage_iter ?kf ~init f = RefUsage.iter ?kf ~init (fun x _usage -> f x) module Var : Proxy = struct let datatype = "Var" let param = refusage_param ~byref:false ~context:false let iter = refusage_iter end module Ref : Proxy = struct let datatype = "Ref" let param = refusage_param ~byref:true ~context:false let iter = refusage_iter end module Caveat : Proxy = struct let datatype = "Caveat" let param = refusage_param ~byref:true ~context:true let iter = refusage_iter end (* -------------------------------------------------------------------------- *) (* --- Generator & Model --- *) (* -------------------------------------------------------------------------- *) (* Each model must be instanciated statically because of registered memory models identifiers and Frama-C states *) module Register(V : Proxy)(M : Sigs.Model) = MemVar.Make(MakeVarUsage(V))(M) module Model_Hoare_Raw = Register(Raw)(MemEmpty) module Model_Hoare_Ref = Register(Ref)(MemEmpty) module Model_Typed_Var = Register(Var)(MemTyped) module Model_Typed_Ref = Register(Ref)(MemTyped) module Model_Caveat = Register(Caveat)(MemTyped) module MakeCompiler(M:Sigs.Model) = struct module M = M module C = CodeSemantics.Make(M) module L = LogicSemantics.Make(M) module A = LogicAssigns.Make(M)(C)(L) end module Comp_Region = MakeCompiler(Register(Static)(MemRegion)) module Comp_MemZeroAlias = MakeCompiler(MemZeroAlias) module Comp_Hoare_Raw = MakeCompiler(Model_Hoare_Raw) module Comp_Hoare_Ref = MakeCompiler(Model_Hoare_Ref) module Comp_MemTyped = MakeCompiler(MemTyped) module Comp_Typed_Var = MakeCompiler(Model_Typed_Var) module Comp_Typed_Ref = MakeCompiler(Model_Typed_Ref) module Comp_Caveat = MakeCompiler(Model_Caveat) let compiler mheap mvar : (module Sigs.Compiler) = match mheap , mvar with | ZeroAlias , _ -> (module Comp_MemZeroAlias) | Region , _ -> (module Comp_Region) | _ , Caveat -> (module Comp_Caveat) | Hoare , (Raw|Var) -> (module Comp_Hoare_Raw) | Hoare , Ref -> (module Comp_Hoare_Ref) | Typed _ , Raw -> (module Comp_MemTyped) | Typed _ , Var -> (module Comp_Typed_Var) | Typed _ , Ref -> (module Comp_Typed_Ref) (* -------------------------------------------------------------------------- *) (* --- Tuning --- *) (* -------------------------------------------------------------------------- *) let configure_mheap = function | Hoare -> MemEmpty.configure () | ZeroAlias -> MemZeroAlias.configure () | Region -> MemRegion.configure () | Typed p -> MemTyped.configure () ; Context.set MemTyped.pointer p let configure (s:setup) (d:driver) () = begin configure_mheap s.mheap ; Cint.configure s.cint ; Cfloat.configure s.cfloat ; Context.set LogicBuiltins.driver d ; end (* -------------------------------------------------------------------------- *) (* --- Access --- *) (* -------------------------------------------------------------------------- *) module COMPILERS = FCMap.Make (struct type t = setup * driver let compare (s,d) (s',d') = let cmp = Transitioning.Stdlib.compare s s' in if cmp <> 0 then cmp else LogicBuiltins.compare d d' end) let instances = ref (COMPILERS.empty : WpContext.model COMPILERS.t) let instance (s:setup) (d:driver) = try COMPILERS.find (s,d) !instances with Not_found -> let id,descr = describe s in let module CC = (val compiler s.mheap s.mvar) in let tuning = [configure s d] in let hypotheses = CC.M.hypotheses in let id,descr = if LogicBuiltins.is_default d then id,descr else ( id ^ "_" ^ LogicBuiltins.id d , descr ^ " (Driver " ^ LogicBuiltins.descr d ^ ")" ) in let model = WpContext.register ~id ~descr ~tuning ~hypotheses () in instances := COMPILERS.add (s,d) model !instances ; model let ident s = fst (describe s) let descr s = snd (describe s) let split ~warning (m:string) : string list = let tk = ref [] in let buffer = Buffer.create 32 in let flush () = if Buffer.length buffer > 0 then begin tk := !tk @ [Buffer.contents buffer] ; Buffer.clear buffer ; end in String.iter (fun c -> match c with | 'A' .. 'Z' -> Buffer.add_char buffer c | '_' | ',' | '@' | '+' | ' ' | '\t' | '\n' | '(' | ')' -> flush () | _ -> warning (Printf.sprintf "In model spec %S : unexpected character '%c'" m c) ) (String.uppercase_ascii m) ; flush () ; !tk let update_config ~warning m s = function | "ZEROALIAS" -> { s with mheap = ZeroAlias } | "REGION" -> { s with mheap = Region } | "HOARE" -> { s with mheap = Hoare } | "TYPED" -> { s with mheap = Typed MemTyped.Fits } | "CAST" -> { s with mheap = Typed MemTyped.Unsafe } | "NOCAST" -> { s with mheap = Typed MemTyped.NoCast } | "CAVEAT" -> { s with mvar = Caveat } | "RAW" -> { s with mvar = Raw } | "REF" -> { s with mvar = Ref } | "VAR" -> { s with mvar = Var } | "INT" | "CINT" -> { s with cint = Cint.Machine } | "NAT" -> { s with cint = Cint.Natural } | "REAL" -> { s with cfloat = Cfloat.Real } | "FLOAT" | "CFLOAT" -> { s with cfloat = Cfloat.Float } | t -> warning (Printf.sprintf "In model spec %S : unknown '%s' selector@." m t) ; s let apply_config ~warning (s:setup) m : setup = List.fold_left (update_config ~warning m) s (split ~warning m) let default = { mheap = Typed MemTyped.Fits ; mvar = Var ; cint = Cint.Machine ; cfloat = Cfloat.Float ; } let abort msg = Wp_parameters.abort "%s" msg let parse ?(default=default) ?(warning=abort) opts = List.fold_left (apply_config ~warning) default opts ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Factory.mli�����������������������������������������������������0000666�0000000�0000000�00000005050�13571573400�016223� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Model Factory --- *) (* -------------------------------------------------------------------------- *) type mheap = Hoare | ZeroAlias | Region | Typed of MemTyped.pointer type mvar = Raw | Var | Ref | Caveat type setup = { mvar : mvar ; mheap : mheap ; cint : Cint.model ; cfloat : Cfloat.model ; } type driver = LogicBuiltins.driver val ident : setup -> string val descr : setup -> string val compiler : mheap -> mvar -> (module Sigs.Compiler) val configure : setup -> driver -> WpContext.tuning val instance : setup -> driver -> WpContext.model val default : setup (** ["Var,Typed,Nat,Real"] memory model. *) val parse : ?default:setup -> ?warning:(string -> unit) -> string list -> setup (** Apply specifications to default setup. Default setup is [Factory.default]. Default warning is [Wp_parameters.abort]. *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Filtering.ml����������������������������������������������������0000666�0000000�0000000�00000026247�13571573400�016401� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Sequent Cleaning --- *) (* -------------------------------------------------------------------------- *) open Qed.Logic open Lang open Lang.F (* Inductive Properties: - filter ~polarity:true p ==> p - p ==> filter ~polarity:false p *) let rec filter ~polarity f p = match F.p_expr p with | And ps when polarity -> F.p_all (filter ~polarity f) ps | Or ps when not polarity -> F.p_any (filter ~polarity f) ps | Not p -> F.p_not (filter_inv ~polarity f p) | Imply(hs,p) -> F.p_hyps (List.map (filter_inv ~polarity f) hs) (filter ~polarity f p) | _ -> (* polarity=true: FALSE -> p polarity=false: p -> TRUE *) if f p then p else if polarity then F.p_false else F.p_true and filter_inv ~polarity f p = filter ~polarity:(not polarity) f p (* -------------------------------------------------------------------------- *) (* --- Usage Domain --- *) (* -------------------------------------------------------------------------- *) module Funs = Qed.Mergeset.Make(Fun) module Fmap = Qed.Mergemap.Make(Field) module Imap = Qed.Intmap type usage = | Top | Bot | Array of usage | Index of usage Imap.t (* Constant map *) | Field of usage Fmap.t module Usage = struct let rec pretty fmt = function | Top -> Format.pp_print_string fmt "Top" | Bot -> Format.pp_print_string fmt "Bot" | Array u -> Format.fprintf fmt "[%a]" pretty u | Index m -> begin Format.fprintf fmt "@[<hov 2>[" ; Imap.iteri (fun k u -> Format.fprintf fmt "@ %d:%a" k pretty u) m ; Format.fprintf fmt " ]@]" ; end | Field m -> begin Format.fprintf fmt "@[<hov 2>{" ; Fmap.iter (fun fd u -> Format.fprintf fmt "@ %a:%a" Field.pretty fd pretty u) m ; Format.fprintf fmt " }@]" ; end let rec join u v = match u,v with | Top , _ | _ , Top -> Top | Bot , w | w , Bot -> w | Array u , Array v -> Array(join u v) | Index m , Array u | Array u , Index m -> Array(Imap.fold (fun u w -> join u w) m u) | Index a , Index b -> Index(Imap.union (fun _ u v -> join u v) a b) | Field a , Field b -> Field(Fmap.union (fun _ u v -> join u v) a b) | (Index _ | Array _) , Field _ | Field _ , (Index _ | Array _) -> Top let meet_array = function Bot -> Bot | u -> Array u let meet_filter = function Bot -> None | u -> Some u let meet_index m = if Imap.is_empty m then Bot else Index m let meet_field m = if Fmap.is_empty m then Bot else Field m let rec meet u v = match u,v with | Top , w | w , Top -> w | Bot , _ | _ , Bot -> Bot | Array u , Array v -> meet_array (meet u v) | Index m , Array v | Array v , Index m -> meet_index (Imap.mapf (fun _ u -> meet_filter (meet u v)) m) | Index a , Index b -> meet_index (Imap.interf (fun _ u v -> meet_filter (meet u v)) a b) | Field a , Field b -> meet_field (Fmap.interf (fun _ u v -> meet_filter (meet u v)) a b) | (Index _ | Array _) , Field _ | Field _ , (Index _ | Array _) -> Bot let meetf u v = meet_filter (meet u v) let rec leq u v = match u , v with | Bot , _ -> true | _ , Top -> true | _ , Bot -> false | Array u , Array v -> leq u v | Array _ , (Index _ | Field _) -> false | Index m , Array v -> Imap.for_all (fun _ u -> leq u v) m | Index a , Index b -> Imap.subset (fun _ u v -> leq u v) a b | Index _ , Field _ -> false | Field _ , (Array _ | Index _) -> false | Field a , Field b -> Fmap.subset (fun _ u v -> leq u v) a b | Top , _ -> false end type domain = { vars : usage Vmap.t ; funs : Funs.t } module Domain = struct let pretty fmt d = begin Format.fprintf fmt "@[<hv 0>@[<hv 2>{" ; Vmap.iter (fun x u -> Format.fprintf fmt "@ @[<hov 2>%a: %a@] ;" F.pp_var x Usage.pretty u) d.vars ; Funs.iter (fun f -> Format.fprintf fmt "@ %a ;" Fun.pretty f) d.funs ; Format.fprintf fmt "@]@ }@]" ; end let join d1 d2 = { vars = Vmap.union (fun _ u v -> Usage.join u v) d1.vars d2.vars ; funs = Funs.union d1.funs d2.funs } let meet d1 d2 = { vars = Vmap.interf (fun _ u v -> Usage.meetf u v) d1.vars d2.vars ; funs = Funs.inter d1.funs d2.funs } let empty = { vars = Vmap.empty ; funs = Funs.empty } let is_empty d = Vmap.is_empty d.vars && Funs.is_empty d.funs let separated u v = is_empty (meet u v) let leq u v = Funs.subset u.funs v.funs && Vmap.subset (fun _ u v -> Usage.leq u v) u.vars v.vars end type delta = Darray | Dindex of int | Dfield of Field.t type value = | E | X of F.var * delta list | D of domain module Value = struct let rec delta = function | [] -> Top | Darray :: w -> Array(delta w) | Dindex i :: w -> Index(Imap.add i (delta w) Imap.empty) | Dfield f :: w -> Field(Fmap.add f (delta w) Fmap.empty) let path x ds = { vars = Vmap.add x (delta ds) Vmap.empty ; funs = Funs.empty } [@@@ warning "-32"] let pretty fmt = function | E -> Format.pp_print_string fmt "empty" | X(x,ds) -> Format.fprintf fmt "%a(%a)@." F.pp_var x Usage.pretty (delta ds) | D dom -> Domain.pretty fmt dom [@@@ warning "+32"] let symbol f = { vars = Vmap.empty ; funs = Funs.singleton f } let getfield v fd = match v with | X(x,ds) -> X(x,ds @ [Dfield fd]) | D _ | E -> v let getindex ~mu v k = match v with | X(x,ds) -> begin match F.repr k with | Kint z -> let d = try Dindex(Integer.to_int z) with Z.Overflow -> Darray in X( x , ds @ [ d ] ) | _ -> let ds = ds @ [ Darray ] in let dk = mu k in if Domain.is_empty dk then X(x,ds) else D (Domain.join (path x ds) dk) end | D d -> D (Domain.join d (mu k)) | E -> D (mu k) type env = { mutable mvalue : value Tmap.t ; mutable mdomain : domain Tmap.t ; } let create () = { mvalue = Tmap.empty ; mdomain = Tmap.empty } let rec compute env e = try Tmap.find e env.mvalue with Not_found -> let module L = Qed.Logic in match F.repr e with | L.True | L.False | L.Kint _ | L.Kreal _ -> E | _ -> let result = match F.repr e with | L.Rget( r , f ) -> getfield (compute env r) f | L.Aget( r , k ) -> getindex ~mu:(domain env) (compute env r) k | L.Fvar x -> X(x,[]) | L.Fun(f,_) -> D (subterms env (symbol f) e) | _ -> D (subterms env Domain.empty e) in env.mvalue <- Tmap.add e result env.mvalue ; result and subterms env d0 e = let pool = ref d0 in F.lc_iter (fun e -> pool := Domain.join (domain env e) !pool) e ; !pool and domain env e = try Tmap.find e env.mdomain with Not_found -> match compute env e with | E -> Domain.empty | D dom -> dom | X(x,ds) -> let dom = path x ds in env.mdomain <- Tmap.add e dom env.mdomain ; dom end (* -------------------------------------------------------------------------- *) (* --- Collect --- *) (* -------------------------------------------------------------------------- *) module Fixpoint = struct type env = { usage : Value.env ; mutable target : domain ; } let rec collect_hyp env p = match F.p_expr p with | And ps | Or ps -> List.iter (collect_hyp env) ps | Imply(hs,p) -> List.iter (collect_hyp env) hs ; collect_hyp env p | _ -> let dp = Value.domain env.usage (F.e_prop p) in if not (Domain.separated dp env.target) then ( env.target <- Domain.join dp env.target ) let rec collect_seq env s = Conditions.iter (collect_step env) s and collect_step env s = let open Conditions in match s.condition with | Type _ | State _ -> () | Core p | Have p | When p | Init p -> collect_hyp env p | Either cs -> List.iter (collect_seq env) cs | Branch(p,a,b) -> begin collect_hyp env p ; collect_seq env a ; collect_seq env b ; end let rec fixpoint env sequence = let d0 = env.target in collect_seq env sequence ; let d1 = env.target in if Domain.leq d1 d0 then d1 else ( fixpoint env sequence ) let target (sequence,goal) = let usage = Value.create () in let target = Value.domain usage (F.e_prop goal) in if Domain.is_empty target then usage , target else usage , fixpoint { usage ; target } sequence end (* -------------------------------------------------------------------------- *) (* --- Calculus --- *) (* -------------------------------------------------------------------------- *) let compute ?(anti=false) sequent = let usage,target = Fixpoint.target sequent in let d_accept = match Domain.is_empty target , anti with | true , false -> Domain.is_empty | true , true -> fun d -> not (Domain.is_empty d) | false , false -> fun d -> not (Domain.is_empty d) && Domain.leq d target | false , true -> fun d -> Domain.is_empty d || not (Domain.leq d target) in let accept p = d_accept (Value.domain usage (F.e_prop p)) in Conditions.map_sequence (filter ~polarity:false accept) (fst sequent) , filter ~polarity:true accept (snd sequent) (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Filtering.mli���������������������������������������������������0000666�0000000�0000000�00000004522�13571573400�016542� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Sequent Cleaning *) (* -------------------------------------------------------------------------- *) open Lang (** Erase parts of a predicate that do not satisfies the condition. The erased parts are replaced by: - [true] when [~polarity:false] (for hypotheses) - [false] when [~polarity:true] (for goals) Hence, we have: - [filter ~polarity:true f p ==> p] - [p ==> filter ~polarity:false f p] See [theory/filtering.why] for proofs. *) val filter : polarity:bool -> (F.pred -> bool) -> F.pred -> F.pred open Conditions val compute : ?anti:bool -> sequent -> sequent (* -------------------------------------------------------------------------- *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Footprint.ml����������������������������������������������������0000666�0000000�0000000�00000012631�13571573400�016432� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module F = Lang.F (* -------------------------------------------------------------------------- *) (* --- Lang Iterator --- *) (* -------------------------------------------------------------------------- *) let iter f e = let q = Queue.create () in Queue.add e q ; while not (Queue.is_empty q) do let e = Queue.pop q in f e ; F.lc_iter (fun e -> Queue.push e q) e done let once f e = let q = Queue.create () in let m = ref F.Tset.empty in let once m e = if F.Tset.mem e !m then false else (m := F.Tset.add e !m ; true) in Queue.add e q ; while not (Queue.is_empty q) do let e = Queue.pop q in f e ; F.lc_iter (fun e -> if once m e then Queue.push e q) e done (* -------------------------------------------------------------------------- *) (* --- Head Footprint --- *) (* -------------------------------------------------------------------------- *) let head_fields = function | [] -> "" | (Lang.Mfield(mdt,_,_,_),_)::_ -> mdt.Lang.ext_debug | (Lang.Cfield fd,_):: _ -> let open Cil_types in fd.fcomp.cname let head e = let open Qed.Logic in match F.repr e with | Kint z -> Z.to_string z | Kreal r -> Q.to_string r | Fvar x -> Printf.sprintf "$%s" (F.Var.basename x) | Bvar(k,_) -> Printf.sprintf "#%d" k | True -> "T" | False -> "F" | And _ -> "&" | Or _ -> "|" | Not _ -> "!" | Imply _ -> ">" | Eq _ -> "=" | Lt _ -> "<" | Leq _ -> "<=" | Neq _ -> "~" | Add _ -> "+" | Mul _ -> "*" | Times(k,_) -> Printf.sprintf ".%s" (Z.to_string k) | Div _ -> "/" | Mod _ -> "%" | If _ -> "?" | Aget _ -> "[]" | Acst _ -> "[.]" | Aset _ -> "[=]" | Rget(_,fd) -> Pretty_utils.sfprintf ".%a" Lang.Field.pretty fd | Rdef fds -> Pretty_utils.sfprintf "{%s}" (head_fields fds) | Fun(f,_) -> Pretty_utils.to_string Lang.Fun.pretty f | Apply _ -> "()" | Bind(Forall,_,_) -> "\\F" | Bind(Exists,_,_) -> "\\E" | Bind(Lambda,_,_) -> "\\L" (* -------------------------------------------------------------------------- *) (* --- Term Footprint --- *) (* -------------------------------------------------------------------------- *) let pattern e = let buffer = Buffer.create 32 in (try iter (fun e -> Buffer.add_string buffer (head e) ; if Buffer.length buffer >= 32 then raise Exit) e with Exit -> ()) ; Buffer.contents buffer (* -------------------------------------------------------------------------- *) (* --- Term Matching --- *) (* -------------------------------------------------------------------------- *) let _prefix m k m' = let n = String.length m in let n' = String.length m' in k+n' <= n && (try for i = 0 to n'-1 do if m.[k+i] != m'.[i] then raise Exit done ; true with Exit -> false) let matches fp e = let fe = pattern e in (*TODO: implement partial mach*) fp = fe (* -------------------------------------------------------------------------- *) (* --- Occurrence --- *) (* -------------------------------------------------------------------------- *) type occurrence = int * string exception Located of occurrence exception Found of F.term let locate ~select ~inside = let k = ref 0 in let m = pattern select in try once (fun e -> if e == select then raise (Located(!k,m)) ; if matches m e then incr k ; ) inside ; raise Not_found with Located fp -> fp let lookup ~occur ~inside = let k = ref (succ (fst occur)) in let m = snd occur in try once (fun e -> if matches m e then decr k ; if !k = 0 then raise (Found e) ; ) inside ; raise Not_found with Found e -> e �������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Footprint.mli���������������������������������������������������0000666�0000000�0000000�00000004664�13571573400�016612� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Term Footprints *) (* -------------------------------------------------------------------------- *) open Lang.F (** Width-first full iterator. *) val iter : (term -> unit) -> term -> unit (** Width-first once iterator. *) val once : (term -> unit) -> term -> unit (** Head only footprint *) val head : term -> string (** Generate head footprint up to size *) val pattern : term -> string (** Head match *) val matches : string -> term -> bool (** [k]-th occurrence of the footprint in a term *) type occurrence = int * string (** Locate the occurrence of [select] footprint inside a term. *) val locate : select:term -> inside:term -> occurrence (** Retrieve back the [k]-th occurrence of a footprint inside a term. *) val lookup : occur:occurrence -> inside:term -> term ����������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Generator.ml����������������������������������������������������0000666�0000000�0000000�00000011516�13571573400�016375� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- WP Computer (main entry points) --- *) (* -------------------------------------------------------------------------- *) class type computer = object method lemma : bool method model : WpContext.model method add_strategy : WpStrategy.strategy -> unit method add_lemma : LogicUsage.logic_lemma -> unit method compute : Wpo.t Bag.t end (* -------------------------------------------------------------------------- *) (* --- Property Entry Point --- *) (* -------------------------------------------------------------------------- *) let compute_ip cc ip = let open Property in match ip with | IPLemma _ | IPAxiomatic _ -> let rec iter cc = function | IPLemma {il_name} -> cc#add_lemma (LogicUsage.logic_lemma il_name) | IPAxiomatic {iax_props} -> List.iter (iter cc) iax_props | _ -> () in iter cc ip ; cc#compute | IPBehavior {ib_kf; ib_bhv} -> let model = cc#model in let bhv = [ib_bhv.Cil_types.b_name] in let assigns = WpAnnot.WithAssigns in List.iter cc#add_strategy (WpAnnot.get_function_strategies ~model ~assigns ~bhv ib_kf) ; cc#compute | IPComplete _ | IPDisjoint _ | IPCodeAnnot _ | IPAllocation _ | IPAssigns _ | IPDecrease _ | IPPredicate _ -> let model = cc#model in let assigns = WpAnnot.WithAssigns in List.iter cc#add_strategy (WpAnnot.get_id_prop_strategies ~model ~assigns ip) ; cc#compute | IPFrom _ | IPAxiom _ | IPReachable _ | IPPropertyInstance _ | IPOther _ | IPTypeInvariant _ | IPGlobalInvariant _ | IPExtended _ -> Wp_parameters.result "Nothing to compute for '%a'" pretty ip ; Bag.empty (* -------------------------------------------------------------------------- *) (* --- Annotations Entry Point --- *) (* -------------------------------------------------------------------------- *) let add_kf cc ?bhv ?prop kf = let model = cc#model in let assigns = WpAnnot.WithAssigns in List.iter cc#add_strategy (WpAnnot.get_function_strategies ~model ~assigns ?bhv ?prop kf) let add_lemmas cc = function | None | Some[] -> LogicUsage.iter_lemmas (fun lem -> let idp = WpPropId.mk_lemma_id lem in if WpAnnot.filter_status idp then cc#add_lemma lem) | Some ps -> if List.mem "-@lemmas" ps then () else LogicUsage.iter_lemmas (fun lem -> let idp = WpPropId.mk_lemma_id lem in if WpAnnot.filter_status idp && WpPropId.select_by_name ps idp then cc#add_lemma lem) let compute_kf cc ?kf ?bhv ?prop () = begin Extlib.may (add_kf cc ?bhv ?prop) kf ; cc#compute end let compute_selection cc ?(fct=Wp_parameters.Fct_all) ?bhv ?prop () = begin add_lemmas cc prop ; Wp_parameters.iter_fct (add_kf cc ?bhv ?prop) fct ; cc#compute end let compute_call cc stmt = let model = cc#model in List.iter cc#add_strategy (WpAnnot.get_call_pre_strategies ~model stmt) ; cc#compute (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Generator.mli���������������������������������������������������0000666�0000000�0000000�00000004664�13571573400�016554� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- WP Computer (main entry points) --- *) (* -------------------------------------------------------------------------- *) class type computer = object method lemma : bool method model : WpContext.model method add_strategy : WpStrategy.strategy -> unit method add_lemma : LogicUsage.logic_lemma -> unit method compute : Wpo.t Bag.t end open Wp_parameters val compute_ip : computer -> Property.t -> Wpo.t Bag.t val compute_call : computer -> Cil_types.stmt -> Wpo.t Bag.t val compute_kf : computer -> ?kf:Kernel_function.t -> ?bhv:string list -> ?prop:string list -> unit -> Wpo.t Bag.t val compute_selection : computer -> ?fct:functions -> ?bhv:string list -> ?prop:string list -> unit -> Wpo.t Bag.t ����������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiComposer.ml��������������������������������������������������0000666�0000000�0000000�00000030363�13571573400�016704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Composer Panel --- *) (* -------------------------------------------------------------------------- *) let peek n s = let rec prefix n s = if n <= 0 then ([],s) else match s with | [] -> raise Not_found | e::s -> let es,s = prefix (pred n) s in e :: es , s in try Some(prefix n s) with Not_found -> None class composer (focused : GuiSequent.focused) = object(self) val mutable stack : Tactical.selection list = [] val mutable update = (fun () -> ()) method clear = stack <- [] method connect f = update <- f method private pp_typeof fmt v = try Lang.F.pp_tau fmt (Lang.F.typeof (Tactical.selected v)) with Not_found -> Format.pp_print_string fmt "?" method private pp_selection fmt v = begin focused#pp_selection fmt v ; let open Tactical in match v with | Compose(Code _) | Inside _ | Clause _ -> Format.fprintf fmt "@ @{<fg:grey>(%a)@}" self#pp_typeof v | _ -> () end method private pp_select cc args ~quit fmt = match args with | e::_ when cc#is_valid e -> let callback () = cc#set_value e ; quit () in Format.fprintf fmt "%t @{<it>and quit composer@}@\n" (focused#button ~title:"Select A" ~callback) | _ -> () method private pp_range cc args ~quit fmt = match args with | a::b::_ when cc#ranged -> begin match Tactical.get_int a, Tactical.get_int b with | Some a,Some b when a <= b -> let callback () = cc#set_value (Tactical.range a b) ; quit () in Format.fprintf fmt "%t @{<it>for range selection@}@\n" (focused#button ~title:"Select A..B" ~callback) | _ -> () end | _ -> () method private pp_stack args sel fmt = if not (Tactical.is_empty sel) then let callback () = stack <- args ; ignore focused#unselect ; update () in focused#button ~title:"Stack" ~callback fmt method private op1 title job args fmt = match args with | a::w -> let callback () = stack <- job a w ; ignore focused#unselect ; update () in focused#button ~title ~callback fmt | _ -> () method private op2 title job args fmt = match args with | a::b::w -> let callback () = stack <- job a b w ; ignore focused#unselect ; update () in focused#button ~title ~callback fmt | _ -> () method private op3 title job args fmt = match args with | a::b::c::w -> let callback () = stack <- job a b c w ; ignore focused#unselect ; update () in focused#button ~title ~callback fmt | _ -> () method private destruct args fmt = match args with | a::w -> let ps = Tactical.destruct a in if ps <> [] then let callback () = stack <- ps @ w ; update () in Format.fprintf fmt "%t @{<it>Decompose into (selectable) sub-terms@}@\n" (focused#button ~title:"Destruct A" ~callback) | _ -> () val mutable stacked = true val mutable group = "" val mutable help = false method private compose fmt args (cc : Tactical.composer) = match peek cc#arity args with | None -> () | Some (es,tail) -> let vs = List.map Tactical.selected es in if cc#filter vs then begin let callback () = let s = Tactical.compose cc#id es in stack <- if es = [] then tail @ [s] else s :: tail ; ignore focused#unselect ; update () in let button = focused#button ~title:cc#title ~callback in let descr = cc#descr in if descr = "" then ( if not stacked && cc#group <> group then Format.pp_print_newline fmt () ; button fmt ; stacked <- false ) else begin if not stacked then Format.pp_print_newline fmt () ; Format.fprintf fmt "%t @{<it>%s@}@\n" button descr ; stacked <- true end ; group <- cc#group end method private hrule fmt = if not stacked then Format.pp_print_newline fmt () ; Format.fprintf fmt "---------------------------------------@\n" ; stacked <- true method private helper fmt (cc : Tactical.composer) = begin if cc#group <> group && group <> "" then self#hrule fmt ; Format.fprintf fmt "[ @{<bf>%s@} ]" cc#title ; let descr = cc#descr in if descr = "" then if cc#arity > 0 then ( Format.fprintf fmt " @{<it>arity %d@}@\n" cc#arity ; stacked <- true ) else stacked <- false else ( Format.fprintf fmt " @{<it>%s@}@\n" descr ; stacked <- true ) ; group <- cc#group end method private openhelp () = help <- true ; update () method private closehelp () = help <- false ; update () method print (cc : GuiTactic.composer) ~quit fmt = begin focused#set_target Tactical.Empty ; Format.fprintf fmt "@{<bf>Selection:@} @{<ul>%s@} %t%t@\n" cc#title (focused#button ~title:"Help" ~callback:self#openhelp) (focused#button ~title:"Cancel" ~callback:quit) ; let tooltip = cc#descr in if tooltip <> "" then Format.fprintf fmt "@\n@{<it>%s@}@\n@\n" tooltip ; let current = cc#get_value in if not (Tactical.is_empty current) then begin let clear () = cc#set_value Tactical.Empty ; quit () in let edit () = stack <- begin match current with | Tactical.Compose(Tactical.Range(a,b)) -> [ Tactical.int a ; Tactical.int b ] | _ -> [current] end ; update () in Format.fprintf fmt "Current: @[<hov 2>%a@]@." focused#pp_selection current ; Format.fprintf fmt "%t @{<it>in edition stack@}@\n" (focused#button ~title:"Edit" ~callback:edit) ; Format.fprintf fmt "%t @{<it>and quit composer@}@\n" (focused#button ~title:"Clear" ~callback:clear) ; end ; let selection = focused#selection in let args = if not (Tactical.is_empty selection) then stack @ [selection] else stack in Format.fprintf fmt "@{<bf>Edition Stack:@}@\n@\n" ; Array.iteri (fun i v -> if i < 26 then let h = if v == selection then '>' else ' ' in let c = char_of_int (int_of_char 'A' + i) in Format.fprintf fmt "%c %c: @[<hov 2>%a@]@\n" h c self#pp_selection v ; ) (Array.of_list args) ; stacked <- true ; group <- "" ; if help then begin Format.fprintf fmt "@\nRegistered Operations %t:@\n@\n" (focused#button ~title:"Close" ~callback:self#closehelp) ; Tactical.iter_composer (self#helper fmt) ; end else begin Format.fprintf fmt "@\n%t%t%t@\n%t%t%t%t@\n@\n%t" (self#pp_select cc args ~quit) (self#pp_range cc args ~quit) (self#pp_stack args selection) (self#op1 "Dup A" (fun a w -> a :: a :: w) args) (self#op1 "Drop A" (fun _ w -> w) args) (self#op2 "Swap A,B" (fun a b w -> b::a::w) args) (self#op3 "Roll A,B,C" (fun a b c w -> c::a::b::w) args) (self#destruct args) ; self#hrule fmt ; Tactical.iter_composer (self#compose fmt args) ; end end end (* -------------------------------------------------------------------------- *) (* --- Browser --- *) (* -------------------------------------------------------------------------- *) class browser (focused : GuiSequent.focused) = object val mutable paging = 10 (* number of items per page *) val mutable offset = 0 (* first listed item on page *) val mutable listed = 0 (* number of listed items *) val mutable update = (fun () -> ()) method clear = begin if paging <> 5 || paging <> 10 then paging <- 10 ; offset <- 0 ; listed <- 0 ; end method connect f = update <- f method print ( cc : GuiTactic.browser ) ~quit fmt = begin focused#set_target cc#target ; let ptitle = if paging = 10 then "5/page" else "10/page" in let ctitle () = paging <- if paging = 10 then 5 else 10 ; update () in Format.fprintf fmt "@{<bf>Selection for %s:@} %t%t@\n@\n" cc#title (focused#button ~title:ptitle ~callback:ctitle) (focused#button ~title:"Cancel" ~callback:quit) ; let tooltip = cc#descr in if tooltip <> "" then Format.fprintf fmt "@{<it>%s@}@\n@\n" tooltip ; listed <- 0 ; let open Tactical in let complete = cc#search (fun item -> listed <- succ listed ; if offset < listed then begin let title = Printf.sprintf "#%02d" listed in let callback () = cc#choose (Some item.vid) ; quit () in Format.fprintf fmt "%t %s@\n" (focused#button ~title ~callback) item.title ; if item.descr <> "" then Format.fprintf fmt "@{<fg:grey>%s@}@\n@\n" item.descr ; end ) (offset + paging) in if listed <= offset then Format.fprintf fmt "@{<it>No Result@}@\n" ; Format.pp_print_newline fmt () ; let rec pages p = let q = p+paging-1 in if q <= listed then begin let title = Printf.sprintf "%d-%d" p q in let callback () = offset <- pred p ; update () in focused#button ~title ~callback fmt ; pages (succ q) ; end else if not complete then begin let title = Printf.sprintf "%d+" p in let callback () = offset <- pred p ; update () in focused#button ~title ~callback fmt ; end in pages 1 ; Format.pp_print_newline fmt () ; end end (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiComposer.mli�������������������������������������������������0000666�0000000�0000000�00000004473�13571573400�017060� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Composer Panel --- *) (* -------------------------------------------------------------------------- *) class composer : GuiSequent.focused -> object method clear : unit method connect : (unit -> unit) -> unit (** request-for-update event *) method print : GuiTactic.composer -> quit:(unit -> unit) -> Format.formatter -> unit end class browser : GuiSequent.focused -> object method clear : unit method connect : (unit -> unit) -> unit (** request-for-update event *) method print : GuiTactic.browser -> quit:(unit -> unit) -> Format.formatter -> unit end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiConfig.ml����������������������������������������������������0000666�0000000�0000000�00000014031�13571573400�016314� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ------------------------------------------------------------------------ *) (* --- Prover List in Configuration --- *) (* ------------------------------------------------------------------------ *) class provers key = object(self) inherit [Why3.Whyconf.Sprover.t] Wutil.selector Why3.Whyconf.Sprover.empty method private load () = let open Gtk_helper.Configuration in let prover_of_conf acc = function | ConfList [ConfString prover_name; ConfString prover_version; ConfString prover_altern] -> Why3.Whyconf.Sprover.add Why3.Whyconf.{ prover_name; prover_version; prover_altern } acc | _ -> acc in try let data = Gtk_helper.Configuration.find key in match data with | ConfList data -> (List.fold_left prover_of_conf Why3.Whyconf.Sprover.empty data) | _ -> Why3.Whyconf.Sprover.empty with Not_found -> Why3.Whyconf.Sprover.empty method private save () = let open Gtk_helper.Configuration in let conf_of_prover dp = ConfList Why3.Whyconf.[ConfString dp.prover_name; ConfString dp.prover_version; ConfString dp.prover_altern] in Gtk_helper.Configuration.set key (ConfList (List.map conf_of_prover (Why3.Whyconf.Sprover.elements self#get))) initializer begin let settings = self#load () in (** select automatically the provers set on the command line *) let cmdline = Wp_parameters.Provers.get () in let selection = List.fold_left (fun acc e -> match Why3Provers.find_opt e with | None -> acc | Some p -> Why3.Whyconf.Sprover.add p acc) settings cmdline in self#set selection ; self#on_event self#save ; end end (* ------------------------------------------------------------------------ *) (* --- WP Provers Configuration Panel --- *) (* ------------------------------------------------------------------------ *) class dp_chooser ~(main:Design.main_window_extension_points) ~(provers:provers) = let dialog = new Wpane.dialog ~title:"Why3 Provers" ~window:main#main_window ~resize:false () in let array = new Wpane.warray () in object(self) val mutable selected = Why3.Whyconf.Mprover.empty method private enable dp e = selected <- Why3.Whyconf.Mprover.add dp e selected method private lookup dp = Why3.Whyconf.Mprover.find dp selected method private entry dp = let text = Why3Provers.title dp in let sw = new Widget.switch () in let lb = new Widget.label ~align:`Left ~text () in sw#set (self#lookup dp) ; sw#connect (self#enable dp) ; let hbox = GPack.hbox ~spacing:10 ~homogeneous:false () in hbox#pack ~expand:false sw#coerce ; hbox#pack ~expand:true lb#coerce ; (object method widget = hbox#coerce method update () = sw#set (self#lookup dp) method delete () = () end) method private configure dps = begin array#set (Why3.Whyconf.Sprover.elements dps) ; array#update () ; end method private detect () = begin self#configure (Why3Provers.provers_set ()); end method private apply () = provers#set (Why3.Whyconf.Mprover.map_filter (function | true -> Some () | false -> None) selected) method run () = let dps = Why3Provers.provers_set () in let sel = provers#get in selected <- Why3.Whyconf.Mprover.merge (fun _ avail enab -> match avail, enab with | None, _ -> None | Some (), Some () -> Some true | Some (), None -> Some false) dps sel; self#configure dps ; dialog#run () initializer begin dialog#button ~action:(`ACTION self#detect) ~label:"Detect Provers" () ; dialog#button ~action:(`CANCEL) ~label:"Cancel" () ; dialog#button ~action:(`APPLY) ~label:"Apply" () ; array#set_entry self#entry ; dialog#add_block array#coerce ; dialog#on_value `APPLY self#apply ; end end (* ------------------------------------------------------------------------ *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiConfig.mli���������������������������������������������������0000666�0000000�0000000�00000004163�13571573400�016472� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ------------------------------------------------------------------------ *) (* --- WP Provers Configuration Panel --- *) (* ------------------------------------------------------------------------ *) class provers : string -> [Why3.Whyconf.Sprover.t] Widget.selector class dp_chooser : main:Design.main_window_extension_points -> provers:provers -> object method run : unit -> unit (** Edit enabled provers *) end (* ------------------------------------------------------------------------ *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiGoal.ml������������������������������������������������������0000666�0000000�0000000�00000061577�13571573400�016012� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type state = | Empty | Proof of ProofEngine.tree | Forking of ProofEngine.tree * ProofEngine.fork * Task.pool | Composer of ProofEngine.tree * GuiTactic.composer * GuiSequent.target | Browser of ProofEngine.tree * GuiTactic.browser * GuiSequent.target let on_proof_context proof job data = let ctxt = ProofEngine.tree_context proof in WpContext.on_context ctxt job data (* -------------------------------------------------------------------------- *) (* --- Autofocus Management --- *) (* -------------------------------------------------------------------------- *) type mode = [ `Refresh | `Autofocus | `ViewModel | `ViewAll | `ViewRaw ] module Config = Gtk_helper.Configuration class ['a] menu ~(data : ('a * string * string) list) ~key ~default = let options = List.map (fun (v,d,_) -> v,d) data in let values = List.map (fun (v,_,k) -> v,k) data in object(self) inherit ['a] Widget.menu ~default ~options () initializer Wutil.later (fun () -> Config.config_values ~key ~default ~values self) end class autofocus = object inherit [mode] menu ~key:"GuiGoal.autofocus" ~default:`Autofocus ~data:[ `Refresh , "Refresh" , "REFRESH" ; `Autofocus , "Autofocus" , "AUTOFOCUS" ; `ViewAll , "Full Context" , "VIEW_ALL" ; `ViewModel , "Unmangled Memory" , "VIEW_MODEL" ; `ViewRaw , "Raw Obligation" , "VIEW_RAW" ; ] end class iformat = object inherit [Plang.iformat] menu ~key:"GuiGoal.iformat" ~default:`Dec ~data:[ `Dec , "Decimal" , "DEC" ; `Hex , "Hexa" , "HEX" ; `Bin , "Binary" , "BIN" ; ] end class rformat = object inherit [Plang.rformat] menu ~key:"GuiGoal.rformat" ~default:`Ratio ~data:[ `Ratio , "Real" , "REAL" ; `Float , "Float (32 bits)" , "F32" ; `Double , "Float (64 bits)" , "F64" ; ] end (* -------------------------------------------------------------------------- *) (* --- Goal Panel --- *) (* -------------------------------------------------------------------------- *) class pane (gprovers : GuiConfig.provers) = let icon = new Widget.image GuiProver.no_status in let status = new Widget.label () in let text = new Wtext.text () in let scripter = new GuiProof.printer text in let printer = new GuiSequent.focused text in let composer = new GuiComposer.composer printer in let browser = new GuiComposer.browser printer in let layout = new Wutil.layout in let palette = new Wpalette.panel () in let help = new Widget.button ~label:"Tactics" ~border:false ~tooltip:"List Available Tactics" () in let delete = new Widget.button ~icon:`DELETE ~tooltip:"Delete current proof" () in let cancel = new Widget.button ~icon:`UNDO ~tooltip:"Undo Proof Steps" () in let forward = new Widget.button ~icon:`MEDIA_FORWARD ~tooltip:"Go ahead among pending goals" () in let next = new Widget.button ~icon:`MEDIA_NEXT ~tooltip:"Goto next pending goal" () in let prev = new Widget.button ~icon:`MEDIA_PREVIOUS ~tooltip:"Goto previous pending goal" () in let play_script = new Widget.button ~icon:`REVERT_TO_SAVED ~tooltip:"Replay Session Script" () in let save_script = new Widget.button ~icon:`SAVE ~tooltip:"Save Script" () in let autofocus = new autofocus in let iformat = new iformat in let rformat = new rformat in let strategies = new GuiTactic.strategies () in let native = List.mem "native:alt-ergo" (Wp_parameters.Provers.get ()) in object(self) val mutable state : state = Empty val mutable provers : GuiProver.prover list = [] val mutable tactics : GuiTactic.tactic list = [] initializer begin let toolbar = Wbox.(toolbar [ w prev ; w next ; w cancel ; w forward ; w autofocus ; w iformat ; w rformat ; w play_script ; w save_script ; w ~padding:6 icon ; h ~padding:6 status ] [ w help ; w delete ]) in let content = Wbox.split ~dir:`HORIZONTAL text#widget (Wbox.scroll palette#widget) in Wutil.later (fun () -> Config.config_float ~key:"GuiGoal.palette" ~default:0.8 content ); layout#populate (Wbox.panel ~top:toolbar content#widget) ; let native_ergo = if native then [ new GuiProver.prover ~console:text ~prover:VCS.NativeAltErgo ] else [] in let why3_provers = List.map (fun dp -> new GuiProver.prover ~console:text ~prover:(VCS.Why3 dp)) (Why3.Whyconf.Sprover.elements gprovers#get) in provers <- native_ergo @ why3_provers ; List.iter (fun p -> palette#add_tool p#tool) provers ; palette#add_tool strategies#tool ; Strategy.iter strategies#register ; Tactical.iter (fun tac -> let gtac = new GuiTactic.tactic tac printer#pp_selection in tactics <- gtac :: tactics ; palette#add_tool gtac#tool) ; tactics <- List.rev tactics ; self#register_provers gprovers#get; printer#on_selection (fun () -> self#update) ; scripter#on_click self#goto ; scripter#on_backtrack self#backtrack ; gprovers#connect self#register_provers ; delete#connect (fun () -> self#interrupt ProofEngine.reset) ; cancel#connect (fun () -> self#interrupt ProofEngine.cancel) ; forward#connect (fun () -> self#forward) ; next#connect (fun () -> self#navigate succ) ; prev#connect (fun () -> self#navigate pred) ; save_script#connect (fun () -> self#save_script) ; play_script#connect (fun () -> self#play_script) ; autofocus#connect self#autofocus ; iformat#connect self#iformat ; rformat#connect self#rformat ; composer#connect (fun () -> self#update) ; browser#connect (fun () -> self#update) ; help#connect (fun () -> self#open_help) ; end (* ---------------------------------------------------------------------- *) (* --- Behavior --- *) (* ---------------------------------------------------------------------- *) val mutable helpmode = false method private open_help = helpmode <- true ; self#update method private quit_help = helpmode <- false ; self#update method private compose cc = match state with | Proof proof -> composer#clear ; let tgt = printer#unselect in state <- Composer(proof,cc,tgt) ; self#update | _ -> () method private browse cc = match state with | Proof proof -> browser#clear ; let tgt = printer#unselect in state <- Browser(proof,cc,tgt) ; self#update | _ -> () method private interrupt cancel = match state with | Empty -> () | Proof proof | Composer(proof,_,_) | Browser(proof,_,_) -> cancel proof ; printer#reset ; self#update | Forking (proof,_,pool) -> cancel proof ; Task.iter Task.cancel pool ; state <- Proof proof ; printer#reset ; self#update method private forward = match state with | Empty | Forking _ | Composer _ | Browser _ -> () | Proof p -> ProofEngine.forward p ; self#update method private goto s = match state with | Empty | Forking _ | Composer _ | Browser _ -> () | Proof p -> ProofEngine.goto p s ; self#update method private navigate f = match state with | Empty | Forking _ | Composer _ | Browser _ -> () | Proof p -> match ProofEngine.current p with | `Leaf (k,_) -> ProofEngine.goto p (`Leaf(f k)) ; self#update | `Main | `Internal _ -> () method private iformat f = printer#set_iformat f ; self#update method private rformat f = printer#set_rformat f ; self#update method private autofocus = function | `Autofocus -> printer#set_focus_mode true ; printer#set_state_mode true ; self#update | `ViewRaw -> printer#set_focus_mode false ; printer#set_state_mode false ; self#update | `ViewModel -> printer#set_focus_mode true ; printer#set_state_mode false ; self#update | `ViewAll -> printer#set_focus_mode false ; printer#set_state_mode true ; self#update | `Refresh -> helpmode <- false ; printer#reset ; let mode = match printer#get_focus_mode , printer#get_state_mode with | true , true -> `Autofocus | false , false -> `ViewRaw | true , false -> `ViewModel | false , true -> `ViewAll in autofocus#set mode ; self#update method private provers = (if native then [ VCS.NativeAltErgo ] else []) @ (List.map (fun dp -> VCS.Why3 dp) (Why3.Whyconf.Sprover.elements gprovers#get)) method private play_script = match state with | Proof p -> ProofEngine.reset p ; ProverScript.spawn ~provers:self#provers ~result: (fun wpo prv res -> text#printf "[%a] %a : %a@." VCS.pp_prover prv Wpo.pp_title wpo VCS.pp_result res) ~success: (fun _ _ -> ProofEngine.forward p ; self#update) (ProofEngine.main p) ; let server = ProverTask.server () in Task.launch server | Empty | Forking _ | Composer _ | Browser _ -> () method private save_script = match state with | Proof p -> let main = ProofEngine.main p in let json = ProofScript.encode (ProofEngine.script p) in ProofSession.save main json ; ProofEngine.set_saved p true ; self#update (* text#clear ; text#printf "@{<bf>Session:@} '%a'@." ProofSession.pretty main ; text#printf "@[<hov 2>@{<bf>Script:@}@ %a@]@." Json.pp json ; self#update_statusbar ; *) | Empty | Forking _ | Composer _ | Browser _ -> () (* ---------------------------------------------------------------------- *) (* --- Prover Controllers --- *) (* ---------------------------------------------------------------------- *) method private register_provers dps = begin (* register missing provers *) let dps = Why3.Whyconf.Sprover.elements dps in let prvs = List.map (fun p -> VCS.Why3 p) dps in (* set visible provers *) List.iter (fun prover -> let prv = prover#prover in match prover#prover with | VCS.Why3 _ -> prover#set_visible (List.mem prv prvs) | _ -> () ) provers ; (* add missing provers *) List.iter (fun prv -> if List.for_all (fun p -> p#prover <> prv) provers then begin let prover = new GuiProver.prover ~console:text ~prover:prv in begin match state with | Proof p -> prover#update (ProofEngine.main p) | Empty | Forking _ | Composer _ | Browser _ -> prover#clear end ; provers <- provers @ [ prover ] ; palette#add_tool prover#tool ; end ) prvs ; end (* ---------------------------------------------------------------------- *) (* --- External API --- *) (* ---------------------------------------------------------------------- *) method select = function | None -> state <- Empty ; self#update | Some w -> let pw = ProofEngine.proof ~main:w in let changed = match state with | Empty -> true | Proof p -> p != pw | Forking _ | Composer _ | Browser _ -> false in if changed then begin printer#reset ; self#update_provers None ; self#update_tactics None ; state <- Proof pw ; self#update ; end (* ---------------------------------------------------------------------- *) (* --- Repaint --- *) (* ---------------------------------------------------------------------- *) method coerce = layout#coerce method private update_provers = function | None -> List.iter (fun prover -> prover#clear) provers | Some wpo -> List.iter (fun prover -> prover#update wpo) provers method private update_tactics = function | None -> printer#set_target Tactical.Empty ; strategies#connect None ; List.iter (fun tactic -> tactic#clear) tactics | Some(tree,sequent,sel) -> on_proof_context tree begin fun () -> strategies#connect (Some (self#strategies sequent)) ; let select (tactic : GuiTactic.tactic) = let process = self#apply in let composer = self#compose in let browser = self#browse in tactic#select ~process ~composer ~browser ~tree sel in List.iter select tactics ; let tgt = if List.exists (fun tactics -> tactics#targeted) tactics then sel else Tactical.Empty in printer#set_target tgt end () method private update_scriptbar = match state with | Empty | Forking _ -> begin save_script#set_enabled false ; play_script#set_enabled false ; end | Proof proof | Composer(proof,_,_) | Browser(proof,_,_) -> begin let main = ProofEngine.main proof in let play = ProofSession.exists main in let save = not (ProofEngine.saved proof) in play_script#set_enabled play ; save_script#set_enabled save ; end method private update_statusbar = match state with | Empty -> begin icon#set_icon GuiProver.no_status ; next#set_enabled false ; prev#set_enabled false ; cancel#set_enabled false ; delete#set_enabled false ; forward#set_enabled false ; status#set_text "No Status" ; help#set_enabled false ; end | Proof proof | Forking(proof,_,_) | Composer(proof,_,_) | Browser(proof,_,_) -> begin let nofork = match state with Forking _ -> false | _ -> true in delete#set_enabled nofork ; help#set_enabled (match state with Proof _ -> not helpmode | _ -> false) ; match ProofEngine.status proof with | `Main -> icon#set_icon GuiProver.ko_status ; next#set_enabled false ; prev#set_enabled false ; cancel#set_enabled false ; forward#set_enabled false ; status#set_text "Non Proved Property" ; | `Proved -> icon#set_icon GuiProver.ok_status ; next#set_enabled false ; prev#set_enabled false ; cancel#set_enabled false ; forward#set_enabled false ; status#set_text "Proved Goal" ; | `Pending 0 -> icon#set_icon GuiProver.ok_status ; next#set_enabled false ; prev#set_enabled false ; forward#set_enabled false ; cancel#set_enabled nofork ; status#set_text "Proof Terminated" ; | `Pending n -> icon#set_icon GuiProver.ko_status ; forward#set_enabled nofork ; cancel#set_enabled nofork ; match ProofEngine.current proof with | `Main | `Internal _ -> next#set_enabled false ; prev#set_enabled false ; if n = 1 then Pretty_utils.ksfprintf status#set_text "One Pending Goal" else Pretty_utils.ksfprintf status#set_text "%d Pending Goals" n | `Leaf(k,_) -> prev#set_enabled (0 < k) ; next#set_enabled (k+1 < n) ; if k = 0 && n = 1 then Pretty_utils.ksfprintf status#set_text "Last Pending Goal" else Pretty_utils.ksfprintf status#set_text "%d/%d Pending Goals" (succ k) n end method private update_tacticbar = match state with | Empty | Forking _ -> self#update_provers None ; self#update_tactics None ; | Proof proof -> let wpo = ProofEngine.head proof in if Wpo.is_proved wpo then begin self#update_provers None ; self#update_tactics None ; end else begin self#update_provers (Some wpo) ; let sequent = printer#sequent in let select = printer#selection in self#update_tactics (Some(proof,sequent,select)) ; end | Composer _ | Browser _ -> () method private update_proofview = match state with | Empty -> text#clear | Proof _ when helpmode -> begin text#clear ; let callback () = self#quit_help in text#printf "@\n@{<bf>Available Tactics:@} %t@\n@\n" (printer#button ~title:"Close" ~callback) ; text#hrule ; let pp_item pp fmt tac = Format.fprintf fmt "[ @{<bf>%a@} ] @{<it>%s@}@\n" pp tac#title tac#descr in Pretty_utils.pp_items ~title:(fun tac -> tac#title) ~iter:Tactical.iter ~pp_item text#fmt ; text#hrule ; end | Proof proof -> on_proof_context proof begin fun () -> text#clear ; scripter#tree proof ; text#hrule ; text#printf "%t@." (printer#goal (ProofEngine.head proof)) ; text#hrule ; scripter#status proof ; end () | Composer(proof,cc,tgt) -> on_proof_context proof begin fun () -> text#clear ; let quit () = state <- Proof proof ; printer#restore tgt ; self#update in text#printf "%t@." (composer#print cc ~quit) ; text#hrule ; text#printf "%t@." (printer#goal (ProofEngine.head proof)) ; end () | Browser(proof,cc,tgt) -> on_proof_context proof begin fun () -> text#clear ; let quit () = state <- Proof proof ; printer#restore tgt ; self#update in text#printf "%t@." (browser#print cc ~quit) ; text#hrule ; text#printf "%t@." (printer#goal (ProofEngine.head proof)) ; end () | Forking _ -> () method update = begin self#update_statusbar ; self#update_proofview ; self#update_scriptbar ; self#update_tacticbar ; end (* ---------------------------------------------------------------------- *) (* --- Splitter --- *) (* ---------------------------------------------------------------------- *) method private commit () = match state with | Empty | Proof _ | Composer _ | Browser _ -> () | Forking(proof,fork,pool) -> let n = Task.size pool in if n = 0 then begin ignore (ProofEngine.commit fork) ; ProofEngine.validate proof ; ProofEngine.forward proof ; state <- Proof proof ; printer#reset ; self#update ; end method private schedule pool provers goal = Prover.spawn goal ~delayed:true ~result: begin fun wpo prv res -> text#printf "[%a] %a : %a@." VCS.pp_prover prv Wpo.pp_title wpo VCS.pp_result res end ~success:(fun _ _ -> Wutil.later self#commit) ~pool (List.map (fun dp -> VCS.BatchMode , dp) provers) method private fork proof fork = Wutil.later begin fun () -> let provers = self#provers in let pool = Task.pool () in ProofEngine.iter (self#schedule pool provers) fork ; let server = ProverTask.server () in state <- Forking(proof,fork,pool) ; Task.launch server ; printer#reset ; text#clear ; text#printf "Tactic %a@." ProofEngine.pretty fork ; text#printf "%d sub-goals generated.@." (Task.size pool) ; text#printf "Computing...@." ; self#update ; end method private apply tactic selection process = match state with | Empty | Forking _ | Composer _ | Browser _ -> () | Proof proof -> Wutil.later begin fun () -> let title = tactic#title in let tactic = ProofScript.jtactic ~title tactic selection in let anchor = ProofEngine.anchor proof () in self#fork proof (ProofEngine.fork proof ~anchor tactic process) end method private search proof = function | None -> text#printf "No tactic found.@\n" | Some fork -> self#fork proof fork method private strategies sequent ~depth ~width auto = match state with | Empty | Forking _ | Composer _ | Browser _ -> () | Proof proof -> Wutil.later begin fun () -> if depth <= 1 then let fork = ProverSearch.search proof ~sequent auto in self#search proof fork else begin ProverScript.search ~depth ~width ~auto ~provers:[ VCS.NativeAltErgo ] ~result: (fun wpo prv res -> text#printf "[%a] %a : %a@." VCS.pp_prover prv Wpo.pp_title wpo VCS.pp_result res) ~success: (fun _ _ -> ProofEngine.forward proof ; self#update ; text#printf "Strategies Applied." ) proof (ProofEngine.anchor proof ()) ; let server = ProverTask.server () in Task.launch server end end method private backtrack node = match state with | Empty | Forking _ | Composer _ | Browser _ -> () | Proof proof -> begin ProofEngine.goto proof (`Node node) ; let fork = ProverSearch.backtrack proof ~anchor:node ~loop:true () in self#search proof fork end end ���������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiGoal.mli�����������������������������������������������������0000666�0000000�0000000�00000003733�13571573400�016151� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- PO Details View --- *) (* -------------------------------------------------------------------------- *) class pane : GuiConfig.provers -> object method select : Wpo.t option -> unit method update : unit method coerce : GObj.widget end �������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiList.ml������������������������������������������������������0000666�0000000�0000000�00000015662�13571573400�016035� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- PO List View --- *) (* -------------------------------------------------------------------------- *) open Wpo module Windex = Indexer.Make(Wpo.S) class model = object(self) val mutable index = Windex.empty method reload = index <- Windex.empty method add w = index <- Windex.add w index method size = Windex.size index method index w = Windex.index w index method get k = Windex.get k index method coerce = (self :> Wpo.t Wtable.listmodel) end let render_prover_result p = let icn_stock name = [`STOCK_ID name] in let icn_status s = [`PIXBUF(Gtk_helper.Icon.get (Gtk_helper.Icon.Feedback s))] in let icn_na = [`PIXBUF(Gtk_helper.Icon.get Gtk_helper.Icon.Unmark)] in let icn_none = icn_stock "" in let icn_valid = icn_status Property_status.Feedback.Valid in let icn_unknown = icn_status Property_status.Feedback.Unknown in let icn_invalid = icn_status Property_status.Feedback.Invalid in let icn_failed = icn_stock "gtk-dialog-warning" in let icn_cut = icn_stock "gtk-cut" in let icn_running = icn_stock "gtk-execute" in let open VCS in let icon_of_verdict = function | Checked | NoResult -> icn_none | Valid -> icn_valid | Invalid -> icn_invalid | Unknown -> icn_unknown | Failed -> icn_failed | Timeout | Stepout -> icn_cut | Computing _ -> icn_running in fun w -> match Wpo.get_result w p , p with | { verdict=NoResult } , Qed -> icn_na | { verdict=NoResult } , Tactical -> begin match ProverScript.get w with | `None -> icn_na | `Script -> icn_stock "gtk-media-play" | `Proof -> icn_stock "gtk-edit" | `Saved -> icn_stock "gtk-file" end | { verdict=r } , _ -> icon_of_verdict r class pane (gprovers:GuiConfig.provers) = let model = new model in let list = new Wtable.list ~headers:true ~rules:true model#coerce in object(self) method coerce = list#coerce method reload = list#reload method add wpo = begin model#add wpo ; list#insert_row wpo ; end method size = model#size method index = model#index method get = model#get method update_all = list#update_all method update w = list#update_row w (* -------------------------------------------------------------------------- *) (* --- Prover Columns Management --- *) (* -------------------------------------------------------------------------- *) val mutable provers : (VCS.prover * GTree.view_column) list = [] method private prover_of_column c = let id = c#misc#get_oid in try Some(fst(List.find (fun (_,c0) -> id = c0#misc#get_oid) provers)) with Not_found -> None method private column_of_prover p = try Some(snd(List.find (fun (p0,_) -> p=p0) provers)) with Not_found -> None method private create_prover p = begin let title = VCS.title_of_prover p in let column = list#add_column_pixbuf ~title [] (render_prover_result p) in if p <> VCS.Qed then provers <- (p,column) :: provers end method private configure (dps:Why3.Whyconf.Sprover.t) = begin (* Removing Useless Columns *) List.iter (fun (vcs,column) -> match vcs with | VCS.Why3 p -> column#set_visible (Why3.Whyconf.Sprover.mem p dps) ; (* ignore (list#view#remove_column column) *) | _ -> () ) provers ; (* Installing Missing Columns *) Why3.Whyconf.Sprover.iter (fun dp -> let prv = VCS.Why3 dp in match self#column_of_prover prv with | None -> self#create_prover prv | Some _ -> () ) dps ; end initializer begin let render w = [`TEXT (Pretty_utils.to_string Wpo.pp_index w.po_idx)] in ignore (list#add_column_text ~title:"Module" [] render) ; let render w = [`TEXT (Pretty_utils.to_string Wpo.pp_title w)] in ignore (list#add_column_text ~title:"Goal" [] render) ; let render w = [`TEXT (Wpo.get_model w |> WpContext.MODEL.descr)] in ignore (list#add_column_text ~title:"Model" [] render) ; List.iter self#create_prover [ VCS.Qed ; VCS.Tactical ] ; let prv = Wp_parameters.Provers.get () in if List.mem "native:alt-ergo" prv then self#create_prover VCS.NativeAltErgo ; if List.mem "native:coq" prv then self#create_prover VCS.NativeCoq ; ignore (list#add_column_empty) ; list#set_selection_mode `MULTIPLE ; gprovers#connect self#configure ; self#configure gprovers#get ; end method private on_cell f w c = f w (self#prover_of_column c) method on_click f = list#on_click (self#on_cell f) method on_double_click f = list#on_double_click (self#on_cell f) method on_right_click f = list#on_right_click (self#on_cell f) method on_selection f = list#on_selection (fun () -> f list#count_selected) method iter_selected = list#iter_selected method count_selected = list#count_selected method show w = let col = list#view#get_column 1 in list#set_focus w col end ������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiList.mli�����������������������������������������������������0000666�0000000�0000000�00000004735�13571573400�016205� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- PO List View --- *) (* -------------------------------------------------------------------------- *) class pane : GuiConfig.provers -> object method show : Wpo.t -> unit method on_click : (Wpo.t -> VCS.prover option -> unit) -> unit method on_right_click : (Wpo.t -> VCS.prover option -> unit) -> unit method on_double_click : (Wpo.t -> VCS.prover option -> unit) -> unit method reload : unit method update : Wpo.t -> unit method update_all : unit method count_selected : int method on_selection : (int -> unit) -> unit method iter_selected : (Wpo.t -> unit) -> unit method add : Wpo.t -> unit method size : int method index : Wpo.t -> int method get : int -> Wpo.t method coerce : GObj.widget end �����������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiNavigator.ml�������������������������������������������������0000666�0000000�0000000�00000047512�13571573400�017053� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- WP Lower Panel --- *) (* -------------------------------------------------------------------------- *) open Design open Widget open Property open GuiSource (* -------------------------------------------------------------------------- *) (* --- Build the Reactive Behavior of GUI --- *) (* -------------------------------------------------------------------------- *) type scope = [ `All | `Module | `Select ] type filter = [ `ToProve | `Scripts | `All ] type card = [ `List | `Goal ] type focus = [ `All | `Index of Wpo.index | `Call of GuiSource.call | `Property of Property.t ] let index_of_lemma l = match LogicUsage.section_of_lemma l.il_name with | LogicUsage.Toplevel _ -> Wpo.Axiomatic None | LogicUsage.Axiomatic a -> Wpo.Axiomatic (Some a.LogicUsage.ax_name) let focus_of_selection selection scope = match selection , scope with | S_none , _ | _ , `All -> `All | S_call c , `Select -> `Call c | S_call c , `Module -> `Index (Wpo.Function(c.s_caller,None)) | S_fun kf , (`Select | `Module) -> `Index(Wpo.Function(kf,None)) | S_prop (IPLemma ilem) , `Module -> `Index(index_of_lemma ilem) | S_prop (IPAxiomatic {iax_name=name}) , _ -> `Index(Wpo.Axiomatic (Some name)) | S_prop ip , `Select -> `Property ip | S_prop ip , `Module -> begin match Property.get_kf ip with | None -> `All | Some kf -> `Index(Wpo.Function(kf,None)) end exception FIRST of Wpo.t let first iter = try iter (fun w -> raise (FIRST w)) ; None with FIRST w -> Some w let iter_kf kf f = Wpo.iter ~index:(Wpo.Function(kf,None)) ~on_goal:f () let iter_ip ip f = Wpo.iter ~ip ~on_goal:f () let iter_ips ips f = List.iter (fun ip -> Wpo.iter ~ip ~on_goal:f ()) ips let calls c = List.map snd (Statuses_by_call.all_call_preconditions_at ~warn_missing:false c.s_caller c.s_stmt) let goal_of_selection = function | S_none -> None | S_prop ip -> first (iter_ip ip) | S_call c -> first (iter_ips (calls c)) | S_fun kf -> first (iter_kf kf) class behavior ~(main : Design.main_window_extension_points) ~(scope : scope Widget.selector) ~(filter : filter Widget.selector) ~(next : Widget.button) ~(prev : Widget.button) ~(index : Widget.button) ~(clear : Widget.button) ~(card : card Widget.selector) ~(list : GuiList.pane) ~(provers : GuiConfig.provers) ~(goal : GuiGoal.pane) ~(source : GuiSource.highlighter) ~(popup : GuiSource.popup) = object(self) initializer let module Cfg = Gtk_helper.Configuration in begin Cfg.config_values ~key:"wp.navigator.scope" ~values:[`All,"all" ; `Module,"module" ; `Select,"select"] ~default:`Module scope ; Cfg.config_values ~key:"wp.navigator.filter" ~values:[`All,"all" ; `Scripts,"scripts" ; `ToProve,"toprove"] ~default:`ToProve filter ; filter#on_event self#reload ; end val mutable focus : focus = `All val mutable currentgoal : Wpo.t option = None method update () = begin list#update_all ; source#update ; goal#update ; end method reload () = begin list#reload ; let to_prove g = not (Wpo.is_proved g || Wpo.reduce g) in let has_proof g = match ProofEngine.get g with | `None -> false | `Proof | `Script | `Saved -> true in let on_goal g = let ok = match filter#get with | `All -> true | `Scripts -> has_proof g | `ToProve -> to_prove g && (Wpo.is_unknown g || has_proof g) in if ok then list#add g in begin match focus with | `All -> Wpo.iter ~on_goal () | `Index index -> Wpo.iter ~index ~on_goal () | `Property ip -> Wpo.iter ~ip ~on_goal () | `Call c -> iter_ips (calls c) on_goal end ; let n = list#size in let k = match currentgoal with | None -> (-1) | Some w -> try list#index w with Not_found -> (-1) in index#set_enabled (n>0) ; if n=0 then card#set `List ; let src = if n=1 && k=0 then (card#set `Goal ; clear#set_enabled false ; true) else false in if k<0 then self#navigator false None else self#navigator src (Some (list#get k)) ; end method private set_focus f = focus <- f ; self#reload () method private set_scope f = match f , currentgoal with | `Module , Some w -> self#set_focus (`Index (Wpo.get_index w)) | `Select , Some w -> self#set_focus (`Property (Wpo.get_property w)) | _ , _ -> self#set_focus `All method private set_selection s = let f = scope#get in currentgoal <- goal_of_selection s ; self#set_focus (focus_of_selection s f) (* -------------------------------------------------------------------------- *) (* --- Navigation from Next/Prev/List --- *) (* -------------------------------------------------------------------------- *) method private details = match card#get , currentgoal with | `List , Some w -> list#show w | `List , None -> () | `Goal , sw -> goal#select sw method private navigator src = function | None -> begin currentgoal <- None ; next#set_enabled false ; prev#set_enabled false ; source#set None ; self#details ; end | (Some w) as sw -> try currentgoal <- sw ; let n = list#size in let k = list#index w in prev#set_enabled (k > 0) ; next#set_enabled (succ k < n) ; source#set (if src then sw else None) ; self#details ; with Not_found -> self#navigator false None method private next () = self#move succ method private prev () = self#move pred method private move dir = try match currentgoal with | None -> () | Some w -> begin self#navigator true None ; let k = list#index w in let w = list#get (dir k) in self#navigator true (Some w) ; end with Not_found -> self#navigator true None method private prove ?mode w prover = begin let refresh w = match card#get with | `List -> list#update w | `Goal -> goal#update in let result w _prv _res = refresh w in let success w _res = refresh w in let schedule task = let thread = Task.thread task in let kill () = Wpo.set_result w prover VCS.no_result ; Task.cancel thread ; in Wpo.set_result w prover (VCS.computing kill) ; let server = ProverTask.server () in Task.spawn server thread ; Task.launch server in if not (VCS.is_valid (Wpo.get_result w VCS.Qed)) && not (VCS.is_computing (Wpo.get_result w prover)) then match prover with | VCS.Tactical -> begin match mode , ProverScript.get w with | (None | Some VCS.BatchMode) , `Script -> schedule (ProverScript.prove ~success w) | _ -> card#set `Goal ; clear#set_enabled false ; self#navigator true (Some w) ; end | _ -> let mode = match mode , prover with | Some m , _ -> m | None , VCS.NativeCoq -> VCS.EditMode | None , VCS.NativeAltErgo -> VCS.FixMode | _ -> VCS.BatchMode in schedule (Prover.prove w ~mode ~result prover) ; refresh w end method private clear () = begin let title = "Delete Proof Obligations" in let text = Printf.sprintf "Confirm deletion of %d proof obligation(s)" list#count_selected in let icon = GMisc.image ~stock:`DELETE () in let response = GToolbox.question_box ~title ~buttons:["Delete POs" ; "Cancel"] ~default:1 ~icon text in if response = 1 then begin list#iter_selected Wpo.remove ; self#reload () ; end end (* -------------------------------------------------------------------------- *) (* --- Popup on Goals --- *) (* -------------------------------------------------------------------------- *) val popup_qed = new Widget.popup () val popup_tip = new Widget.popup () val popup_ergo = new Widget.popup () val popup_coq = new Widget.popup () val popup_why3 = new Widget.popup () val mutable popup_target = None method private popup_delete () = match popup_target with | Some(w,_) -> (popup_target <- None ; Wpo.remove w ; self#reload ()) | None -> () method private popup_delete_script () = match popup_target with | Some(w,_) -> ProofEngine.remove w ; ProofSession.remove w | None -> () method private popup_run mode () = match popup_target with | Some(w,Some p) -> (popup_target <- None ; self#prove ~mode w p) | _ -> popup_target <- None method private add_popup_delete popup = begin popup#add_separator ; popup#add_item ~label:"Delete Goal" ~callback:self#popup_delete ; end method private add_popup_proofmodes popup modes = List.iter (fun (label,mode) -> popup#add_item ~label ~callback:(self#popup_run mode)) modes initializer let open VCS in begin popup_tip#add_item ~label:"Run Script" ~callback:(self#popup_run BatchMode) ; popup_tip#add_item ~label:"Edit Proof" ~callback:(self#popup_run EditMode) ; popup_tip#add_item ~label:"Delete Script" ~callback:(self#popup_delete_script) ; self#add_popup_proofmodes popup_why3 [ "Run",BatchMode ] ; self#add_popup_proofmodes popup_ergo [ "Run",BatchMode ; "Open Altgr-Ergo on Fail",EditMode ; "Open Altgr-Ergo",EditMode ] ; self#add_popup_proofmodes popup_coq [ "Check Proof",BatchMode ; "Edit on Fail",EditMode ; "Edit Proof",EditMode ] ; end method private popup w p = let open VCS in begin popup_target <- Some (w,p) ; match p with | None | Some Tactical -> popup_tip#run () | Some Qed -> popup_qed#run () | Some NativeCoq -> popup_coq#run () | Some NativeAltErgo -> popup_ergo#run () | Some (Why3 _) -> popup_why3#run () end method private action w p = match p with | None -> begin card#set `Goal ; clear#set_enabled false ; self#navigator true (Some w) ; end | Some p -> begin self#navigator true (Some w) ; self#prove w p ; list#update w ; end (* -------------------------------------------------------------------------- *) (* --- Popup on Goals --- *) (* -------------------------------------------------------------------------- *) initializer begin clear#set_enabled false ; next#connect self#next ; prev#connect self#prev ; index#connect (fun () -> card#set `List) ; list#on_click (fun w _p -> self#navigator true (Some w)) ; list#on_right_click (fun w p -> begin self#navigator true (Some w) ; self#popup w p ; list#update w ; end ) ; list#on_double_click self#action ; list#on_selection (fun n -> clear#set_enabled (n>0)) ; card#connect (fun _ -> self#details) ; scope#connect self#set_scope ; popup#on_click self#set_selection ; popup#on_prove (GuiPanel.run_and_prove main provers) ; clear#connect self#clear ; end end (* -------------------------------------------------------------------------- *) (* --- Model Info for Variables --- *) (* -------------------------------------------------------------------------- *) let model_varinfo : GMenu.menu GMenu.factory -> Design.main_window_extension_points -> button:int -> Pretty_source.localizable -> unit = fun _menu main ~button item -> let open Pretty_source in let open Cil_types in match item with | PLval(Some kf, _ , (Var x,NoOffset)) | PTermLval(Some kf, _, _, (TVar {lv_origin=Some x},TNoOffset)) when button=1 -> let init = WpStrategy.is_main_init kf in let acc = RefUsage.get ~kf ~init x in let model = match acc with | RefUsage.NoAccess -> "any" | RefUsage.ByValue -> "'var'" | RefUsage.ByRef -> "'ref'" | RefUsage.ByArray when x.vformal && Cil.isPointerType x.vtype -> "'caveat'" | _ -> "'typed'" in main#pretty_information "Is is accessed as %t and fits in %s wp-model@." (RefUsage.print x acc) model ; | _ -> () (* -------------------------------------------------------------------------- *) (* --- Make Panel and Extend Frama-C GUI --- *) (* -------------------------------------------------------------------------- *) let make (main : main_window_extension_points) = begin (* -------------------------------------------------------------------------- *) (* --- Provers --- *) (* -------------------------------------------------------------------------- *) let provers = new GuiConfig.provers "wp.provers" in let dp_chooser = new GuiConfig.dp_chooser ~main ~provers in (* -------------------------------------------------------------------------- *) (* --- Focus Bar --- *) (* -------------------------------------------------------------------------- *) let scope = new Widget.menu ~default:`Module ~options:[ `All, "Global" ; `Module, "Module" ; `Select , "Property" ; ] () in let filter = new Widget.menu ~default:`ToProve ~options:[ `ToProve , "Not Proved (yet)" ; `Scripts , "All Scripts" ; `All , "All Goals" ; ] () in let prev = new Widget.button ~icon:`GO_BACK ~tooltip:"Previous goal" () in let next = new Widget.button ~icon:`GO_FORWARD ~tooltip:"Next goal" () in let index = new Widget.button ~icon:`INDEX ~tooltip:"List of goals" () in let navigation = Wbox.hgroup [ (prev :> widget) ; (index :> widget) ; (next :> widget) ; ] in let pvrs = new Widget.button ~label:"Provers..." () in let clear = new Widget.button ~label:"Clear" ~icon:`DELETE () in let focusbar = GPack.hbox ~spacing:0 () in begin focusbar#pack ~padding:0 ~expand:false navigation#coerce ; focusbar#pack ~padding:20 ~expand:false scope#coerce ; focusbar#pack ~padding:20 ~expand:false filter#coerce ; focusbar#pack ~from:`END ~expand:false clear#coerce ; focusbar#pack ~from:`END ~expand:false pvrs#coerce ; pvrs#connect dp_chooser#run ; end ; (* -------------------------------------------------------------------------- *) (* --- Filter Popup --- *) (* -------------------------------------------------------------------------- *) begin filter#set_render (function | `All -> "All Results" | `Scripts -> "All Scripts" | `ToProve -> "Not Proved") ; filter#set_items [ `ToProve ; `Scripts ; `All ] ; end ; (* -------------------------------------------------------------------------- *) (* --- List/Goal view --- *) (* -------------------------------------------------------------------------- *) let book = new Wpane.notebook ~default:`List () in let list = new GuiList.pane provers in let goal = new GuiGoal.pane provers in begin book#add `List list#coerce ; book#add `Goal goal#coerce ; end ; (* -------------------------------------------------------------------------- *) (* --- Source Feedback --- *) (* -------------------------------------------------------------------------- *) let source = new GuiSource.highlighter main in let popup = new GuiSource.popup () in (* -------------------------------------------------------------------------- *) (* --- Panel Behavior --- *) (* -------------------------------------------------------------------------- *) let card = (book :> _ Widget.selector) in let scope = (scope :> _ Widget.selector) in let filter = (filter :> _ Widget.selector) in let behavior = new behavior ~main ~next ~prev ~index ~scope ~filter ~clear ~list ~provers ~card ~goal ~source ~popup in GuiPanel.on_reload behavior#reload ; GuiPanel.on_update behavior#update ; (* -------------------------------------------------------------------------- *) (* --- Panel view --- *) (* -------------------------------------------------------------------------- *) let panel = GPack.vbox ~homogeneous:false () in panel#pack ~expand:false focusbar#coerce ; panel#pack ~expand:true ~fill:true book#coerce ; let tab_label = (GMisc.label ~text:"WP Goals" ())#coerce in ignore (panel#misc#connect#after#realize behavior#reload) ; ignore (main#lower_notebook#append_page ~tab_label panel#coerce) ; main#register_source_highlighter source#highlight ; main#register_source_selector popup#register ; main#register_source_selector model_varinfo ; GuiPanel.register ~main ~configure_provers:dp_chooser#run ; end let () = Design.register_extension make let () = Design.register_reset_extension (fun main -> main#protect ~cancelable:false GuiPanel.reload) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiNavigator.mli������������������������������������������������0000666�0000000�0000000�00000003575�13571573400�017225� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- WP Lower Panel --- *) (* -------------------------------------------------------------------------- *) val make : Design.main_window_extension_points -> unit �����������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiPanel.ml�����������������������������������������������������0000666�0000000�0000000�00000024216�13571573400�016154� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Factory open GuiSource (* ------------------------------------------------------------------------ *) (* --- RUN WP --- *) (* ------------------------------------------------------------------------ *) exception Stop let update_callback = ref (fun () -> ()) let on_update f = update_callback := f let update () = !update_callback () let reload_callback = ref (fun () -> ()) let on_reload f = reload_callback := f let reload () = !reload_callback () module Wp_rte_generated = Kernel_function.Make_Table (Datatype.Unit) (struct let name = "GuiSource.Rte_generated" let size = 8 let dependencies = [ Ast.self ] end) let kf_of_selection = function | S_none -> None | S_fun kf -> Some kf | S_prop ip -> Property.get_kf ip | S_call s -> Some s.s_caller let wp_rte_generated s = match kf_of_selection s with | None -> false | Some kf -> if Wp_parameters.RTE.get () then let mem = Wp_rte_generated.mem kf in if not mem then Wp_rte_generated.add kf () ; not mem else false let spawn provers vcs = if not (Bag.is_empty vcs) then let provers = Why3.Whyconf.Sprover.elements provers#get in VC.command ~provers ~tip:true vcs let run_and_prove (main:Design.main_window_extension_points) (provers:GuiConfig.provers) (selection:GuiSource.selection) = begin try begin match selection with | S_none -> raise Stop | S_fun kf -> spawn provers (VC.generate_kf kf) | S_prop ip -> spawn provers (VC.generate_ip ip) | S_call s -> spawn provers (VC.generate_call s.s_stmt) end ; if wp_rte_generated selection then main#redisplay () else reload () with Stop -> () end (* ------------------------------------------------------------------------ *) (* --- Model Panel --- *) (* ------------------------------------------------------------------------ *) type memory = TREE | HOARE | TYPED | REGION class model_selector (main : Design.main_window_extension_points) = let dialog = new Wpane.dialog ~title:"WP Memory Model" ~window:main#main_window () in let memory = new Widget.group HOARE in let r_hoare = memory#add_radio ~label:"Hoare Memory Model" ~value:HOARE () in let r_typed = memory#add_radio ~label:"Typed Memory Model" ~value:TYPED () in let c_casts = new Widget.checkbox ~label:"Unsafe casts" () in let c_byref = new Widget.checkbox ~label:"Reference Arguments" () in let c_ctxt = new Widget.checkbox ~label:"Context Arguments (Caveat)" () in let c_cint = new Widget.checkbox ~label:"Machine Integers" () in let c_cfloat = new Widget.checkbox ~label:"Floating Points" () in let m_label = new Widget.label ~style:`Title () in object(self) initializer begin dialog#add_row r_hoare#coerce ; dialog#add_row r_typed#coerce ; dialog#add_row c_casts#coerce ; dialog#add_row c_byref#coerce ; dialog#add_row c_ctxt#coerce ; dialog#add_row c_cint#coerce ; dialog#add_row c_cfloat#coerce ; dialog#add_row m_label#coerce ; dialog#button ~label:"Cancel" ~icon:`CANCEL ~action:(`CANCEL) () ; dialog#button ~label:"Apply" ~icon:`APPLY ~action:(`APPLY) () ; memory#on_check TYPED c_casts#set_enabled ; memory#on_event self#connect ; c_casts#on_event self#connect ; c_byref#on_event self#connect ; c_ctxt#on_event self#connect ; c_cint#on_event self#connect ; c_cfloat#on_event self#connect ; dialog#on_value `APPLY self#update ; end method update () = Wp_parameters.Model.set [Factory.ident self#get] method set (s:setup) = begin (match s.mheap with | ZeroAlias -> memory#set TREE | Region -> memory#set REGION | Hoare -> memory#set HOARE | Typed m -> memory#set TYPED ; c_casts#set (m = MemTyped.Unsafe)) ; c_byref#set (s.mvar = Ref) ; c_ctxt#set (s.mvar = Caveat) ; c_cint#set (s.cint = Cint.Machine) ; c_cfloat#set (s.cfloat = Cfloat.Float) ; end method get : setup = let m = match memory#get with | TREE -> ZeroAlias | REGION -> Region | HOARE -> Hoare | TYPED -> Typed (if c_casts#get then MemTyped.Unsafe else MemTyped.Fits) in { mheap = m ; mvar = if c_ctxt#get then Caveat else if c_byref#get then Ref else Var ; cint = if c_cint#get then Cint.Machine else Cint.Natural ; cfloat = if c_cfloat#get then Cfloat.Float else Cfloat.Real ; } method connect () = begin m_label#set_text (Factory.descr self#get) ; c_byref#set_enabled (not c_ctxt#get) ; end method run = begin let s = Factory.parse (Wp_parameters.Model.get ()) in self#set s ; self#connect () ; dialog#run () ; end end (* ------------------------------------------------------------------------ *) (* --- WP Panel --- *) (* ------------------------------------------------------------------------ *) let wp_configure_model main () = (new model_selector main)#run let wp_panel ~(main:Design.main_window_extension_points) ~(configure_provers:unit -> unit) = let vbox = GPack.vbox () in let demon = Gtk_form.demon () in let packing = vbox#pack in let control = GPack.table ~columns:2 ~col_spacings:8 ~rows:2 ~packing () in let addcontrol line col w = control#attach ~left:(col-1) ~top:(line-1) ~expand:`NONE w in Gtk_form.label ~text:"timeout" ~packing:(addcontrol 1 2) () ; Gtk_form.spinner ~lower:0 ~upper:100000 ~tooltip:"Timeout for proving one proof obligation" ~packing:(addcontrol 1 1) Wp_parameters.Timeout.get Wp_parameters.Timeout.set demon ; Gtk_form.label ~text:"process" ~packing:(addcontrol 2 2) () ; Gtk_form.spinner ~lower:1 ~upper:32 ~tooltip:"Maximum number of parallel running provers" ~packing:(addcontrol 2 1) Wp_parameters.Procs.get (fun n -> Wp_parameters.Procs.set n ; ignore (ProverTask.server ()) (* to make server procs updated is server exists *) ) demon ; let hbox = GPack.hbox ~packing () in let model_cfg = new Widget.button ~label:"Model..." ~tooltip:"Configure WP Model" () in model_cfg#connect (wp_configure_model main) ; hbox#pack model_cfg#coerce ; let prover_cfg = new Widget.button ~label:"Provers..." ~tooltip:"Detect WP Provers" () in prover_cfg#connect configure_provers ; hbox#pack prover_cfg#coerce ; Gtk_form.menu [ "No Cache" , ProverWhy3.NoCache ; "Update" , ProverWhy3.Update ; "Cleanup" , ProverWhy3.Cleanup ; "Rebuild" , ProverWhy3.Rebuild ; "Replay" , ProverWhy3.Replay ; "Offline" , ProverWhy3.Offline ; ] ~packing:hbox#pack ~tooltip:"Proof Cache Mode" ProverWhy3.get_mode ProverWhy3.set_mode demon ; let pbox = GPack.hbox ~packing ~show:false () in let progress = GRange.progress_bar ~packing:(pbox#pack ~expand:true ~fill:true) () in let cancel = GButton.button ~packing:(pbox#pack ~expand:false) ~stock:`STOP () in cancel#misc#set_sensitive false ; let server = ProverTask.server () in ignore (cancel#connect#released (fun () -> Task.cancel_all server)) ; let inactive = (0,0) in let state = ref inactive in Task.on_server_activity server (fun () -> let scheduled = Task.scheduled server in let terminated = Task.terminated server in let remaining = scheduled - terminated in if remaining <= 0 then ( pbox#misc#hide () ; state := inactive ; cancel#misc#set_sensitive false ) else begin if !state = inactive then ( pbox#misc#show () ; cancel#misc#set_sensitive true ) ; let s_term , s_sched = !state in if s_term <> terminated then update () ; if s_sched <> scheduled || s_term <> terminated then begin progress#set_text (Printf.sprintf "%d / %d" terminated scheduled) ; progress#set_fraction (if scheduled = 0 then 1.0 else (float terminated /. float scheduled)) ; end ; state := (terminated,remaining) ; end) ; Task.on_server_stop server update ; begin "WP" , vbox#coerce , Some (Gtk_form.refresh demon) ; end let register ~main ~configure_provers = main#register_panel (fun main -> wp_panel ~main ~configure_provers) (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiPanel.mli����������������������������������������������������0000666�0000000�0000000�00000003657�13571573400�016333� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val update : unit -> unit val on_update : (unit -> unit) -> unit val reload : unit -> unit val on_reload : (unit -> unit) -> unit val run_and_prove : Design.main_window_extension_points -> GuiConfig.provers -> GuiSource.selection -> unit val register : main:Design.main_window_extension_points -> configure_provers:(unit -> unit) -> unit ���������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiProof.ml�����������������������������������������������������0000666�0000000�0000000�00000022121�13571573400�016173� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let rec rootchain node ns = match ProofEngine.parent node with | None -> node,ns | Some p -> rootchain p (p::ns) let pp_status fmt node = match ProofEngine.state node with | `Opened -> Format.fprintf fmt "@{<red>opened@}" | `Proved | `Pending 0 -> Format.fprintf fmt "@{<green>proved@}" | `Pending 1 -> Format.fprintf fmt "@{<orange>pending@}" | `Pending n -> Format.fprintf fmt "@{<orange>pending %d@}" n | `Script n -> Format.fprintf fmt "script with %d leaves" n class printer (text : Wtext.text) = let nodes : ProofEngine.position Wtext.marker = text#marker in let backs : ProofEngine.node Wtext.marker = text#marker in object(self) initializer begin nodes#set_hover [`BACKGROUND "orange"] ; backs#set_hover [`FOREGROUND "white" ; `BACKGROUND "red"] ; end method on_click f = nodes#on_click (fun (_,_,pos) -> f pos) method on_backtrack f = backs#on_click (fun (_,_,node) -> f node) method pp_node fmt node = nodes#mark (`Node node) Wpo.pp_title fmt (ProofEngine.goal node) method pp_main fmt tree = nodes#mark `Main Wpo.pp_title fmt (ProofEngine.main tree) method private results wpo = List.iter (fun (prv,res) -> if prv <> VCS.Tactical then if VCS.is_verdict res then if VCS.is_valid res then text#printf "@{<bf>Prover@} %a: @{<green>%a@}.@\n" VCS.pp_prover prv VCS.pp_result res else text#printf "@{<bf>Prover@} %a: @{<green>%a@}.@\n" VCS.pp_prover prv VCS.pp_result res ) (Wpo.get_results wpo) method private pp_state fmt node = match ProofEngine.state node with | `Proved -> Format.pp_print_string fmt "proved" | `Opened -> Format.pp_print_string fmt "opened" | `Pending 0 -> Format.pp_print_string fmt "terminated" | `Pending 1 -> Format.pp_print_string fmt "pending" | `Pending n -> Format.fprintf fmt "pending(%d)" n | `Script 0 -> Format.pp_print_string fmt "script" | `Script n -> Format.fprintf fmt "script(%d)" n method private tactic header node = match ProofEngine.children node with | [] -> text#printf "@{<bf>Tactical@}@} %s: @{<green>proved@} (Qed).@\n" header | [_,child] -> text#printf "@{<bf>Tactical@} %a: %a.@\n" self#pp_node child self#pp_state child | children -> begin match ProofEngine.pending node with | 0 -> text#printf "@{<green>@{<bf>Tactical@}@} %s: @{<green>proved@}.@\n" header | 1 -> text#printf "@{<bf>Tactical@} %s: @{<orange>pending@}.@\n" header ; | n -> text#printf "@{<bf>Tactical@} %s: @{<orange>pending(%d)@}.@\n" header n ; end ; List.iter (fun (part,child) -> text#printf "@{<bf>SubGoal@} %s : %a.@\n" part self#pp_state child) children method private alternative g a = let open ProofScript in match a with | Tactic(0,{ header },_) -> text#printf "@{<bf>Script@} %s: terminating.@\n" header | Tactic(n,{ header },_) -> text#printf "@{<bf>Script@} %s: pending %d.@\n" header n | Error(msg,_) -> text#printf "@{<bf>Script@} Error (%S).@\n" msg | Prover(p,r) -> if not (Wpo.has_verdict g p) then text#printf "@{<bf>Script@} %a: %a.@\n" VCS.pp_prover p VCS.pp_result r method private strategy index i h = text#printf "@{<bf>Strategy@} %s" h.Strategy.tactical#title ; if index = i then text#printf "(%4.2f)*@\n" h.Strategy.priority else text#printf "@{<fg:grey>(%4.2f)@}@\n" h.Strategy.priority method pending node = begin let g = ProofEngine.goal node in self#results g ; match ProofEngine.tactical node with | None -> List.iter (self#alternative g) (ProofEngine.bound node) | Some { ProofScript.header } -> self#tactic header node ; let index,hs = ProofEngine.get_strategies node in if Array.length hs > 0 then ( text#hrule ; Array.iteri (self#strategy index) hs ) end method status tree = match ProofEngine.current tree with | `Main -> self#results (ProofEngine.main tree) | `Internal node | `Leaf(_,node) -> self#pending node (* -------------------------------------------------------------------------- *) (* --- Script Printing --- *) (* -------------------------------------------------------------------------- *) method private pp_step ~prefix ~here fmt node = begin let goal = ProofEngine.goal node in let pp_goal fmt goal = Format.fprintf fmt "Goal %a" Wpo.pp_title goal in if node == here then Format.fprintf fmt "@\n%s@{<ul>%a@}" prefix pp_goal goal else let pp_node = nodes#mark (`Node node) pp_goal in text#printf "@\n%s%a" prefix pp_node goal ; end method private backtrack fmt node = let k,hs = ProofEngine.get_strategies node in let n = Array.length hs in if n > 1 then let k = if succ k < n then succ k else 0 in let tac = hs.(k).Strategy.tactical in let pp_label fmt tac = Format.fprintf fmt "backtrack(%s,%d/%d)" tac#title (succ k) n in Format.fprintf fmt " [ %a ]" (backs#mark node pp_label) tac method private proofstep ~prefix ~direct ~path ~here fmt node = begin self#pp_step ~prefix ~here fmt node ; match ProofEngine.tactical node with | None -> Format.fprintf fmt " (%a)" pp_status node | Some tactic -> Format.fprintf fmt " (%s" tactic.ProofScript.header ; match ProofEngine.children node with | [] -> Format.fprintf fmt ": @{<green>qed@})" | _::_ when not (List.mem node path) -> Format.fprintf fmt ": %a)%a" pp_status node self#backtrack node | [_,child] -> Format.fprintf fmt ")%a" self#backtrack node ; self#proofstep ~prefix:direct ~direct ~path ~here fmt child | children -> Format.fprintf fmt ": %a)%a" pp_status node self#backtrack node ; let prefix = direct ^ " + " in let direct = direct ^ " " in List.iter (fun (_,node) -> self#proofstep ~prefix ~direct ~path ~here fmt node) children end method tree tree = match ProofEngine.current tree with | `Main -> begin let wpo = ProofEngine.main tree in match ProofEngine.get wpo with | `Proof -> text#printf "@{<it>Existing Script (navigate to explore)@}@." | `Script -> text#printf "[%a]@." ProofSession.pp_goal wpo ; text#printf "@{<it>Existing Script (replay to explore)@}@." | `Saved -> text#printf "[%a]@." ProofSession.pp_goal wpo ; text#printf "@{<it>Saved Script (replay to load)@}@." | `None -> text#printf "@{<it>No Script@}@." end | `Internal here | `Leaf(_,here) -> begin let root,path = rootchain here [here] in let qed = if Wpo.is_proved (ProofEngine.main tree) then "Qed" else "End" in text#printf "@[<hv 0>@{<bf>Proof@}:%a@\n@{<bf>%s@}.@]@." (self#proofstep ~prefix:" " ~direct:" " ~path ~here) root qed ; end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiProof.mli����������������������������������������������������0000666�0000000�0000000�00000003702�13571573400�016350� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open ProofEngine class printer : Wtext.text -> object method on_click : (position -> unit) -> unit method on_backtrack : (node -> unit) -> unit method pp_main : Format.formatter -> tree -> unit method pp_node : Format.formatter -> node -> unit method pending : node -> unit method status : tree -> unit method tree : tree -> unit end ��������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiProver.ml����������������������������������������������������0000666�0000000�0000000�00000014667�13571573400�016403� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let no_status = `Share "theme/default/never_tried.png" let ok_status = `Share "theme/default/surely_valid.png" let ko_status = `Share "theme/default/unknown.png" let wg_status = `Share "theme/default/invalid.png" let filter = function | VCS.Qed | VCS.Tactical | VCS.NativeCoq -> false | VCS.Why3 _ | VCS.NativeAltErgo -> true (* -------------------------------------------------------------------------- *) (* --- Palette Tool --- *) (* -------------------------------------------------------------------------- *) let timeout_for = function | VCS.NativeAltErgo | VCS.Why3 _ -> let value = Wp_parameters.Timeout.get () in let spin = new Widget.spinner ~tooltip:"Prover Timeout (0 for none)" ~min:0 ~step:5 ~value () in Some spin | _ -> None let stepout_for = function | VCS.NativeAltErgo -> let value = Wp_parameters.Steps.get () in let spin = new Widget.spinner ~tooltip:"Prover Step Limit (0 for none)" ~min:0 ~step:100 ~value () in Some spin | _ -> None class prover ~(console:Wtext.text) ~prover = let tooltip = "Configure Prover" in let content = new Wpane.form () in let result = new Widget.label ~style:`Code ~align:`Center ~text:"No Result" () in let timeout = timeout_for prover in let stepout = stepout_for prover in object(self) inherit Wpalette.tool ~tooltip ~content:content#widget () initializer begin assert (filter prover) ; content#add_row ~xpadding:6 ~ypadding:4 result#coerce ; Wutil.on timeout (fun spin -> content#add_field ~label:"Timeout" spin#coerce) ; Wutil.on stepout (fun spin -> content#add_field ~label:"Steps" spin#coerce) ; end method prover = prover method private log wpo res = begin let fout = Wpo.get_file_logout wpo prover in let ferr = Wpo.get_file_logerr wpo prover in let lout = Sys.file_exists fout in let lerr = Sys.file_exists ferr in if lout || lerr then console#hrule ; console#scroll () ; console#printf "[%a] %a@." VCS.pp_prover prover VCS.pp_result res ; if lout then Command.pp_from_file console#fmt fout ; if lerr then Command.pp_from_file console#fmt ferr ; if lout || lerr then console#hrule ; end method private run wpo = begin let spinner = function None -> None | Some s -> Some s#get in let config = { VCS.valid = false ; VCS.timeout = spinner timeout ; VCS.stepout = spinner stepout ; } in let result wpo _prv _res = self#update wpo in let task = Prover.prove ~config ~result wpo prover in let thread = Task.thread task in let kill () = Wpo.set_result wpo prover VCS.no_result ; Task.cancel thread in Wpo.set_result wpo prover (VCS.computing kill) ; let server = ProverTask.server () in Task.spawn server thread ; Task.launch server ; Wutil.later (fun () -> self#update wpo) ; end method clear = begin self#set_status no_status ; self#set_action ~icon:`MEDIA_PLAY ~tooltip:"Run Prover" ?callback:None () ; Pretty_utils.ksfprintf self#set_label "%a" VCS.pp_prover prover ; result#set_text "No Goal" ; end method update wpo = begin let res = Wpo.get_result wpo prover in result#set_text (Pretty_utils.to_string VCS.pp_result_perf res) ; match res.VCS.verdict with | VCS.NoResult -> let callback () = self#run wpo in self#set_status no_status ; self#set_action ~icon:`MEDIA_PLAY ~tooltip:"Run Prover" ~callback () ; | VCS.Computing callback -> self#set_status `EXECUTE ; self#set_action ~tooltip:"Interrrupt Prover" ~icon:`STOP ~callback () ; Pretty_utils.ksfprintf self#set_label "%a (...)" VCS.pp_prover prover ; | VCS.Valid | VCS.Checked -> let callback () = self#run wpo in self#set_status ok_status ; self#set_action ~tooltip:"Run Prover" ~icon:`MEDIA_PLAY ~callback () ; Pretty_utils.ksfprintf self#set_label "%a (%a)" VCS.pp_prover prover Rformat.pp_time res.VCS.prover_time ; | VCS.Invalid | VCS.Unknown | VCS.Timeout | VCS.Stepout -> let callback () = self#run wpo in self#set_status ko_status ; self#set_action ~tooltip:"Run Prover" ~icon:`MEDIA_PLAY ~callback () ; Pretty_utils.ksfprintf self#set_label "%a (?)" VCS.pp_prover prover ; | VCS.Failed -> let callback () = self#log wpo res in self#set_status `DIALOG_WARNING ; self#set_action ~tooltip:"Dump Logs" ~icon:`FILE ~callback () ; Pretty_utils.ksfprintf self#set_label "%a (failed)" VCS.pp_prover prover ; end end �������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiProver.mli���������������������������������������������������0000666�0000000�0000000�00000003662�13571573400�016545� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Widget val no_status : icon val ok_status : icon val ko_status : icon val wg_status : icon val filter : VCS.prover -> bool (** Requires [filter prover]. *) class prover : console:Wtext.text -> prover:VCS.prover -> object inherit Wpalette.tool method clear : unit method update : Wpo.t -> unit method prover : VCS.prover end ������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiSequent.ml���������������������������������������������������0000666�0000000�0000000�00000056203�13571573400�016542� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Conditions open Lang.F type env = Plang.Env.t module F = Lang.F module Env = Plang.Env module Imap = Qed.Intmap type 'a printer = 'a Qed.Plib.printer type v_fold = [ `Auto | `Visible | `Hidden ] type v_term = [ v_fold | `Shared | `Name of string ] type part = Term | Goal | Step of step [@@@ warning "-32"] let pp_part fmt = function | Term -> Format.fprintf fmt "Term" | Goal -> Format.fprintf fmt "Goal" | Step s -> Format.fprintf fmt "Step #%d" s.id let pp_term fmt e = Format.fprintf fmt "E%03d" (F.QED.id e) let pp_target fmt = function | None -> Format.pp_print_string fmt "-" | Some e -> Format.fprintf fmt "T%03d" (F.QED.id e) let pp_fold fmt u = Format.pp_print_string fmt ( match u with `Auto -> "auto" | `Fold -> "fold" | `Unfold -> "unfold" ) [@@@ warning "+32"] (* -------------------------------------------------------------------------- *) (* --- Focus --- *) (* -------------------------------------------------------------------------- *) class autofocus = object(self) val mutable autofocus = true (* Term Visibility (forced by user) *) val mutable vterm : v_term Tmap.t = Tmap.empty (* Step Visibility (forced by user) *) val mutable vstep : v_fold Imap.t = Imap.empty (* Focused Terms ; lastly selected at head *) val mutable focusring = [] val mutable target = F.e_true (* Memoization of focused terms and steps occurrence *) val mutable occurs_term : bool Tmap.t = Tmap.empty val mutable occurs_step : bool Imap.t = Imap.empty (* Currently displayed sequent *) val mutable sequent : Conditions.sequent option = None method clear = begin sequent <- None ; self#reset ; end method reset = begin focusring <- [] ; vterm <- Tmap.empty ; vstep <- Imap.empty ; self#clear_cache ; end method private clear_cache = begin occurs_term <- Tmap.empty ; occurs_step <- Imap.empty ; end method private clear_steps = occurs_step <- Imap.empty (* --- Environment --- *) method env = let env = Env.create () in Tmap.iter (fun t v -> match v with | `Auto -> () | `Hidden -> Env.define env "..." t | `Visible -> Env.unfold env t | `Shared -> let base = F.basename t in let sanitizer = Plang.sanitizer in Env.define env (Env.fresh env ~sanitizer base) t | `Name x -> Env.define env x t) vterm ; env (* --- Term Occurrence --- *) method private occurs_term e = try Tmap.find e occurs_term with Not_found -> let occurs = try if List.memq e focusring then raise Exit ; if e != F.e_true && e == target then raise Exit ; F.lc_iter (fun e -> if self#occurs_term e then raise Exit) e ; false with Exit -> true in occurs_term <- Tmap.add e occurs occurs_term ; occurs method private occurs_seq seq = try Conditions.iter (fun s -> if self#occurs_step s then raise Exit) seq ; false with Exit -> true method private occurs_state s = try Mstate.iter (fun _m v -> if self#occurs_term v then raise Exit) s ; false with Exit -> true method private occurs_step step = try step.id < 0 (* defensive *) || Imap.find step.id occurs_step with Not_found -> let occurs = match step.condition with | When _ -> true | State s -> self#occurs_state s | Init p | Have p | Type p | Core p -> self#occurs_term (F.e_prop p) | Branch(p,sa,sb) -> self#occurs_term (F.e_prop p) || self#occurs_seq sa || self#occurs_seq sb | Either cs -> List.exists self#occurs_seq cs in occurs_step <- Imap.add step.id occurs occurs_step ; occurs (* --- Term Visibility --- *) method set_term t = function | `Auto -> if Tmap.mem t vterm then (vterm <- Tmap.remove t vterm ; self#clear_cache) | v -> let same = try v = Tmap.find t vterm with Not_found -> false in if not same then (vterm <- Tmap.add t v vterm ; self#clear_cache) method get_term t = try Tmap.find t vterm with Not_found -> `Auto method set_target e = target <- e method clear_target = target <- F.e_true method focus ~extend e = if F.lc_closed e then begin let ring = if extend then (List.filter (fun e0 -> e0 != e) focusring) else [] in focusring <- e :: ring ; self#clear_cache ; end method unfocus e = begin focusring <- List.filter (fun e0 -> e0 != e) focusring ; self#clear_cache ; end method unfocus_last = begin match focusring with | [] -> () | _::es -> focusring <- es ; self#clear_cache end method is_selected e = match focusring with e0::_ -> e0 == e | [] -> false method is_focused e = List.memq e focusring method is_visible e = if autofocus then self#occurs_term e else true method is_targeted e = autofocus && self#occurs_term e method set_autofocus flag = autofocus <- flag ; if flag then self#clear_cache else self#reset method get_autofocus = autofocus method is_autofocused = autofocus && Tmap.is_empty vterm (* --- Sequent Management --- *) method set_step s = function | `Auto -> if Imap.mem s.id vstep then (vstep <- Imap.remove s.id vstep ; self#clear_steps) | v -> let same = try v = Imap.find s.id vstep with Not_found -> false in if not same then (vstep <- Imap.add s.id v vstep ; self#clear_steps) method get_step s = try Imap.find s.id vstep with Not_found -> `Auto method is_visible_step (s : step) = match self#get_step s with | `Auto -> if autofocus then self#occurs_step s else true | `Visible -> true | `Hidden -> false method locate a = match sequent with | None -> Tactical.Empty | Some (hs,goal) -> if F.is_subterm a (F.e_prop goal) then Tactical.(Inside(Goal goal,a)) else let pool = ref Tactical.Empty in let rec lookup_sequence a hs = Conditions.iter (fun step -> match step.condition with | (Have p | When p | Branch(p,_,_)) when F.is_subterm a (F.e_prop p) -> pool := Tactical.(Inside(Step step,a)) ; raise Exit | Branch(_,sa,sb) -> lookup_sequence a sa ; lookup_sequence a sb ; | Either cs -> List.iter (lookup_sequence a) cs | State _ | Type _ | Init _ | Have _ | When _ | Core _ -> () ) hs in (try lookup_sequence a hs with Exit -> ()) ; !pool (* ---- Global ----- *) method set_sequent (s : sequent) = let updated = match sequent with None -> true | Some s0 -> s0 != s in if updated then begin sequent <- Some s ; Conditions.index s ; vstep <- Imap.empty ; self#clear_cache ; end ; updated end (* -------------------------------------------------------------------------- *) (* --- Term Engine --- *) (* -------------------------------------------------------------------------- *) class type term_selection = object method is_focused : term -> bool method is_visible : term -> bool method is_targeted : term -> bool end class plang ~(term : term Wtext.marker) ~(focus : term Wtext.marker) ~(target : term Wtext.marker) (autofocus : term_selection) = object(self) inherit Pcond.state as super method! shareable e = autofocus#is_targeted e || super#shareable e val mutable tgt = F.e_true method set_target t = tgt <- t method clear_target = tgt <- F.e_true method private wrap pp fmt e = if e != F.e_true && e == tgt then target#wrap pp fmt e else if autofocus#is_focused e then focus#wrap pp fmt e else if F.lc_closed e then term#wrap pp fmt e else pp fmt e method! pp_at fmt lbl = Format.fprintf fmt "@{<wp:label>@@%a@}" super#pp_label lbl method! pp_label fmt lbl = Format.fprintf fmt "@{<wp:label>%a@}" super#pp_label lbl method! pp_var fmt x = Format.fprintf fmt "@{<wp:var>%s@}" x method! pp_flow fmt e = self#wrap super#pp_flow fmt e method! pp_atom fmt e = self#wrap super#pp_atom fmt e end (* -------------------------------------------------------------------------- *) (* --- Sequent Engine --- *) (* -------------------------------------------------------------------------- *) class type step_selection = object method is_visible : term -> bool method is_visible_step : step -> bool end class pcond ~(part : part Wtext.marker) ~(target : part Wtext.marker) (focus : step_selection) (plang : Pcond.state) = object(self) inherit Pcond.sequence plang as super (* All displayed entries *) val mutable domain = Vars.empty val mutable ellipsed = false val mutable parts : part Wtext.entry list = [] val mutable tgt : part = Term (* empty *) (* Register displayed entries *) initializer part#on_add (fun entry -> parts <- entry :: parts) method set_target p = tgt <- p method part p q = try let (_,_,part) = List.find (fun (a,b,_) -> a <= p && q <= b) (List.rev parts) in part (* find the tightest step, which was added first *) with Not_found -> Term (* Step Visibility Management *) method visible step = focus#is_visible_step step || match tgt with | Term | Goal -> false | Step s -> s.id = step.id method private domain seq = Conditions.iter (fun step -> if self#visible step && not (Vars.subset step.vars domain) then begin match step.condition with | State _ -> () | Have p | Init p | Core p | When p | Type p -> domain <- Vars.union (F.varsp p) domain | Branch(p,a,b) -> domain <- Vars.union (F.varsp p) domain ; self#domain a ; self#domain b | Either cs -> List.iter self#domain cs end ) seq (* local-variable marking ; not hover/clickable marks *) method! mark (m : F.marks) s = if self#visible s then super#mark m s method! pp_step fmt step = if self#visible step then begin ellipsed <- false ; match tgt with | Step { condition = State _ } -> super#pp_step fmt step | Step s when s == step -> target#mark (Step step) super#pp_step fmt step | _ -> part#mark (Step step) super#pp_step fmt step end else ( if not ellipsed then Format.fprintf fmt "@ [...]" ; ellipsed <- true ) method! pp_goal fmt goal = match tgt with | Goal -> target#mark Goal super#pp_goal fmt goal | _ -> part#mark Goal super#pp_goal fmt goal method! pp_block ~clause fmt seq = try Conditions.iter (fun step -> if self#visible step then raise Exit) seq ; Format.fprintf fmt "@ %a { ... }" self#pp_clause clause with Exit -> begin ellipsed <- false ; super#pp_block ~clause fmt seq ; ellipsed <- false ; end (* Global Call *) method! set_sequence hyps = parts <- [] ; domain <- Vars.empty ; super#set_sequence hyps ; if self#get_state then begin self#domain hyps ; plang#set_domain domain ; end end (* -------------------------------------------------------------------------- *) (* --- Printer --- *) (* -------------------------------------------------------------------------- *) type target = part * F.term option class focused (wtext : Wtext.text) = let parts : part Wtext.marker = wtext#marker in let terms : term Wtext.marker = wtext#marker in let focus : term Wtext.marker = wtext#marker in let button : (unit -> unit) Wtext.marker = wtext#marker in let target_term : term Wtext.marker = wtext#marker in let target_part : part Wtext.marker = wtext#marker in let autofocus = new autofocus in let term_selection = (autofocus :> term_selection) in let step_selection = (autofocus :> step_selection) in let plang = new plang ~term:terms ~focus:focus ~target:target_term term_selection in let pcond = new pcond ~part:parts ~target:target_part step_selection (plang :> Pcond.state) in let popup = new Widget.popup () in object(self) val mutable demon = [] val mutable items = [] val mutable sequent = Conditions.empty , F.p_true val mutable selected_term = None val mutable selected_part = Term val mutable targeted = [] initializer begin wtext#set_font "Monospace" ; wtext#set_css [ "wp:clause" , [`WEIGHT `BOLD] ; "wp:comment" , [`FOREGROUND "darkgreen"] ; "wp:property" , [`FOREGROUND "blue"] ; "wp:label" , [`FOREGROUND "darkgreen"] ; "wp:stmt" , [`WEIGHT `BOLD;`FOREGROUND "darkgreen"] ; "wp:var" , [`STYLE `ITALIC] ; ] ; terms#set_hover [`BACKGROUND "lightblue"] ; parts#set_hover [`BACKGROUND "lightgreen"] ; focus#set_style [`BACKGROUND "wheat"] ; button#set_style [`BACKGROUND "lightblue" ]; button#set_hover [`BACKGROUND "orange" ]; button#on_click (fun (_,_,cb) -> cb ()) ; target_part#set_style [`BACKGROUND "orange"] ; target_term#set_style [`BACKGROUND "orange"] ; parts#on_click self#on_part ; parts#on_right_click self#on_popup_part ; terms#on_click (self#on_term ~extend:false) ; terms#on_shift_click (self#on_term ~extend:true) ; terms#on_right_click self#on_popup_term ; focus#on_click self#on_select ; focus#on_right_click self#on_popup_term ; target_part#on_right_click self#on_popup_part ; target_term#on_right_click self#on_popup_term ; target_part#on_add (fun (p,q,_) -> self#added_zone p q) ; target_term#on_add (fun (p,q,_) -> self#added_zone p q) ; end method reset = selected_term <- None ; selected_part <- Term ; targeted <- [] ; autofocus#reset method private added_zone p q = targeted <- (p,q) :: targeted method private target_zone = try List.find (fun (p,q) -> match selected_part , pcond#part p q with | Goal , Goal -> true | Step s , Step s' -> s.id = s'.id | _ -> false ) targeted with Not_found -> 0,0 method get_focus_mode = autofocus#get_autofocus method set_focus_mode = autofocus#set_autofocus method get_state_mode = pcond#get_state method set_state_mode = pcond#set_state method set_iformat = plang#set_iformat method get_iformat = plang#get_iformat method set_rformat = plang#set_rformat method get_rformat = plang#get_rformat method selected = begin self#set_target self#selection ; List.iter (fun f -> f ()) demon ; end method on_selection f = demon <- demon @ [f] method on_popup (f : Widget.popup -> unit) = items <- items @ [f] method private item ~label ~callback = let callback () = let () = callback () in self#selected in popup#add_item ~label ~callback method private popup_term e = match autofocus#get_term e with | `Auto -> begin if autofocus#is_focused e then self#item ~label:"Un-focus Term" ~callback:(fun () -> autofocus#unfocus e) ; self#item ~label:"Hide Term" ~callback:(fun () -> autofocus#set_term e `Hidden) ; self#item ~label:"Don't Share" ~callback:(fun () -> autofocus#set_term e `Visible) ; end | `Hidden -> self#item ~label:"Show Term" ~callback:(fun () -> autofocus#set_term e `Auto) | `Visible | `Name _ | `Shared -> self#item ~label:"Autofocus" ~callback:(fun () -> autofocus#set_term e `Auto) method private popup_part = function | Goal | Term -> self#item ~label:"Reset Autofocus" ~callback:(fun () -> autofocus#reset) | Step step -> if autofocus#is_visible_step step then self#item ~label:"Hide Clause" ~callback:(fun () -> autofocus#set_step step `Hidden) else self#item ~label:"Show Clause" ~callback:(fun () -> autofocus#set_step step `Visible) method popup = begin popup#clear ; begin match selected_term with | Some e -> self#popup_term e | None -> self#popup_part selected_part end ; popup#add_separator ; List.iter (fun f -> f popup) items ; popup#run () ; end method selection = let inside clause t = if F.p_bool t == Tactical.head clause then Tactical.(Clause clause) else Tactical.(Inside(clause,t)) in match selected_part , selected_term with | Term , None -> Tactical.Empty | Goal , None -> Tactical.(Clause(Goal(snd sequent))) | Step s , None -> Tactical.(Clause(Step s)) | Term , Some t -> autofocus#locate t | Goal , Some t -> inside Tactical.(Goal (snd sequent)) t | Step s , Some t -> inside Tactical.(Step s) t method unselect = begin let p = selected_part in selected_part <- Term ; let t = selected_term in selected_term <- None ; autofocus#unfocus_last ; p,t end method restore (p,t) = begin selected_part <- p ; selected_term <- t ; self#set_target self#selection ; end method set_target tgt = match tgt with | Tactical.Empty | Tactical.Compose _ -> begin pcond#set_target Term ; plang#clear_target ; autofocus#clear_target ; end | Tactical.Inside (_,t) -> begin pcond#set_target Term ; plang#set_target t ; autofocus#set_target t ; end | Tactical.Clause (Tactical.Goal _) -> begin pcond#set_target Goal ; plang#clear_target ; autofocus#clear_target ; end | Tactical.Clause (Tactical.Step s) -> begin pcond#set_target (Step s) ; plang#clear_target ; autofocus#clear_target ; end method private on_term ~extend (p,q,e) = if F.lc_closed e then (* defensive *) begin selected_term <- Some e ; selected_part <- pcond#part p q ; autofocus#focus ~extend e ; self#selected ; end method private on_select (p,q,e) = if F.lc_closed e then (* defensive *) begin selected_term <- Some e ; selected_part <- pcond#part p q ; self#selected ; end method private on_part (_,_,part) = begin selected_term <- None ; selected_part <- part ; autofocus#reset ; self#selected ; end method private on_popup_term (p,q,e) = if F.lc_closed e then (* defensive *) begin selected_term <- Some e; selected_part <- pcond#part p q ; self#popup ; end method private on_popup_part (_,_,part) = begin selected_term <- None ; selected_part <- part ; self#popup ; end method pp_term fmt e = plang#pp_sort fmt e method pp_pred fmt p = plang#pp_pred fmt p method pp_selection fmt = function | Tactical.Empty -> Format.fprintf fmt " - " | Tactical.Compose(Tactical.Range(a,b)) -> Format.fprintf fmt "%d..%d" a b | sel -> self#pp_term fmt (Tactical.selected sel) method sequent = sequent method pp_sequent s fmt = sequent <- s ; if autofocus#set_sequent s then begin selected_term <- None ; selected_part <- Term ; end ; targeted <- [] ; let env = autofocus#env in if pcond#get_state then Env.set_indexed_vars env ; pcond#pp_esequent env fmt s ; let p,q = self#target_zone in if p > 0 && q > p then (Wutil.later (fun () -> wtext#select ~scroll:true p q)) method goal w fmt = let open Wpo in match w.po_formula with | GoalLemma _ -> Format.fprintf fmt "@\n@{<wp:clause>Lemma@} %a:@\n" Wpo.pp_title w ; let _,sequent = Wpo.compute w in self#pp_sequent sequent fmt | GoalAnnot _ -> Format.fprintf fmt "@\n@{<wp:clause>Goal@} %a:@\n" Wpo.pp_title w ; let _,sequent = Wpo.compute w in self#pp_sequent sequent fmt method button ~title ~callback fmt = let pp_title fmt title = Format.fprintf fmt " %s " title in Format.fprintf fmt "[%a]" (button#mark callback pp_title) title end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiSequent.mli��������������������������������������������������0000666�0000000�0000000�00000005731�13571573400�016713� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang.F type env = Plang.Env.t type 'a printer = 'a Qed.Plib.printer (* -------------------------------------------------------------------------- *) (* --- Sequent Pretty-Printer --- *) (* -------------------------------------------------------------------------- *) type target class focused : Wtext.text -> object method reset : unit method get_focus_mode : bool method set_focus_mode : bool -> unit method get_state_mode : bool method set_state_mode : bool -> unit method get_iformat : Plang.iformat method set_iformat : Plang.iformat -> unit method get_rformat : Plang.rformat method set_rformat : Plang.rformat -> unit method selected : unit method unselect : target method restore : target -> unit method on_selection : (unit -> unit) -> unit method sequent : Conditions.sequent method selection : Tactical.selection method set_target : Tactical.selection -> unit method popup : unit method on_popup : (Widget.popup -> unit) -> unit method pp_term : term printer method pp_pred : pred printer method pp_selection : Tactical.selection printer method pp_sequent : Conditions.sequent -> Format.formatter -> unit method goal : Wpo.t -> Format.formatter -> unit method button : title:string -> callback:(unit -> unit) -> Format.formatter -> unit end ���������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiSource.ml����������������������������������������������������0000666�0000000�0000000�00000021633�13571573400�016355� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Source Interaction for WP --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype open Pretty_source open Wpo type selection = | S_none | S_fun of Kernel_function.t | S_prop of Property.t | S_call of call and call = { s_caller : Kernel_function.t ; s_called : Kernel_function.t ; s_stmt : Stmt.t ; } let selection_of_localizable = function | PStmt( kf , stmt ) | PStmtStart( kf , stmt ) | PLval( Some kf , Kstmt stmt , _ ) | PTermLval( Some kf , Kstmt stmt , _, _ ) -> begin match stmt with | { skind=Instr(Call(_,e,_,_)) } -> begin match Kernel_function.get_called e with | None -> S_none | Some called -> S_call { s_called = called ; s_caller = kf ; s_stmt = stmt ; } end | { skind=Instr(Local_init(_,ConsInit (vi, _, _),_)) } -> S_call { s_called = Globals.Functions.get vi ; s_caller = kf ; s_stmt = stmt ; } | _ -> S_none end | PVDecl (Some kf,_,{vglob=true}) -> S_fun kf | PIP ip -> S_prop ip | PVDecl _ | PLval _ | PExp _ | PTermLval _ | PGlobal _ -> S_none let kind_of_property = function | Property.IPLemma _ -> "lemma" | Property.IPCodeAnnot _ -> "annotation" | Property.(IPPredicate {ip_kind=PKRequires _;ip_kinstr = Kglobal}) -> "precondition for callers" | _ -> "property" (* -------------------------------------------------------------------------- *) (* --- Popup Menu for WP --- *) (* -------------------------------------------------------------------------- *) let is_rte_generated kf = List.for_all (fun (_, _, lookup) -> lookup kf) (!Db.RteGen.get_all_status ()) class popup () = object(self) val mutable click : selection -> unit = (fun _ -> ()) val mutable prove : selection -> unit = (fun _ -> ()) method on_click f = click <- f method on_prove f = prove <- f method private rte_generate kf = let setup = Factory.parse (Wp_parameters.Model.get ()) in let driver = Driver.load_driver () in let model = Factory.instance setup driver in WpRTE.generate model kf method private rte_option (menu : GMenu.menu GMenu.factory) (main : Design.main_window_extension_points) title action kf = ignore (menu#add_item title ~callback:(fun () -> action kf ; main#redisplay ())) method private rte_popup menu main loc = match loc with | PVDecl (Some kf,_,{vglob=true}) -> if not (is_rte_generated kf) then self#rte_option menu main "Insert wp-rte guards" self#rte_generate kf ; | _ -> () method private wp_popup (menu : GMenu.menu GMenu.factory) = function | S_none -> () | s -> let target = match s with | S_none -> "none" | S_prop ip -> kind_of_property ip | S_call _ -> "call preconditions" | S_fun _ -> "function annotations" in let title = Printf.sprintf "Prove %s by WP" target in ignore (menu#add_item title ~callback:(fun () -> prove s)) method register (menu : GMenu.menu GMenu.factory) (main : Design.main_window_extension_points) ~(button:int) (loc:Pretty_source.localizable) = begin match button with | 1 -> begin match selection_of_localizable loc with | S_none -> () | s -> click s end | 3 -> begin self#wp_popup menu (selection_of_localizable loc) ; self#rte_popup menu main loc ; end | _ -> () end end (* -------------------------------------------------------------------------- *) (* --- Source Highlighter for WP --- *) (* -------------------------------------------------------------------------- *) module PATH = Stmt.Set module DEPS = Property.Set let apply_tag name attr buffer start stop = let tg = Gtk_helper.make_tag buffer name attr in Gtk_helper.apply_tag buffer tg start stop let apply_goal = apply_tag "wp.goal" [`BACKGROUND "lightblue"] let apply_effect = apply_tag "wp.effect" [`BACKGROUND "lightblue"] let apply_path = apply_tag "wp.path" [`BACKGROUND "yellow"] let apply_depend = apply_tag "wp.depend" [`BACKGROUND "pink"] let instructions path = PATH.filter (fun s -> match s.skind with | Instr _ -> true | _ -> false) path let lemmas ls = List.fold_left (fun s l -> DEPS.add (LogicUsage.ip_lemma l) s) DEPS.empty ls class highlighter (main:Design.main_window_extension_points) = object(self) val mutable goal = None (* orange *) val mutable effect = None (* blue *) val mutable path = PATH.empty (* yellow *) val mutable deps = DEPS.empty (* green *) val mutable current = None method private clear = begin goal <- None ; effect <- None ; path <- PATH.empty ; deps <- DEPS.empty ; end method private scroll () = main#rehighlight () ; match goal with | None -> () | Some ip -> main#scroll (PIP ip) method set s = let moved = match current, s with | None , None -> false | Some s0 , Some s1 -> s0.po_gid <> s1.po_gid | None , Some _ | Some _ , None -> true in if moved then begin current <- s ; self#clear ; match s with | None -> Wutil.later main#rehighlight ; | Some { Wpo.po_pid = pid ; Wpo.po_formula = f } -> begin match f with | GoalLemma l -> deps <- lemmas l.VC_Lemma.depends | GoalAnnot a -> effect <- a.VC_Annot.effect ; path <- instructions a.VC_Annot.path ; deps <- a.VC_Annot.deps ; end ; if not (WpPropId.is_check pid || WpPropId.is_tactic pid) then ( let ip = WpPropId.property_of_id pid in goal <- Some ip ) ; Wutil.later self#scroll ; end method update = main#rehighlight () method highlight (buffer : Design.reactive_buffer) (loc : Pretty_source.localizable) ~(start:int) ~(stop:int) = let buffer = buffer#buffer in begin match loc with | PStmt( _ , stmt ) | PStmtStart( _ , stmt ) -> begin match effect with | Some(s,_) when Stmt.equal stmt s -> apply_effect buffer start stop | _ -> if PATH.mem stmt path then apply_path buffer start stop end | PIP ip -> begin match goal with | Some g when Property.equal g ip -> apply_goal buffer start stop | _ -> if DEPS.mem ip deps then apply_depend buffer start stop end | PGlobal _ | PVDecl _ | PTermLval _ | PLval _ | PExp _ -> () end end �����������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiSource.mli���������������������������������������������������0000666�0000000�0000000�00000005112�13571573400�016520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Source Interaction for WP --- *) (* -------------------------------------------------------------------------- *) open Cil_types type selection = | S_none | S_fun of Kernel_function.t | S_prop of Property.t | S_call of call and call = { s_caller : Kernel_function.t ; s_called : Kernel_function.t ; s_stmt : stmt ; } class popup : unit -> object method on_click : (selection -> unit) -> unit method on_prove : (selection -> unit) -> unit method register : GMenu.menu GMenu.factory -> Design.main_window_extension_points -> button:int -> Pretty_source.localizable -> unit end class highlighter : Design.main_window_extension_points -> object method set : Wpo.t option -> unit method update : unit method highlight : Design.reactive_buffer -> Pretty_source.localizable -> start:int -> stop:int -> unit end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiTactic.ml����������������������������������������������������0000666�0000000�0000000�00000050461�13571573400�016325� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Tactical (* -------------------------------------------------------------------------- *) (* --- Composer --- *) (* -------------------------------------------------------------------------- *) class type composer = object method title : string method descr : string method target : selection method ranged : bool method is_valid : selection -> bool method get_value : selection method set_value : selection -> unit end class type browser = object method title : string method descr : string method target : selection method search : (unit named -> unit) -> int -> bool method choose : string option -> unit end (* -------------------------------------------------------------------------- *) (* --- Field Widget --- *) (* -------------------------------------------------------------------------- *) class virtual wfield = object(self) method wfield = (self :> wfield) val mutable target = Empty method target = target method select tgt = target <- tgt method compose_with (_ : composer -> unit) = () method browse_with (_ : browser -> unit) = () method clear = self#reset ; target <- Empty method virtual reset : unit method virtual connect : (unit -> unit) -> unit method virtual update : ?enabled:bool -> ?title:string -> ?tooltip:string -> ?range:bool -> ?vmin:int -> ?vmax:int -> ?filter:(Lang.F.term -> bool) -> string -> unit end (* -------------------------------------------------------------------------- *) (* --- Checkbox Widget --- *) (* -------------------------------------------------------------------------- *) class checkbox (tac : Tactical.t) (form : Wpane.form) (field : bool field) = let s = Tactical.signature field in let button = new Widget.checkbox ~label:s.title ~tooltip:s.descr () in object inherit wfield initializer begin form#add_field ~field:`Compact button#coerce ; button#connect (tac#set_field field) ; end method reset = button#set s.value method connect = button#on_event method update ?enabled ?title ?tooltip ?range ?vmin ?vmax ?filter id = if id = Tactical.ident field then begin Wutil.on enabled button#set_visible ; Wutil.on tooltip button#set_tooltip ; ignore title ; ignore filter ; ignore vmin ; ignore vmax ; ignore range ; end end (* -------------------------------------------------------------------------- *) (* --- Spinner Widget --- *) (* -------------------------------------------------------------------------- *) class spinner (tac : Tactical.t) (form : Wpane.form) (field : int field) (range : int range) = let s = Tactical.signature field in let spin = new Widget.spinner ?min:range.vmin ?max:range.vmax ~step:range.vstep ~value:s.value ~tooltip:s.descr () in object inherit wfield initializer begin form#add_field ~label:s.title ~field:`Compact spin#coerce ; spin#connect (tac#set_field field) ; end method reset = spin#set s.value method connect = spin#on_event method update ?enabled ?title ?tooltip ?range ?vmin ?vmax ?filter id = if id = Tactical.ident field then begin Wutil.on enabled spin#set_visible ; Wutil.on tooltip spin#set_tooltip ; Wutil.on vmin spin#set_min ; Wutil.on vmax spin#set_max ; ignore title ; ignore range ; ignore filter ; end end (* -------------------------------------------------------------------------- *) (* --- Composer Widget --- *) (* -------------------------------------------------------------------------- *) class mkcomposer (tac : Tactical.t) (form : Wpane.form) (field : selection field) (accept : Lang.F.term -> bool) (pp : Format.formatter -> Tactical.selection -> unit) = let s = Tactical.signature field in let head = new Widget.label ~style:`Label ~align:`Left () in let edit = new Widget.button ~icon:`EDIT ~tooltip:s.descr () in let hbox = Wbox.(hbox [ h head ; w ~padding:8 edit ]) in object(self) inherit wfield initializer form#add_row hbox#coerce val mutable wtitle = s.title val mutable wdescr = s.descr val mutable wvalid = accept val mutable ranged = false val mutable demon = [] method private updated = match tac#get_field field with | Empty -> Pretty_utils.ksfprintf head#set_text "%s: -" wtitle | value -> let text = Pretty_utils.sfprintf "@[<hov 2>%s: %a@]" wtitle pp value in let msg = if String.length text <= 20 then text else String.sub text 0 17 ^ "..." in head#set_text msg (* --- Composer API ---- *) method composer = (self :> composer) method title = wtitle method descr = wdescr method ranged = ranged method is_valid = function | Empty -> false | Compose(Range(a,b)) -> ranged && (a <= b) | _ as s -> try wvalid (Tactical.selected s) with _ -> false method get_value = tac#get_field field method set_value v = tac#set_field field v ; self#updated ; List.iter (fun f -> f ()) demon method! compose_with f = edit#connect (fun () -> f self#composer) (* --- Wfield API ---- *) method reset = wtitle <- s.title ; wdescr <- s.descr ; wvalid <- accept ; tac#set_field field Tactical.Empty ; self#updated method connect f = demon <- demon @ [f] method update ?enabled ?title ?tooltip ?range ?vmin ?vmax ?filter id = if id = Tactical.ident field then begin Wutil.on enabled hbox#set_visible ; Wutil.on title (fun s -> wtitle <- s) ; Wutil.on tooltip (fun d -> wdescr <- d) ; Wutil.on filter (fun f -> wvalid <- f) ; Wutil.on range (fun r -> ranged <- r) ; ignore vmin ; ignore vmax ; end end (* -------------------------------------------------------------------------- *) (* --- Search Widget --- *) (* -------------------------------------------------------------------------- *) exception StopLookup class ['a] mksearch (tac : Tactical.t) (form : Wpane.form) (field : 'a named option field) (browser : 'a Tactical.browser) = let s = Tactical.signature field in let head = new Widget.label ~style:`Label ~align:`Left () in let edit = new Widget.button ~icon:`FIND ~tooltip:s.descr () in let hbox = Wbox.(hbox [ h head ; w ~padding:8 edit ]) in object(self) inherit wfield initializer form#add_row hbox#coerce ; val mutable wtitle = s.title val mutable wdescr = s.descr val items : (string,'a named) Hashtbl.t = Hashtbl.create 7 val mutable demon = [] method private updated = match tac#get_field field with | None -> Pretty_utils.ksfprintf head#set_text "%s: -" wtitle | Some item -> begin let text = item.title in let msg = if String.length text <= 20 then text else String.sub text 0 17 ^ "..." in head#set_text msg ; head#set_tooltip item.descr ; end (* --- Browser API --- *) method browser = (self :> browser) method choose item = let value = match item with | Some id -> (try Some(Hashtbl.find items id) with Not_found -> None) | None -> None in tac#set_field field value ; self#updated ; List.iter (fun f -> f ()) demon method search f n = let count = ref n in Hashtbl.clear items ; try browser (fun item -> if !count <= 0 then raise StopLookup ; Hashtbl.add items item.vid item ; f { item with value = () } ; decr count ; ) target ; true with StopLookup -> false method! browse_with f = edit#connect (fun () -> f self#browser) (* --- Wfield API --- *) method title = wtitle method descr = wdescr method reset = wtitle <- s.title ; wdescr <- s.descr ; tac#set_field field None ; Hashtbl.clear items ; self#updated ; method connect f = demon <- demon @ [f] method update ?enabled ?title ?tooltip ?range ?vmin ?vmax ?filter id = if id = Tactical.ident field then begin Wutil.on enabled hbox#set_visible ; Wutil.on title (fun s -> wtitle <- s) ; Wutil.on tooltip (fun d -> wdescr <- d) ; ignore filter ; ignore range ; ignore vmin ; ignore vmax ; end end (* -------------------------------------------------------------------------- *) (* --- Selector Widget --- *) (* -------------------------------------------------------------------------- *) class ['a] selector (tac : Tactical.t) (form : Wpane.form) (field : 'a field) (options : 'a Tactical.named list) (equal : 'a -> 'a -> bool) = let s = Tactical.signature field in let lookup a = try List.find (fun v -> equal v.value a) options with Not_found -> { title = "" ; descr = "(unknown item)" ; vid = "unknown" ; value=a } in let default = lookup s.value in let render item = item.title in let combo = new Widget.menu ~default ~render ~items:options () in object inherit wfield initializer begin form#add_field ~label:s.title ~field:`Compact combo#coerce ; combo#connect (fun opt -> tac#set_field field opt.value) ; end method reset = combo#set default method connect = combo#on_event method update ?enabled ?title ?tooltip ?range ?vmin ?vmax ?filter id = if id = Tactical.ident field then begin Wutil.on enabled combo#widget#set_visible ; Wutil.on tooltip combo#set_tooltip ; ignore filter ; ignore title ; ignore vmin ; ignore vmax ; ignore range ; end end (* -------------------------------------------------------------------------- *) (* --- Dispatcher --- *) (* -------------------------------------------------------------------------- *) let wfield tac form pp = function | Checkbox fd -> (new checkbox tac form fd)#wfield | Spinner(fd,r) -> (new spinner tac form fd r)#wfield | Selector(fd,opt,eq) -> (new selector tac form fd opt eq)#wfield | Composer(fd,f) -> (new mkcomposer tac form fd f pp)#wfield | Search(fd,browser,_) -> (new mksearch tac form fd browser)#wfield (* -------------------------------------------------------------------------- *) (* --- Tactic Widget --- *) (* -------------------------------------------------------------------------- *) type edited = { tree : ProofEngine.tree ; target : selection ; browser : (browser -> unit) ; composer : (composer -> unit) ; process : (tactical -> selection -> process -> unit) ; } class tactic (tac : tactical) (pp : Format.formatter -> Tactical.selection -> unit) = let form = new Wpane.form () in let descr = new Widget.label ~style:`Descr ~width:24 ~align:`Left () in object(self) val mutable title = tac#title val mutable wfields : wfield list = [] val mutable edited : edited option = None val mutable hints = Fmap.create () val mutable error = false inherit Wpalette.tool ~content:form#widget () as dongle initializer begin form#add_row ~xpadding:4 ~ypadding:2 ~field:`Compact descr#coerce ; self#set_action ~tooltip:"Apply Tactic" ~icon:`MEDIA_PLAY () ; wfields <- List.map (wfield tac form pp) tac#params ; List.iter (fun fd -> fd#connect self#updated) wfields ; List.iter (fun fd -> fd#compose_with self#compose) wfields ; List.iter (fun fd -> fd#browse_with self#browse) wfields ; self#set_tooltip (if wfields = [] then "Tactic Details" else "Configure Tactic") ; end (* -------------------------------------------------------------------------- *) (* --- Panel API --- *) (* -------------------------------------------------------------------------- *) method! set_label = fun msg -> title <- msg ; dongle#set_label msg method set_title : 'a. 'a formatter = fun msg -> Pretty_utils.ksfprintf self#set_label msg method set_descr : 'a. 'a formatter = fun msg -> Pretty_utils.ksfprintf descr#set_text msg (* -------------------------------------------------------------------------- *) (* --- Feedback API --- *) (* -------------------------------------------------------------------------- *) method pool = match edited with | None -> assert false | Some { tree } -> ProofEngine.pool tree method interactive = self#is_active method get_title = title method has_error = error method set_error : 'a. 'a formatter = begin fun msg -> error <- true ; descr#set_fg (`NAME "red") ; Pretty_utils.ksfprintf descr#set_text msg ; end method update_field : 'a. ?enabled:bool -> ?title:string -> ?tooltip:string -> ?range:bool -> ?vmin:int -> ?vmax:int -> ?filter:(Lang.F.term -> bool) -> 'a field -> unit = fun ?enabled ?title ?tooltip ?range ?vmin ?vmax ?filter field -> let id = Tactical.ident field in List.iter (fun (fd : wfield) -> fd#update ?enabled ?title ?tooltip ?range ?vmin ?vmax ?filter id ) wfields (* -------------------------------------------------------------------------- *) (* --- Widget Behavior --- *) (* -------------------------------------------------------------------------- *) method private reset_dongle = begin self#set_label tac#title ; descr#set_text tac#descr ; if error then descr#set_fg `NORMAL ; error <- false ; edited <- None ; end method private reset_fields = List.iter (fun fd -> fd#clear) wfields method private compose widget = match edited with | None -> () | Some edited -> self#set_action () ; edited.composer widget method private browse widget = match edited with | None -> () | Some edited -> self#set_action () ; edited.browser widget method private updated () = match edited with | None -> () | Some { process ; composer ; browser ; target ; tree } -> self#select ~process ~composer ~browser ~tree target method clear = begin self#reset_dongle ; self#reset_fields ; self#set_status `FIND ; self#set_action () ; end method targeted = match edited with None -> false | Some _ -> true method private status target = List.iter (fun fd -> fd#select target) wfields ; try Lang.local ~pool:self#pool (tac#select (self :> feedback)) target with Not_found | Exit -> Not_applicable method select ~process ~browser ~composer ~tree (target : selection) = begin self#reset_dongle ; edited <- Some { process ; composer ; browser ; target ; tree } ; let status = self#status target in match status , error with | Not_applicable , _ -> self#set_visible false ; self#set_status `FIND ; self#set_action () ; | Not_configured , _ | Applicable _ , true -> self#set_visible true ; self#set_status `DIALOG_WARNING ; self#set_action () ; | Applicable proc , false -> self#set_visible true ; self#set_status `APPLY ; let callback () = process tac target proc in self#set_action ~callback () ; end end (* -------------------------------------------------------------------------- *) (* --- Strategies --- *) (* -------------------------------------------------------------------------- *) module User = Gtk_helper.Configuration type hform = { search : Strategy.heuristic ; widget : Widget.checkbox ; } let compare f g = String.compare f.search#title g.search#title let spinner ~(form:Wpane.form) ~default ~label ~tooltip = let config = "wp.strategies." ^ label in let value = User.find_int ~default config in let spinner = new Widget.spinner ~min:1 ~value ~tooltip () in spinner#connect (User.set_int config) ; form#add_field ~label spinner#coerce ; spinner type callback = depth:int -> width:int -> Strategy.heuristic list -> unit class strategies () = let form = new Wpane.form () in let depth = spinner ~form ~default:1 ~label:"Depth" ~tooltip:"Limit the number of nested strategies" in let width = spinner ~form ~default:16 ~label:"Width" ~tooltip:"Limit the number of pending goals" in object(self) inherit Wpalette.tool ~content:form#widget ~label:"Strategies" ~tooltip:"Apply Custom Strategies" () val mutable hforms : hform list = [] val mutable demon : callback option = None method register (search : Strategy.heuristic) = begin let widget = new Widget.checkbox ~label:search#title ~tooltip:search#descr () in let config = "wp.strategies." ^ search#id in let default = User.find_bool ~default:true config in widget#set default ; widget#connect (User.set_bool config) ; widget#on_event self#update ; form#add_row widget#coerce ; let hform = { search ; widget } in hforms <- List.merge compare [hform] hforms end method private update () = match demon with | None -> self#set_visible false | Some _ -> self#set_visible true ; if List.exists (fun h -> h.widget#get) hforms then begin self#set_status `APPLY ; self#set_action ~callback:self#callback () ; end else begin self#set_status `INDEX ; self#set_action () end method private callback () = match demon with | Some f -> let hs = List.fold_right (fun h hs -> if h.widget#get then h.search :: hs else hs) hforms [] in f ~depth:depth#get ~width:width#get hs | None -> () method connect f = demon <- f ; self#update () end (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/GuiTactic.mli���������������������������������������������������0000666�0000000�0000000�00000006630�13571573400�016475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Tactical (* -------------------------------------------------------------------------- *) (* --- Selection Composer --- *) (* -------------------------------------------------------------------------- *) class type composer = object method title : string method descr : string method target : selection method ranged : bool method is_valid : selection -> bool method get_value : selection method set_value : selection -> unit end (* -------------------------------------------------------------------------- *) (* --- Search --- *) (* -------------------------------------------------------------------------- *) class type browser = object method title : string method descr : string method target : selection method search : (unit named -> unit) -> int -> bool method choose : string option -> unit end (* -------------------------------------------------------------------------- *) (* --- Tactical Dongle --- *) (* -------------------------------------------------------------------------- *) class tactic : Tactical.t -> (Format.formatter -> Tactical.selection -> unit) -> object inherit Wpalette.tool inherit feedback method clear : unit method targeted : bool method select : process:(tactical -> selection -> process -> unit) -> browser:(browser -> unit) -> composer:(composer -> unit) -> tree:ProofEngine.tree -> selection -> unit end type callback = depth:int -> width:int -> Strategy.heuristic list -> unit class strategies : unit -> object inherit Wpalette.tool method register : Strategy.heuristic -> unit method connect : callback option -> unit end ��������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Lang.ml���������������������������������������������������������0000666�0000000�0000000�00000075277�13571573400�015346� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Logical Language --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype open Ctypes open Qed open Qed.Logic let dkey_pretty = Wp_parameters.register_category "pretty" (* -------------------------------------------------------------------------- *) let basename def name = let rec lookup def s k n = if k < n then let c = s.[k] in if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') then String.sub s k 1 else lookup def s (succ k) n else def in lookup def name 0 (String.length name) (* -------------------------------------------------------------------------- *) (* Naming Prefixes Names starting with a lower-case character belong to logic language or external model(s). 'pointer' Pointer type 'Lit_<hex>' String Literal Values 'Str_<eid>' String Literal Pointers 'S_<s>' Structure <s> 'U_<u>' Union <u> 'F_<c>_<f>' Field <f> in compound <c> 'A_<t>' ACSL Logic type <t> 'C_<c>' ACSL Constructor <c> 'P_<p>' ACSL Predicate <p> (see LogicUsage.get_name) 'L_<f>' ACSL Logic function <f> (see LogicUsage.get_name) 'FixP_<p>' ACSL Recursive Predicate <p> (see LogicUsage.get_name) 'FixL_<f>' ACSL Recursive Logic function <f> (see LogicUsage.get_name) 'Q_<l>' ACSL Lemma or Axiom 'S_<n>' Set comprehension predicate 'Is<phi>' Typing predicate for type <phi> 'Null<phi>' Null value for type <phi> *) let avoid_leading_backlash s = if s.[0]='\\' then let s = Bytes.of_string s in Bytes.set s 0 '_'; Bytes.to_string s else s let comp_id c = let prefix = if c.cstruct then 'S' else 'U' in if c.corig_name = "" then Printf.sprintf "%c%d" prefix c.ckey else Printf.sprintf "%c%d_%s" prefix c.ckey c.corig_name let field_id f = let c = f.fcomp in if c.corig_name = "" then Printf.sprintf "F%d_%s" c.ckey f.fname else Printf.sprintf "F%d_%s_%s" c.ckey c.corig_name f.fname let type_id l = Printf.sprintf "A_%s" l.lt_name let logic_id f = let name = avoid_leading_backlash (LogicUsage.get_name f) in if f.l_type = None then Printf.sprintf "P_%s" name else Printf.sprintf "L_%s" name let ctor_id c = Printf.sprintf "C_%s" (avoid_leading_backlash c.ctor_name) let lemma_id l = Printf.sprintf "Q_%s" (avoid_leading_backlash l) (* -------------------------------------------------------------------------- *) type 'a infoprover = { altergo: 'a; why3 : 'a; coq : 'a; } (* generic way to have different informations for the provers *) let infoprover x = { altergo = x; why3 = x; coq = x; } let map_infoprover f i = { altergo = f i.altergo; why3 = f i.why3; coq = f i.coq; } type library = string type adt = | Mtype of mdt (* Model type *) | Mrecord of mdt * fields (* Model record-type *) | Atype of logic_type_info (* Logic Type *) | Comp of compinfo (* C-code struct or union *) and mdt = string extern (** name to print to the provers *) and 'a extern = { ext_id : int; ext_link : 'a infoprover; ext_library : library; (** a library which it depends on *) ext_debug : string; (** just for printing during debugging *) } and fields = { mutable fields : field list } and field = | Mfield of mdt * fields * string * tau | Cfield of fieldinfo and tau = (field,adt) Logic.datatype let pointer = Context.create "Lang.pointer" let floats = Context.create "Lang.floats" let new_extern_id = ref (-1) let new_extern ~debug ~library ~link = incr new_extern_id; {ext_id = !new_extern_id; ext_library = library; ext_debug = debug; ext_link = link} let ext_compare a b = Datatype.Int.compare a.ext_id b.ext_id (* -------------------------------------------------------------------------- *) (* --- Sorting & Typing --- *) (* -------------------------------------------------------------------------- *) let sort_of_object = function | C_int _ -> Logic.Sint | C_float _ -> Logic.Sreal | C_pointer _ | C_comp _ | C_array _ -> Logic.Sdata let sort_of_ctype t = sort_of_object (Ctypes.object_of t) let sort_of_ltype t = match Logic_utils.unroll_type ~unroll_typedef:false t with | Ctype typ -> sort_of_ctype typ | Ltype _ | Lvar _ | Larrow _ -> Logic.Sdata | Linteger -> Logic.Sint | Lreal -> Logic.Sreal let tau_of_comp c = Logic.Data(Comp c,[]) let t_int = Logic.Int let t_bool = Logic.Bool let t_real = Logic.Real let t_prop = Logic.Prop let t_addr () = Context.get pointer Cil.voidType let t_array a = Logic.Array(Logic.Int,a) let t_farray a b = Logic.Array(a,b) let t_datatype adt ts = Logic.Data(adt,ts) let rec tau_of_object = function | C_int _ -> Logic.Int | C_float f -> Context.get floats f | C_pointer t -> Context.get pointer t | C_comp c -> tau_of_comp c | C_array { arr_element = typ } -> t_array (tau_of_ctype typ) and tau_of_ctype typ = tau_of_object (Ctypes.object_of typ) let poly = Context.create "Wp.Lang.poly" let rec varpoly k x = function | [] -> Warning.error "Unbound type parameter <%s>" x | y::ys -> if x = y then k else varpoly (succ k) x ys let builtins = Hashtbl.create 131 let rec tau_of_ltype t = match Logic_utils.unroll_type ~unroll_typedef:false t with | Linteger -> Logic.Int | Lreal -> Logic.Real | Ctype typ -> tau_of_ctype typ | Lvar x -> Logic.Tvar (varpoly 1 x (Context.get poly)) | Larrow _ -> Warning.error "array type non-supported(%a)" Printer.pp_logic_type t | Ltype _ as b when Logic_const.is_boolean_type b -> Logic.Bool | Ltype(lt,ps) -> let tau = (*TODO: check arity *) try Mtype(Hashtbl.find builtins lt.lt_name) with Not_found -> Atype lt in Logic.Data(tau,List.map tau_of_ltype ps) let tau_of_return l = match l.l_type with | None -> Logic.Prop | Some t -> tau_of_ltype t (* -------------------------------------------------------------------------- *) (* --- Datatypes --- *) (* -------------------------------------------------------------------------- *) module ADT = struct type t = adt let basename = function | Mtype a -> basename "M" a.ext_link.altergo | Mrecord(r,_) -> basename "R" r.ext_link.altergo | Comp c -> basename (if c.cstruct then "S" else "U") c.corig_name | Atype lt -> basename "A" lt.lt_name let debug = function | Mtype a -> a.ext_debug | Mrecord(a,_) -> a.ext_debug | Comp c -> comp_id c | Atype lt -> type_id lt let hash = function | Mtype a | Mrecord(a,_) -> FCHashtbl.hash a | Comp c -> Compinfo.hash c | Atype lt -> Logic_type_info.hash lt let compare a b = if a==b then 0 else match a,b with | Mtype a , Mtype b -> ext_compare a b | Mtype _ , _ -> (-1) | _ , Mtype _ -> 1 | Mrecord(a,_) , Mrecord(b,_) -> ext_compare a b | Mrecord _ , _ -> (-1) | _ , Mrecord _ -> 1 | Comp a , Comp b -> Compinfo.compare a b | Comp _ , _ -> (-1) | _ , Comp _ -> 1 | Atype a , Atype b -> Logic_type_info.compare a b let equal a b = (compare a b = 0) let pretty fmt a = Format.pp_print_string fmt (debug a) end (* -------------------------------------------------------------------------- *) (* --- Datatypes --- *) (* -------------------------------------------------------------------------- *) let atype lt = try Mtype(Hashtbl.find builtins lt.lt_name) with Not_found -> Atype lt let get_builtin_type ~name ~link ~library = try Mtype (Hashtbl.find builtins name) with Not_found -> let m = new_extern ~link ~library ~debug:name in Hashtbl.add builtins name m ; Mtype m let set_builtin_type ~name ~link ~library = let m = new_extern ~link ~library ~debug:name in Hashtbl.add builtins name m let mem_builtin_type ~name = Hashtbl.mem builtins name let is_builtin lt = Hashtbl.mem builtins lt.lt_name let is_builtin_type ~name = function | Data(Mtype m,_) -> begin try m == Hashtbl.find builtins name with Not_found -> false end | _ -> false let datatype ~library name = let m = new_extern ~link:(infoprover name) ~library ~debug:name in Mtype m let record ~link ~library fts = let m = new_extern ~link ~library ~debug:link.altergo in let r = { fields = [] } in let fs = List.map (fun (f,t) -> Mfield(m,r,f,t)) fts in r.fields <- fs ; Mrecord(m,r) let field t f = match t with | Mrecord(_,r) -> begin try List.find (function Mfield(_,_,g,_) -> f = g | _ -> false) r.fields with Not_found -> Wp_parameters.fatal "No field <%s> in record" f end | _ -> Wp_parameters.fatal "No field <%s> in type '%a'" f ADT.pretty t let comp c = Comp c let fields_of_adt = function | Mrecord(_,r) -> r.fields | Comp c -> List.map (fun f -> Cfield f) c.cfields | _ -> [] let fields_of_tau = function | Record fts -> List.map fst fts | Data(adt,_) -> fields_of_adt adt | _ -> [] let fields_of_field = function | Mfield(_,r,_,_) -> r.fields | Cfield f -> List.map (fun f -> Cfield f) f.fcomp.cfields let tau_of_field = function | Mfield(_,_,_,t) -> t | Cfield f -> tau_of_ctype f.ftype let tau_of_record = function | Mfield(mdt,fs,_,_) -> Logic.Data(Mrecord(mdt,fs),[]) | Cfield f -> tau_of_comp f.fcomp module Field = struct type t = field let debug = function | Mfield(_,_,f,_) -> f | Cfield f -> field_id f let hash = function | Mfield(_,_,f,_) -> FCHashtbl.hash f | Cfield f -> Fieldinfo.hash f let compare f g = if f==g then 0 else match f , g with | Mfield(_,_,f,_) , Mfield(_,_,g,_) -> String.compare f g | Mfield _ , Cfield _ -> (-1) | Cfield _ , Mfield _ -> 1 | Cfield f , Cfield g -> Fieldinfo.compare f g let equal f g = (compare f g = 0) let pretty fmt f = Format.pp_print_string fmt (debug f) let sort = function | Mfield(_,_,_,s) -> Qed.Kind.of_tau s | Cfield f -> sort_of_object (Ctypes.object_of f.ftype) end (* -------------------------------------------------------------------------- *) (* --- Functions & Predicates --- *) (* -------------------------------------------------------------------------- *) type lfun = | ACSL of Cil_types.logic_info (** Registered in Definition.t, only *) | CTOR of Cil_types.logic_ctor_info (** Not registered in Definition.t, directly converted/printed *) | Model of model (** Generated or External function *) and model = { m_category : lfun category ; m_params : sort list ; m_result : sort ; m_typeof : tau option list -> tau ; m_source : source ; } and source = | Generated of WpContext.context option * string | Extern of Engine.link extern let tau_of_lfun phi ts = match phi with | ACSL f -> tau_of_return f | CTOR c -> if c.ctor_type.lt_params = [] then Logic.Data(Atype c.ctor_type,[]) else raise Not_found | Model m -> match m.m_result with | Sint -> Int | Sreal -> Real | Sbool -> Bool | _ -> m.m_typeof ts type balance = Nary | Left | Right let not_found _ = raise Not_found let generated ?(context=false) name = let ctxt = if context then Some (WpContext.get_context ()) else None in Generated(ctxt,name) let symbolf ?library ?context ?link ?(balance=Nary) (** specify a default for link *) ?(category=Logic.Function) ?(params=[]) ?(sort=Logic.Sdata) ?(result:tau option) ?(typecheck:(tau option list -> tau) option) name = let buffer = Buffer.create 80 in Format.kfprintf (fun fmt -> Format.pp_print_flush fmt () ; let name = Buffer.contents buffer in let source = match library with | None -> assert (link = None); generated ?context name | Some th -> let conv n = function | Nary -> Engine.F_call n | Left -> Engine.F_left n | Right -> Engine.F_right n in let link = match link with | None -> infoprover (conv name balance) | Some info -> info in Extern (new_extern ~library:th ~link ~debug:name) in let typeof = match typecheck with Some phi -> phi | None -> match result with Some t -> fun _ -> t | None -> not_found in let result = match result with Some t -> Kind.of_tau t | None -> sort in Model { m_category = category ; m_params = params ; m_result = result ; m_typeof = typeof ; m_source = source ; } ) (Format.formatter_of_buffer buffer) name let extern_s ~library ?link ?category ?params ?sort ?result ?typecheck name = symbolf ~library ?category ?params ?sort ?result ?typecheck ?link "%s" name let extern_f ~library ?link ?balance ?category ?params ?sort ?result ?typecheck name = symbolf ~library ?category ?params ?link ?balance ?sort ?result ?typecheck name let extern_p ~library ?bool ?prop ?link ?(params=[]) () = let link = match bool,prop,link with | Some b , Some p , None -> infoprover (Engine.F_bool_prop(b,p)) | _ , _ , Some info -> info | _ , _ , _ -> assert false in let debug = Export.debug link.altergo in Model { m_category = Logic.Function; m_params = params ; m_result = Logic.Sprop; m_typeof = not_found; m_source = Extern (new_extern ~library ~link ~debug) } let extern_fp ~library ?(params=[]) ?link phi = let link = match link with | None -> infoprover (Engine.F_call phi) | Some link -> map_infoprover (fun phi -> Engine.F_call(phi)) link in Model { m_category = Logic.Function ; m_params = params ; m_result = Logic.Sprop; m_typeof = not_found; m_source = Extern (new_extern ~library ~link ~debug:phi) } let generated_f ?context ?category ?params ?sort ?result name = symbolf ?context ?category ?params ?sort ?result name let generated_p ?context name = Model { m_category = Logic.Function ; m_params = [] ; m_result = Logic.Sprop; m_typeof = not_found; m_source = generated ?context name } module Fun = struct type t = lfun let debug = function | ACSL f -> logic_id f | CTOR c -> ctor_id c | Model({m_source=Generated(_,n)}) -> n | Model({m_source=Extern e}) -> e.ext_debug let hash = function | ACSL f -> Logic_info.hash f | CTOR c -> Logic_ctor_info.hash c | Model({m_source=Generated(_,n)}) -> Datatype.String.hash n | Model({m_source=Extern e}) -> e.ext_id let compare_context c1 c2 = match c1 , c2 with | None , None -> 0 | None , _ -> (-1) | _ , None -> 1 | Some c1 , Some c2 -> WpContext.S.compare c1 c2 let compare_source s1 s2 = match s1 , s2 with | Generated(m1,f1), Generated(m2,f2) -> let cmp = String.compare f1 f2 in if cmp<>0 then cmp else compare_context m1 m2 | Extern f , Extern g -> ext_compare f g | Generated _ , Extern _ -> (-1) | Extern _ , Generated _ -> 1 let compare f g = if f==g then 0 else match f , g with | Model {m_source=mf} , Model {m_source=mg} -> compare_source mf mg | Model _ , _ -> (-1) | _ , Model _ -> 1 | ACSL f , ACSL g -> Logic_info.compare f g | ACSL _ , _ -> (-1) | _ , ACSL _ -> 1 | CTOR c , CTOR d -> Logic_ctor_info.compare c d let equal f g = (compare f g = 0) let pretty fmt f = Format.pp_print_string fmt (debug f) let category = function | Model m -> m.m_category | ACSL _ -> Logic.Function | CTOR _ -> Logic.Constructor let sort = function | Model m -> m.m_result | ACSL { l_type=None } -> Logic.Sprop | ACSL { l_type=Some t } -> sort_of_ltype t | CTOR _ -> Logic.Sdata let parameters = ref (fun _ -> []) let params = function | Model m -> m.m_params | CTOR ct -> List.map sort_of_ltype ct.ctor_params | (ACSL _) as f -> !parameters f end let parameters phi = Fun.parameters := phi class virtual idprinting = object(self) method virtual infoprover: 'a. 'a infoprover -> 'a method virtual sanitize : string -> string method sanitize_type = self#sanitize method sanitize_field = self#sanitize method sanitize_fun = self#sanitize method datatype = function | Mtype a -> self#infoprover a.ext_link | Mrecord(a,_) -> self#infoprover a.ext_link | Comp c -> self#sanitize_type (comp_id c) | Atype lt -> self#sanitize_type (type_id lt) method field = function | Mfield(_,_,f,_) -> self#sanitize_field f | Cfield f -> self#sanitize_field (field_id f) method link = function | ACSL f -> Engine.F_call (self#sanitize_fun (logic_id f)) | CTOR c -> Engine.F_call (self#sanitize_fun (ctor_id c)) | Model({m_source=Generated(_,n)}) -> Engine.F_call (self#sanitize_fun n) | Model({m_source=Extern e}) -> self#infoprover e.ext_link end let name_of_lfun = function | ACSL f -> logic_id f | CTOR c -> ctor_id c | Model({m_source=Generated(_,f)}) -> f | Model({m_source=Extern e}) -> e.ext_debug let name_of_field = function | Mfield(_,_,f,_) -> f | Cfield f -> field_id f (* -------------------------------------------------------------------------- *) (* --- Terms --- *) (* -------------------------------------------------------------------------- *) module F = struct module QZERO = Qed.Term.Make(ADT)(Field)(Fun) (* -------------------------------------------------------------------------- *) (* --- Qed Projectified State --- *) (* -------------------------------------------------------------------------- *) module DATA = Datatype.Make (struct type t = QZERO.state let name = "Wp.Qed" let rehash = Datatype.identity let structural_descr = Structural_descr.t_unknown let reprs = [QZERO.get_state ()] let equal = Datatype.undefined let compare = Datatype.undefined let hash = Datatype.undefined let copy _old = QZERO.create () let varname = Datatype.undefined let pretty = Datatype.undefined let internal_pretty_code = Datatype.undefined let mem_project _ _ = false end) module STATE = State_builder.Register(DATA) (struct type t = QZERO.state let create = QZERO.create let clear = QZERO.clr_state let get = QZERO.get_state let set = QZERO.set_state let clear_some_projects _ _ = false end) (struct let name = "Wp.Qed" let dependencies = [Ast.self] let unique_name = name end) include (STATE : sig end) (* For OCaml-4.0 *) (* -------------------------------------------------------------------------- *) (* --- Term API --- *) (* -------------------------------------------------------------------------- *) module Pretty = Qed.Pretty.Make(QZERO) module QED = struct include QZERO let typeof ?(field=tau_of_field) ?(record=tau_of_record) ?(call=tau_of_lfun) e = QZERO.typeof ~field ~record ~call e end include QED (* -------------------------------------------------------------------------- *) (* --- Term Extensions --- *) (* -------------------------------------------------------------------------- *) type unop = term -> term type binop = term -> term -> term let e_zero = QED.constant (e_zint Z.zero) let e_one = QED.constant (e_zint Z.one) let e_minus_one = QED.constant (e_zint Z.minus_one) let e_minus_one_real = QED.constant (e_real Q.minus_one) let e_one_real = QED.constant (e_real Q.one) let e_zero_real = QED.constant (e_real Q.zero) let e_int64 z = e_zint (Z.of_string (Int64.to_string z)) let e_fact k e = e_times (Z.of_int k) e let e_bigint z = e_zint (Z.of_string (Integer.to_string z)) let e_range a b = e_sum [b;e_one;e_opp a] let e_setfield r f v = (*TODO:NUPW: check for UNIONS *) let r = List.map (fun g -> g,if Field.equal f g then v else e_getfield r g) (fields_of_field f) in e_record r (* -------------------------------------------------------------------------- *) (* --- Predicates --- *) (* -------------------------------------------------------------------------- *) type pred = term type cmp = term -> term -> pred type operator = pred -> pred -> pred let p_bool t = t let e_prop t = t let p_bools xs = xs let e_props xs = xs let lift f x = f x let is_zero e = match QED.repr e with | Kint z -> Integer.equal z Integer.zero | _ -> false let eqp = equal let comparep = compare let is_ptrue = is_true let is_pfalse = is_false let is_equal a b = is_true (e_eq a b) let p_equal = e_eq let p_equals = List.map (fun (x,y) -> p_equal x y) let p_neq = e_neq let p_leq = e_leq let p_lt = e_lt let p_positive e = e_leq e_zero e let p_true = e_true let p_false = e_false let p_not = e_not let p_bind = e_bind let p_forall = e_forall let p_exists = e_exists let p_subst = e_subst let p_subst_var = e_subst_var let p_and p q = e_and [p;q] let p_or p q = e_or [p;q] let p_imply h p = e_imply [h] p let p_hyps hs p = e_imply hs p let p_equiv = e_equiv let p_if = e_if let p_conj = e_and let p_disj = e_or let p_all f xs = e_and (List.map f xs) let p_any f xs = e_or (List.map f xs) let e_vars e = List.sort Var.compare (Vars.elements (vars e)) let p_vars = e_vars let p_call = e_fun ~result:Prop let p_close p = p_forall (p_vars p) p let occurs x t = Vars.mem x (vars t) let intersect a b = Vars.intersect (vars a) (vars b) let occursp = occurs let intersectp = intersect let varsp = vars let p_expr = repr let e_expr = repr let pp_tau = Pretty.pp_tau let context_pp = Context.create "Lang.F.pp" let pp_term fmt e = if Wp_parameters.has_dkey dkey_pretty then QED.debug fmt e else match Context.get_opt context_pp with | Some env -> Pretty.pp_term_env env fmt e | None -> let env = Pretty.known Pretty.empty (QED.vars e) in Pretty.pp_term env fmt e let pp_pred = pp_term let pp_var fmt x = pp_term fmt (e_var x) let pp_vars fmt xs = begin Format.fprintf fmt "@[<hov 2>{" ; Vars.iter (fun x -> Format.fprintf fmt "@ %a" pp_var x) xs ; Format.fprintf fmt " }@]" ; end let debugp = QED.debug type env = Pretty.env let env xs = Pretty.known Pretty.empty xs let marker = Pretty.marks let mark_e = QED.mark let mark_p = QED.mark let define f env m = List.fold_left (fun env t -> let x,env_x = Pretty.fresh env t in f env x t ; env_x) env (QED.defs m) let pp_eterm = Pretty.pp_term let pp_epred = Pretty.pp_term module Pmap = Tmap module Pset = Tset let set_builtin_1 f r = set_builtin f (function [e] -> r e | _ -> raise Not_found) let set_builtin_2 f r = set_builtin f (function [a;b] -> r a b | _ -> raise Not_found) let set_builtin_2' f r = set_builtin' f (function [a;b] -> r a b | _ -> raise Not_found) let set_builtin_eqp = set_builtin_eq end open F module N = struct let ( + ) = e_add let ( ~- ) x = e_sub e_zero x let ( - ) = e_sub let ( * ) = e_mul let ( / ) = e_div let ( mod ) = e_mod let ( = ) = p_equal let ( < ) = p_lt let ( > ) x y = p_lt y x let ( <= ) = p_leq let ( >= ) x y = p_leq y x let ( <> ) = p_neq let ( && ) = p_and let ( || ) = p_or let not = p_not let ( $ ) = e_fun let ( $$ ) = p_call end (* -------------------------------------------------------------------------- *) (* --- Fresh Variables & Local Assumptions --- *) (* -------------------------------------------------------------------------- *) type gamma = { mutable hyps : pred list ; mutable vars : var list ; } (* -------------------------------------------------------------------------- *) let cpool = Context.create "Lang.pool" let cgamma = Context.create "Lang.gamma" let add_vars pool = function | None -> () | Some xs -> F.add_vars pool xs let new_pool ?copy ?(vars = Vars.empty) () = let pool = F.pool ?copy () in F.add_vars pool vars ; pool let new_gamma ?copy () = match copy with | None -> { hyps=[] ; vars=[] } | Some g -> { hyps = g.hyps ; vars = g.vars } let get_pool () = Context.get cpool let get_gamma () = Context.get cgamma let has_gamma () = Context.defined cgamma let freshvar ?basename tau = F.fresh (Context.get cpool) ?basename tau let freshen x = F.alpha (Context.get cpool) x let local ?pool ?vars ?gamma f = let pool = match pool with None -> F.pool () | Some p -> p in add_vars pool vars ; let gamma = match gamma with None -> { hyps=[] ; vars=[] } | Some g -> g in Context.bind cpool pool (Context.bind cgamma gamma f) let sigma () = F.sigma ~pool:(Context.get cpool) () let alpha () = let sigma = sigma () in let alpha = ref Tmap.empty in let lookup e x = try Tmap.find e !alpha with Not_found -> let y = F.Subst.fresh sigma (F.tau_of_var x) in let ey = e_var y in alpha := Tmap.add e ey !alpha; ey in let compute e = match F.repr e with | Fvar x -> lookup e x | _ -> raise Not_found in F.Subst.add_fun sigma compute ; sigma let subst xs vs = let bind w x v = Tmap.add (e_var x) v w in let vmap = try List.fold_left2 bind Tmap.empty xs vs with _ -> raise (Invalid_argument "Wp.Lang.Subst.sigma") in let sigma = sigma () in F.Subst.add_map sigma vmap ; sigma let e_subst f = let sigma = sigma () in F.Subst.add_fun sigma f ; F.e_subst sigma let p_subst f = let sigma = sigma () in F.Subst.add_fun sigma f ; F.p_subst sigma (* -------------------------------------------------------------------------- *) (* --- Hypotheses --- *) (* -------------------------------------------------------------------------- *) let masked = ref false let without_assume job x = if !masked then job x else try masked := true ; let y = job x in masked := false ; y with err -> masked := false ; raise err let assume p = if p != p_true && not !masked then let d = Context.get cgamma in d.hyps <- p :: d.hyps let epsilon ?basename t phi = let d = Context.get cgamma in let x = freshvar ?basename t in let e = e_var x in d.hyps <- phi e :: d.hyps ; d.vars <- x :: d.vars ; e let hypotheses g = g.hyps let variables g = List.rev g.vars let get_hypotheses () = (Context.get cgamma).hyps let get_variables () = (Context.get cgamma).vars (** For why3_api but circular dependency *) module For_export = struct type specific_equality = { for_tau:(tau -> bool); mk_new_eq:F.binop; } (** delay the create at most as possible (due to constants handling in qed) *) let state = ref None let init = ref (fun () -> ()) let add_init f = let old = !init in init := (fun () -> old (); f ()) let get_state () = match !state with | None -> let st = QZERO.create () in QZERO.in_state st !init (); state := Some st; st | Some st -> st let rebuild ?cache t = QZERO.rebuild_in_state (get_state ()) ?cache t let set_builtin f c = add_init (fun () -> QZERO.set_builtin f c) let set_builtin' f c = add_init (fun () -> QZERO.set_builtin' f c) let set_builtin_eq f c = add_init (fun () -> QZERO.set_builtin_eq f c) let set_builtin_leq f c = add_init (fun () -> QZERO.set_builtin_leq f c) let in_state f v = QZERO.in_state (get_state ()) f v end (* -------------------------------------------------------------------------- *) (* --- Simplifier --- *) (* -------------------------------------------------------------------------- *) exception Contradiction class type simplifier = object method name : string method copy : simplifier method assume : F.pred -> unit method target : F.pred -> unit method fixpoint : unit method infer : F.pred list method simplify_exp : F.term -> F.term method simplify_hyp : F.pred -> F.pred method simplify_branch : F.pred -> F.pred method simplify_goal : F.pred -> F.pred end let is_atomic_pred = function | Neq _ | Eq _ | Leq _ | Lt _ | Fun _ -> true | _ -> false let is_literal p = match repr p with | Not p -> is_atomic_pred (repr p) | _ -> is_atomic_pred (repr p) let iter_consequence_literals f_literal p = let f_literal = (fun p -> if QED.lc_closed p then f_literal p else ()) in let rec aux_pos p = match repr p with | And ps -> List.iter aux_pos ps | Not p -> aux_neg p | Bind((Forall|Exists),_,a) -> aux_pos (QED.lc_repr a) | rep when is_atomic_pred rep -> f_literal p | _ -> () and aux_neg p = match repr p with | Imply (hs,p) -> List.iter aux_pos hs ; aux_neg p | Or ps -> List.iter aux_neg ps | Not p -> aux_pos p | Bind((Forall|Exists),_,a) -> aux_neg (QED.lc_repr a) | rep when is_atomic_pred rep -> f_literal (e_not p) | _ -> () in aux_pos p (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Lang.mli��������������������������������������������������������0000666�0000000�0000000�00000047613�13571573400�015510� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Ctypes open Qed open Qed.Logic (** Logic Language based on Qed *) (** {2 Library} *) type library = string (** Name for external prover. In case a Qed.Engine.link is used, [F_subst] patterns are not supported for Why-3. *) type 'a infoprover = { altergo: 'a; why3 : 'a; coq : 'a; } (** generic way to have different informations for the provers *) val infoprover: 'a -> 'a infoprover (** same information for all the provers *) (** {2 Naming} Unique identifiers. *) val comp_id : compinfo -> string val field_id : fieldinfo -> string val type_id : logic_type_info -> string val logic_id : logic_info -> string val ctor_id : logic_ctor_info -> string val lemma_id : string -> string (** {2 Symbols} *) type adt = private (** A type is never registered in a Definition.t *) | Mtype of mdt (** External type *) | Mrecord of mdt * fields (** External record-type *) | Atype of logic_type_info (** Logic Type *) | Comp of compinfo (** C-code struct or union *) and mdt = string extern (** name to print to the provers *) and 'a extern = { ext_id : int; ext_link : 'a infoprover; ext_library : library; (** a library which it depends on *) ext_debug : string; (** just for printing during debugging *) } and fields = { mutable fields : field list } and field = | Mfield of mdt * fields * string * tau | Cfield of fieldinfo and tau = (field,adt) Logic.datatype type lfun = | ACSL of Cil_types.logic_info (** Registered in Definition.t, only *) | CTOR of Cil_types.logic_ctor_info (** Not registered in Definition.t directly converted/printed *) | Model of model (** *) and model = { m_category : lfun category ; m_params : sort list ; m_result : sort ; m_typeof : tau option list -> tau ; m_source : source ; } and source = | Generated of WpContext.context option * string | Extern of Engine.link extern val mem_builtin_type : name:string -> bool val set_builtin_type : name:string -> link:string infoprover -> library:string -> unit val get_builtin_type : name:string -> link:string infoprover -> library:string -> adt val is_builtin : logic_type_info -> bool val is_builtin_type : name:string -> tau -> bool val datatype : library:string -> string -> adt val record : link:string infoprover -> library:string -> (string * tau) list -> adt val atype : logic_type_info -> adt val comp : compinfo -> adt val field : adt -> string -> field val fields_of_adt : adt -> field list val fields_of_tau : tau -> field list val fields_of_field : field -> field list type balance = Nary | Left | Right val extern_s : library:library -> ?link:(Engine.link infoprover) -> ?category:lfun category -> ?params:sort list -> ?sort:sort -> ?result:tau -> ?typecheck:(tau option list -> tau) -> string -> lfun val extern_f : library:library -> ?link:(Engine.link infoprover) -> ?balance:balance -> ?category:lfun category -> ?params:sort list -> ?sort:sort -> ?result:tau -> ?typecheck:(tau option list -> tau) -> ('a,Format.formatter,unit,lfun) format4 -> 'a (** balance just give a default when link is not specified *) val extern_p : library:library -> ?bool:string -> ?prop:string -> ?link:Engine.link infoprover -> ?params:sort list -> unit -> lfun val extern_fp : library:library -> ?params:sort list -> ?link:string infoprover -> string -> lfun val generated_f : ?context:bool -> ?category:lfun category -> ?params:sort list -> ?sort:sort -> ?result:tau -> ('a,Format.formatter,unit,lfun) format4 -> 'a val generated_p : ?context:bool -> string -> lfun (** {2 Sorting and Typing} *) val tau_of_comp : compinfo -> tau val tau_of_object : c_object -> tau val tau_of_ctype : typ -> tau val tau_of_ltype : logic_type -> tau val tau_of_return : logic_info -> tau val tau_of_lfun : lfun -> tau option list -> tau val tau_of_field : field -> tau val tau_of_record : field -> tau val t_int : tau val t_real : tau val t_bool : tau val t_prop : tau val t_addr : unit -> tau (** pointer on Void *) val t_array : tau -> tau val t_farray : tau -> tau -> tau val t_datatype : adt -> tau list -> tau val pointer : (typ -> tau) Context.value (** type of pointers *) val floats : (c_float -> tau) Context.value (** type of floats *) val poly : string list Context.value (** polymorphism *) val parameters : (lfun -> sort list) -> unit (** definitions *) val name_of_lfun : lfun -> string val name_of_field : field -> string (** {2 Logic Formulae} *) module ADT : Logic.Data with type t = adt module Field : Logic.Field with type t = field module Fun : Logic.Function with type t = lfun class virtual idprinting : object method virtual sanitize : string -> string method virtual infoprover : 'a. 'a infoprover -> 'a (** Specify the field to use in an infoprover *) method sanitize_type : string -> string (** Defaults to [self#sanitize] *) method sanitize_field : string -> string (** Defulats to [self#sanitize] *) method sanitize_fun : string -> string (** Defulats to [self#sanitize] *) method datatype : ADT.t -> string method field : Field.t -> string method link : Fun.t -> Engine.link end module F : sig module QED : Logic.Term with module ADT = ADT and module Field = Field and module Fun = Fun (** {3 Types and Variables} *) type var = QED.var type tau = QED.tau type pool = QED.pool module Tau = QED.Tau module Var = QED.Var module Vars : Qed.Idxset.S with type elt = var module Vmap : Qed.Idxmap.S with type key = var val pool : ?copy:pool -> unit -> pool val fresh : pool -> ?basename:string -> tau -> var val alpha : pool -> var -> var val add_var : pool -> var -> unit val add_vars : pool -> Vars.t -> unit val tau_of_var : var -> tau (** {3 Expressions} *) type term = QED.term type record = (field * term) list val hash : term -> int (** Constant time *) val equal : term -> term -> bool (** Same as [==] *) val compare : term -> term -> int module Tset : Qed.Idxset.S with type elt = term module Tmap : Qed.Idxmap.S with type key = term type unop = term -> term type binop = term -> term -> term val e_zero : term val e_one : term val e_minus_one : term val e_minus_one_real : term val e_one_real : term val e_zero_real : term val constant : term -> term val e_fact : int -> term -> term val e_int64 : int64 -> term val e_bigint : Integer.t -> term val e_float : float -> term val e_setfield : term -> field -> term -> term val e_range : term -> term -> term (** e_range a b = b+1-a *) val is_zero : term -> bool val e_true : term val e_false : term val e_bool : bool -> term val e_literal : bool -> term -> term val e_int : int -> term val e_zint : Z.t -> term val e_real : Q.t -> term val e_var : var -> term val e_opp : term -> term val e_times : Z.t -> term -> term val e_sum : term list -> term val e_prod : term list -> term val e_add : term -> term -> term val e_sub : term -> term -> term val e_mul : term -> term -> term val e_div : term -> term -> term val e_mod : term -> term -> term val e_eq : term -> term -> term val e_neq : term -> term -> term val e_leq : term -> term -> term val e_lt : term -> term -> term val e_imply : term list -> term -> term val e_equiv : term -> term -> term val e_and : term list -> term val e_or : term list -> term val e_not : term -> term val e_if : term -> term -> term -> term val e_const : tau -> term -> term val e_get : term -> term -> term val e_set : term -> term -> term -> term val e_getfield : term -> Field.t -> term val e_record : record -> term val e_fun : ?result:tau -> Fun.t -> term list -> term val e_bind : binder -> var -> term -> term val e_open : pool:pool -> ?forall:bool -> ?exists:bool -> ?lambda:bool -> term -> (binder * var) list * term (** Open all the specified binders (flags default to `true`, so all consecutive top most binders are opened by default). The pool must contain all free variables of the term. *) val e_close : (binder * var) list -> term -> term (** Closes all specified binders *) (** {3 Predicates} *) type pred type cmp = term -> term -> pred type operator = pred -> pred -> pred module Pmap : Qed.Idxmap.S with type key = pred module Pset : Qed.Idxset.S with type elt = pred val p_true : pred val p_false : pred val p_equal : term -> term -> pred val p_equals : (term * term) list -> pred list val p_neq : term -> term -> pred val p_leq : term -> term -> pred val p_lt : term -> term -> pred val p_positive : term -> pred val is_ptrue : pred -> Logic.maybe val is_pfalse : pred -> Logic.maybe val is_equal : term -> term -> Logic.maybe val eqp : pred -> pred -> bool val comparep : pred -> pred -> int val p_bool : term -> pred val e_prop : pred -> term val p_bools : term list -> pred list val e_props : pred list -> term list val lift : (term -> term) -> pred -> pred val p_not : pred -> pred val p_and : pred -> pred -> pred val p_or : pred -> pred -> pred val p_imply : pred -> pred -> pred val p_equiv : pred -> pred -> pred val p_hyps : pred list -> pred -> pred val p_if : pred -> pred -> pred -> pred val p_conj : pred list -> pred val p_disj : pred list -> pred val p_any : ('a -> pred) -> 'a list -> pred val p_all : ('a -> pred) -> 'a list -> pred val p_call : lfun -> term list -> pred val p_forall : var list -> pred -> pred val p_exists : var list -> pred -> pred val p_bind : binder -> var -> pred -> pred type sigma module Subst : sig val get : sigma -> term -> term val add : sigma -> term -> term -> unit val add_map : sigma -> term Tmap.t -> unit val add_fun : sigma -> (term -> term) -> unit val add_filter : sigma -> (term -> bool) -> unit end val e_subst : sigma -> term -> term val p_subst : sigma -> pred -> pred val p_subst_var : var -> term -> pred -> pred val e_vars : term -> var list (** Sorted *) val p_vars : pred -> var list (** Sorted *) val p_close : pred -> pred (** Quantify over (sorted) free variables *) val pp_tau : Format.formatter -> tau -> unit val pp_var : Format.formatter -> var -> unit val pp_vars : Format.formatter -> Vars.t -> unit val pp_term : Format.formatter -> term -> unit val pp_pred : Format.formatter -> pred -> unit val debugp : Format.formatter -> pred -> unit type env val context_pp : env Context.value (** Context used by pp_term, pp_pred, pp_var, ppvars for printing the term. Allows to keep the same disambiguation. *) type marks = QED.marks val env : Vars.t -> env val marker : env -> marks val mark_e : marks -> term -> unit val mark_p : marks -> pred -> unit (** Returns a list of terms to be shared among all {i shared} or {i marked} subterms. The order of terms is consistent with definition order: head terms might be used in tail ones. *) val defs : marks -> term list val define : (env -> string -> term -> unit) -> env -> marks -> env val pp_eterm : env -> Format.formatter -> term -> unit val pp_epred : env -> Format.formatter -> pred -> unit val p_expr : pred -> pred QED.expression val e_expr : pred -> term QED.expression (* val p_iter : (pred -> unit) -> (term -> unit) -> pred -> unit *) (** {3 Binders} *) val lc_closed : term -> bool val lc_iter : (term -> unit) -> term -> unit (* TODO: to remove *) (** {3 Utilities} *) val decide : term -> bool (** Return [true] if and only the term is [e_true]. Constant time. *) val basename : term -> string val is_true : term -> maybe (** Constant time. *) val is_false : term -> maybe (** Constant time. *) val is_prop : term -> bool (** Boolean or Property *) val is_int : term -> bool (** Integer sort *) val is_real : term -> bool (** Real sort *) val is_arith : term -> bool (** Integer or Real sort *) val is_closed : term -> bool (** No bound variables *) val is_simple : term -> bool (** Constants, variables, functions of arity 0 *) val is_atomic : term -> bool (** Constants and variables *) val is_primitive : term -> bool (** Constants only *) val is_neutral : Fun.t -> term -> bool val is_absorbant : Fun.t -> term -> bool val record_with : record -> (term * record) option val are_equal : term -> term -> maybe (** Computes equality *) val eval_eq : term -> term -> bool (** Same as [are_equal] is [Yes] *) val eval_neq : term -> term -> bool (** Same as [are_equal] is [No] *) val eval_lt : term -> term -> bool (** Same as [e_lt] is [e_true] *) val eval_leq : term -> term -> bool (** Same as [e_leq] is [e_true] *) val repr : term -> QED.repr (** Constant time *) val sort : term -> Logic.sort (** Constant time *) val vars : term -> Vars.t (** Constant time *) val varsp : pred -> Vars.t (** Constant time *) val occurs : var -> term -> bool val occursp : var -> pred -> bool val intersect : term -> term -> bool val intersectp : pred -> pred -> bool val is_subterm : term -> term -> bool (** Try to extract a type of term. Parameterized by optional extractors for field and functions. Extractors may raise [Not_found] ; however, they are only used when the provided kinds for fields and functions are not precise enough. @param field type of a field value @param record type of the record containing a field @param call type of the values returned by the function @raise Not_found if no type is found. *) val typeof : ?field:(Field.t -> tau) -> ?record:(Field.t -> tau) -> ?call:(Fun.t -> tau option list -> tau) -> term -> tau (** {3 Builtins} The functions below register simplifiers for function [f]. The computation code may raise [Not_found], in which case the symbol is not interpreted. If [f] is an operator with algebraic rules (see type [operator]), the children are normalized {i before} builtin call. Highest priority is [0]. Recursive calls must be performed on strictly smaller terms. *) val set_builtin : lfun -> (term list -> term) -> unit val set_builtin_get : lfun -> (term list -> tau option -> term-> term) -> unit val set_builtin_1 : lfun -> unop -> unit val set_builtin_2 : lfun -> binop -> unit val set_builtin_2' : lfun -> (term -> term -> tau option -> term) -> unit val set_builtin_eq : lfun -> binop -> unit val set_builtin_leq : lfun -> binop -> unit val set_builtin_eqp : lfun -> cmp -> unit val release : unit -> unit (** Empty local caches *) end module N: sig (** simpler notation for writing {!F.term} and {F.pred} *) val ( + ): F.binop (** {! F.p_add } *) val ( - ): F.binop (** {! F.p_sub } *) val ( ~- ): F.unop (** [fun x -> p_sub 0 x] *) val ( * ): F.binop (** {! F.p_mul} *) val ( / ): F.binop (** {! F.p_div} *) val ( mod ): F.binop (** {! F.p_mod} *) val ( = ): F.cmp (** {! F.p_equal} *) val ( < ): F.cmp (** {! F.p_lt} *) val ( > ): F.cmp (** {! F.p_lt} with inversed argument *) val ( <= ): F.cmp (** {! F.p_leq } *) val ( >= ): F.cmp (** {! F.p_leq } with inversed argument *) val ( <> ): F.cmp (** {! F.p_neq } *) val ( && ): F.operator (** {! F.p_and } *) val ( || ): F.operator (** {! F.p_or } *) val not: F.pred -> F.pred (** {! F.p_not } *) val ( $ ): ?result:tau -> lfun -> F.term list -> F.term (** {! F.e_fun } *) val ( $$ ): lfun -> F.term list -> F.pred (** {! F.p_call } *) end (** {2 Fresh Variables and Constraints} *) open F type gamma val new_pool : ?copy:F.pool -> ?vars:Vars.t -> unit -> pool val new_gamma : ?copy:gamma -> unit -> gamma val local : ?pool:pool -> ?vars:Vars.t -> ?gamma:gamma -> ('a -> 'b) -> 'a -> 'b val freshvar : ?basename:string -> tau -> var val freshen : var -> var val assume : pred -> unit val without_assume : ('a -> 'b) -> 'a -> 'b val epsilon : ?basename:string -> tau -> (term -> pred) -> term val hypotheses : gamma -> pred list val variables : gamma -> var list val get_pool : unit -> pool val get_gamma : unit -> gamma val has_gamma : unit -> bool val get_hypotheses : unit -> pred list val get_variables : unit -> var list (** {2 Substitutions} *) val sigma : unit -> F.sigma (** uses current pool *) val alpha : unit -> F.sigma (** freshen all variables *) val subst : F.var list -> F.term list -> F.sigma (** replace variables *) val e_subst : (term -> term) -> term -> term (** uses current pool *) val p_subst : (term -> term) -> pred -> pred (** uses current pool *) (** {2 Simplifiers} *) exception Contradiction val is_literal: F.term -> bool val iter_consequence_literals: (F.term -> unit) -> F.term -> unit (** [iter_consequence_literals assume_from_litteral hypothesis] applies the function [assume_from_litteral] on literals that are a consequence of the [hypothesis] (i.e. in the hypothesis [not (A && (B || C) ==> D)], only [A] and [not D] are considered as consequence literals). *) class type simplifier = object method name : string method copy : simplifier method assume : F.pred -> unit (** Assumes the hypothesis *) method target : F.pred -> unit (** Give the predicate that will be simplified later *) method fixpoint : unit (** Called after assuming hypothesis and knowing the goal *) method infer : F.pred list (** Add new hypotheses implied by the original hypothesis. *) method simplify_exp : F.term -> F.term (** Currently simplify an expression. *) method simplify_hyp : F.pred -> F.pred (** Currently simplify an hypothesis before assuming it. In any case must return a weaker formula. *) method simplify_branch : F.pred -> F.pred (** Currently simplify a branch condition. In any case must return an equivalent formula. *) method simplify_goal : F.pred -> F.pred (** Simplify the goal. In any case must return a stronger formula. *) end (* -------------------------------------------------------------------------- *) (** For why3_api but circular dependency *) module For_export : sig type specific_equality = { for_tau:(tau -> bool); mk_new_eq:F.binop; } val rebuild : ?cache:term Tmap.t -> term -> term * term Tmap.t val set_builtin : Fun.t -> (term list -> term) -> unit val set_builtin' : Fun.t -> (term list -> tau option -> term) -> unit val set_builtin_eq : Fun.t -> (term -> term -> term) -> unit val set_builtin_leq : Fun.t -> (term -> term -> term) -> unit val in_state: ('a -> 'b) -> 'a -> 'b end ���������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Layout.ml�������������������������������������������������������0000666�0000000�0000000�00000053061�13571573400�015725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Pretty_utils open Cil_datatype open Cil_types module Wp = Wp_parameters module type Data = sig type t val equal : t -> t -> bool val compare : t -> t -> int val pretty : t formatter end (* -------------------------------------------------------------------------- *) (* --- Offsets --- *) (* -------------------------------------------------------------------------- *) type offset = | Field of fieldinfo | Index of typ * int module Offset = struct type t = offset let compare a b = if a == b then 0 else match a,b with | Field f, Field g -> Fieldinfo.compare f g | Field _ , _ -> (-1) | _ , Field _ -> 1 | Index(ta,n) , Index(tb,m) -> let cmp = Typ.compare ta tb in if cmp <> 0 then cmp else Pervasives.compare n m let equal a b = (compare a b = 0) let pretty fmt = function | Field fd -> Format.fprintf fmt "{%s}.%a" fd.fcomp.cname Fieldinfo.pretty fd | Index(ty,n) -> Format.fprintf fmt "{%a}[%d]" Typ.pretty ty n let typeof = function | Field f -> f.ftype | Index(ty,_) -> ty let field fd = Field fd let index ty = match Cil.unrollType ty with | TArray(te,n,_,_) -> begin match Extlib.opt_bind Ctypes.get_int n with | None -> failwith "Wp.Layout: unkown array size" | Some n -> Index(te,n) end | _ -> failwith "Wp.Layout: not an array-type" let rec typeof_chain ty = function [] -> ty | _::ds -> typeof_chain ty ds let rec pp_chain ty fmt = function | [] -> () | d::ds -> let next = Format.pp_print_cut fmt () ; match d with | Index(t,n) when Typ.equal t ty -> Format.fprintf fmt "[%d]" n ; t | d -> Format.fprintf fmt "%a" pretty d ; typeof d in pp_chain next fmt ds module H = Compinfo.Hashtbl type cache = typ H.t let cache () : cache = H.create 0 let typ_of_comp cache comp = try H.find cache comp with Not_found -> let typ = TComp(comp,Cil.empty_size_cache (),[]) in H.add cache comp typ ; typ let field_offset cache fd = let typ = typ_of_comp cache fd.fcomp in let offset = Cil_types.(Field(fd,NoOffset)) in Cil.bitsOffset typ offset let range_field cache fd = let typ = typ_of_comp cache fd.fcomp in let offset = Cil_types.(Field(fd,NoOffset)) in Cil.bitsOffset typ offset , Cil.bitsSizeOf typ let range_index typ n = let len = Cil.bitsSizeOf typ * n in (0 , len) , len let range cache = function | Field fd -> range_field cache fd | Index(typ,n) -> range_index typ n let sizeof = function | Field fd -> Cil.bitsSizeOf fd.ftype | Index(ty,n) -> Cil.bitsSizeOf ty * n let container cache = function | Index(ty,n) -> Cil.bitsSizeOf ty * n | Field fd -> Cil.bitsSizeOf (typ_of_comp cache fd.fcomp) end (* -------------------------------------------------------------------------- *) (* --- Deref --- *) (* -------------------------------------------------------------------------- *) type alias = NotUsed | NotAliased | Aliased type usage = Value | Deref | Array type deref = usage * typ module Alias = struct let use = function NotUsed | NotAliased -> NotAliased | Aliased -> Aliased let is_aliased = function NotUsed | NotAliased -> false | Aliased -> true let merge a b = match a,b with | Aliased,_ | _,Aliased -> Aliased | NotAliased,NotAliased -> NotAliased | NotUsed,c | c,NotUsed -> c let alias a b = match a,b with | NotUsed,c | c,NotUsed -> c | _ -> Aliased let to_string = function | NotUsed -> "not used" | NotAliased -> "not aliased" | Aliased -> "aliased" let pretty fmt a = Format.pp_print_string fmt (to_string a) end module Usage = struct let pretty fmt = function | Value -> () | Deref -> Format.pp_print_char fmt '*' | Array -> Format.pp_print_string fmt "[]" let order = function Value -> 0 | Deref -> 1 | Array -> 2 let merge a b = if order a < order b then b else a let is_aliased = function Value -> false | Deref | Array -> true let is_shifted = function Value | Deref -> false | Array -> true end module Deref = struct type t = deref let pretty fmt (usage,typ) = Format.fprintf fmt "{%a}" Typ.pretty typ ; Usage.pretty fmt usage let compare ((da,ta):t) ((db,tb):t) = let cmp = Pervasives.compare da db in if cmp <> 0 then cmp else Typ.compare ta tb let equal a b = (compare a b = 0) end (* -------------------------------------------------------------------------- *) (* --- Access --- *) (* -------------------------------------------------------------------------- *) type lvalue = | Eval of exp | Tval of term | Assigned of stmt module Lvalue = struct type t = lvalue let order = function Eval _ -> 0 | Tval _ -> 1 | Assigned _ -> 2 let compare a b = if a == b then 0 else match a,b with | Eval x , Eval y -> Exp.compare x y | Tval x , Tval y -> Term.compare x y | Assigned a , Assigned b -> Stmt.compare a b | _ -> order a - order b let equal a b = a == b || match a,b with | Eval x , Eval y -> Exp.equal x y | Tval x , Tval y -> Term.equal x y | Assigned a , Assigned b -> Stmt.equal a b | _ -> false let pretty fmt = function | Eval x -> Exp.pretty fmt x | Tval t -> Term.pretty fmt t | Assigned { skind = Instr(Set(lv,_,_)) } | Assigned { skind = Instr(Call(Some lv,_,_,_)) } -> Lval.pretty fmt lv | Assigned { skind = Instr(Local_init(x,_,_)) } -> Varinfo.pretty fmt x | Assigned stmt -> Format.fprintf fmt "stmt:s%d" stmt.sid end module Mode(OPT : sig val get : unit -> bool end) = struct let default = OPT.get let merge a b = if default () then a && b else a || b end module RW = Mode(Wp.Region_rw) module Flat = Mode(Wp.Region_flat) module Pack = Mode(Wp.Region_pack) (* -------------------------------------------------------------------------- *) (* --- Data Layout --- *) (* -------------------------------------------------------------------------- *) type 'a value = | Int of Ctypes.c_int | Float of Ctypes.c_float | Pointer of 'a module Value = struct let compare phi u v = if u == v then 0 else match u,v with | Int a , Int b -> Ctypes.compare_c_int a b | Int _ , _ -> (-1) | _ , Int _ -> 1 | Float a , Float b -> Ctypes.compare_c_float a b | Float _ , _ -> (-1) | _ , Float _ -> 1 | Pointer ra , Pointer rb -> phi ra rb let equal phi a b = match a,b with | Pointer ra , Pointer rb -> phi ra rb | Int a , Int b -> a = b | Float a , Float b -> a = b | _ -> false let pretty pp fmt = function | Int iota -> Ctypes.pp_int fmt iota | Float flt -> Ctypes.pp_float fmt flt | Pointer r -> Format.fprintf fmt "ptr(%a)" pp r let sizeof = function | Int iota -> Ctypes.i_bits iota | Float flt -> Ctypes.f_bits flt | Pointer _ -> Ctypes.p_bits () let pointed = function | Int _ | Float _ -> None | Pointer r -> Some r let merge mu a b = match a,b with | Int i , Int j when i = j -> Some a | Float f , Float g when f = g -> Some a | Pointer r , Pointer r' -> Some(Pointer(mu r r')) | _ -> None end module Matrix = struct let rec gcd a b = if b = 0 then a else gcd b (a mod b) let pretty fmt = function | [] -> () | d::ds -> Format.fprintf fmt "@[<hov 1>[%d" d ; List.iter (fun d -> Format.fprintf fmt ",@,%d" d) ds ; Format.fprintf fmt "]@]" let rec sizeof n = function [] -> n | d::ds -> sizeof (n*d) ds let array ds n = if n = 1 then ds else ds @ [n] (* Assumes s divides len *) let join_array s len = let n = len / s in if n = 1 then [] else [n] (* Assumes s divides len , computes (s,ds) that fits exactly in len with ds maximal prefix of da and db *) let rec join s da db len = match da , db with | d::da , d'::db when d = d' -> let s' = s * d in if len mod s' = 0 then d :: join s' da db len else join_array s len | _ -> join_array s len let rec merge d1 d2 = match d1 , d2 with | n::d1 , n'::d2 when n=n' -> n :: merge d1 d2 | _ -> [] end (* -------------------------------------------------------------------------- *) (* --- Range & Overlays --- *) (* -------------------------------------------------------------------------- *) let garbled_key = Wp.register_category "garbled" type dim = Raw of int | Dim of int * int list type 'a range = { ofs : int ; (* in bits, start from 0 *) len : int ; reg : 'a ; dim : dim ; } type 'a overlay = 'a range list type 'a merger = raw:bool -> 'a -> 'a -> 'a module Range = struct let pp_dim fmt = function | Raw _ -> Format.pp_print_string fmt "raw" | Dim(s,ds) -> Format.fprintf fmt "{%d}%a" s Matrix.pretty ds let pretty pp fmt { ofs ; len ; reg ; dim } = Format.fprintf fmt "%d..%d: %a#%a" ofs (ofs+len-1) pp reg pp_dim dim let overlap (type a) (_ : a formatter) (mu : a merger) ra rb = let aligned = ref None in let ofs = min ra.ofs rb.ofs in let len = max (ra.ofs + ra.len) (rb.ofs + rb.len) - ofs in begin match ra.dim , rb.dim with | Dim(s,da) , Dim(s',db) when s = s' -> if len mod s = 0 then let ta = abs (ra.ofs - rb.ofs) in let tb = abs (ra.ofs + ra.len - rb.ofs - rb.len) in if ta mod s = 0 && tb mod s = 0 then let reg = mu ~raw:false ra.reg rb.reg in let ds = Matrix.join s da db len in let dim = Dim(s,ds) in aligned := Some { ofs ; len ; reg ; dim } | _ -> () end ; match !aligned with | Some rg -> rg | None -> { ofs ; len ; reg = mu ~raw:true ra.reg rb.reg ; dim = Raw len } let shift ofs rg = { rg with ofs = rg.ofs + ofs } let flatten rg = match rg.dim with | Dim(s,ds) when ds <> [] -> let n = Matrix.sizeof 1 ds in { rg with dim = Dim(s,Matrix.array [] n) } | _ -> rg let included p n { ofs ; len } = ofs <= p && p + n <= ofs + len end module Overlay = struct let pretty ?title pp fmt rs = begin Format.fprintf fmt "@[<hv 0>" ; Extlib.may (fun pp -> pp fmt) title ; Format.fprintf fmt "@[<hov 2>{" ; List.iter (fun rg -> Format.fprintf fmt "@ @[<hov 2>%a@];" (Range.pretty pp) rg ) rs ; Format.fprintf fmt "@]@ }@]" ; end let rec merge (pp : 'a formatter) (mu : _ merger) ova ovb = match ova , ovb with | [],ovc | ovc,[] -> ovc | ra::wa , rb::wb -> let sa = ra.ofs + ra.len in let sb = rb.ofs + rb.len in if sa <= rb.ofs then ra :: merge pp mu wa ovb else if sb <= ra.ofs then rb :: merge pp mu ova wb else if sa < sb then merge pp mu wa (Range.overlap pp mu ra rb :: wb) else merge pp mu (Range.overlap pp mu ra rb :: wa) wb let rec pack eq = function | ({ dim = Dim(s ,da) } as ra ) :: ({ dim = Dim(s',db) } as rb ) :: ovl when eq ra.reg rb.reg && s = s' && ra.ofs + ra.len = rb.ofs -> let len = ra.len + rb.len in let ds = Matrix.join s da db len in pack eq ({ ofs = ra.ofs ; len ; reg = ra.reg ; dim = Dim(s,ds) } :: ovl) | rg :: ovl -> rg :: pack eq ovl | [] -> [] let flatten ovl = List.map Range.flatten ovl let once reg overlay = match List.filter (fun rg -> rg.reg == reg) overlay with | [] | [_] -> true | _ -> false end (* -------------------------------------------------------------------------- *) (* --- Layout --- *) (* -------------------------------------------------------------------------- *) type 'a layout = { sizeof : int ; layout : 'a overlay ; } module Compound = struct let garbled cache offset reg = let (ofs,len),sizeof = Offset.range cache offset in { sizeof ; layout = [ { ofs ; len ; reg ; dim = Raw len } ] } let field cache fd reg dim = let (ofs,len),sizeof = Offset.range_field cache fd in { sizeof ; layout = [ { ofs ; len ; reg ; dim } ] } let index te n reg dim = let len = Cil.bitsSizeOf te * n in { sizeof = len ; layout = [ { ofs = 0 ; len ; reg ; dim } ] } let reshape ~eq ~flat ~pack { sizeof ; layout } = let ovl = if flat then Overlay.flatten layout else layout in let ovl = if pack then Overlay.pack eq ovl else ovl in { sizeof ; layout = ovl } end (* -------------------------------------------------------------------------- *) (* --- Clustering --- *) (* -------------------------------------------------------------------------- *) type 'a cluster = | Empty | Garbled | Chunk of 'a value | Layout of 'a layout module Cluster = struct let is_empty = function Empty -> true | _ -> false let is_garbled = function Garbled -> true | _ -> false let pretty pp fmt = function | Empty -> Format.pp_print_string fmt "empty" | Garbled -> Format.pp_print_string fmt "garbled" | Chunk v -> Value.pretty pp fmt v | Layout { sizeof ; layout } -> Overlay.pretty ~title:(fun fmt -> Format.fprintf fmt "sizeof:%d" sizeof) pp fmt layout let deref ~pointed (_,typ) = match Cil.unrollType typ with | TInt(ti,_) | TEnum({ ekind = ti },_) -> Chunk (Int (Ctypes.c_int ti)) | TFloat(tf,_) -> Chunk (Float (Ctypes.c_float tf)) | TPtr _ | TFun _ -> Chunk(Pointer(Lazy.force pointed)) | TVoid _ | TNamed _ | TComp _ | TArray _ | TBuiltin_va_list _ -> Empty let rec get_dim s rds typ = if s = Cil.bitsSizeOf typ then Some (List.rev rds) else match Cil.unrollType typ with | TArray( te , Some e , _ , _ ) -> begin match Ctypes.get_int e with | None -> None | Some n -> get_dim s (if n = 1 then rds else n::rds) te end | _ -> None let shift_may cache pp offset reg ~inline cluster = match offset , cluster with | _ , Garbled -> None | _ , Empty -> let sizeof = Offset.container cache offset in Some { sizeof ; layout = [] } | Field fd , Chunk v -> begin let s = Value.sizeof v in match get_dim s [] fd.ftype with | None -> None | Some ds -> let dim = Dim(s,ds) in Some (Compound.field cache fd reg dim) end | Index(te,n) , Chunk v -> begin let s = Value.sizeof v in match get_dim s (Matrix.array [] n) te with | None -> None | Some ds -> let dim = Dim(s,ds) in Some (Compound.index te n reg dim) end | Field fd , Layout d -> let (ofs,len),sizeof = Offset.range_field cache fd in if d.sizeof = len then let layout = if inline then List.map (Range.shift ofs) d.layout else [ { ofs ; len ; reg ; dim=Dim(len,[]) } ] in Some { sizeof ; layout } else None | Index(te,n) , Layout { sizeof = s ; layout = [ { ofs=0 ; len ; reg ; dim = Dim(se,dse) } ] } when inline && s = len && Cil.bitsSizeOf te = len -> let dim = Dim(se,Matrix.array dse n) in Some (Compound.index te n reg dim) | Index(te,n) , Layout { sizeof } -> let size = Cil.bitsSizeOf te in if sizeof = size then let dim = Dim(size,Matrix.array [] n) in Some (Compound.index te n reg dim) else ( if Wp.has_dkey garbled_key then Wp.debug ~dkey:garbled_key "@[<hv 0>Garbled Offset:@ Index= {%a}[%d];@ Cluster= %a;@]" Cil_datatype.Typ.pretty te n (pretty pp) cluster ; None ) let shift cache pp offset reg ~inline cluster = match shift_may cache pp offset reg ~inline cluster with Some ovl -> ovl | None -> Compound.garbled cache offset reg let do_merge pp (mu : 'a merger) (a : 'a cluster) (b : 'a cluster) = match a,b with | Empty , c | c , Empty -> c | Chunk va , Chunk vb -> begin match Value.merge (mu ~raw:false) va vb with | None -> Garbled | Some v -> Chunk v end | Layout { layout = [ { ofs=0 ; len=la ; reg=ra ; dim=Dim(s,da) } ] } , Layout { layout = [ { ofs=0 ; len=lb ; reg=rb ; dim=Dim(s',db) } ] } when s = s' -> let reg = mu ~raw:false ra rb in let len = max la lb in let ds = Matrix.join s da db len in let layout = [ { ofs=0 ; len ; reg ; dim=Dim(s,ds) } ] in Layout { sizeof = len ; layout } | Layout { sizeof ; layout = la } , Layout { sizeof = s ; layout = lb } when s = sizeof -> let layout = Overlay.merge pp mu la lb in Layout { sizeof ; layout } | _ -> Garbled let merge pp mu a b = let result = do_merge pp mu a b in if result = Garbled && Wp.has_dkey garbled_key then Wp.debug ~dkey:garbled_key "@[<hv 0>Garbled Clusters:@ A=%a@ B=%a@]" (pretty pp) a (pretty pp) b ; result let reshape ~eq ~flat ~pack = function | Layout layout when flat || pack -> Layout (Compound.reshape ~eq ~flat ~pack layout) | cluster -> cluster end (* -------------------------------------------------------------------------- *) (* --- Roots --- *) (* -------------------------------------------------------------------------- *) type 'a from = | Fvar of varinfo | Ffield of 'a * int | Findex of 'a | Fderef of 'a | Farray of 'a type root = | Rnone | Rfield of varinfo * int (* static offset *) | Rindex of varinfo (* any offset rooted at var *) | Rtop module Root = struct let pretty fmt = function | Rtop -> Format.pp_print_string fmt "*" | Rnone -> Format.pp_print_string fmt "-" | Rfield(x,0) -> Format.fprintf fmt "&%a" Varinfo.pretty x | Rfield(x,ofs) -> Format.fprintf fmt "&%a+%d" Varinfo.pretty x ofs | Rindex(x) -> Format.fprintf fmt "&%a+(..)" Varinfo.pretty x let field ofs = function | Rfield(x,p) -> Rfield(x,p+ofs) | (Rindex _ | Rnone | Rtop) as r -> r let index = function | Rfield(x,_) -> Rindex x | (Rindex _ | Rnone | Rtop) as r -> r let from ~root = function | Fvar x -> Rfield(x,0) | Ffield(r,ofs) -> field ofs (root r) | Findex r -> index (root r) | Fderef r -> root r | Farray _ -> Rtop let merge_var a b = match a,b with | (Rfield(x,_) | Rindex x) , (Rfield(y,_) | Rindex y) when Varinfo.equal x y -> Some x | _ -> None let merge_field x a b = match a,b with | Rfield(_,p) , Rfield(_,q) when p = q -> a | _ -> Rindex x let merge a b = if a == b then a else match a,b with | Rnone,s | s,Rnone -> s | Rtop,_ | _,Rtop -> Rtop | _ -> match merge_var a b with | Some x -> merge_field x a b | None -> Rtop let indexed = function | Rnone | Rfield _ -> false | Rindex _ | Rtop -> true let framed = function | Rfield(x,_) | Rindex x -> not x.vglob && not x.vaddrof (* Cf. MemVar *) | Rnone -> true | Rtop -> false end (* -------------------------------------------------------------------------- *) (* --- Chunks --- *) (* -------------------------------------------------------------------------- *) module R = Qed.Intset type chunks = R.t type 'a chunk = | Mref of 'a | Mmem of root * 'a value | Mraw of root * 'a option | Mcomp of chunks * 'a overlay module Chunk = struct let mem = R.mem let empty = R.empty let singleton = R.singleton let union = R.union let union_map f es = List.fold_left (fun w e -> R.union w @@ f e) R.empty es let disjoint a b = not (R.intersect a b) let pretty pp fmt es = begin Format.fprintf fmt "@[<hov 2>{" ; R.iter (fun e -> Format.fprintf fmt "@ %a" pp e) es ; Format.fprintf fmt " }@]" ; end end (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Layout.mli������������������������������������������������������0000666�0000000�0000000�00000017714�13571573400�016103� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Region Utilities *) open Pretty_utils open Cil_types module type Data = sig type t val equal : t -> t -> bool val compare : t -> t -> int val pretty : t formatter end (* -------------------------------------------------------------------------- *) (** {2 L-Path} *) (* -------------------------------------------------------------------------- *) type offset = | Field of fieldinfo | Index of typ * int type lvalue = (** Generalized l-values *) | Eval of exp | Tval of term | Assigned of stmt module Offset : sig include Data with type t = offset val index : typ -> offset val field : fieldinfo -> offset val typeof : offset -> typ val typeof_chain : typ -> offset list -> typ val pp_chain : typ -> offset list formatter type cache val cache : unit -> cache val field_offset : cache -> fieldinfo -> int * int (* in bits *) val range : cache -> offset -> (int * int) * int (* in bits *) val sizeof : offset -> int (* in bits *) end module Lvalue : Data with type t = lvalue (* -------------------------------------------------------------------------- *) (** {2 Access} *) (* -------------------------------------------------------------------------- *) type alias = NotUsed | NotAliased | Aliased type usage = Value | Deref | Array type deref = usage * typ module Alias : sig val use : alias -> alias val merge : alias -> alias -> alias val alias : alias -> alias -> alias val is_aliased : alias -> bool val pretty : alias formatter end module Usage : sig val pretty : usage formatter val merge : usage -> usage -> usage val is_shifted : usage -> bool val is_aliased : usage -> bool end module Deref : Data with type t = deref (* -------------------------------------------------------------------------- *) (** {2 R-Values} *) (* -------------------------------------------------------------------------- *) type 'a value = | Int of Ctypes.c_int | Float of Ctypes.c_float | Pointer of 'a module Value : sig val compare : ('a -> 'a -> int) -> 'a value -> 'a value -> int val equal : ('a -> 'a -> bool) -> 'a value -> 'a value -> bool val pretty : 'a formatter -> 'a value formatter val sizeof : 'a value -> int val pointed : 'a value -> 'a option val merge : ('a -> 'a -> 'a) -> 'a value -> 'a value -> 'a value option end module Matrix : sig val gcd : int -> int -> int val pretty : int list formatter val sizeof : int -> int list -> int val merge : int list -> int list -> int list end (* -------------------------------------------------------------------------- *) (** {2 Overlays} *) (* -------------------------------------------------------------------------- *) type dim = Raw of int | Dim of int * int list type 'a range = private { ofs : int ; (* in bits, start from 0 *) len : int ; reg : 'a ; dim : dim ; } type 'a overlay = 'a range list type 'a merger = raw:bool -> 'a -> 'a -> 'a module Range : sig val pretty : 'a formatter -> 'a range formatter val overlap : 'a formatter -> 'a merger -> 'a range -> 'a range -> 'a range val included : int -> int -> 'a range -> bool end module Overlay : sig val pretty : ?title:(Format.formatter -> unit) -> 'a formatter -> 'a overlay formatter val merge : 'a formatter -> 'a merger -> 'a overlay -> 'a overlay -> 'a overlay val once : 'a -> 'a overlay -> bool end (* -------------------------------------------------------------------------- *) (** {2 Compound Layout} *) (* -------------------------------------------------------------------------- *) type 'a layout = { sizeof : int ; layout : 'a overlay ; } module Compound : sig val garbled : Offset.cache -> offset -> 'a -> 'a layout val reshape : eq:('a -> 'a -> bool) -> flat:bool -> pack:bool -> 'a layout -> 'a layout end (* -------------------------------------------------------------------------- *) (** {2 Clustering} *) (* -------------------------------------------------------------------------- *) type 'a cluster = | Empty | Garbled | Chunk of 'a value | Layout of 'a layout module Cluster : sig val pretty : 'a formatter -> 'a cluster formatter val deref : pointed:'a Lazy.t -> deref -> 'a cluster val shift : Offset.cache -> 'a formatter -> offset -> 'a -> inline:bool -> 'a cluster -> 'a layout val merge : 'a formatter -> 'a merger -> 'a cluster -> 'a cluster -> 'a cluster val is_empty : 'a cluster -> bool val is_garbled : 'a cluster -> bool val reshape : eq:('a -> 'a -> bool) -> flat:bool -> pack:bool -> 'a cluster -> 'a cluster end (* -------------------------------------------------------------------------- *) (** {2 Roots} *) (* -------------------------------------------------------------------------- *) type 'a from = | Fvar of varinfo | Ffield of 'a * int | Findex of 'a | Fderef of 'a | Farray of 'a type root = | Rnone | Rfield of varinfo * int (* static offset *) | Rindex of varinfo (* any offset rooted at var *) | Rtop module Root : sig val pretty : root formatter val from : root:('a -> root) -> 'a from -> root val merge : root -> root -> root val indexed : root -> bool val framed : root -> bool end (* -------------------------------------------------------------------------- *) (** {2 Chunks} *) (* -------------------------------------------------------------------------- *) type chunks = Qed.Intset.t type 'a chunk = | Mref of 'a (** Constant pointers to region *) | Mmem of root * 'a value (** Aliased values *) | Mraw of root * 'a option (** Bits that may points-to *) | Mcomp of chunks * 'a overlay (** Aliased chunks & overlay *) module Chunk : sig val empty : chunks val singleton : int -> chunks val union : chunks -> chunks -> chunks val disjoint : chunks -> chunks -> bool val union_map : ('a -> chunks) -> 'a list -> chunks val mem : int -> chunks -> bool val pretty : int formatter -> chunks formatter end (* -------------------------------------------------------------------------- *) (** {2 Options} *) (* -------------------------------------------------------------------------- *) (** Read-Write access *) module RW : sig val default : unit -> bool val merge : bool -> bool -> bool end (** Flatten arrays *) module Flat : sig val default : unit -> bool val merge : bool -> bool -> bool end (** Pack fields *) module Pack : sig val default : unit -> bool val merge : bool -> bool -> bool end (* -------------------------------------------------------------------------- *) ����������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Letify.ml�������������������������������������������������������0000666�0000000�0000000�00000047014�13571573400�015705� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Letification of Goals --- *) (* -------------------------------------------------------------------------- *) open Qed.Logic open Lang open Lang.F let vmem x a = Vars.mem x (F.vars a) let occurs xs a = Vars.intersect xs (F.vars a) (* -------------------------------------------------------------------------- *) (* --- Trivial Simplifications --- *) (* -------------------------------------------------------------------------- *) module Ground = struct type subst = pred -> pred type env = { mutable ground : bool Tmap.t ; mutable domain : term Tmap.t ; } let rec is_ground env e = F.is_primitive e || begin try Tmap.find e env.ground with Not_found -> let r = match F.repr e with | Rdef fvs -> List.for_all (fun (_,e) -> is_ground env e) fvs | Fun(f,es) -> begin match Fun.category f with | Constructor -> List.for_all (is_ground env) es | _ -> false end | _ -> false in env.ground <- Tmap.add e r env.ground ; r end let merge a b = Tmap.union (fun _ u v -> if F.compare u v <= 0 then u else v) a b let clause env h = begin env.domain <- Tmap.add h F.e_true env.domain ; env.domain <- Tmap.add (e_not h) F.e_false env.domain ; end let frank = function | ACSL _ -> 0 | CTOR _ -> 3 | Model { m_category = Function } -> 0 | Model { m_category = Injection } -> 1 | Model { m_category = Operator _ } -> 2 | Model { m_category = Constructor } -> 3 let add_reduce env a b = env.domain <- Tmap.add a b env.domain let reduce env a b = if F.is_subterm a b then add_reduce env b a else if F.is_subterm b a then add_reduce env a b else begin match F.repr a , F.repr b with | Fun(f,_) , Fun(g,_) when Wp_parameters.Reduce.get () -> let cmp = frank f - frank g in if cmp < 0 then add_reduce env a b else if cmp > 0 then add_reduce env b a | Fun(f,_) , _ when frank f = 0 -> add_reduce env a b | _ , Fun(f,_) when frank f = 0 -> add_reduce env b a | _ -> () end let rec walk env h = match F.repr h with | True | False -> () | And ps -> List.iter (walk env) ps | Eq(a,b) -> clause env h ; if is_ground env b then add_reduce env a b else if is_ground env a then add_reduce env b a else reduce env a b | Fun(f,[x]) -> begin clause env h ; try let iota = Cint.is_cint f in let conv = Cint.convert iota x in add_reduce env conv x ; with Not_found -> () end | _ -> clause env h let subst mu = let sigma = Lang.sigma () in F.Subst.add_map sigma mu ; F.p_subst sigma let e_apply env = let sigma = Lang.sigma () in F.Subst.add_map sigma env.domain ; F.e_subst sigma let p_apply env = let sigma = Lang.sigma () in F.Subst.add_map sigma env.domain ; F.p_subst sigma [@@@ warning "-32"] let pp_sigma fmt s = begin Format.fprintf fmt "@[<hov 2>[" ; Tmap.iter (fun a b -> Format.fprintf fmt "@ %a -> %a ;" F.pp_term a F.pp_term b) s ; Format.fprintf fmt "]@]" ; end [@@@ warning "+32"] let pretty fmt env = pp_sigma fmt env.domain let assume env p = let p = p_apply env p in walk env (F.e_prop p) ; p let top () = { ground = Tmap.empty ; domain = Tmap.empty } let copy env = { domain = env.domain ; ground = env.ground } let compute seq = let n = Array.length seq in let lhs = Array.make n Tmap.empty in let rhs = Array.make n Tmap.empty in let env = top () in for i = 0 to n-2 do seq.(i) <- assume env seq.(i) ; lhs.(succ i) <- env.domain ; done ; if n > 1 then seq.(n-1) <- assume env seq.(n-1) ; let mu = env.domain in env.domain <- Tmap.empty ; for i = n-1 downto 1 do seq.(i) <- assume env seq.(i) ; rhs.(pred i) <- env.domain ; done ; let gs = Array.init n (fun i -> let mu = merge lhs.(i) rhs.(i) in subst mu) in let g = subst mu in gs , g let singleton p = let env = { domain = Tmap.empty ; ground = Tmap.empty } in ignore (assume env p) ; subst env.domain let branch env p = let p = p_apply env p in let wa = copy env in let wb = copy env in ignore (assume wa p) ; ignore (assume wb (F.p_not p)) ; p , wa , wb let forward env p = match F.p_expr p with | And ps -> F.p_all (assume env) ps | _ -> assume env p let backward env p = match F.p_expr p with | And ps -> F.p_all (assume env) (List.rev ps) | _ -> assume env p end (* -------------------------------------------------------------------------- *) (* --- Generalized Substitution --- *) (* -------------------------------------------------------------------------- *) module Sigma : sig type t val equal : t -> t -> bool val pretty : string -> Format.formatter -> t -> unit val empty : t val add : var -> term -> t -> t val mem : var -> t -> bool val find : var -> t -> term val e_apply : t -> term -> term val p_apply : t -> pred -> pred val assume : t -> pred -> t val iter : (var -> term -> unit) -> t -> unit val class_of : t -> var -> var list val domain : t -> Vars.t val codomain : t -> Vars.t end = struct module Ceq = Qed.Partition.Make(Var)(Vars)(Vmap) type t = { dvar : Vars.t ; (* Domain of def *) dcod : Vars.t ; (* Codomain of def *) dall : Vars.t ; (* Domain of cst and def *) def : term Vmap.t ; (* Definitions *) ceq : Ceq.t ; (* Variable Classes *) cst : term Tmap.t ; (* Constants *) mutable cache : F.sigma option ; } let empty = { dcod = Vars.empty ; dvar = Vars.empty ; dall = Vars.empty ; ceq = Ceq.empty ; def = Vmap.empty ; cst = Tmap.empty ; cache = None ; } let equal s1 s2 = Vmap.equal F.equal s1.def s2.def && Tmap.equal F.equal s1.cst s2.cst let mem x sigma = Vmap.mem x sigma.def let find x sigma = Vmap.find x sigma.def let iter f sigma = Vmap.iter f sigma.def let lookup def (e:term) = match F.repr e with | Fvar x -> Vmap.find x def | _ -> raise Not_found let filter domain (e:term) = Vars.intersect (F.vars e) domain let subst sigma = match sigma.cache with | Some s -> s | None -> let s = Lang.sigma () in F.Subst.add_fun s (lookup sigma.def) ; F.Subst.add_map s sigma.cst ; F.Subst.add_filter s (filter sigma.dall) ; sigma.cache <- Some s ; s let e_apply sigma e = F.e_subst (subst sigma) e let p_apply sigma p = F.p_subst (subst sigma) p (* Returns true if [x:=a] applied to [y:=b] raises a circularity *) let occur_check sigma x a = try if vmem x a then raise Exit ; Vmap.iter (fun y b -> if vmem x b && vmem y a then raise Exit) sigma.def ; false with Exit -> true let add_ceq x e ceq = match F.repr e with | Fvar y -> Ceq.merge ceq x y | _ -> ceq let single x e = let sx = Vars.singleton x in { dvar = sx ; dall = sx ; dcod = F.vars e ; def = Vmap.add x e Vmap.empty ; ceq = add_ceq x e Ceq.empty ; cst = Tmap.empty ; cache = None ; } let add x e sigma = let e = e_apply sigma e in if Vmap.mem x sigma.def then sigma else if occur_check sigma x e then sigma else let sx = single x e in let def = Vmap.add x e (Vmap.map (fun _ d -> e_apply sx d) sigma.def) in let cst0 = Tmap.filter (fun e _c -> not (vmem x e)) sigma.cst in let cst1 = Tmap.fold (fun e c cst -> if vmem x e then Tmap.add (e_apply sx e) c cst else cst) cst0 sigma.cst in { cst = cst1 ; def = def ; ceq = add_ceq x e sigma.ceq ; dvar = Vars.add x sigma.dvar ; dall = Vars.add x sigma.dall ; dcod = Vars.union (F.vars e) sigma.dcod ; cache = None ; } let domain sigma = sigma.dvar let codomain sigma = sigma.dcod let class_of sigma x = Vars.elements (Ceq.members sigma.ceq x) (* --- Constants --- *) (* c must be closed *) let add_cst e c sigma = try let c0 = Tmap.find e sigma.cst in if compare c c0 < 0 then raise Not_found else sigma with Not_found -> let cst = Tmap.add e c sigma.cst in let all = Vars.union (F.vars e) sigma.dall in { cst = cst ; dall = all ; dvar = sigma.dvar ; dcod = sigma.dcod ; def = sigma.def ; ceq = sigma.ceq ; cache = None ; } let mem_lit l sigma = try F.Subst.get (subst sigma) l == e_true with Not_found -> false let add_lit l sigma = add_cst l e_true (add_cst (e_not l) e_false sigma) (** look for the shape: \forall x:integer. (csta <= x /\ x <= cstb) => t1=t2 and return [Some(csta,cstb)] < on integer are always normalized to <= *) let extract_forall_equality fb = begin match F.repr (F.QED.lc_repr fb) with | Imply ([la;lb],c) -> begin match F.repr c with | Eq _ -> let order = 0 in (** todo get the order from term *) begin match F.repr la, F.repr lb with | Leq(a,b), Leq(c,d) -> begin match F.repr a, F.repr b, F.repr c, F.repr d with | Bvar(o1,Int), Kint cstb, Kint csta, Bvar(o2,Int) when o1 = order && o2 = order -> Some(csta,cstb) | Kint csta, Bvar(o1,Int), Bvar(o2,Int), Kint cstb when o1 = order && o2 = order -> Some(csta,cstb) | _ -> None end | _ -> None end | _ -> None end | _ -> None end let is_kint e = match F.repr e with Qed.Logic.Kint _ -> true | _ -> false let rec add_pred sigma p = match F.repr p with | And ps -> List.fold_left add_pred sigma ps | Eq(a,b) -> begin match F.repr a , F.repr b with | Fvar x , _ when not (F.occurs x b) -> add x b sigma | _ , Fvar x when not (F.occurs x a) -> add x a sigma | _ -> match F.is_closed a , F.is_closed b with | true , false -> add_cst b a sigma | false , true -> add_cst a b sigma | true , true -> if F.compare a b < 0 then add_cst b a sigma else add_cst a b sigma | false , false -> add_lit p sigma end | Leq(a,b) -> if mem_lit (e_leq b a) sigma then add_pred sigma (e_eq a b) else add_lit p sigma | Lt(a,b) -> let sigma = if is_kint b then add_pred sigma (e_leq a (e_add b e_one)) else sigma in let sigma = if is_kint a then add_pred sigma (e_leq (e_sub a e_one) b) else sigma in add_lit p (add_lit (e_leq a b) (add_lit (e_neq a b) sigma)) | Neq _ | Fun _ | Not _ -> add_lit p sigma | Bind (Forall,Int,fb) -> let bound = Integer.of_int (Wp_parameters.BoundForallUnfolding.get ()) in begin match extract_forall_equality fb with | Some (csta,cstb) when Integer.le csta cstb && Integer.le (Integer.sub cstb csta) bound -> let rec aux sigma i = if Integer.lt cstb i then sigma else begin let eq = F.QED.e_apply p [e_zint i] in (** qed should be able to simplify it directly *) let sigma = add_pred sigma eq in aux sigma (Integer.succ i) end in aux sigma csta | _ -> sigma end | _ -> sigma let assume sigma p = add_pred sigma (F.e_prop p) (* --- Pretty --- *) module Xmap = FCMap.Make(Var) let pretty title fmt sigma = let def = Vmap.fold Xmap.add sigma.def Xmap.empty in begin Format.fprintf fmt "@[<hv 0>@[<hv 2>%s {" title ; Format.fprintf fmt "@ @[vars: %a;@]" F.pp_vars sigma.dall ; Xmap.iter (fun x e -> Format.fprintf fmt "@ @[%a := %a ;@]" F.pp_term (F.e_var x) F.pp_term e ) def ; Tmap.iter (fun e m -> Format.fprintf fmt "@ C @[%a := %a ;@]" F.pp_term e F.pp_term m ) sigma.cst ; Format.fprintf fmt "@ @]}@]" ; end end (* -------------------------------------------------------------------------- *) (* --- Definition Extractions --- *) (* -------------------------------------------------------------------------- *) module Defs = struct type t = Tset.t Vmap.t let empty = Vmap.empty let merge = Vmap.union (fun _ -> Tset.union) let add_def (w : t ref) x e = let es = try Vmap.find x !w with Not_found -> Tset.empty in w := Vmap.add x (Tset.add e es) !w let rec diff s y = function | [] -> s | e::es -> match F.repr e with | Fvar x when x==y -> diff s y es | _ -> diff (e_opp e :: s) y es let add_linear w x pos neg = add_def w x (e_sum (diff pos x neg)) let terms e = match F.repr e with Add es -> es | _ -> [e] let rec atoms = function | [] -> [] | e::es -> match F.repr e with | Fvar x -> x :: atoms es | _ -> atoms es let rec defs w p = match F.repr p with | And ps -> List.iter (defs w) ps | Eq(a,b) -> defs_eq w a b | Not p -> begin match F.repr p with | Fvar x -> add_def w x e_false | _ -> () end | Fvar x -> add_def w x e_true | _ -> () and defs_affine w a b = let ta = terms a in let tb = terms b in let xa = atoms ta in let yb = atoms tb in begin List.iter (fun x -> add_linear w x tb ta) xa ; List.iter (fun y -> add_linear w y ta tb) yb ; end and defs_eq w a b = match F.repr a , F.repr b with | Add _ , _ | _ , Add _ -> defs_affine w a b | Fvar x , Fvar y -> add_def w x b ; add_def w y a | Fvar x , _ -> add_def w x b | _ , Fvar y -> add_def w y a | _ -> () let extract p = let w = ref empty in defs w (F.e_prop p) ; !w let add w p = defs w (F.e_prop p) let domain d = Vmap.fold (fun x _ xs -> Vars.add x xs) d Vars.empty end (* -------------------------------------------------------------------------- *) (* --- Substitution Extraction --- *) (* -------------------------------------------------------------------------- *) module XS = FCSet.Make(Var) let elements xs = Vars.fold XS.add xs XS.empty let iter f xs = XS.iter f (elements xs) let rec extract defs sref cycle x = if not (Vars.mem x cycle) && not (Sigma.mem x !sref) then try let cycle = Vars.add x cycle in let ds = Vmap.find x defs in (* if no defs, exit early *) let ys = ref [] in (* variables equal to x *) let es = ref [] in (* possible definitions *) let rs = ref [] in (* sigma definitions *) Tset.iter (fun e -> if not (occurs cycle e) then match F.repr e with | Fvar y -> begin try let d = Sigma.find y !sref in rs := d :: !rs with Not_found -> ys := y :: !ys end | _ -> es := e :: !es ) ds ; (* Now choose the represent of x and the dependencies *) let select d = sref := Sigma.add x d !sref ; d , F.vars d in let ceq , depends = match List.sort F.compare !rs with | r :: _ -> select r | [] -> match List.sort F.compare !es with | e :: _ -> select e | [] -> e_var x , Vars.empty in List.iter (fun y -> sref := Sigma.add y ceq !sref) !ys ; iter (extract defs sref cycle) depends with Not_found -> () let bind sigma defs xs = let sref = ref sigma in iter (extract defs sref Vars.empty) xs ; !sref let get_class sigma xs x = List.sort Var.compare (List.filter (fun y -> Vars.mem y xs) (Sigma.class_of sigma x)) let rec add_eq ps y = function | z::zs -> add_eq (p_equal (e_var y) (e_var z) :: ps) y zs | [] -> ps let add_equals ys ps = match ys with [] -> ps | y::ys -> add_eq ps y ys let add_definitions sigma defs xs ps = let xs = Vars.filter (fun x -> Vmap.mem x defs) xs in Vars.fold (fun x ps -> let ps = add_equals (get_class sigma xs x) ps in try F.p_equal (e_var x) (Sigma.find x sigma) :: ps with Not_found -> ps ) xs ps (* -------------------------------------------------------------------------- *) (* --- Split-Cases --- *) (* -------------------------------------------------------------------------- *) module Split = struct type occur = int F.Tmap.t ref let create () = ref Tmap.empty let literal m p = try let n = Tmap.find p !m in m := Tmap.add p (succ n) !m with Not_found -> m := Tmap.add p 1 !m let rec occur m p = match F.repr p with | And ps | Or ps -> List.iter (occur m) ps | Imply(hs,p) -> List.iter (occur m) (p::hs) | Not p -> occur m p | If(p,a,b) -> occur m p ; occur m a ; occur m b | Eq(a,b) when F.is_closed a || F.is_closed b -> literal m p | Neq(a,b) when F.is_closed a || F.is_closed b -> literal m (e_not p) | Fun _ | Leq _ -> literal m p | Lt _ -> literal m (e_not p) | _ -> () let add m p = occur m (F.e_prop p) let select m = let compare (c1,n1) (c2,n2) = (* most often first *) if n1 < n2 then 1 else if n1 > n2 then (-1) else F.comparep c1 c2 in List.sort compare (Tmap.fold (fun c n s -> (F.p_bool c,n)::s) !m []) end (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Letify.mli������������������������������������������������������0000666�0000000�0000000�00000006756�13571573400�016066� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Letifications --- *) (* -------------------------------------------------------------------------- *) open Lang.F module Ground : sig type subst = pred -> pred val singleton : pred -> subst val compute : pred array -> subst array * subst type env val pretty : Format.formatter -> env -> unit val top : unit -> env val copy : env -> env val e_apply : env -> term -> term val p_apply : env -> pred -> pred val forward : env -> pred -> pred val backward : env -> pred -> pred val branch : env -> pred -> pred * env * env end module Sigma : sig type t val equal : t -> t -> bool val pretty : string -> Format.formatter -> t -> unit val e_apply : t -> term -> term val p_apply : t -> pred -> pred val empty : t val add : var -> term -> t -> t val assume : t -> pred -> t val find : var -> t -> term val iter : (var -> term -> unit) -> t -> unit val domain : t -> Vars.t val codomain : t -> Vars.t end module Defs : sig type t val empty : t val merge : t -> t -> t val extract : pred -> t val add : t ref -> pred -> unit val domain : t -> Vars.t end val bind : Sigma.t -> Defs.t -> Vars.t -> Sigma.t (** [bind sigma defs xs] select definitions in [defs] targeting variables [xs]. The result is a new substitution that potentially augment [sigma] with definitions for [xs] (and others). *) val add_definitions : Sigma.t -> Defs.t -> Vars.t -> pred list -> pred list (** [add_definitions sigma defs xs ps] keep all definitions of variables [xs] from [sigma] that comes from [defs]. They are added to [ps]. *) (** Pruning strategy ; selects most occurring literals to split cases. *) module Split : sig type occur val create : unit -> occur val add : occur -> pred -> unit val select : occur -> (pred * int) list end ������������������frama-c-20.0-Calcium/src/plugins/wp/LogicAssigns.ml�������������������������������������������������0000666�0000000�0000000�00000006625�13571573400�017041� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Sigs module Make ( M : Sigs.Model ) ( C : Sigs.CodeSemantics with module M = M ) ( L : Sigs.LogicSemantics with module M = M ) = struct module M = M module L = L open M module D = Heap.Set (* -------------------------------------------------------------------------- *) (* --- Domain --- *) (* -------------------------------------------------------------------------- *) let dsloc obj = function | Sloc l | Sdescr(_,l,_) -> M.domain obj l | Srange(l,obj,_,_) | Sarray(l,obj,_) -> M.domain obj l let domain (r: loc Sigs.region) = List.fold_left (fun d (obj,sloc) -> D.union d (dsloc obj sloc)) D.empty r (* -------------------------------------------------------------------------- *) (* --- Assignation --- *) (* -------------------------------------------------------------------------- *) let rec assigned_seq hs s = function | [] -> Bag.concat (M.Sigma.assigned ~pre:s.pre ~post:s.post D.empty) hs | [obj,sloc] -> let eq_sloc = M.assigned s obj sloc in let hs_sloc = Bag.list (List.map Cvalues.equation eq_sloc) in let hs_sdom = M.Sigma.assigned ~pre:s.pre ~post:s.post (dsloc obj sloc) in Bag.concat (Bag.concat hs_sloc hs_sdom) hs | (obj,sloc)::tail -> let sigma = M.Sigma.havoc s.post (dsloc obj sloc) in let s_local = { pre = sigma ; post = s.post } in let s_other = { pre = s.pre ; post = sigma } in let eq_sloc = M.assigned s_local obj sloc in let hs_sloc = Bag.list (List.map Cvalues.equation eq_sloc) in assigned_seq (Bag.concat hs_sloc hs) s_other tail let apply_assigns (s:sigma sequence) (r: M.loc Sigs.region) = Bag.elements (assigned_seq Bag.empty s r) end �����������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/LogicAssigns.mli������������������������������������������������0000666�0000000�0000000�00000003421�13571573400�017201� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Make ( M : Sigs.Model ) ( C : Sigs.CodeSemantics with module M = M ) ( L : Sigs.LogicSemantics with module M = M ) : Sigs.LogicAssigns with module M = M and module L = L �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/LogicBuiltins.ml������������������������������������������������0000666�0000000�0000000�00000025041�13571573400�017214� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* Registry for ACSL Builtins --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Ctypes open Qed open Lang type category = Lang.lfun Qed.Logic.category type builtin = | ACSLDEF | LFUN of lfun | HACK of (F.term list -> F.term) type kind = | Z (* integer *) | R (* real *) | I of Ctypes.c_int | F of Ctypes.c_float | A (* abstract data *) (* [LC] kinds can be compared by Stdlib.compare *) let okind = function | C_int i -> I i | C_float f -> F f | _ -> A let ckind typ = okind (object_of typ) let skind = function | I _ | Z -> Logic.Sint | F _ | R -> Logic.Sreal | A -> Logic.Sdata let rec lkind t = match Logic_utils.unroll_type ~unroll_typedef:false t with | Ctype ty -> ckind ty | Ltype({lt_name="set"},[t]) -> lkind t | Lreal -> R | Linteger -> Z | Ltype _ | Larrow _ | Lvar _ -> A let kind_of_tau = function | Qed.Logic.Int -> Z | Qed.Logic.Real -> R | _ -> A let pp_kind fmt = function | I i -> Ctypes.pp_int fmt i | F f -> Ctypes.pp_float fmt f | Z -> Format.pp_print_string fmt "int" | R -> Format.pp_print_string fmt "real" | A -> Format.pp_print_string fmt "_" let pp_kinds fmt = function | [] -> () | t::ts -> Format.fprintf fmt "(%a" pp_kind t ; List.iter (fun t -> Format.fprintf fmt ",%a" pp_kind t) ts ; Format.fprintf fmt ")" let pp_libs fmt = function | [] -> () | t::ts -> Format.fprintf fmt ": %s" t ; List.iter (fun t -> Format.fprintf fmt ",%s" t) ts let pp_link fmt = function | ACSLDEF -> Format.pp_print_string fmt "(ACSL)" | HACK _ -> Format.pp_print_string fmt "(HACK)" | LFUN f -> Fun.pretty fmt f (* -------------------------------------------------------------------------- *) (* --- Driver & Lookup & Registry --- *) (* -------------------------------------------------------------------------- *) type sigfun = kind list * builtin type driver = { driverid : string; description : string; includes : string list; hlogic : (string , sigfun list) Hashtbl.t; hdeps : (string, string list) Hashtbl.t; hoptions : (string (* library *) * string (* group *) * string (* name *), string list) Hashtbl.t } let id d = d.driverid let descr d = d.description let is_default d = (d.driverid = "") let compare d d' = String.compare d.driverid d'.driverid let driver = Context.create "driver" let cdriver () = Context.get driver let lookup_driver name kinds = try let sigs = Hashtbl.find (cdriver ()).hlogic name in try List.assoc kinds sigs with Not_found -> Wp_parameters.feedback ~once:true "Use -wp-msg-key 'driver' for debugging drivers" ; if kinds=[] then Warning.error "Builtin %s undefined as a constant" name else Warning.error "Builtin %s undefined with signature %a" name pp_kinds kinds with Not_found -> if name.[0] == '\\' then Warning.error "Builtin %s%a not defined" name pp_kinds kinds else ACSLDEF let hacks = Hashtbl.create 8 let hack name phi = Hashtbl.replace hacks name phi let lookup name kinds = try let hack = Hashtbl.find hacks name in let compute es = try hack es with Not_found -> match lookup_driver name kinds with | ACSLDEF | HACK _ -> Warning.error "No fallback for hacked '%s'" name | LFUN p -> F.e_fun p es in HACK compute with Not_found -> lookup_driver name kinds let register ?source name kinds link = let sigs = try Hashtbl.find (cdriver ()).hlogic name with Not_found -> [] in if List.exists (fun (s,_) -> s = kinds) sigs then Wp_parameters.warning ?source "Redefinition of logic %s%a" name pp_kinds kinds ; let entry = (kinds,link) in Hashtbl.add (cdriver ()).hlogic name (entry::sigs) let iter_table f = let items = ref [] in Hashtbl.iter (fun a sigs -> List.iter (fun (ks,lnk) -> items := (a,ks,lnk)::!items) sigs) (cdriver ()).hlogic ; List.iter f (List.sort Transitioning.Stdlib.compare !items) let iter_libs f = let items = ref [] in Hashtbl.iter (fun a libs -> items := (a,libs) :: !items) (cdriver ()).hdeps ; List.iter f (List.sort Transitioning.Stdlib.compare !items) let dump () = Log.print_on_output begin fun fmt -> Format.fprintf fmt "Builtins:@\n" ; iter_libs (fun (name,libs) -> Format.fprintf fmt " * Library %s%a@\n" name pp_libs libs) ; iter_table (fun (name,k,lnk) -> Format.fprintf fmt " * Logic %s%a = %a@\n" name pp_kinds k pp_link lnk) ; end (* -------------------------------------------------------------------------- *) (* --- Implemented Builtins --- *) (* -------------------------------------------------------------------------- *) let logic phi = lookup phi.l_var_info.lv_name (List.map (fun v -> lkind v.lv_type) phi.l_profile) let ctor phi = lookup phi.ctor_name (List.map lkind phi.ctor_params) let constant name = lookup name [] (* -------------------------------------------------------------------------- *) (* --- Declaration of Builtins --- *) (* -------------------------------------------------------------------------- *) let dependencies lib = Hashtbl.find (cdriver ()).hdeps lib let add_library lib deps = let others = try dependencies lib with Not_found -> [] in Hashtbl.add (cdriver ()).hdeps lib (others @ deps) let add_alias ~source name kinds ~alias () = register ~source name kinds (lookup alias kinds) let add_logic ~source result name kinds ~library ?category ~link () = let sort = skind result in let params = List.map skind kinds in let lfun = Lang.extern_s ~library ?category ~sort ~params ~link name in register ~source name kinds (LFUN lfun) let add_predicate ~source name kinds ~library ~link () = let params = List.map skind kinds in let lfun = Lang.extern_fp ~library ~params ~link link.altergo in register ~source name kinds (LFUN lfun) let add_ctor ~source name kinds ~library ~link () = let category = Logic.Constructor in let params = List.map skind kinds in let lfun = Lang.extern_s ~library ~category ~params ~link name in register ~source name kinds (LFUN lfun) let add_type ~source name ~library ?(link=Lang.infoprover name) () = if Lang.mem_builtin_type ~name then Wp_parameters.warning ~source "Redefinition of type '%s'" name ; Lang.set_builtin_type ~name ~library ~link type sanitizer = driver_dir:string -> string -> string let sanitizers : ( string * string , sanitizer ) Hashtbl.t = Hashtbl.create 10 exception Unknown_option of string * string let sanitize ~driver_dir group name v = try (Hashtbl.find sanitizers (group,name)) ~driver_dir v with Not_found -> raise (Unknown_option(group,name)) type doption = string * string let create_option ~sanitizer group name = let option = (group,name) in Hashtbl.replace sanitizers option sanitizer ; option let get_option (group,name) ~library = try Hashtbl.find (cdriver ()).hoptions (library,group,name) with Not_found -> [] let set_option ~driver_dir group name ~library value = let value = sanitize ~driver_dir group name value in Hashtbl.replace (cdriver ()).hoptions (library,group,name) [value] let add_option ~driver_dir group name ~library value = let value = sanitize ~driver_dir group name value in let l = get_option (group,name) ~library in Hashtbl.replace (cdriver ()).hoptions (library,group,name) (l @ [value]) (** Includes *) let find_lib file = if Sys.file_exists file then file else let rec lookup file = function | [] -> Wp_parameters.abort "File '%s' not found" file | dir::dirs -> let path = Printf.sprintf "%s/%s" dir file in if Sys.file_exists path then path else lookup file dirs in lookup file (cdriver ()).includes (* -------------------------------------------------------------------------- *) (* --- Implemented Builtins --- *) (* -------------------------------------------------------------------------- *) let builtin_driver = { driverid = "builtin driver"; description = "builtin driver"; includes = []; hlogic = Hashtbl.create 131; hdeps = Hashtbl.create 31; hoptions = Hashtbl.create 131; } let add_builtin name kinds lfun = let phi = LFUN lfun in if Context.defined driver then register name kinds phi else Context.bind driver builtin_driver (register name kinds) phi let create ~id ?(descr=id) ?(includes=[]) () = { driverid = id ; description = descr ; includes = includes @ builtin_driver.includes ; hlogic = Hashtbl.copy builtin_driver.hlogic ; hdeps = Hashtbl.copy builtin_driver.hdeps ; hoptions = Hashtbl.copy builtin_driver.hoptions ; } let init ~id ?descr ?includes () = Context.set driver (create ~id ?descr ?includes ()) (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/LogicBuiltins.mli�����������������������������������������������0000666�0000000�0000000�00000011457�13571573400�017373� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Linker for ACSL Builtins --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Lang type category = Lang.lfun Qed.Logic.category type kind = | Z (** integer *) | R (** real *) | I of Ctypes.c_int (** C-ints *) | F of Ctypes.c_float (** C-floats *) | A (** Abstract Data *) val kind_of_tau : tau -> kind (** Add a new builtin. This builtin will be shared with all created drivers *) val add_builtin : string -> kind list -> lfun -> unit type driver val driver: driver Context.value val create: id:string -> ?descr:string -> ?includes:string list -> unit -> driver (** Create a new driver. leave the context empty. *) val init: id:string -> ?descr:string -> ?includes:string list -> unit -> unit (** Reset the context to a newly created driver *) val id : driver -> string val descr : driver -> string val is_default : driver -> bool val compare : driver -> driver -> int val find_lib: string -> string (** find a file in the includes of the current drivers *) val dependencies : string -> string list (** Of external theories. Raises Not_found if undefined *) val add_library : string -> string list -> unit (** Add a new library or update the dependencies of an existing one *) val add_alias : source:Filepath.position -> string -> kind list -> alias:string -> unit -> unit val add_type : source:Filepath.position -> string -> library:string -> ?link:string infoprover -> unit -> unit val add_ctor : source:Filepath.position -> string -> kind list -> library:string -> link:Qed.Engine.link infoprover -> unit -> unit val add_logic : source:Filepath.position -> kind -> string -> kind list -> library:string -> ?category:category -> link:Qed.Engine.link infoprover -> unit -> unit val add_predicate : source:Filepath.position -> string -> kind list -> library:string -> link:string infoprover -> unit -> unit val add_option : driver_dir:string -> string -> string -> library:string -> string -> unit (** add a value to an option (group, name) *) val set_option : driver_dir:string -> string -> string -> library:string -> string -> unit (** reset and add a value to an option (group, name) *) type doption type sanitizer = (driver_dir:string -> string -> string) val create_option: sanitizer:sanitizer -> string -> string -> doption (** [add_option_sanitizer ~driver_dir group name] add a sanitizer for group [group] and option [name] *) val get_option : doption -> library:string -> string list (** return the values of option (group, name), return the empty list if not set *) type builtin = | ACSLDEF | LFUN of lfun | HACK of (F.term list -> F.term) val logic : logic_info -> builtin val ctor : logic_ctor_info -> builtin val constant : string -> builtin val lookup : string -> kind list -> builtin (** Replace a logic definition or predicate by a built-in function. The LogicSemantics compilers will replace `Pcall` and `Tcall` instances of this symbol with the provided Qed function on terms. *) val hack : string -> (F.term list -> F.term) -> unit val dump : unit -> unit �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/LogicCompiler.ml������������������������������������������������0000666�0000000�0000000�00000076326�13571573400�017211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Compilation of ACSL Logic-Info --- *) (* -------------------------------------------------------------------------- *) open LogicUsage open LogicBuiltins open Cil_types open Cil_datatype open Clabels open Ctypes open Lang open Lang.F open Sigs open Definitions let dkey_lemma = Wp_parameters.register_category "lemma" type polarity = [ `Positive | `Negative | `NoPolarity ] module Make( M : Sigs.Model ) = struct (* -------------------------------------------------------------------------- *) (* --- Definitions --- *) (* -------------------------------------------------------------------------- *) open M type value = M.loc Sigs.value type logic = M.loc Sigs.logic type result = loc Sigs.result type sigma = M.Sigma.t type chunk = M.Chunk.t type signature = | CST of Integer.t | SIG of sig_param list and sig_param = | Sig_value of logic_var (* to be replaced by the value *) | Sig_chunk of chunk * c_label (* to be replaced by the chunk variable *) (* -------------------------------------------------------------------------- *) (* --- Utilities --- *) (* -------------------------------------------------------------------------- *) let rec wrap_lvar xs vs = match xs , vs with | x::xs , v::vs -> Logic_var.Map.add x v (wrap_lvar xs vs) | _ -> Logic_var.Map.empty let rec wrap_var xs vs = match xs , vs with | x::xs , v::vs -> Varinfo.Map.add x v (wrap_var xs vs) | _ -> Varinfo.Map.empty let rec wrap_mem = function | (label,mem) :: m -> LabelMap.add label mem (wrap_mem m) | [] -> LabelMap.empty let fresh_lvar ?basename ltyp = let tau = Lang.tau_of_ltype ltyp in let x = Lang.freshvar ?basename tau in let p = Cvalues.has_ltype ltyp (e_var x) in Lang.assume p ; x let fresh_cvar ?basename typ = fresh_lvar ?basename (Ctype typ) (* -------------------------------------------------------------------------- *) (* --- Logic Frame --- *) (* -------------------------------------------------------------------------- *) type call = { kf : kernel_function ; formals : value Varinfo.Map.t ; mutable result : M.loc Sigs.result option ; mutable status : var option ; } type frame = { descr : string ; pool : pool ; gamma : gamma ; call : call option ; types : string list ; mutable triggers : trigger list ; mutable labels : sigma LabelMap.t ; } let pp_frame fmt f = begin Format.fprintf fmt "Frame '%s':@\n" f.descr ; LabelMap.iter (fun l m -> Format.fprintf fmt "@[<hov 4>Label '%a': %a@]@\n" Clabels.pretty l Sigma.pretty m ) f.labels ; end (* -------------------------------------------------------------------------- *) (* --- Frames Builders --- *) (* -------------------------------------------------------------------------- *) let logic_frame a types = { descr = a ; pool = Lang.new_pool () ; gamma = Lang.new_gamma () ; types = types ; triggers = [] ; call = None ; labels = LabelMap.empty ; } let call0 ?result ?status ?(formals=Varinfo.Map.empty) kf = { kf ; formals ; result ; status } let call ?result kf vs = let formals = wrap_var (Kernel_function.get_formals kf) vs in let result = match result with None -> None | Some l -> Some (R_loc l) in { kf ; formals ; result ; status = None } let local ~descr = { descr ; types = [] ; pool = Lang.get_pool () ; gamma = Lang.get_gamma () ; triggers = [] ; call = None ; labels = LabelMap.empty ; } let frame kf = { descr = Kernel_function.get_name kf ; types = [] ; pool = Lang.new_pool () ; gamma = Lang.new_gamma () ; triggers = [] ; call = Some (call0 kf) ; labels = LabelMap.empty ; } let call_pre init call mem = { descr = "Pre " ^ Kernel_function.get_name call.kf ; types = [] ; pool = Lang.get_pool () ; gamma = Lang.get_gamma () ; triggers = [] ; call = Some call ; labels = wrap_mem [ Clabels.init , init ; Clabels.pre , mem ] ; } let call_post init call seq = { descr = "Post " ^ Kernel_function.get_name call.kf ; types = [] ; pool = Lang.get_pool () ; gamma = Lang.get_gamma () ; triggers = [] ; call = Some call ; labels = wrap_mem [ Clabels.init , init ; Clabels.pre , seq.pre ; Clabels.post , seq.post ; ] ; } (* -------------------------------------------------------------------------- *) (* --- Current Frame --- *) (* -------------------------------------------------------------------------- *) let cframe : frame Context.value = Context.create "LogicSemantics.frame" let get_frame () = Context.get cframe let in_frame f cc = Context.bind Lang.poly f.types (Context.bind cframe f (Lang.local ~pool:f.pool ~gamma:f.gamma cc)) let mk_frame ?kf ?result ?status ?formals ?(labels=LabelMap.empty) ?descr () = let call = match kf with | None -> None | Some kf -> Some (call0 ?result ?status ?formals kf) in let descr = match descr , kf with | Some descr , _ -> descr | None , None -> "<frame>" | None , Some kf -> Kernel_function.get_name kf in { descr ; labels ; call = call; pool = Lang.get_pool () ; gamma = Lang.get_gamma () ; triggers = []; types = []; } let mem_at_frame frame label = assert (not (Clabels.is_here label)); try LabelMap.find label frame.labels with Not_found -> let s = M.Sigma.create () in frame.labels <- LabelMap.add label s frame.labels ; s let set_at_frame frame label sigma = assert (not (Clabels.is_here label)); assert (not (LabelMap.mem label frame.labels)); frame.labels <- LabelMap.add label sigma frame.labels let mem_frame label = mem_at_frame (Context.get cframe) label let get_call = function | { call = Some call } -> call | { descr } -> Wp_parameters.fatal "Frame '%s' has is outside a function definition" descr let formal x = try let f = get_call (Context.get cframe) in Some (Varinfo.Map.find x f.formals) with Not_found -> None let return_type kf = if Kernel_function.returns_void kf then Wp_parameters.fatal "Function '%s' has no result" (Kernel_function.get_name kf) ; Kernel_function.get_return_type kf let return () = return_type (get_call (Context.get cframe)).kf let result () = let f = get_call (Context.get cframe) in match f.result with | Some r -> r | None -> let tr = return_type f.kf in let basename = Kernel_function.get_name f.kf in let x = fresh_cvar ~basename tr in let r = R_var x in f.result <- Some r ; r let status () = let f = get_call (Context.get cframe) in match f.status with | Some x -> x | None -> let x = fresh_cvar ~basename:"status" Cil.intType in f.status <- Some x ; x let trigger tg = if tg <> Qed.Engine.TgAny then let f = Context.get cframe in f.triggers <- tg :: f.triggers let guards f = Lang.hypotheses f.gamma (* -------------------------------------------------------------------------- *) (* --- Environments --- *) (* -------------------------------------------------------------------------- *) type env = { vars : logic Logic_var.Map.t ; (* pure : not cvar *) lhere : sigma option ; current : sigma option ; } let mk_env ?here ?(lvars=[]) () = let lvars = List.fold_left (fun lvars lv -> let x = fresh_lvar ~basename:lv.lv_name lv.lv_type in let v = Vexp(e_var x) in Logic_var.Map.add lv v lvars) Logic_var.Map.empty lvars in { lhere = here ; current = here ; vars = lvars } let getsigma = function Some s -> s | None -> Warning.error "No current memory (missing \\at)" let current e = getsigma e.current let move_at env s = { env with lhere = Some s ; current = Some s } let env_at env label = let s = if Clabels.is_here label then env.lhere else Some(mem_frame label) in { env with current = s } let mem_at env label = if Clabels.is_here label then getsigma env.lhere else mem_frame label let env_let env x v = { env with vars = Logic_var.Map.add x v env.vars } let env_letp env x p = env_let env x (Vexp (F.e_prop p)) let env_letval env x = function | Loc l -> env_let env x (Vloc l) | Val e -> env_let env x (Cvalues.plain x.lv_type e) (* -------------------------------------------------------------------------- *) (* --- Signature Generators --- *) (* -------------------------------------------------------------------------- *) let param_of_lv lv = let t = Lang.tau_of_ltype lv.lv_type in freshvar ~basename:lv.lv_name t let profile_sig lvs = List.map param_of_lv lvs , List.map (fun lv -> Sig_value lv) lvs let profile_mem l vars = let signature = profile_sig l.l_profile in if vars = [] then signature else let heap = List.fold_left (fun m x -> let obj = object_of x.vtype in M.Sigma.Chunk.Set.union m (M.domain obj (M.cvar x)) ) M.Sigma.Chunk.Set.empty vars in List.fold_left (fun acc l -> let label = Clabels.of_logic l in let sigma = Sigma.create () in M.Sigma.Chunk.Set.fold_sorted (fun chunk (parm,sigm) -> let x = Sigma.get sigma chunk in let s = Sig_chunk (chunk,label) in ( x::parm , s :: sigm ) ) heap acc ) signature l.l_labels let rec profile_env vars domain sigv = function | [] -> { vars=vars ; lhere=None ; current=None } , domain , List.rev sigv | lv :: profile -> let x = param_of_lv lv in let h = Cvalues.has_ltype lv.lv_type (e_var x) in let v = Cvalues.plain lv.lv_type (e_var x) in profile_env (Logic_var.Map.add lv v vars) (h::domain) ((lv,x)::sigv) profile let default_label env = function | [l] -> move_at env (mem_frame (Clabels.of_logic l)) | _ -> env (* -------------------------------------------------------------------------- *) (* --- Generic Compiler --- *) (* -------------------------------------------------------------------------- *) let occurs_pvars f p = Vars.exists f (F.varsp p) let occurs_ps x ps = List.exists (F.occursp x) ps let compile_step (name:string) (types:string list) (profile:logic_var list) (labels:logic_label list) (cc : env -> 'a -> 'b) (filter : 'b -> var -> bool) (data : 'a) : var list * trigger list * pred list * 'b * sig_param list = let frame = logic_frame name types in in_frame frame begin fun () -> let env,domain,sigv = profile_env Logic_var.Map.empty [] [] profile in let env = default_label env labels in let result = cc env data in let used_domain p = occurs_pvars (filter result) p in let domain = List.filter used_domain domain in let used_var (_,x) = filter result x || occurs_ps x domain in let used = List.filter used_var sigv in let parp = List.map snd used in let sigp = List.map (fun (lv,_) -> Sig_value lv) used in let (parm,sigm) = LabelMap.fold (fun label sigma acc -> M.Sigma.Chunk.Set.fold_sorted (fun chunk acc -> if filter result (Sigma.get sigma chunk) then let (parm,sigm) = acc in let x = Sigma.get sigma chunk in let s = Sig_chunk(chunk,label) in ( x::parm , s::sigm ) else acc) (Sigma.domain sigma) acc) frame.labels (parp,sigp) in parm , frame.triggers , domain , result , sigm end () let cc_term : (env -> Cil_types.term -> term) ref = ref (fun _ _ -> assert false) let cc_pred : (polarity -> env -> predicate -> pred) ref = ref (fun _ _ -> assert false) let cc_logic : (env -> Cil_types.term -> logic) ref = ref (fun _ _ -> assert false) let cc_region : (env -> unfold:bool -> Cil_types.term -> loc Sigs.region) ref = ref (fun _ ~unfold _ -> ignore unfold ; assert false) let term env t = !cc_term env t let pred polarity env t = !cc_pred polarity env t let logic env t = !cc_logic env t let region env ~unfold t = !cc_region env ~unfold t let reads env ts = List.iter (fun t -> ignore (logic env t.it_content)) ts let bootstrap_term cc = cc_term := cc let bootstrap_pred cc = cc_pred := cc let bootstrap_logic cc = cc_logic := cc let bootstrap_region cc = cc_region := cc let in_term t x = F.occurs x t let in_pred p x = F.occursp x p let in_reads _ _ = true let is_recursive l = if LogicUsage.is_recursive l then Rec else Def (* -------------------------------------------------------------------------- *) (* --- Registering User-Defined Signatures --- *) (* -------------------------------------------------------------------------- *) module Typedefs = WpContext.Index (struct type key = logic_type_info type data = unit let name = "LogicCompiler." ^ M.datatype ^ ".Typedefs" let compare = Logic_type_info.compare let pretty = Logic_type_info.pretty end) module Signature = WpContext.Index (struct type key = logic_info type data = signature let name = "LogicCompiler." ^ M.datatype ^ ".Signature" let compare = Logic_info.compare let pretty fmt l = Logic_var.pretty fmt l.l_var_info end) (* -------------------------------------------------------------------------- *) (* --- Compiling Lemmas --- *) (* -------------------------------------------------------------------------- *) let rec strip_forall xs p = match p.pred_content with | Pforall(qs,q) -> strip_forall (xs @ qs) q | _ -> xs , p let compile_lemma cluster name ~assumed types labels lemma = let qs,prop = strip_forall [] lemma in let xs,tgs,domain,prop,_ = let cc_pred = pred `Positive in compile_step name types qs labels cc_pred in_pred prop in { l_name = name ; l_types = List.length types ; l_assumed = assumed ; l_triggers = [tgs] ; l_forall = xs ; l_cluster = cluster ; l_lemma = F.p_hyps domain prop ; } (* -------------------------------------------------------------------------- *) (* --- Type Signature of Logic Function --- *) (* -------------------------------------------------------------------------- *) let type_for_signature l ldef sigp = match l.l_type with | None -> () | Some tr -> match Cvalues.ldomain tr with | None -> () | Some p -> let name = "T" ^ Lang.logic_id l in let vs = List.map e_var ldef.d_params in let rec conditions vs sigp = match vs , sigp with | v::vs , Sig_value lv :: sigp -> let cond = Cvalues.has_ltype lv.lv_type v in cond :: conditions vs sigp | _ -> [] in let result = F.e_fun ldef.d_lfun vs in let lemma = p_hyps (conditions vs sigp) (p result) in let trigger = Trigger.of_term result in Definitions.define_lemma { l_name = name ; l_assumed = true ; l_types = ldef.d_types ; l_forall = ldef.d_params ; l_triggers = [[trigger]] ; l_cluster = ldef.d_cluster ; l_lemma = lemma ; } (* -------------------------------------------------------------------------- *) (* --- Compiling Pure Logic Function --- *) (* -------------------------------------------------------------------------- *) let compile_lbpure cluster l = let lfun = ACSL l in let tau = Lang.tau_of_return l in let parp,sigp = Lang.local profile_sig l.l_profile in let ldef = { d_lfun = lfun ; d_types = List.length l.l_tparams ; d_params = parp ; d_cluster = cluster ; d_definition = Logic tau ; } in Definitions.update_symbol ldef ; Signature.update l (SIG sigp) ; parp,sigp (* -------------------------------------------------------------------------- *) (* --- Compiling Abstract Logic Function (in axiomatic with no reads) --- *) (* -------------------------------------------------------------------------- *) let compile_lbnone cluster l vars = let lfun = ACSL l in let tau = Lang.tau_of_return l in let parm,sigm = Lang.local (profile_mem l) vars in let ldef = { d_lfun = lfun ; d_types = List.length l.l_tparams ; d_params = parm ; d_cluster = cluster ; d_definition = Logic tau ; } in Definitions.define_symbol ldef ; type_for_signature l ldef sigm ; SIG sigm (* -------------------------------------------------------------------------- *) (* --- Compiling Logic Function with Reads --- *) (* -------------------------------------------------------------------------- *) let compile_lbreads cluster l ts = let lfun = ACSL l in let name = l.l_var_info.lv_name in let tau = Lang.tau_of_return l in let xs,_,_,(),s = compile_step name l.l_tparams l.l_profile l.l_labels reads in_reads ts in let ldef = { d_lfun = lfun ; d_types = List.length l.l_tparams ; d_params = xs ; d_cluster = cluster ; d_definition = Logic tau ; } in Definitions.define_symbol ldef ; type_for_signature l ldef s ; SIG s (* -------------------------------------------------------------------------- *) (* --- Compiling Recursive Logic Body --- *) (* -------------------------------------------------------------------------- *) let compile_rec name l cc filter data = let types = l.l_tparams in let profile = l.l_profile in let labels = l.l_labels in let result = compile_step name types profile labels cc filter data in if LogicUsage.is_recursive l then begin let (_,_,_,_,s) = result in Signature.update l (SIG s) ; compile_step name types profile labels cc filter data end else result (* -------------------------------------------------------------------------- *) (* --- Compiling Logic Function with Definition --- *) (* -------------------------------------------------------------------------- *) let compile_lbterm cluster l t = let name = l.l_var_info.lv_name in let tau = Lang.tau_of_return l in let xs,_,_,r,s = compile_rec name l term in_term t in match F.repr r with | Qed.Logic.Kint c -> CST c | _ -> let ldef = { d_lfun = ACSL l ; d_types = List.length l.l_tparams ; d_params = xs ; d_cluster = cluster ; d_definition = Function(tau,is_recursive l,r) ; } in Definitions.define_symbol ldef ; type_for_signature l ldef s ; SIG s (* -------------------------------------------------------------------------- *) (* --- Compiling Logic Predicate with Definition --- *) (* -------------------------------------------------------------------------- *) let compile_lbpred cluster l p = let lfun = ACSL l in let name = l.l_var_info.lv_name in let cc_pred = pred `Positive in let xs,_,_,r,s = compile_rec name l cc_pred in_pred p in let ldef = { d_lfun = lfun ; d_types = List.length l.l_tparams ; d_params = xs ; d_cluster = cluster ; d_definition = Predicate(is_recursive l,r) ; } in Definitions.define_symbol ldef ; SIG s let heap_case labels_used support = function | Sig_value _ -> support | Sig_chunk(chk,l_case) -> let l_ind = try LabelMap.find l_case labels_used with Not_found -> LabelSet.empty in let l_chk = try Heap.Map.find chk support with Not_found -> LabelSet.empty in Heap.Map.add chk (LabelSet.union l_chk l_ind) support (* -------------------------------------------------------------------------- *) (* --- Compiling Inductive Logic --- *) (* -------------------------------------------------------------------------- *) let compile_lbinduction cluster l cases = (* unused *) (* Temporarily defines l to reads only its formals *) let parp,sigp = compile_lbpure cluster l in (* Compile cases with default definition and collect used chunks *) let support = List.fold_left (fun support (case,labels,types,lemma) -> let _,_,_,_,s = let cc_pred = pred `Positive in compile_step case types [] labels cc_pred in_pred lemma in let labels_used = LogicUsage.get_induction_labels l case in List.fold_left (heap_case labels_used) support s) Heap.Map.empty cases in (* Make signature with collected chunks *) let (parm,sigm) = let frame = logic_frame l.l_var_info.lv_name l.l_tparams in in_frame frame (fun () -> Heap.Map.fold_sorted (fun chunk labels acc -> let basename = Chunk.basename_of_chunk chunk in let tau = Chunk.tau_of_chunk chunk in LabelSet.fold (fun label (parm,sigm) -> let x = Lang.freshvar ~basename tau in x :: parm , Sig_chunk(chunk,label) :: sigm ) labels acc) support (parp,sigp) ) () in (* Set global Signature *) let lfun = ACSL l in let ldef = { d_lfun = lfun ; d_types = List.length l.l_tparams ; d_params = parm ; d_cluster = cluster ; d_definition = Logic Qed.Logic.Prop ; } in Definitions.update_symbol ldef ; Signature.update l (SIG sigm) ; (* Re-compile final cases *) let cases = List.map (fun (case,labels,types,lemma) -> compile_lemma cluster ~assumed:true case types labels lemma) cases in Definitions.update_symbol { ldef with d_definition = Inductive cases } ; type_for_signature l ldef sigp (* sufficient *) ; SIG sigm let compile_logic cluster section l = let s_rec = List.map (fun x -> Sig_value x) l.l_profile in Signature.update l (SIG s_rec) ; match l.l_body with | LBnone -> let vars = match section with | Toplevel _ -> [] | Axiomatic a -> Varinfo.Set.elements a.ax_reads in if l.l_labels <> [] && vars = [] then Wp_parameters.warning ~once:true ~current:false "No definition for '%s' interpreted as reads nothing" l.l_var_info.lv_name ; compile_lbnone cluster l vars | LBterm t -> compile_lbterm cluster l t | LBpred p -> compile_lbpred cluster l p | LBreads ts -> compile_lbreads cluster l ts | LBinductive cases -> compile_lbinduction cluster l cases (* -------------------------------------------------------------------------- *) (* --- Retrieving Signature --- *) (* -------------------------------------------------------------------------- *) let define_type c t = Typedefs.update t () ; Definitions.define_type c t let define_logic c a = Signature.compile (compile_logic c a) let define_lemma c l = if l.lem_labels <> [] && Wp_parameters.has_dkey dkey_lemma then Wp_parameters.warning ~source:l.lem_position "Lemma '%s' has labels, consider using global invariant instead." l.lem_name ; Definitions.define_lemma (compile_lemma c ~assumed:l.lem_axiom l.lem_name l.lem_types l.lem_labels l.lem_property) let define_axiomatic cluster ax = begin List.iter (define_type cluster) ax.ax_types ; List.iter (define_logic cluster (Axiomatic ax)) ax.ax_logics ; List.iter (define_lemma cluster) ax.ax_lemmas ; end let lemma l = try Definitions.find_lemma l with Not_found -> let section = LogicUsage.section_of_lemma l.lem_name in let cluster = Definitions.section section in begin match section with | Toplevel _ -> define_lemma cluster l | Axiomatic ax -> define_axiomatic cluster ax end ; Definitions.find_lemma l let signature phi = try Signature.find phi with Not_found -> let section = LogicUsage.section_of_logic phi in let cluster = Definitions.section section in match section with | Toplevel _ -> Signature.memoize (compile_logic cluster section) phi | Axiomatic ax -> (* force compilation of entire axiomatics *) define_axiomatic cluster ax ; try Signature.find phi with Not_found -> Wp_parameters.fatal ~current:true "Axiomatic '%s' compiled, but '%a' not" ax.ax_name Printer.pp_logic_var phi.l_var_info let rec logic_type t = match Logic_utils.unroll_type ~unroll_typedef:false t with | Ctype _ -> () | Linteger | Lreal | Lvar _ | Larrow _ -> () | Ltype(lt,ps) -> List.iter logic_type ps ; if not (Typedefs.mem lt) then begin Typedefs.update lt () ; if not (Lang.is_builtin lt) && not (Logic_const.is_boolean_type t) then let section = LogicUsage.section_of_type lt in let cluster = Definitions.section section in match section with | Toplevel _ -> define_type cluster lt | Axiomatic ax -> (* force compilation of entire axiomatics *) define_axiomatic cluster ax end let logic_profile phi = begin List.iter (fun x -> logic_type x.lv_type) phi.l_profile ; Extlib.may logic_type phi.l_type ; end (* -------------------------------------------------------------------------- *) (* --- Binding Formal with Actual w.r.t Signature --- *) (* -------------------------------------------------------------------------- *) let rec bind_labels env phi_labels labels : M.Sigma.t LabelMap.t = match phi_labels, labels with | [], [] -> LabelMap.empty | l1 :: phi_labels, l2 :: labels -> let l1 = Clabels.of_logic l1 in let l2 = Clabels.of_logic l2 in LabelMap.add l1 (mem_at env l2) (bind_labels env phi_labels labels) | _ -> Wp_parameters.fatal "Incorrect by AST typing" let call_params env (phi:logic_info) (labels:logic_label list) (sparam : sig_param list) (parameters:F.term list) : F.term list = logic_profile phi ; let mparams = wrap_lvar phi.l_profile parameters in let mlabels = bind_labels env phi.l_labels labels in List.map (function | Sig_value lv -> Logic_var.Map.find lv mparams | Sig_chunk(c,l) -> let sigma = try LabelMap.find l mlabels with Not_found -> Wp_parameters.fatal "*** Label %a not-found@." Clabels.pretty l in M.Sigma.value sigma c ) sparam let call_fun env (phi:logic_info) (labels:logic_label list) (parameters:F.term list) : F.term = match signature phi with | CST c -> e_zint c | SIG sparam -> let es = call_params env phi labels sparam parameters in F.e_fun (ACSL phi) es let call_pred env (phi:logic_info) (labels:logic_label list) (parameters:F.term list) : F.pred = match signature phi with | CST _ -> assert false | SIG sparam -> let es = call_params env phi labels sparam parameters in F.p_call (ACSL phi) es (* -------------------------------------------------------------------------- *) (* --- Variable Bindings --- *) (* -------------------------------------------------------------------------- *) let logic_var env x = try Logic_var.Map.find x env.vars with Not_found -> try (** It is here because currently the application of a function of arity 0 are represented in the AST as a variable not as an application of the function with no arguments *) let cst = Logic_env.find_logic_cons x in let v = match LogicBuiltins.logic cst with | ACSLDEF -> call_fun env cst [] [] | HACK phi -> phi [] | LFUN phi -> e_fun phi [] ~result:(Lang.tau_of_ltype x.lv_type) in Cvalues.plain x.lv_type v with Not_found -> if Logic_env.is_logic_function x.lv_name then Warning.error "Lambda-functions not yet implemented (at '%s')" x.lv_name else Wp_parameters.fatal "Name '%a' has no definition in term" Printer.pp_logic_var x let logic_info env f = try match Logic_var.Map.find f.l_var_info env.vars with | Vexp p -> Some (F.p_bool p) | _ -> Wp_parameters.fatal "Variable '%a' is not a predicate" Logic_info.pretty f with Not_found -> None end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/LogicCompiler.mli�����������������������������������������������0000666�0000000�0000000�00000011045�13571573400�017345� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Compilation of ACSL Logic-Info --- *) (* -------------------------------------------------------------------------- *) open LogicUsage open Cil_types open Cil_datatype open Clabels open Lang open Lang.F open Sigs open Definitions type polarity = [ `Positive | `Negative | `NoPolarity ] module Make( M : Sigs.Model ) : sig (** {3 Definitions} *) type value = M.loc Sigs.value type logic = M.loc Sigs.logic type result = M.loc Sigs.result type sigma = M.Sigma.t type chunk = M.Chunk.t (** {3 Frames} *) type call type frame val pp_frame : Format.formatter -> frame -> unit val local : descr:string -> frame val frame : kernel_function -> frame val call : ?result:M.loc -> kernel_function -> value list -> call val call_pre : sigma -> call -> sigma -> frame val call_post : sigma -> call -> sigma sequence -> frame val mk_frame : ?kf:Cil_types.kernel_function -> ?result:result -> ?status:Lang.F.var -> ?formals:value Varinfo.Map.t -> ?labels:sigma Clabels.LabelMap.t -> ?descr:string -> unit -> frame val formal : varinfo -> value option val return : unit -> typ val result : unit -> result val status : unit -> var val trigger : trigger -> unit val guards : frame -> pred list val mem_frame : c_label -> sigma val mem_at_frame : frame -> c_label -> sigma val set_at_frame : frame -> c_label -> sigma -> unit val in_frame : frame -> ('a -> 'b) -> 'a -> 'b val get_frame : unit -> frame (** {3 Environment} *) type env val mk_env : ?here:sigma -> ?lvars:Logic_var.t list -> unit -> env val current : env -> sigma val move_at : env -> sigma -> env val env_at : env -> c_label -> env val mem_at : env -> c_label -> sigma val env_let : env -> logic_var -> logic -> env val env_letp : env -> logic_var -> pred -> env val env_letval : env -> logic_var -> value -> env (** {3 Compiler} *) val term : env -> Cil_types.term -> term val pred : polarity -> env -> predicate -> pred val logic : env -> Cil_types.term -> logic val region : env -> unfold:bool -> Cil_types.term -> M.loc Sigs.region (** When [~unfold:true], decompose compound regions field by field *) val bootstrap_term : (env -> Cil_types.term -> term) -> unit val bootstrap_pred : (polarity -> env -> predicate -> pred) -> unit val bootstrap_logic : (env -> Cil_types.term -> logic) -> unit val bootstrap_region : (env -> unfold:bool -> Cil_types.term -> M.loc Sigs.region) -> unit (** {3 Application} *) val call_fun : env -> logic_info -> logic_label list -> F.term list -> F.term val call_pred : env -> logic_info -> logic_label list -> F.term list -> F.pred (** {3 Logic Variable and ACSL Constants} *) val logic_var : env -> logic_var -> logic val logic_info : env -> logic_info -> pred option (** {3 Logic Lemmas} *) val lemma : logic_lemma -> dlemma end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/LogicSemantics.ml�����������������������������������������������0000666�0000000�0000000�00000121220�13571573400�017345� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- ACSL Translation --- *) (* --- LogicSemantics and LogicCompiler are mutually recursive (cycle --- *) (* --- closed by "boostrap*" function --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype open LogicBuiltins open Clabels open Ctypes open Lang open Lang.F open Definitions open Sigs module Make(M : Sigs.Model) = struct module M = M open M type loc = M.loc type value = loc Sigs.value type logic = loc Sigs.logic type result = loc Sigs.result type region = loc Sigs.region type sigma = Sigma.t module L = Cvalues.Logic(M) module C = LogicCompiler.Make(M) (* -------------------------------------------------------------------------- *) (* --- Frames --- *) (* -------------------------------------------------------------------------- *) type call = C.call type frame = C.frame let pp_frame = C.pp_frame let get_frame = C.get_frame let mk_frame = C.mk_frame let in_frame = C.in_frame let mem_frame = C.mem_frame let mem_at_frame = C.mem_at_frame let set_at_frame = C.set_at_frame let mem_at = C.mem_at let env_at = C.env_at let local = C.local let frame = C.frame let call = C.call let call_pre = C.call_pre let call_post = C.call_post let return = C.return let result = C.result let status = C.status let guards = C.guards (* -------------------------------------------------------------------------- *) (* --- Translation Environment & Recursion --- *) (* -------------------------------------------------------------------------- *) type env = C.env let mk_env = C.mk_env let move_at = C.move_at let current = C.current let logic_of_value = function | Val e -> Vexp e | Loc l -> Vloc l let loc_of_term env t = match C.logic env t with | Vexp e -> M.pointer_loc e | Vloc l -> l | _ -> Warning.error "Non-expected set of locations (%a)" Printer.pp_term t let val_of_term env t = match C.logic env t with | Vexp e -> e | Vloc l -> M.pointer_val l | Vset s -> Vset.concretize s | Lset _ -> Warning.error "Non-expected set of values (%a)" Printer.pp_term t let set_of_term env t = L.vset (C.logic env t) let collection_of_term env t = let v = C.logic env t in match v with | Vexp s when Logic_typing.is_set_type t.term_type -> let te = Logic_typing.type_of_set_elem t.term_type in Vset [Vset.Set(tau_of_ltype te,s)] | w -> w let term env t = match C.logic env t with | Vexp e -> e | Vloc l -> M.pointer_val l | s -> Vset.concretize (L.vset s) (* -------------------------------------------------------------------------- *) (* --- Accessing an Offset (sub field-index in a compound) --- *) (* -------------------------------------------------------------------------- *) let rec access_offset env (v:logic) = function | TNoOffset -> v | TModel _ -> Wp_parameters.not_yet_implemented "Model field" | TField(f,offset) -> let v_f = L.map (fun r -> e_getfield r (Cfield f)) v in access_offset env v_f offset | TIndex(k,offset) -> let rk = C.logic env k in let v_k = L.apply e_get v rk in access_offset env v_k offset (* -------------------------------------------------------------------------- *) (* --- Updating an Offset (sub field-index in a compound) --- *) (* -------------------------------------------------------------------------- *) let rec update_offset env (r:term) offset (v:term) = match offset with | TNoOffset -> v | TModel _ -> Wp_parameters.not_yet_implemented "Model field" | TField(f,offset) -> let r_f = e_getfield r (Cfield f) in let r_fv = update_offset env r_f offset v in e_setfield r (Cfield f) r_fv | TIndex(k,offset) -> let k = val_of_term env k in let r_kv = update_offset env (e_get r k) offset v in e_set r k r_kv (* -------------------------------------------------------------------------- *) (* --- Shifting Location of an Offset (pointer shift) --- *) (* -------------------------------------------------------------------------- *) (* typ is logic-type of (load v) *) let rec logic_offset env typ (v:logic) = function | TNoOffset -> typ , v | TModel _ -> Wp_parameters.not_yet_implemented "Model field" | TField(f,offset) -> logic_offset env f.ftype (L.field v f) offset | TIndex(k,offset) -> let te = Cil.typeOf_array_elem typ in let size = Ctypes.get_array_size (Ctypes.object_of typ) in let obj = Ctypes.object_of te in let vloc = L.shift v obj ?size (C.logic env k) in logic_offset env te vloc offset (* -------------------------------------------------------------------------- *) (* --- Logic Variable --- *) (* -------------------------------------------------------------------------- *) type lv_value = | VAL of logic | VAR of varinfo let logic_var env lv = match lv.lv_origin with | None -> VAL (C.logic_var env lv) | Some x -> if x.vformal then match C.formal x with | Some v -> VAL (logic_of_value v) | None -> VAR x else VAR x (* -------------------------------------------------------------------------- *) (* --- Term L-Values (this means 'loading' the l-value) --- *) (* -------------------------------------------------------------------------- *) let load_loc env typ loc loffset = let te,lp = logic_offset env typ (Vloc loc) loffset in L.load (C.current env) (Ctypes.object_of te) lp let term_lval env (lhost,loffset) = match lhost with | TResult ty -> begin match C.result () with | Sigs.R_var x -> access_offset env (Vexp (e_var x)) loffset | Sigs.R_loc l -> load_loc env ty l loffset end | TMem e -> let te = Logic_typing.ctype_of_pointed e.term_type in let te , lp = logic_offset env te (C.logic env e) loffset in L.load (C.current env) (Ctypes.object_of te) lp | TVar{lv_name="\\exit_status"} -> assert (loffset = TNoOffset) ; (* int ! *) Vexp (e_var (C.status ())) | TVar lv -> begin match logic_var env lv with | VAL v -> access_offset env v loffset | VAR x -> load_loc env x.vtype (M.cvar x) loffset end (* -------------------------------------------------------------------------- *) (* --- Address of L-Values --- *) (* -------------------------------------------------------------------------- *) let logic_lval env (lhost,loffset) = match lhost with | TResult ty -> begin match C.result () with | R_loc l -> logic_offset env ty (Vloc l) loffset | R_var _ -> Wp_parameters.abort ~current:true "Address of \\result" end | TMem e -> let te = Logic_typing.ctype_of_pointed e.term_type in logic_offset env te (C.logic env e) loffset | TVar lv -> begin match logic_var env lv with | VAL v -> Wp_parameters.abort ~current:true "Address of logic value (%a)@." (Cvalues.pp_logic M.pretty) v | VAR x -> logic_offset env x.vtype (Vloc (M.cvar x)) loffset end let addr_lval env lv = snd (logic_lval env lv) let lval env lv = let te,ve = logic_lval env lv in match ve with | Vexp e -> te , M.pointer_loc e | Vloc l -> te , l | _ -> Wp_parameters.abort ~current:true "Unexpected set (%a)" Printer.pp_term_lval lv (* -------------------------------------------------------------------------- *) (* --- Unary Operators --- *) (* -------------------------------------------------------------------------- *) (* Only integral *) let term_unop = function | Neg -> L.map_opp | BNot -> L.map Cint.l_not | LNot -> L.map e_not (* -------------------------------------------------------------------------- *) (* --- Equality --- *) (* -------------------------------------------------------------------------- *) type eqsort = | EQ_set | EQ_loc | EQ_plain | EQ_float of c_float | EQ_array of Matrix.matrix | EQ_comp of compinfo | EQ_incomparable let eqsort_of_type t = match Logic_utils.unroll_type ~unroll_typedef:false t with | Ltype({lt_name="set"},[_]) -> EQ_set | Linteger | Lreal | Lvar _ | Larrow _ | Ltype _ -> EQ_plain | Ctype t -> match Ctypes.object_of t with | C_pointer _ -> EQ_loc | C_int _ -> EQ_plain | C_float f -> EQ_float f | C_comp c -> EQ_comp c | C_array a -> EQ_array (Matrix.of_array a) let eqsort_of_comparison a b = match eqsort_of_type a.term_type , eqsort_of_type b.term_type with | EQ_set , _ | _ , EQ_set -> EQ_set | EQ_loc , EQ_loc -> EQ_loc | EQ_comp c1 , EQ_comp c2 -> if Compinfo.equal c1 c2 then EQ_comp c1 else EQ_incomparable | EQ_array (t1,d1) , EQ_array (t2,d2) -> if Ctypes.equal t1 t2 then match Matrix.merge d1 d2 with | Some d -> EQ_array(t1,d) | None -> EQ_incomparable else EQ_incomparable | EQ_plain , EQ_plain -> EQ_plain | EQ_float f1 , EQ_float f2 when f1 = f2 -> EQ_float f1 | _ -> EQ_incomparable let use_equal = function | `Negative -> Wp_parameters.ExtEqual.get () | `Positive | `NoPolarity -> false let term_equal polarity env a b = match eqsort_of_comparison a b with | EQ_set -> let sa = set_of_term env a in let sb = set_of_term env b in (* TODO: should be parametric in the equality of elements *) Vset.equal sa sb | EQ_loc -> let la = loc_of_term env a in let lb = loc_of_term env b in M.loc_eq la lb | EQ_comp c -> let va = val_of_term env a in let vb = val_of_term env b in if use_equal polarity then p_equal va vb else Cvalues.equal_comp c va vb | EQ_array m -> let va = val_of_term env a in let vb = val_of_term env b in if use_equal polarity then p_equal va vb else Cvalues.equal_array m va vb | EQ_float f -> Cfloat.feq f (val_of_term env a) (val_of_term env b) | EQ_plain -> p_equal (val_of_term env a) (val_of_term env b) | EQ_incomparable -> (* incomparable terms *) Warning.error "@[Incomparable terms:@ type %a with@ type %a@]" Printer.pp_logic_type a.term_type Printer.pp_logic_type b.term_type let term_diff polarity env a b = p_not (term_equal (Cvalues.negate polarity) env a b) let float_of_logic_type lt = match Logic_utils.unroll_type lt with | Ctype ty -> (match Cil.unrollType ty with | TFloat(f,_) -> Some (Ctypes.c_float f) | _ -> None) | _ -> None let compare_term env vrel lrel frel a b = if Logic_typing.is_pointer_type a.term_type then lrel (loc_of_term env a) (loc_of_term env b) else match float_of_logic_type a.term_type with | Some f -> frel f (val_of_term env a) (val_of_term env b) | None -> vrel (val_of_term env a) (val_of_term env b) (* -------------------------------------------------------------------------- *) (* --- Term Comparison --- *) (* -------------------------------------------------------------------------- *) let exp_equal env a b = Vexp(e_prop (term_equal `NoPolarity env a b)) let exp_diff env a b = Vexp(e_prop (term_diff `NoPolarity env a b)) let exp_compare env vrel lrel frel a b = Vexp(e_prop (compare_term env vrel lrel frel a b)) (* -------------------------------------------------------------------------- *) (* --- Binary Operators --- *) (* -------------------------------------------------------------------------- *) let toreal t v = if t then L.map Cmath.real_of_int v else v let arith env fint freal a b = let va = C.logic env a in let vb = C.logic env b in let ta = Logic_typing.is_integral_type a.term_type in let tb = Logic_typing.is_integral_type b.term_type in if ta && tb then fint va vb else freal (toreal ta va) (toreal tb vb) let rec fold_assoc bop acc ts = match ts with | [] -> acc | t::others -> match t.term_node with | TBinOp(binop,a,b) when bop == binop -> fold_assoc bop acc (a::b::others) | _ -> fold_assoc bop (t::acc) others let term_binop env binop a b = match binop with | PlusA -> arith env L.apply_add (L.apply F.e_add) a b | MinusA -> arith env L.apply_sub (L.apply F.e_sub) a b | Mult -> arith env (L.apply e_mul) (L.apply F.e_mul) a b | Div -> arith env (L.apply e_div) (L.apply F.e_div) a b | Mod -> L.apply e_mod (C.logic env a) (C.logic env b) | PlusPI | IndexPI -> let va = C.logic env a in let vb = C.logic env b in let te = Logic_typing.ctype_of_pointed a.term_type in L.shift va (Ctypes.object_of te) vb | MinusPI -> let va = C.logic env a in let vb = C.logic env b in let te = Logic_typing.ctype_of_pointed a.term_type in L.shift va (Ctypes.object_of te) (L.map_opp vb) | MinusPP -> let te = Logic_typing.ctype_of_pointed a.term_type in let la = loc_of_term env a in let lb = loc_of_term env b in Vexp(M.loc_diff (Ctypes.object_of te) la lb) | Shiftlt -> L.apply Cint.l_lsl (C.logic env a) (C.logic env b) | Shiftrt -> L.apply Cint.l_lsr (C.logic env a) (C.logic env b) | BAnd -> L.apply Cint.l_and (C.logic env a) (C.logic env b) | BXor -> L.apply Cint.l_xor (C.logic env a) (C.logic env b) | BOr -> L.apply Cint.l_or (C.logic env a) (C.logic env b) | LAnd -> Vexp(e_and (List.map (val_of_term env) (fold_assoc LAnd [] [a;b]))) | LOr -> Vexp(e_or (List.map (val_of_term env) (fold_assoc LOr [] [a;b]))) | Lt -> exp_compare env p_lt M.loc_lt Cfloat.flt a b | Gt -> exp_compare env p_lt M.loc_lt Cfloat.flt b a | Le -> exp_compare env p_leq M.loc_leq Cfloat.fle a b | Ge -> exp_compare env p_leq M.loc_leq Cfloat.fle b a | Eq -> exp_equal env a b | Ne -> exp_diff env a b (* -------------------------------------------------------------------------- *) (* --- Term Cast --- *) (* -------------------------------------------------------------------------- *) type cvsort = | L_bool | L_real | L_integer | L_cint of c_int | L_cfloat of c_float | L_pointer of typ | L_array of arrayinfo let rec cvsort_of_ltype src_ltype = match Logic_utils.unroll_type ~unroll_typedef:false src_ltype with | Linteger -> L_integer | Lreal -> L_real | Ctype src_ctype -> begin match Ctypes.object_of src_ctype with | C_int i -> L_cint i | C_float f -> L_cfloat f | C_pointer te -> L_pointer te | C_array a -> L_array a (* into the logic, C array = logic array *) | C_comp c when c.cstruct -> Warning.error "@[Logic cast from struct (%a) not implemented yet@]" Printer.pp_typ src_ctype | C_comp _ -> Warning.error "@[Logic cast from union (%a) not implemented yet@]" Printer.pp_typ src_ctype end | Ltype _ as b when Logic_const.is_boolean_type b -> L_bool | Ltype({lt_name="set"},[elt_ltype]) -> (* lifting or set of elements ? *) cvsort_of_ltype elt_ltype | (Ltype _ | Lvar _ | Larrow _) as typ -> Warning.error "@[Logic cast from (%a) not implemented yet@]" Printer.pp_logic_type typ (** cast to a C type *) let term_cast_to_ctype env dst_ctype t = let cast_ptr ty t0 = let value = C.logic env t in let o_src = Ctypes.object_of t0 in let o_dst = Ctypes.object_of ty in if Ctypes.compare o_src o_dst = 0 then value else L.map_loc (M.cast { pre=o_src ; post=o_dst }) value in match Ctypes.object_of dst_ctype , cvsort_of_ltype t.term_type with (* Cast to C integers from ...*) | C_int _ , L_bool -> L.map Cvalues.bool_val (C.logic env t) | C_int i , L_cint i0 -> let v = C.logic env t in if (Ctypes.sub_c_int i0 i) then v else L.map (Cint.convert i) v | C_int i , L_integer -> L.map (Cint.convert i) (C.logic env t) | C_int i , L_pointer _ -> L.map_l2t (M.int_of_loc i) (C.logic env t) | C_int i , L_real -> L.map (Cint.of_real i) (C.logic env t) | C_int i , L_cfloat f -> L.map (fun v -> Cint.of_real i (Cfloat.real_of_float f v)) (C.logic env t) | C_int _, L_array _ -> Warning.error "@[Logic cast to sized integer (%a) from (%a) not implemented yet@]" Printer.pp_typ dst_ctype Printer.pp_logic_type t.term_type (* Cast to C float from ... *) | C_float f , L_real -> L.map (Cfloat.float_of_real f) (C.logic env t) | C_float ft, L_cfloat ff -> let map v = if Ctypes.equal_float ff ft then v else Cfloat.float_of_real ft (Cfloat.real_of_float ff v) in L.map map (C.logic env t) | C_float f , (L_cint _ | L_integer) -> L.map (Cfloat.float_of_int f) (C.logic env t) | C_float _, (L_bool|L_pointer _|L_array _) -> Warning.error "@[Logic cast to float (%a) from (%a) not implemented yet@]" Printer.pp_typ dst_ctype Printer.pp_logic_type t.term_type (* Cast to C pointer from ... *) | C_pointer ty , (L_integer | L_cint _) -> let obj = Ctypes.object_of ty in L.map_t2l (M.loc_of_int obj) (C.logic env t) | C_pointer ty , L_pointer t0 -> cast_ptr ty t0 | C_pointer _, (L_bool|L_real|L_cfloat _|L_array _) -> Warning.error "@[Logic cast to pointer (%a) from (%a) not implemented yet@]" Printer.pp_typ dst_ctype Printer.pp_logic_type t.term_type (* Cast to C array from ... *) | C_array _, L_pointer t0 -> (* cast to an array `(T[])(p)` is equivalent to a deref of a cast to a pointer `*(T( * )[])(p)` *) let cast = cast_ptr dst_ctype t0 in L.load (C.current env) (Ctypes.object_of dst_ctype) cast | C_array dst_arr_info, L_array src_arr_info when Ctypes.AinfoComparable.equal dst_arr_info src_arr_info -> (* cast from/to the same type *) C.logic env t | C_array {arr_flat=Some _}, (L_integer|L_cint _|L_bool|L_real|L_cfloat _|L_array _) -> Warning.error "@[Logic cast to sized array (%a) from (%a) not implemented yet@]" Printer.pp_typ dst_ctype Printer.pp_logic_type t.term_type | C_array {arr_flat=None}, (L_integer|L_cint _|L_bool|L_real|L_cfloat _|L_array _) -> Warning.error "@[Logic cast to unsized array (%a) from (%a) not implemented yet@]" Printer.pp_typ dst_ctype Printer.pp_logic_type t.term_type (* Cast to C compound from ... *) | C_comp c, (L_integer|L_cint _|L_bool|L_real|L_cfloat _|L_array _|L_pointer _) when c.cstruct -> Warning.error "@[Logic cast to struct (%a) from (%a) not implemented yet@]" Printer.pp_typ dst_ctype Printer.pp_logic_type t.term_type | C_comp _, (L_integer|L_cint _|L_bool|L_real|L_cfloat _|L_array _|L_pointer _) -> Warning.error "@[Logic cast to union (%a) from (%a) not implemented yet@]" Printer.pp_typ dst_ctype Printer.pp_logic_type t.term_type let term_cast_to_real env t = let src_ltype = Logic_utils.unroll_type ~unroll_typedef:false t.term_type in match cvsort_of_ltype src_ltype with | L_cint _ -> L.map (fun x -> Cmath.real_of_int (Cint.to_integer x)) (C.logic env t) | L_integer -> L.map Cmath.real_of_int (C.logic env t) | L_cfloat f -> L.map (Cfloat.real_of_float f) (C.logic env t) | L_real -> C.logic env t | L_bool|L_pointer _|L_array _ -> Warning.error "@[Logic cast from (%a) to (%a) not implemented yet@]" Printer.pp_logic_type src_ltype Printer.pp_logic_type Lreal let term_cast_to_integer env t = let src_ltype = Logic_utils.unroll_type ~unroll_typedef:false t.term_type in match cvsort_of_ltype src_ltype with | L_real -> L.map Cmath.int_of_real (C.logic env t) | L_cint _ -> L.map Cint.to_integer (C.logic env t) | L_integer -> C.logic env t | L_cfloat f -> L.map (fun x -> Cmath.int_of_real (Cfloat.real_of_float f x)) (C.logic env t) | L_bool -> L.map Cmath.bool_of_int (C.logic env t) | L_pointer _|L_array _ -> Warning.error "@[Logic cast from (%a) to (%a) not implemented yet@]" Printer.pp_logic_type src_ltype Printer.pp_logic_type Linteger let term_cast_to_boolean env t = let src_ltype = Logic_utils.unroll_type ~unroll_typedef:false t.term_type in match cvsort_of_ltype src_ltype with | L_bool -> C.logic env t | L_integer | L_cint _ -> L.map Cmath.int_of_bool (C.logic env t) | L_real | L_cfloat _ | L_pointer _ | L_array _ -> Warning.error "@[Logic cast from (%a) to (%a) not implemented yet@]" Printer.pp_logic_type src_ltype Printer.pp_logic_type Logic_const.boolean_type let rec term_cast_to_ltype env dst_ltype t = match Logic_utils.unroll_type ~unroll_typedef:false dst_ltype with | Ctype typ-> term_cast_to_ctype env typ t | Linteger -> term_cast_to_integer env t | Lreal -> term_cast_to_real env t | Ltype _ as b when Logic_const.is_boolean_type b -> term_cast_to_boolean env t | Ltype({lt_name="set"},[elt_ltype]) -> (* lifting, set of elements ? *) term_cast_to_ltype env elt_ltype t | (Ltype _ | Lvar _ | Larrow _) as dst_ltype -> let src_ltype = Logic_utils.unroll_type ~unroll_typedef:false t.term_type in Warning.error "@[Logic cast to (%a) from (%a) not implemented yet@]" Printer.pp_logic_type dst_ltype Printer.pp_logic_type src_ltype (* -------------------------------------------------------------------------- *) (* --- Environment Binding --- *) (* -------------------------------------------------------------------------- *) let bind_quantifiers (env:env) qs = let rec acc xs env hs = function | [] -> List.rev xs , env , hs | v::vs -> let t = Lang.tau_of_ltype v.lv_type in let x = Lang.freshvar ~basename:v.lv_name t in let h = if Wp_parameters.SimplifyForall.get () then F.p_true else Cvalues.has_ltype v.lv_type (e_var x) in let e = C.env_let env v (Vexp (e_var x)) in acc (x::xs) e (h::hs) vs in acc [] env [] qs (* -------------------------------------------------------------------------- *) (* --- Undefined Term --- *) (* -------------------------------------------------------------------------- *) let term_undefined t = let x = Lang.freshvar ~basename:"w" (Lang.tau_of_ltype t.term_type) in Cvalues.plain t.term_type (e_var x) (* -------------------------------------------------------------------------- *) (* --- Term Nodes --- *) (* -------------------------------------------------------------------------- *) let term_node (env:env) t = match t.term_node with | TConst c -> Vexp (Cvalues.logic_constant c) | TSizeOf _ | TSizeOfE _ | TSizeOfStr _ | TAlignOf _ | TAlignOfE _ -> Vexp (Cvalues.constant_term t) | TLval lval -> if Cil.isVolatileTermLval lval && Cvalues.volatile ~warn:"unsafe volatile access to (term) l-value" () then term_undefined t else term_lval env lval | TAddrOf lval -> addr_lval env lval | TStartOf lval -> begin let lt = Cil.typeOfTermLval lval in let base = addr_lval env lval in match Logic_utils.unroll_type lt with | Ctype ct -> L.map_loc (fun l -> Cvalues.startof ~shift:M.shift l ct) base | _ -> base end | TUnOp(Neg,t) when not (Logic_typing.is_integral_type t.term_type) -> L.map F.e_opp (C.logic env t) | TUnOp(unop,t) -> term_unop unop (C.logic env t) | TBinOp(binop,a,b) -> term_binop env binop a b | TCastE(ty,t) -> term_cast_to_ctype env ty t | TLogic_coerce(typ,t) -> term_cast_to_ltype env typ t | Tapp(f,ls,ts) -> let vs = List.map (val_of_term env) ts in let r = match LogicBuiltins.logic f with | ACSLDEF -> C.call_fun env f ls vs | HACK phi -> phi vs | LFUN f -> e_fun f vs ~result:(Lang.tau_of_ltype t.term_type) in Vexp r | Tlambda _ -> Warning.error "Lambda-functions not yet implemented" | TDataCons({ctor_name="\\true"},_) -> Vexp(e_true) | TDataCons({ctor_name="\\false"},_) -> Vexp(e_false) | TDataCons(c,ts) -> let es = List.map (val_of_term env) ts in let r = match LogicBuiltins.ctor c with | ACSLDEF -> e_fun (CTOR c) es | HACK phi -> phi es | LFUN f -> e_fun f es ~result:(Lang.tau_of_ltype t.term_type) in Vexp r | Tif( cond , a , b ) -> let c = val_of_term env cond in let a = val_of_term env a in let b = val_of_term env b in Vexp (e_if c a b) | Tat( t , label ) -> let clabel = Clabels.of_logic label in C.logic (C.env_at env clabel) t | Tbase_addr (label,t) -> ignore label ; L.map_loc M.base_addr (C.logic env t) | Toffset (label,t) -> ignore label ; L.map_l2t M.base_offset (C.logic env t) | Tblock_length (label,t) -> let obj = object_of (Logic_typing.ctype_of_pointed t.term_type) in let sigma = C.mem_at env (of_logic label) in L.map_l2t (M.block_length sigma obj) (C.logic env t) | Tnull -> Vloc M.null | TUpdate(a,offset,b) -> Vexp (update_offset env (val_of_term env a) offset (val_of_term env b)) | Tempty_set -> Vset [] | Tunion ts -> L.union t.term_type (List.map (collection_of_term env) ts) | Tinter ts -> L.inter t.term_type (List.map (collection_of_term env) ts) | Tcomprehension(t,qs,cond) -> begin let xs,env,domain = bind_quantifiers env qs in let condition = match cond with | None -> p_conj domain | Some p -> let cc = C.pred `NoPolarity env in let p = Lang.without_assume cc p in p_conj (p :: domain) in match C.logic env t with | Vexp e -> Vset[Vset.Descr(xs,e,condition)] | Vloc l -> Lset[Sdescr(xs,l,condition)] | _ -> Wp_parameters.fatal "comprehension set of sets" end | Tlet( { l_var_info=v ; l_body=LBterm a } , b ) -> let va = C.logic env a in C.logic (C.env_let env v va) b | Tlet _ -> Warning.error "Complex let-binding not implemented yet (%a)" Printer.pp_term t | Trange(a,b) -> let bound env = function | None -> None | Some x -> Some (val_of_term env x) in Vset(Vset.range (bound env a) (bound env b)) | Ttypeof _ | Ttype _ -> Warning.error "Type tag not implemented yet" (* -------------------------------------------------------------------------- *) (* --- Separated --- *) (* -------------------------------------------------------------------------- *) let separated_terms env ts = L.separated begin List.map (fun t -> let te = Logic_typing.ctype_of_pointed t.term_type in let obj = Ctypes.object_of te in L.region obj (C.logic env t) ) ts end (* -------------------------------------------------------------------------- *) (* --- Relations --- *) (* -------------------------------------------------------------------------- *) let relation polarity env rel a b = match rel with | Rlt -> compare_term env p_lt M.loc_lt Cfloat.flt a b | Rgt -> compare_term env p_lt M.loc_lt Cfloat.flt b a | Rle -> compare_term env p_leq M.loc_leq Cfloat.fle a b | Rge -> compare_term env p_leq M.loc_leq Cfloat.fle b a | Req -> term_equal polarity env a b | Rneq -> term_diff polarity env a b (* -------------------------------------------------------------------------- *) (* --- Predicates --- *) (* -------------------------------------------------------------------------- *) let valid env acs label t = let te = Logic_typing.ctype_of_pointed t.term_type in let sigma = C.mem_at env (Clabels.of_logic label) in let addrs = C.logic env t in p_all (L.valid sigma acs) (L.region (Ctypes.object_of te) addrs) let predicate polarity env p = match p.pred_content with | Pfalse -> p_false | Ptrue -> p_true | Pseparated ts -> separated_terms env ts | Prel(rel,a,b) -> relation polarity env rel a b | Pand(a,b) -> p_and (C.pred polarity env a) (C.pred polarity env b) | Por(a,b) -> p_or (C.pred polarity env a) (C.pred polarity env b) | Pxor(a,b) -> p_not (p_equiv (C.pred `NoPolarity env a) (C.pred `NoPolarity env b)) | Pimplies(a,b) -> let negated = Cvalues.negate polarity in p_imply (C.pred negated env a) (C.pred polarity env b) | Piff(a,b) -> p_equiv (C.pred `NoPolarity env a) (C.pred `NoPolarity env b) | Pnot a -> p_not (C.pred (Cvalues.negate polarity) env a) | Pif(t,a,b) -> p_if (p_bool (val_of_term env t)) (C.pred polarity env a) (C.pred polarity env b) | Papp({l_var_info = {lv_name = "\\subset"}},_,ts) -> begin match ts with | [a;b] -> L.subset a.term_type (C.logic env a) b.term_type (C.logic env b) | _ -> Warning.error "\\subset requires 2 arguments" end | Papp(f,ls,ts) -> begin match C.logic_info env f with | Some p -> if ls <> [] || ts <> [] then Warning.error "Unexpected parameters for named predicate '%a'" Logic_info.pretty f ; p | None -> let empty ls = if ls <> [] then Warning.error "Unexpected labels for purely logic '%a'" Logic_info.pretty f ; in let es = List.map (val_of_term env) ts in match LogicBuiltins.logic f with | ACSLDEF -> C.call_pred env f ls es | HACK phi -> empty ls ; F.p_bool (phi es) | LFUN p -> empty ls ; p_call p es end | Plet( { l_var_info=v ; l_body=LBterm a } , p ) -> let va = C.logic env a in C.pred polarity (C.env_let env v va) p | Plet( { l_var_info=v ; l_body=LBpred q } , p ) -> let vq = C.pred `NoPolarity env q in C.pred polarity (C.env_letp env v vq) p | Plet _ -> Warning.error "Complex let-inding not implemented yet (%a)" Printer.pp_predicate p | Pforall(qs,p) -> let xs,env,hs = bind_quantifiers env qs in let p = Lang.without_assume (C.pred polarity env) p in p_forall xs (p_hyps hs p) | Pexists(qs,p) -> let xs,env,hs = bind_quantifiers env qs in let p = Lang.without_assume (C.pred polarity env) p in p_exists xs (p_conj (p :: hs)) | Pat(p,label) -> let clabel = Clabels.of_logic label in C.pred polarity (C.env_at env clabel) p | Pvalid(label,t) -> valid env RW label t | Pvalid_read(label,t) -> valid env RD label t | Pvalid_function _t -> Warning.error "\\valid_function not yet implemented@\n\ @[<hov 0>(%a)@]" Printer.pp_predicate p | Pallocable _ | Pfreeable _ | Pfresh _ | Pinitialized _ | Pdangling _-> Warning.error "Allocation, initialization and danglingness not yet implemented@\n\ @[<hov 0>(%a)@]" Printer.pp_predicate p (* -------------------------------------------------------------------------- *) (* --- Set of locations for a term representing a set of l-values --- *) (* -------------------------------------------------------------------------- *) let rec compound_offsets = function | C_comp comp when comp.cstruct -> List.fold_left (fun offsets fd -> List.fold_left (fun offsets (obj,ofs) -> (obj , TField(fd,ofs)) :: offsets ) offsets (compound_offsets (Ctypes.object_of fd.ftype)) ) [] comp.cfields | obj -> [obj , TNoOffset] let assignable_lval env ~unfold lv = match fst lv with | TResult _ | TVar{lv_name="\\exit_status"} -> [] (* special case ! *) | _ -> let offsets = let obj = Ctypes.object_of_logic_type (Cil.typeOfTermLval lv) in if unfold then compound_offsets obj else [obj , TNoOffset] in List.concat (List.map (fun (obj,offset) -> let lv = Logic_const.addTermOffsetLval offset lv in L.region obj (addr_lval env lv)) offsets) let assignable env ~unfold t = match t.term_node with | Tempty_set -> [] | TLval lv -> assignable_lval env ~unfold lv | Tunion ts -> List.concat (List.map (C.region env ~unfold) ts) | Tinter _ -> Warning.error "Intersection in assigns not implemented yet" | Tcomprehension(t,qs,cond) -> begin let xs,env,domain = bind_quantifiers env qs in let conditions = match cond with | None -> domain | Some p -> C.pred `NoPolarity env p :: domain in List.map (function (obj,sloc) -> obj , match sloc with | Sloc l -> Sdescr(xs,l,p_conj conditions) | (Sarray _ | Srange _ | Sdescr _) as sloc -> let ys,l,extend = L.rdescr sloc in Sdescr(xs@ys,l,p_conj (extend :: conditions)) ) (C.region env ~unfold t) end | Tat(t,label) -> C.region ~unfold (C.env_at env (Clabels.of_logic label)) t | Tlet( { l_var_info=v ; l_body=LBterm a } , b ) -> let va = C.logic env a in C.region ~unfold (C.env_let env v va) b | Tlet _ -> Warning.error "Complex let-binding not implemented yet (%a)" Printer.pp_term t | TCastE (_,t) | TLogic_coerce(_,t) -> C.region env ~unfold t | TBinOp _ | TUnOp _ | Trange _ | TUpdate _ | Tapp _ | Tif _ | TConst _ | Tnull | TDataCons _ | Tlambda _ | Ttype _ | Ttypeof _ | TAlignOfE _ | TAlignOf _ | TSizeOfStr _ | TSizeOfE _ | TSizeOf _ | Tblock_length _ | Tbase_addr _ | Toffset _ | TAddrOf _ | TStartOf _ -> Wp_parameters.abort ~current:true "Non-assignable term (%a)" Printer.pp_term t (* -------------------------------------------------------------------------- *) (* --- Protection --- *) (* -------------------------------------------------------------------------- *) let term_protected env t = Warning.handle ~handler:term_undefined ~severe:false ~effect:"Hide sub-term definition" (term_node env) t let pred_protected polarity env p = match polarity with | `Positive -> Warning.handle ~effect:"Target turned to False" ~severe:true ~handler:(fun _ -> p_false) (predicate `Positive env) p | `Negative -> Warning.handle ~effect:"Ignored Hypothesis" ~severe:false ~handler:(fun _ -> p_true) (predicate `Negative env) p | `NoPolarity -> predicate `NoPolarity env p (* -------------------------------------------------------------------------- *) (* --- Boot Strapping --- *) (* -------------------------------------------------------------------------- *) let term_trigger env t = let v = term_protected env t in if List.mem "TRIGGER" t.term_name then begin match v with | Vexp e -> C.trigger (Trigger.of_term e) | Vloc l -> C.trigger (Trigger.of_term (M.pointer_val l)) | _ -> Wp_parameters.warning ~current:true "Can not trigger on tset" end ; v let pred_trigger positive env np = let p = pred_protected positive env np in if List.mem "TRIGGER" np.Cil_types.pred_name then C.trigger (Trigger.of_pred p); p let pred polarity env p = Context.with_current_loc p.pred_loc (pred_trigger polarity env) p let logic env t = Context.with_current_loc t.term_loc (term_trigger env) t let region env ~unfold t = Context.with_current_loc t.term_loc (assignable env ~unfold) t let () = C.bootstrap_pred pred let () = C.bootstrap_term term let () = C.bootstrap_logic logic let () = C.bootstrap_region region let lemma = C.lemma (* -------------------------------------------------------------------------- *) (* --- Regions --- *) (* -------------------------------------------------------------------------- *) let assigned_of_froms env ~unfold froms = List.concat (List.map (fun ({it_content=wr},_deps) -> region env ~unfold wr) froms) let assigned_of_assigns env ~unfold = function | WritesAny -> None | Writes froms -> Some (assigned_of_froms env ~unfold froms) let occurs_opt x = function None -> false | Some t -> F.occurs x t let occurs_sloc x = function | Sloc l -> M.occurs x l | Sarray(l,_,_) -> M.occurs x l | Srange(l,_,a,b) -> M.occurs x l || occurs_opt x a || occurs_opt x b | Sdescr(xs,l,p) -> if List.exists (Var.equal x) xs then false else (M.occurs x l || F.occursp x p) let occurs x region = List.exists (fun (_,s) -> occurs_sloc x s) region let vars_opt = function None -> Vars.empty | Some t -> F.vars t let vars_sloc = function | Sloc l | Sarray(l,_,_) -> M.vars l | Srange(l,_,a,b) -> Vars.union (M.vars l) (Vars.union (vars_opt a) (vars_opt b)) | Sdescr(xs,l,p) -> List.fold_left (fun xs x -> Vars.remove x xs) (Vars.union (M.vars l) (F.varsp p)) xs let vars region = List.fold_left (fun xs (_,s) -> Vars.union xs (vars_sloc s)) Vars.empty region (* -------------------------------------------------------------------------- *) (* --- CheckAssigns --- *) (* -------------------------------------------------------------------------- *) let check_assigns sigma ~written ~assignable = p_all (fun seg -> p_imply (p_not (L.invalid sigma seg)) (p_any (L.included seg) assignable) ) (written : region) end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/LogicSemantics.mli����������������������������������������������0000666�0000000�0000000�00000003612�13571573400�017522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- ACSL Translation --- *) (* -------------------------------------------------------------------------- *) module Make(M : Sigs.Model) : Sigs.LogicSemantics with module M = M ����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/LogicUsage.ml���������������������������������������������������0000666�0000000�0000000�00000044046�13571573400�016475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Dependencies of Logic Definitions --- *) (* -------------------------------------------------------------------------- *) open Cil open Cil_types open Cil_datatype open Clabels open Visitor (* -------------------------------------------------------------------------- *) (* --- Name Utilities --- *) (* -------------------------------------------------------------------------- *) let trim name = let rec first s k n = if k < n && s.[k]='_' then first s (succ k) n else k in let rec last s k = if k >= 0 && s.[k]='_' then last s (pred k) else k in let n = String.length name in if n > 0 then if ( name.[0]='_' || name.[n-1]='_' ) then let p = first name 0 n in let q = last name (pred n) in if p <= q then let name = String.sub name p (q+1-p) in match name.[0] with | '0' .. '9' -> "_" ^ name | _ -> name else "_" else name else "_" (* -------------------------------------------------------------------------- *) (* --- Definition Blocks --- *) (* -------------------------------------------------------------------------- *) type logic_lemma = { lem_name : string ; lem_position : Filepath.position ; lem_axiom : bool ; lem_types : string list ; lem_labels : logic_label list ; lem_property : predicate ; lem_depends : logic_lemma list ; (* global lemmas declared before in AST order (in reverse order) *) } type axiomatic = { ax_name : string ; ax_position : Filepath.position ; ax_property : Property.t ; mutable ax_types : logic_type_info list ; mutable ax_logics : logic_info list ; mutable ax_lemmas : logic_lemma list ; mutable ax_reads : Varinfo.Set.t ; (* read-only *) } type logic_section = | Toplevel of int | Axiomatic of axiomatic let is_global_axiomatic ax = ax.ax_types = [] && ax.ax_logics = [] && ax.ax_lemmas <> [] module SMap = Datatype.String.Map module TMap = Logic_type_info.Map module LMap = Logic_info.Map module LSet = Logic_info.Set (* -------------------------------------------------------------------------- *) (* --- Usage and Dependencies --- *) (* -------------------------------------------------------------------------- *) type inductive_case = { ind_logic : logic_info ; ind_case : string ; mutable ind_call : LabelSet.t LabelMap.t ; } type database = { mutable cases : inductive_case list LMap.t ; mutable clash : LSet.t SMap.t ; mutable names : string LMap.t ; mutable types : logic_section TMap.t ; mutable logics : logic_section LMap.t ; mutable lemmas : (logic_lemma * logic_section) SMap.t ; mutable recursives : LSet.t ; mutable axiomatics : axiomatic SMap.t ; mutable proofcontext : logic_lemma list ; } let empty_database () = { cases = LMap.empty ; names = LMap.empty ; clash = SMap.empty ; types = TMap.empty ; logics = LMap.empty ; lemmas = SMap.empty ; recursives = LSet.empty ; axiomatics = SMap.empty ; proofcontext = [] ; } module DatabaseType = Datatype.Make (struct type t = database include Datatype.Serializable_undefined let reprs = [empty_database ()] let name = "Wp.LogicUsage.DatabaseType" end) module Database = State_builder.Ref(DatabaseType) (struct let name = "Wp.LogicUsage.Database" let dependencies = [Ast.self;Annotations.code_annot_state] let default = empty_database end) let pp_logic fmt l = Printer.pp_logic_var fmt l.l_var_info (* -------------------------------------------------------------------------- *) (* --- Overloading --- *) (* -------------------------------------------------------------------------- *) let basename x = trim x.vorig_name let compute_logicname l = let d = Database.get () in try LMap.find l d.names with Not_found -> let base = l.l_var_info.lv_name in let over = try SMap.find base d.clash with Not_found -> LSet.empty (*TODO: Undetected usage -> overloading issue *) in match LSet.elements over with | [] | [_] -> d.names <- LMap.add l base d.names ; base | symbols -> let rec register k = function | l::ls -> let name = Printf.sprintf "%s_%d_" base k in d.names <- LMap.add l name d.names ; register (succ k) ls | [] -> () in register 1 symbols ; LMap.find l d.names let is_overloaded l = let d = Database.get () in try LSet.cardinal (SMap.find l.l_var_info.lv_name d.clash) > 1 with Not_found -> false let pp_profile fmt l = Format.fprintf fmt "%s" l.l_var_info.lv_name ; match l.l_profile with | [] -> () | x::xs -> Format.fprintf fmt "@[<hov 1>(%a" Printer.pp_logic_type x.lv_type ; List.iter (fun y -> Format.fprintf fmt ",@,%a" Printer.pp_logic_type y.lv_type) xs ; Format.fprintf fmt ")@]" (* -------------------------------------------------------------------------- *) (* --- Utilities --- *) (* -------------------------------------------------------------------------- *) let ip_lemma l = let open Property in (if l.lem_axiom then Property.ip_axiom else Property.ip_lemma) {il_name = l.lem_name; il_labels = l.lem_labels; il_args = l.lem_types; il_loc = (l.lem_position, l.lem_position); il_pred = l.lem_property} let lemma_of_global proof = function | Dlemma(name,axiom,labels,types,pred,_,loc) -> { lem_name = name ; lem_position = fst loc ; lem_types = types ; lem_labels = labels ; lem_axiom = axiom ; lem_property = pred ; lem_depends = proof ; } | _ -> assert false let populate a proof = function | Dfun_or_pred(l,_) -> a.ax_logics <- l :: a.ax_logics | Dtype(t,_) -> a.ax_types <- t :: a.ax_types | Dlemma _ as g -> a.ax_lemmas <- lemma_of_global proof g :: a.ax_lemmas | _ -> () let ip_of_axiomatic g = match Property.ip_of_global_annotation_single g with | None -> assert false | Some ip -> ip let axiomatic_of_global proof = function | Daxiomatic(name,globals,_,loc) as g -> let a = { ax_name = name ; ax_position = fst loc ; ax_property = ip_of_axiomatic g ; ax_reads = Varinfo.Set.empty ; ax_types = [] ; ax_lemmas = [] ; ax_logics = [] ; } in List.iter (populate a proof) globals ; a.ax_types <- List.rev a.ax_types ; a.ax_logics <- List.rev a.ax_logics ; a.ax_lemmas <- List.rev a.ax_lemmas ; a | _ -> assert false let register_logic d section l = let name = l.l_var_info.lv_name in let over = try LSet.add l (SMap.find name d.clash) with Not_found -> LSet.singleton l in begin d.clash <- SMap.add name over d.clash ; d.logics <- LMap.add l section d.logics ; end let register_lemma d section l = begin d.lemmas <- SMap.add l.lem_name (l,section) d.lemmas ; end let register_type d section t = begin d.types <- TMap.add t section d.types ; end let register_axiomatic d a = begin d.axiomatics <- SMap.add a.ax_name a d.axiomatics ; end let register_cases l inds = let d = Database.get () in d.cases <- LMap.add l inds d.cases (* -------------------------------------------------------------------------- *) (* --- Adding a label called in an inductive case --- *) (* -------------------------------------------------------------------------- *) (* calls : LabelSet.t LabelMap.t Given an inductive phi{...A...} In case H{...B...}, have a call to phi{...B...} Then: ( A \in calls[B] ). *) let add_call calls l_a l_b = let a = Clabels.of_logic l_a in let b = Clabels.of_logic l_b in let s = try LabelSet.add a (LabelMap.find b calls) with Not_found -> LabelSet.singleton a in LabelMap.add b s calls (* -------------------------------------------------------------------------- *) (* --- Visitor --- *) (* -------------------------------------------------------------------------- *) class visitor = object(self) inherit Visitor.frama_c_inplace val database = Database.get () val mutable caller : logic_info option = None val mutable axiomatic : axiomatic option = None val mutable inductive : inductive_case option = None val mutable toplevel = 0 method private section = match axiomatic with | None -> Toplevel toplevel | Some a -> Axiomatic a method private do_var x = match axiomatic with | None -> () | Some a -> a.ax_reads <- Varinfo.Set.add x a.ax_reads method private do_lvar x = try self#do_call (Logic_env.find_logic_cons x) [] with Not_found -> () method private do_call l labels = match inductive with | Some case -> if Logic_info.equal l case.ind_logic then case.ind_call <- List.fold_left2 add_call case.ind_call l.l_labels labels | None -> match caller with | None -> () | Some f -> if Logic_info.equal f l then database.recursives <- LSet.add f database.recursives method private do_case l (case,_labels,_types,pnamed) = begin let indcase = { ind_logic = l ; ind_case = case ; ind_call = LabelMap.empty ; } in inductive <- Some indcase ; ignore (visitFramacPredicate (self :> frama_c_visitor) pnamed) ; inductive <- None ; indcase end (* --- LVALUES --- *) method! vlval = function | (Var x,_) -> self#do_var x ; DoChildren | _ -> DoChildren method! vterm_lval = function | (TVar { lv_origin=Some x } , _ ) -> self#do_var x ; DoChildren | (TVar x , _ ) -> self#do_lvar x ; DoChildren | _ -> DoChildren (* --- TERMS --- *) method! vterm_node = function | Tapp(l,labels,_) -> self#do_call l labels ; DoChildren | _ -> DoChildren (* --- PREDICATE --- *) method! vpredicate_node = function | Papp(l,labels,_) -> self#do_call l labels ; DoChildren | _ -> DoChildren method! vannotation global = match global with (* --- AXIOMATICS --- *) | Daxiomatic _ -> begin let pf = database.proofcontext in let ax = axiomatic_of_global pf global in register_axiomatic database ax ; axiomatic <- Some ax ; DoChildrenPost (fun g -> if not (is_global_axiomatic ax) then database.proofcontext <- pf ; axiomatic <- None ; toplevel <- succ toplevel ; g) end (* --- LOGIC INFO --- *) | Dfun_or_pred(l,_) -> begin register_logic database self#section l ; match l.l_body with | LBnone when axiomatic = None -> SkipChildren | LBnone | LBreads _ | LBterm _ | LBpred _ -> caller <- Some l ; DoChildrenPost (fun g -> caller <- None ; g) | LBinductive cases -> register_cases l (List.map (self#do_case l) cases) ; SkipChildren end (* --- LEMMAS --- *) | Dlemma _ -> let lem = lemma_of_global database.proofcontext global in register_lemma database self#section lem ; database.proofcontext <- lem :: database.proofcontext ; SkipChildren | Dtype(t,_) -> register_type database self#section t ; SkipChildren (* --- OTHERS --- *) | Dvolatile _ | Dinvariant _ | Dtype_annot _ | Dmodel_annot _ | Dcustom_annot _ | Dextended _ -> SkipChildren method! vfunc _ = SkipChildren end let compute () = Wp_parameters.feedback ~ontty:`Transient "Collecting axiomatic usage" ; Visitor.visitFramacFile (new visitor) (Ast.get ()) (* -------------------------------------------------------------------------- *) (* --- External API --- *) (* -------------------------------------------------------------------------- *) let (compute,_) = State_builder.apply_once "LogicUsage.compute" [Ast.self;Annotations.code_annot_state] compute let is_recursive l = compute () ; let d = Database.get () in LSet.mem l d.recursives let get_induction_labels l case = compute () ; try let d = Database.get () in let cases = LMap.find l d.cases in try (List.find (fun i -> i.ind_case = case) cases).ind_call with Not_found -> Wp_parameters.fatal "No case '%s' for inductive '%s'" case l.l_var_info.lv_name with Not_found -> Wp_parameters.fatal "Non-inductive '%s'" l.l_var_info.lv_name let axiomatic a = compute () ; try let d = Database.get () in SMap.find a d.axiomatics with Not_found -> Wp_parameters.fatal "Axiomatic '%s' undefined" a let section_of_type t = compute () ; try let d = Database.get () in TMap.find t d.types with Not_found -> Wp_parameters.fatal "Logic type '%s' undefined" t.lt_name let section_of_logic l = compute () ; try let d = Database.get () in LMap.find l d.logics with Not_found -> Wp_parameters.fatal "Logic '%a' undefined" pp_logic l let get_lemma l = compute () ; try let d = Database.get () in SMap.find l d.lemmas with Not_found -> Wp_parameters.fatal "Lemma '%s' undefined" l let iter_lemmas f = compute () ; let d = Database.get () in SMap.iter (fun _name (lem,_) -> f lem) d.lemmas let logic_lemma l = fst (get_lemma l) let section_of_lemma l = snd (get_lemma l) let proof_context () = (* No need for compute: if no lemma, database is empty ! *) let d = Database.get () in d.proofcontext (* -------------------------------------------------------------------------- *) (* --- Dump API --- *) (* -------------------------------------------------------------------------- *) let dump_type fmt t = Format.fprintf fmt " * type '%s'@\n" t.lt_name let dump_profile fmt kind l = begin Format.fprintf fmt " * %s '%s'@\n" kind (compute_logicname l) ; if is_overloaded l then Format.fprintf fmt " profile %a@\n" pp_profile l ; if is_recursive l then Format.fprintf fmt " recursive@\n" ; end let dump_logic fmt d l = begin try let cases = LMap.find l d.cases in dump_profile fmt "inductive" l ; List.iter (fun ind -> Format.fprintf fmt " @[case %s:" ind.ind_case ; LabelMap.iter (fun l s -> Format.fprintf fmt "@ @[<hov 2>{%a:" Clabels.pretty l ; LabelSet.iter (fun l -> Format.fprintf fmt "@ %a" Clabels.pretty l) s ; Format.fprintf fmt "}@]" ) ind.ind_call ; Format.fprintf fmt "@]@\n" ) cases ; with Not_found -> let kind = if l.l_type = None then "predicate" else "function" in dump_profile fmt kind l ; end let dump_lemma fmt l = if l.lem_axiom then Format.fprintf fmt " * axiom '%s'@\n" l.lem_name else Format.fprintf fmt " * lemma '%s'@\n" l.lem_name let get_name l = compute () ; compute_logicname l let pp_section fmt = function | Toplevel 0 -> Format.fprintf fmt "Toplevel" | Toplevel n -> Format.fprintf fmt "Toplevel(%d)" n | Axiomatic a -> Format.fprintf fmt "Axiomatic '%s'" a.ax_name let dump () = compute () ; Log.print_on_output begin fun fmt -> let d = Database.get () in SMap.iter (fun _ a -> Format.fprintf fmt "Axiomatic %s {@\n" a.ax_name ; List.iter (dump_type fmt) a.ax_types ; List.iter (dump_logic fmt d) a.ax_logics ; List.iter (dump_lemma fmt) a.ax_lemmas ; Format.fprintf fmt "}@\n" ) d.axiomatics ; TMap.iter (fun t s -> Format.fprintf fmt " * type '%s' in %a@\n" t.lt_name pp_section s) d.types ; LMap.iter (fun l s -> Format.fprintf fmt " * logic '%a' in %a@\n" pp_logic l pp_section s) d.logics ; SMap.iter (fun l (lem,s) -> Format.fprintf fmt " * %s '%s' in %a@\n" (if lem.lem_axiom then "axiom" else "lemma") l pp_section s) d.lemmas ; Format.fprintf fmt "-------------------------------------------------@." ; end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/LogicUsage.mli��������������������������������������������������0000666�0000000�0000000�00000006602�13571573400�016642� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Dependencies of Logic Definitions --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype open Clabels val basename : varinfo -> string (** Trims the original name *) type logic_lemma = { lem_name : string ; lem_position : Filepath.position ; lem_axiom : bool ; lem_types : string list ; lem_labels : logic_label list ; lem_property : predicate ; lem_depends : logic_lemma list ; (** in reverse order *) } type axiomatic = { ax_name : string ; ax_position : Filepath.position ; ax_property : Property.t ; mutable ax_types : logic_type_info list ; mutable ax_logics : logic_info list ; mutable ax_lemmas : logic_lemma list ; mutable ax_reads : Varinfo.Set.t ; (* read-only *) } type logic_section = | Toplevel of int | Axiomatic of axiomatic val compute : unit -> unit (** To force computation *) val ip_lemma : logic_lemma -> Property.t val iter_lemmas : (logic_lemma -> unit) -> unit val logic_lemma : string -> logic_lemma val axiomatic : string -> axiomatic val section_of_lemma : string -> logic_section val section_of_type : logic_type_info -> logic_section val section_of_logic : logic_info -> logic_section val proof_context : unit -> logic_lemma list (** Lemmas that are not in an axiomatic. *) val is_recursive : logic_info -> bool val get_induction_labels : logic_info -> string -> LabelSet.t LabelMap.t (** Given an inductive [phi{...A...}]. Whenever in [case C{...B...}] we have a call to [phi{...B...}], then [A] belongs to [(induction phi C).[B]]. *) val get_name : logic_info -> string val pp_profile : Format.formatter -> logic_info -> unit val dump : unit -> unit (** Print on output *) ������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Makefile.in�����������������������������������������������������0000666�0000000�0000000�00000022471�13571573400�016164� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of WP plug-in of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat a l'energie atomique et aux energies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # Do not use ?= to initialize both below variables # (fixed efficiency issue, see GNU Make manual, Section 8.11) ifndef FRAMAC_SHARE FRAMAC_SHARE :=$(shell frama-c-config -print-share-path) endif ifndef FRAMAC_LIBDIR FRAMAC_LIBDIR :=$(shell frama-c-config -print-libpath) endif PLUGIN_DIR ?=. ifneq ("$(FRAMAC_INTERNAL)","yes") include $(FRAMAC_SHARE)/Makefile.config endif # Coq Resources Installation include $(PLUGIN_DIR)/share/Makefile.resources # Extension of the GUI for wp is compilable # only if gnomecanvas is available #ifeq ($(HAS_GNOMECANVAS),yes) PLUGIN_GUI_CMO:= \ GuiConfig \ GuiList \ GuiSequent \ GuiProver \ GuiTactic \ GuiProof \ GuiComposer \ GuiGoal \ GuiSource \ GuiPanel \ GuiNavigator #endif PLUGIN_REQUIRES:= why3 PLUGIN_ENABLE:=@ENABLE_WP@ PLUGIN_NAME:=Wp PLUGIN_CMO:= \ rformat wprop \ wp_parameters wp_error \ dyncall ctypes clabels \ Why3Provers \ Context Warning MemoryContext wpContext \ LogicUsage RefUsage \ Layout Region \ RegionAnnot RegionAccess RegionDump RegionAnalysis \ cil2cfg normAtLabels wpPropId mcfg \ Lang Repr Matrix Passive Splitter \ LogicBuiltins Definitions \ Cmath Cint Cfloat Vset Vlist Cstring Cvalues \ Letify Cleaning \ Sigs Mstate Conditions \ Filtering \ Plang Pcfg Pcond \ CodeSemantics \ LogicCompiler \ LogicSemantics LogicAssigns \ Sigma MemLoader \ MemEmpty MemZeroAlias MemVar \ MemMemory MemTyped MemRegion \ wpStrategy wpRTE wpAnnot \ CfgCompiler StmtSemantics \ VCS script proof wpo wpReport \ Footprint Tactical Strategy \ TacSplit TacChoice TacRange \ TacArray TacCompound TacUnfold \ TacHavoc TacInstance TacLemma \ TacFilter TacCut WpTac TacNormalForm \ TacRewrite TacBitwised TacBitrange TacShift \ TacCongruence TacOverflow Auto \ ProofSession ProofScript ProofEngine \ ProverTask ProverErgo ProverCoq \ filter_axioms ProverWhy3 \ driver prover ProverSearch ProverScript \ Generator Factory \ calculus cfgDump cfgWP \ register VC PLUGIN_CMI:= PLUGIN_GENERATED:= \ $(PLUGIN_DIR)/script.ml \ $(PLUGIN_DIR)/rformat.ml \ $(PLUGIN_DIR)/driver.ml \ $(PLUGIN_DIR)/Wp.mli PLUGIN_DEPENDENCIES:= rtegen qed PLUGIN_UNDOC+= PLUGIN_INTRO:=$(PLUGIN_DIR)/intro_wp.txt PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_DISTRIB_EXTERNAL:= \ Changelog \ Makefile.in \ MakeAPI \ configure.ac \ configure \ $(addprefix share/, $(ALL_CEA_RESOURCES) \ $(ALL_UNMODIFIED_WHY3_RESOURCES) \ $(ALL_MODIFIED_WHY3_RESOURCES)) CEA_WP_GENEREATED= script.ml rformat.ml driver.ml # -------------------------------------------------------------------------- # --- Tests --- # -------------------------------------------------------------------------- PLUGIN_TESTS_DIRS:= \ wp wp_plugin wp_acsl wp_bts \ wp_store wp_hoare wp_typed wp_usage \ wp_gallery wp_manual wp_tip \ wp_region ifeq ($(FRAMAC_INTERNAL),yes) Wp_DEFAULT_TESTS: create_share_link endif # -------------------------------------------------------------------------- # --- Dynamic Plugin --- # -------------------------------------------------------------------------- include $(FRAMAC_SHARE)/Makefile.dynamic # Regenerating the Makefile on need ifeq ("$(FRAMAC_INTERNAL)","yes") CONFIG_STATUS_DIR=$(FRAMAC_SRC) else CONFIG_STATUS_DIR=. endif WP_CONFIGURE_MAKEFILE= \ $(Wp_DIR)/Makefile.in \ $(Wp_DIR)/share/Makefile.coqwp \ $(Wp_DIR)/share/Makefile.resources \ $(CONFIG_STATUS_DIR)/config.status $(Wp_DIR)/Makefile: $(WP_CONFIGURE_MAKEFILE) @cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ # -------------------------------------------------------------------------- # --- WP API --- # -------------------------------------------------------------------------- WP_API_BASE= \ wp_parameters.mli \ ctypes.mli clabels.mli \ MemoryContext.mli \ LogicUsage.mli RefUsage.mli \ normAtLabels.mli \ wpPropId.mli mcfg.ml \ Context.mli Warning.mli wpContext.mli \ Lang.mli Repr.mli Passive.mli Splitter.mli \ LogicBuiltins.mli Definitions.mli \ Cint.mli Cfloat.mli Vset.mli Cstring.mli \ Sigs.ml Mstate.mli Conditions.mli Filtering.mli \ Plang.mli Pcfg.mli Pcond.mli \ CodeSemantics.mli \ LogicCompiler.mli LogicSemantics.mli \ Sigma.mli MemVar.mli MemTyped.mli \ CfgCompiler.mli StmtSemantics.mli \ Factory.mli driver.mli VCS.mli Tactical.mli Strategy.mli Auto.mli \ VC.mli wpo.mli ProverTask.mli prover.mli define WP_capitalize $(shell printf "%s%s" \ $$($(ECHO) $(1) | cut -c 1 | tr '[:lower:]' '[:upper:]') $$($(ECHO) $(1) | cut -c 2-)) endef define WP_export $(ECHO) "module $(call WP_capitalize, $(basename $(notdir $(1)))) : sig" >> $(2); $(ECHO) '# 1 "$(1)"' >> $(2); $(CAT) $(1) >> $(2); $(ECHO) "end" >> $(2); endef WP_MLI=$(addprefix $(Wp_DIR)/, $(WP_API_BASE)) $(Wp_DIR)/Wp.mli: $(Wp_DIR)/Makefile $(WP_MLI) $(PRINT_MAKING) $@ $(RM) $@ $@.tmp $(ECHO) "(* This file is generated. Do not edit. *)" > $@.tmp $(ECHO) "(** {b WP Public API} *)" > $@.tmp $(foreach file,$(WP_MLI),$(call WP_export,$(file),$@.tmp)) $(CHMOD_RO) $@.tmp $(MV) $@.tmp $@ .PHONY: wp-doc-api wp-doc-api: $(ECHO) "Generating WP documentation" @mkdir -p $(Wp_DIR)/doc/html $(RM) -fr $(Wp_DIR)/doc/html/* $(CP) $(Wp_DIR)/doc/ocamldoc.css $(Wp_DIR)/doc/html/style.css $(OCAMLDOC) \ -package zarith \ -I lib/fc -I lib/plugins -I $(Wp_DIR) -stars \ -html -d $(Wp_DIR)/doc/html -charset utf-8 \ -t "Frama-C/WP API Documentation" \ -intro $(Wp_DIR)/doc/wp-api.odoc \ -colorize-code -short-functors $(Wp_DIR)/Wp.mli $(ECHO) "Generating $(Wp_DIR)/doc/html/index.html" clean:: $(RM) $(Wp_DIR)/Wp.mli $(RM) -fr $(Wp_DIR)/doc/html # -------------------------------------------------------------------------- # --- Installation Resources # -------------------------------------------------------------------------- ## All relative to share/ ALL_COQ_SOURCES= $(addprefix coqwp/, $(COQ_LIBS_CEA) $(COQ_LIBS_INRIA)) ALL_COQ_BINARIES= $(addsuffix o, $(ALL_COQ_SOURCES)) ALL_ERGO_SOURCES= $(addprefix ergo/, $(ERGO_LIBS_CEA) $(ERGO_LIBS_INRIA)) ALL_WHY3_SOURCES= $(addprefix why3/frama_c_wp/, $(WHY3_LIBS_CEA)) ALL_RESOURCES= \ wp.driver \ $(ALL_COQ_SOURCES) \ $(ALL_ERGO_SOURCES) \ $(ALL_WHY3_SOURCES) INSTALL_OPT?= INSTALL_SHARE=@$(Wp_DIR)/share/instwp $(INSTALL_OPT) byte:: $(Wp_DIR)/share/instwp opt:: $(Wp_DIR)/share/instwp clean:: rm -f $(Wp_DIR)/share/instwp rm -f $(Wp_DIR)/share/install.cm* $(Wp_DIR)/share/instwp: $(Wp_DIR)/share/install.ml $(OCAMLC) $(WARNINGS) -o $@ unix.cma $^ # -------------------------------------------------------------------------- # --- Pre-Compiled Coq Libraries --- # -------------------------------------------------------------------------- WP_COQC_ENABLED=@COQC@ ifeq ($(WP_COQC_ENABLED),yes) include $(Wp_DIR)/share/Makefile.coqwp byte:: coqwpcompile opt:: coqwpcompile clean:: wp-coq-clean endif #($(WP_COQC_ENABLED),yes) # -------------------------------------------------------------------------- # --- Installation --- # -------------------------------------------------------------------------- install:: clean-install $(PRINT_INSTALL) WP shared files $(MKDIR) $(FRAMAC_DATADIR)/wp $(INSTALL_SHARE) -p \ -i $(Wp_DIR)/share \ -d $(FRAMAC_DATADIR)/wp \ $(ALL_RESOURCES) -f -b $(ALL_COQ_BINARIES) uninstall:: $(PRINT_RM) WP shared files $(RM) -r $(FRAMAC_DATADIR)/wp # -------------------------------------------------------------------------- # --- WP Release Stuff (CEA-LIST Only) # -------------------------------------------------------------------------- sinclude MakeDistrib # -------------------------------------------------------------------------- $(Wp_DIR)/.depend: $(Wp_DIR)/driver.mll $(Wp_DIR)/driver.mll: $(Wp_DIR)/Makefile �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Matrix.ml�������������������������������������������������������0000666�0000000�0000000�00000013600�13571573400�015707� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Array Dimensions --- *) (* -------------------------------------------------------------------------- *) open Ctypes open Lang.F type dim = int option type matrix = c_object * dim list let of_array = Ctypes.array_dimensions module KEY(E : sig val compare : c_object -> c_object -> int end) = struct type t = matrix let compare_dim d1 d2 = match d1 , d2 with | None,None -> 0 | Some _,None -> (-1) | None,Some _ -> 1 | Some _,Some _ -> 0 let compare (e1,ds1) (e2,ds2) = let cmp = E.compare e1 e2 in if cmp = 0 then Qed.Hcons.compare_list compare_dim ds1 ds2 else cmp let pretty fmt (obj,ds) = Ctypes.pretty fmt obj ; List.iter (function | None -> Format.pp_print_string fmt "[]" | Some d -> Format.fprintf fmt "[%d]" d ) ds end module COBJ = struct let compare e1 e2 = match e1 , e2 with | C_int _ , C_int _ -> 0 | C_int _ , _ -> (-1) | _ , C_int _ -> 1 | C_float _ , C_float _ -> 0 | C_float _ , _ -> (-1) | _ , C_float _ -> 1 | C_pointer _ , C_pointer _ -> 0 | C_pointer _ , _ -> (-1) | _ , C_pointer _ -> 1 | C_comp a , C_comp b -> Cil_datatype.Compinfo.compare a b | C_comp _ , _ -> (-1) | _ , C_comp _ -> 1 | C_array _ , C_array _ -> assert false end module MACHINE = KEY(Ctypes) module NATURAL = KEY(COBJ) let natural_id = function | C_int _ -> "int" | C_float _ -> "float" | C_pointer _ -> "pointer" | C_array _ -> "array" | C_comp c -> Lang.comp_id c let add_rank buffer k = if k > 0 then Buffer.add_string buffer (string_of_int k) let add_dim buffer rank = function | None -> add_rank buffer rank ; Buffer.add_string buffer "w" ; 0 | Some _ -> succ rank let id ds = let buffer = Buffer.create 8 in add_rank buffer (List.fold_left (add_dim buffer) 0 ds) ; Buffer.contents buffer type denv = { size_var : var list ; (* size variables *) size_val : term list ; (* size values *) index_var : var list ; (* index variables *) index_val : term list ; (* index values *) index_range : pred list ; (* indices are in range of size variables *) index_offset : term list ; (* polynomial of indices *) monotonic : bool ; } let rec collect rank = function | [] -> { size_var = [] ; size_val = [] ; index_var = [] ; index_val = [] ; index_range = [] ; index_offset = [] ; monotonic = true ; } | d::ds -> let denv = collect (succ rank) ds in let k_base = match rank with 0 -> "i" | 1 -> "j" | _ -> "k" in let k_var = Lang.freshvar ~basename:k_base Qed.Logic.Int in let k_val = e_var k_var in let k_ofs = e_prod (k_val :: denv.size_val) in match d with | None -> { denv with index_var = k_var :: denv.index_var ; index_val = k_val :: denv.index_val ; index_offset = k_ofs :: denv.index_offset ; monotonic = false ; } | Some _ -> let n_base = match rank with 0 -> "n" | 1 -> "m" | _ -> "d" in let n_var = Lang.freshvar ~basename:n_base Qed.Logic.Int in let n_val = e_var n_var in let k_inf = p_leq e_zero k_val in let k_sup = p_lt k_val n_val in { size_var = n_var :: denv.size_var ; size_val = n_val :: denv.size_val ; index_var = k_var :: denv.index_var ; index_val = k_val :: denv.index_val ; index_offset = k_ofs :: denv.index_offset ; index_range = k_inf :: k_sup :: denv.index_range ; monotonic = denv.monotonic ; } let denv = collect 0 let rec dval = function | [] -> [] | None :: ds -> dval ds | Some n :: ds -> e_int n :: dval ds let size (_,ds) = dval ds let rec tau obj = function | [] -> Lang.tau_of_object obj | _ :: ds -> Qed.Logic.Array( Qed.Logic.Int , tau obj ds ) let rec do_merge ds1 ds2 = match ds1 , ds2 with | [] , [] -> [] | [] , _ | _ , [] -> raise Exit | d1::ds1 , d2::ds2 -> let d = match d1 , d2 with | None , _ | _ , None -> None | Some n1 , Some n2 -> if n1=n2 then d1 else raise Exit in d :: do_merge ds1 ds2 let merge ds1 ds2 = try Some(do_merge ds1 ds2) with Exit -> None ��������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Matrix.mli������������������������������������������������������0000666�0000000�0000000�00000005277�13571573400�016073� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Array Dimensions --- *) (* -------------------------------------------------------------------------- *) open Ctypes open Lang.F type dim = int option type matrix = c_object * dim list module MACHINE : WpContext.Key with type t = matrix module NATURAL : WpContext.Key with type t = matrix val of_array : arrayinfo -> matrix val id : dim list -> string (** unique w.r.t [equal] *) val natural_id : c_object -> string (** name for elements in NATURAL *) val merge : dim list -> dim list -> dim list option type denv = { size_var : var list ; (** size variables *) size_val : term list ; (** size values *) index_var : var list ; (** index variables *) index_val : term list ; (** index values *) index_range : pred list ; (** indices are in range of size variables *) index_offset : term list ; (** polynomial of indices *) monotonic : bool ; (** all dimensions are defined *) } val denv : dim list -> denv val size : matrix -> term list val tau : c_object -> dim list -> tau ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemEmpty.ml�����������������������������������������������������0000666�0000000�0000000�00000007577�13571573400�016220� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Empty Memory Model --- *) (* -------------------------------------------------------------------------- *) open Lang.F open Sigs module Logic = Qed.Logic let datatype = "MemEmpty" let configure () = begin Context.set Lang.pointer (fun _typ -> Logic.Int) ; Context.set Cvalues.null (p_equal e_zero) ; end let no_binder = { bind = fun _ f v -> f v } let configure_ia _ = no_binder let hypotheses () = [] module Chunk = struct type t = unit let self = "empty" let hash () = 0 let equal () () = true let compare () () = 0 let pretty _fmt () = () let tau_of_chunk () = Logic.Int let basename_of_chunk () = "u" let is_framed () = true end module Heap = Qed.Collection.Make(Chunk) module Sigma = Sigma.Make(Chunk)(Heap) type loc = unit type chunk = Chunk.t type sigma = Sigma.t type domain = Sigma.domain type segment = loc rloc type state = unit let state _ = () let iter _ _ = () let lookup _ _ = Mterm let updates _ _ = Bag.empty let apply _ _ = () let pretty _fmt () = () let vars _l = Vars.empty let occurs _x _l = false let null = () let literal ~eid _ = ignore eid let cvar _x = () let pointer_loc _t = () let pointer_val () = e_zero let field _l _f = () let shift _l _obj _k = () let base_addr _l = () let base_offset _l = e_zero let block_length _s _obj _l = e_zero let cast _ _l = () let loc_of_int _ _ = () let int_of_loc _ () = e_zero let domain _obj _l = Sigma.Chunk.Set.empty let source = "Empty Model" let load _sigma _obj () = Warning.error ~source "Can not load value in Empty model" let copied _s _obj () () = [] let stored _s _obj () _ = [] let assigned _s _obj _sloc = [] let no_pointer () = Warning.error ~source "Can not compare pointers in Empty model" let is_null _ = no_pointer () let loc_eq _ _ = no_pointer () let loc_lt _ _ = no_pointer () let loc_leq _ _ = no_pointer () let loc_neq _ _ = no_pointer () let loc_diff _ _ _ = no_pointer () let frame _sigma = [] let alloc sigma _xs = sigma let scope _seq _s _xs = [] let valid _sigma _acs _l = Warning.error ~source "No validity" let invalid _sigma _l = Warning.error ~source "No validity" let global _sigma _p = p_true let included _s1 _s2 = no_pointer () let separated _s1 _s2 = no_pointer () ���������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemEmpty.mli����������������������������������������������������0000666�0000000�0000000�00000003531�13571573400�016353� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Empty Memory Model --- *) (* -------------------------------------------------------------------------- *) include Sigs.Model �����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemLoader.ml����������������������������������������������������0000666�0000000�0000000�00000034376�13571573400�016325� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Memory Model --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype open Definitions open Ctypes open Lang open Lang.F open Sigs (* -------------------------------------------------------------------------- *) (* --- Compound Loader --- *) (* -------------------------------------------------------------------------- *) let cluster () = Definitions.cluster ~id:"Compound" ~title:"Memory Compound Loader" () module type Model = sig module Chunk : Chunk module Sigma : Sigma with type chunk = Chunk.t val name : string type loc val sizeof : c_object -> int val field : loc -> fieldinfo -> loc val shift : loc -> c_object -> term -> loc val to_addr : loc -> term val to_region_pointer : loc -> int * term val of_region_pointer : int -> c_object -> term -> loc val domain : c_object -> loc -> Sigma.domain val frames : c_object -> loc -> Chunk.t -> frame list val last : Sigma.t -> c_object -> loc -> term val havoc : c_object -> loc -> length:term -> Chunk.t -> fresh:term -> current:term -> term val eqmem : c_object -> loc -> Chunk.t -> term -> term -> pred val eqmem_forall : c_object -> loc -> Chunk.t -> term -> term -> var list * pred * pred val load_int : Sigma.t -> c_int -> loc -> term val load_float : Sigma.t -> c_float -> loc -> term val load_pointer : Sigma.t -> typ -> loc -> loc val store_int : Sigma.t -> c_int -> loc -> term -> Chunk.t * term val store_float : Sigma.t -> c_float -> loc -> term -> Chunk.t * term val store_pointer : Sigma.t -> typ -> loc -> term -> Chunk.t * term end module Make (M : Model) = struct type chunk = M.Chunk.t module Chunk = M.Chunk module Sigma = M.Sigma module Domain = M.Sigma.Chunk.Set let signature ft = let s = Sigma.create () in let xs = ref [] in let cs = ref [] in Domain.iter (fun c -> cs := c :: !cs ; xs := (Sigma.get s c) :: !xs ; ) ft ; List.rev !xs , List.rev !cs , s let pp_rid fmt r = if r <> 0 then Format.fprintf fmt "_R%03d" r let loadrec = ref (fun _ _ _ -> assert false) (* -------------------------------------------------------------------------- *) (* --- Frame Lemmas for Compound Access --- *) (* -------------------------------------------------------------------------- *) let memories sigma chunks = List.map (Sigma.value sigma) chunks let assigned sigma c m chunks = List.map (fun c0 -> if Chunk.equal c0 c then m else Sigma.value sigma c0) chunks let frame_lemmas phi obj loc params chunks = begin let prefix = Fun.debug phi in let sigma = Sigma.create () in List.iter (fun chunk -> List.iter (fun (name,triggers,conditions,m1,m2) -> let mem1 = assigned sigma chunk m1 chunks in let mem2 = assigned sigma chunk m2 chunks in let value1 = e_fun phi (params @ mem1) in let value2 = e_fun phi (params @ mem2) in let vars1 = F.vars value1 in let vars2 = F.vars value2 in let l_triggers = if Vars.subset vars1 vars2 then [ (Trigger.of_term value2 :: triggers ) ] else if Vars.subset vars2 vars1 then [ (Trigger.of_term value1 :: triggers ) ] else [ (Trigger.of_term value1 :: triggers ); (Trigger.of_term value2 :: triggers ) ] in let l_name = Pretty_utils.sfprintf "%s_%s_%a" prefix name Chunk.pretty chunk in let l_lemma = F.p_hyps conditions (p_equal value1 value2) in Definitions.define_lemma { l_assumed = true ; l_name ; l_types = 0 ; l_triggers ; l_forall = F.p_vars l_lemma ; l_lemma = l_lemma ; l_cluster = cluster () ; } ) (M.frames obj loc chunk) ) chunks end (* -------------------------------------------------------------------------- *) (* --- Compound Loader --- *) (* -------------------------------------------------------------------------- *) module COMP_KEY = struct type t = int * compinfo let compare (r,c) (r',c') = if r=r' then Compinfo.compare c c' else r-r' let pretty fmt (r,c) = Format.fprintf fmt "%d:%a" r Compinfo.pretty c end module COMP = WpContext.Generator(COMP_KEY) (struct let name = M.name ^ ".COMP" type key = int * compinfo type data = lfun * chunk list let generate (r,c) = let x = Lang.freshvar ~basename:"p" (Lang.t_addr()) in let v = e_var x in let obj = C_comp c in let loc = M.of_region_pointer r obj v in (* t_pointer -> loc *) let domain = M.domain obj loc in let result = Lang.tau_of_comp c in let lfun = Lang.generated_f ~result "Load%a_%s" pp_rid r (Lang.comp_id c) in (* Since its a generated it is the unique name given *) let xms,chunks,sigma = signature domain in let def = List.map (fun f -> Cfield f , !loadrec sigma (object_of f.ftype) (M.field loc f) ) c.cfields in let dfun = Definitions.Function( result , Def , e_record def ) in Definitions.define_symbol { d_lfun = lfun ; d_types = 0 ; d_params = x :: xms ; d_definition = dfun ; d_cluster = cluster () ; } ; frame_lemmas lfun obj loc [v] chunks ; lfun , chunks let compile = Lang.local generate end) (* -------------------------------------------------------------------------- *) (* --- Array Loader --- *) (* -------------------------------------------------------------------------- *) module ARRAY_KEY = struct type t = int * arrayinfo * Matrix.matrix let pretty fmt (r,_,m) = Format.fprintf fmt "%d:%a" r Matrix.NATURAL.pretty m let compare (r1,_,m1) (r2,_,m2) = if r1 = r2 then Matrix.NATURAL.compare m1 m2 else r1-r2 end module ARRAY = WpContext.Generator(ARRAY_KEY) (struct open Matrix let name = M.name ^ ".ARRAY" type key = int * arrayinfo * Matrix.matrix type data = lfun * chunk list let generate (r,ainfo,(obj_e,ds)) = let x = Lang.freshvar ~basename:"p" (Lang.t_addr()) in let v = e_var x in let obj_a = C_array ainfo in let loc = M.of_region_pointer r obj_a v in (* t_pointer -> loc *) let domain = M.domain obj_a loc in let result = Matrix.tau obj_e ds in let lfun = Lang.generated_f ~result "Array%a%s_%s" pp_rid r (Matrix.id ds) (Matrix.natural_id obj_e) in let prefix = Lang.Fun.debug lfun in let axiom = prefix ^ "_access" in let xmem,chunks,sigma = signature domain in let denv = Matrix.denv ds in let phi = e_fun lfun (v :: denv.size_val @ List.map e_var xmem) in let va = List.fold_left e_get phi denv.index_val in let ofs = e_sum denv.index_offset in let vm = !loadrec sigma obj_e (M.shift loc obj_e ofs) in let lemma = p_hyps denv.index_range (p_equal va vm) in let cluster = cluster () in Definitions.define_symbol { d_lfun = lfun ; d_types = 0 ; d_params = x :: denv.size_var @ xmem ; d_definition = Logic result ; d_cluster = cluster ; } ; Definitions.define_lemma { l_assumed = true ; l_name = axiom ; l_types = 0 ; l_forall = F.p_vars lemma ; l_triggers = [[Trigger.of_term va]] ; l_lemma = lemma ; l_cluster = cluster ; } ; if denv.monotonic then begin let ns = List.map F.e_var denv.size_var in frame_lemmas lfun obj_a loc (v::ns) chunks end ; lfun , chunks let compile = Lang.local generate end) (* -------------------------------------------------------------------------- *) (* --- Loader --- *) (* -------------------------------------------------------------------------- *) let load_comp sigma comp loc = let r , p = M.to_region_pointer loc in let f , m = COMP.get (r,comp) in F.e_fun f (p :: memories sigma m) let load_array sigma a loc = let d = Matrix.of_array a in let r , p = M.to_region_pointer loc in let f , m = ARRAY.get (r,a,d) in F.e_fun f (p :: Matrix.size d @ memories sigma m) let loadvalue sigma obj loc = match obj with | C_int i -> M.load_int sigma i loc | C_float f -> M.load_float sigma f loc | C_pointer t -> snd @@ M.to_region_pointer @@ M.load_pointer sigma t loc | C_comp c -> load_comp sigma c loc | C_array a -> load_array sigma a loc let load sigma obj loc = let open Sigs in match obj with | C_int i -> Val (M.load_int sigma i loc) | C_float f -> Val (M.load_float sigma f loc) | C_pointer t -> Loc (M.load_pointer sigma t loc) | C_comp c -> Val (load_comp sigma c loc) | C_array a -> Val (load_array sigma a loc) let () = loadrec := loadvalue (* -------------------------------------------------------------------------- *) (* --- Havocs --- *) (* -------------------------------------------------------------------------- *) let havoc_length s obj loc length = let ps = ref [] in Domain.iter (fun chunk -> let pre = Sigma.value s.pre chunk in let post = Sigma.value s.post chunk in let tau = Chunk.tau_of_chunk chunk in let basename = Chunk.basename_of_chunk chunk ^ "_undef" in let fresh = F.e_var (Lang.freshvar ~basename tau) in let havoc = M.havoc obj loc ~length chunk ~fresh ~current:pre in ps := Set(post,havoc) :: !ps ) (M.domain obj loc) ; !ps let havoc seq obj loc = havoc_length seq obj loc F.e_one (* -------------------------------------------------------------------------- *) (* --- Stored & Copied --- *) (* -------------------------------------------------------------------------- *) let updated seq phi alpha loc value = let chunk,mem = phi seq.pre alpha loc value in [Set(Sigma.value seq.post chunk,mem)] let stored seq obj loc value = match obj with | C_int i -> updated seq M.store_int i loc value | C_float f -> updated seq M.store_float f loc value | C_pointer ty -> updated seq M.store_pointer ty loc value | C_comp _ | C_array _ -> Set(loadvalue seq.post obj loc, value) :: havoc seq obj loc let copied s obj p q = stored s obj p (loadvalue s.pre obj q) (* -------------------------------------------------------------------------- *) (* --- Assigned --- *) (* -------------------------------------------------------------------------- *) let assigned_loc seq obj loc = match obj with | C_int _ | C_float _ | C_pointer _ -> let x = Lang.freshvar ~basename:"v" (Lang.tau_of_object obj) in stored seq obj loc (e_var x) | C_comp _ | C_array _ -> havoc seq obj loc let assigned_range s obj l a b = havoc_length s obj (M.shift l obj a) (e_range a b) let assigned seq obj = function | Sloc loc -> assigned_loc seq obj loc | Sdescr(xs,loc,condition) -> let ps = ref [] in Domain.iter (fun c -> let m1 = Sigma.value seq.pre c in let m2 = Sigma.value seq.post c in let p,separated,equal = M.eqmem_forall obj loc c m1 m2 in let sep_from_all = F.p_forall xs (F.p_imply condition separated) in let phi = F.p_forall p (F.p_imply sep_from_all equal) in ps := Assert phi :: !ps ) (M.domain obj loc) ; !ps | Sarray(loc,obj,n) -> assigned_range seq obj loc e_zero (e_int (n-1)) | Srange(loc,obj,u,v) -> let a = match u with Some a -> a | None -> e_zero in let b = match v with Some b -> b | None -> M.last seq.pre obj loc in assigned_range seq obj loc a b (* -------------------------------------------------------------------------- *) end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemLoader.mli���������������������������������������������������0000666�0000000�0000000�00000007265�13571573400�016473� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Compound Loader *) open Cil_types open Definitions open Ctypes open Lang.F open Sigs val cluster : unit -> cluster (** Loader Model for Atomic Values *) module type Model = sig module Chunk : Chunk module Sigma : Sigma with type chunk = Chunk.t val name : string type loc val sizeof : c_object -> int val field : loc -> fieldinfo -> loc val shift : loc -> c_object -> term -> loc (** Conversion among loc, t_pointer terms and t_addr terms *) val to_addr : loc -> term val to_region_pointer : loc -> int * term val of_region_pointer : int -> c_object -> term -> loc val domain : c_object -> loc -> Sigma.domain val frames : c_object -> loc -> Chunk.t -> frame list val last : Sigma.t -> c_object -> loc -> term val havoc : c_object -> loc -> length:term -> Chunk.t -> fresh:term -> current:term -> term val eqmem : c_object -> loc -> Chunk.t -> term -> term -> pred val eqmem_forall : c_object -> loc -> Chunk.t -> term -> term -> var list * pred * pred val load_int : Sigma.t -> c_int -> loc -> term val load_float : Sigma.t -> c_float -> loc -> term val load_pointer : Sigma.t -> typ -> loc -> loc val store_int : Sigma.t -> c_int -> loc -> term -> Chunk.t * term val store_float : Sigma.t -> c_float -> loc -> term -> Chunk.t * term val store_pointer : Sigma.t -> typ -> loc -> term -> Chunk.t * term end (** Generates Loader for Compound Values *) module Make (M : Model) : sig val load : M.Sigma.t -> c_object -> M.loc -> M.loc Sigs.value val loadvalue : M.Sigma.t -> c_object -> M.loc -> term val havoc : M.Sigma.t sequence -> c_object -> M.loc -> equation list val havoc_length : M.Sigma.t sequence -> c_object -> M.loc -> term -> equation list val stored : M.Sigma.t sequence -> c_object -> M.loc -> term -> equation list val copied : M.Sigma.t sequence -> c_object -> M.loc -> M.loc -> equation list val assigned : M.Sigma.t sequence -> c_object -> M.loc sloc -> equation list end (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemMemory.ml����������������������������������������������������0000666�0000000�0000000�00000040075�13571573400�016360� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Memory Model --- *) (* -------------------------------------------------------------------------- *) open Lang open Lang.F module L = Qed.Logic let library = "memory" let a_addr = Lang.datatype ~library "addr" let t_addr = L.Data(a_addr,[]) let f_base = Lang.extern_f ~library ~result:L.Int ~link:{altergo = Qed.Engine.F_subst("%1.base"); why3 = Qed.Engine.F_call "base"; coq = Qed.Engine.F_subst("(base %1)"); } "base" let f_offset = Lang.extern_f ~library ~result:L.Int ~link:{altergo = Qed.Engine.F_subst("%1.offset"); why3 = Qed.Engine.F_call "offset"; coq = Qed.Engine.F_subst("(offset %1)"); } "offset" let f_shift = Lang.extern_f ~library ~result:t_addr "shift" let f_global = Lang.extern_f ~library ~result:t_addr ~category:L.Injection "global" let f_null = Lang.extern_f ~library ~result:t_addr "null" let f_base_offset = Lang.extern_f ~library ~category:Qed.Logic.Injection ~result:L.Int "base_offset" let ty_havoc = function | Some l :: _ -> l | _ -> raise Not_found let l_havoc = Qed.Engine.{ coq = F_call "fhavoc" ; altergo = F_call "havoc" ; why3 = F_call "havoc" ; } let p_valid_rd = Lang.extern_fp ~library "valid_rd" let p_valid_rw = Lang.extern_fp ~library "valid_rw" let p_invalid = Lang.extern_fp ~library "invalid" let p_separated = Lang.extern_fp ~library "separated" let p_included = Lang.extern_fp ~library "included" let p_eqmem = Lang.extern_fp ~library "eqmem" let f_havoc = Lang.extern_f ~library ~typecheck:ty_havoc ~link:l_havoc "havoc" let f_region = Lang.extern_f ~library ~result:L.Int "region" (* base -> region *) let p_framed = Lang.extern_fp ~library "framed" (* m-pointer -> prop *) let p_linked = Lang.extern_fp ~library "linked" (* allocation-table -> prop *) let p_sconst = Lang.extern_fp ~library "sconst" (* int-memory -> prop *) let p_addr_lt = Lang.extern_p ~library ~bool:"addr_lt_bool" ~prop:"addr_lt" () let p_addr_le = Lang.extern_p ~library ~bool:"addr_le_bool" ~prop:"addr_le" () let f_addr_of_int = Lang.extern_f ~category:L.Injection ~library ~result:t_addr "addr_of_int" let f_int_of_addr = Lang.extern_f ~category:L.Injection ~library ~result:L.Int "int_of_addr" (* -------------------------------------------------------------------------- *) (* --- Utilities --- *) (* -------------------------------------------------------------------------- *) let t_mem t = L.Array(t_addr,t) let t_malloc = L.Array(L.Int,L.Int) let a_null = F.constant (e_fun f_null []) let a_base p = e_fun f_base [p] let a_offset p = e_fun f_offset [p] let a_global b = e_fun f_global [b] let a_shift l k = e_fun f_shift [l;k] let a_addr b k = a_shift (a_global b) k let a_base_offset k = e_fun f_base_offset [k] (* -------------------------------------------------------------------------- *) (* --- Qed Simplifiers --- *) (* -------------------------------------------------------------------------- *) (* Pointer arithmetic for structure access and array access could be defined directly using the record [{ base = p.base; offset = p.offset + c*i + c' }]. However that gives very bad triggers for the memory model axiomatization, so `shift p (c*i+c')` was used instead. It is not sufficient for user axiomatisation because memory access in axioms require trigger with arithmetic operators which is badly handled by provers. So for each c and c', ie for each kind of structure access and array access a specific function is used `shift_xxx`. Moreover no simplification of `shift_xxx` is done for keeping the same terms in axioms and the goal. `base` and `offset` function simplify all the `shift_xxx` because it seems they don't appear often in axioms and they are useful for simplifying `separated`, `assigns` and pointer comparisons in goals. To sum up memory access should match, but not `\base`, `\offset`, `\separated`, ... *) type addr_builtin = { base: term list -> term ; offset: term list -> term ; } module ADDR_BUILTIN = WpContext.Static (struct type key = lfun type data = addr_builtin let name = "MemMemory.ADDR_BUILTIN" include Lang.Fun end) let phi_base l = match F.repr l with | L.Fun(f,[p;_]) when f==f_shift -> a_base p | L.Fun(f,[b]) when f==f_global -> b | L.Fun(f,[]) when f==f_null -> e_zero | L.Fun(f,args) -> (ADDR_BUILTIN.find f).base args | _ -> raise Not_found let phi_offset l = match F.repr l with | L.Fun(f,[p;k]) when f==f_shift -> e_add (a_offset p) k | L.Fun(f,_) when f==f_global || f==f_null -> F.e_zero | L.Fun(f,args) -> (ADDR_BUILTIN.find f).offset args | _ -> raise Not_found let phi_shift f p i = match F.repr p with | L.Fun(g,[q;j]) when f == g -> F.e_fun f [q;F.e_add i j] | _ -> raise Not_found let eq_shift a b = let p = a_base a in let q = a_base b in let i = a_offset a in let j = a_offset b in if i==j then F.p_equal p q else match F.is_equal p q with | L.No -> F.p_false | L.Yes -> F.p_equal i j | L.Maybe -> raise Not_found let eq_shift_gen phi a b = try phi a b with Not_found -> eq_shift a b let nop _ = raise Not_found let register ?(base=nop) ?(offset=nop) ?equal ?(linear=false) lfun = begin if base != nop || offset != nop then ADDR_BUILTIN.define lfun { base ; offset } ; if linear then F.set_builtin_2 lfun (phi_shift lfun) ; let phi_equal = match equal with | None -> eq_shift | Some phi -> eq_shift_gen phi in F.set_builtin_eqp lfun phi_equal ; end (* -------------------------------------------------------------------------- *) (* --- Simplifier for 'separated' --- *) (* -------------------------------------------------------------------------- *) let r_separated = function | [p;a;q;b] -> if a == F.e_one && b == F.e_one then F.e_neq p q else begin let a_negative = F.e_leq a F.e_zero in let b_negative = F.e_leq b F.e_zero in if a_negative == e_true || b_negative == e_true then e_true else let bp = a_base p in let bq = a_base q in let open Qed.Logic in match F.is_true (F.e_eq bp bq) with | No -> e_true (* Have S *) | Yes when (a_negative == e_false && b_negative == e_false) -> (* Reduced to S *) let p_ofs = a_offset p in let q_ofs = a_offset q in let p_ofs' = F.e_add p_ofs a in let q_ofs' = F.e_add q_ofs b in F.e_or [ F.e_leq q_ofs' p_ofs ; F.e_leq p_ofs' q_ofs ] | _ -> raise Not_found end | _ -> raise Not_found let is_separated args = F.is_true (r_separated args) (* -------------------------------------------------------------------------- *) (* --- Simplifier for 'included' --- *) (* -------------------------------------------------------------------------- *) (* logic a : int logic b : int predicate R = p.base = q.base /\ (q.offset <= p.offset) /\ (p.offset + a <= q.offset + b) predicate included = 0 < a -> ( 0 <= b and R ) predicate a_empty = a <= 0 predicate b_negative = b < 0 lemma SAME_P: p=q -> (R <-> a<=b) lemma SAME_A: a=b -> (R <-> p=q) goal INC_P: p=q -> (included <-> ( 0 < a -> a <= b )) (by SAME_P) goal INC_A: a=b -> 0 < a -> (included <-> R) (by SAME_A) goal INC_1: a_empty -> (included <-> true) goal INC_2: b_negative -> (included <-> a_empty) goal INC_3: not R -> (included <-> a_empty) goal INC_4: not a_empty -> not b_negative -> (included <-> R) *) let r_included = function | [p;a;q;b] -> if F.e_eq p q == F.e_true then F.e_imply [F.e_lt F.e_zero a] (F.e_leq a b) (* INC_P *) else if (F.e_eq a b == F.e_true) && (F.e_lt F.e_zero a == F.e_true) then F.e_eq p q (* INC_A *) else begin let a_empty = F.e_leq a F.e_zero in let b_negative = F.e_lt b F.e_zero in if a_empty == F.e_true then F.e_true (* INC_1 *) else if b_negative == F.e_true then a_empty (* INC_2 *) else let bp = a_base p in let bq = a_base q in let open Qed.Logic in match F.is_true (F.e_eq bp bq) with | No -> a_empty (* INC_3 *) | Yes when (a_empty == e_false && b_negative == e_false) -> (* INC_4 *) let p_ofs = a_offset p in let q_ofs = a_offset q in if a == b then F.e_eq p_ofs q_ofs else let p_ofs' = e_add p_ofs a in let q_ofs' = e_add q_ofs b in e_and [ F.e_leq q_ofs p_ofs ; F.e_leq p_ofs' q_ofs' ] | _ -> raise Not_found end | _ -> raise Not_found (* -------------------------------------------------------------------------- *) (* --- Simplifier for 'havoc' --- *) (* -------------------------------------------------------------------------- *) (* havoc(m_undef, havoc(_undef,m0,p0,a0), p1,a1) = - havoc(m_undef, m0, p1,a1) WHEN included (p1,a1,p0,a0) *) let r_havoc = function | [undef1;m1;p1;a1] -> begin match F.repr m1 with | L.Fun( f , [_undef0;m0;p0;a0] ) when f == f_havoc -> begin let open Qed.Logic in match F.is_true (r_included [p0;a0;p1;a1]) with | Yes -> F.e_fun f_havoc [undef1;m0;p1;a1] | _ -> raise Not_found end | _ -> raise Not_found end | _ -> raise Not_found (* havoc(undef,m,p,a)[k] = - undef[k] WHEN separated (p,a,k,1) - m[k] WHEN NOT separated (p,a,k,1) *) let r_get_havoc = function | [undef;m;p;a] -> (fun _ k -> match is_separated [p;a;k;e_one] with | L.Yes -> F.e_get m k | L.No -> F.e_get undef k | _ -> raise Not_found) | _ -> raise Not_found (* -------------------------------------------------------------------------- *) (* --- Simplifier for int/addr conversion --- *) (* -------------------------------------------------------------------------- *) let phi_int_of_addr p = if p == a_null then F.e_zero else match F.repr p with | L.Fun(f,[a]) when f == f_addr_of_int -> a | _ -> raise Not_found let phi_addr_of_int p = if p == F.e_zero then a_null else match F.repr p with | L.Fun(f,[a]) when f == f_int_of_addr -> a | _ -> raise Not_found (* -------------------------------------------------------------------------- *) (* --- Simplifiers Registration --- *) (* -------------------------------------------------------------------------- *) let () = Context.register begin fun () -> F.set_builtin_1 f_base phi_base ; F.set_builtin_1 f_offset phi_offset ; F.set_builtin_2 f_shift (phi_shift f_shift) ; F.set_builtin_eqp f_shift eq_shift ; F.set_builtin_eqp f_global eq_shift ; F.set_builtin p_separated r_separated ; F.set_builtin p_included r_included ; F.set_builtin f_havoc r_havoc ; F.set_builtin_get f_havoc r_get_havoc ; F.set_builtin_1 f_addr_of_int phi_addr_of_int ; F.set_builtin_1 f_int_of_addr phi_int_of_addr ; end (* -------------------------------------------------------------------------- *) (* --- Frame Conditions --- *) (* -------------------------------------------------------------------------- *) module T = Definitions.Trigger let frames ~addr:p ~offset:n ~sizeof:s ?(basename="mem") tau = let t_mem = L.Array(t_addr,tau) in let m = F.e_var (Lang.freshvar ~basename t_mem) in let m' = F.e_var (Lang.freshvar ~basename t_mem) in let p' = F.e_var (Lang.freshvar ~basename:"q" t_addr) in let n' = F.e_var (Lang.freshvar ~basename:"n" L.Int) in let mh = F.e_fun f_havoc [m';m;p';n'] in let v' = F.e_var (Lang.freshvar ~basename:"v" tau) in let meq = F.p_call p_eqmem [m;m';p';n'] in let diff = F.p_call p_separated [p;n;p';s] in let sep = F.p_call p_separated [p;n;p';n'] in let inc = F.p_call p_included [p;n;p';n'] in let teq = T.of_pred meq in [ "update" , [] , [diff] , m , e_set m p' v' ; "eqmem" , [teq] , [inc;meq] , m , m' ; "havoc" , [] , [sep] , m , mh ; ] (* -------------------------------------------------------------------------- *) (* --- Range Comparison --- *) (* -------------------------------------------------------------------------- *) type range = | LOC of term * term (* loc - size *) | RANGE of term * Vset.set (* base - range offset *) let range ~shift ~addrof ~sizeof = function | Sigs.Rloc(obj,loc) -> LOC( addrof loc , F.e_int (sizeof obj) ) | Sigs.Rrange(loc,obj,Some a,Some b) -> let s = sizeof obj in let p = addrof (shift loc obj a) in let n = e_fact s (e_range a b) in LOC( p , n ) | Sigs.Rrange(loc,_obj,None,None) -> RANGE( a_base (addrof loc) , Vset.range None None ) | Sigs.Rrange(loc,obj,Some a,None) -> let s = sizeof obj in RANGE( a_base (addrof loc) , Vset.range (Some (e_fact s a)) None ) | Sigs.Rrange(loc,obj,None,Some b) -> let s = sizeof obj in RANGE( a_base (addrof loc) , Vset.range None (Some (e_fact s b)) ) let range_set = function | LOC(l,n) -> let a = a_offset l in let b = e_add a n in a_base l , Vset.range (Some a) (Some b) | RANGE(base,set) -> base , set let r_included r1 r2 = match r1 , r2 with | LOC(l1,n1) , LOC(l2,n2) -> F.p_call p_included [l1;n1;l2;n2] | _ -> let base1,set1 = range_set r1 in let base2,set2 = range_set r2 in F.p_if (F.p_equal base1 base2) (Vset.subset set1 set2) (Vset.is_empty set1) let r_disjoint r1 r2 = match r1 , r2 with | LOC(l1,n1) , LOC(l2,n2) -> F.p_call p_separated [l1;n1;l2;n2] | _ -> let base1,set1 = range_set r1 in let base2,set2 = range_set r2 in F.p_imply (F.p_equal base1 base2) (Vset.disjoint set1 set2) let included ~shift ~addrof ~sizeof s1 s2 = let range = range ~shift ~addrof ~sizeof in r_included (range s1) (range s2) let separated ~shift ~addrof ~sizeof s1 s2 = let range = range ~shift ~addrof ~sizeof in r_disjoint (range s1) (range s2) (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemMemory.mli���������������������������������������������������0000666�0000000�0000000�00000010776�13571573400�016536� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Memory Theory --- *) (* -------------------------------------------------------------------------- *) open Lang open Lang.F (** {2 Theory} *) val t_addr : tau val t_malloc : tau (** allocation tables *) val t_mem : tau -> tau (** t_addr indexed array *) val a_null : term (** Null address. Same as [a_addr 0 0] *) val a_global : term -> term (** Zero-offset base. Same as [a_addr base 0] *) val a_addr : term -> term -> term (** Constructor for [{ base ; offset }] *) val a_shift : term -> term -> term (** Shift: [a_shift a k] adds [k] to [a.offset] *) val a_base : term -> term (** Returns the base *) val a_offset : term -> term (** Returns the offset *) val a_base_offset : term -> term (** Returns the offset in {i bytes} from the {i logic} offset (which is a memory cell index, actually) *) val f_null : lfun val f_base : lfun val f_global : lfun val f_shift : lfun val f_offset : lfun val f_havoc : lfun val f_region : lfun val f_addr_of_int : lfun (** Physical address *) val f_int_of_addr : lfun (** Physical address *) val p_addr_lt : lfun val p_addr_le : lfun val p_linked : lfun val p_framed : lfun val p_sconst : lfun val p_separated : lfun val p_included : lfun val p_valid_rd : lfun val p_valid_rw : lfun val p_invalid : lfun val p_eqmem : lfun (* -------------------------------------------------------------------------- *) (** {2 Addr Producer Registration} *) (** Register simplifiers for functions producing [addr] terms: - [~base es] is the simplifier for [(f es).base] - [~offset es] is the simplifier for [(f es).offset] - [~linear:true] register simplifier [f(f(p,i),k)=f(p,i+j)] on [f] - [~equal a b] is the [set_eq_builtin] for [f] The equality builtin is wrapped inside a default builtin that compares [f es] by computing [base] and [offset]. *) val register : ?base:(term list -> term) -> ?offset:(term list -> term) -> ?equal:(term -> term -> pred) -> ?linear:bool -> lfun -> unit (** {2 Frame Conditions} [frames ~addr] are frame conditions for reading a value at address [addr] from a chunk of memory. The value read at [addr] have length [offset], while individual element in memory chunk have type [tau] and offset length [sizeof]. Memory variables use [~basename] or ["mem"] by default. *) val frames : addr:term -> offset:term -> sizeof:term -> ?basename:string -> tau -> Sigs.frame list (** {2 Range of Address} *) val separated : shift:('a -> Ctypes.c_object -> term -> 'a) -> addrof:('a -> term) -> sizeof:(Ctypes.c_object -> int) -> 'a Sigs.rloc -> 'a Sigs.rloc -> pred val included : shift:('a -> Ctypes.c_object -> term -> 'a) -> addrof:('a -> term) -> sizeof:(Ctypes.c_object -> int) -> 'a Sigs.rloc -> 'a Sigs.rloc -> pred (* -------------------------------------------------------------------------- *) ��frama-c-20.0-Calcium/src/plugins/wp/MemRegion.ml����������������������������������������������������0000666�0000000�0000000�00000071772�13571573400�016343� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* TODO DEVEL MODE *) [@@@ warning "-32-37-60"] (* -------------------------------------------------------------------------- *) (* --- Region Memory Model --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Sigs open Definitions module Wp = Wp_parameters module F = Lang.F module L = Qed.Logic (* -------------------------------------------------------------------------- *) (* --- Why-3 Region Theory --- *) (* -------------------------------------------------------------------------- *) let library = "region" let cluster_region () = Definitions.cluster ~id:"Region" ~title:"Region Index Constructors" () (* Index *) let t_addr = MemMemory.t_addr let t_index = L.Data( Lang.datatype ~library "index" ,[] ) let f_addrof = Lang.extern_f ~library ~result:t_addr "addrof" let f_consistent = Lang.extern_fp ~library "consistent" let f_consistent_range = Lang.extern_fp ~library "consistent_range" let a_addrof l = F.e_fun f_addrof [l] let p_consistent l = F.p_call f_consistent [l] let p_consistent_range l n = F.p_call f_consistent_range [l;n] let p_range k n ps = F.(p_leq e_zero k :: p_lt k n :: ps) (* Null *) let f_inull = Lang.extern_f ~library ~result:t_index "inull" let l_inull = F.e_fun f_inull [] let a_null = MemMemory.a_null let p_inull l = F.p_equal a_null (a_addrof l) (* Address *) let p_separated p n q m = F.p_call MemMemory.p_separated [p;n;q;m] (* Constructors *) let region_ctor ~result = Lang.extern_f ~library ~category:L.Constructor ~result "%s" let f_addr_var = region_ctor ~result:t_addr "addr_var" let f_addr_ref = region_ctor ~result:t_addr "addr_ref" let f_base_var = region_ctor ~result:L.Int "base_var" let f_base_ref = region_ctor ~result:L.Int "base_ref" let f_index_var = region_ctor ~result:t_index "index_var" let f_index_ref = region_ctor ~result:t_index "index_ref" let f_index_mem = region_ctor ~result:t_index "index_mem" let a_addr_var x = F.e_fun f_addr_var [x] let a_addr_ref p = F.e_fun f_addr_ref [p] let l_index_var x = F.e_fun f_index_var [F.e_int x] let l_index_mem l k n = F.e_fun f_index_ref [l;k;n] let l_index_ref l = F.e_fun f_index_ref [l] (* Shifts *) let a_shift = MemMemory.a_shift let f_shift_index = Lang.extern_f ~library ~result:t_index "shift_index" let l_shift_index l p = F.e_fun f_shift_index [l;p] (* Bits *) let t_bits = L.Int (* -------------------------------------------------------------------------- *) (* --- Index Simplifiers --- *) (* -------------------------------------------------------------------------- *) type index_builtin = { index: (Lang.lfun -> F.term list -> F.term -> F.term) ; addrof : (F.term list -> F.term) ; consistent : (F.term list -> F.pred) ; } module IndexBuiltin = WpContext.Static (struct type key = Lang.lfun type data = index_builtin let name = "MemRegion.INDEXER" include Lang.Fun end) (* f enjoys shifting props: - f(l,p,...)+k == f(l,p+k,...) - &f(l,p,...) = &l+p *) let is_shiftable f = ( f == f_shift_index ) || ( f == f_index_mem) let phi_addrof index = match F.repr index with | L.Fun(f,[]) when f == f_inull -> a_null | L.Fun(f,[x]) when f == f_index_var -> a_addr_var x | L.Fun(f,[l]) when f == f_index_ref -> a_addr_ref (a_addrof l) | L.Fun(f,l::p::_) when is_shiftable f -> a_shift (a_addrof l) p | L.Fun(f,es) -> (IndexBuiltin.find f).addrof es | _ -> raise Not_found let phi_shift_index l p = if p == F.e_zero then l else match F.repr l with | L.Fun(f,l::q::w) when is_shiftable f -> F.e_fun f (l::(F.e_add p q)::w) | L.Fun(f,es) -> (IndexBuiltin.find f).index f es p | _ -> raise Not_found let phi_consistent index = match F.repr index with | L.Fun(f,[]) when f == f_inull -> F.e_false | L.Fun(f,[x]) when f == f_index_var -> F.e_neq x F.e_zero | L.Fun(f,[l]) when f == f_index_ref -> F.e_prop @@ p_consistent l | L.Fun(f,[l;k;n]) when f == f_index_mem -> F.e_prop @@ F.p_conj @@ p_range k n [p_consistent l] | L.Fun(f,es) -> F.e_prop @@ (IndexBuiltin.find f).consistent es | _ -> raise Not_found let phi_consistent_range index sizeof = match F.repr index with | L.Fun(f,[l;k;n]) when f == f_index_mem -> F.e_prop @@ F.p_conj @@ F.[ p_leq e_zero sizeof ; p_leq e_zero k ; p_leq (e_add k sizeof) n ; p_consistent l ; ] | _ -> raise Not_found let () = Context.register begin fun () -> MemMemory.register f_addr_var ~base:(F.e_fun f_base_var) ~offset:(fun _ -> F.e_zero) ; MemMemory.register f_addr_ref ~base:(F.e_fun f_base_ref) ; F.set_builtin_1 f_addrof phi_addrof ; F.set_builtin_1 f_consistent phi_consistent ; F.set_builtin_2 f_shift_index phi_shift_index ; F.set_builtin_2 f_consistent_range phi_consistent_range ; end let cid = ref 0 (* TODO: projectified *) let constructor ~basename ~params ~index ~addrof ~consistent = let id = incr cid ; !cid in let lfun = Lang.generated_f ~result:t_index "%s_%d" basename id in let ps = List.map F.e_var params in let l = F.e_fun lfun ps in let k = Lang.freshvar ~basename:"k" L.Int in let ofs = F.e_var k in (* Must compute properties before registering simplifiers *) let p_addrof = F.p_equal (a_addrof l) (addrof ps) in let p_consistent = F.p_equiv (p_consistent l) (consistent ps) in let p_index = F.p_equal (l_shift_index l ofs) (index lfun ps ofs) in IndexBuiltin.define lfun { index ; addrof ; consistent } ; fun cluster -> begin Definitions.define_symbol { d_cluster = cluster ; d_lfun = lfun ; d_params = params ; d_types = 0 ; d_definition = Logic t_index ; } ; Definitions.define_lemma { l_cluster = cluster ; l_assumed = true ; l_name = Printf.sprintf "addrof_%s_%d" basename id ; l_forall = params ; l_types = 0 ; l_triggers = [] ; l_lemma = p_addrof ; } ; Definitions.define_lemma { l_cluster = cluster ; l_assumed = true ; l_name = Printf.sprintf "consistent_%s_%d" basename id ; l_forall = params ; l_types = 0 ; l_triggers = [] ; l_lemma = p_consistent ; } ; if p_index != F.p_true then Definitions.define_lemma { l_cluster = cluster ; l_assumed = true ; l_name = Printf.sprintf "index_%s_%d" basename id ; l_forall = params @ [k] ; l_types = 0 ; l_triggers = [] ; l_lemma = p_index ; } ; lfun end (* -------------------------------------------------------------------------- *) (* --- Field Index Constructors --- *) (* -------------------------------------------------------------------------- *) module FIELD = struct type t = int list (* Overlay offsets *) let pretty fmt = function | [] -> Format.fprintf fmt "{}" | p::ps -> begin Format.fprintf fmt "@[<hov 2>{%d" p ; List.iter (fun p -> Format.fprintf fmt ",@,%d" p) ps ; Format.fprintf fmt "}@]" ; end let compare = Pervasives.compare (* Extract constant offset *) let offset k = let rec walk s a = match F.repr a with | L.Add es -> List.fold_left walk s es | L.Kint z -> (try s + Integer.to_int z with Z.Overflow -> s) | _ -> s in walk 0 k let builtin_index f es q = match es with | [l;p] -> F.e_fun f [l;F.e_add q p] | _ -> raise Not_found let builtin_addrof = function | [l;p] -> a_shift (a_addrof l) p | _ -> raise Not_found let builtin_consistent fds = function | [l;p] -> F.p_and (p_consistent l) (F.p_any (fun fd -> F.p_equal (F.e_int fd) p) fds) | _ -> raise Not_found end (* Model Independant Generators *) module FIELD_GEN = WpContext.StaticGenerator(FIELD) (struct type key = FIELD.t type data = cluster -> Lang.lfun let name = "MemRegion.FIELD_GEN" let compile fds = let l = Lang.freshvar ~basename:"l" t_index in let p = Lang.freshvar ~basename:"p" L.Int in constructor ~basename:"field" ~params:[l;p] ~index:FIELD.builtin_index ~addrof:FIELD.builtin_addrof ~consistent:(FIELD.builtin_consistent fds) end) (* Model Dependent Definitions *) module FIELD_MODEL = WpContext.Generator(FIELD) (struct type key = FIELD.t type data = Lang.lfun let name = "MemRegion.FIELD_MODEL" let compile fds = FIELD_GEN.get fds @@ cluster_region () end) let l_field ovl l k = let fds = List.map (fun rg -> rg.Layout.ofs) ovl in F.e_fun (FIELD_MODEL.get fds) [l;k] (* -------------------------------------------------------------------------- *) (* --- Array Index Constructors --- *) (* -------------------------------------------------------------------------- *) module ARRAY = struct type t = int * int list let compare = Pervasives.compare let pretty fmt (s,ds) = Format.fprintf fmt "%d%a" s Layout.Matrix.pretty ds (* Coefficient from Matrix dimensions: c_i = \Pi_{i<j} d_j *) let coefs s ds = let rec walk cs s = function | d::ds -> walk (s::cs) (d*s) ds | [] -> cs in walk [] s ds (* All zeroes *) let zeroes = List.map (fun _ -> F.e_zero) (* Address shift with coefficient c_i for each index k_i *) let rec shift a cs ks = match cs , ks with | c::cs , k::ks -> shift (a_shift a (F.e_fact c k)) cs ks | _ -> a (* Address of an array index *) let builtin_addrof cs = function | l::ks -> shift (a_addrof l) cs ks | _ -> raise Not_found (* Add conditions (0 <= ki < ni) to [ps]. WARNING: ns = rev ds *) let rec add_range_dims ps ks ns = match ks , ns with | k::ks , n::ns -> add_range_dims F.(p_range k (e_int n) ps) ks ns | k::ks , [] -> add_range_dims F.(p_equal e_zero k :: ps) ks [] | [] , _ -> ps (* Consistent index. WARNING: ns = rev ds *) let builtin_consistent ns = function | l::ks -> F.p_conj (add_range_dims [p_consistent l] ks ns) | _ -> raise Not_found (* Extract linear forms *) let rec get_linear poly a = match F.repr a with | L.Add es -> List.fold_left get_linear poly es | L.Kint z -> (try (Integer.to_int z,F.e_one)::poly with Z.Overflow -> (1,a)::poly) | L.Times(c,e) -> (try (Integer.to_int c,e)::poly with Z.Overflow -> (1,a)::poly) | _ -> (1,a)::poly (* Some of linear form *) let rec add_linear s = function | (k,e)::poly -> add_linear (F.e_add s (F.e_fact k e)) poly | [] -> s (* Euclidian division *) (* euclid q r ci p = q',r' <-> p + ci.q + r = ci.q' + r' *) let rec euclid q r ci = function | [] -> q,r | (c,k)::poly -> let q0 = c / ci in let r0 = c mod ci in euclid (F.e_add q (F.e_fact q0 k)) ((r0,k)::r) ci poly (* Linear offset decomposed on each coefficient *) let rec add_linear_index cs ks ks' p = match cs , ks with | c :: cs , k :: ks -> let k' , r = euclid k [] c p in add_linear_index cs ks (k'::ks') r | _ -> List.rev_append ks' ks , p (* Linear offset and remainder delta *) let offset cs ks p = let ks',r = add_linear_index cs ks [] (get_linear [] p) in ks' , add_linear F.e_zero r (* Builtin simplifier *) let builtin_index cs f es p = match es with | l::ks -> let ks' , r = offset cs ks p in if Qed.Hcons.equal_list F.equal ks ks' then raise Not_found else let l' = F.e_fun f (l :: ks) in l_shift_index l' r | _ -> raise Not_found end module ARRAY_GEN = WpContext.StaticGenerator(ARRAY) (struct type key = ARRAY.t type data = (cluster -> Lang.lfun) let name = "MemRegion.ARRAY_GEN" let compile (s,ds) = let l = Lang.freshvar ~basename:"l" t_index in let ks = List.map (fun _ -> Lang.freshvar ~basename:"k" L.Int) ds in let cs = ARRAY.coefs s ds in let ns = List.rev ds in constructor ~basename:"array" ~params:(l::ks) ~index:(ARRAY.builtin_index cs) ~addrof:(ARRAY.builtin_addrof cs) ~consistent:(ARRAY.builtin_consistent ns) end) module ARRAY_MODEL = WpContext.Generator(ARRAY) (struct type key = ARRAY.t type data = Lang.lfun let name = "MemRegion.ARRAY_MODEL" let compile dim = ARRAY_GEN.get dim @@ cluster_region () end) let l_array s ds l ks = F.e_fun (ARRAY_MODEL.get (s,ds)) (l::ks) (* -------------------------------------------------------------------------- *) (* --- Model Context --- *) (* -------------------------------------------------------------------------- *) let datatype = "MemRegion" let configure () = begin Context.set Lang.pointer (fun _ -> t_index) ; Context.set Cvalues.null p_inull ; end let configure_ia = let no_binder = { bind = fun _ f v -> f v } in fun _vertex -> no_binder let hypotheses () = [] let error msg = Warning.error ~source:"Region Model" msg (* -------------------------------------------------------------------------- *) (* --- Region Maps --- *) (* -------------------------------------------------------------------------- *) let map () = RegionAnalysis.get begin match WpContext.get_scope () with | WpContext.Global -> None | WpContext.Kf kf -> Some kf end (* -------------------------------------------------------------------------- *) (* --- Locations --- *) (* -------------------------------------------------------------------------- *) open Layout type region = Region.region type index = F.term let pp_index = F.pp_term let pp_region = Region.R.pretty let pp_value = Value.pretty pp_region let pp_args fmt = function | [] -> () | k::ks -> F.pp_term fmt k ; List.iter (fun k -> Format.fprintf fmt "@,,%a" F.pp_term k) ks let pp_field fmt k = if F.is_atomic k then Format.fprintf fmt "@,+%a" F.pp_term k else Format.fprintf fmt "@,+(%a)" F.pp_term k let pp_delta fmt k = if k != F.e_zero then pp_field fmt k type loc = | GarbledMix (* any possible location *) | Index of index (* unqualified address *) | Lref of region * index * region | Lmem of region * index * root * region value | Lraw of region * index * root * region option | Lfld of region * index * F.term * region overlay | Larr of region * index * F.term * F.term list * int * int list (* For Lxxx locations: - index: start index inside the chunk - term: additional shift index - term list: array index from start *) (* -------------------------------------------------------------------------- *) (* --- Loc Basics --- *) (* -------------------------------------------------------------------------- *) let null = Index l_inull let vars = function | GarbledMix -> F.Vars.empty | Index l | Lref(_,l,_) | Lmem(_,l,_,_) | Lraw(_,l,_,_) -> F.vars l | Lfld(_,l,k,_) -> F.Vars.union (F.vars l) (F.vars k) | Larr(_,l,k,ks,_,_) -> Qed.Hcons.fold_list F.Vars.union F.vars F.Vars.empty (l::k::ks) let occurs x = function | GarbledMix -> false | Index l | Lref(_,l,_) | Lmem(_,l,_,_) | Lraw(_,l,_,_) -> F.occurs x l | Lfld(_,l,k,_) -> F.occurs x l || F.occurs x k | Larr(_,l,k,ks,_,_) -> List.exists (F.occurs x) (l::k::ks) let pretty fmt = function | GarbledMix -> Format.pp_print_string fmt "garbled-mix" | Index l -> Format.fprintf fmt "@[<hov 2>Index(%a)@]" pp_index l | Lref(r,l,r') -> Format.fprintf fmt "@[<hov 2>Ref@,{%a->%a}@,(%a)@]" pp_region r pp_region r' pp_index l | Lmem(r,l,_,v) -> Format.fprintf fmt "@[<hov 2>Mem@,{%a:@,%a}@,(%a)@]" pp_region r pp_value v pp_index l | Lraw(r,l,_,None) -> Format.fprintf fmt "@[<hov 2>Raw@,{%a}@,(%a)" pp_region r pp_index l | Lraw(r,l,_,Some r') -> Format.fprintf fmt "@[<hov 2>Raw@,{%a->%a}@,(%a)" pp_region r pp_region r' pp_index l | Lfld(r,l,k,_) -> Format.fprintf fmt "@[<hov 2>Field@,{%a}@,(%a%a)@]" pp_region r pp_index l pp_field k | Larr(r,l,k,ks,_,_) -> Format.fprintf fmt "@[<hov 2>Index@,{%a}@,@[<hov 2>(%a[%a]%a)@]@]" pp_region r pp_index l pp_args ks pp_delta k (* -------------------------------------------------------------------------- *) (* --- Loc Constructors --- *) (* -------------------------------------------------------------------------- *) let rec index map (r:region) (l:index) (ofs:F.term) (len:int) = index_chunk map r l ofs len (Region.chunk map r) and index_chunk map (r:region) l ofs len = function | Mref r' -> Lref(r,l_shift_index l ofs,r') | Mraw(m,p) -> Lraw(r,l_shift_index l ofs,m,p) | Mmem(m,v) -> Lmem(r,l_shift_index l ofs,m,v) | Mcomp(_,[{ofs=0;reg;dim}]) -> index_dim map reg l ofs len dim | Mcomp(_,overlay) -> index_field map r l ofs len overlay and index_field map r l ofs len overlay = try let k = FIELD.offset ofs in let rg = List.find (Layout.Range.included k len) overlay in let fd = F.e_int k in let l' = l_field overlay l fd in index_dim map rg.reg l' (F.e_sub ofs fd) len rg.dim with Not_found -> Lfld(r,l,ofs,overlay) and index_dim map r l ofs len = function | Raw s | Dim(s,[]) -> index map r (l_index_mem l F.e_zero (F.e_int s)) ofs len | Dim(s,ds) -> index_array map r l (ARRAY.zeroes ds) ofs len s ds and index_array map r l ks ofs len s ds = let cs = ARRAY.coefs s ds in let ks,ofs = ARRAY.offset cs ks ofs in if len <= s then let l' = l_array s ds l ks in index map r l' ofs len else Larr(r,l,ofs,ks,s,ds) and shift_index_loc map loc ofs len = match loc with | GarbledMix -> GarbledMix | Index l -> Index (l_shift_index l ofs) | Lref(r,l,r') -> Lref(r,l_shift_index l ofs,r') | Lmem(r,l,m,v) -> Lmem(r,l_shift_index l ofs,m,v) | Lraw(r,l,m,p) -> Lraw(r,l_shift_index l ofs,m,p) | Lfld(r,l,k,overlay) -> index_field map r l (F.e_add k ofs) len overlay | Larr(r,l,k,ks,s,ds) -> index_array map r l ks (F.e_add k ofs) len s ds let cvar x = let map = map () in let region = Region.of_cvar map x in let id = if Cil.isConstType x.vtype then - x.vid else x.vid in index map region (l_index_var id) F.e_zero (Cil.bitsSizeOf x.vtype) let field loc fd = let map = map () in let ofs,len = Region.field_offset map fd in shift_index_loc map loc (F.e_int ofs) len let shift loc obj n = let map = map () in let s = Ctypes.bits_sizeof_object obj in shift_index_loc map loc (F.e_fact s n) s let pointer_loc l = Index l let pointer_val = function | GarbledMix -> error "Can not obtain address of Garbled-Mix location" | Index l | Lref(_,l,_) | Lmem(_,l,_,_) | Lraw(_,l,_,_) -> l | Lfld(_,l,k,overlay) -> l_field overlay l k | Larr(_,l,k,ks,s,ds) -> l_shift_index (l_array s ds l ks) k let loc_of_index re ty l = index (map()) re l F.e_zero (Cil.bitsSizeOf ty) (* -------------------------------------------------------------------------- *) (* --- Chunks --- *) (* -------------------------------------------------------------------------- *) type chunk = | Mu_alloc | Mu_raw of region * root | Mu_mem of region * root * region value module Chunk = struct type t = chunk let self = "region" let id = function | Mu_raw(r,_) | Mu_mem(r,_,_) -> Region.id r | Mu_alloc -> Region.noid let hash m = id m let compare m m' = if m==m then 0 else Pervasives.compare (id m) (id m') let equal m m' = m==m' || (id m = id m') let tau_of_value = function | Int _ -> L.Int | Float _ -> L.Real | Pointer _ -> t_index let tau_of_chunk = function | Mu_alloc -> MemMemory.t_malloc | Mu_raw _ -> t_bits | Mu_mem(_,root,v) -> let value = tau_of_value v in if Root.indexed root then L.Array(t_addr,value) else value let basename_of_chunk = function | Mu_raw _ -> "B" | Mu_mem(_,root,Int _) -> if Root.indexed root then "M" else "V" | Mu_mem(_,root,Float _) -> if Root.indexed root then "Mf" else "F" | Mu_mem(_,root,Pointer _) -> if Root.indexed root then "Mp" else "M" | Mu_alloc -> "A" let is_framed = function | Mu_raw(_,root) | Mu_mem(_,root,_) -> Root.framed root | Mu_alloc -> false let pretty fmt mu = Format.pp_print_string fmt (basename_of_chunk mu) end module Heap = struct include Qed.Collection.Make(Chunk) let empty = Set.empty let of_raw r rt = Set.singleton (Mu_raw(r,rt)) let of_mem r rt v = Set.singleton (Mu_mem(r,rt,v)) let rec of_region map r = match Region.chunk map r with | Mref _ -> Set.empty | Mraw(rt,_) -> of_raw r rt | Mmem(rt,v) -> of_mem r rt v | Mcomp(_,overlay) -> of_overlay map overlay and of_range map { reg } = of_region map reg and of_overlay map ovl = Qed.Hcons.fold_list Set.union (of_range map) empty ovl end module Sigma = Sigma.Make(Chunk)(Heap) type sigma = Sigma.t type domain = Sigma.domain let domain _obj = function | GarbledMix | Index _ -> error "Can not compute Garbled-mix domain" | Lref _ -> Heap.empty | Lraw(r,_,rt,_) -> Heap.of_raw r rt | Lmem(r,_,rt,v) -> Heap.of_mem r rt v | Lfld(_,_,_,ovl) -> Heap.of_overlay (map()) ovl | Larr(r,_,_,_,_,_) -> Heap.of_region (map()) r let region_of_loc = function | (GarbledMix | Index _) as l -> error "Can not find region of %a" pretty l | Lref(r,_,_) | Lraw(r,_,_,_) | Lmem(r,_,_,_) | Lfld(r,_,_,_) | Larr(r,_,_,_,_,_) -> r (* -------------------------------------------------------------------------- *) (* --- Loader --- *) (* -------------------------------------------------------------------------- *) module MODEL = struct module Chunk = Chunk module Sigma = Sigma let name = "MemRegion.LOADER" type nonrec loc = loc let field = field let shift = shift let sizeof = Ctypes.bits_sizeof_object let domain = domain let frames _ _ _ = [] let to_addr l = a_addrof (pointer_val l) let to_region_pointer l = Region.id (region_of_loc l) , pointer_val l let of_region_pointer r obj l = let map = map () in index map (Region.region map r) l F.e_zero (Ctypes.bits_sizeof_object obj) let load_mem sigma r rt v l = let m = Sigma.value sigma (Mu_mem(r,rt,v)) in if Root.indexed rt then F.e_get m (a_addrof l) else m let load_int sigma i = function | Lmem(r,l,rt,(Int i0 as v)) when i = i0 -> load_mem sigma r rt v l | l -> error "Can not load %a value from %a" Ctypes.pp_int i pretty l let load_float sigma f = function | Lmem(r,l,rt,(Float f0 as v)) when f = f0 -> load_mem sigma r rt v l | l -> error "Can not load %a value from %a" Ctypes.pp_float f pretty l let load_pointer sigma ty = function | Lmem(r,l,rt,(Pointer r' as v)) -> loc_of_index r' ty (load_mem sigma r rt v l) | Lref(_,l,r') -> loc_of_index r' ty (l_index_ref l) | l -> error "Can not load pointer value from %a" pretty l let havoc obj loc ~length (chunk:chunk) ~fresh ~current = match chunk with | Mu_alloc -> fresh | Mu_raw _ -> error "Can not havoc raw memories" | Mu_mem(_,root,_) -> if Layout.Root.indexed root then let addr = to_addr loc in let offset = F.e_fact (Ctypes.bits_sizeof_object obj) length in F.e_fun MemMemory.f_havoc [fresh;current;addr;offset] else fresh let eqmem obj loc chunk m1 m2 = match chunk with | Mu_alloc -> error "Can not compare allocation tables" | Mu_raw _ -> error "Can not compare raw memories" | Mu_mem(_,root,_) -> if Layout.Root.indexed root then let addr = to_addr loc in let offset = F.e_int (Ctypes.bits_sizeof_object obj) in F.p_call MemMemory.p_eqmem [m1;m2;addr;offset] else F.p_equal m1 m2 let eqmem_forall obj loc chunk m1 m2 = match chunk with | Mu_alloc -> error "Can not compare allocation tables" | Mu_raw _ -> error "Can not compare raw memories" | Mu_mem(_,root,_) -> if Layout.Root.indexed root then let xp = Lang.freshvar ~basename:"p" t_addr in let p = F.e_var xp in let a = to_addr loc in let n = F.e_int (Ctypes.bits_sizeof_object obj) in let separated = p_separated p F.e_one a n in let equal = F.p_equal (F.e_get m1 p) (F.e_get m2 p) in [xp],separated,equal else [],F.p_true,F.p_equal m1 m2 let last _ = error "Can not compute last valid index" let store_mem sigma r rt v l value = let c = Mu_mem(r,rt,v) in if Root.indexed rt then c , F.e_set (Sigma.value sigma c) (a_addrof l) value else c , value let store_int sigma i loc value = match loc with | Lmem(r,l,rt,(Int i0 as v)) when i = i0 -> store_mem sigma r rt v l value | _ -> error "Can not store %a value into %a" Ctypes.pp_int i pretty loc let store_float sigma f loc value = match loc with | Lmem(r,l,rt,(Float f0 as v)) when f = f0 -> store_mem sigma r rt v l value | _ -> error "Can not store %a value into %a" Ctypes.pp_float f pretty loc let store_pointer sigma _ty loc value = match loc with | Lmem(r,l,rt,(Pointer _ as v)) -> store_mem sigma r rt v l value | _ -> error "Can not store pointer values into %a" pretty loc end module LOADER = MemLoader.Make(MODEL) let load = LOADER.load let loadvalue = LOADER.loadvalue let stored = LOADER.stored let copied = LOADER.copied let assigned = LOADER.assigned (* -------------------------------------------------------------------------- *) (* --- Loc Segments --- *) (* -------------------------------------------------------------------------- *) type segment = loc rloc let region_of_sloc = function Rloc(_,l) | Rrange(l,_,_,_) -> region_of_loc l let disjoint_region s1 s2 = let map = map () in let c1 = Region.chunks map (region_of_sloc s1) in let c2 = Region.chunks map (region_of_sloc s2) in not (Qed.Intset.intersect c1 c2) let addrof = MODEL.to_addr let sizeof = Ctypes.bits_sizeof_object let included s1 s2 = if disjoint_region s1 s2 then F.p_false else MemMemory.included ~shift ~addrof ~sizeof s1 s2 let separated s1 s2 = if disjoint_region s1 s2 then F.p_true else MemMemory.separated ~shift ~addrof ~sizeof s1 s2 (* -------------------------------------------------------------------------- *) (* --- TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO --- *) (* -------------------------------------------------------------------------- *) type state = unit let state _ = () let iter _ _ = () let lookup _ _ = Mterm let updates _ _ = Bag.empty let apply _ _ = () let literal ~eid _ = ignore eid ; GarbledMix let base_addr _l = GarbledMix let base_offset l = MemMemory.a_offset (addrof l) let block_length _s _obj _l = F.e_zero let cast _ _l = GarbledMix let loc_of_int _ _ = GarbledMix let int_of_loc _ _ = F.e_zero let not_yet_pointer () = error "Pointer comparison not yet implemented" let is_null _ = not_yet_pointer () let loc_eq _ _ = not_yet_pointer () let loc_lt _ _ = not_yet_pointer () let loc_leq _ _ = not_yet_pointer () let loc_neq _ _ = not_yet_pointer () let loc_diff _ _ _ = not_yet_pointer () let frame _sigma = [] let alloc sigma _xs = sigma let scope _seq _s _xs = [] let valid _sigma _acs _l = error "Validity not yet implemented" let invalid _sigma _l = error "Validity not yet implemented" let global _sigma _p = F.p_true ������frama-c-20.0-Calcium/src/plugins/wp/MemRegion.mli���������������������������������������������������0000666�0000000�0000000�00000003531�13571573400�016500� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Empty Memory Model --- *) (* -------------------------------------------------------------------------- *) include Sigs.Model �����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemTyped.ml�����������������������������������������������������0000666�0000000�0000000�00000111554�13571573400�016176� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Empty Memory Model --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype open Ctypes open Lang open Lang.F open Sigs open Definitions open MemMemory let dkey_layout = Wp_parameters.register_category "layout" module L = Qed.Logic (* -------------------------------------------------------------------------- *) (* --- Model Configuration --- *) (* -------------------------------------------------------------------------- *) let datatype = "MemTyped" let hypotheses () = [] let configure () = begin Context.set Lang.pointer (fun _ -> t_addr) ; Context.set Cvalues.null (p_equal a_null) ; end let configure_ia = let no_binder = { bind = fun _ f v -> f v } in fun _vertex -> no_binder (* -------------------------------------------------------------------------- *) (* --- Model Parameters --- *) (* -------------------------------------------------------------------------- *) type pointer = NoCast | Fits | Unsafe let pointer = Context.create "MemTyped.pointer" (* -------------------------------------------------------------------------- *) (* --- Model Semantics --- *) (* -------------------------------------------------------------------------- *) (* the semantic is defined using these notions: - base, offset: has the usual C semantic - memory model consists of: - an allocation table A : base -> int - for each kind of cell (char,int,float,pointer(ptr)) with type T, a map (M_T) : addr -> T - a pointer is record { base ; offset }, offset are in number of cells - allocation table: indicate the size (in number of cell not sizeof) allocated of each base. - = 0 : free - > 0 : allocated read-write - < 0 : allocated read only semantic of all these functions: - region(base -> int): the regions represent the natural partition of the memory by the time when it have been allocated. So the regions are identified by a number. So the addresses in one base are all in the same region. Caveat the [region] function doesn't associate the base to its region directly but to a congruence class that depend of each function but which keeps the order: - = 1 : regions corresponds to formals - = 2 : regions corresponds to locals - > 2 : freshly allocated bases (malloc) - = 0 : globals (except string literals) - < 0 : string literals (-its id) - framed(M_ptr): All pointer values accessible from the memory M (of pointers), lives in region <= 0. Hence separated from locals, formals, and freshly allocated in the current function. - linked(A): The proposition [linked] indicate that an allocation table were the globals are allocated. - sconst(M_char): Indicate that the memory M (of chars) contains the values of string literals at their bases. *) (* -------------------------------------------------------------------------- *) (* --- Chunks --- *) (* -------------------------------------------------------------------------- *) type chunk = | M_int | M_char | M_f32 | M_f64 | M_pointer | T_alloc module Chunk = struct type t = chunk let self = "typed" let rank = function | M_int -> 0 | M_char -> 1 | M_f32 -> 2 | M_f64 -> 3 | M_pointer -> 4 | T_alloc -> 5 let hash = rank let name = function | M_int -> "Mint" | M_char -> "Mchar" | M_f32 -> "Mf32" | M_f64 -> "Mf64" | M_pointer -> "Mptr" | T_alloc -> "Malloc" let compare a b = rank a - rank b let equal = (=) let pretty fmt c = Format.pp_print_string fmt (name c) let val_of_chunk = function | M_int | M_char -> L.Int | M_f32 -> Cfloat.tau_of_float Ctypes.Float32 | M_f64 -> Cfloat.tau_of_float Ctypes.Float64 | M_pointer -> t_addr | T_alloc -> L.Int let tau_of_chunk = function | M_int | M_char -> L.Array(t_addr,L.Int) | M_pointer -> L.Array(t_addr,t_addr) | M_f32 -> L.Array(t_addr,Cfloat.tau_of_float Ctypes.Float32) | M_f64 -> L.Array(t_addr,Cfloat.tau_of_float Ctypes.Float64) | T_alloc -> L.Array(L.Int,L.Int) let basename_of_chunk = name let is_framed _ = false end module Heap = Qed.Collection.Make(Chunk) module Sigma = Sigma.Make(Chunk)(Heap) type loc = term (* of type addr *) (* -------------------------------------------------------------------------- *) (* --- Utilities on locations --- *) (* -------------------------------------------------------------------------- *) let m_int i = if Ctypes.is_char i then M_char else M_int let m_float = function Float32 -> M_f32 | Float64 -> M_f64 let rec footprint = function | C_int i -> Heap.Set.singleton (m_int i) | C_float f -> Heap.Set.singleton (m_float f) | C_pointer _ -> Heap.Set.singleton M_pointer | C_array a -> footprint (object_of a.arr_element) | C_comp c -> footprint_comp c and footprint_comp c = List.fold_left (fun ft f -> Heap.Set.union ft (footprint (object_of f.ftype)) ) Heap.Set.empty c.cfields let domain obj _l = footprint obj let rec length_of_object = function | C_int _ | C_float _ | C_pointer _ -> 1 | C_comp c -> length_of_comp c | C_array { arr_flat = Some { arr_size = n } ; arr_element = elt } -> n * (length_of_typ elt) | C_array _ as a -> if Wp_parameters.ExternArrays.get () then max_int else Warning.error ~source:"Typed Model" "Undefined array-size (%a)" Ctypes.pretty a and length_of_typ t = length_of_object (object_of t) and length_of_field f = length_of_typ f.ftype and length_of_comp c = (* union field are considered as struct field *) List.fold_left (fun s f -> s + length_of_field f) 0 c.cfields let position_of_field f = let rec fnext k f = function | [] -> assert false | g::gs -> if Fieldinfo.equal f g then k else fnext (k + length_of_field g) f gs in fnext 0 f f.fcomp.cfields (* -------------------------------------------------------------------------- *) (* --- Utilities on loc-as-term --- *) (* -------------------------------------------------------------------------- *) type sigma = Sigma.t type domain = Sigma.domain type segment = loc rloc let pretty fmt l = F.pp_term fmt l let vars l = F.vars l let occurs x l = F.occurs x l (* -------------------------------------------------------------------------- *) (* --- Generated Axiomatization --- *) (* -------------------------------------------------------------------------- *) let cluster_globals () = Definitions.cluster ~id:"Globals" ~title:"Global Variables" () type shift = | RS_Field of fieldinfo * int (* offset of the field *) | RS_Index of int (* size of the shift *) let phi_base = function | p::_ -> a_base p | _ -> raise Not_found let phi_field offset = function | [p] -> e_add (a_offset p) (F.e_int offset) | _ -> raise Not_found let phi_index size = function | [p;k] -> e_add (a_offset p) (F.e_fact size k) | _ -> raise Not_found module RegisterShift = WpContext.Static (struct type key = lfun type data = shift let name = "MemTyped.RegisterShift" include Lang.Fun end) module ShiftFieldDef = WpContext.StaticGenerator(Cil_datatype.Fieldinfo) (struct let name = "MemTyped.ShiftFieldDef" type key = fieldinfo type data = dfun let generate f = let result = t_addr in let lfun = Lang.generated_f ~result "shiftfield_%s" (Lang.field_id f) in let position = position_of_field f in (* Since its a generated it is the unique name given *) let xloc = Lang.freshvar ~basename:"p" t_addr in let loc = e_var xloc in let def = a_shift loc (F.e_int position) in let dfun = Definitions.Function( result , Def , def) in RegisterShift.define lfun (RS_Field(f,position)) ; MemMemory.register ~base:phi_base ~offset:(phi_field position) lfun ; { d_lfun = lfun ; d_types = 0 ; d_params = [xloc] ; d_definition = dfun ; d_cluster = Definitions.dummy () ; } let compile = Lang.local generate end) module ShiftField = WpContext.Generator(Cil_datatype.Fieldinfo) (struct let name = "MemTyped.ShiftField" type key = fieldinfo type data = lfun let compile fd = let dfun = ShiftFieldDef.get fd in let d_cluster = MemLoader.cluster () in Definitions.define_symbol { dfun with d_cluster } ; dfun.d_lfun end) module Cobj = struct type t = c_object let pretty = C_object.pretty let compare = compare_ptr_conflated end (* This is a model-independent generator, which will be inherited from the model-dependent clusters *) module ShiftGen = WpContext.StaticGenerator(Cobj) (struct let name = "MemTyped.ShiftDef" type key = c_object type data = dfun let rec c_object_id fmt = function | C_int i -> pp_int fmt i | C_float f -> pp_float fmt f | C_pointer _ -> Format.fprintf fmt "PTR" | C_comp c -> Format.pp_print_string fmt c.cname | C_array a -> let te = object_of a.arr_element in match a.arr_flat with | None -> Format.fprintf fmt "A_%a" c_object_id te | Some f -> Format.fprintf fmt "A%d_%a" f.arr_size c_object_id te let c_object_id c = Format.asprintf "%a@?" c_object_id c let generate obj = let result = t_addr in let shift = Lang.generated_f ~result "shift_%s" (c_object_id obj) in let size = length_of_object obj in (* Since its a generated it is the unique name given *) let xloc = Lang.freshvar ~basename:"p" t_addr in let loc = e_var xloc in let xk = Lang.freshvar ~basename:"k" Qed.Logic.Int in let k = e_var xk in let def = a_shift loc (F.e_fact size k) in let dfun = Definitions.Function( result , Def , def) in RegisterShift.define shift (RS_Index size) ; MemMemory.register ~base:phi_base ~offset:(phi_index size) ~linear:true shift ; { d_lfun = shift ; d_types = 0 ; d_params = [xloc;xk] ; d_definition = dfun ; d_cluster = Definitions.dummy () ; } let compile = Lang.local generate end) (* The model-dependent derivation of model-independent ShiftDef *) module Shift = WpContext.Generator(Cobj) (struct let name = "MemTyped.Shift" type key = c_object type data = lfun let compile obj = let dfun = ShiftGen.get obj in let d_cluster = MemLoader.cluster () in Definitions.define_symbol { dfun with d_cluster } ; dfun.d_lfun end) let field l f = e_fun (ShiftField.get f) [l] let shift l obj k = e_fun (Shift.get obj) [l;k] module LITERAL = struct type t = int * Cstring.cst let compare (a:t) (b:t) = Transitioning.Stdlib.compare (fst a) (fst b) let pretty fmt (eid,cst) = Format.fprintf fmt "%a@%d" Cstring.pretty cst eid end module EID = State_builder.Ref(Datatype.Int) (struct let name = "Wp.MemTyped.EID" let dependencies = [Ast.self] let default () = 0 end) module STRING = WpContext.Generator(LITERAL) (struct let name = "MemTyped.STRING" type key = LITERAL.t type data = term let linked prefix base cst = let name = prefix ^ "_linked" in let a = Lang.freshvar ~basename:"alloc" (Chunk.tau_of_chunk T_alloc) in let m = e_var a in let m_linked = p_call p_linked [m] in let alloc = F.e_get m base in (* The size is alloc-1 *) let sized = Cstring.str_len cst (F.e_add alloc F.e_minus_one) in Definitions.define_lemma { l_assumed = true ; l_name = name ; l_types = 0 ; l_triggers = [] ; l_forall = [] ; l_lemma = p_forall [a] (p_imply m_linked sized) ; l_cluster = Cstring.cluster () ; } let region prefix base cst = let name = prefix ^ "_region" in let re = - Cstring.str_id cst in Definitions.define_lemma { l_assumed = true ; l_name = name ; l_types = 0 ; l_triggers = [] ; l_forall = [] ; l_lemma = p_equal (e_fun f_region [base]) (e_int re) ; l_cluster = Cstring.cluster () ; } let sconst prefix base cst = (** describe the content of literal strings *) let name = prefix ^ "_literal" in let i = Lang.freshvar ~basename:"i" L.Int in let c = Cstring.char_at cst (e_var i) in let addr = shift (a_global base) (C_int (Ctypes.c_char ())) (e_var i) in let m = Lang.freshvar ~basename:"mchar" (Chunk.tau_of_chunk M_char) in let m_sconst = F.p_call p_sconst [e_var m] in let v = F.e_get (e_var m) addr in let read = F.p_equal c v in Definitions.define_lemma { l_assumed = true ; l_name = name ; l_types = 0 ; l_triggers = [] ; l_forall = [m;i] ; l_cluster = Cstring.cluster () ; l_lemma = F.p_imply m_sconst read ; } let fresh () = let eid = succ (EID.get ()) in EID.set eid ; eid let compile (_,cst) = let eid = fresh () in let lfun = Lang.generated_f ~result:L.Int "Str_%d" eid in (* Since its a generated it is the unique name given *) let prefix = Lang.Fun.debug lfun in let base = F.e_fun lfun [] in Definitions.define_symbol { d_lfun = lfun ; d_types = 0 ; d_params = [] ; d_definition = Logic L.Int ; d_cluster = Cstring.cluster () ; } ; Definitions.define_lemma { l_name = prefix ^ "_base" ; l_assumed = true ; l_types = 0 ; l_triggers = [] ; l_forall = [] ; l_lemma = F.p_lt base F.e_zero ; l_cluster = Cstring.cluster () ; } ; region prefix base cst ; linked prefix base cst ; sconst prefix base cst ; base end) (* -------------------------------------------------------------------------- *) (* --- Base Registration --- *) (* -------------------------------------------------------------------------- *) module RegisterBASE = WpContext.Index (struct type key = lfun type data = varinfo let name = "MemTyped.RegisterBASE" include Lang.Fun end) module BASE = WpContext.Generator(Varinfo) (struct let name = "MemTyped.BASE" type key = varinfo type data = term let region prefix x base = let name = prefix ^ "_region" in let re = if x.vglob then 0 else if x.vformal then 1 else 2 in Definitions.define_lemma { l_assumed = true ; l_name = name ; l_types = 0 ; l_triggers = [] ; l_forall = [] ; l_lemma = p_equal (e_fun f_region [base]) (e_int re) ; l_cluster = cluster_globals () ; } let sizeof x = Warning.handle ~handler:(fun _ -> None) ~effect:(Printf.sprintf "No allocation size for variable '%s'" x.vname) (fun obj -> Some (length_of_object obj)) (Ctypes.object_of x.vtype) let linked prefix x base = let name = prefix ^ "_linked" in let size = if x.vglob then sizeof x else Some 0 in match size with | None -> () | Some size -> let a = Lang.freshvar ~basename:"alloc" t_malloc in let m = e_var a in let m_linked = p_call p_linked [m] in let base_size = p_equal (F.e_get m base) (e_int size) in Definitions.define_lemma { l_assumed = true ; l_name = name ; l_types = 0 ; l_triggers = [] ; l_forall = [] ; l_lemma = p_forall [a] (p_imply m_linked base_size) ; l_cluster = cluster_globals () ; } let generate x = let acs_rd = Cil.typeHasQualifier "const" x.vtype in let prefix = if x.vglob then if acs_rd then "K" else "G" else if x.vformal then "P" else "L" in let lfun = Lang.generated_f ~category:L.Constructor ~result:L.Int "%s_%s_%d" prefix x.vorig_name x.vid in (* Since its a generated it is the unique name given *) let prefix = Lang.Fun.debug lfun in let vid = if acs_rd then (-x.vid-1) else succ x.vid in let dfun = Definitions.Function( L.Int , Def , e_int vid ) in Definitions.define_symbol { d_lfun = lfun ; d_types = 0 ; d_params = [] ; d_definition = dfun ; d_cluster = cluster_globals () ; } ; let base = e_fun lfun [] in RegisterBASE.define lfun x ; region prefix x base ; linked prefix x base ; base let compile = Lang.local generate end) (* -------------------------------------------------------------------------- *) (* --- Locations --- *) (* -------------------------------------------------------------------------- *) let null = a_null (* as a loc *) let literal ~eid cst = shift (a_global (STRING.get (eid,cst))) (C_int (Ctypes.c_char ())) e_zero let cvar x = a_global (BASE.get x) let pointer_loc t = t let pointer_val t = t let allocated sigma l = F.e_get (Sigma.value sigma T_alloc) (a_base l) let base_addr l = a_addr (a_base l) e_zero let base_offset l = a_base_offset (a_offset l) let block_length sigma obj l = e_fact (Ctypes.sizeof_object obj) (allocated sigma l) (* -------------------------------------------------------------------------- *) (* --- Cast --- *) (* -------------------------------------------------------------------------- *) module Layout : sig val pretty : Format.formatter -> c_object -> unit val fits: dst:c_object -> src:c_object -> bool (* returns [true] in these cases: - [dst] fits into [src] (exists cobj; [src] = [dst] concat cobj) - [dst] equals [src] ([dst] = [src]) *) end = struct type atom = P of typ | I of c_int | F of c_float let pp_atom fmt = function | P ty -> Printer.pp_typ fmt (TPtr(ty,[])) | I i -> Ctypes.pp_int fmt i | F f -> Ctypes.pp_float fmt f let eq_atom a1 a2 = match a1 , a2 with | P _ , P _ -> true | I i1 , I i2 -> i1 = i2 | F f1 , F f2 -> f1 = f2 | _ -> false type slot = A of atom | S of Cil_types.compinfo (* delayed layout of a C struct *) | U of Cil_types.compinfo (* delayed layout of a C union *) let pp_slot fmt = function | A a -> pp_atom fmt a | S s -> Format.fprintf fmt "{struct %a}" Printer.pp_compinfo s | U u -> Format.fprintf fmt "{union %a}" Printer.pp_compinfo u let eq_slot a1 a2 = (* syntactic equality *) match a1 , a2 with | A a1 , A a2 -> eq_atom a1 a2 | S c1 , S c2 | U c1, U c2 -> Compinfo.equal c1 c2 | _ -> false let rec get_slot = function | C_int i -> A (I i) | C_float f -> A (F f) | C_pointer t -> A (P t) | C_comp ( { cfields = [f] } as c ) -> begin (* union having only one field is equivalent to a struct *) match Ctypes.object_of f.ftype with | C_array _ -> (if c.cstruct then S c else U c) | cobj -> get_slot cobj end | C_comp c -> if c.cstruct then S c else U c | C_array _ -> assert false type block = | Str of slot * int | Arr of c_object * int (* delayed layout of a C type *) | Garbled let pp_block fmt = function | Str(a,n) when n=1 -> pp_slot fmt a | Str(a,n) -> Format.fprintf fmt "%a[%d]" pp_slot a n | Arr(o,n) -> Format.fprintf fmt "{ctype %a}[%d]" Ctypes.pretty o n | Garbled -> Format.fprintf fmt "..." let add_slot a n w = assert (n >= 1) ; match w with | Str(b,m) :: w when eq_slot a b -> Str(b,m+n)::w | _ -> Str(a,n) :: w let add_block p w = match p , w with | Str(a,n) , Str(b,m)::w when eq_slot a b -> Str(b,n+m)::w | Garbled , Garbled::_ -> w | _ -> p :: w type layout = block list let pp_layout fmt = function | [b] -> pp_block fmt b | bs -> begin Format.fprintf fmt "@[<hov 2>{" ; List.iter (fun b -> Format.fprintf fmt "@ %a" pp_block b) bs ; Format.fprintf fmt " }@]" ; end (* requires n > 1 *) let rec add_many cobj n w = (* returns [layout obj]*n @ [w] *) assert (n > 1) ; match cobj, w with | C_array { arr_flat = Some a }, _ when a.arr_cell_nbr = 1 -> add_many (Ctypes.object_of a.arr_cell) n w | C_array _, Arr(o, m)::w when 0 = compare_ptr_conflated o cobj -> Arr(o, m+n)::w | C_array _, _ -> Arr(cobj, n)::w | _ -> add_slot (get_slot cobj) n w let rec rlayout w = function (* returns [layout obj] @ [w] *) | C_array { arr_flat = Some a } -> let cobj = Ctypes.object_of a.arr_cell in if a.arr_cell_nbr = 1 then rlayout w cobj else add_many cobj a.arr_cell_nbr w | C_array { arr_element = e } -> if Wp_parameters.ExternArrays.get () then add_many (Ctypes.object_of e) max_int w else add_block Garbled w | cobj -> add_slot (get_slot cobj) 1 w let layout (obj : c_object) : layout = rlayout [] obj let clayout (c: Cil_types.compinfo) : layout = let flayout w f = rlayout w (Ctypes.object_of f.ftype) in List.fold_left flayout [] (List.rev c.cfields) type comparison = Srem of layout | Drem of layout | Equal | Mismatch let add_array o n w = assert (n > 0) ; if n=1 then rlayout w o else Arr(o, n)::w let decr_slot a n w = assert (n >= 1); if n=1 then w else Str(a, n-1)::w let rec equal u v = match compare ~dst:u ~src:v with | Equal -> true | _ -> false and compare_slot ~dst ~src = match dst, src with | A a1, A a2 -> if eq_atom a1 a2 then Equal else Mismatch | S c1, S c2 | U c1, U c2 when Compinfo.equal c1 c2 -> Equal | S c1, _ -> compare ~dst:(clayout c1) ~src:[Str(src,1)] | _, S c2 -> compare ~dst:[Str(dst,1)] ~src:(clayout c2) | U c1, U c2 -> (* for union, the layouts must be equal *) if equal (clayout c1) (clayout c2) then Equal else Mismatch | U _, A _ -> Mismatch | A _, U _ -> Mismatch and compare ~dst ~src = match dst , src with | [] , [] -> Equal (* src = dst *) | [] , obj -> Srem obj (* src = dst @ obj *) | obj , [] -> Drem obj (* dst = src @ obj *) | p::w1 , q::w2 -> match p , q with | Garbled , _ | _ , Garbled -> Mismatch | Str(a,n) , Str(b,m) -> begin match compare_slot a b with | Mismatch -> Mismatch | Drem a'-> let w1 = a' @ decr_slot a n w1 in let w2 = decr_slot b m w2 in compare w1 w2 | Srem b' -> let w1 = decr_slot a n w1 in let w2 = b' @ decr_slot b m w2 in compare w1 w2 | Equal -> if n < m then let w2 = Str(a,m-n)::w2 in compare w1 w2 else if n > m then let w1 = Str(a,n-m)::w1 in compare w1 w2 else (* n = m *) compare w1 w2 end | Arr(u,n) , Arr(v,m) -> begin match compare ~dst:(layout u) ~src:(layout v) with | Mismatch -> Mismatch | Drem u' -> let w1 = u' @ add_array u (n-1) w1 in let w2 = add_array v (m-1) w2 in compare w1 w2 | Srem v' -> let w1 = add_array u (n-1) w1 in let w2 = v' @ add_array v (m-1) w2 in compare w1 w2 | Equal -> if n < m then let w2 = add_array v (m-n) w2 in compare w1 w2 else if n > m then let w1 = add_array u (n-m) w1 in compare w1 w2 else (* n = m *) compare w1 w2 end | Arr(u,n) , Str _ -> compare ~dst:((layout u) @ add_array u (n-1) w1) ~src | Str _ , Arr(v,n) -> compare ~dst ~src:((layout v) @ add_array v (n-1) w2) let rec repeated ~dst ~src = match dst , src with | [] , [] -> true (* src = dst *) | _ , [] -> false (* empty source layout *) | [] , _ -> false (* empty destination layout *) | [p] , [q] -> begin match p , q with | Garbled , _ | _ , Garbled -> false | Str(a,n) , Str(b,m) -> (* dst =?= repeated(src,n/m) *) begin match compare_slot ~dst:a ~src:b with | Mismatch -> false | Drem a' -> let w1 = a' @ decr_slot a n [] in let w2 = decr_slot b m [] in let cmp = compare ~dst:w1 ~src:w2 in repeated_result ~src cmp | Srem _ -> false | Equal -> (* dst =?= repeated(src,n/m) *) n >= m && (n mod m = 0) end | Arr(u,n) , Arr(v,m) -> begin match compare ~dst:(layout u) ~src:(layout v) with | Mismatch -> false | Drem u' -> let w1 = u' @ add_array u (n-1) [] in let w2 = add_array v (m-1) [] in let cmp = compare ~dst:w1 ~src:w2 in repeated_result ~src cmp | Srem _ -> false | Equal -> (* dst =?= repeated(src,n/m) *) n >= m && (n mod m = 0) end | _ , _ -> repeated_compare ~dst ~src end | _ , _ -> repeated_compare ~dst ~src and repeated_compare ~dst ~src = repeated_result ~src (compare ~dst ~src) and repeated_result ~src = function | Equal -> true | Mismatch | Srem _ -> false | Drem dst -> repeated ~dst ~src let fits ~dst ~src = match dst , src with | C_int i1 , C_int i2 -> i1 = i2 | C_float f1 , C_float f2 -> f1 = f2 | C_comp c , C_comp d when Compinfo.equal c d -> true | C_pointer _ , C_pointer _ -> true | _ -> let src = layout src in match compare ~dst:(layout dst) ~src with | Equal | Srem _ -> true | Mismatch -> false | Drem dst -> repeated dst src let rec pretty fmt = function | C_pointer ty -> Format.fprintf fmt "%a*" pretty (Ctypes.object_of ty) | obj -> pp_layout fmt (layout obj) end let pp_mismatch fmt s = if Context.get pointer <> NoCast && Wp_parameters.has_dkey dkey_layout then Format.fprintf fmt "Cast with incompatible pointers types@\n\ @[@[Source: %a*@]@ @[(layout: %a)@]@]@\n\ @[@[Target: %a*@]@ @[(layout: %a)@]@]" Ctypes.pretty s.pre Layout.pretty s.pre Ctypes.pretty s.post Layout.pretty s.post else Format.fprintf fmt "@[<hov 3>Cast with incompatible pointers types\ @ (source: %a*)@ (target: %a*)@]" Ctypes.pretty s.pre Ctypes.pretty s.post let cast s l = if l==null then null else begin match Context.get pointer with | NoCast -> Warning.error ~source:"Typed Model" "%a" pp_mismatch s | Fits -> if Layout.fits ~dst:s.post ~src:s.pre then l else Warning.error ~source:"Typed Model" "%a" pp_mismatch s | Unsafe -> if not (Layout.fits ~dst:s.post ~src:s.pre) then Warning.emit ~severe:false ~source:"Typed Model" ~effect:"Keep pointer value" "%a" pp_mismatch s ; l end let loc_of_int _ v = F.e_fun f_addr_of_int [v] let int_of_loc _ l = F.e_fun f_int_of_addr [l] (* -------------------------------------------------------------------------- *) (* --- Frames --- *) (* -------------------------------------------------------------------------- *) let frames obj addr = function | T_alloc -> [] | m -> let offset = F.e_int (length_of_object obj) in let sizeof = F.e_one in let tau = Chunk.val_of_chunk m in let basename = Chunk.basename_of_chunk m in MemMemory.frames ~addr ~offset ~sizeof ~basename tau (* -------------------------------------------------------------------------- *) (* --- Loader --- *) (* -------------------------------------------------------------------------- *) module MODEL = struct module Chunk = Chunk module Sigma = Sigma let name = "MemTyped.LOADER" type nonrec loc = loc let field = field let shift = shift let sizeof = length_of_object let domain = domain let frames = frames let to_addr l = l let to_region_pointer l = 0,l let of_region_pointer _ _ l = l let load_int sigma i l = F.e_get (Sigma.value sigma (m_int i)) l let load_float sigma f l = F.e_get (Sigma.value sigma (m_float f)) l let load_pointer sigma _t l = F.e_get (Sigma.value sigma M_pointer) l let last sigma obj l = let n = length_of_object obj in e_sub (F.e_div (allocated sigma l) (F.e_int n)) e_one let havoc obj loc ~length chunk ~fresh ~current = if chunk <> T_alloc then let n = F.e_fact (length_of_object obj) length in F.e_fun f_havoc [fresh;current;loc;n] else fresh let eqmem obj loc _chunk m1 m2 = F.p_call p_eqmem [m1;m2;loc;e_int (length_of_object obj)] let eqmem_forall obj loc _chunk m1 m2 = let xp = Lang.freshvar ~basename:"p" t_addr in let p = F.e_var xp in let n = F.e_int (length_of_object obj) in let separated = F.p_call p_separated [p;e_one;loc;n] in let equal = p_equal (e_get m1 p) (e_get m2 p) in [xp],separated,equal let updated sigma c l v = c , F.e_set (Sigma.value sigma c) l v let store_int sigma i l v = updated sigma (m_int i) l v let store_float sigma f l v = updated sigma (m_float f) l v let store_pointer sigma _ty l v = updated sigma M_pointer l v end module LOADER = MemLoader.Make(MODEL) let load = LOADER.load let stored = LOADER.stored let copied = LOADER.copied let assigned = LOADER.assigned (* -------------------------------------------------------------------------- *) (* --- Loc Comparison --- *) (* -------------------------------------------------------------------------- *) let loc_compare f_cmp i_cmp p q = match F.is_equal (a_base p) (a_base q) with | L.Yes -> i_cmp (a_offset p) (a_offset q) | L.Maybe | L.No -> p_call f_cmp [p;q] let is_null l = p_equal l null let loc_eq = p_equal let loc_neq = p_neq let loc_lt = loc_compare p_addr_lt p_lt let loc_leq = loc_compare p_addr_le p_leq let loc_diff obj p q = let delta = e_sub (a_offset p) (a_offset q) in let size = e_int (length_of_object obj) in e_div delta size (* -------------------------------------------------------------------------- *) (* --- Validity --- *) (* -------------------------------------------------------------------------- *) let s_valid sigma acs p n = let p_valid = match acs with RW -> p_valid_rw | RD -> p_valid_rd in p_call p_valid [Sigma.value sigma T_alloc;p;n] let s_invalid sigma p n = p_call p_invalid [Sigma.value sigma T_alloc;p;n] let segment phi = function | Rloc(obj,l) -> phi l (e_int (length_of_object obj)) | Rrange(l,obj,Some a,Some b) -> let l = shift l obj a in let n = e_fact (length_of_object obj) (e_range a b) in phi l n | Rrange(l,_,a,b) -> Wp_parameters.abort ~current:true "Invalid infinite range @[<hov 2>%a+@,(%a@,..%a)@]" F.pp_term l Vset.pp_bound a Vset.pp_bound b let valid sigma acs = segment (s_valid sigma acs) let invalid sigma = segment (s_invalid sigma) let frame sigma = let wellformed_frame phi chunk = if Sigma.mem sigma chunk then [ p_call phi [Sigma.value sigma chunk] ] else [] in wellformed_frame p_linked T_alloc @ wellformed_frame p_sconst M_char @ wellformed_frame p_framed M_pointer let alloc sigma xs = if xs = [] then sigma else Sigma.havoc_chunk sigma T_alloc let scope seq scope xs = if xs = [] then [] else let alloc = List.fold_left (fun m x -> let size = match scope with | Sigs.Leave -> 0 | Sigs.Enter -> length_of_typ x.vtype in F.e_set m (BASE.get x) (e_int size)) (Sigma.value seq.pre T_alloc) xs in [ p_equal (Sigma.value seq.post T_alloc) alloc ] let global _sigma p = p_leq (e_fun f_region [a_base p]) e_zero (* -------------------------------------------------------------------------- *) (* --- Segments --- *) (* -------------------------------------------------------------------------- *) let included = let addrof l = l in let sizeof = length_of_object in MemMemory.included ~shift ~addrof ~sizeof let separated = let addrof l = l in let sizeof = length_of_object in MemMemory.separated ~shift ~addrof ~sizeof (* -------------------------------------------------------------------------- *) (* --- State Model --- *) (* -------------------------------------------------------------------------- *) type state = chunk Tmap.t let rec lookup_a e = match F.repr e with | L.Fun( f , [e] ) when f == f_global -> lookup_a e | L.Fun( f , es ) -> lookup_f f es | _ -> raise Not_found and lookup_f f es = try match RegisterShift.find f , es with | RS_Field(fd,_) , [e] -> Mstate.field (lookup_lv e) fd | RS_Index _ , [e;k] -> Mstate.index (lookup_lv e) k | _ -> raise Not_found with Not_found when es = [] -> Sigs.(Mvar (RegisterBASE.find f),[]) and lookup_lv e = try lookup_a e with Not_found -> Sigs.(Mmem e,[]) let mchunk c = Sigs.Mchunk (Pretty_utils.to_string Chunk.pretty c) let lookup s e = try mchunk (Tmap.find e s) with Not_found -> try match F.repr e with | L.Fun( f , es ) -> Sigs.Maddr (lookup_f f es) | L.Aget( m , k ) when Tmap.find m s <> T_alloc -> Sigs.Mlval (lookup_lv k) | _ -> Sigs.Mterm with Not_found -> Sigs.Mterm let apply f s = Tmap.fold (fun m c w -> Tmap.add (f m) c w) s Tmap.empty let iter f s = Tmap.iter (fun m c -> f (mchunk c) m) s let state (sigma : sigma) = let s = ref Tmap.empty in Sigma.iter (fun c x -> s := Tmap.add (e_var x) c !s) sigma ; !s let heap domain state = Tmap.fold (fun m c w -> if Vars.intersect (F.vars m) domain then Heap.Map.add c m w else w ) state Heap.Map.empty let rec diff v1 v2 = if v1 == v2 then Bag.empty else match F.repr v2 with | L.Aset( m , k , v ) -> let lv = lookup_lv k in let upd = Mstore( lv , v ) in Bag.append (diff v1 m) upd | _ -> Bag.empty let updates seq domain = let pool = ref Bag.empty in let pre = heap domain seq.pre in let post = heap domain seq.post in Heap.Map.iter2 (fun chunk v1 v2 -> if chunk <> T_alloc then match v1 , v2 with | Some v1 , Some v2 -> pool := Bag.concat (diff v1 v2) !pool | _ -> ()) pre post ; !pool (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemTyped.mli����������������������������������������������������0000666�0000000�0000000�00000003644�13571573400�016347� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Typed Memory Model --- *) (* -------------------------------------------------------------------------- *) include Sigs.Model type pointer = NoCast | Fits | Unsafe val pointer : pointer Context.value ��������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemVar.ml�������������������������������������������������������0000666�0000000�0000000�00000124764�13571573400�015650� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- No-Aliasing Memory Model --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype open Ctypes open MemoryContext open Lang open Lang.F open Sigs module type VarUsage = sig val datatype : string val param : varinfo -> MemoryContext.param val hypotheses : unit -> MemoryContext.clause list end module Make(V : VarUsage)(M : Sigs.Model) = struct (* -------------------------------------------------------------------------- *) (* --- Model --- *) (* -------------------------------------------------------------------------- *) let datatype = "MemVar." ^ V.datatype ^ M.datatype let configure = M.configure let no_binder = { bind = fun _ f v -> f v } let configure_ia _ = no_binder let hypotheses () = V.hypotheses () @ M.hypotheses () (* -------------------------------------------------------------------------- *) (* --- Chunk --- *) (* -------------------------------------------------------------------------- *) type chunk = | Var of varinfo | Alloc of varinfo | Mem of M.Chunk.t let is_framed_var x = not x.vglob && not x.vaddrof (* Can not use VarUsage info, since (&x) can still be passed to the function and be modified by the call (when it assigns everything). *) module VAR = struct type t = varinfo let self = "var" let hash = Varinfo.hash let equal = Varinfo.equal let compare = Varinfo.compare let pretty = Varinfo.pretty let typ_of_chunk x = match V.param x with | ByRef -> Cil.typeOf_pointed x.vtype | _ -> x.vtype let tau_of_chunk x = Lang.tau_of_ctype (typ_of_chunk x) let is_framed = is_framed_var let basename_of_chunk = LogicUsage.basename end module VALLOC = struct type t = varinfo let self = "alloc" let hash = Varinfo.hash let compare = Varinfo.compare let equal = Varinfo.equal let pretty = Varinfo.pretty let tau_of_chunk _x = Qed.Logic.Bool let basename_of_chunk x = match V.param x with | ByRef -> "ra_" ^ LogicUsage.basename x | NotUsed | ByValue | ByShift | ByAddr | InContext | InArray -> "ta_" ^ LogicUsage.basename x let is_framed = is_framed_var end module Chunk = struct type t = chunk let self = "varmem" let hash = function | Var x -> 3 * Varinfo.hash x | Alloc x -> 5 * Varinfo.hash x | Mem m -> 7 * M.Chunk.hash m let compare c1 c2 = if c1 == c2 then 0 else match c1 , c2 with | Var x , Var y | Alloc x , Alloc y -> Varinfo.compare x y | Mem p , Mem q -> M.Chunk.compare p q | Var _ , _ -> (-1) | _ , Var _ -> 1 | Alloc _ , _ -> (-1) | _ , Alloc _ -> 1 let equal c1 c2 = (compare c1 c2 = 0) let pretty fmt = function | Var x -> Varinfo.pretty fmt x | Alloc x -> Format.fprintf fmt "alloc(%a)" Varinfo.pretty x | Mem m -> M.Chunk.pretty fmt m let tau_of_chunk = function | Var x -> VAR.tau_of_chunk x | Alloc x -> VALLOC.tau_of_chunk x | Mem m -> M.Chunk.tau_of_chunk m let basename_of_chunk = function | Var x -> VAR.basename_of_chunk x | Alloc x -> VALLOC.basename_of_chunk x | Mem m -> M.Chunk.basename_of_chunk m let is_framed = function | Var x -> VAR.is_framed x | Alloc x -> VALLOC.is_framed x | Mem m -> M.Chunk.is_framed m end (* -------------------------------------------------------------------------- *) (* --- Sigma --- *) (* -------------------------------------------------------------------------- *) module HEAP = Qed.Collection.Make(VAR) module TALLOC = Qed.Collection.Make(VALLOC) module SIGMA = Sigma.Make(VAR)(HEAP) module ALLOC = Sigma.Make(VALLOC)(TALLOC) module Heap = Qed.Collection.Make(Chunk) type sigma = { mem : M.Sigma.t ; vars : SIGMA.t ; alloc : ALLOC.t ; } module Sigma = struct type t = sigma type chunk = Chunk.t module Chunk = Heap type domain = Heap.set let empty = Heap.Set.empty let union = Heap.Set.union let create () = { vars = SIGMA.create () ; alloc = ALLOC.create () ; mem = M.Sigma.create () ; } let copy s = { vars = SIGMA.copy s.vars ; alloc = ALLOC.copy s.alloc ; mem = M.Sigma.copy s.mem ; } let choose s1 s2 = let s = SIGMA.choose s1.vars s2.vars in let a = ALLOC.choose s1.alloc s2.alloc in let m = M.Sigma.choose s1.mem s2.mem in { vars = s ; alloc = a ; mem = m } let merge s1 s2 = let s,pa1,pa2 = SIGMA.merge s1.vars s2.vars in let a,ta1,ta2 = ALLOC.merge s1.alloc s2.alloc in let m,qa1,qa2 = M.Sigma.merge s1.mem s2.mem in { vars = s ; alloc = a ; mem = m } , Passive.union (Passive.union pa1 ta1) qa1 , Passive.union (Passive.union pa2 ta2) qa2 let merge_list l = let s,pa = SIGMA.merge_list (List.map (fun s -> s.vars) l) in let a,ta = ALLOC.merge_list (List.map (fun s -> s.alloc) l) in let m,qa = M.Sigma.merge_list (List.map (fun s -> s.mem) l) in { vars = s ; alloc = a ; mem = m } , let union = List.map2 Passive.union in union (union pa ta) qa let join s1 s2 = Passive.union (Passive.union (SIGMA.join s1.vars s2.vars) (ALLOC.join s1.alloc s2.alloc)) (M.Sigma.join s1.mem s2.mem) let get s = function | Var x -> SIGMA.get s.vars x | Alloc x -> ALLOC.get s.alloc x | Mem m -> M.Sigma.get s.mem m let mem s = function | Var x -> SIGMA.mem s.vars x | Alloc x -> ALLOC.mem s.alloc x | Mem m -> M.Sigma.mem s.mem m let value s c = e_var (get s c) let iter f s = begin SIGMA.iter (fun x -> f (Var x)) s.vars ; ALLOC.iter (fun x -> f (Alloc x)) s.alloc ; M.Sigma.iter (fun m -> f (Mem m)) s.mem ; end let iter2 f s t = begin SIGMA.iter2 (fun x a b -> f (Var x) a b) s.vars t.vars ; ALLOC.iter2 (fun x a b -> f (Alloc x) a b) s.alloc t.alloc ; M.Sigma.iter2 (fun m p q -> f (Mem m) p q) s.mem t.mem ; end let domain_partition r = begin let xs = ref HEAP.Set.empty in let ts = ref TALLOC.Set.empty in let ms = ref M.Heap.Set.empty in Heap.Set.iter (function | Var x -> xs := HEAP.Set.add x !xs | Alloc x -> ts := TALLOC.Set.add x !ts | Mem c -> ms := M.Heap.Set.add c !ms ) r ; !xs , !ts , !ms end let domain_var xs = HEAP.Set.fold (fun x s -> Heap.Set.add (Var x) s) xs Heap.Set.empty let domain_alloc ts = TALLOC.Set.fold (fun x s -> Heap.Set.add (Alloc x) s) ts Heap.Set.empty let domain_mem ms = M.Heap.Set.fold (fun m s -> Heap.Set.add (Mem m) s) ms Heap.Set.empty let assigned ~pre ~post w = let w_vars , w_alloc , w_mem = domain_partition w in let h_vars = SIGMA.assigned ~pre:pre.vars ~post:post.vars w_vars in let h_alloc = ALLOC.assigned ~pre:pre.alloc ~post:post.alloc w_alloc in let h_mem = M.Sigma.assigned ~pre:pre.mem ~post:post.mem w_mem in Bag.ulist [h_vars;h_alloc;h_mem] let havoc s r = let rvar , ralloc , rmem = domain_partition r in { vars = SIGMA.havoc s.vars rvar ; alloc = ALLOC.havoc s.alloc ralloc ; mem = M.Sigma.havoc s.mem rmem ; } let havoc_chunk s = function | Var x -> { s with vars = SIGMA.havoc_chunk s.vars x } | Alloc x -> { s with alloc = ALLOC.havoc_chunk s.alloc x } | Mem m -> { s with mem = M.Sigma.havoc_chunk s.mem m } let havoc_any ~call s = { alloc = s.alloc ; vars = SIGMA.havoc_any ~call s.vars ; mem = M.Sigma.havoc_any ~call s.mem ; } let remove_chunks s r = let rvar , ralloc , rmem = domain_partition r in { vars = SIGMA.remove_chunks s.vars rvar ; alloc = ALLOC.remove_chunks s.alloc ralloc ; mem = M.Sigma.remove_chunks s.mem rmem ; } let domain s = Heap.Set.union (Heap.Set.union (domain_var (SIGMA.domain s.vars)) (domain_alloc (ALLOC.domain s.alloc))) (domain_mem (M.Sigma.domain s.mem)) let writes s = Heap.Set.union (Heap.Set.union (domain_var (SIGMA.writes {pre=s.pre.vars;post=s.post.vars})) (domain_alloc (ALLOC.writes {pre=s.pre.alloc;post=s.post.alloc}))) (domain_mem (M.Sigma.writes {pre=s.pre.mem;post=s.post.mem})) let pretty fmt s = Format.fprintf fmt "@[<hov 2>{X:@[%a@]@ T:@[%a@]@ M:@[%a@]}@]" SIGMA.pretty s.vars ALLOC.pretty s.alloc M.Sigma.pretty s.mem end type domain = Sigma.domain let get_var s x = SIGMA.get s.vars x let get_term s x = e_var (get_var s x) (* -------------------------------------------------------------------------- *) (* --- State Pretty Printer --- *) (* -------------------------------------------------------------------------- *) type ichunk = Iref of varinfo | Ivar of varinfo type state = { svar : ichunk Tmap.t ; smem : M.state ; } module IChunk = struct let compare_var x y = let rank x = if x.vformal then 0 else if x.vglob then 1 else if x.vtemp then 3 else 2 in let cmp = rank x - rank y in if cmp <> 0 then cmp else Varinfo.compare x y type t = ichunk let hash = function Iref x | Ivar x -> Varinfo.hash x let compare x y = match x,y with | Iref x , Iref y -> Varinfo.compare x y | Iref _ , _ -> (-1) | _ , Iref _ -> 1 | Ivar x , Ivar y -> compare_var x y let equal x y = match x,y with | Iref x , Iref y | Ivar x , Ivar y -> Varinfo.equal x y | Iref _ , Ivar _ | Ivar _ , Iref _ -> false end module Icmap = Qed.Mergemap.Make(IChunk) let set_chunk v c m = let c = try let c0 = Tmap.find v m in if IChunk.compare c c0 < 0 then c else c0 with Not_found -> c in Tmap.add v c m let state s = let m = ref Tmap.empty in SIGMA.iter (fun x v -> let c = match V.param x with ByRef -> Iref x | _ -> Ivar x in m := set_chunk (e_var v) c !m ) s.vars ; { svar = !m ; smem = M.state s.mem } let ilval = function | Iref x -> (Mvar x,[Mindex e_zero]) | Ivar x -> (Mvar x,[]) let imval c = Sigs.Mlval (ilval c) let lookup s e = try imval (Tmap.find e s.svar) with Not_found -> M.lookup s.smem e let apply f s = let m = ref Tmap.empty in Tmap.iter (fun e c -> let e = f e in m := set_chunk e c !m ; ) s.svar ; { svar = !m ; smem = M.apply f s.smem } let iter f s = Tmap.iter (fun v c -> f (imval c) v) s.svar ; M.iter f s.smem let icmap domain istate = Tmap.fold (fun m c w -> if Vars.intersect (F.vars m) domain then Icmap.add c m w else w ) istate Icmap.empty let rec diff lv v1 v2 = if v1 == v2 then Bag.empty else match F.repr v2 with | Qed.Logic.Aset(m , k , vk) -> let upd = diff (Mstate.index lv k) (F.e_get m k) vk in Bag.concat (diff lv v1 m) upd | Qed.Logic.Rdef fvs -> rdiff lv v1 v2 fvs | _ -> Bag.elt (Mstore(lv,v2)) and rdiff lv v1 v2 = function | (Lang.Cfield fi as fd ,f2) :: fvs -> let f1 = F.e_getfield v1 fd in if f1 == f2 then rdiff lv v1 v2 fvs else let upd = diff (Mstate.field lv fi) f1 f2 in let m = F.e_setfield v2 fd f1 in Bag.concat upd (diff lv v1 m) | (Lang.Mfield _,_)::_ -> Bag.elt (Mstore(lv,v2)) | [] -> Bag.empty let updates seq domain = let pre = icmap domain seq.pre.svar in let post = icmap domain seq.post.svar in let pool = ref Bag.empty in Icmap.iter2 (fun c v1 v2 -> match v1 , v2 with | _ , None -> () | None , Some v -> pool := Bag.add (Mstore(ilval c,v)) !pool | Some v1 , Some v2 -> pool := Bag.concat (diff (ilval c) v1 v2) !pool ) pre post ; let seq_mem = { pre = seq.pre.smem ; post = seq.post.smem } in Bag.concat !pool (M.updates seq_mem domain) (* -------------------------------------------------------------------------- *) (* --- Location --- *) (* -------------------------------------------------------------------------- *) type mem = | CVAL (* By-Value variable *) | CREF (* By-Ref variable *) | CTXT (* In-context pointer *) | CARR (* In-context array *) | HEAP (* In-heap variable *) type loc = | Ref of varinfo | Val of mem * varinfo * ofs list (* The varinfo has {i not} been contextualized yet *) | Loc of M.loc (* Generalized In-Heap pointer *) and ofs = | Field of fieldinfo | Shift of c_object * term type segment = loc rloc let rec ofs_vars xs = function | [] -> xs | Field _ :: ofs -> ofs_vars xs ofs | Shift(_,k) :: ofs -> ofs_vars (Vars.union xs (F.vars k)) ofs let vars = function | Ref _ -> Vars.empty | Loc l -> M.vars l | Val(_,_,ofs) -> ofs_vars Vars.empty ofs let rec ofs_occurs x = function | [] -> false | Field _ :: ofs -> ofs_occurs x ofs | Shift(_,k) :: ofs -> Vars.mem x (F.vars k) || ofs_occurs x ofs let occurs x = function | Ref _ -> false | Loc l -> M.occurs x l | Val(_,_,ofs) -> ofs_occurs x ofs let byte_offset n = function | Field fd -> F.e_add n (F.e_int (Ctypes.field_offset fd)) | Shift(obj,k) -> F.e_add n (F.e_fact (Ctypes.sizeof_object obj) k) (* -------------------------------------------------------------------------- *) (* --- Variable and Context --- *) (* -------------------------------------------------------------------------- *) let vtype m x = match m with | CVAL | HEAP -> x.vtype | CTXT | CREF -> Cil.typeOf_pointed x.vtype | CARR -> Ast_info.array_type (Cil.typeOf_pointed x.vtype) let vobject m x = Ctypes.object_of (vtype m x) let vbase m x = match m with | CVAL | HEAP -> x | _ -> { x with vglob = true ; vtype = vtype m x } (* -------------------------------------------------------------------------- *) (* --- Pretty --- *) (* -------------------------------------------------------------------------- *) let rec pp_offset ~obj fmt = function | [] -> () | Field f :: ofs -> Format.fprintf fmt ".%s" f.fname ; pp_offset ~obj:(object_of f.ftype) fmt ofs | Shift(elt,k) :: ofs -> if Ctypes.is_array obj ~elt then ( Format.fprintf fmt ".(%a)" F.pp_term k ; pp_offset ~obj:elt fmt ofs ) else ( Format.fprintf fmt ".(%a : %a)" F.pp_term k Ctypes.pretty elt ; pp_offset ~obj:elt fmt ofs ) let pp_mem fmt = function | CVAL -> Format.pp_print_string fmt "var" | CREF -> Format.pp_print_string fmt "ref" | CTXT -> Format.pp_print_string fmt "ptr" | CARR -> Format.pp_print_string fmt "arr" | HEAP -> Format.pp_print_string fmt "mem" (* re-uses strings that are used into the description of -wp-xxx-vars *) let pp_var_model fmt = function | ByValue | ByShift | NotUsed -> Format.pp_print_string fmt "non-aliased" (* cf. -wp-unalias-vars *) | ByRef -> Format.pp_print_string fmt "by reference" (* cf. -wp-ref-vars *) | InContext | InArray -> Format.pp_print_string fmt "in an isolated context" (* cf. -wp-context-vars *) | ByAddr -> Format.pp_print_string fmt "aliased" (* cf. -wp-alias-vars *) let pretty fmt = function | Ref x -> VAR.pretty fmt x | Loc l -> M.pretty fmt l | Val(m,x,ofs) -> let obj = vobject m x in Format.fprintf fmt "@[%a:%a%a@]" pp_mem m VAR.pretty x (pp_offset ~obj) ofs let noref ~op var = Warning.error "forbidden %s variable '%a' considered %a.@\n\ Use model 'Typed' instead or specify '-wp-unalias-vars %a'" op Varinfo.pretty var pp_var_model (V.param var) Varinfo.pretty var (* -------------------------------------------------------------------------- *) (* --- Basic Constructors --- *) (* -------------------------------------------------------------------------- *) let null = Loc M.null let literal ~eid cst = Loc (M.literal ~eid cst) let cvar x = match V.param x with | NotUsed | ByValue | ByShift -> Val(CVAL,x,[]) | ByAddr -> Val(HEAP,x,[]) | InContext | InArray | ByRef -> Ref x (* -------------------------------------------------------------------------- *) (* --- Lifting --- *) (* -------------------------------------------------------------------------- *) let moffset l = function | Field f -> M.field l f | Shift(e,k) -> M.shift l e k let mseq_of_seq seq = { pre = seq.pre.mem ; post = seq.post.mem } let mloc_of_path m x ofs = List.fold_left moffset (M.cvar (vbase m x)) ofs let mloc_of_loc = function | Loc l -> l | Ref x -> M.cvar x | Val(m,x,ofs) -> mloc_of_path m x ofs let pointer_loc p = Loc (M.pointer_loc p) let pointer_val l = M.pointer_val (mloc_of_loc l) let field l f = match l with | Loc l -> Loc (M.field l f) | Ref x -> noref ~op:"field access to" x | Val(m,x,ofs) -> Val(m,x,ofs @ [Field f]) let rec ofs_shift obj k = function | [] -> [Shift(obj,k)] | [Shift(elt,i)] when Ctypes.equal obj elt -> [Shift(elt,F.e_add i k)] | f::ofs -> f :: ofs_shift obj k ofs let shift l obj k = match l with | Loc l -> Loc (M.shift l obj k) | Ref x -> noref ~op:"array access to" x | Val(m,x,ofs) -> Val(m,x,ofs_shift obj k ofs) let base_addr = function | Loc l -> Loc (M.base_addr l) | Ref x -> noref ~op:"base address of" x (* ??? ~suggest:ByValue *) | Val(m,x,_) -> Val(m,x,[]) let base_offset = function | Loc l -> M.base_offset l | Ref x -> noref ~op:"offset address of" x (* ??? ~suggest:ByValue *) | Val(_,_,ofs) -> List.fold_left byte_offset e_zero ofs let block_length sigma obj = function | Loc l -> M.block_length sigma.mem obj l | Ref x -> noref ~op:"block-length of" x | Val(m,x,_) -> let obj = Ctypes.object_of (vtype m x) in let size = if Ctypes.sizeof_defined obj then Ctypes.sizeof_object obj else if Wp_parameters.ExternArrays.get () then max_int else Warning.error ~source:"MemVar" "Unknown array-size" in F.e_int size let cast obj l = Loc(M.cast obj (mloc_of_loc l)) let loc_of_int e a = Loc(M.loc_of_int e a) let int_of_loc i l = M.int_of_loc i (mloc_of_loc l) (* -------------------------------------------------------------------------- *) (* --- Memory Load --- *) (* -------------------------------------------------------------------------- *) let rec access a = function | [] -> a | Field f :: ofs -> access (e_getfield a (Cfield f)) ofs | Shift(_,k) :: ofs -> access (e_get a k) ofs let rec update a ofs v = match ofs with | [] -> v | Field f :: ofs -> let phi = Cfield f in let a_f = F.e_getfield a phi in let a_f_v = update a_f ofs v in F.e_setfield a phi a_f_v | Shift(_,k) :: ofs -> let a_k = F.e_get a k in let a_k_v = update a_k ofs v in F.e_set a k a_k_v let load sigma obj = function | Ref x -> begin match V.param x with | ByRef -> Sigs.Loc(Val(CREF,x,[])) | InContext -> Sigs.Loc(Val(CTXT,x,[])) | InArray -> Sigs.Loc(Val(CARR,x,[])) | NotUsed | ByAddr | ByValue | ByShift -> assert false end | Val((CREF|CVAL),x,ofs) -> Sigs.Val(access (get_term sigma x) ofs) | Loc l -> Cvalues.map_value (fun l -> Loc l) (M.load sigma.mem obj l) | Val((CTXT|CARR|HEAP) as m,x,ofs) -> Cvalues.map_value (fun l -> Loc l) (M.load sigma.mem obj (mloc_of_path m x ofs)) (* -------------------------------------------------------------------------- *) (* --- Memory Store --- *) (* -------------------------------------------------------------------------- *) let stored seq obj l v = match l with | Ref x -> noref ~op:"write to" x | Val((CREF|CVAL),x,ofs) -> let v1 = get_term seq.pre x in let v2 = get_term seq.post x in [Set( v2 , update v1 ofs v )] | Val((CTXT|CARR|HEAP) as m,x,ofs) -> M.stored (mseq_of_seq seq) obj (mloc_of_path m x ofs) v | Loc l -> M.stored (mseq_of_seq seq) obj l v let copied seq obj l1 l2 = let v = match load seq.pre obj l2 with | Sigs.Val r -> r | Sigs.Loc l -> pointer_val l in stored seq obj l1 v (* -------------------------------------------------------------------------- *) (* --- Pointer Comparison --- *) (* -------------------------------------------------------------------------- *) let is_null = function | Loc l -> M.is_null l | Ref _ | Val _ -> F.p_false let rec offset = function | [] -> e_zero | Field f :: ofs -> e_add (e_int (Ctypes.field_offset f)) (offset ofs) | Shift(obj,k)::ofs -> e_add (e_fact (Ctypes.sizeof_object obj) k) (offset ofs) let loc_diff obj a b = match a , b with | Loc l1 , Loc l2 -> M.loc_diff obj l1 l2 | Ref x , Ref y when Varinfo.equal x y -> e_zero | Val(_,x,p) , Val(_,y,q) when Varinfo.equal x y -> e_div (e_sub (offset p) (offset q)) (e_int (Ctypes.sizeof_object obj)) | _ -> Warning.error ~source:"Reference Variable Model" "Uncomparable locations %a and %a" pretty a pretty b let loc_compare lcmp icmp same a b = match a , b with | Loc l1 , Loc l2 -> lcmp l1 l2 | Ref x , Ref y -> if Varinfo.equal x y then same else p_not same | Val(_,x,p) , Val(_,y,q) -> if Varinfo.equal x y then icmp (offset p) (offset q) else p_not same | (Val _ | Loc _) , (Val _ | Loc _) -> lcmp (mloc_of_loc a) (mloc_of_loc b) | Ref _ , (Val _ | Loc _) | (Val _ | Loc _) , Ref _ -> p_not same let loc_eq = loc_compare M.loc_eq F.p_equal F.p_true let loc_lt = loc_compare M.loc_lt F.p_lt F.p_false let loc_leq = loc_compare M.loc_leq F.p_leq F.p_true let loc_neq = loc_compare M.loc_neq F.p_neq F.p_false (* -------------------------------------------------------------------------- *) (* --- Range & Offset Fits --- *) (* -------------------------------------------------------------------------- *) exception ShiftMismatch let is_heap_allocated = function | CREF | CVAL -> false | HEAP | CTXT | CARR -> true let shift_mismatch l = Wp_parameters.fatal "Invalid shift : %a" pretty l let unsized_array () = Warning.error ~severe:false "Validity of unsized-array not implemented yet" let fits_inside cond a b n = p_leq e_zero a :: p_lt b (e_int n) :: cond let stay_outside cond a b n = p_lt b e_zero :: p_leq (e_int n) a :: cond (* Append conditions to [cond] for [range=(elt,a,b)], consisting of [a..b] elements with type [elt] to fits inside the block, provided [a<=b]. *) let rec block_check fitting cond (block,size) ((elt,a,b) as range) = if Ctypes.equal block elt then fitting cond a b size else match Ctypes.get_array block with | Some( e , Some n ) -> block_check fitting cond (e , n * size) range | Some( _ , None ) -> unsized_array () | None -> raise ShiftMismatch (* Append conditions for [offset] to fits [object], provided [a<=b]. *) let rec offset_fits cond obj offset = match offset with | [] -> cond | Field fd :: ofs -> offset_fits cond (Ctypes.object_of fd.ftype) ofs | Shift(te,k) :: ofs -> match Ctypes.get_array obj with | Some( e , Some n ) when Ctypes.equal e te -> let cond = p_leq e_zero k :: p_lt k (e_int n) :: cond in offset_fits cond e ofs | Some( _ , None ) -> unsized_array () | _ -> let cond = block_check fits_inside cond (obj,1) (te,k,k) in offset_fits cond te ofs (* Append conditions to [cond] for [range=(elt,a,b)], starting at [offset], consisting of [a..b] elements with type [elt] to fits inside the block, of stay outside valid paths, provided [a<=b]. *) let rec range_check fitting cond alloc offset ((elt,a,b) as range) = match offset with | [] -> block_check fitting cond alloc range | Field fd :: ofs -> range_check fitting cond (Ctypes.object_of fd.ftype,1) ofs range | Shift(te,k) :: ofs -> if Ctypes.equal te elt then range_check fitting cond alloc ofs (elt,e_add a k,e_add b k) else match Ctypes.get_array (fst alloc) with | Some( e , Some n ) when Ctypes.equal e te -> let cond = fitting cond k k n in range_check fitting cond (e,n) ofs range | Some( _ , None ) -> unsized_array () | _ -> let cond = block_check fitting cond alloc (te,k,k) in range_check fitting cond (te,1) ofs range (* -------------------------------------------------------------------------- *) (* --- Validity --- *) (* -------------------------------------------------------------------------- *) let valid_offset obj ofs = F.p_conj (offset_fits [] obj ofs) let valid_range obj ofs range = F.p_conj (range_check fits_inside [] (obj,1) ofs range) (* varinfo *) let valid_base sigma acs mem x = if x.vglob then if acs = RW && Cil.typeHasQualifier "const" x.vtype then p_false else p_true else match mem with | CVAL | HEAP -> p_bool (ALLOC.value sigma.alloc x) | CREF | CTXT | CARR -> p_true (* segment *) let valid_offset_path sigma acs mem x ofs = p_and (valid_base sigma acs mem x) (valid_offset (vobject mem x) ofs) let valid_range_path sigma acs mem x ofs rg = p_and (valid_base sigma acs mem x) (valid_range (vobject mem x) ofs rg) (* in-model validation *) let valid sigma acs = function | Rloc(obj,l) -> begin match l with | Ref _ -> p_true | Loc l -> M.valid sigma.mem acs (Rloc(obj,l)) | Val(m,x,p) -> try valid_offset_path sigma acs m x p with ShiftMismatch -> if is_heap_allocated m then M.valid sigma.mem acs (Rloc(obj,mloc_of_loc l)) else shift_mismatch l end | Rrange(l,elt,a,b) -> begin match l with | Ref x -> noref ~op:"valid sub-range of" x | Loc l -> M.valid sigma.mem acs (Rrange(l,elt,a,b)) | Val(m,x,p) -> match a,b with | Some ka,Some kb -> begin try F.p_imply (F.p_leq ka kb) (valid_range_path sigma acs m x p (elt,ka,kb)) with ShiftMismatch -> if is_heap_allocated m then let l = mloc_of_loc l in M.valid sigma.mem acs (Rrange(l,elt,a,b)) else shift_mismatch l end | _ -> Warning.error "Validity of infinite range @[%a.(%a..%a)@]" pretty l Vset.pp_bound a Vset.pp_bound b end (* -------------------------------------------------------------------------- *) (* --- Invalidity --- *) (* -------------------------------------------------------------------------- *) let invalid_range obj ofs range = F.p_disj (range_check stay_outside [] (obj,1) ofs range) let invalid_offset_path sigma m x p = p_not (valid_offset_path sigma RD m x p) let invalid_range_path sigma m x p rg = p_imply (valid_base sigma RD m x) (invalid_range (vobject m x) p rg) let invalid sigma = function | Rloc(obj,l) -> begin match l with | Ref _ -> p_false | Loc l -> M.invalid sigma.mem (Rloc(obj,l)) | Val(m,x,p) -> try invalid_offset_path sigma m x p with ShiftMismatch -> if is_heap_allocated m then M.invalid sigma.mem (Rloc(obj,mloc_of_loc l)) else shift_mismatch l end | Rrange(l,elt,a,b) -> begin match l with | Ref x -> noref ~op:"invalid sub-range of" x | Loc l -> M.invalid sigma.mem (Rrange(l,elt,a,b)) | Val(m,x,p) -> match a,b with | Some ka,Some kb -> begin try F.p_imply (F.p_leq ka kb) (invalid_range_path sigma m x p (elt,ka,kb)) with ShiftMismatch -> if is_heap_allocated m then let l = mloc_of_loc l in M.invalid sigma.mem (Rrange(l,elt,a,b)) else shift_mismatch l end | _ -> Warning.error "Invalidity of infinite range @[%a.(%a..%a)@]" pretty l Vset.pp_bound a Vset.pp_bound b end (* -------------------------------------------------------------------------- *) (* --- Scope --- *) (* -------------------------------------------------------------------------- *) let is_mem x = match V.param x with | ByAddr -> true | _ -> false let is_mvar_alloc x = match V.param x with | ByRef | InContext | InArray | NotUsed -> false | ByValue | ByShift | ByAddr -> true let frame sigma = let pool = ref [] in SIGMA.iter (fun x p -> if (x.vglob || x.vformal) && Cil.isPointerType (VAR.typ_of_chunk x) then pool := M.global sigma.mem (e_var p) :: !pool ) sigma.vars ; !pool @ M.frame sigma.mem let alloc sigma xs = let xm = List.filter is_mem xs in let mem = M.alloc sigma.mem xm in let xv = List.filter is_mvar_alloc xs in let domain = TALLOC.Set.of_list xv in let alloc = ALLOC.havoc sigma.alloc domain in { sigma with alloc ; mem } let scope_vars seq scope xs = let xs = List.filter is_mvar_alloc xs in if xs = [] then [] else let t_in = seq.pre.alloc in let t_out = seq.post.alloc in let v_in = match scope with Enter -> e_false | Leave -> e_true in let v_out = match scope with Enter -> e_true | Leave -> e_false in List.map (fun x -> F.p_and (F.p_equal (ALLOC.value t_in x) v_in) (F.p_equal (ALLOC.value t_out x) v_out) ) xs let scope seq scope xs = let xm = List.filter is_mem xs in let smem = { pre = seq.pre.mem ; post = seq.post.mem } in let hmem = M.scope smem scope xm in let hvars = scope_vars seq scope xs in hvars @ hmem let global sigma p = M.global sigma.mem p (* -------------------------------------------------------------------------- *) (* --- Havoc along a ranged-path --- *) (* -------------------------------------------------------------------------- *) let rec assigned_path (hs : pred list) (* collector of properties *) (xs : var list) (* variable quantifying the assigned location *) (ys : var list) (* variable quantifying others locations *) (a : term) (* pre-term for root + current offset *) (b : term) (* post-term for root + current offset *) = function | [] -> hs (*TODO: optimized version for terminal [Field _] and [Index _] *) | Field f :: ofs -> let cf = Cfield f in let af = e_getfield a cf in let bf = e_getfield b cf in let hs = assigned_path hs xs ys af bf ofs in List.fold_left (fun hs g -> if Fieldinfo.equal f g then hs else let cg = Cfield g in let ag = e_getfield a cg in let bg = e_getfield b cg in let eqg = p_forall ys (p_equal ag bg) in eqg :: hs ) hs f.fcomp.cfields | Shift(_,e) :: ofs -> let y = Lang.freshvar ~basename:"k" Qed.Logic.Int in let k = e_var y in let ak = e_get a k in let bk = e_get b k in if List.exists (fun x -> F.occurs x e) xs then (* index [e] is covered by [xs]: must explore deeper the remaining path. *) assigned_path hs xs (y::ys) ak bk ofs else (* index [e] is not covered by [xs]: any index different from e is disjoint. explore also deeply with index [e]. *) let ae = e_get a e in let be = e_get b e in let ek = p_neq e k in let eqk = p_forall (y::ys) (p_imply ek (p_equal ak bk)) in assigned_path (eqk :: hs) xs ys ae be ofs let assigned_genset s xs mem x ofs p = let valid = valid_offset_path s.post Sigs.RW mem x ofs in let a = get_term s.pre x in let b = get_term s.post x in let a_ofs = access a ofs in let b_ofs = access b ofs in let p_sloc = p_forall xs (p_hyps [valid;p_not p] (p_equal a_ofs b_ofs)) in let conds = assigned_path [p_sloc] xs [] a b ofs in List.map (fun p -> Assert p) conds (* -------------------------------------------------------------------------- *) (* --- Assigned --- *) (* -------------------------------------------------------------------------- *) let assigned_loc seq obj = function | Ref x -> noref ~op:"assigns to" x | Val((CVAL|CREF),_,[]) -> [] (* full update *) | Val((CVAL|CREF),_,_) as vloc -> let v = Lang.freshvar ~basename:"v" (Lang.tau_of_object obj) in stored seq obj vloc (e_var v) | Val((HEAP|CTXT|CARR) as m,x,ofs) -> M.assigned (mseq_of_seq seq) obj (Sloc (mloc_of_path m x ofs)) | Loc l -> M.assigned (mseq_of_seq seq) obj (Sloc l) let assigned_array seq obj l elt n = match l with | Ref x -> noref ~op:"assigns to" x | Val((CVAL|CREF),_,[]) -> [] (* full update *) | Val((CVAL|CREF),_,_) as vloc -> let te = Lang.tau_of_object elt in let v = Lang.freshvar ~basename:"v" Qed.Logic.(Array(Int,te)) in stored seq obj vloc (e_var v) | Val((HEAP|CTXT|CARR) as m,x,ofs) -> let l = mloc_of_path m x ofs in M.assigned (mseq_of_seq seq) obj (Sarray(l,elt,n)) | Loc l -> M.assigned (mseq_of_seq seq) obj (Sarray(l,elt,n)) let assigned_range seq obj l elt a b = match l with | Ref x -> noref ~op:"assigns to" x | Loc l -> M.assigned (mseq_of_seq seq) obj (Srange(l,elt,a,b)) | Val((HEAP|CTXT|CARR) as m,x,ofs) -> M.assigned (mseq_of_seq seq) obj (Srange(mloc_of_path m x ofs,elt,a,b)) | Val((CVAL|CREF) as m,x,ofs) -> let k = Lang.freshvar ~basename:"k" Qed.Logic.Int in let p = Vset.in_range (e_var k) a b in let ofs = ofs_shift elt (e_var k) ofs in assigned_genset seq [k] m x ofs p let assigned_descr seq obj xs l p = match l with | Ref x -> noref ~op:"assigns to" x | Loc l -> M.assigned (mseq_of_seq seq) obj (Sdescr(xs,l,p)) | Val((HEAP|CTXT|CARR) as m,x,ofs) -> M.assigned (mseq_of_seq seq) obj (Sdescr(xs,mloc_of_path m x ofs,p)) | Val((CVAL|CREF) as m,x,ofs) -> assigned_genset seq xs m x ofs p let assigned seq obj = function | Sloc l -> assigned_loc seq obj l | Sarray(l,elt,n) -> assigned_array seq obj l elt n | Srange(l,elt,a,b) -> assigned_range seq obj l elt a b | Sdescr(xs,l,p) -> assigned_descr seq obj xs l p (* -------------------------------------------------------------------------- *) (* --- Segments --- *) (* -------------------------------------------------------------------------- *) type seq = | Rseg of varinfo | Fseg of varinfo * delta list | Mseg of M.loc rloc * varinfo * delta list | Lseg of M.loc rloc and delta = | Dfield of fieldinfo | Drange of term option * term option let dofs = function | Field f -> Dfield f | Shift(_,k) -> let u = Some k in Drange(u,u) let tofs = function | Field d -> Ctypes.object_of d.ftype | Shift(elt,_) -> elt let rec dstartof dim = function | C_array arr -> let n = match arr.arr_flat with None -> 1 | Some a -> a.arr_dim in if n > dim then let u = Some e_zero in let elt = Ctypes.object_of arr.arr_element in Drange(u,u) :: dstartof dim elt else [] | _ -> [] let rec doffset obj host = function | d::ds -> dofs d :: (doffset obj (tofs d) ds) | [] -> dstartof (Ctypes.get_array_dim obj) host let delta obj x ofs = doffset obj (Ctypes.object_of x.vtype) ofs let rec range ofs obj a b = match ofs with | [] -> [ Drange(a,b) ] | [Shift(elt,k)] when Ctypes.equal elt obj -> [ Drange( Vset.bound_shift a k , Vset.bound_shift b k ) ] | d :: ofs -> dofs d :: range ofs obj a b let locseg = function | Rloc(_,Ref x) -> Rseg x | Rrange(Ref x,_,_,_) -> noref ~op:"sub-range of" x | Rloc(obj,Loc l) -> Lseg (Rloc(obj,l)) | Rloc(obj,Val((CVAL|CREF),x,ofs)) -> Fseg(x,delta obj x ofs) | Rrange(Loc l,obj,a,b) -> Lseg (Rrange(l,obj,a,b)) | Rrange(Val((CVAL|CREF),x,ofs),obj,a,b) -> Fseg(x,range ofs obj a b) (* in M: *) | Rloc(obj,Val((CTXT|CARR|HEAP) as m,x,ofs)) -> Mseg(Rloc(obj,mloc_of_path m x ofs),x,delta obj x ofs) | Rrange(Val((CTXT|CARR|HEAP) as m,x,ofs),obj,a,b) -> Mseg(Rrange(mloc_of_path m x ofs,obj,a,b),x,range ofs obj a b) (* -------------------------------------------------------------------------- *) (* --- Segment Inclusion --- *) (* -------------------------------------------------------------------------- *) let rec included_delta d1 d2 = match d1 , d2 with | _ , [] -> p_true | [] , _ -> p_false | u :: d1 , v :: d2 -> match u , v with | Dfield f , Dfield g when Fieldinfo.equal f g -> included_delta d1 d2 | Dfield _ , _ | _ , Dfield _ -> p_false | Drange(a1,b1) , Drange(a2,b2) -> p_conj [ Vset.ordered ~strict:false ~limit:true a2 a1 ; Vset.ordered ~strict:false ~limit:true b1 b2 ; included_delta d1 d2 ] let included s1 s2 = match locseg s1 , locseg s2 with | Rseg x , Rseg y -> if Varinfo.equal x y then p_true else p_false | Rseg _ , _ | _ , Rseg _ -> p_false | Fseg(x1,d1) , Fseg(x2,d2) | Mseg(_,x1,d1) , Mseg(_,x2,d2) -> if Varinfo.equal x1 x2 then included_delta d1 d2 else p_false | Fseg _ , _ | _ , Fseg _ -> p_false | (Lseg s1|Mseg(s1,_,_)) , (Lseg s2|Mseg(s2,_,_)) -> M.included s1 s2 (* -------------------------------------------------------------------------- *) (* --- Segment Separation --- *) (* -------------------------------------------------------------------------- *) let rec separated_delta d1 d2 = match d1 , d2 with | [] , _ | _ , [] -> p_false | u :: d1 , v :: d2 -> match u , v with | Dfield f , Dfield g when Fieldinfo.equal f g -> separated_delta d1 d2 | Dfield _ , _ | _ , Dfield _ -> p_true | Drange(a1,b1) , Drange(a2,b2) -> p_disj [ Vset.ordered ~strict:true ~limit:false b1 a2 ; Vset.ordered ~strict:true ~limit:false b2 a1 ; separated_delta d1 d2 ] let separated r1 r2 = match locseg r1 , locseg r2 with | Rseg x , Rseg y -> if Varinfo.equal x y then p_false else p_true | Rseg _ , _ | _ , Rseg _ -> p_true | Fseg(x1,d1) , Fseg(x2,d2) | Mseg(_,x1,d1) , Mseg(_,x2,d2) -> if Varinfo.equal x1 x2 then separated_delta d1 d2 else p_true | Fseg _ , _ | _ , Fseg _ -> p_true | (Lseg s1|Mseg(s1,_,_)) , (Lseg s2|Mseg(s2,_,_)) -> M.separated s1 s2 (* -------------------------------------------------------------------------- *) (* --- Domain --- *) (* -------------------------------------------------------------------------- *) let domain obj l = match l with | Ref x | Val((CVAL|CREF),x,_) -> Heap.Set.singleton (Var x) | Loc _ | Val((CTXT|CARR|HEAP),_,_) -> M.Heap.Set.fold (fun m s -> Heap.Set.add (Mem m) s) (M.domain obj (mloc_of_loc l)) Heap.Set.empty (* -------------------------------------------------------------------------- *) end ������������frama-c-20.0-Calcium/src/plugins/wp/MemVar.mli������������������������������������������������������0000666�0000000�0000000�00000004110�13571573400�015777� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- No-Aliasing Memory Model --- *) (* -------------------------------------------------------------------------- *) open Cil_types module type VarUsage = sig val datatype : string val param : varinfo -> MemoryContext.param (** Memory Model Hypotheses *) val hypotheses : unit -> MemoryContext.clause list end module Make(V : VarUsage)(M : Sigs.Model) : Sigs.Model ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemZeroAlias.ml�������������������������������������������������0000666�0000000�0000000�00000021570�13571573400�017000� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- L-Value Indexed Memory Model --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype open Lang open Lang.F open Sigs module Logic = Qed.Logic let datatype = "MemZeroAlias" let configure () = begin Context.set Lang.pointer (fun _typ -> Logic.Int) ; Context.set Cvalues.null F.(p_equal e_zero) ; end let no_binder = { bind = fun _ f v -> f v } let configure_ia _ = no_binder (* TODO: compute actual separation hypotheses *) let hypotheses () = [] (* -------------------------------------------------------------------------- *) (* --- Chunks --- *) (* -------------------------------------------------------------------------- *) type chunk = varinfo * path list (* from left to right *) and path = S | I | F of fieldinfo let hash_path = function S -> 1 | I -> 2 | F fd -> Fieldinfo.hash fd let equal_path p q = match p,q with | S , S -> true | I , I -> true | F f , F g -> Fieldinfo.equal f g | _ -> false let compare_path p q = match p,q with | S , S -> 0 | S , _ -> (-1) | _ , S -> 1 | I , I -> 0 | I , _ -> (-1) | _ , I -> 1 | F f , F g -> Fieldinfo.compare f g [@@@ warning "-32"] let pp_path fmt = function | S -> Format.pp_print_char fmt '*' | I -> Format.pp_print_string fmt "[]" | F f -> Format.pp_print_char fmt '.' ; Fieldinfo.pretty fmt f [@@@ warning "+32"] let rec object_of_rpath x = function | [] -> Ctypes.object_of x.vtype | S :: p -> Ctypes.object_of_pointed (object_of_rpath x p) | I :: p -> Ctypes.object_of_array_elem (object_of_rpath x p) | F f :: _ -> Ctypes.object_of f.ftype let rec dim_of_path t = function | [] -> t | S :: p | F _ :: p -> dim_of_path t p | I :: p -> dim_of_path Qed.Logic.(Array(Int,t)) p module Chunk = struct type t = chunk let self = "mtree" let hash (x,p) = Qed.Hcons.hash_list hash_path (Varinfo.hash x) p let equal (x,p) (y,q) = Varinfo.equal x y && Qed.Hcons.equal_list equal_path p q let compare (x,p) (y,q) = let cmp = Varinfo.compare x y in if cmp <> 0 then cmp else Qed.Hcons.compare_list compare_path p q let rec pp x fmt = function | [] -> Varinfo.pretty fmt x | [S] -> Format.fprintf fmt "*%a" Varinfo.pretty x | S::ps -> Format.fprintf fmt "*(%a)" (pp x) ps | I::ps -> Format.fprintf fmt "%a[]" (pp x) ps | F f::S::ps -> Format.fprintf fmt "%a->%a" (pp x) ps Fieldinfo.pretty f | F f::ps -> Format.fprintf fmt "%a.%a" (pp x) ps Fieldinfo.pretty f let pretty fmt (x,p) = Format.fprintf fmt "@[<hov 2>%a@]" (pp x) (List.rev p) let tau_of_chunk (x,p) = let te = Lang.tau_of_object (object_of_rpath x (List.rev p)) in dim_of_path te p let basename_of_chunk (x,_) = LogicUsage.basename x let is_framed (x,p) = not x.vglob && p = [] end module Heap = Qed.Collection.Make(Chunk) module Sigma = Sigma.Make(Chunk)(Heap) type loc = | Null | Var of varinfo | Star of loc | Array of loc * F.term | Field of loc * fieldinfo type sigma = Sigma.t type domain = Sigma.domain type segment = loc rloc let rec pretty fmt = function | Null -> Format.pp_print_string fmt "null" | Var x -> Varinfo.pretty fmt x | Star(Var x) -> Format.fprintf fmt "*%a" Varinfo.pretty x | Star p -> Format.fprintf fmt "*(%a)" pretty p | Array(p,k) -> Format.fprintf fmt "%a[%a]" pretty p Lang.F.pp_term k | Field(Star p,f) -> Format.fprintf fmt "%a->%a" pretty p Fieldinfo.pretty f | Field(p,f) -> Format.fprintf fmt "%a.%a" pretty p Fieldinfo.pretty f let rec vars = function | Var _ | Null -> Vars.empty | Star p | Field(p,_) -> vars p | Array(p,k) -> Vars.union (vars p) (F.vars k) let rec occurs x = function | Null | Var _ -> false | Star p | Field(p,_) -> occurs x p | Array(p,k) -> F.occurs x k || occurs x p let source = "Tree Model" let null = Null let literal ~eid:_ _ = Warning.error ~source "No Literal" let pointer_loc _t = Warning.error ~source "No Pointer Loc" let pointer_val _v = Warning.error ~source "No Pointer Val" let cvar x = Var x let field l f = Field(l,f) let shift l _obj k = Array(l,k) let base_addr _l = Warning.error ~source "No Base Addr" let base_offset _l = Warning.error ~source "No Offset Addr" let block_length _s _obj _l = Warning.error ~source "No Block Length" let cast _ _l = Warning.error ~source "No Cast" let loc_of_int _ _ = Warning.error ~source "No Hardware Address" let int_of_loc _ _ = Warning.error ~source "No Hardware Address" let rec walk ps ks = function | Null -> Warning.error ~source "No Null Walk" | Var x -> (x,ps),ks | Star l -> walk (S::ps) ks l | Array(l,k) -> walk (I::ps) (k::ks) l | Field(l,f) -> walk (F f::ps) ks l let access l = walk [] [] l let domain _obj l = try Heap.Set.singleton (fst (access l)) with _ -> Heap.Set.empty let value sigma l = let m,ks = access l in let x = Sigma.get sigma m in List.fold_left F.e_get (e_var x) ks let rec update a ks v = match ks with | [] -> v | k::ks -> F.e_set a k (update (F.e_get a k) ks v) let set s m ks v = if ks = [] then v else update (e_var (Sigma.get s m)) ks v let load sigma obj l = if Ctypes.is_pointer obj then Loc (Star l) else Val(value sigma l) let stored seq _obj l e = let m,ks = access l in let x = F.e_var (Sigma.get seq.post m) in [Set( x , set seq.pre m ks e )] let copied seq obj a b = stored seq obj a (value seq.pre b) let assigned _s _obj _sloc = [] type state = Chunk.t Tmap.t let state (s:sigma) = let m = ref Tmap.empty in Sigma.iter (fun c x -> m := Tmap.add (F.e_var x) c !m) s ; !m let imval c = Sigs.Mchunk (Pretty_utils.to_string Chunk.pretty c) let iter f s = Tmap.iter (fun v c -> f (imval c) v) s let lookup (s : state) (e : Lang.F.term) = imval (F.Tmap.find e s) let apply f s = let m = ref Tmap.empty in Tmap.iter (fun e c -> m := Tmap.add (f e) c !m) s ; !m let rec ipath lv = function | [] -> lv | S::w -> ipath (Mval lv,[]) w | I::_ -> raise Not_found | F f::w -> let (host,path) = lv in ipath (host, path @ [Mfield f]) w let ilval (x,p) = ipath (Mvar x,[]) p let heap domain state = Tmap.fold (fun m c w -> if Vars.intersect (F.vars m) domain then Heap.Map.add c m w else w ) state Heap.Map.empty let updates seq domain = let pre = heap domain seq.pre in let post = heap domain seq.post in let pool = ref Bag.empty in Heap.Map.iter2 (fun c v1 v2 -> try match v1,v2 with | _,None -> () | None,Some v -> pool := Bag.add (Mstore(ilval c,v)) !pool | Some v1,Some v2 -> if v2 != v1 then pool := Bag.add (Mstore (ilval c,v2)) !pool with Not_found -> () ) pre post ; !pool let no_pointer () = Warning.error ~source "No Pointer" let is_null = function Null -> F.p_true | _ -> no_pointer () let loc_eq _ _ = no_pointer () let loc_lt _ _ = no_pointer () let loc_leq _ _ = no_pointer () let loc_neq _ _ = no_pointer () let loc_diff _ _ _ = no_pointer () let frame _sigma = [] let alloc sigma _xs = sigma let scope _seq _s _xs = [] let valid _sigma _acs _l = Warning.error ~source "No validity" let invalid _sigma _l = Warning.error ~source "No validity" let global _sigma _p = p_true let included _s1 _s2 = no_pointer () let separated _s1 _s2 = no_pointer () ����������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemZeroAlias.mli������������������������������������������������0000666�0000000�0000000�00000003531�13571573400�017146� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Empty Memory Model --- *) (* -------------------------------------------------------------------------- *) include Sigs.Model �����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemoryContext.ml������������������������������������������������0000666�0000000�0000000�00000013634�13571573400�017267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Variable Partitionning --- *) (* -------------------------------------------------------------------------- *) type param = NotUsed | ByAddr | ByValue | ByShift | ByRef | InContext | InArray let pp_param fmt = function | NotUsed -> Format.pp_print_string fmt "not used" | ByAddr -> Format.pp_print_string fmt "in heap" | ByValue -> Format.pp_print_string fmt "by value" | ByShift -> Format.pp_print_string fmt "by value with shift" | ByRef -> Format.pp_print_string fmt "by ref." | InContext -> Format.pp_print_string fmt "in context" | InArray -> Format.pp_print_string fmt "in array" (* -------------------------------------------------------------------------- *) (* --- Separation Hypotheses --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype type zone = | Var of varinfo (* &x - the cell x *) | Ptr of varinfo (* p - the cell pointed by p *) | Arr of varinfo (* p+(..) - the cell and its neighbors pointed by p *) type partition = { globals : zone list ; (* [ &G , G[...], ... ] *) to_heap : zone list ; (* [ p, ... ] *) context : zone list ; (* [ p+(..), ... ] *) } type clause = Valid of zone | Separated of zone list list (* -------------------------------------------------------------------------- *) let is_separated_true = function [] | [_] -> true | _ -> false (* -------------------------------------------------------------------------- *) let pp_zone fmt = function | Arr vi -> Format.fprintf fmt "%a+(..)" Varinfo.pretty vi | Ptr vi -> Varinfo.pretty fmt vi | Var vi -> Format.fprintf fmt "&%a" Varinfo.pretty vi let pp_region fmt = function | [] -> Format.pp_print_string fmt "\\empty" | [z] -> pp_zone fmt z | z::zs -> Format.fprintf fmt "@[<hov 2>\\union(%a" pp_zone z ; List.iter (fun z -> Format.fprintf fmt ",@,%a" pp_zone z) zs ; Format.fprintf fmt ")@]" let pp_separation fmt = function | [] | [_] -> Format.pp_print_string fmt "\\true" | r::rs -> Format.fprintf fmt "@[<hov 2>\\separated(%a" pp_region r ; List.iter (fun r -> Format.fprintf fmt ",@,%a" pp_region r) rs ; Format.fprintf fmt ")@]" let pp_clause fmt = function | Separated sep -> Format.fprintf fmt "@ @[<hov 2>requires %a;@]" pp_separation sep | Valid zone -> Format.fprintf fmt "@ @[<hov 2>requires \\valid(%a);@]" pp_zone zone (* -------------------------------------------------------------------------- *) (* --- Memory Context --- *) (* -------------------------------------------------------------------------- *) let add_region r s = if r = [] then s else r::s let separated partition = List.rev @@ add_region (List.rev partition.to_heap) @@ add_region (List.rev partition.globals) @@ List.map (fun z -> [z]) partition.context let validity partition = List.rev @@ List.map (fun z -> Valid z) partition.context let requires partition = let s = separated partition in let v = validity partition in if not (is_separated_true s) then Separated s :: v else v (* -------------------------------------------------------------------------- *) (* --- Partition --- *) (* -------------------------------------------------------------------------- *) let empty = { globals = [] ; context = [] ; to_heap = [] ; } let set x p w = match p with | NotUsed -> w | ByAddr -> w | ByRef | InContext -> if Cil.isFunctionType x.vtype then w else { w with context = Ptr x :: w.context } | InArray -> if Cil.isFunctionType x.vtype then w else { w with context = Arr x :: w.context } | ByValue | ByShift -> if x.vghost then w else if Cil.isFunctionType x.vtype then w else if x.vglob && (x.vstorage <> Static || x.vaddrof) then let z = if Cil.isArrayType x.vtype then Arr x else Var x in { w with globals = z :: w.globals } else if x.vformal && Cil.isPointerType x.vtype then let z = if p = ByShift then Arr x else Ptr x in { w with to_heap = z :: w.to_heap } else w (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/MemoryContext.mli�����������������������������������������������0000666�0000000�0000000�00000004470�13571573400�017436� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type param = NotUsed | ByAddr | ByValue | ByShift | ByRef | InContext | InArray val pp_param : Format.formatter -> param -> unit type partition val empty : partition val set : varinfo -> param -> partition -> partition type zone = | Var of varinfo (** [&x] the cell x *) | Ptr of varinfo (** [p] the cell pointed by p *) | Arr of varinfo (** [p+(..)] the cell and its neighbors pointed by p *) type clause = | Valid of zone | Separated of zone list list (** Build the separation clause from a partition, including the clauses related to the pointer validity *) val requires : partition -> clause list val pp_zone : Format.formatter -> zone -> unit val pp_clause : Format.formatter -> clause -> unit ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Mstate.ml�������������������������������������������������������0000666�0000000�0000000�00000010131�13571573400�015674� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang.F open Sigs type (_,_) eq = Equal : 'a -> ('a,'a) eq | NotEqual : ('a,'b) eq module Ident : sig type 'a t val create : 'a -> 'a t val get : 'a t -> 'a val eq : 'a t -> 'b t -> ('a,'b) eq end = struct let k = ref 0 type 'a t = int * 'a let get = snd let create s = incr k ; (!k,s) let eq (k,s) (k',_) = if k = k' then Obj.magic (Equal s) else NotEqual end (* -------------------------------------------------------------------------- *) (* --- L-Val Utility --- *) (* -------------------------------------------------------------------------- *) let index (host,ofs) k = host , ofs @ [Mindex k] let field (host,ofs) f = host , ofs @ [Mfield f] let host_eq a b = match a,b with | Mvar x , Mvar y -> Cil_datatype.Varinfo.equal x y | Mmem a , Mmem b -> a == b | _ -> false let ofs_eq a b = match a,b with | Mindex i , Mindex j -> i = j | Mfield f , Mfield g -> Cil_datatype.Fieldinfo.equal f g | _ -> false let rec offset_eq p q = match p,q with | [],[] -> true | a :: p , b :: q -> ofs_eq a b && offset_eq p q | _ -> false let equal a b = a == b || (host_eq (fst a) (fst b) && offset_eq (snd a) (snd b)) (* -------------------------------------------------------------------------- *) (* --- Memory State Pretty Printing Information --- *) (* -------------------------------------------------------------------------- *) type 'a operations = { apply : (term -> term) -> 'a -> 'a ; lookup : 'a -> term -> mval ; updates : 'a sequence -> Vars.t -> update Bag.t ; iter : (mval -> term -> unit) -> 'a -> unit ; } type 'a model = MODEL : 'a operations Ident.t * ('b -> 'a) -> 'b model let create (type s) (module M : Sigs.Model with type Sigma.t = s) = let op = { apply = M.apply ; lookup = M.lookup ; updates = M.updates ; iter = M.iter ; } in MODEL( Ident.create op , M.state ) type state = STATE : 'a operations Ident.t * 'a -> state let state model sigma = match model with MODEL(op,state) -> STATE(op,state sigma) let iter f = function STATE(m,s) -> (Ident.get m).iter f s let apply f = function STATE(m,s) -> STATE(m,(Ident.get m).apply f s) let lookup s e = match s with STATE(m,s) -> (Ident.get m).lookup s e let updates seq vars = match seq.pre , seq.post with STATE(p,u) , STATE(q,v) -> match Ident.eq p q with | Equal s -> s.updates { pre = u ; post = v } vars | NotEqual -> Bag.empty (* assert false *) (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Mstate.mli������������������������������������������������������0000666�0000000�0000000�00000005010�13571573400�016045� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang.F open Sigs (* -------------------------------------------------------------------------- *) (* --- L-Val Utility --- *) (* -------------------------------------------------------------------------- *) val index : s_lval -> term -> s_lval val field : s_lval -> Cil_types.fieldinfo -> s_lval val equal : s_lval -> s_lval -> bool (* -------------------------------------------------------------------------- *) (* --- Memory State Pretty Printing Information --- *) (* -------------------------------------------------------------------------- *) type 'a model type state val create : (module Model with type Sigma.t = 'a) -> 'a model val state : 'a model -> 'a -> state val lookup : state -> term -> mval val apply : (term -> term) -> state -> state val iter : (mval -> term -> unit) -> state -> unit val updates : state sequence -> Vars.t -> update Bag.t ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Passive.ml������������������������������������������������������0000666�0000000�0000000�00000005510�13571573400�016056� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Passive Forms --- *) (* -------------------------------------------------------------------------- *) open Lang open Lang.F type binding = | Bind of var * var (* fresh , bound *) | Join of var * var (* left, right *) type t = binding list let empty = [] let is_empty n = n = [] let union = List.append let bind ~fresh ~bound bs = Bind(fresh,bound) :: bs let join x y bs = if Var.equal x y then bs else Join(x,y) :: bs let eq x y = F.p_equal (e_var x) (e_var y) let rec collect phi hs = function | [] -> hs | Bind(x,y)::bs -> collect phi (if phi y then eq x y :: hs else hs) bs | Join(x,y)::bs -> collect phi (if phi x || phi y then eq x y :: hs else hs) bs let apply bindings p = let xs = varsp p in let hs = collect (fun x -> Vars.mem x xs) [] bindings in p_conj (p::hs) let conditions bindings phi = collect phi [] bindings let iter = List.iter let pretty fmt = List.iter begin function | Bind(x,y) -> Format.fprintf fmt "@ @[%a:=%a@]" F.pp_var x F.pp_var y | Join(x,y) -> Format.fprintf fmt "@ @[%a==%a@]" F.pp_var x F.pp_var y end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Passive.mli�����������������������������������������������������0000666�0000000�0000000�00000004017�13571573400�016230� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang.F (** Passive Forms *) type t val empty : t val is_empty : t -> bool val union : t -> t -> t val bind : fresh:var -> bound:var -> t -> t val join : var -> var -> t -> t val conditions : t -> (var -> bool) -> pred list val apply : t -> pred -> pred type binding = | Bind of var * var (* fresh , bound *) | Join of var * var (* left, right *) val iter : (binding -> unit) -> t -> unit val pretty : Format.formatter -> t -> unit �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Pcfg.ml���������������������������������������������������������0000666�0000000�0000000�00000022500�13571573400�015321� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Lang open Lang.F open Sigs (* -------------------------------------------------------------------------- *) (* --- State Registry --- *) (* -------------------------------------------------------------------------- *) type label = { id : int ; (* index in the sequent, unique *) name : string ; (* (almost) unique *) stmt : Cil_types.stmt option ; (* if defined in the sequent *) state : Mstate.state ; mutable flag : bool ; mutable prev : label list ; mutable next : label list ; } type value = | Term | Addr of s_lval | Lval of s_lval * label | Chunk of string * label module Imap = Datatype.Int.Map type env = { mutable kid : int ; (* counter for anonymous labels *) mutable cfg : label list ; (* sorted by dominators *) mutable values : value Tmap.t ; (* cache *) mutable labels : label Imap.t ; } let label env ~id ?stmt ?descr state = let name = let open Cil_types in match descr , stmt with | Some lbl , _ -> lbl | None , Some { labels = Label(lbl,_,_) :: _ } -> lbl | _ -> env.kid <- succ env.kid ; Printf.sprintf "L%d" env.kid in { id ; stmt ; name ; state ; flag = false ; prev = [] ; next = [] } let insert env label = begin env.labels <- Imap.add label.id label env.labels ; env.cfg <- label :: env.cfg ; end let create () = { kid = 0 ; cfg = [] ; values = Tmap.empty ; labels = Imap.empty ; } let at env ~id = Imap.find id env.labels let flag lbl = lbl.flag <- true ; lbl let visible lbl = lbl.flag let rec find env e = try Tmap.find e env.values with Not_found -> env.values <- Tmap.add e Term env.values ; if F.is_primitive e then Term else let v = lookup env e env.cfg in env.values <- Tmap.add e v env.values ; v and lookup env e = function | [] -> Term | lbl :: others -> try match Mstate.lookup lbl.state e with | Sigs.Mterm -> raise Not_found | Sigs.Maddr lv -> Addr lv | Sigs.Mlval lv -> Lval(lv,flag lbl) | Sigs.Mchunk m -> Chunk(m,flag lbl) with Not_found -> lookup env e others let is_ref x k = (k == F.e_zero) && Cil.isPointerType x.vtype let is_atomic = function | Mvar x , [Mindex k] -> is_ref x k | Mvar _ , [] -> true | _ -> false let iter f lbl = Mstate.iter f lbl.state let is_copy env lbl = function | Sigs.Mstore( lv , value ) -> begin match find env value with | Lval(lv0,lbl0) -> lbl0 == lbl && Mstate.equal lv lv0 | _ -> false end let updates env seq vars = Bag.filter (fun upd -> not (is_copy env seq.pre upd)) (Mstate.updates { pre = seq.pre.state ; post = seq.post.state } vars) (* -------------------------------------------------------------------------- *) (* --- Label Control Flow --- *) (* -------------------------------------------------------------------------- *) let prev lbl = lbl.prev let next lbl = lbl.next let branching = function { next = [_] } -> false | _ -> true let sequence_point a b = if a != b then match a,b with | Some p , Some q -> if not (List.memq q p.next) then p.next <- q :: p.next ; if not (List.memq p q.prev) then q.prev <- p :: q.prev ; | None , _ | _ , None -> () let rec control env prev sequence next = ignore (ctrl env prev (Conditions.list sequence) next) and ctrl env prev steps next = match steps with | [] -> next | s :: others -> let open Conditions in match s.condition with | Type _ | Have _ | When _ | Core _ | Init _ -> (* Sequence of Labels on Hyp *) ctrl env prev others next | Branch(_,cthen,celse) -> let next = ctrl env None others next in control env prev cthen next ; control env prev celse next ; None | Either cases -> let next = ctrl env None others next in List.iter (fun s -> control env prev s next) cases ; None | State _ -> try let here = Some (at env ~id:s.id) in sequence_point prev here ; let next = ctrl env here others next in sequence_point here next ; here with Not_found -> ctrl env prev others next (* -------------------------------------------------------------------------- *) (* --- Priority Queue --- *) (* -------------------------------------------------------------------------- *) let register seq = ignore (Conditions.steps seq) ; let env = create () in let queue = Queue.create () in let push s = Queue.add s queue in let pop () = try Some (Queue.pop queue) with Queue.Empty -> None in let api = ref [] in (* Pre & Post *) let cfg = ref [] in (* Other labels *) let pool = function Some ("Pre"|"Post") -> api | _ -> cfg in let rec compile seq = Conditions.iter (fun s -> let open Conditions in match s with | { id ; stmt ; descr ; condition = State m } -> let label = label env ~id ?stmt ?descr m in let r = pool descr in r := label :: !r | { condition = Type _ | Have _ | When _ | Core _ | Init _ } -> () | { condition = Branch(_,cthen,celse) } -> push cthen ; push celse | { condition = Either cases } -> List.iter push cases ) seq ; match pop () with Some s -> compile s | None -> () in compile seq ; let insert = insert env in List.iter insert !cfg ; List.iter insert !api ; control env None seq None ; env (* -------------------------------------------------------------------------- *) (* --- Pretty Printer --- *) (* -------------------------------------------------------------------------- *) class virtual engine = object(self) method virtual pp_atom : Format.formatter -> F.term -> unit method virtual pp_flow : Format.formatter -> F.term -> unit (* --- L-Values --- *) method is_atomic_lv = is_atomic method pp_ofs fmt = function | Mfield fd -> Format.fprintf fmt ".%s@," fd.fname | Mindex k -> Format.fprintf fmt "[%a]@," self#pp_flow k method pp_offset fmt fs = List.iter (self#pp_ofs fmt) fs method pp_host fmt = function | Sigs.Mvar x -> Format.pp_print_string fmt x.vname | Sigs.Mmem p -> self#pp_atom fmt p | Sigs.Mval lv -> self#pp_lval fmt lv method pp_lval fmt = function | Mvar x , [] -> Format.pp_print_string fmt x.vname | Mvar x , [Mindex k] when is_ref x k -> Format.fprintf fmt "*%s" x.vname | Mvar x , ofs -> Format.fprintf fmt "@[<hov 2>%s%a@]" x.vname self#pp_offset ofs | host , [] -> Format.fprintf fmt "*%a" self#pp_host host | host , Mfield fd :: ofs -> Format.fprintf fmt "@[<hov 2>%a@,->%s%a@]" self#pp_host host fd.fname self#pp_offset ofs | host , ((Mindex _ :: _) as ofs) -> Format.fprintf fmt "@[<hov 2>%a@,%a@]" self#pp_host host self#pp_offset ofs method pp_addr fmt = function | Mvar x , [] -> Format.fprintf fmt "&%s" x.vname | Mmem p , [] -> self#pp_atom fmt p | Mmem p , [Mindex k] -> Format.fprintf fmt "%a + %a" self#pp_atom p self#pp_atom k | lv -> Format.fprintf fmt "&(%a)" self#pp_lval lv method pp_label fmt lbl = Format.pp_print_string fmt lbl.name method pp_chunk fmt m = Format.fprintf fmt "µ:%s" m end open Sigs let rec lv_iter f (h,ofs) = host_iter f h ; List.iter (ofs_iter f) ofs and host_iter f = function Mvar _ -> () | Mmem e -> f e | Mval lv -> lv_iter f lv and ofs_iter f = function Mfield _ -> () | Mindex e -> f e let subterms env f e = match find env e with | Term -> false | Chunk _ -> true | Addr lv | Lval(lv,_) -> lv_iter f lv ; true ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Pcfg.mli��������������������������������������������������������0000666�0000000�0000000�00000005517�13571573400�015503� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Sigs open Lang open Lang.F type env type label type value = | Term | Addr of s_lval | Lval of s_lval * label | Chunk of string * label val create : unit -> env val register : Conditions.sequence -> env val at : env -> id:int -> label val find : env -> F.term -> value val updates : env -> label Sigs.sequence -> Vars.t -> Sigs.update Bag.t val visible : label -> bool val subterms : env -> (F.term -> unit) -> F.term -> bool val prev : label -> label list val next : label -> label list val iter : (Sigs.mval -> term -> unit) -> label -> unit val branching : label -> bool class virtual engine : object method virtual pp_atom : Format.formatter -> term -> unit method virtual pp_flow : Format.formatter -> term -> unit method is_atomic_lv : s_lval -> bool method pp_ofs : Format.formatter -> s_offset -> unit method pp_offset : Format.formatter -> s_offset list -> unit method pp_host : Format.formatter -> s_host -> unit (** current state *) method pp_lval : Format.formatter -> s_lval -> unit (** current state *) method pp_addr : Format.formatter -> s_lval -> unit method pp_label : Format.formatter -> label -> unit (** label name *) method pp_chunk : Format.formatter -> string -> unit (** chunk name *) end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Pcond.ml��������������������������������������������������������0000666�0000000�0000000�00000040636�13571573400�015517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) module F = Lang.F module Env = Plang.Env open F let dkey_state = Wp_parameters.register_category "state" type env = Plang.Env.t let rec alloc_hyp pool f seq = let open Conditions in if not (Vars.subset (Conditions.vars_hyp seq) (Plang.alloc_domain pool)) then Conditions.iter (fun step -> if not (Vars.subset step.vars (Plang.alloc_domain pool)) then match step.condition with | State _ -> Plang.alloc_xs pool f step.vars | Have p | When p | Type p | Init p | Core p -> Plang.alloc_p pool f p | Branch(p,sa,sb) -> Plang.alloc_p pool f p ; alloc_hyp pool f sa ; alloc_hyp pool f sb ; | Either cases -> List.iter (alloc_hyp pool f) cases ) seq let alloc_seq pool f (hs,g) = begin Plang.alloc_p pool f g ; (* Mark goal first *) alloc_hyp pool f hs ; end (* -------------------------------------------------------------------------- *) (* --- State Printer --- *) (* -------------------------------------------------------------------------- *) type context = NoWhere | InAddr | AtLabel of Pcfg.label class state = object(self) inherit Plang.engine as super inherit Pcfg.engine val mutable env = Pcfg.create () val mutable context = NoWhere val mutable domain = Vars.empty method clear = begin env <- Pcfg.create () ; context <- NoWhere ; domain <- Vars.empty ; end method set_sequence seq = begin env <- Pcfg.register seq ; context <- NoWhere ; domain <- Conditions.vars_hyp seq ; end method domain = domain method set_domain vars = domain <- vars method label_at ~id = Pcfg.at env ~id method private at : 'a. ?lbl:Pcfg.label -> (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit = begin fun ?lbl pp fmt w -> match context , lbl with | NoWhere , None -> context <- InAddr ; Format.fprintf fmt "« %a »" pp w ; context <- NoWhere ; | NoWhere , Some l -> context <- AtLabel l ; Format.fprintf fmt "« %a »%a" pp w self#pp_at l ; context <- NoWhere ; | InAddr , None -> pp fmt w | AtLabel _ , None -> pp fmt w | AtLabel l0 , Some l when l == l0 -> pp fmt w | (InAddr | AtLabel _) as here , Some l -> context <- AtLabel l ; Format.fprintf fmt "( %a )%a" pp w self#pp_at l ; context <- here ; end method private atflow : 'a. ?lbl:Pcfg.label -> (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit = begin fun ?lbl pp fmt w -> match context , lbl with | NoWhere , None -> context <- InAddr ; pp fmt w ; context <- NoWhere ; | InAddr , None -> pp fmt w | AtLabel _ , None -> pp fmt w | AtLabel l0 , Some l when l == l0 -> pp fmt w | (InAddr | AtLabel _ | NoWhere) as here , Some l -> context <- AtLabel l ; Format.fprintf fmt "%a%a" pp w self#pp_at l ; context <- here ; end method pp_at fmt lbl = Format.fprintf fmt "@@%a" self#pp_label lbl val mutable force = false method! pp_var fmt x = Format.pp_print_char fmt '`' ; Format.pp_print_string fmt x method! pp_repr fmt e = if force then (force <- false ; super#pp_repr fmt e) else begin match Pcfg.find env e with | Pcfg.Term -> super#pp_repr fmt e | Pcfg.Addr lv -> if self#is_atomic_lv lv then self#atflow self#pp_addr fmt lv else self#at self#pp_addr fmt lv | Pcfg.Lval(lv,lbl) -> if self#is_atomic_lv lv then self#atflow ~lbl self#pp_lval fmt lv else self#at ~lbl self#pp_lval fmt lv | Pcfg.Chunk(m,lbl) -> self#atflow ~lbl self#pp_chunk fmt m end method pp_value fmt e = force <- true ; super#pp_sort fmt e method! pp_sort fmt e = context <- NoWhere ; super#pp_sort fmt e method! pp_term fmt e = context <- NoWhere ; super#pp_term fmt e method! pp_pred fmt p = context <- NoWhere ; super#pp_pred fmt p method! subterms f e = if not (Pcfg.subterms env f e) then super#subterms f e method updates seq = Pcfg.updates env seq domain method pp_update lbl fmt = function Sigs.Mstore(lv,v) -> let stack = context in context <- AtLabel lbl ; Format.fprintf fmt "@[<hov 2>%a =@ %a;@]" self#pp_lval lv self#pp_value v ; context <- stack ; end (* -------------------------------------------------------------------------- *) (* --- Sequent Printer --- *) (* -------------------------------------------------------------------------- *) open Conditions let mark_step m step = (* sub-sequences are marked recursively marked later *) match step.condition with | When p | Type p | Have p | Init p | Core p | Branch(p,_,_) -> F.mark_p m p | Either _ | State _ -> () let spaced pp fmt a = Format.pp_print_space fmt () ; pp fmt a let append pp fmt a = pp fmt a ; Format.pp_print_space fmt () let pp_open_block pp fmt a left = Format.fprintf fmt "@[<hv 0>@[<hv 2>%a %s" pp a left let pp_close_block fmt right = Format.fprintf fmt "@]@ %s@]" right class engine (lang : #Plang.engine) = object(self) (* -------------------------------------------------------------------------- *) (* --- Horizontal Printers --- *) (* -------------------------------------------------------------------------- *) method pp_clause fmt s = Format.fprintf fmt "@{<wp:clause>%s@}" s method pp_stmt fmt s = Format.fprintf fmt "@{<wp:stmt>%s@}" s method pp_name = Format.pp_print_string method pp_core = lang#pp_sort method pp_comment fmt s = Format.fprintf fmt "@[<hov 0>@{<wp:comment>(* %s *)@}@]" s method pp_property fmt p = Format.fprintf fmt "@[<hov 0>@{<wp:property>(* %a *)@}@]" Description.pp_local p method pp_warning fmt w = let open Warning in Format.fprintf fmt "@[<hov 0>@{<wp:warning>Warning@}[%s]: %s@ (%s).@]" w.source w.reason w.effect method pp_definition fmt x e = Format.fprintf fmt "@[<hov 4>%a %a = %a.@]" self#pp_clause "Let" self#pp_name x self#pp_core e method pp_intro ~step ~clause ?(dot=".") fmt p = ignore step ; Format.fprintf fmt "@[<hov 4>%a %a%s@]" self#pp_clause clause lang#pp_pred p dot (* -------------------------------------------------------------------------- *) (* --- Block Printers --- *) (* -------------------------------------------------------------------------- *) method pp_condition ~step fmt = function | State _ -> () | Core p -> self#pp_intro ~step ~clause:"Core:" fmt p | Type p -> self#pp_intro ~step ~clause:"Type:" fmt p | Init p -> self#pp_intro ~step ~clause:"Init:" fmt p | Have p -> self#pp_intro ~step ~clause:"Have:" fmt p | When p -> self#pp_intro ~step ~clause:"When:" fmt p | Branch(p,sa,sb) -> begin self#pp_intro ~step ~clause:"If" ~dot:"" fmt p ; if not (Conditions.is_true sa) then self#sequence ~clause:"Then" fmt sa ; if not (Conditions.is_true sb) then self#sequence ~clause:"Else" fmt sb ; end | Either cases -> begin pp_open_block self#pp_clause fmt "Either" "{" ; List.iter (fun seq -> Format.fprintf fmt "@ @[<hv 2>%a" self#pp_clause "Case:" ; self#block fmt seq ; Format.fprintf fmt "@]" ; ) cases ; pp_close_block fmt "}" ; end method pp_step fmt step = match step.condition with | State _ -> self#pp_condition ~step fmt step.condition | _ -> begin ( match step.descr with None -> () | Some s -> spaced self#pp_comment fmt s ) ; Warning.Set.iter (spaced self#pp_warning fmt) step.warn ; List.iter (spaced self#pp_property fmt) step.deps ; spaced (self#pp_condition ~step) fmt step.condition ; end method private sequence ~clause fmt seq = Format.pp_print_space fmt () ; self#pp_block ~clause fmt seq method pp_block ~clause fmt seq = if Conditions.is_true seq then Format.fprintf fmt "%a {}" self#pp_clause clause else begin pp_open_block self#pp_clause fmt clause "{"; self#block fmt seq ; pp_close_block fmt "}" ; end method private dump fmt seq () = alloc_seq (Plang.pool ()) (fun x -> ignore (lang#bind x)) seq ; let env,marks = lang#marks in let hs,goal = seq in F.mark_p marks goal ; Conditions.iter (self#mark marks) hs ; Format.fprintf fmt "@[<hv 0>" ; List.iter (append (self#define env) fmt) (F.defs marks) ; lang#set_env env ; if not (Conditions.is_true hs) then begin self#pp_block ~clause:"Assume" fmt hs ; Format.pp_print_newline fmt () ; end ; self#pp_goal fmt goal ; Format.fprintf fmt "@]@." method pp_goal fmt goal = Format.fprintf fmt "@[<hov 4>%a %a.@]" self#pp_clause "Prove:" lang#pp_pred goal method pp_sequence ~clause fmt seq = lang#global (fun () -> self#pp_block ~clause fmt seq) method pp_sequent fmt seq = lang#global (self#dump fmt seq) method pp_esequent env fmt seq = lang#set_env env ; self#dump fmt seq () (* --- Scope Management --- *) method mark m s = mark_step m s method name env e = Env.fresh env ~sanitizer:lang#sanitize (F.basename e) method private define env fmt e = let name = self#name env e in lang#scope env (fun () -> self#pp_definition fmt name e) ; Env.define env name e method private block fmt seq = begin let env,marks = lang#marks in Conditions.iter (self#mark marks) seq ; List.iter (spaced (self#define env) fmt) (F.defs marks) ; lang#scope env (fun () -> Conditions.iter (self#pp_step fmt) seq) ; end end (* -------------------------------------------------------------------------- *) (* --- All-In-One Printers --- *) (* -------------------------------------------------------------------------- *) let is_nop = function None -> true | Some(_,upd) -> Bag.is_empty upd class sequence (lang : #state) = object(self) inherit engine lang as super method private label step = function | State _ -> (try Some (lang#label_at ~id:step.id) with Not_found -> None) | _ -> None method private updates fmt = function | None -> () | Some( lbl , upd ) -> if not (Bag.is_empty upd) then Bag.iter ((spaced (lang#pp_update lbl)) fmt) upd method! pp_condition ~step fmt cond = match self#label step cond with | None -> super#pp_condition ~step fmt cond | Some lbl -> let before = match Pcfg.prev lbl with | [ pre ] when (Pcfg.branching pre) -> let seq = Sigs.{ pre ; post = lbl } in let upd = lang#updates seq in Some(pre,upd) | _ -> None in let after = match Pcfg.next lbl with | [ post ] -> let seq = Sigs.{ pre = lbl ; post } in let upd = lang#updates seq in Some(lbl,upd) | _ -> None in if Pcfg.visible lbl || not (is_nop before) || not (is_nop after) || Wp_parameters.debug_atleast 1 then lang#with_mode Qed.Engine.Mterm (fun _mode -> begin Format.fprintf fmt "@ @[<hv 0>@[<hv 2>%a {" self#pp_stmt "Stmt" ; self#updates fmt before ; if Pcfg.visible lbl then Format.fprintf fmt "@ %a:" lang#pp_label lbl ; if Wp_parameters.debug_atleast 1 then begin if not (Pcfg.visible lbl) then Format.fprintf fmt "@ label %a:" lang#pp_label lbl ; List.iter (fun lbl -> Format.fprintf fmt "@ from %a;" lang#pp_label lbl) (Pcfg.prev lbl) ; List.iter (fun lbl -> Format.fprintf fmt "@ goto %a;" lang#pp_label lbl) (Pcfg.next lbl) ; (* Pcfg.iter (fun _m v -> if Vars.intersect lang#domain (F.vars v) then Format.fprintf fmt "@ (%a := %a)" lang#pp_term v lang#pp_value v ) lbl ; *) end ; self#updates fmt after ; Format.fprintf fmt " @]@ }@]" ; end) val mutable active = true method set_state s = active <- s method get_state = active method set_sequence seq = if active then lang#set_sequence seq else lang#clear method set_goal p = lang#set_domain (Vars.union lang#domain (F.varsp p)) method set_sequent (hs,p) = self#set_sequence hs ; self#set_goal p method! pp_sequence ~clause fmt seq = begin self#set_sequence seq ; super#pp_sequence ~clause fmt seq ; end method! pp_sequent fmt seq = begin self#set_sequent seq ; super#pp_sequent fmt seq ; end method! pp_esequent env fmt seq = begin self#set_sequent seq ; super#pp_esequent env fmt seq ; end end (* -------------------------------------------------------------------------- *) (* --- All-In-One Printers --- *) (* -------------------------------------------------------------------------- *) let engine () = if Wp_parameters.has_dkey dkey_state then ( new sequence (new state) :> engine ) else new engine (new Plang.engine) let pretty fmt seq = (engine())#pp_sequent fmt seq let () = Conditions.pretty := pretty let sequence ?(clause="Sequence") fmt seq = let plang = new Plang.engine in let pcond = new engine plang in plang#global (fun () -> Vars.iter (fun x -> ignore (plang#bind x)) (Conditions.vars_hyp seq) ; pcond#pp_sequence ~clause fmt seq) let bundle ?clause fmt bundle = sequence ?clause fmt (Conditions.bundle bundle) let dump = bundle ~clause:"Bundle" ��������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Pcond.mli�������������������������������������������������������0000666�0000000�0000000�00000012213�13571573400�015656� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Qed.Plib open Conditions (** {2 All-in-one printers} *) val dump : bundle printer val bundle : ?clause:string -> bundle printer val sequence : ?clause:string -> sequence printer val pretty : sequent printer (** {2 Low-level API} *) open Lang.F type env = Plang.Env.t val alloc_hyp : Plang.pool -> (var -> unit) -> sequence -> unit val alloc_seq : Plang.pool -> (var -> unit) -> sequent -> unit (** Sequent Printer Engine. Uses the following [CSS]: - ["wp:clause"] for all clause keywords - ["wp:comment"] for descriptions - ["wp:warning"] for warnings - ["wp:property"] for properties *) class engine : #Plang.engine -> object (** {2 Printer Components} *) method name : env -> term -> string (** Generate a name for marked term *) method mark : marks -> step -> unit (** Marks terms to share in step *) method pp_clause : string printer (** Default: ["@{<wp:clause>...}"] *) method pp_stmt : string printer (** Default: ["@{<wp:stmt>...}"] *) method pp_comment : string printer (** Default: ["@{<wp:comment>(* ... *)}"] *) method pp_property : Property.t printer (** Default: ["@{<wp:property>(* ... *)}"] *) method pp_warning : Warning.t printer (** Default: ["@{<wp:warning>Warning}..."] *) method pp_name : string printer (** Default: [Format.pp_print_string] *) method pp_core : term printer (** Default: [plang#pp_sort] *) method pp_definition : Format.formatter -> string -> term -> unit method pp_intro : step:step -> clause:string -> ?dot:string -> pred printer method pp_condition : step:step -> condition printer method pp_block : clause:string -> sequence printer method pp_goal : pred printer method pp_step : step printer (** Assumes an "<hv>" box is opened. *) method pp_block : clause:string -> sequence printer (** Assumes an "<hv>" box is opened and all variables are named. *) method pp_sequence : clause:string -> sequence printer (** Assumes an "<hv>" box is opened {i and} all variables are declared. (recursively used) *) method pp_sequent : sequent printer (** Print the sequent in global environment. *) method pp_esequent : env -> sequent printer (** Print the sequent in the given environment. The environment is enriched with the shared terms. *) end (* -------------------------------------------------------------------------- *) (* --- State-Aware Printers --- *) (* -------------------------------------------------------------------------- *) class state : object inherit Plang.engine inherit Pcfg.engine method clear : unit method set_sequence : Conditions.sequence -> unit method set_domain : Vars.t -> unit (** Default is sequence's domain *) method domain : Vars.t method label_at : id:int -> Pcfg.label method updates : Pcfg.label Sigs.sequence -> Sigs.update Bag.t method pp_at : Format.formatter -> Pcfg.label -> unit method pp_update : Pcfg.label -> Format.formatter -> Sigs.update -> unit method pp_value : Format.formatter -> term -> unit end class sequence : #state -> object inherit engine method set_sequence : Conditions.sequence -> unit (** Initialize state with this sequence *) method set_goal : pred -> unit (** Adds goal to state domain *) method set_sequent : sequent -> unit (** Set sequence and goal *) method get_state : bool (** If [true], states are rendered when printing sequences. *) method set_state : bool -> unit (** If set to [false], states rendering is deactivated. *) end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Plang.ml��������������������������������������������������������0000666�0000000�0000000�00000022234�13571573400�015507� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Format open Qed.Logic open Qed.Engine open Lang open Lang.F (* -------------------------------------------------------------------------- *) (* --- Variables Marker --- *) (* -------------------------------------------------------------------------- *) type pool = { mutable vars : Vars.t ; mutable mark : Tset.t ; } let pool () = { vars = Vars.empty ; mark = Tset.empty } let alloc_domain p = p.vars let rec walk p f e = if not (Tset.mem e p.mark) && not (Vars.subset (F.vars e) p.vars) then begin p.mark <- Tset.add e p.mark ; match F.repr e with | Fvar x -> p.vars <- Vars.add x p.vars ; f x | _ -> F.lc_iter (walk p f) e end let alloc_e = walk let alloc_p pool f p = walk pool f (F.e_prop p) let alloc_xs pool f xs = let ys = Vars.diff xs pool.vars in if not (Vars.is_empty ys) then begin Vars.iter f ys ; pool.vars <- Vars.union xs pool.vars ; end (* -------------------------------------------------------------------------- *) (* --- Lang Pretty Printer --- *) (* -------------------------------------------------------------------------- *) module E = Qed.Export.Make(Lang.F.QED) module Env = E.Env type scope = Qed.Engine.scope type iformat = [ `Dec | `Hex | `Bin ] type rformat = [ `Ratio | `Float | `Double ] let sanitizer = Qed.Export.sanitize ~to_lowercase:false class engine = object(self) inherit E.engine as super inherit Lang.idprinting method infoprover w = w.altergo (* --- Types --- *) method t_int = "Z" method t_real = "R" method t_bool = "bool" method t_prop = "Prop" method t_atomic _ = true method pp_tvar fmt k = if 0 <= k && k < 26 then fprintf fmt "'%c" (char_of_int (int_of_char 'a' + k)) else fprintf fmt "'%d" (k-26) method pp_array fmt t = fprintf fmt "%a[]" self#pp_subtau t method pp_farray fmt t k = fprintf fmt "@[<hov 2>%a[%a]@]" self#pp_subtau t self#pp_tau k method pp_datatype a fmt ts = Qed.Plib.pp_call_var ~f:(self#datatype a) self#pp_tau fmt ts (* --- Booleans --- *) method e_true _ = "true" method e_false _ = "false" (* --- Integers --- *) val mutable iformat : iformat = `Dec method get_iformat = iformat method set_iformat (f : iformat) = iformat <- f method pp_int _ fmt z = try let n = Integer.to_int z in if -256 <= n && n <= 256 then Format.pp_print_int fmt n else raise Z.Overflow with Z.Overflow -> match iformat with | `Dec -> Integer.pretty ~hexa:false fmt z | `Hex -> Integer.pp_hex ~sep:"," fmt z | `Bin -> Integer.pp_bin ~sep:"," fmt z (* --- Reals --- *) val mutable rformat : rformat = `Ratio method get_rformat = rformat method set_rformat (f : rformat) = rformat <- f method pp_real fmt q = match Q.classify q with | Q.ZERO -> Format.pp_print_string fmt ".0" | Q.INF -> Format.pp_print_string fmt "(1/.0)" | Q.MINF -> Format.pp_print_string fmt "(-1/.0)" | Q.UNDEF -> Format.pp_print_string fmt "(.0/.0)" | Q.NZERO -> match rformat with | `Ratio -> let { Q.num = num ; Q.den = den } = q in if Z.equal den Z.one then Format.fprintf fmt "%s.0" (Z.to_string num) else Format.fprintf fmt "(%s.0/%s)" (Z.to_string num) (Z.to_string den) | `Float -> Format.fprintf fmt "%sf" (Cfloat.float_lit Ctypes.Float32 q) | `Double -> Format.fprintf fmt "%sd" (Cfloat.float_lit Ctypes.Float64 q) (* --- Atomicity --- *) method callstyle = CallVar method is_atomic e = match F.repr e with | Kint z -> Z.leq Z.zero z | Kreal _ -> true | Apply _ -> true | Aset _ | Aget _ | Fun _ -> true | _ -> F.is_simple e (* --- Operators --- *) method op_spaced = Qed.Export.is_identifier method op_scope _ = None method op_real_of_int = Op "(R)" method op_add _ = Assoc "+" method op_sub _ = Assoc "-" method op_mul _ = Assoc "*" method op_div _ = Op "/" method op_mod _ = Op "%" method op_minus _ = Op "-" method op_equal _ = Op "=" method op_noteq _ = Op "!=" method op_eq _ _ = Op "=" method op_neq _ _ = Op "!=" method op_lt _ _ = Op "<" method op_leq _ _ = Op "<=" method op_not _ = Op "!" method op_and = function Cprop -> Assoc "/\\" | Cterm -> Assoc "&" method op_or = function Cprop -> Assoc "\\/" | Cterm -> Assoc "|" method op_equiv = function Cprop -> Op "<->" | Cterm -> Op "=" method op_imply _ = Op "->" (* --- Ternary --- *) method pp_conditional fmt cond pthen pelse = begin fprintf fmt "@[<hov 0>if %a" self#pp_atom cond ; fprintf fmt "@ then %a" self#pp_atom pthen ; fprintf fmt "@ else %a" self#pp_atom pelse ; fprintf fmt "@]" ; end (* --- Arrays --- *) method pp_array_cst fmt (_ : F.tau) v = Format.fprintf fmt "@[<hov 2>[%a..]@]" self#pp_flow v method pp_array_get fmt a k = Format.fprintf fmt "@[<hov 2>%a@,[%a]@]" self#pp_atom a self#pp_flow k method pp_array_set fmt a k v = Format.fprintf fmt "@[<hov 2>%a@,[%a@ <- %a]@]" self#pp_atom a self#pp_atom k self#pp_flow v (* --- Records --- *) method pp_get_field fmt a fd = Format.fprintf fmt "%a.%s" self#pp_atom a (self#field fd) method pp_def_fields fmt fvs = let base,fvs = match F.record_with fvs with | None -> None,fvs | Some(r,fvs) -> Some r,fvs in begin fprintf fmt "@[<hov 2>{" ; let open Qed.Plib in iteri (fun i (f,v) -> ( match i , base with | (Isingle | Ifirst) , Some r -> fprintf fmt "@ %a with" self#pp_flow r | _ -> () ) ; ( match i with | Ifirst | Imiddle -> fprintf fmt "@ @[<hov 2>%s = %a ;@]" (self#field f) self#pp_flow v | Isingle | Ilast -> fprintf fmt "@ @[<hov 2>%s = %a@]" (self#field f) self#pp_flow v ) ) fvs ; fprintf fmt "@ }@]" ; end (* --- Lists --- *) method! pp_fun cmode fct ts = if fct == Vlist.f_concat then Vlist.pretty self ts else if fct == Vlist.f_elt then Vlist.elements self ts else if fct == Vlist.f_repeat then Vlist.pprepeat self ts else super#pp_fun cmode fct ts (* --- Higher Order --- *) method pp_apply (_:cmode) (_:term) (_:formatter) (_:term list) = failwith "Qed: higher-order application" method pp_lambda (_:formatter) (_: (string * tau) list) = failwith "Qed: lambda abstraction" (* --- Binders --- *) method! shareable e = super#shareable e && Vlist.shareable e method pp_forall tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>forall %a" self#pp_var x ; List.iter (fun x -> fprintf fmt ",@,%a" self#pp_var x) xs ; fprintf fmt "@ : %a.@]" self#pp_tau tau ; method pp_exists tau fmt = function | [] -> () | x::xs -> fprintf fmt "@[<hov 2>exists %a" self#pp_var x ; List.iter (fun x -> fprintf fmt ",@,%a" self#pp_var x) xs ; fprintf fmt "@ : %a.@]" self#pp_tau tau ; method pp_let fmt _ x e = fprintf fmt "@[<hov 4>let %s = %a in@]@ " x self#pp_flow e (* --- Predicates --- *) method pp_pred fmt p = self#pp_prop fmt (F.e_prop p) end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Plang.mli�������������������������������������������������������0000666�0000000�0000000�00000005143�13571573400�015660� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Lang.F (** Lang Pretty-Printer *) type scope = Qed.Engine.scope module Env : Qed.Engine.Env with type term := term type pool val pool : unit -> pool val alloc_e : pool -> (var -> unit) -> term -> unit val alloc_p : pool -> (var -> unit) -> pred -> unit val alloc_xs : pool -> (var -> unit) -> Vars.t -> unit val alloc_domain : pool -> Vars.t val sanitizer : string -> string type iformat = [ `Hex | `Dec | `Bin ] type rformat = [ `Ratio | `Float | `Double ] class engine : object inherit [Z.t,ADT.t,Field.t,Fun.t,tau,var,term,Env.t] Qed.Engine.engine method get_iformat : iformat method set_iformat : iformat -> unit method get_rformat : rformat method set_rformat : rformat -> unit method marks : Env.t * Lang.F.marks method pp_pred : Format.formatter -> pred -> unit method lookup : term -> scope (**/**) inherit Lang.idprinting method sanitize : string -> string method infoprover : 'a. 'a Lang.infoprover -> 'a method op_spaced : string -> bool (**/**) end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProofEngine.ml��������������������������������������������������0000666�0000000�0000000�00000033542�13571573400�016665� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Interactive Proof Engine --- *) (* -------------------------------------------------------------------------- *) type node = { tree : Wpo.t ; (* root, to check consistency *) goal : Wpo.t ; (* only GoalAnnot of a sequent *) parent : node option ; mutable script : script ; mutable search_index : int ; mutable search_space : Strategy.t array ; (* sorted by priority *) } and script = | Opened | Script of ProofScript.jscript (* to replay *) | Tactic of ProofScript.jtactic * (string * node) list (* played *) type tree = { main : Wpo.t ; (* Main goal to be proved. *) mutable pool : Lang.F.pool option ; (* Global pool variable *) mutable saved : bool ; (* Saved on Disk. *) mutable gid : int ; (* WPO goal numbering *) mutable head : node option ; (* the current node *) mutable root : node option ; (* the root node *) } module PROOFS = WpContext.StaticGenerator(Wpo.S) (struct type key = Wpo.S.t type data = tree let name = "Wp.ProofEngine.Proofs" let compile main = ignore (Wpo.resolve main) ; { main ; gid = 0 ; pool = None ; head = None ; root = None ; saved = false ; } end) let () = Wpo.on_remove PROOFS.remove let get wpo = try let proof = PROOFS.get wpo in match proof.root with | None | Some { script = Opened | Script _ } -> raise Not_found | Some { script = Tactic _ } -> if proof.saved then `Saved else `Proof with Not_found -> if ProofSession.exists wpo then `Script else `None let iter_all f ns = List.iter (fun (_,n) -> f n) ns let map_all f ns = List.map (fun (k,n) -> k,f n) ns let pool tree = match tree.pool with | Some pool -> pool | None -> let _,sequent = Wpo.compute tree.main in let pool = Lang.new_pool ~vars:(Conditions.vars_seq sequent) () in tree.pool <- Some pool ; pool (* -------------------------------------------------------------------------- *) (* --- Constructors --- *) (* -------------------------------------------------------------------------- *) let proof ~main = assert (not (Wpo.is_tactic main)) ; PROOFS.get main let rec reset_node n = Wpo.clear_results n.goal ; if Wpo.is_tactic n.goal then Wpo.remove n.goal ; match n.script with | Opened | Script _ -> () | Tactic(_,children) -> iter_all reset_node children let reset_root = function None -> () | Some n -> reset_node n let reset t = begin Wpo.clear_results t.main ; reset_root t.root ; t.gid <- 0 ; t.head <- None ; t.root <- None ; t.saved <- false ; end let remove w = if PROOFS.mem w then reset (PROOFS.get w) let saved t = t.saved let set_saved t s = t.saved <- s (* -------------------------------------------------------------------------- *) (* --- Walking --- *) (* -------------------------------------------------------------------------- *) let rec walk f node = if not (Wpo.is_proved node.goal) then match node.script with | Tactic (_,children) -> iter_all (walk f) children | Opened | Script _ -> f node let rec witer f node = let proved = Wpo.is_proved node.goal in if proved then f ~proved node else match node.script with | Tactic (_,children) -> iter_all (witer f) children | Opened | Script _ -> f ~proved node let iteri f tree = match tree.root with | None -> () | Some r -> let k = ref 0 in walk (fun node -> f !k node ; incr k) r (* -------------------------------------------------------------------------- *) (* --- Consolidating --- *) (* -------------------------------------------------------------------------- *) let proved n = Wpo.is_proved n.goal let pending n = let k = ref 0 in walk (fun _ -> incr k) n ; !k let has_pending n = try walk (fun _ -> raise Exit) n ; false with Exit -> true let consolidate root = let result = ref VCS.valid in witer (fun ~proved:_ node -> let rs = List.map snd (Wpo.get_results node.goal) in result := VCS.merge !result (VCS.best rs) ; ) root ; !result let validate ?(incomplete=false) tree = match tree.root with | None -> () | Some root -> if not (Wpo.is_proved tree.main) then if incomplete then let result = consolidate root in Wpo.set_result tree.main VCS.Tactical result else if not (has_pending root) then Wpo.set_result tree.main VCS.Tactical VCS.valid (* -------------------------------------------------------------------------- *) (* --- Accessors --- *) (* -------------------------------------------------------------------------- *) let main t = t.main let head t = match t.head with | None -> t.main | Some n -> n.goal let goal n = n.goal let tree_context t = Wpo.get_context t.main let node_context n = Wpo.get_context n.goal let parent n = n.parent let title n = n.goal.Wpo.po_name let tactical n = match n.script with | Tactic(tactic,_) -> Some tactic | Opened | Script _ -> None let get_strategies n = n.search_index , n.search_space let set_strategies n ?(index=0) hs = n.search_index <- index ; n.search_space <- hs let children n = match n.script with | Tactic(_,children) -> children | Opened | Script _ -> [] (* -------------------------------------------------------------------------- *) (* --- State & Status --- *) (* -------------------------------------------------------------------------- *) type status = [ `Main | `Proved | `Pending of int ] type state = [ `Opened | `Proved | `Pending of int | `Script of int ] let status t : status = match t.root with | None -> if Wpo.is_proved t.main then `Proved else `Main | Some root -> `Pending (pending root) let opened n = not (Wpo.is_proved n.goal) let state n = if Wpo.is_proved n.goal then `Proved else match n.script with | Opened -> `Opened | Script s -> begin match List.partition ProofScript.is_prover s with | [] , s -> `Script (ProofScript.status s) | p , [] -> `Pending (ProofScript.status p) | provers , scripts -> let np = ProofScript.status provers in let ns = ProofScript.status scripts in `Script( min ns np ) end | Tactic _ -> `Pending (pending n) (* -------------------------------------------------------------------------- *) (* --- Navigation --- *) (* -------------------------------------------------------------------------- *) type current = [ `Main | `Internal of node | `Leaf of int * node ] let current t : current = match t.head with | Some h -> let p = ref (`Internal h) in iteri (fun i n -> if n == h then p := `Leaf(i,n)) t ; !p | None -> `Main type position = [ `Main | `Node of node | `Leaf of int ] let goto t = function | `Main -> t.head <- t.root | `Node n -> if n.tree == t.main then t.head <- Some n | `Leaf k -> t.head <- t.root ; iteri (fun i n -> if i = k then t.head <- Some n) t let fetch t node = try t.head <- t.root ; walk (fun n -> t.head <- Some n ; raise Exit) node ; false with Exit -> true let rec forward t = match t.head with | None -> t.head <- t.root | Some hd -> if not (fetch t hd) then begin t.head <- hd.parent ; forward t ; end let cancel t = match t.head with | None -> () | Some node -> begin Wpo.clear_results node.goal ; match node.script with | Opened -> t.head <- node.parent ; if t.head = None then t.root <- None ; | Tactic _ | Script _ -> (*TODO: save the current script *) node.script <- Opened ; end (* -------------------------------------------------------------------------- *) (* --- Sub-Goal --- *) (* -------------------------------------------------------------------------- *) let mk_annot axioms goal vc = let open Wpo.VC_Annot in match vc with | Wpo.GoalAnnot annot -> { annot with goal ; axioms } | _ -> { axioms ; goal ; tags = [] ; warn = [] ; deps = Property.Set.empty ; path = Cil_datatype.Stmt.Set.empty ; effect = None ; } let mk_formula ~main axioms sequent = Wpo.(GoalAnnot (mk_annot axioms (GOAL.make sequent) main)) let mk_goal t ~title ~part ~axioms sequent = let id = t.gid in t.gid <- succ id ; let gid = Printf.sprintf "%s-%d" t.main.Wpo.po_gid id in let sid = Printf.sprintf "%s-%d" t.main.Wpo.po_sid id in Wpo.({ po_gid = gid ; po_leg = "" ; (* no use for legacy name *) po_sid = sid ; po_name = Printf.sprintf "%s (%s)" title part ; po_idx = t.main.po_idx ; po_pid = WpPropId.tactical ~gid ; po_model = t.main.po_model ; po_formula = mk_formula ~main:t.main.po_formula axioms sequent ; }) let mk_tree_node ~tree ~anchor goal = { tree = tree.main ; goal ; parent = Some anchor ; script = Opened ; search_index = 0 ; search_space = [| |] ; } let mk_root_node goal = { tree = goal ; goal ; parent = None ; script = Opened ; search_index = 0 ; search_space = [| |] ; } let mk_root ~tree = let goal = tree.main in let node = mk_root_node goal in let root = Some node in tree.root <- root ; tree.head <- root ; node (* -------------------------------------------------------------------------- *) (* --- Forking --- *) (* -------------------------------------------------------------------------- *) module Fork = struct type t = { tree : tree ; anchor : node ; tactic : ProofScript.jtactic ; goals : (string * Wpo.t) list ; } let create tree ~anchor tactic process = let axioms , sequent = Wpo.compute anchor.goal in let vars = Conditions.vars_seq sequent in let dseqs = Lang.local ~vars process sequent in let title = tactic.ProofScript.header in let goals = List.map (fun (part,s) -> part , mk_goal tree ~title ~part ~axioms s) dseqs in { tree ; tactic ; anchor ; goals } let iter f w = iter_all f w.goals let header frk = frk.tactic.ProofScript.header end let pretty fmt frk = Format.pp_print_string fmt (Fork.header frk) type fork = Fork.t let fork = Fork.create let iter = Fork.iter let anchor tree ?node () = match node with | Some n -> n | None -> match tree.head with | Some n -> n | None -> match tree.root with | Some n -> n | None -> mk_root tree let commit fork = List.iter (fun (_,wp) -> ignore (Wpo.resolve wp)) fork.Fork.goals ; let tree = fork.Fork.tree in let anchor = fork.Fork.anchor in let children = map_all (mk_tree_node ~tree ~anchor) fork.Fork.goals in tree.saved <- false ; anchor.script <- Tactic( fork.Fork.tactic , children ) ; anchor , children (* -------------------------------------------------------------------------- *) (* --- Scripting --- *) (* -------------------------------------------------------------------------- *) let results wpo = List.map (fun (p,r) -> ProofScript.a_prover p r) (Wpo.get_results wpo) let rec script_node (node : node) = let provers = results node.goal in let scripts = match node.script with | Script s -> List.filter ProofScript.is_tactic s | Tactic( tactic , children ) -> [ ProofScript.a_tactic tactic (List.map subscript_node children) ] | Opened -> [] in provers @ scripts and subscript_node (key,node) = key , script_node node let script tree = match tree.root with | None -> results tree.main | Some node -> script_node node let bind node script = match node.script with | Tactic _ -> (*TODO: saveback the thrown script *) () | Opened | Script _ -> (*TODO: saveback the previous script *) node.script <- Script script let bound node = match node.script with | Tactic _ | Opened -> [] | Script s -> s (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProofEngine.mli�������������������������������������������������0000666�0000000�0000000�00000007006�13571573400�017032� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Interactive Proof Engine *) (* -------------------------------------------------------------------------- *) type tree (** A proof tree *) type node (** A proof node *) val get : Wpo.t -> [ `Script | `Proof | `Saved | `None ] val proof : main:Wpo.t -> tree val reset : tree -> unit val remove : Wpo.t -> unit val validate : ?incomplete:bool -> tree -> unit (** Leaves are numbered from 0 to n-1 *) type status = [ `Main | `Proved | `Pending of int ] type state = [ `Opened | `Proved | `Pending of int | `Script of int ] type current = [ `Main | `Internal of node | `Leaf of int * node ] type position = [ `Main | `Node of node | `Leaf of int ] val pool : tree -> Lang.F.pool val saved : tree -> bool val set_saved : tree -> bool -> unit val status : tree -> status val current : tree -> current val goto : tree -> position -> unit val main : tree -> Wpo.t val head : tree -> Wpo.t val goal : node -> Wpo.t val tree_context : tree -> WpContext.t val node_context : node -> WpContext.t val opened : node -> bool (** not proved *) val proved : node -> bool (** not opened *) val title : node -> string val state : node -> state val parent : node -> node option val pending : node -> int val children : node -> (string * node) list val tactical : node -> ProofScript.jtactic option val get_strategies : node -> int * Strategy.t array (* current index *) val set_strategies : node -> ?index:int -> Strategy.t array -> unit val forward : tree -> unit val cancel : tree -> unit type fork val anchor : tree -> ?node:node -> unit -> node val fork : tree -> anchor:node -> ProofScript.jtactic -> Tactical.process -> fork val iter : (Wpo.t -> unit) -> fork -> unit val commit : fork -> node * (string * node) list val pretty : Format.formatter -> fork -> unit val script : tree -> ProofScript.jscript val bind : node -> ProofScript.jscript -> unit val bound : node -> ProofScript.jscript ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProofScript.ml��������������������������������������������������0000666�0000000�0000000�00000037707�13571573400�016733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Tactical open Conditions (* -------------------------------------------------------------------------- *) (* --- Step Look Around --- *) (* -------------------------------------------------------------------------- *) let around f k n = match f k with | Some s -> s | None -> let rec scan f k i n = match f (k-i) with | Some s -> s | None -> match f (k+i) with | Some s -> s | None -> let j = succ i in if k+j < n || j <= k then scan f k j n else raise Not_found in scan f k 1 n let s_kind s = match s.condition with | Have _ | When _ | Core _ -> "have" | Type _ -> "type" | Init _ -> "init" | Branch _ -> "branch" | Either _ -> "either" | State _ -> "state" let check_pattern ~pattern p = if not (Footprint.matches pattern (Lang.F.e_prop p)) then raise Not_found let lookup_occur ~occur p = Footprint.lookup ~occur ~inside:(Lang.F.e_prop p) let lookup_step ~kind ~pattern hs k = try let s = Conditions.step_at hs k in if s_kind s <> kind then raise Not_found ; let p = Conditions.head s in check_pattern ~pattern p ; Some s with Not_found -> None let lookup_inside ~kind ~occur hs k = try let s = Conditions.step_at hs k in if s_kind s <> kind then raise Not_found ; let p = Conditions.head s in Some (s , lookup_occur ~occur p) with Not_found -> None let locate_step ~at ~kind ~pattern hs = around (lookup_step ~kind ~pattern hs) at (Conditions.size hs) let locate_inside ~at ~kind ~occur hs = around (lookup_inside ~kind ~occur hs) at (Conditions.size hs) (* -------------------------------------------------------------------------- *) (* --- Selection of Json --- *) (* -------------------------------------------------------------------------- *) let pattern p = Footprint.pattern (Lang.F.e_prop p) let occur p t = Footprint.locate ~inside:(Lang.F.e_prop p) ~select:t let j_select s = "select" , `String s let j_goal = j_select "clause-goal" let j_step = j_select "clause-step" let j_ingoal = j_select "inside-goal" let j_instep = j_select "inside-step" let j_compose = j_select "compose" let j_kint = j_select "kint" let j_range = j_select "range" let j_id a = "id" , `String a let j_at s = "at" , `Int s.id let j_int z = "val" , `String (Integer.to_string z) let j_min a = "min" , `Int a let j_max b = "max" , `Int b let j_kind s = "kind" , `String (s_kind s) let j_pattern p = "pattern" , `String p let j_ppattern p = j_pattern (pattern p) let j_occur k = "occur" , `Int k let j_pred p = let tgt = Pretty_utils.to_string Lang.F.pp_pred p in "target" , `String tgt let j_term e = let tgt = Pretty_utils.to_string Lang.F.pp_term e in "target" , `String tgt let rec json_of_selection = function | Empty -> `Null | Compose code -> json_of_compose code | Clause (Goal p) -> `Assoc[ j_goal ; j_pred p ; j_ppattern p ] | Clause (Step s) -> let p = Conditions.head s in `Assoc[ j_step ; j_at s ; j_kind s ; j_pred p ; j_ppattern p ] | Inside(Goal p,e) -> let n,m = occur p e in `Assoc [ j_ingoal ; j_occur n ; j_term e ; j_pattern m ] | Inside(Step s,e) -> let n,m = occur (Conditions.head s) e in `Assoc [ j_instep ; j_at s ; j_kind s ; j_occur n ; j_term e ; j_pattern m ] and j_args = function | [] -> [] | es -> ["args" , `List (List.map json_of_selection es)] and json_of_compose = function | Cint a -> `Assoc [j_kint ; j_int a] | Range(a,b) -> `Assoc [j_range ; j_min a ; j_max b] | Code(_,id,es) -> `Assoc (j_compose :: j_id id :: j_args es) (* -------------------------------------------------------------------------- *) (* --- Json to Selection --- *) (* -------------------------------------------------------------------------- *) let (>?) js (fd:string) = Json.field fd js let (|>) js op = op js let j_pattern js = js >? "pattern" |> Json.string let j_at js = js >? "at" |> Json.int let j_kind js = js >? "kind" |> Json.string let j_occur js = js >? "occur" |> Json.int let j_id js = js >? "id" |> Json.string let j_args js = js >? "args" |> Json.list let j_val js = js >? "val" |> Json.string |> Integer.of_string let j_min js = js >? "min" |> Json.int let j_max js = js >? "max" |> Json.int let rec selection_of_json ((hs,g) as s : sequent) js = try let key = js >? "select" |> Json.string in match key with | "clause-goal" -> check_pattern ~pattern:(j_pattern js) g ; Clause (Goal g) | "clause-step" -> let pattern = j_pattern js in let s = locate_step ~at:(j_at js) ~kind:(j_kind js) ~pattern hs in Clause (Step s) | "inside-goal" -> let occur = j_occur js , j_pattern js in Inside(Goal g , lookup_occur ~occur g ) | "inside-step" -> let occur = j_occur js , j_pattern js in let s,e = locate_inside ~at:(j_at js) ~kind:(j_kind js) ~occur hs in Inside(Step s,e) | "compose" -> let id = j_id js in let args = j_args js in Tactical.compose id (List.map (selection_of_json s) args) | "kint" -> Tactical.cint (j_val js) | "range" -> Tactical.range (j_min js) (j_max js) | _ -> raise Not_found with Not_found | Invalid_argument _ -> Empty let selection_target js = js >? "target" |> Json.string let json_of_named = function | None -> `Null | Some a -> `Assoc Tactical.[ "id" , `String a.vid ; "title" , `String a.title ; "descr" , `String a.descr ; ] let named_of_json find js = try let vid = js >? "id" |> Json.string in let title = js >? "title" |> Json.string in let descr = js >? "descr" |> Json.string in let value = find vid in Some Tactical.{ vid ; title ; descr ; value } with Not_found | Invalid_argument _ -> None (* -------------------------------------------------------------------------- *) (* --- Tactical Json Parameters --- *) (* -------------------------------------------------------------------------- *) let json_of_param (tac : tactical) = function | Checkbox fd -> ident fd , Json.of_bool (tac#get_field fd) | Spinner(fd,_) -> ident fd , Json.of_int (tac#get_field fd) | Composer(fd,_) -> ident fd , json_of_selection (tac#get_field fd) | Selector(fd,options,equal) -> ident fd , `String begin try let a = tac#get_field fd in let v = List.find (fun v -> equal v.value a) options in v.vid with _ -> "default" end | Search(fd,_,_) -> ident fd , json_of_named (tac#get_field fd) let param_of_json (tac : tactical) seq js = function | Checkbox fd -> tac#set_field fd (try Json.bool (Json.field (ident fd) js) with _ -> default fd) | Spinner(fd,_) -> tac#set_field fd (try Json.int (Json.field (ident fd) js) with _ -> default fd) | Composer(fd,_) -> let sel = (try selection_of_json seq (Json.field (ident fd) js) with _ -> default fd) in tac#set_field fd sel | Selector(fd,options,_) -> tac#set_field fd begin try let jid = Json.string (Json.field (ident fd) js) in let v = List.find (fun v -> v.vid = jid) options in v.value with _ -> default fd end | Search(fd,_,find) -> tac#set_field fd begin try named_of_json find (Json.field (ident fd) js) with _ -> None end let json_of_parameters (tac : tactical) = `Assoc (List.map (json_of_param tac) tac#params) let parameters_of_json (tac : tactical) sequent js = List.iter (param_of_json tac sequent js) tac#params (* -------------------------------------------------------------------------- *) (* --- Tactic Encoding --- *) (* -------------------------------------------------------------------------- *) type jtactic = { header : string ; tactic : string ; params : Json.t ; select : Json.t ; } let jtactic ~title (tac : tactical) (sel : selection) = { header = title ; tactic = tac#id ; params = json_of_parameters tac ; select = json_of_selection sel ; } let json_of_tactic t js = `Assoc [ "header" , `String t.header ; "tactic" , `String t.tactic ; "params" , t.params ; "select" , t.select ; "children" , `Assoc js ; ] let children_of_json = function | `List js -> Wp_parameters.warning ~current:false ~once:true "Deprecated script(s) found ; consider using prover 'tip'" ; List.map (fun j -> "",j) js | `Assoc fs -> fs | _ -> [] let tactic_of_json js = try let header = js >? "header" |> Json.string in let tactic = js >? "tactic" |> Json.string in let params = try js >? "params" with Not_found -> `Null in let select = try js >? "select" with Not_found -> `Null in let children = try js >? "children" |> children_of_json with Not_found -> [] in Some( { header ; tactic ; params ; select } , children ) with _ -> None (* -------------------------------------------------------------------------- *) (* --- Prover Encoding --- *) (* -------------------------------------------------------------------------- *) let json_of_verdict = function | VCS.NoResult | VCS.Checked | VCS.Computing _ -> `String "none" | VCS.Valid -> `String "valid" | VCS.Unknown -> `String "unknown" | VCS.Timeout -> `String "timeout" | VCS.Stepout -> `String "stepout" | VCS.Invalid -> `String "invalid" | VCS.Failed -> `String "failed" let verdict_of_json = function | `String "valid" -> VCS.Valid | `String "unknown" -> VCS.Unknown | `String "timeout" -> VCS.Timeout | `String "stepout" -> VCS.Stepout | `String "invalid" -> VCS.Invalid | `String "failed" -> VCS.Failed | _ -> VCS.NoResult let json_of_result (p : VCS.prover) (r : VCS.result) = let open VCS in let name = "prover" , `String (VCS.name_of_prover p) in let verdict = "verdict" , json_of_verdict r.verdict in let time = if r.prover_time > 0.0 then [ "time" , `Float r.prover_time ] else [] in let steps = if r.prover_steps > 0 then [ "steps" , `Int r.prover_steps ] else [] in `Assoc (name :: verdict :: (time @ steps)) let prover_of_json js = try VCS.prover_of_name (js >? "prover" |> Json.string) with Not_found -> None let result_of_json js = let verdict = try js >? "verdict" |> verdict_of_json with _ -> VCS.NoResult in let time = try js >? "time" |> Json.float with _ -> 0.0 in let steps = try js >? "steps" |> Json.int with _ -> 0 in VCS.result ~time ~steps verdict (* -------------------------------------------------------------------------- *) (* --- Script --- *) (* -------------------------------------------------------------------------- *) type jscript = alternative list and alternative = | Prover of VCS.prover * VCS.result | Tactic of int * jtactic * (string * jscript) list (* pending goals *) | Error of string * Json.t let is_prover = function Prover _ -> true | Tactic _ | Error _ -> false let is_tactic = function Tactic _ -> true | Prover _ | Error _ -> false let pending = function | Prover(_, r) -> if VCS.is_valid r then 0 else 1 | Tactic(n,_,_) -> n | Error _ -> 1 let rec status = function | [] -> 1 | [a] -> pending a | a::s -> let n = pending a in if n = 0 then 0 else min n (status s) let rec subgoals n = function | [] -> n | (_,a)::s -> subgoals (n + status a) s let a_prover p r = Prover(p,r) let a_tactic tac children = Tactic(subgoals 0 children,tac,children) (* -------------------------------------------------------------------------- *) (* --- Codecs --- *) (* -------------------------------------------------------------------------- *) let rec decode = function | `Null -> [] | `List alts -> List.map alternative alts | js -> [Error("Invalid Script",js)] and subscript (key,js) = key , decode js and alternative js = match prover_of_json js with | Some prover -> Prover(prover,result_of_json js) | None -> match tactic_of_json js with | Some(tactic, children) -> a_tactic tactic (List.map subscript children) | None -> Error("Invalid Tactic",js) let rec encode script = `List (alternatives script) and subgoal (k,alt) = k , encode alt and alternatives = function | [] -> [] | Prover(p,r) :: scr -> json_of_result p r :: alternatives scr | Tactic(_,t,s) :: scr -> json_of_tactic t (List.map subgoal s) :: alternatives scr | Error _ :: scr -> alternatives scr let configure jtactic sequent = try let tactical = Tactical.lookup ~id:jtactic.tactic in tactical#reset ; parameters_of_json tactical sequent jtactic.params ; Conditions.index sequent ; let select = selection_of_json sequent jtactic.select in Some(tactical,select) with Not_found -> None (* -------------------------------------------------------------------------- *) (* --- Console --- *) (* -------------------------------------------------------------------------- *) class console ~pool ~title = object val mutable the_title = title method pool : Lang.F.pool = pool method interactive = false method get_title = the_title method set_title : 'a. 'a formatter = fun msg -> Pretty_utils.ksfprintf (fun s -> the_title <- s) msg method set_descr : 'a. 'a formatter = fun msg -> Pretty_utils.ksfprintf (fun s -> ignore s) msg method update_field : 'a. ?enabled:bool -> ?title:string -> ?tooltip:string -> ?range:bool -> ?vmin:int -> ?vmax:int -> ?filter:(Lang.F.term -> bool) -> 'a field -> unit = fun ?enabled ?title ?tooltip ?range ?vmin ?vmax ?filter field -> ignore enabled ; ignore title ; ignore tooltip ; ignore field ; ignore vmin ; ignore vmax ; ignore range ; ignore filter ; () val mutable errors = false method has_error = errors method set_error : 'a. 'a formatter = fun msg -> Pretty_utils.ksfprintf (fun s -> errors <- true ; Wp_parameters.error "[%s] %s" title s) msg end (* -------------------------------------------------------------------------- *) ���������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProofScript.mli�������������������������������������������������0000666�0000000�0000000�00000006116�13571573400�017072� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Tactical open Conditions class console : pool:Lang.F.pool -> title:string -> Tactical.feedback type jscript = alternative list and alternative = private | Prover of VCS.prover * VCS.result | Tactic of int * jtactic * (string * jscript) list (** With number of pending goals *) | Error of string * Json.t and jtactic = { header : string ; tactic : string ; params : Json.t ; select : Json.t ; } val is_prover : alternative -> bool val is_tactic : alternative -> bool val a_prover : VCS.prover -> VCS.result -> alternative val a_tactic : jtactic -> (string * jscript) list -> alternative val pending : alternative -> int (** pending goals *) val status : jscript -> int (** minimum of pending goals *) val decode : Json.t -> jscript val encode : jscript -> Json.t val jtactic : title:string -> tactical -> selection -> jtactic val configure : jtactic -> sequent -> (tactical * selection) option (** Json Codecs *) val json_of_selection : selection -> Json.t val selection_of_json : sequent -> Json.t -> selection val selection_target : Json.t -> string val json_of_param : tactical -> parameter -> string * Json.t val param_of_json : tactical -> sequent -> Json.t -> parameter -> unit val json_of_parameters : tactical -> Json.t val parameters_of_json : tactical -> sequent -> Json.t -> unit val json_of_tactic : jtactic -> (string * Json.t) list -> Json.t val json_of_result : VCS.prover -> VCS.result -> Json.t val prover_of_json : Json.t -> VCS.prover option val result_of_json : Json.t -> VCS.result ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProofSession.ml�������������������������������������������������0000666�0000000�0000000�00000010101�13571573400�017065� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Wpo type status = | NoScript | Script of string | Deprecated of string let files : (string,status) Hashtbl.t = Hashtbl.create 32 let filename wpo = let d = Wp_parameters.get_session_dir "script" in Printf.sprintf "%s/%s.json" d wpo.po_gid let legacies wpo = let m = WpContext.MODEL.id wpo.po_model in let d = Wp_parameters.get_session_dir m in List.map (Printf.sprintf "%s/%s.json" d) [ wpo.po_gid ; wpo.po_leg ; ] let status wpo = let f = filename wpo in try Hashtbl.find files f with Not_found -> let status = if Sys.file_exists f then Script f else try let f' = List.find Sys.file_exists (legacies wpo) in Wp_parameters.warning ~current:false "Deprecated script for '%s' (use prover tip to upgrade)" wpo.po_sid ; Deprecated f' with Not_found -> NoScript in Hashtbl.add files f status ; status let pp_file fmt s = Filepath.Normalized.(pretty fmt (of_string s)) let pp_status fmt = function | NoScript -> Format.pp_print_string fmt "no script file" | Script f -> Format.fprintf fmt "script '%a'" pp_file f | Deprecated f -> Format.fprintf fmt "script '%a' (deprecated)" pp_file f let pp_goal fmt wpo = pp_status fmt (status wpo) let exists wpo = match status wpo with NoScript -> false | Script _ | Deprecated _ -> true let load wpo = match status wpo with | NoScript -> `Null | Script f | Deprecated f -> if Sys.file_exists f then Json.load_file f else `Null let remove wpo = match status wpo with | NoScript -> () | Script f -> begin Extlib.safe_remove f ; Hashtbl.replace files f NoScript ; end | Deprecated f0 -> begin Wp_parameters.feedback "Removed deprecated script for '%s'" wpo.po_sid ; Extlib.safe_remove f0 ; Hashtbl.replace files (filename wpo) NoScript ; end let save wpo js = let empty = match js with | `Null | `List [] | `Assoc [] -> true | _ -> false in if empty then remove wpo else match status wpo with | Script f -> Json.save_file f js | NoScript -> begin let f = filename wpo in Json.save_file f js ; Hashtbl.replace files f (Script f) ; end | Deprecated f0 -> begin Wp_parameters.feedback "Upgraded script for '%s'" wpo.po_sid ; Extlib.safe_remove f0 ; let f = filename wpo in Json.save_file f js ; Hashtbl.replace files f (Script f) ; end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProofSession.mli������������������������������������������������0000666�0000000�0000000�00000003740�13571573400�017251� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type status = | NoScript | Script of string | Deprecated of string val pp_status : Format.formatter -> status -> unit val pp_goal : Format.formatter -> Wpo.t -> unit val status : Wpo.t -> status val exists : Wpo.t -> bool val save : Wpo.t -> Json.t -> unit val load : Wpo.t -> Json.t val remove : Wpo.t -> unit (**************************************************************************) ��������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverCoq.ml����������������������������������������������������0000666�0000000�0000000�00000055065�13571573400�016376� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Prover Coq Interface --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Qed open Lang open Definitions let dkey = Wp_parameters.register_category "prover" let cluster_file c = let dir = WpContext.directory () in let base = cluster_id c in Printf.sprintf "%s/%s.v" dir base (* -------------------------------------------------------------------------- *) (* --- External Coq Libraries --- *) (* -------------------------------------------------------------------------- *) (* Applies to both WP resources from the Share, and User-defined libraries *) let option_file = LogicBuiltins.create_option (fun ~driver_dir x -> driver_dir ^ "/" ^ x) "coq" "file" type coqlib = { c_id : string ; (* Identifies the very original file. *) c_source : string ; (* Original file directory. *) c_file : string ; (* Relative Coq source file. *) c_path : string ; (* Relative Coq source directory. *) c_name : string ; (* Module package. *) c_module : string ; (* Full module name. *) } (* example: { c_id="/mydir/foobar:a/b/User.v" ; c_source="/mydir/foobar" ; c_file= "a/b/User.v" ; c_path = "a/b" ; c_name = "a.b" ; c_module = "a.b.User" ; } *) (* Take the directory name and changes all '/' into '.' *) let name_of_path path = if path = "." then "" else String.map (fun c -> if c = '/' || c = '\\' then '.' else c) path let find_nonwin_column opt = let p = String.rindex opt ':' in if String.length opt >= 3 && opt.[1] = ':' && (opt.[2] = '/' || opt.[2] = '\\') && p = 1 then (* windows absolute path, not <source>:<dir>/<file.v> format. *) raise Not_found else p (* Parses the coq.file option from the driver. *) let parse_c_option opt = try (* Format "<source>:<dir>/<file.v>" *) let p = find_nonwin_column opt in let c_source = String.sub opt 0 p in let c_file = String.sub opt (p+1) (String.length opt - p - 1) in let c_path = Filename.dirname c_file in let c_name = name_of_path c_path in let coqid = Filename.chop_extension (Filename.basename c_file) in let c_module = Printf.sprintf "%s.%s" c_name (String.capitalize_ascii coqid) in { c_id = opt ; c_source ; c_file ; c_path ; c_name ; c_module } with Not_found -> (* Format "<source>/<file.v>" *) let c_source = Filename.dirname opt in let c_file = Filename.basename opt in let c_module = String.capitalize_ascii (Filename.chop_extension c_file) in { c_id = opt ; c_source ; c_file ; c_path = "." ; c_name = "" ; c_module } let coqlibs = Hashtbl.create 128 (*[LC] Not Projectified. *) let c_option opt = try Hashtbl.find coqlibs opt with Not_found -> let clib = parse_c_option opt in Hashtbl.add coqlibs opt clib ; clib (* -------------------------------------------------------------------------- *) (* --- Dependencies --- *) (* -------------------------------------------------------------------------- *) type depend = | D_cluster of cluster (* Generated in <out>/<model>/A.v *) | D_coqlib of coqlib (* From <source>/ or <out>/coqwp/ *) (* -------------------------------------------------------------------------- *) (* --- Exporting Formulae to Coq --- *) (* -------------------------------------------------------------------------- *) let engine = let module E = Qed.Export_coq.Make(Lang.F.QED) in object(self) inherit E.engine as super inherit Lang.idprinting method infoprover p = p.coq method! pp_fun cmode fct ts = if fct == Vlist.f_concat then Vlist.export self ts else super#pp_fun cmode fct ts end class visitor fmt c = object(self) inherit Definitions.visitor c inherit ProverTask.printer fmt (cluster_title c) val mutable deps : depend list = [] (* --- Managing Formatter --- *) method flush = begin Format.pp_print_newline fmt () ; List.rev deps end (* --- Files, Theories and Clusters --- *) method add_coqfile opt = let clib = c_option opt in Format.fprintf fmt "Require Import %s.@\n" clib.c_module ; deps <- (D_coqlib clib) :: deps method on_library thy = let files = LogicBuiltins.get_option option_file ~library:thy in List.iter self#add_coqfile files method on_cluster c = self#lines ; Format.fprintf fmt "Require Import %s.@\n" (cluster_id c) ; deps <- (D_cluster c) :: deps method on_type lt def = begin self#lines ; engine#declare_type fmt (Lang.atype lt) (List.length lt.lt_params) def ; end method on_comp c fts = begin self#paragraph ; engine#declare_type fmt (Lang.comp c) 0 (Qed.Engine.Trec fts) ; end method on_dlemma l = begin self#paragraph ; engine#declare_axiom fmt (Lang.lemma_id l.l_name) l.l_forall l.l_triggers (F.e_prop l.l_lemma) end method on_dfun d = begin self#paragraph ; match d.d_definition with | Logic t -> engine#declare_signature fmt d.d_lfun (List.map F.tau_of_var d.d_params) t ; | Function(t,mu,v) -> let pp = match mu with | Rec -> engine#declare_fixpoint ~prefix:"Fix" | Def -> engine#declare_definition in pp fmt d.d_lfun d.d_params t v | Predicate(mu,p) -> let pp = match mu with | Rec -> engine#declare_fixpoint ~prefix:"Fix" | Def -> engine#declare_definition in pp fmt d.d_lfun d.d_params Logic.Prop (F.e_prop p) | Inductive dl -> engine#declare_inductive fmt d.d_lfun (List.map F.tau_of_var d.d_params) Logic.Prop (List.map (fun l -> (Lang.lemma_id l.l_name, l.l_forall, l.l_triggers, (F.e_prop l.l_lemma)) ) dl) end end let write_cluster c = let f = cluster_file c in Wp_parameters.debug ~dkey "Generate '%s'" f ; let deps = Command.print_file f begin fun fmt -> let v = new visitor fmt c in v#lines ; v#printf "Require Import ZArith.@\n" ; v#printf "Require Import Reals.@\n" ; v#on_library "qed" ; v#vself ; v#flush ; end in Wp_parameters.print_generated f ; deps (* -------------------------------------------------------------------------- *) (* --- Assembling Goal --- *) (* -------------------------------------------------------------------------- *) (* Returns whether source was modified after target *) let need_recompile ~source ~target = try let t_src = (Unix.stat source).Unix.st_mtime in let t_tgt = (Unix.stat target).Unix.st_mtime in t_src >= t_tgt with Unix.Unix_error _ -> true (* Used to mark version of clusters already available *) module CLUSTERS = WpContext.Index (struct type key = cluster type data = int * depend list let name = "ProverCoq.FILES" let compare = cluster_compare let pretty = pp_cluster end) (* Used to mark coqlib versions to use *) module Marked = Set.Make (struct type t = depend let compare d1 d2 = match d1 , d2 with | D_coqlib _ , D_cluster _ -> (-1) | D_cluster _ , D_coqlib _ -> 1 | D_cluster c1 , D_cluster c2 -> Definitions.cluster_compare c1 c2 | D_coqlib c1 , D_coqlib c2 -> String.compare c1.c_id c2.c_id end) type included = string * string (* -R <path> <name>, name possibly empty, use -I instead *) type coqcc = { mutable marked : Marked.t ; mutable includes : included list ; (* (reversed) includes with as *) mutable sources : string list ; (* (reversed) file .v to recompile *) } let add_include coqcc dir = if not (List.mem dir coqcc.includes) then coqcc.includes <- dir :: coqcc.includes let add_source coqcc file = if not (List.mem file coqcc.sources) then coqcc.sources <- file :: coqcc.sources (* Recursive assembly: some file need further dependencies *) let rec assemble coqcc d = if not (Marked.mem d coqcc.marked) then begin coqcc.marked <- Marked.add d coqcc.marked ; match d with | D_cluster cluster -> assemble_cluster coqcc cluster | D_coqlib clib -> assemble_coqlib coqcc clib end and assemble_cluster coqcc c = let (age,deps) = try CLUSTERS.find c with Not_found -> (-1,[]) in let deps = if age < cluster_age c then let deps = write_cluster c in CLUSTERS.update c (cluster_age c , deps) ; deps else deps in List.iter (assemble coqcc) deps ; add_source coqcc (cluster_file c) and assemble_coqlib coqcc c = let compiled = Printf.sprintf "%s/%so" c.c_source c.c_file in if Sys.file_exists compiled then let dir = Printf.sprintf "%s/%s" c.c_source c.c_path in add_include coqcc (dir,c.c_name) else begin let tgtdir = Wp_parameters.get_output_dir "coqwp" in let source = Printf.sprintf "%s/%s" c.c_source c.c_file in let target = Printf.sprintf "%s/%s" tgtdir c.c_file in let dir = Printf.sprintf "%s/%s" tgtdir c.c_path in if need_recompile ~source ~target then begin Wp_parameters.make_output_dir dir ; Command.copy source target ; end ; add_include coqcc (dir,c.c_name) ; add_source coqcc target; end (* -------------------------------------------------------------------------- *) (* --- Assembling Goal --- *) (* -------------------------------------------------------------------------- *) let assemble_goal ~pid axioms prop = let title = Pretty_utils.to_string WpPropId.pretty pid in let model = WpContext.directory () in let id = WpPropId.get_propid pid in let file = Printf.sprintf "%s/%s.coq" model id in let goal = cluster ~id ~title () in let deps = Command.print_file file begin fun fmt -> let v = new visitor fmt goal in v#printf "Require Import ZArith.@\n" ; v#printf "Require Import Reals.@\n" ; v#on_library "qed" ; v#vgoal axioms prop ; let libs = Wp_parameters.CoqLibs.get () in if libs <> [] then begin v#section "Additional Libraries" ; List.iter v#add_coqfile libs ; v#hline ; end ; v#paragraph ; engine#global begin fun () -> v#printf "@[<hv 2>Goal@ %a.@]@." engine#pp_prop (F.e_prop prop) ; end ; v#flush end in let coqcc = { marked = Marked.empty ; includes = [] ; sources = [] } in List.iter (assemble coqcc) deps ; let includes = (model , "") :: List.rev coqcc.includes in let sources = List.rev coqcc.sources in includes , sources , file (* -------------------------------------------------------------------------- *) (* --- Running Coq --- *) (* -------------------------------------------------------------------------- *) open Task open VCS let coq_timeout () = let coqtimeout = Wp_parameters.CoqTimeout.get () in let gentimeout = Wp_parameters.Timeout.get () in max coqtimeout gentimeout let coqide_lock = Task.mutex () let emacs_regexp = Str.regexp_string_case_fold "emacs" let is_emacs cmd = try ignore (Str.search_forward emacs_regexp cmd 0) ; true with Not_found -> false class runcoq includes source = let base = Filename.chop_extension source in let logout = base ^ "_Coq.out" in let logerr = base ^ "_Coq.err" in object(self) inherit ProverTask.command "coq" method private project = let dir = Filename.dirname source in let p = Wp_parameters.CoqProject.get () in Command.pp_to_file (Printf.sprintf "%s/%s" dir p) begin fun fmt -> List.iter (fun (dir,name) -> if name = "" then Format.fprintf fmt "-R %s ''@\n" dir else Format.fprintf fmt "-R %s %s@\n" dir name ) includes ; Format.fprintf fmt "-arg@\n" ; end method private options = begin List.iter (fun (dir,name) -> if name = "" then self#add ["-R";dir;""] else self#add ["-R";dir;name] ) includes ; end method failed : 'a. 'a task = begin let name = Filename.basename source in Wp_parameters.feedback ~ontty:`Message "[Coq] '%s' compilation failed." name ; if Wp_parameters.verbose_atleast 1 then begin ProverTask.pp_file ~message:"Coqc (stdout)" ~file:logout ; ProverTask.pp_file ~message:"Coqc (stderr)" ~file:logerr ; end ; Task.failed "Compilation of '%s' failed." name ; end method compile = let cmd = Wp_parameters.CoqCompiler.get () in self#set_command cmd ; self#options ; self#add [ source ] ; self#timeout (coq_timeout ()) ; Task.call (fun () -> if not (Wp_parameters.Check.get ()) then let name = Filename.basename source in Wp_parameters.feedback ~ontty:`Transient "[Coq] Compiling '%s'." name) () >>= self#run ~logout ~logerr >>= fun r -> if r = 127 then Task.failed "Command '%s' not found" cmd else if r <> 0 then self#failed else Task.return () method check = let cmd = Wp_parameters.CoqCompiler.get () in self#set_command cmd ; self#options ; self#add [ source ] ; self#timeout (coq_timeout ()) ; self#run ~logout ~logerr () >>= function | 127 -> Task.failed "Command '%s' not found" cmd | 0 -> Task.return true | 1 -> Task.return false | _ -> self#failed method coqide = let coqide = Wp_parameters.CoqIde.get () in self#set_command coqide ; if is_emacs coqide then begin self#project ; self#add [ source ] ; end else begin self#options ; self#add [ source ] ; end ; Task.sync coqide_lock (self#run ~logout ~logerr) end (* -------------------------------------------------------------------------- *) (* --- Compilation Helpers --- *) (* -------------------------------------------------------------------------- *) let shared_demon = ref true let shared_headers : (string,unit Task.shared) Hashtbl.t = Hashtbl.create 120 let shared includes source = try Hashtbl.find shared_headers source with Not_found -> if !shared_demon then begin shared_demon := false ; let server = ProverTask.server () in Task.on_server_stop server (fun () -> Hashtbl.clear shared_headers) ; end ; let descr = Printf.sprintf "Coqc '%s'" source in let shared = Task.shared ~descr ~retry:true (fun () -> (new runcoq includes source)#compile) in Hashtbl.add shared_headers source shared ; shared let rec compile_headers includes forced = function | [] -> Task.nop | source::headers -> let target = source ^ "o" in if forced || need_recompile ~source ~target then begin let cc = shared includes source in Task.share cc >>= fun () -> compile_headers includes true headers end else compile_headers includes forced headers (* -------------------------------------------------------------------------- *) (* --- Coq Prover --- *) (* -------------------------------------------------------------------------- *) let ontty = `Feedback open Wpo type coq_wpo = { cw_pid : WpPropId.prop_id ; cw_gid : string ; cw_leg : string ; cw_goal : string ; (* filename for goal without proof *) cw_script : string ; (* filename for goal with proof script *) cw_headers : string list ; (* filename for libraries *) cw_includes : included list ; (* -R ... ... *) } let make_check w = Command.print_file w.cw_script begin fun fmt -> Command.pp_from_file fmt w.cw_goal ; Format.fprintf fmt "Proof.@\nAdmitted.@\n@." ; end let make_script w script closing = Command.print_file w.cw_script begin fun fmt -> Command.pp_from_file fmt w.cw_goal ; Format.fprintf fmt "Proof.@\n%s%s@\n@." script closing ; end let try_script w script closing = make_script w script closing ; (new runcoq w.cw_includes w.cw_script)#check let check_script w = make_check w ; (new runcoq w.cw_includes w.cw_script)#check let rec try_hints w = function | [] -> Task.return false | (kind,script,closing) :: hints -> Wp_parameters.feedback ~ontty "[Coq] Goal %s : %s" w.cw_gid kind ; try_script w script closing >>= fun succeed -> if succeed then let required,hints = WpPropId.prop_id_keys w.cw_pid in let keys = List.merge String.compare required hints in Proof.add_script_for ~gid:w.cw_gid keys script closing ; Task.return true else try_hints w hints let try_prove w = begin match Proof.script_for ~pid:w.cw_pid ~gid:w.cw_gid ~legacy:w.cw_leg with | Some (script,closing) -> Wp_parameters.feedback ~ontty "[Coq] Goal %s : Saved script" w.cw_gid ; try_script w script closing | None -> Task.return false end >>= fun succeed -> if succeed then Task.return true else try_hints w (Proof.hints_for ~pid:w.cw_pid) let try_coqide w = let script,closing = Proof.script_for_ide ~pid:w.cw_pid ~gid:w.cw_gid ~legacy:w.cw_leg in make_script w script closing ; (new runcoq w.cw_includes w.cw_script)#coqide >>= fun st -> if st = 0 then match Proof.parse_coqproof w.cw_script with | None -> Wp_parameters.feedback "[Coq] No proof found" ; Task.return false | Some(script,closing) -> if Proof.is_empty_script script then begin Proof.delete_script_for ~gid:w.cw_gid ; Task.canceled () ; end else begin let req,hs = WpPropId.prop_id_keys w.cw_pid in let hints = List.merge String.compare req hs in Proof.add_script_for ~gid:w.cw_gid hints script closing ; Wp_parameters.feedback ~ontty "[Coq] Goal %s : Script" w.cw_gid ; try_script w script closing end else if st = 127 then Task.failed "CoqIde command '%s' not found" (Wp_parameters.CoqIde.get ()) else Task.failed "CoqIde exits with status %d." st let prove_session ~mode w = begin compile_headers w.cw_includes false w.cw_headers >>= begin fun () -> match mode with | BatchMode -> try_prove w | EditMode -> try_coqide w | FixMode -> begin try_prove w >>> function | Task.Result true -> Task.return true | Task.Failed e -> Task.raised e | Task.Canceled | Task.Timeout _ | Task.Result false -> try_coqide w end end end >>= Task.call (fun r -> if r then VCS.valid else VCS.unknown) exception Admitted_not_proved let gen_session w = begin make_script w " ...\n" "Qed." ; Wp_parameters.print_generated w.cw_script ; Task.return VCS.no_result end let check_session w = compile_headers w.cw_includes false w.cw_headers >>= (fun () -> check_script w) >>> function | Task.Result true -> Task.return VCS.checked | Task.Failed e -> Task.raised e | Task.Canceled | Task.Timeout _ | Task.Result false -> Task.raised Admitted_not_proved let prove_session ~mode w = if Wp_parameters.Generate.get () then gen_session w else if Wp_parameters.Check.get () then check_session w else prove_session ~mode w let prove_prop wpo ~mode ~axioms ~prop = let pid = wpo.po_pid in let gid = wpo.po_gid in let leg = wpo.po_leg in let model = wpo.po_model in let context = Wpo.get_context wpo in let script = DISK.file_goal ~pid ~model ~prover:NativeCoq in let includes , headers , goal = WpContext.on_context context (assemble_goal ~pid axioms) prop in prove_session ~mode { cw_pid = pid ; cw_gid = gid ; cw_leg = leg ; cw_goal = goal ; cw_script = script ; cw_headers = headers ; cw_includes = includes ; } let prove_annot wpo vcq ~mode = Task.todo begin fun () -> let prop = WpContext.on_context (Wpo.get_context wpo) GOAL.compute_proof vcq.VC_Annot.goal in prove_prop wpo ~mode ~axioms:None ~prop end let prove_lemma wpo vca ~mode = Task.todo begin fun () -> let lemma = vca.VC_Lemma.lemma in let depends = vca.VC_Lemma.depends in let prop = F.p_forall lemma.l_forall lemma.l_lemma in let axioms = Some(lemma.l_cluster,depends) in prove_prop wpo ~mode ~axioms ~prop end let prove mode wpo = match wpo.Wpo.po_formula with | GoalAnnot vcq -> prove_annot wpo vcq ~mode | GoalLemma vca -> prove_lemma wpo vca ~mode ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverCoq.mli���������������������������������������������������0000666�0000000�0000000�00000003603�13571573400�016536� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Task open VCS (* -------------------------------------------------------------------------- *) (* --- Alt-Ergo Theorem Prover --- *) (* -------------------------------------------------------------------------- *) val prove : mode -> Wpo.t -> result task �����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverErgo.ml���������������������������������������������������0000666�0000000�0000000�00000042575�13571573400�016552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Prover Alt-Ergo Interface --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Qed open Lang open Definitions let dkey = Wp_parameters.register_category "prover" let dkey_cluster = Wp_parameters.register_category "cluster" let option_file = LogicBuiltins.create_option (fun ~driver_dir x -> Filename.concat driver_dir x) "altergo" "file" (* -------------------------------------------------------------------------- *) (* --- Making Goal File --- *) (* -------------------------------------------------------------------------- *) let altergo_gui = lazy begin let name = Wp_parameters.AltGrErgo.get () in let x = Command.command name [| "-version" |] in match x with | Unix.WEXITED 0 -> true | Unix.WEXITED 127 -> Wp_parameters.error ~current:false "AltGr-Ergo command '%s' not found." name; false | Unix.WEXITED r -> Wp_parameters.error ~current:false "AltGr-Ergo command '%s' exits with status [%d]" name r ; false | _ -> Wp_parameters.error ~current:false "AltGr-Ergo command '%s' does not work." name; false end let append_file out file = let lines = ref 0 in Command.read_lines file begin fun line -> output_string out line ; output_string out "\n" ; incr lines ; end ; !lines let rec locate_error files file line = match files with | [] -> ProverTask.location file line | (f,n)::files -> if line <= n then ProverTask.location f line else locate_error files file (line-n) let cluster_file c = let dir = WpContext.directory () in let base = cluster_id c in Printf.sprintf "%s/%s.ergo" dir base (* -------------------------------------------------------------------------- *) (* --- Exporting Formulae to Alt-Ergo --- *) (* -------------------------------------------------------------------------- *) type depend = | D_file of string | D_cluster of cluster [@@@warning "-32"] let pp_depend fmt = function | D_file file -> Format.fprintf fmt "File %s" file | D_cluster cluster -> Format.fprintf fmt "Cluster %a" Definitions.pp_cluster cluster [@@@warning "+32"] module TYPES = WpContext.Index (struct type key = adt type data = tau let name = "ProverErgo.TYPES" let compare = ADT.compare let pretty = ADT.pretty end) let engine = let module E = Qed.Export_altergo.Make(Lang.F.QED) in object(self) inherit E.engine as super inherit Lang.idprinting method infoprover p = p.altergo method set_typedef = TYPES.define method get_typedef = TYPES.get val mutable share = true method! shareable e = share && super#shareable e method! declare_axiom fmt a xs tgs phi = try share <- false ; super#declare_axiom fmt a xs tgs phi ; share <- true with err -> share <- true ; raise err val mutable goal = false method set_goal g = goal <- g method private is_vlist polarity a b = goal && self#mode = polarity && (Vlist.check_term a || Vlist.check_term b) method! pp_equal fmt a b = if self#is_vlist Qed.Engine.Mpositive a b then Qed.Plib.pp_call_var "vlist_eq" self#pp_term fmt [a;b] else super#pp_equal fmt a b method! pp_noteq fmt a b = if self#is_vlist Qed.Engine.Mnegative a b then begin Format.fprintf fmt "@[<hov 2>not@,(" ; Qed.Plib.pp_call_var "vlist_eq" self#pp_term fmt [a;b] ; Format.fprintf fmt ")@]" ; end else super#pp_noteq fmt a b method! pp_fun cmode fct ts = if fct == Vlist.f_concat then Vlist.export self ts else super#pp_fun cmode fct ts end class visitor fmt c = object(self) inherit Definitions.visitor c inherit ProverTask.printer fmt (cluster_title c) val mutable deps = [] (* --- Managing Formatter --- *) method flush = begin Format.pp_print_newline fmt () ; List.rev deps end (* --- Files, Theories and Clusters --- *) method add_dfile f = let df = D_file f in if not (List.mem df deps) then deps <- df :: deps method add_shared f = self#add_dfile (Wp_parameters.Share.file ~error:true f) method add_library f = self#add_dfile f method on_cluster c = deps <- (D_cluster c) :: deps method on_library thy = let iter file = self#add_library file in List.iter iter (LogicBuiltins.get_option option_file ~library:thy) method on_type lt def = begin self#lines ; engine#declare_type fmt (Lang.atype lt) (List.length lt.lt_params) def ; end method on_comp c fts = begin self#lines ; engine#declare_type fmt (Lang.comp c) 0 (Qed.Engine.Trec fts) ; end method on_dlemma l = begin self#paragraph ; engine#declare_axiom fmt (Lang.lemma_id l.l_name) l.l_forall l.l_triggers (F.e_prop l.l_lemma) end method on_dfun d = begin self#paragraph ; match d.d_definition with | Logic t -> engine#declare_signature fmt d.d_lfun (List.map F.tau_of_var d.d_params) t ; | Function(t,_,v) -> engine#declare_definition fmt d.d_lfun d.d_params t v | Predicate(_,p) -> engine#declare_definition fmt d.d_lfun d.d_params Logic.Prop (F.e_prop p) | Inductive ds -> engine#declare_signature fmt d.d_lfun (List.map F.tau_of_var d.d_params) Logic.Prop; List.iter self#on_dlemma ds end end let write_cluster c job = let f = cluster_file c in Wp_parameters.debug ~dkey "Generate '%s'" f ; let output = Command.print_file f begin fun fmt -> let v = new visitor fmt c in engine#set_goal false ; job v ; v#flush end in if Wp_parameters.has_dkey dkey_cluster then Log.print_on_output begin fun fmt -> Format.fprintf fmt "---------------------------------------------@\n" ; Format.fprintf fmt "--- File '%s/%s.ergo' @\n" (WpContext.get_context () |> WpContext.S.id) (cluster_id c) ; Format.fprintf fmt "---------------------------------------------@\n" ; Command.pp_from_file fmt f ; end ; output (* -------------------------------------------------------------------------- *) (* --- File Assembly --- *) (* -------------------------------------------------------------------------- *) module CLUSTERS = WpContext.Index (struct type key = cluster type data = int * depend list let name = "ProverErgo.CLUSTERS" let compare = cluster_compare let pretty = pp_cluster end) type export = { out : out_channel ; mutable files : (string * int) list ; } let rec assemble export = function | D_file file -> assemble_file export file | D_cluster c -> assemble_cluster export c and assemble_file export file = if List.for_all (fun (f,_) -> f <> file) export.files then let lines = append_file export.out file in export.files <- (file,lines) :: export.files and assemble_cluster export c = let (age,deps) = try CLUSTERS.find c with Not_found -> (-1,[]) in let deps = if age < cluster_age c then let deps = write_cluster c (fun v -> v#vself) in CLUSTERS.update c (cluster_age c , deps) ; deps else deps in List.iter (assemble export) deps ; let file = cluster_file c in assemble_file export file and assemble_lib export lib = assemble_file export (LogicBuiltins.find_lib lib) (* -------------------------------------------------------------------------- *) (* --- Assembling Goal --- *) (* -------------------------------------------------------------------------- *) let assemble_goal ~file ~id ~title ~axioms prop = let goal = cluster ~id ~title () in let deps = write_cluster goal begin fun v -> v#on_library "qed"; v#vgoal axioms prop ; v#paragraph ; try let qlet = List.mem "qlet" (Wp_parameters.AltErgoFlags.get ()) in engine#set_quantify_let qlet ; engine#set_goal true ; engine#global begin fun () -> v#printf "@[<hv 2>goal %s:@ %a@]@." id engine#pp_goal (F.e_prop prop) ; end ; engine#set_quantify_let false ; engine#set_goal false ; with error -> engine#set_quantify_let false ; engine#set_goal false ; raise error end in Command.write_file file begin fun out -> let export = { files = [] ; out = out } in List.iter (assemble export) deps ; let libs = Wp_parameters.AltErgoLibs.get () in List.iter (assemble_lib export) libs ; assemble_file export (cluster_file goal) ; List.rev export.files end (* -------------------------------------------------------------------------- *) (* --- Running AltErgo --- *) (* -------------------------------------------------------------------------- *) open ProverTask (*bug in Alt-Ergo: sometimes error messages are repeated. *) (*let p_loc = "^File " ... *) let p_loc = "^File " ^ p_string ^ ", line " ^ p_int ^ ", [^:]+:" let p_valid = p_loc ^ "Valid (" ^ p_float ^ ") (" ^ p_int ^ "\\( +steps\\)?)" let p_unsat = p_loc ^ "I don't know" let p_limit = "^Steps limit reached: " ^ p_int let re_error = Str.regexp p_loc let re_valid = Str.regexp p_valid let re_limit = Str.regexp p_limit let re_unsat = Str.regexp p_unsat class altergo ~config ~pid ~gui ~file ~lines ~logout ~logerr = object(ergo) initializer ignore pid inherit ProverTask.command (Wp_parameters.AltErgo.get ()) val mutable files = [] val mutable error = None val mutable valid = false val mutable limit = false val mutable unsat = false val mutable timer = 0.0 val mutable steps = 0 method private time t = timer <- t method private error (a : pattern) = let lpos = locate_error files (a#get_string 1) (a#get_int 2) in let message = a#get_after ~offset:1 2 in error <- Some ( lpos , message ) method private valid (a : pattern) = begin valid <- true ; timer <- a#get_float 3 ; steps <- a#get_int 4 ; end method private limit (a : pattern) = begin limit <- true ; steps <- pred (a#get_int 1) ; end method private unsat (_ : pattern) = begin unsat <- true ; end method result r = if r = 127 then let cmd = Wp_parameters.AltErgo.get () in VCS.kfailed "Command '%s' not found" cmd else match error with | Some(pos,message) when unsat || limit || not valid -> let source = Cil_datatype.Position.of_lexing_pos pos in Wp_parameters.error ~source "Alt-Ergo error:@\n%s" message ; VCS.failed ~pos message | _ -> try let verdict = if unsat then VCS.Unknown else if valid then VCS.Valid else if limit then VCS.Stepout else raise Not_found in VCS.result ~time:(if gui then 0.0 else timer) ~steps verdict with | Not_found when Wp_parameters.Check.get () -> if r = 0 then VCS.checked else begin if Wp_parameters.verbose_atleast 1 then begin ProverTask.pp_file ~message:"Alt-Ergo (stdout)" ~file:logout ; ProverTask.pp_file ~message:"Alt-Ergo (stderr)" ~file:logerr ; end; VCS.failed "Alt-Ergo type-checking failed." end | Not_found -> begin if Wp_parameters.verbose_atleast 1 then begin ProverTask.pp_file ~message:"Alt-Ergo (stdout)" ~file:logout ; ProverTask.pp_file ~message:"Alt-Ergo (stderr)" ~file:logerr ; end; if r = 0 then VCS.failed "Unexpected Alt-Ergo output" else VCS.kfailed "Alt-Ergo exits with status [%d]." r end method prove = files <- lines ; if gui then ergo#set_command (Wp_parameters.AltGrErgo.get ()) ; if Wp_parameters.Check.get () then ergo#add ["-type-only"] else begin ergo#add_parameter ~name:"-proof" Wp_parameters.ProofTrace.get ; ergo#add_parameter ~name:"-model" Wp_parameters.ProofTrace.get ; end ; let flags = List.filter (fun p -> p <> "qlet") (Wp_parameters.AltErgoFlags.get ()) in ergo#add flags ; ergo#add [ file ] ; if not gui then begin ergo#add_positive ~name:"-steps-bound" ~value:(VCS.get_stepout config) ; ergo#timeout (VCS.get_timeout config) ; end ; ergo#validate_time ergo#time ; ergo#validate_pattern ~logs:`ERR re_error ergo#error ; ergo#validate_pattern ~logs:`OUT re_valid ergo#valid ; ergo#validate_pattern ~logs:`OUT re_limit ergo#limit ; ergo#validate_pattern ~logs:`OUT re_unsat ergo#unsat ; ergo#run ~logout ~logerr () end open VCS open Wpo open Task let try_prove ~config ~pid ~gui ~file ~lines ~logout ~logerr = let ergo = new altergo ~config ~pid ~gui ~file ~lines ~logout ~logerr in ergo#prove >>> function | Task.Timeout t -> Task.return (VCS.timeout t) | Task.Result r -> Task.call ergo#result r | st -> Task.status (Task.map (fun _ -> assert false) st) let prove_file ~config ~pid ~mode ~file ~lines ~logout ~logerr = let gui = match mode with | EditMode -> Lazy.force altergo_gui | BatchMode | FixMode -> false in try_prove ~config ~pid ~gui ~file ~lines ~logout ~logerr >>= function | { verdict=(VCS.Unknown|VCS.Timeout|VCS.Stepout) } when mode = FixMode && Lazy.force altergo_gui -> try_prove ~config ~pid ~gui:true ~file ~lines ~logout ~logerr | r -> Task.return r let prove_prop ~config ~pid ~mode ~context ~axioms ~prop = let prover = NativeAltErgo in let model = fst context in let file = DISK.file_goal ~pid ~model ~prover in let logout = DISK.file_logout ~pid ~model ~prover in let logerr = DISK.file_logerr ~pid ~model ~prover in let id = WpPropId.get_propid pid in let title = Pretty_utils.to_string WpPropId.pretty pid in let lines = WpContext.on_context context (assemble_goal ~file ~id ~title ~axioms) prop in if Wp_parameters.has_print_generated () then WpContext.on_context context (fun () -> let goal = cluster ~id ~title () in Wp_parameters.print_generated (cluster_file goal) ) () ; if Wp_parameters.Generate.get () then Task.return VCS.no_result else prove_file ~config ~pid ~mode ~file ~lines ~logout ~logerr let prove_annot context pid vcq ~config ~mode = Task.todo begin fun () -> let axioms = vcq.VC_Annot.axioms in let prop = GOAL.compute_proof vcq.VC_Annot.goal in prove_prop ~pid ~config ~mode ~context ~axioms ~prop end let prove_lemma context pid vca ~config ~mode = Task.todo begin fun () -> let lemma = vca.Wpo.VC_Lemma.lemma in let depends = vca.Wpo.VC_Lemma.depends in let prop = F.p_forall lemma.l_forall lemma.l_lemma in let axioms = Some(lemma.l_cluster,depends) in prove_prop ~pid ~config ~mode ~context ~axioms ~prop end let prove ~config ~mode wpo = let pid = wpo.Wpo.po_pid in let context = Wpo.get_context wpo in match wpo.Wpo.po_formula with | Wpo.GoalAnnot vcq -> prove_annot context pid vcq ~config ~mode | Wpo.GoalLemma vca -> prove_lemma context pid vca ~config ~mode �����������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverErgo.mli��������������������������������������������������0000666�0000000�0000000�00000003703�13571573400�016711� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Task open VCS (* -------------------------------------------------------------------------- *) (* --- Alt-Ergo Theorem Prover --- *) (* -------------------------------------------------------------------------- *) val dkey_cluster: Wp_parameters.category val prove : config:config -> mode:mode -> Wpo.t -> result task �������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverScript.ml�������������������������������������������������0000666�0000000�0000000�00000041373�13571573400�017115� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Tactical open ProofScript (* -------------------------------------------------------------------------- *) (* --- Alternatives Ordering --- *) (* -------------------------------------------------------------------------- *) module Priority = struct open VCS let stage = function | Prover( Qed , { verdict = Valid } ) -> 0 | Prover( (NativeAltErgo | Why3 _) , { verdict = Valid } ) -> 1 | Prover( NativeCoq , { verdict = Valid } ) -> 2 | Tactic _ -> 3 | Prover _ -> 4 | Error _ -> 5 let time = function | Tactic _ | Error _ -> 0.0 | Prover( _ , r ) -> r.prover_time +. r.solver_time let compare a b = let sa = stage a in let sb = stage b in if sa = sb then Transitioning.Stdlib.compare (time a) (time b) else sa - sb let sort script = List.stable_sort compare script end (* -------------------------------------------------------------------------- *) (* --- Running Json-Tactical --- *) (* -------------------------------------------------------------------------- *) let jconfigure (console : #Tactical.feedback) jtactic goal = let _ , sequent = Wpo.compute goal in match ProofScript.configure jtactic sequent with | None -> None | Some(tactical,selection) -> console#set_title "%s" tactical#title ; let verdict = try Lang.local ~pool:console#pool (tactical#select console) selection with Not_found | Exit -> Not_applicable in begin match verdict with | Applicable process when not console#has_error -> let title = tactical#title in let script = ProofScript.jtactic ~title tactical selection in Some (script , process) | _ -> None end let jfork tree ?node jtactic = let console = new ProofScript.console ~pool:(ProofEngine.pool tree) ~title:jtactic.header in try let anchor = ProofEngine.anchor tree ?node () in let goal = ProofEngine.goal anchor in let ctxt = ProofEngine.node_context anchor in match WpContext.on_context ctxt (jconfigure console jtactic) goal with | None -> None | Some (script,process) -> Some (ProofEngine.fork tree ~anchor script process) with | Not_found -> console#set_error "Can not configure tactic" ; None | e -> console#set_error "Exception <%s>" (Printexc.to_string e) ; raise e (* -------------------------------------------------------------------------- *) (* --- Running Alternatives --- *) (* -------------------------------------------------------------------------- *) open Task module Env = struct type t = { tree : ProofEngine.tree ; valid : bool ; (* play valid provers *) failed : bool ; (* play failed provers *) provers : VCS.prover list ; progress : Wpo.t -> string -> unit ; result : Wpo.t -> VCS.prover -> VCS.result -> unit ; success : Wpo.t -> VCS.prover option -> unit ; depth : int ; width : int ; auto : Strategy.heuristic list ; mutable signaled : bool ; mutable backtrack : int ; mutable backtracking : backtracking option ; } and backtracking = { bk_node : ProofEngine.node ; bk_depth : int ; (* depth of search *) mutable bk_best : int ; (* best index, (-1) for none *) mutable bk_pending : int ; (* best pending, max_int when none *) } let tree env = env.tree let play env res = if VCS.is_valid res then env.valid else env.failed let progress env msg = env.progress (ProofEngine.main env.tree) msg let stuck env = if not env.signaled then begin ProofEngine.validate ~incomplete:true env.tree ; env.success (ProofEngine.main env.tree) None ; env.signaled <- true ; end let validate ?(finalize=false) env = ProofEngine.validate ~incomplete:true env.tree ; if not env.signaled then let wpo = ProofEngine.main env.tree in let proved = Wpo.is_proved wpo in if proved || finalize then begin env.signaled <- true ; List.iter (fun (prv,res) -> env.result wpo prv res) (Wpo.get_results wpo) ; env.success wpo (if proved then Some VCS.Tactical else None) end let goal env = function | Some n -> ProofEngine.goal n | None -> ProofEngine.main env.tree let prove env wpo ?config prover = Prover.prove wpo ?config ~mode:VCS.BatchMode ~progress:env.progress prover let pending env = match ProofEngine.status env.tree with | `Main | `Proved -> 0 | `Pending n -> n let setup_backtrack env node depth = if env.backtrack > 0 then let is_nearer = match env.backtracking with | None -> true | Some { bk_depth } -> depth < bk_depth in if is_nearer then let _,hs = ProofEngine.get_strategies node in if Array.length hs > 1 then env.backtracking <- Some { bk_node = node ; bk_best = (-1) ; bk_depth = depth ; bk_pending = pending env ; } let search env node ~depth = if env.auto <> [] && depth < env.depth && pending env < env.width then match ProverSearch.search env.tree ~anchor:node env.auto with | None -> None | Some _ as fork -> setup_backtrack env node depth ; fork else None let backtrack env = if env.backtrack <= 0 then None else match env.backtracking with | None -> None | Some point -> let n = pending env in let anchor = point.bk_node in if n < point.bk_pending then begin point.bk_best <- fst (ProofEngine.get_strategies anchor) ; point.bk_pending <- n ; end ; match ProverSearch.backtrack env.tree ~anchor ~loop:false () with | Some fork -> env.backtracking <- None ; Some (point.bk_depth,fork) | None -> (* end of backtrack *) env.backtracking <- None ; match ProverSearch.index env.tree ~anchor ~index:point.bk_best with None -> None | Some fork -> Some (point.bk_depth,fork) let provers env = env.provers let make tree ~valid ~failed ~provers ~depth ~width ~backtrack ~auto ~progress ~result ~success = { tree ; valid ; failed ; provers ; depth ; width ; backtrack ; auto ; progress ; result ; success ; backtracking = None ; signaled = false } end (* -------------------------------------------------------------------------- *) (* --- Choosing Alternatives --- *) (* -------------------------------------------------------------------------- *) let fst_order _ _ = 0 let key_order (a,_) (b,_) = String.compare a b let rec zip order nodes scripts = match nodes , scripts with | _ , [] | [] , _ -> (*TODO: saveback forgiven scripts *) () | node :: o_nodes , script :: o_scripts -> let cmp = order node script in if cmp < 0 then zip order o_nodes scripts else if cmp > 0 then zip order nodes o_scripts else (ProofEngine.bind (snd node) (snd script) ; zip order o_nodes o_scripts) let reconcile nodes scripts = match nodes , scripts with | [] , [] -> () | [_,n] , [_,s] -> ProofEngine.bind n s | _ -> if List.for_all (fun (k,_) -> k = "") scripts then zip fst_order nodes scripts else zip key_order (List.stable_sort key_order nodes) (List.stable_sort key_order scripts) let rec forall phi = function | x::xs -> phi x >>= fun ok -> if ok then forall phi xs else Task.return false | [] -> Task.return true let rec exists phi = function | x::xs -> phi x >>= fun ok -> if ok then Task.return true else exists phi xs | [] -> Task.return false let prove_node env node prv = let wpo = Env.goal env (Some node) in if not (VCS.is_verdict (Wpo.get_result wpo prv)) then Env.prove env wpo prv else Task.return false (* -------------------------------------------------------------------------- *) (* --- Auto & Seach Mode --- *) (* -------------------------------------------------------------------------- *) let rec auto env ?(depth=0) node : bool Task.task = exists (prove_node env node) (Env.provers env) >>= fun ok -> if ok then Task.return true else if depth > 0 then autosearch env ~depth node else begin autosearch env ~depth node >>= fun ok -> if ok then Task.return true else match Env.backtrack env with | Some (depth,fork) -> Env.progress env "Backtracking" ; autofork env ~depth fork | None -> Task.return false end and autosearch env ~depth node : bool Task.task = match Env.search env node ~depth with | None -> Task.return false | Some fork -> autofork env ~depth fork and autofork env ~depth fork = let _,children = ProofEngine.commit fork in let pending = Env.pending env in if pending > 0 then begin Env.progress env (Printf.sprintf "Auto %d" pending) ; let depth = succ depth in forall (auto env ~depth) (List.map snd children) end else ( Env.validate env ; Task.return true ) (* -------------------------------------------------------------------------- *) (* --- Script Crawling --- *) (* -------------------------------------------------------------------------- *) let rec crawl env on_child node = function | [] -> let node = ProofEngine.anchor (Env.tree env) ?node () in auto env node >>= fun ok -> if ok then Env.validate env else Env.stuck env ; Task.return () | Error(msg,json) :: alternative -> Wp_parameters.error "@[<hov 2>Script Error %S: %a@]@." msg Json.pp json ; crawl env on_child node alternative | Prover( prv , res ) :: alternative -> begin let task = if Env.play env res then let wpo = Env.goal env node in let config = VCS.configure res in Env.prove env wpo ~config prv else Task.return false in let continue ok = if ok then (Env.validate env ; Task.return ()) else crawl env on_child node alternative in task >>= continue end | Tactic( _ , jtactic , subscripts ) :: alternative -> begin match jfork (Env.tree env) ?node jtactic with | None -> Wp_parameters.warning "Script Error: can not apply '%s'@\n\ @[<hov 2>Params: %a@]@\n\ @[<hov 2>Select: %a@]@." jtactic.tactic Json.pp jtactic.params Json.pp jtactic.select ; crawl env on_child node alternative | Some fork -> (*TODO: saveback forgiven script *) let _,children = ProofEngine.commit fork in reconcile children subscripts ; let residual = List.filter (fun (_,node) -> not (ProofEngine.proved node)) children in if residual = [] then Env.validate env else List.iter (fun (_,n) -> on_child n) children ; Task.return () end (* -------------------------------------------------------------------------- *) (* --- Main Process --- *) (* -------------------------------------------------------------------------- *) let schedule job = Task.spawn (ProverTask.server ()) (Task.thread (Task.todo job)) let rec process env node = schedule begin fun () -> if ProofEngine.proved node then ( Env.validate env ; Task.return () ) else let script = Priority.sort (ProofEngine.bound node) in crawl env (process env) (Some node) script end let task ~valid ~failed ~provers ~depth ~width ~backtrack ~auto ~start ~progress ~result ~success wpo = begin fun () -> start wpo ; let json = ProofSession.load wpo in let script = Priority.sort (ProofScript.decode json) in let tree = ProofEngine.proof ~main:wpo in let env = Env.make tree ~valid ~failed ~provers ~depth ~width ~backtrack ~auto ~progress ~result ~success in crawl env (process env) None script >>? (fun _ -> ProofEngine.forward tree) ; end (* -------------------------------------------------------------------------- *) (* --- Main Entry Points --- *) (* -------------------------------------------------------------------------- *) type 'a process = ?valid:bool -> ?failed:bool -> ?provers:VCS.prover list -> ?depth:int -> ?width:int -> ?backtrack:int -> ?auto:Strategy.heuristic list -> ?start:(Wpo.t -> unit) -> ?progress:(Wpo.t -> string -> unit) -> ?result:(Wpo.t -> VCS.prover -> VCS.result -> unit) -> ?success:(Wpo.t -> VCS.prover option -> unit) -> Wpo.t -> 'a let skip1 _ = () let skip2 _ _ = () let skip3 _ _ _ = () let prove ?(valid = true) ?(failed = true) ?(provers = []) ?(depth = 0) ?(width = 0) ?(backtrack = 0) ?(auto = []) ?(start = skip1) ?(progress = skip2) ?(result = skip3) ?(success = skip2) wpo = Task.todo (task ~valid ~failed ~provers ~depth ~width ~backtrack ~auto ~start ~progress ~result ~success wpo) let spawn ?(valid = true) ?(failed = true) ?(provers = []) ?(depth = 0) ?(width = 0) ?(backtrack = 0) ?(auto = []) ?(start = skip1) ?(progress = skip2) ?(result = skip3) ?(success = skip2) wpo = schedule (task ~valid ~failed ~provers ~depth ~width ~backtrack ~auto ~start ~progress ~result ~success wpo) let search ?(depth = 0) ?(width = 0) ?(backtrack = 0) ?(auto = []) ?(provers = []) ?(progress = skip2) ?(result = skip3) ?(success = skip2) tree node = begin let env = Env.make tree ~valid:false ~failed:false ~provers ~depth ~width ~backtrack ~auto ~progress ~result ~success in schedule begin fun () -> autosearch env ~depth:0 node >>= fun ok -> if ok then Env.validate ~finalize:true env else Env.stuck env ; Task.return () end end (* -------------------------------------------------------------------------- *) (* --- Save Session --- *) (* -------------------------------------------------------------------------- *) let proofs = Hashtbl.create 32 let has_proof wpo = let wid = wpo.Wpo.po_gid in try Hashtbl.find proofs wid with Not_found -> if ProofSession.exists wpo then let ok = try let script = ProofScript.decode (ProofSession.load wpo) in ProofScript.status script = 0 with _ -> false in (Hashtbl.add proofs wid ok ; ok) else false let save wpo = let script = ProofEngine.script (ProofEngine.proof ~main:wpo) in Hashtbl.remove proofs wpo.Wpo.po_gid ; ProofSession.save wpo (ProofScript.encode script) let get wpo = match ProofEngine.get wpo with | `None -> `None | `Proof -> `Proof | `Saved -> `Saved | `Script -> if has_proof wpo then `Script else `Proof (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverScript.mli������������������������������������������������0000666�0000000�0000000�00000005315�13571573400�017262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open VCS type 'a process = ?valid:bool -> (** Play provers with valid result (default: true) *) ?failed:bool -> (** Play provers with invalid result (default: true) *) ?provers:prover list -> (** Additional list of provers to {i try} when stuck *) ?depth:int -> (** Strategy search depth (default: 0) *) ?width:int -> (** Strategy search width (default: 0) *) ?backtrack:int -> (** Strategy backtracking (default: 0) *) ?auto:Strategy.heuristic list -> (** Strategies to try (default: none) *) ?start:(Wpo.t -> unit) -> ?progress:(Wpo.t -> string -> unit) -> ?result:(Wpo.t -> prover -> result -> unit) -> ?success:(Wpo.t -> prover option -> unit) -> Wpo.t -> 'a val prove : unit Task.task process val spawn : unit process val search : ?depth:int -> ?width:int -> ?backtrack:int -> ?auto:Strategy.heuristic list -> ?provers:prover list -> ?progress:(Wpo.t -> string -> unit) -> ?result:(Wpo.t -> prover -> result -> unit) -> ?success:(Wpo.t -> prover option -> unit) -> ProofEngine.tree -> ProofEngine.node -> unit val get : Wpo.t -> [ `Script | `Proof | `Saved | `None ] val save : Wpo.t -> unit �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverSearch.ml�������������������������������������������������0000666�0000000�0000000�00000010771�13571573400�017054� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Tactical open Strategy let configure (console : #Tactical.feedback) strategy = let { tactical ; selection ; arguments } = strategy in let verdict () = try tactical#reset ; Strategy.set_args tactical arguments ; tactical#select console selection with Not_found | Exit -> Not_applicable in match Lang.local ~pool:console#pool verdict () with | Applicable process when not console#has_error -> let title = tactical#title in let script = ProofScript.jtactic ~title tactical selection in Some (script , process) | _ -> None let fork tree anchor strategy = let console = new ProofScript.console ~pool:(ProofEngine.pool tree) ~title:strategy.tactical#title in try let context = ProofEngine.node_context anchor in match WpContext.on_context context (configure console) strategy with | None -> None | Some (script,process) -> Some (ProofEngine.fork tree ~anchor script process) with | Not_found -> console#set_error "Can not configure strategy" ; None | e -> console#set_error "Exception <%s>" (Printexc.to_string e) ; raise e let rec lookup tree anchor k hs = let n = Array.length hs in if n=0 then None,0,[| |] else match fork tree anchor hs.(k) with | Some fork -> Some fork,k,hs | None -> if k = 0 then lookup tree anchor 0 (Array.sub hs 1 (n-1)) else let slice = Array.sub hs 0 (n-1) in if k < n-1 then ( Array.blit hs (succ k) slice k (n-k-1) ; lookup tree anchor k slice ) else lookup tree anchor 0 hs let index tree ~anchor ~index = if index < 0 then None else let _,hs = ProofEngine.get_strategies anchor in if index < Array.length hs then fork tree anchor hs.(index) else None let first tree ?anchor strategies = let node = ProofEngine.anchor tree ?node:anchor () in let fork,index,space = lookup tree node 0 strategies in ProofEngine.set_strategies node ~index space ; fork let search tree ?anchor ?sequent heuristics = let pool = new Strategy.pool in let anchor = ProofEngine.anchor tree ?node:anchor () in let sequent = match sequent with | Some s -> s | None -> snd (Wpo.compute (ProofEngine.goal anchor)) in let lookup h = try h#search pool#add sequent with Not_found -> () in WpContext.on_context (ProofEngine.node_context anchor) (List.iter lookup) heuristics ; first tree ~anchor pool#sort let backtrack tree ?anchor ?(loop=false) ?(width = max_int) () = let node = ProofEngine.anchor tree ?node:anchor () in let k,hs = ProofEngine.get_strategies node in let n = Array.length hs in if 1<n && (loop || succ k < (min n width)) then let k = if succ k < n then succ k else 0 in let fork,index,hs = lookup tree node k hs in ProofEngine.set_strategies node ~index hs ; fork else None (* -------------------------------------------------------------------------- *) �������frama-c-20.0-Calcium/src/plugins/wp/ProverSearch.mli������������������������������������������������0000666�0000000�0000000�00000004371�13571573400�017224� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Proof Search Engine --- *) (* -------------------------------------------------------------------------- *) open ProofEngine open Conditions val first : tree -> ?anchor:node -> Strategy.t array -> fork option val index : tree -> anchor:node -> index:int -> fork option val search : tree -> ?anchor:node -> ?sequent:sequent -> Strategy.heuristic list -> fork option val backtrack : tree -> ?anchor:node -> ?loop:bool -> ?width:int -> unit -> fork option (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverTask.ml���������������������������������������������������0000666�0000000�0000000�00000027212�13571573400�016547� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Library for Running Provers --- *) (* -------------------------------------------------------------------------- *) open Task let dkey_prover = Wp_parameters.register_category "prover" (* -------------------------------------------------------------------------- *) (* --- Export Printer --- *) (* -------------------------------------------------------------------------- *) class printer fmt title = let bar = String.make 50 '-' in object(self) val mutable lastpar = true initializer begin Format.fprintf fmt "(* ----%s---- *)@\n" bar ; Format.fprintf fmt "(* --- %-50s --- *)@\n" title ; Format.fprintf fmt "(* ----%s---- *)@\n" bar ; end method paragraph = Format.pp_print_newline fmt () ; lastpar <- true method lines = if lastpar then Format.pp_print_newline fmt () ; lastpar <- false method hline = self#paragraph ; Format.fprintf fmt "(* %s *)@\n" bar method section s = self#paragraph ; Format.fprintf fmt "(* --- %-20s --- *)@\n" s method printf : 'a. ('a,Format.formatter,unit) format -> 'a = fun msg -> Format.fprintf fmt msg end (* -------------------------------------------------------------------------- *) (* --- Buffer Validation --- *) (* -------------------------------------------------------------------------- *) class type pattern = object method get_after : ?offset:int -> int -> string method get_string : int -> string method get_int : int -> int method get_float : int -> float end class group text = object method search re pos = ignore (Str.search_forward re text pos) method next = Str.match_end () method get_after ?(offset=0) k = try let n = String.length text in let p = Str.group_end k + offset + 1 in if p >= n then "" else String.sub text p (n-p) with Not_found -> "" method get_string k = try Str.matched_group k text with Not_found -> "" method get_int k = try int_of_string (Str.matched_group k text) with Not_found | Failure _ -> 0 method get_float k = try float_of_string (Str.matched_group k text) with Not_found | Failure _ -> 0.0 end let rec validate_pattern ((re,all,job) as p) group pos = group#search re pos ; job (group :> pattern) ; if all then validate_pattern p group group#next let validate_buffer buffer validers = let text = Buffer.contents buffer in let group = new group text in List.iter (fun pattern -> try validate_pattern pattern group 0 with Not_found -> () ) validers let dump_buffer buffer = function | None -> () | Some log -> let n = Buffer.length buffer in if n > 0 then Command.write_file log (fun out -> Buffer.output_buffer out buffer) else if Wp_parameters.has_out () then Extlib.safe_remove log let echo_buffer buffer = let n = Buffer.length buffer in if n > 0 then Log.print_on_output (fun fmt -> Format.pp_print_string fmt (Buffer.contents buffer) ; Format.pp_print_flush fmt () ; ) let location file line = { Lexing.pos_fname = file ; Lexing.pos_lnum = line ; Lexing.pos_bol = 0 ; Lexing.pos_cnum = 0 ; } let timeout = function | None -> Wp_parameters.Timeout.get () | Some t -> t let stepout = function | None -> Wp_parameters.Steps.get () | Some t -> t let pp_file ~message ~file = if Sys.file_exists file then Log.print_on_output begin fun fmt -> let bar = String.make 60 '-' in Format.fprintf fmt "%s@\n" bar ; Format.fprintf fmt "--- %s :@\n" message ; Format.fprintf fmt "%s@\n" bar ; Command.pp_from_file fmt file ; Format.fprintf fmt "%s@\n" bar ; end (* -------------------------------------------------------------------------- *) (* --- Prover Task --- *) (* -------------------------------------------------------------------------- *) let p_group p = Printf.sprintf "\\(%s\\)" p let p_int = "\\([0-9]+\\)" let p_float = "\\([0-9.]+\\)" let p_string = "\"\\([^\"]*\\)\"" let p_until_space = "\\([^ \t\n]*\\)" type logs = [ `OUT | `ERR | `BOTH ] let is_out = function `OUT | `BOTH -> true | `ERR -> false let is_err = function `ERR | `BOTH -> true | `OUT -> false let is_opt a = String.length a > 0 && a.[0] = '-' let rec pp_args fmt = function | [] -> () | a::b::c::w when is_opt a && not (is_opt b) && not (is_opt c) -> Format.fprintf fmt "@ @[<hov 2>%s@ %S@ %S@]" a b c ; pp_args fmt w | a::b::w when is_opt a && not (is_opt b) -> Format.fprintf fmt "@ @[<hov 2>%s@ %S@]" a b ; pp_args fmt w | a::w when is_opt a -> Format.fprintf fmt "@ %s" a ; pp_args fmt w | a::w-> Format.fprintf fmt "@ %S" a ; pp_args fmt w class command name = object val mutable once = true val mutable cmd = name val mutable param : string list = [] val mutable timeout = 0 val mutable validout = [] val mutable validerr = [] val mutable timers = [] val stdout = Buffer.create 256 val stderr = Buffer.create 256 method command = cmd :: param method pretty fmt = Format.pp_print_string fmt cmd ; pp_args fmt param method set_command name = cmd <- name method add args = param <- param @ args method add_parameter ~name phi = if phi () then param <- param @ [name] method add_int ~name ~value = param <- param @ [ name ; string_of_int value ] method add_positive ~name ~value = if value > 0 then param <- param @ [ name ; string_of_int value ] method add_float ~name ~value = param <- param @ [ name ; string_of_float value ] method add_list ~name values = List.iter (fun v -> param <- param @ [ name ; v ]) values method timeout t = timeout <- t method validate_pattern ?(logs=`BOTH) ?(repeat=false) regexp (handler : pattern -> unit) = begin let v = [regexp,repeat,handler] in if is_out (logs:logs) then validout <- validout @ v ; if is_err (logs:logs) then validerr <- validerr @ v ; end method validate_time phi = timers <- timers @ [phi] method run ?(echo=false) ?logout ?logerr () : int Task.task = assert once ; once <- false ; let time = ref 0.0 in let args = Array.of_list param in Buffer.clear stdout ; Buffer.clear stderr ; Task.command ~timeout ~time ~stdout ~stderr cmd args >>? begin fun st -> (* finally *) if Wp_parameters.has_dkey dkey_prover then Log.print_on_output begin fun fmt -> Format.fprintf fmt "@[<hov 2>RUN '%s%a'@]@." cmd pp_args param ; Format.fprintf fmt "RESULT %a@." (Task.pretty Format.pp_print_int) st ; Format.fprintf fmt "OUT:@\n%s" (Buffer.contents stdout) ; Format.fprintf fmt "ERR:@\n%sEND@." (Buffer.contents stderr) ; end ; dump_buffer stdout logout ; dump_buffer stderr logerr ; if echo then begin match st with | Task.Result 0 | Task.Canceled | Task.Timeout _ -> () | Task.Result 127 -> begin Wp_parameters.error "Command '%s' not found (exit status 127)@." cmd ; echo_buffer stdout ; echo_buffer stderr ; end | Task.Result s -> begin Wp_parameters.error "Command '%s' exits with status [%d]@." cmd s ; echo_buffer stdout ; echo_buffer stderr ; end | Task.Failed exn -> begin Wp_parameters.error "Command '%s' fails: %s@." cmd (Task.error exn) ; echo_buffer stdout ; echo_buffer stderr ; end end ; let t = !time in List.iter (fun phi -> phi t) timers ; validate_buffer stderr validerr ; validate_buffer stdout validout ; Buffer.clear stdout ; Buffer.clear stderr ; end end (* -------------------------------------------------------------------------- *) (* --- Task Server --- *) (* -------------------------------------------------------------------------- *) let server = ref None let getprocs = function Some n -> n | None -> Wp_parameters.Procs.get () let server ?procs () = match !server with | Some s -> let np = getprocs procs in Task.set_procs s np ; Why3Provers.set_procs np ; s | None -> let np = getprocs procs in let s = Task.server ~procs:np () in Why3Provers.set_procs np ; Task.on_server_stop s Proof.savescripts ; server := Some s ; s (* -------------------------------------------------------------------------- *) (* --- Task Composition --- *) (* -------------------------------------------------------------------------- *) let schedule task = let server = server () in Task.spawn server (Task.thread task) let silent _ = () let spawn ?(monitor=silent) ?pool (jobs : ('a * bool Task.task) list) = if jobs <> [] then begin let step = ref 0 in let monitored = ref [] in let canceled = ref false in let callback a r = if r then begin if not !canceled then begin canceled := true ; monitor (Some a) ; List.iter Task.cancel !monitored ; end end else begin decr step ; if not !canceled && !step = 0 then monitor None ; end in let pack (a,t) = Task.thread (t >>= Task.call (callback a)) in step := List.length jobs ; monitored := List.map pack jobs ; let server = server () in List.iter (Task.spawn server ?pool) !monitored ; end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverTask.mli��������������������������������������������������0000666�0000000�0000000�00000010154�13571573400�016715� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Library for Running Provers --- *) (* -------------------------------------------------------------------------- *) class printer : Format.formatter -> string -> object method paragraph : unit method lines : unit method section : string -> unit method hline : unit method printf : 'a. ('a,Format.formatter,unit) format -> 'a end val pp_file : message:string -> file:string -> unit (** never fails *) class type pattern = object method get_after : ?offset:int -> int -> string (** [get_after ~offset:p k] returns the end of the message starting [p] characters after the end of group [k]. *) method get_string : int -> string method get_int : int -> int method get_float : int -> float end val p_group : string -> string (** Put pattern in group [\(p\)] *) val p_int : string (** Int group pattern [\([0-9]+\)] *) val p_float : string (** Float group pattern [\([0-9.]+\)] *) val p_string : string (** String group pattern ["\(...\)"] *) val p_until_space : string (** No space group pattern "\\([^ \t\n]*\\)" *) val location : string -> int -> Lexing.position val timeout : int option -> int val stepout : int option -> int type logs = [ `OUT | `ERR | `BOTH ] class virtual command : string -> object method command : string list method pretty : Format.formatter -> unit method set_command : string -> unit method add : string list -> unit method add_int : name:string -> value:int -> unit method add_positive : name:string -> value:int -> unit method add_float : name:string -> value:float -> unit method add_parameter : name:string -> (unit -> bool) -> unit method add_list : name:string -> string list -> unit method timeout : int -> unit method validate_time : (float -> unit) -> unit method validate_pattern : ?logs:logs -> ?repeat:bool -> Str.regexp -> (pattern -> unit) -> unit method run : ?echo:bool -> ?logout:string -> ?logerr:string -> unit -> int Task.task end val server : ?procs:int -> unit -> Task.server val schedule : 'a Task.task -> unit val spawn : ?monitor:('a option -> unit) -> ?pool:Task.pool -> ('a * bool Task.task) list -> unit (** Spawn all the tasks over the server and retain the first 'validated' one. The callback [monitor] is called with [Some] at first success, and [None] if none succeed. An option [pool] task can be passed to register the associated threads. *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverWhy3.ml���������������������������������������������������0000666�0000000�0000000�00000151442�13571573400�016502� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Allow type-desambiguation for symbols *) [@@@ warning "-40-42"] let dkey = Wp_parameters.register_category "prover" let dkey_api = Wp_parameters.register_category "why3_api" let option_file = LogicBuiltins.create_option (fun ~driver_dir x -> Filename.concat driver_dir x) "why3" "file" let option_import = LogicBuiltins.create_option (fun ~driver_dir:_ x -> x) "why3" "import" let why3_failure msg = Pretty_utils.ksfprintf failwith msg module Env = WpContext.Index(struct include Datatype.Unit type key = unit type data = Why3.Env.env end) let get_why3_env = Env.memoize begin fun () -> let config = Why3Provers.config () in let main = Why3.Whyconf.get_main config in let ld = (WpContext.directory ()):: (Wp_parameters.Share.file "why3"):: (Why3.Whyconf.loadpath main) in Why3.Env.create_env ld end type context = { mutable th : Why3.Theory.theory_uc; env: Why3.Env.env; } type convert = { th : Why3.Theory.theory_uc; env: Why3.Env.env; subst: Why3.Term.term Lang.F.Tmap.t; pool: Lang.F.pool; polarity: Cvalues.polarity; in_goal: bool; mutable convert_for_export: Lang.F.term Lang.F.Tmap.t; } (** The reason for the rebuild *) let specific_equalities: Lang.For_export.specific_equality list ref = ref [Vlist.specialize_eq_list] let add_specific_equality ~for_tau ~mk_new_eq = specific_equalities := { for_tau; mk_new_eq }::!specific_equalities (** get symbols *) let get_ls ~cnv ~f ~l ~p = let th = Why3.Env.read_theory cnv.env f l in let ls = try Why3.Theory.ns_find_ls th.th_export p with Not_found -> why3_failure "The symbol %a can't be found in %a.%s" Why3.Pp.(print_list dot string) p Why3.Pp.(print_list dot string) f l in ls let get_ts ~cnv ~f ~l ~p = let th = Why3.Env.read_theory cnv.env f l in let ls = try Why3.Theory.ns_find_ts th.th_export p with Not_found -> why3_failure "The type %a can't be found in %a.%s" Why3.Pp.(print_list dot string) p Why3.Pp.(print_list dot string) f l in ls let t_app ~cnv ~f ~l ~p tl = Why3.Term.t_app_infer (get_ls ~cnv ~f ~l ~p) tl let t_app' ~cnv ~f ~l ~p tl ty = Why3.Term.t_app (get_ls ~cnv ~f ~l ~p) tl ty (** Conversion *) (** why3 1.3 let const_int (z:Z.t) = Why3.(Term.t_const Number.(int_const (BigInt.of_string (Z.to_string z)))) Why3.Ty.ty_int let const_real ~cnv (q:Q.t) = let mk_real_int z = let c = Why3.Number.real_const (Why3.BigInt.of_string (Z.to_string z)) in Why3.(Term.t_const c) Why3.Ty.ty_real in if Z.equal Z.one q.den then mk_real_int q.num else t_app ~cnv ~f:["real"] ~l:"Real" ~p:["infix /"] [mk_real_int q.num;mk_real_int q.den] *) let const_int (z:Z.t) = Why3.(Term.t_const Number.(const_of_big_int (BigInt.of_string (Z.to_string z)))) Why3.Ty.ty_int let const_real ~cnv (q:Q.t) = let mk_real_int z = let rc_negative = Z.sign z < 0 in let z = Z.abs z in let rc_abs = Why3.Number.real_const_dec (Z.to_string z) "" None in let c = Why3.Number.ConstReal { Why3.Number.rc_negative; rc_abs } in Why3.(Term.t_const c) Why3.Ty.ty_real in if Z.equal Z.one q.den then mk_real_int q.num else t_app ~cnv ~f:["real"] ~l:"Real" ~p:["infix /"] [mk_real_int q.num;mk_real_int q.den] (** fold map list of at least one element *) let fold_map map fold = function | [] -> assert false (** absurd: forbidden by qed *) | a::tl -> List.fold_left (fun acc a -> fold acc (map a)) (map a) tl let empty_context name : context = { th = Why3.Theory.create_theory (Why3.Ident.id_fresh name); env = get_why3_env (); } let empty_cnv ?(polarity=`NoPolarity) ?(in_goal=false) (ctx:context) : convert = { th = ctx.th; subst = Lang.F.Tmap.empty; pool = Lang.F.pool (); env = ctx.env; polarity; in_goal; convert_for_export = Lang.F.Tmap.empty; } let lfun_name (lfun:Lang.lfun) = match lfun with | ACSL f -> Qed.Engine.F_call (Lang.logic_id f) | CTOR c -> Qed.Engine.F_call (Lang.ctor_id c) | Model({m_source=Generated(_,n)}) -> Qed.Engine.F_call n | Model({m_source=Extern e}) -> e.Lang.ext_link.Lang.why3 let coerce ~cnv sort expected r = match sort, expected with | Qed.Logic.Bool, Qed.Logic.Prop -> Why3.Term.(t_equ r t_bool_true) | Qed.Logic.Int, Qed.Logic.Real -> t_app ~cnv ~f:["real"] ~l:"FromInt" ~p:["from_int"] [r] | _ -> r let name_of_adt = function | Lang.Mtype a -> a.Lang.ext_link.Lang.why3 | Mrecord(a,_) -> a.Lang.ext_link.Lang.why3 | Comp c -> Lang.comp_id c | Atype lt -> Lang.type_id lt let tvar = let tvar = Datatype.Int.Hashtbl.create 10 in fun i -> Datatype.Int.Hashtbl.memo tvar i (fun i -> let id = Why3.Ident.id_fresh (Printf.sprintf "a%i" i) in Why3.Ty.create_tvsymbol id ) (** Sharing *) let shared (_ : Lang.F.term) = false let shareable e = match Lang.F.repr e with | Kint _ | Kreal _ | True | False -> false | Times _ | Add _ | Mul _ | Div _ | Mod _ -> true | Eq _ | Neq _ | Leq _ | Lt _ -> false | Aget _ | Aset _ | Rget _ | Rdef _ | Acst _ -> true | And _ | Or _ | Not _ | Imply _ | If _ -> false | Fun _ -> not (Lang.F.is_prop e) | Bvar _ | Fvar _ | Apply _ | Bind _ -> false let subterms f e = match Lang.F.repr e with | Rdef fts -> begin match Lang.F.record_with fts with | None -> Lang.F.lc_iter f e | Some(a,fts) -> f a ; List.iter (fun (_,e) -> f e) fts end | _ -> Lang.F.lc_iter f e (* path splitting *) let regexp_col = Str.regexp_string ":" let regexp_com = Str.regexp_string "," let regexp_dot = Str.regexp_string "." let cut_path s = Str.split_delim regexp_dot s (* conversion *) let rec of_tau ~cnv (t:Lang.F.tau) = match t with | Prop -> None | Bool -> Some Why3.Ty.ty_bool | Int -> Some Why3.Ty.ty_int | Real -> Some Why3.Ty.ty_real | Array(k,v) -> let ts = get_ts ~cnv ~f:["map"] ~l:"Map" ~p:["map"] in Some (Why3.Ty.ty_app ts [Why3.Opt.get (of_tau ~cnv k); Why3.Opt.get (of_tau ~cnv v)]) | Data(adt,l) -> begin let s = name_of_adt adt in match Why3.Theory.(ns_find_ts (get_namespace cnv.th) (cut_path s)) with | ts -> Some (Why3.Ty.ty_app ts (List.map (fun e -> Why3.Opt.get (of_tau ~cnv e)) l)) | exception Not_found -> why3_failure "Can't find type '%s' in why3 namespace" s end | Tvar i -> Some (Why3.Ty.ty_var (tvar i)) | Record _ -> why3_failure "Type %a not (yet) convertible" Lang.F.pp_tau t let rec full_trigger = function | Qed.Engine.TgAny -> false | TgVar _ -> true | TgGet(a,k) -> full_trigger a && full_trigger k | TgSet(a,k,v) -> full_trigger a && full_trigger k && full_trigger v | TgFun(_,xs) | TgProp(_,xs) -> List.for_all full_trigger xs let rec full_triggers = function | [] -> [] | ts :: tgs -> match List.filter full_trigger ts with | [] -> full_triggers tgs | ts -> ts :: full_triggers tgs let rec of_trigger ~cnv t = match t with | Qed.Engine.TgAny -> assert false (** absurd: filter by full_triggers *) | Qed.Engine.TgVar v -> begin try Lang.F.Tmap.find (Lang.F.e_var v) cnv.subst with Not_found -> why3_failure "Unbound variable %a" Lang.F.pp_var v end | Qed.Engine.TgGet(m,k) -> t_app ~cnv ~f:["map"] ~l:"Map" ~p:["get"] [of_trigger cnv m;of_trigger cnv k] | TgSet(m,k,v) -> t_app ~cnv ~f:["map"] ~l:"Map" ~p:["set"] [of_trigger cnv m;of_trigger cnv k;of_trigger cnv v] | TgFun (f,l) -> begin match lfun_name f with | F_call s -> let ls = Why3.Theory.(ns_find_ls (get_namespace cnv.th) (cut_path s)) in Why3.Term.t_app_infer ls (List.map (fun e -> of_trigger cnv e) l) | _ -> why3_failure "can not convert extented calls in triggers" end | TgProp (f,l) -> begin match lfun_name f with | F_call s -> let ls = Why3.Theory.(ns_find_ls (get_namespace cnv.th) (cut_path s)) in Why3.Term.t_app_infer ls (List.map (fun e -> of_trigger cnv e) l) | _ -> why3_failure "can not convert extented calls in triggers" end let rec of_term ~cnv expected t : Why3.Term.term = Wp_parameters.debug ~dkey:dkey_api "of_term %a %a@." Lang.F.Tau.pretty expected Lang.F.pp_term t; let sort = Lang.F.typeof t in let ($) f x = f x in let r = try coerce ~cnv sort expected $ Lang.F.Tmap.find t cnv.subst with Not_found -> match Lang.F.repr t, sort, expected with | (Fvar _, _, _) -> invalid_arg "unbound variable in of_term" | (Bvar _, _, _) -> invalid_arg "bound variable in of_term" | Bind((Forall|Exists) as q,_,_), _, _ -> coerce ~cnv Prop expected $ let why3_vars, t = successive_binders cnv q t in let quant = match q with | Qed.Logic.Forall -> Why3.Term.Tforall | Qed.Logic.Exists -> Why3.Term.Texists | _ -> assert false in Why3.Term.t_quant quant (Why3.Term.t_close_quant why3_vars [] t) | True, _, Prop -> Why3.Term.t_true | True, _, Bool -> Why3.Term.t_bool_true | False, _, Prop -> Why3.Term.t_false | False, _, Bool -> Why3.Term.t_bool_false | Kint z, Int, _ -> coerce ~cnv sort expected $ const_int z | Kreal q, Real, _ -> coerce ~cnv sort expected $ const_real ~cnv q | Times(z,t), Int, _ -> coerce ~cnv sort expected $ t_app ~cnv ~f:["int"] ~l:"Int" ~p:["infix *"] [const_int z; of_term cnv sort t] | Times(z,t), Real, _ -> coerce ~cnv sort expected $ t_app ~cnv ~f:["real"] ~l:"Real" ~p:["infix *"] [const_real ~cnv (Q.of_bigint z); of_term cnv sort t] | Add l, Int, _ -> coerce ~cnv sort expected $ t_app_fold ~f:["int"] ~l:"Int" ~p:["infix +"] ~cnv sort l | Add l, Real, _ -> coerce ~cnv sort expected $ t_app_fold ~f:["real"] ~l:"Real" ~p:["infix +"] ~cnv sort l | Mul l, Int, _ -> coerce ~cnv sort expected $ t_app_fold ~f:["int"] ~l:"Int" ~p:["infix *"] ~cnv sort l | Mul l, Real, _ -> coerce ~cnv sort expected $ t_app_fold ~f:["real"] ~l:"Real" ~p:["infix *"] ~cnv sort l | Leq (a,b), _, Prop -> int_or_real ~cnv ~fint:["int"] ~lint:"Int" ~pint:["infix <="] ~freal:["real"] ~lreal:"Real" ~preal:["infix <="] a b | Div(a,b), Int, _ -> coerce ~cnv sort expected $ t_app ~cnv ~f:["int"] ~l:"ComputerDivision" ~p:["div"] [of_term ~cnv sort a; of_term ~cnv sort b] | Mod(a,b), Int, _ -> coerce ~cnv sort expected $ t_app ~cnv ~f:["int"] ~l:"ComputerDivision" ~p:["mod"] [of_term ~cnv sort a; of_term ~cnv sort b] | Div(a,b), Real, _ -> coerce ~cnv sort expected $ t_app ~cnv ~f:["real"] ~l:"Real" ~p:["infix /"] [of_term ~cnv sort a; of_term ~cnv sort b] | Lt (a,b), _, Prop -> int_or_real ~cnv ~fint:["int"] ~lint:"Int" ~pint:["infix <"] ~freal:["real"] ~lreal:"Real" ~preal:["infix <"] a b | Leq (a,b), _, Bool -> int_or_real ~cnv ~fint:["qed"] ~lint:"Qed" ~pint:["zleq"] ~freal:["qed"] ~lreal:"Qed" ~preal:["rleq"] a b | Lt (a,b), _, Bool -> int_or_real ~cnv ~fint:["qed"] ~lint:"Qed" ~pint:["zlt"] ~freal:["qed"] ~lreal:"Qed" ~preal:["rlt"] a b | And l, _, Bool -> t_app_fold ~f:["bool"] ~l:"Bool" ~p:["andb"] ~cnv expected l | And l, _, Prop -> fold_map (of_term ~cnv expected) Why3.Term.t_and l | Or l, _, Bool -> t_app_fold ~f:["bool"] ~l:"Bool" ~p:["orb"] ~cnv expected l | Or l, _, Prop -> fold_map (of_term ~cnv expected) Why3.Term.t_or l | Not e, _, Bool -> let cnv = {cnv with polarity = Cvalues.negate cnv.polarity} in t_app ~cnv ~f:["bool"] ~l:"Bool" ~p:["notb"] [of_term ~cnv expected e] | Not e, _, Prop -> let cnv = {cnv with polarity = Cvalues.negate cnv.polarity} in Why3.Term.t_not (of_term cnv expected e) | Imply (l,e), _, _ -> let e = (of_term ~cnv expected) e in let cnv' = {cnv with polarity = Cvalues.negate cnv.polarity} in let fold acc a = let a = of_term ~cnv:cnv' expected a in match expected with | Prop -> Why3.Term.t_implies a acc | _ (* Bool *) -> t_app ~cnv:cnv' ~f:["bool"] ~l:"Bool" ~p:["implb"] [a;acc] in List.fold_left fold e (List.rev l) | Eq (a,b), _, Prop -> begin match Lang.F.typeof a with | Prop | Bool -> Why3.Term.t_iff (of_term cnv Prop a) (of_term cnv Prop b) | tau -> match List.find (fun spe -> spe.Lang.For_export.for_tau tau) !specific_equalities with | spe when cnv.polarity = `Positive -> of_term cnv expected (spe.mk_new_eq a b) | exception Not_found -> Why3.Term.t_equ (of_term' cnv a) (of_term' cnv b) | _ -> Why3.Term.t_equ (of_term' cnv a) (of_term' cnv b) end | Neq (a,b), _, Prop -> begin match Lang.F.typeof a with | Prop | Bool -> Why3.Term.t_not (Why3.Term.t_iff (of_term cnv Prop a) (of_term cnv Prop b)) | tau -> match List.find (fun spe -> spe.Lang.For_export.for_tau tau) !specific_equalities with | spe when cnv.polarity = `Negative -> Why3.Term.t_not (of_term cnv expected (spe.mk_new_eq a b)) | exception Not_found -> Why3.Term.t_neq (of_term' cnv a) (of_term' cnv b) | _ -> Why3.Term.t_neq (of_term' cnv a) (of_term' cnv b) end | Eq (a,b), _, Bool -> t_app ~cnv ~f:["qed"] ~l:"Qed" ~p:["eqb"] [of_term' cnv a; of_term' cnv b] | Neq (a,b), _, Bool -> t_app ~cnv ~f:["qed"] ~l:"Qed" ~p:["neqb"] [of_term' cnv a; of_term' cnv b] | If(a,b,c), _, _ -> let cnv' = {cnv with polarity = `NoPolarity} in Why3.Term.t_if (of_term cnv' Prop a) (of_term cnv expected b) (of_term cnv expected c) | Aget(m,k), _, _ -> coerce ~cnv sort expected $ let mtau = Lang.F.typeof m in let ksort = match mtau with | Array(ksort,_) -> ksort | _ -> assert false (** absurd: by qed typing *)in t_app ~cnv ~f:["map"] ~l:"Map" ~p:["get"] [of_term cnv mtau m;of_term cnv ksort k] | Aset(m,k,v), Array(ksort,vsort), _ -> coerce ~cnv sort expected $ t_app ~cnv ~f:["map"] ~l:"Map" ~p:["set"] [of_term cnv sort m;of_term cnv ksort k;of_term cnv vsort v] | Acst(_,v), Array(_,vsort), _ -> coerce ~cnv sort expected $ t_app' ~cnv ~f:["map"] ~l:"Const" ~p:["const"] [of_term cnv vsort v] (of_tau cnv sort) (* Generic *) | Fun (f,l), _, _ -> begin let t_app ls l r = Why3.Term.t_app ls l r in let apply_from_ns s l sort = match Why3.Theory.(ns_find_ls (get_namespace cnv.th) (cut_path s)), expected with | ls, (Prop | Bool) -> coerce ~cnv sort expected $ t_app ls l (of_tau cnv sort) | ls, _ -> coerce ~cnv sort expected $ t_app ls l (of_tau cnv sort) | exception Not_found -> why3_failure "Can't find '%s' in why3 namespace" s in let apply_from_ns' s l = apply_from_ns s (List.map (fun e -> of_term' cnv e) l) in match lfun_name f, expected with | F_call s, _ -> apply_from_ns' s l sort | Qed.Engine.F_subst _, _ -> why3_failure "Driver link with subst not yet implemented" | Qed.Engine.F_left s, _ | Qed.Engine.F_assoc s, _ -> let rec aux = function | [] -> why3_failure "Empty application" | [a] -> of_term cnv expected a | a::l -> apply_from_ns s [of_term' cnv a; aux l] sort in aux l | Qed.Engine.F_right s, _ -> let rec aux = function | [] -> why3_failure "Empty application" | [a] -> of_term cnv expected a | a::l -> apply_from_ns s [aux l;of_term' cnv a] sort in aux (List.rev l) | Qed.Engine.F_list (fcons,fnil), _ -> let rec aux = function | [] -> apply_from_ns fnil [] sort | a::l -> apply_from_ns fcons [of_term' cnv a;aux l] sort in aux l | Qed.Engine.F_bool_prop (s,_), Bool | Qed.Engine.F_bool_prop (_,s), Prop -> apply_from_ns' s l expected | Qed.Engine.F_bool_prop (_,_), _ -> why3_failure "badly expected type %a for term %a" Lang.F.pp_tau expected Lang.F.pp_term t end | Rget(a,f), _ , _ -> begin let s = Lang.name_of_field f in match Why3.Theory.(ns_find_ls (get_namespace cnv.th) (cut_path s)) with | ls -> Why3.Term.t_app ls [of_term' cnv a] (of_tau cnv expected) | exception Not_found -> why3_failure "Can't find '%s' in why3 namespace" s end | Rdef(l), Data(Comp c,_) , _ -> begin (* l is already sorted by field *) let s = Lang.comp_id c in match Why3.Theory.(ns_find_ls (get_namespace cnv.th) (cut_path s)) with | ls -> let l = List.map (fun (_,t) -> of_term' cnv t) l in Why3.Term.t_app ls l (of_tau cnv expected) | exception Not_found -> why3_failure "Can't find '%s' in why3 namespace" s end | (Rdef _, Data ((Mtype _|Mrecord (_, _)|Atype _), _), _) | (Rdef _, (Prop|Bool|Int|Real|Tvar _|Array (_, _)), _) | (Aset (_, _, _), (Prop|Bool|Int|Real|Tvar _|Record _|Data (_, _)), _) | (Neq (_, _), _, (Int|Real|Tvar _|Array (_, _)|Record _|Data (_, _))) | (Eq (_, _), _, (Int|Real|Tvar _|Array (_, _)|Record _|Data (_, _))) | (Not _, _, (Int|Real|Tvar _|Array (_, _)|Record _|Data (_, _))) | (Or _, _, (Int|Real|Tvar _|Array (_, _)|Record _|Data (_, _))) | (And _, _, (Int|Real|Tvar _|Array (_, _)|Record _|Data (_, _))) | (Lt (_, _), _, (Int|Real|Tvar _|Array (_, _)|Record _|Data (_, _))) | (Leq (_, _), _, (Int|Real|Tvar _|Array (_, _)|Record _|Data (_, _))) | (Div (_, _), (Prop|Bool|Tvar _|Array (_, _)|Record _|Data (_, _)), _) | (Mod (_, _), (Prop|Bool|Real|Tvar _|Array (_, _)|Record _|Data (_, _)), _) | (Mul _, (Prop|Bool|Tvar _|Array (_, _)|Record _|Data (_, _)), _) | (Add _, (Prop|Bool|Tvar _|Array (_, _)|Record _|Data (_, _)), _) | (Times (_, _), (Prop|Bool|Tvar _|Array (_, _)|Record _|Data (_, _)), _) | (Kreal _, (Prop|Bool|Int|Tvar _|Array (_, _)|Record _|Data (_, _)), _) | (Kint _, (Prop|Bool|Real|Tvar _|Array (_, _)|Record _|Data (_, _)), _) | (False, _, (Int|Real|Tvar _|Array (_, _)|Record _|Data (_, _))) | (True, _, (Int|Real|Tvar _|Array (_, _)|Record _|Data (_, _))) | (Acst (_, _), (Prop|Bool|Int|Real|Tvar _|Record _|Data (_, _)), _) -> assert false (** absurd: by typing *) | (Bind (Lambda, _, _), _, _) | Apply _ , _, _ | Rdef _, Record _, _ -> why3_failure "Can't convert to why3 the qed term %a of type %a" Lang.F.pp_term t Lang.F.pp_tau sort in r and t_app_fold ~cnv ~f ~l ~p expected lt = let fold acc a = t_app ~cnv ~f ~l ~p [acc;a] in fold_map (of_term ~cnv expected) fold lt and of_term' cnv t = of_term cnv (Lang.F.typeof t) t and share cnv expected t = let l = Lang.F.QED.shared ~shareable ~shared ~subterms [t] in let cnv,lets = mk_lets cnv l in let t = of_term ~cnv expected t in let t = List.fold_left (fun t (x,e') -> Why3.Term.t_let_close x e' t ) t lets in t and mk_lets cnv l = List.fold_left (fun (cnv,lets) e -> let cnv' = {cnv with polarity = `NoPolarity} in let e' = of_term cnv' (Lang.F.typeof e) e in match e'.t_ty with | None -> ({cnv with subst = Lang.F.Tmap.add e e' cnv.subst},lets) | Some ty -> let x = Why3.Ident.id_fresh (Lang.F.basename e) in let x = Why3.Term.create_vsymbol x ty in (* Format.printf "lets %a = %a : %a@." * Why3.Pretty.print_vsty x * Why3.Pretty.print_term e' * Why3.Pretty.print_ty (Why3.Term.t_type e'); *) let cnv = {cnv with subst = Lang.F.Tmap.add e (Why3.Term.t_var x) cnv.subst } in let lets = (x,e')::lets in cnv,lets ) (cnv,[]) l and successive_binders cnv q t = match Lang.F.repr t with | Bind((Forall|Exists) as q',tau,t) when q' = q -> let x = Lang.F.fresh cnv.pool tau in let x' = Why3.Ident.id_fresh (Lang.F.Tau.basename tau) in let x' = Why3.Term.create_vsymbol x' (Why3.Opt.get (of_tau cnv tau)) in let cnv = {cnv with subst = Lang.F.Tmap.add (Lang.F.e_var x) (Why3.Term.t_var x') cnv.subst} in let t = Lang.F.QED.e_unbind x t in let why3_vars, t = successive_binders cnv q t in x'::why3_vars, t | _ -> [], share cnv Prop t and int_or_real ~cnv ~fint ~lint ~pint ~freal ~lreal ~preal a b = match (Lang.F.typeof a), (Lang.F.typeof b) with | Int, Int -> t_app_fold ~f:fint ~l:lint ~p:pint ~cnv Int [a; b] | Real, Int | Real, Real | Int, Real -> t_app_fold ~f:freal ~l:lreal ~p:preal ~cnv Real [a; b] | _ -> assert false let convert cnv expected t = (** rewrite terms which normal form inside qed are different from the one of the provers *) let t, convert_for_export = Lang.For_export.rebuild ~cache:cnv.convert_for_export t in cnv.convert_for_export <- convert_for_export; Lang.For_export.in_state (share cnv expected) t let mk_binders cnv l = List.fold_left (fun (cnv,lets) v -> match of_tau cnv (Lang.F.tau_of_var v) with | None -> why3_failure "Quantification on prop" | Some ty -> let x = Why3.Ident.id_fresh (Lang.F.Var.basename v) in let x = Why3.Term.create_vsymbol x ty in let e = Lang.F.e_var v in let cnv = {cnv with subst = Lang.F.Tmap.add e (Why3.Term.t_var x) cnv.subst } in let lets = x::lets in cnv,lets ) (cnv,[]) (List.rev l) (** visit definitions and add them in the task *) module CLUSTERS = WpContext.Index (struct type key = Definitions.cluster type data = int * Why3.Theory.theory let name = "ProverWhy3.CLUSTERS" let compare = Definitions.cluster_compare let pretty = Definitions.pp_cluster end) let filenoext file = let basename = Filename.basename file in (try Filename.chop_extension basename with Invalid_argument _ -> basename) class visitor (ctx:context) c = object(self) inherit Definitions.visitor c (* --- Files, Theories and Clusters --- *) method add_builtin_lib = self#add_import_file ["bool"] "Bool" ; self#add_import_file ["int"] "Int" ; self#add_import_file ["int"] "ComputerDivision" ; self#add_import_file ["real"] "RealInfix" ; self#on_library "qed"; self#add_import_file ["map"] "Map" method on_cluster c = let name = Definitions.cluster_id c in Wp_parameters.debug ~dkey:dkey_api "Start on_cluster %s@." name; let th_name = String.capitalize_ascii name in let thy = let age = try fst (CLUSTERS.find c) with Not_found -> (-1) in if age < Definitions.cluster_age c then let ctx = empty_context th_name in let v = new visitor ctx c in v#add_builtin_lib; v#vself; let th = Why3.Theory.close_theory ctx.th in if Wp_parameters.has_dkey ProverErgo.dkey_cluster then Log.print_on_output begin fun fmt -> Format.fprintf fmt "---------------------------------------------@\n" ; Format.fprintf fmt "--- Context '%s' Cluster '%s' @\n" (WpContext.get_context () |> WpContext.S.id) name; Format.fprintf fmt "---------------------------------------------@\n" ; Why3.Pretty.print_theory fmt th; end ; CLUSTERS.update c (Definitions.cluster_age c, th); th else snd (CLUSTERS.find c) in let th = ctx.th in let th = Why3.Theory.open_scope th name in let th = Why3.Theory.use_export th thy in let th = Why3.Theory.close_scope th true in Wp_parameters.debug ~dkey:dkey_api "End on_cluster %s@." name; ctx.th <- th method section _ = () method add_import ?was thy = match Str.split_delim regexp_dot thy with | [] -> why3_failure "[driver] empty import option" | l -> let file, thy = Why3.Lists.chop_last l in self#add_import_use file thy (Why3.Opt.get_def thy was) ~import:true method add_import_file file thy = self#add_import_use ~import:true file thy thy method add_import_file_as file thy name = self#add_import_use ~import:false file thy name method add_import_use ~import file thy name = Wp_parameters.debug ~dkey:dkey_api "@[use@ %s@ @[%a.%s@]@ as@ %s@]" (if import then "import" else "") Why3.Pp.(print_list (Why3.Pp.constant_string ".") string) file thy name ; let thy = Why3.Env.read_theory ctx.env file thy in let th = ctx.th in let th = Why3.Theory.open_scope th name in let th = Why3.Theory.use_export th thy in let th = Why3.Theory.close_scope th import in ctx.th <- th method on_library thy = let copy_file source = if Filepath.normalize (Filename.dirname source) <> Filepath.normalize (Wp_parameters.Share.dir ()) then let tgtdir = WpContext.directory () in let why3src = Filename.basename source in let target = Printf.sprintf "%s/%s" tgtdir why3src in Command.copy source target in let iter_file opt = match Str.split_delim regexp_col opt with | [file] -> let filenoext = filenoext file in copy_file file; self#add_import_file [filenoext] (String.capitalize_ascii filenoext); | [file;lib] -> copy_file file; self#add_import_file [filenoext file] lib; | [file;lib;name] -> copy_file file; self#add_import_file_as [filenoext file] lib name; | _ -> why3_failure "[driver] incorrect why3.file %S for library '%s'" opt thy in let iter_import opt = List.iter (fun import -> match Str.split_delim regexp_col import with | [ th ] -> self#add_import th | [ th ; was ] -> self#add_import ~was th | _ -> why3_failure "[driver] incorrect why3.file %S for library '%s'" opt thy ) (Str.split regexp_com opt) in begin List.iter iter_file (LogicBuiltins.get_option option_file ~library:thy) ; List.iter iter_import (LogicBuiltins.get_option option_import ~library:thy) ; end method on_type lt def = match def with | Tabs -> let id = Why3.Ident.id_fresh (Lang.type_id lt) in let map i _ = tvar i in let tv_args = List.mapi map lt.lt_params in let id = Why3.Ty.create_tysymbol id tv_args NoDef in let decl = Why3.Decl.create_ty_decl id in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; | Tdef t -> let id = Why3.Ident.id_fresh (Lang.type_id lt) in let map i _ = tvar i in let tv_args = List.mapi map lt.lt_params in let cnv = empty_cnv ctx in let t = Why3.Opt.get (of_tau ~cnv t) in let id = Why3.Ty.create_tysymbol id tv_args (Alias t) in let decl = Why3.Decl.create_ty_decl id in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; | Tsum cases -> let id = Why3.Ident.id_fresh (Lang.type_id lt) in let map i _ = tvar i in let tv_args = List.mapi map lt.lt_params in let tys = Why3.Ty.create_tysymbol id tv_args NoDef in let tv_args = List.map Why3.Ty.ty_var tv_args in let return_ty = Why3.Ty.ty_app tys tv_args in let cnv = empty_cnv ctx in let constr = List.length cases in let cases = List.map (fun (c,targs) -> let name = match c with | Lang.CTOR c -> Lang.ctor_id c | _ -> assert false in let id = Why3.Ident.id_fresh name in let targs = List.map (fun t -> Why3.Opt.get (of_tau ~cnv t)) targs in let ls = Why3.Term.create_fsymbol ~constr id targs return_ty in let proj = List.map (fun _ -> None) targs in (ls,proj) ) cases in let decl = Why3.Decl.create_data_decl [tys,cases] in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; | Trec fields -> let id = Why3.Ident.id_fresh (Lang.type_id lt) in let map i _ = tvar i in let tv_args = List.mapi map lt.lt_params in let tys = Why3.Ty.create_tysymbol id tv_args NoDef in let tv_args = List.map Why3.Ty.ty_var tv_args in let return_ty = Why3.Ty.ty_app tys tv_args in let cnv = empty_cnv ctx in let fields,args = List.split @@ List.map (fun (f,ty) -> let name = Lang.name_of_field f in let id = Why3.Ident.id_fresh name in let ty = Why3.Opt.get (of_tau ~cnv ty) in let ls = Why3.Term.create_fsymbol id [return_ty] ty in Some ls,ty ) fields in let id = Why3.Ident.id_fresh (Lang.type_id lt) in let cstr = Why3.Term.create_fsymbol ~constr:1 id args return_ty in let decl = Why3.Decl.create_data_decl [tys,[cstr,fields]] in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; method on_comp c (fts:(Lang.field * Lang.tau) list) = begin let compare_field (f,_) (g,_) = let cmp = Lang.Field.compare f g in if cmp = 0 then assert false (* by definition *) else cmp in let fts = List.sort compare_field fts in (*TODO:NUPW: manage UNIONS *) let id = Why3.Ident.id_fresh (Lang.comp_id c) in let ts = Why3.Ty.create_tysymbol id [] Why3.Ty.NoDef in let ty = Why3.Ty.ty_app ts [] in let id = Why3.Ident.id_fresh (Lang.comp_id c) in let cnv = empty_cnv ctx in let map (f,tau) = let ty_ctr = of_tau ~cnv tau in let id = Why3.Ident.id_fresh (Lang.name_of_field f) in let ls = Why3.Term.create_lsymbol id [ty] ty_ctr in (Some ls,Why3.Opt.get ty_ctr) in let fields = List.map map fts in let constr = Why3.Term.create_fsymbol ~constr:1 id (List.map snd fields) ty in let decl = Why3.Decl.create_data_decl [ts,[constr,List.map fst fields]] in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; end method on_dlemma l = begin let kind = Why3.Decl.(if l.l_assumed then Paxiom else Plemma) in let id = Why3.Ident.id_fresh (Lang.lemma_id l.l_name) in let id = Why3.Decl.create_prsymbol id in let cnv = empty_cnv ctx in List.iter (Lang.F.add_var cnv.pool) l.l_forall; let cnv, vars = Lang.For_export.in_state (mk_binders cnv) l.l_forall in let t = convert cnv Prop (Lang.F.e_prop l.l_lemma) in let triggers = full_triggers l.l_triggers in let triggers = Lang.For_export.in_state (List.map (List.map (of_trigger ~cnv))) triggers in let t = Why3.Term.t_forall_close vars triggers t in let decl = Why3.Decl.create_prop_decl kind id t in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; end method on_dfun d = Wp_parameters.debug ~dkey:dkey_api "Define %a@." Lang.Fun.pretty d.d_lfun ; let cnv = empty_cnv ctx in List.iter (Lang.F.add_var cnv.pool) d.d_params; begin match d.d_definition with | Logic t -> let id = Why3.Ident.id_fresh (Qed.Export.link_name (lfun_name d.d_lfun)) in let map e = Why3.Opt.get (of_tau ~cnv (Lang.F.tau_of_var e)) in let ty_args = List.map map d.d_params in let id = Why3.Term.create_lsymbol id ty_args (of_tau ~cnv t) in let decl = Why3.Decl.create_param_decl id in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; | Function(t,mu,v) -> begin match mu with | Rec -> (* transform recursive function into an axioms *) let name = Qed.Export.link_name (lfun_name d.d_lfun) in let id = Why3.Ident.id_fresh name in let map e = Why3.Opt.get (of_tau ~cnv (Lang.F.tau_of_var e)) in let ty_args = List.map map d.d_params in let result = of_tau ~cnv t in let id = Why3.Term.create_lsymbol id ty_args result in let decl = Why3.Decl.create_param_decl id in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; let cnv = empty_cnv ctx in List.iter (Lang.F.add_var cnv.pool) d.d_params; let cnv, vars = mk_binders cnv d.d_params in let t = share cnv t v in let t = Why3.Term.t_forall_close vars [] (Why3.Term.t_equ (Why3.Term.t_app id (List.map Why3.Term.t_var vars) result) t) in let decl = Why3.Decl.create_prop_decl Why3.Decl.Paxiom (Why3.Decl.create_prsymbol (Why3.Ident.id_fresh (name^"_def"))) t in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; | Def -> let id = Why3.Ident.id_fresh (Qed.Export.link_name (lfun_name d.d_lfun)) in let map e = Why3.Opt.get (of_tau ~cnv (Lang.F.tau_of_var e)) in let ty_args = List.map map d.d_params in let result = of_tau ~cnv t in let id = Why3.Term.create_lsymbol id ty_args result in let cnv, vars = mk_binders cnv d.d_params in let t = share cnv t v in let decl = Why3.Decl.make_ls_defn id vars t in let decl = Why3.Decl.create_logic_decl [decl] in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl end | Predicate(mu,p) -> begin match mu with | Rec -> let name = Qed.Export.link_name (lfun_name d.d_lfun) in let id = Why3.Ident.id_fresh name in let map e = Why3.Opt.get (of_tau ~cnv (Lang.F.tau_of_var e)) in let ty_args = List.map map d.d_params in let result = None in let id = Why3.Term.create_lsymbol id ty_args result in let decl = Why3.Decl.create_param_decl id in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; let cnv = empty_cnv ctx in List.iter (Lang.F.add_var cnv.pool) d.d_params; let cnv, vars = mk_binders cnv d.d_params in let t = share cnv Prop (Lang.F.e_prop p) in let t = Why3.Term.t_forall_close vars [] (Why3.Term.t_iff t (Why3.Term.t_app id (List.map Why3.Term.t_var vars) result)) in let decl = Why3.Decl.create_prop_decl Why3.Decl.Paxiom (Why3.Decl.create_prsymbol (Why3.Ident.id_fresh (name^"_def"))) t in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl; | Def -> let id = Why3.Ident.id_fresh (Qed.Export.link_name (lfun_name d.d_lfun)) in let map e = Why3.Opt.get (of_tau ~cnv (Lang.F.tau_of_var e)) in let ty_args = List.map map d.d_params in let id = Why3.Term.create_lsymbol id ty_args None in let cnv, vars = mk_binders cnv d.d_params in let t = share cnv Prop (Lang.F.e_prop p) in let decl = Why3.Decl.make_ls_defn id vars t in let decl = Why3.Decl.create_logic_decl [decl] in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl end | Inductive dl -> (* create predicate symbol *) let id = Why3.Ident.id_fresh (Qed.Export.link_name (lfun_name d.d_lfun)) in let map e = Why3.Opt.get (of_tau ~cnv (Lang.F.tau_of_var e)) in let ty_args = List.map map d.d_params in let id = Why3.Term.create_lsymbol id ty_args None in let decl = Why3.Decl.create_param_decl id in ctx.th <- Why3.Theory.add_decl ~warn:false ctx.th decl ; (* register axioms *) List.iter (self#on_dlemma) dl end end (* -------------------------------------------------------------------------- *) (* --- Goal Compilation --- *) (* -------------------------------------------------------------------------- *) let goal_id = (Why3.Decl.create_prsymbol (Why3.Ident.id_fresh "wp_goal")) let prove_goal ~id ~title ~name ?axioms t = (* Format.printf "why3_of_qed start@."; *) let goal = Definitions.cluster ~id ~title () in let ctx = empty_context name in let v = new visitor ctx goal in Wp_parameters.debug ~dkey:dkey_api "%t" begin fun fmt -> Format.fprintf fmt "---------------------------------------------@\n" ; Format.fprintf fmt "EXPORT GOAL %s@." id ; Format.fprintf fmt "PROP @[<hov 2>%a@]@." Lang.F.pp_pred t ; Format.fprintf fmt "---------------------------------------------@\n" ; end ; v#add_builtin_lib; v#vgoal axioms t; let cnv = empty_cnv ~in_goal:true ~polarity:`Positive ctx in let t = convert cnv Prop (Lang.F.e_prop t) in let decl = Why3.Decl.create_prop_decl Pgoal goal_id t in let th = Why3.Theory.close_theory ctx.th in if Wp_parameters.has_print_generated () then begin let th_uc_tmp = Why3.Theory.add_decl ~warn:false ctx.th decl in let th_tmp = Why3.Theory.close_theory th_uc_tmp in Wp_parameters.debug ~dkey:Wp_parameters.cat_print_generated "%a" Why3.Pretty.print_theory th_tmp end; th, decl let prove_prop ?axioms ~pid ~prop = let id = WpPropId.get_propid pid in let title = Pretty_utils.to_string WpPropId.pretty pid in let name = "WP" in let th, decl = prove_goal ?axioms ~id ~title ~name prop in let t = None in let t = Why3.Task.use_export t th in Why3.Task.add_decl t decl let task_of_wpo wpo = let pid = wpo.Wpo.po_pid in match wpo.Wpo.po_formula with | Wpo.GoalAnnot v -> let pid = wpo.Wpo.po_pid in let axioms = v.Wpo.VC_Annot.axioms in let prop = Wpo.GOAL.compute_proof v.Wpo.VC_Annot.goal in (* Format.printf "Goal: %a@." Lang.F.pp_pred prop; *) prove_prop ~pid ~prop ?axioms | Wpo.GoalLemma v -> let lemma = v.Wpo.VC_Lemma.lemma in let depends = v.Wpo.VC_Lemma.depends in let prop = Lang.F.p_forall lemma.l_forall lemma.l_lemma in let axioms = Some(lemma.l_cluster,depends) in prove_prop ~pid ~prop ?axioms (* -------------------------------------------------------------------------- *) (* --- Prover Task --- *) (* -------------------------------------------------------------------------- *) let prover_task prover task = let env = get_why3_env () in let config = Why3Provers.config () in let prover_config = Why3.Whyconf.get_prover_config config prover in let drv = Why3.Whyconf.load_driver (Why3.Whyconf.get_main config) env prover_config.driver prover_config.extra_drivers in let remove_for_prover = if prover.prover_name = "Alt-Ergo" then Filter_axioms.remove_for_altergo else Filter_axioms.remove_for_why3 in let trans = Why3.Trans.seq [ remove_for_prover; Filter_axioms.trans; Filter_axioms.def_into_axiom ] in let task = if prover.prover_name = "Coq" then task else Why3.Trans.apply trans task in drv , prover_config , Why3.Driver.prepare_task drv task (* -------------------------------------------------------------------------- *) (* --- Prover Call --- *) (* -------------------------------------------------------------------------- *) let altergo_step_limit = Str.regexp "^Steps limit reached:" type prover_call = { prover : Why3Provers.t ; call : Why3.Call_provers.prover_call ; steps : int option ; timeover : float option ; mutable interrupted : bool ; mutable killed : bool ; } let ping_prover_call p = match Why3.Call_provers.query_call p.call with | NoUpdates | ProverStarted -> let () = match p.timeover with | None -> () | Some timeout -> let time = Unix.time () in if time > timeout then begin Wp_parameters.debug ~dkey "Hard Kill (late why3server timeout)" ; p.interrupted <- true ; Why3.Call_provers.interrupt_call p.call ; end in Task.Wait 100 | InternalFailure exn -> let msg = Format.asprintf "@[<hov 2>%a@]" Why3.Exn_printer.exn_printer exn in Task.Return (Task.Result (VCS.failed msg)) | ProverInterrupted -> Task.(Return Canceled) | ProverFinished _ when p.killed -> Task.(Return Canceled) | ProverFinished pr -> let r = match pr.pr_answer with | Timeout -> VCS.timeout (int_of_float pr.pr_time) | Valid -> VCS.result ~time:pr.pr_time ~steps:pr.pr_steps VCS.Valid | Invalid -> VCS.result ~time:pr.pr_time ~steps:pr.pr_steps VCS.Invalid | OutOfMemory -> VCS.failed "out of memory" | StepLimitExceeded -> VCS.result ?steps:p.steps VCS.Stepout | Unknown _ -> VCS.unknown | _ when p.interrupted -> VCS.timeout (int_of_float pr.pr_time) | Failure s -> VCS.failed s | HighFailure -> let alt_ergo_hack = p.prover.prover_name = "Alt-Ergo" && Str.string_match altergo_step_limit pr.pr_output 0 in if alt_ergo_hack then VCS.result ?steps:p.steps VCS.Stepout else VCS.failed "Unknown error" in Wp_parameters.debug ~dkey "@[@[Why3 result for %a:@] @[%a@] and @[%a@]@." Why3.Whyconf.print_prover p.prover (Why3.Call_provers.print_prover_result) pr VCS.pp_result r; Task.Return (Task.Result r) let call_prover ~timeout ~steplimit drv prover prover_config task = let steps = match steplimit with Some 0 -> None | _ -> steplimit in let limit = let def = Why3.Call_provers.empty_limit in { def with Why3.Call_provers.limit_time = Why3.Opt.get_def def.limit_time timeout; Why3.Call_provers.limit_steps = Why3.Opt.get_def def.limit_time steps; } in let command = Why3.Whyconf.get_complete_command prover_config ~with_steps:(steps<>None) in let call = Why3.Driver.prove_task_prepared ~command ~limit drv task in Wp_parameters.debug ~dkey "Why3 run prover %a with %i timeout %i steps@." Why3.Whyconf.print_prover prover (Why3.Opt.get_def (-1) timeout) (Why3.Opt.get_def (-1) steps); let timeover = match timeout with | None -> None | Some tlimit -> let started = Unix.time () in Some (started +. 2.0 +. float tlimit) in let pcall = { call ; prover ; killed = false ; interrupted = false ; steps ; timeover ; } in let ping = function | Task.Kill -> pcall.killed <- true ; Why3.Call_provers.interrupt_call call ; Task.Yield | Task.Coin -> ping_prover_call pcall in Task.async ping (* -------------------------------------------------------------------------- *) (* --- Cache Management --- *) (* -------------------------------------------------------------------------- *) type mode = NoCache | Update | Replay | Rebuild | Offline | Cleanup let hits = ref 0 let miss = ref 0 let removed = ref 0 let cleanup = Hashtbl.create 0 (* used entries, never to be reset since cleanup is performed at exit *) let get_hits () = !hits let get_miss () = !miss let get_removed () = !removed let mark_cache ~mode hash = if mode = Cleanup || !Config.is_gui then Hashtbl.replace cleanup hash () let cleanup_cache ~mode = if mode = Cleanup && (!hits > 0 || !miss > 0) then let dir = Wp_parameters.get_session_dir "cache" in try if Sys.is_directory dir then Array.iter (fun f -> if Filename.check_suffix f ".json" then let hash = Filename.chop_suffix f ".json" in if not (Hashtbl.mem cleanup hash) then begin incr removed ; Extlib.safe_remove (Printf.sprintf "%s/%s" dir f) ; end ) (Sys.readdir dir) ; with Unix.Unix_error _ as exn -> Wp_parameters.warning ~current:false "Can not cleanup cache (%s)" (Printexc.to_string exn) (* -------------------------------------------------------------------------- *) (* --- Cache Management --- *) (* -------------------------------------------------------------------------- *) let parse_mode ~origin ~fallback = function | "none" -> NoCache | "update" -> Update | "replay" -> Replay | "rebuild" -> Rebuild | "offline" -> Offline | "cleanup" -> Cleanup | "" -> raise Not_found | m -> Wp_parameters.warning ~current:false "Unknown %s mode %S (use %s instead)" origin m fallback ; raise Not_found let mode_name = function | NoCache -> "none" | Update -> "update" | Replay -> "replay" | Rebuild -> "rebuild" | Offline -> "offline" | Cleanup -> "cleanup" module MODE = WpContext.StaticGenerator(Datatype.Unit) (struct type key = unit type data = mode let name = "Wp.Cache.mode" let compile () = try let origin = "FRAMAC_WP_CACHE" in parse_mode ~origin ~fallback:"-wp-cache" (Sys.getenv origin) with Not_found -> try parse_mode ~origin:"-wp-cache" ~fallback:"none" (Wp_parameters.Cache.get()) with Not_found -> if Wp_parameters.has_session () then Update else NoCache end) let get_mode = MODE.get let set_mode m = MODE.clear () ; Wp_parameters.Cache.set (mode_name m) let task_hash wpo drv prover task = lazy begin let file = Wpo.DISK.file_goal ~pid:wpo.Wpo.po_pid ~model:wpo.Wpo.po_model ~prover:(VCS.Why3 prover) in let _ = Command.print_file file begin fun fmt -> Format.fprintf fmt "(* WP Task for Prover %s *)@\n" (Why3Provers.print prover) ; Why3.Driver.print_task_prepared drv fmt task ; end in Digest.file file |> Digest.to_hex end let time_fits time = function | None | Some 0 -> true | Some limit -> time <= float limit let steps_fits steps = function | None | Some 0 -> true | Some limit -> steps <= limit let time_seized time = function | None | Some 0 -> false | Some limit -> float limit <= time let steps_seized steps steplimit = steps <> 0 && match steplimit with | None | Some 0 -> false | Some limit -> limit <= steps let promote ~timeout ~steplimit (res : VCS.result) = match res.verdict with | VCS.NoResult | VCS.Computing _ | VCS.Checked -> VCS.no_result | VCS.Failed -> res | VCS.Invalid | VCS.Valid | VCS.Unknown -> if not (steps_fits res.prover_steps steplimit) then { res with verdict = Stepout } else if not (time_fits res.prover_time timeout) then { res with verdict = Timeout } else res | VCS.Timeout | VCS.Stepout -> if steps_seized res.prover_steps steplimit then { res with verdict = Stepout } else if time_seized res.prover_time timeout then { res with verdict = Timeout } else (* can be run a longer time or widely *) VCS.no_result let get_cache_result ~mode hash = match mode with | NoCache | Rebuild -> VCS.no_result | Update | Cleanup | Replay | Offline -> let dir = Wp_parameters.get_session_dir "cache" in let hash = Lazy.force hash in let file = Printf.sprintf "%s/%s.json" dir hash in if not (Sys.file_exists file) then VCS.no_result else try mark_cache ~mode hash ; Json.load_file file |> ProofScript.result_of_json with err -> Wp_parameters.warning ~current:false ~once:true "invalid cache entry (%s)" (Printexc.to_string err) ; VCS.no_result let set_cache_result ~mode hash prover result = match mode with | NoCache | Replay | Offline -> () | Rebuild | Update | Cleanup -> let dir = Wp_parameters.get_session_dir "cache" in let hash = Lazy.force hash in let file = Printf.sprintf "%s/%s.json" dir hash in try mark_cache ~mode hash ; ProofScript.json_of_result (VCS.Why3 prover) result |> Json.save_file file with err -> Wp_parameters.warning ~current:false ~once:true "can not update cache (%s)" (Printexc.to_string err) let is_trivial (t : Why3.Task.task) = let goal = Why3.Task.task_goal_fmla t in Why3.Term.t_equal goal Why3.Term.t_true (* -------------------------------------------------------------------------- *) (* --- Prove WPO --- *) (* -------------------------------------------------------------------------- *) let build_proof_task ?timeout ?steplimit ~prover wpo () = try WpContext.on_context (Wpo.get_context wpo) begin fun () -> (* Always generate common task *) let task = task_of_wpo wpo in if Wp_parameters.Check.get () then Task.return VCS.checked (* Why3 tasks are type-checked *) else if Wp_parameters.Generate.get () then Task.return VCS.no_result (* Only generate *) else let drv , config , task = prover_task prover task in if is_trivial task then Task.return VCS.valid else let mode = get_mode () in match mode with | NoCache -> call_prover ~timeout ~steplimit drv prover config task | Offline -> let hash = task_hash wpo drv prover task in let result = get_cache_result ~mode hash |> VCS.cached in if VCS.is_verdict result then incr hits else incr miss ; Task.return result | Update | Replay | Rebuild | Cleanup -> let hash = task_hash wpo drv prover task in let result = get_cache_result ~mode hash |> promote ~timeout ~steplimit |> VCS.cached in if VCS.is_verdict result then begin incr hits ; Task.return result end else Task.finally (call_prover ~timeout ~steplimit drv prover config task) begin function | Task.Result result when VCS.is_verdict result -> incr miss ; set_cache_result ~mode hash prover result | _ -> () end end () with exn -> if Wp_parameters.has_dkey dkey_api then Wp_parameters.fatal "[Why3 Error] %a@\n%s" Why3.Exn_printer.exn_printer exn Printexc.(raw_backtrace_to_string @@ get_raw_backtrace ()) else Task.failed "[Why3 Error] %a" Why3.Exn_printer.exn_printer exn let prove ?timeout ?steplimit ~prover wpo = Task.later (build_proof_task ?timeout ?steplimit ~prover wpo) () (* -------------------------------------------------------------------------- *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ProverWhy3.mli��������������������������������������������������0000666�0000000�0000000�00000004341�13571573400�016646� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val add_specific_equality: for_tau:(Lang.tau -> bool) -> mk_new_eq:Lang.F.binop -> unit (** Equality used in the goal, simpler to prove than polymorphic equality *) val prove : ?timeout:int -> ?steplimit:int -> prover:Why3Provers.t -> Wpo.t -> VCS.result Task.task (** Return NoResult if it is already proved by Qed *) type mode = NoCache | Update | Replay | Rebuild | Offline | Cleanup val set_mode : mode -> unit val get_mode : unit -> mode val get_hits : unit -> int val get_miss : unit -> int val get_removed : unit -> int val cleanup_cache : mode:mode -> unit (**************************************************************************) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RefUsage.ml�����������������������������������������������������0000666�0000000�0000000�00000074504�13571573400�016156� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ---------------------------------------------------------------------- *) (* --- Variable Analysis --- *) (* ---------------------------------------------------------------------- *) open Ctypes open Cil_types open Cil_datatype (* ---------------------------------------------------------------------- *) (* --- Varinfo Accesses --- *) (* ---------------------------------------------------------------------- *) (** By lattice order of usage *) type access = | NoAccess (** Never used *) | ByRef (** Only used as ["*x"], equals to [load(shift(load(&x),0))] *) | ByArray (** Only used as ["x[_]"], equals to [load(shift(load(&x),_))] *) | ByValue (** Only used as ["x"], equals to [load(&x)] *) | ByAddr (** Widely used, potentially up to ["&x"] *) module Access : sig type t = access val is_bot : t -> bool val cup : t -> t -> t val pretty : varinfo -> Format.formatter -> t -> unit end = struct type t = access let is_bot = function NoAccess -> true | _ -> false let pretty x fmt = function | NoAccess -> Format.fprintf fmt "-%a" Varinfo.pretty x | ByRef -> Format.fprintf fmt "*%a" Varinfo.pretty x | ByArray -> Format.fprintf fmt "%a[]" Varinfo.pretty x | ByValue -> Format.fprintf fmt "%a" Varinfo.pretty x | ByAddr -> Format.fprintf fmt "&%a" Varinfo.pretty x let rank = function | NoAccess -> 0 | ByRef -> 1 | ByArray -> 2 | ByValue -> 3 | ByAddr -> 4 let cup a b = if rank a < rank b then b else a end (* ---------------------------------------------------------------------- *) (* --- Expressions & Memory Model --- *) (* ---------------------------------------------------------------------- *) module E : sig type t val bot : t val is_bot : t -> bool val cup : t -> t -> t val cup_differ : t -> t -> t * bool (* val leq : t -> t -> bool *) (* unused for now *) (* val lcup : t list -> t *) (* unused for now *) val fcup : ('a -> t) -> 'a list -> t val get : varinfo -> t -> access val access : varinfo -> access -> t -> t val partition_formals_vs_others : t -> t*t val pretty : Format.formatter -> t -> unit val iter: (varinfo -> access -> unit) -> t -> unit end = struct module Xmap = Qed.Mergemap.Make(Varinfo) type t = access Xmap.t let pretty fmt m = begin Format.fprintf fmt "@[<hov 2>{" ; Xmap.iter (fun x e -> if e <> NoAccess then ( Format.pp_print_space fmt () ; Access.pretty x fmt e ) ) m ; Format.fprintf fmt " }@]" ; end let bot = Xmap.empty let is_bot = Xmap.is_empty let cup = Xmap.union (fun _ -> Access.cup) let cup_differ e1 e2 = let r = cup e1 e2 in let is_modified = not (r==e1) in (* Format.printf "cup_differ %a %a = %a,%b@." pretty e1 pretty e2 pretty r is_modified; *) r, is_modified (* unused for now *) (* let leq = Xmap.subset (fun _ -> Access.leq) *) (* unused for now *) (* let rec lcup = function [] -> bot |[x] -> x |x::xs -> cup x (lcup xs)*) let rec fcup f = function [] -> bot | [x] -> f x | x::xs -> cup (f x) (fcup f xs) let get vi e = try Xmap.find vi e with Not_found -> NoAccess let access vi u e = if Access.is_bot u then e else Xmap.insert (fun _ u old -> Access.cup old u) vi u e let partition_formals_vs_others e = Xmap.partition (fun vi _a -> vi.vformal) e let iter = Xmap.iter end type value = E.t type model = | E of value (* E *) | Loc_var of varinfo (* &x *) | Loc_shift of varinfo * value (* &x.[...] *) | Val_var of varinfo (* x *) | Val_comp of varinfo * value (* x.f[_].g... *) | Val_shift of varinfo * value (* (x + E) *) [@@@ warning "-32" ] let pp_model fmt = function | E v -> E.pretty fmt v | Loc_var x -> Format.fprintf fmt "&%a" Varinfo.pretty x | Loc_shift(x,v) -> Format.fprintf fmt "&%a.(%a)" Varinfo.pretty x E.pretty v | Val_var x -> Varinfo.pretty fmt x | Val_comp(x,v) -> Format.fprintf fmt "%a.(%a)" Varinfo.pretty x E.pretty v | Val_shift(x,v) -> Format.fprintf fmt "%a+(%a)" Varinfo.pretty x E.pretty v [@@@ warning "+32" ] let nothing = E E.bot let v_model v = if E.is_bot v then nothing else E v let vcup (a:value) (b:value) : model = v_model (E.cup a b) let share_vcup (m:model) ~old (b:value) : model = (* requires m = E(old) *) (* ensures \result == vcup old b *) let e = E.cup old b in if e == old then m else v_model e (* let lcup xs = m_value (E.lcup xs) *) (* unused for now *) (* let fcup f xs = m_value (E.fcup f xs) *) (* unused for now *) let e_value = function | Loc_var x -> E.access x ByAddr E.bot | Loc_shift(x,e) -> E.access x ByAddr e | Val_var x -> E.access x ByValue E.bot | Val_comp(x,e) | Val_shift(x,e) -> E.access x ByValue e | E e -> e let m_value = function | E _ as m -> m | m -> E (e_value m) let m_vcup = let m_vcup m = vcup (e_value m) in function | E old as m -> (* better sharing than vcup (e_value m) b *) share_vcup m ~old | _ as m -> m_vcup m let m_fcup f = let m_fcup f = E.fcup (fun x -> e_value (f x)) in function (* better sharing than E.fcup (fun x -> e_value (f x)) *) | [] -> nothing | [x] -> m_value (f x) | x::xs -> m_vcup (f x) (m_fcup f xs) let cval x = Val_var x let cvar x = Loc_var x let shift (m:model) (k:value) = let share ~old mk e = (* for a better sharing between maps *) if e == old then m else mk e in match m with | Loc_var x -> Loc_shift(x,k) | Loc_shift(x,e) -> share ~old:e (fun k -> Loc_shift(x,k)) (E.cup e k) | Val_var x -> Val_shift(x,k) | Val_comp(x,e) -> share ~old:e (fun k -> Val_comp(x,k)) (E.cup e k) | Val_shift(x,e) -> share ~old:e (fun k -> Val_shift(x,k)) (E.cup e k) | E old -> share_vcup m old k let field = function | Val_var x -> Val_comp(x,E.bot) | (Val_comp _ | Val_shift _) as m -> m | m -> shift m E.bot let load = function | Loc_var x -> Val_var x (* E.access x ByValue E.bot *) | Loc_shift(x,e) -> if Cil.isArithmeticOrPointerType x.vtype then E (E.access x ByAddr e) else E (E.access x ByValue e) | Val_var x -> E (E.access x ByRef E.bot) | Val_comp(x,e) -> E (E.access x ByRef e) | Val_shift(x,e) -> E (E.access x ByArray e) | E _ as m -> m (* for \\valid, \\separated, \\block_length: no variable escape, excepts for shifts *) let unescape = function (* better than e_value (load m) *) | Loc_var x -> E.access x ByValue E.bot | Loc_shift(x,e) -> E.access x ByValue e | Val_var x -> E.access x ByRef E.bot | Val_comp(x,e) -> E.access x ByRef e | Val_shift(x,e) -> E.access x ByArray e | E e -> e (* ---------------------------------------------------------------------- *) (* --- Casts --- *) (* ---------------------------------------------------------------------- *) type cast = | Identity | Convert | Cast let cast cv m = match cv with | Identity -> m | Convert | Cast -> m_value m let cast_obj tgt src = match tgt , src with | (C_int _ | C_float _) , (C_int _ | C_float _) -> Convert | C_pointer tr , C_pointer te -> let obj_r = Ctypes.object_of tr in let obj_e = Ctypes.object_of te in if Ctypes.compare obj_r obj_e = 0 then Identity else Cast | _ -> if Ctypes.equal tgt src then Identity else Cast let cast_ctyp tgt src = cast_obj (Ctypes.object_of tgt) (Ctypes.object_of src) let cast_ltyp tgt src = match Logic_utils.unroll_type ~unroll_typedef:false src with | Ctype src -> cast_ctyp tgt src | _ -> Cast (* ---------------------------------------------------------------------- *) (* --- Environment --- *) (* ---------------------------------------------------------------------- *) module KFmap = Qed.Mergemap.Make(Kernel_function) module KFset = Qed.Mergeset.Make(Kernel_function) module LVmap = Qed.Mergemap.Make(Logic_var) module LFset = Qed.Mergeset.Make(Logic_info) type global_ctx = { (** Variable accesses from C code and code annotations *) mutable code : value ; (** Accesses of formal variables from function specs *) mutable spec_formals : value ; (** Accesses of global variables from function specs *) mutable spec_globals : value ; (** A map to a list (since a same kf can be called more than ones) to a list of models for each arg_exp of the call to the kf. *) mutable cphi : (model list list) KFmap.t ; (** Logical function/predicate used directly and indirectly by specs/annots of a C function *) mutable lphi : LFset.t ; } let mk_global_ctx () = { code = E.bot ; spec_formals = E.bot ; spec_globals = E.bot ; cphi = KFmap.empty ; lphi = LFset.empty } (* Temporary local context *) type local_ctx = { mutable tlet : model LVmap.t; (* for \\let var bound to a term *) mutable plet : value LVmap.t; (* for \\let var bound to a predicate *) mutable spec : value; (* for formals and globals of of spec, before partitioning the result *) } let mk_local_ctx () = { tlet=LVmap.empty ; plet=LVmap.empty ; spec=E.bot } type ctx = { local:local_ctx ; global:global_ctx } let mk_ctx () = { global = mk_global_ctx () ; local = mk_local_ctx () } (* ---------------------------------------------------------------------- *) (* --- Tlet --- *) (* ---------------------------------------------------------------------- *) (* For \\let binding a predicate *) let get_tlet (env:local_ctx) (lv:logic_var) = try LVmap.find lv env.tlet with Not_found -> assert (false) (* nothing *) let add_tlet (env:local_ctx) (lv:logic_var) (m:model) = env.tlet <- LVmap.insert (fun _ _ _old -> assert false) lv m env.tlet let rem_tlet (env:local_ctx) (lv:logic_var) = env.tlet <- LVmap.remove lv env.tlet (* ---------------------------------------------------------------------- *) (* --- Plet --- *) (* ---------------------------------------------------------------------- *) (* For \\let binding a predicate *) let get_plet (env:local_ctx) (lv:logic_var) = try LVmap.find lv env.plet with Not_found -> e_value (get_tlet env lv) let add_plet (env:local_ctx) (lv:logic_var) (e:value) = env.plet <- LVmap.insert (fun _ _ _old -> assert false) lv e env.plet let rem_plet (env:local_ctx) (lv:logic_var) = env.plet <- LVmap.remove lv env.plet (* ---------------------------------------------------------------------- *) (* --- Compilation of C-Expressions --- *) (* ---------------------------------------------------------------------- *) let rec vexpr (e:Cil_types.exp) : value = e_value (expr e) and mexpr (e:Cil_types.exp) : model = (* better sharing than E (vexpr e) *) m_value (expr e) and expr (e:Cil_types.exp) : model = match e.enode with (* Logics *) | Const _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> nothing (* Unary *) | UnOp((Neg|BNot|LNot),e,_) -> mexpr e (* Jessie *) | Info(e,_) -> expr e (* Binary *) | BinOp( (MinusPP|PlusA|MinusA|Mult|Div|Mod |Shiftlt|Shiftrt|BAnd|BXor|BOr|LAnd|LOr |Lt|Gt|Le|Ge|Eq|Ne), a,b,_ ) -> m_vcup (expr a) (vexpr b) (* Shifts *) | BinOp((PlusPI|IndexPI|MinusPI),a,b,_) -> shift (expr a) (vexpr b) (* Casts *) | CastE(ty_tgt,e) -> cast (cast_ctyp ty_tgt (Cil.typeOf e)) (expr e) (* Address *) | AddrOf lval -> lvalue lval | StartOf lval -> startof (lvalue lval) (Cil.typeOfLval lval) (* Load *) | Lval lval -> load (lvalue lval) and lvalue (h,ofs) = offset (host h) ofs and host = function | Var x -> cvar x | Mem e -> expr e and offset (m:model) = function | NoOffset -> m | Field(_,ofs) -> offset (field m) ofs | Index(e,ofs) -> offset (shift m (vexpr e)) ofs and startof (m:model) typ = if Cil.isArrayType typ then shift m E.bot else m (* ---------------------------------------------------------------------- *) (* --- Compilation of ACSL-Terms --- *) (* ---------------------------------------------------------------------- *) let rec vterm (env:ctx) (t:term) : value = e_value (term env t) and mterm (env:ctx) (t:term) : model = m_value (term env t) (* better sharing than E (vterm env e) *) and termopt (env:ctx) = function None -> nothing | Some t -> term env t (* --- Expr --- *) and term (env:ctx) (t:term) : model = match t.term_node with (* Logics *) | TConst _ | TSizeOf _ | TSizeOfE _ | TSizeOfStr _ | TAlignOf _ | TAlignOfE _ | Ttypeof _ | Ttype _ -> nothing (* Unary *) | TUnOp((Neg|BNot|LNot),t) -> mterm env t (* Binary *) | TBinOp( (MinusPP|PlusA|MinusA|Mult|Div|Mod |Shiftlt|Shiftrt|BAnd|BXor|BOr|LAnd|LOr |Lt|Gt|Le|Ge|Eq|Ne), a,b ) -> m_vcup (term env a) (vterm env b) (* Shifts *) | TBinOp((PlusPI|IndexPI|MinusPI),a,b) -> shift (term env a) (vterm env b) (* Casts *) | TCastE(ty_tgt,t) -> cast (cast_ltyp ty_tgt t.term_type) (term env t) | TLogic_coerce (_lt,t) -> term env t (* Term L-Values *) | TLval tlv -> term_lval env tlv | TAddrOf tlv | TStartOf tlv -> addr_lval env tlv | TUpdate(s,ofs,t) -> let v = term env s in let k = term_indices env E.bot ofs in let e = vterm env t in m_vcup (m_vcup v k) e (* Operators *) | Tat(t,_) -> term env t | Tunion ts | Tinter ts | TDataCons(_,ts) -> m_fcup (term env) ts | Tif(e,a,b) -> m_fcup (term env) [e;a;b] | Trange(a,b) -> m_fcup (termopt env) [a;b] | Toffset(_,t) | Tbase_addr(_,t) -> mterm env t | Tnull | Tempty_set -> nothing (* Binders *) | Tlambda(_xs,b) -> mterm env b | Tcomprehension(t,_xs,None) -> mterm env t | Tcomprehension(t,_xs,Some p) -> m_vcup (term env t) (pred env p) | Tlet({l_var_info; l_body = LBterm def},t) -> let m_def = term env def in add_tlet env.local l_var_info m_def; let m = term env t in rem_tlet env.local l_var_info; m | Tlet(_,_t) -> Wp_parameters.not_yet_implemented "unknown \\let construct" (* No escape *) | Tblock_length(_, t) -> E (unescape ((term env) t)) (* Call *) | Tapp({l_var_info=({lv_origin=None; lv_kind=LVLocal} as lvar)},[],[]) -> (* var bound by a \\let *) get_tlet env.local lvar | Tapp(phi,_,ts) -> v_model (v_lphi env phi ts) (* --- Lvalues --- *) and term_lval env (h,ofs) = match h with | TResult _ | TVar{lv_name="\\exit_status"} -> nothing | TVar( {lv_origin=None ; lv_kind=LVLocal} as lvar) -> (* var bound by a \\let *) load (term_offset env (get_tlet env.local lvar) ofs) | TVar( {lv_origin=None} ) -> (* logic variable *) nothing | TVar( {lv_origin=Some x} ) -> load (term_offset env (Loc_var x) ofs) | TMem t -> load (term_offset env (load (term env t)) ofs) and term_indices env v = function | TNoOffset -> v | TModel(_,ofs) | TField(_,ofs) -> term_indices env v ofs | TIndex(e,ofs) -> term_indices env (E.cup v (vterm env e)) ofs and term_offset env (l:model) = function | TNoOffset -> l | TField(_,ofs) -> term_offset env (field l) ofs | TIndex(e,ofs) -> term_offset env (shift l (vterm env e)) ofs | TModel _ -> Wp_parameters.not_yet_implemented "Model fields" and addr_lval env (h,ofs) = match h with | TResult _ -> Wp_parameters.abort ~current:true "Address of \\result" | TVar{lv_name="\\exit_status"} -> Wp_parameters.abort ~current:true "Address of \\exit_status" | TMem t -> term_offset env (term env t) ofs | TVar( {lv_origin=Some x} ) -> term_offset env (Loc_var x) ofs | TVar( {lv_origin=None} as x ) -> Wp_parameters.abort ~current:true "Address of logic variable (%a)" Logic_var.pretty x (* --- Predicates --- *) and pred (env:ctx) p : value = match p.pred_content with | Pfalse | Ptrue -> E.bot (* Unary *) | Pat(p,_) | Pnot p -> (pred env) p (* Binary *) | Pand(p1,p2) | Por(p1,p2) | Pxor(p1,p2) | Piff(p1,p2) | Pimplies(p1,p2) -> E.fcup (pred env) [p1; p2] | Pif (t,p1,p2) -> E.cup ((vterm env) t) (E.fcup (pred env) [p1; p2]) | Prel(_,t1,t2) -> E.fcup (vterm env) [t1; t2] (* Binders *) | Pforall(_,p) | Pexists(_,p) -> (pred env) p | Plet({l_var_info; l_body = LBterm def},p) -> let m_def = term env def in add_tlet env.local l_var_info m_def; let e = pred env p in rem_tlet env.local l_var_info; e | Plet({l_var_info; l_body = LBpred def},p) -> let e_def = pred env def in add_plet env.local l_var_info e_def; let e = pred env p in rem_plet env.local l_var_info; e | Plet(_,_t) -> Wp_parameters.not_yet_implemented "unknown \\let construct" (* Call *) | Papp({l_var_info=({lv_origin=None; lv_kind=LVLocal} as lvar)},[],[]) -> (* var bound by a \\let *) get_plet env.local lvar | Papp(phi,_,ts) -> v_lphi env phi ts (* No escape *) | Pinitialized(_, t) | Pdangling(_,t) | Pallocable(_, t) | Pfreeable(_, t) | Pvalid(_,t) | Pvalid_read (_,t) | Pvalid_function t -> unescape ((term env) t) | Pseparated ts -> E.fcup (fun t -> unescape ((term env) t)) ts | Pfresh(_, _, t1, t2) -> E.fcup (fun t -> unescape ((term env) t)) [t1;t2] (* --- Call to Logical functions/Predicates --- *) and v_lphi (env:ctx) (lphi:logic_info) ts : value = let not_yet_implemented s = Wp_parameters.not_yet_implemented "unknown construct with %s" s in match lphi.l_var_info.lv_kind with | LVC -> not_yet_implemented "LVC" | LVFormal -> not_yet_implemented "LVFormal" | LVQuant -> not_yet_implemented "LVQuant" | LVLocal -> not_yet_implemented "LVLocal" | LVGlobal -> let v_body = (* get the accesses the globals *) if not (LFset.mem lphi env.global.lphi) then begin env.global.lphi <- LFset.add lphi env.global.lphi; v_body env lphi.l_body end else E.bot and v_param = E.fcup (vterm env) ts (* usage of the parameter of the application *) in E.cup v_param v_body and v_body (env:ctx) = (* locals of the logical function are removed *) let vglob v = snd (E.partition_formals_vs_others v) in function | LBnone -> E.bot | LBreads(its) -> E.fcup (fun it -> vglob ((vterm env) it.it_content)) its | LBterm(t) -> vglob (vterm env t) | LBpred(p) -> vglob (pred env p) | LBinductive(inds) -> E.fcup (fun (_,_,_,p) -> vglob (pred env p)) inds (* ---------------------------------------------------------------------- *) (* --- Compilation of C Function --- *) (* ---------------------------------------------------------------------- *) let cinit vi init = let update_code_env a v = E.cup a v in let einit (m:model) a exp = update_code_env a (E.cup (e_value m) (vexpr exp)) in let rec aux (m: model) a = function | SingleInit (exp) -> einit m a exp | CompoundInit(_,loi) -> List.fold_left (fun a (ofs,init) -> aux (offset m ofs) a init) a loi in aux (cval vi) E.bot init let cfun_code env kf = (* Visits term/pred of code annotations and C exp *) let update_code_env v = env.global.code <- E.cup env.global.code v in let do_term t = update_code_env (vterm env t) in let do_pred p = update_code_env (pred env p) in let do_code = let do_arg arg = (* normalizing model: taking out access map *) match expr arg with (* in order to put it code_env *) | (Loc_var _ | Val_var _) as m -> m | (Loc_shift(_,e) | Val_shift(_,e)) as m when E.is_bot e -> m | Loc_shift(x,e) -> update_code_env e; Loc_shift(x,E.bot) | Val_shift(x,e) -> update_code_env e; Val_shift(x,E.bot) | Val_comp(x,e) -> update_code_env e; Val_comp(x,E.bot) | m when m == nothing -> m | E e -> update_code_env e ; nothing in let do_args kf args = env.global.cphi <- KFmap.insert (fun _ u old -> u @ old) kf [(List.map do_arg args)] env.global.cphi in let do_exp exp = update_code_env (vexpr exp) in let do_lval lval = update_code_env (e_value (load (lvalue lval))) in let do_lval_opt = function | None -> () | Some lval -> do_lval lval in function | Block _ | Break _ | Continue _ | Goto _ | Loop _ | UnspecifiedSequence _ | TryFinally _ | Return (None,_) | Instr(Asm _) | Instr(Skip _) | Instr(Code_annot _) -> () | Throw _ | TryCatch _ | TryExcept _ -> Wp_parameters.warning "RefUsage: throw/try-catch not implemented" | Instr(Set(lval,exp,_)) -> do_lval lval ; do_exp exp | Instr(Call(lval_opt,fun_exp,args_list,_)) -> begin do_lval_opt lval_opt ; match Kernel_function.get_called fun_exp with | None -> List.iter do_exp (fun_exp::args_list) | Some called_kf -> do_args called_kf args_list end | Instr(Local_init (v,AssignInit i,_)) -> update_code_env (cinit v i) | Instr(Local_init (v,ConsInit (f,args,kind),_)) -> let kf = Globals.Functions.get f in (match kind with | Constructor -> do_args kf (Cil.mkAddrOfVi v :: args) | Plain_func -> update_code_env (e_value (cval v)); do_args kf args) | Return(Some exp,_) | If (exp,_,_,_) | Switch (exp,_,_,_) -> do_exp exp in let visitor = object inherit Visitor.frama_c_inplace as super method! vstmt stmt = do_code stmt.skind; super#vstmt stmt (* vpredicate and vterm are called from vcode_annot *) method !vpredicate p = do_pred p ; Cil.SkipChildren method !vterm t = do_term t ; Cil.SkipChildren (* speed up: skip non interesting subtrees *) method! vloop_pragma _ = Cil.SkipChildren (* no need *) method! vvdec _ = Cil.SkipChildren (* done via stmt *) method! vexpr _ = Cil.SkipChildren (* done via stmt *) method! vlval _ = Cil.SkipChildren (* done via stmt *) method! vattr _ = Cil.SkipChildren (* done via stmt *) method! vinst _ = Cil.SkipChildren (* done via stmt *) end in try let definition = Kernel_function.get_definition kf in ignore (Cil.visitCilFunction (visitor:>Cil.cilVisitor) definition) with Not_found -> () let cfun_spec env kf = let update_spec_env v = env.local.spec <- E.cup env.local.spec v ; Cil.SkipChildren in let visitor = object inherit Cil.nopCilVisitor method !vpredicate p = update_spec_env (pred env p) method !vterm t = update_spec_env (vterm env t) end in let spec = Annotations.funspec kf in ignore (Cil.visitCilFunspec (visitor:>Cil.cilVisitor) spec) ; (* Partitioning the accesses of the spec for formals vs globals *) let formals,globals = E.partition_formals_vs_others env.local.spec in env.global.spec_formals <- formals ; env.global.spec_globals <- globals let cfun kf = let env = mk_ctx () in (* Skipping frama-c builtins? if not (Cil.is_builtin (Kernel_function.get_vi kf)) then *) begin if Kernel_function.is_definition kf then cfun_code env kf ; cfun_spec env kf end ; env.global let cvarinit vi initinfo env = match initinfo.init with | None -> env | Some init -> E.cup env (cinit vi init) (* ---------------------------------------------------------------------- *) (* --- Compilation --- *) (* ---------------------------------------------------------------------- *) let mk_context () = KFmap.empty let param a m = match a with | NoAccess | ByAddr -> E.bot (* should never arise *) | ByValue -> e_value m | ByRef -> e_value (load m) | ByArray -> e_value (load (shift m E.bot)) let update_call_env (env:global_ctx) v = let r,differ = E.cup_differ env.code v in env.code <- r ; differ let call_kf (env:global_ctx) (formals:access list) (models:model list) (reached:bool) = let unmodified = ref reached in let rec call xs ms = match xs, ms with | x::xs , m::ms -> let actual = param x m in if update_call_env env actual then unmodified := false; call xs ms | _ -> () in call formals models; !unmodified type callee = KFset.t type callees = callee KFmap.t type fp_t = { mutable todo: unit KFmap.t ; mutable redo: unit KFmap.t } let compute_usage () = Wp_parameters.feedback ~ontty:`Transient "Collecting variable usage" ; (* initial state from variable initializers *) let u_init = Globals.Vars.fold cvarinit E.bot in (* initial state by kf *) let usage = Globals.Functions.fold (fun kf env -> KFmap.insert (fun _ _u _old -> assert false) kf (cfun kf) env) (mk_context ()) in (* inverse table of function calls *) let callees = KFmap.fold (fun kf v (a:callees) -> KFmap.fold (fun called_kf _ (a:callees) -> KFmap.insert (fun _ v (old:callee) -> KFset.union old v) called_kf (KFset.add kf KFset.empty) a) v.cphi a) usage KFmap.empty in (* extract kf map to be fixed (the callers). *) let callers = KFmap.mapq (fun _kf v -> if KFmap.is_empty v.cphi then None else Some v) usage in (* extract it as a working list to be fixed *) let todo = KFmap.map (fun _ -> ()) callers in (* the todo map is used to intersect the callers map *) let kf_fp state_fp kf env _ = let kf_calls called_kf calls (reached:bool) = let called = try KFmap.find called_kf usage with Not_found -> assert false in (* update from accesses of globals of the called spec *) let reached = if update_call_env env called.spec_globals then false else reached in (* update from accesses of formals of the called spec for each calls*) let specs_formals = called.spec_formals in let params = Kernel_function.get_formals called_kf in let formals = List.map (fun vi -> E.get vi specs_formals) params in let kf_call reached call = call_kf env formals call reached in List.fold_left kf_call reached calls in state_fp.todo <- KFmap.remove kf state_fp.todo ; let cphi = env.cphi in let reached = KFmap.fold kf_calls cphi true in if not reached then begin let callers = try KFmap.find kf callees with Not_found -> KFset.empty in KFset.iter (fun kf_caller -> try ignore (KFmap.find kf_caller todo) (* kf_caller is still into the current remaining working list *) with Not_found -> (* kf_caller must be added to the next working list. *) state_fp.redo <- KFmap.add kf_caller () state_fp.redo) callers end; (* the intersect result is not used *) None in let rec fixpoint todo = if not (KFmap.is_empty todo) then let state_fp = {redo=KFmap.empty; todo} in ignore (KFmap.interf (kf_fp state_fp) callers todo); fixpoint state_fp.todo in fixpoint todo ; (* TODO[LC]: prendre en compte la compilation des fonctions logiques et predicats ; Cf. add_lphi *) let usage = KFmap.map (fun ctx -> E.cup (E.cup ctx.code ctx.spec_globals) ctx.spec_formals) usage in u_init, usage (* ---------------------------------------------------------------------- *) (* --- Projectified Analysis Result --- *) (* ---------------------------------------------------------------------- *) module D = Datatype.Make (struct type t = E.t * E.t KFmap.t include Datatype.Serializable_undefined let reprs = [E.bot,KFmap.empty] let name = "RefUsage.usage" end) module S = State_builder.Option_ref(D) (struct let name = "RefUsage.Analysis" let dependencies = [ Ast.self ] end) (* compute_usage is called once per project *) let usage () = S.memo compute_usage (* ---------------------------------------------------------------------- *) (* --- API --- *) (* ---------------------------------------------------------------------- *) let iter ?kf ?(init=false) f = let u_init, usage = usage () in let kf_access = match kf with | None -> E.bot | Some kf -> (try KFmap.find kf usage with Not_found -> E.bot) in let access = if init then E.cup kf_access u_init else kf_access in E.iter f access let get ?kf ?(init=false) vi = let u_init, usage = usage () in let kf_access = match kf with | None -> NoAccess | Some kf -> (try E.get vi (KFmap.find kf usage) with Not_found -> NoAccess) in if init then Access.cup kf_access (E.get vi u_init) else kf_access let compute () = ignore (usage ()) let print x m fmt = Access.pretty x fmt m let dump () = Log.print_on_output begin fun fmt -> Format.fprintf fmt ".................................................@\n" ; Format.fprintf fmt "... Ref Usage@\n" ; Format.fprintf fmt ".................................................@\n" ; let a_init, a_usage = usage () in Format.fprintf fmt "@[<hv 0>Init:@ %a@]@." E.pretty a_init ; KFmap.iter (fun kf m -> (* Do not dump results for frama-c builtins *) if not (Cil.is_builtin (Kernel_function.get_vi kf)) then Format.fprintf fmt "@[<hv 0>Function %a:@ %a@]@." Kernel_function.pretty kf E.pretty m ; ) a_usage; Format.fprintf fmt ".................................................@\n" ; end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RefUsage.mli����������������������������������������������������0000666�0000000�0000000�00000004674�13571573400�016330� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Variable Analysis --- *) (* -------------------------------------------------------------------------- *) open Cil_types (** By lattice order of usage *) type access = | NoAccess (** Never used *) | ByRef (** Only used as ["*x"], equals to [load(shift(load(&x),0))] *) | ByArray (** Only used as ["x[_]"], equals to [load(shift(load(&x),_))] *) | ByValue (** Only used as ["x"], equals to [load(&x)] *) | ByAddr (** Widely used, potentially up to ["&x"] *) val get : ?kf:kernel_function -> ?init:bool -> varinfo -> access val iter: ?kf:kernel_function -> ?init:bool -> (varinfo -> access -> unit) -> unit val print : varinfo -> access -> Format.formatter -> unit val dump : unit -> unit val compute : unit -> unit ��������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Region.ml�������������������������������������������������������0000666�0000000�0000000�00000052761�13571573400�015701� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_datatype open Layout module Wp = Wp_parameters (* -------------------------------------------------------------------------- *) (* --- Access Maps --- *) (* -------------------------------------------------------------------------- *) module Vmap = Varinfo.Map module Smap = Datatype.String.Map module Rmap = Qed.Intmap module Rset = Qed.Intset module Dmap = Qed.Listmap.Make(Offset) module Dset = Qed.Listset.Make(Deref) module Acs = Qed.Listset.Make(Lvalue) module Class = Qed.Listset.Make(Datatype.String) module Ranks = Qed.Listset.Make(Datatype.Int) type region = { id : int ; mutable garbled : bool ; mutable rw : bool ; mutable pack : bool ; mutable flat : bool ; mutable names : Class.t ; mutable alias : alias ; mutable delta : int Dmap.t ; mutable deref : Dset.t ; mutable read : Acs.t ; mutable written : Acs.t ; mutable shifted : Acs.t ; mutable copiedTo : Rset.t ; (* copies to *) mutable pointsTo : int option ; } type map = { cache : Offset.cache ; queue : int Queue.t ; mutable rid : int ; mutable vars : int Vmap.t ; mutable return : int ; (* -1 when undefined *) mutable strings : (int * string) Rmap.t ; (* eid -> rid *) mutable index : int Smap.t ; mutable region : region Rmap.t ; mutable aliasing : int Rmap.t ; mutable cluster : region cluster Rmap.t ; mutable roots : root Rmap.t ; mutable froms : region from list Rmap.t ; mutable mranks : Ranks.t Rmap.t ; (* set of sizeof(ds) accessed by shifting *) mutable mdims : int list Rmap.t ; (* common dim prefix accessed from cluster *) mutable domain : Rset.t ; (* reachable regions via clusters *) mutable chunk : region chunk Rmap.t ; (* memory chunks *) } let create () = { rid = 0 ; return = (-1) ; cache = Offset.cache () ; vars = Vmap.empty ; strings = Rmap.empty ; index = Smap.empty ; region = Rmap.empty ; aliasing = Rmap.empty ; queue = Queue.create () ; cluster = Rmap.empty ; roots = Rmap.empty ; froms = Rmap.empty ; mranks = Rmap.empty ; mdims = Rmap.empty ; domain = Rset.empty ; chunk = Rmap.empty ; } let noid = 0 let is_empty map = (map.rid = 0) let fresh map = let id = map.rid in map.rid <- succ id ; let region = { id ; garbled = false ; rw = RW.default () ; flat = Flat.default () ; pack = Pack.default () ; names = [] ; alias = NotUsed ; delta = Dmap.empty ; deref = Dset.empty ; read = Acs.empty ; written = Acs.empty ; shifted = Acs.empty ; copiedTo = Rset.empty ; pointsTo = None ; } in map.region <- Rmap.add id region map.region ; region (* -------------------------------------------------------------------------- *) (* --- Datatype --- *) (* -------------------------------------------------------------------------- *) module R = struct type t = region let id a = a.id let equal a b = (a.id = b.id) let compare a b = Pervasives.compare a.id b.id let pp_rid fmt id = Format.fprintf fmt "R%03d" id let pretty fmt r = pp_rid fmt r.id end module Map = Qed.Idxmap.Make(R) module Set = Qed.Idxset.Make(R) (* -------------------------------------------------------------------------- *) (* --- Union Find --- *) (* -------------------------------------------------------------------------- *) let rec aliasing map i = try let j = aliasing map (Rmap.find i map.aliasing) in if j <> i then map.aliasing <- Rmap.add i j map.aliasing ; j with Not_found -> i let linkto map i k = if i <> k then begin map.aliasing <- Rmap.add i k map.aliasing ; Queue.add i map.queue ; end let region map r = try Rmap.find (aliasing map r) map.region with Not_found -> failwith "Wp.Region: Undefined Region" let join_classes map i j = let k = min i j in (linkto map i k ; linkto map j k ; k) let join_id map i j = let i = aliasing map i in let j = aliasing map j in if i = j then i else join_classes map i j let join_region map ra rb = let i = aliasing map ra.id in let j = aliasing map rb.id in let k = join_classes map i j in if k = i then ra else if k = j then rb else (* defensive *) region map k (* -------------------------------------------------------------------------- *) (* --- Aliasing --- *) (* -------------------------------------------------------------------------- *) let alias map a b = let k = join_id map a.id b.id in let r = region map k in r.alias <- Aliased ; r let do_alias map a b = ignore (alias map a b) let add_alias map ~into:a b = let i = aliasing map a.id in let j = aliasing map b.id in let wa = (region map i).alias in let wb = (region map j).alias in let k = join_classes map i j in (* Aliasing has changed *) (region map k).alias <- Alias.alias wa (Alias.use wb) let get_merged map r = let i = aliasing map r.id in if i <> r.id then Some (region map i) else None let get_alias map r = let i = aliasing map r.id in if i <> r.id then region map i else r let eq_alias map a b = (aliasing map a.id = aliasing map b.id) (* -------------------------------------------------------------------------- *) (* --- General Iterator --- *) (* -------------------------------------------------------------------------- *) let once mark r = if Rset.mem r.id !mark then false else ( mark := Rset.add r.id !mark ; true ) let iter map f = let do_once marks f r = if once marks r then f r else () in Rmap.iter (do_once (ref Rset.empty) f) map.region (* -------------------------------------------------------------------------- *) (* --- Region Accessor --- *) (* -------------------------------------------------------------------------- *) let id reg = reg.id let is_garbled reg = reg.garbled let has_pointed reg = reg.pointsTo <> None let has_deref reg = not (Dset.is_empty reg.deref) let has_layout reg = not (Dmap.is_empty reg.delta) let has_offset reg d = Dmap.mem d reg.delta let iter_offset map f reg = Dmap.iter (fun ofs r -> f ofs (region map r)) reg.delta let has_copies reg = not (Rset.is_empty reg.copiedTo) let iter_copies map f reg = Rset.iter (fun r -> f (region map r)) reg.copiedTo let add_offset map reg d = try region map (Dmap.find d reg.delta) with Not_found -> let rd = fresh map in reg.delta <- Dmap.add d rd.id reg.delta ; rd let add_pointed map reg = match reg.pointsTo with | Some k -> region map k | None -> let r = fresh map in reg.pointsTo <- Some r.id ; r let get_addrof map reg = let addr = fresh map in addr.pointsTo <- Some reg.id ; addr let get_pointed map reg = match reg.pointsTo with | None -> None | Some r -> Some (region map r) let get_offset map reg d = try Some (region map (Dmap.find d reg.delta)) with Not_found -> None let get_copies map reg = List.map (region map) (Rset.elements reg.copiedTo) (* -------------------------------------------------------------------------- *) (* --- Access --- *) (* -------------------------------------------------------------------------- *) let acs_read rg lvalue = rg.read <- Acs.add lvalue rg.read let acs_write rg lvalue = rg.written <- Acs.add lvalue rg.written let acs_shift rg lvalue = rg.shifted <- Acs.add lvalue rg.shifted let acs_deref rg deref = rg.deref <- Dset.add deref rg.deref let acs_copy ~src ~tgt = if tgt.id <> src.id then src.copiedTo <- Rset.add tgt.id src.copiedTo let iter_read f rg = Acs.iter f rg.read let iter_write f rg = Acs.iter f rg.written let iter_shift f rg = Acs.iter f rg.shifted let iter_deref f rg = Dset.iter f rg.deref let is_read rg = not (Acs.is_empty rg.read) let is_written rg = not (Acs.is_empty rg.written) let is_shifted rg = not (Acs.is_empty rg.shifted) let is_aliased rg = Alias.is_aliased rg.alias (* -------------------------------------------------------------------------- *) (* --- Varinfo Index --- *) (* -------------------------------------------------------------------------- *) let rvar map x r = let reg = region map r in if reg.id <> r then map.vars <- Vmap.add x reg.id map.vars ; reg let of_null map = fresh map (* A fresh region each time: polymorphic *) let of_cvar map x = try rvar map x (Vmap.find x map.vars) with Not_found -> let reg = fresh map in map.vars <- Vmap.add x reg.id map.vars ; reg let of_return map = if map.return < 0 then let reg = fresh map in map.return <- reg.id ; reg else region map map.return let has_return map = 0 <= map.return let iter_vars map f = Vmap.iter (fun x r -> f x (rvar map x r)) map.vars (* -------------------------------------------------------------------------- *) (* --- Field Info Index --- *) (* -------------------------------------------------------------------------- *) let field_offset map fd = Offset.field_offset map.cache fd (* -------------------------------------------------------------------------- *) (* --- String Literal Index --- *) (* -------------------------------------------------------------------------- *) let of_cstring map ~eid ~cst = try region map (fst @@ Rmap.find eid map.strings) with Not_found -> let reg = fresh map in map.strings <- Rmap.add eid (reg.id,cst) map.strings ; reg let iter_strings map f = Rmap.iter (fun (rid,cst) -> f (region map rid) cst) map.strings (* -------------------------------------------------------------------------- *) (* --- Region Index --- *) (* -------------------------------------------------------------------------- *) let rindex map a r = let reg = region map r in if reg.id <> r then map.index <- Smap.add a reg.id map.index ; reg let of_name map a = try rindex map a (Smap.find a map.index) with Not_found -> let reg = fresh map in reg.names <- [a] ; map.index <- Smap.add a reg.id map.index ; reg let of_class map = function | None -> fresh map | Some a -> of_name map a let has_names reg = not (Class.is_empty reg.names) let iter_names map f = Smap.iter (fun a r -> f a (rindex map a r)) map.index (* -------------------------------------------------------------------------- *) (* --- Fusion --- *) (* -------------------------------------------------------------------------- *) let merge_pointed map u v = match u,v with | None , w | w , None -> w | Some i , Some j -> Some (join_id map i j) let merge_delta map _d a b = join_id map a b let merge_region map ~id a b = { id ; garbled = a.garbled || b.garbled ; rw = RW.merge a.rw b.rw ; flat = Flat.merge a.flat b.flat ; pack = Pack.merge a.pack b.pack ; alias = Alias.merge a.alias b.alias ; names = Class.union a.names b.names ; read = Acs.union a.read b.read ; written = Acs.union a.written b.written ; shifted = Acs.union a.shifted b.shifted ; copiedTo = Rset.union a.copiedTo b.copiedTo ; pointsTo = merge_pointed map a.pointsTo b.pointsTo ; delta = Dmap.union (merge_delta map) a.delta b.delta ; deref = Dset.union a.deref b.deref ; } let fusion map = while not (Queue.is_empty map.queue) do let i = Queue.pop map.queue in let j = aliasing map i in if i <> j then begin if not (Wp.Region_fixpoint.get ()) then Wp.debug "Region %a -> %a" R.pp_rid i R.pp_rid j ; let a = try Rmap.find i map.region with Not_found -> assert false in let b = try Rmap.find j map.region with Not_found -> assert false in assert (i = a.id) ; assert (j = b.id ) ; let c = merge_region map ~id:j a b in map.region <- Rmap.add j c (Rmap.remove i map.region) ; end done let fusionned map = not (Queue.is_empty map.queue) let iter_fusion map f = Queue.iter (fun i -> f i (region map i)) map.queue (* -------------------------------------------------------------------------- *) (* --- Garbling --- *) (* -------------------------------------------------------------------------- *) let rec garblify map reg = if not reg.garbled then begin reg.garbled <- true ; Dmap.iter (fun _delta r -> garblify map (region map r) ; ignore (join_id map reg.id r) ; ) reg.delta ; reg.delta <- Dmap.empty ; end (* -------------------------------------------------------------------------- *) (* --- Clustering --- *) (* -------------------------------------------------------------------------- *) let cluster map reg = try Rmap.find reg.id map.cluster with Not_found -> Layout.Empty module Cluster = struct open Layout let rec from_region map reg = try Rmap.find reg.id map.cluster with Not_found -> if reg.garbled then Garbled else if not (Wp.Region_cluster.get ()) then Empty else begin map.cluster <- Rmap.add reg.id Empty map.cluster ; let mu ~raw ra rb = if raw then begin garblify map ra ; garblify map rb ; end ; join_region map ra rb in let cluster = if has_layout reg then Cluster.reshape ~eq:R.equal ~flat:reg.flat ~pack:reg.pack @@ from_layout map mu reg else from_deref map mu reg in if cluster = Garbled then garblify map reg ; map.cluster <- Rmap.add reg.id cluster map.cluster ; cluster end and from_deref map mu reg = let pointed = lazy (add_pointed map reg) in List.fold_left (fun chunk deref -> Cluster.merge R.pretty mu chunk (Cluster.deref ~pointed deref) ) Empty reg.deref and from_layout map mu reg = Dmap.fold (fun offset tgt acc -> let layout = shift map offset (region map tgt) in Cluster.merge R.pretty mu (Layout layout) acc ) reg.delta Empty and shift map offset target = let inline = Wp.Region_inline.get () || not (is_aliased target) in let cluster = from_region map target in Cluster.shift map.cache R.pretty offset target ~inline cluster let compute map reg = begin if has_layout reg && has_deref reg then begin Dset.iter (fun deref -> let target = add_offset map reg (Index(snd deref,1)) in target.read <- Acs.union reg.read target.read ; target.written <- Acs.union reg.written target.written ; acs_deref target deref ) reg.deref ; reg.deref <- Dset.empty ; reg.read <- Acs.empty ; reg.written <- Acs.empty ; Queue.add reg.id map.queue ; end ; ignore (from_region map reg) ; end end (* -------------------------------------------------------------------------- *) (* --- Froms Analysis --- *) (* -------------------------------------------------------------------------- *) let get_froms map reg = try Rmap.find reg.id map.froms with Not_found -> [] let add_from map ~from ~target = let rs = get_froms map target in map.froms <- Rmap.add target.id (from :: rs) map.froms module Froms = struct open Layout let rec forward map marks ~source ~from ~target = map.domain <- Rset.add source.id map.domain ; add_from map ~from ~target ; if once marks target then add_region map marks target and add_region map marks reg = begin add_points_to map marks ~source:reg reg.pointsTo ; add_cluster map marks ~source:reg (cluster map reg) ; end and add_points_to map marks ~source = function | None -> () | Some p -> add_deref map marks ~source ~target:(region map p) and add_deref map marks ~source ~target = let from = if is_shifted target then Farray source else Fderef source in forward map marks ~source ~from ~target and add_cluster map marks ~source = function | Empty | Garbled | Chunk (Int _ | Float _) -> () | Chunk (Pointer target) -> add_deref map marks ~source ~target | Layout { layout } -> List.iter (add_range map marks ~source) layout and add_range map marks ~source = function | { ofs ; reg = target ; dim = Dim(_,[]) } -> forward map marks ~source ~from:(Ffield(source,ofs)) ~target | { reg = target } -> forward map marks ~source ~from:(Findex source) ~target end (* -------------------------------------------------------------------------- *) (* --- Roots Analysis --- *) (* -------------------------------------------------------------------------- *) let get_roots map reg = try Rmap.find reg.id map.roots with Not_found -> Rnone let has_roots map reg = get_roots map reg <> Rnone module Roots = struct let rec of_region map region = try Rmap.find region.id map.roots with Not_found -> let froms = get_froms map region in let roots = List.fold_left (fun roots from -> Root.merge roots (Root.from ~root:(of_region map) from) ) Rnone froms in map.roots <- Rmap.add region.id roots map.roots ; roots let compute map reg = ignore (of_region map reg) end (* -------------------------------------------------------------------------- *) (* --- Forward & Backward Propagation --- *) (* -------------------------------------------------------------------------- *) let forward map = begin let marks = ref Rset.empty in map.domain <- Rset.empty ; Vmap.iter (fun x r -> let reg = region map r in let open Cil_types in if x.vglob || x.vformal then add_from map ~from:(Fvar x) ~target:(region map r) ; Froms.add_region map marks reg ; ) map.vars ; end let backward map = begin Rmap.iter (Roots.compute map) map.region ; end (* -------------------------------------------------------------------------- *) (* --- Chunk Analysis --- *) (* -------------------------------------------------------------------------- *) let rec chunk map region = try Rmap.find region.id map.chunk with Not_found -> let roots = get_roots map region in let chunk = match cluster map region with | Empty | Garbled -> Mraw (roots,get_pointed map region) | Chunk v -> if is_read region || is_written region then Mmem(roots,v) else begin match v with | Pointer r -> Mref r | _ -> Mraw (roots,get_pointed map region) end | Layout { layout } -> let chunks = Chunk.union_map (fun { reg } -> chunks map reg) layout in Mcomp(chunks,layout) in map.chunk <- Rmap.add region.id chunk map.chunk ; chunk and chunks map region = match chunk map region with | Mcomp(rs,_) -> rs | _ -> Chunk.singleton region.id (* -------------------------------------------------------------------------- *) (* --- Fixpoint --- *) (* -------------------------------------------------------------------------- *) let fixpoint map = begin let turn = ref 0 in let loop = ref true in while !loop do incr turn ; Wp.feedback ~ontty:`Transient "Region clustering (loop #%d)" !turn ; fusion map ; map.cluster <- Rmap.empty ; iter map (Cluster.compute map) ; loop := fusionned map ; done ; Wp.feedback ~ontty:`Transient "Region forward analysis" ; forward map ; Wp.feedback ~ontty:`Transient "Region backward analysis" ; backward map ; Wp.feedback ~ontty:`Transient "Region fixpoint reached" ; end (* -------------------------------------------------------------------------- *) ���������������frama-c-20.0-Calcium/src/plugins/wp/Region.mli������������������������������������������������������0000666�0000000�0000000�00000010366�13571573400�016045� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Layout type region type map module R : Layout.Data with type t = region module Map : Qed.Idxmap.S with type key = region module Set : Qed.Idxset.S with type elt = region val create : unit -> map val is_empty : map -> bool val iter : map -> (region -> unit) -> unit val id: region -> int val noid: int val get_addrof : map -> region -> region val add_pointed : map -> region -> region val add_offset : map -> region -> offset -> region val field_offset : map -> fieldinfo -> int * int val get_froms : map -> region -> region from list val get_roots : map -> region -> root val has_roots : map -> region -> bool val is_garbled : region -> bool val has_pointed : region -> bool val has_layout : region -> bool val has_offset : region -> offset -> bool val has_copies : region -> bool val has_deref : region -> bool val has_names : region -> bool val has_return : map -> bool val get_pointed : map -> region -> region option val get_offset : map -> region -> offset -> region option val get_copies : map -> region -> region list val get_alias : map -> region -> region val get_merged : map -> region -> region option val eq_alias : map -> region -> region -> bool val acs_read : region -> lvalue -> unit val acs_write : region -> lvalue -> unit val acs_shift : region -> lvalue -> unit val acs_deref : region -> deref -> unit val acs_copy : src:region -> tgt:region -> unit val is_read : region -> bool val is_written : region -> bool val is_shifted : region -> bool val is_aliased : region -> bool val iter_read : (lvalue -> unit) -> region -> unit val iter_write : (lvalue -> unit) -> region -> unit val iter_shift : (lvalue -> unit) -> region -> unit val iter_deref : (deref -> unit) -> region -> unit val iter_offset : map -> (offset -> region -> unit) -> region -> unit val iter_copies : map -> (region -> unit) -> region -> unit val iter_vars : map -> (varinfo -> region -> unit) -> unit val iter_names : map -> (string -> region -> unit) -> unit val iter_strings : map -> (region -> string -> unit) -> unit val of_null : map -> region val of_return : map -> region val of_cvar : map -> varinfo -> region val of_cstring : map -> eid:int -> cst:string -> region val of_name : map -> string -> region val of_class : map -> string option -> region val region : map -> int -> region val cluster : map -> region -> region cluster val chunk : map -> region -> region chunk val chunks : map -> region -> chunks val alias : map -> region -> region -> region val do_alias : map -> region -> region -> unit val add_alias : map -> into:region -> region -> unit val fusion : map -> unit val fusionned : map -> bool val iter_fusion : map -> (int -> region -> unit) -> unit val fixpoint : map -> unit ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RegionAccess.ml�������������������������������������������������0000666�0000000�0000000�00000037411�13571573400�017016� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Layout open Region (* -------------------------------------------------------------------------- *) (* --- Location Compiler --- *) (* -------------------------------------------------------------------------- *) type addr = { addrof : Region.region ; typeOfPointed : typ ; shift : bool ; } type value = | Pure | Read_at of typ * region | Addr_of of addr [@@@ warning "-32"] let pp_value fmt = function | Pure -> Format.pp_print_string fmt "scalar" | Read_at(_,r) -> Format.fprintf fmt "read %a" R.pretty r | Addr_of a -> if a.shift then Format.fprintf fmt "addr %a+" R.pretty a.addrof else Format.fprintf fmt "addr %a" R.pretty a.addrof [@@@ warning "+32"] (* -------------------------------------------------------------------------- *) (* --- Strings --- *) (* -------------------------------------------------------------------------- *) let cc_string map exp = let cst = Pretty_utils.to_string Cil_datatype.Exp.pretty exp in let addrof = Region.of_cstring map ~eid:exp.eid ~cst in { addrof ; typeOfPointed = Cil.charType ; shift=false } (* -------------------------------------------------------------------------- *) (* --- Reading Values --- *) (* -------------------------------------------------------------------------- *) let read acs = function | Pure -> () | Addr_of _ -> () | Read_at(tr,r) -> acs_deref r (Value,tr) ; acs_read r acs let points_to = function { shift ; addrof = pointed ; typeOfPointed = typ } -> acs_deref pointed ((if shift then Array else Deref),typ) let addrof map = function | Pure -> failwith "Wp.Region: physical address" | Read_at(tr,r) -> acs_deref r (Value,tr) ; { addrof = add_pointed map r ; typeOfPointed = Cil.typeOf_pointed tr ; shift = false ; } | Addr_of addr -> addr let cast ty value = if Cil.isPointerType ty then match value with | Addr_of addr -> Addr_of { addr with typeOfPointed = Cil.typeOf_pointed ty } | Read_at (_,r) -> Read_at(ty,r) | Pure -> Pure else value let is_pointer_value = function | Pure -> false | Addr_of _ -> true | Read_at(tr,_) -> Cil.isPointerType tr let merge_type t t' = if Cil.isVoidType t then t' else if Cil.isVoidType t' then t else if Cil_datatype.Typ.equal t t' then t else failwith "Wp.Region: merge incompatible pointer types" let merge_addrof (map:map) v1 v2 = if not (is_pointer_value v1) then v2 else if not (is_pointer_value v2) then v1 else let a1 = addrof map v1 in let a2 = addrof map v2 in let typeOfPointed = merge_type a1.typeOfPointed a2.typeOfPointed in let addrof = Region.alias map a1.addrof a2.addrof in let shift = a1.shift || a2.shift in Addr_of { addrof ; typeOfPointed ; shift } (* -------------------------------------------------------------------------- *) (* --- Expressions & L-values --- *) (* -------------------------------------------------------------------------- *) let rec cc_exp (map:map) exp = match exp.enode with | BinOp( (PlusPI | IndexPI | MinusPI) , a , b , _ ) -> cc_read map b ; let { addrof = pointed } as addr = cc_addr map a in acs_shift pointed (Eval exp) ; Addr_of { addr with shift = true } | AddrOf lv | StartOf lv -> Addr_of { addrof = cc_lval map lv ; typeOfPointed = Cil.typeOfLval lv ; shift = false ; } | Lval lv -> Read_at (Cil.typeOfLval lv , cc_lval map lv) | CastE(ty,e) -> cast ty (cc_exp map e) | Info(e,_) -> cc_exp map e | Const (CStr _ | CWStr _) -> Addr_of (cc_string map exp) | Const (CInt64 _ | CChr _ | CEnum _ | CReal _) | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | AlignOfE _ -> Pure | UnOp(_,e,ty) -> assert (not (Cil.isPointerType ty)) ; cc_read map e ; Pure | BinOp(_,a,b,ty) -> assert (not (Cil.isPointerType ty)) ; cc_read map a ; cc_read map b ; Pure and cc_host map = function | Var x -> of_cvar map x , x.vtype | Mem e -> let a = cc_addr map e in points_to a ; (* deref, not read !*) a.addrof , a.typeOfPointed and cc_lval map (host , offset) = let r,ty = cc_host map host in cc_offset map r ty offset and cc_offset map r ty = function | Cil_types.NoOffset -> r | Cil_types.Field(fd,ofs) -> let df = Offset.field fd in cc_offset map (add_offset map r df) fd.ftype ofs | Cil_types.Index(e,ofs) -> cc_read map e ; let de = Offset.index ty in let te = Offset.typeof de in cc_offset map (add_offset map r de) te ofs and cc_addr map a = addrof map (cc_exp map a) and cc_read map e = read (Eval e) (cc_exp map e) and cc_comp map e = match cc_exp map e with | Pure | Addr_of _ -> failwith "Wp.Region: comp expected" | Read_at(_,r) -> r let cc_writes map stmt tgt typ e = acs_deref tgt (Value,typ) ; acs_write tgt (Assigned stmt) ; match Cil.unrollType typ with | TPtr _ -> let a = cc_addr map e in points_to a ; (* deref, not read! *) do_alias map a.addrof (add_pointed map tgt) | TComp _ -> let src = cc_comp map e in acs_copy ~src ~tgt | _ -> cc_read map e let cc_assign map stmt lv e = cc_writes map stmt (cc_lval map lv) (Cil.typeOfLval lv) e let cc_return map stmt e = cc_writes map stmt (Region.of_return map) (Cil.typeOf e) e (* -------------------------------------------------------------------------- *) (* --- Stmt & Instructions --- *) (* -------------------------------------------------------------------------- *) let rec cc_init map stmt lv = function | SingleInit e -> cc_assign map stmt lv e | CompoundInit(_,content) -> List.iter (fun (ofs,vi) -> cc_init map stmt (Cil.addOffsetLval ofs lv) vi ) content let cc_local_init map stmt x = function | AssignInit vi -> cc_init map stmt (Var x,NoOffset) vi | ConsInit _ -> failwith "Wp.Region: cons-init not implemented" let cc_instr map stmt = function | Set(lv,e,_) -> cc_assign map stmt lv e | Call _ -> failwith "Wp.Region: call not implemented" | Local_init(x,vi,_) -> cc_local_init map stmt x vi | Asm _ | Skip _ | Code_annot _ -> () let cc_skind map stmt = match stmt.skind with | Instr instr -> cc_instr map stmt instr | Return(Some ve,_) -> cc_return map stmt ve | If(e,_,_,_) -> cc_read map e | Switch(e,_,_,_) -> cc_read map e | Return(None,_) | Goto _ | Break _ | Continue _ | Loop _ | Block _ | UnspecifiedSequence _ | Throw _ | TryCatch _ | TryFinally _ | TryExcept _ -> () (* -------------------------------------------------------------------------- *) (* --- ACSL Terms --- *) (* -------------------------------------------------------------------------- *) let rec cc_term map t = read (Tval t) (cc_term_value map t) and cc_term_value (map:map) (term:term) = match term.term_node with | TLval lv -> begin match cc_term_lval map lv with | None -> Pure | Some(ty,reg) -> Read_at(ty,reg) end | TAddrOf lv | TStartOf lv -> begin match cc_term_lval map lv with | None -> failwith "Wp.Region: pure term-value" | Some(ty,reg) -> Addr_of { addrof = reg ; typeOfPointed = ty ; shift = false ; } end | TBinOp( (PlusPI | IndexPI | MinusPI) , a , b ) -> begin cc_term map b ; let { addrof = pointed } as addr = cc_term_addr map a in acs_shift pointed (Tval term) ; Addr_of { addr with shift = true } end | Tnull -> Addr_of { addrof = Region.of_null map ; typeOfPointed = Cil.charType ; shift = false ; } | TUnOp(_,a) -> cc_term map a ; Pure | TBinOp(_,a,b) -> cc_term map a ; cc_term map b ; Pure | Tat(t,_) -> cc_term_value map t | TCastE(ty,t) -> cast ty @@ cc_term_value map t | TLogic_coerce (Ctype ty,t) -> cast ty @@ cc_term_value map t | TLogic_coerce (_,t) -> cc_term_value map t | TConst _ | TSizeOf _ | TSizeOfE _ | TSizeOfStr _ | TAlignOf _ | TAlignOfE _ | Ttype _ | Ttypeof _ -> Pure | TDataCons(_,ts) -> List.iter (cc_term map) ts ; Pure | TUpdate(w,ofs,v) -> cc_term map w ; cc_term map v ; cc_term_offset_read map ofs ; Pure | Tbase_addr(_at,t) -> cast Cil.voidPtrType @@ cc_term_value map t | Tblock_length(_at,t) | Toffset(_at,t) -> cc_term map t ; Pure | Tif(c,a,b) -> cc_term map c ; merge_addrof map (cc_term_value map a) (cc_term_value map b) | Tempty_set -> Pure | Tunion ts | Tinter ts -> List.fold_left (fun v t -> merge_addrof map v (cc_term_value map t)) Pure ts | Tcomprehension(t,_,None) -> cc_term_value map t | Tcomprehension(t,_,Some p) -> cc_pred map p ; cc_term_value map t | Trange(a,b) -> cc_term_option map a ; cc_term_option map b ; Pure | Tlet _ | Tlambda _ | Tapp _ -> failwith "Wp.Region: unsupported logic functions and bindings" and cc_term_lval map (lhost,loffset) = match lhost with | TResult typ -> Some(typ,of_return map) | TVar lvar -> begin match lvar.lv_origin with | Some x -> let ty,rv = cc_term_offset map (of_cvar map x) x.vtype loffset in Some(ty,rv) | None -> cc_term_offset_read map loffset ; None end | TMem p -> begin let a = cc_term_addr map p in points_to a ; let ty,ra = cc_term_offset map a.addrof a.typeOfPointed loffset in Some(ty,ra) end and cc_term_offset map r ty = function | TNoOffset -> ty,r | TField(fd,ofs) -> let df = Offset.field fd in cc_term_offset map (add_offset map r df) fd.ftype ofs | TIndex(t,ofs) -> cc_term map t ; let de = Offset.index ty in let te = Offset.typeof de in cc_term_offset map (add_offset map r de) te ofs | TModel _ -> failwith "Wp.Region: model field" and cc_term_offset_read map = function | TNoOffset -> () | TField(_,ofs) -> cc_term_offset_read map ofs | TModel(_,ofs) -> cc_term_offset_read map ofs | TIndex(t,ofs) -> cc_term map t ; cc_term_offset_read map ofs and cc_term_addr map t = addrof map @@ cc_term_value map t and cc_term_option map = function None -> () | Some t -> cc_term map t (* -------------------------------------------------------------------------- *) (* --- ACSL Predicates --- *) (* -------------------------------------------------------------------------- *) and cc_pred (map:map) (p:predicate) = match p.pred_content with | Pfalse | Ptrue -> () | Prel(_,a,b) -> cc_term map a ; cc_term map b | Pnot a -> cc_pred map a | Pif(t,a,b) -> cc_term map t ; cc_pred map a ; cc_pred map b | Pand(a,b) | Por(a,b) | Pxor(a,b) | Pimplies(a,b) | Piff(a,b) -> cc_pred map a ; cc_pred map b | Pforall(_,p) | Pexists(_,p) -> cc_pred map p | Pseparated ts -> List.iter (cc_term map) ts | Pvalid(_,t) | Pvalid_read(_,t) | Pvalid_function t | Pinitialized(_,t) | Pdangling(_,t) | Pallocable(_,t) | Pfreeable(_,t) -> cc_term map t | Pfresh(_,_,ptr,n) -> cc_term map ptr ; cc_term map n | Pat(p,_at) -> cc_pred map p | Plet _ | Papp _ -> failwith "Wp.Region: unsupported logic predicates and bindings" (* -------------------------------------------------------------------------- *) (* --- ACSL Spec & Defs --- *) (* -------------------------------------------------------------------------- *) class visitor map = object inherit Visitor.frama_c_inplace as super method! vpredicate p = cc_pred map p ; Cil.SkipChildren method! vterm t = cc_term map t ; Cil.SkipChildren method! vstmt s = cc_skind map s ; super#vstmt s (* vpredicate and vterm are called from vcode_annot *) (* speed up: skip non interesting subtrees *) method! vloop_pragma _ = Cil.SkipChildren (* no need *) method! vvdec _ = Cil.SkipChildren (* done via stmt *) method! vexpr _ = Cil.SkipChildren (* done via stmt *) method! vlval _ = Cil.SkipChildren (* done via stmt *) method! vattr _ = Cil.SkipChildren (* done via stmt *) method! vinst _ = Cil.SkipChildren (* done via stmt *) end let cc_fundec map def = let visitor = new visitor map in ignore (Cil.visitCilFunction (visitor:>Cil.cilVisitor) def) let cc_spec map spec = let visitor = new visitor map in ignore (Cil.visitCilFunspec (visitor:>Cil.cilVisitor) spec) (* -------------------------------------------------------------------------- *) (* --- L-path Iterator --- *) (* -------------------------------------------------------------------------- *) open RegionAnnot let iter_star map f t r = let pointed = add_pointed map r in acs_deref pointed (Deref,t) ; f pointed let iter_shift map f t r = let pointed = add_pointed map r in acs_deref pointed (Array,t) ; f r let iter_index map f tarr r = f (add_offset map r (Offset.index tarr)) let iter_fields map f fds r = List.iter (fun fd -> f (add_offset map r (Offset.field fd))) fds let rec iter_lpath map f lv = match lv.lnode with | L_var x -> f (of_cvar map x) | L_region a -> f (of_name map a) | L_cast(_,a) -> iter_lpath map f a | L_addr a -> iter_lpath map (fun r -> f (get_addrof map r)) a | L_star(te,a) -> iter_lpath map (iter_star map f te) a | L_shift(a,te,_) -> iter_lpath map (iter_shift map f te) a | L_index(a,_,_) -> iter_lpath map (iter_index map f lv.ltype) a | L_field(a,fs) -> iter_lpath map (iter_fields map f fs) a (* -------------------------------------------------------------------------- *) (* --- Region Specs --- *) (* -------------------------------------------------------------------------- *) let cc_lpath map rclass _rpattern lv = iter_lpath map (Region.add_alias map ~into:rclass) lv let cc_region map spec = let rclass = Region.of_class map spec.region_name in let rpattern = spec.region_pattern in List.iter (cc_lpath map rclass rpattern) spec.region_lpath (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RegionAccess.mli������������������������������������������������0000666�0000000�0000000�00000004267�13571573400�017172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Region (* -------------------------------------------------------------------------- *) val cc_lval : map -> lval -> region val cc_read : map -> exp -> unit val cc_assign : map -> stmt -> lval -> exp -> unit val cc_init : map -> stmt -> lval -> init -> unit val cc_instr : map -> stmt -> instr -> unit val cc_fundec : map -> fundec -> unit val cc_pred : map -> predicate -> unit val cc_term : map -> term -> unit val cc_spec : map -> spec -> unit open RegionAnnot val cc_region : map -> region_spec -> unit (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RegionAnalysis.ml�����������������������������������������������0000666�0000000�0000000�00000010471�13571573400�017375� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types module Wp = Wp_parameters module Kf = Kernel_function (* ---------------------------------------------------------------------- *) (* --- Compute Analysis --- *) (* ---------------------------------------------------------------------- *) let compute kf = let map = Region.create () in if Kf.is_definition kf then begin Wp.feedback ~ontty:`Transient "[region] Analyzing %a" Kf.pretty kf ; let def = Kf.get_definition kf in RegionAccess.cc_fundec map def ; let spec = Annotations.funspec kf in RegionAccess.cc_spec map spec ; List.iter (fun bhv -> let region_specs = RegionAnnot.of_behavior bhv in if region_specs <> [] then if Cil.is_default_behavior bhv then List.iter (RegionAccess.cc_region map) region_specs else Wp.warning ~once:true "Region specifications in non-default behaviours are skipped." ) spec.spec_behavior ; if Wp.Region_fixpoint.get () then Region.fixpoint map ; end ; map (* ---------------------------------------------------------------------- *) (* --- Projectified Analysis Result --- *) (* ---------------------------------------------------------------------- *) module REGION = Datatype.Make (struct type t = Region.map include Datatype.Undefined let reprs = [Region.create ()] let name = "Wp.RegionAnalysis.region" let mem_project = Datatype.never_any_project end) module GLOBAL = State_builder.Ref (REGION) (struct let name = "Wp.RegionAnalysis.ref" let dependencies = [Ast.self] let default = Region.create end) module REGISTRY = State_builder.Hashtbl (Kernel_function.Hashtbl) (REGION) (struct let name = "Wp.RegionAnalysis.registry" let dependencies = [Ast.self] let size = 32 end) let get = function | None -> GLOBAL.get () | Some kf -> try REGISTRY.find kf with Not_found -> let map = compute kf in REGISTRY.add kf map ; map (* ---------------------------------------------------------------------- *) (* --- Command Line Registry --- *) (* ---------------------------------------------------------------------- *) let main () = if Wp.Region.get () then begin Ast.compute () ; let dir = Wp.get_output_dir "region" in Wp.iter_kf (fun kf -> let map = get (Some kf) in if not (Region.is_empty map) then RegionDump.dump ~dir kf map ) ; end let () = Db.Main.extend main (* ---------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RegionAnalysis.mli����������������������������������������������0000666�0000000�0000000�00000003561�13571573400�017550� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Memoized and Projectified Region Analyzis for the given Function. *) val get : Kernel_function.t option -> Region.map (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RegionAnnot.ml��������������������������������������������������0000666�0000000�0000000�00000041504�13571573400�016672� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype open Logic_ptree module Wp = Wp_parameters (* -------------------------------------------------------------------------- *) (* --- L-Path --- *) (* -------------------------------------------------------------------------- *) type region_pattern = | FREE | PVAR | PREF | PMEM | PVECTOR | PMATRIX type lrange = | R_index of term | R_range of term option * term option type lpath = { loc : location ; lnode : lnode ; ltype : typ ; } and lnode = | L_var of varinfo | L_region of string | L_addr of lpath | L_star of typ * lpath | L_shift of lpath * typ * lrange | L_index of lpath * typ * lrange | L_field of lpath * fieldinfo list | L_cast of typ * lpath type region_spec = { region_name: string option ; region_pattern: region_pattern ; region_lpath: lpath list ; } (* let get_int e = match Logic_utils.constFoldTermToInt e with | None -> None | Some a -> Some (Integer.to_int a) let get_int_option = function | None -> None | Some e -> get_int e *) module Lpath = struct type t = lpath let compare_bound a b = match a,b with | None , None -> 0 | Some a , Some b -> Term.compare a b | None , Some _ -> (-1) | Some _ , None -> 1 let compare_range a b = match a,b with | R_index a , R_index b -> Term.compare a b | R_index _ , _ -> (-1) | _ , R_index _ -> 1 | R_range(a1,b1) , R_range(a2,b2) -> let cmp = compare_bound a1 a2 in if cmp <> 0 then cmp else compare_bound b1 b2 let rec compare a b = match a.lnode , b.lnode with | L_var x , L_var y -> Varinfo.compare x y | L_var _ , _ -> (-1) | _ , L_var _ -> 1 | L_region a , L_region b -> String.compare a b | L_region _ , _ -> (-1) | _ , L_region _ -> 1 | L_star(ta,a) , L_star(tb,b) -> let cmp = Typ.compare ta tb in if cmp <> 0 then cmp else compare a b | L_star _ , _ -> (-1) | _ , L_star _ -> 1 | L_addr a , L_addr b -> compare a b | L_addr _ , _ -> (-1) | _ , L_addr _ -> 1 | L_shift(a,ta,i) , L_shift(b,tb,j) -> compare_index a ta i b tb j | L_shift _ , _ -> (-1) | _ , L_shift _ -> 1 | L_index(a,ta,i) , L_index(b,tb,j) -> compare_index a ta i b tb j | L_index _ , _ -> (-1) | _ , L_index _ -> 1 | L_field(a,fs) , L_field(b,gs) -> let cmp = compare a b in if cmp <> 0 then cmp else Qed.Hcons.compare_list Fieldinfo.compare fs gs | L_field _ , _ -> (-1) | _ , L_field _ -> 1 | L_cast(ta,a) , L_cast(tb,b) -> let cmp = Typ.compare ta tb in if cmp <> 0 then cmp else compare a b and compare_index a ta i b tb j = let cmp = compare a b in if cmp <> 0 then cmp else let cmp = Typ.compare ta tb in if cmp <> 0 then cmp else compare_range i j let equal a b = (compare a b = 0) let pp_bound pp fmt = function None -> () | Some a -> pp fmt a let pp_range pp fmt = function | R_index a -> pp fmt a | R_range(a,b) -> begin pp_bound pp fmt a ; Format.fprintf fmt "@,.." ; pp_bound pp fmt b ; end let first = function [] -> assert false | f::_ -> f let rec last = function [] -> assert false | [f] -> f | _::fs -> last fs let is_lval = function | L_var _ | L_region _ | L_index _ | L_field _ -> true | _ -> false let rec pp_lpath pp fmt a = match a.lnode with | L_var x -> Varinfo.pretty fmt x | L_region a -> Format.pp_print_string fmt a | L_field( p , [f] ) -> pfield pp p f fmt | L_field( p , fs ) -> Format.fprintf fmt "@[<hov 2>(%t@,..%t)@]" (pfield pp p (first fs)) (pfield pp p (last fs)) | L_index(a,_,i) -> Format.fprintf fmt "@[<hov 2>%a@,[%a]@]" (pp_lval pp) a (pp_range pp) i | L_shift(a,_,i) -> Format.fprintf fmt "@[<hov 2>%a@,+(%a)@]" (pp_lpath pp) a (pp_range pp) i | L_star(_,a) -> Format.fprintf fmt "*%a" (pp_lval pp) a | L_addr a -> Format.fprintf fmt "&%a" (pp_lval pp) a | L_cast(t,a) -> Format.fprintf fmt "(%a)@,%a" Typ.pretty t (pp_lval pp) a and pfield pp a f fmt = Format.fprintf fmt "@[<hov 2>%a%a@]" (panchor pp) a Fieldinfo.pretty f and panchor pp fmt a = match a.lnode with | L_star(_,p) -> Format.fprintf fmt "%a@,->" (pp_lval pp) p | _ -> Format.fprintf fmt "%a@,." (pp_lval pp) a and pp_lval pp fmt a = if is_lval a.lnode then pp_lpath pp fmt a else Format.fprintf fmt "(%a)" (pp_lpath pp) a let pretty = pp_lpath Term.pretty end (* -------------------------------------------------------------------------- *) (* --- Region Spec Printer --- *) (* -------------------------------------------------------------------------- *) let patterns = [ "PVAR" , PVAR ; "PREF" , PREF ; "PMEM" , PMEM ; "PVECTOR" , PVECTOR ; "PMATRIX" , PMATRIX ; ] let p_name p = fst (List.find (fun (_,q) -> q = p) patterns) let pp_pattern_spec fmt p = try Format.fprintf fmt "\\pattern{%s}" (p_name p) ; true with Not_found -> false let pp_path_spec pp fmt coma lv = if coma then Format.fprintf fmt ",@ " ; Lpath.pp_lpath pp fmt lv ; true let pp_region_spec pp fmt coma spec = begin if coma then Format.fprintf fmt ",@ " ; Format.fprintf fmt "@[<hv 2>" ; Extlib.may (Format.fprintf fmt "%s:@ ") spec.region_name ; let coma = pp_pattern_spec fmt spec.region_pattern in let coma = List.fold_left (pp_path_spec pp fmt) coma spec.region_lpath in Format.fprintf fmt "@]" ; coma end (* -------------------------------------------------------------------------- *) (* --- Typing Env --- *) (* -------------------------------------------------------------------------- *) type env = { context : Logic_typing.typing_context ; mutable declared : string list ; mutable name : string option ; mutable pattern : region_pattern ; mutable paths : lpath list ; mutable specs : region_spec list ; } let error env ~loc msg = env.context.Logic_typing.error loc msg let flush env = let region_name = env.name in env.name <- None ; let region_pattern = env.pattern in env.pattern <- FREE ; let region_lpath = List.rev env.paths in env.paths <- [] ; Extlib.may (fun a -> env.declared <- a::env.declared) region_name ; if not (region_name = None && region_lpath = []) then let region = { region_name ; region_pattern ; region_lpath } in env.specs <- region :: env.specs (* -------------------------------------------------------------------------- *) (* --- Type Utils --- *) (* -------------------------------------------------------------------------- *) let isIndexType t = match Logic_utils.unroll_type t with | Ctype (TInt _) | Linteger -> true | _ -> false let getCompoundType env ~loc typ = match Cil.unrollType typ with | TComp(comp,_,_) -> comp | _ -> error env ~loc "Expected compound type for term" (* -------------------------------------------------------------------------- *) (* --- Path Typechecking --- *) (* -------------------------------------------------------------------------- *) let parse_varinfo env ~loc x = try match env.context.Logic_typing.find_var x with | { lv_origin = Some v } -> v | _ -> error env ~loc "Variable '%s' is not a C-variable" x with Not_found -> error env ~loc "Unknown variable (or region) '%s'" x let parse_fieldinfo env ~loc comp f = try List.find (fun fd -> fd.fname = f) comp.cfields with Not_found -> error env ~loc "No field '%s' in compound type '%s'" f comp.cname let parse_lindex env e = let open Logic_typing in let g = env.context in let t = g.type_term g g.pre_state e in if isIndexType t.term_type then t else error env ~loc:t.term_loc "Index term shall have a integer type" let parse_ltype env ~loc t = let open Logic_typing in let g = env.context in let t = g.logic_type g loc g.pre_state t in match Logic_utils.unroll_type t with | Ctype typ -> typ | _ -> error env ~loc "C-type expected for casting l-values" let parse_lbound env = function | None -> None | Some e -> Some (parse_lindex env e) let parse_lrange env e = match e.lexpr_node with | PLrange(a,b) -> R_range( parse_lbound env a , parse_lbound env b ) | _ -> R_index( parse_lindex env e ) let sugar ~loc node = { lexpr_loc = loc ; lexpr_node = node } let rec field_range ~inside fa fb = function | [] -> [] | f::fs -> let bound = Fieldinfo.equal f fa || Fieldinfo.equal f fb in if inside then f :: (if bound then [] else field_range ~inside fa fb fs) else if bound then f :: (field_range ~inside:true fa fb fs) else field_range ~inside fa fb fs let rec typeof_fields = function | [] -> TVoid [] | [f] -> f.ftype | f::fs -> let t = typeof_fields fs in if Typ.equal f.ftype t then t else TVoid [] let rec parse_lpath env e = let loc = e.lexpr_loc in match e.lexpr_node with | PLvar x -> if List.mem x env.declared then { loc ; lnode = L_region x ; ltype = TVoid [] } else let v = parse_varinfo env ~loc x in { loc ; lnode = L_var v ; ltype = v.vtype } | PLunop( Ustar , p ) -> let lv = parse_lpath env p in if Cil.isPointerType lv.ltype then let te = Cil.typeOf_pointed lv.ltype in { loc ; lnode = L_star(te,lv) ; ltype = te } else error env ~loc "Pointer-type expected for operator '&'" | PLunop( Uamp , p ) -> let lv = parse_lpath env p in let ltype = TPtr( lv.ltype , [] ) in { loc ; lnode = L_addr lv ; ltype } | PLbinop( p , Badd , r ) -> let { ltype } as lv = parse_lpath env p in let rg = parse_lrange env r in if Cil.isPointerType ltype then let te = Cil.typeOf_pointed ltype in { loc ; lnode = L_shift(lv,te,rg) ; ltype = ltype } else if Cil.isArrayType ltype then let te = Cil.typeOf_array_elem ltype in { loc ; lnode = L_shift(lv,te,rg) ; ltype = TPtr(te,[]) } else error env ~loc "Pointer-type expected for operator '+'" | PLdot( p , f ) -> let lv = parse_lpath env p in let comp = getCompoundType env ~loc:lv.loc lv.ltype in let fd = parse_fieldinfo env ~loc comp f in { loc ; lnode = L_field(lv,[fd]) ; ltype = fd.ftype } | PLarrow( p , f ) -> let sp = sugar ~loc (PLunop(Ustar,p)) in let pf = sugar ~loc (PLdot(sp,f)) in parse_lpath env pf | PLarrget( p , k ) -> let { ltype } as lv = parse_lpath env p in let rg = parse_lrange env k in if Cil.isPointerType ltype then let pointed = Cil.typeOf_pointed ltype in let ls = { loc ; lnode = L_shift(lv,pointed,rg) ; ltype } in { loc ; lnode = L_star(pointed,ls) ; ltype = pointed } else if Cil.isArrayType ltype then let elt = Cil.typeOf_array_elem ltype in { loc ; lnode = L_index(lv,elt,rg) ; ltype = elt } else error env ~loc:lv.loc "Pointer or array type expected" | PLcast( t , a ) -> let lv = parse_lpath env a in let ty = parse_ltype env ~loc t in { loc ; lnode = L_cast(ty,lv) ; ltype = ty } | PLrange( Some a , Some b ) -> let pa,fa = parse_fpath env a in let pb,fb = parse_fpath env b in let p = if Lpath.equal pa pb then pa else error env ~loc "Range of fields from different l-values" in let comp = if Compinfo.equal fa.fcomp fb.fcomp then fa.fcomp else error env ~loc "Range of fields from incompatible types" in let fields = field_range ~inside:false fa fb comp.cfields in let ltype = typeof_fields fields in { loc ; lnode = L_field(p,fields) ; ltype } | PLrange( Some a , None ) -> let p,fd = parse_fpath env a in let fields = field_range ~inside:false fd fd fd.fcomp.cfields in let ltype = typeof_fields fields in { loc ; lnode = L_field(p,fields) ; ltype } | PLrange( None , Some a ) -> let p,fd = parse_fpath env a in let fields = field_range ~inside:true fd fd fd.fcomp.cfields in let ltype = typeof_fields fields in { loc ; lnode = L_field(p,fields) ; ltype } | _ -> error env ~loc "Unexpected expression for region spec" and parse_fpath env p = let lv = parse_lpath env p in match lv.lnode with | L_field( a , [f] ) -> a , f | _ -> error env ~loc:lv.loc "Missing field access in range" (* -------------------------------------------------------------------------- *) (* --- Spec Typechecking --- *) (* -------------------------------------------------------------------------- *) let kspec = ref 0 let registry = Hashtbl.create 0 let parse_pattern env ~loc names params = match names with | [name] -> let pattern = try List.assoc name patterns with Not_found -> error env ~loc "Unknown pattern '%s'" name in if params <> [] then error env ~loc "Unexpected parameters for pattern '%s'" name ; pattern | [] -> error env ~loc "Missing pattern name" | _ -> error env ~loc "Duplicate pattern names" let rec parse_region env p = let loc = p.lexpr_loc in match p.lexpr_node with | PLnamed( name , p ) -> flush env ; env.name <- Some name ; parse_region env p | PLapp("\\pattern",names,params) -> let pattern = parse_pattern env ~loc names params in if env.pattern <> FREE && env.pattern <> pattern then error env ~loc "Duplicate pattern definition in region" else env.pattern <- pattern | _ -> let path = parse_lpath env p in env.paths <- path :: env.paths let typecheck ~typing_context ~loc:_loc ps = let env = { name = None ; declared = [] ; context = typing_context ; pattern = FREE ; paths = [] ; specs = [] ; } in List.iter (parse_region env) ps ; let id = !kspec in incr kspec ; let specs = flush env ; env.specs in Hashtbl.add registry id specs ; Ext_id id (* -------------------------------------------------------------------------- *) (* --- Registry --- *) (* -------------------------------------------------------------------------- *) let of_extid = Hashtbl.find registry let of_extrev = function | { ext_name="region" ; ext_kind = Ext_id k } -> of_extid k | _ -> raise Not_found let of_extension e = List.rev (of_extrev e) let of_behavior bhv = List.fold_left (fun acc e -> List.rev_append (try of_extrev e with Not_found -> []) acc) [] bhv.Cil_types.b_extended let pp_extension printer fmt = function | Ext_id k -> let spec = try Hashtbl.find registry k with Not_found -> [] in ignore (List.fold_left (pp_region_spec printer#term fmt) false spec) | _ -> () let specified = let re = Str.regexp_case_fold "region" in fun model -> try ignore (Str.search_forward re model 0) ; true with Not_found -> false let register () = if Wp.Region.get () || Wp.Region_annot.get () || List.exists specified (Wp.Model.get ()) then begin Logic_typing.register_behavior_extension "region" true typecheck ; Cil_printer.register_behavior_extension "region" pp_extension ; end let () = Cmdline.run_after_configuring_stage register (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RegionAnnot.mli�������������������������������������������������0000666�0000000�0000000�00000005004�13571573400�017036� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type lrange = | R_index of term | R_range of term option * term option type lpath = { loc : location ; lnode : lnode ; ltype : typ ; } and lnode = | L_var of varinfo | L_region of string | L_addr of lpath | L_star of typ * lpath | L_shift of lpath * typ * lrange | L_index of lpath * typ * lrange | L_field of lpath * fieldinfo list | L_cast of typ * lpath module Lpath : sig type t = lpath val equal : t -> t -> bool val compare : t -> t -> int val pretty : Format.formatter -> t -> unit end type region_pattern = | FREE | PVAR | PREF | PMEM | PVECTOR | PMATRIX type region_spec = { region_name: string option ; region_pattern: region_pattern ; region_lpath: lpath list ; } val p_name : region_pattern -> string val of_extension : acsl_extension -> region_spec list val of_behavior : behavior -> region_spec list val register : unit -> unit (** Auto when `-wp-region` *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RegionDump.ml���������������������������������������������������0000666�0000000�0000000�00000025170�13571573400�016521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Wp = Wp_parameters module Kf = Kernel_function module G = Dotgraph module R = G.Node(Region.Map) let node_default = [`Attr("fontname","monospace")] let edge_default = [`Attr("fontname","monospace")] let attr_offset = [ `Filled ; `Color "grey" ; `Box ] let attr_write = [ `Label "W" ; `Fillcolor "green" ; `Filled ] let attr_read = [ `Label "R" ; `Fillcolor "green" ; `Filled ] let attr_alias = [ `Label "&" ; `Fillcolor "orange" ; `Filled ] let attr_merge = [ `Color "red" ; `Fillcolor "red" ; `Filled ] let attr_shift = [ `Label "[]" ] let attr_delta = [ `Filled ; `Color "lightblue" ; `Box ] let attr_deref = [ `ArrowHead "tee" ] let attr_cil = [ `Filled ; `Fillcolor "yellow" ] let attr_region = `Shape "tab" :: attr_cil let attr_var = `Shape "cds" :: attr_cil let attr_garbled = [`Fillcolor "red";`Filled] let attr_froms = [ `Color "blue" ; `Attr("dir","back") ] let attr_pointed = [ `Color "red" ] let attr_pointed_deref = [ `Attr("taillabel","*"); `Attr("labelangle","+30"); `Color "red"; ] let attr_pointed_shift = [ `Attr("taillabel","[..]"); `Attr("labeldistance","1.7"); `Attr("labelangle","+40"); `Color "red"; ] let rid_key = Wp.register_category "rid" let dot_key = Wp.register_category "dot" let pdf_key = Wp.register_category "pdf" let deref_key = Wp.register_category "deref" let roots_key = Wp.register_category "roots" let froms_key = Wp.register_category "froms" let cluster_key = Wp.register_category "cluster" let chunk_key = Wp.register_category "chunk" let offset_key = Wp.register_category "offset" let sfprintf = Pretty_utils.sfprintf let dotpointed ~label r = let attr = if Region.is_shifted r then attr_pointed_shift else attr_pointed_deref in let target = G.port (R.get r) "w" in `Port ("",["",attr,target],label) let dotvalue ?(prefix="") value : Dotgraph.record = let open Layout in match value with | Int i -> `Label (sfprintf "%s%a" prefix Ctypes.pp_int i) | Float f -> `Label (sfprintf "%s%a" prefix Ctypes.pp_float f) | Pointer r -> dotpointed ~label:(prefix ^ "ptr") r let dotrange ?(prefix="") rg : Dotgraph.record = let open Layout in let pp_dim fmt = function | Raw _ -> Format.pp_print_string fmt "raw" | Dim(s,ds) -> Format.fprintf fmt "%d%a" s Matrix.pretty ds in let label = sfprintf "%d..%d: %s%a" rg.ofs (rg.ofs + rg.len - 1) prefix pp_dim rg.dim in `Port("",["",[`Dotted],R.get rg.reg],label) let dotcluster cluster : Dotgraph.record = let open Layout in match cluster with | Empty -> `Label "-" | Garbled -> `Label "Garbled" | Chunk v -> dotvalue v | Layout { sizeof ; layout } -> let label = Printf.sprintf "sizeof:%d" sizeof in `Hbox (`Label label :: List.map dotrange layout) let dotchunk mem : Dotgraph.record = let open Layout in match mem with | Mraw(_,None) -> `Label "Raw" | Mraw(_,Some r) -> dotpointed ~label:"Raw" r | Mref r -> dotpointed ~label:"Ref" r | Mmem(rt,v) -> let prefix = if Layout.Root.indexed rt then "Mem " else "Var " in dotvalue ~prefix v | Mcomp(_,ovl) -> let range rg = dotrange ~prefix:(if Overlay.once rg.reg ovl then "D" else "C") rg in `Hbox (List.map range ovl) let dotregion dot map region node = begin let is_read = Region.is_read region in let is_written = Region.is_written region in let is_aliased = Region.is_aliased region in let is_accessed = is_read || is_written || is_aliased in let has_deref = Wp.has_dkey deref_key && Region.has_deref region in let has_roots = Wp.has_dkey roots_key && Region.has_roots map region in let has_index_infos = has_deref || has_roots in let has_side_cluster = is_accessed || has_index_infos || Region.has_names region || Wp.has_dkey offset_key || Wp.has_dkey rid_key || not (Wp.has_dkey cluster_key || Wp.has_dkey chunk_key) || not (Wp.Region_fixpoint.get ()) in if has_side_cluster then begin let attr = G.decorate [ `Oval ] [ is_read , attr_read ; Region.has_pointed region , [ `Label "D" ] ; is_written , attr_write ; Region.is_shifted region , attr_shift ; is_aliased , attr_alias ; Region.get_alias map region != region , attr_merge ; Region.is_garbled region , attr_merge ; ] in G.node dot node attr ; end ; if Wp.has_dkey offset_key then Region.iter_offset map (fun offset target -> let label = Pretty_utils.to_string Layout.Offset.pretty offset in let delta = G.inode dot (`Label label :: attr_offset) in G.link dot [node;delta;R.get target] [`Dotted] ) region ; if Wp.has_dkey offset_key then Extlib.may (fun target -> let label = if Region.is_shifted target then "[..]" else "*" in let deref = G.inode dot (`Label label :: attr_offset) in G.link dot [node;deref;R.get target] attr_pointed ) (Region.get_pointed map region) ; if has_index_infos then begin let derefs = ref [] in let label s = derefs := s :: !derefs in if has_roots then label @@ sfprintf "roots:%a" Layout.Root.pretty (Region.get_roots map region) ; if has_deref then Region.iter_deref (fun deref -> label @@ Pretty_utils.to_string Layout.Deref.pretty deref ) region ; if !derefs <> [] then begin let label = String.concat "\n" (List.rev !derefs) in let delta = G.inode dot (`Label label :: attr_delta) in G.rank dot [node;delta] ; G.edge dot delta node attr_deref end end ; if Wp.has_dkey cluster_key then begin let cluster = Region.cluster map region in if not (has_side_cluster && Layout.Cluster.is_empty cluster) then let record = dotcluster cluster in let attr = if Region.is_garbled region then attr_garbled else [] in if has_side_cluster then let delta = G.irecord dot ~attr record in G.edge dot node (G.port delta "w") attr_deref else G.record dot node ~attr record end ; if Wp.has_dkey chunk_key then begin let chunk = Region.chunk map region in let record = dotchunk chunk in let attr = if Region.is_garbled region then attr_garbled else [] in if has_side_cluster then let delta = G.irecord dot ~attr record in G.edge dot node (G.port delta "w") attr_deref else G.record dot node ~attr record end ; if Wp.has_dkey froms_key then begin let open Layout in List.iter (function | Fvar _ -> () | Farray r -> G.edge dot (R.get r) node (`Label "[]"::attr_froms) | Fderef r -> G.edge dot (R.get r) node (`Label "*"::attr_froms) | Findex r -> G.edge dot (R.get r) node (`Label "+(..)"::attr_froms) | Ffield(r,ofs) -> let label = Printf.sprintf "+%d" ofs in G.edge dot (R.get r) node (`Label label::attr_froms) ) (Region.get_froms map region) end ; Region.iter_copies map (fun target -> G.edge dot node (R.get target) [`Color "green"] ) region ; Extlib.may (fun target -> G.edge dot node (R.get target) [`Color "red"] ) (Region.get_merged map region) ; end let dotvar dot x r = begin let open Cil_types in let xnode = G.inode dot ~prefix:"V" (`Label x.vname :: attr_var) in G.edge dot (G.port xnode "e") (R.get r) [] ; end let dotlabel dot a r = begin let anode = G.inode dot ~prefix:"R" (`Label a :: attr_region) in let rnode = R.get r in G.rank dot [ anode ; rnode ] ; G.edge dot anode rnode [] end let dotrid dot r = dotlabel dot (Pretty_utils.to_string Region.R.pretty r) r let dotstr dot r cst = dotlabel dot (String.escaped cst) r let dotgraph dot map = begin G.node_default dot node_default ; G.edge_default dot edge_default ; R.clear () ; R.push dot (dotregion dot map) ; Region.iter_vars map (dotvar dot) ; Region.iter_strings map (dotstr dot) ; G.pop_all dot ; if Wp.has_dkey rid_key then Region.iter map (dotrid dot) ; Region.iter_names map (dotlabel dot) ; if Region.has_return map then dotlabel dot "\\result" (Region.of_return map) ; Region.iter_fusion map (fun i r -> let rid = Region.id r in if i <> rid then dotlabel dot (Printf.sprintf "Fusion R%03d" i) r else dotlabel dot "Fusion (Self)" r ) ; G.pop_all dot ; end let dump ~dir kf map = if Wp.has_dkey dot_key || Wp.has_dkey pdf_key then begin let name = Kf.get_name kf in let file = Printf.sprintf "%s/%s.dot" dir name in let dot = Dotgraph.open_dot ~attr:[`LR] ~name ~file () in dotgraph dot map ; Dotgraph.close dot ; let outcome = if Wp.has_dkey pdf_key then Dotgraph.layout dot else file in Wp.result "Region Graph: %s" outcome end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/RegionDump.mli��������������������������������������������������0000666�0000000�0000000�00000003353�13571573400�016671� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Dump region graphs to dir according to -wp options. By default, does nothing. *) val dump : dir:string -> Kernel_function.t -> Region.map -> unit �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Repr.ml���������������������������������������������������������0000666�0000000�0000000�00000006324�13571573400�015360� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) type var = Lang.F.var type tau = Lang.F.tau type field = Lang.field type lfun = Lang.lfun type term = Lang.F.term type pred = Lang.F.pred type repr = | True | False | And of term list | Or of term list | Not of term | Imply of term list * term | If of term * term * term | Var of var | Int of Z.t | Real of Q.t | Add of term list | Mul of term list | Div of term * term | Mod of term * term | Eq of term * term | Neq of term * term | Lt of term * term | Leq of term * term | Times of Z.t * term | Call of lfun * term list | Field of term * field | Record of (field * term) list | Cst of tau * term | Get of term * term | Set of term * term * term | HigherOrder module L = Qed.Logic let term e : repr = match Lang.F.repr e with | L.True -> True | L.False -> False | L.And ts -> And ts | L.Or ts -> Or ts | L.Not t -> Not t | L.If(a,b,c) -> If(a,b,c) | L.Imply(hs,p) -> Imply(hs,p) | L.Kint z -> Int z | L.Kreal r -> Real r | L.Add ts -> Add ts | L.Mul ts -> Mul ts | L.Div(a,b) -> Div(a,b) | L.Mod(a,b) -> Mod(a,b) | L.Eq(a,b) -> Eq(a,b) | L.Neq(a,b) -> Neq(a,b) | L.Lt(a,b) -> Lt(a,b) | L.Leq(a,b) -> Leq(a,b) | L.Times(k,t) -> Times(k,t) | L.Fun(f,ts) -> Call(f,ts) | L.Rget(r,f) -> Field(r,f) | L.Rdef fvs -> Record fvs | L.Acst(t,v) -> Cst(t,v) | L.Aget(a,k) -> Get(a,k) | L.Aset(a,k,v) -> Set(a,k,v) | L.Fvar x -> Var x | L.Bvar _ | L.Bind _ | L.Apply _ -> HigherOrder let pred p = term (Lang.F.e_prop p) let lfun = Lang.name_of_lfun let field = Lang.name_of_field (* -------------------------------------------------------------------------- *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Repr.mli��������������������������������������������������������0000666�0000000�0000000�00000005055�13571573400�015531� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {2 Term & Predicate Introspection} *) type tau = Lang.F.tau type var = Lang.F.var type field = Lang.field type lfun = Lang.lfun type term = Lang.F.term type pred = Lang.F.pred type repr = | True | False | And of term list | Or of term list | Not of term | Imply of term list * term | If of term * term * term | Var of var | Int of Z.t | Real of Q.t | Add of term list | Mul of term list | Div of term * term | Mod of term * term | Eq of term * term | Neq of term * term | Lt of term * term | Leq of term * term | Times of Z.t * term | Call of lfun * term list | Field of term * field | Record of (field * term) list | Cst of tau * term | Get of term * term | Set of term * term * term | HigherOrder (** See Lang.F.e_open and Lang.F.e_close *) val term : term -> repr val pred : pred -> repr val lfun : lfun -> string val field : field -> string (* -------------------------------------------------------------------------- *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Sigma.ml��������������������������������������������������������0000666�0000000�0000000�00000015177�13571573400�015516� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Generic Sigma Factory --- *) (* -------------------------------------------------------------------------- *) open Lang.F module Make (C : Sigs.Chunk) (H : Qed.Collection.S with type t = C.t) : Sigs.Sigma with type chunk = C.t and module Chunk = H = struct type chunk = C.t module Chunk = H type domain = H.Set.t let empty = H.Set.empty let union = H.Set.union type t = { id : int ; mutable map : var H.map } let id = ref 0 (* for debugging purpose *) let build map = let k = !id in incr id ; { id = k ; map = map } let create () = build H.Map.empty let copy s = build s.map let newchunk c = Lang.freshvar ~basename:(C.basename_of_chunk c) (C.tau_of_chunk c) let merge a b = let pa = ref Passive.empty in let pb = ref Passive.empty in let merge_chunk c x y = if Var.equal x y then x else let z = newchunk c in pa := Passive.bind ~fresh:z ~bound:x !pa ; pb := Passive.bind ~fresh:z ~bound:y !pb ; z in let w = H.Map.union merge_chunk a.map b.map in build w , !pa , !pb type kind = | Used of Lang.F.var | Unused let merge_list l = (** Get a map of the chunks (the data is not important) *) let union = List.fold_left (fun acc e -> H.Map.union (fun _ v1 _ -> v1) acc e.map) H.Map.empty l in (** The goal is to build a matrix chunk -> elt of the list -> Used/Unused *) (** Set the data of the map to []. *) let union = H.Map.map (fun _ -> []) union in (** For each elements of the list tell if each chunk is used *) let merge _ m e = match m, e with | Some m, Some e -> Some (Used e::m) | Some m, None -> Some (Unused::m) | None, _ -> assert false in let union = List.fold_left (fun acc e -> H.Map.merge merge acc e.map) union (** important so that the list in the map are in the correct order *) (List.rev l) in (** Build the passive for each element of the list, and the final domain *) let p = ref (List.map (fun _ -> Passive.empty) l) in let map c l = match List.filter (fun x -> not (Unused = x)) l with | [] -> assert false (** If all the sigmas use the same variable *) | (Used a)::l when List.for_all (function | Unused -> true | Used x -> Var.equal x a) l -> a | _ -> let z = newchunk c in let map2 p = function | Unused -> p | Used a -> Passive.bind ~fresh:z ~bound:a p in p := List.map2 map2 !p l; z in let union = H.Map.mapi map union in build union , !p let choose a b = let merge_chunck _ x y = if Var.compare x y <= 0 then x else y in build (H.Map.union merge_chunck a.map b.map) let get w c = try H.Map.find c w.map with Not_found -> let x = newchunk c in w.map <- H.Map.add c x w.map ; x let mem w c = H.Map.mem c w.map let join a b = let p = ref Passive.empty in H.Map.iter2 (fun chunk x y -> match x,y with | Some x , Some y -> p := Passive.join x y !p | Some x , None -> b.map <- H.Map.add chunk x b.map | None , Some y -> a.map <- H.Map.add chunk y a.map | None , None -> ()) a.map b.map ; !p let assigned ~pre ~post written = let p = ref Bag.empty in H.Map.iter2 (fun chunk x y -> if not (H.Set.mem chunk written) then match x,y with | Some x , Some y when x != y -> p := Bag.add (p_equal (e_var x) (e_var y)) !p | Some x , None -> post.map <- H.Map.add chunk x post.map | None , Some y -> pre.map <- H.Map.add chunk y pre.map | _ -> ()) pre.map post.map ; !p let value w c = e_var (get w c) let iter f w = H.Map.iter f w.map let iter2 f w1 w2 = H.Map.iter2 f w1.map w2.map let havoc w xs = let ys = H.Set.mapping newchunk xs in build (H.Map.union (fun _c _old y -> y) w.map ys) let havoc_chunk w c = let x = newchunk c in build (H.Map.add c x w.map) let havoc_any ~call w = let framer c x = if call && C.is_framed c then x else newchunk c in build (H.Map.mapi framer w.map) let remove_chunks w xs = build (H.Map.filter (fun c _ -> not (H.Set.mem c xs)) w.map) let domain w = H.Map.domain w.map let pretty fmt w = begin Format.fprintf fmt "@[<hov 2>@@%s%d[" C.self w.id ; H.Map.iter (fun c x -> Format.fprintf fmt "@ %a:%a" C.pretty c Var.pretty x) w.map ; Format.fprintf fmt " ]@]" ; end let writes seq = let effect = ref Chunk.Set.empty in iter2 (fun chunk u v -> let written = match u,v with | Some x , Some y -> not (Var.equal x y) | None , Some _ -> true | Some _ , None -> false (** no need to create a new so it is the same *) | None, None -> assert false in if written then effect := Chunk.Set.add chunk !effect ) seq.Sigs.pre seq.Sigs.post ; !effect end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Sigma.mli�������������������������������������������������������0000666�0000000�0000000�00000003734�13571573400�015663� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Generic Sigma Factory --- *) (* -------------------------------------------------------------------------- *) module Make (C : Sigs.Chunk) (H : Qed.Collection.S with type t = C.t) : Sigs.Sigma with type chunk = C.t and module Chunk = H ������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Sigs.ml���������������������������������������������������������0000666�0000000�0000000�00000070632�13571573400�015360� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Common Types and Signatures *) (* -------------------------------------------------------------------------- *) open Cil_types open Ctypes open Lang.F open Interpreted_automata (* -------------------------------------------------------------------------- *) (** {1 General Definitions} *) (* -------------------------------------------------------------------------- *) type 'a sequence = { pre : 'a ; post : 'a } type 'a binder = { bind: 'b 'c. 'a -> ('b -> 'c) -> 'b -> 'c } (** Oriented equality or arbitrary relation *) type equation = | Set of term * term (** [Set(a,b)] is [a := b]. *) | Assert of pred (** Access conditions *) type acs = | RW (** Read-Write Access *) | RD (** Read-Only Access *) (** Abstract location or concrete value *) type 'a value = | Val of term | Loc of 'a (** Contiguous set of locations *) type 'a rloc = | Rloc of c_object * 'a | Rrange of 'a * c_object * term option * term option (** Structured set of locations *) type 'a sloc = | Sloc of 'a | Sarray of 'a * c_object * int (** full sized range (optimized assigns) *) | Srange of 'a * c_object * term option * term option | Sdescr of var list * 'a * pred (** Typed set of locations *) type 'a region = (c_object * 'a sloc) list (** Logical values, locations, or sets of *) type 'a logic = | Vexp of term | Vloc of 'a | Vset of Vset.set | Lset of 'a sloc list (** Scope management for locals and formals *) type scope = Enter | Leave (** Container for the returned value of a function *) type 'a result = | R_loc of 'a | R_var of var (** Polarity of predicate compilation *) type polarity = [ `Positive | `Negative | `NoPolarity ] (** Frame Conditions. Consider a function [phi(m)] over memory [m], we want memories [m1,m2] and condition [p] such that [p(m1,m2) -> phi(m1) = phi(m2)]. - [name] used for generating lemma - [triggers] for the lemma - [conditions] for the frame lemma to hold - [mem1,mem2] to two memories for which the lemma holds *) type frame = string * Definitions.trigger list * pred list * term * term (* -------------------------------------------------------------------------- *) (** {1 Reversing Models} It is sometimes possible to reverse memory models abstractions into ACSL left-values via the definitions below. *) (* -------------------------------------------------------------------------- *) (** Reversed ACSL left-value *) type s_lval = s_host * s_offset list and s_host = | Mvar of varinfo (** Variable *) | Mmem of term (** Pointed value *) | Mval of s_lval (** Pointed value of another abstract left-value *) and s_offset = Mfield of fieldinfo | Mindex of term (** Reversed abstract value *) type mval = | Mterm (** Not a state-related value *) | Maddr of s_lval (** The value is the address of an l-value in current memory *) | Mlval of s_lval (** The value is the value of an l-value in current memory *) | Mchunk of string (** The value is an abstract memory chunk (description) *) (** Reversed update *) type update = Mstore of s_lval * term (** An update of the ACSL left-value with the given value *) (* -------------------------------------------------------------------------- *) (** {1 Memory Models} *) (* -------------------------------------------------------------------------- *) (** Memory Chunks. The concrete memory is partionned into a vector of abstract data. Each component of the partition is called a {i memory chunk} and holds an abstract representation of some part of the memory. Remark: memory chunks are not required to be independant from each other, provided the memory model implementation is consistent with the chosen representation. Conversely, a given object might be represented by several memory chunks. See {!Model.domain}. *) module type Chunk = sig type t val self : string (** Chunk names, for pretty-printing. *) val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int val pretty : Format.formatter -> t -> unit val tau_of_chunk : t -> tau (** The type of data hold in a chunk. *) val basename_of_chunk : t -> string (** Used when generating fresh variables for a chunk. *) val is_framed : t -> bool (** Whether the chunk is local to a function call. Means the chunk is separated from anyother call side-effects. If [true], entails that a function assigning everything can not modify the chunk. Only used for optimisation, it would be safe to always return [false]. *) end (** Memory Environments. Represents the content of the memory, {i via} a vector of logic variables for each memory chunk. *) module type Sigma = sig type chunk (** The type of memory chunks. *) module Chunk : Qed.Collection.S with type t = chunk (** Memory footprint. *) type domain = Chunk.Set.t (** Environment assigning logic variables to chunk. Memory chunk variables are assigned lazily. Hence, the vector is empty unless a chunk is accessed. Pay attention to this when you merge or havoc chunks. New chunks are generated from the context pool of {!Lang.freshvar}. *) type t val pretty : Format.formatter -> t -> unit (** For debugging purpose *) val create : unit -> t (** Initially empty environment. *) val mem : t -> chunk -> bool (** Whether a chunk has been assigned. *) val get : t -> chunk -> var (** Lazily get the variable for a chunk. *) val value : t -> chunk -> term (** Same as [Lang.F.e_var] of [get]. *) val copy : t -> t (** Duplicate the environment. Fresh chunks in the copy are {i not} duplicated into the source environment. *) val join : t -> t -> Passive.t (** Make two environment pairwise equal {i via} the passive form. Missing chunks in one environment are added with the corresponding variable of the other environment. When both environments don't agree on a chunk, their variables are added to the passive form. *) val assigned : pre:t -> post:t -> domain -> pred Bag.t (** Make chunks equal outside of some domain. This is similar to [join], but outside the given footprint of an assigns clause. Although, the function returns the equality predicates instead of a passive form. Like in [join], missing chunks are reported from one side to the other one, and common chunks are added to the equality bag. *) val choose : t -> t -> t (** Make the union of each sigma, choosing the minimal variable in case of conflict. Both initial environments are kept unchanged. *) val merge : t -> t -> t * Passive.t * Passive.t (** Make the union of each sigma, choosing a {i new} variable for each conflict, and returns the corresponding joins. Both initial environments are kept unchanged. *) val merge_list : t list -> t * Passive.t list (** Same than {!merge} but for a list of sigmas. Much more efficient than folding merge step by step. *) val iter : (chunk -> var -> unit) -> t -> unit (** Iterates over the chunks and associated variables already accessed so far in the environment. *) val iter2 : (chunk -> var option -> var option -> unit) -> t -> t -> unit (** Same as [iter] for both environments. *) val havoc_chunk : t -> chunk -> t (** Generate a new fresh variable for the given chunk. *) val havoc : t -> domain -> t (** All the chunks in the provided footprint are generated and made fresh. Existing chunk variables {i outside} the footprint are copied into the new environment. The original environement itself is kept unchanged. More efficient than iterating [havoc_chunk] over the footprint. *) val havoc_any : call:bool -> t -> t (** All the chunks are made fresh. As an optimisation, when [~call:true] is set, only non-local chunks are made fresh. Local chunks are those for which [Chunk.is_frame] returns [true]. *) val remove_chunks : t -> domain -> t (** Return a copy of the environment where chunks in the footprint have been removed. Keep the original environment unchanged. *) val domain : t -> domain (** Footprint of a memory environment. That is, the set of accessed chunks so far in the environment. *) val union : domain -> domain -> domain (** Same as [Chunk.Set.union] *) val empty : domain (** Same as [Chunk.Set.empty] *) val writes : t sequence -> domain (** [writes s] indicates which chunks are new in [s.post] compared to [s.pre]. *) end (** Memory Models. *) module type Model = sig (** {2 Model Definition} *) val configure : WpContext.tuning (** Initializers to be run before using the model. Typically sets {!Context} values. *) val configure_ia: automaton -> vertex binder (** Given an automaton, return a vertex's binder. Currently used by the automata compiler to bind current vertex. See {!StmtSemantics}. *) val datatype : string (** For projectification. Must be unique among models. *) val hypotheses : unit -> MemoryContext.clause list (** Computes the memory model hypotheses including separation and validity clauses to be verified for this model. *) module Chunk : Chunk (** Memory model chunks. *) module Heap : Qed.Collection.S with type t = Chunk.t (** Chunks Sets and Maps. *) module Sigma : Sigma with type chunk = Chunk.t and module Chunk = Heap (** Model Environments. *) type loc (** Representation of the memory location in the model. *) type chunk = Chunk.t type sigma = Sigma.t type domain = Sigma.domain type segment = loc rloc (** {2 Reversing the Model} *) type state (** Internal (private) memory state description for later reversing the model. *) (** Returns a memory state description from a memory environement. *) val state : sigma -> state (** Try to interpret a term as an in-memory operation located at this program point. Only best-effort shall be performed, otherwise return [Mvalue]. Recognized [Cil] patterns: - [Mvar x,[Mindex 0]] is rendered as [*x] when [x] has a pointer type - [Mmem p,[Mfield f;...]] is rendered as [p->f...] like in Cil - [Mmem p,[Mindex k;...]] is rendered as [p[k]...] to catch Cil [Mem(AddPI(p,k)),...] *) val lookup : state -> term -> mval (** Try to interpret a sequence of states into updates. The result shall be exhaustive with respect to values that are printed as [Sigs.mval] values at [post] label {i via} the [lookup] function. Otherwise, those values would not be pretty-printed to the user. *) val updates : state sequence -> Vars.t -> update Bag.t (** Propagate a sequent substitution inside the memory state. *) val apply : (term -> term) -> state -> state (** Debug *) val iter : (mval -> term -> unit) -> state -> unit val pretty : Format.formatter -> loc -> unit (** pretty printing of memory location *) (** {2 Memory Model API} *) val vars : loc -> Vars.t (** Return the logic variables from which the given location depend on. *) val occurs : var -> loc -> bool (** Test if a location depend on a given logic variable *) val null : loc (** Return the location of the null pointer *) val literal : eid:int -> Cstring.cst -> loc (** Return the memory location of a constant string, the id is a unique identifier. *) val cvar : varinfo -> loc (** Return the location of a C variable. *) val pointer_loc : term -> loc (** Interpret an address value (a pointer) as an abstract location. Might fail on memory models not supporting pointers. *) val pointer_val : loc -> term (** Return the adress value (a pointer) of an abstract location. Might fail on memory models not capable of representing pointers. *) val field : loc -> fieldinfo -> loc (** Return the memory location obtained by field access from a given memory location. *) val shift : loc -> c_object -> term -> loc (** Return the memory location obtained by array access at an index represented by the given {!term}. The element of the array are of the given {!c_object} type. *) val base_addr : loc -> loc (** Return the memory location of the base address of a given memory location. *) val base_offset : loc -> term (** Return the offset of the location, in bytes, from its base_addr. *) val block_length : sigma -> c_object -> loc -> term (** Returns the length (in bytes) of the allocated block containing the given location. *) val cast : c_object sequence -> loc -> loc (** Cast a memory location into another memory location. For [cast ty loc] the cast is done from [ty.pre] to [ty.post]. Might fail on memory models not supporting pointer casts. *) val loc_of_int : c_object -> term -> loc (** Cast a term representing an absolute memory address (to some c_object) given as an integer, into an abstract memory location. *) val int_of_loc : c_int -> loc -> term (** Cast a memory location into its absolute memory address, given as an integer with the given C-type. *) val domain : c_object -> loc -> domain (** Compute the set of chunks that hold the value of an object with the given C-type. It is safe to retun an over-approximation of the chunks involved. *) val load : sigma -> c_object -> loc -> loc value (** Return the value of the object of the given type at the given location in the given memory state. *) val copied : sigma sequence -> c_object -> loc -> loc -> equation list (** Return a set of equations that express a copy between two memory state. [copied sigma ty loc1 loc2] returns a set of formula expressing that the content for an object [ty] is the same in [sigma.pre] at [loc1] and in [sigma.post] at [loc2]. *) val stored : sigma sequence -> c_object -> loc -> term -> equation list (** Return a set of formula that express a modification between two memory state. [copied sigma ty loc t] returns a set of formula expressing that [sigma.pre] and [sigma.post] are identical except for an object [ty] at location [loc] which is represented by [t] in [sigma.post]. *) val assigned : sigma sequence -> c_object -> loc sloc -> equation list (** Return a set of formula that express that two memory state are the same except at the given set of memory location. This function can over-approximate the set of given memory location (e.g it can return [true] as if the all set of memory location was given). *) val is_null : loc -> pred (** Return the formula that check if a given location is null *) val loc_eq : loc -> loc -> pred val loc_lt : loc -> loc -> pred val loc_neq : loc -> loc -> pred val loc_leq : loc -> loc -> pred (** Memory location comparisons *) val loc_diff : c_object -> loc -> loc -> term (** Compute the length in bytes between two memory locations *) val valid : sigma -> acs -> segment -> pred (** Return the formula that tests if a memory state is valid (according to {!acs}) in the given memory state at the given segment. *) val frame : sigma -> pred list (** Assert the memory is a proper heap state preceeding the function entry point. *) val alloc : sigma -> varinfo list -> sigma (** Allocates new chunk for the validity of variables. *) val invalid : sigma -> segment -> pred (** Returns the formula that tests if the entire memory is invalid for write access. *) val scope : sigma sequence -> scope -> varinfo list -> pred list (** Manage the scope of variables. Returns the updated memory model and hypotheses modeling the new validity-scope of the variables. *) val global : sigma -> term -> pred (** Given a pointer value [p], assumes this pointer [p] (when valid) is allocated outside the function frame under analysis. This means separated from the formals and locals of the function. *) val included : segment -> segment -> pred (** Return the formula that tests if two segment are included *) val separated : segment -> segment -> pred (** Return the formula that tests if two segment are separated *) end (* -------------------------------------------------------------------------- *) (** {1 C and ACSL Compilers} *) (* -------------------------------------------------------------------------- *) (** Compiler for C expressions *) module type CodeSemantics = sig module M : Model (** The underlying memory model *) type loc = M.loc type nonrec value = loc value type nonrec result = loc result type sigma = M.Sigma.t val pp_value : Format.formatter -> value -> unit val cval : value -> term (** Evaluate an abstract value. May fail because of [M.pointer_val]. *) val cloc : value -> loc (** Interpret a value as a location. May fail because of [M.pointer_loc]. *) val cast : typ -> typ -> value -> value (** Applies a pointer cast or a conversion. [cast tr te ve] transforms a value [ve] with type [te] into a value with type [tr]. *) val equal_typ : typ -> value -> value -> pred (** Computes the value of [(a==b)] provided both [a] and [b] are values with the given type. *) val not_equal_typ : typ -> value -> value -> pred (** Computes the value of [(a==b)] provided both [a] and [b] are values with the given type. *) val equal_obj : c_object -> value -> value -> pred (** Same as [equal_typ] with an object type. *) val not_equal_obj : c_object -> value -> value -> pred (** Same as [not_equal_typ] with an object type. *) val exp : sigma -> exp -> value (** Evaluate the expression on the given memory state. *) val cond : sigma -> exp -> pred (** Evaluate the conditional expression on the given memory state. *) val lval : sigma -> lval -> loc (** Evaluate the left-value on the given memory state. *) val call : sigma -> exp -> loc (** Address of a function pointer. Handles [AddrOf], [StartOf] and [Lval] as usual. *) val instance_of : loc -> kernel_function -> pred (** Check whether a function pointer is (an instance of) some kernel function. Currently, the meaning of "{i being an instance of}" is simply equality. *) val loc_of_exp : sigma -> exp -> loc (** Compile an expression as a location. May (also) fail because of [M.pointer_val]. *) val val_of_exp : sigma -> exp -> term (** Compile an expression as a term. May (also) fail because of [M.pointer_loc]. *) val result : sigma -> typ -> result -> term (** Value of an abstract result container. *) val return : sigma -> typ -> exp -> term (** Return an expression with a given type. Short cut for compiling the expression, cast into the desired type, and finally converted to a term. *) val is_zero : sigma -> c_object -> loc -> pred (** Express that the object (of specified type) at the given location is filled with zeroes. *) (** Express that all objects in a range of locations have a given value. More precisely, [is_exp_range sigma loc ty a b v] express that value at [( ty* )loc + k] equals [v], forall [a <= k < b]. Value [v=None] stands for zero. *) val is_exp_range : sigma -> loc -> c_object -> term -> term -> value option -> pred val unchanged : M.sigma -> M.sigma -> varinfo -> pred (** Express that a given variable has the same value in two memory states. *) type warned_hyp = Warning.Set.t * pred val init : sigma:M.sigma -> varinfo -> init option -> warned_hyp list (** Express that some variable has some initial value at the given memory state. Remark: [None] initializer are interpreted as zeroes. This is consistent with the [init option] associated with global variables in CIL, for which the default initializer are zeroes. There is no [init option] value associated with local initializers. *) end (** Compiler for ACSL expressions *) module type LogicSemantics = sig module M : Model (** Underlying memory model *) type loc = M.loc type nonrec value = M.loc value type nonrec logic = M.loc logic type nonrec region = M.loc region type nonrec result = M.loc result type sigma = M.Sigma.t (** {2 Frames} Frames are compilation environment for ACSL. A frame typically manages the current function, formal paramters, the memory environments at different labels and the [\result] and [\exit_status] values. The frame also holds the {i gamma} environment responsible for accumulating typing constraints, and the {i pool} for generating fresh logic variables. Notice that a [frame] is not responsible for holding the environment at label [Here], since this is managed by a specific compilation environment, see {!env} below. *) type frame val pp_frame : Format.formatter -> frame -> unit (** Get the current frame, or raise a fatal error if none. *) val get_frame : unit -> frame (** Execute the given closure with the specified current frame. The [Lang.gamma] and [Lang.pool] contexts are also set accordingly. *) val in_frame : frame -> ('a -> 'b) -> 'a -> 'b (** Get the memory environment at the given label. A fresh environment is created lazily if required. The label must {i not} be [Here]. *) val mem_at_frame : frame -> Clabels.c_label -> sigma (** Update a frame with a specific environment for the given label. *) val set_at_frame : frame -> Clabels.c_label -> sigma -> unit (** Same as [mem_at_frame] but for the current frame. *) val mem_frame : Clabels.c_label -> sigma (** Full featured constructor for frames, with fresh pool and gamma. *) val mk_frame : ?kf:Cil_types.kernel_function -> ?result:result -> ?status:Lang.F.var -> ?formals:value Cil_datatype.Varinfo.Map.t -> ?labels:sigma Clabels.LabelMap.t -> ?descr:string -> unit -> frame (** Make a local frame reusing the {i current} pool and gamma. *) val local : descr:string -> frame (** Make a fresh frame with the given function. *) val frame : kernel_function -> frame type call (** Internal call data. *) (** Create call data from the callee point of view, deriving data (gamma and pools) from the current frame. If [result] is specified, the called function will stored its result at the provided location in the current frame (the callee). *) val call : ?result:M.loc -> kernel_function -> value list -> call (** Derive a frame from the call data suitable for compiling the called function contracts in the provided pre-state. *) val call_pre : sigma -> call -> sigma -> frame (** Derive a frame from the call data suitable for compiling the called function contracts in the provided pre-state and post-state. *) val call_post : sigma -> call -> sigma sequence -> frame (** Result type of the current function in the current frame. *) val return : unit -> typ (** Result location of the current function in the current frame. *) val result : unit -> result (** Exit status for the current frame. *) val status : unit -> var (** Returns the current gamma environment from the current frame. *) val guards : frame -> pred list (** {2 Compilation Environment} *) type env (** Compilation environment for terms and predicates. Manages the {i current} memory state and the memory state at [Here]. Remark: don't confuse the {i current} memory state with the memory state {i at label} [Here]. The current memory state is the one we have at hand when compiling a term or a predicate. Hence, inside [\at(e,L)] the current memory state when compiling [e] is the one at [L]. *) (** Create a new environment. Current and [Here] memory points are initialized to [~here], if provided. The logic variables stand for formal parameters of ACSL logic function and ACSL predicates. *) val mk_env : ?here:sigma -> ?lvars:logic_var list -> unit -> env (** The {i current} memory state. Must be propertly initialized with a specific {!move} before. *) val current : env -> sigma (** Move the compilation environment to the specified [Here] memory state. This memory state becomes also the new {i current} one. *) val move_at : env -> sigma -> env (** Returns the memory state at the requested label. Uses the local environment for [Here] and the current frame otherwize. *) val mem_at : env -> Clabels.c_label -> sigma (** Returns a new environment where the current memory state is moved to to the corresponding label. Suitable for compiling [e] inside [\at(e,L)] ACSL construct. *) val env_at : env -> Clabels.c_label -> env (** {2 Compilers} *) (** Compile a term l-value into a (typed) abstract location *) val lval : env -> Cil_types.term_lval -> Cil_types.typ * M.loc (** Compile a term expression. *) val term : env -> Cil_types.term -> term (** Compile a predicate. The polarity is used to generate a weaker or stronger predicate in case of unsupported feature from WP or the underlying memory model. *) val pred : polarity -> env -> Cil_types.predicate -> pred (** Compile a term representing a set of memory locations into an abstract region. When [~unfold:true], compound memory locations are expanded field-by-field. *) val region : env -> unfold:bool -> Cil_types.term -> region (** Computes the region assigned by a list of froms. *) val assigned_of_froms : env -> unfold:bool -> from list -> region (** Computes the region assigned by an assigns clause. [None] means everyhting is assigned. *) val assigned_of_assigns : env -> unfold:bool -> assigns -> region option (** Same as [term] above but reject any set of locations. *) val val_of_term : env -> Cil_types.term -> term (** Same as [term] above but expects a single loc or a single pointer value. *) val loc_of_term : env -> Cil_types.term -> loc (** Compile a lemma definition. *) val lemma : LogicUsage.logic_lemma -> Definitions.dlemma (** {2 Regions} *) (** Qed variables appearing in a region expression. *) val vars : region -> Vars.t (** Member of vars. *) val occurs : var -> region -> bool (** Check assigns inclusion. Compute a formula that checks whether written locations are either invalid (at the given memory location) or included in some assignable region. *) val check_assigns : sigma -> written:region -> assignable:region -> pred end (** Compiler for Performing Assigns *) module type LogicAssigns = sig module M : Model module L : LogicSemantics with module M = M open M (** Memory footprint of a region. *) val domain : loc region -> Heap.set (** Relates two memory states corresponding to an assigns clause with the specified set of locations. *) val apply_assigns : sigma sequence -> loc region -> pred list end (** All Compilers Together *) module type Compiler = sig module M : Model module C : CodeSemantics with module M = M module L : LogicSemantics with module M = M module A : LogicAssigns with module M = M and module L = L end ������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Splitter.ml�����������������������������������������������������0000666�0000000�0000000�00000017332�13571573400�016257� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Base Type for Splitting --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype type tag = | MARK of stmt | THEN of stmt | ELSE of stmt | CALL of stmt * kernel_function | CASE of stmt * int64 list | DEFAULT of stmt | ASSERT of identified_predicate * int * int (* part *) let pretty fmt = function | MARK _ -> Format.fprintf fmt "Stmt" | THEN _ -> Format.fprintf fmt "Then" | ELSE _ -> Format.fprintf fmt "Else" | CASE(_,[]) -> Format.fprintf fmt "Case(s)" | CASE(_,[k]) -> Format.fprintf fmt "Case %s" (Int64.to_string k) | CASE(_,k::ks) -> Format.fprintf fmt "@[Cases %s" (Int64.to_string k) ; List.iter (fun k -> Format.fprintf fmt ",@,%s" (Int64.to_string k)) ks ; Format.fprintf fmt "@]" | CALL(_,kf) -> Format.fprintf fmt "Call %a" Kernel_function.pretty kf | DEFAULT _ -> Format.fprintf fmt "Default" | ASSERT(_,k,n) -> Format.fprintf fmt "Disjunction (%d/%d)" k n let loc = function | THEN s | ELSE s | MARK s | CASE(s,_) | CALL(s,_) | DEFAULT s -> Stmt.loc s | ASSERT(p,_,_) -> p.ip_content.pred_loc let compare p q = if p == q then 0 else match p,q with | MARK s , MARK t -> Stmt.compare s t | MARK _ , _ -> (-1) | _ , MARK _ -> 1 | THEN s , THEN t -> Stmt.compare s t | THEN _ , _ -> (-1) | _ , THEN _ -> 1 | ELSE s , ELSE t -> Stmt.compare s t | ELSE _ , _ -> (-1) | _ , ELSE _ -> 1 | CASE(s1,k1) , CASE(s2,k2) -> let c = Stmt.compare s1 s2 in if c = 0 then Transitioning.Stdlib.compare k1 k2 else c | CASE _ , _ -> (-1) | _ , CASE _ -> 1 | DEFAULT s , DEFAULT t -> Stmt.compare s t | DEFAULT _ , _ -> (-1) | _ , DEFAULT _ -> 1 | CALL(s1,f1) , CALL(s2,f2) -> let c = Stmt.compare s1 s2 in if c = 0 then Kernel_function.compare f1 f2 else c | CALL _ , _ -> (-1) | _ , CALL _ -> 1 | ASSERT(ip1,k1,_) , ASSERT(ip2,k2,_) -> let c = Transitioning.Stdlib.compare ip1.ip_id ip2.ip_id in if c = 0 then k1 - k2 else c (* -------------------------------------------------------------------------- *) (* --- Assertion Disjunction --- *) (* -------------------------------------------------------------------------- *) let rec disjunction p = try unwrap p with Exit -> [p] and unwrap p = match p.pred_content with | Por(a,b) -> disjunction a @ disjunction b | Plet(f,a) -> List.map (fun q -> { p with pred_content = Plet(f,q) }) (unwrap a) | Pexists(qs,p) -> List.map (fun q -> { p with pred_content = Pexists(qs,q) }) (unwrap p) | Pat(p,l) -> List.map (fun q -> { p with pred_content = Pat(q,l) }) (unwrap p) | _ -> raise Exit let predicate ip = ip.ip_content let rec enumerate ip k n = function | [] -> [] | p::ps -> (ASSERT(ip,k,n),p) :: enumerate ip (succ k) n ps let cases ip = try let ps = unwrap (predicate ip) in Some (enumerate ip 1 (List.length ps) ps) with Exit -> None (* -------------------------------------------------------------------------- *) (* --- Switch Cases --- *) (* -------------------------------------------------------------------------- *) let switch_cases stmt ks = CASE(stmt,ks) let switch_default stmt = DEFAULT stmt let if_then stmt = THEN stmt let if_else stmt = ELSE stmt let mark stmt = MARK stmt let call stmt kf = CALL(stmt,kf) (* -------------------------------------------------------------------------- *) (* --- Switch Cases --- *) (* -------------------------------------------------------------------------- *) module Tags = Qed.Listset.Make (struct type t = tag let compare = compare let equal x y = (compare x y = 0) end) module M = Qed.Listmap.Make(Tags) module I = FCMap.Make(Tags) type 'a t = 'a M.t let rec compact merge = function | ([] | [_]) as m -> m | ( (k1,v1) as e )::(( (k2,v2)::r ) as m) -> if Tags.compare k1 k2 = 0 then collect merge k1 [v2;v1] r else e :: compact merge m and collect merge k vs = function | [] -> [k,merge vs] | ((k',v')::r) as m -> if Tags.compare k k' = 0 then collect merge k (v'::vs) r else (k,merge vs) :: compact merge m let bytags (k,_) (k',_) = Tags.compare k k' let group tag merge m = let compaction = ref false in let m = List.sort bytags (List.map (fun (tgs,v) -> if not !compaction && Tags.mem tag tgs then compaction := true ; Tags.add tag tgs , v) m) in if !compaction then compact merge m else m (* let filter phi m = M.filter (fun key _ -> phi key) m *) let length = List.length let empty = [] let singleton e = [[],e] let union merge m1 m2 = M.union (fun _ -> merge) m1 m2 let rec merge ~left ~both ~right m1 m2 = match m1 , m2 with | [],[] -> [] | _,[] -> List.map (fun (k,v) -> k , left v) m1 | [],_ -> List.map (fun (k,v) -> k , right v) m2 | (k1,v1)::w1 , (k2,v2)::w2 -> let cmp = Tags.compare k1 k2 in if cmp < 0 then (k1 , left v1) :: merge ~left ~both ~right w1 m2 else if cmp > 0 then (k2 , right v2) :: merge ~left ~both ~right m1 w2 else (k1 , both v1 v2) :: merge ~left ~both ~right w1 w2 let merge_all merge = function | [] -> [] | [m] -> m | [m1;m2] -> M.union (fun _ u v -> merge [u;v]) m1 m2 | ms -> let t = ref I.empty in List.iter (List.iter (fun (k,v) -> try let r = (I.find k !t) in r := v :: !r with Not_found -> t := I.add k (ref [v]) !t)) ms ; I.fold (fun k r m -> match !r with | [] -> m | [v] -> (k,v)::m | vs -> (k,merge vs)::m) !t [] let map = M.map let iter = M.iter let fold = M.fold let exists f xs = List.exists (fun (_,x) -> f x) xs let for_all f xs = List.for_all (fun (_,x) -> f x) xs let filter f xs = List.filter (fun (_,x) -> f x) xs ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Splitter.mli����������������������������������������������������0000666�0000000�0000000�00000005365�13571573400�016433� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type tag = | MARK of stmt | THEN of stmt | ELSE of stmt | CALL of stmt * kernel_function | CASE of stmt * int64 list | DEFAULT of stmt | ASSERT of identified_predicate * int * int (* part / Npart *) val loc : tag -> location val pretty : Format.formatter -> tag -> unit val mark : stmt -> tag val if_then : stmt -> tag val if_else : stmt -> tag val switch_cases : stmt -> int64 list -> tag val switch_default : stmt -> tag val cases : identified_predicate -> (tag * predicate) list option val call : stmt -> kernel_function -> tag type 'a t val empty : 'a t val singleton : 'a -> 'a t val group : tag -> ('a list -> 'a) -> 'a t -> 'a t val union : ('a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t val merge : left:('a -> 'c) -> both:('a -> 'b -> 'c) -> right:('b -> 'c) -> 'a t -> 'b t -> 'c t val merge_all : ('a list -> 'a) -> 'a t list -> 'a t val length : 'a t -> int val map : ('a -> 'b) -> 'a t -> 'b t val iter : (tag list -> 'a -> unit) -> 'a t -> unit val fold : (tag list -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val exists : ('a -> bool) -> 'a t -> bool val for_all : ('a -> bool) -> 'a t -> bool val filter : ('a -> bool) -> 'a t -> 'a t ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/StmtSemantics.ml������������������������������������������������0000666�0000000�0000000�00000072644�13571573400�017256� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Sigs open Cil_types open Cil_datatype open Clabels let not_yet = Wp_parameters.not_yet_implemented module Make(Compiler:Sigs.Compiler) = struct module Compiler = Compiler module Cfg = CfgCompiler.Cfg(Compiler.M.Sigma) module M = Compiler.M module Sigma = Compiler.M.Sigma module C = Compiler.C module L = Compiler.L module A = Compiler.A type node = Cfg.node type goal = { goal_pred : Cfg.P.t; goal_prop : WpPropId.prop_id; } type cfg = Cfg.cfg type paths = { paths_cfg : cfg; paths_goals : goal Bag.t; } type env = { flow : node LabelMap.t ; kf : Kernel_function.t; result : Lang.F.var; return : typ ; (** used for substituting directly values without going through terms. Good for memory models, avoid unneeded conversions. *) subst_formals: (exp * node) Varinfo.Map.t; status : Lang.F.var; } exception LabelNotFound of c_label (* -------------------------------------------------------------------------- *) (* --- Env Utilities --- *) (* -------------------------------------------------------------------------- *) let result env = env.result let bind l n env = { env with flow = LabelMap.add l n env.flow } let (@^) cfg1 cfg2 = { paths_cfg = Cfg.concat cfg1.paths_cfg cfg2.paths_cfg; paths_goals = Bag.concat cfg1.paths_goals cfg2.paths_goals; } let (@*) env lns = let flow = List.fold_left (fun flow (l, n) -> LabelMap.add l n flow) env.flow lns in { env with flow } let (@:) env lbl = try LabelMap.find lbl env.flow with Not_found -> raise (LabelNotFound lbl) let (@-) env f = { env with flow = LabelMap.filter (fun lbl _ -> f lbl) env.flow } let empty_env kf = let return = Kernel_function.get_return_type kf in let result = Lang.freshvar ~basename:"result" (Lang.tau_of_ctype return) in let status = Lang.freshvar ~basename:"status" Qed.Logic.Int in let env = {flow = LabelMap.empty; kf; result; status; return; subst_formals = Varinfo.Map.empty} in env @* [ Clabels.init, Cfg.node (); Clabels.at_exit, Cfg.node(); ] (* -------------------------------------------------------------------------- *) (* --- Paths & Cfg Utilities --- *) (* -------------------------------------------------------------------------- *) let paths_of_cfg cfg = { paths_cfg = cfg; paths_goals = Bag.empty; } let nop = Cfg.nop |> paths_of_cfg let add_tmpnode n = Cfg.add_tmpnode n |> paths_of_cfg let goto n1 n2 = (Cfg.goto n1 n2) |> paths_of_cfg let meta ?stmt ?descr n = (Cfg.meta ?stmt ?descr n) |> paths_of_cfg let guard nc c nt = (Cfg.guard nc c nt) |> paths_of_cfg let guard' nc c nt = (Cfg.guard' nc c nt) |> paths_of_cfg let either n ns = (Cfg.either n ns) |> paths_of_cfg let implies n ns = (Cfg.implies n ns) |> paths_of_cfg let effect n1 e n2 = (Cfg.effect n1 e n2) |> paths_of_cfg let assume p = (Cfg.assume p) |> paths_of_cfg let current env sigma = Cfg.Node.(Map.add (env @: Clabels.here) sigma Map.empty) let goals_nodes goals = Bag.fold_left (fun acc g -> Cfg.Node.Map.fold (fun n _ acc -> Cfg.Node.Set.add n acc) (Cfg.P.reads g.goal_pred) acc ) Cfg.Node.Set.empty goals (* -------------------------------------------------------------------------- *) (* --- Sequence & Parallel Compilation --- *) (* -------------------------------------------------------------------------- *) let rec sequence f env = function | [] -> goto (env @: Clabels.here) (env @: Clabels.next) | [ elt ] -> f env elt | stmt :: stmts -> let n = Cfg.node () in let paths = f (bind Clabels.next n env) stmt in paths @^ (sequence f (bind Clabels.here n env) stmts) let choice ?(pre=Clabels.here) ?(post=Clabels.next) f env = let pre_node = env @: pre in let apply f env elt = let n = Cfg.node () in n, f (bind pre n env) elt in let rec aux env ns = function | [] -> goto (env @: pre) (env @: post) | [ elt ] -> let n, paths = apply f env elt in paths @^ either pre_node (n :: ns) | elt :: elts -> let n, paths = apply f env elt in paths @^ (aux env (n :: ns) elts) in aux env [] (** executed possibly at the same time *) let parallel ?(pre=Clabels.here) ?(post=Clabels.next) f env = let pre_node = env @: pre in let apply f env elt = let n = Cfg.node () in n, f (bind pre n env) elt in let rec aux env ns = function | [] -> goto (env @: pre) (env @: post) | [ elt ] -> let n, (c,paths) = apply f env elt in paths @^ implies pre_node ((c,n) :: ns) | elt :: elts -> let n, (c,paths) = apply f env elt in paths @^ (aux env ((c,n) :: ns) elts) in aux env [] (* -------------------------------------------------------------------------- *) (* --- Compiler: Scope --- *) (* -------------------------------------------------------------------------- *) let scope env sc xs = let post = Sigma.create () in let pre = M.alloc post xs in let seq = { pre ; post } in let p = Lang.F.p_conj (M.scope seq sc xs) in let e = Cfg.E.create seq p in let descr = Format.asprintf "%s scope [%a]: @[%a@]" (match sc with Leave -> "Leaving" | Enter -> "Entering") (Pretty_utils.pp_iter ~sep:"; @" List.iter Varinfo.pretty) xs Cfg.E.pretty e in meta ~descr (env @: Clabels.here) @^ effect (env @: Clabels.here) e (env @: Clabels.next) (* -------------------------------------------------------------------------- *) (* --- Compiler: Assignment --- *) (* -------------------------------------------------------------------------- *) let set env lv exp = let here = Sigma.create () in let loc = C.lval here lv in let value = C.exp here exp in let obj = Ctypes.object_of (Cil.typeOfLval lv) in let next = Sigma.havoc here (M.domain obj loc) in let sequence = { pre=here ; post=next } in let ps = match value with | Loc ptr -> M.copied sequence obj loc ptr | Val term -> M.stored sequence obj loc term in let ps = List.map Cvalues.equation ps in let e = Cfg.E.create sequence (Lang.F.p_conj ps) in let descr = Format.asprintf "Set: @[%a = %a@]" Printer.pp_lval lv Printer.pp_exp exp in meta ~descr (env @: Clabels.here) @^ effect ( env @: Clabels.here ) e (env @: Clabels.next) (* -------------------------------------------------------------------------- *) (* --- Compiler: Return --- *) (* -------------------------------------------------------------------------- *) let return env e_opt = goto (env @: Clabels.here) (env @: Clabels.next) @^ match e_opt with | None -> nop | Some exp -> let rtyp = env.return in let here = Sigma.create () in let value = C.return here rtyp exp in let p = Lang.F.p_equal (Lang.F.e_var env.result) value in assume (Cfg.P.create (current env here) p) (* -------------------------------------------------------------------------- *) (* --- Compiler: Assertion --- *) (* -------------------------------------------------------------------------- *) let mk_frame ~descr env = let nsigmas = LabelMap.fold (fun _ (n : node) (nmap : M.sigma Cfg.Node.Map.t) -> if Cfg.Node.Map.mem n nmap then nmap else Cfg.Node.Map.add n (Sigma.create ()) nmap) env.flow Cfg.Node.Map.empty in let lsigmas = LabelMap.map (fun n -> try Cfg.Node.Map.find n nsigmas with Not_found -> assert false (* by nsigmas *)) env.flow in let frame_formals = L.mk_frame ~kf:env.kf ~descr:"frame_formals" ~labels:LabelMap.empty () in let formals = Varinfo.Map.map (fun (exp,n) -> try let here = Cfg.Node.Map.find n nsigmas in L.in_frame frame_formals (C.exp here) exp with Not_found -> Wp_parameters.fatal "node of formals not present in labels. normal?" ) env.subst_formals in let frame = L.mk_frame ~labels:lsigmas ~kf:env.kf ~result:(Sigs.R_var env.result) ~status:env.status ~formals ~descr () in frame, nsigmas, lsigmas let pred : env -> Sigs.polarity -> predicate -> _ = fun env polarity p -> (* Format.printf "env.flow: %a@." *) (* (Pretty_utils.pp_iter2 LabelMap.iter Label.pretty Cfg.Node.pp) *) (* env.flow; *) let frame, nsigmas, lsigmas = mk_frame ~descr:"pred" env in try let here = LabelMap.find Clabels.here lsigmas in let lenv = L.mk_env ~here () in let pred = L.in_frame frame (L.pred polarity lenv) p in (** Remove the sigmas not used for the compilation, but here must stay *) let nsigmas = Cfg.Node.Map.filter (fun _ s -> s == here || not (Sigma.Chunk.Set.is_empty (Sigma.domain s)) ) nsigmas in (Cfg.P.create nsigmas pred) with Not_found -> Wp_parameters.fatal "Error during compilation" let assert_ env p prop_id = let pos = pred env `Positive p.ip_content in let env' = env @* [Clabels.here, env @: Clabels.next ] in let neg = pred env' `Negative p.ip_content in let goal = { goal_pred = pos; goal_prop = prop_id; } in { paths_goals = Bag.elt goal; paths_cfg = Cfg.goto (env @: Clabels.here) (env @: Clabels.next); } @^ assume neg let assume_ : env -> Sigs.polarity -> predicate -> paths = fun env polarity p -> assume (pred env polarity p) (* -------------------------------------------------------------------------- *) (* --- Compiler: Function Call --- *) (* -------------------------------------------------------------------------- *) let rec call_kf : env -> lval option -> kernel_function -> exp list -> paths = fun env lvr kf es -> let pre_node = Cfg.node () in let post_node = Cfg.node () in let return_node = Cfg.node () in let next_node = env @: Clabels.next in let exit_stop = Cfg.node () in (* Caller's context: sigma, frame and actuals evaluated to this sigma *) let cfg_enter_scope = scope (env @* [Clabels.next,pre_node]) (* Clabels.here is here *) Enter (Kernel_function.get_formals kf) in let cfg_leave_scope = scope (env @* [Clabels.here,post_node;Clabels.next,return_node]) Leave (Kernel_function.get_formals kf) in let cfg_contract env = spec env (Annotations.funspec kf) in let result env = match lvr with | None -> goto (env @: Clabels.here) (env @: Clabels.next) | Some lv -> let pre = Sigma.create () in let tr = Cil.typeOfLval lv in let obj = Ctypes.object_of tr in let loc = C.lval pre lv in let post = Sigma.havoc pre (M.domain obj loc) in let vr = M.load post obj loc in let p = C.equal_typ tr vr (C.cast tr env.return (Val (Lang.F.e_var env.result))) in let e = Cfg.E.create { pre; post } p in effect (env @: Clabels.here) e (env @: Clabels.next) in let old_status = env.status in let exit_status (env:env) = let p = Lang.F.p_equal (Lang.F.e_var old_status) (Lang.F.e_var env.status) in let s = M.Sigma.create () in let e = Cfg.E.create {pre=s;post=s} p in effect (env @: Clabels.here) e (env @: Clabels.next) in let subst_formals = List.fold_left2 (fun acc v e -> Varinfo.Map.add v (e,pre_node) acc) Varinfo.Map.empty (Kernel_function.get_formals kf) es in let env_call = { (empty_env kf) with subst_formals } @* [Clabels.init, env @: Clabels.init; Clabels.pre, pre_node; Clabels.here, pre_node; Clabels.next, post_node; Clabels.post, post_node; Clabels.at_exit, env @: Clabels.at_exit] in (* TODO: Call inlining. *) nop @^ cfg_enter_scope @^ cfg_contract env_call @^ cfg_leave_scope @^ result (env_call @* [(Clabels.here, return_node); (Clabels.next, next_node)]) @^ exit_status (env_call @* [(Clabels.here, exit_stop); (Clabels.next, env @: Clabels.at_exit)]) and call : env -> lval option -> exp -> exp list -> paths = fun env lv e es -> match Kernel_function.get_called e with | Some kf -> call_kf env lv kf es | None -> not_yet "[StmtSemantics] Call through a function pointer." (* -------------------------------------------------------------------------- *) (* --- Compiler: Instruction --- *) (* -------------------------------------------------------------------------- *) and instr : env -> instr -> paths = fun env -> function | Set (lv, e, _) -> set env lv e | Call (lv, e, es, _) -> call env lv e es | Asm _ -> not_yet "[StmtSemantics] Inline Asm." | Local_init (v, ConsInit(f, args, kind), loc) -> Cil.treat_constructor_as_func (fun lv e es _ -> call env lv e es) v f args kind loc | Local_init (vi, AssignInit init, _) -> let here = Sigma.create () in let next = Sigma.create () in (*TODO: make something of warnings *) let hyp = Lang.F.p_all snd (C.init ~sigma:next vi (Some init)) in effect (env @: Clabels.here) (Cfg.E.create {pre=here; post=next} hyp) (env @: Clabels.next) | Skip _ | Code_annot _ -> goto (env @: Clabels.here) (env @: Clabels.next) (* -------------------------------------------------------------------------- *) (* --- Compiler: Annotations --- *) (* -------------------------------------------------------------------------- *) and spec : env -> spec -> paths = fun env spec -> let pre_cond env p prop_id = assert_ env p prop_id in let post_cond termination_kind env (tk, ip) = if tk = termination_kind then assume_ env `Positive ip.ip_content else nop in let behavior env b = let nrequires = Cfg.node () in let nassigns = Cfg.node () in let assume = let p = pred (env @* [Clabels.here, env @: Clabels.pre]) `Negative (Ast_info.behavior_assumes b) in match Cfg.P.to_condition p with | Some (c,None) -> c | Some (c,Some n) when Cfg.Node.equal n (env @: Clabels.pre) -> c | _ -> not_yet "assume of behaviors with labels: %a" Cfg.P.pretty p in let post_normal_behavior = Cfg.node () in let post_normal_env = env @* [Clabels.here, nassigns; Clabels.post, post_normal_behavior] in let post_at_exit_behavior = Cfg.node () in let post_at_exit_env = env @* [Clabels.here, nassigns; Clabels.post, post_at_exit_behavior] in assume, sequence (fun env ip -> (** TODO: Kglobal is it always Kglobal ? *) let prop_id = WpPropId.mk_pre_id env.kf Kglobal b ip in pre_cond env ip prop_id) (env @* [Clabels.next, nrequires]) b.b_requires @^ assigns (env @* [Clabels.here, nrequires; Clabels.next, nassigns]) b.b_assigns @^ either nassigns [post_normal_behavior;post_at_exit_behavior] @^ List.fold_left (fun acc post -> acc @^ post_cond Normal post_normal_env post) nop b.b_post_cond @^ List.fold_left (fun acc post -> acc @^ post_cond Exits post_at_exit_env post) nop b.b_post_cond @^ goto post_normal_behavior (env @: Clabels.post) @^ goto post_at_exit_behavior (env @: Clabels.at_exit) in let env = env @* [Clabels.here, env @: Clabels.pre; Clabels.next, env @: Clabels.post] in parallel behavior env spec.spec_behavior and assigns : env -> assigns -> paths = fun env a -> let frame, _, _ = mk_frame "assigns" env in let lenv = L.mk_env () in (* TODO: lenv for ghost code. *) let here = Sigma.create () in let authorized_region = L.in_frame frame (L.assigned_of_assigns ~unfold:false lenv) a in match authorized_region with | None -> goto (env @: Clabels.here) (env @: Clabels.next) | Some region -> let domain = A.domain region in let next = M.Sigma.havoc here domain in let seq = { pre = here; post = next } in let preds = A.apply_assigns seq region in effect (env @: Clabels.here) (Cfg.E.create seq (Lang.F.p_conj preds)) (env @: Clabels.next) and froms : env -> from list -> paths = fun env froms -> assigns env (Writes froms) (* -------------------------------------------------------------------------- *) (* --- Automaton --- *) (* -------------------------------------------------------------------------- *) let pref v1 v2 = let open Interpreted_automata in match v1.vertex_info, v2.vertex_info with | NoneInfo, NoneInfo -> 0 | NoneInfo, _ -> -1 | _ , NoneInfo -> 1 | LoopHead i, LoopHead j -> Transitioning.Stdlib.compare j i module Automata = Interpreted_automata.UnrollUnnatural.Version type nodes = { global: node Automata.Hashtbl.t; local: node Automata.Map.t; } let get_node nodes v = try Automata.Map.find v nodes.local with Not_found -> Automata.Hashtbl.memo nodes.global v (fun _ -> Cfg.node ()) let add_local nodes v n = {nodes with local = Automata.Map.add v n nodes.local} let transition : env -> nodes -> Automata.t Interpreted_automata.transition -> paths = fun env nodes tr -> let open Interpreted_automata in match tr with | Skip | Enter { blocals = [] } | Leave { blocals = [] } -> goto (env @: Clabels.here) (env @: Clabels.next) | Enter {blocals} -> scope env Sigs.Enter blocals | Leave {blocals} -> scope env Sigs.Leave blocals | Return (r,_) -> return env r | Prop ({kind = Assert|Invariant} as a, _) -> let env = Logic_label.Map.fold (fun logic_label vertex acc -> let c_label = Clabels.of_logic logic_label in let node = get_node nodes vertex in bind c_label node acc ) a.labels env in assert_ env a.predicate (WpPropId.mk_property a.property) | Prop ({kind = Assume} as a, _)-> let env = Logic_label.Map.fold (fun logic_label vertex acc -> let c_label = Clabels.of_logic logic_label in let node = get_node nodes vertex in bind c_label node acc ) a.labels env in assume (pred env `Negative a.predicate.ip_content) @^ goto (env @: Clabels.here) (env @: Clabels.next) | Prop _ -> not_yet "[StmtSemantics] Annots other than 'assert'" | Guard (exp,b,_) -> let here = Sigma.create () in let cond = C.cond here exp in let condition = Cfg.C.create here cond in (if b = Then then guard else guard') (env @: Clabels.here) condition (env @: Clabels.next) | Instr (i,_) -> instr env i let rec get_invariants g n (l:Automata.t Wto.partition) = let open Interpreted_automata in let open Interpreted_automata.UnrollUnnatural in match l, G.succ_e g n with | (Wto.Node a)::l, [(_,{edge_transition = (Prop({kind=Assert|Invariant|Assume|Check},_) | Skip) as t},b)] when Automata.equal a b -> let invs,l = get_invariants g b l in (t,a)::invs,l | _ -> [],(Wto.Node n)::l let as_assumes l = let open Interpreted_automata in List.map (function | (Prop({kind=Assume},_),_) as t -> t | (Prop({kind=Assert|Invariant} as a,s),b) -> (Prop ({a with kind=Assume},s),b) | (Prop({kind=Check},_),b) -> (Skip,b) | (Skip,_) as t -> t | _ -> assert false ) l let automaton : env -> Interpreted_automata.automaton -> paths = fun env a -> let open Interpreted_automata in let binder = M.configure_ia a in let bind = binder.bind in let wto = WTO.partition ~pref ~init:a.entry_point ~succs:(G.succ a.graph) in let index = Compute.build_wto_index_table wto in (* let cout = open_out "/tmp/automata.dot" in Interpreted_automata.output_to_dot cout ~wto ~number:`Vertex a; close_out cout; *) let open UnrollUnnatural in let g = unroll_unnatural_loop a wto index in let here = (a.entry_point,Vertex.Set.empty) in let next = (a.return_point,Vertex.Set.empty) in let wto = WTO.partition ?pref:None (* natural loop keep the heads *) ~succs:(UnrollUnnatural.G.succ g) ~init:here in let do_node nodes v paths = let n = get_node nodes v in let l,paths = G.fold_succ_e (fun (_,e,v2) (l,paths) -> let n2' = Cfg.node () in let n2 = get_node nodes v2 in (n2'::l, transition (env @* [Clabels.here,n2';Clabels.next,n2]) nodes e.edge_transition @^ add_tmpnode n2' @^ paths) ) g v ([],paths) in (either n l) @^ paths in let rec do_list ~fresh_nodes paths nodes n1 = function | [] -> (n1,paths) | (t,b)::l -> let n2, nodes = if fresh_nodes then let n2 = Cfg.node () in let nodes = add_local nodes b n2 in n2, nodes else (get_node nodes b), nodes in let paths = paths @^ transition (env @* [Clabels.here,n1;Clabels.next,n2]) nodes t in do_list ~fresh_nodes paths nodes n2 l in let rec component nodes paths = function | Wto.Node ((n, _) as v) -> bind n (do_node nodes v) paths | Wto.Component ((n, _) as v, l) -> let do_component (v, l) = assert (not (Automata.Map.mem v nodes.local)); let invariants,l = get_invariants g v l in let n = get_node {nodes with local = Automata.Map.empty} v in (* initialization *) let n,paths = do_list ~fresh_nodes:true paths nodes n invariants in (* preservation *) let n_loop = Cfg.node () in let _,paths = do_list ~fresh_nodes:true paths nodes n_loop invariants in (* arbitrary number of loop *) let n_havoc = Cfg.node () in let havoc = Cfg.havoc n ~effects:{pre=n_havoc;post=n_loop} n_havoc in let paths = (havoc |> paths_of_cfg) @^ paths in (* body *) let invariants_as_assumes = as_assumes invariants in let _,paths = do_list ~fresh_nodes:false paths (add_local nodes v n_havoc) n_havoc invariants_as_assumes in partition (add_local nodes v n_loop) paths l in bind n do_component (v, l) and partition nodes paths l = List.fold_left (component nodes) paths l in let nodes = { global = Automata.Hashtbl.create 10; local = Automata.Map.empty } in Automata.Hashtbl.add nodes.global here (env @: Clabels.here); Automata.Hashtbl.add nodes.global next (env @: Clabels.next); partition nodes nop wto (** connect init to here. [is_pre_main] indicate if here is the pre-state of main. *) let init ~is_pre_main env = let ninit = (env @: Clabels.init) in let sinit = Sigma.create () in (** todo WpStrategy.is_main_init, need to test that seq.pre is the start of the function *) (** todo warning *) let cfg_init = Globals.Vars.fold_in_file_order (fun var initinfo cfg -> if var.vstorage = Extern then cfg else let h = Lang.F.p_all snd (C.init ~sigma:sinit var initinfo.init) in let h = Cfg.P.create (Cfg.Node.Map.add ninit sinit Cfg.Node.Map.empty) h in assume h ) nop in if is_pre_main then cfg_init @^ goto ninit (env @: Clabels.here) else let nconst = Cfg.Node.create () in let sconst = Sigma.havoc_any ~call:false sinit in let havoc = Cfg.E.create {pre=sinit; post=sconst} Lang.F.p_true in let consts = if WpStrategy.isInitConst () then Globals.Vars.fold_in_file_order (fun var _ cfg -> if WpStrategy.isGlobalInitConst var then let h = (C.unchanged sconst sinit var) in let h = Cfg.P.create (Cfg.Node.Map.add ninit sinit (Cfg.Node.Map.add nconst sconst Cfg.Node.Map.empty)) h in cfg @^ assume h else cfg ) nop else nop in cfg_init @^ effect ninit havoc nconst @^ consts @^ goto nconst (env @: Clabels.here) let pre_spec env spec = let pre_cond polarity env p = assume_ (env @* [Clabels.here, env @: Clabels.pre]) polarity p in let behavior env b = let assume = let p = pred env `Negative (Ast_info.behavior_assumes b) in match Cfg.P.to_condition p with | Some (c,None) -> c | Some (c,Some n) when Cfg.Node.equal n (env @: Clabels.here) -> c | _ -> not_yet "assume of behaviors with labels: %a" Cfg.P.pretty p in assume, List.fold_left (fun acc ip -> acc @^ pre_cond `Negative env ip.ip_content) nop b.b_requires @^ goto (env @: Clabels.here) (env @: Clabels.next) in parallel behavior env spec.spec_behavior let post_normal_spec env spec = let post_cond termination_kind env (tk, ip) propid = if tk = termination_kind then assert_ env ip propid else nop in let behavior env b = let assume = let p = pred (env @* [Clabels.here, env @: Clabels.pre]) `Negative (Ast_info.behavior_assumes b) in match Cfg.P.to_condition p with | Some (c,None) -> c | Some (c,Some n) when Cfg.Node.equal n (env @: Clabels.pre) -> c | _ -> not_yet "assume of behaviors with labels: %a" Cfg.P.pretty p in assume, sequence (fun env post -> let propid = WpPropId.mk_fct_post_id env.kf b post in post_cond Normal env post propid) env b.b_post_cond in let env = env in parallel behavior env spec.spec_behavior let compute_kf kf = let open Interpreted_automata in let autom = Compute.get_automaton ~annotations:true kf in (* let cout = open_out (Format.sprintf "/tmp/cfg_automata_%s.dot" (Kernel_function.get_name kf)) in * Interpreted_automata.Compute.output_to_dot cout autom; * close_out cout; *) let binder = M.configure_ia autom in let bind = binder.bind in let spec = Annotations.funspec kf in (* start and end nodes of pre(resp. post)-conditions. *) let pres = { pre = Cfg.node (); post = Cfg.node () } in let posts = { pre = Cfg.node (); post = Cfg.node () } in let env = empty_env kf @* [Clabels.pre,pres.post;Clabels.post,posts.pre] in (* initialization *) let init = init ~is_pre_main:(WpStrategy.is_main_init kf) (env @* [Clabels.here,pres.pre]) in (* pre-condition *) let pre = bind autom.entry_point @@ pre_spec (env @* [Clabels.here,pres.pre;Clabels.next,pres.post]) in (* code *) let paths = automaton (env @* [Clabels.here,pres.post;Clabels.next,posts.pre]) autom in (* post-condition *) let post = bind autom.return_point @@ post_normal_spec (env @* [Clabels.here,posts.pre;Clabels.next,posts.post]) in init @^ pre spec @^ paths @^ post spec, env @: Clabels.init end ��������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/StmtSemantics.mli�����������������������������������������������0000666�0000000�0000000�00000011226�13571573400�017414� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Clabels module Make(Compiler : Sigs.Compiler) : sig module Cfg : CfgCompiler.Cfg with module S = Compiler.M.Sigma type node = Cfg.node type goal = { goal_pred : Cfg.P.t; goal_prop : WpPropId.prop_id; } type cfg = Cfg.cfg type paths = { paths_cfg : cfg; paths_goals : goal Bag.t; } val goals_nodes: goal Bag.t -> Cfg.Node.Set.t exception LabelNotFound of c_label (** Compilation environment *) type env val empty_env : Kernel_function.t -> env val bind : c_label -> node -> env -> env val result : env -> Lang.F.var val (@^) : paths -> paths -> paths (** Same as [Cfg.concat] *) val (@*) : env -> ( c_label * node ) list -> env (** fold bind *) val (@:) : env -> c_label -> node (** LabelMap.find with refined excpetion. @raise LabelNotFound instead of [Not_found] *) val (@-) : env -> (c_label -> bool) -> env val sequence : (env -> 'a -> paths) -> env -> 'a list -> paths (** Chain compiler by introducing fresh nodes between each element of the list. For each consecutive [x;y] elements, a fresh node [n] is created, and [x] is compiled with [Next:n] and [y] is compiled with [Here:n]. *) val choice : ?pre:c_label -> ?post:c_label -> (env -> 'a -> paths) -> env -> 'a list -> paths (** Chain compiler in parallel, between labels [~pre] and [~post], which defaults to resp. [here] and [next]. The list of eventualities is exhastive, hence an [either] assumption is also inserted. *) val parallel : ?pre:c_label -> ?post:c_label -> (env -> 'a -> Cfg.C.t * paths) -> env -> 'a list -> paths (** Chain compiler in parallel, between labels [~pre] and [~post], which defaults to resp. [here] and [next]. The list of eventualities is exhastive, hence an [either] assumption is also inserted. *) (** {2 Instructions Compilation} Each instruction or statement is typically compiled between [Here] and [Next] nodes in the [flow]. [Pre], [Post] and [Exit] are reserved for the entry and exit points of current function. in [flow] are used when needed such as [Break] and [Continue] and should be added before calling. *) val set : env -> lval -> exp -> paths val scope : env -> Sigs.scope -> varinfo list -> paths val instr : env -> instr -> paths val return : env -> exp option -> paths val assume : Cfg.P.t -> paths val call_kf : env -> lval option -> kernel_function -> exp list -> paths val call : env -> lval option -> exp -> exp list -> paths (** {2 ACSL Compilation} *) val spec : env -> spec -> paths val assume_ : env -> Sigs.polarity -> predicate -> paths val assigns : env -> assigns -> paths val froms : env -> from list -> paths (** {2 Automata Compilation} *) val automaton : env -> Interpreted_automata.automaton -> paths val init: is_pre_main:bool -> env -> paths (** {2 Full Compilation} Returns the set of all paths for the function, with all proof obligations. The returned node corresponds to the [Init] label. *) val compute_kf: Kernel_function.t -> paths * node end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Strategy.ml�����������������������������������������������������0000666�0000000�0000000�00000012472�13571573400�016253� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Lookup Selection --- *) (* -------------------------------------------------------------------------- *) open Lang open Lang.F open Tactical open Conditions type lookup = { target : Lang.F.term ; mutable marked : Tset.t ; } let lookup_term env e = let rec walk env e = if e == env.target then raise Exit ; if not (Tset.mem e env.marked) then begin env.marked <- Tset.add e env.marked ; Lang.F.lc_iter (walk env) e ; end in try walk env e ; false with Exit -> true let occurs_x x a = F.Vars.mem x (F.vars a) let occurs_y x p = F.Vars.mem x (F.varsp p) let occurs_e a b = lookup_term { target = a ; marked = Tset.empty } b let occurs_p a p = occurs_e a (F.e_prop p) let occurs_q p q = occurs_e (F.e_prop p) (F.e_prop q) let lookup_step env queue s = match s.condition with | State _ -> Empty | When p | Have p | Init p | Core p | Type p -> let p = Lang.F.e_prop p in if p == env.target then Clause(Step s) else if lookup_term env p then Inside(Step s,env.target) else Empty | Branch(c,sa,sb) -> let p = Lang.F.e_prop c in if lookup_term env p then Inside(Step s,env.target) else ( Queue.add sa queue ; Queue.add sb queue ; Empty ) | Either cs -> List.iter (fun s -> Queue.add s queue) cs ; Empty exception Found of selection let lookup_sequence env queue seq = Conditions.iter (fun s -> match lookup_step env queue s with | Empty -> () | sel -> raise (Found sel) ) seq let select_e (sequence,goal) e = let g = Lang.F.e_prop goal in if g == e then Clause(Goal goal) else let env = { target = e ; marked = Tset.empty } in if lookup_term env g then Inside(Goal goal,e) else try let queue = Queue.create () in lookup_sequence env queue sequence ; while not (Queue.is_empty queue) do lookup_sequence env queue (Queue.pop queue) done ; Empty with Found sel -> sel let select_p seq p = select_e seq (F.e_prop p) (* -------------------------------------------------------------------------- *) (* --- Elementary Tactics --- *) (* -------------------------------------------------------------------------- *) type argument = ARG: 'a field * 'a -> argument type strategy = { priority : float ; tactical : tactical ; selection : selection ; arguments : argument list ; } and t = strategy let highest a b = Transitioning.Stdlib.compare b.priority a.priority class pool = object val pool : strategy Vector.t = Vector.create () method add = Vector.add pool method sort = let hs = Vector.to_array pool in Array.stable_sort highest hs ; hs end class type heuristic = object method id : string method title : string method descr : string method search : (strategy -> unit) -> sequent -> unit end module Tmap = Map.Make(String) let registry = ref Tmap.empty let register s = let id = s#id in if Tmap.mem id !registry then Wp_parameters.error "Strategy #%s already registered (skipped)" id else registry := Tmap.add id (s :> heuristic) !registry let export s = register s ; (s :> heuristic) let lookup ~id = Tmap.find id !registry let iter f = Tmap.iter (fun _ s -> f s) !registry let arg fd v = ARG(fd,v) let set_arg (tactical : #tactical) = function ARG(fd,v) -> tactical#set_field fd v let set_args tactical arguments = List.iter (set_arg tactical) arguments let make tactical ?(priority=1.0) ?(arguments=[]) selection = { priority ; tactical ; selection ; arguments } (* -------------------------------------------------------------------------- *) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Strategy.mli����������������������������������������������������0000666�0000000�0000000�00000006033�13571573400�016420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** {2 Term & Predicate Selection} *) open Lang.F open Conditions open Tactical val occurs_x : var -> term -> bool val occurs_y : var -> pred -> bool val occurs_e : term -> term -> bool val occurs_p : term -> pred -> bool val occurs_q : pred -> pred -> bool (** Lookup the first occurrence of term in the sequent and returns the associated selection. Returns [Empty] is not found. Goal is lookup first. *) val select_e : sequent -> term -> selection (** Same as [select_e] but for a predicate. *) val select_p : sequent -> pred -> selection (** {2 Strategy} *) type argument = ARG: 'a field * 'a -> argument type strategy = { priority : float ; tactical : tactical ; selection : selection ; arguments : argument list ; } class pool : object method add : strategy -> unit method sort : strategy array end class type heuristic = object method id : string method title : string method descr : string method search : (strategy -> unit) -> sequent -> unit end val register : #heuristic -> unit val export : #heuristic -> heuristic val lookup : id:string -> heuristic val iter : (heuristic -> unit) -> unit (** {2 Factory} *) type t = strategy val arg : 'a field -> 'a -> argument val make : tactical -> ?priority:float -> ?arguments:argument list -> selection -> strategy (**/**) (* To be used only when applying the tactical *) val set_arg : tactical -> argument -> unit val set_args : tactical -> argument list -> unit �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacArray.ml�����������������������������������������������������0000666�0000000�0000000�00000005442�13571573400�016156� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Tactical (* -------------------------------------------------------------------------- *) (* --- Array Tactical --- *) (* -------------------------------------------------------------------------- *) (* Detects a[i->e][j] pattern *) let access_update_pattern e = let open Qed.Logic in match F.repr e with | Aget(u,j) -> begin match F.repr u with | Aset(a,i,e) -> Some(a,i,e,j) | _ -> None end | _ -> None class array = object inherit Tactical.make ~id:"Wp.array" ~title:"Array" ~descr:"Decompose array access-update patterns" ~params:[] method select feedback (s : Tactical.selection) = let e = Tactical.selected s in match access_update_pattern e with | None -> Not_applicable | Some(a,i,v,j) -> ignore feedback ; let at = Tactical.at s in let cases = [ "Same Indices" , F.p_equal i j , e , v ; "Diff Indices" , F.p_neq i j , e , F.e_get a j ; ] in Applicable (Tactical.rewrite ?at cases) end let tactical = Tactical.export (new array) let strategy = Strategy.make tactical ~arguments:[] ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacArray.mli����������������������������������������������������0000666�0000000�0000000�00000003361�13571573400�016325� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Array Tactical (auto-registered) *) open Tactical open Strategy val tactical : tactical val strategy : ?priority:float -> selection -> strategy �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacBitrange.ml��������������������������������������������������0000666�0000000�0000000�00000026100�13571573400�016625� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang (* Helpers *) let is_positive e = F.p_leq F.e_zero e (* 0 <= n *) let is_negative e = F.p_lt e F.e_zero (* n < 0 *) (* Requires 2^i < n && 0 <= i < j *) let rec log2m i j n = let b = Integer.two_power_of_int j in if Integer.lt b n then log2m j (2*j) n else (* 2^i < n <= 2^j *) if Integer.equal b n then j else (* 2^i < n < 2^j *) log2d i j n (* Requires 2^i < n < 2 ^j && 0 <= i < j *) and log2d i j n = if succ i = j then i else let k = (i+j)/2 in let a = Integer.two_power_of_int k in let c = Integer.compare a n in if c > 0 then log2d i k n else (* a=2^k > n *) if c < 0 then log2d k j n else (* a=2^k < n *) k (* Theorem LAND-1: derived from Cbits.uint_land_range exists i, 0 <= e_i <= n ----------------------------- 0 <= land(e_1,...,e_n) <= n Theorem LAND-2: partially derived from Cbits.sint_land_inf forall i, -2^p <= e_i <= n < 0 ------------------------------------------- -2^p <= land(e_1,...,e_n) <= e_i <= n < 0 *) let land_leq ~positive es n = (* land(e_1,...,e_n) <= n *) if Integer.(le zero n) then (* From theorem LAND-1 when 0<=n: (exist i, 0 <= e_i <= n) |- 0 <= land(e_1,...,e_n) <= n *) let a = F.e_zint n in let case1 = F.p_any (fun e -> F.p_and (is_positive e) (F.p_leq e a)) es in if positive then case1 else (* From theorem LAND-2: when 0 <= n (forall i, e_i < 0) && -1 <= 0 <= n |- land(e_1,...e_n) <= -1 <= 0 <= n *) let case2 = F.p_any is_negative es in F.p_or case1 case2 else if positive then raise Not_found else (* From theorem LAND-2 when n<0: (forall i, e_i <= n < 0) |- land(e_1,...,e_n) <= n < 0*) let a = F.e_zint n in let case1 = F.p_any (fun e -> F.p_leq e a) es in if Integer.(lt n minus_one) then case1 else (* From theorem LAND-2: when -1 == n (forall i, e_i < 0) && -1 <= 0 <= n |- land(e_1,...e_n) <= -1 <= 0 <= n *) let case2 = F.p_any is_negative es in F.p_or case1 case2 let leq_land ~positive n es = (* n <= land(e_1,...,e_n) *) if Integer.(le n zero) then (* From theorem LAND-1 when n<=0: (exist i, n <= 0 <= e_i) |- n <= 0 <= land(e_1,...,e_n) *) F.p_any is_positive es else if positive then raise Not_found else let p = log2m 0 1 (Integer.neg n) in (* Have n <= -2^p < 0 From theorem LAND-2: when n <= -2^p < 0 (forall i, n <= -2^p <= e_i < 0) |- n <= land(e_1,...e_n) < 0 *) let a = F.e_zint Integer.(neg (two_power_of_int p)) in F.p_all (fun e -> F.p_and (is_negative e) (F.p_lt a e)) es (* Theorem LOR-1: partially derived from Cbits.uint_lor_inf forall i, 0 <= e_i <= 2^p-1 ----------------------------- forall i, 0 <= e_i <= lor(e_1,...,e_n) <= 2^p-1 Theorem LOR-2: derived from Cbits.sint_lor_range exist i, e_i <= n < 0 ----------------------------- n <= lor(e_1,...,e_n) < 0 *) let lor_leq ~positive es n = (* lor(e_1,...,e_n) <= n *) if Integer.(le zero n) then let p = log2m 0 1 (Integer.succ n) in (* Have 0 <= 2^p <= n+1, hence 0 <= 2^p-1 <= n. From theorem LOR-1 when 0 <= 2^p-1 <= n (forall i, 0<= e_i <= 2^p-1 <=n) ==> 0<=lor(e_1,...,e_n) <= 2^p-1 <=n *) let a = F.e_zint (Integer.two_power_of_int p) in let case1 = F.p_all (fun e -> F.p_and (is_positive e) (F.p_lt e a)) es in if positive then case1 else (* From theorem LOR-2 when 0<=n: (exist i, e_i < 0 <= n) |- lor(e_1,...,e_n) < 0 <= n*) let case2 = F.p_any is_negative es in F.p_or case1 case2 else raise Not_found let leq_lor ~positive n es = (* n <= lor(e_1,...,e_n) *) if Integer.(le zero n) then (* From theorem LOR-1 when 0<=n: (forall i, 0 <= n <= e_i) |- 0 <= n <= lor(e_1,...,e_n) *) let a = F.e_zint n in F.p_all (fun e -> F.p_leq a e) es else if positive then raise Not_found else (* From theorem LOR-1 when n<0: (forall i, n < 0 <= e_i) |- n < 0 <= lor(e_1,...,e_n) *) let case1 = F.p_all is_positive es in (* From theorem LOR-2 when n<0: (exist i, n <= e_i < 0) |- n <= lor(e_1,...,e_n) < 0 *) let a = F.e_zint n in let case2 = F.p_any (fun e -> F.p_and (F.p_leq a e) (is_negative e)) es in F.p_or case1 case2 (* -------------------------------------------------------------------------- *) (* --- Patterns --- *) (* -------------------------------------------------------------------------- *) type pattern = | LEQ of pattern * pattern | LT of pattern * pattern | INT | LAND | LOR type sigma = { plor : bool ; pland : bool ; mutable bound : Integer.t ; mutable terms : F.term list ; } let rec pmatch s p e = let open Qed.Logic in match p , F.repr e with | LEQ(p,q) , Leq(a,b) | LT(p,q) , Lt(a,b) -> pmatch s p a ; pmatch s q b | INT , Kint n -> s.bound <- n | LAND , Fun(f,es) when f == Cint.f_land -> s.terms <- es | LOR , Fun(f,es) when f == Cint.f_lor -> s.terms <- es | _ -> raise Exit let matches s p e = try pmatch s p e ; true with Exit -> false let patterns : (pattern * (sigma -> F.pred)) list = [ LEQ(INT,LAND) , (fun s -> leq_land ~positive:s.pland s.bound s.terms) ; LT(INT,LAND) , (fun s -> leq_land ~positive:s.pland (Integer.succ s.bound) s.terms) ; LEQ(LAND,INT) , (fun s -> land_leq ~positive:s.pland s.terms s.bound) ; LT(LAND,INT) , (fun s -> land_leq ~positive:s.pland s.terms (Integer.pred s.bound)) ; LEQ(INT,LOR) , (fun s -> leq_lor ~positive:s.plor s.bound s.terms) ; LT(INT,LOR) , (fun s -> leq_lor ~positive:s.plor (Integer.succ s.bound) s.terms) ; LEQ(LOR,INT) , (fun s -> lor_leq ~positive:s.plor s.terms s.bound) ; LT(LOR,INT) , (fun s -> lor_leq ~positive:s.plor s.terms (Integer.pred s.bound)) ; ] let select_goal ~pland ~plor g = try let s = { pland ; plor ; bound = Integer.zero ; terms = [] } in let (_,f) = List.find (fun (p,_) -> matches s p g) patterns in Some (f s) with Not_found -> None let rec split_goals ~pland ~plor others ranges = function | [] -> List.rev others , List.rev ranges | g::gs -> begin match select_goal ~pland ~plor g with | None -> split_goals ~pland ~plor (F.p_bool g::others) ranges gs | Some g' -> split_goals ~pland ~plor others (g'::ranges) gs end let range_goal g' (hs,_) = ["bit-range" , (hs,g')] let range_goals gs' (hs,_) = List.map (fun g' -> "bit-range" , (hs,g')) gs' let other_goals ps (hs,_) = List.map (fun p -> "split" , (hs,p)) ps open Tactical let positive_land = Tactical.checkbox ~id:"positive-land" ~title:"Force positive logical-and" ~descr:"Requires to obtain a result from (at least one) positive operands" ~default:true () let positive_lor = Tactical.checkbox ~id:"positive-lor" ~title:"Force negative logical-or" ~descr:"Restrict to obtain a positive result from (all) positive operands" ~default:true () class bitrange = object(self) inherit Tactical.make ~id:"Wp.bitrange" ~title:"Bit Range" ~descr:"Bounds of Bitwise Operators" ~params:[snd positive_land;snd positive_lor] method select feedback = function | Clause(Goal p) -> begin let goals = let e = F.e_prop p in match F.repr e with | Qed.Logic.And es -> es | Qed.Logic.Leq _ | Qed.Logic.Lt _ -> [e] | _ -> raise Not_found in let pland = self#get_field (fst positive_land) in let plor = self#get_field (fst positive_lor) in let others,ranges = split_goals ~pland ~plor [] [] goals in if ranges = [] then Tactical.Not_applicable else begin if others = [] then feedback#set_title "Split & Bit Range(s)" else feedback#set_title "Bit Range(s)" ; Tactical.Applicable (fun seq -> other_goals others seq @ range_goals ranges seq) end end | Inside(Goal p,e) -> begin let g = F.e_prop p in match F.repr g with | Qed.Logic.And es when List.memq e es -> begin let pland = self#get_field (fst positive_land) in let plor = self#get_field (fst positive_lor) in match select_goal ~pland ~plor g with | Some g' -> Tactical.Applicable(range_goal g') | None -> Tactical.Not_applicable end | _ -> Tactical.Not_applicable end | _ -> Tactical.Not_applicable end let tactical = Tactical.export (new bitrange) let strategy = Strategy.make tactical ~arguments:[] (* -------------------------------------------------------------------------- *) (* --- Auto Bitrange --- *) (* -------------------------------------------------------------------------- *) let is_bitwised e = let open Qed.Logic in match F.repr e with | Fun(f,_) -> List.memq f Cint.f_bitwised | _ -> false class autobitrange = object method id = "wp:bitrange" method title = "Auto Bit-Range" method descr = "Apply Bit-Range on comparison with bitwised operations" method search push (seq : Conditions.sequent) = let goal = snd seq in let open Qed.Logic in match F.e_expr goal with | Lt(x,y) | Leq(x,y) when is_bitwised x || is_bitwised y -> push (strategy Tactical.(Clause (Goal goal))) | _ -> () end let () = Strategy.register (new autobitrange) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacBitrange.mli�������������������������������������������������0000666�0000000�0000000�00000003503�13571573400�017000� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Bit Range Tactical (auto-registered) *) open Tactical open Strategy val tactical : tactical val strategy : ?priority:float -> selection -> strategy (**************************************************************************) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacBitwised.ml��������������������������������������������������0000666�0000000�0000000�00000012446�13571573400�016654� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang let range a n = let vmax = Integer.two_power_of_int n in F.p_and (F.p_leq F.e_zero a) (F.p_lt a (F.e_zint vmax)) (* starts from 0 *) let bit_test x k = Cint.l_and x (F.e_int (1 lsl k)) (* from n downto 0 *) let rec bitwise_eqs a b n = if n >= 0 then F.e_eq (bit_test a n) (bit_test b n) :: bitwise_eqs a b (n-1) else [] (* bitwise eq on n bits *) let bitwise_eq a b n = F.e_and (bitwise_eqs a b (n-1)) let rewrite descr u v = Tactical.rewrite [ descr , F.p_true , u , v ] let vrange,prange = Tactical.spinner ~id:"Wp.bitwised.range" ~vmin:0 ~vmax:64 ~default:32 ~title:"Bits" ~descr:"Number of bits for bitwise equality" () class bitcase = object(self) inherit Tactical.make ~id:"Wp.bitwised" ~title:"Bitwise Eq." ~descr:"Decompose Bitwise Equality" ~params:[prange] (* range:(0 <= a < 2^n && 0 <= b < 2^n) && bitwise:(forall k; 0 <= k <= n ==> (bit(a,k) <==> bit(b,k))) |- a <= b *) method private process (feedback:Tactical.feedback) ~neq e a b = if F.is_int a && F.is_int b then let n = self#get_field vrange in let inrange = F.p_and (range a n) (range b n) in let bitwise = bitwise_eq a b n in let e' = if neq then F.e_not bitwise else bitwise in feedback#set_title "Bitwise %s. (%d bits)" (if neq then "Neq" else "Eq") n ; Tactical.Applicable (fun seq -> ("range" , (fst seq , inrange)) :: rewrite "bitwise" e e' seq) else Tactical.Not_applicable method select feedback selection = let e = Tactical.selected selection in let open Qed.Logic in match F.repr e with | Eq(a,b) -> self#process feedback ~neq:false e a b | Neq(a,b) -> self#process feedback ~neq:true e a b | _ -> Tactical.Not_applicable end let tactical = Tactical.export (new bitcase) let strategy ?(priority=1.0) selection ~nbits = Strategy.{ priority ; tactical ; selection ; arguments = [ arg vrange nbits ] ; } (* -------------------------------------------------------------------------- *) (* --- Auto Bitwise --- *) (* -------------------------------------------------------------------------- *) let is_bitwised e = let open Qed.Logic in match F.repr e with | Fun(f,_) -> List.memq f Cint.f_bitwised | _ -> false let rec lookup push clause ~nbits ~priority p = let open Qed.Logic in match F.repr p with | And ps | Or ps -> List.iter (lookup push clause ~priority ~nbits) ps | Imply(hs,p) -> List.iter (lookup push clause ~priority ~nbits) (p::hs) | Eq(x,y) | Neq(x,y) when F.is_int x && F.is_int y -> let bx = is_bitwised x in let by = is_bitwised y in if bx || by then let priority = if bx && by then priority else priority *. 0.8 in push (strategy ~priority ~nbits Tactical.(Inside(clause,p))) | _ -> () class autobitwise = object(self) method private nbits = Ctypes.i_bits (Ctypes.c_ptr ()) method id = "wp:bitwised" method title = Printf.sprintf "Auto Bitwise Eq. (%d)" self#nbits method descr = Printf.sprintf "Apply Bitwise Equality on wordsize bits (%d)" self#nbits method search push (seq : Conditions.sequent) = let goal = snd seq in let nbits = self#nbits in lookup push (Tactical.Goal goal) ~nbits ~priority:1.0 (F.e_prop goal) ; Conditions.iter (fun step -> let p = Conditions.head step |> F.e_prop in lookup push (Tactical.Step step) ~nbits ~priority:0.5 p ) (fst seq) end let () = Strategy.register (new autobitwise) (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacBitwised.mli�������������������������������������������������0000666�0000000�0000000�00000003522�13571573400�017020� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Bitwised-Eq Tactical (auto-registered) *) open Tactical open Strategy val tactical : tactical val strategy : ?priority:float -> selection -> nbits:int -> strategy (**************************************************************************) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacChoice.ml����������������������������������������������������0000666�0000000�0000000�00000011037�13571573400�016267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Conditions open Tactical (* -------------------------------------------------------------------------- *) (* --- Choice Tactical --- *) (* -------------------------------------------------------------------------- *) class choice = object inherit Tactical.make ~id:"Wp.choice" ~title:"Choice" ~descr:"Select a Goal Alternative" ~params:[] method select _feedback (s : Tactical.selection) = match s with | Inside(Goal p,q) -> begin match F.e_expr p with | Qed.Logic.Or qs when List.memq q qs -> Applicable (fun (hs,_) -> ["Choice",(hs,F.p_bool q)]) | _ -> Not_applicable end | Empty | Compose _ | Clause _ | Inside(Step _,_) -> Not_applicable end class absurd = object inherit Tactical.make ~id:"Wp.absurd" ~title:"Absurd" ~descr:"Contradict an Hypothesis" ~params:[] method select _feedback (s : Tactical.selection) = match s with | Empty | Compose _ | Inside _ | Clause(Goal _) -> Not_applicable | Clause(Step s) -> begin match s.condition with | Have p | When p | Core p | Init p | Type p -> let absurd seq = let emp = Conditions.(step (Have F.p_true)) in let seq = Conditions.replace ~at:s.id emp seq in [ "Absurd" , (fst seq , F.p_not p) ] in Applicable absurd | Branch _ | Either _ | State _ -> Not_applicable end end class contrapose = object inherit Tactical.make ~id:"Wp.contrapose" ~title:"Contrapose" ~descr:"Swap and Negate Hypothesis with Conclusion" ~params:[] method select _feedback (s : Tactical.selection) = match s with | Empty | Compose _ | Inside _ | Clause(Goal _) -> Not_applicable | Clause(Step s) -> begin match s.condition with | Have p | When p | Core p | Init p | Type p -> let contrapose (hs,goal) = let descr = "Contrapose" in let goal = F.p_not goal in let goal = Conditions.(step ~descr (Have goal)) in let hs = Conditions.replace ~at:s.id goal (hs , F.p_false) in [ "Contrapose" , (fst hs , F.p_not p) ] in Applicable contrapose | Branch _ | Either _ | State _ -> Not_applicable end end module Choice = struct let tactical = Tactical.export (new choice) let strategy = Strategy.make tactical ~arguments:[] end module Absurd = struct let tactical = Tactical.export (new absurd) let strategy = Strategy.make tactical ~arguments:[] end module Contrapose = struct let tactical = Tactical.export (new contrapose) let strategy = Strategy.make tactical ~arguments:[] end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacChoice.mli���������������������������������������������������0000666�0000000�0000000�00000004001�13571573400�016431� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Choice, Absurd & Contrapose Tactical (auto-registered) *) open Tactical open Strategy module Choice : sig val tactical : tactical val strategy : ?priority:float -> selection -> strategy end module Absurd : sig val tactical : tactical val strategy : ?priority:float -> selection -> strategy end module Contrapose : sig val tactical : tactical val strategy : ?priority:float -> selection -> strategy end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacCompound.ml��������������������������������������������������0000666�0000000�0000000�00000020115�13571573400�016656� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Lang.F open Conditions open Tactical (* -------------------------------------------------------------------------- *) (* --- Compound Equality --- *) (* -------------------------------------------------------------------------- *) type update = term * term * term type equality = | Record of term * term * Lang.field list (* a.f = b.f forall f *) | Array1 of update * term * tau | Array2 of update * update * tau (* -------------------------------------------------------------------------- *) (* --- Record Patterns --- *) (* -------------------------------------------------------------------------- *) let get_record_assoc = function | (f,_)::_ -> Some (Lang.fields_of_field f) | _ -> None let get_record_type = function | Qed.Logic.Record fts -> get_record_assoc fts | _ -> None let get_record_term a = match F.repr a with | Qed.Logic.Rdef fvs -> get_record_assoc fvs | Qed.Logic.Fvar x -> get_record_type (F.tau_of_var x) | _ -> None (* -------------------------------------------------------------------------- *) (* --- Array Patterns --- *) (* -------------------------------------------------------------------------- *) let rec typeof_index a k = try F.typeof k with Not_found -> match F.repr a with | Qed.Logic.Aset(a,k,_) -> typeof_index a k | _ -> typeof_domain a and typeof_domain a = match F.typeof a with | Qed.Logic.Array(t,_) -> t | _ -> raise Not_found and typeof_update (a,k,_) = typeof_index a k let get_array_update a = match F.repr a with | Qed.Logic.Aset(a,k,v) -> Some (a,k,v) | _ -> None (* -------------------------------------------------------------------------- *) (* --- Equality Patterns --- *) (* -------------------------------------------------------------------------- *) let array1 upd a = let t = try typeof_domain a with Not_found -> typeof_update upd in Array1(upd,a,t) let array2 p q = let t = try typeof_update p with Not_found -> typeof_update q in Array2(p,q,t) let get_compound_cmp a b = match get_record_term a with | Some fs -> Record(a,b,fs) | None -> match get_record_term b with | Some fs -> Record(a,b,fs) | None -> match get_array_update a , get_array_update b with | None , None -> raise Not_found | Some upd , None -> array1 upd b | None , Some upd -> array1 upd a | Some p , Some q -> array2 p q let get_compound_equality e = match F.repr e with | Qed.Logic.Eq(a,b) -> true , get_compound_cmp a b | Qed.Logic.Neq(a,b) -> false , get_compound_cmp a b | _ -> raise Not_found (* -------------------------------------------------------------------------- *) (* --- Clauses --- *) (* -------------------------------------------------------------------------- *) let field a b f = Pretty_utils.sfprintf "Field %a" Lang.Field.pretty f , F.p_equal (F.e_getfield a f) (F.e_getfield b f) let index ~pool tau = let x = F.fresh pool tau in [x] , F.e_var x let eq i j p = F.p_imply (F.p_equal i j) p let neq i j p = F.p_imply (F.p_neq i j) p let get1 a k v = F.p_equal (F.e_get a k) v let get2 a b k = F.p_equal (F.e_get a k) (F.e_get b k) let clause ~pool = function | Record(a,b,fs) -> List.map (field a b) fs | Array1((a,i,u),b,t) -> let ks,k = index ~pool t in [ "Updated" , get1 b i u ; "Others" , F.p_forall ks (neq i k (get2 a b k)) ] | Array2((a,i,u),(b,j,v),t) -> let ks,k = index ~pool t in [ "Updated (both)" , eq i j (F.p_equal u v) ; "Updated (left)" , neq i j (get1 a j v) ; "Updated (right)" , neq i j (get1 b i u) ; "Others" , F.p_forall ks (neq i k (neq j k (get2 a b k))) ] (* -------------------------------------------------------------------------- *) (* --- Compound Tactic --- *) (* -------------------------------------------------------------------------- *) let conj cs = F.p_all snd cs let disj cs = F.p_any (fun (_,p) -> F.p_not p) cs let negative (f,p) = f , When (F.p_not p) let name eq = if eq then "eq" else "neq" let kind = function Record _ -> "compound" | Array1 _ | Array2 _ -> "array" let equality eq = if eq then "equality" else "dis-equality" let process_expand (feedback : Tactical.feedback) ?at e = let pool = feedback#pool in let eq,cmp = get_compound_equality e in feedback#set_title "Compound (%s)" (name eq) ; feedback#set_descr "Expand %s %s" (kind cmp) (equality eq) ; let e' = (if eq then conj else disj) (clause ~pool cmp) in let cases = [feedback#get_title,F.p_true,e,F.e_prop e'] in Tactical.rewrite ?at cases let process_have (feedback : Tactical.feedback) s = let pool = feedback#pool in let e = F.e_prop (Conditions.have s) in let eq,cmp = get_compound_equality e in if eq then begin feedback#set_title "Compound (eq)" ; feedback#set_descr "Expand %s equality" (kind cmp) ; let cases = ["Compound (eq)",When (conj (clause ~pool cmp))] in Tactical.replace ~at:s.id cases end else begin feedback#set_title "Compound (split)" ; feedback#set_descr "Split %s dis-equality" (kind cmp) ; let cases = List.map negative (clause ~pool cmp) in Tactical.replace ~at:s.id cases end let process_goal (feedback : Tactical.feedback) p = let pool = feedback#pool in let eq,cmp = get_compound_equality (F.e_prop p) in if eq then begin feedback#set_title "Compound (split)" ; feedback#set_descr "Split %s equality" (kind cmp) ; Tactical.split (clause ~pool cmp) ; end else begin feedback#set_title "Compound (neq)" ; feedback#set_descr "Expand compound dis-equality" ; let cases = ["Compound (neq)",disj (clause ~pool cmp)] in Tactical.split cases end class compound = object inherit Tactical.make ~id:"Wp.compound" ~title:"Compound" ~descr:"Decompose compound equalities" ~params:[] method select feedback (s : Tactical.selection) = let process = match s with | Clause (Step s) -> process_have feedback s | Clause (Goal p) -> process_goal feedback p | Inside(_,e) -> process_expand feedback ?at:(Tactical.at s) e | Empty | Compose _ -> raise Not_found in Applicable process end let tactical = Tactical.export (new compound) let strategy = Strategy.make tactical ~arguments:[] ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacCompound.mli�������������������������������������������������0000666�0000000�0000000�00000003364�13571573400�017036� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Compound Tactical (auto-registered) *) open Tactical open Strategy val tactical : tactical val strategy : ?priority:float -> selection -> strategy ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacCongruence.ml������������������������������������������������0000666�0000000�0000000�00000020031�13571573400�017157� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Qed.Logic (* Only integer patterns *) type pattern = | IMUL_K of Integer.t * F.term | IDIV_K of F.term * Integer.t | QDIV of F.term * F.term | Ival of F.term * Integer.t option | Rval of F.term let pattern e = match F.repr e with | Kint n -> Ival(e,Some n) | Times(k,e) when F.is_int e -> IMUL_K(k,e) | Div(a,b) when not (F.is_int e) -> QDIV(a,b) | Div(a,b) when F.is_int e -> begin match F.repr b with | Kint k -> if Integer.(equal k zero) then raise Not_found ; IDIV_K(a,k) | _ -> Ival(e,None) end | _ -> if F.is_int e then Ival(e,None) else if F.is_real e then Rval e else raise Not_found (* let pp_pattern fmt = function | Ival(_,Some z) -> Format.fprintf fmt "(%s : constant)" (Integer.to_string z) | Ival(e,None) -> Format.fprintf fmt "@[<hov 2>(%a : int)@]" F.pp_term e | Rval e -> Format.fprintf fmt "@[<hov 2>(%a : real)@]" F.pp_term e | IMUL_K(k,e) -> Format.fprintf fmt "@[<hov 2>%s.(%a : int)@]" (Integer.to_string k) F.pp_term e | IDIV_K(e,k) -> Format.fprintf fmt "@[<hov 2>(%a : int)/%s@]" F.pp_term e (Integer.to_string k) | QDIV(a,b) -> Format.fprintf fmt "@[<hov 2>(%a : real)@,/(%a : real)@]" F.pp_term a F.pp_term b *) let to_term = function | IMUL_K(k,a) -> F.e_times k a | IDIV_K(a,k) -> F.e_div a (F.e_zint k) | QDIV(a,b) -> F.e_div a b | Ival(e,_) | Rval e -> e let pdiv a b = let k = Integer.c_div a b in Ival(F.e_zint k,Some k) let nzero x = F.p_neq F.e_zero x let positive x = F.p_lt F.e_zero x let negative x = F.p_lt x F.e_zero type cmp = LEQ | LT | EQ let icmp cmp a b = match cmp with | LEQ -> Integer.le a b | LT -> Integer.lt a b | EQ -> Integer.equal a b let fcmp cmp a b = match cmp with | LEQ -> F.p_leq a b | LT -> F.p_lt a b | EQ -> F.p_equal a b let compare_ratio cmp a u b v = let x = F.e_mul a v in let y = F.e_mul b v in let pu = positive u in let nu = negative u in let pv = positive v in let nv = negative v in F.p_conj [ nzero u ; nzero v ; F.p_hyps [pu;pv] (fcmp cmp x y) ; F.p_hyps [nu;pv] (fcmp cmp y x) ; F.p_hyps [pu;nv] (fcmp cmp y x) ; F.p_hyps [nu;nv] (fcmp cmp x y) ] let compare_div cmp a b g = let ra = F.e_mod a g in let rb = F.e_mod b g in fcmp cmp (F.e_sub a ra) (F.e_sub b rb) let rec compare cmp a b = match a, b with | IMUL_K( k,a ) , Ival(_,Some n) -> if Integer.(lt zero k) then compare cmp (pattern a) (pdiv n k) else if Integer.(lt k zero) then compare cmp (pdiv n k) (pattern a) else if icmp cmp Integer.zero n then F.p_true else F.p_false | Ival(_,Some n) , IMUL_K( k,a ) -> if Integer.(lt zero k) then compare cmp (pdiv n k) (pattern a) else if Integer.(lt k zero) then compare cmp (pattern a) (pdiv n k) else if icmp cmp Integer.zero n then F.p_true else F.p_false | IDIV_K( a,k ) , Ival(b,_) -> if Integer.(lt zero k) then let c = F.e_times k (F.e_add b F.e_one) in fcmp cmp a c else if Integer.(lt k zero) then let c = F.e_times k (F.e_sub b F.e_one) in fcmp cmp c a else raise Not_found | Ival(a,_) , IDIV_K( b,k ) -> if Integer.(lt zero k) then let c = F.e_times k (F.e_sub a F.e_one) in fcmp cmp c b else if Integer.(lt k zero) then let c = F.e_times k (F.e_add a F.e_one) in fcmp cmp b c else raise Not_found | IDIV_K( a,p ) , IDIV_K( b,q ) when not Integer.(equal p zero) && not Integer.(equal q zero) -> let g = Integer.pgcd (Integer.abs p) (Integer.abs q) in let ka = Integer.e_div p g in let kb = Integer.e_div q g in compare_div cmp (F.e_times ka a) (F.e_times kb b) (F.e_zint g) | QDIV(a,u) , QDIV(b,v) -> compare_ratio cmp a u b v | QDIV(a,u) , (Ival(b,_) | Rval b) -> compare_ratio cmp a u b F.e_one | (Ival(a,_) | Rval a) , QDIV(b,v) -> compare_ratio cmp a F.e_one b v | _ -> raise Not_found let eq_ratio eq a u b v = F.p_conj [ nzero u ; nzero v ; eq (F.e_mul a v) (F.e_mul b u) ] let rec equal eq a b = match a , b with | IMUL_K( k,a ) , Ival(_,Some n) | Ival(_,Some n) , IMUL_K( k,a ) -> let r = Integer.c_rem k n in if Integer.equal r Integer.zero then equal eq (pattern a) (pdiv n k) else eq F.e_one F.e_zero | IMUL_K( k,a ) , IMUL_K( k',b ) -> let r = Integer.pgcd k k' in eq (F.e_times (Integer.c_div k r) a) (F.e_times (Integer.c_div k' r) b) | IDIV_K( a,p ) , IDIV_K( b,q ) when not Integer.(equal p zero) && not Integer.(equal q zero) -> let g = Integer.pgcd (Integer.abs p) (Integer.abs q) in let ka = Integer.e_div p g in let kb = Integer.e_div q g in compare_div EQ (F.e_times ka a) (F.e_times kb b) (F.e_zint g) | QDIV(a,u) , QDIV(b,v) -> eq_ratio eq a u b v | QDIV(a,u) , (Ival(b,_) | Rval b) -> eq_ratio eq a u b F.e_one | (Ival(a,_) | Rval a) , QDIV(b,v) -> eq_ratio eq a F.e_one b v | _ -> eq (to_term a) (to_term b) let select goal = match F.repr (F.e_prop goal) with | Leq(a,b) -> compare LEQ (pattern a) (pattern b) | Lt(a,b) -> compare LT (pattern a) (pattern b) | Eq(a,b) -> equal F.p_equal (pattern a) (pattern b) | Neq(a,b) -> equal F.p_neq (pattern a) (pattern b) | _ -> raise Not_found class congruence = object inherit Tactical.make ~id:"Wp.congruence" ~title:"Congruence" ~descr:"Euclidian Comparisons" ~params:[] method select _feedback = function | Tactical.Clause(Tactical.Goal p) -> let q = select p in if q != p then Tactical.Applicable(fun seq -> ["congruence" , (fst seq , q)]) else Tactical.Not_applicable | _ -> Tactical.Not_applicable end let tactical = Tactical.export (new congruence) let strategy = Strategy.make tactical ~arguments:[] (* -------------------------------------------------------------------------- *) (* --- Auto Congruence --- *) (* -------------------------------------------------------------------------- *) class autodiv = object method id = "wp:congruence" method title = "Auto Congruence" method descr = "Resolve Divisions and Multiplications" method search push (seq : Conditions.sequent) = try let p = snd seq in let q = select p in if q != p then push (strategy Tactical.(Clause (Goal p))) with Not_found -> () end let () = Strategy.register (new autodiv) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacCongruence.mli�����������������������������������������������0000666�0000000�0000000�00000003534�13571573400�017341� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Tactical for Product & Division Comparison (auto-registered) *) open Tactical open Strategy val tactical : tactical val strategy : ?priority:float -> selection -> strategy (**************************************************************************) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacCut.ml�������������������������������������������������������0000666�0000000�0000000�00000010020�13571573400�015617� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Tactical open Conditions (* -------------------------------------------------------------------------- *) (* --- Cut Tactical --- *) (* -------------------------------------------------------------------------- *) let fclause,pclause = Tactical.composer ~id:"clause" ~title:"Clause" ~descr:"Clause to Cut with" ~filter:F.is_prop () type mode = CASES | MODUS let fmode,pmode = Tactical.selector ~id:"case" ~title:"Mode" ~descr:"Select How the Clause is Used" ~default:MODUS ~options:Tactical.[ { title="Case Analysis" ; descr="" ; vid="CASES" ; value=CASES } ; { title="Modus Ponens" ; descr="" ; vid="MODUS" ; value=MODUS } ; ] () class cut = object(self) inherit Tactical.make ~id:"Wp.cut" ~title:"Cut" ~descr:"Use Intermerdiate Hypothesis" ~params:[pmode;pclause] method select feedback sel = let mode = match sel with | Clause(Goal p) when p != F.p_false -> feedback#update_field ~enabled:false fmode ; CASES | _ -> feedback#update_field ~enabled:true fmode ; self#get_field fmode in let cut = self#get_field fclause in if Tactical.is_empty cut then Not_configured else match mode with | MODUS -> feedback#set_descr "Prove then Insert the Clause" ; let clause = F.p_bool (Tactical.selected cut) in let step = Conditions.step ~descr:"Cut" (Have clause) in let at = Tactical.at sel in Applicable begin fun sequent -> let assume = Conditions.insert ?at step sequent in [ "Clause" , (fst sequent,clause) ; "Assume" , (fst assume,snd sequent) ] end | CASES -> feedback#set_descr "Proof by Case in the Clause" ; let positive = F.p_bool (Tactical.selected cut) in let negative = F.p_not positive in Applicable begin fun (hs,goal) -> [ "Positive" , (hs,F.p_imply positive goal) ; "Negative" , (hs,F.p_imply negative goal) ] end end let tactical = Tactical.export (new cut) let strategy ?(priority=1.0) ?(modus=true) selection = Strategy.{ priority ; tactical ; selection ; arguments = [ arg fmode (if modus then MODUS else CASES) ] ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacCut.mli������������������������������������������������������0000666�0000000�0000000�00000003575�13571573400�016011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Cut Tactical (auto-registered) *) open Tactical open Strategy type mode = CASES | MODUS val fmode : mode field val tactical : tactical val strategy : ?priority:float -> ?modus:bool -> selection -> strategy (**************************************************************************) �����������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacFilter.ml����������������������������������������������������0000666�0000000�0000000�00000005072�13571573400�016324� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Tactical (* -------------------------------------------------------------------------- *) (* --- Filter Tactical --- *) (* -------------------------------------------------------------------------- *) let vanti,panti = Tactical.checkbox ~id:"anti" ~title:"Absurd" ~descr:"Find Contradiction in Side Hypotheses" ~default:false () class filter = object(self) inherit Tactical.make ~id:"Wp.filter" ~title:"Filter" ~descr:"Erase Hypotheses" ~params:[panti] method select feedback _sel = let anti = self#get_field vanti in let process seq = ["Filter",Filtering.compute ~anti seq] in feedback#set_title (if anti then "Filter (absurd)" else "Filter") ; Applicable process end let tactical = Tactical.export (new filter) let strategy ?(priority=1.0) ?(anti=false) () = Strategy.{ priority ; tactical ; selection = Empty ; arguments = [arg vanti anti] ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacFilter.mli���������������������������������������������������0000666�0000000�0000000�00000003403�13571573400�016471� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Filtering Tactic (auto-registered) *) val vanti : bool Tactical.field val tactical : Tactical.t val strategy : ?priority:float -> ?anti:bool -> unit -> Strategy.t �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacHavoc.ml�����������������������������������������������������0000666�0000000�0000000�00000016762�13571573400�016147� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Tactical open Conditions module L = Qed.Logic (* -------------------------------------------------------------------------- *) (* --- Havoc --- *) (* -------------------------------------------------------------------------- *) let lookup_havoc e = match F.repr e with | L.Aget( m , p ) -> begin match F.repr m with | L.Fun( f , [mr;m0;a;n] ) when f == MemMemory.f_havoc -> Some( mr , m0 , a , n , p ) | _ -> None end | _ -> None class havoc = object inherit Tactical.make ~id:"Wp.havoc" ~title:"Havoc" ~descr:"Go Through Assigns" ~params:[] method select _feedback sel = let at = Tactical.at sel in let e = Tactical.selected sel in match lookup_havoc e with | None -> Not_applicable | Some(mr,m0,a,n,p) -> let separated = F.p_call MemMemory.p_separated [ p ; F.e_int 1 ; a ; n ] in let process = Tactical.rewrite ?at [ "Unassigned" , separated , e , F.e_get m0 p ; "Assigned" , F.p_not separated , e , F.e_get mr p ; ] in Applicable process end (* -------------------------------------------------------------------------- *) (* --- Separated --- *) (* -------------------------------------------------------------------------- *) let separated ?at property = match F.e_expr property with | L.Fun( f , [p;n;q;m] ) when f == MemMemory.p_separated -> let base_p = MemMemory.a_base p in let ofs_p = MemMemory.a_offset p in let base_q = MemMemory.a_base q in let ofs_q = MemMemory.a_offset q in let eq_base = F.p_equal base_p base_q in let on_left = F.p_leq (F.e_add ofs_p n) ofs_q in let on_right = F.p_leq (F.e_add ofs_q m) ofs_p in let overlap = F.p_not (F.p_and on_left on_right) in let pattern = F.e_prop property in let cases = [ "WrongBase" , F.p_neq base_p base_q , pattern , F.e_true ; "OnLeft" , F.p_and eq_base on_left , pattern , F.e_true ; "OnRight" , F.p_and eq_base on_right , pattern , F.e_true ; "OverLap" , F.p_and eq_base overlap , pattern , F.e_false ] in Applicable (Tactical.rewrite ?at cases) | _ -> Not_applicable class separated = object inherit Tactical.make ~id:"Wp.separated" ~title:"Separated" ~descr:"Expand Separation Cases" ~params:[] method select _feedback sel = match sel with | Clause (Goal p) -> separated p | Clause (Step s) -> separated ~at:s.id (Conditions.head s) | Inside (_,p) when F.is_prop p -> separated ?at:(Tactical.at sel) (F.p_bool p) | _ -> Not_applicable end (* -------------------------------------------------------------------------- *) (* --- Included, Validity, Invalidity --- *) (* -------------------------------------------------------------------------- *) let invalid m p n = let base = MemMemory.a_base p in let offset = MemMemory.a_offset p in let malloc = F.e_get m base in "Invalid", F.p_imply (F.p_lt F.e_zero n) (F.p_or (F.p_leq malloc offset) (F.p_leq (F.e_add offset n) F.e_zero)) let valid_rd m p n = let base = MemMemory.a_base p in let offset = MemMemory.a_offset p in let malloc = F.e_get m base in "Valid (Read)", F.p_imply (F.p_lt F.e_zero n) (F.p_and (F.p_leq F.e_zero offset) (F.p_leq (F.e_add offset n) malloc)) let valid_rw m p n = let base = MemMemory.a_base p in let offset = MemMemory.a_offset p in let malloc = F.e_get m base in "Valid (Read & Write)", F.p_imply (F.p_lt F.e_zero n) (F.p_conj [ F.p_lt F.e_zero base ; F.p_leq F.e_zero offset ; F.p_leq (F.e_add offset n) malloc ; ]) let included p a q b = let p_base = MemMemory.a_base p in let q_base = MemMemory.a_base q in let p_offset = MemMemory.a_offset p in let q_offset = MemMemory.a_offset q in "Included", F.p_imply (F.p_lt F.e_zero a) (F.p_imply (F.p_leq F.e_zero b) (F.p_conj [ F.p_equal p_base q_base ; F.p_leq q_offset p_offset ; F.p_leq (F.e_add p_offset a) (F.e_add q_offset b) ; ])) let lookup f = function | [p;a;q;b] when f == MemMemory.p_included -> included p a q b | [m;p;n] when f == MemMemory.p_invalid -> invalid m p n | [m;p;n] when f == MemMemory.p_valid_rd -> valid_rd m p n | [m;p;n] when f == MemMemory.p_valid_rw -> valid_rw m p n | _ -> raise Not_found let unfold ?at e f es = let descr,q = lookup f es in Applicable (Tactical.rewrite ?at [descr,F.p_true,e,F.e_prop q]) class validity = object inherit Tactical.make ~id:"Wp.valid" ~title:"Validity Range" ~descr:"Unfold validity and range definitions" ~params:[] method select _feedback (s : Tactical.selection) = let at = Tactical.at s in let e = Tactical.selected s in match F.repr e with | Qed.Logic.Fun(f,es) -> unfold ?at e f es | _ -> Not_applicable end (* -------------------------------------------------------------------------- *) (* --- Exported API --- *) (* -------------------------------------------------------------------------- *) module Havoc = struct let tactical = Tactical.export (new havoc) let strategy ?(priority=1.0) ~havoc = Strategy.{ priority ; tactical ; selection = havoc ; arguments = [] ; } end module Separated = struct let tactical = Tactical.export (new separated) let strategy = Strategy.make tactical ~arguments:[] end module Validity = struct let tactical = Tactical.export (new validity) let strategy = Strategy.make tactical ~arguments:[] end (* -------------------------------------------------------------------------- *) ��������������frama-c-20.0-Calcium/src/plugins/wp/TacHavoc.mli����������������������������������������������������0000666�0000000�0000000�00000003765�13571573400�016317� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Havoc Tactical (auto-registered) *) open Tactical open Strategy module Havoc : sig val tactical : tactical val strategy : ?priority:float -> havoc:selection -> strategy end module Separated : sig val tactical : tactical val strategy : ?priority:float -> selection -> strategy end module Validity : sig val tactical : tactical val strategy : ?priority:float -> selection -> strategy end �����������frama-c-20.0-Calcium/src/plugins/wp/TacInstance.ml��������������������������������������������������0000666�0000000�0000000�00000020027�13571573400�016640� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Tactical module L = Qed.Logic (* -------------------------------------------------------------------------- *) (* --- Instance Tactical --- *) (* -------------------------------------------------------------------------- *) let descr = function | 1 -> "First Parameter" | 2 -> "Second Parameter" | 3 -> "Third Parameter" | n -> Printf.sprintf "%d-th Parameter" n let mkparam k = Tactical.composer ~id:(Printf.sprintf "P%d" k) ~title:(Printf.sprintf "#%d" k) ~descr:(descr k) () let fields,params = List.split (List.map mkparam [1;2;3;4;5;6;7;8;9;10]) let rec has_binder q p = match F.repr p with | L.Bind(q0,_,_) -> q = q0 | L.Imply(_,p) -> has_binder q p | _ -> false type bindings = (F.var * selection) list type env = { binder : L.binder ; feedback : Tactical.feedback ; mutable index : int ; } let rec complexity = function | [] -> Integer.one | (_,v) :: bindings -> match v with | Tactical.Compose(Tactical.Range(a,b)) when a < b -> let n = Integer.of_int (b+1-a) in Integer.mul n (complexity bindings) | _ -> complexity bindings let cardinal limit bindings = let n = complexity bindings in if Integer.le n (Integer.of_int limit) then Some (Integer.to_int n) else None let rec bind_exists bindings property = match bindings with | [] -> property | (x,v) :: bindings -> let closed = if Tactical.is_empty v then Lang.F.p_bind L.Exists x property else let value = Tactical.selected v in Lang.F.p_subst_var x value property in bind_exists bindings closed let rec range x a b w = if a <= b then ( Printf.sprintf "%s-%d" (fst w) a , Lang.F.p_subst_var x (F.e_int a) (snd w) ) :: range x (succ a) b w else [] let rec bind_ranges pool = function | [] -> pool | (x,a,b) :: ranges -> bind_ranges (List.concat (List.map (range x a b) pool)) ranges let rec bind_forall ranges bindings property = match bindings with | (x,v) :: bindings -> begin match v with | Tactical.Compose(Tactical.Range(a,b)) when a < b -> bind_forall ((x,a,b)::ranges) bindings property | Tactical.Empty -> bind_forall ranges bindings (Lang.F.p_bind L.Forall x property) | _ -> let value = Tactical.selected v in bind_forall ranges bindings (Lang.F.p_subst_var x value property) end | [] -> bind_ranges [ "Instance" , property ] ranges let instance_goal ?(title="Witness") bindings property sequent = [ title, (fst sequent , bind_exists bindings property) ] let instance_have ?(title="Instance") ?at bindings property sequent = let clauses = List.map (fun (descr,p) -> Conditions.(step ~descr (Have p))) (bind_forall [] bindings property) in let step = match clauses with | [single] -> single | _ -> Conditions.(step (Either [sequence clauses])) in [ title , Conditions.insert ?at step sequent ] let bind ~side bindings property : Tactical.process = match side with | None -> instance_goal ~title:"Witness" bindings property | Some s -> let open Conditions in instance_have ?title:s.descr ~at:s.id bindings property let filter tau e = try F.Tau.equal tau (F.typeof e) with Not_found -> true (* allowed to not restrict usage *) let fieldname ~range k x = Pretty_utils.sfprintf "%s (%a)%t" (descr k) F.Tau.pretty (F.tau_of_var x) (fun fmt -> if range then Format.pp_print_string fmt "(accept range)") class instance = object(self) inherit Tactical.make ~id:"Wp.instance" ~title:"Instance" ~descr:"Instantiate properties" ~params method private wrap env lemma fields = match F.repr lemma , fields with | L.Imply(hs,p) , _ when env.binder = L.Forall && has_binder env.binder p -> let bindings,property = self#wrap env p fields in bindings, F.e_imply hs property | L.Bind(q,tau,phi) , fd :: fields when q = env.binder -> env.index <- succ env.index ; let x = F.fresh env.feedback#pool tau in let v = self#get_field fd in let range = match tau with L.Int -> true | _ -> false in let tooltip = fieldname ~range env.index x in env.feedback#update_field ~tooltip ~range ~enabled:true ~filter:(filter tau) fd ; let lemma = F.QED.e_unbind x phi in let bindings,property = self#wrap env lemma fields in (x,v) :: bindings , property | _ -> List.iter (env.feedback#update_field ~enabled:false) fields ; [] , lemma method private configure ~side feedback p = let binder = match side with None -> L.Exists | Some _ -> L.Forall in let lemma = F.e_prop p in if has_binder binder lemma then let env = { index = 0 ; feedback ; binder } in let bindings,phi = self#wrap env lemma fields in if List.exists (fun (_,v) -> not (Tactical.is_empty v)) bindings then match cardinal 1000 bindings with | Some n -> if n > 1 then feedback#set_descr "Generates %d instances" n ; Applicable (bind ~side bindings (F.p_bool phi)) | None -> feedback#set_error "More than 1,000 instances" ; Not_configured else Not_configured else Not_applicable method select feedback sel = match sel with | Inside(Step s,t) when F.is_prop t -> let hs = Conditions.have s in let p = F.p_bool t in begin match F.p_expr hs with | L.And ps when List.memq p ps -> self#configure ~side:(Some s) feedback p | _ -> Not_applicable end | Clause(Step s) -> let open Conditions in begin match s.condition with | Have p | When p | Init p | Core p -> self#configure ~side:(Some s) feedback p | _ -> Not_applicable end | Clause(Goal p) -> self#configure ~side:None feedback p | _ -> Not_applicable end let tactical = Tactical.export (new instance) let rec wrap fs vs = match fs , vs with | f :: fs , v :: vs -> Strategy.arg f v :: (wrap fs vs) | fs , _ -> List.map (fun f -> Strategy.arg f Empty) fs let strategy ?(priority=1.0) selection values = Strategy.{ priority ; tactical ; selection ; arguments = wrap fields values ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacInstance.mli�������������������������������������������������0000666�0000000�0000000�00000004520�13571573400�017011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Instance Tactical (auto-registered) *) open Lang.F open Tactical open Strategy val tactical : Tactical.t val fields : selection field list val params : parameter list val filter : tau -> term -> bool type bindings = (var * selection) list val complexity : bindings -> Integer.t val cardinal : int -> bindings -> int option (** less than limit *) val instance_goal : ?title:string -> bindings -> pred -> Tactical.process val instance_have : ?title:string -> ?at:int -> bindings -> pred -> Tactical.process val wrap : selection field list -> selection list -> argument list (** {2 Strategies} *) val strategy : ?priority:float -> selection -> selection list -> strategy (**************************************************************************) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacLemma.ml�����������������������������������������������������0000666�0000000�0000000�00000013721�13571573400�016132� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Tactical open Definitions module L = Qed.Logic (* -------------------------------------------------------------------------- *) (* --- Browser ---- *) (* -------------------------------------------------------------------------- *) let named l = { vid = l.l_name ; title = l.l_name ; descr = Pretty_utils.to_string F.pp_pred l.l_lemma ; value = l ; } class browser ?on_cluster f cluster = object(self) (* Base Visitor *) inherit Definitions.visitor cluster method section _ = () method on_library _ = () method on_type _ _ = () method on_comp _ _ = () method on_dfun _ = () method! vtypes = () method! vsymbols = () method! vself = self#vlemmas (* Cluster & Lemmas *) method on_cluster c = match on_cluster with | None -> (new browser ~on_cluster:self#vcluster f c)#vlemmas | Some visitor -> visitor c method on_dlemma l = f (named l) end let browse f s = if WpContext.is_defined () then begin let main = Definitions.cluster ~id:"browser" () in let visitor = new browser f main in let selection = Tactical.selected s in visitor#vterm selection end (* -------------------------------------------------------------------------- *) (* --- Search Lemma Tactical --- *) (* -------------------------------------------------------------------------- *) type env = { feedback : Tactical.feedback ; lemma : F.pred ; descr : string ; } type lemma = Definitions.dlemma Tactical.named let find thm = try Some (named (Definitions.find_name thm)) with Not_found -> None let search,psearch = Tactical.search ~id:"lemma" ~title:"Lemma" ~descr:"Lemma to Instantiate" ~browse ~find:Definitions.find_name () let fresh pool { l_forall ; l_lemma } = let vars = List.map (F.alpha pool) l_forall in let sigma = Lang.subst l_forall (List.map F.e_var vars) in vars , F.p_subst sigma l_lemma class instance = object(self) inherit Tactical.make ~id:"Wp.lemma" ~title:"Lemma" ~descr:"Search & Instantiate Lemma" ~params:(psearch :: TacInstance.params) method private hide (feedback : Tactical.feedback) fields = List.iter (fun fd -> feedback#update_field ~enabled:false fd) fields method private wrap env vars fields = match vars , fields with | x::xs , fd::fields -> let title = Pretty_utils.to_string F.pp_var x in let value = self#get_field fd in let tau = F.tau_of_var x in env.feedback#update_field ~enabled:true ~title ~tooltip:env.descr ~range:(match tau with L.Int -> true | _ -> false) ~filter:(TacInstance.filter tau) fd ; let bindings,lemma = self#wrap env xs fields in (x,value)::bindings , lemma | _ -> self#hide env.feedback fields ; [] , F.p_forall vars env.lemma method select feedback = function | Empty -> Not_applicable | selection -> begin match self#get_field search with | None -> self#hide feedback TacInstance.fields ; Not_configured | Some Tactical.{ title ; value = dlem } -> let fields = TacInstance.fields in let vars,lemma = fresh feedback#pool dlem in let descr = Pretty_utils.to_string F.pp_pred lemma in let bindings,lemma = self#wrap { feedback ; descr ; lemma } vars fields in match TacInstance.cardinal 1000 bindings with | Some n -> if n > 1 then feedback#set_descr "Generates %d instances" n ; let at = Tactical.at selection in Applicable (TacInstance.instance_have ~title ?at bindings lemma) | None -> feedback#set_error "More than 1,000 instances" ; Not_configured end end let tactical = Tactical.export (new instance) let strategy ?(priority=1.0) ?(at = Tactical.int 0) lemma values = Strategy.{ priority ; tactical ; selection = at ; arguments = arg search (find lemma) :: TacInstance.wrap TacInstance.fields values ; } (* -------------------------------------------------------------------------- *) �����������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacLemma.mli����������������������������������������������������0000666�0000000�0000000�00000003772�13571573400�016310� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Self registered 'Lemma' Tactical *) open Tactical open Strategy type lemma = Definitions.dlemma Tactical.named val named : Definitions.dlemma -> lemma val find : string -> lemma option val search : lemma option Tactical.field val tactical : tactical val strategy : ?priority:float -> ?at:selection -> string -> selection list -> strategy (**************************************************************************) ������frama-c-20.0-Calcium/src/plugins/wp/TacNormalForm.ml������������������������������������������������0000666�0000000�0000000�00000010146�13571573400�017151� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Conditions open Tactical (** Useful **) let str_case = "Case" let sub_cases phi = function | [] -> List.map (fun t -> phi str_case (F.p_bool t)) | [descr] -> List.map (fun t -> phi descr (F.p_bool t)) | infos -> List.map2 (fun info t -> phi info (F.p_bool t)) infos (* split into n sequents: [hyps] |- [subcases]_i *) let f_replace_goal infos subcases (hyps,_) = let sub_case descr p = descr, (hyps,p) in sub_cases sub_case infos subcases (* split into n sequents: [subcases]_i, hyps/[hyp] |- goal in fact, [hyp] is replaced by [subcases]_i *) let f_replace_hyp hyp infos subcases sequent = let sub_case descr p = descr, Conditions.(replace ~at:hyp.id (update_cond hyp ~descr (When p)) sequent) in sub_cases sub_case infos subcases (* -------------------------------------------------------------------------- *) (* --- FNC (goal) and FND (hyp) tacticals --- *) (* -------------------------------------------------------------------------- *) let nf_conj_args e = match F.repr e with | Qed.Logic.And xs -> xs | _ -> [e] let nf_disj_args e = match F.repr e with | Qed.Logic.Or xs -> xs | _ -> [e] let f_nf_goal e ~depth = f_replace_goal ["CNF"] (nf_conj_args (WpTac.e_cnf ~depth e)) let f_nf_hyp s e ~depth = f_replace_hyp s ["DNF"] (nf_disj_args (WpTac.e_dnf ~depth e)) let match_selection = function | Clause(Goal p) -> let e = Lang.F.e_prop p in if WpTac.is_cnf e then None else Some (true, e, f_nf_goal e) | Clause(Step s) -> begin match s.condition with | (Type p | Have p | When p | Core p | Init p) -> let e = Lang.F.e_prop p in if WpTac.is_dnf e then None else Some (false, e, f_nf_hyp s e) | _ -> None end | Inside(_,_) | Compose _ | Empty -> None class normal_form = object inherit Tactical.make ~id:"Wp.normal_form" ~title:"Intuition" ~descr:"Decompose with Conjunctive/Disjunctive Normal Form" ~params:[] method select feedback (s : Tactical.selection) = match match_selection s with | Some (pol,_,continuation) -> feedback#set_title (if pol then "Intuition (CNF)" else "Intuition (DNF)") ; let depth = (-1) in Applicable (continuation ~depth) | _ -> Not_applicable end let tactical = Tactical.export (new normal_form) let strategy = Strategy.make tactical ~arguments:[] (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacNormalForm.mli�����������������������������������������������0000666�0000000�0000000�00000003505�13571573400�017323� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Normal Form Tactical (auto-registered) *) open Tactical open Strategy val tactical : tactical val strategy : ?priority:float -> selection -> strategy (**************************************************************************) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacOverflow.ml��������������������������������������������������0000666�0000000�0000000�00000005040�13571573400�016675� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Tactical class overflow = object inherit Tactical.make ~id:"Wp.overflow" ~title:"Overflow" ~descr:"Consider no overflow nor downcast" ~params:[] method select _feedback selection = let e = Tactical.selected selection in let open Qed.Logic in match F.repr e with | Fun(f,[v]) -> let iota = Cint.to_cint f in let cond = Cint.range iota v in (* let a,b = Ctypes.bounds iota in let range = F.p_and (F.p_leq (F.e_zint a) v) (F.p_leq v (F.e_zint b)) in *) Applicable( fun (hs,g) -> [ "In-Range", (hs , cond) ; "No-Overflow" , Conditions.subst (fun u -> if u == e then v else raise Not_found) (hs , F.p_imply cond g) ]) | _ -> Not_applicable end let overflow = Tactical.export (new overflow) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacOverflow.mli�������������������������������������������������0000666�0000000�0000000�00000003224�13571573400�017050� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Auto registered overflow tactic *) val overflow : Tactical.t ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacRange.ml�����������������������������������������������������0000666�0000000�0000000�00000006717�13571573400�016142� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Lang.F open Tactical (* -------------------------------------------------------------------------- *) (* --- Range Tactical --- *) (* -------------------------------------------------------------------------- *) let rec range pool e a b = if a <= b then let descr = Printf.sprintf "Value %d" b in let cond = p_equal e (e_int b) in range ((descr,cond)::pool) e a (pred b) else pool let enum ?at e a b sequent = let lower = Printf.sprintf "Lower %d" a , p_lt e (e_int a) in let upper = Printf.sprintf "Upper %d" b , p_lt (e_int b) e in let cases = lower :: range [upper] e a b in Tactical.insert ?at cases sequent let vmin,pmin = Tactical.spinner ~id:"inf" ~title:"Inf" ~descr:"Range Lower Bound (inclusive)" () let vmax,pmax = Tactical.spinner ~id:"sup" ~title:"Sup" ~descr:"Range Upper Bound (inclusive)" () class range = object(self) inherit Tactical.make ~id:"Wp.range" ~title:"Range" ~descr:"Enumerate a range of values for an integer term" ~params:[pmin;pmax] method select feedback (s : Tactical.selection) = let at = Tactical.at s in let e = Tactical.selected s in if F.is_int e then begin let a = self#get_field vmin in let b = self#get_field vmax in if not (a <= b) then ( feedback#set_error "Empty Range (shall have Inf <= Sup)" ; Not_configured ) else ( feedback#set_title "Range (%d-%d)" a b ; feedback#set_descr "Enumerate (lower,%d-%d,upper)" a b ; Applicable(enum ?at e a b) ) end else Not_applicable end let tactical = Tactical.export (new range) let strategy ?(priority=1.0) selection ~vmin:a ~vmax:b = Strategy.{ priority ; tactical ; selection ; arguments = [ arg vmin a ; arg vmax b ] ; } �������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacRange.mli����������������������������������������������������0000666�0000000�0000000�00000003603�13571573400�016302� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Range Tactical (auto-registered) *) open Tactical open Strategy val vmin : int field val vmax : int field val tactical : tactical val strategy : ?priority:float -> selection -> vmin:int -> vmax:int -> strategy (**************************************************************************) �����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacRewrite.ml���������������������������������������������������0000666�0000000�0000000�00000011143�13571573400�016514� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Tactic to Apply Substitution by Hand *) (* -------------------------------------------------------------------------- *) open Tactical open Repr let rewrite ~select ~replaced ~value = Applicable (Tactical.rewrite ?at:(Tactical.at select) [ "Rewrite" , Lang.F.p_true , replaced , value ]) let hypothesis s = let open Conditions in match s.condition with | When p | Have p | Core p | Init p -> p | _ -> raise Not_found let clause = function | Clause(Step s) -> hypothesis s | Inside(Step s,e) -> begin match Repr.pred (hypothesis s) with | And es when List.memq e es -> Lang.F.p_bool e | _ -> raise Not_found end | _ -> raise Not_found class rewrite dir = let id = if dir then "Wp.TacRewrite.Left" else "Wp.TacRewrite.Right" in let title = if dir then "Rewrite (<-)" else "Rewrite (->)" in object inherit Tactical.make ~id ~title ~descr:"Rewrite from equality" ~params:[] method select _feedback select = try let p = clause select in match Repr.pred p with | Eq(a,b) -> let replaced,value = if dir then a,b else b,a in rewrite ~select ~replaced ~value | _ -> Not_applicable with Not_found -> Not_applicable end let tacl = Tactical.export (new rewrite true :> Tactical.tactical) let tacr = Tactical.export (new rewrite false :> Tactical.tactical) let mem a b = let rec walk m e = if a==e then raise Exit ; if not (Lang.F.Tset.mem e !m) then begin m := Lang.F.Tset.add e !m ; Lang.F.lc_iter (walk m) e end in try walk (ref Lang.F.Tset.empty) b ; false with Exit -> true let direct a goal = match Repr.term goal with | Eq(u,v) when a == u || a == v -> true | _ -> false let submit push select e goal rw = if direct e goal then push (Strategy.make ~priority:1.5 rw select) else if mem e goal then push (Strategy.make ~priority:0.5 rw select) let rec lookup step push goal e = match Repr.term e with | And ps -> List.iter (lookup step push goal) ps | Eq(a,b) -> begin let select = Inside(Step step,e) in submit push select a goal tacl ; submit push select b goal tacr ; end | _ -> () class auto_rewrite = object method id = "wp:replace" method title = "Auto Replace" method descr = "Lookup for equalities to Rewrite" method search (push : Strategy.strategy -> unit) (hyps,goal) = Conditions.iter (fun s -> let open Conditions in match s.condition with | Have p | When p | Core p | Init p -> lookup s push (Lang.F.e_prop goal) (Lang.F.e_prop p) | _ -> ()) hyps end let () = Strategy.register (new auto_rewrite) type dir = [ `Left | `Right ] let tactical = function | `Left -> tacl | `Right -> tacr let strategy ?priority dir selection = Strategy.make ?priority (tactical dir) selection �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacRewrite.mli��������������������������������������������������0000666�0000000�0000000�00000003553�13571573400�016673� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Range Tactical (auto-registered) *) open Tactical open Strategy type dir = [ `Left | `Right ] val tactical : dir -> tactical val strategy : ?priority:float -> dir -> selection -> strategy (**************************************************************************) �����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacShift.ml�����������������������������������������������������0000666�0000000�0000000�00000010514�13571573400�016151� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang let select_op f = let rewrite descr u v = Tactical.rewrite [ descr , F.p_true , u , v ] in let rewrite_lsl e a n = (* from selection e='a<<n', rewrites the sequent 'Hs |- G' into: - Hs[e := a*2^n] |- G[e := a*2^n)] *) let b = F.e_mul a (F.e_int (1 lsl n)) in rewrite "shift" e b in let rewrite_lsr e a n = (* from selection e='a>>n', rewrites the sequent 'Hs |- G' into: - Hs |- 0<=a - Hs[e := a*2^n] |- G[e := a*2^n] *) let b = F.e_div a (F.e_int (1 lsl n)) in (fun seq -> ("positive" , (fst seq , F.p_leq F.e_zero a)) :: rewrite "shift" e b seq) in if f == Cint.f_lsl then rewrite_lsl else if f == Cint.f_lsr then rewrite_lsr else raise Not_found let select_int n = match F.repr n with | Qed.Logic.Kint n -> (try Integer.to_int n with Z.Overflow -> raise Not_found) | _ -> raise Not_found class shift = object inherit Tactical.make ~id:"Wp.shift" ~title:"Logical Shift" ~descr:"Transform Shifts into Div/Mult" ~params:[] method select feedback selection = let e = Tactical.selected selection in let open Qed.Logic in match F.repr e with | Fun( f , [a;n] ) -> begin let rewrite_shift = select_op f in let n = select_int n in if n > 64 then feedback#set_error "Too large shift (64 max.)" ; if n < 0 then feedback#set_error "Negative shift (0 min.)" ; Tactical.Applicable (rewrite_shift e a n) end | _ -> Tactical.Not_applicable end let tactical = Tactical.export (new shift) let strategy = Strategy.make tactical ~arguments:[] (* -------------------------------------------------------------------------- *) (* --- Auto Shift --- *) (* -------------------------------------------------------------------------- *) let is_shift e = try let open Qed.Logic in match F.repr e with | Fun( f , [_;n] ) -> let _ignore = select_op f in let _ = select_int n in true | _ -> false with Not_found -> false let rec scan m f e = if not (F.Tset.mem e !m) then begin m := F.Tset.add e !m ; if is_shift e then f e else if F.lc_closed e then F.lc_iter (scan m f) e end class autoshift = object method id = "wp:bitshift" method title = "Auto Bit-Shift" method descr = "Apply Bit-Shift in Goal" method search push (seq : Conditions.sequent) = let goal = snd seq in let apply e = let selection = Tactical.(Inside(Goal goal,e)) in push (strategy ~priority:0.5 selection) in scan (ref F.Tset.empty) apply (F.e_prop goal) end let () = Strategy.register (new autoshift) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacShift.mli����������������������������������������������������0000666�0000000�0000000�00000003477�13571573400�016334� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Shift Tactical (auto-registered) *) open Tactical open Strategy val tactical : tactical val strategy : ?priority:float -> selection -> strategy (**************************************************************************) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacSplit.ml�����������������������������������������������������0000666�0000000�0000000�00000047364�13571573400�016204� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang module PartitionsQQ : sig val destructs_qq : Lang.F.pool -> is_forall:bool -> Lang.F.QED.term -> Lang.F.Vars.t * Lang.F.QED.term val get : vars:Lang.F.Vars.t -> Lang.F.term list -> int * Lang.F.Tset.t list end = struct let dkey = Wp_parameters.register_category "tac_split_quantifiers" (* debugging key *) let debug fmt = Wp_parameters.debug ~dkey fmt let destructs_qq pool ~is_forall t = let ctx,a = F.e_open ~pool ~forall:is_forall ~exists:(not is_forall) ~lambda:false t in let vars = List.fold_left (fun vars (_,var) -> F.Vars.add var vars) F.Vars.empty ctx in vars, a type kind_t = Root of F.Tset.t | Node of node_t and node_t = { var: F.Var.t; mutable rank: int; mutable kind: kind_t } type var2node_t = node_t F.Vmap.t let is_root root = match root.kind with | Node _ -> false | Root _ -> true let find (map:var2node_t) var = let find_root var root = function | None -> (* adds an empty root partition for that [var] *) root := Some { var; rank=0; kind=(Root F.Tset.empty) }; debug ". . find(%a)= %a (inserted)@." Lang.F.pp_var var Lang.F.pp_var var ; !root | (Some { kind=(Root _); var=debug_var }) as old -> debug ". . find(%a)= %a@." Lang.F.pp_var var Lang.F.pp_var debug_var ; root := old ; old | Some ({ kind=(Node _) } as node) -> debug ". . find(%a)=" Lang.F.pp_var var ; let rec find_aux node = debug " %a" Lang.F.pp_var node.var ; match node.kind with | Node y -> let r = find_aux y in node.kind <- Node r ; r | Root _ -> node in root := Some (find_aux node); debug "@." ; !root in let root = ref None in let map = F.Vmap.change find_root var root map in let root = match !root with | None -> assert false | Some root -> root in assert (is_root root); map,root let union ((map:var2node_t),rootX) varY = debug "< union(%a,%a)@." Lang.F.pp_var rootX.var Lang.F.pp_var varY ; assert (is_root rootX); let map,rootY = find map varY in assert ((rootX == rootY) = (0 = F.Var.compare rootX.var rootY.var)) ; if rootX == rootY then begin debug "> union(%a,%a)=%a@." Lang.F.pp_var rootX.var Lang.F.pp_var varY Lang.F.pp_var rootX.var ; map,rootX end else let terms root = match root.kind with | Node _ -> assert false | Root terms -> terms in let root, node = if rootX.rank < rootY.rank then rootY, rootX else (if rootX.rank = rootY.rank then rootX.rank <- 1+rootX.rank; rootX,rootY) in root.kind <- Root (F.Tset.union (terms rootX) (terms rootY)); node.kind <- Node root ; assert (is_root root); debug "> union(%a,%a)=%a@." Lang.F.pp_var rootX.var Lang.F.pp_var varY Lang.F.pp_var root.var ; map,root let partitions ~vars es = let debug_term_nth = ref 0 in let partitions (set,map) term = incr debug_term_nth ; let vars = F.Vars.inter vars (Lang.F.vars term) in match F.Vars.elements vars with | [] -> debug "- term #%d: no vars -> %a@." !debug_term_nth Lang.F.pp_term term; (F.Tset.add term set), map (* closed term partition *) | var::others -> (* term partition bound to variables *) debug "- term #%d: nb vars=%d -> %a@." !debug_term_nth (1+List.length others) Lang.F.pp_term term; let map,root = List.fold_left union (find map var) others in (* adds the current term to the partition *) (match root.kind with | Node _ -> assert false | Root terms -> root.kind <- Root (F.Tset.add term terms)); set,map in debug "------------@.Partitions(vars #%d,terms #%d)@." (F.Vars.cardinal vars) (List.length es); List.fold_left partitions (F.Tset.empty,F.Vmap.empty) es let extract (set,map) = debug "------------@.Extract@.no vars: nb terms = %d@." (F.Tset.cardinal set); let acc = if F.Tset.is_empty set then 0, [] else 1, [set] in let extract var node ((nb_parts,parts) as acc) = if 0 != F.Var.compare node.var var then acc else match node.kind with | Root part -> assert (not (F.Tset.is_empty part)); debug "var %a, nb terms = %d@." Lang.F.pp_var var (F.Tset.cardinal part); (nb_parts+1),part::parts | Node _ -> acc in let ((nb_part,_) as r) = F.Vmap.fold extract map acc in assert (nb_part > 0); r let get ~vars es = extract (partitions ~vars es) end open Lang.F open Conditions open Tactical (* -------------------------------------------------------------------------- *) (* --- Split Tactical --- *) (* -------------------------------------------------------------------------- *) let bind qq ~vars p = F.Vars.fold (F.e_bind qq) vars p class split = object inherit Tactical.make ~id:"Wp.split" ~title:"Split" ~descr:"Decompose Logical Connectives and Conditionals" ~params:[] method select feedback (s : Tactical.selection) = match s with | Empty | Compose _ -> Not_applicable | Inside(_,e) -> begin let split_cmp title x y = feedback#set_title title ; feedback#set_descr "Decompose into three comparisons (lt, eq, gt)" ; let cases = [ "Lt",F.p_bool (e_lt x y); "Eq",F.p_bool (e_eq x y); "Gt",F.p_bool (e_lt y x); ] in let at = Tactical.at s in Applicable (Tactical.insert ?at cases) in let open Qed.Logic in match Lang.F.repr e with | Leq(x,y) -> split_cmp "Split (comp.)" x y | Lt(x,y) -> split_cmp "Split (comp.)" x y | Eq(x,y) when not (is_prop x || is_prop y) -> split_cmp "Split (eq.)" x y | Neq(x,y) when not (is_prop x || is_prop y) -> split_cmp "Split (neq.)" x y | _ when F.is_prop e-> feedback#set_title "Split (true,false)" ; feedback#set_descr "Decompose between True and False values" ; let cases = ["True",F.p_bool e;"False",F.p_not (F.p_bool e)] in let at = Tactical.at s in Applicable (Tactical.insert ?at cases) | _ -> Not_applicable end | Clause(Goal p) -> begin let open Qed.Logic in match Lang.F.e_expr p with | Bind (Exists,_,_) -> begin let vars,q = PartitionsQQ.destructs_qq feedback#pool ~is_forall:false (e_prop p) in match Lang.F.repr q with | If (c,p,q) -> if F.Vars.is_empty (F.Vars.inter (F.vars c) vars) then begin (* unbound condition: proceed by case *) feedback#set_title "Split (exists if)" ; feedback#set_descr "Split unbound Condition into Branches" ; let p = F.e_imply [c] (bind Exists ~vars p) in let q = F.e_imply [e_not c] (bind Exists ~vars q) in Applicable (Tactical.split [ "Then" , F.p_bool p ; "Else" , F.p_bool q ; ]) end else begin feedback#set_title "Split (rewrite exists if)" ; feedback#set_descr "Rewrite the Conditional in a Disjunction \ and Distribute the Quantifier under" ; let p = bind Exists ~vars (F.e_and [c;p]) in let q = bind Exists ~vars (F.e_and [(e_not c); q]) in let cases = [ "Split" , F.p_bool (F.e_or [p;q]) ] in Applicable (Tactical.split cases) end | Or es -> feedback#set_title "Split (exists or)" ; feedback#set_descr "Distributes the Quantifier under the Disjunction" ; let p = F.e_or (List.map (bind Exists ~vars) es) in let cases = [ "Split" , F.p_bool p ] in Applicable (Tactical.split cases) | Imply (es, p) -> feedback#set_title "Split (exists imply)" ; feedback#set_descr "Distributes the Quantifier under the Imply" ; let p = F.e_imply (List.map (bind Forall ~vars) es) (bind Exists ~vars p) in let cases = [ "Split" , F.p_bool p ] in Applicable (Tactical.split cases) | And es -> let nb_parts,parts = PartitionsQQ.get vars es in if nb_parts=1 then Not_applicable else begin feedback#set_title "Split (exists and)" ; feedback#set_descr "Decompose the Quantifier into %d Blocks" nb_parts ; let bind es = bind Exists ~vars (F.e_and (F.Tset.elements es)) in let goal i n es = Printf.sprintf "Goal %d/%d" i n , F.p_bool (bind es) in Applicable (Tactical.split (Tactical.mapi goal parts)) end | _ -> Not_applicable end | And es -> let n = List.length es in feedback#set_title "Split (and)" ; feedback#set_descr "Decompose between the %d parts of the Conjunction" n ; let goal i n e = Printf.sprintf "Goal %d/%d" i n , F.p_bool e in Applicable (Tactical.split (Tactical.mapi goal es)) | Eq(x,y) when (F.is_prop x) && (F.is_prop y) -> feedback#set_title "Split (iff)" ; feedback#set_descr "Turn Equivalence into Implications" ; let p = F.p_bool (F.e_imply [x] y) in let q = F.p_bool (F.e_imply [y] x) in let cases = [ "Necessity" , p ; "Sufficiency" , q ] in Applicable (Tactical.split cases) | Neq(x,y) when (F.is_prop x) && (F.is_prop y) -> feedback#set_title "Split (xor)" ; feedback#set_descr "Turn Dis-Equivalence into Implications" ; let p = F.p_bool (F.e_imply [x] (e_not y)) in let q = F.p_bool (F.e_imply [y] (e_not x)) in let cases = [ "Necessity" , p ; "Sufficiency" , q ] in Applicable (Tactical.split cases) | If(c,p,q) -> (* Split + intro *) feedback#set_title "Split (if)" ; feedback#set_descr "Decompose Conditional into Branches" ; let p = F.p_bool (F.e_imply [c] p) in let q = F.p_bool (F.e_imply [e_not c] q) in let cases = [ "Then" , p ; "Else" , q ] in Applicable (Tactical.split cases) | _ -> Not_applicable end | Clause(Step step) -> begin match step.condition with | State _ -> Not_applicable | Branch(p,_,_) -> feedback#set_title "Split (branch)" ; feedback#set_descr "Decompose Conditional into Branches" ; let cases = [ "Then" , p ; "Else" , p_not p ] in Applicable (Tactical.insert ~at:step.id cases) | Either seqs -> let n = List.length seqs in feedback#set_title "Split (switch)" ; feedback#set_descr "Decompose each %d Cases" n ; let either i n s = Printf.sprintf "Case %d/%d" i n , Either [s] in let cases = Tactical.mapi either seqs in Applicable (Tactical.replace ~at:step.id cases) | (Type p | Have p | When p | Core p | Init p) -> begin let open Qed.Logic in match F.e_expr p with | Bind (Forall,_,_) -> begin let vars,q = PartitionsQQ.destructs_qq feedback#pool ~is_forall:true (e_prop p) in match Lang.F.repr q with | If (c,p,q) -> if F.Vars.is_empty (F.Vars.inter (F.vars c) vars) then begin (* unbound condition: so, the If is considered as a disjunction *) feedback#set_title "Split (forall if)" ; feedback#set_descr "Decompose unbound conditional into Branches" ; let p = F.p_bool (F.e_and [c; (bind Exists ~vars p)]) in let q = F.p_bool (F.e_and [(e_not c); (bind Exists ~vars q)]) in let cases = [ "Then" , When p ; "Else" , When q ] in Applicable (Tactical.replace ~at:step.id cases) end else begin feedback#set_title "Split (rewrite forall if)" ; feedback#set_descr "Rewrite the Conditional in a Conjunction and Distributes the Quantifier under the Conjunction" ; let p = bind Exists ~vars (F.e_imply [c] p) in let q = bind Exists ~vars (F.e_imply [e_not c] q) in let cases = [ "Split (rewrite exists if)" , When (F.p_bool (F.e_and [p;q])) ] in Applicable (Tactical.replace ~at:step.id cases) end | And es -> feedback#set_title "Split (forall and)" ; feedback#set_descr "Distributes the Quantifier under the Conjunction" ; let p = F.p_bool (F.e_and (List.map (bind Forall ~vars) es)) in let cases = [ "Split (distrib forall and)" , When p ] in Applicable (Tactical.replace ~at:step.id cases) | Or es -> let nb_parts,parts = PartitionsQQ.get vars es in if nb_parts=1 then Not_applicable else begin feedback#set_title "Split (forall or)" ; feedback#set_descr "Decompose the Quantifier between %d parts of the Disjunction" nb_parts ; let bind es = bind Forall ~vars (F.e_or (F.Tset.elements es)) in let goal i n es = Printf.sprintf "Goal %d/%d" i n , When (F.p_bool (bind es)) in let cases = Tactical.mapi goal parts in Applicable (Tactical.replace ~at:step.id cases) end | _ -> Not_applicable end | Or xs -> let n = List.length xs in feedback#set_title "Split (or)" ; feedback#set_descr "Distinguish the %d parts of the Disjunction" n ; let hyp i n e = Printf.sprintf "Case %d/%d" i n , When (F.p_bool e) in let cases = Tactical.mapi hyp xs in Applicable (Tactical.replace ~at:step.id cases) | Eq(x,y) when (F.is_prop x)&&(F.is_prop y) -> feedback#set_title "Split (iff)"; feedback#set_descr "Decompose Equivalence into both True/False" ; let p = F.p_bool x in let q = F.p_bool y in let cases = [ "Both True" , When F.(p_and p q) ; "Both False" , When F.(p_and (p_not p) (p_not q)) ; ] in Applicable (Tactical.replace ~at:step.id cases) | Neq(x,y) when (F.is_prop x)&&(F.is_prop y) -> feedback#set_title "Split (xor)"; feedback#set_descr "Decompose Dis-Equivalence into alternated True/False" ; let p = F.p_bool x in let q = F.p_bool y in let cases = [ "True/False" , When F.(p_and p (p_not q)) ; "False/True" , When F.(p_and (p_not p) q) ; ] in Applicable (Tactical.replace ~at:step.id cases) | Neq(x,y) when not (is_prop x || is_prop y) -> feedback#set_title "Split (<>)"; feedback#set_descr "Decompose into two comparisons (<, >)" ; let cases = ["Lt", When F.(p_bool (e_lt x y)); "Gt", When F.(p_bool (e_lt y x))] in Applicable (Tactical.replace ~at:step.id cases) | Leq(x,y) when not (is_prop x || is_prop y) -> feedback#set_title "Split (<=)"; feedback#set_descr "Decompose into two comparisons (<, =)" ; let cases = ["Lt", When F.(p_bool (e_lt x y)); "Eq", When F.(p_bool (e_eq y x))] in Applicable (Tactical.replace ~at:step.id cases) | If(c,p,q) -> feedback#set_title "Split (if)" ; feedback#set_descr "Split Conditional into Branches" ; let p = F.p_bool (F.e_and [c;p]) in let q = F.p_bool (F.e_and [e_not c;q]) in let cases = [ "Then" , When p ; "Else" , When q ] in Applicable (Tactical.replace ~at:step.id cases) | _ -> Not_applicable end end end let tactical = Tactical.export (new split) let strategy = Strategy.make tactical ~arguments:[] (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacSplit.mli����������������������������������������������������0000666�0000000�0000000�00000003477�13571573400�016352� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Split Tactical (auto-registered) *) open Tactical open Strategy val tactical : tactical val strategy : ?priority:float -> selection -> strategy (**************************************************************************) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacUnfold.ml����������������������������������������������������0000666�0000000�0000000�00000006365�13571573400�016334� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Tactical (* -------------------------------------------------------------------------- *) (* --- Unfold Definition Tactical --- *) (* -------------------------------------------------------------------------- *) open Definitions let definition f es = let d = find_symbol f in match d.d_definition with | Function(_,_,u) -> let sigma = Lang.subst d.d_params es in F.e_subst sigma u | Predicate(_,p) -> let sigma = Lang.subst d.d_params es in F.e_prop (F.p_subst sigma p) | _ -> raise Not_found let range f es = let a,b = Ctypes.bounds (Cint.is_cint f) in let range e = F.p_and (F.p_leq (F.e_zint a) e) (F.p_leq e (F.e_zint b)) in F.e_prop (F.p_all range es) let rec applicable ?at e f es = function | phi::others -> begin try let v = phi f es in let d = Pretty_utils.sfprintf "Unfold '%a'" Lang.Fun.pretty f in Applicable (Tactical.rewrite ?at [d,F.p_true,e,v]) with Not_found | Invalid_argument _ -> applicable ?at e f es others end | [] -> Not_applicable class unfold = object inherit Tactical.make ~id:"Wp.unfold" ~title:"Definition" ~descr:"Unfold predicate and logic function definition" ~params:[] method select _feedback (s : Tactical.selection) = let at = Tactical.at s in let e = Tactical.selected s in match F.repr e with | Qed.Logic.Fun(f,es) -> applicable ?at e f es [ definition ; range ] | _ -> Not_applicable end let tactical = Tactical.export (new unfold) let strategy = Strategy.make tactical ~arguments:[] ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/TacUnfold.mli���������������������������������������������������0000666�0000000�0000000�00000003500�13571573400�016471� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Built-in Unfold Tactical (auto-registered) *) open Tactical open Strategy val tactical : tactical val strategy : ?priority:float -> selection -> strategy (**************************************************************************) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Tactical.ml�����������������������������������������������������0000666�0000000�0000000�00000051232�13571573400�016172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Conditions open Lang.F module Tmap = Map.Make(String) let composers = ref Tmap.empty let groups = ref [] (* -------------------------------------------------------------------------- *) (* --- Composer Factory --- *) (* -------------------------------------------------------------------------- *) class type composer = object method id : string method group : string method title : string method descr : string method arity : int method filter : term list -> bool method compute : term list -> term end let rec insert_group cc = function | [] -> [cc#group , [cc]] | (( gid , ccs ) as group ):: others -> if cc#group = gid then ( gid , ccs @ [cc] ) :: others else group :: insert_group cc others let add_composer (c : #composer) = let id = c#id in if Tmap.mem id !composers then Wp_parameters.error "Composer #%s already registered (skipped)" id else begin composers := Tmap.add id (c :> composer) !composers ; groups := insert_group (c :> composer) !groups ; end let iter_composer f = List.iter (fun (_,ccs) -> List.iter f ccs) !groups (* -------------------------------------------------------------------------- *) (* --- Tactical Selection --- *) (* -------------------------------------------------------------------------- *) type clause = Goal of pred | Step of step type process = sequent -> (string * sequent) list type status = | Not_applicable | Not_configured | Applicable of process type selection = | Empty | Clause of clause | Inside of clause * term | Compose of compose and compose = | Cint of Integer.t | Range of int * int | Code of term * string * selection list (* -------------------------------------------------------------------------- *) (* --- Selection API --- *) (* -------------------------------------------------------------------------- *) let head = function | Goal p -> p | Step s -> Conditions.head s let is_empty = function Empty -> true | _ -> false let composed = function | Cint a -> e_zint a | Range(a,_) -> e_int a | Code(v,_id,_es) -> v let selected = function | Empty -> e_true | Inside(_,t) -> t | Clause c -> e_prop (head c) | Compose code -> composed code let get_int_z z = try Some (Integer.to_int z) with Z.Overflow -> None let get_int = function | Empty -> None | Compose(Cint a) -> get_int_z a | s -> match Lang.F.repr (selected s) with | Qed.Logic.Kint z -> get_int_z z | _ -> None let subclause clause p = match clause with | Step s -> let hs = Conditions.have s in hs == p || ( match Lang.F.p_expr hs with | Qed.Logic.And ps -> List.memq p ps | _ -> false ) | Goal hs -> hs == p || ( match Lang.F.p_expr hs with | Qed.Logic.Or ps -> List.memq p ps | _ -> false ) let pp_clause fmt = function | Goal _ -> Format.pp_print_string fmt "Goal" | Step s -> Format.fprintf fmt "Hyp %d" s.id let rec pp_selection fmt = function | Empty -> Format.pp_print_string fmt "Empty" | Inside(c,t) -> Format.fprintf fmt "Term %d in %a" (Lang.F.QED.id t) pp_clause c | Clause c -> pp_clause fmt c | Compose(Cint k) -> Format.fprintf fmt "Constant '%a'" (Integer.pretty ~hexa:false) k | Compose(Range(a,b)) -> Format.fprintf fmt "Range '%d..%d'" a b | Compose(Code(_,id,es)) -> Format.fprintf fmt "@[<hov 2>Compose '%s'" id ; List.iter (fun e -> Format.fprintf fmt "(%a)" pp_selection e) es ; Format.fprintf fmt "@]" let int a = Compose(Cint (Integer.of_int a)) let cint a = Compose(Cint a) let range a b = Compose(Range(a,b)) let compose id es = try let cc = Tmap.find id !composers in let e = cc#compute (List.map selected es) in match Lang.F.repr e with | Qed.Logic.Kint n -> cint n | _ -> Compose(Code(e,id,es)) with Not_found -> Empty let findhead (s:selection) e = match s with | Empty -> None | Compose(Range _ | Cint _) -> None | Inside(clause,_) | Clause clause -> let p = Lang.F.e_prop (head clause) in if Lang.F.is_subterm e p then Some(Inside(clause,e)) else None | Compose(Code(v,_,_)) as s -> if v == e then Some s else None let rec lookup (s:selection) e q = match findhead s e with | Some _ as result -> result | None -> lookup_inner s e q and lookup_inner (s:selection) e q = begin match s with | Compose(Code(_,_,ps)) -> List.iter (fun p -> Queue.add p q) ps | _ -> () end ; if Queue.is_empty q then None else lookup (Queue.pop q) e q and subterm (s:selection) e = match Lang.F.repr e with | Qed.Logic.Kint z -> Some (cint z) | _ -> match findhead s e with | Some _ as result -> result | None -> lookup_inner s e (Queue.create ()) let rec subterms s = function | [] -> [] | e::es -> let ps = subterms s es in match subterm s e with | None -> ps | Some p -> p::ps let destruct_value s = let v = selected s in let open Qed.Logic in match Lang.F.repr v with | Kint _ | Kreal _ | True | False | Bind _ | Fvar _ | Bvar _ | Apply _ -> [] | Add es | Mul es | And es | Or es | Fun(_,es) -> subterms s es | Imply(hs,p) -> subterms s (hs @ [p]) | If(a,b,c) | Aset(a,b,c) -> subterms s [a;b;c] | Not a | Rget(a,_) | Acst(_,a) -> subterms s [a] | Rdef fvs -> subterms s (List.map snd fvs) | Times(k,v) -> cint k :: subterms s [v] | Div(a,b) | Mod(a,b) | Eq(a,b) | Neq(a,b) | Lt(a,b) | Leq(a,b) | Aget(a,b) -> subterms s [a;b] let destruct = function | Empty | Compose(Cint _) -> [] | Compose(Range(a,b)) -> [int a;int b] | s -> let ps = destruct_value s in if ps <> [] then ps else match s with | Compose(Code(_,_,ps)) -> ps | _ -> [] (* -------------------------------------------------------------------------- *) (* --- Fields --- *) (* -------------------------------------------------------------------------- *) type 'a named = { title : string ; descr : string ; vid : string ; value : 'a } type 'a range = { vmin : 'a option ; vmax : 'a option ; vstep : 'a } type 'a field = 'a named (* value is the default *) type 'a browser = ('a named -> unit) -> selection -> unit let field ~id ~title ~descr ~default : 'a field = if id = "" then raise (Invalid_argument "Tactical.field") ; { title ; descr ; vid = id ; value=default } let ident fd = fd.vid let signature fd = fd let default fd = fd.value module Fmap : sig type t val create : unit -> t val reset : t -> unit val get : t -> 'a field -> 'a val set : t -> 'a field -> 'a -> unit end = struct type t = (string,Obj.t) Hashtbl.t let create () = Hashtbl.create 8 let reset t = Hashtbl.clear t let get m (fd : 'a field) : 'a = try Obj.obj (Hashtbl.find m fd.vid) with Not_found -> fd.value let set m (fd : 'a field) (v : 'a) = Hashtbl.add m fd.vid (Obj.repr v) end (* -------------------------------------------------------------------------- *) (* --- Parameters --- *) (* -------------------------------------------------------------------------- *) type parameter = | Checkbox of bool field | Spinner of int field * int range | Composer of selection field * (Lang.F.term -> bool) | Selector : 'a field * 'a named list * ('a -> 'a -> bool) -> parameter | Search : 'a named option field * 'a browser * (string -> 'a) -> parameter let checkbox ~id ~title ~descr ?(default=false) () = let fd = field ~id ~title ~descr ~default in fd , Checkbox fd let spinner ~id ~title ~descr ?default ?vmin ?vmax ?(vstep=1) () = let () = match vmin , vmax with | Some a , Some b -> if a >= b then raise (Invalid_argument "Tactical.spinner") | _ -> () in let default = match default, vmin, vmax with | Some v , _ , _ -> v | None , None , None -> 0 | None , Some v , _ -> v | None , None , Some v -> v in let fd = field ~id ~title ~descr ~default in fd , Spinner(fd,{vmin;vmax;vstep}) let selector ~id ~title ~descr ?default ~options ?(equal=(=)) () = let default = match default,options with | _ , [] -> raise (Invalid_argument "Tactical.selector(empty)") | Some value , vs -> if List.for_all (fun v -> equal v.value value) vs then raise (Invalid_argument "Tactical.selector(default)") ; value | None , {value}::_ -> value in let fd = field ~id ~title ~descr ~default in fd , Selector(fd,options,equal) let accept _ = true let composer ~id ~title ~descr ?(default=Empty) ?(filter=accept) () = let fd = field ~id ~title ~descr ~default in fd , Composer(fd,filter) let search ~id ~title ~descr ~browse ~find () = let fd = field ~id ~title ~descr ~default:None in fd , Search(fd,browse,find) (* -------------------------------------------------------------------------- *) (* --- Feedback --- *) (* -------------------------------------------------------------------------- *) type 'a formatter = ('a,Format.formatter,unit) format -> 'a class type feedback = object method pool : pool method interactive : bool method get_title : string method has_error : bool method set_title : 'a. 'a formatter method set_descr : 'a. 'a formatter method set_error : 'a. 'a formatter method update_field : 'a. ?enabled:bool -> ?title:string -> ?tooltip:string -> ?range:bool -> ?vmin:int -> ?vmax:int -> ?filter:(Lang.F.term -> bool) -> 'a field -> unit end (* -------------------------------------------------------------------------- *) (* --- Tactical Process Utilities --- *) (* -------------------------------------------------------------------------- *) let at = function | Empty | Clause (Goal _) | Inside(Goal _,_) | Compose _ -> None | Clause (Step s) | Inside(Step s,_) -> Some s.id let mapi f cases = let rec iter f i n = function | [] -> [] | p::ps -> (f i n p) :: iter f (succ i) n ps in iter f 1 (List.length cases) cases let insert ?at cases sequent = List.map (fun (descr,p) -> let step = Conditions.(step ~descr (When p)) in descr , Conditions.insert ?at step sequent) cases let replace ~at cases sequent = List.map (fun (descr,cond) -> let step = Conditions.(step ~descr cond) in descr , Conditions.replace ~at step sequent) cases let split cases sequent = let hyps = fst sequent in List.map (fun (descr,p) -> descr,(hyps,p)) cases let rewrite ?at patterns sequent = List.map (fun (descr,guard,src,tgt) -> let sequent = Conditions.subst (fun e -> if e == src then tgt else raise Not_found) sequent in let step = Conditions.(step ~descr (When guard)) in descr , Conditions.insert ?at step sequent ) patterns (* -------------------------------------------------------------------------- *) (* --- Tactical Engines --- *) (* -------------------------------------------------------------------------- *) class type tactical = object method id : string method title : string method descr : string method params : parameter list method reset : unit method get_field : 'a. 'a field -> 'a method set_field : 'a. 'a field -> 'a -> unit method select : feedback -> selection -> status end type t = tactical (* -------------------------------------------------------------------------- *) (* --- Tactical Builder --- *) (* -------------------------------------------------------------------------- *) class virtual make ~id ~title ~descr ~params = object val hmap = Fmap.create () method id : string = id method title : string = title method descr : string = descr method params : parameter list = params method reset = Fmap.reset hmap method get_field : 'a. 'a field -> 'a = Fmap.get hmap method set_field : 'a. 'a field -> 'a -> unit = Fmap.set hmap method virtual select : feedback -> selection -> status end (* -------------------------------------------------------------------------- *) (* --- Registry --- *) (* -------------------------------------------------------------------------- *) let tacticals = ref Tmap.empty let register t = let id = t#id in if Tmap.mem id !tacticals then Wp_parameters.error "Tactical #%s already registered (skipped)" id else tacticals := Tmap.add id (t :> t) !tacticals let export t = register t ; (t :> t) let iter f = Tmap.iter (fun _id t -> f t) !tacticals let lookup ~id = Tmap.find id !tacticals (* -------------------------------------------------------------------------- *) (* --- Default Composers --- *) (* -------------------------------------------------------------------------- *) open Lang let () = for i = 0 to 9 do add_composer (object method id = Printf.sprintf "wp:%d" i method group = "const:unit" method title = string_of_int i method descr = "" method arity = 0 method filter = function _ -> true method compute = function _ -> F.e_int i end) done let () = add_composer (object method id = "wp:eq" method group = "logic" method title = "A == B" method descr = "" method arity = 2 method filter = function | [a;b] -> (try let ta = F.typeof a in let tb = F.typeof b in F.Tau.equal ta tb with Not_found -> false) | _ -> false method compute = function [a;b] -> F.e_eq a b | _ -> F.e_true end) let () = add_composer (object method id = "wp:leq" method group = "logic" method title = "A <= B" method descr = "" method arity = 2 method filter = List.for_all F.is_arith method compute = function [a;b] -> F.e_leq a b | _ -> F.e_true end) let () = add_composer (object method id = "wp:lt" method group = "logic" method title = "A < B" method descr = "" method arity = 2 method filter = List.for_all F.is_arith method compute = function [a;b] -> F.e_lt a b | _ -> F.e_true end) let () = add_composer (object method id = "wp:range" method group = "logic" method title = "A <= B <= C" method descr = "" method arity = 3 method filter = List.for_all F.is_arith method compute = function [a;b;c] -> F.e_and [F.e_leq a b;F.e_leq b c] | _ -> F.e_true end) let () = add_composer (object method id = "wp:not" method group = "logic" method title = "not A" method descr = "" method arity = 1 method filter = List.for_all F.is_prop method compute = function a::_ -> F.e_not a | _ -> F.e_false end) let () = add_composer (object method id = "wp:and" method group = "logic" method title = "A && B" method descr = "" method arity = 2 method filter = List.for_all F.is_prop method compute = F.e_and end) let () = add_composer (object method id = "wp:or" method group = "logic" method title = "A || B" method descr = "" method arity = 2 method filter = List.for_all F.is_prop method compute = F.e_or end) let () = add_composer (object method id = "wp:incr" method group = "additive" method title = "A+1" method descr = "" method arity = 1 method filter = List.for_all F.is_arith method compute es = F.e_sum (F.e_int 1 :: es) end) let () = add_composer (object method id = "wp:decr" method group = "additive" method title = "A-1" method descr = "" method arity = 1 method filter = List.for_all F.is_arith method compute es = F.e_sum (F.e_int (-1) :: es) end) let () = add_composer (object method id = "wp:add" method group = "additive" method title = "Add A+B" method descr = "" method arity = 2 method filter = List.for_all F.is_arith method compute = F.e_sum end) let () = add_composer (object method id = "wp:sub" method group = "additive" method title = "Sub A-B" method descr = "" method arity = 2 method filter = List.for_all F.is_arith method compute = function [a;b] -> F.e_sub a b | _ -> F.e_int 0 end) let () = add_composer (object method id = Printf.sprintf "wp:ten" method group = "product" method title = "A*10" method descr = "" method arity = 1 method filter = List.for_all F.is_arith method compute = function [e] -> F.e_times (Integer.of_int 10) e | _ -> F.e_int 0 end) let () = add_composer (object method id = "wp:mul" method group = "product" method title = "Mul A*B" method descr = "" method arity = 2 method filter = List.for_all F.is_arith method compute = F.e_prod end) let () = add_composer (object method id = "wp:div" method group = "product" method title = "Div A/B" method descr = "" method arity = 2 method filter = List.for_all F.is_arith method compute = function [a;b] -> F.e_div a b | _ -> F.e_int 1 end) let () = add_composer (object method id = "wp:mod" method group = "product" method title = "Mod A%B" method descr = "" method arity = 2 method filter = List.for_all F.is_int method compute = function [a;b] -> F.e_mod a b | _ -> F.e_int 1 end) let () = add_composer (object method id = "wp:get" method group = "structure" method title = "Get A[B]" method descr = "" method arity = 2 method filter = function | [a;b] -> begin try let ta = F.typeof a in let tb = F.typeof b in match ta with | Qed.Logic.Array(tm,_) -> F.Tau.equal tm tb | _ -> false with Not_found -> false end | _ -> false method compute = function [a;b] -> F.e_get a b | _ -> F.e_int 0 end) let () = add_composer (object method id = "wp:set" method group = "structure" method title = "Set A[B <-C]" method descr = "" method arity = 3 method filter = function | [a;b;c] -> begin try let ta = F.typeof a in let tb = F.typeof b in let tc = F.typeof c in match ta with | Qed.Logic.Array(tm,tv) -> F.Tau.equal tm tb && F.Tau.equal tv tc | _ -> false with Not_found -> false end | _ -> false method compute = function [a;b] -> F.e_get a b | _ -> F.e_int 0 end) (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Tactical.mli����������������������������������������������������0000666�0000000�0000000�00000020147�13571573400�016344� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Tactical *) (* -------------------------------------------------------------------------- *) open Lang.F open Conditions (** {2 Tactical Selection} *) type clause = Goal of pred | Step of step type process = sequent -> (string * sequent) list type status = | Not_applicable | Not_configured | Applicable of process type selection = | Empty | Clause of clause | Inside of clause * term | Compose of compose and compose = private | Cint of Integer.t | Range of int * int | Code of term * string * selection list val int : int -> selection val cint : Integer.t -> selection val range : int -> int -> selection val compose : string -> selection list -> selection val get_int : selection -> int option val destruct : selection -> selection list val head : clause -> pred val is_empty : selection -> bool val selected : selection -> term val subclause : clause -> pred -> bool (** When [subclause clause p], we have [clause = Step H] and [H -> p], or [clause = Goal G] and [p -> G]. *) (** Debug only *) val pp_clause : Format.formatter -> clause -> unit (** Debug only *) val pp_selection : Format.formatter -> selection -> unit (** {2 Tactical Parameters} *) type 'a field module Fmap : sig type t val create : unit -> t val get : t -> 'a field -> 'a (** raises Not_found if absent *) val set : t -> 'a field -> 'a -> unit end (** {2 Tactical Parameter Editors} *) type 'a named = { title : string ; descr : string ; vid : string ; value : 'a } type 'a range = { vmin : 'a option ; vmax : 'a option ; vstep : 'a } type 'a browser = ('a named -> unit) -> selection -> unit type parameter = | Checkbox of bool field | Spinner of int field * int range | Composer of selection field * (Lang.F.term -> bool) | Selector : 'a field * 'a named list * ('a -> 'a -> bool) -> parameter | Search : 'a named option field * 'a browser * (string -> 'a) -> parameter val ident : 'a field -> string val default : 'a field -> 'a val signature : 'a field -> 'a named val checkbox : id:string -> title:string -> descr:string -> ?default:bool -> unit -> bool field * parameter (** Unless specified, default is [false]. *) val spinner : id:string -> title:string -> descr:string -> ?default:int -> ?vmin:int -> ?vmax:int -> ?vstep:int -> unit -> int field * parameter (** Unless specified, default is [vmin] or [0] or [vmax], whichever fits. Range must be non-empty, and default shall fit in. *) val selector : id:string -> title:string -> descr:string -> ?default:'a -> options:'a named list -> ?equal:('a -> 'a -> bool) -> unit -> 'a field * parameter (** Unless specified, default is head option. Default equality is [(=)]. Options must be non-empty. *) val composer : id:string -> title:string -> descr:string -> ?default:selection -> ?filter:(Lang.F.term -> bool) -> unit -> selection field * parameter (** Unless specified, default is Empty selection. *) val search : id:string -> title:string -> descr:string -> browse:('a browser) -> find:(string -> 'a) -> unit -> 'a named option field * parameter (** Search field. - [browse s n] is the lookup function, used in the GUI only. Shall returns at most [n] results applying to selection [s]. - [find n] is used at script replay, and shall retrieve the selected item's [id] later on. *) type 'a formatter = ('a,Format.formatter,unit) format -> 'a class type feedback = object (** Global fresh variable pool *) method pool : pool (** Interactive mode. If [false] the GUI is not activated. Hence, detailed feedback is not reported to the user. *) method interactive : bool method get_title : string (** Retrieve the title *) method has_error : bool (** Retrieve the errors *) method set_title : 'a. 'a formatter (** Update the title {i wrt} current selection & tuning *) method set_descr : 'a. 'a formatter (** Add a short description {i wrt} current selection & tuning *) method set_error : 'a. 'a formatter (** Mark the current configuration as invalid *) method update_field : 'a. ?enabled:bool -> ?title:string -> ?tooltip:string -> ?range:bool -> ?vmin:int -> ?vmax:int -> ?filter:(Lang.F.term -> bool) -> 'a field -> unit (** Update field parameters *) end (** {2 Tactical Utilities} *) val at : selection -> int option val mapi : (int -> int -> 'a -> 'b) -> 'a list -> 'b list val insert : ?at:int -> (string * pred) list -> process val replace : at:int -> (string * condition) list -> process val split : (string * pred) list -> process val rewrite : ?at:int -> (string * pred * term * term) list -> process (** For each pattern [(descr,guard,src,tgt)] replace [src] with [tgt] under condition [guard], inserted in position [at]. *) (** {2 Tactical Plug-in} *) class type tactical = object method id : string method title : string method descr : string method params : parameter list method reset : unit method get_field : 'a. 'a field -> 'a method set_field : 'a. 'a field -> 'a -> unit method select : feedback -> selection -> status end class virtual make : id:string -> title:string -> descr:string -> params:parameter list -> object method id : string method reset : unit method get_field : 'a. 'a field -> 'a method set_field : 'a. 'a field -> 'a -> unit method title : string method descr : string method params : parameter list method reset : unit (** Reset all parameters to default *) method virtual select : feedback -> selection -> status (** Shall return [Applicable] or [Not_configured] if the tactic might apply to the selection. Hints can be provided here, if appropriate. The continuation [f] returned with [Applicable f] shall generates sub-goals {i wrt} to the given selection and current field values. @raise Exit,Not_found is like returning Not_applicable. *) end (** {2 Composer Factory} *) class type composer = object method id : string method group : string method title : string method descr : string method arity : int method filter : term list -> bool method compute : term list -> term end (** {2 Global Registry} *) type t = tactical val register : #tactical -> unit val export : #tactical -> tactical (** Register and returns the tactical *) val lookup : id:string -> tactical val iter : (tactical -> unit) -> unit val add_composer : #composer -> unit val iter_composer : (composer -> unit) -> unit �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/VC.ml�����������������������������������������������������������0000666�0000000�0000000�00000010320�13571573400�014747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Wpo (* -------------------------------------------------------------------------- *) (* --- Verification Conditions Interface --- *) (* -------------------------------------------------------------------------- *) type t = Wpo.t let get_id = Wpo.get_gid let get_model = Wpo.get_model let get_scope = Wpo.get_scope let get_context = Wpo.get_context let get_description = Wpo.get_label let get_property = Wpo.get_property let get_sequent w = snd (Wpo.compute w) let get_result = Wpo.get_result let get_results = Wpo.get_results let get_logout = Wpo.get_file_logout let get_logerr = Wpo.get_file_logerr let is_trivial = Wpo.is_trivial let is_proved = Wpo.is_proved let get_formula po = match po.po_formula with | GoalLemma l -> l.VC_Lemma.lemma.Definitions.l_lemma | GoalAnnot { VC_Annot.goal = g } -> WpContext.on_context (get_context po) Wpo.GOAL.compute_proof g let clear = Wpo.clear let proof = Wpo.goals_of_property let iter_ip on_goal ip = Wpo.iter ~ip ~on_goal () let iter_kf on_goal ?bhv kf = match bhv with | None -> (* iter on all behaviors, see Wpo.iter *) Wpo.iter ~index:(Wpo.Function(kf,None)) ~on_goal () | Some bs -> List.iter (fun b -> Wpo.iter ~index:(Wpo.Function(kf,Some b)) ~on_goal () ) bs let remove = iter_ip Wpo.remove let () = Property_status.register_property_remove_hook remove (* -------------------------------------------------------------------------- *) (* --- Generator Interface --- *) (* -------------------------------------------------------------------------- *) let generator ?model () = let setup = match model with | None -> Register.cmdline () | Some s -> Factory.parse [s] in let driver = Driver.load_driver () in CfgWP.computer setup driver let generate_ip ?model ip = let gen = generator ?model () in Generator.compute_ip gen ip let generate_kf ?model ?(bhv=[]) kf = let gen = generator ?model () in Generator.compute_kf gen ~bhv ~kf () let generate_call ?model stmt = let gen = generator ?model () in Generator.compute_call gen stmt (* -------------------------------------------------------------------------- *) (* --- Prover Interface --- *) (* -------------------------------------------------------------------------- *) let prove = Prover.prove let spawn = Prover.spawn ~delayed:true let server = ProverTask.server let command ?provers ?tip vcs = Register.do_wp_proofs_iter ?provers ?tip (fun f -> Bag.iter f vcs) (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/VC.mli����������������������������������������������������������0000666�0000000�0000000�00000011251�13571573400�015124� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Verification Conditions Interface --- *) (* -------------------------------------------------------------------------- *) open VCS (** {2 Proof Obligations} *) type t (** elementary proof obligation *) val get_id : t -> string val get_model : t -> WpContext.model val get_scope : t -> WpContext.scope val get_context : t -> WpContext.context val get_description : t -> string val get_property : t -> Property.t val get_result : t -> prover -> result val get_results : t -> (prover * result) list val get_logout : t -> prover -> string (** only file name, might not exists *) val get_logerr : t -> prover -> string (** only file name, might not exists *) val get_sequent : t -> Conditions.sequent val get_formula: t -> Lang.F.pred val is_trivial : t -> bool val is_proved : t -> bool (** {2 Database} Notice that a property or a function have no proof obligation until you explicitly generate them {i via} the [generate_xxx] functions below. *) val clear : unit -> unit val proof : Property.t -> t list (** List of proof obligations computed for a given property. Might be empty if you don't have used one of the generators below. *) val remove : Property.t -> unit val iter_ip : (t -> unit) -> Property.t -> unit val iter_kf : (t -> unit) -> ?bhv:string list -> Kernel_function.t -> unit (** {2 Generators} The generated VCs are also added to the database, so they can be accessed later. The default value for [model] is what has been given on the command line ([-wp-model] option) *) val generate_ip : ?model:string -> Property.t -> t Bag.t val generate_kf : ?model:string -> ?bhv:string list -> Kernel_function.t -> t Bag.t val generate_call : ?model:string -> Cil_types.stmt -> t Bag.t (** {2 Prover Interface} *) val prove : t -> ?config:config -> ?mode:mode -> ?start:(t -> unit) -> ?progress:(t -> string -> unit) -> ?result:(t -> prover -> result -> unit) -> prover -> bool Task.task (** Returns a ready-to-schedule task. *) val spawn : t -> ?config:config -> ?start:(t -> unit) -> ?progress:(t -> string -> unit) -> ?result:(t -> prover -> result -> unit) -> ?success:(t -> prover option -> unit) -> ?pool:Task.pool -> (mode * prover) list -> unit (** Same as [prove] but schedule the tasks into the global server returned by [server] function below. The first succeeding prover cancels the other ones. *) val server : ?procs:int -> unit -> Task.server (** Default number of parallel tasks is given by [-wp-par] command-line option. The returned server is global to Frama-C, but the number of parallel task allowed will be updated to fit the [~procs] or command-line options. *) val command : ?provers:Why3.Whyconf.prover list -> ?tip:bool -> t Bag.t -> unit (** Run the provers with the command-line interface. If [~provers] is set, it is used for computing the list of provers to spawn. If [~tip] is set, it is used to compute the script execution mode. *) (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/VCS.ml����������������������������������������������������������0000666�0000000�0000000�00000027751�13571573400�015112� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Prover Results --- *) (* -------------------------------------------------------------------------- *) let dkey_no_time_info = Wp_parameters.register_category "no-time-info" let dkey_no_step_info = Wp_parameters.register_category "no-step-info" let dkey_no_goals_info = Wp_parameters.register_category "no-goals-info" let dkey_no_cache_info = Wp_parameters.register_category "no-cache-info" let dkey_success_only = Wp_parameters.register_category "success-only" type prover = | Why3 of Why3Provers.t (* Prover via WHY *) | NativeAltErgo (* Direct Alt-Ergo *) | NativeCoq (* Direct Coq and Coqide *) | Qed (* Qed Solver *) | Tactical (* Interactive Prover *) type mode = | BatchMode (* Only check scripts *) | EditMode (* Edit then check scripts *) | FixMode (* Try check script, then edit script on non-success *) let prover_of_name = function | "" | "none" -> None | "qed" | "Qed" -> Some Qed | "native-alt-ergo" (* for wp-reports *) | "native:alt-ergo" | "native:altgr-ergo" -> Wp_parameters.warning ~once:true ~current:false "native support for alt-ergo is deprecated, use why3 instead" ; Some NativeAltErgo | "native-coq" (* for wp-reports *) | "native:coq" | "native:coqide" | "native:coqedit" -> Wp_parameters.warning ~once:true ~current:false "native support for coq is deprecated, use tip instead" ; Some NativeCoq | "script" -> Some Tactical | "tip" -> Some Tactical | "why3" -> Some (Why3 { Why3.Whyconf.prover_name = "why3"; Why3.Whyconf.prover_version = ""; Why3.Whyconf.prover_altern = "generate only" }) | s -> match Extlib.string_del_prefix "why3:" s with | Some "" -> None | Some s' -> Some (Why3 (Why3Provers.find s')) | None -> Some (Why3 (Why3Provers.find s)) let mode_of_prover_name = function | "native:coqedit" -> EditMode | "native:coqide" | "native:altgr-ergo" -> FixMode | _ -> BatchMode let name_of_prover = function | Why3 s -> "why3:" ^ (Why3Provers.print s) | NativeAltErgo -> "alt-ergo" | NativeCoq -> "coq" | Qed -> "qed" | Tactical -> "script" let title_of_prover = function | Why3 s -> Why3Provers.title s | NativeAltErgo -> "Alt-Ergo" | NativeCoq -> "Coq" | Qed -> "Qed" | Tactical -> "Script" let title_of_mode = function | FixMode -> "Fix" | EditMode -> "Edit" | BatchMode -> "Batch" let sanitize_why3 s = let buffer = Buffer.create 80 in assert (s <> "ide"); Buffer.add_string buffer "Why3_" ; String.iter (fun c -> let c = if ('0' <= c && c <= '9') || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') then c else '_' in Buffer.add_char buffer c) s ; Buffer.contents buffer let filename_for_prover = function | Why3 s -> sanitize_why3 (Why3Provers.print s) | NativeAltErgo -> "Alt-Ergo" | NativeCoq -> "Coq" | Qed -> "Qed" | Tactical -> "Tactical" let is_auto = function | Qed | NativeAltErgo | Why3 _ -> true | Tactical | NativeCoq -> false let cmp_prover p q = match p,q with | Qed , Qed -> 0 | Qed , _ -> (-1) | _ , Qed -> 1 | NativeAltErgo , NativeAltErgo -> 0 | NativeAltErgo , _ -> (-1) | _ , NativeAltErgo -> 1 | Tactical , Tactical -> 0 | Tactical , _ -> (-1) | _ , Tactical -> 1 | NativeCoq , NativeCoq -> 0 | NativeCoq , _ -> (-1) | _ , NativeCoq -> 1 | Why3 p , Why3 q -> Why3Provers.compare p q let pp_prover fmt = function | NativeAltErgo -> Format.pp_print_string fmt "Alt-Ergo (Native)" | NativeCoq -> Format.pp_print_string fmt "Coq (Native)" | Why3 smt -> if Wp_parameters.debug_atleast 1 then Format.fprintf fmt "Why:%s" (Why3Provers.print smt) else Format.pp_print_string fmt (Why3Provers.title smt) | Qed -> Format.fprintf fmt "Qed" | Tactical -> Format.pp_print_string fmt "Tactical" let pp_mode fmt m = Format.pp_print_string fmt (title_of_mode m) module P = struct type t = prover let compare = cmp_prover end module Pset = Set.Make(P) module Pmap = Map.Make(P) (* -------------------------------------------------------------------------- *) (* --- Config --- *) (* -------------------------------------------------------------------------- *) type config = { valid : bool ; timeout : int option ; stepout : int option ; } let param f = let v = f() in if v>0 then Some v else None let current () = { valid = false ; timeout = param Wp_parameters.Timeout.get ; stepout = param Wp_parameters.Steps.get ; } let default = { valid = false ; timeout = None ; stepout = None } let get_timeout = function | { timeout = None } -> Wp_parameters.Timeout.get () | { timeout = Some t } -> t let get_stepout = function | { stepout = None } -> Wp_parameters.Steps.get () | { stepout = Some t } -> t (* -------------------------------------------------------------------------- *) (* --- Results --- *) (* -------------------------------------------------------------------------- *) type verdict = | NoResult | Invalid | Unknown | Timeout | Stepout | Computing of (unit -> unit) (* kill function *) | Checked | Valid | Failed type result = { verdict : verdict ; cached : bool ; solver_time : float ; prover_time : float ; prover_steps : int ; prover_errpos : Lexing.position option ; prover_errmsg : string ; } let is_verdict r = match r.verdict with | Valid | Checked | Unknown | Invalid | Timeout | Stepout | Failed -> true | NoResult | Computing _ -> false let is_valid = function { verdict = Valid } -> true | _ -> false let is_computing = function { verdict=Computing _ } -> true | _ -> false let configure r = let valid = (r.verdict = Valid) in let timeout = let t = r.prover_time in if t > 0.0 then let timeout = Wp_parameters.Timeout.get() in let margin = Wp_parameters.TimeExtra.get() + int_of_float (t +. 0.5) in Some(max timeout margin) else None in let stepout = if r.prover_steps > 0 && r.prover_time <= 0.0 then let stepout = Wp_parameters.Steps.get () in let margin = 1000 in Some(max stepout margin) else None in { valid ; timeout ; stepout ; } let time_fits t = t = 0.0 || let timeout = Wp_parameters.Timeout.get () in timeout = 0 || let margin = Wp_parameters.TimeMargin.get () in t < float (timeout - margin) let step_fits n = n = 0 || let stepout = Wp_parameters.Steps.get () in stepout = 0 || n < stepout let autofit r = time_fits r.prover_time && step_fits r.prover_steps let result ?(cached=false) ?(solver=0.0) ?(time=0.0) ?(steps=0) verdict = { verdict ; cached = cached ; solver_time = solver ; prover_time = time ; prover_steps = steps ; prover_errpos = None ; prover_errmsg = "" ; } let no_result = result NoResult let valid = result Valid let checked = result Checked let invalid = result Invalid let unknown = result Unknown let timeout t = result ~time:(float t) Timeout let stepout n = result ~steps:n Stepout let computing kill = result (Computing kill) let failed ?pos msg = { verdict = Failed ; cached = false ; solver_time = 0.0 ; prover_time = 0.0 ; prover_steps = 0 ; prover_errpos = pos ; prover_errmsg = msg ; } let cached r = if is_verdict r then { r with cached=true } else r let kfailed ?pos msg = Pretty_utils.ksfprintf (failed ?pos) msg let perfo extended dkey = extended || not (Wp_parameters.has_dkey dkey) let pp_perf ~extended fmt r = begin let t = r.solver_time in if t > Rformat.epsilon && perfo extended dkey_no_time_info then Format.fprintf fmt " (Qed:%a)" Rformat.pp_time t ; let t = r.prover_time in if t > Rformat.epsilon && perfo extended dkey_no_time_info then Format.fprintf fmt " (%a)" Rformat.pp_time t ; let s = r.prover_steps in if s > 0 && perfo extended dkey_no_step_info then Format.fprintf fmt " (%d)" s ; if r.cached && perfo extended dkey_no_cache_info then Format.fprintf fmt " (cached)" ; end let pp_res ~extended fmt r = match r.verdict with | NoResult -> Format.pp_print_string fmt (if extended then "No Result" else "-") | Computing _ -> Format.pp_print_string fmt "Computing" | Checked -> Format.fprintf fmt "Typechecked" | Invalid -> Format.pp_print_string fmt "Invalid" | Valid when Wp_parameters.has_dkey dkey_success_only -> Format.pp_print_string fmt "Valid" | (Timeout|Stepout|Unknown) when Wp_parameters.has_dkey dkey_success_only -> Format.pp_print_string fmt "Unsuccess" | Valid -> Format.fprintf fmt "Valid%a" (pp_perf ~extended) r | Unknown -> Format.fprintf fmt "Unknown%a" (pp_perf ~extended) r | Timeout -> Format.fprintf fmt "Timeout%a" (pp_perf ~extended) r | Stepout -> Format.fprintf fmt "Step limit%a" (pp_perf ~extended) r | Failed -> Format.fprintf fmt "Failed@ %s" r.prover_errmsg let pp_result = pp_res ~extended:false let pp_result_perf = pp_res ~extended:true let compare p q = let rank = function | NoResult | Computing _ -> 0 | Failed -> 1 | Unknown -> 2 | Timeout | Stepout -> 3 | Valid -> 4 | Invalid -> 5 | Checked -> 6 in let r = rank q.verdict - rank p.verdict in if r <> 0 then r else let s = Transitioning.Stdlib.compare p.prover_steps q.prover_steps in if s <> 0 then s else let t = Transitioning.Stdlib.compare p.prover_time q.prover_time in if t <> 0 then t else Transitioning.Stdlib.compare p.solver_time q.solver_time let combine v1 v2 = match v1 , v2 with | Valid , Valid -> Valid | Failed , _ | _ , Failed -> Failed | Invalid , _ | _ , Invalid -> Invalid | Timeout , _ | _ , Timeout -> Timeout | Stepout , _ | _ , Stepout -> Stepout | _ -> Unknown let merge r1 r2 = let err = if r1.prover_errmsg <> "" then r1 else r2 in { verdict = combine r1.verdict r2.verdict ; cached = r1.cached && r2.cached ; solver_time = max r1.solver_time r2.solver_time ; prover_time = max r1.prover_time r2.prover_time ; prover_steps = max r1.prover_steps r2.prover_steps ; prover_errpos = err.prover_errpos ; prover_errmsg = err.prover_errmsg ; } let choose r1 r2 = match is_valid r1 , is_valid r2 with | true , false -> r1 | false , true -> r2 | _ -> if compare r1 r2 <= 0 then r1 else r2 let best = List.fold_left choose no_result �����������������������frama-c-20.0-Calcium/src/plugins/wp/VCS.mli���������������������������������������������������������0000666�0000000�0000000�00000011423�13571573400�015250� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Verification Condition Status *) (* -------------------------------------------------------------------------- *) (** {2 Prover} *) type prover = | Why3 of Why3Provers.t (* Prover via WHY *) | NativeAltErgo (* Direct Alt-Ergo *) | NativeCoq (* Direct Coq and Coqide *) | Qed (* Qed Solver *) | Tactical (* Interactive Prover *) type mode = | BatchMode (* Only check scripts *) | EditMode (* Edit then check scripts *) | FixMode (* Try check script, then edit script on non-success *) module Pset : Set.S with type elt = prover module Pmap : Map.S with type key = prover val name_of_prover : prover -> string val title_of_prover : prover -> string val filename_for_prover : prover -> string val prover_of_name : string -> prover option val mode_of_prover_name : string -> mode val title_of_mode : mode -> string val pp_prover : Format.formatter -> prover -> unit val pp_mode : Format.formatter -> mode -> unit val cmp_prover : prover -> prover -> int (* -------------------------------------------------------------------------- *) (** {2 Config} [None] means current WP option default. [Some 0] means prover default. *) (* -------------------------------------------------------------------------- *) type config = { valid : bool ; timeout : int option ; stepout : int option ; } val current : unit -> config (** Current parameters *) val default : config (** all None *) val get_timeout : config -> int (** 0 means no-timeout *) val get_stepout : config -> int (** 0 means no-stepout *) (** {2 Results} *) type verdict = | NoResult | Invalid | Unknown | Timeout | Stepout | Computing of (unit -> unit) (* kill function *) | Checked | Valid | Failed type result = { verdict : verdict ; cached : bool ; solver_time : float ; prover_time : float ; prover_steps : int ; prover_errpos : Lexing.position option ; prover_errmsg : string ; } val no_result : result val valid : result val checked : result val invalid : result val unknown : result val stepout : int -> result val timeout : int -> result val computing : (unit -> unit) -> result val failed : ?pos:Lexing.position -> string -> result val kfailed : ?pos:Lexing.position -> ('a,Format.formatter,unit,result) format4 -> 'a val cached : result -> result (** only for true verdicts *) val result : ?cached:bool -> ?solver:float -> ?time:float -> ?steps:int -> verdict -> result val is_auto : prover -> bool val is_verdict : result -> bool val is_valid: result -> bool val is_computing: result -> bool val configure : result -> config val autofit : result -> bool (** Result that fits the default configuration *) val pp_result : Format.formatter -> result -> unit val pp_result_perf : Format.formatter -> result -> unit val compare : result -> result -> int (* best is minimal *) val merge : result -> result -> result val choose : result -> result -> result val best : result list -> result val dkey_no_time_info: Wp_parameters.category val dkey_no_step_info: Wp_parameters.category val dkey_no_goals_info: Wp_parameters.category val dkey_no_cache_info: Wp_parameters.category val dkey_success_only: Wp_parameters.category ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Vlist.ml��������������������������������������������������������0000666�0000000�0000000�00000032167�13571573400�015555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- VList Builtins --- *) (* -------------------------------------------------------------------------- *) open Lang open Lang.F module L = Qed.Logic module E = Qed.Engine (* -------------------------------------------------------------------------- *) (* --- Driver --- *) (* -------------------------------------------------------------------------- *) let library = "vlist" (*--- Linked Symbols ---*) let t_list = "\\list" let l_list = Lang.infoprover "list" let l_concat = Lang.infoprover (E.F_right "concat") let l_elt = Lang.(E.({ altergo = F_subst "cons(%1,nil)" ; why3 = F_call "elt" ; coq = F_subst "(cons %1 nil)" ; })) let l_repeat = Lang.(E.({ altergo = F_call "repeat_box" ; why3 = F_call "repeat" ; coq = F_call "repeat" ; })) (*--- Typechecking ---*) let a_list = Lang.get_builtin_type ~library ~name:t_list ~link:l_list let _list_of t = L.Data(a_list,[t]) let vlist_get_tau = function | None -> invalid_arg "a list operator without result type" | Some t -> t let ty_nil = function _ -> invalid_arg "All nil must be typed" let ty_listelt = function | L.Data(_,[t]) -> (t : tau) | _ -> raise Not_found let ty_cons = function | [ _ ; Some l ] -> l | [ Some e ; _ ] -> L.Data(a_list,[e]) | _ -> raise Not_found let ty_elt = function | [ Some e ] -> L.Data(a_list,[e]) | _ -> raise Not_found let ty_nth = function | Some l :: _ -> ty_listelt l | _ -> raise Not_found let rec ty_concat = function | Some l :: _ -> l | None :: w -> ty_concat w | [] -> raise Not_found let ty_repeat = function | Some l :: _ -> l | _ -> raise Not_found (*--- Qed Symbols ---*) let f_cons = Lang.extern_f ~library ~typecheck:ty_cons "cons" (* rewriten in concat(elt) *) let f_nil = Lang.extern_f ~library ~typecheck:ty_nil ~category:L.Constructor "nil" let f_elt = Lang.extern_f ~library ~category:L.Constructor ~typecheck:ty_elt ~link:l_elt "elt" let concatenation = L.(Operator { invertible = true ; associative = true ; commutative = false ; idempotent = false ; neutral = E_fun(f_nil,[]) ; absorbant = E_none ; }) let f_nth = Lang.extern_f ~library ~typecheck:ty_nth "nth" let f_length = Lang.extern_f ~library ~sort:L.Sint "length" let f_concat = Lang.extern_f ~library ~category:concatenation ~typecheck:ty_concat ~link:l_concat "concat" let f_repeat = Lang.extern_f ~library ~typecheck:ty_repeat ~link:l_repeat "repeat" (*--- ACSL Builtins ---*) let () = let open LogicBuiltins in begin add_builtin "\\Nil" [] f_nil ; add_builtin "\\Cons" [A;A] f_cons ; add_builtin "\\nth" [A;Z] f_nth ; add_builtin "\\length" [A] f_length ; add_builtin "\\concat" [A;A] f_concat ; add_builtin "\\repeat" [A;Z] f_repeat ; end (*--- Smart Constructors ---*) let is_nil e = match F.repr e with | Qed.Logic.Fun (f,_) -> Fun.equal f f_nil | _ -> false let v_nil t = F.e_fun ~result:t f_nil [] let v_elt e = F.e_fun f_elt [e] let v_concat es tau = F.e_fun f_concat es ~result:tau let v_length l = F.e_fun f_length [l] let v_repeat s n = F.e_fun f_repeat [s;n] (* -------------------------------------------------------------------------- *) (* --- Rewriters --- *) (* -------------------------------------------------------------------------- *) let rewrite_cons a w tau = v_concat [v_elt a ; w] (vlist_get_tau tau) let rewrite_length e = match F.repr e with | L.Fun( nil , [] ) when nil == f_nil -> F.e_zero | L.Fun( elt , [_] ) when elt == f_elt -> F.e_one | L.Fun( concat , es ) when concat == f_concat -> F.e_sum (List.map v_length es) | L.Fun( repeat , [ u ; n ] ) when repeat == f_repeat && Cint.is_positive_or_null n -> F.e_mul (v_length u) n | _ -> raise Not_found let rec get_nth k e = match F.repr e with | L.Fun( concat , list ) when concat == f_concat -> get_nth_list k list | L.Fun( elt , [x] ) when elt == f_elt && k = 0 -> x | _ -> raise Not_found and get_nth_list k = function | head::tail -> begin match F.repr head with | L.Fun( elt , [x] ) when elt == f_elt -> if k = 0 then x else get_nth_list (k-1) tail | _ -> raise Not_found end | [] -> raise Not_found let rewrite_nth s k = match F.repr k with | L.Kint z -> let k = try Integer.to_int z with Z.Overflow -> raise Not_found in if 0 <= k then get_nth k s else raise Not_found | _ -> raise Not_found let rewrite_repeat s n = if F.equal n e_zero then v_nil (F.typeof s) else if F.equal n e_one then s else if is_nil s then s else match F.repr s with | L.Fun( repeat , [s0 ; n0] ) when (repeat == f_repeat) && (Cint.is_positive_or_null n) && (Cint.is_positive_or_null n0) -> v_repeat s0 (F.e_mul n0 n) | _ -> raise Not_found let rec leftmost a ms = match F.repr a with | L.Fun( concat , e :: es ) when concat == f_concat -> leftmost e (es@ms) | L.Fun( repeat , [ u ; n ] ) when repeat == f_repeat && Cint.is_positive_or_null n -> leftmost u (v_repeat u (F.e_sub n F.e_one) :: ms) | _ -> a , ms let rec rightmost ms a = match F.repr a with | L.Fun( concat , es ) when concat == f_concat -> begin match List.rev es with | [] -> ms , a | e::es -> rightmost (ms @ List.rev es) e end | L.Fun( repeat , [ u ; n ] ) when repeat == f_repeat && Cint.is_positive_or_null n -> rightmost (ms @ [v_repeat u (F.e_sub n F.e_one)]) u | _ -> ms , a let leftmost_eq a b = let a , u = leftmost a [] in let b , v = leftmost b [] in if u <> [] || v <> [] then match F.is_equal a b with | L.Yes -> F.p_equal (v_concat u (F.typeof a)) (v_concat v (F.typeof a)) | L.No -> F.p_false | L.Maybe -> raise Not_found else raise Not_found let rightmost_eq a b = let u , a = rightmost [] a in let v , b = rightmost [] b in if u <> [] || v <> [] then match F.is_equal a b with | L.Yes -> F.p_equal (v_concat u (F.typeof a)) (v_concat v (F.typeof a)) | L.No -> F.p_false | L.Maybe -> raise Not_found else raise Not_found let p_is_nil a = F.p_equal a (v_nil (F.typeof a)) let rewrite_is_nil a = match F.repr a with | L.Fun(concat,es) when concat == f_concat -> F.p_all p_is_nil es | L.Fun(elt,[_]) when elt == f_elt -> F.p_false | L.Fun(repeat,[u;n]) when repeat == f_repeat -> F.p_or (F.p_leq n F.e_zero) (p_is_nil u) | _ -> raise Not_found let elements a = match F.repr a with | L.Fun( nil , [] ) when nil == f_nil -> [] | L.Fun( concat , es ) when concat == f_concat -> es | _ -> [a] (* [omit rs x ys]: if ys = u.x.v returns (rs+u,v) with r in reverse order *) let rec omit rs x = function | [] -> raise Not_found | y::ys -> if x == y then rs,ys else omit (y::rs) x ys let rec subsequence xs rs ys = match xs with | [] -> List.rev_append rs ys | x::xs -> let rs,ys = omit rs x ys in subsequence xs rs ys let rewrite_eq a b = match F.repr a , F.repr b with | L.Fun(nil,[]) , _ when nil == f_nil -> rewrite_is_nil b | _ , L.Fun(nil,[]) when nil == f_nil -> rewrite_is_nil a | _ -> try leftmost_eq a b with Not_found -> try rightmost_eq a b with Not_found -> let xs = elements a in let ys = elements b in if List.length xs < List.length ys then F.p_all p_is_nil (subsequence xs [] ys) else F.p_all p_is_nil (subsequence ys [] xs) (* All Simplifications *) let () = Context.register begin fun () -> F.set_builtin_2 f_nth rewrite_nth ; F.set_builtin_2' f_cons rewrite_cons ; F.set_builtin_2 f_repeat rewrite_repeat ; F.set_builtin_1 f_length rewrite_length ; F.set_builtin_eqp f_repeat rewrite_eq ; F.set_builtin_eqp f_nil rewrite_eq ; end (* -------------------------------------------------------------------------- *) (* --- Typing --- *) (* -------------------------------------------------------------------------- *) let f_list = [ f_nil ; f_cons ; f_elt ; f_repeat ; f_concat ] let check_tau = Lang.is_builtin_type ~name:t_list let check_term e = try match F.repr e with | L.Fvar x -> check_tau (F.tau_of_var x) | L.Bvar(_,t) -> check_tau t | L.Fun( f , _ ) -> List.memq f f_list || check_tau (Lang.F.typeof e) | _ -> false with Not_found -> false let f_vlist_eq = Lang.extern_f ~library ~sort:L.Sprop "vlist_eq" let specialize_eq_list = {For_export.for_tau = check_tau; mk_new_eq = (fun a b -> Lang.F.e_fun ~result:Qed.Logic.Prop f_vlist_eq [a;b])} (* -------------------------------------------------------------------------- *) (* --- Export --- *) (* -------------------------------------------------------------------------- *) class type engine = object method callstyle : Qed.Engine.callstyle method pp_atom : Format.formatter -> Lang.F.term -> unit method pp_flow : Format.formatter -> Lang.F.term -> unit end let rec export (engine : #engine) fmt = function | [] -> begin match engine#callstyle with | E.CallVoid -> Format.pp_print_string fmt "nil()" | E.CallVar|E.CallApply -> Format.pp_print_string fmt "nil" end | e::es -> begin match F.repr e with | L.Fun( elt , [x] ) when elt == f_elt -> apply engine fmt "cons" x es | _ -> apply engine fmt "concat" e es end and apply (engine : #engine) fmt f x es = match engine#callstyle with | E.CallVar | E.CallVoid -> Format.fprintf fmt "@[<hov 2>%s(@,%a,@,%a)@]" f engine#pp_flow x (export engine) es | E.CallApply -> Format.fprintf fmt "@[<hov 2>(%s@ %a@ %a)@]" f engine#pp_atom x (export engine) es let export_rewriter_concat es tau = match es with | [] -> v_nil (vlist_get_tau tau) | e::es -> begin match F.repr e with | L.Fun( elt , [x] ) when Lang.Fun.equal elt f_elt -> e_fun ?result:tau f_cons [x;e_fun ?result:tau f_concat es] | _ -> raise Not_found end let () = Lang.For_export.set_builtin' f_concat export_rewriter_concat (* -------------------------------------------------------------------------- *) let rec collect xs = function | [] -> List.rev xs , [] | (e::es) as w -> begin match F.repr e with | L.Fun( elt , [x] ) when elt == f_elt -> collect (x::xs) es | _ -> List.rev xs , w end let list engine fmt xs = Qed.Plib.pp_listsep ~sep:"," engine#pp_flow fmt xs let elements (engine : #engine) fmt xs = Format.fprintf fmt "@[<hov 2>[ %a ]@]" (list engine) xs let rec pp_concat (engine : #engine) fmt es = let xs , es = collect [] es in begin (if xs <> [] then elements engine fmt xs) ; match es with | [] -> () | m::ms -> if xs <> [] then Format.fprintf fmt " ^@ " ; engine#pp_atom fmt m ; if ms <> [] then ( Format.fprintf fmt " ^@ " ; pp_concat engine fmt ms ) end let pretty (engine : #engine) fmt es = if es = [] then Format.pp_print_string fmt "[]" else Format.fprintf fmt "@[<hov 2>%a@]" (pp_concat engine) es let pprepeat (engine : #engine) fmt = function | [l;n] -> Format.fprintf fmt "@[<hov 2>(%a *^@ %a)@]" engine#pp_flow l engine#pp_flow n | es -> Format.fprintf fmt "@[<hov 2>repeat(%a)@]" (list engine) es let shareable e = match F.repr e with | L.Fun( f , es ) -> f != f_elt && es != [] | _ -> true (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Vlist.mli�������������������������������������������������������0000666�0000000�0000000�00000004576�13571573400�015731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang (** VList Theory Builtins Empty API, the module only registers builtins. *) val check_tau : tau -> bool val check_term : F.term -> bool class type engine = object method callstyle : Qed.Engine.callstyle method pp_atom : Format.formatter -> F.term -> unit method pp_flow : Format.formatter -> F.term -> unit end val f_nil : Fun.t val f_elt : Fun.t val f_nth : Fun.t val f_cons : Fun.t val f_concat : Fun.t val f_repeat : Fun.t val export : #engine -> Format.formatter -> F.term list -> unit val pretty : #engine -> Format.formatter -> F.term list -> unit val elements : #engine -> Format.formatter -> F.term list -> unit val pprepeat : #engine -> Format.formatter -> F.term list -> unit val shareable : F.term -> bool val specialize_eq_list: Lang.For_export.specific_equality ����������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Vset.ml���������������������������������������������������������0000666�0000000�0000000�00000031232�13571573400�015365� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Qed open Lang open Lang.F (* -------------------------------------------------------------------------- *) (* --- Logical Sets --- *) (* -------------------------------------------------------------------------- *) type set = vset list and vset = | Set of tau * term | Singleton of term | Range of term option * term option | Descr of var list * term * pred let occurs_opt x = function | None -> false | Some t -> occurs x t let occurs_vset x = function | Set(_,t) | Singleton t -> occurs x t | Range(a,b) -> occurs_opt x a || occurs_opt x b | Descr(xs,t,p) -> if List.exists (Var.equal x) xs then false else (occurs x t || occursp x p) let occurs x = List.exists (occurs_vset x) let vars_opt = function None -> Vars.empty | Some e -> F.vars e let vars_vset = function | Set(_,t) -> F.vars t | Singleton t -> F.vars t | Range(a,b) -> Vars.union (vars_opt a) (vars_opt b) | Descr(xs,t,p) -> List.fold_left (fun xs x -> Vars.remove x xs) (Vars.union (F.vars t) (F.varsp p)) xs let vars vset = List.fold_left (fun xs s -> Vars.union xs (vars_vset s)) Vars.empty vset (* -------------------------------------------------------------------------- *) (* --- Pretty --- *) (* -------------------------------------------------------------------------- *) let pp_bound fmt = function | None -> () | Some e -> F.pp_term fmt e let pp_vset fmt = function | Set(_,t) -> F.pp_term fmt t | Singleton x -> Format.fprintf fmt "@[<hov 2>{ %a }@]" F.pp_term x | Range(None,None) -> Format.pp_print_string fmt "[..]" | Range(a,b) -> Format.fprintf fmt "@[<hov 2>[%a@,..%a]@]" pp_bound a pp_bound b | Descr _ -> Format.fprintf fmt "{ <comprehension> }" let pretty fmt = function | [] -> Format.pp_print_string fmt "{}" | [v] -> pp_vset fmt v | v::vs -> Format.fprintf fmt "@[<hov 2>(%a" pp_vset v ; List.iter (fun v -> Format.fprintf fmt "@ + %a" pp_vset v) vs ; Format.fprintf fmt ")@]" (* -------------------------------------------------------------------------- *) (* --- Set Operations --- *) (* -------------------------------------------------------------------------- *) let library = "vset" let adt_set = Lang.datatype ~library "set" let tau_of_set te = Logic.Data( adt_set , [te] ) let p_member = Lang.extern_p ~library ~bool:"member_bool" ~prop:"member" () let f_empty = Lang.extern_f ~library "empty" let f_union = Lang.extern_f ~library "union" let f_inter = Lang.extern_f ~library "inter" let f_range = Lang.extern_f ~library "range" let f_range_sup = Lang.extern_f ~library "range_sup" let f_range_inf = Lang.extern_f ~library "range_inf" let f_range_all = Lang.extern_f ~library "range_all" let f_singleton = Lang.extern_f ~library "singleton" let single a b = match a,b with | Some x , Some y when F.QED.equal x y -> a | _ -> None let test_range x y a b = let p_inf = match a with Some a -> p_leq a x | None -> p_true in let p_sup = match b with Some b -> p_leq y b | None -> p_true in p_and p_inf p_sup let sub_range x y a b = match single a b with | Some z -> p_and (p_equal x z) (p_equal y z) | None -> p_imply (p_leq x y) (test_range x y a b) let in_size x n = p_and (p_leq e_zero x) (p_lt x (e_int n)) let in_range x a b = match single a b with | Some y -> p_equal x y | None -> test_range x x a b let ordered ~limit ~strict a b = match a , b with | Some x , Some y -> if strict then p_lt x y else p_leq x y | _ -> if limit then p_true else p_false let member x xs = p_any (function | Set(_,s) -> p_call p_member [x;s] | Singleton e -> p_equal x e | Range(a,b) -> in_range x a b | Descr(xs,t,p) -> p_exists xs (p_and (p_equal x t) p) ) xs let empty = [] let singleton x = [Singleton x] let range a b = [Range(a,b)] let union xs ys = (xs @ ys) let descr = function | Set(t,s) -> let x = Lang.freshvar t in let e = e_var x in [x] , e , p_call p_member [e;s] | Singleton e -> ( [] , e , p_true ) | Range(a,b) -> let x = Lang.freshvar ~basename:"k" Logic.Int in let e = e_var x in [x] , e , in_range e a b | Descr(xs,t,p) -> xs, t, p (* -------------------------------------------------------------------------- *) (* --- Concretize --- *) (* -------------------------------------------------------------------------- *) let concretize_vset = function | Set(_,s) -> s | Singleton e -> e_fun f_singleton [e] | Range(None,None) -> e_fun f_range_all [] | Range(None,Some b) -> e_fun f_range_inf [b] | Range(Some a,None) -> e_fun f_range_sup [a] | Range(Some a,Some b) -> e_fun f_range [a;b] | Descr _ -> Warning.error "Concretization for comprehension sets not implemented yet" let concretize = function | [] -> e_fun f_empty [] | x::xs -> List.fold_left (fun w x -> e_fun f_union [w;concretize_vset x]) (concretize_vset x) xs let inter xs ys = e_fun f_inter [xs;ys] (* -------------------------------------------------------------------------- *) (* --- Emptyness --- *) (* -------------------------------------------------------------------------- *) let p_empty s = p_equal s (e_fun f_empty []) let is_empty xs = p_all (function | Set(_,s) -> p_empty s | Singleton _ -> p_false | Range(Some a,Some b) -> p_lt b a | Range _ -> p_false | Descr(xs,t,p) -> p_forall xs (p_imply p (p_empty t)) ) xs (* -------------------------------------------------------------------------- *) (* --- Inclusion --- *) (* -------------------------------------------------------------------------- *) let subrange a b = function | [Range(c,d)] -> p_imply (match a,b with | Some a , Some b -> p_leq a b | _ -> p_true) (p_and (match c,a with | None,_ -> p_true | Some _,None -> p_false | Some c,Some a -> p_leq c a) (match b,d with | _,None -> p_true | None,Some _ -> p_false | Some b,Some d -> p_leq b d)) | ys -> let x = Lang.freshvar ~basename:"k" Logic.Int in let k = e_var x in p_forall [x] (p_imply (in_range k a b) (member k ys)) let subset xs ys = p_all (function | Set(t,s) -> let x = Lang.freshvar t in let e = e_var x in p_forall [x] (p_imply (p_call p_member [e;s]) (member e ys)) | Singleton e -> member e ys | Descr(xs,t,p) -> p_forall xs (p_imply p (member t ys)) | Range(a,b) -> subrange a b ys ) xs (* -------------------------------------------------------------------------- *) (* --- Equality --- *) (* -------------------------------------------------------------------------- *) let equal xs ys = p_and (subset xs ys) (subset ys xs) (* -------------------------------------------------------------------------- *) (* --- Separation --- *) (* -------------------------------------------------------------------------- *) let empty_range a b = match a,b with | None,_ | _,None -> p_false | Some x , Some y -> p_lt y x let disjoint_bounds left right = match left , right with | None,_ | _,None -> p_false | Some x , Some y -> p_lt x y let disjoint_vset x y = match x , y with | Singleton x , Singleton y -> p_neq x y | Singleton e , Range(a,b) | Range(a,b) , Singleton e -> p_not (in_range e a b) | Range(a,b) , Range(c,d) -> p_disj [ empty_range a b ; empty_range c d ; disjoint_bounds b c ; disjoint_bounds d a ; ] | Singleton x , Descr(xs,t,p) | Descr(xs,t,p) , Singleton x -> p_forall xs (p_imply p (p_neq x t)) | Range(a,b) , Descr(xs,t,p) | Descr(xs,t,p) , Range(a,b) -> p_forall xs (p_imply p (p_not (in_range t a b))) | Descr(xs,ta,pa) , Descr(ys,tb,pb) -> p_forall xs (p_forall ys (p_hyps [pa;pb] (p_neq ta tb))) | Singleton e , Set(_,s) | Set(_,s) , Singleton e -> p_not (p_call p_member [e;s]) | Set _ , Set _ -> let xs,a,p = descr x in let ys,b,q = descr y in p_forall (xs @ ys) (p_hyps [p;q] (p_neq a b)) | Set(_,s) , w | w , Set(_,s) -> let xs,t,p = descr w in let t_in_s = p_call p_member [t;s] in p_forall xs (p_not (p_and p t_in_s)) let disjoint xs ys = let ws = List.fold_left (fun w x -> List.fold_left (fun w y -> disjoint_vset x y :: w) w ys ) [] xs in p_conj ws (* -------------------------------------------------------------------------- *) (* --- Lifting & Mapping --- *) (* -------------------------------------------------------------------------- *) let cartesian f xs ys = let zs = List.fold_left (fun w x -> List.fold_left (fun w y -> f x y :: w) w ys ) [] xs in List.rev zs let map_vset f x = let xs,t,p = descr x in Descr(xs,f t,p) let map f xs = List.map (function Singleton x -> Singleton (f x) | u -> map_vset f u) xs let map_opt f = function None -> None | Some x -> Some (f x) let map_opp xs = List.map (function | Singleton x -> Singleton (e_opp x) | Range(a,b) -> Range(map_opt e_opp b,map_opt e_opp a) | Descr(xs,t,p) -> Descr(xs,e_opp t,p) | (Set _) as w -> let xs,t,p = descr w in Descr(xs,e_opp t,p) ) xs let lift_vset f x y = let xs,ta,pa = descr x in let ys,tb,pb = descr y in Descr (xs @ ys , f ta tb , p_and pa pb) let lift f xs ys = cartesian (fun x y -> match x , y with | Singleton a , Singleton b -> Singleton (f a b) | _ -> lift_vset f x y ) xs ys let bound_shift a k = match a with | None -> None | Some x -> Some (e_add x k) let bound_add a b = match a,b with | None,_ | _,None -> None | Some x , Some y -> Some (e_add x y) let bound_sub a b = match a,b with | None,_ | _,None -> None | Some x , Some y -> Some (e_sub x y) let lift_add xs ys = cartesian (fun x y -> match x , y with | Singleton a , Singleton b -> Singleton(e_add a b) | Singleton u , Range(a,b) | Range(a,b) , Singleton u -> Range(map_opt (e_add u) a, map_opt (e_add u) b) | Range(a,b) , Range(c,d) -> Range(bound_add a c,bound_add b d) | _ -> lift_vset e_add x y ) xs ys let lift_sub xs ys = cartesian (fun x y -> match x , y with | Singleton a , Singleton b -> Singleton(e_sub a b) | Singleton u , Range(a,b) -> Range(bound_sub (Some u) b , bound_sub (Some u) a) | Range(a,b) , Singleton u -> Range(bound_sub a (Some u) , bound_sub b (Some u)) | Range(a,b) , Range(c,d) -> Range(bound_sub a d , bound_sub b c) | _ -> lift_vset e_sub x y ) xs ys (* -------------------------------------------------------------------------- *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Vset.mli��������������������������������������������������������0000666�0000000�0000000�00000006432�13571573400�015542� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang.F (** Logical Sets *) type set = vset list and vset = | Set of tau * term | Singleton of term | Range of term option * term option | Descr of var list * term * pred val tau_of_set : tau -> tau val vars : set -> Vars.t val occurs : var -> set -> bool val empty : set val singleton : term -> set val range : term option -> term option -> set val union : set -> set -> set val inter : term -> term -> term val member : term -> set -> pred val in_size : term -> int -> pred val in_range : term -> term option -> term option -> pred val sub_range : term -> term -> term option -> term option -> pred val ordered : limit:bool -> strict:bool -> term option -> term option -> pred (** - [limit]: result when either parameter is [None] - [strict]: if [true], comparison is [<] instead of [<=] *) val is_empty : set -> pred val equal : set -> set -> pred val subset : set -> set -> pred val disjoint : set -> set -> pred val concretize : set -> term val bound_shift : term option -> term -> term option val bound_add : term option -> term option -> term option val bound_sub : term option -> term option -> term option (** {3 Pretty} *) val pp_bound : Format.formatter -> term option -> unit val pp_vset : Format.formatter -> vset -> unit val pretty : Format.formatter -> set -> unit (** {3 Mapping} These operations compute different kinds of [{f x y with x in A, y in B}]. *) val map : (term -> term) -> set -> set val map_opp : set -> set (** {3 Lifting} These operations computes different sort of [{f x y with x in A, y in B}]. *) val lift : (term -> term -> term) -> set -> set -> set val lift_add : set -> set -> set val lift_sub : set -> set -> set val descr : vset -> var list * term * pred ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Warning.ml������������������������������������������������������0000666�0000000�0000000�00000013541�13571573400�016054� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Warning Manager --- *) (* -------------------------------------------------------------------------- *) module SELF = struct type t = { loc : Filepath.position ; severe : bool ; source : string ; reason : string ; effect : string ; } let compare w1 w2 = if w1 == w2 then 0 else let f1 = w1.loc.Filepath.pos_path in let f2 = w2.loc.Filepath.pos_path in let fc = Datatype.Filepath.compare f1 f2 in if fc <> 0 then fc else let l1 = w1.loc.Filepath.pos_lnum in let l2 = w2.loc.Filepath.pos_lnum in let lc = l1 - l2 in if lc <> 0 then lc else match w1.severe , w2.severe with | true , false -> (-1) | false , true -> 1 | _ -> Transitioning.Stdlib.compare w1 w2 end include SELF module Map = FCMap.Make(SELF) module Set = FCSet.Make(SELF) let severe s = Set.exists (fun w -> w.severe) s let pretty fmt w = begin Format.fprintf fmt "@[<v 0>%a: warning from %s:@\n" Cil_datatype.Position.pretty w.loc w.source ; if w.severe then Format.fprintf fmt " - Warning: %s, looking for context inconsistency" w.effect else Format.fprintf fmt " - Warning: %s" w.effect ; Format.fprintf fmt "@\n Reason: %s@]" w.reason ; end type collector = { default : string ; mutable warnings : Set.t ; } let collector : collector Context.value = Context.create "Warning" let default () = (Context.get collector).default (* -------------------------------------------------------------------------- *) (* --- Contextual Errors --- *) (* -------------------------------------------------------------------------- *) exception Error of string * string (* source , reason *) let error ?(source="wp") text = let buffer = Buffer.create 120 in Format.kfprintf (fun fmt -> Format.pp_print_flush fmt () ; let text = Buffer.contents buffer in if Context.defined collector then raise (Error (source,text)) else Wp_parameters.abort ~current:true "%s" text ) (Format.formatter_of_buffer buffer) text (* -------------------------------------------------------------------------- *) (* --- Contextual Errors --- *) (* -------------------------------------------------------------------------- *) type context = collector option let context ?(source="wp") () = Context.push collector { default = source ; warnings = Set.empty } let flush old = let c = Context.get collector in Context.pop collector old ; c.warnings let add w = let c = Context.get collector in c.warnings <- Set.add w c.warnings let kprintf phi ?(log=true) ?(severe=false) ?source ~effect message = let source = match source with Some s -> s | None -> default () in let buffer = Buffer.create 80 in Format.kfprintf (fun fmt -> Format.pp_print_flush fmt () ; let text = Buffer.contents buffer in let loc = Cil_const.CurrentLoc.get () in if log then Wp_parameters.warning ~source:(fst loc) "%s" text ~once:true ; phi { loc = fst loc ; severe = severe ; source = source ; effect = effect ; reason = text ; }) (Format.formatter_of_buffer buffer) message let create ?log ?severe ?source ~effect msg = kprintf (fun w -> w) ?log ?severe ?source ~effect msg let emit ?severe ?source ~effect msg = kprintf add ~log:true ?severe ?source ~effect msg let handle ?(severe=false) ~effect ~handler cc x = try cc x with Error(source,reason) -> if Context.defined collector then ( emit ~severe ~source ~effect "%s" reason ; handler x ) else if source <> "wp" then Wp_parameters.fatal ~current:true "[%s] %s" source reason else Wp_parameters.fatal ~current:true "%s" reason type 'a outcome = | Result of Set.t * 'a | Failed of Set.t let catch ?source ?(severe=true) ~effect cc x = let wrn = context ?source () in try let y = cc x in Result(flush wrn,y) (* DO NOT inline this let *) with Error(source,reason) -> emit ~severe ~source ~effect "%s" reason ; Failed (flush wrn) ���������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Warning.mli�����������������������������������������������������0000666�0000000�0000000�00000006110�13571573400�016217� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Contextual Errors *) exception Error of string * string (** Source, Reason *) val error : ?source:string -> ('a,Format.formatter,unit,'b) format4 -> 'a (** Warning Manager *) type t = { loc : Filepath.position ; severe : bool ; source : string ; reason : string ; effect : string ; } val compare : t -> t -> int val pretty : Format.formatter -> t -> unit module Set : FCSet.S with type elt = t module Map : FCMap.S with type key = t val severe : Set.t -> bool type context val context : ?source:string -> unit -> context val flush : context -> Set.t val add : t -> unit val create : ?log:bool -> ?severe:bool -> ?source:string -> effect:string -> ('a,Format.formatter,unit,t) format4 -> 'a val emit : ?severe:bool -> ?source:string -> effect:string -> ('a,Format.formatter,unit) format -> 'a (** Emit a warning in current context. Defaults: [severe=true], [source="wp"]. *) val handle : ?severe:bool -> effect:string -> handler:('a -> 'b) -> ('a -> 'b) -> 'a -> 'b (** Handle the error and emit a warning with specified severity and effect if a context has been set. Otherwise, a WP-fatal error is raised instead. Default for [severe] is false. *) type 'a outcome = | Result of Set.t * 'a | Failed of Set.t val catch : ?source:string -> ?severe:bool -> effect:string -> ('a -> 'b) -> 'a -> 'b outcome (** Set up a context for the job. If non-handled errors are raised, then a warning is emitted with specified severity and effect. Default for [severe] is [true]. *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Why3Provers.ml��������������������������������������������������0000666�0000000�0000000�00000011524�13571573400�016661� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Why3 Config & Provers --- *) (* -------------------------------------------------------------------------- *) let cfg = lazy begin try Why3.Whyconf.read_config None with exn -> Wp_parameters.abort "%a" Why3.Exn_printer.exn_printer exn end let version = Why3.Config.version let config () = Lazy.force cfg let set_procs = Why3.Controller_itp.set_session_max_tasks let configure = let todo = ref true in begin fun () -> if !todo then begin let args = Array.of_list ("why3"::Wp_parameters.Why3Flags.get ()) in begin try Arg.parse_argv ~current:(ref 0) args (Why3.Debug.Args.[desc_debug;desc_debug_all;desc_debug_list]) (fun _ -> raise (Arg.Help "Unknown why3 option")) "Why3 options" with Arg.Bad s -> Wp_parameters.abort "%s" s end; ignore (Why3.Debug.Args.option_list ()); Why3.Debug.Args.set_flags_selected (); todo := false end end type t = Why3.Whyconf.prover let find_opt s = try let config = Lazy.force cfg in let filter = Why3.Whyconf.parse_filter_prover s in let filter = Why3.Whyconf.filter_prover_with_shortcut config filter in Some ((Why3.Whyconf.filter_one_prover config filter).Why3.Whyconf.prover) with | Why3.Whyconf.ProverNotFound _ | Why3.Whyconf.ParseFilterProver _ | Why3.Whyconf.ProverAmbiguity _ -> None let find ?donotfail s = try try let config = Lazy.force cfg in let filter = Why3.Whyconf.parse_filter_prover s in let filter = Why3.Whyconf.filter_prover_with_shortcut config filter in (Why3.Whyconf.filter_one_prover config filter).Why3.Whyconf.prover with | Why3.Whyconf.ProverNotFound _ as exn when donotfail <> None -> Wp_parameters.warning ~once:true "%a" Why3.Exn_printer.exn_printer exn; (** from Why3.Whyconf.parse_filter_prover *) let sl = Why3.Strings.rev_split ',' s in (* reverse order *) let prover_name, prover_version, prover_altern = match sl with | [name] -> name,"","" | [version;name] -> name,version,"" | [altern;version;name] -> name,version,altern | _ -> raise (Why3.Whyconf.ParseFilterProver s) in { Why3.Whyconf.prover_name; Why3.Whyconf.prover_version; Why3.Whyconf.prover_altern } with | ( Why3.Whyconf.ProverNotFound _ | Why3.Whyconf.ParseFilterProver _ | Why3.Whyconf.ProverAmbiguity _ ) as exn -> Wp_parameters.abort "%a" Why3.Exn_printer.exn_printer exn let print = Why3.Whyconf.prover_parseable_format let title p = Pretty_utils.sfprintf "%a" Why3.Whyconf.print_prover p let compare = Why3.Whyconf.Prover.compare let provers () = Why3.Whyconf.Mprover.keys (Why3.Whyconf.get_provers (config ())) let provers_set () : Why3.Whyconf.Sprover.t = Why3.Whyconf.Mprover.domain (Why3.Whyconf.get_provers (config ())) let is_available p = Why3.Whyconf.Mprover.mem p (Why3.Whyconf.get_provers (config ())) let has_shortcut p s = match Why3.Wstdlib.Mstr.find_opt s (Why3.Whyconf.get_prover_shortcuts (config ())) with | None -> false | Some p' -> Why3.Whyconf.Prover.equal p p' ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/Why3Provers.mli�������������������������������������������������0000666�0000000�0000000�00000004142�13571573400�017030� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val version : string val config : unit -> Why3.Whyconf.config val configure : unit -> unit val set_procs : int -> unit type t = Why3.Whyconf.prover val find_opt : string -> t option val find : ?donotfail:unit -> string -> t val print : t -> string val title : t -> string val compare : t -> t -> int val provers : unit -> t list val provers_set : unit -> Why3.Whyconf.Sprover.t val is_available : t -> bool val has_shortcut : t -> string -> bool (**************************************************************************) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/WpTac.ml��������������������������������������������������������0000666�0000000�0000000�00000035574�13571573400�015477� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang open Lang.F open Qed.Logic (** Debug **) let dkey = Wp_parameters.register_category "cnf" let debug fmt = Wp_parameters.debug ~dkey fmt let debugN level fmt = Wp_parameters.debug ~level ~dkey fmt (** Can be moved into Qed **) let s_bool p = [p; e_not p] (* is it an atom for CNF/DNF *) let is_cnf_dnf_atom_repr = function | If(_,x,y) | Eq(x,y) | Neq(x,y) -> not (is_prop x && is_prop y) | And _ | Or _ | Imply _ | Not _ -> false | _ -> true let is_cnf_dnf_literal_repr = function | Not _ -> true | _ as repr -> is_cnf_dnf_atom_repr repr let is_cnf_dnf_literal e = is_cnf_dnf_literal_repr (repr e) let is_conj0_literal_repr = function | And xs -> List.for_all is_cnf_dnf_literal xs | _ as repr -> is_cnf_dnf_literal_repr repr let is_conj0_literal e = is_conj0_literal_repr (repr e) let is_disj0_literal_repr = function | Or xs -> List.for_all is_cnf_dnf_literal xs | _ as repr -> is_cnf_dnf_literal_repr repr let is_disj0_literal e = is_disj0_literal_repr (repr e) (* is it already into a Conjunctive Normal Form *) let is_cnf_repr = function | And xs -> List.for_all is_disj0_literal xs | _ as repr -> is_disj0_literal_repr repr let is_cnf e = is_cnf_repr (repr e) (* is it already into a Disjunctive Normal Form *) let is_dnf_repr = function | Or xs -> List.for_all is_conj0_literal xs | _ as repr -> is_conj0_literal_repr repr let is_dnf e = is_dnf_repr (repr e) (** CNF/DNF tools **) exception Absorbant exception TooBig type xf_t = term list type xnf_t = xf_t list type xNf_t = xf_t * xnf_t let is_true_repr = function | True -> true | _ -> false let is_false_repr = function | False -> true | _ -> false let is_conj_literal_repr = function | And xs -> List.for_all is_cnf_dnf_literal xs | _ -> false let is_disj_literal_repr = function | Or xs -> List.for_all is_cnf_dnf_literal xs | _ -> false let conj_args e = match repr e with | And xs -> xs | _ -> [e] let disj_args e = match repr e with | Or xs -> xs | _ -> [e] let normalize_cf ts = (* TODO: use something like Qed.Term.conjunction *) let c = e_and ts in match repr c with | False -> raise Absorbant | True -> [] | And cf -> cf | _ -> [ c ] let normalize_df ts = (* TODO: use something like Qed.Term.disjunction *) let c = e_or ts in match repr c with | True -> raise Absorbant | False -> [] | Or cf -> cf | _ -> [ c ] (*** one step of CNF/DNF ***) let s_cnf_ite c p q = [e_imply [c] p; e_imply [e_not c] q] let s_dnf_ite c p q = [e_and [c;p]; e_and [e_not c;e_not q]] let s_cnf_iff p q = [e_imply [p] q; e_imply [q] p] let s_dnf_iff p q = [e_and [p;q]; e_and [e_not p;e_not q]] let s_cnf_xor p q = [e_imply [e_not p] q; e_imply [e_not q] p] let s_dnf_xor p q = [e_and [e_not p; q]; e_and [e_not q; p]] type repr = QED.repr type cnf_dnt_tools = { normalize_xf: xf_t -> xf_t ; is_neutral_repr: repr -> bool ; is_absorbant_repr: repr -> bool ; neutral: term ; absorbant: term ; mk_top: xf_t -> term ; mk_sub: xf_t -> term ; sub_args: term -> xf_t ; is_sub_repr: repr -> bool ; s_ite: term -> term -> term -> term list ; s_iff: term -> term -> term list ; s_xor: term -> term -> term list ; } let cnf_record = { normalize_xf=normalize_cf; is_neutral_repr=is_true_repr; is_absorbant_repr=is_false_repr; neutral=e_true; absorbant=e_false; mk_top=e_and; mk_sub=e_or; sub_args=disj_args; is_sub_repr=is_disj_literal_repr; s_ite=s_cnf_ite; s_iff=s_cnf_iff; s_xor=s_cnf_xor; } let dnf_record = { normalize_xf=normalize_df; is_neutral_repr=is_false_repr; is_absorbant_repr=is_true_repr; neutral=e_false; absorbant=e_true; mk_top=e_or; mk_sub=e_and; sub_args=conj_args; is_sub_repr=is_conj_literal_repr; s_ite=s_dnf_ite; s_iff=s_dnf_iff; s_xor=s_dnf_xor; } let neutral:xNf_t = [],[] (*** Pretty ***) let pp_indent ~pol fmt = function | x when x <= 0 -> Format.fprintf fmt "xxx * " | x -> Format.fprintf fmt "xxx%s * " (String.make (2*(x-1)+(if pol then 0 else 1)) ' ') let pp_xf ~pol fmt = function | [] -> Format.fprintf fmt "%sf [%s neutral)]" (if pol then "c" else "d") (if pol then "TRUE" else "FALSE ") | xf -> Format.printf "%sf [" (if pol then "c" else "d"); List.iter (fun x -> Format.fprintf fmt "%s %a " (if pol then "&&" else "||") Lang.F.pp_term x) xf; Format.printf "]" let pp_xNf ~pol ~depth fmt xNf = let pp_xNf fmt = function | [] -> Format.fprintf fmt " (%sNF %s absorbant);@?" (if pol then "C" else "D") (if pol then "FALSE" else "TRUE ") | xf -> List.iter (fun x -> Format.fprintf fmt "%s %a @?" (if pol then "||" else "&&") Lang.F.pp_term x) xf; in match xNf with | [],[] -> Format.fprintf fmt "%sNF %s neutral=[]@?" (if pol then "C" else "D") (if pol then "TRUE " else "FALSE") | xf,xnf -> Format.fprintf fmt "%sNF [@?" (if pol then "C" else "D") ; if xf <> [] then List.iter (fun x -> Format.fprintf fmt "%s (%a) @?" (if pol then "&&" else "||") Lang.F.pp_term x) xf; List.iter (fun x -> Format.fprintf fmt "@.%a %s [%a]@?" (pp_indent ~pol) depth (if pol then "&&" else "||") pp_xNf x) xnf; Format.fprintf fmt "]@?" (** Transforms [e] into CNF/DNF **) let cnf_dnf ~pol ~depth e = let literal (cf,cnf,others) e = (e::cf),cnf,others in let normalized (cf,cnf,others) e = cf,(e::cnf),others in let unnormalized (cf,cnf,others) e = cf,cnf,(e::others) in let tools ~pol = if pol then cnf_record else dnf_record in let flat ~tool ~pol = let rec flatten acc = List.fold_left flat acc and flat acc e = match repr e with | Eq(x,y) when (F.is_prop x) && (F.is_prop y) -> flatten acc (tool.s_iff x y) | Neq(x,y) when (F.is_prop x) && (F.is_prop y) -> flatten acc (tool.s_xor x y) | If(c,p,q) -> flatten acc (tool.s_ite c p q) | Imply _ when pol -> unnormalized acc e | Imply (xe,x) -> flatten acc (x::(List.map (fun x -> e_not x) xe)) | Or xs when not pol -> flatten acc xs | And xs when pol -> flatten acc xs | repr when tool.is_absorbant_repr repr -> raise Absorbant | repr when tool.is_neutral_repr repr -> acc | repr when is_cnf_dnf_literal_repr repr -> literal acc e | repr when tool.is_sub_repr repr -> normalized acc e | And _ | Or _ -> unnormalized acc e | _ -> unnormalized acc e in flat ([],[],[]) in let c_cNf_cNf2cNf ~tool ~pol ~depth ((cf1,cnf1):xNf_t) ((cf2,cnf2):xNf_t) : xNf_t = (*[LC] TODO: check ignored variables *) ignore pol ; ignore depth ; match cnf2 with | ([]::_) -> raise Absorbant (* @absorbant @ _ = @absorbant *) | _ -> (* TODO: uses Qed.Term.consequence_style *) let cf,cnf = List.fold_left (fun (cf,cnf) -> function | [] -> raise Absorbant | [x] -> (x::cf),cnf | df -> cf,(df::cnf)) neutral cnf1 in let cf = if cf1=[] && cf=[] then cf2 else tool.normalize_xf cf@cf1@cf2 in cf, (cnf@cnf2) in (* distribution for CNF/DNF as literal list list *) let dNf2cNf ~tool ~pol ~depth (dNf:xNf_t) : xNf_t = let pp_i fmt () = (pp_indent ~pol) fmt depth in let df2cNf (df:xf_t) : xNf_t = match df with | [] -> raise Absorbant (* #neutral = @absorbant *) | [_] -> df,[] | _ -> [],[df] in let c_df_cNf2cNf (df:xf_t) (cNf:xNf_t) : xNf_t = c_cNf_cNf2cNf ~tool ~pol ~depth (df2cNf df) cNf in (* (d1#...#dm) # (c1@...@cn) = (c1#d1#...#dm) @ ... @ (cn#d1#...#dm) (d1#...#dm) # @neutral/#absorbant = @neutral = ([],[]) *) let d_df_cf2cNf (df:xf_t) (cf:xf_t) : xNf_t = match df with | [] -> cf,[] (* #neutral # (c1@...@cn) = (c1@...@cn) *) | df -> List.fold_left (fun (acc:xNf_t) (x:term) -> c_df_cNf2cNf (x::df) acc) neutral cf in (* (d1#...#dm) # (D1@...@Dn) = (D1#d1#...#dm) @ ... @ (Dn#d1#...#dm) (d1#...#dm) # @neutral/#absorbant = @neutral = ([],[]) *) (*[LC] TODO: check function never called *) let _d_df_cnf2cNf (df:xf_t) (cnf:xnf_t) : xNf_t = match df with | [] -> ([],cnf) (* #neutral # (D1@...@Dn) = (D1@...@Dn) *) | df -> List.fold_left (fun (acc:xNf_t) (df':xf_t) -> c_df_cNf2cNf (df'@df) acc) neutral cnf in (* (c1@...@cn) # (c1'@...@ck'@D1@...@Dm) = ((c1@...@cn)#c1') @ ... @ ((c1@...@cn)#c1k') @ ((c1@...@cn)#D1) @ ...@ ((c1@...@cn)#Dm) (c1@...@cn) # @neutral/#absorbant = @neutral *) let d_cf_cNf2cNf (cf:xf_t) (cNf':xNf_t) : xNf_t = let r = match cf,cNf' with | _,([],[]) -> debugN 4 "%a> d_cf_cNf2cNf cas1/4@." pp_i (); cNf' (* (c1@...@cn) # @neutral/#absorbant= @neutral *) | [],_ -> debugN 4 "%a> d_cf_cNf2cNf cas2/4@." pp_i (); neutral (* @neutral/#absorbant # (c1'@...@ck'@D1@...@Dm) = @neutral *) | _, (_,[]::_) -> debugN 4 "%a> d_cf_cNf2cNf cas3/4@." pp_i (); cf,[] (* (c1@...@cn) # #neutral/@absorbant= (c1@...@cn) *) | _,(cf',cnf') -> debugN 4 "%a> d_cf_cNf2cNf cas4/4 cf(%d) cNf(%d,%d)@." pp_i () (List.length cf) (List.length cf') (List.length cnf'); if 2048 < (List.length cf)*((List.length cf')+(List.length cnf')) then raise TooBig ; let cNf1 = List.fold_left (fun (acc:xNf_t) (x:term) -> c_cNf_cNf2cNf ~tool ~pol ~depth (d_df_cf2cNf [x] cf) acc) neutral cf' in List.fold_left (fun (acc:xNf_t) (df:xf_t) -> c_cNf_cNf2cNf ~tool ~pol ~depth (d_df_cf2cNf df cf) acc) cNf1 cnf' in debugN 4 "%a> d_cf_cNf2cNf %sNf(%d,%b) %a %a =@.%a> d_cf_cNf2cNf = %a@." pp_i () (if pol then "C" else "D") depth pol (pp_xf ~pol) cf (pp_xNf ~pol ~depth) cNf' pp_i () (pp_xNf ~pol ~depth) r; r in (* (c1@...@ck@D1@...@Dn) # (C1#...#Cm) = (C1#(c1@...@ck@D1@...@Dn)) # (C2#...#Cm) *) let rec d_cNf_dnf2cNf (cNf:xNf_t) (dnf:xnf_t) : xNf_t = debugN 3 "%a> d_cNf_dnff2cNf cNf(%d,%d) dnf(%d)=...@." pp_i () (List.length (fst cNf)) (List.length (snd cNf)) (List.length dnf); match dnf with | [] -> cNf (* (c1@...@ck@D1@...@Dn) # @absorbant/#neutral = (D1@...@Dn) *) | []::_ -> neutral (* (c1@...@ck@D1@...@Dn) # @neutral/#absorbant = @neutral *) | cf::[]-> d_cf_cNf2cNf cf cNf (* (c1@...@ck@D1@...@Dn) # (c11@...@c1k) = (c11@...@c1k) # (c1@...@ck@D1@...@Dn) *) | cf::dnf -> (* (c1@...@ck@D1@...@Dn) # ((c11@...@c1k)#C2#...#Cm) = ((c11@...@c1k)#(c1@...@ck@D1@...#@n)) @ (C2#...#Cm) *) d_cNf_dnf2cNf (d_cf_cNf2cNf cf cNf) dnf in debugN 3 "%a> %sNf->%sNf(%d,%b) %a=...@." pp_i () (if pol then "D" else "C") (if pol then "C" else "D") depth pol (pp_xNf ~pol:(not pol) ~depth) dNf; (* (d1#...#dk)#(C1#...#Cm) = (d1#...#dk) # (C1#...#Cm) *) let r = match dNf with | [],[] -> raise Absorbant (* #neutral = @absorbant *) | ([_] as df),dnf -> d_cNf_dnf2cNf (df,[]) dnf | df,dnf -> d_cNf_dnf2cNf ([],[df]) dnf in debugN 3 "%a> %sNf->%sNf(%d,%b) %a =@.%a> %a@." pp_i () (if pol then "D" else "C") (if pol then "C" else "D") depth pol (pp_xNf ~pol:(not pol) ~depth) dNf pp_i () (pp_xNf ~pol ~depth) r; r in let rec cnf_dnf ~depth ~pol e = debugN 2 "@.%a%sNf(%d,%b) %a@." (pp_indent ~pol) depth (if pol then "C" else "D") depth pol pp_term e; if depth <> -1 && depth <= 0 then [e],[] else let tool = tools ~pol in try let c_cf_cnf2cNf (cf:xf_t) (cnf:xf_t) : xNf_t = (* TODO: uses Qed.Term.consequence_style *) (tool.normalize_xf cf), (List.map tool.sub_args cnf) in let cf,cnf,cxf = flat ~tool ~pol e in (* [cf@cnf] part is into normal form, but the [cxf] part isn't. May raise Absorbant. *) let (cf,cnf) as cNf = c_cf_cnf2cNf cf cnf in let depth = if depth <> -1 && (not pol) then depth-1 else depth in try let c_cNf_cdf2cNf cNf xf = let dNf = cnf_dnf ~depth ~pol:(not pol) xf in c_cNf_cNf2cNf ~tool ~pol ~depth cNf (dNf2cNf ~tool ~pol ~depth dNf) in List.fold_left c_cNf_cdf2cNf cNf cxf with | TooBig -> debug "Too big CNF/DNF@." ; (cf@cxf),cnf with | Absorbant -> [],[[]] in let tool = tools pol in let cNf = cnf_dnf ~depth ~pol e in try match cNf with | [],[] -> tool.neutral | cf,cnf -> let mk_sub = function | [] -> raise Absorbant | df -> let r = tool.mk_sub df in if tool.is_absorbant_repr (F.repr r) then raise Absorbant else r in tool.mk_top (cf@(List.map mk_sub cnf)) with Absorbant -> tool.absorbant let cnf_dnf ~pol ?(depth=(-1)) = cnf_dnf ~pol ~depth let e_cnf = cnf_dnf ~pol:true let e_dnf = cnf_dnf ~pol:false (** Register new available transformation at Conditions.closure **) (* feature at Conditions.closure and also for debugging purposes *) let () = Conditions.at_closure (fun ((step,goal) as sequent) -> match Wp_parameters.SplitDepth.get () with | 0 -> sequent | depth when depth < -1 -> (* Unspecified debug mode checking the correctness of CNF algo: `H |- P` is replaced by `H |- P <-> CNF(P)` *) let cnf = e_cnf ~depth:(-(depth+3)) (e_prop goal) in debug " CNF=%a@." pp_term cnf; step, p_equiv goal (F.p_bool cnf) | depth -> (* `H |- P` is replaced by `H |- CNF(P)` *) let cnf = e_cnf ~depth (e_prop goal) in debug " CNF=%a@." pp_term cnf; step, p_bool cnf ) ������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/WpTac.mli�������������������������������������������������������0000666�0000000�0000000�00000004366�13571573400�015643� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Lang.F (** Term manipulation for Tacticals *) val s_bool:term -> term list val s_cnf_ite: term -> term -> term -> term list val s_dnf_ite: term -> term -> term -> term list val s_cnf_iff: term -> term -> term list val s_dnf_iff: term -> term -> term list val s_cnf_xor: term -> term -> term list val s_dnf_xor: term -> term -> term list (* Is the term into a Conjunctive Normal Form *) val is_cnf: term -> bool (* returns the Conjunctive Normal Form of a term *) val e_cnf: ?depth:int -> term -> term (*Is the term into a Conjunctive Normal Form *) val is_dnf: term -> bool (* returns the Disjunctive Normal Form of a term *) val e_dnf: ?depth:int -> term -> term ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/calculus.ml�����������������������������������������������������0000666�0000000�0000000�00000067600�13571573400�016267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Wp computation using the CFG *) open Cil_types open Cil_datatype module Cfg (W : Mcfg.S) = struct let dkey = Wp_parameters.register_category "calculus" (* Debugging key *) let debug fmt = Wp_parameters.debug ~dkey fmt (** Before storing something at a program point, we have to process the label * at that point. *) let do_labels wenv e obj = let do_lab s o l = W.label wenv s l o in let obj = do_lab None obj Clabels.here in let stmt = Cil2cfg.get_edge_stmt e in let labels = Cil2cfg.get_edge_labels e in List.fold_left (do_lab stmt) obj labels let add_hyp wenv obj h = debug "add hyp %a@." WpPropId.pp_pred_info h; W.add_hyp wenv h obj let add_goal wenv obj g = debug "add goal %a@." WpPropId.pp_pred_info g; W.add_goal wenv g obj (*[LC] Adding scopes for loop invariant preservation: WHY ???? *) (*[LC] Nevertheless, if required, this form should be used (BTS #1462) let open_scope wenv formals blocks = List.fold_right (fun b obj -> W.scope wenv b.blocals Mcfg.SC_Block_out obj) blocks (W.scope wenv formals Mcfg.SC_Function_out W.empty) match WpPropId.is_loop_preservation (fst g) with | None -> W.add_goal wenv g obj | Some stmt -> debug "add scope for loop preservation %a@." WpPropId.pp_pred_info g ; let blocks = Kernel_function.find_all_enclosing_blocks stmt in let kf = Kernel_function.find_englobing_kf stmt in let formals = Kernel_function.get_formals kf in W.merge wenv (W.add_goal wenv g (open_scope wenv formals blocks)) obj *) let add_assigns_goal wenv obj g_assigns = match g_assigns with | WpPropId.AssignsAny _ | WpPropId.NoAssignsInfo -> obj | WpPropId.AssignsLocations a -> debug "add assign goal (@[%a@])@." WpPropId.pretty (WpPropId.assigns_info_id a); W.add_assigns wenv a obj let add_assigns_hyp wenv obj h_assigns = match h_assigns with | WpPropId.AssignsLocations (h_id, a) -> let hid = Some h_id in let obj = W.use_assigns wenv a.WpPropId.a_stmt hid a obj in Some a.WpPropId.a_label, obj | WpPropId.AssignsAny a -> Wp_parameters.warning ~current:true ~once:true "Missing assigns clause (assigns 'everything' instead)" ; let obj = W.use_assigns wenv a.WpPropId.a_stmt None a obj in Some a.WpPropId.a_label, obj | WpPropId.NoAssignsInfo -> None, obj (** detect if the computation of the result at [edge] is possible, * or if it will loop. If [strategy] are provide, * cut are done on edges with cut properties, * and if not, cut are done on loop node back edge if any. * TODO: maybe this should be done while building the strategy ? * *) exception Stop of Cil2cfg.edge let test_edge_loop_ok cfg strategy edge = debug "[test_edge_loop_ok] (%s strategy) for %a" (match strategy with None -> "without" | Some _ -> "with") Cil2cfg.pp_edge edge; let rec collect_edge_preds set e = let cut = match strategy with None -> Cil2cfg.is_back_edge e | Some strategy -> let e_annots = WpStrategy.get_annots strategy e in (WpStrategy.get_cut e_annots <> []) in if cut then () (* normal loop cut *) else if Cil2cfg.Eset.mem e set then (* e is already in set : loop without cut ! *) raise (Stop e) else (* add e to set and continue with its preds *) let set = Cil2cfg.Eset.add e set in let preds = Cil2cfg.pred_e cfg (Cil2cfg.edge_src e) in List.iter (collect_edge_preds set) preds in try let _ = collect_edge_preds Cil2cfg.Eset.empty edge in debug "[test_edge_loop_ok] ok."; true with Stop e -> begin debug "[test_edge_loop_ok] loop without cut detected at %a" Cil2cfg.pp_edge e; false end (** to store the results of computations : * we store a result for each edge, and also a list of proof obligations. * * Be careful that there are two modes of computation : * the first one ([Pass1]) is used to prove the establishment of properties * while the second (after [change_mode_if_needed]) prove the preservation. * See {!R.set} for more details. * *) module R : sig type t val empty : Cil2cfg.t -> t val is_pass1 : t -> bool val change_mode_if_needed : t -> unit val find : t -> Cil2cfg.edge -> W.t_prop val set : WpStrategy.strategy -> W.t_env -> t -> Cil2cfg.edge -> W.t_prop -> W.t_prop val add_oblig : t -> Clabels.c_label -> W.t_prop -> unit val add_memo : t -> Cil2cfg.edge -> W.t_prop -> unit end = struct type t_mode = Pass1 | Pass2 module HE = Cil2cfg.HE (struct type t = W.t_prop option end) module LabObligs : sig type t val empty : t val is_empty : t -> bool val get_of_label : t -> Clabels.c_label -> W.t_prop list val get_of_edge : t -> Cil2cfg.edge -> W.t_prop list val add_to_label : t -> Clabels.c_label -> W.t_prop -> t val add_to_edge : t -> Cil2cfg.edge -> W.t_prop -> t end = struct type key = Olab of Clabels.c_label | Oedge of Cil2cfg.edge let cmp_key k1 k2 = match k1, k2 with | Olab l1, Olab l2 when Clabels.equal l1 l2 -> true | Oedge e1, Oedge e2 when Cil2cfg.same_edge e1 e2 -> true | _ -> false (* TODOopt: could have a sorted list... *) type t = (key * W.t_prop list) list let empty = [] let is_empty obligs = (obligs = []) let add obligs k obj = let rec aux l_obligs = match l_obligs with | [] -> (k, [obj])::[] | (k', obligs)::tl when cmp_key k k' -> (k, obj::obligs)::tl | o::tl -> o::(aux tl) in aux obligs let add_to_label obligs label obj = add obligs (Olab label) obj let add_to_edge obligs e obj = add obligs (Oedge e) obj let get obligs k = let rec aux l_obligs = match l_obligs with | [] -> [] | (k', obligs)::_ when cmp_key k k' -> obligs | _::tl -> aux tl in aux obligs let get_of_label obligs label = get obligs (Olab label) let get_of_edge obligs e = get obligs (Oedge e) end type t = { mutable mode : t_mode ; cfg: Cil2cfg.t; tbl : HE.t ; mutable memo : LabObligs.t; mutable obligs : LabObligs.t; } let empty cfg = debug "start computing (pass 1)@."; { mode = Pass1; cfg = cfg; tbl = HE.create 97 ; obligs = LabObligs.empty ; memo = LabObligs.empty ;} let is_pass1 res = (res.mode = Pass1) let add_oblig res label obj = debug "add proof obligation at label %a =@. @[<hov2> %a@]@." Clabels.pretty label W.pretty obj; res.obligs <- LabObligs.add_to_label (res.obligs) label obj let add_memo res e obj = debug "Memo goal for Pass2 at %a=@. @[<hov2> %a@]@." Cil2cfg.pp_edge e W.pretty obj; res.memo <- LabObligs.add_to_edge (res.memo) e obj let find res e = let obj = HE.find res.tbl e in match obj with None -> Wp_parameters.warning "find edge annot twice (%a) ?" Cil2cfg.pp_edge e; raise Not_found | Some obj -> if (res.mode = Pass2) && (List.length (Cil2cfg.pred_e res.cfg (Cil2cfg.edge_src e)) < 2) then begin (* it should be used once only : can free it *) HE.replace res.tbl e None; debug "clear edge %a@." Cil2cfg.pp_edge e end; obj (** If needed, clear wp table to compute Pass2. * If nothing has been stored in res.memo, there is nothing to do. *) let change_mode_if_needed res = if LabObligs.is_empty res.memo then () else begin debug "change to Pass2 (clear wp table)@."; begin try let e_start = Cil2cfg.start_edge res.cfg in let start_goal = find res e_start in add_memo res e_start start_goal with Not_found -> () end; HE.clear res.tbl; (* move memo obligs of Pass1 to obligs for Pass2 *) res.obligs <- res.memo; res.memo <- LabObligs.empty; res.mode <- Pass2 end let collect_oblig wenv res e obj = let labels = Cil2cfg.get_edge_labels e in let add obj obligs = List.fold_left (fun obj o -> W.merge wenv o obj) obj obligs in let obj = try debug "get proof obligation at edge %a@." Cil2cfg.pp_edge e; let obligs = LabObligs.get_of_edge res.obligs e in add obj obligs with Not_found -> obj in let add_lab_oblig obj label = try debug "get proof obligation at label %a@." Clabels.pretty label; let obligs = LabObligs.get_of_label res.obligs label in add obj obligs with Not_found -> obj in let obj = List.fold_left add_lab_oblig obj labels in obj (** We have found some assigns hypothesis in the strategy : * it means that we skip the corresponding bloc, ie. we directly compute * the result before the block : (forall assigns. P), * and continue with empty. *) let use_assigns wenv res obj h_assigns = let lab, obj = add_assigns_hyp wenv obj h_assigns in match lab with | None -> obj | Some label -> add_oblig res label obj; W.empty (** store the result p for the computation of the edge e. * * - In Compute mode : if we have some hyps H about this edge, store H => p if we have some goal G about this edge, store G /\ p if we have annotation B to be used as both H and G, store B /\ B=>P We also have to add H and G from HI (invariants computed in Pass1 mode) So finally, we build : [ H => [ BG /\ (BH => (G /\ P)) ] ] *) let set strategy wenv res e obj = try match (HE.find res.tbl e) with | None -> raise Not_found | Some obj -> obj (* cannot warn here because it can happen with CUT properties. * We could check that obj is the same thing than the founded result *) (* Wp_parameters.fatal "strange loop at %a ?" Cil2cfg.pp_edge e *) with Not_found -> begin let e_annot = WpStrategy.get_annots strategy e in let h_prop = WpStrategy.get_hyp_only e_annot in let g_prop = WpStrategy.get_goal_only e_annot in let bh_prop, bg_prop = WpStrategy.get_both_hyp_goals e_annot in let h_assigns = WpStrategy.get_asgn_hyp e_annot in let g_assigns = WpStrategy.get_asgn_goal e_annot in (* get_cut is ignored : see get_wp_edge *) let obj = collect_oblig wenv res e obj in let is_loop_head = match Cil2cfg.node_type (Cil2cfg.edge_src e) with | Cil2cfg.Vloop (Some _, _) -> true | _ -> false in let compute ~goal obj = let local_add_goal obj g = if goal then add_goal wenv obj g else obj in let obj = List.fold_left (local_add_goal) obj g_prop in let obj = List.fold_left (add_hyp wenv) obj bh_prop in let obj = if goal then add_assigns_goal wenv obj g_assigns else obj in let obj = List.fold_left (local_add_goal) obj bg_prop in let obj = List.fold_left (add_hyp wenv) obj h_prop in obj in let obj = match res.mode with | Pass1 -> compute ~goal:true obj | Pass2 -> compute ~goal:false obj in let obj = do_labels wenv e obj in let obj = if is_loop_head then obj (* assigns used in [wp_loop] *) else use_assigns wenv res obj h_assigns in debug "[set_wp_edge] %a@." Cil2cfg.pp_edge e; debug " = @[<hov2> %a@]@." W.pretty obj; Format.print_flush (); HE.replace res.tbl e (Some obj); find res e (* this should give back obj, but also do more things *) end end (* module R *) let use_loop_assigns strategy wenv e obj = let e_annot = WpStrategy.get_annots strategy e in let h_assigns = WpStrategy.get_asgn_hyp e_annot in let label, obj = add_assigns_hyp wenv obj h_assigns in match label with Some _ -> obj | None -> assert false (* we should have assigns hyp for loops !*) (** Compute the result for edge [e] which goes to the loop node [nloop]. * So [e] can be either a back_edge or a loop entry edge. * Be very careful not to make an infinite loop by calling [get_loop_head]... * *) let wp_loop ((_, cfg, strategy, _, wenv)) nloop e get_loop_head = let loop_with_quantif () = if Cil2cfg.is_back_edge e then (* Be careful not to use get_only_succ here (infinite loop) *) (debug "[wp_loop] cut at back edge"; W.empty) else (* edge going into the loop from outside : quantify *) begin debug "[wp_loop] quantify"; let obj = get_loop_head nloop in let head = match Cil2cfg.succ_e cfg nloop with | [h] -> h | _ -> assert false (* already detected in [get_loop_head] *) in use_loop_assigns strategy wenv head obj end in (* if WpStrategy.new_loop_computation strategy && R.is_pass1 res && loop_with_cut cfg strategy nloop then loop_with_cut_pass1 () else (* old mode or no inv or pass2 *) *) match Cil2cfg.node_type nloop with | Cil2cfg.Vloop (Some true, _) -> (* natural loop (has back edges) *) loop_with_quantif () | _ -> (* TODO : print info about the loop *) Wp_error.unsupported "non-natural loop without invariant property." type callenv = { pre_annots : WpStrategy.t_annots ; post_annots : WpStrategy.t_annots ; exit_annots : WpStrategy.t_annots ; } let callenv cfg strategy v = let eb = match Cil2cfg.pred_e cfg v with e::_ -> e | _ -> assert false in let en, ee = Cil2cfg.get_call_out_edges cfg v in { pre_annots = WpStrategy.get_annots strategy eb ; post_annots = WpStrategy.get_annots strategy en ; exit_annots = WpStrategy.get_annots strategy ee ; } let wp_call_any wenv cenv ~p_post ~p_exit = let obj = W.merge wenv p_post p_exit in let call_asgn = WpStrategy.get_call_asgn cenv.post_annots None in let lab, obj = add_assigns_hyp wenv obj call_asgn in match lab with | Some _ -> obj | None -> assert false let wp_call_kf wenv cenv stmt lval kf args precond ~p_post ~p_exit = let call_asgn = WpStrategy.get_call_asgn cenv.post_annots (Some kf) in let assigns = match call_asgn with | WpPropId.AssignsLocations (_, asgn_body) -> asgn_body.WpPropId.a_assigns | WpPropId.AssignsAny _ -> WritesAny | WpPropId.NoAssignsInfo -> assert false (* see above *) in let pre_hyp, pre_goals = WpStrategy.get_call_pre cenv.pre_annots kf in let obj = W.call wenv stmt lval kf args ~pre:(pre_hyp) ~post:((WpStrategy.get_call_hyp cenv.post_annots kf)) ~pexit:((WpStrategy.get_call_hyp cenv.exit_annots kf)) ~assigns ~p_post ~p_exit in if precond then W.call_goal_precond wenv stmt kf args ~pre:(pre_goals) obj else obj let wp_calls ((_, cfg, strategy, _, wenv)) res v stmt lval call args p_post p_exit = debug "[wp_calls] %a@." Cil2cfg.pp_call_type call; let cenv = callenv cfg strategy v in match call with | Cil2cfg.Static kf -> let precond = WpStrategy.is_default_behavior strategy && R.is_pass1 res in wp_call_kf wenv cenv stmt lval kf args precond ~p_post ~p_exit | Cil2cfg.Dynamic fct -> let bhv = WpStrategy.behavior_name_of_strategy strategy in match Dyncall.get ?bhv stmt with | None -> wp_call_any wenv cenv ~p_post ~p_exit | Some (prop,calls) -> let precond = R.is_pass1 res in let do_call kf = let wp = wp_call_kf wenv cenv stmt lval kf args precond ~p_post ~p_exit in kf , wp in let pid = WpPropId.mk_property prop in W.call_dynamic wenv stmt pid fct (List.map do_call calls) let wp_stmt wenv s obj = match s.skind with | Return (r, _) -> W.return wenv s r obj | Instr i -> begin match i with | Local_init (vi, AssignInit i, _) -> W.init wenv vi (Some i) obj | Local_init (_, ConsInit _, _) -> assert false | (Set (lv, e, _)) -> W.assign wenv s lv e obj | (Asm _) -> let asm = WpPropId.mk_asm_assigns_desc s in W.use_assigns wenv asm.WpPropId.a_stmt None asm obj | (Call _) -> assert false | Skip _ | Code_annot _ -> obj end | Break _ | Continue _ | Goto _ -> obj | Loop _-> (* this is not a real loop (exit before looping) just ignore it ! *) obj | If _ -> assert false | Switch _-> assert false | Block _-> assert false | UnspecifiedSequence _-> assert false | TryExcept _ | TryFinally _ | Throw _ | TryCatch _ -> assert false let wp_scope wenv vars scope obj = debug "[wp_scope] %s : %a@." (match scope with | Mcfg.SC_Global -> "global" | Mcfg.SC_Block_in -> "block in" | Mcfg.SC_Block_out -> "block out" | Mcfg.SC_Function_in -> "function in" | Mcfg.SC_Function_frame -> "function frame" | Mcfg.SC_Function_out -> "function out" ) (Pretty_utils.pp_list ~sep:", " Printer.pp_varinfo) vars; W.scope wenv vars scope obj (** @return the WP stored for edge [e]. Compute it if it is not already * there and store it. Also handle the Acut annotations. *) let rec get_wp_edge ((_kf, cfg, strategy, res, wenv) as env) e = !Db.progress (); let v = Cil2cfg.edge_dst e in debug "[get_wp_edge] get wp before %a@." Cil2cfg.pp_node v; try let res = R.find res e in debug "[get_wp_edge] %a already computed@." Cil2cfg.pp_node v; res with Not_found -> (* Notice that other hyp and goal are handled in R.set as usual *) let cutp = if R.is_pass1 res then WpStrategy.get_cut (WpStrategy.get_annots strategy e) else [] in match cutp with | [] -> let wp = compute_wp_edge env e in R.set strategy wenv res e wp | cutp -> debug "[get_wp_edge] cut at node %a@." Cil2cfg.pp_node v; let add_cut_goal (g,p) acc = if g then add_goal wenv acc p else acc in let edge_annot = List.fold_right add_cut_goal cutp W.empty in (* put cut goal properties as goals in e if any, else true *) let edge_annot = R.set strategy wenv res e edge_annot in let wp = compute_wp_edge env e in let add_cut_hyp (_,p) acc = add_hyp wenv acc p in let oblig = List.fold_right add_cut_hyp cutp wp in (* TODO : we could add hyp to the oblig if we have some in strategy *) let oblig = W.loop_step oblig in if test_edge_loop_ok cfg None e then R.add_memo res e oblig else R.add_oblig res Clabels.pre (W.close wenv oblig); edge_annot and get_only_succ env cfg v = match Cil2cfg.succ_e cfg v with | [e'] -> get_wp_edge env e' | ls -> Wp_parameters.debug "CFG node %a has %d successors instead of 1@." Cil2cfg.pp_node v (List.length ls); Wp_error.unsupported "strange loop(s)." and compute_wp_edge ((kf, cfg, _annots, res, wenv) as env) e = let v = Cil2cfg.edge_dst e in debug "[compute_edge] before %a go...@." Cil2cfg.pp_node v; let old_loc = Cil.CurrentLoc.get () in let () = match Cil2cfg.node_stmt_opt v with | Some s -> Cil.CurrentLoc.set (Stmt.loc s) | None -> () in let formals = Kernel_function.get_formals kf in let res = match Cil2cfg.node_type v with | Cil2cfg.Vstart -> Wp_parameters.debug "No CFG edge can lead to Vstart"; Wp_error.unsupported "strange CFGs." | Cil2cfg.VfctIn -> let obj = get_only_succ env cfg v in let obj = wp_scope wenv formals Mcfg.SC_Function_in obj in let obj = wp_scope wenv [] Mcfg.SC_Global obj in obj | Cil2cfg.VblkIn (Cil2cfg.Bfct, b) -> let obj = get_only_succ env cfg v in let obj = wp_scope wenv b.blocals Mcfg.SC_Block_in obj in wp_scope wenv formals Mcfg.SC_Function_frame obj | Cil2cfg.VblkIn (_, b) -> let obj = get_only_succ env cfg v in wp_scope wenv b.blocals Mcfg.SC_Block_in obj | Cil2cfg.VblkOut (_, _b) -> let obj = get_only_succ env cfg v in obj (* cf. blocks_closed_by_edge below *) | Cil2cfg.Vstmt s -> let obj = get_only_succ env cfg v in wp_stmt wenv s obj | Cil2cfg.Vcall (stmt, lval, fct, args) -> let en, ee = Cil2cfg.get_call_out_edges cfg v in let objn = get_wp_edge env en in let obje = get_wp_edge env ee in wp_calls env res v stmt lval fct args objn obje | Cil2cfg.Vtest (true, s, c) -> let et, ef = Cil2cfg.get_test_edges cfg v in let t_obj = get_wp_edge env et in let f_obj = get_wp_edge env ef in W.test wenv s c t_obj f_obj | Cil2cfg.Vtest (false, _, _) -> get_only_succ env cfg v | Cil2cfg.Vswitch (s, e) -> let cases, def_edge = Cil2cfg.get_switch_edges cfg v in let cases_obj = List.map (fun (c,e) -> c, get_wp_edge env e) cases in let def_obj = get_wp_edge env def_edge in W.switch wenv s e cases_obj def_obj | Cil2cfg.Vloop _ | Cil2cfg.Vloop2 _ -> let get_loop_head = fun n -> get_only_succ env cfg n in wp_loop env v e get_loop_head | Cil2cfg.VfctOut | Cil2cfg.Vexit -> let obj = get_only_succ env cfg v (* exitpost / postcondition *) in wp_scope wenv formals Mcfg.SC_Function_out obj | Cil2cfg.Vend -> W.empty (* LC : unused entry point... let obj = W.empty in wp_scope wenv formals Mcfg.SC_Function_after_POST obj *) in let res = let blks = Cil2cfg.blocks_closed_by_edge cfg e in let free_locals res b = wp_scope wenv b.blocals Mcfg.SC_Block_out res in List.fold_left free_locals res blks in debug "[compute_edge] before %a done@." Cil2cfg.pp_node v; Cil.CurrentLoc.set old_loc; res let compute_global_init wenv filter obj = Globals.Vars.fold_in_file_order (fun var initinfo obj -> if var.vstorage = Extern then obj else let do_init = match filter with | `All -> true | `InitConst -> WpStrategy.isGlobalInitConst var in if not do_init then obj else let old_loc = Cil.CurrentLoc.get () in Cil.CurrentLoc.set var.vdecl ; let obj = W.init wenv var initinfo.init obj in Cil.CurrentLoc.set old_loc ; obj ) obj let process_global_const wenv obj = Globals.Vars.fold_in_file_order (fun var _initinfo obj -> if WpStrategy.isGlobalInitConst var then W.const wenv var obj else obj ) obj (* WP of global initializations. *) let process_global_init wenv kf obj = if WpStrategy.is_main_init kf then begin let obj = W.label wenv None Clabels.init obj in compute_global_init wenv `All obj end else if W.has_init wenv then begin let obj = if WpStrategy.isInitConst () then process_global_const wenv obj else obj in let obj = W.use_assigns wenv None None WpPropId.mk_init_assigns obj in let obj = W.label wenv None Clabels.init obj in compute_global_init wenv `All obj end else if WpStrategy.isInitConst () then compute_global_init wenv `InitConst obj else obj let get_weakest_precondition cfg ((kf, _g, strategy, res, wenv) as env) = debug "[wp-cfg] start Pass1"; Cil2cfg.iter_edges (fun e -> ignore (get_wp_edge env e)) cfg ; debug "[wp-cfg] end of Pass1"; R.change_mode_if_needed res; (* Notice that [get_wp_edge] will start Pass2 if needed, * but if not, it will only fetch Pass1 result. *) let e_start = Cil2cfg.start_edge cfg in let obj = get_wp_edge env e_start in let obj = process_global_init wenv kf obj in let obj = match WpStrategy.strategy_kind strategy with | WpStrategy.SKannots -> obj | WpStrategy.SKfroms info -> let pre = info.WpStrategy.get_pre () in let pre = WpStrategy.get_hyp_only pre in W.build_prop_of_from wenv pre obj in debug "before close: %a@." W.pretty obj; W.close wenv obj let compute cfg strategy = debug "[wp-cfg] start computing with the strategy for %a" WpStrategy.pp_info_of_strategy strategy; if WpStrategy.strategy_has_prop_goal strategy || WpStrategy.strategy_has_asgn_goal strategy then try let kf = Cil2cfg.cfg_kf cfg in if Cil2cfg.strange_loops cfg <> [] then Wp_error.unsupported "non natural loop(s)" ; let lvars = match WpStrategy.strategy_kind strategy with | WpStrategy.SKfroms info -> info.WpStrategy.more_vars | _ -> [] in let wenv = W.new_env ~lvars kf in let res = R.empty cfg in let env = (kf, cfg, strategy, res, wenv) in List.iter (fun (pid,thm) -> W.add_axiom pid thm) (WpStrategy.global_axioms strategy) ; let goal = get_weakest_precondition cfg env in debug "[get_weakest_precondition] %a@." W.pretty goal; let pp_cfg_edges_annot res fmt e = try W.pretty fmt (R.find res e) with Not_found -> Format.fprintf fmt "<released>" in let annot_cfg = pp_cfg_edges_annot res in debug "[wp-cfg] computing done."; [goal] , annot_cfg with Wp_error.Error (_, msg) -> Wp_parameters.warning "@[calculus failed on strategy@ @[for %a@]@ \ because@ %s (abort)@]" WpStrategy.pp_info_of_strategy strategy msg; let annot_cfg fmt _e = Format.fprintf fmt "" in [], annot_cfg else begin debug "[wp-cfg] no goal in this strategy : ignore."; let annot_cfg fmt _e = Format.fprintf fmt "" in [], annot_cfg end end ��������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/calculus.mli����������������������������������������������������0000666�0000000�0000000�00000003414�13571573400�016431� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Generic WP calculus *) module Cfg(W : Mcfg.S) : sig val compute : Cil2cfg.t -> WpStrategy.strategy -> W.t_prop list * (Format.formatter -> Cil2cfg.edge -> unit) end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/cfgDump.ml������������������������������������������������������0000666�0000000�0000000�00000025336�13571573400�016041� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* *) (**************************************************************************) let _dkey = "cfgdump" (* debugging key *) module VC = struct let fc = ref None let out = ref Format.std_formatter let knode = ref 0 let node () = incr knode ; !knode let create kf bhv = begin let name = match bhv with | None -> Kernel_function.get_name kf | Some bname -> Kernel_function.get_name kf ^ "_" ^ bname in let file = Filename.concat (Wp_parameters.get_output ()) name in Wp_parameters.feedback "CFG %a -> %s@." Kernel_function.pretty kf name ; let fout = open_out (file ^ ".dot") in fc := Some (fout,file) ; out := Format.formatter_of_out_channel fout ; Format.fprintf !out "digraph %a {@\n" Kernel_function.pretty kf ; Format.fprintf !out " rankdir = TB ;@\n" ; Format.fprintf !out " node [ style = filled, shape = box ] ;@\n" ; Format.fprintf !out " N000 [ color = red, shape = circle, label = \"*\" ] ;@\n" ; end let flush () = begin Format.fprintf !out "}@." ; out := Format.std_formatter ; match !fc with | None -> () | Some (fout,file) -> close_out fout ; ignore (Sys.command (Printf.sprintf "dot -Tpdf %s.dot > %s.pdf" file file)) end (* -------------------------------------------------------------------------- *) (* --- MCFG Interface --- *) (* -------------------------------------------------------------------------- *) type t_prop = int (* current node *) let pretty fmt k = Format.fprintf fmt "N%03d" k let link a b = if b =0 then Format.fprintf !out " %a -> %a [ style=dotted ];@." pretty a pretty b else Format.fprintf !out " %a -> %a ;@." pretty a pretty b let merge _env k1 k2 = if k1=0 then k2 else if k2=0 then k1 else let u = node () in Format.fprintf !out " %a [ label=\"\" , shape=circle ] ;@." pretty u ; link u k1 ; link u k2 ; u let empty = 0 let has_init _ = false type t_env = Kernel_function.t let new_env ?lvars kf : t_env = ignore lvars ; kf let add_axiom _p _l = () let add_hyp _env (pid,pred) k = let u = node () in if Wp_parameters.debug_atleast 1 then Format.fprintf !out " %a [ color=green , label=\"Assume %a\" ] ;@." pretty u Printer.pp_predicate pred else Format.fprintf !out " %a [ color=green , label=\"Assume %a\" ] ;@." pretty u WpPropId.pp_propid pid ; link u k ; u let add_goal env (pid,pred) k = let u = node () in if Wp_parameters.debug_atleast 1 then Format.fprintf !out " %a [ color=red , label=\"Prove %a\" ] ;@." pretty u Printer.pp_predicate pred else Format.fprintf !out " %a [ color=red , label=\"Prove %a\" ] ;@." pretty u WpPropId.pp_propid pid ; Format.fprintf !out " %a -> %a [ style=dotted ] ;@." pretty u pretty k ; merge env u k let pp_assigns fmt = function | Cil_types.WritesAny -> Format.pp_print_string fmt " \\everything" | Cil_types.Writes [] -> Format.pp_print_string fmt " \\nothing" | Cil_types.Writes froms -> List.iter (fun (t,_) -> Format.fprintf fmt "@ %a" Printer.pp_identified_term t) froms let add_assigns env (pid,_) k = let u = node () in Format.fprintf !out " %a [ color=red , label=\"Assigns %a\" ] ;@." pretty u WpPropId.pp_propid pid ; merge env u k let use_assigns _env _stmt region d k = let u = node () in begin match region with | None -> Format.fprintf !out " %a [ color=orange , label=\"Havoc All\" ] ;@." pretty u | Some pid -> Format.fprintf !out " %a [ color=orange , label=\"Havoc %a:\n@[<hov 2>assigns%a;@]\" ] ;@." pretty u WpPropId.pp_propid pid pp_assigns d.WpPropId.a_assigns end ; link u k ; u let label _env stmt label k = if Clabels.is_here label then k else let u = node () in ( match stmt with | None -> Format.fprintf !out " %a [ label=\"Label %a\" ] ;@." pretty u Clabels.pretty label | Some s -> Format.fprintf !out " %a [ label=\"Label %a (Stmt s%d)\" ] ;@." pretty u Clabels.pretty label s.Cil_types.sid ) ; link u k ; u let assign _env _stmt x e k = let u = node () in Format.fprintf !out " %a [ color=orange , label=\"%a := %a\" ] ;@." pretty u Printer.pp_lval x Printer.pp_exp e ; link u k ; u let return _env _stmt r k = let u = node () in begin match r with | None -> Format.fprintf !out " %a [ color=orange , label=\"Return\" ] ;@." pretty u | Some e -> Format.fprintf !out " %a [ color=orange , label=\"Return %a\" ] ;@." pretty u Printer.pp_exp e end ; link u k ; u let test _env _stmt e k1 k2 = let u = node () in Format.fprintf !out " %a [ color=cyan , label=\"If %a\" ] ;@." pretty u Printer.pp_exp e ; link u k1 ; link u k2 ; u let switch _env _stmt e cases def = let u = node () in Format.fprintf !out " %a [ color=cyan , label=\"Switch %a\" ] ;@." pretty u Printer.pp_exp e ; List.iter (fun (_,k) -> link u k) cases ; link u def ; u let const _ x k = let u = node () in Format.fprintf !out " %a [ color=orange, label=\"const %a\" ] ;@." pretty u Printer.pp_lval (Cil.var x) ; link u k ; u let init _ x init k = let u = node () in let pp_init fmt = function | None -> Format.pp_print_string fmt "<default>" | Some init -> Printer.pp_init fmt init in Format.fprintf !out " %a [ color=orange, label=\"init %a := %a\" ] ;@." pretty u Printer.pp_lval (Cil.var x) pp_init init ; link u k ; u let tag s k = let u = node () in Format.fprintf !out " %a [ color=cyan , label=\"Tag %s\" ] ;@." pretty u s ; link u k ; u let loop_entry w = tag "BeforeLoop" w let loop_step w = tag "InLoop" w let call_dynamic _env _stmt _pid fct calls = let u = node () in Format.fprintf !out " %a [ color=red , label \"CallPtr %a\" ];@." pretty u Printer.pp_exp fct ; List.iter (fun (_,k) -> link u k) calls ; u let call_goal_precond env _stmt kf _es ~pre k = let u = node () in Format.fprintf !out " %a [ color=red , label=\"Prove PreCond %a%t\" ] ;@." pretty u Kernel_function.pretty kf begin fun fmt -> if Wp_parameters.debug_atleast 1 then List.iter (fun (_,p) -> Format.fprintf fmt "\n@[<hov 2>Requires %a ;@]" Printer.pp_predicate p) pre end ; ignore pre ; merge env u k let call env stmt _r kf _es ~pre ~post ~pexit ~assigns ~p_post ~p_exit = let u_post = List.fold_right (add_hyp env) post p_post in let u_exit = List.fold_right (add_hyp env) pexit p_exit in let u = node () in link u u_post ; link u u_exit ; Format.fprintf !out " %a [ color=orange , label=\"Call %a @[<hov 2>(assigns%a)@]\" ] ;@." pretty u Kernel_function.pretty kf pp_assigns assigns ; ignore stmt ; List.fold_right (add_hyp env) pre u let pp_scope sc fmt xs = let title = match sc with | Mcfg.SC_Global -> "Global" | Mcfg.SC_Function_in -> "F-in" | Mcfg.SC_Function_frame -> "F-frame" | Mcfg.SC_Function_out -> "F-out" | Mcfg.SC_Block_in -> "B-in" | Mcfg.SC_Block_out -> "B-out" in begin Format.fprintf fmt "%s {" title ; List.iter (fun x -> Format.fprintf fmt " %a" Printer.pp_varinfo x) xs ; Format.fprintf fmt " }" ; end let scope _kfenv xs scope k = let u = node () in Format.fprintf !out " %a [ color=lightblue , label=\"%a\" ] ;@." pretty u (pp_scope scope) xs ; link u k ; u let close kfenv k = let u = node () in Format.fprintf !out " %a [ color=cyan , label=\"Function %a\" ] ;@." pretty u Kernel_function.pretty kfenv ; link u k ; u let build_prop_of_from _env _ps _k = 0 end module WP = Calculus.Cfg(VC) (* ------------------------------------------------------------------------ *) (* --- Proof Obligation Generation --- *) (* ------------------------------------------------------------------------ *) class computer () = let driver = Driver.load_driver () in let model = Factory.(instance default driver) in object val mutable wptasks = [] method model = model method lemma = true method add_lemma (_ : LogicUsage.logic_lemma) = () method add_strategy strategy = wptasks <- strategy :: wptasks method compute : Wpo.t Bag.t = begin (* Generates Wpos and accumulate exported goals *) List.iter (fun strategy -> let cfg = WpStrategy.cfg_of_strategy strategy in let kf = Cil2cfg.cfg_kf cfg in let bhv = WpStrategy.behavior_name_of_strategy strategy in VC.create kf bhv ; try ignore (WP.compute cfg strategy) ; VC.flush () with err -> VC.flush () ; raise err ) wptasks ; wptasks <- [] ; Bag.empty end (* method compute *) end (* class computer *) let create () = (new computer () :> Generator.computer) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/cfgDump.mli�����������������������������������������������������0000666�0000000�0000000�00000003300�13571573400�016175� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* Produce a CfgProof.computer that dumps a graph of generated PO *) val create : unit -> Generator.computer ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/cfgWP.ml��������������������������������������������������������0000666�0000000�0000000�00000154200�13571573400�015453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- WP Calculus --- *) (* -------------------------------------------------------------------------- *) open LogicUsage open Cil_types open Cil_datatype open WpPropId open Clabels open Qed open Lang open Lang.F open Sigs open Wpo module VC( C : Sigs.Compiler ) = struct open C open C.M module V = Vars module P = WpPropId.PropId let state = Mstate.create (module M) type target = | Gprop of P.t | Geffect of P.t * Stmt.t * effect_source | Gposteffect of P.t module TARGET = struct type t = target let hsrc = function | FromCode -> 1 | FromCall -> 2 | FromReturn -> 3 let hash = function | Gprop p | Gposteffect p -> P.hash p | Geffect(p,s,e) -> P.hash p * 37 + 41 * Stmt.hash s + hsrc e let compare g1 g2 = if g1 == g2 then 0 else match g1,g2 with | Gprop p1 , Gprop p2 -> P.compare p1 p2 | Gprop _ , _ -> (-1) | _ , Gprop _ -> 1 | Geffect(p1,s1,e1) , Geffect(p2,s2,e2) -> let c = P.compare p1 p2 in if c <> 0 then c else let c = Stmt.compare s1 s2 in if c <> 0 then c else hsrc e1 - hsrc e2 | Geffect _ , _ -> (-1) | _ , Geffect _ -> 1 | Gposteffect p1 , Gposteffect p2 -> P.compare p1 p2 let equal g1 g2 = (compare g1 g2 = 0) let prop_id = function Gprop p | Gposteffect p | Geffect(p,_,_) -> p let source = function Gprop _ | Gposteffect _ -> None | Geffect(_,s,e) -> Some(s,e) let pretty fmt = function | Gprop p -> WpPropId.pretty fmt p | Geffect(p,s,FromCode) -> Format.fprintf fmt "%a at sid:%d" WpPropId.pretty p s.sid | Geffect(p,s,FromCall) -> Format.fprintf fmt "Call %a at sid:%d" WpPropId.pretty p s.sid | Geffect(p,s,FromReturn) -> Format.fprintf fmt "Return %a at sid:%d" WpPropId.pretty p s.sid | Gposteffect p -> Format.fprintf fmt "%a post-effect" WpPropId.pretty p end (* Authorized written region from an assigns specification *) type effect = { e_pid : P.t ; (* Assign Property *) e_kind : a_kind ; (* Requires post effects (in case of loop-assigns) *) e_label : c_label ; (* scope for collection *) e_valid : L.sigma ; (* sigma where locations are filtered for validity *) e_region : L.region ; (* expected from spec *) e_warn : Warning.Set.t ; (* from translation *) } module EFFECT = struct type t = effect let compare e1 e2 = P.compare e1.e_pid e2.e_pid end module G = Qed.Collection.Make(TARGET) module W = Warning.Set module D = Property.Set module S = Stmt.Set module Eset = FCSet.Make(EFFECT) module Gset = G.Set module Gmap = G.Map type vc = { hyps : Conditions.bundle ; goal : F.pred ; vars : Vars.t ; (* the variables of effects/goal to collect *) warn : W.t ; deps : D.t ; path : S.t ; } (* -------------------------------------------------------------------------- *) (* --- MCFG Interface --- *) (* -------------------------------------------------------------------------- *) type t_env = { frame : L.frame ; main : L.env ; } type t_prop = { sigma : L.sigma option ; effects : Eset.t ; vcs : vc Splitter.t Gmap.t ; } (* -------------------------------------------------------------------------- *) (* --- MCFG Pretty --- *) (* -------------------------------------------------------------------------- *) let pp_vc fmt vc = Format.fprintf fmt "%a@ @[<hov 2>Prove %a@]" Pcond.dump vc.hyps F.pp_pred vc.goal let pp_vcs fmt vcs = let k = ref 0 in Splitter.iter (fun tags vc -> incr k ; begin match tags with | [] -> () | t::ts -> Format.fprintf fmt " (%a" Splitter.pretty t ; List.iter (fun t -> Format.fprintf fmt ",%a" Splitter.pretty t) ts ; Format.fprintf fmt ")@\n" ; end ; Format.fprintf fmt "@[<hov 5> (%d) %a@]@\n" !k pp_vc vc) vcs let pp_gvcs fmt gvcs = Gmap.iter_sorted (fun goal vcs -> let n = Splitter.length vcs in Format.fprintf fmt "Goal %a: (%d)@\n" TARGET.pretty goal n ; pp_vcs fmt vcs ; ) gvcs let pretty fmt wp = begin (match wp.sigma with None -> () | Some s -> Format.fprintf fmt "Sigma:@[<hov 2>%a@]@\n" Sigma.pretty s) ; pp_gvcs fmt wp.vcs ; end (* -------------------------------------------------------------------------- *) (* --- Utilities --- *) (* -------------------------------------------------------------------------- *) let empty_vc = { hyps = Conditions.nil ; goal = p_true ; vars = V.empty ; warn = W.empty ; deps = D.empty ; path = S.empty ; } let sigma_opt = function None -> Sigma.create () | Some s -> s let sigma_at w = sigma_opt w.sigma let sigma_union s1 s2 = match s1 , s2 with | None , s | s , None -> sigma_opt s , Passive.empty , Passive.empty | Some s1 , Some s2 -> Sigma.merge s1 s2 let merge_sigma s1 s2 = match s1 , s2 with | None , s | s , None -> s , Passive.empty , Passive.empty | Some s1 , Some s2 -> let s,p1,p2 = Sigma.merge s1 s2 in Some s,p1,p2 let join_with s = function None -> Passive.empty | Some s' -> Sigma.join s s' let occurs_vc vc x = Vars.mem x vc.vars || Conditions.occurs x vc.hyps let intersect_vc vc p = Vars.intersect (F.varsp p) vc.vars || Conditions.intersect p vc.hyps let state_vc ?descr ?stmt state vc = let path = match stmt with | None -> vc.path | Some s -> S.add s vc.path in let hyps = Conditions.state ?stmt ?descr state vc.hyps in { vc with path ; hyps } let assume_vc ?descr ?hpid ?stmt ?warn ?(filter=false) ?(init=false) hs vc = if (hs = [] && warn = None) || (filter && not (List.exists (intersect_vc vc) hs)) then vc else let path = match stmt with | None -> vc.path | Some s -> S.add s vc.path in let deps = match hpid with | None -> [] | Some p -> [WpPropId.property_of_id p] in let dset = List.fold_right D.add deps vc.deps in let wrns = match warn with | None -> vc.warn | Some w -> Warning.Set.union w vc.warn in let hyps = Conditions.assume ?descr ?stmt ?warn ~deps ~init (F.p_conj hs) vc.hyps in { hyps = hyps ; goal = vc.goal ; vars = vc.vars ; warn = wrns ; deps = dset ; path = path ; } let assume_vcs ?descr ?filter ?init whs vc = List.fold_left (fun vc (warn,hyp) -> assume_vc ?descr ?filter ?init ~warn [hyp] vc) vc whs let passify_vc pa vc = let hs = Passive.conditions pa (occurs_vc vc) in assume_vc hs vc (* -------------------------------------------------------------------------- *) (* --- Branching --- *) (* -------------------------------------------------------------------------- *) let branch_vc ~stmt ~warn cond vc1 vc2 = let hyps , goal = if F.eqp vc1.goal vc2.goal then begin Conditions.branch ~stmt ~warn cond vc1.hyps vc2.hyps , vc1.goal end else let k = F.e_var (Lang.freshvar ~basename:"K" Logic.Bool) in let p = F.p_equal k F.e_true in let q = F.p_equal k F.e_false in let h1 = Conditions.assume p vc1.hyps in let h2 = Conditions.assume q vc2.hyps in (Conditions.branch ~stmt ~warn cond h1 h2 , F.p_if p vc1.goal vc2.goal) in { hyps = hyps ; goal = goal ; vars = V.union vc1.vars vc2.vars ; deps = D.union vc1.deps vc2.deps ; warn = W.union vc1.warn vc2.warn ; path = S.union vc1.path vc2.path ; } (* -------------------------------------------------------------------------- *) (* --- Merging --- *) (* -------------------------------------------------------------------------- *) let merge_vc vc1 vc2 = let hyps , goal = if F.eqp vc1.goal vc2.goal then Conditions.merge [vc1.hyps;vc2.hyps] , vc1.goal else let k = F.e_var (Lang.freshvar ~basename:"K" Logic.Bool) in let p = F.p_equal k F.e_true in let q = F.p_equal k F.e_false in let h1 = Conditions.assume ~descr:"Merge Left" p vc1.hyps in let h2 = Conditions.assume ~descr:"Merge Right" q vc2.hyps in (Conditions.merge [h1 ; h2] , F.p_if p vc1.goal vc2.goal) in { hyps = hyps ; goal = goal ; vars = V.union vc1.vars vc2.vars ; deps = D.union vc1.deps vc2.deps ; warn = W.union vc1.warn vc2.warn ; path = S.union vc1.path vc2.path ; } let merge_vcs = function | [] -> empty_vc | [vc] -> vc | vcs -> let hyps = Conditions.merge (List.map (fun vc -> vc.hyps) vcs) in let goal = p_all (fun vc -> vc.goal) vcs in let vars = List.fold_left (fun d vc -> V.union d vc.vars) V.empty vcs in let deps = List.fold_left (fun d vc -> D.union d vc.deps) D.empty vcs in let warn = List.fold_left (fun d vc -> W.union d vc.warn) W.empty vcs in let path = List.fold_left (fun d vc -> S.union d vc.path) S.empty vcs in { hyps = hyps ; goal = goal ; vars = vars ; deps = deps ; warn = warn ; path = path } (* -------------------------------------------------------------------------- *) (* --- Merging and Branching with Splitters --- *) (* -------------------------------------------------------------------------- *) let gmerge = Gmap.union (fun _gid -> Splitter.union merge_vc) let gmap phi vcs = Gmap.map (Splitter.map phi) vcs let gbranch ~left ~both ~right vcs1 vcs2 = Gmap.merge (fun _g w1 w2 -> match w1 , w2 with | None , None -> None | Some vcs1 , None -> Some (Splitter.map left vcs1) | None , Some vcs2 -> Some (Splitter.map right vcs2) | Some vcs1 , Some vcs2 -> Some (Splitter.merge ~left ~both ~right vcs1 vcs2) ) vcs1 vcs2 let merge_all_vcs : vc Splitter.t Gmap.t list -> vc Splitter.t Gmap.t = fun cases -> let targets = List.fold_left (fun goals vcs -> Gset.union goals (Gmap.domain vcs)) Gset.empty cases in let goal g vcs = try Gmap.find g vcs with Not_found -> Splitter.empty in Gset.mapping (fun g -> Splitter.merge_all merge_vcs (List.map (goal g) cases)) targets (* -------------------------------------------------------------------------- *) (* --- Merge for Calculus --- *) (* -------------------------------------------------------------------------- *) let empty = { sigma = None ; effects = Eset.empty ; vcs = Gmap.empty ; } let has_init wenv = let frame = wenv.frame in let init = L.mem_at_frame frame Clabels.init in let domain = Sigma.domain init in not (M.Heap.Set.is_empty domain) let merge wenv wp1 wp2 = L.in_frame wenv.frame (fun () -> let sigma,pa1,pa2 = merge_sigma wp1.sigma wp2.sigma in let effects = Eset.union wp1.effects wp2.effects in let vcs1 = gmap (passify_vc pa1) wp1.vcs in let vcs2 = gmap (passify_vc pa2) wp2.vcs in let vcs = gmerge vcs1 vcs2 in { sigma = sigma ; vcs = vcs ; effects = effects } ) () (* -------------------------------------------------------------------------- *) (* --- Environment --- *) (* -------------------------------------------------------------------------- *) let new_env ?lvars kf = let frame = L.frame kf in let env = L.in_frame frame (L.mk_env ?lvars) () in { frame = frame ; main = env } let in_wenv (wenv:t_env) (wp:t_prop) (phi:L.env -> t_prop -> 'a) : 'a = L.in_frame wenv.frame (fun wp -> match wp.sigma with | None -> let s = Sigma.create () in phi (L.move_at wenv.main s) { wp with sigma = Some s } | Some s -> phi (L.move_at wenv.main s) wp) wp (* -------------------------------------------------------------------------- *) (* --- Compilation of Goals --- *) (* -------------------------------------------------------------------------- *) let introduction pred = let hs , goal = Conditions.forall_intro pred in let xs = List.fold_left (fun xs h -> Vars.union xs (F.varsp h)) (F.varsp goal) hs in xs , hs , goal let add_vc target ?(warn=Warning.Set.empty) pred vcs = let xs , hs , goal = introduction pred in let hyps = Conditions.intros hs Conditions.nil in let vc = { empty_vc with goal=goal ; vars=xs ; hyps=hyps ; warn=warn } in Gmap.add target (Splitter.singleton vc) vcs (* ------------------------------------------------------------------------ *) (* --- Compilation of Effects --- *) (* ------------------------------------------------------------------------ *) let cc_effect env pid (ainfo:WpPropId.assigns_desc) : effect option = let from = ainfo.WpPropId.a_label in let sigma = L.mem_frame from in let authorized_region = L.assigned_of_assigns ~unfold:false (match ainfo.a_kind with | StmtAssigns -> L.move_at env sigma | LoopAssigns -> env) ainfo.a_assigns in match authorized_region with | None -> None | Some region -> Some { e_pid = pid ; e_kind = ainfo.a_kind ; e_label = from ; e_valid = sigma ; e_region = region ; e_warn = Warning.Set.empty ; } let cc_posteffect e vcs = match e.e_kind with | StmtAssigns -> vcs | LoopAssigns -> let vc = { empty_vc with vars = L.vars e.e_region } in Gmap.add (Gposteffect e.e_pid) (Splitter.singleton vc) vcs (* -------------------------------------------------------------------------- *) (* --- WP RULES : adding axioms, hypotheses and goals --- *) (* -------------------------------------------------------------------------- *) let add_axiom _id _l = () let add_hyp wenv (hpid,predicate) wp = in_wenv wenv wp (fun env wp -> let outcome = Warning.catch ~severe:false ~effect:"Skip hypothesis" (L.pred `Negative env) predicate in let warn,hs = match outcome with | Warning.Result(warn,p) -> warn , [p] | Warning.Failed warn -> warn , [] in let vcs = gmap (assume_vc ~hpid ~warn hs) wp.vcs in { wp with vcs = vcs }) let add_goal wenv (gpid,predicate) wp = in_wenv wenv wp (fun env wp -> let outcome = Warning.catch ~severe:true ~effect:"Degenerated goal" (L.pred `Positive env) predicate in let warn,goal = match outcome with | Warning.Result(warn,goal) -> warn,goal | Warning.Failed warn -> warn,F.p_false in let vcs = add_vc (Gprop gpid) ~warn goal wp.vcs in { wp with vcs = vcs }) let add_assigns wenv (gpid,ainfo) wp = in_wenv wenv wp begin fun env wp -> let outcome = Warning.catch ~severe:true ~effect:"Degenerated goal" (cc_effect env gpid) ainfo in match outcome with | Warning.Result (_,None) -> wp | Warning.Result (warn,Some e) -> let e = { e with e_warn = warn } in let effects = Eset.add e wp.effects in let vcs = cc_posteffect e wp.vcs in { wp with effects = effects ; vcs = vcs } | Warning.Failed warn -> let vcs = add_vc (Gprop gpid) ~warn p_false wp.vcs in { wp with vcs = vcs } end let add_warnings wrns vcs = gmap (fun vc -> { vc with warn = W.union wrns vc.warn }) vcs (* -------------------------------------------------------------------------- *) (* --- WP RULE : use assigns clause --- *) (* -------------------------------------------------------------------------- *) let assigns_condition (region : L.region) (e:effect) : F.pred = L.check_assigns e.e_valid ~written:region ~assignable:e.e_region exception COLLECTED let is_collected vcs p = try Gmap.iter (fun target vcs -> let q = TARGET.prop_id target in if P.equal p q && Splitter.length vcs > 0 then raise COLLECTED ) vcs ; false with COLLECTED -> true let check_nothing effects vcs = Eset.fold (fun e vcs -> if is_collected vcs e.e_pid then vcs else Gmap.add (Gprop e.e_pid) (Splitter.singleton empty_vc) vcs ) effects vcs let check_assigns sloc source ?(warn=Warning.Set.empty) region effects vcs = Eset.fold (fun e vcs -> let xs,hs,goal = introduction (assigns_condition region e) in let warn = Warning.Set.union warn e.e_warn in let setup vc = { vc with warn = warn ; hyps = Conditions.intros hs vc.hyps ; goal = goal ; vars = xs } in let group = match e.e_kind with | StmtAssigns -> Splitter.singleton (setup empty_vc) | LoopAssigns -> try Splitter.map setup (Gmap.find (Gposteffect e.e_pid) vcs) with Not_found -> Wp_parameters.fatal "Missing post-effect for %a" WpPropId.pretty e.e_pid in let target = match sloc with | None -> Gprop e.e_pid | Some stmt -> Geffect(e.e_pid,stmt,source) in Gmap.add target group vcs ) effects vcs let do_assigns ?descr ?stmt ~source ?hpid ?warn sequence ~assigned ?(unfolded=assigned) effects vcs = let vcs = check_assigns stmt source ?warn unfolded effects vcs in let eqmem = A.apply_assigns sequence assigned in gmap (assume_vc ?descr ?hpid ?stmt ?warn eqmem) vcs let do_assigns_everything ?stmt ?warn effects vcs = Eset.fold (fun e vcs -> let target = match stmt with | None -> Gprop e.e_pid | Some s -> Geffect(e.e_pid,s,FromCode) in add_vc target ?warn F.p_false vcs) effects vcs let cc_region ~unfold cc data = let assigned = cc ~unfold:false data in assigned , if unfold then cc ~unfold:true data else assigned let cc_assigned env ~unfold kind froms = let dummy = Sigma.create () in let r0 = L.assigned_of_froms ~unfold:false (L.move_at env dummy) froms in let d0 = A.domain r0 in let s1 = L.current env in let s0 = Sigma.havoc s1 d0 in let sref = match kind with | StmtAssigns -> s0 | LoopAssigns -> s1 in let cc_assigned = L.assigned_of_froms (L.move_at env sref) in let assigned,unfolded = cc_region ~unfold cc_assigned froms in let sequence = { pre=s0 ; post=s1 } in sequence , assigned , unfolded let use_assigns wenv stmt hpid ainfo wp = in_wenv wenv wp begin fun env wp -> match ainfo.a_assigns with | WritesAny -> let sigma = Sigma.havoc_any ~call:false (L.current env) in let vcs = do_assigns_everything ?stmt wp.effects wp.vcs in { sigma = Some sigma ; vcs=vcs ; effects = wp.effects } | Writes froms -> let kind = ainfo.WpPropId.a_kind in let unfold = Wp_parameters.UnfoldAssigns.get () in let outcome = Warning.catch ~severe:true ~effect:"Assigns everything" (cc_assigned env ~unfold kind) froms in match outcome with | Warning.Result(warn,(sequence,assigned,unfolded)) -> let vcs = do_assigns ~source:FromCode ?hpid ?stmt ~warn sequence ~assigned ~unfolded wp.effects wp.vcs in { sigma = Some sequence.pre ; vcs=vcs ; effects = wp.effects } | Warning.Failed warn -> let sigma = Sigma.havoc_any ~call:false (L.current env) in let vcs = do_assigns_everything ?stmt ~warn wp.effects wp.vcs in { sigma = Some sigma ; vcs=vcs ; effects = wp.effects } end (* -------------------------------------------------------------------------- *) (* --- WP RULE : label --- *) (* -------------------------------------------------------------------------- *) let is_stopeffect l e = Clabels.equal l e.e_label let not_posteffect es target _vcs = match target with | Gposteffect p -> not (Eset.exists (fun e -> P.equal p e.e_pid) es) | _ -> true let state_vcs stmt sigma vcs = try let descr : string option = match stmt with | None | Some { labels=[] } -> None | Some { labels = lbl::_ } -> Some (Pretty_utils.to_string Printer.pp_label lbl) in let state = Mstate.state state sigma in gmap (state_vc ?descr ?stmt state) vcs with Not_found -> vcs let label wenv stmt label wp = if Clabels.is_here label then wp else in_wenv wenv wp (fun env wp -> let s_here = L.current env in let s_labl = L.mem_frame label in let pa = Sigma.join s_here s_labl in let stop,effects = Eset.partition (is_stopeffect label) wp.effects in let vcs = Gmap.filter (not_posteffect stop) wp.vcs in let vcs = gmap (passify_vc pa) vcs in let vcs = check_nothing stop vcs in let vcs = state_vcs stmt s_here vcs in { sigma = Some s_here ; vcs=vcs ; effects=effects }) (* -------------------------------------------------------------------------- *) (* --- WP RULE : assignation --- *) (* -------------------------------------------------------------------------- *) let cc_lval env lv = let obj = Ctypes.object_of (Cil.typeOfLval lv) in let dummy = Sigma.create () in let l0 = C.lval dummy lv in let s2 = L.current env in let domain = M.domain obj l0 in let s1 = Sigma.havoc s2 domain in let loc = C.lval s1 lv in let seq = { pre=s1 ; post=s2 } in obj , domain , seq , loc let cc_stored lv seq loc obj expr = if Cil.isVolatileLval lv && Cvalues.volatile ~warn:"unsafe write-access to volatile l-value" () then None else Some begin match expr.enode with | Lval lv -> M.copied seq obj loc (C.lval seq.pre lv) | _ -> M.stored seq obj loc (C.val_of_exp seq.pre expr) end let assign wenv stmt lv expr wp = in_wenv wenv wp begin fun env wp -> let outcome = Warning.catch ~severe:true ~effect:"Assigns everything (unknown l-value)" (cc_lval env) lv in match outcome with | Warning.Failed warn -> (* L-Value is unknown *) let sigma = Sigma.havoc_any ~call:false (L.current env) in let vcs = do_assigns_everything ~stmt ~warn wp.effects wp.vcs in { sigma = Some sigma ; vcs=vcs ; effects = wp.effects } | Warning.Result(l_warn,(obj,dom,seq,loc)) -> (* L-Value has been translated *) let region = [obj,Sloc loc] in let outcome = Warning.catch ~severe:false ~effect:"Havoc l-value (unknown r-value)" (cc_stored lv seq loc obj) expr in match outcome with | Warning.Failed r_warn | Warning.Result(r_warn,None) -> (* R-Value is unknown or L-Value is volatile *) let warn = Warning.Set.union l_warn r_warn in let vcs = do_assigns ~source:FromCode ~stmt ~warn seq ~assigned:region wp.effects wp.vcs in { sigma = Some seq.pre ; vcs=vcs ; effects = wp.effects } | Warning.Result(r_warn,Some stored) -> (* R-Value and effects has been translated *) let warn = Warning.Set.union l_warn r_warn in let ft = M.Heap.Set.fold_sorted (fun chunk ft -> M.Sigma.get seq.post chunk :: ft) dom [] in let update vc = if List.exists (occurs_vc vc) ft then let eqs = List.map Cvalues.equation stored in assume_vc ~stmt ~warn eqs vc else vc in let vcs = gmap update wp.vcs in let vcs = check_assigns (Some stmt) FromCode region wp.effects vcs in { sigma = Some seq.pre ; vcs=vcs ; effects = wp.effects } end (* -------------------------------------------------------------------------- *) (* --- WP RULE : return statement --- *) (* -------------------------------------------------------------------------- *) let return wenv stmt result wp = match result with | None -> wp | Some exp -> in_wenv wenv wp begin fun env wp -> let vr = L.result () in let tr = L.return () in let sigma = L.current env in let returned = p_equal (C.result sigma tr vr) (C.return sigma tr exp) in let vcs = gmap (assume_vc ~descr:"Return" ~stmt [returned]) wp.vcs in { wp with vcs = vcs } end (* -------------------------------------------------------------------------- *) (* --- WP RULE : conditional --- *) (* -------------------------------------------------------------------------- *) let condition ~descr ?stmt ?warn pa h vc = passify_vc pa (assume_vc ?stmt ?warn ~descr h vc) let mark m = function | None -> Splitter.empty | Some s -> Splitter.group m merge_vcs s let random () = let v = Lang.freshvar ~basename:"cond" Logic.Bool in F.p_bool (F.e_var v) let test wenv stmt exp wp1 wp2 = L.in_frame wenv.frame (fun () -> let sigma,pa1,pa2 = sigma_union wp1.sigma wp2.sigma in let warn,cond = match Warning.catch ~source:"Condition" ~severe:false ~effect:"Skip condition value" (C.cond sigma) exp with | Warning.Result(warn,cond) -> warn,cond | Warning.Failed(warn) -> warn,random() in let effects = Eset.union wp1.effects wp2.effects in let vcs = if Wp_parameters.Split.get () then let cneg = p_not cond in let vcs1 = gmap (condition pa1 ~stmt ~warn ~descr:"Then" [cond]) wp1.vcs in let vcs2 = gmap (condition pa2 ~stmt ~warn ~descr:"Else" [cneg]) wp2.vcs in Gmap.merge (fun _g w1 w2 -> let s1 = mark (Splitter.if_then stmt) w1 in let s2 = mark (Splitter.if_else stmt) w2 in Some (Splitter.union (merge_vc) s1 s2) ) vcs1 vcs2 else let vcs1 = gmap (passify_vc pa1) wp1.vcs in let vcs2 = gmap (passify_vc pa2) wp2.vcs in gbranch ~left:(assume_vc ~descr:"Then" ~stmt ~warn [cond]) ~right:(assume_vc ~descr:"Else" ~stmt ~warn [p_not cond]) ~both:(branch_vc ~stmt ~warn cond) vcs1 vcs2 in { sigma = Some sigma ; vcs=vcs ; effects=effects }) () (* -------------------------------------------------------------------------- *) (* --- WP RULE : switch --- *) (* -------------------------------------------------------------------------- *) let rec cc_case_values ks vs sigma = function | [] -> ks , vs | e::es -> match Ctypes.get_int64 e with | Some k -> cc_case_values (k::ks) (F.e_int64 k::vs) sigma es | None -> cc_case_values ks (C.val_of_exp sigma e::vs) sigma es let cc_group_case stmt warn descr tag pa cond vcs : vc Splitter.t Gmap.t = Gmap.map (fun s -> Splitter.map (condition ~descr ~warn ~stmt pa cond) (Splitter.group tag merge_vcs s) ) vcs let cc_case stmt warn sigma v (es,wp) = let ks,vs = cc_case_values [] [] sigma es in let pa = join_with sigma wp.sigma in let eq = p_any (p_equal v) vs in let msg = match ks with | [k] -> "Case " ^ Int64.to_string k | _ -> "Cases " ^ String.concat "," (List.map Int64.to_string ks) in let tag = Splitter.switch_cases stmt ks in vs , cc_group_case stmt warn msg tag pa [eq] wp.vcs let cc_default stmt sigma neq default = let pa = join_with sigma default.sigma in cc_group_case stmt W.empty "Default" (Splitter.switch_default stmt) pa neq default.vcs let switch wenv stmt exp cases default = L.in_frame wenv.frame (fun () -> let domain = List.fold_left (fun d (_,wp) -> match wp.sigma with | None -> d | Some s -> Sigma.union d (Sigma.domain s) ) Sigma.empty cases in let sigma = Sigma.havoc (Sigma.create ()) domain in let warn,value = match Warning.catch ~source:"Switch" ~severe:false ~effect:"Skip switched value" (C.val_of_exp sigma) exp with | Warning.Result(warn,value) -> warn,value | Warning.Failed(warn) -> let tau = Lang.tau_of_ctype (Cil.typeOf exp) in warn,e_var (Lang.freshvar tau) in let vcs_cases = List.map (cc_case stmt warn sigma value) cases in let neq = List.map (fun (vs,_) -> p_all (p_neq value) vs) vcs_cases in let vcs_default = cc_default stmt sigma neq default in let vcs = merge_all_vcs ( vcs_default :: List.map snd vcs_cases ) in let effects = List.fold_left (fun es (_,wp) -> Eset.union es wp.effects) default.effects cases in { sigma = Some sigma ; effects = effects ; vcs = vcs }) () (* -------------------------------------------------------------------------- *) (* --- WP RULES : initial values --- *) (* -------------------------------------------------------------------------- *) let const wenv v wp = in_wenv wenv wp (fun env wp -> let shere = L.current env in let sinit = L.mem_at env Clabels.init in let const_vc = assume_vc ~init:true ~filter:true ~descr:"Global Constant" [C.unchanged shere sinit v] in { wp with vcs = gmap const_vc wp.vcs }) let init wenv var init wp = in_wenv wenv wp (fun env wp -> let sigma = L.current env in let init_vc = assume_vcs ~init:true ~filter:true ~descr:"Initializer" (C.init ~sigma var init) in { wp with vcs = gmap init_vc wp.vcs }) (* -------------------------------------------------------------------------- *) (* --- WP RULE : tag --- *) (* -------------------------------------------------------------------------- *) let loop_step wp = wp let loop_entry wp = wp (* -------------------------------------------------------------------------- *) (* --- WP RULE : call dynamic --- *) (* -------------------------------------------------------------------------- *) let call_pointer sigma fct = let outcome = Warning.catch ~severe:true ~effect:"Degenerated goal" (C.call sigma) fct in match outcome with | Warning.Failed warn -> warn,None | Warning.Result(warn,floc) -> warn,Some floc let call_instance_of gpid (warn,fopt) calls vcs = let goal = match fopt with | None -> F.p_false | Some floc -> F.p_any (C.instance_of floc) calls in add_vc (Gprop gpid) ~warn goal vcs let call_contract stmt sigma hpid (warn,fopt) (kf,wp) : vc Splitter.t Gmap.t = let pa = join_with sigma wp.sigma in let tag = Splitter.call stmt kf in let descr = Printf.sprintf "Instance of '%s'" (Kernel_function.get_name kf) in let instance_of vc = let hyp = match fopt with | None -> F.p_true | Some floc -> C.instance_of floc kf in assume_vc ~stmt ~warn ~descr ~hpid [hyp] vc in Gmap.map (fun s -> Splitter.map (fun vc -> passify_vc pa (instance_of vc)) (Splitter.group tag merge_vcs s) ) wp.vcs let call_dynamic wenv stmt gpid fct calls = L.in_frame wenv.frame begin fun () -> let sigma = Sigma.create () in let called = call_pointer sigma fct in let vcs_calls = List.map (call_contract stmt sigma gpid called) calls in let vcs = merge_all_vcs vcs_calls in let vcs = call_instance_of gpid called (List.map fst calls) vcs in let effects = List.fold_left (fun es (_,wp) -> Eset.union es wp.effects) Eset.empty calls in { sigma = Some sigma ; vcs = vcs ; effects = effects } end () (* -------------------------------------------------------------------------- *) (* --- WP RULE : call precondition --- *) (* -------------------------------------------------------------------------- *) let call_goal_precond wenv _stmt kf es ~pre wp = in_wenv wenv wp (fun env wp -> let sigma = L.current env in let outcome = Warning.catch ~severe:true ~effect:"Can not prove call preconditions" (List.map (C.exp sigma)) es in match outcome with | Warning.Failed warn -> let vcs = List.fold_left (fun vcs (gid,_) -> add_vc (Gprop gid) ~warn p_false vcs) wp.vcs pre in { wp with vcs = vcs } | Warning.Result(warn,vs) -> let init = L.mem_at env Clabels.init in let call = L.call kf vs in let call_e = L.mk_env ~here:sigma () in let call_f = L.call_pre init call sigma in let vcs = List.fold_left (fun vcs (gid,p) -> let outcome = Warning.catch ~severe:true ~effect:"Can not prove call precondition" (L.in_frame call_f (L.pred `Positive call_e)) p in match outcome with | Warning.Result(warn2,goal) -> let warn = W.union warn warn2 in add_vc (Gprop gid) ~warn goal vcs | Warning.Failed warn2 -> let warn = W.union warn warn2 in add_vc (Gprop gid) ~warn p_false vcs ) wp.vcs pre in { wp with vcs = vcs }) (* -------------------------------------------------------------------------- *) (* --- WP RULE : call postcondition --- *) (* -------------------------------------------------------------------------- *) type callenv = { sigma_pre : sigma ; seq_post : sigma sequence ; seq_exit : sigma sequence ; seq_result : sigma sequence ; loc_result : (typ * Ctypes.c_object * loc) option ; frame_pre : L.frame ; frame_post : L.frame ; frame_exit : L.frame ; } (* --- Computing Call Memory States --- *) let cc_result_domain = function | Some lv -> let dummy = Sigma.create () in let tr = Cil.typeOfLval lv in let lr = C.lval dummy lv in Some (M.domain (Ctypes.object_of tr) lr) | None -> Some (M.Heap.Set.empty) let cc_call_domain env0 kf es = function | WritesAny -> None | Writes froms -> let dummy = Sigma.create () in let vs = List.map (C.exp dummy) es in let env = L.move_at env0 dummy in let init = L.mem_at env0 Clabels.init in let frame = L.call_pre init (L.call kf vs) dummy in let unfold = Wp_parameters.UnfoldAssigns.get () in let cc_froms = L.assigned_of_froms ~unfold env in Some (A.domain (L.in_frame frame cc_froms froms)) let cc_havoc d s = match d with | None -> { pre = Sigma.havoc_any ~call:true s ; post = s } | Some domain -> { pre = Sigma.havoc s domain ; post = s } let cc_callenv env0 lvr kf es assigns wpost wexit = let init = L.mem_at env0 Clabels.init in let dom_call = cc_call_domain env0 kf es assigns in let dom_vret = cc_result_domain lvr in (* Sequences to be considered *) let seq_result = cc_havoc dom_vret (sigma_at wpost) in let seq_post = cc_havoc dom_call seq_result.pre in let seq_exit = cc_havoc dom_call (sigma_at wexit) in (* Pre-State *) let sigma_pre, _, _ = Sigma.merge seq_post.pre seq_exit.pre in let formals = List.map (C.exp sigma_pre) es in let call = L.call kf formals in let result = match lvr with | None -> None | Some lv -> let tr = Cil.typeOfLval lv in let obj = Ctypes.object_of tr in let loc = C.lval sigma_pre lv in Some (tr,obj,loc) in { sigma_pre = sigma_pre ; seq_post = seq_post ; seq_exit = seq_exit ; seq_result = seq_result ; loc_result = result ; frame_pre = L.call_pre init call sigma_pre ; frame_post = L.call_post init call seq_post ; frame_exit = L.call_post init call seq_exit ; } type call_vcs = { vcs_post : vc Splitter.t Gmap.t ; vcs_exit : vc Splitter.t Gmap.t ; } let cc_call_effects stmt cenv env0 assigns wpost wexit = match assigns with | WritesAny -> { vcs_post = do_assigns_everything ~stmt wpost.effects wpost.vcs ; vcs_exit = do_assigns_everything ~stmt wexit.effects wexit.vcs ; } | Writes froms -> let env = L.move_at env0 cenv.sigma_pre in let unfold = Wp_parameters.UnfoldAssigns.get () in let assigned,unfolded = L.in_frame cenv.frame_pre (cc_region ~unfold (L.assigned_of_froms env)) froms in let vcs_post = do_assigns ~descr:"Call Effects" ~source:FromCall ~stmt cenv.seq_post ~assigned ~unfolded wpost.effects wpost.vcs in let vcs_exit = do_assigns ~descr:"Exit Effects" ~source:FromCall ~stmt cenv.seq_exit ~assigned ~unfolded wexit.effects wexit.vcs in let vcs_result = match cenv.loc_result with | None -> vcs_post (* no result *) | Some(_,obj,loc) -> let assigned = [obj,Sloc loc] in do_assigns ~descr:"Return Effects" ~source:FromReturn ~stmt cenv.seq_result ~assigned wpost.effects vcs_post in { vcs_post = vcs_result ; vcs_exit = vcs_exit } (* --- Compiling Contracts --- *) let cc_contract_hyp frame env contract = L.in_frame frame (List.map (fun (_,p) -> L.pred `Negative env p)) contract (* --- Binding Result --- *) let cc_result call = match call.loc_result with | None -> [] | Some(tr,obj,loc) -> (* [LC,VP] : the C left unspecified where to compute the lv *) (* [LC,BY] : lv computed before, like in Value Analysis *) let vr = M.load call.seq_result.post obj loc in let re = L.in_frame call.frame_post L.result () in let te = L.in_frame call.frame_post L.return () in let value = C.result call.sigma_pre tr re in [ C.equal_typ tr vr (C.cast tr te (Val value)) ] let cc_status f_caller f_callee = p_equal (e_var (L.in_frame f_caller L.status ())) (e_var (L.in_frame f_callee L.status ())) (* --- Call Rule --- *) let call_proper wenv stmt lvr kf es ~pre ~post ~pexit ~assigns ~p_post ~p_exit () = let call = cc_callenv wenv.main lvr kf es assigns p_post p_exit in let env_pre = L.move_at wenv.main call.sigma_pre in let env_post = L.move_at wenv.main call.seq_post.post in let env_exit = L.move_at wenv.main call.seq_exit.post in (* Compiling specifications *) let hs_pre = cc_contract_hyp call.frame_pre env_pre pre in let hs_post = cc_contract_hyp call.frame_post env_post post in let hs_exit = cc_contract_hyp call.frame_exit env_exit pexit in (* Binding result/status *) let hs_post = cc_result call @ hs_post in let hs_exit = cc_status wenv.frame call.frame_exit :: hs_exit in (* Checking effects (assigns and result) *) let ceff = cc_call_effects stmt call wenv.main assigns p_post p_exit in (* Applying specifications *) let fname = Kernel_function.get_name kf in let apply outcome pa hs vcs = let descr = Printf.sprintf "%s '%s'" outcome fname in gmap (condition ~descr ~stmt pa hs) vcs in let pa_post = Sigma.join call.sigma_pre call.seq_post.pre in let pa_exit = Sigma.join call.sigma_pre call.seq_exit.pre in (* Skip Precond for Caveat mode *) let hs_pre = if Wp_parameters.CalleePreCond.get () then hs_pre else [] in (* Build the contexts *) let cond_post = apply "Call" pa_post (hs_pre @ hs_post) ceff.vcs_post in let cond_exit = apply "Exit" pa_exit (hs_pre @ hs_exit) ceff.vcs_exit in (* Final vcs *) let vcs = gmerge cond_post cond_exit in let effects = Eset.union p_post.effects p_exit.effects in { sigma = Some call.sigma_pre ; effects=effects ; vcs=vcs } let call wenv stmt lvr kf es ~pre ~post ~pexit ~assigns ~p_post ~p_exit = L.in_frame wenv.frame (fun () -> let outcome = Warning.catch ~severe:true ~effect:"Call assigns everything" (call_proper wenv stmt lvr kf es ~pre ~post ~pexit ~assigns ~p_post ~p_exit) () in match outcome with | Warning.Result(warn , wp) -> { wp with vcs = add_warnings warn wp.vcs } | Warning.Failed warn -> let v_post = do_assigns_everything ~stmt ~warn p_post.effects p_exit.vcs in let v_exit = do_assigns_everything ~stmt ~warn p_exit.effects p_exit.vcs in let effects = Eset.union p_post.effects p_exit.effects in let vcs = gmerge v_post v_exit in let sigma = Sigma.create () in { sigma = Some sigma ; vcs = vcs ; effects = effects } ) () (* -------------------------------------------------------------------------- *) (* --- WP RULE : scope --- *) (* -------------------------------------------------------------------------- *) let wp_scope env wp ~descr scope xs = let post = L.current env in let pre = M.alloc post xs in let hs = M.scope { pre ; post } scope xs in let vcs = gmap (assume_vc ~descr hs) wp.vcs in { wp with sigma = Some pre ; vcs = vcs } let scope wenv xs sc wp = in_wenv wenv wp begin fun env wp -> match sc with | Mcfg.SC_Global -> let hs = M.frame (L.current env) in let vcs = gmap (assume_vc ~descr:"Heap" hs) wp.vcs in { wp with vcs } | Mcfg.SC_Function_in -> wp | Mcfg.SC_Function_frame -> wp_scope env wp ~descr:"Function Frame" Enter xs | Mcfg.SC_Function_out -> wp_scope env wp ~descr:"Function Exit" Leave xs | Mcfg.SC_Block_in -> wp_scope env wp ~descr:"Block In" Enter xs | Mcfg.SC_Block_out -> wp_scope env wp ~descr:"Block Out" Leave xs end (* -------------------------------------------------------------------------- *) (* --- WP RULE : close --- *) (* -------------------------------------------------------------------------- *) let close wenv wp = let guards = L.guards wenv.frame in let vcs = gmap (fun vc -> let gdom = List.filter (intersect_vc vc) guards in let hyps = Conditions.domain gdom vc.hyps in { vc with hyps = hyps ; vars = Vars.empty } ) wp.vcs in { wp with vcs = vcs } (* -------------------------------------------------------------------------- *) (* --- WP RULE : froms --- *) (* -------------------------------------------------------------------------- *) let cc_from deps hs vc = let guards = Lang.get_hypotheses () in let hyps = Conditions.assume ~descr:"Bisimulation" (p_conj guards) vc.hyps in let p = F.p_hyps (Conditions.extract hyps) vc.goal in let alpha = Lang.alpha () in let a_hs = List.map (F.p_subst alpha) hs in let a_p = F.p_subst alpha p in let p = p_hyps a_hs a_p in { vc with goal = p ; vars = F.varsp p ; hyps = Conditions.nil ; deps = D.union deps vc.deps ; } let build_prop_of_from wenv preconds wp = in_wenv wenv wp (fun env wp -> let sigma = L.mem_frame Clabels.pre in let env_pre = L.move_at env sigma in let hs = List.map (fun (_,p) -> L.pred `Negative env_pre p) preconds in let ds = List.fold_left (fun ds (pid,_) -> D.add (WpPropId.property_of_id pid) ds) D.empty preconds in let vcs = gmap (cc_from ds hs) wp.vcs in { sigma = Some sigma ; effects = Eset.empty ; vcs=vcs }) (* -------------------------------------------------------------------------- *) (* --- WPO Builder --- *) (* -------------------------------------------------------------------------- *) let is_trivial vc = F.eqp vc.goal F.p_true let is_empty vc = is_trivial vc && D.is_empty vc.deps && S.is_empty vc.path && W.is_empty vc.warn let make_vcqs target tags vc = let vcq = { VC_Annot.effect = TARGET.source target ; VC_Annot.axioms = None ; VC_Annot.goal = GOAL.dummy ; VC_Annot.tags = tags ; VC_Annot.deps = vc.deps ; VC_Annot.path = vc.path ; VC_Annot.warn = W.elements vc.warn ; } in let hyps = Conditions.bundle vc.hyps in let goal g = { vcq with VC_Annot.goal = GOAL.make (hyps,g) } in match F.p_expr vc.goal with | Logic.And gs when Wp_parameters.Split.get () -> Bag.list (List.map goal gs) | _ -> Bag.elt (goal vc.goal) let make_trivial vc = { VC_Annot.effect = None ; VC_Annot.axioms = None ; VC_Annot.goal = GOAL.trivial ; VC_Annot.tags = [] ; VC_Annot.deps = vc.deps ; VC_Annot.path = vc.path ; VC_Annot.warn = W.elements vc.warn ; } let make_oblig index pid vcq = { po_model = WpContext.get_model () ; po_pid = pid ; po_sid = "" ; po_gid = "" ; po_leg = "" ; po_name = "" ; po_idx = index ; po_formula = GoalAnnot vcq ; } (* -------------------------------------------------------------------------- *) (* --- WPO Grouper --- *) (* -------------------------------------------------------------------------- *) (* NOTE: bug in ocamldoc in OCaml 4.02 prevents usage of 'P' here *) module PMAP = FCMap.Make(WpPropId.PropId) type group = { mutable verifs : VC_Annot.t Bag.t ; mutable trivial : vc ; } let group_vc groups target tags vc = let pid = TARGET.prop_id target in let group = try PMAP.find pid !groups with Not_found -> let g = { verifs = Bag.empty ; trivial = empty_vc } in groups := PMAP.add pid g !groups ; g in if is_trivial vc then group.trivial <- merge_vc group.trivial vc else group.verifs <- Bag.concat group.verifs (make_vcqs target tags vc) let compile collection index (wp : t_prop) = let groups = ref PMAP.empty in Gmap.iter_sorted (fun target -> Splitter.iter (group_vc groups target)) wp.vcs ; let model = WpContext.get_model () in PMAP.iter begin fun pid group -> let trivial_wpo = let vcq = make_trivial group.trivial in Bag.elt (make_oblig index pid vcq) in let provers_wpo = Bag.map (make_oblig index pid) group.verifs in let mid = WpContext.MODEL.id model in let group = if is_empty group.trivial then if Bag.is_empty provers_wpo then trivial_wpo else provers_wpo else Bag.concat trivial_wpo provers_wpo in WpAnnot.split begin fun po_pid wpo -> let po_sid = WpPropId.get_propid po_pid in let po_leg = WpPropId.get_legacy po_pid in let po_gid = Printf.sprintf "%s_%s" mid po_sid in let po_leg = Printf.sprintf "%s_%s" mid po_leg in let po_name = Pretty_utils.to_string WpPropId.pretty_local pid in let wpo = { wpo with po_pid ; po_sid ; po_gid ; po_leg ; po_name } in Wpo.add wpo ; collection := Bag.append !collection wpo ; end pid group end !groups let lemma = L.lemma end (* -------------------------------------------------------------------------- *) (* --- WPO Computer --- *) (* -------------------------------------------------------------------------- *) module KFmap = Kernel_function.Map module Computer(M : Sigs.Compiler) = struct module VCG = VC(M) module WP = Calculus.Cfg(VCG) let compile_lemma l = ignore (VCG.lemma l) let prove_lemma collection l = if not l.lem_axiom then begin let id = WpPropId.mk_lemma_id l in let def = VCG.lemma l in let model = WpContext.get_model () in let vca = { Wpo.VC_Lemma.depends = l.lem_depends ; Wpo.VC_Lemma.lemma = def ; Wpo.VC_Lemma.sequent = None ; } in let index = match LogicUsage.section_of_lemma l.lem_name with | LogicUsage.Toplevel _ -> Wpo.Axiomatic None | LogicUsage.Axiomatic a -> Wpo.Axiomatic (Some a.ax_name) in let mid = WpContext.MODEL.id model in let sid = WpPropId.get_propid id in let leg = WpPropId.get_legacy id in let wpo = { Wpo.po_model = model ; Wpo.po_gid = Printf.sprintf "%s_%s" mid sid ; Wpo.po_leg = Printf.sprintf "%s_%s" mid leg ; Wpo.po_sid = sid ; Wpo.po_name = Printf.sprintf "Lemma '%s'" l.lem_name ; Wpo.po_idx = index ; Wpo.po_pid = id ; Wpo.po_formula = Wpo.GoalLemma vca ; } in Wpo.add wpo ; collection := Bag.append !collection wpo ; end let prove_strategy collection model kf strategy = let cfg = WpStrategy.cfg_of_strategy strategy in let bhv = WpStrategy.get_bhv strategy in let index = Wpo.Function( kf , bhv ) in if WpRTE.missing_guards model kf then Wp_parameters.warning ~current:false ~once:true "Missing RTE guards" ; try let (results,_) = WP.compute cfg strategy in List.iter (VCG.compile collection index) results with Warning.Error(source,reason) -> Wp_parameters.failure ~current:false "From %s: %s" source reason class wp (model:WpContext.model) = object val mutable lemmas : LogicUsage.logic_lemma Bag.t = Bag.empty val mutable annots : WpStrategy.strategy Bag.t KFmap.t = KFmap.empty method lemma = true method model = model method add_lemma lemma = lemmas <- Bag.append lemmas lemma method add_strategy strategy = let kf = WpStrategy.get_kf strategy in let sf = try KFmap.find kf annots with Not_found -> Bag.empty in annots <- KFmap.add kf (Bag.append sf strategy) annots method compute : Wpo.t Bag.t = begin let collection = ref Bag.empty in Lang.F.release () ; WpContext.on_context (model,WpContext.Global) begin fun () -> LogicUsage.iter_lemmas compile_lemma ; Bag.iter (prove_lemma collection) lemmas ; end () ; KFmap.iter (fun kf strategies -> WpContext.on_context (model,WpContext.Kf kf) begin fun () -> LogicUsage.iter_lemmas compile_lemma ; Bag.iter (prove_strategy collection model kf) strategies ; end () ) annots ; lemmas <- Bag.empty ; annots <- KFmap.empty ; Lang.F.release () ; !collection end end end (* Cache because computer functors can not be instantiated twice *) module COMPUTERS = Hashtbl.Make(WpContext.MODEL) let computers = COMPUTERS.create 1 let computer setup driver = let model = Factory.instance setup driver in try COMPUTERS.find computers model with Not_found -> let module M = (val Factory.(compiler setup.mheap setup.mvar)) in let module VC = Computer(M) in let generator = (new VC.wp model :> Generator.computer) in COMPUTERS.add computers model generator ; generator ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/cfgWP.mli�������������������������������������������������������0000666�0000000�0000000�00000004026�13571573400�015624� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- WP Calculus --- *) (* -------------------------------------------------------------------------- *) module VC( M : Sigs.Compiler ) : Mcfg.S module Computer( M : Sigs.Compiler ) : sig class wp : WpContext.model -> Generator.computer end val computer : Factory.setup -> Factory.driver -> Generator.computer ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/cil2cfg.ml������������������������������������������������������0000666�0000000�0000000�00000130224�13571573400�015756� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Build a CFG of a function keeping some information of the initial structure. **) open Cil_types let dkey = Wp_parameters.register_category "cil2cfg" (* debugging key *) let debug fmt = Wp_parameters.debug ~dkey fmt let debug2 fmt = Wp_parameters.debug ~dkey ~level:2 fmt (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Nodes} *) (** Be careful that only Bstmt are real Block statements *) type block_type = Bstmt of stmt | Bthen of stmt | Belse of stmt | Bloop of stmt | Bfct (* added to identify 2 blocks for tests, else there are mixed up because same * sid *) type call_type = | Dynamic of exp | Static of kernel_function let pp_call_type fmt = function | Dynamic _ -> Format.pp_print_string fmt "dynamic" | Static kf -> Kernel_function.pretty fmt kf type node_type = | Vstart | Vend | Vexit | VfctIn | VfctOut (* TODO : not useful anymore -> Bfct *) | VblkIn of block_type * block | VblkOut of block_type * block | Vstmt of stmt | Vcall of stmt * lval option * call_type * exp list | Vtest of bool * stmt * exp (** bool=true for In and false for Out *) | Vswitch of stmt * exp | Vloop of bool option * stmt (** boolean is is_natural. None means the node has not been detected * as a loop *) | Vloop2 of bool * int type node_info = { kind : node_type ; mutable reachable : bool } type node = node_info let node_type n = n.kind let bkind_stmt bk = match bk with | Bfct -> None | Bstmt s | Bthen s | Belse s | Bloop s -> Some s let _bkind_sid bk = match bk with | Bfct -> 0 | Bstmt s | Bthen s | Belse s | Bloop s -> s.sid type node_id = int * int (** gives a identifier to each CFG node in order to hash them *) let node_type_id t : node_id = match t with | Vstart -> (0, 0) | VfctIn -> (0, 1) | VfctOut -> (0, 2) | Vexit -> (0, 3) | Vend -> (0, 4) | Vstmt s | Vtest (true, s, _) | Vswitch (s,_) | Vcall (s, _, _, _) -> (1, s.sid) | Vloop (_, s) -> (2, s.sid) | Vloop2 (_, n) -> (3, n) | VblkIn (Bfct, _) -> (4, 0) | VblkIn (Bstmt s,_) -> (5, s.sid) | VblkIn (Bthen s,_) -> (6, s.sid) | VblkIn (Belse s,_) -> (7, s.sid) | VblkIn (Bloop s,_) -> (8, s.sid) | VblkOut (Bfct, _) -> (9, 0) | VblkOut (Bstmt s,_) -> (10, s.sid) | VblkOut (Bthen s,_) -> (11, s.sid) | VblkOut (Belse s,_) -> (12, s.sid) | VblkOut (Bloop s,_) -> (13, s.sid) | Vtest (false, s, _) -> (14, s.sid) let node_id n = node_type_id (node_type n) let pp_bkind fmt bk = match bk with | Bfct -> Format.fprintf fmt "fct" | Bstmt s -> Format.fprintf fmt "stmt:%d" s.sid | Bthen s -> Format.fprintf fmt "then:%d" s.sid | Belse s -> Format.fprintf fmt "else:%d" s.sid | Bloop s -> Format.fprintf fmt "loop:%d" s.sid let pp_node_type fmt n = match n with | Vstart -> Format.fprintf fmt "<start>" | VfctIn -> Format.fprintf fmt "<fctIn>" | VfctOut -> Format.fprintf fmt "<fctOut>" | Vend -> Format.fprintf fmt "<end>" | Vexit -> Format.fprintf fmt "<exit>" | VblkIn (bk,_) -> Format.fprintf fmt "<blkIn-%a>" pp_bkind bk | VblkOut (bk,_) -> Format.fprintf fmt "<blkOut-%a>" pp_bkind bk | Vcall (s, _, _, _) -> Format.fprintf fmt "<callIn-%d>" s.sid | Vstmt s -> Format.fprintf fmt "<stmt-%d>" s.sid | Vtest (b, s, _) -> Format.fprintf fmt "<test%s-%d>" (if b then "In" else "Out") s.sid | Vswitch (s,_) -> Format.fprintf fmt "<switch-%d>" s.sid | Vloop (_, s) -> Format.fprintf fmt "<loop-%d>" s.sid | Vloop2 (_, n) -> Format.fprintf fmt "<loop-n%d>" n let same_node v v' = (node_id v) = (node_id v') (** the CFG nodes *) module VL = struct type t = node let hash v = let (a,b) = (node_id v) in b*17 + a let equal v v' = same_node v v' let compare v v' = Extlib.compare_basic (node_id v) (node_id v') let pretty fmt v = pp_node_type fmt (node_type v) end let pp_node fmt v = VL.pretty fmt v let start_stmt_of_node v = match node_type v with | Vstart | Vtest (false, _, _) | VblkOut _ | VfctIn | VfctOut | Vend | Vexit | Vloop2 _ -> None | VblkIn (bk, _) -> bkind_stmt bk | Vstmt s | Vtest (true, s, _) | Vloop (_, s) | Vswitch (s,_) | Vcall (s, _, _, _) -> Some s let node_stmt_opt v = match node_type v with | Vstart | Vtest (false, _, _) | VfctIn | VfctOut | Vend | Vexit | Vloop2 _ -> None | VblkIn (bk, _) | VblkOut (bk, _) -> bkind_stmt bk | Vstmt s | Vtest (true, s, _) | Vloop (_, s) | Vswitch (s,_) | Vcall (s, _, _, _) -> Some s let node_stmt_exn v = match node_stmt_opt v with None -> raise Not_found | Some s -> s (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Edge labels} *) type edge_type = | Enone (** normal edge *) | Ethen (** then branch : edge source is a Vtest *) | Eelse (** else branch : edge source is a Vtest *) | Eback (** back edge to a loop : the edge destination is a Vloop *) | EbackThen (** Eback + Ethen *) | EbackElse (** Eback + Eelse *) | Ecase of (exp list) (** switch branch : edge source is a Vswitch. Ecase [] for default case *) | Enext (** not really a edge : gives the next node of a complex stmt *) (** the CFG edges *) module EL = struct let compare_edge_type e1 e2 = if e1 == e2 then 0 else match e1, e2 with | Enone, Enone | Ethen, Ethen | Eelse, Eelse | Eback, Eback | EbackThen, EbackThen | EbackElse, EbackElse | Enext, Enext -> 0 | Ecase l1, Ecase l2 -> Extlib.list_compare Cil_datatype.Exp.compare l1 l2 | Enone, (Ethen | Eelse | Eback | EbackThen | EbackElse | Ecase _ | Enext) | Ethen, (Eelse | Eback | EbackThen | EbackElse | Ecase _ | Enext) | Eelse, (Eback | EbackThen | EbackElse | Ecase _ | Enext) | Eback, (EbackThen | EbackElse | Ecase _ | Enext) | EbackThen, (EbackElse | Ecase _ | Enext) | EbackElse, (Ecase _ | Enext) | Ecase _, Enext -> -1 | Enext, (Ecase _ | EbackElse | EbackThen | Eback | Eelse | Ethen | Enone) | Ecase _, (EbackElse | EbackThen | Eback | Eelse | Ethen | Enone) | EbackElse, (EbackThen | Eback | Eelse | Ethen | Enone) | EbackThen, (Eback | Eelse | Ethen | Enone) | Eback, (Eelse | Ethen | Enone) | Eelse, (Ethen | Enone) | Ethen, Enone -> 1 type t = edge_type ref let compare (e1 : t) (e2 : t) = compare_edge_type !e1 !e2 let default = ref Enone let pretty fmt e = let txt = match e with | Enone -> "----" | Ethen -> "then" | Eelse -> "else" | Eback -> "back" | EbackThen -> "then-back" | EbackElse -> "else-back" | Ecase [] -> "default" | Ecase l -> Format.asprintf "case(%a)" (Pretty_utils.pp_list ~sep:", " Printer.pp_exp) l | Enext -> "(next)" in Format.fprintf fmt "%s" txt end (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Graph} *) module PMAP(X: Graph.Sig.COMPARABLE) = struct module M = FCMap.Make(X) type 'a t = 'a M.t ref type key = X.t type 'a return = unit let empty = () (* never called and not visible for the user thanks to signature constraints *) let create ?size () = ignore size ; ref M.empty let create_from h = ignore h ; ref M.empty let is_empty h = M.is_empty !h let clear h = h := M.empty let add k v h = h := M.add k v !h ; h let remove k h = h := M.remove k !h ; h let find k h = M.find k !h let mem k h = M.mem k !h let find_and_raise k t s = try find k t with Not_found -> invalid_arg s let fold f h init = M.fold f !h init let map f h = ref (M.fold (fun k v m -> let (k,v) = f k v in M.add k v m) !h M.empty) let iter f h = M.iter f !h let copy h = ref !h end (** the CFG is an ocamlgraph, but be careful to use it through the cfg function * because some edges don't have the same meaning as some others... *) module MyGraph = Graph.Blocks.Make(PMAP) module CFG: Graph.Sig.I with type V.t = VL.t and type V.label = VL.t and type E.t = VL.t * EL.t * VL.t and type E.label = EL.t = struct include MyGraph.Digraph.ConcreteBidirectionalLabeled(VL)(EL) let add_vertex g v = ignore (add_vertex g v) let add_edge g v1 v2 = ignore (add_edge g v1 v2) let remove_edge g v1 v2 = ignore (remove_edge g v1 v2) let remove_edge_e g e = ignore (remove_edge_e g e) let add_edge_e g e = ignore (add_edge_e g e) let remove_vertex g v = if HM.mem v g then begin ignore (HM.remove v g); let remove v = S.filter (fun (v2,_) -> not (V.equal v v2)) in HM.iter (fun k (s1, s2) -> ignore (HM.add k (remove v s1, remove v s2) g)) g end end (** Set of edges. *) module Eset = FCSet.Make (CFG.E) (** Set of nodes. *) module Nset = FCSet.Make (CFG.V) (** Hashtbl of node *) module Ntbl = Hashtbl.Make (CFG.V) (** The final CFG is composed of the graph, but also : * the function that it represents, * an hashtable to find a CFG node knowing its hashcode *) type t = { kernel_function : kernel_function; graph : CFG.t; spec_only : bool; stmt_node : ((int*int), CFG.V.t) Hashtbl.t; unreachables : node_type list; loop_nodes : (node list) option; mutable loop_cpt : int; } let new_cfg_env spec_only kf = { kernel_function = kf; spec_only = spec_only ; graph = CFG.create (); stmt_node = Hashtbl.create 97; unreachables = []; loop_nodes = None; loop_cpt = 0; } let cfg_kf cfg = cfg.kernel_function let cfg_graph cfg = cfg.graph let cfg_spec_only cfg = cfg.spec_only let unreachable_nodes cfg = cfg.unreachables (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 CFG edges} *) type edge = CFG.E.t let edge_type e = !(CFG.E.label e) let edge_src e = CFG.E.src e let edge_dst e = CFG.E.dst e let pp_edge fmt e = Format.fprintf fmt "%a -%a-> %a" pp_node (CFG.E.src e) EL.pretty (edge_type e) pp_node (CFG.E.dst e) let is_back_edge e = match (edge_type e) with | Eback | EbackThen | EbackElse -> true | Enone | Ethen | Eelse | Ecase _ | Enext -> false let is_next_edge e = match (edge_type e) with | Enext -> true | Eback | EbackThen | EbackElse | Enone | Ethen | Eelse | Ecase _ -> false let pred_e cfg n = try let edges = CFG.pred_e cfg.graph n in List.filter (fun e -> not (is_next_edge e)) edges with Invalid_argument _ -> (Wp_parameters.warning "[cfg.pred_e] pb with node %a" pp_node n; []) let succ_e cfg n = try let edges = CFG.succ_e cfg.graph n in List.filter (fun e -> not (is_next_edge e)) edges with Invalid_argument _ -> (Wp_parameters.warning "[cfg.succ_e] pb with node %a" pp_node n; []) type edge_key = int * int * int * int let edge_key e : edge_key = let a,b = node_id (edge_src e) in let c,d = node_id (edge_dst e) in a,b,c,d let same_edge e1 e2 = (edge_key e1 = edge_key e2) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Iterators} ignoring the [Enext] edges *) let iter_nodes f cfg = CFG.iter_vertex f (cfg.graph) let fold_nodes f cfg acc = CFG.fold_vertex f (cfg.graph) acc let iter_edges f cfg = let f e = if is_next_edge e then () else f e in CFG.iter_edges_e f (cfg.graph) let iter_succ f cfg n = let f e = if is_next_edge e then () else f (CFG.E.dst e) in try CFG.iter_succ_e f (cfg.graph) n with Invalid_argument _ -> (Wp_parameters.warning "[cfg.iter_succ] pb with node %a" pp_node n) let fold_succ f cfg n acc = let f e acc = if is_next_edge e then acc else f (CFG.E.dst e) acc in try CFG.fold_succ_e f (cfg.graph) n acc with Invalid_argument _ -> (Wp_parameters.warning "[cfg.fold_succ] pb with node %a" pp_node n; acc) let fold_pred f cfg n acc = let f e acc = if is_next_edge e then acc else f (CFG.E.src e) acc in try CFG.fold_pred_e f (cfg.graph) n acc with Invalid_argument s -> (Wp_parameters.warning "[cfg.fold_pred] pb with node %a: %s" pp_node n s; acc) let _iter_succ_e f cfg n = let f e = if is_next_edge e then () else f e in try CFG.iter_succ_e f (cfg.graph) n with Invalid_argument _ -> (Wp_parameters.warning "[cfg.iter_succ_e] pb with node %a" pp_node n) let iter_pred_e f cfg n = let f e = if is_next_edge e then () else f e in try CFG.iter_pred_e f (cfg.graph) n with Invalid_argument _ -> (Wp_parameters.warning "[cfg.iter_pred_e] pb with node %a" pp_node n) let fold_pred_e f cfg n acc = let f e acc = if is_next_edge e then acc else f e acc in try CFG.fold_pred_e f (cfg.graph) n acc with Invalid_argument _ -> (Wp_parameters.warning "[cfg.fold_pred_e] pb with node %a" pp_node n; acc) let fold_succ_e f cfg n acc = let f e acc = if is_next_edge e then acc else f e acc in try CFG.fold_succ_e f (cfg.graph) n acc with Invalid_argument _ -> (Wp_parameters.warning "[cfg.fold_succ_e] pb with node %a" pp_node n; acc) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Getting information} *) let cfg_start cfg = Hashtbl.find cfg.stmt_node (node_type_id Vstart) let start_edge cfg = match succ_e cfg (cfg_start cfg) with [e] -> e | _ -> Wp_parameters.fatal "[cfg] should have exactly ONE starting edge !" exception Found of node let _find_stmt_node cfg stmt = let find n = match node_stmt_opt n with None -> () | Some s -> if s.sid = stmt.sid then raise (Found n) in try (iter_nodes find cfg; raise Not_found) with Found n -> n (** Get the edges going out a test node with the then branch first *) let get_test_edges cfg v = match succ_e cfg v with | [e1; e2] -> begin match (edge_type e1), (edge_type e2) with | (Ethen|EbackThen), (Eelse|EbackElse) -> e1, e2 | (Eelse|EbackElse), (Ethen|EbackThen) -> e2, e1 | _, (Eelse|EbackElse) -> Wp_parameters.fatal "[cfg] test node with invalid edges %a" pp_edge e1 | _, _ -> Wp_parameters.fatal "[cfg] test node with invalid edges %a" pp_edge e2 end | _ -> raise (Invalid_argument "[cfg:get_test_edges] not a test") let get_switch_edges cfg v = match node_type v with | Vswitch _ -> begin let get_case (cl, dl) e = match (edge_type e) with | Ecase [] -> cl, e::dl | Ecase c -> (c, e)::cl, dl | _ -> Wp_parameters.fatal ("[cfg] switch node with invalid edges") in match List.fold_left get_case ([],[]) (succ_e cfg v) with | cl, [d] -> cl, d | _ -> Wp_parameters.fatal ("[cfg] switch node with several 'default' ?") end | _ -> raise (Invalid_argument "[cfg:get_switch_edges] not a switch") let get_call_out_edges cfg v = let e1, e2 = match succ_e cfg v with | [e1;e2] -> e1, e2 | _ -> assert false in let en, ee = match node_type (edge_dst e1) , node_type (edge_dst e2) with | _, Vexit -> e1, e2 | Vexit, _ -> e2, e1 | _, _ -> assert false in en, ee let get_edge_stmt e = match node_type (edge_dst e) with | Vstart | VfctIn | Vexit | VfctOut -> None | VblkIn (Bstmt s, _) | Vstmt s | Vcall (s,_,_,_) | Vtest (true, s, _) | Vswitch (s,_) -> Some s | Vloop (_,s) -> if is_back_edge e then None else Some s | Vtest _ | VblkIn _ | VblkOut _ | Vend | Vloop2 _ -> None let get_edge_labels e = let v_after = edge_dst e in let l = match node_type v_after with | Vstart -> assert false | VfctIn -> [] | Vexit | VfctOut -> [Clabels.post] | VblkIn (Bstmt s, _) | Vcall (s,_,_,_) | Vstmt s | Vtest (true, s, _) | Vswitch (s,_) -> [Clabels.stmt s] | Vloop (_,s) -> if is_back_edge e then [] else [Clabels.stmt s] | Vtest (false, _, _) | VblkIn _ | VblkOut _ | Vend -> [] | Vloop2 _ -> [] in let v_before = edge_src e in match node_type v_before with | VfctIn -> Clabels.pre::l | Vloop (_, s) -> (Clabels.loop_current s)::l | _ -> l let next_edge cfg n = let edges = match node_type n with | VblkIn _ | Vswitch _ | Vtest _ | Vloop _ -> let edges = CFG.succ_e cfg.graph n in List.filter is_next_edge edges | Vcall _ -> let en, _ee = get_call_out_edges cfg n in [en] | Vstmt _ -> let edges = match CFG.succ_e cfg.graph n with | (([] | _::[]) as edges) -> edges | edges -> (* this case may happen in case of a loop which is not really a loop : it is then a Vstmt, and the Enext is not the succ_e. *) List.filter is_next_edge edges in edges | _ -> debug "[next_edge] not found for %a@." pp_node n; raise Not_found (* No Enext information on this node *) in match edges with | [] -> (* can append when nodes have been removed *) raise Not_found | [e] -> e | _ -> Wp_parameters.fatal "several (%d) Enext edges to node %a" (List.length edges) pp_node n (** Find the node that follows the input node statement. * The statement postcondition can then be stored to the edges before that node. * @raise Not_found when the node after has been removed (unreachable) *) let node_after cfg n = edge_dst (next_edge cfg n) let get_pre_edges cfg n = pred_e cfg n let get_post_edges cfg v = try let v' = node_after cfg v in pred_e cfg v' with Not_found -> [] let get_exit_edges cfg src = debug "[get_exit_edges] of %a@." pp_node src; let do_node n acc = debug "[get_exit_edges] look at %a@." pp_node n; let add_exit e acc = let dst = edge_dst e in match node_type dst with | Vexit -> debug "[get_exit_edges] add %a@." pp_edge e; (* (succ_e cfg dst) @ acc *) e :: acc | _ -> acc in match node_type n with | Vstart -> (* In it is a problem a domination which is not solved here *) Wp_parameters.warning "[cfg] Forget exits clause of node %a" pp_node src; raise Exit | _ -> fold_succ_e add_exit cfg n acc in let rec do_node_and_preds n (seen, edges as acc) = if Nset.mem n seen then acc (* Don't loop over the same node. *) else begin let edges = do_node n edges in if CFG.V.compare src n = 0 then (seen, edges) else do_preds n (Nset.add n seen, edges) end and do_preds n acc = fold_pred do_node_and_preds cfg n acc in let edges = try let edge = next_edge cfg src in if is_next_edge edge then (* needs to look at all node between the next node and the source *) snd (do_preds (edge_dst edge) (Nset.empty, [])) else do_node src [] with Exit | Not_found -> [] in if edges = [] then debug "[get_exit_edges] -> empty"; edges let add_edges_before cfg src set e_after = let rec add_preds set e = let e_src = edge_src e in if CFG.V.compare src e_src = 0 then set else let add_edge_and_preds e set = if Eset.mem e set then set else add_preds (Eset.add e set) e in fold_pred_e add_edge_and_preds cfg e_src set in add_preds set e_after let get_internal_edges cfg n = let edges = try pred_e cfg (node_after cfg n) with Not_found -> [] in let set = Eset.empty in let set = List.fold_left (add_edges_before cfg n) set edges in edges, set let rec get_edge_next_stmt cfg e = let v_after = edge_dst e in let get_next v = match succ_e cfg v with | [e] -> get_edge_next_stmt cfg e | [] | _ :: _ -> None (* nodes without statement should have one succ, except the last one *) in match node_type v_after with | VblkOut _ | VblkIn ((Bthen _|Belse _|Bloop _|Bfct),_) -> get_next v_after | _ -> match node_stmt_opt v_after with | Some s -> Some s | None -> get_next v_after let get_post_label cfg v = match get_post_edges cfg v with | [] -> None | e::_ -> (* TODO: is this ok to consider only one edge ? *) match get_edge_next_stmt cfg e with | None -> None | Some s -> Some (Clabels.stmt s) let blocks_closed_by_edge cfg e = debug "[blocks_closed_by_edge] for %a...@." pp_edge e; let v_before = edge_src e in let blocks = match node_type v_before with | Vstmt s | Vtest (true, s, _) | Vloop (_, s) | Vswitch (s,_) -> ignore (Ast.get ()); (* Since CIL Cfg computation is required and Ast.get () have to do this well. *) begin match s.succs with | [s'] -> (try Kernel_function.blocks_closed_by_edge s s' with Not_found as e -> debug "[blocks_closed_by_edge] not found sid:%d -> sid:%d@." s.sid s'.sid; raise e) | [] | _ :: _ -> let s' = get_edge_next_stmt cfg e in match s' with | None -> [] | Some s' -> debug "[blocks_closed_by_edge] found sid:%d -> sid:%d@." s.sid s'.sid; try Kernel_function.blocks_closed_by_edge s s' with Invalid_argument _ -> [] end | _ -> (* TODO ? *) [] in let v_after = edge_dst e in let blocks = match node_type v_after with | VblkOut (Bfct, b) -> b::blocks | _ -> blocks in blocks let has_exit cfg = try let node = Hashtbl.find cfg.stmt_node (node_type_id Vexit) in match pred_e cfg node with | [] -> false | _ -> true with Not_found | Invalid_argument _ -> false (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Generic table to store things on edges} *) module type HEsig = sig type ti type t val create : int -> t val find : t -> edge -> ti val find_all : t -> edge -> ti list val add : t -> edge -> ti -> unit val replace : t -> edge -> ti -> unit val remove : t -> edge -> unit val clear : t -> unit end module HE (I : sig type t end) = struct type ti = I.t type t = (edge_key, ti) Hashtbl.t let create n = Hashtbl.create n let find info e = Hashtbl.find info (edge_key e) let find_all info e = Hashtbl.find_all info (edge_key e) let add info e i = Hashtbl.add info (edge_key e) i let replace info e i = Hashtbl.replace info (edge_key e) i let remove info e = Hashtbl.remove info (edge_key e) let clear info = Hashtbl.clear info end (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {2 Building the CFG} *) let add_node env t = let id = node_type_id t in let n = {kind = t ; reachable = false } in debug "add node : %a@." VL.pretty n; let n = CFG.V.create n in Hashtbl.add env.stmt_node id n; n let change_node_kind env n t = let id = node_id n in let id' = node_type_id t in let n' = { n with kind = t } in debug "change node kind from %a to %a" VL.pretty n VL.pretty n'; let n' = CFG.V.create n' in Hashtbl.remove env.stmt_node id; Hashtbl.add env.stmt_node id' n'; let preds = CFG.fold_pred_e (fun e acc -> e::acc) env.graph n [] in let succs = CFG.fold_succ_e (fun e acc -> e::acc) env.graph n [] in CFG.remove_vertex env.graph n; List.iter (fun e -> let e' = CFG.E.create (CFG.E.src e) (CFG.E.label e) n' in debug "replace edge %a %a %a" VL.pretty (CFG.E.src e) EL.pretty !(CFG.E.label e) VL.pretty n'; CFG.add_edge_e env.graph e') preds; List.iter (fun e -> let e' = CFG.E.create n' (CFG.E.label e) (CFG.E.dst e) in debug "replace edge %a %a %a" VL.pretty n' EL.pretty !(CFG.E.label e) VL.pretty (CFG.E.dst e) ; CFG.add_edge_e env.graph e') succs; n' let add_edge env n1 edge_type n2 = let e = CFG.E.create n1 (ref edge_type) n2 in debug "add edge : %a@." pp_edge e; CFG.add_edge_e env.graph e let remove_edge env e = debug "remove edge : %a@." pp_edge e; CFG.remove_edge_e env.graph e let insert_loop_node env loop_head loop_kind = let n_loop = add_node env loop_kind in let mv_pred_edge e = add_edge env (edge_src e) (edge_type e) n_loop; remove_edge env e in iter_pred_e mv_pred_edge env loop_head; add_edge env n_loop Enone loop_head; n_loop let init_cfg spec_only kf = let env = new_cfg_env spec_only kf in let start = add_node env (Vstart) in let fct_in = add_node env (VfctIn) in let _ = add_edge env start Enone fct_in in let fct_out = add_node env (VfctOut) in let nexit = add_node env (Vexit) in let nend = add_node env (Vend) in let _ = add_edge env fct_out Enone nend in let _ = add_edge env nexit Enone nend in env, fct_in, fct_out let get_node env t = let id = node_type_id t in debug "get_node: %a --> id:%d,%d" pp_node_type t (fst id) (snd id); try Hashtbl.find env.stmt_node id with Not_found -> add_node env t (** Setup the preconditions at all the call points of [e_kf], when possible *) let setup_preconditions_proxies e_kf = match e_kf.enode with | Lval (Var vkf, NoOffset) -> let kf = Globals.Functions.get vkf in Statuses_by_call.setup_all_preconditions_proxies kf | _ -> () (* call through function pointer *) let get_call_type fct = match Kernel_function.get_called fct with | None -> Dynamic fct | Some kf -> Static kf (** In some cases (goto for instance) we have to create a node before having * processed if through [cfg_stmt]. It is important that the created node * is the same than while the 'normal' processing ! That is why * this pattern matching might seem redundant with the other one. *) let get_stmt_node env s = let do_call res fct args _loc = get_node env (Vcall (s, res, get_call_type fct, args)) in match s.skind with | Instr (Call (res, fct, args, loc)) -> do_call res fct args loc | Instr (Local_init (v, ConsInit(f, args, kind), loc)) -> Cil.treat_constructor_as_func do_call v f args kind loc | Block b -> get_node env (VblkIn (Bstmt s,b)) | UnspecifiedSequence seq -> let b = Cil.block_from_unspecified_sequence seq in get_node env (VblkIn (Bstmt s,b)) | If (e, _, _, _) -> get_node env (Vtest (true, s, e)) | Loop _ -> get_node env (Vloop (None, s)) | Break _ | Continue _ | Goto _ | Instr _ | Return _ -> get_node env (Vstmt s) | Switch (e, _, _, _) -> get_node env (Vswitch (s, e)) | TryExcept _ | TryFinally _ | Throw _ | TryCatch _ -> Wp_parameters.not_yet_implemented "[cfg] exception handling" (** build the nodes for the [stmts], connect the last one with [next], * and return the node of the first stmt. *) let rec cfg_stmts env stmts next = match stmts with | [] -> next | [s] -> cfg_stmt env s next | s::tl -> let next = cfg_stmts env tl next in let ns = cfg_stmt env s next in ns and cfg_block env bkind b next = let in_blk = get_node env (VblkIn (bkind, b)) in let out_blk = get_node env (VblkOut (bkind, b)) in let _ = add_edge env in_blk Enext out_blk in let _ = add_edge env out_blk Enone next in let first_in_blk = cfg_stmts env b.bstmts out_blk in let _ = add_edge env in_blk Enone first_in_blk in in_blk and cfg_switch env switch_stmt switch_exp blk case_stmts next = let n_switch = get_node env (Vswitch (switch_stmt, switch_exp)) in add_edge env n_switch Enext next; let _first = cfg_stmts env blk.bstmts next in let branch with_def s = let n = get_stmt_node env s in let rec find_case l = match l with | [] -> false, [] | Case (e, _)::tl -> let r = match find_case tl with | true, [] -> true, [] | true, _ -> assert false | false, l -> false, e::l in r | Default _ :: _ -> (* we don't check if we have several Default because it is impossible: * CIL gives an error *) true, [] | _::tl -> find_case tl in let def, case = find_case s.labels in if case = [] && not def then Wp_parameters.fatal "[cfg] switch branch without label"; add_edge env n_switch (Ecase case) n; if def then true else with_def in let with_def = List.fold_left branch false case_stmts in let _ = if not with_def then add_edge env n_switch (Ecase []) next in n_switch and cfg_stmt env s next = !Db.progress (); match s.skind with | Instr (Call (_, f, _, _)) -> setup_preconditions_proxies f; let in_call = get_stmt_node env s in add_edge env in_call Enone next; let exit_node = get_node env (Vexit) in add_edge env in_call Enone exit_node; in_call | Instr (Local_init(_,ConsInit (f, _, _), _)) -> let kf = Globals.Functions.get f in Statuses_by_call.setup_all_preconditions_proxies kf; let in_call = get_stmt_node env s in add_edge env in_call Enone next; let exit_node = get_node env Vexit in add_edge env in_call Enone exit_node; in_call | Instr _ | Return _ -> let n = get_stmt_node env s in add_edge env n Enone next; n | Block b -> cfg_block env (Bstmt s) b next | UnspecifiedSequence seq -> let b = Cil.block_from_unspecified_sequence seq in cfg_block env (Bstmt s) b next | If (e, b1, b2, _) -> begin let n_in = get_stmt_node env s (*get_node env (Vtest (true, s, e))*) in let n_out = get_node env (Vtest (false, s, e)) in (* this node is to ensure that there is only one edge before * the [next] node of a if to put post properties about the IF. *) add_edge env n_out Enone next; let in_b1 = cfg_block env (Bthen s) b1 n_out in let in_b2 = cfg_block env (Belse s) b2 n_out in add_edge env n_in Ethen in_b1; add_edge env n_in Eelse in_b2; add_edge env n_in Enext next; n_in end | Loop(_, b, _, _, _) -> let loop = get_stmt_node env s in add_edge env loop Enext next; let in_b = cfg_block env (Bloop s) b loop in add_edge env loop Enone in_b; loop | Break _ | Continue _ | Goto _ -> let n = get_stmt_node env s in let _ = match s.succs with | [s'] -> add_edge env n Enone (get_stmt_node env s') | _ -> Wp_parameters.fatal "[cfg] jump with more than one successor ?" in n | Switch (e, b, lstmts, _) -> cfg_switch env s e b lstmts next | TryExcept _ | TryFinally _ | Throw _ | TryCatch _ -> Wp_parameters.not_yet_implemented "[cfg] exception handling" (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {3 Cleaning} remove node and edges that are unreachable *) let clean_graph cfg = let graph = cfg_graph cfg in let rec reach n = if n.reachable then () else (n.reachable <- true; iter_succ reach cfg n) in reach (cfg_start cfg); let clean n acc = if n.reachable then acc else begin debug "remove unreachable node %a@." VL.pretty n; let v = node_type n in CFG.remove_vertex graph n; Hashtbl.remove cfg.stmt_node (node_type_id v); v::acc end in let unreach = fold_nodes clean cfg [] in { cfg with unreachables = unreach } (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {3 About loops} * Let's first remind some definitions about loops : * - {b back edge} : edge n->h such that h dominates n. * - {b natural loop} : defined by a back edge n->h * * h is called the {b loop header}, * * the body of the loop is the set of nodes n that are "between" h and n, * ie all n predecessors until h. * Because h dominates n, every backward path from n go through h. * Notice that each node in the loop body is dominated by h. * * A loop is not a natural loop if it has several entries (no loop header), * or if it has some irreducible region (no back edge). * * Below, we use an algorithm from the paper : * "A New Algorithm for Identifying Loops in Decompilation" * of Tao Wei, Jian Mao, Wei Zou, and Yu Chen, * to gather information about the loops in the built CFG. *) module type WeiMaoZouChenInput = sig type graph type node type tenv (** build a new env from a graph, * and also return the entry point of the graph which has to be unique. *) val init : graph -> tenv * node (** apply the function on the node successors *) val fold_succ : (tenv -> node -> tenv) -> tenv -> node -> tenv val eq_nodes : node -> node -> bool (** store the position for the node and also the fact that the node has * been seen *) val set_pos : tenv -> node -> int -> tenv (** reset the position (set the position to 0), but should keep the * information that the node has been seen already. *) val reset_pos : tenv -> node -> tenv (** get the previously stored position of the node or 0 if nothing has been * stored *) val get_pos : tenv -> node -> int (** get the previously stored position of the node if any, or None * if [set_pos] hasn't been called already for this node. *) val get_pos_if_traversed : tenv -> node -> int option (** [set_iloop_header env b h] store h as the innermost loop header for b. * Beware that this function can be called several times for the same b * with different values of h during the computation. Only the last one * will give the correct information. * *) val set_iloop_header : tenv -> node -> node -> tenv (** get the node innermost loop header if any *) val get_iloop_header : tenv -> node -> node option (** store the node as a loop header. *) val add_loop_header : tenv -> node -> tenv (** store the node as an irreducible loop header. *) val add_irreducible : tenv -> node -> tenv (** store the edge between the two nodes (n1, n2) as a reentry edge. * n2 is the reentry point which means that it is in a loop, * but it is not the loop header, and n1 is not in the loop. *) val add_reentry_edge : tenv -> node -> node -> tenv (* val pretty_node : Format.formatter -> node -> unit *) end (** Implementation of * "A New Algorithm for Identifying Loops in Decompilation" *) module WeiMaoZouChen (G : WeiMaoZouChenInput) : sig val identify_loops : G.graph -> G.tenv end = struct let tag_lhead env b h = match h with | None -> env | Some h -> if G.eq_nodes h b then (* already done *) env else let rec do_cur env cur_b cur_h = match G.get_iloop_header env cur_b with | None -> G.set_iloop_header env cur_b cur_h | Some hb when G.eq_nodes hb cur_h -> (* nothing to do *) env | Some hb -> if (G.get_pos env hb) < (G.get_pos env cur_h) then let env = G.set_iloop_header env cur_b cur_h in do_cur env cur_h hb else do_cur env hb cur_h in do_cur env b h (** @return innermost loop header of b0 (None if b0 is not in a loop) *) let rec trav_loops_DFS env b0 pos = let env = G.set_pos env b0 pos in let do_b env b = match G.get_pos_if_traversed env b with | None -> (* case A : b is not traversed already *) let env, nh = trav_loops_DFS env b (pos + 1) in tag_lhead env b0 nh | Some b_pos when (b_pos > 0) -> begin (* case B : b already in path -> it is a loop *) let env = G.add_loop_header env b in tag_lhead env b0 (Some b) end | Some 0 -> begin match G.get_iloop_header env b with | None -> (* case C : do nothing *) env | Some h when (G.get_pos env h > 0) -> (* case D : b not in path, but h is *) tag_lhead env b0 (Some h) | Some h -> (* h not in path *) begin (* case E : reentry *) assert (G.get_pos env h = 0); let env = G.add_irreducible env h in let env = G.add_reentry_edge env b0 b in let rec f env h = match G.get_iloop_header env h with | Some h when (G.get_pos env h > 0) -> tag_lhead env b0 (Some h) | Some h -> let env = G.add_irreducible env h in f env h | None -> env in f env h end end | _ -> assert false (* b_pos cannot be < 0 *) in let env = G.fold_succ do_b env b0 in let env = G.reset_pos env b0 in let h0 = G.get_iloop_header env b0 in env, h0 let identify_loops g = let env, start = G.init g in let env, _ = trav_loops_DFS env start 1 in env end (** To use WeiMaoZouChen algorithm, * we need to define how to interact with our CFG graph *) module LoopInfo = struct type node = CFG.V.t type graph = t type tenv = { graph : t ; dfsp : int Ntbl.t; iloop_header : node Ntbl.t; loop_headers : node list ; irreducible : node list ; unstruct_coef : int } let init cfg = let env = { graph = cfg ; dfsp = Ntbl.create 97; iloop_header = Ntbl.create 7; loop_headers = []; irreducible = []; unstruct_coef = 0 } in env, cfg_start cfg let eq_nodes = CFG.V.equal let set_pos env n pos = Ntbl.add env.dfsp n pos; env let reset_pos env n = Ntbl.replace env.dfsp n 0; env let get_pos env n = try Ntbl.find env.dfsp n with Not_found -> 0 let get_pos_if_traversed env n = try Some (Ntbl.find env.dfsp n) with Not_found -> None let set_iloop_header env b h = Ntbl.add env.iloop_header b h; env let get_iloop_header env b = try Some (Ntbl.find env.iloop_header b) with Not_found -> None let add_loop_header env h = { env with loop_headers = h :: env.loop_headers} let add_irreducible env h = { env with irreducible = h :: env.irreducible} let add_reentry_edge env _ _ = (* TODO *) env let is_irreducible env h = List.exists (eq_nodes h) env.irreducible let fold_succ f env n = fold_succ (fun v env -> f env v) env.graph n env let unstructuredness env = let k = float_of_int env.unstruct_coef in let k = k /. (float_of_int (CFG.nb_edges (cfg_graph env.graph))) in let k = 1. +. k in k end module Mloop = WeiMaoZouChen (LoopInfo) let set_back_edge e = let info = CFG.E.label e in match !info with | Eback | EbackThen | EbackElse -> () | Enone -> info := Eback | Ethen -> info := EbackThen | Eelse -> info := EbackElse | Ecase _ | Enext -> assert false let mark_loops cfg = let env = Mloop.identify_loops cfg in let mark_loop_back_edge h = match node_stmt_opt h with | None -> (* Because we use !Db.Dominators that work on statements, we don't know how to detect back edge here. TODO: compute dominators on our cfg ? *) false | Some h_stmt -> let mark_back_edge e = let n = edge_src e in let is_back_edge = try let n_stmt = node_stmt_exn n in Dominators.dominates h_stmt n_stmt with Not_found -> false (* pred of h is not a stmt *) in if is_back_edge then set_back_edge e; debug "to loop edge %a@." pp_edge e in iter_pred_e mark_back_edge cfg h; true in let mark_loop loops h = debug "loop head in %a@." VL.pretty h; let is_natural = if (LoopInfo.is_irreducible env h) then (debug "irreducible loop detected in %a@." VL.pretty h; false) else true in let back_edges_ok = if is_natural then mark_loop_back_edge h else true in let loop = match node_type h with | Vloop (_, h_stmt) -> assert (back_edges_ok); change_node_kind cfg h (Vloop (Some is_natural, h_stmt)) | _ -> match node_stmt_opt h with | Some h_stmt when back_edges_ok -> insert_loop_node cfg h (Vloop (Some is_natural, h_stmt)) | None when back_edges_ok -> let n = cfg.loop_cpt in cfg.loop_cpt <- n + 1; insert_loop_node cfg h (Vloop2 (is_natural, n)) | _ -> (* consider it has non-natural. *) let n = cfg.loop_cpt in cfg.loop_cpt <- n + 1; insert_loop_node cfg h (Vloop2 (false, n)) in loop::loops in let loops = List.fold_left mark_loop [] env.LoopInfo.loop_headers in debug2 "unstructuredness coef = %f@." (LoopInfo.unstructuredness env); { cfg with loop_nodes = Some loops } let loop_nodes cfg = match cfg.loop_nodes with Some l -> l | None -> Wp_parameters.fatal "Cannot use the loop nodes before having computed them" let strange_loops cfg = let strange n = match node_type n with | Vloop (Some is_natural, _) when is_natural -> false | _ -> true in let loops = loop_nodes cfg in let strange_loops = List.filter strange loops in debug "%d/%d strange loops" (List.length strange_loops) (List.length loops); strange_loops let very_strange_loops cfg = let strange n = match node_type n with | Vloop (Some _, _) | Vloop2 _ -> false | _ -> true in let loops = loop_nodes cfg in let strange_loops = List.filter strange loops in debug "%d/%d very strange loops" (List.length strange_loops) (List.length loops); strange_loops (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (** {3 Create CFG} *) let cfg_from_definition kf f = let kf_name = Kernel_function.get_name kf in let cfg, fct_in, fct_out = init_cfg false kf in let in_b = cfg_block cfg Bfct f.sbody fct_out in let _ = add_edge cfg fct_in Enone in_b in let graph = cfg_graph cfg in debug "for function '%s': %d vertex - %d edges@." kf_name (CFG.nb_edges graph) (CFG.nb_vertex graph); debug "start removing unreachable in %s@." kf_name; !Db.progress (); let cfg = clean_graph cfg in debug "for function '%s': %d vertex - %d edges@." kf_name (CFG.nb_edges graph) (CFG.nb_vertex graph); !Db.progress (); debug "start loop analysis for %s@." kf_name; let cfg = mark_loops cfg in cfg let cfg_from_proto kf = let cfg, fct_in, fct_out = init_cfg true kf in let _ = add_edge cfg fct_in Enone fct_out in let cfg = { cfg with loop_nodes = Some [] } in cfg (* ------------------------------------------------------------------------ *) (** {2 CFG management} *) let create kf = let kf_name = Kernel_function.get_name kf in debug "create cfg for function '%s'@." kf_name; let cfg = try let f = Kernel_function.get_definition kf in cfg_from_definition kf f with Kernel_function.No_Definition -> cfg_from_proto kf in debug "done for %s@." kf_name; !Db.progress (); cfg module KfCfg = Kernel_function.Make_Table (Datatype.Make (struct include Datatype.Undefined type tt = t type t = tt let name = "WpCfg" let mem_project = Datatype.never_any_project let reprs = List.map (fun kf -> { kernel_function = kf; spec_only = true; graph = CFG.create (); stmt_node = Hashtbl.create 0; unreachables = []; loop_nodes = None; loop_cpt = 0; } ) Kernel_function.reprs let equal t1 t2 = Kernel_function.equal t1.kernel_function t2.kernel_function let hash t = Kernel_function.hash t.kernel_function let compare t1 t2 = Kernel_function.compare t1.kernel_function t2.kernel_function end)) (struct let name = "KfCfg" let dependencies = [Ast.self] let size = 17 end) let get kf = KfCfg.memo create kf (* ------------------------------------------------------------------------ *) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/cil2cfg.mli�����������������������������������������������������0000666�0000000�0000000�00000014734�13571573400�016136� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Clabels (** abstract type of a cfg *) type t (** @raise Log.FeatureRequest for non natural loops and 'exception' stmts. * @return the graph and the list of unreachable nodes. * *) val get : Kernel_function.t -> t (** abstract type of the cfg nodes *) type node val pp_node : Format.formatter -> node -> unit val same_node : node -> node -> bool (** abstract type of the cfg edges *) type edge val pp_edge : Format.formatter -> edge -> unit val same_edge : edge -> edge -> bool (** get the starting edges *) val start_edge : t -> edge (** set of edges *) module Eset : FCSet.S with type elt = edge (** node and edges relations *) val edge_src : edge -> node val edge_dst : edge -> node val pred_e : t -> node -> edge list val succ_e : t -> node -> edge list (** iterators *) val fold_nodes : (node -> 'a -> 'a) -> t -> 'a -> 'a val iter_nodes : (node -> unit) -> t -> unit val iter_edges : (edge -> unit) -> t -> unit (** Be careful that only Bstmt are real Block statements *) type block_type = private | Bstmt of stmt | Bthen of stmt | Belse of stmt | Bloop of stmt | Bfct type call_type = | Dynamic of exp | Static of kernel_function val pp_call_type : Format.formatter -> call_type -> unit val get_call_type : exp -> call_type type node_type = private | Vstart | Vend | Vexit | VfctIn | VfctOut | VblkIn of block_type * block | VblkOut of block_type * block | Vstmt of stmt | Vcall of stmt * lval option * call_type * exp list | Vtest of bool * stmt * exp | Vswitch of stmt * exp | Vloop of bool option * stmt (** boolean is is_natural. None means the node has not been * detected as a loop. *) | Vloop2 of bool * int val node_type : node -> node_type val pp_node_type : Format.formatter -> node_type -> unit val node_stmt_opt : node -> stmt option val start_stmt_of_node : node -> stmt option (** @return the nodes that are unreachable from the 'start' node. * These nodes have been removed from the cfg already. *) val unreachable_nodes : t -> node_type list (** similar to [succ_e g v] * but tests the branch to return (then-edge, else-edge) * @raise Invalid_argument if the node is not a test. * *) val get_test_edges : t -> node -> edge * edge (** similar to [succ_e g v] but give the switch cases and the default edge *) val get_switch_edges : t -> node -> (exp list * edge) list * edge (** similar to [succ_e g v] but gives the edge to VcallOut first and the edge to Vexit second. *) val get_call_out_edges : t -> node -> edge * edge val blocks_closed_by_edge : t -> edge -> block list val is_back_edge : edge -> bool (** detect is there are non natural loops or natural loops where we didn't * manage to compute back edges (see [mark_loops]). Must be empty in the mode * [-wp-no-invariants]. (see also [very_strange_loops]) *) val strange_loops : t -> node list (** detect is there are natural loops where we didn't manage to compute * back edges (see [mark_loops]). At the moment, we are not able to handle those * loops. *) val very_strange_loops : t -> node list (** @return the (normalized) labels at the program point of the edge. *) val get_edge_labels : edge -> Clabels.c_label list (** Complete get_edge_labels and returns the associated stmt, if any. *) val get_edge_stmt : edge -> stmt option (** @return None when the edge leads to the end of the function. *) val get_edge_next_stmt : t -> edge -> stmt option (** whether an exit edge exists or not *) val has_exit : t -> bool (** Find the edges where the precondition of the node statement have to be * checked. *) val get_pre_edges : t -> node -> edge list (** Find the edges where the postconditions of the node statement have to be * checked. *) val get_post_edges : t -> node -> edge list (** Get the label to be used for the Post state of the node contract if any. *) val get_post_label : t -> node -> c_label option (** Find the edges [e] that goes to the [Vexit] node inside the statement * beginning at node [n] *) val get_exit_edges : t -> node -> edge list (** Find the edges [e] of the statement node [n] postcondition * and the set of edges that are inside the statement ([e] excluded). * For instance, for a single statement node, [e] is [succ_e n], * and the set is empty. For a test node, [e] are the last edges of the 2 * branches, and the set contains all the edges between [n] and the [e] edges. * *) val get_internal_edges : t -> node -> edge list * Eset.t val cfg_kf : t -> Kernel_function.t val cfg_spec_only : t -> bool (** returns [true] is this CFG is degenerated (no code available) *) (** signature of a mapping table from cfg edges to some information. *) module type HEsig = sig type ti type t val create : int -> t val find : t -> edge -> ti val find_all : t -> edge -> ti list val add : t -> edge -> ti -> unit val replace : t -> edge -> ti -> unit val remove : t -> edge -> unit val clear : t -> unit end module HE (I : sig type t end) : HEsig with type ti = I.t ������������������������������������frama-c-20.0-Calcium/src/plugins/wp/clabels.ml������������������������������������������������������0000666�0000000�0000000�00000006455�13571573400�016062� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Normalized C-labels --- *) (* -------------------------------------------------------------------------- *) open Cil_types type c_label = string let compare = String.compare let equal (a:string) (b:string) = (a = b) module T = struct type t = c_label let compare = compare end module LabelMap = Datatype.String.Map module LabelSet = Datatype.String.Set let init = "wp:init" let here = "wp:here" let next = "wp:next" let pre = "wp:pre" let post = "wp:post" let old = "wp:old" let break = "wp:break" let continue = "wp:continue" let default = "wp:default" let at_exit = "wp:exit" let loopcurrent = "wp:loopcurrent" let loopentry = "wp:loopentry" let formal a = a let pretty = Format.pp_print_string let is_here h = (h = here) let mem l lbl = List.mem l lbl let case n = "wp:case" ^ Int64.to_string n let stmt s = "wp:sid" ^ string_of_int s.sid let loop_entry s = stmt s (* same point *) let loop_current s = "wp:head" ^ string_of_int s.sid let to_logic a = FormalLabel a let of_logic = function | BuiltinLabel Here -> here | BuiltinLabel Init -> init | BuiltinLabel Pre -> pre | BuiltinLabel Post -> post | FormalLabel name -> name | BuiltinLabel Old -> old | BuiltinLabel LoopCurrent -> loopcurrent | BuiltinLabel LoopEntry -> loopentry | StmtLabel s -> stmt !s let name = function FormalLabel a -> a | _ -> "" let lookup labels a = try List.find (fun (l,_) -> name l = a) labels |> snd with Not_found -> Wp_parameters.fatal "Unbound label parameter '%s' in predicate or function call" a (* -------------------------------------------------------------------------- *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/clabels.mli�����������������������������������������������������0000666�0000000�0000000�00000006367�13571573400�016235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Normalized C-labels *) (* -------------------------------------------------------------------------- *) (** Structural representation of logic labels. Compatible with pervasives comparison and structural equality. *) type c_label val is_here : c_label -> bool val mem : c_label -> c_label list -> bool val equal : c_label -> c_label -> bool module T : sig type t = c_label val compare : t -> t -> int end module LabelMap : FCMap.S with type key = c_label module LabelSet : FCSet.S with type elt = c_label val pre : c_label val here : c_label val next : c_label val init : c_label val post : c_label val break : c_label val continue : c_label val default : c_label val at_exit : c_label val loopentry : c_label val loopcurrent : c_label val old : c_label val formal : string -> c_label val case : int64 -> c_label val stmt : Cil_types.stmt -> c_label val loop_entry : Cil_types.stmt -> c_label val loop_current : Cil_types.stmt -> c_label val to_logic : c_label -> Cil_types.logic_label val of_logic : Cil_types.logic_label -> c_label (** Assumes the logic label only comes from normalized or non-ambiguous labels. Ambiguous labels are: Old, LoopEntry and LoopCurrent, since they points to different program points dependending on the context. *) val pretty : Format.formatter -> c_label -> unit open Cil_types val name : logic_label -> string val lookup : (logic_label * logic_label) list -> string -> logic_label (** [lookup bindings lparam] retrieves the actual label for the label in [bindings] for label parameter [lparam]. *) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/configure�������������������������������������������������������0000777�0000000�0000000�00000305410�13571573400�016023� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Makefile.in" ac_subst_vars='LTLIBOBJS LIBOBJS COQC HAS_WHY3 WHY3 ENABLE_WP ENABLE_GUI FRAMAC_VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_wp enable_wp_coq ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-wp WP plug-in (default: yes) --enable-wp-coq Wp precompiled Coq libraries (default: yes) Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu KNOWN_PLUGINS=$(frama-c -plugins | \ sed -e '/\[kernel\]/d' -e 's/\([^ ][^ ]*\( [^ ][^ ]*\)*\) .*/\1/' \ -e '/^ /d' -e '/^$/d' | \ tr "a-z- " "A-Z__") for plugin in ${KNOWN_PLUGINS}; do export $(echo ENABLE_$plugin)=yes done FRAMAC_VERSION=`frama-c -version` # Extract the first word of "frama-c-gui", so it can be a program name with args. set dummy frama-c-gui; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ENABLE_GUI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ENABLE_GUI"; then ac_cv_prog_ENABLE_GUI="$ENABLE_GUI" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ENABLE_GUI="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ENABLE_GUI" && ac_cv_prog_ENABLE_GUI="no" fi fi ENABLE_GUI=$ac_cv_prog_ENABLE_GUI if test -n "$ENABLE_GUI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_GUI" >&5 $as_echo "$ENABLE_GUI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi upper() { echo "$1" | tr "a-z-" "A-Z_" } lower() { echo "$1" | tr "A-Z" "a-z" } new_section() { banner=`echo "* $1 *" | sed -e 's/./*/g'` title=`echo "* $1 *" | tr "a-z" "A-Z"` { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $title" >&5 $as_echo "$as_me: $title" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: $banner" >&5 $as_echo "$as_me: $banner" >&6;} } # sadly, there's no way to define a new diversion beside the internal ones. # hoping for the best here... # to distinguish internal plugins, known by the main configure, from # purely external plugins living in src/ and compiled together with the main # frama-c # end of check_plugin # 1st param: uppercase name of the library # 2nd param: file which must exist. This parameter can be a list of files. # In this case, they will be tried in turn until one of them exists. The # name of the file found will be put in the variable SELECTED_$1 # 3d param: warning to display if problem # 4th param: yes iff checking the library must always to be done # (even if there is no plug-in using it) # 1st param: actual name of the ocamlfind package (often lowercase) # 2nd param: warning to display if problem # 1st param: uppercase name of the program # 2nd param: program which must exist. See comment on configure_library() # on how to deal with multiple choices for a given program. # 3d param: warning to display if problem # 4th param: yes iff checking the tool must always to be done # (even if there is no plug-in using it) EXTERNAL_PLUGINS= # Usage: plugin_disable([plugin],[reason]) # Implementation of an ordering $1 < $2: "" < yes < partial < no lt_mark () { first=`echo "$1" | sed -e 's/ .*//' ` second=`echo "$2" | sed -e 's/ .*//' ` case $first in "") echo "true";; "yes"*) case $second in "yes") echo "";; "partial" | "no") echo "true";; esac;; "partial"*) case $second in "yes" | "partial") echo "";; "no") echo "true";; esac;; "no"*) echo "";; esac } # Check and propagate marks to requires and users. # $1: parent plugin # $2: mark to propagate to requires # $3: mark to propagate to users check_and_propagate () { # for each requires r=REQUIRE_$1 eval require="\$$r" for p in $require; do up=`upper "$p"` m=MARK_"$up" eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$2" `; then # update marks eval MARK_$up=\"$2\"; TODOLIST=$TODOLIST" "$p # display a warning or an error if required short_mark=`echo $2 | sed -e 's/ .*//'` lp=`lower $p` reason=`echo $2 | sed -e 's/no (\(.*\))/\1/' ` if test "$short_mark" = "no"; then fp=FORCE_"$up" if eval test "\$$fp" = "yes"; then as_fn_error $? "$lp requested but $reason." "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp disabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp disabled because $reason." >&2;} fi else if test "$short_mark" = "partial"; then reason=`echo $2 | sed -e 's/partial (\(.*\))/\1/' ` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enable because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enable because $reason." >&2;} fi fi eval INFO_$up=\", $reason\" fi done # for each users u=USE_$1 eval use="\$$u" for p in $use; do up=`upper "$p"` m=MARK_$up eval mark="\$$m" if test -z "$mark"; then m=ENABLE_"$up" eval mark="\$$m" fi if test `lt_mark "$mark" "$3" `; then # update marks eval MARK_$up=\"$3\"; TODOLIST=$TODOLIST" "$p # display a warning if required lp=`lower $p` reason=`echo $3 | sed -e 's/partial (\(.*\))/\1/' ` if test "$reason" != "$3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $lp only partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $lp only partially enabled because $reason." >&2;} fi eval INFO_$up=\", $reason\" fi done } # checks direct dependencies of a plugin. Useful for dynamic plugins which # have a dependency toward already installed (or not) plug-ins, since the old # plugins are not in the TODO list from the beginning (and need not their # mutual dependencies be rechecked anyway check_required_used () { ep=ENABLE_$1 eval enabled=\$$ep if test "$enabled" != "no"; then r=REQUIRED_$1 u=USED_$1 m=MARK_$1 eval required=\$$r eval used=\$$u eval $m=yes reason= for p in $required; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"no\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name disabled because $reason." >&2;} eval INFO_$1=\", $reason\" else for p in $used; do up=`upper $p` ec=ENABLE_$up eval enabled=\$$ec case `echo "$enabled" | sed -e 's/ .*//'` in "") reason="$p unknown";; "yes" | "partial");; "no") reason="$p not enabled";; esac done if test -n "$reason"; then eval $m=\"partial\ \($reason\)\" p_name=`lower $1` { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p_name partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p_name partially enabled because $reason." >&2;} eval INFO_$1=\", $reason\" fi fi else # $enabled = "no" eval $m=\"no\" fi } # Recursively check the plug-in dependencies using the plug-in dependency graph compute_dependency () { plugin=`echo $TODOLIST | sed -e 's/ .*//' ` TODOLIST=`echo $TODOLIST | sed -e 's/[^ ]* *\(.*\)/\1/' ` lplugin=`lower "$plugin"` uplugin=`upper "$plugin"` # new mark to consider m=MARK_$uplugin eval mark="\$$m" # old mark to consider r=REMEMBER_$uplugin eval remember="\$$r" # the exact mark (final result), # also the old mark if plugin already visited e=ENABLE_$uplugin eval enable="\$$e" #first visit. Performs additional checks over requirements. if test -z "$mark"; then check_required_used "$uplugin"; eval mark=\$$m fi # echo "plug-in $lplugin (mark=$mark, remember=$remember, enable=$enable)" if test `lt_mark "$remember" "$mark"`; then # visit the current plugin: # mark <- max(mark, enable) case `echo "$mark" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") if test -n "$enable"; then mark="$enable"; else mark="yes"; fi;; "partial") if test "$enable" = "no"; then mark="no"; fi;; "no") ;; esac # update plug-in attributes with the new mark # echo "update attributes with $mark" eval $m=\"$mark\" eval $e=\"`echo "$mark" | sed -e 's/ .*//' `\" enable="$mark" eval $r=\"$mark\" # compute and propagate a new mark to requires and users case `echo "$enable" | sed -e 's/ .*//' ` in "") echo "problem?"; exit 3;; "yes") check_and_propagate $uplugin "yes" "yes";; "partial") # if a plug-in is partial, does not consider its dependencies as partial # so the second argument is "yes" and not "partial" check_and_propagate \ "$uplugin" \ "yes" \ "yes";; "no") check_and_propagate \ "$uplugin" \ "no ($lplugin not enabled)" \ "partial ($lplugin not enabled)";; esac fi # recursively consider the next plugins if test -n "$TODOLIST"; then compute_dependency; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Makefile.in" >&5 $as_echo_n "checking for Makefile.in... " >&6; } if ${ac_cv_file_Makefile_in+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "Makefile.in"; then ac_cv_file_Makefile_in=yes else ac_cv_file_Makefile_in=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_Makefile_in" >&5 $as_echo "$ac_cv_file_Makefile_in" >&6; } if test "x$ac_cv_file_Makefile_in" = xyes; then : default=yes;plugin_present=yes else plugin_present=no;default=no fi FORCE=no # Check whether --enable-wp was given. if test "${enable_wp+set}" = set; then : enableval=$enable_wp; ENABLE=$enableval;FORCE=$enableval else ENABLE=$default fi if test "$ONLY_KERNEL" = "yes" -a "$FORCE" = "no"; then ENABLE=no fi if test "$plugin_present" = "no" -a "$FORCE" = "yes"; then as_fn_error $? "wp is not available" "$LINENO" 5 fi FORCE_WP=$FORCE PLUGINS_FORCE_LIST=${PLUGINS_FORCE_LIST}" "FORCE_WP ENABLE_WP=$ENABLE NAME_WP=wp if test "$default" = "no" -a "$FORCE" = "no"; then INFO_WP=" (not available by default)" fi echo "wp... $ENABLE" # kept defined for write_plugin_config. A bit ugly, but not more than # usual autoconf stuff. # m4_undefine([PLUGIN_NAME]) # Check whether --enable-wp-coq was given. if test "${enable_wp_coq+set}" = set; then : enableval=$enable_wp_coq; WPCOQ=$enableval else WPCOQ=yes fi REQUIRE_QED=$REQUIRE_QED" "wp REQUIRED_WP=$REQUIRED_WP" "qed REQUIRE_RTEGEN=$REQUIRE_RTEGEN" "wp REQUIRED_WP=$REQUIRED_WP" "rtegen USE_GUI=$USE_GUI" "wp USED_WP=$USED_WP" "gui # Why3 API dependency ###################### # REQUIRE_LIBRARY: library *must* be present in order to build plugins # USE_LIBRARY: better for plugins if library is present, but not required # HAS_LIBRARY: is the library available? REQUIRE_WHY3= USE_WHY3= HAS_WHY3= WHY3_PATH=`ocamlfind query why3 | tr -d '\\r\\n'` echo "Ocamlfind -> using $WHY3_PATH" WHY3PATH_FOR_CONFIGURE=$WHY3_PATH # No need to check the same thing multiple times. # [JS 2009/06/02] sh tests and m4 variables do not mix well together. # It works by chance but it is not robust enough. # Should be rewritten HAS_WHY3=no if test "$HAS_WHY3" != "yes"; then as_ac_File=`$as_echo "ac_cv_file_$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX" >&5 $as_echo_n "checking for $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX existence when cross compiling" "$LINENO" 5 if test -r "$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : HAS_WHY3=yes else HAS_WHY3=no fi if test "$HAS_WHY3" = "yes"; then SELECTED_WHY3=$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX fi fi WHY3=$SELECTED_WHY3 REQUIRE_WHY3=$REQUIRE_WHY3" "wp if test -n "$REQUIRE_WHY3" -o -n "$USE_WHY3" -o "$force_check" = "yes"; then if test "$HAS_WHY3" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX not found." >&5 $as_echo "$as_me: WARNING: $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX not found." >&2;} reason="$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX missing" for p in $REQUIRE_WHY3; do up=`upper "$p"` ep=ENABLE_$up eval enable_p=\$$ep if test "$enable_p" != "no"; then fp=FORCE_`upper "$p"` if eval test "\$$fp" = "yes"; then as_fn_error $? "$p requested but $reason." "$LINENO" 5 fi eval $ep="no\ \(see\ warning\ about\ $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p disabled because $reason." >&5 $as_echo "$as_me: WARNING: $p disabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done for p in $USE_WHY3; do up=`upper "$p"` ep=ENABLE_$up eval eep="\$$ep" if test "`echo $eep | sed -e 's/ .*//' `" != "no"; then eval $ep="partial\ \(see\ warning\ about\ $WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX\)" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $p partially enabled because $reason." >&5 $as_echo "$as_me: WARNING: $p partially enabled because $reason." >&2;} eval INFO_$up=\", $reason\" fi done fi fi # First, initialize some variables for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` TODOLIST=$TODOLIST" "$plugin eval MARK_$plugin= eval REMEMBER_$plugin= fi done # main call compute_dependency # NB: this would deserve to use plugin_requires mechanism if test "$ENABLE_WP" != "no"; then ## Configuring for WP-COQ if test "$WPCOQ" = "yes" ; then # Extract the first word of "coqc", so it can be a program name with args. set dummy coqc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_COQC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$COQC"; then ac_cv_prog_COQC="$COQC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_COQC="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_COQC" && ac_cv_prog_COQC="no" fi fi COQC=$ac_cv_prog_COQC if test -n "$COQC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COQC" >&5 $as_echo "$COQC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$COQC" = "yes" ; then COQVERSION=`coqc -v | sed -n -e 's|.*version* *\([^ ]*\) .*$|\1|p' ` case $COQVERSION in 8.7*|8.8*|8.9*|8.10*|trunk) { $as_echo "$as_me:${as_lineno-$LINENO}: result: coqc version $COQVERSION found" >&5 $as_echo "coqc version $COQVERSION found" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported coqc version $COQVERSION" >&5 $as_echo "unsupported coqc version $COQVERSION" >&6; } COQC="no" ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: rerun configure to make wp using coq 8.7.2 or higher" >&5 $as_echo "$as_me: rerun configure to make wp using coq 8.7.2 or higher" >&6;} fi else COQC="no" fi fi ac_config_files="$ac_config_files ./Makefile" # Compute INFO_* and exported ENABLE_* from previously computed ENABLE_* for fp in ${PLUGINS_FORCE_LIST}; do if test "$fp" != "FORCE_GTKSOURCEVIEW"; then plugin=`echo $fp | sed -e "s/FORCE_\(.*\)/\1/" ` ep=ENABLE_$plugin eval v=\$$ep eval ep_v=`echo $v | sed -e 's/ .*//' ` eval ENABLE_$plugin=$ep_v reason=`echo $v | sed -e 's/[a-z]*\( .*\)/\1/' ` n=NAME_$plugin eval name=\$$n info= if test "$reason" != "$ep_v"; then info=$reason fi { $as_echo "$as_me:${as_lineno-$LINENO}: $name: $ep_v$info" >&5 $as_echo "$as_me: $name: $ep_v$info" >&6;} fi done cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "./Makefile") CONFIG_FILES="$CONFIG_FILES ./Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac case $ac_file$ac_mode in "./Makefile":F) chmod -w ./Makefile ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/configure.ac����������������������������������������������������0000666�0000000�0000000�00000007017�13571573400�016404� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of WP plug-in of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat a l'energie atomique et aux energies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## m4_define([plugin_file],Makefile.in) m4_define([FRAMAC_SHARE_ENV], [m4_normalize(m4_esyscmd([echo $FRAMAC_SHARE]))]) m4_define([FRAMAC_SHARE], [m4_ifval(FRAMAC_SHARE_ENV,[FRAMAC_SHARE_ENV], [m4_esyscmd(frama-c -print-path)])]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)] ) check_plugin(wp,PLUGIN_RELATIVE_PATH(plugin_file),[WP plug-in],yes,yes) AC_ARG_ENABLE( wp-coq, [ --enable-wp-coq Wp precompiled Coq libraries (default: yes)], WPCOQ=$enableval, WPCOQ=yes ) plugin_require(wp,qed) plugin_require(wp,rtegen) plugin_use(wp,gui) # Why3 API dependency ###################### # REQUIRE_LIBRARY: library *must* be present in order to build plugins # USE_LIBRARY: better for plugins if library is present, but not required # HAS_LIBRARY: is the library available? REQUIRE_WHY3= USE_WHY3= HAS_WHY3= WHY3_PATH=`ocamlfind query why3 | tr -d '\\r\\n'` echo "Ocamlfind -> using $WHY3_PATH" WHY3PATH_FOR_CONFIGURE=$WHY3_PATH configure_library([WHY3], [$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX], [$WHY3PATH_FOR_CONFIGURE/why3.$LIB_SUFFIX not found.], no) plugin_require_external(wp,why3) AC_SUBST(HAS_WHY3) check_plugin_dependencies # NB: this would deserve to use plugin_requires mechanism if test "$ENABLE_WP" != "no"; then ## Configuring for WP-COQ if test "$WPCOQ" = "yes" ; then AC_CHECK_PROG(COQC,coqc,yes,no) if test "$COQC" = "yes" ; then COQVERSION=`coqc -v | sed -n -e 's|.*version* *\([[^ ]]*\) .*$|\1|p' ` case $COQVERSION in 8.7*|8.8*|8.9*|8.10*|trunk) AC_MSG_RESULT(coqc version $COQVERSION found) ;; *) AC_MSG_RESULT(unsupported coqc version $COQVERSION) COQC="no" ;; esac else AC_MSG_NOTICE(rerun configure to make wp using coq 8.7.2 or higher) fi else COQC="no" fi AC_SUBST(COQC) fi write_plugin_config(Makefile) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ctypes.ml�������������������������������������������������������0000666�0000000�0000000�00000046212�13571573400�015757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- C-Types --- *) (* -------------------------------------------------------------------------- *) open Cil_types open Cil_datatype module WpLog = Wp_parameters type c_int = | CBool | UInt8 | SInt8 | UInt16 | SInt16 | UInt32 | SInt32 | UInt64 | SInt64 let compare_c_int : c_int -> c_int -> _ = Extlib.compare_basic let signed = function | CBool -> false | UInt8 | UInt16 | UInt32 | UInt64 -> false | SInt8 | SInt16 | SInt32 | SInt64 -> true let i_bits = function | CBool -> 1 | UInt8 | SInt8 -> 8 | UInt16 | SInt16 -> 16 | UInt32 | SInt32 -> 32 | UInt64 | SInt64 -> 64 let i_bytes = function | CBool -> 1 | UInt8 | SInt8 -> 1 | UInt16 | SInt16 -> 2 | UInt32 | SInt32 -> 4 | UInt64 | SInt64 -> 8 let make_c_int signed = function | 1 -> if signed then SInt8 else UInt8 | 2 -> if signed then SInt16 else UInt16 | 4 -> if signed then SInt32 else UInt32 | 8 -> if signed then SInt64 else UInt64 | size -> WpLog.not_yet_implemented "%d-bytes integers" size let is_char = function | UInt8 -> Cil.theMachine.Cil.theMachine.char_is_unsigned | SInt8 -> not Cil.theMachine.Cil.theMachine.char_is_unsigned | UInt16 | SInt16 | UInt32 | SInt32 | UInt64 | SInt64 | CBool -> false let c_int ikind = let mach = Cil.theMachine.Cil.theMachine in match ikind with | IBool -> CBool | IChar -> if mach.char_is_unsigned then UInt8 else SInt8 | ISChar -> SInt8 | IUChar -> UInt8 | IInt -> make_c_int true mach.sizeof_int | IUInt -> make_c_int false mach.sizeof_int | IShort -> make_c_int true mach.sizeof_short | IUShort -> make_c_int false mach.sizeof_short | ILong -> make_c_int true mach.sizeof_long | IULong -> make_c_int false mach.sizeof_long | ILongLong -> make_c_int true mach.sizeof_longlong | IULongLong -> make_c_int false mach.sizeof_longlong let c_bool () = c_int IBool let c_char () = c_int IChar let p_bytes () = Cil.theMachine.Cil.theMachine.sizeof_ptr let p_bits () = 8 * p_bytes () let c_ptr () = make_c_int false (p_bytes ()) let sub_c_int t1 t2 = if (signed t1 = signed t2) then i_bits t1 <= i_bits t2 else (not(signed t1) && (i_bits t1 < i_bits t2)) type c_float = | Float32 | Float64 let compare_c_float : c_float -> c_float -> _ = Extlib.compare_basic let f_bytes = function | Float32 -> 4 | Float64 -> 8 let f_bits = function | Float32 -> 32 | Float64 -> 64 let make_c_float = function | 4 -> Float32 | 8 -> Float64 | size -> WpLog.not_yet_implemented "%d-bits floats" (8*size) let c_float fkind = let mach = Cil.theMachine.Cil.theMachine in match fkind with | FFloat -> make_c_float mach.sizeof_float | FDouble -> make_c_float mach.sizeof_double | FLongDouble -> make_c_float mach.sizeof_longdouble let equal_float f1 f2 = f_bits f1 = f_bits f2 (* Array objects, with both the head view and the flatten view. *) type arrayflat = { arr_size : int ; (* number of elements in the array *) arr_dim : int ; (* number of dimensions in the array *) arr_cell : typ ; (* type of elementary cells of the flatten array *) arr_cell_nbr : int ; (* number of elementary cells in the flatten array *) } type arrayinfo = { arr_element : typ ; (* type of the elements of the array *) arr_flat : arrayflat option; } (* Type of variable, inits, field or assignable values. *) type c_object = | C_int of c_int | C_float of c_float | C_pointer of typ | C_comp of compinfo | C_array of arrayinfo (* -------------------------------------------------------------------------- *) (* --- Memoization --- *) (* -------------------------------------------------------------------------- *) let idx = function | UInt8 -> 0 | SInt8 -> 1 | UInt16 -> 2 | SInt16 -> 3 | UInt32 -> 4 | SInt32 -> 5 | UInt64 -> 6 | SInt64 -> 7 | CBool -> 8 let i_memo f = let m = Array.make 9 None in fun i -> let k = idx i in match m.(k) with | Some r -> r | None -> let r = f i in m.(k) <- Some r ; r let fdx = function | Float32 -> 0 | Float64 -> 1 let f_memo f = let m = Array.make 2 None in fun z -> let k = fdx z in match m.(k) with | Some r -> r | None -> let r = f z in m.(k) <- Some r ; r let i_iter f = List.iter f [CBool;UInt8;SInt8;UInt16;SInt16;UInt32;SInt32;UInt64;SInt64] let f_iter f = List.iter f [Float32;Float64] (* -------------------------------------------------------------------------- *) (* --- Bounds --- *) (* -------------------------------------------------------------------------- *) let i_bounds i = if signed i then let m = Integer.two_power_of_int (i_bits i - 1) in Integer.neg m , Integer.pred m else let m = Integer.two_power_of_int (i_bits i) in Integer.zero , Integer.pred m let bounds i = i_memo i_bounds i (* -------------------------------------------------------------------------- *) (* --- Pretty Printers --- *) (* -------------------------------------------------------------------------- *) let pp_int fmt i = if i = CBool then Format.pp_print_string fmt "bool" else Format.fprintf fmt "%cint%d" (if signed i then 's' else 'u') (i_bits i) let pp_float fmt f = Format.fprintf fmt "float%d" (f_bits f) let pp_object fmt = function | C_int i -> pp_int fmt i | C_float f -> pp_float fmt f | C_pointer _ -> Format.pp_print_string fmt "obj-pointer" | C_comp _ -> Format.pp_print_string fmt "obj-struct/union" | C_array _ -> Format.pp_print_string fmt "obj-array" (* -------------------------------------------------------------------------- *) (* --- Array Info --- *) (* -------------------------------------------------------------------------- *) let char c = Integer.to_int64 (Cil.charConstToInt c) let constant e = match (Cil.constFold true e).enode with | Const(CInt64(k,_,_)) -> Integer.to_int64 k | _ -> WpLog.fatal "Non-constant expression (%a)" Printer.pp_exp e let get_int e = match (Cil.constFold true e).enode with | Const(CInt64(k,_,_)) -> Some (Integer.to_int k) | _ -> None let get_int64 e = match (Cil.constFold true e).enode with | Const(CInt64(k,_,_)) -> Some (Integer.to_int64 k) | _ -> None let dimension t = let rec flat k d = function | TNamed (r,_) -> flat k d r.ttype | TArray(ty,Some e,_,_) -> flat (succ k) (Int64.mul d (constant e)) ty | te -> k , d , te in flat 1 Int64.one t (* -------------------------------------------------------------------------- *) (* --- Value State_builder. --- *) (* -------------------------------------------------------------------------- *) let is_pointer = function | C_pointer _ -> true | C_int _ | C_float _ | C_array _ | C_comp _ -> false let rec object_of typ = match typ with | TInt(i,_) -> C_int (c_int i) | TFloat(f,_) -> C_float (c_float f) | TPtr(typ,_) -> C_pointer (if Cil.isVoidType typ then Cil.charType else typ) | TFun _ -> C_pointer Cil.voidType | TEnum ({ekind=i},_) -> C_int (c_int i) | TComp (comp,_,_) -> C_comp comp | TArray (typ_elt,e_opt,_,_) -> begin match e_opt with | None -> C_array { arr_element = typ_elt; arr_flat = None; } | Some e -> let dim,ncells,ty_cell = dimension typ in C_array { arr_element = typ_elt ; arr_flat = Some { arr_size = Int64.to_int (constant e) ; arr_dim = dim ; arr_cell = ty_cell ; arr_cell_nbr = Int64.to_int (ncells) ; } } end | TBuiltin_va_list _ -> WpLog.warning ~current:true ~once:true "variadyc type (considered as void*)" ; C_pointer (TVoid []) | TVoid _ -> WpLog.warning ~current:true "void object" ; C_int (c_int IInt) | TNamed (r,_) -> object_of r.ttype (* ------------------------------------------------------------------------ *) (* --- Comparable --- *) (* ------------------------------------------------------------------------ *) let hsh = ref (fun _ -> assert false) (* Recursive call to hash *) let cmp = ref (fun _ _ -> assert false) (* Recursive call to compare *) module AinfoComparable = struct type t = arrayinfo let hash a = !hsh (object_of a.arr_element) let equal a b = let obj_a = object_of a.arr_element in let obj_b = object_of b.arr_element in (!cmp obj_a obj_b = 0) && (match a.arr_flat , b.arr_flat with | Some a , Some b -> a.arr_size = b.arr_size | None , None -> true | _ -> false) let compare a b = let obj_a = object_of a.arr_element in let obj_b = object_of b.arr_element in let c = !cmp obj_a obj_b in if c <> 0 then c else match a.arr_flat , b.arr_flat with | Some a , Some b -> Transitioning.Stdlib.compare a.arr_size b.arr_size | None , Some _ -> (-1) | Some _ , None -> 1 | None , None -> 0 end let hash = function | C_int _ -> 3 | C_float _ -> 5 | C_pointer _ -> 7 | C_comp c -> 11 * Compinfo.hash c | C_array a -> 13 * AinfoComparable.hash a let equal a b = match a,b with | C_int i, C_int i' -> i=i' | C_float f , C_float f' -> f=f' | C_pointer te , C_pointer te' -> Typ.equal te te' | C_comp c , C_comp c' -> Compinfo.equal c c' | C_array a , C_array a' -> AinfoComparable.equal a a' | _ -> false let compare a b = if a==b then 0 else match a,b with | C_int i, C_int i' -> compare_c_int i i' | C_int _ , _ -> (-1) | _ , C_int _ -> 1 | C_float f , C_float f' -> compare_c_float f f' | C_float _ , _ -> (-1) | _ , C_float _ -> 1 | C_pointer te , C_pointer te' -> Typ.compare te te' | C_pointer _ , _ -> (-1) | _ , C_pointer _ -> 1 | C_comp c , C_comp c' -> Compinfo.compare c c' | C_comp _ , _ -> (-1) | _ , C_comp _ -> 1 | C_array a , C_array a' -> AinfoComparable.compare a a' let () = begin hsh := hash ; cmp := compare ; end (* -------------------------------------------------------------------------- *) (* --- Accessor Utilities --- *) (* -------------------------------------------------------------------------- *) let object_of_pointed = function C_int _ | C_float _ | C_comp _ as o -> Wp_parameters.fatal "object_of_pointed called on non-pointer %a@." pp_object o | C_array info -> object_of info.arr_element | C_pointer typ -> object_of typ let object_of_array_elem = function | C_array arr -> object_of arr.arr_element | o -> Wp_parameters.fatal ~current:true "object_of_array_elem called on non-array %a." pp_object o let rec object_of_logic_type t = match Logic_utils.unroll_type ~unroll_typedef:false t with | Ctype ty -> object_of ty | Ltype({lt_name="set"},[t]) -> object_of_logic_type t | t -> Wp_parameters.fatal ~current:true "@[<hov 2>c-object of logic type@ (%a)@]" Printer.pp_logic_type t let rec object_of_logic_pointed t = match Logic_utils.unroll_type ~unroll_typedef:false t with | Ctype ty -> object_of_pointed (object_of ty) | Ltype({lt_name="set"},[t]) -> object_of_logic_pointed t | t -> Wp_parameters.fatal ~current:true "@[<hov 2>pointed of logic type@ (%a)@]" Printer.pp_logic_type t let rec array_dimensions a = let te = object_of a.arr_element in let d = match a.arr_flat with None -> None | Some f -> Some f.arr_size in match te with | C_array a -> let te,ds = array_dimensions a in te , d::ds | _ -> te , [d] let dimension_of_object = function | C_int _ | C_float _ | C_pointer _ | C_comp _ | C_array { arr_flat=None } -> None | C_array { arr_flat=Some a } -> Some (a.arr_dim , a.arr_cell_nbr) let no_infinite_array = function | C_array {arr_flat = None} -> false | _ -> true let is_comp obj c = match obj with | C_comp c0 -> Compinfo.equal c c0 | _ -> false let is_array obj ~elt = match obj with | C_array { arr_element = e } -> equal (object_of e) elt | _ -> false let array_size = function | { arr_flat = Some { arr_size=s } } -> Some s | { arr_flat = None } -> if Wp_parameters.ExternArrays.get () then Some max_int else None let get_array_size = function | C_array a -> array_size a | _ -> None let get_array_dim = function | C_array { arr_flat=Some a } -> a.arr_dim | C_array _ -> 1 | _ -> 0 let get_array = function | C_array a -> Some( object_of a.arr_element, array_size a ) | _ -> None (* -------------------------------------------------------------------------- *) (* --- Sizeof --- *) (* -------------------------------------------------------------------------- *) let sizeof_defined = function | C_array { arr_flat = None } -> false | _ -> true let typ_comp cinfo = TComp(cinfo,Cil.empty_size_cache(),[]) let bits_sizeof_comp cinfo = Cil.bitsSizeOf (typ_comp cinfo) let bits_sizeof_array ainfo = match ainfo.arr_flat with | Some a -> let csize = Cil.integer ~loc:Cil.builtinLoc a.arr_cell_nbr in let ctype = TArray(a.arr_cell,Some csize,Cil.empty_size_cache(),[]) in Cil.bitsSizeOf ctype | None -> if WpLog.ExternArrays.get () then max_int else WpLog.fatal ~current:true "Sizeof unknown-size array" let sizeof_object = function | C_int i -> i_bytes i | C_float f -> f_bytes f | C_pointer _ty -> p_bytes () | C_comp cinfo -> bits_sizeof_comp cinfo / 8 | C_array ainfo -> bits_sizeof_array ainfo / 8 let bits_sizeof_object = function | C_int i -> i_bits i | C_float f -> f_bits f | C_pointer _ty -> p_bits () | C_comp cinfo -> bits_sizeof_comp cinfo | C_array ainfo -> bits_sizeof_array ainfo let field_offset fd = if fd.fcomp.cstruct then (* C struct *) let ctype = TComp(fd.fcomp,Cil.empty_size_cache(),[]) in let offset = Field(fd,NoOffset) in fst (Cil.bitsOffset ctype offset) / 8 else (* CIL invariant: all C union fields start at offset 0 *) 0 (* Conforms to C-ISO 6.3.1.8 *) (* If same sign => greater rank. *) (* If different: *) (* Case 1: *) (* rank(unsigned) >= rank(signed) *) (* then convert to unsigned *) (* Case 2: *) (* domain(unsigned) contains *) (* domain(signed) *) (* then convert to signed *) (* Otherwise: *) (* both are converted to unsigned *) (* *) (* Case 2 is actually the negative *) (* of Case 1, and both simplifies *) (* into converting to the operand *) (* with greater rank, whatever *) (* their sign. *) let i_convert t1 t2 = if i_bits t1 < i_bits t2 then t2 else t1 let f_convert t1 t2 = if f_bits t1 < f_bits t2 then t2 else t1 let promote a1 a2 = match a1 , a2 with | C_int i1 , C_int i2 -> C_int (i_convert i1 i2) | C_float f1 , C_float f2 -> C_float (f_convert f1 f2) | C_int _ , C_float _ -> a2 | C_float _ , C_int _ -> a1 | _ -> WpLog.not_yet_implemented "promotion between arithmetics and pointer types" let rec basename = function | C_int i -> Format.asprintf "%a" pp_int i | C_float f -> Format.asprintf "%a" pp_float f | C_pointer _ -> "pointer" | C_comp c -> c.cname | C_array a -> let te = basename (object_of a.arr_element) in match a.arr_flat with | None -> te ^ "_array" | Some f -> te ^ "_" ^ string_of_int f.arr_size let is_atomic = function | TVoid _ | TInt _ | TFloat _ | TNamed _ -> true | _ -> false let rec pretty fmt = function | C_int i -> pp_int fmt i | C_float f -> pp_float fmt f | C_comp c -> Format.pp_print_string fmt c.cname | C_pointer ty -> if is_atomic ty then Format.fprintf fmt "%a*" Printer.pp_typ ty else Format.fprintf fmt "(%a)*" Printer.pp_typ ty | C_array a -> let te = object_of a.arr_element in match a.arr_flat with | None -> Format.fprintf fmt "%a[]" pretty te | Some f -> Format.fprintf fmt "%a[%d]" pretty te f.arr_size module C_object = Datatype.Make(struct type t = c_object let name = "Ctypes.C_object" let rehash = Datatype.Undefined.rehash let structural_descr = Datatype.Undefined.structural_descr let reprs = [C_int UInt8] let equal = equal let pretty = pretty let hash = hash let compare = compare let copy = Datatype.Undefined.copy let internal_pretty_code = Datatype.Undefined.internal_pretty_code let mem_project = Datatype.Undefined.mem_project let varname _ = "co" end) let rec compare_ptr_conflated a b = if a==b then 0 else match a,b with | C_int i, C_int i' -> compare_c_int i i' | C_int _ , _ -> (-1) | _ , C_int _ -> 1 | C_float f , C_float f' -> compare_c_float f f' | C_float _ , _ -> (-1) | _ , C_float _ -> 1 | C_pointer _ , C_pointer _ -> 0 | C_pointer _ , _ -> (-1) | _ , C_pointer _ -> 1 | C_comp c , C_comp c' -> Compinfo.compare c c' | C_comp _ , _ -> (-1) | _ , C_comp _ -> 1 | C_array a , C_array a' -> compare_array_ptr_conflated a a' and compare_array_ptr_conflated a b = let obj_a = object_of a.arr_element in let obj_b = object_of b.arr_element in let c = compare_ptr_conflated obj_a obj_b in if c <> 0 then c else match a.arr_flat , b.arr_flat with | Some a , Some b -> Transitioning.Stdlib.compare a.arr_size b.arr_size | None , Some _ -> (-1) | Some _ , None -> 1 | None , None -> 0 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/ctypes.mli������������������������������������������������������0000666�0000000�0000000�00000013672�13571573400�016134� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** C-Types *) (* -------------------------------------------------------------------------- *) open Cil_types (** Runtime integers. *) type c_int = | CBool | UInt8 | SInt8 | UInt16 | SInt16 | UInt32 | SInt32 | UInt64 | SInt64 (** Runtime floats. *) type c_float = | Float32 | Float64 (** Array objects, with both the head view and the flatten view. *) type arrayflat = { arr_size : int ; (** number of elements in the array *) arr_dim : int ; (** number of dimensions in the array *) arr_cell : typ ; (** type of elementary cells of the flatten array. Never an array. *) arr_cell_nbr : int ; (** number of elementary cells in the flatten array *) } type arrayinfo = { arr_element : typ ; (** type of the elements of the array *) arr_flat : arrayflat option; } (** Type of variable, inits, field or assignable values. Abstract view of unrolled C types without attribute. *) type c_object = | C_int of c_int | C_float of c_float | C_pointer of typ | C_comp of compinfo | C_array of arrayinfo val object_of_pointed: c_object -> c_object val object_of_array_elem : c_object -> c_object val object_of_logic_type : logic_type -> c_object val object_of_logic_pointed : logic_type -> c_object (** {2 Utilities} *) val i_iter: (c_int -> unit) -> unit val f_iter: (c_float -> unit) -> unit val i_memo : (c_int -> 'a) -> c_int -> 'a (** memoized, not-projectified *) val f_memo : (c_float -> 'a) -> c_float -> 'a (** memoized, not-projectified *) val is_char : c_int -> bool val c_char : unit -> c_int (** Returns the type of [char] *) val c_bool : unit -> c_int (** Returns the type of [int] *) val c_ptr : unit -> c_int (** Returns the type of pointers *) val c_int : ikind -> c_int (** Conforms to {Cil.theMachine} *) val c_float : fkind -> c_float (** Conforms to {Cil.theMachine} *) val object_of : typ -> c_object val is_pointer : c_object -> bool val char : char -> int64 val constant : exp -> int64 val get_int : exp -> int option val get_int64 : exp -> int64 option val signed : c_int -> bool (** [true] if signed *) val bounds: c_int -> Integer.t * Integer.t (** domain, bounds included *) val i_bits : c_int -> int (** size in bits *) val i_bytes : c_int -> int (** size in bytes *) val f_bits : c_float -> int (** size in bits *) val f_bytes : c_float -> int (** size in bytes *) val p_bits : unit -> int (** pointer size in bits *) val p_bytes : unit -> int (** pointer size in bits *) val sub_c_int: c_int -> c_int -> bool val equal_float : c_float -> c_float -> bool val sizeof_defined : c_object -> bool val sizeof_object : c_object -> int val bits_sizeof_comp : compinfo -> int val bits_sizeof_array : arrayinfo -> int val bits_sizeof_object : c_object -> int val field_offset : fieldinfo -> int val no_infinite_array : c_object -> bool val is_comp : c_object -> compinfo -> bool val is_array : c_object -> elt:c_object -> bool val get_array : c_object -> ( c_object * int option ) option val get_array_size : c_object -> int option val get_array_dim : c_object -> int val array_size : arrayinfo -> int option val array_dimensions : arrayinfo -> c_object * int option list (** Returns the list of dimensions the array consists of. None-dimension means undefined one. *) val dimension_of_object : c_object -> (int * int) option (** Returns None for 1-dimension objects, and Some(d,N) for d-matrix with N cells *) val i_convert : c_int -> c_int -> c_int val f_convert : c_float -> c_float -> c_float val promote : c_object -> c_object -> c_object val pp_int : Format.formatter -> c_int -> unit val pp_float : Format.formatter -> c_float -> unit val pp_object : Format.formatter -> c_object -> unit val basename : c_object -> string val compare : c_object -> c_object -> int val equal : c_object -> c_object -> bool val hash : c_object -> int val pretty : Format.formatter -> c_object -> unit module C_object: Datatype.S with type t = c_object module AinfoComparable : sig type t = arrayinfo val compare : t -> t -> int val equal : t -> t -> bool val hash : t -> int end val compare_c_int : c_int -> c_int -> int val compare_c_float : c_float -> c_float -> int val compare_ptr_conflated : c_object -> c_object -> int (** same as {!compare} but all PTR are considered the same *) ����������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/driver.mli������������������������������������������������������0000666�0000000�0000000�00000003761�13571573400�016116� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Driver for External Files --- *) (* -------------------------------------------------------------------------- *) val load_driver : unit -> LogicBuiltins.driver (** Memoized loading of drivers according to current WP options. Finally sets [LogicBuiltins.driver] and returns it. *) ���������������frama-c-20.0-Calcium/src/plugins/wp/driver.mll������������������������������������������������������0000666�0000000�0000000�00000043373�13571573400�016124� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- External Driver --- *) (* -------------------------------------------------------------------------- *) { open Qed.Logic open Lexing open Cil_types open LogicBuiltins type bal = [ `Default | `Left | `Right | `Nary ] type token = | EOF | KEY of string | BOOLEAN | INTEGER | REAL | INT of ikind | FLT of fkind | KIND of kind | ID of string | LINK of string | RECLINK of (string * (string * bal)) list | FIELD of string * string let keywords = [ "library" , KEY "library" ; "type" , KEY "type" ; "ctor" , KEY "ctor" ; "logic" , KEY "logic" ; "predicate" , KEY "predicate" ; "boolean" , BOOLEAN ; "integer" , INTEGER ; "real" , REAL ; "char" , INT IChar ; "short" , INT IShort ; "int" , INT IInt ; "unsigned" , INT IUInt ; "float" , FLT FFloat ; "float32" , KIND (F Ctypes.Float32) ; "float64" , KIND (F Ctypes.Float64) ; "double" , FLT FDouble ; ] let ident x = try List.assoc x keywords with Not_found -> ID x let newline lexbuf = lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with pos_lnum = succ lexbuf.lex_curr_p.pos_lnum } let rec conv_bal default (name,bal) = match bal with | `Default -> conv_bal default (name,default) | `Left -> Qed.Engine.F_left name | `Right -> Qed.Engine.F_right name | `Nary -> if Qed.Plib.is_template name then Qed.Engine.F_subst name else Qed.Engine.F_call name } let blank = [ ' ' '\t' '\r' ] let ident = '\\'? [ 'a'-'z' 'A'-'Z' '_' '0'-'9' ]+ rule tok = parse eof { EOF } | '\n' { newline lexbuf ; tok lexbuf } | blank+ { tok lexbuf } | "//" [^ '\n']* '\n' { newline lexbuf ; tok lexbuf } | "/*" { comment lexbuf } | ident as a { ident a } | '"' { LINK (string_val (Buffer.create 10) lexbuf) } | '{' { RECLINK(reclink [] lexbuf) } | (ident as group) '.' (ident as var) { FIELD(group,var) } | _ | ":=" | "+=" { KEY (Lexing.lexeme lexbuf) } and comment = parse | eof { failwith "Unterminated comment" } | "*/" { tok lexbuf } | '\n' { newline lexbuf ; comment lexbuf } | _ { comment lexbuf } and value = parse | '\n' { newline lexbuf ; value lexbuf } | blank+ { value lexbuf } | ident as a { a } | '"' { string_val (Buffer.create 10) lexbuf } | _ { failwith "Ident or String expected" } and string_val buf = parse | '"' { Buffer.contents buf;} | [^ '\\' '"'] as c { Buffer.add_char buf c; string_val buf lexbuf } | '\\' (['\\' '"' 'n' 'r' 't'] as c) { Buffer.add_char buf (match c with 'n' -> '\n' | 'r' -> '\r' | 't' -> '\t' | _ -> c); string_val buf lexbuf } | '\\' '\n' { string_val buf lexbuf } | '\\' (_ as c) { Buffer.add_char buf '\\'; Buffer.add_char buf c; string_val buf lexbuf } | eof { failwith "Unterminated string" } and recstring acc = parse | ';' | blank+ { recstring acc lexbuf } | '\n' { newline lexbuf ; recstring acc lexbuf } | '}' { acc } | ident as field { recstring_bis acc field lexbuf } | _ { failwith "Identifier or '}' expected" } and recstring_bis acc field = parse | blank+ { recstring_bis acc field lexbuf } | '\n' { newline lexbuf ; recstring_bis acc field lexbuf } | '=' { recstring_ter acc field lexbuf } | _ { failwith "'=' expected" } and recstring_ter acc field = parse | blank+ { recstring_ter acc field lexbuf } | '\n' { newline lexbuf ; recstring_ter acc field lexbuf } | ident as name { recstring ((field,name)::acc) lexbuf } | '"' { let name = string_val (Buffer.create 10) lexbuf in recstring ((field,name)::acc) lexbuf } | _ { failwith "Identifier or String expected" } and recorstring = parse | '\n' { newline lexbuf ; recorstring lexbuf } | blank+ { recorstring lexbuf } | '"' { `String (string_val (Buffer.create 10) lexbuf) } | '{' { `RecString (recstring [] lexbuf) } | _ as c { failwith (Printf.sprintf "found '%c' instead of \" or {" c) } and reclink acc = parse | ';' | blank+ { reclink acc lexbuf } | '\n' { newline lexbuf ; reclink acc lexbuf } | '}' { acc } | ident as field { reclink_bis acc field lexbuf } | _ { failwith "Identifier or '}' expected" } and reclink_bis acc field = parse | blank+ { reclink_bis acc field lexbuf } | '\n' { newline lexbuf ; reclink_bis acc field lexbuf } | '=' { reclink_ter acc field lexbuf } | _ { failwith "'=' expected" } and reclink_ter acc field = parse | blank+ { reclink_ter acc field lexbuf } | '\n' { newline lexbuf ; reclink_ter acc field lexbuf } | ident as name { let link = name,(bal lexbuf) in reclink ((field,link)::acc) lexbuf } | '"' { let name = string_val (Buffer.create 10) lexbuf in let link = name,(bal lexbuf) in reclink ((field,link)::acc) lexbuf } | _ { failwith "Identifier or String expected" } and bal = parse | '\n' { newline lexbuf ; bal lexbuf } | blank+ { bal lexbuf } | ('(' "right" ')') { `Right } | ('(' "nary" ')') { `Nary } | ('(' "left" ')')? as c { if c = "" then `Default else `Left } { let pretty fmt = function | EOF -> Format.pp_print_string fmt "<eof>" | KEY a | ID a -> Format.fprintf fmt "'%s'" a | LINK s -> Format.fprintf fmt "\"%s\"" s | BOOLEAN | INTEGER | REAL | INT _ | FLT _ | KIND _ -> Format.pp_print_string fmt "<type>" | FIELD(group,name) -> Format.fprintf fmt "%s.%s" group name | RECLINK _ -> Format.pp_print_string fmt "<reclink>" type input = { lexbuf : Lexing.lexbuf ; mutable position : Lexing.position ; mutable current : token ; } let skip input = if input.current <> EOF then begin input.position <- input.lexbuf.lex_curr_p ; input.current <- tok input.lexbuf ; end let token input = input.current let source input = input.position let value input = if input.current = EOF then failwith "Value expected" else let v = value input.lexbuf in skip input; v let key input a = match token input with | KEY b when a=b -> skip input ; true | _ -> false let skipkey input a = match token input with | KEY b when a=b -> skip input | _ -> failwith (Printf.sprintf "Missing '%s'" a) let noskipkey input a = match token input with | KEY b when a=b -> () | _ -> failwith (Printf.sprintf "Missing '%s'" a) let ident input = match token input with | ID x | LINK x -> skip input ; x | _ -> failwith "missing identifier" let kind input = let kd = match token input with | INTEGER -> Z | REAL -> R | BOOLEAN -> A | INT i -> I (Ctypes.c_int i) | FLT f -> F (Ctypes.c_float f) | KIND x -> x | ID _ -> A | _ -> failwith "<type> expected" in skip input ; kd let parameter input = let k = kind input in match token input with | ID _ -> skip input ; k | _ -> k let rec parameters input = if key input ")" then [] else let p = parameter input in if key input "," then p :: parameters input else if key input ")" then [p] else failwith "Missing ',' or ')'" let signature input = if key input "(" then parameters input else [] let rec depend input = match token input with | ID a | LINK a -> skip input ; ignore (key input ",") ; a :: depend input | _ -> [] let link def input = match token input with | LINK f | ID f -> let link = conv_bal def (f,(bal input.lexbuf)) in skip input; Lang.infoprover link | RECLINK l -> skip input ; begin try {Lang.altergo = conv_bal def (List.assoc "altergo" l); why3 = conv_bal def (List.assoc "why3" l); coq = conv_bal def (List.assoc "coq" l) } with Not_found -> failwith "a link must contain an entry for 'altergo', 'why3' and 'coq'" end | _ -> failwith "Missing link symbol" let linkstring input = match recorstring input.lexbuf with | `String f -> skip input ; Lang.infoprover f | `RecString l -> skip input ; begin try {Lang.altergo = List.assoc "altergo" l; why3 = List.assoc "why3" l; coq = List.assoc "coq" l } with Not_found -> failwith "a link must contain an entry for 'altergo', 'why3' and 'coq'" end | _ -> failwith "Missing link symbol" let input_string input = match token input with | LINK f | ID f -> skip input ; f | _ -> failwith "String or ident expected" let op = { invertible = false ; associative = false ; commutative = false ; idempotent = false ; neutral = E_none ; absorbant = E_none ; } let op_elt input = ignore (key input ":") ; let op = input_string input in skipkey input ":" ; match op with | "0" -> E_int 0 | "1" -> E_int 1 | "-1" -> E_int (-1) | "\\true" -> E_true | "\\false" -> E_false | _ -> match LogicBuiltins.constant op with | ACSLDEF -> failwith (Printf.sprintf "Symbol '%s' not found" op) | HACK _ -> failwith (Printf.sprintf "Symbol '%s' hacked" op) | LFUN lfun -> E_fun(lfun,[]) let rec op_link op input = match token input with | LINK _ | RECLINK _ -> Operator op, link `Left input | ID "associative" -> skip input ; skipkey input ":" ; op_link { op with associative = true } input | ID "commutative" -> skip input ; skipkey input ":" ; op_link { op with commutative = true } input | ID "ac" -> skip input ; skipkey input ":" ; op_link { op with commutative = true ; associative = true } input | ID "idempotent" -> skip input ; skipkey input ":" ; op_link { op with idempotent = true } input | ID "invertible" -> skip input ; skipkey input ":" ; op_link { op with invertible = true } input | ID "neutral" -> skip input ; let e = op_elt input in op_link { op with neutral = e } input | ID "absorbant" -> skip input ; let e = op_elt input in op_link { op with absorbant = e } input | ID t -> failwith (Printf.sprintf "Unknown tag '%s'" t) | _ -> failwith "Missing <tag> or <link>" let logic_link input = match token input with | LINK _ | RECLINK _ -> Function, link `Nary input | ID "constructor" -> skip input ; skipkey input ":" ; Qed.Logic.Constructor, link `Nary input | ID "injective" -> skip input ; skipkey input ":" ; Injection, link `Nary input | _ -> op_link op input let rec parse ~driver_dir library input = match token input with | EOF -> () | KEY "library" -> skip input ; let name = input_string input in ignore (key input ":") ; let depends = depend input in ignore (key input ";") ; add_library name depends ; parse ~driver_dir name input | KEY "type" -> skip input ; let name = ident input in let source = source input in noskipkey input "=" ; let link = linkstring input in add_type ~source:(Cil_datatype.Position.of_lexing_pos source) name ~library ~link () ; skipkey input ";" ; parse ~driver_dir library input | KEY "ctor" -> skip input ; let name = ident input in let source = source input in let args = signature input in skipkey input "=" ; let link = link `Nary input in add_ctor ~source:(Cil_datatype.Position.of_lexing_pos source) name args ~library ~link () ; skipkey input ";" ; parse ~driver_dir library input | KEY "logic" -> skip input ; let result = kind input in let name = ident input in let source = source input in let args = signature input in if key input ":=" then begin let alias = ident input in add_alias ~source:(Cil_datatype.Position.of_lexing_pos source) name args ~alias () ; end else begin skipkey input "=" ; let category,link = logic_link input in add_logic ~source:(Cil_datatype.Position.of_lexing_pos source) result name args ~library ~category ~link () ; end ; skipkey input ";" ; parse ~driver_dir library input | KEY "predicate" -> skip input ; let name = ident input in let source = source input in let args = signature input in if key input ":=" then begin let alias = ident input in add_alias ~source:(Cil_datatype.Position.of_lexing_pos source) name args ~alias () ; end else begin noskipkey input "=" ; let link = linkstring input in add_predicate ~source:(Cil_datatype.Position.of_lexing_pos source) name args ~library ~link () ; end ; skipkey input ";" ; parse ~driver_dir library input | FIELD (group,var) -> skip input ; begin match token input with | KEY ":=" -> let v = value input in set_option ~driver_dir group var ~library v | KEY "+=" -> let v = value input in add_option ~driver_dir group var ~library v | _ -> failwith "Missing ':=' or '+='" end; skipkey input ";" ; parse ~driver_dir library input | _ -> failwith "Unexpected entry" let load_file ?(ontty=`Transient) file = try let path = Datatype.Filepath.of_string file in Wp_parameters.feedback ~ontty "Loading driver '%a'" Datatype.Filepath.pretty path; let driver_dir = Filename.dirname file in let inc = open_in file in let lex = Lexing.from_channel inc in let position = { lex.Lexing.lex_curr_p with Lexing.pos_fname = file } in let input = { current = tok lex ; position = position ; lexbuf = lex } in try lex.Lexing.lex_curr_p <- position ; parse ~driver_dir "qed" input ; close_in inc with Failure msg -> close_in inc ; let source = lex.Lexing.lex_start_p in Wp_parameters.abort ~current:false ~source:(Cil_datatype.Position.of_lexing_pos source) "(Driver Error) %s (at %a)" msg pretty (token input) with exn -> Wp_parameters.abort ~current:false "Error in driver '%s': %s" file (Printexc.to_string exn) (*TODO[LC] Think about projectification ... *) let dkey = Wp_parameters.register_category "includes" let dkey_driver = Wp_parameters.register_category "driver" let loaded : (string list, driver) Hashtbl.t =Hashtbl.create 10 let load_driver () = let drivers = Wp_parameters.Drivers.get () in begin try let driver = Hashtbl.find loaded drivers in Context.set LogicBuiltins.driver driver with Not_found -> let driver_basename file = let base = Filename.basename file in try Filename.chop_extension base with Invalid_argument _ -> base in let drvs = List.map driver_basename drivers in let id = String.concat "_" drvs in let descr = String.concat "," drvs in let includes = let directories = try [Wp_parameters.Share.dir ~error:false ()] with Wp_parameters.Share.No_dir -> [] in if Wp_parameters.has_dkey dkey then Wp_parameters.debug ~dkey "Included directories:%t" (fun fmt -> List.iter (fun d -> Format.fprintf fmt "@\n - '%s'" d) directories ); directories in LogicBuiltins.init ~id ~descr ~includes () ; let drivers = List.map (fun file -> if Sys.file_exists file then Filepath.normalize file else LogicBuiltins.find_lib file) drivers in let default = Wp_parameters.Share.file ~error:true "wp.driver" in let feedback = Wp_parameters.Share.Dir_name.is_set () in let ontty = if feedback then `Message else `Transient in load_file ~ontty default; List.iter load_file drivers; Hashtbl.add loaded drivers (Context.get LogicBuiltins.driver); if Wp_parameters.has_dkey dkey_driver then LogicBuiltins.dump () end ; Context.get LogicBuiltins.driver } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/dyncall.ml������������������������������������������������������0000666�0000000�0000000�00000023567�13571573400�016106� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil open Cil_types open Logic_typing open Logic_ptree open Cil_datatype let dkey_calls = Wp_parameters.register_category "calls" (* -------------------------------------------------------------------------- *) (* --- Typing --- *) (* -------------------------------------------------------------------------- *) let find_call env loc f = try env.find_var f with Not_found -> env.error loc "Unknown function '%s'" f let typecheck ~typing_context ~loc ps = ignore loc ; let fs = List.map (fun p -> let loc = p.lexpr_loc in match p.lexpr_node with | PLvar f -> let fv = find_call typing_context loc f in Logic_const.term ~loc (TLval(TVar fv,TNoOffset)) fv.lv_type | _ -> typing_context.error loc "Function name expected for calls" ) ps in Ext_terms fs (* -------------------------------------------------------------------------- *) (* --- Recover --- *) (* -------------------------------------------------------------------------- *) let get_call t = match t.term_node with | TLval (TVar { lv_origin = Some v } , TNoOffset ) -> Globals.Functions.get v | _ -> raise Not_found let get_calls ecmd bhvs : (string * Kernel_function.t list) list = List.fold_right (fun bhv calls -> let fs = ref [] in List.iter (function | {ext_name; ext_kind = Ext_terms ts} when ext_name = ecmd -> fs := !fs @ List.map get_call ts | _ -> ()) bhv.Cil_types.b_extended ; let fs = !fs in if fs <> [] then (bhv.Cil_types.b_name , fs) :: calls else calls ) bhvs [] let pp_calls fmt calls = List.iter (fun kf -> Format.fprintf fmt "@ %a" Kernel_function.pretty kf) calls (* -------------------------------------------------------------------------- *) (* --- Dynamic Calls --- *) (* -------------------------------------------------------------------------- *) module PInfo = struct let module_name = "Dyncall.Point" end module Point = Datatype.Pair_with_collections(Datatype.String)(Stmt)(PInfo) module Calls = Datatype.Pair(Property)(Datatype.List(Kernel_function)) module CInfo = struct let name = "Dyncall.CallPoints" let dependencies = [Ast.self] let size = 63 end module CallPoints = State_builder.Hashtbl(Point.Hashtbl)(Calls)(CInfo) let property ~kf ~bhv ~stmt calls = let fact = if bhv = Cil.default_behavior_name then Format.asprintf "@[<hov 2>call point%a@]" pp_calls calls else Format.asprintf "@[<hov 2>call point%a for %s@]" pp_calls calls bhv in Property.(ip_other fact (OLStmt (kf,stmt))) (* -------------------------------------------------------------------------- *) (* --- Detection --- *) (* -------------------------------------------------------------------------- *) let emitter = Emitter.create "Wp.Dyncall" [ Emitter.Property_status ] ~correctness:[] ~tuning:[ Wp_parameters.DynCall.parameter ] class dyncall = object(self) inherit Visitor.frama_c_inplace val mutable count = 0 val mutable scope = [] val block_calls = Stack.create () method count = count method private kf = match self#current_kf with None -> assert false | Some kf -> kf method private stmt = match self#current_stmt with None -> assert false | Some stmt -> stmt method! vfunc _ = scope <- [] ; DoChildren method! vcode_annot ca = match ca.annot_content with | Cil_types.AExtended (bhvs, _, ({ext_name = "calls"; ext_kind = Ext_terms calls} as extended)) -> if calls <> [] && (scope <> [] || not (Stack.is_empty block_calls)) then begin let bhvs = match bhvs with | [] -> [ Cil.default_behavior_name ] | bhvs -> bhvs in let debug_calls bhv stmt kfs = if Wp_parameters.has_dkey dkey_calls then let source = snd (Stmt.loc stmt) in if Cil.default_behavior_name = bhv then Wp_parameters.result ~source "@[<hov 2>Calls%a@]" pp_calls kfs else Wp_parameters.result ~source "@[<hov 2>Calls (for %s)%a@]" bhv pp_calls kfs in let pool = ref [] in (* collect emitted properties *) let add_calls_info kf stmt = count <- succ count ; List.iter (fun bhv -> let kfs = List.map get_call calls in debug_calls bhv stmt kfs ; let prop = property ~kf ~bhv ~stmt kfs in pool := prop :: !pool ; CallPoints.add (bhv,stmt) (prop,kfs)) bhvs in let kf = self#kf in List.iter (add_calls_info kf) (if scope <> [] then scope else Stack.top block_calls) ; if !pool <> [] then begin let eloc = Property.ELStmt(kf,self#stmt) in let annot = Property.ip_of_extended eloc extended in Property_status.logical_consequence emitter annot !pool ; end end; SkipChildren | _ -> SkipChildren method! vspec spec = let calls = get_calls "instanceof" spec.Cil_types.spec_behavior in if calls <> [] then begin match self#current_kf with None -> () | Some kf -> List.iter (fun (bhv,kfs) -> Wp_parameters.result "@[<hov 2>%a for %s instance of%a" Kernel_function.pretty kf bhv pp_calls kfs) calls end; SkipChildren method! vstmt_aux s = match s.skind with | Instr (Call( _ , fct , _ , _ )) when Kernel_function.get_called fct = None -> if not (Stack.is_empty block_calls) then Stack.push (self#stmt :: Stack.pop block_calls) block_calls; scope <- self#stmt :: scope ; Cil.DoChildrenPost (fun s -> scope <- []; s) | Block _ -> Stack.push [] block_calls; Cil.DoChildrenPost (fun s -> let calls = Stack.pop block_calls in if not (Stack.is_empty block_calls) then Stack.push (calls @ Stack.pop block_calls) block_calls; s) | _ -> Cil.DoChildren end let compute = let compute () = if Wp_parameters.DynCall.get () then begin Wp_parameters.feedback ~dkey:dkey_calls "Computing dynamic calls." ; let d = new dyncall in Visitor .visitFramacFile (d :> Visitor.frama_c_visitor) (Ast.get()) ; let n = d#count in if n > 0 then Wp_parameters.feedback ~dkey:dkey_calls "Dynamic call(s): %d." n else Wp_parameters.feedback ~dkey:dkey_calls "No dynamic call." end in fst (State_builder.apply_once "Wp.Dyncall.compute" [Ast.self ; Wp_parameters.DynCall.self] compute) (* -------------------------------------------------------------------------- *) (* --- Registry --- *) (* -------------------------------------------------------------------------- *) let get ?bhv stmt = compute () ; let get bhv = try Some (CallPoints.find (bhv,stmt)) with Not_found -> None in match bhv with | None -> get Cil.default_behavior_name | Some bhv -> (match get bhv with | None -> get Cil.default_behavior_name | result -> result) (* -------------------------------------------------------------------------- *) (* --- Registry --- *) (* -------------------------------------------------------------------------- *) let register = let once = ref false in fun () -> if (not !once) && Wp_parameters.DynCall.get () then begin once := true; Logic_typing.register_code_annot_next_stmt_extension "calls" true typecheck; Logic_typing.register_behavior_extension "instanceof" true typecheck ; end let () = Cmdline.run_after_configuring_stage register �����������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/dyncall.mli�����������������������������������������������������0000666�0000000�0000000�00000003702�13571573400�016244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types val pp_calls : Format.formatter -> kernel_function list -> unit val get : ?bhv:string -> stmt -> (Property.t * kernel_function list) option (** Returns [None] if there is no specified dynamic call. *) val compute : unit -> unit (** Forces computation of dynamic calls. Otherwise, they are computed lazily on [get]. Requires [-wp-dynamic]. *) ��������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/filter_axioms.ml������������������������������������������������0000666�0000000�0000000�00000014456�13571573400�017322� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Why3 open Term open Decl let meta_remove_altergo = Theory.register_meta "remove_for_altergo" [Theory.MTprsymbol] ~desc:"Don't@ translate@ this@ lemma@ for@ altergo." let meta_remove_why3 = Theory.register_meta "remove_for_why3" [Theory.MTprsymbol] ~desc:"Don't@ translate@ this@ lemma@ for@ why3." let meta_remove_ = Theory.register_meta "remove_for_" [Theory.MTprsymbol] ~desc:"Don't@ translate@ this@ lemma@ for@ why3 and altergo." let elim_abstract remove_pr d = match d.d_node with | Dprop (Paxiom,pr,_) when Spr.mem pr remove_pr -> (* Format.eprintf "Remove %a@." Pretty.print_pr pr; *) [] | Dprop (Paxiom,_,_) -> (* Format.eprintf "Not Remove %a@." Pretty.print_pr pr; *) [d] | _ -> (* Format.eprintf "Not Seen %a@." Pretty.print_decl d; *) [d] let remove_prop meta = Trans.on_tagged_pr meta (fun remove_pr -> Trans.on_tagged_pr meta_remove_ (fun remove_pr2 -> Trans.decl (elim_abstract (Spr.union remove_pr remove_pr2)) None)) let remove_for_altergo = remove_prop meta_remove_altergo let remove_for_why3 = remove_prop meta_remove_why3 let () = Trans.register_transform "remove_for_altergo" remove_for_altergo ~desc:"Remove@ tagged@ proposition@ with \"remove_for_altergo\"@ and \ \"remove_for_\"@ metas." let () = Trans.register_transform "remove_for_why3" remove_for_why3 ~desc:"Remove@ tagged@ proposition@ with \"remove_for_why3\"@ and \ \"remove_for_\" metas." (** inlining *) let meta_inline_in = Theory.register_meta "inline_in" [Theory.MTlsymbol;Theory.MTprsymbol;] ~desc:"Inline@ the@ symbol@ in@ the@ proposition." let t_unfold defs fs tl ty = match Mls.find_opt fs defs with | None -> assert false (** absurd: it is in mpr so it is in sls so added in defs *) | Some (vl,e) -> let add (mt,mv) x y = Ty.ty_match mt x.vs_ty (t_type y), Mvs.add x y mv in let (mt,mv) = List.fold_left2 add (Ty.Mtv.empty, Mvs.empty) vl tl in let mt = Ty.oty_match mt e.t_ty ty in t_ty_subst mt mv e (* inline every symbol *) let rec t_replace_all defs s t = let t = t_map (t_replace_all defs s) t in match t.t_node with | Tapp (fs,tl) when Sls.mem fs s -> t_attr_copy t (t_unfold defs fs tl t.t_ty) | _ -> t let fold mpr sls d (defs, task) = (** replace *) let d = match d.d_node with | Dprop (k,pr,f) -> let s = Mpr.find_def Sls.empty pr mpr in if Sls.is_empty s then d else create_prop_decl k pr (t_replace_all defs s f) | _ -> d in (** add to defs if needed *) match d.d_node with | Dlogic [ls,ld] when Sls.mem ls sls -> let vl,e = open_ls_defn ld in Mls.add ls (vl,e) defs, Task.add_decl task d | _ -> defs, Task.add_decl task d let fold mpr sls task_hd (defs, task) = match task_hd.Task.task_decl.Theory.td_node with | Theory.Decl d -> fold mpr sls d (defs, task) | _ -> defs, Task.add_tdecl task task_hd.Task.task_decl let trans = let add (mpr,sls) = function | [Theory.MAls ls; Theory.MApr pr] -> Mpr.change (function None -> Some (Sls.singleton ls) | Some s -> Some (Sls.add ls s)) pr mpr, Sls.add ls sls | _ -> assert false in Trans.on_meta meta_inline_in (fun l -> let mpr, sls = List.fold_left add (Mpr.empty,Sls.empty) l in Trans.fold_map (fold mpr sls) Mls.empty None) let () = Trans.register_transform "inline_in" trans ~desc:"Inline@ the@ symbol@ in@ the@ proposition(meta@ of@ the@ same@ name)" (*** eliminate function *) let meta_def_into_axiom = Theory.register_meta "def_into_axiom" [Theory.MTlsymbol] ~desc:"Turn the marked function into an axiom" let add_ld which (ls,ld) (abst,defn,axl) = if which ls then let vl,e = open_ls_defn ld in let nm = ls.ls_name.Ident.id_string ^ "_def" in let pr = create_prsymbol (Ident.id_derive nm ls.ls_name) in let hd = t_app ls (List.map t_var vl) e.t_ty in let e = TermTF.t_selecti Term.t_equ_simp Term.t_iff_simp hd e in let ax = t_forall_close vl [[hd]] e in let ax = create_prop_decl Paxiom pr ax in let ld = create_param_decl ls in ld :: abst, defn, ax :: axl else abst, (ls,ld) :: defn, axl let elim_decl which l = let abst,defn,axl = List.fold_right (add_ld which) l ([],[],[]) in let defn = if defn = [] then [] else [create_logic_decl defn] in abst @ defn @ axl let elim which d = match d.d_node with | Dlogic l -> elim_decl which l | _ -> [d] let def_into_axiom = Trans.on_tagged_ls meta_def_into_axiom (fun sls -> Trans.decl (elim (fun ls -> Term.Sls.mem ls sls)) None) let () = Trans.register_transform "def_into_axiom" def_into_axiom ~desc:"Turn the marked function into an axiom" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/filter_axioms.mli�����������������������������������������������0000666�0000000�0000000�00000003466�13571573400�017472� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val remove_for_altergo : Why3.Task.task Why3.Trans.trans val remove_for_why3 : Why3.Task.task Why3.Trans.trans val trans : Why3.Task.task Why3.Trans.trans val def_into_axiom : Why3.Task.task Why3.Trans.trans ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/intro_wp.txt����������������������������������������������������0000666�0000000�0000000�00000003752�13571573400�016522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#*************************************************************************# #* # #* This file is part of WP plug-in of Frama-C. # #* # #* Copyright (C) 2007-2019 # #* CEA (Commissariat a l'energie atomique et aux energies # #* alternatives) # #* # #* you can redistribute it and/or modify it under the terms of the GNU # #* Lesser General Public License as published by the Free Software # #* Foundation, version 2.1. # #* # #* It is distributed in the hope that it will be useful, # #* but WITHOUT ANY WARRANTY; without even the implied warranty of # #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # #* GNU Lesser General Public License for more details. # #* # #* See the GNU Lesser General Public License version 2.1 # #* for more details (enclosed in the file licenses/LGPLv2.1). # #* # #*************************************************************************# {2 Presentation} The WP plugin is dedicated to formally prove ACSL annotations and contracts by {i Weakest Precondition Calculus}. Dynamically registered API is now deprecated and replaced by a full featured OCaml interface. To use it, simply add [PLUGIN_DEPENDENCIES+=Wp] in your Plug-in Makefile. {2 Plugin API} - {{:../wp/Wp.html}OCaml API} - {{:../dynamic_plugins/Dynamic_plugins.Wp.html}Dynamic API} ({b deprecated}) ����������������������frama-c-20.0-Calcium/src/plugins/wp/mcfg.ml���������������������������������������������������������0000666�0000000�0000000�00000012630�13571573400�015361� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type scope = | SC_Global | SC_Function_in (* Just before the pre-state *) | SC_Function_frame (* Just after the introduction of formals *) | SC_Function_out (* Post-state *) | SC_Block_in | SC_Block_out module type Export = sig type pred type decl val export_section : Format.formatter -> string -> unit val export_goal : Format.formatter -> string -> pred -> unit val export_decl : Format.formatter -> decl -> unit end module type Splitter = sig type pred val simplify : pred -> pred val split : bool -> pred -> pred Bag.t end (** * This is what is really needed to propagate something through the CFG. * Usually, the propagated thing should be a predicate, * but it can be more sophisticated like lists of predicates, * or maybe a structure to keep hypotheses and goals separated. * Moreover, proof obligations may also need to be handled. **) module type S = sig type t_env type t_prop val pretty : Format.formatter -> t_prop -> unit val merge : t_env -> t_prop -> t_prop -> t_prop val empty : t_prop (** optionally init env with user logic variables *) val new_env : ?lvars:Cil_types.logic_var list -> kernel_function -> t_env val add_axiom : WpPropId.prop_id -> LogicUsage.logic_lemma -> unit val add_hyp : t_env -> WpPropId.pred_info -> t_prop -> t_prop val add_goal : t_env -> WpPropId.pred_info -> t_prop -> t_prop val add_assigns : t_env -> WpPropId.assigns_info -> t_prop -> t_prop (** [use_assigns env hid kind assgn goal] performs the havoc on the goal. * [hid] should be [None] iff [assgn] is [WritesAny], * and tied to the corresponding identified_property otherwise.*) val use_assigns : t_env -> stmt option -> WpPropId.prop_id option -> WpPropId.assigns_desc -> t_prop -> t_prop val label : t_env -> stmt option -> Clabels.c_label -> t_prop -> t_prop val init : t_env -> varinfo -> init option -> t_prop -> t_prop val const : t_env -> varinfo -> t_prop -> t_prop val assign : t_env -> stmt -> lval -> exp -> t_prop -> t_prop val return : t_env -> stmt -> exp option -> t_prop -> t_prop val test : t_env -> stmt -> exp -> t_prop -> t_prop -> t_prop val switch : t_env -> stmt -> exp -> (exp list * t_prop) list -> t_prop -> t_prop val has_init : t_env -> bool val loop_entry : t_prop -> t_prop val loop_step : t_prop -> t_prop (* -------------------------------------------------------------------------- *) (* --- Call Rules --- *) (* -------------------------------------------------------------------------- *) val call_dynamic : t_env -> stmt -> WpPropId.prop_id -> exp -> (kernel_function * t_prop) list -> t_prop val call_goal_precond : t_env -> stmt -> kernel_function -> exp list -> pre: WpPropId.pred_info list -> t_prop -> t_prop val call : t_env -> stmt -> lval option -> kernel_function -> exp list -> pre: WpPropId.pred_info list -> post: WpPropId.pred_info list -> pexit: WpPropId.pred_info list -> assigns: assigns -> p_post: t_prop -> p_exit: t_prop -> t_prop (* -------------------------------------------------------------------------- *) (* --- SCOPING RULES --- *) (* -------------------------------------------------------------------------- *) val scope : t_env -> varinfo list -> scope -> t_prop -> t_prop val close : t_env -> t_prop -> t_prop (* -------------------------------------------------------------------------- *) (* --- FROM --- *) (* -------------------------------------------------------------------------- *) (** build [p => alpha(p)] for functional dependencies verification. *) val build_prop_of_from : t_env -> WpPropId.pred_info list -> t_prop -> t_prop end ��������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/normAtLabels.ml�������������������������������������������������0000666�0000000�0000000�00000022026�13571573400�017030� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types type label_mapping = Cil_types.logic_label -> Clabels.c_label (** push the Tat down to the 'data' operations. * This can be useful in cases like \at (x + \at(y, Ly), Lx) because * it gives \at(x, Lx) + \at(y, Ly) so there is no more \at imbrications. * Also try to "normalize" label : * - remove Here because its meaning change when propagating, * - remove Old because its meaning depend on where it comes from. * *) class norm_at (mapping : label_mapping) = object(self) inherit Visitor.generic_frama_c_visitor (Visitor_behavior.copy (Project.current ())) val mutable current_label = None method private change_label label = let label = mapping label in let old_label = current_label in current_label <- Some label; old_label method private restore_term old_label x = current_label <- old_label; let x = match x.term_node with | Ttypeof x -> (* Ttypeof is used as a dummy unary construct *) x | _ -> assert false in x method private restore_pred old_label x = current_label <- old_label; let x = match x.pred_content with | Pnot x -> (* Pnot is used as a dummy unary construct *) x | _ -> assert false in x method! vterm t = match t.term_node with | Tat (t, l) -> let old_label = self#change_label l in let new_t = {t with term_node = Ttypeof t} in Cil.ChangeDoChildrenPost (new_t, self#restore_term old_label) | TAddrOf (h, _) | TLval (h, _) | TStartOf (h, _) -> let old_label = current_label in let at_label = match h with | TResult _ | TVar{lv_name="\\exit_status"} -> Some Clabels.post | _ -> old_label in current_label <- None; let post t = current_label <- old_label; match at_label with | Some label -> {t with term_node = Tat (t, Clabels.to_logic label)} | None -> t in Cil.ChangeDoChildrenPost (t, post) | Tapp _ -> let post = function | {term_node=Tapp(predicate,labels,args)} as t -> let normalize l = mapping l |> Clabels.to_logic in let new_labels = List.map normalize labels in { t with term_node=Tapp(predicate,new_labels,args) } | _ -> assert false in Cil.ChangeDoChildrenPost (t,post) | _ -> Cil.DoChildren method! vpredicate p = match p.pred_content with | Pat (p, l) -> let old_label = self#change_label l in let new_p = {p with pred_content = Pnot p} in Cil.ChangeDoChildrenPost (new_p, self#restore_pred old_label) | Papp _ -> let post = function | {pred_content=Papp(predicate,labels,args)} as p -> let normalize l = mapping l |> Clabels.to_logic in let new_labels = List.map normalize labels in { p with pred_content=Papp(predicate,new_labels,args) } | _ -> assert false in Cil.ChangeDoChildrenPost (p,post) | _ -> Cil.DoChildren end exception LabelError of logic_label let option l = function Some l -> l | None -> raise (LabelError l) let labels_empty l = raise (LabelError l) let enclosing_loop ?kf ?at l = match kf , at with | Some kf , Some stmt -> Kernel_function.find_enclosing_loop kf stmt | _ -> raise (LabelError l) let labels_fct ?kf ?at l = match l with | BuiltinLabel Init -> Clabels.init | BuiltinLabel Pre -> Clabels.pre | StmtLabel at -> Clabels.stmt !at | BuiltinLabel LoopEntry -> Clabels.loop_entry (enclosing_loop ?kf ?at l) | BuiltinLabel LoopCurrent -> Clabels.loop_current (enclosing_loop ?kf ?at l) | _ -> raise (LabelError l) (* -------------------------------------------------------------------------- *) (* --- Function Contracts --- *) (* -------------------------------------------------------------------------- *) let labels_fct_pre = function | BuiltinLabel Init -> Clabels.init | BuiltinLabel (Pre|Here) -> Clabels.pre | l -> raise (LabelError l) let labels_fct_post = function | BuiltinLabel Init -> Clabels.init | BuiltinLabel (Pre | Old) -> Clabels.pre | BuiltinLabel (Post | Here) -> Clabels.post | l -> raise (LabelError l) let labels_fct_assigns = function | BuiltinLabel Init -> Clabels.init | BuiltinLabel (Here | Pre | Old) -> Clabels.pre | BuiltinLabel Post -> Clabels.post | l -> raise (LabelError l) (* -------------------------------------------------------------------------- *) (* --- Statements Contracts --- *) (* -------------------------------------------------------------------------- *) let labels_stmt_pre ~kf s = function | BuiltinLabel Here -> Clabels.stmt s | l -> labels_fct ~kf ~at:s l let labels_stmt_post ~kf s l_post = function | BuiltinLabel Old -> Clabels.stmt s | BuiltinLabel (Here | Post) as l -> option l l_post | l -> labels_fct ~kf ~at:s l let labels_stmt_assigns ~kf s l_post = function | BuiltinLabel (Here | Old) -> Clabels.stmt s | BuiltinLabel Post as l -> option l l_post | l -> labels_fct ~kf ~at:s l (* -------------------------------------------------------------------------- *) (* --- User Assertions in Functions Code --- *) (* -------------------------------------------------------------------------- *) let labels_assert_before ~kf s = function | BuiltinLabel Here -> Clabels.stmt s | l -> labels_fct ~kf ~at:s l let labels_assert_after ~kf s l_post = function | BuiltinLabel Old -> Clabels.stmt s | BuiltinLabel Here as l -> option l l_post | l -> labels_fct ~kf ~at:s l let labels_loop_inv ~established s = function | BuiltinLabel Here -> Clabels.here | BuiltinLabel LoopEntry -> Clabels.loop_entry s | BuiltinLabel LoopCurrent -> if established then Clabels.loop_entry s else Clabels.loop_current s | FormalLabel wplabel -> Clabels.formal wplabel | l -> labels_fct ?kf:None ?at:None l (* current loop is handled above *) let labels_loop_assigns s l = labels_loop_inv ~established:false s l (* -------------------------------------------------------------------------- *) (* --- User Defined Predicates --- *) (* -------------------------------------------------------------------------- *) let labels_predicate lab_pairs l = try List.assoc l lab_pairs |> Clabels.of_logic with Not_found -> Clabels.of_logic l let labels_axiom = function | FormalLabel a -> Clabels.formal a | l -> raise (LabelError l) (* -------------------------------------------------------------------------- *) (* --- Apply Normalization --- *) (* -------------------------------------------------------------------------- *) (** @raise LabelError if there is a label in [p] that is incompatible * with the [labels] translation *) let preproc_annot labels p = let visitor = new norm_at labels in Visitor.visitFramacPredicate visitor p (** @raise LabelError if there is a label in [p] that is incompatible * with the [labels] translation *) let preproc_assigns labels asgns = let visitor = new norm_at labels in List.map (Visitor.visitFramacFrom visitor) asgns let catch_label_error ex txt1 txt2 = match ex with | LabelError lab -> Wp_parameters.warning "Unexpected label %a in %s : ignored %s" Wp_error.pp_logic_label lab txt1 txt2 | _ -> raise ex ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/normAtLabels.mli������������������������������������������������0000666�0000000�0000000�00000005131�13571573400�017177� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Clabels (* exception LabelError of logic_label *) val catch_label_error : exn -> string -> string -> unit type label_mapping val labels_empty : label_mapping val labels_fct_pre : label_mapping val labels_fct_post : label_mapping val labels_fct_assigns : label_mapping val labels_assert_before : kf:kernel_function -> stmt -> label_mapping val labels_assert_after : kf:kernel_function -> stmt -> c_label option -> label_mapping val labels_loop_inv : established:bool -> stmt -> label_mapping val labels_loop_assigns : stmt -> label_mapping val labels_stmt_pre : kf:kernel_function -> stmt -> label_mapping val labels_stmt_post : kf:kernel_function -> stmt -> c_label option -> label_mapping val labels_stmt_assigns : kf:kernel_function -> stmt -> c_label option -> label_mapping val labels_predicate : (logic_label * logic_label) list -> label_mapping val labels_axiom : label_mapping val preproc_annot : label_mapping -> predicate -> predicate val preproc_assigns : label_mapping -> from list -> from list ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/proof.ml��������������������������������������������������������0000666�0000000�0000000�00000026226�13571573400�015600� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Proof Script Database --- *) (* -------------------------------------------------------------------------- *) let scriptbase : (string, string list * string * string) Hashtbl.t = Hashtbl.create 81 (* [ goal name -> sorted hints , script , closing ] *) let scriptfile = ref None (* current file script name *) let needback = ref false (* file script need backup before modification *) let needsave = ref false (* file script need to be saved *) let needwarn = ref false (* user should be prompted for chosen scriptfile *) let sanitize hint = try let n = String.length hint in if n <= 0 then raise Exit ; for i = 0 to n - 1 do match hint.[i] with | 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '-' | '*' -> () | _ -> raise Exit done ; true with Exit -> false let register_script goal hints proof closing = let hints = List.sort String.compare (List.filter sanitize hints) in Hashtbl.replace scriptbase goal (hints,proof,closing) let delete_script_for ~gid = Hashtbl.remove scriptbase gid (* -------------------------------------------------------------------------- *) (* --- Proof Scripts Parsers --- *) (* -------------------------------------------------------------------------- *) open Script let is_empty_script script = try for i=0 to String.length script - 1 do match script.[i] with '\n' | ' ' | '\t' -> () | _ -> raise Exit done ; true with Exit -> false let parse_coqproof file = let input = Script.open_file file in try let rec fetch_proof input = match token input with | Proof(p,c) -> Some(p,c) | Eof -> None | _ -> skip input ; fetch_proof input in let proof = fetch_proof input in Script.close input ; proof with e -> Script.close input ; raise e let collect_scripts input = while key input "Goal" do let g = ident input in eat input "." ; let xs = if key input "Hint" then let xs = idents input in eat input "." ; xs else [] in let proof,qed = match token input with | Proof(p,c) -> skip input ; p,c | _ -> error input "Missing proof" in register_script g xs proof qed done ; if token input <> Eof then error input "Unexpected script declaration" let parse_scripts file = if Sys.file_exists file then begin let input = Script.open_file file in try collect_scripts input ; Script.close input ; with e -> Script.close input ; raise e end let dump_scripts file = let out = open_out file in let fmt = Format.formatter_of_out_channel out in try Format.fprintf fmt "(* Generated by Frama-C WP *)@\n@\n" ; let goals = Hashtbl.fold (fun goal _ gs -> goal::gs) scriptbase [] in List.iter (fun goal -> let (hints,proof,qed) = Hashtbl.find scriptbase goal in Format.fprintf fmt "Goal %s.@\n" goal ; (match hints with | [] -> () | k::ks -> Format.fprintf fmt "Hint %s" k ; List.iter (fun k -> Format.fprintf fmt ",%s" k) ks ; Format.fprintf fmt ".@\n"); Format.fprintf fmt "Proof.@\n%s%s@\n@." proof qed ) (List.sort String.compare goals) ; Format.pp_print_newline fmt () ; close_out out ; with e -> Format.pp_print_newline fmt () ; close_out out ; raise e (* -------------------------------------------------------------------------- *) (* --- Scripts Management --- *) (* -------------------------------------------------------------------------- *) let rec choose k = let file = Printf.sprintf "wp%d.script" k in if Sys.file_exists file then choose (succ k) else file let savescripts () = if !needsave then match !scriptfile with | None -> () | Some file -> if Wp_parameters.UpdateScript.get () then try if !needback then ( Command.copy file (file ^ ".back") ; needback := false ) ; if !needwarn then ( needwarn := false ; Wp_parameters.warning ~current:false "No script file specified.@\n\ Your proofs are saved in '%s'@\n\ Use -wp-script '%s' to re-run them." file file ; ) ; dump_scripts file ; needsave := false ; with e -> Wp_parameters.abort "Error when dumping script file '%s':@\n%s" file (Printexc.to_string e) else Wp_parameters.warning ~once:true ~current:false "Script base modified : modification will not be saved" let loadscripts () = let user = Wp_parameters.Script.get () in if !scriptfile <> Some user then begin savescripts () ; begin try parse_scripts user ; with e -> Wp_parameters.error "Error in script file '%s':@\n%s" user (Printexc.to_string e) end ; if Wp_parameters.UpdateScript.get () then if user = "" then (* update new file *) begin let ftmp = choose 0 in Wp_parameters.Script.set ftmp ; scriptfile := Some ftmp ; needwarn := true ; needback := false ; end else (* update user's file *) begin scriptfile := Some user ; needback := Sys.file_exists user ; end else (* do not update *) begin scriptfile := Some user ; needback := false ; end end let find_script_for_goal ~gid ~legacy = loadscripts () ; try let _,proof,qed = Hashtbl.find scriptbase gid in Some(proof,qed) with Not_found -> try let (_,proof,qed) as entry = Hashtbl.find scriptbase legacy in Wp_parameters.feedback "Upgrading Coq script for '%s'" gid ; Hashtbl.add scriptbase gid entry ; Hashtbl.remove scriptbase legacy ; needsave := true ; Some(proof,qed) with Not_found -> None let update_hints_for_goal goal hints = try let old_hints,script,qed = Hashtbl.find scriptbase goal in let new_hints = List.sort String.compare hints in if Transitioning.Stdlib.compare new_hints old_hints <> 0 then begin Hashtbl.replace scriptbase goal (new_hints,script,qed) ; needsave := true ; end with Not_found -> () let rec matches n xs ys = match xs , ys with | x::rxs , y::rys -> let c = String.compare x y in if c < 0 then matches n rxs ys else if c > 0 then matches n xs rys else matches (succ n) rxs rys | _ -> n let rec filter xs ys = match xs , ys with | [] , _ -> ys | _::_ , [] -> raise Not_found | x::rxs , y::rys -> let c = String.compare x y in if c < 0 then raise Not_found else if c > 0 then y :: filter xs rys else filter rxs rys let most_suitable (n,_,_,_) (n',_,_,_) = n'-n let find_script_with_hints required hints = loadscripts () ; let required = List.sort String.compare required in let hints = List.sort String.compare hints in List.sort most_suitable begin Hashtbl.fold (fun g (xs,proof,qed) scripts -> try let n = matches 0 hints (filter required xs) in (n,g,proof,qed)::scripts with Not_found -> scripts) scriptbase [] end let add_script_for ~gid hints proof = needsave := true ; register_script gid hints proof (* -------------------------------------------------------------------------- *) (* --- Prover API --- *) (* -------------------------------------------------------------------------- *) let script_for ~pid ~gid ~legacy = let found = find_script_for_goal ~gid ~legacy in ( if found <> None then let required,hints = WpPropId.prop_id_keys pid in let all = List.merge String.compare required hints in update_hints_for_goal gid all ) ; found let rec head n = function [] -> [] | x::xs -> if n > 0 then x :: head (pred n) xs else [] let hints_for ~pid = let default = match Wp_parameters.CoqTactic.get () with | "none" -> [] | tactic -> ["Default tactic",Printf.sprintf " %s.\n" tactic,"Qed."] in if Wp_parameters.TryHints.get () then let nhints = Wp_parameters.Hints.get () in if nhints > 0 then let required,hints = WpPropId.prop_id_keys pid in let scripts = find_script_with_hints required hints in default @ List.map (fun (_,_,s,q) -> "Hint",s,q) (head nhints scripts) else default else default let script_for_ide ~pid ~gid ~legacy = match find_script_for_goal ~gid ~legacy with | Some script -> script | None -> let required,hints = WpPropId.prop_id_keys pid in let hints = find_script_with_hints required hints in let script = if hints = [] then begin match Wp_parameters.CoqTactic.get () with | "none" -> "" | tactic -> Format.asprintf "(* %s. *)\n" tactic end else begin let nhints = Wp_parameters.Hints.get () in Format.asprintf "%t" (fun fmt -> List.iter (fun (_,g,script,_) -> Format.fprintf fmt "(*@ --------------------------------------\n \ @ From '%s': \n%s*)\n%!" g script ) (head nhints hints)) end in script , "Qed." ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/proof.mli�������������������������������������������������������0000666�0000000�0000000�00000005220�13571573400�015740� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** Coq Proof Scripts *) (* -------------------------------------------------------------------------- *) open WpPropId val is_empty_script : string -> bool (** Check a proof script text for emptyness *) val delete_script_for : gid:string -> unit (** [delete_script ~gid] remove known script for goal. *) val add_script_for : gid:string -> string list -> string -> string -> unit (** [new_script goal keys proof qed] registers the script [proof] terminated by [qed] for goal [gid] and keywords [keys] *) val parse_coqproof : string -> (string * string) option (** [parse_coqproof f] parses a coq-file [f] and fetch the first proof. *) val savescripts : unit -> unit (** If necessary, dump the scripts database into the file specified by [-wp-script f]. *) val script_for : pid:prop_id -> gid:string -> legacy:string -> (string * string) option val script_for_ide : pid:prop_id -> gid:string -> legacy:string -> string * string val hints_for : pid:prop_id -> (string * string * string) list ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/prover.ml�������������������������������������������������������0000666�0000000�0000000�00000011343�13571573400�015762� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open VCS (* -------------------------------------------------------------------------- *) (* --- Prover Implementation against Task API --- *) (* -------------------------------------------------------------------------- *) open Task open Wpo let dispatch ?(config=VCS.default) mode prover wpo = begin match prover with | Qed | Tactical -> Task.return VCS.no_result | NativeAltErgo -> ProverErgo.prove ~config ~mode wpo | NativeCoq -> ProverCoq.prove mode wpo | Why3 prover -> ProverWhy3.prove ~timeout:(VCS.get_timeout config) ~steplimit:(VCS.get_stepout config) ~prover wpo end let started ?start wpo = match start with | None -> () | Some f -> f wpo let signal ?progress wpo msg = match progress with | None -> () | Some f -> f wpo msg let update ?result wpo prover res = Wpo.set_result wpo prover res ; match result with | None -> () | Some f -> f wpo prover res let run_prover wpo ?config ?(mode=BatchMode) ?progress ?result prover = signal ?progress wpo (VCS.name_of_prover prover) ; dispatch ?config mode prover wpo >>> fun status -> let res = match status with | Task.Result r -> r | Task.Canceled -> VCS.no_result | Task.Timeout t -> VCS.timeout t | Task.Failed exn -> VCS.failed (error exn) in let res = { res with solver_time = Wpo.qed_time wpo } in update ?result wpo prover res ; Task.return (VCS.is_valid res) let simplify ?start ?result wpo = Task.call (fun wpo -> let r = Wpo.get_result wpo VCS.Qed in VCS.( r.verdict == Valid ) || begin started ?start wpo ; if Wpo.reduce wpo then let time = qed_time wpo in let res = VCS.result ~time VCS.Valid in (update ?result wpo VCS.Qed res ; true) else false end) wpo let prove wpo ?config ?mode ?start ?progress ?result prover = simplify ?start ?result wpo >>= fun succeed -> if succeed then Task.return true else (run_prover wpo ?config ?mode ?progress ?result prover) let spawn wpo ~delayed ?config ?start ?progress ?result ?success ?pool provers = if provers<>[] then let do_monitor on_success wpo = function | None -> on_success wpo None | Some prover -> let r = Wpo.get_result wpo VCS.Qed in let prover = if VCS.( r.verdict == Valid ) then VCS.Qed else prover in on_success wpo (Some prover) in let monitor = match success with | None -> None | Some on_success -> Some (do_monitor on_success wpo) in let process (mode,prover) = prove wpo ?config ~mode ?start ?progress ?result prover in let canceled = match success with None -> None | Some f -> Some (fun _ -> f wpo None) in ProverTask.spawn ?monitor ?pool (List.map (fun mp -> snd mp , if delayed then Task.later ?canceled process mp else process mp) provers) else let process = simplify ?start ?result wpo in let thread = Task.thread process in let server = ProverTask.server () in Task.spawn server ?pool thread ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/prover.mli������������������������������������������������������0000666�0000000�0000000�00000004457�13571573400�016143� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open VCS (* -------------------------------------------------------------------------- *) (* --- Prover Implementation against Task API --- *) (* -------------------------------------------------------------------------- *) val prove : Wpo.t -> ?config:config -> ?mode:mode -> ?start:(Wpo.t -> unit) -> ?progress:(Wpo.t -> string -> unit) -> ?result:(Wpo.t -> prover -> result -> unit) -> prover -> bool Task.task val spawn : Wpo.t -> delayed:bool -> ?config:config -> ?start:(Wpo.t -> unit) -> ?progress:(Wpo.t -> string -> unit) -> ?result:(Wpo.t -> prover -> result -> unit) -> ?success:(Wpo.t -> prover option -> unit) -> ?pool:Task.pool -> (mode * prover) list -> unit �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/register.ml�����������������������������������������������������0000666�0000000�0000000�00000101173�13571573400�016272� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Factory let dkey_main = Wp_parameters.register_category "main" let dkey_raised = Wp_parameters.register_category "raised" let dkey_shell = Wp_parameters.register_category "shell" (* --------- Command Line ------------------- *) let cmdline () : setup = begin match Wp_parameters.Model.get () with | ["Runtime"] -> Wp_parameters.abort "Model 'Runtime' is no more available.@\nIt will be reintroduced \ in a future release." | ["Logic"] -> Wp_parameters.warning ~once:true "Deprecated 'Logic' model.@\nUse 'Typed' with option '-wp-ref' \ instead." ; { mheap = Factory.Typed MemTyped.Fits ; mvar = Factory.Ref ; cint = Cint.Natural ; cfloat = Cfloat.Real ; } | ["Store"] -> Wp_parameters.warning ~once:true "Deprecated 'Store' model.@\nUse 'Typed' instead." ; { mheap = Factory.Typed MemTyped.Fits ; mvar = Factory.Var ; cint = Cint.Natural ; cfloat = Cfloat.Real ; } | spec -> Factory.parse spec end let set_model (s:setup) = Wp_parameters.Model.set [Factory.ident s] (* --------- WP Computer -------------------- *) let computer () = if Wp_parameters.Model.get () = ["Dump"] then CfgDump.create () else CfgWP.computer (cmdline ()) (Driver.load_driver ()) (* ------------------------------------------------------------------------ *) (* --- Memory Model Hypotheses --- *) (* ------------------------------------------------------------------------ *) module Models = Set.Make(WpContext.MODEL) module Fmap = Kernel_function.Map let wp_iter_model ?ip ?index job = begin let pool : Models.t Fmap.t ref = ref Fmap.empty in Wpo.iter ?ip ?index ~on_goal:(fun wpo -> match Wpo.get_index wpo with | Wpo.Axiomatic _ -> () | Wpo.Function(kf,_) -> let m = Wpo.get_model wpo in let ms = try Fmap.find kf !pool with Not_found -> Models.empty in if not (Models.mem m ms) then pool := Fmap.add kf (Models.add m ms) !pool ; ) () ; Fmap.iter (fun kf ms -> Models.iter (fun m -> job kf m) ms) !pool end let wp_print_memory_context kf m hyp fmt = begin let printer = new Printer.extensible_printer () in let pp_vdecl = printer#without_annot printer#vdecl in Format.fprintf fmt "@[<hv 0>@[<hv 3>/*@@@ behavior %s:" (WpContext.MODEL.id m) ; List.iter (MemoryContext.pp_clause fmt) hyp ; let vkf = Kernel_function.get_vi kf in Format.fprintf fmt "@ @]*/@]@\n@[<hov 2>%a;@]@\n" pp_vdecl vkf ; end let wp_warn_memory_context () = begin wp_iter_model begin fun kf m -> let hyp = WpContext.compute_hypotheses m kf in if hyp <> [] then Wp_parameters.warning ~current:false "@[<hv 0>Memory model hypotheses for function '%s':@ %t@]" (Kernel_function.get_name kf) (wp_print_memory_context kf m hyp) end end (* ------------------------------------------------------------------------ *) (* --- Printing informations --- *) (* ------------------------------------------------------------------------ *) let do_wp_print () = (* Printing *) if Wp_parameters.Print.get () then try Wpo.iter ~on_goal:(fun _ -> raise Exit) () ; Wp_parameters.result "No proof obligations" with Exit -> Log.print_on_output (fun fmt -> Wpo.iter ~on_axiomatics:(Wpo.pp_axiomatics fmt) ~on_behavior:(Wpo.pp_function fmt) ~on_goal:(Wpo.pp_goal_flow fmt) ()) let do_wp_print_for goals = if Wp_parameters.Print.get () then if Bag.is_empty goals then Wp_parameters.result "No proof obligations" else Log.print_on_output (fun fmt -> Bag.iter (Wpo.pp_goal_flow fmt) goals) let do_wp_report () = begin let reports = Wp_parameters.Report.get () in let jreport = Wp_parameters.ReportJson.get () in if reports <> [] || jreport <> "" then begin let stats = WpReport.fcstat () in begin match String.split_on_char ':' jreport with | [] | [""] -> () | [joutput] -> WpReport.export_json stats ~joutput () ; | [jinput;joutput] -> WpReport.export_json stats ~jinput ~joutput () ; | _ -> Wp_parameters.error "Invalid format for option -wp-report-json" end ; List.iter (WpReport.export stats) reports ; end ; if Wp_parameters.MemoryContext.get () then wp_warn_memory_context () end (* ------------------------------------------------------------------------ *) (* --- Wp Results --- *) (* ------------------------------------------------------------------------ *) let pp_warnings fmt wpo = let ws = Wpo.warnings wpo in if ws <> [] then let n = List.length ws in let s = List.exists (fun w -> w.Warning.severe) ws in begin match s , n with | true , 1 -> Format.fprintf fmt " (Degenerated)" | true , _ -> Format.fprintf fmt " (Degenerated, %d warnings)" n | false , 1 -> Format.fprintf fmt " (Stronger)" | false , _ -> Format.fprintf fmt " (Stronger, %d warnings)" n end let launch task = let server = ProverTask.server () in (** Do on_server_stop save why3 session *) Task.spawn server (Task.thread task) ; Task.launch server (* ------------------------------------------------------------------------ *) (* --- Prover Stats --- *) (* ------------------------------------------------------------------------ *) let do_wpo_display goal = let result = if Wpo.is_trivial goal then "trivial" else "not tried" in Wp_parameters.feedback "Goal %s : %s" (Wpo.get_gid goal) result module PM = FCMap.Make(struct type t = VCS.prover let compare = VCS.cmp_prover end) type pstat = { mutable proved : int ; mutable unknown : int ; mutable interrupted : int ; mutable incache : int ; mutable failed : int ; mutable n_time : int ; (* nbr of measured times *) mutable a_time : float ; (* sum of measured times *) mutable u_time : float ; (* max time *) mutable d_time : float ; (* min time *) mutable steps : int ; } module GOALS = Wpo.S.Set let scheduled = ref 0 let exercised = ref 0 let spy = ref false let session = ref GOALS.empty let proved = ref GOALS.empty let provers = ref PM.empty let begin_session () = session := GOALS.empty ; spy := true let clear_session () = session := GOALS.empty let end_session () = session := GOALS.empty ; spy := false let iter_session f = GOALS.iter f !session let clear_scheduled () = begin scheduled := 0 ; exercised := 0 ; proved := GOALS.empty ; provers := PM.empty ; end let get_pstat p = try PM.find p !provers with Not_found -> let s = { proved = 0 ; unknown = 0 ; interrupted = 0 ; failed = 0 ; steps = 0 ; incache = 0 ; n_time = 0 ; a_time = 0.0 ; u_time = 0.0 ; d_time = max_float ; } in provers := PM.add p s !provers ; s let add_step s n = if n > s.steps then s.steps <- n let add_time s t = if t > 0.0 then begin s.n_time <- succ s.n_time ; s.a_time <- t +. s.a_time ; if t < s.d_time then s.d_time <- t ; if t > s.u_time then s.u_time <- t ; end let do_list_scheduled iter_on_goals = if not (Wp_parameters.has_dkey VCS.dkey_no_goals_info) then begin clear_scheduled () ; iter_on_goals (fun goal -> begin incr scheduled ; if !spy then session := GOALS.add goal !session ; end) ; let n = !scheduled in if n > 1 then Wp_parameters.feedback "%d goals scheduled" n else Wp_parameters.feedback "%d goal scheduled" n ; end let dkey_prover = Wp_parameters.register_category "prover" let do_wpo_start goal = begin incr exercised ; if Wp_parameters.has_dkey dkey_prover then Wp_parameters.feedback "[Qed] Goal %s preprocessing" (Wpo.get_gid goal) ; end let do_wpo_wait () = Wp_parameters.feedback ~ontty:`Transient "[wp] Waiting provers..." let do_progress goal msg = begin if !scheduled > 0 then let pp = int_of_float (100.0 *. float !exercised /. float !scheduled) in let pp = max 0 (min 100 pp) in Wp_parameters.feedback ~ontty:`Transient "[%02d%%] %s (%s)" pp goal.Wpo.po_sid msg ; end (* ------------------------------------------------------------------------ *) (* --- Caching --- *) (* ------------------------------------------------------------------------ *) let do_report_cache_usage mode = if not (Wp_parameters.has_dkey dkey_shell) && not (Wp_parameters.has_dkey VCS.dkey_no_cache_info) then let hits = ProverWhy3.get_hits () in let miss = ProverWhy3.get_miss () in if hits <= 0 && miss <= 0 then Wp_parameters.result "[Cache] not used" else Wp_parameters.result "[Cache]%t" begin fun fmt -> let sep = ref " " in let pp_cache fmt n job = if n > 0 then ( Format.fprintf fmt "%s%s:%d" !sep job n ; sep := ", " ) in match mode with | ProverWhy3.NoCache -> () | ProverWhy3.Replay -> pp_cache fmt hits "found" ; pp_cache fmt miss "missed" ; Format.pp_print_newline fmt () ; | ProverWhy3.Offline -> pp_cache fmt hits "found" ; pp_cache fmt miss "failed" ; Format.pp_print_newline fmt () ; | ProverWhy3.Update | ProverWhy3.Cleanup -> pp_cache fmt hits "found" ; pp_cache fmt miss "updated" ; Format.pp_print_newline fmt () ; | ProverWhy3.Rebuild -> pp_cache fmt hits "replaced" ; pp_cache fmt miss "updated" ; Format.pp_print_newline fmt () ; end (* -------------------------------------------------------------------------- *) (* --- Prover Results --- *) (* -------------------------------------------------------------------------- *) let do_wpo_stat goal prover res = let s = get_pstat prover in let open VCS in if res.cached then s.incache <- succ s.incache ; match res.verdict with | Checked | NoResult | Computing _ | Invalid | Unknown -> s.unknown <- succ s.unknown | Stepout | Timeout -> s.interrupted <- succ s.interrupted | Failed -> s.failed <- succ s.failed | Valid -> if not (Wpo.is_tactic goal) then proved := GOALS.add goal !proved ; s.proved <- succ s.proved ; add_step s res.prover_steps ; add_time s res.prover_time ; if prover <> Qed then add_time (get_pstat Qed) res.solver_time let do_wpo_result goal prover res = if VCS.is_verdict res then begin if Wp_parameters.Check.get () then begin let open VCS in let ontty = if res.verdict = Checked then `Feedback else `Message in Wp_parameters.feedback ~ontty "[%a] Goal %s : %a" VCS.pp_prover prover (Wpo.get_gid goal) VCS.pp_result res ; end ; if prover = VCS.Qed then do_progress goal "Qed" ; do_wpo_stat goal prover res ; end let do_wpo_success goal s = if not (Wp_parameters.Check.get ()) then if Wp_parameters.Generate.get () then match s with | None -> () | Some prover -> Wp_parameters.feedback ~ontty:`Silent "[%a] Goal %s : Valid" VCS.pp_prover prover (Wpo.get_gid goal) else match s with | None -> begin match Wpo.get_results goal with | [p,r] -> Wp_parameters.result "[%a] Goal %s : %a%a" VCS.pp_prover p (Wpo.get_gid goal) VCS.pp_result r pp_warnings goal | pres -> Wp_parameters.result "[Failed] Goal %s%t" (Wpo.get_gid goal) begin fun fmt -> pp_warnings fmt goal ; List.iter (fun (p,r) -> Format.fprintf fmt "@\n%8s: @[<hv>%a@]" (VCS.title_of_prover p) VCS.pp_result r ) pres ; end end | Some (VCS.Tactical as p) -> Wp_parameters.feedback ~ontty:`Silent "[%a] Goal %s : Valid" VCS.pp_prover p (Wpo.get_gid goal) | Some p -> let r = Wpo.get_result goal p in Wp_parameters.feedback ~ontty:`Silent "[%a] Goal %s : %a" VCS.pp_prover p (Wpo.get_gid goal) VCS.pp_result r let do_report_time fmt s = begin if s.n_time > 0 && s.u_time > Rformat.epsilon && not (Wp_parameters.has_dkey VCS.dkey_no_time_info) && not (Wp_parameters.has_dkey VCS.dkey_success_only) then let mean = s.a_time /. float s.n_time in let epsilon = 0.05 *. mean in let delta = s.u_time -. s.d_time in if delta < epsilon then Format.fprintf fmt " (%a)" Rformat.pp_time mean else let middle = (s.u_time +. s.d_time) *. 0.5 in if abs_float (middle -. mean) < epsilon then Format.fprintf fmt " (%a-%a)" Rformat.pp_time s.d_time Rformat.pp_time s.u_time else Format.fprintf fmt " (%a-%a-%a)" Rformat.pp_time s.d_time Rformat.pp_time mean Rformat.pp_time s.u_time end let do_report_steps fmt s = begin if s.steps > 0 && not (Wp_parameters.has_dkey VCS.dkey_no_step_info) && not (Wp_parameters.has_dkey VCS.dkey_success_only) then Format.fprintf fmt " (%d)" s.steps ; end let do_report_stopped fmt s = if Wp_parameters.has_dkey VCS.dkey_success_only then begin let n = s.interrupted + s.unknown in if n > 0 then Format.fprintf fmt " (unsuccess: %d)" n ; end else begin if s.interrupted > 0 then Format.fprintf fmt " (interrupted: %d)" s.interrupted ; if s.unknown > 0 then Format.fprintf fmt " (unknown: %d)" s.unknown ; if s.incache > 0 then Format.fprintf fmt " (cached: %d)" s.incache ; end let do_report_prover_stats pp_prover fmt (p,s) = begin let name = VCS.title_of_prover p in Format.fprintf fmt "%a %4d " pp_prover name s.proved ; do_report_time fmt s ; do_report_steps fmt s ; do_report_stopped fmt s ; if s.failed > 0 then Format.fprintf fmt " (failed: %d)" s.failed ; Format.fprintf fmt "@\n" ; end let do_report_scheduled () = if not (Wp_parameters.has_dkey VCS.dkey_no_goals_info) then if Wp_parameters.Generate.get () then let plural = if !exercised > 1 then "s" else "" in Wp_parameters.result "%d goal%s generated" !exercised plural else let proved = GOALS.cardinal !proved in let mode = ProverWhy3.get_mode () in if mode <> ProverWhy3.NoCache then do_report_cache_usage mode ; Wp_parameters.result "%t" begin fun fmt -> Format.fprintf fmt "Proved goals: %4d / %d@\n" proved !scheduled ; Pretty_utils.pp_items ~min:12 ~align:`Left ~title:(fun (prover,_) -> VCS.title_of_prover prover) ~iter:(fun f -> PM.iter (fun p s -> f (p,s)) !provers) ~pp_title:(fun fmt a -> Format.fprintf fmt "%s:" a) ~pp_item:do_report_prover_stats fmt ; end let do_list_scheduled_result () = begin do_report_scheduled () ; clear_scheduled () ; end (* ------------------------------------------------------------------------ *) (* --- Proving --- *) (* ------------------------------------------------------------------------ *) type mode = { mutable tactical : bool ; mutable update : bool ; mutable depth : int ; mutable width : int ; mutable backtrack : int ; mutable auto : Strategy.heuristic list ; mutable provers : (VCS.mode * VCS.prover) list ; } let spawn_wp_proofs_iter ~mode iter_on_goals = if mode.tactical || mode.provers<>[] then begin let server = ProverTask.server () in ignore (Wp_parameters.Share.dir ()); (* To prevent further errors *) iter_on_goals (fun goal -> if mode.tactical && not (Wpo.is_trivial goal) && (mode.auto <> [] || ProofSession.exists goal) then ProverScript.spawn ~failed:false ~auto:mode.auto ~depth:mode.depth ~width:mode.width ~backtrack:mode.backtrack ~provers:(List.map snd mode.provers) ~start:do_wpo_start ~progress:do_progress ~result:do_wpo_result ~success:do_wpo_success goal else Prover.spawn goal ~delayed:false ~start:do_wpo_start ~progress:do_progress ~result:do_wpo_result ~success:do_wpo_success mode.provers ) ; Task.on_server_wait server do_wpo_wait ; Task.launch server end let get_prover_names () = match Wp_parameters.Provers.get () with [] -> [ "alt-ergo" ] | pnames -> pnames let compute_provers ~mode = mode.provers <- List.fold_right (fun pname prvs -> match VCS.prover_of_name pname with | None -> prvs | Some VCS.Tactical -> mode.tactical <- true ; if pname = "tip" then mode.update <- true ; prvs | Some prover -> (VCS.mode_of_prover_name pname , prover) :: prvs) (get_prover_names ()) [] let dump_strategies = let once = ref true in fun () -> if !once then ( once := false ; Wp_parameters.result "Registered strategies for -wp-auto:%t" (fun fmt -> Strategy.iter (fun h -> Format.fprintf fmt "@\n '%s': %s" h#id h#title ))) let default_mode () = { tactical = false ; update=false ; provers = [] ; depth=0 ; width = 0 ; auto=[] ; backtrack = 0 ; } let compute_auto ~mode = mode.auto <- [] ; mode.width <- Wp_parameters.AutoWidth.get () ; mode.depth <- Wp_parameters.AutoDepth.get () ; mode.backtrack <- max 0 (Wp_parameters.BackTrack.get ()) ; let auto = Wp_parameters.Auto.get () in if mode.depth <= 0 || mode.width <= 0 then ( if auto <> [] then Wp_parameters.feedback "Auto-search deactivated because of 0-depth or 0-width" ) else begin List.iter (fun id -> if id = "?" then dump_strategies () else try mode.auto <- Strategy.lookup ~id :: mode.auto with Not_found -> Wp_parameters.error ~current:false "Strategy -wp-auto '%s' unknown (ignored)." id ) auto ; mode.auto <- List.rev mode.auto ; if mode.auto <> [] then mode.tactical <- true ; end let do_update_session mode iter = if mode.update then begin let removed = ref 0 in let updated = ref 0 in let invalid = ref 0 in iter begin fun goal -> let results = Wpo.get_results goal in let autoproof (p,r) = (p=VCS.Qed) || (VCS.is_auto p && VCS.is_valid r && VCS.autofit r) in if List.exists autoproof results then begin if ProofSession.exists goal then (incr removed ; ProofSession.remove goal) end else let scripts = ProofEngine.script (ProofEngine.proof ~main:goal) in if scripts <> [] then begin let keep = function | ProofScript.Prover(p,r) -> VCS.is_auto p && VCS.is_valid r | ProofScript.Tactic(n,_,_) -> n=0 | ProofScript.Error _ -> false in let strategy = List.filter keep scripts in if strategy <> [] then begin incr updated ; ProofSession.save goal (ProofScript.encode strategy) end else if not (ProofSession.exists goal) then begin incr invalid ; ProofSession.save goal (ProofScript.encode scripts) end end end ; let r = !removed in let u = !updated in let f = !invalid in ( if r = 0 && u = 0 && f = 0 then Wp_parameters.result "No updated script." ) ; ( if r > 0 then let s = if r > 1 then "s" else "" in Wp_parameters.result "Updated session with %d new automated proof%s." r s ); ( if u > 0 then let s = if u > 1 then "s" else "" in Wp_parameters.result "Updated session with %d new valid script%s." u s ) ; ( if f > 0 then let s = if f > 1 then "s" else "" in Wp_parameters.result "Updated session with %d new script%s to complete." f s ); end let do_wp_proofs_iter ?provers ?tip iter = let mode = default_mode () in compute_provers ~mode ; compute_auto ~mode ; begin match provers with None -> () | Some prvs -> mode.provers <- List.map (fun dp -> VCS.BatchMode , VCS.Why3 dp) prvs end ; begin match tip with None -> () | Some tip -> mode.tactical <- tip ; mode.update <- tip ; end ; let spawned = mode.tactical || mode.provers <> [] in begin if spawned then do_list_scheduled iter ; spawn_wp_proofs_iter ~mode iter ; if spawned then begin do_list_scheduled_result () ; do_update_session mode iter ; end else if not (Wp_parameters.Print.get ()) then iter do_wpo_display end let do_wp_proofs () = do_wp_proofs_iter (fun f -> Wpo.iter ~on_goal:f ()) let do_wp_proofs_for goals = do_wp_proofs_iter (fun f -> Bag.iter f goals) (* registered at frama-c (normal) exit *) let do_cache_cleanup () = begin let mode = ProverWhy3.get_mode () in ProverWhy3.cleanup_cache ~mode ; let removed = ProverWhy3.get_removed () in if removed > 0 && not (Wp_parameters.has_dkey dkey_shell) && not (Wp_parameters.has_dkey VCS.dkey_no_cache_info) then Wp_parameters.result "[Cache] removed:%d" removed end (* ------------------------------------------------------------------------ *) (* --- Secondary Entry Points --- *) (* ------------------------------------------------------------------------ *) (* Deprecated entry point in Dynamic. *) let deprecated_wp_compute kf bhv ipopt = let model = computer () in let goals = match ipopt with | None -> Generator.compute_kf model ?kf ~bhv () | Some ip -> Generator.compute_ip model ip in do_wp_proofs_for goals let deprecated_wp_compute_kf kf bhv prop = let model = computer () in do_wp_proofs_for (Generator.compute_kf model ?kf ~bhv ~prop ()) let deprecated_wp_compute_ip ip = Wp_parameters.warning ~once:true "Dynamic 'wp_compute_ip' is now deprecated." ; let model = computer () in do_wp_proofs_for (Generator.compute_ip model ip) let deprecated_wp_compute_call stmt = Wp_parameters.warning ~once:true "Dynamic 'wp_compute_ip' is now deprecated." ; do_wp_proofs_for (Generator.compute_call (computer ()) stmt) let deprecated_wp_clear () = Wp_parameters.warning ~once:true "Dynamic 'wp_compute_ip' is now deprecated." ; Wpo.clear () (* ------------------------------------------------------------------------ *) (* --- Command-line Entry Points --- *) (* ------------------------------------------------------------------------ *) let dkey_logicusage = Wp_parameters.register_category "logicusage" let dkey_refusage = Wp_parameters.register_category "refusage" let dkey_builtins = Wp_parameters.register_category "builtins" let cmdline_run () = let wp_main fct = Wp_parameters.feedback ~ontty:`Feedback "Running WP plugin..."; Ast.compute (); Dyncall.compute (); if Wp_parameters.has_dkey dkey_logicusage then begin LogicUsage.compute (); LogicUsage.dump (); end ; if Wp_parameters.has_dkey dkey_refusage then begin RefUsage.compute (); RefUsage.dump (); end ; let bhv = Wp_parameters.Behaviors.get () in let prop = Wp_parameters.Properties.get () in (** TODO entry point *) let computer = computer () in if Wp_parameters.has_dkey dkey_builtins then begin WpContext.on_context (computer#model,WpContext.Global) LogicBuiltins.dump (); end ; Generator.compute_selection computer ~fct ~bhv ~prop () in let fct = Wp_parameters.get_wp () in match fct with | Wp_parameters.Fct_none -> () | Wp_parameters.Fct_all -> begin ignore (wp_main fct); do_wp_proofs (); do_wp_print (); do_wp_report (); end | _ -> begin let goals = wp_main fct in do_wp_proofs_for goals ; do_wp_print_for goals ; do_wp_report () ; end (* ------------------------------------------------------------------------ *) (* --- Register external functions --- *) (* ------------------------------------------------------------------------ *) let deprecated name = Wp_parameters.warning ~once:true ~current:false "Dynamic '%s' now is deprecated. Use `Wp.VC` api instead." name let register name ty code = let _ignore = Dynamic.register ~plugin:"Wp" name ty ~journalize:false (*LC: Because of Property is not journalizable. *) (fun x -> deprecated name ; code x) in () (* DEPRECATED *) let () = let module OLS = Datatype.List(Datatype.String) in let module OKF = Datatype.Option(Kernel_function) in let module OP = Datatype.Option(Property) in register "wp_compute" (Datatype.func3 OKF.ty OLS.ty OP.ty Datatype.unit) deprecated_wp_compute let () = let module OKF = Datatype.Option(Kernel_function) in let module OLS = Datatype.List(Datatype.String) in register "wp_compute_kf" (Datatype.func3 OKF.ty OLS.ty OLS.ty Datatype.unit) deprecated_wp_compute_kf let () = register "wp_compute_ip" (Datatype.func Property.ty Datatype.unit) deprecated_wp_compute_ip let () = register "wp_compute_call" (Datatype.func Cil_datatype.Stmt.ty Datatype.unit) deprecated_wp_compute_call let () = register "wp_clear" (Datatype.func Datatype.unit Datatype.unit) deprecated_wp_clear let run = Dynamic.register ~plugin:"Wp" "run" (Datatype.func Datatype.unit Datatype.unit) ~journalize:true cmdline_run let () = let open Datatype in begin let t_job = func Unit.ty Unit.ty in let t_iter = func (func Wpo.S.ty Unit.ty) Unit.ty in let register name ty f = ignore (Dynamic.register name ty ~plugin:"Wp" ~journalize:false f) in register "wp_begin_session" t_job begin_session ; register "wp_end_session" t_job end_session ; register "wp_clear_session" t_job clear_session ; register "wp_iter_session" t_iter iter_session ; end (* ------------------------------------------------------------------------ *) (* --- Tracing WP Invocation --- *) (* ------------------------------------------------------------------------ *) let pp_wp_parameters fmt = begin Format.pp_print_string fmt "# frama-c -wp" ; if Wp_parameters.RTE.get () then Format.pp_print_string fmt " -wp-rte" ; let spec = Wp_parameters.Model.get () in if spec <> [] && spec <> ["Typed"] then ( let descr = Factory.descr (Factory.parse spec) in Format.fprintf fmt " -wp-model '%s'" descr ) ; if not (Wp_parameters.Let.get ()) then Format.pp_print_string fmt " -wp-no-let" ; if Wp_parameters.Let.get () && not (Wp_parameters.Prune.get ()) then Format.pp_print_string fmt " -wp-no-prune" ; if Wp_parameters.Split.get () then Format.pp_print_string fmt " -wp-split" ; let tm = Wp_parameters.Timeout.get () in if tm <> 10 then Format.fprintf fmt " -wp-timeout %d" tm ; let st = Wp_parameters.Steps.get () in if st > 0 then Format.fprintf fmt " -wp-steps %d" st ; if not (Kernel.SignedOverflow.get ()) then Format.pp_print_string fmt " -no-warn-signed-overflow" ; if Kernel.UnsignedOverflow.get () then Format.pp_print_string fmt " -warn-unsigned-overflow" ; if Kernel.SignedDowncast.get () then Format.pp_print_string fmt " -warn-signed-downcast" ; if Kernel.UnsignedDowncast.get () then Format.pp_print_string fmt " -warn-unsigned-downcast" ; if not (Wp_parameters.Volatile.get ()) then Format.pp_print_string fmt " -wp-no-volatile" ; Format.pp_print_string fmt " [...]" ; Format.pp_print_newline fmt () ; end let () = Cmdline.run_after_setting_files (fun _ -> if Wp_parameters.has_dkey dkey_shell then Log.print_on_output pp_wp_parameters) (* -------------------------------------------------------------------------- *) (* --- Prover Configuration & Detection --- *) (* -------------------------------------------------------------------------- *) let () = Cmdline.run_after_configuring_stage Why3Provers.configure let do_prover_detect () = if not !Config.is_gui && Wp_parameters.Detect.get () then let provers = Why3Provers.provers () in if provers = [] then Wp_parameters.result "No Why3 provers detected." else let open Why3.Whyconf in let shortcuts = get_prover_shortcuts (Why3Provers.config ()) in let print_prover_shortcuts_for fmt p = Why3.Wstdlib.Mstr.iter (fun name p' -> if Prover.equal p p' then Format.fprintf fmt "%s|" name) shortcuts in List.iter (fun p -> Wp_parameters.result "Prover %10s %-6s [%a%a]" p.prover_name p.prover_version print_prover_shortcuts_for p print_prover_parseable_format p ) provers (* ------------------------------------------------------------------------ *) (* --- Main Entry Points --- *) (* ------------------------------------------------------------------------ *) let rec try_sequence jobs () = match jobs with | [] -> () | head :: tail -> Extlib.try_finally ~finally:(try_sequence tail) head () let sequence jobs () = if Wp_parameters.has_dkey dkey_raised then List.iter (fun f -> f ()) jobs else try_sequence jobs () let tracelog () = let active_keys = Wp_parameters.get_debug_keys () in if active_keys <> [] then begin let pp_sep fmt () = Format.pp_print_string fmt "," in Wp_parameters.( debug "Logging keys: %a." (Format.pp_print_list ~pp_sep pp_category) active_keys) end let main = sequence [ (fun () -> Wp_parameters.debug ~dkey:dkey_main "Start WP plugin...@.") ; do_prover_detect ; cmdline_run ; tracelog ; Wp_parameters.reset ; (fun () -> Wp_parameters.debug ~dkey:dkey_main "Stop WP plugin...@.") ; ] let () = Cmdline.at_normal_exit do_cache_cleanup let () = Db.Main.extend main (* ------------------------------------------------------------------------ *) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/rformat.mli�����������������������������������������������������0000666�0000000�0000000�00000004216�13571573400�016271� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Format val epsilon : float val get_time : float array -> float -> int (** [get_time T t] returns [k] such that [T[k-1] <= t <= T[k]], [T] is extended with [T[-1]=0] and [T[N]=+oo]. *) val pp_time : formatter -> float -> unit (** Pretty print time in hour, minutes, seconds, or milliseconds, as appropriate *) val pp_time_range : float array -> formatter -> float -> unit type command = | CMD of string | ARG of string * string | TEXT val command : string -> command val pretty : (formatter -> string -> string -> unit) -> formatter -> string -> unit ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/rformat.mll�����������������������������������������������������0000666�0000000�0000000�00000016216�13571573400�016277� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Fast Report for WP --- *) (* -------------------------------------------------------------------------- *) { (* -------------------------------------------------------------------------- *) (* --- Time Utilities --- *) (* -------------------------------------------------------------------------- *) let epsilon = 0.0005 let get_time ladder t = let rec dicho ladder t i j = let k = (i+j)/2 in if i=k then j else let d = ladder.(k) in if t < d then dicho ladder t i k else if t > d then dicho ladder t k j else k in if t <= ladder.(0) then 0 else let n = Array.length ladder in if t > ladder.(n-1) then n else dicho ladder t 0 (n-1) let rdiv t n = let d = floor (t /. n) in let r = t -. d *. n in d , r let pp_time fmt t = if t < 0.001 then Format.fprintf fmt "%.2fms" (1000.0 *. t) else if t < 1.0 then Format.fprintf fmt "%dms" (truncate (t *. 1000.0 +. 0.5)) else if t < 60.0 then let dt = t -. floor t in if dt < 0.1 then Format.fprintf fmt "%.0fs" t else Format.fprintf fmt "%.1fs" t else if t < 3600.0 then let minutes,seconds = rdiv t 60.0 in if seconds < 1.0 then Format.fprintf fmt "%d'" (truncate minutes) else Format.fprintf fmt "%d'%ds" (truncate minutes) (truncate seconds) else let hours,seconds = rdiv t 3600.0 in let minutes,_ = rdiv seconds 60.0 in if minutes < 1.0 then Format.fprintf fmt "%dh" (truncate hours) else Format.fprintf fmt "%dh%d'" (truncate hours) (truncate minutes) let pp_time_range ladder fmt t = let k = get_time ladder t in let n = Array.length ladder in if k > n then Format.fprintf fmt ">%a" pp_time ladder.(n-1) else pp_time fmt ladder.(k) (* -------------------------------------------------------------------------- *) (* --- Formatters Syntax --- *) (* -------------------------------------------------------------------------- *) type command = | CMD of string | ARG of string * string | TEXT type console = { env : (Format.formatter -> string -> string -> unit) ; line : Buffer.t ; mutable spaces : int ; fline : Format.formatter ; foutput : Format.formatter ; } let spaces = String.make 80 ' ' let rec add_spaces buffer n = if n > 0 then if n < 80 then Buffer.add_substring buffer spaces 0 n else ( Buffer.add_string buffer spaces ; add_spaces buffer (n-80) ) let spaces console = begin Format.pp_print_flush console.fline () ; if console.spaces > 0 then ( add_spaces console.line console.spaces ; console.spaces <- 0 ) ; end let flush console = begin spaces console ; Format.pp_print_string console.foutput (Buffer.contents console.line) ; Buffer.clear console.line ; end let write console text = spaces console ; Buffer.add_string console.line text let env console cmd arg = spaces console ; console.env console.fline cmd arg } let blank = [ ' ' '\t' ] let number = [ '0'-'9' ]+ let ident = [ 'a'-'z' 'A'-'Z' '-' '0'-'9' ]+ let in_braces = [^ '}' ':' ]+ rule word console = parse eof { flush console } | '\n' { flush console ; Format.pp_print_newline console.foutput () ; word console lexbuf } | ' ' { console.spaces <- succ console.spaces ; word console lexbuf } | "&&" { write console "&" ; word console lexbuf } | "%%" { write console "%" ; word console lexbuf } | '&' (number as arg) ':' { Format.pp_print_flush console.fline () ; add_spaces console.line (int_of_string arg - Buffer.length console.line) ; console.spaces <- 0 ; word console lexbuf } | "%{" (in_braces as cmd) ':' (in_braces as arg) '}' | '%' (ident as cmd) ':' (ident as arg) { env console cmd arg ; word console lexbuf } | "%{" (in_braces as cmd) "}" | '%' (ident as cmd) { env console cmd "" ; word console lexbuf } | _ { write console (Lexing.lexeme lexbuf) ; word console lexbuf } and command = parse | blank* '@' (ident as cmd) blank* { CMD cmd } | blank* '@' (ident as cmd) blank+ '"' ([^ '"']* as arg) '"' blank* { ARG(cmd,arg) } | eof { TEXT } | _ { TEXT } { let pretty env fmt msg = let lexbuf = Lexing.from_string msg in let line = Buffer.create 80 in word { line = line ; fline = Format.formatter_of_buffer line ; foutput = fmt ; env = env ; spaces = 0 ; } lexbuf let command msg = let lexbuf = Lexing.from_string msg in command lexbuf } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/script.mli������������������������������������������������������0000666�0000000�0000000�00000004411�13571573400�016120� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Lexer for Script files --- *) (* -------------------------------------------------------------------------- *) type token = | Id of string | Key of string | Proof of string * string | Word | Eof type input val open_file : string -> input val close : input -> unit val skip : input -> unit val token : input -> token val error : input -> ('a,Format.formatter,unit,'b) format4 -> 'a val key : input -> string -> bool val eat : input -> string -> unit val ident : input -> string val idents : input -> string list val filter : string -> string option �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/script.mll������������������������������������������������������0000666�0000000�0000000�00000013214�13571573400�016124� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) { type token = | Id of string | Key of string | Proof of string * string (* script , closing *) | Word | Eof let fill buffer lexbuf = Buffer.add_string buffer (Lexing.lexeme lexbuf) open Lexing let newline lexbuf = lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with pos_lnum = succ lexbuf.lex_curr_p.pos_lnum } } let space = [' ' '\t' '\r'] rule token = parse space+ { token lexbuf } | '\n' { newline lexbuf ; token lexbuf } | "Proof." space* '\n' { newline lexbuf ; let buffer = Buffer.create 512 in let closing = proof buffer 0 lexbuf in Proof (Buffer.contents buffer,closing) } | "Proof." space* { let buffer = Buffer.create 512 in let closing = proof buffer 0 lexbuf in Proof (Buffer.contents buffer,closing) } | [ 'a'-'z' 'A'-'Z' '0'-'9' '_' '-' '*' ]+ { Id (Lexing.lexeme lexbuf) } | [ '.' ':' ',' ';' ] { Key(Lexing.lexeme lexbuf) } | "(*" { comment 0 lexbuf } | eof { Eof } | _ { Word } and comment n = parse "*)" { if n > 0 then comment (pred n) lexbuf else token lexbuf } | "(*" { comment (succ n) lexbuf } | eof { failwith "Non-terminated comment" } | '\n' { newline lexbuf ; comment n lexbuf } | _ { comment n lexbuf } and proof buffer n = parse ( "Qed." | "Save." | "Admitted." ) { if n > 0 then proof buffer (pred n) lexbuf else Lexing.lexeme lexbuf } | "(*@" { skip 0 lexbuf ; proof buffer n lexbuf } | "(*" { fill buffer lexbuf ; proof buffer (succ n) lexbuf } | "*)" { fill buffer lexbuf ; if n>0 then proof buffer (pred n) lexbuf else failwith "Non-terminated comment (inside proof)" } | eof { failwith "Non-terminated proof" } | '\n' { fill buffer lexbuf ; newline lexbuf ; proof buffer n lexbuf } | _ { fill buffer lexbuf ; proof buffer n lexbuf } and skip n = parse | "(*" { skip (succ n) lexbuf } | "*)" { if n>0 then skip (pred n) lexbuf } | eof { () } | "\n" { newline lexbuf ; skip n lexbuf } | _ { skip n lexbuf } { let filter key = let lexbuf = Lexing.from_string key in match token lexbuf with | Id a -> Some a | _ -> None type input = { src : string ; inc : in_channel ; lexbuf : Lexing.lexbuf ; mutable token : token ; mutable tik : int ; } let open_file f = let inc = open_in f in let lex = Lexing.from_channel inc in let tok = token lex in { src=f ; tik=0 ; inc=inc ; lexbuf=lex ; token=tok } let pp_token lexbuf fmt = function | Id x -> Format.fprintf fmt "ident '%s'" x | Key k -> Format.fprintf fmt "'%s'" k | Proof _ -> Format.fprintf fmt "Proof...Qed" | Eof -> Format.fprintf fmt "end-of-file" | Word -> Format.fprintf fmt "start of '%s'" (Lexing.lexeme lexbuf) let skip input = if input.token <> Eof then ( input.tik <- 0 ; input.token <- token input.lexbuf ) let token input = input.tik <- succ input.tik ; if input.tik > 1000 then failwith "Blocked" ; input.token let close input = close_in input.inc let error input text = let buffer = Buffer.create 80 in let fmt = Format.formatter_of_buffer buffer in let line = (Lexing.lexeme_start_p input.lexbuf).Lexing.pos_lnum in Format.fprintf fmt "%s:%d: " input.src line ; Format.kfprintf (fun fmt -> Format.fprintf fmt "(at %a)" (pp_token input.lexbuf) input.token ; Format.pp_print_flush fmt () ; failwith (Buffer.contents buffer) ) fmt text let key input k = match input.token with | (Key a) | (Id a) when a=k -> skip input ; true | _ -> false let eat input k = if not (key input k) then error input "Missing '%s'" k let ident input = match input.token with | Id a -> skip input ; a | _ -> error input "Missing identifier" let rec idents input = match input.token with | Id a -> skip input ; if key input "," then a :: idents input else [a] | Word -> skip input ; if key input "," then idents input else [] | _ -> [] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/����������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015213� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/Makefile.coqwp��������������������������������������������0000666�0000000�0000000�00000006730�13571573400�020011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of WP plug-in of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat a l'energie atomique et aux energies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## WPLSHARE=$(Wp_DIR)/share # -------------------------------------------------------------------------- # --- Coq Compilation # -------------------------------------------------------------------------- .PHONY: coqwpcompile COQWPINCLUDES= -R $(WPLSHARE)/coqwp '' COQWPBINARIES= $(addprefix $(WPLSHARE)/, $(ALL_COQ_BINARIES)) coqwpcompile: $(COQWPBINARIES) $(WPLSHARE)/coqwp/%.vo: $(WPLSHARE)/coqwp/%.v echo "Coqc $<" coqc -w none $(COQWPINCLUDES) $< $(WPLSHARE)/coqwp/%.ide: $(WPLSHARE)/coqwp/%.v echo "Coqide $<" coqide $(COQWPINCLUDES) $< $(WPLSHARE)/coqwp/.depend: $(addprefix $(WPLSHARE)/, $(WP_COQ_SOURCES)) echo "Coqdep $(WPLSHARE)/coqwp" @coqdep $(COQWPINCLUDES) $(WPLSHARE)/coqwp/*.v $(WPLSHARE)/coqwp/**/*.v > $@ # -------------------------------------------------------------------------- # --- Additional Targets # -------------------------------------------------------------------------- .PHONY: wp-coq-compile wp-coq-clean wp-coq-install wp-coq-uninstall wp-coq-compile: coqwpcompile @echo "Run 'make wp-coq-install' to install all precompiled libraries" wp-coq-clean: find $(Wp_DIR) \( -name "*.vo" -or -name "*.glob" -or -name ".*.aux" \) -delete rm -f $(WPLSHARE)/coqwp/.depend wp-coq-install: $(PRINT_INSTALL) "Coq Libraries" $(INSTALL_SHARE) -f -p -s \ -i $(Wp_DIR)/share \ -d $(FRAMAC_DATADIR)/wp \ $(ALL_COQ_BINARIES) wp-coq-uninstall: $(PRINT_RM) "Coq Libraries" @rm -f $(FRAMAC_DATADIR)/wp/why3/*.vo @rm -f $(FRAMAC_DATADIR)/wp/coqwp/*.vo @rm -f $(FRAMAC_DATADIR)/wp/coqwp/*/*.vo # -------------------------------------------------------------------------- # --- Coq Dependencies # -------------------------------------------------------------------------- ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) ifneq ($(MAKECMDGOALS),smartclean) sinclude $(WPLSHARE)/coqwp/.depend endif endif endif # -------------------------------------------------------------------------- ����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/Makefile.resources����������������������������������������0000666�0000000�0000000�00000010506�13571573400�020666� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������########################################################################## # # # This file is part of WP plug-in of Frama-C. # # # # Copyright (C) 2007-2019 # # CEA (Commissariat a l'energie atomique et aux energies # # alternatives) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version 2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## # -------------------------------------------------------------------------- # --- Why-3 Libraries # -------------------------------------------------------------------------- ## Used in share/why3 WHY3_LIBS_CEA:= \ cbits.mlw \ cint.mlw \ cfloat.mlw \ cmath.mlw \ memory.mlw \ qed.mlw \ vset.mlw \ vlist.mlw ## Used in share/why3 WHY3_API_LIBS_CEA:= WHY3_LIBS_CEA # -------------------------------------------------------------------------- # --- Coq Libraries # -------------------------------------------------------------------------- ## Used in share/coqwp COQ_LIBS_CEA:= \ ArcTrigo.v \ Bits.v \ Cbits.v \ Cfloat.v \ Cint.v \ Cmath.v \ Square.v \ ExpLog.v \ Memory.v \ Qed.v \ Qedlib.v \ Vset.v \ Vlist.v \ Zbits.v COQ_LIBS_INRIA:=\ BuiltIn.v \ HighOrd.v \ bool/Bool.v \ int/Abs.v \ int/ComputerDivision.v \ int/EuclideanDivision.v \ int/ComputerOfEuclideanDivision.v \ int/Exponentiation.v \ int/Int.v \ int/MinMax.v \ int/Power.v \ map/Map.v \ map/Const.v \ real/Abs.v \ real/FromInt.v \ real/MinMax.v \ real/Real.v \ real/RealInfix.v \ real/Square.v \ real/ExpLog.v \ real/PowerReal.v \ real/Trigonometry.v # -------------------------------------------------------------------------- # --- Alt-Ergo Libraries # -------------------------------------------------------------------------- # Used in share/ergo ERGO_LIBS_CEA:= \ ArcTrigo.mlw \ Cbits.mlw \ Cfloat.mlw \ Cint.mlw \ Cmath.mlw \ Square.mlw \ ExpLog.mlw \ Memory.mlw \ Qed.mlw \ Vset.mlw \ Vlist.mlw ERGO_LIBS_INRIA:= \ bool.Bool.mlw \ int.Abs.mlw \ int.ComputerDivision.mlw \ int.ComputerOfEuclideanDivision.mlw \ int.Int.mlw \ int.MinMax.mlw \ map.Map.mlw \ map.Const.mlw \ real.Abs.mlw \ real.FromInt.mlw \ real.MinMax.mlw \ real.Real.mlw \ real.RealInfix.mlw \ real.Square.mlw \ real.Truncate.mlw \ real.ExpLog.mlw \ real.PowerReal.mlw \ real.Trigonometry.mlw \ real.Hyperbolic.mlw \ real.Polar.mlw # -------------------------------------------------------------------------- # --- LICENSES # -------------------------------------------------------------------------- # Resource classes for license header files # These files are relatives to this directory WP_SHARE_SRC_CEA_RESOURCES:= \ wp.driver \ why3/coq.drv \ $(addprefix why3/frama_c_wp/, $(WHY3_LIBS_CEA)) \ $(addprefix coqwp/, $(COQ_LIBS_CEA)) \ $(addprefix ergo/, $(ERGO_LIBS_CEA)) ALL_CEA_RESOURCES+= \ install.ml \ Makefile.resources \ Makefile.coqwp \ $(WP_SHARE_SRC_CEA_RESOURCES) ALL_UNMODIFIED_WHY3_RESOURCES:= \ $(addprefix coqwp/, $(COQ_LIBS_INRIA)) ALL_MODIFIED_WHY3_RESOURCES:= \ $(addprefix ergo/, $(ERGO_LIBS_INRIA)) ########################################################################## # Local Variables: # mode: makefile # End: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/����������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016344� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/ArcTrigo.v������������������������������������������0000666�0000000�0000000�00000004515�13571573400�020252� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.R_sqrt. Require Reals.Rbasic_fun. Require Reals.Rtrigo_def. Require Reals.Rtrigo1. Require Reals.Ratan. Require BuiltIn. Require real.Real. Require real.RealInfix. Require real.Abs. Require real.Square. Require real.Trigonometry. (* Why3 goal *) Definition asin : R -> R. Admitted. (* Why3 goal *) Definition acos : R -> R. Admitted. (* Why3 goal *) Lemma Sin_asin : forall (x:R), (((-1%R)%R <= x)%R /\ (x <= 1%R)%R) -> ((Reals.Rtrigo_def.sin (asin x)) = x). Admitted. (* Why3 goal *) Lemma Cos_acos : forall (x:R), (((-1%R)%R <= x)%R /\ (x <= 1%R)%R) -> ((Reals.Rtrigo_def.cos (acos x)) = x). Admitted. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Bits.v����������������������������������������������0000666�0000000�0000000�00000123166�13571573400�017445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** * C-Integer Library for Coq *) (* -------------------------------------------------------------------------- *) (** This module provides a theory of bits over [Z] natural integers. - for natural [n], the [k]-th bit of [2^n] if [(k=n)] ; - for positive integer [x>=0], it is the union of the bits of its binary decomposition (hence, natural powers of two) ; - finally, the bits of a negative integer [x<0] are the reverted ones of its two's complement [-(x+1)]. The realization of the theory proceeds into several stages, following the Coq definition of type [Z]. We take advantage of the bitwize representation of positive integers provided by the [positive] type in Coq. The successive stages are: - properties of {!trailing:bit-functions} (finally ending by 1-sequence or 0-sequence); - bits of {!positive:positive} integers [p>0]; - bits of {!natural:natural} integers [n>=0]; - bits of {!integer:integers} [n:Z]. The {!Zbit:characteristic} function of integers, denoted [Zbit], have the expected logical properties: - [(Zbit 0 k)] is [false]; - [(Zbit (-1) k)] is [true]; - [(Zbit (2^n) k)] is [(k=n)]; - [Zbit] is injective, ie: the bit representation of each integer is unique. *) (** ** Type of characteristic functions of integers *) Definition Zfc := nat -> bool. (** ** Tacticals *) Require Import ZArith. Require Import FunctionalExtensionality. Require Import Qedlib. Close Scope Z_scope. (** Induction after a given rank. *) Remark upper_nat_ind: forall P (n:nat), P n -> (forall k, (n < k) -> P k) -> (forall k, (n <= k) -> P k). Proof. intros. case (le_lt_eq_dec n k); intuition (subst; auto with arith). Qed. (** Induction over bool with equality. *) Ltac case_eqb H e := pattern e; apply Sumbool.bool_eq_ind; intro H. (** Find arithmetic contradiction. *) Ltac arithContradiction := cut False; [contradiction; try omega|];auto with arith. (** Cases [Inf:i<j], [EQ:i=j] and [Sup:i>j]. *) Ltac nat_compare Inf EQ Sup i j := destruct (lt_eq_lt_dec i j) as [ TMP | Sup ]; [ destruct TMP as [ Inf | EQ ]; [ | try rewrite <- EQ ] | ]; auto with arith. (** Cases [Inf:i<j], [EQ:i=j] and [Sup:i>j]. *) Ltac Z_compare Inf EQ Sup i j := destruct (Z_dec i j) as [ TMP| EQ ]; [ destruct TMP as [ Inf | Sup ] | try rewrite <- EQ ]; auto with zarith. (** For proving a symmetrical relation [P], it is sufficient to prove [P i j] for [i<j] and [P i i]. *) Lemma symmetrical_ind: forall (P : nat -> nat -> Prop), (forall i j, P i j -> P j i) -> (forall i, P i i) -> (forall i j, i < j -> P i j) -> (forall i j, P i j). Proof. intros P Sym Diag Triangle i j. nat_compare Inf EQ Sup i j. Qed. (** * remarks about two_power_nat *) Remark two_power_nat_is_positive: forall n, (0 < two_power_nat n)%Z. Proof. induction n. (** base *) + by compute. (** ind. *) + rewrite two_power_nat_S. apply Zmult_lt_0_compat. by compute. auto. Qed. Remark two_power_nat_plus: forall n m, (two_power_nat (n+m) = (two_power_nat n)*(two_power_nat m))%Z. Proof. induction m. (replace (two_power_nat 0) with 1%Z by (compute;forward)). (replace (n + 0) with n by (auto with zarith)). ring. rewrite two_power_nat_S. replace (n + S m) with (S(n+m)) by (auto with zarith). rewrite two_power_nat_S. rewrite IHm. ring. Qed. Remark two_power_nat_increase: forall n m, n <= m -> (two_power_nat n <= two_power_nat m)%Z. Proof. intros. rewrite ((le_plus_minus n m) H). rewrite two_power_nat_plus. generalize (two_power_nat_is_positive (m - n)). pose (K:=(two_power_nat (m - n))); fold K; intro. generalize (two_power_nat_is_positive n); intro. rewrite <- (Z.mul_1_r (two_power_nat n)) at 1. apply Zmult_le_compat_l; omega. Qed. Remark two_power_nat_increase_strict: forall n m, n < m -> (two_power_nat n < two_power_nat m)%Z. Proof. intros. rewrite (le_plus_minus (n+1) m) by omega. rewrite two_power_nat_plus. generalize (two_power_nat_is_positive (m - (n+1))). pose (K:=(two_power_nat (m - (n+1)))); fold K; intro. rewrite two_power_nat_plus. replace (two_power_nat 1) with 2%Z by (compute; trivial). generalize (two_power_nat_is_positive n); intro. rewrite <- (Z.mul_1_r (two_power_nat n)) at 1. replace (two_power_nat n * 2 * K)%Z with (two_power_nat n * (2 * K))%Z by ring. apply Zmult_gt_0_lt_compat_l; omega. Qed. (** {@trailing:} *) (** * Eventually constant functions *) (** The bits representation of [Z] integers are eventually constant [nat -> bool] functions. Positive integers finally ends with an infinite sequence of 0-bits, while negative inetegers ends with 1-bits. Hence, it is always possible to defined the highest significant sign-bit of a bit function. This section formalize these properties: predicate [trailing] defines an eventually constant bit function, and function [last] returns its highest significant bit. *) (** Function [f] has constant value [b] from rank [k]. *) Definition trailing f (n:nat) (b:bool) := forall k, n <= k -> f k = b. (** Returns the lowest index such than [f n=b], and [n] otherwise. *) Fixpoint last f n b {struct n} := match n with | O => O | S m => if Bool.eqb (f m) b then last f m b else n end. (** Functions last decreases. *) Remark last_leq : forall f n b, last f n b <= n. Proof. intros f n b. induction n; auto. simpl. destruct (Bool.eqb (f n) b); auto. Qed. (** Trailing of previous position. *) Remark trailing_step : forall f n b, f n = b -> trailing f (S n) b -> trailing f n b. Proof. intros f n b fn tl. unfold trailing. apply upper_nat_ind; auto with arith. Qed. (** Last preserves trailing. *) Remark trailing_last : forall f n b, trailing f n b -> trailing f (last f n b) b. Proof. intros f n b. induction n; simpl; auto. intro IHS. case_eqb H (Bool.eqb (f n) b); auto. apply IHn. apply trailing_step; [ apply Bool.eqb_prop | ]; auto. Qed. (** The [last] is null or points to a flip. *) Remark last_null_or_flip: forall (f: Zfc) (n: nat) (b: bool), last f n b = O \/ exists k, last f n b = S k /\ f k <> b. Proof. intros f n b. induction n; simpl; auto. case_eqb BIT (Bool.eqb (f n) b). auto. right. exists n. split; [ auto | apply Bool.eqb_false_iff; auto ]. Qed. (** The [last] of trailing is unique. *) Lemma last_trail_ext: forall (f: Zfc) (b: bool) (n m: nat), trailing f n b -> trailing f m b -> last f n b = last f m b. Proof. intros f b. cut (forall n m, trailing f n b -> trailing f m b -> last f n b < last f m b -> False). { intros ABSURD n m. intros Hn Hm. nat_compare INF EQ SUP (last f n b) (last f m b); auto. (** INF *) * apply False_ind; apply (ABSURD n m); auto. (** SUP *) * apply False_ind; apply (ABSURD m n); auto. } intros n m Hn Hm. pose ( i := last f n b ). fold i. pose ( j := last f m b ). fold j. intro Leq. assert (Hi : trailing f i b) by (unfold i; apply trailing_last; auto). assert (Hj : trailing f j b) by (unfold j; apply trailing_last; auto). assert (Range : forall k, i <= k <= j -> f k = b) by (intros k [lo up]; auto with arith). generalize (last_null_or_flip f m b). intros [ Last_null | Last_flip ]. (** Last is Null *) + fold j in Last_null. rewrite Last_null in Leq. omega. (** Last if a flip *) + destruct Last_flip as [ k [ kj flip ] ]. fold j in kj. absurd (f k = b); auto. apply Range; omega. Qed. (** {@positive:} *) (** * Bits of positive integers *) (** Strictly positive integers are represented in Coq by theirs bits, with lowest bits as head constructors, and highest bit at tail. Conversely, given a finite range of bits ended by a 1-bit, the reconstruction of a [positive] integer is defined. *) (** Position of the highest significant bit of a positive. *) Fixpoint xHpos (p:positive): nat := match p with | xH => O | xI p => S (xHpos p) | xO p => S (xHpos p) end. (** [xHpos] increases. *) Remark xHpos_incr : forall p a: positive, xHpos p <= xHpos (p + a). Proof. induction p; intros; simpl; case a; intros; simpl; try omega; apply le_n_S; try rewrite Pplus_one_succ_r; try (rewrite Pplus_carry_spec; rewrite Pplus_one_succ_r;rewrite<- Pplus_assoc); try solve [apply (IHp p0) | apply (IHp 1%positive)|apply (IHp (p0+1%positive)%positive)]. Qed. (** Return the value of the [i]-th bit of a positive. *) Fixpoint P_decomp (x: positive) (i: nat) { struct x } : bool := match i, x with | O, xH => true | O, xI _ => true | O, xO _ => false | S m, xH => false | S m, xI p => P_decomp p m | S m, xO p => P_decomp p m end. (** Returns the positive of bits [[f i,...,f (i+n-1),1]]. Remark the [n]-th bit is always 1 ([xH]). *) Fixpoint P_recomp (n: nat) (f : Zfc) (i: nat) {struct n } := match n with | O => xH | S m => if (f i) then xI (P_recomp m f (S i)) else xO (P_recomp m f (S i)) end. (** ** Properties of decomposition *) (** After the highest bits, all bits are false. *) Remark P_decomp_limit: forall x k, k > xHpos x -> P_decomp x k = false. Proof. induction x; simpl; intros; destruct k. inversion H. apply IHx. auto with arith. inversion H. apply IHx. auto with arith. inversion H. auto with arith. Qed. (** The highest bit is true. *) Remark P_decomp_xHpos: forall x, P_decomp x (xHpos x) = true. Proof. induction x; simpl; intros; auto. Qed. (** The [P_shift] of [nat -> A] functions. *) Definition P_shift {A:Type} f i k : A := f (i + k). (** bits of a positive with one more 1-bit. *) Remark P_decomp_shift1: forall p: positive, P_shift (P_decomp p~1) 1 = P_decomp p. Proof. intro p. extensionality k. unfold P_shift. auto. Qed. (** bits of a positive with one more 0-bit. *) Remark P_decomp_shift0: forall p: positive, P_shift (P_decomp p~0) 1 = P_decomp p. Proof. intro p. extensionality k. unfold P_shift. auto. Qed. (** ** Properties of recomposition *) (** Recomposition of shifted bits. *) Remark P_recomp_shift: forall (f: Zfc) (n i j: nat), P_recomp n f (i+j) = P_recomp n (P_shift f i) j. Proof. intros f n. induction n; intros i j; simpl; auto. unfold P_shift at 1. case_eqb BIT (f (i+j)); f_equal; (replace (S(i+j)) with (i + S j) by omega); apply IHn. Qed. (** Highest bits of recomposition. *) Remark xHpos_P_recomp: forall (n: nat) (f: Zfc) (i: nat), xHpos (P_recomp n f i) = n. Proof. intros n f. induction n. simpl. auto. intros. simpl. destruct (f i); simpl; f_equal; apply IHn. Qed. (** ** Involution of decomposition and recomposition *) (** Invariance by 1-bit shift. *) Remark NEXT_I: forall (n: nat) (p: positive), P_recomp n (P_decomp p~1) 1 = P_recomp n (P_decomp p) 0. Proof. intros. replace 1 with (1+0) by omega. rewrite P_recomp_shift. rewrite P_decomp_shift1. auto. Qed. (** Invariance by 0-bit shift. *) Remark NEXT_O: forall (n: nat) (p: positive), P_recomp n (P_decomp p~0) 1 = P_recomp n (P_decomp p) 0. Proof. intros. replace 1 with (1+0) by omega. rewrite P_recomp_shift. rewrite P_decomp_shift0. auto. Qed. (** Recomposition of Decomposition. *) Lemma P_recomp_decomp: forall (n: nat) (p: positive), n = xHpos p -> P_recomp n (P_decomp p) O = p. Proof. induction n;intros;simpl. destruct p; inversion H; auto. destruct p; unfold P_decomp at 1; f_equal. rewrite NEXT_I. apply IHn. inversion H; auto with arith. rewrite NEXT_O. apply IHn. inversion H; auto with arith. inversion H. Qed. (** Decomposition of Recomposition. The induction scheeme of the proof requires to recompose an arbitrary shifted function. *) Lemma P_decomp_recomp: forall (f: Zfc) (n i k: nat), k < n -> P_decomp (P_recomp n f i) k = f (i+k). Proof. intros f n. induction n. intros. apply False_ind. omega. intros i k Limit. simpl. destruct k. case_eqb Fi (f i); simpl; rewrite <- Fi; f_equal; omega. destruct (f i); simpl. rewrite IHn. f_equal. omega. omega. rewrite IHn. f_equal. omega. omega. Qed. (** Last bits of positive. *) Remark last_P_decomp: forall (p: positive) (m: nat), m = xHpos p -> last (P_decomp p) (S m) false = (S m). Proof. intros p m Hm. unfold last; rewrite Hm; rewrite P_decomp_xHpos; simpl; auto. Qed. (** {@natural:} *) (** * Bits of natural integers *) (** The section naturally extends bits of [positive] to [N]. Zero is represented by the infinite sequence of 0-bits. *) (** Conversion from [Z] to [N]. *) Definition Nabs (x:Z): N := match x with | Z0 => N0 | Zpos p => Npos p | Zneg p => Npos p end. (** Number of significative bits (last 1-bit) of a natural. *) Definition NxHpos (n:N): nat := match n with | N0 => O | Npos p => S (xHpos p) end. (** NxHpos increases. *) Remark NxHpos_incr: forall x a: N, NxHpos x <= NxHpos (x + a). Proof. destruct x; destruct a; simpl; try (by compute). cut (xHpos p <= xHpos (p + p0)). omega. apply xHpos_incr. Qed. (** Arithmetic properties of [NxHpos] *) Remark NxHpos_2x_p0: forall n:N, (0 < n)%N -> NxHpos (2 * n) = S (NxHpos n). Proof. destruct n; by simpl. Qed. Remark NxHpos_2x_p1: forall n:N, NxHpos (2 * n + 1) = S (NxHpos n). Proof. destruct n ; by simpl. Qed. Remark NxHpos_div2_p: forall n:N, (0 < n)%N -> NxHpos (N.div2 n) = pred (NxHpos n). Proof. destruct n. (** zero *) + by compute. (** positive *) + by destruct p. Qed. (** Bits of a natural integer *) Definition N_decomp (x: N): Zfc := match x with | N0 => (fun _ => false) | Npos p => P_decomp p end. (** Recomposition of an integer from a range of [n]-bits *) Definition N_recomp (n: nat) (f: Zfc): Z := match last f n false with | O => Z0 | S m => Zpos (P_recomp m f 0) end. (** Recomposition result is a positive integer. *) Remark N_recomp_pos: forall (n: nat) (f: Zfc), (0 <= N_recomp n f)%Z. Proof. intros. unfold N_recomp. destruct (last f n false); auto with zarith. Qed. (** Zero has a unique representation *) Remark N_recomp_zero: forall (n: nat) (f: Zfc), trailing f n false -> (N_recomp n f = 0)%Z -> forall k, f k = false. Proof. intros n f Trail. unfold N_recomp. destruct (last_null_or_flip f n false) as [ZERO | FLIP]. rewrite ZERO. intros. generalize (trailing_last f n false). intro TLAST. rewrite ZERO in TLAST. apply TLAST; auto with arith. destruct FLIP as [k [L F]]. rewrite L. discriminate. Qed. (** One has a unique representation *) Remark N_recomp_one: forall (n: nat) (f: Zfc), trailing f n false -> (N_recomp n f = 1)%Z -> f O = true /\ forall k, f (S k) = false. Proof. intros n f Trail. unfold N_recomp. destruct (last_null_or_flip f n false) as [ZERO | FLIP]. rewrite ZERO. intros. apply False_ind. omega. destruct (last f n false) eqn:LAST. intros. apply False_ind. omega. intro ONE. assert (XH: P_recomp n0 f 0 = xH). inversion ONE; trivial. destruct FLIP as [ K1 [ SKN B1not ] ]. assert (NK : n0 = K1) by ( auto with arith ). rewrite NK in *. assert (B1 : f K1 = true) by ( destruct (f K1); auto ). assert (T1 : trailing f (S K1) false). { rewrite <- LAST. apply trailing_last; auto. } destruct K1. + rewrite B1 in *. split; auto. intro k; destruct k; apply T1; auto with arith. + simpl in XH. destruct (f 0). * apply False_ind. discriminate. * apply False_ind. discriminate. Qed. (** Involution of Decomposition and Recomposition *) Lemma N_decomp_recomp: forall (n: nat) (f: Zfc), trailing f n false -> N_decomp (Nabs (N_recomp n f)) = f. Proof. intros n f Trail. unfold N_recomp. generalize (last_null_or_flip f n false). intros [ ZERO | FLIP ]. (** ZERO *) + rewrite ZERO. simpl. extensionality k. symmetry. cut (trailing f 0 false). intro H. apply H. omega. rewrite <- ZERO. apply trailing_last. auto. (** FLIP *) + destruct FLIP as [k [Last Flip]]. rewrite Last. simpl. extensionality i. nat_compare Inf EQ Sup i k. (** Inf *) * apply P_decomp_recomp. auto. (** Eq *) * generalize (xHpos_P_recomp i f 0). pose (x := P_recomp i f 0). fold x. intro xHi. rewrite <- xHi. rewrite P_decomp_xHpos. rewrite xHi. rewrite EQ. case_eqb FK (f k); auto; contradiction. (** Sup *) * generalize (xHpos_P_recomp k f 0). pose (x := P_recomp k f 0). fold x. intro xHk. rewrite (P_decomp_limit x i); [|rewrite xHk;auto]. cut (trailing f (S k) false). intro H. symmetry. apply H. omega. rewrite <- Last. apply trailing_last. auto. Qed. (** [NxHpos] of a recomposition *) Lemma NxHpos_N_recomp_pos: forall (n: nat) (f: Zfc), NxHpos (Nabs (N_recomp n f)) = last f n false. Proof. intros. unfold N_recomp. elim (last_null_or_flip f n false). intro ZERO. rewrite ZERO. auto. intros [ k [ LAST FLIP ] ]. rewrite LAST. simpl. rewrite xHpos_P_recomp. trivial. Qed. (** {@integer:} *) (** * Bits of Integers *) Local Open Scope Z_scope. (** The bits representation of an integer consists of a bit function, packed with its trailing property. This representation is _not_ unique. However, the unicity of last significant bits implies an extensionality equality: if two [bits] records have the same bit function, they represent the same integer, see [Lemma btest_ext]. *) Record bits: Type := mkbits { bsize:nat; bsign: bool; btest: Zfc; btrail : trailing btest bsize bsign }. (** ** Two's complement and bits inversion *) (** As specified in the introduction, the extension positive integers [N] to [Z] is realized by two's complement and bit inversion. *) (** Two's complement and related properties. *) Definition zlnot x:Z := -(x + 1). Remark zlnot_inv: forall x, zlnot (zlnot x) = x. Proof. intros. unfold zlnot. auto with zarith. Qed. Remark zlnot_inj: forall x y : Z, (zlnot x) = (zlnot y) -> x = y. Proof. unfold zlnot. intros. omega. Qed. Remark zlnot_sym: forall x y : Z, (zlnot x) = y -> x = (zlnot y). Proof. unfold zlnot. intros. omega. Qed. Lemma P_zlnot_sym: forall P (b: Z), 0 <= b -> ((forall z: Z, -b <= z -> P z) -> (forall z:Z, z < b -> P (zlnot z))). Proof. intros P b Bge0 Hyp z H. assert (-b <= zlnot z). unfold zlnot. omega. apply Hyp. auto. Qed. Lemma P_zlnot_sym_rev: forall P (b: Z), 0 <= b -> ((forall z:Z, z < b -> P z) -> (forall z:Z, -b <= z -> P (zlnot z))). Proof. intros P b Bge0 Hyp z H. assert (zlnot z < b). unfold zlnot. omega. apply Hyp. auto. Qed. (** Bit inversion and related properties. *) Definition fnot (f: Zfc): Zfc := (fun k => negb (f k)). Remark fnot_inv: forall f: Zfc, fnot (fnot f) = f. Proof. intros. extensionality k. unfold fnot. destruct (f k); auto. Qed. Remark fnot_inj: forall f g, fnot f = fnot g -> f = g. Proof. intros. generalize (fnot_inv f); intro E; rewrite <- E; clear E. generalize (fnot_inv g); intro E; rewrite <- E; clear E. rewrite H. auto. Qed. Remark fnot_sym: forall f g: Zfc, (fnot f) = g -> f = (fnot g). Proof. intros. apply (fnot_inj f). rewrite (fnot_inv). auto. Qed. (** Lifting of [fnot] to [trailing] *) Remark trailing_fnot: forall (f: Zfc) (n: nat) (b: bool), trailing (fnot f) n (negb b) -> trailing f n b. Proof. intros. unfold trailing. intros k Hk. generalize (H k Hk). intro E. rewrite <- (fnot_inv f). unfold fnot. unfold fnot in E. rewrite E. rewrite Bool.negb_involutive. trivial. Qed. (** Lifting of [fnot] to [last] *) Remark last_fnot: forall (f: Zfc) (n: nat) (b: bool), last (fnot f) n (negb b) = last f n b. Proof. intros. induction n. simpl. trivial. simpl. case_eqb H (Bool.eqb (f n) b). (** TRUE *) + unfold fnot. destruct (f n); destruct b; simpl in *; (discriminate || apply IHn). (** FALSE *) + unfold fnot. destruct (f n); destruct b; simpl in *; ( discriminate || auto). Qed. (** ** Decomposition and Recomposition of integers *) (** Trailing bits of positive integers *) Remark Zpos_decomp_trail: forall n: N, trailing (N_decomp n) (NxHpos n) false. Proof. intro n. induction n. unfold trailing. auto. unfold trailing. simpl. intro k. apply P_decomp_limit. Qed. (** Trailing bits of positive integers *) Remark Zneg_decomp_trail: forall n: N, trailing (fnot (N_decomp n)) (NxHpos n) true. Proof. intro n. unfold trailing. intros. unfold fnot. by (rewrite Zpos_decomp_trail). Qed. (** Bits decomposition of [Z] integers *) Program Definition bits_of_Z (x:Z): bits := if (Zle_bool 0 x) then let n := Nabs x in mkbits (NxHpos n) false (N_decomp n) (Zpos_decomp_trail n) else let n := Nabs (zlnot x) in mkbits (NxHpos n) true (fnot (N_decomp n)) (Zneg_decomp_trail n). (** Recomposition of an integers from its bits *) Definition Z_of_bits (b: bits): Z := if bsign b then zlnot (N_recomp (bsize b) (fnot (btest b))) else N_recomp (bsize b) (btest b). (** ** Extensional unicity of bits representation *) (** Same [Zfc] implies equality of signs *) Remark btest_sign: forall x y: bits, btest x = btest y -> bsign x = bsign y. Proof. destruct x. destruct y. simpl in * . pose (k := max bsize0 bsize1). generalize (btrail0 k). intro H0. generalize (btrail1 k). intro H1. intro BEQ. rewrite <- H0; unfold k; auto with arith. rewrite <- H1; unfold k; auto with arith. rewrite BEQ. auto. Qed. (** Opposite [Zfc] implies opposite signs *) Remark btest_sign_sym: forall x y: bits, btest x = fnot (btest y) -> bsign x = negb (bsign y). Proof. destruct x. destruct y. simpl in * . pose (k := max bsize0 bsize1). generalize (btrail0 k). intro H0. generalize (btrail1 k). intro H1. intro BEQ. rewrite <- H0; unfold k; auto with arith. rewrite <- H1; unfold k; auto with arith. rewrite BEQ. auto. Qed. (** Same [Zfc] leads to equal represented integers *) Lemma btest_ext: forall x y: bits, btest x = btest y -> Z_of_bits x = Z_of_bits y. Proof. intros x y BEQ. assert (bsign x = bsign y) as SEQ. apply btest_sign. auto. unfold Z_of_bits. rewrite <- BEQ. rewrite <- SEQ. case_eqb SIGNX (bsign x); [ f_equal | ]; unfold N_recomp; rewrite <- (last_trail_ext _ _ (bsize x) (bsize y)); auto. (** x<0 , trailing ~x |x| false *) + generalize (btrail x). rewrite SIGNX. unfold trailing. intros T k R. unfold fnot. rewrite T; auto with arith. (** x<0 , trailing ~x |y| false *) + rewrite BEQ. generalize (btrail y). rewrite SIGNX in SEQ. rewrite <- SEQ. unfold trailing. intros T k R. unfold fnot. rewrite T; auto with arith. (** x>0 , trailing x |x| false *) + generalize (btrail x). rewrite SIGNX. auto. (** x>0 , trailing x |y| false *) + generalize (btrail y). rewrite SIGNX in SEQ. rewrite <- SEQ. rewrite <- BEQ. auto. Qed. (** Opposite [Zfc] leads to two's complement represented integers *) Lemma btest_ext_sym: forall x y: bits, btest x = fnot (btest y) -> Z_of_bits x = zlnot (Z_of_bits y). Proof. intros x y BEQ1. assert (btest y = fnot (btest x)) as BEQ2 by (apply fnot_sym; symmetry; auto). assert (bsign x = negb (bsign y)) as SEQ1 by (by apply btest_sign_sym). assert (bsign y = negb (bsign x)) as SEQ2 by (by apply btest_sign_sym). unfold Z_of_bits. rewrite <- BEQ1. rewrite SEQ2. rewrite <- BEQ2. case_eqb SIGNX (bsign x); (try replace (negb true) with false by (compute ; forward)); (try replace (negb false) with true by (compute ; forward)); (try rewrite zlnot_inv); [ f_equal | ]; unfold N_recomp; rewrite <- (last_trail_ext _ _ (bsize x) (bsize y)); auto. (** x<0 , trailing ~x |x| false *) + rewrite BEQ2. generalize (btrail x). rewrite SIGNX. unfold trailing. intros T k R. unfold fnot. rewrite T; auto with arith. (** x<0 , trailing ~x |y| false *) + rewrite BEQ2. generalize (btrail y). rewrite <- BEQ2. rewrite SIGNX in SEQ2. rewrite SEQ2. replace (negb true) with false by auto. auto. (** x>0 , trailing x |x| false *) + generalize (btrail x). rewrite SIGNX. auto. (** x>0 , trailing x |y| false *) + generalize (btrail y). rewrite SIGNX in SEQ2. rewrite SEQ2. replace (negb false) with true by auto. rewrite BEQ1. unfold trailing. intros T k R. unfold fnot. rewrite T; auto with arith. Qed. (** ** Involution of Decomposition and Recomposition *) (** These two fundamental lemmas allow reasoning conversely with bits or integers. *) (** [Z_of_bits] is the inverse of [bits_of_Z] *) Lemma Z_recomp_decomp: forall x: Z, Z_of_bits (bits_of_Z x) = x. Proof. intro x. unfold bits_of_Z. induction x; simpl. (** x = 0 *) + unfold Z_of_bits. simpl. unfold N_recomp. simpl. trivial. (** x = Zpos p *) + unfold Z_of_bits. simpl. unfold N_recomp. rewrite last_P_decomp; auto. rewrite P_recomp_decomp; auto. (** x = Zneg p *) + unfold Z_of_bits. simpl. rewrite fnot_inv. pose ( z := zlnot (Zneg p) ). fold z. generalize (zlnot_inv (Zneg p)). intro H. rewrite <- H. f_equal. fold z. assert (ZDEF: z = Zpos p - 1). (** ZDEF *) * unfold z. unfold zlnot. pose (u := Zneg p). fold u. pose (v := Zpos p). fold v. replace u with (-v) by (unfold u; unfold v; simpl; trivial). omega. (** cont. *) * assert (Q : z = 0 \/ exists q, z = Zpos q). { destruct p. - simpl in ZDEF. right. exists (p~1%positive - 1)%positive. trivial. - simpl in ZDEF. right. exists (p~0%positive - 1)%positive. trivial. - simpl in ZDEF. left. trivial. } elim Q. - intro Z; rewrite Z; simpl. unfold N_recomp. simpl. trivial. - intros [q Z]. rewrite Z; simpl. unfold N_recomp. rewrite last_P_decomp; auto. rewrite P_recomp_decomp; auto. Qed. (** [bits_of_Z] is the inverse of [Z_of_bits] modulo [btest] *) Lemma Z_decomp_recomp: forall b: bits, btest (bits_of_Z (Z_of_bits b)) = btest b. Proof. intros. unfold Z_of_bits. destruct (bsign b) eqn:BSIGN ; unfold bits_of_Z. (** NEGATIVE SIGN *) + pose ( f := fnot (btest b) ). fold f. assert ( Fnot : btest b = fnot f). unfold f. rewrite fnot_inv. auto. pose ( x := N_recomp (bsize b) f ). fold x. assert ( Xpos : 0 <= x ) by ( apply N_recomp_pos; auto with zarith ). repeat rewrite zlnot_inv. case_leq 0 (zlnot x); intro SIGN; simpl. (** 0 <= zlnot x -> contradiction *) * unfold zlnot in SIGN. apply False_ind. omega. (** 0 > zlnot x *) * apply fnot_inj. rewrite fnot_inv. fold f. unfold x. apply N_decomp_recomp. apply trailing_fnot. simpl. rewrite <- BSIGN. rewrite <- Fnot. apply (btrail b). (** POSITIVE SIGN *) + pose ( f := btest b ). fold f. pose ( x := N_recomp (bsize b) f ). fold x. assert ( Xpos : 0 <= x ) by ( apply N_recomp_pos; auto with zarith ). case_leq 0 x; intro H; try (apply False_ind; omega; fail). simpl. unfold f. unfold x. apply N_decomp_recomp. rewrite <- BSIGN. apply (btrail b). Qed. (** Two's complement symmetry. *) Lemma Z_decomp_recomp_sym: forall b: bits, btest (bits_of_Z (zlnot (Z_of_bits b))) = fnot (btest b). Proof. intros. unfold Z_of_bits. destruct (bsign b) eqn:BSIGN; unfold bits_of_Z; (try rewrite zlnot_inv). (** POSITIVE SIGN *) + pose ( f := fnot (btest b)). fold f. pose ( x := N_recomp (bsize b) f ). fold x. assert ( Xpos : 0 <= x ) by ( apply N_recomp_pos; auto with zarith ). case_leq 0 x; intro H; try (apply False_ind; omega; fail). simpl. unfold f. unfold x. apply N_decomp_recomp. apply trailing_fnot. replace (negb false) with true by auto. rewrite fnot_inv. rewrite <- BSIGN. apply (btrail b). (** NEGATIVE SIGN *) + pose ( f := fnot (btest b) ). fold f. assert ( Fnot : btest b = fnot f). unfold f. rewrite fnot_inv. auto. pose ( x := N_recomp (bsize b) (btest b) ). fold x. assert ( Xpos : 0 <= x) by ( apply N_recomp_pos; auto with zarith ). case_leq 0 (zlnot x); intro SIGN; simpl. (** 0 <= zlnot x -> contradiction *) * unfold zlnot in SIGN. apply False_ind. omega. (** 0 > zlnot x *) * unfold f. f_equal. apply N_decomp_recomp. rewrite <- BSIGN. apply (btrail b). Qed. (** [Zfc] can be used to discriminate. *) Lemma btest_discrimination: forall x y: bits, btest x <> btest y -> Z_of_bits x <> Z_of_bits y. Proof. intros x y. intro BNEQ; apply contrap with (Q := btest x = btest y); auto; clear BNEQ. intro. rewrite <- (Z_decomp_recomp x); rewrite <- (Z_decomp_recomp y). f_equal; f_equal; auto. Qed. (** Sign can be used to discriminate. *) Lemma sign_discrimination: forall x y: bits, bsign x <> bsign y -> Z_of_bits x <> Z_of_bits y. Proof. intros x y SNEQ. apply btest_discrimination. apply contrap with (Q := bsign x = bsign y); auto. apply btest_sign. Qed. (** Sign encoding *) Lemma Zsign_encoding: forall z:Z, bsign (bits_of_Z z) = negb (Zle_bool 0 z). Proof. intro z. unfold bits_of_Z. unfold bsign. case_leq 0 z; auto. Qed. Lemma bsign_encoding: forall b:bits, bsign b = negb (Zle_bool 0 (Z_of_bits b)). Proof. intro b. rewrite <- Zsign_encoding. unfold Z_of_bits. destruct (bsign b) eqn:BSIGN ; unfold bits_of_Z. (** NEGATIVE SIGN *) + pose ( f := fnot (btest b) ). fold f. assert ( Fnot : btest b = fnot f). unfold f. rewrite fnot_inv. auto. pose ( x := N_recomp (bsize b) f ). fold x. assert ( Xpos : 0 <= x ) by ( apply N_recomp_pos; auto with zarith ). repeat rewrite zlnot_inv. case_leq 0 (zlnot x); intro SIGN; simpl. (** 0 <= zlnot x -> contradiction *) * unfold zlnot in SIGN. apply False_ind. omega. (** 0 > zlnot x *) * auto. (** POSITIVE SIGN *) + pose ( f := btest b ). fold f. pose ( x := N_recomp (bsize b) f ). fold x. assert ( Xpos : 0 <= x ) by ( apply N_recomp_pos; auto with zarith ). case_leq 0 x; intro H; try (apply False_ind; omega; fail). simpl. auto. Qed. (** {@Zbit:} *) (** * Characteristic Function of integers *) (** Extracts the [k]-th bit of [x]. *) Definition Zbit (x : Z): Zfc := btest (bits_of_Z x). Definition TRUE : Zfc := fun _ => true. Definition FALSE : Zfc := fun _ => false. Lemma Zbit_of_zero: Zbit 0 = FALSE. Proof. unfold Zbit. unfold bits_of_Z. simpl. auto. Qed. Lemma Zbit_of_mone: Zbit (-1) = TRUE. Proof. unfold Zbit. unfold bits_of_Z. simpl. auto. Qed. (** The expected characteristic of binary decomposition of an integer *) Theorem Zbit_power: forall n k:nat, Zbit (two_power_nat n) k = beq_nat n k. Proof. unfold two_power_nat. unfold Zbit. unfold bits_of_Z. simpl. induction n; intro k. (** base *) + simpl; auto. (** ind. *) + unfold shift_nat. destruct k; simpl; auto. Qed. (** The extensional unicity of [Zbit] for each integer *) Theorem Zbit_ext : forall x y: Z, Zbit x = Zbit y -> x = y. Proof. unfold Zbit. intros. rewrite <- (Z_recomp_decomp x). rewrite <- (Z_recomp_decomp y). apply btest_ext. auto. Qed. (** Two's complement symmetry *) Theorem Zbit_ext_sym : forall x y: Z, Zbit x = fnot (Zbit y) -> x = zlnot y. Proof. unfold Zbit. intros. rewrite <- (Z_recomp_decomp x). rewrite <- (Z_recomp_decomp y). apply btest_ext_sym. auto. Qed. (** * Position of the Highest Significant Bit in two's complement representation *) Definition ZxHpos (z:Z): nat := if (Zle_bool 0 z) then NxHpos (Nabs z) else NxHpos (Nabs (zlnot z)). (** Zero has no significant bit, as minus one *) Remark ZxHpos_is_zero: ZxHpos 0 = O /\ ZxHpos (-1) = O. Proof. split; by compute. Qed. (** [bsize] of a [bits_of_Z] gives the exact position. The use of the [last] function gives the exact position. *) Lemma bsize_exact: forall z:Z, ZxHpos (z) = bsize (bits_of_Z z). Proof. intro. unfold bits_of_Z. unfold ZxHpos. case_leq 0 z; unfold bsize; auto. Qed. (** [bsize] over approximates the exact position. The use of the [last] function gives the exact position. *) Lemma bsize_over_approx: forall b:bits, ZxHpos (Z_of_bits b) = last (btest b) (bsize b) (bsign b). Proof. intros. unfold ZxHpos. unfold Z_of_bits. destruct (bsign b) eqn:BSIGN. (** Negative *) + pose ( f := fnot (btest b)). fold f. pose ( x := N_recomp (bsize b) f ). fold x. assert ( Xpos : 0 <= x ) by (apply N_recomp_pos; auto with zarith ). case_leq 0 (zlnot x); intro H; try (unfold zlnot in H; apply False_ind; omega; fail). rewrite zlnot_inv. unfold x. unfold f. rewrite NxHpos_N_recomp_pos. rewrite <- last_fnot. rewrite fnot_inv. by simpl. (** Positive *) + case_leq 0 (N_recomp (bsize b) (btest b)); intro N_recomp. rewrite NxHpos_N_recomp_pos. trivial. generalize (N_recomp_pos(bsize b) (btest b)). intros. apply False_ind. omega. Qed. (** Two's complement symmetry *) Remark ZxHpos_sym: forall z: Z, ZxHpos (zlnot z) = ZxHpos z. Proof. intro. unfold ZxHpos; try rewrite zlnot_inv; unfold zlnot. case_leq 0 z; case_leq 0 (-(z+1)). Qed. (** Position of the highest significant bit of [two_power_nat]. *) Remark ZxHpos_of_two_power_nat: forall n: nat, (ZxHpos (two_power_nat n) = S n)%nat. Proof. intro. unfold ZxHpos. case_leq 0 (two_power_nat n); intro. (** 0 <=two_power_nat n *) + induction n. (** Base *) * by simpl. (** cont. *) * rewrite two_power_nat_S. rewrite two_power_nat_S in H. replace (Nabs (2 * two_power_nat n)) with (2 * Nabs (two_power_nat n))%N by by compute. rewrite NxHpos_2x_p0. by rewrite IHn. by compute. (** 0 > two_power_nat n *) + generalize (two_power_nat_is_positive n). omega. Qed. (** Position of the highest significant bit of the predecessor of [two_power_nat]. *) Remark ZxHpos_of_two_power_nat_minus_one: forall n: nat, (ZxHpos ((two_power_nat n) - 1) = n)%nat. Proof. intro. unfold ZxHpos. case_leq 0 ((two_power_nat n) -1); intro. (** 0 <=(two_power_nat n) - 1 *) + induction n. (** Base *) * by simpl. (** cont. *) * rewrite two_power_nat_S. rewrite two_power_nat_S in H. assert ((Nabs (2 * two_power_nat n - 1) = 2 * Nabs (two_power_nat n - 1) +1)%N) as EQ. { generalize (two_power_nat_is_positive n); intro. assert (0 <= (two_power_nat n - 1)) as A0 by omega. assert (0 < 2 * (two_power_nat n - 1) + 1) as A1 by omega. replace (2 * two_power_nat n - 1) with (2 * (two_power_nat n - 1) + 1) by omega. destruct (two_power_nat n - 1); by auto. } rewrite EQ. rewrite NxHpos_2x_p1. by rewrite IHn. (** 0 > two_power_nat n *) + generalize (two_power_nat_is_positive n). omega. Qed. (** [ZxHpos] increases for positive input values *) Remark ZxHpos_incr_for_positive: forall x a: Z, 0 <= x -> 0 <= a -> (ZxHpos x <= ZxHpos (x + a))%nat. Proof. intros. unfold ZxHpos. case_leq 0 x. case_leq 0 (x + a). intros. destruct x; destruct a; try (by compute). replace (Nabs (Zpos p + Zpos p0)) with (Npos p + Npos p0)%N by forward. apply NxHpos_incr. Qed. (** [ZxHpos] decreases for negative input values *) Remark ZxHpos_decr_for_negative: forall x a: Z, x <= 0 -> a <= 0 -> (ZxHpos x <= ZxHpos (x + a))%nat. Proof. intros. unfold ZxHpos. unfold zlnot. case_leq 0 x; case_leq 0 (x + a); intros; try (replace x with 0 by omega); try (by compute). case_leq (-1) x; intros; try (replace x with (-1) by omega); try (by compute). assert (- (x + 1) >= 0) as X by omega. assert (- a >= 0) as A by omega. clear H; clear H0; clear H1; clear H2; clear H3. replace (-(x+a+1)) with (-(x+1) + -a) by omega. pose (b := -a); fold b; fold b in A. pose (y := -(x+1)); fold y; fold y in X. destruct y; destruct b; try (by compute). replace (Nabs (Zpos p + Zpos p0)) with (Npos p + Npos p0)%N by forward. apply NxHpos_incr. Qed. (** [two_power_nat_of (ZxHpos z)] gives an upper bound for [z] *) Remark two_power_nat_of_ZxHpos: forall z: Z, z < two_power_nat (ZxHpos z). Proof. destruct z. (** zero *) + by compute. (** positive *) + unfold ZxHpos. replace (Nabs (Zpos p)) with (Npos p) by forward. replace (Zpos p) with (Z_of_N (Npos p)) by forward. induction p. (** 2p+1 *) * simpl. simpl in IHp. replace (Zpos p~1) with (2*(Zpos p) + 1)%Z by (auto with zarith). rewrite two_power_nat_S. omega. (** 2p *) * simpl. simpl in IHp. replace (Zpos p~0) with (2*Zpos p)%Z by (auto with zarith). rewrite two_power_nat_S. omega. (** one *) * by compute. (** negative *) + assert (Zneg p < 0)%Z by (by simpl). generalize (two_power_nat_is_positive (ZxHpos (Zneg p))). omega. Qed. (** Lower upper [two_power_nat] bound of an integer. *) Definition ZxHbound (z: Z): Z := two_power_nat (ZxHpos z). Remark ZxHbound_of_two_power_nat_minus_one: forall n: nat, ZxHbound ((two_power_nat n) - 1) = two_power_nat n. Proof. intro. unfold ZxHbound. rewrite ZxHpos_of_two_power_nat_minus_one. auto. Qed. (** [ZxHbound] gives an upper and lower bound. *) Lemma ZxHrange: forall z: Z, let bound := ZxHbound z in -bound <= z < bound. Proof. intro. unfold ZxHbound. case_leq 0 z; intro. (** 0 <= z *) + generalize (two_power_nat_of_ZxHpos z). split; omega. (** 0 > z *) + generalize (two_power_nat_of_ZxHpos (-(z+1))). rewrite <- (ZxHpos_sym z). unfold zlnot. split; omega. Qed. Remark ZxHpos_le: forall x y: Z, ZxHbound x <= ZxHbound y -> (ZxHpos x <= ZxHpos y)%nat. Proof. unfold ZxHbound. intros x y. pose (X := ZxHpos x). fold X. pose (Y := ZxHpos y). fold Y. generalize X Y. induction X0; intro. (** base *) + generalize (two_power_nat_is_positive Y0). replace (two_power_nat 0) with 1 by (compute ; forward). omega. (** cont. *) + rewrite two_power_nat_S. induction Y0. (** base *) * generalize (two_power_nat_is_positive X0). replace (two_power_nat 0) with 1 by (compute ; forward). omega. (** cont. *) * rewrite two_power_nat_S. cut ((2 * two_power_nat X0) <= (2 * two_power_nat Y0) -> (S X0 <= S Y0)%nat). omega. generalize (IHX0 Y0). omega. Qed. Remark ZxHbound_le: forall x y: Z, (ZxHpos x <= ZxHpos y)%nat -> ZxHbound x <= ZxHbound y. Proof. unfold ZxHbound. intros x y. pose (X := ZxHpos x). fold X. pose (Y := ZxHpos y). fold Y. repeat rewrite two_power_nat_S. generalize X Y. induction X0; intro. (** base *) + generalize (two_power_nat_is_positive Y0). replace (two_power_nat 0) with 1 by (compute ; forward). omega. (** cont. *) + rewrite two_power_nat_S. induction Y0. (** base *) * generalize (two_power_nat_is_positive X0). replace (two_power_nat 0) with 1 by (compute ; forward). omega. (** cont. *) * intro. rewrite two_power_nat_S. cut ((2 * two_power_nat X0) <= (2 * two_power_nat Y0)). omega. apply (IHX0 Y0). omega. Qed. Remark ZxHbound_lt: forall x y: Z, (ZxHpos x < ZxHpos y)%nat -> ZxHbound x < ZxHbound y. Proof. unfold ZxHbound. intros x y. pose (X := ZxHpos x). fold X. pose (Y := ZxHpos y). fold Y. repeat rewrite two_power_nat_S. generalize X Y. induction X0; intro. (** base *) + generalize (two_power_nat_is_positive Y0). replace (two_power_nat 0) with 1 by (compute ; forward). induction Y0; repeat rewrite two_power_nat_S; omega. (** cont. *) + rewrite two_power_nat_S. induction Y0. (** base *) * generalize (two_power_nat_is_positive X0). replace (two_power_nat 0) with 1 by (compute;forward). omega. (** cont. *) * intro. rewrite two_power_nat_S. apply (IHX0 Y0). omega. Qed. Lemma ZxHpower: forall (n: nat) (z: Z), -(two_power_nat n) <= z < two_power_nat n -> ZxHbound z <= two_power_nat n. Proof. intros. rewrite <- ZxHbound_of_two_power_nat_minus_one. apply ZxHbound_le. destruct H. case_leq 0 z; intro. (** 0 <= z *) + clear H. replace (two_power_nat n - 1) with (z + ((two_power_nat n - 1) - z)) by auto with zarith. pose (d := ((two_power_nat n - 1) - z)); fold d. assert (0 <= d) as D by (unfold d; omega). by (apply ZxHpos_incr_for_positive). (** 0 > z *) + rewrite <- (ZxHpos_sym z). unfold zlnot. replace (two_power_nat n - 1) with (-(z+1) + (z+two_power_nat n)) by auto with zarith. pose (x := -(z+1)); fold x. pose (d := (z + two_power_nat n)); fold d. assert (0 <= d) as D by (unfold d; omega). apply ZxHpos_incr_for_positive. unfold x. omega. unfold d. omega. Qed. (** ** Main tactics.*) Ltac Zbit_ext k := apply Zbit_ext; extensionality k. Ltac auto_bits := autorewrite with bits ; auto with zarith. Hint Rewrite Zbit_of_zero Zbit_of_mone : bits. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/BuiltIn.v�������������������������������������������0000666�0000000�0000000�00000004066�13571573400�020107� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) Require Export ZArith. Require Export Rbase. Require Import ClassicalEpsilon. Class WhyType T := { why_inhabitant : T ; why_decidable_eq : forall x y : T, { x = y } + { x <> y } }. Notation int := Z. Notation IZR := IZR (only parsing). Global Instance int_WhyType : WhyType int. Proof. split. exact Z0. exact Z.eq_dec. Qed. Notation real := R. Global Instance real_WhyType : WhyType real. Proof. split. exact R0. intros x y. destruct (total_order_T x y) as [[H|H]|H] ; try (left ; exact H) ; right. now apply Rlt_not_eq. now apply Rgt_not_eq. Qed. Global Instance tuple_WhyType : forall T {T' : WhyType T} U {U' : WhyType U}, WhyType (T * U). Proof. intros T WT U WU. split. split ; apply why_inhabitant. intros (x1,x2) (y1,y2). destruct (why_decidable_eq x1 y1) as [H1|H1]. destruct (why_decidable_eq x2 y2) as [H2|H2]. left. now apply f_equal2. right. now injection. right. now injection. Qed. Global Instance unit_WhyType : WhyType unit. Proof. split. exact tt. intros [] []. now left. Qed. Global Instance bool_WhyType : WhyType bool. Proof. split. exact false. exact Bool.bool_dec. Qed. Global Instance func_WhyType : forall (a:Type) {a_WT:WhyType a} (b:Type) {b_WT:WhyType b}, WhyType (a -> b). Proof. intros. repeat split. exact (fun _ => why_inhabitant). intros x y. apply excluded_middle_informative. Qed. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Cbits.v���������������������������������������������0000666�0000000�0000000�00000150342�13571573400�017604� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require Qed. Require bool.Bool. Require int.Int. Require int.Abs. Require int.EuclideanDivision. Require int.ComputerDivision. Require int.ComputerOfEuclideanDivision. Require real.Real. Require real.RealInfix. Require real.FromInt. Require Cint. (* Why3 goal *) Lemma lnot_bool : ((Cint.lnot 0%Z) = (-1%Z)%Z) /\ ((Cint.lnot (-1%Z)%Z) = 0%Z). Proof. split; Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma land_idemp : forall (x:Z), ((Cint.land x x) = x). Proof. intro. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma land_0 : forall (x:Z), ((Cint.land 0%Z x) = 0%Z). Proof. intro. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma land_0bis : forall (x:Z), ((Cint.land x 0%Z) = 0%Z). Proof. intro. rewrite Zbits.land_commut. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma land_1 : forall (x:Z), ((Cint.land (-1%Z)%Z x) = x). Proof. intro. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma land_1bis : forall (x:Z), ((Cint.land x (-1%Z)%Z) = x). Proof. intros x. rewrite Zbits.land_commut. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma land_bool : ((Cint.land 0%Z 0%Z) = 0%Z) /\ (((Cint.land 0%Z 1%Z) = 0%Z) /\ (((Cint.land 1%Z 0%Z) = 0%Z) /\ ((Cint.land 1%Z 1%Z) = 1%Z))). Proof. split;split;split;Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lor_idemp : forall (x:Z), ((Cint.lor x x) = x). Proof. intro. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lor_1 : forall (x:Z), ((Cint.lor (-1%Z)%Z x) = (-1%Z)%Z). Proof. intro. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lor_1bis : forall (x:Z), ((Cint.lor x (-1%Z)%Z) = (-1%Z)%Z). Proof. intros x. rewrite Zbits.lor_commut. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lor_0 : forall (x:Z), ((Cint.lor 0%Z x) = x). Proof. intro. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lor_0bis : forall (x:Z), ((Cint.lor x 0%Z) = x). Proof. intros x. rewrite Zbits.lor_commut. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lor_bool : ((Cint.lor 0%Z 0%Z) = 0%Z) /\ (((Cint.lor 0%Z 1%Z) = 1%Z) /\ (((Cint.lor 1%Z 0%Z) = 1%Z) /\ ((Cint.lor 1%Z 1%Z) = 1%Z))). Proof. split;split;split; Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lxor_nilpotent : forall (x:Z), ((Cint.lxor x x) = 0%Z). Proof. intro. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lxor_1 : forall (x:Z), ((Cint.lxor (-1%Z)%Z x) = (Cint.lnot x)). Proof. intro. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lxor_1bis : forall (x:Z), ((Cint.lxor x (-1%Z)%Z) = (Cint.lnot x)). Proof. intros x. rewrite Zbits.lxor_commut. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lxor_0 : forall (x:Z), ((Cint.lxor 0%Z x) = x). Proof. intro. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lxor_0bis : forall (x:Z), ((Cint.lxor x 0%Z) = x). Proof. intros x. rewrite Zbits.lxor_commut. Zbits.auto_zbits. Qed. (* Why3 goal *) Lemma lxor_bool : ((Cint.lxor 0%Z 0%Z) = 0%Z) /\ (((Cint.lxor 0%Z 1%Z) = 1%Z) /\ (((Cint.lxor 1%Z 0%Z) = 1%Z) /\ ((Cint.lxor 1%Z 1%Z) = 0%Z))). Proof. split; split; split; Zbits.auto_zbits. Qed. Require Import Qedlib. Local Open Scope Z_scope. Require Import Zbits. (* Why3 goal *) Definition bit_testb : Z -> Z -> bool. exact (bit_testb). Defined. (* Why3 goal *) Definition bit_test : Z -> Z -> Prop. exact (fun x i => (bit_testb x i) = true). Defined. (* Why3 goal *) Definition lnot : Z -> Z. exact (lnot). Defined. (* Why3 goal *) Definition land : Z -> Z -> Z. exact (land). Defined. (* Why3 goal *) Definition lxor : Z -> Z -> Z. exact (lxor). Defined. (* Why3 goal *) Definition lor : Z -> Z -> Z. exact (lor). Defined. (* Why3 goal *) Definition lsl : Z -> Z -> Z. exact (lsl). Defined. (* Why3 goal *) Definition lsr : Z -> Z -> Z. exact (lsr). Defined. (** * Bit extraction *) (** Tacticals *) Local Ltac omegaContradiction := cut False; [contradiction|omega]. Ltac unfold_bit_testb h := unfold bit_testb; unfold Zbits.bit_testb; rewrite (Zle_imp_le_bool _ _ h). (** Some useful properties *) Remark Zlt_bool_true_Zlt: forall (b:bool) (x y: Z), (b = Zlt_bool x y) <-> ((b = true) <-> x < y). Proof. intros. split; case_lt x y; intros; try rewrite H0. + split; intro G; auto. + split; intro G; [discriminate G| omega]. + auto. + destruct b; try auto. destruct H0. assert (x < y) by (by (apply H0)). omegaContradiction. Qed. (** ** Definition of bit_test predicate *) (* Why3 goal *) Lemma bit_test_def : forall (x:Z) (k:Z), ((bit_testb x k) = true) <-> (bit_test x k). Proof. intros x k. unfold bit_test. reflexivity. Qed. (** * Link between Bit extraction and bitwise operators *) (** ** Some properties of bit extration *) (** ** Logical operators *) (* Why3 goal *) Lemma bit_test_extraction : forall (x:Z) (k:Z), (0%Z <= k)%Z -> ~ ((land x (lsl 1%Z k)) = 0%Z) <-> (bit_test x k). Proof. intros x k h1. unfold land. unfold lsl; unfold Zbits.lsl. rewrite (Zle_imp_le_bool _ _ h1); unfold Zbits.lsl_def. unfold bit_test; unfold bit_testb; unfold_bit_testb h1; unfold Zbits.zbit_test_def. pose (i:= (Z.abs_nat k)); fold i. split. (** 1st impl *) + intro NEQ. apply Bool.not_false_is_true. contradict NEQ. rewrite Zbits.Zbit_extraction. assumption. (** 2sd impl *) + intro EQ. contradict EQ. rewrite Bool.not_true_iff_false. rewrite <- Zbits.Zbit_extraction. assumption. Qed. (* Why3 goal *) Lemma bit_test_extraction_eq : forall (x:Z) (k:Z), (0%Z <= k)%Z -> ((land x (lsl 1%Z k)) = (lsl 1%Z k)) <-> (bit_test x k). Proof. intros x k h1. unfold land. unfold lsl; unfold Zbits.lsl. rewrite (Zle_imp_le_bool _ _ h1); unfold Zbits.lsl_def. unfold bit_test; unfold bit_testb; unfold_bit_testb h1; unfold Zbits.zbit_test_def. pose (i:= (Z.abs_nat k)); fold i. rewrite Zbits.Zbit_extraction_true. split; auto. Qed. (* Why3 goal *) Lemma lsl_1_0 : ((lsl 1%Z 0%Z) = 1%Z). Proof. compute. auto. Qed. (* Why3 goal *) Lemma bit_test_extraction_bis : forall (x:Z), ~ ((land 1%Z x) = 0%Z) -> bit_test x 0%Z. Proof. intros x. rewrite <- lsl_1_0. intro. apply bit_test_extraction. + omega. + rewrite Zbits.land_commut. auto. Qed. (* Why3 goal *) Lemma bit_test_extraction_bis_eq : forall (x:Z), (bit_test x 0%Z) -> ((land 1%Z x) = 1%Z). Proof. intros x h1. rewrite <- lsl_1_0. rewrite <- Zbits.land_commut. apply bit_test_extraction_eq; auto with zarith. Qed. (* Why3 goal *) Lemma lnot_extraction_bool : forall (x:Z) (i:Z), (0%Z <= i)%Z -> ((bit_testb (lnot x) i) = (Init.Datatypes.negb (bit_testb x i))). Proof. intros x i h1. unfold_bit_testb h1. apply Zbits.lnot_extraction. Qed. (* Why3 goal *) Lemma lnot_extraction : forall (x:Z) (i:Z), (0%Z <= i)%Z -> (bit_test (lnot x) i) <-> ~ (bit_test x i). Proof. intros x i h1. unfold bit_test. rewrite lnot_extraction_bool; auto. pose (xb:=bit_testb x i). fold xb. destruct xb; simpl; split; intros; auto. discriminate H. Qed. (* Why3 goal *) Lemma land_extraction_bool : forall (x:Z) (y:Z) (i:Z), (0%Z <= i)%Z -> ((bit_testb (land x y) i) = (Init.Datatypes.andb (bit_testb x i) (bit_testb y i))). Proof. intros x y i h1. unfold_bit_testb h1. apply Zbits.land_extraction. Qed. (* Why3 goal *) Lemma land_extraction : forall (x:Z) (y:Z) (i:Z), (0%Z <= i)%Z -> (bit_test (land x y) i) <-> ((bit_test x i) /\ (bit_test y i)). Proof. intros x y i h1. unfold bit_test. rewrite land_extraction_bool; auto. pose (xb:=bit_testb x i). fold xb. pose (yb:=bit_testb y i). fold yb. destruct xb; destruct yb; simpl; split; intros; auto; destruct H; auto. Qed. (* Why3 goal *) Lemma lor_extraction_bool : forall (x:Z) (y:Z) (i:Z), (0%Z <= i)%Z -> ((bit_testb (lor x y) i) = (Init.Datatypes.orb (bit_testb x i) (bit_testb y i))). Proof. intros x y i h1. unfold_bit_testb h1. apply Zbits.lor_extraction. Qed. (* Why3 goal *) Lemma lor_extraction : forall (x:Z) (y:Z) (i:Z), (0%Z <= i)%Z -> (bit_test (lor x y) i) <-> ((bit_test x i) \/ (bit_test y i)). Proof. intros x y i h1. unfold bit_test. rewrite lor_extraction_bool; auto. pose (xb:=bit_testb x i). fold xb. pose (yb:=bit_testb y i). fold yb. destruct xb; destruct yb; simpl; split; intros; auto; destruct H; auto. Qed. (* Why3 goal *) Lemma lxor_extraction_bool : forall (x:Z) (y:Z) (i:Z), (0%Z <= i)%Z -> ((bit_testb (lxor x y) i) = (Init.Datatypes.xorb (bit_testb x i) (bit_testb y i))). Proof. intros x y i h1. unfold_bit_testb h1. apply Zbits.lxor_extraction. Qed. (* Why3 goal *) Lemma lxor_extraction : forall (x:Z) (y:Z) (i:Z), (0%Z <= i)%Z -> (bit_test (lxor x y) i) <-> ((bit_test x i) <-> ~ (bit_test y i)). Proof. intros x y i h1. unfold bit_test. rewrite lxor_extraction_bool; auto. pose (xb:=bit_testb x i). fold xb. pose (yb:=bit_testb y i). fold yb. destruct xb; destruct yb; simpl; repeat (split; intros; auto). discriminate H. destruct H; contradiction H; auto. discriminate H0. destruct H; apply H0; discriminate. Qed. (** ** Shift operators *) (* Why3 goal *) Lemma lsl_1_two_power : forall (n:Z), (0%Z <= n)%Z -> ((lsl 1%Z n) = (Cint.two_power_abs n)). Proof. intros n h1. unfold lsl. rewrite Zbits.lsl_pos by auto. unfold Zbits.lsl_def. rewrite Zbits.lsl_arithmetic_shift. unfold Zbits.lsl_arithmetic_def. unfold Cint.two_power_abs. ring. Qed. (* Why3 goal *) Lemma land_1_lsl_1 : forall (a:Z) (x:Z) (n:Z), (0%Z <= n)%Z -> (a < (lsl 1%Z n))%Z -> (((2%Z * a)%Z + (land 1%Z x))%Z < (lsl 1%Z (1%Z + n)%Z))%Z. Proof. intros a x n h1. unfold lsl; unfold Zbits.lsl. case_leq 0%Z (1 + n)%Z ; intro. case_leq 0%Z (n)%Z ; intro. unfold Zbits.lsl_def. rewrite Zbits.lsl_arithmetic_shift. unfold Zbits.lsl_arithmetic_def. rewrite Zabs2Nat.abs_nat_nonneg by auto. rewrite Zabs2Nat.abs_nat_nonneg by auto. rewrite Z2Nat.inj_add by omega. pose (n0:=Z.to_nat n); fold n0. replace ((Z.to_nat 1%Z)%nat) with (1%nat) by auto. rewrite Bits.two_power_nat_plus. replace ((two_power_nat 1)%Z) with (2%Z) by auto with zarith. replace ((1 * two_power_nat n0)%Z) with ((two_power_nat n0)%Z) by auto. replace ((1 * (2 * two_power_nat n0))%Z) with ((2 * two_power_nat n0)%Z) by ring. intro. cut((land 1 x < 2)%Z) ; auto with zarith. case_eq ((land 1 x)%Z) (0%Z); intros. rewrite bit_test_extraction_bis_eq; [omega|]. apply bit_test_extraction_bis. auto. Qed. (** ** Shift operators *) (* Why3 goal *) Lemma lsl_extraction_sup_bool : forall (x:Z) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> (n <= m)%Z -> ((bit_testb (lsl x n) m) = (bit_testb x (m - n)%Z)). Proof. intros x n m h1 h2 h3. unfold lsl. unfold Zbits.lsl. unfold_bit_testb h1. rewrite (Zle_imp_le_bool _ _ h2). rewrite (Zle_imp_le_bool 0 (m - n)) by omega. rewrite Zbits.lsl_extraction. rewrite (Z.abs_eq n); auto. rewrite (Z.abs_eq m); auto. case_leq n m. intros. reflexivity. Qed. (* Why3 goal *) Lemma lsl_extraction_sup : forall (x:Z) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> (n <= m)%Z -> (bit_test (lsl x n) m) <-> (bit_test x (m - n)%Z). Proof. intros x n m h1 h2 h3. unfold bit_test; rewrite lsl_extraction_sup_bool; auto; reflexivity. Qed. (* Why3 goal *) Lemma lsl_extraction_inf_bool : forall (x:Z) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> (m < n)%Z -> ((bit_testb (lsl x n) m) = false). Proof. intros x n m h1 h2 h3. unfold lsl. unfold Zbits.lsl. unfold_bit_testb h1. rewrite (Zle_imp_le_bool _ _ h2). rewrite Zbits.lsl_extraction. rewrite (Z.abs_eq n); auto. rewrite (Z.abs_eq m); auto. case_leq n m. intros. reflexivity. Qed. (* Why3 goal *) Lemma lsl_extraction_inf : forall (x:Z) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> (m < n)%Z -> ~ (bit_test (lsl x n) m). Proof. intros x n m h1 h2 h3. unfold bit_test; rewrite lsl_extraction_inf_bool; auto; reflexivity. Qed. (* Why3 goal *) Lemma lsr_extraction_bool : forall (x:Z) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> ((bit_testb (lsr x n) m) = (bit_testb x (m + n)%Z)). Proof. intros x n m h1 h2. unfold lsr. unfold Zbits.lsr. unfold_bit_testb h1. rewrite (Zle_imp_le_bool _ _ h2). rewrite Zbits.lsr_extraction. rewrite (Z.abs_eq n); auto. rewrite (Z.abs_eq m); auto. case_leq 0 (m+n). intros. reflexivity. Qed. (* Why3 goal *) Lemma lsr_extractionl : forall (x:Z) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> (bit_test (lsr x n) m) <-> (bit_test x (m + n)%Z). Proof. intros x n m h1 h2. unfold bit_test; rewrite lsr_extraction_bool; auto; reflexivity. Qed. (* Why3 goal *) Lemma lsl1_extraction_bool : forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z -> ((bit_testb (lsl 1%Z i) j) = (Qed.eqb i j)). Proof. intros i j h1 h2. unfold lsl. unfold Zbits.lsl. rewrite (Zle_imp_le_bool _ _ h1). unfold_bit_testb h2. unfold Zbits.lsl_def. rewrite Zbits.lsl_arithmetic_shift; unfold Zbits.lsl_arithmetic_def. replace (1 * two_power_nat (Z.abs_nat i)) with (two_power_nat (Z.abs_nat i)) by ring. unfold Zbits.zbit_test_def; rewrite Bits.Zbit_power. rewrite Zabs2Nat.abs_nat_nonneg; auto. rewrite Zabs2Nat.abs_nat_nonneg; auto. case_eq i j. (** i = j *) + intro EQ; rewrite EQ; rewrite <- beq_nat_refl. symmetry. apply Qed.eqb1 ; auto. (** i <> j *) + intro NEQ. assert (Qed.eqb i j = false) as EQB. { apply Qed.eqb_false. assumption. } rewrite EQB. rewrite -> beq_nat_false_iff. contradict NEQ. rewrite Z2Nat.inj_iff in NEQ; auto. Qed. (* Why3 goal *) Lemma lsl1_extraction : forall (i:Z) (j:Z), (0%Z <= i)%Z -> (0%Z <= j)%Z -> (bit_test (lsl 1%Z i) j) <-> (i = j). Proof. intros i j h1 h2. unfold bit_test; rewrite lsl1_extraction_bool; auto. apply Qed.eqb1. Qed. (* Why3 goal *) Lemma pos_extraction_sup : forall (x:Z) (i:Z) (j:Z), (0%Z <= x)%Z -> (0%Z <= i)%Z -> (x < (lsl 1%Z i))%Z -> (i <= j)%Z -> ~ (bit_test x j). Proof. intros x i j h1 h2. unfold lsl ; unfold bit_test. rewrite Zbits.lsl_pos; auto. unfold Zbits.lsl_def. rewrite Zbits.lsl_arithmetic_shift. unfold Zbits.lsl_arithmetic_def. replace (1 * two_power_nat (Z.abs_nat i)) with (two_power_nat (Z.abs_nat i)) by ring. intros. rewrite Zbits.bit_testb_pos ; auto. + assert (HB:(Bits.Zbit x (Z.abs_nat j) = false)). {(apply (Zbits.Zbit_unsigned_trail (Z.abs_nat i) (Z.abs_nat j) x); auto). apply Zabs_nat_le; omega. } unfold Zbits.zbit_test_def. rewrite HB; discriminate. + omega. Qed. (* Why3 goal *) Lemma pos_extraction_sup_inv : forall (x:Z) (i:Z), (0%Z <= i)%Z -> (forall (j:Z), (i <= j)%Z -> ~ (bit_test x j)) -> (0%Z <= x)%Z /\ (x < (lsl 1%Z i))%Z. Proof. intros x i h1 h2. unfold lsl. rewrite Zbits.lsl_pos; auto. unfold Zbits.lsl_def. rewrite Zbits.lsl_arithmetic_shift. unfold Zbits.lsl_arithmetic_def. replace (1 * two_power_nat (Z.abs_nat i)) with (two_power_nat (Z.abs_nat i)) by ring. apply Zbits.Zbit_unsigned_trail_inv. intros k h. generalize (h2 (Z.of_nat k)); clear h2; intro h2. unfold bit_test in h2; rewrite Zbits.bit_testb_pos in h2. + assert (Zbits.zbit_test_def x (Z.of_nat k) <> true) as h3. { apply h2. clear h2. rewrite <- (Zabs2Nat.id k) in h. rewrite <- Zabs2Nat.inj_le in h; auto. apply Zle_0_nat. } clear h2. unfold Zbits.zbit_test_def in h3. rewrite Zabs2Nat.id in h3. destruct (Bits.Zbit x k). * contradiction h3. auto. * auto. + apply Zle_0_nat. Qed. (** * Link between Bit extraction and C type conversions *) (** ** Unsigned conversions *) (* Why3 goal *) Lemma to_uint_extraction_sup : forall (n:Z) (x:Z) (i:Z), ((0%Z <= n)%Z /\ (n <= i)%Z) -> (Cint.is_uint n x) -> ~ (bit_test x i). Proof. intros n x i h1 h2. assert (H:(Bits.Zbit x (Z.abs_nat i) = false)). { unfold Cint.is_uint in h2. apply (Zbits.Zbit_unsigned_trail (Z.abs_nat n) (Z.abs_nat i) x). + apply Zabs_nat_le. omega. + unfold Cint.two_power_abs in h2. trivial. } assert (I:(0 <= i)) by omega; unfold bit_test; unfold_bit_testb I; unfold Zbits.zbit_test_def. rewrite H; discriminate. Qed. (* Why3 goal *) Lemma to_uint_extraction_inf_bool : forall (n:Z) (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> ((bit_testb (Cint.to_uint n x) i) = (bit_testb x i)). Proof. intros n x i (h1,h2); unfold_bit_testb h1; unfold Zbits.zbit_test_def. pose (k:= (Z.abs_nat i)); fold k. unfold Cint.to_uint; unfold Cint.to_range. simpl. replace (x - 0) with x by (auto with zarith). unfold Cint.two_power_abs. rewrite Zbits.Zbit_uint_mod_two_power_nat. rewrite (leb_correct_conv k (Z.abs_nat n)). + trivial. + apply Zabs_nat_lt; omega. Qed. (* Why3 goal *) Lemma to_uint_extraction_inf : forall (n:Z) (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (bit_test (Cint.to_uint n x) i) <-> (bit_test x i). Proof. intros n x i (h1,h2); unfold bit_test; rewrite to_uint_extraction_inf_bool by auto; pose (xb:=bit_testb x i); fold xb; destruct xb; simpl; split; intro G; auto; destruct G; auto. Qed. (* Why3 goal *) Lemma is_uint_ext : forall (n:Z) (x:Z) (y:Z), (0%Z <= n)%Z -> (Cint.is_uint n x) -> (Cint.is_uint n y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros n x y h1 h2 h3 h4. assert (forall i: int, (0 <= i)%Z -> (bit_test x i <-> bit_test y i)). { intros. case_lt i n; intro. + apply h4; omega. + assert (~ bit_test x i). { apply (to_uint_extraction_sup n). omega. auto. } assert (~ bit_test y i). { apply (to_uint_extraction_sup n). omega. auto. } intuition. } clear h1; clear h2; clear h3; clear h4. unfold bit_test in H. unfold bit_testb in H. apply Zbits.bit_testb_ext; intros. rewrite <- Zbits.bool2_eq_true. apply H; auto. Qed. Local Ltac uint_extraction_inf_bool to_uint := intros; rewrite to_uint; apply to_uint_extraction_inf_bool; omega. Local Ltac uint_extraction_inf to_uint := intros; rewrite to_uint; apply to_uint_extraction_inf; omega. (** *** Cast to uint8 C type *) (* Why3 goal *) Lemma to_uint8_extraction_sup : forall (x:Z) (i:Z), (8%Z <= i)%Z -> (Cint.is_uint8 x) -> ~ (bit_test x i). Proof. intros; apply (to_uint_extraction_sup 8); (auto with zarith). Qed. (* Why3 goal *) Lemma to_uint8_extraction_inf_bool : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 8%Z)%Z) -> ((bit_testb (Cint.to_uint8 x) i) = (bit_testb x i)). Proof. uint_extraction_inf_bool Cint.to_uint_8. Qed. (* Why3 goal *) Lemma to_uint8_extraction_inf : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 8%Z)%Z) -> (bit_test (Cint.to_uint8 x) i) <-> (bit_test x i). Proof. uint_extraction_inf Cint.to_uint_8. Qed. (* Why3 goal *) Lemma is_uint8_ext : forall (x:Z) (y:Z), (Cint.is_uint8 x) -> (Cint.is_uint8 y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i < 8%Z)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros x y h1 h2 h3. apply (is_uint_ext 8); (auto with zarith). Qed. (** *** Cast to uint16 C type *) (* Why3 goal *) Lemma to_uint16_extraction_sup : forall (x:Z) (i:Z), (16%Z <= i)%Z -> (Cint.is_uint16 x) -> ~ (bit_test x i). Proof. intros; apply (to_uint_extraction_sup 16); (auto with zarith). Qed. (* Why3 goal *) Lemma to_uint16_extraction_inf_bool : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 16%Z)%Z) -> ((bit_testb (Cint.to_uint16 x) i) = (bit_testb x i)). Proof. uint_extraction_inf_bool Cint.to_uint_16. Qed. (* Why3 goal *) Lemma to_uint16_extraction_inf : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 16%Z)%Z) -> (bit_test (Cint.to_uint16 x) i) <-> (bit_test x i). Proof. uint_extraction_inf Cint.to_uint_16. Qed. (* Why3 goal *) Lemma is_uint16_ext : forall (x:Z) (y:Z), (Cint.is_uint16 x) -> (Cint.is_uint16 y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i < 16%Z)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros x y h1 h2 h3. apply (is_uint_ext 16); (auto with zarith). Qed. (** *** Cast to uint32 C type *) (* Why3 goal *) Lemma to_uint32_extraction_sup : forall (x:Z) (i:Z), (32%Z <= i)%Z -> (Cint.is_uint32 x) -> ~ (bit_test x i). Proof. intros; apply (to_uint_extraction_sup 32); (auto with zarith). Qed. (* Why3 goal *) Lemma to_uint32_extraction_inf_bool : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 32%Z)%Z) -> ((bit_testb (Cint.to_uint32 x) i) = (bit_testb x i)). Proof. uint_extraction_inf_bool Cint.to_uint_32. Qed. (* Why3 goal *) Lemma to_uint32_extraction_inf : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 32%Z)%Z) -> (bit_test (Cint.to_uint32 x) i) <-> (bit_test x i). Proof. uint_extraction_inf Cint.to_uint_32. Qed. (* Why3 goal *) Lemma is_uint32_ext : forall (x:Z) (y:Z), (Cint.is_uint32 x) -> (Cint.is_uint32 y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i < 32%Z)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros x y h1 h2 h3. apply (is_uint_ext 32); (auto with zarith). Qed. (** *** Cast to uint64 C type *) (* Why3 goal *) Lemma to_uint64_extraction_sup : forall (x:Z) (i:Z), (64%Z <= i)%Z -> (Cint.is_uint64 x) -> ~ (bit_test x i). Proof. intros; apply (to_uint_extraction_sup 64); (auto with zarith). Qed. (* Why3 goal *) Lemma to_uint64_extraction_inf_bool : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 64%Z)%Z) -> ((bit_testb (Cint.to_uint64 x) i) = (bit_testb x i)). Proof. uint_extraction_inf_bool Cint.to_uint_64. Qed. (* Why3 goal *) Lemma to_uint64_extraction_inf : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 64%Z)%Z) -> (bit_test (Cint.to_uint64 x) i) <-> (bit_test x i). Proof. uint_extraction_inf Cint.to_uint_64. Qed. (* Why3 goal *) Lemma is_uint64_ext : forall (x:Z) (y:Z), (Cint.is_uint64 x) -> (Cint.is_uint64 y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i < 64%Z)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros x y h1 h2 h3. apply (is_uint_ext 64); (auto with zarith). Qed. (** ** Signed conversions *) (* Why3 goal *) Lemma to_sint_extraction_sup : forall (n:Z) (x:Z) (i:Z), ((0%Z <= n)%Z /\ (n <= i)%Z) -> (Cint.is_sint n x) -> (bit_test x i) <-> (x < 0%Z)%Z. Proof. intros n x i h1. unfold Cint.is_sint. intro h2; assert (H:(0 <= i)) by omega; unfold bit_test; unfold_bit_testb H; unfold Zbits.zbit_test_def. assert (Z.abs_nat n <= Z.abs_nat i)%nat. { apply (Zabs_nat_le); omega. } rewrite <- Zlt_bool_true_Zlt; apply (Zbits.Zbit_trail (Z.abs_nat n) (Z.abs_nat i) x); auto. Qed. (* Why3 goal *) Lemma to_sint_extraction_inf_bool : forall (n:Z) (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> ((bit_testb (Cint.to_sint n x) i) = (bit_testb x i)). Proof. intros n x i (h1,h2); unfold_bit_testb h1; unfold Zbits.zbit_test_def. pose (k:= (Z.abs_nat i)); fold k. unfold Cint.to_sint; unfold Cint.to_range. rewrite Z.sub_opp_r; rewrite Z.sub_opp_r. rewrite Z.add_opp_l. replace (Cint.two_power_abs n + Cint.two_power_abs n) with (2 * Cint.two_power_abs n) by (auto with zarith). unfold Cint.two_power_abs. replace n with ((n-i)+i) by (auto with zarith). rewrite Zabs2Nat.inj_add by omega. apply Zbits.Zbit_sint_mod_two_power_nat. Qed. (* Why3 goal *) Lemma to_sint_extraction_inf : forall (n:Z) (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < n)%Z) -> (bit_test (Cint.to_sint n x) i) <-> (bit_test x i). Proof. intros n x i (h1,h2). unfold bit_test; rewrite to_sint_extraction_inf_bool by auto. pose (xb:=bit_testb x i); fold xb; destruct xb; simpl; split; intro G; auto; destruct G; auto. Qed. (* Why3 goal *) Lemma is_sint_ext : forall (n:Z) (x:Z) (y:Z), (0%Z <= n)%Z -> (Cint.is_sint n x) -> (Cint.is_sint n y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i <= n)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros n x y h1 h2 h3 h4. assert (forall i: int, (0 <= i)%Z -> (bit_test x i <-> bit_test y i)). { intros. case_leq i n; intro. + apply h4; omega. + assert (0<=n<=n) by omega. specialize ((h4 n) H1). generalize ((to_sint_extraction_sup n x n) H1 h2). generalize ((to_sint_extraction_sup n y n) H1 h3). clear H1; intros. rewrite h4 in H2. rewrite H2 in H1. clear H2. assert ((bit_test x i) <-> x < 0). { apply (to_sint_extraction_sup n); [omega | auto]. } assert ((bit_test y i) <-> y < 0). { apply (to_sint_extraction_sup n); [omega | auto]. } rewrite H2. rewrite H3. auto. } clear h1; clear h2; clear h3; clear h4. unfold bit_test in H. unfold bit_testb in H. apply Zbits.bit_testb_ext; intros. rewrite <- Zbits.bool2_eq_true. apply H; auto. Qed. (** Tactical *) Local Ltac sint_extraction_sup is_sint vn vz := intros x i h1; unfold is_sint; intro h2; assert (H:(0 <= i)) by omega; unfold bit_test; unfold_bit_testb H; unfold Zbits.zbit_test_def; assert (Z.abs_nat vz <= Z.abs_nat i)%nat by (assert (vn = Z.abs_nat vz)%nat by (auto with arith); apply Zabs_nat_le; omega); rewrite <- Zlt_bool_true_Zlt; apply (Zbits.Zbit_trail vn (Z.abs_nat i) x); auto. Local Ltac unfold_hyp h := match goal with | h:(?X1) |- _ => unfold X1 in h | h:(?X1 _ ) |- _ => unfold X1 in h | h:(?X1 _ _) |- _ => unfold X1 in h | h:(?X1 _ _ _) |- _ => unfold X1 in h | h:(?X1 _ _ _ _) |- _ => unfold X1 in h | _ => idtac end. Local Ltac sint_extraction_inf_bool to_sint := intros; rewrite to_sint; apply to_sint_extraction_inf_bool; omega. Local Ltac sint_extraction_inf to_sint := intros; rewrite to_sint; apply to_sint_extraction_inf; omega. (** *** Cast to sint8 C type *) (* Why3 goal *) Lemma to_sint8_extraction_sup : forall (x:Z) (i:Z), (7%Z <= i)%Z -> (Cint.is_sint8 x) -> (bit_test x i) <-> (x < 0%Z)%Z. Proof. intros; apply (to_sint_extraction_sup 7); (auto with zarith). Qed. (* Why3 goal *) Lemma to_sint8_extraction_inf_bool : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 7%Z)%Z) -> ((bit_testb (Cint.to_sint8 x) i) = (bit_testb x i)). Proof. sint_extraction_inf_bool Cint.to_sint_8. Qed. (* Why3 goal *) Lemma to_sint8_extraction_inf : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 7%Z)%Z) -> (bit_test (Cint.to_sint8 x) i) <-> (bit_test x i). Proof. sint_extraction_inf Cint.to_sint_8. Qed. (* Why3 goal *) Lemma is_sint8_ext : forall (x:Z) (y:Z), (Cint.is_sint8 x) -> (Cint.is_sint8 y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i <= 7%Z)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros. apply (is_sint_ext 7) ; (auto with zarith). Qed. (** *** Cast to sint16 C type *) (* Why3 goal *) Lemma to_sint16_extraction_sup : forall (x:Z) (i:Z), (15%Z <= i)%Z -> (Cint.is_sint16 x) -> (bit_test x i) <-> (x < 0%Z)%Z. Proof. intros; apply (to_sint_extraction_sup 15); (auto with zarith). Qed. (* Why3 goal *) Lemma to_sint16_extraction_inf_bool : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 15%Z)%Z) -> ((bit_testb (Cint.to_sint16 x) i) = (bit_testb x i)). Proof. sint_extraction_inf_bool Cint.to_sint_16. Qed. (* Why3 goal *) Lemma to_sint16_extraction_inf : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 15%Z)%Z) -> (bit_test (Cint.to_sint16 x) i) <-> (bit_test x i). Proof. sint_extraction_inf Cint.to_sint_16. Qed. (* Why3 goal *) Lemma is_sint16_ext : forall (x:Z) (y:Z), (Cint.is_sint16 x) -> (Cint.is_sint16 y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i <= 15%Z)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros. apply (is_sint_ext 15) ; (auto with zarith). Qed. (** *** Cast to uint32 C type *) (* Why3 goal *) Lemma to_sint32_extraction_sup : forall (x:Z) (i:Z), (31%Z <= i)%Z -> (Cint.is_sint32 x) -> (bit_test x i) <-> (x < 0%Z)%Z. Proof. intros; apply (to_sint_extraction_sup 31); (auto with zarith). Qed. (* Why3 goal *) Lemma to_sint32_extraction_inf_bool : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 31%Z)%Z) -> ((bit_testb (Cint.to_sint32 x) i) = (bit_testb x i)). Proof. sint_extraction_inf_bool Cint.to_sint_32. Qed. (* Why3 goal *) Lemma to_sint32_extraction_inf : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 31%Z)%Z) -> (bit_test (Cint.to_sint32 x) i) <-> (bit_test x i). Proof. sint_extraction_inf Cint.to_sint_32. Qed. (* Why3 goal *) Lemma is_sint32_ext : forall (x:Z) (y:Z), (Cint.is_sint32 x) -> (Cint.is_sint32 y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i <= 31%Z)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros. apply (is_sint_ext 31) ; (auto with zarith). Qed. (** *** Cast to uint64 C type *) (* Why3 goal *) Lemma to_sint64_extraction_sup : forall (x:Z) (i:Z), (63%Z <= i)%Z -> (Cint.is_sint64 x) -> (bit_test x i) <-> (x < 0%Z)%Z. Proof. intros; apply (to_sint_extraction_sup 63); (auto with zarith). Qed. (* Why3 goal *) Lemma to_sint64_extraction_inf_bool : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 63%Z)%Z) -> ((bit_testb (Cint.to_sint64 x) i) = (bit_testb x i)). Proof. sint_extraction_inf_bool Cint.to_sint_64. Qed. (* Why3 goal *) Lemma to_sint64_extraction_inf : forall (x:Z) (i:Z), ((0%Z <= i)%Z /\ (i < 63%Z)%Z) -> (bit_test (Cint.to_sint64 x) i) <-> (bit_test x i). Proof. sint_extraction_inf Cint.to_sint_64. Qed. (* Why3 goal *) Lemma is_sint64_ext : forall (x:Z) (y:Z), (Cint.is_sint64 x) -> (Cint.is_sint64 y) -> (forall (i:Z), ((0%Z <= i)%Z /\ (i <= 63%Z)%Z) -> (bit_test x i) <-> (bit_test y i)) -> (x = y). Proof. intros; apply (is_sint_ext 63); (auto with zarith). Qed. (** * Some C-Integer Bits Conversions are distributive *) (** Tacticals *) Local Ltac is_uint_bitwise f n := intros x y Rx Ry; unfold_hyp Rx; unfold_hyp Ry; apply Cint.id_to_range; apply (Zbits.Z_bitwise_in_uint_range f n x y Rx Ry); by compute. Local Ltac lsr_in_uint_range n := intros x y Ry Rx; unfold_hyp Rx; apply Cint.id_to_range; split; [ (apply (Zbits.lsr_lower_bound 0 _ _ Ry); omega) | (apply (Zbits.lsr_upper_bound n _ _ Ry); omega)]. (** ** Unsigned conversions *) (* Why3 goal *) Lemma to_uint_lor : forall (n:Z) (x:Z) (y:Z), ((Cint.to_uint n (lor x y)) = (lor (Cint.to_uint n x) (Cint.to_uint n y))). Proof. intros n x y. apply Zbits.zbit_test_ext. intro. rewrite Zbits.lor_extraction. unfold Cint.to_uint; unfold Cint.to_range; Cint.simplify_to_range_unfolding. unfold Cint.two_power_abs. repeat (rewrite Zbits.uint_mod_two_power_extraction). rewrite Zbits.lor_extraction. pose (c:=(leb (Z.abs_nat n) (Z.abs_nat n0))); fold c. destruct c; auto. Qed. (** *** Cast to uint8 C type *) (* Why3 goal *) Lemma to_uint8_lor : forall (x:Z) (y:Z), ((Cint.to_uint8 (lor x y)) = (lor (Cint.to_uint8 x) (Cint.to_uint 8%Z y))). Proof. intros x y; rewrite Cint.to_uint_8; apply to_uint_lor. Qed. (** *** Cast to uint16 C type *) (* Why3 goal *) Lemma to_uint16_lor : forall (x:Z) (y:Z), ((Cint.to_uint16 (lor x y)) = (lor (Cint.to_uint16 x) (Cint.to_uint16 y))). Proof. intros x y; rewrite Cint.to_uint_16; apply to_uint_lor. Qed. (** *** Cast to uint32 C type *) (* Why3 goal *) Lemma to_uint32_lor : forall (x:Z) (y:Z), ((Cint.to_uint32 (lor x y)) = (lor (Cint.to_uint32 x) (Cint.to_uint32 y))). Proof. intros x y; rewrite Cint.to_uint_32; apply to_uint_lor. Qed. (** *** Cast to uint64 C type *) (* Why3 goal *) Lemma to_uint64_lor : forall (x:Z) (y:Z), ((Cint.to_uint64 (lor x y)) = (lor (Cint.to_uint64 x) (Cint.to_uint64 y))). Proof. intros x y; rewrite Cint.to_uint_64; apply to_uint_lor. Qed. (* Why3 goal *) Lemma is_uint_lxor : forall (n:Z) (x:Z) (y:Z), (Cint.is_uint n x) -> (Cint.is_uint n y) -> ((Cint.to_uint n (lxor x y)) = (lxor x y)). Proof. intro n; is_uint_bitwise xorb (Z.abs_nat n). Qed. (** * Some C-Integer Bits Conversions are identity *) (** ** Unsigned conversions *) (* Why3 goal *) Lemma is_uint_lor : forall (n:Z) (x:Z) (y:Z), (Cint.is_uint n x) -> (Cint.is_uint n y) -> ((Cint.to_uint n (lor x y)) = (lor x y)). Proof. intro n; is_uint_bitwise orb (Z.abs_nat n). Qed. (* Why3 goal *) Lemma is_uint_land : forall (n:Z) (x:Z) (y:Z), (Cint.is_uint n x) -> (Cint.is_uint n y) -> ((Cint.to_uint n (land x y)) = (land x y)). Proof. intro n; is_uint_bitwise andb (Z.abs_nat n). Qed. (* Why3 goal *) Lemma is_uint_lsr : forall (n:Z) (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_uint n x) -> ((Cint.to_uint n (lsr x y)) = (lsr x y)). Proof. intro n; lsr_in_uint_range (Cint.two_power_abs n). Qed. (* Why3 goal *) Lemma is_uint_lsl1_inf : forall (n:Z) (y:Z), ((0%Z <= y)%Z /\ (y < n)%Z) -> ((Cint.to_uint n (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros n y (h1,h2); (assert (0 <= y) as Ry by omega); unfold lsl; unfold Zbits.lsl; rewrite (Zle_imp_le_bool _ _ Ry); unfold Zbits.lsl_def; rewrite Zbits.lsl_arithmetic_shift; unfold Zbits.lsl_arithmetic_def. (replace (1 * two_power_nat (Z.abs_nat y)) with (two_power_nat (Z.abs_nat y)) by (auto with zarith)); clear Ry. assert (Z.abs_nat y < (Z.abs_nat n))%nat as A by (apply Zabs_nat_lt; omega); clear h1; clear h2; pose (M := Z.abs_nat y); fold M; fold M in A. unfold Cint.to_uint; unfold Cint.to_range; Cint.simplify_to_range_unfolding. rewrite Zmod_small; trivial. unfold Cint.two_power_abs; pose (N:=(Z.abs_nat n)); fold N; fold N in A. generalize (Bits.two_power_nat_is_positive M); intro Pos. generalize (Bits.two_power_nat_increase_strict M N A) ; intro. omega. Qed. (* Why3 goal *) Lemma is_uint_lsl1_sup : forall (n:Z) (y:Z), ((0%Z <= n)%Z /\ (n <= y)%Z) -> ((Cint.to_uint n (lsl 1%Z y)) = 0%Z). Proof. intros n y h1. (assert (0 <= y) as Ry by omega); unfold lsl; unfold Zbits.lsl; rewrite (Zle_imp_le_bool _ _ Ry); unfold Zbits.lsl_def; rewrite Zbits.lsl_arithmetic_shift; unfold Zbits.lsl_arithmetic_def. (replace (1 * two_power_nat (Z.abs_nat y)) with (two_power_nat (Z.abs_nat y)) by (auto with zarith)); clear Ry. assert (Z.abs_nat n <= (Z.abs_nat y))%nat as A by (apply Zabs_nat_le; omega); clear h1; pose (M := Z.abs_nat y); fold M; fold M in A. unfold Cint.to_uint; unfold Cint.to_range; Cint.simplify_to_range_unfolding. rewrite (le_plus_minus (Z.abs_nat n) M A). replace (Z.abs_nat n + (M - Z.abs_nat n))%nat with ((M - Z.abs_nat n) + Z.abs_nat n)%nat by (auto with zarith). rewrite Bits.two_power_nat_plus. apply Z_mod_mult. Qed. (** *** Cast to uint8 C type *) (* Why3 goal *) Lemma is_uint8_lxor : forall (x:Z) (y:Z), (Cint.is_uint8 x) -> (Cint.is_uint8 y) -> ((Cint.to_uint8 (lxor x y)) = (lxor x y)). Proof. intros; rewrite Cint.to_uint_8; apply is_uint_lxor; trivial. Qed. (* Why3 goal *) Lemma is_uint8_lor : forall (x:Z) (y:Z), (Cint.is_uint8 x) -> (Cint.is_uint8 y) -> ((Cint.to_uint8 (lor x y)) = (lor x y)). Proof. intros; rewrite Cint.to_uint_8; apply is_uint_lor; trivial. Qed. (* Why3 goal *) Lemma is_uint8_land : forall (x:Z) (y:Z), (Cint.is_uint8 x) -> (Cint.is_uint8 y) -> ((Cint.to_uint8 (land x y)) = (land x y)). Proof. intros; rewrite Cint.to_uint_8; apply is_uint_land; trivial. Qed. (* Why3 goal *) Lemma is_uint8_lsr : forall (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_uint8 x) -> ((Cint.to_uint8 (lsr x y)) = (lsr x y)). Proof. intros; rewrite Cint.to_uint_8; apply is_uint_lsr; trivial. Qed. (* Why3 goal *) Lemma is_uint8_lsl1_inf : forall (y:Z), ((0%Z <= y)%Z /\ (y < 8%Z)%Z) -> ((Cint.to_uint8 (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros; rewrite Cint.to_uint_8; apply is_uint_lsl1_inf; trivial. Qed. (* Why3 goal *) Lemma is_uint8_lsl1_sup : forall (y:Z), (8%Z <= y)%Z -> ((Cint.to_uint8 (lsl 1%Z y)) = 0%Z). Proof. intros; rewrite Cint.to_uint_8; apply is_uint_lsl1_sup; omega. Qed. (** *** Cast to uint16 C type *) (* Why3 goal *) Lemma is_uint16_lxor : forall (x:Z) (y:Z), (Cint.is_uint16 x) -> (Cint.is_uint16 y) -> ((Cint.to_uint16 (lxor x y)) = (lxor x y)). Proof. intros; rewrite Cint.to_uint_16; apply is_uint_lxor; trivial. Qed. (* Why3 goal *) Lemma is_uint16_lor : forall (x:Z) (y:Z), (Cint.is_uint16 x) -> (Cint.is_uint16 y) -> ((Cint.to_uint16 (lor x y)) = (lor x y)). Proof. intros; rewrite Cint.to_uint_16; apply is_uint_lor; trivial. Qed. (* Why3 goal *) Lemma is_uint16_land : forall (x:Z) (y:Z), (Cint.is_uint16 x) -> (Cint.is_uint16 y) -> ((Cint.to_uint16 (land x y)) = (land x y)). Proof. intros; rewrite Cint.to_uint_16; apply is_uint_land; trivial. Qed. (* Why3 goal *) Lemma is_uint16_lsr : forall (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_uint16 x) -> ((Cint.to_uint16 (lsr x y)) = (lsr x y)). Proof. intros; rewrite Cint.to_uint_16; apply is_uint_lsr; trivial. Qed. (* Why3 goal *) Lemma is_uint16_lsl1_inf : forall (y:Z), ((0%Z <= y)%Z /\ (y < 16%Z)%Z) -> ((Cint.to_uint16 (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros; rewrite Cint.to_uint_16. apply is_uint_lsl1_inf; trivial. Qed. (* Why3 goal *) Lemma is_uint16_lsl1_sup : forall (y:Z), (16%Z <= y)%Z -> ((Cint.to_uint16 (lsl 1%Z y)) = 0%Z). Proof. intros; rewrite Cint.to_uint_16; apply is_uint_lsl1_sup; omega. Qed. (** *** Cast to uint32 C type *) (* Why3 goal *) Lemma is_uint32_lxor : forall (x:Z) (y:Z), (Cint.is_uint32 x) -> (Cint.is_uint32 y) -> ((Cint.to_uint32 (lxor x y)) = (lxor x y)). Proof. intros; rewrite Cint.to_uint_32; apply is_uint_lxor; trivial. Qed. (* Why3 goal *) Lemma is_uint32_lor : forall (x:Z) (y:Z), (Cint.is_uint32 x) -> (Cint.is_uint32 y) -> ((Cint.to_uint32 (lor x y)) = (lor x y)). Proof. intros; rewrite Cint.to_uint_32; apply is_uint_lor; trivial. Qed. (* Why3 goal *) Lemma is_uint32_land : forall (x:Z) (y:Z), (Cint.is_uint32 x) -> (Cint.is_uint32 y) -> ((Cint.to_uint32 (land x y)) = (land x y)). Proof. intros; rewrite Cint.to_uint_32; apply is_uint_land; trivial. Qed. (* Why3 goal *) Lemma is_uint32_lsr : forall (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_uint32 x) -> ((Cint.to_uint32 (lsr x y)) = (lsr x y)). Proof. intros; rewrite Cint.to_uint_32; apply is_uint_lsr; trivial. Qed. (* Why3 goal *) Lemma is_uint32_lsl1_inf : forall (y:Z), ((0%Z <= y)%Z /\ (y < 32%Z)%Z) -> ((Cint.to_uint32 (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros; rewrite Cint.to_uint_32; apply is_uint_lsl1_inf; trivial. Qed. (* Why3 goal *) Lemma is_uint32_lsl1_sup : forall (y:Z), (32%Z <= y)%Z -> ((Cint.to_uint32 (lsl 1%Z y)) = 0%Z). Proof. intros; rewrite Cint.to_uint_32; apply is_uint_lsl1_sup; omega. Qed. (** *** Cast to uint64 C type *) (* Why3 goal *) Lemma is_uint64_lxor : forall (x:Z) (y:Z), (Cint.is_uint64 x) -> (Cint.is_uint64 y) -> ((Cint.to_uint64 (lxor x y)) = (lxor x y)). Proof. intros; rewrite Cint.to_uint_64; apply is_uint_lxor; trivial. Qed. (* Why3 goal *) Lemma is_uint64_lor : forall (x:Z) (y:Z), (Cint.is_uint64 x) -> (Cint.is_uint64 y) -> ((Cint.to_uint64 (lor x y)) = (lor x y)). Proof. intros; rewrite Cint.to_uint_64; apply is_uint_lor; trivial. Qed. (* Why3 goal *) Lemma is_uint64_land : forall (x:Z) (y:Z), (Cint.is_uint64 x) -> (Cint.is_uint64 y) -> ((Cint.to_uint64 (land x y)) = (land x y)). Proof. intros; rewrite Cint.to_uint_64; apply is_uint_land; trivial. Qed. (* Why3 goal *) Lemma is_uint64_lsr : forall (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_uint64 x) -> ((Cint.to_uint64 (lsr x y)) = (lsr x y)). Proof. intros; rewrite Cint.to_uint_64; apply is_uint_lsr; trivial. Qed. (* Why3 goal *) Lemma is_uint64_lsl1_inf : forall (y:Z), ((0%Z <= y)%Z /\ (y < 64%Z)%Z) -> ((Cint.to_uint64 (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros; rewrite Cint.to_uint_64; apply is_uint_lsl1_inf; trivial. Qed. (* Why3 goal *) Lemma is_uint64_lsl1_sup : forall (y:Z), (64%Z <= y)%Z -> ((Cint.to_uint64 (lsl 1%Z y)) = 0%Z). Proof. intros; rewrite Cint.to_uint_64; apply is_uint_lsl1_sup; omega. Qed. (** ** Signed conversions *) (** Tacticals *) Local Ltac is_sint_lnot b := intros x Rx; unfold_hyp Rx; apply Cint.id_to_range; apply (Zbits.lnot_in_range (-b) b x Rx); omega. Local Ltac is_sint_bitwise f n := intros x y Rx Ry; unfold_hyp Rx; unfold_hyp Ry; apply Cint.id_to_range; apply (Zbits.Z_bitwise_in_sint_range f n x y Rx Ry); by compute. Local Ltac lsr_in_sint_range n := intros x y Ry Rx; unfold_hyp Rx; apply Cint.id_to_range; split; [ (apply (Zbits.lsr_lower_bound (-n) _ _ Ry); omega) | (apply (Zbits.lsr_upper_bound n _ _ Ry); omega)]. (* Why3 goal *) Lemma is_sint_lnot : forall (n:Z) (x:Z), (Cint.is_sint n x) -> ((Cint.to_sint n (lnot x)) = (lnot x)). Proof. intros n; is_sint_lnot (Cint.two_power_abs n). Qed. (* Why3 goal *) Lemma is_sint_lxor : forall (n:Z) (x:Z) (y:Z), (Cint.is_sint n x) -> (Cint.is_sint n y) -> ((Cint.to_sint n (lxor x y)) = (lxor x y)). Proof. intro n; is_sint_bitwise xorb (Z.abs_nat n). Qed. (* Why3 goal *) Lemma is_sint_lor : forall (n:Z) (x:Z) (y:Z), (Cint.is_sint n x) -> (Cint.is_sint n y) -> ((Cint.to_sint n (lor x y)) = (lor x y)). Proof. intro n; is_sint_bitwise orb (Z.abs_nat n). Qed. (* Why3 goal *) Lemma is_sint_land : forall (n:Z) (x:Z) (y:Z), (Cint.is_sint n x) -> (Cint.is_sint n y) -> ((Cint.to_sint n (land x y)) = (land x y)). Proof. intro n; is_sint_bitwise andb (Z.abs_nat n). Qed. (* Why3 goal *) Lemma is_sint_lsr : forall (n:Z) (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_sint n x) -> ((Cint.to_sint n (lsr x y)) = (lsr x y)). Proof. intro n; lsr_in_sint_range (Cint.two_power_abs n). Qed. (* Why3 goal *) Lemma is_sint_lsl1_inf : forall (n:Z) (y:Z), ((0%Z <= y)%Z /\ (y < n)%Z) -> ((Cint.to_sint n (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros n y (h1,h2). apply Cint.id_sint. unfold lsl; unfold Zbits.lsl; rewrite (Zle_imp_le_bool _ _ h1); unfold Zbits.lsl_def; rewrite Zbits.lsl_arithmetic_shift; unfold Zbits.lsl_arithmetic_def; (replace (1 * two_power_nat (Z.abs_nat y)) with (two_power_nat (Z.abs_nat y)) by (auto with zarith)). unfold Cint.is_sint. generalize (Cint.two_power_abs_is_positive y); generalize (Cint.two_power_abs_is_positive n); unfold Cint.two_power_abs; intros. split; [omega|]. apply Bits.two_power_nat_increase_strict. apply Zabs_nat_lt; omega. Qed. (* Why3 goal *) Lemma is_sint_lsl1_sup : forall (n:Z) (y:Z), ((0%Z <= n)%Z /\ (n < y)%Z) -> ((Cint.to_sint n (lsl 1%Z y)) = 0%Z). Proof. intros n y h1. assert (0 <= y) as Ry by omega; unfold lsl; unfold Zbits.lsl; rewrite (Zle_imp_le_bool _ _ Ry); unfold Zbits.lsl_def; rewrite Zbits.lsl_arithmetic_shift; unfold Zbits.lsl_arithmetic_def; (replace (1 * two_power_nat (Z.abs_nat y)) with (two_power_nat (Z.abs_nat y)) by (auto with zarith)). pose (M := two_power_nat (Z.abs_nat y)); fold M. unfold Cint.to_sint; unfold Cint.to_range; Cint.simplify_to_range_unfolding. pose (N:=(Cint.two_power_abs n)); fold N. rewrite <- (Z.mod_unique_pos (M + N) (N + N) (Cint.two_power_abs (y - (n + 1))) N). + auto with zarith. + generalize (Cint.two_power_abs_is_positive n); fold N; omega. + rewrite Z.add_cancel_r. replace (N + N) with (2 * N) by (auto with zarith); unfold N. rewrite <- Cint.two_power_abs_plus_one by omega. rewrite <- Cint.two_power_abs_plus_pos by omega. replace (n + 1 + (y - (n + 1))) with y by ring. auto. Qed. (** *** Cast to sint8 C type *) (* Why3 goal *) Lemma is_sint8_lnot : forall (x:Z), (Cint.is_sint8 x) -> ((Cint.to_sint8 (lnot x)) = (lnot x)). Proof. is_sint_lnot 128. Qed. (* Why3 goal *) Lemma is_sint8_lxor : forall (x:Z) (y:Z), (Cint.is_sint8 x) -> (Cint.is_sint8 y) -> ((Cint.to_sint8 (lxor x y)) = (lxor x y)). Proof. is_sint_bitwise xorb 7%nat. Qed. (* Why3 goal *) Lemma is_sint8_lor : forall (x:Z) (y:Z), (Cint.is_sint8 x) -> (Cint.is_sint8 y) -> ((Cint.to_sint8 (lor x y)) = (lor x y)). Proof. is_sint_bitwise orb 7%nat. Qed. (* Why3 goal *) Lemma is_sint8_land : forall (x:Z) (y:Z), (Cint.is_sint8 x) -> (Cint.is_sint8 y) -> ((Cint.to_sint8 (land x y)) = (land x y)). Proof. is_sint_bitwise andb 7%nat. Qed. (* Why3 goal *) Lemma is_sint8_lsr : forall (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_sint8 x) -> ((Cint.to_sint8 (lsr x y)) = (lsr x y)). Proof. lsr_in_sint_range 128. Qed. (* Why3 goal *) Lemma is_sint8_lsl1 : ((lsl 1%Z 7%Z) = 128%Z). Proof. compute. auto. Qed. (* Why3 goal *) Lemma is_sint8_lsl1_inf : forall (y:Z), ((0%Z <= y)%Z /\ (y < 7%Z)%Z) -> ((Cint.to_sint8 (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros; rewrite Cint.to_sint_8; apply is_sint_lsl1_inf; omega. Qed. (* Why3 goal *) Lemma is_sint8_lsl1_sup : forall (y:Z), (8%Z <= y)%Z -> ((Cint.to_sint8 (lsl 1%Z y)) = 0%Z). Proof. intros; rewrite Cint.to_sint_8; apply is_sint_lsl1_sup; omega. Qed. (** *** Cast to sint16 C type *) (* Why3 goal *) Lemma is_sint16_lnot : forall (x:Z), (Cint.is_sint16 x) -> ((Cint.to_sint16 (lnot x)) = (lnot x)). Proof. is_sint_lnot 32768. Qed. (* Why3 goal *) Lemma is_sint16_lxor : forall (x:Z) (y:Z), (Cint.is_sint16 x) -> (Cint.is_sint16 y) -> ((Cint.to_sint16 (lxor x y)) = (lxor x y)). Proof. is_sint_bitwise xorb 15%nat. Qed. (* Why3 goal *) Lemma is_sint16_lor : forall (x:Z) (y:Z), (Cint.is_sint16 x) -> (Cint.is_sint16 y) -> ((Cint.to_sint16 (lor x y)) = (lor x y)). Proof. is_sint_bitwise orb 15%nat. Qed. (* Why3 goal *) Lemma is_sint16_land : forall (x:Z) (y:Z), (Cint.is_sint16 x) -> (Cint.is_sint16 y) -> ((Cint.to_sint16 (land x y)) = (land x y)). Proof. is_sint_bitwise andb 15%nat. Qed. (* Why3 goal *) Lemma is_sint16_lsr : forall (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_sint16 x) -> ((Cint.to_sint16 (lsr x y)) = (lsr x y)). Proof. lsr_in_sint_range 32768. Qed. (* Why3 goal *) Lemma is_sint16_lsl1 : ((lsl 1%Z 15%Z) = 32768%Z). Proof. compute. auto. Qed. (* Why3 goal *) Lemma is_sint16_lsl1_inf : forall (y:Z), ((0%Z <= y)%Z /\ (y < 15%Z)%Z) -> ((Cint.to_sint16 (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros; rewrite Cint.to_sint_16; apply is_sint_lsl1_inf; omega. Qed. (* Why3 goal *) Lemma is_sint16_lsl1_sup : forall (y:Z), (16%Z <= y)%Z -> ((Cint.to_sint16 (lsl 1%Z y)) = 0%Z). Proof. intros; rewrite Cint.to_sint_16; apply is_sint_lsl1_sup; omega. Qed. (** *** Cast to sint32 C type *) (* Why3 goal *) Lemma is_sint32_lnot : forall (x:Z), (Cint.is_sint32 x) -> ((Cint.to_sint32 (lnot x)) = (lnot x)). Proof. is_sint_lnot 2147483648. Qed. (* Why3 goal *) Lemma is_sint32_lxor : forall (x:Z) (y:Z), (Cint.is_sint32 x) -> (Cint.is_sint32 y) -> ((Cint.to_sint32 (lxor x y)) = (lxor x y)). Proof. is_sint_bitwise xorb 31%nat. Qed. (* Why3 goal *) Lemma is_sint32_lor : forall (x:Z) (y:Z), (Cint.is_sint32 x) -> (Cint.is_sint32 y) -> ((Cint.to_sint32 (lor x y)) = (lor x y)). Proof. is_sint_bitwise orb 31%nat. Qed. (* Why3 goal *) Lemma is_sint32_land : forall (x:Z) (y:Z), (Cint.is_sint32 x) -> (Cint.is_sint32 y) -> ((Cint.to_sint32 (land x y)) = (land x y)). Proof. is_sint_bitwise andb 31%nat. Qed. (* Why3 goal *) Lemma is_sint32_lsr : forall (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_sint32 x) -> ((Cint.to_sint32 (lsr x y)) = (lsr x y)). Proof. lsr_in_sint_range 2147483648. Qed. (* Why3 goal *) Lemma is_sint32_lsl1 : ((lsl 1%Z 31%Z) = 2147483648%Z). Proof. compute. auto. Qed. (* Why3 goal *) Lemma is_sint32_lsl1_inf : forall (y:Z), ((0%Z <= y)%Z /\ (y < 31%Z)%Z) -> ((Cint.to_sint32 (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros; rewrite Cint.to_sint_32; apply is_sint_lsl1_inf; omega. Qed. (* Why3 goal *) Lemma is_sint32_lsl1_sup : forall (y:Z), (32%Z <= y)%Z -> ((Cint.to_sint32 (lsl 1%Z y)) = 0%Z). Proof. intros; rewrite Cint.to_sint_32; apply is_sint_lsl1_sup; omega. Qed. (** *** Cast to sint64 C type *) (* Why3 goal *) Lemma is_sint64_lnot : forall (x:Z), (Cint.is_sint64 x) -> ((Cint.to_sint64 (lnot x)) = (lnot x)). Proof. is_sint_lnot 9223372036854775808. Qed. (* Why3 goal *) Lemma is_sint64_lxor : forall (x:Z) (y:Z), (Cint.is_sint64 x) -> (Cint.is_sint64 y) -> ((Cint.to_sint64 (lxor x y)) = (lxor x y)). Proof. is_sint_bitwise xorb 63%nat. Qed. (* Why3 goal *) Lemma is_sint64_lor : forall (x:Z) (y:Z), (Cint.is_sint64 x) -> (Cint.is_sint64 y) -> ((Cint.to_sint64 (lor x y)) = (lor x y)). Proof. is_sint_bitwise orb 63%nat. Qed. (* Why3 goal *) Lemma is_sint64_land : forall (x:Z) (y:Z), (Cint.is_sint64 x) -> (Cint.is_sint64 y) -> ((Cint.to_sint64 (land x y)) = (land x y)). Proof. is_sint_bitwise andb 63%nat. Qed. (* Why3 goal *) Lemma is_sint64_lsr : forall (x:Z) (y:Z), (0%Z <= y)%Z -> (Cint.is_sint64 x) -> ((Cint.to_sint64 (lsr x y)) = (lsr x y)). Proof. lsr_in_sint_range 9223372036854775808. Qed. (* Why3 goal *) Lemma is_sint64_lsl1 : ((lsl 1%Z 63%Z) = 9223372036854775808%Z). Proof. compute. auto. Qed. (* Why3 goal *) Lemma is_sint64_lsl1_inf : forall (y:Z), ((0%Z <= y)%Z /\ (y < 63%Z)%Z) -> ((Cint.to_sint64 (lsl 1%Z y)) = (lsl 1%Z y)). Proof. intros; rewrite Cint.to_sint_64; apply is_sint_lsl1_inf; omega. Qed. (* Why3 goal *) Lemma is_sint64_lsl1_sup : forall (y:Z), (64%Z <= y)%Z -> ((Cint.to_sint64 (lsl 1%Z y)) = 0%Z). Proof. intros; rewrite Cint.to_sint_64; apply is_sint_lsl1_sup; omega. Qed. (** * Range of some bitwise operations *) (* Why3 goal *) Lemma uint_land_range : forall (x:Z) (y:Z), (0%Z <= x)%Z -> (0%Z <= (land x y))%Z /\ ((land x y) <= x)%Z. Proof. intros x y h1. apply Zbits.uint_land_range; trivial. Qed. (* Why3 goal *) Lemma uint_lor_inf : forall (x:Z) (y:Z), ((-1%Z)%Z <= x)%Z -> (0%Z <= y)%Z -> (x <= (lor x y))%Z. Proof. intros x y h1 h2. case_leq 0 x; intro. + apply Zbits.uint_lor_inf; trivial. + replace x with (-1). { rewrite Zbits.lor_1; omega. } omega. Qed. (* Why3 goal *) Lemma sint_land_inf : forall (x:Z) (y:Z), (x <= 0%Z)%Z -> (y < 0%Z)%Z -> ((land x y) <= x)%Z. Proof. intros x y h1 h2. cut (-(x+1) <= -((land x y)+1)). { omega. } fold (Bits.zlnot x). fold (Bits.zlnot (land x y)). repeat (rewrite <- Zbits.lnot_zlnot_equiv). rewrite Zbits.lnot_land_de_morgan. repeat (rewrite Zbits.lnot_zlnot_equiv). apply (uint_lor_inf (Bits.zlnot x)); unfold Bits.zlnot; try omega. Qed. (* Why3 goal *) Lemma sint_lor_range : forall (x:Z) (y:Z), (x < 0%Z)%Z -> (x <= (lor x y))%Z /\ ((lor x y) < 0%Z)%Z. Proof. intros x y h1. cut (0 <= -((lor x y)+1) <= -(x+1)). { omega. } fold (Bits.zlnot x). fold (Bits.zlnot (lor x y)). rewrite <- Zbits.lnot_zlnot_equiv. rewrite Zbits.lnot_lor_de_morgan. rewrite Zbits.lnot_zlnot_equiv. apply (uint_land_range (Bits.zlnot x)). unfold Bits.zlnot; omega. Qed. (* Why3 goal *) Lemma is_uint_lor_distrib : forall (n:Z) (x:Z) (y:Z), (Cint.is_uint n (lor x y)) <-> ((Cint.is_uint n x) /\ (Cint.is_uint n y)). Proof. intros n x y; split. + unfold Cint.is_uint ; intros. destruct H. rewrite <- Zbits.lor_sign in H. destruct H. generalize H0; clear H0. assert (h1:((-1) <= x)) by omega. generalize (uint_lor_inf x y h1 H1). rewrite Zbits.lor_commut. assert (h2:((-1) <= y)) by omega. generalize (uint_lor_inf y x h2 H). unfold lor; pose (z:=(Zbits.lor y x)); fold z; intros. omega. + intro H; destruct H. rewrite <- (is_uint_lor n) by trivial. apply Cint.is_to_uint. Qed. (** * Link between bitwise operators and addition *) (* Why3 goal *) Lemma lor_addition : forall (x:Z) (y:Z), ((land x y) = 0%Z) -> ((x + y)%Z = (lor x y)). Proof. intros x y h1. apply Zbits.lor_addition; trivial. Qed. (* Why3 goal *) Lemma lxor_addition : forall (x:Z) (y:Z), ((land x y) = 0%Z) -> ((x + y)%Z = (lxor x y)). Proof. intros x y h1. apply Zbits.lxor_addition; trivial. Qed. (** * Link between land and cast operator *) (* Why3 goal *) Lemma to_uint_land_edge : forall (x:Z) (n:Z), (0%Z <= n)%Z -> ((Cint.to_uint n x) = (land ((lsl 1%Z n) - 1%Z)%Z x)). Proof. intros x n h1. unfold Cint.to_uint; unfold Cint.to_range; Cint.simplify_to_range_unfolding. unfold Cint.two_power_abs. rewrite Zbits.pos_mod_two_power_nat_land_edge. unfold land; f_equal. unfold lsl; rewrite Zbits.lsl_pos by omega; unfold Zbits.lsl_def. rewrite Zbits.lsl_arithmetic_shift; unfold Zbits.lsl_arithmetic_def. auto with zarith. Qed. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Cfloat.v��������������������������������������������0000666�0000000�0000000�00000031170�13571573400�017745� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.Rbasic_fun. Require Reals.R_sqrt. Require BuiltIn. Require bool.Bool. Require int.Int. Require real.Real. Require real.RealInfix. Require real.Abs. Require real.FromInt. Require real.Square. (* Why3 goal *) Definition f32 : Type. Admitted. (* Why3 goal *) Definition f64 : Type. Admitted. (* Why3 goal *) Definition to_f32: R -> f32. Admitted. (* Why3 goal *) Definition of_f32: f32 -> R. Admitted. (* Why3 goal *) Definition to_f64: R -> f64. Admitted. (* Why3 goal *) Definition of_f64: f64 -> R. Admitted. (* Why3 goal *) Lemma to_f32_zero : ((of_f32 (to_f32 0%R)) = 0%R). Admitted. (* Why3 goal *) Lemma to_f32_one : ((of_f32 (to_f32 1%R)) = 1%R). Admitted. (* Why3 goal *) Lemma to_f64_zero : ((of_f64 (to_f64 0%R)) = 0%R). Admitted. (* Why3 goal *) Lemma to_f64_one : ((of_f64 (to_f64 1%R)) = 1%R). Admitted. (* Why3 assumption *) Inductive rounding_mode := | Up : rounding_mode | Down : rounding_mode | ToZero : rounding_mode | NearestTiesToAway : rounding_mode | NearestTiesToEven : rounding_mode. Axiom rounding_mode_WhyType : WhyType rounding_mode. Existing Instance rounding_mode_WhyType. (* Why3 goal *) Definition round_float: rounding_mode -> R -> f32. Admitted. (* Why3 goal *) Definition round_double: rounding_mode -> R -> f64. Admitted. (* Why3 goal *) Lemma float_32 : forall (x:R), ((to_f32 x) = (round_float NearestTiesToEven x)). Admitted. (* Why3 goal *) Lemma float_64 : forall (x:R), ((to_f64 x) = (round_double NearestTiesToEven x)). Admitted. (* Why3 assumption *) Inductive float_kind := | Finite : float_kind | NaN : float_kind | Inf_pos : float_kind | Inf_neg : float_kind. Axiom float_kind_WhyType : WhyType float_kind. Existing Instance float_kind_WhyType. (* Why3 goal *) Definition classify_f32: f32 -> float_kind. Admitted. (* Why3 goal *) Definition classify_f64: f64 -> float_kind. Admitted. (* Why3 assumption *) Definition is_finite_f32 (f:f32): Prop := ((classify_f32 f) = Finite). (* Why3 assumption *) Definition is_finite_f64 (d:f64): Prop := ((classify_f64 d) = Finite). (* Why3 assumption *) Definition is_NaN_f32 (f:f32): Prop := ((classify_f32 f) = NaN). (* Why3 assumption *) Definition is_NaN_f64 (d:f64): Prop := ((classify_f64 d) = NaN). (* Why3 assumption *) Definition is_infinite_f32 (f:f32): Prop := ((classify_f32 f) = Inf_pos) \/ ((classify_f32 f) = Inf_neg). (* Why3 assumption *) Definition is_infinite_f64 (d:f64): Prop := ((classify_f64 d) = Inf_pos) \/ ((classify_f64 d) = Inf_neg). (* Why3 assumption *) Definition is_positive_infinite_f32 (f:f32): Prop := ((classify_f32 f) = Inf_pos). (* Why3 assumption *) Definition is_positive_infinite_f64 (d:f64): Prop := ((classify_f64 d) = Inf_pos). (* Why3 assumption *) Definition is_negative_infinite_f32 (f:f32): Prop := ((classify_f32 f) = Inf_neg). (* Why3 assumption *) Definition is_negative_infinite_f64 (d:f64): Prop := ((classify_f64 d) = Inf_neg). (* Why3 goal *) Lemma is_finite_to_float_32 : forall (x:R), (is_finite_f32 (to_f32 x)). Admitted. (* Why3 goal *) Lemma is_finite_to_float_64 : forall (x:R), (is_finite_f64 (to_f64 x)). Admitted. (* Why3 goal *) Lemma to_float_is_finite_32 : forall (f:f32), (is_finite_f32 f) -> ((to_f32 (of_f32 f)) = f). Admitted. (* Why3 goal *) Lemma to_float_is_finite_64 : forall (d:f64), (is_finite_f64 d) -> ((to_f64 (of_f64 d)) = d). Admitted. (* Why3 assumption *) Definition finite (x:R): Prop := (is_finite_f32 (to_f32 x)) /\ (is_finite_f64 (to_f64 x)). (* Why3 goal *) Lemma finite_small_f32 : forall (x:R), (((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368%R)%R <= x)%R /\ (x <= 340282346600000016151267322115014000640%R)%R) -> (is_finite_f32 (to_f32 x)). Admitted. (* Why3 goal *) Lemma finite_small_f64 : forall (x:R), (((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368%R)%R <= x)%R /\ (x <= 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368%R)%R) -> (is_finite_f64 (to_f64 x)). Admitted. (* Why3 goal *) Lemma finite_range_f32 : forall (f:f32), (is_finite_f32 f) <-> (((-340282346600000016151267322115014000640%R)%R <= (of_f32 f))%R /\ ((of_f32 f) <= 340282346600000016151267322115014000640%R)%R). Admitted. (* Why3 goal *) Lemma finite_range_f64 : forall (d:f64), (is_finite_f64 d) <-> (((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368%R)%R <= (of_f64 d))%R /\ ((of_f64 d) <= 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368%R)%R). Admitted. (* Why3 goal *) Definition eq_f32b: f32 -> f32 -> bool. Admitted. (* Why3 goal *) Definition eq_f64b: f64 -> f64 -> bool. Admitted. (* Why3 assumption *) Definition eq_f32 (x:f32) (y:f32): Prop := ((eq_f32b x y) = true). (* Why3 assumption *) Definition eq_f64 (x:f64) (y:f64): Prop := ((eq_f64b x y) = true). (* Why3 goal *) Lemma eq_finite_f32 : forall (x:f32) (y:f32), (is_finite_f32 x) -> ((is_finite_f32 y) -> ((eq_f32 x y) <-> ((of_f32 x) = (of_f32 y)))). Admitted. (* Why3 goal *) Lemma eq_finite_f64 : forall (x:f64) (y:f64), (is_finite_f64 x) -> ((is_finite_f64 y) -> ((eq_f64 x y) <-> ((of_f64 x) = (of_f64 y)))). Admitted. (* Why3 goal *) Definition ne_f32b: f32 -> f32 -> bool. Admitted. (* Why3 goal *) Definition ne_f64b: f64 -> f64 -> bool. Admitted. (* Why3 assumption *) Definition ne_f32 (x:f32) (y:f32): Prop := ((ne_f32b x y) = true). (* Why3 assumption *) Definition ne_f64 (x:f64) (y:f64): Prop := ((ne_f64b x y) = true). (* Why3 goal *) Lemma ne_finite_f32 : forall (x:f32) (y:f32), (is_finite_f32 x) -> ((is_finite_f32 y) -> ((ne_f32 x y) <-> ~ ((of_f32 x) = (of_f32 y)))). Admitted. (* Why3 goal *) Lemma ne_finite_f64 : forall (x:f64) (y:f64), (is_finite_f64 x) -> ((is_finite_f64 y) -> ((ne_f64 x y) <-> ~ ((of_f64 x) = (of_f64 y)))). Admitted. (* Why3 goal *) Definition le_f32b: f32 -> f32 -> bool. Admitted. (* Why3 goal *) Definition le_f64b: f64 -> f64 -> bool. Admitted. (* Why3 assumption *) Definition le_f32 (x:f32) (y:f32): Prop := ((le_f32b x y) = true). (* Why3 assumption *) Definition le_f64 (x:f64) (y:f64): Prop := ((le_f64b x y) = true). (* Why3 goal *) Lemma le_finite_f32 : forall (x:f32) (y:f32), (is_finite_f32 x) -> ((is_finite_f32 y) -> ((le_f32 x y) <-> ((of_f32 x) <= (of_f32 y))%R)). Admitted. (* Why3 goal *) Lemma le_finite_f64 : forall (x:f64) (y:f64), (is_finite_f64 x) -> ((is_finite_f64 y) -> ((le_f64 x y) <-> ((of_f64 x) <= (of_f64 y))%R)). Admitted. (* Why3 goal *) Definition lt_f32b: f32 -> f32 -> bool. Admitted. (* Why3 goal *) Definition lt_f64b: f64 -> f64 -> bool. Admitted. (* Why3 assumption *) Definition lt_f32 (x:f32) (y:f32): Prop := ((lt_f32b x y) = true). (* Why3 assumption *) Definition lt_f64 (x:f64) (y:f64): Prop := ((lt_f64b x y) = true). (* Why3 goal *) Lemma lt_finite_f32 : forall (x:f32) (y:f32), (is_finite_f32 x) -> ((is_finite_f32 y) -> ((lt_f32 x y) <-> ((of_f32 x) < (of_f32 y))%R)). Admitted. (* Why3 goal *) Lemma lt_finite_f64 : forall (x:f64) (y:f64), (is_finite_f64 x) -> ((is_finite_f64 y) -> ((lt_f64 x y) <-> ((of_f64 x) < (of_f64 y))%R)). Admitted. (* Why3 goal *) Definition neg_f32: f32 -> f32. Admitted. (* Why3 goal *) Definition neg_f64: f64 -> f64. Admitted. (* Why3 goal *) Lemma neg_finite_f32 : forall (x:f32), (is_finite_f32 x) -> ((of_f32 (neg_f32 x)) = (-(of_f32 x))%R). Admitted. (* Why3 goal *) Lemma neg_finite_f64 : forall (x:f64), (is_finite_f64 x) -> ((of_f64 (neg_f64 x)) = (-(of_f64 x))%R). Admitted. (* Why3 goal *) Definition add_f32: f32 -> f32 -> f32. Admitted. (* Why3 goal *) Definition add_f64: f64 -> f64 -> f64. Admitted. (* Why3 goal *) Lemma add_finite_f32 : forall (x:f32) (y:f32), (is_finite_f32 x) -> ((is_finite_f32 y) -> ((add_f32 x y) = (to_f32 ((of_f32 x) + (of_f32 y))%R))). Admitted. (* Why3 goal *) Lemma add_finite_f64 : forall (x:f64) (y:f64), (is_finite_f64 x) -> ((is_finite_f64 y) -> ((add_f64 x y) = (to_f64 ((of_f64 x) + (of_f64 y))%R))). Admitted. (* Why3 goal *) Definition mul_f32: f32 -> f32 -> f32. Admitted. (* Why3 goal *) Definition mul_f64: f64 -> f64 -> f64. Admitted. (* Why3 goal *) Lemma mul_finite_f32 : forall (x:f32) (y:f32), (is_finite_f32 x) -> ((is_finite_f32 y) -> ((mul_f32 x y) = (to_f32 ((of_f32 x) * (of_f32 y))%R))). Admitted. (* Why3 goal *) Lemma mul_finite_f64 : forall (x:f64) (y:f64), (is_finite_f64 x) -> ((is_finite_f64 y) -> ((mul_f64 x y) = (to_f64 ((of_f64 x) * (of_f64 y))%R))). Admitted. (* Why3 goal *) Definition div_f32: f32 -> f32 -> f32. Admitted. (* Why3 goal *) Definition div_f64: f64 -> f64 -> f64. Admitted. (* Why3 goal *) Lemma div_finite_f32 : forall (x:f32) (y:f32), (is_finite_f32 x) -> ((is_finite_f32 y) -> ((div_f32 x y) = (to_f32 ((of_f32 x) / (of_f32 y))%R))). Admitted. (* Why3 goal *) Lemma div_finite_f64 : forall (x:f64) (y:f64), (is_finite_f64 x) -> ((is_finite_f64 y) -> ((div_f64 x y) = (to_f64 ((of_f64 x) / (of_f64 y))%R))). Admitted. (* Why3 goal *) Definition sqrt_f32: f32 -> f32. Admitted. (* Why3 goal *) Definition sqrt_f64: f64 -> f64. Admitted. (* Why3 goal *) Lemma sqrt_finite_f32 : forall (x:f32), (is_finite_f32 x) -> ((sqrt_f32 x) = (to_f32 (Reals.R_sqrt.sqrt (of_f32 x)))). Admitted. (* Why3 goal *) Lemma sqrt_finite_f64 : forall (x:f64), (is_finite_f64 x) -> ((sqrt_f64 x) = (to_f64 (Reals.R_sqrt.sqrt (of_f64 x)))). Admitted. (* Why3 goal *) Definition model_f32: f32 -> R. Admitted. (* Why3 assumption *) Definition delta_f32 (f:f32): R := (Reals.Rbasic_fun.Rabs ((of_f32 f) - (model_f32 f))%R). (* Why3 assumption *) Definition error_f32 (f:f32): R := ((delta_f32 f) / (Reals.Rbasic_fun.Rabs (model_f32 f)))%R. (* Why3 goal *) Definition model_f64: f64 -> R. Admitted. (* Why3 assumption *) Definition delta_f64 (f:f64): R := (Reals.Rbasic_fun.Rabs ((of_f64 f) - (model_f64 f))%R). (* Why3 assumption *) Definition error_f64 (f:f64): R := ((delta_f64 f) / (Reals.Rbasic_fun.Rabs (model_f64 f)))%R. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Cint.v����������������������������������������������0000666�0000000�0000000�00000061212�13571573400�017432� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require bool.Bool. Require int.Int. (* Why3 assumption *) Definition is_bool (x:Z): Prop := (x = 0%Z) \/ (x = 1%Z). Require Import Qedlib. (** * remarks about two_power_nat *) Remark two_power_nat_is_positive: forall n, (0 < two_power_nat n)%Z. Proof. induction n. (** base *) + compute. auto. (** ind. *) + rewrite two_power_nat_S. apply Zmult_lt_0_compat. omega. auto. Qed. Remark two_power_nat_plus: forall n m, (two_power_nat (n+m) = (two_power_nat n)*(two_power_nat m))%Z. Proof. induction m. (replace (two_power_nat 0) with 1%Z by (compute;forward)). (replace (n + 0)%nat with n by (auto with zarith)). ring. rewrite two_power_nat_S. replace (n + S m)%nat with (S(n+m)) by (auto with zarith). rewrite two_power_nat_S. rewrite IHm. ring. Qed. (** * C-Integer bounds * **) (** ** bounds are inlined into prover files ** **) (** * C-Integer Ranges *) (* Why3 assumption *) Definition is_uint8 (x:Z): Prop := (0%Z <= x)%Z /\ (x < 256%Z)%Z. (* Why3 assumption *) Definition is_sint8 (x:Z): Prop := ((-128%Z)%Z <= x)%Z /\ (x < 128%Z)%Z. (* Why3 assumption *) Definition is_uint16 (x:Z): Prop := (0%Z <= x)%Z /\ (x < 65536%Z)%Z. (* Why3 assumption *) Definition is_sint16 (x:Z): Prop := ((-32768%Z)%Z <= x)%Z /\ (x < 32768%Z)%Z. (* Why3 assumption *) Definition is_uint32 (x:Z): Prop := (0%Z <= x)%Z /\ (x < 4294967296%Z)%Z. (* Why3 assumption *) Definition is_sint32 (x:Z): Prop := ((-2147483648%Z)%Z <= x)%Z /\ (x < 2147483648%Z)%Z. (* Why3 assumption *) Definition is_uint64 (x:Z): Prop := (0%Z <= x)%Z /\ (x < 18446744073709551616%Z)%Z. (* Why3 assumption *) Definition is_sint64 (x:Z): Prop := ((-9223372036854775808%Z)%Z <= x)%Z /\ (x < 9223372036854775808%Z)%Z. (* Why3 goal *) Lemma is_bool0 : (is_bool 0%Z). Proof. unfold is_bool. auto. Qed. (* Why3 goal *) Lemma is_bool1 : (is_bool 1%Z). Proof. unfold is_bool. auto. Qed. (* Why3 goal *) Definition to_bool: Z -> Z. exact (fun x => if ( x =? 0 ) then 0 else 1). Defined. (* Why3 goal *) Lemma to_bool_def : forall (x:Z), ((x = 0%Z) -> ((to_bool x) = 0%Z)) /\ ((~ (x = 0%Z)) -> ((to_bool x) = 1%Z)). Proof. intros x. unfold to_bool. induction (Z.eqb_spec x 0%Z) ; intuition. Qed. Local Open Scope Z_scope. Definition to_range a b z := a + (z-a) mod (b-a). Ltac simplify_to_range_unfolding := repeat (rewrite Z.sub_0_r); repeat (rewrite Z.add_0_l); repeat (rewrite Z.sub_opp_r). Lemma is_to_range: forall a b z, a<b -> a <= to_range a b z < b. Proof. intros. unfold to_range. assert (Q : b-a > 0) ; auto with zarith. generalize (Z_mod_lt (z-a) (b-a) Q). intro R. auto with zarith. Qed. (* Why3 goal *) Definition to_uint8: Z -> Z. exact (to_range 0 256). Defined. (* Why3 goal *) Definition to_sint8: Z -> Z. exact (to_range (-128) 128). Defined. (* Why3 goal *) Definition to_uint16: Z -> Z. exact (to_range 0 65536). Defined. (* Why3 goal *) Definition to_sint16: Z -> Z. exact (to_range (-32768) 32768). Defined. (* Why3 goal *) Definition to_uint32: Z -> Z. exact (to_range 0 4294967296). Defined. (* Why3 goal *) Definition to_sint32: Z -> Z. exact (to_range (-2147483648) 2147483648). Defined. (* Why3 goal *) Definition to_uint64: Z -> Z. exact (to_range 0 18446744073709551616). Defined. (* Why3 goal *) Definition to_sint64: Z -> Z. exact (to_range (-9223372036854775808) 9223372036854775808). Defined. (* Why3 goal *) Definition two_power_abs: Z -> Z. exact (fun n => two_power_nat (Z.abs_nat n)). Defined. (* Why3 goal *) Lemma two_power_abs_is_positive : forall (n:Z), (0%Z < (two_power_abs n))%Z. Proof. intros n. unfold two_power_abs. apply two_power_nat_is_positive. Qed. (* Why3 goal *) Lemma two_power_abs_plus_pos : forall (n:Z) (m:Z), (0%Z <= n)%Z -> ((0%Z <= m)%Z -> ((two_power_abs (n + m)%Z) = ((two_power_abs n) * (two_power_abs m))%Z)). Proof. intros n m h1 h2. unfold two_power_abs. replace (Z.abs_nat (n + m)) with ((Z.abs_nat n) + (Z.abs_nat m))%nat. + rewrite two_power_nat_plus. trivial. + rewrite Zabs2Nat.inj_add by omega. trivial. Qed. (* Why3 goal *) Lemma two_power_abs_plus_one : forall (n:Z), (0%Z <= n)%Z -> ((two_power_abs (n + 1%Z)%Z) = (2%Z * (two_power_abs n))%Z). Proof. intros n h1. rewrite two_power_abs_plus_pos by omega. replace (two_power_abs 1) with 2%Z. + ring. + unfold two_power_abs. compute. trivial. Qed. (* Why3 assumption *) Definition is_uint (n:Z) (x:Z): Prop := (0%Z <= x)%Z /\ (x < (two_power_abs n))%Z. (* Why3 assumption *) Definition is_sint (n:Z) (x:Z): Prop := ((-(two_power_abs n))%Z <= x)%Z /\ (x < (two_power_abs n))%Z. (* Why3 goal *) Definition to_uint: Z -> Z -> Z. exact (fun n => to_range 0 (two_power_abs n)). Defined. Ltac to_uint to_uintN := unfold to_uint; unfold to_uintN; f_equal. Remark to_uint_8 : to_uint8 = to_uint 8%Z. Proof. to_uint to_uint8. Qed. Remark to_uint_16 : to_uint16 = to_uint 16%Z. Proof. to_uint to_uint16. Qed. Remark to_uint_32 : to_uint32 = to_uint 32%Z. Proof. to_uint to_uint32. Qed. Remark to_uint_64 : to_uint64 = to_uint 64%Z. Proof. to_uint to_uint64. Qed. (* Why3 goal *) Definition to_sint: Z -> Z -> Z. exact (fun n => to_range (-two_power_abs n) (two_power_abs n)). Defined. Ltac to_sint to_sintN := unfold to_sint; unfold to_sintN; f_equal. Remark to_sint_8 : to_sint8 = to_sint 7%Z. Proof. to_sint to_sint8. Qed. Remark to_sint_16 : to_sint16 = to_sint 15%Z. Proof. to_sint to_sint16. Qed. Remark to_sint_32 : to_sint32 = to_sint 31%Z. Proof. to_sint to_sint32. Qed. Remark to_sint_64 : to_sint64 = to_sint 63%Z. Proof. to_sint to_sint64. Qed. (* Why3 goal *) Lemma is_to_uint : forall (n:Z) (x:Z), (is_uint n (to_uint n x)). Proof. intros n x. apply is_to_range. apply two_power_abs_is_positive. Qed. (* Why3 goal *) Lemma is_to_sint : forall (n:Z) (x:Z), (is_sint n (to_sint n x)). Proof. intros n x. apply is_to_range. generalize (two_power_abs_is_positive n); intro. omega. Qed. (** * C-Integer Conversions are in-range *) Local Ltac to_range := intro x ; apply is_to_range ; omega. (* Why3 goal *) Lemma is_to_uint8 : forall (x:Z), (is_uint8 (to_uint8 x)). Proof. to_range. Qed. (* Why3 goal *) Lemma is_to_sint8 : forall (x:Z), (is_sint8 (to_sint8 x)). Proof. to_range. Qed. (* Why3 goal *) Lemma is_to_uint16 : forall (x:Z), (is_uint16 (to_uint16 x)). Proof. to_range. Qed. (* Why3 goal *) Lemma is_to_sint16 : forall (x:Z), (is_sint16 (to_sint16 x)). Proof. to_range. Qed. (* Why3 goal *) Lemma is_to_uint32 : forall (x:Z), (is_uint32 (to_uint32 x)). Proof. to_range. Qed. (* Why3 goal *) Lemma is_to_sint32 : forall (x:Z), (is_sint32 (to_sint32 x)). Proof. to_range. Qed. (* Why3 goal *) Lemma is_to_uint64 : forall (x:Z), (is_uint64 (to_uint64 x)). Proof. to_range. Qed. (* Why3 goal *) Lemma is_to_sint64 : forall (x:Z), (is_sint64 (to_sint64 x)). Proof. to_range. Qed. (** * C-Integer Conversions are identity when in-range *) Remark mod_kn_mod_n: forall (k:Z) (n:Z) (x:Z), k>0 -> n>0 -> (x mod (k*n)) mod n = x mod n. Proof. intros. rewrite (Zmod_eq_full x (k*n)). + rewrite <- Z.add_opp_r. rewrite Zopp_mult_distr_l. replace (- (x/(k*n)) * (k*n)) with (((-(x/(k*n))) * k) * n) by ring. apply Z_mod_plus_full. + assert (k*n > 0). { apply Zmult_gt_0_compat; trivial. } omega. Qed. Lemma id_to_range : forall a b x, a <= x < b -> to_range a b x = x. Proof. intros a b x Range. unfold to_range. assert (Q : b-a > 0) ; auto with zarith. cut ((x-a) mod (b-a) = (x-a)). omega. apply Zmod_small. omega. Qed. Local Ltac id_range := intro x ; apply id_to_range ; omega. (* Why3 goal *) Lemma id_uint : forall (n:Z) (x:Z), (is_uint n x) <-> ((to_uint n x) = x). Proof. intros n x; split. + apply id_to_range. + intro H; rewrite <- H. apply is_to_uint. Qed. (* Why3 goal *) Lemma id_sint : forall (n:Z) (x:Z), (is_sint n x) <-> ((to_sint n x) = x). Proof. intros n x; split. + apply id_to_range. + intro H; rewrite <- H. apply is_to_sint. Qed. (* Why3 goal *) Lemma id_uint8 : forall (x:Z), (is_uint8 x) -> ((to_uint8 x) = x). Proof. id_range. Qed. (* Why3 goal *) Lemma id_sint8 : forall (x:Z), (is_sint8 x) -> ((to_sint8 x) = x). Proof. id_range. Qed. (* Why3 goal *) Lemma id_uint16 : forall (x:Z), (is_uint16 x) -> ((to_uint16 x) = x). Proof. id_range. Qed. (* Why3 goal *) Lemma id_sint16 : forall (x:Z), (is_sint16 x) -> ((to_sint16 x) = x). Proof. id_range. Qed. (* Why3 goal *) Lemma id_uint32 : forall (x:Z), (is_uint32 x) -> ((to_uint32 x) = x). Proof. id_range. Qed. (* Why3 goal *) Lemma id_sint32 : forall (x:Z), (is_sint32 x) -> ((to_sint32 x) = x). Proof. id_range. Qed. (* Why3 goal *) Lemma id_uint64 : forall (x:Z), (is_uint64 x) -> ((to_uint64 x) = x). Proof. id_range. Qed. (* Why3 goal *) Lemma id_sint64 : forall (x:Z), (is_sint64 x) -> ((to_sint64 x) = x). Proof. id_range. Qed. (** * C-Integer Conversions are projections *) Local Ltac proj := intro x ; apply id_to_range ; apply is_to_range ; omega. (* Why3 goal *) Lemma proj_uint : forall (n:Z) (x:Z), ((to_uint n (to_uint n x)) = (to_uint n x)). Proof. intros n x. apply id_to_range. unfold to_uint. apply is_to_range. apply two_power_abs_is_positive. Qed. (* Why3 goal *) Lemma proj_sint : forall (n:Z) (x:Z), ((to_sint n (to_sint n x)) = (to_sint n x)). Proof. intros n x. apply id_to_range. unfold to_sint. apply is_to_range. assert (0 < two_power_abs n). { apply two_power_abs_is_positive. } omega. Qed. (* Why3 goal *) Lemma proj_uint8 : forall (x:Z), ((to_uint8 (to_uint8 x)) = (to_uint8 x)). Proof. proj. Qed. (* Why3 goal *) Lemma proj_sint8 : forall (x:Z), ((to_sint8 (to_sint8 x)) = (to_sint8 x)). Proof. proj. Qed. (* Why3 goal *) Lemma proj_uint16 : forall (x:Z), ((to_uint16 (to_uint16 x)) = (to_uint16 x)). Proof. proj. Qed. (* Why3 goal *) Lemma proj_sint16 : forall (x:Z), ((to_sint16 (to_sint16 x)) = (to_sint16 x)). Proof. proj. Qed. (* Why3 goal *) Lemma proj_uint32 : forall (x:Z), ((to_uint32 (to_uint32 x)) = (to_uint32 x)). Proof. proj. Qed. (* Why3 goal *) Lemma proj_sint32 : forall (x:Z), ((to_sint32 (to_sint32 x)) = (to_sint32 x)). Proof. proj. Qed. (* Why3 goal *) Lemma proj_uint64 : forall (x:Z), ((to_uint64 (to_uint64 x)) = (to_uint64 x)). Proof. proj. Qed. (* Why3 goal *) Lemma proj_sint64 : forall (x:Z), ((to_sint64 (to_sint64 x)) = (to_sint64 x)). Proof. proj. Qed. (* Why3 goal *) Lemma proj_su : forall (n:Z) (x:Z), ((to_sint n (to_uint n x)) = (to_uint n x)). Proof. intros n x; unfold to_uint; unfold to_sint; unfold to_range; simplify_to_range_unfolding. generalize (two_power_abs_is_positive n). pose (n2:=(two_power_abs n)); fold n2. intros. replace (n2 + n2) with (2*n2) by (auto with zarith). replace ((x mod n2 + n2) mod (2 * n2)) with (x mod n2 + n2). + replace (- n2 + (x mod n2 + n2)) with (x mod n2) by ring. trivial. + symmetry. apply Zmod_small. assert (0 <= x mod n2 < n2). { apply Z_mod_lt; omega. } omega. Qed. (* Why3 goal *) Lemma incl_su : forall (n:Z) (x:Z), (is_uint n x) -> (is_sint n x). Proof. intros n x. rewrite id_uint; intro H; rewrite <- H. rewrite id_sint; apply proj_su. Qed. (* Why3 goal *) Lemma proj_su_uint : forall (n:Z) (m:Z) (x:Z), (0%Z <= n)%Z -> ((0%Z <= m)%Z -> ((to_sint (m + n)%Z (to_uint n x)) = (to_uint n x))). Proof. intros n m x Posn POSm; unfold to_uint; unfold to_sint; unfold to_range. repeat (rewrite Z.sub_0_r); rewrite Z.add_0_l; repeat (rewrite Z.sub_opp_r). generalize (two_power_abs_is_positive n). generalize (two_power_abs_is_positive m). generalize (two_power_abs_is_positive (m+n)). rewrite two_power_abs_plus_pos by omega. pose (n2:=(two_power_abs n)); fold n2. pose (m2:=(two_power_abs m)); fold m2. intros. replace (m2*n2 + m2*n2) with (2*(m2*n2)) by (auto with zarith). replace ((x mod n2 + (m2*n2)) mod (2*(m2*n2))) with (x mod n2 + (m2*n2)). + omega. + symmetry. apply Zmod_small. pose (r:=(x mod n2)); fold r. assert (0 <= r < n2). { apply Z_mod_lt; omega. } split. * omega. * replace (2*(m2*n2)) with (m2*n2 + m2*n2) by (auto with zarith). rewrite <- Z.add_lt_mono_r. pose (mn:=(m2 * n2)); fold mn. assert (n2 <= mn). { replace n2 with (1*n2) by auto with zarith. unfold mn. apply Int.CompatOrderMult; omega. } destruct H2. omega. Qed. (* Why3 goal *) Lemma proj_su_sint : forall (n:Z) (m:Z) (x:Z), (0%Z <= n)%Z -> ((0%Z <= m)%Z -> ((to_sint n (to_uint (m + (n + 1%Z)%Z)%Z x)) = (to_sint n x))). Proof. intros n m x POSn POSm; unfold to_uint; unfold to_sint; unfold to_range. repeat (rewrite Z.sub_0_r); rewrite Z.add_0_l; repeat (rewrite Z.sub_opp_r). generalize (two_power_abs_is_positive n). generalize (two_power_abs_is_positive m). generalize (two_power_abs_is_positive (m + (n + 1))). rewrite two_power_abs_plus_pos by omega. rewrite two_power_abs_plus_one by omega. pose (n2:=(two_power_abs n)); fold n2. pose (m2:=(two_power_abs m)); fold m2. intros. replace (n2 + n2) with (2*n2) by (auto with zarith). symmetry. rewrite <- (mod_kn_mod_n m2 ) by omega. rewrite <- Z.add_mod_idemp_l by omega. rewrite mod_kn_mod_n by omega. trivial. Qed. (* Why3 goal *) Lemma proj_int8 : forall (x:Z), ((to_sint8 (to_uint8 x)) = (to_sint8 x)). Proof. intros x. rewrite to_sint_8. rewrite to_uint_8. replace 8 with (0+(7+1)) by (auto with zarith). apply proj_su_sint; (auto with zarith). Qed. (* Why3 goal *) Lemma proj_int16 : forall (x:Z), ((to_sint16 (to_uint16 x)) = (to_sint16 x)). Proof. intros x. rewrite to_sint_16. rewrite to_uint_16. replace 16 with (0+(15+1)) by (auto with zarith). apply proj_su_sint; (auto with zarith). Qed. (* Why3 goal *) Lemma proj_int32 : forall (x:Z), ((to_sint32 (to_uint32 x)) = (to_sint32 x)). Proof. intros x. rewrite to_sint_32. rewrite to_uint_32. replace 32 with (0+(31+1)) by (auto with zarith). apply proj_su_sint; (auto with zarith). Qed. (* Why3 goal *) Lemma proj_int64 : forall (x:Z), ((to_sint64 (to_uint64 x)) = (to_sint64 x)). Proof. intros x. rewrite to_sint_64. rewrite to_uint_64. replace 64 with (0+(63+1)) by (auto with zarith). apply proj_su_sint; (auto with zarith). Qed. (* Why3 goal *) Lemma proj_us_uint : forall (n:Z) (m:Z) (x:Z), (0%Z <= n)%Z -> ((0%Z <= m)%Z -> ((to_uint (n + 1%Z)%Z (to_sint (m + n)%Z x)) = (to_uint (n + 1%Z)%Z x))). Proof. intros n m x POSn POSm; unfold to_uint; unfold to_sint; unfold to_range. repeat (rewrite Z.sub_0_r); repeat (rewrite Z.add_0_l); repeat (rewrite Z.sub_opp_r). generalize (two_power_abs_is_positive n). generalize (two_power_abs_is_positive m). rewrite two_power_abs_plus_one by omega. rewrite two_power_abs_plus_pos by omega. pose (n2:=(two_power_abs n)); fold n2. pose (m2:=(two_power_abs m)); fold m2. intros. replace (m2*n2 + m2*n2) with (2*(m2*n2)) by (auto with zarith). rewrite Z.add_opp_l. symmetry. rewrite <- (mod_kn_mod_n m2) by omega. replace (m2 * (2 * n2)) with (2 * (m2 * n2)) by ring. pose (mn:=(m2*n2)); fold mn. replace x with ((x+mn)-mn) by (auto with zarith). replace (x + mn - mn + mn) with (x + mn) by (auto with zarith). rewrite <- Zminus_mod_idemp_l. unfold mn. replace (2 * (m2 * n2)) with (m2 * (2 * n2)) by ring. rewrite mod_kn_mod_n by omega. trivial. Qed. Remark two_power_abs_increase: forall (n:Z), 0 <= n -> two_power_abs n < two_power_abs (n +1). Proof. intros. generalize (two_power_abs_is_positive n); intro h. rewrite two_power_abs_plus_one; omega. Qed. Require Import Qedlib. (* Why3 goal *) Lemma incl_uint : forall (n:Z) (x:Z) (i:Z), (0%Z <= n)%Z -> ((0%Z <= i)%Z -> ((is_uint n x) -> (is_uint (n + i)%Z x))). Proof. intros n x i h1 h2 h3. apply Qedlib.Z_induction_rank with (m:=0) (n := i) ; auto with zarith. { replace (n + 0) with n by ring; auto. } intro; unfold is_uint; intros h10 h11. split. + omega. + replace (n + (n0 + 1)) with ((n + n0) + 1) by ring. pose (m :=(n + n0)); fold m; fold m in h11. assert (two_power_abs m < two_power_abs (m + 1)). { assert (0 <= m) by (unfold m; omega). clear h11 h2 x h3 i h1 h10. apply two_power_abs_increase; auto. } omega. Qed. (* Why3 goal *) Lemma incl_sint : forall (n:Z) (x:Z) (i:Z), (0%Z <= n)%Z -> ((0%Z <= i)%Z -> ((is_sint n x) -> (is_sint (n + i)%Z x))). Proof. intros n x i h1 h2 h3. apply Qedlib.Z_induction_rank with (m:=0) (n := i) ; auto with zarith. { replace (n + 0) with n by ring; auto. } intro; unfold is_sint; intros h10 h11. replace (n + (n0 + 1)) with ((n + n0) + 1) by ring. pose (m :=(n + n0)); fold m; fold m in h11. assert (0 <= m). { unfold m; omega. } generalize (two_power_abs_increase m); intro. omega. Qed. (* Why3 goal *) Lemma incl_int : forall (n:Z) (x:Z) (i:Z), (0%Z <= n)%Z -> ((0%Z <= i)%Z -> ((is_uint n x) -> (is_sint (n + i)%Z x))). Proof. intros n x i h1 h2 h3. unfold is_sint; unfold is_uint in h3. apply Qedlib.Z_induction_rank with (m:=0) (n := i) ; auto with zarith. { replace (n + 0) with n by ring; omega. } intro. replace (n + (n0 + 1)) with ((n + n0) + 1) by ring. pose (m :=(n + n0)); fold m; intros. assert (0 <= m). { unfold m; omega. } generalize (two_power_abs_increase m); intro. omega. Qed. Require Import Zbits. (* Why3 goal *) Definition lnot: Z -> Z. exact (lnot). Defined. (* Why3 goal *) Definition land: Z -> Z -> Z. exact (land). Defined. (* Why3 goal *) Definition lxor: Z -> Z -> Z. exact (lxor). Defined. (* Why3 goal *) Definition lor: Z -> Z -> Z. exact (lor). Defined. (* Why3 goal *) Definition lsl: Z -> Z -> Z. exact (lsl). Defined. (* Why3 goal *) Definition lsr: Z -> Z -> Z. exact (lsr). Defined. (* Why3 goal *) Definition bit_testb: Z -> Z -> bool. exact (bit_testb). Defined. (* Why3 goal *) Definition bit_test: Z -> Z -> Prop. exact (fun x i => (bit_testb x i) = true). Defined. (* Unused content named is_uint8_pos intros x h. red in h. intuition. Qed. *) (* Unused content named is_uint16_pos intros x h. red in h. intuition. Qed. *) (* Unused content named is_uint32_pos intros x h. red in h. intuition. Qed. *) (* Unused content named is_uint64_pos intros x h. red in h. intuition. Qed. *) (** * Tacticals. *) Require Import Qedlib. Fixpoint Cst_nat n := match n with O => true | S c => Cst_nat c end. Fixpoint Cst_pos p := match p with xH => true | xI c | xO c => Cst_pos c end. Fixpoint Cst_N n := match n with N0 => true | Npos c => Cst_pos c end. Definition Cst_Z x := match x with Z0 => true | Zpos c | Zneg c => Cst_pos c end. Ltac COMPUTE e := let R := fresh in pose (R := e); fold R; compute in R; unfold R; clear R. Ltac COMPUTE_HYP h e := let R := fresh in pose (R := e); fold R in h; compute in R; unfold R in h; clear R. Ltac GUARD cst e := let E := fresh in pose (E := cst e); compute in E; match goal with | [ E:=true |- _] => clear E end. Ltac COMPUTE1 f cst := match goal with | [ |- context[f ?e] ] => GUARD cst e; COMPUTE (f e) | [ H:=context[f ?e] |- _ ] => GUARD cst e; COMPUTE_HYP H (f e) | [ H: context[f ?e] |- _ ] => GUARD cst e; COMPUTE_HYP H (f e) end. Ltac COMPUTE2 f cst1 cst2 := match goal with | [ |- context[f ?e1 ?e2] ] => GUARD cst1 e1; GUARD cst2 e2; COMPUTE (f e1 e2) | [ H:=context[f ?e1 ?e2] |- _] => GUARD cst1 e1; GUARD cst2 e2; COMPUTE_HYP H (f e1 e2) | [ H: context[f ?e1 ?e2] |- _] => GUARD cst1 e1; GUARD cst2 e2; COMPUTE_HYP H (f e1 e2) end. Ltac COMPUTE2AC f cst tac := match goal with | [ |- context[f ?e1 (f ?e2 ?e3) ]] => GUARD cst e1; first [ (GUARD cst e2; (replace (f e1 (f e2 e3)) with (f e3 (f e1 e2)) by (tac ; forward)); COMPUTE (f e1 e2)) | (GUARD cst e3; (replace (f e1 (f e2 e3)) with (f e2 (f e1 e3)) by (tac ; forward)); COMPUTE (f e1 e3))] | [ |- context[f (f ?e3 ?e2) ?e1 ]] => GUARD cst e1; first [ (GUARD cst e2; (replace (f (f e3 e2) e1) with (f e3 (f e2 e1)) by (tac ; forward)); COMPUTE (f e2 e1)) | (GUARD cst e3; (replace (f (f e3 e2) e1) with (f e2 (f e3 e1)) by (tac ; forward)); COMPUTE (f e3 e1))] | [ H:=context[f ?e1 (f ?e2 ?e3) ] |- _] => GUARD cst e1; first [ (GUARD cst e2; (replace (f e1 (f e2 e3)) with (f e3 (f e1 e2)) in H by (tac ; forward)); COMPUTE_HYP H (f e1 e2)) | (GUARD cst e3; (replace (f e1 (f e2 e3)) with (f e2 (f e1 e3)) in H by (tac ; forward)); COMPUTE_HYP H (f e1 e3))] | [ H:=context[f (f ?e3 ?e2) ?e1 ] |- _] => GUARD cst e1; first [ (GUARD cst e2; (replace (f (f e3 e2) e1) with (f e3 (f e2 e1)) in H by (tac ; forward)); COMPUTE_HYP H (f e2 e1)) | (GUARD cst e3; (replace (f (f e3 e2) e1) with (f e2 (f e3 e1)) in H by (tac ; forward)); COMPUTE_HYP H (f e3 e1))] | [ H: context[f ?e1 (f ?e2 ?e3) ] |- _] => GUARD cst e1; first [ (GUARD cst e2; (replace (f e1 (f e2 e3)) with (f e3 (f e1 e2)) in H by (tac ; forward)); COMPUTE (f e1 e2)) | (GUARD cst e3; (replace (f e1 (f e2 e3)) with (f e2 (f e1 e3)) in H by (tac ; forward)); COMPUTE_HYP H (f e1 e3))] | [ H: context[f (f ?e3 ?e2) ?e1 ] |- _] => GUARD cst e1; first [ (GUARD cst e2; (replace (f (f e3 e2) e1) with (f e3 (f e2 e1)) in H by (tac ; forward)); COMPUTE_HYP H (f e2 e1)) | (GUARD cst e3; (replace (f (f e3 e2) e1) with (f e2 (f e3 e1)) in H by (tac ; forward)); COMPUTE_HYP H (f e3 e1))] end. Ltac COMPUTE3 f cst1 cst2 cst3 := match goal with | [ |- context[f ?e1 ?e2 ?e3] ] => GUARD cst1 e1; GUARD cst2 e2; GUARD cst3 e3; COMPUTE (f e1 e2 e3) | [ H:=context[f ?e1 ?e2 ?e3] |- _ ] => GUARD cst1 e1; GUARD cst2 e2; GUARD cst3 e3; COMPUTE_HYP H (f e1 e2 e3) | [ H: context[f ?e1 ?e2 ?e3] |- _ ] => GUARD cst1 e1; GUARD cst2 e2; GUARD cst3 e3; COMPUTE_HYP H (f e1 e2 e3) end. (* Require Import Bits. Ltac ring_tactic := ring. Ltac rewrite_cst := first [ COMPUTE Zopp Cst_Z | COMPUTE Zsucc Cst_Z | COMPUTE Zpred Cst_Z | COMPUTE Zdouble_plus_one Cst_Z | COMPUTE Zdouble_minus_one Cst_Z | COMPUTE Zdouble Cst_Z | COMPUTE Zabs Cst_Z | COMPUTE Zabs_N Cst_Z | COMPUTE Zabs_nat Cst_Z | COMPUTE Z_of_N Cst_N | COMPUTE Z_of_nat Cst_nat | COMPUTE two_power_nat Cst_nat | COMPUTE2 Zminus Cst_Z Cst_Z | COMPUTE2 Zplus Cst_Z Cst_Z | COMPUTE2 Zmult Cst_Z Cst_Z | COMPUTE2AC Zplus Cst_Z ring_tactic | COMPUTE2AC Zmult Cst_Z ring_tactic | COMPUTE to_uint8 Cst_Z | COMPUTE to_sint8 Cst_Z | COMPUTE to_uint16 Cst_Z | COMPUTE to_sint16 Cst_Z | COMPUTE to_uint32 Cst_Z | COMPUTE to_sint32 Cst_Z | COMPUTE to_uint64 Cst_Z | COMPUTE to_sint64 Cst_Z | COMPUTE3 to_range Cst_Z Cst_Z Cst_Z | COMPUTE1 zlnot Cst_Z | COMPUTE1 ZxHpos Cst_Z | COMPUTE1 ZxHpower Cst_Z ]. Remark rewrite_cst_example_1: forall x y, 1 + ((2 * x) * 3 + 2) = (3 * (2 * y)+ 2) + 1 -> 1 + (2 + (x * 2) * 3 ) = (2 + 3 * (y* 2)) + 1. Proof. intros. repeat rewrite_cst. auto. Qed. Remark rewrite_cst_example_2: forall x: Z, x + zlnot (zlnot (0)) = x + Z_of_nat (ZxHpos 0). Proof. rewrite_cst. intro. auto. Qed. *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Cmath.v���������������������������������������������0000666�0000000�0000000�00000004017�13571573400�017571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. Require int.Abs. Require real.Real. Require real.RealInfix. Require Import RIneq. (* Why3 goal *) Lemma abs_def : forall (x:Z), ((0%Z <= x)%Z -> ((ZArith.BinInt.Z.abs x) = x)) /\ (~ (0%Z <= x)%Z -> ((ZArith.BinInt.Z.abs x) = (-x)%Z)). Proof. exact int.Abs.abs_def. Qed. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/ExpLog.v��������������������������������������������0000666�0000000�0000000�00000003665�13571573400�017743� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.Rtrigo_def. Require Reals.Rpower. Require BuiltIn. Require real.Real. Require real.RealInfix. Require real.ExpLog. (* Why3 goal *) Lemma exp_pos : forall (x:R), (0%R < (Reals.Rtrigo_def.exp x))%R. Admitted. ���������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/HighOrd.v�������������������������������������������0000666�0000000�0000000�00000002064�13571573400�020061� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) Require Import BuiltIn. Definition func : forall (a:Type) (b:Type), Type. intros a b. exact (a -> b). Defined. Definition infix_at: forall {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b}, (a -> b) -> a -> b. intros a aWT b bWT f x. exact (f x). Defined. Definition pred (a: Type) := func a bool. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Memory.v��������������������������������������������0000666�0000000�0000000�00000025610�13571573400�020007� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require HighOrd. Require bool.Bool. Require int.Int. Require map.Map. Require Import ZArith. Require Import Qedlib. (* Why3 assumption *) Inductive addr := | mk_addr : Z -> Z -> addr. Axiom addr_WhyType : WhyType addr. Existing Instance addr_WhyType. (* Why3 assumption *) Definition offset (v:addr) : Z := match v with | mk_addr x x1 => x1 end. (* Why3 assumption *) Definition base (v:addr) : Z := match v with | mk_addr x x1 => x end. (* Why3 goal *) Definition addr_le : addr -> addr -> Prop. exact (fun (p q : addr) => ((base p = base q) /\ (offset p <= offset q)%Z)). Defined. (* Why3 goal *) Definition addr_lt : addr -> addr -> Prop. exact (fun (p q : addr) => (base p = base q) /\ (offset p < offset q)%Z). Defined. (* Why3 goal *) Definition addr_le_bool : addr -> addr -> bool. exact (fun (p q : addr) => andb (Zeq_bool (base p) (base q)) (Zle_bool (offset p) (offset q))). Defined. (* Why3 goal *) Definition addr_lt_bool : addr -> addr -> bool. exact (fun (p q : addr) => andb (Zeq_bool (base p) (base q)) (Zlt_bool (offset p) (offset q))). Defined. (* Why3 goal *) Lemma addr_le_def : forall (p:addr) (q:addr), ((base p) = (base q)) -> (addr_le p q) <-> ((offset p) <= (offset q))%Z. Proof. unfold addr_le. intuition. Qed. (* Why3 goal *) Lemma addr_lt_def : forall (p:addr) (q:addr), ((base p) = (base q)) -> (addr_lt p q) <-> ((offset p) < (offset q))%Z. Proof. unfold addr_lt. intuition. Qed. (* Why3 goal *) Lemma addr_le_bool_def : forall (p:addr) (q:addr), (addr_le p q) <-> ((addr_le_bool p q) = true). Proof. unfold addr_le. unfold addr_le_bool. intros. split; intro H. destruct H as [H0 H1]. rewrite Zeq_is_eq_bool in H0. apply Zle_imp_le_bool in H1. rewrite H0. rewrite H1. compute;reflexivity. symmetry in H. apply Bool.andb_true_eq in H. destruct H as [H1 H2]. split;[apply Zeq_bool_eq|apply Zle_bool_imp_le];symmetry; assumption. Qed. (* Why3 goal *) Lemma addr_lt_bool_def : forall (p:addr) (q:addr), (addr_lt p q) <-> ((addr_lt_bool p q) = true). Proof. unfold addr_lt. unfold addr_lt_bool. intros. split; intro H. destruct H as [H0 H1]. rewrite Zeq_is_eq_bool in H0. rewrite Zlt_is_lt_bool in H1. rewrite H0. rewrite H1. compute;reflexivity. symmetry in H. apply Bool.andb_true_eq in H. destruct H as [H1 H2]. split;[apply Zeq_bool_eq|rewrite Zlt_is_lt_bool];symmetry; assumption. Qed. (* Why3 assumption *) Definition null : addr := mk_addr 0%Z 0%Z. (* Why3 assumption *) Definition global (b:Z) : addr := mk_addr b 0%Z. (* Why3 assumption *) Definition shift (p:addr) (k:Z) : addr := mk_addr (base p) ((offset p) + k)%Z. (* Why3 assumption *) Definition included (p:addr) (a:Z) (q:addr) (b:Z) : Prop := (0%Z < a)%Z -> (0%Z <= b)%Z /\ (((base p) = (base q)) /\ (((offset q) <= (offset p))%Z /\ (((offset p) + a)%Z <= ((offset q) + b)%Z)%Z)). (* Why3 assumption *) Definition separated (p:addr) (a:Z) (q:addr) (b:Z) : Prop := (a <= 0%Z)%Z \/ ((b <= 0%Z)%Z \/ (~ ((base p) = (base q)) \/ ((((offset q) + b)%Z <= (offset p))%Z \/ (((offset p) + a)%Z <= (offset q))%Z))). (* Why3 assumption *) Definition eqmem {a:Type} {a_WT:WhyType a} (m1: farray addr a) (m2:farray addr a) (p:addr) (a1:Z) : Prop := forall (q:addr), (included q 1%Z p a1) -> ((m1 .[ q ]) = (m2 .[ q ])). (* Why3 goal *) Variable havoc: forall {a:Type} {a_WT:WhyType a}, (map.Map.map addr a) -> (map.Map.map addr a) -> addr -> Z -> map.Map.map addr a. Definition fhavoc {A : Type} (m : farray addr A) (w : farray addr A) (p:addr) (n:Z) : (farray addr A) := {| whytype1 := whytype1 m; whytype2 := whytype2 m; access := @havoc _ (whytype2 m) (access m) (access w) p n |}. (* Why3 assumption *) Definition valid_rw (m:array Z) (p:addr) (n:Z) : Prop := (0%Z < n)%Z -> (0%Z < (base p))%Z /\ ((0%Z <= (offset p))%Z /\ (((offset p) + n)%Z <= (m .[ base p ]))%Z). (* Why3 assumption *) Definition valid_rd (m:array Z) (p:addr) (n:Z) : Prop := (0%Z < n)%Z -> ~ (0%Z = (base p)) /\ ((0%Z <= (offset p))%Z /\ (((offset p) + n)%Z <= (m .[ base p ]))%Z). (* Why3 assumption *) Definition invalid (m:array Z) (p:addr) (n:Z) : Prop := (0%Z < n)%Z -> ((m .[ base p ]) <= (offset p))%Z \/ (((offset p) + n)%Z <= 0%Z)%Z. (* Why3 goal *) Lemma valid_rw_rd : forall (m:array Z), forall (p:addr), forall (n:Z), (valid_rw m p n) -> valid_rd m p n. Proof. intros m p n. unfold valid_rw. unfold valid_rd. intuition (auto with zarith). Qed. (* Why3 goal *) Lemma valid_string : forall (m:array Z), forall (p:addr), ((base p) < 0%Z)%Z -> ((0%Z <= (offset p))%Z /\ ((offset p) < (m .[ base p ]))%Z) -> (valid_rd m p 1%Z) /\ ~ (valid_rw m p 1%Z). Proof. intros m p. unfold valid_rd. unfold valid_rw. intuition (auto with zarith). Qed. Lemma separated_neq : forall p a q b p' q', separated p a q b -> included p' 1 p a -> included q' 1 q b -> p' <> q'. Proof. intros p a q b p' q' SEP InP InQ EQ. unfold separated in SEP. unfold included in InP,InQ. case_lt 0%Z a. case_lt 0%Z b. intros BPOS APOS. generalize InP ; clear InP. intro H ; elim H ; clear H ; auto with zarith. intro H. clear H. intro H ; elim H ; clear H. intro BaseP. intro H ; elim H ; clear H. intros InP1 InP2. generalize InQ ; clear InQ. intro H ; elim H ; clear H ; auto with zarith. intro H. clear H. intro H ; elim H ; clear H. intro BaseQ. intro H ; elim H ; clear H. intros InQ1 InQ2. generalize SEP ; clear SEP. intro H ; elim H ; clear H ; auto with zarith. intro H ; elim H ; clear H ; auto with zarith. intro H ; elim H ; clear H ; auto with zarith. rewrite <- EQ in BaseQ. rewrite BaseP in BaseQ. contradiction. rewrite <- EQ in InQ1,InQ2. omega. Qed. (* Why3 goal *) Lemma separated_1 : forall (p:addr) (q:addr), forall (a:Z) (b:Z) (i:Z) (j:Z), (separated p a q b) -> (((offset p) <= i)%Z /\ (i < ((offset p) + a)%Z)%Z) -> (((offset q) <= j)%Z /\ (j < ((offset q) + b)%Z)%Z) -> ~ ((mk_addr (base p) i) = (mk_addr (base q) j)). Admitted. (* Why3 goal *) Definition region : array Z. Admitted. (* Why3 goal *) Definition linked : array Z -> Prop. Admitted. (* Why3 goal *) Definition sconst : (farray addr Z) -> Prop. Admitted. (* Why3 assumption *) Definition framed (m: farray addr addr) : Prop := forall (p:addr), ((region .[ (base (m .[ p ]))] ) <= 0%Z)%Z. (* Why3 goal *) Lemma separated_included : forall (p:addr) (q:addr), forall (a:Z) (b:Z), (0%Z < a)%Z -> (0%Z < b)%Z -> (separated p a q b) -> ~ (included p a q b). Proof. intros p q a b h1 h2 h3. unfold separated. unfold included. unfold not. intuition. Admitted. (* Lemma separated_region : forall p a q b, region (base p) <> region (base q) -> separated p a q b. Proof. intros p a q b RDIFF. unfold separated. right. right. left. intuition. apply RDIFF. rewrite H. auto. Qed. *) (* Why3 goal *) Lemma included_trans : forall (p:addr) (q:addr) (r:addr), forall (a:Z) (b:Z) (c:Z), (included p a q b) -> (included q b r c) -> included p a r c. Proof. intros p a q b r c. unfold included. intuition. Qed. (* Why3 goal *) Lemma separated_trans : forall (p:addr) (q:addr) (r:addr), forall (a:Z) (b:Z) (c:Z), (included p a q b) -> (separated q b r c) -> separated p a r c. Proof. intros p a q b r c. Admitted. (* Why3 goal *) Lemma separated_sym : forall (p:addr) (q:addr), forall (a:Z) (b:Z), (separated p a q b) <-> (separated q b p a). Proof. intros p q a b. unfold separated. intuition. Qed. (* Why3 goal *) Lemma eqmem_included {a:Type} {a_WT:WhyType a} : forall (m1:farray addr a) (m2:farray addr a), forall (p:addr) (q:addr), forall (a1:Z) (b:Z), (included p a1 q b) -> (eqmem m1 m2 q b) -> eqmem m1 m2 p a1. Proof. intros m1 m2 p q a1 b h1 h2. Admitted. (* Why3 goal *) Lemma eqmem_sym {a:Type} {a_WT:WhyType a} : forall (m1:farray addr a) (m2: farray addr a), forall (p:addr), forall (a1:Z), (eqmem m1 m2 p a1) -> eqmem m2 m1 p a1. Proof. intros m1 m2 p a1. unfold eqmem. Admitted. (* Why3 goal *) Lemma havoc_access {a:Type} {a_WT:WhyType a} : forall (m0: farray addr a) (m1:farray addr a), forall (q:addr) (p:addr), forall (a1:Z), ((separated q 1%Z p a1) -> (((havoc m0 m1 p a1) q) = (m1 .[ q ]))) /\ (~ (separated q 1%Z p a1) -> (((havoc m0 m1 p a1) q) = (m0 .[ q ]))). Proof. intros m0 m1 q p a1. Admitted. (* Why3 goal *) Definition int_of_addr : addr -> Z. Admitted. (* Why3 goal *) Definition addr_of_int : Z -> addr. Admitted. (* Why3 goal *) Definition base_offset: Z -> Z. Admitted. (* Why3 goal *) Definition base_index: Z -> Z. Admitted. (* Why3 goal *) Lemma int_of_addr_bijection : forall (a:Z), ((int_of_addr (addr_of_int a)) = a). Admitted. (* Why3 goal *) Lemma addr_of_int_bijection : forall (p:addr), ((addr_of_int (int_of_addr p)) = p). Admitted. (* Why3 goal *) Lemma addr_of_null : ((int_of_addr null) = 0%Z). Admitted. (* Why3 goal *) Lemma base_offset_zero : ((base_offset 0%Z) = 0%Z). Admitted. (* Why3 goal *) Lemma base_offset_inj : forall (i:Z), ((base_index (base_offset i)) = i). Admitted. (* Why3 goal *) Lemma base_offset_monotonic : forall (i:Z) (j:Z), (i < j)%Z -> ((base_offset i) < (base_offset j))%Z. Admitted. ������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Qed.v�����������������������������������������������0000666�0000000�0000000�00000013672�13571573400�017255� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require bool.Bool. Require int.Int. Require int.Abs. Require int.EuclideanDivision. Require int.ComputerDivision. Require int.ComputerOfEuclideanDivision. Require real.Real. Require real.RealInfix. Require real.FromInt. (* Why3 goal *) Definition match_bool {a:Type} {a_WT:WhyType a} : bool -> a -> a -> a. exact (fun b x y => if b then x else y). Defined. (* Why3 goal *) Lemma match_bool1 {a:Type} {a_WT:WhyType a} : forall (p:bool) (x:a) (y:a), ((p = true) /\ ((match_bool p x y) = x)) \/ ((p = false) /\ ((match_bool p x y) = y)). Proof. intros p x y. destruct p; intuition. Qed. (* Why3 goal *) Definition eqb {a:Type} {a_WT:WhyType a} : a -> a -> bool. exact (fun x y => if why_decidable_eq x y then true else false). Defined. (* Why3 goal *) Lemma eqb1 {a:Type} {a_WT:WhyType a} : forall (x:a) (y:a), ((eqb x y) = true) <-> (x = y). Proof. intros x y. destruct a_WT. compute;destruct (why_decidable_eq x y);intuition discriminate. Qed. (* Why3 goal *) Lemma eqb_false {a:Type} {a_WT:WhyType a} : forall (x:a) (y:a), ((eqb x y) = false) <-> ~ (x = y). Proof. intros x y. destruct a_WT. compute;destruct (why_decidable_eq x y);intuition discriminate. Qed. (* Why3 goal *) Definition neqb {a:Type} {a_WT:WhyType a} : a -> a -> bool. exact (fun x y => if why_decidable_eq x y then false else true). Defined. (* Why3 goal *) Lemma neqb1 {a:Type} {a_WT:WhyType a} : forall (x:a) (y:a), ((neqb x y) = true) <-> ~ (x = y). Proof. intros x y. destruct a_WT. compute;destruct (why_decidable_eq x y);intuition discriminate. Qed. (* Why3 goal *) Definition zlt : Z -> Z -> bool. exact(Zlt_bool). Defined. (* Why3 goal *) Definition zleq : Z -> Z -> bool. exact(Zle_bool). Defined. (* Why3 goal *) Lemma zlt1 : forall (x:Z) (y:Z), ((zlt x y) = true) <-> (x < y)%Z. Proof. intros x y. assert (T:= Zlt_is_lt_bool x y). tauto. Qed. (* Why3 goal *) Lemma zleq1 : forall (x:Z) (y:Z), ((zleq x y) = true) <-> (x <= y)%Z. Proof. intros x y. assert (T:= Zle_is_le_bool x y). tauto. Qed. (* Why3 goal *) Definition rlt : R -> R -> bool. exact (fun x y => if Rlt_dec x y then true else false). Defined. (* Why3 goal *) Definition rleq : R -> R -> bool. exact (fun x y => if Rle_dec x y then true else false). Defined. (* Why3 goal *) Lemma rlt1 : forall (x:R) (y:R), ((rlt x y) = true) <-> (x < y)%R. Proof. intros x y. compute;destruct (Rlt_dec x y); intuition discriminate. Qed. (* Why3 goal *) Lemma rleq1 : forall (x:R) (y:R), ((rleq x y) = true) <-> (x <= y)%R. Proof. intros x y. compute;destruct (Rle_dec x y);intuition;discriminate. Qed. (* Why3 assumption *) Definition real_of_int (x:Z) : R := (BuiltIn.IZR x). Lemma lt_is_not_eqb1: forall x y, (x < y -> Z.eqb x y = false)%Z. Proof. intros. rewrite Z.eqb_compare. rewrite H. reflexivity. Qed. Lemma lt_is_not_eqb2: forall x y, (y < x -> Z.eqb x y = false)%Z. Proof. intros. rewrite Z.eqb_compare. rewrite (Z.lt_gt _ _ H). reflexivity. Qed. (* Why3 goal *) Lemma c_euclidian : forall (n:Z) (d:Z), ~ (d = 0%Z) -> (n = (((ZArith.BinInt.Z.quot n d) * d)%Z + (ZArith.BinInt.Z.rem n d))%Z). Proof. intros n d. intros H. rewrite Int.Comm1. exact (ComputerDivision.Div_mod n d H). Qed. (* Why3 goal *) Lemma cmod_remainder : forall (n:Z) (d:Z), ((0%Z <= n)%Z -> (0%Z < d)%Z -> (0%Z <= (ZArith.BinInt.Z.rem n d))%Z /\ ((ZArith.BinInt.Z.rem n d) < d)%Z) /\ (((n <= 0%Z)%Z -> (0%Z < d)%Z -> ((-d)%Z < (ZArith.BinInt.Z.rem n d))%Z /\ ((ZArith.BinInt.Z.rem n d) <= 0%Z)%Z) /\ (((0%Z <= n)%Z -> (d < 0%Z)%Z -> (0%Z <= (ZArith.BinInt.Z.rem n d))%Z /\ ((ZArith.BinInt.Z.rem n d) < (-d)%Z)%Z) /\ ((n <= 0%Z)%Z -> (d < 0%Z)%Z -> (d < (ZArith.BinInt.Z.rem n d))%Z /\ ((ZArith.BinInt.Z.rem n d) <= 0%Z)%Z))). Proof. intros n d. (split;[|split;[|split]]);intros; [exact (Zquot.Zrem_lt_pos_pos _ _ H H0)| exact (Zquot.Zrem_lt_neg_pos _ _ H H0)| exact (Zquot.Zrem_lt_pos_neg _ _ H H0)| exact (Zquot.Zrem_lt_neg_neg _ _ H H0)]. Qed. (* Why3 goal *) Lemma cdiv_neutral : forall (a:Z), ((ZArith.BinInt.Z.quot a 1%Z) = a). Proof. intro a. exact (Z.quot_1_r a). Qed. (* Why3 goal *) Lemma cdiv_inv : forall (a:Z), ~ (a = 0%Z) -> ((ZArith.BinInt.Z.quot a a) = 1%Z). Proof. intros a h1. exact (Z.quot_same a h1). Qed. ����������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Qedlib.v��������������������������������������������0000666�0000000�0000000�00000024121�13571573400�017733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) Require Import Bool. Require Import ZArith. Require Import Reals. Require BuiltIn. Require map.Map. Open Scope Z_scope. Set Implicit Arguments. (** ** Tactical *) Ltac forward := repeat (first [ split | intros ]) ; try discriminate ; try contradiction ; try tauto ; try constructor ; try (apply False_ind ; omega ; fail) ; try (apply False_ind ; auto with zarith ; fail) ; auto with zarith. Ltac finish := forward ; fail. Tactic Notation "by" tactic(A) := A ; finish. (** ** Conditional Property *) Inductive branch (A B C : Prop) : Prop := | Then: A -> B -> branch A B C | Else: not A -> C -> branch A B C . Definition itep (A B C : Prop) := (A -> B) /\ (~A -> C). Lemma ite_then : forall A B C : Prop, itep A B C -> A -> B. Proof. by (unfold itep). Qed. Lemma ite_else : forall A B C : Prop, itep A B C -> ~A -> C. Proof. by (unfold itep). Qed. Lemma ite_both : forall A B C : Prop, itep A B C -> (B \/ C). Proof. by (unfold itep). Qed. Remark contrap: forall P Q : Prop, (P -> Q) -> ~Q -> ~P. Proof. intuition. Qed. (** ** Booleans *) Inductive reflect (P:Prop) : bool -> Prop := | R_true : P -> reflect P true | R_false : ~P -> reflect P false. Definition boolean {A : Set} (f : A -> A -> bool) (p : A -> A -> Prop) : Prop := forall x y, reflect (p x y) (f x y). (* forall x y, (f x y = true <-> p x y) /\ (f x y = false <-> ~(p x y)). *) Ltac case_leq x y := generalize (Zle_cases x y) ; induction (Zle_bool x y) ; try omega. Ltac case_lt x y := generalize (Zlt_cases x y) ; induction (Zlt_bool x y) ; try omega. Ltac case_eq x y := generalize (Zeq_bool_if x y) ; induction (Zeq_bool x y) ; try omega. Lemma Zneq_cases : forall x y, if Zneq_bool x y then x <> y else x = y. Proof. intros x y. generalize (Zeq_bool_if x y). unfold Zeq_bool. unfold Zneq_bool. induction (x ?= y) ; auto. Qed. Ltac case_neq x y := generalize (Zneq_cases x y) ; induction (Zneq_bool x y) ; try omega. Inductive Zcases (x y : Z) := | Case_lt : (x < y) -> Zcases x y | Case_eq : (x = y) -> Zcases x y | Case_gt : (x > y) -> Zcases x y. Program Definition Zcompare x y : Zcases x y. Proof. intros. case_leq x y. case_lt x y. intros H _. exact (Case_lt H). intros H1 H2. assert (H : x=y) by omega. exact (Case_eq H). intro H. exact (Case_gt H). Qed. Theorem Zeq_boolean : boolean Zeq_bool (fun x y => (x=y)). Proof. unfold boolean. intros x y. by (case_eq x y). Qed. Theorem Zneq_boolean : boolean Zneq_bool (fun x y => (x <> y)). Proof. unfold boolean. intros x y. by (case_neq x y). Qed. Theorem Zlt_boolean : boolean Zlt_bool Z.lt. Proof. unfold boolean. intros x y. by (case_lt x y). Qed. Theorem Zle_boolean : boolean Zle_bool Z.le. Proof. unfold boolean. intros x y. by (case_leq x y). Qed. Parameter Req_bool : R -> R -> bool. Parameter Rlt_bool : R -> R -> bool. Parameter Rle_bool : R -> R -> bool. Parameter Rneq_bool : R -> R -> bool. Hypothesis Rlt_boolean : boolean Rlt_bool Rlt. Hypothesis Rle_boolean : boolean Rle_bool Rle. Hypothesis Req_boolean : boolean Req_bool (fun x y => (x=y)). Hypothesis Rneq_boolean : boolean Rneq_bool (fun x y => (x<>y)). Parameter Aeq_bool : forall A : Set, A -> A -> bool. Hypothesis Aeq_boolean : forall A : Set, boolean (@Aeq_bool A) (fun x y => x=y). Definition Aneq_bool {A : Set} (x y : A) := negb (Aeq_bool x y). Hypothesis Aneq_boolean : forall A : Set, boolean (@Aneq_bool A) (fun x y => x<>y). (** ** Integer Induction (after a given rank) *) Theorem Z_induction(m : Z)(P : Z -> Prop) : (forall n, n <= m -> P n ) -> (forall n, n >= m -> P n -> P (n+1)) -> (forall n, P n). Proof. intros. induction (Z_le_dec n m) ; auto with zarith. apply Z.le_ind with (n := m) ; auto with zarith. unfold Morphisms.Proper. unfold Morphisms.respectful. intros. rewrite H1. intuition. intros. apply H0; auto with zarith. Qed. Theorem Z_induction_rank(m : Z)(P : Z -> Prop) : P m -> (forall n, m <= n -> P n -> P (n+1)) -> (forall n, m <= n -> P n). Proof. intros h0 h1 n. apply Z_induction with (m := m) (n := n). + intros. apply Z.le_ind with (n := m) ; auto with zarith. unfold Morphisms.Proper. unfold Morphisms.respectful. intros. rewrite H1. intuition. + intros. auto with zarith. Qed. (** ** Real Constants *) (** signed power *) Definition real_base e a n := match n with | 0 => a | Zpos n => (a * pow e (Pos.to_nat n))%R | Zneg n => (a / pow e (Pos.to_nat n))%R end. (** an integer multiplied by a (signed) power of 10. *) Definition real_dec := real_base 10%R. (** an integer multiplied by a (signed) power of 2. *) Definition real_hex := real_base 2%R. (** ** Arrays *) Record farray (A B : Type) := { whytype1 : BuiltIn.WhyType A ; whytype2 : BuiltIn.WhyType B ; access :> @Map.map A B }. Definition array (A : Type) := farray Z A. Hypothesis extensionality: forall (A B : Type) (f g : A -> B), (forall x, f x = g x) -> f = g. Definition select {A B : Type} (m : farray A B) (k : A) : B := (access m) k. Lemma farray_eq : forall A B (m1 m2 : farray A B), whytype1 m1 = whytype1 m2 -> whytype2 m1 = whytype2 m2 -> (forall k, select m1 k = select m2 k) -> m1 = m2. Proof. intros A B m1 m2. destruct m1. destruct m2. simpl. intros H1 H2; rewrite H1; rewrite H2 ; clear H1 H2. intro K. rewrite (extensionality _ _ K). reflexivity. Qed. Definition update {A B : Type} (m : farray A B) (k : A) (v : B) : (farray A B) := {| whytype1 := whytype1 m; whytype2 := whytype2 m; access := @Map.set A (whytype1 m) B (whytype2 m) (access m) k v|}. Notation " a .[ k ] " := (select a k) (at level 60). Notation " a .[ k <- v ] " := (update a k v) (at level 60). Lemma access_update : forall (A B : Type) (m : farray A B) k v, m.[k <- v].[k] = v. Proof. intros. apply (proj1 (Map.set_def (access m) k v k)). reflexivity. Qed. Lemma access_update_neq : forall (A B : Type) (m : farray A B) i j v, i <> j -> m.[ i <- v ].[j] = m.[j]. Proof. intros. apply (proj2 (Map.set_def (access m) i v j)). auto. Qed. (** ** Division on Z *) Definition Cdiv (n d : Z) : Z := match n , d with | 0 , _ | _ , 0 => 0 | Zpos a , Zpos b | Zneg a , Zneg b => (Zpos a/Zpos b) | Zpos a , Zneg b | Zneg a , Zpos b => (-(Zpos a/Zpos b)) end. Definition Cmod (n d : Z) : Z := match n , d with | 0 , _ | _ , 0 => 0 | Zpos a , Zpos b | Zpos a , Zneg b => ( (Zpos a) mod (Zpos b) ) | Zneg a , Zpos b | Zneg a , Zneg b => (-( (Zpos a) mod (Zpos b) )) end. Lemma Cdiv_cases : forall n d, ((n >= 0) -> (d > 0) -> Cdiv n d = n/d) /\ ((n <= 0) -> (d > 0) -> Cdiv n d = -((-n)/d)) /\ ((n >= 0) -> (d < 0) -> Cdiv n d = -(n/(-d))) /\ ((n <= 0) -> (d < 0) -> Cdiv n d = (-n)/(-d)). Proof. intros. destruct n as [|a|a] ; destruct d as [|b|b] ; intuition ; by auto with zarith. Qed. Lemma Cmod_cases : forall n d, ((n >= 0) -> (d > 0) -> Cmod n d = n mod d) /\ ((n <= 0) -> (d > 0) -> Cmod n d = -((-n) mod d)) /\ ((n >= 0) -> (d < 0) -> Cmod n d = (n mod (-d))) /\ ((n <= 0) -> (d < 0) -> Cmod n d = -((-n) mod (-d))). Proof. intros. destruct n as [|a|a] ; destruct d as [|b|b] ; intuition ; by auto with zarith. Qed. Theorem Cdiv_enclidian : forall (n d : Z), d <> 0 -> let q := Cdiv n d in let r := Cmod n d in (q * d + r = n). Proof. intros n d NEQ q r. assert (OPP: forall p, (- (Zneg p) = Zpos p)) by auto with zarith. assert (NEG: forall p, (Zneg p = - (Zpos p))) by auto with zarith. destruct n as [|a|a] ; destruct d as [|b|b] ; auto with zarith ; unfold Cdiv in q ; unfold Cmod in r ; unfold q ; unfold r ; repeat rewrite OPP ; repeat rewrite NEG ; rewrite (Zmod_eq_full (Zpos a) (Zpos b)) ; try discriminate ; try ring. Qed. Lemma Cmod_less : forall n d, ((n >= 0) -> (d > 0) -> 0 <= Cmod n d < d) /\ ((n <= 0) -> (d > 0) -> -d < Cmod n d <= 0) /\ ((n >= 0) -> (d < 0) -> 0 <= Cmod n d < -d) /\ ((n <= 0) -> (d < 0) -> d < Cmod n d <= 0). Proof. intros. destruct n as [|a|a] ; destruct d as [|b|b] ; intuition ; simpl ; forward ; generalize (Z_mod_lt (Zpos a) (Zpos b) (Zgt_pos_0 b)) ; repeat (replace (Zneg b) with (- Zpos b) by auto with zarith) ; intuition (auto with zarith). Qed. Lemma Zdiv_less : forall (n d : Z), (n > 0) -> (d > 0) -> (d * (n/d) <= n). Proof. intros n d Npos Dpos. generalize (Zmod_eq n d). pose (x := (n/d)). fold x. intro H. generalize (H Dpos). clear H. pose (r := (n mod d)). fold r. intro H. generalize (Z_mod_lt n d). intro R. generalize (R Dpos). clear R. fold r. replace (d*x) with (x*d) by ring. omega. Qed. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Square.v��������������������������������������������0000666�0000000�0000000�00000004660�13571573400�020001� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.R_sqrt. Require BuiltIn. Require real.Real. Require real.RealInfix. Require real.Square. (* Why3 goal *) Lemma sqrt_lin1 : forall (x:R), (1%R < x)%R -> ((Reals.R_sqrt.sqrt x) < x)%R. Proof. intros x h1. refine (Reals.R_sqrt.sqrt_less _ _ h1). apply (Rle_trans 0 1 x Rle_0_1)%R. exact (Rlt_le _ _ h1). Qed. (* Why3 goal *) Lemma sqrt_lin0 : forall (x:R), ((0%R < x)%R /\ (x < 1%R)%R) -> (x < (Reals.R_sqrt.sqrt x))%R. Proof. intros x (h1,h2). exact (Reals.R_sqrt.sqrt_more x h1 h2). Qed. (* Why3 goal *) Lemma sqrt_0 : ((Reals.R_sqrt.sqrt 0%R) = 0%R). Proof. exact Reals.R_sqrt.sqrt_0. Qed. (* Why3 goal *) Lemma sqrt_1 : ((Reals.R_sqrt.sqrt 1%R) = 1%R). Proof. exact Reals.R_sqrt.sqrt_1. Qed. ��������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Vlist.v���������������������������������������������0000666�0000000�0000000�00000040463�13571573400�017643� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. Require int.Abs. Require int.ComputerDivision. (* ---------------------------------------------------------------------- *) (* --- Lists for Why-3 --- *) (* ---------------------------------------------------------------------- *) Require List. Ltac seq := autorewrite with list ; auto with zarith. Hint Rewrite List.app_assoc List.app_nil_l List.app_nil_r : list. (* -------------------------------------------------------------------- *) (* --- Classical Lists for Alt-Ergo --- *) (* -------------------------------------------------------------------- *) Require Import Qedlib. (* Why3 goal *) Definition list : forall (a:Type), Type. exact(List.list). Defined. (* Why3 goal *) Definition nil {a:Type} {a_WT:WhyType a} : list a. generalize a. exact(@List.nil). Defined. (* Why3 goal *) Definition cons {a:Type} {a_WT:WhyType a} : a -> (list a) -> list a. generalize a. exact(@List.cons). Defined. (* Why3 goal *) Definition concat {a:Type} {a_WT:WhyType a} : (list a) -> (list a) -> list a. Local Open Scope list_scope. exact(fun u v => u ++ v). Defined. Fixpoint repeat_nat (a:Type) (w: list a) (n: nat) {struct n} := match n with | O => w | S m => w ++ (repeat_nat a w m) end. (* Why3 goal *) Definition repeat {a:Type} {a_WT:WhyType a} : (list a) -> Z -> list a. exact(fun w n => match n with | Z0 => nil | Zneg _ => nil | other => repeat_nat a w (Z.abs_nat (n-1)) end). Defined. (* Why3 goal *) Definition length {a:Type} {a_WT:WhyType a} : (list a) -> Z. exact(fun w => Z.of_nat (List.length w)). Defined. (* Why3 goal *) Definition nth {a:Type} {a_WT:WhyType a} : (list a) -> Z -> a. exact(fun w n => match n with | Zneg _ => (@why_inhabitant a a_WT) | other => List.nth (Z.abs_nat n) w (@why_inhabitant a a_WT) end). Defined. (* -------------------------------------------------------------------- *) (* --- length --- *) (* -------------------------------------------------------------------- *) (* Why3 goal *) Lemma length_pos {a:Type} {a_WT:WhyType a} : forall (w:list a), (0%Z <= (length w))%Z. Proof. intros. unfold length. apply Zle_0_nat. Qed. (* Why3 goal *) Lemma length_nil {a:Type} {a_WT:WhyType a} : ((length (nil : list a)) = 0%Z). Proof. intros. unfold length. unfold nil. by seq. Qed. (* Why3 goal *) Lemma length_nil_bis {a:Type} {a_WT:WhyType a} : forall (w:list a), ((length w) = 0%Z) -> (w = (nil : list a)). Proof. intros w. unfold length. unfold nil. destruct w. + by seq. + Import List.ListNotations. assert (0 < Z.of_nat (Datatypes.length (a0 :: w))). { replace (Datatypes.length (a0 :: w)) with (1 + Datatypes.length (w))%nat by( (replace (a0 :: w) with ([a0] ++ w) by seq); rewrite List.app_length; by seq). assert (0 <= Z.of_nat (Datatypes.length w)) by apply Zle_0_nat. replace (Z.of_nat (1 + Datatypes.length w)) with (1 + Z.of_nat (Datatypes.length w)). { omega. } rewrite Nat2Z.inj_add. auto with zarith. } intro. cut False; [contradiction|omega]. Qed. (* Why3 goal *) Lemma length_cons {a:Type} {a_WT:WhyType a} : forall (x:a) (w:list a), ((length (cons x w)) = (1%Z + (length w))%Z). Proof. intros. unfold length. replace (Datatypes.length (cons x w)) with (1 + (Datatypes.length w))%nat. apply Nat2Z.inj_add. simpl. auto. Qed. (* Why3 goal *) Hypothesis length_concat : forall {a:Type} {a_WT:WhyType a}, forall (u:list a) (v:list a), ((length (concat u v)) = ((length u) + (length v))%Z). (* Why3 goal *) Hypothesis length_repeat : forall {a:Type} {a_WT:WhyType a}, forall (w:list a) (n:Z), (0%Z <= n)%Z -> ((length (repeat w n)) = (n * (length w))%Z). (* -------------------------------------------------------------------- *) (* --- nth --- *) (* -------------------------------------------------------------------- *) (* Why3 goal *) Hypothesis nth_cons : forall {a:Type} {a_WT:WhyType a}, forall (k:Z) (x:a) (w:list a), ((k = 0%Z) -> ((nth (cons x w) k) = x)) /\ (~ (k = 0%Z) -> ((nth (cons x w) k) = (nth w (k - 1%Z)%Z))). (* Why3 goal *) Hypothesis nth_concat : forall {a:Type} {a_WT:WhyType a}, forall (u:list a) (v:list a) (k:Z), ((k < (length u))%Z -> ((nth (concat u v) k) = (nth u k))) /\ (~ (k < (length u))%Z -> ((nth (concat u v) k) = (nth v (k - (length u))%Z))). (* Why3 goal *) Hypothesis nth_repeat : forall {a:Type} {a_WT:WhyType a}, forall (n:Z) (k:Z) (w:list a), ((0%Z <= k)%Z /\ (k < (n * (length w))%Z)%Z) -> (0%Z < (length w))%Z -> ((nth (repeat w n) k) = (nth w (ZArith.BinInt.Z.rem k (length w)))). (* Why3 assumption *) Definition vlist_eq {a:Type} {a_WT:WhyType a} (u:list a) (v:list a) : Prop := ((length u) = (length v)) /\ forall (i:Z), ((0%Z <= i)%Z /\ (i < (length u))%Z) -> ((nth u i) = (nth v i)). (* -------------------------------------------------------------------- *) (* --- equality of Lists --- *) (* -------------------------------------------------------------------- *) (* Why3 goal *) Hypothesis extensionality : forall {a:Type} {a_WT:WhyType a}, forall (u:list a) (v:list a), (vlist_eq u v) -> (u = v). (* -------------------------------------------------------------------- *) (* --- neutral elements --- *) (* -------------------------------------------------------------------- *) (* Why3 goal *) Lemma eq_nil_concat {a:Type} {a_WT:WhyType a} : forall (w:list a), (vlist_eq (concat (nil : list a) w) w) /\ (vlist_eq (concat w (nil : list a)) w). Proof. intros. split ; unfold vlist_eq ; rewrite length_concat; rewrite length_nil; split; auto with zarith; intros. (* + generalize (nth_concat nil w i); rewrite length_nil; intro G; destruct G. rewrite H1. * replace (i - 0)%Z with i by (auto with zarith). auto. * omega. *) + generalize (nth_concat w nil i). intro G; destruct G. rewrite H0. * auto. * omega. Qed. (* Why3 goal *) Lemma rw_nil_concat_left {a:Type} {a_WT:WhyType a} : forall (w:list a), ((concat (nil : list a) w) = w). Proof. intros. apply extensionality. generalize (eq_nil_concat w). intro G; destruct G. apply H. Qed. (* Why3 goal *) Lemma rw_nil_concat_right {a:Type} {a_WT:WhyType a} : forall (w:list a), ((concat w (nil : list a)) = w). intros. apply extensionality. generalize (eq_nil_concat w). intro G; destruct G. apply H0. Qed. (* Why3 goal *) Lemma eq_cons_concat {a:Type} {a_WT:WhyType a} : forall (x:a) (v:list a) (w:list a), vlist_eq (concat (cons x v) w) (cons x (concat v w)). Proof. intros. unfold vlist_eq ; rewrite length_concat. repeat (rewrite length_cons). split. + rewrite length_concat. ring. + intros. generalize (nth_cons i x (concat v w)); intro G; destruct G. case_eq i 0%Z; intro Position_0. * clear H1; rewrite H0; clear H0; auto. generalize (nth_concat (cons x v) w i); rewrite length_cons; intro G; destruct G. generalize (length_pos v); intro Positive. clear H1; rewrite H0 by omega; clear H0. generalize (nth_cons i x v); intro G; destruct G. clear H1; rewrite H0; clear H0; auto. * clear H0; rewrite H1; clear H1; auto. generalize (nth_concat (cons x v) w i); rewrite length_cons; intro G; destruct G. case_lt i (1+ length v)%Z; intros. - clear H1; rewrite H0 by auto; clear H0. generalize (nth_cons i x v); intro G; destruct G. clear H0; rewrite H1 by auto; clear H1. generalize (nth_concat v w (i -1)); intro G; destruct G. clear H1; rewrite H0 by auto with zarith; clear H0. auto. - clear H0; rewrite H1 by auto; clear H1. generalize (nth_concat v w (i -1)); intro G; destruct G. clear H0; rewrite H1 by auto with zarith. replace (i - (1 + length v))%Z with (i - 1 - length v)%Z by auto with zarith. auto. Qed. (* Why3 goal *) Lemma rw_cons_concat {a:Type} {a_WT:WhyType a} : forall (x:a) (v:list a) (w:list a), ((concat (cons x v) w) = (cons x (concat v w))). Proof. intros. apply extensionality. apply eq_cons_concat. Qed. (* Why3 goal *) Lemma rw_nil_cons_concat {a:Type} {a_WT:WhyType a} : forall (x:a) (w:list a), ((concat (cons x (nil : list a)) w) = (cons x w)). Proof. intros. rewrite rw_cons_concat. rewrite rw_nil_concat_left. auto. Qed. (* -------------------------------------------------------------------- *) (* --- associativity --- *) (* -------------------------------------------------------------------- *) (* Why3 goal *) Lemma eq_assoc_concat {a:Type} {a_WT:WhyType a} : forall (u:list a) (v:list a) (w:list a), vlist_eq (concat (concat u v) w) (concat u (concat v w)). Proof. intros. unfold vlist_eq. repeat (rewrite length_concat). split. - ring. - intros. generalize (length_pos u); generalize (length_pos v); intros uPos vPos. case_lt i (length u); intro inU; generalize (nth_concat u (concat v w) i) ; intro G; destruct G. + clear H1; rewrite H0 by auto; clear H0. generalize (nth_concat (concat u v) w i) ; rewrite length_concat ; intro G; destruct G. clear H1; rewrite H0 by omega; clear H0. generalize (nth_concat u v i) ; intro G; destruct G. clear H1; rewrite H0 by auto; clear H0. auto. + clear H0; rewrite H1 by auto; clear H1. case_lt i ((length u) + (length v)); intro inV; generalize (nth_concat (concat u v) w i) ; rewrite length_concat ; intro G; destruct G. * clear H1; rewrite H0 by omega; clear H0. generalize (nth_concat u v i) ; intro G; destruct G. clear H0; rewrite H1 by auto; clear H1. generalize (nth_concat v w (i - length u)) ; intro G; destruct G. clear H1; rewrite H0 by omega; clear H0. auto. * clear H0; rewrite H1 by omega; clear H1. generalize (nth_concat v w (i - length u)) ; intro G; destruct G. clear H0; rewrite H1 by omega; clear H1. replace (i - (length u + length v)) with (i - length u - length v) by auto with zarith. auto. Qed. (* Why3 goal *) Lemma rw_nil_repeat {a:Type} {a_WT:WhyType a} : forall (n:Z), (0%Z <= n)%Z -> ((repeat (nil : list a) n) = (nil : list a)). Proof. intros n h1. induction n ; simpl ; auto. assert (R : forall n, repeat_nat a nil n = nil). * intro n. induction n ; simpl ; auto. * apply R. Qed. (* Why3 goal *) Lemma rw_repeat_zero {a:Type} {a_WT:WhyType a} : forall (w:list a), ((repeat w 0%Z) = (nil : list a)). Proof. intros w. simpl. auto. Qed. (* Why3 goal *) Lemma eq_repeat_one {a:Type} {a_WT:WhyType a} : forall (w:list a), vlist_eq (repeat w 1%Z) w. intros w. simpl. unfold vlist_eq. auto. Qed. (* Why3 goal *) Lemma rw_repeat_one {a:Type} {a_WT:WhyType a} : forall (w:list a), ((repeat w 1%Z) = w). Proof. intros w. simpl. auto. Qed. (* Why3 goal *) Lemma eq_repeat_concat {a:Type} {a_WT:WhyType a} : forall (p:Z) (q:Z) (w:list a), (0%Z <= p)%Z -> (0%Z <= q)%Z -> vlist_eq (repeat w (p + q)%Z) (concat (repeat w p) (repeat w q)). Proof. intros p q w h1 h2. unfold vlist_eq ; simpl ; split ; auto with zarith. + repeat rewrite length_concat. repeat rewrite length_repeat ; auto with zarith. + rewrite length_repeat ; auto with zarith. intros. induction w. * replace ([]) with (@nil a a_WT) ; auto. repeat rewrite rw_nil_repeat ; auto with zarith. * pose (A := (a0 :: w)). fold A. fold A in H. assert (L : 0 < length A). { unfold A. replace (a0 :: w) with (cons a0 w) by auto. rewrite length_cons. assert (0 <= length w). apply length_pos. auto with zarith. } rewrite nth_repeat ; auto with zarith. generalize (nth_concat (repeat A p) (repeat A q) i). intros [ POS NEG ]. induction (Z_lt_le_dec i (length (repeat A p))). rewrite length_repeat in a1; auto with zarith. - rewrite POS ; auto with zarith. rewrite nth_repeat ; auto with zarith. rewrite length_repeat ; auto with zarith. - rewrite length_repeat in b ; auto with zarith. assert ( I_pos: 0 <= i ) ; auto with zarith. rewrite Int.Mul_distr_r in H. rewrite NEG ; auto with zarith. rewrite nth_repeat ; auto with zarith ; rewrite length_repeat ; auto with zarith. replace (i - p * length A) with (i + (-p) * length A). rewrite Z.rem_add ; auto with zarith. apply Z.mul_nonneg_nonneg ; auto with zarith. replace (i + -p * length A) with (i - p * length A) ; auto with zarith. rewrite Z.mul_opp_l. rewrite Z.add_opp_r. auto. rewrite Z.mul_opp_l. rewrite Z.add_opp_r. auto. rewrite length_repeat ; auto with zarith. Qed. (* Why3 goal *) Lemma rw_repeat_concat {a:Type} {a_WT:WhyType a} : forall (p:Z) (q:Z) (w:list a), (0%Z <= p)%Z -> (0%Z <= q)%Z -> ((repeat w (p + q)%Z) = (concat (repeat w p) (repeat w q))). intros p q w h1 h2. apply extensionality. apply eq_repeat_concat ; auto with zarith. Qed. (* Why3 goal *) Lemma rw_repeat_after {a:Type} {a_WT:WhyType a} : forall (p:Z) (w:list a), (0%Z <= p)%Z -> ((concat (repeat w p) w) = (repeat w (p + 1%Z)%Z)). Proof. intros p w h1. rewrite (rw_repeat_concat p 1 w) ; auto with zarith. Qed. (* Why3 goal *) Lemma rw_repeat_before {a:Type} {a_WT:WhyType a} : forall (p:Z) (w:list a), (0%Z <= p)%Z -> ((concat w (repeat w p)) = (repeat w (p + 1%Z)%Z)). Proof. intros p w h1. replace (p+1) with (1+p) ; auto with zarith. rewrite (rw_repeat_concat 1 p w) ; auto with zarith. Qed. (* Why3 goal *) Definition repeat_box {a:Type} {a_WT:WhyType a} : (list a) -> Z -> list a. intros l n. exact (repeat l n). Defined. (* Why3 goal *) Lemma rw_repeat_box_unfold {a:Type} {a_WT:WhyType a} : forall (w:list a) (n:Z), ((repeat_box w n) = (repeat w n)). Proof. intros. unfold repeat_box. auto. Qed. (* Why3 goal *) Lemma rw_repeat_plus_box_unfold {a:Type} {a_WT:WhyType a} : forall (w:list a) (a1:Z) (b:Z), (0%Z <= a1)%Z -> (0%Z <= b)%Z -> ((repeat_box w (a1 + b)%Z) = (concat (repeat w a1) (repeat w b))). Proof. intros. unfold repeat_box. rewrite rw_repeat_concat ; auto. Qed. (* Why3 goal *) Lemma rw_repeat_plus_one_box_unfold {a:Type} {a_WT:WhyType a} : forall (w:list a) (n:Z), (0%Z < n)%Z -> ((repeat_box w n) = (concat (repeat w (n - 1%Z)%Z) w)) /\ ((repeat_box w (n + 1%Z)%Z) = (concat (repeat w n) w)). Proof. intros. split. + generalize (rw_repeat_concat (n-1) 1 w). replace (n-1+1) with n ; auto with zarith. + rewrite (rw_repeat_concat n 1 w) ; auto with zarith. Qed. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Vset.v����������������������������������������������0000666�0000000�0000000�00000011566�13571573400�017465� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require bool.Bool. Require int.Int. (* Why3 goal *) Definition set : forall (a:Type), Type. Admitted. (* Why3 goal *) Definition empty {a:Type} {a_WT:WhyType a} : set a. Admitted. (* Why3 goal *) Definition singleton {a:Type} {a_WT:WhyType a} : a -> set a. Admitted. (* Why3 goal *) Definition union {a:Type} {a_WT:WhyType a} : (set a) -> (set a) -> set a. Admitted. (* Why3 goal *) Definition inter {a:Type} {a_WT:WhyType a} : (set a) -> (set a) -> set a. Admitted. (* Why3 goal *) Definition member {a:Type} {a_WT:WhyType a} : a -> (set a) -> Prop. Admitted. (* Why3 goal *) Definition member_bool {a:Type} {a_WT:WhyType a} : a -> (set a) -> bool. Admitted. (* Why3 goal *) Definition range : Z -> Z -> set Z. Admitted. (* Why3 goal *) Definition range_sup : Z -> set Z. Admitted. (* Why3 goal *) Definition range_inf : Z -> set Z. Admitted. (* Why3 goal *) Definition range_all : set Z. Admitted. (* Why3 assumption *) Definition eqset {a:Type} {a_WT:WhyType a} (a1:set a) (b:set a) : Prop := forall (x:a), (member x a1) <-> (member x b). (* Why3 assumption *) Definition subset {a:Type} {a_WT:WhyType a} (a1:set a) (b:set a) : Prop := forall (x:a), (member x a1) -> member x b. (* Why3 assumption *) Definition disjoint {a:Type} {a_WT:WhyType a} (a1:set a) (b:set a) : Prop := forall (x:a), (member x a1) -> ~ (member x b). (* Why3 goal *) Lemma member_bool1 {a:Type} {a_WT:WhyType a} : forall (x:a), forall (s:set a), ((member x s) -> ((member_bool x s) = true)) /\ (~ (member x s) -> ((member_bool x s) = false)). Proof. intros x s. Admitted. (* Why3 goal *) Lemma member_empty {a:Type} {a_WT:WhyType a} : forall (x:a), ~ (member x (empty : set a)). Proof. intros x. Admitted. (* Why3 goal *) Lemma member_singleton {a:Type} {a_WT:WhyType a} : forall (x:a) (y:a), (member x (singleton y)) <-> (x = y). Proof. intros x y. Admitted. (* Why3 goal *) Lemma member_union {a:Type} {a_WT:WhyType a} : forall (x:a), forall (a1:set a) (b:set a), (member x (union a1 b)) <-> ((member x a1) \/ (member x b)). Proof. intros x a1 b. Admitted. (* Why3 goal *) Lemma member_inter {a:Type} {a_WT:WhyType a} : forall (x:a), forall (a1:set a) (b:set a), (member x (inter a1 b)) <-> ((member x a1) /\ (member x b)). Proof. intros x a1 b. Admitted. (* Why3 goal *) Lemma union_empty {a:Type} {a_WT:WhyType a} : forall (a1:set a), ((union a1 (empty : set a)) = a1) /\ ((union (empty : set a) a1) = a1). Proof. intros a1. Admitted. (* Why3 goal *) Lemma inter_empty {a:Type} {a_WT:WhyType a} : forall (a1:set a), ((inter a1 (empty : set a)) = (empty : set a)) /\ ((inter (empty : set a) a1) = (empty : set a)). Proof. intros a1. Admitted. (* Why3 goal *) Lemma member_range : forall (x:Z) (a:Z) (b:Z), (member x (range a b)) <-> ((a <= x)%Z /\ (x <= b)%Z). Proof. intros x a b. Admitted. (* Why3 goal *) Lemma member_range_sup : forall (x:Z) (a:Z), (member x (range_sup a)) <-> (a <= x)%Z. Proof. intros x a. Admitted. (* Why3 goal *) Lemma member_range_inf : forall (x:Z) (b:Z), (member x (range_inf b)) <-> (x <= b)%Z. Proof. intros x b. Admitted. (* Why3 goal *) Lemma member_range_all : forall (x:Z), member x range_all. Proof. intros x. Admitted. ������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/Zbits.v���������������������������������������������0000666�0000000�0000000�00000211556�13571573400�017640� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (** * ACSL Logical and Bitwise Operators *) (* -------------------------------------------------------------------------- *) (** The characteristic function of integers have {!arith:arithmetic} properties and allows to define logical operators over [Z]. Logical [land], [lor], [lxor] and [lnot] are defined as the lifting over bits of the associated boolean operators. As a corollary, the consistency of bitwise [lnot] definition and two's complements [zlnot] is assessed. These definitions are provided in two stages: - {!bitwise:bitwise} definitions of logical operators - {!ACSL:ACSL} operators definitions *) (** ** Tacticals *) Require Import ZArith. Require Import FunctionalExtensionality. Require Import Qedlib. Require Import Bits. Require Import Psatz. Local Open Scope Z_scope. Local Ltac omegaContradiction := cut False; [contradiction|omega]. Local Ltac caseEq name := generalize (refl_equal name); pattern name at -1 in |- *; case name. Local Ltac unfold_hyp h := match goal with | h:(?X1) |- _ => unfold X1 in h | h:(?X1 _ ) |- _ => unfold X1 in h | h:(?X1 _ _) |- _ => unfold X1 in h | h:(?X1 _ _ _) |- _ => unfold X1 in h | h:(?X1 _ _ _ _) |- _ => unfold X1 in h | _ => idtac end. Lemma bool3_eq : forall b1 b2: bool, (forall b: bool, b1=b <-> b2=b) <-> b1=b2. Proof. intros. intuition. rewrite H; auto. rewrite <- H; auto. rewrite H; auto. Qed. Lemma bool2_eq_true : forall b1 b2:bool, (b1=true <-> b2=true) <-> b1=b2. Proof. intros. destruct b1. destruct b2. intuition. intuition. destruct b2. intuition. intuition. Qed. Lemma split_range: forall a x b: Z, a <= x -> x < b -> a <= x < b. Proof. intros. omega. Qed. (** Some remarks about absolute value *) Remark zabs_gt: forall n m: Z, Z.abs m < Z.abs n -> (Z.abs_nat m < Z.abs_nat n)%nat. Proof. intros. apply (inj_lt_rev (Z.abs_nat m) (Z.abs_nat n)). rewrite (inj_Zabs_nat n). rewrite (inj_Zabs_nat m). omega. Qed. Remark zabs_le: forall n m: Z, Z.abs n <= Z.abs m -> (Z.abs_nat n <= Z.abs_nat m)%nat. Proof. intros. apply (inj_le_rev (Z.abs_nat n) (Z.abs_nat m)). rewrite (inj_Zabs_nat n). rewrite (inj_Zabs_nat m). omega. Qed. Remark zabs_le_plus: forall (n m:Z) (k: nat), Z.abs n <= Z.abs m -> (Z.abs_nat n <= k + Z.abs_nat m)%nat. Proof. intros. apply (inj_le_rev (Z.abs_nat n) (k + Z.abs_nat m)%nat). rewrite (inj_Zabs_nat n). rewrite inj_plus. rewrite (inj_Zabs_nat m). omega. Qed. Remark zabs_nat_zabs: forall n: Z, Z.abs_nat (Z.abs n) = Z.abs_nat n. Proof. intro. rewrite <- (inj_Zabs_nat n). rewrite Zabs_nat_Z_of_nat. auto. Qed. Remark zabs_minus: forall n m: Z, Z.abs n <= Z.abs m -> (Z.abs_nat m - Z.abs_nat n)%nat = Z.abs_nat (Z.abs m - Z.abs n). Proof. intros. rewrite Zabs_nat_Zminus by (generalize (Zabs_pos n); omega). repeat rewrite zabs_nat_zabs. auto. Qed. Remark zabs_plus: forall n m: Z, (Z.abs_nat m + Z.abs_nat n)%nat = Z.abs_nat (Z.abs m + Z.abs n). Proof. intros. rewrite Zabs_nat_Zplus. (** cont. *) repeat rewrite zabs_nat_zabs; auto. (** hyp 1 *) generalize (Zabs_pos m); omega. (** hyp 2 *) generalize (Zabs_pos n); omega. Qed. (** Some remarks about Zle_bool and Zlt_bool *) Remark Zle_2x: forall x:Z, Zle_bool 0 (2*x) = Zle_bool 0 x. Proof. induction x; auto. Qed. Remark Zle_div2: forall x:Z, Zle_bool 0 (x/2) = Zle_bool 0 x. Proof. intro x. case_leq 0 (x/2); case_leq 0 x; try auto; intros; apply False_ind. (** 0>x *) + assert (x/2 < 0); [ apply Zdiv_lt_upper_bound | ]; omega. (** 0<=x *) + assert (0 <= (x/2)); [ apply Z_div_pos | ]; omega. Qed. Remark Zlt_div2_neg: forall x:Z, Zlt_bool (x/2) 0 = Zlt_bool x 0. Proof. intro x. case_lt (x/2) 0; case_lt x 0; intros; try auto. (** x>=0 *) + assert (x/2 >= 0) by (apply Z_div_ge0 ; omega). omegaContradiction. (** x<0 *) + apply False_ind. assert (x/2 < 0) by (apply Zdiv_lt_upper_bound; omega). omegaContradiction. Qed. (** Some useful properties *) Remark upper_positive_mult_positive: forall p x: Z, 0 <= x -> 0 < p -> x <= x * p. Proof. intros. rewrite <- Zmult_1_r at 1. apply Zmult_le_compat_l; omega. Qed. Remark lower_negative_mult_positive: forall p x: Z, x <= 0 -> 0 < p -> x * p <= x. Proof. intros. cut (-x <= -(x * p)). omega. rewrite Zopp_mult_distr_l. apply upper_positive_mult_positive; omega. Qed. Theorem Z2_induction(P: Z -> Prop) : P 0 -> (forall (c:bool) (z:Z), 0 <= z -> P z -> P (2*z + if c then 1 else 0))-> (forall z:Z, 0 <= z -> P z). Proof. intros. induction z. + auto. + induction p. * assert ((Z.pos p~1) =(2*Z.pos p + 1)) by (auto with zarith). rewrite H2 in *. apply (H0 true ((Z.pos p))); auto with zarith. * assert ((Z.pos p~0) =(2*Z.pos p)) by (auto with zarith). rewrite H2 in *. apply (H0 false ((Z.pos p))); auto with zarith. * apply (H0 true 0); auto with zarith. + generalize (Pos2Z.neg_is_neg p); intro; omegaContradiction. Qed. (** Some useful properties about modulus *) Remark mod2_case : forall z:Z, z mod 2 = 0 \/ z mod 2 = 1. Proof. intros. rewrite Zmod_odd. case (Z.odd z); intuition. Qed. Ltac case_mod2 z := induction (mod2_case z) as [EVEN|ODD]. Remark mod2_lt: forall z:Z, 0 <= z mod 2 < 2. Proof. intro; apply Z_mod_lt; auto with zarith. Qed. Remark div2_mod2_eq: forall z:Z, z = 2*(z/2) + z mod 2. Proof. intro; apply Z_div_mod_eq; auto with zarith. Qed. Remark div2_odd_eq: forall z:Z, z = 2*(z/2) + (if (Z.odd z) then 1 else 0). Proof. intro. rewrite <- Zmod_odd. apply div2_mod2_eq. Qed. Remark odd_mod2: forall (x:Z), Z.odd (x mod 2) = Z.odd x. Proof. destruct x. (** 0 *) + compute; auto. (** positive *) + destruct p. (** 2p+1 *) * rewrite <- (Z.mod_unique (Z.pos p~1) 2 (Z.pos p) 1) ; [ | omega | (auto with zarith)]. (replace (Z.pos p~1) with ( 1 + 2*Z.pos p) by forward). rewrite Z.odd_add_mul_2; auto. (** 2p+0 *) * rewrite <- (Z.mod_unique (Z.pos p~0) 2 (Z.pos p) 0); [ | omega | (auto with zarith)]. (replace (Z.pos p~0) with ( 0 + 2*Z.pos p) by forward). rewrite Z.odd_add_mul_2; auto. (** 1 *) * compute; auto. (** negative *) + destruct p. (** 2p+1 *) * rewrite <- (Z.mod_unique (Z.neg p~1) 2 ((Z.neg p)-1) 1); [ | omega | rewrite Zmult_minus_distr_l; rewrite Pos2Z.neg_xI; ring]. (replace (Z.neg p~1) with ( (-1) + 2*(Z.neg p)) by (simpl; auto)). rewrite Z.odd_add_mul_2; auto. (** 2p+0 *) * rewrite <- (Z.mod_unique (Z.neg p~0) 2 (Z.neg p) 0); [ | omega | simpl; auto]. (replace (Z.neg p~0) with ( 0 + 2*Z.neg p) by (simpl; auto)). rewrite Z.odd_add_mul_2; simpl; auto. (** 1 *) * compute; auto. Qed. Remark uint_div2_mod_two_power_nat: forall (m:nat) (x:Z), (x mod two_power_nat (S m)) / 2 = (x/2) mod two_power_nat m. Proof. intros. rewrite two_power_nat_S. rewrite Z.rem_mul_r ; [ | discriminate | apply two_power_nat_is_positive]. pose (z:=((x/2) mod two_power_nat m)); fold z. rewrite <- (Zdiv_unique (x mod 2 + 2*z) 2 z (x mod 2)); [auto | apply mod2_lt | auto with zarith]. Qed. Remark sint_div2_mod_two_power_nat_pos: forall (m:nat) (x:Z), ((x + two_power_nat (S m)) mod (2*two_power_nat (S m))) / 2 = ((x/2) + two_power_nat m) mod two_power_nat (S m). Proof. intros. rewrite <- two_power_nat_S. rewrite (uint_div2_mod_two_power_nat (S m) (x + two_power_nat (S m))). rewrite two_power_nat_S. (replace (2*two_power_nat m) with ((two_power_nat m) *2) by ring). rewrite Z_div_plus. auto. compute; auto. Qed. Remark sint_div2_mod_two_power_nat: forall (m:nat) (x:Z), (((x + two_power_nat (S m)) mod (2*two_power_nat (S m))) - two_power_nat (S m)) / 2 = (((x/2) + two_power_nat m) mod two_power_nat (S m)) - two_power_nat m. Proof. intros. rewrite <- two_power_nat_S. rewrite <- sint_div2_mod_two_power_nat_pos. rewrite two_power_nat_S. rewrite two_power_nat_S. rewrite two_power_nat_S. pose (z:= (two_power_nat m)); fold z. pose (a:= ((x + 2*z) mod (2*(2*z)))); fold a. (replace (a - 2*z) with (a + ((- z) * 2)) by ring). rewrite Z.div_add. ring. discriminate. Qed. (* -------------------------------------------------------------------------- *) (** {@arith:} *) (** * Arithmetic Properties of the Characteristic Function of integers *) (* -------------------------------------------------------------------------- *) Remark Zbit_2x_0: forall x: Z, Zbit (2*x) O = false. Proof. unfold Zbit. unfold bits_of_Z. intro. case_leq 0 (2*x); intro; unfold btest. (** case 0 <= 2*x *) + unfold Nabs. unfold N_decomp. unfold P_decomp. destruct x; auto. (** case 0 > 2*x *) + unfold zlnot. destruct x; auto. destruct p; simpl; auto. Qed. Remark Zbit_2x_p: forall (n:nat) (x:Z), Zbit (2*x) (S n) = Zbit x n. Proof. intros. unfold Zbit; unfold bits_of_Z; rewrite Zle_2x. case_leq 0 x; intro; unfold btest. (** case 0<=x *) + unfold Nabs; unfold N_decomp; unfold P_decomp; destruct x; auto. (** case 0>x *) + unfold zlnot; destruct x; [ compute in H; discriminate H | discriminate H | destruct p; simpl; auto]. Qed. Remark Zbit_s2x_0: forall x: Z, Zbit ((2*x) + 1) O = true. Proof. unfold Zbit. unfold bits_of_Z. intro. case_leq 0 (2*x); intro; unfold btest. (** case 0 <= 2*x *) + unfold Nabs. unfold N_decomp. unfold P_decomp. destruct x; auto. (** case 0 > 2*x *) + unfold zlnot. destruct x; auto. destruct p; simpl; auto. Qed. Remark Zbit_s2x_p: forall (n:nat) (x:Z), Zbit ((2*x) + 1) (S n) = Zbit x n. Proof. intros. unfold Zbit; unfold bits_of_Z. case_leq 0 x; intro; unfold btest. (** case 0<=x *) + case_leq 0 (2*x + 1) ; intro. unfold Nabs. unfold N_decomp. unfold P_decomp. destruct x; auto. assert (Z.neg p < 0) by apply (Zlt_neg_0 p); omegaContradiction. (** case 0<=x *) + case_leq 0 (2*x + 1) ; intro. unfold zlnot; destruct x; [ discriminate H | assert (Z.pos p > 0) by apply (Zgt_pos_0 p); omegaContradiction |]. destruct p; simpl; auto. Qed. Lemma Zbit_succ: forall (c:bool) (n:nat) (x:Z), Zbit ((2*x) + if c then 1 else 0) (S n) = Zbit x n. Proof. intros. destruct c. + rewrite Zbit_s2x_p; auto. + replace (2*x + 0) with (2*x) by (auto with zarith). rewrite Zbit_2x_p; auto. Qed. Remark Zbit_pos0: forall x: Z, 0 <= x -> Zbit x O = Z.odd x. Proof. intros x POS. destruct x. (** 0 *) + compute; auto. (** Positive *) + unfold Zbit; unfold bits_of_Z. rewrite Zodd_mod. destruct p; unfold P_decomp; simpl. (** 2p+1 *) * rewrite <- (Z.mod_unique (Z.pos p~1) 2 (Z.pos p) 1); [ auto | | auto]. clear POS ; omega. (** 2p *) * rewrite <- (Z.mod_unique (Z.pos p~0) 2 (Z.pos p) 0); [ auto | | auto]. clear POS ; omega. (** 1 *) * compute ; auto. (** Negative *) + assert ( Z.neg p < 0) by apply Zlt_neg_0. omegaContradiction. Qed. Lemma Zbit_0: forall x: Z, Zbit x O = Z.odd x. Proof. intro. destruct x. (** 0 *) + compute; auto. (** Positive *) + apply Zbit_pos0. apply Zle_0_pos. (** Negative *) + destruct p. (** 2p+1 *) * unfold Zbit; unfold bits_of_Z. simpl. unfold fnot. compute; auto. (** 2p *) * (replace (Z.neg p~0) with (2*Z.neg p) by (auto with zarith)). rewrite Zbit_2x_0. simpl; auto. (** 1 *) * compute; auto. Qed. Remark Zbit_div2: forall (n:nat) (x:Z), Zbit (x/2) n = Zbit x (S n). Proof. intros. unfold Zbit; unfold bits_of_Z; rewrite Zle_div2. case_leq 0 x; intro; unfold btest; unfold Nabs; unfold N_decomp; unfold P_decomp. (** case 0<=x *) + destruct x; [by compute | | (apply False_ind; compute in H; auto) ]. destruct p. (** 2p+1 *) * rewrite <- (Zdiv_unique (Zpos (xI (p)) ) 2 (Zpos p) 1); by compute. (** 2p *) * rewrite <- (Zdiv_unique (Zpos (xO (p)) ) 2 (Zpos p) 0); by compute. (** one *) * by compute. (** case 0>x *) + unfold zlnot. destruct x; [ by compute | (compute in H; discriminate H) | ]. destruct p. (** -(2p+1) *) * rewrite <- (Zdiv_unique (Zneg (xI (p)) ) 2 (Zneg p - 1) 1); [ (replace (Zneg p - 1 + 1) with (Zneg p) by omega); (replace (-Zneg p) with (Zpos p) by (compute;forward)); (replace (-(Zneg (xI (p)) + 1)) with (Zpos (xO(p))) by (compute;forward)) | | (replace (2*(Zneg p - 1) + 1) with (2*Zneg p - 1) by omega) ]; by compute. (** -2p *) * rewrite <- (Zdiv_unique (Zneg (xO (p)) ) 2 (Zneg p) 0); [ | by compute | by compute]. (repeat (rewrite Z.opp_add_distr)). (repeat (rewrite Z.add_opp_r)). (repeat (rewrite Pos2Z.opp_neg)). destruct p; [ (** -2(2p+1) *) (replace (Zpos (xI(p)) -1) with (Zpos (xO(p))) by (compute;forward)); (replace (Zpos (xO(xI(p))) -1) with (Zpos (xI(xO(p)))) by (compute;forward)) | (** -2(2p) *) | (** -2 *) ]; by compute. (** minus one *) * by compute. Qed. Theorem Zbit_le : forall x y: Z, 0 <= y -> (forall k: nat, Zbit x k = true -> Zbit y k = true) -> x <= y. Proof. intros x y POS. revert x. apply Z2_induction with (z:=y); auto; intros. + replace x with 0. * auto with zarith. * apply Zbit_ext. extensionality k. generalize (H k); clear H. destruct (Zbit x k); intuition. + generalize (div2_mod2_eq x); intro Euc. rewrite Euc. case_mod2 x; destruct c as [] eqn:Carry. * rewrite EVEN in *. cut ((x/2)<=z). { intro; omega. } generalize (H0 (x/2)); clear H0; intro h0. apply h0; clear h0; intro. generalize (H1 (S k)); clear H1; intro h1. rewrite Zbit_s2x_p in h1. intro. apply h1. rewrite <- Zbit_div2; auto. * rewrite EVEN in *. cut ((x/2)<=z). { intro; omega. } generalize (H0 (x/2)); clear H0; intro h0. apply h0; clear h0; intro. generalize (H1 (S k)); clear H1; intro h1. replace (2*z + 0) with (2*z) in h1 by (auto with zarith). rewrite Zbit_2x_p in h1. intro. apply h1. rewrite <- Zbit_div2; auto. * rewrite ODD. cut ((x/2)<=z). { intro; omega. } generalize (H0 (x/2)); clear H0; intro h0. apply h0; clear h0; intro. generalize (H1 (S k)); clear H1; intro h1. rewrite Zbit_s2x_p in h1. intro. apply h1. rewrite <- Zbit_div2; auto. * rewrite ODD. replace (2*z + 0) with (2*z) in * by (auto with zarith). assert ((Zbit x O) = true). { rewrite Zbit_0. rewrite Zmod_odd in ODD. destruct (Z.odd x); intuition. } assert (Zbit (2*z) O=true). { apply (H1 O); auto. } rewrite (Zbit_2x_0) in H3. discriminate H3. Qed. (** Recursive definition of Zbit *) Theorem Zbit_rec: forall (x:Z) (n:nat), Zbit x n = if leb n 0 %nat then Z.odd x else Zbit (x/2) (pred n). Proof. intro x. destruct n. (** Base *) + simpl. apply Zbit_0. (** Ind. *) + simpl. rewrite Zbit_div2. auto. Qed. Lemma Zbit_shift_l: forall (n m:nat) (x:Z), Zbit (x * (two_power_nat n)) m = if leb n m then Zbit x (m - n)%nat else false. Proof. induction n; intros. (** base *) + rewrite (leb_correct O m) by omega. unfold two_power_nat. unfold shift_nat. rewrite <- (minus_n_O m). f_equal. simpl. omega. (** ind. *) + rewrite two_power_nat_S. (replace (x * (2*two_power_nat n)) with ((2*x) * two_power_nat n) by ring). rewrite (IHn m (2*x)). nat_compare Inf EQ Sup n m. (** n<m *) * rewrite (leb_correct n m) by omega. rewrite (leb_correct (S n) m) by omega. rewrite <-(Zbit_2x_p (m - S n) x). f_equal. rewrite (minus_Sn_m) by omega. by simpl. (** n=m *) * rewrite (leb_correct n n) by omega. rewrite (leb_correct_conv n (S n)) by omega. rewrite <- minus_n_n. apply Zbit_2x_0. (** n>m *) * rewrite (leb_correct_conv m n) by omega. rewrite (leb_correct_conv m (S n)) by omega. auto. Qed. Lemma Znat_ind: forall (P: Z -> Prop), P 0 -> (forall (x:Z), 0 <= x -> P x -> P (2*x)) -> (forall (x:Z), 0 <= x -> P x -> P (2*x+1)) -> (forall (x:Z), 0 <= x -> P x). Proof. intros. destruct x. (* 0 *) auto. (* Pos *) induction p. (* 2p+1 *) (replace (Z.pos p~1) with (2 * Z.pos p + 1) by (auto with zarith)); auto. (* 2p *) (replace (Z.pos p~0) with (2 * Z.pos p) by (auto with zarith)); auto. (* 1 *) (replace (1) with (2 * 0 + 1) by (auto with zarith)). apply H1. omega. auto. (* Neg *) compute in H2. intuition congruence. Qed. Lemma Zbit_shift_r: forall (n m:nat) (x:Z), Zbit (x / (two_power_nat n)) m = Zbit x (n + m)%nat. Proof. induction n; intros. (** base *) + unfold two_power_nat. unfold shift_nat. f_equal. simpl. apply Zdiv_1_r. (** ind. *) + rewrite two_power_nat_S. (replace (2*two_power_nat n) with ((two_power_nat n)*2) by ring). rewrite <- Zdiv_Zdiv; [ | generalize (two_power_nat_is_positive n); omega | omega]. rewrite (plus_Snm_nSm n m). rewrite <- (IHn (S m) x). apply Zbit_div2. Qed. Theorem Zbit_uint_mod_two_power_nat: forall (n m:nat) (x:Z), Zbit (x mod (two_power_nat n)) m = if leb n m then false else Zbit x m. Proof. induction n. (** base *) simpl. + intros. (replace (two_power_nat 0) with 1 by forward). rewrite Z.mod_1_r. auto_bits. + induction m. (** base *) * intros. (replace (n + 0)%nat with n by (simpl; auto)). rewrite two_power_nat_S. rewrite Zbit_0; rewrite Zbit_0. rewrite Z.rem_mul_r; [ | discriminate | apply two_power_nat_is_positive]. rewrite Z.odd_add_mul_2. rewrite odd_mod2; auto. (** ind. *) * intros. rewrite <- Zbit_div2; rewrite <- Zbit_div2. rewrite uint_div2_mod_two_power_nat. rewrite (IHn m (x/2)). nat_compare Inf EQ Sup n m. Qed. Theorem Zbit_sint_mod_two_power_nat: forall (n m:nat) (x:Z), Zbit (((x + two_power_nat (n+m)) mod (2*two_power_nat (n+m))) - two_power_nat (n+m)) m = Zbit x m. Proof. induction n. (** base *) + induction m; intros. (** base *) * rewrite plus_O_n. (replace (two_power_nat O) with 1 by forward). (replace (2*1) with 2 by forward). rewrite Zbit_0; rewrite Zbit_0. rewrite Z.odd_sub. rewrite odd_mod2. rewrite Z.odd_add. (replace (Z.odd 1) with true by forward). rewrite Bool.xorb_true_r; rewrite Bool.xorb_true_r. rewrite (Bool.negb_involutive). auto. (** ind. *) * rewrite plus_O_n. rewrite <- Zbit_div2; rewrite <- Zbit_div2. rewrite <- (IHm (x/2)). rewrite sint_div2_mod_two_power_nat. rewrite plus_O_n. rewrite <- two_power_nat_S. auto. (** ind. *) + induction m. (** base *) * intros. (replace (S n + 0)%nat with (S n) by (simpl; auto)). rewrite two_power_nat_S. rewrite Zbit_0; rewrite Zbit_0. rewrite Z.rem_mul_r; [ | discriminate | (rewrite <- two_power_nat_S ; apply two_power_nat_is_positive)]. rewrite <- Z.add_sub_assoc. rewrite <- Zmult_minus_distr_l. rewrite Z.odd_add_mul_2. rewrite odd_mod2. rewrite Z.odd_add_mul_2. auto. (** ind. *) * intros. (replace (S n + S m)%nat with (S ((S n) + m))%nat by (simpl; auto)). rewrite <- Zbit_div2; rewrite <- Zbit_div2. rewrite <- (IHm (x/2)). rewrite sint_div2_mod_two_power_nat. rewrite <- two_power_nat_S. auto. Qed. Lemma Zbit_sign: forall (n: nat) (z: Z), let b := two_power_nat n in -b <= z < b -> (Zbit z n = Zlt_bool z 0). Proof. intro n. induction n; intro z; intro b; unfold b. (** base *) + (replace (two_power_nat 0) with 1 by forward). case_lt z 0; intros. (** z<0 *) (replace z with (-1) by (omega);forward). (** z>=0*) (replace z with 0 by omega); by forward. (** ind. *) + rewrite two_power_nat_S; intro. rewrite <-Zbit_div2. assert ((- two_power_nat n) <= z/2 < two_power_nat n) by (split ; [apply Zdiv_le_lower_bound | apply Zdiv_lt_upper_bound] ; omega). assert (Zbit (z/2) n = ((z/2) <? 0)) by (by apply (IHn (z/2))). rewrite H1; apply Zlt_div2_neg. Qed. Lemma Zbit_trail_plus: forall (n i: nat) (z: Z), let b := two_power_nat n in -b <= z < b -> (Zbit z (n+i)%nat = Zlt_bool z 0). Proof. intro n. induction i; intros z b; unfold b. (** base *) + rewrite plus_0_r. apply Zbit_sign. (** ind. *) + intro. rewrite <- plus_n_Sm. rewrite <-Zbit_div2. assert ((- two_power_nat n) <= z/2 < two_power_nat n) by (split ; [apply Zdiv_le_lower_bound | apply Zdiv_lt_upper_bound] ; omega). assert (Zbit (z/2) (n + i)%nat = (z/2 <? 0)) by (by apply (IHi (z/2))). rewrite H1; apply Zlt_div2_neg. Qed. Lemma Zbit_trail: forall (n i: nat) (z: Z), let b := two_power_nat n in (n <= i)%nat -> -b <= z < b -> (Zbit z i = Zlt_bool z 0). Proof. intros. generalize (Zbit_trail_plus n (i - n)%nat z). rewrite <- le_plus_minus by auto. auto. Qed. Lemma Zbit_unsigned_trail: forall (n i: nat) (z: Z), (n <= i)%nat -> 0 <= z < two_power_nat n -> (Zbit z i = false). Proof. intros n i z h1. (* work around a problem with "try omega" inside case_lt *) pose (b:=two_power_nat n); fold b. intro h2. (replace false with (Zlt_bool z 0) by (case_lt z 0; auto)). apply (Zbit_trail n); auto. fold b. omega. Qed. Lemma Zbit_trail_plus_inv: forall (n: nat) (z: Z), let b := two_power_nat n in (forall (i: nat), (Zbit z (n+i)%nat = Zlt_bool z 0)) -> -b <= z < b. Proof. intro n. induction n; intro z; intro b; unfold b. (** base *) + (replace (two_power_nat 0) with 1 by (auto with zarith)). case_lt z 0; intros h h0. (** z<0 *) * replace z with (-1); [| symmetry; apply Zbit_ext; extensionality k; unfold TRUE; apply h0]. omega. (** z>=0*) * replace z with 0; [| symmetry; apply Zbit_ext; extensionality k; unfold FALSE; apply h0]. omega. (** ind. *) + intro. generalize (div2_mod2_eq z); intro Euc. generalize (mod2_lt z); intro Mod. pose (x := z / 2); fold x in Euc. pose (r := z mod 2); fold r in Euc,Mod. assert (Ind: -(two_power_nat n) <= x < (two_power_nat n)). { apply IHn; intro; unfold x; rewrite Zlt_div2_neg. case_mod2 z. + fold r in EVEN. rewrite <-Zbit_2x_p. replace (S (n+i)) with (S n + i)%nat ; [ | auto with arith ]. replace (2*(z/2)) with z. * apply H. * fold x; auto with zarith. + fold r in ODD. rewrite <-Zbit_s2x_p. replace (S (n+i)) with (S n + i)%nat ; [ | auto with arith ]. replace (2*(z/2) + 1) with z. * apply H. * fold x; auto with zarith. } rewrite two_power_nat_S. auto with zarith. Qed. Lemma Zbit_unsigned_trail_plus_inv: forall (n: nat) (z: Z), let b := two_power_nat n in (forall (i: nat), (Zbit z (n+i)%nat = false)) -> 0 <= z < b. Proof. intro n. induction n; intro z; intro b; unfold b. (** base *) + (replace (two_power_nat 0) with 1 by (auto with zarith)). intro h0. replace z with 0; [| symmetry; apply Zbit_ext; extensionality k; unfold FALSE; apply h0]. omega. (** ind. *) + intro. generalize (div2_mod2_eq z); intro Euc. generalize (mod2_lt z); intro Mod. pose (x := z / 2); fold x in Euc. pose (r := z mod 2); fold r in Euc,Mod. assert (Ind: 0 <= x < (two_power_nat n)). { apply IHn; intro; unfold x. case_mod2 z. + fold r in EVEN. rewrite <-Zbit_2x_p. replace (S (n+i)) with (S n + i)%nat ; [ | auto with arith ]. replace (2*(z/2)) with z. * apply H. * fold x; auto with zarith. + fold r in ODD. rewrite <-Zbit_s2x_p. replace (S (n+i)) with (S n + i)%nat ; [ | auto with arith ]. replace (2*(z/2) + 1) with z. * apply H. * fold x; auto with zarith. } rewrite two_power_nat_S. auto with zarith. Qed. Lemma Zbit_trail_inv: forall (n: nat) (z: Z), let b := two_power_nat n in (forall (i: nat), (n <= i)%nat -> (Zbit z i = Zlt_bool z 0)) -> -b <= z < b. Proof. intros n z b h1. generalize (Zbit_trail_plus_inv n z); intro h2. apply h2; intro. generalize (h1 (n + i)%nat); intro h3. apply h3. auto with zarith. Qed. Lemma Zbit_unsigned_trail_inv: forall (n: nat) (z: Z), (forall (i: nat), (n <= i)%nat -> (Zbit z i = false)) -> 0 <= z < (two_power_nat n). Proof. intros n z h1. generalize (Zbit_unsigned_trail_plus_inv n z); intro h2. apply h2; intro. generalize (h1 (n + i)%nat); intro h3. apply h3. auto with zarith. Qed. (** {@bitwise:} *) (** * Bitwise Shifting Operators *) Program Definition bitwise_lsl (x: bits) (n:nat): bits := let sign := (bsign x) in let btest := (fun i: nat => if leb n i %nat then btest x (i - n)%nat else false) in let last := last btest ((bsize x) + n) sign in mkbits last sign btest _ . Next Obligation. apply trailing_last. generalize (btrail x). unfold trailing. intro Tx. intro k. nat_compare Inf EQ Sup n k. (** n < k *) + rewrite (leb_correct n k) by omega. intros. rewrite (Tx (k - n)%nat) by omega. auto. (** n = k *) + rewrite (leb_correct n n) by omega. intros. rewrite (Tx (n - n)%nat) by omega. auto. (** n > k *) + intro. omegaContradiction. Qed. Program Definition bitwise_lsr (x: bits) (n:nat): bits := let sign := (bsign x) in let btest := (fun i: nat => btest x (i + n)%nat) in let last := last btest (bsize x) sign in mkbits last sign btest _ . Next Obligation. apply trailing_last. generalize (btrail x). unfold trailing. intro Tx. intros. rewrite (Tx (k + n)%nat); auto with arith. Qed. Definition lsl_shift_def (x:Z) (n:nat): Z := Z_of_bits (bitwise_lsl (bits_of_Z x) n). Definition lsr_shift_def (x:Z) (n:nat): Z := Z_of_bits (bitwise_lsr (bits_of_Z x) n). (** ** Link between bitwise shifting operators and arithmetics *) Definition lsl_arithmetic_def (x:Z) (n:nat): Z := x * (two_power_nat n). Lemma lsl_arithmetic_shift: lsl_shift_def = lsl_arithmetic_def. Proof. extensionality x; extensionality n; Zbit_ext k. (** right term *) unfold lsl_arithmetic_def; rewrite (Zbit_shift_l n k x). (** left term *) unfold lsl_shift_def; unfold Zbit; rewrite Z_decomp_recomp; unfold bitwise_lsl; unfold btest. auto. Qed. Definition lsr_arithmetic_def (x:Z) (n:nat): Z := x / (two_power_nat n). (** Note: [lsr_arithmetic_def x n] and [Cdiv x (two_power_nat n)] differs for negative [x]. *) Remark lsr_differs_to_Cdiv: lsr_arithmetic_def (-1) 1%nat <> Cdiv (-1) (two_power_nat 1). Proof. by compute. Qed. Lemma lsr_arithmetic_shift: lsr_shift_def = lsr_arithmetic_def. Proof. extensionality x; extensionality n; Zbit_ext k. (** right term *) unfold lsr_arithmetic_def; rewrite (Zbit_shift_r n k x); (replace (n+k)%nat with (k+n)%nat by omega). (** left term *) unfold lsr_shift_def; unfold Zbit; rewrite Z_decomp_recomp; unfold bitwise_lsr; unfold btest. auto. Qed. (** * Bitwise Logical Operators *) Program Definition bitwise (f: bool -> bool -> bool) (x y: bits): bits := let sign := f (bsign x) (bsign y) in let btest := (fun i: nat => f (btest x i) (btest y i)) in let last := last btest (max (bsize x) (bsize y)) sign in mkbits last sign btest _ . Next Obligation. apply trailing_last. generalize (btrail x). generalize (btrail y). unfold trailing. intros Ty Tx k Max. rewrite Tx. rewrite Ty. trivial. generalize (Max.max_lub_r (bsize x) (bsize y) k). omega. generalize (Max.max_lub_l (bsize x) (bsize y) k). omega. Qed. Definition Z_bitwise (f: bool -> bool -> bool) (x y: Z): Z := Z_of_bits (bitwise f (bits_of_Z x) (bits_of_Z y)). (** ** Properties of Bitwise Logical Operators *) Lemma Zbit_bitwise: forall (f: bool -> bool -> bool) (x y: Z) (k: nat), Zbit (Z_bitwise f x y) k = f (Zbit x k) (Zbit y k). Proof. intros. unfold Zbit. unfold Z_bitwise. rewrite Z_decomp_recomp. auto. Qed. (** Tactical. *) Ltac Zbit_bitwise k := Zbit_ext k; repeat rewrite Zbit_bitwise. (** Range of bitwise operators *) Lemma Z_bitwise_ZxHpos: forall (f: bool -> bool -> bool) (x y: Z), (ZxHpos (Z_bitwise f x y) <= max (ZxHpos x) (ZxHpos y))%nat. Proof. intros f x y. unfold Z_bitwise. rewrite (bsize_over_approx). unfold bitwise. unfold btest at 1; unfold bsize at 1; unfold bsign at 3; apply Max.max_case_strong; rewrite <- (bsize_exact x); rewrite <- (bsize_exact y); intro CASE. (** (ZxHpos y <= ZxHpos x) *) + rewrite Max.max_l by auto. generalize (last_leq (fun i: nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i)) (ZxHpos x) (f (bsign (bits_of_Z x)) (bsign (bits_of_Z y)))); intro. generalize (last_leq (fun i : nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i)) (last (fun i : nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i)) (ZxHpos x) (f (bsign (bits_of_Z x)) (bsign (bits_of_Z y)))) (f (bsign (bits_of_Z x)) (bsign (bits_of_Z y)))); intro. omega. (** cont. (ZxHpos x <= ZxHpos y) *) + rewrite Max.max_r by auto. generalize (last_leq (fun i: nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i)) (ZxHpos y) (f (bsign (bits_of_Z x)) (bsign (bits_of_Z y)))); intro. generalize (last_leq (fun i: nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i)) (last (fun i: nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i)) (ZxHpos y) (f (bsign (bits_of_Z x)) (bsign (bits_of_Z y)))) (f (bsign (bits_of_Z x)) (bsign (bits_of_Z y)))); intro. omega. Qed. Lemma Z_bitwise_ZxHbound: forall (f: bool -> bool -> bool) (x y: Z), ZxHbound (Z_bitwise f x y) <= Z.max (ZxHbound x) (ZxHbound y). Proof. intros f x y. generalize (Z_bitwise_ZxHpos f x y). apply Z.max_case_strong; intro. (** ZxHbound y <= ZxHbound x *) + assert (ZxHpos y <= ZxHpos x)%nat by by (apply ZxHpos_le). rewrite max_l; by try (intro; apply ZxHbound_le). (** ZxHbound x <= ZxHbound y *) + assert (ZxHpos x <= ZxHpos y)%nat by by (apply ZxHpos_le). rewrite max_r; by try (intro; apply ZxHbound_le). Qed. Theorem Z_bitwise_in_sint_range: forall (f: bool -> bool -> bool) (n: nat) (x y: Z), let b := two_power_nat n in -b <= x < b -> -b <= y < b -> -b <= (Z_bitwise f x y) < b. Proof. intros f n x y b Rx Ry. assert (ZxHbound x <= b) as Bx. { unfold b. unfold b in Rx. apply (ZxHpower n x). omega. } assert (ZxHbound y <= b) as By. { unfold b. unfold b in Ry. apply (ZxHpower n y). omega. } generalize (Z_bitwise_ZxHbound f x y). pose (zxy := Z_bitwise f x y); fold zxy. generalize (ZxHrange zxy). apply Z.max_case_strong. (** ZxHbound y <= ZxHbound x *) + intros Ryx Rzxy. destruct Rzxy as [ bound_neg bound_pos ]. lia. (** ZxHbound x <= ZxHbound y *) + intros Ryx Rzxy. destruct Rzxy as [ bound_neg bound_pos ]. lia. Qed. Theorem Z_bitwise_sign: forall (f: bool -> bool -> bool) (x y: Z), Zle_bool 0 (Z_bitwise f x y) = negb (f (negb (Zle_bool 0 x)) (negb (Zle_bool 0 y))). Proof. intros f x y. case_leq 0 (Z_bitwise f x y); unfold Z_bitwise; unfold Z_of_bits; unfold bitwise; simpl; repeat (rewrite Zsign_encoding); destruct (f (negb (Zle_bool 0 x)) (negb (Zle_bool 0 y))); intuition. + unfold zlnot in H; generalize (N_recomp_pos (last (fun i : nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i)) (max (bsize (bits_of_Z x)) (bsize (bits_of_Z y))) true) (fnot (fun i : nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i)))); intro; omegaContradiction. + generalize (N_recomp_pos (last (fun i : nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i)) (max (bsize (bits_of_Z x)) (bsize (bits_of_Z y))) false) (fun i : nat => f (btest (bits_of_Z x) i) (btest (bits_of_Z y) i))); intro; omegaContradiction. Qed. Theorem Z_bitwise_is_uint: forall (f: bool -> bool -> bool) (x y: Z), 0 <= x -> 0 <= y -> (f false false = false) -> 0 <= (Z_bitwise f x y). Proof. intros f x y Rx Ry Fsign. generalize (Z_bitwise_sign f x y). case_leq 0 x; case_leq 0 y; replace (negb true) with false by intuition; intros. rewrite Fsign in H1. replace (negb false) with true in H1 by intuition. case_leq 0 (Z_bitwise f x y). discriminate H1. Qed. Theorem Z_bitwise_is_uint1: forall (f: bool -> bool -> bool) (x y: Z), 0 <= x -> (forall b:bool, f false b = false) -> 0 <= (Z_bitwise f x y). Proof. intros f x y Rx Fsign. generalize (Z_bitwise_sign f x y). case_leq 0 x; replace (negb true) with false by intuition; intros. rewrite (Fsign (negb (0 <=? y))) in H0. replace (negb false) with true in H0 by intuition. case_leq 0 (Z_bitwise f x y). discriminate H0. Qed. Theorem Z_bitwise_is_uint2: forall (f: bool -> bool -> bool) (x y: Z), 0 <= y -> (forall b: bool, f b false = false) -> 0 <= (Z_bitwise f x y). Proof. intros f x y Rx Fsign. generalize (Z_bitwise_sign f x y). case_leq 0 y; replace (negb true) with false by intuition; intros. rewrite (Fsign (negb (0 <=? x))) in H0. replace (negb false) with true in H0 by intuition. case_leq 0 (Z_bitwise f x y). discriminate H0. Qed. Theorem Z_bitwise_in_uint_range: forall (f: bool -> bool -> bool) (n: nat) (x y: Z), let b := two_power_nat n in 0 <= x < b -> 0 <= y < b -> f false false = false -> 0 <= (Z_bitwise f x y) < b. Proof. intros f n x y b Rx Ry. assert (ZxHbound x <= b) as Bx. { unfold b. unfold b in Rx. apply (ZxHpower n x). omega. } assert (ZxHbound y <= b) as By. { unfold b. unfold b in Ry. apply (ZxHpower n y). omega. } intro Fsign. assert (0 <= (Z_bitwise f x y)) as Bz. { apply (Z_bitwise_is_uint f x y); auto; omega. } generalize (Z_bitwise_ZxHbound f x y). pose (zxy := Z_bitwise f x y); fold zxy; fold zxy in Bz. generalize (ZxHrange zxy). apply Z.max_case_strong. (** ZxHbound y <= ZxHbound x *) + intros Ryx Rzxy. destruct Rzxy as [ Bneg Bpos ]. lia. (** ZxHbound x <= ZxHbound y *) + intros Ryx Rzxy. destruct Rzxy as [ Bneg Bpos ]. lia. Qed. (** Commutative bitwise operators *) Definition commutative {A B: Type} (f: A -> A -> B) := forall x y: A, f x y = f y x. Lemma Z_bitwise_commut: forall (f: bool -> bool -> bool), commutative f -> commutative (Z_bitwise f). Proof. unfold commutative. intros. apply btest_ext. simpl. extensionality k. apply H. Qed. (** Associative bitwise operators *) Definition associative {A: Type} (f: A -> A -> A) := forall x y z: A, f (f x y) z = f x (f y z). Lemma Z_bitwise_assoc: forall (f: bool -> bool -> bool), associative f -> associative (Z_bitwise f). Proof. unfold associative. intros. apply btest_ext. simpl. extensionality k. unfold Z_bitwise. repeat rewrite Z_decomp_recomp. simpl. apply H. Qed. (** Idempotent bitwise operators *) Definition idempotent {A: Type} (f: A -> A -> A) := forall x: A, f x x = x. Lemma Z_bitwise_idempotent: forall (f: bool -> bool -> bool), idempotent f -> idempotent (Z_bitwise f). Proof. unfold idempotent. intros. Zbit_bitwise k. auto. Qed. (** Distributive bitwise operators *) Definition distributive_l {A: Type} (f : A -> A -> A) (g : A -> A -> A) := forall x y z: A, f x (g y z) = g (f x y) (f x z). Definition distributive_r {A: Type} (f : A -> A -> A) (g : A -> A -> A) := forall x y z: A, f (g x y) z = g (f x z) (f y z). Lemma Z_bitwise_distrib_l: forall (f g: bool -> bool -> bool), distributive_l f g -> distributive_l (Z_bitwise f) (Z_bitwise g) . Proof. unfold distributive_l. intros. Zbit_bitwise k. auto. Qed. Lemma Z_bitwise_distrib_r: forall (f g: bool -> bool -> bool), distributive_r f g -> distributive_r (Z_bitwise f) (Z_bitwise g) . Proof. unfold distributive_r. intros. Zbit_bitwise k. auto. Qed. (** Neutral elements of bitwise operators *) Definition neutral {A: Type} (e: A) (f: A -> A -> A) := forall x: A, f e x = x. Lemma Z_bitwise_neutral (e:bool): forall (f: bool -> bool -> bool), neutral e f -> neutral (if e then (-1) else 0) (Z_bitwise f). Proof. unfold neutral. intros. Zbit_bitwise k. destruct e; simpl; rewrite H; auto. Qed. (** Absorbant element of bitwise operators *) Definition absorbant {A: Type} (a: A) (f: A -> A -> A) := forall x: A, f a x = a. Lemma Z_bitwise_absorbant (a:bool) : forall f, absorbant a f -> absorbant (if a then (-1) else 0) (Z_bitwise f). Proof. unfold absorbant. intros. Zbit_bitwise k. destruct a; simpl; rewrite H; auto. Qed. (** {@ACSL:} *) (** * ACSL shifting operators *) Parameter lsl_undef: Z -> Z -> Z. Definition lsl_def (x:Z) (n:Z): Z := lsl_shift_def x (Z.abs_nat n). Definition lsl (x : Z) (y : Z) : Z := if Zle_bool 0 y then lsl_def x y else lsl_undef x y. Theorem lsl_pos: forall x n: Z, 0<=n -> lsl x n = lsl_def x n. Proof. intros. unfold lsl. case_leq 0 n. Qed. (* Lemma test_compute: lsl 2 1 = 4. *) (* Proof. *) (* compute; reflexivity. *) (* Qed. *) Parameter lsr_undef: Z -> Z -> Z. Definition lsr_def (x:Z) (n:Z): Z := lsr_shift_def x (Z.abs_nat n). Definition lsr (x : Z) (y : Z) : Z := if Zle_bool 0 y then lsr_def x y else lsr_undef x y. Theorem lsr_pos: forall x n: Z, 0<=n -> lsr x n = lsr_def x n. Proof. intros. unfold lsr. case_leq 0 n. Qed. (** ** Properties of shifting operators *) Theorem Zbit_lsl: forall (x n: Z) (k: nat), Zbit (lsl_def x n) k = if (Zle_bool (Z.abs n) (Z_of_nat k)) then Zbit x (Z.abs_nat ((Z_of_nat k) - (Z.abs n))) else false. Proof. intros. unfold lsl_def. rewrite lsl_arithmetic_shift. unfold lsl_arithmetic_def. rewrite Zbit_shift_l. case_leq (Z.abs n) (Z_of_nat k). (** case |n| <= k *) + intro LEQ. cut (leb (Z.abs_nat n) k= true). { intro LEB. rewrite LEB. f_equal. rewrite Zabs_nat_Zminus; try split; try apply Zabs_pos; auto. rewrite Zabs_nat_Z_of_nat. rewrite zabs_nat_zabs; auto. } apply leb_correct. rewrite <- Zabs_nat_Z_of_nat. apply zabs_le. rewrite <- (inj_Zabs_nat (Z_of_nat k)). rewrite Zabs_nat_Z_of_nat. auto. (** case |n| > k *) + intro GT. cut (leb (Z.abs_nat n) k = false). intro GTB. rewrite GTB. auto. apply leb_correct_conv. rewrite <- (Zabs_nat_Z_of_nat k). apply zabs_gt. rewrite <- (inj_Zabs_nat (Z_of_nat k)). rewrite Zabs_nat_Z_of_nat. omega. Qed. Theorem Zbit_lsr: forall (x n: Z) (k: nat), Zbit (lsr_def x n) k = Zbit x (k + (Z.abs_nat n))%nat. Proof. intros. (** left term *) unfold lsr_def. unfold lsr_shift_def. unfold Zbit. rewrite Z_decomp_recomp. unfold bitwise_lsr. unfold btest at 1. auto. Qed. Lemma lsl_of_lsl: forall (n m: Z) (x:Z), lsl_def (lsl_def x n) m = lsl_def x (Z.abs n + Z.abs m). Proof. intros. unfold lsl_def. rewrite <- zabs_plus. rewrite lsl_arithmetic_shift. unfold lsl_arithmetic_def. (replace (x * two_power_nat (Z.abs_nat n) * two_power_nat (Z.abs_nat m)) with (x *(two_power_nat (Z.abs_nat n) * two_power_nat (Z.abs_nat m))) by ring). f_equal. repeat rewrite two_power_nat_correct. rewrite Zpower_nat_is_exp. auto. Qed. Lemma lsr_of_lsr: forall (n m: Z) (x:Z), lsr_def (lsr_def x n) m = lsr_def x (Z.abs n + Z.abs m). Proof. intros. unfold lsr_def. rewrite <- zabs_plus. unfold lsr_shift_def at 3. unfold lsr_shift_def at 1. unfold bitwise_lsr. apply btest_ext. unfold btest at 1. unfold btest at 2. extensionality k. unfold lsr_shift_def. rewrite Z_decomp_recomp. unfold bitwise_lsr. unfold btest at 1. f_equal. omega. Qed. Lemma lsr_of_lsl: forall (n m: Z) (x:Z), Z.abs n <= Z.abs m -> lsr_def (lsl_def x n) m = lsr_def x (Z.abs m - Z.abs n). Proof. intros. unfold lsr_def. rewrite <- zabs_minus by auto. unfold lsr_shift_def. unfold bitwise_lsr. apply btest_ext. unfold btest at 1. unfold btest at 2. extensionality k. unfold lsl_def. unfold lsl_shift_def. rewrite Z_decomp_recomp. unfold bitwise_lsl. unfold btest at 1. rewrite (leb_correct (Z.abs_nat n) (k + Z.abs_nat m)). f_equal. (** arg 1 *) + rewrite (inj_eq_rev (k + Z.abs_nat m - Z.abs_nat n) (k + (Z.abs_nat m - Z.abs_nat n))). auto. rewrite inj_minus1 by (apply zabs_le_plus; omega). repeat rewrite inj_plus. rewrite inj_minus1 at 1 by (apply zabs_le; auto). omega. (** arg 2 *) + apply zabs_le_plus. omega. Qed. (** * ACSL bitwise operators *) Definition limpl (x y: Z): Z := Z_bitwise implb x y. Definition land (x y: Z): Z := Z_bitwise andb x y. Definition lor (x y: Z): Z := Z_bitwise orb x y. Definition lxor (x y: Z): Z := Z_bitwise xorb x y. Definition lnot (x: Z): Z := lxor (-1) x. (** ** Bounds of land and lor terms *) Theorem uint_land_range: forall (x y: Z), 0 <= x -> 0 <= land x y <= x. Proof. intros. split. + apply (Z_bitwise_is_uint1 andb). * auto. * intro. destruct b; intuition. + apply Zbit_le. * auto. * intro. unfold land; rewrite Zbit_bitwise. destruct (Zbit x k); intuition. Qed. Theorem land_sign: forall (x y: Z), (0 <= x \/ 0 <= y) <-> 0 <= land x y. Proof. intros x y. unfold land; unfold Z_bitwise. pose (bz := (bitwise andb (bits_of_Z x) (bits_of_Z y))). fold bz. assert ((0 <= Z_of_bits bz) <-> (bsign bz = false)). { rewrite Bits.bsign_encoding. case_leq 0 (Z_of_bits bz); intros; split; intros; auto. * omegaContradiction. * discriminate H0. } rewrite H. unfold bz. unfold bitwise. simpl. rewrite (bsign_encoding (bits_of_Z x)). rewrite bsign_encoding. rewrite (Z_recomp_decomp x). rewrite Z_recomp_decomp. split; case_leq 0 x; intro; try omegaContradiction; case_leq 0 y; intros; try omegaContradiction; auto. discriminate H2. Qed. Theorem lor_sign: forall (x y: Z), (0 <= x /\ 0 <= y) <-> 0 <= lor x y. Proof. intros x y. unfold lor; unfold Z_bitwise. pose (bz := (bitwise orb (bits_of_Z x) (bits_of_Z y))). fold bz. assert ((0 <= Z_of_bits bz) <-> (bsign bz = false)). { rewrite Bits.bsign_encoding. case_leq 0 (Z_of_bits bz); intros; split; intros; auto. * omegaContradiction. * discriminate H0. } rewrite H. unfold bz. unfold bitwise. simpl. rewrite (bsign_encoding (bits_of_Z x)). rewrite bsign_encoding. rewrite (Z_recomp_decomp x). rewrite Z_recomp_decomp. split; case_leq 0 x; intro; try omegaContradiction; case_leq 0 y; split; intros; try omegaContradiction; discriminate H2. Qed. Theorem uint_lor_inf: forall (x y: Z), 0 <= x -> 0 <= y -> x <= lor x y. Proof. intros. apply Zbit_le. + unfold lor. unfold Z_bitwise. pose (bz := (bitwise orb (bits_of_Z x) (bits_of_Z y))). fold bz. unfold Z_of_bits. destruct (bsign bz) eqn:BSIGN. (** negative sign *) * assert (bsign bz = false) as OPP. unfold bz. unfold bitwise. unfold bsign. unfold bits_of_Z. unfold bsign. case_leq 0 x; intro; try omegaContradiction. case_leq 0 y; intros; try omegaContradiction. auto. rewrite BSIGN in OPP. discriminate. (** positive sign *) * apply (N_recomp_pos). + intro. unfold lor; rewrite Zbit_bitwise. destruct (Zbit x k); intuition. Qed. (** Zbit extraction *) Theorem Zbit_extraction : forall (x:Z) (i:nat), (land x (lsl_shift_def 1 i) = 0 <-> (Zbit x i) = false). Proof. intros. rewrite lsl_arithmetic_shift; unfold lsl_arithmetic_def. replace (1 * two_power_nat i) with (two_power_nat i) by ring. unfold land. split. (** 1st impl *) + intro H. assert (Zbit (Z_bitwise andb x (two_power_nat i)) i = Zbit 0 i). { rewrite H; reflexivity. } rewrite Zbit_bitwise in H0. rewrite Zbit_power in H0. unfold FALSE in H0. rewrite <- beq_nat_refl in H0. rewrite Bool.andb_true_r in H0. assumption. (** 2sd impl *) + intro. Zbit_ext k. rewrite Zbit_bitwise; rewrite Zbit_power. unfold FALSE. (** proof by case *) case (lt_eq_lt_dec i k); intro cas. destruct cas. (** i<k *) * rewrite Bool.andb_false_intro2; auto. apply beq_nat_false_iff; omega. (** k=i *) * rewrite <- e. rewrite Bool.andb_false_intro1; auto. (** k<i *) * rewrite Bool.andb_false_intro2; auto. apply beq_nat_false_iff; omega. Qed. Theorem Zbit_extraction_true : forall (x:Z) (i:nat), (land x (lsl_shift_def 1 i) = (lsl_shift_def 1 i) <-> (Zbit x i) = true). Proof. intros. rewrite lsl_arithmetic_shift; unfold lsl_arithmetic_def. replace (1 * two_power_nat i) with (two_power_nat i) by ring. unfold land. split. (** 1st impl *) + intro H. assert (Zbit (Z_bitwise andb x (two_power_nat i)) i = Zbit (two_power_nat i) i). { rewrite H; reflexivity. } rewrite Zbit_bitwise in H0. rewrite Zbit_power in H0. rewrite <- beq_nat_refl in H0. rewrite Bool.andb_true_r in H0. assumption. (** 2sd impl *) + intro. Zbit_ext k. rewrite Zbit_bitwise; rewrite Zbit_power. (** proof by case *) case (lt_eq_lt_dec i k); intro cas. destruct cas. (** i<k *) * rewrite Bool.andb_false_intro2; auto; [symmetry| ]; apply beq_nat_false_iff; omega. (** k=i *) * rewrite <- e. rewrite H. rewrite Bool.andb_true_l. reflexivity. (** k<i *) * rewrite Bool.andb_false_intro2; auto; [symmetry| ]; apply beq_nat_false_iff; omega. Qed. (** ** Properties of lnot operator *) (** lnot x equals -(x+1) *) Theorem lnot_zlnot_equiv: forall x: Z, lnot x = zlnot x. Proof. intro x. unfold lnot. unfold lxor. Zbit_bitwise k. rewrite Bool.xorb_true_l. (** Now to prove that zlnot negates bits *) unfold Zbit. unfold bits_of_Z. pose (y := zlnot x). fold y. case_leq 0 x; case_leq 0 y; intros Y X; try ( unfold y in Y; unfold zlnot in Y; apply False_ind; omega); simpl. (** Negative *) + unfold y. rewrite zlnot_inv. unfold fnot. trivial. (** Positive *) + unfold fnot. rewrite Bool.negb_involutive. trivial. Qed. (** Tactical *) Local Ltac lnot_with_omega := repeat rewrite lnot_zlnot_equiv; unfold zlnot; omega. Theorem lnot_0: lnot 0 = -1. Proof. auto with arith. Qed. Theorem lnot_1: lnot (-1) = 0. Proof. auto with arith. Qed. (** Involution of the double negation *) Theorem lnot_inv: forall x: Z, lnot (lnot x) = x. Proof. intros x. lnot_with_omega. Qed. Theorem lnot_sym: forall x y: Z, lnot x = y -> lnot y = x. Proof. intros x y. lnot_with_omega. Qed. Theorem lnot_inj: forall x y: Z, lnot x = lnot y -> y = x. Proof. intros x y. lnot_with_omega. Qed. (** ** Associative and commutative bitwise operators *) (** land is AC *) Theorem land_assoc: associative land. Proof. apply (Z_bitwise_assoc andb). unfold associative. intros. symmetry. apply Bool.andb_assoc. Qed. Theorem land_commut: commutative land. Proof. apply (Z_bitwise_commut andb Bool.andb_comm). Qed. (** lor is AC *) Theorem lor_assoc: associative lor. Proof. apply (Z_bitwise_assoc orb). unfold associative. intros. symmetry. apply Bool.orb_assoc. Qed. Theorem lor_commut: commutative lor. Proof. apply (Z_bitwise_commut orb Bool.orb_comm). Qed. (** lxor is AC *) Theorem lxor_assoc: associative lxor. Proof. apply (Z_bitwise_assoc xorb Bool.xorb_assoc). Qed. Theorem lxor_commut: commutative lxor. Proof. apply (Z_bitwise_commut xorb Bool.xorb_comm). Qed. (** ** Idempotent bitwise operators *) (** land is idempotent *) Theorem land_idemp: idempotent land. Proof. apply (Z_bitwise_idempotent andb). unfold idempotent. intro. destruct x; auto. Qed. (** lor is idempotent *) Theorem lor_idemp: idempotent lor. Proof. apply (Z_bitwise_idempotent orb). unfold idempotent. intro. destruct x; auto. Qed. (** ** Neutral elements of bitwise operators *) (** Zero is the neutral element of lor *) Theorem lor_0: neutral 0 lor. Proof. apply (Z_bitwise_neutral false orb). unfold neutral. auto. Qed. (** Zero is the neutral element of lxor *) Theorem lxor_0: neutral 0 lxor. Proof. apply (Z_bitwise_neutral false xorb). unfold neutral. apply Bool.orb_false_r. Qed. (** Minus one is the neutral element of land *) Theorem land_1: neutral (-1) land. Proof. apply (Z_bitwise_neutral true andb). unfold neutral. auto. Qed. (** ** Absorbant elements of bitwise operators *) (** Zero is the absorbant element of land *) Theorem land_0: absorbant 0 land. Proof. apply (Z_bitwise_absorbant false andb). unfold absorbant. auto. Qed. (** Minus one is the absorbant element of lor *) Theorem lor_1: absorbant (-1) lor. Proof. apply (Z_bitwise_absorbant true orb). unfold absorbant. auto. Qed. (** ** De Morgan laws of bitwise operators *) Theorem lnot_land_de_morgan: forall x y: Z, lnot (land x y) = lor (lnot x) (lnot y). Proof. intros. unfold lnot. unfold lxor. Zbit_bitwise k. rewrite Bool.xorb_true_l. unfold land. rewrite Zbit_bitwise. unfold lor. rewrite Zbit_bitwise. unfold Zbit. unfold Z_bitwise. rewrite Z_decomp_recomp. rewrite Z_decomp_recomp. unfold bitwise. simpl. pose (xb:= btest (bits_of_Z x) k). fold xb. pose (yb:= btest (bits_of_Z y) k). fold yb. destruct xb; destruct yb; simpl; auto. Qed. Theorem lnot_lor_de_morgan: forall x y: Z, lnot (lor x y) = land (lnot x) (lnot y). Proof. intros. unfold lnot. unfold lxor. Zbit_bitwise k. rewrite Bool.xorb_true_l. unfold land. rewrite Zbit_bitwise. unfold lor. rewrite Zbit_bitwise. unfold Zbit. unfold Z_bitwise. rewrite Z_decomp_recomp. rewrite Z_decomp_recomp. unfold bitwise. simpl. pose (xb:= btest (bits_of_Z x) k). fold xb. pose (yb:= btest (bits_of_Z y) k). fold yb. destruct xb; destruct yb; simpl; auto. Qed. (** ** Distributivity of bitwise operators *) (** Distributive lor land *) Theorem lor_land_distrib_l: distributive_l lor land. Proof. apply (Z_bitwise_distrib_l orb andb). unfold distributive_l. destruct x; destruct y; destruct z; auto. Qed. Theorem lor_land_distrib_r: distributive_r lor land. Proof. apply (Z_bitwise_distrib_r orb andb). unfold distributive_r. destruct x; destruct y; destruct z; auto. Qed. (** Distributive land lor *) Theorem land_lor_distrib_l: distributive_l land lor. Proof. apply (Z_bitwise_distrib_l andb orb). unfold distributive_l. destruct x; destruct y; destruct z; auto. Qed. Theorem land_lor_distrib_r: distributive_r land lor. Proof. apply (Z_bitwise_distrib_r andb orb). unfold distributive_r. destruct x; destruct y; destruct z; auto. Qed. (** Distributive land lxor *) Theorem land_lxor_distrib_l: distributive_l land lxor. Proof. apply (Z_bitwise_distrib_l andb xorb). unfold distributive_l. destruct x; destruct y; destruct z; auto. Qed. Theorem land_lxor_distrib_r: distributive_r land lxor. Proof. apply (Z_bitwise_distrib_r andb xorb). unfold distributive_r. destruct x; destruct y; destruct z; auto. Qed. (** ** Properties of lxor operator *) Theorem lxor_nilpotent: forall x: Z, lxor x x = 0. Proof. intro. unfold lxor. Zbit_bitwise k. rewrite Bool.xorb_nilpotent. auto. Qed. Theorem lxor_1: forall x: Z, lxor (-1) x = lnot x. Proof. trivial. Qed. (** ** Others properties of lnot operator *) Theorem lxor_lnot: forall x y: Z, lxor (lnot x) y = lnot (lxor x y). Proof. intros. unfold lnot. apply (lxor_assoc (-1) x y). Qed. Theorem land_lnot_nilpotent: forall x: Z, land (lnot x) x = 0. Proof. intro. rewrite <- lxor_1. rewrite land_lxor_distrib_r. rewrite land_1. rewrite land_idemp. apply lxor_nilpotent. Qed. Theorem lor_lnot_1: forall x: Z, lor (lnot x) x = (-1). Proof. intro. apply lnot_inj. rewrite lnot_lor_de_morgan. rewrite lnot_inv. rewrite land_commut. rewrite land_lnot_nilpotent. apply lnot_1. Qed. (** ** Link between shifting and bitwise operators *) Local Ltac lsl_distrib_r lop z := unfold distributive_r; let k := fresh in intros; unfold lop; Zbit_bitwise k; repeat rewrite Zbit_lsl; rewrite Zbit_bitwise; case_leq (Z.abs z) (Z_of_nat k); [ (intro; trivial) | trivial ]. (** Distributive lsl lor *) Lemma lsl_lor_distrib_r: distributive_r lsl_def lor. Proof. lsl_distrib_r lor z. Qed. (** Distributive lsl land *) Lemma lsl_land_distrib_r: distributive_r lsl_def land. Proof. lsl_distrib_r land z. Qed. (** Distributive lsl lxor *) Lemma lsl_lxor_distrib_r: distributive_r lsl_def lxor. Proof. lsl_distrib_r lxor z. Qed. Local Ltac lsr_distrib_r lop := unfold distributive_r; intros; Zbit_ext fresh; unfold lop; rewrite Zbit_bitwise; repeat rewrite Zbit_lsr; rewrite Zbit_bitwise; trivial. (** Distributive lsr lor *) Lemma lsr_lor_distrib_r: distributive_r lsr_def lor. Proof. lsr_distrib_r lor. Qed. (** Distributive lsr land *) Lemma lsr_land_distrib_r: distributive_r lsr_def land. Proof. lsr_distrib_r land. Qed. (** Distributive lsr lxor *) Lemma lsr_lxor_distrib_r: distributive_r lsr_def lxor. Proof. lsr_distrib_r lxor. Qed. (** lsr lnot *) Lemma lsr_lnot: forall x y: Z, lnot (lsr_def x y) = lsr_def (lnot x) y . Proof. unfold lnot. lsr_distrib_r lxor. Qed. (** ** Some properties of equations of bitwise operators *) Local Ltac f_equal_hyp h f k := match goal with | [ h:(?X1 = ?X2) |- _ ] => let H := fresh in assert (H : f X1 k = f X2 k) by (f_equal; auto); clear h; assert (h: f X1 k = f X2 k) by auto; clear H end. Local Ltac linear2 := intros x y; (try split); intros H; (try split); let k := fresh "k" in Zbit_ext k; try (destruct H as [H H0] ; f_equal_hyp H0 Zbit k; generalize H0; clear H0) ; f_equal_hyp H Zbit k; generalize H; clear H; (try unfold limpl); (try unfold lnot); (try unfold land); (try unfold lor); (try unfold lxor); repeat (replace (Zbit (-1) k) with true by simpl); repeat (replace (Zbit 0 k) with false by simpl); repeat rewrite Zbit_bitwise; destruct (Zbit x k); destruct (Zbit y k); simpl; auto. Lemma linear_land: forall x y: Z, limpl x y = -1 <-> land x y = x. Proof. linear2. Qed. Lemma linear_lor: forall x y: Z, lor x y = x <-> limpl y x = -1. Proof. linear2. Qed. Lemma linear_lxor: forall x y: Z, lxor x y = x <-> y=0. Proof. linear2. Qed. Lemma linear_limpl_r: forall x y: Z, limpl x y = y <-> lor x y = -1. Proof. linear2. Qed. (* Local Ltac F_equal_hyp h f k := match goal with | [ h:(?X1 = ?X2) |- _ ] => idtac h; let H := fresh in assert (H : f X1 k = f X2 k) by (f_equal; auto); clear h; assert (h: f X1 k = f X2 k) by (apply H); clear H end. *) Lemma linear_limpl_l: forall x y: Z, limpl x y = x <-> x=-1 /\ y=-1. Proof. linear2. Qed. Lemma linear_land_lnot: forall x y: Z, land x y = lnot x <-> x=-1 /\ y=0. Proof. linear2. Qed. Lemma linear_lor_lnot: forall x y: Z, lor x y = lnot x <-> x=0 /\ y=-1. Proof. linear2. Qed. Lemma linear_lxor_lnot : forall x y: Z, lxor x y = lnot x <-> y=-1. Proof. linear2. Qed. Lemma linear_limpl_r_lnot: forall x y: Z, limpl x y = lnot y <-> x=0 /\ y=0. Proof. linear2. Qed. Lemma linear_limpl_l_lnot: forall x y: Z, limpl x y = lnot x <-> land x y = 0. Proof. linear2. Qed. Local Ltac linear3 := intros x y z; (try split); intros H; (try split); let k := fresh "k" in Zbit_ext k; try (destruct H as [H H0] ; f_equal_hyp H0 Zbit k; generalize H0; clear H0); f_equal_hyp H Zbit k; generalize H; clear H; (try unfold limpl); (try unfold lnot); (try unfold land); (try unfold lor); (try unfold lxor); repeat (replace (Zbit (-1) k) with true by simpl); repeat (replace (Zbit 0 k) with false by simpl); repeat rewrite Zbit_bitwise; destruct (Zbit x k); destruct (Zbit y k); destruct (Zbit z k); simpl; auto. Lemma linear_lxor_land: forall x y z: Z, lxor x y = land x z <-> lnot y = limpl x z. Proof. linear3. Qed. Lemma linear_lxor_lor: forall x y z: Z, lxor x y = lor x z <-> lnot y = limpl z x. Proof. linear3. Qed. Lemma linear_lxor_limpl_l: forall x y z: Z, lxor x y = limpl x z <-> lnot y = land x z. Proof. linear3. Qed. Lemma linear_lxor_limpl_r: forall x y z: Z, lxor x y = limpl z x <-> lnot y = lor z x. Proof. linear3. Qed. Lemma linear_land_land: forall x y z: Z, land x y = land z x <-> land x (lxor y z) = 0. Proof. linear3. Qed. Lemma linear_lnot_land_land: forall x y z: Z, lnot (land x y) = land z x <-> x=-1 /\ y = lnot z. Proof. linear3. Qed. Lemma linear_lor_lor: forall x y z: Z, lor x y = lor z x <-> land (lnot x) (lxor y z) = 0. Proof. linear3. Qed. Lemma linear_lnot_lor_lor: forall x y z: Z, lnot (lor x y) = lor z x <-> x=0 /\ y = lnot z. Proof. linear3. Qed. Lemma linear_lor_land: forall x y z: Z, lor x y = land x z <-> y = land x (lnot (lxor y z)). Proof. linear3. Qed. Lemma land_discrimination_inv: forall x y z:Z, x = land y z -> land x (lnot y) = 0. Proof. linear3. Qed. Lemma land_discrimination: forall x y z:Z, land x (lnot y) <> 0 -> x <> land y z. Proof. intros x y z. generalize (land_discrimination_inv x y z). intuition. Qed. Lemma lxor_discrimination_inv: forall x y z:Z, x = lxor y z -> lxor x y = z. Proof. linear3. Qed. Lemma land_system: forall x1 x2 y1 y2 z:Z, (x1 = land z y1 /\ x2 = land z y2) <-> lor x1 x2 = land z (lor (land (lnot x1) (land (lnot x2) (lor y1 y2))) (lor (land x1 (land y1 (lnot (lxor x2 y2)))) ((land x2 (land y2 (lnot (lxor x1 y1))))))). Proof. intros x1 x2 y1 y2 z. split; intro H ; try split; Zbit_ext k; try (destruct H as [H H0]; f_equal_hyp H0 Zbit k; generalize H0; clear H0); f_equal_hyp H Zbit k; generalize H; clear H; (try unfold limpl); (try unfold lnot); (try unfold land); (try unfold lor); (try unfold lxor); repeat (replace (Zbit (-1) k) with true by simpl); repeat (replace (Zbit 0 k) with false by simpl); repeat rewrite Zbit_bitwise; destruct (Zbit x1 k); destruct (Zbit x2 k); destruct (Zbit y1 k); destruct (Zbit y2 k); destruct (Zbit z k); simpl; auto. Qed. (** * Properties about bounds of bitwise operators *) Theorem lnot_in_range: forall a b z: Z, a <= z < b -> -b <= lnot z < -a. Proof. intros. rewrite lnot_zlnot_equiv. unfold zlnot. omega. Qed. Theorem lsr_upper_bound: forall b x y: Z, 0 <= y -> x < b -> 0 <= b -> lsr x y < b. Proof. intros b x y Ry Rx Rb. apply Zle_is_le_bool in Ry; unfold lsr; rewrite Ry. unfold lsr_def. rewrite lsr_arithmetic_shift. unfold lsr_arithmetic_def. pose (d := two_power_nat (Z.abs_nat y)); fold d. assert (PWR2: 0 < d) by apply two_power_nat_is_positive. apply Zdiv_lt_upper_bound; auto. assert (b <= b * d) by apply (upper_positive_mult_positive d b Rb PWR2). omega. Qed. Theorem lsr_lower_bound: forall b x y: Z, 0 <= y -> b <= x -> b <= 0 -> b <= lsr x y. Proof. intros b x y Ry Rx Rb. apply Zle_is_le_bool in Ry; unfold lsr; rewrite Ry. unfold lsr_def. rewrite lsr_arithmetic_shift. unfold lsr_arithmetic_def. pose (d := two_power_nat (Z.abs_nat y)); fold d. assert (PWR2: 0 < d) by apply two_power_nat_is_positive. apply Zdiv_le_lower_bound; auto. assert (b * d <= b) by apply (lower_negative_mult_positive d b Rb PWR2). omega. Qed. (** * Other properties of bitwise operators *) Theorem Zbit_land_edge_inf: forall (x:Z) (n k:nat), Zbit x k = Zbit (land ((two_power_nat (S (n + k))) - 1) x) k. Proof. intros. unfold land; rewrite Zbit_bitwise. cut (Zbit (two_power_nat (S (n + k)) - 1) k = true). { intro C; rewrite C; simpl; auto. } induction k. (** base *) + (replace (n + 0)%nat with n by (auto with zarith)). rewrite two_power_nat_S. (replace (2*two_power_nat n - 1) with (2*(two_power_nat n - 1) +1) by ring). apply Zbit_s2x_0. (** ind. *) + rewrite two_power_nat_S. (replace (2*two_power_nat (n + S k) - 1) with (2*(two_power_nat (n + S k) - 1) +1) by ring). rewrite Zbit_s2x_p. (replace (n + S k)%nat with (S (n + k)%nat) by (auto with zarith)). auto. Qed. Theorem Zbit_power_minus_one: forall n k:nat, Zbit (two_power_nat n - 1) k = leb (S k) n. Proof. induction n. (** base *) + unfold two_power_nat; unfold Zbit; unfold bits_of_Z. simpl; auto. (** ind *) + replace (two_power_nat (S n) - 1) with (2 * (two_power_nat n - 1) + 1) by (rewrite two_power_nat_S; (auto with zarith)). destruct k. * rewrite Zbit_s2x_0. auto. * rewrite Zbit_s2x_p. rewrite (IHn k). auto. Qed. Lemma pos_mod_two_power_nat_land_edge: forall (x:Z) (n:nat), x mod (two_power_nat n) = land ((two_power_nat n) - 1) x. Proof. intros. Zbit_ext k. rewrite Zbit_uint_mod_two_power_nat. unfold land; rewrite Zbit_bitwise. rewrite Zbit_power_minus_one. nat_compare Inf EQ Sup n k. + rewrite (leb_correct n k) by omega. rewrite (leb_correct_conv n (S k)) by omega. simpl; auto. + rewrite (leb_correct n n) by omega. rewrite (leb_correct_conv n (S n)) by omega. simpl; auto. + rewrite (leb_correct_conv k n) by omega. rewrite (leb_correct (S k) n) by omega. simpl; auto. Qed. (** * Bit extraction *) Parameter zbit_test_undef: Z -> Z -> bool. (* Extended version for negative value. *) Definition zbit_test_def (x:Z) (n:Z): bool := Zbit x (Z.abs_nat n). Theorem zbit_test_ext: forall x y: Z, (forall n, zbit_test_def x n = zbit_test_def y n) -> x=y. Proof. intros x y. unfold zbit_test_def. intro. Zbit_ext k. rewrite <- (Zabs2Nat.id k). apply H. Qed. Definition bit_testb (x:Z) (n:Z): bool := if Zle_bool 0 n then zbit_test_def x n else zbit_test_undef x n. Theorem bit_testb_pos: forall x n: Z, 0<=n -> bit_testb x n = zbit_test_def x n. Proof. intros. unfold bit_testb. case_leq 0 n. intro. auto. Qed. Theorem bit_testb_ext: forall x y: Z, (forall n: Z, 0<=n -> bit_testb x n = bit_testb y n) -> x=y. Proof. intros. Zbit_ext j. specialize (H (Z.of_nat j)). specialize (H (Zle_0_nat j)). rewrite bit_testb_pos in H. rewrite bit_testb_pos in H. unfold zbit_test_def in H. rewrite Zabs2Nat.id in H. auto. apply (Zle_0_nat j). apply (Zle_0_nat j). Qed. (** Tactical *) Local Ltac bit_extraction bin_op := intros; unfold zbit_test_def; unfold bin_op; rewrite Zbit_bitwise; auto. (** ** Link between Bit extraction and modulo operator *) Theorem uint_mod_two_power_extraction: forall (n:nat) (m x:Z), zbit_test_def (x mod (two_power_nat n)) m = if leb n (Z.abs_nat m) then false else zbit_test_def x m. Proof. intros. unfold zbit_test_def. apply Zbit_uint_mod_two_power_nat. Qed. (** ** Link between Bit extraction and bitwise shifting operators *) Theorem lsl_extraction: forall x n m: Z, zbit_test_def (lsl_def x n) m = if Zle_bool (Z.abs n) (Z.abs m) then zbit_test_def x ((Z.abs m) - (Z.abs n)) else false. Proof. intros. unfold zbit_test_def. rewrite Zbit_lsl. repeat rewrite inj_Zabs_nat. auto. Qed. Theorem lsr_extraction: forall x n m: Z, zbit_test_def (lsr_def x n) m = zbit_test_def x ((Z.abs m) + (Z.abs n)). Proof. intros. unfold zbit_test_def. (** right term *) rewrite <- zabs_plus. (** left term *) rewrite Zbit_lsr. auto. Qed. (** ** Link between Bit extraction and bitwise operators *) Theorem land_extraction: forall x y i: Z, zbit_test_def (land x y) i = andb (zbit_test_def x i) (zbit_test_def y i). Proof. bit_extraction land. Qed. Theorem lor_extraction: forall x y i: Z, zbit_test_def (lor x y) i = orb (zbit_test_def x i) (zbit_test_def y i). Proof. bit_extraction lor. Qed. Theorem lxor_extraction: forall x y i: Z, zbit_test_def (lxor x y) i = xorb (zbit_test_def x i) (zbit_test_def y i). Proof. bit_extraction lxor. Qed. Theorem lnot_extraction: forall x i: Z, zbit_test_def (lnot x) i = negb (zbit_test_def x i). Proof. unfold lnot. bit_extraction lxor. Qed. (** ** Link between bitwise operators and the addition *) Remark land_no_carry : forall (x y:Z) (i:nat), land x y = 0 -> (Zbit x i = false \/ Zbit y i = false). Proof. intros. assert (Zbit (land x y) i = false). { rewrite H. rewrite Zbit_of_zero. unfold FALSE. trivial. } clear H. unfold land in H0. rewrite Zbit_bitwise in H0. destruct (Zbit x i); destruct (Zbit y i); intuition. Qed. Theorem lor_addition : forall (x y:Z), land x y = 0 -> x + y = lor x y. Proof. intros. Zbit_ext i. generalize H; clear H. generalize x; clear x. generalize y; clear y. induction i; intros. + generalize (land_no_carry x y O). unfold lor; rewrite Zbit_bitwise. repeat (rewrite Zbit_0). rewrite Z.odd_add. destruct (Z.odd x); destruct (Z.odd y); intuition. + generalize (IHi (y/2) (x/2)); clear IHi. unfold lor; rewrite Zbit_bitwise. rewrite Zbit_bitwise. intros. repeat (rewrite <- Zbit_div2). assert (Zbit (x / 2 + y / 2) i = (Zbit (x / 2) i || Zbit (y / 2) i)%bool). { apply H0; clear H0; clear i. Zbit_ext k. unfold land; rewrite Zbit_bitwise. rewrite Zbit_div2; rewrite Zbit_div2. generalize (land_no_carry x y (S k)). destruct (Zbit x (S k)); destruct (Zbit y (S k)); intuition. } rewrite <- H1; clear H1. f_equal. generalize (land_no_carry x y 0%nat). repeat (rewrite Zbit_0). rewrite (div2_odd_eq x) at 3. rewrite (div2_odd_eq y) at 3. clear H0. destruct (Z.odd x); destruct (Z.odd y); intuition; try discriminate H0; repeat (rewrite Z.add_0_r); symmetry. * apply (Zdiv_unique (2 * (x / 2) + 1 + 2 * (y / 2)) 2 (x / 2 + y / 2) 1); auto with zarith. * apply (Zdiv_unique (2 * (x / 2) + (2 * (y / 2) + 1)) 2 (x / 2 + y / 2) 1); auto with zarith. * apply (Zdiv_unique (2 * (x / 2) + 2 * (y / 2)) 2 (x / 2 + y / 2) 0); auto with zarith. * apply (Zdiv_unique (2 * (x / 2) + 2 * (y / 2)) 2 (x / 2 + y / 2) 0); auto with zarith. Qed. Theorem lxor_addition : forall (x y:Z), land x y = 0 -> x + y = lxor x y. Proof. intros. rewrite lor_addition. + Zbit_ext i. unfold lor; rewrite Zbit_bitwise. unfold lxor; rewrite Zbit_bitwise. generalize (land_no_carry x y i). destruct (Zbit x i); destruct (Zbit y i); intuition. + trivial. Qed. Theorem land_addition : forall (x y z:Z), land x y = 0 -> (land x z) + (land y z) = land (x + y) z. Proof. intros. rewrite lor_addition. + rewrite lor_addition; trivial. symmetry. apply land_lor_distrib_r. + rewrite land_assoc. rewrite <- (land_commut (land y z)). rewrite land_assoc. rewrite <- land_assoc. rewrite H. apply land_0. Qed. (** * Tacticals. *) (** ** Main tactics.*) (* Ltac rewrite_cst := first [ Bits.rewrite_cst | COMPUTE1 bitwise_lsl Cst_Z Cst_nat | COMPUTE1 bitwise_lsr Cst_Z Cst_nat | COMPUTE1 lsl_shift_def Cst_Z Cst_nat | COMPUTE1 lsr_shift_def Cst_Z Cst_nat | COMPUTE1 lsl_arithmetic_def Cst_Z Cst_nat | COMPUTE1 lsr_arithmetic_def Cst_Z Cst_nat | COMPUTE1 lsl_def Cst_Z Cst_Z | COMPUTE1 lsr_def Cst_Z Cst_Z | COMPUTE1 land Cst_Z Cst_Z | COMPUTE1 lor Cst_Z Cst_Z | COMPUTE1 lxor Cst_Z Cst_Z | COMPUTE1 lnot Cst_Z | COMPUTE1 zbit_test_def Cst_Z Cst_Z ]. *) Ltac auto_zbits := autorewrite with zbits ; auto_bits. Hint Rewrite lnot_0 land_0 lor_0 lxor_0 lnot_1 land_1 lor_1 lxor_1 lor_0 lor_1 land_idemp lor_idemp lxor_nilpotent: zbits. (** Example of use. *) (* Remark rewrite_cst_example: forall x, x + (land 0 (zlnot (land 0 5))) = x + Z_of_nat (ZxHpos 0). Proof. repeat rewrite_cst. intro. auto. Qed. *) ��������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/bool/�����������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017277� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/bool/Bool.v�����������������������������������������0000666�0000000�0000000�00000004256�13571573400�020370� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. (* Why3 goal *) Lemma andb_def : forall (x:bool) (y:bool), ((Init.Datatypes.andb x y) = match x with | true => y | false => false end). Proof. intros x y. apply refl_equal. Qed. (* Why3 goal *) Lemma orb_def : forall (x:bool) (y:bool), ((Init.Datatypes.orb x y) = match x with | false => y | true => true end). Proof. intros x y. apply refl_equal. Qed. (* Why3 goal *) Lemma notb_def : forall (x:bool), ((Init.Datatypes.negb x) = match x with | false => true | true => false end). Proof. intros x. apply refl_equal. Qed. (* Why3 goal *) Lemma xorb_def : forall (x:bool) (y:bool), ((Init.Datatypes.xorb x y) = match x with | false => y | true => (Init.Datatypes.negb y) end). Proof. intros x y. destruct x; destruct y; auto. Qed. (* Why3 goal *) Lemma implb_def : forall (x:bool) (y:bool), ((Init.Datatypes.implb x y) = match x with | false => true | true => y end). Proof. now intros [|] [|]. Qed. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/int/������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017136� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/int/Abs.v�������������������������������������������0000666�0000000�0000000�00000003065�13571573400�020036� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. (* Why3 comment *) (* abs is replaced with (ZArith.BinInt.Z.abs x) by the coq driver *) (* Why3 goal *) Lemma abs_def : forall (x:Z), ((0%Z <= x)%Z -> ((ZArith.BinInt.Z.abs x) = x)) /\ (~ (0%Z <= x)%Z -> ((ZArith.BinInt.Z.abs x) = (-x)%Z)). intros x. split ; intros H. now apply Z.abs_eq. apply Zabs_non_eq. apply Znot_gt_le. contradict H. apply Zlt_le_weak. now apply Z.gt_lt. Qed. (* Why3 goal *) Lemma Abs_le : forall (x:Z) (y:Z), ((ZArith.BinInt.Z.abs x) <= y)%Z <-> (((-y)%Z <= x)%Z /\ (x <= y)%Z). intros x y. zify. omega. Qed. (* Why3 goal *) Lemma Abs_pos : forall (x:Z), (0%Z <= (ZArith.BinInt.Z.abs x))%Z. exact Zabs_pos. Qed. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/int/ComputerDivision.v������������������������������0000666�0000000�0000000�00000011245�13571573400�022633� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. Require int.Abs. Require Import Zquot. (* Why3 comment *) (* div is replaced with (ZArith.BinInt.Z.quot x x1) by the coq driver *) (* Why3 comment *) (* mod1 is replaced with (ZArith.BinInt.Z.rem x x1) by the coq driver *) (* Why3 goal *) Lemma Div_mod : forall (x:Z) (y:Z), ~ (y = 0%Z) -> (x = ((y * (ZArith.BinInt.Z.quot x y))%Z + (ZArith.BinInt.Z.rem x y))%Z). intros x y _. apply Z.quot_rem'. Qed. (* Why3 goal *) Lemma Div_bound : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (0%Z <= (ZArith.BinInt.Z.quot x y))%Z /\ ((ZArith.BinInt.Z.quot x y) <= x)%Z. intros x y (Hx,Hy). split. now apply Z.quot_pos. destruct (Z.eq_dec y 1) as [H|H]. rewrite H, Z.quot_1_r. apply Z.le_refl. destruct (Zle_lt_or_eq 0 x Hx) as [H'|H']. apply Zlt_le_weak. apply Z.quot_lt with (1 := H'). omega. now rewrite <- H', Zquot_0_l. Qed. (* Why3 goal *) Lemma Mod_bound : forall (x:Z) (y:Z), ~ (y = 0%Z) -> ((-(ZArith.BinInt.Z.abs y))%Z < (ZArith.BinInt.Z.rem x y))%Z /\ ((ZArith.BinInt.Z.rem x y) < (ZArith.BinInt.Z.abs y))%Z. intros x y Zy. destruct (Zle_or_lt 0 x) as [Hx|Hx]. refine ((fun H => conj (Z.lt_le_trans _ 0 _ _ (proj1 H)) (proj2 H)) _). clear -Zy ; zify ; omega. now apply Zrem_lt_pos. refine ((fun H => conj (proj1 H) (Z.le_lt_trans _ 0 _ (proj2 H) _)) _). clear -Zy ; zify ; omega. apply Zrem_lt_neg with (2 := Zy). now apply Zlt_le_weak. Qed. (* Why3 goal *) Lemma Div_sign_pos : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (0%Z <= (ZArith.BinInt.Z.quot x y))%Z. intros x y (Hx, Hy). now apply Z.quot_pos. Qed. (* Why3 goal *) Lemma Div_sign_neg : forall (x:Z) (y:Z), ((x <= 0%Z)%Z /\ (0%Z < y)%Z) -> ((ZArith.BinInt.Z.quot x y) <= 0%Z)%Z. intros x y (Hx, Hy). generalize (Z.quot_pos (-x) y). rewrite Zquot_opp_l. omega. Qed. (* Why3 goal *) Lemma Mod_sign_pos : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ ~ (y = 0%Z)) -> (0%Z <= (ZArith.BinInt.Z.rem x y))%Z. intros x y (Hx, Zy). now apply Zrem_lt_pos. Qed. (* Why3 goal *) Lemma Mod_sign_neg : forall (x:Z) (y:Z), ((x <= 0%Z)%Z /\ ~ (y = 0%Z)) -> ((ZArith.BinInt.Z.rem x y) <= 0%Z)%Z. intros x y (Hx, Zy). now apply Zrem_lt_neg. Qed. (* Why3 goal *) Lemma Rounds_toward_zero : forall (x:Z) (y:Z), ~ (y = 0%Z) -> ((ZArith.BinInt.Z.abs ((ZArith.BinInt.Z.quot x y) * y)%Z) <= (ZArith.BinInt.Z.abs x))%Z. intros x y Zy. rewrite Zmult_comm. zify. generalize (Z.mul_quot_le x y). generalize (Z.mul_quot_ge x y). omega. Qed. (* Why3 goal *) Lemma Div_1 : forall (x:Z), ((ZArith.BinInt.Z.quot x 1%Z) = x). exact Z.quot_1_r. Qed. (* Why3 goal *) Lemma Mod_1 : forall (x:Z), ((ZArith.BinInt.Z.rem x 1%Z) = 0%Z). exact Z.rem_1_r. Qed. (* Why3 goal *) Lemma Div_inf : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (x < y)%Z) -> ((ZArith.BinInt.Z.quot x y) = 0%Z). exact Z.quot_small. Qed. (* Why3 goal *) Lemma Mod_inf : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (x < y)%Z) -> ((ZArith.BinInt.Z.rem x y) = x). exact Z.rem_small. Qed. (* Why3 goal *) Lemma Div_mult : forall (x:Z) (y:Z) (z:Z), ((0%Z < x)%Z /\ ((0%Z <= y)%Z /\ (0%Z <= z)%Z)) -> ((ZArith.BinInt.Z.quot ((x * y)%Z + z)%Z x) = (y + (ZArith.BinInt.Z.quot z x))%Z). intros x y z (Hx&Hy&Hz). rewrite (Zplus_comm y). rewrite <- Z_quot_plus. now rewrite Zplus_comm, Zmult_comm. apply Zmult_le_0_compat with (2 := Hz). apply Zplus_le_0_compat with (1 := Hz). apply Zmult_le_0_compat with (1 := Hy). now apply Zlt_le_weak. intros H. now rewrite H in Hx. Qed. (* Why3 goal *) Lemma Mod_mult : forall (x:Z) (y:Z) (z:Z), ((0%Z < x)%Z /\ ((0%Z <= y)%Z /\ (0%Z <= z)%Z)) -> ((ZArith.BinInt.Z.rem ((x * y)%Z + z)%Z x) = (ZArith.BinInt.Z.rem z x)). intros x y z (Hx&Hy&Hz). rewrite Zplus_comm, Zmult_comm. apply Z_rem_plus. apply Zmult_le_0_compat with (2 := Hz). apply Zplus_le_0_compat with (1 := Hz). apply Zmult_le_0_compat with (1 := Hy). now apply Zlt_le_weak. Qed. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/int/ComputerOfEuclideanDivision.v�������������������0000666�0000000�0000000�00000007066�13571573400�024740� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. Require int.Abs. Require int.EuclideanDivision. Require int.ComputerDivision. Lemma on_pos_euclidean_is_div: forall n d, (int.EuclideanDivision.div n (Zpos d)) = Z.div n (Zpos d). intros n d. unfold EuclideanDivision.div. assert (0 < Z.pos d)%Z by reflexivity. destruct (Z.mod_pos_bound n (Zpos d) H). case (Z_le_dec 0 (n mod (Zpos d))); intros H2. * reflexivity. * destruct (H2 H0). Qed. (* Why3 goal *) Lemma cdiv_cases : forall (n:Z) (d:Z), ((0%Z <= n)%Z -> ((0%Z < d)%Z -> ((ZArith.BinInt.Z.quot n d) = (int.EuclideanDivision.div n d)))) /\ (((n <= 0%Z)%Z -> ((0%Z < d)%Z -> ((ZArith.BinInt.Z.quot n d) = (-(int.EuclideanDivision.div (-n)%Z d))%Z))) /\ (((0%Z <= n)%Z -> ((d < 0%Z)%Z -> ((ZArith.BinInt.Z.quot n d) = (-(int.EuclideanDivision.div n (-d)%Z))%Z))) /\ ((n <= 0%Z)%Z -> ((d < 0%Z)%Z -> ((ZArith.BinInt.Z.quot n d) = (int.EuclideanDivision.div (-n)%Z (-d)%Z)))))). intros n d. destruct d as [|d|d]; destruct n as [|n|n]; intuition (try contradiction; try discriminate; auto). + assert (NZ_d:((Zpos d) <> 0)%Z) by discriminate. rewrite (Z.quot_div (Z.pos n) (Z.pos d) NZ_d). rewrite on_pos_euclidean_is_div. rewrite Z.mul_1_l. reflexivity. + assert (NZ_d:((Zpos d) <> 0)%Z) by discriminate. rewrite (Z.quot_div (Z.neg n) (Z.pos d) NZ_d). rewrite on_pos_euclidean_is_div. reflexivity. + assert (NZ_d:((Z.neg d) <> 0)%Z) by discriminate. rewrite (Z.quot_div (Z.pos n) (Z.neg d) NZ_d). simpl. rewrite on_pos_euclidean_is_div. reflexivity. + assert (NZ_d:((Z.neg d) <> 0)%Z) by discriminate. rewrite (Z.quot_div (Z.neg n) (Z.neg d) NZ_d). simpl. rewrite on_pos_euclidean_is_div. destruct (Z.pos n / Z.pos d)%Z;reflexivity. Qed. (* Why3 goal *) Lemma cmod_cases : forall (n:Z) (d:Z), ((0%Z <= n)%Z -> ((0%Z < d)%Z -> ((ZArith.BinInt.Z.rem n d) = (int.EuclideanDivision.mod1 n d)))) /\ (((n <= 0%Z)%Z -> ((0%Z < d)%Z -> ((ZArith.BinInt.Z.rem n d) = (-(int.EuclideanDivision.mod1 (-n)%Z d))%Z))) /\ (((0%Z <= n)%Z -> ((d < 0%Z)%Z -> ((ZArith.BinInt.Z.rem n d) = (int.EuclideanDivision.mod1 n (-d)%Z)))) /\ ((n <= 0%Z)%Z -> ((d < 0%Z)%Z -> ((ZArith.BinInt.Z.rem n d) = (-(int.EuclideanDivision.mod1 (-n)%Z (-d)%Z))%Z))))). intros n d. unfold int.EuclideanDivision.mod1. assert (Z.rem n d = n - (d * (Z.quot n d)))%Z. assert (H:= Z.quot_rem' n d). omega. rewrite H. assert (H2:=cdiv_cases n d). intuition. + rewrite H1. reflexivity. + rewrite H4. rewrite Z.mul_opp_r. omega. + rewrite H1. rewrite Z.mul_opp_r. rewrite Z.mul_opp_l. reflexivity. + rewrite H4. rewrite Z.mul_opp_l. omega. Qed. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/int/EuclideanDivision.v�����������������������������0000666�0000000�0000000�00000013724�13571573400�022732� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. Require int.Abs. (* Why3 goal *) Definition div : Z -> Z -> Z. intros x y. case (Z_le_dec 0 (Zmod x y)) ; intros H. exact (Z.div x y). exact (Z.div x y + 1)%Z. Defined. (* Why3 goal *) Definition mod1 : Z -> Z -> Z. intros x y. exact (x - y * div x y)%Z. Defined. (* Why3 goal *) Lemma Div_mod : forall (x:Z) (y:Z), ~ (y = 0%Z) -> (x = ((y * (div x y))%Z + (mod1 x y))%Z). intros x y Zy. unfold mod1, div. case Z_le_dec ; intros H ; ring. Qed. (* Why3 goal *) Lemma Mod_bound : forall (x:Z) (y:Z), ~ (y = 0%Z) -> (0%Z <= (mod1 x y))%Z /\ ((mod1 x y) < (ZArith.BinInt.Z.abs y))%Z. intros x y Zy. zify. assert (H1 := Z_mod_neg x y). assert (H2 := Z_mod_lt x y). unfold mod1, div. case Z_le_dec ; intros H0. rewrite Zmult_comm, <- Zmod_eq_full with (1 := Zy). omega. replace (x - y * (x / y + 1))%Z with (x - x / y * y - y)%Z by ring. rewrite <- Zmod_eq_full with (1 := Zy). omega. Qed. (* Why3 goal *) Lemma Div_unique : forall (x:Z) (y:Z) (q:Z), (0%Z < y)%Z -> (((q * y)%Z <= x)%Z /\ (x < ((q * y)%Z + y)%Z)%Z) -> ((div x y) = q). intros x y q h1 (h2,h3). assert (h:(~(y=0))%Z) by omega. generalize (Mod_bound x y h); intro h0. rewrite Z.abs_eq in h0; auto with zarith. generalize (Div_mod x y h); clear h; intro h. assert (cases:(div x y = q \/ (div x y <= q - 1 \/ div x y >= q+1))%Z) by omega. destruct cases as [h4 | [h5 | h6]]; auto. assert (y * div x y <= y * (q - 1))%Z. apply Zmult_le_compat_l; auto with zarith. replace (y*(q-1))%Z with (q*y - y)%Z in H by ring. elimtype False. omega. assert (y * div x y >= y * (q + 1))%Z. apply Zmult_ge_compat_l; auto with zarith. replace (y*(q+1))%Z with (q*y + y)%Z in H by ring. elimtype False. omega. Qed. (* Why3 goal *) Lemma Div_bound : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z < y)%Z) -> (0%Z <= (div x y))%Z /\ ((div x y) <= x)%Z. intros x y (Hx,Hy). unfold div. case Z_le_dec ; intros H. split. apply Z_div_pos with (2 := Hx). now apply Z.lt_gt. destruct (Z.eq_dec y 1) as [H'|H']. rewrite H', Zdiv_1_r. apply Z.le_refl. rewrite <- (Zdiv_1_r x) at 2. apply Zdiv_le_compat_l with (1 := Hx). omega. elim H. apply Z_mod_lt. now apply Z.lt_gt. Qed. (* Why3 goal *) Lemma Mod_1 : forall (x:Z), ((mod1 x 1%Z) = 0%Z). intros x. unfold mod1, div. rewrite Zmod_1_r, Zdiv_1_r, Zmult_1_l. apply Zminus_diag. Qed. (* Why3 goal *) Lemma Div_1 : forall (x:Z), ((div x 1%Z) = x). intros x. unfold div. now rewrite Zmod_1_r, Zdiv_1_r. Qed. (* Why3 goal *) Lemma Div_inf : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (x < y)%Z) -> ((div x y) = 0%Z). intros x y Hxy. unfold div. case Z_le_dec ; intros H. now apply Zdiv_small. elim H. now rewrite Zmod_small. Qed. (* Why3 goal *) Lemma Div_inf_neg : forall (x:Z) (y:Z), ((0%Z < x)%Z /\ (x <= y)%Z) -> ((div (-x)%Z y) = (-1%Z)%Z). intros x y Hxy. assert (h: (x < y \/ x = y)%Z) by omega. destruct h. (* case 0 < x < y *) assert (h1: (x mod y = x)%Z). rewrite Zmod_small; auto with zarith. assert (h2: ((-x) mod y = y - x)%Z). rewrite Z_mod_nz_opp_full. rewrite h1; auto. rewrite h1; auto with zarith. unfold div. case Z_le_dec; auto with zarith. intros h3. rewrite Z_div_nz_opp_full; auto with zarith. rewrite Zdiv_small; auto with zarith. (* case x = y *) subst. assert (h1: (y mod y = 0)%Z). rewrite Z_mod_same_full; auto with zarith. assert (h2: ((-y) mod y = 0)%Z). rewrite Z_mod_zero_opp_full; auto with zarith. unfold div. case Z_le_dec; rewrite h2; auto with zarith. intro. rewrite Z_div_zero_opp_full; auto with zarith. rewrite Z_div_same_full; auto with zarith. Qed. (* Why3 goal *) Lemma Mod_0 : forall (y:Z), ~ (y = 0%Z) -> ((mod1 0%Z y) = 0%Z). intros y Hy. unfold mod1, div. rewrite Zmod_0_l. simpl. now rewrite Zdiv_0_l, Zmult_0_r. Qed. (* Why3 goal *) Lemma Div_1_left : forall (y:Z), (1%Z < y)%Z -> ((div 1%Z y) = 0%Z). intros y Hy. rewrite Div_inf; auto with zarith. Qed. (* Why3 goal *) Lemma Div_minus1_left : forall (y:Z), (1%Z < y)%Z -> ((div (-1%Z)%Z y) = (-1%Z)%Z). intros y Hy. unfold div. assert (h1: (1 mod y = 1)%Z). apply Zmod_1_l; auto. assert (h2: ((-(1)) mod y = y-1)%Z). rewrite Z_mod_nz_opp_full; auto with zarith. case Z_le_dec; auto with zarith. intro. rewrite Z_div_nz_opp_full; auto with zarith. rewrite Zdiv_small; auto with zarith. Qed. (* Why3 goal *) Lemma Mod_1_left : forall (y:Z), (1%Z < y)%Z -> ((mod1 1%Z y) = 1%Z). intros y Hy. unfold mod1. rewrite Div_1_left; auto with zarith. Qed. (* Why3 goal *) Lemma Mod_minus1_left : forall (y:Z), (1%Z < y)%Z -> ((mod1 (-1%Z)%Z y) = (y - 1%Z)%Z). intros y Hy. unfold mod1. rewrite Div_minus1_left; auto with zarith. Qed. Open Scope Z_scope. (* Why3 goal *) Lemma Div_mult : forall (x:Z) (y:Z) (z:Z), (0%Z < x)%Z -> ((div ((x * y)%Z + z)%Z x) = (y + (div z x))%Z). intros x y z h. unfold div. destruct (Z_le_dec 0 (z mod x)). destruct (Z_le_dec 0 ((x*y+z) mod x)). rewrite Zmult_comm. rewrite Z_div_plus_full_l; auto with zarith. generalize (Z_mod_lt (x * y + z) x); auto with zarith. generalize (Z_mod_lt z x); auto with zarith. Qed. (* Why3 goal *) Lemma Mod_mult : forall (x:Z) (y:Z) (z:Z), (0%Z < x)%Z -> ((mod1 ((x * y)%Z + z)%Z x) = (mod1 z x)). intros x y z h. unfold mod1. rewrite Div_mult. ring. auto with zarith. Qed. ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/int/Exponentiation.v��������������������������������0000666�0000000�0000000�00000007424�13571573400�022340� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. Section Exponentiation. (* Why3 goal *) Variable t : Type. Hypothesis t_WhyType : WhyType t. Existing Instance t_WhyType. (* Why3 goal *) Variable one: t. (* Why3 goal *) Variable infix_as: t -> t -> t. (* Why3 goal *) Hypothesis Assoc : forall (x:t) (y:t) (z:t), ((infix_as (infix_as x y) z) = (infix_as x (infix_as y z))). (* Why3 goal *) Hypothesis Unit_def_l : forall (x:t), ((infix_as one x) = x). (* Why3 goal *) Hypothesis Unit_def_r : forall (x:t), ((infix_as x one) = x). (* Why3 goal *) Definition power : t -> Z -> t. intros x n. exact (iter_nat (Z.abs_nat n) t (fun acc => infix_as x acc) one). Defined. (* Why3 goal *) Lemma Power_0 : forall (x:t), ((power x 0%Z) = one). Proof. easy. Qed. (* Why3 goal *) Lemma Power_s : forall (x:t) (n:Z), (0%Z <= n)%Z -> ((power x (n + 1%Z)%Z) = (infix_as x (power x n))). Proof. intros x n h1. unfold power. fold (Z.succ n). now rewrite Zabs_nat_Zsucc. Qed. (* Why3 goal *) Lemma Power_s_alt : forall (x:t) (n:Z), (0%Z < n)%Z -> ((power x n) = (infix_as x (power x (n - 1%Z)%Z))). Proof. intros x n h1. rewrite <- Power_s; auto with zarith. f_equal; omega. Qed. (* Why3 goal *) Lemma Power_1 : forall (x:t), ((power x 1%Z) = x). Proof. exact Unit_def_r. Qed. (* Why3 goal *) Lemma Power_sum : forall (x:t) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> ((power x (n + m)%Z) = (infix_as (power x n) (power x m))). Proof. intros x n m Hn Hm. revert n Hn. apply natlike_ind. apply sym_eq, Unit_def_l. intros n Hn IHn. replace (Z.succ n + m)%Z with ((n + m) + 1)%Z by ring. rewrite Power_s by auto with zarith. rewrite IHn. now rewrite <- Assoc, <- Power_s. Qed. (* Why3 goal *) Lemma Power_mult : forall (x:t) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> ((power x (n * m)%Z) = (power (power x n) m)). Proof. intros x n m Hn Hm. revert m Hm. apply natlike_ind. now rewrite Zmult_0_r, 2!Power_0. intros m Hm IHm. replace (n * Z.succ m)%Z with (n + n * m)%Z by ring. rewrite Power_sum by auto with zarith. rewrite IHm. now rewrite <- Power_s. Qed. (* Why3 goal *) Lemma Power_comm1 : forall (x:t) (y:t), ((infix_as x y) = (infix_as y x)) -> forall (n:Z), (0%Z <= n)%Z -> ((infix_as (power x n) y) = (infix_as y (power x n))). Proof. intros x y comm. apply natlike_ind. now rewrite Power_0, Unit_def_r, Unit_def_l. intros n Hn IHn. unfold Z.succ. rewrite (Power_s _ _ Hn). rewrite Assoc. rewrite IHn. rewrite <- Assoc. rewrite <- Assoc. now rewrite comm. Qed. (* Why3 goal *) Lemma Power_comm2 : forall (x:t) (y:t), ((infix_as x y) = (infix_as y x)) -> forall (n:Z), (0%Z <= n)%Z -> ((power (infix_as x y) n) = (infix_as (power x n) (power y n))). Proof. intros x y comm. apply natlike_ind. rewrite 3!Power_0. now rewrite Unit_def_r. intros n Hn IHn. unfold Z.succ. rewrite 3!(Power_s _ _ Hn). rewrite IHn. rewrite <- Assoc. rewrite (Assoc x). rewrite <- (Power_comm1 _ _ comm _ Hn). now rewrite <- 2!Assoc. Qed. End Exponentiation. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/int/Int.v�������������������������������������������0000666�0000000�0000000�00000007426�13571573400�020070� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. (* Why3 comment *) (* prefix_mn is replaced with (-x)%Z by the coq driver *) (* Why3 comment *) (* infix_pl is replaced with (x + x1)%Z by the coq driver *) (* Why3 comment *) (* infix_as is replaced with (x * x1)%Z by the coq driver *) (* Why3 comment *) (* infix_ls is replaced with (x < x1)%Z by the coq driver *) (* Why3 goal *) Lemma infix_mn_def : forall (x:Z) (y:Z), ((x - y)%Z = (x + (-y)%Z)%Z). reflexivity. Qed. (* Why3 goal *) Lemma infix_lseq_def : forall (x:Z) (y:Z), (x <= y)%Z <-> ((x < y)%Z \/ (x = y)). exact Zle_lt_or_eq_iff. Qed. (* Why3 goal *) Lemma Assoc : forall (x:Z) (y:Z) (z:Z), (((x + y)%Z + z)%Z = (x + (y + z)%Z)%Z). Proof. intros x y z. apply sym_eq. apply Zplus_assoc. Qed. (* Why3 goal *) Lemma Unit_def_l : forall (x:Z), ((0%Z + x)%Z = x). Proof. exact Zplus_0_l. Qed. (* Why3 goal *) Lemma Unit_def_r : forall (x:Z), ((x + 0%Z)%Z = x). Proof. exact Zplus_0_r. Qed. (* Why3 goal *) Lemma Inv_def_l : forall (x:Z), (((-x)%Z + x)%Z = 0%Z). Proof. exact Zplus_opp_l. Qed. (* Why3 goal *) Lemma Inv_def_r : forall (x:Z), ((x + (-x)%Z)%Z = 0%Z). Proof. exact Zplus_opp_r. Qed. (* Why3 goal *) Lemma Comm : forall (x:Z) (y:Z), ((x + y)%Z = (y + x)%Z). Proof. exact Zplus_comm. Qed. (* Why3 goal *) Lemma Assoc1 : forall (x:Z) (y:Z) (z:Z), (((x * y)%Z * z)%Z = (x * (y * z)%Z)%Z). Proof. intros x y z. apply sym_eq. apply Zmult_assoc. Qed. (* Why3 goal *) Lemma Mul_distr_l : forall (x:Z) (y:Z) (z:Z), ((x * (y + z)%Z)%Z = ((x * y)%Z + (x * z)%Z)%Z). Proof. intros x y z. apply Zmult_plus_distr_r. Qed. (* Why3 goal *) Lemma Mul_distr_r : forall (x:Z) (y:Z) (z:Z), (((y + z)%Z * x)%Z = ((y * x)%Z + (z * x)%Z)%Z). Proof. intros x y z. apply Zmult_plus_distr_l. Qed. (* Why3 goal *) Lemma Comm1 : forall (x:Z) (y:Z), ((x * y)%Z = (y * x)%Z). Proof. exact Zmult_comm. Qed. (* Why3 goal *) Lemma Unitary : forall (x:Z), ((1%Z * x)%Z = x). Proof. exact Zmult_1_l. Qed. (* Why3 goal *) Lemma NonTrivialRing : ~ (0%Z = 1%Z). Proof. discriminate. Qed. (* Why3 goal *) Lemma Refl : forall (x:Z), (x <= x)%Z. Proof. intros x. apply Z.le_refl. Qed. (* Why3 goal *) Lemma Trans : forall (x:Z) (y:Z) (z:Z), (x <= y)%Z -> (y <= z)%Z -> (x <= z)%Z. Proof. exact Z.le_trans. Qed. (* Why3 goal *) Lemma Antisymm : forall (x:Z) (y:Z), (x <= y)%Z -> (y <= x)%Z -> (x = y). Proof. exact Zle_antisym. Qed. (* Why3 goal *) Lemma Total : forall (x:Z) (y:Z), (x <= y)%Z \/ (y <= x)%Z. Proof. intros x y. destruct (Zle_or_lt x y) as [H|H]. left. assumption. right. now apply Zlt_le_weak. Qed. (* Why3 goal *) Lemma ZeroLessOne : (0%Z <= 1%Z)%Z. Proof. apply Zle_lt_or_eq_iff. now left. Qed. (* Why3 goal *) Lemma CompatOrderAdd : forall (x:Z) (y:Z) (z:Z), (x <= y)%Z -> ((x + z)%Z <= (y + z)%Z)%Z. Proof. exact Zplus_le_compat_r. Qed. (* Why3 goal *) Lemma CompatOrderMult : forall (x:Z) (y:Z) (z:Z), (x <= y)%Z -> (0%Z <= z)%Z -> ((x * z)%Z <= (y * z)%Z)%Z. Proof. exact Zmult_le_compat_r. Qed. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/int/MinMax.v����������������������������������������0000666�0000000�0000000�00000005016�13571573400�020520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. (* Why3 comment *) (* min is replaced with (ZArith.BinInt.Z.min x x1) by the coq driver *) (* Why3 goal *) Lemma min_def : forall (x:Z) (y:Z), ((x <= y)%Z -> ((ZArith.BinInt.Z.min x y) = x)) /\ (~ (x <= y)%Z -> ((ZArith.BinInt.Z.min x y) = y)). Proof. intros x y. split ; intros H. now apply Z.min_l. apply Z.min_r. omega. Qed. (* Why3 comment *) (* max is replaced with (ZArith.BinInt.Z.max x x1) by the coq driver *) (* Why3 goal *) Lemma max_def : forall (x:Z) (y:Z), ((x <= y)%Z -> ((ZArith.BinInt.Z.max x y) = y)) /\ (~ (x <= y)%Z -> ((ZArith.BinInt.Z.max x y) = x)). Proof. intros x y. split ; intros H. now apply Z.max_r. apply Z.max_l. omega. Qed. (* Why3 goal *) Lemma Min_r : forall (x:Z) (y:Z), (y <= x)%Z -> ((ZArith.BinInt.Z.min x y) = y). exact Z.min_r. Qed. (* Why3 goal *) Lemma Max_l : forall (x:Z) (y:Z), (y <= x)%Z -> ((ZArith.BinInt.Z.max x y) = x). exact Z.max_l. Qed. (* Why3 goal *) Lemma Min_comm : forall (x:Z) (y:Z), ((ZArith.BinInt.Z.min x y) = (ZArith.BinInt.Z.min y x)). exact Z.min_comm. Qed. (* Why3 goal *) Lemma Max_comm : forall (x:Z) (y:Z), ((ZArith.BinInt.Z.max x y) = (ZArith.BinInt.Z.max y x)). exact Z.max_comm. Qed. (* Why3 goal *) Lemma Min_assoc : forall (x:Z) (y:Z) (z:Z), ((ZArith.BinInt.Z.min (ZArith.BinInt.Z.min x y) z) = (ZArith.BinInt.Z.min x (ZArith.BinInt.Z.min y z))). Proof. intros x y z. apply eq_sym, Z.min_assoc. Qed. (* Why3 goal *) Lemma Max_assoc : forall (x:Z) (y:Z) (z:Z), ((ZArith.BinInt.Z.max (ZArith.BinInt.Z.max x y) z) = (ZArith.BinInt.Z.max x (ZArith.BinInt.Z.max y z))). Proof. intros x y z. apply eq_sym, Z.max_assoc. Qed. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/int/Power.v�����������������������������������������0000666�0000000�0000000�00000006604�13571573400�020427� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. Require Import Exponentiation. (* Why3 goal *) Notation power := Zpower. Lemma power_is_exponentiation : forall x n, (0 <= n)%Z -> power x n = Exponentiation.power _ 1%Z Zmult x n. Proof. intros x [|n|n] H. easy. 2: now elim H. unfold Exponentiation.power, power, Zpower_pos. now rewrite iter_nat_of_P. Qed. (* Why3 goal *) Lemma Power_0 : forall (x:Z), ((power x 0%Z) = 1%Z). Proof. intros x. apply refl_equal. Qed. (* Why3 goal *) Lemma Power_s : forall (x:Z) (n:Z), (0%Z <= n)%Z -> ((power x (n + 1%Z)%Z) = (x * (power x n))%Z). Proof. intros x n h1. rewrite Zpower_exp. change (power x 1) with (x * 1)%Z. ring. now apply Z.le_ge. easy. Qed. (* Why3 goal *) Lemma Power_s_alt : forall (x:Z) (n:Z), (0%Z < n)%Z -> ((power x n) = (x * (power x (n - 1%Z)%Z))%Z). intros x n h1. rewrite <- Power_s. f_equal; auto with zarith. omega. Qed. (* Why3 goal *) Lemma Power_1 : forall (x:Z), ((power x 1%Z) = x). Proof. exact Zmult_1_r. Qed. (* Why3 goal *) Lemma Power_sum : forall (x:Z) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> ((power x (n + m)%Z) = ((power x n) * (power x m))%Z). Proof. intros x n m Hn Hm. now apply Zpower_exp; apply Z.le_ge. Qed. (* Why3 goal *) Lemma Power_mult : forall (x:Z) (n:Z) (m:Z), (0%Z <= n)%Z -> (0%Z <= m)%Z -> ((power x (n * m)%Z) = (power (power x n) m)). Proof. intros x n m Hn Hm. rewrite 3!power_is_exponentiation ; auto with zarith. apply Power_mult ; auto with zarith. Qed. (* Why3 goal *) Lemma Power_comm1 : forall (x:Z) (y:Z), ((x * y)%Z = (y * x)%Z) -> forall (n:Z), (0%Z <= n)%Z -> (((power x n) * y)%Z = (y * (power x n))%Z). Proof. intros x y h1 n h2. auto with zarith. Qed. (* Why3 goal *) Lemma Power_comm2 : forall (x:Z) (y:Z), ((x * y)%Z = (y * x)%Z) -> forall (n:Z), (0%Z <= n)%Z -> ((power (x * y)%Z n) = ((power x n) * (power y n))%Z). Proof. intros x y h1 n h2. rewrite 3!power_is_exponentiation ; auto with zarith. apply Power_comm2 ; auto with zarith. Qed. (* Why3 goal *) Lemma Power_non_neg : forall (x:Z) (y:Z), ((0%Z <= x)%Z /\ (0%Z <= y)%Z) -> (0%Z <= (power x y))%Z. intros x y (h1,h2). now apply Z.pow_nonneg. Qed. (* Why3 goal *) Lemma Power_pos : forall (x:Z) (y:Z), ((0%Z < x)%Z /\ (0%Z <= y)%Z) -> (0%Z < (power x y))%Z. Proof. intros x y (h1,h2). eapply Z.pow_pos_nonneg; eauto. Qed. Open Scope Z_scope. (* Why3 goal *) Lemma Power_monotonic : forall (x:Z) (n:Z) (m:Z), ((0%Z < x)%Z /\ ((0%Z <= n)%Z /\ (n <= m)%Z)) -> ((power x n) <= (power x m))%Z. intros. apply Z.pow_le_mono_r; auto with zarith. Qed. ����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/map/������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017121� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/map/Const.v�����������������������������������������0000666�0000000�0000000�00000002077�13571573400�020404� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require HighOrd. Require map.Map. (* Why3 assumption *) Definition const {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b} (v:b) : a -> b := fun (us:a) => v. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/map/Map.v�������������������������������������������0000666�0000000�0000000�00000003551�13571573400�020031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require HighOrd. Require Import ClassicalEpsilon. (* Why3 assumption *) Definition map (a:Type) (b:Type) := a -> b. Global Instance map_WhyType : forall (a:Type) {a_WT:WhyType a} (b:Type) {b_WT:WhyType b}, WhyType (map a b). Proof. intros. repeat split. exact (fun _ => why_inhabitant). intros x y. apply excluded_middle_informative. Qed. (* Why3 goal *) Definition set {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b} : (a -> b) -> a -> b -> a -> b. Proof. intros m x y. intros x'. destruct (why_decidable_eq x x') as [H|H]. exact y. exact (m x'). Defined. (* Why3 goal *) Lemma set_def {a:Type} {a_WT:WhyType a} {b:Type} {b_WT:WhyType b} : forall (f:a -> b) (x:a) (v:b) (y:a), ((y = x) -> (((set f x v) y) = v)) /\ (~ (y = x) -> (((set f x v) y) = (f y))). Proof. intros f x v y. unfold set. case why_decidable_eq. intros <-. split ; try easy ; intros H ; now elim H. (* TODO: replace by easy after 8.4 *) intros H. split ; intros H'. now elim H. easy. Qed. �������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/�����������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017267� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/Abs.v������������������������������������������0000666�0000000�0000000�00000005323�13571573400�020166� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.Rbasic_fun. Require BuiltIn. Require real.Real. Import Rbasic_fun. (* Why3 comment *) (* abs is replaced with (Reals.Rbasic_fun.Rabs x) by the coq driver *) (* Why3 goal *) Lemma abs_def : forall (x:R), ((0%R <= x)%R -> ((Reals.Rbasic_fun.Rabs x) = x)) /\ (~ (0%R <= x)%R -> ((Reals.Rbasic_fun.Rabs x) = (-x)%R)). split ; intros H. apply Rabs_right. now apply Rle_ge. apply Rabs_left. now apply Rnot_le_lt. Qed. (* Why3 goal *) Lemma Abs_le : forall (x:R) (y:R), ((Reals.Rbasic_fun.Rabs x) <= y)%R <-> (((-y)%R <= x)%R /\ (x <= y)%R). intros x y. unfold Rabs. case Rcase_abs ; intros H ; (split ; [intros H0;split | intros (H0,H1)]). rewrite <- (Ropp_involutive x). now apply Ropp_le_contravar. apply Rlt_le. apply Rlt_le_trans with (1 := H). apply Rle_trans with (2 := H0). rewrite <- Ropp_0. apply Ropp_le_contravar. now apply Rlt_le. rewrite <- (Ropp_involutive y). now apply Ropp_le_contravar. apply Rge_le in H. apply Rle_trans with (2 := H). apply Rle_trans with (Ropp x). now apply Ropp_le_contravar. rewrite <- Ropp_0. now apply Ropp_le_contravar. exact H0. exact H1. Qed. (* Why3 goal *) Lemma Abs_pos : forall (x:R), (0%R <= (Reals.Rbasic_fun.Rabs x))%R. exact Rabs_pos. Qed. (* Why3 goal *) Lemma Abs_sum : forall (x:R) (y:R), ((Reals.Rbasic_fun.Rabs (x + y)%R) <= ((Reals.Rbasic_fun.Rabs x) + (Reals.Rbasic_fun.Rabs y))%R)%R. exact Rabs_triang. Qed. (* Why3 goal *) Lemma Abs_prod : forall (x:R) (y:R), ((Reals.Rbasic_fun.Rabs (x * y)%R) = ((Reals.Rbasic_fun.Rabs x) * (Reals.Rbasic_fun.Rabs y))%R). exact Rabs_mult. Qed. (* Why3 goal *) Lemma triangular_inequality : forall (x:R) (y:R) (z:R), ((Reals.Rbasic_fun.Rabs (x - z)%R) <= ((Reals.Rbasic_fun.Rabs (x - y)%R) + (Reals.Rbasic_fun.Rabs (y - z)%R))%R)%R. intros x y z. replace (x - z)%R with ((x - y) + (y - z))%R by ring. apply Rabs_triang. Qed. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/ExpLog.v���������������������������������������0000666�0000000�0000000�00000004302�13571573400�020653� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.Rtrigo_def. Require Reals.Rpower. Require BuiltIn. Require real.Real. Import Rtrigo_def. Import Rpower. (* Why3 comment *) (* exp is replaced with (Reals.Rtrigo_def.exp x) by the coq driver *) (* Why3 goal *) Lemma Exp_zero : ((Reals.Rtrigo_def.exp 0%R) = 1%R). exact exp_0. Qed. Require Import Exp_prop. (* Why3 goal *) Lemma Exp_sum : forall (x:R) (y:R), ((Reals.Rtrigo_def.exp (x + y)%R) = ((Reals.Rtrigo_def.exp x) * (Reals.Rtrigo_def.exp y))%R). exact exp_plus. Qed. (* Why3 comment *) (* log is replaced with (Reals.Rpower.ln x) by the coq driver *) (* Why3 goal *) Lemma Log_one : ((Reals.Rpower.ln 1%R) = 0%R). exact ln_1. Qed. (* Why3 goal *) Lemma Log_mul : forall (x:R) (y:R), ((0%R < x)%R /\ (0%R < y)%R) -> ((Reals.Rpower.ln (x * y)%R) = ((Reals.Rpower.ln x) + (Reals.Rpower.ln y))%R). intros x y (Hx,Hy). now apply ln_mult. Qed. (* Why3 goal *) Lemma Log_exp : forall (x:R), ((Reals.Rpower.ln (Reals.Rtrigo_def.exp x)) = x). exact ln_exp. Qed. (* Why3 goal *) Lemma Exp_log : forall (x:R), (0%R < x)%R -> ((Reals.Rtrigo_def.exp (Reals.Rpower.ln x)) = x). exact exp_ln. Qed. (* Why3 assumption *) Definition log2 (x:R) : R := ((Reals.Rpower.ln x) / (Reals.Rpower.ln 2%R))%R. (* Why3 assumption *) Definition log10 (x:R) : R := ((Reals.Rpower.ln x) / (Reals.Rpower.ln 10%R))%R. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/FromInt.v��������������������������������������0000666�0000000�0000000�00000003752�13571573400�021043� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require int.Int. Require real.Real. (* Why3 comment *) (* from_int is replaced with (BuiltIn.IZR x) by the coq driver *) (* Why3 goal *) Lemma Zero : ((BuiltIn.IZR 0%Z) = 0%R). Proof. split. Qed. (* Why3 goal *) Lemma One : ((BuiltIn.IZR 1%Z) = 1%R). Proof. split. Qed. (* Why3 goal *) Lemma Add : forall (x:Z) (y:Z), ((BuiltIn.IZR (x + y)%Z) = ((BuiltIn.IZR x) + (BuiltIn.IZR y))%R). Proof. exact plus_IZR. Qed. (* Why3 goal *) Lemma Sub : forall (x:Z) (y:Z), ((BuiltIn.IZR (x - y)%Z) = ((BuiltIn.IZR x) - (BuiltIn.IZR y))%R). Proof. exact minus_IZR. Qed. (* Why3 goal *) Lemma Mul : forall (x:Z) (y:Z), ((BuiltIn.IZR (x * y)%Z) = ((BuiltIn.IZR x) * (BuiltIn.IZR y))%R). Proof. exact mult_IZR. Qed. (* Why3 goal *) Lemma Neg : forall (x:Z), ((BuiltIn.IZR (-x)%Z) = (-(BuiltIn.IZR x))%R). Proof. exact opp_IZR. Qed. (* Why3 goal *) Lemma Injective : forall (x:Z) (y:Z), ((BuiltIn.IZR x) = (BuiltIn.IZR y)) -> (x = y). Proof. exact eq_IZR. Qed. (* Why3 goal *) Lemma Monotonic : forall (x:Z) (y:Z), (x <= y)%Z -> ((BuiltIn.IZR x) <= (BuiltIn.IZR y))%R. Proof. exact (IZR_le). Qed. ����������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/MinMax.v���������������������������������������0000666�0000000�0000000�00000006763�13571573400�020663� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require real.Real. Require Import Rbasic_fun. (* Why3 comment *) (* min is replaced with (Reals.Rbasic_fun.Rmin x x1) by the coq driver *) (* Why3 goal *) Lemma min_def : forall (x:R) (y:R), ((x <= y)%R -> ((Reals.Rbasic_fun.Rmin x y) = x)) /\ (~ (x <= y)%R -> ((Reals.Rbasic_fun.Rmin x y) = y)). Proof. intros x y. split ; intros H. now apply Rmin_left. apply Rmin_right. now apply Rlt_le, Rnot_le_lt. Qed. (* Why3 comment *) (* max is replaced with (Reals.Rbasic_fun.Rmax x x1) by the coq driver *) (* Why3 goal *) Lemma max_def : forall (x:R) (y:R), ((x <= y)%R -> ((Reals.Rbasic_fun.Rmax x y) = y)) /\ (~ (x <= y)%R -> ((Reals.Rbasic_fun.Rmax x y) = x)). Proof. intros x y. split ; intros H. now apply Rmax_right. apply Rmax_left. now apply Rlt_le, Rnot_le_lt. Qed. (* Why3 goal *) Lemma Min_r : forall (x:R) (y:R), (y <= x)%R -> ((Reals.Rbasic_fun.Rmin x y) = y). exact Rmin_right. Qed. (* Why3 goal *) Lemma Max_l : forall (x:R) (y:R), (y <= x)%R -> ((Reals.Rbasic_fun.Rmax x y) = x). exact Rmax_left. Qed. (* Why3 goal *) Lemma Min_comm : forall (x:R) (y:R), ((Reals.Rbasic_fun.Rmin x y) = (Reals.Rbasic_fun.Rmin y x)). exact Rmin_comm. Qed. (* Why3 goal *) Lemma Max_comm : forall (x:R) (y:R), ((Reals.Rbasic_fun.Rmax x y) = (Reals.Rbasic_fun.Rmax y x)). exact Rmax_comm. Qed. (* Why3 goal *) Lemma Min_assoc : forall (x:R) (y:R) (z:R), ((Reals.Rbasic_fun.Rmin (Reals.Rbasic_fun.Rmin x y) z) = (Reals.Rbasic_fun.Rmin x (Reals.Rbasic_fun.Rmin y z))). Proof. intros x y z. destruct (Rle_or_lt x y) as [Hxy|Hxy]. rewrite Rmin_left with (1 := Hxy). destruct (Rle_or_lt x z) as [Hxz|Hxz]. rewrite Rmin_left with (1 := Hxz). apply eq_sym, Rmin_left. now apply Rmin_case. rewrite (Rmin_right y z). reflexivity. apply Rlt_le. now apply Rlt_le_trans with x. rewrite (Rmin_right x y) by now apply Rlt_le. apply eq_sym, Rmin_right. apply Rlt_le. apply Rle_lt_trans with (2 := Hxy). apply Rmin_l. Qed. (* Why3 goal *) Lemma Max_assoc : forall (x:R) (y:R) (z:R), ((Reals.Rbasic_fun.Rmax (Reals.Rbasic_fun.Rmax x y) z) = (Reals.Rbasic_fun.Rmax x (Reals.Rbasic_fun.Rmax y z))). Proof. intros x y z. destruct (Rle_or_lt x y) as [Hxy|Hxy]. rewrite Rmax_right with (1 := Hxy). apply eq_sym, Rmax_right. apply Rle_trans with (1 := Hxy). apply Rmax_l. rewrite (Rmax_left x y) by now apply Rlt_le. destruct (Rle_or_lt x z) as [Hxz|Hxz]. rewrite Rmax_right with (1 := Hxz). rewrite Rmax_right. apply eq_sym, Rmax_right. apply Rlt_le. now apply Rlt_le_trans with x. apply Rle_trans with (1 := Hxz). apply Rmax_r. rewrite Rmax_left. apply eq_sym, Rmax_left. apply Rmax_case ; now apply Rlt_le. now apply Rlt_le. Qed. �������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/PowerReal.v������������������������������������0000666�0000000�0000000�00000006267�13571573400�021371� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.Rtrigo_def. Require Reals.Rpower. Require Reals.R_sqrt. Require BuiltIn. Require int.Int. Require int.Power. Require real.Real. Require real.FromInt. Require real.Square. Require real.ExpLog. Import Rpower. (* Why3 comment *) (* pow is replaced with (Reals.Rpower.Rpower x x1) by the coq driver *) (* Why3 goal *) Lemma Pow_def : forall (x:R) (y:R), (0%R < x)%R -> ((Reals.Rpower.Rpower x y) = (Reals.Rtrigo_def.exp (y * (Reals.Rpower.ln x))%R)). Proof. easy. Qed. (* Why3 goal *) Lemma Pow_pos : forall (x:R) (y:R), (0%R < x)%R -> (0%R < (Reals.Rpower.Rpower x y))%R. Proof. intros x y h1. apply Exp_prop.exp_pos. Qed. (* Why3 goal *) Lemma Pow_plus : forall (x:R) (y:R) (z:R), (0%R < z)%R -> ((Reals.Rpower.Rpower z (x + y)%R) = ((Reals.Rpower.Rpower z x) * (Reals.Rpower.Rpower z y))%R). Proof. intros x y z h1. now apply Rpower_plus. Qed. (* Why3 goal *) Lemma Pow_mult : forall (x:R) (y:R) (z:R), (0%R < x)%R -> ((Reals.Rpower.Rpower (Reals.Rpower.Rpower x y) z) = (Reals.Rpower.Rpower x (y * z)%R)). Proof. intros x y z h1. now apply Rpower_mult. Qed. (* Why3 goal *) Lemma Pow_x_zero : forall (x:R), (0%R < x)%R -> ((Reals.Rpower.Rpower x 0%R) = 1%R). Proof. intros x h1. now apply Rpower_O. Qed. (* Why3 goal *) Lemma Pow_x_one : forall (x:R), (0%R < x)%R -> ((Reals.Rpower.Rpower x 1%R) = x). Proof. intros x h1. now apply Rpower_1. Qed. (* Why3 goal *) Lemma Pow_one_y : forall (y:R), ((Reals.Rpower.Rpower 1%R y) = 1%R). Proof. intros y. unfold Rpower. rewrite ln_1. rewrite Rmult_0_r. now apply Rtrigo_def.exp_0. Qed. (* Why3 goal *) Lemma Pow_x_two : forall (x:R), (0%R < x)%R -> ((Reals.Rpower.Rpower x 2%R) = (Reals.RIneq.Rsqr x)). Proof. intros x h1. rewrite (Rpower_pow 2) by easy. simpl. now rewrite Rmult_1_r. Qed. (* Why3 goal *) Lemma Pow_half : forall (x:R), (0%R < x)%R -> ((Reals.Rpower.Rpower x (05 / 10)%R) = (Reals.R_sqrt.sqrt x)). Proof. intros x h1. replace (5 / 10)%R with (/ 2)%R by field. now apply Rpower_sqrt. Qed. (* Why3 goal *) Lemma pow_from_int : forall (x:Z) (y:Z), (0%Z < x)%Z -> (0%Z <= y)%Z -> ((Reals.Rpower.Rpower (BuiltIn.IZR x) (BuiltIn.IZR y)) = (BuiltIn.IZR (int.Power.power x y))). Proof. intros x y h1 h2. rewrite <- Z2Nat.id with (1 := h2). rewrite <- pow_IZR. rewrite <- INR_IZR_INZ. apply Rpower_pow. now apply (IZR_lt 0). Qed. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/Real.v�����������������������������������������0000666�0000000�0000000�00000012236�13571573400�020345� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. (* Why3 comment *) (* prefix_mn is replaced with (-x)%R by the coq driver *) (* Why3 comment *) (* infix_pl is replaced with (x + x1)%R by the coq driver *) (* Why3 comment *) (* infix_as is replaced with (x * x1)%R by the coq driver *) (* Why3 comment *) (* infix_ls is replaced with (x < x1)%R by the coq driver *) (* Why3 goal *) Lemma infix_lseq_def : forall (x:R) (y:R), (x <= y)%R <-> ((x < y)%R \/ (x = y)). Proof. reflexivity. Qed. (* Why3 goal *) Lemma Assoc : forall (x:R) (y:R) (z:R), (((x + y)%R + z)%R = (x + (y + z)%R)%R). Proof. exact Rplus_assoc. Qed. (* Why3 goal *) Lemma Unit_def_l : forall (x:R), ((0%R + x)%R = x). Proof. exact Rplus_0_l. Qed. (* Why3 goal *) Lemma Unit_def_r : forall (x:R), ((x + 0%R)%R = x). Proof. exact Rplus_0_r. Qed. (* Why3 goal *) Lemma Inv_def_l : forall (x:R), (((-x)%R + x)%R = 0%R). Proof. exact Rplus_opp_l. Qed. (* Why3 goal *) Lemma Inv_def_r : forall (x:R), ((x + (-x)%R)%R = 0%R). Proof. exact Rplus_opp_r. Qed. (* Why3 goal *) Lemma Comm : forall (x:R) (y:R), ((x + y)%R = (y + x)%R). Proof. exact Rplus_comm. Qed. (* Why3 goal *) Lemma Assoc1 : forall (x:R) (y:R) (z:R), (((x * y)%R * z)%R = (x * (y * z)%R)%R). Proof. exact Rmult_assoc. Qed. (* Why3 goal *) Lemma Mul_distr_l : forall (x:R) (y:R) (z:R), ((x * (y + z)%R)%R = ((x * y)%R + (x * z)%R)%R). Proof. intros x y z. apply Rmult_plus_distr_l. Qed. (* Why3 goal *) Lemma Mul_distr_r : forall (x:R) (y:R) (z:R), (((y + z)%R * x)%R = ((y * x)%R + (z * x)%R)%R). Proof. intros x y z. apply Rmult_plus_distr_r. Qed. (* Why3 goal *) Lemma Comm1 : forall (x:R) (y:R), ((x * y)%R = (y * x)%R). Proof. exact Rmult_comm. Qed. (* Why3 goal *) Lemma Unitary : forall (x:R), ((1%R * x)%R = x). Proof. exact Rmult_1_l. Qed. (* Why3 goal *) Lemma NonTrivialRing : ~ (0%R = 1%R). Proof. apply not_eq_sym. exact R1_neq_R0. Qed. (* Why3 comment *) (* inv is replaced with (Reals.Rdefinitions.Rinv x) by the coq driver *) (* Why3 goal *) Lemma Inverse : forall (x:R), ~ (x = 0%R) -> ((x * (Reals.Rdefinitions.Rinv x))%R = 1%R). Proof. exact Rinv_r. Qed. (* Why3 goal *) Lemma infix_mn_def : forall (x:R) (y:R), ((x - y)%R = (x + (-y)%R)%R). Proof. reflexivity. Qed. (* Why3 goal *) Lemma infix_sl_def : forall (x:R) (y:R), ((x / y)%R = (x * (Reals.Rdefinitions.Rinv y))%R). Proof. reflexivity. Qed. (* Why3 goal *) Lemma add_div : forall (x:R) (y:R) (z:R), ~ (z = 0%R) -> (((x + y)%R / z)%R = ((x / z)%R + (y / z)%R)%R). Proof. intros. field. assumption. Qed. (* Why3 goal *) Lemma sub_div : forall (x:R) (y:R) (z:R), ~ (z = 0%R) -> (((x - y)%R / z)%R = ((x / z)%R - (y / z)%R)%R). Proof. intros. field. assumption. Qed. (* Why3 goal *) Lemma neg_div : forall (x:R) (y:R), ~ (y = 0%R) -> (((-x)%R / y)%R = (-(x / y)%R)%R). Proof. intros. field. assumption. Qed. (* Why3 goal *) Lemma assoc_mul_div : forall (x:R) (y:R) (z:R), ~ (z = 0%R) -> (((x * y)%R / z)%R = (x * (y / z)%R)%R). Proof. intros x y z _. apply Rmult_assoc. Qed. (* Why3 goal *) Lemma assoc_div_mul : forall (x:R) (y:R) (z:R), (~ (y = 0%R) /\ ~ (z = 0%R)) -> (((x / y)%R / z)%R = (x / (y * z)%R)%R). Proof. intros x y z (Zy, Zz). unfold Rdiv. rewrite Rmult_assoc. now rewrite Rinv_mult_distr. Qed. (* Why3 goal *) Lemma assoc_div_div : forall (x:R) (y:R) (z:R), (~ (y = 0%R) /\ ~ (z = 0%R)) -> ((x / (y / z)%R)%R = ((x * z)%R / y)%R). Proof. intros x y z (Zy, Zz). field. now split. Qed. (* Why3 goal *) Lemma Refl : forall (x:R), (x <= x)%R. Proof. exact Rle_refl. Qed. (* Why3 goal *) Lemma Trans : forall (x:R) (y:R) (z:R), (x <= y)%R -> (y <= z)%R -> (x <= z)%R. Proof. exact Rle_trans. Qed. (* Why3 goal *) Lemma Antisymm : forall (x:R) (y:R), (x <= y)%R -> (y <= x)%R -> (x = y). Proof. exact Rle_antisym. Qed. (* Why3 goal *) Lemma Total : forall (x:R) (y:R), (x <= y)%R \/ (y <= x)%R. Proof. intros x y. destruct (Rle_or_lt x y) as [H|H]. now left. right. now apply Rlt_le. Qed. (* Why3 goal *) Lemma ZeroLessOne : (0%R <= 1%R)%R. Proof. exact Rle_0_1. Qed. (* Why3 goal *) Lemma CompatOrderAdd : forall (x:R) (y:R) (z:R), (x <= y)%R -> ((x + z)%R <= (y + z)%R)%R. Proof. intros x y z. exact (Rplus_le_compat_r z x y). Qed. (* Why3 goal *) Lemma CompatOrderMult : forall (x:R) (y:R) (z:R), (x <= y)%R -> (0%R <= z)%R -> ((x * z)%R <= (y * z)%R)%R. Proof. intros x y z H Zz. now apply Rmult_le_compat_r. Qed. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/RealInfix.v������������������������������������0000666�0000000�0000000�00000002053�13571573400�021337� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require BuiltIn. Require real.Real. (* Why3 goal *) Lemma infix_mndt_def : forall (x:R) (y:R), ((x - y)%R = (x + (-y)%R)%R). Proof. intros x y. reflexivity. Qed. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/Square.v���������������������������������������0000666�0000000�0000000�00000003751�13571573400�020724� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.R_sqrt. Require BuiltIn. Require real.Real. Import R_sqrt. (* Why3 goal *) Lemma sqr_def : forall (x:R), ((Reals.RIneq.Rsqr x) = (x * x)%R). reflexivity. Qed. (* Why3 comment *) (* sqrt is replaced with (Reals.R_sqrt.sqrt x) by the coq driver *) (* Why3 goal *) Lemma Sqrt_positive : forall (x:R), (0%R <= x)%R -> (0%R <= (Reals.R_sqrt.sqrt x))%R. intros x _. apply sqrt_pos. Qed. (* Why3 goal *) Lemma Sqrt_square : forall (x:R), (0%R <= x)%R -> ((Reals.RIneq.Rsqr (Reals.R_sqrt.sqrt x)) = x). exact sqrt_sqrt. Qed. (* Why3 goal *) Lemma Square_sqrt : forall (x:R), (0%R <= x)%R -> ((Reals.R_sqrt.sqrt (x * x)%R) = x). exact sqrt_square. Qed. (* Why3 goal *) Lemma Sqrt_mul : forall (x:R) (y:R), ((0%R <= x)%R /\ (0%R <= y)%R) -> ((Reals.R_sqrt.sqrt (x * y)%R) = ((Reals.R_sqrt.sqrt x) * (Reals.R_sqrt.sqrt y))%R). intros x y (hx & hy); now apply sqrt_mult. Qed. (* Why3 goal *) Lemma Sqrt_le : forall (x:R) (y:R), ((0%R <= x)%R /\ (x <= y)%R) -> ((Reals.R_sqrt.sqrt x) <= (Reals.R_sqrt.sqrt y))%R. intros x y (h1 & h2); apply sqrt_le_1; auto. apply Rle_trans with x; auto. Qed. �����������������������frama-c-20.0-Calcium/src/plugins/wp/share/coqwp/real/Trigonometry.v���������������������������������0000666�0000000�0000000�00000012071�13571573400�022161� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (**************************************************************************) (* This file is generated by Why3's Coq-realize driver *) (* Beware! Only edit allowed sections below *) Require Import BuiltIn. Require Reals.R_sqrt. Require Reals.Rbasic_fun. Require Reals.Rtrigo_def. Require Reals.Rtrigo1. Require Reals.Ratan. Require BuiltIn. Require real.Real. Require real.Abs. Require real.Square. Require Import Reals. (* Why3 comment *) (* cos is replaced with (Reals.Rtrigo_def.cos x) by the coq driver *) (* Why3 comment *) (* sin is replaced with (Reals.Rtrigo_def.sin x) by the coq driver *) (* Why3 goal *) Lemma Pythagorean_identity : forall (x:R), (((Reals.RIneq.Rsqr (Reals.Rtrigo_def.cos x)) + (Reals.RIneq.Rsqr (Reals.Rtrigo_def.sin x)))%R = 1%R). Proof. intros x. rewrite Rplus_comm. apply sin2_cos2. Qed. (* Why3 goal *) Lemma Cos_le_one : forall (x:R), ((Reals.Rbasic_fun.Rabs (Reals.Rtrigo_def.cos x)) <= 1%R)%R. Proof. intros x. apply Abs.Abs_le. apply COS_bound. Qed. (* Why3 goal *) Lemma Sin_le_one : forall (x:R), ((Reals.Rbasic_fun.Rabs (Reals.Rtrigo_def.sin x)) <= 1%R)%R. Proof. intros x. apply Abs.Abs_le. apply SIN_bound. Qed. (* Why3 goal *) Lemma Cos_0 : ((Reals.Rtrigo_def.cos 0%R) = 1%R). Proof. apply cos_0. Qed. (* Why3 goal *) Lemma Sin_0 : ((Reals.Rtrigo_def.sin 0%R) = 0%R). Proof. apply sin_0. Qed. (* Why3 comment *) (* pi is replaced with Reals.Rtrigo1.PI by the coq driver *) (* Why3 goal *) Lemma Pi_double_precision_bounds : ((7074237752028440 / 2251799813685248)%R < Reals.Rtrigo1.PI)%R /\ (Reals.Rtrigo1.PI < (7074237752028441 / 2251799813685248)%R)%R. Proof. replace PI with (4 * (PI / 4))%R by field. rewrite <- atan_1. admit. (* to avoid a dependency on CoqInterval *) (* Require Import Interval_tactic. split ; interval with (i_prec 55). *) Admitted. (* Why3 goal *) Lemma Cos_pi : ((Reals.Rtrigo_def.cos Reals.Rtrigo1.PI) = (-1%R)%R). Proof. apply cos_PI. Qed. (* Why3 goal *) Lemma Sin_pi : ((Reals.Rtrigo_def.sin Reals.Rtrigo1.PI) = 0%R). Proof. apply sin_PI. Qed. (* Why3 goal *) Lemma Cos_pi2 : ((Reals.Rtrigo_def.cos ((05 / 10)%R * Reals.Rtrigo1.PI)%R) = 0%R). Proof. replace (5 / 10 * PI)%R with (PI / 2)%R by field. apply cos_PI2. Qed. (* Why3 goal *) Lemma Sin_pi2 : ((Reals.Rtrigo_def.sin ((05 / 10)%R * Reals.Rtrigo1.PI)%R) = 1%R). Proof. replace (5 / 10 * PI)%R with (PI / 2)%R by field. apply sin_PI2. Qed. (* Why3 goal *) Lemma Cos_plus_pi : forall (x:R), ((Reals.Rtrigo_def.cos (x + Reals.Rtrigo1.PI)%R) = (-(Reals.Rtrigo_def.cos x))%R). Proof. intros x. apply neg_cos. Qed. (* Why3 goal *) Lemma Sin_plus_pi : forall (x:R), ((Reals.Rtrigo_def.sin (x + Reals.Rtrigo1.PI)%R) = (-(Reals.Rtrigo_def.sin x))%R). Proof. intros x. apply neg_sin. Qed. (* Why3 goal *) Lemma Cos_plus_pi2 : forall (x:R), ((Reals.Rtrigo_def.cos (x + ((05 / 10)%R * Reals.Rtrigo1.PI)%R)%R) = (-(Reals.Rtrigo_def.sin x))%R). Proof. intros x. rewrite cos_sin. replace (PI / 2 + (x + 5 / 10 * PI))%R with (x + PI)%R by field. apply neg_sin. Qed. (* Why3 goal *) Lemma Sin_plus_pi2 : forall (x:R), ((Reals.Rtrigo_def.sin (x + ((05 / 10)%R * Reals.Rtrigo1.PI)%R)%R) = (Reals.Rtrigo_def.cos x)). Proof. intros x. rewrite cos_sin. apply f_equal. field. Qed. (* Why3 goal *) Lemma Cos_neg : forall (x:R), ((Reals.Rtrigo_def.cos (-x)%R) = (Reals.Rtrigo_def.cos x)). Proof. intros x. apply cos_neg. Qed. (* Why3 goal *) Lemma Sin_neg : forall (x:R), ((Reals.Rtrigo_def.sin (-x)%R) = (-(Reals.Rtrigo_def.sin x))%R). Proof. intros x. apply sin_neg. Qed. (* Why3 goal *) Lemma Cos_sum : forall (x:R) (y:R), ((Reals.Rtrigo_def.cos (x + y)%R) = (((Reals.Rtrigo_def.cos x) * (Reals.Rtrigo_def.cos y))%R - ((Reals.Rtrigo_def.sin x) * (Reals.Rtrigo_def.sin y))%R)%R). Proof. intros x y. apply cos_plus. Qed. (* Why3 goal *) Lemma Sin_sum : forall (x:R) (y:R), ((Reals.Rtrigo_def.sin (x + y)%R) = (((Reals.Rtrigo_def.sin x) * (Reals.Rtrigo_def.cos y))%R + ((Reals.Rtrigo_def.cos x) * (Reals.Rtrigo_def.sin y))%R)%R). Proof. intros x y. apply sin_plus. Qed. (* Why3 goal *) Lemma tan_def : forall (x:R), ((Reals.Rtrigo1.tan x) = ((Reals.Rtrigo_def.sin x) / (Reals.Rtrigo_def.cos x))%R). Proof. intros x. apply eq_refl. Qed. (* Why3 comment *) (* atan is replaced with (Reals.Ratan.atan x) by the coq driver *) (* Why3 goal *) Lemma Tan_atan : forall (x:R), ((Reals.Rtrigo1.tan (Reals.Ratan.atan x)) = x). Proof. intros x. apply atan_right_inv. Qed. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/�����������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016147� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/ArcTrigo.mlw�����������������������������������������0000666�0000000�0000000�00000004427�13571573400�020411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_RealInfix_ must be appended to this file*) (** The theory real_Abs_ must be appended to this file*) (** The theory real_Square_ must be appended to this file*) (** The theory real_Trigonometry_ must be appended to this file*) logic asin : real -> real logic acos : real -> real axiom Sin_asin : (forall x:real. ((((-1.0) <= x) and (x <= 1.0)) -> (sin(asin(x)) = x))) axiom Cos_acos : (forall x:real. ((((-1.0) <= x) and (x <= 1.0)) -> (cos(acos(x)) = x))) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/Cbits.mlw��������������������������������������������0000666�0000000�0000000�00000047163�13571573400�017747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory Qed_ must be appended to this file*) (** The theory bool_Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory int_Abs_ must be appended to this file*) (** The theory int_ComputerDivision_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_RealInfix_ must be appended to this file*) (** The theory real_FromInt_ must be appended to this file*) (** The theory Cint_ must be appended to this file*) logic bit_testb : int, int -> bool logic bit_test : int, int -> prop logic lnot : int -> int logic ac land : int, int -> int logic ac lxor : int, int -> int logic ac lor : int, int -> int logic lsl : int, int -> int logic lsr : int, int -> int axiom lnot_bool : (lnot(0) = (-1)) axiom lnot_bool1 : (lnot((-1)) = 0) axiom land_idemp : (forall x:int [land(x, x)]. (land(x, x) = x)) axiom land_0 : (forall x:int [land(0, x)]. (land(0, x) = 0)) axiom land_0bis : (forall x:int [land(x, 0)]. (land(x, 0) = 0)) axiom land_1 : (forall x:int [land((-1), x)]. (land((-1), x) = x)) axiom land_1bis : (forall x:int [land(x, (-1))]. (land(x, (-1)) = x)) axiom lor_idemp : (forall x:int [lor(x, x)]. (lor(x, x) = x)) axiom lor_1 : (forall x:int [lor((-1), x)]. (lor((-1), x) = (-1))) axiom lor_1bis : (forall x:int [lor(x, (-1))]. (lor(x, (-1)) = (-1))) axiom lor_0 : (forall x:int [lor(0, x)]. (lor(0, x) = x)) axiom lor_0bis : (forall x:int [lor(x, 0)]. (lor(x, 0) = x)) axiom lxor_nilpotent : (forall x:int [lxor(x, x)]. (lxor(x, x) = 0)) axiom lxor_1 : (forall x:int [lxor((-1), x)]. (lxor((-1), x) = lnot(x))) axiom lxor_1bis : (forall x:int [lxor(x, (-1))]. (lxor(x, (-1)) = lnot(x))) axiom lxor_0 : (forall x:int [lxor(0, x)]. (lxor(0, x) = x)) axiom lxor_0bis : (forall x:int [lxor(x, 0)]. (lxor(x, 0) = x)) axiom bit_test_def : (forall x:int. forall k:int [bit_testb(x, k)]. ((bit_testb(x, k) = true) -> bit_test(x, k))) axiom bit_test_def1 : (forall x:int. forall k:int [bit_testb(x, k)]. (bit_test(x, k) -> (bit_testb(x, k) = true))) axiom bit_test_extraction : (forall x:int. forall k:int [land(x, lsl(1, k))| land(lsl(1, k), x)]. ((0 <= k) -> ((not (land(x, lsl(1, k)) = 0)) -> bit_test(x, k)))) axiom bit_test_extraction1 : (forall x:int. forall k:int [land(x, lsl(1, k))| land(lsl(1, k), x)]. ((0 <= k) -> (bit_test(x, k) -> (not (land(x, lsl(1, k)) = 0))))) axiom lsl_1_0 : (lsl(1, 0) = 1) axiom bit_test_extraction_bis : (forall x:int [land(x, 1)| land(1, x)]. ((not (land(1, x) = 0)) -> bit_test(x, 0))) axiom bit_test_extraction_bis_eq : (forall x:int [land(x, 1)| land(1, x)]. (bit_test(x, 0) -> (land(1, x) = 1))) axiom lnot_extraction : (forall x:int. forall i:int [bit_test(lnot(x), i)]. ((0 <= i) -> (bit_test(lnot(x), i) -> (not bit_test(x, i))))) axiom lnot_extraction1 : (forall x:int. forall i:int [bit_test(lnot(x), i)]. ((0 <= i) -> ((not bit_test(x, i)) -> bit_test(lnot(x), i)))) axiom land_extraction : (forall x:int. forall y:int. forall i:int [bit_test(land(x, y), i)]. ((0 <= i) -> (bit_test(land(x, y), i) -> bit_test(x, i)))) axiom land_extraction1 : (forall x:int. forall y:int. forall i:int [bit_test(land(x, y), i)]. ((0 <= i) -> (bit_test(land(x, y), i) -> bit_test(y, i)))) axiom land_extraction2 : (forall x:int. forall y:int. forall i:int [bit_test(land(x, y), i)]. ((0 <= i) -> ((bit_test(x, i) and bit_test(y, i)) -> bit_test(land(x, y), i)))) axiom lor_extraction : (forall x:int. forall y:int. forall i:int [bit_test(lor(x, y), i)]. ((0 <= i) -> (bit_test(lor(x, y), i) -> (bit_test(x, i) or bit_test(y, i))))) axiom lor_extraction1 : (forall x:int. forall y:int. forall i:int [bit_test(lor(x, y), i)]. ((0 <= i) -> ((bit_test(x, i) or bit_test(y, i)) -> bit_test(lor(x, y), i)))) axiom lxor_extraction : (forall x:int. forall y:int. forall i:int [bit_test(lxor(x, y), i)]. ((0 <= i) -> (bit_test(lxor(x, y), i) -> (bit_test(x, i) -> (not bit_test(y, i)))))) axiom lxor_extraction1 : (forall x:int. forall y:int. forall i:int [bit_test(lxor(x, y), i)]. ((0 <= i) -> (bit_test(lxor(x, y), i) -> ((not bit_test(y, i)) -> bit_test(x, i))))) axiom lxor_extraction2 : (forall x:int. forall y:int. forall i:int [bit_test(lxor(x, y), i)]. ((0 <= i) -> ((bit_test(x, i) <-> (not bit_test(y, i))) -> bit_test(lxor(x, y), i)))) axiom land_1_lsl_1 : (forall a:int. forall x:int. forall n:int [lsl(1, (1 + n)), lsl(1, n), ((2 * a) + land(1, x))]. ((0 <= n) -> ((a < lsl(1, n)) -> (((2 * a) + land(1, x)) < lsl(1, (1 + n)))))) axiom lsl_extraction_sup : (forall x:int. forall n:int. forall m:int [bit_test(lsl(x, n), m)]. ((0 <= n) -> ((0 <= m) -> ((n <= m) -> (bit_test(lsl(x, n), m) -> bit_test(x, (m - n))))))) axiom lsl_extraction_sup1 : (forall x:int. forall n:int. forall m:int [bit_test(lsl(x, n), m)]. ((0 <= n) -> ((0 <= m) -> ((n <= m) -> (bit_test(x, (m - n)) -> bit_test(lsl(x, n), m)))))) axiom lsl_extraction_inf : (forall x:int. forall n:int. forall m:int [bit_test(lsl(x, n), m)]. ((0 <= n) -> ((0 <= m) -> ((m < n) -> (not bit_test(lsl(x, n), m)))))) axiom lsr_extractionl : (forall x:int. forall n:int. forall m:int [bit_test(lsr(x, n), m)]. ((0 <= n) -> ((0 <= m) -> (bit_test(lsr(x, n), m) -> bit_test(x, (m + n)))))) axiom lsr_extractionl1 : (forall x:int. forall n:int. forall m:int [bit_test(lsr(x, n), m)]. ((0 <= n) -> ((0 <= m) -> (bit_test(x, (m + n)) -> bit_test(lsr(x, n), m))))) axiom lsl1_extraction : (forall i:int. forall j:int [bit_test(lsl(1, i), j)]. ((0 <= i) -> ((0 <= j) -> (bit_test(lsl(1, i), j) -> (i = j))))) axiom lsl1_extraction1 : (forall i:int. forall j:int [bit_test(lsl(1, i), j)]. ((0 <= i) -> ((0 <= j) -> ((i = j) -> bit_test(lsl(1, i), j))))) axiom to_uint8_extraction_sup : (forall x:int. forall i:int [is_uint8(x), bit_test(x, i)]. ((8 <= i) -> (is_uint8(x) -> (not bit_test(x, i))))) axiom to_uint8_extraction_inf : (forall x:int. forall i:int [bit_test(to_uint8(x), i)]. (((0 <= i) and (i < 8)) -> (bit_test(to_uint8(x), i) -> bit_test(x, i)))) axiom to_uint8_extraction_inf1 : (forall x:int. forall i:int [bit_test(to_uint8(x), i)]. (((0 <= i) and (i < 8)) -> (bit_test(x, i) -> bit_test(to_uint8(x), i)))) axiom to_uint16_extraction_sup : (forall x:int. forall i:int [is_uint16(x), bit_test(x, i)]. ((16 <= i) -> (is_uint16(x) -> (not bit_test(x, i))))) axiom to_uint16_extraction_inf : (forall x:int. forall i:int [bit_test(to_uint16(x), i)]. (((0 <= i) and (i < 16)) -> (bit_test(to_uint16(x), i) -> bit_test(x, i)))) axiom to_uint16_extraction_inf1 : (forall x:int. forall i:int [bit_test(to_uint16(x), i)]. (((0 <= i) and (i < 16)) -> (bit_test(x, i) -> bit_test(to_uint16(x), i)))) axiom to_uint32_extraction_sup : (forall x:int. forall i:int [is_uint32(x), bit_test(x, i)]. ((32 <= i) -> (is_uint32(x) -> (not bit_test(x, i))))) axiom to_uint32_extraction_inf : (forall x:int. forall i:int [bit_test(to_uint32(x), i)]. (((0 <= i) and (i < 32)) -> (bit_test(to_uint32(x), i) -> bit_test(x, i)))) axiom to_uint32_extraction_inf1 : (forall x:int. forall i:int [bit_test(to_uint32(x), i)]. (((0 <= i) and (i < 32)) -> (bit_test(x, i) -> bit_test(to_uint32(x), i)))) axiom to_uint64_extraction_sup : (forall x:int. forall i:int [is_uint64(x), bit_test(x, i)]. ((64 <= i) -> (is_uint64(x) -> (not bit_test(x, i))))) axiom to_uint64_extraction_inf : (forall x:int. forall i:int [bit_test(to_uint64(x), i)]. (((0 <= i) and (i < 64)) -> (bit_test(to_uint64(x), i) -> bit_test(x, i)))) axiom to_uint64_extraction_inf1 : (forall x:int. forall i:int [bit_test(to_uint64(x), i)]. (((0 <= i) and (i < 64)) -> (bit_test(x, i) -> bit_test(to_uint64(x), i)))) axiom to_sint8_extraction_sup : (forall x:int. forall i:int [is_sint8(x), bit_test(x, i)]. ((7 <= i) -> (is_sint8(x) -> (bit_test(x, i) -> (x < 0))))) axiom to_sint8_extraction_sup1 : (forall x:int. forall i:int [is_sint8(x), bit_test(x, i)]. ((7 <= i) -> (is_sint8(x) -> ((x < 0) -> bit_test(x, i))))) axiom to_sint8_extraction_inf : (forall x:int. forall i:int [bit_test(to_sint8(x), i)]. (((0 <= i) and (i < 7)) -> (bit_test(to_sint8(x), i) -> bit_test(x, i)))) axiom to_sint8_extraction_inf1 : (forall x:int. forall i:int [bit_test(to_sint8(x), i)]. (((0 <= i) and (i < 7)) -> (bit_test(x, i) -> bit_test(to_sint8(x), i)))) axiom to_sint16_extraction_sup : (forall x:int. forall i:int [is_sint16(x), bit_test(x, i)]. ((15 <= i) -> (is_sint16(x) -> (bit_test(x, i) -> (x < 0))))) axiom to_sint16_extraction_sup1 : (forall x:int. forall i:int [is_sint16(x), bit_test(x, i)]. ((15 <= i) -> (is_sint16(x) -> ((x < 0) -> bit_test(x, i))))) axiom to_sint16_extraction_inf : (forall x:int. forall i:int [bit_test(to_sint16(x), i)]. (((0 <= i) and (i < 15)) -> (bit_test(to_sint16(x), i) -> bit_test(x, i)))) axiom to_sint16_extraction_inf1 : (forall x:int. forall i:int [bit_test(to_sint16(x), i)]. (((0 <= i) and (i < 15)) -> (bit_test(x, i) -> bit_test(to_sint16(x), i)))) axiom to_sint32_extraction_sup : (forall x:int. forall i:int [is_sint32(x), bit_test(x, i)]. ((31 <= i) -> (is_sint32(x) -> (bit_test(x, i) -> (x < 0))))) axiom to_sint32_extraction_sup1 : (forall x:int. forall i:int [is_sint32(x), bit_test(x, i)]. ((31 <= i) -> (is_sint32(x) -> ((x < 0) -> bit_test(x, i))))) axiom to_sint32_extraction_inf : (forall x:int. forall i:int [bit_test(to_sint32(x), i)]. (((0 <= i) and (i < 31)) -> (bit_test(to_sint32(x), i) -> bit_test(x, i)))) axiom to_sint32_extraction_inf1 : (forall x:int. forall i:int [bit_test(to_sint32(x), i)]. (((0 <= i) and (i < 31)) -> (bit_test(x, i) -> bit_test(to_sint32(x), i)))) axiom to_sint64_extraction_sup : (forall x:int. forall i:int [is_sint64(x), bit_test(x, i)]. ((63 <= i) -> (is_sint64(x) -> (bit_test(x, i) -> (x < 0))))) axiom to_sint64_extraction_sup1 : (forall x:int. forall i:int [is_sint64(x), bit_test(x, i)]. ((63 <= i) -> (is_sint64(x) -> ((x < 0) -> bit_test(x, i))))) axiom to_sint64_extraction_inf : (forall x:int. forall i:int [bit_test(to_sint64(x), i)]. (((0 <= i) and (i < 63)) -> (bit_test(to_sint64(x), i) -> bit_test(x, i)))) axiom to_sint64_extraction_inf1 : (forall x:int. forall i:int [bit_test(to_sint64(x), i)]. (((0 <= i) and (i < 63)) -> (bit_test(x, i) -> bit_test(to_sint64(x), i)))) axiom is_uint_lxor : (forall n:int. forall x:int. forall y:int. (is_uint(n, x) -> (is_uint(n, y) -> (to_uint(n, lxor(x, y)) = lxor(x, y))))) axiom is_uint8_lxor : (forall x:int. forall y:int [to_uint8(lxor(x, y))]. (is_uint8(x) -> (is_uint8(y) -> (to_uint8(lxor(x, y)) = lxor(x, y))))) axiom is_uint8_lor : (forall x:int. forall y:int [to_uint8(lor(x, y))]. (is_uint8(x) -> (is_uint8(y) -> (to_uint8(lor(x, y)) = lor(x, y))))) axiom is_uint8_land : (forall x:int. forall y:int [to_uint8(land(x, y))]. (is_uint8(x) -> (is_uint8(y) -> (to_uint8(land(x, y)) = land(x, y))))) axiom is_uint8_lsr : (forall x:int. forall y:int [to_uint8(lsr(x, y))]. ((0 <= y) -> (is_uint8(x) -> (to_uint8(lsr(x, y)) = lsr(x, y))))) axiom is_uint8_lsl1_inf : (forall y:int [to_uint8(lsl(1, y))]. (((0 <= y) and (y < 8)) -> (to_uint8(lsl(1, y)) = lsl(1, y)))) axiom is_uint8_lsl1_sup : (forall y:int [to_uint8(lsl(1, y))]. ((8 <= y) -> (to_uint8(lsl(1, y)) = 0))) axiom is_uint16_lxor : (forall x:int. forall y:int [to_uint16(lxor(x, y))]. (is_uint16(x) -> (is_uint16(y) -> (to_uint16(lxor(x, y)) = lxor(x, y))))) axiom is_uint16_lor : (forall x:int. forall y:int [to_uint16(lor(x, y))]. (is_uint16(x) -> (is_uint16(y) -> (to_uint16(lor(x, y)) = lor(x, y))))) axiom is_uint16_land : (forall x:int. forall y:int [to_uint16(land(x, y))]. (is_uint16(x) -> (is_uint16(y) -> (to_uint16(land(x, y)) = land(x, y))))) axiom is_uint16_lsr : (forall x:int. forall y:int [to_uint16(lsr(x, y))]. ((0 <= y) -> (is_uint16(x) -> (to_uint16(lsr(x, y)) = lsr(x, y))))) axiom is_uint16_lsl1_inf : (forall y:int [to_uint16(lsl(1, y))]. (((0 <= y) and (y < 16)) -> (to_uint16(lsl(1, y)) = lsl(1, y)))) axiom is_uint16_lsl1_sup : (forall y:int [to_uint16(lsl(1, y))]. ((16 <= y) -> (to_uint16(lsl(1, y)) = 0))) axiom is_uint32_lxor : (forall x:int. forall y:int [to_uint32(lxor(x, y))]. (is_uint32(x) -> (is_uint32(y) -> (to_uint32(lxor(x, y)) = lxor(x, y))))) axiom is_uint32_lor : (forall x:int. forall y:int [to_uint32(lor(x, y))]. (is_uint32(x) -> (is_uint32(y) -> (to_uint32(lor(x, y)) = lor(x, y))))) axiom is_uint32_land : (forall x:int. forall y:int [to_uint32(land(x, y))]. (is_uint32(x) -> (is_uint32(y) -> (to_uint32(land(x, y)) = land(x, y))))) axiom is_uint32_lsr : (forall x:int. forall y:int [to_uint32(lsr(x, y))]. ((0 <= y) -> (is_uint32(x) -> (to_uint32(lsr(x, y)) = lsr(x, y))))) axiom is_uint32_lsl1_inf : (forall y:int [to_uint32(lsl(1, y))]. (((0 <= y) and (y < 32)) -> (to_uint32(lsl(1, y)) = lsl(1, y)))) axiom is_uint32_lsl1_sup : (forall y:int [to_uint32(lsl(1, y))]. ((32 <= y) -> (to_uint32(lsl(1, y)) = 0))) axiom is_uint64_lxor : (forall x:int. forall y:int [to_uint64(lxor(x, y))]. (is_uint64(x) -> (is_uint64(y) -> (to_uint64(lxor(x, y)) = lxor(x, y))))) axiom is_uint64_lor : (forall x:int. forall y:int [to_uint64(lor(x, y))]. (is_uint64(x) -> (is_uint64(y) -> (to_uint64(lor(x, y)) = lor(x, y))))) axiom is_uint64_land : (forall x:int. forall y:int [to_uint64(land(x, y))]. (is_uint64(x) -> (is_uint64(y) -> (to_uint64(land(x, y)) = land(x, y))))) axiom is_uint64_lsr : (forall x:int. forall y:int [to_uint64(lsr(x, y))]. ((0 <= y) -> (is_uint64(x) -> (to_uint64(lsr(x, y)) = lsr(x, y))))) axiom is_uint64_lsl1_inf : (forall y:int [to_uint64(lsl(1, y))]. (((0 <= y) and (y < 64)) -> (to_uint64(lsl(1, y)) = lsl(1, y)))) axiom is_uint64_lsl1_sup : (forall y:int [to_uint64(lsl(1, y))]. ((64 <= y) -> (to_uint64(lsl(1, y)) = 0))) axiom is_sint8_lnot : (forall x:int [to_sint8(lnot(x))]. (is_sint8(x) -> (to_sint8(lnot(x)) = lnot(x)))) axiom is_sint8_lxor : (forall x:int. forall y:int [to_sint8(lxor(x, y))]. (is_sint8(x) -> (is_sint8(y) -> (to_sint8(lxor(x, y)) = lxor(x, y))))) axiom is_sint8_lor : (forall x:int. forall y:int [to_sint8(lor(x, y))]. (is_sint8(x) -> (is_sint8(y) -> (to_sint8(lor(x, y)) = lor(x, y))))) axiom is_sint8_land : (forall x:int. forall y:int [to_sint8(land(x, y))]. (is_sint8(x) -> (is_sint8(y) -> (to_sint8(land(x, y)) = land(x, y))))) axiom is_sint8_lsr : (forall x:int. forall y:int [to_sint8(lsr(x, y))]. ((0 <= y) -> (is_sint8(x) -> (to_sint8(lsr(x, y)) = lsr(x, y))))) axiom is_sint8_lsl1 : (lsl(1, 7) = 128) axiom is_sint8_lsl1_inf : (forall y:int [to_sint8(lsl(1, y))]. (((0 <= y) and (y < 7)) -> (to_sint8(lsl(1, y)) = lsl(1, y)))) axiom is_sint8_lsl1_sup : (forall y:int [to_sint8(lsl(1, y))]. ((8 <= y) -> (to_sint8(lsl(1, y)) = 0))) axiom is_sint16_lnot : (forall x:int [to_sint16(lnot(x))]. (is_sint16(x) -> (to_sint16(lnot(x)) = lnot(x)))) axiom is_sint16_lxor : (forall x:int. forall y:int [to_sint16(lxor(x, y))]. (is_sint16(x) -> (is_sint16(y) -> (to_sint16(lxor(x, y)) = lxor(x, y))))) axiom is_sint16_lor : (forall x:int. forall y:int [to_sint16(lor(x, y))]. (is_sint16(x) -> (is_sint16(y) -> (to_sint16(lor(x, y)) = lor(x, y))))) axiom is_sint16_land : (forall x:int. forall y:int [to_sint16(land(x, y))]. (is_sint16(x) -> (is_sint16(y) -> (to_sint16(land(x, y)) = land(x, y))))) axiom is_sint16_lsr : (forall x:int. forall y:int [to_sint16(lsr(x, y))]. ((0 <= y) -> (is_sint16(x) -> (to_sint16(lsr(x, y)) = lsr(x, y))))) axiom is_sint16_lsl1 : (lsl(1, 15) = 32768) axiom is_sint16_lsl1_inf : (forall y:int [to_sint16(lsl(1, y))]. (((0 <= y) and (y < 15)) -> (to_sint16(lsl(1, y)) = lsl(1, y)))) axiom is_sint16_lsl1_sup : (forall y:int [to_sint16(lsl(1, y))]. ((16 <= y) -> (to_sint16(lsl(1, y)) = 0))) axiom is_sint32_lnot : (forall x:int [to_sint32(lnot(x))]. (is_sint32(x) -> (to_sint32(lnot(x)) = lnot(x)))) axiom is_sint32_lxor : (forall x:int. forall y:int [to_sint32(lxor(x, y))]. (is_sint32(x) -> (is_sint32(y) -> (to_sint32(lxor(x, y)) = lxor(x, y))))) axiom is_sint32_lor : (forall x:int. forall y:int [to_sint32(lor(x, y))]. (is_sint32(x) -> (is_sint32(y) -> (to_sint32(lor(x, y)) = lor(x, y))))) axiom is_sint32_land : (forall x:int. forall y:int [to_sint32(land(x, y))]. (is_sint32(x) -> (is_sint32(y) -> (to_sint32(land(x, y)) = land(x, y))))) axiom is_sint32_lsr : (forall x:int. forall y:int [to_sint32(lsr(x, y))]. ((0 <= y) -> (is_sint32(x) -> (to_sint32(lsr(x, y)) = lsr(x, y))))) axiom is_sint32_lsl1 : (lsl(1, 31) = 2147483648) axiom is_sint32_lsl1_inf : (forall y:int [to_sint32(lsl(1, y))]. (((0 <= y) and (y < 31)) -> (to_sint32(lsl(1, y)) = lsl(1, y)))) axiom is_sint32_lsl1_sup : (forall y:int [to_sint32(lsl(1, y))]. ((32 <= y) -> (to_sint32(lsl(1, y)) = 0))) axiom is_sint64_lnot : (forall x:int [to_sint64(lnot(x))]. (is_sint64(x) -> (to_sint64(lnot(x)) = lnot(x)))) axiom is_sint64_lxor : (forall x:int. forall y:int [to_sint64(lxor(x, y))]. (is_sint64(x) -> (is_sint64(y) -> (to_sint64(lxor(x, y)) = lxor(x, y))))) axiom is_sint64_lor : (forall x:int. forall y:int [to_sint64(lor(x, y))]. (is_sint64(x) -> (is_sint64(y) -> (to_sint64(lor(x, y)) = lor(x, y))))) axiom is_sint64_land : (forall x:int. forall y:int [to_sint64(land(x, y))]. (is_sint64(x) -> (is_sint64(y) -> (to_sint64(land(x, y)) = land(x, y))))) axiom is_sint64_lsr : (forall x:int. forall y:int [to_sint64(lsr(x, y))]. ((0 <= y) -> (is_sint64(x) -> (to_sint64(lsr(x, y)) = lsr(x, y))))) axiom is_sint64_lsl1 : (lsl(1, 63) = 9223372036854775808) axiom is_sint64_lsl1_inf : (forall y:int [to_sint64(lsl(1, y))]. (((0 <= y) and (y < 63)) -> (to_sint64(lsl(1, y)) = lsl(1, y)))) axiom is_sint64_lsl1_sup : (forall y:int [to_sint64(lsl(1, y))]. ((64 <= y) -> (to_sint64(lsl(1, y)) = 0))) axiom lor_addition : (forall x:int. forall y:int [land(x, y), lor(x, y)]. ((land(x, y) = 0) -> ((x + y) = lor(x, y)))) axiom lxor_addition : (forall x:int. forall y:int [land(x, y), lxor(x, y)]. ((land(x, y) = 0) -> ((x + y) = lxor(x, y)))) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/Cfloat.mlw�������������������������������������������0000666�0000000�0000000�00000034334�13571573400�020107� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory bool_Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_RealInfix_ must be appended to this file*) (** The theory real_Abs_ must be appended to this file*) (** The theory real_FromInt_ must be appended to this file*) (** The theory real_Square_ must be appended to this file*) type f32 type f64 logic to_f32 : real -> f32 logic of_f32 : f32 -> real logic to_f64 : real -> f64 logic of_f64 : f64 -> real axiom to_f32_zero : (of_f32(to_f32(0.0)) = 0.0) axiom to_f32_one : (of_f32(to_f32(1.0)) = 1.0) axiom to_f64_zero : (of_f64(to_f64(0.0)) = 0.0) axiom to_f64_one : (of_f64(to_f64(1.0)) = 1.0) type rounding_mode = Up | Down | ToZero | NearestTiesToAway | NearestTiesToEven logic match_rounding_mode : rounding_mode, 'a, 'a, 'a, 'a, 'a -> 'a axiom match_rounding_mode_Up : (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. (match_rounding_mode(Up, z, z1, z2, z3, z4) = z)) axiom match_rounding_mode_Down : (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. (match_rounding_mode(Down, z, z1, z2, z3, z4) = z1)) axiom match_rounding_mode_ToZero : (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. (match_rounding_mode(ToZero, z, z1, z2, z3, z4) = z2)) axiom match_rounding_mode_NearestTiesToAway : (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. (match_rounding_mode(NearestTiesToAway, z, z1, z2, z3, z4) = z3)) axiom match_rounding_mode_NearestTiesToEven : (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. (match_rounding_mode(NearestTiesToEven, z, z1, z2, z3, z4) = z4)) logic round_float : rounding_mode, real -> f32 logic round_double : rounding_mode, real -> f64 axiom float_32 : (forall x:real [round_float(NearestTiesToEven, x)]. (to_f32(x) = round_float(NearestTiesToEven, x))) axiom float_64 : (forall x:real [round_double(NearestTiesToEven, x)]. (to_f64(x) = round_double(NearestTiesToEven, x))) type float_kind = Finite | NaN | Inf_pos | Inf_neg logic match_float_kind : float_kind, 'a, 'a, 'a, 'a -> 'a axiom match_float_kind_Finite : (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. (match_float_kind(Finite, z, z1, z2, z3) = z)) axiom match_float_kind_NaN : (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. (match_float_kind(NaN, z, z1, z2, z3) = z1)) axiom match_float_kind_Inf_pos : (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. (match_float_kind(Inf_pos, z, z1, z2, z3) = z2)) axiom match_float_kind_Inf_neg : (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. (match_float_kind(Inf_neg, z, z1, z2, z3) = z3)) logic classify_f32 : f32 -> float_kind logic classify_f64 : f64 -> float_kind predicate is_finite_f32(f: f32) = (classify_f32(f) = Finite) predicate is_finite_f64(d: f64) = (classify_f64(d) = Finite) predicate is_NaN_f32(f: f32) = (classify_f32(f) = NaN) predicate is_NaN_f64(d: f64) = (classify_f64(d) = NaN) predicate is_infinite_f32(f: f32) = ((classify_f32(f) = Inf_pos) or (classify_f32(f) = Inf_neg)) predicate is_infinite_f64(d: f64) = ((classify_f64(d) = Inf_pos) or (classify_f64(d) = Inf_neg)) predicate is_positive_infinite_f32(f: f32) = (classify_f32(f) = Inf_pos) predicate is_positive_infinite_f64(d: f64) = (classify_f64(d) = Inf_pos) predicate is_negative_infinite_f32(f: f32) = (classify_f32(f) = Inf_neg) predicate is_negative_infinite_f64(d: f64) = (classify_f64(d) = Inf_neg) axiom is_finite_to_float_32 : (forall x:real [is_finite_f32(to_f32(x))]. is_finite_f32(to_f32(x))) axiom is_finite_to_float_64 : (forall x:real [is_finite_f64(to_f64(x))]. is_finite_f64(to_f64(x))) axiom to_float_is_finite_32 : (forall f:f32 [to_f32(of_f32(f))| is_finite_f32(f)]. (is_finite_f32(f) -> (to_f32(of_f32(f)) = f))) axiom to_float_is_finite_64 : (forall d:f64 [to_f64(of_f64(d))| is_finite_f64(d)]. (is_finite_f64(d) -> (to_f64(of_f64(d)) = d))) predicate finite(x: real) = (is_finite_f32(to_f32(x)) and is_finite_f64(to_f64(x))) axiom finite_small_f32 : (forall x:real. ((((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0) <= x) and (x <= 340282346600000016151267322115014000640.0)) -> is_finite_f32(to_f32(x)))) axiom finite_small_f64 : (forall x:real. ((((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0) <= x) and (x <= 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0)) -> is_finite_f64(to_f64(x)))) axiom finite_range_f32 : (forall f:f32. (is_finite_f32(f) -> ((-340282346600000016151267322115014000640.0) <= of_f32(f)))) axiom finite_range_f321 : (forall f:f32. (is_finite_f32(f) -> (of_f32(f) <= 340282346600000016151267322115014000640.0))) axiom finite_range_f322 : (forall f:f32. ((((-340282346600000016151267322115014000640.0) <= of_f32(f)) and (of_f32(f) <= 340282346600000016151267322115014000640.0)) -> is_finite_f32(f))) axiom finite_range_f64 : (forall d:f64. (is_finite_f64(d) -> ((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0) <= of_f64(d)))) axiom finite_range_f641 : (forall d:f64. (is_finite_f64(d) -> (of_f64(d) <= 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0))) axiom finite_range_f642 : (forall d:f64. ((((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0) <= of_f64(d)) and (of_f64(d) <= 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0)) -> is_finite_f64(d))) logic eq_f32b : f32, f32 -> bool logic eq_f64b : f64, f64 -> bool predicate eq_f32(x: f32, y: f32) = (eq_f32b(x, y) = true) predicate eq_f64(x: f64, y: f64) = (eq_f64b(x, y) = true) axiom eq_finite_f32 : (forall x:f32. forall y:f32 [eq_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> (eq_f32(x, y) -> (of_f32(x) = of_f32(y)))))) axiom eq_finite_f321 : (forall x:f32. forall y:f32 [eq_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> ((of_f32(x) = of_f32(y)) -> eq_f32(x, y))))) axiom eq_finite_f64 : (forall x:f64. forall y:f64 [eq_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> (eq_f64(x, y) -> (of_f64(x) = of_f64(y)))))) axiom eq_finite_f641 : (forall x:f64. forall y:f64 [eq_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> ((of_f64(x) = of_f64(y)) -> eq_f64(x, y))))) logic ne_f32b : f32, f32 -> bool logic ne_f64b : f64, f64 -> bool predicate ne_f32(x: f32, y: f32) = (ne_f32b(x, y) = true) predicate ne_f64(x: f64, y: f64) = (ne_f64b(x, y) = true) axiom ne_finite_f32 : (forall x:f32. forall y:f32 [ne_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> (ne_f32(x, y) -> (not (of_f32(x) = of_f32(y))))))) axiom ne_finite_f321 : (forall x:f32. forall y:f32 [ne_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> ((not (of_f32(x) = of_f32(y))) -> ne_f32(x, y))))) axiom ne_finite_f64 : (forall x:f64. forall y:f64 [ne_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> (ne_f64(x, y) -> (not (of_f64(x) = of_f64(y))))))) axiom ne_finite_f641 : (forall x:f64. forall y:f64 [ne_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> ((not (of_f64(x) = of_f64(y))) -> ne_f64(x, y))))) logic le_f32b : f32, f32 -> bool logic le_f64b : f64, f64 -> bool predicate le_f32(x: f32, y: f32) = (le_f32b(x, y) = true) predicate le_f64(x: f64, y: f64) = (le_f64b(x, y) = true) axiom le_finite_f32 : (forall x:f32. forall y:f32 [le_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> (le_f32(x, y) -> (of_f32(x) <= of_f32(y)))))) axiom le_finite_f321 : (forall x:f32. forall y:f32 [le_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> ((of_f32(x) <= of_f32(y)) -> le_f32(x, y))))) axiom le_finite_f64 : (forall x:f64. forall y:f64 [le_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> (le_f64(x, y) -> (of_f64(x) <= of_f64(y)))))) axiom le_finite_f641 : (forall x:f64. forall y:f64 [le_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> ((of_f64(x) <= of_f64(y)) -> le_f64(x, y))))) logic lt_f32b : f32, f32 -> bool logic lt_f64b : f64, f64 -> bool predicate lt_f32(x: f32, y: f32) = (lt_f32b(x, y) = true) predicate lt_f64(x: f64, y: f64) = (lt_f64b(x, y) = true) axiom lt_finite_f32 : (forall x:f32. forall y:f32 [lt_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> (lt_f32(x, y) -> (of_f32(x) < of_f32(y)))))) axiom lt_finite_f321 : (forall x:f32. forall y:f32 [lt_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> ((of_f32(x) < of_f32(y)) -> lt_f32(x, y))))) axiom lt_finite_f64 : (forall x:f64. forall y:f64 [lt_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> (lt_f64(x, y) -> (of_f64(x) < of_f64(y)))))) axiom lt_finite_f641 : (forall x:f64. forall y:f64 [lt_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> ((of_f64(x) < of_f64(y)) -> lt_f64(x, y))))) logic neg_f32 : f32 -> f32 logic neg_f64 : f64 -> f64 axiom neg_finite_f32 : (forall x:f32 [neg_f32(x)]. (is_finite_f32(x) -> (of_f32(neg_f32(x)) = (-of_f32(x))))) axiom neg_finite_f64 : (forall x:f64 [neg_f64(x)]. (is_finite_f64(x) -> (of_f64(neg_f64(x)) = (-of_f64(x))))) logic add_f32 : f32, f32 -> f32 logic add_f64 : f64, f64 -> f64 axiom add_finite_f32 : (forall x:f32. forall y:f32 [add_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> (add_f32(x, y) = to_f32((of_f32(x) + of_f32(y))))))) axiom add_finite_f64 : (forall x:f64. forall y:f64 [add_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> (add_f64(x, y) = to_f64((of_f64(x) + of_f64(y))))))) logic mul_f32 : f32, f32 -> f32 logic mul_f64 : f64, f64 -> f64 axiom mul_finite_f32 : (forall x:f32. forall y:f32 [mul_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> (mul_f32(x, y) = to_f32((of_f32(x) * of_f32(y))))))) axiom mul_finite_f64 : (forall x:f64. forall y:f64 [mul_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> (mul_f64(x, y) = to_f64((of_f64(x) * of_f64(y))))))) logic div_f32 : f32, f32 -> f32 logic div_f64 : f64, f64 -> f64 axiom div_finite_f32 : (forall x:f32. forall y:f32 [div_f32(x, y)]. (is_finite_f32(x) -> (is_finite_f32(y) -> (div_f32(x, y) = to_f32((of_f32(x) / of_f32(y))))))) axiom div_finite_f64 : (forall x:f64. forall y:f64 [div_f64(x, y)]. (is_finite_f64(x) -> (is_finite_f64(y) -> (div_f64(x, y) = to_f64((of_f64(x) / of_f64(y))))))) logic sqrt_f32 : f32 -> f32 logic sqrt_f64 : f64 -> f64 axiom sqrt_finite_f32 : (forall x:f32 [sqrt_f32(x)]. (is_finite_f32(x) -> (sqrt_f32(x) = to_f32(sqrt(of_f32(x)))))) axiom sqrt_finite_f64 : (forall x:f64 [sqrt_f64(x)]. (is_finite_f64(x) -> (sqrt_f64(x) = to_f64(sqrt(of_f64(x)))))) logic model_f32 : f32 -> real function delta_f32(f: f32) : real = abs_real((of_f32(f) - model_f32(f))) function error_f32(f: f32) : real = (delta_f32(f) / abs_real(model_f32(f))) logic model_f64 : f64 -> real function delta_f64(f: f64) : real = abs_real((of_f64(f) - model_f64(f))) function error_f64(f: f64) : real = (delta_f64(f) / abs_real(model_f64(f))) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/Cint.mlw���������������������������������������������0000666�0000000�0000000�00000015651�13571573400�017575� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory bool_Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) predicate is_bool(x: int) = ((x = 0) or (x = 1)) logic is_uint8 : int -> prop axiom is_uint8_def : (forall x:int [is_uint8(x)]. (is_uint8(x) -> (0 <= x))) axiom is_uint8_def1 : (forall x:int [is_uint8(x)]. (is_uint8(x) -> (x < 256))) axiom is_uint8_def2 : (forall x:int [is_uint8(x)]. (((0 <= x) and (x < 256)) -> is_uint8(x))) logic is_sint8 : int -> prop axiom is_sint8_def : (forall x:int [is_sint8(x)]. (is_sint8(x) -> ((-128) <= x))) axiom is_sint8_def1 : (forall x:int [is_sint8(x)]. (is_sint8(x) -> (x < 128))) axiom is_sint8_def2 : (forall x:int [is_sint8(x)]. ((((-128) <= x) and (x < 128)) -> is_sint8(x))) logic is_uint16 : int -> prop axiom is_uint16_def : (forall x:int [is_uint16(x)]. (is_uint16(x) -> (0 <= x))) axiom is_uint16_def1 : (forall x:int [is_uint16(x)]. (is_uint16(x) -> (x < 65536))) axiom is_uint16_def2 : (forall x:int [is_uint16(x)]. (((0 <= x) and (x < 65536)) -> is_uint16(x))) predicate is_sint16(x: int) = (((-32768) <= x) and (x < 32768)) logic is_uint32 : int -> prop axiom is_uint32_def : (forall x:int [is_uint32(x)]. (is_uint32(x) -> (0 <= x))) axiom is_uint32_def1 : (forall x:int [is_uint32(x)]. (is_uint32(x) -> (x < 4294967296))) axiom is_uint32_def2 : (forall x:int [is_uint32(x)]. (((0 <= x) and (x < 4294967296)) -> is_uint32(x))) logic is_sint32 : int -> prop axiom is_sint32_def : (forall x:int [is_sint32(x)]. (is_sint32(x) -> ((-2147483648) <= x))) axiom is_sint32_def1 : (forall x:int [is_sint32(x)]. (is_sint32(x) -> (x < 2147483648))) axiom is_sint32_def2 : (forall x:int [is_sint32(x)]. ((((-2147483648) <= x) and (x < 2147483648)) -> is_sint32(x))) logic is_uint64 : int -> prop axiom is_uint64_def : (forall x:int [is_uint64(x)]. (is_uint64(x) -> (0 <= x))) axiom is_uint64_def1 : (forall x:int [is_uint64(x)]. (is_uint64(x) -> (x < 18446744073709551616))) axiom is_uint64_def2 : (forall x:int [is_uint64(x)]. (((0 <= x) and (x < 18446744073709551616)) -> is_uint64(x))) logic is_sint64 : int -> prop axiom is_sint64_def : (forall x:int [is_sint64(x)]. (is_sint64(x) -> ((-9223372036854775808) <= x))) axiom is_sint64_def1 : (forall x:int [is_sint64(x)]. (is_sint64(x) -> (x < 9223372036854775808))) axiom is_sint64_def2 : (forall x:int [is_sint64(x)]. ((((-9223372036854775808) <= x) and (x < 9223372036854775808)) -> is_sint64(x))) axiom is_bool0 : is_bool(0) axiom is_bool1 : is_bool(1) logic to_bool : int -> int axiom to_bool_def : (forall x:int. ((x = 0) -> (to_bool(x) = 0))) axiom to_bool_def1 : (forall x:int. ((not (x = 0)) -> (to_bool(x) = 1))) logic to_uint8 : int -> int logic to_sint8 : int -> int logic to_uint16 : int -> int logic to_sint16 : int -> int logic to_uint32 : int -> int logic to_sint32 : int -> int logic to_uint64 : int -> int logic to_sint64 : int -> int logic two_power_abs : int -> int predicate is_uint(n: int, x: int) = ((0 <= x) and (x < two_power_abs(n))) predicate is_sint(n: int, x: int) = (((-two_power_abs(n)) <= x) and (x < two_power_abs(n))) logic to_uint : int, int -> int logic to_sint : int, int -> int axiom is_to_uint8 : (forall x:int [is_uint8(to_uint8(x))]. is_uint8(to_uint8(x))) axiom is_to_sint8 : (forall x:int [is_sint8(to_sint8(x))]. is_sint8(to_sint8(x))) axiom is_to_uint16 : (forall x:int [is_uint16(to_uint16(x))]. is_uint16(to_uint16(x))) axiom is_to_sint16 : (forall x:int [is_sint16(to_sint16(x))]. is_sint16(to_sint16(x))) axiom is_to_uint32 : (forall x:int [is_uint32(to_uint32(x))]. is_uint32(to_uint32(x))) axiom is_to_sint32 : (forall x:int [is_sint32(to_sint32(x))]. is_sint32(to_sint32(x))) axiom is_to_uint64 : (forall x:int [is_uint64(to_uint64(x))]. is_uint64(to_uint64(x))) axiom is_to_sint64 : (forall x:int [is_sint64(to_sint64(x))]. is_sint64(to_sint64(x))) axiom id_uint8 : (forall x:int [to_uint8(x)]. (((0 <= x) and (x < 256)) -> (to_uint8(x) = x))) axiom id_sint8 : (forall x:int [to_sint8(x)]. ((((-128) <= x) and (x < 128)) -> (to_sint8(x) = x))) axiom id_uint16 : (forall x:int [to_uint16(x)]. (((0 <= x) and (x < 65536)) -> (to_uint16(x) = x))) axiom id_sint16 : (forall x:int [to_sint16(x)]. ((((-32768) <= x) and (x < 32768)) -> (to_sint16(x) = x))) axiom id_uint32 : (forall x:int [to_uint32(x)]. (((0 <= x) and (x < 4294967296)) -> (to_uint32(x) = x))) axiom id_sint32 : (forall x:int [to_sint32(x)]. ((((-2147483648) <= x) and (x < 2147483648)) -> (to_sint32(x) = x))) axiom id_uint64 : (forall x:int [to_uint64(x)]. (((0 <= x) and (x < 18446744073709551616)) -> (to_uint64(x) = x))) axiom id_sint64 : (forall x:int [to_sint64(x)]. ((((-9223372036854775808) <= x) and (x < 9223372036854775808)) -> (to_sint64(x) = x))) axiom proj_int8 : (forall x:int [to_sint8(to_uint8(x))]. (to_sint8(to_uint8(x)) = to_sint8(x))) axiom proj_int16 : (forall x:int [to_sint16(to_uint16(x))]. (to_sint16(to_uint16(x)) = to_sint16(x))) axiom proj_int32 : (forall x:int [to_sint32(to_uint32(x))]. (to_sint32(to_uint32(x)) = to_sint32(x))) axiom proj_int64 : (forall x:int [to_sint64(to_uint64(x))]. (to_sint64(to_uint64(x)) = to_sint64(x))) ���������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/Cmath.mlw��������������������������������������������0000666�0000000�0000000�00000004210�13571573400�017721� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory int_Abs_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_RealInfix_ must be appended to this file*) axiom abs_def : (forall x:int [abs_int(x)]. ((0 <= x) -> (abs_int(x) = x))) axiom abs_def1 : (forall x:int [abs_int(x)]. ((not (0 <= x)) -> (abs_int(x) = (-x)))) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/ExpLog.mlw�������������������������������������������0000666�0000000�0000000�00000003740�13571573400�020072� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_RealInfix_ must be appended to this file*) (** The theory real_ExpLog_ must be appended to this file*) axiom exp_pos : (forall x:real. (0.0 < exp(x))) ��������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/Memory.mlw�������������������������������������������0000666�0000000�0000000�00000017702�13571573400�020147� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory bool_Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory map_Map_ must be appended to this file*) type addr = { base : int; offset : int } logic addr_le : addr, addr -> prop logic addr_lt : addr, addr -> prop logic addr_le_bool : addr, addr -> bool logic addr_lt_bool : addr, addr -> bool axiom addr_le_def : (forall p:addr. forall q:addr [addr_le(p, q)]. (((p).base = (q).base) -> (addr_le(p, q) -> ((p).offset <= (q).offset)))) axiom addr_le_def1 : (forall p:addr. forall q:addr [addr_le(p, q)]. (((p).base = (q).base) -> (((p).offset <= (q).offset) -> addr_le(p, q)))) axiom addr_lt_def : (forall p:addr. forall q:addr [addr_lt(p, q)]. (((p).base = (q).base) -> (addr_lt(p, q) -> ((p).offset < (q).offset)))) axiom addr_lt_def1 : (forall p:addr. forall q:addr [addr_lt(p, q)]. (((p).base = (q).base) -> (((p).offset < (q).offset) -> addr_lt(p, q)))) axiom addr_le_bool_def : (forall p:addr. forall q:addr [addr_le_bool(p, q)]. (addr_le(p, q) -> (addr_le_bool(p, q) = true))) axiom addr_le_bool_def1 : (forall p:addr. forall q:addr [addr_le_bool(p, q)]. ((addr_le_bool(p, q) = true) -> addr_le(p, q))) axiom addr_lt_bool_def : (forall p:addr. forall q:addr [addr_lt_bool(p, q)]. (addr_lt(p, q) -> (addr_lt_bool(p, q) = true))) axiom addr_lt_bool_def1 : (forall p:addr. forall q:addr [addr_lt_bool(p, q)]. ((addr_lt_bool(p, q) = true) -> addr_lt(p, q))) function null() : addr = { base = 0; offset = 0 } function global(b: int) : addr = { base = b; offset = 0 } function shift(p: addr, k: int) : addr = { base = (p).base; offset = ((p).offset + k) } predicate included(p: addr, a: int, q: addr, b: int) = ((0 < a) -> ((0 <= b) and (((p).base = (q).base) and (((q).offset <= (p).offset) and (((p).offset + a) <= ((q).offset + b)))))) predicate separated(p: addr, a: int, q: addr, b: int) = ((a <= 0) or ((b <= 0) or ((not ((p).base = (q).base)) or ((((q).offset + b) <= (p).offset) or (((p).offset + a) <= (q).offset))))) predicate eqmem(m1: (addr,'a) farray, m2: (addr,'a) farray, p: addr, a1: int) = (forall q:addr [(m1[p])| (m2[q])]. (included(q, 1, p, a1) -> ((m1[q]) = (m2[q])))) logic havoc : (addr,'a) farray, (addr,'a) farray, addr, int -> (addr,'a) farray predicate valid_rw(m: (int,int) farray, p: addr, n: int) = ((0 < n) -> ((0 < (p).base) and ((0 <= (p).offset) and (((p).offset + n) <= (m[(p).base]))))) predicate valid_rd(m: (int,int) farray, p: addr, n: int) = ((0 < n) -> ((not (0 = (p).base)) and ((0 <= (p).offset) and (((p).offset + n) <= (m[(p).base]))))) predicate invalid(m: (int,int) farray, p: addr, n: int) = ((0 < n) -> (((m[(p).base]) <= (p).offset) or (((p).offset + n) <= 0))) axiom valid_rw_rd : (forall m:(int,int) farray. (forall p:addr. (forall n:int. (valid_rw(m, p, n) -> valid_rd(m, p, n))))) axiom valid_string : (forall m:(int,int) farray. (forall p:addr. (((p).base < 0) -> (((0 <= (p).offset) and ((p).offset < (m[(p).base]))) -> valid_rd(m, p, 1))))) axiom valid_string1 : (forall m:(int,int) farray. (forall p:addr. (((p).base < 0) -> (((0 <= (p).offset) and ((p).offset < (m[(p).base]))) -> (not valid_rw(m, p, 1)))))) axiom separated_1 : (forall p:addr. forall q:addr. (forall a:int. forall b:int. forall i:int. forall j:int [separated(p, a, q, b), { base = (p).base; offset = i }, { base = (q).base; offset = j }]. (separated(p, a, q, b) -> ((((p).offset <= i) and (i < ((p).offset + a))) -> ((((q).offset <= j) and (j < ((q).offset + b))) -> (not ({ base = (p).base; offset = i } = { base = (q).base; offset = j }))))))) logic region : int -> int logic linked : (int,int) farray -> prop logic sconst : (addr,int) farray -> prop predicate framed(m: (addr,addr) farray) = (forall p:addr [(m[p])]. (region(((m[p])).base) <= 0)) axiom separated_included : (forall p:addr. forall q:addr. (forall a:int. forall b:int [separated(p, a, q, b), included(p, a, q, b)]. ((0 < a) -> ((0 < b) -> (separated(p, a, q, b) -> (not included(p, a, q, b))))))) axiom included_trans : (forall p:addr. forall q:addr. forall r:addr. (forall a:int. forall b:int. forall c:int [included(p, a, q, b), included(q, b, r, c)]. (included(p, a, q, b) -> (included(q, b, r, c) -> included(p, a, r, c))))) axiom separated_trans : (forall p:addr. forall q:addr. forall r:addr. (forall a:int. forall b:int. forall c:int [included(p, a, q, b), separated(q, b, r, c)]. (included(p, a, q, b) -> (separated(q, b, r, c) -> separated(p, a, r, c))))) axiom separated_sym : (forall p:addr. forall q:addr. (forall a:int. forall b:int [separated(p, a, q, b)]. (separated(p, a, q, b) -> separated(q, b, p, a)))) axiom separated_sym1 : (forall p:addr. forall q:addr. (forall a:int. forall b:int [separated(p, a, q, b)]. (separated(q, b, p, a) -> separated(p, a, q, b)))) axiom eqmem_included : (forall m1:(addr,'a) farray. forall m2:(addr,'a) farray. (forall p:addr. forall q:addr. (forall a1:int. forall b:int [eqmem(m1, m2, p, a1), eqmem(m1, m2, q, b)]. (included(p, a1, q, b) -> (eqmem(m1, m2, q, b) -> eqmem(m1, m2, p, a1)))))) axiom eqmem_sym : (forall m1:(addr,'a) farray. forall m2:(addr,'a) farray. (forall p:addr. (forall a1:int. (eqmem(m1, m2, p, a1) -> eqmem(m2, m1, p, a1))))) axiom havoc_access : (forall m0:(addr,'a) farray. forall m1:(addr,'a) farray. (forall q:addr. forall p:addr. (forall a1:int. (separated(q, 1, p, a1) -> ((havoc(m0, m1, p, a1)[q]) = (m1[q])))))) axiom havoc_access1 : (forall m0:(addr,'a) farray. forall m1:(addr,'a) farray. (forall q:addr. forall p:addr. (forall a1:int. ((not separated(q, 1, p, a1)) -> ((havoc(m0, m1, p, a1)[q]) = (m0[q])))))) logic int_of_addr : addr -> int logic addr_of_int : int -> addr logic base_offset : int -> int logic base_index : int -> int axiom int_of_addr_bijection : (forall a:int. (int_of_addr(addr_of_int(a)) = a)) axiom addr_of_int_bijection : (forall p:addr. (addr_of_int(int_of_addr(p)) = p)) axiom addr_of_null : (int_of_addr(null) = 0) axiom base_offset_zero : (base_offset(0) = 0) axiom base_offset_inj : (forall i:int. (base_index(base_offset(i)) = i)) axiom base_offset_monotonic : (forall i:int. forall j:int. ((i < j) -> (base_offset(i) < base_offset(j)))) ��������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/Qed.mlw����������������������������������������������0000666�0000000�0000000�00000013250�13571573400�017402� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory bool_Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory int_Abs_ must be appended to this file*) (** The theory int_ComputerDivision_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_RealInfix_ must be appended to this file*) (** The theory real_FromInt_ must be appended to this file*) logic match_bool : bool, 'a, 'a -> 'a axiom match_bool1 : (forall p:bool. forall x:'a. forall y:'a [match_bool(p, x, y)]. (((p = true) and (match_bool(p, x, y) = x)) or ((p = false) and (match_bool(p, x, y) = y)))) logic eqb : 'a, 'a -> bool axiom eqb1 : (forall x:'a. forall y:'a. ((eqb(x, y) = true) -> (x = y))) axiom eqb2 : (forall x:'a. forall y:'a. ((x = y) -> (eqb(x, y) = true))) logic neqb : 'a, 'a -> bool axiom neqb1 : (forall x:'a. forall y:'a. ((neqb(x, y) = true) -> (not (x = y)))) axiom neqb2 : (forall x:'a. forall y:'a. ((not (x = y)) -> (neqb(x, y) = true))) logic zlt : int, int -> bool logic zleq : int, int -> bool axiom zlt1 : (forall x:int. forall y:int. ((zlt(x, y) = true) -> (x < y))) axiom zlt2 : (forall x:int. forall y:int. ((x < y) -> (zlt(x, y) = true))) axiom zleq1 : (forall x:int. forall y:int. ((zleq(x, y) = true) -> (x <= y))) axiom zleq2 : (forall x:int. forall y:int. ((x <= y) -> (zleq(x, y) = true))) logic rlt : real, real -> bool logic rleq : real, real -> bool axiom rlt1 : (forall x:real. forall y:real. ((rlt(x, y) = true) -> (x < y))) axiom rlt2 : (forall x:real. forall y:real. ((x < y) -> (rlt(x, y) = true))) axiom rleq1 : (forall x:real. forall y:real. ((rleq(x, y) = true) -> (x <= y))) axiom rleq2 : (forall x:real. forall y:real. ((x <= y) -> (rleq(x, y) = true))) function real_of_int(x: int) : real = from_int(x) axiom cdiv_cases : (forall n:int. forall d:int [div(n, d)]. ((0 <= n) -> ((0 < d) -> (div(n, d) = (n / d))))) axiom cdiv_cases1 : (forall n:int. forall d:int [div(n, d)]. ((n <= 0) -> ((0 < d) -> (div(n, d) = (-((-n) / d)))))) axiom cdiv_cases2 : (forall n:int. forall d:int [div(n, d)]. ((0 <= n) -> ((d < 0) -> (div(n, d) = (-(n / (-d))))))) axiom cdiv_cases3 : (forall n:int. forall d:int [div(n, d)]. ((n <= 0) -> ((d < 0) -> (div(n, d) = ((-n) / (-d)))))) axiom cmod_cases : (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((0 < d) -> (mod(n, d) = (n % d))))) axiom cmod_cases1 : (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((0 < d) -> (mod(n, d) = (-((-n) % d)))))) axiom cmod_cases2 : (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((d < 0) -> (mod(n, d) = (n % (-d)))))) axiom cmod_cases3 : (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((d < 0) -> (mod(n, d) = (-((-n) % (-d))))))) axiom c_euclidian : (forall n:int. forall d:int [div(n, d), mod(n, d)]. ((not (d = 0)) -> (n = ((div(n, d) * d) + mod(n, d))))) axiom cmod_remainder : (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((0 < d) -> (0 <= mod(n, d))))) axiom cmod_remainder1 : (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((0 < d) -> (mod(n, d) < d)))) axiom cmod_remainder2 : (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((0 < d) -> ((-d) < mod(n, d))))) axiom cmod_remainder3 : (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((0 < d) -> (mod(n, d) <= 0)))) axiom cmod_remainder4 : (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((d < 0) -> (0 <= mod(n, d))))) axiom cmod_remainder5 : (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((d < 0) -> (mod(n, d) < (-d))))) axiom cmod_remainder6 : (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((d < 0) -> (d < mod(n, d))))) axiom cmod_remainder7 : (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((d < 0) -> (mod(n, d) <= 0)))) axiom cdiv_neutral : (forall a:int [div(a, 1)]. (div(a, 1) = a)) axiom cdiv_inv : (forall a:int [div(a, a)]. ((not (a = 0)) -> (div(a, a) = 1))) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/Square.mlw�������������������������������������������0000666�0000000�0000000�00000004237�13571573400�020136� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_RealInfix_ must be appended to this file*) (** The theory real_Square_ must be appended to this file*) axiom sqrt_lin1 : (forall x:real [sqrt(x)]. ((1.0 < x) -> (sqrt(x) < x))) axiom sqrt_lin0 : (forall x:real [sqrt(x)]. (((0.0 < x) and (x < 1.0)) -> (x < sqrt(x)))) axiom sqrt_0 : (sqrt(0.0) = 0.0) axiom sqrt_1 : (sqrt(1.0) = 1.0) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/Vlist.mlw��������������������������������������������0000666�0000000�0000000�00000011727�13571573400�020001� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory int_Abs_ must be appended to this file*) (** The theory int_ComputerDivision_ must be appended to this file*) type 'a list logic nil : 'a list logic cons : 'a, 'a list -> 'a list logic concat : 'a list, 'a list -> 'a list logic repeat : 'a list, int -> 'a list logic length : 'a list -> int logic nth : 'a list, int -> 'a axiom length_pos : (forall w:'a list. (0 <= length(w))) axiom length_nil : (length((nil : 'a list)) = 0) axiom length_nil_bis : (forall w:'a list. ((length(w) = 0) -> (w = (nil : 'a list)))) axiom length_cons : (forall x:'a. forall w:'a list [length(cons(x, w))]. (length(cons(x, w)) = (1 + length(w)))) axiom length_concat : (forall u:'a list. forall v:'a list [length(concat(u, v))]. (length(concat(u, v)) = (length(u) + length(v)))) axiom length_repeat : (forall w:'a list. forall n:int [length(repeat(w, n))]. ((0 <= n) -> (length(repeat(w, n)) = (n * length(w))))) axiom nth_cons : (forall k:int. forall x:'a. forall w:'a list [nth(cons(x, w), k)]. ((k = 0) -> (nth(cons(x, w), k) = x))) axiom nth_cons1 : (forall k:int. forall x:'a. forall w:'a list [nth(cons(x, w), k)]. ((not (k = 0)) -> (nth(cons(x, w), k) = nth(w, (k - 1))))) axiom nth_concat : (forall u:'a list. forall v:'a list. forall k:int [nth(concat(u, v), k)]. ((k < length(u)) -> (nth(concat(u, v), k) = nth(u, k)))) axiom nth_concat1 : (forall u:'a list. forall v:'a list. forall k:int [nth(concat(u, v), k)]. ((not (k < length(u))) -> (nth(concat(u, v), k) = nth(v, (k - length(u)))))) axiom nth_repeat : (forall n:int. forall k:int. forall w:'a list [nth(repeat(w, n), k)]. (((0 <= k) and (k < (n * length(w)))) -> ((0 < length(w)) -> (nth(repeat(w, n), k) = nth(w, mod(k, length(w))))))) predicate vlist_eq(u: 'a list, v: 'a list) = ((length(u) = length(v)) and (forall i:int. (((0 <= i) and (i < length(u))) -> (nth(u, i) = nth(v, i))))) axiom extensionality : (forall u:'a list. forall v:'a list. (vlist_eq(u, v) -> (u = v))) axiom rw_nil_concat_left : (forall w:'a list [concat((nil : 'a list), w)]. (concat((nil : 'a list), w) = w)) axiom rw_nil_concat_right : (forall w:'a list [concat(w, (nil : 'a list))]. (concat(w, (nil : 'a list)) = w)) axiom rw_nil_repeat : (forall n:int [repeat((nil : 'a list), n)]. ((0 <= n) -> (repeat((nil : 'a list), n) = (nil : 'a list)))) axiom rw_repeat_zero : (forall w:'a list [repeat(w, 0)]. (repeat(w, 0) = (nil : 'a list))) axiom rw_repeat_one : (forall w:'a list [repeat(w, 1)]. (repeat(w, 1) = w)) logic repeat_box : 'a list, int -> 'a list axiom rw_repeat_box_unfold : (forall w:'a list. forall n:int [repeat_box(w, n)]. (repeat_box(w, n) = repeat(w, n))) axiom rw_repeat_plus_box_unfold : (forall w:'a list. forall a1:int. forall b:int [repeat_box(w, (a1 + b))]. ((0 <= a1) -> ((0 <= b) -> (repeat_box(w, (a1 + b)) = concat(repeat(w, a1), repeat(w, b)))))) axiom rw_repeat_plus_one_box_unfold : (forall w:'a list. forall n:int [repeat_box(w, n)]. ((0 < n) -> (repeat_box(w, n) = concat(repeat(w, (n - 1)), w)))) axiom rw_repeat_plus_one_box_unfold1 : (forall w:'a list. forall n:int [repeat_box(w, n)]. ((0 < n) -> (repeat_box(w, (n + 1)) = concat(repeat(w, n), w)))) �����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/Vset.mlw���������������������������������������������0000666�0000000�0000000�00000012644�13571573400�017620� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory bool_Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) type 'a set logic empty : 'a set logic singleton : 'a -> 'a set logic ac union : 'a set, 'a set -> 'a set logic ac inter : 'a set, 'a set -> 'a set logic member : 'a, 'a set -> prop logic member_bool : 'a, 'a set -> bool logic range : int, int -> int set logic range_sup : int -> int set logic range_inf : int -> int set logic range_all : int set predicate eqset(a: 'a1 set, b: 'a1 set) = (forall x:'a1. (member(x, a) <-> member(x, b))) predicate subset(a: 'a1 set, b: 'a1 set) = (forall x:'a1. (member(x, a) -> member(x, b))) predicate disjoint(a: 'a1 set, b: 'a1 set) = (forall x:'a1. (member(x, a) -> (not member(x, b)))) axiom member_bool1 : (forall x:'a. (forall s:'a set [member_bool(x, s)]. (member(x, s) -> (member_bool(x, s) = true)))) axiom member_bool2 : (forall x:'a. (forall s:'a set [member_bool(x, s)]. ((not member(x, s)) -> (member_bool(x, s) = false)))) axiom member_empty : (forall x:'a [member(x, (empty : 'a set))]. (not member(x, (empty : 'a set)))) axiom member_singleton : (forall x:'a. forall y:'a [member(x, singleton(y))]. (member(x, singleton(y)) -> (x = y))) axiom member_singleton1 : (forall x:'a. forall y:'a [member(x, singleton(y))]. ((x = y) -> member(x, singleton(y)))) axiom member_union : (forall x:'a. (forall a1:'a set. forall b:'a set [member(x, union(a1, b))]. (member(x, union(a1, b)) -> (member(x, a1) or member(x, b))))) axiom member_union1 : (forall x:'a. (forall a1:'a set. forall b:'a set [member(x, union(a1, b))]. ((member(x, a1) or member(x, b)) -> member(x, union(a1, b))))) axiom member_inter : (forall x:'a. (forall a1:'a set. forall b:'a set [member(x, inter(a1, b))]. (member(x, inter(a1, b)) -> member(x, a1)))) axiom member_inter1 : (forall x:'a. (forall a1:'a set. forall b:'a set [member(x, inter(a1, b))]. (member(x, inter(a1, b)) -> member(x, b)))) axiom member_inter2 : (forall x:'a. (forall a1:'a set. forall b:'a set [member(x, inter(a1, b))]. ((member(x, a1) and member(x, b)) -> member(x, inter(a1, b))))) axiom union_empty : (forall a:'a1 set [union(a, (empty : 'a1 set))| union((empty : 'a1 set), a)]. (union(a, (empty : 'a1 set)) = a)) axiom union_empty1 : (forall a:'a1 set [union(a, (empty : 'a1 set))| union((empty : 'a1 set), a)]. (union((empty : 'a1 set), a) = a)) axiom inter_empty : (forall a:'a1 set [inter(a, (empty : 'a1 set))| inter((empty : 'a1 set), a)]. (inter(a, (empty : 'a1 set)) = (empty : 'a1 set))) axiom inter_empty1 : (forall a:'a1 set [inter(a, (empty : 'a1 set))| inter((empty : 'a1 set), a)]. (inter((empty : 'a1 set), a) = (empty : 'a1 set))) axiom member_range : (forall x:int. forall a:int. forall b:int [member(x, range(a, b))]. (member(x, range(a, b)) -> (a <= x))) axiom member_range1 : (forall x:int. forall a:int. forall b:int [member(x, range(a, b))]. (member(x, range(a, b)) -> (x <= b))) axiom member_range2 : (forall x:int. forall a:int. forall b:int [member(x, range(a, b))]. (((a <= x) and (x <= b)) -> member(x, range(a, b)))) axiom member_range_sup : (forall x:int. forall a:int [member(x, range_sup(a))]. (member(x, range_sup(a)) -> (a <= x))) axiom member_range_sup1 : (forall x:int. forall a:int [member(x, range_sup(a))]. ((a <= x) -> member(x, range_sup(a)))) axiom member_range_inf : (forall x:int. forall b:int [member(x, range_inf(b))]. (member(x, range_inf(b)) -> (x <= b))) axiom member_range_inf1 : (forall x:int. forall b:int [member(x, range_inf(b))]. ((x <= b) -> member(x, range_inf(b)))) axiom member_range_all : (forall x:int [member(x, range_all)]. member(x, range_all)) ��������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/bool.Bool.mlw����������������������������������������0000666�0000000�0000000�00000002730�13571573400�020517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) function andb(x: bool, y: bool) : bool = match_bool(x, y, false) function orb(x: bool, y: bool) : bool = match_bool(x, true, y) function notb(x: bool) : bool = match_bool(x, false, true) function xorb(x: bool, y: bool) : bool = match_bool(x, notb(y), y) function implb(x: bool, y: bool) : bool = match_bool(x, y, true) ����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/int.Abs.mlw������������������������������������������0000666�0000000�0000000�00000003254�13571573400�020172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) logic abs_int : int -> int axiom abs_def : (forall x:int. ((0 <= x) -> (abs_int(x) = x))) axiom abs_def1 : (forall x:int. ((not (0 <= x)) -> (abs_int(x) = (-x)))) axiom Abs_le : (forall x:int. forall y:int. ((abs_int(x) <= y) -> ((-y) <= x))) axiom Abs_le1 : (forall x:int. forall y:int. ((abs_int(x) <= y) -> (x <= y))) axiom Abs_le2 : (forall x:int. forall y:int. ((((-y) <= x) and (x <= y)) -> (abs_int(x) <= y))) axiom Abs_pos : (forall x:int. (0 <= abs_int(x))) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/int.ComputerDivision.mlw�����������������������������0000666�0000000�0000000�00000004171�13571573400�022767� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory int_Abs_ must be appended to this file*) logic div : int, int -> int logic mod : int, int -> int axiom Div_bound : (forall x:int. forall y:int. (((0 <= x) and (0 < y)) -> (0 <= div(x, y)))) axiom Div_bound1 : (forall x:int. forall y:int. (((0 <= x) and (0 < y)) -> (div(x, y) <= x))) axiom Div_1 : (forall x:int. (div(x, 1) = x)) axiom Mod_1 : (forall x:int. (mod(x, 1) = 0)) axiom Div_inf : (forall x:int. forall y:int. (((0 <= x) and (x < y)) -> (div(x, y) = 0))) axiom Mod_inf : (forall x:int. forall y:int. (((0 <= x) and (x < y)) -> (mod(x, y) = x))) axiom Div_mult : (forall x:int. forall y:int. forall z:int [div(((x * y) + z), x)]. (((0 < x) and ((0 <= y) and (0 <= z))) -> (div(((x * y) + z), x) = (y + div(z, x))))) axiom Mod_mult : (forall x:int. forall y:int. forall z:int [mod(((x * y) + z), x)]. (((0 < x) and ((0 <= y) and (0 <= z))) -> (mod(((x * y) + z), x) = mod(z, x)))) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/int.ComputerOfEuclideanDivision.mlw������������������0000666�0000000�0000000�00000004423�13571573400�025066� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory int_Abs_ must be appended to this file*) (** The theory int_ComputerDivision_ must be appended to this file*) axiom cdiv_cases : (forall n:int. forall d:int [div(n, d)]. ((0 <= n) -> ((0 < d) -> (div(n, d) = (n / d))))) axiom cdiv_cases1 : (forall n:int. forall d:int [div(n, d)]. ((n <= 0) -> ((0 < d) -> (div(n, d) = (-((-n) / d)))))) axiom cdiv_cases2 : (forall n:int. forall d:int [div(n, d)]. ((0 <= n) -> ((d < 0) -> (div(n, d) = (-(n / (-d))))))) axiom cdiv_cases3 : (forall n:int. forall d:int [div(n, d)]. ((n <= 0) -> ((d < 0) -> (div(n, d) = ((-n) / (-d)))))) axiom cmod_cases : (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((0 < d) -> (mod(n, d) = (n % d))))) axiom cmod_cases1 : (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((0 < d) -> (mod(n, d) = (-((-n) % d)))))) axiom cmod_cases2 : (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((d < 0) -> (mod(n, d) = (n % (-d)))))) axiom cmod_cases3 : (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((d < 0) -> (mod(n, d) = (-((-n) % (-d))))))) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/int.Int.mlw������������������������������������������0000666�0000000�0000000�00000002314�13571573400�020213� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (* this is a prelude for Alt-Ergo integer arithmetic *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/int.MinMax.mlw���������������������������������������0000666�0000000�0000000�00000004240�13571573400�020652� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) logic min_int : int, int -> int axiom min_def : (forall x:int. forall y:int. ((x <= y) -> (min_int(x, y) = x))) axiom min_def1 : (forall x:int. forall y:int. ((not (x <= y)) -> (min_int(x, y) = y))) logic max_int : int, int -> int axiom max_def : (forall x:int. forall y:int. ((x <= y) -> (max_int(x, y) = y))) axiom max_def1 : (forall x:int. forall y:int. ((not (x <= y)) -> (max_int(x, y) = x))) axiom Min_r : (forall x:int. forall y:int. ((y <= x) -> (min_int(x, y) = y))) axiom Max_l : (forall x:int. forall y:int. ((y <= x) -> (max_int(x, y) = x))) axiom Min_comm : (forall x:int. forall y:int. (min_int(x, y) = min_int(y, x))) axiom Max_comm : (forall x:int. forall y:int. (max_int(x, y) = max_int(y, x))) axiom Min_assoc : (forall x:int. forall y:int. forall z:int. (min_int(min_int(x, y), z) = min_int(x, min_int(y, z)))) axiom Max_assoc : (forall x:int. forall y:int. forall z:int. (max_int(max_int(x, y), z) = max_int(x, max_int(y, z)))) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/map.Const.mlw����������������������������������������0000666�0000000�0000000�00000002512�13571573400�020532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory map_Map_ must be appended to this file*) logic const : 'b -> ('a,'b) farray axiom const_def : (forall v:'b. forall us:'a. (((const(v) : ('a,'b) farray)[us]) = v)) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/map.Map.mlw������������������������������������������0000666�0000000�0000000�00000002224�13571573400�020161� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.Abs.mlw�����������������������������������������0000666�0000000�0000000�00000004051�13571573400�020317� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) logic abs_real : real -> real axiom abs_def : (forall x:real. ((0.0 <= x) -> (abs_real(x) = x))) axiom abs_def1 : (forall x:real. ((not (0.0 <= x)) -> (abs_real(x) = (-x)))) axiom Abs_le : (forall x:real. forall y:real. ((abs_real(x) <= y) -> ((-y) <= x))) axiom Abs_le1 : (forall x:real. forall y:real. ((abs_real(x) <= y) -> (x <= y))) axiom Abs_le2 : (forall x:real. forall y:real. ((((-y) <= x) and (x <= y)) -> (abs_real(x) <= y))) axiom Abs_pos : (forall x:real. (0.0 <= abs_real(x))) axiom Abs_sum : (forall x:real. forall y:real. (abs_real((x + y)) <= (abs_real(x) + abs_real(y)))) axiom Abs_prod : (forall x:real. forall y:real. (abs_real((x * y)) = (abs_real(x) * abs_real(y)))) axiom triangular_inequality : (forall x:real. forall y:real. forall z:real. (abs_real((x - z)) <= (abs_real((x - y)) + abs_real((y - z))))) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.ExpLog.mlw��������������������������������������0000666�0000000�0000000�00000003372�13571573400�021015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) logic exp : real -> real axiom Exp_zero : (exp(0.0) = 1.0) axiom Exp_sum : (forall x:real. forall y:real. (exp((x + y)) = (exp(x) * exp(y)))) logic log : real -> real axiom Log_one : (log(1.0) = 0.0) axiom Log_mul : (forall x:real. forall y:real. (((0.0 < x) and (0.0 < y)) -> (log((x * y)) = (log(x) + log(y))))) axiom Log_exp : (forall x:real. (log(exp(x)) = x)) axiom Exp_log : (forall x:real. ((0.0 < x) -> (exp(log(x)) = x))) function log2(x: real) : real = (log(x) / log(2.0)) function log10(x: real) : real = (log(x) / log(10.0)) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.FromInt.mlw�������������������������������������0000666�0000000�0000000�00000003603�13571573400�021172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) logic from_int : int -> real axiom Zero : (from_int(0) = 0.0) axiom One : (from_int(1) = 1.0) axiom Add : (forall x:int. forall y:int. (from_int((x + y)) = (from_int(x) + from_int(y)))) axiom Sub : (forall x:int. forall y:int. (from_int((x - y)) = (from_int(x) - from_int(y)))) axiom Mul : (forall x:int. forall y:int. (from_int((x * y)) = (from_int(x) * from_int(y)))) axiom Neg : (forall x:int. (from_int((-x)) = (-from_int(x)))) axiom Injective : (forall x:int. forall y:int. ((from_int(x) = from_int(y)) -> (x = y))) axiom Monotonic : (forall x:int. forall y:int. ((x <= y) -> (from_int(x) <= from_int(y)))) �����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.Hyperbolic.mlw����������������������������������0000666�0000000�0000000�00000003525�13571573400�021717� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_Square_ must be appended to this file*) (** The theory real_ExpLog_ must be appended to this file*) function sinh(x: real) : real = (0.5 * (exp(x) - exp((-x)))) function cosh(x: real) : real = (0.5 * (exp(x) + exp((-x)))) function tanh(x: real) : real = (sinh(x) / cosh(x)) function asinh(x: real) : real = log((x + sqrt((sqr(x) + 1.0)))) logic acosh : real -> real axiom Acosh_def : (forall x:real. ((1.0 <= x) -> (acosh(x) = log((x + sqrt((sqr(x) - 1.0))))))) logic atanh : real -> real axiom Atanh_def : (forall x:real. ((((- 1.0) < x) and (x < 1.0)) -> (atanh(x) = (0.5 * log(((1.0 + x) / (1.0 - x))))))) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.MinMax.mlw��������������������������������������0000666�0000000�0000000�00000004326�13571573400�021010� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) logic min_real : real, real -> real axiom min_def : (forall x:real. forall y:real. ((x <= y) -> (min_real(x, y) = x))) axiom min_def1 : (forall x:real. forall y:real. ((not (x <= y)) -> (min_real(x, y) = y))) logic max_real : real, real -> real axiom max_def : (forall x:real. forall y:real. ((x <= y) -> (max_real(x, y) = y))) axiom max_def1 : (forall x:real. forall y:real. ((not (x <= y)) -> (max_real(x, y) = x))) axiom Min_r : (forall x:real. forall y:real. ((y <= x) -> (min_real(x, y) = y))) axiom Max_l : (forall x:real. forall y:real. ((y <= x) -> (max_real(x, y) = x))) axiom Min_comm : (forall x:real. forall y:real. (min_real(x, y) = min_real(y, x))) axiom Max_comm : (forall x:real. forall y:real. (max_real(x, y) = max_real(y, x))) axiom Min_assoc : (forall x:real. forall y:real. forall z:real. (min_real(min_real(x, y), z) = min_real(x, min_real(y, z)))) axiom Max_assoc : (forall x:real. forall y:real. forall z:real. (max_real(max_real(x, y), z) = max_real(x, max_real(y, z)))) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.Polar.mlw���������������������������������������0000666�0000000�0000000�00000003250�13571573400�020667� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_Abs_ must be appended to this file*) (** The theory real_Square_ must be appended to this file*) (** The theory real_Trigonometry_ must be appended to this file*) function hypot(x: real, y: real) : real = sqrt((sqr(x) + sqr(y))) logic atan2 : real, real -> real axiom X_from_polar : (forall x:real. forall y:real. (x = (hypot(x, y) * cos(atan2(y, x))))) axiom Y_from_polar : (forall x:real. forall y:real. (y = (hypot(x, y) * sin(atan2(y, x))))) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.PowerReal.mlw�����������������������������������0000666�0000000�0000000�00000004770�13571573400�021522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory int_Exponentiation_ must be appended to this file*) (** The theory int_Power_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_FromInt_ must be appended to this file*) (** The theory real_Square_ must be appended to this file*) (** The theory real_ExpLog_ must be appended to this file*) logic pow : real, real -> real axiom Pow_def : (forall x:real. forall y:real. ((0.0 < x) -> (pow(x, y) = exp((y * log(x)))))) axiom Pow_pos : (forall x:real. forall y:real. ((0.0 < x) -> (0.0 < pow(x, y)))) axiom Pow_plus : (forall x:real. forall y:real. forall z:real. ((0.0 < z) -> (pow(z, (x + y)) = (pow(z, x) * pow(z, y))))) axiom Pow_mult : (forall x:real. forall y:real. forall z:real. ((0.0 < x) -> (pow(pow(x, y), z) = pow(x, (y * z))))) axiom Pow_x_zero : (forall x:real. ((0.0 < x) -> (pow(x, 0.0) = 1.0))) axiom Pow_x_one : (forall x:real. ((0.0 < x) -> (pow(x, 1.0) = x))) axiom Pow_one_y : (forall y:real. (pow(1.0, y) = 1.0)) axiom Pow_x_two : (forall x:real. ((0.0 < x) -> (pow(x, 2.0) = sqr(x)))) axiom Pow_half : (forall x:real. ((0.0 < x) -> (pow(x, 0.5) = sqrt(x)))) axiom pow_from_int : (forall x:int. forall y:int. ((0 < x) -> ((0 <= y) -> (pow(from_int(x), from_int(y)) = from_int(power(x, y)))))) ��������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.Real.mlw����������������������������������������0000666�0000000�0000000�00000003724�13571573400�020503� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (* this is a prelude for Alt-Ergo real arithmetic *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) axiom add_div : (forall x:real. forall y:real. forall z:real. ((not (z = 0.0)) -> (((x + y) / z) = ((x / z) + (y / z))))) axiom sub_div : (forall x:real. forall y:real. forall z:real. ((not (z = 0.0)) -> (((x - y) / z) = ((x / z) - (y / z))))) axiom neg_div : (forall x:real. forall y:real. ((not (y = 0.0)) -> (((-x) / y) = (-(x / y))))) axiom assoc_mul_div : (forall x:real. forall y:real. forall z:real. ((not (z = 0.0)) -> (((x * y) / z) = (x * (y / z))))) axiom assoc_div_mul : (forall x:real. forall y:real. forall z:real. (((not (y = 0.0)) and (not (z = 0.0))) -> (((x / y) / z) = (x / (y * z))))) axiom assoc_div_div : (forall x:real. forall y:real. forall z:real. (((not (y = 0.0)) and (not (z = 0.0))) -> ((x / (y / z)) = ((x * z) / y)))) ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.RealInfix.mlw�����������������������������������0000666�0000000�0000000�00000002316�13571573400�021475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.Square.mlw��������������������������������������0000666�0000000�0000000�00000003323�13571573400�021053� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) function sqr(x: real) : real = (x * x) logic sqrt : real -> real axiom Sqrt_positive : (forall x:real. ((0.0 <= x) -> (0.0 <= sqrt(x)))) axiom Sqrt_square : (forall x:real. ((0.0 <= x) -> (sqr(sqrt(x)) = x))) axiom Square_sqrt : (forall x:real. ((0.0 <= x) -> (sqrt((x * x)) = x))) axiom Sqrt_mul : (forall x:real. forall y:real. (((0.0 <= x) and (0.0 <= y)) -> (sqrt((x * y)) = (sqrt(x) * sqrt(y))))) axiom Sqrt_le : (forall x:real. forall y:real. (((0.0 <= x) and (x <= y)) -> (sqrt(x) <= sqrt(y)))) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.Trigonometry.mlw��������������������������������0000666�0000000�0000000�00000005231�13571573400�022315� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_Abs_ must be appended to this file*) (** The theory real_Square_ must be appended to this file*) logic cos : real -> real logic sin : real -> real axiom Pythagorean_identity : (forall x:real. ((sqr(cos(x)) + sqr(sin(x))) = 1.0)) axiom Cos_le_one : (forall x:real. (abs_real(cos(x)) <= 1.0)) axiom Sin_le_one : (forall x:real. (abs_real(sin(x)) <= 1.0)) axiom Cos_0 : (cos(0.0) = 1.0) axiom Sin_0 : (sin(0.0) = 0.0) logic pi : real axiom Pi_double_precision_bounds : (0x1.921fb54442d18p1 < pi) axiom Pi_double_precision_bounds1 : (pi < 0x1.921fb54442d19p1) axiom Cos_pi : (cos(pi) = (- 1.0)) axiom Sin_pi : (sin(pi) = 0.0) axiom Cos_pi2 : (cos((0.5 * pi)) = 0.0) axiom Sin_pi2 : (sin((0.5 * pi)) = 1.0) axiom Cos_plus_pi : (forall x:real. (cos((x + pi)) = (-cos(x)))) axiom Sin_plus_pi : (forall x:real. (sin((x + pi)) = (-sin(x)))) axiom Cos_plus_pi2 : (forall x:real. (cos((x + (0.5 * pi))) = (-sin(x)))) axiom Sin_plus_pi2 : (forall x:real. (sin((x + (0.5 * pi))) = cos(x))) axiom Cos_neg : (forall x:real. (cos((-x)) = cos(x))) axiom Sin_neg : (forall x:real. (sin((-x)) = (-sin(x)))) axiom Cos_sum : (forall x:real. forall y:real. (cos((x + y)) = ((cos(x) * cos(y)) - (sin(x) * sin(y))))) axiom Sin_sum : (forall x:real. forall y:real. (sin((x + y)) = ((sin(x) * cos(y)) + (cos(x) * sin(y))))) function tan(x: real) : real = (sin(x) / cos(x)) logic atan : real -> real axiom Tan_atan : (forall x:real. (tan(atan(x)) = x)) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/ergo/real.Truncate.mlw������������������������������������0000666�0000000�0000000�00000005553�13571573400�021407� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* The Why3 Verification Platform / The Why3 Development Team *) (* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) (* *) (* This software is distributed under the terms of the GNU Lesser *) (* General Public License version 2.1, with the special exception *) (* on linking described in file LICENSE. *) (* *) (* File modified by CEA (Commissariat à l'énergie atomique et aux *) (* énergies alternatives). *) (* *) (**************************************************************************) (* this is the prelude for Alt-Ergo, version >= 0.95.2 *) (** The theory BuiltIn_ must be appended to this file*) (** The theory Bool_ must be appended to this file*) (** The theory int_Int_ must be appended to this file*) (** The theory real_Real_ must be appended to this file*) (** The theory real_FromInt_ must be appended to this file*) logic truncate : real -> int axiom Truncate_int : (forall i:int. (truncate(from_int(i)) = i)) axiom Truncate_down_pos : (forall x:real. ((0.0 <= x) -> (from_int(truncate(x)) <= x))) axiom Truncate_down_pos1 : (forall x:real. ((0.0 <= x) -> (x < from_int((truncate(x) + 1))))) axiom Truncate_up_neg : (forall x:real. ((x <= 0.0) -> (from_int((truncate(x) - 1)) < x))) axiom Truncate_up_neg1 : (forall x:real. ((x <= 0.0) -> (x <= from_int(truncate(x))))) axiom Real_of_truncate : (forall x:real. ((x - 1.0) <= from_int(truncate(x)))) axiom Real_of_truncate1 : (forall x:real. (from_int(truncate(x)) <= (x + 1.0))) axiom Truncate_monotonic : (forall x:real. forall y:real. ((x <= y) -> (truncate(x) <= truncate(y)))) axiom Truncate_monotonic_int1 : (forall x:real. forall i:int. ((x <= from_int(i)) -> (truncate(x) <= i))) axiom Truncate_monotonic_int2 : (forall x:real. forall i:int. ((from_int(i) <= x) -> (i <= truncate(x)))) logic floor : real -> int logic ceil : real -> int axiom Floor_int : (forall i:int. (floor(from_int(i)) = i)) axiom Ceil_int : (forall i:int. (ceil(from_int(i)) = i)) axiom Floor_down : (forall x:real. (from_int(floor(x)) <= x)) axiom Floor_down1 : (forall x:real. (x < from_int((floor(x) + 1)))) axiom Ceil_up : (forall x:real. (from_int((ceil(x) - 1)) < x)) axiom Ceil_up1 : (forall x:real. (x <= from_int(ceil(x)))) axiom Floor_monotonic : (forall x:real. forall y:real. ((x <= y) -> (floor(x) <= floor(y)))) axiom Ceil_monotonic : (forall x:real. forall y:real. ((x <= y) -> (ceil(x) <= ceil(y)))) �����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/install.ml������������������������������������������������0000666�0000000�0000000�00000014112�13571573400�017212� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let binary = ref false let open_out file = if !binary then open_out_bin file else open_out file let open_in file = if !binary then open_in_bin file else open_in file (* -------------------------------------------------------------------------- *) (* --- Monadic --- *) (* -------------------------------------------------------------------------- *) let try_finally ~finally f x = try let r = f x in finally x ; r with e -> finally x ; raise e let on_inc file job = try_finally ~finally:close_in job (open_in file) let on_out file job = try_finally ~finally:close_out job (open_out file) (* -------------------------------------------------------------------------- *) (* --- Sys-like Commands --- *) (* -------------------------------------------------------------------------- *) let hardcopy inc out = begin let buffer = Bytes.create 1024 in let n = ref 0 in while (n := input inc buffer 0 1024 ; !n > 0) do output out buffer 0 !n done ; flush out ; end let copy src tgt = on_inc src (fun inc -> on_out tgt (hardcopy inc)) let is_dir path = Sys.file_exists path && Sys.is_directory path let rec mkdir path = if not (Sys.file_exists path) then begin mkdir (Filename.dirname path) ; Unix.mkdir path 0o755 ; end else if not (Sys.is_directory path) then failwith (Printf.sprintf "Directory %S is not a directory" path) let parse_mode (m : string) : Unix.file_perm = try int_of_string m with _ -> failwith (Printf.sprintf "Invalid file permissions %S" m) (* -------------------------------------------------------------------------- *) (* --- Install Utility --- *) (* -------------------------------------------------------------------------- *) let verbose = ref false let warning = ref true let path = ref false let mode = ref "default" let input = ref "." let output = ref "#undefined#" let count = ref 0 let summary = ref false let do_mkdir tgt = if not (Sys.file_exists tgt) then begin if not !path then failwith (Printf.sprintf "Directory %S not found." tgt) ; if !verbose then Format.printf "[install] mkdir %S@." tgt ; mkdir tgt ; end else if not (Sys.is_directory tgt) then failwith (Printf.sprintf "File %S is not a directory." tgt) let do_copy src tgt = begin if !verbose then Format.printf "[install] cp %S %S@." src tgt ; copy src tgt ; incr count ; end let do_chmod tgt = begin if !mode <> "default" then let perm = parse_mode !mode in if !verbose then Format.printf "[install] chmod %s %S@." !mode tgt ; Unix.chmod tgt perm ; end let do_install file = try let src = Printf.sprintf "%s/%s" !input file in if Sys.file_exists src then begin let tgt = Printf.sprintf "%s/%s" !output file in do_mkdir (Filename.dirname tgt) ; do_copy src tgt ; do_chmod tgt ; end else if !warning then Format.printf "[install] File %S not found@." src with | Failure msg | Sys_error msg -> Format.printf "[install] %s@." msg ; exit 1 | Unix.Unix_error (e,_,_) -> let msg = Unix.error_message e in Format.printf "[install] Error: %s@." msg ; exit 2 | e -> let msg = Printexc.to_string e in Format.printf "[install] Error: %s@." msg ; exit 2 let () = Arg.parse [ "-v" , Arg.Set verbose , "verbose mode" ; "-q" , Arg.Clear verbose , "quiet mode (default)" ; "-p" , Arg.Set path , "create output directories" ; "-f" , Arg.Clear warning , "ignore warnings" ; "-i" , Arg.Set_string input , "<dir> set input directory (defaults to '.')" ; "-d" , Arg.Set_string output , "<dir> set output directory (mandatory)" ; "-m" , Arg.Set_string mode , "<mode> change mode of copied files (use \"default\" to reset)" ; "-s" , Arg.Set summary , "print number of installed files." ; "-b", Arg.Set binary, "set binary mode for copying files."; ] do_install "Usage: install [options|files]\n\n\ Copy all files from input directory to output directory.\n\ Files must be given with their relative paths to input/output.\n\ Options and files are processed in order (each option only\n\ apply to subsequent files).\n" let () = if !summary then match !count with | 0 -> Format.printf "No file installed.@." | 1 -> Format.printf "One single file installed.@." | n -> Format.printf "%d files installed.@." n ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/why3/�����������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016105� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/why3/frama_c_wp/������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020203� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/why3/frama_c_wp/cbits.mlw���������������������������������0000666�0000000�0000000�00000062300�13571573400�022031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- C-Bits Arithmetics for Why-3 --- *) (* -------------------------------------------------------------------------- *) theory Cbits use int.Int use bool.Bool use frama_c_wp.cint.Cint use frama_c_wp.qed.Qed function bit_testb int int : bool predicate bit_test int int (** * C-Integer Bits * **) function lnot int : int function land int int : int function lxor int int : int function lor int int : int meta AC function land meta AC function lxor meta AC function lor function lsl int int : int function lsr int int : int (** * Bitwise identities *) (** ** lnot identities *) axiom lnot_bool: ((lnot 0) = (-1)) /\ ((lnot (-1)) = 0) (** ** land identities *) axiom land_idemp: forall x:int [land x x]. (land x x) = x axiom land_0: forall x:int [land 0 x]. (land 0 x) = 0 axiom land_0bis: forall x:int [land x 0]. (land x 0) = 0 axiom land_1: forall x:int [land (-1) x]. (land (-1) x) = x axiom land_1bis: forall x:int [land x (-1)]. (land x (-1)) = x axiom land_bool: (land 0 0) = 0 /\ (land 0 1) = 0 /\ (land 1 0) = 0 /\ (land 1 1) = 1 meta "remove_for_" axiom land_bool (** ** lor identities *) axiom lor_idemp: forall x:int [lor x x]. (lor x x) = x axiom lor_1: forall x:int [lor (-1) x]. (lor (-1) x) = -1 axiom lor_1bis: forall x:int [lor x (-1)]. (lor x (-1)) = -1 axiom lor_0: forall x:int [lor 0 x]. (lor 0 x) = x axiom lor_0bis: forall x:int [lor x 0]. (lor x 0) = x axiom lor_bool: (lor 0 0) = 0 /\ (lor 0 1) = 1 /\ (lor 1 0) = 1 /\ (lor 1 1) = 1 meta "remove_for_" axiom lor_bool (** ** lxor identities *) axiom lxor_nilpotent: forall x:int [lxor x x]. (lxor x x) = 0 axiom lxor_1: forall x:int [lxor (-1) x]. (lxor (-1) x) = (lnot x) axiom lxor_1bis: forall x:int [lxor x (-1)]. (lxor x (-1)) = (lnot x) axiom lxor_0: forall x:int [lxor 0 x]. (lxor 0 x) = x axiom lxor_0bis: forall x:int [lxor x 0]. (lxor x 0) = x axiom lxor_bool: (lxor 0 0) = 0 /\ (lxor 0 1) = 1 /\ (lxor 1 0) = 1 /\ (lxor 1 1) = 0 meta "remove_for_" axiom lxor_bool (** * Bit extraction *) (** ** Definition of bit_test predicate *) axiom bit_test_def: forall x k:int [bit_testb x k]. (bit_testb x k = True) <-> bit_test x k (** * Link between Bit extraction and bitwise operators *) (** ** Some properties of bit extration *) (** ** Logical operators *) axiom bit_test_extraction: forall x k:int [land x (lsl 1 k)|land (lsl 1 k) x]. 0<=k -> (land x (lsl 1 k))<>0 <-> (bit_test x k) lemma bit_test_extraction_eq: forall x k:int [land x (lsl 1 k)|land (lsl 1 k) x]. 0<=k -> (land x (lsl 1 k))=(lsl 1 k) <-> (bit_test x k) meta "remove_for_" lemma bit_test_extraction_eq axiom lsl_1_0: lsl 1 0 = 1 axiom bit_test_extraction_bis: forall x :int [land x 1|land 1 x]. (land 1 x)<>0 -> (bit_test x 0) axiom bit_test_extraction_bis_eq: forall x :int [land x 1|land 1 x]. (bit_test x 0) -> (land 1 x)=1 lemma lnot_extraction_bool: forall x i:int [bit_testb (lnot x) i]. 0<=i -> bit_testb (lnot x) i = notb (bit_testb x i) axiom lnot_extraction: forall x i:int [bit_test (lnot x) i]. 0<=i -> (bit_test (lnot x) i) <-> not (bit_test x i) meta "remove_for_" lemma lnot_extraction_bool lemma land_extraction_bool: forall x y i:int [bit_testb (land x y) i]. 0<=i -> bit_testb (land x y) i = andb (bit_testb x i) (bit_testb y i) axiom land_extraction: forall x y i:int [bit_test (land x y) i]. 0<=i -> bit_test (land x y) i <-> ((bit_test x i) /\ (bit_test y i)) meta "remove_for_" lemma land_extraction_bool lemma lor_extraction_bool: forall x y i:int [bit_testb (lor x y) i]. 0<=i -> bit_testb (lor x y) i = orb (bit_testb x i) (bit_testb y i) axiom lor_extraction: forall x y i:int [bit_test (lor x y) i]. 0<=i -> (bit_test (lor x y) i) <-> ((bit_test x i) \/ (bit_test y i)) meta "remove_for_" lemma lor_extraction_bool lemma lxor_extraction_bool: forall x y i:int [bit_testb (lxor x y) i]. 0<=i -> bit_testb (lxor x y) i = xorb (bit_testb x i) (bit_testb y i) axiom lxor_extraction: forall x y i:int [bit_test (lxor x y) i]. 0<=i -> (bit_test (lxor x y) i) <-> ((bit_test x i) <-> not (bit_test y i)) meta "remove_for_" lemma lxor_extraction_bool (** ** Shift operators *) lemma lsl_1_two_power : forall n : int. 0 <= n -> lsl 1 n = Cint.two_power_abs n meta "remove_for_" lemma lsl_1_two_power axiom land_1_lsl_1 : forall a x n : int [(lsl 1 (1+n)),(lsl 1 n),(2*a+(land 1 x))] . 0<=n -> a<lsl 1 n -> 2*a+(land 1 x)<lsl 1 (1+n) lemma lsl_extraction_sup_bool: forall x n m:int [bit_testb (lsl x n) m]. 0<=n -> 0<=m -> m>=n -> bit_testb (lsl x n) m = bit_testb x (m-n) axiom lsl_extraction_sup: forall x n m:int [bit_test (lsl x n) m]. 0<=n -> 0<=m -> m>=n -> (bit_test (lsl x n) m) <-> (bit_test x (m-n)) meta "remove_for_" lemma lsl_extraction_sup_bool lemma lsl_extraction_inf_bool: forall x n m:int [bit_testb (lsl x n) m]. 0<=n -> 0<=m -> m< n -> bit_testb (lsl x n) m = False axiom lsl_extraction_inf: forall x n m:int [bit_test (lsl x n) m]. 0<=n -> 0<=m -> m< n -> not (bit_test (lsl x n) m) meta "remove_for_" lemma lsl_extraction_inf_bool lemma lsr_extraction_bool: forall x n m:int [bit_testb (lsr x n) m]. 0<=n -> 0<=m -> bit_testb (lsr x n) m = bit_testb x (m+n) axiom lsr_extractionl: forall x n m:int [bit_test (lsr x n) m]. 0<=n -> 0<=m -> (bit_test (lsr x n) m) <-> (bit_test x (m+n)) meta "remove_for_" lemma lsr_extraction_bool lemma lsl1_extraction_bool: forall i j:int [bit_testb (lsl 1 i) j]. 0<=i -> 0<=j -> bit_testb (lsl 1 i) j = eqb i j axiom lsl1_extraction: forall i j:int [bit_test (lsl 1 i) j]. 0<=i -> 0<=j -> (bit_test (lsl 1 i) j) <-> i=j meta "remove_for_" lemma lsl1_extraction_bool lemma pos_extraction_sup: forall x i j:int [(lsl 1 i),(bit_test x j)]. 0<=x -> 0<=i -> x < (lsl 1 i) -> i <= j -> not (bit_test x j) meta "remove_for_" lemma pos_extraction_sup lemma pos_extraction_sup_inv: forall x i :int . 0<=i -> (forall j: int . i <= j -> not (bit_test x j)) -> 0<= x < (lsl 1 i) meta "remove_for_" lemma pos_extraction_sup_inv (** * Link between Bit extraction and C type conversions *) (** ** Unsigned conversions *) lemma to_uint_extraction_sup: forall n x i:int . 0<=n<=i -> is_uint n x -> not (bit_test x i) lemma to_uint_extraction_inf_bool: forall n x i:int . 0<=i<n -> (bit_testb (to_uint n x) i) = (bit_testb x i) lemma to_uint_extraction_inf: forall n x i:int . 0<=i<n -> (bit_test (to_uint n x) i) <-> (bit_test x i) lemma is_uint_ext : forall n x y:int . 0<=n -> is_uint n x -> is_uint n y -> (forall i: int. 0<=i<n -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma to_uint_extraction_sup meta "remove_for_" lemma to_uint_extraction_inf_bool meta "remove_for_" lemma to_uint_extraction_inf meta "remove_for_" lemma is_uint_ext (** *** Cast to uint8 C type *) axiom to_uint8_extraction_sup: forall x i:int [(is_uint8 x),(bit_test x i)]. 8<=i -> is_uint8 x -> not (bit_test x i) lemma to_uint8_extraction_inf_bool: forall x i:int [bit_testb (to_uint8 x) i]. 0<=i<8 -> (bit_testb (to_uint8 x) i) = (bit_testb x i) axiom to_uint8_extraction_inf: forall x i:int [bit_test (to_uint8 x) i]. 0<=i<8 -> (bit_test (to_uint8 x) i) <-> (bit_test x i) meta "remove_for_" lemma to_uint8_extraction_inf_bool lemma is_uint8_ext : forall x y:int . is_uint8 x -> is_uint8 y -> (forall i: int. 0<=i<8 -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma is_uint8_ext (** *** Cast to uint16 C type *) axiom to_uint16_extraction_sup: forall x i:int [(is_uint16 x),(bit_test x i)]. 16<=i -> is_uint16 x -> not (bit_test x i) lemma to_uint16_extraction_inf_bool: forall x i:int [bit_testb (to_uint16 x) i]. 0<=i<16 -> (bit_testb (to_uint16 x) i) = (bit_testb x i) axiom to_uint16_extraction_inf: forall x i:int [bit_test (to_uint16 x) i]. 0<=i<16 -> (bit_test (to_uint16 x) i) <-> (bit_test x i) meta "remove_for_" lemma to_uint16_extraction_inf_bool lemma is_uint16_ext : forall x y:int . is_uint16 x -> is_uint16 y -> (forall i: int. 0<=i<16 -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma is_uint16_ext (** *** Cast to uint32 C type *) axiom to_uint32_extraction_sup: forall x i:int [(is_uint32 x),(bit_test x i)]. 32<=i -> is_uint32 x -> not (bit_test x i) lemma to_uint32_extraction_inf_bool: forall x i:int [bit_testb (to_uint32 x) i]. 0<=i<32 -> (bit_testb (to_uint32 x) i) = (bit_testb x i) axiom to_uint32_extraction_inf: forall x i:int [bit_test (to_uint32 x) i]. 0<=i<32 -> (bit_test (to_uint32 x) i) <-> (bit_test x i) meta "remove_for_" lemma to_uint32_extraction_inf_bool lemma is_uint32_ext : forall x y:int . is_uint32 x -> is_uint32 y -> (forall i: int. 0<=i<32 -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma is_uint32_ext (** *** Cast to uint64 C type *) axiom to_uint64_extraction_sup: forall x i:int [(is_uint64 x),(bit_test x i)]. 64<=i -> (is_uint64 x) -> not (bit_test x i) lemma to_uint64_extraction_inf_bool: forall x i:int [bit_testb (to_uint64 x) i]. 0<=i<64 -> (bit_testb (to_uint64 x) i) = (bit_testb x i) axiom to_uint64_extraction_inf: forall x i:int [bit_test (to_uint64 x) i]. 0<=i<64 -> (bit_test (to_uint64 x) i) <-> (bit_test x i) meta "remove_for_" lemma to_uint64_extraction_inf_bool lemma is_uint64_ext : forall x y:int . is_uint64 x -> is_uint64 y -> (forall i: int. 0<=i<64 -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma is_uint64_ext (** ** Signed conversions *) lemma to_sint_extraction_sup: forall n x i:int . 0<=n<=i -> is_sint n x -> (bit_test x i) <-> x < 0 lemma to_sint_extraction_inf_bool: forall n x i:int . 0<=i<n -> (bit_testb (to_sint n x) i) = (bit_testb x i) lemma to_sint_extraction_inf: forall n x i:int . 0<=i<n -> (bit_test (to_sint n x) i) <-> (bit_test x i) lemma is_sint_ext : forall n x y:int . 0<=n -> is_sint n x -> is_sint n y -> (forall i: int. 0<=i<=n -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma to_sint_extraction_sup meta "remove_for_" lemma to_sint_extraction_inf_bool meta "remove_for_" lemma to_sint_extraction_inf meta "remove_for_" lemma is_sint_ext (** *** Cast to sint8 C type *) axiom to_sint8_extraction_sup: forall x i:int [(is_sint8 x),(bit_test x i)]. 7<=i -> is_sint8 x -> (bit_test x i) <-> x < 0 lemma to_sint8_extraction_inf_bool: forall x i:int [(bit_testb (to_sint8 x) i)]. 0<=i<7 -> (bit_testb (to_sint8 x) i) = (bit_testb x i) axiom to_sint8_extraction_inf: forall x i:int [(bit_test (to_sint8 x) i)]. 0<=i<7 -> (bit_test (to_sint8 x) i) <-> (bit_test x i) meta "remove_for_" lemma to_sint8_extraction_inf_bool lemma is_sint8_ext : forall x y:int . is_sint8 x -> is_sint8 y -> (forall i: int. 0<=i<=7 -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma is_sint8_ext (** *** Cast to sint16 C type *) axiom to_sint16_extraction_sup: forall x i:int [(is_sint16 x),(bit_test x i)]. 15<=i -> is_sint16 x -> (bit_test x i) <-> x < 0 lemma to_sint16_extraction_inf_bool: forall x i:int [bit_testb (to_sint16 x) i]. 0<=i<15 -> (bit_testb (to_sint16 x) i) = (bit_testb x i) axiom to_sint16_extraction_inf: forall x i:int [bit_test (to_sint16 x) i]. 0<=i<15 -> (bit_test (to_sint16 x) i) <-> (bit_test x i) meta "remove_for_" lemma to_sint16_extraction_inf_bool lemma is_sint16_ext : forall x y:int . is_sint16 x -> is_sint16 y -> (forall i: int. 0<=i<=15 -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma is_sint16_ext (** *** Cast to sint32 C type *) axiom to_sint32_extraction_sup: forall x i:int [(is_sint32 x),(bit_test x i)]. 31<=i -> is_sint32 x -> (bit_test x i) <-> x < 0 lemma to_sint32_extraction_inf_bool: forall x i:int [bit_testb (to_sint32 x) i]. 0<=i<31 -> (bit_testb (to_sint32 x) i) = (bit_testb x i) axiom to_sint32_extraction_inf: forall x i:int [bit_test (to_sint32 x) i]. 0<=i<31 -> (bit_test (to_sint32 x) i) <-> (bit_test x i) meta "remove_for_" lemma to_sint32_extraction_inf_bool lemma is_sint32_ext : forall x y:int . is_sint32 x -> is_sint32 y -> (forall i: int. 0<=i<=31 -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma is_sint32_ext (** *** Cast to sint64 C type *) axiom to_sint64_extraction_sup: forall x i:int [(is_sint64 x),(bit_test x i)]. 63<=i -> is_sint64 x -> (bit_test x i) <-> x < 0 lemma to_sint64_extraction_inf_bool: forall x i:int [bit_testb (to_sint64 x) i]. 0<=i<63 -> (bit_testb (to_sint64 x) i) = (bit_testb x i) axiom to_sint64_extraction_inf: forall x i:int [bit_test (to_sint64 x) i]. 0<=i<63 -> (bit_test (to_sint64 x) i) <-> (bit_test x i) meta "remove_for_" lemma to_sint64_extraction_inf_bool lemma is_sint64_ext : forall x y:int . is_sint64 x -> is_sint64 y -> (forall i: int. 0<=i<=63 -> (bit_test x i <-> bit_test y i)) -> x = y meta "remove_for_" lemma is_sint64_ext (** * Some C-Integer Bits Conversions are distributive *) (** ** Unsigned conversions *) lemma to_uint_lor : forall n x y:int. to_uint n (lor x y) = lor (to_uint n x) (to_uint n y) meta "remove_for_" lemma to_uint_lor (** *** Cast to uint8 C type *) lemma to_uint8_lor : forall x y:int [to_uint8 (lor x y)]. to_uint8 (lor x y) = lor (to_uint8 x) (to_uint 8 y) meta "remove_for_" lemma to_uint8_lor (** *** Cast to uint16 C type *) lemma to_uint16_lor : forall x y:int [to_uint16 (lor x y)]. to_uint16 (lor x y) = lor (to_uint16 x) (to_uint16 y) meta "remove_for_" lemma to_uint16_lor (** *** Cast to uint32 C type *) axiom to_uint32_lor : forall x y:int [to_uint32 (lor x y)]. to_uint32 (lor x y) = lor (to_uint32 x) (to_uint32 y) meta "remove_for_" axiom to_uint32_lor (** *** Cast to uint64 C type *) lemma to_uint64_lor : forall x y:int [to_uint64 (lor x y)]. to_uint64 (lor x y) = lor (to_uint64 x) (to_uint64 y) meta "remove_for_" lemma to_uint64_lor (** * Some C-Integer Bits Conversions are identity *) (** ** Unsigned conversions *) lemma is_uint_lxor : forall n x y:int. is_uint n x -> is_uint n y -> to_uint n (lxor x y) = lxor x y lemma is_uint_lor : forall n x y:int. is_uint n x -> is_uint n y -> to_uint n (lor x y) = lor x y lemma is_uint_land : forall n x y:int. is_uint n x -> is_uint n y -> to_uint n (land x y) = land x y lemma is_uint_lsr : forall n x y:int. 0<=y -> is_uint n x -> to_uint n (lsr x y) = lsr x y lemma is_uint_lsl1_inf : forall n y:int. 0<=y<n -> to_uint n (lsl 1 y) = lsl 1 y lemma is_uint_lsl1_sup : forall n y:int. 0<=n<=y -> to_uint n (lsl 1 y) = 0 meta "remove_for_" lemma is_uint_lor meta "remove_for_" lemma is_uint_land meta "remove_for_" lemma is_uint_lsr meta "remove_for_" lemma is_uint_lsl1_inf meta "remove_for_" lemma is_uint_lsl1_sup (** *** Cast to uint8 C type *) axiom is_uint8_lxor : forall x y:int [to_uint8 (lxor x y)]. is_uint8 x -> is_uint8 y -> to_uint8 (lxor x y) = lxor x y axiom is_uint8_lor : forall x y:int [to_uint8 (lor x y)]. is_uint8 x -> is_uint8 y -> to_uint8 (lor x y) = lor x y axiom is_uint8_land : forall x y:int [to_uint8 (land x y)]. is_uint8 x -> is_uint8 y -> to_uint8 (land x y) = land x y axiom is_uint8_lsr : forall x y:int [to_uint8 (lsr x y)]. 0<=y -> is_uint8 x -> to_uint8 (lsr x y) = lsr x y axiom is_uint8_lsl1_inf : forall y:int [to_uint8 (lsl 1 y)]. 0<=y<8 -> to_uint8 (lsl 1 y) = lsl 1 y axiom is_uint8_lsl1_sup : forall y:int [to_uint8 (lsl 1 y)]. 8<=y -> to_uint8 (lsl 1 y) = 0 (** *** Cast to uint16 C type *) axiom is_uint16_lxor : forall x y:int [to_uint16 (lxor x y)]. is_uint16 x -> is_uint16 y -> to_uint16 (lxor x y) = lxor x y axiom is_uint16_lor : forall x y:int [to_uint16 (lor x y)]. is_uint16 x -> is_uint16 y -> to_uint16 (lor x y) = lor x y axiom is_uint16_land : forall x y:int [to_uint16 (land x y)]. is_uint16 x -> is_uint16 y -> to_uint16 (land x y) = land x y axiom is_uint16_lsr : forall x y:int [to_uint16 (lsr x y)]. 0<=y -> is_uint16 x -> to_uint16 (lsr x y) = lsr x y axiom is_uint16_lsl1_inf : forall y:int [to_uint16 (lsl 1 y)]. 0<=y<16 -> to_uint16 (lsl 1 y) = lsl 1 y axiom is_uint16_lsl1_sup : forall y:int [to_uint16 (lsl 1 y)]. 16<=y -> to_uint16 (lsl 1 y) = 0 (** *** Cast to uint32 C type *) axiom is_uint32_lxor : forall x y:int [to_uint32 (lxor x y)]. is_uint32 x -> is_uint32 y -> to_uint32 (lxor x y) = lxor x y axiom is_uint32_lor : forall x y:int [to_uint32 (lor x y)]. is_uint32 x -> is_uint32 y -> to_uint32 (lor x y) = lor x y axiom is_uint32_land : forall x y:int [to_uint32 (land x y)]. is_uint32 x -> is_uint32 y -> to_uint32 (land x y) = land x y axiom is_uint32_lsr : forall x y:int [to_uint32 (lsr x y)]. 0<=y -> is_uint32 x -> to_uint32 (lsr x y) = lsr x y axiom is_uint32_lsl1_inf : forall y:int [to_uint32 (lsl 1 y)]. 0<=y<32 -> to_uint32 (lsl 1 y) = lsl 1 y axiom is_uint32_lsl1_sup : forall y:int [to_uint32 (lsl 1 y)]. 32<=y -> to_uint32 (lsl 1 y) = 0 (** *** Cast to uint64 C type *) axiom is_uint64_lxor : forall x y:int [to_uint64 (lxor x y)]. is_uint64 x -> is_uint64 y -> to_uint64 (lxor x y) = lxor x y axiom is_uint64_lor : forall x y:int [to_uint64 (lor x y)]. is_uint64 x -> is_uint64 y -> to_uint64 (lor x y) = lor x y axiom is_uint64_land : forall x y:int [to_uint64 (land x y)]. is_uint64 x -> is_uint64 y -> to_uint64 (land x y) = land x y axiom is_uint64_lsr : forall x y:int [to_uint64 (lsr x y)]. 0<=y -> is_uint64 x -> to_uint64 (lsr x y) = lsr x y axiom is_uint64_lsl1_inf : forall y:int [to_uint64 (lsl 1 y)]. 0<=y<64 -> to_uint64 (lsl 1 y) = lsl 1 y axiom is_uint64_lsl1_sup : forall y:int [to_uint64 (lsl 1 y)]. 64<=y -> to_uint64 (lsl 1 y) = 0 (** ** Signed conversions *) lemma is_sint_lnot: forall n x:int. is_sint n x -> to_sint n (lnot x) = lnot x lemma is_sint_lxor: forall n x y:int. is_sint n x -> is_sint n y -> to_sint n (lxor x y) = lxor x y lemma is_sint_lor: forall n x y:int. is_sint n x -> is_sint n y -> to_sint n (lor x y) = lor x y lemma is_sint_land: forall n x y:int. is_sint n x -> is_sint n y -> to_sint n (land x y) = land x y lemma is_sint_lsr: forall n x y:int. 0<=y -> is_sint n x -> to_sint n (lsr x y) = lsr x y lemma is_sint_lsl1_inf : forall n y:int. 0<=y<n -> to_sint n (lsl 1 y) = (lsl 1 y) lemma is_sint_lsl1_sup : forall n y:int. 0<=n<y -> to_sint n (lsl 1 y) = 0 meta "remove_for_" lemma is_sint_lnot meta "remove_for_" lemma is_sint_lxor meta "remove_for_" lemma is_sint_lor meta "remove_for_" lemma is_sint_land meta "remove_for_" lemma is_sint_lsr meta "remove_for_" lemma is_sint_lsl1_inf meta "remove_for_" lemma is_sint_lsl1_sup (** *** Cast to sint8 C type *) axiom is_sint8_lnot: forall x:int [to_sint8 (lnot x)]. is_sint8 x -> to_sint8 (lnot x) = lnot x axiom is_sint8_lxor: forall x y:int [to_sint8 (lxor x y)]. is_sint8 x -> is_sint8 y -> to_sint8 (lxor x y) = lxor x y axiom is_sint8_lor: forall x y:int [to_sint8 (lor x y)]. is_sint8 x -> is_sint8 y -> to_sint8 (lor x y) = lor x y axiom is_sint8_land: forall x y:int [to_sint8 (land x y)]. is_sint8 x -> is_sint8 y -> to_sint8 (land x y) = land x y axiom is_sint8_lsr: forall x y:int [to_sint8 (lsr x y)]. 0<=y -> is_sint8 x -> to_sint8 (lsr x y) = lsr x y axiom is_sint8_lsl1 : lsl 1 7 = Cint.max_sint8 axiom is_sint8_lsl1_inf : forall y:int [to_sint8 (lsl 1 y)]. 0<=y<7 -> to_sint8 (lsl 1 y) = lsl 1 y axiom is_sint8_lsl1_sup : forall y:int [to_sint8 (lsl 1 y)]. 8<=y -> to_sint8 (lsl 1 y) = 0 (** *** Cast to sint16 C type *) axiom is_sint16_lnot : forall x:int [to_sint16 (lnot x)]. is_sint16 x -> to_sint16 (lnot x) = lnot x axiom is_sint16_lxor : forall x y:int [to_sint16 (lxor x y)]. is_sint16 x -> is_sint16 y -> to_sint16 (lxor x y) = lxor x y axiom is_sint16_lor : forall x y:int [to_sint16 (lor x y)]. is_sint16 x -> is_sint16 y -> to_sint16 (lor x y) = lor x y axiom is_sint16_land : forall x y:int [to_sint16 (land x y)]. is_sint16 x -> is_sint16 y -> to_sint16 (land x y) = land x y axiom is_sint16_lsr : forall x y:int [to_sint16 (lsr x y)]. 0<=y -> is_sint16 x -> to_sint16 (lsr x y) = lsr x y axiom is_sint16_lsl1 : lsl 1 15 = Cint.max_sint16 axiom is_sint16_lsl1_inf : forall y:int [to_sint16 (lsl 1 y)]. 0<=y<15 -> to_sint16 (lsl 1 y) = (lsl 1 y) axiom is_sint16_lsl1_sup : forall y:int [to_sint16 (lsl 1 y)]. 16<=y -> to_sint16 (lsl 1 y) = 0 (** *** Cast to sint32 C type *) axiom is_sint32_lnot : forall x:int [to_sint32(lnot(x))]. is_sint32 x -> to_sint32 (lnot x) = lnot x axiom is_sint32_lxor : forall x y:int [to_sint32 (lxor x y)]. is_sint32 x -> is_sint32 y -> to_sint32 (lxor x y) = lxor x y axiom is_sint32_lor : forall x y:int [to_sint32(lor x y)]. is_sint32 x -> is_sint32 y -> to_sint32 (lor x y) = lor x y axiom is_sint32_land : forall x y:int [to_sint32 (land x y)]. is_sint32 x -> is_sint32 y -> to_sint32 (land x y) = land x y axiom is_sint32_lsr : forall x y:int [to_sint32 (lsr x y)]. 0<=y -> is_sint32 x -> to_sint32 (lsr x y) = lsr x y axiom is_sint32_lsl1 : lsl 1 31 = Cint.max_sint32 axiom is_sint32_lsl1_inf : forall y:int [to_sint32 (lsl 1 y)]. 0<=y<31 -> to_sint32 (lsl 1 y) = lsl 1 y axiom is_sint32_lsl1_sup : forall y:int [to_sint32 (lsl 1 y)]. 32<=y -> to_sint32 (lsl 1 y) = 0 (** *** Cast to sint64 C type *) axiom is_sint64_lnot : forall x:int [to_sint64 (lnot x)]. is_sint64 x -> to_sint64 (lnot x) = lnot x axiom is_sint64_lxor : forall x y:int [to_sint64 (lxor x y)]. is_sint64 x -> is_sint64 y -> to_sint64 (lxor x y) = lxor x y axiom is_sint64_lor : forall x y:int [to_sint64(lor x y)]. is_sint64 x -> is_sint64 y -> to_sint64 (lor x y) = lor x y axiom is_sint64_land : forall x y:int [to_sint64 (land x y)]. is_sint64 x -> is_sint64 y -> to_sint64 (land x y) = land x y axiom is_sint64_lsr : forall x y:int [to_sint64 (lsr x y)]. 0<=y -> is_sint64 x -> to_sint64 (lsr x y) = lsr x y axiom is_sint64_lsl1 : lsl 1 63 = Cint.max_sint64 axiom is_sint64_lsl1_inf : forall y:int [to_sint64 (lsl 1 y)]. 0<=y<63 -> to_sint64 (lsl 1 y) = lsl 1 y axiom is_sint64_lsl1_sup : forall y:int [to_sint64 (lsl 1 y)]. 64<=y -> to_sint64 (lsl 1 y) = 0 (** * Range of some bitwise operations *) lemma uint_land_range : forall x y: int . 0<=x -> 0 <= land x y <= x meta "remove_for_" lemma uint_land_range lemma uint_lor_inf : forall x y: int . -1<=x -> 0<=y -> x <= lor x y meta "remove_for_" lemma uint_lor_inf lemma sint_land_inf : forall x y: int . x<=0 -> y<0 -> land x y <= x meta "remove_for_" lemma sint_land_inf lemma sint_lor_range : forall x y: int . x<0 -> x <= lor x y < 0 meta "remove_for_" lemma sint_lor_range lemma is_uint_lor_distrib : forall n x y: int . (is_uint n (lor x y)) <-> ((is_uint n x) && (is_uint n y)) meta "remove_for_" lemma is_uint_lor_distrib (** * Link between bitwise operators and addition *) axiom lor_addition : forall x y: int [(land x y), (lor x y) ]. land x y = 0 -> x + y = lor x y axiom lxor_addition : forall x y: int [(land x y), (lxor x y) ]. land x y = 0 -> x + y = lxor x y (** * Link between land and cast operator *) lemma to_uint_land_edge : forall x n: int. 0<=n -> to_uint n x = land ((lsl 1 n) - 1) x meta "remove_for_" lemma to_uint_land_edge end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/why3/frama_c_wp/cfloat.mlw��������������������������������0000666�0000000�0000000�00000023357�13571573400�022206� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- C-Integer Arithmetics for Alt-Ergo --- *) (* -------------------------------------------------------------------------- *) theory Cfloat use bool.Bool use real.RealInfix use real.Abs use real.Square use real.FromInt (* -------------------------------------------------------------------------- *) (* --- C-Integer Arithmetics for Alt-Ergo --- *) (* -------------------------------------------------------------------------- *) type f32 (* single precision IEEE *) type f64 (* double precision IEEE *) (* C-Float Conversion *) function to_f32 real : f32 function of_f32 f32 : real function to_f64 real : f64 function of_f64 f64 : real axiom to_f32_zero: of_f32 (to_f32 0.0) = 0.0 axiom to_f32_one: of_f32 (to_f32 1.0) = 1.0 axiom to_f64_zero: of_f64 (to_f64 0.0) = 0.0 axiom to_f64_one: of_f64 (to_f64 1.0) = 1.0 (* C-Float Rounding Modes *) type rounding_mode = Up | Down | ToZero | NearestTiesToAway | NearestTiesToEven function round_float rounding_mode real : f32 function round_double rounding_mode real : f64 axiom float_32: forall x:real [ round_float NearestTiesToEven x ]. to_f32 x = round_float NearestTiesToEven x axiom float_64: forall x:real [ round_double NearestTiesToEven x ]. to_f64 x = round_double NearestTiesToEven x (* C-Float Classification *) type float_kind = Finite | NaN | Inf_pos | Inf_neg function classify_f32 f32 : float_kind function classify_f64 f64 : float_kind predicate is_finite_f32 (f:f32) = (classify_f32 f = Finite) predicate is_finite_f64 (d:f64) = (classify_f64 d = Finite) predicate is_NaN_f32 (f:f32) = (classify_f32 f = NaN) predicate is_NaN_f64 (d:f64) = (classify_f64 d = NaN) predicate is_infinite_f32 (f:f32) = (classify_f32 f = Inf_pos || classify_f32 f = Inf_neg) predicate is_infinite_f64 (d:f64) = (classify_f64 d = Inf_pos || classify_f64 d = Inf_neg) predicate is_positive_infinite_f32 (f:f32) = (classify_f32 f = Inf_pos) predicate is_positive_infinite_f64 (d:f64) = (classify_f64 d = Inf_pos) predicate is_negative_infinite_f32 (f:f32) = (classify_f32 f = Inf_neg) predicate is_negative_infinite_f64 (d:f64) = (classify_f64 d = Inf_neg) axiom is_finite_to_float_32 : forall x:real [is_finite_f32(to_f32 x)]. is_finite_f32 (to_f32 x) axiom is_finite_to_float_64 : forall x:real [is_finite_f64(to_f64 x)]. is_finite_f64 (to_f64 x) axiom to_float_is_finite_32 : forall f:f32 [ to_f32( of_f32 f ) | is_finite_f32(f) ]. is_finite_f32(f) -> to_f32( of_f32 f ) = f axiom to_float_is_finite_64 : forall d:f64 [ to_f64( of_f64 d ) | is_finite_f64(d) ]. is_finite_f64(d) -> to_f64( of_f64 d ) = d (* Finite Constants *) predicate finite (x:real) = (is_finite_f32 (to_f32 x)) /\ (is_finite_f64 (to_f64 x)) constant max_f32 : real = 340282346600000016151267322115014000640.0 constant max_f64 : real = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 axiom finite_small_f32 : forall x:real. -. max_f64 <=. x <=. max_f32 -> is_finite_f32(to_f32 x) axiom finite_small_f64 : forall x:real. -. max_f64 <=. x <=. max_f64 -> is_finite_f64(to_f64 x) axiom finite_range_f32 : forall f:f32. is_finite_f32(f) <-> -. max_f32 <=. of_f32 f <=. max_f32 axiom finite_range_f64 : forall d:f64. is_finite_f64(d) <-> -. max_f64 <=. of_f64 d <=. max_f64 (* Equal *) function eq_f32b (x:f32) (y:f32) : bool function eq_f64b (x:f64) (y:f64) : bool predicate eq_f32 (x:f32) (y:f32) = (eq_f32b x y = true) predicate eq_f64 (x:f64) (y:f64) = (eq_f64b x y = true) axiom eq_finite_f32 : forall x,y:f32 [eq_f32 x y]. is_finite_f32 x -> is_finite_f32 y -> eq_f32 x y <-> of_f32 x = of_f32 y axiom eq_finite_f64 : forall x,y:f64 [eq_f64 x y]. is_finite_f64 x -> is_finite_f64 y -> eq_f64 x y <-> of_f64 x = of_f64 y (* Not Equal *) function ne_f32b (x:f32) (y:f32) : bool function ne_f64b (x:f64) (y:f64) : bool predicate ne_f32 (x:f32) (y:f32) = (ne_f32b x y = true) predicate ne_f64 (x:f64) (y:f64) = (ne_f64b x y = true) axiom ne_finite_f32 : forall x,y:f32 [ne_f32 x y]. is_finite_f32 x -> is_finite_f32 y -> ne_f32 x y <-> of_f32 x <> of_f32 y axiom ne_finite_f64 : forall x,y:f64 [ne_f64 x y]. is_finite_f64 x -> is_finite_f64 y -> ne_f64 x y <-> of_f64 x <> of_f64 y (* Comparison (<=) *) function le_f32b (x:f32) (y:f32) : bool function le_f64b (x:f64) (y:f64) : bool predicate le_f32 (x:f32) (y:f32) = (le_f32b x y = true) predicate le_f64 (x:f64) (y:f64) = (le_f64b x y = true) axiom le_finite_f32 : forall x,y:f32 [le_f32 x y]. is_finite_f32 x -> is_finite_f32 y -> le_f32 x y <-> of_f32 x <=. of_f32 y axiom le_finite_f64 : forall x,y:f64 [le_f64 x y]. is_finite_f64 x -> is_finite_f64 y -> le_f64 x y <-> of_f64 x <=. of_f64 y (* Comparison (<) *) function lt_f32b (x:f32) (y:f32) : bool function lt_f64b (x:f64) (y:f64) : bool predicate lt_f32 (x:f32) (y:f32) = (lt_f32b x y = true) predicate lt_f64 (x:f64) (y:f64) = (lt_f64b x y = true) axiom lt_finite_f32 : forall x,y:f32 [lt_f32 x y]. is_finite_f32 x -> is_finite_f32 y -> lt_f32 x y <-> of_f32 x <. of_f32 y axiom lt_finite_f64 : forall x,y:f64 [lt_f64 x y]. is_finite_f64 x -> is_finite_f64 y -> lt_f64 x y <-> of_f64 x <. of_f64 y (* Negation *) function neg_f32 (x:f32) : f32 function neg_f64 (x:f64) : f64 axiom neg_finite_f32 : forall x:f32 [neg_f32 x]. is_finite_f32 x -> of_f32 (neg_f32 x) = -. (of_f32 x) axiom neg_finite_f64 : forall x:f64 [neg_f64 x]. is_finite_f64 x -> of_f64 (neg_f64 x) = -. (of_f64 x) (* Addition *) function add_f32 (x:f32) (y:f32) : f32 function add_f64 (x:f64) (y:f64) : f64 axiom add_finite_f32 : forall x,y:f32 [add_f32 x y]. is_finite_f32 x -> is_finite_f32 y -> add_f32 x y = to_f32 (of_f32 x +. of_f32 y) axiom add_finite_f64 : forall x,y:f64 [add_f64 x y]. is_finite_f64 x -> is_finite_f64 y -> add_f64 x y = to_f64 (of_f64 x +. of_f64 y) (* Multiplication *) function mul_f32 (x:f32) (y:f32) : f32 function mul_f64 (x:f64) (y:f64) : f64 axiom mul_finite_f32 : forall x,y:f32 [mul_f32 x y]. is_finite_f32 x -> is_finite_f32 y -> mul_f32 x y = to_f32 (of_f32 x *. of_f32 y) axiom mul_finite_f64 : forall x,y:f64 [mul_f64 x y]. is_finite_f64 x -> is_finite_f64 y -> mul_f64 x y = to_f64 (of_f64 x *. of_f64 y) (* Division *) function div_f32 (x:f32) (y:f32) : f32 function div_f64 (x:f64) (y:f64) : f64 axiom div_finite_f32 : forall x,y:f32 [div_f32 x y]. is_finite_f32 x -> is_finite_f32 y -> div_f32 x y = to_f32 (of_f32 x /. of_f32 y) axiom div_finite_f64 : forall x,y:f64 [div_f64 x y]. is_finite_f64 x -> is_finite_f64 y -> div_f64 x y = to_f64 (of_f64 x /. of_f64 y) (* Square Root *) function sqrt_f32 f32 : f32 function sqrt_f64 f64 : f64 axiom sqrt_finite_f32 : forall x:f32 [sqrt_f32 x]. is_finite_f32 x -> sqrt_f32 x = to_f32 (sqrt (of_f32 x)) axiom sqrt_finite_f64 : forall x:f64 [sqrt_f64 x]. is_finite_f64 x -> sqrt_f64 x = to_f64 (sqrt (of_f64 x)) (* Models *) function model_f32 (f:f32) : real function delta_f32 (f:f32) : real = abs( of_f32 f -. model_f32 f ) function error_f32 (f:f32) : real = (delta_f32 f) /. (abs (model_f32 f)) function model_f64 (f:f64) : real function delta_f64 (f:f64) : real = abs( of_f64 f -. model_f64 f ) function error_f64 (f:f64) : real = (delta_f64 f) /. (abs (model_f64 f)) end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/why3/frama_c_wp/cint.mlw����������������������������������0000666�0000000�0000000�00000023105�13571573400�021662� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- C-Integer Arithmetics for Why-3 --- *) (* -------------------------------------------------------------------------- *) theory Cint use int.Int use bool.Bool (** * C-Integer bounds * **) (** ** bounds are inlined into prover files ** **) function max_uint8: int = 256 function max_sint8: int = 128 function max_uint16: int = 65536 function max_sint16: int = 32768 function max_uint32: int = 4294967296 function max_sint32: int = 2147483648 function max_uint64: int = 18446744073709551616 function max_sint64: int = 9223372036854775808 (** * C-Integer Ranges * **) predicate is_bool(x:int) = x = 0 \/ x = 1 predicate is_uint8(x:int) = 0 <= x < max_uint8 predicate is_sint8(x:int) = -max_sint8 <= x < max_sint8 predicate is_uint16(x:int) = 0 <= x < max_uint16 predicate is_sint16(x:int) = -max_sint16 <= x < max_sint16 predicate is_uint32(x:int) = 0 <= x < max_uint32 predicate is_sint32(x:int) = -max_sint32 <= x < max_sint32 predicate is_uint64(x:int) = 0 <= x < max_uint64 predicate is_sint64(x:int) = -max_sint64 <= x < max_sint64 lemma is_bool0: is_bool(0) lemma is_bool1: is_bool(1) (* meta "def_into_axiom" predicate is_bool *) meta "def_into_axiom" predicate is_uint8 meta "def_into_axiom" predicate is_sint8 meta "def_into_axiom" predicate is_uint16 meta "def_into_axiom" predicate is_uint16 meta "def_into_axiom" predicate is_sint32 meta "def_into_axiom" predicate is_uint32 meta "def_into_axiom" predicate is_sint64 meta "def_into_axiom" predicate is_uint64 (** * C-Integer Conversion * **) function to_bool ( x : int ) : int = if x = 0 then 0 else 1 function to_uint8 int : int function to_sint8 int : int function to_uint16 int : int function to_sint16 int : int function to_uint32 int : int function to_sint32 int : int function to_uint64 int : int function to_sint64 int : int function two_power_abs int : int lemma two_power_abs_is_positive : forall n:int [ two_power_abs n ]. 0 < two_power_abs n lemma two_power_abs_plus_pos : forall n m:int . 0 <= n -> 0 <= m -> two_power_abs (n+m) = (two_power_abs n) * (two_power_abs m) lemma two_power_abs_plus_one : forall n:int . 0 <= n -> two_power_abs (n+1) = 2 * (two_power_abs n) meta "remove_for_" lemma two_power_abs_is_positive meta "remove_for_" lemma two_power_abs_plus_pos meta "remove_for_" lemma two_power_abs_plus_one predicate is_uint (n:int) (x:int) = 0 <= x < two_power_abs n (* * [n] is the number of significant bits (that doesn't include the sign bit). * *) predicate is_sint (n:int) (x:int) = -(two_power_abs n) <= x < two_power_abs n function to_uint int int : int function to_sint int int : int (** * C-Integer Conversions are in-range * **) lemma is_to_uint : forall n x:int [ is_uint n (to_uint n x) ]. is_uint n (to_uint n x) lemma is_to_sint : forall n x:int [ is_sint n (to_sint n x) ]. is_sint n (to_sint n x) meta "remove_for_" lemma is_to_uint meta "remove_for_" lemma is_to_sint axiom is_to_uint8 : forall x:int [ is_uint8(to_uint8 x) ]. is_uint8 (to_uint8 x) axiom is_to_sint8 : forall x:int [ is_sint8(to_sint8 x) ]. is_sint8 (to_sint8 x) axiom is_to_uint16 : forall x:int [ is_uint16(to_uint16 x) ]. is_uint16 (to_uint16 x) axiom is_to_sint16 : forall x:int [ is_sint16(to_sint16 x) ]. is_sint16 (to_sint16 x) axiom is_to_uint32 : forall x:int [ is_uint32(to_uint32 x) ]. is_uint32 (to_uint32 x) axiom is_to_sint32 : forall x:int [ is_sint32(to_sint32 x) ]. is_sint32 (to_sint32 x) axiom is_to_uint64 : forall x:int [ is_uint64(to_uint64 x) ]. is_uint64 (to_uint64 x) axiom is_to_sint64 : forall x:int [ is_sint64(to_sint64 x) ]. is_sint64 (to_sint64 x) (** * C-Integer Conversions are identity when in-range * **) lemma id_uint : forall n x:int [ to_uint n x ]. is_uint n x <-> (to_uint n x) = x lemma id_sint : forall n x:int [ to_sint n x ]. is_sint n x <-> (to_sint n x) = x meta "remove_for_" lemma id_uint meta "remove_for_" lemma id_sint axiom id_uint8 : forall x:int [ to_uint8 x ]. is_uint8 x -> (to_uint8 x) = x axiom id_sint8 : forall x:int [ to_sint8 x ]. is_sint8 x -> (to_sint8 x) = x axiom id_uint16 : forall x:int [ to_uint16 x ]. is_uint16 x -> (to_uint16 x) = x axiom id_sint16 : forall x:int [ to_sint16 x ]. is_sint16 x -> (to_sint16 x) = x axiom id_uint32 : forall x:int [ to_uint32 x ]. is_uint32 x -> (to_uint32 x) = x axiom id_sint32 : forall x:int [ to_sint32 x ]. is_sint32 x -> (to_sint32 x) = x axiom id_uint64 : forall x:int [ to_uint64 x ]. is_uint64 x -> (to_uint64 x) = x axiom id_sint64 : forall x:int [ to_sint64 x ]. is_sint64 x -> (to_sint64 x) = x meta "inline_in" predicate is_uint8, axiom id_uint8 meta "inline_in" predicate is_sint8, axiom id_sint8 meta "inline_in" predicate is_uint16, axiom id_uint16 meta "inline_in" predicate is_sint16, axiom id_sint16 meta "inline_in" predicate is_uint32, axiom id_uint32 meta "inline_in" predicate is_sint32, axiom id_sint32 meta "inline_in" predicate is_uint64, axiom id_uint64 meta "inline_in" predicate is_sint64, axiom id_sint64 (** * C-Integer Conversions are projections * **) lemma proj_uint : forall n x:int . to_uint n (to_uint n x)= to_uint n x lemma proj_sint : forall n x:int . to_sint n (to_sint n x)= to_sint n x meta "remove_for_" lemma proj_uint meta "remove_for_" lemma proj_sint axiom proj_uint8 : forall x:int [ to_uint8(to_uint8 x) ]. to_uint8(to_uint8 x)=to_uint8 x axiom proj_sint8 : forall x:int [ to_sint8(to_sint8 x) ]. to_sint8(to_sint8 x)=to_sint8 x axiom proj_uint16 : forall x:int [ to_uint16(to_uint16 x) ]. to_uint16(to_uint16 x)=to_uint16 x axiom proj_sint16 : forall x:int [ to_sint16(to_sint16 x) ]. to_sint16(to_sint16 x)=to_sint16 x axiom proj_uint32 : forall x:int [ to_uint32(to_uint32 x) ]. to_uint32(to_uint32 x)=to_uint32 x axiom proj_sint32 : forall x:int [ to_sint32(to_sint32 x) ]. to_sint32(to_sint32 x)=to_sint32 x axiom proj_uint64 : forall x:int [ to_uint64(to_uint64 x) ]. to_uint64(to_uint64 x)=to_uint64 x axiom proj_sint64 : forall x:int [ to_sint64(to_sint64 x) ]. to_sint64(to_sint64 x)=to_sint64 x meta "remove_for_" axiom proj_uint8 meta "remove_for_" axiom proj_sint8 meta "remove_for_" axiom proj_uint16 meta "remove_for_" axiom proj_sint16 meta "remove_for_" axiom proj_uint32 meta "remove_for_" axiom proj_sint32 meta "remove_for_" axiom proj_uint64 meta "remove_for_" axiom proj_sint64 (** * Generalization for [to_sint _ (to_uint _ x)] * **) lemma proj_su: forall n x:int . to_sint n (to_uint n x) = to_uint n x lemma incl_su: forall n x:int . is_uint n x -> is_sint n x meta "remove_for_" lemma proj_su meta "remove_for_" lemma incl_su lemma proj_su_uint: forall n m x:int . 0 <= n -> 0 <= m -> to_sint (m+n) (to_uint n x) = to_uint n x lemma proj_su_sint: forall n m x:int . 0 <= n -> 0 <= m -> to_sint n (to_uint (m+(n+1)) x) = to_sint n x meta "remove_for_" lemma proj_su_uint meta "remove_for_" lemma proj_su_sint axiom proj_int8 : forall x:int [ to_sint8(to_uint8 x) ]. to_sint8(to_uint8 x) =to_sint8 x axiom proj_int16 : forall x:int [ to_sint16(to_uint16 x) ]. to_sint16(to_uint16 x)=to_sint16 x axiom proj_int32 : forall x:int [ to_sint32(to_uint32 x) ]. to_sint32(to_uint32 x)=to_sint32 x axiom proj_int64 : forall x:int [ to_sint64(to_uint64 x) ]. to_sint64(to_uint64 x)=to_sint64 x (** * Generalization for [to_uint _ (to_sint _ x)] * **) lemma proj_us_uint: forall n m x:int . 0 <= n -> 0 <= m -> to_uint (n+1) (to_sint (m+n) x) = to_uint (n+1) x meta "remove_for_" lemma proj_us_uint (** * C-Integer range inclusion * **) lemma incl_uint : forall n x i:int . 0 <= n -> 0 <= i -> is_uint n x -> is_uint (n+i) x lemma incl_sint : forall n x i:int . 0 <= n -> 0 <= i -> is_sint n x -> is_sint (n+i) x lemma incl_int : forall n x i:int . 0 <= n -> 0 <= i -> is_uint n x -> is_sint (n+i) x meta "remove_for_" lemma incl_uint meta "remove_for_" lemma incl_sint meta "remove_for_" lemma incl_int end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/why3/frama_c_wp/cmath.mlw���������������������������������0000666�0000000�0000000�00000005432�13571573400�022024� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Mathematics for Why-3 --- *) (* -------------------------------------------------------------------------- *) theory Cmath [@ W:non_conservative_extension:N] use int.Int use int.Abs use real.RealInfix lemma abs_def : forall x:int [abs(x)]. if x >= 0 then abs(x)=x else abs(x)=(-x) end theory Square [@ W:non_conservative_extension:N] use real.RealInfix use real.Square lemma sqrt_lin1 : forall x:real [sqrt(x)]. 1. <. x -> sqrt(x) <. x lemma sqrt_lin0 : forall x:real [sqrt(x)]. 0. <. x <. 1. -> x <. sqrt(x) lemma sqrt_0 : sqrt(0.) = 0. lemma sqrt_1 : sqrt(1.) = 1. end theory ExpLog [@ W:non_conservative_extension:N] use real.RealInfix use real.ExpLog axiom exp_pos : forall x:real. exp x >. 0. end theory ArcTrigo use real.RealInfix use real.Trigonometry as Trigo function atan (x : real) : real = Trigo.atan x function asin real : real function acos real : real lemma Sin_asin: forall x:real. -. 1.0 <=. x <=. 1.0 -> Trigo.sin (asin x) = x lemma Cos_acos: forall x:real. -. 1.0 <=. x <=. 1.0 -> Trigo.cos (acos x) = x end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/why3/frama_c_wp/memory.mlw��������������������������������0000666�0000000�0000000�00000013650�13571573400�022241� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) theory Memory use bool.Bool use int.Int use map.Map type addr = { base : int ; offset : int } predicate addr_le addr addr predicate addr_lt addr addr function addr_le_bool addr addr : bool function addr_lt_bool addr addr : bool axiom addr_le_def: forall p q :addr [addr_le p q]. p.base = q.base -> (addr_le p q <-> p.offset <= q.offset) axiom addr_lt_def: forall p q :addr [addr_lt p q]. p.base = q.base -> (addr_lt p q <-> p.offset < q.offset) axiom addr_le_bool_def : forall p q : addr [ addr_le_bool p q]. addr_le p q <-> addr_le_bool p q = True axiom addr_lt_bool_def : forall p q : addr [ addr_lt_bool p q]. addr_lt p q <-> addr_lt_bool p q = True constant null : addr = { base = 0 ; offset = 0 } function global (b:int) : addr = { base = b ; offset = 0 } meta "inline:no" function null meta "inline:no" function global function shift (p:addr) (k:int) : addr = { p with offset = p.offset + k } predicate included (p:addr) (a:int) (q:addr) (b:int) = a > 0 -> ( b >= 0 /\ p.base = q.base /\ (q.offset <= p.offset) /\ (p.offset + a <= q.offset + b) ) predicate separated (p:addr) (a:int) (q:addr) (b:int) = a <= 0 \/ b <= 0 \/ p.base <> q.base \/ q.offset + b <= p.offset \/ p.offset + a <= q.offset (* Memories *) predicate eqmem (m1 m2 : map addr 'a) (p:addr) (a:int) = forall q:addr [m1[p]|m2[q]]. included q 1 p a -> m1[q] = m2[q] function havoc (m0 m1 : map addr 'a) (p:addr) (a:int) : map addr 'a predicate valid_rw (m : map int int) (p:addr) (n:int) = n > 0 -> ( 0 < p.base /\ 0 <= p.offset /\ p.offset + n <= m[p.base] ) predicate valid_rd (m : map int int) (p:addr) (n:int) = n > 0 -> ( 0 <> p.base /\ 0 <= p.offset /\ p.offset + n <= m[p.base] ) predicate invalid (m : map int int) (p:addr) (n:int) = n > 0 -> ( m[p.base] <= p.offset \/ p.offset + n <= 0 ) lemma valid_rw_rd : forall m : map int int. forall p : addr. forall n : int. valid_rw m p n -> valid_rd m p n lemma valid_string : forall m : map int int. forall p : addr. p.base < 0 -> 0 <= p.offset < m[p.base] -> (valid_rd m p 1 /\ not (valid_rw m p 1)) lemma separated_1 : forall p q : addr. forall a b i j : int [ separated p a q b , { base = p.base ; offset = i } , { base = q.base ; offset = j } ]. separated p a q b -> p.offset <= i < p.offset + a -> q.offset <= j < q.offset + b -> { base = p.base ; offset = i } <> { base = q.base ; offset = j } (* Regions *) function region int : int predicate linked (map int int) predicate sconst (map addr int) predicate framed (m : map addr addr) = forall p:addr [m[p]]. region(m[p].base) <= 0 (* Properties *) lemma separated_included : forall p q : addr. forall a b : int [ separated p a q b , included p a q b ]. a > 0 -> b > 0 -> separated p a q b -> included p a q b -> false lemma included_trans : forall p q r : addr. forall a b c : int [ included p a q b , included q b r c ]. included p a q b -> included q b r c -> included p a r c lemma separated_trans : forall p q r : addr. forall a b c : int [ included p a q b , separated q b r c ]. included p a q b -> separated q b r c -> separated p a r c lemma separated_sym : forall p q : addr. forall a b : int [ separated p a q b ]. separated p a q b <-> separated q b p a lemma eqmem_included : forall m1 m2 : map addr 'a. forall p q : addr. forall a b : int [ eqmem m1 m2 p a,eqmem m1 m2 q b ]. included p a q b -> eqmem m1 m2 q b -> eqmem m1 m2 p a lemma eqmem_sym : forall m1 m2 : map addr 'a. forall p : addr. forall a : int. eqmem m1 m2 p a -> eqmem m2 m1 p a lemma havoc_access : forall m0 m1 : map addr 'a. forall q p : addr. forall a : int. (Map.([]) (havoc m0 m1 p a) (q)) = (if (separated q 1 p a) then (Map.([]) (m1) (q)) else (Map.([]) (m0) (q))) (* Physical Address *) function int_of_addr addr : int function addr_of_int int : addr function base_offset int : int function base_index int : int axiom int_of_addr_bijection : forall a:int. int_of_addr (addr_of_int a) = a axiom addr_of_int_bijection : forall p:addr. addr_of_int (int_of_addr p) = p axiom addr_of_null : int_of_addr null = 0 end����������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/why3/frama_c_wp/qed.mlw�����������������������������������0000666�0000000�0000000�00000007435�13571573400�021506� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) theory Qed use bool.Bool use int.Int use real.RealInfix use real.FromInt use int.ComputerDivision as CD (** to be used only for the ACSL ite generation. Something is wrong with "wp/share/ergo/bool.Bool.mlw" (coming from why3), the function match_bool is undefined. An hack is to give a definition here. *) function match_bool (x : bool) (y z:'a ) : 'a axiom match_bool: forall p:bool, x:'a, y:'a [match_bool p x y]. ( p=True /\ match_bool p x y=x ) || ( p=False /\ match_bool p x y=y ) meta "remove_for_why3" axiom match_bool (** The definitions are in comment because its not useful for coq (no if-then-else on formula) and not tested on automatic provers *) function eqb (x y : 'a) : bool (*= if x = y then True else False*) axiom eqb : forall x:'a, y:'a. eqb x y = True <-> x = y axiom eqb_false : forall x:'a, y:'a. eqb x y = False <-> x <> y meta "remove_for_" axiom eqb_false function neqb (x y : 'a) : bool(* = if x <> y then True else False*) axiom neqb : forall x:'a, y:'a. neqb x y = True <-> x <> y function zlt (x y : int) : bool(* = if x < y then True else False*) function zleq (x y : int) : bool(* = if x <= y then True else False*) axiom zlt : forall x:int, y:int. zlt x y = True <-> x < y axiom zleq : forall x:int, y:int. zleq x y = True <-> x <= y function rlt (x y : real) : bool(* = if x <. y then True else False*) function rleq (x y : real) : bool(* = if x <=. y then True else False*) axiom rlt : forall x:real, y:real. rlt x y = True <-> x <. y axiom rleq : forall x:real, y:real. rleq x y = True <-> x <=. y function real_of_int (x:int) : real = FromInt.from_int x meta "inline:no" function real_of_int lemma c_euclidian : forall n d:int [(CD.div n d),(CD.mod n d)]. d <> 0 -> n = CD.div n d * d + CD.mod n d lemma cmod_remainder : forall n d:int [CD.mod n d]. ((n >= 0) -> (d > 0) -> 0 <= CD.mod n d < d) /\ ((n <= 0) -> (d > 0) -> -d < CD.mod n d <= 0) /\ ((n >= 0) -> (d < 0) -> 0 <= CD.mod n d < -d) /\ ((n <= 0) -> (d < 0) -> d < CD.mod n d <= 0) lemma cdiv_neutral : forall a:int [CD.div a 1]. CD.div a 1 = a lemma cdiv_inv : forall a:int [CD.div a a]. a<>0 -> CD.div a a = 1 end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/why3/frama_c_wp/vlist.mlw���������������������������������0000666�0000000�0000000�00000017770�13571573400�022101� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ---------------------------------------------------------------------- *) (* --- Lists for Why-3 --- *) (* ---------------------------------------------------------------------- *) theory Vlist use int.Int use int.ComputerDivision (* -------------------------------------------------------------------- *) (* --- Classical Lists for Alt-Ergo --- *) (* -------------------------------------------------------------------- *) type list 'a function nil : list 'a function cons 'a (list 'a) : list 'a function concat (list 'a) (list 'a) : list 'a function repeat (list 'a) int : list 'a function length (list 'a) : int function nth (list 'a) int : 'a function elt (x:'a) : list 'a = cons x nil (* -------------------------------------------------------------------- *) (* --- length --- *) (* -------------------------------------------------------------------- *) axiom length_pos : forall w:list 'a. (Int.(<=) 0 (length w)) axiom length_nil : length (nil: list 'a) = 0 axiom length_nil_bis : forall w:list 'a. length w = 0 -> w = nil axiom length_cons : forall x:'a, w:list 'a [length (cons x w)]. length (cons x w) = (Int.(+) 1 (length w)) axiom length_concat : forall u,v:list 'a [length (concat u v)]. length (concat u v) = (Int.(+) (length u) (length v)) axiom length_repeat : forall w:list 'a, n:int [length (repeat w n)]. (Int.(<=) 0 n) -> length (repeat w n) = (Int.( * ) n (length w)) (* -------------------------------------------------------------------- *) (* --- nth --- *) (* -------------------------------------------------------------------- *) axiom nth_cons: forall k:int, x:'a, w:list 'a [nth (cons x w) k]. nth (cons x w) k = if k = 0 then x else nth w (k-1) axiom nth_concat: forall u,v:list 'a, k:int [nth (concat u v) k]. nth (concat u v) k = if k < length u then nth u k else nth v (Int.(-) k (length u)) axiom nth_repeat: forall n,k:int, w:list 'a [nth (repeat w n) k]. 0 <= k < (Int.( * ) n (length w)) -> (Int.(<) 0 (length w)) -> nth (repeat w n) k = nth w (mod k (length w)) (* -------------------------------------------------------------------- *) (* --- equality of Lists --- *) (* -------------------------------------------------------------------- *) predicate vlist_eq (u : list 'a) (v : list 'a) = length u = length v && forall i:int. 0 <= i < length u -> nth u i = nth v i axiom extensionality: forall u,v:list 'a. vlist_eq u v -> u = v (* -------------------------------------------------------------------- *) (* --- neutral elements --- *) (* -------------------------------------------------------------------- *) lemma eq_nil_concat: forall w:list 'a. vlist_eq (concat nil w) w /\ vlist_eq (concat w nil) w meta "remove_for_" lemma eq_nil_concat lemma rw_nil_concat_left: forall w:list 'a [concat nil w]. concat nil w = w lemma rw_nil_concat_right: forall w:list 'a [concat w nil]. concat w nil = w (* -------------------------------------------------------------------- *) (* --- normalization --- *) (* -------------------------------------------------------------------- *) lemma eq_cons_concat: forall x:'a, v,w:list 'a [concat (cons x v) w]. vlist_eq (concat (cons x v) w) (cons x (concat v w)) meta "remove_for_" lemma eq_cons_concat lemma rw_cons_concat: forall x:'a, v,w:list 'a [concat (cons x v) w]. (concat (cons x v) w) = (cons x (concat v w)) meta "remove_for_" lemma rw_cons_concat lemma rw_nil_cons_concat: forall x:'a, w:list 'a [concat (cons x nil) w]. (concat (cons x nil) w) = (cons x w) meta "remove_for_" lemma rw_nil_cons_concat (* -------------------------------------------------------------------- *) (* --- associativity --- *) (* -------------------------------------------------------------------- *) lemma eq_assoc_concat: forall u,v,w:list 'a. vlist_eq (concat (concat u v) w) (concat u (concat v w)) meta "remove_for_" lemma eq_assoc_concat (* -------------------------------------------------------------------- *) (* --- repeat --- *) (* -------------------------------------------------------------------- *) lemma rw_nil_repeat: forall n:int [repeat (nil: list 'a) n]. n >= 0 -> repeat (nil: list 'a) n = (nil: list 'a) lemma rw_repeat_zero: forall w:list 'a [repeat w 0]. repeat w 0 = nil lemma eq_repeat_one: forall w:list 'a. vlist_eq (repeat w 1) w meta "remove_for_" lemma eq_repeat_one lemma rw_repeat_one: forall w:list 'a [repeat w 1]. repeat w 1 = w lemma eq_repeat_concat: forall p,q:int, w:list 'a. 0 <= p -> 0 <= q -> vlist_eq (repeat w (Int.(+) p q)) (concat (repeat w p) (repeat w q)) meta "remove_for_" lemma eq_repeat_concat lemma rw_repeat_concat: forall p,q:int, w:list 'a. 0 <= p -> 0 <= q -> repeat w (Int.(+) p q) = concat (repeat w p) (repeat w q) meta "remove_for_" lemma rw_repeat_concat lemma rw_repeat_after: forall p:int, w:list 'a. 0 <= p -> concat (repeat w p) w = repeat w (Int.(+) p 1) meta "remove_for_" lemma rw_repeat_after lemma rw_repeat_before: forall p:int, w:list 'a. 0 <= p -> concat w (repeat w p) = repeat w (Int.(+) p 1) meta "remove_for_" lemma rw_repeat_before (*--- To avoid exponential blowup of use of repeat_after by alt-ergo ---*) function repeat_box (list 'a) int : (list 'a) (* repeat *) axiom rw_repeat_box_unfold: forall w:list 'a, n:int [ repeat_box w n ]. repeat_box w n = repeat w n axiom rw_repeat_plus_box_unfold: forall w:list 'a, a,b: int [ repeat_box w (Int.(+) a b) ]. (Int.(<=) 0 a) -> (Int.(<=) 0 b) -> repeat_box w (Int.(+) a b) = concat (repeat w a) (repeat w b) axiom rw_repeat_plus_one_box_unfold: forall w:list 'a, n:int [ repeat_box w n ]. (Int.(<) 0 n) -> (repeat_box w n = (concat (repeat w (Int.(-) n 1)) w) && (repeat_box w (Int.(+) n 1) = concat (repeat w n) w)) end ��������frama-c-20.0-Calcium/src/plugins/wp/share/why3/frama_c_wp/vset.mlw����������������������������������0000666�0000000�0000000�00000010464�13571573400�021712� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Sets for Why-3 --- *) (* -------------------------------------------------------------------------- *) theory Vset use bool.Bool use int.Int (* -------------------------------------------------------------------------- *) (* --- Classical Sets for Alt-Ergo --- *) (* -------------------------------------------------------------------------- *) type set 'a function empty : set 'a function singleton 'a : set 'a function union (set 'a) (set 'a) : set 'a function inter (set 'a) (set 'a) : set 'a meta AC function union meta AC function inter predicate member 'a (set 'a) function member_bool 'a (set 'a) : bool function range int int : set int (* [a..b] *) function range_sup int : set int (* [a..] *) function range_inf int : set int (* [..b] *) function range_all : set int (* [..] *) predicate eqset (a : set 'a) (b : set 'a) = forall x : 'a. (member x a) <-> (member x b) predicate subset (a : set 'a) (b : set 'a) = forall x : 'a. (member x a) -> (member x b) predicate disjoint (a : set 'a) (b : set 'a) = forall x : 'a. (member x a) -> (member x b) -> false (* -------------------------------------------------------------------------- *) axiom member_bool : forall x:'a. forall s:set 'a [member_bool x s]. if member x s then member_bool x s = True else member_bool x s = False axiom member_empty : forall x:'a [member x empty]. not (member x empty) axiom member_singleton : forall x:'a,y:'a [member x (singleton y)]. member x (singleton y) <-> x=y axiom member_union : forall x:'a. forall a:set 'a,b:set 'a [member x (union a b)]. member x (union a b) <-> (member x a) \/ (member x b) axiom member_inter : forall x:'a. forall a:set 'a,b:set 'a [member x (inter a b)]. member x (inter a b) <-> (member x a) /\ (member x b) axiom union_empty : forall a:set 'a [(union a empty)|(union empty a)]. (union a empty) = a /\ (union empty a) = a axiom inter_empty : forall a:set 'a [(inter a empty)|(inter empty a)]. (inter a empty) = empty /\ (inter empty a) = empty axiom member_range : forall x:int,a:int,b:int [member x (range a b)]. member x (range a b) <-> (a <= x /\ x <= b) axiom member_range_sup : forall x:int,a:int [member x (range_sup a)]. member x (range_sup a) <-> (a <= x) axiom member_range_inf : forall x:int,b:int [member x (range_inf b)]. member x (range_inf b) <-> (x <= b) axiom member_range_all : forall x:int [member x range_all]. member x range_all (* -------------------------------------------------------------------------- *) end������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/share/wp.driver�������������������������������������������������0000666�0000000�0000000�00000015456�13571573400�017071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/**************************************************************************/ /* */ /* This file is part of WP plug-in of Frama-C. */ /* */ /* Copyright (C) 2007-2019 */ /* CEA (Commissariat a l'energie atomique et aux energies */ /* alternatives) */ /* */ /* you can redistribute it and/or modify it under the terms of the GNU */ /* Lesser General Public License as published by the Free Software */ /* Foundation, version 2.1. */ /* */ /* It is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU Lesser General Public License for more details. */ /* */ /* See the GNU Lesser General Public License version 2.1 */ /* for more details (enclosed in the file licenses/LGPLv2.1). */ /* */ /**************************************************************************/ library qed: coq.file += "coqwp/BuiltIn.v"; coq.file += "coqwp:bool/Bool.v"; coq.file += "coqwp/HighOrd.v"; coq.file += "coqwp:int/Int.v"; coq.file += "coqwp:int/Abs.v"; coq.file += "coqwp:int/ComputerDivision.v"; coq.file += "coqwp:int/EuclideanDivision.v"; coq.file += "coqwp:int/ComputerOfEuclideanDivision.v"; coq.file += "coqwp:real/Real.v"; coq.file += "coqwp:real/RealInfix.v"; coq.file += "coqwp:real/FromInt.v"; coq.file += "coqwp:map/Map.v"; coq.file += "coqwp:bool/Bool.v"; coq.file += "coqwp/Qedlib.v"; coq.file += "coqwp/Qed.v"; why3.import += "int.Abs:IAbs"; why3.import += "frama_c_wp.qed.Qed"; altergo.file += "ergo/int.Int.mlw"; altergo.file += "ergo/int.Abs.mlw"; altergo.file += "ergo/int.ComputerDivision.mlw"; altergo.file += "ergo/int.ComputerOfEuclideanDivision.mlw"; altergo.file += "ergo/real.Real.mlw"; altergo.file += "ergo/real.RealInfix.mlw"; altergo.file += "ergo/real.FromInt.mlw"; altergo.file += "ergo/Qed.mlw"; library const: coq.file += "coqwp:map/Const.v"; why3.import += "map.Const"; altergo.file += "ergo/map.Const.mlw"; library bool: altergo.file += "ergo/bool.Bool.mlw"; library minmax_int: coq.file += "coqwp:int/MinMax.v"; altergo.file += "ergo/int.MinMax.mlw"; why3.import += "int.MinMax:Ig"; logic integer "\\max"(integer,integer) = commutative:associative:idempotent: {coq="Zmax";altergo="max_int";why3="Ig.max"}; logic integer "\\min"(integer,integer) = commutative:associative:idempotent: {coq="Zmin";altergo="min_int";why3="Ig.min"}; library minmax_real: coq.file += "coqwp:real/MinMax.v"; altergo.file += "ergo/real.MinMax.mlw"; why3.import += "real.MinMax:Rg"; logic real "\\max"(real,real) = commutative:associative:idempotent: {coq="Rmax";altergo="max_real";why3="Rg.max"}; logic real "\\min"(real,real) = commutative:associative:idempotent: {coq="Rmin";altergo="min_real";why3="Rg.min"}; library cint: coq.file += "coqwp/Bits.v"; coq.file += "coqwp/Zbits.v"; coq.file += "coqwp/Cint.v"; why3.import += "frama_c_wp.cint.Cint"; altergo.file += "ergo/Cint.mlw"; library cbits: cint logic boolean "bit_test"(integer,integer) := \bit_test_stdlib; coq.file += "coqwp/Cbits.v"; altergo.file += "ergo/Cbits.mlw"; why3.import += "frama_c_wp.cbits.Cbits"; library cfloat: cmath sqrt coq.file += "coqwp:real/Abs.v"; coq.file += "coqwp/Cfloat.v"; why3.import += "frama_c_wp.cfloat.Cfloat"; altergo.file += "ergo/Cfloat.mlw"; type "rounding_mode" = "rounding_mode"; ctor "\\Up"() = "Up"; ctor "\\Down"() = "Down"; ctor "\\ToZero"() = "ToZero"; ctor "\\NearestAway"() = "NearestTiesToAway"; ctor "\\NearestEven"() = "NearestTiesToEven"; predicate "\\is_finite"(float32) = "is_finite_f32"; predicate "\\is_finite"(float64) = "is_finite_f64"; predicate "\\is_NaN"(float32) = "is_NaN_f32"; predicate "\\is_NaN"(float64) = "is_NaN_f64"; predicate "\\is_infinite"(float32) = "is_infinite_f32" ; predicate "\\is_infinite"(float64) = "is_infinite_f64" ; predicate "\\is_plus_infinity"(float32) = "is_positive_infinite_f32"; predicate "\\is_plus_infinity"(float64) = "is_positive_infinite_f64"; predicate "\\is_minus_infinity"(float32) = "is_negative_infinite_f32"; predicate "\\is_minus_infinity"(float64) = "is_negative_infinite_f64"; logic bool "\\round_float"(rounding_mode,real) = "round_float"; logic bool "\\round_double"(rounding_mode,real) = "round_double"; library vset: type set = "set"; coq.file := "coqwp/Vset.v"; why3.import := "vset.Vset"; altergo.file := "ergo/Vset.mlw"; library vlist: coq.file := "coqwp/Vlist.v"; why3.import := "frama_c_wp.vlist.Vlist"; altergo.file := "ergo/Vlist.mlw"; library memory: coq.file := "coqwp/Memory.v"; why3.import := "frama_c_wp.memory.Memory"; altergo.file := "ergo/Memory.mlw"; library sqrt: cmath why3.import += "real.Square"; coq.file += "coqwp/Square.v"; why3.import += "frama_c_wp.cmath.Square"; altergo.file += "ergo/real.Square.mlw"; altergo.file += "ergo/Square.mlw"; library exponential: qed why3.import += "real.ExpLog" ; why3.import += "frama_c_wp.cmath.ExpLog" ; coq.file += "coqwp:real/ExpLog.v" ; coq.file += "coqwp/Exp.v" ; altergo.file += "ergo/real.ExpLog.mlw" ; altergo.file += "ergo/ExpLog.mlw" ; library power: exponential sqrt why3.import += "real.PowerReal" ; coq.file += "coqwp:int/Exponentiation.v" ; coq.file += "coqwp:int/Power.v" ; coq.file += "coqwp:real/PowerReal.v" ; altergo.file += "ergo/int.Power.mlw" ; altergo.file += "ergo/real.PowerReal.mlw" ; library truncate: qed why3.import += "real.Truncate" ; altergo.file += "ergo/real.Truncate.mlw" ; library cmath: qed why3.import += "real.Abs:RAbs" ; why3.import += "frama_c_wp.cmath.Cmath"; coq.file += "coqwp:real/Abs.v" ; coq.file += "coqwp:real/Square.v"; coq.file += "coqwp/Cmath.v"; altergo.file += "ergo/real.Abs.mlw" ; altergo.file += "ergo/Cmath.mlw"; library trigonometry: sqrt cmath why3.import += "real.Trigonometry"; coq.file += "coqwp:real/Trigonometry.v"; altergo.file += "ergo/real.Trigonometry.mlw"; library arctrigo: trigonometry why3.import += "frama_c_wp.cmath.ArcTrigo"; coq.file += "coqwp/ArcTrigo.v"; altergo.file += "ergo/ArcTrigo.mlw"; library hyperbolic: sqrt exponential why3.import += "real.Hyperbolic"; altergo.file += "ergo/real.Hyperbolic.mlw"; library polar: sqrt trigonometry why3.import += "real.Polar"; altergo.file += "ergo/real.Polar.mlw"; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/����������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015253� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/inexistant-prover�����������������������������������������0000666�0000000�0000000�00000000000�13571573400�020665� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/native.report���������������������������������������������0000666�0000000�0000000�00000000476�13571573400�020005� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@CONSOLE @ZERO " - " @HEAD @CHAPTER ------------------------------------------------------------- %chapter &18: WP &26: Alt-Ergo (Native) &42: Total &51:Success @SECTION %name &18:%wp &24: %{native-alt-ergo} %range &42:%total &51: %success%% @TAIL ------------------------------------------------------------- @END ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/qualif.report���������������������������������������������0000666�0000000�0000000�00000000465�13571573400�017776� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@CONSOLE @ZERO " - " @HEAD @CHAPTER ------------------------------------------------------------- %chapter &18: WP &26: Alt-Ergo &42: Total &51:Success @SECTION %name &18:%wp &24: %{Alt-Ergo,2.0.0,} %range &42:%total &51: %success%% @TAIL ------------------------------------------------------------- @END �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/test_config�����������������������������������������������0000666�0000000�0000000�00000000173�13571573400�017503� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CMD: @frama-c@ -no-autoload-plugins -load-module wp -wp -wp-prover none -wp-print -wp-share ./share -wp-msg-key shell OPT: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/test_config_qualif����������������������������������������0000666�0000000�0000000�00000000726�13571573400�021050� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CMD: @frama-c@ -no-autoload-plugins -load-module wp -wp -wp-par 1 -wp-share ./share -wp-msg-key shell,success-only -wp-report-json @PTEST_DIR@/oracle@PTEST_CONFIG@/@PTEST_NAME@.@PTEST_NUMBER@.report.json:@PTEST_DIR@/result@PTEST_CONFIG@/@PTEST_NAME@.@PTEST_NUMBER@.report.json -wp-report tests/qualif.report -wp-session @PTEST_DIR@/oracle@PTEST_CONFIG@/@PTEST_NAME@.@PTEST_NUMBER@.session -wp-cache offline @PTEST_FILE@ LOG: @PTEST_NAME@.@PTEST_NUMBER@.report.json OPT: ������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/�������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015701� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/bug_rte.i����������������������������������������������0000666�0000000�0000000�00000000165�13571573400�017504� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-rte */ /* run.config_qualif DONTRUN: */ int bug(int i, int j) { return i - (j == 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017146� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/bug_rte.res.oracle������������������������������0000666�0000000�0000000�00000001444�13571573400�022557� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp/bug_rte.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function bug ------------------------------------------------------------ Function bug ------------------------------------------------------------ Goal Assertion 'rte,signed_overflow' (file tests/wp/bug_rte.i, line 7): Assume { Type: is_sint32(i) /\ is_sint32(j). } Prove: if (j = 1) then ((-2147483647) <= i) else ((-2147483648) <= i). ------------------------------------------------------------ Goal Assertion 'rte,signed_overflow' (file tests/wp/bug_rte.i, line 7): Assume { Type: is_sint32(i) /\ is_sint32(j). } Prove: i <= (2147483647 + (if (j = 1) then 1 else 0)). ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/sharing.res.oracle������������������������������0000666�0000000�0000000�00000004203�13571573400�022557� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/sharing.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp:print-generated] theory WP (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.memory.Memory *) (* use frama_c_wp.cint.Cint *) (* use Compound *) goal wp_goal : forall t:int -> int, t1:addr -> int, i:int, a:addr, i1:int. let a1 = shift_sint32 a 0 in let a2 = shift_sint32 a i1 in let m = set t1 a1 (get t1 a2) in let m1 = set m (shift_sint32 a 1) (get m a2) in let m2 = set m1 (shift_sint32 a 2) (get m1 a2) in let m3 = set m2 (shift_sint32 a 3) (get m2 a2) in 0 <= i1 -> 0 <= i -> region (base a) <= 0 -> i1 <= 9 -> i <= 9 -> linked t -> is_sint32 i1 -> valid_rw t a1 10 -> (forall i2:int. 0 <= i2 -> i2 <= 9 -> 0 <= get t1 (shift_sint32 a i2)) -> 0 <= get (set m3 (shift_sint32 a 4) (get m3 a2)) (shift_sint32 a i) end [wp] 1 goal generated ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp/sharing.c, line 8) in 'f': Let a = shift_sint32(t, 0). Let a_1 = shift_sint32(t, x). Let m = Mint_0[a <- Mint_0[a_1]]. Let m_1 = m[shift_sint32(t, 1) <- m[a_1]]. Let m_2 = m_1[shift_sint32(t, 2) <- m_1[a_1]]. Let m_3 = m_2[shift_sint32(t, 3) <- m_2[a_1]]. Assume { Type: is_sint32(x). (* Goal *) When: (0 <= i) /\ (i <= 9). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= x) /\ (x <= 9) /\ valid_rw(Malloc_0, a, 10) /\ (forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 9) -> (0 <= Mint_0[shift_sint32(t, i_1)])))). } Prove: 0 <= m_3[shift_sint32(t, 4) <- m_3[a_1]][shift_sint32(t, i)]. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/stmtcompiler_test.res.oracle��������������������0000666�0000000�0000000�00000046321�13571573400�024714� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/stmtcompiler_test.i (no preprocessing) [kernel] tests/wp/stmtcompiler_test.i:136: Warning: Body of function if_assert falls-through. Adding a return statement [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp/stmtcompiler_test.i:145: Warning: No code nor implicit assigns clause for function behavior1, generating default assigns from the prototype [wp] Warning: Missing RTE guards [wp] tests/wp/stmtcompiler_test.i:81: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function behavior2 ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 109): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function behavior3 ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 116): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function behavior4 ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 123): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function behavior5 ------------------------------------------------------------ Goal Assertion 'bad' (file tests/wp/stmtcompiler_test.i, line 131): Assume { Type: is_sint32(x). (* Call 'behavior1' *) Have: 0 <= x. } Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function compare ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 154): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function empty ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 6): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function if_assert ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 137): Assume { Type: is_sint32(x) /\ is_sint32(y). (* Then *) Have: x < 0. } Prove: x < (y * y). ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 140): Assume { Type: is_sint32(x) /\ is_sint32(y) /\ is_sint32(-x). (* Else *) Have: 0 <= x. } Prove: 0 < (x + (y * y)). ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 142): Prove: true. ------------------------------------------------------------ Goal Assertion 'missing_return' (file tests/wp/stmtcompiler_test.i, line 143): Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(y). If x_2 < 0 Then { Have: x_2 = x. } Else { Have: x_2 = x_1. Have: (x + x_1) = 0. } (* Assertion *) Have: x < (y * y). } Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 50): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main_assigns_global ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 67): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 68): Prove: true. ------------------------------------------------------------ Goal Assertion 'bad' (file tests/wp/stmtcompiler_test.i, line 69): Assume { Type: is_sint32(foo_0). } Prove: foo_0 = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function main_ensures_result ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 43): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function not_main ------------------------------------------------------------ Goal Assertion 'bad' (file tests/wp/stmtcompiler_test.i, line 54): Assume { Type: is_sint32(foo_0). } Prove: foo_0 = 42. ------------------------------------------------------------ ------------------------------------------------------------ Function one_assign ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 13): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function one_if ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 18): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function some_seq ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 28): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 29): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function zloop ------------------------------------------------------------ Goal Post-condition (file tests/wp/stmtcompiler_test.i, line 74) in 'zloop': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp/stmtcompiler_test.i, line 80): Assume { Type: is_sint32(i) /\ is_sint32(x) /\ is_sint32(1 + i) /\ is_sint32(2 + i). (* Pre-condition *) Have: 0 <= x. (* Invariant *) Have: i <= 10. (* Then *) Have: i <= 9. } Prove: i <= 8. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp/stmtcompiler_test.i, line 80): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 84): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 85): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test.i, line 86): Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: 0 <= x_1. } Prove: 0 <= x. ------------------------------------------------------------ Goal Assertion 'bad' (file tests/wp/stmtcompiler_test.i, line 87): Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: 0 <= x_1. (* Assertion *) Have: 0 <= x. } Prove: false. ------------------------------------------------------------ new way empty sequent: Assume { Have: foo_0 = 42. } Prove: true. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 6): Prove: true. [Qed] Valid ------------------------------------------------------------ new way one_assign sequent: Assume { Have: foo_0 = 42. Have: (ta_d_0=true) /\ (ta_d_1=false). Have: d = c. } Prove: d = c. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 13): Prove: true. [Qed] Valid ------------------------------------------------------------ new way one_if sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false). } Prove: true. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 18): Prove: true. [Qed] Valid ------------------------------------------------------------ new way some_seq sequent: Assume { Have: foo_0 = 42. Have: (ta_d_0=true) /\ (ta_d_1=false). Have: d_1 = 0. If c != 0 Then { Have: d_1 = d_2. Have: d = 1. } If c = 0 Then { Have: d_1 = d_3. Have: d = 2. } Have: ((c != 0) -> (d = 1)). } Prove: ((c = 0) -> (d = 2)). Goal Assertion (file tests/wp/stmtcompiler_test.i, line 29): Prove: true. [Qed] Valid ------------------------------------------------------------ some_seq sequent: Assume { Have: foo_0 = 42. Have: (ta_d_0=true) /\ (ta_d_1=false). Have: d_1 = 0. If c != 0 Then { Have: d_1 = d_2. Have: d = 1. } If c = 0 Then { Have: d_1 = d_3. Have: d = 2. } } Prove: ((c != 0) -> (d = 1)). Goal Assertion (file tests/wp/stmtcompiler_test.i, line 28): Prove: true. [Qed] Valid ------------------------------------------------------------ new way main_ensures_result sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false) /\ (ta_x_0=true) /\ (ta_x_1=false). Have: result_0 = 0. Have: x = result_0. } Prove: x = 0. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 43): Prove: true. [Qed] Valid ------------------------------------------------------------ [wp] tests/wp/stmtcompiler_test.i:145: Warning: void object new way main sequent: Assume { Have: foo_0 = 42. } Prove: foo_0 = 42. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 50): Prove: true. [Qed] Valid ------------------------------------------------------------ [wp] tests/wp/stmtcompiler_test.i:145: Warning: void object new way not_main sequent: Assume { Have: foo_1 = 42. } Prove: foo_0 = 42. Goal Assertion 'bad' (file tests/wp/stmtcompiler_test.i, line 54): Prove: foo_0 = 42. [Qed] - ------------------------------------------------------------ [wp] tests/wp/stmtcompiler_test.i:145: Warning: void object new way main_assigns_global sequent: Assume { Have: foo_1 = 42. Have: (ta_r_0=true) /\ (ta_r_1=false). Have: foo_2 = 1. Have: x = result_0. Have: x = foo_0. Have: result_0 = r. Have: ((x = 2) -> (foo_0 = 2)). Have: r = foo_0. } Prove: foo_0 = 1. Goal Assertion 'bad' (file tests/wp/stmtcompiler_test.i, line 69): Prove: foo_0 = 1. [Qed] - ------------------------------------------------------------ main_assigns_global sequent: Assume { Have: foo_1 = 42. Have: (ta_r_0=true) /\ (ta_r_1=false). Have: foo_2 = 1. Have: x = result_0. Have: x = foo_0. Have: result_0 = r. Have: ((x = 2) -> (foo_0 = 2)). } Prove: r = foo_0. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 68): Prove: true. [Qed] Valid ------------------------------------------------------------ main_assigns_global sequent: Assume { Have: foo_1 = 42. Have: (ta_r_0=true) /\ (ta_r_1=false). Have: foo_2 = 1. Have: x = result_0. Have: x = foo_0. Have: result_0 = r. } Prove: ((x = 2) -> (foo_0 = 2)). Goal Assertion (file tests/wp/stmtcompiler_test.i, line 67): Prove: true. [Qed] Valid ------------------------------------------------------------ new way zloop sequent: Assume { Have: foo_0 = 42. Have: 0 <= x. Have: (ta_i_0=true) /\ (ta_i_1=false). Have: i_1 = 0. Have: (1 + i_1) = i_2. Have: i_2 <= 10. Have: i <= 10. Have: 10 <= i. Have: 10 <= i. Have: i = 10. Have: 0 <= x. Have: foo_1 = 0. } Prove: i = 1. Goal Assertion 'bad' (file tests/wp/stmtcompiler_test.i, line 87): Assume { Have: 0 <= x. } Prove: false. [Qed] - ------------------------------------------------------------ zloop sequent: Assume { Have: foo_0 = 42. Have: 0 <= x. Have: (ta_i_0=true) /\ (ta_i_1=false). Have: i = 0. Have: (1 + i) = i_1. Have: i_1 <= 10. Have: i_2 <= 10. Have: 10 <= i_2. Have: 10 <= i_2. Have: i_2 = 10. } Prove: 0 <= x. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 86): Prove: true. [Qed] Valid ------------------------------------------------------------ zloop sequent: Assume { Have: foo_0 = 42. Have: 0 <= x. Have: (ta_i_0=true) /\ (ta_i_1=false). Have: i_1 = 0. Have: (1 + i_1) = i_2. Have: i_2 <= 10. Have: i <= 10. Have: 10 <= i. Have: 10 <= i. } Prove: i = 10. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 85): Prove: true. [Qed] Valid ------------------------------------------------------------ zloop sequent: Assume { Have: foo_0 = 42. Have: 0 <= x. Have: (ta_i_0=true) /\ (ta_i_1=false). Have: i_1 = 0. Have: (1 + i_1) = i_2. Have: i_2 <= 10. Have: i <= 10. Have: 10 <= i. } Prove: 10 <= i. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 84): Prove: true. [Qed] Valid ------------------------------------------------------------ zloop sequent: Assume { Have: foo_0 = 42. Have: 0 <= x. Have: (ta_i_0=true) /\ (ta_i_1=false). Have: i_1 = 0. Have: (1 + i_1) = i. } Prove: i <= 10. Goal Invariant (file tests/wp/stmtcompiler_test.i, line 80): Prove: true. [Qed] Valid ------------------------------------------------------------ zloop sequent: Assume { Have: foo_0 = 42. Have: 0 <= x. Have: (ta_i_0=true) /\ (ta_i_1=false). Have: i_1 = 0. Have: (1 + i_1) = i_2. Have: i_2 <= 10. Have: i_3 <= 10. Have: i_3 <= 9. Have: (1 + i_3) = i_4. Have: (1 + i_4) = i. } Prove: i <= 10. Goal Invariant (file tests/wp/stmtcompiler_test.i, line 80): Assume { Have: 0 <= x. Have: i <= 10. Have: i <= 9. } Prove: i <= 8. Prover Qed returns Valid ------------------------------------------------------------ zloop sequent: Assume { Have: foo_0 = 42. Have: 0 <= x. Have: (ta_i_0=true) /\ (ta_i_1=false). Have: i = 0. Have: (1 + i) = i_1. Have: i_1 <= 10. Have: i_2 <= 10. Have: 10 <= i_2. Have: 10 <= i_2. Have: i_2 = 10. Have: 0 <= x. If foo_1 = 0 Then { Have: ((foo_1 = 0) -> (i_2 = 1)). } Have: x = result_0. Have: (ta_i_2=false) /\ (ta_i_0=true). } Prove: 0 <= result_0. Goal Post-condition (file tests/wp/stmtcompiler_test.i, line 74) in 'zloop': Prove: true. [Qed] Valid ------------------------------------------------------------ new way behavior2 sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false) /\ (ta_x_0=true) /\ (ta_x_1=false). Have: result_0 < 0. Have: x = result_0. } Prove: x < 0. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 109): Prove: true. [Qed] Valid ------------------------------------------------------------ new way behavior3 sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false) /\ (ta_x_0=true) /\ (ta_x_1=false). Have: 0 <= result_0. Have: x = result_0. } Prove: 0 <= x. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 116): Prove: true. [Qed] Valid ------------------------------------------------------------ new way behavior4 sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false) /\ (ta_x_0=true) /\ (ta_x_1=false). Have: result_0 <= 0. Have: 0 <= result_0. Have: x = result_0. } Prove: x = 0. Goal Assertion (file tests/wp/stmtcompiler_test.i, line 123): Prove: true. [Qed] Valid ------------------------------------------------------------ new way behavior5 sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false) /\ (ta_x_0=true) /\ (ta_x_1=false). Have: 0 <= result_0. Have: x = result_0. } Prove: x < 0. Goal Assertion 'bad' (file tests/wp/stmtcompiler_test.i, line 131): Assume { Have: 0 <= x. } Prove: false. [Qed] - ------------------------------------------------------------ new way if_assert sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false). If x < 0 Then { Have: x = x_1. Have: ((x < 0) -> (x_1 < (y * y))). } If 0 <= x Then { Have: x = x_2. Have: (x_1 + x_2) = 0. Have: ((0 <= x) -> (x_1 < (y * y))). } Have: x_1 < (y * y). } Prove: false. Goal Assertion 'missing_return' (file tests/wp/stmtcompiler_test.i, line 143): Assume { If x < 0 Then { Have: x = x_1. } If 0 <= x Then { Have: x = x_2. Have: (x_1 + x_2) = 0. } Have: x_1 < (y * y). } Prove: false. [Qed] - ------------------------------------------------------------ if_assert sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false). If x_1 < 0 Then { Have: x_1 = x. Have: ((x_1 < 0) -> (x < (y * y))). } If 0 <= x_1 Then { Have: x_1 = x_2. Have: (x + x_2) = 0. Have: ((0 <= x_1) -> (x < (y * y))). } } Prove: x < (y * y). Goal Assertion (file tests/wp/stmtcompiler_test.i, line 142): Prove: true. [Qed] Valid ------------------------------------------------------------ if_assert sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false). Have: 0 <= x_1. Have: (x + x_1) = 0. } Prove: x < (y * y). Goal Assertion (file tests/wp/stmtcompiler_test.i, line 140): Assume { Have: 0 <= x. } Prove: 0 < (x + (y * y)). [Qed] - ------------------------------------------------------------ if_assert sequent: Assume { Have: foo_0 = 42. Have: (ta_retres_0=true) /\ (ta_retres_1=false). Have: x < 0. } Prove: x < (y * y). Goal Assertion (file tests/wp/stmtcompiler_test.i, line 137): Assume { Have: x < 0. } Prove: x < (y * y). [Qed] - ------------------------------------------------------------ new way compare sequent: Assume { Have: (b < a) \/ ((b = a) /\ (a <= b) /\ (c < d)) \/ ((b != a) /\ (a <= b) /\ ((b != a) \/ ((b = a) /\ (d <= c)))) \/ ((b = a) /\ (a <= b) /\ (c < d) /\ ((b != a) \/ ((b = a) /\ (d <= c)))) \/ ((b = a) /\ (a <= b) /\ (d <= c) /\ ((b != a) \/ ((b = a) /\ (d <= c)))). Have: foo_0 = 42. Have: (ta_r_0=true) /\ (ta_r_1=false). If (b < a) \/ ((b = a) /\ (a <= b) /\ (c < d)) \/ ((b != a) /\ (a <= b) /\ ((b != a) \/ ((b = a) /\ (d <= c)))) \/ ((b = a) /\ (a <= b) /\ (c < d) /\ ((b != a) \/ ((b = a) /\ (d <= c)))) \/ ((b = a) /\ (a <= b) /\ (d <= c) /\ ((b != a) \/ ((b = a) /\ (d <= c)))) If b < a Then { Have: r_1 = r_2. Have: r = (-1). } If a <= b Then { Have: r_1 = r_3. If (b != a) \/ ((b = a) /\ (d <= c)) Then { If b = a Then { Have: r_4 = r_5. If d <= c Then { Have: r_5 = r_6. Have: r = 0. } If c < d Then { Have: r_5 = r_7. Have: r = 1. } } If b != a Then { Have: r_4 = r_8. Have: r = 1. } } If b = a Then { Have: r_3 = r_9. If c < d Then { Have: r_9 = r_10. Have: r = (-1). } If d <= c Then { Have: r_9 = r_4. } } If b != a Then { Have: r_3 = r_4. } } } Prove: ((a < b) -> (r = 1)). Goal Assertion (file tests/wp/stmtcompiler_test.i, line 154): Prove: true. [Qed] Valid ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/stmtcompiler_test_rela.res.oracle���������������0000666�0000000�0000000�00000000723�13571573400�025713� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/stmtcompiler_test_rela.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function empty ------------------------------------------------------------ Goal Assertion (file tests/wp/stmtcompiler_test_rela.i, line 9): Prove: true. ------------------------------------------------------------ ���������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_behav.res.oracle�����������������������������0000666�0000000�0000000�00000031466�13571573400�022732� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/wp_behav.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] tests/wp/wp_behav.c:172: Warning: Ignored specification 'for b1' (generalize to all behavior) [wp] Warning: Missing RTE guards [wp] tests/wp/wp_behav.c:69: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp/wp_behav.c:81: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp/wp_behav.c:154: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp/wp_behav.c:176: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function assert_needed ------------------------------------------------------------ Goal Assertion 'ko' (file tests/wp/wp_behav.c, line 117): Assume { Type: is_sint32(x). } Prove: 0 < x. ------------------------------------------------------------ Goal Assertion 'qed_ok,ok_with_hyp' (file tests/wp/wp_behav.c, line 120): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bhv ------------------------------------------------------------ Goal Complete behaviors 'pos', 'neg': Assume { Type: is_sint32(n). (* Pre-condition *) Have: n != 0. } Prove: (0 < n) \/ (n < 0). ------------------------------------------------------------ ------------------------------------------------------------ Function bhv with behavior neg ------------------------------------------------------------ Goal Post-condition for 'neg' 'qed_ok' in 'bhv': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bhv with behavior pos ------------------------------------------------------------ Goal Post-condition for 'pos' 'qed_ok' in 'bhv': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bts0513 ------------------------------------------------------------ Goal Post-condition 'ko1' in 'bts0513': Prove: false. ------------------------------------------------------------ Goal Post-condition 'ko2' in 'bts0513': Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'f': Assume { Type: is_sint32(f) /\ is_sint32(f - 2) /\ is_sint32(f - 1). } Prove: 0 < f. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior x1 ------------------------------------------------------------ Goal Post-condition for 'x1' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'x1' 'qed_ko' in 'f': Prove: false. ------------------------------------------------------------ Goal Assertion for 'x1' 'qed_ok' (file tests/wp/wp_behav.c, line 23): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior x2 ------------------------------------------------------------ Goal Post-condition for 'x2' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'x2' 'qed_ko' in 'f': Prove: false. ------------------------------------------------------------ Goal Assertion for 'x2' 'qed_ok' (file tests/wp/wp_behav.c, line 24): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function local_named_behavior with behavior xpos_stmt_53 ------------------------------------------------------------ Goal Post-condition for 'xpos' 'qed_ok' at instruction (file tests/wp/wp_behav.c, line 112): Prove: true. ------------------------------------------------------------ Goal Post-condition for 'xpos' 'qed_ok' at instruction (file tests/wp/wp_behav.c, line 112): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function min ------------------------------------------------------------ Goal Complete behaviors 'bx', 'by': Prove: true. ------------------------------------------------------------ Goal Disjoint behaviors 'bx', 'by': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function min with behavior bx ------------------------------------------------------------ Goal Post-condition for 'bx' 'qed_ok' in 'min': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bx' 'qed_ko' in 'min': Assume { Type: is_sint32(min_0) /\ is_sint32(y). (* Pre-condition for 'bx' *) Have: min_0 <= y. } Prove: y = min_0. ------------------------------------------------------------ ------------------------------------------------------------ Function min with behavior by ------------------------------------------------------------ Goal Post-condition for 'by' 'qed_ok' in 'min': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'by' 'qed_ko' in 'min': Assume { Type: is_sint32(min_0) /\ is_sint32(x). (* Pre-condition for 'by' *) Have: min_0 < x. } Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function more_stmt_assigns ------------------------------------------------------------ Goal Post-condition 'qed_ok,ok_with_hoare' in 'more_stmt_assigns': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function more_stmt_assigns with behavior blk_stmt_86 ------------------------------------------------------------ Goal Assigns for 'blk' 'qed_ok,qed_ok' at block (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns for 'blk' 'qed_ok,qed_ok' at block (2/2): Effect at line 163 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function part_stmt_bhv with behavior b1 ------------------------------------------------------------ Goal Post-condition for 'b1' 'qed_ok' in 'part_stmt_bhv': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function part_stmt_bhv with behavior bs_stmt_93_b1 ------------------------------------------------------------ Goal Post-condition for 'bs' (file tests/wp/wp_behav.c, line 175) at block: Assume { Type: is_sint32(x). (* Residual *) When: x <= 0. } Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function razT ------------------------------------------------------------ Goal Preservation of Invariant 'qed_ok' (file tests/wp/wp_behav.c, line 153): Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(n_1). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i) /\ is_sint32(i_1). (* Pre-condition *) Have: n_1 <= 9. (* Invariant 'qed_ok' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (T[i_2] = 0))). (* Then *) Have: i < n. } Prove: T[i <- 0][i_1] = 0. ------------------------------------------------------------ Goal Establishment of Invariant 'qed_ok' (file tests/wp/wp_behav.c, line 153): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function razT with behavior b1 ------------------------------------------------------------ Goal Post-condition for 'b1' 'e1' in 'razT': Let x = T[0]. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(n_1) /\ is_sint32(x). (* Pre-condition *) Have: n_1 <= 9. (* Pre-condition for 'b1' *) Have: 0 < n_1. (* Invariant 'qed_ok' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (T[i_1] = 0))). (* Else *) Have: n <= i. } Prove: x = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_assigns ------------------------------------------------------------ Goal Post-condition (file tests/wp/wp_behav.c, line 134) in 'stmt_assigns': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_assigns with behavior default_for_stmt_70 ------------------------------------------------------------ Goal Assigns (file tests/wp/wp_behav.c, line 139) at call 'unknown' (file tests/wp/wp_behav.c, line 140): Call Effect at line 140 Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract with behavior default_for_stmt_22 ------------------------------------------------------------ Goal Pre-condition 'qed_ok' at block: Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract with behavior ko ------------------------------------------------------------ Goal Post-condition for 'ko' 'qed_ko' in 'stmt_contract': Assume { Type: is_sint32(stmt_contract_0). (* Post-condition 'qed_ok' at block *) Have: 0 < stmt_contract_0. } Prove: 3 <= stmt_contract_0. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract with behavior ko_without_asgn ------------------------------------------------------------ Goal Post-condition for 'ko_without_asgn' 'qed_ko' in 'stmt_contract': Assume { Type: is_sint32(Y) /\ is_sint32(stmt_contract_0). (* Post-condition 'qed_ok' at block *) Have: 0 < stmt_contract_0. } Prove: Y < stmt_contract_0. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract with behavior ok ------------------------------------------------------------ Goal Post-condition for 'ok' 'qed_ok' in 'stmt_contract': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract_assigns with behavior default_for_stmt_43 ------------------------------------------------------------ Goal Pre-condition 'qed_ok' at block: Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok' at block: Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok,asgn_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract_assigns with behavior ko ------------------------------------------------------------ Goal Post-condition for 'ko' 'qed_ko' in 'stmt_contract_assigns': Assume { Type: is_sint32(stmt_contract_assigns_0). (* Post-condition 'qed_ok' at block *) Have: 0 < stmt_contract_assigns_0. } Prove: 3 <= stmt_contract_assigns_0. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract_assigns with behavior ok ------------------------------------------------------------ Goal Post-condition for 'ok' 'qed_ok' in 'stmt_contract_assigns': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract_assigns with behavior ok_asgn ------------------------------------------------------------ Goal Post-condition for 'ok_asgn' 'qed_ok' in 'stmt_contract_assigns': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract_label ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'stmt_contract_label': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function stmt_contract_label with behavior default_for_stmt_32 ------------------------------------------------------------ Goal Post-condition 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_behavior.0.res.oracle������������������������0000666�0000000�0000000�00000026742�13571573400�023603� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/wp_behavior.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function behaviors ------------------------------------------------------------ Goal Complete behaviors 'Y', 'X': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: (P_CX -> P_RX). (* Pre-condition for 'Y' *) Have: (P_CY -> P_RY). } Prove: P_CX \/ P_CY. ------------------------------------------------------------ Goal Disjoint behaviors 'Y', 'X': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: (P_CX -> P_RX). (* Pre-condition for 'Y' *) Have: (P_CY -> P_RY). } Prove: (!P_CX) \/ (!P_CY). ------------------------------------------------------------ Goal Post-condition (file tests/wp/wp_behavior.i, line 24) in 'behaviors': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: (P_CX -> P_RX). (* Pre-condition for 'Y' *) Have: (P_CY -> P_RY). (* Assertion *) Have: P_Q. } Prove: P_P. ------------------------------------------------------------ Goal Assertion (file tests/wp/wp_behavior.i, line 39): Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: (P_CX -> P_RX). (* Pre-condition for 'Y' *) Have: (P_CY -> P_RY). } Prove: P_Q. ------------------------------------------------------------ ------------------------------------------------------------ Function behaviors with behavior X ------------------------------------------------------------ Goal Post-condition for 'X' (file tests/wp/wp_behavior.i, line 28) in 'behaviors': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'Y' *) Have: (P_CY -> P_RY). (* Pre-condition for 'X' *) Have: P_RX. (* Pre-condition for 'X' *) Have: P_CX. (* Assertion *) Have: P_Q. } Prove: P_PX. ------------------------------------------------------------ Goal Assigns for 'X' (file tests/wp/wp_behavior.i, line 29) in 'behaviors' (1/2): Effect at line 40 Assume { Type: is_sint32(c). (* Goal *) When: !invalid(Malloc_0, px_0, 1). (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'Y' *) Have: (P_CY -> P_RY). (* Pre-condition for 'X' *) Have: P_RX. (* Pre-condition for 'X' *) Have: P_CX. (* Assertion *) Have: P_Q. (* Then *) Have: c != 0. } Prove: qx_0 = px_0. ------------------------------------------------------------ Goal Assigns for 'X' (file tests/wp/wp_behavior.i, line 29) in 'behaviors' (2/2): Effect at line 41 Assume { (* Goal *) When: !invalid(Malloc_0, py_0, 1). (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'Y' *) Have: (P_CY -> P_RY). (* Pre-condition for 'X' *) Have: P_RX. (* Pre-condition for 'X' *) Have: P_CX. (* Assertion *) Have: P_Q. } Prove: qx_0 = py_0. ------------------------------------------------------------ ------------------------------------------------------------ Function behaviors with behavior Y ------------------------------------------------------------ Goal Post-condition for 'Y' (file tests/wp/wp_behavior.i, line 33) in 'behaviors': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qy_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: (P_CX -> P_RX). (* Pre-condition for 'Y' *) Have: P_RY. (* Pre-condition for 'Y' *) Have: P_CY. (* Assertion *) Have: P_Q. } Prove: P_PY. ------------------------------------------------------------ Goal Assigns for 'Y' (file tests/wp/wp_behavior.i, line 34) in 'behaviors' (1/2): Effect at line 40 Assume { Type: is_sint32(c). (* Goal *) When: !invalid(Malloc_0, px_0, 1). (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qy_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: (P_CX -> P_RX). (* Pre-condition for 'Y' *) Have: P_RY. (* Pre-condition for 'Y' *) Have: P_CY. (* Assertion *) Have: P_Q. (* Then *) Have: c != 0. } Prove: qy_0 = px_0. ------------------------------------------------------------ Goal Assigns for 'Y' (file tests/wp/wp_behavior.i, line 34) in 'behaviors' (2/2): Effect at line 41 Assume { (* Goal *) When: !invalid(Malloc_0, py_0, 1). (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qy_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: (P_CX -> P_RX). (* Pre-condition for 'Y' *) Have: P_RY. (* Pre-condition for 'Y' *) Have: P_CY. (* Assertion *) Have: P_Q. } Prove: qy_0 = py_0. ------------------------------------------------------------ ------------------------------------------------------------ Function call ------------------------------------------------------------ Goal Post-condition (file tests/wp/wp_behavior.i, line 66) in 'call': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. (* Call 'behaviors' *) Have: P_P /\ P_R /\ ((P_CX -> P_RX)) /\ ((P_CX -> P_PX)) /\ ((P_CY -> P_RY)) /\ ((P_CY -> P_PY)). } Prove: P_Q. ------------------------------------------------------------ Goal Assigns (file tests/wp/wp_behavior.i, line 65) in 'call': Effect at line 69 Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. (* Exit 'behaviors' *) Have: P_R /\ ((P_CX -> P_RX)) /\ ((P_CY -> P_RY)). } Prove: false. ------------------------------------------------------------ Goal Assigns (file tests/wp/wp_behavior.i, line 65) in 'call': Effect at line 69 Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. (* Call 'behaviors' *) Have: P_P /\ P_R /\ ((P_CX -> P_RX)) /\ ((P_CX -> P_PX)) /\ ((P_CY -> P_RY)) /\ ((P_CY -> P_PY)). } Prove: false. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp/wp_behavior.i, line 23) in 'behaviors'' in 'call' at call 'behaviors' (file tests/wp/wp_behavior.i, line 69) : Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. } Prove: P_R. ------------------------------------------------------------ Goal Instance of 'Pre-condition for 'X' (file tests/wp/wp_behavior.i, line 27) in 'behaviors'' in 'call' at call 'behaviors' (file tests/wp/wp_behavior.i, line 69) : Assume { (* Goal *) When: P_CX. (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. } Prove: P_RX. ------------------------------------------------------------ Goal Instance of 'Pre-condition for 'Y' (file tests/wp/wp_behavior.i, line 32) in 'behaviors'' in 'call' at call 'behaviors' (file tests/wp/wp_behavior.i, line 69) : Assume { (* Goal *) When: P_CY. (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. } Prove: P_RY. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition (file tests/wp/wp_behavior.i, line 45) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0). } Prove: P_R. ------------------------------------------------------------ Goal Pre-condition (file tests/wp/wp_behavior.i, line 46) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0). } Prove: P_R1. ------------------------------------------------------------ ------------------------------------------------------------ Function main with behavior X ------------------------------------------------------------ Goal Pre-condition for 'X' (file tests/wp/wp_behavior.i, line 49) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'X' *) Have: P_CX. } Prove: P_RX. ------------------------------------------------------------ Goal Pre-condition for 'X' (file tests/wp/wp_behavior.i, line 50) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'X' *) Have: P_CX. } Prove: P_RX1. ------------------------------------------------------------ Goal Assigns for 'X' (file tests/wp/wp_behavior.i, line 51) in 'main' (1/2): Effect at line 58 Prove: true. ------------------------------------------------------------ Goal Assigns for 'X' (file tests/wp/wp_behavior.i, line 51) in 'main' (2/2): Effect at line 59 Assume { (* Goal *) When: !invalid(Malloc_0, q, 1). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'X' *) Have: P_CX. (* Pre-condition for 'X' *) Have: P_RX1. (* Pre-condition for 'X' *) Have: P_RX. } Prove: q = p. ------------------------------------------------------------ ------------------------------------------------------------ Function main with behavior Y ------------------------------------------------------------ Goal Pre-condition for 'Y' (file tests/wp/wp_behavior.i, line 54) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'Y' *) Have: P_CY. } Prove: P_RY. ------------------------------------------------------------ Goal Assigns for 'Y' (file tests/wp/wp_behavior.i, line 55) in 'main' (1/2): Effect at line 58 Assume { Type: is_sint32(c). (* Goal *) When: !invalid(Malloc_0, p, 1). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'Y' *) Have: P_CY. (* Pre-condition for 'Y' *) Have: P_RY. (* Then *) Have: c != 0. } Prove: q = p. ------------------------------------------------------------ Goal Assigns for 'Y' (file tests/wp/wp_behavior.i, line 55) in 'main' (2/2): Effect at line 59 Prove: true. ------------------------------------------------------------ ������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_behavior.1.res.oracle������������������������0000666�0000000�0000000�00000025356�13571573400�023604� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/wp_behavior.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function behaviors ------------------------------------------------------------ Goal Complete behaviors 'Y', 'X': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0). (* Pre-condition *) Have: P_R. } Prove: P_CX \/ P_CY. ------------------------------------------------------------ Goal Disjoint behaviors 'Y', 'X': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0). (* Pre-condition *) Have: P_R. } Prove: (!P_CX) \/ (!P_CY). ------------------------------------------------------------ Goal Post-condition (file tests/wp/wp_behavior.i, line 24) in 'behaviors': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0). (* Pre-condition *) Have: P_R. (* Assertion *) Have: P_Q. } Prove: P_P. ------------------------------------------------------------ Goal Assertion (file tests/wp/wp_behavior.i, line 39): Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0). (* Pre-condition *) Have: P_R. } Prove: P_Q. ------------------------------------------------------------ ------------------------------------------------------------ Function behaviors with behavior X ------------------------------------------------------------ Goal Post-condition for 'X' (file tests/wp/wp_behavior.i, line 28) in 'behaviors': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: P_RX. (* Pre-condition for 'X' *) Have: P_CX. (* Assertion *) Have: P_Q. } Prove: P_PX. ------------------------------------------------------------ Goal Assigns for 'X' (file tests/wp/wp_behavior.i, line 29) in 'behaviors' (1/2): Effect at line 40 Assume { Type: is_sint32(c). (* Goal *) When: !invalid(Malloc_0, px_0, 1). (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: P_RX. (* Pre-condition for 'X' *) Have: P_CX. (* Assertion *) Have: P_Q. (* Then *) Have: c != 0. } Prove: qx_0 = px_0. ------------------------------------------------------------ Goal Assigns for 'X' (file tests/wp/wp_behavior.i, line 29) in 'behaviors' (2/2): Effect at line 41 Assume { (* Goal *) When: !invalid(Malloc_0, py_0, 1). (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'X' *) Have: P_RX. (* Pre-condition for 'X' *) Have: P_CX. (* Assertion *) Have: P_Q. } Prove: qx_0 = py_0. ------------------------------------------------------------ ------------------------------------------------------------ Function behaviors with behavior Y ------------------------------------------------------------ Goal Post-condition for 'Y' (file tests/wp/wp_behavior.i, line 33) in 'behaviors': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qy_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'Y' *) Have: P_RY. (* Pre-condition for 'Y' *) Have: P_CY. (* Assertion *) Have: P_Q. } Prove: P_PY. ------------------------------------------------------------ Goal Assigns for 'Y' (file tests/wp/wp_behavior.i, line 34) in 'behaviors' (1/2): Effect at line 40 Assume { Type: is_sint32(c). (* Goal *) When: !invalid(Malloc_0, px_0, 1). (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qy_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'Y' *) Have: P_RY. (* Pre-condition for 'Y' *) Have: P_CY. (* Assertion *) Have: P_Q. (* Then *) Have: c != 0. } Prove: qy_0 = px_0. ------------------------------------------------------------ Goal Assigns for 'Y' (file tests/wp/wp_behavior.i, line 34) in 'behaviors' (2/2): Effect at line 41 Assume { (* Goal *) When: !invalid(Malloc_0, py_0, 1). (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qy_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition for 'Y' *) Have: P_RY. (* Pre-condition for 'Y' *) Have: P_CY. (* Assertion *) Have: P_Q. } Prove: qy_0 = py_0. ------------------------------------------------------------ ------------------------------------------------------------ Function call ------------------------------------------------------------ Goal Post-condition (file tests/wp/wp_behavior.i, line 66) in 'call': Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. (* Call 'behaviors' *) Have: P_P /\ P_R /\ ((P_CX -> P_RX)) /\ ((P_CX -> P_PX)) /\ ((P_CY -> P_RY)) /\ ((P_CY -> P_PY)). } Prove: P_Q. ------------------------------------------------------------ Goal Assigns (file tests/wp/wp_behavior.i, line 65) in 'call': Effect at line 69 Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. (* Exit 'behaviors' *) Have: P_R /\ ((P_CX -> P_RX)) /\ ((P_CY -> P_RY)). } Prove: false. ------------------------------------------------------------ Goal Assigns (file tests/wp/wp_behavior.i, line 65) in 'call': Effect at line 69 Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. (* Call 'behaviors' *) Have: P_P /\ P_R /\ ((P_CX -> P_RX)) /\ ((P_CX -> P_PX)) /\ ((P_CY -> P_RY)) /\ ((P_CY -> P_PY)). } Prove: false. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp/wp_behavior.i, line 23) in 'behaviors'' in 'call' at call 'behaviors' (file tests/wp/wp_behavior.i, line 69) : Assume { (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. } Prove: P_R. ------------------------------------------------------------ Goal Instance of 'Pre-condition for 'X' (file tests/wp/wp_behavior.i, line 27) in 'behaviors'' in 'call' at call 'behaviors' (file tests/wp/wp_behavior.i, line 69) : Assume { (* Goal *) When: P_CX. (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. } Prove: P_RX. ------------------------------------------------------------ Goal Instance of 'Pre-condition for 'Y' (file tests/wp/wp_behavior.i, line 32) in 'behaviors'' in 'call' at call 'behaviors' (file tests/wp/wp_behavior.i, line 69) : Assume { (* Goal *) When: P_CY. (* Heap *) Have: (region(px_0.base) <= 0) /\ (region(py_0.base) <= 0) /\ (region(qx_0.base) <= 0) /\ (region(qy_0.base) <= 0). (* Pre-condition *) Have: P_RQ. } Prove: P_RY. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition (file tests/wp/wp_behavior.i, line 45) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0). } Prove: P_R. ------------------------------------------------------------ Goal Pre-condition (file tests/wp/wp_behavior.i, line 46) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0). } Prove: P_R1. ------------------------------------------------------------ ------------------------------------------------------------ Function main with behavior X ------------------------------------------------------------ Goal Pre-condition for 'X' (file tests/wp/wp_behavior.i, line 49) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'X' *) Have: P_CX. } Prove: P_RX. ------------------------------------------------------------ Goal Pre-condition for 'X' (file tests/wp/wp_behavior.i, line 50) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'X' *) Have: P_CX. } Prove: P_RX1. ------------------------------------------------------------ Goal Assigns for 'X' (file tests/wp/wp_behavior.i, line 51) in 'main' (1/2): Effect at line 58 Prove: true. ------------------------------------------------------------ Goal Assigns for 'X' (file tests/wp/wp_behavior.i, line 51) in 'main' (2/2): Effect at line 59 Assume { (* Goal *) When: !invalid(Malloc_0, q, 1). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'X' *) Have: P_CX. (* Pre-condition for 'X' *) Have: P_RX1. (* Pre-condition for 'X' *) Have: P_RX. } Prove: q = p. ------------------------------------------------------------ ------------------------------------------------------------ Function main with behavior Y ------------------------------------------------------------ Goal Pre-condition for 'Y' (file tests/wp/wp_behavior.i, line 54) in 'main': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'Y' *) Have: P_CY. } Prove: P_RY. ------------------------------------------------------------ Goal Assigns for 'Y' (file tests/wp/wp_behavior.i, line 55) in 'main' (1/2): Effect at line 58 Assume { Type: is_sint32(c). (* Goal *) When: !invalid(Malloc_0, p, 1). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_R. (* Pre-condition *) Have: P_R1. (* Pre-condition for 'Y' *) Have: P_CY. (* Pre-condition for 'Y' *) Have: P_RY. (* Then *) Have: c != 0. } Prove: q = p. ------------------------------------------------------------ Goal Assigns for 'Y' (file tests/wp/wp_behavior.i, line 55) in 'main' (2/2): Effect at line 59 Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_call_pre.0.res.oracle������������������������0000666�0000000�0000000�00000002107�13571573400�023552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Hoare' [...] [kernel] Parsing tests/wp/wp_call_pre.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp/wp_call_pre.c:53: Warning: No code nor implicit assigns clause for function g, generating default assigns from the prototype [kernel] tests/wp/wp_call_pre.c:53: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function call_main ------------------------------------------------------------ Goal Instance of 'Pre-condition 'qed_ok,Rmain' in 'main'' in 'call_main' at call 'main' (file tests/wp/wp_call_pre.c, line 40) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Rmain' in 'main': Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_call_pre.1.res.oracle������������������������0000666�0000000�0000000�00000001425�13571573400�023555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Hoare' [...] [kernel] Parsing tests/wp/wp_call_pre.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp/wp_call_pre.c:53: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards Goal Pre-condition 'qed_ok,Rmain' in 'main': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,Emain' in 'main': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition 'qed_ok,Rf' in 'f'' in 'main' at initialization of 'x' (file tests/wp/wp_call_pre.c, line 33) : Prove: true. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_call_pre.2.res.oracle������������������������0000666�0000000�0000000�00000002763�13571573400�023564� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Hoare' [...] [kernel] Parsing tests/wp/wp_call_pre.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp/wp_call_pre.c:53: Warning: No code nor implicit assigns clause for function g, generating default assigns from the prototype [kernel] tests/wp/wp_call_pre.c:53: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function double_call ------------------------------------------------------------ Goal Instance of 'Pre-condition 'qed_ok,Rf' in 'f'' in 'double_call' at initialization of 'x1' (file tests/wp/wp_call_pre.c, line 26) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition 'qed_ok,Rf' in 'f'' in 'double_call' at initialization of 'x2' (file tests/wp/wp_call_pre.c, line 27) : Assume { Type: is_sint32(f) /\ is_sint32(x). (* Pre-condition *) Have: 0 <= x. (* Call 'f' *) Have: 0 < f. } Prove: (-1) <= x. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Instance of 'Pre-condition 'qed_ok,Rf' in 'f'' in 'main' at initialization of 'x' (file tests/wp/wp_call_pre.c, line 33) : Prove: true. ------------------------------------------------------------ �������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_call_pre.3.res.oracle������������������������0000666�0000000�0000000�00000001572�13571573400�023562� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Hoare' [...] [kernel] Parsing tests/wp/wp_call_pre.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp/wp_call_pre.c:53: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards Goal Instance of 'Pre-condition 'qed_ok,Rf' in 'f'' in 'double_call' at initialization of 'x1' (file tests/wp/wp_call_pre.c, line 26) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition 'qed_ok,Rf' in 'f'' in 'double_call' at initialization of 'x2' (file tests/wp/wp_call_pre.c, line 27) : Assume { Type: is_sint32(f) /\ is_sint32(x). (* Pre-condition *) Have: 0 <= x. (* Call 'f' *) Have: 0 < f. } Prove: (-1) <= x. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_call_pre.4.res.oracle������������������������0000666�0000000�0000000�00000000551�13571573400�023557� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Hoare' [...] [kernel] Parsing tests/wp/wp_call_pre.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards Goal Pre-condition 'qed_ok,Rstmt' at instruction (file tests/wp/wp_call_pre.c, line 47): Prove: true. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_eqb.res.oracle�������������������������������0000666�0000000�0000000�00000002243�13571573400�022403� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/wp_eqb.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp:print-generated] theory WP (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.cint.Cint *) goal wp_goal : forall i:int, i1:int, i2:int, i3:int. (if i3 = i2 then 1 else 0) = (if i1 = i then 1 else 0) -> is_sint32 i3 -> is_sint32 i2 -> is_sint32 i1 -> is_sint32 i -> i3 = i2 <-> i1 = i end [wp] 1 goal generated ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp/wp_eqb.i, line 8) in 'f': Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(c) /\ is_sint32(d). Have: (if (d = c) then 1 else 0) = (if (b = a) then 1 else 0). } Prove: (d = c) <-> (b = a). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_strategy.0.res.oracle������������������������0000666�0000000�0000000�00000012622�13571573400�023636� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Hoare' [...] [kernel] Parsing tests/wp/wp_strategy.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function bts0513 ------------------------------------------------------------ Goal Post-condition 'qed_ko,ko1' in 'bts0513': Prove: false. ------------------------------------------------------------ Goal Post-condition 'qed_ko,ko2' in 'bts0513': Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function bts0513_bis ------------------------------------------------------------ Goal Assertion 'qed_ko,ko1' (file tests/wp/wp_strategy.c, line 27): Assume { Type: is_sint32(x). } Prove: 0 < x. ------------------------------------------------------------ Goal Assertion 'qed_ok,ok' (file tests/wp/wp_strategy.c, line 28): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function default_behaviors ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'default_behaviors': Prove: true. ------------------------------------------------------------ Goal Assertion 'qed_ok' (file tests/wp/wp_strategy.c, line 98): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function default_behaviors with behavior default_for_stmt_54 ------------------------------------------------------------ Goal Post-condition 'qed_ok,stmt_p' at block: Prove: true. ------------------------------------------------------------ Goal Assertion 'qed_ok' (file tests/wp/wp_strategy.c, line 94): Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function dpd1 ------------------------------------------------------------ Goal Assertion 'qed_ok,A' (file tests/wp/wp_strategy.c, line 38): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function dpd1 with behavior default_for_stmt_10 ------------------------------------------------------------ Goal Post-condition 'qed_ko,Eko' at program point (file tests/wp/wp_strategy.c, line 37): Assume { Type: is_sint32(x). } Prove: 0 < x. ------------------------------------------------------------ Goal Assigns 'qed_ok' at program point (file tests/wp/wp_strategy.c, line 37): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function dpd2 with behavior P ------------------------------------------------------------ Goal Assertion for 'P' 'qed_ok,A' (file tests/wp/wp_strategy.c, line 46): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function dpd2 with behavior default_for_stmt_15 ------------------------------------------------------------ Goal Post-condition 'qed_ko,Eko' at program point (file tests/wp/wp_strategy.c, line 45): Assume { Type: is_sint32(x). } Prove: 0 < x. ------------------------------------------------------------ Goal Assigns 'qed_ok' at program point (file tests/wp/wp_strategy.c, line 45): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function spec_if ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'spec_if': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function spec_if with behavior default_for_stmt_20 ------------------------------------------------------------ Goal Post-condition 'qed_ok' at block: Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function spec_if with behavior default_for_stmt_26 ------------------------------------------------------------ Goal Assigns 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function spec_if with behavior default_for_stmt_32 ------------------------------------------------------------ Goal Assigns 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function spec_if_cond with behavior default_for_stmt_40 ------------------------------------------------------------ Goal Post-condition 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function spec_if_not_cond with behavior default_for_stmt_48 ------------------------------------------------------------ Goal Post-condition 'qed_ok' at if-then-else (file tests/wp/wp_strategy.c, line 80): Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle/wp_strategy.1.res.oracle������������������������0000666�0000000�0000000�00000003666�13571573400�023647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/wp_strategy.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function default_behaviors with behavior default_for_stmt_54 ------------------------------------------------------------ Goal Assigns 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function dpd1 with behavior default_for_stmt_10 ------------------------------------------------------------ Goal Assigns 'qed_ok' at program point (file tests/wp/wp_strategy.c, line 37): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function dpd2 with behavior default_for_stmt_15 ------------------------------------------------------------ Goal Assigns 'qed_ok' at program point (file tests/wp/wp_strategy.c, line 45): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function spec_if with behavior default_for_stmt_20 ------------------------------------------------------------ Goal Assigns 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function spec_if with behavior default_for_stmt_26 ------------------------------------------------------------ Goal Assigns 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function spec_if with behavior default_for_stmt_32 ------------------------------------------------------------ Goal Assigns 'qed_ok' at block: Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/�����������������������������������������0000777�0000000�0000000�00000000000�13571573400�020507� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/sharing.0.report.json��������������������0000666�0000000�0000000�00000002023�13571573400�024502� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "wp:functions": { "f": { "f_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/sharing.0.session/�����������������������0000777�0000000�0000000�00000000000�13571573400�023762� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/sharing.0.session/cache/�����������������0000777�0000000�0000000�00000000000�13571573400�025025� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000171�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/sharing.0.session/cache/581afbf7dec3e6ca7cfa496b2276fc75.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/sharing.0.session/cache/581afbf7dec3e6ca70000666�0000000�0000000�00000000127�13571573400�027560� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.2396, "steps": 35 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/sharing.c.0.report.json������������������0000666�0000000�0000000�00000001714�13571573400�024731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 13 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "wp:functions": { "f": { "f_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 13 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 13 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } } } } } ����������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/sharing.res.oracle�����������������������0000666�0000000�0000000�00000001263�13571573400�024123� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/sharing.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp/oracle_qualif/sharing.0.report.json' [wp] Report out: 'tests/wp/result_qualif/sharing.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (28..40) 1 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.report.json����������0000666�0000000�0000000�00000037016�13571573400�026642� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 9, "valid": 1, "unknown": 8, "rank": 2 }, "qed": { "total": 18, "valid": 18 }, "wp:main": { "total": 27, "valid": 19, "unknown": 8, "rank": 2 } }, "wp:functions": { "empty": { "empty_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "one_assign": { "one_assign_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "one_if": { "one_if_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "some_seq": { "some_seq_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "some_seq_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "main_ensures_result": { "main_ensures_result_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "main": { "main_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "not_main": { "not_main_assert_bad": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "main_assigns_global": { "main_assigns_global_assert_bad": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_assigns_global_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_assigns_global_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } } }, "zloop": { "zloop_assert_bad": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "zloop_assert_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "zloop_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "zloop_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "zloop_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "zloop_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "unknown": 3 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 7, "valid": 4, "unknown": 3 } } }, "behavior2": { "behavior2_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "behavior3": { "behavior3_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "behavior4": { "behavior4_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "behavior5": { "behavior5_assert_bad": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "if_assert": { "if_assert_assert_missing_return": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "if_assert_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "if_assert_assert_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "if_assert_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 1, "unknown": 2, "rank": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 4, "valid": 2, "unknown": 2, "rank": 2 } } }, "compare": { "compare_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026110� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027153� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/0fc0c87545f218082b029769b99f3cbb.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/0fc0c870000666�0000000�0000000�00000000107�13571573400�030146� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/21d803410dbbfd70cdb668492467b60e.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/21d80340000666�0000000�0000000�00000000107�13571573400�030001� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/6ebbb9ba0d75ceab60327c5edfcba19f.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/6ebbb9b0000666�0000000�0000000�00000000107�13571573400�030307� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/72bbc5126a5242466cbb895cebf6027f.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/72bbc510000666�0000000�0000000�00000000107�13571573400�030141� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/c637f422de13d8e95f7a1a89edea67c2.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/c637f420000666�0000000�0000000�00000000126�13571573400�030073� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0138, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/dd70bd3d9b6ee92aba6887c09808a980.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/dd70bd30000666�0000000�0000000�00000000107�13571573400�030223� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/e77f1bc90faed3c7ee344a6487f26e51.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/e77f1bc0000666�0000000�0000000�00000000107�13571573400�030232� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/eedbbd1cdf64aa6012b869697f66f2b1.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/eedbbd10000666�0000000�0000000�00000000107�13571573400�030362� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/faf120d58a951fa6145839b46c1df0a7.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.0.session/cache/faf120d0000666�0000000�0000000�00000000107�13571573400�030217� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.i.0.report.json��������0000666�0000000�0000000�00000036153�13571573400�027072� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 9, "valid": 1, "unknown": 8, "rank": 2 }, "qed": { "total": 18, "valid": 18 }, "wp:main": { "total": 27, "valid": 19, "unknown": 8, "rank": 2 } }, "wp:functions": { "empty": { "empty_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "one_assign": { "one_assign_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "one_if": { "one_if_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "some_seq": { "some_seq_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "some_seq_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "main_ensures_result": { "main_ensures_result_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "main": { "main_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "not_main": { "not_main_assert_bad": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "main_assigns_global": { "main_assigns_global_assert_bad": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_assigns_global_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_assigns_global_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } } }, "zloop": { "zloop_assert_bad": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "zloop_assert_3": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "zloop_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "zloop_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "zloop_loop_invariant": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "zloop_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 3, "unknown": 3 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 7, "valid": 4, "unknown": 3 } } }, "behavior2": { "behavior2_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "behavior3": { "behavior3_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "behavior4": { "behavior4_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "behavior5": { "behavior5_assert_bad": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "if_assert": { "if_assert_assert_missing_return": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "if_assert_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "if_assert_assert_2": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "if_assert_assert": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "alt-ergo": { "total": 3, "valid": 1, "unknown": 2, "rank": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 4, "valid": 2, "unknown": 2, "rank": 2 } } }, "compare": { "compare_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test.res.oracle�������������0000666�0000000�0000000�00000006445�13571573400�026260� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/stmtcompiler_test.i (no preprocessing) [kernel] tests/wp/stmtcompiler_test.i:136: Warning: Body of function if_assert falls-through. Adding a return statement [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp/stmtcompiler_test.i:145: Warning: No code nor implicit assigns clause for function behavior1, generating default assigns from the prototype [wp] Warning: Missing RTE guards [wp] tests/wp/stmtcompiler_test.i:81: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 27 goals scheduled [wp] [Qed] Goal typed_behavior2_assert : Valid [wp] [Qed] Goal typed_behavior3_assert : Valid [wp] [Qed] Goal typed_behavior4_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_behavior5_assert_bad : Unsuccess [wp] [Qed] Goal typed_compare_assert : Valid [wp] [Qed] Goal typed_empty_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_if_assert_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_if_assert_assert_2 : Unsuccess [wp] [Qed] Goal typed_if_assert_assert_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_if_assert_assert_missing_return : Unsuccess [wp] [Qed] Goal typed_main_assert : Valid [wp] [Qed] Goal typed_main_assigns_global_assert : Valid [wp] [Qed] Goal typed_main_assigns_global_assert_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_assigns_global_assert_bad : Unsuccess [wp] [Qed] Goal typed_main_ensures_result_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_not_main_assert_bad : Unsuccess [wp] [Qed] Goal typed_one_assign_assert : Valid [wp] [Qed] Goal typed_one_if_assert : Valid [wp] [Qed] Goal typed_some_seq_assert : Valid [wp] [Qed] Goal typed_some_seq_assert_2 : Valid [wp] [Qed] Goal typed_zloop_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_zloop_loop_invariant_preserved : Unsuccess [wp] [Qed] Goal typed_zloop_loop_invariant_established : Valid [wp] [Qed] Goal typed_zloop_assert : Valid [wp] [Qed] Goal typed_zloop_assert_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_zloop_assert_3 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_zloop_assert_bad : Unsuccess [wp] Proved goals: 19 / 27 Qed: 18 Alt-Ergo 2.0.0: 1 (unsuccess: 8) [wp] Report in: 'tests/wp/oracle_qualif/stmtcompiler_test.0.report.json' [wp] Report out: 'tests/wp/result_qualif/stmtcompiler_test.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success empty 1 - 1 100% one_assign 1 - 1 100% one_if 1 - 1 100% some_seq 2 - 2 100% main_ensures_result 1 - 1 100% main 1 - 1 100% not_main - - 1 0.0% main_assigns_global 2 - 3 66.7% zloop 4 - 7 57.1% behavior2 1 - 1 100% behavior3 1 - 1 100% behavior4 1 - 1 100% behavior5 - - 1 0.0% if_assert 1 1 (4..16) 4 50.0% compare 1 - 1 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test_rela.0.session/��������0000777�0000000�0000000�00000000000�13571573400�027113� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test_rela.0.session/cache/��0000777�0000000�0000000�00000000000�13571573400�030156� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000210�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test_rela.0.session/cache/8bf6a3f121519d7863ac34c9cb097dba.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test_rela.0.session/cache/8b0000666�0000000�0000000�00000000130�13571573400�030404� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0473, "steps": 175 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test_rela.i.0.report.json���0000666�0000000�0000000�00000001267�13571573400�030073� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "empty": { "empty_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/stmtcompiler_test_rela.res.oracle��������0000666�0000000�0000000�00000007167�13571573400�027265� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/stmtcompiler_test_rela.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Qed] Goal typed_empty_assert : Valid [wp] Proved goals: 1 / 1 Qed: 1 [wp] Report in: 'tests/wp/oracle_qualif/stmtcompiler_test_rela.0.report.json' [wp] Report out: 'tests/wp/result_qualif/stmtcompiler_test_rela.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success empty 1 - 1 100% ------------------------------------------------------------- ------The pred (c_11<c_23) -> (result_0<result_1) ####################################################################### Sequent: Assume { (* Leaving scope [tmp]: effect: ta_tmp_2 /\ (not ta_tmp_3) *) If (node_0=true) Then { Have: (ta_tmp_0=false) /\ (ta_tmp_1=true). Have: (node_1=true). } If (node_2=true) Then { Have: (node_0=true). } (* Set: tmp = c *) If (node_3=true) Then { Have: tmp_0 = c_2. Have: (node_2=true). } (* Set: c = c + 100 *) If (node_4=true) Then { Have: (100 + c_3) = c_2. Have: (node_3=true). } (* Set: c = c + 10 *) If (node_5=true) Then { Have: (10 + c_4) = c_2. Have: (node_3=true). } If (node_6=true) Then { If c < 0 Then { Have: (node_7=true). } Else { Have: (node_8=true). } } (* Entering scope [tmp]: effect: (not ta_tmp_0) /\ ta_tmp_1 *) If (node_9=true) Then { Have: (ta_tmp_1=true) /\ (ta_tmp_2=false). Have: (node_6=true). } If (node_7=true) Then { Have: c = c_4. Have: (node_5=true). } If (node_8=true) Then { Have: c = c_3. Have: (node_4=true). } Have: ((node_2=true) -> (tmp_0 = result_0)). Have: (node_1=true). Have: (node_9=true). (* Leaving scope [tmp]: effect: ta_tmp_8 /\ (not ta_tmp_9) *) If (node_10=true) Then { Have: (ta_tmp_3=false) /\ (ta_tmp_4=true). Have: (node_11=true). } If (node_12=true) Then { Have: (node_10=true). } (* Set: tmp = c *) If (node_13=true) Then { Have: tmp_1 = c_5. Have: (node_12=true). } (* Set: c = c + 100 *) If (node_14=true) Then { Have: (100 + c_6) = c_5. Have: (node_13=true). } (* Set: c = c + 10 *) If (node_15=true) Then { Have: (10 + c_7) = c_5. Have: (node_13=true). } If (node_16=true) Then { If c_1 < 0 Then { Have: (node_17=true). } Else { Have: (node_18=true). } } (* Entering scope [tmp]: effect: (not ta_tmp_6) /\ ta_tmp_7 *) If (node_19=true) Then { Have: (ta_tmp_4=true) /\ (ta_tmp_5=false). Have: (node_16=true). } If (node_17=true) Then { Have: c_1 = c_7. Have: (node_15=true). } If (node_18=true) Then { Have: c_1 = c_6. Have: (node_14=true). } Have: ((node_12=true) -> (tmp_1 = result_1)). Have: (node_11=true). Have: (node_19=true). } Prove: ((c < c_1) -> (result_0 < result_1)). ####################################################################### [Alt-Ergo 2.0.0] Valid ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.res.oracle��������������������0000666�0000000�0000000�00000010152�13571573400�024416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 1 [...] [kernel] Parsing tests/wp/wp_behav.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] tests/wp/wp_behav.c:172: Warning: Ignored specification 'for b1' (generalize to all behavior) [wp] Warning: Missing RTE guards [wp] tests/wp/wp_behav.c:69: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp/wp_behav.c:81: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp/wp_behav.c:154: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp/wp_behav.c:176: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 38 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_assert_needed_assert_ko : Unsuccess [wp] [Qed] Goal typed_assert_needed_assert_qed_ok_ok_with_hyp : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bhv_complete_pos_neg : Valid [wp] [Qed] Goal typed_bhv_neg_ensures_qed_ok : Valid [wp] [Qed] Goal typed_bhv_pos_ensures_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bts0513_ensures_ko1 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bts0513_ensures_ko2 : Unsuccess [wp] [Qed] Goal typed_f_ensures_qed_ok : Valid [wp] [Qed] Goal typed_f_x1_ensures_qed_ok : Valid [wp] [Qed] Goal typed_f_assert_qed_ok : Valid [wp] [Qed] Goal typed_f_x2_ensures_qed_ok : Valid [wp] [Qed] Goal typed_f_assert_qed_ok_2 : Valid [wp] [Qed] Goal typed_local_named_behavior_xpos_ensures_qed_ok : Valid [wp] [Qed] Goal typed_local_named_behavior_xpos_ensures_qed_ok_2 : Valid [wp] [Qed] Goal typed_min_complete_bx_by : Valid [wp] [Qed] Goal typed_min_disjoint_bx_by : Valid [wp] [Qed] Goal typed_min_bx_ensures_qed_ok : Valid [wp] [Qed] Goal typed_min_by_ensures_qed_ok : Valid [wp] [Qed] Goal typed_more_stmt_assigns_ensures_qed_ok_ok_with_hoare : Valid [wp] [Qed] Goal typed_more_stmt_assigns_blk_assigns_part1 : Valid [wp] [Qed] Goal typed_more_stmt_assigns_blk_assigns_part2 : Valid [wp] [Qed] Goal typed_part_stmt_bhv_b1_ensures_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_part_stmt_bhv_bs_ensures : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_razT_loop_invariant_qed_ok_preserved : Valid [wp] [Qed] Goal typed_razT_loop_invariant_qed_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_razT_b1_ensures_e1 : Unsuccess [wp] [Qed] Goal typed_stmt_assigns_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_stmt_assigns_assigns : Unsuccess [wp] [Qed] Goal typed_stmt_contract_requires_qed_ok : Valid [wp] [Qed] Goal typed_stmt_contract_ensures_qed_ok : Valid [wp] [Qed] Goal typed_stmt_contract_ok_ensures_qed_ok : Valid [wp] [Qed] Goal typed_stmt_contract_assigns_requires_qed_ok : Valid [wp] [Qed] Goal typed_stmt_contract_assigns_ensures_qed_ok : Valid [wp] [Qed] Goal typed_stmt_contract_assigns_assigns : Valid [wp] [Qed] Goal typed_stmt_contract_assigns_ok_ensures_qed_ok : Valid [wp] [Qed] Goal typed_stmt_contract_assigns_ok_asgn_ensures_qed_ok : Valid [wp] [Qed] Goal typed_stmt_contract_label_ensures_qed_ok_2 : Valid [wp] [Qed] Goal typed_stmt_contract_label_ensures_qed_ok : Valid [wp] Proved goals: 32 / 38 Qed: 30 Alt-Ergo 2.0.0: 2 (unsuccess: 6) [wp] Report in: 'tests/wp/oracle_qualif/wp_behav.0.report.json' [wp] Report out: 'tests/wp/result_qualif/wp_behav.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 5 - 5 100% min 4 - 4 100% bhv 2 1 (4..16) 3 100% stmt_contract 3 - 3 100% stmt_contract_label 2 - 2 100% stmt_contract_assigns 5 - 5 100% local_named_behavior 2 - 2 100% assert_needed 1 - 2 50.0% bts0513 - - 2 0.0% stmt_assigns 1 - 2 50.0% razT 1 1 (12..24) 3 66.7% more_stmt_assigns 3 - 3 100% part_stmt_bhv 1 - 2 50.0% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/����������������������0000777�0000000�0000000�00000000000�13571573400�024122� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/����������������0000777�0000000�0000000�00000000000�13571573400�025165� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/2c21c483e6514092e4297c8c7c7f5c27.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/2c21c483e65140920000666�0000000�0000000�00000000126�13571573400�027100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0136, "steps": 8 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/2d7c06745f3753a40000666�0000000�0000000�00000000072�13571573400�027171� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/2f1b7133d8eb145b63e2eb498c04d03d.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/2f1b7133d8eb145b0000666�0000000�0000000�00000000106�13571573400�027314� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/36a0dd93457388b6c6c84312921f068a.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/36a0dd93457388b60000666�0000000�0000000�00000000106�13571573400�027175� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/afa6e44ddb6ea474a65613aec1f876dc.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/afa6e44ddb6ea4740000666�0000000�0000000�00000000127�13571573400�027547� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0111, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/c23fba7e5fe63bc7e55fd7ea9b88cbe9.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.0.session/cache/c23fba7e5fe63bc70000666�0000000�0000000�00000000106�13571573400�027546� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.res.oracle��������������������0000666�0000000�0000000�00000003076�13571573400�024426� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp/wp_behav.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] tests/wp/wp_behav.c:172: Warning: Ignored specification 'for b1' (generalize to all behavior) [wp] Warning: Missing RTE guards [wp] tests/wp/wp_behav.c:69: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 8 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f_x1_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f_x2_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_min_bx_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_min_by_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_stmt_contract_ko_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_stmt_contract_ko_without_asgn_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_stmt_contract_assigns_ko_ensures_qed_ko : Unsuccess [wp] Proved goals: 0 / 8 Alt-Ergo 2.0.0: 0 (unsuccess: 8) [wp] Report in: 'tests/wp/oracle_qualif/wp_behav.1.report.json' [wp] Report out: 'tests/wp/result_qualif/wp_behav.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 3 0.0% min - - 2 0.0% stmt_contract - - 2 0.0% stmt_contract_assigns - - 1 0.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/����������������������0000777�0000000�0000000�00000000000�13571573400�024123� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/����������������0000777�0000000�0000000�00000000000�13571573400�025166� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/0fb970e5c6ab3888a204139d3cd2b997.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/0fb970e5c6ab38880000666�0000000�0000000�00000000107�13571573400�027337� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/11ff8a4041ea06001123f69473d6be27.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/11ff8a4041ea06000000666�0000000�0000000�00000000107�13571573400�027222� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/2d7c06745f3753a40000666�0000000�0000000�00000000072�13571573400�027172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/757b09ca6b9492a26cc4218a6f427fb3.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/757b09ca6b9492a20000666�0000000�0000000�00000000107�13571573400�027253� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/8f2ec7b0ccefab812d364dabe9f39174.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/8f2ec7b0ccefab810000666�0000000�0000000�00000000107�13571573400�027624� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/ab1bfbbefdd06631a6280e248d23e12c.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.1.session/cache/ab1bfbbefdd066310000666�0000000�0000000�00000000107�13571573400�027611� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.c.0.report.json�����������������0000666�0000000�0000000�00000047216�13571573400�025100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 8, "valid": 2, "unknown": 6, "rank": 4 }, "qed": { "total": 30, "valid": 30 }, "wp:main": { "total": 38, "valid": 32, "unknown": 6, "rank": 4 } }, "wp:functions": { "f": { "f_assert_qed_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_x2_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_x1_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "min": { "min_disjoint_bx_by": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "min_complete_bx_by": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "min_by_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "min_bx_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } }, "bhv": { "bhv_complete_pos_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "bhv_neg_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bhv_pos_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 3 } } }, "stmt_contract": { "stmt_contract_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "stmt_contract_requires_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "stmt_contract_ok_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "stmt_contract_label": { "stmt_contract_label_ensures_qed_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "stmt_contract_label_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "stmt_contract_assigns": { "stmt_contract_assigns_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "stmt_contract_assigns_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "stmt_contract_assigns_requires_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "stmt_contract_assigns_ok_asgn_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "stmt_contract_assigns_ok_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "local_named_behavior": { "local_named_behavior_xpos_ensures_qed_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "local_named_behavior_xpos_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "assert_needed": { "assert_needed_assert_qed_ok_ok_with_hyp": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "assert_needed_assert_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "bts0513": { "bts0513_ensures_ko2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bts0513_ensures_ko1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "stmt_assigns": { "stmt_assigns_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "stmt_assigns_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "razT": { "razT_loop_invariant_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "razT_b1_ensures_e1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1, "rank": 4 } } }, "more_stmt_assigns": { "more_stmt_assigns_blk_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "more_stmt_assigns_ensures_qed_ok_ok_with_hoare": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "part_stmt_bhv": { "part_stmt_bhv_bs_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "part_stmt_bhv_b1_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_behav.c.1.report.json�����������������0000666�0000000�0000000�00000011252�13571573400�025070� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 8, "unknown": 8 }, "wp:main": { "total": 8, "unknown": 8 } }, "wp:functions": { "f": { "f_x2_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_x1_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "unknown": 3 }, "wp:main": { "total": 3, "unknown": 3 } } }, "min": { "min_by_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "min_bx_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "stmt_contract": { "stmt_contract_ko_without_asgn_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "stmt_contract_ko_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "stmt_contract_assigns": { "stmt_contract_assigns_ko_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_call_pre.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024616� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_call_pre.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025661� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_call_pre.0.session/cache/e780596669cdd012782072be66d12e4b.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_call_pre.0.session/cache/e780596669cdd0000666�0000000�0000000�00000000127�13571573400�027453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0141, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_call_pre.c.0.report.json��������������0000666�0000000�0000000�00000014644�13571573400�025573� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 10, "valid": 10, "rank": 2 } }, "wp:functions": { "double_call": { "f_requires_qed_ok_Rf_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_requires_qed_ok_Rf": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 2 } } }, "main": { "f_requires_qed_ok_Rf_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_ensures_qed_ok_Emain": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Rmain": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "call_main": { "main_requires_qed_ok_Rmain_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_main_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "stmt_pre": { "stmt_pre_requires_qed_ok_Rstmt": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "call_g": { "g_requires_Rgb": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_requires_qed_ok_Rga": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ��������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_call_pre.res.oracle�������������������0000666�0000000�0000000�00000003423�13571573400�024757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/wp_call_pre.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp/wp_call_pre.c:53: Warning: No code nor implicit assigns clause for function g, generating default assigns from the prototype [kernel] tests/wp/wp_call_pre.c:53: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards [wp] 10 goals scheduled [wp] [Qed] Goal typed_call_g_call_g_requires_qed_ok_Rga : Valid [wp] [Qed] Goal typed_call_g_call_g_requires_Rgb : Valid [wp] [Qed] Goal typed_call_main_ensures_qed_ok : Valid [wp] [Qed] Goal typed_call_main_call_main_requires_qed_ok_Rmain : Valid [wp] [Qed] Goal typed_double_call_call_f_requires_qed_ok_Rf : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_double_call_call_f_2_requires_qed_ok_Rf : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Rmain : Valid [wp] [Qed] Goal typed_main_ensures_qed_ok_Emain : Valid [wp] [Qed] Goal typed_main_call_f_requires_qed_ok_Rf : Valid [wp] [Qed] Goal typed_stmt_pre_requires_qed_ok_Rstmt : Valid [wp] Proved goals: 10 / 10 Qed: 9 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp/oracle_qualif/wp_call_pre.0.report.json' [wp] Report out: 'tests/wp/result_qualif/wp_call_pre.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success double_call 1 1 (4..16) 2 100% main 3 - 3 100% call_main 2 - 2 100% stmt_pre 1 - 1 100% call_g 2 - 2 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_eqb.0.report.json���������������������0000666�0000000�0000000�00000002023�13571573400�024324� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:functions": { "f": { "f_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_eqb.0.session/������������������������0000777�0000000�0000000�00000000000�13571573400�023604� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_eqb.0.session/cache/������������������0000777�0000000�0000000�00000000000�13571573400�024647� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000170�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_eqb.0.session/cache/7fee9fe07f256d953327c9088c7a94c0.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_eqb.0.session/cache/7fee9fe07f256d95330000666�0000000�0000000�00000000127�13571573400�027266� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0097, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_eqb.i.0.report.json�������������������0000666�0000000�0000000�00000002023�13571573400�024553� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:functions": { "f": { "f_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_eqb.res.oracle������������������������0000666�0000000�0000000�00000001256�13571573400�023747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp/wp_eqb.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp/oracle_qualif/wp_eqb.0.report.json' [wp] Report out: 'tests/wp/result_qualif/wp_eqb.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (8..20) 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024677� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025742� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/cache/1528cf42525a01f3944e99e556354442.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/cache/1528cf42525a00000666�0000000�0000000�00000000107�13571573400�027416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/cache/2d7c06745f3750000666�0000000�0000000�00000000072�13571573400�027436� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/cache/51575c7e603242f75c27b4c733019a3a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/cache/51575c7e603240000666�0000000�0000000�00000000107�13571573400�027347� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/cache/c23fba7e5fe63bc7e55fd7ea9b88cbe9.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.0.session/cache/c23fba7e5fe630000666�0000000�0000000�00000000107�13571573400�027730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.c.0.report.json��������������0000666�0000000�0000000�00000031714�13571573400�025651� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 8, "unknown": 8 }, "qed": { "total": 17, "valid": 17 }, "wp:main": { "total": 25, "valid": 17, "unknown": 8 } }, "wp:functions": { "bts0513": { "bts0513_ensures_qed_ko_ko2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bts0513_ensures_qed_ko_ko1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "bts0513_bis": { "bts0513_bis_assert_qed_ok_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bts0513_bis_assert_qed_ko_ko1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "dpd1": { "dpd1_assert_qed_ok_A": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "dpd1_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "dpd1_ensures_qed_ko_Eko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } } }, "dpd2": { "dpd2_assert_qed_ok_A": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "dpd2_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "dpd2_ensures_qed_ko_Eko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } } }, "spec_if": { "spec_if_assert_rte_signed_overflow_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "spec_if_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "spec_if_assigns_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "spec_if_assigns_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "spec_if_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "spec_if_ensures_qed_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "spec_if_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 7, "valid": 5, "unknown": 2 } } }, "spec_if_cond": { "spec_if_cond_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "spec_if_not_cond": { "spec_if_not_cond_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "default_behaviors": { "default_behaviors_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "default_behaviors_assert_qed_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "default_behaviors_assert_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "default_behaviors_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "default_behaviors_ensures_qed_ok_stmt_p": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "default_behaviors_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 6, "valid": 5, "unknown": 1 } } } } } ����������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/oracle_qualif/wp_strategy.res.oracle�������������������0000666�0000000�0000000�00000005521�13571573400�025041� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Hoare' [...] [kernel] Parsing tests/wp/wp_strategy.c (with preprocessing) [rte] annotating function bts0513 [rte] annotating function bts0513_bis [rte] annotating function default_behaviors [rte] annotating function dpd1 [rte] annotating function dpd2 [rte] annotating function spec_if [rte] annotating function spec_if_cond [rte] annotating function spec_if_not_cond [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 25 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal hoare_bts0513_ensures_qed_ko_ko1 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal hoare_bts0513_ensures_qed_ko_ko2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal hoare_bts0513_bis_assert_qed_ko_ko1 : Unsuccess [wp] [Qed] Goal hoare_bts0513_bis_assert_qed_ok_ok : Valid [wp] [Qed] Goal hoare_default_behaviors_ensures_qed_ok : Valid [wp] [Qed] Goal hoare_default_behaviors_assert_qed_ok_2 : Valid [wp] [Qed] Goal hoare_default_behaviors_ensures_qed_ok_stmt_p : Valid [wp] [Qed] Goal hoare_default_behaviors_assert_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal hoare_default_behaviors_assert_rte_signed_overflow : Unsuccess [wp] [Qed] Goal hoare_default_behaviors_assigns : Valid [wp] [Qed] Goal hoare_dpd1_assert_qed_ok_A : Valid [wp] [Alt-Ergo 2.0.0] Goal hoare_dpd1_ensures_qed_ko_Eko : Unsuccess [wp] [Qed] Goal hoare_dpd1_assigns : Valid [wp] [Qed] Goal hoare_dpd2_assert_qed_ok_A : Valid [wp] [Alt-Ergo 2.0.0] Goal hoare_dpd2_ensures_qed_ko_Eko : Unsuccess [wp] [Qed] Goal hoare_dpd2_assigns : Valid [wp] [Qed] Goal hoare_spec_if_ensures_qed_ok_2 : Valid [wp] [Qed] Goal hoare_spec_if_ensures_qed_ok : Valid [wp] [Qed] Goal hoare_spec_if_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal hoare_spec_if_assert_rte_signed_overflow : Unsuccess [wp] [Qed] Goal hoare_spec_if_assigns_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal hoare_spec_if_assert_rte_signed_overflow_2 : Unsuccess [wp] [Qed] Goal hoare_spec_if_assigns_3 : Valid [wp] [Qed] Goal hoare_spec_if_cond_ensures_qed_ok : Valid [wp] [Qed] Goal hoare_spec_if_not_cond_ensures_qed_ok : Valid [wp] Proved goals: 17 / 25 Qed: 17 Alt-Ergo 2.0.0: 0 (unsuccess: 8) [wp] Report in: 'tests/wp/oracle_qualif/wp_strategy.0.report.json' [wp] Report out: 'tests/wp/result_qualif/wp_strategy.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success bts0513 - - 2 0.0% bts0513_bis 1 - 2 50.0% dpd1 2 - 3 66.7% dpd2 2 - 3 66.7% spec_if 5 - 7 71.4% spec_if_cond 1 - 1 100% spec_if_not_cond 1 - 1 100% default_behaviors 5 - 6 83.3% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/sharing.c����������������������������������������������0000666�0000000�0000000�00000000547�13571573400�017506� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-msg-key print-generated -wp-prover why3 -wp-gen */ /*@ requires \valid(t+(0..9)); requires 0 <= x < 10; requires \forall integer n; 0 <= n < 10 ==> 0 <= t[n]; ensures \forall integer n; 0 <= n < 10 ==> 0 <= t[n]; @*/ void f(int *t, int x){ t[0] = t[x]; t[1] = t[x]; t[2] = t[x]; t[3] = t[x]; t[4] = t[x]; } ���������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/stmtcompiler_test.i������������������������������������0000666�0000000�0000000�00000004445�13571573400�021643� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -load-script tests/wp/stmtcompiler_test.ml -wp-msg-key success-only */ int empty (int c){ /*@ assert \true; */ return c; } int one_assign (int c){ int d; d = c; /*@ assert d == c; */ return d; } int one_if (int c){ /*@ assert \true; */ if(c) return 1; else return 2; } int some_seq (int c){ int d; d = 0; if(c) d = 1; else d = 2; /*@ assert (c != 0 ==> d == 1); */ /*@ assert (c == 0 ==> d == 2); */ d += 1; return d; } /*@ ensures \result == 0; assigns \nothing; @*/ int ensures_result(void); int main_ensures_result(){ int x; x = ensures_result(); /*@ assert x == 0; */ return 1; } int foo = 42; void main(){ /*@ assert foo == 42; @*/ } void not_main(){ /*@ assert bad: foo == 42; @*/ } /*@ ensures \result == x; ensures foo == x; assigns foo; @*/ int assigns_global(int x); void main_assigns_global(int x){ foo = 1; int r = assigns_global(x); /*@ assert x == 2 ==> foo == 2; */ /*@ assert foo == r; */ /*@ assert bad: foo == 1; */ } /*@ requires x >= 0; ensures \result >= 0; @*/ int zloop(int x){ int i = 0; i++; /*@ loop invariant i <= 10; @*/ for(; i < 10; i++){ i++; } /*@ assert i >= 10; @*/ /*@ assert i == 10; @*/ /*@ assert x >= 0; @*/ if(foo==0){ /*@ assert bad: i == 1; @*/ 0; } return x; } /*@ behavior zero: assumes x == 0; ensures \result <= 0; behavior pos: assumes x >= 0; ensures \result >= 0; behavior neg: assumes x < 0; ensures \result < 0; complete behaviors zero, pos, neg; @*/ int behavior1(int x); int behavior2(){ int x; x = behavior1(-1); /*@ assert x < 0; */ return 1; } int behavior3(){ int x; x = behavior1(1); /*@ assert x >= 0; */ return 1; } int behavior4(){ int x; x = behavior1(0); /*@ assert x == 0; */ return 1; } int behavior5(){ int x; x = behavior1(1); /*@ assert bad: x < 0; */ return 1; } int if_assert(int x, int y){ if (x < 0) { /*@ assert x < y * y; @*/ } else { x = - x; /*@ assert x < y * y; @*/ } /*@ assert 0 < (y * y) - x; @*/ } int compare(int a, int b, int c, int d) { int r; if(a > b) r = -1; else if((a == b) && ((c < d))) r = -1; else if((a == b) && !((c < d))) r = 0; else r = 1; /*@ assert (a < b) ==> r == 1; @*/ return r; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/stmtcompiler_test.ml�����������������������������������0000666�0000000�0000000�00000011313�13571573400�022013� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* test API of StmtSemantics *) [@@@ warning "-40"] [@@@ warning "-42"] open Wp open Factory open Sigs let mode = `Tree let run () = let setup : Factory.setup = { mheap = Typed MemTyped.NoCast; mvar = Var; cint = Cint.Natural; cfloat = Cfloat.Real} in let driver = Driver.load_driver () in let model = Factory.instance setup driver in let module C = (val (Factory.compiler setup.mheap setup.mvar)) in let module Compiler = StmtSemantics.Make(C) in let module Cfg = Compiler.Cfg in let provers = List.fold_right (fun pname prvs -> match VCS.prover_of_name pname with | None -> prvs | Some VCS.Tactical -> prvs | Some prv -> (VCS.mode_of_prover_name pname, prv) :: prvs) ["qed"] [] in let spawn goal = let result _ prv res = Format.printf "[%a] %a@.@\n" VCS.pp_prover prv VCS.pp_result res in let server = ProverTask.server () in Prover.spawn goal ~delayed:true ~result provers; Task.launch server in let prove_sequent kf prop_id sequent = Format.printf "@[<3>@[%s sequent:@]@ %a@]@." (Kernel_function.get_name kf) !Conditions.pretty sequent; let goal = Wpo.GOAL.make sequent in let vc_annot = Wpo.VC_Annot.{ axioms = None; goal; tags = []; warn = []; deps = Property.Set.empty; path = Cil_datatype.Stmt.Set.empty; effect = None; } in let po = Wpo.{ po_gid = ""; po_sid = ""; po_name = ""; po_leg = ""; po_idx = Function(kf, None); po_model = model; po_pid = prop_id; po_formula = Wpo.GoalAnnot vc_annot; } in Format.printf "@[%a@]" Wpo.pp_goal po; spawn po; Format.printf "%s@." Wpo.bar ; in let goal_read acc g = let reads = Cfg.P.reads g.Compiler.goal_pred in Cfg.Node.Map.union (fun _ -> C.M.Sigma.union) reads acc in let prove_goal kf start cfg goal = let pred = goal.Compiler.goal_pred in let user_reads = goal_read Cfg.Node.Map.empty goal in let posts = Cfg.P.nodes pred in let name = Kernel_function.get_name kf in let (_, nsigmas,sequence) = Compiler.Cfg.compile ~mode ~name start posts user_reads cfg in (* Format.printf "Nodes of %a: " Lang.F.pp_pred (Cfg.P.get pred); *) let map n _domain = (* Format.printf "%a " Cfg.Node.pp n; *) try Cfg.Node.Map.find n nsigmas with Not_found -> (* Format.printf "unknown node %a@." Cfg.Node.pp n; *) assert false in let pred = Cfg.P.relocate (Cfg.Node.Map.map map (Cfg.P.reads pred)) pred in (* Format.printf "@."; *) let p = (Cfg.P.get pred) in let sequent = sequence, p in prove_sequent kf goal.Compiler.goal_prop sequent in (** Test on real Cil functions *) let _run_test model kf = let context = model , WpContext.Kf kf in WpContext.on_context context begin fun () -> let automaton = Interpreted_automata.Compute.get_automaton ~annotations:true kf in (* Format.printf "@[%s body cil:%a@]@." fct Printer.pp_block block; *) let seq = {Sigs.pre = Cfg.node (); post = Cfg.node ()} in let env = Compiler.empty_env kf in let env = Compiler.(env @* [Clabels.here,seq.pre; Clabels.next,seq.post]) in let paths = Compiler.automaton env automaton in let cfg, goals = paths.Compiler.paths_cfg, paths.Compiler.paths_goals in Format.printf "old way@."; Bag.iter (prove_goal kf seq.pre cfg) goals; end () in let run_test_ia model kf = let context = model , WpContext.Kf kf in WpContext.on_context context begin fun () -> let paths,start = Compiler.compute_kf kf in let cfg, goals = paths.Compiler.paths_cfg, paths.Compiler.paths_goals in let fname = Filename.temp_file "cfg_pre_" (Kernel_function.get_name kf) in let cout = open_out fname in Compiler.Cfg.output_dot cout ~checks:(Bag.map (fun g -> g.Compiler.goal_pred) goals) cfg; close_out cout; Format.printf "new way@."; Bag.iter (prove_goal kf start cfg) goals; end () in let ordered_kf = List.sort (fun kf1 kf2 -> Cil_datatype.Location.compare (Kernel_function.get_location kf1) (Kernel_function.get_location kf2) (* String.compare *) (* (Kernel_function.get_name kf1) *) (* (Kernel_function.get_name kf2) *) ) (Globals.Functions.fold (fun kf acc -> kf::acc) []) in List.iter (fun kf -> if Kernel_function.is_definition kf then Lang.local (run_test_ia model) kf ) ordered_kf let () = Db.Main.extend run ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/stmtcompiler_test_rela.i�������������������������������0000666�0000000�0000000�00000000327�13571573400�022641� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -load-script tests/wp/stmtcompiler_test_rela.ml -wp-msg-key success-only */ int empty (int c){ c = c < 0 ? c + 10 : c+100; int tmp; tmp = c; /*@ assert \true;*/ return tmp; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/stmtcompiler_test_rela.ml������������������������������0000666�0000000�0000000�00000012423�13571573400�023021� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* test API of StmtCompiler for relational property verification*) [@@@ warning "-40"] [@@@ warning "-42"] open Wp open Factory open Sigs let run () = let setup : Factory.setup = { mheap = Hoare; mvar = Var; cint = Cint.Natural; cfloat = Cfloat.Real} in let driver = Driver.load_driver () in let model = Factory.instance setup driver in let module C = (val (Factory.compiler setup.mheap setup.mvar)) in let module Compiler = StmtSemantics.Make(C) in let module Cfg = Compiler.Cfg in let provers = List.fold_right (fun pname prvs -> match VCS.prover_of_name pname with | None -> prvs | Some VCS.Tactical -> prvs | Some prv -> (VCS.mode_of_prover_name pname, prv) :: prvs) ["alt-ergo"] [] in let spawn goal = let result _ prv res = Format.printf "[%a] %a@.@\n" VCS.pp_prover prv VCS.pp_result res in let server = ProverTask.server () in Prover.spawn goal ~delayed:true ~result provers; Task.launch server in let prove kf sequent = let goal = Wpo.GOAL.make sequent in let vc_annot = Wpo.VC_Annot.{ axioms = None; goal; tags = []; warn = []; deps = Property.Set.empty; path = Cil_datatype.Stmt.Set.empty; effect = None; } in let funct = Kernel_function.get_definition kf in let stmt = List.hd (funct.sbody.bstmts) in let pred = Cil_types.{ pred_name = []; pred_loc = funct.svar.vdecl; pred_content = Cil_types.Ptrue; } in let annot = Logic_const.new_code_annotation (AAssert ([],Assert,pred)) in let po = Wpo.{ po_gid = ""; po_leg = ""; po_sid = ""; po_name = ""; po_idx = Function(kf, None); po_model = model; po_pid = WpPropId.mk_assert_id kf stmt annot; po_formula = Wpo.GoalAnnot vc_annot; } in let inter_po = ref po in Property_status.iter (fun x -> match Wpo.goals_of_property x with | h :: _ -> inter_po := Wpo.{ po_gid = ""; po_leg = ""; po_sid = ""; po_name = ""; po_idx = Function(kf, None); po_model = model; po_pid = h.po_pid; po_formula = Wpo.GoalAnnot vc_annot; } | _ -> () ); spawn !inter_po; in let reads_formal f sigma = let v= C.M.load sigma (Ctypes.C_int (Wp.Ctypes.c_int Cil_types.IInt)) (C.M.cvar f) in let t = C.C.cval v in t in let run_test kf = let fct = Kernel_function.get_definition kf in WpContext.on_context (model,WpContext.Kf kf) begin fun () -> let block = Interpreted_automata.Compute.get_automaton ~annotations:true kf in let formal = List.hd (fct.sformals) in (*First call*) let seq1 = {Sigs.pre = Cfg.node (); post = Cfg.node ()} in let env1 = Compiler.empty_env kf in let env1 = Compiler.(env1 @* [Clabels.here,seq1.pre;Clabels.next,seq1.post]) in let path1 = Compiler.automaton env1 block in let cfg1 = path1.Compiler.paths_cfg in let node1 = Cfg.T.init' seq1.pre (reads_formal formal) in let (_,sigma1,sequence1) = Compiler.Cfg.compile seq1.pre (Cfg.Node.Set.singleton seq1.post) (Cfg.T.reads node1) cfg1 in let node1 = Cfg.T.relocate sigma1 node1 in let term_1 = Cfg.T.get node1 in (*Seconde call*) let seq2 = {Sigs.pre = Cfg.node (); post = Cfg.node ()} in let env2 = Compiler.empty_env kf in let env2 = Compiler.(env2 @* [Clabels.here,seq2.pre;Clabels.next,seq2.post]) in let path2 = Compiler.automaton env2 block in let cfg2 = path2.Compiler.paths_cfg in let node2 = Cfg.T.init' seq2.pre (reads_formal formal) in let (_,sigma2,sequence2) = Compiler.Cfg.compile seq2.pre (Cfg.Node.Set.singleton seq2.post) (Cfg.T.reads node2) cfg2 in let node2 = Cfg.T.relocate sigma2 node2 in let term_2 = Cfg.T.get node2 in let return1 = Compiler.result env1 in let return1 = Lang.F.e_var return1 in let return2 = Compiler.result env2 in let return2 = Lang.F.e_var return2 in let pred = Lang.F.p_imply (Lang.F.p_lt term_1 term_2) (Lang.F.p_lt return1 return2) in Format.printf "------The pred %a @." Lang.F.pp_pred pred; let sequent = (Conditions.concat [sequence1;sequence2]),pred in Format.printf "#######################################################################@."; Format.printf "Sequent: @[%a@]" !Conditions.pretty sequent; Format.printf "#######################################################################@."; prove kf sequent; end () in let ordered_kf = List.sort (fun kf1 kf2 -> String.compare (Kernel_function.get_name kf1) (Kernel_function.get_name kf2)) (Globals.Functions.fold (fun kf acc -> kf::acc) []) in List.iter (fun kf -> if Kernel_function.is_definition kf then Lang.local run_test kf) ordered_kf let () = Db.Main.extend run ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/wp_behav.c���������������������������������������������0000666�0000000�0000000�00000006620�13571573400�017644� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-prop="-qed_ko" -wp-timeout 1 OPT: -wp-prop qed_ko -wp-steps 50 */ int X, Y, Z; /*@ @ ensures qed_ok: \result > x; @ ensures qed_ko: \result > 0; @ behavior x1: @ assumes x == 1; @ ensures qed_ok: \result == 3; @ ensures qed_ko: \result == 4; @ behavior x2: @ assumes x == 2; @ ensures qed_ok: \result == 4; @ ensures qed_ko: \result == 3; @ */ int f (int x) { x++; //@ for x1: assert qed_ok: x == 2; //@ for x2: assert qed_ok: x == 3; return x+1; } /*@ behavior bx: assumes x <= y; ensures qed_ok: \result == x; ensures qed_ko: \result == y; behavior by: assumes x > y; ensures qed_ok: \result == y; ensures qed_ko: \result == x; complete behaviors bx, by; disjoint behaviors bx, by; */ int min (int x, int y) { return (x < y) ? x : y; } /*@ requires n != 0; behavior pos: assumes n > 0; ensures qed_ok: \result == x/n; behavior neg: assumes n < 0; ensures qed_ok: \result == x/-n; complete behaviors pos, neg; // notice that this needs the requires hyp */ int bhv (int x, int n) { n = (n<0) ? -n : n; return x/n; } /*@ behavior ok: ensures qed_ok: \result > 0; behavior ko: ensures qed_ko: \result > 2; behavior ko_without_asgn: ensures qed_ko: \result > Y; */ int stmt_contract (int c) { int x = 0; Y = 0; /*@ requires qed_ok: x == 0; @ ensures qed_ok: x > 0; */ if (c) x = 3; else x = 5; return x; } //@ ensures qed_ok: \result >= 0; int stmt_contract_label (int c) { int x = 0; //@ ensures qed_ok: x >= \old(x); if (c) x++; return x; } /*@ behavior ok: ensures qed_ok: \result > 0; behavior ko: ensures qed_ko: \result > 2; behavior ok_asgn: ensures qed_ok: \result > Y; */ int stmt_contract_assigns (int c) { int x = 0; Y = 0; /*@ requires qed_ok: x == 0; @ ensures qed_ok: x > 0; @ assigns qed_ok: asgn_ok: x; */ if (c) x = 3; else x = 5; return x; } int local_named_behavior (int x) { int y = 3; /*@ behavior xpos: assumes x > 0; ensures qed_ok: x > 3; ensures qed_ok: x > y; */ x += y; return x; } void assert_needed (int x) { //@ assert ko: x > 0; int a = 0; a += x; //@ assert qed_ok: ok_with_hyp: a > 0; } /* we shouldn't be able to prove ko1 from ko2 and then ko2 from ko1 */ /*@ ensures ko1: \result == x+1; ensures ko2: \result == x+1; */ int bts0513 (int x) { return x; } //@ assigns X, Y; void unknown (int, int); //@ ensures \result > X; int stmt_assigns (int a) { int x = 0; int y = 3; X = x; //@ assigns Y; unknown (x, y); x = x+1; return x; } int T[10]; // use Inv as Hyp for Bhp props /*@ requires n < 10; behavior b1: assumes 0<n; ensures e1: T[0] == 0; */ void razT (int n) { //@ loop invariant qed_ok: \forall int k; 0<= k < i ==> T[k] == 0; for (int i = 0; i < n; i++) T[i] = 0; } //@ ensures qed_ok: ok_with_hoare: T[1] == \old(T[1]); int more_stmt_assigns (int x) { x = 0; //@ behavior blk: assigns qed_ok:x, qed_ok:T[x]; { T[x] = 1; x = 1; } return x; } /*@ behavior b1: assumes x > 0; ensures qed_ok: \result > x; */ int part_stmt_bhv (int x) { /*@ //TODO: not implemented yet. for b1: behavior bs: ensures x > \old(x); */ if (x > 0) x++; return x; } //============================================================================== ����������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/wp_behavior.i������������������������������������������0000666�0000000�0000000�00000002516�13571573400�020364� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-precond-weakening OPT: -wp-precond-weakening */ /* run.config_qualif DONTRUN: */ int tab[10], x, y; /*@ axiomatic a { @ predicate P reads \nothing; @ predicate Q reads \nothing; predicate RQ reads \nothing; @ predicate R reads \nothing; predicate R1 reads \nothing; @ predicate CX reads \nothing; @ predicate RX reads \nothing; predicate RX1 reads \nothing; @ predicate PX reads \nothing; @ predicate CY reads \nothing; @ predicate RY reads \nothing; @ predicate PY reads \nothing; }*/ /*@ requires R; @ ensures P; @ behavior X: @ assumes CX; @ requires RX; @ ensures PX; @ assigns *qx; @ behavior Y: @ assumes CY; @ requires RY; @ ensures PY; @ assigns *qy; @ complete behaviors; @ disjoint behaviors; @*/ void behaviors(int c, int* px, int *py, int * qx, int* qy) { /*@ assert Q;*/ if (c) *px=1; else *py=1; return; } /*@ requires R; @ requires R1; @ behavior X: @ assumes CX; @ requires RX; @ requires RX1; @ assigns *p; @ behavior Y: @ assumes CY; @ requires RY; @ assigns *q; @*/ void main(int c, int* p, int *q) { if (c) *p=1; else *q=1; return; } /*@ requires RQ ; assigns *px, *py ; ensures Q ; */ void call(int cond, int* px, int *py, int * qx, int* qy) { behaviors (cond, px, py, qx, qy) ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/wp_call_pre.c������������������������������������������0000666�0000000�0000000�00000002503�13571573400�020334� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Hoare -wp-no-simpl -wp-prop Rmain OPT: -wp-model Hoare -wp-no-simpl -wp-fct main OPT: -wp-model Hoare -wp-no-simpl -wp-prop Rf OPT: -wp-model Hoare -wp-no-simpl -wp-fct double_call OPT: -wp-model Hoare -wp-no-simpl -wp-fct stmt_pre -wp-prop Rstmt */ /* run.config_qualif OPT: -journal-disable -wp -wp-par 1 */ int G = 3; //@ requires qed_ok: Rf: a > 0; ensures Ef: \result > 0; int f (int a); // Function with 2 preconditions. //@ requires qed_ok: Rga: a > 0; requires Rgb: b > 0; ensures Ef: \result > 0; int g (int a, int b); /* This is to test explicitly the case where the post-condition of a call * is at the same program point than the precondition of the next call */ //@ requires Rd: x >= 0; int double_call (int x) { int x1 = f (x+1); int x2 = f (x+2); return x1 + x2; } //@ requires qed_ok: Rmain: G > 0; ensures qed_ok: Emain: \result > 0; int main (void) { int x = f(G); return x; } //@ ensures qed_ok: \result > 0; int call_main (void) { G = 1; return main (); } //@ requires 0 < G; int stmt_pre (void) { int x = 0; //@ requires qed_ok: Rstmt: G > x; x = G - x; return x; } // proving the preconditions on [g] call from the GUI should change the // status of [g] preconditions since it is the only call. int call_g (void) { int x = 1; int y = 2; return g (1, 2); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/wp_eqb.i�����������������������������������������������0000666�0000000�0000000�00000000362�13571573400�017331� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /* run.config OPT: -wp-msg-key print-generated -wp-prover why3 -wp-gen */ /*@ ensures \result == 1 ==> ((a==b) == (c==d)); @*/ int f(int a, int b, int c, int d){ if((a==b) == (c == d)){ return 1; } else { return 0; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp/wp_strategy.c������������������������������������������0000666�0000000�0000000�00000005456�13571573400�020427� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -journal-disable -wp-model Hoare -wp-verbose 2 OPT: -journal-disable -wp-model Typed -wp-verbose 2 -wp-prop @assigns */ /* run.config_qualif OPT: -journal-disable -rte -wp -wp-model Hoare -wp-par 1 -wp-msg-key "success-only" */ /*----------------------------------------------------------------------------*/ /* This file is to test the strategy generation, so it doesn't need to be tested * for different models. Let's choose examples that work with Hoare, * except to test assign properties that need pointer aware memory model (ex Typed). */ /*----------------------------------------------------------------------------*/ /* we shouldn't be able to prove ko1 from ko2 and then ko2 from ko1 */ /*@ ensures qed_ko: ko1 : \result == x+1; ensures qed_ko: ko2 : \result == x+1; */ int bts0513 (int x) { return x; } int bts0513_bis (int x) { int i; //@ assert qed_ko: ko1 : x > 0; //@ assert qed_ok: ok : x > 0; return x; } /*----------------------------------------------------------------------------*/ // Problem of dependencies : we should be able to prove A, and the proof // of E shouldn't depend on A ! void dpd1 (int x) { //@ ensures qed_ko: Eko: x>0; assigns qed_ok: x; ; //@ assert qed_ok: A: x>0; } // workaround : //@ behavior P: void dpd2 (int x) { //@ ensures qed_ko: Eko: x>0; assigns qed_ok: x; ; //@ for P: assert qed_ok: A: x>0; } //============================================================================== // specification of an IF block : notice that the proof of the ensures property // shouldn't depend on [spec_if_f] properties. int Z; int T[10]; /*@ assigns T[i]; ensures T[i] > i; */ void spec_if_f (int i); //@ ensures qed_ok: T[0] > 0; void spec_if (int c0, int c1, int c2) { //@ assigns qed_ok: T[0], Z; ensures qed_ok: T[0] > 0; if (c0) { spec_if_f (0); } else { T[0] = 5; } //@ assigns qed_ok: T[1], Z; if (c1) { spec_if_f (1); } else { Z++; } //@ assigns qed_ok: T[2], Z; if (c2) { spec_if_f (2); } else { Z++; } } //============================================================================== // when a IF condition is a negation, the AST doesn't have the same structure ! // void spec_if_cond (int c0) { int i; //@ ensures qed_ok: i > 0; if (c0) { i = 2; } else { i = 1; } } void spec_if_not_cond (int c0) { int i; //@ ensures qed_ok: i > 0; if (!c0) { i = 2; } else { i = 1; } } //============================================================================== // Test is unnamed (default) behavior for function and blocks are not mixed // together. //@ requires c == 0 ==> x >= 0; ensures qed_ok: \result > 0; int default_behaviors (int c, int x) { int y; //@ ensures qed_ok: stmt_p: x > 0; assigns qed_ok: x; if (c) x = 1; else { //@ assert qed_ok: x >= 0; x++; } y = 0; //@ assert qed_ok: x > y; return x; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/��������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016703� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/arith.i�������������������������������������������0000666�0000000�0000000�00000003227�13571573400�020170� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-prop="-qed_ko" OPT: -wp-prop qed_ko -wp-steps 50 */ /*@ ensures qed_ko: KO:\result < 0; @ ensures qed_ok: nat:\result >= 0; @*/ unsigned int cast_sgn_usgn (void) { int x = -1; return x; } unsigned char uchar_range (unsigned char i) { //@ assert qed_ok: A1:i >= 0; //@ assert qed_ok: A2:i <= 255; return i; } //@ lemma ucL1: qed_ok: (unsigned char) 255 == 255 ; //@ lemma ucL2: qed_ok: (unsigned char) 256 == 0 ; //@ lemma ucL3: qed_ok: (unsigned char) -1 == 255 ; //@ lemma ucL4: qed_ok: (unsigned char) 1023 == (unsigned char) 255 ; //@ lemma ucN1: qed_ok: (unsigned char) 256 == 256 ==> \false; //@ lemma ucN2: qed_ok: (unsigned char) 256 == -1 ==> \false ; //@ lemma scL1: qed_ok: (signed char) 127 == 127 ; //@ lemma scN1: qed_ok: (signed char) 255 == 255 ==> \false; //@ lemma scN2: qed_ok: (signed char) 256 == 255 ==> \false ; //@ lemma L01: lnot: qed_ok: ~(-1) == 0 ; //@ lemma L10: land: neutral: qed_ok: (55 & -1) == 55 ; //@ lemma L11: land: absorbant: qed_ok: (55 & 0) == 0 ; //@ lemma L12: land: qed_ok: (3 & 2) == 2; //@ lemma L13: land: qed_ok: (55 & 7 & 1) == 1; //@ lemma L20: lor: neutral: qed_ok: (55 | 0) == 55 ; //@ lemma L21: lor: absorbant: qed_ok: (55 | -1) == (-1) ; //@ lemma L30: lxor_neutral: qed_ok: (55 ^ 0) == 55 ; //@ axiomatic undefined_x { logic integer x ; } //@ lemma L14: land: absorbant: qed_ok: (1 & x & 2) == 0 ; //@ lemma L15: land: qed_ok: (3 & x & 2) == (2 & x) ; //@ lemma L16: land: qed_ok: (3 & x & -2) == (2 & x) ; /*@ lemma ASSOC: land: qed_ok: \forall integer x,y,z,t; x == (y & z) ==> (x & t) == (y & t & z) ; */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/assign_array.i������������������������������������0000666�0000000�0000000�00000000252�13571573400�021536� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� int A[16]; int G; /*@ assigns *p; */ void f(int *p); /*@ assigns A[0]; */ void jobA(void) { f(A); } /*@ assigns G; */ void jobG(void) { f(&G); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/assigns_path.i������������������������������������0000666�0000000�0000000�00000000645�13571573400�021545� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef struct S { int n ; int a[4]; } ; struct S p ; /*@ requires 0 <= n < 4 ; ensures N: p.n == n ; ensures A: \forall integer k; 0 <= k < n ==> p.a[k] == b[k]; assigns p ; */ void job( int n , int * b ) { p.n = n ; /*@ loop invariant 0 <= i <= n ; loop invariant \forall integer k; 0 <= k < i ==> p.a[k] == b[k]; loop assigns i, p.a[..]; */ for (int i = 0; i < n; i++) p.a[i] = b[i]; } �������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/assigns_range.i�����������������������������������0000666�0000000�0000000�00000002546�13571573400�021707� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 -wp-prop="-qed_ko" OPT: -wp -wp-par 1 -wp-prop qed_ko -wp-steps 50 */ int t1[20], t2[20], t3[20], t4[20], t5[20]; /*@ requires 0 <= i <20; assigns t1[i]; */ void assigns_t1_an_element(int i); /*@ requires 0 <= i && i <= j && j < 20 ; assigns t2[i..j]; */ void assigns_t2_bound (int i, int j); /*@ requires 0 <= i < 20 ; assigns t3[i..]; */ void assigns_t3_inf_bound (int i); /*@ requires 0 <= j <20 ; assigns t4[..j]; */ void assigns_t4_sup_bound (int j); /*@ assigns t5[..]; */ void assigns_t5_unbound (void); /*@ requires 0 <= i && i <= j && j < 20 ; assigns qed_ok: t1[(i-1)..(i+1)], t2[..], t3[i..], t4[..j], t5[..99] ; */ void call_assigns_all(int i, int j) { assigns_t1_an_element(i); assigns_t2_bound(i,j); assigns_t3_inf_bound(i); assigns_t4_sup_bound(j); assigns_t5_unbound(); } /*@ requires 5 <= i && i <= 7 ; assigns qed_ko: t1[i-1]; // <- false property (wrong index) */ void call_assigns_t1(int i) { assigns_t1_an_element(i); } /*@ requires 5 <= i && i <= 7 ; assigns qed_ko: t1[i-1]; // <- false property (wrong base) */ void call_assigns_t2(int i) { assigns_t2_bound(i,i+2); } /*@ requires 0 <= i && i <= j && j < 20 ; assigns qed_ko: t4[i..]; // <- false property (wrong lower bound) */ void call_assigns_t4(int i, int j) { assigns_t4_sup_bound(j); } ����������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/axioms.i������������������������������������������0000666�0000000�0000000�00000001574�13571573400�020364� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-model Typed -wp-par 1 */ // Test for the instantiation of axioms with labels. // The axiomatic A is equivalent (in spirit) to the definition of predicate Q. /*@ axiomatic A { @ predicate P{L}(int *t,int a,int b) reads *t ; @ axiom D{L}: @ \forall int * t ; \forall int a,b ; @ (\forall int k ; a<=k<=b ==> \valid(t+k) ==> t[k] > 0) ==> P(t,a,b) ; @ } @ */ /*@ predicate Q(int *t,int a,int b) = @ \forall int k ; a<=k<=b ==> \valid(t+k) ==> t[k] > 0 ; @ */ /*@ requires \valid(t+(a..b)) ; @ requires a<=b ; @ ensures P : todo: P(t,a,b) ; @ ensures Q : Q(t,a,b) ; @ assigns todo: t[a..b] ; @ */ void f(int *t , int a, int b) { /*@ loop invariant Index: a<=i<=b+1 ; @ loop invariant Positive: \forall int k ; a<=k<i ==> t[k] > 0 ; @ loop assigns i,t[a..i-1] ; @ */ for(int i=a; i<=b; i++) t[i] = 1 ; } ������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/base_offset.i�������������������������������������0000666�0000000�0000000�00000000713�13571573400�021336� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 */ struct S { char c; int a[4]; long u; char d; }; struct S s ; struct S* p ; /*@ ensures \forall integer k; 0 <= k < 4 ==> \offset( &s.a[k] ) == \offset( &s.a ) + k * sizeof(int) ; ensures \forall integer k; 0 <= k < 4 ==> \offset( &p->a[k] ) == \offset( &p->a ) ==> k == 0 ; ensures \forall integer i,j; 0 <= i <= j < 4 ==> \offset( &p->a[i] ) <= \offset( &p->a[j] ) ; */ void f(void){return;} �����������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/bitwise.i�����������������������������������������0000666�0000000�0000000�00000005773�13571573400�020537� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-model Typed -wp-par 1 -wp-prop="-zbit" */ /*@ ensures \result == (int) (a & b & c); @ ensures band0: 3!=(\result & 0xF0); @ behavior bit0: @ assumes bit0: 1==(a & 1) && 1==(b & 1) && 1==(c & 1); @ ensures band1: 1==(\result & 1); @ ensures band2: 0!=(\result & 1); @ behavior bit1: @ assumes bit1: 0==(b & 2); @ ensures band3: 0==(\result & 2); @ behavior bit2: @ assumes bit2: 0!=(c & 4); @ ensures band4: (\result & 4) == (a & b & 4); @ behavior bit3: @ assumes bit3: 2!=(a & 2) && 0==(b & c & 2) && 1 != (a & b & 1); @ ensures band5: (\result & 2) == (a & b & 1); @ behavior bit4: @ assumes bit4: a==-1 && b==~0 && c==-1; @ ensures band6: \result==-1; @ behavior bit5: @ ensures band7: zbit: (0x55==(0xFFF & a)) ==> (0x5555!=(0xFFFF & a)); */ int band(int a,int b,int c) { return a & b & c; } /*@ ensures \result == (int) (a | b | c); @ ensures bor0: 3!=(\result | 0xF0); @ behavior bit1: @ assumes bit1: 2==(a & 2); @ ensures bor1: 2==(\result & 2); @ behavior bit2: @ assumes bit2: 0==(a & 4) && 0==((b | c) & 4); @ ensures bor2: 0==(\result & 4); @ behavior bit3: @ assumes bit3: a==0 && b == 0 && c==0; @ ensures bor3: \result==0; */ int bor(int a,int b, int c) { return a | b | c ; } /*@ ensures \result == (int) (a ^ b); @ behavior bit1: @ assumes a == -1 && 0xFF==(0xF0^b); @ ensures \result == ~0x0F; @ behavior bit2: @ assumes a == b; @ ensures \result == 0; @ behavior bit3: @ assumes a == ~b; @ ensures zbit: \result == -1; */ int bxor(int a,int b) { return a ^ b ; } //@ ensures \result == (int) (~a) ; int bnot(int a) { return ~a ; } /*@ ensures \result == (int) (a << n) ; @ behavior shift1: @ assumes n == 3; @ ensures lsl1: ((a & 1) != 0) == (0 != (\result & 8)); @ ensures lsl2: 1 != (\result & 1); @ behavior shift2: @ assumes a == 2; @ ensures lsl3: 0 != ( (a<<(unsigned)(n) ) & ((1 << (1+(unsigned)(n)) ))); */ int lshift(int a,int n) { return a << n ; } /*@ ensures \result == (int) (a >> n) ; @ behavior shift1: @ assumes n == 3; @ ensures lsr1: ((a & 8) != 0) == (0 != (\result & 1)); */ int rshift(int a,int n) { return a >> n ; } /*@ behavior true: @ assumes a == 1 || b == 1; @ ensures \result == 1; @ behavior false: @ assumes !(a == 1 || b == 1); @ ensures \result == 0; */ _Bool bor_bool(_Bool a, _Bool b) { return (_Bool)(((int)a | (int)b) != 0); } /*@ behavior true: @ assumes a == 1 && b == 1; @ ensures \result == 1; @ behavior false: @ assumes !(a == 1 && b == 1); @ ensures \result == 0; */ _Bool band_bool(_Bool a, _Bool b) { return (_Bool)(((int)a & (int)b) != 0); } /*@ behavior true: @ assumes (a == 1 && b == 0) || (a == 0 && b == 1); @ ensures \result == 1; @ behavior false: @ assumes !((a == 1 && b == 0) || (a == 0 && b == 1)) ; @ ensures \result == 0; */ _Bool bxor_bool(_Bool a, _Bool b) { return (_Bool)(((int)a ^ (int)b) != 0); } �����frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/bitwise2.i����������������������������������������0000666�0000000�0000000�00000001147�13571573400�020610� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� //@ ensures \result == ((unsigned)(A & (0x7FFFFE00 >> 9))) ; unsigned job1(unsigned A) { return A & 0x7FFFFE00 >> 9 ; } //@ ensures \result == (A & 0x7FFFFE00 >> 9) ; unsigned job1bis(unsigned A) { return A & 0x7FFFFE00 >> 9 ; } //@ ensures \result == (((unsigned)(A & 0x7FFFFE00)) >> 9) ; unsigned job2(unsigned A) { return (A & 0x7FFFFE00) >> 9 ; } //@ ensures \result == ((unsigned)(A & (0x7FFFFE00 >> 9))) ; unsigned job3(unsigned A) { return A & (0x7FFFFE00 >> 9) ; } //@ ensures \result == (A & (unsigned long)(0x7FFFFE00ul >> 9)) ; unsigned job4(unsigned A) { return A & (0x7FFFFE00 >> 9) ; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/block_length.i������������������������������������0000666�0000000�0000000�00000001402�13571573400�021505� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 */ int t[20]; int mat[10][5]; struct S {int i; int tab[4];}; int x; struct S s; struct S ts[4]; /*@ ensures Pt: \block_length(&t) == 20*sizeof(int) ; ensures Psiz1 : sizeof(mat[1]) == 5*sizeof(int); ensures Pmat1 : \block_length(&mat[1]) == 50*sizeof(int); ensures Psiz2 : sizeof(mat) == 50*sizeof(int); ensures Pmat2 : \block_length(&mat) == 50*sizeof(int); ensures Ps : \block_length(&s) == \block_length(&x) + 4*sizeof(int); ensures Pts : \block_length(&ts) == 4* \block_length(&s); ensures Pt1: \block_length(&t[1]) == 20*sizeof(int) ; ensures Pmat12 : \block_length(&mat[1][2]) == 50*sizeof(int); ensures Pts1 : \block_length(&ts[1]) == 4* \block_length(&s); */ void f(void){return;} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/checks.i������������������������������������������0000666�0000000�0000000�00000000611�13571573400�020313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -eva -load-module scope,eva,report -then -report OPT: -wp-prop=@check OPT: -wp-prop=@assert */ /* run.config_qualif OPT: -load-module report -wp-steps 5 -then -report */ // note: eva and wp gives the same reporting //@ axiomatic A { predicate P reads \nothing ; } void main() { //@check c1: P; //@assert a1: P; //@check c2: P; //@assert a2: P; ; } �����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/classify_float.c����������������������������������0000666�0000000�0000000�00000000730�13571573400�022051� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-prover alt-ergo OPT: -wp-prover native:alt-ergo OPT: -wp-prover native:coq -wp-coq-script tests/wp_acsl/classify_float.script OPT: -wp-model real */ /*@ lemma NaN_not_finite: \forall double x; !( \is_NaN(x) && \is_finite(x) ); lemma InfP_not_finite: \forall double x; !( \is_plus_infinity(x) && \is_finite(x) ); lemma InfN_not_finite: \forall double x; !( \is_minus_infinity(x) && \is_finite(x) ); */ #include <math.h> ����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/classify_float.script�����������������������������0000666�0000000�0000000�00000000565�13571573400�023141� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* Generated by Frama-C WP *) Goal typed_lemma_InfN_not_finite. Hint InfN_not_finite,property. Proof. (* auto with zarith. *) admit. Admitted. Goal typed_lemma_InfP_not_finite. Hint InfP_not_finite,property. Proof. (* auto with zarith. *) admit. Admitted. Goal typed_lemma_NaN_not_finite. Hint NaN_not_finite,property. Proof. (* auto with zarith. *) admit. Admitted. �������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/cnf.i���������������������������������������������0000666�0000000�0000000�00000005161�13571573400�017626� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: */ /* run.config_qualif OPT: -wp -wp-split-depth -2 -wp-par 1 -wp-msg-key cnf -wp-debug 1 // -wp-split-depth -2 -> replace the Goal by Goal<==>CNF(Goal) */ //@ axiomatic Ax { predicate A; predicate A1; predicate A2; } //@ axiomatic Bx { predicate B; predicate B1; predicate B2; } //@ axiomatic Cx { predicate C; predicate C1; predicate C2; } //@ axiomatic Px { predicate P(integer x); } /*@ @ ensures a0: A && A1 && A2 ; @ ensures a1: A || A1 || A2 ; @ ensures a2: A && A1 ==> A2 ; @ ensures a3: A1 <==> A2 ; @ ensures a4: A ? A1 : A2 ; @ ensures a5: ( A && A1 && A2 ) || ( C && (B && B1 && B2) ); @ ensures a6: ( A || A1 || A2 ) || ( C && (B || B1 || B2) ); @ ensures a7: ( A && A1 ==> A2 ) || ( C && (B && B1 ==> B2) ) ; @ ensures a8: ( A1 <==> A2 ) || ( C && (B1 <==> B2) ) ; @ ensures a9: ( A ? A1 : A2 ) || ( C && (B ? B1 : B2) ) ; @ ensures b0: C && (B && B1 && B2) ; @ ensures b1: C && (B || B1 || B2) ; @ ensures b2: C && (B && B1 ==> B2) ; @ ensures b3: C && (B1 <==> B2) ; @ ensures b4: C && (B ? B1 : B2) ; @ ensures b5: ( C && (B && B1 && B2) ) ==> ( C1 || (B && B1 && B2) ); @ ensures b6: ( C && (B || B1 || B2) ) ==> ( C1 || (B || B1 || B2) ) ; @ ensures b7: ( C && (B && B1 ==> B2) ) ==> ( C1 || (B && B1 ==> B2) ) ; @ ensures b8: ( C && (B1 <==> B2) ) ==> ( C1 || (B1 <==> B2 )) ; @ ensures b9: ( C && (B ? B1 : B2) ) ==> ( C1 || (B ? B1 : B2) ) ; @ ensures c0: C || (B && B1 && B2) ; @ ensures c1: C || (B || B1 || B2) ; @ ensures c2: C || (B && B1 ==> B2) ; @ ensures c3: C || (B1 <==> B2) ; @ ensures c4: C || (B ? B1 : B2) ; @ ensures c5: ( C || (B && B1 && B2) ) <==> ( C1 <==> (B && B1 && B2) ) ; @ ensures c6: ( C || (B || B1 || B2) ) <==> ( C1 <==> (B || B1 || B2) ) ; @ ensures c7: ( C || (B && B1 ==> B2) ) <==> ( C1 <==> (B && B1 ==> B2) ) ; @ ensures c8: ( C || (B1 <==> B2 ) <==> ( C1 <==> (B1 <==> B2) )) ; @ ensures c9: ( C || (B ? B1 : B2) ) <==> ( C1 <==> (B1 <==> B2) ) ; @ ensures d0: C <==> (B && B1 && B2) ; @ ensures d1: C <==> (B || B1 || B2) ; @ ensures d2: C <==> (B && B1 ==> B2) ; @ ensures d3: C <==> (B1 <==> B2) ; @ ensures d4: C <==> (B ? B1 : B2) ; @ ensures d5: (C || B1 || B2) <==> (B && B1 && B2) ; @ ensures d6: (C || B1 || B2) <==> (B || B1 || B2) ; @ ensures d7: (C || B1 || B2) <==> (B && B1 ==> B2) ; @ ensures d8: (C || B1 || B2) <==> (B1 <==> B2) ; @ ensures d9: (C || B1 || B2) <==> (B ? B1 : B2) ; @ ensures e0: A && (((A || B) ==> C) || (B ==> C)) ; @ ensures e1: B && (((A || B) ==> C) || (B ==> C)) ; @ ensures e2: C && (((A || B) ==> C) || (B ==> C)); @*/ void f(void) { ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/ctor.i��������������������������������������������0000666�0000000�0000000�00000000417�13571573400�020026� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������//@ ghost int WORLD; /*@ axiomatic Event { type evt = WrOf(integer) | RdOf(integer) ; logic \list<evt> obs{L} reads WORLD ; lemma cons: \forall integer i,j; (WrOf(i) == WrOf(j)) <==> (i == j); lemma diff: \forall integer i,j; (RdOf(i) != WrOf(j)); } */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/div_mod.i�����������������������������������������0000666�0000000�0000000�00000003312�13571573400�020475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-gen -wp-print */ /* run.config_qualif OPT: -wp-prop="-ko" OPT: -wp-prover why3:alt-ergo -wp-prop="-ko" OPT: -wp-prover "alt-ergo" -wp-prop="ko" -wp-steps 50 */ //@ axiomatic Eq { predicate Peq(integer x,integer y) = x == y ; } /*@ @ ensures d0: div_pos_pos: Peq( 5 / 3 , 1 ); @ ensures d1: div_neg_pos: Peq( (-5) / 3 , -1 ); @ ensures d2: div_pos_neg: Peq( 5 / (-3), -1 ); @ ensures d3: div_neg_neg: Peq( (-5) / (-3), 1 ); @ ensures d4: div_x_1: Peq( x / 1, x ); @ ensures d5: div_x_minus1: Peq( x / (-1), -x ); @ ensures d6: div_0_x: x!=0 ==> Peq( 0 / x, 0 ); @ ensures d7: div_0_x: ko: Peq( 0 / x, 0 ); @ ensures sd0: div_pos_pos: x>=0 && y>0 ==> (x / y) >= 0; @ ensures sd1: div_neg_pos: x<=0 && y>0 ==> (x / y) <= 0; @ ensures sd2: div_pos_neg: x>=0 && y<0 ==> (x / y) <= 0; @ ensures sd3: div_neg_neg: x<=0 && y<0 ==> (x / y) >= 0; @ ensures m0: mod_pos_pos: Peq( 5 % 3 , 2 ); @ ensures m1: mod_neg_pos: Peq( (-5) % 3 , -2 ); @ ensures m2: mod_pos_neg: Peq( 5 % (-3), 2 ); @ ensures m3: mod_neg_neg: Peq( (-5) % (-3), -2 ); @ ensures m4: mod_x_1: Peq( x % 1, 0 ); @ ensures m5: mod_x_minus1: Peq( x % (-1), 0 ); @ ensures m6: mod_0_x: x!=0 ==> Peq( 0 % x, 0 ); @ ensures m7: mod_0_x: ko: Peq( 0 % x, 0 ); @ ensures sm0: mod_pos_pos: x>=0 && y>0 ==> (x % y) >= 0; @ ensures sm1: mod_neg_pos: x<=0 && y>0 ==> (x % y) <= 0; @ ensures sm2: mod_pos_neg: x>=0 && y<0 ==> (x % y) >= 0; @ ensures sm3: mod_neg_neg: x<=0 && y<0 ==> (x % y) <= 0; @*/ void f(int x, int y) { ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/e_imply.i�����������������������������������������0000666�0000000�0000000�00000005423�13571573400�020517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-gen -wp-print */ //@ axiomatic P { predicate P(integer x); } //@ axiomatic T { predicate T = \true ; } //@ axiomatic F { predicate F = \false; } /*@ ensures p0: T; @ ensures p1: P(1) ==> T; @ ensures p2: F ==> P(2); @ ensures p3: F ==> P(2) ==> P(3); @ ensures p4: P(1) && P(2) ==> (P(3) ==> P(2)) && (P(3) ==> P(1)); @ ensures p5: P(2) ==> (T && P(2)); @ ensures p6: P(1) ==> P(2) ==> (P(1) && P(2)); @ ensures p7: (F && P(12)) ==> (P(21) && P(22)); @ ensures p8: P(1) ==> (P(1) ? T : P(3)); @ ensures p9: P(1) && P(2) ==> (P(2) ? P(1) : P(3)); @ ensures i0: (P(1) && P(2) && P(3)) ==> P(2); @ ensures i1: P(1) ==> P(2) ==> (P(1) && P(2) && T); @ ensures i2: F ==> P(1) && P(2) ==> (!P(1) || !P(2)); @ ensures i3: P(1) && P(2) ==> (!P(1) || !P(2) || T); @ ensures i4: P(0) && P(1) && P(2) && P(3) && P(4) ==> (P(1) && P(3) && (P(2) || P(4))); @ ensures i5: P(0) && P(1) && P(2) ==> P(3) && P(4) ==> (P(1) && P(3) && (P(2) || P(4))); @ ensures i6: P(0) && P(1) && P(2) && P(3) && P(4) ==> (P(1) && P(3) && (P(2) && P(4) ==> T)); @ ensures i7: P(0) && P(1) && P(2) ==> P(3) && P(4) ==> (P(1) && P(3) && (P(2) && P(4) ==> T)); @ ensures i8: P(0) && P(1) && P(2) && P(3) && !P(5) ==> (P(1) && P(3) && (P(2) && F ==> P(5))); @ ensures i9: P(0) && P(1) && P(2) ==> P(3) && !P(5) ==> (P(1) && P(3) && (P(2) && F ==> P(5))); @ ensures a0: F && P(2) ==> !P(2) ; @ ensures a1: F ==> (P(1) && F && P(3)) ; @ ensures a2: F && !P(3) ==> P(0) && P(2) && P(4) ==> (F && P(2) && P(3)) ; @ ensures a3: F && !P(3) ==> P(0) && P(2) && P(4) ==> (F && P(2) && P(3)) ; @ ensures a4: !T ==> P(1) && P(0) && P(2) && P(4) ==> (P(1) && P(2) && T) ; @ ensures a5: !T ==> P(2) ==> (T && P(2) && P(3)) ; @ ensures a6: !T ==> P(2) && P(4) ==> (T && P(2) && P(3)) ; @ ensures a7: !T ==> P(2) ==> (T && P(2) && P(3)) ; @ ensures a8: F && !P(2) && P(4) ==> (F && P(2) && P(3)) ; @ ensures a9: F && P(2) && !P(3) && P(4) ==> (F && P(2) && P(3)) ; @ ensures o0: F && P(2) ==> (!P(2) || (F && P(3))); @ ensures o1: F ==> P(2) ==> (!F || !P(2) || !P(3)) ; @ ensures o2: F && P(3) ==> P(0) && P(2) && !P(4) ==> (!F || !P(2) || !P(3)) ; @ ensures o3: P(1) && !P(3) ==> P(0) && P(2) && P(4) ==> (!P(1) || !P(2) || !P(3)) ; @ ensures o4: !T ==> P(1) && P(0) && P(2) && P(4) ==> (P(1) || P(2) || !T) ; @ ensures o5: !T ==> P(2) ==> (T || !P(2) || P(3)) ; @ ensures o6: !T ==> P(2) && P(4) ==> (T || !P(2) || P(3)) ; @ ensures o7: !T ==> P(2) ==> (T || !P(2) || P(3)) ; @ ensures o8: F && !P(2) && P(4) ==> (!F || P(2) || !P(3)) ; @ ensures o9: F && P(2) && !P(3) && P(4) ==> (!F || !P(2) || P(3)) ; @ ensures f0: P(1) ==> (P(2) && (P(1) || P(12)) ==> T) ; @ ensures f1: P(1) && (P(2) || P(11)) ==> (P(2) && (P(1) || P(12)) ==> T) ; */ void f(void) { ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/equal.i�������������������������������������������0000666�0000000�0000000�00000002353�13571573400�020167� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-wp-no-extensional" */ /* run.config_qualif COMMENT: STDOPT: +"-wp-no-extensional" */ /* -------------------------------------------------------------------------- */ /* --- GOAL: equality over records, arrays, pointers --- */ /* -------------------------------------------------------------------------- */ struct S { int a; int b;}; struct S s0,s1; //@ ensures s0 == {{s1 \with .a = s0.a} \with .b = s0.b}; void simple_struct(void){return;} int t0[2]; int t1[2]; //@ ensures t0 == {{t1 \with [0] = t0[0]} \with [1] = t0[1]}; void simple_array(void){return;} struct St {int tab[10];}; struct St st0,st1; //@ ensures st0.tab == st1.tab ==> st0 == st1 ; void with_array_struct(void){return;} struct Sp {int * p ;}; struct Sp sp0,sp1; //@ ensures sp0.p == sp1.p ==> sp0 == sp1; void with_ptr_struct(void){return;} int * tp0[5]; int * tp1[5]; //@ ensures (\forall integer i; 0 <= i < 5 ==> tp0[i] == tp1[i]) ==> tp0 == tp1; void with_ptr_array(void){return;} struct Q {int * qp ; int qt[2] ; struct S qs;}; struct Q q0,q1; /*@ ensures q0.qp == q1.qp ==> q0.qs == q1.qs ==> q0.qt == q1.qt ==> q0 == q1 ; */ void with_ptr_and_array_struct(void){return;} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/float_compare.i�����������������������������������0000666�0000000�0000000�00000003506�13571573400�021674� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-prover why3:alt-ergo OPT: -wp-model real */ /*@ lemma test_float_compare: \forall float x,y; \is_finite(x) && \is_finite(y) ==> \le_float(x,y) ==> \lt_float(x,y) || \eq_float(x,y); */ /*@ lemma test_double_compare: \forall double x,y; \is_finite(x) && \is_finite(y) ==> \le_double(x,y) ==> \lt_double(x,y) || \eq_double(x,y); */ /*@ lemma test_float_compare_greater: \forall float x,y; \is_finite(x) && \is_finite(y) ==> \ge_float(x,y) ==> \gt_float(x,y) || \eq_float(x,y); */ /*@ lemma test_double_compare_greater: \forall double x,y; \is_finite(x) && \is_finite(y) ==> \ge_double(x,y) ==> \gt_double(x,y) || \eq_double(x,y); */ /*@ lemma finite_32_64: \forall float x; \is_finite(x) ==> \is_finite((double)x); */ /*@ lemma finite_32_64_real: \forall float x; \is_finite(x) ==> ((real) x) == ((real)(double) x) ; */ /*@ requires \is_finite(a) && \is_finite(b); ensures DEF: \result == ((a < b) ? 1 : 0) ; ensures REL1: \result <==> a < b ; ensures REL2: \result <==> a < b ; */ int cmp_ff(float a,float b) { return a < b; } /*@ requires \is_finite(a) && \is_finite(b); ensures DEF: \result == ((a < b) ? 1 : 0) ; ensures REL1: \result <==> a < b ; ensures REL2: \result <==> a < b ; */ int cmp_dd(double a,double b) { return a < b; } /*@ requires \is_finite(a) && \is_finite(b); ensures DEF: \result == ((a < b) ? 1 : 0) ; ensures REL1: \result <==> a < b ; ensures REL2: \result <==> a < b ; */ int cmp_fd(float a,double b) { //@ assert \is_finite((double)a); //@ assert ((real) a) == ((real)(double)a) ; return a < b; } /*@ ensures POS: \lt_float(a,b) <==> \result == 1 ; ensures NEG: !\lt_float(a,b) <==> \result == 0 ; */ int cmp_fnan(float a,float b) { return a < b; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/funvar_inv.i��������������������������������������0000666�0000000�0000000�00000003142�13571573400�021232� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*run.config OPT: -wp-model Hoare OPT: -wp-model Typed+ref */ /*run.config_qualif OPT: -wp -wp-model Typed+ref -wp-par 1 -wp-prop qed_ok */ /* -------------------------------------------------------------------------- */ /* --- GOAL: Such as funvar is used for the two model, Typed and Hoare --- */ /* --- the oracles of this test have to been unchanged by any change in --- */ /* --- funvar --- */ /* --- TODO verify the semantics of startof: is it normal --- */ /* --- &G+i <> &(G[i]) ? --- */ /* -------------------------------------------------------------------------- */ int G [4]; /*@ ensures P_startof: G[0] == 0 ==> \result == &(G[0]) ; ensures P_addr: G[0] != 0 && G[1] == 0 ==> \result == &(G[1]) ; */ int * f (void) { int i =0; //@ loop assigns qed_ok: index:i ; while (i < 4 && G[i] !=0) i++; if (i>=4) return &(i) ; else return &(G[i]); } /*@ ensures P_startof_shift: G[0] == 0 ==> \result == &(G[0]) ; ensures P_addr_shift: G[0] != 0 && G[1] == 0 ==> \result == &(G[1]) ; */ int * f2 (void) { int i =0; //@ loop assigns qed_ok: index:i ; while (((G+i) < (G+4)) && G[i] !=0) i++; if (i>=4) return &(i) ; else return &(G[i]); } /*@ ensures P_addr_startof_shift: G[0] == 0 ==> \result == &(G[0]) ; ensures P_addr_addr_shift: G[0] != 0 && G[1] == 0 ==> \result == &(G[1]) ; */ int * g (void) { int i =0; //@ loop assigns qed_ok: i ; while (((&G+i) < (&G+4)) && G[i] !=0) i++; if (i>=4) return &(i) ; else return &(G[i]); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/implicit_enum_cast.i������������������������������0000666�0000000�0000000�00000000430�13571573400�022722� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef enum CODE { OK=1, KO=2 } err; //@ensures (\result==OK) <==> (x>0); assigns \nothing; err foo(int x); //@ensures (\result==OK) <==> (x>0 && y>0); assigns \nothing; err bar(int x,int y) { err s = OK; if (foo(x) != OK) s = KO; if (foo(y) != OK) s = KO; return s; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/inductive.i���������������������������������������0000666�0000000�0000000�00000004313�13571573400�021050� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT:-wp-prover=why3 -wp-gen -wp-msg-key print-generated */ /* run.config_qualif DONTRUN: */ /*@ inductive is_gcd(integer a, integer b, integer d) { case gcd_zero: \forall integer n; is_gcd(n, 0, n); case gcd_succ: \forall integer a, b, d; is_gcd(b, a % b, d) ==> is_gcd(a, b, d); } */ /*@ lemma test_no_label: \forall integer a, b, d ; is_gcd(a, b, d) ==> is_gcd(b, d, a) ==> \false ; */ typedef struct _list { int element; struct _list* next; } list; /*@ inductive reachable{L} (list* root, list* node) { case root_reachable{L}: \forall list* root; reachable(root,root); case next_reachable{L}: \forall list* root, *node; \valid(root) ==> reachable(root->next, node) ==> reachable(root,node); } */ /*@ lemma test_one_label{L1, L2}: \forall list *l1, *l2 ; reachable{L1}(l1, l2) ==> reachable{L2}(l1, l2) ==> \false ; */ /*@ predicate swap{L1, L2}(int *a, int *b, integer begin, integer i, integer j, integer end) = begin <= i < j < end && \at(a[i], L1) == \at(b[j], L2) && \at(a[j], L1) == \at(b[i], L2) && \forall integer k; begin <= k < end && k != i && k != j ==> \at(a[k], L1) == \at(b[k], L2); predicate same_array{L1,L2}(int *a, int *b, integer begin, integer end) = \forall integer k; begin <= k < end ==> \at(a[k],L1) == \at(b[k],L2); inductive same_elements{L1, L2}(int *a, int *b, integer begin, integer end) { case refl{L1, L2}: \forall int *a, int *b, integer begin, end; same_array{L1,L2}(a, b, begin, end) ==> same_elements{L1, L2}(a, b, begin, end); case swap{L1, L2}: \forall int *a, int *b, integer begin, i, j, end; swap{L1, L2}(a, b, begin, i, j, end) ==> same_elements{L1, L2}(a, b, begin, end); case trans{L1, L2, L3}: \forall int* a, int *b, int *c, integer begin, end; same_elements{L1, L2}(a, b, begin, end) ==> same_elements{L2, L3}(b, c, begin, end) ==> same_elements{L1, L3}(a, c, begin, end); } */ /*@ lemma test_multilabel{L1, L2, L3}: \forall int *a, *b, integer b1, b2, e1, e2 ; same_elements{L1, L2}(a, b, b1, e1) ==> same_elements{L2, L3}(b, a, b2, e2) ==> \false ; */���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/init_label.i��������������������������������������0000666�0000000�0000000�00000000724�13571573400�021162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-wp-no-extensional" */ /* run.config_qualif COMMENT: STDOPT: +"-wp-no-extensional" */ int A[20] = {10,11,12} ; /*@ requires OK: A[1]==11 && A[19]==0 ; */ int main(void) ; /*@ requires Init: A == \at( A , Init ); ensures OK: \result == 12 ; */ int job(void) { return A[2]; } /*@ ensures OK: \at( A[8] , Init ) == 0 ; */ void foreign(void) { return ; } /*@ ensures KO: \result == 12 ; */ int extra(void) { return A[2]; } ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/init_value.i��������������������������������������0000666�0000000�0000000�00000006342�13571573400�021221� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-let OPT: -main main_ko -wp-no-let -wp-no-init-const */ /* run.config_qualif OPT: -wp -wp-par 1 -wp-prop="-qed_ko" OPT: -main main_ko -wp-par 1 -wp-prop qed_ko -wp-steps 50 -wp-no-init-const */ /* -------------------------------------------------------------------------- */ /* --- GOAL: partial and complete initialization of value --- */ /* -------------------------------------------------------------------------- */ struct S { int a; int b;}; struct S s = {2}; int t[2] = {1}; int t1[9+1] = {[5 ... 6]=2, [0 ... 3 ]=1 }; struct St {int tab[9+1];}; struct St st = {{1,2,3,4}}; struct Sc {int a; int b[2+1]; int c;}; struct Sc sc0 = {1,{2,3,4},5}; struct Sc sc1 = {1,2,3,4,5}; struct Sc sc2 = {1,{2,3},4}; struct Sc sc3 = {1,2,3,4}; struct Sc sq0 = {2,{2,2},2}; struct Sc sq1 = {.b={2,2}}; unsigned char tab[32]; union U { short t[4]; short a; long long b; } u = {.a=-1 }; /*@ requires qed_ok: Struct_Simple_a: s.a == 2 ; requires qed_ok: Struct_Simple_b: s.b == 0 ; requires qed_ok: Simple_Array_0 : t[0] == 1 ; requires qed_ok: Simple_Array_1 : t[1] == 0 ; requires qed_ok: With_Array_Struct_5 : st.tab[5] == 0 ; requires qed_ok: With_Array_Struct_3 : st.tab[3] == 4 ; requires qed_ok: Sc_eq : sc1 == sc0; requires qed_ok: Sc_t : sc2.b[2] == 0 ; requires qed_ok: Sc_t : sc3.b[2] == 4 ; requires qed_ok: Sc_c_2 : sc2.c == 4; requires qed_ok: Sc_c_3 : sc3.c == 0; requires qed_ok: Tab_no_init : tab[5] == 0 ; requires qed_ok: Tab_todo : \forall int i; 0 <= i <= 31 ==> tab[i] <= 255; requires qed_ok: sq0.b[1]==2; requires qed_ok: sq0.b[2]==0; requires qed_ok: \forall integer i; 0 <= i <= 3 ==> t1[i] == 1; requires qed_ok: todo: t1[4] == 0; requires qed_ok: \forall integer i; 5 < i <= 6 ==> t1[i] == 2; requires qed_ok: \forall integer i; 6 < i <= 9 ==> t1[i] == 0; requires qed_ok: direct_init_union: u.a == -1; */ void main (int a){return;}; /*@ requires qed_ko: Sc_eq_ko : sc2 == sc3; requires qed_ko: Sc_t : sc3.b[2] == 3 ; requires qed_ko: Sc_c_2 : sc2.c == 2; requires qed_ko: Tab_no_init : tab[5] == 1 ; requires qed_ko: With_Array_Struct_3 : st.tab[3] == 3 ; requires qed_ko: Simple_Array_1 : t[1] == 1 ; requires qed_ko: T1_6: t1[6] == 0; requires qed_ko: indirect_init_union_b: u.b == 0; requires qed_ko: indirect_init_union_t: u.t[0] == 0; */ void main_ko (void){return;} const int ta1[5] = { [2]=1,[4]=1 }; /*@ ensures qed_ok: ta1[0]==ta1[1] && ta1[1]==ta1[3]; @ ensures qed_ko: ta1[4]==0; @ ensures qed_ko: ta1[3]==1; */ void fa1(void) {return ;} const int ta2[5] = { [2 ... 3]=1 }; /*@ ensures qed_ok: ta2[0]==ta2[1] && ta2[1]==ta2[4]; @ ensures qed_ko: ta2[4]==1; @ ensures qed_ko: ta2[1]==1; */ void fa2(void) {return ;} const int ta3[5] = { [1]=1, [3]=1}; /*@ ensures qed_ok: ta3[0]==ta3[2] && ta1[2]==ta1[4]; @ ensures qed_ko: ta3[0]==1; @ ensures qed_ko: ta3[2]==1; @ ensures qed_ko: ta2[4]==1; */ void fa3(void) {return ;} const struct { int a, b, c; } ts1[4] = { [2].a=1, [2].b=1 }; /*@ ensures qed_ok: ts1[0]==ts1[1] && ts1[1]==ts1[3] && ts1[2].a ==ts1[2].b; @ ensures qed_ko: ts1[2].c==1; @ ensures qed_ko: ts1[0].a==1;*/ void fs1(void) {return ;} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/init_value_mem.i����������������������������������0000666�0000000�0000000�00000001102�13571573400�022044� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Typed OPT: -wp-model Hoare */ /* run.config_qualif OPT: -wp -wp-par 1 -wp-model Typed */ /* run.config_qed DONTRUN: (config_qed) */ /* -------------------------------------------------------------------------- */ /* --- GOAL: complete initialization of value into or out memory --- */ /* -------------------------------------------------------------------------- */ struct St {int a; int b;}; struct St v={1,2}, w={1,2} ; struct St * p = &v ; /*@ ensures P: v == w; @ ensures Q: *p == w; */ void main(void) { return; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/intbool.i�����������������������������������������0000666�0000000�0000000�00000000136�13571573400�020523� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ ensures \result == i - (int) (j == 1) ; */ int bug(int i, int j) { return i - (j == 1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/label_escape.i������������������������������������0000666�0000000�0000000�00000000612�13571573400�021453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 -wp-prop="-qed_ko" OPT: -wp -wp-par 1 -wp-prop qed_ko -wp-steps 50 */ int f(int x) { int y=1; if (x) goto M; L: y=2; M: //@ assert qed_ko: oracle_ko: \at(y,L) == 0 ; return y; } int g(int x) { int y=0; if (!x) goto M; y=1 ; L: y=2 ; M: if (x) { //@ assert qed_ok: ok: \at(y,L) == 1 ; return 1; } return 0; } ����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/logic.i�������������������������������������������0000666�0000000�0000000�00000006263�13571573400�020161� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Typed */ /* run.config_qualif OPT: -wp -wp-model Typed -wp-steps 50 */ // Test logic types defined from C types //-------------------------------------- typedef struct { int x ; int y ; } Point ; typedef Point Triangle[3] ; /*@ axiomatic A { type triangle = Point[3]; predicate P(triangle t) = t[1].x==20 ; } */ //@ assigns \nothing; ensures P((triangle)q); void f(Point *q); Point t[3]; //@ assigns \nothing; ensures P(t); void h(void) { f(t) ; } // Test logic constants //--------------------- int x = 1 ; //@ logic integer k = 1 ; //------------------------------------------ Triangle tr={10,11,20,21,30,31}; Triangle * q = &tr; Point * p = &tr[0]; typedef struct { int tab[6] ; } Tint6; Tint6 tr6 ={10,11,20,21,30,31} ; Point pt1 = {10,11}; typedef struct { int tab[2] ; } Tint2; Tint2 pt2 = {10,11}; typedef struct { unsigned char bytes[sizeof(unsigned)] ; } Buint; Buint buint = { 1, 2, 4, 8 }; unsigned ui = 134480385; /*@ requires qed_ok: x == k; @ requires qed_ok: P(tr); @ requires qed_ok: P(*q); @ requires qed_ok: P(*(Triangle *)p); @ requires qed_ok: pt1.y == ((Point) pt2).y; @ requires qed_ok: pt2.tab[1] == ((Tint2) pt1).tab[1]; @ requires qed_ok: pt1.y == ((Point) pt2.tab).y; @ requires qed_ok: pt2.tab[1] == ((int[2]) pt1)[1]; @ requires qed_ok: pt2.tab[1] == ((int[2]) pt2)[1]; @ requires qed_ok: ui == (unsigned) buint; @ requires qed_ok: buint == (Buint) ui; @ requires qed_ok: tr[1].y == ((Triangle) tr6)[1].y; @ requires qed_ok: tr[1].y == ((Triangle) tr6.tab)[1].y; @ requires qed_ok: tr6.tab[4] == ((int[6])tr6)[4]; @ requires qed_ok: pt2.tab[1] == ((int[2])tr6)[1]; @ requires qed_ok: pt2.tab[1] == ((int[2])tr6.tab)[1]; @ requires qed_ok: pt2.tab[1] == ((Tint2)tr6).tab[1]; @ requires qed_ok: pt2.tab[1] == ((Tint2)tr6.tab).tab[1]; */ int main() { return *(unsigned *)&buint; } //-------------------------------------- /*@ axiomatic B { @ type Aint2 = int[2]; @ type Aint6 = int[6]; @ type Aint2x3 = Aint2[3]; @ logic Point pt reads \nothing; @ logic Aint2 a2 reads \nothing; @ logic Aint6 a6 reads \nothing; @ logic Tint2 s2 reads \nothing; @ logic Point[3] p3 reads \nothing; @ logic Point[2] p2 reads \nothing; @ logic Aint2x3 a2x3 reads \nothing; @ } */ // todo: lemma trunc1: (Point)p3 == p3[0]; // todo: lemma trunc2: (Point[2])p3 == p2 <==> p2[0]==p3[0] && p2[1]==p3[1]; // todo: lemma trunc3: (Aint2)a2x3 == a2x3[0]; // todo: lemma trunc4: (Aint2)a6 == ((Aint2x3)a6)[0]; // todo: lemma extend1: ((Point[3])pt)[0] == pt; // todo: lemma extend2: (Point[3])p2 == p3 ==> p2[0]==p3[0] && p2[1]==p3[1]; // todo: lemma fits_eq1: (Point)a2 == pt <==> pt.x==a2[0] && pt.y==a2[1]; // todo: lemma fits_eq2: (Aint2)pt == a2 <==> pt.x==a2[0] && pt.y==a2[1]; // todo: lemma fits_eq3: (Aint2)s2 == s2.tab ; // todo: lemma fits_eq4: (Point)s2 == pt <==> pt.x==s2.tab[0] && pt.y==s2.tab[1]; // todo: lemma fits_eq5: (Aint2)(p3[2]) == ((Aint2x3)p3)[2]; // todo: lemma fits_eq6: ((Aint6)p3)[5] == ((Aint2x3)p3)[2][1]; // todo: lemma fits_trunc1: (int)pt == pt.x; // todo: lemma fits_trunc2: (Aint2)p3 == a2 <==> p3[0].x==a2[0] && p3[0].y==a2[1]; //-------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/looplabels.i��������������������������������������0000666�0000000�0000000�00000001110�13571573400�021202� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 */ /*@ predicate IsEqual(int * a , int * b , int n) = @ \forall integer i; 0 <= i < n ==> a[i] == b[i] ; @ */ /*@ requires n>0 ; @ requires \valid( a+ (0..n-1) ); @ requires \valid( b+ (0..n-1) ); @ requires \separated( a+ (0..n-1) , b + (0..n-1) ); @ ensures IsEqual(a,b,n); @ assigns b[0..n-1] ; @ */ void copy( int * a , int * b , int n ) { /*@ loop invariant 0 <= i <= n ; @ loop invariant IsEqual(a,b,i) ; @ loop assigns i , b[0..n-1] ; @ */ for (int i = 0 ; i < n ; i++) { b[i] = a[i] ; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/null.c��������������������������������������������0000666�0000000�0000000�00000000367�13571573400�020027� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� #define NULL ((void*)0) //@ ensures \result == 0; int null_is_zero (void) { void * p = NULL; return (int) p; } /*@ lemma valid_non_null: !\valid ((char *)\null); */ /*@ lemma valid_read_non_null: !\valid_read((char *)\null); */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/�������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020150� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/arith.res.oracle���������������������������0000666�0000000�0000000�00000011140�13571573400�023233� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/arith.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma ASSOC: Assume: 'L16' 'L15' 'L14' 'L30' 'L21' 'L20' 'L13' 'L12' 'L11' 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: ((land y_0 z_0)=x_0) -> ((land t_0 y_0 z_0)=(land t_0 x_0)) ------------------------------------------------------------ Lemma L01: Assume: 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L10: Assume: 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L11: Assume: 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L12: Assume: 'L11' 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L13: Assume: 'L12' 'L11' 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L14: Assume: 'L30' 'L21' 'L20' 'L13' 'L12' 'L11' 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L15: Assume: 'L14' 'L30' 'L21' 'L20' 'L13' 'L12' 'L11' 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L16: Assume: 'L15' 'L14' 'L30' 'L21' 'L20' 'L13' 'L12' 'L11' 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L20: Assume: 'L13' 'L12' 'L11' 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L21: Assume: 'L20' 'L13' 'L12' 'L11' 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma L30: Assume: 'L21' 'L20' 'L13' 'L12' 'L11' 'L10' 'L01' 'scN2' 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma scL1: Assume: 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma scN1: Assume: 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma scN2: Assume: 'scN1' 'scL1' 'ucN2' 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma ucL1: Prove: true ------------------------------------------------------------ Lemma ucL2: Assume: 'ucL1' Prove: true ------------------------------------------------------------ Lemma ucL3: Assume: 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma ucL4: Assume: 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma ucN1: Assume: 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ Lemma ucN2: Assume: 'ucN1' 'ucL4' 'ucL3' 'ucL2' 'ucL1' Prove: true ------------------------------------------------------------ ------------------------------------------------------------ Function cast_sgn_usgn ------------------------------------------------------------ Goal Post-condition 'qed_ko,KO' in 'cast_sgn_usgn': Prove: false. ------------------------------------------------------------ Goal Post-condition 'qed_ok,nat' in 'cast_sgn_usgn': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function uchar_range ------------------------------------------------------------ Goal Assertion 'qed_ok,A1' (file tests/wp_acsl/arith.i, line 16): Assume { Type: is_uint8(i). } Prove: 0 <= i. ------------------------------------------------------------ Goal Assertion 'qed_ok,A2' (file tests/wp_acsl/arith.i, line 17): Assume { Type: is_uint8(i). (* Assertion 'qed_ok,A1' *) Have: 0 <= i. } Prove: i <= 255. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/assign_array.res.oracle��������������������0000666�0000000�0000000�00000002016�13571573400�024610� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/assign_array.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function jobA ------------------------------------------------------------ Goal Assigns (file tests/wp_acsl/assign_array.i, line 11) in 'jobA': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_acsl/assign_array.i, line 11) in 'jobA': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function jobG ------------------------------------------------------------ Goal Assigns (file tests/wp_acsl/assign_array.i, line 19) in 'jobG': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_acsl/assign_array.i, line 19) in 'jobG': Prove: true. ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/assigns_path.res.oracle��������������������0000666�0000000�0000000�00000005700�13571573400�024614� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/assigns_path.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'N' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'A' in 'job': Assume { Type: is_sint32(i_1) /\ is_sint32(n). (* Goal *) When: (0 <= i) /\ (i < n). (* Heap *) Have: region(b.base) <= 0. (* Pre-condition *) Have: (0 <= n) /\ (n <= 3). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (Mint_0[shift_sint32(b, i_2)] = v[i_2]))). (* Invariant *) Have: (0 <= i_1) /\ (i_1 <= n). (* Else *) Have: n <= i_1. } Prove: Mint_0[shift_sint32(b, i)] = v[i]. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_acsl/assigns_path.i, line 16): Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Heap *) Have: region(b.base) <= 0. (* Pre-condition *) Have: (0 <= n) /\ (n <= 3). (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (Mint_0[shift_sint32(b, i_1)] = v[i_1]))). (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_acsl/assigns_path.i, line 16): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_acsl/assigns_path.i, line 17): Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i). (* Heap *) Have: region(b.base) <= 0. (* Pre-condition *) Have: (0 <= n) /\ (n <= 3). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (Mint_0[shift_sint32(b, i_2)] = v[i_2]))). (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: v[i <- Mint_0[shift_sint32(b, i)]][i_1] = Mint_0[shift_sint32(b, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_acsl/assigns_path.i, line 17): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_acsl/assigns_path.i, line 18): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_acsl/assigns_path.i, line 9) in 'job' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_acsl/assigns_path.i, line 9) in 'job' (2/2): Effect at line 20 Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'job': /*@ behavior typed: requires \separated(&p,b+(..)); */ void job(int n, int *b); ����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/assigns_range.res.oracle�������������������0000666�0000000�0000000�00000016414�13571573400�024760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/assigns_range.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function call_assigns_all ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (1/5): Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (2/5): Call Effect at line 37 Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (3/5): Call Effect at line 38 Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (4/5): Call Effect at line 39 Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (5/5): Call Effect at line 40 Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (1/5): Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (2/5): Call Effect at line 37 Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (3/5): Call Effect at line 38 Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (4/5): Call Effect at line 39 Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'call_assigns_all' (5/5): Call Effect at line 40 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_acsl/assigns_range.i, line 8) in 'assigns_t1_an_element'' in 'call_assigns_all' at call 'assigns_t1_an_element' (file tests/wp_acsl/assigns_range.i, line 37) : Assume { Type: is_sint32(i) /\ is_sint32(j). (* Pre-condition *) Have: (0 <= i) /\ (i <= j) /\ (j <= 19). } Prove: i <= 19. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_acsl/assigns_range.i, line 13) in 'assigns_t2_bound'' in 'call_assigns_all' at call 'assigns_t2_bound' (file tests/wp_acsl/assigns_range.i, line 38) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_acsl/assigns_range.i, line 18) in 'assigns_t3_inf_bound'' in 'call_assigns_all' at call 'assigns_t3_inf_bound' (file tests/wp_acsl/assigns_range.i, line 39) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_acsl/assigns_range.i, line 23) in 'assigns_t4_sup_bound'' in 'call_assigns_all' at call 'assigns_t4_sup_bound' (file tests/wp_acsl/assigns_range.i, line 40) : Assume { Type: is_sint32(i) /\ is_sint32(j). (* Pre-condition *) Have: (0 <= i) /\ (i <= j) /\ (j <= 19). (* Call 'assigns_t1_an_element' *) Have: i <= 19. (* Call Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (((i_1 < i) \/ (j < i_1)) -> (t2_0[i_1] = t2_1[i_1])))). (* Call Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (((i_1 < i) \/ (20 <= i_1)) -> (t3_0[i_1] = t3_1[i_1])))). } Prove: 0 <= j. ------------------------------------------------------------ ------------------------------------------------------------ Function call_assigns_t1 ------------------------------------------------------------ Goal Assigns 'qed_ko' in 'call_assigns_t1': Call Effect at line 49 Assume { Type: is_sint32(i). (* Goal *) When: (0 <= i) /\ (i <= 19). (* Pre-condition *) Have: (5 <= i) /\ (i <= 7). } Prove: false. ------------------------------------------------------------ Goal Assigns 'qed_ko' in 'call_assigns_t1': Call Effect at line 49 Assume { Type: is_sint32(i). (* Goal *) When: (0 <= i) /\ (i <= 19). (* Pre-condition *) Have: (5 <= i) /\ (i <= 7). } Prove: false. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_acsl/assigns_range.i, line 8) in 'assigns_t1_an_element'' in 'call_assigns_t1' at call 'assigns_t1_an_element' (file tests/wp_acsl/assigns_range.i, line 49) : Assume { Type: is_sint32(i). (* Pre-condition *) Have: (5 <= i) /\ (i <= 7). } Prove: (0 <= i) /\ (i <= 19). ------------------------------------------------------------ ------------------------------------------------------------ Function call_assigns_t2 ------------------------------------------------------------ Goal Assigns 'qed_ko' in 'call_assigns_t2': Call Effect at line 57 Assume { Type: is_sint32(i). (* Goal *) When: ((-2) <= i) /\ (i <= 19). (* Pre-condition *) Have: (5 <= i) /\ (i <= 7). (* Exit 'assigns_t2_bound' *) Have: (0 <= i) /\ (i <= 17). (* Exit Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (((i_1 < i) \/ ((3 + i) <= i_1)) -> (t2_0[i_1] = t2_1[i_1])))). } Prove: false. ------------------------------------------------------------ Goal Assigns 'qed_ko' in 'call_assigns_t2': Call Effect at line 57 Assume { Type: is_sint32(i). (* Goal *) When: ((-2) <= i) /\ (i <= 19). (* Pre-condition *) Have: (5 <= i) /\ (i <= 7). (* Call 'assigns_t2_bound' *) Have: (0 <= i) /\ (i <= 17). (* Call Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (((i_1 < i) \/ ((3 + i) <= i_1)) -> (t2_0[i_1] = t2_1[i_1])))). } Prove: false. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_acsl/assigns_range.i, line 13) in 'assigns_t2_bound'' in 'call_assigns_t2' at call 'assigns_t2_bound' (file tests/wp_acsl/assigns_range.i, line 57) : Assume { Type: is_sint32(i). (* Pre-condition *) Have: (5 <= i) /\ (i <= 7). } Prove: (0 <= i) /\ (i <= 17). ------------------------------------------------------------ ------------------------------------------------------------ Function call_assigns_t4 ------------------------------------------------------------ Goal Assigns 'qed_ko' in 'call_assigns_t4': Call Effect at line 65 Assume { Type: is_sint32(i) /\ is_sint32(j). (* Goal *) When: 0 <= j. (* Pre-condition *) Have: (0 <= i) /\ (i <= j) /\ (j <= 19). (* Exit Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (((i_1 < 0) \/ (j < i_1)) -> (t4_0[i_1] = t4_1[i_1])))). } Prove: i <= 0. ------------------------------------------------------------ Goal Assigns 'qed_ko' in 'call_assigns_t4': Call Effect at line 65 Assume { Type: is_sint32(i) /\ is_sint32(j). (* Goal *) When: 0 <= j. (* Pre-condition *) Have: (0 <= i) /\ (i <= j) /\ (j <= 19). (* Call Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (((i_1 < 0) \/ (j < i_1)) -> (t4_0[i_1] = t4_1[i_1])))). } Prove: i <= 0. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_acsl/assigns_range.i, line 23) in 'assigns_t4_sup_bound'' in 'call_assigns_t4' at call 'assigns_t4_sup_bound' (file tests/wp_acsl/assigns_range.i, line 65) : Assume { Type: is_sint32(i) /\ is_sint32(j). (* Pre-condition *) Have: (0 <= i) /\ (i <= j) /\ (j <= 19). } Prove: 0 <= j. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/axioms.res.oracle��������������������������0000666�0000000�0000000�00000012023�13571573400�023425� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/axioms.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'P,todo' in 'f': Let a_1 = shift_sint32(t, a). Let x = -a. Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, i - a). Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). (* Invariant 'Positive' *) Have: forall i_1 : Z. ((a <= i_1) -> ((i_1 < i) -> (0 < a_2[shift_sint32(t, i_1)]))). (* Invariant 'Index' *) Have: (a <= i) /\ (i <= (1 + b)). (* Else *) Have: b < i. } Prove: P_P(a_2, t, a, b). ------------------------------------------------------------ Goal Post-condition 'Q' in 'f': Let a_1 = shift_sint32(t, a). Let x = -a. Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, i - a). Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). (* Invariant 'Positive' *) Have: forall i_1 : Z. ((a <= i_1) -> ((i_1 < i) -> (0 < a_2[shift_sint32(t, i_1)]))). (* Invariant 'Index' *) Have: (a <= i) /\ (i <= (1 + b)). (* Else *) Have: b < i. } Prove: P_Q(Malloc_0, a_2, t, a, b). ------------------------------------------------------------ Goal Preservation of Invariant 'Index' (file tests/wp_acsl/axioms.i, line 30): Let a_1 = shift_sint32(t, a). Let x = -a. Let x_1 = 1 + i. Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i) /\ is_sint32(x_1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). (* Invariant 'Positive' *) Have: forall i_1 : Z. ((a <= i_1) -> ((i_1 < i) -> (0 < havoc(Mint_undef_0, Mint_0, a_1, i - a)[shift_sint32(t, i_1)]))). (* Invariant 'Index' *) Have: (a <= i) /\ (i <= (1 + b)). (* Then *) Have: i <= b. } Prove: a <= x_1. ------------------------------------------------------------ Goal Establishment of Invariant 'Index' (file tests/wp_acsl/axioms.i, line 30): Assume { Type: is_sint32(a) /\ is_sint32(b). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, shift_sint32(t, a), 1 + b - a). } Prove: a <= (1 + b). ------------------------------------------------------------ Goal Preservation of Invariant 'Positive' (file tests/wp_acsl/axioms.i, line 31): Let a_1 = shift_sint32(t, a). Let x = -a. Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, i - a). Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i) /\ is_sint32(1 + i). (* Goal *) When: (a <= i_1) /\ (i_1 <= i) /\ is_sint32(i_1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). (* Invariant 'Positive' *) Have: forall i_2 : Z. ((a <= i_2) -> ((i_2 < i) -> (0 < a_2[shift_sint32(t, i_2)]))). (* Invariant 'Index' *) Have: (a <= i) /\ (i <= (1 + b)). (* Then *) Have: i <= b. } Prove: 0 < a_2[shift_sint32(t, i) <- 1][shift_sint32(t, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant 'Positive' (file tests/wp_acsl/axioms.i, line 31): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_acsl/axioms.i, line 32) (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_acsl/axioms.i, line 32) (2/3): Effect at line 34 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_acsl/axioms.i, line 32) (3/3): Effect at line 34 Let a_1 = shift_sint32(t, a). Let x = -a. Let a_2 = shift_sint32(t, i). Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i) /\ is_sint32(1 + i). (* Goal *) When: !invalid(Malloc_0, a_2, 1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). (* Invariant 'Positive' *) Have: forall i_1 : Z. ((a <= i_1) -> ((i_1 < i) -> (0 < havoc(Mint_undef_0, Mint_0, a_1, i - a)[shift_sint32(t, i_1)]))). (* Invariant 'Index' *) Have: (a <= i) /\ (i <= (1 + b)). (* Then *) Have: i <= b. } Prove: included(a_2, 1, a_1, 1 + i - a). ------------------------------------------------------------ Goal Assigns 'todo' in 'f': Effect at line 34 Let a_1 = shift_sint32(t, a). Let x = -a. Assume { Have: a < i. Have: !invalid(Malloc_0, a_1, i - a). Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). } Prove: i <= (1 + b). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/base_offset.res.oracle���������������������0000666�0000000�0000000�00000001650�13571573400�024411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/base_offset.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/base_offset.i, line 11) in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/base_offset.i, line 13) in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/base_offset.i, line 15) in 'f': Let x = p.offset. Assume { (* Goal *) When: (0 <= i) /\ (i <= i_1) /\ (i_1 <= 3). (* Heap *) Have: region(p.base) <= 0. } Prove: base_offset(1 + i + x) <= base_offset(1 + i_1 + x). ------------------------------------------------------------ ����������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/bitwise.res.oracle�������������������������0000666�0000000�0000000�00000022400�13571573400�023573� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/bitwise.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function band ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise.i, line 5) in 'band': Prove: true. ------------------------------------------------------------ Goal Post-condition 'band0' in 'band': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function band with behavior bit0 ------------------------------------------------------------ Goal Post-condition for 'bit0' 'band1' in 'band': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bit0' 'band2' in 'band': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function band with behavior bit1 ------------------------------------------------------------ Goal Post-condition for 'bit1' 'band3' in 'band': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function band with behavior bit2 ------------------------------------------------------------ Goal Post-condition for 'bit2' 'band4' in 'band': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function band with behavior bit3 ------------------------------------------------------------ Goal Post-condition for 'bit3' 'band5' in 'band': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function band with behavior bit4 ------------------------------------------------------------ Goal Post-condition for 'bit4' 'band6' in 'band': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function band with behavior bit5 ------------------------------------------------------------ Goal Post-condition for 'bit5' 'band7,zbit' in 'band': Assume { Type: is_sint32(a). (* Goal *) When: land(4095, a) = 85. } Prove: land(65535, a) != 21845. ------------------------------------------------------------ ------------------------------------------------------------ Function band_bool with behavior false ------------------------------------------------------------ Goal Post-condition for 'false' (file tests/wp_acsl/bitwise.i, line 91) in 'band_bool': Assume { Type: is_bool(a) /\ is_bool(b). (* Pre-condition for 'false' *) Have: (a != 1) \/ (b != 1). } Prove: land(a, b) = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function band_bool with behavior true ------------------------------------------------------------ Goal Post-condition for 'true' (file tests/wp_acsl/bitwise.i, line 88) in 'band_bool': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bnot ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise.i, line 55) in 'bnot': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bor ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise.i, line 28) in 'bor': Prove: true. ------------------------------------------------------------ Goal Post-condition 'bor0' in 'bor': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bor with behavior bit1 ------------------------------------------------------------ Goal Post-condition for 'bit1' 'bor1' in 'bor': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bor with behavior bit2 ------------------------------------------------------------ Goal Post-condition for 'bit2' 'bor2' in 'bor': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bor with behavior bit3 ------------------------------------------------------------ Goal Post-condition for 'bit3' 'bor3' in 'bor': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bor_bool with behavior false ------------------------------------------------------------ Goal Post-condition for 'false' (file tests/wp_acsl/bitwise.i, line 81) in 'bor_bool': Assume { Type: is_bool(a) /\ is_bool(b). (* Pre-condition for 'false' *) Have: (a != 1) /\ (b != 1). } Prove: (a = 0) /\ (b = 0). ------------------------------------------------------------ ------------------------------------------------------------ Function bor_bool with behavior true ------------------------------------------------------------ Goal Post-condition for 'true' (file tests/wp_acsl/bitwise.i, line 78) in 'bor_bool': Assume { Type: is_bool(a) /\ is_bool(b). (* Pre-condition for 'true' *) Have: (a = 1) \/ (b = 1). } Prove: (a != 0) \/ (b != 0). ------------------------------------------------------------ ------------------------------------------------------------ Function bxor ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise.i, line 42) in 'bxor': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor with behavior bit1 ------------------------------------------------------------ Goal Post-condition for 'bit1' (file tests/wp_acsl/bitwise.i, line 45) in 'bxor': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor with behavior bit2 ------------------------------------------------------------ Goal Post-condition for 'bit2' (file tests/wp_acsl/bitwise.i, line 48) in 'bxor': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor with behavior bit3 ------------------------------------------------------------ Goal Post-condition for 'bit3' 'zbit' in 'bxor': Let x = lnot(b). Assume { Type: is_sint32(b) /\ is_sint32(x) /\ is_sint32(lxor(b, x)). } Prove: lnot(x) = b. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor_bool with behavior false ------------------------------------------------------------ Goal Post-condition for 'false' (file tests/wp_acsl/bitwise.i, line 100) in 'bxor_bool': Assume { Type: is_bool(a) /\ is_bool(b). (* Pre-condition for 'false' *) Have: ((a != 0) \/ (b != 1)) /\ ((a != 1) \/ (b != 0)). } Prove: b = a. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor_bool with behavior true ------------------------------------------------------------ Goal Post-condition for 'true' (file tests/wp_acsl/bitwise.i, line 97) in 'bxor_bool': Assume { Type: is_bool(a) /\ is_bool(b). (* Pre-condition for 'true' *) Have: ((a = 0) /\ (b = 1)) \/ ((a = 1) /\ (b = 0)). } Prove: b != a. ------------------------------------------------------------ ------------------------------------------------------------ Function lshift ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise.i, line 58) in 'lshift': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function lshift with behavior shift1 ------------------------------------------------------------ Goal Post-condition for 'shift1' 'lsl1' in 'lshift': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'shift1' 'lsl2' in 'lshift': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function lshift with behavior shift2 ------------------------------------------------------------ Goal Post-condition for 'shift2' 'lsl3' in 'lshift': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function rshift ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise.i, line 69) in 'rshift': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function rshift with behavior shift1 ------------------------------------------------------------ Goal Post-condition for 'shift1' 'lsr1' in 'rshift': Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/bitwise2.res.oracle������������������������0000666�0000000�0000000�00000003114�13571573400�023656� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/bitwise2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise2.i, line 2) in 'job1': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job1bis ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise2.i, line 7) in 'job1bis': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise2.i, line 12) in 'job2': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job3 ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise2.i, line 17) in 'job3': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job4 ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/bitwise2.i, line 22) in 'job4': Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/block_length.res.oracle��������������������0000666�0000000�0000000�00000002623�13571573400�024565� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/block_length.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'Pt' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Psiz1' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Pmat1' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Psiz2' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Pmat2' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Ps' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Pts' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Pt1' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Pmat12' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Pts1' in 'f': Prove: true. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/checks.0.res.oracle������������������������0000666�0000000�0000000�00000007335�13571573400�023535� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/checks.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Check 'c1' (file tests/wp_acsl/checks.i, line 14): Prove: P_P. ------------------------------------------------------------ Goal Assertion 'a1' (file tests/wp_acsl/checks.i, line 15): Prove: P_P. ------------------------------------------------------------ Goal Check 'c2' (file tests/wp_acsl/checks.i, line 16): Prove: true. ------------------------------------------------------------ Goal Assertion 'a2' (file tests/wp_acsl/checks.i, line 17): Prove: true. ------------------------------------------------------------ [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/wp_acsl/checks.i:14: Warning: check 'c1' got status unknown. [eva:alarm] tests/wp_acsl/checks.i:15: Warning: assertion 'a1' got status unknown. [eva:alarm] tests/wp_acsl/checks.i:16: Warning: check 'c2' got status unknown. [eva:alarm] tests/wp_acsl/checks.i:17: Warning: assertion 'a2' got status unknown. [eva] done for function main [scope:rm_asserts] removing 2 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 5 statements reached (out of 5): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 0 valid 4 unknown 0 invalid 4 total Preconditions 0 valid 0 unknown 0 invalid 0 total 0% of the logical properties reached have been proven. ---------------------------------------------------------------------------- [report] Computing properties status... -------------------------------------------------------------------------------- --- Global Properties -------------------------------------------------------------------------------- [ Valid ] Axiomatic 'A' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Check 'c1' (file tests/wp_acsl/checks.i, line 14) tried with Eva. [ - ] Assertion 'a1' (file tests/wp_acsl/checks.i, line 15) tried with Eva. [ Partial ] Check 'c2' (file tests/wp_acsl/checks.i, line 16) By RedundantAlarms, with pending: - Assertion 'a1' (file tests/wp_acsl/checks.i, line 15) [ Partial ] Assertion 'a2' (file tests/wp_acsl/checks.i, line 17) By RedundantAlarms, with pending: - Assertion 'a1' (file tests/wp_acsl/checks.i, line 15) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 2 Locally validated 2 To be validated 5 Total -------------------------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/checks.1.res.oracle������������������������0000666�0000000�0000000�00000001101�13571573400�023517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/checks.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Check 'c1' (file tests/wp_acsl/checks.i, line 14): Prove: P_P. ------------------------------------------------------------ Goal Check 'c2' (file tests/wp_acsl/checks.i, line 16): Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/checks.2.res.oracle������������������������0000666�0000000�0000000�00000001111�13571573400�023521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/checks.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Assertion 'a1' (file tests/wp_acsl/checks.i, line 15): Prove: P_P. ------------------------------------------------------------ Goal Assertion 'a2' (file tests/wp_acsl/checks.i, line 17): Prove: true. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/classify_float.res.oracle������������������0000666�0000000�0000000�00000001456�13571573400�025137� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/classify_float.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma InfN_not_finite: Assume: 'InfP_not_finite' 'NaN_not_finite' Prove: (not (is_finite_f64 x_0)) \/ (not (is_negative_infinite_f64 x_0)) ------------------------------------------------------------ Lemma InfP_not_finite: Assume: 'NaN_not_finite' Prove: (not (is_finite_f64 x_0)) \/ (not (is_positive_infinite_f64 x_0)) ------------------------------------------------------------ Lemma NaN_not_finite: Prove: (not (is_finite_f64 x_0)) \/ (not (is_NaN_f64 x_0)) ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/ctor.res.oracle����������������������������0000666�0000000�0000000�00000000730�13571573400�023076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/ctor.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Axiomatic 'Event' ------------------------------------------------------------ Lemma cons: Prove: true ------------------------------------------------------------ Lemma diff: Assume: 'cons' Prove: true ------------------------------------------------------------ ����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/div_mod.res.oracle�������������������������0000666�0000000�0000000�00000010514�13571573400�023551� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/div_mod.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'd0,div_pos_pos' in 'f': Prove: P_Peq(1, 1). ------------------------------------------------------------ Goal Post-condition 'd1,div_neg_pos' in 'f': Prove: P_Peq(-1, -1). ------------------------------------------------------------ Goal Post-condition 'd2,div_pos_neg' in 'f': Prove: P_Peq(-1, -1). ------------------------------------------------------------ Goal Post-condition 'd3,div_neg_neg' in 'f': Prove: P_Peq(1, 1). ------------------------------------------------------------ Goal Post-condition 'd4,div_x_1' in 'f': Assume { Type: is_sint32(x). } Prove: P_Peq(x, x). ------------------------------------------------------------ Goal Post-condition 'd5,div_x_minus1' in 'f': Let x_1 = -x. Assume { Type: is_sint32(x). } Prove: P_Peq(x_1, x_1). ------------------------------------------------------------ Goal Post-condition 'd6,div_0_x' in 'f': Assume { Type: is_sint32(x). (* Goal *) When: x != 0. } Prove: P_Peq(0 / x, 0). ------------------------------------------------------------ Goal Post-condition 'd7,div_0_x,ko' in 'f': Assume { Type: is_sint32(x). } Prove: P_Peq(0 / x, 0). ------------------------------------------------------------ Goal Post-condition 'sd0,div_pos_pos' in 'f': Assume { Type: is_sint32(x) /\ is_sint32(y). (* Goal *) When: (0 < y) /\ (0 <= x). } Prove: 0 <= (x / y). ------------------------------------------------------------ Goal Post-condition 'sd1,div_neg_pos' in 'f': Assume { Type: is_sint32(x) /\ is_sint32(y). (* Goal *) When: (x <= 0) /\ (0 < y). } Prove: (x / y) <= 0. ------------------------------------------------------------ Goal Post-condition 'sd2,div_pos_neg' in 'f': Assume { Type: is_sint32(x) /\ is_sint32(y). (* Goal *) When: (0 <= x) /\ (y < 0). } Prove: (x / y) <= 0. ------------------------------------------------------------ Goal Post-condition 'sd3,div_neg_neg' in 'f': Assume { Type: is_sint32(x) /\ is_sint32(y). (* Goal *) When: (x <= 0) /\ (y < 0). } Prove: 0 <= (x / y). ------------------------------------------------------------ Goal Post-condition 'm0,mod_pos_pos' in 'f': Prove: P_Peq(2, 2). ------------------------------------------------------------ Goal Post-condition 'm1,mod_neg_pos' in 'f': Prove: P_Peq(-2, -2). ------------------------------------------------------------ Goal Post-condition 'm2,mod_pos_neg' in 'f': Prove: P_Peq(2, 2). ------------------------------------------------------------ Goal Post-condition 'm3,mod_neg_neg' in 'f': Prove: P_Peq(-2, -2). ------------------------------------------------------------ Goal Post-condition 'm4,mod_x_1' in 'f': Prove: P_Peq(0, 0). ------------------------------------------------------------ Goal Post-condition 'm5,mod_x_minus1' in 'f': Assume { Type: is_sint32(x). } Prove: P_Peq(x % (-1), 0). ------------------------------------------------------------ Goal Post-condition 'm6,mod_0_x' in 'f': Assume { Type: is_sint32(x). (* Goal *) When: x != 0. } Prove: P_Peq(0 % x, 0). ------------------------------------------------------------ Goal Post-condition 'm7,mod_0_x,ko' in 'f': Assume { Type: is_sint32(x). } Prove: P_Peq(0 % x, 0). ------------------------------------------------------------ Goal Post-condition 'sm0,mod_pos_pos' in 'f': Assume { Type: is_sint32(x) /\ is_sint32(y). (* Goal *) When: (0 < y) /\ (0 <= x). } Prove: 0 <= (x % y). ------------------------------------------------------------ Goal Post-condition 'sm1,mod_neg_pos' in 'f': Assume { Type: is_sint32(x) /\ is_sint32(y). (* Goal *) When: (x <= 0) /\ (0 < y). } Prove: (x % y) <= 0. ------------------------------------------------------------ Goal Post-condition 'sm2,mod_pos_neg' in 'f': Assume { Type: is_sint32(x) /\ is_sint32(y). (* Goal *) When: (0 <= x) /\ (y < 0). } Prove: 0 <= (x % y). ------------------------------------------------------------ Goal Post-condition 'sm3,mod_neg_neg' in 'f': Assume { Type: is_sint32(x) /\ is_sint32(y). (* Goal *) When: (x <= 0) /\ (y < 0). } Prove: (x % y) <= 0. ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/e_imply.res.oracle�������������������������0000666�0000000�0000000�00000014327�13571573400�023574� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/e_imply.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'p0' in 'f': Prove: P_T. ------------------------------------------------------------ Goal Post-condition 'p1' in 'f': Assume { (* Goal *) When: P_P(1). } Prove: P_T. ------------------------------------------------------------ Goal Post-condition 'p2' in 'f': Assume { (* Goal *) When: P_F. } Prove: P_P(2). ------------------------------------------------------------ Goal Post-condition 'p3' in 'f': Assume { (* Goal *) When: P_F /\ P_P(2). } Prove: P_P(3). ------------------------------------------------------------ Goal Post-condition 'p4' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'p5' in 'f': Assume { (* Goal *) When: P_P(2). } Prove: P_T. ------------------------------------------------------------ Goal Post-condition 'p6' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'p7' in 'f': Assume { (* Goal *) When: P_F /\ P_P(12). } Prove: P_P(21) /\ P_P(22). ------------------------------------------------------------ Goal Post-condition 'p8' in 'f': Assume { (* Goal *) When: P_P(1). } Prove: P_T. ------------------------------------------------------------ Goal Post-condition 'p9' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'i0' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'i1' in 'f': Assume { (* Goal *) When: P_P(1) /\ P_P(2). } Prove: P_T. ------------------------------------------------------------ Goal Post-condition 'i2' in 'f': Assume { (* Goal *) When: P_F. } Prove: (!P_P(1)) \/ (!P_P(2)). ------------------------------------------------------------ Goal Post-condition 'i3' in 'f': Assume { (* Goal *) When: P_P(1) /\ P_P(2). } Prove: P_T. ------------------------------------------------------------ Goal Post-condition 'i4' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'i5' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'i6' in 'f': Assume { (* Goal *) When: P_P(0) /\ P_P(1) /\ P_P(2) /\ P_P(3) /\ P_P(4). } Prove: P_T. ------------------------------------------------------------ Goal Post-condition 'i7' in 'f': Assume { (* Goal *) When: P_P(0) /\ P_P(1) /\ P_P(2) /\ P_P(3) /\ P_P(4). } Prove: P_T. ------------------------------------------------------------ Goal Post-condition 'i8' in 'f': Prove: (!P_F) \/ (!P_P(0)) \/ (!P_P(1)) \/ (!P_P(2)) \/ (!P_P(3)) \/ P_P(5). ------------------------------------------------------------ Goal Post-condition 'i9' in 'f': Prove: (!P_F) \/ (!P_P(0)) \/ (!P_P(1)) \/ (!P_P(2)) \/ (!P_P(3)) \/ P_P(5). ------------------------------------------------------------ Goal Post-condition 'a0' in 'f': Prove: (!P_F) \/ (!P_P(2)). ------------------------------------------------------------ Goal Post-condition 'a1' in 'f': Assume { (* Goal *) When: P_F. } Prove: P_P(1) /\ P_P(3). ------------------------------------------------------------ Goal Post-condition 'a2' in 'f': Prove: (!P_F) \/ (!P_P(0)) \/ (!P_P(2)) \/ P_P(3) \/ (!P_P(4)). ------------------------------------------------------------ Goal Post-condition 'a3' in 'f': Prove: (!P_F) \/ (!P_P(0)) \/ (!P_P(2)) \/ P_P(3) \/ (!P_P(4)). ------------------------------------------------------------ Goal Post-condition 'a4' in 'f': Prove: P_T \/ (!P_P(0)) \/ (!P_P(1)) \/ (!P_P(2)) \/ (!P_P(4)). ------------------------------------------------------------ Goal Post-condition 'a5' in 'f': Prove: P_T \/ (!P_P(2)). ------------------------------------------------------------ Goal Post-condition 'a6' in 'f': Prove: P_T \/ (!P_P(2)) \/ (!P_P(4)). ------------------------------------------------------------ Goal Post-condition 'a7' in 'f': Prove: P_T \/ (!P_P(2)). ------------------------------------------------------------ Goal Post-condition 'a8' in 'f': Prove: (!P_F) \/ P_P(2) \/ (!P_P(4)). ------------------------------------------------------------ Goal Post-condition 'a9' in 'f': Prove: (!P_F) \/ (!P_P(2)) \/ P_P(3) \/ (!P_P(4)). ------------------------------------------------------------ Goal Post-condition 'o0' in 'f': Assume { (* Goal *) When: P_F /\ P_P(2). } Prove: P_P(3). ------------------------------------------------------------ Goal Post-condition 'o1' in 'f': Assume { (* Goal *) When: P_F /\ P_P(2). } Prove: !P_P(3). ------------------------------------------------------------ Goal Post-condition 'o2' in 'f': Prove: (!P_F) \/ (!P_P(0)) \/ (!P_P(2)) \/ (!P_P(3)) \/ P_P(4). ------------------------------------------------------------ Goal Post-condition 'o3' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'o4' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'o5' in 'f': Assume { (* Goal *) When: (!P_T) /\ P_P(2). } Prove: P_P(3). ------------------------------------------------------------ Goal Post-condition 'o6' in 'f': Assume { (* Goal *) When: (!P_T) /\ P_P(2) /\ P_P(4). } Prove: P_P(3). ------------------------------------------------------------ Goal Post-condition 'o7' in 'f': Assume { (* Goal *) When: (!P_T) /\ P_P(2). } Prove: P_P(3). ------------------------------------------------------------ Goal Post-condition 'o8' in 'f': Assume { (* Goal *) When: P_F /\ (!P_P(2)) /\ P_P(4). } Prove: !P_P(3). ------------------------------------------------------------ Goal Post-condition 'o9' in 'f': Prove: (!P_F) \/ (!P_P(2)) \/ P_P(3) \/ (!P_P(4)). ------------------------------------------------------------ Goal Post-condition 'f0' in 'f': Assume { (* Goal *) When: P_P(1) /\ P_P(2). } Prove: P_T. ------------------------------------------------------------ Goal Post-condition 'f1' in 'f': Assume { (* Goal *) When: P_P(1) /\ P_P(2). } Prove: P_T. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/equal.res.oracle���������������������������0000666�0000000�0000000�00000005640�13571573400�023243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/equal.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function simple_array ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/equal.i, line 22) in 'simple_array': Let x = t0_0[0]. Let x_1 = t0_0[1]. Assume { Type: IsArray1_sint32(t0_0) /\ IsArray1_sint32(t1_0) /\ is_sint32(x) /\ is_sint32(x_1). } Prove: EqArray1_int(2, t0_0, t1_0[0 <- x][1 <- x_1]). ------------------------------------------------------------ ------------------------------------------------------------ Function simple_struct ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/equal.i, line 16) in 'simple_struct': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function with_array_struct ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/equal.i, line 28) in 'with_array_struct': Let a = st0_0.F2_St_tab. Let a_1 = st1_0.F2_St_tab. Assume { Type: IsS2_St(st0_0) /\ IsS2_St(st1_0) /\ IsArray1_sint32(a) /\ IsArray1_sint32(a_1). (* Goal *) When: EqArray1_int(10, a, a_1). } Prove: EqS2_St(st0_0, st1_0). ------------------------------------------------------------ ------------------------------------------------------------ Function with_ptr_and_array_struct ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/equal.i, line 47) in 'with_ptr_and_array_struct': Let a = q0_0.F4_Q_qs. Let a_1 = q1_0.F4_Q_qs. Let a_2 = q0_0.F4_Q_qt. Let a_3 = q1_0.F4_Q_qt. Assume { Type: IsS4_Q(q0_0) /\ IsS4_Q(q1_0) /\ IsArray1_sint32(a_2) /\ IsArray1_sint32(a_3) /\ IsS1_S(a) /\ IsS1_S(a_1). (* Goal *) When: ((q1_0.F4_Q_qp) = (q0_0.F4_Q_qp)) /\ EqS1_S(a, a_1) /\ EqArray1_int(2, a_2, a_3). } Prove: EqS4_Q(q0_0, q1_0). ------------------------------------------------------------ ------------------------------------------------------------ Function with_ptr_array ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/equal.i, line 40) in 'with_ptr_array': Assume { (* Goal *) When: forall i : Z. ((0 <= i) -> ((i <= 4) -> (tp1_0[i] = tp0_0[i]))). } Prove: EqArray1_pointer(5, tp0_0, tp1_0). ------------------------------------------------------------ ------------------------------------------------------------ Function with_ptr_struct ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/equal.i, line 34) in 'with_ptr_struct': Assume { (* Goal *) When: (sp1_0.F3_Sp_p) = (sp0_0.F3_Sp_p). } Prove: EqS3_Sp(sp0_0, sp1_0). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/float_compare.res.oracle�������������������0000666�0000000�0000000�00000013255�13571573400�024750� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/float_compare.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma finite_32_64: Assume: 'test_double_compare_greater' 'test_float_compare_greater' 'test_double_compare' 'test_float_compare' Prove: (is_finite_f32 x_0) -> (is_finite_f64 (to_f64 (of_f32 x_0))) ------------------------------------------------------------ Lemma finite_32_64_real: Assume: 'finite_32_64' 'test_double_compare_greater' 'test_float_compare_greater' 'test_double_compare' 'test_float_compare' Prove: let r_0 = (of_f32 x_0) in (is_finite_f32 x_0) -> ((of_f64 (to_f64 r_0))=r_0) ------------------------------------------------------------ Lemma test_double_compare: Assume: 'test_float_compare' Prove: (is_finite_f64 x_0) -> (is_finite_f64 y_0) -> (le_f64 x_0 y_0) -> ((eq_f64 x_0 y_0) \/ (lt_f64 x_0 y_0)) ------------------------------------------------------------ Lemma test_double_compare_greater: Assume: 'test_float_compare_greater' 'test_double_compare' 'test_float_compare' Prove: (is_finite_f64 x_0) -> (is_finite_f64 y_0) -> (le_f64 y_0 x_0) -> ((eq_f64 x_0 y_0) \/ (lt_f64 y_0 x_0)) ------------------------------------------------------------ Lemma test_float_compare: Prove: (is_finite_f32 x_0) -> (is_finite_f32 y_0) -> (le_f32 x_0 y_0) -> ((eq_f32 x_0 y_0) \/ (lt_f32 x_0 y_0)) ------------------------------------------------------------ Lemma test_float_compare_greater: Assume: 'test_double_compare' 'test_float_compare' Prove: (is_finite_f32 x_0) -> (is_finite_f32 y_0) -> (le_f32 y_0 x_0) -> ((eq_f32 x_0 y_0) \/ (lt_f32 y_0 x_0)) ------------------------------------------------------------ ------------------------------------------------------------ Function cmp_dd ------------------------------------------------------------ Goal Post-condition 'DEF' in 'cmp_dd': Assume { (* Pre-condition *) Have: is_finite_f64(a) /\ is_finite_f64(b). } Prove: (if lt_f64b(a, b) then 1 else 0) = (if (of_f64(a) < of_f64(b)) then 1 else 0). ------------------------------------------------------------ Goal Post-condition 'REL1' in 'cmp_dd': Assume { (* Pre-condition *) Have: is_finite_f64(a) /\ is_finite_f64(b). } Prove: lt_f64(a, b) <-> (of_f64(a) < of_f64(b)). ------------------------------------------------------------ Goal Post-condition 'REL2' in 'cmp_dd': Assume { (* Pre-condition *) Have: is_finite_f64(a) /\ is_finite_f64(b). } Prove: lt_f64(a, b) <-> (of_f64(a) < of_f64(b)). ------------------------------------------------------------ ------------------------------------------------------------ Function cmp_fd ------------------------------------------------------------ Goal Post-condition 'DEF' in 'cmp_fd': Let r = of_f32(a). Let a_1 = to_f64(r). Assume { (* Pre-condition *) Have: is_finite_f32(a) /\ is_finite_f64(b). (* Assertion *) Have: is_finite_f64(a_1). (* Assertion *) Have: of_f64(a_1) = r. } Prove: (if lt_f64b(a_1, b) then 1 else 0) = (if (r < of_f64(b)) then 1 else 0). ------------------------------------------------------------ Goal Post-condition 'REL1' in 'cmp_fd': Let r = of_f32(a). Let a_1 = to_f64(r). Assume { (* Pre-condition *) Have: is_finite_f32(a) /\ is_finite_f64(b). (* Assertion *) Have: is_finite_f64(a_1). (* Assertion *) Have: of_f64(a_1) = r. } Prove: lt_f64(a_1, b) <-> (r < of_f64(b)). ------------------------------------------------------------ Goal Post-condition 'REL2' in 'cmp_fd': Let r = of_f32(a). Let a_1 = to_f64(r). Assume { (* Pre-condition *) Have: is_finite_f32(a) /\ is_finite_f64(b). (* Assertion *) Have: is_finite_f64(a_1). (* Assertion *) Have: of_f64(a_1) = r. } Prove: lt_f64(a_1, b) <-> (r < of_f64(b)). ------------------------------------------------------------ Goal Assertion (file tests/wp_acsl/float_compare.i, line 63): Assume { (* Pre-condition *) Have: is_finite_f32(a) /\ is_finite_f64(b). } Prove: is_finite_f64(to_f64(of_f32(a))). ------------------------------------------------------------ Goal Assertion (file tests/wp_acsl/float_compare.i, line 64): Let r = of_f32(a). Let a_1 = to_f64(r). Assume { (* Pre-condition *) Have: is_finite_f32(a) /\ is_finite_f64(b). (* Assertion *) Have: is_finite_f64(a_1). } Prove: of_f64(a_1) = r. ------------------------------------------------------------ ------------------------------------------------------------ Function cmp_ff ------------------------------------------------------------ Goal Post-condition 'DEF' in 'cmp_ff': Assume { (* Pre-condition *) Have: is_finite_f32(a) /\ is_finite_f32(b). } Prove: (if lt_f32b(a, b) then 1 else 0) = (if (of_f32(a) < of_f32(b)) then 1 else 0). ------------------------------------------------------------ Goal Post-condition 'REL1' in 'cmp_ff': Assume { (* Pre-condition *) Have: is_finite_f32(a) /\ is_finite_f32(b). } Prove: lt_f32(a, b) <-> (of_f32(a) < of_f32(b)). ------------------------------------------------------------ Goal Post-condition 'REL2' in 'cmp_ff': Assume { (* Pre-condition *) Have: is_finite_f32(a) /\ is_finite_f32(b). } Prove: lt_f32(a, b) <-> (of_f32(a) < of_f32(b)). ------------------------------------------------------------ ------------------------------------------------------------ Function cmp_fnan ------------------------------------------------------------ Goal Post-condition 'POS' in 'cmp_fnan': Prove: true. ------------------------------------------------------------ Goal Post-condition 'NEG' in 'cmp_fnan': Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/funvar_inv.0.res.oracle��������������������0000666�0000000�0000000�00000010036�13571573400�024442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Hoare' [...] [kernel] Parsing tests/wp_acsl/funvar_inv.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_acsl/funvar_inv.i:24: Warning: Can not compare pointers in Empty model [wp] tests/wp_acsl/funvar_inv.i:23: Warning: Can not compare pointers in Empty model [wp] tests/wp_acsl/funvar_inv.i:38: Warning: Can not compare pointers in Empty model [wp] tests/wp_acsl/funvar_inv.i:37: Warning: Can not compare pointers in Empty model [wp] tests/wp_acsl/funvar_inv.i:53: Warning: Can not compare pointers in Empty model [wp] tests/wp_acsl/funvar_inv.i:52: Warning: Can not compare pointers in Empty model ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'P_startof' in 'f': tests/wp_acsl/funvar_inv.i:23: warning from Empty Model: - Warning: Target turned to False, looking for context inconsistency Reason: Can not compare pointers in Empty model Let x = G[0]. Assume { Type: is_sint32(i) /\ is_sint32(x) /\ is_sint32(G[1]). If i <= 3 Then { (* Else *) Have: G[i] = 0. } } Prove: x != 0. ------------------------------------------------------------ Goal Post-condition 'P_addr' in 'f': tests/wp_acsl/funvar_inv.i:24: warning from Empty Model: - Warning: Target turned to False, looking for context inconsistency Reason: Can not compare pointers in Empty model Let x = G[0]. Assume { Type: is_sint32(i) /\ is_sint32(x). (* Goal *) When: (x != 0) /\ (G[1] = 0). If i <= 3 Then { (* Else *) Have: G[i] = 0. } } Prove: false. ------------------------------------------------------------ Goal Loop assigns 'qed_ok,index': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f2 ------------------------------------------------------------ Goal Post-condition 'P_startof_shift' in 'f2': tests/wp_acsl/funvar_inv.i:37: warning from Empty Model: - Warning: Target turned to False, looking for context inconsistency Reason: Can not compare pointers in Empty model Let x = G[0]. Assume { Type: is_sint32(i) /\ is_sint32(x) /\ is_sint32(G[1]). If i <= 3 Then { (* Else *) Have: G[i] = 0. } } Prove: x != 0. ------------------------------------------------------------ Goal Post-condition 'P_addr_shift' in 'f2': tests/wp_acsl/funvar_inv.i:38: warning from Empty Model: - Warning: Target turned to False, looking for context inconsistency Reason: Can not compare pointers in Empty model Let x = G[0]. Assume { Type: is_sint32(i) /\ is_sint32(x). (* Goal *) When: (x != 0) /\ (G[1] = 0). If i <= 3 Then { (* Else *) Have: G[i] = 0. } } Prove: false. ------------------------------------------------------------ Goal Loop assigns 'qed_ok,index': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition 'P_addr_startof_shift' in 'g': tests/wp_acsl/funvar_inv.i:52: warning from Empty Model: - Warning: Target turned to False, looking for context inconsistency Reason: Can not compare pointers in Empty model Let x = G[0]. Assume { Type: is_sint32(i) /\ is_sint32(x) /\ is_sint32(G[1]). If i <= 3 Then { (* Else *) Have: G[i] = 0. } } Prove: x != 0. ------------------------------------------------------------ Goal Post-condition 'P_addr_addr_shift' in 'g': tests/wp_acsl/funvar_inv.i:53: warning from Empty Model: - Warning: Target turned to False, looking for context inconsistency Reason: Can not compare pointers in Empty model Let x = G[0]. Assume { Type: is_sint32(i) /\ is_sint32(x). (* Goal *) When: (x != 0) /\ (G[1] = 0). If i <= 3 Then { (* Else *) Have: G[i] = 0. } } Prove: false. ------------------------------------------------------------ Goal Loop assigns 'qed_ok': Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/funvar_inv.1.res.oracle��������������������0000666�0000000�0000000�00000007754�13571573400�024460� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_acsl/funvar_inv.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'P_startof' in 'f': Let a = global(G_G_18). Let a_1 = shift_sint32(a, 0). Assume { Type: is_sint32(v) /\ is_sint32(Mint_0[shift_sint32(a, 1)]). (* Goal *) When: Mint_0[a_1] = 0. (* Heap *) Have: linked(Malloc_0). (* Initializer *) Init: Mint_0[global(L_i_25)] = 0. If v <= 3 Then { (* Else *) Have: Mint_0[f] = 0. Have: shift_sint32(a, v) = f. } Else { Have: global(L_i_25) = f. } } Prove: a_1 = f. ------------------------------------------------------------ Goal Post-condition 'P_addr' in 'f': Let a = global(G_G_18). Let x = Mint_0[shift_sint32(a, 0)]. Let a_1 = shift_sint32(a, 1). Assume { Type: is_sint32(v) /\ is_sint32(x). (* Goal *) When: (x != 0) /\ (Mint_0[a_1] = 0). (* Heap *) Have: linked(Malloc_0). (* Initializer *) Init: Mint_0[global(L_i_25)] = 0. If v <= 3 Then { (* Else *) Have: Mint_0[f] = 0. Have: shift_sint32(a, v) = f. } Else { Have: global(L_i_25) = f. } } Prove: a_1 = f. ------------------------------------------------------------ Goal Loop assigns 'qed_ok,index': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f2 ------------------------------------------------------------ Goal Post-condition 'P_startof_shift' in 'f2': Let a = global(G_G_18). Let a_1 = shift_sint32(a, 0). Assume { Type: is_sint32(v) /\ is_sint32(Mint_0[shift_sint32(a, 1)]). (* Goal *) When: Mint_0[a_1] = 0. (* Heap *) Have: linked(Malloc_0). (* Initializer *) Init: Mint_0[global(L_i_30)] = 0. If v <= 3 Then { (* Else *) Have: Mint_0[f2_0] = 0. Have: shift_sint32(a, v) = f2_0. } Else { Have: global(L_i_30) = f2_0. } } Prove: a_1 = f2_0. ------------------------------------------------------------ Goal Post-condition 'P_addr_shift' in 'f2': Let a = global(G_G_18). Let x = Mint_0[shift_sint32(a, 0)]. Let a_1 = shift_sint32(a, 1). Assume { Type: is_sint32(v) /\ is_sint32(x). (* Goal *) When: (x != 0) /\ (Mint_0[a_1] = 0). (* Heap *) Have: linked(Malloc_0). (* Initializer *) Init: Mint_0[global(L_i_30)] = 0. If v <= 3 Then { (* Else *) Have: Mint_0[f2_0] = 0. Have: shift_sint32(a, v) = f2_0. } Else { Have: global(L_i_30) = f2_0. } } Prove: a_1 = f2_0. ------------------------------------------------------------ Goal Loop assigns 'qed_ok,index': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition 'P_addr_startof_shift' in 'g': Let a = global(G_G_18). Let a_1 = shift_sint32(a, 0). Assume { Type: is_sint32(v) /\ is_sint32(Mint_0[shift_sint32(a, 1)]). (* Goal *) When: Mint_0[a_1] = 0. (* Heap *) Have: linked(Malloc_0). (* Initializer *) Init: Mint_0[global(L_i_35)] = 0. If v <= 3 Then { (* Else *) Have: Mint_0[g] = 0. Have: shift_sint32(a, v) = g. } Else { Have: global(L_i_35) = g. } } Prove: a_1 = g. ------------------------------------------------------------ Goal Post-condition 'P_addr_addr_shift' in 'g': Let a = global(G_G_18). Let x = Mint_0[shift_sint32(a, 0)]. Let a_1 = shift_sint32(a, 1). Assume { Type: is_sint32(v) /\ is_sint32(x). (* Goal *) When: (x != 0) /\ (Mint_0[a_1] = 0). (* Heap *) Have: linked(Malloc_0). (* Initializer *) Init: Mint_0[global(L_i_35)] = 0. If v <= 3 Then { (* Else *) Have: Mint_0[g] = 0. Have: shift_sint32(a, v) = g. } Else { Have: global(L_i_35) = g. } } Prove: a_1 = g. ------------------------------------------------------------ Goal Loop assigns 'qed_ok': Prove: true. ------------------------------------------------------------ ��������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/implicit_enum_cast.res.oracle��������������0000666�0000000�0000000�00000002744�13571573400�026006� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/implicit_enum_cast.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function bar ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/implicit_enum_cast.i, line 6) in 'bar': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'bar' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'bar' (2/3): Call Result at line 10 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'bar' (3/3): Effect at line 10 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'bar' (1/5): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'bar' (2/5): Call Result at line 10 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'bar' (3/5): Effect at line 10 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'bar' (4/5): Call Result at line 11 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'bar' (5/5): Effect at line 11 Prove: true. ------------------------------------------------------------ ����������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/inductive.res.oracle�����������������������0000666�0000000�0000000�00000013515�13571573400�024126� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/inductive.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 3 goals scheduled [wp:print-generated] theory WP (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) predicate P_is_gcd int int int axiom Q_gcd_zero : forall n:int. P_is_gcd n 0 n axiom Q_gcd_succ : forall a:int, b:int, d:int. P_is_gcd b (mod a b) d -> P_is_gcd a b d lemma Q_test_no_label : forall a:int, b:int, d:int. P_is_gcd a b d -> not P_is_gcd b d a (* use frama_c_wp.memory.Memory *) (* use Compound *) predicate P_reachable (int -> int) (addr -> addr) addr addr axiom Q_root_reachable : forall malloc:int -> int, mptr:addr -> addr, root:addr. P_reachable malloc mptr root root axiom Q_next_reachable : forall malloc:int -> int, mptr:addr -> addr, root:addr, node:addr. valid_rw malloc root 2 -> P_reachable malloc mptr (get mptr (shiftfield_F1__list_next root)) node -> P_reachable malloc mptr root node goal wp_goal : forall t:int -> int, t1:addr -> addr, t2:int -> int, t3:addr -> addr, a: addr, a1:addr. P_reachable t2 t3 a a1 -> not P_reachable t t1 a a1 end [wp:print-generated] theory WP1 (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) predicate P_is_gcd1 int int int axiom Q_gcd_zero1 : forall n:int. P_is_gcd1 n 0 n axiom Q_gcd_succ1 : forall a:int, b:int, d:int. P_is_gcd1 b (mod a b) d -> P_is_gcd1 a b d goal wp_goal : forall i:int, i1:int, i2:int. P_is_gcd1 i i1 i2 -> not P_is_gcd1 i1 i2 i end [wp:print-generated] theory WP2 (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.memory.Memory *) (* use Compound *) predicate P_reachable1 (int -> int) (addr -> addr) addr addr axiom Q_root_reachable1 : forall malloc:int -> int, mptr:addr -> addr, root:addr. P_reachable1 malloc mptr root root axiom Q_next_reachable1 : forall malloc:int -> int, mptr:addr -> addr, root:addr, node:addr. valid_rw malloc root 2 -> P_reachable1 malloc mptr (get mptr (shiftfield_F1__list_next root)) node -> P_reachable1 malloc mptr root node lemma Q_test_one_label : forall malloc:int -> int, mptr:addr -> addr, malloc1:int -> int, mptr1: addr -> addr, l1:addr, l2:addr. P_reachable1 malloc1 mptr1 l1 l2 -> not P_reachable1 malloc mptr l1 l2 predicate P_is_gcd2 int int int axiom Q_gcd_zero2 : forall n:int. P_is_gcd2 n 0 n axiom Q_gcd_succ2 : forall a:int, b:int, d:int. P_is_gcd2 b (mod a b) d -> P_is_gcd2 a b d lemma Q_test_no_label1 : forall a:int, b:int, d:int. P_is_gcd2 a b d -> not P_is_gcd2 b d a predicate P_same_array (mint:addr -> int) (mint1:addr -> int) (a:addr) (b: addr) (begin:int) (end1:int) = forall i:int. begin <= i -> i < end1 -> get mint1 (shift_sint32 a i) = get mint (shift_sint32 b i) predicate P_swap (mint:addr -> int) (mint1:addr -> int) (a:addr) (b:addr) (begin:int) (i:int) (j:int) (end1:int) = ((((get mint1 (shift_sint32 a i) = get mint (shift_sint32 b j) /\ get mint1 (shift_sint32 a j) = get mint (shift_sint32 b i)) /\ begin <= i) /\ i < j) /\ j < end1) /\ (forall i1:int. not i1 = i -> not j = i1 -> begin <= i1 -> i1 < end1 -> get mint1 (shift_sint32 a i1) = get mint (shift_sint32 b i1)) predicate P_same_elements (addr -> int) (addr -> int) addr addr int int axiom Q_refl : forall mint:addr -> int, mint1:addr -> int, a:addr, b:addr, begin:int, end1:int. P_same_array mint mint1 a b begin end1 -> P_same_elements mint mint1 a b begin end1 axiom Q_swap : forall mint:addr -> int, mint1:addr -> int, a:addr, b:addr, begin:int, i: int, j:int, end1:int. P_swap mint mint1 a b begin i j end1 -> P_same_elements mint mint1 a b begin end1 axiom Q_trans : forall mint:addr -> int, mint1:addr -> int, mint2:addr -> int, a:addr, b: addr, c:addr, begin:int, end1:int. P_same_elements mint mint1 b c begin end1 -> P_same_elements mint1 mint2 a b begin end1 -> P_same_elements mint mint2 a c begin end1 goal wp_goal : forall t:addr -> int, t1:addr -> int, t2:addr -> int, a:addr, a1:addr, i: int, i1:int, i2:int, i3:int. P_same_elements t1 t2 a a1 i i2 -> not P_same_elements t t1 a1 a i1 i3 end [wp] 3 goals generated ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma test_multilabel: Assume: 'test_one_label' 'test_no_label' Prove: (P_same_elements Mint_1 Mint_2 a_0 b_0 b1_0 e1_0) -> (not (P_same_elements Mint_0 Mint_1 b_0 a_0 b2_0 e2_0)) ------------------------------------------------------------ Lemma test_no_label: Prove: (P_is_gcd a_0 b_0 d_0) -> (not (P_is_gcd b_0 d_0 a_0)) ------------------------------------------------------------ Lemma test_one_label: Assume: 'test_no_label' Prove: (P_reachable Malloc_1 Mptr_1 l1_0 l2_0) -> (not (P_reachable Malloc_0 Mptr_0 l1_0 l2_0)) ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/init_label.res.oracle����������������������0000666�0000000�0000000�00000003320�13571573400�024227� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/init_label.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_acsl/init_label.i:27: Warning: No code nor implicit assigns clause for function main, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function extra ------------------------------------------------------------ Goal Post-condition 'KO' in 'extra': Let x = A[2]. Assume { Type: is_sint32(x). } Prove: x = 12. ------------------------------------------------------------ ------------------------------------------------------------ Function foreign ------------------------------------------------------------ Goal Post-condition 'OK' in 'foreign': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'OK' in 'job': Let x = A[2]. Assume { Type: IsArray1_sint32(A) /\ IsArray1_sint32(A_1) /\ is_sint32(x). (* Initializer *) Init: A_1[0] = 10. (* Initializer *) Init: A_1[1] = 11. (* Initializer *) Init: A_1[2] = 12. (* Initializer *) Init: forall i : Z. ((3 <= i) -> ((i <= 19) -> (A_1[i] = 0))). (* Pre-condition *) Have: EqArray1_int(20, A, A_1). } Prove: x = 12. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition 'OK' in 'main': Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/init_value.0.res.oracle��������������������0000666�0000000�0000000�00000041700�13571573400�024426� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-no-let [...] [kernel] Parsing tests/wp_acsl/init_value.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function fa1 ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'fa1': Let x = ta1_0[4]. Let x_1 = ta1_0[0]. Let x_2 = ta1_0[1]. Let x_3 = ta1_0[3]. Assume { Type: is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(x). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (ta1_0[i] = 0))). (* Initializer *) Init: ta1_0[2] = 1. (* Initializer *) Init: x = 1. (* Initializer *) Init: forall i : Z. ((3 <= i) -> ((i <= 3) -> (ta1_0[i] = 0))). } Prove: (x_2 = x_1) /\ (x_3 = x_2). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa1': Let x = ta1_0[4]. Assume { Type: is_sint32(ta1_0[0]) /\ is_sint32(ta1_0[1]) /\ is_sint32(ta1_0[3]) /\ is_sint32(x). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (ta1_0[i] = 0))). (* Initializer *) Init: ta1_0[2] = 1. (* Initializer *) Init: x = 1. (* Initializer *) Init: forall i : Z. ((3 <= i) -> ((i <= 3) -> (ta1_0[i] = 0))). } Prove: x = 0. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa1': Let x = ta1_0[4]. Let x_1 = ta1_0[3]. Assume { Type: is_sint32(ta1_0[0]) /\ is_sint32(ta1_0[1]) /\ is_sint32(x_1) /\ is_sint32(x). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (ta1_0[i] = 0))). (* Initializer *) Init: ta1_0[2] = 1. (* Initializer *) Init: x = 1. (* Initializer *) Init: forall i : Z. ((3 <= i) -> ((i <= 3) -> (ta1_0[i] = 0))). } Prove: x_1 = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function fa2 ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'fa2': Let x = ta2_0[0]. Let x_1 = ta2_0[1]. Let x_2 = ta2_0[4]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (ta2_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 3) -> (ta2_0[i] = 1))). (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 4) -> (ta2_0[i] = 0))). } Prove: (x_1 = x) /\ (x_2 = x_1). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa2': Let x = ta2_0[4]. Assume { Type: is_sint32(ta2_0[0]) /\ is_sint32(ta2_0[1]) /\ is_sint32(x). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (ta2_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 3) -> (ta2_0[i] = 1))). (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 4) -> (ta2_0[i] = 0))). } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa2': Let x = ta2_0[1]. Assume { Type: is_sint32(ta2_0[0]) /\ is_sint32(x) /\ is_sint32(ta2_0[4]). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (ta2_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 3) -> (ta2_0[i] = 1))). (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 4) -> (ta2_0[i] = 0))). } Prove: x = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function fa3 ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'fa3': Let x = ta1_0[4]. Let x_1 = ta1_0[2]. Let x_2 = ta3_0[0]. Let x_3 = ta3_0[2]. Assume { Type: is_sint32(x_1) /\ is_sint32(x) /\ is_sint32(x_2) /\ is_sint32(x_3). (* Initializer *) Init: forall i : Z. ((i <= 0) -> ((0 <= i) -> (ta3_0[i] = 0))). (* Initializer *) Init: ta3_0[1] = 1. (* Initializer *) Init: ta3_0[3] = 1. (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 2) -> (ta3_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 4) -> (ta3_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (ta1_0[i] = 0))). (* Initializer *) Init: x_1 = 1. (* Initializer *) Init: x = 1. (* Initializer *) Init: forall i : Z. ((3 <= i) -> ((i <= 3) -> (ta1_0[i] = 0))). } Prove: (x = x_1) /\ (x_3 = x_2). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa3': Let x = ta3_0[0]. Assume { Type: is_sint32(x) /\ is_sint32(ta3_0[2]). (* Initializer *) Init: forall i : Z. ((i <= 0) -> ((0 <= i) -> (ta3_0[i] = 0))). (* Initializer *) Init: ta3_0[1] = 1. (* Initializer *) Init: ta3_0[3] = 1. (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 2) -> (ta3_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 4) -> (ta3_0[i] = 0))). } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa3': Let x = ta3_0[2]. Assume { Type: is_sint32(ta3_0[0]) /\ is_sint32(x). (* Initializer *) Init: forall i : Z. ((i <= 0) -> ((0 <= i) -> (ta3_0[i] = 0))). (* Initializer *) Init: ta3_0[1] = 1. (* Initializer *) Init: ta3_0[3] = 1. (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 2) -> (ta3_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 4) -> (ta3_0[i] = 0))). } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa3': Let x = ta2_0[4]. Assume { Type: is_sint32(x). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (ta2_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 3) -> (ta2_0[i] = 1))). (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 4) -> (ta2_0[i] = 0))). } Prove: x = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function fs1 ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'fs1': Let a = ts1_0[2]. Let x = a.F5_c. Let x_1 = a.F5_b. Let x_2 = a.F5_a. Let a_1 = ts1_0[0]. Let a_2 = ts1_0[1]. Let a_3 = ts1_0[3]. Assume { Type: IsS5(a_1) /\ IsS5(a_2) /\ IsS5(a_3) /\ is_sint32(a_1.F5_a) /\ is_sint32(x_2) /\ is_sint32(x_1) /\ is_sint32(x). (* Initializer *) Init: forall i : Z. let a_4 = ts1_0[i] in ((0 <= i) -> ((i <= 1) -> (((a_4.F5_a) = 0) /\ ((a_4.F5_b) = 0) /\ ((a_4.F5_c) = 0)))). (* Initializer *) Init: x_2 = 1. (* Initializer *) Init: x_1 = 1. (* Initializer *) Init: x = 0. (* Initializer *) Init: forall i : Z. let a_4 = ts1_0[i] in ((3 <= i) -> ((i <= 3) -> (((a_4.F5_a) = 0) /\ ((a_4.F5_b) = 0) /\ ((a_4.F5_c) = 0)))). } Prove: (x_1 = x_2) /\ EqS5(a_1, a_2) /\ EqS5(a_2, a_3). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fs1': Let a = ts1_0[2]. Let x = a.F5_c. Let x_1 = a.F5_b. Let x_2 = a.F5_a. Let a_1 = ts1_0[0]. Assume { Type: IsS5(a_1) /\ IsS5(ts1_0[1]) /\ IsS5(ts1_0[3]) /\ is_sint32(a_1.F5_a) /\ is_sint32(x_2) /\ is_sint32(x_1) /\ is_sint32(x). (* Initializer *) Init: forall i : Z. let a_2 = ts1_0[i] in ((0 <= i) -> ((i <= 1) -> (((a_2.F5_a) = 0) /\ ((a_2.F5_b) = 0) /\ ((a_2.F5_c) = 0)))). (* Initializer *) Init: x_2 = 1. (* Initializer *) Init: x_1 = 1. (* Initializer *) Init: x = 0. (* Initializer *) Init: forall i : Z. let a_2 = ts1_0[i] in ((3 <= i) -> ((i <= 3) -> (((a_2.F5_a) = 0) /\ ((a_2.F5_b) = 0) /\ ((a_2.F5_c) = 0)))). } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fs1': Let a = ts1_0[2]. Let x = a.F5_c. Let x_1 = a.F5_b. Let x_2 = a.F5_a. Let a_1 = ts1_0[0]. Let x_3 = a_1.F5_a. Assume { Type: IsS5(a_1) /\ IsS5(ts1_0[1]) /\ IsS5(ts1_0[3]) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ is_sint32(x_1) /\ is_sint32(x). (* Initializer *) Init: forall i : Z. let a_2 = ts1_0[i] in ((0 <= i) -> ((i <= 1) -> (((a_2.F5_a) = 0) /\ ((a_2.F5_b) = 0) /\ ((a_2.F5_c) = 0)))). (* Initializer *) Init: x_2 = 1. (* Initializer *) Init: x_1 = 1. (* Initializer *) Init: x = 0. (* Initializer *) Init: forall i : Z. let a_2 = ts1_0[i] in ((3 <= i) -> ((i <= 3) -> (((a_2.F5_a) = 0) /\ ((a_2.F5_b) = 0) /\ ((a_2.F5_c) = 0)))). } Prove: x_3 = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Struct_Simple_a' in 'main': Let x = s.F1_S_b. Let x_1 = s.F1_S_a. Assume { Type: is_sint32(x_1) /\ is_sint32(x). (* Initializer *) Init: x_1 = 2. (* Initializer *) Init: x = 0. } Prove: x_1 = 2. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Struct_Simple_b' in 'main': Let x = s.F1_S_b. Let x_1 = s.F1_S_a. Assume { Type: is_sint32(x_1) /\ is_sint32(x). (* Initializer *) Init: x_1 = 2. (* Initializer *) Init: x = 0. } Prove: x = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Simple_Array_0' in 'main': Let x = t[0]. Assume { Type: is_sint32(x) /\ is_sint32(t[1]). (* Initializer *) Init: x = 1. (* Initializer *) Init: forall i : Z. ((0 < i) -> ((i <= 1) -> (t[i] = 0))). } Prove: x = 1. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Simple_Array_1' in 'main': Let x = t[0]. Let x_1 = t[1]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Initializer *) Init: x = 1. (* Initializer *) Init: forall i : Z. ((0 < i) -> ((i <= 1) -> (t[i] = 0))). } Prove: x_1 = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,With_Array_Struct_5' in 'main': Let a = st_0.F2_St_tab. Let a_1 = a[3]. Let a_2 = a[5]. Assume { Type: is_sint32(a_1) /\ is_sint32(a_2). (* Initializer *) Init: a[0] = 1. (* Initializer *) Init: a[1] = 2. (* Initializer *) Init: a[2] = 3. (* Initializer *) Init: a_1 = 4. (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 9) -> (a[i] = 0))). } Prove: a_2 = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,With_Array_Struct_3' in 'main': Let a = st_0.F2_St_tab. Let a_1 = a[3]. Assume { Type: is_sint32(a_1) /\ is_sint32(a[5]). (* Initializer *) Init: a[0] = 1. (* Initializer *) Init: a[1] = 2. (* Initializer *) Init: a[2] = 3. (* Initializer *) Init: a_1 = 4. (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 9) -> (a[i] = 0))). } Prove: a_1 = 4. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Sc_eq' in 'main': Let a = sc0_0.F3_Sc_b. Let a_1 = sc1_0.F3_Sc_b. Assume { Type: IsS3_Sc(sc0_0) /\ IsS3_Sc(sc1_0). (* Initializer *) Init: (sc1_0.F3_Sc_a) = 1. (* Initializer *) Init: a_1[0] = 2. (* Initializer *) Init: a_1[1] = 3. (* Initializer *) Init: a_1[2] = 4. (* Initializer *) Init: (sc1_0.F3_Sc_c) = 5. (* Initializer *) Init: (sc0_0.F3_Sc_a) = 1. (* Initializer *) Init: a[0] = 2. (* Initializer *) Init: a[1] = 3. (* Initializer *) Init: a[2] = 4. (* Initializer *) Init: (sc0_0.F3_Sc_c) = 5. } Prove: EqS3_Sc(sc1_0, sc0_0). ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Sc_t' in 'main': Let x = sc2_0.F3_Sc_c. Let a = sc2_0.F3_Sc_b. Let a_1 = a[2]. Assume { Type: is_sint32(x) /\ is_sint32(a_1). (* Initializer *) Init: (sc2_0.F3_Sc_a) = 1. (* Initializer *) Init: a[0] = 2. (* Initializer *) Init: a[1] = 3. (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 2) -> (a[i] = 0))). (* Initializer *) Init: x = 4. } Prove: a_1 = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Sc_t' in 'main': Let x = sc3_0.F3_Sc_c. Let a = sc3_0.F3_Sc_b. Let a_1 = a[2]. Assume { Type: is_sint32(x) /\ is_sint32(a_1). (* Initializer *) Init: (sc3_0.F3_Sc_a) = 1. (* Initializer *) Init: a[0] = 2. (* Initializer *) Init: a[1] = 3. (* Initializer *) Init: a_1 = 4. (* Initializer *) Init: x = 0. } Prove: a_1 = 4. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Sc_c_2' in 'main': Let x = sc2_0.F3_Sc_c. Let a = sc2_0.F3_Sc_b. Assume { Type: is_sint32(x) /\ is_sint32(a[2]). (* Initializer *) Init: (sc2_0.F3_Sc_a) = 1. (* Initializer *) Init: a[0] = 2. (* Initializer *) Init: a[1] = 3. (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 2) -> (a[i] = 0))). (* Initializer *) Init: x = 4. } Prove: x = 4. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Sc_c_3' in 'main': Let x = sc3_0.F3_Sc_c. Let a = sc3_0.F3_Sc_b. Let a_1 = a[2]. Assume { Type: is_sint32(x) /\ is_sint32(a_1). (* Initializer *) Init: (sc3_0.F3_Sc_a) = 1. (* Initializer *) Init: a[0] = 2. (* Initializer *) Init: a[1] = 3. (* Initializer *) Init: a_1 = 4. (* Initializer *) Init: x = 0. } Prove: x = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Tab_no_init' in 'main': Let x = tab_0[5]. Assume { Type: is_uint8(x). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 31) -> (tab_0[i] = 0))). } Prove: x = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,Tab_todo' in 'main': Assume { Type: is_uint8(tab_0[5]). (* Goal *) When: (0 <= i) /\ (i <= 31) /\ is_sint32(i). (* Initializer *) Init: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 31) -> (tab_0[i_1] = 0))). } Prove: tab_0[i] <= 255. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': Let a = sq0_0.F3_Sc_b. Let a_1 = a[1]. Assume { Type: is_sint32(a_1) /\ is_sint32(a[2]). (* Initializer *) Init: (sq0_0.F3_Sc_a) = 2. (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (a[i] = 2))). (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 2) -> (a[i] = 0))). (* Initializer *) Init: (sq0_0.F3_Sc_c) = 2. } Prove: a_1 = 2. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': Let a = sq0_0.F3_Sc_b. Let a_1 = a[2]. Assume { Type: is_sint32(a[1]) /\ is_sint32(a_1). (* Initializer *) Init: (sq0_0.F3_Sc_a) = 2. (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 1) -> (a[i] = 2))). (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 2) -> (a[i] = 0))). (* Initializer *) Init: (sq0_0.F3_Sc_c) = 2. } Prove: a_1 = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': Assume { Type: is_sint32(t1_0[4]). (* Goal *) When: (0 <= i) /\ (i <= 3). (* Initializer *) Init: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 3) -> (t1_0[i_1] = 1))). (* Initializer *) Init: forall i_1 : Z. ((5 <= i_1) -> ((i_1 <= 6) -> (t1_0[i_1] = 2))). (* Initializer *) Init: forall i_1 : Z. ((4 <= i_1) -> ((i_1 <= 4) -> (t1_0[i_1] = 0))). (* Initializer *) Init: forall i_1 : Z. ((7 <= i_1) -> ((i_1 <= 9) -> (t1_0[i_1] = 0))). } Prove: t1_0[i] = 1. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,todo' in 'main': Let x = t1_0[4]. Assume { Type: is_sint32(x). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 3) -> (t1_0[i] = 1))). (* Initializer *) Init: forall i : Z. ((5 <= i) -> ((i <= 6) -> (t1_0[i] = 2))). (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 4) -> (t1_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((7 <= i) -> ((i <= 9) -> (t1_0[i] = 0))). } Prove: x = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': Assume { Type: is_sint32(t1_0[4]). (* Goal *) When: (6 <= i) /\ (i <= 6). (* Initializer *) Init: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 3) -> (t1_0[i_1] = 1))). (* Initializer *) Init: forall i_1 : Z. ((5 <= i_1) -> ((i_1 <= 6) -> (t1_0[i_1] = 2))). (* Initializer *) Init: forall i_1 : Z. ((4 <= i_1) -> ((i_1 <= 4) -> (t1_0[i_1] = 0))). (* Initializer *) Init: forall i_1 : Z. ((7 <= i_1) -> ((i_1 <= 9) -> (t1_0[i_1] = 0))). } Prove: t1_0[i] = 2. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': Assume { Type: is_sint32(t1_0[4]). (* Goal *) When: (7 <= i) /\ (i <= 9). (* Initializer *) Init: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 3) -> (t1_0[i_1] = 1))). (* Initializer *) Init: forall i_1 : Z. ((5 <= i_1) -> ((i_1 <= 6) -> (t1_0[i_1] = 2))). (* Initializer *) Init: forall i_1 : Z. ((4 <= i_1) -> ((i_1 <= 4) -> (t1_0[i_1] = 0))). (* Initializer *) Init: forall i_1 : Z. ((7 <= i_1) -> ((i_1 <= 9) -> (t1_0[i_1] = 0))). } Prove: t1_0[i] = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ok,direct_init_union' in 'main': Let x = u.F4_U_a. Assume { Type: is_sint16(x). (* Initializer *) Init: x = (-1). } Prove: x = (-1). ------------------------------------------------------------ ����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/init_value.1.res.oracle��������������������0000666�0000000�0000000�00000017444�13571573400�024437� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-no-let [...] [kernel] Parsing tests/wp_acsl/init_value.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function fa1 ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'fa1': Let x = ta1_0[0]. Let x_1 = ta1_0[1]. Let x_2 = ta1_0[3]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(ta1_0[4]). } Prove: (x_1 = x) /\ (x_2 = x_1). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa1': Let x = ta1_0[4]. Assume { Type: is_sint32(ta1_0[0]) /\ is_sint32(ta1_0[1]) /\ is_sint32(ta1_0[3]) /\ is_sint32(x). } Prove: x = 0. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa1': Let x = ta1_0[3]. Assume { Type: is_sint32(ta1_0[0]) /\ is_sint32(ta1_0[1]) /\ is_sint32(x) /\ is_sint32(ta1_0[4]). } Prove: x = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function fa2 ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'fa2': Let x = ta2_0[0]. Let x_1 = ta2_0[1]. Let x_2 = ta2_0[4]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). } Prove: (x_1 = x) /\ (x_2 = x_1). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa2': Let x = ta2_0[4]. Assume { Type: is_sint32(ta2_0[0]) /\ is_sint32(ta2_0[1]) /\ is_sint32(x). } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa2': Let x = ta2_0[1]. Assume { Type: is_sint32(ta2_0[0]) /\ is_sint32(x) /\ is_sint32(ta2_0[4]). } Prove: x = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function fa3 ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'fa3': Let x = ta1_0[2]. Let x_1 = ta1_0[4]. Let x_2 = ta3_0[0]. Let x_3 = ta3_0[2]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3). } Prove: (x_1 = x) /\ (x_3 = x_2). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa3': Let x = ta3_0[0]. Assume { Type: is_sint32(x) /\ is_sint32(ta3_0[2]). } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa3': Let x = ta3_0[2]. Assume { Type: is_sint32(ta3_0[0]) /\ is_sint32(x). } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fa3': Let x = ta2_0[4]. Assume { Type: is_sint32(x). } Prove: x = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function fs1 ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'fs1': Let a = ts1_0[0]. Let a_1 = ts1_0[1]. Let a_2 = ts1_0[3]. Let a_3 = ts1_0[2]. Let x = a_3.F5_a. Let x_1 = a_3.F5_b. Assume { Type: IsS5(a) /\ IsS5(a_1) /\ IsS5(a_2) /\ is_sint32(a.F5_a) /\ is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(a_3.F5_c). } Prove: (x_1 = x) /\ EqS5(a, a_1) /\ EqS5(a_1, a_2). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fs1': Let a = ts1_0[0]. Let a_1 = ts1_0[2]. Let x = a_1.F5_c. Assume { Type: IsS5(a) /\ IsS5(ts1_0[1]) /\ IsS5(ts1_0[3]) /\ is_sint32(a.F5_a) /\ is_sint32(a_1.F5_a) /\ is_sint32(a_1.F5_b) /\ is_sint32(x). } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'fs1': Let a = ts1_0[0]. Let x = a.F5_a. Let a_1 = ts1_0[2]. Assume { Type: IsS5(a) /\ IsS5(ts1_0[1]) /\ IsS5(ts1_0[3]) /\ is_sint32(x) /\ is_sint32(a_1.F5_a) /\ is_sint32(a_1.F5_b) /\ is_sint32(a_1.F5_c). } Prove: x = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function main_ko ------------------------------------------------------------ Goal Pre-condition 'qed_ko,Sc_eq_ko' in 'main_ko': Let x = sc2_0.F3_Sc_c. Let a = sc2_0.F3_Sc_b. Let a_1 = sc3_0.F3_Sc_b. Let a_2 = a_1[2]. Assume { Type: IsS3_Sc(sc2_0) /\ IsS3_Sc(sc3_0) /\ is_sint32(x) /\ is_sint32(a_2). (* Initializer *) Init: (sc3_0.F3_Sc_a) = 1. (* Initializer *) Init: a_1[0] = 2. (* Initializer *) Init: a_1[1] = 3. (* Initializer *) Init: a_2 = 4. (* Initializer *) Init: (sc3_0.F3_Sc_c) = 0. (* Initializer *) Init: (sc2_0.F3_Sc_a) = 1. (* Initializer *) Init: a[0] = 2. (* Initializer *) Init: a[1] = 3. (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 2) -> (a[i] = 0))). (* Initializer *) Init: x = 4. } Prove: EqS3_Sc(sc2_0, sc3_0). ------------------------------------------------------------ Goal Pre-condition 'qed_ko,Sc_t' in 'main_ko': Let a = sc3_0.F3_Sc_b. Let a_1 = a[2]. Assume { Type: IsS3_Sc(sc3_0) /\ is_sint32(a_1). (* Initializer *) Init: (sc3_0.F3_Sc_a) = 1. (* Initializer *) Init: a[0] = 2. (* Initializer *) Init: a[1] = 3. (* Initializer *) Init: a_1 = 4. (* Initializer *) Init: (sc3_0.F3_Sc_c) = 0. } Prove: a_1 = 3. ------------------------------------------------------------ Goal Pre-condition 'qed_ko,Sc_c_2' in 'main_ko': Let x = sc2_0.F3_Sc_c. Let a = sc2_0.F3_Sc_b. Assume { Type: IsS3_Sc(sc2_0) /\ is_sint32(x). (* Initializer *) Init: (sc2_0.F3_Sc_a) = 1. (* Initializer *) Init: a[0] = 2. (* Initializer *) Init: a[1] = 3. (* Initializer *) Init: forall i : Z. ((2 <= i) -> ((i <= 2) -> (a[i] = 0))). (* Initializer *) Init: x = 4. } Prove: x = 2. ------------------------------------------------------------ Goal Pre-condition 'qed_ko,Tab_no_init' in 'main_ko': Let x = tab_0[5]. Assume { Type: is_uint8(x). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 31) -> (tab_0[i] = 0))). } Prove: x = 1. ------------------------------------------------------------ Goal Pre-condition 'qed_ko,With_Array_Struct_3' in 'main_ko': Let a = st_0.F2_St_tab. Let a_1 = a[3]. Assume { Type: is_sint32(a_1). (* Initializer *) Init: a[0] = 1. (* Initializer *) Init: a[1] = 2. (* Initializer *) Init: a[2] = 3. (* Initializer *) Init: a_1 = 4. (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 9) -> (a[i] = 0))). } Prove: a_1 = 3. ------------------------------------------------------------ Goal Pre-condition 'qed_ko,Simple_Array_1' in 'main_ko': Let x = t[1]. Assume { Type: is_sint32(x). (* Initializer *) Init: t[0] = 1. (* Initializer *) Init: forall i : Z. ((0 < i) -> ((i <= 1) -> (t[i] = 0))). } Prove: x = 1. ------------------------------------------------------------ Goal Pre-condition 'qed_ko,T1_6' in 'main_ko': Let x = t1_0[6]. Assume { Type: is_sint32(x). (* Initializer *) Init: forall i : Z. ((0 <= i) -> ((i <= 3) -> (t1_0[i] = 1))). (* Initializer *) Init: forall i : Z. ((5 <= i) -> ((i <= 6) -> (t1_0[i] = 2))). (* Initializer *) Init: forall i : Z. ((4 <= i) -> ((i <= 4) -> (t1_0[i] = 0))). (* Initializer *) Init: forall i : Z. ((7 <= i) -> ((i <= 9) -> (t1_0[i] = 0))). } Prove: x = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ko,indirect_init_union_b' in 'main_ko': Let x = u.F4_U_b. Assume { Type: is_sint64(x) /\ is_sint16((u.F4_U_t)[0]). (* Initializer *) Init: (u.F4_U_a) = (-1). } Prove: x = 0. ------------------------------------------------------------ Goal Pre-condition 'qed_ko,indirect_init_union_t' in 'main_ko': Let a = (u.F4_U_t)[0]. Assume { Type: is_sint64(u.F4_U_b) /\ is_sint16(a). (* Initializer *) Init: (u.F4_U_a) = (-1). } Prove: a = 0. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/init_value_mem.0.res.oracle����������������0000666�0000000�0000000�00000002412�13571573400�025261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/init_value_mem.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Post-condition 'P' in 'main': Let a = global(G_v_18). Let a_1 = Load_S1_St(a, Mint_0). Assume { Type: IsS1_St(w) /\ IsS1_St(a_1). (* Initializer *) Init: (w.F1_St_a) = 1. (* Initializer *) Init: (w.F1_St_b) = 2. (* Initializer *) Init: Mint_0[shiftfield_F1_St_a(a)] = 1. (* Initializer *) Init: Mint_0[shiftfield_F1_St_b(a)] = 2. (* Heap *) Have: region(G_v_18) <= 0. } Prove: EqS1_St(a_1, w). ------------------------------------------------------------ Goal Post-condition 'Q' in 'main': Let a = global(G_v_18). Let a_1 = Load_S1_St(a, Mint_0). Assume { Type: IsS1_St(w) /\ IsS1_St(a_1). (* Initializer *) Init: (w.F1_St_a) = 1. (* Initializer *) Init: (w.F1_St_b) = 2. (* Initializer *) Init: Mint_0[shiftfield_F1_St_a(a)] = 1. (* Initializer *) Init: Mint_0[shiftfield_F1_St_b(a)] = 2. (* Heap *) Have: region(G_v_18) <= 0. } Prove: EqS1_St(a_1, w). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/init_value_mem.1.res.oracle����������������0000666�0000000�0000000�00000002213�13571573400�025261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Hoare' [...] [kernel] Parsing tests/wp_acsl/init_value_mem.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_acsl/init_value_mem.i:24: Warning: Can not load value in Empty model ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Post-condition 'P' in 'main': Assume { Type: IsS1_St(v) /\ IsS1_St(w). (* Initializer *) Init: (w.F1_St_a) = 1. (* Initializer *) Init: (w.F1_St_b) = 2. (* Initializer *) Init: (v.F1_St_a) = 1. (* Initializer *) Init: (v.F1_St_b) = 2. } Prove: EqS1_St(v, w). ------------------------------------------------------------ Goal Post-condition 'Q' in 'main': tests/wp_acsl/init_value_mem.i:24: warning from Empty Model: - Warning: Hide sub-term definition Reason: Can not load value in Empty model Assume { Type: IsS1_St(w_1). (* Initializer *) Init: (w_1.F1_St_a) = 1. (* Initializer *) Init: (w_1.F1_St_b) = 2. } Prove: EqS1_St(w, w_1). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/intbool.res.oracle�������������������������0000666�0000000�0000000�00000000713�13571573400�023576� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/intbool.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function bug ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/intbool.i, line 1) in 'bug': Prove: true. ------------------------------------------------------------ �����������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/label_escape.res.oracle��������������������0000666�0000000�0000000�00000001505�13571573400�024527� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/label_escape.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'qed_ko,oracle_ko' (file tests/wp_acsl/label_escape.i, line 12): Assume { Type: is_sint32(x) /\ is_sint32(y). If x != 0 Else { Have: y = 1. } } Prove: y = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Assertion 'qed_ok,ok' (file tests/wp_acsl/label_escape.i, line 25): Prove: true. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/logic.res.oracle���������������������������0000666�0000000�0000000�00000026142�13571573400�023231� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/logic.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_acsl/logic.i:65: Warning: Cast with incompatible pointers types (source: __anonstruct_Buint_4*) (target: uint32*) [wp] tests/wp_acsl/logic.i:49: Warning: Logic cast from struct (Tint2) not implemented yet [wp] tests/wp_acsl/logic.i:50: Warning: Logic cast from struct (Point) not implemented yet [wp] tests/wp_acsl/logic.i:51: Warning: Logic cast to struct (Point) from (int [2]) not implemented yet [wp] tests/wp_acsl/logic.i:52: Warning: Logic cast from struct (Point) not implemented yet [wp] tests/wp_acsl/logic.i:53: Warning: Logic cast from struct (Tint2) not implemented yet [wp] tests/wp_acsl/logic.i:54: Warning: Logic cast from struct (Buint) not implemented yet [wp] tests/wp_acsl/logic.i:55: Warning: Logic cast to struct (Buint) from (unsigned int) not implemented yet [wp] tests/wp_acsl/logic.i:56: Warning: Logic cast from struct (Tint6) not implemented yet [wp] tests/wp_acsl/logic.i:57: Warning: Logic cast to sized array (Triangle) from (int [6]) not implemented yet [wp] tests/wp_acsl/logic.i:58: Warning: Logic cast from struct (Tint6) not implemented yet [wp] tests/wp_acsl/logic.i:59: Warning: Logic cast from struct (Tint6) not implemented yet [wp] tests/wp_acsl/logic.i:60: Warning: Logic cast to sized array (int [2]) from (int [6]) not implemented yet [wp] tests/wp_acsl/logic.i:61: Warning: Logic cast from struct (Tint6) not implemented yet [wp] tests/wp_acsl/logic.i:62: Warning: Logic cast to struct (Tint2) from (int [6]) not implemented yet ------------------------------------------------------------ Function h ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/logic.i, line 21) in 'h': Let a = global(G_t_27). Let m = Array1_S1(shift___anonstruct_Point_1(a, 0), 3, Mint_0). Let m_1 = Array1_S1(a, 3, Mint_0). Assume { Type: IsArray1S1(m_1) /\ IsArray1S1(m). (* Call 'f' *) Have: P_P(m). } Prove: P_P(m_1). ------------------------------------------------------------ Goal Assigns nothing in 'h': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'h': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': Let a = global(G_tr_33). Let a_1 = shift___anonstruct_Point_1(a, 2). Let a_2 = shift___anonstruct_Point_1(a, 1). Let a_3 = shift___anonstruct_Point_1(a, 0). Let a_4 = shiftfield_F4_bytes(global(G_buint_39)). Let m = Array1_S1(a, 3, Mint_0). Assume { Type: IsArray1S1(m) /\ IsArray1S1(Array1_S1(a_3, 3, Mint_0)). (* Initializer *) Init: Mint_0[shift_uint8(a_4, 0)] = 1. (* Initializer *) Init: Mint_0[shift_uint8(a_4, 1)] = 2. (* Initializer *) Init: Mint_0[shift_uint8(a_4, 2)] = 4. (* Initializer *) Init: Mint_0[shift_uint8(a_4, 3)] = 8. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_3)] = 10. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_3)] = 11. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_2)] = 20. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_2)] = 21. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_1)] = 30. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_1)] = 31. (* Heap *) Have: region(G_tr_33) <= 0. } Prove: P_P(m). ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': Let a = global(G_tr_33). Let a_1 = shift___anonstruct_Point_1(a, 2). Let a_2 = shift___anonstruct_Point_1(a, 1). Let a_3 = shift___anonstruct_Point_1(a, 0). Let a_4 = shiftfield_F4_bytes(global(G_buint_39)). Let m = Array1_S1(a, 3, Mint_0). Assume { Type: IsArray1S1(m) /\ IsArray1S1(Array1_S1(a_3, 3, Mint_0)). (* Initializer *) Init: Mint_0[shift_uint8(a_4, 0)] = 1. (* Initializer *) Init: Mint_0[shift_uint8(a_4, 1)] = 2. (* Initializer *) Init: Mint_0[shift_uint8(a_4, 2)] = 4. (* Initializer *) Init: Mint_0[shift_uint8(a_4, 3)] = 8. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_3)] = 10. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_3)] = 11. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_2)] = 20. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_2)] = 21. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_1)] = 30. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_1)] = 31. (* Heap *) Have: region(G_tr_33) <= 0. } Prove: P_P(m). ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': Let a = global(G_tr_33). Let a_1 = shift___anonstruct_Point_1(a, 2). Let a_2 = shift___anonstruct_Point_1(a, 1). Let a_3 = shift___anonstruct_Point_1(a, 0). Let a_4 = shiftfield_F4_bytes(global(G_buint_39)). Let m = Array1_S1(a_3, 3, Mint_0). Assume { Type: IsArray1S1(Array1_S1(a, 3, Mint_0)) /\ IsArray1S1(m). (* Initializer *) Init: Mint_0[shift_uint8(a_4, 0)] = 1. (* Initializer *) Init: Mint_0[shift_uint8(a_4, 1)] = 2. (* Initializer *) Init: Mint_0[shift_uint8(a_4, 2)] = 4. (* Initializer *) Init: Mint_0[shift_uint8(a_4, 3)] = 8. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_3)] = 10. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_3)] = 11. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_2)] = 20. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_2)] = 21. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_1)] = 30. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_1)] = 31. (* Heap *) Have: region(G_tr_33) <= 0. } Prove: P_P(m). ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:49: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast from struct (Tint2) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: (w.F1_y) = 11. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:50: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast from struct (Point) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: (w.F3_tab)[1] = 11. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:51: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast to struct (Point) from (int [2]) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: (w.F1_y) = 11. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:52: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast from struct (Point) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: w[1] = 11. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:53: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast from struct (Tint2) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: w[1] = 11. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:54: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast from struct (Buint) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: w = 134480385. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:55: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast to struct (Buint) from (unsigned int) not implemented yet Let a = global(G_tr_33). Let a_1 = shift___anonstruct_Point_1(a, 2). Let a_2 = shift___anonstruct_Point_1(a, 1). Let a_3 = shift___anonstruct_Point_1(a, 0). Let a_4 = global(G_buint_39). Let a_5 = shiftfield_F4_bytes(a_4). Let a_6 = Load_S4(a_4, Mint_0). Assume { Type: IsS4(a_6). (* Initializer *) Init: Mint_0[shift_uint8(a_5, 0)] = 1. (* Initializer *) Init: Mint_0[shift_uint8(a_5, 1)] = 2. (* Initializer *) Init: Mint_0[shift_uint8(a_5, 2)] = 4. (* Initializer *) Init: Mint_0[shift_uint8(a_5, 3)] = 8. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_3)] = 10. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_3)] = 11. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_2)] = 20. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_2)] = 21. (* Initializer *) Init: Mint_0[shiftfield_F1_x(a_1)] = 30. (* Initializer *) Init: Mint_0[shiftfield_F1_y(a_1)] = 31. (* Heap *) Have: region(G_tr_33) <= 0. } Prove: EqS4(a_6, w). ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:56: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast from struct (Tint6) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: (w[1].F1_y) = 21. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:57: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast to sized array (Triangle) from (int [6]) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: (w[1].F1_y) = 21. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:58: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast from struct (Tint6) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: w[4] = 30. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:59: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast from struct (Tint6) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: w[1] = 11. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:60: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast to sized array (int [2]) from (int [6]) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: w[1] = 11. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:61: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast from struct (Tint6) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: (w.F3_tab)[1] = 11. ------------------------------------------------------------ Goal Pre-condition 'qed_ok' in 'main': tests/wp_acsl/logic.i:62: warning from wp: - Warning: Hide sub-term definition Reason: Logic cast to struct (Tint2) from (int [6]) not implemented yet Assume { (* Heap *) Have: region(G_tr_33) <= 0. } Prove: (w.F3_tab)[1] = 11. ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/looplabels.res.oracle����������������������0000666�0000000�0000000�00000010043�13571573400�024261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/looplabels.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function copy ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/looplabels.i, line 13) in 'copy': Let a_1 = shift_sint32(b, 0). Let a_2 = shift_sint32(a, 0). Assume { Type: is_sint32(i) /\ is_sint32(n). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < n) /\ valid_rw(Malloc_0, a_2, n) /\ valid_rw(Malloc_0, a_1, n) /\ separated(a_2, n, a_1, n). (* Invariant *) Have: P_IsEqual(havoc(Mint_undef_0, Mint_0, a_1, n), a, b, i). (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Else *) Have: n <= i. } Prove: P_IsEqual(havoc(Mint_undef_0, Mint_0, a_1, i), a, b, i). ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_acsl/looplabels.i, line 18): Let a_1 = shift_sint32(b, 0). Let a_2 = shift_sint32(a, 0). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < n) /\ valid_rw(Malloc_0, a_2, n) /\ valid_rw(Malloc_0, a_1, n) /\ separated(a_2, n, a_1, n). (* Invariant *) Have: P_IsEqual(havoc(Mint_undef_0, Mint_0, a_1, n), a, b, i). (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_acsl/looplabels.i, line 18): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_acsl/looplabels.i, line 19): Let a_1 = shift_sint32(b, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, n). Let a_3 = shift_sint32(a, 0). Let x = 1 + i. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < n) /\ valid_rw(Malloc_0, a_3, n) /\ valid_rw(Malloc_0, a_1, n) /\ separated(a_3, n, a_1, n). (* Invariant *) Have: P_IsEqual(a_2, a, b, i). (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: P_IsEqual(a_2[shift_sint32(b, i) <- a_2[shift_sint32(a, i)]], a, b, x). ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_acsl/looplabels.i, line 19): Let a_1 = shift_sint32(a, 0). Let a_2 = shift_sint32(b, 0). Assume { Type: is_sint32(n). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < n) /\ valid_rw(Malloc_0, a_1, n) /\ valid_rw(Malloc_0, a_2, n) /\ separated(a_1, n, a_2, n). } Prove: P_IsEqual(Mint_0, a, b, 0). ------------------------------------------------------------ Goal Loop assigns (file tests/wp_acsl/looplabels.i, line 20) (1/2): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_acsl/looplabels.i, line 20) (2/2): Effect at line 23 Let a_1 = shift_sint32(b, 0). Let a_2 = shift_sint32(a, 0). Let a_3 = shift_sint32(b, i). Assume { Type: is_sint32(i) /\ is_sint32(n). (* Goal *) When: !invalid(Malloc_0, a_3, 1). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < n) /\ valid_rw(Malloc_0, a_2, n) /\ valid_rw(Malloc_0, a_1, n) /\ separated(a_2, n, a_1, n). (* Invariant *) Have: P_IsEqual(havoc(Mint_undef_0, Mint_0, a_1, n), a, b, i). (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: included(a_3, 1, a_1, n). ------------------------------------------------------------ Goal Assigns (file tests/wp_acsl/looplabels.i, line 14) in 'copy': Effect at line 22 Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/null.res.oracle����������������������������0000666�0000000�0000000�00000001560�13571573400�023103� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/null.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma valid_non_null: Prove: not (valid_rw Malloc_0 null 1) ------------------------------------------------------------ Lemma valid_read_non_null: Assume: 'valid_non_null' Prove: not (valid_rd Malloc_0 null 1) ------------------------------------------------------------ ------------------------------------------------------------ Function null_is_zero ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/null.c, line 4) in 'null_is_zero': Prove: true. ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/pointer.res.oracle�������������������������0000666�0000000�0000000�00000017604�13571573400�023617� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/pointer.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_acsl/pointer.i:50: Warning: Uncomparable locations p_0 and mem:t.(0) [wp] tests/wp_acsl/pointer.i:49: Warning: Uncomparable locations p_0 and mem:t.(0) [wp] tests/wp_acsl/pointer.i:48: Warning: Uncomparable locations p_0 and mem:t.(0) [wp] tests/wp_acsl/pointer.i:47: Warning: Uncomparable locations p_0 and mem:t.(0) [wp] tests/wp_acsl/pointer.i:46: Warning: Uncomparable locations p_0 and mem:t.(0) [wp] tests/wp_acsl/pointer.i:45: Warning: Uncomparable locations p_0 and mem:t.(0) ------------------------------------------------------------ Function absurd ------------------------------------------------------------ Goal Post-condition 'qed_ko,Base_oracle_ko' in 'absurd': Assume { (* Goal *) When: q.offset < p.offset. (* Heap *) Have: (region(G_t_19) <= 0) /\ (region(q.base) <= 0). (* Pre-condition *) Have: p.base = G_t_19. } Prove: addr_lt(q, p). ------------------------------------------------------------ Goal Post-condition 'qed_ko,Comp_oracle_ko' in 'absurd': Assume { (* Goal *) When: i_1 <= i. (* Heap *) Have: (region(G_t_19) <= 0) /\ (region(q.base) <= 0). (* Pre-condition *) Have: p.base = G_t_19. } Prove: i <= i_1. ------------------------------------------------------------ ------------------------------------------------------------ Function array ------------------------------------------------------------ Goal Post-condition 'Lt' in 'array': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Le' in 'array': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Eq' in 'array': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function compare ------------------------------------------------------------ Goal Post-condition 'qed_ok,Lt' in 'compare': Let x = q.base. Let x_1 = p.base. Assume { (* Goal *) When: q.offset < p.offset. (* Heap *) Have: (region(x_1) <= 0) /\ (region(x) <= 0). (* Pre-condition *) Have: x = x_1. } Prove: addr_lt(q, p). ------------------------------------------------------------ Goal Post-condition 'qed_ok,Le' in 'compare': Let x = q.base. Let x_1 = p.base. Assume { (* Goal *) When: q.offset <= p.offset. (* Heap *) Have: (region(x_1) <= 0) /\ (region(x) <= 0). (* Pre-condition *) Have: x = x_1. } Prove: addr_le(q, p). ------------------------------------------------------------ Goal Post-condition 'qed_ok,Eq' in 'compare': Let x = q.base. Let x_1 = p.base. Assume { (* Goal *) When: q.offset = p.offset. (* Heap *) Have: (region(x_1) <= 0) /\ (region(x) <= 0). (* Pre-condition *) Have: x = x_1. } Prove: q = p. ------------------------------------------------------------ ------------------------------------------------------------ Function mixed_array_pointer ------------------------------------------------------------ Goal Post-condition 'qed_ok,Lt' in 'mixed_array_pointer': tests/wp_acsl/pointer.i:45: warning from Reference Variable Model: - Warning: Hide sub-term definition Reason: Uncomparable locations p_0 and mem:t.(0) Assume { (* Goal *) When: 0 < w. (* Heap *) Have: region(G_t_19) <= 0. (* Pre-condition *) Have: p.base = G_t_19. } Prove: addr_lt(shift_sint32(global(G_t_19), 0), p). ------------------------------------------------------------ Goal Post-condition 'qed_ok,Le' in 'mixed_array_pointer': tests/wp_acsl/pointer.i:46: warning from Reference Variable Model: - Warning: Hide sub-term definition Reason: Uncomparable locations p_0 and mem:t.(0) Assume { (* Goal *) When: 0 <= w. (* Heap *) Have: region(G_t_19) <= 0. (* Pre-condition *) Have: p.base = G_t_19. } Prove: addr_le(shift_sint32(global(G_t_19), 0), p). ------------------------------------------------------------ Goal Post-condition 'qed_ok,Eq' in 'mixed_array_pointer': tests/wp_acsl/pointer.i:47: warning from Reference Variable Model: - Warning: Hide sub-term definition Reason: Uncomparable locations p_0 and mem:t.(0) Assume { (* Heap *) Have: region(G_t_19) <= 0. (* Pre-condition *) Have: p.base = G_t_19. } Prove: shift_sint32(global(G_t_19), 0) = p. ------------------------------------------------------------ Goal Post-condition 'qed_ok,Ne' in 'mixed_array_pointer': tests/wp_acsl/pointer.i:48: warning from Reference Variable Model: - Warning: Hide sub-term definition Reason: Uncomparable locations p_0 and mem:t.(0) Assume { (* Goal *) When: w != 0. (* Heap *) Have: region(G_t_19) <= 0. (* Pre-condition *) Have: p.base = G_t_19. } Prove: shift_sint32(global(G_t_19), 0) != p. ------------------------------------------------------------ Goal Post-condition 'qed_ko,Le_oracle_ko' in 'mixed_array_pointer': tests/wp_acsl/pointer.i:49: warning from Reference Variable Model: - Warning: Hide sub-term definition Reason: Uncomparable locations p_0 and mem:t.(0) Assume { (* Goal *) When: 0 <= w. (* Heap *) Have: region(G_t_19) <= 0. (* Pre-condition *) Have: p.base = G_t_19. } Prove: addr_lt(shift_sint32(global(G_t_19), 0), p). ------------------------------------------------------------ Goal Post-condition 'qed_ko,Lt_oracle_ko' in 'mixed_array_pointer': tests/wp_acsl/pointer.i:50: warning from Reference Variable Model: - Warning: Hide sub-term definition Reason: Uncomparable locations p_0 and mem:t.(0) Assume { (* Goal *) When: 0 < w. (* Heap *) Have: region(G_t_19) <= 0. (* Pre-condition *) Have: p.base = G_t_19. } Prove: addr_le(p, shift_sint32(global(G_t_19), 0)). ------------------------------------------------------------ ------------------------------------------------------------ Function null ------------------------------------------------------------ Goal Post-condition 'qed_ok,Bool' in 'null': Let x = int_of_addr(p). Assume { Type: is_sint32(x). (* Heap *) Have: region(p.base) <= 0. } Prove: (x != 0) <-> (null != p). ------------------------------------------------------------ Goal Post-condition 'qed_ok,NotNull' in 'null': Let x = int_of_addr(p). Assume { Type: is_sint32(x). (* Goal *) When: null != p. (* Heap *) Have: region(p.base) <= 0. } Prove: x != 0. ------------------------------------------------------------ Goal Post-condition 'qed_ok,IsNull' in 'null': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function pointer ------------------------------------------------------------ Goal Post-condition 'qed_ok,Lt' in 'pointer': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,Le' in 'pointer': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,Eq' in 'pointer': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,Eq_0' in 'pointer': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,Eq_0_bis' in 'pointer': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ko,Le_oracle_ko' in 'pointer': Assume { (* Goal *) When: i <= i_1. (* Heap *) Have: region(p.base) <= 0. } Prove: i < i_1. ------------------------------------------------------------ Goal Post-condition 'qed_ko,Eq_oracle_ko' in 'pointer': Assume { (* Heap *) Have: region(p.base) <= 0. } Prove: false. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'compare': /*@ behavior typed: requires \separated(&p,q+(..)); */ void compare(int *q); [wp] Warning: Memory model hypotheses for function 'absurd': /*@ behavior typed: requires \separated(&p,q+(..)); */ void absurd(int *q); ����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/post_result.res.oracle���������������������0000666�0000000�0000000�00000001562�13571573400�024516� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/post_result.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function correct ------------------------------------------------------------ Goal Assertion 'OK' (file tests/wp_acsl/post_result.i, line 16): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function wrong ------------------------------------------------------------ Goal Assertion 'KO' (file tests/wp_acsl/post_result.i, line 22): Let a = shift_sint32(global(G_a_18), 1). Let x = Mint_0[a]. Let x_1 = Mint_undef_0[a]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). } Prove: x_1 = x. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/precedence.res.oracle����������������������0000666�0000000�0000000�00000074617�13571573400�024243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/precedence.i (no preprocessing) [kernel:annot-error] tests/wp_acsl/precedence.i:90: Warning: unexpected token ';' [kernel:annot-error] tests/wp_acsl/precedence.i:135: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:134: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:133: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:132: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:130: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:129: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:128: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:127: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:125: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:124: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:123: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:122: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:120: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:119: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:118: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:175: Warning: R is not a logic variable. Ignoring code annotation [kernel:annot-error] tests/wp_acsl/precedence.i:176: Warning: P is not a logic variable. Ignoring code annotation [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function bitwise ------------------------------------------------------------ Goal Post-condition 'r_precedence_and_xor' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_and_xor' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_xor_and' in 'bitwise': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: lxor(r, land(p, q)) = land(p, lxor(q, r)). ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_xor_and' in 'bitwise': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: lxor(p, land(q, r)) = land(r, lxor(p, q)). ------------------------------------------------------------ Goal Post-condition 'r_precedence_xor_or' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_xor_or' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_or_xor' in 'bitwise': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: lxor(p, lor(q, r)) = lor(r, lxor(p, q)). ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_or_xor' in 'bitwise': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: lxor(r, lor(p, q)) = lor(p, lxor(q, r)). ------------------------------------------------------------ Goal Post-condition 'r_precedence_or_implies' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_or_implies' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_implies_or' in 'bitwise': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: lor(r, lnot(lor(p, q))) = lor(p, lor(r, lnot(q))). ------------------------------------------------------------ Goal Post-condition 'ok,r_precedence_implies_or' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok,since' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'r_assoc_implies' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_assoc_implies' in 'bitwise': Let x = lnot(p). Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: lor(r, lnot(lor(q, x))) = lor(r, lor(x, lnot(q))). ------------------------------------------------------------ Goal Post-condition 'r_precedence_implies_equiv' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_implies_equiv' in 'bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_equiv_implies' in 'bitwise': Let x = lnot(p). Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: lxor(r, lnot(lor(q, x))) = lor(lxor(r, lnot(q)), x). ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_equiv_implies' in 'bitwise': Let x = lnot(p). Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: lor(r, lnot(lxor(q, x))) = lxor(lor(r, lnot(q)), x). ------------------------------------------------------------ ------------------------------------------------------------ Function comparison ------------------------------------------------------------ Goal Post-condition 'chainable_lt_lt' in 'comparison': Prove: true. ------------------------------------------------------------ Goal Post-condition 'chainable_le_le' in 'comparison': Prove: true. ------------------------------------------------------------ Goal Post-condition 'chainable_gt_gt' in 'comparison': Prove: true. ------------------------------------------------------------ Goal Post-condition 'chainable_ge_ge' in 'comparison': Prove: true. ------------------------------------------------------------ Goal Post-condition 'chainable_eq_eq' in 'comparison': Prove: true. ------------------------------------------------------------ Goal Post-condition 'r_precedence_eq_and' in 'comparison': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_eq_and' in 'comparison': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_and_eq' in 'comparison': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: ((q = p) /\ (r != 0)) <-> (((q != 0) /\ (r != 0)) <-> (p != 0)). ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_and_eq' in 'comparison': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: ((p != 0) /\ (r = q)) <-> (((p != 0) /\ (q != 0)) <-> (r != 0)). ------------------------------------------------------------ Goal Post-condition 'ko,l_nonassoc_eq' in 'comparison': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: ((q = p) /\ (r = q)) <-> ((r != 0) <-> (q = p)). ------------------------------------------------------------ Goal Post-condition 'ko,r_nonassoc_eq' in 'comparison': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: ((q = p) /\ (r = q)) <-> ((r = q) <-> (p != 0)). ------------------------------------------------------------ Goal Post-condition 'r_precedence_neq_and' in 'comparison': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_neq_and' in 'comparison': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_and_neq' in 'comparison': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: ((q != p) /\ (r != 0)) <-> (!(((q != 0) /\ (r != 0)) <-> (p != 0))). ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_and_neq' in 'comparison': Assume { Type: is_sint32(p) /\ is_sint32(q) /\ is_sint32(r). } Prove: ((p != 0) /\ (r != q)) <-> (!(((p != 0) /\ (q != 0)) <-> (r != 0))). ------------------------------------------------------------ ------------------------------------------------------------ Function predicate ------------------------------------------------------------ Goal Post-condition 'r_precedence_and_xor' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_and_xor' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_xor_and' in 'predicate': Prove: (P_P /\ (!(P_R <-> P_Q))) <-> (!((P_P /\ P_Q) <-> P_R)). ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_xor_and' in 'predicate': Prove: (P_R /\ (!(P_Q <-> P_P))) <-> (!((P_Q /\ P_R) <-> P_P)). ------------------------------------------------------------ Goal Post-condition 'r_precedence_xor_or' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_xor_or' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_or_xor' in 'predicate': Prove: (P_R \/ (!(P_Q <-> P_P))) <-> (!((P_Q \/ P_R) <-> P_P)). ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_or_xor' in 'predicate': Prove: (P_P \/ (!(P_R <-> P_Q))) <-> (!((P_P \/ P_Q) <-> P_R)). ------------------------------------------------------------ Goal Post-condition 'r_precedence_or_implies' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_or_implies' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_implies_or' in 'predicate': Prove: (P_P \/ ((P_Q -> P_R))) <-> (((P_P \/ P_Q) -> P_R)). ------------------------------------------------------------ Goal Post-condition 'ok,r_precedence_implies_or' in 'predicate': Prove: (P_R \/ ((P_P -> P_Q))) <-> ((P_P -> (P_Q \/ P_R))). ------------------------------------------------------------ Goal Post-condition 'ok,since' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'r_assoc_implies' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_assoc_implies' in 'predicate': Prove: ((((P_P -> P_Q)) -> P_R)) <-> ((P_P -> (P_Q -> P_R))). ------------------------------------------------------------ Goal Post-condition 'r_precedence_implies_equiv' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_implies_equiv' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_equiv_implies' in 'predicate': Prove: ((P_P -> (P_R <-> P_Q))) <-> (((P_P -> P_Q)) <-> P_R). ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_equiv_implies' in 'predicate': Prove: (((P_Q <-> P_P) -> P_R)) <-> (((P_Q -> P_R)) <-> P_P). ------------------------------------------------------------ Goal Post-condition 'r_precedence_equiv_ite' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'm_precedence_equiv_ite' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_equiv_ite' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_ite_equiv' in 'predicate': Prove: ((((P_Q <-> P_P) -> P_R)) /\ (((!(P_Q <-> P_P)) -> P_S))) <-> ((((P_Q -> P_R)) /\ (((!P_Q) -> P_S))) <-> P_P). ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_ite_equiv' in 'predicate': Prove: (((P_P -> P_Q)) /\ (((!P_P) -> (P_S <-> P_R)))) <-> ((((P_P -> P_Q)) /\ (((!P_P) -> P_R))) <-> P_S). ------------------------------------------------------------ Goal Post-condition 'r_assoc_ite' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_assoc_ite' in 'predicate': Prove: (((((P_P -> P_Q)) -> ((((!P_P) -> P_R)) -> P_S))) /\ ((((P_P /\ (!P_Q)) \/ ((!P_P) /\ (!P_R))) -> P_U))) <-> (((P_P -> P_Q)) /\ (((!P_P) -> (((P_R -> P_S)) /\ (((!P_R) -> P_U)))))). ------------------------------------------------------------ Goal Post-condition 'r_precedence_ite_forall' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'm_precedence_ite_forall' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_ite_forall' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_forall_ite' in 'predicate': Assume { Type: is_sint32(x). } Prove: (forall i : Z. ((P_Px(i) -> P_Qx(i))) /\ (((!P_Px(i)) -> P_Rx(i)))) <-> ((((forall i : Z. P_Px(i)) -> P_Qx(x))) /\ (((exists i : Z. !P_Px(i)) -> P_Rx(x)))). ------------------------------------------------------------ Goal Post-condition 'ko,m_precedence_forall_ite' in 'predicate': Assume { Type: is_sint32(x). } Prove: ((((!P_Px(x)) -> P_Rx(x))) /\ ((P_Px(x) -> (forall i : Z. P_Qx(i))))) <-> (((P_Px(x) -> P_Qx(x))) /\ (((!P_Px(x)) -> P_Rx(x)))). ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_forall_ite' in 'predicate': Assume { Type: is_sint32(x). } Prove: (((P_Px(x) -> P_Qx(x))) /\ (((!P_Px(x)) -> (forall i : Z. P_Rx(i))))) <-> (((P_Px(x) -> P_Qx(x))) /\ (((!P_Px(x)) -> P_Rx(x)))). ------------------------------------------------------------ Goal Post-condition 'r_assoc_forall' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_assoc_forall' in 'predicate': Prove: (forall i_1,i : Z. P_Pxy(i_1, i)) <-> (forall i : Z. P_Pxy(i, i)). ------------------------------------------------------------ Goal Post-condition 'r_precedence_ite_exists' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'm_precedence_ite_exists' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_ite_exists' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_exists_ite' in 'predicate': Assume { Type: is_sint32(x). } Prove: (exists i : Z. ((P_Px(i) -> P_Qx(i))) /\ (((!P_Px(i)) -> P_Rx(i)))) <-> ((((exists i : Z. P_Px(i)) -> P_Qx(x))) /\ (((forall i : Z. !P_Px(i)) -> P_Rx(x)))). ------------------------------------------------------------ Goal Post-condition 'ko,m_precedence_exists_ite' in 'predicate': Assume { Type: is_sint32(x). } Prove: ((((!P_Px(x)) -> P_Rx(x))) /\ ((P_Px(x) -> (exists i : Z. P_Qx(i))))) <-> (((P_Px(x) -> P_Qx(x))) /\ (((!P_Px(x)) -> P_Rx(x)))). ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_exists_ite' in 'predicate': Assume { Type: is_sint32(x). } Prove: (((P_Px(x) -> P_Qx(x))) /\ (((!P_Px(x)) -> (exists i : Z. P_Rx(i))))) <-> (((P_Px(x) -> P_Qx(x))) /\ (((!P_Px(x)) -> P_Rx(x)))). ------------------------------------------------------------ Goal Post-condition 'r_assoc_exist' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_assoc_exist' in 'predicate': Prove: (exists i_1,i : Z. P_Pxy(i_1, i)) <-> (exists i : Z. P_Pxy(i, i)). ------------------------------------------------------------ Goal Post-condition 'r_precedence_ite_let' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'm_precedence_ite_let' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_ite_let' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,r_precedence_let_ite' in 'predicate': Assume { Type: is_sint32(a) /\ is_sint32(x). } Prove: (((P_Px(a) -> P_Qx(x))) /\ (((!P_Px(a)) -> P_Rx(x)))) <-> (((P_Px(a) -> P_Qx(a))) /\ (((!P_Px(a)) -> P_Rx(a)))). ------------------------------------------------------------ Goal Post-condition 'ko,m_precedence_let_ite' in 'predicate': Assume { Type: is_sint32(a) /\ is_sint32(x). } Prove: (((P_Px(x) -> P_Qx(x))) /\ (((!P_Px(x)) -> P_Rx(x)))) <-> (((P_Px(x) -> P_Qx(a))) /\ (((!P_Px(x)) -> P_Rx(x)))). ------------------------------------------------------------ Goal Post-condition 'ko,l_precedence_let_ite' in 'predicate': Assume { Type: is_sint32(a) /\ is_sint32(x). } Prove: (((P_Px(x) -> P_Qx(x))) /\ (((!P_Px(x)) -> P_Rx(x)))) <-> (((P_Px(x) -> P_Qx(x))) /\ (((!P_Px(x)) -> P_Rx(a)))). ------------------------------------------------------------ Goal Post-condition 'r_assoc_let' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'scope_let' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'scope_let' in 'predicate': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko,l_assoc_naming' in 'predicate': Prove: (((P_P -> P_R)) /\ (((!P_P) -> P_S))) <-> (((P_P -> P_Q)) /\ (((!P_P) -> P_S))). ------------------------------------------------------------ Goal Post-condition 'r_precedence_ite_naming' in 'predicate': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function predicate_bitwise ------------------------------------------------------------ Goal Post-condition 'r_precedence_equiv_Pand' in 'predicate_bitwise': Prove: true. ------------------------------------------------------------ Goal Post-condition 'l_precedence_equiv_Pand' in 'predicate_bitwise': Prove: true. ------------------------------------------------------------ /* Generated by Frama-C */ /*@ axiomatic Pred { predicate P; predicate Q; predicate R; predicate S; predicate U; } */ /*@ axiomatic PredX { predicate Px(ℤ x) ; predicate Qx(ℤ x) ; predicate Rx(ℤ x) ; } */ /*@ axiomatic PredXY { predicate Pxy(ℤ x, ℤ y) ; predicate Qxy(ℤ x, ℤ y) ; } */ /*@ ensures r_precedence_and_xor: (P ∧ Q) ⊻ R ⇔ (P ∧ Q) ⊻ R; ensures l_precedence_and_xor: P ⊻ (Q ∧ R) ⇔ P ⊻ (Q ∧ R); ensures ko: l_precedence_xor_and: (P ∧ Q) ⊻ R ⇔ P ∧ (Q ⊻ R); ensures ko: r_precedence_xor_and: P ⊻ (Q ∧ R) ⇔ (P ⊻ Q) ∧ R; ensures r_precedence_xor_or: (P ⊻ Q) ∨ R ⇔ (P ⊻ Q) ∨ R; ensures l_precedence_xor_or: P ∨ (Q ⊻ R) ⇔ P ∨ (Q ⊻ R); ensures ko: l_precedence_or_xor: (P ⊻ Q) ∨ R ⇔ P ⊻ (Q ∨ R); ensures ko: r_precedence_or_xor: P ∨ (Q ⊻ R) ⇔ (P ∨ Q) ⊻ R; ensures r_precedence_or_implies: P ∨ Q ⇒ R ⇔ P ∨ Q ⇒ R; ensures l_precedence_or_implies: P ⇒ Q ∨ R ⇔ P ⇒ Q ∨ R; ensures ko: l_precedence_implies_or: P ∨ Q ⇒ R ⇔ P ∨ (Q ⇒ R); ensures ok: r_precedence_implies_or: P ⇒ Q ∨ R ⇔ (P ⇒ Q) ∨ R; ensures ok: since: (P ⇒ Q) ∨ R ⇔ (P ⇒ Q) ∨ R; ensures r_assoc_implies: P ⇒ Q ⇒ R ⇔ P ⇒ Q ⇒ R; ensures ko: l_assoc_implies: P ⇒ Q ⇒ R ⇔ (P ⇒ Q) ⇒ R; ensures r_precedence_implies_equiv: P ⇒ Q ⇔ R ⇔ P ⇒ Q ⇔ R; ensures l_precedence_implies_equiv: P ⇔ Q ⇒ R ⇔ P ⇔ Q ⇒ R; ensures ko: r_precedence_equiv_implies: P ⇒ Q ⇔ R ⇔ P ⇒ (Q ⇔ R); ensures ko: l_precedence_equiv_implies: P ⇔ Q ⇒ R ⇔ (P ⇔ Q) ⇒ R; ensures r_precedence_equiv_ite: ((P ⇔ Q) ⇒ R) ∧ (¬(P ⇔ Q) ⇒ S) ⇔ ((P ⇔ Q) ⇒ R) ∧ (¬(P ⇔ Q) ⇒ S); ensures m_precedence_equiv_ite: (P ⇒ (Q ⇔ R)) ∧ (¬P ⇒ S) ⇔ (P ⇒ (Q ⇔ R)) ∧ (¬P ⇒ S); ensures l_precedence_equiv_ite: (P ⇒ Q) ∧ (¬P ⇒ (R ⇔ S)) ⇔ (P ⇒ Q) ∧ (¬P ⇒ (R ⇔ S)); ensures ko: r_precedence_ite_equiv: ((P ⇔ Q) ⇒ R) ∧ (¬(P ⇔ Q) ⇒ S) ⇔ P ⇔ (Q ⇒ R) ∧ (¬Q ⇒ S); ensures ko: l_precedence_ite_equiv: (P ⇒ Q) ∧ (¬P ⇒ (R ⇔ S)) ⇔ (P ⇒ Q) ∧ (¬P ⇒ R) ⇔ S; ensures r_assoc_ite: (P ⇒ Q) ∧ (¬P ⇒ (R ⇒ S) ∧ (¬R ⇒ U)) ⇔ (P ⇒ Q) ∧ (¬P ⇒ (R ⇒ S) ∧ (¬R ⇒ U)); ensures ko: l_assoc_ite: (P ⇒ Q) ∧ (¬P ⇒ (R ⇒ S) ∧ (¬R ⇒ U)) ⇔ ((P ⇒ Q) ∧ (¬P ⇒ R) ⇒ S) ∧ (¬((P ⇒ Q) ∧ (¬P ⇒ R)) ⇒ U); ensures r_precedence_ite_forall: (∀ ℤ x; (Px(x) ⇒ Qx(x)) ∧ (¬Px(x) ⇒ Rx(x))) ⇔ (∀ ℤ y; (Px(y) ⇒ Qx(y)) ∧ (¬Px(y) ⇒ Rx(y))); ensures m_precedence_ite_forall: (Px(\old(x)) ⇒ (∀ ℤ x; Qx(x))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))) ⇔ (Px(\old(x)) ⇒ (∀ ℤ y; Qx(y))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))); ensures l_precedence_ite_forall: (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (∀ ℤ x; Rx(x))) ⇔ (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (∀ ℤ y; Rx(y))); ensures ko: r_precedence_forall_ite: (∀ ℤ x; (Px(x) ⇒ Qx(x)) ∧ (¬Px(x) ⇒ Rx(x))) ⇔ ((∀ ℤ y; Px(y)) ⇒ Qx(\old(x))) ∧ (¬(∀ ℤ y; Px(y)) ⇒ Rx(\old(x))); ensures ko: m_precedence_forall_ite: (Px(\old(x)) ⇒ (∀ ℤ x; Qx(x))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))) ⇔ (Px(\old(x)) ⇒ (∀ ℤ y; Qx(\old(x)))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))); ensures ko: l_precedence_forall_ite: (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (∀ ℤ x; Rx(x))) ⇔ (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (∀ ℤ y; Rx(\old(x)))); ensures r_assoc_forall: (∀ ℤ x; ∀ ℤ x; Pxy(x, x)) ⇔ (∀ ℤ x; Pxy(x, x)); ensures ko: r_assoc_forall: (∀ ℤ x; ∀ ℤ y; Pxy(x, y)) ⇔ (∀ ℤ x; Pxy(x, x)); ensures r_precedence_ite_exists: (∃ ℤ x; (Px(x) ⇒ Qx(x)) ∧ (¬Px(x) ⇒ Rx(x))) ⇔ (∃ ℤ y; (Px(y) ⇒ Qx(y)) ∧ (¬Px(y) ⇒ Rx(y))); ensures m_precedence_ite_exists: (Px(\old(x)) ⇒ (∃ ℤ x; Qx(x))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))) ⇔ (Px(\old(x)) ⇒ (∃ ℤ y; Qx(y))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))); ensures l_precedence_ite_exists: (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (∃ ℤ x; Rx(x))) ⇔ (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (∃ ℤ y; Rx(y))); ensures ko: r_precedence_exists_ite: (∃ ℤ x; (Px(x) ⇒ Qx(x)) ∧ (¬Px(x) ⇒ Rx(x))) ⇔ ((∃ ℤ y; Px(y)) ⇒ Qx(\old(x))) ∧ (¬(∃ ℤ y; Px(y)) ⇒ Rx(\old(x))); ensures ko: m_precedence_exists_ite: (Px(\old(x)) ⇒ (∃ ℤ x; Qx(x))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))) ⇔ (Px(\old(x)) ⇒ (∃ ℤ y; Qx(\old(x)))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))); ensures ko: l_precedence_exists_ite: (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (∃ ℤ x; Rx(x))) ⇔ (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (∃ ℤ y; Rx(\old(x)))); ensures r_assoc_exist: (∃ ℤ x; ∃ ℤ x; Pxy(x, x)) ⇔ (∃ ℤ x; Pxy(x, x)); ensures ko: r_assoc_exist: (∃ ℤ x; ∃ ℤ y; Pxy(x, y)) ⇔ (∃ ℤ x; Pxy(x, x)); ensures r_precedence_ite_let: (\let x = \old(a); (Px(x) ⇒ Qx(x)) ∧ (¬Px(x) ⇒ Rx(x))) ⇔ (\let y = \old(a); (Px(y) ⇒ Qx(y)) ∧ (¬Px(y) ⇒ Rx(y))); ensures m_precedence_ite_let: (Px(\old(x)) ⇒ (\let x = \old(a); Qx(x))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))) ⇔ (Px(\old(x)) ⇒ (\let y = \old(a); Qx(y))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))); ensures l_precedence_ite_let: (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (\let x = \old(a); Rx(x))) ⇔ (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (\let y = \old(a); Rx(y))); ensures ko: r_precedence_let_ite: (\let x = \old(a); (Px(x) ⇒ Qx(x)) ∧ (¬Px(x) ⇒ Rx(x))) ⇔ ((\let y = \old(a); Px(y)) ⇒ Qx(\old(x))) ∧ (¬(\let y = \old(a); Px(y)) ⇒ Rx(\old(x))); ensures ko: m_precedence_let_ite: (Px(\old(x)) ⇒ (\let x = \old(a); Qx(x))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))) ⇔ (Px(\old(x)) ⇒ (\let y = \old(a); Qx(\old(x)))) ∧ (¬Px(\old(x)) ⇒ Rx(\old(x))); ensures ko: l_precedence_let_ite: (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (\let x = \old(a); Rx(x))) ⇔ (Px(\old(x)) ⇒ Qx(\old(x))) ∧ (¬Px(\old(x)) ⇒ (\let y = \old(a); Rx(\old(x)))); ensures r_assoc_let: (\let x = \old(a); \let x = \old(b); Pxy(x, x)) ⇔ (\let x = \old(b); Pxy(x, x)); ensures scope_let: (\let x = \old(a); \let x = x + 1; Px(x)) ⇔ Px(\old(a) + 1); ensures scope_let: (\let x = \old(x); \let y = x + 1; Pxy(x, y)) ⇔ Pxy(\old(x), \old(x) + 1); ensures ko: l_assoc_naming: (P ⇒ Q) ∧ (¬P ⇒ (R: S)) ⇔ (P ⇒ (Q: R)) ∧ (¬P ⇒ S); ensures r_precedence_ite_naming: (P ⇒ Q) ∧ (¬P ⇒ (R: S)) ⇔ (P ⇒ Q) ∧ (¬P ⇒ (R: S)); */ void predicate(int x, int a, int b) { return; } /*@ ensures chainable_lt_lt: \old(p) < \old(q) < \old(r) ⇔ \old(p) < \old(q) < \old(r); ensures chainable_le_le: \old(p) ≤ \old(q) ≤ \old(r) ⇔ \old(p) ≤ \old(q) ≤ \old(r); ensures chainable_gt_gt: \old(p) > \old(q) > \old(r) ⇔ \old(p) > \old(q) > \old(r); ensures chainable_ge_ge: \old(p) ≥ \old(q) ≥ \old(r) ⇔ \old(p) ≥ \old(q) ≥ \old(r); ensures chainable_eq_eq: \old(p) ≡ \old(q) ≡ \old(r) ⇔ \old(p) ≡ \old(q) ≡ \old(r); ensures r_precedence_eq_and: \old(p) ≡ \old(q) ∧ R ⇔ \old(p) ≡ \old(q) ∧ R; ensures l_precedence_eq_and: P ∧ \old(q) ≡ \old(r) ⇔ P ∧ \old(q) ≡ \old(r); ensures ko: r_precedence_and_eq: \old(p) ≡ \old(q) ∧ \old(r) ≢ 0 ⇔ (\old(p) ≢ 0) ≡ (\old(q) ≢ 0 ∧ \old(r) ≢ 0); ensures ko: l_precedence_and_eq: \old(p) ≢ 0 ∧ \old(q) ≡ \old(r) ⇔ (\old(p) ≢ 0 ∧ \old(q) ≢ 0) ≡ (\old(r) ≢ 0); ensures ko: l_nonassoc_eq: \old(p) ≡ \old(q) ≡ \old(r) ⇔ (\old(p) ≡ \old(q)) ≡ (\old(r) ≢ 0); ensures ko: r_nonassoc_eq: \old(p) ≡ \old(q) ≡ \old(r) ⇔ (\old(p) ≢ 0) ≡ (\old(q) ≡ \old(r)); ensures r_precedence_neq_and: \old(p) ≢ \old(q) ∧ R ⇔ \old(p) ≢ \old(q) ∧ R; ensures l_precedence_neq_and: P ∧ \old(q) ≢ \old(r) ⇔ P ∧ \old(q) ≢ \old(r); ensures ko: r_precedence_and_neq: \old(p) ≢ \old(q) ∧ \old(r) ≢ 0 ⇔ (\old(p) ≢ 0) ≢ (\old(q) ≢ 0 ∧ \old(r) ≢ 0); ensures ko: l_precedence_and_neq: \old(p) ≢ 0 ∧ \old(q) ≢ \old(r) ⇔ (\old(p) ≢ 0 ∧ \old(q) ≢ 0) ≢ (\old(r) ≢ 0); */ void comparison(int p, int q, int r) { return; } /*@ ensures r_precedence_and_xor: ((\old(p) & \old(q)) ^ \old(r)) ≡ ((\old(p) & \old(q)) ^ \old(r)); ensures l_precedence_and_xor: (\old(p) ^ (\old(q) & \old(r))) ≡ (\old(p) ^ (\old(q) & \old(r))); ensures ko: l_precedence_xor_and: ((\old(p) & \old(q)) ^ \old(r)) ≡ (\old(p) & (\old(q) ^ \old(r))); ensures ko: r_precedence_xor_and: (\old(p) ^ (\old(q) & \old(r))) ≡ ((\old(p) ^ \old(q)) & \old(r)); ensures r_precedence_xor_or: ((\old(p) ^ \old(q)) | \old(r)) ≡ ((\old(p) ^ \old(q)) | \old(r)); ensures l_precedence_xor_or: (\old(p) | (\old(q) ^ \old(r))) ≡ (\old(p) | (\old(q) ^ \old(r))); ensures ko: l_precedence_or_xor: ((\old(p) ^ \old(q)) | \old(r)) ≡ (\old(p) ^ (\old(q) | \old(r))); ensures ko: r_precedence_or_xor: (\old(p) | (\old(q) ^ \old(r))) ≡ ((\old(p) | \old(q)) ^ \old(r)); ensures r_precedence_or_implies: (~(\old(p) | \old(q)) | \old(r)) ≡ (~(\old(p) | \old(q)) | \old(r)); ensures l_precedence_or_implies: (~\old(p) | (\old(q) | \old(r))) ≡ (~\old(p) | (\old(q) | \old(r))); ensures ko: l_precedence_implies_or: (~(\old(p) | \old(q)) | \old(r)) ≡ (\old(p) | (~\old(q) | \old(r))); ensures ok: r_precedence_implies_or: (~\old(p) | (\old(q) | \old(r))) ≡ ((~\old(p) | \old(q)) | \old(r)); ensures ok: since: ((~\old(p) | \old(q)) | \old(r)) ≡ ((~\old(p) | \old(q)) | \old(r)); ensures r_assoc_implies: (~\old(p) | (~\old(q) | \old(r))) ≡ (~\old(p) | (~\old(q) | \old(r))); ensures ko: l_assoc_implies: (~\old(p) | (~\old(q) | \old(r))) ≡ (~(~\old(p) | \old(q)) | \old(r)); ensures r_precedence_implies_equiv: (~(~\old(p) | \old(q)) ^ \old(r)) ≡ (~(~\old(p) | \old(q)) ^ \old(r)); ensures l_precedence_implies_equiv: (~\old(p) ^ (~\old(q) | \old(r))) ≡ (~\old(p) ^ (~\old(q) | \old(r))); ensures ko: r_precedence_equiv_implies: (~(~\old(p) | \old(q)) ^ \old(r)) ≡ (~\old(p) | (~\old(q) ^ \old(r))); ensures ko: l_precedence_equiv_implies: (~\old(p) ^ (~\old(q) | \old(r))) ≡ (~(~\old(p) ^ \old(q)) | \old(r)); */ void bitwise(int p, int q, int r) { return; } /*@ ensures r_precedence_equiv_Pand: (~\old(p) ^ \old(q)) ≢ 0 ∧ R ⇔ (~\old(p) ^ \old(q)) ≢ 0 ∧ R; ensures l_precedence_equiv_Pand: P ∧ (~\old(q) ^ \old(r)) ≢ 0 ⇔ P ∧ (~\old(q) ^ \old(r)) ≢ 0; */ void predicate_bitwise(int p, int q, int r) { return; } �����������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/predicates_functions.res.oracle������������0000666�0000000�0000000�00000002133�13571573400�026341� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/predicates_functions.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 1 goal scheduled [wp:print-generated] theory WP (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) predicate P_P (i:int) = i = 42 predicate P_RP int axiom P_RP_def : forall i:int. i <= 0 \/ P_P i /\ P_RP ((- 1) + i) <-> P_RP i function L_F (i:int) : int = 2 * i function L_RF int : int axiom L_RF_def : forall i:int. L_RF i = (if i <= 0 then 0 else L_F i + L_RF ((- 1) + i)) goal wp_goal : forall i:int. 0 < i -> P_RP (L_RF i) end [wp] 1 goal generated ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma foo: Prove: (0<i_0) -> (P_RP (L_RF i_0)) ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/range.res.oracle���������������������������0000666�0000000�0000000�00000001703�13571573400�023224� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/range.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function test ------------------------------------------------------------ Goal Post-condition 'P1,ok' in 'test': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P2,ok' in 'test': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition 'HP,ok' in 'val_assigns_p'' in 'test' at call 'val_assigns_p' (file tests/wp_acsl/range.i, line 32) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition 'HQ,ok' in 'val_assigns_q'' in 'test' at call 'val_assigns_q' (file tests/wp_acsl/range.i, line 33) : Prove: true. ------------------------------------------------------------ �������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/reads.res.oracle���������������������������0000666�0000000�0000000�00000005755�13571573400�023241� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/reads.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'f': Assume { Type: is_sint32(x) /\ is_sint32(y). (* Pre-condition *) Have: (0 <= x) /\ (0 <= y) /\ (x <= 10) /\ (y <= 10) /\ P_Q(y, x). } Prove: P_Q(1 + y, 1 + x). ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'g': Let x = Mint_0[u]. Let x_1 = Mint_0[v]. Let m = Mint_0[u <- 1 + x]. Let x_2 = m[v]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Heap *) Have: (region(u.base) <= 0) /\ (region(v.base) <= 0). (* Pre-condition *) Have: (0 <= x) /\ (0 <= x_1) /\ (x <= 10) /\ (x_1 <= 10) /\ P_P(Mint_0, u, v). } Prove: P_P(m[v <- 1 + x_2], u, v). ------------------------------------------------------------ ------------------------------------------------------------ Function modifies_x ------------------------------------------------------------ Goal Post-condition 'qed_ok,F_OK' in 'modifies_x': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ko,G_KO' in 'modifies_x': Assume { Type: is_sint32(x). (* Pre-condition *) Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). } Prove: P_g(1 + x). ------------------------------------------------------------ Goal Post-condition 'qed_ko,H_KO' in 'modifies_x': Assume { Type: is_sint32(x). (* Pre-condition *) Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). } Prove: P_h(y, 1 + x). ------------------------------------------------------------ Goal Post-condition 'qed_ok,W_OK,todo' in 'modifies_x': Assume { Type: is_sint32(x). (* Pre-condition *) Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). } Prove: P_w(y, 1 + x). ------------------------------------------------------------ ------------------------------------------------------------ Function modifies_y ------------------------------------------------------------ Goal Post-condition 'qed_ok,F_OK' in 'modifies_y': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,G_OK' in 'modifies_y': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ko,H_KO' in 'modifies_y': Assume { Type: is_sint32(y). (* Pre-condition *) Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). } Prove: P_h(1 + y, x). ------------------------------------------------------------ Goal Post-condition 'qed_ok,W_OK,todo' in 'modifies_y': Assume { Type: is_sint32(y). (* Pre-condition *) Have: P_f /\ P_g(x) /\ P_h(y, x) /\ P_w(y, x). } Prove: P_w(1 + y, x). ------------------------------------------------------------ �������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/record.res.oracle��������������������������0000666�0000000�0000000�00000004036�13571573400�023410� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/record.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'M1,qed_ok' in 'f': Let x = s2_0.F1_T_i. Assume { Type: IsS1_T(s1_0) /\ IsS1_T(s2_0) /\ is_sint32(s1_0.F1_T_j) /\ is_sint32(x) /\ is_sint32(s2_0.F1_T_j). (* Goal *) When: EqS1_T(s1_0, s2_0). } Prove: x = (s1_0.F1_T_i). ------------------------------------------------------------ Goal Post-condition 'M2,qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'M3,qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'M4,qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'M5,qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'M6,qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P1,qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P2,qed_ok' in 'f': Assume { Type: IsArray1_sint32(t1_0) /\ IsArray1_sint32(t2_0). (* Goal *) When: forall i : Z. ((0 <= i) -> ((i <= 9) -> (t2_0[i] = t1_0[i]))). } Prove: EqArray1_int(10, t1_0, t2_0). ------------------------------------------------------------ Goal Post-condition 'P3,qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P4,qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P5,qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'KP5,qed_ko' in 'f': Prove: false. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/simpl_is_type.res.oracle�������������������0000666�0000000�0000000�00000041073�13571573400�025014� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/simpl_is_type.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function check_acsl ------------------------------------------------------------ Goal Check 'ko,A1,absorb_is_cint' (file tests/wp_acsl/simpl_is_type.i, line 62): Prove: exists i : Z. forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 63) -> P_P(i_1, i, 1.0))). ------------------------------------------------------------ Goal Check 'ko,A2,absorb_is_cint' (file tests/wp_acsl/simpl_is_type.i, line 63): Prove: exists i : Z. forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 63) -> (P_P(i, i_1, 1.0) -> P_P(i_1, i, 1.0)))). ------------------------------------------------------------ Goal Check 'ko,A3,absorb_is_cint' (file tests/wp_acsl/simpl_is_type.i, line 64): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((0 <= i_1) -> ((i_1 <= 63) -> P_P(i_1, i, r))))). ------------------------------------------------------------ Goal Check 'ko,A4,absorb_is_cint' (file tests/wp_acsl/simpl_is_type.i, line 65): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((0 <= i_1) -> ((i_1 <= 63) -> (P_P(i, i_1, r) -> P_P(i_1, i, r)))))). ------------------------------------------------------------ Goal Check 'ok,C1,absurd_is_cint' (file tests/wp_acsl/simpl_is_type.i, line 67): Prove: exists i : Z. forall i_1 : Z. ((i_1 < 0) -> (((-900000) <= i_1) -> (is_uint8(i_1) -> (P_P(i, i_1, 1.0) -> P_P(i_1, i, 1.0))))). ------------------------------------------------------------ Goal Check 'ok,C2,absurd_is_cint' (file tests/wp_acsl/simpl_is_type.i, line 68): Prove: exists i : Z. forall i_1 : Z. ((i_1 < 0) -> (((-900000) <= i_1) -> (is_uint8(i_1) -> (P_P(i, i_1, 1.0) -> P_P(i_1, i, 1.0))))). ------------------------------------------------------------ Goal Check 'lack,C3,absurd_is_cint' (file tests/wp_acsl/simpl_is_type.i, line 69): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((i_1 < 0) -> (((-900000) <= i_1) -> (P_P(i, i_1, r) -> P_P(i_1, i, r)))))). ------------------------------------------------------------ Goal Check 'lack,C4,absurd_is_cint' (file tests/wp_acsl/simpl_is_type.i, line 70): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((i_1 < 0) -> (((-900000) <= i_1) -> (P_P(i, i_1, r) -> P_P(i_1, i, r)))))). ------------------------------------------------------------ Goal Check 'ok,C5,absurd_cmp' (file tests/wp_acsl/simpl_is_type.i, line 71): Prove: true. ------------------------------------------------------------ Goal Check 'ko,B5,no_absurd_cmp' (file tests/wp_acsl/simpl_is_type.i, line 72): Assume { (* Goal *) When: (.0 < r) /\ (r < 1.0). } Prove: P_P(3, 5, 1.0). ------------------------------------------------------------ Goal Check 'ko,Min1,reduces_min' (file tests/wp_acsl/simpl_is_type.i, line 74): Prove: exists i : Z. forall i_1 : Z. ((0 <= i_1) -> (((-5) <= i_1) -> ((i_1 <= 99) -> P_P(i_1, i, 1.0)))). ------------------------------------------------------------ Goal Check 'ko,Min2,reduces_min' (file tests/wp_acsl/simpl_is_type.i, line 75): Prove: exists i : Z. forall i_1 : Z. ((10 <= i_1) -> ((11 <= i_1) -> ((i_1 <= 99) -> (P_P(10, i, 1.0) -> P_P(i_1, i, 1.0))))). ------------------------------------------------------------ Goal Check 'ko,Min3,reduces_min' (file tests/wp_acsl/simpl_is_type.i, line 76): Prove: exists i : Z. forall i_1 : Z. ((10 <= i_1) -> ((12 <= i_1) -> ((i_1 <= 99) -> (P_P(10, i, 1.0) -> (P_P(11, i, 1.0) -> (P_P(13, i, 1.0) -> P_P(i_1, i, 1.0))))))). ------------------------------------------------------------ Goal Check 'ko,Min4,reduces_min' (file tests/wp_acsl/simpl_is_type.i, line 77): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. (((-5) <= i_1) -> ((i_1 <= 99) -> P_P(i_1, i, r))))). ------------------------------------------------------------ Goal Check 'ko,Min5,reduces_min' (file tests/wp_acsl/simpl_is_type.i, line 78): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((10 <= i_1) -> ((i_1 <= 99) -> (P_P(10, i, r) -> P_P(i_1, i, r)))))). ------------------------------------------------------------ Goal Check 'ko,Min6,reduces_min' (file tests/wp_acsl/simpl_is_type.i, line 79): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((10 <= i_1) -> ((i_1 <= 99) -> (P_P(10, i, r) -> (P_P(11, i, r) -> (P_P(13, i, r) -> P_P(i_1, i, r)))))))). ------------------------------------------------------------ Goal Check 'ko,Max1,reduces_max' (file tests/wp_acsl/simpl_is_type.i, line 81): Prove: exists i : Z. forall i_1 : Z. ((10 <= i_1) -> ((i_1 <= 255) -> ((i_1 <= 599) -> P_P(i_1, i, 1.0)))). ------------------------------------------------------------ Goal Check 'ko,Max2,reduces_max' (file tests/wp_acsl/simpl_is_type.i, line 82): Prove: exists i : Z. forall i_1 : Z. ((10 <= i_1) -> ((i_1 <= 97) -> ((i_1 <= 99) -> (P_P(98, i, 1.0) -> (P_P(99, i, 1.0) -> P_P(i_1, i, 1.0)))))). ------------------------------------------------------------ Goal Check 'ko,Max3,reduces_max' (file tests/wp_acsl/simpl_is_type.i, line 83): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((10 <= i_1) -> ((i_1 <= 599) -> P_P(i_1, i, r))))). ------------------------------------------------------------ Goal Check 'ko,Max4,reduces_max' (file tests/wp_acsl/simpl_is_type.i, line 84): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((10 <= i_1) -> ((i_1 <= 99) -> (P_P(98, i, r) -> (P_P(99, i, r) -> P_P(i_1, i, r))))))). ------------------------------------------------------------ Goal Check 'ko,MinMax1,reduce_minmax' (file tests/wp_acsl/simpl_is_type.i, line 86): Prove: exists i : Z. forall i_1 : Z. ((0 <= i_1) -> (((-5) <= i_1) -> ((i_1 <= 97) -> ((i_1 <= 99) -> (P_P(98, i, 1.0) -> (P_P(99, i, 1.0) -> P_P(i_1, i, 1.0))))))). ------------------------------------------------------------ Goal Check 'ko,MinMax2,reduce_minmax' (file tests/wp_acsl/simpl_is_type.i, line 87): Prove: exists i : Z. forall i_1 : Z. ((10 <= i_1) -> ((12 <= i_1) -> ((i_1 <= 97) -> ((i_1 <= 99) -> (P_P(10, i, 1.0) -> (P_P(11, i, 1.0) -> (P_P(13, i, 1.0) -> (P_P(98, i, 1.0) -> (P_P(99, i, 1.0) -> P_P(i_1, i, 1.0)))))))))). ------------------------------------------------------------ Goal Check 'ko,MinMax3,reduce_minmax' (file tests/wp_acsl/simpl_is_type.i, line 88): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. (((-5) <= i_1) -> ((i_1 <= 99) -> (P_P(98, i, r) -> (P_P(99, i, r) -> P_P(i_1, i, r))))))). ------------------------------------------------------------ Goal Check 'ko,MinMax4,reduce_minmax' (file tests/wp_acsl/simpl_is_type.i, line 89): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((10 <= i_1) -> ((i_1 <= 99) -> (P_P(10, i, r) -> (P_P(11, i, r) -> (P_P(13, i, r) -> (P_P(98, i, r) -> (P_P(99, i, r) -> P_P(i_1, i, r)))))))))). ------------------------------------------------------------ Goal Check 'ko,Let1,intro_let' (file tests/wp_acsl/simpl_is_type.i, line 92): Prove: exists i : Z. P_P(10, i, 1.0). ------------------------------------------------------------ Goal Check 'ko,Let2,intro_let' (file tests/wp_acsl/simpl_is_type.i, line 93): Prove: exists i : Z. P_P(0, i, 1.0). ------------------------------------------------------------ Goal Check 'ko,Let3,intro_let' (file tests/wp_acsl/simpl_is_type.i, line 94): Prove: exists i : Z. P_P(255, i, 1.0). ------------------------------------------------------------ Goal Check 'ko,Let4,intro_let' (file tests/wp_acsl/simpl_is_type.i, line 95): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((10 <= i_1) -> ((i_1 <= 10) -> P_P(i_1, i, r))))). ------------------------------------------------------------ Goal Check 'ko,Let5,intro_let' (file tests/wp_acsl/simpl_is_type.i, line 96): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((i_1 <= 0) -> (((-5) <= i_1) -> P_P(i_1, i, r))))). ------------------------------------------------------------ Goal Check 'ko,Let6,intro_let' (file tests/wp_acsl/simpl_is_type.i, line 97): Prove: exists i : Z. forall i_1 : Z. (is_uint8(i_1) -> (exists r : R. ((255 <= i_1) -> ((i_1 <= 599) -> P_P(i_1, i, r))))). ------------------------------------------------------------ ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/simpl_is_type.i, line 17) in 'f': Let a = shift_sint32(t, 0). Let a_1 = havoc(Mint_undef_0, Mint_0, a, size_0). Assume { Type: is_sint32(i) /\ is_sint32(size_0). (* Goal *) When: (0 <= i_1) /\ (i_1 < size_0) /\ is_sint32(i_1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < size_0) /\ (forall i_2 : Z. ((0 <= i_2) -> ((i_2 < size_0) -> (Mint_0[shift_sint32(t, i_2)] < 0)))). (* Invariant *) Have: forall i_2 : Z. ((i <= i_2) -> ((i_2 < size_0) -> (a_1[shift_sint32(t, i_2)] < 0))). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (0 < a_1[shift_sint32(t, i_2)]))). (* Invariant *) Have: (0 <= i) /\ (i <= size_0). (* Else *) Have: size_0 <= i. } Prove: 0 < havoc(Mint_undef_0, Mint_0, a, i)[shift_sint32(t, i_1)]. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_acsl/simpl_is_type.i, line 22): Let a = havoc(Mint_undef_0, Mint_0, shift_sint32(t, 0), size_0). Assume { Type: is_sint32(i) /\ is_sint32(size_0) /\ is_sint32(1 + i). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < size_0) /\ (forall i_1 : Z. ((0 <= i_1) -> ((i_1 < size_0) -> (Mint_0[shift_sint32(t, i_1)] < 0)))). (* Invariant *) Have: forall i_1 : Z. ((i <= i_1) -> ((i_1 < size_0) -> (a[shift_sint32(t, i_1)] < 0))). (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (0 < a[shift_sint32(t, i_1)]))). (* Invariant *) Have: (0 <= i) /\ (i <= size_0). (* Then *) Have: i < size_0. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_acsl/simpl_is_type.i, line 22): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_acsl/simpl_is_type.i, line 23): Let a = havoc(Mint_undef_0, Mint_0, shift_sint32(t, 0), size_0). Let a_1 = shift_sint32(t, i). Let a_2 = a[a_1]. Assume { Type: is_sint32(i) /\ is_sint32(size_0) /\ is_sint32(1 + i) /\ is_sint32(a_2). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i) /\ is_sint32(i_1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < size_0) /\ (forall i_2 : Z. ((0 <= i_2) -> ((i_2 < size_0) -> (Mint_0[shift_sint32(t, i_2)] < 0)))). (* Invariant *) Have: forall i_2 : Z. ((i <= i_2) -> ((i_2 < size_0) -> (a[shift_sint32(t, i_2)] < 0))). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (0 < a[shift_sint32(t, i_2)]))). (* Invariant *) Have: (0 <= i) /\ (i <= size_0). (* Then *) Have: i < size_0. } Prove: 0 < a[a_1 <- -a_2][shift_sint32(t, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_acsl/simpl_is_type.i, line 23): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_acsl/simpl_is_type.i, line 24): Let a = havoc(Mint_undef_0, Mint_0, shift_sint32(t, 0), size_0). Let a_1 = shift_sint32(t, i). Let a_2 = a[a_1]. Assume { Type: is_sint32(i) /\ is_sint32(size_0) /\ is_sint32(1 + i) /\ is_sint32(a_2). (* Goal *) When: (i_1 < size_0) /\ (i < i_1) /\ is_sint32(i_1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < size_0) /\ (forall i_2 : Z. ((0 <= i_2) -> ((i_2 < size_0) -> (Mint_0[shift_sint32(t, i_2)] < 0)))). (* Invariant *) Have: forall i_2 : Z. ((i <= i_2) -> ((i_2 < size_0) -> (a[shift_sint32(t, i_2)] < 0))). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (0 < a[shift_sint32(t, i_2)]))). (* Invariant *) Have: (0 <= i) /\ (i <= size_0). (* Then *) Have: i < size_0. } Prove: a[a_1 <- -a_2][shift_sint32(t, i_1)] < 0. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_acsl/simpl_is_type.i, line 24): Assume { Type: is_sint32(size_0). (* Goal *) When: (0 <= i) /\ (i < size_0) /\ is_sint32(i). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < size_0) /\ (forall i_1 : Z. ((0 <= i_1) -> ((i_1 < size_0) -> (Mint_0[shift_sint32(t, i_1)] < 0)))). } Prove: Mint_0[shift_sint32(t, i)] < 0. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_acsl/simpl_is_type.i, line 25) (1/2): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_acsl/simpl_is_type.i, line 25) (2/2): Effect at line 28 Let a = shift_sint32(t, 0). Let a_1 = havoc(Mint_undef_0, Mint_0, a, size_0). Let a_2 = shift_sint32(t, i). Assume { Type: is_sint32(i) /\ is_sint32(size_0). (* Goal *) When: !invalid(Malloc_0, a_2, 1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 < size_0) /\ (forall i_1 : Z. ((0 <= i_1) -> ((i_1 < size_0) -> (Mint_0[shift_sint32(t, i_1)] < 0)))). (* Invariant *) Have: forall i_1 : Z. ((i <= i_1) -> ((i_1 < size_0) -> (a_1[shift_sint32(t, i_1)] < 0))). (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (0 < a_1[shift_sint32(t, i_1)]))). (* Invariant *) Have: (0 <= i) /\ (i <= size_0). (* Then *) Have: i < size_0. } Prove: included(a_2, 1, a, size_0). ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition (file tests/wp_acsl/simpl_is_type.i, line 35) in 'g': Let x = Mint_0[shift_sint32(t, i)]. Assume { Type: is_sint32(i) /\ is_sint32(size_0) /\ is_sint32(x). (* Heap *) Have: region(t.base) <= 0. (* Pre-condition *) Have: 0 < size_0. (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (Mint_0[shift_sint32(t, i_1)] != x))). (* Invariant *) Have: (0 <= i) /\ (i <= size_0). Have: i < size_0. } Prove: exists i_1 : Z. (Mint_0[shift_sint32(t, i_1)] = x) /\ (0 <= i_1) /\ (i_1 < size_0) /\ (forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (Mint_0[shift_sint32(t, i_2)] != x)))). ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_acsl/simpl_is_type.i, line 44): Let x_1 = Mint_0[shift_sint32(t, i)]. Assume { Type: is_sint32(i) /\ is_sint32(size_0) /\ is_sint32(x) /\ is_sint32(1 + i) /\ is_sint32(x_1). (* Heap *) Have: region(t.base) <= 0. (* Pre-condition *) Have: 0 < size_0. (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (Mint_0[shift_sint32(t, i_1)] != x))). (* Invariant *) Have: (0 <= i) /\ (i <= size_0). (* Then *) Have: i < size_0. (* Else *) Have: x_1 != x. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_acsl/simpl_is_type.i, line 44): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_acsl/simpl_is_type.i, line 46): Let x_1 = Mint_0[shift_sint32(t, i_1)]. Assume { Type: is_sint32(i_1) /\ is_sint32(size_0) /\ is_sint32(x) /\ is_sint32(1 + i_1) /\ is_sint32(x_1). (* Goal *) When: (0 <= i) /\ (i <= i_1) /\ is_sint32(i). (* Heap *) Have: region(t.base) <= 0. (* Pre-condition *) Have: 0 < size_0. (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (Mint_0[shift_sint32(t, i_2)] != x))). (* Invariant *) Have: (0 <= i_1) /\ (i_1 <= size_0). (* Then *) Have: i_1 < size_0. (* Else *) Have: x_1 != x. } Prove: Mint_0[shift_sint32(t, i)] != x. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_acsl/simpl_is_type.i, line 46): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_acsl/simpl_is_type.i, line 48): Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/sizeof.res.oracle��������������������������0000666�0000000�0000000�00000001212�13571573400�023422� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/sizeof.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Assertion 'A' (file tests/wp_acsl/sizeof.i, line 10): Prove: !P_eq(12, 9). ------------------------------------------------------------ Goal Assertion 'B' (file tests/wp_acsl/sizeof.i, line 11): Assume { (* Assertion 'A' *) Have: !P_eq(12, 9). } Prove: P_eq(48, 48). ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/struct_use_case.res.oracle�����������������0000666�0000000�0000000�00000002670�13571573400�025327� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_acsl/struct_use_case.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'ko' in 'f': Let a = var_0.F1_b. Let a_1 = { var_0 with F1_b = a[0 <- y][1 <- x] }. Assume { Type: IsS1(var_0) /\ is_uint32(x) /\ is_uint32(y) /\ IsS1(a_1). } Prove: EqS1(a_1, { var_0 with F1_b = a[1 <- x] }). ------------------------------------------------------------ Goal Post-condition 'ok' in 'f': Let a = var_0.F1_b. Let a_1 = { var_0 with F1_b = a[0 <- y][1 <- x] }. Assume { Type: IsS1(var_0) /\ is_uint32(x) /\ is_uint32(y) /\ IsS1(a_1). } Prove: EqS1(a_1, { var_0 with F1_b = a[1 <- x][0 <- y] }). ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition 'ko' in 'g': Let a = (var_0.F1_b)[1 <- x]. Let a_1 = { F1_a = y ; F1_b = a }. Assume { Type: IsS1(var_0) /\ is_uint32(x) /\ is_uint32(y) /\ IsS1(a_1). } Prove: EqS1(a_1, { var_0 with F1_b = a }). ------------------------------------------------------------ Goal Post-condition 'ok' in 'g': Prove: true. ------------------------------------------------------------ ������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/tset.res.oracle����������������������������0000666�0000000�0000000�00000002042�13571573400�023104� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/tset.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma UNION_DESCR: Assume: 'UNION_RANGE' 'UNION_LIFT' 'UNION_EQ' Prove: true ------------------------------------------------------------ Lemma UNION_EQ: Prove: (((x_0=0) \/ (y_0=x_0)) /\ ((y_0=0) \/ (y_0=x_0)))=(y_0=x_0) ------------------------------------------------------------ Lemma UNION_LIFT: Assume: 'UNION_EQ' Prove: true ------------------------------------------------------------ Lemma UNION_RANGE: Assume: 'UNION_LIFT' 'UNION_EQ' Prove: (0<=k_0) -> (k_0<=n_0) -> (((k_0<n_0) -> (-1<=k_0)) /\ ((0<k_0) -> (k_0<=(1+n_0))) /\ (forall i_0:int. (0<=i_0) -> (i_0<=n_0) -> ((i_0=k_0) \/ ((k_0<i_0) /\ (i_0<=n_0)) \/ ((0<=i_0) /\ (i_0<k_0))))) ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/type_guard.res.oracle����������������������0000666�0000000�0000000�00000001175�13571573400�024276� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/type_guard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'f': Assume { Type: is_uint8(t). } Prove: (0 <= t) /\ (t <= 255). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'f': Assume { Type: is_uint8(t). } Prove: (0 <= t) /\ (t <= 127). ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/unit_bit_test.res.oracle�������������������0000666�0000000�0000000�00000002400�13571573400�024777� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/unit_bit_test.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function rotate_left ------------------------------------------------------------ Goal Post-condition 'bit_zero' in 'rotate_left': Prove: true. ------------------------------------------------------------ Goal Post-condition 'other_bits' in 'rotate_left': Let x_1 = lsr(x, 31). Assume { Type: is_uint32(x) /\ is_uint32(x_1). (* Goal *) When: (0 <= i) /\ (i <= 30) /\ is_sint32(i). } Prove: (land(lor(x_1, to_uint32(lsl(x, 1))), lsl(1, 1 + i)) != 0) <-> (land(x, lsl(1, i)) != 0). ------------------------------------------------------------ ------------------------------------------------------------ Function sum ------------------------------------------------------------ Goal Post-condition 'ok' in 'sum': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko' in 'sum': Assume { Type: is_sint8(a) /\ is_sint8(b). } Prove: (bit_test(a, 1) \/ bit_test(b, 1)) <-> (bit_test(a, 1) /\ bit_test(b, 1)). ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/unit_bool.res.oracle�����������������������0000666�0000000�0000000�00000004635�13571573400�024131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/unit_bool.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Axiomatic 'Foo' ------------------------------------------------------------ Lemma f_1: Assume: 'f_def' Prove: (L_f 1) ------------------------------------------------------------ ------------------------------------------------------------ Function boolean_casts ------------------------------------------------------------ Goal Check 'C0' (file tests/wp_acsl/unit_bool.i, line 12): Prove: true. ------------------------------------------------------------ Goal Check 'C1' (file tests/wp_acsl/unit_bool.i, line 13): Prove: true. ------------------------------------------------------------ Goal Check 'c0' (file tests/wp_acsl/unit_bool.i, line 14): Prove: true. ------------------------------------------------------------ Goal Check 'c1' (file tests/wp_acsl/unit_bool.i, line 15): Prove: true. ------------------------------------------------------------ Goal Check 'c2' (file tests/wp_acsl/unit_bool.i, line 16): Prove: true. ------------------------------------------------------------ Goal Check 'X0' (file tests/wp_acsl/unit_bool.i, line 18): Prove: true. ------------------------------------------------------------ Goal Check 'X1' (file tests/wp_acsl/unit_bool.i, line 19): Prove: true. ------------------------------------------------------------ Goal Check 'x0' (file tests/wp_acsl/unit_bool.i, line 20): Prove: true. ------------------------------------------------------------ Goal Check 'x1' (file tests/wp_acsl/unit_bool.i, line 21): Prove: true. ------------------------------------------------------------ Goal Check 'x2' (file tests/wp_acsl/unit_bool.i, line 22): Prove: true. ------------------------------------------------------------ Goal Check 'B0' (file tests/wp_acsl/unit_bool.i, line 24): Prove: true. ------------------------------------------------------------ Goal Check 'B1' (file tests/wp_acsl/unit_bool.i, line 25): Prove: true. ------------------------------------------------------------ Goal Check 'b0' (file tests/wp_acsl/unit_bool.i, line 26): Prove: true. ------------------------------------------------------------ Goal Check 'b1' (file tests/wp_acsl/unit_bool.i, line 27): Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/unit_compare.res.oracle��������������������0000666�0000000�0000000�00000006427�13571573400�024625� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/unit_compare.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition 'LE_X_Y' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x <= y. ------------------------------------------------------------ Goal Pre-condition 'LE_X1_Y' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x < y. ------------------------------------------------------------ Goal Pre-condition 'LE_X_Y1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x <= (1 + y). ------------------------------------------------------------ Goal Pre-condition 'LE_X1_Y1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x <= y. ------------------------------------------------------------ Goal Pre-condition 'LE_Xm1_Y' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x <= (1 + y). ------------------------------------------------------------ Goal Pre-condition 'LE_X_Ym1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x < y. ------------------------------------------------------------ Goal Pre-condition 'LE_Xm1_Ym1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x <= y. ------------------------------------------------------------ Goal Pre-condition 'LE_X1_Ym1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: (2 + x) <= y. ------------------------------------------------------------ Goal Pre-condition 'LE_Xm1_Y1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x <= (2 + y). ------------------------------------------------------------ Goal Pre-condition 'LT_X_Y' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x < y. ------------------------------------------------------------ Goal Pre-condition 'LT_X1_Y' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: (2 + x) <= y. ------------------------------------------------------------ Goal Pre-condition 'LT_X_Y1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x <= y. ------------------------------------------------------------ Goal Pre-condition 'LT_X1_Y1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x < y. ------------------------------------------------------------ Goal Pre-condition 'LT_Xm1_Y' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x <= y. ------------------------------------------------------------ Goal Pre-condition 'LT_X_Ym1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: (2 + x) <= y. ------------------------------------------------------------ Goal Pre-condition 'LT_Xm1_Ym1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x < y. ------------------------------------------------------------ Goal Pre-condition 'LT_X1_Ym1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: (3 + x) <= y. ------------------------------------------------------------ Goal Pre-condition 'LT_Xm1_Y1' in 'main': Assume { Type: is_sint32(x) /\ is_sint32(y). } Prove: x <= (1 + y). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle/user_def_type_guard.res.oracle�������������0000666�0000000�0000000�00000001122�13571573400�026142� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/user_def_type_guard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'f': Prove: (0 <= L_t) /\ (L_t <= 255). ------------------------------------------------------------ Goal Post-condition 'qed_ko' in 'f': Prove: (0 <= L_t) /\ (L_t <= 127). ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/������������������������������������0000777�0000000�0000000�00000000000�13571573400�021511� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.0.res.oracle������������������0000666�0000000�0000000�00000004243�13571573400�024740� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/arith.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 24 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ASSOC_land_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L01_lnot_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L10_land_neutral_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L11_land_absorbant_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L12_land_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L13_land_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L14_land_absorbant_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L15_land_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L16_land_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L20_lor_neutral_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L21_lor_absorbant_qed_ok : Valid [wp] [Qed] Goal typed_lemma_L30_lxor_neutral_qed_ok : Valid [wp] [Qed] Goal typed_lemma_scL1_qed_ok : Valid [wp] [Qed] Goal typed_lemma_scN1_qed_ok : Valid [wp] [Qed] Goal typed_lemma_scN2_qed_ok : Valid [wp] [Qed] Goal typed_lemma_ucL1_qed_ok : Valid [wp] [Qed] Goal typed_lemma_ucL2_qed_ok : Valid [wp] [Qed] Goal typed_lemma_ucL3_qed_ok : Valid [wp] [Qed] Goal typed_lemma_ucL4_qed_ok : Valid [wp] [Qed] Goal typed_lemma_ucN1_qed_ok : Valid [wp] [Qed] Goal typed_lemma_ucN2_qed_ok : Valid [wp] [Qed] Goal typed_cast_sgn_usgn_ensures_qed_ok_nat : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_uchar_range_assert_qed_ok_A1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_uchar_range_assert_qed_ok_A2 : Valid [wp] Proved goals: 24 / 24 Qed: 21 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_acsl/oracle_qualif/arith.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/arith.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma 20 1 (8..20) 21 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success cast_sgn_usgn 1 - 1 100% uchar_range - 2 (12..24) 2 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024440� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025503� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.0.session/cache/22e8af89bab02c0376d0b76de0783ced.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.0.session/cache/22e8af89bab02c0000666�0000000�0000000�00000000127�13571573400�027550� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0297, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.0.session/cache/25352f9b51b5b51a92cd738b531b5cdf.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.0.session/cache/25352f9b51b5b50000666�0000000�0000000�00000000127�13571573400�027333� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0309, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.0.session/cache/eee79396f30abd45df8aaaa33f0bd73c.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.0.session/cache/eee79396f30abd0000666�0000000�0000000�00000000126�13571573400�027565� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.028, "steps": 18 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.1.res.oracle������������������0000666�0000000�0000000�00000001331�13571573400�024734� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/arith.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_cast_sgn_usgn_ensures_qed_ko_KO : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/arith.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/arith.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success cast_sgn_usgn - - 1 0.0% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.1.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024441� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.1.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025504� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.1.session/cache/0312839fb550e7a57a51a6de0c8a6d84.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.1.session/cache/0312839fb550e70000666�0000000�0000000�00000000107�13571573400�027254� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.i.0.report.json���������������0000666�0000000�0000000�00000024173�13571573400�025421� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 4 }, "qed": { "total": 21, "valid": 21 }, "wp:main": { "total": 24, "valid": 24, "rank": 4 } }, "wp:axiomatics": { "": { "lemma_ucN2_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_ucN1_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_ucL4_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_ucL3_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_ucL2_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_ucL1_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_scN2_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_scN1_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_scL1_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L30_lxor_neutral_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L21_lor_absorbant_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L20_lor_neutral_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L16_land_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L15_land_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L14_land_absorbant_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L13_land_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L12_land_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L11_land_absorbant_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L10_land_neutral_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_L01_lnot_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_ASSOC_land_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "qed": { "total": 20, "valid": 20 }, "wp:main": { "total": 21, "valid": 21, "rank": 0 } } } }, "wp:functions": { "cast_sgn_usgn": { "cast_sgn_usgn_ensures_qed_ok_nat": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "uchar_range": { "uchar_range_assert_qed_ok_A2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "uchar_range_assert_qed_ok_A1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/arith.i.1.report.json���������������0000666�0000000�0000000�00000001613�13571573400�025414� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "cast_sgn_usgn": { "cast_sgn_usgn_ensures_qed_ko_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assign_array.0.report.json����������0000666�0000000�0000000�00000002355�13571573400�026543� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "wp:functions": { "jobA": { "jobA_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "jobG": { "jobG_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assign_array.i.0.report.json��������0000666�0000000�0000000�00000002355�13571573400�026772� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "wp:functions": { "jobA": { "jobA_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "jobG": { "jobG_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assign_array.res.oracle�������������0000666�0000000�0000000�00000001601�13571573400�026150� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/assign_array.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Qed] Goal typed_jobA_assigns_exit : Valid [wp] [Qed] Goal typed_jobA_assigns_normal : Valid [wp] [Qed] Goal typed_jobG_assigns_exit : Valid [wp] [Qed] Goal typed_jobG_assigns_normal : Valid [wp] Proved goals: 4 / 4 Qed: 4 [wp] Report in: 'tests/wp_acsl/oracle_qualif/assign_array.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/assign_array.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success jobA 2 - 2 100% jobG 2 - 2 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.0.report.json����������0000666�0000000�0000000�00000006612�13571573400�026544� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 6 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 9, "valid": 9, "rank": 6 } }, "wp:functions": { "job": { "job_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "job_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "job_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "job_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "job_ensures_N": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 6 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 9, "valid": 9, "rank": 6 } } } } } ����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026014� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027057� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.0.session/cache/0bb9326e4269583224fb2770b016800a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.0.session/cache/0bb93260000666�0000000�0000000�00000000127�13571573400�027771� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0255, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.0.session/cache/27425d7dcb17564821b7f51bacad4897.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.0.session/cache/27425d70000666�0000000�0000000�00000000127�13571573400�027720� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0289, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.0.session/cache/9eee7a2ae5de6a1ff5a8b4e995114dbc.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.0.session/cache/9eee7a20000666�0000000�0000000�00000000127�13571573400�030143� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0214, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.i.0.report.json��������0000666�0000000�0000000�00000006612�13571573400�026773� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 9, "valid": 9, "rank": 6 } }, "wp:functions": { "job": { "job_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "job_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "job_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "job_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "job_ensures_N": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 9, "valid": 9, "rank": 6 } } } } } ����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_path.res.oracle�������������0000666�0000000�0000000�00000002447�13571573400�026162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/assigns_path.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 9 goals scheduled [wp] [Qed] Goal typed_job_ensures_N : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_A : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_job_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_job_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_job_loop_assigns : Valid [wp] [Qed] Goal typed_job_assigns_part1 : Valid [wp] [Qed] Goal typed_job_assigns_part2 : Valid [wp] Proved goals: 9 / 9 Qed: 6 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_acsl/oracle_qualif/assigns_path.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/assigns_path.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 6 3 (20..32) 9 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'job': /*@ behavior typed: requires \separated(&p,b+(..)); */ void job(int n, int *b); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.res.oracle����������0000666�0000000�0000000�00000004132�13571573400�026451� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/assigns_range.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 17 goals scheduled [wp] [Qed] Goal typed_call_assigns_all_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_call_assigns_all_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_call_assigns_all_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_call_assigns_all_assigns_exit_part4 : Valid [wp] [Qed] Goal typed_call_assigns_all_assigns_exit_part5 : Valid [wp] [Qed] Goal typed_call_assigns_all_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_call_assigns_all_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_call_assigns_all_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_call_assigns_all_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_call_assigns_all_assigns_normal_part5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_all_call_assigns_t1_an_element_requires : Valid [wp] [Qed] Goal typed_call_assigns_all_call_assigns_t2_bound_requires : Valid [wp] [Qed] Goal typed_call_assigns_all_call_assigns_t3_inf_bound_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_all_call_assigns_t4_sup_bound_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_t1_call_assigns_t1_an_element_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_t2_call_assigns_t2_bound_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_t4_call_assigns_t4_sup_bound_requires : Valid [wp] Proved goals: 17 / 17 Qed: 12 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_acsl/oracle_qualif/assigns_range.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/assigns_range.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success call_assigns_all 12 2 (8..20) 14 100% call_assigns_t1 - 1 (4..16) 1 100% call_assigns_t2 - 1 (4..16) 1 100% call_assigns_t4 - 1 (4..16) 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026154� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027217� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/51be20ba77a29823228730006ea17235.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/51be200000666�0000000�0000000�00000000127�13571573400�030040� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0136, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/71b8977e0240d06ce312ec58fd2cebe2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/71b8970000666�0000000�0000000�00000000126�13571573400�030002� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0116, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/7ef721ab5f79fd73a875a1100883ff5a.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/7ef7210000666�0000000�0000000�00000000127�13571573400�030055� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0119, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/84f093e6097df47f748e4706e4b385ff.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/84f0930000666�0000000�0000000�00000000127�13571573400�027777� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0145, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/ebb4a8c6f3fc630f681a9fa5a848cc32.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.0.session/cache/ebb4a80000666�0000000�0000000�00000000126�13571573400�030206� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0141, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.1.res.oracle����������0000666�0000000�0000000�00000002333�13571573400�026453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/assigns_range.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_t1_assigns_exit : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_t1_assigns_normal : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_t2_assigns_exit : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_t2_assigns_normal : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_t4_assigns_exit : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_call_assigns_t4_assigns_normal : Unsuccess [wp] Proved goals: 0 / 6 Alt-Ergo 2.0.0: 0 (unsuccess: 6) [wp] Report in: 'tests/wp_acsl/oracle_qualif/assigns_range.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/assigns_range.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success call_assigns_t1 - - 2 0.0% call_assigns_t2 - - 2 0.0% call_assigns_t4 - - 2 0.0% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.1.session/������������0000777�0000000�0000000�00000000000�13571573400�026155� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.1.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027220� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.1.session/cache/09d5c02631d5ca87b084ca3e64dc38d1.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.1.session/cache/09d5c00000666�0000000�0000000�00000000107�13571573400�030045� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.1.session/cache/801fd980d7f251786363b0010fdb0d7c.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.1.session/cache/801fd90000666�0000000�0000000�00000000107�13571573400�030054� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.1.session/cache/c77d39c9e3d9f3a0a1a2eba86ddf32bb.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.1.session/cache/c77d390000666�0000000�0000000�00000000107�13571573400�030061� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.i.0.report.json�������0000666�0000000�0000000�00000014211�13571573400�027125� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 3 }, "qed": { "total": 12, "valid": 12 }, "wp:main": { "total": 17, "valid": 17, "rank": 3 } }, "wp:functions": { "call_assigns_all": { "assigns_t4_sup_bound_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "assigns_t3_inf_bound_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "assigns_t2_bound_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "assigns_t1_an_element_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "call_assigns_all_assigns": { "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 10, "valid": 10 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 3 }, "qed": { "total": 12, "valid": 12 }, "wp:main": { "total": 14, "valid": 14, "rank": 3 } } }, "call_assigns_t1": { "assigns_t1_an_element_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } } }, "call_assigns_t2": { "assigns_t2_bound_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } } }, "call_assigns_t4": { "assigns_t4_sup_bound_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/assigns_range.i.1.report.json�������0000666�0000000�0000000�00000005454�13571573400�027137� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 6, "unknown": 6 }, "wp:main": { "total": 6, "unknown": 6 } }, "wp:functions": { "call_assigns_t1": { "call_assigns_t1_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "call_assigns_t2": { "call_assigns_t2_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "call_assigns_t4": { "call_assigns_t4_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024631� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025674� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/18272cbcbacbdee3afc9f607c0898da8.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/18272cbcbacbd0000666�0000000�0000000�00000000127�13571573400�027726� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0318, "steps": 32 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/bbb29605b3f16a545b51b5890bef9c4d.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/bbb29605b3f160000666�0000000�0000000�00000000126�13571573400�027513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.035, "steps": 45 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/c22b2b7de2cf2f354d9edafa47d34589.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/c22b2b7de2cf20000666�0000000�0000000�00000000107�13571573400�027646� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/d40fe249206bb99bb022dc99c31f13c3.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/d40fe249206bb0000666�0000000�0000000�00000000127�13571573400�027514� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0504, "steps": 70 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/d82134accee9fa37acc671a4193d9c28.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/d82134accee9f0000666�0000000�0000000�00000000126�13571573400�027663� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.021, "steps": 14 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/ebcd5db6abab43ea6e440b41c61de767.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/ebcd5db6abab40000666�0000000�0000000�00000000107�13571573400�030065� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/fa6ed598f056631f9bfaf5af5363a26b.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.0.session/cache/fa6ed598f05660000666�0000000�0000000�00000000127�13571573400�027541� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0216, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.i.0.report.json��������������0000666�0000000�0000000�00000007603�13571573400�025611� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 7, "valid": 5, "unknown": 2, "rank": 16 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 10, "valid": 8, "unknown": 2, "rank": 16 } }, "wp:functions": { "f": { "f_loop_invariant_Positive": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 9 } }, "f_loop_invariant_Index": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "f_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 16 } }, "f_ensures_Q": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "wp:main": { "total": 1, "valid": 1, "rank": 11 } }, "f_ensures_P_todo": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 7, "valid": 5, "unknown": 2, "rank": 16 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 10, "valid": 8, "unknown": 2, "rank": 16 } } } } } �����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/axioms.res.oracle�������������������0000666�0000000�0000000�00000002422�13571573400�024770� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/axioms.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 10 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_P_todo : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_Q : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_invariant_Index_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_invariant_Index_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_invariant_Positive_preserved : Valid [wp] [Qed] Goal typed_f_loop_invariant_Positive_established : Valid [wp] [Qed] Goal typed_f_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_f_loop_assigns_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_assigns_part3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assigns : Unsuccess [wp] Proved goals: 8 / 10 Qed: 3 Alt-Ergo 2.0.0: 5 (unsuccess: 2) [wp] Report in: 'tests/wp_acsl/oracle_qualif/axioms.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/axioms.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 3 5 (56..80) 10 80.0% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/base_offset.0.session/��������������0000777�0000000�0000000�00000000000�13571573400�025611� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/base_offset.0.session/cache/��������0000777�0000000�0000000�00000000000�13571573400�026654� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/base_offset.0.session/cache/31b7327f039e0b07f5212fb83a9e9e89.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/base_offset.0.session/cache/31b7327f0000666�0000000�0000000�00000000072�13571573400�027654� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/base_offset.i.0.report.json���������0000666�0000000�0000000�00000002564�13571573400�026572� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } }, "wp:functions": { "f": { "f_ensures_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_ensures_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/base_offset.res.oracle��������������0000666�0000000�0000000�00000001465�13571573400�025756� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/base_offset.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_f_ensures : Valid [wp] [Qed] Goal typed_f_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_3 : Unsuccess [wp] Proved goals: 2 / 3 Qed: 2 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/base_offset.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/base_offset.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 2 - 3 66.7% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024777� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026042� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/cache/1ecbe0b41a07f6fd2241aff3258cd377.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/cache/1ecbe0b41a070000666�0000000�0000000�00000000126�13571573400�027642� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.016, "steps": 13 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/cache/22c1313f9df2b9bda80d2bb8c4d175fc.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/cache/22c1313f9df20000666�0000000�0000000�00000000127�13571573400�027516� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0106, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/cache/4fc19b7c827e48214e31ff4f16d7a060.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/cache/4fc19b7c827e0000666�0000000�0000000�00000000127�13571573400�027615� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0087, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/cache/7aa1ae97b0ddd96dc9a92948a21d089d.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.0.session/cache/7aa1ae97b0dd0000666�0000000�0000000�00000000127�13571573400�027736� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0352, "steps": 26 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.i.0.report.json�������������0000666�0000000�0000000�00000035252�13571573400�025760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 1, "unknown": 3, "rank": 2 }, "qed": { "total": 25, "valid": 25 }, "wp:main": { "total": 29, "valid": 26, "unknown": 3, "rank": 2 } }, "wp:functions": { "band": { "band_bit4_ensures_band6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "band_bit3_ensures_band5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "band_bit2_ensures_band4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "band_bit1_ensures_band3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "band_bit0_ensures_band2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "band_bit0_ensures_band1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "band_ensures_band0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "band_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } }, "bor": { "bor_bit3_ensures_bor3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bor_bit2_ensures_bor2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bor_bit1_ensures_bor1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bor_ensures_bor0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bor_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "bxor": { "bxor_bit2_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bxor_bit1_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bxor_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "bnot": { "bnot_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "lshift": { "lshift_shift2_ensures_lsl3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lshift_shift1_ensures_lsl2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lshift_shift1_ensures_lsl1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lshift_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } }, "rshift": { "rshift_shift1_ensures_lsr1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "rshift_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "bor_bool": { "bor_bool_false_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bor_bool_true_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 2 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1, "rank": 2 } } }, "band_bool": { "band_bool_false_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "band_bool_true_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "bxor_bool": { "bxor_bool_false_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bxor_bool_true_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise.res.oracle������������������0000666�0000000�0000000�00000005124�13571573400�025140� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/bitwise.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 29 goals scheduled [wp] [Qed] Goal typed_band_ensures : Valid [wp] [Qed] Goal typed_band_ensures_band0 : Valid [wp] [Qed] Goal typed_band_bit0_ensures_band1 : Valid [wp] [Qed] Goal typed_band_bit0_ensures_band2 : Valid [wp] [Qed] Goal typed_band_bit1_ensures_band3 : Valid [wp] [Qed] Goal typed_band_bit2_ensures_band4 : Valid [wp] [Qed] Goal typed_band_bit3_ensures_band5 : Valid [wp] [Qed] Goal typed_band_bit4_ensures_band6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_band_bool_false_ensures : Valid [wp] [Qed] Goal typed_band_bool_true_ensures : Valid [wp] [Qed] Goal typed_bnot_ensures : Valid [wp] [Qed] Goal typed_bor_ensures : Valid [wp] [Qed] Goal typed_bor_ensures_bor0 : Valid [wp] [Qed] Goal typed_bor_bit1_ensures_bor1 : Valid [wp] [Qed] Goal typed_bor_bit2_ensures_bor2 : Valid [wp] [Qed] Goal typed_bor_bit3_ensures_bor3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bor_bool_false_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bor_bool_true_ensures : Valid [wp] [Qed] Goal typed_bxor_ensures : Valid [wp] [Qed] Goal typed_bxor_bit1_ensures : Valid [wp] [Qed] Goal typed_bxor_bit2_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bxor_bool_false_ensures : Valid [wp] [Qed] Goal typed_bxor_bool_true_ensures : Valid [wp] [Qed] Goal typed_lshift_ensures : Valid [wp] [Qed] Goal typed_lshift_shift1_ensures_lsl1 : Valid [wp] [Qed] Goal typed_lshift_shift1_ensures_lsl2 : Valid [wp] [Qed] Goal typed_lshift_shift2_ensures_lsl3 : Valid [wp] [Qed] Goal typed_rshift_ensures : Valid [wp] [Qed] Goal typed_rshift_shift1_ensures_lsr1 : Valid [wp] Proved goals: 29 / 29 Qed: 25 Alt-Ergo 2.0.0: 4 [wp] Report in: 'tests/wp_acsl/oracle_qualif/bitwise.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/bitwise.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success band 8 - 8 100% bor 5 - 5 100% bxor 3 - 3 100% bnot 1 - 1 100% lshift 4 - 4 100% rshift 2 - 2 100% bor_bool - 2 (8..20) 2 100% band_bool 1 1 (20..32) 2 100% bxor_bool 1 1 (8..20) 2 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise2.0.report.json��������������0000666�0000000�0000000�00000005713�13571573400�025612� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } }, "wp:functions": { "job1": { "job1_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job1bis": { "job1bis_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job2": { "job2_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job3": { "job3_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job4": { "job4_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise2.i.0.report.json������������0000666�0000000�0000000�00000005713�13571573400�026041� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } }, "wp:functions": { "job1": { "job1_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job1bis": { "job1bis_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job2": { "job2_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job3": { "job3_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job4": { "job4_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/bitwise2.res.oracle�����������������0000666�0000000�0000000�00000002071�13571573400�025220� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/bitwise2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 5 goals scheduled [wp] [Qed] Goal typed_job1_ensures : Valid [wp] [Qed] Goal typed_job1bis_ensures : Valid [wp] [Qed] Goal typed_job2_ensures : Valid [wp] [Qed] Goal typed_job3_ensures : Valid [wp] [Qed] Goal typed_job4_ensures : Valid [wp] Proved goals: 5 / 5 Qed: 5 [wp] Report in: 'tests/wp_acsl/oracle_qualif/bitwise2.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/bitwise2.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job1 1 - 1 100% job1bis 1 - 1 100% job2 1 - 1 100% job3 1 - 1 100% job4 1 - 1 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/block_length.i.0.report.json��������0000666�0000000�0000000�00000006265�13571573400�026747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 10, "valid": 10 } }, "wp:functions": { "f": { "f_ensures_Pts1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Pmat12": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Pt1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Pts": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Ps": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Pmat2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Psiz2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Pmat1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Psiz1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Pt": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 10, "valid": 10 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/block_length.res.oracle�������������0000666�0000000�0000000�00000002107�13571573400�026123� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/block_length.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 10 goals scheduled [wp] [Qed] Goal typed_f_ensures_Pt : Valid [wp] [Qed] Goal typed_f_ensures_Psiz1 : Valid [wp] [Qed] Goal typed_f_ensures_Pmat1 : Valid [wp] [Qed] Goal typed_f_ensures_Psiz2 : Valid [wp] [Qed] Goal typed_f_ensures_Pmat2 : Valid [wp] [Qed] Goal typed_f_ensures_Ps : Valid [wp] [Qed] Goal typed_f_ensures_Pts : Valid [wp] [Qed] Goal typed_f_ensures_Pt1 : Valid [wp] [Qed] Goal typed_f_ensures_Pmat12 : Valid [wp] [Qed] Goal typed_f_ensures_Pts1 : Valid [wp] Proved goals: 10 / 10 Qed: 10 [wp] Report in: 'tests/wp_acsl/oracle_qualif/block_length.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/block_length.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 10 - 10 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/checks.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024571� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/checks.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025634� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/checks.0.session/cache/720b1b51dec0a3fbd5b6f5f8d3f5d6f9.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/checks.0.session/cache/720b1b51dec0a0000666�0000000�0000000�00000000106�13571573400�027514� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 5 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/checks.res.oracle�������������������0000666�0000000�0000000�00000004330�13571573400�024730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 5 [...] [kernel] Parsing tests/wp_acsl/checks.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_main_check_c1 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_assert_a1 : Unsuccess [wp] [Qed] Goal typed_main_check_c2 : Valid [wp] [Qed] Goal typed_main_assert_a2 : Valid [wp] Proved goals: 2 / 4 Qed: 2 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_acsl/oracle_qualif/checks.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/checks.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main 2 - 4 50.0% ------------------------------------------------------------- [report] Computing properties status... -------------------------------------------------------------------------------- --- Global Properties -------------------------------------------------------------------------------- [ Valid ] Axiomatic 'A' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Check 'c1' (file tests/wp_acsl/checks.i, line 14) tried with Wp.typed. [ - ] Assertion 'a1' (file tests/wp_acsl/checks.i, line 15) tried with Wp.typed. [ Partial ] Check 'c2' (file tests/wp_acsl/checks.i, line 16) By Wp.typed, with pending: - Assertion 'a1' (file tests/wp_acsl/checks.i, line 15) [ Partial ] Assertion 'a2' (file tests/wp_acsl/checks.i, line 17) By Wp.typed, with pending: - Assertion 'a1' (file tests/wp_acsl/checks.i, line 15) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 2 Locally validated 2 To be validated 5 Total -------------------------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.0.res.oracle���������0000666�0000000�0000000�00000001500�13571573400�026624� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/classify_float.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_InfN_not_finite : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_InfP_not_finite : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_NaN_not_finite : Valid [wp] Proved goals: 3 / 3 Qed: 0 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_acsl/oracle_qualif/classify_float.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/classify_float.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - 3 (4..16) 3 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.0.session/�����������0000777�0000000�0000000�00000000000�13571573400�026333� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.0.session/cache/�����0000777�0000000�0000000�00000000000�13571573400�027376� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.0.session/cache/0b96e48ee127a1425284f14d35224e5e.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.0.session/cache/0b96e0000666�0000000�0000000�00000000126�13571573400�030145� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.022, "steps": 11 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.0.session/cache/377b1ddc5cd0851120f14ebc55cb07a4.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.0.session/cache/377b10000666�0000000�0000000�00000000127�13571573400�030064� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0221, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.0.session/cache/9a3235da49aa1f5332c48d29cb5e4f60.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.0.session/cache/9a3230000666�0000000�0000000�00000000127�13571573400�030062� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0145, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.res.oracle���������0000666�0000000�0000000�00000001617�13571573400�026636� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/classify_float.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: native support for alt-ergo is deprecated, use why3 instead [wp] 3 goals scheduled [wp] [Alt-Ergo (Native)] Goal typed_lemma_InfN_not_finite : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_InfP_not_finite : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_NaN_not_finite : Valid [wp] Proved goals: 3 / 3 Qed: 0 Alt-Ergo: 3 [wp] Report in: 'tests/wp_acsl/oracle_qualif/classify_float.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/classify_float.1.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - - (4..16) 3 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.session/�����������0000777�0000000�0000000�00000000000�13571573400�026334� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.session/cache/�����0000777�0000000�0000000�00000000000�13571573400�027377� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.session/cache/0b96e48ee127a1425284f14d35224e5e.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.session/cache/0b96e0000666�0000000�0000000�00000000127�13571573400�030147� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0213, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.session/cache/377b1ddc5cd0851120f14ebc55cb07a4.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.session/cache/377b10000666�0000000�0000000�00000000127�13571573400�030065� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0168, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.session/cache/9a3235da49aa1f5332c48d29cb5e4f60.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.session/cache/9a3230000666�0000000�0000000�00000000127�13571573400�030063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0215, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.2.res.oracle���������0000666�0000000�0000000�00000002052�13571573400�026631� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/classify_float.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: native support for coq is deprecated, use tip instead [wp] 3 goals scheduled [wp] [Coq] Goal typed_lemma_InfN_not_finite : Saved script [wp] [Coq (Native)] Goal typed_lemma_InfN_not_finite : Valid [wp] [Coq] Goal typed_lemma_InfP_not_finite : Saved script [wp] [Coq (Native)] Goal typed_lemma_InfP_not_finite : Valid [wp] [Coq] Goal typed_lemma_NaN_not_finite : Saved script [wp] [Coq (Native)] Goal typed_lemma_NaN_not_finite : Valid [wp] Proved goals: 3 / 3 Qed: 0 Coq: 3 [wp] Report in: 'tests/wp_acsl/oracle_qualif/classify_float.2.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/classify_float.2.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - - 3 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.3.res.oracle���������0000666�0000000�0000000�00000001455�13571573400�026640� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Real)' [...] [kernel] Parsing tests/wp_acsl/classify_float.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 3 goals scheduled [wp] [Qed] Goal typed_real_lemma_InfN_not_finite : Valid [wp] [Qed] Goal typed_real_lemma_InfP_not_finite : Valid [wp] [Qed] Goal typed_real_lemma_NaN_not_finite : Valid [wp] Proved goals: 3 / 3 Qed: 3 [wp] Report in: 'tests/wp_acsl/oracle_qualif/classify_float.3.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/classify_float.3.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma 3 - 3 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.c.0.report.json������0000666�0000000�0000000�00000004205�13571573400�027300� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 1 } }, "wp:axiomatics": { "": { "lemma_NaN_not_finite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "lemma_InfP_not_finite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "lemma_InfN_not_finite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.c.1.report.json������0000666�0000000�0000000�00000004205�13571573400�027301� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 2 } }, "wp:axiomatics": { "": { "lemma_NaN_not_finite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "lemma_InfP_not_finite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "lemma_InfN_not_finite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 2 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.c.2.report.json������0000666�0000000�0000000�00000002367�13571573400�027311� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "coq": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:axiomatics": { "": { "lemma_NaN_not_finite": { "coq": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_InfP_not_finite": { "coq": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_InfN_not_finite": { "coq": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "coq": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/����������������������0000777�0000000�0000000�00000000000�13571573400�024077� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/����������������0000777�0000000�0000000�00000000000�13571573400�025142� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/01f6142393c61d0b4d78fdebfa54f289.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/01f6142393c61d0b0000666�0000000�0000000�00000000127�13571573400�027127� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0114, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/0a1563f5c57f0dc1e442b67ae3481600.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/0a1563f5c57f0dc10000666�0000000�0000000�00000000127�13571573400�027274� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0091, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/0e04b6829dbff9839c263060c47505ff.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/0e04b6829dbff9830000666�0000000�0000000�00000000127�13571573400�027316� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0072, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/1c0a18bd9dc3d4937d9da8bc4c97a590.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/1c0a18bd9dc3d4930000666�0000000�0000000�00000000126�13571573400�027356� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0095, "steps": 5 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/1e62e5ef01b026e0509b1f15b23edf82.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/1e62e5ef01b026e00000666�0000000�0000000�00000000127�13571573400�027267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0079, "steps": 28 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/240319af067db756838425ec03ce9c5e.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/240319af067db7560000666�0000000�0000000�00000000127�13571573400�027143� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0105, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/2ba0eb90ccbc289c4443c4c14a513f41.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/2ba0eb90ccbc289c0000666�0000000�0000000�00000000126�13571573400�027511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0091, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/36ba31ce017a23e3de44dfa8f021b045.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/36ba31ce017a23e30000666�0000000�0000000�00000000127�13571573400�027262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0104, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/3802694f8e50b26a879fa5235dea90dd.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/3802694f8e50b26a0000666�0000000�0000000�00000000126�13571573400�027146� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.013, "steps": 18 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/38c5c28a40dc96dd26f3c2dbffb7cf2c.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/38c5c28a40dc96dd0000666�0000000�0000000�00000000127�13571573400�027367� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0205, "steps": 57 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/3de87c93437108089c3fc3d147a110bf.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/3de87c93437108080000666�0000000�0000000�00000000125�13571573400�027073� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.009, "steps": 3 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/4042531f6f0428250d20692ed68e7695.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/4042531f6f0428250000666�0000000�0000000�00000000126�13571573400�026775� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0103, "steps": 5 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/40e5fd92406791c46a253a74b782a4ee.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/40e5fd92406791c40000666�0000000�0000000�00000000127�13571573400�027151� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0113, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/4fdf63524b5ce8bccf960e205c26c1c6.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/4fdf63524b5ce8bc0000666�0000000�0000000�00000000127�13571573400�027450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0077, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/552dc3412bb2994bb70538c2ef90e116.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/552dc3412bb2994b0000666�0000000�0000000�00000000126�13571573400�027216� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0067, "steps": 8 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/56badc38ebd11f85561b19682f3baaf5.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/56badc38ebd11f850000666�0000000�0000000�00000000130�13571573400�027436� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0247, "steps": 179 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/5bb8802cd33529e793ecb4ce980c8758.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/5bb8802cd33529e70000666�0000000�0000000�00000000126�13571573400�027227� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0063, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/66a24739918528d1d446c1d39100e1b5.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/66a24739918528d10000666�0000000�0000000�00000000127�13571573400�027020� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0129, "steps": 29 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/7dc9e2f1ca9f3c88e718c9e1b00aea08.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/7dc9e2f1ca9f3c880000666�0000000�0000000�00000000126�13571573400�027461� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0109, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/86081a9e69583a62b5e630f412c34a48.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/86081a9e69583a620000666�0000000�0000000�00000000125�13571573400�027100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.007, "steps": 8 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/8fcb381b63da5f4e9aca0d7a8f9e0b98.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/8fcb381b63da5f4e0000666�0000000�0000000�00000000127�13571573400�027447� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0086, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/b15e16b9c49e317f124993589d536cb3.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/b15e16b9c49e317f0000666�0000000�0000000�00000000127�13571573400�027311� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0122, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/c13fe2015b075f0e203350c84fc3f1c6.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/c13fe2015b075f0e0000666�0000000�0000000�00000000127�13571573400�027267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0154, "steps": 27 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/c21539213e6c5259862fd7389b7b271e.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/c21539213e6c52590000666�0000000�0000000�00000000126�13571573400�027063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0105, "steps": 8 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/e73151b5fb353f0fb6d7b0d07028da48.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/e73151b5fb353f0f0000666�0000000�0000000�00000000127�13571573400�027300� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0124, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/ef23f172217b73fca0708f1eeea72bfa.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/ef23f172217b73fc0000666�0000000�0000000�00000000127�13571573400�027303� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0113, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/f2efaa910a22ef83281aed6b33892862.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/f2efaa910a22ef830000666�0000000�0000000�00000000126�13571573400�027435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0082, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/fb4cac2192648dd647b2cfd761097a13.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/fb4cac2192648dd60000666�0000000�0000000�00000000127�13571573400�027365� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0101, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/fd50b32bedc05c1d4407ec0d91baae91.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/fd50b32bedc05c1d0000666�0000000�0000000�00000000127�13571573400�027505� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0122, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/fd5aae34d94298825cde6ebc3782886a.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/fd5aae34d94298820000666�0000000�0000000�00000000126�13571573400�027316� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0086, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/fe38c06e404e254e28944da9cfb91669.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.0.session/cache/fe38c06e404e254e0000666�0000000�0000000�00000000127�13571573400�027305� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0149, "steps": 37 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.i.0.report.json�����������������0000666�0000000�0000000�00000044101�13571573400�025051� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 32, "valid": 32, "rank": 30 }, "qed": { "total": 11, "valid": 11 }, "wp:main": { "total": 43, "valid": 43, "rank": 30 } }, "wp:functions": { "f": { "f_ensures_e2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_e1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_e0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_d9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "f_ensures_d8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_d7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "f_ensures_d6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "f_ensures_d5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_d4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "f_ensures_d3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_d2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "f_ensures_d1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_d0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_c9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_c8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_c7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "f_ensures_c6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "f_ensures_c5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 14 } }, "f_ensures_c4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_c3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_c2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_c1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_c0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_b9": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_b8": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_b7": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_b6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_b5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_b4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_b3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_b2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_b1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_b0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 30 }, "wp:main": { "total": 1, "valid": 1, "rank": 30 } }, "f_ensures_a8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_a7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 15 }, "wp:main": { "total": 1, "valid": 1, "rank": 15 } }, "f_ensures_a6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "f_ensures_a5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "f_ensures_a4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_a3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_a2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 32, "valid": 32, "rank": 30 }, "qed": { "total": 11, "valid": 11 }, "wp:main": { "total": 43, "valid": 43, "rank": 30 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/cnf.res.oracle����������������������0000666�0000000�0000000�00000037346�13571573400�024253� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/cnf.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 43 goals scheduled [wp:cnf] CNF=P_A /\ P_A1 /\ P_A2 [wp] [Qed] Goal typed_f_ensures_a0 : Valid [wp:cnf] CNF=P_A \/ P_A1 \/ P_A2 [wp] [Qed] Goal typed_f_ensures_a1 : Valid [wp:cnf] CNF=P_A2 [wp] [Qed] Goal typed_f_ensures_a2 : Valid [wp:cnf] CNF=((not P_A1) \/ P_A2) /\ (P_A1 \/ (not P_A2)) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_a3 : Valid [wp:cnf] CNF=((not P_A) \/ P_A1) /\ (P_A \/ P_A2) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_a4 : Valid [wp:cnf] CNF=(P_A \/ P_B) /\ (P_A \/ P_B1) /\ (P_A \/ P_B2) /\ (P_A \/ P_C) /\ (P_A1 \/ P_B) /\ (P_A1 \/ P_B1) /\ (P_A1 \/ P_B2) /\ (P_A1 \/ P_C) /\ (P_A2 \/ P_B) /\ (P_A2 \/ P_B1) /\ (P_A2 \/ P_B2) /\ (P_A2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_a5 : Valid [wp:cnf] CNF=(P_A \/ P_A1 \/ P_A2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B1 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_B1 \/ P_B2) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_B1 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_B2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B1 \/ P_B2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_a6 : Valid [wp:cnf] CNF=(P_A2 \/ P_C) /\ (P_A2 \/ (not P_B) \/ P_C) /\ (P_A2 \/ (not P_B1) \/ P_C) /\ (P_A2 \/ P_B2 \/ P_C) /\ (P_A2 \/ (not P_B) \/ (not P_B1) \/ P_B2) /\ (P_A2 \/ (not P_B) \/ (not P_B1) \/ P_C) /\ (P_A2 \/ (not P_B) \/ P_B2 \/ P_C) /\ (P_A2 \/ (not P_B1) \/ P_B2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_a7 : Valid [wp:cnf] CNF=((not P_A1) \/ P_A2 \/ P_C) /\ (P_A1 \/ (not P_A2) \/ P_C) /\ ((not P_A1) \/ P_A2 \/ (not P_B1) \/ P_B2) /\ ((not P_A1) \/ P_A2 \/ (not P_B1) \/ P_C) /\ ((not P_A1) \/ P_A2 \/ (not P_B2) \/ P_C) /\ ((not P_A1) \/ P_A2 \/ P_B1 \/ (not P_B2)) /\ ((not P_A1) \/ P_A2 \/ P_B1 \/ P_C) /\ ((not P_A1) \/ P_A2 \/ P_B2 \/ P_C) /\ (P_A1 \/ (not P_A2) \/ (not P_B1) \/ P_B2) /\ (P_A1 \/ (not P_A2) \/ (not P_B1) \/ P_C) /\ (P_A1 \/ (not P_A2) \/ (not P_B2) \/ P_C) /\ (P_A1 \/ (not P_A2) \/ P_B1 \/ (not P_B2)) /\ (P_A1 \/ (not P_A2) \/ P_B1 \/ P_C) /\ (P_A1 \/ (not P_A2) \/ P_B2 \/ P_C) /\ ((not P_A1) \/ P_A2 \/ (not P_B1) \/ (not P_B2) \/ P_C) /\ ((not P_A1) \/ P_A2 \/ (not P_B1) \/ P_B2 \/ P_C) /\ ((not P_A1) \/ P_A2 \/ P_B1 \/ (not P_B2) \/ P_C) /\ ((not P_A1) \/ P_A2 \/ P_B1 \/ P_B2 \/ P_C) /\ (P_A1 \/ (not P_A2) \/ (not P_B1) \/ (not P_B2) \/ P_C) /\ (P_A1 \/ (not P_A2) \/ (not P_B1) \/ P_B2 \/ P_C) /\ (P_A1 \/ (not P_A2) \/ P_B1 \/ (not P_B2) \/ P_C) /\ (P_A1 \/ (not P_A2) \/ P_B1 \/ P_B2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_a8 : Valid [wp:cnf] CNF=((not P_A) \/ P_A1 \/ P_C) /\ (P_A \/ P_A2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ (not P_B) \/ P_B1) /\ ((not P_A) \/ P_A1 \/ (not P_B) \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_B \/ P_B2) /\ ((not P_A) \/ P_A1 \/ P_B \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_B1 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_B2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_C) /\ (P_A \/ P_A2 \/ (not P_B) \/ P_B1) /\ (P_A \/ P_A2 \/ (not P_B) \/ P_C) /\ (P_A \/ P_A2 \/ P_B \/ P_B2) /\ (P_A \/ P_A2 \/ P_B \/ P_C) /\ (P_A \/ P_A2 \/ P_B1 \/ P_C) /\ (P_A \/ P_A2 \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ (not P_B) \/ P_B1 \/ P_B2) /\ ((not P_A) \/ P_A1 \/ (not P_B) \/ P_B1 \/ P_C) /\ ((not P_A) \/ P_A1 \/ (not P_B) \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B1) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_B \/ P_B2) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_B \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_B1 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_B \/ P_B1 \/ P_B2) /\ ((not P_A) \/ P_A1 \/ P_B \/ P_B1 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_B \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_B1 \/ P_B2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B1) /\ (P_A \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_B2) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B1 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B2 \/ P_C) /\ (P_A \/ P_A2 \/ (not P_B) \/ P_B1 \/ P_B2) /\ (P_A \/ P_A2 \/ (not P_B) \/ P_B1 \/ P_C) /\ (P_A \/ P_A2 \/ (not P_B) \/ P_B2 \/ P_C) /\ (P_A \/ P_A2 \/ P_B \/ P_B1 \/ P_B2) /\ (P_A \/ P_A2 \/ P_B \/ P_B1 \/ P_C) /\ (P_A \/ P_A2 \/ P_B \/ P_B2 \/ P_C) /\ (P_A \/ P_A2 \/ P_B1 \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ (not P_B) \/ P_B1 \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B1 \/ P_B2) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B1 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_B \/ P_B1 \/ P_B2) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_B \/ P_B1 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_B \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_B1 \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_B \/ P_B1 \/ P_B2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B1 \/ P_B2) /\ (P_A \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B1 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_B1 \/ P_B2) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_B1 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_B2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B1 \/ P_B2 \/ P_C) /\ (P_A \/ P_A2 \/ (not P_B) \/ P_B1 \/ P_B2 \/ P_C) /\ (P_A \/ P_A2 \/ P_B \/ P_B1 \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B1 \/ P_B2 \/ P_C) /\ ((not P_A) \/ P_A1 \/ P_A2 \/ P_B \/ P_B1 \/ P_B2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ (not P_B) \/ P_B1 \/ P_B2 \/ P_C) /\ (P_A \/ P_A1 \/ P_A2 \/ P_B \/ P_B1 \/ P_B2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_a9 : Valid [wp:cnf] CNF=P_B /\ P_B1 /\ P_B2 /\ P_C [wp] [Qed] Goal typed_f_ensures_b0 : Valid [wp:cnf] CNF=P_C /\ (P_B \/ P_B1 \/ P_B2) [wp] [Qed] Goal typed_f_ensures_b1 : Valid [wp:cnf] CNF=P_C /\ ((not P_B) \/ (not P_B1) \/ P_B2) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_b2 : Valid [wp:cnf] CNF=P_C /\ ((not P_B1) \/ P_B2) /\ (P_B1 \/ (not P_B2)) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_b3 : Valid [wp:cnf] CNF=P_C /\ ((not P_B) \/ P_B1) /\ (P_B \/ P_B2) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_b4 : Valid [wp:cnf] CNF=true [wp] [Qed] Goal typed_f_ensures_b5 : Valid [wp:cnf] CNF=P_B \/ P_B1 \/ P_B2 \/ P_C1 [wp] [Qed] Goal typed_f_ensures_b6 : Valid [wp] [Qed] Goal typed_f_ensures_b7 : Valid [wp] [Qed] Goal typed_f_ensures_b8 : Valid [wp:cnf] CNF=true [wp] [Qed] Goal typed_f_ensures_b9 : Valid [wp:cnf] CNF=(P_B \/ P_C) /\ (P_B1 \/ P_C) /\ (P_B2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_c0 : Valid [wp:cnf] CNF=P_B \/ P_B1 \/ P_B2 \/ P_C [wp] [Qed] Goal typed_f_ensures_c1 : Valid [wp:cnf] CNF=P_B2 \/ P_C [wp] [Qed] Goal typed_f_ensures_c2 : Valid [wp:cnf] CNF=((not P_B1) \/ P_B2 \/ P_C) /\ (P_B1 \/ (not P_B2) \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_c3 : Valid [wp:cnf] CNF=((not P_B) \/ P_B1 \/ P_C) /\ (P_B \/ P_B2 \/ P_C) /\ ((not P_B) \/ P_B1 \/ P_B2 \/ P_C) /\ (P_B \/ P_B1 \/ P_B2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_c4 : Valid [wp:cnf] CNF=(P_B \/ (not P_C) \/ (not P_C1)) /\ (P_B \/ P_C \/ P_C1) /\ (P_B1 \/ (not P_C) \/ (not P_C1)) /\ (P_B1 \/ P_C \/ P_C1) /\ (P_B2 \/ (not P_C) \/ (not P_C1)) /\ (P_B2 \/ P_C \/ P_C1) /\ ((not P_B) \/ (not P_B1) \/ (not P_B2) \/ P_C1) /\ ((not P_B) \/ P_B1 \/ (not P_C) \/ (not P_C1)) /\ ((not P_B) \/ P_B1 \/ P_C \/ P_C1) /\ ((not P_B) \/ P_B2 \/ (not P_C) \/ (not P_C1)) /\ ((not P_B) \/ P_B2 \/ P_C \/ P_C1) /\ ((not P_B1) \/ P_B2 \/ (not P_C) \/ (not P_C1)) /\ ((not P_B1) \/ P_B2 \/ P_C \/ P_C1) /\ (P_B \/ (not P_B1) \/ (not P_C) \/ (not P_C1)) /\ (P_B \/ (not P_B1) \/ P_C \/ P_C1) /\ (P_B \/ (not P_B2) \/ (not P_C) \/ (not P_C1)) /\ (P_B \/ (not P_B2) \/ P_C \/ P_C1) /\ (P_B \/ P_B1 \/ P_C \/ P_C1) /\ (P_B \/ P_B2 \/ P_C \/ P_C1) /\ (P_B1 \/ (not P_B2) \/ (not P_C) \/ (not P_C1)) /\ (P_B1 \/ (not P_B2) \/ P_C \/ P_C1) /\ (P_B1 \/ P_B2 \/ P_C \/ P_C1) /\ ((not P_B) \/ (not P_B1) \/ (not P_B2) \/ (not P_C) \/ P_C1) /\ ((not P_B) \/ (not P_B1) \/ P_B2 \/ (not P_C) \/ (not P_C1)) /\ ((not P_B) \/ (not P_B1) \/ P_B2 \/ P_C \/ P_C1) /\ ((not P_B) \/ P_B1 \/ (not P_B2) \/ (not P_C) \/ (not P_C1)) /\ ((not P_B) \/ P_B1 \/ (not P_B2) \/ P_C \/ P_C1) /\ ((not P_B) \/ P_B1 \/ P_B2 \/ P_C \/ P_C1) /\ (P_B \/ (not P_B1) \/ (not P_B2) \/ (not P_C) \/ (not P_C1)) /\ (P_B \/ (not P_B1) \/ (not P_B2) \/ P_C \/ P_C1) /\ (P_B \/ (not P_B1) \/ P_B2 \/ P_C \/ P_C1) /\ (P_B \/ P_B1 \/ (not P_B2) \/ P_C \/ P_C1) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_c5 : Valid [wp:cnf] CNF=((not P_B) \/ P_C1) /\ ((not P_B1) \/ P_C1) /\ ((not P_B2) \/ P_C1) /\ ((not P_B) \/ (not P_B1) \/ P_C1) /\ ((not P_B) \/ (not P_B2) \/ P_C1) /\ ((not P_B) \/ (not P_C) \/ P_C1) /\ ((not P_B) \/ P_B1 \/ P_C1) /\ ((not P_B) \/ P_B2 \/ P_C1) /\ ((not P_B1) \/ (not P_B2) \/ P_C1) /\ ((not P_B1) \/ (not P_C) \/ P_C1) /\ ((not P_B1) \/ P_B2 \/ P_C1) /\ ((not P_B2) \/ (not P_C) \/ P_C1) /\ (P_B \/ (not P_B1) \/ P_C1) /\ (P_B \/ (not P_B2) \/ P_C1) /\ (P_B1 \/ (not P_B2) \/ P_C1) /\ ((not P_B) \/ (not P_B1) \/ P_B2 \/ P_C1) /\ ((not P_B) \/ P_B1 \/ (not P_B2) \/ P_C1) /\ ((not P_B) \/ P_B1 \/ (not P_C) \/ P_C1) /\ ((not P_B) \/ P_B1 \/ P_B2 \/ P_C1) /\ ((not P_B) \/ P_B2 \/ (not P_C) \/ P_C1) /\ ((not P_B1) \/ P_B2 \/ (not P_C) \/ P_C1) /\ (P_B \/ (not P_B1) \/ (not P_B2) \/ P_C1) /\ (P_B \/ (not P_B1) \/ (not P_C) \/ P_C1) /\ (P_B \/ (not P_B1) \/ P_B2 \/ P_C1) /\ (P_B \/ (not P_B2) \/ (not P_C) \/ P_C1) /\ (P_B \/ P_B1 \/ (not P_B2) \/ P_C1) /\ (P_B1 \/ (not P_B2) \/ (not P_C) \/ P_C1) /\ ((not P_B) \/ P_B1 \/ P_B2 \/ (not P_C) \/ P_C1) /\ (P_B \/ (not P_B1) \/ P_B2 \/ (not P_C) \/ P_C1) /\ (P_B \/ P_B1 \/ (not P_B2) \/ (not P_C) \/ P_C1) /\ (P_B \/ P_B1 \/ P_B2 \/ (not P_C) \/ (not P_C1)) /\ (P_B \/ P_B1 \/ P_B2 \/ P_C \/ P_C1) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_c6 : Valid [wp:cnf] CNF=((not P_B2) \/ P_C1) /\ (P_B \/ P_C1) /\ (P_B1 \/ P_C1) /\ ((not P_B) \/ (not P_B2) \/ P_C1) /\ ((not P_B) \/ P_B1 \/ P_C1) /\ ((not P_B1) \/ (not P_B2) \/ P_C1) /\ ((not P_B2) \/ (not P_C) \/ P_C1) /\ (P_B \/ (not P_B1) \/ P_C1) /\ (P_B \/ (not P_B2) \/ P_C1) /\ (P_B \/ (not P_C) \/ P_C1) /\ (P_B \/ P_B1 \/ P_C1) /\ (P_B \/ P_B2 \/ P_C1) /\ (P_B1 \/ (not P_B2) \/ P_C1) /\ (P_B1 \/ (not P_C) \/ P_C1) /\ (P_B1 \/ P_B2 \/ P_C1) /\ ((not P_B) \/ (not P_B1) \/ (not P_B2) \/ P_C1) /\ ((not P_B) \/ (not P_B2) \/ (not P_C) \/ P_C1) /\ ((not P_B) \/ P_B1 \/ (not P_B2) \/ P_C1) /\ ((not P_B) \/ P_B1 \/ (not P_C) \/ P_C1) /\ ((not P_B) \/ P_B1 \/ P_B2 \/ P_C1) /\ ((not P_B1) \/ (not P_B2) \/ (not P_C) \/ P_C1) /\ (P_B \/ (not P_B1) \/ (not P_B2) \/ P_C1) /\ (P_B \/ (not P_B1) \/ (not P_C) \/ P_C1) /\ (P_B \/ (not P_B1) \/ P_B2 \/ P_C1) /\ (P_B \/ P_B1 \/ P_B2 \/ P_C1) /\ (P_B \/ P_B2 \/ (not P_C) \/ P_C1) /\ (P_B1 \/ P_B2 \/ (not P_C) \/ P_C1) /\ ((not P_B) \/ (not P_B1) \/ (not P_B2) \/ (not P_C) \/ P_C1) /\ ((not P_B) \/ (not P_B1) \/ P_B2 \/ (not P_C) \/ (not P_C1)) /\ ((not P_B) \/ (not P_B1) \/ P_B2 \/ P_C \/ P_C1) /\ ((not P_B) \/ P_B1 \/ P_B2 \/ (not P_C) \/ P_C1) /\ (P_B \/ (not P_B1) \/ P_B2 \/ (not P_C) \/ P_C1) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_c7 : Valid [wp:cnf] Too big CNF/DNF [wp:cnf] CNF=((P_C \/ (P_B2 <-> P_B1)) -> ((P_B2 <-> P_B1) <-> P_C1)) /\ (((P_B2 <-> P_B1) <-> P_C1) -> (P_C \/ (P_B2 <-> P_B1))) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_c8 : Valid [wp:cnf] Too big CNF/DNF [wp:cnf] CNF=((P_C \/ ((P_B -> P_B1) /\ ((not P_B) -> P_B2))) -> ((P_B2 <-> P_B1) <-> P_C1)) /\ (((P_B2 <-> P_B1) <-> P_C1) -> (P_C \/ ((P_B -> P_B1) /\ ((not P_B) -> P_B2)))) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_c9 : Valid [wp:cnf] CNF=(P_B \/ (not P_C)) /\ (P_B1 \/ (not P_C)) /\ (P_B2 \/ (not P_C)) /\ ((not P_B) \/ (not P_B1) \/ (not P_B2) \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d0 : Valid [wp:cnf] CNF=((not P_B) \/ P_C) /\ ((not P_B1) \/ P_C) /\ ((not P_B2) \/ P_C) /\ (P_B \/ P_B1 \/ P_B2 \/ (not P_C)) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d1 : Valid [wp:cnf] CNF=((not P_B2) \/ P_C) /\ (P_B \/ P_C) /\ (P_B1 \/ P_C) /\ ((not P_B) \/ (not P_B1) \/ P_B2 \/ (not P_C)) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d2 : Valid [wp:cnf] CNF=((not P_B1) \/ (not P_B2) \/ P_C) /\ ((not P_B1) \/ P_B2 \/ (not P_C)) /\ (P_B1 \/ (not P_B2) \/ (not P_C)) /\ (P_B1 \/ P_B2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d3 : Valid [wp:cnf] CNF=((not P_B) \/ (not P_B1) \/ P_C) /\ ((not P_B) \/ P_B1 \/ (not P_C)) /\ ((not P_B1) \/ (not P_B2) \/ P_C) /\ (P_B \/ (not P_B2) \/ P_C) /\ (P_B \/ P_B2 \/ (not P_C)) /\ ((not P_B) \/ P_B1 \/ P_B2 \/ (not P_C)) /\ (P_B \/ P_B1 \/ P_B2 \/ (not P_C)) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d4 : Valid [wp:cnf] CNF=((not P_B1) \/ P_B2) /\ (P_B \/ (not P_B1)) /\ (P_B \/ (not P_B2)) /\ (P_B \/ (not P_C)) /\ (P_B1 \/ (not P_B2)) /\ (P_B1 \/ (not P_C)) /\ (P_B2 \/ (not P_C)) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d5 : Valid [wp:cnf] CNF=((not P_B) \/ P_B1 \/ P_B2 \/ P_C) /\ (P_B \/ P_B1 \/ P_B2 \/ (not P_C)) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d6 : Valid [wp:cnf] CNF=((not P_B) \/ (not P_B1) \/ P_B2) /\ (P_B1 \/ P_B2 \/ P_C) /\ ((not P_B) \/ (not P_B1) \/ P_B2 \/ (not P_C)) /\ (P_B \/ P_B1 \/ P_B2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d7 : Valid [wp:cnf] CNF=((not P_B1) \/ P_B2) /\ (P_B1 \/ (not P_B2)) /\ ((not P_B1) \/ P_B2 \/ (not P_C)) /\ (P_B1 \/ (not P_B2) \/ (not P_C)) /\ (P_B1 \/ P_B2 \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d8 : Valid [wp:cnf] CNF=((not P_B) \/ P_B1 \/ (not P_B2)) /\ ((not P_B) \/ P_B1 \/ (not P_C)) /\ (P_B \/ (not P_B1) \/ P_B2) /\ (P_B \/ P_B2 \/ (not P_C)) /\ ((not P_B) \/ P_B1 \/ P_B2 \/ (not P_C)) /\ (P_B \/ P_B1 \/ P_B2 \/ (not P_C)) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_d9 : Valid [wp:cnf] CNF=P_A /\ ((not P_B) \/ P_C) /\ ((not P_A) \/ (not P_B) \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_e0 : Valid [wp:cnf] CNF=P_B /\ ((not P_B) \/ P_C) /\ ((not P_A) \/ (not P_B) \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_e1 : Valid [wp:cnf] CNF=P_C /\ ((not P_B) \/ P_C) /\ ((not P_A) \/ (not P_B) \/ P_C) [wp] [Why:Alt-Ergo,2.0.0] Goal typed_f_ensures_e2 : Valid [wp] Proved goals: 43 / 43 Qed: 12 Alt-Ergo 2.0.0: 31 [wp] Report in: 'tests/wp_acsl/oracle_qualif/cnf.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/cnf.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 12 31 (168..192) 43 100% ------------------------------------------------------------- [wp] Logging keys: success-only,shell,cnf. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/ctor.0.report.json������������������0000666�0000000�0000000�00000001731�13571573400�025025� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:axiomatics": { "Event": { "lemma_diff": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_cons": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ���������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/ctor.i.0.report.json����������������0000666�0000000�0000000�00000001731�13571573400�025254� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:axiomatics": { "Event": { "lemma_diff": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_cons": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ���������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/ctor.res.oracle���������������������0000666�0000000�0000000�00000001234�13571573400�024437� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/ctor.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 2 goals scheduled [wp] [Qed] Goal typed_lemma_cons : Valid [wp] [Qed] Goal typed_lemma_diff : Valid [wp] Proved goals: 2 / 2 Qed: 2 [wp] Report in: 'tests/wp_acsl/oracle_qualif/ctor.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/ctor.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic Event 2 - 2 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.res.oracle����������������0000666�0000000�0000000�00000004066�13571573400�025255� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/div_mod.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 22 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d0_div_pos_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d1_div_neg_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d2_div_pos_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d3_div_neg_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d4_div_x_1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d5_div_x_minus1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d6_div_0_x : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sd0_div_pos_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sd1_div_neg_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sd2_div_pos_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sd3_div_neg_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m0_mod_pos_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m1_mod_neg_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m2_mod_pos_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m3_mod_neg_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m4_mod_x_1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m5_mod_x_minus1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m6_mod_0_x : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sm0_mod_pos_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sm1_mod_neg_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sm2_mod_pos_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sm3_mod_neg_neg : Valid [wp] Proved goals: 22 / 22 Qed: 0 Alt-Ergo 2.0.0: 22 [wp] Report in: 'tests/wp_acsl/oracle_qualif/div_mod.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/div_mod.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 22 (8..20) 22 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024752� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026015� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/44bfcd84497c1c379bc0b02525bc51ec.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/44bfcd84497c0000666�0000000�0000000�00000000127�13571573400�027571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0157, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/479f1bfb29d85f65371b04c1a243f4e3.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/479f1bfb29d80000666�0000000�0000000�00000000127�13571573400�027573� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0157, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/4b9760bdd31f7e65841794504859d1e2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/4b9760bdd31f0000666�0000000�0000000�00000000127�13571573400�027557� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0156, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/5d63c645e492af38b5a1d3859d7eeaa2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/5d63c645e4920000666�0000000�0000000�00000000126�13571573400�027426� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0073, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/6110c80065036f515b029169c819ef30.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/6110c80065030000666�0000000�0000000�00000000127�13571573400�027240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0108, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/74a8a8ffa4b4e9177b600ddb8bfb9700.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/74a8a8ffa4b40000666�0000000�0000000�00000000127�13571573400�027643� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0114, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/7d858dfd91200ecf83a156407ab6df41.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/7d858dfd91200000666�0000000�0000000�00000000127�13571573400�027511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0157, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/7f46ccdf53adb7491436d4ec9cacd70b.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/7f46ccdf53ad0000666�0000000�0000000�00000000127�13571573400�027723� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0177, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/9749dd5f15852dceee737755a7f829b3.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/9749dd5f15850000666�0000000�0000000�00000000127�13571573400�027442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0176, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/cbc69af7ff44dae806eb363d47e2f0c9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/cbc69af7ff440000666�0000000�0000000�00000000126�13571573400�027727� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.017, "steps": 11 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/d7903440b39a1276f7555554baa19daa.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/d7903440b39a0000666�0000000�0000000�00000000127�13571573400�027415� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0157, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/f22ea2eb3e900d6144ad40c3d082f288.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/f22ea2eb3e900000666�0000000�0000000�00000000127�13571573400�027631� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0121, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/f82e8f548cffbe0189a8fe63d2166368.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.0.session/cache/f82e8f548cff0000666�0000000�0000000�00000000126�13571573400�027661� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0126, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.res.oracle����������������0000666�0000000�0000000�00000004066�13571573400�025256� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/div_mod.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 22 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d0_div_pos_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d1_div_neg_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d2_div_pos_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d3_div_neg_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d4_div_x_1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d5_div_x_minus1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d6_div_0_x : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sd0_div_pos_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sd1_div_neg_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sd2_div_pos_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sd3_div_neg_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m0_mod_pos_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m1_mod_neg_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m2_mod_pos_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m3_mod_neg_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m4_mod_x_1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m5_mod_x_minus1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m6_mod_0_x : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sm0_mod_pos_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sm1_mod_neg_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sm2_mod_pos_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_sm3_mod_neg_neg : Valid [wp] Proved goals: 22 / 22 Qed: 0 Alt-Ergo 2.0.0: 22 [wp] Report in: 'tests/wp_acsl/oracle_qualif/div_mod.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/div_mod.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 22 (8..20) 22 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/������������������0000777�0000000�0000000�00000000000�13571573400�024753� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026016� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/44bfcd84497c1c379bc0b02525bc51ec.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/44bfcd84497c0000666�0000000�0000000�00000000126�13571573400�027571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.011, "steps": 11 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/479f1bfb29d85f65371b04c1a243f4e3.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/479f1bfb29d80000666�0000000�0000000�00000000127�13571573400�027574� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0171, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/4b9760bdd31f7e65841794504859d1e2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/4b9760bdd31f0000666�0000000�0000000�00000000127�13571573400�027560� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0106, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/5d63c645e492af38b5a1d3859d7eeaa2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/5d63c645e4920000666�0000000�0000000�00000000126�13571573400�027427� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0087, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/6110c80065036f515b029169c819ef30.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/6110c80065030000666�0000000�0000000�00000000127�13571573400�027241� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0156, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/74a8a8ffa4b4e9177b600ddb8bfb9700.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/74a8a8ffa4b40000666�0000000�0000000�00000000127�13571573400�027644� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0128, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/7d858dfd91200ecf83a156407ab6df41.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/7d858dfd91200000666�0000000�0000000�00000000127�13571573400�027512� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0156, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/7f46ccdf53adb7491436d4ec9cacd70b.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/7f46ccdf53ad0000666�0000000�0000000�00000000127�13571573400�027724� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0143, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/9749dd5f15852dceee737755a7f829b3.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/9749dd5f15850000666�0000000�0000000�00000000127�13571573400�027443� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0234, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/cbc69af7ff44dae806eb363d47e2f0c9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/cbc69af7ff440000666�0000000�0000000�00000000127�13571573400�027731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0163, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/d7903440b39a1276f7555554baa19daa.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/d7903440b39a0000666�0000000�0000000�00000000127�13571573400�027416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0166, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/f22ea2eb3e900d6144ad40c3d082f288.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/f22ea2eb3e900000666�0000000�0000000�00000000127�13571573400�027632� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0113, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/f82e8f548cffbe0189a8fe63d2166368.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.1.session/cache/f82e8f548cff0000666�0000000�0000000�00000000126�13571573400�027662� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0096, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.2.res.oracle����������������0000666�0000000�0000000�00000001435�13571573400�025254� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/div_mod.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_d7_div_0_x_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_m7_mod_0_x_ko : Unsuccess [wp] Proved goals: 0 / 2 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_acsl/oracle_qualif/div_mod.2.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/div_mod.2.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 2 0.0% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.2.session/������������������0000777�0000000�0000000�00000000000�13571573400�024754� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.2.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026017� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.2.session/cache/7e3da19219501629671643d84602636b.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.2.session/cache/7e3da19219500000666�0000000�0000000�00000000107�13571573400�027416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.2.session/cache/d6668302c907360822639074896e6cf8.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.2.session/cache/d6668302c9070000666�0000000�0000000�00000000107�13571573400�027345� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.i.0.report.json�������������0000666�0000000�0000000�00000031463�13571573400�025733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 22, "valid": 22, "rank": 3 }, "wp:main": { "total": 22, "valid": 22, "rank": 3 } }, "wp:functions": { "f": { "f_ensures_sm3_mod_neg_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sm2_mod_pos_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sm1_mod_neg_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sm0_mod_pos_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_m6_mod_0_x": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_m5_mod_x_minus1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_m4_mod_x_1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_m3_mod_neg_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_m2_mod_pos_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_m1_mod_neg_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_m0_mod_pos_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_sd3_div_neg_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sd2_div_pos_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sd1_div_neg_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sd0_div_pos_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_d6_div_0_x": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_d5_div_x_minus1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_d4_div_x_1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_d3_div_neg_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_d2_div_pos_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_d1_div_neg_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_d0_div_pos_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 22, "valid": 22, "rank": 3 }, "wp:main": { "total": 22, "valid": 22, "rank": 3 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.i.1.report.json�������������0000666�0000000�0000000�00000031463�13571573400�025734� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 22, "valid": 22, "rank": 3 }, "wp:main": { "total": 22, "valid": 22, "rank": 2 } }, "wp:functions": { "f": { "f_ensures_sm3_mod_neg_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sm2_mod_pos_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sm1_mod_neg_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sm0_mod_pos_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_m6_mod_0_x": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_m5_mod_x_minus1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_m4_mod_x_1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_m3_mod_neg_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_m2_mod_pos_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_m1_mod_neg_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_m0_mod_pos_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_sd3_div_neg_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sd2_div_pos_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sd1_div_neg_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_sd0_div_pos_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_d6_div_0_x": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_ensures_d5_div_x_minus1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_d4_div_x_1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "f_ensures_d3_div_neg_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_d2_div_pos_neg": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_d1_div_neg_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_d0_div_pos_pos": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 22, "valid": 22, "rank": 3 }, "wp:main": { "total": 22, "valid": 22, "rank": 2 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/div_mod.i.2.report.json�������������0000666�0000000�0000000�00000002317�13571573400�025731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:functions": { "f": { "f_ensures_m7_mod_0_x_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_ensures_d7_div_0_x_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/e_imply.0.report.json���������������0000666�0000000�0000000�00000031723�13571573400�025520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 34, "valid": 34 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 42, "valid": 42 } }, "wp:functions": { "f": { "f_ensures_f1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_f0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_a0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p9": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 34, "valid": 34 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 42, "valid": 42 } } } } } ���������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/e_imply.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024767� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/e_imply.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026032� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/e_imply.0.session/cache/5d63c645e492af38b5a1d3859d7eeaa2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/e_imply.0.session/cache/5d63c645e4920000666�0000000�0000000�00000000126�13571573400�027443� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0086, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/e_imply.0.session/cache/9d34e1b8df5fccf6e523d0308ec54b9e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/e_imply.0.session/cache/9d34e1b8df5f0000666�0000000�0000000�00000000126�13571573400�027664� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0087, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/e_imply.i.0.report.json�������������0000666�0000000�0000000�00000136377�13571573400�025762� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 111, "valid": 111, "rank": 0 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 119, "valid": 119, "rank": 0 } }, "wp:axiomatics": { "": { "Qed_0077": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0076": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0075": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "Qed_0074": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0073": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "Qed_0072": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0071": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0070": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0069": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "Qed_0068": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "Qed_0067": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0066": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0065": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "Qed_0064": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0063": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0062": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0061": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0060": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0059": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0058": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0057": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0056": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0055": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0054": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0053": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0052": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0051": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0050": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0049": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0048": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0047": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0046": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0045": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0044": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0043": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0042": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0041": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0040": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0039": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0038": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0037": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0036": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0035": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0034": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0033": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0032": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0031": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0030": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0029": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0028": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0027": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0026": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0025": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0024": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0023": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0022": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0021": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0020": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0019": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0018": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0017": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0016": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0015": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0014": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0013": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0012": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0011": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0010": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0009": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0008": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0007": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0006": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0005": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0004": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0003": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0002": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "Qed_0001": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 77, "valid": 77, "rank": 0 }, "wp:main": { "total": 77, "valid": 77, "rank": 0 } } } }, "wp:functions": { "f": { "f_ensures_f1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_f0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_o9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_o8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_o7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_o6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_o5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_o4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_o2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_o1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_o0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_a0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_i9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_i8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_i7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_i6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_i5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_i3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_i2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_i1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_i0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p9": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_p7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_p6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_p4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_p3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_p2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_p1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "f_ensures_p0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 34, "valid": 34, "rank": 0 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 42, "valid": 42, "rank": 0 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/e_imply.res.oracle������������������0000666�0000000�0000000�00000005424�13571573400�025133� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/e_imply.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 42 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_p0 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_p1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_p2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_p3 : Valid [wp] [Qed] Goal typed_f_ensures_p4 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_p5 : Valid [wp] [Qed] Goal typed_f_ensures_p6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_p7 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_p8 : Valid [wp] [Qed] Goal typed_f_ensures_p9 : Valid [wp] [Qed] Goal typed_f_ensures_i0 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_i1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_i2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_i3 : Valid [wp] [Qed] Goal typed_f_ensures_i4 : Valid [wp] [Qed] Goal typed_f_ensures_i5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_i6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_i7 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_i8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_i9 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a0 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a4 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a7 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_a9 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_o0 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_o1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_o2 : Valid [wp] [Qed] Goal typed_f_ensures_o3 : Valid [wp] [Qed] Goal typed_f_ensures_o4 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_o5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_o6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_o7 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_o8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_o9 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_f0 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_f1 : Valid [wp] Proved goals: 42 / 42 Qed: 8 Alt-Ergo 2.0.0: 34 [wp] Report in: 'tests/wp_acsl/oracle_qualif/e_imply.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/e_imply.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 8 34 42 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.report.json�����������������0000666�0000000�0000000�00000015522�13571573400�025170� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 6 } }, "wp:functions": { "simple_struct": { "simple_struct_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "simple_array": { "simple_array_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "with_array_struct": { "with_array_struct_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "with_ptr_struct": { "with_ptr_struct_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } } }, "with_ptr_array": { "with_ptr_array_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "with_ptr_and_array_struct": { "with_ptr_and_array_struct_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024440� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025503� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/29f844e0252b436c115005bccb6bd46b.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/29f844e0252b430000666�0000000�0000000�00000000127�13571573400�027255� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0162, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/30399c40583302217a5c153235924ad2.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/30399c405833020000666�0000000�0000000�00000000126�13571573400�027110� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0163, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/76c29bfe8c97d224189a63098e1c3c95.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/76c29bfe8c97d20000666�0000000�0000000�00000000127�13571573400�027516� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0146, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/a8e5608996545756ebaec6753de5c6c1.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/a8e560899654570000666�0000000�0000000�00000000127�13571573400�027223� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0188, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/d23ae2e368db89350200d5d69bb722ec.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.0.session/cache/d23ae2e368db890000666�0000000�0000000�00000000126�13571573400�027502� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.023, "steps": 24 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.i.0.report.json���������������0000666�0000000�0000000�00000015522�13571573400�025417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 5 } }, "wp:functions": { "simple_struct": { "simple_struct_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "simple_array": { "simple_array_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "with_array_struct": { "with_array_struct_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } }, "with_ptr_struct": { "with_ptr_struct_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } }, "with_ptr_array": { "with_ptr_array_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } }, "with_ptr_and_array_struct": { "with_ptr_and_array_struct_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/equal.res.oracle��������������������0000666�0000000�0000000�00000002453�13571573400�024603� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/equal.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_simple_array_ensures : Valid [wp] [Qed] Goal typed_simple_struct_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_with_array_struct_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_with_ptr_and_array_struct_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_with_ptr_array_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_with_ptr_struct_ensures : Valid [wp] Proved goals: 6 / 6 Qed: 1 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_acsl/oracle_qualif/equal.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/equal.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success simple_struct 1 - 1 100% simple_array - 1 (12..24) 1 100% with_array_struct - 1 (12..24) 1 100% with_ptr_struct - 1 (4..16) 1 100% with_ptr_array - 1 (12..24) 1 100% with_ptr_and_array_struct - 1 (20..32) 1 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.report.json���������0000666�0000000�0000000�00000005757�13571573400�026705� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 4, "rank": 8 }, "wp:main": { "total": 4, "valid": 4, "rank": 8 } }, "wp:axiomatics": { "": { "lemma_test_float_compare_greater": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "lemma_test_float_compare": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "lemma_test_double_compare_greater": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "lemma_test_double_compare": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 4, "rank": 8 }, "wp:main": { "total": 4, "valid": 4, "rank": 8 } } } } } �����������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.res.oracle����������0000666�0000000�0000000�00000004246�13571573400�026447� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/float_compare.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 19 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_finite_32_64 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_finite_32_64_real : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_test_double_compare : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_test_double_compare_greater : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_test_float_compare : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_test_float_compare_greater : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_dd_ensures_DEF : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_dd_ensures_REL1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_dd_ensures_REL2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_fd_ensures_DEF : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_fd_ensures_REL1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_fd_ensures_REL2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_fd_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_fd_assert_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_ff_ensures_DEF : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_ff_ensures_REL1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_cmp_ff_ensures_REL2 : Valid [wp] [Qed] Goal typed_cmp_fnan_ensures_POS : Valid [wp] [Qed] Goal typed_cmp_fnan_ensures_NEG : Valid [wp] Proved goals: 18 / 19 Qed: 2 Alt-Ergo 2.0.0: 16 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/float_compare.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/float_compare.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - 5 (28..40) 6 83.3% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success cmp_ff - 3 (20..32) 3 100% cmp_dd - 3 (20..32) 3 100% cmp_fd - 5 (20..32) 5 100% cmp_fnan 2 - 2 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026144� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027207� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/10d9f6592ee2fd950288ebe6f5d3f531.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/10d9f60000666�0000000�0000000�00000000127�13571573400�030043� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0258, "steps": 27 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/317a8e39d81b6285d8bb0a46918b062e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/317a8e0000666�0000000�0000000�00000000127�13571573400�030042� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0304, "steps": 38 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/356edd7331c75234f303e6d3096f70c5.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/356edd0000666�0000000�0000000�00000000127�13571573400�030124� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0229, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/4344a1e4fc5a0418ca737c0a7be93591.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/4344a10000666�0000000�0000000�00000000127�13571573400�027752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0178, "steps": 38 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/45d5efa0014745864b946de074271fe4.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/45d5ef0000666�0000000�0000000�00000000127�13571573400�030126� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0273, "steps": 38 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/ba0b494f917626e21536de68be663206.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/ba0b490000666�0000000�0000000�00000000127�13571573400�030113� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0224, "steps": 38 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/ccae408301168be91c5c0bd2b0aeccb4.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/ccae400000666�0000000�0000000�00000000127�13571573400�030171� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0282, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/d6fabea34373ebdadaabe35c24d5d844.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/d6fabe0000666�0000000�0000000�00000000127�13571573400�030261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0258, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/d82e5a28f648497c89374602499307fa.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/d82e5a0000666�0000000�0000000�00000000127�13571573400�030122� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0211, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/d892b55ce1a00109c8dacf9303c5e094.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/d892b50000666�0000000�0000000�00000000127�13571573400�030047� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0232, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/e2c485bb5df33638440d4e418cb2f845.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/e2c4850000666�0000000�0000000�00000000072�13571573400�030043� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/e69df22f86875c4d3aa937b1aabbe6de.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/e69df20000666�0000000�0000000�00000000127�13571573400�030131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0274, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/ed1bfb911114eb90d99266280ea72387.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/ed1bfb0000666�0000000�0000000�00000000127�13571573400�030255� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0199, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/f8043e3845e19b26c1e940b241828ea5.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.0.session/cache/f8043e0000666�0000000�0000000�00000000127�13571573400�030043� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0253, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.res.oracle����������0000666�0000000�0000000�00000004173�13571573400�026447� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Real)' [...] [kernel] Parsing tests/wp_acsl/float_compare.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 19 goals scheduled [wp] [Qed] Goal typed_real_lemma_finite_32_64 : Valid [wp] [Qed] Goal typed_real_lemma_finite_32_64_real : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_real_lemma_test_double_compare : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_real_lemma_test_double_compare_greater : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_real_lemma_test_float_compare : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_real_lemma_test_float_compare_greater : Valid [wp] [Qed] Goal typed_real_cmp_dd_ensures_DEF : Valid [wp] [Qed] Goal typed_real_cmp_dd_ensures_REL1 : Valid [wp] [Qed] Goal typed_real_cmp_dd_ensures_REL2 : Valid [wp] [Qed] Goal typed_real_cmp_fd_ensures_DEF : Valid [wp] [Qed] Goal typed_real_cmp_fd_ensures_REL1 : Valid [wp] [Qed] Goal typed_real_cmp_fd_ensures_REL2 : Valid [wp] [Qed] Goal typed_real_cmp_fd_assert : Valid [wp] [Qed] Goal typed_real_cmp_fd_assert_2 : Valid [wp] [Qed] Goal typed_real_cmp_ff_ensures_DEF : Valid [wp] [Qed] Goal typed_real_cmp_ff_ensures_REL1 : Valid [wp] [Qed] Goal typed_real_cmp_ff_ensures_REL2 : Valid [wp] [Qed] Goal typed_real_cmp_fnan_ensures_POS : Valid [wp] [Qed] Goal typed_real_cmp_fnan_ensures_NEG : Valid [wp] Proved goals: 19 / 19 Qed: 15 Alt-Ergo 2.0.0: 4 [wp] Report in: 'tests/wp_acsl/oracle_qualif/float_compare.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/float_compare.1.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma 2 4 (1..12) 6 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success cmp_ff 3 - 3 100% cmp_dd 3 - 3 100% cmp_fd 5 - 5 100% cmp_fnan 2 - 2 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/������������0000777�0000000�0000000�00000000000�13571573400�026145� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027210� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/cache/0229e4d03dbe5dab56c7710d10ede856.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/cache/0229e40000666�0000000�0000000�00000000126�13571573400�027757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0057, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/cache/5a2626cdfff12f90f4c43a8b11ff70fb.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/cache/5a26260000666�0000000�0000000�00000000126�13571573400�027757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0047, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/cache/d189bb3b47019848c9af5b14c2febb1c.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/cache/d189bb0000666�0000000�0000000�00000000126�13571573400�030123� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0056, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/cache/e2c00d7a3ff17960fa10dee8b619ee99.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.1.session/cache/e2c00d0000666�0000000�0000000�00000000125�13571573400�030106� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.005, "steps": 4 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/float_compare.i.0.report.json�������0000666�0000000�0000000�00000005627�13571573400�027130� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 4, "valid": 4, "rank": 8 }, "wp:main": { "total": 4, "valid": 4, "rank": 8 } }, "wp:axiomatics": { "": { "lemma_test_float_compare_greater": { "alt-ergo": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "lemma_test_float_compare": { "alt-ergo": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "lemma_test_double_compare_greater": { "alt-ergo": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "lemma_test_double_compare": { "alt-ergo": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "wp:section": { "alt-ergo": { "total": 4, "valid": 4, "rank": 8 }, "wp:main": { "total": 4, "valid": 4, "rank": 8 } } } } } ���������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/funvar_inv.i.0.report.json����������0000666�0000000�0000000�00000003152�13571573400�026461� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:functions": { "f": { "f_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "f2": { "f2_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "g": { "g_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/funvar_inv.res.oracle���������������0000666�0000000�0000000�00000001635�13571573400�025652� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_acsl/funvar_inv.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_ref_f_loop_assigns : Valid [wp] [Qed] Goal typed_ref_f2_loop_assigns : Valid [wp] [Qed] Goal typed_ref_g_loop_assigns : Valid [wp] Proved goals: 3 / 3 Qed: 3 [wp] Report in: 'tests/wp_acsl/oracle_qualif/funvar_inv.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/funvar_inv.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 1 - 1 100% f2 1 - 1 100% g 1 - 1 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/implicit_enum_cast.0.report.json����0000666�0000000�0000000�00000001675�13571573400�027735� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 9, "valid": 9 } }, "wp:functions": { "bar": { "bar_assigns": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } }, "bar_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 9, "valid": 9 } } } } } �������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/implicit_enum_cast.i.0.report.json��0000666�0000000�0000000�00000001675�13571573400�030164� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 9, "valid": 9 } }, "wp:functions": { "bar": { "bar_assigns": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } }, "bar_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 9, "valid": 9 } } } } } �������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/implicit_enum_cast.res.oracle�������0000666�0000000�0000000�00000002161�13571573400�027340� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/implicit_enum_cast.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 9 goals scheduled [wp] [Qed] Goal typed_bar_ensures : Valid [wp] [Qed] Goal typed_bar_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_bar_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_bar_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_bar_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_bar_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_bar_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_bar_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_bar_assigns_normal_part5 : Valid [wp] Proved goals: 9 / 9 Qed: 9 [wp] Report in: 'tests/wp_acsl/oracle_qualif/implicit_enum_cast.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/implicit_enum_cast.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success bar 9 - 9 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_label.0.report.json������������0000666�0000000�0000000�00000006027�13571573400�026163� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 3, "unknown": 1, "rank": 5 } }, "wp:functions": { "main": { "main_requires_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job": { "job_ensures_OK": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } } }, "foreign": { "foreign_ensures_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "extra": { "extra_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_label.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025433� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_label.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026476� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_label.0.session/cache/c84282884407d8b312dc1b674cbe8aaa.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_label.0.session/cache/c842828840000666�0000000�0000000�00000000127�13571573400�027517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0177, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_label.0.session/cache/eff2b9bd2f173b980e8e1b5dcdbaa5bb.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_label.0.session/cache/eff2b9bd20000666�0000000�0000000�00000000107�13571573400�030064� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_label.i.0.report.json����������0000666�0000000�0000000�00000005665�13571573400�026421� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 2, "valid": 1, "unknown": 1, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 3, "unknown": 1, "rank": 5 } }, "wp:functions": { "main": { "main_requires_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "job": { "job_ensures_OK": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } } }, "foreign": { "foreign_ensures_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "extra": { "extra_ensures_KO": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ���������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_label.res.oracle���������������0000666�0000000�0000000�00000002304�13571573400�025571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/init_label.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_acsl/init_label.i:27: Warning: No code nor implicit assigns clause for function main, generating default assigns from the prototype [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_extra_ensures_KO : Unsuccess [wp] [Qed] Goal typed_foreign_ensures_OK : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_OK : Valid [wp] [Qed] Goal typed_main_requires_OK : Valid [wp] Proved goals: 3 / 4 Qed: 2 Alt-Ergo 2.0.0: 1 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/init_label.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/init_label.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main 1 - 1 100% job - 1 (16..28) 1 100% foreign 1 - 1 100% extra - - 1 0.0% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.res.oracle�������������0000666�0000000�0000000�00000004462�13571573400�025773� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/init_value.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 24 goals scheduled [wp] [Qed] Goal typed_fa1_ensures_qed_ok : Valid [wp] [Qed] Goal typed_fa2_ensures_qed_ok : Valid [wp] [Qed] Goal typed_fa3_ensures_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_fs1_ensures_qed_ok : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Struct_Simple_a : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Struct_Simple_b : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Simple_Array_0 : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Simple_Array_1 : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_With_Array_Struct_5 : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_With_Array_Struct_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_Sc_eq : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Sc_t : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Sc_t_2 : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Sc_c_2 : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Sc_c_3 : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_Tab_no_init : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_Tab_todo : Valid [wp] [Qed] Goal typed_main_requires_qed_ok : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_3 : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_todo : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_4 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_5 : Valid [wp] [Qed] Goal typed_main_requires_qed_ok_direct_init_union : Valid [wp] Proved goals: 24 / 24 Qed: 19 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_acsl/oracle_qualif/init_value.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/init_value.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main 16 4 (32..44) 20 100% fa1 1 - 1 100% fa2 1 - 1 100% fa3 1 - 1 100% fs1 - 1 (96..120) 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025470� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026533� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/1266a11568fc6ce4527751fb9f0bfc00.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/1266a11560000666�0000000�0000000�00000000127�13571573400�027532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0143, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/28ebee21bdc49b87750703c03cc83798.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/28ebee21b0000666�0000000�0000000�00000000127�13571573400�030035� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0158, "steps": 36 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/4841a6604ba903a9ba49400c68c2e73f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/4841a66040000666�0000000�0000000�00000000126�13571573400�027536� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0065, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/90e3000618dadd5adbcbdf38d9879d27.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/90e3000610000666�0000000�0000000�00000000130�13571573400�027517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0256, "steps": 106 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/9b0ec3f827a2dfbdd38a8306b140191e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.0.session/cache/9b0ec3f820000666�0000000�0000000�00000000126�13571573400�027762� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0067, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.res.oracle�������������0000666�0000000�0000000�00000004263�13571573400�025773� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/init_value.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 18 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_fa1_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_fa1_ensures_qed_ko_2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_fa2_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_fa2_ensures_qed_ko_2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_fa3_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_fa3_ensures_qed_ko_2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_fa3_ensures_qed_ko_3 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_fs1_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_fs1_ensures_qed_ko_2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_ko_requires_qed_ko_Sc_eq_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_ko_requires_qed_ko_Sc_t : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_ko_requires_qed_ko_Sc_c_2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_ko_requires_qed_ko_Tab_no_init : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_ko_requires_qed_ko_With_Array_Struct_3 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_ko_requires_qed_ko_Simple_Array_1 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_ko_requires_qed_ko_T1_6 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_ko_requires_qed_ko_indirect_init_union_b : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_ko_requires_qed_ko_indirect_init_union_t : Unsuccess [wp] Proved goals: 0 / 18 Alt-Ergo 2.0.0: 0 (unsuccess: 18) [wp] Report in: 'tests/wp_acsl/oracle_qualif/init_value.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/init_value.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main_ko - - 9 0.0% fa1 - - 2 0.0% fa2 - - 2 0.0% fa3 - - 3 0.0% fs1 - - 2 0.0% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/���������������0000777�0000000�0000000�00000000000�13571573400�025471� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026534� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/0835185dd71c7d1c718720d74a3ada10.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/0835185dd0000666�0000000�0000000�00000000107�13571573400�027622� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/2320083088fc84e76dc56f8d32a050b2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/2320083080000666�0000000�0000000�00000000107�13571573400�027446� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/2bf48ccc1394e38ad5c0acfd4573068a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/2bf48ccc10000666�0000000�0000000�00000000107�13571573400�030034� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/2d7c067450000666�0000000�0000000�00000000072�13571573400�027623� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/3ea2bffb31441a0ad6dd94f94352da21.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/3ea2bffb30000666�0000000�0000000�00000000107�13571573400�030112� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/53494c07d4ab866af097d757c756acc2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/53494c07d0000666�0000000�0000000�00000000107�13571573400�027623� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/5a1b4b09d644d4023654862eb30b6a74.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/5a1b4b09d0000666�0000000�0000000�00000000107�13571573400�027750� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/6617079c456c6ecdbc088dfb43e1a05a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/6617079c40000666�0000000�0000000�00000000107�13571573400�027547� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/6fd2c09f2259cb10e5973da49efb691a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/6fd2c09f20000666�0000000�0000000�00000000107�13571573400�027762� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/8593898c80b2f1f893d2111cd88fc898.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/8593898c80000666�0000000�0000000�00000000107�13571573400�027571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/912f7fe924733b72a8c62f519277c3bc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/912f7fe920000666�0000000�0000000�00000000107�13571573400�027713� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/94aa4eb49e58d0e0de082241117282c9.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/94aa4eb490000666�0000000�0000000�00000000107�13571573400�027763� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/a1cb57bb989678a2e21ae7c8e499ab5a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.1.session/cache/a1cb57bb90000666�0000000�0000000�00000000107�13571573400�030034� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.i.0.report.json����������0000666�0000000�0000000�00000026751�13571573400�026455� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 7, "valid": 7, "rank": 24 }, "qed": { "total": 17, "valid": 17 }, "wp:main": { "total": 24, "valid": 24, "rank": 24 } }, "wp:functions": { "main": { "main_requires_qed_ok_direct_init_union": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "main_requires_qed_ok_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "main_requires_qed_ok_todo": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "main_requires_qed_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Tab_todo": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "main_requires_qed_ok_Tab_no_init": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Sc_c_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Sc_c_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Sc_t_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Sc_t": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Sc_eq": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "main_requires_qed_ok_With_Array_Struct_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_With_Array_Struct_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Simple_Array_1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "main_requires_qed_ok_Simple_Array_0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Struct_Simple_b": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_qed_ok_Struct_Simple_a": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 6, "rank": 9 }, "qed": { "total": 14, "valid": 14 }, "wp:main": { "total": 20, "valid": 20, "rank": 9 } } }, "fa1": { "fa1_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "fa2": { "fa2_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "fa3": { "fa3_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "fs1": { "fs1_ensures_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 24 }, "wp:main": { "total": 1, "valid": 1, "rank": 24 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 24 }, "wp:main": { "total": 1, "valid": 1, "rank": 24 } } } } } �����������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value.i.1.report.json����������0000666�0000000�0000000�00000020640�13571573400�026445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 18, "unknown": 18 }, "wp:main": { "total": 18, "unknown": 18 } }, "wp:functions": { "main_ko": { "main_ko_requires_qed_ko_indirect_init_union_t": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_ko_requires_qed_ko_indirect_init_union_b": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_ko_requires_qed_ko_T1_6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_ko_requires_qed_ko_Simple_Array_1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_ko_requires_qed_ko_With_Array_Struct_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_ko_requires_qed_ko_Tab_no_init": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_ko_requires_qed_ko_Sc_c_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_ko_requires_qed_ko_Sc_t": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_ko_requires_qed_ko_Sc_eq_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 9, "unknown": 9 }, "wp:main": { "total": 9, "unknown": 9 } } }, "fa1": { "fa1_ensures_qed_ko_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "fa1_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "fa2": { "fa2_ensures_qed_ko_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "fa2_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "fa3": { "fa3_ensures_qed_ko_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "fa3_ensures_qed_ko_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "fa3_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "unknown": 3 }, "wp:main": { "total": 3, "unknown": 3 } } }, "fs1": { "fs1_ensures_qed_ko_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "fs1_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } ������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value_mem.0.session/�����������0000777�0000000�0000000�00000000000�13571573400�026326� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value_mem.0.session/cache/�����0000777�0000000�0000000�00000000000�13571573400�027371� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value_mem.0.session/cache/ada35ef3207f170ebebb1029d3420256.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value_mem.0.session/cache/ada350000666�0000000�0000000�00000000127�13571573400�030211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0307, "steps": 36 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value_mem.i.0.report.json������0000666�0000000�0000000�00000002676�13571573400�027313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 9 }, "wp:main": { "total": 2, "valid": 2, "rank": 9 } }, "wp:functions": { "main": { "main_ensures_Q": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "main_ensures_P": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 9 }, "wp:main": { "total": 2, "valid": 2, "rank": 9 } } } } } ������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/init_value_mem.res.oracle�����������0000666�0000000�0000000�00000001423�13571573400�026465� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/init_value_mem.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_main_ensures_P : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_ensures_Q : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_acsl/oracle_qualif/init_value_mem.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/init_value_mem.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main - 2 (32..44) 2 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/intbool.0.report.json���������������0000666�0000000�0000000�00000001243�13571573400�025522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "bug": { "bug_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/intbool.i.0.report.json�������������0000666�0000000�0000000�00000001243�13571573400�025751� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "bug": { "bug_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/intbool.res.oracle������������������0000666�0000000�0000000�00000001235�13571573400�025137� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/intbool.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Qed] Goal typed_bug_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 1 [wp] Report in: 'tests/wp_acsl/oracle_qualif/intbool.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/intbool.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success bug 1 - 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/label_escape.0.res.oracle�����������0000666�0000000�0000000�00000001263�13571573400�026227� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/label_escape.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Qed] Goal typed_g_assert_qed_ok_ok : Valid [wp] Proved goals: 1 / 1 Qed: 1 [wp] Report in: 'tests/wp_acsl/oracle_qualif/label_escape.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/label_escape.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success g 1 - 1 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/label_escape.1.res.oracle�����������0000666�0000000�0000000�00000001350�13571573400�026225� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/label_escape.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_qed_ko_oracle_ko : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/label_escape.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/label_escape.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 1 0.0% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/label_escape.1.session/�������������0000777�0000000�0000000�00000000000�13571573400�025731� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/label_escape.1.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�026774� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/label_escape.1.session/cache/f326c24c69a19b34d04e78fb2c67f80d.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/label_escape.1.session/cache/f326c240000666�0000000�0000000�00000000107�13571573400�027706� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/label_escape.i.0.report.json��������0000666�0000000�0000000�00000001173�13571573400�026704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "g": { "g_assert_qed_ok_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/label_escape.i.1.report.json��������0000666�0000000�0000000�00000001603�13571573400�026703� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "f": { "f_assert_qed_ko_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.report.json�����������������0000666�0000000�0000000�00000023523�13571573400�025156� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 17, "valid": 3, "unknown": 14, "rank": 16 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 21, "valid": 7, "unknown": 14, "rank": 16 } }, "wp:functions": { "h": { "h_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "h_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "main": { "main_requires_qed_ok_18": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_17": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_16": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_15": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_14": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_13": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_12": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_11": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_10": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_9": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_8": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_7": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_6": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_5": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_4": { "alt-ergo": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "main_requires_qed_ok_3": { "alt-ergo": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "main_requires_qed_ok_2": { "alt-ergo": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "main_requires_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 17, "valid": 3, "unknown": 14, "rank": 16 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 18, "valid": 4, "unknown": 14, "rank": 16 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024426� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025471� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/0f239620c3c1b66b8468a3f1020f5471.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/0f239620c3c1b60000666�0000000�0000000�00000000072�13571573400�027310� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/3b92daa0c60a8fd3936ce9728c00cb1b.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/3b92daa0c60a8f0000666�0000000�0000000�00000000127�13571573400�027531� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0191, "steps": 30 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/3fb4d0dcf9fda952e324462b078cf07e.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/3fb4d0dcf9fda90000666�0000000�0000000�00000000072�13571573400�027707� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/47d1b9e051b4330350aa41a5c9d5a242.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/47d1b9e051b4330000666�0000000�0000000�00000000107�13571573400�027313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/73c06b555235a7d0c550272daddaaf5c.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/73c06b555235a70000666�0000000�0000000�00000000107�13571573400�027237� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/850478f3d426778af16ee9be9a21ecb8.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/850478f3d426770000666�0000000�0000000�00000000107�13571573400�027200� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/deb52da9b678582b8c3439b66ad3fea5.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/deb52da9b678580000666�0000000�0000000�00000000072�13571573400�027476� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/e141038c0739ebf644c02fbfab4bc16c.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/e141038c0739eb0000666�0000000�0000000�00000000072�13571573400�027315� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/e1f6d3a532c8a83649031c67d6f02c37.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/e1f6d3a532c8a80000666�0000000�0000000�00000000107�13571573400�027461� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/e9ddcbfe8eae150dadeb9e43baa64aa4.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.0.session/cache/e9ddcbfe8eae150000666�0000000�0000000�00000000107�13571573400�027770� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.i.0.report.json���������������0000666�0000000�0000000�00000024217�13571573400�025406� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 18, "valid": 2, "unknown": 16, "rank": 14 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 21, "valid": 5, "unknown": 16, "rank": 16 } }, "wp:functions": { "h": { "h_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "h_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } } }, "main": { "main_requires_qed_ok_18": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_17": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_16": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_15": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_14": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_13": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_12": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_11": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_10": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_qed_ok_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "main_requires_qed_ok_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "main_requires_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 17, "valid": 2, "unknown": 15, "rank": 14 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 18, "valid": 3, "unknown": 15, "rank": 16 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/logic.res.oracle��������������������0000666�0000000�0000000�00000007310�13571573400�024566� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/logic.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_acsl/logic.i:65: Warning: Cast with incompatible pointers types (source: __anonstruct_Buint_4*) (target: uint32*) [wp] tests/wp_acsl/logic.i:49: Warning: Logic cast from struct (Tint2) not implemented yet [wp] tests/wp_acsl/logic.i:50: Warning: Logic cast from struct (Point) not implemented yet [wp] tests/wp_acsl/logic.i:51: Warning: Logic cast to struct (Point) from (int [2]) not implemented yet [wp] tests/wp_acsl/logic.i:52: Warning: Logic cast from struct (Point) not implemented yet [wp] tests/wp_acsl/logic.i:53: Warning: Logic cast from struct (Tint2) not implemented yet [wp] tests/wp_acsl/logic.i:54: Warning: Logic cast from struct (Buint) not implemented yet [wp] tests/wp_acsl/logic.i:55: Warning: Logic cast to struct (Buint) from (unsigned int) not implemented yet [wp] tests/wp_acsl/logic.i:56: Warning: Logic cast from struct (Tint6) not implemented yet [wp] tests/wp_acsl/logic.i:57: Warning: Logic cast to sized array (Triangle) from (int [6]) not implemented yet [wp] tests/wp_acsl/logic.i:58: Warning: Logic cast from struct (Tint6) not implemented yet [wp] tests/wp_acsl/logic.i:59: Warning: Logic cast from struct (Tint6) not implemented yet [wp] tests/wp_acsl/logic.i:60: Warning: Logic cast to sized array (int [2]) from (int [6]) not implemented yet [wp] tests/wp_acsl/logic.i:61: Warning: Logic cast from struct (Tint6) not implemented yet [wp] tests/wp_acsl/logic.i:62: Warning: Logic cast to struct (Tint2) from (int [6]) not implemented yet [wp] 21 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_h_ensures : Unsuccess [wp] [Qed] Goal typed_h_assigns_exit : Valid [wp] [Qed] Goal typed_h_assigns_normal : Valid [wp] [Qed] Goal typed_main_requires_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_4 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_5 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_6 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_7 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_8 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_9 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_10 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_11 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_12 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_13 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_14 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_15 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_16 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_17 : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_qed_ok_18 : Unsuccess (Stronger) [wp] Proved goals: 5 / 21 Qed: 3 Alt-Ergo 2.0.0: 2 (unsuccess: 16) [wp] Report in: 'tests/wp_acsl/oracle_qualif/logic.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/logic.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success h 2 - 3 66.7% main 1 2 (24..36) 18 16.7% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025465� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026530� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/0f63c1954a7d6baa2f8da8e60a928530.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/0f63c19540000666�0000000�0000000�00000000127�13571573400�027617� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0225, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/903d890ca7aeec177776404726fb9e34.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/903d890ca0000666�0000000�0000000�00000000127�13571573400�027677� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0572, "steps": 75 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/a8cfe2cc9d4446b768f13c185b5ae88f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/a8cfe2cc90000666�0000000�0000000�00000000127�13571573400�030122� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0225, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/c1429295f69a4db013f8d8d413ca0851.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/c1429295f0000666�0000000�0000000�00000000130�13571573400�027615� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.4748, "steps": 360 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/eb1487e9e86602ca063f756b4584adda.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.0.session/cache/eb1487e9e0000666�0000000�0000000�00000000127�13571573400�027770� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0206, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.i.0.report.json����������0000666�0000000�0000000�00000006567�13571573400�026455� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 42 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 8, "valid": 8, "rank": 42 } }, "wp:functions": { "copy": { "copy_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 42 }, "wp:main": { "total": 2, "valid": 2, "rank": 42 } }, "copy_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "copy_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "copy_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 17 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 17 } }, "copy_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 42 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 8, "valid": 8, "rank": 42 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/looplabels.res.oracle���������������0000666�0000000�0000000�00000002210�13571573400�025617� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/looplabels.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 8 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_copy_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_copy_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_copy_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_copy_loop_invariant_2_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_copy_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_copy_loop_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_copy_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_copy_assigns : Valid [wp] Proved goals: 8 / 8 Qed: 3 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_acsl/oracle_qualif/looplabels.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/looplabels.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success copy 3 5 (336..384) 8 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/null.0.report.json������������������0000666�0000000�0000000�00000005007�13571573400�025030� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 3, "rank": 1 } }, "wp:axiomatics": { "": { "lemma_valid_read_non_null": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "lemma_valid_non_null": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } } } }, "wp:functions": { "null_is_zero": { "null_is_zero_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/null.0.session/���������������������0000777�0000000�0000000�00000000000�13571573400�024303� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/null.0.session/cache/���������������0000777�0000000�0000000�00000000000�13571573400�025346� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000173�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/null.0.session/cache/431464c40dcbd394a0782b002a273b0c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/null.0.session/cache/431464c40dcbd390000666�0000000�0000000�00000000126�13571573400�027335� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0158, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000173�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/null.0.session/cache/4e785c9f5d5c5edf9cfd90e8b7186840.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/null.0.session/cache/4e785c9f5d5c5ed0000666�0000000�0000000�00000000126�13571573400�027525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0161, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/null.c.0.report.json����������������0000666�0000000�0000000�00000004641�13571573400�025254� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 2, "valid": 2, "rank": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 3, "rank": 1 } }, "wp:axiomatics": { "": { "lemma_valid_read_non_null": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "lemma_valid_non_null": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "alt-ergo": { "total": 2, "valid": 2, "rank": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } } } }, "wp:functions": { "null_is_zero": { "null_is_zero_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/null.res.oracle���������������������0000666�0000000�0000000�00000001756�13571573400�024453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/null.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_valid_non_null : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_valid_read_non_null : Valid [wp] [Qed] Goal typed_null_is_zero_ensures : Valid [wp] Proved goals: 3 / 3 Qed: 1 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_acsl/oracle_qualif/null.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/null.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - 2 (1..12) 2 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success null_is_zero 1 - 1 100% ------------------------------------------------------------- ������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.res.oracle����������������0000666�0000000�0000000�00000003550�13571573400�025311� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_acsl/pointer.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_acsl/pointer.i:50: Warning: Uncomparable locations p_0 and mem:t.(0) [wp] tests/wp_acsl/pointer.i:49: Warning: Uncomparable locations p_0 and mem:t.(0) [wp] 9 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_ref_absurd_ensures_qed_ko_Base_oracle_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ref_absurd_ensures_qed_ko_Comp_oracle_ko : Unsuccess [wp] [Qed] Goal typed_ref_array_ensures_Lt : Valid [wp] [Qed] Goal typed_ref_array_ensures_Le : Valid [wp] [Qed] Goal typed_ref_array_ensures_Eq : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_mixed_array_pointer_ensures_qed_ko_Le_oracle_ko : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_ref_mixed_array_pointer_ensures_qed_ko_Lt_oracle_ko : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_ref_pointer_ensures_qed_ko_Le_oracle_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ref_pointer_ensures_qed_ko_Eq_oracle_ko : Unsuccess [wp] Proved goals: 3 / 9 Qed: 3 Alt-Ergo 2.0.0: 0 (unsuccess: 6) [wp] Report in: 'tests/wp_acsl/oracle_qualif/pointer.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/pointer.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success array 3 - 3 100% pointer - - 2 0.0% mixed_array_pointer - - 2 0.0% absurd - - 2 0.0% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'absurd': /*@ behavior typed_ref: requires \separated(&p,q+(..)); */ void absurd(int *q); ��������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�025011� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026054� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/011e5f52d70fa0086a654148080a4fe9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/011e5f52d70f0000666�0000000�0000000�00000000072�13571573400�027527� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/29bd54364c6cbab6b5edf958e89561f6.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/29bd54364c6c0000666�0000000�0000000�00000000072�13571573400�027540� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/5292c3d3c867034980a3690da72406f0.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/5292c3d3c8670000666�0000000�0000000�00000000072�13571573400�027464� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/608256dd483458fbd63dc7eb8aa06df2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/608256dd48340000666�0000000�0000000�00000000072�13571573400�027403� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/6dadeba4671262b2ad4067da798f0a23.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/6dadeba467120000666�0000000�0000000�00000000072�13571573400�027670� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/9fc972b0f872f2d9d78708d1d3f86f83.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.0.session/cache/9fc972b0f8720000666�0000000�0000000�00000000072�13571573400�027552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.res.oracle����������������0000666�0000000�0000000�00000003450�13571573400�025311� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/pointer.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_acsl/pointer.i:50: Warning: Uncomparable locations p_0 and mem:t.(0) [wp] tests/wp_acsl/pointer.i:49: Warning: Uncomparable locations p_0 and mem:t.(0) [wp] 9 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_absurd_ensures_qed_ko_Base_oracle_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_absurd_ensures_qed_ko_Comp_oracle_ko : Unsuccess [wp] [Qed] Goal typed_array_ensures_Lt : Valid [wp] [Qed] Goal typed_array_ensures_Le : Valid [wp] [Qed] Goal typed_array_ensures_Eq : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mixed_array_pointer_ensures_qed_ko_Le_oracle_ko : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_mixed_array_pointer_ensures_qed_ko_Lt_oracle_ko : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_pointer_ensures_qed_ko_Le_oracle_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_pointer_ensures_qed_ko_Eq_oracle_ko : Unsuccess [wp] Proved goals: 3 / 9 Qed: 3 Alt-Ergo 2.0.0: 0 (unsuccess: 6) [wp] Report in: 'tests/wp_acsl/oracle_qualif/pointer.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/pointer.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success array 3 - 3 100% pointer - - 2 0.0% mixed_array_pointer - - 2 0.0% absurd - - 2 0.0% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'absurd': /*@ behavior typed: requires \separated(&p,q+(..)); */ void absurd(int *q); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/������������������0000777�0000000�0000000�00000000000�13571573400�025012� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026055� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/011e5f52d70fa0086a654148080a4fe9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/011e5f52d70f0000666�0000000�0000000�00000000072�13571573400�027530� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/29bd54364c6cbab6b5edf958e89561f6.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/29bd54364c6c0000666�0000000�0000000�00000000072�13571573400�027541� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/5292c3d3c867034980a3690da72406f0.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/5292c3d3c8670000666�0000000�0000000�00000000072�13571573400�027465� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/608256dd483458fbd63dc7eb8aa06df2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/608256dd48340000666�0000000�0000000�00000000072�13571573400�027404� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/6dadeba4671262b2ad4067da798f0a23.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/6dadeba467120000666�0000000�0000000�00000000072�13571573400�027671� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/9fc972b0f872f2d9d78708d1d3f86f83.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.1.session/cache/9fc972b0f8720000666�0000000�0000000�00000000072�13571573400�027553� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.i.0.report.json�������������0000666�0000000�0000000�00000011210�13571573400�025756� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 6, "unknown": 6 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 9, "valid": 3, "unknown": 6 } }, "wp:functions": { "array": { "array_ensures_Eq": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "array_ensures_Le": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "array_ensures_Lt": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "pointer": { "pointer_ensures_qed_ko_Eq_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "pointer_ensures_qed_ko_Le_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "mixed_array_pointer": { "mixed_array_pointer_ensures_qed_ko_Lt_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "mixed_array_pointer_ensures_qed_ko_Le_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "absurd": { "absurd_ensures_qed_ko_Comp_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "absurd_ensures_qed_ko_Base_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/pointer.i.1.report.json�������������0000666�0000000�0000000�00000011210�13571573400�025757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 6, "unknown": 6 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 9, "valid": 3, "unknown": 6 } }, "wp:functions": { "array": { "array_ensures_Eq": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "array_ensures_Le": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "array_ensures_Lt": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "pointer": { "pointer_ensures_qed_ko_Eq_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "pointer_ensures_qed_ko_Le_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "mixed_array_pointer": { "mixed_array_pointer_ensures_qed_ko_Lt_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "mixed_array_pointer_ensures_qed_ko_Le_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "absurd": { "absurd_ensures_qed_ko_Comp_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "absurd_ensures_qed_ko_Base_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/post_result.0.session/��������������0000777�0000000�0000000�00000000000�13571573400�025714� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/post_result.0.session/cache/��������0000777�0000000�0000000�00000000000�13571573400�026757� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/post_result.0.session/cache/3ed898ae35ca655f3ace9c43ba4407d1.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/post_result.0.session/cache/3ed898ae0000666�0000000�0000000�00000000107�13571573400�030132� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/post_result.i.0.report.json���������0000666�0000000�0000000�00000002724�13571573400�026673� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "wp:functions": { "correct": { "correct_assert_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "wrong": { "wrong_assert_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/post_result.res.oracle��������������0000666�0000000�0000000�00000001536�13571573400�026060� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/post_result.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_correct_assert_OK : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_wrong_assert_KO : Unsuccess [wp] Proved goals: 1 / 2 Qed: 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/post_result.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/post_result.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success correct 1 - 1 100% wrong - - 1 0.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.0.res.oracle�������������0000666�0000000�0000000�00000013767�13571573400�025741� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/precedence.i (no preprocessing) [kernel:annot-error] tests/wp_acsl/precedence.i:90: Warning: unexpected token ';' [kernel:annot-error] tests/wp_acsl/precedence.i:135: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:134: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:133: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:132: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:130: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:129: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:128: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:127: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:125: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:124: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:123: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:122: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:120: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:119: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:118: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:175: Warning: R is not a logic variable. Ignoring code annotation [kernel:annot-error] tests/wp_acsl/precedence.i:176: Warning: P is not a logic variable. Ignoring code annotation [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 52 goals scheduled [wp] [Qed] Goal typed_bitwise_ensures_r_precedence_and_xor : Valid [wp] [Qed] Goal typed_bitwise_ensures_l_precedence_and_xor : Valid [wp] [Qed] Goal typed_bitwise_ensures_r_precedence_xor_or : Valid [wp] [Qed] Goal typed_bitwise_ensures_l_precedence_xor_or : Valid [wp] [Qed] Goal typed_bitwise_ensures_r_precedence_or_implies : Valid [wp] [Qed] Goal typed_bitwise_ensures_l_precedence_or_implies : Valid [wp] [Qed] Goal typed_bitwise_ensures_ok_r_precedence_implies_or : Valid [wp] [Qed] Goal typed_bitwise_ensures_ok_since : Valid [wp] [Qed] Goal typed_bitwise_ensures_r_assoc_implies : Valid [wp] [Qed] Goal typed_bitwise_ensures_r_precedence_implies_equiv : Valid [wp] [Qed] Goal typed_bitwise_ensures_l_precedence_implies_equiv : Valid [wp] [Qed] Goal typed_comparison_ensures_chainable_lt_lt : Valid [wp] [Qed] Goal typed_comparison_ensures_chainable_le_le : Valid [wp] [Qed] Goal typed_comparison_ensures_chainable_gt_gt : Valid [wp] [Qed] Goal typed_comparison_ensures_chainable_ge_ge : Valid [wp] [Qed] Goal typed_comparison_ensures_chainable_eq_eq : Valid [wp] [Qed] Goal typed_comparison_ensures_r_precedence_eq_and : Valid [wp] [Qed] Goal typed_comparison_ensures_l_precedence_eq_and : Valid [wp] [Qed] Goal typed_comparison_ensures_r_precedence_neq_and : Valid [wp] [Qed] Goal typed_comparison_ensures_l_precedence_neq_and : Valid [wp] [Qed] Goal typed_predicate_ensures_r_precedence_and_xor : Valid [wp] [Qed] Goal typed_predicate_ensures_l_precedence_and_xor : Valid [wp] [Qed] Goal typed_predicate_ensures_r_precedence_xor_or : Valid [wp] [Qed] Goal typed_predicate_ensures_l_precedence_xor_or : Valid [wp] [Qed] Goal typed_predicate_ensures_r_precedence_or_implies : Valid [wp] [Qed] Goal typed_predicate_ensures_l_precedence_or_implies : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ok_r_precedence_implies_or : Valid [wp] [Qed] Goal typed_predicate_ensures_ok_since : Valid [wp] [Qed] Goal typed_predicate_ensures_r_assoc_implies : Valid [wp] [Qed] Goal typed_predicate_ensures_r_precedence_implies_equiv : Valid [wp] [Qed] Goal typed_predicate_ensures_l_precedence_implies_equiv : Valid [wp] [Qed] Goal typed_predicate_ensures_r_precedence_equiv_ite : Valid [wp] [Qed] Goal typed_predicate_ensures_m_precedence_equiv_ite : Valid [wp] [Qed] Goal typed_predicate_ensures_l_precedence_equiv_ite : Valid [wp] [Qed] Goal typed_predicate_ensures_r_assoc_ite : Valid [wp] [Qed] Goal typed_predicate_ensures_r_precedence_ite_forall : Valid [wp] [Qed] Goal typed_predicate_ensures_m_precedence_ite_forall : Valid [wp] [Qed] Goal typed_predicate_ensures_l_precedence_ite_forall : Valid [wp] [Qed] Goal typed_predicate_ensures_r_assoc_forall : Valid [wp] [Qed] Goal typed_predicate_ensures_r_precedence_ite_exists : Valid [wp] [Qed] Goal typed_predicate_ensures_m_precedence_ite_exists : Valid [wp] [Qed] Goal typed_predicate_ensures_l_precedence_ite_exists : Valid [wp] [Qed] Goal typed_predicate_ensures_r_assoc_exist : Valid [wp] [Qed] Goal typed_predicate_ensures_r_precedence_ite_let : Valid [wp] [Qed] Goal typed_predicate_ensures_m_precedence_ite_let : Valid [wp] [Qed] Goal typed_predicate_ensures_l_precedence_ite_let : Valid [wp] [Qed] Goal typed_predicate_ensures_r_assoc_let : Valid [wp] [Qed] Goal typed_predicate_ensures_scope_let : Valid [wp] [Qed] Goal typed_predicate_ensures_scope_let_2 : Valid [wp] [Qed] Goal typed_predicate_ensures_r_precedence_ite_naming : Valid [wp] [Qed] Goal typed_predicate_bitwise_ensures_r_precedence_equiv_Pand : Valid [wp] [Qed] Goal typed_predicate_bitwise_ensures_l_precedence_equiv_Pand : Valid [wp] Proved goals: 52 / 52 Qed: 51 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_acsl/oracle_qualif/precedence.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/precedence.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success predicate 29 1 (4..16) 30 100% comparison 9 - 9 100% bitwise 11 - 11 100% predicate_bitwise 2 - 2 100% ------------------------------------------------------------- ���������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025426� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026471� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.0.session/cache/ef707c0bb275753bd2194c2a2f336344.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.0.session/cache/ef707c0bb0000666�0000000�0000000�00000000126�13571573400�027772� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0101, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.res.oracle�������������0000666�0000000�0000000�00000013127�13571573400�025730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/precedence.i (no preprocessing) [kernel:annot-error] tests/wp_acsl/precedence.i:90: Warning: unexpected token ';' [kernel:annot-error] tests/wp_acsl/precedence.i:135: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:134: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:133: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:132: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:130: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:129: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:128: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:127: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:125: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:124: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:123: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:122: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:120: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:119: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:118: Warning: Inconsistent relation chain. [kernel:annot-error] tests/wp_acsl/precedence.i:175: Warning: R is not a logic variable. Ignoring code annotation [kernel:annot-error] tests/wp_acsl/precedence.i:176: Warning: P is not a logic variable. Ignoring code annotation [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 37 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_bitwise_ensures_ko_l_precedence_xor_and : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bitwise_ensures_ko_r_precedence_xor_and : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bitwise_ensures_ko_l_precedence_or_xor : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bitwise_ensures_ko_r_precedence_or_xor : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bitwise_ensures_ko_l_precedence_implies_or : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bitwise_ensures_ko_l_assoc_implies : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bitwise_ensures_ko_r_precedence_equiv_implies : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bitwise_ensures_ko_l_precedence_equiv_implies : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_comparison_ensures_ko_r_precedence_and_eq : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_comparison_ensures_ko_l_precedence_and_eq : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_comparison_ensures_ko_l_nonassoc_eq : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_comparison_ensures_ko_r_nonassoc_eq : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_comparison_ensures_ko_r_precedence_and_neq : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_comparison_ensures_ko_l_precedence_and_neq : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_precedence_xor_and : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_r_precedence_xor_and : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_precedence_or_xor : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_r_precedence_or_xor : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_precedence_implies_or : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_assoc_implies : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_r_precedence_equiv_implies : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_precedence_equiv_implies : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_r_precedence_ite_equiv : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_precedence_ite_equiv : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_assoc_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_r_precedence_forall_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_m_precedence_forall_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_precedence_forall_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_r_assoc_forall : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_r_precedence_exists_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_m_precedence_exists_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_precedence_exists_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_r_assoc_exist : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_r_precedence_let_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_m_precedence_let_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_precedence_let_ite : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_predicate_ensures_ko_l_assoc_naming : Unsuccess [wp] Proved goals: 0 / 37 Alt-Ergo 2.0.0: 0 (unsuccess: 37) [wp] Report in: 'tests/wp_acsl/oracle_qualif/precedence.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/precedence.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success predicate - - 23 0.0% comparison - - 6 0.0% bitwise - - 8 0.0% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/���������������0000777�0000000�0000000�00000000000�13571573400�025427� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026472� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/016ce89e9b8b999b7bf425d0ee1e7116.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/016ce89e90000666�0000000�0000000�00000000107�13571573400�027650� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/04f4761f14fb3a54c3035d0b417bffd8.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/04f4761f10000666�0000000�0000000�00000000107�13571573400�027555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/09c00cfae051f3b27e37f365250df44e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/09c00cfae0000666�0000000�0000000�00000000072�13571573400�027766� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/1481641686b389e08b15e043cb5bef91.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/1481641680000666�0000000�0000000�00000000107�13571573400�027421� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/1e04ebe21430dd8643cb3e4dad797b6b.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/1e04ebe210000666�0000000�0000000�00000000072�13571573400�027704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/2ab1808813f8d43d0488d16425a46f39.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/2ab1808810000666�0000000�0000000�00000000107�13571573400�027551� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/2ce0bee40cbc8ad442d39d6cf05ada0d.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/2ce0bee400000666�0000000�0000000�00000000107�13571573400�027764� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/2d078f164dc8273dcdd1f06ef1b97f9f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/2d078f1640000666�0000000�0000000�00000000072�13571573400�027561� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/3030f52742527d2fcb9fc935a40fdbec.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/3030f52740000666�0000000�0000000�00000000107�13571573400�027470� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/303fd6534adc78b34dd66abc242bee2c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/303fd65340000666�0000000�0000000�00000000107�13571573400�027554� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/32696eb870a9c92d67a124bfca3c99c5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/32696eb870000666�0000000�0000000�00000000072�13571573400�027573� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/332151f277e19559e7bc7b0e33c592fc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/332151f270000666�0000000�0000000�00000000072�13571573400�027471� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/36b7c4424bad8308393bae14b4ad8d83.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/36b7c44240000666�0000000�0000000�00000000072�13571573400�027556� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/37810e32c8adc217bca1893d56dd0d3c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/37810e32c0000666�0000000�0000000�00000000107�13571573400�027552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/42a23cf63801c6b924ac9c3fba58f28b.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/42a23cf630000666�0000000�0000000�00000000107�13571573400�027630� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/69e728a4ee84c1719a3c19171f6f72ca.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/69e728a4e0000666�0000000�0000000�00000000107�13571573400�027651� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/6bc1171b7f8d4e25fb74810d66d09a5a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/6bc1171b70000666�0000000�0000000�00000000072�13571573400�027631� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/71534ba44a0c80435ba49a794c00a63f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/71534ba440000666�0000000�0000000�00000000072�13571573400�027552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/74737c07a7ea74b64c5c92754c917319.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/74737c07a0000666�0000000�0000000�00000000107�13571573400�027561� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/7e9f5aec43f44bd30a69eb1d4bd91519.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/7e9f5aec40000666�0000000�0000000�00000000107�13571573400�030007� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/7f5cdd85335b91c16f75c45c0ded5dac.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/7f5cdd8530000666�0000000�0000000�00000000107�13571573400�027727� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/82ae98ac3f92a8b0606d357a4a184a09.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/82ae98ac30000666�0000000�0000000�00000000072�13571573400�027723� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/8345bb3cca3fbd801c1cd5733ef5df08.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/8345bb3cc0000666�0000000�0000000�00000000072�13571573400�027714� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/8e223e013f54ae81184a122d353ce342.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/8e223e0130000666�0000000�0000000�00000000107�13571573400�027547� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/9b397ed7034430ce10a317951e11139c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/9b397ed700000666�0000000�0000000�00000000072�13571573400�027651� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/9cd975d66b99841ef6a0b73ce9e1850a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/9cd975d660000666�0000000�0000000�00000000107�13571573400�027657� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/9d72f3e01192bff65d3d09f0a1a2b434.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/9d72f3e010000666�0000000�0000000�00000000107�13571573400�027637� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/9fb6579178e19e693e7fbb52c17de5e5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/9fb6579170000666�0000000�0000000�00000000107�13571573400�027576� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/a5f6f9ceafa7c53d9d28b7201ca5f910.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/a5f6f9cea0000666�0000000�0000000�00000000107�13571573400�030064� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/c036ae99793ecc9acb6b535dd2d1005c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/c036ae9970000666�0000000�0000000�00000000107�13571573400�027645� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/c639d7ade787dbfa6c8e3ac0deab407b.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/c639d7ade0000666�0000000�0000000�00000000107�13571573400�030004� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/d041292fc36e216def97c3254eb01974.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/d041292fc0000666�0000000�0000000�00000000107�13571573400�027631� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/db8621fbde219e817cc89e61a12fb844.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/db8621fbd0000666�0000000�0000000�00000000072�13571573400�027776� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/e40be544e57a231fd175961172f5a7fa.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/e40be544e0000666�0000000�0000000�00000000107�13571573400�027714� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/e7ecca8d08437e06bec751fec7df3d79.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/e7ecca8d00000666�0000000�0000000�00000000072�13571573400�030057� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/fba9006cb323657285278f3f151270b4.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/fba9006cb0000666�0000000�0000000�00000000107�13571573400�027767� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/fef57be462b7432acaace8d983f9c64e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.1.session/cache/fef57be460000666�0000000�0000000�00000000072�13571573400�030011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.i.0.report.json����������0000666�0000000�0000000�00000037514�13571573400�026412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 51, "valid": 51 }, "wp:main": { "total": 52, "valid": 52, "rank": 2 } }, "wp:functions": { "predicate": { "predicate_ensures_r_precedence_ite_naming": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_scope_let_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_scope_let": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_assoc_let": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_l_precedence_ite_let": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_m_precedence_ite_let": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_precedence_ite_let": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_assoc_exist": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_l_precedence_ite_exists": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_m_precedence_ite_exists": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_precedence_ite_exists": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_assoc_forall": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_l_precedence_ite_forall": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_m_precedence_ite_forall": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_precedence_ite_forall": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_assoc_ite": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_l_precedence_equiv_ite": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_m_precedence_equiv_ite": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_precedence_equiv_ite": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_l_precedence_implies_equiv": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_precedence_implies_equiv": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_assoc_implies": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_ok_since": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_ok_r_precedence_implies_or": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "predicate_ensures_l_precedence_or_implies": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_precedence_or_implies": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_l_precedence_xor_or": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_precedence_xor_or": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_l_precedence_and_xor": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_ensures_r_precedence_and_xor": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 29, "valid": 29 }, "wp:main": { "total": 30, "valid": 30, "rank": 2 } } }, "comparison": { "comparison_ensures_l_precedence_neq_and": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "comparison_ensures_r_precedence_neq_and": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "comparison_ensures_l_precedence_eq_and": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "comparison_ensures_r_precedence_eq_and": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "comparison_ensures_chainable_eq_eq": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "comparison_ensures_chainable_ge_ge": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "comparison_ensures_chainable_gt_gt": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "comparison_ensures_chainable_le_le": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "comparison_ensures_chainable_lt_lt": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 9, "valid": 9 } } }, "bitwise": { "bitwise_ensures_l_precedence_implies_equiv": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_r_precedence_implies_equiv": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_r_assoc_implies": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_ok_since": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_ok_r_precedence_implies_or": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_l_precedence_or_implies": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_r_precedence_or_implies": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_l_precedence_xor_or": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_r_precedence_xor_or": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_l_precedence_and_xor": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "bitwise_ensures_r_precedence_and_xor": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 11, "valid": 11 }, "wp:main": { "total": 11, "valid": 11 } } }, "predicate_bitwise": { "predicate_bitwise_ensures_l_precedence_equiv_Pand": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "predicate_bitwise_ensures_r_precedence_equiv_Pand": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/precedence.i.1.report.json����������0000666�0000000�0000000�00000034264�13571573400�026412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 37, "unknown": 37 }, "wp:main": { "total": 37, "unknown": 37 } }, "wp:functions": { "predicate": { "predicate_ensures_ko_l_assoc_naming": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_precedence_let_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_m_precedence_let_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_r_precedence_let_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_r_assoc_exist": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_precedence_exists_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_m_precedence_exists_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_r_precedence_exists_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_r_assoc_forall": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_precedence_forall_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_m_precedence_forall_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_r_precedence_forall_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_assoc_ite": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_precedence_ite_equiv": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_r_precedence_ite_equiv": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_precedence_equiv_implies": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_r_precedence_equiv_implies": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_assoc_implies": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_precedence_implies_or": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_r_precedence_or_xor": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_precedence_or_xor": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_r_precedence_xor_and": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "predicate_ensures_ko_l_precedence_xor_and": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 23, "unknown": 23 }, "wp:main": { "total": 23, "unknown": 23 } } }, "comparison": { "comparison_ensures_ko_l_precedence_and_neq": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "comparison_ensures_ko_r_precedence_and_neq": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "comparison_ensures_ko_r_nonassoc_eq": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "comparison_ensures_ko_l_nonassoc_eq": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "comparison_ensures_ko_l_precedence_and_eq": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "comparison_ensures_ko_r_precedence_and_eq": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 6, "unknown": 6 }, "wp:main": { "total": 6, "unknown": 6 } } }, "bitwise": { "bitwise_ensures_ko_l_precedence_equiv_implies": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bitwise_ensures_ko_r_precedence_equiv_implies": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bitwise_ensures_ko_l_assoc_implies": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bitwise_ensures_ko_l_precedence_implies_or": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bitwise_ensures_ko_r_precedence_or_xor": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bitwise_ensures_ko_l_precedence_or_xor": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bitwise_ensures_ko_r_precedence_xor_and": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bitwise_ensures_ko_l_precedence_xor_and": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 8, "unknown": 8 }, "wp:main": { "total": 8, "unknown": 8 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/range.i.0.report.json���������������0000666�0000000�0000000�00000003665�13571573400�025411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "wp:functions": { "test": { "val_assigns_q_requires_HQ_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "val_assigns_p_requires_HP_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "test_ensures_P2_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "test_ensures_P1_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } } } } ���������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/range.res.oracle��������������������0000666�0000000�0000000�00000001532�13571573400�024565� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/range.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Qed] Goal typed_test_ensures_P1_ok : Valid [wp] [Qed] Goal typed_test_ensures_P2_ok : Valid [wp] [Qed] Goal typed_test_call_val_assigns_p_requires_HP_ok : Valid [wp] [Qed] Goal typed_test_call_val_assigns_q_requires_HQ_ok : Valid [wp] Proved goals: 4 / 4 Qed: 4 [wp] Report in: 'tests/wp_acsl/oracle_qualif/range.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/range.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success test 4 - 4 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.res.oracle������������������0000666�0000000�0000000�00000002423�13571573400�024725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/reads.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 7 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_g_ensures_qed_ok : Valid [wp] [Qed] Goal typed_modifies_x_ensures_qed_ok_F_OK : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_modifies_x_ensures_qed_ok_W_OK_todo : Unsuccess [wp] [Qed] Goal typed_modifies_y_ensures_qed_ok_F_OK : Valid [wp] [Qed] Goal typed_modifies_y_ensures_qed_ok_G_OK : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_modifies_y_ensures_qed_ok_W_OK_todo : Unsuccess [wp] Proved goals: 5 / 7 Qed: 3 Alt-Ergo 2.0.0: 2 (unsuccess: 2) [wp] Report in: 'tests/wp_acsl/oracle_qualif/reads.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/reads.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (8..20) 1 100% g - 1 (16..28) 1 100% modifies_y 2 - 3 66.7% modifies_x 1 - 2 50.0% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024427� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025472� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/cache/088f4361e7220d82c4aac3de0d54e9c0.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/cache/088f4361e7220d0000666�0000000�0000000�00000000127�13571573400�027244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0178, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/cache/9b8ec49fe4b770ed766cffeca06e26ba.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/cache/9b8ec49fe4b7700000666�0000000�0000000�00000000107�13571573400�027501� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/cache/a7c19062a3a1ba781245090093cae159.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/cache/a7c19062a3a1ba0000666�0000000�0000000�00000000107�13571573400�027440� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/cache/e056ff14ff3f3a31e1d259539c614fb4.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.0.session/cache/e056ff14ff3f3a0000666�0000000�0000000�00000000127�13571573400�027546� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0154, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.1.res.oracle������������������0000666�0000000�0000000�00000001653�13571573400�024732� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/reads.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_modifies_x_ensures_qed_ko_G_KO : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_modifies_x_ensures_qed_ko_H_KO : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_modifies_y_ensures_qed_ko_H_KO : Unsuccess [wp] Proved goals: 0 / 3 Alt-Ergo 2.0.0: 0 (unsuccess: 3) [wp] Report in: 'tests/wp_acsl/oracle_qualif/reads.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/reads.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success modifies_y - - 1 0.0% modifies_x - - 2 0.0% ------------------------------------------------------------- �������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.1.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024430� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.1.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025473� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.1.session/cache/12175c96080c5e14983d37f17a405001.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.1.session/cache/12175c96080c5e0000666�0000000�0000000�00000000107�13571573400�027242� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.1.session/cache/a3d2f9ea9936fb5a5daf720f2390125e.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.1.session/cache/a3d2f9ea9936fb0000666�0000000�0000000�00000000107�13571573400�027555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.1.session/cache/dec49417e6eaea97560cc7370af29e03.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.1.session/cache/dec49417e6eaea0000666�0000000�0000000�00000000107�13571573400�027627� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.i.0.report.json���������������0000666�0000000�0000000�00000011150�13571573400�025377� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 2, "unknown": 2, "rank": 5 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 7, "valid": 5, "unknown": 2, "rank": 6 } }, "wp:functions": { "f": { "f_ensures_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "g": { "g_ensures_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } } }, "modifies_y": { "modifies_y_ensures_qed_ok_W_OK_todo": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "modifies_y_ensures_qed_ok_G_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "modifies_y_ensures_qed_ok_F_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } } }, "modifies_x": { "modifies_x_ensures_qed_ok_W_OK_todo": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "modifies_x_ensures_qed_ok_F_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/reads.i.1.report.json���������������0000666�0000000�0000000�00000003700�13571573400�025402� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "unknown": 3 }, "wp:main": { "total": 3, "unknown": 3 } }, "wp:functions": { "modifies_y": { "modifies_y_ensures_qed_ko_H_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "modifies_x": { "modifies_x_ensures_qed_ko_H_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "modifies_x_ensures_qed_ko_G_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } ����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.0.res.oracle�����������������0000666�0000000�0000000�00000002311�13571573400�025101� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/record.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 11 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_M1_qed_ok : Valid [wp] [Qed] Goal typed_f_ensures_M2_qed_ok : Valid [wp] [Qed] Goal typed_f_ensures_M3_qed_ok : Valid [wp] [Qed] Goal typed_f_ensures_M4_qed_ok : Valid [wp] [Qed] Goal typed_f_ensures_M5_qed_ok : Valid [wp] [Qed] Goal typed_f_ensures_M6_qed_ok : Valid [wp] [Qed] Goal typed_f_ensures_P1_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_P2_qed_ok : Valid [wp] [Qed] Goal typed_f_ensures_P3_qed_ok : Valid [wp] [Qed] Goal typed_f_ensures_P4_qed_ok : Valid [wp] [Qed] Goal typed_f_ensures_P5_qed_ok : Valid [wp] Proved goals: 11 / 11 Qed: 9 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_acsl/oracle_qualif/record.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/record.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 9 2 (12..24) 11 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024607� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025652� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.0.session/cache/41f3fc78840b8c11a76649f0b924b629.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.0.session/cache/41f3fc78840b80000666�0000000�0000000�00000000127�13571573400�027430� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0108, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.0.session/cache/46e19b7d03b33707aaeca4b14b58c682.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.0.session/cache/46e19b7d03b330000666�0000000�0000000�00000000127�13571573400�027415� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0163, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.1.res.oracle�����������������0000666�0000000�0000000�00000001321�13571573400�025102� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/record.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_KP5_qed_ko : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/record.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/record.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 1 0.0% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.1.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024610� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.1.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025653� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.1.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.1.session/cache/2d7c06745f3750000666�0000000�0000000�00000000072�13571573400�027347� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.i.0.report.json��������������0000666�0000000�0000000�00000010647�13571573400�025571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 11, "valid": 11, "rank": 4 } }, "wp:functions": { "f": { "f_ensures_P5_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_P4_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_P3_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_P2_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "f_ensures_P1_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_M6_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_M5_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_M4_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_M3_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_M2_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_M1_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 11, "valid": 11, "rank": 4 } } } } } �����������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/record.i.1.report.json��������������0000666�0000000�0000000�00000001466�13571573400�025571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "f": { "f_ensures_KP5_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026211� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027254� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/04736580fb1226122258d72b0db18b1c.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/0473650000666�0000000�0000000�00000000127�13571573400�027747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0279, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/04d277b0189801d4f62511a2ab403876.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/04d2770000666�0000000�0000000�00000000127�13571573400�030026� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0287, "steps": 31 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/1810ee3e876059ed91b3364dadef0514.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/1810ee0000666�0000000�0000000�00000000127�13571573400�030102� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0393, "steps": 44 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/1acff11b2d0792af6d82f30fec359c77.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/1acff10000666�0000000�0000000�00000000127�13571573400�030240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0602, "steps": 63 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/2b6ad3215a88bf1a97361c2a6a548186.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/2b6ad30000666�0000000�0000000�00000000127�13571573400�030160� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0432, "steps": 46 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/63680574867f4524c193e581c4e99eab.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/6368050000666�0000000�0000000�00000000126�13571573400�027751� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.022, "steps": 17 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/6c40717c6a3db07364d11c549ccc8b8e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/6c40710000666�0000000�0000000�00000000127�13571573400�030023� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0164, "steps": 48 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/95ff51261b0bee522dfdaedbe5332136.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/95ff510000666�0000000�0000000�00000000127�13571573400�030116� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0247, "steps": 29 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/a9c64d50a502a33e86bf9c24d3534330.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/a9c64d0000666�0000000�0000000�00000000127�13571573400�030171� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0207, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/e4e1431d753b9fc612caefb5e0d2f17c.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.0.session/cache/e4e1430000666�0000000�0000000�00000000127�13571573400�030104� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0221, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.i.0.report.json�������0000666�0000000�0000000�00000013620�13571573400�027165� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 9, "valid": 9, "rank": 14 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 15, "valid": 15, "rank": 13 } }, "wp:functions": { "f": { "f_loop_invariant_3": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 11 }, "wp:main": { "total": 2, "valid": 2, "rank": 11 } }, "f_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 11 } }, "f_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "f_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 14 } }, "f_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 6, "rank": 14 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 9, "valid": 9, "rank": 13 } } }, "g": { "g_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 7 } }, "g_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "g_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 7 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 6, "valid": 6, "rank": 7 } } } } } ����������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/simpl_is_type.res.oracle������������0000666�0000000�0000000�00000003612�13571573400�026352� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/simpl_is_type.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 18 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_check_acsl_check_ok_C1_absurd_is_cint : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_check_acsl_check_ok_C2_absurd_is_cint : Valid [wp] [Qed] Goal typed_check_acsl_check_ok_C5_absurd_cmp : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_f_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_f_loop_invariant_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_invariant_3_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_invariant_3_established : Valid [wp] [Qed] Goal typed_f_loop_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_assigns_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_g_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_g_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_g_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_g_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_g_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_g_loop_assigns : Valid [wp] Proved goals: 18 / 18 Qed: 7 Alt-Ergo 2.0.0: 11 [wp] Report in: 'tests/wp_acsl/oracle_qualif/simpl_is_type.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/simpl_is_type.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 3 6 (56..68) 9 100% g 3 3 (24..36) 6 100% check_acsl 1 2 (44..56) 3 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/sizeof.0.report.json����������������0000666�0000000�0000000�00000002466�13571573400�025363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 0 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } }, "wp:functions": { "foo": { "foo_assert_B": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 0 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/sizeof.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024630� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/sizeof.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025673� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/sizeof.0.session/cache/0c70acd19fe913cf00d8d5b7f63540bb.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/sizeof.0.session/cache/0c70acd19fe910000666�0000000�0000000�00000000126�13571573400�027575� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0082, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/sizeof.0.session/cache/5d63c645e492af38b5a1d3859d7eeaa2.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/sizeof.0.session/cache/5d63c645e492a0000666�0000000�0000000�00000000126�13571573400�027445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0084, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/sizeof.i.0.report.json��������������0000666�0000000�0000000�00000002647�13571573400�025613� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 2, "valid": 2, "rank": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } }, "wp:functions": { "foo": { "foo_assert_B": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "foo_assert_A": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "alt-ergo": { "total": 2, "valid": 2, "rank": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } } } } } �����������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/sizeof.res.oracle�������������������0000666�0000000�0000000�00000001367�13571573400�024776� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/sizeof.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_foo_assert_A : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_foo_assert_B : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_acsl/oracle_qualif/sizeof.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/sizeof.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo - 2 (1..12) 2 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.0.res.oracle��������0000666�0000000�0000000�00000001552�13571573400�027024� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_acsl/struct_use_case.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_f_ensures_ok : Valid [wp] [Qed] Goal typed_caveat_g_ensures_ok : Valid [wp] Proved goals: 2 / 2 Qed: 1 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_acsl/oracle_qualif/struct_use_case.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/struct_use_case.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (12..24) 1 100% g 1 - 1 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.0.session/����������0000777�0000000�0000000�00000000000�13571573400�026524� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.0.session/cache/����0000777�0000000�0000000�00000000000�13571573400�027567� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000206�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.0.session/cache/75e686a8c0da1561f5008f979b188b6d.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.0.session/cache/75e60000666�0000000�0000000�00000000127�13571573400�030200� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0157, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.1.res.oracle��������0000666�0000000�0000000�00000001602�13571573400�027021� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/struct_use_case.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_f_ensures_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_g_ensures_ko : Unsuccess [wp] Proved goals: 0 / 2 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_acsl/oracle_qualif/struct_use_case.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/struct_use_case.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 1 0.0% g - - 1 0.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.1.session/����������0000777�0000000�0000000�00000000000�13571573400�026525� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.1.session/cache/����0000777�0000000�0000000�00000000000�13571573400�027570� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000206�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.1.session/cache/0e21c0bd5123ab46e918c741bc7e0a87.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.1.session/cache/0e210000666�0000000�0000000�00000000107�13571573400�030160� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000206�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.1.session/cache/d7ed670240fade4912b282fbeb66481b.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.1.session/cache/d7ed0000666�0000000�0000000�00000000107�13571573400�030334� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.i.0.report.json�����0000666�0000000�0000000�00000003107�13571573400�027477� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "wp:functions": { "f": { "f_ensures_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "g": { "g_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/struct_use_case.i.1.report.json�����0000666�0000000�0000000�00000002535�13571573400�027504� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:functions": { "f": { "f_ensures_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "g": { "g_ensures_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.0.session/���������������������0000777�0000000�0000000�00000000000�13571573400�024310� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.0.session/cache/���������������0000777�0000000�0000000�00000000000�13571573400�025353� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000173�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.0.session/cache/329cc0ac6eb2e52eee8c4c5535959d47.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.0.session/cache/329cc0ac6eb2e520000666�0000000�0000000�00000000126�13571573400�027477� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0108, "steps": 5 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000173�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.0.session/cache/a8575b778e6a1338826f75588b184b9a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.0.session/cache/a8575b778e6a1330000666�0000000�0000000�00000000126�13571573400�027301� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0128, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.i.0.report.json����������������0000666�0000000�0000000�00000004227�13571573400�025267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 2 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 4, "rank": 2 } }, "wp:axiomatics": { "": { "lemma_UNION_RANGE": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "lemma_UNION_LIFT": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_UNION_EQ": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "lemma_UNION_DESCR": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 2 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 4, "rank": 2 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.res.oracle���������������������0000666�0000000�0000000�00000001572�13571573400�024454� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/tset.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: native support for coq is deprecated, use tip instead [wp] 4 goals scheduled [wp] [Qed] Goal typed_lemma_UNION_DESCR : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_UNION_EQ : Valid [wp] [Qed] Goal typed_lemma_UNION_LIFT : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_UNION_RANGE : Valid [wp] Proved goals: 4 / 4 Qed: 2 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_acsl/oracle_qualif/tset.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/tset.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma 2 2 (4..16) 4 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.0.res.oracle�������������0000666�0000000�0000000�00000001320�13571573400�025765� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/type_guard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ok : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_acsl/oracle_qualif/type_guard.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/type_guard.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (12..24) 1 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025474� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026537� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.0.session/cache/97e65fe64d92e5a8031769b221e69ccf.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.0.session/cache/97e65fe640000666�0000000�0000000�00000000127�13571573400�027726� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0173, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.1.res.oracle�������������0000666�0000000�0000000�00000001331�13571573400�025770� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/type_guard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ko : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/type_guard.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/type_guard.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 1 0.0% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.1.session/���������������0000777�0000000�0000000�00000000000�13571573400�025475� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.1.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026540� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.1.session/cache/9151bf7f78d38207ac18d6b238e10b92.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.1.session/cache/9151bf7f70000666�0000000�0000000�00000000107�13571573400�027714� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.i.0.report.json����������0000666�0000000�0000000�00000002022�13571573400�026442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:functions": { "f": { "f_ensures_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/type_guard.i.1.report.json����������0000666�0000000�0000000�00000001442�13571573400�026450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "f": { "f_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bit_test.0.report.json���������0000666�0000000�0000000�00000005514�13571573400�026735� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 13 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 3, "unknown": 1, "rank": 13 } }, "wp:functions": { "sum": { "sum_ensures_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "sum_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "rotate_left": { "rotate_left_ensures_other_bits": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 13 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "rotate_left_ensures_bit_zero": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 13 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 13 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bit_test.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026205� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bit_test.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027250� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bit_test.0.session/cache/d1a5d841e11f0a8ed014e2aa4ab1cc68.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bit_test.0.session/cache/d1a5d80000666�0000000�0000000�00000000107�13571573400�030157� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bit_test.0.session/cache/f2e288c6ba3fc74ec5ba8e7052418211.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bit_test.0.session/cache/f2e2880000666�0000000�0000000�00000000127�13571573400�030111� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0509, "steps": 56 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bit_test.c.0.report.json�������0000666�0000000�0000000�00000005235�13571573400�027156� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 2, "valid": 1, "unknown": 1, "rank": 13 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 3, "unknown": 1, "rank": 13 } }, "wp:functions": { "sum": { "sum_ensures_ko": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "sum_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "rotate_left": { "rotate_left_ensures_other_bits": { "alt-ergo": { "total": 1, "valid": 1, "rank": 13 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "rotate_left_ensures_bit_zero": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 13 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 13 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bit_test.res.oracle������������0000666�0000000�0000000�00000001730�13571573400�026345� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/unit_bit_test.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Qed] Goal typed_rotate_left_ensures_bit_zero : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_rotate_left_ensures_other_bits : Valid [wp] [Qed] Goal typed_sum_ensures_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_sum_ensures_ko : Unsuccess [wp] Proved goals: 3 / 4 Qed: 2 Alt-Ergo 2.0.0: 1 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/unit_bit_test.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/unit_bit_test.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success sum 1 - 2 50.0% rotate_left 1 1 (48..60) 2 100% ------------------------------------------------------------- ����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bool.0.report.json�������������0000666�0000000�0000000�00000017776�13571573400�026070� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "qed": { "total": 14, "valid": 14 }, "wp:main": { "total": 15, "valid": 15, "rank": 1 } }, "wp:axiomatics": { "Foo": { "lemma_f_1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } }, "wp:functions": { "boolean_casts": { "boolean_casts_check_b1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_b0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_B1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_B0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_x2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_x1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_x0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_X1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_X0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_c2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_c1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_c0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_C1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "boolean_casts_check_C0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 14, "valid": 14 }, "wp:main": { "total": 14, "valid": 14 } } } } } ��frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bool.0.session/����������������0000777�0000000�0000000�00000000000�13571573400�025323� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bool.0.session/cache/����������0000777�0000000�0000000�00000000000�13571573400�026366� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bool.0.session/cache/ea51224602f5817b481d8b68c85bf05f.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bool.0.session/cache/ea512246020000666�0000000�0000000�00000000126�13571573400�027523� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0101, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bool.i.0.report.json�����������0000666�0000000�0000000�00000001752�13571573400�026302� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:axiomatics": { "Foo": { "lemma_f_1": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } ����������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/unit_bool.res.oracle����������������0000666�0000000�0000000�00000003142�13571573400�025462� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/unit_bool.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 15 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_f_1 : Valid [wp] [Qed] Goal typed_boolean_casts_check_C0 : Valid [wp] [Qed] Goal typed_boolean_casts_check_C1 : Valid [wp] [Qed] Goal typed_boolean_casts_check_c0 : Valid [wp] [Qed] Goal typed_boolean_casts_check_c1 : Valid [wp] [Qed] Goal typed_boolean_casts_check_c2 : Valid [wp] [Qed] Goal typed_boolean_casts_check_X0 : Valid [wp] [Qed] Goal typed_boolean_casts_check_X1 : Valid [wp] [Qed] Goal typed_boolean_casts_check_x0 : Valid [wp] [Qed] Goal typed_boolean_casts_check_x1 : Valid [wp] [Qed] Goal typed_boolean_casts_check_x2 : Valid [wp] [Qed] Goal typed_boolean_casts_check_B0 : Valid [wp] [Qed] Goal typed_boolean_casts_check_B1 : Valid [wp] [Qed] Goal typed_boolean_casts_check_b0 : Valid [wp] [Qed] Goal typed_boolean_casts_check_b1 : Valid [wp] Proved goals: 15 / 15 Qed: 14 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_acsl/oracle_qualif/unit_bool.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/unit_bool.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic Foo - 1 (1..12) 1 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success boolean_casts 14 - 14 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.0.res.oracle����0000666�0000000�0000000�00000001353�13571573400�027647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_acsl/user_def_type_guard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ok : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_acsl/oracle_qualif/user_def_type_guard.0.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/user_def_type_guard.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (12..24) 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.0.session/������0000777�0000000�0000000�00000000000�13571573400�027350� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.0.session/cache/0000777�0000000�0000000�00000000000�13571573400�030413� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000212�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.0.session/cache/efda141dfdfe97789f4a4ffd5f7577cd.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.0.session/cache/0000666�0000000�0000000�00000000127�13571573400�030415� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0173, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.1.res.oracle����0000666�0000000�0000000�00000001364�13571573400�027652� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_acsl/user_def_type_guard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ko : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_acsl/oracle_qualif/user_def_type_guard.1.report.json' [wp] Report out: 'tests/wp_acsl/result_qualif/user_def_type_guard.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 1 0.0% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.1.session/������0000777�0000000�0000000�00000000000�13571573400�027351� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.1.session/cache/0000777�0000000�0000000�00000000000�13571573400�030414� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000212�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.1.session/cache/359125254990d37ce0c03112199b9d15.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.1.session/cache/0000666�0000000�0000000�00000000107�13571573400�030414� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.i.0.report.json�0000666�0000000�0000000�00000002022�13571573400�030316� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:functions": { "f": { "f_ensures_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/oracle_qualif/user_def_type_guard.i.1.report.json�0000666�0000000�0000000�00000001442�13571573400�030324� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "f": { "f_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/pointer.i�����������������������������������������0000666�0000000�0000000�00000010063�13571573400�020535� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-model Typed+ref -wp-prop="-qed_ok,-qed-ko" OPT: -wp-model Typed -wp-prop="-qed_ok,-qed-kok" */ // Some true properties cannot be proved. config_qualif tests them. /* -------------------------------------------------------------------------- */ /* --- GOAL: pointer arithmetics handled by each models --- */ /* --- TODO: validate tests on other models. --- */ /* -------------------------------------------------------------------------- */ int * p ; int t[10]; /* -------------------------------------------------------------------------- */ /* --- Testing shift from arrays --- */ /* -------------------------------------------------------------------------- */ /*@ ensures Lt: ( \forall integer i, integer j; i < j ==> t+i < t+j ); @ ensures Le: ( \forall integer k, integer l; k <= l ==> t+k <= t+l ); @ ensures Eq: ( \forall integer m, integer n; m == n ==> t+m == t+n ); */ void array (void) { return; } /* -------------------------------------------------------------------------- */ /* --- Testing shift from pointer --- */ /* -------------------------------------------------------------------------- */ /*@ ensures qed_ok: Lt: ( \forall integer i, integer j; i < j ==> p+i < p+j ); @ ensures qed_ok: Le: ( \forall integer k, integer l; k <= l ==> p+k <= p+l ); @ ensures qed_ok: Eq: ( \forall integer m, integer n; m == n ==> p+m == p+n ); @ ensures qed_ok: Eq_0: ( \forall integer n; n == 0 ==> p == p+n ); @ ensures qed_ok: Eq_0_bis: ( \forall integer n; p+n == p ==> n == 0 ); @ ensures qed_ko: Le_oracle_ko:(\forall integer i, integer j; i <= j ==> p+i < p+j ); @ ensures qed_ko: Eq_oracle_ko: ( \forall integer n; p+n == p ==> n == 1 ); */ void pointer (void) { return; } /* -------------------------------------------------------------------------- */ /* --- Testing shift from mixed array and pointers --- */ /* -------------------------------------------------------------------------- */ /*@ requires \base_addr(p) == \base_addr(&t[0]) ; ensures qed_ok: Lt: p-t > 0 ==> p > (int *) t ; ensures qed_ok: Le: p-t >= 0 ==> p >= (int *) t ; ensures qed_ok: Eq: p-t == 0 ==> p == (int *) t ; ensures qed_ok: Ne: p-t != 0 ==> p != (int *) t ; ensures qed_ko: Le_oracle_ko: p-t >= 0 ==> p > (int *) t ; ensures qed_ko: Lt_oracle_ko: p-t > 0 ==> p <= (int *) t ; */ void mixed_array_pointer (int *p) { return; } /* -------------------------------------------------------------------------- */ /* --- Testing pointers comparison, base, and minus --- */ /* -------------------------------------------------------------------------- */ /*@ requires \base_addr(p) == \base_addr(q) ; ensures qed_ok: Lt: p-q > 0 ==> p > q ; ensures qed_ok: Le: p-q >= 0 ==> p >= q ; ensures qed_ok: Eq: p-q == 0 ==> p == q ; */ void compare (int * q) { return; } /* -------------------------------------------------------------------------- */ /* --- Testing pointers comparison, base, and minus --- */ /* -------------------------------------------------------------------------- */ /*@ requires \base_addr(p) == \base_addr(&t[0]) ; ensures qed_ko: Base_oracle_ko: p-q > 0 ==> p > q ; // missing base p == base q ! ensures qed_ko: Comp_oracle_ko: ( \forall integer i, integer j; i <= j ==> t+i >= t+j ); */ void absurd (int * q) { return; } /* -------------------------------------------------------------------------- */ /* --- Testing null --- */ /* -------------------------------------------------------------------------- */ //TODO: fix problem with null (Cf. translate_expr / translate_prop) with Hoare model. // It is ok with store model. /*@ ensures qed_ok: Bool: \result == (p != \null) ; ensures qed_ok: NotNull: p != \null ==> \result != 0 ; ensures qed_ok: IsNull: p == \null ==> \result == 0 ; */ int null (int *p) { return (int) p; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/post_result.i�������������������������������������0000666�0000000�0000000�00000000454�13571573400�021443� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-steps 50 */ int a[5]; /*@ ensures \result == a ; assigns \result[0..n]; */ int * job(int n); void correct(void) { int * p = job(2); //@ assert OK: p[3] == \at(a[3],Pre) ; } void wrong(void) { int * p = job(2); //@ assert KO: p[1] == \at(a[1],Pre) ; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/precedence.i��������������������������������������0000666�0000000�0000000�00000025025�13571573400�021156� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -kernel-warn-key=annot-error=active -print */ /* run.config_qualif OPT: -kernel-warn-key=annot-error=active -wp -wp-model Typed -wp-par 1 -wp-prop="-ko" OPT: -kernel-warn-key=annot-error=active -wp -wp-model Typed -wp-par 1 -wp-prop="ko" -wp-steps 50 */ /* Test of operator precedence and associativity. * - The option -kernel-warn-key annot-error=inactive allow to skip contracts that contain a 'badly_formed' term. * Since the whole contract is rejected in a such case, these contracts must content only one property. * So, they are put inside a statement contract. */ //@ axiomatic Pred { predicate P; predicate Q; predicate R; predicate S; predicate U;} //@ axiomatic PredX { predicate Px(integer x); predicate Qx(integer x); predicate Rx(integer x);} //@ axiomatic PredXY{ predicate Pxy(integer x, integer y); predicate Qxy(integer x, integer y);} /*@ // PREDICATE OPERATORS ------------------------------------------------ @ ensures r_precedence_and_xor: (P && Q ^^ R) <==> ((P && Q) ^^ R); @ ensures l_precedence_and_xor: (P ^^ Q && R) <==> (P ^^ (Q && R)); @ ensures ko: l_precedence_xor_and: (P && Q ^^ R) <==> (P && (Q ^^ R)); @ ensures ko: r_precedence_xor_and: (P ^^ Q && R) <==> ((P ^^ Q) && R); @ ensures r_precedence_xor_or: (P ^^ Q || R) <==> ((P ^^ Q) || R); @ ensures l_precedence_xor_or: (P || Q ^^ R) <==> (P || (Q ^^ R)); @ ensures ko: l_precedence_or_xor: (P ^^ Q || R) <==> (P ^^ (Q || R)); @ ensures ko: r_precedence_or_xor: (P || Q ^^ R) <==> ((P || Q) ^^ R); @ ensures r_precedence_or_implies: (P || Q ==> R) <==> ((P || Q) ==> R); @ ensures l_precedence_or_implies: (P ==> Q || R) <==> (P ==> (Q || R)); @ ensures ko: l_precedence_implies_or: (P || Q ==> R) <==> (P || (Q ==> R)); @ ensures ok: r_precedence_implies_or: (P ==> Q || R) <==> ((P ==> Q) || R); @ ensures ok: since: ((P ==> Q) || R) <==> ((P ==> Q) || R); @ ensures r_assoc_implies: (P ==> Q ==> R) <==> (P ==> (Q ==>R)); @ ensures ko: l_assoc_implies: (P ==> Q ==> R) <==> ((P ==> Q) ==>R); @ ensures r_precedence_implies_equiv: (P ==> Q <==> R) <==> ((P ==> Q) <==> R); @ ensures l_precedence_implies_equiv: (P <==> Q ==> R) <==> (P <==> (Q ==> R)); @ ensures ko: r_precedence_equiv_implies: (P ==> Q <==> R) <==> (P ==> (Q <==> R)); @ ensures ko: l_precedence_equiv_implies: (P <==> Q ==> R) <==> ((P <==> Q) ==> R); @ ensures r_precedence_equiv_ite: (P <==> Q ? R : S) <==> ((P <==> Q) ? R : S); @ ensures m_precedence_equiv_ite: (P ? Q <==> R : S) <==> (P ? (Q <==> R) : S); @ ensures l_precedence_equiv_ite: (P ? Q : R <==> S) <==> (P ? Q : (R <==> S)); @ ensures ko: r_precedence_ite_equiv: (P <==> Q ? R : S) <==> (P <==> (Q ? R : S)); @ ensures ko: l_precedence_ite_equiv: (P ? Q : R <==> S) <==> ((P ? Q : R) <==> S); @ ensures r_assoc_ite: (P ? Q : R ? S : U) <==> (P ? Q : (R ? S : U)); @ ensures ko: l_assoc_ite: (P ? Q : R ? S : U) <==> ((P ? Q : R) ? S : U); @ ensures r_precedence_ite_forall: (\forall integer x; Px(x) ? Qx(x) : Rx(x)) <==> (\forall integer y; (Px(y) ? Qx(y) : Rx(y))); @ ensures m_precedence_ite_forall: (Px(x) ? \forall integer x; Qx(x) : Rx(x)) <==> (Px(x) ? (\forall integer y; Qx(y)) : Rx(x)); @ ensures l_precedence_ite_forall: (Px(x) ? Qx(x) : \forall integer x; Rx(x)) <==> (Px(x) ? Qx(x) : (\forall integer y; Rx(y))); @ ensures ko: r_precedence_forall_ite: (\forall integer x; Px(x) ? Qx(x) : Rx(x)) <==> ((\forall integer y; Px(y)) ? Qx(x) : Rx(x)); @ ensures ko: m_precedence_forall_ite: (Px(x) ? \forall integer x; Qx(x) : Rx(x)) <==> (Px(x) ? (\forall integer y; Qx(x)) : Rx(x)); @ ensures ko: l_precedence_forall_ite: (Px(x) ? Qx(x) : \forall integer x; Rx(x)) <==> (Px(x) ? Qx(x) : (\forall integer y; Rx(x))); @ ensures r_assoc_forall: (\forall integer x; \forall integer x ; Pxy(x, x)) <==> (\forall integer x ; Pxy(x, x)); @ ensures ko: r_assoc_forall: (\forall integer x; \forall integer y ; Pxy(x, y)) <==> (\forall integer x ; Pxy(x, x)); @ ensures r_precedence_ite_exists: (\exists integer x; Px(x) ? Qx(x) : Rx(x)) <==> (\exists integer y; (Px(y) ? Qx(y) : Rx(y))); @ ensures m_precedence_ite_exists: (Px(x) ? \exists integer x; Qx(x) : Rx(x)) <==> (Px(x) ? (\exists integer y; Qx(y)) : Rx(x)); @ ensures l_precedence_ite_exists: (Px(x) ? Qx(x) : \exists integer x; Rx(x)) <==> (Px(x) ? Qx(x) : (\exists integer y; Rx(y))); @ ensures ko: r_precedence_exists_ite: (\exists integer x; Px(x) ? Qx(x) : Rx(x)) <==> ((\exists integer y; Px(y)) ? Qx(x) : Rx(x)); @ ensures ko: m_precedence_exists_ite: (Px(x) ? \exists integer x; Qx(x) : Rx(x)) <==> (Px(x) ? (\exists integer y; Qx(x)) : Rx(x)); @ ensures ko: l_precedence_exists_ite: (Px(x) ? Qx(x) : \exists integer x; Rx(x)) <==> (Px(x) ? Qx(x) : (\exists integer y; Rx(x))); @ ensures r_assoc_exist: (\exists integer x; \exists integer x ; Pxy(x, x)) <==> (\exists integer x ; Pxy(x, x)); @ ensures ko: r_assoc_exist: (\exists integer x; \exists integer y ; Pxy(x, y)) <==> (\exists integer x ; Pxy(x, x)); @ ensures r_precedence_ite_let: (\let x=a; Px(x) ? Qx(x) : Rx(x)) <==> (\let y=a; (Px(y) ? Qx(y) : Rx(y))); @ ensures m_precedence_ite_let: (Px(x) ? \let x=a; Qx(x) : Rx(x)) <==> (Px(x) ? (\let y=a; Qx(y)) : Rx(x)); @ ensures l_precedence_ite_let: (Px(x) ? Qx(x) : \let x=a; Rx(x)) <==> (Px(x) ? Qx(x) : (\let y=a; Rx(y))); @ ensures ko: r_precedence_let_ite: (\let x=a; Px(x) ? Qx(x) : Rx(x)) <==> ((\let y=a; Px(y)) ? Qx(x) : Rx(x)); @ ensures ko: m_precedence_let_ite: (Px(x) ? \let x=a; Qx(x) : Rx(x)) <==> (Px(x) ? (\let y=a; Qx(x)) : Rx(x)); @ ensures ko: l_precedence_let_ite: (Px(x) ? Qx(x) : \let x=a; Rx(x)) <==> (Px(x) ? Qx(x) : (\let y=a; Rx(x))); @ ensures r_assoc_let: (\let x=a; \let x=b ; Pxy(x, x)) <==> (\let x=b ; Pxy(x, x)); @ ensures scope_let: (\let x=a; \let x=x+1 ; Px(x)) <==> Px(a+1); @ ensures scope_let: (\let x=x; \let y=x+1 ; Pxy(x, y)) <==> Pxy(x, x+1); @ ensures ko: l_assoc_naming: (P ? Q : R : S) <==> (P ? (Q : R) : S); @ ensures r_precedence_ite_naming: (P ? Q : R : S) <==> (P ? Q : (R: S)); */ void predicate(int x, int a, int b) { // Properties that have to be rejected at the parsing. //@ ensures badly_formed: ; ; } /*@ // COMPARISON OPERATORS ------------------------------------------------ @ ensures chainable_lt_lt: (p < q < r) <==> ((p < q) && (q < r)); @ ensures chainable_le_le: (p <= q <= r) <==> ((p <= q) && (q <= r)); @ ensures chainable_gt_gt: (p > q > r) <==> ((p > q) && (q > r)); @ ensures chainable_ge_ge: (p >= q >= r) <==> ((p >= q) && (q >= r)); @ ensures chainable_eq_eq: (p == q == r) <==> ((p == q) && (q == r)); @ ensures r_precedence_eq_and: (p == q && R) <==> ((p == q) && R); @ ensures l_precedence_eq_and: (P && q == r) <==> (P && (q == r)); @ ensures ko: r_precedence_and_eq: (p == q && r) <==> (p == (q && r)); @ ensures ko: l_precedence_and_eq: (p && q == r) <==> ((p && q) == r); @ ensures ko: l_nonassoc_eq: (p == q == r) <==> ((p == q) == r); @ ensures ko: r_nonassoc_eq: (p == q == r) <==> (p == (q == r)); @ ensures r_precedence_neq_and: (p != q && R) <==> ((p != q) && R); @ ensures l_precedence_neq_and: (P && q != r) <==> (P && (q != r)); @ ensures ko: r_precedence_and_neq: (p != q && r) <==> (p != (q && r)); @ ensures ko: l_precedence_and_neq: (p && q != r) <==> ((p && q) != r); */ void comparison(int p, int q, int r) { // Properties that have to be rejected at the parsing: //@ ensures badly_formed: unchainable_eq_ne: (p == q != r) <==> ((p == q) && (q != r)); //@ ensures badly_formed: unchainable_ne_eq: (p != q == r) <==> ((p != q) && (q == r)); //@ ensures badly_formed: unchainable_ne_ne: p != q != r; //@ ensures badly_formed: unchainable_lt_ne: p < q != r; //@ ensures badly_formed: unchainable_le_ne: p <= q != r; //@ ensures badly_formed: unchainable_gt_ne: p > q != r; //@ ensures badly_formed: unchainable_ge_ne: p >= q != r; //@ ensures badly_formed: unchainable_ne_lt: p != q < r; //@ ensures badly_formed: unchainable_ne_le: p != q <= r; //@ ensures badly_formed: unchainable_ne_gt: p != q > r; //@ ensures badly_formed: unchainable_ne_ge: p != q >= r; //@ ensures badly_formed: unchainable_lt_gt: p < q > r; //@ ensures badly_formed: unchainable_lt_ge: p < q >= r; //@ ensures badly_formed: unchainable_le_gt: p <= q > r; //@ ensures badly_formed: unchainable_le_ge: p <= q >= r; ; } /*@ // BITWISE OPERATORS ------------------------------------------------ @ ensures r_precedence_and_xor: (p & q ^ r) == ((p & q) ^ r); @ ensures l_precedence_and_xor: (p ^ q & r) == (p ^ (q & r)); @ ensures ko: l_precedence_xor_and: (p & q ^ r) == (p & (q ^ r)); @ ensures ko: r_precedence_xor_and: (p ^ q & r) == ((p ^ q) & r); @ ensures r_precedence_xor_or: (p ^ q | r) == ((p ^ q) | r); @ ensures l_precedence_xor_or: (p | q ^ r) == (p | (q ^ r)); @ ensures ko: l_precedence_or_xor: (p ^ q | r) == (p ^ (q | r)); @ ensures ko: r_precedence_or_xor: (p | q ^ r) == ((p | q) ^ r); @ ensures r_precedence_or_implies: (p | q --> r) == ((p | q) --> r); @ ensures l_precedence_or_implies: (p --> q | r) == (p --> (q | r)); @ ensures ko: l_precedence_implies_or: (p | q --> r) == (p | (q --> r)); @ ensures ok: r_precedence_implies_or: (p --> q | r) == ((p --> q) | r); @ ensures ok: since: ((p --> q) | r) == ((p --> q) | r); @ ensures r_assoc_implies: (p --> q --> r) == (p --> (q -->r)); @ ensures ko: l_assoc_implies: (p --> q --> r) == ((p --> q) -->r); @ ensures r_precedence_implies_equiv: (p --> q <--> r) == ((p --> q) <--> r); @ ensures l_precedence_implies_equiv: (p <--> q --> r) == (p <--> (q --> r)); @ ensures ko: r_precedence_equiv_implies: (p --> q <--> r) == (p --> (q <--> r)); @ ensures ko: l_precedence_equiv_implies: (p <--> q --> r) == ((p <--> q) --> r); */ void bitwise(int p, int q, int r) { // Properties that have to be rejected at the parsing: ; } /*@ // MIXES PREDICATE AND BITWISE OPERATORS ------------------------------------------------ @ ensures r_precedence_equiv_Pand: (p <--> q && R) <==> ((p <--> q) && R); @ ensures l_precedence_equiv_Pand: (P && q <--> r) <==> (P && (q <--> r)); */ void predicate_bitwise(int p, int q, int r) { // Properties that have to be rejected at the parsing: //@ ensures ko: badly_formed: l_precedence_Pand_equiv: (p <--> q && R) <==> (p <--> (q && R)); //@ ensures ko: badly_formed: r_precedence_Pand_equiv: (P && q <--> r) <==> ((P && q) <--> r); ; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/predicates_functions.i����������������������������0000666�0000000�0000000�00000000614�13571573400�023271� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT:-wp-prover=why3 -wp-gen -wp-msg-key print-generated */ /* run.config_qualif DONTRUN: */ /*@ predicate P(integer i) = i == 42 ; */ /*@ predicate RP(integer i) = (i <= 0) || ( P(i) && RP(i-1) ) ; */ /*@ logic integer F(integer i) = i * 2 ; */ /*@ logic integer RF(integer i) = (i <= 0) ? 0 : F(i) + RF(i-1) ; */ /*@ lemma foo: \forall integer i ; i > 0 ==> RP(RF(i)) ; */��������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/range.i�������������������������������������������0000666�0000000�0000000�00000001540�13571573400�020151� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-model Typed -wp-par 1 */ /*@ requires HP: ok: 0 <= i && i <= j && j-i == 10; assigns p[i..j] ; ensures P: ok: \valid (p+(i..j)) ; */ void val_assigns_p(int * p , int i, int j); /*@ requires HQ: ok: 0 <= k && k <= l && l-k == 10; assigns q[k..l]; ensures Q: ok: \valid(q+(k..l)) ; */ void val_assigns_q(int * q,int k, int l); int * r; /*@ requires H1 : a <=b && 0 <= a && b-a == 10; requires H2 : c <=d && 0 <= c && d-c == 10; ensures P1 : ok: 0 <= a && b < 10 && 10 <= c && d < 20 ==> \valid(r+(a..d)) && \separated (r+(a..b) , r+(c..d)) ; ensures P2 : ok: 0 <= c && d < 10 && 10 <= a && b < 20 ==> \valid(r+(c..b)) && \separated (r+(a..b) , r+(c..d)) ; */ void test (int a, int b , int c, int d) { val_assigns_p(r,a,b) ; val_assigns_q(r,c,d) ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/reads.i�������������������������������������������0000666�0000000�0000000�00000002241�13571573400�020152� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Typed */ /* run.config_qualif OPT: -wp -wp-model Typed -wp-par 1 -wp-prop="-qed_ko,-ko" OPT: -wp -wp-model Typed -wp-par 1 -wp-prop="qed_ko,ko" -wp-steps 50 */ // Test for implicit variables int x ; int y ; int *u ; int *v ; /*@ axiomatic A { @ predicate P(int *p,int *q)= *p <= *q ; @ predicate Q= x <= y ; @ } @ */ /*@ requires Q ; @ requires 0<=x<=10 ; @ requires 0<=y<=10 ; @ ensures qed_ok: Q ; @ */ void f(void) { x++; y++; } /*@ requires P(u,v) ; @ requires 0<=*u<=10 ; @ requires 0<=*v<=10 ; @ ensures qed_ok: P(u,v) ; @ */ void g(void) { (*u)++; (*v)++; } /*@ axiomatic S { @ predicate f{L} reads \nothing ; @ predicate g{L} reads x ; @ predicate h{L} reads x,y ; @ predicate w{L} ; @ } @*/ /*@ requires H: f && g && h && w ; @ ensures qed_ok: F_OK: f ; @ ensures qed_ok: G_OK: g ; @ ensures qed_ko: H_KO: h ; @ ensures qed_ok: W_OK: todo: w ; @ */ void modifies_y () { y++ ; } /*@ requires H: f && g && h && w ; @ ensures qed_ok: F_OK: f ; @ ensures qed_ko: G_KO: g ; @ ensures qed_ko: H_KO: h ; @ ensures qed_ok: W_OK: todo: w ; @ */ void modifies_x () { x++ ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/record.i������������������������������������������0000666�0000000�0000000�00000002614�13571573400�020336� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-wp-no-extensional" */ /* run.config_qualif OPT: -wp -wp-model Typed -wp-par 1 -wp-prop="-qed_ko,-ko" -wp-no-extensional OPT: -wp -wp-model Typed -wp-par 1 -wp-prop="qed_ko,ko" -wp-steps 50 -wp-no-extensional */ struct T { int i ; int j; }; struct T s1, s2; int t1[10]; int t2[10]; struct St { struct T st; }s,u; struct St2 { struct St stt; } st1,st2; struct T1 { int i ; int j ; int q ; }s3,s4; /*@ ensures M1: qed_ok: \forall integer i; s1.i == i && s1 == s2 ==> s2.i == i ; ensures M2: qed_ok: {s1 \with .i = (int)3}.i == 3 ; ensures M3: qed_ok: {s1 \with .i = (int)3}.j == s1.j ; ensures M4: qed_ok: {{s3 \with .i = (int)3} \with .j = (int) 4}.q == s3.q; ensures M5: qed_ok: {{s3 \with .i = (int)3} \with .j = (int) 4}.i == 3; ensures M6: qed_ok: {{s3 \with .i = (int)3} \with .j = (int) 4}.j == 4; ensures P1: qed_ok: {{s1 \with .i = s2.i}\with .j = s2.j} == s2 ; ensures P2: qed_ok: (\forall integer i; 0 <= i < 10 ==> t1[i] == t2[i]) ==> t1==t2; ensures P3: qed_ok: ({st1 \with .stt.st.i = (int)3}).stt.st.i == 3; ensures P4: qed_ok: ({{st1 \with .stt.st.i = (int)3}\with .stt.st.j = (int)4}).stt.st.i == 3; ensures P5: qed_ok: ({st1 \with .stt={ \with .st.i = (int)3 , .st.j = (int)4}}).stt.st.i == 3; ensures KP5: qed_ko: ({st1 \with .stt={ \with .st.i = (int)3 , .st.j = (int)4}}).stt.st.i == 4; */ void f (void) { return; } ��������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/simpl_is_type.i�����������������������������������0000666�0000000�0000000�00000012503�13571573400�021736� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-simplify-is-cint */ /* run.config_qualif OPT: -wp-simplify-is-cint -wp-prop=-ko,-lack */ /** Tests the simplification of (forall x:int. P) into (forall x:integer. P) when P already constraint x to be in the range of the machine integer. */ /*@ requires \forall int x; 0 <= x < size ==> t[x] < 0; requires 0 < size; ensures \forall int x; 0 <= x < size ==> 0 < t[x]; @*/ void f(int *t, int size){ /*@ loop invariant 0 <= i <= size; loop invariant \forall int x; 0 <= x < i ==> 0 < t[x]; loop invariant \forall int x; i <= x < size ==> t[x] < 0; loop assigns t[0..size-1], i; @*/ for(int i=0; i<size; i++){ t[i] = - t[i]; } } /*@ requires 0 < size; ensures \result == 1 ==> \exists int i; 0 <= i < size && t[i] == x && \forall int j; 0 <= j < i ==> t[j] != x; @*/ int g(int *t, int size, int x){ /*@ loop invariant 0 <= i <= size; loop invariant \forall int j; 0 <= j < i ==> t[j] != x; loop assigns i; @*/ for(int i = 0; i < size; i++){ if(t[i]==x) return 1; } return 0; } //@ axiomatic A { predicate P(integer x, integer y, real f) reads \nothing; } void check_acsl (void) { //@ check ko: A1: absorb_is_cint: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; 0 <= x < 64 ==> P(x,y,f); //@ check ko: A2: absorb_is_cint: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; 0 <= x < 64 && P(y,x,1.0) ==> P(x,y,f); //@ check ko: A3: absorb_is_cint: \exists integer y ; \forall unsigned char x ; \exists real f ; 0 <= x < 64 ==> P(x,y,f); //@ check ko: A4: absorb_is_cint: \exists integer y ; \forall unsigned char x ; \exists real f ; 0 <= x < 64 && P(y,x,f) ==> P(x,y,f); //@ check ok: C1: absurd_is_cint: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; -900000 <= x < 0 && P(y,x,f) ==> P(x,y,f); //@ check ok: C2: absurd_is_cint: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; -900000 <= x < 0 && P(y,x,f) ==> P(x,y,f); //@ check lack: C3: absurd_is_cint: \exists integer y ; \forall unsigned char x ; \exists real f ; -900000 <= x < 0 && P(y,x,f) ==> P(x,y,f); //@ check lack: C4: absurd_is_cint: \exists integer y ; \forall unsigned char x ; \exists real f ; -900000 <= x < 0 && P(y,x,f) ==> P(x,y,f); //@ check ok: C5: absurd_cmp: \let f = 1.0; \forall integer x ; (\exists integer y ; 0 < y < 1) ==> P(3,5,f); //@ check ko: B5: no_absurd_cmp: \let f = 1.0; \forall integer x ; (\exists real y ; 0 < y < 1) ==> P(3,5,f); //@ check ko: Min1: reduces_min: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; -5 <= x < 100 ==> P(x,y,f); //@ check ko: Min2: reduces_min: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; 10 <= x < 100 && P(10,y,f) ==> P(x,y,f); //@ check ko: Min3: reduces_min: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; 10 <= x < 100 && P(10,y,f) && P(11,y,f) && P(13,y,f) ==> P(x,y,f); //@ check ko: Min4: reduces_min: \exists integer y ; \forall unsigned char x ; \exists real f ; -5 <= x < 100 ==> P(x,y,f); //@ check ko: Min5: reduces_min: \exists integer y ; \forall unsigned char x ; \exists real f ; 10 <= x < 100 && P(10,y,f) ==> P(x,y,f); //@ check ko: Min6: reduces_min: \exists integer y ; \forall unsigned char x ; \exists real f ; 10 <= x < 100 && P(10,y,f) && P(11,y,f) && P(13,y,f) ==> P(x,y,f); //@ check ko: Max1: reduces_max: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; 10 <= x < 600 ==> P(x,y,f); //@ check ko: Max2: reduces_max: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; 10 <= x < 100 && P(98,y,f) && P(99,y,f) ==> P(x,y,f); //@ check ko: Max3: reduces_max: \exists integer y ; \forall unsigned char x ; \exists real f ; 10 <= x < 600 ==> P(x,y,f); //@ check ko: Max4: reduces_max: \exists integer y ; \forall unsigned char x ; \exists real f ; 10 <= x < 100 && P(98,y,f) && P(99,y,f) ==> P(x,y,f); //@ check ko: MinMax1: reduce_minmax: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; -5 <= x < 100 && P(98,y,f) && P(99,y,f) ==> P(x,y,f); //@ check ko: MinMax2: reduce_minmax: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; 10 <= x < 100 && P(10,y,f) && P(11,y,f) && P(13,y,f) &&P(98,y,f) && P(99,y,f) ==> P(x,y,f); //@ check ko: MinMax3: reduce_minmax: \exists integer y ; \forall unsigned char x ; \exists real f ; -5 <= x < 100 && P(98,y,f) && P(99,y,f) ==> P(x,y,f); //@ check ko: MinMax4: reduce_minmax: \exists integer y ; \forall unsigned char x ; \exists real f ; 10 <= x < 100 && P(10,y,f) && P(11,y,f) && P(13,y,f) &&P(98,y,f) && P(99,y,f) ==> P(x,y,f); //@ check ko: Let1: intro_let: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; 10 <= x < 11 ==> P(x,y,f); //@ check ko: Let2: intro_let: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; -5 <= x < 1 ==> P(x,y,f); //@ check ko: Let3: intro_let: \exists integer y ; \forall unsigned char x ; \let f = 1.0 ; 255 <= x < 600 ==> P(x,y,f); //@ check ko: Let4: intro_let: \exists integer y ; \forall unsigned char x ; \exists real f ; 10 <= x < 11 ==> P(x,y,f); //@ check ko: Let5: intro_let: \exists integer y ; \forall unsigned char x ; \exists real f ; -5 <= x < 1 ==> P(x,y,f); //@ check ko: Let6: intro_let: \exists integer y ; \forall unsigned char x ; \exists real f ; 255 <= x < 600 ==> P(x,y,f); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/sizeof.i������������������������������������������0000666�0000000�0000000�00000000450�13571573400�020353� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct S { int x; char c; int y; } ; // There is some padding here ! struct S a ; struct S b[4] ; /*@ predicate eq(integer a,integer b) = (a==b) ; */ void foo(void) { /*@ assert A: !eq( sizeof(a) , 2 * sizeof(int) + sizeof(char) ); */ /*@ assert B: eq( sizeof(b) , 4 * sizeof(a) ); */ } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/struct_use_case.i���������������������������������0000666�0000000�0000000�00000001353�13571573400�022252� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Caveat */ /* run.config_qualif OPT: -journal-disable -wp -wp-model Caveat -wp-par 1 -wp-prop="-ko" OPT: -journal-disable -wp -wp-model Caveat -wp-par 1 -wp-prop ko -wp-steps 50 */ /* run.config_qed DONTRUN: (config_qed) see config_qualif */ struct { unsigned int a; unsigned int b[2]; } var; /*@ ensures ko: var == { \old(var) \with .b[1] = x } ; @ ensures ok: var == { \old(var) \with .b[1] = x, .b[0] = y } ; @*/ void f(unsigned int x, unsigned int y){ var.b[0] = y; var.b[1] = x; } /*@ ensures ko: var == { \old(var) \with .b[1] = x } ; @ ensures ok: var == { \old(var) \with .b[1] = x, .a = y } ; @*/ void g(unsigned int x, unsigned int y){ var.a = y; var.b[1] = x; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/tset.i��������������������������������������������0000666�0000000�0000000�00000000776�13571573400�020046� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-prover alt-ergo,native:coq -wp-coq-script tests/wp_acsl/tset.s */ /*@ lemma UNION_EQ: \forall integer x,y ; (\union(0,x) == \union(0,y)) <==> (x==y) ; lemma UNION_LIFT: \forall integer x,y ; \union(1,x) + \union(2,y) == \union(3,2+x,1+y,x+y); lemma UNION_RANGE: \forall integer k,n ; 0 <= k <= n ==> \union( (0..(k-1)) , k, ((k+1)..n) ) == (0..n) ; lemma UNION_DESCR: \forall integer n; { n-x | integer x; \subset(x,(0..n)) } == (0..n) ; */ ��frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/tset.s��������������������������������������������0000666�0000000�0000000�00000000236�13571573400�020047� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* Generated by Frama-C WP *) Goal typed_lemma_UNION_DESCR. Hint UNION_DESCR,property. Proof. intros. exists (i_1-i). intuition (auto with zarith). Qed. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/type_guard.i��������������������������������������0000666�0000000�0000000�00000000401�13571573400�021213� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-model Typed -wp-par 1 -wp-prop="-qed_ko,-ko" OPT: -wp -wp-model Typed -wp-par 1 -wp-prop="qed_ko,ko" -wp-steps 50 */ /*@ ensures qed_ok: 0<=t<256 ; @ ensures qed_ko: 0<=t<128 ; */ void f(unsigned char t) {return;} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/unit_bit_test.c�����������������������������������0000666�0000000�0000000�00000001075�13571573400�021726� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-pp-annot" */ /* run.config_qualif STDOPT: +"-pp-annot" */ #define ST(a) (((a)&2)!=0) /*@ ensures ok: ST(\result) <==> ST(a) || ST(b) ; ensures ko: ST(\result) <==> ST(a) && ST(b) ; */ char sum( char a , char b ) { return a|b; } #define BIT_TEST(x,n) (((x)&(1<<(n)))!=0) /*@ ensures bit_zero: BIT_TEST(\result,0) == BIT_TEST(x,31); @ ensures other_bits: \forall int k ; 0 <= k && k < 31 ==> ( BIT_TEST(\result,1+k) <==> BIT_TEST(x,k)); */ unsigned rotate_left (unsigned x) { return (x << 1) | (x >> 31); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/unit_bool.i���������������������������������������0000666�0000000�0000000�00000001455�13571573400�021054� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ axiomatic Foo { logic boolean f(integer x); axiom f_def: \forall integer x; f(x) == \true <==> (\forall integer y; y < x ==> y < 1) ; lemma f_1: f(1); }*/ _Bool boolean_casts(int x, _Bool y) { //@ check C0: 0 == (integer) \false; //@ check C1: 1 == (integer) \true ; //@ check c0: \false == (boolean) 0; //@ check c1: \true == (boolean) 1; //@ check c2: \true == (boolean) 2; int x0 = 0, x1=1, x2=2; //@ check X0: x0 == (int) \false; //@ check X1: x1 == (int) \true ; //@ check x0: \false == (boolean) x0; //@ check x1: \true == (boolean) x1; //@ check x2: \true == (boolean) x2; _Bool b0=0, b1=1; //@ check B0: b0 == (_Bool) \false; //@ check B1: b1 == (_Bool) \true ; //@ check b0: \false == (boolean) b0; //@ check b1: \true == (boolean) b1; return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/unit_compare.i������������������������������������0000666�0000000�0000000�00000001265�13571573400�021546� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: only syntactic check. */ /*@ requires LE_X_Y : x <= y ; requires LE_X1_Y : x+1 <= y ; requires LE_X_Y1 : x <= y+1 ; requires LE_X1_Y1 : x+1 <= y+1 ; requires LE_Xm1_Y : x-1 <= y ; requires LE_X_Ym1 : x <= y-1 ; requires LE_Xm1_Ym1 : x-1 <= y-1 ; requires LE_X1_Ym1 : x+1 <= y-1 ; requires LE_Xm1_Y1 : x-1 <= y+1 ; requires LT_X_Y : x < y ; requires LT_X1_Y : x+1 < y ; requires LT_X_Y1 : x < y+1 ; requires LT_X1_Y1 : x+1 < y+1 ; requires LT_Xm1_Y : x-1 < y ; requires LT_X_Ym1 : x < y-1 ; requires LT_Xm1_Ym1 : x-1 < y-1 ; requires LT_X1_Ym1 : x+1 < y-1 ; requires LT_Xm1_Y1 : x-1 < y+1 ; */ void main(int x,int y) {} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_acsl/user_def_type_guard.i�����������������������������0000666�0000000�0000000�00000000452�13571573400�023075� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-model Typed -wp-par 1 -wp-prop="-qed_ko,-ko" OPT: -wp -wp-model Typed -wp-par 1 -wp-prop="qed_ko,ko" -wp-steps 50 */ /*@ axiomatic S { logic unsigned char t; } */ /*@ ensures qed_ok: 0<=t<256 ; @ ensures qed_ko: 0<=t<128 ; */ void f(void) {return;} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/���������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016551� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts0708.i������������������������������������������0000666�0000000�0000000�00000000724�13571573400�020035� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-prop A -then -wp-prop B */ /* -------------------------------------------------------------------------- */ /* - Testing that definition of P is correctly generated for both WP rounds - */ /* -------------------------------------------------------------------------- */ //@ predicate P(integer x) = 0 < x ; int x,a,b ; /*@ requires P(x) ; @ ensures A: P(a) ; @ ensures B: P(b) ; */ void f(void) { a = x+1 ; b = x+2 ; } ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts0843.i������������������������������������������0000666�0000000�0000000�00000000651�13571573400�020034� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 */ /* Incorrect translation of logic constant. Runtime needs a memory for creating C-variable location, which leads to dummy memory state in constant definition of [&p]. */ typedef struct { int a; } las; las * p; //@ logic las** p_ref = &p; /*@ requires \valid(p); assigns p->a; */ void f3() { p->a = 7; } /*@ requires \valid(p); assigns (*p_ref)->a; */ void g3() { f3(); } ���������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts779.i�������������������������������������������0000666�0000000�0000000�00000000173�13571573400�017763� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 -wp-rte */ void f(unsigned char *t) { //@ assert t[0] < 256; t[1]=3; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts788.i�������������������������������������������0000666�0000000�0000000�00000000342�13571573400�017761� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref */ /* run.config_qualif OPT: -wp-model +ref */ int t20[20] = {3} ; /*@ ensures I0: t20[0]==3 ; @ ensures I1: t20[1]==0 ; @ ensures I2: t20[2]==0 ; */ void main (void) {return; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts986.i�������������������������������������������0000666�0000000�0000000�00000000230�13571573400�017755� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 -wp-steps 50 */ void f (void) { int * p ; { int x ; p = &x ; } //@ assert A:!\valid(p); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_0896.i�����������������������������������������0000666�0000000�0000000�00000000615�13571573400�020203� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: (config_qualif) useless */ /* run.config_qed DONTRUN: (config_qed) see config_qed */ // Checks that the axiom "ax{L}" is defined only once. extern int tab[5], x; //@ axiomatic A { axiom ax: 10 < \block_length(&tab[0]); } //@ assigns x; extern void h(void); //@ requires r2: x==0; assigns x; void g() { h(); } //@ requires r1: x==0; void f(void) { g(); } �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1174.i�����������������������������������������0000666�0000000�0000000�00000000432�13571573400�020166� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-prover native:coq -wp-coq-script tests/wp_bts/bts_1174.s -wp-model +real */ /*@ requires -10. <= x && x <= 10.; */ void job(int a,double x) { double y; if (a) { y = x * 2.; /*@ assert qed_ok: x >= 0. ==> y >= 0.; */ ; } return; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1174.s�����������������������������������������0000666�0000000�0000000�00000001234�13571573400�020201� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* Generated by Frama-C WP *) Goal store_job_assert_qed_ok. Hint job,property,qed_ok. Proof. intros. Require Import Fourier. unfold r_1. fourier. Qed. Goal store_main_assert_qed_ok. Hint main,property,qed_ok. Proof. intros. Require Import Fourier. unfold r_1. fourier. Qed. Goal store_main_pre. Hint default,main,property. Proof. intros. Require Import Fourier. unfold r_1. fourier. Qed. Goal typed_job_assert_qed_ok. Hint job,property,qed_ok. Proof. intros. Require Import Fourier. unfold r_1. fourier. Qed. Goal typed_real_job_assert_qed_ok. Hint job,property,qed_ok. Proof. intros. Require Import Fourier. fourier. Qed. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1176.i�����������������������������������������0000666�0000000�0000000�00000000370�13571573400�020171� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 -wp-steps 50 */ typedef struct las { double a; double b; } las; /*@ assigns \nothing; ensures \result>=x; */ double g(double x); void f(las * p) { p->a = g(p->b); //@ assert qed_ok: p->a>=p->b; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1360.i�����������������������������������������0000666�0000000�0000000�00000001106�13571573400�020162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-rte */ /* run.config_qualif OPT: -wp -wp-par 1 -wp-rte */ /* The RTE '*_mem_access_3' obligation should fail in Function 'foo_wrong' */ /*@ requires \valid_read(a) && \valid_read(b) ; requires \separated(a,b); ensures *a == \old(*a & *b) ; assigns *a ; */ void foo_wrong(int * a,int *b) { int tmp = *a & *b ; *a = tmp ; /* ARG ! */ } /*@ requires \valid(a) && \valid_read(b) ; requires \separated(a,b); ensures *a == \old(*a & *b) ; assigns *a ; */ void foo_correct(int * a,int *b) { int tmp = *a & *b ; *a = tmp ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1382.i�����������������������������������������0000666�0000000�0000000�00000000630�13571573400�020167� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: nothing to prove */ //@ assigns *((char*)dst+(0..size-1)) \from *((char*)src+(0..size-1)); void copy(void* dst, const void* src, unsigned int size); //@ assigns *p; void f(unsigned char *p) ; int dest, src; void loop (void) { int i ; i=0 ; //@ loop assigns i, dest; while (i<100) { f((unsigned char*)&dest); copy(&dest, &src, sizeof(dest)); i++; } } ��������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1462.i�����������������������������������������0000666�0000000�0000000�00000001230�13571573400�020163� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� void wrong(int c) { int x = 0; int y = 0; /*@ assert for_value: c<= 0 || c == 1 || c>=2; */ if (c==2) { x=1; y=1; } L: /*@ loop invariant A_KO: \at(x==0,L) ==> i!=0 ==> y == 0; loop invariant B: \at(x==1,L) ==> i!=0 ==> x == 1; loop invariant C: \at(c==0,Pre) ==> i==0 ==> x == 0; loop assigns i,x,y; */ for (int i = 0; i<10; i++) { if (c == 0) { x = 0; } if (c == 1) { y = 1; } if (c == 2) { x = 1; } } if (c==1) { /*@ assert consequence_of_false_invariant: y==0; */ } } void local (void) { int y; /*@ loop invariant \valid(&y); loop assigns y; */ for(;;) { int x; x++; y++; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1586.i�����������������������������������������0000666�0000000�0000000�00000001361�13571573400�020177� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /*@ behavior Bizarre: assumes x; ensures TRANS: x ==> \result==1 ; */ int compute_bizarre(int x) { if (x) return 1; else return 2; } /*@ behavior Normal: assumes x; ensures TRANS: x <==> \result==1 ; */ int compute_normal(int x) { if (x) return 1; else return 2; } int main_bizarre_KO(int x) { int trans = compute_bizarre(x); switch(trans) { case 0: //@ assert FALSE: \false; return -1; break; default: return -1; break; } } int main_normal_KO(int x) { int trans = compute_normal(x); switch(trans) { case 0: //@ assert FALSE: \false; return -1; break; default: return -1; break; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1588.i�����������������������������������������0000666�0000000�0000000�00000000403�13571573400�020175� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������void f (int n, int *d ) { int i = 0, z = 0; //@ loop invariant l1_2: d == \at(d,Pre) + i; while (i < n) { ; //@ assert a1: d == \at(d,Pre) + i; ; ; ; ; ; i++; d++; z++; } while (z != 0) { z--; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1601.c�����������������������������������������0000666�0000000�0000000�00000005536�13571573400�020165� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef unsigned char BOOL; #define TRUE 1 #define FALSE 0 typedef unsigned char uint8; typedef unsigned short int uint16; typedef unsigned long uint32; uint16 F_MIN_R = 15; const uint8 RESP_STATE = 30; typedef enum { RESP_MODE, SS_A_MODE }tenumMode; tenumMode tenumRMode; BOOL gbCaMStatus; BOOL gbCaaStatus; uint8 mnPb; BOOL mbApLYRange; float gfApYLineSlope; float gfApYLineConst; float gfApRLineSlope; float gfApRLineConst; float mfAp; uint16 almC; uint16 nApLYL = 0; uint16 nApLRL = 0; uint16 Ap_Y_L_Ui = 0; uint16 Ap_R_L_Ui = 0; float fCaValue=0.0; float fRrValue = 0.0; uint16 nCaLYL=0; uint16 nCaLRL=0; /*@ @ behavior basic: @ assumes fRrValue == 0; @ ensures tenumRMode == SS_A_MODE; @ */ void foo() { float mfNewAp = 0; BOOL bYAp = FALSE; BOOL bRAp = FALSE; BOOL bApAlmC = FALSE; if (fRrValue != 0) { /* Some code here */ } else { if (mnPb == 1) { mfAp = RESP_STATE; mnPb = 2; } tenumRMode = SS_A_MODE; } //@ assert fRrValue == 0.0 ==> tenumRMode == SS_A_MODE; if ( (mfAp >= F_MIN_R) && ((gbCaMStatus == TRUE) && (gbCaaStatus == FALSE)) ) { bApAlmC = TRUE; almC = 1; } else { almC = 0; } //@ assert fRrValue == 0.0 ==> tenumRMode == SS_A_MODE; if ( (bApAlmC == TRUE) && (mfAp < nApLYL) && (fCaValue >= nCaLYL) ) { float fmultval = 0; fmultval = gfApYLineSlope*fCaValue; mfNewAp = fmultval + gfApYLineConst; if (mfAp >= mfNewAp) bYAp = TRUE; else bYAp = FALSE; Ap_Y_L_Ui = (uint16)mfNewAp; } //@ assert fRrValue == 0.0 ==> tenumRMode == SS_A_MODE; if ((bApAlmC == TRUE) && (fCaValue > (float)nCaLYL)) { mfNewAp = ((gfApYLineSlope*fCaValue) + gfApYLineConst); if (mfNewAp < (float)nApLYL); Ap_Y_L_Ui = (uint16)mfNewAp; } else if ((bApAlmC == TRUE) && (fCaValue <= (float)nCaLYL)) Ap_Y_L_Ui = F_MIN_R; if ( (bApAlmC == TRUE) && (fCaValue >= nCaLRL) ) { float fmultval = 0; fmultval = gfApRLineSlope*fCaValue; mfNewAp = fmultval + gfApRLineConst; if (mfAp >= mfNewAp) bRAp = TRUE; else bRAp = FALSE; Ap_R_L_Ui = (uint16)mfNewAp; } else if ( (bApAlmC == TRUE) && (fCaValue < nCaLRL) ) Ap_R_L_Ui = F_MIN_R; //@ assert fRrValue == 0.0 ==> tenumRMode == SS_A_MODE; if ( (mfAp >= nApLYL) || ((bApAlmC == TRUE) && (fCaValue < nCaLYL)) || ((bYAp == TRUE) && (gbCaMStatus == TRUE) && (gbCaaStatus == FALSE) ) ) { mbApLYRange = TRUE; } else mbApLYRange = FALSE; //@ assert fRrValue == 0.0 ==> tenumRMode == SS_A_MODE; if ( (mfAp >= nApLRL) || ((bApAlmC == TRUE) && (fCaValue < nCaLRL)) || ((bRAp == TRUE) && (gbCaMStatus == TRUE) && (gbCaaStatus == FALSE) ) ) { //@ assert fRrValue == 0.0 ==> tenumRMode == SS_A_MODE; } //@ assert fRrValue == 0.0 ==> tenumRMode == SS_A_MODE; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1647.c�����������������������������������������0000666�0000000�0000000�00000000452�13571573400�020167� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: */ #define NULL ((void *) 0L) /*@ ensures e1: \result == \null; ensures e2: \result == 0; ensures e3: \result == (int *) \null; ensures e4: \result == (int *) 0; ensures e5: \result == (int *)((void *)0); */ int * f (void) { return NULL; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1776.i�����������������������������������������0000666�0000000�0000000�00000000264�13571573400�020201� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: (nothing to prove) */ int X,Y; void g (void) { X ++; } void f (int x, int y) { if (x > X) { g (); //@ assert KO: ax2: x > X ; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_1828.i�����������������������������������������0000666�0000000�0000000�00000003624�13571573400�020202� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-warn-memory-model OPT: -wp-model "+ref" */ /* run.config_qualif OPT: -wp-warn-memory-model OPT: -wp-model "+ref" */ // -------------------------------------------------------------------------- // --- Local Frame // -------------------------------------------------------------------------- /* The function has _no_ separation hypotheses. The assertion shall be proven in all models. */ //@ requires \valid(one); void local_frame(int *one){ int two; //@ assert ok: one != &two; } // -------------------------------------------------------------------------- // --- Global Frame // -------------------------------------------------------------------------- /* The function _has_ separation hypotheses in Typed model: the pointer 'one' might be aliased to any global variable. Since the global 'zero' is not aliased, it is assumed not be pointed-to. The default separation hypothesis is then: \separated( one , &zero ); This hypothesis _could_ be released if we assume that pointers to scalar of different types are not permitted. Like function above, if `zero` and `one` are valid pointers, they point to allocated blocks in the heap. Hence, they are separated from all locals and formals. However, using the `REF` model, we are also able to prove that `one` and `zero` are separated, since `*one` and `*zero` are placed on the ByRef model. With this model, the generated separation hypothesis shall be: \separated(one,zero). */ int *zero; /*@ requires \valid(zero) && \valid(one); ensures sep_iff_ref: \separated(zero,one); ensures one_iff_ref: *one == \old(*one + *zero + 1); ensures zero_always: *zero == \old(*one + *zero - 1); */ void global_frame(int *one, int arg){ int two = *one + *zero ; *one = two + 1 ; *zero = two - 1 ; // might havoc *one //@ assert ok: \separated(one,&arg,&two); //@ assert ok: \separated(zero,&arg,&two); } ������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_2040.i�����������������������������������������0000666�0000000�0000000�00000000331�13571573400�020155� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� int A,B; /*@ assigns A,B ; behavior Case: assumes \at(A,Here) > 0; ensures B > 0; */ void job(void); void call(void) { A = 1; job(); //@ assert B > 0; /* SHALL BE PROVED (unknown in BTS 2040) */ } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_2079.i�����������������������������������������0000666�0000000�0000000�00000000635�13571573400�020200� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-prop=-Obs */ /*@ axiomatic S { predicate S(integer k); } */ typedef struct S { int f[40]; } ; struct S a[3] ; struct S *p; int *q; int *r; /*@ ensures Obs:P: S((p+k)-p); ensures Obs:Q: S((q+k)-q); ensures Obs:R: S((r+k)-q); ensures Eval:P: p+k-p == k ; ensures Eval:Q: q+k-q == k ; */ int main(int k) { p = a; q = &a[1].f[12]; r = &a[2].f[17]; return 0; } ���������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_2110.i�����������������������������������������0000666�0000000�0000000�00000001146�13571573400�020160� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config CMD: @frama-c@ -wp -wp-msg-key shell,cluster,print-generated -wp-prover why3 -wp-gen -wp-share ./share OPT: */ /* run.config_qualif DONTRUN: */ struct FD { int pos; int *adr; }; struct A { int dummy; }; /*@ //requires \valid(fd); //requires \valid(a); //requires \separated(a,fd); assigns fd->pos; assigns *a; ensures fd->pos != \old(fd->pos); */ int myRead(struct FD* fd,struct A* a); /*@ //requires \valid(fd); //requires \valid(a); //requires \separated(a,fd); ensures KO: *a == \old(*a); */ void myMain(struct FD* fd,struct A* a) { //@ assigns KO: *a; myRead(fd,a); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_2159.i�����������������������������������������0000666�0000000�0000000�00000000244�13571573400�020173� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ logic integer Id(integer k) = k ; */ int s ; /*@ ensures s == \old( 0 <= x <= 100 ? Id(s+x) : Id(s) ); */ void job(int x) { if (0 <= x && x <= 100) s+=x; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_2201.i�����������������������������������������0000666�0000000�0000000�00000000216�13571573400�020156� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: */ /*@ assigns \nothing; */ int main() { int foo = 1; 1 & (foo & 0x80000000000001LL) << 1; return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_2246.i�����������������������������������������0000666�0000000�0000000�00000000244�13571573400�020170� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: */ int x; /*@ requires x == 1; ensures x == 1; */ void bad (int e) { switch (e) { case 0: break; case 1: x = 2; break; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/bts_2471.i�����������������������������������������0000666�0000000�0000000�00000000607�13571573400�020173� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: */ /* run.config_qualif OPT: -wp-timeout 1 OPT: -wp-prover native:alt-ergo -wp-timeout 1 OPT: -wp-prover native:coq */ /*@ axiomatic maps { type model_digit = octet | sextet; logic integer foo(model_digit i); } */ int foo() { // Shall not fail (parse error in BTS issue) //@assert ko: \forall int i; i == foo(octet); return 0; } �������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/ergo_typecheck.i�����������������������������������0000666�0000000�0000000�00000003012�13571573400�021712� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef struct { unsigned int a[2]; unsigned int b[2]; unsigned int c; } my_type; my_type var = {0}; /*@ @ ensures var_divded : var == {\old(var) \with @ .a = {\old(var.a) \with @ [0] = (unsigned int) 0, @ [1] = (unsigned int) 1}, @ .b = {\old(var.b) \with @ [0] = (unsigned int)(\old(var.b[0]) + 1), @ [1] = (unsigned int)(\old(var.b[1]) + 2)}, @ .c = (unsigned int) 5 @ }; @ @ ensures var_inline : var == {\old(var) \with @ .a[0] = (unsigned int) 0, @ .a[1] = (unsigned int) 1, @ .b[0] = (unsigned int)(\old(var.b[0]) + 1), @ .b[1] = (unsigned int)(\old(var.b[1]) + 2), @ .c = (unsigned int) 5 @ }; @ @ ensures var_unit0 : var.a[0] == 0; @ ensures var_unit1 : var.a[1] == 1; @ ensures var_unit2 : var.b[0] == (unsigned int)(\old(var.b[0]) + 1); @ ensures var_unit3 : var.b[1] == (unsigned int)(\old(var.b[1]) + 2); @ ensures var_unit4 : var.c == 5; @ assigns var; @ */ void f() { var.a[0] = 0u; var.a[1] = 1u; var.b[0] ++; var.b[1] += 2; var.c = 5u; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/ex5.i����������������������������������������������0000666�0000000�0000000�00000006570�13571573400�017434� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: */ void dummy() { int d = 7; //@ assert \exists integer r1, r2, r3, r4, r5; d == r1 + r2 + r3 + r4 + r5; int e = 7; //@ assert \exists integer i4, i3, i2, i1, i; e <= i + i1 + i2 + i3 + i4; int a = 7; //@ assert \exists integer i5, x; a == x + i5 && x <= i5; } /*@ axiomatic A { predicate P(integer x) reads \nothing; predicate Q(integer x) reads \nothing ; logic integer f(integer x) reads \nothing; predicate B(boolean x) reads \nothing; predicate C(boolean x,boolean y) reads \nothing ; logic boolean c(boolean x) reads \nothing; } */ /*@ ensures ok11: \exists integer x; x == f(b); ensures ok12: \exists integer x; \exists integer y; x == f(y); ensures ok21: \exists integer x; 1+x == f(b); ensures ok22: \exists integer x; \exists integer y; 1+x == f(y); ensures ok31: \exists integer x; a+x+f(a) == b+f(b); ensures ok32: \exists integer x; \exists integer y; a+x+f(a) == b+f(y); ensures ko0: \exists integer x; x != 1; ensures ko1: \exists integer x; x == f(x); ensures ko2: \exists integer x; 1+x == b+f(x); ensures ko3: \exists integer x; x+f(x) == b; ensures ko4: \exists integer x; P(x) && \exists integer y; x == f(y); ensures ko5: \exists integer x; P(x) || Q(x) || x == 1; ensures p1: \exists integer x; P(x) && Q(x) && x == 1; ensures p2: \exists integer x; P(x) && Q(x) && 1+x == b; ensures p3: \exists integer x; P(x) && Q(x) && 1+x+f(a) == b+f(b); ensures ok41: \exists boolean x; x && c(x) == c(\true); ensures ok42: \exists boolean x; !x && c(x) == c(\false); ensures ok43: \exists boolean x; \exists boolean y; !x && y && (C(x,y) <==> C(\false,\true)) ; ensures ko43: \exists boolean x; \exists boolean y; !x && y && C(x,y) ; */ void exists (int a, int b) { } /*@ ensures ok11: \forall integer x; x != f(b); ensures ok12: \forall integer x; \forall integer y; x != f(y); ensures ok21: \forall integer x; 1+x != f(b); ensures ok22: \forall integer x; \forall integer y; 1+x != f(y); ensures ok31: \forall integer x; a+x+f(a) != b+f(b); ensures ok32: \forall integer x; \forall integer y; a+x+f(a) != b+f(y); ensures ko0: \forall integer x; x == f(x); ensures ko1: \forall integer x; x != f(x); ensures ko2: \forall integer x; 1+x != b+f(x); ensures ko3: \forall integer x; x+f(x) != b; ensures ko4: \forall integer x; P(x) || \forall integer y; x != f(y); ensures ko5: \forall integer x; P(x) && Q(x) && x != 1; ensures p1: \forall integer x; P(x) || Q(x) || x != 1; ensures p2: \forall integer x; P(x) || Q(x) || 1+x != b; ensures p3: \forall integer x; P(x) || Q(x) || 1+x+f(a) != b+f(b); ensures q1: \forall integer x; P(x) && Q(x) ==> x != 1; ensures q2: \forall integer x; P(x) && Q(x) ==> 1+x != b; ensures q3: \forall integer x; P(x) && Q(x) ==> 1+x+f(a) != b+f(b); ensures r1: \forall integer x; P(x) && x == 1 ==> Q(x); ensures r2: \forall integer x; P(x) && 1+x == b ==> Q(x); ensures r3: \forall integer x; P(x) && 1+x+f(a) == b+f(b) ==> Q(x); */ void forall (int a, int b) { } ����������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue-364.i����������������������������������������0000666�0000000�0000000�00000000217�13571573400�020365� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� void main() { char *a = "abc"; // Validity of ending `\0` ; //@ assert ZERO: \valid_read(a+3); //@ assert OVER: !\valid_read(a+4); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue-516.c����������������������������������������0000666�0000000�0000000�00000001112�13571573400�020351� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: */ #define NULL ((void*) 0) struct list { struct list* next ; int field ; }; /*@ axiomatic To_ll { @ logic \list<struct list*> to_logic_list{L}(struct list* bl, struct list* el) ; @ }*/ typedef struct list **list_t ; void list_remove(list_t list, struct list *item){ struct list *l = *list ; int n = 0 ; /*@ assert \nth(to_logic_list(*list, NULL), n) == l && l != NULL;*/ /*@ assert UNROLL: (l->next != item && l->next == NULL) ==> to_logic_list(*list, NULL) == (to_logic_list(*list, l) ^ to_logic_list(l, NULL)); */ } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue-684-exit.c�����������������������������������0000666�0000000�0000000�00000000231�13571573400�021327� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include "stdlib.h" /*@ assigns \nothing; @ exits \exit_status == state; @ ensures \false; */ void inconditional_exit(int state) { exit (state); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue_141.i����������������������������������������0000666�0000000�0000000�00000000626�13571573400�020444� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-rte -wp -wp-steps 50 */ /* run.config_qualif DONTRUN: */ typedef struct list { struct list *next; }; struct list *cur; volatile int nondet; void f(int i) {} int main() { int bla = -1; reset: if (nondet) f(bla); while (nondet) { if (nondet) goto reset; if (nondet) goto exit; } goto reset; exit: while (nondet) { cur = cur->next; } return 0; } ����������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue_143.i����������������������������������������0000666�0000000�0000000�00000001112�13571573400�020435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: */ /* run.config_qualif EXECNOW: chmod a-x ./tests/inexistant-prover OPT: -wp OPT: -wp -wp-prover "alt-ergo,native:coq" -wp-alt-ergo ./tests/inexistant-prover -wp-coqc ./tests/inexistant-prover OPT: -wp -wp-prover "alt-ergo" -wp-alt-ergo ./tests/inexistant-prover OPT: -wp -wp-prover "native:coq" -wp-coqc ./tests/inexistant-prover */ /*@ axiomatic A { lemma ok_because_inconsistent: \forall integer x; x > 0 ==> x < 0 ==> x == 0 ; } */ /*@ axiomatic B { lemma ok_because_consistent: \forall integer x; x > 0 ==> x*x > 0 ; } */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue_198.i����������������������������������������0000666�0000000�0000000�00000000112�13571573400�020446� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ lemma broken: \forall int k ; \forall int b ; b > 0 ==> b/b == 1 ; */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue_447.i����������������������������������������0000666�0000000�0000000�00000000150�13571573400�020445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ logic integer f(integer \this) = \this + 1; */ /*@ lemma foo: \forall integer x; f(x) == x + 1; */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue_453.i����������������������������������������0000666�0000000�0000000�00000001116�13571573400�020445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef unsigned T; T incr_value; //@ axiomatic A { predicate Incr(T x, T r) = r == x + incr_value; } /*@ assigns \nothing; @ ensures Incr(x, \result); @ */ T incr(T x); // Was KO before the fix of #453 void f1(T i) { /*@ loop assigns i; @*/ while (i<10) { /*@ assigns i ; ensures Sincr: Incr(\old(i), i); */ i = incr(i); } } // Was OK before the fix of #453 void f2(T i) { /*@ loop assigns i; @*/ while (i<10) { //@ ghost A: ; /*@ assigns i ; ensures Sincr: Incr(\old(i), i); */ i = incr(i); //@ ghost B: ; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue_494.i����������������������������������������0000666�0000000�0000000�00000000377�13571573400�020462� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������//@ predicate R(integer x,integer y) = (y == x+1) ; /*@ ensures R(\old(*p),*p); */ void f(int *p) { (*p)++; } void job_ko_fixed(int x) { f(&x); //@assert Wrong: \false; x++; } void job_ko_success(int y) { f(&y); //@assert Wrong: \false; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue_508.c����������������������������������������0000666�0000000�0000000�00000001033�13571573400�020436� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#define HASHTBL_LEN 17 typedef struct { int b; int size; } Buckets; typedef struct { Buckets data[HASHTBL_LEN]; int size; } Hashtbl; /*@ requires \valid(tbl); @ requires \valid(tbl->data+(0 .. HASHTBL_LEN - 1)); @ requires 0 <= d < HASHTBL_LEN; @ @ assigns tbl->data[d], tbl->size; // approximation sur tbl->data[d]; si on écrit tbl->data[d].size, pas de problème @ */ int add(Hashtbl *tbl, int d) { unsigned int h = d; tbl->data[h].size = 0; // si on inline d, pas de probleme tbl->size = 0; return 0; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue_715_a.i��������������������������������������0000666�0000000�0000000�00000000144�13571573400�020746� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ requires *s >= 0 ; */ void dummy(int *s); void foo(void) { int p[1] = { 0 }; dummy(p); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/issue_715_b.i��������������������������������������0000666�0000000�0000000�00000000255�13571573400�020752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������//@ predicate isValid(int *s) = \valid(s); /*@ requires isValid(dest); requires dest[0] >= 0; */ void dummy(int *dest); void foo(){ int p[1] = { 0 } ; dummy(p); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/nupw-bcl-bts1120.i���������������������������������0000666�0000000�0000000�00000002653�13571573400�021552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 -wp-fct "g,unreachable_smt_with_contract" */ /*@ axiomatic ax { @ predicate ExitF(integer x); @ predicate ExitP(integer x); @ predicate Exit1(integer x); @ predicate PostF(integer x); @ predicate PostP(integer x); @ predicate Post1(integer x); @ predicate P(integer x); @ predicate PreF(integer x); @ predicate Pre(integer x); @ predicate Pre1(integer x); } */ //@ assigns \nothing; ensures PostF(x); exits ExitF(x) ; int f(int x); // corrected. //@ requires ExitF(max) ==> ExitP(max); assigns \nothing; exits ok:ExitP(max); void g (int max) { int tmp = f(max); //@ loop assigns ok:tmp; while (tmp<=max) { tmp ++; } } //@ requires ok: x > 0 ; assigns \nothing; extern int f_with_precond (int x); // corrected. //@ requires PostP(max); ensures ok: PostP(max); void unreachable_smt_with_contract (int max) { int tmp = f_with_precond(1); goto L; //@ requires ok: Pre1(max); assigns ok: tmp; ensures ok: Post1(max); exits ok: Exit1(max); tmp = f_with_precond(-2); //@ assert ok: P(tmp); tmp=3; L:; } //@ assigns \nothing; exits never: \false; int f_no_exit(int) ; // corrected in stronger the PO (e1 is forgotten and is not provable *) //@ exits e:ExitP(0); int cfg_domination_problem (int max) { int tmp=1; if (max) { tmp=f_no_exit(tmp); goto L; } //@ assigns tmp; exits e1:ExitP(max); { tmp=f(max); L: tmp=3; } return tmp; } �������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/��������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020016� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts0708.res.oracle��������������������������0000666�0000000�0000000�00000001353�13571573400�023106� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts0708.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'A' in 'f': Let x_1 = 1 + x. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: P_P(x). } Prove: P_P(x_1). ------------------------------------------------------------ Goal Post-condition 'B' in 'f': Let x_1 = 2 + x. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: P_P(x). } Prove: P_P(x_1). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts0843.res.oracle��������������������������0000666�0000000�0000000�00000003217�13571573400�023107� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts0843.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f3 ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/bts0843.i, line 12) in 'f3': Effect at line 13 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g3 ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/bts0843.i, line 14) in 'g3': Call Effect at line 16 Let a = Mptr_0[global(G_p_18)]. Let a_1 = shiftfield_F1_a(a). Assume { (* Goal *) When: !invalid(Malloc_0, a_1, 1). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, a, 1). } Prove: a_1 = shiftfield_F1_a(Mptr_0[L_p_ref]). ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/bts0843.i, line 14) in 'g3': Call Effect at line 16 Let a = Mptr_0[global(G_p_18)]. Let a_1 = shiftfield_F1_a(a). Assume { (* Goal *) When: !invalid(Malloc_0, a_1, 1). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, a, 1). } Prove: a_1 = shiftfield_F1_a(Mptr_0[L_p_ref]). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_bts/bts0843.i, line 12) in 'f3'' in 'g3' at call 'f3' (file tests/wp_bts/bts0843.i, line 16) : Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts779.res.oracle���������������������������0000666�0000000�0000000�00000001042�13571573400�023031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts779.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/bts779.i, line 6): Let x = Mint_0[shift_uint8(t, 0)]. Assume { Type: is_uint8(x). (* Heap *) Have: region(t.base) <= 0. } Prove: x <= 255. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts788.res.oracle���������������������������0000666�0000000�0000000�00000002067�13571573400�023041� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_bts/bts788.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Post-condition 'I0' in 'main': Prove: true. ------------------------------------------------------------ Goal Post-condition 'I1' in 'main': Let x = t20_0[1]. Assume { Type: is_sint32(x) /\ is_sint32(t20_0[2]). (* Initializer *) Init: t20_0[0] = 3. (* Initializer *) Init: forall i : Z. ((0 < i) -> ((i <= 19) -> (t20_0[i] = 0))). } Prove: x = 0. ------------------------------------------------------------ Goal Post-condition 'I2' in 'main': Let x = t20_0[2]. Assume { Type: is_sint32(t20_0[1]) /\ is_sint32(x). (* Initializer *) Init: t20_0[0] = 3. (* Initializer *) Init: forall i : Z. ((0 < i) -> ((i <= 19) -> (t20_0[i] = 0))). } Prove: x = 0. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts986.res.oracle���������������������������0000666�0000000�0000000�00000001031�13571573400�023027� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts986.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'A' (file tests/wp_bts/bts986.i, line 12): Assume { (* Heap *) Have: linked(Malloc_0). } Prove: !valid_rw(Malloc_0[L_x_21 <- 0], global(L_x_21), 1). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_0896.res.oracle�������������������������0000666�0000000�0000000�00000001607�13571573400�023257� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_0896.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Instance of 'Pre-condition 'r2' in 'g'' in 'f' at call 'g' (file tests/wp_bts/bts_0896.i, line 22) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/bts_0896.i, line 18) in 'g': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/bts_0896.i, line 18) in 'g': Prove: true. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1174.res.oracle�������������������������0000666�0000000�0000000�00000001222�13571573400�023236� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1174.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Assertion 'qed_ok' (file tests/wp_bts/bts_1174.i, line 11): Let r = of_f64(x). Assume { Type: is_sint32(a). (* Goal *) When: .0 <= r. (* Pre-condition *) Have: (r <= 10.0) /\ (-10.0 <= r). (* Then *) Have: a != 0. } Prove: .0 <= of_f64(mul_f64(x, to_f64(2.0))). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1176.res.oracle�������������������������0000666�0000000�0000000�00000000705�13571573400�023245� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1176.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'qed_ok' (file tests/wp_bts/bts_1176.i, line 17): Prove: true. ------------------------------------------------------------ �����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1360.res.oracle�������������������������0000666�0000000�0000000�00000004652�13571573400�023245� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_bts/bts_1360.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function foo_correct [rte] annotating function foo_wrong ------------------------------------------------------------ Function foo_correct ------------------------------------------------------------ Goal Post-condition (file tests/wp_bts/bts_1360.i, line 24) in 'foo_correct': Prove: true. ------------------------------------------------------------ Goal Assertion 'rte,mem_access' (file tests/wp_bts/bts_1360.i, line 29): Assume { (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (b != a) /\ valid_rd(Malloc_0, b, 1) /\ valid_rw(Malloc_0, a, 1). } Prove: valid_rd(Malloc_0, a, 1). ------------------------------------------------------------ Goal Assertion 'rte,mem_access' (file tests/wp_bts/bts_1360.i, line 29): Prove: true. ------------------------------------------------------------ Goal Assertion 'rte,mem_access' (file tests/wp_bts/bts_1360.i, line 30): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/bts_1360.i, line 25) in 'foo_correct': Effect at line 30 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function foo_wrong ------------------------------------------------------------ Goal Post-condition (file tests/wp_bts/bts_1360.i, line 13) in 'foo_wrong': Prove: true. ------------------------------------------------------------ Goal Assertion 'rte,mem_access' (file tests/wp_bts/bts_1360.i, line 18): Prove: true. ------------------------------------------------------------ Goal Assertion 'rte,mem_access' (file tests/wp_bts/bts_1360.i, line 18): Prove: true. ------------------------------------------------------------ Goal Assertion 'rte,mem_access' (file tests/wp_bts/bts_1360.i, line 19): Assume { (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (b != a) /\ valid_rd(Malloc_0, a, 1) /\ valid_rd(Malloc_0, b, 1). } Prove: valid_rw(Malloc_0, a, 1). ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/bts_1360.i, line 14) in 'foo_wrong': Effect at line 19 Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1382.res.oracle�������������������������0000666�0000000�0000000�00000005327�13571573400�023251� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1382.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_bts/bts_1382.i:18: Warning: Cast with incompatible pointers types (source: sint32*) (target: sint8*) [wp] tests/wp_bts/bts_1382.i:18: Warning: Cast with incompatible pointers types (source: sint32*) (target: sint8*) [wp] tests/wp_bts/bts_1382.i:17: Warning: Cast with incompatible pointers types (source: sint32*) (target: uint8*) ------------------------------------------------------------ Function loop ------------------------------------------------------------ Goal Loop assigns (file tests/wp_bts/bts_1382.i, line 15) (1/3): tests/wp_bts/bts_1382.i:17: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: uint8*) tests/wp_bts/bts_1382.i:18: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: sint8*) tests/wp_bts/bts_1382.i:18: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: sint8*) Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_bts/bts_1382.i, line 15) (2/3): Call Effect at line 17 tests/wp_bts/bts_1382.i:17: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: uint8*) Assume { Type: is_sint32(i). (* Goal *) When: !invalid(Malloc_0, w, 1). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Then *) Have: i <= 99. } Prove: global(G_dest_43) = w. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_bts/bts_1382.i, line 15) (3/3): Call Effect at line 18 tests/wp_bts/bts_1382.i:17: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: uint8*) tests/wp_bts/bts_1382.i:18: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: sint8*) tests/wp_bts/bts_1382.i:18: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: sint8*) Let a = shift_sint8(w, 0). Assume { Type: is_sint32(i). (* Goal *) When: !invalid(Malloc_0, a, 4). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Then *) Have: i <= 99. } Prove: included(a, 4, global(G_dest_43), 1). ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1462.res.oracle�������������������������0000666�0000000�0000000�00000005772�13571573400�023254� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1462.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function local ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_bts/bts_1462.i, line 26): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_bts/bts_1462.i, line 26): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_bts/bts_1462.i, line 26) (1/2): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_bts/bts_1462.i, line 26) (2/2): Effect at line 30 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function wrong ------------------------------------------------------------ Goal Assertion 'for_value' (file tests/wp_bts/bts_1462.i, line 5): Assume { Type: is_sint32(c). } Prove: (c = 1) \/ (c <= 0) \/ (2 <= c). ------------------------------------------------------------ Goal Preservation of Invariant 'A_KO' (file tests/wp_bts/bts_1462.i, line 9): Assume { Type: is_sint32(c) /\ is_sint32(i) /\ is_sint32(x) /\ is_sint32(y) /\ is_sint32(y_1) /\ is_sint32(1 + i). (* Goal *) When: i != (-1). (* Assertion 'for_value' *) Have: (c = 1) \/ (c <= 0) \/ (2 <= c). Have: c != 2. (* Invariant 'C' *) Have: ((c = 0) -> ((i = 0) -> (x = 0))). (* Invariant 'A_KO' *) Have: ((i != 0) -> (y_1 = 0)). (* Then *) Have: i <= 9. If c = 1 Then { Have: y = 1. } Else { Have: y_1 = y. } } Prove: y = 0. ------------------------------------------------------------ Goal Establishment of Invariant 'A_KO' (file tests/wp_bts/bts_1462.i, line 9): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'B' (file tests/wp_bts/bts_1462.i, line 10): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'B' (file tests/wp_bts/bts_1462.i, line 10): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'C' (file tests/wp_bts/bts_1462.i, line 11): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'C' (file tests/wp_bts/bts_1462.i, line 11): Prove: true. ------------------------------------------------------------ Goal Assertion 'consequence_of_false_invariant' (file tests/wp_bts/bts_1462.i, line 19): Assume { Type: is_sint32(i) /\ is_sint32(y). (* Invariant 'A_KO' *) Have: ((i != 0) -> (y = 0)). (* Else *) Have: 10 <= i. } Prove: y = 0. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_bts/bts_1462.i, line 12): Prove: true. ------------------------------------------------------------ ������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1586.res.oracle�������������������������0000666�0000000�0000000�00000002572�13571573400�023256� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1586.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function compute_bizarre with behavior Bizarre ------------------------------------------------------------ Goal Post-condition for 'Bizarre' 'TRANS' in 'compute_bizarre': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function compute_normal with behavior Normal ------------------------------------------------------------ Goal Post-condition for 'Normal' 'TRANS' in 'compute_normal': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main_bizarre_KO ------------------------------------------------------------ Goal Assertion 'FALSE' (file tests/wp_bts/bts_1586.i, line 32): Tags: Case 0. Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function main_normal_KO ------------------------------------------------------------ Goal Assertion 'FALSE' (file tests/wp_bts/bts_1586.i, line 47): Tags: Case 0. Prove: false. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1588.res.oracle�������������������������0000666�0000000�0000000�00000001672�13571573400�023260� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1588.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_bts/bts_1588.i:19: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp_bts/bts_1588.i:5: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Preservation of Invariant 'l1_2' (file tests/wp_bts/bts_1588.i, line 4): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'l1_2' (file tests/wp_bts/bts_1588.i, line 4): Prove: true. ------------------------------------------------------------ Goal Assertion 'a1' (file tests/wp_bts/bts_1588.i, line 8): Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1601.res.oracle�������������������������0000666�0000000�0000000�00000003267�13571573400�023244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1601.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/bts_1601.c, line 72): Assume { Type: is_uint32(tenumRMode_0). (* Residual *) When: ne_f32(fRrValue_0, to_f32(.0)). (* Goal *) When: of_f32(fRrValue_0) = .0. } Prove: tenumRMode_0 = 1. ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/bts_1601.c, line 84): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/bts_1601.c, line 104): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/bts_1601.c, line 136): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/bts_1601.c, line 147): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/bts_1601.c, line 153): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/bts_1601.c, line 157): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function foo with behavior basic ------------------------------------------------------------ Goal Post-condition for 'basic' (file tests/wp_bts/bts_1601.c, line 46) in 'foo': Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1647.res.oracle�������������������������0000666�0000000�0000000�00000001533�13571573400�023250� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1647.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'e1' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'e2' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'e3' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'e4' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'e5' in 'f': Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1776.res.oracle�������������������������0000666�0000000�0000000�00000001047�13571573400�023253� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1776.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'KO,ax2' (file tests/wp_bts/bts_1776.i, line 14): Assume { Type: is_sint32(X) /\ is_sint32(X_1) /\ is_sint32(x). (* Then *) Have: X_1 < x. } Prove: X < x. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1828.0.res.oracle�����������������������0000666�0000000�0000000�00000004343�13571573400�023411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1828.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function global_frame ------------------------------------------------------------ Goal Post-condition 'sep_iff_ref' in 'global_frame': Assume { (* Heap *) Have: (region(one_0.base) <= 0) /\ (region(zero_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, one_0, 1) /\ valid_rw(Malloc_0, zero_0, 1). } Prove: zero_0 != one_0. ------------------------------------------------------------ Goal Post-condition 'one_iff_ref' in 'global_frame': Let x = Mint_0[one_0]. Let x_1 = Mint_0[zero_0]. Let x_2 = x + x_1 - 1. Let x_3 = 1 + x + x_1. Let x_4 = Mint_0[one_0 <- x_3][zero_0 <- x_2][one_0]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x + x_1) /\ is_sint32(x_2) /\ is_sint32(x_4). (* Heap *) Have: (region(one_0.base) <= 0) /\ (region(zero_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, one_0, 1) /\ valid_rw(Malloc_0, zero_0, 1). } Prove: x_4 = x_3. ------------------------------------------------------------ Goal Post-condition 'zero_always' in 'global_frame': Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_bts/bts_1828.i, line 60): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_bts/bts_1828.i, line 61): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function local_frame ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_bts/bts_1828.i, line 23): Assume { (* Heap *) Have: (region(one_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, one_0, 1). } Prove: global(L_two_22) != one_0. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'global_frame': /*@ behavior typed: requires \separated(&zero,one); */ void global_frame(int *one, int arg); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_1828.1.res.oracle�����������������������0000666�0000000�0000000�00000003227�13571573400�023412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_bts/bts_1828.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function global_frame ------------------------------------------------------------ Goal Post-condition 'sep_iff_ref' in 'global_frame': Prove: true. ------------------------------------------------------------ Goal Post-condition 'one_iff_ref' in 'global_frame': Prove: true. ------------------------------------------------------------ Goal Post-condition 'zero_always' in 'global_frame': Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_bts/bts_1828.i, line 60): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_bts/bts_1828.i, line 61): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function local_frame ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_bts/bts_1828.i, line 23): Assume { (* Heap *) Have: (region(one_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, one_0, 1). } Prove: global(L_two_22) != one_0. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'global_frame': /*@ behavior typed_ref: requires \separated(zero,one); requires \valid(zero); requires \valid(one); */ void global_frame(int *one, int arg); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_2040.res.oracle�������������������������0000666�0000000�0000000�00000000677�13571573400�023244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2040.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function call ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/bts_2040.i, line 17): Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_2079.res.oracle�������������������������0000666�0000000�0000000�00000002107�13571573400�023246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2079.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Post-condition 'Obs,P' in 'main': Assume { Type: is_sint32(k). (* Heap *) Have: region(0) <= 0. } Prove: P_S(k). ------------------------------------------------------------ Goal Post-condition 'Obs,Q' in 'main': Assume { Type: is_sint32(k). (* Heap *) Have: region(0) <= 0. } Prove: P_S(k). ------------------------------------------------------------ Goal Post-condition 'Obs,R' in 'main': Assume { Type: is_sint32(k). (* Heap *) Have: region(0) <= 0. } Prove: P_S(45 + k). ------------------------------------------------------------ Goal Post-condition 'Eval,P' in 'main': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Eval,Q' in 'main': Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_2110.res.oracle�������������������������0000666�0000000�0000000�00000006603�13571573400�023235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2110.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled --------------------------------------------- --- Context 'typed_myMain' Cluster 'S2_A' --------------------------------------------- theory S2_A (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) type S2_A = | S2_A1 (F2_A_dummy:int) (* use frama_c_wp.cint.Cint *) predicate IsS2_A (s:S2_A) = is_sint32 (F2_A_dummy s) predicate EqS2_A (s:S2_A) (s1:S2_A) = F2_A_dummy s1 = F2_A_dummy s end --------------------------------------------- --- Context 'typed_myMain' Cluster 'Compound' --------------------------------------------- theory Compound (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.memory.Memory *) function shiftfield_F1_FD_pos (p:addr) : addr = shift p 0 function shiftfield_F2_A_dummy (p:addr) : addr = shift p 0 (* use S2_A *) function Load_S2_A (p:addr) (mint:addr -> int) : S2_A = S2_A1 (get mint (shiftfield_F2_A_dummy p)) axiom Q_Load_S2_A_update_Mint : forall mint:addr -> int, p:addr, q:addr, v:int [Load_S2_A p (set mint q v)]. not q = p -> Load_S2_A p (set mint q v) = Load_S2_A p mint axiom Q_Load_S2_A_eqmem_Mint : forall mint:addr -> int, mint1:addr -> int, n:int, p:addr, q:addr [Load_S2_A p mint, eqmem mint mint1 q n| Load_S2_A p mint1, eqmem mint mint1 q n]. included p 1 q n -> eqmem mint mint1 q n -> Load_S2_A p mint1 = Load_S2_A p mint axiom Q_Load_S2_A_havoc_Mint : forall mint:addr -> int, mint1:addr -> int, n:int, p:addr, q:addr [Load_S2_A p (havoc mint1 mint q n)]. separated p 1 q n -> Load_S2_A p (havoc mint1 mint q n) = Load_S2_A p mint end [wp:print-generated] theory WP (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.memory.Memory *) (* use Compound *) goal wp_goal : forall t:int -> int, t1:addr -> int, a:addr, a1:addr, i:int. let a2 = shiftfield_F1_FD_pos a1 in let x = get t1 a2 in not x = i -> region (base a1) <= 0 -> region (base a) <= 0 -> linked t -> is_sint32 i -> is_sint32 x -> not invalid t a2 1 -> a2 = a end [wp:print-generated] theory WP1 (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.memory.Memory *) (* use S2_A *) (* use Compound *) goal wp_goal : forall t:addr -> int, t1:addr -> int, a:addr, a1:addr. let a2 = Load_S2_A a t in let a3 = Load_S2_A a (havoc t1 t a 1) in region (base a1) <= 0 -> region (base a) <= 0 -> IsS2_A a2 -> IsS2_A a3 -> EqS2_A a3 a2 end [wp] 2 goals generated �����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_2159.res.oracle�������������������������0000666�0000000�0000000�00000001275�13571573400�023252� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2159.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition (file tests/wp_bts/bts_2159.i, line 5) in 'job': Assume { Type: is_sint32(s) /\ is_sint32(s_1) /\ is_sint32(x). If 0 <= x Then { If x <= 100 Then { Have: (s + x) = s_1. } Else { Have: s_1 = s. } } Else { Have: s_1 = s. } } Prove: (if ((0 <= x) & (x <= 100)) then L_Id(s + x) else L_Id(s)) = s_1. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_2201.res.oracle�������������������������0000666�0000000�0000000�00000000670�13571573400�023234� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2201.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Assigns nothing in 'main': Effect at line 8 Prove: true. ------------------------------------------------------------ ������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/bts_2246.res.oracle�������������������������0000666�0000000�0000000�00000001453�13571573400�023245� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2246.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function bad ------------------------------------------------------------ Goal Post-condition (file tests/wp_bts/bts_2246.i, line 9) in 'bad' (1/3): Tags: Default. Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_bts/bts_2246.i, line 9) in 'bad' (2/3): Tags: Case 1. Prove: false. ------------------------------------------------------------ Goal Post-condition (file tests/wp_bts/bts_2246.i, line 9) in 'bad' (3/3): Tags: Case 0. Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/ergo_typecheck.res.oracle�������������������0000666�0000000�0000000�00000002373�13571573400�024775� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/ergo_typecheck.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'var_divded' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'var_inline' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'var_unit0' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'var_unit1' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'var_unit2' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'var_unit3' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'var_unit4' in 'f': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/ergo_typecheck.i, line 34) in 'f': Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/ex5.res.oracle������������������������������0000666�0000000�0000000�00000015035�13571573400�022502� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/ex5.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function dummy ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/ex5.i, line 7): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/ex5.i, line 9): Prove: exists i_4,i_3,i_2,i_1,i : Z. 7 <= (i + i_1 + i_2 + i_3 + i_4). ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/ex5.i, line 11): Assume { (* Assertion *) Have: 7 <= (i + i_1 + i_2 + i_3 + i_4). } Prove: exists i_5 : Z. 4 <= i_5. ------------------------------------------------------------ ------------------------------------------------------------ Function exists ------------------------------------------------------------ Goal Post-condition 'ok11' in 'exists': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok12' in 'exists': Prove: exists i_1,i : Z. L_f(i) = i_1. ------------------------------------------------------------ Goal Post-condition 'ok21' in 'exists': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok22' in 'exists': Prove: exists i_1,i : Z. (1 + i_1) = L_f(i). ------------------------------------------------------------ Goal Post-condition 'ok31' in 'exists': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok32' in 'exists': Prove: exists i_1,i : Z. (a + i_1 + L_f(a)) = (b + L_f(i)). ------------------------------------------------------------ Goal Post-condition 'ko0' in 'exists': Prove: exists i : Z. i != 1. ------------------------------------------------------------ Goal Post-condition 'ko1' in 'exists': Prove: exists i : Z. L_f(i) = i. ------------------------------------------------------------ Goal Post-condition 'ko2' in 'exists': Prove: exists i : Z. (b + L_f(i)) = (1 + i). ------------------------------------------------------------ Goal Post-condition 'ko3' in 'exists': Prove: exists i : Z. (i + L_f(i)) = b. ------------------------------------------------------------ Goal Post-condition 'ko4' in 'exists': Prove: exists i : Z. P_P(i) /\ (exists i_1 : Z. L_f(i_1) = i). ------------------------------------------------------------ Goal Post-condition 'ko5' in 'exists': Prove: exists i : Z. (i = 1) \/ P_P(i) \/ P_Q(i). ------------------------------------------------------------ Goal Post-condition 'p1' in 'exists': Prove: P_P(1) /\ P_Q(1). ------------------------------------------------------------ Goal Post-condition 'p2' in 'exists': Let x = b - 1. Prove: P_P(x) /\ P_Q(x). ------------------------------------------------------------ Goal Post-condition 'p3' in 'exists': Let x = b + L_f(b) - 1 - L_f(a). Prove: P_P(x) /\ P_Q(x). ------------------------------------------------------------ Goal Post-condition 'ok41' in 'exists': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok42' in 'exists': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok43' in 'exists': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko43' in 'exists': Prove: P_C(false, true). ------------------------------------------------------------ ------------------------------------------------------------ Function forall ------------------------------------------------------------ Goal Post-condition 'ok11' in 'forall': Prove: false. ------------------------------------------------------------ Goal Post-condition 'ok12' in 'forall': Prove: L_f(i) != i_1. ------------------------------------------------------------ Goal Post-condition 'ok21' in 'forall': Prove: false. ------------------------------------------------------------ Goal Post-condition 'ok22' in 'forall': Prove: (1 + i) != L_f(i_1). ------------------------------------------------------------ Goal Post-condition 'ok31' in 'forall': Prove: false. ------------------------------------------------------------ Goal Post-condition 'ok32' in 'forall': Prove: (a + i + L_f(a)) != (b + L_f(i_1)). ------------------------------------------------------------ Goal Post-condition 'ko0' in 'forall': Prove: L_f(i) = i. ------------------------------------------------------------ Goal Post-condition 'ko1' in 'forall': Prove: L_f(i) != i. ------------------------------------------------------------ Goal Post-condition 'ko2' in 'forall': Prove: (b + L_f(i)) != (1 + i). ------------------------------------------------------------ Goal Post-condition 'ko3' in 'forall': Prove: (i + L_f(i)) != b. ------------------------------------------------------------ Goal Post-condition 'ko4' in 'forall': Prove: (L_f(i) != i_1) \/ P_P(i_1). ------------------------------------------------------------ Goal Post-condition 'ko5' in 'forall': Prove: (i != 1) /\ P_P(i) /\ P_Q(i). ------------------------------------------------------------ Goal Post-condition 'p1' in 'forall': Prove: P_P(1) \/ P_Q(1). ------------------------------------------------------------ Goal Post-condition 'p2' in 'forall': Let x = b - 1. Prove: P_P(x) \/ P_Q(x). ------------------------------------------------------------ Goal Post-condition 'p3' in 'forall': Let x = b + L_f(b) - 1 - L_f(a). Prove: P_P(x) \/ P_Q(x). ------------------------------------------------------------ Goal Post-condition 'q1' in 'forall': Assume { (* Goal *) When: P_P(1) /\ P_Q(1). } Prove: false. ------------------------------------------------------------ Goal Post-condition 'q2' in 'forall': Let x = b - 1. Assume { (* Goal *) When: P_P(x) /\ P_Q(x). } Prove: false. ------------------------------------------------------------ Goal Post-condition 'q3' in 'forall': Let x = b + L_f(b) - 1 - L_f(a). Assume { (* Goal *) When: P_P(x) /\ P_Q(x). } Prove: false. ------------------------------------------------------------ Goal Post-condition 'r1' in 'forall': Assume { (* Goal *) When: P_P(1). } Prove: P_Q(1). ------------------------------------------------------------ Goal Post-condition 'r2' in 'forall': Let x = b - 1. Assume { (* Goal *) When: P_P(x). } Prove: P_Q(x). ------------------------------------------------------------ Goal Post-condition 'r3' in 'forall': Let x = b + L_f(b) - 1 - L_f(a). Assume { (* Goal *) When: P_P(x). } Prove: P_Q(x). ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue-364.res.oracle������������������������0000666�0000000�0000000�00000001551�13571573400�023441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue-364.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Assertion 'ZERO' (file tests/wp_bts/issue-364.i, line 5): Assume { (* Heap *) Have: linked(Malloc_0). } Prove: valid_rd(Malloc_0, shift_sint8(global(Str_1), 3), 1). ------------------------------------------------------------ Goal Assertion 'OVER' (file tests/wp_bts/issue-364.i, line 6): Let a = global(Str_1). Assume { (* Heap *) Have: linked(Malloc_0). (* Assertion 'ZERO' *) Have: valid_rd(Malloc_0, shift_sint8(a, 3), 1). } Prove: !valid_rd(Malloc_0, shift_sint8(a, 4), 1). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue-516.res.oracle������������������������0000666�0000000�0000000�00000002312�13571573400�023434� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue-516.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: No definition for 'to_logic_list' interpreted as reads nothing ------------------------------------------------------------ Function list_remove ------------------------------------------------------------ Goal Assertion (file tests/wp_bts/issue-516.c, line 21): Let a = Mptr_0[list_0]. Assume { (* Heap *) Have: (region(item_0.base) <= 0) /\ (region(list_0.base) <= 0) /\ framed(Mptr_0). } Prove: (a != null) /\ (a = nth(L_to_logic_list(a, null), 0)). ------------------------------------------------------------ Goal Assertion 'UNROLL' (file tests/wp_bts/issue-516.c, line 23): Let a = Mptr_0[list_0]. Let a_1 = Mptr_0[shiftfield_F1_list_next(a)]. Assume { (* Goal *) When: (a_1 != item_0) /\ (a_1 = null). (* Heap *) Have: (region(item_0.base) <= 0) /\ (region(list_0.base) <= 0) /\ framed(Mptr_0). (* Initializer *) Init: a = nth(L_to_logic_list(a, a_1), 0). (* Assertion *) Have: a_1 != a. } Prove: L_to_logic_list(a, a) = nil. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue-684-exit.res.oracle�������������������0000666�0000000�0000000�00000001621�13571573400�024413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue-684-exit.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function inconditional_exit ------------------------------------------------------------ Goal Post-condition (file tests/wp_bts/issue-684-exit.c, line 4) in 'inconditional_exit': Prove: true. ------------------------------------------------------------ Goal Exit-condition (file tests/wp_bts/issue-684-exit.c, line 3) in 'inconditional_exit': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'inconditional_exit': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'inconditional_exit': Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue_141.res.oracle������������������������0000666�0000000�0000000�00000000673�13571573400�023520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -wp-steps 50 [...] [kernel] Parsing tests/wp_bts/issue_141.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function f [rte] annotating function main [wp] tests/wp_bts/issue_141.i:18: Warning: calculus failed on strategy for 'main', behavior 'default!', all properties, both assigns or not because unsupported strange loop(s). (abort) [wp] No proof obligations ���������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue_198.res.oracle������������������������0000666�0000000�0000000�00000000630�13571573400�023525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_198.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma broken: Prove: (0<b_0) -> (is_sint32 b_0) -> ((b_0 div b_0)=1) ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue_447.res.oracle������������������������0000666�0000000�0000000�00000000567�13571573400�023533� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_447.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma foo: Prove: (1+x_0)=(L_f x_0) ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue_453.res.oracle������������������������0000666�0000000�0000000�00000003335�13571573400�023524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_453.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f1 ------------------------------------------------------------ Goal Loop assigns (file tests/wp_bts/issue_453.i, line 13): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f1 with behavior default_for_stmt_7 ------------------------------------------------------------ Goal Post-condition 'Sincr' at call 'incr' (file tests/wp_bts/issue_453.i, line 19): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/issue_453.i, line 16) at call 'incr' (file tests/wp_bts/issue_453.i, line 19): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f2 ------------------------------------------------------------ Goal Loop assigns (file tests/wp_bts/issue_453.i, line 25): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f2 with behavior default_for_stmt_17 ------------------------------------------------------------ Goal Post-condition 'Sincr' at call 'incr' (file tests/wp_bts/issue_453.i, line 32): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/issue_453.i, line 29) at call 'incr' (file tests/wp_bts/issue_453.i, line 32): Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue_494.res.oracle������������������������0000666�0000000�0000000�00000002505�13571573400�023527� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_494.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_bts/issue_494.i, line 4) in 'f': Let x = Mint_0[p]. Let x_1 = 1 + x. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: P_R(x, x_1). ------------------------------------------------------------ ------------------------------------------------------------ Function job_ko_fixed ------------------------------------------------------------ Goal Assertion 'Wrong' (file tests/wp_bts/issue_494.i, line 10): Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Call 'f' *) Have: P_R(x_1, x). } Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function job_ko_success ------------------------------------------------------------ Goal Assertion 'Wrong' (file tests/wp_bts/issue_494.i, line 16): Assume { Type: is_sint32(y) /\ is_sint32(y_1). (* Call 'f' *) Have: P_R(y, y_1). } Prove: false. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue_508.res.oracle������������������������0000666�0000000�0000000�00000002340�13571573400�023520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_508.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function add ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/issue_508.c, line 17) in 'add' (1/3): Effect at line 21 Let a = shiftfield_F2_data(tbl_0). Let x = to_uint32(d). Assume { Type: is_sint32(d). (* Goal *) When: !invalid(Malloc_0, shiftfield_F1_size(shift___anonstruct_Buckets_1(a, x)), 1). (* Heap *) Have: (region(tbl_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= d) /\ (d <= 16) /\ valid_rw(Malloc_0, tbl_0, 35) /\ valid_rw(Malloc_0, shift___anonstruct_Buckets_1(a, 0), 34). } Prove: (x <= d) /\ (d <= x). ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/issue_508.c, line 17) in 'add' (2/3): Effect at line 22 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/issue_508.c, line 17) in 'add' (3/3): Effect at line 23 Prove: true. ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue_715_a.res.oracle����������������������0000666�0000000�0000000�00000001275�13571573400�024026� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_715_a.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_bts/issue_715_a.i:6: Warning: No code nor implicit assigns clause for function dummy, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_bts/issue_715_a.i, line 2) in 'dummy'' in 'foo' at call 'dummy' (file tests/wp_bts/issue_715_a.i, line 9) : Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/issue_715_b.res.oracle����������������������0000666�0000000�0000000�00000002021�13571573400�024015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_715_b.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_bts/issue_715_b.i:9: Warning: No code nor implicit assigns clause for function dummy, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_bts/issue_715_b.i, line 4) in 'dummy'' in 'foo' at call 'dummy' (file tests/wp_bts/issue_715_b.i, line 11) : Assume { (* Heap *) Have: linked(Malloc_0). } Prove: P_isValid(Malloc_0[L_p_28 <- 1], shift_sint32(global(L_p_28), 0)). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_bts/issue_715_b.i, line 5) in 'dummy'' in 'foo' at call 'dummy' (file tests/wp_bts/issue_715_b.i, line 11) : Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle/nupw-bcl-bts1120.res.oracle�����������������0000666�0000000�0000000�00000005552�13571573400�024625� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/nupw-bcl-bts1120.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] tests/wp_bts/nupw-bcl-bts1120.i:54: Warning: [cfg] Forget exits clause of node <blkIn-stmt:26> [wp] tests/wp_bts/nupw-bcl-bts1120.i:54: Warning: [cfg] Forget exits clause of node <blkIn-stmt:26> [wp] [CFG] Goal unreachable_smt_with_contract_assigns : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_exits_ok : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_ensures_ok : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_requires_ok : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_assert_ok : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_call_f_with_precond_requires_ok : Valid (Unreachable) [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function cfg_domination_problem ------------------------------------------------------------ Goal Exit-condition 'e' in 'cfg_domination_problem': Assume { (* Exit 'f' *) Have: P_ExitF(0). } Prove: P_ExitP(0). ------------------------------------------------------------ ------------------------------------------------------------ Function cfg_domination_problem with behavior default_for_stmt_26 ------------------------------------------------------------ Goal Assigns (file tests/wp_bts/nupw-bcl-bts1120.i, line 60) at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Exit-condition 'ok' in 'g': Prove: true. ------------------------------------------------------------ Goal Loop assigns 'ok': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (2/3): Call Result at line 27 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (3/3): Effect at line 29 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function unreachable_smt_with_contract ------------------------------------------------------------ Goal Post-condition 'ok' in 'unreachable_smt_with_contract': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition 'ok' in 'f_with_precond'' in 'unreachable_smt_with_contract' at initialization of 'tmp' (file tests/wp_bts/nupw-bcl-bts1120.i, line 40) : Prove: true. ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/�������������������������������������0000777�0000000�0000000�00000000000�13571573400�021357� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0708.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024306� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0708.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025351� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0708.0.session/cache/45adede70556d3565ca7da32bceece0c.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0708.0.session/cache/45adede70556d0000666�0000000�0000000�00000000126�13571573400�027261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0085, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0708.0.session/cache/cab2498bc3eae91d071c428687d9c535.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0708.0.session/cache/cab2498bc3eae0000666�0000000�0000000�00000000125�13571573400�027411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.014, "steps": 9 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0708.i.0.report.json��������������0000666�0000000�0000000�00000002741�13571573400�025264� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 2 }, "wp:main": { "total": 2, "valid": 2, "rank": 2 } }, "wp:functions": { "f": { "f_ensures_B": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "f_ensures_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 2 }, "wp:main": { "total": 2, "valid": 2, "rank": 2 } } } } } �������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0708.res.oracle�������������������0000666�0000000�0000000�00000002436�13571573400�024452� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts0708.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_A : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts0708.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts0708.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (4..16) 1 100% ------------------------------------------------------------- [wp] Running WP plugin... [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_A : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_B : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts0708.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts0708.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 2 (4..16) 2 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0843.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024306� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0843.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025351� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0843.0.session/cache/8ee3ccd2b653146fa62b383b6d59595a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0843.0.session/cache/8ee3ccd2b65310000666�0000000�0000000�00000000126�13571573400�027254� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0154, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0843.i.0.report.json��������������0000666�0000000�0000000�00000003566�13571573400�025272� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 4, "rank": 1 } }, "wp:functions": { "f3": { "f3_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "g3": { "f3_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g3_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 3, "rank": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts0843.res.oracle�������������������0000666�0000000�0000000�00000001624�13571573400�024450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts0843.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Qed] Goal typed_f3_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_g3_assigns_exit : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_g3_assigns_normal : Valid [wp] [Qed] Goal typed_g3_call_f3_requires : Valid [wp] Proved goals: 4 / 4 Qed: 2 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts0843.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts0843.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f3 1 - 1 100% g3 1 2 3 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts779.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024236� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts779.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025301� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts779.0.session/cache/84e464991f42146c235a4fc00372cf66.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts779.0.session/cache/84e464991f42140000666�0000000�0000000�00000000107�13571573400�027004� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts779.0.session/cache/df22e5945984cae59d5572661c5078e4.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts779.0.session/cache/df22e5945984ca0000666�0000000�0000000�00000000127�13571573400�027226� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0228, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts779.i.0.report.json���������������0000666�0000000�0000000�00000003136�13571573400�025213� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 4 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1, "rank": 4 } }, "wp:functions": { "f": { "f_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 4 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1, "rank": 4 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts779.res.oracle��������������������0000666�0000000�0000000�00000001422�13571573400�024374� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_bts/bts779.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function f [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_rte_mem_access : Unsuccess [wp] Proved goals: 1 / 2 Qed: 0 Alt-Ergo 2.0.0: 1 (unsuccess: 1) [wp] Report in: 'tests/wp_bts/oracle_qualif/bts779.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts779.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (12..24) 2 50.0% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts788.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024236� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts788.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025301� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts788.0.session/cache/9615dd4933bcc9729b8d73c457ea1451.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts788.0.session/cache/9615dd4933bcc90000666�0000000�0000000�00000000126�13571573400�027223� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.016, "steps": 16 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts788.0.session/cache/f3def660dbf6ffbaa12d1bfcbaf4fa10.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts788.0.session/cache/f3def660dbf6ff0000666�0000000�0000000�00000000127�13571573400�027525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0156, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts788.i.0.report.json���������������0000666�0000000�0000000�00000004042�13571573400�025210� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 3, "rank": 3 } }, "wp:functions": { "main": { "main_ensures_I2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "main_ensures_I1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "main_ensures_I0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 3, "rank": 3 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts788.res.oracle��������������������0000666�0000000�0000000�00000001514�13571573400�024376� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_bts/bts788.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_ref_main_ensures_I0 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_main_ensures_I1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_main_ensures_I2 : Valid [wp] Proved goals: 3 / 3 Qed: 1 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts788.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts788.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main 1 2 (12..24) 3 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts986.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024236� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts986.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025301� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts986.0.session/cache/9445275097129056bb2cb75cd5cbdc15.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts986.0.session/cache/944527509712900000666�0000000�0000000�00000000127�13571573400�026643� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0196, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts986.i.0.report.json���������������0000666�0000000�0000000�00000002031�13571573400�025204� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:functions": { "f": { "f_assert_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts986.res.oracle��������������������0000666�0000000�0000000�00000001310�13571573400�024370� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_bts/bts986.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_A : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts986.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts986.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (8..20) 1 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1174.i.0.report.json�������������0000666�0000000�0000000�00000001273�13571573400�025420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "coq": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "job": { "job_assert_qed_ok": { "coq": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "coq": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1174.res.oracle������������������0000666�0000000�0000000�00000001540�13571573400�024602� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Real)' [...] [kernel] Parsing tests/wp_bts/bts_1174.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: native support for coq is deprecated, use tip instead [wp] 1 goal scheduled [wp] [Coq] Goal typed_real_job_assert_qed_ok : Saved script [wp] [Coq (Native)] Goal typed_real_job_assert_qed_ok : Valid [wp] Proved goals: 1 / 1 Qed: 0 Coq: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_1174.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_1174.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job - - 1 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1176.i.0.report.json�������������0000666�0000000�0000000�00000001157�13571573400�025423� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "f": { "f_assert_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1176.res.oracle������������������0000666�0000000�0000000�00000001256�13571573400�024610� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_bts/bts_1176.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Qed] Goal typed_f_assert_qed_ok : Valid [wp] Proved goals: 1 / 1 Qed: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_1176.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_1176.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 1 - 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1360.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024440� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1360.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�025503� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1360.0.session/cache/3bd45d7903238a8ffb491d774fe6fafe.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1360.0.session/cache/3bd45d7903230000666�0000000�0000000�00000000107�13571573400�027101� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1360.0.session/cache/d6b34eb7a8b408a7607505bec8a37c29.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1360.0.session/cache/d6b34eb7a8b40000666�0000000�0000000�00000000127�13571573400�027325� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0171, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1360.i.0.report.json�������������0000666�0000000�0000000�00000011767�13571573400�025426� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 4 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 10, "valid": 9, "unknown": 1, "rank": 4 } }, "wp:functions": { "foo_wrong": { "foo_wrong_assert_rte_mem_access_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "foo_wrong_assert_rte_mem_access_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_wrong_assert_rte_mem_access": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_wrong_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_wrong_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 5, "valid": 4, "unknown": 1 } } }, "foo_correct": { "foo_correct_assert_rte_mem_access_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_correct_assert_rte_mem_access_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_correct_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "foo_correct_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_correct_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 5, "valid": 5, "rank": 4 } } } } } ���������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1360.res.oracle������������������0000666�0000000�0000000�00000002553�13571573400�024604� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_bts/bts_1360.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function foo_correct [rte] annotating function foo_wrong [wp] 10 goals scheduled [wp] [Qed] Goal typed_foo_correct_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_foo_correct_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_foo_correct_assert_rte_mem_access_2 : Valid [wp] [Qed] Goal typed_foo_correct_assert_rte_mem_access_3 : Valid [wp] [Qed] Goal typed_foo_correct_assigns : Valid [wp] [Qed] Goal typed_foo_wrong_ensures : Valid [wp] [Qed] Goal typed_foo_wrong_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_foo_wrong_assert_rte_mem_access_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_foo_wrong_assert_rte_mem_access_3 : Unsuccess [wp] [Qed] Goal typed_foo_wrong_assigns : Valid [wp] Proved goals: 9 / 10 Qed: 8 Alt-Ergo 2.0.0: 1 (unsuccess: 1) [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_1360.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_1360.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo_wrong 4 - 5 80.0% foo_correct 4 1 (12..24) 5 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.0.report.json���������������0000666�0000000�0000000�00000011315�13571573400�025167� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 2, "unknown": 1, "rank": 2 }, "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 13, "valid": 12, "unknown": 1, "rank": 2 } }, "wp:functions": { "wrong": { "wrong_assert_consequence_of_false_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wrong_loop_invariant_C": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wrong_loop_invariant_B": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wrong_loop_invariant_A_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "wrong_assert_for_value": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wrong_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 2, "unknown": 1, "rank": 2 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 9, "valid": 8, "unknown": 1, "rank": 2 } } }, "local": { "local_loop_invariant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "local_loop_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024443� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�025506� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.0.session/cache/0498222ad10a7cab9a5f7e70ee6d9640.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.0.session/cache/0498222ad10a0000666�0000000�0000000�00000000107�13571573400�027070� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.0.session/cache/16ddbd9fbf85a3bf8a6d0da586ad146a.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.0.session/cache/16ddbd9fbf850000666�0000000�0000000�00000000126�13571573400�027420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0135, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.0.session/cache/7730ee1a1dbc7387268022b37006f301.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.0.session/cache/7730ee1a1dbc0000666�0000000�0000000�00000000127�13571573400�027317� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0086, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.i.0.report.json�������������0000666�0000000�0000000�00000011226�13571573400�025417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 3, "valid": 2, "unknown": 1, "rank": 2 }, "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 13, "valid": 12, "unknown": 1, "rank": 2 } }, "wp:functions": { "wrong": { "wrong_assert_consequence_of_false_invariant": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wrong_loop_invariant_C": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wrong_loop_invariant_B": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wrong_loop_invariant_A_KO": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "wrong_assert_for_value": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wrong_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 3, "valid": 2, "unknown": 1, "rank": 2 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 9, "valid": 8, "unknown": 1, "rank": 2 } } }, "local": { "local_loop_invariant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "local_loop_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1462.res.oracle������������������0000666�0000000�0000000�00000003037�13571573400�024605� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1462.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 13 goals scheduled [wp] [Qed] Goal typed_local_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_local_loop_invariant_established : Valid [wp] [Qed] Goal typed_local_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_local_loop_assigns_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_wrong_assert_for_value : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_wrong_loop_invariant_A_KO_preserved : Unsuccess [wp] [Qed] Goal typed_wrong_loop_invariant_A_KO_established : Valid [wp] [Qed] Goal typed_wrong_loop_invariant_B_preserved : Valid [wp] [Qed] Goal typed_wrong_loop_invariant_B_established : Valid [wp] [Qed] Goal typed_wrong_loop_invariant_C_preserved : Valid [wp] [Qed] Goal typed_wrong_loop_invariant_C_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_wrong_assert_consequence_of_false_invariant : Valid [wp] [Qed] Goal typed_wrong_loop_assigns : Valid [wp] Proved goals: 12 / 13 Qed: 10 Alt-Ergo 2.0.0: 2 (unsuccess: 1) [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_1462.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_1462.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success wrong 6 2 (4..16) 9 88.9% local 4 - 4 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1586.0.report.json���������������0000666�0000000�0000000�00000006001�13571573400�025172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 2, "unknown": 2 } }, "wp:functions": { "compute_bizarre": { "compute_bizarre_Bizarre_ensures_TRANS": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "compute_normal": { "compute_normal_Normal_ensures_TRANS": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "main_bizarre_KO": { "main_bizarre_KO_assert_FALSE": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "main_normal_KO": { "main_normal_KO_assert_FALSE": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1586.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024452� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1586.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�025515� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1586.0.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1586.0.session/cache/2d7c06745f370000666�0000000�0000000�00000000072�13571573400�027124� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1586.i.0.report.json�������������0000666�0000000�0000000�00000005604�13571573400�025431� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 2, "unknown": 2 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 2, "unknown": 2 } }, "wp:functions": { "compute_bizarre": { "compute_bizarre_Bizarre_ensures_TRANS": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "compute_normal": { "compute_normal_Normal_ensures_TRANS": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "main_bizarre_KO": { "main_bizarre_KO_assert_FALSE": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "main_normal_KO": { "main_normal_KO_assert_FALSE": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1586.res.oracle������������������0000666�0000000�0000000�00000002145�13571573400�024613� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1586.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Qed] Goal typed_compute_bizarre_Bizarre_ensures_TRANS : Valid [wp] [Qed] Goal typed_compute_normal_Normal_ensures_TRANS : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_bizarre_KO_assert_FALSE : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_normal_KO_assert_FALSE : Unsuccess [wp] Proved goals: 2 / 4 Qed: 2 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_1586.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_1586.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success compute_bizarre 1 - 1 100% compute_normal 1 - 1 100% main_bizarre_KO - - 1 0.0% main_normal_KO - - 1 0.0% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1588.0.report.json���������������0000666�0000000�0000000�00000001544�13571573400�025203� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:functions": { "f": { "f_assert_a1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_loop_invariant_l1_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1588.i.0.report.json�������������0000666�0000000�0000000�00000001544�13571573400�025432� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:functions": { "f": { "f_assert_a1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_loop_invariant_l1_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1588.res.oracle������������������0000666�0000000�0000000�00000001741�13571573400�024616� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1588.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_bts/bts_1588.i:19: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp_bts/bts_1588.i:5: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 3 goals scheduled [wp] [Qed] Goal typed_f_loop_invariant_l1_2_preserved : Valid [wp] [Qed] Goal typed_f_loop_invariant_l1_2_established : Valid [wp] [Qed] Goal typed_f_assert_a1 : Valid [wp] Proved goals: 3 / 3 Qed: 3 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_1588.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_1588.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 3 - 3 100% ------------------------------------------------------------- �������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1601.0.report.json���������������0000666�0000000�0000000�00000006311�13571573400�025162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 8, "valid": 8, "rank": 5 } }, "wp:functions": { "foo": { "foo_assert_7": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "foo_basic_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 8, "valid": 8, "rank": 5 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1601.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024436� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1601.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�025501� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1601.0.session/cache/1108d44ac28a86f5eb79e03578b6b5ca.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1601.0.session/cache/1108d44ac28a0000666�0000000�0000000�00000000127�13571573400�027150� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0332, "steps": 27 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1601.c.0.report.json�������������0000666�0000000�0000000�00000006204�13571573400�025404� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 8, "valid": 8, "rank": 5 } }, "wp:functions": { "foo": { "foo_assert_7": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "foo_basic_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 8, "valid": 8, "rank": 5 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1601.res.oracle������������������0000666�0000000�0000000�00000001766�13571573400�024607� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1601.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 8 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_foo_assert : Valid [wp] [Qed] Goal typed_foo_assert_2 : Valid [wp] [Qed] Goal typed_foo_assert_3 : Valid [wp] [Qed] Goal typed_foo_assert_4 : Valid [wp] [Qed] Goal typed_foo_assert_5 : Valid [wp] [Qed] Goal typed_foo_assert_6 : Valid [wp] [Qed] Goal typed_foo_assert_7 : Valid [wp] [Qed] Goal typed_foo_basic_ensures : Valid [wp] Proved goals: 8 / 8 Qed: 7 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_1601.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_1601.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo 7 1 (16..28) 8 100% ------------------------------------------------------------- ����������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.0.res.oracle����������������0000666�0000000�0000000�00000002402�13571573400�024744� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_1828.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_global_frame_ensures_sep_iff_ref : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_global_frame_ensures_one_iff_ref : Unsuccess [wp] [Qed] Goal typed_global_frame_ensures_zero_always : Valid [wp] [Qed] Goal typed_global_frame_assert_ok : Valid [wp] [Qed] Goal typed_global_frame_assert_ok_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_local_frame_assert_ok : Valid [wp] Proved goals: 4 / 6 Qed: 3 Alt-Ergo 2.0.0: 1 (unsuccess: 2) [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_1828.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_1828.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success local_frame - 1 (1..12) 1 100% global_frame 3 - 5 60.0% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'global_frame': /*@ behavior typed: requires \separated(&zero,one); */ void global_frame(int *one, int arg); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024451� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�025514� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.0.session/cache/2f7f2c8f6ef7d223e768e1090d15a5ad.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.0.session/cache/2f7f2c8f6ef70000666�0000000�0000000�00000000126�13571573400�027355� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0149, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.0.session/cache/73efff261f005628172071973be37a21.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.0.session/cache/73efff261f000000666�0000000�0000000�00000000107�13571573400�027254� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.0.session/cache/c089c450772a3a0346e02bc1e798bdb0.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.0.session/cache/c089c450772a0000666�0000000�0000000�00000000072�13571573400�027116� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.1.res.oracle����������������0000666�0000000�0000000�00000002515�13571573400�024752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_bts/bts_1828.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Qed] Goal typed_ref_global_frame_ensures_sep_iff_ref : Valid [wp] [Qed] Goal typed_ref_global_frame_ensures_one_iff_ref : Valid [wp] [Qed] Goal typed_ref_global_frame_ensures_zero_always : Valid [wp] [Qed] Goal typed_ref_global_frame_assert_ok : Valid [wp] [Qed] Goal typed_ref_global_frame_assert_ok_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_local_frame_assert_ok : Valid [wp] Proved goals: 6 / 6 Qed: 5 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_1828.1.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_1828.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success local_frame - 1 (1..12) 1 100% global_frame 5 - 5 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'global_frame': /*@ behavior typed_ref: requires \separated(zero,one); requires \valid(zero); requires \valid(one); */ void global_frame(int *one, int arg); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.1.session/������������������0000777�0000000�0000000�00000000000�13571573400�024452� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.1.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�025515� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.1.session/cache/2f7f2c8f6ef7d223e768e1090d15a5ad.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.1.session/cache/2f7f2c8f6ef70000666�0000000�0000000�00000000126�13571573400�027356� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0153, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.i.0.report.json�������������0000666�0000000�0000000�00000010012�13571573400�025415� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 1, "unknown": 2, "rank": 1 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 6, "valid": 4, "unknown": 2, "rank": 1 } }, "wp:functions": { "local_frame": { "local_frame_assert_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } }, "global_frame": { "global_frame_assert_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "global_frame_assert_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "global_frame_ensures_zero_always": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "global_frame_ensures_one_iff_ref": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "global_frame_ensures_sep_iff_ref": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 5, "valid": 3, "unknown": 2 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1828.i.1.report.json�������������0000666�0000000�0000000�00000006711�13571573400�025431� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 6, "valid": 6, "rank": 1 } }, "wp:functions": { "local_frame": { "local_frame_assert_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } }, "global_frame": { "global_frame_assert_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "global_frame_assert_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "global_frame_ensures_zero_always": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "global_frame_ensures_one_iff_ref": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "global_frame_ensures_sep_iff_ref": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } } } } �������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2040.0.report.json���������������0000666�0000000�0000000�00000001253�13571573400�025160� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "call": { "call_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2040.i.0.report.json�������������0000666�0000000�0000000�00000001253�13571573400�025407� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "call": { "call_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2040.res.oracle������������������0000666�0000000�0000000�00000001235�13571573400�024574� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2040.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Qed] Goal typed_call_assert : Valid [wp] Proved goals: 1 / 1 Qed: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_2040.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_2040.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success call 1 - 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2079.i.0.report.json�������������0000666�0000000�0000000�00000002011�13571573400�025414� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:functions": { "main": { "main_ensures_Eval_Q": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_ensures_Eval_P": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2079.res.oracle������������������0000666�0000000�0000000�00000001330�13571573400�024604� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2079.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_main_ensures_Eval_P : Valid [wp] [Qed] Goal typed_main_ensures_Eval_Q : Valid [wp] Proved goals: 2 / 2 Qed: 2 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_2079.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_2079.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main 2 - 2 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2159.0.report.json���������������0000666�0000000�0000000�00000002010�13571573400�025163� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:functions": { "job": { "job_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2159.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024447� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2159.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�025512� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2159.0.session/cache/bdef92292b218ae60ed7bf31d9876725.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2159.0.session/cache/bdef92292b210000666�0000000�0000000�00000000127�13571573400�027252� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0161, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2159.i.0.report.json�������������0000666�0000000�0000000�00000002010�13571573400�025412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:functions": { "job": { "job_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2159.res.oracle������������������0000666�0000000�0000000�00000001302�13571573400�024602� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2159.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_2159.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_2159.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job - 1 (12..24) 1 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.0.res.oracle����������������0000666�0000000�0000000�00000001316�13571573400�024742� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 1 [...] [kernel] Parsing tests/wp_bts/bts_2471.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_foo_assert_ko : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_2471.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_2471.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo - - 1 0.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024444� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�025507� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.0.session/cache/73ea306163d25a228b4586b8b98472f6.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.0.session/cache/73ea306163d20000666�0000000�0000000�00000000106�13571573400�027077� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.1.res.oracle����������������0000666�0000000�0000000�00000001431�13571573400�024741� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 1 [...] [kernel] Parsing tests/wp_bts/bts_2471.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: native support for alt-ergo is deprecated, use why3 instead [wp] 1 goal scheduled [wp] [Alt-Ergo (Native)] Goal typed_foo_assert_ko : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_2471.1.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_2471.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo - - 1 0.0% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.2.res.oracle����������������0000666�0000000�0000000�00000001465�13571573400�024751� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/bts_2471.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: native support for coq is deprecated, use tip instead [wp] 1 goal scheduled [wp] [Coq] Goal typed_foo_assert_ko : Default tactic [wp] [Coq (Native)] Goal typed_foo_assert_ko : Unsuccess [wp] Proved goals: 0 / 1 Coq: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_bts/oracle_qualif/bts_2471.2.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/bts_2471.2.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo - - 1 0.0% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/ergo_typecheck.0.report.json���������0000666�0000000�0000000�00000005212�13571573400�026715� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } }, "wp:functions": { "f": { "f_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_inline": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_divded": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/ergo_typecheck.i.0.report.json�������0000666�0000000�0000000�00000005212�13571573400�027144� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } }, "wp:functions": { "f": { "f_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_unit0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_inline": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_var_divded": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/ergo_typecheck.res.oracle������������0000666�0000000�0000000�00000002016�13571573400�026330� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/ergo_typecheck.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 8 goals scheduled [wp] [Qed] Goal typed_f_ensures_var_divded : Valid [wp] [Qed] Goal typed_f_ensures_var_inline : Valid [wp] [Qed] Goal typed_f_ensures_var_unit0 : Valid [wp] [Qed] Goal typed_f_ensures_var_unit1 : Valid [wp] [Qed] Goal typed_f_ensures_var_unit2 : Valid [wp] [Qed] Goal typed_f_ensures_var_unit3 : Valid [wp] [Qed] Goal typed_f_ensures_var_unit4 : Valid [wp] [Qed] Goal typed_f_assigns : Valid [wp] Proved goals: 8 / 8 Qed: 8 [wp] Report in: 'tests/wp_bts/oracle_qualif/ergo_typecheck.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/ergo_typecheck.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 8 - 8 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-364.0.report.json��������������0000666�0000000�0000000�00000003106�13571573400�025364� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 7 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "wp:functions": { "main": { "main_assert_OVER": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "main_assert_ZERO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 7 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-364.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�024641� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-364.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�025704� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-364.0.session/cache/20ce0275c1526238b5f71932690ce665.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-364.0.session/cache/20ce0275c150000666�0000000�0000000�00000000127�13571573400�027207� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0224, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-364.0.session/cache/811d41ea82968315323fd1dca753edac.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-364.0.session/cache/811d41ea8290000666�0000000�0000000�00000000127�13571573400�027222� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0273, "steps": 30 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-364.i.0.report.json������������0000666�0000000�0000000�00000002751�13571573400�025620� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 2, "valid": 2, "rank": 8 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "wp:functions": { "main": { "main_assert_OVER": { "alt-ergo": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "main_assert_ZERO": { "alt-ergo": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "wp:section": { "alt-ergo": { "total": 2, "valid": 2, "rank": 8 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } } } } } �����������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-364.res.oracle�����������������0000666�0000000�0000000�00000001405�13571573400�025000� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue-364.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_main_assert_ZERO : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_assert_OVER : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue-364.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue-364.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main - 2 (28..40) 2 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-684-exit.0.report.json���������0000666�0000000�0000000�00000003077�13571573400�026347� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "wp:functions": { "inconditional_exit": { "inconditional_exit_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "inconditional_exit_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "inconditional_exit_exits": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue-684-exit.res.oracle������������0000666�0000000�0000000�00000001566�13571573400�025764� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue-684-exit.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Qed] Goal typed_inconditional_exit_ensures : Valid [wp] [Qed] Goal typed_inconditional_exit_exits : Valid [wp] [Qed] Goal typed_inconditional_exit_assigns_exit : Valid [wp] [Qed] Goal typed_inconditional_exit_assigns_normal : Valid [wp] Proved goals: 4 / 4 Qed: 4 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue-684-exit.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue-684-exit.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success inconditional_exit 4 - 4 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.0.res.oracle���������������0000666�0000000�0000000�00000001466�13571573400�025222� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_143.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ok_because_inconsistent : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ok_because_consistent : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_143.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_143.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic A - 1 (1..12) 1 100% Axiomatic B - 1 (1..12) 1 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�024716� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�025761� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.0.session/cache/38acf909585519bf444c738cb33ab2c5.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.0.session/cache/38acf9095850000666�0000000�0000000�00000000126�13571573400�027313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0099, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.0.session/cache/4125251455381bd914edf14cf4cbadb5.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.0.session/cache/412525145530000666�0000000�0000000�00000000126�13571573400�027047� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0084, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.1.res.oracle���������������0000666�0000000�0000000�00000001572�13571573400�025221� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_143.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: native support for coq is deprecated, use tip instead [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ok_because_inconsistent : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ok_because_consistent : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_143.1.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_143.1.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic A - 1 (1..12) 1 100% Axiomatic B - 1 (1..12) 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.1.session/�����������������0000777�0000000�0000000�00000000000�13571573400�024717� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.1.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�025762� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.1.session/cache/38acf909585519bf444c738cb33ab2c5.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.1.session/cache/38acf9095850000666�0000000�0000000�00000000126�13571573400�027314� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0096, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.1.session/cache/4125251455381bd914edf14cf4cbadb5.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.1.session/cache/412525145530000666�0000000�0000000�00000000126�13571573400�027050� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0094, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.2.res.oracle���������������0000666�0000000�0000000�00000001466�13571573400�025224� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_143.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ok_because_inconsistent : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ok_because_consistent : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_143.2.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_143.2.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic A - 1 (1..12) 1 100% Axiomatic B - 1 (1..12) 1 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.2.session/�����������������0000777�0000000�0000000�00000000000�13571573400�024720� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.2.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�025763� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.2.session/cache/38acf909585519bf444c738cb33ab2c5.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.2.session/cache/38acf9095850000666�0000000�0000000�00000000126�13571573400�027315� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0091, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.2.session/cache/4125251455381bd914edf14cf4cbadb5.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.2.session/cache/412525145530000666�0000000�0000000�00000000125�13571573400�027050� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.009, "steps": 4 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.3.res.oracle���������������0000666�0000000�0000000�00000002020�13571573400�025210� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_143.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: native support for coq is deprecated, use tip instead [wp] 2 goals scheduled [wp] [Coq] Goal typed_lemma_ok_because_inconsistent : Default tactic [wp] [Coq (Native)] Goal typed_lemma_ok_because_inconsistent : Failed Command './tests/inexistant-prover' not found [wp] [Coq (Native)] Goal typed_lemma_ok_because_consistent : Failed Command './tests/inexistant-prover' not found [wp] Proved goals: 0 / 2 Coq: 0 (failed: 2) [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_143.3.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_143.3.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic A - - 1 0.0% Axiomatic B - - 1 0.0% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.i.0.report.json������������0000666�0000000�0000000�00000004423�13571573400�025673� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } }, "wp:axiomatics": { "A": { "lemma_ok_because_inconsistent": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } }, "B": { "lemma_ok_because_consistent": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.i.1.report.json������������0000666�0000000�0000000�00000004423�13571573400�025674� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } }, "wp:axiomatics": { "A": { "lemma_ok_because_inconsistent": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } }, "B": { "lemma_ok_because_consistent": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.i.2.report.json������������0000666�0000000�0000000�00000004423�13571573400�025675� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } }, "wp:axiomatics": { "A": { "lemma_ok_because_inconsistent": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } }, "B": { "lemma_ok_because_consistent": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_143.i.3.report.json������������0000666�0000000�0000000�00000003002�13571573400�025666� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "coq": { "total": 2, "failed": 2 }, "wp:main": { "total": 2, "failed": 2 } }, "wp:axiomatics": { "A": { "lemma_ok_because_inconsistent": { "coq": { "total": 1, "failed": 1 }, "wp:main": { "total": 1, "failed": 1 } }, "wp:section": { "coq": { "total": 1, "failed": 1 }, "wp:main": { "total": 1, "failed": 1 } } }, "B": { "lemma_ok_because_consistent": { "coq": { "total": 1, "failed": 1 }, "wp:main": { "total": 1, "failed": 1 } }, "wp:section": { "coq": { "total": 1, "failed": 1 }, "wp:main": { "total": 1, "failed": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_198.0.report.json��������������0000666�0000000�0000000�00000002041�13571573400�025450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:axiomatics": { "": { "lemma_broken": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_198.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�024730� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_198.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�025773� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_198.0.session/cache/38c1b43d76702d5ab3baa6900ee752eb.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_198.0.session/cache/38c1b43d7670000666�0000000�0000000�00000000126�13571573400�027314� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0153, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_198.i.0.report.json������������0000666�0000000�0000000�00000001730�13571573400�025703� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:axiomatics": { "": { "lemma_broken": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } } } } } ����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_198.res.oracle�����������������0000666�0000000�0000000�00000001245�13571573400�025071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_198.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_broken : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_198.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_198.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - 1 (4..16) 1 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_447.0.report.json��������������0000666�0000000�0000000�00000001333�13571573400�025450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:axiomatics": { "": { "lemma_foo": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_447.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�024725� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_447.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�025770� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_447.0.session/cache/5d63c645e492af38b5a1d3859d7eeaa2.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_447.0.session/cache/5d63c645e490000666�0000000�0000000�00000000126�13571573400�027317� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0084, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_447.i.0.report.json������������0000666�0000000�0000000�00000001706�13571573400�025703� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:axiomatics": { "": { "lemma_foo": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } ����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_447.res.oracle�����������������0000666�0000000�0000000�00000001242�13571573400�025063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_447.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_foo : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_447.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_447.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - 1 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_453.0.report.json��������������0000666�0000000�0000000�00000004211�13571573400�025443� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } }, "wp:functions": { "f1": { "f1_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f1_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f1_ensures_Sincr": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "f2": { "f2_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f2_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f2_ensures_Sincr": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_453.i.0.report.json������������0000666�0000000�0000000�00000004211�13571573400�025672� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } }, "wp:functions": { "f1": { "f1_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f1_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f1_ensures_Sincr": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "f2": { "f2_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f2_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f2_ensures_Sincr": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_453.res.oracle�����������������0000666�0000000�0000000�00000001675�13571573400�025072� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_453.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Qed] Goal typed_f1_loop_assigns : Valid [wp] [Qed] Goal typed_f1_ensures_Sincr : Valid [wp] [Qed] Goal typed_f1_assigns : Valid [wp] [Qed] Goal typed_f2_loop_assigns : Valid [wp] [Qed] Goal typed_f2_ensures_Sincr : Valid [wp] [Qed] Goal typed_f2_assigns : Valid [wp] Proved goals: 6 / 6 Qed: 6 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_453.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_453.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f1 3 - 3 100% f2 3 - 3 100% ------------------------------------------------------------- �������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.0.report.json��������������0000666�0000000�0000000�00000005400�13571573400�025451� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 1, "unknown": 2, "rank": 3 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2, "rank": 3 } }, "wp:functions": { "f": { "f_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } }, "job_ko_fixed": { "job_ko_fixed_assert_Wrong": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "job_ko_success": { "job_ko_success_assert_Wrong": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�024727� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�025772� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.0.session/cache/7dac874a74c4862db7a2944e8c37b9ee.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.0.session/cache/7dac874a74c0000666�0000000�0000000�00000000107�13571573400�027453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.0.session/cache/8c9a5bc85b9f4470e33ef29dbe5cc4d7.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.0.session/cache/8c9a5bc85b90000666�0000000�0000000�00000000107�13571573400�027461� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.0.session/cache/ad665a340bece5a7e649ab81ad5c30ea.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.0.session/cache/ad665a340be0000666�0000000�0000000�00000000127�13571573400�027441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0208, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.i.0.report.json������������0000666�0000000�0000000�00000005020�13571573400�025676� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 3, "valid": 1, "unknown": 2, "rank": 3 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2, "rank": 3 } }, "wp:functions": { "f": { "f_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } }, "job_ko_fixed": { "job_ko_fixed_assert_Wrong": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "job_ko_success": { "job_ko_success_assert_Wrong": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_494.res.oracle�����������������0000666�0000000�0000000�00000001730�13571573400�025067� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_494.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_ko_fixed_assert_Wrong : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_job_ko_success_assert_Wrong : Unsuccess [wp] Proved goals: 1 / 3 Qed: 0 Alt-Ergo 2.0.0: 1 (unsuccess: 2) [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_494.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_494.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (8..20) 1 100% job_ko_fixed - - 1 0.0% job_ko_success - - 1 0.0% ------------------------------------------------------------- ����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_508.0.report.json��������������0000666�0000000�0000000�00000002572�13571573400�025454� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 15 } }, "wp:functions": { "add": { "add_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 15 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 15 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_508.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�024723� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_508.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�025766� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_508.0.session/cache/e8f5425a0d4716aa3cf9bb584096267c.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_508.0.session/cache/e8f5425a0d40000666�0000000�0000000�00000000127�13571573400�027364� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0386, "steps": 58 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_508.c.0.report.json������������0000666�0000000�0000000�00000002572�13571573400�025675� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 14 } }, "wp:functions": { "add": { "add_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 14 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 14 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_508.res.oracle�����������������0000666�0000000�0000000�00000001456�13571573400�025070� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_508.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_add_assigns_part1 : Valid [wp] [Qed] Goal typed_add_assigns_part2 : Valid [wp] [Qed] Goal typed_add_assigns_part3 : Valid [wp] Proved goals: 3 / 3 Qed: 2 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_508.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_508.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success add 2 1 (56..68) 3 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_715_a.0.report.json������������0000666�0000000�0000000�00000001257�13571573400�025753� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "foo": { "dummy_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_715_a.res.oracle���������������0000666�0000000�0000000�00000001513�13571573400�025362� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_715_a.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_bts/issue_715_a.i:6: Warning: No code nor implicit assigns clause for function dummy, generating default assigns from the prototype [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Qed] Goal typed_foo_call_dummy_requires : Valid [wp] Proved goals: 1 / 1 Qed: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_715_a.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_715_a.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo 1 - 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_715_b.0.report.json������������0000666�0000000�0000000�00000003002�13571573400�025742� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } }, "wp:functions": { "foo": { "dummy_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "dummy_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_715_b.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025224� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_715_b.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026267� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_715_b.0.session/cache/d16c9211a53fccb4eb65942166fe02a2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_715_b.0.session/cache/d16c9211a0000666�0000000�0000000�00000000127�13571573400�027425� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0189, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/issue_715_b.res.oracle���������������0000666�0000000�0000000�00000001651�13571573400�025366� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/issue_715_b.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_bts/issue_715_b.i:9: Warning: No code nor implicit assigns clause for function dummy, generating default assigns from the prototype [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_foo_call_dummy_requires : Valid [wp] [Qed] Goal typed_foo_call_dummy_requires_2 : Valid [wp] Proved goals: 2 / 2 Qed: 1 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_bts/oracle_qualif/issue_715_b.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/issue_715_b.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo 1 1 (8..20) 2 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/nupw-bcl-bts1120.i.0.report.json�����0000666�0000000�0000000�00000004647�13571573400�027005� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } }, "wp:functions": { "g": { "g_assigns": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "g_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_exits_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } } }, "unreachable_smt_with_contract": { "f_with_precond_requires_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "unreachable_smt_with_contract_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �����������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_bts/oracle_qualif/nupw-bcl-bts1120.res.oracle����������0000666�0000000�0000000�00000003171�13571573400�026161� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_bts/nupw-bcl-bts1120.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] [CFG] Goal unreachable_smt_with_contract_assigns : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_exits_ok : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_ensures_ok : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_requires_ok : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_assert_ok : Valid (Unreachable) [wp] [CFG] Goal unreachable_smt_with_contract_call_f_with_precond_requires_ok : Valid (Unreachable) [wp] Warning: Missing RTE guards [wp] 8 goals scheduled [wp] [Qed] Goal typed_g_exits_ok : Valid [wp] [Qed] Goal typed_g_loop_assigns : Valid [wp] [Qed] Goal typed_g_assigns_exit : Valid [wp] [Qed] Goal typed_g_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_g_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_g_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_unreachable_smt_with_contract_ensures_ok_2 : Valid [wp] [Qed] Goal typed_unreachable_smt_with_contract_call_f_with_precond_2_requires_ok : Valid [wp] Proved goals: 8 / 8 Qed: 8 [wp] Report in: 'tests/wp_bts/oracle_qualif/nupw-bcl-bts1120.0.report.json' [wp] Report out: 'tests/wp_bts/result_qualif/nupw-bcl-bts1120.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success g 6 - 6 100% unreachable_smt_with_contract 2 - 2 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/�����������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017420� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/binary-multiplication-without-overflow.c�������0000666�0000000�0000000�00000002133�13571573400�027444� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -warn-unsigned-overflow -wp-no-print -wp-rte */ /* run.config_qualif OPT: -wp-prover why3:alt-ergo -warn-unsigned-overflow -wp-prop=-lack -then -warn-unsigned-overflow -wp-rte -wp -wp-prop=-lack */ typedef unsigned uint32_t ; typedef unsigned long long uint64_t ; /*@ axiomatic mult { @ lemma sizeof_ok: ok: sizeof(uint64_t) == 2 * sizeof(uint32_t); @ lemma ax1: lack: \forall integer x, y; 0<x && 0<y ==> 0 <= 2*x*(y/2) <= x*y; @ } @ */ //@ ensures product: \result == a*b; uint64_t BinaryMultiplication (uint32_t a, uint32_t b) { //@ assert a1: ok: deductible: a*b <= 18446744073709551615; // deductible from size of C types uint64_t r=0; uint64_t x=a; if (b != 0) { /*@ loop assigns ok: r, x, b; @ loop invariant inv1: ok: r+x*b == \at(a*b, LoopEntry); @ loop invariant inv2: ok: deductible: 2*x*(b/2) <= 18446744073709551615; // deductible from inv1, ax1, a1 and x>=0, b>0, r>=0 @ loop variant ok: b ; @*/ while (1) { if (b%2) r=r+x; b=b/2; if (b==0) break; x=x*2; }; } return r; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/binary-multiplication.c������������������������0000666�0000000�0000000�00000003356�13571573400�024112� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-print -wp-rte */ /* run.config_qualif OPT: -wp-prover=why3:alt-ergo -wp-prop=-lack -wp-timeout 90 -then -wp-rte -wp -wp-prop=-lack */ // The use '-wp-prover=z3,why3:alt-ergo' gives better results. typedef unsigned uint32_t ; typedef unsigned long long uint64_t ; /*@ axiomatic mult { @ lemma sizeof_ok: ok: sizeof(uint64_t) == 2*sizeof(uint32_t); @ lemma ax1: lack: \forall integer x, y; 0<x && 0<y ==> 0 <= 2*x*(y/2) <= x*y; @ lemma ax2: lack: \forall integer x, y; (uint64_t)(x * ((uint64_t)y)) == (uint64_t)(x*y) ; @ lemma ax3: lack: \forall integer x, y; (uint64_t)(x + ((uint64_t)y)) == (uint64_t)(x+y) ; @ lemma ax4: ok: \forall integer x, y; (uint64_t)(((uint64_t)x) * y) == (uint64_t)(x*y) ; @ lemma ax5: ok: \forall integer x, y; (uint64_t)(((uint64_t)x) + y) == (uint64_t)(x+y) ; @ lemma ax7: ok: \forall integer x, y; 0<=x && 0<=y && ((y%2) > 0) ==> 2*x*(y/2) + x == x*y; @ } @ */ //@ ensures product: \result == a*b; uint64_t BinaryMultiplication (uint32_t a, uint32_t b) { //@ assert a1: ok: deductible: a*b == (uint64_t)(a*b); // deductible from size of C types uint64_t r=0; uint64_t x=a; if (b != 0) { /*@ loop assigns r, x, b; @ loop invariant inv1: ok: r+x*b == \at(a*b, LoopEntry); @ loop invariant inv2: ok: b > 0; @ loop variant ok: b ; @*/ while (1) { //@ assert a2: ok: b>1 ==> 2*x == (uint64_t)(2*x); //@ assert a3: ok: x*b == (uint64_t)(x*b); //@ assert a4: ok: ((b%2) != 0) ==> 2*x*(b/2) + x == x*b; //@ assert a5: ok: ((b%2) == 0) ==> 2*x*(b/2) == x*b; if (b%2) r=r+x; //@ assert a6: lack: ok_z3: r+2*x*(b/2) == \at(a*b, Pre); b=b/2; if (b==0) break; x=x*2; }; } return r; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/frama_c_exo1_solved.c��������������������������0000666�0000000�0000000�00000001725�13571573400�023471� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-print -wp-rte */ /* run.config_qualif OPT: -then -wp-rte -wp */ /* ************/ /* Solution de TP donné par Julien à L'IFIPS */ /* ************/ /* Questions: 1. Informellement, que calcule cette fonction? 2. Donner une spécification en ACSL de cette fonction. 3. Prouver cette fonction avec WP et Alt-Ergo. La preuve doit inclure la terminaison et l'absence d'erreur à l'exécution. */ /*@ requires len > 0; @ requires \valid(a+(0..len-1)); @ ensures 0 <= \result < len; @ ensures \forall integer i; 0 <= i < len ==> a[i] <= a[\result]; @ assigns \nothing; */ int exo1(int *a, int len) { int i = 0, j = len - 1; /*@ loop invariant 0 <= i <= j < len; @ loop invariant @ \forall integer k; @ (0 <= k < i || j < k < len) @ ==> (a[k] <= a[i] || a[k] <= a[j]); @ loop assigns i, j; @ loop variant j - i; */ while (i < j) if (a[i] <= a[j]) i++; else j--; return i; } �������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/frama_c_exo2_solved.c��������������������������0000666�0000000�0000000�00000006750�13571573400�023475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-print -wp-rte -no-warn-signed-overflow */ /* run.config_qualif OPT: -then -wp-rte -no-warn-signed-overflow -wp */ // note: exo hors vérification de l'absence de débordements /* ************/ /* Solution de TP donné par Julien à L'IFIPS */ /* ************/ /* Un sous-tableau [b] d'un tableau [a] est un sous-ensemble d'éléments contigüs de [a]. Par exemple, si a = { 0, 3, -1, 4 }, des sous-tableaux possibles sont {}, { 0 }, { 3, -1 }, { 0, 3, -1, 4 }. Un sous-tableau de [a] est dit maximal si la somme de ses éléments est au moins aussi grande que celle de n'importe quel autre sous-tableau de [a]. L'unique sous-tableau maximal de l'exemple précédent est { 3, -1, 4 }. Les sous-tableaux de taille 0 étant autorisés, un tableau avec uniquement des valeurs négatives a une somme maximale de 0. La fonction [max_subarray(a, len)] retourne la somme d'un sous-tableau maximal de [a], [len] étant la longueur de [a]. */ /* Questions: 1. Donner une spécification en ACSL de cette fonction. Vous pouvez vous aider de la fonction logique [sum(int *a, integer low, integer high, integer len)] calculant la somme des éléments entre les indices [low] et [high] (inclus) d'un tableau [a] de longueur [len] et dont une version axiomatisée est fournie. 2. Modifier le programme de manière à ajouter 3 variables ghosts [cur_low], [low] et [high] calculant respectivement: - l'indice minimum du sous-tableau duquel on est en train de calculer la somme courante [cur]; - l'indice minimum du sous-tableau maximal courant; - l'indice maximum du sous-tableau maximal courant; 3. Prouver cette fonction avec WP et Alt-Ergo. Prouver la terminaison et l'absence d'accès mémoire indéfini, mais pas l'absence de débordements arithmétiques. Les options à fournir à Frama-C pour cela sont, dans cet ordre: -rte -no-warn-signed-overflow -then -wp */ /*@ axiomatic Sum { logic integer sum(int *a, integer low, integer high, integer len) reads a[low..high]; axiom base: \forall integer low, high,len; \forall int *a; low > high ==> sum(a, low, high, len) == 0; axiom ind: \forall integer low, high,len; \forall int *a; 0 <= low <= high < len ==> sum(a, low, high, len) == a[high] + sum(a, low, high-1, len); } */ /*@ requires len >= 0; @ requires \valid(a+(0..len-1)); @ ensures \forall integer l, h; @ 0 <= l <= h <= len ==> sum(a,l,h-1,len) <= \result; @ ensures \exists integer l, h; @ 0 <= l <= h <= len && sum(a,l,h-1,len) == \result; @ assigns \nothing; @ */ int max_subarray(int *a, int len) { int max = 0; int cur = 0; /*@ ghost int cur_low = 0, low = 0, high = 0; */ /*@ loop invariant 0 <= i <= len; @ loop invariant 0 <= low <= high <= i; @ loop invariant 0 <= cur_low <= i; @ @ loop invariant cur <= max; @ loop invariant cur == sum(a,cur_low,i-1,len); @ loop invariant max == sum(a,low,high-1,len); @ @ loop invariant \forall integer l; @ 0 <= l <= i ==> sum(a,l,i-1,len) <= cur; @ @ loop invariant \forall integer l, h; @ 0 <= l <= h <= i <= len ==> sum(a,l,h-1,len) <= max; @ @ loop assigns i, cur, max, cur_low, low, high; @ loop variant len - i; */ for(int i = 0; i < len; i++) { cur = a[i] + cur; if (cur < 0) { cur = 0; /*@ ghost cur_low = i+1; */ } if (cur > max) { max = cur; /*@ ghost low = cur_low; */ /*@ ghost high = i+1; */ } } return max; } ������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/frama_c_exo3_solved.old.c����������������������0000666�0000000�0000000�00000007756�13571573400�024262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Typed+Ref -wp-no-print -wp-rte */ /* run.config_qualif OPT: -wp-model Typed+Ref -then -wp-rte -wp */ /* ************/ /* Solution d'une proposition TP donné par Julien à L'IFIPS */ /* ************/ #define BOUND 100 /* La fonction [equal_elements(a, v1, v2)] prends en entrée un tableau [a] de longueur [BOUND+2] avec [BOUND >= 2] ne contenant que des valeurs entre [0] et [BOUND-1] et contenant aussi au moins deux valeurs différentes apparaissent deux fois (il contient donc au moins deux couples de valeurs égales). La fonction cherche ces deux valeurs et les stocke dans [v1] et [v2]. */ /* Questions: 1. Remplacer le corps du prédicat [appear_twice(int *a, integer len, integer v)] qui prend un tableau [a] de longueur [len] et une valeur [v] de façon à ce qu'il soit valide si et seulement si [v] apparaît au moins deux fois dans [a]. Afin de faciliter la tâche ultérieure d'Alt-Ergo (question 3), on veillera à faire en sorte de limiter au maximum la portée des quantificateurs. Ainsi, on préférera par exemple écrire \forall integer i; i == 0 ==> \exists integer j; i == j; plutôt que \forall integer i; \exists integer j; i == 0 ==> i == j; 2. Donner une spécification en ACSL de la fonction [equal_elements]. 3. Prouver cette fonction en utilisant le WP avec le modèle Typed+ref et Alt-Ergo. La preuve doit inclure la terminaison et l'absence d'erreur à l'exécution. Pour activer le modèle Typed+ref directement à partir de la ligne de commandes (plutôt que dans la GUI), vous pouvez fournir l'option -wp-model Typed+ref à Frama-C. Les deux assertions dans le code doivent également être prouvées. Elles facilitent la tâche d'Alt-Ergo (et peuvent vous permettre de mieux comprendre l'algorithme). */ /*@ predicate appear_twice(int *a, integer len, integer v) = \exists integer i; 0 <= i < len && a[i] == v && \exists integer j; 0 <= j < len && a[j] == v && i != j; */ /*@ requires BOUND >= 2; @ requires \valid(v1); @ requires \valid(v2); @ requires \valid(a+(0.. BOUND+1)); @ requires \forall integer i; 0 <= i < BOUND+2 ==> 0 <= a[i] < BOUND; @ requires \exists integer v1, v2; @ appear_twice(a, BOUND+2, v1) && appear_twice(a, BOUND+2, v2) && v1 != v2; @ ensures appear_twice(a, BOUND+2, *v1); @ ensures appear_twice(a, BOUND+2, *v2); @ ensures *v1 != *v2; @ assigns *v1, *v2; @ */ void equal_elements(int *a, int *v1, int *v2) { char seen[BOUND]; *v1 = -1; *v2 = -1; /*@ loop invariant 0 <= i <= BOUND; @ loop invariant \forall integer j; 0 <= j < i ==> seen[j] == 0; @ @ loop assigns i, seen[0.. BOUND-1]; @ loop variant BOUND-i; */ for(int i = 0; i < BOUND; i++) seen[i] = 0; /*@ loop invariant 0 <= i <= BOUND+2; @ loop invariant *v1 == -1 ==> *v2 == -1; @ loop invariant *v1 != -1 ==> appear_twice(a, i, *v1); @ loop invariant *v2 != -1 ==> appear_twice(a, i, *v2) && *v1 != *v2; @ loop invariant *v1 != -1 ==> *v1 != *v2; @ loop invariant @ \forall integer v; 0 <= v < BOUND ==> seen[v] @ ==> \exists integer j; 0 <= j < i && a[j] == v; @ loop invariant @ \forall integer v; 0 <= v < BOUND ==> ! seen[v] @ ==> \forall integer j; 0 <= j < i ==> a[j] != v; @ loop invariant @ *v2 == -1 ==> @ \forall integer v; 0 <= v < BOUND ==> @ v != *v1 ==> ! appear_twice(a, i, v); @ loop assigns i, seen[0.. BOUND-1], *v1, *v2; @ loop variant BOUND+2-i; */ for(int i = 0; i < BOUND+2; i++) { int v = a[i]; if (seen[v]) { if (*v1 == -1) *v1 = v; else if (*v2 == -1 && v != *v1) *v2 = v; /*@ assert @ *v2 == -1 ==> @ \forall integer w; ! appear_twice(a, i, w) ==> w != *v1 @ ==> ! appear_twice(a, i+1, w); */ } else { seen[v] = 1; /*@ assert @ *v2 == -1 ==> @ \forall integer w; ! appear_twice(a, i, w) ==> w != *v1 @ ==> ! appear_twice(a, i+1, w); */ } } } ������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/frama_c_exo3_solved.old.v2.c�������������������0000666�0000000�0000000�00000006404�13571573400�024575� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Typed+Ref -wp-no-print -wp-rte */ /* run.config_qualif OPT: -wp-model Typed+Ref -then -wp-rte -wp */ /* ************/ /* Autre solution d'une proposition de TP donné par Julien à L'IFIPS */ /* ************/ #define BOUND 100 /* La fonction [equal_elements(a, v1, v2)] prends en entrée un tableau [a] de longueur [BOUND+2] avec [BOUND >= 2] ne contenant que des valeurs entre [0] et [BOUND-1] et contenant aussi au moins deux valeurs différentes apparaissent deux fois (il contient donc au moins deux couples de valeurs égales). La fonction cherche ces deux valeurs et les stocke dans [v1] et [v2]. */ /* Cette version des spécifications utilise la notion du nombre d'occurence */ /*@ axiomatic Occurence { logic integer occ(int *a, integer low, integer high, integer v) reads a[low..high-1]; axiom base: \forall integer low, high, v; \forall int *a; low >= high ==> occ(a, low, high, v) == 0; axiom ind1: \forall integer low, high, v; \forall int *a; low < high ==> a[high-1] == v ==> occ(a, low, high, v) == 1 + occ(a, low, high-1, v); axiom ind2: \forall integer low, high, v; \forall int *a; low < high ==> a[high-1] != v ==> occ(a, low, high, v) == occ(a, low, high-1, v); } */ /*@ requires BOUND >= 2; @ requires \valid(v1); @ requires \valid(v2); @ requires \valid(a+(0.. BOUND+1)); @ requires \forall integer i; 0 <= i < BOUND+2 ==> 0 <= a[i] < BOUND; @ requires \exists integer v1, v2; 0 <= v1 < BOUND && 0 <= v2 < BOUND && 2 <= occ(a,0,BOUND+2,v1) && 2 <= occ(a,0,BOUND+2,v2) && v1 != v2; @ ensures v1_good: 2 <= occ(a,0,BOUND+2,*v1); @ ensures v2_good: 2 <= occ(a,0,BOUND+2,*v2); @ ensures v1_v2_diff: *v1 != *v2; @ assigns *v1, *v2; @ */ void equal_elements(int *a, int *v1, int *v2) { char seen[BOUND]; *v1 = -1; *v2 = -1; /*@ loop invariant 0 <= i <= BOUND; @ loop invariant set_at_0: \forall integer j; 0 <= j < i ==> 0 == seen[j]; @ @ loop assigns i, seen[0.. BOUND-1]; @ loop variant BOUND-i; */ for(int i = 0; i < BOUND; i++){ ICI: seen[i] = 0; /*@ assert set_at_1: \forall integer j; i != j ==> \at(seen[j],ICI) == seen[j]; @*/ } /*@ loop invariant bound: 0 <= i <= BOUND+2; @ loop invariant v1_first: *v1 == -1 ==> *v2 == -1; @ loop invariant v1_sound1: *v1 != -1 ==> 2 <= occ(a,0,i,*v1); @ loop invariant v2_sound1: *v2 != -1 ==> 2 <= occ(a,0,i,*v2) && *v1 != *v2; @ loop invariant v1_v2_diff: *v1 != -1 ==> *v1 != *v2; @ loop invariant seen_sound1: @ \forall integer v; 0 <= v < BOUND ==> seen[v] @ ==> 0 < occ(a,0,i,v); @ loop invariant seen_sound2: @ \forall integer v; 0 <= v < BOUND ==> ! seen[v] @ ==> 0 == occ(a,0,i,v); @ loop invariant v1_sound2: @ *v1 == -1 ==> @ \forall integer v; 0 <= v < BOUND ==> occ(a,0,i,v) < 2; @ loop invariant v2_sound2: @ *v2 == -1 ==> @ \forall integer v; 0 <= v < BOUND ==> v != *v1 ==> occ(a,0,i,v) < 2; @ loop assigns i, seen[0.. BOUND-1], *v1, *v2; @ loop variant BOUND+2-i; */ for(int i = 0; i < BOUND+2; i++) { int v = a[i]; if (seen[v]) { if (*v1 == -1) *v1 = v; else if (*v2 == -1 && v != *v1) *v2 = v; } else { seen[v] = 1; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/frama_c_exo3_solved.simplified.c���������������0000666�0000000�0000000�00000004436�13571573400�025621� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-print -wp-rte */ /* run.config_qualif OPT: -then -wp-rte -wp */ /* ************/ /* Solution de TP donné par Julien à L'IFIPS */ /* ************/ #define BOUND 100 /* La fonction [pair(a, len)] prend en entrée un tableau [a] de longueur [len] ne contenant que des valeurs entre 0 et [BOUND-1] (inclus) et retourne [-1] si [a] ne contient pas deux éléments de même valeur et retourne un des indices correspondant à une valeur en double sinon. */ /* Questions: 1. Définir un prédicat [has_pair(a, len)] qui est valide si et seulement s'il existe (au moins) deux éléments du tableau [a] de longueur [len] qui sont égaux. 2. En utilisant des comportements (behaviors), donner une spécification en ACSL de la fonction [pair]. 3. Prouver cette fonction en utilisant le WP et Alt-Ergo. La preuve doit inclure la terminaison et l'absence d'erreur à l'exécution. */ /*@ predicate has_pair(int *a, integer len) = \exists integer i, j; 0 <= i < j < len && a[i] == a[j]; */ /*@ requires len >= 0; @ requires \valid(a+(0.. len-1)); @ requires \forall integer i; 0 <= i < len ==> 0 <= a[i] < BOUND; @ assigns \nothing; @ @ behavior no_pair: @ assumes ! has_pair(a, len); @ ensures \result == -1; @ @ behavior has_pair: @ assumes has_pair(a, len); @ ensures \exists integer i; @ 0 <= i < len && i != \result && a[\result] == a[i]; @ @ complete behaviors; @ disjoint behaviors; @ */ int pair(int *a, int len) { char seen[BOUND]; /*@ loop invariant 0 <= i <= BOUND; @ loop invariant \forall integer j; 0 <= j < i ==> seen[j] == 0; @ @ loop assigns i, seen[0.. BOUND-1]; @ loop variant BOUND-i; */ for(int i = 0; i < BOUND; i++) seen[i] = 0; /*@ loop invariant 0 <= i <= len; @ @ loop invariant @ \forall integer v; 0 <= v < BOUND ==> seen[v] @ ==> \exists integer j; 0 <= j < i && a[j] == v; @ @ loop invariant @ \forall integer v; 0 <= v < BOUND ==> ! seen[v] @ ==> \forall integer j; 0 <= j < i ==> a[j] != v; @ @ loop invariant !has_pair(a, i); @ @ loop assigns i, seen[0.. BOUND-1]; @ loop variant len-i; */ for(int i = 0; i < len; i++) { int v = a[i]; if (seen[v]) return i; else seen[v] = 1; } return -1; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/frama_c_hashtbl_solved.c�����������������������0000666�0000000�0000000�00000025020�13571573400�024234� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-print -wp-rte */ /* run.config_qualif OPT: -wp-prop=-left_unproved -then -wp-rte -wp -wp-prop=-left_unproved */ /* ******************************* */ /* Solution de TP donné par Julien */ /* ******************************* */ /* -------------------------------------------------------------------------- */ /* Ce fichier fournit une petite librairie de tables de hachage simplifiées: elles ne sont pas dynamiques et, en particulier, pas redimensionnables. Votre but est: 1. écrire la spécification ACSL des fonctions fournies à partir de leurs spécifications informelles (mais pas du code...) 2. prouver que chaque fonction satisfait la spécification écrite en 1. 3. prouver l'absence d'erreurs à l'exécution via l'option -wp-rte. */ /* -------------------------------------------------------------------------- */ #include <limits.h> /* -------------------------------------------------------------------------- */ /* Chaines de caractères simplifiées: toutes les chaînes de caractères de ce fichier seront supposées de longueurs STRING_LEN. La fonction [eq_string] est fournie avec sa spécification formelle déjà prouvée. Vous n'avez donc rien à faire pour cette fonction \o/. Astuce: le prédicat [EqString] peut éventuellement être utile... */ /* -------------------------------------------------------------------------- */ #define STRING_LEN 20 /*@ predicate EqString(char *s1, char *s2) = @ \forall integer i; 0 <= i < STRING_LEN ==> s1[i] == s2[i]; @ */ /*@ requires \valid_read(s1 + (0 .. STRING_LEN - 1)); @ requires \valid_read(s2 + (0 .. STRING_LEN - 1)); @ assigns \nothing; @ @ behavior eq: @ assumes EqString(s1, s2); @ ensures \result == 1; @ @ behavior not_eq: @ assumes ! EqString(s1, s2); @ ensures \result == 0; @ @ complete behaviors; @ disjoint behaviors; @ */ int eq_string(const char *s1, const char *s2) { int i; /*@ loop invariant 0 <= i <= STRING_LEN; @ loop invariant \forall integer j; 0 <= j < i ==> s1[j] == s2[j]; @ loop assigns i; @ loop variant STRING_LEN - i; @*/ for(i = 0; i < STRING_LEN; i++) if (s1[i] != s2[i]) return 0; return 1; } /* -------------------------------------------------------------------------- */ /* Structures de données. Les tables de hachage associent ici des clés sous forme de chaînes de caractères à des valeurs entières. Une fonction de hachage sur les chaînes de caractères vous est fournie. Les tables de hachage sont représentées par leur nombre d'éléments et un tableau de "buckets" de longueur HASHTBL_LEN. Les "buckets" sont eux-même des tableaux de couples (clé, valeur) (individuellement appelé "bucket") dont toutes les clés ont le même haché. Chaque tableau est de longueur fixe, BUCKET_LEN, mais le nombre d'éléments stockés dans celui-ci peut varier. */ /* -------------------------------------------------------------------------- */ #define BUCKET_LEN 10 #define HASHTBL_LEN 17 typedef struct { char *key; // clé, sous forme de chaînes de caractères (simplifiées) int value; // valeur associée à la clé } Bucket; typedef struct { Bucket buckets[BUCKET_LEN]; // tableau de couples (clé, valeur) int size; // nombre d'éléments stockés dans le tableau } Buckets; typedef struct { Buckets data[HASHTBL_LEN]; // tableau de buckets int size; // nombre d'éléments stockés dans la table de hachage } Hashtbl; /* -------------------------------------------------------------------------- */ /* Fonction de hachage fournie: vous n'avez là non plus rien à faire \o/. La postcondition de la fonction [hash] ne peut pas être prouvée sans donner une définition à la fonction logique [Hash]. Ce travail n'est pas demandé ici et cette postcondition restera donc toujours non prouvée. Ce devrait être la seule... Astuce: la fonction logique [HashIndex] de l'axiomatique [Hash] n'est pas donnée que pour faire jolie. Vous avez aussi le droit d'ajouter vos propres définitions de prédicats et de fonctions... */ /* -------------------------------------------------------------------------- */ /*@ axiomatic Hash { @ logic unsigned long Hash(char *s) reads(s + (0 .. )); @ // [Hash] est un modèle abstrait de la fonction de hash codée en C @ // ci-dessous @ @ logic integer HashIndex(Hashtbl *tbl, char *k) = Hash(k) % HASHTBL_LEN; @ } */ /*@ requires \valid_read(s + (0 .. STRING_LEN - 1)); @ assigns \nothing; @ ensures left_unproved: \result == Hash(s); @ */ unsigned long hash(const char *s) { unsigned long h = 5381; int i; /*@ loop invariant 0 <= i <= STRING_LEN; @ loop assigns h, i; @ loop variant STRING_LEN - i; */ for(i = 0; i < STRING_LEN; i++) { if (s[i]) break; h = ((h << 5) + h) + s[i]; } return h; } /* -------------------------------------------------------------------------- */ /* Fonctions logiques et prédicats additionnels utiles. */ /* -------------------------------------------------------------------------- */ /*@ @ predicate valid_tbl(Hashtbl *tbl) = @ \valid(tbl->data+(0 .. HASHTBL_LEN - 1)); @ @ predicate valid_buckets(Hashtbl *tbl) = @ \forall integer i; @ 0 <= i < HASHTBL_LEN ==> @ \valid(tbl->data[i].buckets + (0 .. BUCKET_LEN - 1)); @ @ predicate valid_read_keys(Hashtbl *tbl) = @ \forall integer i, j; @ 0 <= i < HASHTBL_LEN ==> @ 0 <= j < tbl->data[i].size ==> @ \valid_read(tbl->data[i].buckets[j].key + (0 .. STRING_LEN - 1)); @ @ logic integer buckets_size(Hashtbl *tbl, char *k) = @ tbl->data[HashIndex(tbl, k)].size; @ @ logic Bucket bucket(Hashtbl *tbl, char *k, integer i) = @ tbl->data[HashIndex(tbl, k)].buckets[i]; @ @ */ /* -------------------------------------------------------------------------- */ /* Exercice 0 (échauffement): La fonction [size] retourne le nombre d'éléments d'une table. */ /* -------------------------------------------------------------------------- */ /*@ requires \valid(tbl); @ assigns \nothing; @ ensures \result == tbl->size; @ */ int size(const Hashtbl *tbl) { return tbl->size; } /* -------------------------------------------------------------------------- */ /* Exercice 1: La fonction [init] initialise une table de hachage contenant 0 élément. En particulier, chaque buckets contient 0 élément. */ /* -------------------------------------------------------------------------- */ /*@ requires \valid(tbl); @ requires valid_tbl(tbl); @ assigns tbl->size, tbl->data[0 .. HASHTBL_LEN - 1]; @ ensures tbl->size == 0; @ ensures \forall integer i; 0 <= i < HASHTBL_LEN ==> tbl->data[i].size == 0; @ */ void init(Hashtbl *tbl){ int i; tbl->size = 0; /*@ loop invariant 0 <= i <= HASHTBL_LEN; @ loop invariant \forall integer k; 0 <= k < i ==> tbl->data[k].size == 0; @ loop assigns i, tbl->data[0 .. HASHTBL_LEN - 1].size; @ loop variant HASHTBL_LEN - i; @ */ for(i = 0; i < HASHTBL_LEN; i++) tbl->data[i].size = 0; } /* -------------------------------------------------------------------------- */ /* Exercice 2: La fonction [add] ajouter un couple (clé, valeur) dans la table de hachage s'il y a suffisamment de places. Si tel est le cas, elle retourne 0. S'il n'y a pas suffisamment de places, la fonction ne fait rien et retourne -1. Conseil: lorsque la table est modifiée, bien penser à spécifier les nouvelles tailles et l'emplacement du couple ajouté. */ /* -------------------------------------------------------------------------- */ /*@ requires \valid(tbl); @ requires valid_tbl(tbl); @ requires valid_buckets(tbl); @ requires \valid_read(k + (0 .. STRING_LEN - 1)); @ requires 0 <= tbl->size < INT_MAX; @ requires \forall integer i; @ 0 <= i < HASHTBL_LEN ==> @ 0 <= tbl->data[i].size <= BUCKET_LEN; @ @ assigns tbl->data[HashIndex(tbl, k)], tbl->size; @ @ behavior nominal: @ assumes buckets_size(tbl, k) < BUCKET_LEN; @ assigns tbl->data[HashIndex(tbl, k)], tbl->size; @ ensures \result == 0; @ ensures tbl->size == \old(tbl->size) + 1; @ ensures buckets_size(tbl, k) == buckets_size{Old}(tbl, k) + 1; @ ensures bucket(tbl, k, buckets_size{Old}(tbl, k)).key == k; @ ensures bucket(tbl, k, buckets_size{Old}(tbl, k)).value == d; @ behavior full: @ assumes buckets_size(tbl, k) == BUCKET_LEN; @ assigns \nothing; @ ensures \result == -1; @ @ complete behaviors; @ disjoint behaviors; @ */ int add(Hashtbl *tbl, char *k, int d) { Bucket new_entry; unsigned int h = hash(k) % HASHTBL_LEN; if (tbl->data[h].size >= BUCKET_LEN) return -1; new_entry.key = k; new_entry.value = d; tbl->data[h].buckets[tbl->data[h].size] = new_entry; tbl->data[h].size++; tbl->size++; return 0; } /* -------------------------------------------------------------------------- */ /* Exercice 3: La fonction [mem_binding] retourne 1 si le couple (clé, valeur) [k, v] donné en entrée est présent dans la table de hachage. Elle retourne 0 sinon. */ /* -------------------------------------------------------------------------- */ /*@ requires \valid(tbl); @ requires valid_tbl(tbl); @ requires valid_buckets(tbl); @ requires valid_read_keys(tbl); @ requires \valid_read(k + (0 .. STRING_LEN - 1)); @ requires \forall integer i; @ 0 <= i < HASHTBL_LEN ==> @ 0 <= tbl->data[i].size < BUCKET_LEN; @ @ assigns \nothing; @ @ behavior found: @ assumes \exists integer i; 0 <= i < buckets_size(tbl, k) && @ EqString(k, bucket(tbl, k, i).key) && v == bucket(tbl, k, i).value; @ ensures \result == 1; @ @ behavior not_found: @ assumes \forall integer i; 0 <= i < buckets_size(tbl, k) ==> @ (! EqString(k, bucket(tbl, k, i).key) @ || tbl->data[HashIndex(tbl, k)].buckets[i].value != v); @ // note: Alt-Ergo does not manage to prove it if written @ // bucket(tbl, k, i).value != v @ // so disappointing :-( @ ensures \result == 0; @ @ complete behaviors; @ disjoint behaviors; @ */ int mem_binding(const Hashtbl *tbl, const char *k, int v) { int i, h = hash(k) % HASHTBL_LEN; /*@ loop invariant 0 <= i <= tbl->data[h].size; @ loop invariant \forall integer j; 0 <= j < i ==> @ (! EqString(k, tbl->data[h].buckets[j].key) @ || tbl->data[h].buckets[j].value != v); @ loop assigns i; @ loop variant tbl->data[h].size - i; @ */ for(i = 0; i < tbl->data[h].size; i++) { if (eq_string(k, tbl->data[h].buckets[i].key) && tbl->data[h].buckets[i].value == v) return 1; } return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/loop-statement.c�������������������������������0000666�0000000�0000000�00000003631�13571573400�022542� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-print */ /* run.config_qualif OPT: */ typedef char Te; // type for loop inputs typedef int Ts; // type for loop outputs /*@ axiomatic Ts_list { @ logic \list<Ts> empty_Ts_list = \Nil; @ logic \list<Ts> add2_Ts_tail(\list<Ts> x, Ts b) = \concat(x, \Cons(b, empty_Ts_list)); @ } */ /*@ axiomatic Ploop { @ predicate Pcond( Te e, Ts a ) reads \nothing; @ predicate Pbody( Te e, Ts a, Ts b ) reads \nothing; @ predicate Piter( Te e, Ts a, Ts b ) = Pbody(e,a,b) && Pcond(e,a); @ predicate Pinv( \list<Ts> x, Te e, Ts i, Ts a ) = 0 < \length(x) && i == \nth(x, 0) && a == \nth(x, \length(x)-1) && \forall integer k ; 0 <= k < \length(x)-1 ==> Piter(e, \nth(x, k), \nth(x, k+1) ); @ predicate Pinduc( Te e, Ts a, Ts b ) = \forall Ts i, \list<Ts> x ; Pinv(x, e, i, a) ==> Pinv( add2_Ts_tail(x,b), e, i, b ); @ lemma Lb: \forall Te e, Ts a, b ; Piter(e, a, b) ==> Pinduc( e, a, b ); @ predicate Ploop( Te e, Ts i, Ts b ) = \exists \list<Ts> x ; Pinv( x, e, i, b ) ; @ } */ /*@ assigns \nothing; @*/ void nop(void); Ts G; // Loop outputs /*@ assigns \nothing; @ ensures Cond: \result != 0 <==> Pcond( e, G ); @*/ int cond(Te e); /*@ assigns G; @ ensures Body: Pbody( e, \old(G), G ); @*/ void body(Te e); /*@ assigns G; @ ensures Scond: !Pcond( e, G ); @ ensures Sloop: Ploop( e, \old( G ), G ); @*/ void loop_statement(Te e) { /*@ requires Rinv: Pinv(add2_Ts_tail(empty_Ts_list,G), e, G, G); @ assigns G; @ ensures Scond: !Pcond(e, G ); @ ensures Sloop: Ploop(e, \old( G ), G ) ; @*/ /*@ loop assigns G; @ loop invariant Iloop: Ploop(e, \at( G, LoopEntry ), G ); @*/ while (cond(e)) /*@ requires Scond: Pcond( e, G ); @ assigns G ; @ ensures Sbody: Pbody( e, \old(G), G ); @*/ body(e); } �������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/����������������������������������������0000777�0000000�0000000�00000000000�13571573400�020665� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000156�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/binary-multiplication-without-overflow.res.oracle�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/binary-multiplication-without-overflow.r0000666�0000000�0000000�00000002517�13571573400�030736� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -warn-unsigned-overflow [...] [kernel] Parsing tests/wp_gallery/binary-multiplication-without-overflow.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function BinaryMultiplication [wp] Goal typed_lemma_ax1_lack : not tried [wp] Goal typed_lemma_sizeof_ok_ok : trivial [wp] Goal typed_BinaryMultiplication_ensures_product : not tried [wp] Goal typed_BinaryMultiplication_assert_a1_ok_deductible : not tried [wp] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_preserved : not tried [wp] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_established : not tried [wp] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_deductible_preserved : not tried [wp] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_deductible_established : not tried [wp] Goal typed_BinaryMultiplication_assert_rte_unsigned_overflow : not tried [wp] Goal typed_BinaryMultiplication_assert_rte_unsigned_overflow_2 : not tried [wp] Goal typed_BinaryMultiplication_assert_rte_unsigned_overflow_3 : not tried [wp] Goal typed_BinaryMultiplication_assert_rte_unsigned_overflow_4 : not tried [wp] Goal typed_BinaryMultiplication_loop_assigns : trivial [wp] Goal typed_BinaryMultiplication_loop_variant_decrease : not tried [wp] Goal typed_BinaryMultiplication_loop_variant_positive : not tried ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/binary-multiplication.res.oracle��������0000666�0000000�0000000�00000002741�13571573400�027167� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_gallery/binary-multiplication.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function BinaryMultiplication [wp] Goal typed_lemma_ax1_lack : not tried [wp] Goal typed_lemma_ax2_lack : not tried [wp] Goal typed_lemma_ax3_lack : not tried [wp] Goal typed_lemma_ax4_ok : not tried [wp] Goal typed_lemma_ax5_ok : not tried [wp] Goal typed_lemma_ax7_ok : not tried [wp] Goal typed_lemma_sizeof_ok_ok : trivial [wp] Goal typed_BinaryMultiplication_ensures_product : not tried [wp] Goal typed_BinaryMultiplication_assert_a1_ok_deductible : not tried [wp] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_preserved : not tried [wp] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_established : not tried [wp] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_preserved : not tried [wp] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_established : not tried [wp] Goal typed_BinaryMultiplication_assert_a2_ok : not tried [wp] Goal typed_BinaryMultiplication_assert_a3_ok : not tried [wp] Goal typed_BinaryMultiplication_assert_a4_ok : not tried [wp] Goal typed_BinaryMultiplication_assert_a5_ok : not tried [wp] Goal typed_BinaryMultiplication_assert_a6_lack_ok_z3 : not tried [wp] Goal typed_BinaryMultiplication_loop_assigns : trivial [wp] Goal typed_BinaryMultiplication_loop_variant_decrease : not tried [wp] Goal typed_BinaryMultiplication_loop_variant_positive : not tried �������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/frama_c_exo1_solved.res.oracle����������0000666�0000000�0000000�00000001767�13571573400�026557� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_gallery/frama_c_exo1_solved.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function exo1 [wp] Goal typed_exo1_ensures : not tried [wp] Goal typed_exo1_ensures_2 : not tried [wp] Goal typed_exo1_assert_rte_signed_overflow : not tried [wp] Goal typed_exo1_loop_invariant_preserved : not tried [wp] Goal typed_exo1_loop_invariant_established : not tried [wp] Goal typed_exo1_loop_invariant_2_preserved : not tried [wp] Goal typed_exo1_loop_invariant_2_established : not tried [wp] Goal typed_exo1_assert_rte_mem_access : not tried [wp] Goal typed_exo1_assert_rte_mem_access_2 : not tried [wp] Goal typed_exo1_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_exo1_assert_rte_signed_overflow_3 : not tried [wp] Goal typed_exo1_loop_assigns : trivial [wp] Goal typed_exo1_assigns : not tried [wp] Goal typed_exo1_loop_variant_decrease : not tried [wp] Goal typed_exo1_loop_variant_positive : not tried ���������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/frama_c_exo2_solved.res.oracle����������0000666�0000000�0000000�00000003273�13571573400�026552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -no-warn-signed-overflow [...] [kernel] Parsing tests/wp_gallery/frama_c_exo2_solved.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function max_subarray [wp] Goal typed_max_subarray_ensures : not tried [wp] Goal typed_max_subarray_ensures_2 : not tried [wp] Goal typed_max_subarray_loop_invariant_preserved : not tried [wp] Goal typed_max_subarray_loop_invariant_established : not tried [wp] Goal typed_max_subarray_loop_invariant_2_preserved : not tried [wp] Goal typed_max_subarray_loop_invariant_2_established : not tried [wp] Goal typed_max_subarray_loop_invariant_3_preserved : not tried [wp] Goal typed_max_subarray_loop_invariant_3_established : not tried [wp] Goal typed_max_subarray_loop_invariant_4_preserved : not tried [wp] Goal typed_max_subarray_loop_invariant_4_established : not tried [wp] Goal typed_max_subarray_loop_invariant_5_preserved : not tried [wp] Goal typed_max_subarray_loop_invariant_5_established : not tried [wp] Goal typed_max_subarray_loop_invariant_6_preserved : not tried [wp] Goal typed_max_subarray_loop_invariant_6_established : not tried [wp] Goal typed_max_subarray_loop_invariant_7_preserved : not tried [wp] Goal typed_max_subarray_loop_invariant_7_established : not tried [wp] Goal typed_max_subarray_loop_invariant_8_preserved : not tried [wp] Goal typed_max_subarray_loop_invariant_8_established : not tried [wp] Goal typed_max_subarray_assert_rte_mem_access : not tried [wp] Goal typed_max_subarray_loop_assigns : trivial [wp] Goal typed_max_subarray_assigns : not tried [wp] Goal typed_max_subarray_loop_variant_decrease : not tried [wp] Goal typed_max_subarray_loop_variant_positive : not tried �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/frama_c_exo3_solved.old.res.oracle������0000666�0000000�0000000�00000007607�13571573400�027335� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_gallery/frama_c_exo3_solved.old.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function equal_elements [wp] Goal typed_ref_equal_elements_ensures : not tried [wp] Goal typed_ref_equal_elements_ensures_2 : not tried [wp] Goal typed_ref_equal_elements_ensures_3 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_mem_access : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_2 : trivial [wp] Goal typed_ref_equal_elements_loop_invariant_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_2_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_2_established : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_2 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_signed_overflow : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_3_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_3_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_4_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_4_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_5_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_5_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_6_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_6_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_7_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_7_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_8_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_8_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_9_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_9_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_10_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_10_established : not tried [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_3 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_3 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_4 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_4 : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_5 : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_6 : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_7 : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_8 : trivial [wp] Goal typed_ref_equal_elements_assert : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_5 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_6 : not tried [wp] Goal typed_ref_equal_elements_assert_2 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_ref_equal_elements_loop_assigns : trivial [wp] Goal typed_ref_equal_elements_loop_assigns_2 : trivial [wp] Goal typed_ref_equal_elements_assigns_part1 : trivial [wp] Goal typed_ref_equal_elements_assigns_part2 : not tried [wp] Goal typed_ref_equal_elements_assigns_part3 : not tried [wp] Goal typed_ref_equal_elements_loop_variant_decrease : not tried [wp] Goal typed_ref_equal_elements_loop_variant_positive : not tried [wp] Goal typed_ref_equal_elements_loop_variant_2_decrease : not tried [wp] Goal typed_ref_equal_elements_loop_variant_2_positive : not tried [wp] Warning: Memory model hypotheses for function 'equal_elements': /*@ behavior typed_ref: requires \separated(v1,v2,a+(..)); requires \valid(v1); requires \valid(v2); */ void equal_elements(int *a, int *v1, int *v2); �������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/frama_c_exo3_solved.old.v2.res.oracle���0000666�0000000�0000000�00000010244�13571573400�027652� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_gallery/frama_c_exo3_solved.old.v2.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function equal_elements [wp] Goal typed_ref_equal_elements_ensures_v1_good : not tried [wp] Goal typed_ref_equal_elements_ensures_v2_good : not tried [wp] Goal typed_ref_equal_elements_ensures_v1_v2_diff : not tried [wp] Goal typed_ref_equal_elements_assert_rte_mem_access : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_2 : trivial [wp] Goal typed_ref_equal_elements_loop_invariant_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_set_at_0_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_set_at_0_established : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_2 : not tried [wp] Goal typed_ref_equal_elements_assert_set_at_1 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_signed_overflow : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_bound_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_bound_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_seen_sound1_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_seen_sound1_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_seen_sound2_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_seen_sound2_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v1_first_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v1_first_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v1_sound1_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v1_sound1_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v1_sound2_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v1_sound2_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v1_v2_diff_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v1_v2_diff_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v2_sound1_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v2_sound1_established : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v2_sound2_preserved : not tried [wp] Goal typed_ref_equal_elements_loop_invariant_v2_sound2_established : not tried [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_3 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_3 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_4 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_4 : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_5 : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_6 : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_7 : trivial [wp] Goal typed_ref_equal_elements_assert_rte_mem_access_8 : trivial [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_5 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_index_bound_6 : not tried [wp] Goal typed_ref_equal_elements_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_ref_equal_elements_loop_assigns : trivial [wp] Goal typed_ref_equal_elements_loop_assigns_2 : trivial [wp] Goal typed_ref_equal_elements_assigns_part1 : trivial [wp] Goal typed_ref_equal_elements_assigns_part2 : not tried [wp] Goal typed_ref_equal_elements_assigns_part3 : not tried [wp] Goal typed_ref_equal_elements_loop_variant_decrease : not tried [wp] Goal typed_ref_equal_elements_loop_variant_positive : not tried [wp] Goal typed_ref_equal_elements_loop_variant_2_decrease : not tried [wp] Goal typed_ref_equal_elements_loop_variant_2_positive : not tried [wp] Warning: Memory model hypotheses for function 'equal_elements': /*@ behavior typed_ref: requires \separated(v1,v2,a+(..)); requires \valid(v1); requires \valid(v2); */ void equal_elements(int *a, int *v1, int *v2); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000146�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/frama_c_exo3_solved.simplified.res.oracle���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/frama_c_exo3_solved.simplified.res.oracl0000666�0000000�0000000�00000004201�13571573400�030522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_gallery/frama_c_exo3_solved.simplified.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function pair [wp] Goal typed_pair_complete_has_pair_no_pair : trivial [wp] Goal typed_pair_disjoint_has_pair_no_pair : trivial [wp] Goal typed_pair_loop_invariant_preserved : not tried [wp] Goal typed_pair_loop_invariant_established : not tried [wp] Goal typed_pair_loop_invariant_2_preserved : not tried [wp] Goal typed_pair_loop_invariant_2_established : not tried [wp] Goal typed_pair_assert_rte_index_bound : not tried [wp] Goal typed_pair_assert_rte_index_bound_2 : not tried [wp] Goal typed_pair_assert_rte_signed_overflow : not tried [wp] Goal typed_pair_loop_invariant_3_preserved : not tried [wp] Goal typed_pair_loop_invariant_3_established : not tried [wp] Goal typed_pair_loop_invariant_4_preserved : not tried [wp] Goal typed_pair_loop_invariant_4_established : not tried [wp] Goal typed_pair_loop_invariant_5_preserved : not tried [wp] Goal typed_pair_loop_invariant_5_established : not tried [wp] Goal typed_pair_loop_invariant_6_preserved : not tried [wp] Goal typed_pair_loop_invariant_6_established : not tried [wp] Goal typed_pair_assert_rte_mem_access : not tried [wp] Goal typed_pair_assert_rte_index_bound_3 : not tried [wp] Goal typed_pair_assert_rte_index_bound_4 : not tried [wp] Goal typed_pair_assert_rte_index_bound_5 : not tried [wp] Goal typed_pair_assert_rte_index_bound_6 : not tried [wp] Goal typed_pair_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_pair_loop_assigns : trivial [wp] Goal typed_pair_loop_assigns_2 : trivial [wp] Goal typed_pair_assigns_part1 : not tried [wp] Goal typed_pair_assigns_part2 : not tried [wp] Goal typed_pair_assigns_part3 : not tried [wp] Goal typed_pair_assigns_part4 : not tried [wp] Goal typed_pair_loop_variant_decrease : not tried [wp] Goal typed_pair_loop_variant_positive : not tried [wp] Goal typed_pair_loop_variant_2_decrease : not tried [wp] Goal typed_pair_loop_variant_2_positive : not tried [wp] Goal typed_pair_has_pair_ensures : not tried [wp] Goal typed_pair_no_pair_ensures : not tried �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/frama_c_hashtbl_solved.res.oracle�������0000666�0000000�0000000�00000020652�13571573400�027322� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_gallery/frama_c_hashtbl_solved.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function add [rte] annotating function eq_string [rte] annotating function hash [rte] annotating function init [rte] annotating function mem_binding [rte] annotating function size [wp] Computing [100 goals...] [wp] Goal typed_add_complete_full_nominal : not tried [wp] Goal typed_add_disjoint_full_nominal : not tried [wp] Goal typed_add_assert_rte_index_bound : not tried [wp] Goal typed_add_assert_rte_mem_access : not tried [wp] Goal typed_add_assert_rte_index_bound_2 : not tried [wp] Goal typed_add_assert_rte_index_bound_3 : not tried [wp] Goal typed_add_assert_rte_index_bound_4 : not tried [wp] Goal typed_add_assert_rte_index_bound_5 : not tried [wp] Goal typed_add_assert_rte_mem_access_2 : not tried [wp] Goal typed_add_assert_rte_mem_access_3 : not tried [wp] Goal typed_add_assert_rte_index_bound_6 : not tried [wp] Goal typed_add_assert_rte_mem_access_4 : not tried [wp] Goal typed_add_assert_rte_mem_access_5 : not tried [wp] Goal typed_add_assert_rte_signed_overflow : not tried [wp] Goal typed_add_assert_rte_mem_access_6 : not tried [wp] Goal typed_add_assert_rte_mem_access_7 : not tried [wp] Goal typed_add_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_add_assigns_exit : trivial [wp] Goal typed_add_assigns_normal_part1 : trivial [wp] Goal typed_add_assigns_normal_part2 : not tried [wp] Goal typed_add_assigns_normal_part3 : not tried [wp] Goal typed_add_assigns_normal_part4 : not tried [wp] Goal typed_add_assigns_normal_part5 : not tried [wp] Goal typed_add_assigns_normal_part6 : not tried [wp] Goal typed_add_assigns_normal_part7 : not tried [wp] Goal typed_add_assigns_normal_part8 : not tried [wp] Goal typed_add_assigns_normal_part9 : not tried [wp] Goal typed_add_call_hash_requires : not tried [wp] Goal typed_add_full_ensures : not tried [wp] Goal typed_add_full_assigns_exit : trivial [wp] Goal typed_add_full_assigns_normal_part1 : trivial [wp] Goal typed_add_full_assigns_normal_part2 : not tried [wp] Goal typed_add_full_assigns_normal_part3 : not tried [wp] Goal typed_add_full_assigns_normal_part4 : not tried [wp] Goal typed_add_full_assigns_normal_part5 : not tried [wp] Goal typed_add_full_assigns_normal_part6 : not tried [wp] Goal typed_add_full_assigns_normal_part7 : not tried [wp] Goal typed_add_full_assigns_normal_part8 : not tried [wp] Goal typed_add_full_assigns_normal_part9 : not tried [wp] Goal typed_add_nominal_ensures : not tried [wp] Goal typed_add_nominal_ensures_2 : not tried [wp] Goal typed_add_nominal_ensures_3 : not tried [wp] Goal typed_add_nominal_ensures_4 : not tried [wp] Goal typed_add_nominal_ensures_5 : not tried [wp] Goal typed_add_nominal_assigns_exit : trivial [wp] Goal typed_add_nominal_assigns_normal_part1 : trivial [wp] Goal typed_add_nominal_assigns_normal_part2 : not tried [wp] Goal typed_add_nominal_assigns_normal_part3 : not tried [wp] Goal typed_add_nominal_assigns_normal_part4 : not tried [wp] Goal typed_add_nominal_assigns_normal_part5 : not tried [wp] Goal typed_add_nominal_assigns_normal_part6 : not tried [wp] Goal typed_add_nominal_assigns_normal_part7 : not tried [wp] Goal typed_add_nominal_assigns_normal_part8 : not tried [wp] Goal typed_add_nominal_assigns_normal_part9 : not tried [wp] Goal typed_eq_string_complete_not_eq_eq : trivial [wp] Goal typed_eq_string_disjoint_not_eq_eq : trivial [wp] Goal typed_eq_string_loop_invariant_preserved : not tried [wp] Goal typed_eq_string_loop_invariant_established : not tried [wp] Goal typed_eq_string_loop_invariant_2_preserved : not tried [wp] Goal typed_eq_string_loop_invariant_2_established : not tried [wp] Goal typed_eq_string_assert_rte_mem_access : not tried [wp] Goal typed_eq_string_assert_rte_mem_access_2 : not tried [wp] Goal typed_eq_string_assert_rte_signed_overflow : not tried [wp] Goal typed_eq_string_loop_assigns : trivial [wp] Goal typed_eq_string_assigns_part1 : not tried [wp] Goal typed_eq_string_assigns_part2 : not tried [wp] Goal typed_eq_string_assigns_part3 : not tried [wp] Goal typed_eq_string_assigns_part4 : not tried [wp] Goal typed_eq_string_loop_variant_decrease : not tried [wp] Goal typed_eq_string_loop_variant_positive : not tried [wp] Goal typed_eq_string_eq_ensures : not tried [wp] Goal typed_eq_string_not_eq_ensures : not tried [wp] Goal typed_hash_ensures_left_unproved : not tried [wp] Goal typed_hash_loop_invariant_preserved : not tried [wp] Goal typed_hash_loop_invariant_established : not tried [wp] Goal typed_hash_assert_rte_mem_access : not tried [wp] Goal typed_hash_assert_rte_mem_access_2 : not tried [wp] Goal typed_hash_assert_rte_signed_overflow : not tried [wp] Goal typed_hash_loop_assigns : trivial [wp] Goal typed_hash_assigns_part1 : not tried [wp] Goal typed_hash_assigns_part2 : not tried [wp] Goal typed_hash_loop_variant_decrease : not tried [wp] Goal typed_hash_loop_variant_positive : not tried [wp] Goal typed_init_ensures : not tried [wp] Goal typed_init_ensures_2 : not tried [wp] Goal typed_init_assert_rte_mem_access : not tried [wp] Goal typed_init_loop_invariant_preserved : not tried [wp] Goal typed_init_loop_invariant_established : not tried [wp] Goal typed_init_loop_invariant_2_preserved : not tried [wp] Goal typed_init_loop_invariant_2_established : not tried [wp] Goal typed_init_assert_rte_index_bound : not tried [wp] Goal typed_init_assert_rte_index_bound_2 : not tried [wp] Goal typed_init_assert_rte_mem_access_2 : not tried [wp] Goal typed_init_assert_rte_signed_overflow : not tried [wp] Goal typed_init_loop_assigns_part1 : trivial [wp] Goal typed_init_loop_assigns_part2 : not tried [wp] Goal typed_init_assigns_part1 : not tried [wp] Goal typed_init_assigns_part2 : not tried [wp] Goal typed_init_assigns_part3 : not tried [wp] Goal typed_init_loop_variant_decrease : not tried [wp] Goal typed_init_loop_variant_positive : not tried [wp] Goal typed_mem_binding_complete_not_found_found : not tried [wp] Goal typed_mem_binding_disjoint_not_found_found : not tried [wp] Goal typed_mem_binding_loop_invariant_preserved : not tried [wp] Goal typed_mem_binding_loop_invariant_established : not tried [wp] Goal typed_mem_binding_loop_invariant_2_preserved : not tried [wp] Goal typed_mem_binding_loop_invariant_2_established : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound_2 : not tried [wp] Goal typed_mem_binding_assert_rte_mem_access : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound_3 : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound_4 : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound_5 : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound_6 : not tried [wp] Goal typed_mem_binding_assert_rte_mem_access_2 : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound_7 : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound_8 : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound_9 : not tried [wp] Goal typed_mem_binding_assert_rte_index_bound_10 : not tried [wp] Goal typed_mem_binding_assert_rte_mem_access_3 : not tried [wp] Goal typed_mem_binding_assert_rte_signed_overflow : not tried [wp] Goal typed_mem_binding_loop_assigns_part1 : trivial [wp] Goal typed_mem_binding_loop_assigns_part2 : not tried [wp] Goal typed_mem_binding_assigns_exit_part1 : trivial [wp] Goal typed_mem_binding_assigns_exit_part2 : not tried [wp] Goal typed_mem_binding_assigns_exit_part3 : not tried [wp] Goal typed_mem_binding_assigns_exit_part4 : not tried [wp] Goal typed_mem_binding_assigns_normal_part1 : trivial [wp] Goal typed_mem_binding_assigns_normal_part2 : not tried [wp] Goal typed_mem_binding_assigns_normal_part3 : not tried [wp] Goal typed_mem_binding_assigns_normal_part4 : not tried [wp] Goal typed_mem_binding_assigns_normal_part5 : not tried [wp] Goal typed_mem_binding_assigns_normal_part6 : not tried [wp] Goal typed_mem_binding_assigns_normal_part7 : not tried [wp] Goal typed_mem_binding_loop_variant_decrease : not tried [wp] Goal typed_mem_binding_loop_variant_positive : not tried [wp] Goal typed_mem_binding_call_hash_requires : not tried [wp] Goal typed_mem_binding_call_eq_string_requires : not tried [wp] Goal typed_mem_binding_call_eq_string_requires_2 : not tried [wp] Goal typed_mem_binding_found_ensures : not tried [wp] Goal typed_mem_binding_not_found_ensures : not tried [wp] Goal typed_size_ensures : not tried [wp] Goal typed_size_assert_rte_mem_access : not tried [wp] Goal typed_size_assigns : not tried ��������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle/loop-statement.res.oracle���������������0000666�0000000�0000000�00000002101�13571573400�025611� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_gallery/loop-statement.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Goal typed_lemma_Lb : not tried [wp] Goal typed_loop_statement_ensures_Scond : not tried [wp] Goal typed_loop_statement_ensures_Sloop : not tried [wp] Goal typed_loop_statement_loop_invariant_Iloop_preserved : not tried [wp] Goal typed_loop_statement_loop_invariant_Iloop_established : not tried [wp] Goal typed_loop_statement_loop_assigns_part1 : trivial [wp] Goal typed_loop_statement_loop_assigns_part2 : not tried [wp] Goal typed_loop_statement_assigns_2_exit_part1 : trivial [wp] Goal typed_loop_statement_assigns_2_exit_part2 : not tried [wp] Goal typed_loop_statement_assigns_2_normal_part1 : trivial [wp] Goal typed_loop_statement_assigns_2_normal_part2 : not tried [wp] Goal typed_loop_statement_requires_Rinv : not tried [wp] Goal typed_loop_statement_requires_Scond : not tried [wp] Goal typed_loop_statement_ensures_Sbody : not tried [wp] Goal typed_loop_statement_assigns : trivial ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/���������������������������������0000777�0000000�0000000�00000000000�13571573400�022226� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000165�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000777�0000000�0000000�00000000000�13571573400�030756� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000173�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000777�0000000�0000000�00000000000�13571573400�030756� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/50b7ca427889aed35cdffb94389d1fc1.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000130�13571573400�030752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1725, "steps": 111 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/83dc0544abe24718ea722865cad8567d.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000127�13571573400�030760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0591, "steps": 72 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/b4b065851b610941b8243cc07cc36ed7.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000127�13571573400�030760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0404, "steps": 52 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/bb32008f2b6dbbd81a3deecbf51e7d01.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000127�13571573400�030760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0792, "steps": 42 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/c39ca4ac35735cb6f87c385e13049ca6.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000127�13571573400�030760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0233, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/d200f15f1ef2cdeb0e4ccb444961c8cf.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000127�13571573400�030760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0181, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/d5ffa33594d297a8ce47a352154deba1.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000127�13571573400�030760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0234, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/db765e117c923a38adaf1ca9b69e1bbd.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000127�13571573400�030760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0212, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/e62b96ca9a73811ef18902b193cbc59a.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000127�13571573400�030760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0251, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/edb252ae3606764fc300bb9f81803db8.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000127�13571573400�030760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0382, "steps": 27 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000240�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.session/cache/f069f82f764fc40974af232593211a75.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000000126�13571573400�030757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.104, "steps": 87 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000172�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.c.0.report.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000015765�13571573400�030776� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 11, "valid": 11, "rank": 22 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 14, "valid": 14, "rank": 22 } }, "wp:axiomatics": { "mult": { "lemma_sizeof_ok_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } }, "wp:functions": { "BinaryMultiplication": { "BinaryMultiplication_assert_rte_unsigned_overflow_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "BinaryMultiplication_assert_rte_unsigned_overflow_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "BinaryMultiplication_assert_rte_unsigned_overflow_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 10 }, "wp:main": { "total": 1, "valid": 1, "rank": 10 } }, "BinaryMultiplication_assert_rte_unsigned_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "BinaryMultiplication_loop_invariant_inv2_ok_deductible": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 22 }, "wp:main": { "total": 2, "valid": 2, "rank": 22 } }, "BinaryMultiplication_loop_invariant_inv1_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 19 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 19 } }, "BinaryMultiplication_assert_a1_ok_deductible": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "BinaryMultiplication_loop_variant": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 13 }, "wp:main": { "total": 2, "valid": 2, "rank": 13 } }, "BinaryMultiplication_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "BinaryMultiplication_ensures_product": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 17 }, "wp:main": { "total": 1, "valid": 1, "rank": 17 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 11, "valid": 11, "rank": 22 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 13, "valid": 13, "rank": 22 } } } } } �����������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000165�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.res.oracle������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication-without-ove0000666�0000000�0000000�00000007344�13571573400�030770� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -warn-unsigned-overflow [...] [kernel] Parsing tests/wp_gallery/binary-multiplication-without-overflow.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 10 goals scheduled [wp] [Qed] Goal typed_lemma_sizeof_ok_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_ensures_product : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a1_ok_deductible : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_preserved : Valid [wp] [Qed] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_deductible_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_deductible_established : Valid [wp] [Qed] Goal typed_BinaryMultiplication_loop_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_variant_decrease : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_variant_positive : Valid [wp] Proved goals: 10 / 10 Qed: 3 Alt-Ergo 2.0.0: 7 [wp] Report in: 'tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/binary-multiplication-without-overflow.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic mult 1 - 1 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success BinaryMultiplication 2 7 (104..128) 9 100% ------------------------------------------------------------- [wp] Running WP plugin... [rte] annotating function BinaryMultiplication [wp] 14 goals scheduled [wp] [Qed] Goal typed_lemma_sizeof_ok_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_ensures_product : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a1_ok_deductible : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_preserved : Valid [wp] [Qed] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_deductible_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_deductible_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_rte_unsigned_overflow : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_rte_unsigned_overflow_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_rte_unsigned_overflow_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_rte_unsigned_overflow_4 : Valid [wp] [Qed] Goal typed_BinaryMultiplication_loop_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_variant_decrease : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_variant_positive : Valid [wp] Proved goals: 11 / 14 Qed: 0 Alt-Ergo 2.0.0: 11 [wp] Report in: 'tests/wp_gallery/oracle_qualif/binary-multiplication-without-overflow.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/binary-multiplication-without-overflow.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic mult 1 - 1 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success BinaryMultiplication 2 11 (104..128) 13 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/�0000777�0000000�0000000�00000000000�13571573400�030365� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000152�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000777�0000000�0000000�00000000000�13571573400�030530� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/1539e57db2401020ec0e02d0f7961978.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000107�13571573400�030530� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 90. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/24386c81f53980bedb1b517805f58c72.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000126�13571573400�030531� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.027, "steps": 45 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/66c6d5d5b8486f066838ca77c26a99bc.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000127�13571573400�030532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0104, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/7679c569f1bb065300d3d8cb1464bbad.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000130�13571573400�030524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0995, "steps": 131 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/77d9616fbe16ad3e6a1b14e74982ead2.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000127�13571573400�030532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0183, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/a0e9344a67a80337a267995dd5b05544.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000127�13571573400�030532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0201, "steps": 53 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/b035bd9b0798630779b2676faf707d06.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000127�13571573400�030532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.529, "steps": 430 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/b336801d3713a314b5daec247980d7dd.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000130�13571573400�030524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.5623, "steps": 383 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/c450d21c433db1ccd7b96bfd362d035a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000127�13571573400�030532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0108, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/d8e9312b5b8cdc167678751e3ede50c1.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000127�13571573400�030532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0522, "steps": 80 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/e0a684fe785a113b129a9df74687db0c.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000126�13571573400�030531� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0098, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/e487df371af8c54f2d6fb9cc129c1696.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000130�13571573400�030524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0384, "steps": 114 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000217�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/cache/fe5b0fc55cfd82dc6da71976001e38ec.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.0.session/c0000666�0000000�0000000�00000000126�13571573400�030531� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0132, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000151�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.c.0.report.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.c.0.report.0000666�0000000�0000000�00000020074�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 13, "valid": 13, "rank": 67 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 16, "valid": 16, "rank": 67 } }, "wp:axiomatics": { "mult": { "lemma_sizeof_ok_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_ax5_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "lemma_ax4_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 3, "rank": 1 } } } }, "wp:functions": { "BinaryMultiplication": { "BinaryMultiplication_assert_a6_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "BinaryMultiplication_assert_a5_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "BinaryMultiplication_assert_a3_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "BinaryMultiplication_assert_a2_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 14 } }, "BinaryMultiplication_loop_invariant_inv2_ok_deductible": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 61 }, "wp:main": { "total": 2, "valid": 2, "rank": 61 } }, "BinaryMultiplication_loop_invariant_inv1_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 67 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 67 } }, "BinaryMultiplication_assert_a1_ok_deductible": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "BinaryMultiplication_loop_variant": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 32 }, "wp:main": { "total": 2, "valid": 2, "rank": 32 } }, "BinaryMultiplication_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "BinaryMultiplication_ensures_product": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 49 }, "wp:main": { "total": 1, "valid": 1, "rank": 49 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 11, "valid": 11, "rank": 67 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 13, "valid": 13, "rank": 67 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/binary-multiplication.res.oracle�0000666�0000000�0000000�00000010226�13571573400�030525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 90 [...] [kernel] Parsing tests/wp_gallery/binary-multiplication.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 17 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ax4_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ax5_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ax7_ok : Valid [wp] [Qed] Goal typed_lemma_sizeof_ok_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_ensures_product : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a1_ok_deductible : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_preserved : Unsuccess [wp] [Qed] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a2_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a3_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a4_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a5_ok : Valid [wp] [Qed] Goal typed_BinaryMultiplication_loop_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_variant_decrease : Valid [wp] [Qed] Goal typed_BinaryMultiplication_loop_variant_positive : Valid [wp] Proved goals: 16 / 17 Qed: 4 Alt-Ergo 2.0.0: 12 (unsuccess: 1) [wp] Report in: 'tests/wp_gallery/oracle_qualif/binary-multiplication.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/binary-multiplication.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic mult 1 3 (8..20) 4 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success BinaryMultiplication 3 9 (400..448) 13 92.3% ------------------------------------------------------------- [wp] Running WP plugin... [rte] annotating function BinaryMultiplication [wp] 17 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ax4_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ax5_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ax7_ok : Valid [wp] [Qed] Goal typed_lemma_sizeof_ok_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_ensures_product : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a1_ok_deductible : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_preserved : Unsuccess [wp] [Qed] Goal typed_BinaryMultiplication_loop_invariant_inv1_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_invariant_inv2_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a2_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a3_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a4_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_assert_a5_ok : Valid [wp] [Qed] Goal typed_BinaryMultiplication_loop_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_BinaryMultiplication_loop_variant_decrease : Valid [wp] [Qed] Goal typed_BinaryMultiplication_loop_variant_positive : Valid [wp] Proved goals: 13 / 17 Qed: 1 Alt-Ergo 2.0.0: 12 (unsuccess: 1) [wp] Report in: 'tests/wp_gallery/oracle_qualif/binary-multiplication.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/binary-multiplication.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic mult 1 3 (8..20) 4 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success BinaryMultiplication 3 9 (400..448) 13 92.3% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/���0000777�0000000�0000000�00000000000�13571573400�027746� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000150�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000777�0000000�0000000�00000000000�13571573400�030415� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/00ecf4296b3aee4d1912c74420c9bfce.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0238, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/0230914cd0121d246ef6d21a5cfc7fa1.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0156, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/2deacada1b18db7a5111ef2c5b2638de.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000666�0000000�0000000�00000000130�13571573400�030411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0667, "steps": 102 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/45575d27fe1fe5a0b0153e23f53726c9.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000666�0000000�0000000�00000000126�13571573400�030416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.028, "steps": 31 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/48bd1dffec078a57cdf3c81460760830.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000666�0000000�0000000�00000000126�13571573400�030416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.017, "steps": 20 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/a9a1699bcaaae331be6465b2f7af6a4c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0406, "steps": 47 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/b0c44ab7bb5e6a7220f7179fe6ae6761.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0373, "steps": 51 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/d10c14e21c7d63a6a49829c726e18f8f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0312, "steps": 51 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cache/d9457ea3aed60df13390d1465c9ae2a4.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0283, "steps": 36 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000147�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.c.0.report.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.c.0.report.js0000666�0000000�0000000�00000016144�13571573400�030363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 9, "valid": 9, "rank": 27 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 15, "valid": 15, "rank": 27 } }, "wp:functions": { "exo1": { "exo1_assert_rte_signed_overflow_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "exo1_assert_rte_signed_overflow_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "exo1_assert_rte_mem_access_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "wp:main": { "total": 1, "valid": 1, "rank": 11 } }, "exo1_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "exo1_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "exo1_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 27 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 27 } }, "exo1_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 9 } }, "exo1_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "exo1_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "exo1_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "exo1_ensures_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "exo1_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 9, "valid": 9, "rank": 27 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 15, "valid": 15, "rank": 27 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.res.oracle���0000666�0000000�0000000�00000005360�13571573400�030111� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_gallery/frama_c_exo1_solved.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 10 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_exo1_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_exo1_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_exo1_loop_assigns : Valid [wp] [Qed] Goal typed_exo1_assigns : Valid [wp] [Qed] Goal typed_exo1_loop_variant_decrease : Valid [wp] [Qed] Goal typed_exo1_loop_variant_positive : Valid [wp] Proved goals: 10 / 10 Qed: 6 Alt-Ergo 2.0.0: 4 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo1_solved.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success exo1 6 4 (88..112) 10 100% ------------------------------------------------------------- [wp] Running WP plugin... [rte] annotating function exo1 [wp] 15 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_assert_rte_signed_overflow : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_exo1_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_exo1_loop_invariant_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_assert_rte_mem_access : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_assert_rte_mem_access_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_assert_rte_signed_overflow_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_exo1_assert_rte_signed_overflow_3 : Valid [wp] [Qed] Goal typed_exo1_loop_assigns : Valid [wp] [Qed] Goal typed_exo1_assigns : Valid [wp] [Qed] Goal typed_exo1_loop_variant_decrease : Valid [wp] [Qed] Goal typed_exo1_loop_variant_positive : Valid [wp] Proved goals: 9 / 15 Qed: 0 Alt-Ergo 2.0.0: 9 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo1_solved.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo1_solved.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success exo1 6 9 (88..112) 15 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/���0000777�0000000�0000000�00000000000�13571573400�027747� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000150�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000777�0000000�0000000�00000000000�13571573400�030416� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/09d860a6bed99d37144eb85b7d09c1cd.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0362, "steps": 52 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/2298a3e138acd30bbfb9944ea8f9e47f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0315, "steps": 32 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/2a85ef642eeffcb15f2c8c244d5e6fcd.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0486, "steps": 61 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/37e42d2496a52f0392be3e018f994253.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0191, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/4024290cccf2bd02d1affc464c31272c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0356, "steps": 47 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/7384017a2cf1ceb7fa5e3f2a27ec1461.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0354, "steps": 46 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/8d7cbb96d2716e5e30fa2db72e0bc571.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000130�13571573400�030412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1911, "steps": 275 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/9386d1588ee8ff353cf1bba248d8b6ce.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000126�13571573400�030417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.031, "steps": 41 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/99c9c4369b4e7f2cc778a41d382e4be5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000130�13571573400�030412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0885, "steps": 140 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/ac26388b1db7b81e2c7bbf9cbd232cbf.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0244, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/ba4e367ec1b498ad0f90c7529ea797f9.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0247, "steps": 31 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/c8dc85fabdedd37aab84db72c8de7556.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000127�13571573400�030420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0245, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cache/d7f28bc4aeb695c611ec122b4a4690e5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.session/cac0000666�0000000�0000000�00000000126�13571573400�030417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.075, "steps": 87 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000147�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.c.0.report.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.c.0.report.js0000666�0000000�0000000�00000020225�13571573400�030357� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 14, "valid": 14, "rank": 49 }, "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 23, "valid": 23, "rank": 49 } }, "wp:functions": { "max_subarray": { "max_subarray_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 15 }, "wp:main": { "total": 1, "valid": 1, "rank": 15 } }, "max_subarray_loop_invariant_8": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 49 }, "wp:main": { "total": 2, "valid": 2, "rank": 49 } }, "max_subarray_loop_invariant_7": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 25 }, "wp:main": { "total": 2, "valid": 2, "rank": 25 } }, "max_subarray_loop_invariant_6": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 11 }, "wp:main": { "total": 2, "valid": 2, "rank": 11 } }, "max_subarray_loop_invariant_5": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 11 }, "wp:main": { "total": 2, "valid": 2, "rank": 11 } }, "max_subarray_loop_invariant_4": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "max_subarray_loop_invariant_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 10 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 10 } }, "max_subarray_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 13 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 13 } }, "max_subarray_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 7 } }, "max_subarray_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "max_subarray_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "max_subarray_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "max_subarray_ensures_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "max_subarray_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 14, "valid": 14, "rank": 49 }, "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 23, "valid": 23, "rank": 49 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.res.oracle���0000666�0000000�0000000�00000010751�13571573400�030112� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_gallery/frama_c_exo2_solved.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 22 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_3_preserved : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_3_established : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_4_preserved : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_4_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_5_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_5_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_6_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_6_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_7_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_7_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_8_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_8_established : Valid [wp] [Qed] Goal typed_max_subarray_loop_assigns : Valid [wp] [Qed] Goal typed_max_subarray_assigns : Valid [wp] [Qed] Goal typed_max_subarray_loop_variant_decrease : Valid [wp] [Qed] Goal typed_max_subarray_loop_variant_positive : Valid [wp] Proved goals: 22 / 22 Qed: 9 Alt-Ergo 2.0.0: 13 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo2_solved.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success max_subarray 9 13 (256..304) 22 100% ------------------------------------------------------------- [wp] Running WP plugin... [rte] annotating function max_subarray [wp] 23 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_3_preserved : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_3_established : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_4_preserved : Valid [wp] [Qed] Goal typed_max_subarray_loop_invariant_4_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_5_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_5_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_6_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_6_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_7_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_7_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_8_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_loop_invariant_8_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_max_subarray_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_max_subarray_loop_assigns : Valid [wp] [Qed] Goal typed_max_subarray_assigns : Valid [wp] [Qed] Goal typed_max_subarray_loop_variant_decrease : Valid [wp] [Qed] Goal typed_max_subarray_loop_variant_positive : Valid [wp] Proved goals: 14 / 23 Qed: 0 Alt-Ergo 2.0.0: 14 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo2_solved.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo2_solved.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success max_subarray 9 14 (256..304) 23 100% ------------------------------------------------------------- �����������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000146�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000777�0000000�0000000�00000000000�13571573400�030446� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000154�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000777�0000000�0000000�00000000000�13571573400�030446� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/0b5759138af93f51b0e7fb12c995eb14.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0602, "steps": 122 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/0bb570bdfc29c713f2ab3cfdfeb32896.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000127�13571573400�030450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0185, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/146fbdc1298b06be16738f962a3f5159.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000127�13571573400�030450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0476, "steps": 88 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/283f609cf9f5e76247af6de360d9da6b.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000126�13571573400�030447� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.018, "steps": 36 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/381ee71a63ecd1842e5a04cbce851b5b.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.2703, "steps": 245 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/3c5ed1325c8ab6ee7d1fc9ecf57b6f9d.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000127�13571573400�030450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.112, "steps": 183 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/4b205930d3b4d8fee48261a586bc8073.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.1391, "steps": 480 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/6598f250edf1b886274861118ba008ad.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000127�13571573400�030450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0237, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/70e5ed1bc7a3e313f8eb27096a17ae10.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0659, "steps": 153 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/79d831813d414cc08f58c5fda2236205.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0998, "steps": 148 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/a0c5cf3bb71e2656a3034208a111b110.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0608, "steps": 119 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/b165ab4893ffc1cbfc6ae37fb197c0f1.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0431, "steps": 100 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/b1811c4bf2e186a18d64936abca5b39f.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0611, "steps": 119 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/b8b99ab8c81e5a26ca31d567fc55ec6d.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.1315, "steps": 587 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/bba11adb2ddad99a9727cb7458cea372.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.0553, "steps": 312 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/c04157f46e4552c161a37fde022748c4.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0629, "steps": 121 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/c608f5ac1c4e41f6285e2d0288f7a3e6.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.9603, "steps": 443 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/cbfaf2c41e4f40a1fe17f5ec7749baec.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000127�13571573400�030450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0236, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/d9c5bf672a6c1429d923b3f9f333ad8b.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.6726, "steps": 327 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/de3aef527d44800527eba214ba87014c.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000127�13571573400�030450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0296, "steps": 34 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session/cache/e3bdffb2192e8e9280a4f8319d797e5c.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.session0000666�0000000�0000000�00000000127�13571573400�030450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.037, "steps": 110 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000153�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.c.0.report.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.c.0.repor0000666�0000000�0000000�00000042261�13571573400�030342� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 21, "valid": 21, "rank": 52 }, "qed": { "total": 29, "valid": 29 }, "wp:main": { "total": 50, "valid": 50, "rank": 52 } }, "wp:functions": { "equal_elements": { "equal_elements_assert_rte_signed_overflow_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "equal_elements_assert_rte_index_bound_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_index_bound_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_8": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_7": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_index_bound_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 23 }, "wp:main": { "total": 1, "valid": 1, "rank": 23 } }, "equal_elements_assert_rte_index_bound_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 23 }, "wp:main": { "total": 1, "valid": 1, "rank": 23 } }, "equal_elements_assert_rte_mem_access_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 23 }, "wp:main": { "total": 1, "valid": 1, "rank": 23 } }, "equal_elements_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "equal_elements_assert_rte_index_bound_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_index_bound": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 40 }, "wp:main": { "total": 1, "valid": 1, "rank": 40 } }, "equal_elements_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 26 }, "wp:main": { "total": 1, "valid": 1, "rank": 26 } }, "equal_elements_loop_invariant_10": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 49 }, "wp:main": { "total": 2, "valid": 2, "rank": 49 } }, "equal_elements_loop_invariant_9": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 49 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 49 } }, "equal_elements_loop_invariant_8": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 34 }, "wp:main": { "total": 2, "valid": 2, "rank": 34 } }, "equal_elements_loop_invariant_7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 21 } }, "equal_elements_loop_invariant_6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 47 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 47 } }, "equal_elements_loop_invariant_5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 52 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 52 } }, "equal_elements_loop_invariant_4": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "equal_elements_loop_invariant_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "equal_elements_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 19 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 19 } }, "equal_elements_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "equal_elements_loop_variant_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "equal_elements_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "equal_elements_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "equal_elements_loop_assigns_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_ensures_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 23 }, "wp:main": { "total": 1, "valid": 1, "rank": 23 } }, "equal_elements_ensures_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 31 }, "wp:main": { "total": 1, "valid": 1, "rank": 31 } }, "equal_elements_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 27 }, "wp:main": { "total": 1, "valid": 1, "rank": 27 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 21, "valid": 21, "rank": 52 }, "qed": { "total": 29, "valid": 29 }, "wp:main": { "total": 50, "valid": 50, "rank": 52 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000146�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.res.oracle���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.res.oracl0000666�0000000�0000000�00000020112�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_gallery/frama_c_exo3_solved.old.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 34 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_3_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_3_established : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_4_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_4_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_5_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_5_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_6_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_6_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_7_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_7_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_8_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_8_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_9_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_9_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_10_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_10_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_assigns : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_assigns_2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part1 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part3 : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_decrease : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_positive : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_2_positive : Valid [wp] Proved goals: 34 / 34 Qed: 18 Alt-Ergo 2.0.0: 16 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo3_solved.old.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success equal_elements 18 16 (544..640) 34 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'equal_elements': /*@ behavior typed_ref: requires \separated(v1,v2,a+(..)); requires \valid(v1); requires \valid(v2); */ void equal_elements(int *a, int *v1, int *v2); [wp] Running WP plugin... [rte] annotating function equal_elements [wp] 50 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_3 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_index_bound : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_index_bound_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_signed_overflow : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_3_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_3_established : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_4_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_4_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_5_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_5_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_6_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_6_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_7_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_7_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_8_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_8_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_9_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_9_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_10_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_10_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_mem_access_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_index_bound_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_index_bound_4 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_4 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_5 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_6 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_7 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_index_bound_5 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_index_bound_6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_signed_overflow_2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_assigns : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_assigns_2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part1 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part3 : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_decrease : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_positive : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_2_positive : Valid [wp] Proved goals: 32 / 50 Qed: 11 Alt-Ergo 2.0.0: 21 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo3_solved.old.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success equal_elements 29 21 (544..640) 50 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'equal_elements': /*@ behavior typed_ref: requires \separated(v1,v2,a+(..)); requires \valid(v1); requires \valid(v2); */ void equal_elements(int *a, int *v1, int *v2); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000151�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000777�0000000�0000000�00000000000�13571573400�030266� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000157�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000777�0000000�0000000�00000000000�13571573400�030266� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/0994e7de773b107d157192d17ecbedc2.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000130�13571573400�030262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1735, "steps": 263 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/3a323549e397e5966994d38f5eda824f.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0262, "steps": 29 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/3a56ae53705a898c58ab7719dad95879.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0641, "steps": 96 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/4268a7599d49e87d664f37118bfe31e0.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0346, "steps": 40 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/52b8e721d8f9317b458272dda8b08ca7.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000130�13571573400�030262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0994, "steps": 166 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/5fad8316b9a6c1a0d096e3445186bbda.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0335, "steps": 39 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/67f47fb725f1d6b46adbfc0978186f71.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000130�13571573400�030262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0816, "steps": 108 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/6fcf2fbb95adef2015dbd96c6436e748.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0436, "steps": 48 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/7cbb37cc372cb9c7ace1d05e5f61952f.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0273, "steps": 30 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/8baa73c0a0cf86f103780b665f587c7e.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0268, "steps": 38 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/98b660918f4eeb38cb437039f2c8746f.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0332, "steps": 39 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/9a8bccb913784d4facd21f58c0b084c6.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0456, "steps": 68 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/a24a96fa07cf7d70235cbdd81c94626c.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0374, "steps": 54 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/abfb3fa59feee714e91e6024d3d916cb.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000130�13571573400�030262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1541, "steps": 264 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/b9b0b69bbd5926d173af68d85595f720.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0214, "steps": 30 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/c3c471363fa4a5387ea0d4bdff81eec5.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000130�13571573400�030262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1173, "steps": 119 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/cd1a76fb30d85ca8043541c541bda7c5.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0339, "steps": 45 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/d52a947f857129281877763e2ce75652.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000126�13571573400�030267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.039, "steps": 70 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/d9074d7a7643baec0368e51d72f9e647.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0486, "steps": 70 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/da51cc8a750e66b95505021e00e8d6da.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0267, "steps": 42 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/ef4e8894a88571b2c2789eaa08c82a12.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000130�13571573400�030262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1127, "steps": 182 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/f0a77b66204fa20da473db042805e41e.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000127�13571573400�030270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0246, "steps": 41 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000224�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.session/cache/f34f77d6c4322eaf0ee8de9aad034e23.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.sess0000666�0000000�0000000�00000000126�13571573400�030267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.043, "steps": 60 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000156�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.c.0.report.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.c.0.re0000666�0000000�0000000�00000041032�13571573400�030142� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 23, "valid": 23, "rank": 36 }, "qed": { "total": 28, "valid": 28 }, "wp:main": { "total": 51, "valid": 51, "rank": 36 } }, "wp:functions": { "equal_elements": { "equal_elements_assert_rte_signed_overflow_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 10 }, "wp:main": { "total": 1, "valid": 1, "rank": 10 } }, "equal_elements_assert_rte_index_bound_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_index_bound_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_8": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_7": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_index_bound_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "equal_elements_assert_rte_index_bound_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "equal_elements_assert_rte_mem_access_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "equal_elements_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "equal_elements_assert_rte_index_bound_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_index_bound": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_assert_rte_mem_access": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_loop_invariant_v2_sound2": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 36 }, "wp:main": { "total": 2, "valid": 2, "rank": 36 } }, "equal_elements_loop_invariant_v1_sound2": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 20 }, "wp:main": { "total": 2, "valid": 2, "rank": 20 } }, "equal_elements_loop_invariant_seen_sound2": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 30 }, "wp:main": { "total": 2, "valid": 2, "rank": 30 } }, "equal_elements_loop_invariant_seen_sound1": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 36 }, "wp:main": { "total": 2, "valid": 2, "rank": 36 } }, "equal_elements_loop_invariant_v1_v2_diff": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 15 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 15 } }, "equal_elements_loop_invariant_v2_sound1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 28 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 28 } }, "equal_elements_loop_invariant_v1_sound1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 21 } }, "equal_elements_loop_invariant_v1_first": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "equal_elements_loop_invariant_bound": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 10 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 10 } }, "equal_elements_assert_set_at_1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "equal_elements_loop_invariant_set_at_0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 10 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 10 } }, "equal_elements_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 7 } }, "equal_elements_loop_variant_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "equal_elements_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "equal_elements_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "equal_elements_loop_assigns_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "equal_elements_ensures_v1_v2_diff": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "wp:main": { "total": 1, "valid": 1, "rank": 11 } }, "equal_elements_ensures_v2_good": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 23 }, "wp:main": { "total": 1, "valid": 1, "rank": 23 } }, "equal_elements_ensures_v1_good": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 13 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 23, "valid": 23, "rank": 36 }, "qed": { "total": 28, "valid": 28 }, "wp:main": { "total": 51, "valid": 51, "rank": 36 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000151�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.res.oracle������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.res.or0000666�0000000�0000000�00000021275�13571573400�030374� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_gallery/frama_c_exo3_solved.old.v2.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 35 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_v1_good : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_v2_good : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_v1_v2_diff : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_set_at_0_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_set_at_0_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_set_at_1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_bound_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_bound_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_seen_sound1_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_seen_sound1_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_seen_sound2_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_seen_sound2_established : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v1_first_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v1_first_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v1_sound1_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v1_sound1_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v1_sound2_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v1_sound2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v1_v2_diff_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v1_v2_diff_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v2_sound1_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v2_sound1_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v2_sound2_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v2_sound2_established : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_assigns : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_assigns_2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part1 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part3 : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_decrease : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_positive : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_2_positive : Valid [wp] Proved goals: 35 / 35 Qed: 17 Alt-Ergo 2.0.0: 18 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo3_solved.old.v2.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success equal_elements 17 18 (240..288) 35 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'equal_elements': /*@ behavior typed_ref: requires \separated(v1,v2,a+(..)); requires \valid(v1); requires \valid(v2); */ void equal_elements(int *a, int *v1, int *v2); [wp] Running WP plugin... [rte] annotating function equal_elements [wp] 51 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_v1_good : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_v2_good : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_ensures_v1_v2_diff : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_set_at_0_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_set_at_0_established : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_index_bound : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_index_bound_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_set_at_1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_signed_overflow : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_bound_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_bound_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_seen_sound1_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_seen_sound1_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_seen_sound2_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_seen_sound2_established : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v1_first_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v1_first_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v1_sound1_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v1_sound1_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v1_sound2_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v1_sound2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v1_v2_diff_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v1_v2_diff_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v2_sound1_preserved : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_invariant_v2_sound1_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v2_sound2_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_loop_invariant_v2_sound2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_mem_access_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_index_bound_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_index_bound_4 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_4 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_5 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_6 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_7 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_mem_access_8 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_index_bound_5 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assert_rte_index_bound_6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_equal_elements_assert_rte_signed_overflow_2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_assigns : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_assigns_2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part1 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part2 : Valid [wp] [Qed] Goal typed_ref_equal_elements_assigns_part3 : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_decrease : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_positive : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_ref_equal_elements_loop_variant_2_positive : Valid [wp] Proved goals: 34 / 51 Qed: 11 Alt-Ergo 2.0.0: 23 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.old.v2.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo3_solved.old.v2.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success equal_elements 28 23 (240..288) 51 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'equal_elements': /*@ behavior typed_ref: requires \separated(v1,v2,a+(..)); requires \valid(v1); requires \valid(v2); */ void equal_elements(int *a, int *v1, int *v2); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000160�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.report.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000032260�13571573400�030416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 15, "valid": 15, "rank": 27 }, "qed": { "total": 20, "valid": 20 }, "wp:main": { "total": 35, "valid": 35, "rank": 27 } }, "wp:functions": { "pair": { "pair_disjoint_has_pair_no_pair": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_complete_has_pair_no_pair": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_assert_rte_signed_overflow_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "wp:main": { "total": 1, "valid": 1, "rank": 11 } }, "pair_assert_rte_index_bound_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_assert_rte_index_bound_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_assert_rte_index_bound_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "pair_assert_rte_index_bound_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "pair_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "pair_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "pair_assert_rte_index_bound_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_assert_rte_index_bound": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_loop_invariant_6": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 20 }, "wp:main": { "total": 2, "valid": 2, "rank": 20 } }, "pair_loop_invariant_5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 17 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 17 } }, "pair_loop_invariant_4": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 15 }, "wp:main": { "total": 2, "valid": 2, "rank": 15 } }, "pair_loop_invariant_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "pair_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "pair_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "pair_loop_variant_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "pair_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "pair_assigns": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "pair_loop_assigns_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_has_pair_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 27 }, "wp:main": { "total": 1, "valid": 1, "rank": 27 } }, "pair_no_pair_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 14 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 15, "valid": 15, "rank": 27 }, "qed": { "total": 20, "valid": 20 }, "wp:main": { "total": 35, "valid": 35, "rank": 27 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000155�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000777�0000000�0000000�00000000000�13571573400�030411� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000163�00000000000�007773� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000777�0000000�0000000�00000000000�13571573400�030411� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/14276c6d39fd02eb3bfe8184e2080f3e.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0226, "steps": 50 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/2a36d0493c8197c85fed26e515ca1746.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0491, "steps": 62 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/3710bb06a41471f5a1ba7a24e612a631.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000126�13571573400�030412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.032, "steps": 48 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/4ea7eca23aaae8b6354c3d2681929873.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000130�13571573400�030405� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0656, "steps": 101 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/50f26ce79495d19742bd2d2bbe85a8ec.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0234, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/622a2b9a7f0c8f2711cdaad74aa9e154.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0253, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/6bea889a3e65713254fec285d40f00be.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000126�13571573400�030412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.022, "steps": 18 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/6d024368791118352e330ee5819a43da.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0224, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/7af89e44e06470d4c58bdbdea0fe349b.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0253, "steps": 46 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/80e82a5604b2fa67ff4f9b8091c99f1a.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.231, "steps": 151 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/850683912365f15b45151d1ab6686c10.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0203, "steps": 28 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/904575836baf21bc229b0d95f611a2f4.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0489, "steps": 59 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/910a3dfe75b97d4b6b63f4d430267331.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0435, "steps": 72 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/bf28d7590dfa23396bb3dec88ced00fa.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0169, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000230�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.session/cache/f9fc4b67c3f50f27fa531f82e161010e.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.0000666�0000000�0000000�00000000127�13571573400�030413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0305, "steps": 50 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000162�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.c.0.report.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.c.0000666�0000000�0000000�00000032260�13571573400�030501� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 15, "valid": 15, "rank": 26 }, "qed": { "total": 20, "valid": 20 }, "wp:main": { "total": 35, "valid": 35, "rank": 26 } }, "wp:functions": { "pair": { "pair_disjoint_has_pair_no_pair": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_complete_has_pair_no_pair": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_assert_rte_signed_overflow_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "wp:main": { "total": 1, "valid": 1, "rank": 11 } }, "pair_assert_rte_index_bound_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_assert_rte_index_bound_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_assert_rte_index_bound_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "pair_assert_rte_index_bound_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "pair_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "pair_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "pair_assert_rte_index_bound_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_assert_rte_index_bound": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_loop_invariant_6": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 20 }, "wp:main": { "total": 2, "valid": 2, "rank": 20 } }, "pair_loop_invariant_5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 16 } }, "pair_loop_invariant_4": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 15 }, "wp:main": { "total": 2, "valid": 2, "rank": 15 } }, "pair_loop_invariant_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "pair_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "pair_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "pair_loop_variant_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "pair_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "pair_assigns": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "pair_loop_assigns_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pair_has_pair_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 26 }, "wp:main": { "total": 1, "valid": 1, "rank": 26 } }, "pair_no_pair_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 14 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 15, "valid": 15, "rank": 26 }, "qed": { "total": 20, "valid": 20 }, "wp:main": { "total": 35, "valid": 35, "rank": 26 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000155�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.res.oracle��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.re0000666�0000000�0000000�00000012032�13571573400�030602� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_gallery/frama_c_exo3_solved.simplified.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 26 goals scheduled [wp] [Qed] Goal typed_pair_complete_has_pair_no_pair : Valid [wp] [Qed] Goal typed_pair_disjoint_has_pair_no_pair : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_pair_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_pair_loop_invariant_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_3_preserved : Valid [wp] [Qed] Goal typed_pair_loop_invariant_3_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_4_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_4_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_5_preserved : Valid [wp] [Qed] Goal typed_pair_loop_invariant_5_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_6_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_6_established : Valid [wp] [Qed] Goal typed_pair_loop_assigns : Valid [wp] [Qed] Goal typed_pair_loop_assigns_2 : Valid [wp] [Qed] Goal typed_pair_assigns_part1 : Valid [wp] [Qed] Goal typed_pair_assigns_part2 : Valid [wp] [Qed] Goal typed_pair_assigns_part3 : Valid [wp] [Qed] Goal typed_pair_assigns_part4 : Valid [wp] [Qed] Goal typed_pair_loop_variant_decrease : Valid [wp] [Qed] Goal typed_pair_loop_variant_positive : Valid [wp] [Qed] Goal typed_pair_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_pair_loop_variant_2_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_has_pair_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_no_pair_ensures : Valid [wp] Proved goals: 26 / 26 Qed: 16 Alt-Ergo 2.0.0: 10 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo3_solved.simplified.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success pair 16 10 (144..168) 26 100% ------------------------------------------------------------- [wp] Running WP plugin... [rte] annotating function pair [wp] 35 goals scheduled [wp] [Qed] Goal typed_pair_complete_has_pair_no_pair : Valid [wp] [Qed] Goal typed_pair_disjoint_has_pair_no_pair : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_pair_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_pair_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_pair_assert_rte_index_bound : Valid [wp] [Qed] Goal typed_pair_assert_rte_index_bound_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_assert_rte_signed_overflow : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_3_preserved : Valid [wp] [Qed] Goal typed_pair_loop_invariant_3_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_4_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_4_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_5_preserved : Valid [wp] [Qed] Goal typed_pair_loop_invariant_5_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_6_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_loop_invariant_6_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_assert_rte_mem_access : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_assert_rte_index_bound_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_assert_rte_index_bound_4 : Valid [wp] [Qed] Goal typed_pair_assert_rte_index_bound_5 : Valid [wp] [Qed] Goal typed_pair_assert_rte_index_bound_6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_assert_rte_signed_overflow_2 : Valid [wp] [Qed] Goal typed_pair_loop_assigns : Valid [wp] [Qed] Goal typed_pair_loop_assigns_2 : Valid [wp] [Qed] Goal typed_pair_assigns_part1 : Valid [wp] [Qed] Goal typed_pair_assigns_part2 : Valid [wp] [Qed] Goal typed_pair_assigns_part3 : Valid [wp] [Qed] Goal typed_pair_assigns_part4 : Valid [wp] [Qed] Goal typed_pair_loop_variant_decrease : Valid [wp] [Qed] Goal typed_pair_loop_variant_positive : Valid [wp] [Qed] Goal typed_pair_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_pair_loop_variant_2_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_has_pair_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_pair_no_pair_ensures : Valid [wp] Proved goals: 19 / 35 Qed: 4 Alt-Ergo 2.0.0: 15 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_exo3_solved.simplified.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_exo3_solved.simplified.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success pair 20 15 (144..168) 35 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000777�0000000�0000000�00000000000�13571573400�030517� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000153�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000777�0000000�0000000�00000000000�13571573400�030517� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/04f8fd45e1372421cd06dda8f75437c9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1085, "steps": 95 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/08b6db2d3fafc4cb93883a7010ed552d.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0459, "steps": 65 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/0c3a16ff3ecb02ed6f91b69f76942a5f.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0314, "steps": 74 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/1734ba914f5a9bff1a0c272ed625acf9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0224, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/1c83ad0e6fe132008040c290e2b1c7a9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0243, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/214b0fb9511817c8882f41d7586b6bb4.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 2.5518, "steps": 856 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/27e2e343658ccf65535b56edee720c46.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0624, "steps": 96 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/327ad8c34d97a2b1d501faa2742234dd.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0315, "steps": 32 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/32f18b2b6ec78668204d73a4ef122549.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0517, "steps": 99 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/3816760d1f1f7ae54387d98f152bc630.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0356, "steps": 42 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/3c2bdca046ada8649292938b16f2dd9b.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000126�13571573400�030520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.035, "steps": 47 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/3ed6ccb36aabda9beaecfc54b51bc6dc.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0232, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/3f1a0275ffdc48d034f6dfacf4502be1.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0234, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/41abf1fe4d6a6b46b204b97a55f5ba46.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.221, "steps": 586 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/41db8884cdb35e4120e231fbcf59b7cf.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1436, "steps": 179 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/461fe24ecd8d691d91a96770806ef5ff.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0538, "steps": 77 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/4995e8c730ee8819901115149d1bb625.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0734, "steps": 93 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/520cfa9227ef9a8499ea5907b0f1a23d.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1518, "steps": 222 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/597cff9f1dc565dac843b5ef236377f7.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1081, "steps": 167 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/5a2a0c8957f907ffd6d1208c9bc716c9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0687, "steps": 108 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/5c1973c9a7e767b15e43009917c6851e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0485, "steps": 65 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/5e8a70a24df8668e3eddea0531ad99e5.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0299, "steps": 64 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/5f56c6fcd7ff3a11c481090df3c059aa.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0225, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/6509b0d16bb80f07dff8caefc0884f3f.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0148, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/77c08f25814dcbff8b80bb9785ff47cf.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0332, "steps": 39 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/7df9a56da14d9dd93c12da0522e8e8b3.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0329, "steps": 80 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/80d8e9979c233523c50a19ebcad3be19.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1793, "steps": 252 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/8167f048a31fdace22ee03da7fa539af.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0209, "steps": 33 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/82b3f47a066db73685d212791359b54d.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.348, "steps": 212 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/8407ce0b26aeb833ba4fd8ce228a9e97.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0217, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/85c0b453bc87d1ad6dfe2aa142c4b0ba.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.2355, "steps": 267 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/951faf191dfc11e8fc646c586d96289c.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0784, "steps": 119 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/96fb69d76e3bb0eead37b4c7dd252322.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000126�13571573400�030520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.037, "steps": 38 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/99b2a99007595fd4779d0d783981aee6.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0693, "steps": 87 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/9a7791b227859785dd3658f3e00d05d2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0581, "steps": 65 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/9ade3e7bb7e61fe51ea8379e0903d0a3.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000125�13571573400�030517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.05, "steps": 95 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/9cf655198880bef2ca355ed1f121fc66.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1134, "steps": 135 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/9d2df333d71dd7cc761d785740777970.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.3665, "steps": 243 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/a01c8acaa455eb12c637dfaa78fb6281.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0537, "steps": 65 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/a2fed4c123e00a399b2a71264588ae3f.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000126�13571573400�030520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.053, "steps": 62 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/a4c1cf1b26ba59b95dce2092293d58df.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.2842, "steps": 323 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/a71babb73b425cb72938455297d27098.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.095, "steps": 139 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/a973ee94d22b5c133562523ebf227000.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0459, "steps": 48 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/b081be9daf7d73611002878d723b3594.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0342, "steps": 61 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/b6c50154bbca0d093a38a64d7c2bb3fe.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000126�13571573400�030520� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.017, "steps": 29 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/bb264654a0f79375e32e1f67e7065442.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0351, "steps": 73 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/bcd2f5408ea8fd10bdf1a0bde16708e0.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0701, "steps": 96 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/c11b57a25c76c5aefd4f4ca106023f8d.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0351, "steps": 54 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/c2cb928753e5eb6454e63f3c29c88ec5.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0746, "steps": 91 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/c5ca73eda7b61e6faf847606cdfcf53e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0736, "steps": 133 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/d14fb37372690722d97188281edbd253.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.082, "steps": 114 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/d9f6b94c2290c22af167ebadf0b9c8c6.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0245, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/dccefa8264c6127cfde9ab4406f616ce.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000130�13571573400�030513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0743, "steps": 121 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/df86e23aae9d67aa4641f46b44c3a1c6.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0402, "steps": 56 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/e601503a32df36981fc0563bd80c220e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0236, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/eacfb63f26eb59d486f4b27509498428.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0505, "steps": 82 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/f2ed0f1b93feba9c781bb7f0f2119c8e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0292, "steps": 74 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000220�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/cache/f5f0d5b17ac51b44de3a90bf08e03769.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.session/0000666�0000000�0000000�00000000127�13571573400�030521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0578, "steps": 77 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000152�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.c.0.report.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.c.0.report0000666�0000000�0000000�00000135660�13571573400�030526� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 58, "valid": 58, "rank": 60 }, "qed": { "total": 85, "valid": 85 }, "wp:main": { "total": 143, "valid": 143, "rank": 60 } }, "wp:functions": { "eq_string": { "eq_string_disjoint_not_eq_eq": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "eq_string_complete_not_eq_eq": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "eq_string_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "eq_string_assert_rte_mem_access_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "eq_string_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "eq_string_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 9 } }, "eq_string_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "eq_string_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "eq_string_assigns": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "eq_string_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "eq_string_not_eq_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 14 } }, "eq_string_eq_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "wp:main": { "total": 1, "valid": 1, "rank": 11 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 7, "valid": 7, "rank": 16 }, "qed": { "total": 11, "valid": 11 }, "wp:main": { "total": 18, "valid": 18, "rank": 15 } } }, "hash": { "hash_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "hash_assert_rte_mem_access_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "hash_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "hash_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "hash_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "hash_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "hash_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 12 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 10, "valid": 10, "rank": 12 } } }, "size": { "size_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "size_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "size_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 5 } } }, "init": { "init_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "init_assert_rte_mem_access_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 20 }, "wp:main": { "total": 1, "valid": 1, "rank": 20 } }, "init_assert_rte_index_bound_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_assert_rte_index_bound": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "init_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 9 } }, "init_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "init_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "init_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 11 } }, "init_loop_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "init_ensures_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "init_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 19 }, "wp:main": { "total": 1, "valid": 1, "rank": 19 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 8, "valid": 8, "rank": 19 }, "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 18, "valid": 18, "rank": 18 } } }, "add": { "hash_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "add_disjoint_full_nominal": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "add_complete_full_nominal": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 25 }, "wp:main": { "total": 1, "valid": 1, "rank": 25 } }, "add_assert_rte_signed_overflow_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 22 } }, "add_assert_rte_mem_access_7": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 20 }, "wp:main": { "total": 1, "valid": 1, "rank": 20 } }, "add_assert_rte_mem_access_6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 24 }, "wp:main": { "total": 1, "valid": 1, "rank": 24 } }, "add_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "wp:main": { "total": 1, "valid": 1, "rank": 21 } }, "add_assert_rte_mem_access_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "add_assert_rte_mem_access_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 20 }, "wp:main": { "total": 1, "valid": 1, "rank": 20 } }, "add_assert_rte_index_bound_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "add_assert_rte_mem_access_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "add_assert_rte_index_bound_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "add_assert_rte_mem_access_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 30 }, "wp:main": { "total": 1, "valid": 1, "rank": 30 } }, "add_assert_rte_index_bound_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "add_assert_rte_index_bound_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 17 }, "wp:main": { "total": 1, "valid": 1, "rank": 17 } }, "add_assert_rte_index_bound_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "add_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 32 }, "wp:main": { "total": 1, "valid": 1, "rank": 32 } }, "add_assert_rte_index_bound": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "add_nominal_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 20 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 10, "valid": 10, "rank": 20 } }, "add_full_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 18 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 10, "valid": 10, "rank": 18 } }, "add_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 19 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 10, "valid": 10, "rank": 19 } }, "add_full_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "add_nominal_ensures_5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 34 }, "wp:main": { "total": 1, "valid": 1, "rank": 34 } }, "add_nominal_ensures_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 22 } }, "add_nominal_ensures_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 33 }, "wp:main": { "total": 1, "valid": 1, "rank": 33 } }, "add_nominal_ensures_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 24 }, "wp:main": { "total": 1, "valid": 1, "rank": 24 } }, "add_nominal_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 24, "valid": 24, "rank": 34 }, "qed": { "total": 30, "valid": 30 }, "wp:main": { "total": 54, "valid": 54, "rank": 34 } } }, "mem_binding": { "eq_string_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 23 }, "wp:main": { "total": 1, "valid": 1, "rank": 23 } }, "eq_string_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "hash_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "mem_binding_disjoint_not_found_found": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 36 }, "wp:main": { "total": 1, "valid": 1, "rank": 36 } }, "mem_binding_complete_not_found_found": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "mem_binding_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "mem_binding_assert_rte_mem_access_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 29 }, "wp:main": { "total": 1, "valid": 1, "rank": 29 } }, "mem_binding_assert_rte_index_bound_10": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "mem_binding_assert_rte_index_bound_9": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "mem_binding_assert_rte_index_bound_8": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "mem_binding_assert_rte_index_bound_7": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "mem_binding_assert_rte_mem_access_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 35 }, "wp:main": { "total": 1, "valid": 1, "rank": 35 } }, "mem_binding_assert_rte_index_bound_6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 18 }, "wp:main": { "total": 1, "valid": 1, "rank": 18 } }, "mem_binding_assert_rte_index_bound_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "mem_binding_assert_rte_index_bound_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "mem_binding_assert_rte_index_bound_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "mem_binding_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 33 }, "wp:main": { "total": 1, "valid": 1, "rank": 33 } }, "mem_binding_assert_rte_index_bound_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 17 }, "wp:main": { "total": 1, "valid": 1, "rank": 17 } }, "mem_binding_assert_rte_index_bound": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 17 }, "wp:main": { "total": 1, "valid": 1, "rank": 17 } }, "mem_binding_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 15 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 15 } }, "mem_binding_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 15 }, "wp:main": { "total": 2, "valid": 2, "rank": 15 } }, "mem_binding_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "mem_binding_assigns": { "qed": { "total": 11, "valid": 11 }, "wp:main": { "total": 11, "valid": 11 } }, "mem_binding_loop_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "mem_binding_not_found_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 60 }, "wp:main": { "total": 1, "valid": 1, "rank": 60 } }, "mem_binding_found_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 52 }, "wp:main": { "total": 1, "valid": 1, "rank": 52 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 15, "valid": 15, "rank": 60 }, "qed": { "total": 25, "valid": 25 }, "wp:main": { "total": 40, "valid": 40, "rank": 60 } } } } } ��������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.res.oracle0000666�0000000�0000000�00000042113�13571573400�030657� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_gallery/frama_c_hashtbl_solved.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Computing [100 goals...] [wp] 102 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_add_complete_full_nominal : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_disjoint_full_nominal : Valid [wp] [Qed] Goal typed_add_assigns_exit : Valid [wp] [Qed] Goal typed_add_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assigns_normal_part6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assigns_normal_part7 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part8 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part9 : Valid [wp] [Qed] Goal typed_add_call_hash_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_full_ensures : Valid [wp] [Qed] Goal typed_add_full_assigns_exit : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_full_assigns_normal_part6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_full_assigns_normal_part7 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_full_assigns_normal_part8 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part9 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures_4 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures_5 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_exit : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_assigns_normal_part6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_assigns_normal_part7 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part8 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part9 : Valid [wp] [Qed] Goal typed_eq_string_complete_not_eq_eq : Valid [wp] [Qed] Goal typed_eq_string_disjoint_not_eq_eq : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_eq_string_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_eq_string_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_eq_string_loop_assigns : Valid [wp] [Qed] Goal typed_eq_string_assigns_part1 : Valid [wp] [Qed] Goal typed_eq_string_assigns_part2 : Valid [wp] [Qed] Goal typed_eq_string_assigns_part3 : Valid [wp] [Qed] Goal typed_eq_string_assigns_part4 : Valid [wp] [Qed] Goal typed_eq_string_loop_variant_decrease : Valid [wp] [Qed] Goal typed_eq_string_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_eq_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_not_eq_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_hash_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_hash_loop_invariant_established : Valid [wp] [Qed] Goal typed_hash_loop_assigns : Valid [wp] [Qed] Goal typed_hash_assigns_part1 : Valid [wp] [Qed] Goal typed_hash_assigns_part2 : Valid [wp] [Qed] Goal typed_hash_loop_variant_decrease : Valid [wp] [Qed] Goal typed_hash_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_init_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_init_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_init_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_init_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_init_assigns_part1 : Valid [wp] [Qed] Goal typed_init_assigns_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_assigns_part3 : Valid [wp] [Qed] Goal typed_init_loop_variant_decrease : Valid [wp] [Qed] Goal typed_init_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_complete_not_found_found : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_disjoint_not_found_found : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_loop_invariant_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_mem_binding_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_mem_binding_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_mem_binding_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_exit_part4 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part5 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part6 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part7 : Valid [wp] [Qed] Goal typed_mem_binding_loop_variant_decrease : Valid [wp] [Qed] Goal typed_mem_binding_loop_variant_positive : Valid [wp] [Qed] Goal typed_mem_binding_call_hash_requires : Valid [wp] [Qed] Goal typed_mem_binding_call_eq_string_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_call_eq_string_requires_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_found_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_not_found_ensures : Valid [wp] [Qed] Goal typed_size_ensures : Valid [wp] [Qed] Goal typed_size_assigns : Valid [wp] Proved goals: 102 / 102 Qed: 69 Alt-Ergo 2.0.0: 33 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_hashtbl_solved.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success eq_string 11 4 (52..64) 15 100% hash 6 1 (12..24) 7 100% size 2 - 2 100% init 8 5 (80..104) 13 100% add 24 15 (224..272) 39 100% mem_binding 18 8 (800..896) 26 100% ------------------------------------------------------------- [wp] Running WP plugin... [rte] annotating function add [rte] annotating function eq_string [rte] annotating function hash [rte] annotating function init [rte] annotating function mem_binding [rte] annotating function size [wp] 143 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_add_complete_full_nominal : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_disjoint_full_nominal : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assert_rte_index_bound : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_add_assert_rte_index_bound_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assert_rte_index_bound_3 : Valid [wp] [Qed] Goal typed_add_assert_rte_index_bound_4 : Valid [wp] [Qed] Goal typed_add_assert_rte_index_bound_5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assert_rte_mem_access_2 : Valid [wp] [Qed] Goal typed_add_assert_rte_mem_access_3 : Valid [wp] [Qed] Goal typed_add_assert_rte_index_bound_6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assert_rte_mem_access_4 : Valid [wp] [Qed] Goal typed_add_assert_rte_mem_access_5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assert_rte_signed_overflow : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assert_rte_mem_access_6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assert_rte_mem_access_7 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assert_rte_signed_overflow_2 : Valid [wp] [Qed] Goal typed_add_assigns_exit : Valid [wp] [Qed] Goal typed_add_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assigns_normal_part6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_assigns_normal_part7 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part8 : Valid [wp] [Qed] Goal typed_add_assigns_normal_part9 : Valid [wp] [Qed] Goal typed_add_call_hash_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_full_ensures : Valid [wp] [Qed] Goal typed_add_full_assigns_exit : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_full_assigns_normal_part6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_full_assigns_normal_part7 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_full_assigns_normal_part8 : Valid [wp] [Qed] Goal typed_add_full_assigns_normal_part9 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures_4 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_ensures_5 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_exit : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_assigns_normal_part6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_add_nominal_assigns_normal_part7 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part8 : Valid [wp] [Qed] Goal typed_add_nominal_assigns_normal_part9 : Valid [wp] [Qed] Goal typed_eq_string_complete_not_eq_eq : Valid [wp] [Qed] Goal typed_eq_string_disjoint_not_eq_eq : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_eq_string_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_eq_string_loop_invariant_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_assert_rte_mem_access : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_assert_rte_mem_access_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_assert_rte_signed_overflow : Valid [wp] [Qed] Goal typed_eq_string_loop_assigns : Valid [wp] [Qed] Goal typed_eq_string_assigns_part1 : Valid [wp] [Qed] Goal typed_eq_string_assigns_part2 : Valid [wp] [Qed] Goal typed_eq_string_assigns_part3 : Valid [wp] [Qed] Goal typed_eq_string_assigns_part4 : Valid [wp] [Qed] Goal typed_eq_string_loop_variant_decrease : Valid [wp] [Qed] Goal typed_eq_string_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_eq_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_eq_string_not_eq_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_hash_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_hash_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_hash_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_hash_assert_rte_mem_access_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_hash_assert_rte_signed_overflow : Valid [wp] [Qed] Goal typed_hash_loop_assigns : Valid [wp] [Qed] Goal typed_hash_assigns_part1 : Valid [wp] [Qed] Goal typed_hash_assigns_part2 : Valid [wp] [Qed] Goal typed_hash_loop_variant_decrease : Valid [wp] [Qed] Goal typed_hash_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_assert_rte_mem_access : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_init_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_init_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_init_assert_rte_index_bound : Valid [wp] [Qed] Goal typed_init_assert_rte_index_bound_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_assert_rte_mem_access_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_assert_rte_signed_overflow : Valid [wp] [Qed] Goal typed_init_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_init_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_init_assigns_part1 : Valid [wp] [Qed] Goal typed_init_assigns_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_assigns_part3 : Valid [wp] [Qed] Goal typed_init_loop_variant_decrease : Valid [wp] [Qed] Goal typed_init_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_complete_not_found_found : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_disjoint_not_found_found : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_loop_invariant_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_mem_binding_loop_invariant_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_assert_rte_index_bound : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_assert_rte_index_bound_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_mem_binding_assert_rte_index_bound_3 : Valid [wp] [Qed] Goal typed_mem_binding_assert_rte_index_bound_4 : Valid [wp] [Qed] Goal typed_mem_binding_assert_rte_index_bound_5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_assert_rte_index_bound_6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_assert_rte_mem_access_2 : Valid [wp] [Qed] Goal typed_mem_binding_assert_rte_index_bound_7 : Valid [wp] [Qed] Goal typed_mem_binding_assert_rte_index_bound_8 : Valid [wp] [Qed] Goal typed_mem_binding_assert_rte_index_bound_9 : Valid [wp] [Qed] Goal typed_mem_binding_assert_rte_index_bound_10 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_assert_rte_mem_access_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_assert_rte_signed_overflow : Valid [wp] [Qed] Goal typed_mem_binding_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_mem_binding_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_exit_part4 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part5 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part6 : Valid [wp] [Qed] Goal typed_mem_binding_assigns_normal_part7 : Valid [wp] [Qed] Goal typed_mem_binding_loop_variant_decrease : Valid [wp] [Qed] Goal typed_mem_binding_loop_variant_positive : Valid [wp] [Qed] Goal typed_mem_binding_call_hash_requires : Valid [wp] [Qed] Goal typed_mem_binding_call_eq_string_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_call_eq_string_requires_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_found_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mem_binding_not_found_ensures : Valid [wp] [Qed] Goal typed_size_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_size_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_size_assigns : Valid [wp] Proved goals: 74 / 143 Qed: 16 Alt-Ergo 2.0.0: 58 [wp] Report in: 'tests/wp_gallery/oracle_qualif/frama_c_hashtbl_solved.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/frama_c_hashtbl_solved.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success eq_string 11 7 (56..80) 18 100% hash 7 3 (44..56) 10 100% size 2 1 (16..28) 3 100% init 10 8 (88..112) 18 100% add 30 24 (224..272) 54 100% mem_binding 25 15 (800..896) 40 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/��������0000777�0000000�0000000�00000000000�13571573400�027021� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/cache/��0000777�0000000�0000000�00000000000�13571573400�030064� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000210�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/cache/03fec2b350050f7ad0a32911983f92d4.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/cache/030000666�0000000�0000000�00000000127�13571573400�030231� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0148, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000210�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/cache/5c915923b8d3f16e0dddab272de43d35.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/cache/5c0000666�0000000�0000000�00000000130�13571573400�030310� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.7756, "steps": 557 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000210�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/cache/e0b73b1d74026acf8109d693b6475ba1.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/cache/e00000666�0000000�0000000�00000000127�13571573400�030313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.036, "steps": 100 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000210�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/cache/f4b6619cc6bf4e20fdcbc3c6a85e42b0.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.0.session/cache/f40000666�0000000�0000000�00000000127�13571573400�030320� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0388, "steps": 69 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.c.0.report.json���0000666�0000000�0000000�00000012317�13571573400�027771� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 4, "rank": 51 }, "qed": { "total": 11, "valid": 11 }, "wp:main": { "total": 15, "valid": 15, "rank": 50 } }, "wp:axiomatics": { "Ploop": { "lemma_Lb": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 51 }, "wp:main": { "total": 1, "valid": 1, "rank": 50 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 51 }, "wp:main": { "total": 1, "valid": 1, "rank": 50 } } } }, "wp:functions": { "loop_statement": { "loop_statement_loop_invariant_Iloop": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 16 }, "wp:main": { "total": 2, "valid": 2, "rank": 16 } }, "loop_statement_assigns_2": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "loop_statement_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "loop_statement_loop_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "loop_statement_ensures_Sbody": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "loop_statement_requires_Scond": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "loop_statement_requires_Rinv": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 20 }, "wp:main": { "total": 1, "valid": 1, "rank": 20 } }, "loop_statement_ensures_Sloop": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "loop_statement_ensures_Scond": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 20 }, "qed": { "total": 11, "valid": 11 }, "wp:main": { "total": 14, "valid": 14, "rank": 20 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_gallery/oracle_qualif/loop-statement.res.oracle��������0000666�0000000�0000000�00000003471�13571573400�027165� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_gallery/loop-statement.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 15 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_Lb : Valid [wp] [Qed] Goal typed_loop_statement_ensures_Scond : Valid [wp] [Qed] Goal typed_loop_statement_ensures_Sloop : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_loop_statement_loop_invariant_Iloop_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_loop_statement_loop_invariant_Iloop_established : Valid [wp] [Qed] Goal typed_loop_statement_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_loop_statement_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_loop_statement_assigns_2_exit_part1 : Valid [wp] [Qed] Goal typed_loop_statement_assigns_2_exit_part2 : Valid [wp] [Qed] Goal typed_loop_statement_assigns_2_normal_part1 : Valid [wp] [Qed] Goal typed_loop_statement_assigns_2_normal_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_loop_statement_requires_Rinv : Valid [wp] [Qed] Goal typed_loop_statement_requires_Scond : Valid [wp] [Qed] Goal typed_loop_statement_ensures_Sbody : Valid [wp] [Qed] Goal typed_loop_statement_assigns : Valid [wp] Proved goals: 15 / 15 Qed: 11 Alt-Ergo 2.0.0: 4 [wp] Report in: 'tests/wp_gallery/oracle_qualif/loop-statement.0.report.json' [wp] Report out: 'tests/wp_gallery/result_qualif/loop-statement.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic Ploop - 1 (512..608) 1 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success loop_statement 11 3 (88..112) 14 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/�������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017057� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/byref.i������������������������������������������0000666�0000000�0000000�00000001466�13571573400�020347� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: OPT: -wp-model +ref */ /* run.config_qualif OPT: OPT: -wp-model +ref */ /*@ requires \valid(r); ensures *r == 1 ; assigns *r ; */ void f(int *r) { *r = 1 ; } // Pre-condition of f holds only when q is used ByRef /*@ ensures \result == 1 ; */ int wrong_without_ref(int * q) { f(q) ; return *q ; } // Pre-condition of f always holds /*@ requires \valid(q); ensures \result == 1 ; */ int pointer(int * q) { f(q) ; return *q ; } // Pre-condition of f always holds //@ ensures \result == 1 ; int local() { int u ; f(&u) ; return u ; } // Pre-condition of f always holds //@ ensures \result == 1 ; int formal(int v) { f(&v) ; return v ; } int g ; // Pre-condition of f always holds //@ ensures \result == 1 ; int global(void) { f(&g) ; return g ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/dispatch_var.i�����������������������������������0000666�0000000�0000000�00000006022�13571573400�021700� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref -wp-msg-key refusage */ /* run.config_qualif OPT: -wp-model +ref */ /*@ assigns \nothing ; ensures \result == *p ; */ int ref_ctr(int * p); int r1 ; /*@ assigns r1; ensures Ref_r1 : \result == 4; */ int call_ref_ctr (void) { r1 = 4 ; return ref_ctr(&r1); } int n1; /*@ assigns n1; ensures Mem_n1 :\result == 4; */ int call_ref_ctr2 (void) { int * s ; s = &n1 ; n1 = 4 ; if (ref_ctr(&n1) == 4) return *s; else return n1; } /*----------------------------------------*/ /*@ assigns \nothing ; ensures \result == *q; */ int ref_bd (int * q) { return *q; } int r2 ; /*@ assigns r2; ensures Ref_r2 : \result == 4; */ int call_ref_bd (void) { r2 = 4 ; return ref_bd(&r2); } int n2; /*@ assigns n2; ensures Mem_n2 :\result == 4; */ int call_ref_bd2 (void) { int * p ; p = &n2 ; n2 = 4 ; if (ref_bd(&n2) == 4) return *p; else return n1; } /*---------------------------------------*/ /*@ requires \valid(p1); assigns \nothing; ensures \result == *p1; */ int ref_valid (int *p1); int r7, n4 ; /*@ assigns r7,n4; ensures R7_N4: \result == 8; */ int call_ref_valid(void) { int * p ; r7 = 4; n4 = 4; p = &n4; return (ref_valid(&r7)+ ref_valid(&n4)); } /*---------------------------------------*/ /*@ assigns \nothing; ensures \result == *q1; */ int no_ref_bd(int *q1) { int * q ; q = q1+1 ; return *q1; } int n5, nr6 ; /*@ assigns n5,nr6; ensures Mem_n5_nr6 :\result == 8; */ int call_no_ref_bd(void) { int * p ; n5 = 4; nr6 = 4; p = &n5; return (no_ref_bd(&n5)+ no_ref_bd(&nr6)); } /*---------------------------------------*/ /*@ requires \valid(ref); assigns \nothing ; ensures \result == *ref1 + *ref2; */ int ref_ctr_nr(int *ref, int *ref1,int *ref2); int r5,r6; int f3,r4; /*@ requires \valid(&r6); assigns f3,r4, r6; ensures R_R_R : r5 == 0 ==> \result == 4; ensures R_R_R : r5 != 0 ==> \result == 4; */ int call_ref_ctr_nr(void) { f3 =2 ; r4 = 2 ; r6 = 2; int k; if (r5 == 0) k = f3 ; else k = r6; return ref_ctr_nr(&r5,&k,&r4); } /*---------------------------------------*/ /*@ assigns \nothing ; ensures \result == **pp ; */ int ref_ctr_nstars(int **pp); /*@ assigns \nothing ; ensures \result == 4; */ int call_ref_ctr_nstars(void) { int x; x = 4 ; int * px = &x; return ref_ctr_nstars(&px); } /*-------------------------------*/ int r0; /*@ assigns r0; ensures \result == 8; */ int call_two_ref(void) { r0 = 4; return (ref_bd(&r0)+ref_ctr(&r0)) ; } /*-------------------------------*/ /*@ requires *pg == 4; assigns \nothing; ensures \result == 4 ; */ int g (int *pg) { return ref_bd(pg); } /*-------------------------------*/ struct S { int tab[10]; int k;}; /*@ requires \valid(sf.tab+(0..5)); assigns \nothing; ensures Pload2 : \forall integer j; 0<=j<5 ==> \result.tab[j] == sf.tab[j] ; */ struct S array_in_struct_param(struct S sf){return sf;} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/dispatch_var2.i����������������������������������0000666�0000000�0000000�00000002013�13571573400�021756� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref -wp-no-let OPT: -wp-model +ref -wp-let */ /* run.config_qualif OPT: -wp-model +ref -wp-no-let OPT: -wp-model +ref -wp-let */ /*@ requires \valid(rp); assigns *rp; ensures *rp == 0; */ void reset (int *rp) {*rp = 0;} /*@ requires \valid(ip); assigns *ip; ensures *ip == \old(*ip)+1; */ void incr (int *ip) {*ip=*ip+1;} /*@ requires \valid(lp); assigns \nothing; ensures \result == *lp ; */ int load (int *lp) {return *lp;} int x; /*@ assigns x; ensures \result == 0; */ int call_global (void) { reset(&x); return (load(&x)); } /*@ requires \valid(&y); assigns \nothing; ensures \result == 0; */ int call_param (int y) { reset(&y); return (load(&y)); } /*@ assigns \nothing; ensures \result == 0; */ int call_local(void) { int z; reset(&z); return (load(&z)); } /*@ requires \valid(q); assigns *q; ensures \result == 0; */ int call_param_ref (int *q) { reset(q); return (load(q)); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/isHoare.i����������������������������������������0000666�0000000�0000000�00000000456�13571573400�020630� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref */ /* run.config_qualif OPT: -wp -wp-par 1 -wp-model +ref */ /*@ ensures ok : \result == 0 || \result == 1; */ int cmp_invalid_addr_as_int (void) { int p; int q; { int x=1 ; p = (int) &x ; } { int y=2 ; q = (int) &y ; } return (p == q) ? 1 : 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/logicarr.i���������������������������������������0000666�0000000�0000000�00000001326�13571573400�021035� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: */ /* run.config_qualif OPT: -wp -wp-par 1 */ /*@ predicate p_pointer{L1,L2}(int *a,int i,int j) = \at(a[i],L1) == \at(a[j],L2) ; */ // ARRAY PASSED BY VALUES /*@ predicate p_arrays(int a[10],int i,int b[10],int j) = a[i] == b[j] ; */ // USELESS LABELS and USELESS \AT /*@ predicate p_dummy{L1,L2}(int a[10],int i,int j) = \at(a[i],L1) == \at(a[j],L2) ; */ int arr[10]; /*@ requires 0 <= i < 10; requires 0 <= j < 10; requires 0 <= k < 10; ensures PTR: p_pointer{Pre,Here}((int *)arr,i,j); ensures ARR: p_arrays(\old(arr),i,arr,j); ensures DUM: p_dummy{Pre,Here}(arr,j,k); */ void job(i,j,k) { int tmp = arr[i]; arr[i] = arr[j] ; arr[j] = tmp ; arr[k] = tmp ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/logicref.i���������������������������������������0000666�0000000�0000000�00000000664�13571573400�021031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref */ /* run.config_qualif OPT: -wp-model +ref */ //@ predicate vrange(int *p1,integer n) = \valid(p1+(0..n-1)) ; //@ requires vrange(a,k) && 0<=i<k ; assigns a[i];ensures a[i] == 0 ; void fvrange_n (int *a,int i,int k) { //@ assert \valid(a+i); a[i] = 0 ; } //@ predicate P(integer b) = b == 0 ; //@ requires P(x) ; assigns \nothing; ensures P(\result) ; int gcd(int x) {return x;} ����������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/logicref_simple.i��������������������������������0000666�0000000�0000000�00000001455�13571573400�022401� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref -wp-msg-key refusage */ /* run.config_qualif OPT: -wp-model +ref */ //@ predicate simple (int * p3) = *p3 == 0; //@ predicate simple_array (int * p4) = p4[3] == 0; //@ predicate two_star(int **p) = simple(*p); //@ predicate vpositive (int *p2) = \valid(p2) && *p2 >= 0 ; //@ requires simple(c) ; assigns \nothing ; ensures \result == 1; int fsimple (int *c) {return *c+1;} int t[10]; //@ requires simple_array(&(t[0])); assigns \nothing ; ensures \result == 1 ; int fsimple_array (void) {return t[3]+1;} //@ requires two_star(d) ; assigns \nothing ; ensures \result == 1; int ftwo_star (int **d) {return **d+1;} //@ requires vpositive(b) ; assigns *b;ensures *b == 0; void fvpositive (int *b) { // OK for ref model only //@ assert OK: \valid(b); *b = 0 ; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020324� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/byref.0.res.oracle������������������������0000666�0000000�0000000�00000006310�13571573400�023550� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_hoare/byref.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 12) in 'f': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/byref.i, line 13) in 'f': Effect at line 14 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function formal ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 47) in 'formal': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'formal' at call 'f' (file tests/wp_hoare/byref.i, line 50) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function global ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 57) in 'global': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'global' at call 'f' (file tests/wp_hoare/byref.i, line 60) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function local ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 38) in 'local': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'local' at call 'f' (file tests/wp_hoare/byref.i, line 42) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function pointer ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 29) in 'pointer': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'pointer' at call 'f' (file tests/wp_hoare/byref.i, line 33) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function wrong_without_ref ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 18) in 'wrong_without_ref': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'wrong_without_ref' at call 'f' (file tests/wp_hoare/byref.i, line 22) : Assume { (* Heap *) Have: (region(q.base) <= 0) /\ linked(Malloc_0). } Prove: valid_rw(Malloc_0, q, 1). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/byref.1.res.oracle������������������������0000666�0000000�0000000�00000007016�13571573400�023555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/byref.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 12) in 'f': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/byref.i, line 13) in 'f': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function formal ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 47) in 'formal': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'formal' at call 'f' (file tests/wp_hoare/byref.i, line 50) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function global ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 57) in 'global': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'global' at call 'f' (file tests/wp_hoare/byref.i, line 60) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function local ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 38) in 'local': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'local' at call 'f' (file tests/wp_hoare/byref.i, line 42) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function pointer ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 29) in 'pointer': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'pointer' at call 'f' (file tests/wp_hoare/byref.i, line 33) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function wrong_without_ref ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/byref.i, line 18) in 'wrong_without_ref': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/byref.i, line 11) in 'f'' in 'wrong_without_ref' at call 'f' (file tests/wp_hoare/byref.i, line 22) : Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'f': /*@ behavior typed_ref: requires \valid(r); */ void f(int *r); [wp] Warning: Memory model hypotheses for function 'wrong_without_ref': /*@ behavior typed_ref: requires \valid(q); */ int wrong_without_ref(int *q); [wp] Warning: Memory model hypotheses for function 'pointer': /*@ behavior typed_ref: requires \valid(q); */ int pointer(int *q); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/dispatch_var.res.oracle�������������������0000666�0000000�0000000�00000037346�13571573400�024767� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/dispatch_var.i (no preprocessing) [wp] Running WP plugin... ................................................. ... Ref Usage ................................................. Init: { } Function ref_ctr: { *p } Function call_ref_ctr: { r1 tmp } Function call_ref_ctr2: { &n1 s tmp __retres } Function ref_bd: { *q __retres } Function call_ref_bd: { r2 tmp } Function call_ref_bd2: { n1 &n2 p tmp __retres } Function ref_valid: { *p1 } Function call_ref_valid: { r7 &n4 p tmp tmp_0 __retres } Function no_ref_bd: { q1 q __retres } Function call_no_ref_bd: { &n5 nr6 p tmp tmp_0 __retres } Function ref_ctr_nr: { *ref *ref1 *ref2 } Function call_ref_ctr_nr: { r5 r6 f3 r4 k tmp } Function ref_ctr_nstars: { *pp } Function call_ref_ctr_nstars: { &x px tmp } Function call_two_ref: { r0 tmp tmp_0 __retres } Function g: { *pg tmp } Function array_in_struct_param: { sf } ................................................. [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function array_in_struct_param ------------------------------------------------------------ Goal Post-condition 'Pload2' in 'array_in_struct_param': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'array_in_struct_param': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_no_ref_bd ------------------------------------------------------------ Goal Post-condition 'Mem_n5_nr6' in 'call_no_ref_bd': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 114) in 'call_no_ref_bd' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 114) in 'call_no_ref_bd' (2/3): Effect at line 121 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 114) in 'call_no_ref_bd' (3/3): Call Result at line 122 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 114) in 'call_no_ref_bd' (1/5): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 114) in 'call_no_ref_bd' (2/5): Effect at line 121 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 114) in 'call_no_ref_bd' (3/5): Call Result at line 122 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 114) in 'call_no_ref_bd' (4/5): Call Result at line 123 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 114) in 'call_no_ref_bd' (5/5): Effect at line 122 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_ref_bd ------------------------------------------------------------ Goal Post-condition 'Ref_r2' in 'call_ref_bd': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 51) in 'call_ref_bd': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 51) in 'call_ref_bd' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 51) in 'call_ref_bd' (2/2): Call Result at line 57 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_ref_bd2 ------------------------------------------------------------ Goal Post-condition 'Mem_n2' in 'call_ref_bd2': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 63) in 'call_ref_bd2' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 63) in 'call_ref_bd2' (2/2): Effect at line 68 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 63) in 'call_ref_bd2' (1/5): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 63) in 'call_ref_bd2' (2/5): Effect at line 68 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 63) in 'call_ref_bd2' (3/5): Call Result at line 70 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 63) in 'call_ref_bd2' (4/5): Effect at line 70 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 63) in 'call_ref_bd2' (5/5): Effect at line 71 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_ref_ctr ------------------------------------------------------------ Goal Post-condition 'Ref_r1' in 'call_ref_ctr': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 17) in 'call_ref_ctr': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 17) in 'call_ref_ctr' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 17) in 'call_ref_ctr' (2/2): Call Result at line 23 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_ref_ctr2 ------------------------------------------------------------ Goal Post-condition 'Mem_n1' in 'call_ref_ctr2': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 28) in 'call_ref_ctr2' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 28) in 'call_ref_ctr2' (2/2): Effect at line 33 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 28) in 'call_ref_ctr2' (1/5): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 28) in 'call_ref_ctr2' (2/5): Effect at line 33 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 28) in 'call_ref_ctr2' (3/5): Call Result at line 35 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 28) in 'call_ref_ctr2' (4/5): Effect at line 35 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 28) in 'call_ref_ctr2' (5/5): Effect at line 36 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_ref_ctr_nr ------------------------------------------------------------ Goal Post-condition 'R_R_R' in 'call_ref_ctr_nr': Prove: true. ------------------------------------------------------------ Goal Post-condition 'R_R_R' in 'call_ref_ctr_nr': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 139) in 'call_ref_ctr_nr' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 139) in 'call_ref_ctr_nr' (2/3): Effect at line 147 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 139) in 'call_ref_ctr_nr' (3/3): Effect at line 147 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 139) in 'call_ref_ctr_nr' (1/4): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 139) in 'call_ref_ctr_nr' (2/4): Effect at line 147 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 139) in 'call_ref_ctr_nr' (3/4): Effect at line 147 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 139) in 'call_ref_ctr_nr' (4/4): Call Result at line 148 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var.i, line 129) in 'ref_ctr_nr'' in 'call_ref_ctr_nr' at call 'ref_ctr_nr' (file tests/wp_hoare/dispatch_var.i, line 148) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_ref_ctr_nstars ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var.i, line 162) in 'call_ref_ctr_nstars': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_ref_ctr_nstars' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_ref_ctr_nstars' (2/2): Effect at line 167 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_ref_ctr_nstars' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_ref_ctr_nstars' (2/3): Effect at line 167 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_ref_ctr_nstars' (3/3): Call Result at line 169 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_ref_valid ------------------------------------------------------------ Goal Post-condition 'R7_N4' in 'call_ref_valid': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 87) in 'call_ref_valid' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 87) in 'call_ref_valid' (2/3): Effect at line 94 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 87) in 'call_ref_valid' (3/3): Call Result at line 95 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 87) in 'call_ref_valid' (1/5): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 87) in 'call_ref_valid' (2/5): Effect at line 94 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 87) in 'call_ref_valid' (3/5): Call Result at line 95 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 87) in 'call_ref_valid' (4/5): Call Result at line 96 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 87) in 'call_ref_valid' (5/5): Effect at line 95 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var.i, line 79) in 'ref_valid'' in 'call_ref_valid' at call 'ref_valid' (file tests/wp_hoare/dispatch_var.i, line 95) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var.i, line 79) in 'ref_valid'' in 'call_ref_valid' at call 'ref_valid' (file tests/wp_hoare/dispatch_var.i, line 96) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_two_ref ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var.i, line 177) in 'call_two_ref': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 176) in 'call_two_ref' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 176) in 'call_two_ref' (2/2): Call Result at line 182 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 176) in 'call_two_ref' (1/4): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 176) in 'call_two_ref' (2/4): Call Result at line 182 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 176) in 'call_two_ref' (3/4): Call Result at line 182 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var.i, line 176) in 'call_two_ref' (4/4): Effect at line 182 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var.i, line 192) in 'g': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (2/2): Call Result at line 195 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function no_ref_bd ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var.i, line 104) in 'no_ref_bd': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'no_ref_bd' (1/2): Effect at line 108 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'no_ref_bd' (2/2): Effect at line 109 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function ref_bd ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var.i, line 42) in 'ref_bd': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'ref_bd': Effect at line 46 Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'ref_bd': /*@ behavior typed_ref: requires \valid(q); */ int ref_bd(int *q); [wp] Warning: Memory model hypotheses for function 'g': /*@ behavior typed_ref: requires \valid(pg); */ int g(int *pg); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/dispatch_var2.0.res.oracle����������������0000666�0000000�0000000�00000031333�13571573400�025175� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' -wp-no-let [...] [kernel] Parsing tests/wp_hoare/dispatch_var2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function call_global ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 37) in 'call_global': Assume { Type: is_sint32(call_global_0) /\ is_sint32(load_0) /\ is_sint32(tmp_0) /\ is_sint32(x). (* Block In *) Have: (ta_tmp_0=false). (* Call 'reset' *) Have: x = 0. (* Call 'load' *) Have: (tmp_0 = load_0) /\ (x = load_0). (* Return *) Have: tmp_0 = call_global_0. } Prove: call_global_0 = 0. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 36) in 'call_global': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 36) in 'call_global' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 36) in 'call_global' (2/2): Call Result at line 42 Assume { Type: is_sint32(load_0) /\ is_sint32(tmp_0) /\ is_sint32(x). Have: (ta_tmp_1=true) <-> (ta_tmp_0=true). (* Block In *) Have: (ta_tmp_1=false). (* Call 'reset' *) Have: x = 0. (* Call 'load' *) Have: x = load_0. } Prove: (ta_tmp_0=false). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 12) in 'reset'' in 'call_global' at call 'reset' (file tests/wp_hoare/dispatch_var2.i, line 41) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 27) in 'load'' in 'call_global' at call 'load' (file tests/wp_hoare/dispatch_var2.i, line 42) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_local ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 56) in 'call_local': Assume { Type: is_sint32(call_local_0) /\ is_sint32(load_0) /\ is_sint32(tmp_0) /\ is_sint32(z). (* Block In *) Have: (ta_tmp_0=false) /\ (ta_z_0=false). (* Call 'reset' *) Have: z = 0. (* Call 'load' *) Have: (tmp_0 = load_0) /\ (z = load_0). (* Return *) Have: tmp_0 = call_local_0. } Prove: call_local_0 = 0. ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (2/2): Call Effect at line 61 Assume { Type: is_sint32(status_0) /\ is_sint32(status_1) /\ is_sint32(z). Have: (ta_z_1=true) <-> (ta_z_0=true). (* Block In *) Have: (ta_tmp_0=false) /\ (ta_z_1=false). (* Merge *) Either { Case: (* Call 'reset' *) Have: z = 0. Case: } } Prove: (ta_z_0=false). ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (2/3): Call Effect at line 61 Assume { Type: is_sint32(z). Have: (ta_z_1=true) <-> (ta_z_0=true). (* Block In *) Have: (ta_tmp_0=false) /\ (ta_z_1=false). (* Call 'reset' *) Have: z = 0. } Prove: (ta_z_0=false). ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (3/3): Call Result at line 62 Assume { Type: is_sint32(load_0) /\ is_sint32(tmp_0) /\ is_sint32(z). Have: (ta_tmp_1=true) <-> (ta_tmp_0=true). (* Block In *) Have: (ta_tmp_1=false) /\ (ta_z_0=false). (* Call 'reset' *) Have: z = 0. (* Call 'load' *) Have: z = load_0. } Prove: (ta_tmp_0=false). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 12) in 'reset'' in 'call_local' at call 'reset' (file tests/wp_hoare/dispatch_var2.i, line 61) : Assume { (* Block In *) Have: (ta_tmp_0=false) /\ (ta_z_0=true) /\ (ta_z_1=false). } Prove: (ta_z_0=true). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 27) in 'load'' in 'call_local' at call 'load' (file tests/wp_hoare/dispatch_var2.i, line 62) : Assume { Type: is_sint32(z). (* Block In *) Have: (ta_tmp_0=false) /\ (ta_z_0=true) /\ (ta_z_1=false). (* Call 'reset' *) Have: (ta_z_0=true) /\ (z = 0). } Prove: (ta_z_0=true). ------------------------------------------------------------ ------------------------------------------------------------ Function call_param ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 47) in 'call_param': Assume { Type: is_sint32(call_param_0) /\ is_sint32(load_0) /\ is_sint32(tmp_0) /\ is_sint32(y). (* Pre-condition *) Have: (ta_y_0=true). (* Pre-condition *) Have: (ta_y_0=true). (* Function Frame *) Have: (ta_y_1=true) /\ (ta_y_0=false). (* Block In *) Have: (ta_tmp_0=false). Have: (ta_y_1=true) <-> (ta_y_2=true). (* Call 'reset' *) Have: (ta_y_1=true) /\ (y = 0). Have: (ta_y_2=true) <-> (ta_y_3=true). (* Call 'load' *) Have: (ta_y_2=true) /\ (tmp_0 = load_0) /\ (y = load_0). (* Return *) Have: tmp_0 = call_param_0. (* Function Exit *) Have: (ta_y_3=true). } Prove: call_param_0 = 0. ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (2/2): Call Effect at line 51 Assume { Type: is_sint32(status_0) /\ is_sint32(status_1) /\ is_sint32(y). Have: (ta_y_1=true) <-> (ta_y_0=true). (* Pre-condition *) Have: (ta_y_1=true). (* Pre-condition *) Have: (ta_y_1=true). (* Function Frame *) Have: (ta_y_2=true) /\ (ta_y_1=false). (* Block In *) Have: (ta_tmp_0=false). (* Merge *) Either { Case: (* Call 'reset' *) Have: (ta_y_2=true) /\ (y = 0). Case: (* Exit 'reset' *) Have: (ta_y_2=true). } } Prove: (ta_y_0=false). ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (2/3): Call Effect at line 51 Assume { Type: is_sint32(y). Have: (ta_y_1=true) <-> (ta_y_0=true). (* Pre-condition *) Have: (ta_y_1=true). (* Pre-condition *) Have: (ta_y_1=true). (* Function Frame *) Have: (ta_y_2=true) /\ (ta_y_1=false). (* Block In *) Have: (ta_tmp_0=false). (* Call 'reset' *) Have: (ta_y_2=true) /\ (y = 0). } Prove: (ta_y_0=false). ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (3/3): Call Result at line 52 Assume { Type: is_sint32(load_0) /\ is_sint32(tmp_0) /\ is_sint32(y). Have: (ta_tmp_1=true) <-> (ta_tmp_0=true). (* Pre-condition *) Have: (ta_y_0=true). (* Pre-condition *) Have: (ta_y_0=true). (* Function Frame *) Have: (ta_y_1=true) /\ (ta_y_0=false). (* Block In *) Have: (ta_tmp_1=false). Have: (ta_y_1=true) <-> (ta_y_2=true). (* Call 'reset' *) Have: (ta_y_1=true) /\ (y = 0). (* Call 'load' *) Have: (ta_y_2=true) /\ (y = load_0). } Prove: (ta_tmp_0=false). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 12) in 'reset'' in 'call_param' at call 'reset' (file tests/wp_hoare/dispatch_var2.i, line 51) : Assume { (* Pre-condition *) Have: (ta_y_1=true). (* Pre-condition *) Have: (ta_y_1=true). (* Function Frame *) Have: (ta_y_0=true) /\ (ta_y_1=false). (* Block In *) Have: (ta_tmp_0=false). } Prove: (ta_y_0=true). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 27) in 'load'' in 'call_param' at call 'load' (file tests/wp_hoare/dispatch_var2.i, line 52) : Assume { Type: is_sint32(y). (* Pre-condition *) Have: (ta_y_1=true). (* Pre-condition *) Have: (ta_y_1=true). (* Function Frame *) Have: (ta_y_2=true) /\ (ta_y_1=false). (* Block In *) Have: (ta_tmp_0=false). Have: (ta_y_2=true) <-> (ta_y_0=true). (* Call 'reset' *) Have: (ta_y_2=true) /\ (y = 0). } Prove: (ta_y_0=true). ------------------------------------------------------------ ------------------------------------------------------------ Function call_param_ref ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 68) in 'call_param_ref': Assume { Type: is_sint32(call_param_ref_0) /\ is_sint32(load_0) /\ is_sint32(q) /\ is_sint32(tmp_0). (* Block In *) Have: (ta_tmp_0=false). (* Call 'reset' *) Have: q = 0. (* Call 'load' *) Have: (q = load_0) /\ (tmp_0 = load_0). (* Return *) Have: tmp_0 = call_param_ref_0. } Prove: call_param_ref_0 = 0. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 67) in 'call_param_ref': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 67) in 'call_param_ref' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 67) in 'call_param_ref' (2/2): Call Result at line 73 Assume { Type: is_sint32(load_0) /\ is_sint32(q) /\ is_sint32(tmp_0). Have: (ta_tmp_1=true) <-> (ta_tmp_0=true). (* Block In *) Have: (ta_tmp_1=false). (* Call 'reset' *) Have: q = 0. (* Call 'load' *) Have: q = load_0. } Prove: (ta_tmp_0=false). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 12) in 'reset'' in 'call_param_ref' at call 'reset' (file tests/wp_hoare/dispatch_var2.i, line 72) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 27) in 'load'' in 'call_param_ref' at call 'load' (file tests/wp_hoare/dispatch_var2.i, line 73) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function incr ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 21) in 'incr': Assume { Type: is_sint32(ip_0) /\ is_sint32(ip_1) /\ is_sint32(ip_2). Have: ip_2 = ip_0. Have: (1 + ip_2) = ip_1. } Prove: (1 + ip_0) = ip_1. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 20) in 'incr': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function load ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 29) in 'load': Assume { Type: is_sint32(load_0) /\ is_sint32(lp_0) /\ is_sint32(retres_0). (* Block In *) Have: (ta_retres_0=false). Have: retres_0 = lp_0. (* Return *) Have: retres_0 = load_0. } Prove: lp_0 = load_0. ------------------------------------------------------------ Goal Assigns nothing in 'load': Effect at line 31 Assume { Have: (ta_retres_1=true) <-> (ta_retres_0=true). (* Block In *) Have: (ta_retres_1=false). } Prove: (ta_retres_0=false). ------------------------------------------------------------ ------------------------------------------------------------ Function reset ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 14) in 'reset': Assume { Type: is_sint32(rp_0). Have: rp_0 = 0. } Prove: rp_0 = 0. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 13) in 'reset': Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'reset': /*@ behavior typed_ref: requires \valid(rp); */ void reset(int *rp); [wp] Warning: Memory model hypotheses for function 'incr': /*@ behavior typed_ref: requires \valid(ip); */ void incr(int *ip); [wp] Warning: Memory model hypotheses for function 'load': /*@ behavior typed_ref: requires \valid(lp); */ int load(int *lp); [wp] Warning: Memory model hypotheses for function 'call_param_ref': /*@ behavior typed_ref: requires \valid(q); */ int call_param_ref(int *q); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/dispatch_var2.1.res.oracle����������������0000666�0000000�0000000�00000016662�13571573400�025206� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/dispatch_var2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function call_global ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 37) in 'call_global': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 36) in 'call_global': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 36) in 'call_global' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 36) in 'call_global' (2/2): Call Result at line 42 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 12) in 'reset'' in 'call_global' at call 'reset' (file tests/wp_hoare/dispatch_var2.i, line 41) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 27) in 'load'' in 'call_global' at call 'load' (file tests/wp_hoare/dispatch_var2.i, line 42) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_local ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 56) in 'call_local': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (2/2): Call Effect at line 61 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (2/3): Call Effect at line 61 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_local' (3/3): Call Result at line 62 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 12) in 'reset'' in 'call_local' at call 'reset' (file tests/wp_hoare/dispatch_var2.i, line 61) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 27) in 'load'' in 'call_local' at call 'load' (file tests/wp_hoare/dispatch_var2.i, line 62) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_param ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 47) in 'call_param': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (2/2): Call Effect at line 51 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (2/3): Call Effect at line 51 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_param' (3/3): Call Result at line 52 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 12) in 'reset'' in 'call_param' at call 'reset' (file tests/wp_hoare/dispatch_var2.i, line 51) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 27) in 'load'' in 'call_param' at call 'load' (file tests/wp_hoare/dispatch_var2.i, line 52) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_param_ref ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 68) in 'call_param_ref': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 67) in 'call_param_ref': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 67) in 'call_param_ref' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 67) in 'call_param_ref' (2/2): Call Result at line 73 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 12) in 'reset'' in 'call_param_ref' at call 'reset' (file tests/wp_hoare/dispatch_var2.i, line 72) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/dispatch_var2.i, line 27) in 'load'' in 'call_param_ref' at call 'load' (file tests/wp_hoare/dispatch_var2.i, line 73) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function incr ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 21) in 'incr': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 20) in 'incr': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function load ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 29) in 'load': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'load': Effect at line 31 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function reset ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/dispatch_var2.i, line 14) in 'reset': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/dispatch_var2.i, line 13) in 'reset': Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'reset': /*@ behavior typed_ref: requires \valid(rp); */ void reset(int *rp); [wp] Warning: Memory model hypotheses for function 'incr': /*@ behavior typed_ref: requires \valid(ip); */ void incr(int *ip); [wp] Warning: Memory model hypotheses for function 'load': /*@ behavior typed_ref: requires \valid(lp); */ int load(int *lp); [wp] Warning: Memory model hypotheses for function 'call_param_ref': /*@ behavior typed_ref: requires \valid(q); */ int call_param_ref(int *q); ������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/isHoare.res.oracle������������������������0000666�0000000�0000000�00000000752�13571573400�023701� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/isHoare.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function cmp_invalid_addr_as_int ------------------------------------------------------------ Goal Post-condition 'ok' in 'cmp_invalid_addr_as_int': Prove: true. ------------------------------------------------------------ ����������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/logicarr.res.oracle�����������������������0000666�0000000�0000000�00000004127�13571573400�024111� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_hoare/logicarr.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'PTR' in 'job': Let a = global(G_arr_33). Let a_1 = shift_sint32(a, i). Let x = Mint_0[a_1]. Let a_2 = shift_sint32(a, j). Let m = Mint_0[a_1 <- Mint_0[a_2]][a_2 <- x][shift_sint32(a, k) <- x]. Assume { Type: is_sint32(i) /\ is_sint32(j) /\ is_sint32(k) /\ IsArray1_sint32(Array1_int(a, 10, Mint_0)) /\ is_sint32(x) /\ IsArray1_sint32(Array1_int(a, 10, m)). (* Pre-condition *) Have: (0 <= i) /\ (0 <= j) /\ (0 <= k) /\ (i <= 9) /\ (j <= 9) /\ (k <= 9). } Prove: P_p_pointer(m, Mint_0, shift_sint32(a, 0), i, j). ------------------------------------------------------------ Goal Post-condition 'ARR' in 'job': Let a = global(G_arr_33). Let m = Array1_int(a, 10, Mint_0). Let a_1 = shift_sint32(a, i). Let x = Mint_0[a_1]. Let a_2 = shift_sint32(a, j). Let m_1 = Array1_int(a, 10, Mint_0[a_1 <- Mint_0[a_2]][a_2 <- x][shift_sint32(a, k) <- x]). Assume { Type: is_sint32(i) /\ is_sint32(j) /\ is_sint32(k) /\ IsArray1_sint32(m) /\ is_sint32(x) /\ IsArray1_sint32(m_1). (* Pre-condition *) Have: (0 <= i) /\ (0 <= j) /\ (0 <= k) /\ (i <= 9) /\ (j <= 9) /\ (k <= 9). } Prove: P_p_arrays(m, i, m_1, j). ------------------------------------------------------------ Goal Post-condition 'DUM' in 'job': Let a = global(G_arr_33). Let a_1 = shift_sint32(a, i). Let x = Mint_0[a_1]. Let a_2 = shift_sint32(a, j). Let m = Array1_int(a, 10, Mint_0[a_1 <- Mint_0[a_2]][a_2 <- x][shift_sint32(a, k) <- x]). Assume { Type: is_sint32(i) /\ is_sint32(j) /\ is_sint32(k) /\ IsArray1_sint32(Array1_int(a, 10, Mint_0)) /\ is_sint32(x) /\ IsArray1_sint32(m). (* Pre-condition *) Have: (0 <= i) /\ (0 <= j) /\ (0 <= k) /\ (i <= 9) /\ (j <= 9) /\ (k <= 9). } Prove: P_p_dummy(m, j, k). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/logicref.res.oracle�����������������������0000666�0000000�0000000�00000002614�13571573400�024100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/logicref.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function fvrange_n ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/logicref.i, line 11) in 'fvrange_n': Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_hoare/logicref.i, line 14): Assume { Type: is_sint32(i) /\ is_sint32(k). (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= i) /\ (i < k) /\ P_vrange(Malloc_0, a, k). } Prove: valid_rw(Malloc_0, shift_sint32(a, i), 1). ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/logicref.i, line 11) in 'fvrange_n': Effect at line 15 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function gcd ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/logicref.i, line 23) in 'gcd': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'gcd': Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/logicref_simple.res.oracle����������������0000666�0000000�0000000�00000006144�13571573400�025453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/logicref_simple.i (no preprocessing) [wp] Running WP plugin... ................................................. ... Ref Usage ................................................. Init: { } Function fsimple: { c __retres } Function fsimple_array: { &t __retres } Function ftwo_star: { d __retres } Function fvpositive: { b } ................................................. [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function fsimple ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/logicref_simple.i, line 14) in 'fsimple': Let x = Mint_0[c]. Assume { Type: is_sint32(x) /\ is_sint32(1 + x). (* Heap *) Have: region(c.base) <= 0. (* Pre-condition *) Have: P_simple(Mint_0, c). } Prove: x = 0. ------------------------------------------------------------ Goal Assigns nothing in 'fsimple': Effect at line 15 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function fsimple_array ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/logicref_simple.i, line 19) in 'fsimple_array': Let a = global(G_t_33). Let x = Mint_0[shift_sint32(a, 3)]. Assume { Type: is_sint32(x) /\ is_sint32(1 + x). (* Pre-condition *) Have: P_simple_array(Mint_0, shift_sint32(a, 0)). } Prove: x = 0. ------------------------------------------------------------ Goal Assigns nothing in 'fsimple_array': Effect at line 20 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function ftwo_star ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/logicref_simple.i, line 22) in 'ftwo_star': Let x = Mint_0[Mptr_0[d]]. Assume { Type: is_sint32(x) /\ is_sint32(1 + x). (* Heap *) Have: (region(d.base) <= 0) /\ framed(Mptr_0). (* Pre-condition *) Have: P_two_star(Mptr_0, Mint_0, d). } Prove: x = 0. ------------------------------------------------------------ Goal Assigns nothing in 'ftwo_star': Effect at line 23 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function fvpositive ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/logicref_simple.i, line 26) in 'fvpositive': Prove: true. ------------------------------------------------------------ Goal Assertion 'OK' (file tests/wp_hoare/logicref_simple.i, line 30): Assume { (* Heap *) Have: (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: P_vpositive(Malloc_0, Mint_0, b). } Prove: valid_rw(Malloc_0, b, 1). ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/logicref_simple.i, line 26) in 'fvpositive': Effect at line 31 Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/reference.res.oracle����������������������0000666�0000000�0000000�00000010674�13571573400�024251� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/reference.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function call_f2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference.i, line 35) in 'call_f2': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_f2' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_f2' (2/3): Effect at line 39 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_f2' (3/3): Effect at line 39 Prove: false. ------------------------------------------------------------ Goal Assigns nothing in 'call_f2' (1/4): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_f2' (2/4): Effect at line 39 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_f2' (3/4): Effect at line 39 Prove: false. ------------------------------------------------------------ Goal Assigns nothing in 'call_f2' (4/4): Call Result at line 40 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference.i, line 26) in 'f2'' in 'call_f2' at call 'f2' (file tests/wp_hoare/reference.i, line 40) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_global ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference.i, line 46) in 'call_global': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_global': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_global' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'call_global' (2/2): Call Result at line 49 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference.i, line 10) in 'f'' in 'call_global' at call 'f' (file tests/wp_hoare/reference.i, line 49) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference.i, line 18) in 'g': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (2/2): Effect at line 21 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (2/3): Effect at line 21 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'g' (3/3): Call Result at line 22 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference.i, line 10) in 'f'' in 'g' at call 'f' (file tests/wp_hoare/reference.i, line 22) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function write ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference.i, line 58) in 'write': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference.i, line 57) in 'write': Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'call_f2': /*@ behavior typed_ref: requires \valid(ptr); */ int call_f2(int *ptr, int y); [wp] Warning: Memory model hypotheses for function 'call_global': /*@ behavior typed_ref: requires \valid(gl); */ int call_global(void); [wp] Warning: Memory model hypotheses for function 'write': /*@ behavior typed_ref: requires \valid(pa); */ void write(int kb, int *pa); ��������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/reference_and_struct.res.oracle�����������0000666�0000000�0000000�00000021263�13571573400�026473� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/reference_and_struct.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function call_array_in_struct_param ------------------------------------------------------------ Goal Post-condition 'Pload2' in 'call_array_in_struct_param': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Pload3' in 'call_array_in_struct_param': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 98) in 'call_array_in_struct_param': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 98) in 'call_array_in_struct_param': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_and_struct.i, line 83) in 'load_5'' in 'call_array_in_struct_param' at call 'load_5' (file tests/wp_hoare/reference_and_struct.i, line 102) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_on_array_in_struct_global ------------------------------------------------------------ Goal Post-condition 'Pload' in 'call_on_array_in_struct_global': Let a = s.F2_S_tab. Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (a[i_1] = reg_load_0[i_1]))). } Prove: a[i] = reg_load_0[i]. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 91) in 'call_on_array_in_struct_global': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 91) in 'call_on_array_in_struct_global': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_and_struct.i, line 83) in 'load_5'' in 'call_on_array_in_struct_global' at call 'load_5' (file tests/wp_hoare/reference_and_struct.i, line 94) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_reset ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference_and_struct.i, line 20) in 'call_reset': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 19) in 'call_reset': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 19) in 'call_reset' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 19) in 'call_reset' (2/2): Effect at line 23 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_and_struct.i, line 11) in 'reset'' in 'call_reset' at call 'reset' (file tests/wp_hoare/reference_and_struct.i, line 23) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_reset_1_5 ------------------------------------------------------------ Goal Post-condition 'Presset_mat' in 'call_reset_1_5': Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'reset_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> ((v[i_1].F1_T_a) = 0))). } Prove: (v[i].F1_T_a) = 0. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 63) in 'call_reset_1_5': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 63) in 'call_reset_1_5': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_and_struct.i, line 53) in 'reset_1_5'' in 'call_reset_1_5' at call 'reset_1_5' (file tests/wp_hoare/reference_and_struct.i, line 67) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_reset_5 ------------------------------------------------------------ Goal Post-condition 'Preset_5' in 'call_reset_5': Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> ((ts_0[i_1].F1_T_a) = 0))). (* Call Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 9) -> (((i_1 < 0) \/ (5 <= i_1)) -> (ts_1[i_1] = ts_0[i_1])))). } Prove: (ts_0[i].F1_T_a) = 0. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 35) in 'call_reset_5': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 35) in 'call_reset_5': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_and_struct.i, line 26) in 'reset_5'' in 'call_reset_5' at call 'reset_5' (file tests/wp_hoare/reference_and_struct.i, line 39) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_reset_5_dim2 ------------------------------------------------------------ Goal Post-condition 'Presset_mat' in 'call_reset_5_dim2': Let m = smatrix_0[1]. Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> ((m[i_1].F1_T_a) = 0))). (* Call Effects *) Have: forall i_1 : Z. ((i_1 != 1) -> (smatrix_1[i_1] = smatrix_0[i_1])). } Prove: (m[i].F1_T_a) = 0. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 71) in 'call_reset_5_dim2': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 71) in 'call_reset_5_dim2': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_and_struct.i, line 26) in 'reset_5'' in 'call_reset_5_dim2' at call 'reset_5' (file tests/wp_hoare/reference_and_struct.i, line 75) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_reset_5_tps ------------------------------------------------------------ Goal Post-condition 'Preset_5_tps' in 'call_reset_5_tps': Let a = tps_0[9]. Let a_1 = shift_T(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, 10). Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Heap *) Have: linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, a_1, 10). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (a_2[shiftfield_F1_T_a(shift_T(a, i_1))] = 0))). } Prove: a_2[shiftfield_F1_T_a(shift_T(a, i))] = 0. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 45) in 'call_reset_5_tps': Call Effect at line 49 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 45) in 'call_reset_5_tps': Call Effect at line 49 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_and_struct.i, line 26) in 'reset_5'' in 'call_reset_5_tps' at call 'reset_5' (file tests/wp_hoare/reference_and_struct.i, line 49) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function reset ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference_and_struct.i, line 13) in 'reset': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_and_struct.i, line 12) in 'reset': Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'reset': /*@ behavior typed_ref: requires \valid(p); */ void reset(struct T *p); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/reference_array.res.oracle����������������0000666�0000000�0000000�00000033227�13571573400�025446� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/reference_array.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function add_1_5 ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference_array.i, line 49) in 'add_1_5': Let a = shift_A5_sint32(ap_0, 0). Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Heap *) Have: (region(ap_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, shift_sint32(a, 0), 5). (* Call 'add_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + Mint_0[shift_sint32(a, i_1)])))). } Prove: reg_add_0[i] = (reg_load_0[i] + Mint_0[shift_sint32(a, i)]). ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 48) in 'add_1_5': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 48) in 'add_1_5': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 26) in 'add_5'' in 'add_1_5' at call 'add_5' (file tests/wp_hoare/reference_array.i, line 52) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function calls_on_array_dim_1 ------------------------------------------------------------ Goal Post-condition 'Pload' in 'calls_on_array_dim_1': Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (t[i_1] = reg_load_0[i_1]))). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (t_1[i_1] = 0))). (* Call Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (((i_1 < 0) \/ (5 <= i_1)) -> (t[i_1] = t_1[i_1])))). (* Call 'add_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + t_1[i_1])))). } Prove: t[i] = reg_load_0[i]. ------------------------------------------------------------ Goal Post-condition 'Preset' in 'calls_on_array_dim_1': Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (t_1[i_1] = reg_load_0[i_1]))). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (t[i_1] = 0))). (* Call Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (((i_1 < 0) \/ (5 <= i_1)) -> (t_1[i_1] = t[i_1])))). (* Call 'add_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + t[i_1])))). } Prove: t[i] = 0. ------------------------------------------------------------ Goal Post-condition 'Padd' in 'calls_on_array_dim_1': Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (t[i_1] = reg_load_0[i_1]))). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (t_1[i_1] = 0))). (* Call Effects *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (((i_1 < 0) \/ (5 <= i_1)) -> (t[i_1] = t_1[i_1])))). (* Call 'add_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + t_1[i_1])))). } Prove: t[i] = reg_add_0[i]. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 58) in 'calls_on_array_dim_1': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 58) in 'calls_on_array_dim_1': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 19) in 'load_5'' in 'calls_on_array_dim_1' at call 'load_5' (file tests/wp_hoare/reference_array.i, line 65) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 9) in 'reset_5'' in 'calls_on_array_dim_1' at call 'reset_5' (file tests/wp_hoare/reference_array.i, line 66) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 26) in 'add_5'' in 'calls_on_array_dim_1' at call 'add_5' (file tests/wp_hoare/reference_array.i, line 67) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function calls_on_array_dim_2 ------------------------------------------------------------ Goal Post-condition 'Pload' in 'calls_on_array_dim_2': Let m = tt_0[0]. Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (m[i_1] = reg_load_0[i_1]))). (* Call 'reset_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (v[i_1] = 0))). (* Call 'add_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + v[i_1])))). } Prove: m[i] = reg_load_0[i]. ------------------------------------------------------------ Goal Post-condition 'Preset' in 'calls_on_array_dim_2': Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (tt_0[0][i_1] = reg_load_0[i_1]))). (* Call 'reset_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (v[i_1] = 0))). (* Call 'add_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + v[i_1])))). } Prove: v[i] = 0. ------------------------------------------------------------ Goal Post-condition 'Padd' in 'calls_on_array_dim_2': Let m = tt_0[0]. Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (m[i_1] = reg_load_0[i_1]))). (* Call 'reset_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (v[i_1] = 0))). (* Call 'add_1_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + v[i_1])))). } Prove: m[i] = reg_add_0[i]. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 91) in 'calls_on_array_dim_2': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 91) in 'calls_on_array_dim_2': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 40) in 'load_1_5'' in 'calls_on_array_dim_2' at call 'load_1_5' (file tests/wp_hoare/reference_array.i, line 98) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 33) in 'reset_1_5'' in 'calls_on_array_dim_2' at call 'reset_1_5' (file tests/wp_hoare/reference_array.i, line 99) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 47) in 'add_1_5'' in 'calls_on_array_dim_2' at call 'add_1_5' (file tests/wp_hoare/reference_array.i, line 100) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function calls_on_array_dim_2_to_1 ------------------------------------------------------------ Goal Post-condition 'Pload' in 'calls_on_array_dim_2_to_1': Let m = tt_1[0]. Let m_1 = tt_0[0]. Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (m_1[i_1] = reg_load_0[i_1]))). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (m[i_1] = 0))). (* Call Effects *) Have: forall i_1 : Z. ((i_1 != 0) -> (tt_0[i_1] = tt_1[i_1])). (* Call 'add_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + m[i_1])))). } Prove: m_1[i] = reg_load_0[i]. ------------------------------------------------------------ Goal Post-condition 'Preset' in 'calls_on_array_dim_2_to_1': Let m = tt_0[0]. Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (tt_1[0][i_1] = reg_load_0[i_1]))). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (m[i_1] = 0))). (* Call Effects *) Have: forall i_1 : Z. ((i_1 != 0) -> (tt_1[i_1] = tt_0[i_1])). (* Call 'add_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + m[i_1])))). } Prove: m[i] = 0. ------------------------------------------------------------ Goal Post-condition 'Padd' in 'calls_on_array_dim_2_to_1': Let m = tt_1[0]. Let m_1 = tt_0[0]. Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Call 'load_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (m_1[i_1] = reg_load_0[i_1]))). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (m[i_1] = 0))). (* Call Effects *) Have: forall i_1 : Z. ((i_1 != 0) -> (tt_0[i_1] = tt_1[i_1])). (* Call 'add_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (reg_add_0[i_1] = (reg_load_0[i_1] + m[i_1])))). } Prove: m_1[i] = reg_add_0[i]. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 73) in 'calls_on_array_dim_2_to_1': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 73) in 'calls_on_array_dim_2_to_1': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 19) in 'load_5'' in 'calls_on_array_dim_2_to_1' at call 'load_5' (file tests/wp_hoare/reference_array.i, line 83) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 9) in 'reset_5'' in 'calls_on_array_dim_2_to_1' at call 'reset_5' (file tests/wp_hoare/reference_array.i, line 84) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 26) in 'add_5'' in 'calls_on_array_dim_2_to_1' at call 'add_5' (file tests/wp_hoare/reference_array.i, line 85) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function load_1_5 ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference_array.i, line 42) in 'load_1_5': Let a = shift_A5_sint32(lp_0, 0). Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Heap *) Have: (region(lp_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, shift_sint32(a, 0), 5). (* Call 'load_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (Mint_0[shift_sint32(a, i_1)] = reg_load_0[i_1]))). } Prove: Mint_0[shift_sint32(a, i)] = reg_load_0[i]. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 41) in 'load_1_5': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 41) in 'load_1_5': Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 19) in 'load_5'' in 'load_1_5' at call 'load_5' (file tests/wp_hoare/reference_array.i, line 45) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function reset_1_5 ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference_array.i, line 36) in 'reset_1_5': Let a = shift_A5_sint32(rp_0, 0). Let a_1 = shift_sint32(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, 5). Assume { (* Goal *) When: (0 <= i) /\ (i <= 4). (* Heap *) Have: (region(rp_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, a_1, 5). (* Call 'reset_5' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 4) -> (a_2[shift_sint32(a, i_1)] = 0))). } Prove: a_2[shift_sint32(a, i)] = 0. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 34) in 'reset_1_5': Call Effect at line 38 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_hoare/reference_array.i, line 34) in 'reset_1_5': Call Effect at line 38 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_hoare/reference_array.i, line 9) in 'reset_5'' in 'reset_1_5' at call 'reset_5' (file tests/wp_hoare/reference_array.i, line 38) : Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'load_1_5': /*@ behavior typed_ref: requires \separated(reg_load+(..),lp+(..)); */ void load_1_5(int (*lp)[5]); [wp] Warning: Memory model hypotheses for function 'add_1_5': /*@ behavior typed_ref: requires \separated(\union(reg_load+(..),reg_add+(..)),ap+(..)); */ void add_1_5(int (*ap)[5]); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/reference_array_simple.res.oracle���������0000666�0000000�0000000�00000002710�13571573400�027010� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/reference_array_simple.i (no preprocessing) [wp] Running WP plugin... ................................................. ... Ref Usage ................................................. Init: { } Function f1: { p1[] i } Function call_f1: { tt tmp } Function f2: { p2[] j } Function call_f2: { tt tmp __retres } Function f3: { p3[] k } Function call_f3: { tp tmp } ................................................. [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function call_f1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference_array_simple.i, line 14) in 'call_f1': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_f2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference_array_simple.i, line 25) in 'call_f2': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call_f3 ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/reference_array_simple.i, line 39) in 'call_f3': Prove: true. ------------------------------------------------------------ ��������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle/refguards.res.oracle����������������������0000666�0000000�0000000�00000005703�13571573400�024272� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/refguards.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/refguards.i, line 9) in 'f': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/refguards.i, line 17) in 'g': Let a_1 = shift_sint32(b, k). Let x = Mint_0[a_1]. Let x_1 = Mint_0[shift_sint32(a, k) <- x][a_1]. Assume { Type: is_sint32(k) /\ is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0). } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function h ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/refguards.i, line 24) in 'h': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function s ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/refguards.i, line 32) in 's': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/refguards.i, line 33) in 's': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/refguards.i, line 34) in 's': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/refguards.i, line 35) in 's': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_hoare/refguards.i, line 36) in 's': Prove: true. ------------------------------------------------------------ Goal Post-condition 'KO' in 's': Assume { (* Heap *) Have: (region(c.base) <= 0) /\ (region(d.base) <= 0). } Prove: d != c. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'f': /*@ behavior typed_ref: requires \separated(c,d,\union(a+(..),b+(..))); requires \valid(c); requires \valid(d); */ void f(int *a, int *b, int *c, int *d, int k); [wp] Warning: Memory model hypotheses for function 'h': /*@ behavior typed_ref: requires \separated(c,d); requires \valid(c); requires \valid(d); */ void h(int *c, int *d, int k); [wp] Warning: Memory model hypotheses for function 's': /*@ behavior typed_ref: requires \separated(c,d); requires \valid(c); requires \valid(d); */ void s(int **c, int **d, int k); �������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/�����������������������������������0000777�0000000�0000000�00000000000�13571573400�021665� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/byref.0.res.oracle�����������������0000666�0000000�0000000�00000003036�13571573400�025113� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_hoare/byref.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 12 goals scheduled [wp] [Qed] Goal typed_f_ensures : Valid [wp] [Qed] Goal typed_f_assigns : Valid [wp] [Qed] Goal typed_formal_ensures : Valid [wp] [Qed] Goal typed_formal_call_f_requires : Valid [wp] [Qed] Goal typed_global_ensures : Valid [wp] [Qed] Goal typed_global_call_f_requires : Valid [wp] [Qed] Goal typed_local_ensures : Valid [wp] [Qed] Goal typed_local_call_f_requires : Valid [wp] [Qed] Goal typed_pointer_ensures : Valid [wp] [Qed] Goal typed_pointer_call_f_requires : Valid [wp] [Qed] Goal typed_wrong_without_ref_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_wrong_without_ref_call_f_requires : Unsuccess [wp] Proved goals: 11 / 12 Qed: 11 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_hoare/oracle_qualif/byref.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/byref.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 2 - 2 100% wrong_without_ref 1 - 2 50.0% pointer 2 - 2 100% local 2 - 2 100% formal 2 - 2 100% global 2 - 2 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/byref.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024614� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/byref.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025657� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/byref.0.session/cache/914472b8d4c8fb3a40937ea1f3009a96.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/byref.0.session/cache/914472b8d4c8f0000666�0000000�0000000�00000000072�13571573400�027436� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/byref.1.res.oracle�����������������0000666�0000000�0000000�00000003710�13571573400�025113� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/byref.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 12 goals scheduled [wp] [Qed] Goal typed_ref_f_ensures : Valid [wp] [Qed] Goal typed_ref_f_assigns : Valid [wp] [Qed] Goal typed_ref_formal_ensures : Valid [wp] [Qed] Goal typed_ref_formal_call_f_requires : Valid [wp] [Qed] Goal typed_ref_global_ensures : Valid [wp] [Qed] Goal typed_ref_global_call_f_requires : Valid [wp] [Qed] Goal typed_ref_local_ensures : Valid [wp] [Qed] Goal typed_ref_local_call_f_requires : Valid [wp] [Qed] Goal typed_ref_pointer_ensures : Valid [wp] [Qed] Goal typed_ref_pointer_call_f_requires : Valid [wp] [Qed] Goal typed_ref_wrong_without_ref_ensures : Valid [wp] [Qed] Goal typed_ref_wrong_without_ref_call_f_requires : Valid [wp] Proved goals: 12 / 12 Qed: 12 [wp] Report in: 'tests/wp_hoare/oracle_qualif/byref.1.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/byref.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 2 - 2 100% wrong_without_ref 2 - 2 100% pointer 2 - 2 100% local 2 - 2 100% formal 2 - 2 100% global 2 - 2 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'f': /*@ behavior typed_ref: requires \valid(r); */ void f(int *r); [wp] Warning: Memory model hypotheses for function 'wrong_without_ref': /*@ behavior typed_ref: requires \valid(q); */ int wrong_without_ref(int *q); [wp] Warning: Memory model hypotheses for function 'pointer': /*@ behavior typed_ref: requires \valid(q); */ int pointer(int *q); ��������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/byref.i.0.report.json��������������0000666�0000000�0000000�00000013511�13571573400�025567� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 11, "valid": 11 }, "wp:main": { "total": 12, "valid": 11, "unknown": 1 } }, "wp:functions": { "f": { "f_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "wrong_without_ref": { "f_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wrong_without_ref_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "pointer": { "f_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pointer_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "local": { "f_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "local_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "formal": { "f_requires_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "formal_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "global": { "f_requires_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "global_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/byref.i.1.report.json��������������0000666�0000000�0000000�00000012556�13571573400�025600� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 12, "valid": 12 }, "wp:main": { "total": 12, "valid": 12 } }, "wp:functions": { "f": { "f_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "wrong_without_ref": { "f_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wrong_without_ref_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "pointer": { "f_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "pointer_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "local": { "f_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "local_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "formal": { "f_requires_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "formal_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "global": { "f_requires_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "global_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/dispatch_var.i.0.report.json�������0000666�0000000�0000000�00000037303�13571573400�027134� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 78, "valid": 78 }, "wp:main": { "total": 78, "valid": 78 } }, "wp:functions": { "call_ref_ctr": { "call_ref_ctr_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "call_ref_ctr_ensures_Ref_r1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } }, "call_ref_ctr2": { "call_ref_ctr2_assigns": { "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 7, "valid": 7 } }, "call_ref_ctr2_ensures_Mem_n1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } }, "ref_bd": { "ref_bd_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "ref_bd_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "call_ref_bd": { "call_ref_bd_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "call_ref_bd_ensures_Ref_r2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } }, "call_ref_bd2": { "call_ref_bd2_assigns": { "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 7, "valid": 7 } }, "call_ref_bd2_ensures_Mem_n2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } }, "call_ref_valid": { "ref_valid_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "ref_valid_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_ref_valid_assigns": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } }, "call_ref_valid_ensures_R7_N4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 11, "valid": 11 }, "wp:main": { "total": 11, "valid": 11 } } }, "no_ref_bd": { "no_ref_bd_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "no_ref_bd_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "call_no_ref_bd": { "call_no_ref_bd_assigns": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } }, "call_no_ref_bd_ensures_Mem_n5_nr6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 9, "valid": 9 } } }, "call_ref_ctr_nr": { "ref_ctr_nr_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_ref_ctr_nr_assigns": { "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 7, "valid": 7 } }, "call_ref_ctr_nr_ensures_R_R_R_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_ref_ctr_nr_ensures_R_R_R": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 10, "valid": 10 } } }, "call_ref_ctr_nstars": { "call_ref_ctr_nstars_assigns": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } }, "call_ref_ctr_nstars_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } } }, "call_two_ref": { "call_two_ref_assigns": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } }, "call_two_ref_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 7, "valid": 7 } } }, "g": { "g_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "g_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } }, "array_in_struct_param": { "array_in_struct_param_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "array_in_struct_param_ensures_Pload2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/dispatch_var.res.oracle������������0000666�0000000�0000000�00000015213�13571573400�026315� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/dispatch_var.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 78 goals scheduled [wp] [Qed] Goal typed_ref_array_in_struct_param_ensures_Pload2 : Valid [wp] [Qed] Goal typed_ref_array_in_struct_param_assigns : Valid [wp] [Qed] Goal typed_ref_call_no_ref_bd_ensures_Mem_n5_nr6 : Valid [wp] [Qed] Goal typed_ref_call_no_ref_bd_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_no_ref_bd_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_no_ref_bd_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_ref_call_no_ref_bd_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_no_ref_bd_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_no_ref_bd_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_no_ref_bd_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_ref_call_no_ref_bd_assigns_normal_part5 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd_ensures_Ref_r2 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_ref_bd_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd2_ensures_Mem_n2 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd2_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd2_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd2_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd2_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd2_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd2_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_ref_call_ref_bd2_assigns_normal_part5 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_ensures_Ref_r1 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr2_ensures_Mem_n1 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr2_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr2_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr2_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr2_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr2_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr2_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr2_assigns_normal_part5 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_ensures_R_R_R : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_ensures_R_R_R_2 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nr_call_ref_ctr_nr_requires : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nstars_ensures : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nstars_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nstars_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nstars_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nstars_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_ctr_nstars_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_ensures_R7_N4 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_assigns_normal_part5 : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_call_ref_valid_requires : Valid [wp] [Qed] Goal typed_ref_call_ref_valid_call_ref_valid_2_requires : Valid [wp] [Qed] Goal typed_ref_call_two_ref_ensures : Valid [wp] [Qed] Goal typed_ref_call_two_ref_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_two_ref_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_two_ref_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_two_ref_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_two_ref_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_two_ref_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_ref_g_ensures : Valid [wp] [Qed] Goal typed_ref_g_assigns_exit : Valid [wp] [Qed] Goal typed_ref_g_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_g_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_no_ref_bd_ensures : Valid [wp] [Qed] Goal typed_ref_no_ref_bd_assigns_part1 : Valid [wp] [Qed] Goal typed_ref_no_ref_bd_assigns_part2 : Valid [wp] [Qed] Goal typed_ref_ref_bd_ensures : Valid [wp] [Qed] Goal typed_ref_ref_bd_assigns : Valid [wp] Proved goals: 78 / 78 Qed: 78 [wp] Report in: 'tests/wp_hoare/oracle_qualif/dispatch_var.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/dispatch_var.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success call_ref_ctr 4 - 4 100% call_ref_ctr2 8 - 8 100% ref_bd 2 - 2 100% call_ref_bd 4 - 4 100% call_ref_bd2 8 - 8 100% call_ref_valid 11 - 11 100% no_ref_bd 3 - 3 100% call_no_ref_bd 9 - 9 100% call_ref_ctr_nr 10 - 10 100% call_ref_ctr_nstars 6 - 6 100% call_two_ref 7 - 7 100% g 4 - 4 100% array_in_struct_param 2 - 2 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'ref_bd': /*@ behavior typed_ref: requires \valid(q); */ int ref_bd(int *q); [wp] Warning: Memory model hypotheses for function 'g': /*@ behavior typed_ref: requires \valid(pg); */ int g(int *pg); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/dispatch_var2.0.res.oracle���������0000666�0000000�0000000�00000007102�13571573400�026533� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' -wp-no-let [...] [kernel] Parsing tests/wp_hoare/dispatch_var2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 34 goals scheduled [wp] [Qed] Goal typed_ref_call_global_ensures : Valid [wp] [Qed] Goal typed_ref_call_global_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_global_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_global_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_global_call_reset_requires : Valid [wp] [Qed] Goal typed_ref_call_global_call_load_requires : Valid [wp] [Qed] Goal typed_ref_call_local_ensures : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_local_call_reset_requires : Valid [wp] [Qed] Goal typed_ref_call_local_call_load_requires : Valid [wp] [Qed] Goal typed_ref_call_param_ensures : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_param_call_reset_requires : Valid [wp] [Qed] Goal typed_ref_call_param_call_load_requires : Valid [wp] [Qed] Goal typed_ref_call_param_ref_ensures : Valid [wp] [Qed] Goal typed_ref_call_param_ref_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_param_ref_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_param_ref_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_param_ref_call_reset_requires : Valid [wp] [Qed] Goal typed_ref_call_param_ref_call_load_requires : Valid [wp] [Qed] Goal typed_ref_incr_ensures : Valid [wp] [Qed] Goal typed_ref_incr_assigns : Valid [wp] [Qed] Goal typed_ref_load_ensures : Valid [wp] [Qed] Goal typed_ref_load_assigns : Valid [wp] [Qed] Goal typed_ref_reset_ensures : Valid [wp] [Qed] Goal typed_ref_reset_assigns : Valid [wp] Proved goals: 34 / 34 Qed: 34 [wp] Report in: 'tests/wp_hoare/oracle_qualif/dispatch_var2.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/dispatch_var2.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success reset 2 - 2 100% incr 2 - 2 100% load 2 - 2 100% call_global 6 - 6 100% call_param 8 - 8 100% call_local 8 - 8 100% call_param_ref 6 - 6 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'reset': /*@ behavior typed_ref: requires \valid(rp); */ void reset(int *rp); [wp] Warning: Memory model hypotheses for function 'incr': /*@ behavior typed_ref: requires \valid(ip); */ void incr(int *ip); [wp] Warning: Memory model hypotheses for function 'load': /*@ behavior typed_ref: requires \valid(lp); */ int load(int *lp); [wp] Warning: Memory model hypotheses for function 'call_param_ref': /*@ behavior typed_ref: requires \valid(q); */ int call_param_ref(int *q); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/dispatch_var2.1.res.oracle���������0000666�0000000�0000000�00000007067�13571573400�026546� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/dispatch_var2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 34 goals scheduled [wp] [Qed] Goal typed_ref_call_global_ensures : Valid [wp] [Qed] Goal typed_ref_call_global_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_global_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_global_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_global_call_reset_requires : Valid [wp] [Qed] Goal typed_ref_call_global_call_load_requires : Valid [wp] [Qed] Goal typed_ref_call_local_ensures : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_local_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_local_call_reset_requires : Valid [wp] [Qed] Goal typed_ref_call_local_call_load_requires : Valid [wp] [Qed] Goal typed_ref_call_param_ensures : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_param_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_call_param_call_reset_requires : Valid [wp] [Qed] Goal typed_ref_call_param_call_load_requires : Valid [wp] [Qed] Goal typed_ref_call_param_ref_ensures : Valid [wp] [Qed] Goal typed_ref_call_param_ref_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_param_ref_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_param_ref_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_param_ref_call_reset_requires : Valid [wp] [Qed] Goal typed_ref_call_param_ref_call_load_requires : Valid [wp] [Qed] Goal typed_ref_incr_ensures : Valid [wp] [Qed] Goal typed_ref_incr_assigns : Valid [wp] [Qed] Goal typed_ref_load_ensures : Valid [wp] [Qed] Goal typed_ref_load_assigns : Valid [wp] [Qed] Goal typed_ref_reset_ensures : Valid [wp] [Qed] Goal typed_ref_reset_assigns : Valid [wp] Proved goals: 34 / 34 Qed: 34 [wp] Report in: 'tests/wp_hoare/oracle_qualif/dispatch_var2.1.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/dispatch_var2.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success reset 2 - 2 100% incr 2 - 2 100% load 2 - 2 100% call_global 6 - 6 100% call_param 8 - 8 100% call_local 8 - 8 100% call_param_ref 6 - 6 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'reset': /*@ behavior typed_ref: requires \valid(rp); */ void reset(int *rp); [wp] Warning: Memory model hypotheses for function 'incr': /*@ behavior typed_ref: requires \valid(ip); */ void incr(int *ip); [wp] Warning: Memory model hypotheses for function 'load': /*@ behavior typed_ref: requires \valid(lp); */ int load(int *lp); [wp] Warning: Memory model hypotheses for function 'call_param_ref': /*@ behavior typed_ref: requires \valid(q); */ int call_param_ref(int *q); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/dispatch_var2.i.0.report.json������0000666�0000000�0000000�00000024162�13571573400�027215� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 34, "valid": 34 }, "wp:main": { "total": 34, "valid": 34 } }, "wp:functions": { "reset": { "reset_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "incr": { "incr_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "incr_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "load": { "load_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "load_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "call_global": { "load_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_global_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "call_global_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } } }, "call_param": { "load_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_param_assigns": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } }, "call_param_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } }, "call_local": { "load_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_local_assigns": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } }, "call_local_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } }, "call_param_ref": { "load_requires_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_requires_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_param_ref_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "call_param_ref_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/dispatch_var2.i.1.report.json������0000666�0000000�0000000�00000024162�13571573400�027216� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 34, "valid": 34 }, "wp:main": { "total": 34, "valid": 34 } }, "wp:functions": { "reset": { "reset_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "incr": { "incr_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "incr_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "load": { "load_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "load_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "call_global": { "load_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_global_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "call_global_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } } }, "call_param": { "load_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_param_assigns": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } }, "call_param_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } }, "call_local": { "load_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_local_assigns": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } }, "call_local_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } }, "call_param_ref": { "load_requires_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_requires_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_param_ref_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "call_param_ref_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/isHoare.i.0.report.json������������0000666�0000000�0000000�00000001737�13571573400�026061� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "cmp_invalid_addr_as_int": { "cmp_invalid_addr_as_int_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } ���������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/isHoare.res.oracle�����������������0000666�0000000�0000000�00000001323�13571573400�025235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/isHoare.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Qed] Goal typed_ref_cmp_invalid_addr_as_int_ensures_ok : Valid [wp] Proved goals: 1 / 1 Qed: 1 [wp] Report in: 'tests/wp_hoare/oracle_qualif/isHoare.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/isHoare.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success cmp_invalid_addr_as_int 1 - 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.0.session/����������������0000777�0000000�0000000�00000000000�13571573400�025307� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.0.session/cache/����������0000777�0000000�0000000�00000000000�13571573400�026352� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.0.session/cache/1fed73d94cd3ea7e79e26165deb00a73.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.0.session/cache/1fed73d94c0000666�0000000�0000000�00000000127�13571573400�027752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0248, "steps": 28 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.0.session/cache/229a0707b77b3e984c3a781699a1df78.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.0.session/cache/229a0707b70000666�0000000�0000000�00000000127�13571573400�027521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0206, "steps": 28 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.0.session/cache/68453e74d36f575702ba0721ff25075e.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.0.session/cache/68453e74d30000666�0000000�0000000�00000000127�13571573400�027535� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0321, "steps": 27 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.i.0.report.json�����������0000666�0000000�0000000�00000003636�13571573400�026271� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 9 }, "wp:main": { "total": 3, "valid": 3, "rank": 9 } }, "wp:functions": { "job": { "job_ensures_DUM": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "job_ensures_ARR": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "job_ensures_PTR": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 9 }, "wp:main": { "total": 3, "valid": 3, "rank": 9 } } } } } ��������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicarr.res.oracle����������������0000666�0000000�0000000�00000001477�13571573400�025457� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_hoare/logicarr.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_PTR : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_ARR : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_DUM : Valid [wp] Proved goals: 3 / 3 Qed: 0 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_hoare/oracle_qualif/logicarr.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/logicarr.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job - 3 (24..36) 3 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref.0.session/����������������0000777�0000000�0000000�00000000000�13571573400�025277� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref.0.session/cache/����������0000777�0000000�0000000�00000000000�13571573400�026342� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref.0.session/cache/5682e7679f747ad1baccf6715c89c77b.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref.0.session/cache/5682e7679f0000666�0000000�0000000�00000000127�13571573400�027541� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0398, "steps": 70 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref.i.0.report.json�����������0000666�0000000�0000000�00000005765�13571573400�026266� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 5, "valid": 5, "rank": 16 } }, "wp:functions": { "fvrange_n": { "fvrange_n_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "fvrange_n_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "fvrange_n_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 16 } } }, "gcd": { "gcd_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "gcd_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �����������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref.res.oracle����������������0000666�0000000�0000000�00000001750�13571573400�025441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/logicref.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 5 goals scheduled [wp] [Qed] Goal typed_ref_fvrange_n_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_fvrange_n_assert : Valid [wp] [Qed] Goal typed_ref_fvrange_n_assigns : Valid [wp] [Qed] Goal typed_ref_gcd_ensures : Valid [wp] [Qed] Goal typed_ref_gcd_assigns : Valid [wp] Proved goals: 5 / 5 Qed: 4 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_hoare/oracle_qualif/logicref.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/logicref.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success fvrange_n 2 1 (56..80) 3 100% gcd 2 - 2 100% ------------------------------------------------------------- ������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/���������0000777�0000000�0000000�00000000000�13571573400�026650� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/cache/���0000777�0000000�0000000�00000000000�13571573400�027713� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/cache/318d89b595af1570a649f15bbbff5641.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/cache/3180000666�0000000�0000000�00000000127�13571573400�030151� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0234, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/cache/5d8f0aabf61ed825acdb27fdae4c5762.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/cache/5d80000666�0000000�0000000�00000000127�13571573400�030236� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0235, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/cache/8a4919db9cce7f5f1a2301d319fa6b29.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/cache/8a40000666�0000000�0000000�00000000126�13571573400�030231� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0154, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/cache/a9946fa5de4da04cf54204ee6ab4aa06.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.0.session/cache/a990000666�0000000�0000000�00000000127�13571573400�030240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0137, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.i.0.report.json����0000666�0000000�0000000�00000016012�13571573400�027622� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 4, "rank": 4 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 9, "valid": 9, "rank": 3 } }, "wp:functions": { "fsimple": { "fsimple_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "fsimple_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } } }, "fsimple_array": { "fsimple_array_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "fsimple_array_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } } }, "ftwo_star": { "ftwo_star_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "ftwo_star_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } } }, "fvpositive": { "fvpositive_assert_OK": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "fvpositive_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "fvpositive_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 2 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/logicref_simple.res.oracle���������0000666�0000000�0000000�00000002570�13571573400�027013� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/logicref_simple.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 9 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_ref_fsimple_ensures : Valid [wp] [Qed] Goal typed_ref_fsimple_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_fsimple_array_ensures : Valid [wp] [Qed] Goal typed_ref_fsimple_array_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_ftwo_star_ensures : Valid [wp] [Qed] Goal typed_ref_ftwo_star_assigns : Valid [wp] [Qed] Goal typed_ref_fvpositive_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_fvpositive_assert_OK : Valid [wp] [Qed] Goal typed_ref_fvpositive_assigns : Valid [wp] Proved goals: 9 / 9 Qed: 5 Alt-Ergo 2.0.0: 4 [wp] Report in: 'tests/wp_hoare/oracle_qualif/logicref_simple.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/logicref_simple.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success fsimple 1 1 (8..20) 2 100% fsimple_array 1 1 (8..20) 2 100% ftwo_star 1 1 (12..24) 2 100% fvpositive 2 1 (4..16) 3 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025443� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026506� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference.0.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference.0.session/cache/2d7c067450000666�0000000�0000000�00000000072�13571573400�027575� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference.i.0.report.json����������0000666�0000000�0000000�00000012303�13571573400�026414� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 21, "valid": 21 }, "wp:main": { "total": 23, "valid": 21, "unknown": 2 } }, "wp:functions": { "g": { "f_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_assigns": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } }, "g_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 7, "valid": 7 } } }, "call_f2": { "f2_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_f2_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 7, "valid": 5, "unknown": 2 } }, "call_f2_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 9, "valid": 7, "unknown": 2 } } }, "call_global": { "f_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_global_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "call_global_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "write": { "write_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "write_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference.res.oracle���������������0000666�0000000�0000000�00000005146�13571573400�025610� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/reference.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 23 goals scheduled [wp] [Qed] Goal typed_ref_call_f2_ensures : Valid [wp] [Qed] Goal typed_ref_call_f2_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_call_f2_assigns_exit_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_call_f2_assigns_exit_part3 : Unsuccess [wp] [Qed] Goal typed_ref_call_f2_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_f2_assigns_normal_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_call_f2_assigns_normal_part3 : Unsuccess [wp] [Qed] Goal typed_ref_call_f2_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_ref_call_f2_call_f2_requires : Valid [wp] [Qed] Goal typed_ref_call_global_ensures : Valid [wp] [Qed] Goal typed_ref_call_global_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_global_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_global_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_global_call_f_requires : Valid [wp] [Qed] Goal typed_ref_g_ensures : Valid [wp] [Qed] Goal typed_ref_g_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_g_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_g_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_g_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_g_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_g_call_f_requires : Valid [wp] [Qed] Goal typed_ref_write_ensures : Valid [wp] [Qed] Goal typed_ref_write_assigns : Valid [wp] Proved goals: 21 / 23 Qed: 21 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_hoare/oracle_qualif/reference.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/reference.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success g 7 - 7 100% call_f2 7 - 9 77.8% call_global 5 - 5 100% write 2 - 2 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'call_f2': /*@ behavior typed_ref: requires \valid(ptr); */ int call_f2(int *ptr, int y); [wp] Warning: Memory model hypotheses for function 'call_global': /*@ behavior typed_ref: requires \valid(gl); */ int call_global(void); [wp] Warning: Memory model hypotheses for function 'write': /*@ behavior typed_ref: requires \valid(pa); */ void write(int kb, int *pa); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/����0000777�0000000�0000000�00000000000�13571573400�027671� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000147�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cache/��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cach0000777�0000000�0000000�00000000000�13571573400�030510� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000214�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cache/2997574795f2d8750bfb2e604df792d0.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cach0000666�0000000�0000000�00000000126�13571573400�030511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0072, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000214�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cache/30cbcd7f2b76c47e8e8cc22b6d0230ba.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cach0000666�0000000�0000000�00000000126�13571573400�030511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0107, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000214�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cache/cc1529e7cf30a2d454364b33be49ceea.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cach0000666�0000000�0000000�00000000126�13571573400�030511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.021, "steps": 18 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000214�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cache/cf3f785f873f6cf9d0875e0c1961c0df.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cach0000666�0000000�0000000�00000000126�13571573400�030511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0111, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000214�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cache/e866441f779fc7798857b21eef329295.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.0.session/cach0000666�0000000�0000000�00000000126�13571573400�030511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0099, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000146�00000000000�007774� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.i.0.report.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.i.0.report.jso0000666�0000000�0000000�00000036442�13571573400�030476� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 4 }, "qed": { "total": 27, "valid": 27 }, "wp:main": { "total": 32, "valid": 32, "rank": 5 } }, "wp:functions": { "reset": { "reset_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "call_reset": { "reset_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_reset_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "call_reset_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "call_reset_5": { "reset_5_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_reset_5_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "call_reset_5_ensures_Preset_5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 1 } } }, "call_reset_5_tps": { "reset_5_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_reset_5_tps_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "call_reset_5_tps_ensures_Preset_5_tps": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 5 } } }, "call_reset_1_5": { "reset_1_5_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_reset_1_5_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "call_reset_1_5_ensures_Presset_mat": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 1 } } }, "call_reset_5_dim2": { "reset_5_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_reset_5_dim2_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "call_reset_5_dim2_ensures_Presset_mat": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 1 } } }, "call_on_array_in_struct_global": { "load_5_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_on_array_in_struct_global_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "call_on_array_in_struct_global_ensures_Pload": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 2 } } }, "call_array_in_struct_param": { "load_5_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_array_in_struct_param_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "call_array_in_struct_param_ensures_Pload3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "call_array_in_struct_param_ensures_Pload2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_and_struct.res.oracle����0000666�0000000�0000000�00000006662�13571573400�030042� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/reference_and_struct.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 32 goals scheduled [wp] [Qed] Goal typed_ref_call_array_in_struct_param_ensures_Pload2 : Valid [wp] [Qed] Goal typed_ref_call_array_in_struct_param_ensures_Pload3 : Valid [wp] [Qed] Goal typed_ref_call_array_in_struct_param_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_array_in_struct_param_assigns_normal : Valid [wp] [Qed] Goal typed_ref_call_array_in_struct_param_call_load_5_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_call_on_array_in_struct_global_ensures_Pload : Valid [wp] [Qed] Goal typed_ref_call_on_array_in_struct_global_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_on_array_in_struct_global_assigns_normal : Valid [wp] [Qed] Goal typed_ref_call_on_array_in_struct_global_call_load_5_requires : Valid [wp] [Qed] Goal typed_ref_call_reset_ensures : Valid [wp] [Qed] Goal typed_ref_call_reset_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_reset_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_call_reset_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_call_reset_call_reset_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_call_reset_1_5_ensures_Presset_mat : Valid [wp] [Qed] Goal typed_ref_call_reset_1_5_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_reset_1_5_assigns_normal : Valid [wp] [Qed] Goal typed_ref_call_reset_1_5_call_reset_1_5_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_call_reset_5_ensures_Preset_5 : Valid [wp] [Qed] Goal typed_ref_call_reset_5_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_reset_5_assigns_normal : Valid [wp] [Qed] Goal typed_ref_call_reset_5_call_reset_5_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_call_reset_5_dim2_ensures_Presset_mat : Valid [wp] [Qed] Goal typed_ref_call_reset_5_dim2_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_reset_5_dim2_assigns_normal : Valid [wp] [Qed] Goal typed_ref_call_reset_5_dim2_call_reset_5_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_call_reset_5_tps_ensures_Preset_5_tps : Valid [wp] [Qed] Goal typed_ref_call_reset_5_tps_assigns_exit : Valid [wp] [Qed] Goal typed_ref_call_reset_5_tps_assigns_normal : Valid [wp] [Qed] Goal typed_ref_call_reset_5_tps_call_reset_5_requires : Valid [wp] [Qed] Goal typed_ref_reset_ensures : Valid [wp] [Qed] Goal typed_ref_reset_assigns : Valid [wp] Proved goals: 32 / 32 Qed: 27 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_hoare/oracle_qualif/reference_and_struct.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/reference_and_struct.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success reset 2 - 2 100% call_reset 5 - 5 100% call_reset_5 3 1 (1..12) 4 100% call_reset_5_tps 3 1 (12..24) 4 100% call_reset_1_5 3 1 (1..12) 4 100% call_reset_5_dim2 3 1 (1..12) 4 100% call_on_array_in_struct_global 3 1 (1..12) 4 100% call_array_in_struct_param 5 - 5 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'reset': /*@ behavior typed_ref: requires \valid(p); */ void reset(struct T *p); ������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/���������0000777�0000000�0000000�00000000000�13571573400�026641� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/���0000777�0000000�0000000�00000000000�13571573400�027704� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/077d2f20bc5367a72365679fee3d38a4.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/0770000666�0000000�0000000�00000000126�13571573400�030143� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0084, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/1e7344104d7210f7ec6ae8efc6b42d57.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/1e70000666�0000000�0000000�00000000126�13571573400�030222� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0072, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/423b6c29c3451823276ad77f781f6a6a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/4230000666�0000000�0000000�00000000127�13571573400�030137� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0112, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/588918e081502951ea3f03c1c1d7c12f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/5880000666�0000000�0000000�00000000126�13571573400�030152� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.009, "steps": 12 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/62514413e23ba5305cf24c6ff036d7ab.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/6250000666�0000000�0000000�00000000127�13571573400�030143� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0165, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/76b4ba27b4d7df4f72444fd646ad383c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/76b0000666�0000000�0000000�00000000126�13571573400�030224� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.014, "steps": 18 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/7efca4558505433c34411f970848ed8c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/7ef0000666�0000000�0000000�00000000126�13571573400�030307� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0107, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/912ca6ada2f29485e603afd43c96230f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/9120000666�0000000�0000000�00000000127�13571573400�030142� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0097, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/9b59f2c8997898e5cd20c9397d630a70.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/9b50000666�0000000�0000000�00000000126�13571573400�030225� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0108, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/ad29f0a440fa5619b6beacba2993114a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/ad20000666�0000000�0000000�00000000126�13571573400�030274� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0074, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/cb18b19c27fdc4c535d96f98c1300701.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/cb10000666�0000000�0000000�00000000127�13571573400�030274� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0128, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000207�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/e02d6a197b2feb41566f9f70042c1161.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.0.session/cache/e020000666�0000000�0000000�00000000126�13571573400�030214� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0067, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.i.0.report.json����0000666�0000000�0000000�00000044400�13571573400�027615� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 12, "valid": 12, "rank": 4 }, "qed": { "total": 24, "valid": 24 }, "wp:main": { "total": 36, "valid": 36, "rank": 5 } }, "wp:functions": { "reset_1_5": { "reset_5_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_1_5_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "reset_1_5_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 5 } } }, "load_1_5": { "load_5_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "load_1_5_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "load_1_5_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 4 } } }, "add_1_5": { "add_5_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "add_1_5_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "add_1_5_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 4 } } }, "calls_on_array_dim_1": { "add_5_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_5_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "load_5_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "calls_on_array_dim_1_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "calls_on_array_dim_1_ensures_Padd": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "calls_on_array_dim_1_ensures_Preset": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "calls_on_array_dim_1_ensures_Pload": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 3 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 8, "valid": 8, "rank": 3 } } }, "calls_on_array_dim_2_to_1": { "add_5_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_5_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "load_5_requires_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "calls_on_array_dim_2_to_1_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "calls_on_array_dim_2_to_1_ensures_Padd": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "calls_on_array_dim_2_to_1_ensures_Preset": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "calls_on_array_dim_2_to_1_ensures_Pload": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 3 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 8, "valid": 8, "rank": 3 } } }, "calls_on_array_dim_2": { "add_1_5_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_1_5_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "load_1_5_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "calls_on_array_dim_2_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "calls_on_array_dim_2_ensures_Padd": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "calls_on_array_dim_2_ensures_Preset": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "calls_on_array_dim_2_ensures_Pload": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 2 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 8, "valid": 8, "rank": 2 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array.res.oracle���������0000666�0000000�0000000�00000007555�13571573400�027014� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/reference_array.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 36 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_ref_add_1_5_ensures : Valid [wp] [Qed] Goal typed_ref_add_1_5_assigns_exit : Valid [wp] [Qed] Goal typed_ref_add_1_5_assigns_normal : Valid [wp] [Qed] Goal typed_ref_add_1_5_call_add_5_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_calls_on_array_dim_1_ensures_Pload : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_calls_on_array_dim_1_ensures_Preset : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_calls_on_array_dim_1_ensures_Padd : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_1_assigns_exit : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_1_assigns_normal : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_1_call_load_5_requires : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_1_call_reset_5_requires : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_1_call_add_5_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_calls_on_array_dim_2_ensures_Pload : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_calls_on_array_dim_2_ensures_Preset : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_calls_on_array_dim_2_ensures_Padd : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_assigns_exit : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_assigns_normal : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_call_load_1_5_requires : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_call_reset_1_5_requires : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_call_add_1_5_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_calls_on_array_dim_2_to_1_ensures_Pload : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_calls_on_array_dim_2_to_1_ensures_Preset : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_calls_on_array_dim_2_to_1_ensures_Padd : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_to_1_assigns_exit : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_to_1_assigns_normal : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_to_1_call_load_5_requires : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_to_1_call_reset_5_requires : Valid [wp] [Qed] Goal typed_ref_calls_on_array_dim_2_to_1_call_add_5_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_load_1_5_ensures : Valid [wp] [Qed] Goal typed_ref_load_1_5_assigns_exit : Valid [wp] [Qed] Goal typed_ref_load_1_5_assigns_normal : Valid [wp] [Qed] Goal typed_ref_load_1_5_call_load_5_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_reset_1_5_ensures : Valid [wp] [Qed] Goal typed_ref_reset_1_5_assigns_exit : Valid [wp] [Qed] Goal typed_ref_reset_1_5_assigns_normal : Valid [wp] [Qed] Goal typed_ref_reset_1_5_call_reset_5_requires : Valid [wp] Proved goals: 36 / 36 Qed: 24 Alt-Ergo 2.0.0: 12 [wp] Report in: 'tests/wp_hoare/oracle_qualif/reference_array.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/reference_array.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success reset_1_5 3 1 (12..24) 4 100% load_1_5 3 1 (12..24) 4 100% add_1_5 3 1 (12..24) 4 100% calls_on_array_dim_1 5 3 (8..20) 8 100% calls_on_array_dim_2_to_1 5 3 (4..16) 8 100% calls_on_array_dim_2 5 3 (4..16) 8 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'load_1_5': /*@ behavior typed_ref: requires \separated(reg_load+(..),lp+(..)); */ void load_1_5(int (*lp)[5]); [wp] Warning: Memory model hypotheses for function 'add_1_5': /*@ behavior typed_ref: requires \separated(\union(reg_load+(..),reg_add+(..)),ap+(..)); */ void add_1_5(int (*ap)[5]); ���������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000150�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array_simple.i.0.report.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array_simple.i.0.report.j0000666�0000000�0000000�00000003627�13571573400�030454� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:functions": { "call_f1": { "call_f1_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "call_f2": { "call_f2_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "call_f3": { "call_f3_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } ���������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/reference_array_simple.res.oracle��0000666�0000000�0000000�00000001706�13571573400�030355� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/reference_array_simple.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_ref_call_f1_ensures : Valid [wp] [Qed] Goal typed_ref_call_f2_ensures : Valid [wp] [Qed] Goal typed_ref_call_f3_ensures : Valid [wp] Proved goals: 3 / 3 Qed: 3 [wp] Report in: 'tests/wp_hoare/oracle_qualif/reference_array_simple.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/reference_array_simple.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success call_f1 1 - 1 100% call_f2 1 - 1 100% call_f3 1 - 1 100% ------------------------------------------------------------- ����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/refguards.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025467� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/refguards.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026532� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/refguards.0.session/cache/29bd54364c6cbab6b5edf958e89561f6.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/refguards.0.session/cache/29bd543640000666�0000000�0000000�00000000072�13571573400�027622� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/refguards.0.session/cache/639f5f795718cce5837c2a5bc34605e0.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/refguards.0.session/cache/639f5f7950000666�0000000�0000000�00000000127�13571573400�027644� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0207, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/refguards.i.0.report.json����������0000666�0000000�0000000�00000007532�13571573400�026450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 3 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 9, "valid": 8, "unknown": 1, "rank": 4 } }, "wp:functions": { "f": { "f_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "g": { "g_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "h": { "h_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "s": { "s_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "s_ensures_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "s_ensures_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "s_ensures_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "s_ensures_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "s_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 6, "valid": 5, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/oracle_qualif/refguards.res.oracle���������������0000666�0000000�0000000�00000003671�13571573400�025635� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_hoare/refguards.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 9 goals scheduled [wp] [Qed] Goal typed_ref_f_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_g_ensures : Valid [wp] [Qed] Goal typed_ref_h_ensures : Valid [wp] [Qed] Goal typed_ref_s_ensures : Valid [wp] [Qed] Goal typed_ref_s_ensures_2 : Valid [wp] [Qed] Goal typed_ref_s_ensures_3 : Valid [wp] [Qed] Goal typed_ref_s_ensures_4 : Valid [wp] [Qed] Goal typed_ref_s_ensures_5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_s_ensures_KO : Unsuccess [wp] Proved goals: 8 / 9 Qed: 7 Alt-Ergo 2.0.0: 1 (unsuccess: 1) [wp] Report in: 'tests/wp_hoare/oracle_qualif/refguards.0.report.json' [wp] Report out: 'tests/wp_hoare/result_qualif/refguards.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 1 - 1 100% g - 1 (8..20) 1 100% h 1 - 1 100% s 5 - 6 83.3% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'f': /*@ behavior typed_ref: requires \separated(c,d,\union(a+(..),b+(..))); requires \valid(c); requires \valid(d); */ void f(int *a, int *b, int *c, int *d, int k); [wp] Warning: Memory model hypotheses for function 'h': /*@ behavior typed_ref: requires \separated(c,d); requires \valid(c); requires \valid(d); */ void h(int *c, int *d, int k); [wp] Warning: Memory model hypotheses for function 's': /*@ behavior typed_ref: requires \separated(c,d); requires \valid(c); requires \valid(d); */ void s(int **c, int **d, int k); �����������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/reference.i��������������������������������������0000666�0000000�0000000�00000001542�13571573400�021171� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref */ /* run.config_qualif OPT: -wp-model +ref */ /*@ requires \valid(p); assigns \nothing ; ensures \result == *p ; */ int f(int * p); /*@ assigns \nothing ; ensures \result == 4 ; */ int g (int x){ x = 4 ; return f(&x); } /*@ requires \valid(p2) && \valid(q) ; assigns \nothing ; ensures \result == *p2+*q; */ int f2(int *p2, int * q); /*@ requires \valid(ptr); assigns \nothing; ensures \result == 4; */ int call_f2(int * ptr, int y) { y = 2 ; *ptr =2; return f2(ptr,&y); } int *gl; /*@ requires \valid(gl) ; assigns \nothing; ensures \result == *gl; */ int call_global (void) { return f(gl);} /*--------------------------------------------*/ /*@ requires \valid(pa); assigns *pa; ensures *pa == kb; */ void write (int kb,int * pa) { *pa = kb;} ��������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/reference_and_struct.i���������������������������0000666�0000000�0000000�00000004237�13571573400�023423� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref */ /* run.config_qualif OPT: -wp-model +ref */ struct T {int a; int b;}; /*@ requires \valid(p); assigns p->a; ensures p->a == 0; */ void reset (struct T *p) {p->a = 0;} struct T st ; /*@ assigns st.a; ensures \result == 0; */ int call_reset (void) { reset(&st) ; return (st.a);} /*@ requires \valid(fp+(0..4)); assigns fp[0..4]; ensures Reset5: \forall integer i; 0<=i<5 ==> (fp+i)->a == 0; */ void reset_5 (struct T *fp); struct T ts[10]; /*@ assigns ts[0..4]; ensures Preset_5: \forall integer i; 0<=i<5 ==> ts[i].a == 0; */ void call_reset_5 (void) { reset_5(ts) ; return ;} struct T * tps[10]; /*@ requires \valid(tps[9]+(0..4)); assigns tps[9][0..4]; ensures Preset_5_tps : \forall integer i; 0<=i<5 ==> tps[9][i].a == 0; */ void call_reset_5_tps(void) { reset_5(tps[9]); return;} /*@ requires \valid(rp[0]+(0..4)); assigns rp[0][0..4]; ensures \forall integer i; 0<= i<5 ==> (rp[0]+i)->a == 0; */ void reset_1_5 (struct T (*rp) [5]); struct T smatrix [20] [5] ; /*@ assigns smatrix[0][0..4]; ensures Presset_mat : \forall integer i; 0<= i<5 ==> (smatrix[0]+i)->a == 0; */ void call_reset_1_5(void) {reset_1_5(smatrix); return;} /*@ assigns smatrix[1][0..4]; ensures Presset_mat : \forall integer i; 0<= i<5 ==> (smatrix[1]+i)->a == 0; */ void call_reset_5_dim2(void) {reset_5(smatrix[1]); return;} /*-------------------------------------------------------*/ struct S { int tab[10]; int k;}; struct S s; int reg_load[5]; /*@ requires \valid(hp+(0..4)); assigns reg_load[0..4]; ensures \forall integer i; 0<=i<5 ==> reg_load[i] == hp[i]; */ void load_5 (int * hp); /*@ assigns reg_load[0..4]; ensures Pload : \forall integer i; 0<=i<5 ==> reg_load[i] == \old(s.tab[i]); */ void call_on_array_in_struct_global (void){load_5(s.tab);} /*@ requires \valid(sf.tab+(0..4)); assigns reg_load[0..4]; ensures Pload2 : \forall integer j; 0<=j<5 ==> reg_load[j] == sf.tab[j]; ensures Pload3 : \forall integer j; 0<=j<5 ==> \result.tab[j] == sf.tab[j]; */ struct S call_array_in_struct_param(struct S sf){load_5(sf.tab); return sf;} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/reference_array.i��������������������������������0000666�0000000�0000000�00000004455�13571573400�022375� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref */ /* run.config_qualif OPT: -wp-model +ref */ /*@ requires \valid(fp+(0..4)); assigns fp[0..4]; ensures Reset5: \forall integer i; 0<=i<5 ==> fp[i] == 0; */ void reset_5 (int *fp); int reg_load[5]; int reg_add[5]; /*@ requires \valid(hp+(0..4)); assigns reg_load[0..4]; ensures \forall integer i; 0<=i<5 ==> reg_load[i] == hp[i]; */ void load_5 (int * hp); /*@ requires \valid(gp+(0..4)); assigns reg_add[0..4]; ensures \forall integer i; 0<=i<5 ==> reg_add[i] == \old(reg_load[i])+gp[i]; */ void add_5(int *gp); /*@ requires \valid(rp[0]+(0..4)); assigns rp[0][0..4]; ensures \forall integer i; 0<= i<5 ==> rp[0][i] == 0; */ void reset_1_5 (int (*rp) [5]) { reset_5(rp[0]);} /*@ requires \valid(lp[0]+(0..4)); assigns reg_load[0..4]; ensures \forall integer i; 0<=i<5 ==> reg_load[i] == lp[0][i]; */ void load_1_5 (int (*lp) [5]) {load_5(lp[0]);} /*@ requires \valid(ap[0]+(0..4)); assigns reg_add[0..4]; ensures \forall integer i; 0<=i<5 ==> reg_add[i] == reg_load[i]+ ap[0][i]; */ void add_1_5 (int (*ap) [5]) {add_5(ap[0]);} int t[20]; int tt[20][5]; /*@ assigns reg_load[0..4], reg_add[0..4],t[0..4]; ensures Pload : \forall integer i; 0<=i<5 ==> reg_load[i] == \old(t[i]); ensures Preset: \forall integer j; 0<=j<5 ==> t[j] == 0; ensures Padd : \forall integer k; 0<=k<5 ==> reg_add[k] == \old(t[k]); */ void calls_on_array_dim_1 (void) { load_5(t); reset_5(t); add_5(t); } /*@ assigns reg_load[0..4], reg_add[0..4],tt[0][0..4]; ensures Pload : \forall integer i; 0<=i<5 ==> reg_load[i] == \old(tt[0][i]); ensures Preset: \forall integer j; 0<=j<5 ==> tt[0][j] == 0; ensures Padd : \forall integer k; 0<=k<5 ==> reg_add[k] == \old(tt[0][k]); */ void calls_on_array_dim_2_to_1 (void) { load_5(tt[0]); reset_5(tt[0]); add_5(tt[0]); } /*@ assigns reg_load[0..4], reg_add[0..4],tt[0][0..4]; ensures Pload : \forall integer i; 0<=i<5 ==> reg_load[i] == \old(tt[0][i]); ensures Preset: \forall integer j; 0<=j<5 ==> tt[0][j] == 0; ensures Padd : \forall integer k; 0<=k<5 ==> reg_add[k] == \old(tt[0][k]); */ void calls_on_array_dim_2 (void) { load_1_5(tt); reset_1_5(tt); add_1_5(tt); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/reference_array_simple.i�������������������������0000666�0000000�0000000�00000001202�13571573400�023731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref -wp-msg-key refusage */ /* run.config_qualif OPT: -wp-model +ref */ int tt[10][5]; //@ ensures \result == p1[i]; assigns \nothing; int f1 (int * p1,int i) ; //@ ensures \result ==5; int call_f1(void) { tt[0][3] = 5; return f1(tt[0],3); } //@ ensures \result[3] == p2[j][3] ; assigns \nothing; int * f2 (int (*p2)[5], int j); //@ ensures \result == 5; int call_f2(void) { tt[2][3] = 5; return ((f2(tt,2))[3]); } //@ ensures \result == p3[k] ; assigns \nothing; int * f3(int ** p3,int k); int * tp [10]; //@ ensures \result == tp[5]; int * call_f3(void) { return (f3(tp,5)); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_hoare/refguards.i��������������������������������������0000666�0000000�0000000�00000001330�13571573400�021210� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref */ /* run.config_qualif OPT: -wp-model +ref */ //@ ensures \separated(c,d) ; void f( int *a, int *b ,int *c ,int * d, int k ) { a[k] = b[k] ; *d = *c ; *c = k ; } //@ ensures a[k]==b[k] ; void g( int *a, int *b, int k ) { a[k] = b[k] ; } /* No warning ; ensures checks the added hyps */ //@ ensures \separated(c,d); void h( int *c, int *d, int k ) { *d = *c ; *c = k ; } /* No warning ; ensures checks the added hyps */ /*@ ensures \separated(c,d); @ ensures \separated(c,*c); @ ensures \separated(c,*d); @ ensures \separated(*c,d); @ ensures \separated(d,*d); @ ensures KO: \separated(*c,*d); */ void s( int **c, int **d, int k ) { **d = **c ; **c = k ; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017236� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/manual.i����������������������������������������0000666�0000000�0000000�00000000725�13571573400�020671� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: */ /* run.config_qualif OPT: -wp-msg-key no-time-info @PTEST_DIR@/working_dir/swap.c @PTEST_DIR@/working_dir/swap1.h OPT: -wp-msg-key no-time-info -wp-rte @PTEST_DIR@/working_dir/swap.c @PTEST_DIR@/working_dir/swap2.h OPT: -load-module report -kernel-verbose 0 -wp-msg-key no-time-info -wp-rte @PTEST_DIR@/working_dir/swap.c @PTEST_DIR@/working_dir/swap2.h -wp-verbose 0 -then -no-unicode -report */ void look_at_working_dir(void); �������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/����������������������������������0000777�0000000�0000000�00000000000�13571573400�022044� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.0.res.oracle���������������0000666�0000000�0000000�00000001611�13571573400�025435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_manual/manual.i (no preprocessing) [kernel] Parsing tests/wp_manual/working_dir/swap.c (with preprocessing) [kernel] Parsing tests/wp_manual/working_dir/swap1.h (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_swap_ensures_A : Valid [wp] [Qed] Goal typed_swap_ensures_B : Valid [wp] Proved goals: 2 / 2 Qed: 1 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_manual/oracle_qualif/manual.0.report.json' [wp] Report out: 'tests/wp_manual/result_qualif/manual.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success swap 1 1 (8..20) 2 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�025141� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�026204� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.0.session/cache/d88a99b129ce316ba3299ac7e85f666d.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.0.session/cache/d88a99b129c0000666�0000000�0000000�00000000127�13571573400�027616� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0229, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.1.res.oracle���������������0000666�0000000�0000000�00000002361�13571573400�025441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_manual/manual.i (no preprocessing) [kernel] Parsing tests/wp_manual/working_dir/swap.c (with preprocessing) [kernel] Parsing tests/wp_manual/working_dir/swap2.h (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function swap [wp] 8 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_swap_ensures_A : Valid [wp] [Qed] Goal typed_swap_ensures_B : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_swap_assert_rte_mem_access : Valid [wp] [Qed] Goal typed_swap_assert_rte_mem_access_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_swap_assert_rte_mem_access_3 : Valid [wp] [Qed] Goal typed_swap_assert_rte_mem_access_4 : Valid [wp] [Qed] Goal typed_swap_assigns_part1 : Valid [wp] [Qed] Goal typed_swap_assigns_part2 : Valid [wp] Proved goals: 8 / 8 Qed: 5 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_manual/oracle_qualif/manual.1.report.json' [wp] Report out: 'tests/wp_manual/result_qualif/manual.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success swap 5 3 (16..28) 8 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.1.session/�����������������0000777�0000000�0000000�00000000000�13571573400�025142� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.1.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�026205� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.1.session/cache/19ce43ef6379eb9ea574ac9b1382a30c.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.1.session/cache/19ce43ef6370000666�0000000�0000000�00000000127�13571573400�027613� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0199, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.1.session/cache/522c058d7703faeb37d62ce550ad47a9.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.1.session/cache/522c058d7700000666�0000000�0000000�00000000127�13571573400�027442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0191, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.1.session/cache/a84bbfbec4416c44461feaf1d7cb7e08.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.1.session/cache/a84bbfbec440000666�0000000�0000000�00000000126�13571573400�030017� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.017, "steps": 19 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.2.res.oracle���������������0000666�0000000�0000000�00000003045�13571573400�025442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [rte] annotating function swap ------------------------------------------------------------- Functions WP Alt-Ergo Total Success swap 5 3 (16..28) 8 100% ------------------------------------------------------------- [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'swap' -------------------------------------------------------------------------------- [ Valid ] Post-condition 'A' by Wp.typed. [ Valid ] Post-condition 'B' by Wp.typed. [ Valid ] Assigns (file tests/wp_manual/working_dir/swap2.h, line 4) by Wp.typed. [ Valid ] Assertion 'rte,mem_access' (file tests/wp_manual/working_dir/swap.c, line 3) by Wp.typed. [ Valid ] Assertion 'rte,mem_access' (file tests/wp_manual/working_dir/swap.c, line 4) by Wp.typed. [ Valid ] Assertion 'rte,mem_access' (file tests/wp_manual/working_dir/swap.c, line 4) by Wp.typed. [ Valid ] Assertion 'rte,mem_access' (file tests/wp_manual/working_dir/swap.c, line 5) by Wp.typed. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 8 Completely validated 8 Total -------------------------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.2.session/�����������������0000777�0000000�0000000�00000000000�13571573400�025143� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.2.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�026206� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.2.session/cache/19ce43ef6379eb9ea574ac9b1382a30c.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.2.session/cache/19ce43ef6370000666�0000000�0000000�00000000127�13571573400�027614� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0137, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.2.session/cache/522c058d7703faeb37d62ce550ad47a9.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.2.session/cache/522c058d7700000666�0000000�0000000�00000000127�13571573400�027443� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0174, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.2.session/cache/a84bbfbec4416c44461feaf1d7cb7e08.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.2.session/cache/a84bbfbec440000666�0000000�0000000�00000000127�13571573400�030021� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0139, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.i.0.report.json������������0000666�0000000�0000000�00000002745�13571573400�026123� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "wp:functions": { "swap": { "swap_ensures_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_ensures_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } } } } } ���������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.i.1.report.json������������0000666�0000000�0000000�00000007673�13571573400�026131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 8, "valid": 8, "rank": 5 } }, "wp:functions": { "swap": { "swap_assert_rte_mem_access_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_assert_rte_mem_access_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "swap_assert_rte_mem_access_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "swap_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "swap_ensures_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_ensures_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 8, "valid": 8, "rank": 5 } } } } } ���������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/oracle_qualif/manual.i.2.report.json������������0000666�0000000�0000000�00000007673�13571573400�026132� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 8, "valid": 8, "rank": 5 } }, "wp:functions": { "swap": { "swap_assert_rte_mem_access_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_assert_rte_mem_access_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "swap_assert_rte_mem_access_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "swap_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "swap_ensures_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_ensures_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 8, "valid": 8, "rank": 5 } } } } } ���������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/working_dir/������������������������������������0000777�0000000�0000000�00000000000�13571573400�021554� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/working_dir/swap.c������������������������������0000666�0000000�0000000�00000000122�13571573400�022665� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������void swap(int *a,int *b) { int tmp = *a ; *a = *b ; *b = tmp ; return ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/working_dir/swap1.h�����������������������������0000666�0000000�0000000�00000000141�13571573400�022754� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ ensures A: *a == \old(*b) ; @ ensures B: *b == \old(*a) ; @*/ void swap(int *a,int *b) ; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_manual/working_dir/swap2.h�����������������������������0000666�0000000�0000000�00000000232�13571573400�022756� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ requires \valid(a) && \valid(b); @ ensures A: *a == \old(*b) ; @ ensures B: *b == \old(*a) ; @ assigns *a,*b ; @*/ void swap(int *a,int *b) ; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017257� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/Abs.v�������������������������������������������0000666�0000000�0000000�00000000065�13571573400�020154� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Require Import ZArith. Definition my_abs := Z.abs. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/abs.driver��������������������������������������0000666�0000000�0000000�00000000200�13571573400�021231� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������library "abs": logic integer ABS (integer) = "my_abs" ; coq.file := "Abs.v"; altergo.file := "abs.mlw"; why3.file := "abs.why";������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/abs.i�������������������������������������������0000666�0000000�0000000�00000000771�13571573400�020203� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-driver tests/wp_plugin/abs.driver */ /* run.config_qualif OPT: -wp -wp-driver tests/wp_plugin/abs.driver -wp-prover alt-ergo OPT: -wp -wp-driver tests/wp_plugin/abs.driver -wp-prover native:coq -wp-coq-script tests/wp_plugin/abs.script OPT: -wp -wp-driver tests/wp_plugin/abs.driver -wp-prover native:alt-ergo */ /*@ axiomatic Absolute { logic integer ABS(integer x) ; } */ /*@ ensures \result == ABS(x) ; */ int abs(int x) { if (x < 0) return -x ; return x ; } �������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/abs.mlw�����������������������������������������0000666�0000000�0000000�00000000203�13571573400�020540� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������logic my_abs : int -> int axiom abs_pos : forall x:int. x>=0 -> my_abs(x) = x axiom abs_neg : forall x:int. x<=0 -> my_abs(x) = -x ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/abs.script��������������������������������������0000666�0000000�0000000�00000000364�13571573400�021255� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* Generated by Frama-C WP *) Goal typed_abs_abs_ensures. Hint abs,default,property. Proof. intro n. intros. subst. unfold my_abs. induction H1; [ intros ; rewrite Zabs_non_eq | intros ; rewrite Z.abs_eq ] ; auto with zarith. Qed. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/abs.why�����������������������������������������0000666�0000000�0000000�00000000253�13571573400�020555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������theory Abs use int.Int function my_abs int : int axiom abs_pos : forall x:int. x>=0 -> my_abs x = x axiom abs_neg : forall x:int. x<=0 -> my_abs x = -x end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/asm.i�������������������������������������������0000666�0000000�0000000�00000000273�13571573400�020213� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������void main() { int src = 1; int dst = 2; asm ("mov %1, %0\n\t" "add $1, %0" : "=r" (dst) : "r" (src)); //@ assert OK: src == 1; //@ assert KO: dst == 2; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/bit_test.c��������������������������������������0000666�0000000�0000000�00000001354�13571573400�021243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-driver tests/wp_plugin/bit_test.driver */ /* run.config_qualif OPT: -wp-driver tests/wp_plugin/bit_test.driver -wp-prover why3:alt-ergo -wp-check */ /*@ axiomatic btest { logic 𝔹 lbtest(ℤ v, ℤ n) ; predicate btest(ℤ v, ℤ n) ; logic 𝔹 lbtest_qed(ℤ v, ℤ n) ; predicate btest_qed(ℤ v, ℤ n) ; } */ /*@ ensures ko: lbtest(order1, 0) ≡ lbtest(order2, 0); */ void check1(int order1, int order2) { return; } /*@ ensures ko: lbtest_qed(order1, 0) ≡ lbtest_qed(order2, 0); */ void check2(int order1, int order2) { return; } #include "__fc_integer.h" /*@ ensures ko: bit_test(order1, 0) ≡ bit_test(order2, 0); */ void check3(int order1, int order2) { return; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/bit_test.driver���������������������������������0000666�0000000�0000000�00000000371�13571573400�022312� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������library c2fc_bit : cbits; logic boolean lbtest (integer, integer) = "bit_testb"; predicate btest (integer, integer) = "bit_test"; logic boolean lbtest_qed (integer, integer) := \bit_test; predicate btest_qed (integer, integer) := \bit_test; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/bool.i������������������������������������������0000666�0000000�0000000�00000001657�13571573400�020375� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-let */ /* run.config_qualif OPT: -wp-no-let */ /*@ ensures 0 <= \result <= 2 ; */ int job(_Bool a, _Bool b) { return a+b; } /*@ behavior true: @ assumes a == 1 || b == 1; @ ensures \result == 1; @ behavior false: @ assumes !(a == 1 || b == 1); @ ensures \result == 0; */ _Bool bor_bool(_Bool a, _Bool b) { return (_Bool)(((int)a | (int)b) != 0); } /*@ behavior true: @ assumes a == 1 && b == 1; @ ensures \result == 1; @ behavior false: @ assumes !(a == 1 && b == 1); @ ensures \result == 0; */ _Bool band_bool(_Bool a, _Bool b) { return (_Bool)(((int)a & (int)b) != 0); } /*@ behavior true: @ assumes (a == 1 && b == 0) || (a == 0 && b == 1); @ ensures \result == 1; @ behavior false: @ assumes !((a == 1 && b == 0) || (a == 0 && b == 1)) ; @ ensures \result == 0; */ _Bool bxor_bool(_Bool a, _Bool b) { return (_Bool)(((int)a ^ (int)b) != 0); } ���������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/call.i������������������������������������������0000666�0000000�0000000�00000001152�13571573400�020343� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: (config_qualif) Nothing to improve here */ /* run.config_qed DONTRUN: (config_qed) see config_qualif */ /* The objective here is to check that 'job' preconditions are only proved under default behavior (not for A nor B). */ /*@ requires x > 0 ; ensures \result > 0; assigns \nothing ; */ int job(int x); /*@ ensures \result >= 0 ; @ assigns \nothing ; @ behavior A: @ assumes x < y; @ ensures \result > 0 ; @ behavior B: @ assumes x > y; @ ensures \result > 0 ; */ int main(int x,int y) { if (x<y) return job(y-x); if (x>y) return job(x-y); return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/cint.i������������������������������������������0000666�0000000�0000000�00000003003�13571573400�020362� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: OPT: -no-warn-signed-overflow OPT: -warn-unsigned-overflow OPT: -warn-signed-downcast OPT: -warn-unsigned-downcast OPT: -wp-model +nat */ /* run.config_qualif DONTRUN: */ // For each function <F=downcast|overflow>, result should be: // - identity when -warn-F, typically R(a,a) // - modulus when -no-warn-F, typically R(to_xxx(a),a) // For bitwise functions, result should be identity for signed and conversion for unsigned, // whatever the kernel options are (no RTE involved here). With +nat, have only signedness for types hypotheses. // Default kernel options: // -warn-signed-overflow -no-warn-<others> //@ predicate R(integer x,integer y); //@ ensures R(\result,a); int signed_bitwise(int a) { return ~a; // no conversion in *all* models } //@ ensures R(\result,a); short signed_downcast(int a) { return (short) a; // identity *only* for testcases 3 (-warn-signed-downcast) } //@ ensures R(\result,a+b); int signed_overflow(int a,int b) { return a+b; // identity *except* for testcase 1 (-no-warn-signed-overflow) } //@ ensures R(\result,a); unsigned unsigned_bitwise(unsigned a) { return ~a; // converted in *all* models (bit extension), including testcase 5 (nat) } //@ ensures R(\result,a); unsigned unsigned_downcast(int a) { return (unsigned) a; // identity *only* for testcases 4 (-warn-unsigned-downcast) } //@ ensures R(\result,a+b); unsigned unsigned_overflow(unsigned a,unsigned b) { return a+b; // identity *only* for testcases 2 (-warn-unsigned-overflow) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/combined.c��������������������������������������0000666�0000000�0000000�00000002013�13571573400�021177� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: [PB] temporary removed since a difference has to be validated. */ /* run.config_qualif EXECNOW: @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -wp-par 1 -load-module @PTEST_DIR@/@PTEST_NAME@ */ /* ZD : this should not be here such as it cannot be tested by all frama-c developer */ /*@ axiomatic A { @ predicate P(int x); @ }*/ /*@ ensures P(\result); @ assigns \nothing; */ int f(int i); /*@ assigns \nothing; */ int g(int j); void job(int *t, int A) { /*@ assert 50 <= A <= 100; */ /*@ loop invariant 0 <= i <= 50; @ loop invariant \forall integer k; 0 <= k < i ==> P(t[k]); @ loop assigns i,t[0..49]; @ */ for(int i = 0; i < 50; i++) t[i] = f(i); /*@ loop invariant A <= j <= 100; @ loop assigns j,t[A..99]; @ */ for(int j = A; j < 100; j++) t[j] = g(j); /*@ assert \forall integer k; 0 <= k < 50 ==> P(t[k]); */ } int T[100]; void main(void) { job(T, 50); // job(T, 48); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/config.i����������������������������������������0000666�0000000�0000000�00000000140�13571573400�020671� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: */ /* run.config_qualif CMD: tests/wp_plugin/config.sh OPT: */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/config.sh���������������������������������������0000777�0000000�0000000�00000001027�13571573400�021063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh ERGO=`alt-ergo -version` WHY3=`why3 --version` # sed command to prevent from diffs about the date: "(Month Year)" COQC=`coqc --version | head -1 | sed -e 's: ([A-Z][a-z]* [0-9]*)$::'` echo "----------------------------------------------------------" echo "WP Requirements for Qualif Tests (3)" echo "----------------------------------------------------------" echo "1. The Alt-Ergo theorem prover, version ${ERGO}" echo "2. The ${WHY3}" echo "3. ${COQC}" echo "----------------------------------------------------------" ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/convert.i���������������������������������������0000666�0000000�0000000�00000000653�13571573400�021115� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: */ /* run.config_qualif OPT: OPT: -wp-prover native:alt-ergo -wp-report=tests/native.report */ // -------------------------------------------------------------------------- // --- Conversions // -------------------------------------------------------------------------- //@ lemma floor: \forall real x; \floor(x) <= x < \floor(x)+1 ; //@ lemma ceil: \forall real x; \ceil(x)-1 < x <= \ceil(x) ; �������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/copy.i������������������������������������������0000666�0000000�0000000�00000001163�13571573400�020404� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Everything should be discharged. /*@ requires n>=0 ; @ requires \separated( a+ (0..n-1) , b + (0..n-1) ); @ ensures \forall integer k ; 0 <= k < n ==> a[k] == b[k] ; @ assigns a[0..n-1] ; @ */ void copy( int * a , int * b , int n ) { /*@ loop invariant Range: 0 <= i <= n ; @ loop invariant Copy: \forall integer k ; 0 <= k < i ==> a[k] == b[k] ; @ loop assigns i , a[0..n-1] ; @ */ for (int i = 0 ; i < n ; i++) { L: a[i] = b[i] ; /*@ assert A: \forall integer k ; 0 <= k < i ==> a[k] == \at(a[k],L); */ /*@ assert B: \forall integer k ; 0 <= k < i ==> b[k] == \at(b[k],L); */ } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/dynamic.i���������������������������������������0000666�0000000�0000000�00000004356�13571573400�021065� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-dynamic -wp-msg-key "calls" */ /* run.config_qualif OPT: -wp-dynamic -wp */ //----------------------------------------------------------------------------- /*@ requires -10<=x<=10; ensures \result == x+1; assigns \nothing; */ int f1(int x); /*@ ensures \result == x-1; assigns \nothing; */ int f2(int x); typedef struct S { int param ; int (*f)(int) ; } ; /*@ requires (closure->f == &f1 && \abs(closure->param)<=5) || closure->f == &f2 ; ensures \abs(\result - closure->param) <= 1 ; */ int call(struct S * closure) { /*@ calls f1,f2 ; */ return (closure -> f)(closure -> param) ; } //----------------------------------------------------------------------------- int X; //@ assigns X; ensures X==x; int g(int x); /*@ requires p->f == &g || p->f == (int (*)(int)) 0; @ ensures p->f == &g ==> X==1; @ ensures p->f == (int (*)(int)) 0 ==> X==\old(X); */ void guarded_call (struct S * p) { if (p->f != (int (*)(int)) 0) //@ calls g; (* (p->f))(1); } //----------------------------------------------------------------------------- int X1; //@ assigns X1; ensures X1==1; int h1(void); int X2; //@ assigns X2; ensures X2==2; int h2(void); //@ assigns \nothing; int h0(void); /*@ behavior bhv1: @ assumes p == &h1; @ assigns X1; @ ensures X1==1; */ int behavior (int (*p)(void)) { //@ calls h1, h2; // Shall not be proved in default behavior (known bug) return (*p)(); } /*@ behavior bhv1: @ assumes p == &h1; @ assigns X1; @ ensures X1==1; @ behavior bhv0: @ assumes p == &h0; @ assigns \nothing; @ ensures X1==\old(X1); */ int some_behaviors (int (*p)(void)) { //@ for bhv1,bhv0: calls h1, h2, h0; return (*p)(); } /*@ ensures X1==1; assigns X1 ; */ int missing_context (int (*p)(void)) { //@ calls h1 ; return (*p)(); } //----------------------------------------------------------------------------- //@ requires \false; ensures \false; exits \false; assigns \nothing; int unreachable_g(int x); //@ ensures X==\old(X); void no_call (void) { struct S * p; p->f = (int (*)(int)) 0; if (p->f != (int (*)(int)) 0) //@ calls unreachable_g; (* (p->f))(1); } //----------------------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/flash-ergo.driver�������������������������������0000666�0000000�0000000�00000000146�13571573400�022524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������library INDEX: const logic index INDEX_init = {coq="dumb"; altergo="const(0)"; why3="Flash.init"; } ; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/flash.c�����������������������������������������0000666�0000000�0000000�00000007314�13571573400�020525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: OPT: -wp-driver tests/wp_plugin/flash.driver,tests/wp_plugin/flash-ergo.driver OPT: -wp-driver tests/wp_plugin/flash.driver -load-module tests/wp_plugin/flash.ml */ /* run.config_qualif OPT: -wp-timeout 1 OPT: -wp-driver tests/wp_plugin/flash.driver,tests/wp_plugin/flash-ergo.driver OPT: -wp-driver tests/wp_plugin/flash.driver -load-module tests/wp_plugin/flash.ml */ /* -------------------------------------------------------------------------- */ /* --- Observation of Sequence of Reads and Writes --- */ /* -------------------------------------------------------------------------- */ //@ ghost int OBSERVER_time; /*@ axiomatic EVENT { type event = | RdAt_int(int *) | WrAt_int(int *) ; logic \list<event> OBSERVER{L} reads OBSERVER_time; } */ /* -------------------------------------------------------------------------- */ /* --- Observation of memory access per pointer --- */ /* -------------------------------------------------------------------------- */ /*@ axiomatic INDEX { type index; logic index INDEX_init ; } */ /* -------------------------------------------------------------------------- */ /* --- Instrumentation of read values via function RD --- */ /* -------------------------------------------------------------------------- */ //@ghost int RD_time ; /*@ axiomatic RD { logic index RD_current{L} reads RD_time; logic index RD_update( index idx , int *p ) reads \nothing; logic integer RD_access( index idx , int *p ) reads \nothing; logic int RD_value( int *p , integer k ) reads \nothing; } */ /*@ ensures RD_current == RD_update(\old(RD_current),p); ensures RD_value( p , RD_access( \old(RD_current) , p ) ) == \result; ensures OBSERVER == ( \old(OBSERVER) ^ [| RdAt_int(p) |] ); ensures OBSERVER_time == \old(OBSERVER_time)+1; assigns OBSERVER_time ; ensures RD_time == \old(RD_time)+1; assigns RD_time ; */ int RD(int *p); /* -------------------------------------------------------------------------- */ /* --- Instrumentation of writen values via function WR --- */ /* -------------------------------------------------------------------------- */ //@ ghost int WR_time ; /*@ axiomatic WR { logic index WR_current{L} reads WR_time; logic index WR_update( index idx , int *p ) reads \nothing; logic integer WR_access( index idx , int *p ) reads \nothing; logic int WR_value( int *p , integer k ) reads \nothing; } */ /*@ ensures WR_current == WR_update(\old(WR_current),p); ensures WR_value( p , WR_access( \old(WR_current) , p ) ) == v; ensures OBSERVER == ( \old(OBSERVER) ^ [| WrAt_int(p) |] ); ensures OBSERVER_time == \old(OBSERVER_time)+1; assigns OBSERVER_time ; ensures WR_time == \old(WR_time)+1; assigns WR_time ; */ void WR(int *p,int v); /* -------------------------------------------------------------------------- */ /* --- Function under Proof --- */ /* -------------------------------------------------------------------------- */ int a; int b; /*@ requires OBSERVER == [| |] ; requires RD_current == INDEX_init ; requires WR_current == INDEX_init ; ensures Events: OBSERVER == [| RdAt_int(&a), RdAt_int(&b) , WrAt_int(&b) , RdAt_int(&a) |] ; ensures A_reads: RD_access( RD_current , &a ) == 2; ensures B_reads: RD_access( RD_current , &b ) == 1; ensures B_writes: WR_access( WR_current , &b ) == 1; ensures ReadValues: \result == RD_value(&a,0) + RD_value(&a,1) + RD_value(&b,0) ; ensures WriteValues: WR_value(&b,0) == RD_value(&a,0) + RD_value(&b,0) ; */ int job(void) { int s = 0; s += RD(&a); s += RD(&b); WR(&b,s); s += RD(&a); return s; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/flash.driver������������������������������������0000666�0000000�0000000�00000001225�13571573400�021571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������library INDEX: memory why3.file += "flash.mlw"; type index = {coq="dumb"; altergo="(addr,int)farray"; why3="Flash.t"; } ; logic integer INDEX_access( index , addr ) = {coq="dumb"; altergo="(%1)[%2]"; why3="Flash.get"; } ; logic index INDEX_update( index , addr ) = {coq="dumb"; altergo="((%1)[(%2) <- (%1)[%2]+1])"; why3="Flash.update"}; logic index INDEX_init := "INDEX_init" ; library RD: INDEX logic integer RD_access( index , addr ) := "INDEX_access" ; logic index RD_update( index , addr ) := "INDEX_update" ; library WR: INDEX logic integer WR_access( index , addr ) := "INDEX_access" ; logic index WR_update( index , addr ) := "INDEX_update" ; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/flash.ml����������������������������������������0000666�0000000�0000000�00000000670�13571573400�020711� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������module L = Wp.Lang module F = Wp.Lang.F let init _ = F.e_const (L.t_addr()) F.e_zero let update = function | [ m ; a ] -> F.e_set m a (F.e_add (F.e_get m a) (F.e_int 1)) | _ -> assert false let access = function | [ m ; a ] -> F.e_get m a | _ -> assert false let () = begin Wp.LogicBuiltins.hack "INDEX_init" init ; Wp.LogicBuiltins.hack "INDEX_access" access ; Wp.LogicBuiltins.hack "INDEX_update" update ; end ������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/flash.mlw���������������������������������������0000666�0000000�0000000�00000000444�13571573400�021077� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������module Flash use map.Map use map.Const use int.Int use frama_c_wp.memory.Memory type t = map addr int function get (m:t) (x:addr) : int = m[x] function update (m:t) (x:addr) : t = m[ x <- (m[x] + 1) ] function init : t = const 0 end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/float_format.i����������������������������������0000666�0000000�0000000�00000000376�13571573400�022114� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-prover native:coq OPT: -wp-prover native:alt-ergo -wp-steps 50 -wp-timeout 1 OPT: -wp-prover alt-ergo -wp-steps 50 -wp-timeout 1 */ //@ ensures KO: \result == 0.2 + x ; float output(float x) { return 0.2 + x ; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/float_model.i�����������������������������������0000666�0000000�0000000�00000001000�13571573400�021705� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +real OPT: -wp-model +float */ /* run.config_qualif DONTRUN: */ //@ predicate P(real x); float FD,FF ; double DD,DF ; /*@ ensures ACSL_R: P( 2.1 ); ensures ACSL_F: P( 2.1f ); ensures ACSL_FR: P( (float) 2.1 ); ensures ACSL_DR: P( (double) 2.1 ); ensures ACSL_DF: P( (double) 2.1f ); ensures C_FD: P( FD ); ensures C_FF: P( FF ); ensures C_DD: P( DD ); ensures C_DF: P( DF ); */ void job(void) { FD = 2.1 ; FF = 2.1f ; DD = 2.1 ; DF = 2.1f ; } frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/float_real.i������������������������������������0000666�0000000�0000000�00000000563�13571573400�021545� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +real OPT: -wp-model +float */ /* run.config_qualif OPT: -wp-model +real OPT: -wp-model +float */ // OK with +real, KO with +float /*@ ensures \result <==> (\abs(x-y) < 1e-5) ; */ static int dequal(double const x, double const y) { double tmp = x-y ; if ( tmp < 1e-5 && tmp > -1e-5 ) return 1; else return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/frame.i�����������������������������������������0000666�0000000�0000000�00000001011�13571573400�020514� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Everything FRAMED goals should be discharged. Not the KO ones. int g ; void f(void) { return; } /*@ ensures FRAMED: \result == \old(g) ; ensures KO: \result == g ; */ int local(void) { int x = g ; f(); return x; } //@ensures KO: \result == \old(g) ; int global(void) { f(); return g; } //@ensures KO: \result == \old(*p) ; int localref(int *p) { f(); //@ assert FRAMED: p == \at(p,Pre); return *p; } //@ensures KO: \result == r ; int alias(int r) { int p = (int) &r ; f(); return r ; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/ground_real.i�����������������������������������0000666�0000000�0000000�00000000146�13571573400�021733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ lemma R: \forall real x,y ; (x + 1.2 + y - 0.2 <= y - x + 1.5) <==> (x <= 1.0 / 4.0) ; */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/inductive.c�������������������������������������0000666�0000000�0000000�00000004013�13571573400�021413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-prover native:coq -wp-gen -wp-msg-key print-generated */ /* run.config_qualif OPT: -wp-prover native:coq -wp-coq-script tests/wp_plugin/inductive.script -wp-timeout 240 */ typedef struct _list { int element; struct _list* next; } list; /*@ inductive reachable{L} (list* root, list* node) { case root_reachable{L}: \forall list* root; reachable(root,root); case next_reachable{L}: \forall list* root, *node; \valid(root) ==> reachable(root->next, node) ==> reachable(root,node); } */ /*@ predicate swap{L1, L2}(int *a, int *b, integer begin, integer i, integer j, integer end) = begin <= i < j < end && \at(a[i], L1) == \at(b[j], L2) && \at(a[j], L1) == \at(b[i], L2) && \forall integer k; begin <= k < end && k != i && k != j ==> \at(a[k], L1) == \at(b[k], L2); predicate same_array{L1,L2}(int *a, int *b, integer begin, integer end) = \forall integer k; begin <= k < end ==> \at(a[k],L1) == \at(b[k],L2); inductive same_elements{L1, L2}(int *a, int *b, integer begin, integer end) { case refl{L1, L2}: \forall int *a, int *b, integer begin, end; same_array{L1,L2}(a, b, begin, end) ==> same_elements{L1, L2}(a, b, begin, end); case swap{L1, L2}: \forall int *a, int *b, integer begin, i, j, end; swap{L1, L2}(a, b, begin, i, j, end) ==> same_elements{L1, L2}(a, b, begin, end); case trans{L1, L2, L3}: \forall int* a, int *b, int *c, integer begin, end; same_elements{L1, L2}(a, b, begin, end) ==> same_elements{L2, L3}(b, c, begin, end) ==> same_elements{L1, L3}(a, c, begin, end); } */ /*@ lemma test: \forall list *root,*node; reachable(root,node) ==> ( root == node || (\valid(root) && reachable(root->next, node)) ); */ /*@ lemma offset{L1,L2} : \forall int *a, *b, integer begin, end, offset; same_elements{L1,L2}(a+offset,b+offset, begin, end) ==> same_elements{L1,L2}(a, b, begin+offset, end+offset); */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/inductive.script��������������������������������0000666�0000000�0000000�00000002445�13571573400�022504� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* Generated by Frama-C WP *) Goal typed_lemma_offset. Hint offset,property. Proof. intros. remember (shift_sint32 a_1 i) as a_11. remember (shift_sint32 a i) as a1. revert dependent a. revert dependent a_1. induction H; intros; subst. - apply Q_refl. unfold P_same_array; intros. unfold P_same_array in *. unfold shift_sint32, shift in *. destruct a0, a_0. simpl in *. replace i1 with (i + (i1 -i)) by omega. rewrite 2!Z.add_assoc. apply H; omega. - apply Q_swap with (i_2:=i+i_2) (i_1:=i+i_1). unfold P_swap in *. decompose [and] H; clear H. unfold shift_sint32, shift in *. destruct a0, a_0. simpl in *. repeat split; try omega. + rewrite 2!Z.add_assoc. assumption. + rewrite 2!Z.add_assoc. assumption. + intros. replace i_0 with (i + (i_0 - i)) by omega. rewrite 2!Z.add_assoc. apply H6; omega. - apply Q_trans with (t_1:=t_1) (a_1:=shift_sint32 a_1 (-i)). + apply IHP_same_elements1. destruct a_1; unfold shift_sint32, shift; simpl. f_equal; omega. reflexivity. + apply IHP_same_elements2. reflexivity. destruct a_1; unfold shift_sint32, shift; simpl. f_equal; omega. Qed. Goal typed_lemma_test. Hint property,test. Proof. intros. destruct H. - left. reflexivity. - right. split;assumption. (* auto with zarith. *) Qed. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/init_const.i������������������������������������0000666�0000000�0000000�00000000705�13571573400�021604� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-init-const */ /* run.config_qualif OPT: -wp-init-const */ int A[4] = { 1,2,3 } ; const int B[4] = { 1,2,3 } ; //@ ensures KO: \result == 6 ; int fA(void) { return A[0]+A[1]+A[2]+A[3] ; } //@ ensures OK: \result == 6 ; int fB(void) { return B[0]+B[1]+B[2]+B[3] ; } //@ ensures KO: \result == \at(A[3],Init) ; int fC(void) { return A[3]; } //@ ensures OK: \result == \at(B[3],Init) ; int fD(void) { return B[3]; } �����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/init_const_guard.i������������������������������0000666�0000000�0000000�00000000752�13571573400�022770� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-init-const */ /* run.config_qualif OPT: -wp-init-const */ int x ; int * const q = &x ; const int * p = &x ; /*@ ensures Const: q == &x ; ensures Pointed_Valid: \valid(q); ensures Q_ReadOnly: \valid_read(&q); ensures Q_NotWrite: !\valid(&q); */ int f(void) { return 0; } /*@ ensures P_not_Const: \valid(&p); */ void g(void) { p = &x ; //@ assert Read: \valid_read(p); //@ assert Guard_against_Const: !\valid(p); *((int *)p) = 2 ; } ����������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/init_extern.i�����������������������������������0000666�0000000�0000000�00000000560�13571573400�021762� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: tests/wp_plugin/init_linker.i */ /* run.config_qualif OPT: tests/wp_plugin/init_linker.i */ // To be linked with init_linker that defines the initial value of 'a' extern int a ; extern int b ; /*@ ensures OK: \at( a , Init ) == 2 ; ensures KO: \at( a , Init ) == 0 ; ensures KO: \at( b , Init ) == 0 ; */ void f(void) { return; } ������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/init_linker.i�����������������������������������0000666�0000000�0000000�00000000247�13571573400�021743� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: this is complementary file to init_extern.i */ /* run.config_qualif DONTRUN: this is complementary file to init_extern.i */ int a = 2 ; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/init_valid.i������������������������������������0000666�0000000�0000000�00000000444�13571573400�021555� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� int A[4] = { 1,2,3 } ; const int B[4] = { 1,2,3 } ; void validA(void) { //@ assert OK: \valid_read( &B[1] ); //@ assert OK: \valid( &A[2] ); A[2] = B[1] ; } void validB(void) { //@ assert OK: \valid_read( &A[1] ); //@ assert KO: \valid( &B[2] ); *((int*)&B[2]) = A[1] ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/initarr.i���������������������������������������0000666�0000000�0000000�00000000616�13571573400�021104� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-init-const */ /* run.config_qualif OPT: -wp-init-const */ typedef struct { int *f; int *g; } S; int a,b,c,d,e,f; const S A[3] = { { .f=&a,.g=&b}, {.f=&c,.g=&d}, {.f=&e,.g=&f} }; /*@ requires 0 <= i < 3 ; ensures SEP: \separated( A[i].f , A[i].g ); ensures ALT: (A[i].f == &a) || (A[i].f == &c) || (A[i].f == &e) ; */ void job(int i) { return; } ������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/injector.c��������������������������������������0000666�0000000�0000000�00000002535�13571573400�021245� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -pp-annot -wp -wp-par 1 -wp-prop="-qed_ko" OPT: -pp-annot -wp -wp-par 1 -wp-prop qed_ko -wp-steps 50 */ #define OK 33 #define KO 55 int k ; int inp[5] ; int out[5] ; /*@ requires 0 <= k < 5 ; @ ensures \result == out[\old(k)] ; @ ensures inp[\old(k)] == u ; @ ensures k == \old(k)+1 ; @ assigns k,inp[k] ; @ */ int g(int u); /*@ requires k == 0 ; @ behavior FST_FAIL: @ assumes out[0] != OK ; @ ensures qed_ok: k == 1 ; @ ensures qed_ok: inp[0] == a ; @ ensures qed_ok: \result == KO ; @ behavior SND_FAIL: @ assumes out[0] == OK ; @ assumes out[1] != OK ; @ ensures qed_ok: k == 2 ; @ ensures qed_ok: inp[0] == a ; @ ensures qed_ok: inp[1] == b ; @ ensures qed_ok: \result == KO ; @ behavior SUCCESS: @ assumes out[0] == OK ; @ assumes out[1] == OK ; @ ensures qed_ok: k == 2 ; @ ensures qed_ok: inp[0] == a ; @ ensures qed_ok: inp[1] == b ; @ ensures qed_ok: \result == OK ; @ behavior ko: @ ensures qed_ko: inp[0] == b ; @ behavior ko_1: @ assumes out[0] == OK ; @ assumes out[1] == OK ; @ ensures qed_ko: k == 1 ; @ ensures qed_ko: inp[1] == a ; @ ensures qed_ko: \result == KO ; @ */ int f(int a,int b) { int x ; int y ; x = g(a); if (x != OK) return KO ; y = g(b); if (y != OK) return KO ; return OK ; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/invertible.i������������������������������������0000666�0000000�0000000�00000002446�13571573400�021602� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: */ /*@ axiomatic A { @ logic integer a reads \nothing ; @ logic integer a1 reads \nothing ; @ logic integer a2 reads \nothing ; @ logic integer b reads \nothing ; @ logic integer b1 reads \nothing ; @ logic integer b2 reads \nothing ; @ logic integer c reads \nothing ; @ logic integer c1 reads \nothing ; @ logic integer c2 reads \nothing ; @ } */ /*@ requires Invertible_11: (( a1^a2 ^ b) == (a1^a2 ^ c)) <==> (b == c); @ requires Invertible_12: (( a ^ b) == ( a ^ c)) <==> (b == c); @ requires Invertible_13: (( a ^ b) == a ) <==> (b == 0) ; @ requires Invertible_14: (((a1|a2) ^ b) == (a1|a2) ) <==> (b == 0) ; @ requires Invertible_21: ((a ^ b1^b2 ) == (c ^ b1^b2)) <==> (a == c); @ requires Invertible_22: ((a ^ b ) == (c ^ b )) <==> (a == c); @ requires Invertible_23: ((a ^ b ) == b ) <==> (a == 0); @ requires Invertible_24: ((a ^ (b1|b2)) == (b1|b2)) <==> (a == 0); @ requires Invertible_31: ((a ^ c1^c2 ) == (b ^ c1^c2)) <==> (a == b); @ requires Invertible_32: ((a ^ c ) == (b ^ c )) <==> (a == b); @ requires Invertible_33: ((a ^ c ) == c ) <==> (a == 0); @ requires Invertible_34: ((a ^ (c1|c2)) == (c1|c2)) <==> (a == 0); */ void main (void); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/loop.i������������������������������������������0000666�0000000�0000000�00000000740�13571573400�020403� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 -wp-prop qed_ok */ /*@ requires \valid(t + (a..b)); @ requires a <= b ; @ ensures qed_ok: \forall int i ; a <= i <= b ==> t[i] == e ; @ assigns qed_ok: t[a..b] ; @*/ void init( int * t , int a , int b , int e ) { /*@ loop invariant qed_ok: a <= i <= b+1 ; @ loop invariant qed_ok: \forall int j ; a <= j < i ==> t[j] == e ; @ loop assigns qed_ok: i,t[a..i-1] ; */ for ( int i = a ; i <= b ; i ++ ) t[i] = e ; } ��������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/loopcurrent.i�����������������������������������0000666�0000000�0000000�00000000343�13571573400�022005� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /*@ requires (n+p) > 0; */ void f(int n,int p) { int r; n += p; r = 0; /*@ loop invariant \at(n,LoopEntry) == \at(n+p,Pre); loop invariant \at(n + r,LoopCurrent) == \at(n,LoopEntry); */ while (n--) r++; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/loopentry.i�������������������������������������0000666�0000000�0000000�00000000322�13571573400�021461� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /*@ requires (n+p) > 0; */ void f(int n,int p) { int r; n += p; r = 0; /*@ loop invariant \at(n,LoopEntry) == \at(n+p,Pre); loop invariant n + r == \at(n,LoopEntry); */ while (n--) r++; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/loopextra.i�������������������������������������0000666�0000000�0000000�00000000350�13571573400�021444� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� void f (int n) { for (int i = 0; i < n; i++) { /*@ assert \at(i,LoopEntry) == 0; */ int j = 0; while (j++ < i) { /*@ assert \at(j,LoopEntry) == 0; */ /*@ assert \at(j,LoopCurrent) + 1 == j; */ } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/mask.i������������������������������������������0000666�0000000�0000000�00000000212�13571573400�020357� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ ensures A: \result == (-129 & x) ; ensures B: \result == (0x7F & x) ; */ int compute(unsigned char x) { return x & 0xFF7F ; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/math.i������������������������������������������0000666�0000000�0000000�00000011577�13571573400�020375� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: */ /* run.config_qualif OPT: -wp-prover alt-ergo -wp-prop=-ko -wp-timeout 100 -wp-steps 1500 OPT: -wp-prover native:alt-ergo -wp-report=tests/native.report -wp-prop=-ko -wp-timeout 100 -wp-steps 1500 OPT: -wp-prover alt-ergo -wp-prop=ko -wp-timeout 1 -wp-steps 50 OPT: -wp-prover native:alt-ergo -wp-report=tests/native.report -wp-prop=ko -wp-timeout 1 */ // -------------------------------------------------------------------------- // --- Absolute // -------------------------------------------------------------------------- //@ lemma abs_pos: \forall real x,y ; 0 <= x < y ==> \abs(x) < \abs(y) ; //@ lemma abs_neg: \forall real x,y ; x < y <= 0 ==> \abs(x) > \abs(y) ; // -------------------------------------------------------------------------- // --- Min/Max // -------------------------------------------------------------------------- //@ lemma min_inf: \forall real x,y; \min(x,y) <= x && \min(x,y) <= y ; //@ lemma min_or: \forall real x,y; \min(x,y) == x || \min(x,y) == y ; //@ lemma max_inf: \forall real x,y; x <= \max(x,y) && y <= \max(x,y) ; //@ lemma max_or: \forall real x,y; \max(x,y) == x || \max(x,y) == y ; //@ lemma min_ac: \forall real x,y,z; \min(x,\min(y,z)) == \min(\min(x,y),z) && \min(x,y) == \min(y,x) ; //@ lemma max_ac: \forall real x,y,z; \max(x,\max(y,z)) == \max(\max(x,y),z) && \max(x,y) == \max(y,x) ; // -------------------------------------------------------------------------- // --- Square // -------------------------------------------------------------------------- //@ lemma sqrt_pos: \forall real x,y; 0 <= x ==> 0 <= \sqrt(x) ; //@ lemma sqrt_mono: \forall real x,y; 0 <= x < y ==> \sqrt(x) < \sqrt(y) ; // -------------------------------------------------------------------------- // --- Exponential // -------------------------------------------------------------------------- //@ lemma exp_pos: \forall real x; \exp(x) > 0 ; //@ lemma log_exp_mul_add: \forall real a,b; \log(\exp(a) * \exp(b)) == a+b ; //@ lemma exp_log_add_mul: \forall real a,b; a > 0 ==> b > 0 ==> \exp(\log(a) + \log(b)) == a*b ; //@ lemma pow_2: \forall real a; a>0 ==> \pow(a,2) == a * a ; // -------------------------------------------------------------------------- // --- Trigonometry // -------------------------------------------------------------------------- //@ lemma atan_sin_cos: \forall real x; \sin(\atan(x)) / \cos(\atan(x)) == x ; // -------------------------------------------------------------------------- // --- Hyperbolic // -------------------------------------------------------------------------- //@ lemma sinh_opp: \forall real x; \sinh(-x) == -\sinh(x) ; //@ lemma cosh_opp: \forall real x; \cosh(-x) == \cosh(x) ; //@ lemma tanh_opp: \forall real x; \tanh(-x) == -\tanh(x) ; // -------------------------------------------------------------------------- // --- Polar // -------------------------------------------------------------------------- //@ lemma distance: \forall real x,y; \hypot(x,y) == \sqrt( x*x + y*y ); // -------------------------------------------------------------------------- /*@ ensures sin_asin: \forall real x; -1 <= x <= 1 ==> \sin(\asin(x)) == x ; @ ensures sin_asin_in_range: \forall real y; \let x = \cos(y) ; \sin(\asin(x)) == x ; //@ ensures asin_sin: \forall real x; -\pi/2 <= x <= \pi/2 ==> \asin(\sin(x)) == x ; // TODO: uncomments @ ensures cos_acos: \forall real x; -1 <= x <= 1 ==> \cos(\acos(x)) == x ; @ ensures cos_acos_in_range: \forall real y; \let x = \sin(y) ; \cos(\acos(x)) == x ; //@ ensures acos_cos: \forall real x; 0 <= x <= \pi ==> \acos(\cos(x)) == x ; // TODO: uncomments @ ensures tan_atan: \forall real x; \tan(\atan(x)) == x ; //@ ensures atan_tan: \forall real x; -\pi/2 <= x <= \pi/2 ==> \atan(\tan(x)) == x ; // TODO: uncomments @ ensures log_pow: \forall real x,b; 0 < x ==> \log(\pow(x,b)) == \log(x)*b ; @ ensures log_exp: \forall real x; \log(\exp(x)) == x ; @ ensures exp_log: \forall real x; 0 < x ==> \exp(\log(x)) == x ; @ ensures min_plus_distrib: \forall real x,y,z; \min(x,y)+z == \min(x+z,y+z) ; @ ensures sqrt_pos: \forall real x; x>0 ==> \sqrt(x)>0 ; @ ensures sqrt_pos0: \forall real x; x>=0 ==> \sqrt(x)>=0 ; */ void ok(void) { }; /*@ ensures ko: sin_asin: \forall real x; \sin(\asin(x)) == x ; @ ensures ko: cos_acos: \forall real x; \cos(\acos(x)) == x ; @ ensures ko: asin_sin: \forall real x; \asin(\sin(x)) == x ; @ ensures ko: acos_cos: \forall real x; \acos(\cos(x)) == x ; @ ensures ko: atan_tan: \forall real x; \atan(\tan(x)) == x ; @ ensures ko: log_pow: \forall real x,b; \log(\pow(x,b)) == \log(x)*b ; @ ensures ko: exp_log: \forall real x; \exp(\log(x)) == x ; @ ensures ko: exp_log_add_mul: \forall real a,b; \exp(\log(a) + \log(b)) == a*b ; @ ensures ko: sqrt_pos: \forall real x; \sqrt(x) >= 0 ; */ void ko(void) { }; ���������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/model.i�����������������������������������������0000666�0000000�0000000�00000000637�13571573400�020537� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config CMD: @frama-c@ -wp-share ./share -wp-msg-key cluster,shell,print-generated -wp-prover why3 OPT: -wp-model Typed -wp -wp-gen -wp-print -then -wp-model Typed+ref -wp -wp-gen -wp-print */ /* run.config_qualif OPT: -wp-msg-key cluster -wp-model Typed -wp-check -then -wp -wp-model Typed+ref -wp-check */ //@ predicate P(integer a); //@ ensures P(\result); int f(int *p,int k) { return p[k]; } �������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/nowp.c������������������������������������������0000666�0000000�0000000�00000000145�13571573400�020406� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� int main(int a) { int b; if (a) b = 42 + a; //@ assert no_wp: \initialized(&b); return b; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/nowp.c.0.report.json����������������������������0000666�0000000�0000000�00000000005�13571573400�023021� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/nth.i�������������������������������������������0000666�0000000�0000000�00000001350�13571573400�020221� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-prover alt-ergo -wp-prop=-lack OPT: -wp-prover why3:alt-ergo */ /*@ axiomatic Nth { logic integer f(integer a); lemma access_16_16: ok: \forall integer k ; 0 <= k < 16 ==> f(k)==\nth([| f(0), f(1), f(2), f(3), f(4), f(5), f(6), f(7), f(8), f(9), f(10), f(11), f(12), f(13), f(14), f(15) |], k); lemma access_4_4: ok: \forall integer k ; 0 <= k < 4 ==> f(k)==\nth([| f(0), f(1), f(2), f(3) |], k); lemma eq_repeat_concat_3: ok: \forall \list<integer> x ; (x *^ 3) == (x ^ x ^ x) ; lemma access_repeat_concat_3: ok: lack: \forall \list<integer> x ; \forall integer k ; 0 <= k < 3*\length(x) ==> \nth(x *^ 3, k) == \nth(x ^ x ^ x, k) ; } */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/�����������������������������������������0000777�0000000�0000000�00000000000�13571573400�020524� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/abs.res.oracle���������������������������0000666�0000000�0000000�00000001123�13571573400�023245� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/abs.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function abs ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/abs.i, line 13) in 'abs': Assume { Type: is_sint32(abs_0) /\ is_sint32(x). If x < 0 Then { Have: (abs_0 + x) = 0. } Else { Have: x = abs_0. } } Prove: my_abs(x) = abs_0. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/asm.res.oracle���������������������������0000666�0000000�0000000�00000001734�13571573400�023270� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/asm.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Assertion 'OK' (file tests/wp_plugin/asm.i, line 10): Prove: true. ------------------------------------------------------------ Goal Assertion 'KO' (file tests/wp_plugin/asm.i, line 11): Assume { Type: is_sint32(dst_0). } Prove: dst_0 = 2. ------------------------------------------------------------ ------------------------------------------------------------ Function main with behavior default_for_stmt_3 ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/asm.i, line 5) at assembly (file tests/wp_plugin/asm.i, line 5): Effect at line 5 Prove: false. ------------------------------------------------------------ ������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/bit_test.res.oracle����������������������0000666�0000000�0000000�00000002350�13571573400�024320� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/bit_test.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function check1 ------------------------------------------------------------ Goal Post-condition 'ko' in 'check1': Assume { Type: is_sint32(order1_0) /\ is_sint32(order2_0). } Prove: bit_testb(order2_0, 0) = bit_testb(order1_0, 0). ------------------------------------------------------------ ------------------------------------------------------------ Function check2 ------------------------------------------------------------ Goal Post-condition 'ko' in 'check2': Assume { Type: is_sint32(order1_0) /\ is_sint32(order2_0). } Prove: bit_test(order2_0, 0) <-> bit_test(order1_0, 0). ------------------------------------------------------------ ------------------------------------------------------------ Function check3 ------------------------------------------------------------ Goal Post-condition 'ko' in 'check3': Assume { Type: is_sint32(order1_0) /\ is_sint32(order2_0). } Prove: bit_test(order2_0, 0) <-> bit_test(order1_0, 0). ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/bool.res.oracle��������������������������0000666�0000000�0000000�00000011113�13571573400�023433� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-no-let [...] [kernel] Parsing tests/wp_plugin/bool.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function band_bool with behavior false ------------------------------------------------------------ Goal Post-condition for 'false' (file tests/wp_plugin/bool.i, line 28) in 'band_bool': Assume { Type: is_bool(a) /\ is_bool(a_1) /\ is_bool(b) /\ is_bool(b_1) /\ is_bool(band_bool_0) /\ is_bool(retres_0). Have: (a_1 = a) /\ (b_1 = b). (* Pre-condition for 'false' *) Have: (a_1 != 1) \/ (b_1 != 1). Have: (if (land(a, b) = 0) then 0 else 1) = retres_0. (* Return *) Have: retres_0 = band_bool_0. } Prove: band_bool_0 = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function band_bool with behavior true ------------------------------------------------------------ Goal Post-condition for 'true' (file tests/wp_plugin/bool.i, line 25) in 'band_bool': Assume { Type: is_bool(a) /\ is_bool(a_1) /\ is_bool(b) /\ is_bool(b_1) /\ is_bool(band_bool_0) /\ is_bool(retres_0). Have: (a_1 = a) /\ (b_1 = b). (* Pre-condition for 'true' *) Have: (a_1 = 1) /\ (b_1 = 1). Have: (if (land(a, b) = 0) then 0 else 1) = retres_0. (* Return *) Have: retres_0 = band_bool_0. } Prove: band_bool_0 = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function bor_bool with behavior false ------------------------------------------------------------ Goal Post-condition for 'false' (file tests/wp_plugin/bool.i, line 18) in 'bor_bool': Assume { Type: is_bool(a) /\ is_bool(a_1) /\ is_bool(b) /\ is_bool(b_1) /\ is_bool(bor_bool_0) /\ is_bool(retres_0). Have: (a_1 = a) /\ (b_1 = b). (* Pre-condition for 'false' *) Have: (a_1 != 1) /\ (b_1 != 1). Have: (if ((a = 0) & (b = 0)) then 0 else 1) = retres_0. (* Return *) Have: retres_0 = bor_bool_0. } Prove: bor_bool_0 = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function bor_bool with behavior true ------------------------------------------------------------ Goal Post-condition for 'true' (file tests/wp_plugin/bool.i, line 15) in 'bor_bool': Assume { Type: is_bool(a) /\ is_bool(a_1) /\ is_bool(b) /\ is_bool(b_1) /\ is_bool(bor_bool_0) /\ is_bool(retres_0). Have: (a_1 = a) /\ (b_1 = b). (* Pre-condition for 'true' *) Have: (a_1 = 1) \/ (b_1 = 1). Have: (if ((a = 0) & (b = 0)) then 0 else 1) = retres_0. (* Return *) Have: retres_0 = bor_bool_0. } Prove: bor_bool_0 = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor_bool with behavior false ------------------------------------------------------------ Goal Post-condition for 'false' (file tests/wp_plugin/bool.i, line 37) in 'bxor_bool': Assume { Type: is_bool(a) /\ is_bool(a_1) /\ is_bool(b) /\ is_bool(b_1) /\ is_bool(bxor_bool_0) /\ is_bool(retres_0). Have: (a_1 = a) /\ (b_1 = b). (* Pre-condition for 'false' *) Have: ((a_1 != 0) \/ (b_1 != 1)) /\ ((a_1 != 1) \/ (b_1 != 0)). Have: (if (b = a) then 0 else 1) = retres_0. (* Return *) Have: retres_0 = bxor_bool_0. } Prove: bxor_bool_0 = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor_bool with behavior true ------------------------------------------------------------ Goal Post-condition for 'true' (file tests/wp_plugin/bool.i, line 34) in 'bxor_bool': Assume { Type: is_bool(a) /\ is_bool(a_1) /\ is_bool(b) /\ is_bool(b_1) /\ is_bool(bxor_bool_0) /\ is_bool(retres_0). Have: (a_1 = a) /\ (b_1 = b). (* Pre-condition for 'true' *) Have: ((a_1 = 0) /\ (b_1 = 1)) \/ ((a_1 = 1) /\ (b_1 = 0)). Have: (if (b = a) then 0 else 1) = retres_0. (* Return *) Have: retres_0 = bxor_bool_0. } Prove: bxor_bool_0 = 1. ------------------------------------------------------------ ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/bool.i, line 10) in 'job': Assume { Type: is_bool(a) /\ is_bool(b) /\ is_sint32(job_0) /\ is_sint32(retres_0). Have: (a + b) = retres_0. (* Return *) Have: retres_0 = job_0. } Prove: (0 <= job_0) /\ (job_0 <= 2). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/call.res.oracle��������������������������0000666�0000000�0000000�00000004554�13571573400�023426� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/call.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/call.i, line 17) in 'main': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'main': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'main' (1/6): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'main' (2/6): Call Result at line 28 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'main' (3/6): Effect at line 28 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'main' (4/6): Call Result at line 29 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'main' (5/6): Effect at line 29 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'main' (6/6): Effect at line 30 Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_plugin/call.i, line 13) in 'job'' in 'main' at call 'job' (file tests/wp_plugin/call.i, line 28) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_plugin/call.i, line 13) in 'job'' in 'main' at call 'job' (file tests/wp_plugin/call.i, line 29) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main with behavior A ------------------------------------------------------------ Goal Post-condition for 'A' (file tests/wp_plugin/call.i, line 21) in 'main': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main with behavior B ------------------------------------------------------------ Goal Post-condition for 'B' (file tests/wp_plugin/call.i, line 24) in 'main': Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/cint.0.res.oracle������������������������0000666�0000000�0000000�00000004760�13571573400�023605� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/cint.i (no preprocessing) [kernel] tests/wp_plugin/cint.i:22: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function signed_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 24) in 'signed_bitwise': Let x = lnot(a). Assume { Type: is_sint32(a) /\ is_sint32(x). } Prove: P_R(x, a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 30) in 'signed_downcast': Assume { Type: is_sint32(a). } Prove: P_R(to_sint16(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 36) in 'signed_overflow': Assume { Type: is_sint32(signed_overflow_0). } Prove: P_R(signed_overflow_0, signed_overflow_0). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 42) in 'unsigned_bitwise': Assume { Type: is_uint32(a). } Prove: P_R(to_uint32(lnot(a)), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 48) in 'unsigned_downcast': Assume { Type: is_sint32(a). } Prove: P_R(to_uint32(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 54) in 'unsigned_overflow': Let x = a + b. Assume { Type: is_uint32(a) /\ is_uint32(b). } Prove: P_R(to_uint32(x), x). ------------------------------------------------------------ ����������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/cint.1.res.oracle������������������������0000666�0000000�0000000�00000005003�13571573400�023575� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -no-warn-signed-overflow [...] [kernel] Parsing tests/wp_plugin/cint.i (no preprocessing) [kernel] tests/wp_plugin/cint.i:22: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function signed_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 24) in 'signed_bitwise': Let x = lnot(a). Assume { Type: is_sint32(a) /\ is_sint32(x). } Prove: P_R(x, a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 30) in 'signed_downcast': Assume { Type: is_sint32(a). } Prove: P_R(to_sint16(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 36) in 'signed_overflow': Let x = a + b. Assume { Type: is_sint32(a) /\ is_sint32(b). } Prove: P_R(to_sint32(x), x). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 42) in 'unsigned_bitwise': Assume { Type: is_uint32(a). } Prove: P_R(to_uint32(lnot(a)), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 48) in 'unsigned_downcast': Assume { Type: is_sint32(a). } Prove: P_R(to_uint32(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 54) in 'unsigned_overflow': Let x = a + b. Assume { Type: is_uint32(a) /\ is_uint32(b). } Prove: P_R(to_uint32(x), x). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/cint.2.res.oracle������������������������0000666�0000000�0000000�00000005024�13571573400�023601� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -warn-unsigned-overflow [...] [kernel] Parsing tests/wp_plugin/cint.i (no preprocessing) [kernel] tests/wp_plugin/cint.i:22: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function signed_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 24) in 'signed_bitwise': Let x = lnot(a). Assume { Type: is_sint32(a) /\ is_sint32(x). } Prove: P_R(x, a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 30) in 'signed_downcast': Assume { Type: is_sint32(a). } Prove: P_R(to_sint16(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 36) in 'signed_overflow': Assume { Type: is_sint32(signed_overflow_0). } Prove: P_R(signed_overflow_0, signed_overflow_0). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 42) in 'unsigned_bitwise': Assume { Type: is_uint32(a). } Prove: P_R(to_uint32(lnot(a)), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 48) in 'unsigned_downcast': Assume { Type: is_sint32(a). } Prove: P_R(to_uint32(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 54) in 'unsigned_overflow': Assume { Type: is_uint32(unsigned_overflow_0). } Prove: P_R(unsigned_overflow_0, unsigned_overflow_0). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/cint.3.res.oracle������������������������0000666�0000000�0000000�00000005113�13571573400�023601� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -warn-signed-downcast [...] [kernel] Parsing tests/wp_plugin/cint.i (no preprocessing) [kernel] tests/wp_plugin/cint.i:22: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function signed_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 24) in 'signed_bitwise': Let x = lnot(a). Assume { Type: is_sint32(a) /\ is_sint32(x). } Prove: P_R(x, a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 30) in 'signed_downcast': Assume { Type: is_sint16(signed_downcast_0) /\ is_sint32(signed_downcast_0). } Prove: P_R(signed_downcast_0, signed_downcast_0). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 36) in 'signed_overflow': Assume { Type: is_sint32(signed_overflow_0). } Prove: P_R(signed_overflow_0, signed_overflow_0). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 42) in 'unsigned_bitwise': Assume { Type: is_uint32(a). } Prove: P_R(to_uint32(lnot(a)), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 48) in 'unsigned_downcast': Assume { Type: is_sint32(a). } Prove: P_R(to_uint32(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 54) in 'unsigned_overflow': Let x = a + b. Assume { Type: is_uint32(a) /\ is_uint32(b). } Prove: P_R(to_uint32(x), x). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/cint.4.res.oracle������������������������0000666�0000000�0000000�00000005127�13571573400�023607� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -warn-unsigned-downcast [...] [kernel] Parsing tests/wp_plugin/cint.i (no preprocessing) [kernel] tests/wp_plugin/cint.i:22: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function signed_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 24) in 'signed_bitwise': Let x = lnot(a). Assume { Type: is_sint32(a) /\ is_sint32(x). } Prove: P_R(x, a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 30) in 'signed_downcast': Assume { Type: is_sint32(a). } Prove: P_R(to_sint16(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 36) in 'signed_overflow': Assume { Type: is_sint32(signed_overflow_0). } Prove: P_R(signed_overflow_0, signed_overflow_0). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 42) in 'unsigned_bitwise': Assume { Type: is_uint32(a). } Prove: P_R(to_uint32(lnot(a)), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 48) in 'unsigned_downcast': Assume { Type: is_uint32(unsigned_downcast_0) /\ is_sint32(unsigned_downcast_0). } Prove: P_R(unsigned_downcast_0, unsigned_downcast_0). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 54) in 'unsigned_overflow': Let x = a + b. Assume { Type: is_uint32(a) /\ is_uint32(b). } Prove: P_R(to_uint32(x), x). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/cint.5.res.oracle������������������������0000666�0000000�0000000�00000004523�13571573400�023607� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Nat)' [...] [kernel] Parsing tests/wp_plugin/cint.i (no preprocessing) [kernel] tests/wp_plugin/cint.i:22: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function signed_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 24) in 'signed_bitwise': Prove: P_R(lnot(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 30) in 'signed_downcast': Prove: P_R(to_sint16(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function signed_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 36) in 'signed_overflow': Prove: P_R(signed_overflow_0, signed_overflow_0). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_bitwise ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 42) in 'unsigned_bitwise': Assume { Type: 0 <= a. } Prove: P_R(to_uint32(lnot(a)), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_downcast ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 48) in 'unsigned_downcast': Prove: P_R(to_uint32(a), a). ------------------------------------------------------------ ------------------------------------------------------------ Function unsigned_overflow ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/cint.i, line 54) in 'unsigned_overflow': Let x = a + b. Assume { Type: (0 <= a) /\ (0 <= b). } Prove: P_R(to_uint32(x), x). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/combined.res.oracle����������������������0000666�0000000�0000000�00000012506�13571573400�024267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/combined.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Assertion (file tests/wp_plugin/combined.c, line 27): Assume { Type: is_sint32(A). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). } Prove: (50 <= A) /\ (A <= 100). ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/combined.c, line 29): Assume { Type: is_sint32(A) /\ is_sint32(i) /\ is_sint32(v) /\ is_sint32(1 + i). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Assertion *) Have: (50 <= A) /\ (A <= 100). (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_P(havoc(Mint_undef_0, Mint_0, shift_sint32(t, 0), 50) [shift_sint32(t, i_1)]))). (* Invariant *) Have: (0 <= i) /\ (i <= 50). (* Then *) Have: i <= 49. (* Call 'f' *) Have: P_P(v). } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/combined.c, line 29): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/combined.c, line 30): Let a = havoc(Mint_undef_0, Mint_0, shift_sint32(t, 0), 50). Assume { Type: is_sint32(A) /\ is_sint32(i) /\ is_sint32(v) /\ is_sint32(1 + i). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Assertion *) Have: (50 <= A) /\ (A <= 100). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> P_P(a[shift_sint32(t, i_2)]))). (* Invariant *) Have: (0 <= i) /\ (i <= 50). (* Then *) Have: i <= 49. (* Call 'f' *) Have: P_P(v). } Prove: P_P(a[shift_sint32(t, i) <- v][shift_sint32(t, i_1)]). ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/combined.c, line 30): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/combined.c, line 35): Let x = 1 + j. Assume { Type: is_sint32(A) /\ is_sint32(i) /\ is_sint32(j) /\ is_sint32(x). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Assertion *) Have: (50 <= A) /\ (A <= 100). (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_P(havoc(Mint_undef_0, Mint_0, shift_sint32(t, 0), 50) [shift_sint32(t, i_1)]))). (* Invariant *) Have: (0 <= i) /\ (i <= 50). (* Else *) Have: 50 <= i. (* Invariant *) Have: (A <= j) /\ (j <= 100). (* Then *) Have: j <= 99. } Prove: A <= x. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/combined.c, line 35): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_plugin/combined.c, line 40): Let a = havoc(Mint_undef_1, Mint_0, shift_sint32(t, 0), 50). Assume { Type: is_sint32(A) /\ is_sint32(i_1) /\ is_sint32(j). (* Goal *) When: (0 <= i) /\ (i <= 49). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Assertion *) Have: (50 <= A) /\ (A <= 100). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> P_P(a[shift_sint32(t, i_2)]))). (* Invariant *) Have: (0 <= i_1) /\ (i_1 <= 50). (* Else *) Have: 50 <= i_1. (* Invariant *) Have: (A <= j) /\ (j <= 100). (* Else *) Have: 100 <= j. } Prove: P_P(havoc(Mint_undef_0, a, shift_sint32(t, A), 100 - A) [shift_sint32(t, i)]). ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/combined.c, line 31) (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/combined.c, line 31) (2/3): Effect at line 33 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/combined.c, line 31) (3/3): Call Result at line 33 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/combined.c, line 36) (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/combined.c, line 36) (2/3): Effect at line 38 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/combined.c, line 36) (3/3): Call Result at line 38 Let a = shift_sint32(t, j). Assume { Type: is_sint32(A) /\ is_sint32(i) /\ is_sint32(j). (* Goal *) When: !invalid(Malloc_0, a, 1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Assertion *) Have: (50 <= A) /\ (A <= 100). (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_P(havoc(Mint_undef_0, Mint_0, shift_sint32(t, 0), 50) [shift_sint32(t, i_1)]))). (* Invariant *) Have: (0 <= i) /\ (i <= 50). (* Else *) Have: 50 <= i. (* Invariant *) Have: (A <= j) /\ (j <= 100). (* Then *) Have: j <= 99. } Prove: included(a, 1, shift_sint32(t, A), 100 - A). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/convert.res.oracle�����������������������0000666�0000000�0000000�00000001173�13571573400�024165� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/convert.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma ceil: Assume: 'floor' Prove: let x_1 = (\ceil x_0) in (x_0<=(real_of_int x_1)) /\ ((real_of_int (x_1-1))<x_0) ------------------------------------------------------------ Lemma floor: Prove: let x_1 = (\floor x_0) in ((real_of_int x_1)<=x_0) /\ (x_0<(real_of_int (1+x_1))) ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/copy.res.oracle��������������������������0000666�0000000�0000000�00000015204�13571573400�023457� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/copy.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function copy ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/copy.i, line 5) in 'copy': Let a_1 = shift_sint32(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, n). Let a_3 = havoc(Mint_undef_0, Mint_0, a_1, i). Assume { Type: is_sint32(i) /\ is_sint32(n). (* Goal *) When: (0 <= i_1) /\ (i_1 < n). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ separated(a_1, n, shift_sint32(b, 0), n). (* Invariant 'Copy' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_2[shift_sint32(b, i_2)] = a_2[shift_sint32(a, i_2)]))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Else *) Have: n <= i. } Prove: a_3[shift_sint32(b, i_1)] = a_3[shift_sint32(a, i_1)]. ------------------------------------------------------------ Goal Preservation of Invariant 'Copy' (file tests/wp_plugin/copy.i, line 11): Let a_1 = shift_sint32(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, n). Let a_3 = a_2[shift_sint32(a, i) <- a_2[shift_sint32(b, i)]]. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ separated(a_1, n, shift_sint32(b, 0), n). (* Invariant 'Copy' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_2[shift_sint32(b, i_2)] = a_2[shift_sint32(a, i_2)]))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Assertion 'A' *) Have: forall i_2 : Z. let a_4 = shift_sint32(a, i_2) in ((0 <= i_2) -> ((i_2 < i) -> (a_3[a_4] = a_2[a_4]))). (* Assertion 'B' *) Have: forall i_2 : Z. let a_4 = shift_sint32(b, i_2) in ((0 <= i_2) -> ((i_2 < i) -> (a_3[a_4] = a_2[a_4]))). } Prove: a_3[shift_sint32(b, i_1)] = a_3[shift_sint32(a, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant 'Copy' (file tests/wp_plugin/copy.i, line 11): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range' (file tests/wp_plugin/copy.i, line 10): Let a_1 = shift_sint32(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, n). Let a_3 = a_2[shift_sint32(a, i) <- a_2[shift_sint32(b, i)]]. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ separated(a_1, n, shift_sint32(b, 0), n). (* Invariant 'Copy' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_2[shift_sint32(b, i_1)] = a_2[shift_sint32(a, i_1)]))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Assertion 'A' *) Have: forall i_1 : Z. let a_4 = shift_sint32(a, i_1) in ((0 <= i_1) -> ((i_1 < i) -> (a_3[a_4] = a_2[a_4]))). (* Assertion 'B' *) Have: forall i_1 : Z. let a_4 = shift_sint32(b, i_1) in ((0 <= i_1) -> ((i_1 < i) -> (a_3[a_4] = a_2[a_4]))). } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant 'Range' (file tests/wp_plugin/copy.i, line 10): Prove: true. ------------------------------------------------------------ Goal Assertion 'A' (file tests/wp_plugin/copy.i, line 17): Let a_1 = shift_sint32(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, n). Let a_3 = shift_sint32(a, i_1). Assume { Type: is_sint32(i) /\ is_sint32(n). (* Goal *) When: (0 <= i_1) /\ (i_1 < i). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ separated(a_1, n, shift_sint32(b, 0), n). (* Invariant 'Copy' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_2[shift_sint32(b, i_2)] = a_2[shift_sint32(a, i_2)]))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: a_2[shift_sint32(a, i) <- a_2[shift_sint32(b, i)]][a_3] = a_2[a_3]. ------------------------------------------------------------ Goal Assertion 'B' (file tests/wp_plugin/copy.i, line 18): Let a_1 = shift_sint32(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, n). Let a_3 = a_2[shift_sint32(a, i) <- a_2[shift_sint32(b, i)]]. Let a_4 = shift_sint32(b, i_1). Assume { Type: is_sint32(i) /\ is_sint32(n). (* Goal *) When: (0 <= i_1) /\ (i_1 < i). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ separated(a_1, n, shift_sint32(b, 0), n). (* Invariant 'Copy' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_2[shift_sint32(b, i_2)] = a_2[shift_sint32(a, i_2)]))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Assertion 'A' *) Have: forall i_2 : Z. let a_5 = shift_sint32(a, i_2) in ((0 <= i_2) -> ((i_2 < i) -> (a_3[a_5] = a_2[a_5]))). } Prove: a_3[a_4] = a_2[a_4]. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/copy.i, line 12) (1/2): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/copy.i, line 12) (2/2): Effect at line 16 Let a_1 = shift_sint32(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, n). Let a_3 = shift_sint32(a, i). Let a_4 = a_2[a_3 <- a_2[shift_sint32(b, i)]]. Assume { Type: is_sint32(i) /\ is_sint32(n). (* Goal *) When: !invalid(Malloc_0, a_3, 1). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ separated(a_1, n, shift_sint32(b, 0), n). (* Invariant 'Copy' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_2[shift_sint32(b, i_1)] = a_2[shift_sint32(a, i_1)]))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Assertion 'A' *) Have: forall i_1 : Z. let a_5 = shift_sint32(a, i_1) in ((0 <= i_1) -> ((i_1 < i) -> (a_4[a_5] = a_2[a_5]))). (* Assertion 'B' *) Have: forall i_1 : Z. let a_5 = shift_sint32(b, i_1) in ((0 <= i_1) -> ((i_1 < i) -> (a_4[a_5] = a_2[a_5]))). } Prove: included(a_3, 1, a_1, n). ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/copy.i, line 6) in 'copy': Effect at line 14 Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/dynamic.res.oracle�����������������������0000666�0000000�0000000�00000030513�13571573400�024131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/dynamic.i (no preprocessing) [wp] Running WP plugin... [wp:calls] Computing dynamic calls. [wp] tests/wp_plugin/dynamic.i:30: Calls f1 f2 [wp] tests/wp_plugin/dynamic.i:44: Calls g [wp] tests/wp_plugin/dynamic.i:65: Calls h1 h2 [wp] tests/wp_plugin/dynamic.i:78: Calls (for bhv1) h1 h2 h0 [wp] tests/wp_plugin/dynamic.i:78: Calls (for bhv0) h1 h2 h0 [wp] tests/wp_plugin/dynamic.i:87: Calls h1 [wp] tests/wp_plugin/dynamic.i:100: Calls unreachable_g [wp:calls] Dynamic call(s): 6. [wp] Loading driver 'share/wp.driver' [wp] tests/wp_plugin/dynamic.i:78: Warning: Missing 'calls' for default behavior [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function behavior with behavior bhv1 ------------------------------------------------------------ Goal Call point h1 h2 in 'behavior' at instruction (file tests/wp_plugin/dynamic.i, line 65): Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bhv1' (file tests/wp_plugin/dynamic.i, line 62) in 'behavior' (1/2): Tags: Call h1. Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bhv1' (file tests/wp_plugin/dynamic.i, line 62) in 'behavior' (2/2): Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 61) in 'behavior' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 61) in 'behavior' (2/2): Call Effect at line 65 Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 61) in 'behavior' (1/4): Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 61) in 'behavior' (2/4): Call Effect at line 65 Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 61) in 'behavior' (3/4): Call Result at line 65 Tags: Call h1. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 61) in 'behavior' (4/4): Call Result at line 65 Tags: Call h2. Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function call ------------------------------------------------------------ Goal Call point f1 f2 in 'call' at instruction (file tests/wp_plugin/dynamic.i, line 30): Let a = Mptr_0[shiftfield_F1_S_f(closure_0)]. Let a_1 = global(G_f2_28). Let a_2 = global(G_f1_20). Let x = Mint_0[shiftfield_F1_S_param(closure_0)]. Assume { Type: is_sint32(x). (* Heap *) Have: (region(closure_0.base) <= 0) /\ framed(Mptr_0). (* Pre-condition *) Have: (a = a_1) \/ ((a = a_2) /\ (abs_int(x) <= 5)). } Prove: (a = a_2) \/ (a = a_1). ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 26) in 'call' (1/2): Tags: Call f1. Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 26) in 'call' (2/2): Tags: Call f2. Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_plugin/dynamic.i, line 10) in 'f1'' in 'call' at instruction (file tests/wp_plugin/dynamic.i, line 30) : Tags: Call f1. Let x = Mint_0[shiftfield_F1_S_param(closure_0)]. Assume { Type: is_sint32(x). (* Heap *) Have: (region(closure_0.base) <= 0) /\ framed(Mptr_0). (* Pre-condition *) Have: abs_int(x) <= 5. (* Instance of 'f1' *) (* Call point f1 f2 *) Have: Mptr_0[shiftfield_F1_S_f(closure_0)] = global(G_f1_20). } Prove: ((-10) <= x) /\ (x <= 10). ------------------------------------------------------------ ------------------------------------------------------------ Function guarded_call ------------------------------------------------------------ Goal Call point g in 'guarded_call' at instruction (file tests/wp_plugin/dynamic.i, line 44): Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 38) in 'guarded_call' (1/2): Assume { Type: is_sint32(X). (* Goal *) When: Mptr_0[shiftfield_F1_S_f(p)] = global(0). (* Heap *) Have: (region(p.base) <= 0) /\ framed(Mptr_0). (* Else *) Have: G_g_46 = 0. } Prove: X = 1. ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 38) in 'guarded_call' (2/2): Tags: Call g. Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 39) in 'guarded_call' (1/2): Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 39) in 'guarded_call' (2/2): Tags: Call g. Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function missing_context ------------------------------------------------------------ Goal Call point h1 in 'missing_context' at instruction (file tests/wp_plugin/dynamic.i, line 87): Assume { (* Heap *) Have: region(p.base) <= 0. } Prove: global(G_h1_59) = p. ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 82) in 'missing_context': Tags: Call h1. Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/dynamic.i, line 83) in 'missing_context': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/dynamic.i, line 83) in 'missing_context' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/dynamic.i, line 83) in 'missing_context' (2/2): Call Result at line 87 Tags: Call h1. Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function no_call ------------------------------------------------------------ Goal Call point unreachable_g in 'no_call' at instruction (file tests/wp_plugin/dynamic.i, line 100): Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 94) in 'no_call' (1/2): Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 94) in 'no_call' (2/2): Tags: Call unreachable_g. Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_plugin/dynamic.i, line 91) in 'unreachable_g'' in 'no_call' at instruction (file tests/wp_plugin/dynamic.i, line 100) : Tags: Call unreachable_g. Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function some_behaviors with behavior bhv0 ------------------------------------------------------------ Goal Call point h1 h2 h0 for bhv0 in 'some_behaviors' at instruction (file tests/wp_plugin/dynamic.i, line 78): Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bhv0' (file tests/wp_plugin/dynamic.i, line 75) in 'some_behaviors' (1/3): Tags: Call h0. Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bhv0' (file tests/wp_plugin/dynamic.i, line 75) in 'some_behaviors' (2/3): Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bhv0' (file tests/wp_plugin/dynamic.i, line 75) in 'some_behaviors' (3/3): Tags: Call h1. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv0' nothing in 'some_behaviors' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv0' nothing in 'some_behaviors' (2/3): Call Effect at line 78 Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv0' nothing in 'some_behaviors' (3/3): Call Effect at line 78 Tags: Call h1. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv0' nothing in 'some_behaviors' (1/6): Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv0' nothing in 'some_behaviors' (2/6): Call Effect at line 78 Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv0' nothing in 'some_behaviors' (3/6): Call Effect at line 78 Tags: Call h1. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv0' nothing in 'some_behaviors' (4/6): Call Result at line 78 Tags: Call h0. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv0' nothing in 'some_behaviors' (5/6): Call Result at line 78 Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv0' nothing in 'some_behaviors' (6/6): Call Result at line 78 Tags: Call h1. Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function some_behaviors with behavior bhv1 ------------------------------------------------------------ Goal Call point h1 h2 h0 for bhv1 in 'some_behaviors' at instruction (file tests/wp_plugin/dynamic.i, line 78): Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bhv1' (file tests/wp_plugin/dynamic.i, line 71) in 'some_behaviors' (1/3): Tags: Call h0. Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bhv1' (file tests/wp_plugin/dynamic.i, line 71) in 'some_behaviors' (2/3): Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Post-condition for 'bhv1' (file tests/wp_plugin/dynamic.i, line 71) in 'some_behaviors' (3/3): Tags: Call h1. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 70) in 'some_behaviors' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 70) in 'some_behaviors' (2/2): Call Effect at line 78 Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 70) in 'some_behaviors' (1/5): Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 70) in 'some_behaviors' (2/5): Call Effect at line 78 Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 70) in 'some_behaviors' (3/5): Call Result at line 78 Tags: Call h0. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 70) in 'some_behaviors' (4/5): Call Result at line 78 Tags: Call h2. Prove: true. ------------------------------------------------------------ Goal Assigns for 'bhv1' (file tests/wp_plugin/dynamic.i, line 70) in 'some_behaviors' (5/5): Call Result at line 78 Tags: Call h1. Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'guarded_call': /*@ behavior typed: requires \separated(&X,p); */ void guarded_call(struct S *p); [wp] Warning: Memory model hypotheses for function 'behavior': /*@ behavior typed: requires \separated(&X1,p+(..)); */ int behavior(int (*p)(void)); [wp] Warning: Memory model hypotheses for function 'some_behaviors': /*@ behavior typed: requires \separated(&X1,p+(..)); */ int some_behaviors(int (*p)(void)); [wp] Warning: Memory model hypotheses for function 'missing_context': /*@ behavior typed: requires \separated(&X1,p); */ int missing_context(int (*p)(void)); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/flash.0.res.oracle�����������������������0000666�0000000�0000000�00000020534�13571573400�023742� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/flash.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'Events' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'A_reads' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = L_RD_update(L_INDEX_init, a). Let a_6 = L_RD_update(a_5, a_2). Let a_7 = L_RD_update(a_6, a). Let x_1 = 1 + RD_time_0. Let x_2 = 1 + WR_time_0. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 1. Let a_8 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = OBSERVER_time_0 - 3. Let x_7 = RD_time_0 - 2. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_6) /\ is_sint32(x_5) /\ is_sint32(x_7) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = L_INDEX_init) /\ (L_OBSERVER(x_6) = nil) /\ (L_RD_current(x_7) = L_INDEX_init). (* Call 'RD' *) Have: (a_5 = a_8) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((L_RD_value(a, L_RD_access(L_INDEX_init, a)) + L_RD_value(a_2, L_RD_access(a_8, a_2))) = L_WR_value(a_2, L_WR_access(L_INDEX_init, a_2))). (* Call 'RD' *) Have: (a_6 = L_RD_current(RD_time_0)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (L_WR_update(L_INDEX_init, a_2) = L_WR_current(x_2)) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (a_7 = L_RD_current(x_1)). } Prove: L_RD_access(a_7, a) = 2. ------------------------------------------------------------ Goal Post-condition 'B_reads' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = L_RD_update(L_INDEX_init, a). Let a_6 = L_RD_update(a_5, a_2). Let a_7 = L_RD_update(a_6, a). Let x_1 = 1 + RD_time_0. Let x_2 = 1 + WR_time_0. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 1. Let a_8 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = OBSERVER_time_0 - 3. Let x_7 = RD_time_0 - 2. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_6) /\ is_sint32(x_5) /\ is_sint32(x_7) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = L_INDEX_init) /\ (L_OBSERVER(x_6) = nil) /\ (L_RD_current(x_7) = L_INDEX_init). (* Call 'RD' *) Have: (a_5 = a_8) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((L_RD_value(a, L_RD_access(L_INDEX_init, a)) + L_RD_value(a_2, L_RD_access(a_8, a_2))) = L_WR_value(a_2, L_WR_access(L_INDEX_init, a_2))). (* Call 'RD' *) Have: (a_6 = L_RD_current(RD_time_0)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (L_WR_update(L_INDEX_init, a_2) = L_WR_current(x_2)) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (a_7 = L_RD_current(x_1)). } Prove: L_RD_access(a_7, a_2) = 1. ------------------------------------------------------------ Goal Post-condition 'B_writes' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = L_RD_update(L_INDEX_init, a). Let a_6 = L_RD_update(a_5, a_2). Let a_7 = L_WR_update(L_INDEX_init, a_2). Let x_1 = 1 + WR_time_0. Let x_2 = RD_time_0 - 1. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 2. Let a_8 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = OBSERVER_time_0 - 3. Let x_7 = RD_time_0 - 3. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_6) /\ is_sint32(x_7) /\ is_sint32(x_5) /\ is_sint32(x_4) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = L_INDEX_init) /\ (L_OBSERVER(x_6) = nil) /\ (L_RD_current(x_7) = L_INDEX_init). (* Call 'RD' *) Have: (a_5 = a_8) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((L_RD_value(a, L_RD_access(L_INDEX_init, a)) + L_RD_value(a_2, L_RD_access(a_8, a_2))) = L_WR_value(a_2, L_WR_access(L_INDEX_init, a_2))). (* Call 'RD' *) Have: (a_6 = L_RD_current(x_2)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (a_7 = L_WR_current(x_1)) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (L_RD_update(a_6, a) = L_RD_current(RD_time_0)). } Prove: L_WR_access(a_7, a_2) = 1. ------------------------------------------------------------ Goal Post-condition 'ReadValues' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = L_RD_update(L_INDEX_init, a). Let a_6 = L_RD_update(a_5, a_2). Let x_1 = 1 + WR_time_0. Let x_2 = RD_time_0 - 1. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 2. Let a_7 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = L_RD_value(a, L_RD_access(L_INDEX_init, a)). Let x_7 = OBSERVER_time_0 - 3. Let x_8 = RD_time_0 - 3. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_7) /\ is_sint32(x_8) /\ is_sint32(x_5) /\ is_sint32(x_4) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = L_INDEX_init) /\ (L_OBSERVER(x_7) = nil) /\ (L_RD_current(x_8) = L_INDEX_init). (* Call 'RD' *) Have: (a_5 = a_7) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((x_6 + L_RD_value(a_2, L_RD_access(a_7, a_2))) = L_WR_value(a_2, L_WR_access(L_INDEX_init, a_2))). (* Call 'RD' *) Have: (a_6 = L_RD_current(x_2)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (L_WR_update(L_INDEX_init, a_2) = L_WR_current(x_1)) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (L_RD_update(a_6, a) = L_RD_current(RD_time_0)). } Prove: (x_6 + L_RD_value(a_2, L_RD_access(a_5, a_2)) + L_RD_value(a, L_RD_access(a_6, a))) = (L_RD_value(a, 0) + L_RD_value(a, 1) + L_RD_value(a_2, 0)). ------------------------------------------------------------ Goal Post-condition 'WriteValues' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = L_RD_update(L_INDEX_init, a). Let a_6 = L_RD_update(a_5, a_2). Let x_1 = 1 + WR_time_0. Let x_2 = RD_time_0 - 1. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 2. Let a_7 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = OBSERVER_time_0 - 3. Let x_7 = RD_time_0 - 3. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_6) /\ is_sint32(x_7) /\ is_sint32(x_5) /\ is_sint32(x_4) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = L_INDEX_init) /\ (L_OBSERVER(x_6) = nil) /\ (L_RD_current(x_7) = L_INDEX_init). (* Call 'RD' *) Have: (a_5 = a_7) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((L_RD_value(a, L_RD_access(L_INDEX_init, a)) + L_RD_value(a_2, L_RD_access(a_7, a_2))) = L_WR_value(a_2, L_WR_access(L_INDEX_init, a_2))). (* Call 'RD' *) Have: (a_6 = L_RD_current(x_2)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (L_WR_update(L_INDEX_init, a_2) = L_WR_current(x_1)) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (L_RD_update(a_6, a) = L_RD_current(RD_time_0)). } Prove: (L_RD_value(a, 0) + L_RD_value(a_2, 0)) = L_WR_value(a_2, 0). ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/flash.1.res.oracle�����������������������0000666�0000000�0000000�00000020400�13571573400�023733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/flash.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] tests/wp_plugin/flash-ergo.driver:2: Warning: Redefinition of logic INDEX_init [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'Events' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'A_reads' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). Let a_7 = ((a_6)[(a) <- (a_6)[a]+1]). Let x_1 = 1 + RD_time_0. Let x_2 = 1 + WR_time_0. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 1. Let a_8 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = OBSERVER_time_0 - 3. Let x_7 = RD_time_0 - 2. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_6) /\ is_sint32(x_5) /\ is_sint32(x_7) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = const(0)) /\ (L_OBSERVER(x_6) = nil) /\ (L_RD_current(x_7) = const(0)). (* Call 'RD' *) Have: (a_8 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((L_RD_value(a, (const(0))[a]) + L_RD_value(a_2, (a_8)[a_2])) = L_WR_value(a_2, (const(0))[a_2])). (* Call 'RD' *) Have: (a_6 = L_RD_current(RD_time_0)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (L_WR_current(x_2) = ((const(0))[(a_2) <- (const(0))[a_2]+1])) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (a_7 = L_RD_current(x_1)). } Prove: (a_7)[a] = 2. ------------------------------------------------------------ Goal Post-condition 'B_reads' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). Let a_7 = ((a_6)[(a) <- (a_6)[a]+1]). Let x_1 = 1 + RD_time_0. Let x_2 = 1 + WR_time_0. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 1. Let a_8 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = OBSERVER_time_0 - 3. Let x_7 = RD_time_0 - 2. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_6) /\ is_sint32(x_5) /\ is_sint32(x_7) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = const(0)) /\ (L_OBSERVER(x_6) = nil) /\ (L_RD_current(x_7) = const(0)). (* Call 'RD' *) Have: (a_8 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((L_RD_value(a, (const(0))[a]) + L_RD_value(a_2, (a_8)[a_2])) = L_WR_value(a_2, (const(0))[a_2])). (* Call 'RD' *) Have: (a_6 = L_RD_current(RD_time_0)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (L_WR_current(x_2) = ((const(0))[(a_2) <- (const(0))[a_2]+1])) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (a_7 = L_RD_current(x_1)). } Prove: (a_7)[a_2] = 1. ------------------------------------------------------------ Goal Post-condition 'B_writes' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). Let x_1 = 1 + WR_time_0. Let a_7 = ((const(0))[(a_2) <- (const(0))[a_2]+1]). Let x_2 = RD_time_0 - 1. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 2. Let a_8 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = OBSERVER_time_0 - 3. Let x_7 = RD_time_0 - 3. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_6) /\ is_sint32(x_7) /\ is_sint32(x_5) /\ is_sint32(x_4) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = const(0)) /\ (L_OBSERVER(x_6) = nil) /\ (L_RD_current(x_7) = const(0)). (* Call 'RD' *) Have: (a_8 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((L_RD_value(a, (const(0))[a]) + L_RD_value(a_2, (a_8)[a_2])) = L_WR_value(a_2, (const(0))[a_2])). (* Call 'RD' *) Have: (a_6 = L_RD_current(x_2)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (L_WR_current(x_1) = a_7) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (((a_6)[(a) <- (a_6)[a]+1]) = L_RD_current(RD_time_0)). } Prove: (a_7)[a_2] = 1. ------------------------------------------------------------ Goal Post-condition 'ReadValues' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). Let x_1 = 1 + WR_time_0. Let x_2 = RD_time_0 - 1. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 2. Let a_7 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = L_RD_value(a, (const(0))[a]). Let x_7 = OBSERVER_time_0 - 3. Let x_8 = RD_time_0 - 3. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_7) /\ is_sint32(x_8) /\ is_sint32(x_5) /\ is_sint32(x_4) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = const(0)) /\ (L_OBSERVER(x_7) = nil) /\ (L_RD_current(x_8) = const(0)). (* Call 'RD' *) Have: (a_7 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((x_6 + L_RD_value(a_2, (a_7)[a_2])) = L_WR_value(a_2, (const(0))[a_2])). (* Call 'RD' *) Have: (a_6 = L_RD_current(x_2)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (L_WR_current(x_1) = ((const(0))[(a_2) <- (const(0))[a_2]+1])) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (((a_6)[(a) <- (a_6)[a]+1]) = L_RD_current(RD_time_0)). } Prove: (x_6 + L_RD_value(a_2, (a_5)[a_2]) + L_RD_value(a, (a_6)[a])) = (L_RD_value(a, 0) + L_RD_value(a, 1) + L_RD_value(a_2, 0)). ------------------------------------------------------------ Goal Post-condition 'WriteValues' in 'job': Let x = 1 + OBSERVER_time_0. Let a = global(G_a_62). Let a_1 = C_RdAt_int(a). Let a_2 = global(G_b_63). Let a_3 = C_RdAt_int(a_2). Let a_4 = C_WrAt_int(a_2). Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). Let x_1 = 1 + WR_time_0. Let x_2 = RD_time_0 - 1. Let x_3 = OBSERVER_time_0 - 1. Let x_4 = RD_time_0 - 2. Let a_7 = L_RD_current(x_4). Let x_5 = OBSERVER_time_0 - 2. Let x_6 = OBSERVER_time_0 - 3. Let x_7 = RD_time_0 - 3. Assume { Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ is_sint32(WR_time_0) /\ is_sint32(x_6) /\ is_sint32(x_7) /\ is_sint32(x_5) /\ is_sint32(x_4) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ is_sint32(x) /\ is_sint32(x_1). (* Pre-condition *) Have: (L_WR_current(WR_time_0) = const(0)) /\ (L_OBSERVER(x_6) = nil) /\ (L_RD_current(x_7) = const(0)). (* Call 'RD' *) Have: (a_7 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ ((L_RD_value(a, (const(0))[a]) + L_RD_value(a_2, (a_7)[a_2])) = L_WR_value(a_2, (const(0))[a_2])). (* Call 'RD' *) Have: (a_6 = L_RD_current(x_2)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). (* Call 'WR' *) Have: (L_WR_current(x_1) = ((const(0))[(a_2) <- (const(0))[a_2]+1])) /\ (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). (* Call 'RD' *) Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ (((a_6)[(a) <- (a_6)[a]+1]) = L_RD_current(RD_time_0)). } Prove: (L_RD_value(a, 0) + L_RD_value(a_2, 0)) = L_WR_value(a_2, 0). ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/flash.2.res.oracle�����������������������0000666�0000000�0000000�00000001773�13571573400�023750� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/flash.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'Events' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'A_reads' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'B_reads' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'B_writes' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ReadValues' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'WriteValues' in 'job': Prove: true. ------------------------------------------------------------ �����frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/float_format.res.oracle������������������0000666�0000000�0000000�00000001526�13571573400�025164� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/float_format.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_plugin/float_format.i:10: Warning: Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function output ------------------------------------------------------------ Goal Post-condition 'KO' in 'output': Let r = of_f32(x). Prove: ((1.0/5) + r) = of_f32(to_f32(of_f64(add_f64(to_f64((3602879701896397.0/18014398509481984)), to_f64(r))))). ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/float_model.0.res.oracle�����������������0000666�0000000�0000000�00000003514�13571573400�025131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Real)' [...] [kernel] Parsing tests/wp_plugin/float_model.i (no preprocessing) [kernel] tests/wp_plugin/float_model.i:10: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel:parser:decimal-float] tests/wp_plugin/float_model.i:28: Warning: Floating-point constant 2.1 is not represented exactly. Will use 0x1.0cccccccccccdp1. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'ACSL_R' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ Goal Post-condition 'ACSL_F' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ Goal Post-condition 'ACSL_FR' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ Goal Post-condition 'ACSL_DR' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ Goal Post-condition 'ACSL_DF' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ Goal Post-condition 'C_FD' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ Goal Post-condition 'C_FF' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ Goal Post-condition 'C_DD' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ Goal Post-condition 'C_DF' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/float_model.1.res.oracle�����������������0000666�0000000�0000000�00000003671�13571573400�025136� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed' [...] [kernel] Parsing tests/wp_plugin/float_model.i (no preprocessing) [kernel] tests/wp_plugin/float_model.i:10: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel:parser:decimal-float] tests/wp_plugin/float_model.i:28: Warning: Floating-point constant 2.1 is not represented exactly. Will use 0x1.0cccccccccccdp1. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'ACSL_R' in 'job': Prove: P_P((21.0/10)). ------------------------------------------------------------ Goal Post-condition 'ACSL_F' in 'job': Prove: P_P((4404019.0/2097152)). ------------------------------------------------------------ Goal Post-condition 'ACSL_FR' in 'job': Prove: P_P((4404019.0/2097152)). ------------------------------------------------------------ Goal Post-condition 'ACSL_DR' in 'job': Prove: P_P((4728779608739021.0/2251799813685248)). ------------------------------------------------------------ Goal Post-condition 'ACSL_DF' in 'job': Prove: P_P((4404019.0/2097152)). ------------------------------------------------------------ Goal Post-condition 'C_FD' in 'job': Prove: P_P((4404019.0/2097152)). ------------------------------------------------------------ Goal Post-condition 'C_FF' in 'job': Prove: P_P((4404019.0/2097152)). ------------------------------------------------------------ Goal Post-condition 'C_DD' in 'job': Prove: P_P((4728779608739021.0/2251799813685248)). ------------------------------------------------------------ Goal Post-condition 'C_DF' in 'job': Prove: P_P((4404019.0/2097152)). ------------------------------------------------------------ �����������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/float_real.0.res.oracle������������������0000666�0000000�0000000�00000002030�13571573400�024744� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Real)' [...] [kernel] Parsing tests/wp_plugin/float_real.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_plugin/float_real.i:19: Warning: Floating-point constant 1e-5 is not represented exactly. Will use 0x1.4f8b588e368f1p-17. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function dequal ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/float_real.i, line 14) in 'dequal': Assume { Type: is_sint32(dequal_0). If x < ((1.0/100000) + y) Then { If y < ((1.0/100000) + x) Then { (* Return *) Have: dequal_0 = 1. } Else { (* Return *) Have: dequal_0 = 0. } } Else { (* Return *) Have: dequal_0 = 0. } } Prove: (abs_real(x - y) < (1.0/100000)) <-> (dequal_0 != 0). ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/float_real.1.res.oracle������������������0000666�0000000�0000000�00000002252�13571573400�024753� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed' [...] [kernel] Parsing tests/wp_plugin/float_real.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_plugin/float_real.i:19: Warning: Floating-point constant 1e-5 is not represented exactly. Will use 0x1.4f8b588e368f1p-17. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function dequal ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/float_real.i, line 14) in 'dequal': Assume { Type: is_sint32(dequal_0). If lt_f64(add_f64(x, neg_f64(y)), to_f64((5902958103587057.0/590295810358705651712))) Then { If lt_f64(to_f64((-5902958103587057.0/590295810358705651712)), add_f64(x, neg_f64(y))) Then { (* Return *) Have: dequal_0 = 1. } Else { (* Return *) Have: dequal_0 = 0. } } Else { (* Return *) Have: dequal_0 = 0. } } Prove: (abs_real(of_f64(x) - of_f64(y)) < (1.0/100000)) <-> (dequal_0 != 0). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/frame.res.oracle�������������������������0000666�0000000�0000000�00000003512�13571573400�023576� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/frame.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function alias ------------------------------------------------------------ Goal Post-condition 'KO' in 'alias': Let a = global(P_r_39). Let x = Mint_1[a]. Let x_1 = Mint_0[a]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: linked(Malloc_0). } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function global ------------------------------------------------------------ Goal Post-condition 'KO' in 'global': Assume { Type: is_sint32(g) /\ is_sint32(global_0). } Prove: global_0 = g. ------------------------------------------------------------ ------------------------------------------------------------ Function local ------------------------------------------------------------ Goal Post-condition 'FRAMED' in 'local': Prove: true. ------------------------------------------------------------ Goal Post-condition 'KO' in 'local': Assume { Type: is_sint32(g) /\ is_sint32(local_0). } Prove: local_0 = g. ------------------------------------------------------------ ------------------------------------------------------------ Function localref ------------------------------------------------------------ Goal Post-condition 'KO' in 'localref': Let x = Mint_1[p]. Let x_1 = Mint_0[p]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ Goal Assertion 'FRAMED' (file tests/wp_plugin/frame.i, line 28): Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/ground_real.res.oracle�������������������0000666�0000000�0000000�00000000602�13571573400�025002� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/ground_real.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma R: Prove: ((2*x_0)<=1/2)=(x_0<=1/4) ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/inductive.res.oracle���������������������0000666�0000000�0000000�00000016077�13571573400�024510� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/inductive.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: native support for coq is deprecated, use tip instead [wp] 2 goals scheduled [wp:print-generated] "WPOUT/typed/Compound.v" (* ---------------------------------------------------------- *) (* --- Memory Compound Loader --- *) (* ---------------------------------------------------------- *) Require Import ZArith. Require Import Reals. Require Import BuiltIn. Require Import bool.Bool. Require Import HighOrd. Require Import int.Int. Require Import int.Abs. Require Import int.ComputerDivision. Require Import int.EuclideanDivision. Require Import int.ComputerOfEuclideanDivision. Require Import real.Real. Require Import real.RealInfix. Require Import real.FromInt. Require Import map.Map. Require Import bool.Bool. Require Import Qedlib. Require Import Qed. Require Import Memory. Definition shift_sint32 (p : addr) (k : Z) : addr := (shift p k%Z). Definition shiftfield_F1__list_next (p : addr) : addr := (shift p 1%Z). [wp:print-generated] "WPOUT/typed/lemma_test_Coq.v" (* ---------------------------------------------------------- *) (* --- Lemma 'test' --- *) (* ---------------------------------------------------------- *) Require Import ZArith. Require Import Reals. Require Import BuiltIn. Require Import bool.Bool. Require Import HighOrd. Require Import int.Int. Require Import int.Abs. Require Import int.ComputerDivision. Require Import int.EuclideanDivision. Require Import int.ComputerOfEuclideanDivision. Require Import real.Real. Require Import real.RealInfix. Require Import real.FromInt. Require Import map.Map. Require Import bool.Bool. Require Import Qedlib. Require Import Qed. (* --- Global Definitions --- *) Require Import Memory. Require Import Compound. Inductive P_reachable : array Z -> farray addr addr -> addr -> addr -> Prop := | Q_root_reachable: forall (t : array Z), forall (t_1 : farray addr addr), forall (a : addr), (P_reachable t t_1 a a) | Q_next_reachable: forall (t : array Z), forall (t_1 : farray addr addr), forall (a_1 a : addr), ((valid_rw t a_1 2%Z)) -> ((P_reachable t t_1 (t_1.[ (shiftfield_F1__list_next a_1) ]) a)) -> ((P_reachable t t_1 a_1 a)). Goal forall (t : array Z), forall (t_1 : farray addr addr), forall (a_1 a : addr), ((P_reachable t t_1 a_1 a)) -> ((a_1 = a) \/ (((valid_rw t a_1 2%Z)) /\ ((P_reachable t t_1 (t_1.[ (shiftfield_F1__list_next a_1) ]) a)))). Proof. ... Qed. [wp:print-generated] "WPOUT/typed/lemma_offset_Coq.v" (* ---------------------------------------------------------- *) (* --- Lemma 'offset' --- *) (* ---------------------------------------------------------- *) Require Import ZArith. Require Import Reals. Require Import BuiltIn. Require Import bool.Bool. Require Import HighOrd. Require Import int.Int. Require Import int.Abs. Require Import int.ComputerDivision. Require Import int.EuclideanDivision. Require Import int.ComputerOfEuclideanDivision. Require Import real.Real. Require Import real.RealInfix. Require Import real.FromInt. Require Import map.Map. Require Import bool.Bool. Require Import Qedlib. Require Import Qed. (* --- Global Definitions --- *) Require Import Memory. Require Import Compound. Inductive P_reachable : array Z -> farray addr addr -> addr -> addr -> Prop := | Q_root_reachable: forall (t : array Z), forall (t_1 : farray addr addr), forall (a : addr), (P_reachable t t_1 a a) | Q_next_reachable: forall (t : array Z), forall (t_1 : farray addr addr), forall (a_1 a : addr), ((valid_rw t a_1 2%Z)) -> ((P_reachable t t_1 (t_1.[ (shiftfield_F1__list_next a_1) ]) a)) -> ((P_reachable t t_1 a_1 a)). Hypothesis Q_test: forall (t : array Z), forall (t_1 : farray addr addr), forall (a_1 a : addr), ((P_reachable t t_1 a_1 a)) -> ((a_1 = a) \/ (((valid_rw t a_1 2%Z)) /\ ((P_reachable t t_1 (t_1.[ (shiftfield_F1__list_next a_1) ]) a)))). Definition P_same_array (Mint_0 : farray addr Z) (Mint_1 : farray addr Z) (a : addr) (b : addr) (begin_0 : Z) (end_0 : Z) : Prop := forall (i : Z), ((begin_0 <= i)%Z) -> ((i < end_0)%Z) -> (((Mint_1.[ (shift_sint32 a i%Z) ]) = (Mint_0.[ (shift_sint32 b i%Z) ]))%Z). Definition P_swap (Mint_0 : farray addr Z) (Mint_1 : farray addr Z) (a : addr) (b : addr) (begin_0 : Z) (i : Z) (j : Z) (end_0 : Z) : Prop := (((Mint_1.[ (shift_sint32 a i%Z) ]) = (Mint_0.[ (shift_sint32 b j%Z) ]))%Z) /\ (((Mint_1.[ (shift_sint32 a j%Z) ]) = (Mint_0.[ (shift_sint32 b i%Z) ]))%Z) /\ ((begin_0 <= i)%Z) /\ ((i < j)%Z) /\ ((j < end_0)%Z) /\ (forall (i_1 : Z), ((i_1 <> i)%Z) -> ((i_1 <> j)%Z) -> ((begin_0 <= i_1)%Z) -> ((i_1 < end_0)%Z) -> (((Mint_1.[ (shift_sint32 a i_1%Z) ]) = (Mint_0.[ (shift_sint32 b i_1%Z) ]))%Z)). Inductive P_same_elements : farray addr Z -> farray addr Z -> addr -> addr -> Z -> Z -> Prop := | Q_refl: forall (i_1 i : Z), forall (t_1 t : farray addr Z), forall (a_1 a : addr), ((P_same_array t_1 t a_1 a i_1%Z i%Z)) -> ((P_same_elements t_1 t a_1 a i_1%Z i%Z)) | Q_swap: forall (i_3 i_2 i_1 i : Z), forall (t_1 t : farray addr Z), forall (a_1 a : addr), ((P_swap t_1 t a_1 a i_3%Z i_2%Z i_1%Z i%Z)) -> ((P_same_elements t_1 t a_1 a i_3%Z i%Z)) | Q_trans: forall (i_1 i : Z), forall (t_2 t_1 t : farray addr Z), forall (a_2 a_1 a : addr), ((P_same_elements t_2 t_1 a_1 a i_1%Z i%Z)) -> ((P_same_elements t_1 t a_2 a_1 i_1%Z i%Z)) -> ((P_same_elements t_2 t a_2 a i_1%Z i%Z)). Goal forall (i_2 i_1 i : Z), forall (t_1 t : farray addr Z), forall (a_1 a : addr), ((P_same_elements t_1 t ((shift_sint32 a_1 i%Z)) ((shift_sint32 a i%Z)) i_2%Z i_1%Z)) -> ((P_same_elements t_1 t a_1 a (i%Z + i_2%Z)%Z (i%Z + i_1%Z)%Z)). Proof. ... Qed. [wp] 2 goals generated ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma offset: Assume: 'test' Prove: (P_same_elements Mint_0 Mint_1 (shift_sint32 a_0 offset_0) (shift_sint32 b_0 offset_0) begin_0 end_0) -> (P_same_elements Mint_0 Mint_1 a_0 b_0 (begin_0+offset_0) (end_0+offset_0)) ------------------------------------------------------------ Lemma test: Prove: (P_reachable Malloc_0 Mptr_0 root_0 node_0) -> ((root_0=node_0) \/ ((valid_rw Malloc_0 root_0 2) /\ (P_reachable Malloc_0 Mptr_0 Mptr_0[(shiftfield_F1__list_next root_0)] node_0))) ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/init_const.res.oracle��������������������0000666�0000000�0000000�00000002613�13571573400�024656� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/init_const.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function fA ------------------------------------------------------------ Goal Post-condition 'KO' in 'fA': Let x = A[0]. Let x_1 = A[1]. Let x_2 = A[2]. Let x_3 = A[3]. Let x_4 = x + x_1 + x_2 + x_3. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(x_4). } Prove: x_4 = 6. ------------------------------------------------------------ ------------------------------------------------------------ Function fB ------------------------------------------------------------ Goal Post-condition 'OK' in 'fB': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function fC ------------------------------------------------------------ Goal Post-condition 'KO' in 'fC': Let x = A[3]. Assume { Type: is_sint32(x). } Prove: x = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function fD ------------------------------------------------------------ Goal Post-condition 'OK' in 'fD': Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/init_const_guard.res.oracle��������������0000666�0000000�0000000�00000003320�13571573400�026034� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/init_const_guard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'Const' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Pointed_Valid' in 'f': Assume { (* Heap *) Have: (region(G_x_18) <= 0) /\ linked(Malloc_0). } Prove: valid_rw(Malloc_0, global(G_x_18), 1). ------------------------------------------------------------ Goal Post-condition 'Q_ReadOnly' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Q_NotWrite' in 'f': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition 'P_not_Const' in 'g': Prove: true. ------------------------------------------------------------ Goal Assertion 'Read' (file tests/wp_plugin/init_const_guard.i, line 31): Assume { (* Heap *) Have: (region(p.base) <= 0) /\ linked(Malloc_0). } Prove: valid_rd(Malloc_0, global(G_x_18), 1). ------------------------------------------------------------ Goal Assertion 'Guard_against_Const' (file tests/wp_plugin/init_const_guard.i, line 32): Let a = global(G_x_18). Assume { (* Heap *) Have: (region(p.base) <= 0) /\ linked(Malloc_0). (* Assertion 'Read' *) Have: valid_rd(Malloc_0, a, 1). } Prove: !valid_rw(Malloc_0, a, 1). ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/init_extern.res.oracle�������������������0000666�0000000�0000000�00000001350�13571573400�025032� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/init_extern.i (no preprocessing) [kernel] Parsing tests/wp_plugin/init_linker.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'OK' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'KO' in 'f': Prove: false. ------------------------------------------------------------ Goal Post-condition 'KO' in 'f': Assume { Type: is_sint32(b). } Prove: b = 0. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/init_valid.res.oracle��������������������0000666�0000000�0000000�00000002005�13571573400�024622� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/init_valid.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function validA ------------------------------------------------------------ Goal Assertion 'OK' (file tests/wp_plugin/init_valid.i, line 6): Prove: true. ------------------------------------------------------------ Goal Assertion 'OK' (file tests/wp_plugin/init_valid.i, line 7): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function validB ------------------------------------------------------------ Goal Assertion 'OK' (file tests/wp_plugin/init_valid.i, line 13): Prove: true. ------------------------------------------------------------ Goal Assertion 'KO' (file tests/wp_plugin/init_valid.i, line 14): Prove: false. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/initarr.res.oracle�����������������������0000666�0000000�0000000�00000002571�13571573400�024160� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/initarr.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'SEP' in 'job': Let a = A[2]. Let a_1 = A[1]. Let a_2 = A[0]. Let a_3 = A[i]. Assume { Type: is_sint32(i). (* Initializer *) Init: (a_2.F1_f) = global(G_a_18). (* Initializer *) Init: (a_2.F1_g) = global(G_b_19). (* Initializer *) Init: (a_1.F1_f) = global(G_c_20). (* Initializer *) Init: (a_1.F1_g) = global(G_d_21). (* Initializer *) Init: (a.F1_f) = global(G_e_22). (* Initializer *) Init: (a.F1_g) = global(G_f_23). (* Pre-condition *) Have: (0 <= i) /\ (i <= 2). } Prove: (a_3.F1_g) != (a_3.F1_f). ------------------------------------------------------------ Goal Post-condition 'ALT' in 'job': Let a = global(G_e_22). Let a_1 = global(G_c_20). Let a_2 = global(G_a_18). Let a_3 = A[i].F1_f. Assume { Type: is_sint32(i). (* Initializer *) Init: (A[0].F1_f) = a_2. (* Initializer *) Init: (A[1].F1_f) = a_1. (* Initializer *) Init: (A[2].F1_f) = a. (* Pre-condition *) Have: (0 <= i) /\ (i <= 2). } Prove: (a_3 = a_2) \/ (a_3 = a_1) \/ (a_3 = a). ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/injector.res.oracle����������������������0000666�0000000�0000000�00000007776�13571573400�024341� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/injector.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_plugin/injector.c, line 13) in 'g'' in 'f' at call 'g' (file tests/wp_plugin/injector.c, line 54) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_plugin/injector.c, line 13) in 'g'' in 'f' at call 'g' (file tests/wp_plugin/injector.c, line 56) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior FST_FAIL ------------------------------------------------------------ Goal Post-condition for 'FST_FAIL' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'FST_FAIL' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'FST_FAIL' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior SND_FAIL ------------------------------------------------------------ Goal Post-condition for 'SND_FAIL' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'SND_FAIL' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'SND_FAIL' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'SND_FAIL' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior SUCCESS ------------------------------------------------------------ Goal Post-condition for 'SUCCESS' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'SUCCESS' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'SUCCESS' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'SUCCESS' 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior ko ------------------------------------------------------------ Goal Post-condition for 'ko' 'qed_ko' in 'f': Let x = out_0[0]. Let x_1 = inp_0[0]. Assume { Type: is_sint32(b) /\ is_sint32(v) /\ is_sint32(x_1) /\ is_sint32(x). If x != 33 Then { Have: inp_1[0 <- v] = inp_0. } Else { (* Call Effects *) Have: inp_1[0 <- v][1 <- b] = inp_0. } } Prove: x_1 = b. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior ko_1 ------------------------------------------------------------ Goal Post-condition for 'ko_1' 'qed_ko' in 'f': Assume { (* Pre-condition for 'ko_1' *) Have: out_0[0] = 33. (* Pre-condition for 'ko_1' *) Have: out_0[1] = 33. } Prove: false. ------------------------------------------------------------ Goal Post-condition for 'ko_1' 'qed_ko' in 'f': Assume { Type: is_sint32(b) /\ is_sint32(v). (* Pre-condition for 'ko_1' *) Have: out_0[0] = 33. (* Pre-condition for 'ko_1' *) Have: out_0[1] = 33. } Prove: v = b. ------------------------------------------------------------ Goal Post-condition for 'ko_1' 'qed_ko' in 'f': Assume { (* Pre-condition for 'ko_1' *) Have: out_0[0] = 33. (* Pre-condition for 'ko_1' *) Have: out_0[1] = 33. } Prove: false. ------------------------------------------------------------ ��frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/invertible.res.oracle��������������������0000666�0000000�0000000�00000003562�13571573400�024654� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/invertible.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_plugin/invertible.i:17: Warning: No code nor implicit assigns clause for function main, generating default assigns from the prototype ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition 'Invertible_11' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_12' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_13' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_14' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_21' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_22' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_23' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_24' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_31' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_32' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_33' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'Invertible_34' in 'main': Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/loop.res.oracle��������������������������0000666�0000000�0000000�00000010607�13571573400�023460� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/loop.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function init ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'init': Let a_1 = shift_sint32(t, a). Let x = -a. Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, i - a). Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i). (* Goal *) When: (i_1 <= b) /\ (a <= i_1) /\ is_sint32(i_1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). (* Invariant 'qed_ok' *) Have: forall i_2 : Z. ((a <= i_2) -> ((i_2 < i) -> (a_2[shift_sint32(t, i_2)] = e))). (* Invariant 'qed_ok' *) Have: (a <= i) /\ (i <= (1 + b)). (* Else *) Have: b < i. } Prove: a_2[shift_sint32(t, i_1)] = e. ------------------------------------------------------------ Goal Preservation of Invariant 'qed_ok' (file tests/wp_plugin/loop.i, line 12): Let a_1 = shift_sint32(t, a). Let x = -a. Let x_1 = 1 + i. Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i) /\ is_sint32(x_1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). (* Invariant 'qed_ok' *) Have: forall i_1 : Z. ((a <= i_1) -> ((i_1 < i) -> (havoc(Mint_undef_0, Mint_0, a_1, i - a)[shift_sint32(t, i_1)] = e))). (* Invariant 'qed_ok' *) Have: (a <= i) /\ (i <= (1 + b)). (* Then *) Have: i <= b. } Prove: a <= x_1. ------------------------------------------------------------ Goal Establishment of Invariant 'qed_ok' (file tests/wp_plugin/loop.i, line 12): Assume { Type: is_sint32(a) /\ is_sint32(b). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, shift_sint32(t, a), 1 + b - a). } Prove: a <= (1 + b). ------------------------------------------------------------ Goal Preservation of Invariant 'qed_ok' (file tests/wp_plugin/loop.i, line 13): Let a_1 = shift_sint32(t, a). Let x = -a. Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, i - a). Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i) /\ is_sint32(1 + i). (* Goal *) When: (a <= i_1) /\ (i_1 <= i) /\ is_sint32(i_1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). (* Invariant 'qed_ok' *) Have: forall i_2 : Z. ((a <= i_2) -> ((i_2 < i) -> (a_2[shift_sint32(t, i_2)] = e))). (* Invariant 'qed_ok' *) Have: (a <= i) /\ (i <= (1 + b)). (* Then *) Have: i <= b. } Prove: a_2[shift_sint32(t, i) <- e][shift_sint32(t, i_1)] = e. ------------------------------------------------------------ Goal Establishment of Invariant 'qed_ok' (file tests/wp_plugin/loop.i, line 13): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'qed_ok' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'qed_ok' (2/3): Effect at line 15 Prove: true. ------------------------------------------------------------ Goal Loop assigns 'qed_ok' (3/3): Effect at line 16 Let a_1 = shift_sint32(t, a). Let x = -a. Let a_2 = shift_sint32(t, i). Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i) /\ is_sint32(1 + i). (* Goal *) When: !invalid(Malloc_0, a_2, 1). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). (* Invariant 'qed_ok' *) Have: forall i_1 : Z. ((a <= i_1) -> ((i_1 < i) -> (havoc(Mint_undef_0, Mint_0, a_1, i - a)[shift_sint32(t, i_1)] = e))). (* Invariant 'qed_ok' *) Have: (a <= i) /\ (i <= (1 + b)). (* Then *) Have: i <= b. } Prove: included(a_2, 1, a_1, 1 + i - a). ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'init': Effect at line 15 Let a_1 = shift_sint32(t, a). Let x = -a. Assume { Have: a < i. Have: !invalid(Malloc_0, a_1, i - a). Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(i). (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (a <= b) /\ valid_rw(Malloc_0, a_1, 1 + b - a). } Prove: i <= (1 + b). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/loopcurrent.res.oracle�������������������0000666�0000000�0000000�00000002017�13571573400�025057� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/loopcurrent.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/loopcurrent.i:12: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/loopcurrent.i, line 9): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/loopcurrent.i, line 9): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/loopcurrent.i, line 10): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/loopcurrent.i, line 10): Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/loopentry.res.oracle���������������������0000666�0000000�0000000�00000002003�13571573400�024531� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/loopentry.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/loopentry.i:12: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/loopentry.i, line 9): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/loopentry.i, line 9): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/loopentry.i, line 10): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/loopentry.i, line 10): Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/loopextra.res.oracle���������������������0000666�0000000�0000000�00000001635�13571573400�024525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/loopextra.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/loopextra.i:6: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp_plugin/loopextra.i:3: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion (file tests/wp_plugin/loopextra.i, line 4): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_plugin/loopextra.i, line 7): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_plugin/loopextra.i, line 8): Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/mask.res.oracle��������������������������0000666�0000000�0000000�00000001041�13571573400�023432� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/mask.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function compute ------------------------------------------------------------ Goal Post-condition 'A' in 'compute': Prove: true. ------------------------------------------------------------ Goal Post-condition 'B' in 'compute': Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/math.res.oracle��������������������������0000666�0000000�0000000�00000017345�13571573400�023446� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/math.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma abs_neg: Assume: 'abs_pos' Prove: (y_0<=0) -> (x_0<y_0) -> ((\rabs y_0)<(\rabs x_0)) ------------------------------------------------------------ Lemma abs_pos: Prove: (0<=x_0) -> (x_0<y_0) -> ((\rabs x_0)<(\rabs y_0)) ------------------------------------------------------------ Lemma atan_sin_cos: Assume: 'pow_2' 'exp_log_add_mul' 'log_exp_mul_add' 'exp_pos' 'sqrt_mono' 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: let r_0 = (\atan x_0) in ((\sin r_0) div (\cos r_0))=x_0 ------------------------------------------------------------ Lemma cosh_opp: Assume: 'sinh_opp' 'atan_sin_cos' 'pow_2' 'exp_log_add_mul' 'log_exp_mul_add' 'exp_pos' 'sqrt_mono' 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: (\cosh (-x_0))=(\cosh x_0) ------------------------------------------------------------ Lemma distance: Assume: 'tanh_opp' 'cosh_opp' 'sinh_opp' 'atan_sin_cos' 'pow_2' 'exp_log_add_mul' 'log_exp_mul_add' 'exp_pos' 'sqrt_mono' 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: (\sqrt ((x_0*x_0)+(y_0*y_0)))=(\hypot x_0 y_0) ------------------------------------------------------------ Lemma exp_log_add_mul: Assume: 'log_exp_mul_add' 'exp_pos' 'sqrt_mono' 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: (0<a_0) -> (0<b_0) -> ((a_0*b_0)=(\exp ((\log a_0)+(\log b_0)))) ------------------------------------------------------------ Lemma exp_pos: Assume: 'sqrt_mono' 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: true ------------------------------------------------------------ Lemma log_exp_mul_add: Assume: 'exp_pos' 'sqrt_mono' 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: (a_0+b_0)=(\log ((\exp a_0)*(\exp b_0))) ------------------------------------------------------------ Lemma max_ac: Assume: 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: true ------------------------------------------------------------ Lemma max_inf: Assume: 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: let r_0 = (\max x_0 y_0) in (x_0<=r_0) /\ (y_0<=r_0) ------------------------------------------------------------ Lemma max_or: Assume: 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: let r_0 = (\max x_0 y_0) in (r_0=x_0) \/ (r_0=y_0) ------------------------------------------------------------ Lemma min_ac: Assume: 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: true ------------------------------------------------------------ Lemma min_inf: Assume: 'abs_neg' 'abs_pos' Prove: let r_0 = (\min x_0 y_0) in (r_0<=x_0) /\ (r_0<=y_0) ------------------------------------------------------------ Lemma min_or: Assume: 'min_inf' 'abs_neg' 'abs_pos' Prove: let r_0 = (\min x_0 y_0) in (r_0=x_0) \/ (r_0=y_0) ------------------------------------------------------------ Lemma pow_2: Assume: 'exp_log_add_mul' 'log_exp_mul_add' 'exp_pos' 'sqrt_mono' 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: (0<a_0) -> ((a_0*a_0)=(\pow a_0 2)) ------------------------------------------------------------ Lemma sinh_opp: Assume: 'atan_sin_cos' 'pow_2' 'exp_log_add_mul' 'log_exp_mul_add' 'exp_pos' 'sqrt_mono' 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: ((\sinh x_0)+(\sinh (-x_0)))=0 ------------------------------------------------------------ Lemma sqrt_mono: Assume: 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: (0<=x_0) -> (x_0<y_0) -> ((\sqrt x_0)<(\sqrt y_0)) ------------------------------------------------------------ Lemma sqrt_pos: Assume: 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: (0<=x_0) -> (0<=(\sqrt x_0)) ------------------------------------------------------------ Lemma tanh_opp: Assume: 'cosh_opp' 'sinh_opp' 'atan_sin_cos' 'pow_2' 'exp_log_add_mul' 'log_exp_mul_add' 'exp_pos' 'sqrt_mono' 'sqrt_pos' 'max_ac' 'min_ac' 'max_or' 'max_inf' 'min_or' 'min_inf' 'abs_neg' 'abs_pos' Prove: ((\tanh x_0)+(\tanh (-x_0)))=0 ------------------------------------------------------------ ------------------------------------------------------------ Function ko ------------------------------------------------------------ Goal Post-condition 'ko,sin_asin' in 'ko': Prove: sin(asin(r)) = r. ------------------------------------------------------------ Goal Post-condition 'ko,cos_acos' in 'ko': Prove: cos(acos(r)) = r. ------------------------------------------------------------ Goal Post-condition 'ko,asin_sin' in 'ko': Prove: asin(sin(r)) = r. ------------------------------------------------------------ Goal Post-condition 'ko,acos_cos' in 'ko': Prove: acos(cos(r)) = r. ------------------------------------------------------------ Goal Post-condition 'ko,atan_tan' in 'ko': Prove: atan(tan(r)) = r. ------------------------------------------------------------ Goal Post-condition 'ko,log_pow' in 'ko': Prove: (r * log(r_1)) = log(pow(r_1, r)). ------------------------------------------------------------ Goal Post-condition 'ko,exp_log' in 'ko': Prove: exp(log(r)) = r. ------------------------------------------------------------ Goal Post-condition 'ko,exp_log_add_mul' in 'ko': Prove: (r * r_1) = exp(log(r) + log(r_1)). ------------------------------------------------------------ Goal Post-condition 'ko,sqrt_pos' in 'ko': Prove: .0 <= sqrt(r). ------------------------------------------------------------ ------------------------------------------------------------ Function ok ------------------------------------------------------------ Goal Post-condition 'sin_asin' in 'ok': Assume { (* Goal *) When: (r <= 1.0) /\ (-1.0 <= r). } Prove: sin(asin(r)) = r. ------------------------------------------------------------ Goal Post-condition 'sin_asin_in_range' in 'ok': Let r_1 = cos(r). Prove: sin(asin(r_1)) = r_1. ------------------------------------------------------------ Goal Post-condition 'cos_acos' in 'ok': Assume { (* Goal *) When: (r <= 1.0) /\ (-1.0 <= r). } Prove: cos(acos(r)) = r. ------------------------------------------------------------ Goal Post-condition 'cos_acos_in_range' in 'ok': Let r_1 = sin(r). Prove: cos(acos(r_1)) = r_1. ------------------------------------------------------------ Goal Post-condition 'tan_atan' in 'ok': Prove: true. ------------------------------------------------------------ Goal Post-condition 'log_pow' in 'ok': Assume { (* Goal *) When: .0 < r_1. } Prove: (r * log(r_1)) = log(pow(r_1, r)). ------------------------------------------------------------ Goal Post-condition 'log_exp' in 'ok': Prove: true. ------------------------------------------------------------ Goal Post-condition 'exp_log' in 'ok': Assume { (* Goal *) When: .0 < r. } Prove: exp(log(r)) = r. ------------------------------------------------------------ Goal Post-condition 'min_plus_distrib' in 'ok': Prove: (r + min_real(r_1, r_2)) = min_real(r_1 + r, r_2 + r). ------------------------------------------------------------ Goal Post-condition 'sqrt_pos' in 'ok': Assume { (* Goal *) When: .0 < r. } Prove: .0 < sqrt(r). ------------------------------------------------------------ Goal Post-condition 'sqrt_pos0' in 'ok': Assume { (* Goal *) When: .0 <= r. } Prove: .0 <= sqrt(r). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/model.res.oracle�������������������������0000666�0000000�0000000�00000011647�13571573400�023614� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/model.i (no preprocessing) [kernel] tests/wp_plugin/model.i:10: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled --------------------------------------------- --- Context 'typed_f' Cluster 'Compound' --------------------------------------------- theory Compound (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.memory.Memory *) function shift_sint32 (p:addr) (k:int) : addr = shift p k end --------------------------------------------- --- Context 'typed_f' Cluster 'Axiomatic' --------------------------------------------- theory Axiomatic (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) predicate P_P int end [wp:print-generated] theory WP (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.memory.Memory *) (* use frama_c_wp.cint.Cint *) (* use Compound *) (* use Axiomatic *) goal wp_goal : forall t:addr -> int, i:int, a:addr. let x = get t (shift_sint32 a i) in region (base a) <= 0 -> is_sint32 i -> is_sint32 x -> P_P x end [wp] 1 goal generated ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/model.i, line 12) in 'f': Let x = Mint_0[shift_sint32(p, k)]. Assume { Type: is_sint32(k) /\ is_sint32(x). (* Heap *) Have: region(p.base) <= 0. } Prove: P_P(x). ------------------------------------------------------------ [wp] Running WP plugin... [wp] 2 goals scheduled --------------------------------------------- --- Context 'typed_ref_f' Cluster 'Compound' --------------------------------------------- theory Compound1 (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool1 *) (* use int.Int1 *) (* use int.ComputerDivision1 *) (* use real.RealInfix1 *) (* use frama_c_wp.qed.Qed1 *) (* use map.Map1 *) (* use frama_c_wp.memory.Memory1 *) function shift_sint321 (p:addr1) (k:int) : addr1 = shift1 p k end --------------------------------------------- --- Context 'typed_ref_f' Cluster 'Axiomatic' --------------------------------------------- theory Axiomatic1 (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool1 *) (* use int.Int1 *) (* use int.ComputerDivision1 *) (* use real.RealInfix1 *) (* use frama_c_wp.qed.Qed1 *) (* use map.Map1 *) predicate P_P1 int end [wp:print-generated] theory WP1 (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool1 *) (* use int.Int1 *) (* use int.ComputerDivision1 *) (* use real.RealInfix1 *) (* use frama_c_wp.qed.Qed1 *) (* use map.Map1 *) (* use frama_c_wp.memory.Memory1 *) (* use frama_c_wp.cint.Cint1 *) (* use Compound1 *) (* use Axiomatic1 *) goal wp_goal : forall t:addr1 -> int, i:int, a:addr1. let x = get1 t (shift_sint321 a i) in region1 (base1 a) <=' 0 -> is_sint321 i -> is_sint321 x -> P_P1 x end [wp:print-generated] theory WP2 (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.memory.Memory *) (* use frama_c_wp.cint.Cint *) (* use Compound *) (* use Axiomatic *) goal wp_goal : forall t:addr -> int, i:int, a:addr. let x = get t (shift_sint32 a i) in region (base a) <= 0 -> is_sint32 i -> is_sint32 x -> P_P x end [wp] 2 goals generated ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/model.i, line 12) in 'f': Let x = Mint_0[shift_sint32(p, k)]. Assume { Type: is_sint32(k) /\ is_sint32(x). (* Heap *) Have: region(p.base) <= 0. } Prove: P_P(x). ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/model.i, line 12) in 'f': Let x = Mint_0[shift_sint32(p, k)]. Assume { Type: is_sint32(k) /\ is_sint32(x). (* Heap *) Have: region(p.base) <= 0. } Prove: P_P(x). ------------------------------------------------------------ �����������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/nowp.res.oracle��������������������������0000666�0000000�0000000�00000000314�13571573400�023464� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/nowp.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] No proof obligations ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/nth.res.oracle���������������������������0000666�0000000�0000000�00000002554�13571573400�023302� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/nth.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Axiomatic 'Nth' ------------------------------------------------------------ Lemma access_16_16: Prove: (0<=k_0) -> (k_0<=15) -> ((nth (concat (elt (L_f 0)) (elt (L_f 1)) (elt (L_f 2)) (elt (L_f 3)) (elt (L_f 4)) (elt (L_f 5)) (elt (L_f 6)) (elt (L_f 7)) (elt (L_f 8)) (elt (L_f 9)) (elt (L_f 10)) (elt (L_f 11)) (elt (L_f 12)) (elt (L_f 13)) (elt (L_f 14)) (elt (L_f 15))) k_0)=(L_f k_0)) ------------------------------------------------------------ Lemma access_4_4: Assume: 'access_16_16' Prove: (0<=k_0) -> (k_0<=3) -> ((nth (concat (elt (L_f 0)) (elt (L_f 1)) (elt (L_f 2)) (elt (L_f 3))) k_0)=(L_f k_0)) ------------------------------------------------------------ Lemma access_repeat_concat_3: Assume: 'eq_repeat_concat_3' 'access_4_4' 'access_16_16' Prove: (0<=k_0) -> (k_0<(3*(length x_0))) -> ((nth (concat x_0 x_0 x_0) k_0)=(nth (repeat x_0 3) k_0)) ------------------------------------------------------------ Lemma eq_repeat_concat_3: Assume: 'access_4_4' 'access_16_16' Prove: true ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/overarray.res.oracle���������������������0000666�0000000�0000000�00000006147�13571573400�024525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/overarray.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f1_ok ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/overarray.i, line 12) in 'f1_ok': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/overarray.i, line 12) in 'f1_ok': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f2_ok ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/overarray.i, line 15) in 'f2_ok': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/overarray.i, line 15) in 'f2_ok': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f3_ok ------------------------------------------------------------ Goal Assigns nothing in 'f3_ok': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'f3_ok': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f4_ok ------------------------------------------------------------ Goal Assigns nothing in 'f4_ok': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'f4_ok': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f5_ko ------------------------------------------------------------ Goal Assigns nothing in 'f5_ko': Call Effect at line 25 Assume { (* Exit Effects *) Have: forall i : Z. let x = 15 + i in (((-15) <= i) -> ((i <= 4) -> (((i < 0) \/ (10 <= i)) -> (A[x] = A_1[x])))). } Prove: false. ------------------------------------------------------------ Goal Assigns nothing in 'f5_ko': Call Effect at line 25 Assume { (* Call Effects *) Have: forall i : Z. let x = 15 + i in (((-15) <= i) -> ((i <= 4) -> (((i < 0) \/ (10 <= i)) -> (A[x] = A_1[x])))). } Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function f6_ko ------------------------------------------------------------ Goal Assigns nothing in 'f6_ko': Call Effect at line 28 Assume { (* Exit Effects *) Have: forall i : Z. let x = i - 5 in ((5 <= i) -> ((i <= 24) -> (((i < 0) \/ (10 <= i)) -> (A[x] = A_1[x])))). } Prove: false. ------------------------------------------------------------ Goal Assigns nothing in 'f6_ko': Call Effect at line 28 Assume { (* Call Effects *) Have: forall i : Z. let x = i - 5 in ((5 <= i) -> ((i <= 24) -> (((i < 0) \/ (10 <= i)) -> (A[x] = A_1[x])))). } Prove: false. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/overassign.res.oracle��������������������0000666�0000000�0000000�00000007216�13571573400�024671� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/overassign.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f1_ok ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/overassign.i, line 13) in 'f1_ok': Call Effect at line 14 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/overassign.i, line 13) in 'f1_ok': Call Effect at line 14 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f2_ok ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/overassign.i, line 16) in 'f2_ok': Call Effect at line 17 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/overassign.i, line 16) in 'f2_ok': Call Effect at line 17 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f3_ok ------------------------------------------------------------ Goal Assigns nothing in 'f3_ok': Call Effect at line 20 Assume { (* Heap *) Have: (region(G_A_30) <= 0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, shift_sint32(global(G_A_30), 20), 10). ------------------------------------------------------------ Goal Assigns nothing in 'f3_ok': Call Effect at line 20 Assume { (* Heap *) Have: (region(G_A_30) <= 0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, shift_sint32(global(G_A_30), 20), 10). ------------------------------------------------------------ ------------------------------------------------------------ Function f4_ok ------------------------------------------------------------ Goal Assigns nothing in 'f4_ok': Call Effect at line 23 Assume { (* Heap *) Have: (region(G_A_30) <= 0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, shift_sint32(global(G_A_30), -10), 10). ------------------------------------------------------------ Goal Assigns nothing in 'f4_ok': Call Effect at line 23 Assume { (* Heap *) Have: (region(G_A_30) <= 0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, shift_sint32(global(G_A_30), -10), 10). ------------------------------------------------------------ ------------------------------------------------------------ Function f5_ko ------------------------------------------------------------ Goal Assigns nothing in 'f5_ko': Call Effect at line 26 Assume { (* Heap *) Have: (region(G_A_30) <= 0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, shift_sint32(global(G_A_30), 15), 10). ------------------------------------------------------------ Goal Assigns nothing in 'f5_ko': Call Effect at line 26 Assume { (* Heap *) Have: (region(G_A_30) <= 0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, shift_sint32(global(G_A_30), 15), 10). ------------------------------------------------------------ ------------------------------------------------------------ Function f6_ko ------------------------------------------------------------ Goal Assigns nothing in 'f6_ko': Call Effect at line 29 Assume { (* Heap *) Have: (region(G_A_30) <= 0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, shift_sint32(global(G_A_30), -5), 10). ------------------------------------------------------------ Goal Assigns nothing in 'f6_ko': Call Effect at line 29 Assume { (* Heap *) Have: (region(G_A_30) <= 0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, shift_sint32(global(G_A_30), -5), 10). ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/params.res.oracle������������������������0000666�0000000�0000000�00000000555�13571573400�023773� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/params.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma lem: Prove: (P_p 1) ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/plet.res.oracle��������������������������0000666�0000000�0000000�00000001030�13571573400�023441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/plet.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Axiomatic 'Test' ------------------------------------------------------------ Lemma GOAL: Prove: (P_A \/ (exists i_0:int. (0<=i_0) /\ (i_0<L_N) /\ (not (P_H i_0)))) <-> ((forall i_0:int. (0<=i_0) -> (i_0<L_N) -> (P_H i_0)) -> P_A) ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/polarity.res.oracle����������������������0000666�0000000�0000000�00000001410�13571573400�024342� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/polarity.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/polarity.i:1: Warning: Allocation, initialization and danglingness not yet implemented (\initialized(\at(p,wp:pre))) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion (file tests/wp_plugin/polarity.i, line 4): tests/wp_plugin/polarity.i:1: warning from wp: - Warning: Ignored Hypothesis Reason: Allocation, initialization and danglingness not yet implemented (\initialized(\at(p,wp:pre))) Prove: false. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/prenex.res.oracle������������������������0000666�0000000�0000000�00000014735�13571573400�024016� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/prenex.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function diag ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/prenex.i, line 11) in 'diag': Assume { Type: is_sint32(diag_0) /\ is_sint32(i) /\ is_sint32(i_1) /\ is_sint32(j) /\ is_sint32(m) /\ is_sint32(n). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0). (* Pre-condition *) Have: (0 <= m) /\ (0 <= n). (* Invariant 'PI' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i_1) -> ((0 <= i_2) -> ((i_2 < m) -> (Mint_0[shift_sint32(p, i_3)] < Mint_0[shift_sint32(q, i_2)]))))). (* Invariant 'I' *) Have: (0 <= i_1) /\ (i_1 <= n). If i_1 < n Then { Let x = Mint_0[shift_sint32(p, i)]. Have: (ta_j_0=false). (* Invariant 'PJ' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < j) -> (x < Mint_0[shift_sint32(q, i_2)]))). (* Invariant 'J' *) Have: (0 <= j) /\ (j <= m). (* Then *) Have: j < m. Have: i_1 = i. (* Then *) Have: Mint_0[shift_sint32(q, j)] <= x. (* Return *) Have: diag_0 = 0. } Else { (* Return *) Have: diag_0 = 1. } } Prove: (forall i_2 : Z. ((0 <= i_2) -> ((i_2 < n) -> (forall i_3 : Z. ((0 <= i_3) -> ((i_3 < m) -> (Mint_0[shift_sint32(p, i_2)] < Mint_0[shift_sint32(q, i_3)]))))))) <-> (diag_0 != 0). ------------------------------------------------------------ Goal Preservation of Invariant 'I' (file tests/wp_plugin/prenex.i, line 19): Assume { Type: is_sint32(i) /\ is_sint32(j) /\ is_sint32(m) /\ is_sint32(n) /\ is_sint32(1 + i). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0). (* Pre-condition *) Have: (0 <= m) /\ (0 <= n). (* Invariant 'PI' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 < m) -> (Mint_0[shift_sint32(p, i_2)] < Mint_0[shift_sint32(q, i_1)]))))). (* Invariant 'I' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Invariant 'PJ' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (Mint_0[shift_sint32(p, i)] < Mint_0[shift_sint32(q, i_1)]))). (* Invariant 'J' *) Have: (0 <= j) /\ (j <= m). (* Else *) Have: m <= j. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant 'I' (file tests/wp_plugin/prenex.i, line 19): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'PI' (file tests/wp_plugin/prenex.i, line 21): Assume { Type: is_sint32(i_2) /\ is_sint32(j) /\ is_sint32(m) /\ is_sint32(n) /\ is_sint32(1 + i_2). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i_1 < m) /\ (i <= i_2). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0). (* Pre-condition *) Have: (0 <= m) /\ (0 <= n). (* Invariant 'PI' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i_2) -> ((0 <= i_3) -> ((i_3 < m) -> (Mint_0[shift_sint32(p, i_4)] < Mint_0[shift_sint32(q, i_3)]))))). (* Invariant 'I' *) Have: (0 <= i_2) /\ (i_2 <= n). (* Then *) Have: i_2 < n. (* Invariant 'PJ' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 < j) -> (Mint_0[shift_sint32(p, i_2)] < Mint_0[shift_sint32(q, i_3)]))). (* Invariant 'J' *) Have: (0 <= j) /\ (j <= m). (* Else *) Have: m <= j. } Prove: Mint_0[shift_sint32(p, i)] < Mint_0[shift_sint32(q, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant 'PI' (file tests/wp_plugin/prenex.i, line 21): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'J' (file tests/wp_plugin/prenex.i, line 28): Let x = Mint_0[shift_sint32(p, i)]. Let x_1 = Mint_0[shift_sint32(q, j)]. Assume { Type: is_sint32(i) /\ is_sint32(j) /\ is_sint32(m) /\ is_sint32(n) /\ is_sint32(1 + j) /\ is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0). (* Pre-condition *) Have: (0 <= m) /\ (0 <= n). (* Invariant 'PI' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 < m) -> (Mint_0[shift_sint32(p, i_2)] < Mint_0[shift_sint32(q, i_1)]))))). (* Invariant 'I' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Invariant 'PJ' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (x < Mint_0[shift_sint32(q, i_1)]))). (* Invariant 'J' *) Have: (0 <= j) /\ (j <= m). (* Then *) Have: j < m. (* Else *) Have: x < x_1. } Prove: (-1) <= j. ------------------------------------------------------------ Goal Establishment of Invariant 'J' (file tests/wp_plugin/prenex.i, line 28): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'PJ' (file tests/wp_plugin/prenex.i, line 30): Let x = Mint_0[shift_sint32(p, i)]. Let x_1 = Mint_0[shift_sint32(q, j)]. Assume { Type: is_sint32(i) /\ is_sint32(j) /\ is_sint32(m) /\ is_sint32(n) /\ is_sint32(1 + j) /\ is_sint32(x) /\ is_sint32(x_1). (* Goal *) When: (0 <= i_1) /\ (i_1 <= j). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0). (* Pre-condition *) Have: (0 <= m) /\ (0 <= n). (* Invariant 'PI' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 < m) -> (Mint_0[shift_sint32(p, i_3)] < Mint_0[shift_sint32(q, i_2)]))))). (* Invariant 'I' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Invariant 'PJ' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < j) -> (x < Mint_0[shift_sint32(q, i_2)]))). (* Invariant 'J' *) Have: (0 <= j) /\ (j <= m). (* Then *) Have: j < m. (* Else *) Have: x < x_1. } Prove: x < Mint_0[shift_sint32(q, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant 'PJ' (file tests/wp_plugin/prenex.i, line 30): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/prenex.i, line 24) (1/2): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/prenex.i, line 24) (2/2): Effect at line 34 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/prenex.i, line 32): Prove: true. ------------------------------------------------------------ �����������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/repeat.res.oracle������������������������0000666�0000000�0000000�00000024511�13571573400�023766� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/repeat.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/repeat.c:47: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function induction ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/repeat.c, line 55) in 'induction': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/repeat.c, line 61): Let a = L_sequence(calls_1). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Pre-condition *) Have: (L_sequence(calls_0) = nil) /\ (0 <= n). (* Invariant *) Have: ([ 1, 2 ] *^ i) = a. (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Call 'f' *) Have: L_sequence(calls_2) = a ^ [ 1 ]. (* Call 'g' *) Have: L_sequence(calls_3) = a ^ [ 1, 2 ]. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/repeat.c, line 61): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/repeat.c, line 62): Let a = L_sequence(calls_0). Let a_1 = a ^ [ 1, 2 ]. Let a_2 = [ 1, 2 ]. Let x = 1 + i. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x). (* Pre-condition *) Have: (L_sequence(calls_1) = nil) /\ (0 <= n). (* Invariant *) Have: (a_2 *^ i) = a. (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Call 'f' *) Have: L_sequence(calls_2) = a ^ [ 1 ]. (* Call 'g' *) Have: L_sequence(calls_3) = a_1. } Prove: (a_2 *^ x) = a_1. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/repeat.c, line 62): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/repeat.c, line 63): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 56) in 'induction' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 56) in 'induction' (2/2): Effect at line 65 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 56) in 'induction': Effect at line 65 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function master ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/repeat.c, line 29) in 'master': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 30) in 'master': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 30) in 'master': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function shifted ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/repeat.c, line 73) in 'shifted': Let a = [ 1, 2 ]. Let a_1 = (a *^ i). Let a_2 = a_1 ^ [ 1, 2 ]. Assume { Type: is_sint32(i) /\ is_sint32(n). (* Pre-condition *) Have: (L_sequence(calls_0) = nil) /\ (0 <= n). (* Call 'f' *) Have: L_sequence(calls_1) = [ 1 ]. (* Invariant *) Have: L_sequence(calls_2) = a_1 ^ [ 1 ]. (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Else *) Have: n <= i. (* Call 'g' *) Have: L_sequence(calls_3) = a_2. } Prove: (a *^ 1 + i) = a_2. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/repeat.c, line 81): Let a = ([ 1, 2 ] *^ i). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Pre-condition *) Have: (L_sequence(calls_0) = nil) /\ (0 <= n). (* Call 'f' *) Have: L_sequence(calls_1) = [ 1 ]. (* Invariant *) Have: L_sequence(calls_2) = a ^ [ 1 ]. (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Call 'g' *) Have: L_sequence(calls_3) = a ^ [ 1, 2 ]. (* Call 'f' *) Have: L_sequence(calls_4) = a ^ [ 1, 2, 1 ]. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/repeat.c, line 81): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_plugin/repeat.c, line 82): Let a = [ 1, 2 ]. Let a_1 = (a *^ i). Let a_2 = a_1 ^ [ 1, 2 ]. Let x = 1 + i. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x). (* Pre-condition *) Have: (L_sequence(calls_0) = nil) /\ (0 <= n). (* Call 'f' *) Have: L_sequence(calls_1) = [ 1 ]. (* Invariant *) Have: L_sequence(calls_2) = a_1 ^ [ 1 ]. (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. (* Call 'g' *) Have: L_sequence(calls_3) = a_2. (* Call 'f' *) Have: L_sequence(calls_4) = a_1 ^ [ 1, 2, 1 ]. } Prove: (a *^ x) = a_2. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_plugin/repeat.c, line 82): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/repeat.c, line 83): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 74) in 'shifted' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 74) in 'shifted' (2/2): Effect at line 85 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 74) in 'shifted' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 74) in 'shifted' (2/2): Effect at line 85 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function unroll ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/repeat.c, line 41) in 'unroll': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (generated): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant (generated): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (1/11): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (2/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (3/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (4/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (5/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (6/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (7/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (8/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (9/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (10/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (11/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (1/11): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (2/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (3/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (4/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (5/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (6/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (7/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (8/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (9/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (10/11): Effect at line 47 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/repeat.c, line 42) in 'unroll' (11/11): Effect at line 47 Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/rte.0.res.oracle�������������������������0000666�0000000�0000000�00000003743�13571573400�023442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_plugin/rte.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp:rte] function job: generate rte for memory access [wp:rte] function job: generate rte for division by zero [wp:rte] function job: generate rte for signed overflow [wp] Warning: -wp-rte can annotate invalid bool value because -warn-invalid-bool is not set [rte] annotating function job [wp:rte] function job2: generate rte for memory access [wp:rte] function job2: generate rte for division by zero [wp:rte] function job2: generate rte for signed overflow [rte] annotating function job2 [wp:rte] function job3: generate rte for memory access [wp:rte] function job3: generate rte for division by zero [wp:rte] function job3: generate rte for signed overflow [rte] annotating function job3 [wp] Warning: Missing RTE guards [wp] Goal typed_job_ensures : not tried [wp] Goal typed_job_assert_rte_mem_access : not tried [wp] Goal typed_job_assert_rte_mem_access_2 : not tried [wp] Goal typed_job_assert_rte_signed_overflow : not tried [wp] Goal typed_job_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_job_assert_rte_mem_access_3 : not tried [wp] Goal typed_job2_ensures : not tried [wp] Goal typed_job3_ensures : not tried /* Generated by Frama-C */ /*@ axiomatic Obs { predicate R(integer r) ; } */ /*@ ensures R(\result); */ int job(int *p, int n) { int __retres; /*@ assert rte: mem_access: \valid(p); */ /*@ assert rte: mem_access: \valid_read(p); */ /*@ assert rte: signed_overflow: -2147483648 <= *p + n; */ /*@ assert rte: signed_overflow: *p + n <= 2147483647; */ *p += n; /*@ assert rte: mem_access: \valid_read(p); */ __retres = *p; return __retres; } /*@ ensures R(\result); */ unsigned int job2(unsigned int a, unsigned int b) { unsigned int __retres; __retres = a + b; return __retres; } _Bool X; /*@ ensures R(\result); */ int job3(void) { int __retres; __retres = (int)X; return __retres; } �����������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/rte.1.res.oracle�������������������������0000666�0000000�0000000�00000003401�13571573400�023432� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -no-warn-signed-overflow [...] [kernel] Parsing tests/wp_plugin/rte.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp:rte] function job: generate rte for memory access [wp:rte] function job: generate rte for division by zero [wp:rte] function job: generate rte for invalid bool value [rte] annotating function job [wp:rte] function job2: generate rte for memory access [wp:rte] function job2: generate rte for division by zero [wp:rte] function job2: generate rte for invalid bool value [rte] annotating function job2 [wp:rte] function job3: generate rte for memory access [wp:rte] function job3: generate rte for division by zero [wp:rte] function job3: generate rte for invalid bool value [rte] annotating function job3 [wp] Goal typed_job_ensures : not tried [wp] Goal typed_job_assert_rte_mem_access : not tried [wp] Goal typed_job_assert_rte_mem_access_2 : not tried [wp] Goal typed_job_assert_rte_mem_access_3 : not tried [wp] Goal typed_job2_ensures : not tried [wp] Goal typed_job3_ensures : not tried [wp] Goal typed_job3_assert_rte_bool_value : not tried /* Generated by Frama-C */ /*@ axiomatic Obs { predicate R(integer r) ; } */ /*@ ensures R(\result); */ int job(int *p, int n) { int __retres; /*@ assert rte: mem_access: \valid(p); */ /*@ assert rte: mem_access: \valid_read(p); */ *p += n; /*@ assert rte: mem_access: \valid_read(p); */ __retres = *p; return __retres; } /*@ ensures R(\result); */ unsigned int job2(unsigned int a, unsigned int b) { unsigned int __retres; __retres = a + b; return __retres; } _Bool X; /*@ ensures R(\result); */ int job3(void) { int __retres; /*@ assert rte: bool_value: X == 0 || X == 1; */ __retres = (int)X; return __retres; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/rte.2.res.oracle�������������������������0000666�0000000�0000000�00000005072�13571573400�023441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -warn-unsigned-overflow [...] [kernel] Parsing tests/wp_plugin/rte.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp:rte] function job: generate rte for memory access [wp:rte] function job: generate rte for division by zero [wp:rte] function job: generate rte for signed overflow [wp:rte] function job: generate rte for unsigned overflow [wp:rte] function job: generate rte for invalid bool value [rte] annotating function job [wp:rte] function job2: generate rte for memory access [wp:rte] function job2: generate rte for division by zero [wp:rte] function job2: generate rte for signed overflow [wp:rte] function job2: generate rte for unsigned overflow [wp:rte] function job2: generate rte for invalid bool value [rte] annotating function job2 [wp:rte] function job3: generate rte for memory access [wp:rte] function job3: generate rte for division by zero [wp:rte] function job3: generate rte for signed overflow [wp:rte] function job3: generate rte for unsigned overflow [wp:rte] function job3: generate rte for invalid bool value [rte] annotating function job3 [wp] Goal typed_job_ensures : not tried [wp] Goal typed_job_assert_rte_mem_access : not tried [wp] Goal typed_job_assert_rte_mem_access_2 : not tried [wp] Goal typed_job_assert_rte_signed_overflow : not tried [wp] Goal typed_job_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_job_assert_rte_mem_access_3 : not tried [wp] Goal typed_job2_ensures : not tried [wp] Goal typed_job2_assert_rte_unsigned_overflow : not tried [wp] Goal typed_job2_assert_rte_unsigned_overflow_2 : not tried [wp] Goal typed_job3_ensures : not tried [wp] Goal typed_job3_assert_rte_bool_value : not tried /* Generated by Frama-C */ /*@ axiomatic Obs { predicate R(integer r) ; } */ /*@ ensures R(\result); */ int job(int *p, int n) { int __retres; /*@ assert rte: mem_access: \valid(p); */ /*@ assert rte: mem_access: \valid_read(p); */ /*@ assert rte: signed_overflow: -2147483648 <= *p + n; */ /*@ assert rte: signed_overflow: *p + n <= 2147483647; */ *p += n; /*@ assert rte: mem_access: \valid_read(p); */ __retres = *p; return __retres; } /*@ ensures R(\result); */ unsigned int job2(unsigned int a, unsigned int b) { unsigned int __retres; /*@ assert rte: unsigned_overflow: 0 <= a + b; */ /*@ assert rte: unsigned_overflow: a + b <= 4294967295; */ __retres = a + b; return __retres; } _Bool X; /*@ ensures R(\result); */ int job3(void) { int __retres; /*@ assert rte: bool_value: X == 0 || X == 1; */ __retres = (int)X; return __retres; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/rte.3.res.oracle�������������������������0000666�0000000�0000000�00000004674�13571573400�023451� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -wp-model 'Typed (Nat)' [...] [kernel] Parsing tests/wp_plugin/rte.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp:rte] function job: generate rte for memory access [wp:rte] function job: generate rte for division by zero [wp:rte] function job: generate rte for signed overflow [wp] Warning: -wp-rte and model nat require kernel to warn against unsigned overflow [wp] Warning: -wp-rte and model nat require kernel to warn against signed downcast [wp] Warning: -wp-rte and model nat require kernel to warn against unsigned downcast [wp:rte] function job: generate rte for invalid bool value [rte] annotating function job [wp:rte] function job2: generate rte for memory access [wp:rte] function job2: generate rte for division by zero [wp:rte] function job2: generate rte for signed overflow [wp:rte] function job2: generate rte for invalid bool value [rte] annotating function job2 [wp:rte] function job3: generate rte for memory access [wp:rte] function job3: generate rte for division by zero [wp:rte] function job3: generate rte for signed overflow [wp:rte] function job3: generate rte for invalid bool value [rte] annotating function job3 [wp] Goal typed_nat_job_ensures : not tried [wp] Goal typed_nat_job_assert_rte_mem_access : not tried [wp] Goal typed_nat_job_assert_rte_mem_access_2 : not tried [wp] Goal typed_nat_job_assert_rte_signed_overflow : not tried [wp] Goal typed_nat_job_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_nat_job_assert_rte_mem_access_3 : not tried [wp] Goal typed_nat_job2_ensures : not tried [wp] Goal typed_nat_job3_ensures : not tried [wp] Goal typed_nat_job3_assert_rte_bool_value : not tried /* Generated by Frama-C */ /*@ axiomatic Obs { predicate R(integer r) ; } */ /*@ ensures R(\result); */ int job(int *p, int n) { int __retres; /*@ assert rte: mem_access: \valid(p); */ /*@ assert rte: mem_access: \valid_read(p); */ /*@ assert rte: signed_overflow: -2147483648 <= *p + n; */ /*@ assert rte: signed_overflow: *p + n <= 2147483647; */ *p += n; /*@ assert rte: mem_access: \valid_read(p); */ __retres = *p; return __retres; } /*@ ensures R(\result); */ unsigned int job2(unsigned int a, unsigned int b) { unsigned int __retres; __retres = a + b; return __retres; } _Bool X; /*@ ensures R(\result); */ int job3(void) { int __retres; /*@ assert rte: bool_value: X == 0 || X == 1; */ __retres = (int)X; return __retres; } ��������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/rte.4.res.oracle�������������������������0000666�0000000�0000000�00000005446�13571573400�023450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -wp-model 'Typed (Nat)' -warn-unsigned-overflow [...] [kernel] Parsing tests/wp_plugin/rte.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp:rte] function job: generate rte for memory access [wp:rte] function job: generate rte for division by zero [wp:rte] function job: generate rte for signed overflow [wp:rte] function job: generate rte for unsigned overflow [wp] Warning: -wp-rte and model nat require kernel to warn against signed downcast [wp] Warning: -wp-rte and model nat require kernel to warn against unsigned downcast [wp:rte] function job: generate rte for invalid bool value [rte] annotating function job [wp:rte] function job2: generate rte for memory access [wp:rte] function job2: generate rte for division by zero [wp:rte] function job2: generate rte for signed overflow [wp:rte] function job2: generate rte for unsigned overflow [wp:rte] function job2: generate rte for invalid bool value [rte] annotating function job2 [wp:rte] function job3: generate rte for memory access [wp:rte] function job3: generate rte for division by zero [wp:rte] function job3: generate rte for signed overflow [wp:rte] function job3: generate rte for unsigned overflow [wp:rte] function job3: generate rte for invalid bool value [rte] annotating function job3 [wp] Goal typed_nat_job_ensures : not tried [wp] Goal typed_nat_job_assert_rte_mem_access : not tried [wp] Goal typed_nat_job_assert_rte_mem_access_2 : not tried [wp] Goal typed_nat_job_assert_rte_signed_overflow : not tried [wp] Goal typed_nat_job_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_nat_job_assert_rte_mem_access_3 : not tried [wp] Goal typed_nat_job2_ensures : not tried [wp] Goal typed_nat_job2_assert_rte_unsigned_overflow : not tried [wp] Goal typed_nat_job2_assert_rte_unsigned_overflow_2 : not tried [wp] Goal typed_nat_job3_ensures : not tried [wp] Goal typed_nat_job3_assert_rte_bool_value : not tried /* Generated by Frama-C */ /*@ axiomatic Obs { predicate R(integer r) ; } */ /*@ ensures R(\result); */ int job(int *p, int n) { int __retres; /*@ assert rte: mem_access: \valid(p); */ /*@ assert rte: mem_access: \valid_read(p); */ /*@ assert rte: signed_overflow: -2147483648 <= *p + n; */ /*@ assert rte: signed_overflow: *p + n <= 2147483647; */ *p += n; /*@ assert rte: mem_access: \valid_read(p); */ __retres = *p; return __retres; } /*@ ensures R(\result); */ unsigned int job2(unsigned int a, unsigned int b) { unsigned int __retres; /*@ assert rte: unsigned_overflow: 0 <= a + b; */ /*@ assert rte: unsigned_overflow: a + b <= 4294967295; */ __retres = a + b; return __retres; } _Bool X; /*@ ensures R(\result); */ int job3(void) { int __retres; /*@ assert rte: bool_value: X == 0 || X == 1; */ __retres = (int)X; return __retres; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/rte.5.res.oracle�������������������������0000666�0000000�0000000�00000001757�13571573400�023452� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Nat)' [...] [kernel] Parsing tests/wp_plugin/rte.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp:rte] function job: missing rte for memory access [wp:rte] function job: missing rte for division by zero [wp:rte] function job: missing rte for signed overflow [wp:rte] function job: missing rte for invalid bool value [wp] Warning: Missing RTE guards [wp:rte] function job2: missing rte for memory access [wp:rte] function job2: missing rte for division by zero [wp:rte] function job2: missing rte for signed overflow [wp:rte] function job2: missing rte for invalid bool value [wp:rte] function job3: missing rte for memory access [wp:rte] function job3: missing rte for division by zero [wp:rte] function job3: missing rte for signed overflow [wp:rte] function job3: missing rte for invalid bool value [wp] Goal typed_nat_job_ensures : not tried [wp] Goal typed_nat_job2_ensures : not tried [wp] Goal typed_nat_job3_ensures : not tried �����������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/rte.6.res.oracle�������������������������0000666�0000000�0000000�00000002700�13571573400�023440� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte -wp-model 'Typed (Nat)' [...] [kernel] Parsing tests/wp_plugin/rte.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: -wp-rte can annotate memory access because -rte-mem is not set [wp:rte] function job: generate rte for division by zero [wp:rte] function job: generate rte for signed overflow [wp] Warning: -wp-rte and model nat require kernel to warn against unsigned overflow [wp] Warning: -wp-rte and model nat require kernel to warn against signed downcast [wp] Warning: -wp-rte and model nat require kernel to warn against unsigned downcast [wp:rte] function job: generate rte for invalid bool value [rte] annotating function job [wp:rte] function job2: generate rte for division by zero [wp:rte] function job2: generate rte for signed overflow [wp:rte] function job2: generate rte for invalid bool value [rte] annotating function job2 [wp:rte] function job3: generate rte for division by zero [wp:rte] function job3: generate rte for signed overflow [wp:rte] function job3: generate rte for invalid bool value [rte] annotating function job3 [wp] Warning: Missing RTE guards [wp] Goal typed_nat_job_ensures : not tried [wp] Goal typed_nat_job_assert_rte_signed_overflow : not tried [wp] Goal typed_nat_job_assert_rte_signed_overflow_2 : not tried [wp] Goal typed_nat_job2_ensures : not tried [wp] Goal typed_nat_job3_ensures : not tried [wp] Goal typed_nat_job3_assert_rte_bool_value : not tried ����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/sep.res.oracle���������������������������0000666�0000000�0000000�00000007574�13571573400�023307� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_plugin/sep.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f1_none ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/sep.i, line 13) in 'f1_none': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f2_p_a ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/sep.i, line 17) in 'f2_p_a': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f3_p_ab ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/sep.i, line 21) in 'f3_p_ab': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f4_pq_ab ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/sep.i, line 25) in 'f4_pq_ab': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f5_pq ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/sep.i, line 29) in 'f5_pq': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f6_Pa ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/sep.i, line 33) in 'f6_Pa': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f7_pq_ad ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/sep.i, line 42) in 'f7_pq_ad': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f8_pq_a ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/sep.i, line 48) in 'f8_pq_a': Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'f2_p_a': /*@ behavior typed_caveat: requires \separated(p,&a); requires \valid(p); */ void f2_p_a(int *p); [wp] Warning: Memory model hypotheses for function 'f3_p_ab': /*@ behavior typed_caveat: requires \separated(p,\union(&a,&b)); requires \valid(p); */ void f3_p_ab(int *p); [wp] Warning: Memory model hypotheses for function 'f4_pq_ab': /*@ behavior typed_caveat: requires \separated(p,q,\union(&a,&b)); requires \valid(p); requires \valid(q); */ void f4_pq_ab(int *p, int *q); [wp] Warning: Memory model hypotheses for function 'f5_pq': /*@ behavior typed_caveat: requires \separated(p,q); requires \valid(p); requires \valid(q); */ void f5_pq(int *p, int *q); [wp] Warning: Memory model hypotheses for function 'f6_Pa': /*@ behavior typed_caveat: requires \separated(p+(..),&a); requires \valid(p+(..)); */ void f6_Pa(int *p, int k); [wp] Warning: Memory model hypotheses for function 'f7_pq_ad': /*@ behavior typed_caveat: requires \separated(p,q,\union(&a,&d)); requires \valid(p); requires \valid(q); */ void f7_pq_ad(int *p, int *q); [wp] Warning: Memory model hypotheses for function 'f8_pq_a': /*@ behavior typed_caveat: requires \separated(p,q,&a); requires \valid(p); requires \valid(q); */ void f8_pq_a(int *p, int *q); ������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/sequence.res.oracle����������������������0000666�0000000�0000000�00000027233�13571573400�024322� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_plugin/sequence.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function loops ------------------------------------------------------------ Goal Post-condition 'ok,first' in 'loops': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok,last' in 'loops': Let a = ([ y ] *^ i). Let a_1 = [ x ] ^ a ^ [ z ]. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x) /\ is_sint32(y) /\ is_sint32(z). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. (* Call 'f' *) Have: L_call_obs(call_seq_1) = [ x ]. (* Invariant 'ok,inv' *) Have: L_call_obs(call_seq_2) = [ x ] ^ a. (* Invariant 'ok,id_max' *) Have: if (0 <= n) then (i <= n) else (i <= 0). (* Invariant 'ok,id_min' *) Have: 0 <= i. (* Else *) Have: n <= i. (* Call 'f' *) Have: L_call_obs(call_seq_3) = a_1. } Prove: nth(a_1, 1 + length(a)) = z. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,id_max' (file tests/wp_plugin/sequence.i, line 97): Let a = ([ y ] *^ i). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x) /\ is_sint32(y) /\ is_sint32(1 + i). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. (* Call 'f' *) Have: L_call_obs(call_seq_1) = [ x ]. (* Invariant 'ok,inv' *) Have: L_call_obs(call_seq_2) = [ x ] ^ a. (* Invariant 'ok,id_max' *) Have: if (0 <= n) then (i <= n) else (i <= 0). (* Invariant 'ok,id_min' *) Have: 0 <= i. (* Then *) Have: i < n. (* Call 'g' *) Have: L_call_obs(call_seq_3) = [ x ] ^ a ^ [ y ]. } Prove: 0 <= n. ------------------------------------------------------------ Goal Establishment of Invariant 'ok,id_max' (file tests/wp_plugin/sequence.i, line 97): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,id_min' (file tests/wp_plugin/sequence.i, line 96): Let a = ([ y ] *^ i). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x) /\ is_sint32(y) /\ is_sint32(1 + i). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. (* Call 'f' *) Have: L_call_obs(call_seq_1) = [ x ]. (* Invariant 'ok,inv' *) Have: L_call_obs(call_seq_2) = [ x ] ^ a. (* Invariant 'ok,id_max' *) Have: if (0 <= n) then (i <= n) else (i <= 0). (* Invariant 'ok,id_min' *) Have: 0 <= i. (* Then *) Have: i < n. (* Call 'g' *) Have: L_call_obs(call_seq_3) = [ x ] ^ a ^ [ y ]. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant 'ok,id_min' (file tests/wp_plugin/sequence.i, line 96): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,inv' (file tests/wp_plugin/sequence.i, line 98): Let a = ([ y ] *^ i). Let x_1 = 1 + i. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x) /\ is_sint32(y) /\ is_sint32(x_1). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. (* Call 'f' *) Have: L_call_obs(call_seq_1) = [ x ]. (* Invariant 'ok,inv' *) Have: L_call_obs(call_seq_2) = [ x ] ^ a. (* Invariant 'ok,id_max' *) Have: if (0 <= n) then (i <= n) else (i <= 0). (* Invariant 'ok,id_min' *) Have: 0 <= i. (* Then *) Have: i < n. (* Call 'g' *) Have: L_call_obs(call_seq_3) = [ x ] ^ a ^ [ y ]. } Prove: ([ y ] *^ x_1) = a ^ [ y ]. ------------------------------------------------------------ Goal Establishment of Invariant 'ok,inv' (file tests/wp_plugin/sequence.i, line 98): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_plugin/sequence.i, line 95): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/sequence.i, line 79) in 'loops' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/sequence.i, line 79) in 'loops' (2/3): Effect at line 100 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/sequence.i, line 79) in 'loops' (3/3): Effect at line 100 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/sequence.i, line 79) in 'loops' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/sequence.i, line 79) in 'loops' (2/3): Effect at line 100 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/sequence.i, line 79) in 'loops' (3/3): Effect at line 100 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function loops with behavior g_called ------------------------------------------------------------ Goal Post-condition for 'g_called' 'ok,u1' in 'loops': Let a = ([ y ] *^ i). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x) /\ is_sint32(y) /\ is_sint32(z). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. (* Pre-condition for 'g_called' *) Have: 0 < n. (* Call 'f' *) Have: L_call_obs(call_seq_1) = [ x ]. (* Invariant 'ok,inv' *) Have: L_call_obs(call_seq_2) = [ x ] ^ a. (* Invariant 'ok,id_max' *) Have: i <= n. (* Invariant 'ok,id_min' *) Have: 0 <= i. (* Else *) Have: n <= i. (* Call 'f' *) Have: L_call_obs(call_seq_3) = [ x ] ^ a ^ [ z ]. } Prove: length(a) = i. ------------------------------------------------------------ Goal Post-condition for 'g_called' 'ok,u2' in 'loops': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function loops with behavior g_not_called ------------------------------------------------------------ Goal Post-condition for 'g_not_called' 'ok,v1' in 'loops': Let a = ([ y ] *^ i). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x) /\ is_sint32(y) /\ is_sint32(z). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. (* Pre-condition for 'g_not_called' *) Have: n <= 0. (* Call 'f' *) Have: L_call_obs(call_seq_1) = [ x ]. (* Invariant 'ok,inv' *) Have: L_call_obs(call_seq_2) = [ x ] ^ a. (* Invariant 'ok,id_max' *) Have: if (0 <= n) then (i <= n) else (i <= 0). (* Invariant 'ok,id_min' *) Have: 0 <= i. (* Else *) Have: n <= i. (* Call 'f' *) Have: L_call_obs(call_seq_3) = [ x ] ^ a ^ [ z ]. } Prove: length(a) = 0. ------------------------------------------------------------ Goal Post-condition for 'g_not_called' 'ok,v2' in 'loops': Let a = ([ y ] *^ i). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(x) /\ is_sint32(y) /\ is_sint32(z). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. (* Pre-condition for 'g_not_called' *) Have: n <= 0. (* Call 'f' *) Have: L_call_obs(call_seq_1) = [ x ]. (* Invariant 'ok,inv' *) Have: L_call_obs(call_seq_2) = [ x ] ^ a. (* Invariant 'ok,id_max' *) Have: if (0 <= n) then (i <= n) else (i <= 0). (* Invariant 'ok,id_min' *) Have: 0 <= i. (* Else *) Have: n <= i. (* Call 'f' *) Have: L_call_obs(call_seq_3) = [ x ] ^ a ^ [ z ]. } Prove: i <= 0. ------------------------------------------------------------ ------------------------------------------------------------ Function no_calls ------------------------------------------------------------ Goal Post-condition 'ok,m1' in 'no_calls': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok,m2' in 'no_calls': Assume { (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. } Prove: length(L_call_nil) = 0. ------------------------------------------------------------ Goal Post-condition 'ok,bug_why3,n1' in 'no_calls': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok,n2' in 'no_calls': Assume { (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. } Prove: L_call_nil = nil. ------------------------------------------------------------ Goal Post-condition 'ok,n3' in 'no_calls': Assume { (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. } Prove: L_call_nil = nil. ------------------------------------------------------------ Goal Post-condition 'ok,bug_why3,n5' in 'no_calls': Assume { Type: is_sint32(a). (* Goal *) When: 0 <= a. (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. } Prove: (L_call_nil = nil) \/ (a <= 0). ------------------------------------------------------------ Goal Post-condition 'ok,bug_why3,n6' in 'no_calls': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok,bug_why3,n5_ok' in 'no_calls': Assume { Type: is_sint32(a). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. } Prove: (L_call_nil = nil) \/ (a <= 0). ------------------------------------------------------------ Goal Post-condition 'ok,bug_why3,n6_ok' in 'no_calls': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/sequence.i, line 35) in 'no_calls': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function sequence ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/sequence.i, line 54) in 'sequence': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/sequence.i, line 54) in 'sequence': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function sequence with behavior g_called ------------------------------------------------------------ Goal Post-condition for 'g_called' 'ok,o1' in 'sequence': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'g_called' 'ok,p1' in 'sequence': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'g_called' 'ok,p2' in 'sequence': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'g_called' 'ok,p3' in 'sequence': Assume { Type: is_sint32(c) /\ is_sint32(x) /\ is_sint32(y) /\ is_sint32(z). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. (* Pre-condition for 'g_called' *) Have: c != 0. (* Call 'f' *) Have: L_call_obs(call_seq_1) = [ x ]. (* Call 'g' *) Have: L_call_obs(call_seq_2) = [ x, y ]. (* Call 'f' *) Have: L_call_obs(call_seq_3) = [ x, y, z ]. } Prove: L_call_nil = nil. ------------------------------------------------------------ ------------------------------------------------------------ Function sequence with behavior g_not_called ------------------------------------------------------------ Goal Post-condition for 'g_not_called' 'ok,o2' in 'sequence': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'g_not_called' 'ok,q1' in 'sequence': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'g_not_called' 'ok,q2' in 'sequence': Prove: true. ------------------------------------------------------------ Goal Post-condition for 'g_not_called' 'ok,q3' in 'sequence': Assume { Type: is_sint32(x) /\ is_sint32(z). (* Pre-condition *) Have: L_call_obs(call_seq_0) = nil. (* Call 'f' *) Have: L_call_obs(call_seq_1) = [ x ]. (* Call 'f' *) Have: L_call_obs(call_seq_2) = [ x, z ]. } Prove: L_call_nil = nil. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/stmt.res.oracle��������������������������0000666�0000000�0000000�00000012611�13571573400�023473� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/stmt.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] [CFG] Goal f_exits : Valid (Unreachable) [wp] [CFG] Goal g_exits : Valid (Unreachable) [wp] [CFG] Goal g_assigns : Valid (Unreachable) [wp] [CFG] Goal g_ensures : Valid (Unreachable) [wp] [CFG] Goal g_exits : Valid (Unreachable) [wp] [CFG] Goal h_exits : Valid (Unreachable) [wp] [CFG] Goal h_assigns : Valid (Unreachable) [wp] [CFG] Goal h_ensures : Valid (Unreachable) [wp] [CFG] Goal h_exits : Valid (Unreachable) [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/stmt.c, line 10) in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/stmt.c, line 11) in 'f': Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_plugin/stmt.c, line 16): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior default_for_stmt_2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/stmt.c, line 17) at block: Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/stmt.c, line 21) at block: Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/stmt.c, line 27) in 'g': Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_plugin/stmt.c, line 32): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function h ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/stmt.c, line 40) in 'h': Prove: true. ------------------------------------------------------------ Goal Assertion (generated): Prove: true. ------------------------------------------------------------ Goal Assertion (generated): Prove: true. ------------------------------------------------------------ [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Exit-condition (file tests/wp_plugin/stmt.c, line 15) at block by Unreachable Annotations. [ Partial ] Return-condition (file tests/wp_plugin/stmt.c, line 16) at block By Frama-C kernel, with pending: - Assertion (file tests/wp_plugin/stmt.c, line 16) [ - ] Default behavior at block tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Exit-condition (file tests/wp_plugin/stmt.c, line 31) at block by Unreachable Annotations. [ Valid ] Return-condition (file tests/wp_plugin/stmt.c, line 32) at block by Unreachable Annotations. [ Valid ] Post-condition (file tests/wp_plugin/stmt.c, line 33) at block by Unreachable Annotations. [ Valid ] Assigns (file tests/wp_plugin/stmt.c, line 36) at block by Unreachable Annotations. [ Valid ] Default behavior at block by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Exit-condition (file tests/wp_plugin/stmt.c, line 43) at block by Unreachable Annotations. [ Valid ] Post-condition (file tests/wp_plugin/stmt.c, line 44) at block by Unreachable Annotations. [ Partial ] Return-condition for 'POS' (file tests/wp_plugin/stmt.c, line 48) at block By Frama-C kernel, with pending: - Assertion (generated) - Assertion (generated) [ Partial ] Return-condition for 'NEG' (file tests/wp_plugin/stmt.c, line 51) at block By Frama-C kernel, with pending: - Assertion (generated) - Assertion (generated) [ Valid ] Assigns (file tests/wp_plugin/stmt.c, line 53) at block by Unreachable Annotations. [ Partial ] Behavior 'NEG' at block By Frama-C kernel, with pending: - Assertion (generated) - Assertion (generated) [ Partial ] Behavior 'POS' at block By Frama-C kernel, with pending: - Assertion (generated) - Assertion (generated) [ Valid ] Default behavior at block by Frama-C kernel. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 10 Completely validated 5 Locally validated 1 To be validated 16 Total -------------------------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/string_c.res.oracle����������������������0000666�0000000�0000000�00000072745�13571573400�024332� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/string_c.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards Goal Post-condition 'copied_contents' in 'memcpy': Let a = shift_sint8(dest_0, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Assume { Type: is_uint32(i) /\ is_uint32(n). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n) /\ separated(a, n, shift_sint8(src_0, 0), n). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_1[shift_sint8(src_0, i_1)] = a_1[shift_sint8(dest_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Else *) Have: n <= i. } Prove: L_memcmp(Mchar_0, havoc(Mchar_undef_0, Mchar_0, a, i), dest_0, src_0, i) = 0. ------------------------------------------------------------ Goal Post-condition 'result_ptr' in 'memcpy': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 33): Let a = shift_sint8(dest_0, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Assume { Type: is_uint32(i) /\ is_uint32(n). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n) /\ separated(a, n, shift_sint8(src_0, 0), n). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_1[shift_sint8(src_0, i_1)] = a_1[shift_sint8(dest_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: to_uint32(1 + i) <= n. ------------------------------------------------------------ Goal Establishment of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 33): Assume { Type: is_uint32(n). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n) /\ separated(shift_sint8(dest_0, 0), n, shift_sint8(src_0, 0), n). } Prove: 0 <= n. ------------------------------------------------------------ Goal Preservation of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 34): Let a = shift_sint8(dest_0, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = a_1[shift_sint8(dest_0, i) <- a_1[shift_sint8(src_0, i)]]. Assume { Type: is_uint32(i) /\ is_uint32(n). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + i)). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n) /\ separated(a, n, shift_sint8(src_0, 0), n). (* Invariant 'no_eva' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_1[shift_sint8(src_0, i_2)] = a_1[shift_sint8(dest_0, i_2)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: a_2[shift_sint8(src_0, i_1)] = a_2[shift_sint8(dest_0, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 34): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file FRAMAC_SHARE/libc/string.c, line 35) (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file FRAMAC_SHARE/libc/string.c, line 35) (2/3): Effect at line 38 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file FRAMAC_SHARE/libc/string.c, line 35) (3/3): Effect at line 39 Let a = shift_sint8(dest_0, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(dest_0, i). Assume { Type: is_uint32(i) /\ is_uint32(n). (* Goal *) When: !invalid(Malloc_0, a_2, 1). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n) /\ separated(a, n, shift_sint8(src_0, 0), n). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_1[shift_sint8(src_0, i_1)] = a_1[shift_sint8(dest_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: included(a_2, 1, a, n). ------------------------------------------------------------ Goal Assigns (file FRAMAC_SHARE/libc/string.h, line 96) in 'memcpy': Effect at line 38 Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file FRAMAC_SHARE/libc/string.c, line 38): Let a = shift_sint8(dest_0, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Assume { Type: is_uint32(i) /\ is_uint32(n). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n) /\ separated(a, n, shift_sint8(src_0, 0), n). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_1[shift_sint8(src_0, i_1)] = a_1[shift_sint8(dest_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file FRAMAC_SHARE/libc/string.c, line 38): Prove: true. ------------------------------------------------------------ Goal Post-condition 'copied_contents' in 'memmove': Assume { Type: is_uint32(i) /\ is_uint32(i_1) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n). If n = 0 Then { Have: Mchar_1 = Mchar_0. } Else { Let a = shift_sint8(dest_0, 0). Let a_1 = shift_sint8(src_0, 0). (* Call 'memoverlap' *) Have: ((separated(a, n, a_1, n) -> (memoverlap_0 = 0))) /\ ((addr_le(dest_0, src_0) -> (addr_lt(src_0, shift_sint8(dest_0, n)) -> ((!separated(a, n, a_1, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(src_0, dest_0) -> (addr_le(dest_0, shift_sint8(src_0, n)) -> ((!separated(a, n, a_1, n)) -> (memoverlap_0 = 1))))). If memoverlap_0 <= 0 Then { Have: (ta_i_0=false). (* Loop assigns ... *) Have: havoc(Mchar_undef_0, Mchar_0, a, n) = Mchar_1. (* Invariant 'no_eva' *) Have: forall i_2 : Z. let a_2 = shift_sint8(src_0, i_2) in ((i <= i_2) -> ((i_2 < n) -> (Mchar_1[a_2] = Mchar_0[a_2]))). (* Invariant 'no_eva' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (Mchar_1[shift_sint8(dest_0, i_2)] = Mchar_0[shift_sint8(src_0, i_2)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Else *) Have: n <= i. } Else { (* Block In *) Have: (ta_i_1=false). (* Loop assigns ... *) Have: havoc(Mchar_undef_1, Mchar_0, a, n) = Mchar_2. (* Invariant 'no_eva' *) Have: forall i_2 : Z. let a_2 = shift_sint8(src_0, i_2) in ((i_2 <= i_1) -> ((0 <= i_2) -> (Mchar_2[a_2] = Mchar_0[a_2]))). (* Invariant 'no_eva' *) Have: forall i_2 : Z. ((i_1 < i_2) -> ((i_2 < n) -> (Mchar_2[shift_sint8(dest_0, i_2)] = Mchar_0[shift_sint8(src_0, i_2)]))). (* Invariant 'no_eva' *) Have: (0 <= i_1) /\ (i_1 < n). (* Else *) Have: i_1 <= 0. Have: Mchar_2[a <- Mchar_2[a_1]] = Mchar_1. } } } Prove: L_memcmp(Mchar_0, Mchar_1, dest_0, src_0, n) = 0. ------------------------------------------------------------ Goal Post-condition 'result_ptr' in 'memmove': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 79): Let a = shift_sint8(dest_0, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(src_0, 0). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(dest_0, src_0) -> (addr_lt(src_0, shift_sint8(dest_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(src_0, dest_0) -> (addr_le(dest_0, shift_sint8(src_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Then *) Have: memoverlap_0 <= 0. (* Invariant 'no_eva' *) Have: forall i_1 : Z. let a_3 = shift_sint8(src_0, i_1) in ((i <= i_1) -> ((i_1 < n) -> (a_1[a_3] = Mchar_0[a_3]))). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_1[shift_sint8(dest_0, i_1)] = Mchar_0[shift_sint8(src_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: to_uint32(1 + i) <= n. ------------------------------------------------------------ Goal Establishment of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 79): Let a = shift_sint8(d, 0). Let a_1 = shift_sint8(s, 0). Assume { Type: is_uint32(n) /\ is_sint32(memoverlap_0). (* Heap *) Have: (region(d.base) <= 0) /\ (region(s.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, d, n) /\ P_valid_read_or_empty(Malloc_0, s, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_1, n) -> (memoverlap_0 = 0))) /\ ((addr_le(d, s) -> (addr_lt(s, shift_sint8(d, n)) -> ((!separated(a, n, a_1, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(s, d) -> (addr_le(d, shift_sint8(s, n)) -> ((!separated(a, n, a_1, n)) -> (memoverlap_0 = 1))))). (* Then *) Have: memoverlap_0 <= 0. } Prove: 0 <= n. ------------------------------------------------------------ Goal Preservation of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 80): Let a = shift_sint8(d, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(s, 0). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + i)). (* Heap *) Have: (region(d.base) <= 0) /\ (region(s.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, d, n) /\ P_valid_read_or_empty(Malloc_0, s, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(d, s) -> (addr_lt(s, shift_sint8(d, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(s, d) -> (addr_le(d, shift_sint8(s, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Then *) Have: memoverlap_0 <= 0. (* Invariant 'no_eva' *) Have: forall i_2 : Z. let a_3 = shift_sint8(s, i_2) in ((i <= i_2) -> ((i_2 < n) -> (a_1[a_3] = Mchar_0[a_3]))). (* Invariant 'no_eva' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_1[shift_sint8(d, i_2)] = Mchar_0[shift_sint8(s, i_2)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: a_1[shift_sint8(d, i) <- a_1[shift_sint8(s, i)]][shift_sint8(d, i_1)] = Mchar_0[shift_sint8(s, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 80): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 81): Let a = shift_sint8(d, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(s, 0). Let a_3 = shift_sint8(s, i_1). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Goal *) When: (i_1 < n) /\ (to_uint32(1 + i) <= i_1). (* Heap *) Have: (region(d.base) <= 0) /\ (region(s.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, d, n) /\ P_valid_read_or_empty(Malloc_0, s, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(d, s) -> (addr_lt(s, shift_sint8(d, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(s, d) -> (addr_le(d, shift_sint8(s, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Then *) Have: memoverlap_0 <= 0. (* Invariant 'no_eva' *) Have: forall i_2 : Z. let a_4 = shift_sint8(s, i_2) in ((i <= i_2) -> ((i_2 < n) -> (a_1[a_4] = Mchar_0[a_4]))). (* Invariant 'no_eva' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_1[shift_sint8(d, i_2)] = Mchar_0[shift_sint8(s, i_2)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: a_1[shift_sint8(d, i) <- a_1[shift_sint8(s, i)]][a_3] = Mchar_0[a_3]. ------------------------------------------------------------ Goal Establishment of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 81): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 91): Let a = shift_sint8(dest_0, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(src_0, 0). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(dest_0, src_0) -> (addr_lt(src_0, shift_sint8(dest_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(src_0, dest_0) -> (addr_le(dest_0, shift_sint8(src_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Else *) Have: 0 < memoverlap_0. (* Invariant 'no_eva' *) Have: forall i_1 : Z. let a_3 = shift_sint8(src_0, i_1) in ((i_1 <= i) -> ((0 <= i_1) -> (a_1[a_3] = Mchar_0[a_3]))). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((i < i_1) -> ((i_1 < n) -> (a_1[shift_sint8(dest_0, i_1)] = Mchar_0[shift_sint8(src_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i < n). (* Then *) Have: 0 < i. } Prove: to_uint32(i - 1) < n. ------------------------------------------------------------ Goal Establishment of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 91): Let a = shift_sint8(d, 0). Let a_1 = shift_sint8(s, 0). Assume { Type: is_uint32(n) /\ is_sint32(memoverlap_0). (* Heap *) Have: (region(d.base) <= 0) /\ (region(s.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, d, n) /\ P_valid_read_or_empty(Malloc_0, s, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_1, n) -> (memoverlap_0 = 0))) /\ ((addr_le(d, s) -> (addr_lt(s, shift_sint8(d, n)) -> ((!separated(a, n, a_1, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(s, d) -> (addr_le(d, shift_sint8(s, n)) -> ((!separated(a, n, a_1, n)) -> (memoverlap_0 = 1))))). (* Else *) Have: 0 < memoverlap_0. } Prove: to_uint32(n - 1) < n. ------------------------------------------------------------ Goal Preservation of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 92): Let a = shift_sint8(d, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(s, 0). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Goal *) When: (i_1 < n) /\ (to_uint32(i - 1) < i_1). (* Heap *) Have: (region(d.base) <= 0) /\ (region(s.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, d, n) /\ P_valid_read_or_empty(Malloc_0, s, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(d, s) -> (addr_lt(s, shift_sint8(d, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(s, d) -> (addr_le(d, shift_sint8(s, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Else *) Have: 0 < memoverlap_0. (* Invariant 'no_eva' *) Have: forall i_2 : Z. let a_3 = shift_sint8(s, i_2) in ((i_2 <= i) -> ((0 <= i_2) -> (a_1[a_3] = Mchar_0[a_3]))). (* Invariant 'no_eva' *) Have: forall i_2 : Z. ((i < i_2) -> ((i_2 < n) -> (a_1[shift_sint8(d, i_2)] = Mchar_0[shift_sint8(s, i_2)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i < n). (* Then *) Have: 0 < i. } Prove: a_1[shift_sint8(d, i) <- a_1[shift_sint8(s, i)]][shift_sint8(d, i_1)] = Mchar_0[shift_sint8(s, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 92): Let a = shift_sint8(dest_0, 0). Let a_1 = shift_sint8(src_0, 0). Assume { Type: is_uint32(n) /\ is_sint32(memoverlap_0). (* Goal *) When: (i < n) /\ (to_uint32(n - 1) < i). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_1, n) -> (memoverlap_0 = 0))) /\ ((addr_le(dest_0, src_0) -> (addr_lt(src_0, shift_sint8(dest_0, n)) -> ((!separated(a, n, a_1, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(src_0, dest_0) -> (addr_le(dest_0, shift_sint8(src_0, n)) -> ((!separated(a, n, a_1, n)) -> (memoverlap_0 = 1))))). (* Else *) Have: 0 < memoverlap_0. } Prove: Mchar_0[shift_sint8(src_0, i)] = Mchar_0[shift_sint8(dest_0, i)]. ------------------------------------------------------------ Goal Preservation of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 93): Let a = shift_sint8(d, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(s, 0). Let a_3 = shift_sint8(s, i_1). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Goal *) When: (0 <= i_1) /\ (i_1 <= to_uint32(i - 1)). (* Heap *) Have: (region(d.base) <= 0) /\ (region(s.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, d, n) /\ P_valid_read_or_empty(Malloc_0, s, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(d, s) -> (addr_lt(s, shift_sint8(d, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(s, d) -> (addr_le(d, shift_sint8(s, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Else *) Have: 0 < memoverlap_0. (* Invariant 'no_eva' *) Have: forall i_2 : Z. let a_4 = shift_sint8(s, i_2) in ((i_2 <= i) -> ((0 <= i_2) -> (a_1[a_4] = Mchar_0[a_4]))). (* Invariant 'no_eva' *) Have: forall i_2 : Z. ((i < i_2) -> ((i_2 < n) -> (a_1[shift_sint8(d, i_2)] = Mchar_0[shift_sint8(s, i_2)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i < n). (* Then *) Have: 0 < i. } Prove: a_1[shift_sint8(d, i) <- a_1[shift_sint8(s, i)]][a_3] = Mchar_0[a_3]. ------------------------------------------------------------ Goal Establishment of Invariant 'no_eva' (file FRAMAC_SHARE/libc/string.c, line 93): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file FRAMAC_SHARE/libc/string.c, line 82) (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file FRAMAC_SHARE/libc/string.c, line 82) (2/3): Effect at line 85 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file FRAMAC_SHARE/libc/string.c, line 82) (3/3): Effect at line 86 Let a = shift_sint8(d, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(src_0, 0). Let a_3 = shift_sint8(d, i). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Goal *) When: !invalid(Malloc_0, a_3, 1). (* Heap *) Have: (region(d.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, d, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(d, src_0) -> (addr_lt(src_0, shift_sint8(d, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(src_0, d) -> (addr_le(d, shift_sint8(src_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Then *) Have: memoverlap_0 <= 0. (* Invariant 'no_eva' *) Have: forall i_1 : Z. let a_4 = shift_sint8(src_0, i_1) in ((i <= i_1) -> ((i_1 < n) -> (a_1[a_4] = Mchar_0[a_4]))). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_1[shift_sint8(d, i_1)] = Mchar_0[shift_sint8(src_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: included(a_3, 1, a, n). ------------------------------------------------------------ Goal Loop assigns (file FRAMAC_SHARE/libc/string.c, line 94) (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file FRAMAC_SHARE/libc/string.c, line 94) (2/3): Effect at line 97 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file FRAMAC_SHARE/libc/string.c, line 94) (3/3): Effect at line 98 Let a = shift_sint8(d, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(src_0, 0). Let a_3 = shift_sint8(d, i). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Goal *) When: !invalid(Malloc_0, a_3, 1). (* Heap *) Have: (region(d.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, d, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(d, src_0) -> (addr_lt(src_0, shift_sint8(d, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(src_0, d) -> (addr_le(d, shift_sint8(src_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Else *) Have: 0 < memoverlap_0. (* Invariant 'no_eva' *) Have: forall i_1 : Z. let a_4 = shift_sint8(src_0, i_1) in ((i_1 <= i) -> ((0 <= i_1) -> (a_1[a_4] = Mchar_0[a_4]))). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((i < i_1) -> ((i_1 < n) -> (a_1[shift_sint8(d, i_1)] = Mchar_0[shift_sint8(src_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i < n). (* Then *) Have: 0 < i. } Prove: included(a_3, 1, a, n). ------------------------------------------------------------ Goal Assigns (file FRAMAC_SHARE/libc/string.h, line 106) in 'memmove': Prove: true. ------------------------------------------------------------ Goal Assigns (file FRAMAC_SHARE/libc/string.h, line 106) in 'memmove' (1/7): Prove: true. ------------------------------------------------------------ Goal Assigns (file FRAMAC_SHARE/libc/string.h, line 106) in 'memmove' (2/7): Effect at line 74 Prove: true. ------------------------------------------------------------ Goal Assigns (file FRAMAC_SHARE/libc/string.h, line 106) in 'memmove' (3/7): Call Result at line 77 Prove: true. ------------------------------------------------------------ Goal Assigns (file FRAMAC_SHARE/libc/string.h, line 106) in 'memmove' (4/7): Effect at line 85 Prove: true. ------------------------------------------------------------ Goal Assigns (file FRAMAC_SHARE/libc/string.h, line 106) in 'memmove' (5/7): Effect at line 97 Prove: true. ------------------------------------------------------------ Goal Assigns (file FRAMAC_SHARE/libc/string.h, line 106) in 'memmove' (6/7): Effect at line 99 Let a = shift_sint8(d, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(src_0, 0). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Goal *) When: !invalid(Malloc_0, a, 1). (* Heap *) Have: (region(d.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, d, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(d, src_0) -> (addr_lt(src_0, shift_sint8(d, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(src_0, d) -> (addr_le(d, shift_sint8(src_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Else *) Have: 0 < memoverlap_0. (* Invariant 'no_eva' *) Have: forall i_1 : Z. let a_3 = shift_sint8(src_0, i_1) in ((i_1 <= i) -> ((0 <= i_1) -> (a_1[a_3] = Mchar_0[a_3]))). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((i < i_1) -> ((i_1 < n) -> (a_1[shift_sint8(d, i_1)] = Mchar_0[shift_sint8(src_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i < n). (* Else *) Have: i <= 0. } Prove: 0 < n. ------------------------------------------------------------ Goal Assigns (file FRAMAC_SHARE/libc/string.h, line 106) in 'memmove' (7/7): Effect at line 101 Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file FRAMAC_SHARE/libc/string.c, line 85): Let a = shift_sint8(dest_0, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(src_0, 0). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(dest_0, src_0) -> (addr_lt(src_0, shift_sint8(dest_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(src_0, dest_0) -> (addr_le(dest_0, shift_sint8(src_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Then *) Have: memoverlap_0 <= 0. (* Invariant 'no_eva' *) Have: forall i_1 : Z. let a_3 = shift_sint8(src_0, i_1) in ((i <= i_1) -> ((i_1 < n) -> (a_1[a_3] = Mchar_0[a_3]))). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_1[shift_sint8(dest_0, i_1)] = Mchar_0[shift_sint8(src_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file FRAMAC_SHARE/libc/string.c, line 85): Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file FRAMAC_SHARE/libc/string.c, line 97): Let a = shift_sint8(dest_0, 0). Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, n). Let a_2 = shift_sint8(src_0, 0). Assume { Type: is_uint32(i) /\ is_uint32(n) /\ is_sint32(memoverlap_0). (* Heap *) Have: (region(dest_0.base) <= 0) /\ (region(src_0.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_valid_or_empty(Malloc_0, dest_0, n) /\ P_valid_read_or_empty(Malloc_0, src_0, n). (* Else *) Have: n != 0. (* Call 'memoverlap' *) Have: ((separated(a, n, a_2, n) -> (memoverlap_0 = 0))) /\ ((addr_le(dest_0, src_0) -> (addr_lt(src_0, shift_sint8(dest_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = (-1)))))) /\ ((addr_lt(src_0, dest_0) -> (addr_le(dest_0, shift_sint8(src_0, n)) -> ((!separated(a, n, a_2, n)) -> (memoverlap_0 = 1))))). (* Else *) Have: 0 < memoverlap_0. (* Invariant 'no_eva' *) Have: forall i_1 : Z. let a_3 = shift_sint8(src_0, i_1) in ((i_1 <= i) -> ((0 <= i_1) -> (a_1[a_3] = Mchar_0[a_3]))). (* Invariant 'no_eva' *) Have: forall i_1 : Z. ((i < i_1) -> ((i_1 < n) -> (a_1[shift_sint8(dest_0, i_1)] = Mchar_0[shift_sint8(src_0, i_1)]))). (* Invariant 'no_eva' *) Have: (0 <= i) /\ (i < n). (* Then *) Have: 0 < i. } Prove: to_uint32(i - 1) < i. ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file FRAMAC_SHARE/libc/string.c, line 97): Prove: true. ------------------------------------------------------------ ���������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/struct.res.oracle������������������������0000666�0000000�0000000�00000005152�13571573400�024032� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/struct.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'qed_ok,E0' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E1' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E2' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E3' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E4' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E5' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E6' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E7' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E8' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E9' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E10' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,E11' in 'f': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition 'qed_ok,P3' in 'g': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,P4' in 'g': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,P5' in 'g': Prove: true. ------------------------------------------------------------ Goal Assigns 'qed_ok' in 'g': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function id ------------------------------------------------------------ Goal Post-condition 'qed_ok,P1' in 'id': Prove: true. ------------------------------------------------------------ Goal Post-condition 'qed_ok,P2' in 'id': Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/subset.res.oracle������������������������0000666�0000000�0000000�00000001534�13571573400�024013� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/subset.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function mem ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/subset.i, line 4) in 'mem': Let x = b.base. Let x_1 = a.base. Assume { Type: is_sint32(mem_0) /\ is_sint32(n). (* Heap *) Have: (region(x_1) <= 0) /\ (region(x) <= 0). (* Pre-condition *) Have: x = x_1. If addr_le(b, a) Then { If addr_le(a, shift_sint32(b, n)) Then { Have: mem_0 = 1. } Else { Have: mem_0 = 0. } } Else { Have: mem_0 = 0. } } Prove: included(a, 1, shift_sint32(b, 0), 1 + n) <-> (mem_0 != 0). ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/subset_fopen.res.oracle������������������0000666�0000000�0000000�00000002600�13571573400�025175� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/subset_fopen.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'Ok_A' (file tests/wp_plugin/subset_fopen.c, line 17): Assume { Type: is_sint32(i). (* Heap *) Have: linked(Malloc_0). } Prove: (0 <= i) /\ (i <= 9). ------------------------------------------------------------ Goal Assertion 'Ok_B' (file tests/wp_plugin/subset_fopen.c, line 18): Prove: true. ------------------------------------------------------------ Goal Assertion 'Ok_C' (file tests/wp_plugin/subset_fopen.c, line 19): Prove: true. ------------------------------------------------------------ Goal Assertion 'Ok_D' (file tests/wp_plugin/subset_fopen.c, line 22): Prove: true. ------------------------------------------------------------ Goal Assertion 'Ok_E' (file tests/wp_plugin/subset_fopen.c, line 26): Assume { Type: is_sint32(i). (* Goal *) When: null != p. (* Heap *) Have: linked(Malloc_0). (* Assertion 'Ok_A' *) Have: (0 <= i) /\ (i <= 9). (* Call 'fopen' *) Have: included(p, 2, shift___fc_FILE(global(G___fc_fopen_19), 0), 1024). } Prove: valid_rw(Malloc_0, p, 2). ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/trig.res.oracle��������������������������0000666�0000000�0000000�00000004327�13571573400�023456� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/trig.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Assertion 'qed_ok,S' (file tests/wp_plugin/trig.i, line 42): Let x = c.F1_MSG_size. Let a_1 = c.F1_MSG_text. Assume { Type: IsS1_MSG(a) /\ IsS1_MSG(b) /\ IsS1_MSG(c) /\ is_sint32(x) /\ is_uint8((a.F1_MSG_text)[2]) /\ is_uint8((b.F1_MSG_text)[2]) /\ is_uint8(a_1[2]) /\ is_uint8(a_1[7]). (* Pre-condition *) Have: ((a.F1_MSG_size) = 5) /\ ((b.F1_MSG_size) = 5). (* Call 'fconcat' *) Have: EqS1_MSG(c, L_concat(a, b)). } Prove: x = 10. ------------------------------------------------------------ Goal Assertion 'qed_ok,A' (file tests/wp_plugin/trig.i, line 43): Let a_1 = (a.F1_MSG_text)[2]. Let a_2 = c.F1_MSG_text. Let a_3 = a_2[2]. Assume { Type: IsS1_MSG(a) /\ IsS1_MSG(b) /\ IsS1_MSG(c) /\ is_uint8(a_1) /\ is_uint8((b.F1_MSG_text)[2]) /\ is_uint8(a_3) /\ is_uint8(a_2[7]). (* Pre-condition *) Have: ((a.F1_MSG_size) = 5) /\ ((b.F1_MSG_size) = 5). (* Call 'fconcat' *) Have: EqS1_MSG(c, L_concat(a, b)). (* Assertion 'qed_ok,S' *) Have: (c.F1_MSG_size) = 10. } Prove: a_3 = a_1. ------------------------------------------------------------ Goal Assertion 'qed_ok,B' (file tests/wp_plugin/trig.i, line 44): Let a_1 = c.F1_MSG_text. Let a_2 = a_1[2]. Let a_3 = (a.F1_MSG_text)[2]. Let a_4 = (b.F1_MSG_text)[2]. Let a_5 = a_1[7]. Assume { Type: IsS1_MSG(a) /\ IsS1_MSG(b) /\ IsS1_MSG(c) /\ is_uint8(a_3) /\ is_uint8(a_4) /\ is_uint8(a_2) /\ is_uint8(a_5). (* Pre-condition *) Have: ((a.F1_MSG_size) = 5) /\ ((b.F1_MSG_size) = 5). (* Call 'fconcat' *) Have: EqS1_MSG(c, L_concat(a, b)). (* Assertion 'qed_ok,S' *) Have: (c.F1_MSG_size) = 10. (* Assertion 'qed_ok,A' *) Have: a_2 = a_3. } Prove: a_5 = a_4. ------------------------------------------------------------ Goal Instance of 'Pre-condition 'qed_ok' in 'fconcat'' in 'foo' at initialization of 'c' (file tests/wp_plugin/trig.i, line 41) : Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/unfold_assigns.0.res.oracle��������������0000666�0000000�0000000�00000011170�13571573400�025657� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unfold_assigns.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function NO_UNFOLD_KO ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 33) in 'NO_UNFOLD_KO': Call Effect at line 35 Assume { (* Goal *) When: !invalid(Malloc_0, s, 2). (* Heap *) Have: (region(s.base) <= 0) /\ linked(Malloc_0). } Prove: false. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 33) in 'NO_UNFOLD_KO': Call Effect at line 35 Assume { (* Goal *) When: !invalid(Malloc_0, s, 2). (* Heap *) Have: (region(s.base) <= 0) /\ linked(Malloc_0). } Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function NO_UNFOLD_OK_1 ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 18) in 'NO_UNFOLD_OK_1': Call Effect at line 20 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 18) in 'NO_UNFOLD_OK_1': Call Effect at line 20 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function NO_UNFOLD_OK_2 ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 23) in 'NO_UNFOLD_OK_2': Call Effect at line 25 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 23) in 'NO_UNFOLD_OK_2': Call Effect at line 25 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function NO_UNFOLD_OK_3 ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 28) in 'NO_UNFOLD_OK_3': Call Effect at line 30 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 28) in 'NO_UNFOLD_OK_3': Call Effect at line 30 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function USE_ASSIGN_UNFOLD_KO ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/unfold_assigns.i, line 48) in 'USE_ASSIGN_UNFOLD_KO': Let a = Load_S1_S(q, Mint_0). Let a_1 = Load_S1_S(q, havoc(Mint_undef_0, Mint_0, p, 2)). Assume { Type: IsS1_S(a) /\ IsS1_S(a_1). (* Goal *) When: separated(p, 2, q, 2). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). } Prove: EqS1_S(a_1, a). ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 49) in 'USE_ASSIGN_UNFOLD_KO': Call Effect at line 53 Assume { (* Goal *) When: !invalid(Malloc_0, p, 2). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). } Prove: false. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 49) in 'USE_ASSIGN_UNFOLD_KO': Call Effect at line 53 Assume { (* Goal *) When: !invalid(Malloc_0, p, 2). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). } Prove: false. ------------------------------------------------------------ ------------------------------------------------------------ Function USE_ASSIGN_UNFOLD_OK ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/unfold_assigns.i, line 39) in 'USE_ASSIGN_UNFOLD_OK': Let a = Load_S1_S(q, Mint_0). Let a_1 = Load_S1_S(q, havoc(Mint_undef_0, Mint_0, p, 2)). Assume { Type: IsS1_S(a) /\ IsS1_S(a_1). (* Goal *) When: separated(p, 2, q, 2). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). } Prove: EqS1_S(a_1, a). ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 40) in 'USE_ASSIGN_UNFOLD_OK': Call Effect at line 44 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 40) in 'USE_ASSIGN_UNFOLD_OK': Call Effect at line 44 Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/unfold_assigns.1.res.oracle��������������0000666�0000000�0000000�00000010132�13571573400�025655� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unfold_assigns.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function NO_UNFOLD_KO ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 33) in 'NO_UNFOLD_KO': Call Effect at line 35 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 33) in 'NO_UNFOLD_KO': Call Effect at line 35 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function NO_UNFOLD_OK_1 ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 18) in 'NO_UNFOLD_OK_1': Call Effect at line 20 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 18) in 'NO_UNFOLD_OK_1': Call Effect at line 20 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function NO_UNFOLD_OK_2 ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 23) in 'NO_UNFOLD_OK_2': Call Effect at line 25 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 23) in 'NO_UNFOLD_OK_2': Call Effect at line 25 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function NO_UNFOLD_OK_3 ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 28) in 'NO_UNFOLD_OK_3': Call Effect at line 30 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 28) in 'NO_UNFOLD_OK_3': Call Effect at line 30 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function USE_ASSIGN_UNFOLD_KO ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/unfold_assigns.i, line 48) in 'USE_ASSIGN_UNFOLD_KO': Let a = Load_S1_S(q, Mint_0). Let a_1 = Load_S1_S(q, havoc(Mint_undef_0, Mint_0, p, 2)). Assume { Type: IsS1_S(a) /\ IsS1_S(a_1). (* Goal *) When: separated(p, 2, q, 2). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). } Prove: EqS1_S(a_1, a). ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 49) in 'USE_ASSIGN_UNFOLD_KO': Call Effect at line 53 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 49) in 'USE_ASSIGN_UNFOLD_KO': Call Effect at line 53 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function USE_ASSIGN_UNFOLD_OK ------------------------------------------------------------ Goal Post-condition (file tests/wp_plugin/unfold_assigns.i, line 39) in 'USE_ASSIGN_UNFOLD_OK': Let a = Load_S1_S(q, Mint_0). Let a_1 = Load_S1_S(q, havoc(Mint_undef_0, Mint_0, p, 2)). Assume { Type: IsS1_S(a) /\ IsS1_S(a_1). (* Goal *) When: separated(p, 2, q, 2). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). } Prove: EqS1_S(a_1, a). ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 40) in 'USE_ASSIGN_UNFOLD_OK': Call Effect at line 44 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_plugin/unfold_assigns.i, line 40) in 'USE_ASSIGN_UNFOLD_OK': Call Effect at line 44 Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/unroll.res.oracle������������������������0000666�0000000�0000000�00000002343�13571573400�024020� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unroll.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/unroll.i:20: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function unrolled_loop ------------------------------------------------------------ Goal Post-condition 'zero' in 'unrolled_loop': Let a = shift_uint32(t, 0). Assume { (* Heap *) Have: (region(t.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, a, 16). } Prove: P_zeroed(Mint_0[a <- 0][shift_uint32(t, 1) <- 0][shift_uint32(t, 2) <- 0][shift_uint32(t, 3) <- 0][shift_uint32(t, 4) <- 0] [shift_uint32(t, 5) <- 0][shift_uint32(t, 6) <- 0] [shift_uint32(t, 7) <- 0][shift_uint32(t, 8) <- 0] [shift_uint32(t, 9) <- 0][shift_uint32(t, 10) <- 0] [shift_uint32(t, 11) <- 0][shift_uint32(t, 12) <- 0] [shift_uint32(t, 13) <- 0][shift_uint32(t, 14) <- 0] [shift_uint32(t, 15) <- 0], t, 0, 15). ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/unsafe-arrays.0.res.oracle���������������0000666�0000000�0000000�00000001516�13571573400�025424� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unsafe-arrays.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'ARRAYS' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'STRUCT' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'INDIRP' in 'f': Assume { (* Heap *) Have: (region(p.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, p, 10). } Prove: valid_rw(Malloc_0, shift_sint32(shiftfield_F1_f(p), 0), 10). ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/unsafe-arrays.1.res.oracle���������������0000666�0000000�0000000�00000000524�13571573400�025423� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unsafe-arrays.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/unsafe-arrays.i:13: User Error: Invalid infinite range (shiftfield_F1_f p_0)+(..) [kernel] Plug-in wp aborted: invalid user input. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/unsigned.err.oracle����������������������0000666�0000000�0000000�00000000000�13571573400�024304� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/unsigned.res.oracle����������������������0000666�0000000�0000000�00000001104�13571573400�024313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unsigned.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 1 goal scheduled [wp] [Tactical] Goal typed_lemma_U32 : Valid [wp] Proved goals: 1 / 1 Qed: 0 Script: 1 ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma U32: Prove: (is_uint32 x_0) -> ((land 4294967295 x_0)=x_0) Prover Tactical returns Valid ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/unsupported_init.res.oracle��������������0000666�0000000�0000000�00000002455�13571573400�026124� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unsupported_init.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/unsupported_init.i:1: Warning: Allocation, initialization and danglingness not yet implemented (r1: \initialized(Y + (0 .. 99))) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'a1' (file tests/wp_plugin/unsupported_init.i, line 9): tests/wp_plugin/unsupported_init.i:1: warning from wp: - Warning: Ignored Hypothesis Reason: Allocation, initialization and danglingness not yet implemented (r1: \initialized(Y + (0 .. 99))) Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition 'r1' in 'cp'' in 'f' at call 'cp' (file tests/wp_plugin/unsupported_init.i, line 8) : tests/wp_plugin/unsupported_init.i:1: warning from wp: - Warning: Target turned to False, looking for context inconsistency Reason: Allocation, initialization and danglingness not yet implemented (r1: \initialized(Y + (0 .. 99))) Assume { (* Heap *) Have: (region(A.base) <= 0) /\ (region(B.base) <= 0). } Prove: false. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/volatile.0.res.oracle��������������������0000666�0000000�0000000�00000003147�13571573400�024465� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/volatile.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job_assigns ------------------------------------------------------------ Goal Assertion 'KO_WHEN_VOLATILE' (file tests/wp_plugin/volatile.i, line 15): Prove: w = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function job_read ------------------------------------------------------------ Goal Assertion 'KO_WHEN_VOLATILE' (file tests/wp_plugin/volatile.i, line 21): Assume { Type: is_sint32(x). } Prove: x = w. ------------------------------------------------------------ ------------------------------------------------------------ Function job_struct ------------------------------------------------------------ Goal Assertion 'ok,dead_code' (file tests/wp_plugin/volatile.i, line 29): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job_struct_assigns ------------------------------------------------------------ Goal Assertion 'KO_WHEN_VOLATILE' (file tests/wp_plugin/volatile.i, line 35): Assume { (* Heap *) Have: region(p.base) <= 0. } Prove: EqS1_st_v(w, w_1). ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'job_struct_assigns': /*@ behavior typed: requires \separated(&sv,p); */ void job_struct_assigns(struct st_v *p); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle/volatile.1.res.oracle��������������������0000666�0000000�0000000�00000006105�13571573400�024463� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-no-volatile [...] [kernel] Parsing tests/wp_plugin/volatile.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/volatile.i:15: Warning: unsafe volatile access to (term) l-value [wp] tests/wp_plugin/volatile.i:14: Warning: unsafe write-access to volatile l-value [wp] tests/wp_plugin/volatile.i:21: Warning: unsafe volatile access to (term) l-value [wp] tests/wp_plugin/volatile.i:20: Warning: unsafe read-access to volatile l-value [wp] tests/wp_plugin/volatile.i:35: Warning: unsafe volatile access to (term) l-value [wp] tests/wp_plugin/volatile.i:35: Warning: unsafe volatile access to (term) l-value [wp] tests/wp_plugin/volatile.i:34: Warning: unsafe write-access to volatile l-value ------------------------------------------------------------ Function job_assigns ------------------------------------------------------------ Goal Assertion 'KO_WHEN_VOLATILE' (file tests/wp_plugin/volatile.i, line 15): tests/wp_plugin/volatile.i:14: warning from wp: - Warning: ignore volatile attribute Reason: unsafe write-access to volatile l-value tests/wp_plugin/volatile.i:15: warning from wp: - Warning: ignore volatile attribute Reason: unsafe volatile access to (term) l-value Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job_read ------------------------------------------------------------ Goal Assertion 'KO_WHEN_VOLATILE' (file tests/wp_plugin/volatile.i, line 21): tests/wp_plugin/volatile.i:20: warning from wp: - Warning: ignore volatile attribute Reason: unsafe read-access to volatile l-value tests/wp_plugin/volatile.i:21: warning from wp: - Warning: ignore volatile attribute Reason: unsafe volatile access to (term) l-value Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job_struct ------------------------------------------------------------ Goal Assertion 'ok,dead_code' (file tests/wp_plugin/volatile.i, line 29): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job_struct_assigns ------------------------------------------------------------ Goal Assertion 'KO_WHEN_VOLATILE' (file tests/wp_plugin/volatile.i, line 35): tests/wp_plugin/volatile.i:34: warning from wp: - Warning: ignore volatile attribute Reason: unsafe write-access to volatile l-value tests/wp_plugin/volatile.i:35: warning from wp: - Warning: ignore volatile attribute Reason: unsafe volatile access to (term) l-value tests/wp_plugin/volatile.i:35: warning from wp: - Warning: ignore volatile attribute Reason: unsafe volatile access to (term) l-value Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'job_struct_assigns': /*@ behavior typed: requires \separated(&sv,p); */ void job_struct_assigns(struct st_v *p); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/����������������������������������0000777�0000000�0000000�00000000000�13571573400�022065� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.0.res.oracle������������������0000666�0000000�0000000�00000001300�13571573400�024741� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/abs.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_abs_abs_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/abs.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/abs.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success abs - 1 (12..24) 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024452� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025515� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.0.session/cache/197ec27172491d33862a78fd32fadc0f.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.0.session/cache/197ec27172491d0000666�0000000�0000000�00000000127�13571573400�027275� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0171, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.1.res.oracle������������������0000666�0000000�0000000�00000001463�13571573400�024754� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/abs.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: native support for coq is deprecated, use tip instead [wp] 1 goal scheduled [wp] [Coq] Goal typed_abs_abs_ensures : Saved script [wp] [Coq (Native)] Goal typed_abs_abs_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Coq: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/abs.1.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/abs.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success abs - - 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.2.res.oracle������������������0000666�0000000�0000000�00000001411�13571573400�024746� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/abs.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: native support for alt-ergo is deprecated, use why3 instead [wp] 1 goal scheduled [wp] [Alt-Ergo (Native)] Goal typed_abs_abs_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/abs.2.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/abs.2.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success abs - - (4..16) 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.2.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024454� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.2.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025517� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.2.session/cache/197ec27172491d33862a78fd32fadc0f.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.2.session/cache/197ec27172491d0000666�0000000�0000000�00000000127�13571573400�027277� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0158, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.i.0.report.json���������������0000666�0000000�0000000�00000002010�13571573400�025415� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:functions": { "abs": { "abs_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.i.1.report.json���������������0000666�0000000�0000000�00000001243�13571573400�025425� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "coq": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "abs": { "abs_ensures": { "coq": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "coq": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.i.2.report.json���������������0000666�0000000�0000000�00000002010�13571573400�025417� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:functions": { "abs": { "abs_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/asm.0.report.json�����������������0000666�0000000�0000000�00000003272�13571573400�025214� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } }, "wp:functions": { "main": { "main_assert_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_assert_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/asm.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024465� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/asm.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025530� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/asm.0.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/asm.0.session/cache/2d7c06745f37530000666�0000000�0000000�00000000072�13571573400�027307� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/asm.0.session/cache/9ffeff1b1fd70de5988221b29b130cda.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/asm.0.session/cache/9ffeff1b1fd70d0000666�0000000�0000000�00000000107�13571573400�027747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/asm.i.0.report.json���������������0000666�0000000�0000000�00000003105�13571573400�025436� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } }, "wp:functions": { "main": { "main_assert_KO": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_assert_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_assigns": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/asm.res.oracle��������������������0000666�0000000�0000000�00000001473�13571573400�024631� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/asm.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_main_assert_OK : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_assert_KO : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_main_assigns : Unsuccess [wp] Proved goals: 1 / 3 Qed: 1 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_plugin/oracle_qualif/asm.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/asm.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main 1 - 3 33.3% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bit_test.res.oracle���������������0000666�0000000�0000000�00000001743�13571573400�025666� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/bit_test.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_bit_test_check1_ensures_ko : Typechecked [wp] [Alt-Ergo 2.0.0] Goal typed_bit_test_check2_ensures_ko : Typechecked [wp] [Alt-Ergo 2.0.0] Goal typed_bit_test_check3_ensures_ko : Typechecked [wp] Proved goals: 0 / 3 Alt-Ergo 2.0.0: 0 (unsuccess: 3) [wp] Report in: 'tests/wp_plugin/oracle_qualif/bit_test.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/bit_test.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success check1 - - 1 0.0% check2 - - 1 0.0% check3 - - 1 0.0% ------------------------------------------------------------- �����������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.res.oracle�����������������0000666�0000000�0000000�00000002442�13571573400�025137� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-no-let -wp-timeout 45 -wp-steps 1500 [...] [kernel] Parsing tests/wp_plugin/bool.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 7 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_band_bool_false_ensures : Unsuccess [wp] [Qed] Goal typed_band_bool_true_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bor_bool_false_ensures : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bor_bool_true_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bxor_bool_false_ensures : Unsuccess [wp] [Qed] Goal typed_bxor_bool_true_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures : Unsuccess [wp] Proved goals: 3 / 7 Qed: 2 Alt-Ergo 2.0.0: 1 (unsuccess: 4) [wp] Report in: 'tests/wp_plugin/oracle_qualif/bool.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/bool.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job - - 1 0.0% bor_bool - 1 (4..16) 2 50.0% band_bool 1 - 2 50.0% bxor_bool 1 - 2 50.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024640� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025703� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/1ecbe0b41a07f6fd2241aff3258cd377.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/1ecbe0b41a07f0000666�0000000�0000000�00000000127�13571573400�027652� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0157, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/22c1313f9df2b9bda80d2bb8c4d175fc.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/22c1313f9df2b0000666�0000000�0000000�00000000127�13571573400�027521� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0145, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/4fc19b7c827e48214e31ff4f16d7a060.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/4fc19b7c827e40000666�0000000�0000000�00000000127�13571573400�027542� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0146, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/7aa1ae97b0ddd96dc9a92948a21d089d.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/7aa1ae97b0ddd0000666�0000000�0000000�00000000127�13571573400�027743� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0366, "steps": 26 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/f46d52d0100d219b44e3dd94ca164077.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.0.session/cache/f46d52d0100d20000666�0000000�0000000�00000000127�13571573400�027433� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0177, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.i.0.report.json��������������0000666�0000000�0000000�00000013137�13571573400�025617� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 1, "unknown": 4, "rank": 2 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 7, "valid": 3, "unknown": 4, "rank": 2 } }, "wp:functions": { "job": { "job_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "bor_bool": { "bor_bool_false_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bor_bool_true_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 2 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1, "rank": 2 } } }, "band_bool": { "band_bool_false_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "band_bool_true_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "bxor_bool": { "bxor_bool_false_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "bxor_bool_true_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.i.1.report.json��������������0000666�0000000�0000000�00000014275�13571573400�025624� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 6 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 7, "valid": 7, "rank": 6 } }, "wp:functions": { "job": { "job_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "bor_bool": { "bor_bool_false_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "bor_bool_true_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 3 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } } }, "band_bool": { "band_bool_false_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "band_bool_true_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } } }, "bxor_bool": { "bxor_bool_false_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "bxor_bool_true_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/bool.res.oracle�������������������0000666�0000000�0000000�00000002344�13571573400�025002� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-no-let [...] [kernel] Parsing tests/wp_plugin/bool.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 7 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_band_bool_false_ensures : Valid [wp] [Qed] Goal typed_band_bool_true_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bor_bool_false_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bor_bool_true_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bxor_bool_false_ensures : Valid [wp] [Qed] Goal typed_bxor_bool_true_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures : Valid [wp] Proved goals: 7 / 7 Qed: 2 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_plugin/oracle_qualif/bool.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/bool.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job - 1 (12..24) 1 100% bor_bool - 2 (8..20) 2 100% band_bool 1 1 (20..32) 2 100% bxor_bool 1 1 (8..20) 2 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/config.res.oracle�����������������0000666�0000000�0000000�00000000522�13571573400�025310� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������---------------------------------------------------------- WP Requirements for Qualif Tests (3) ---------------------------------------------------------- 1. The Alt-Ergo theorem prover, version 2.0.0 2. The Why3 platform, version 1.2.0 3. The Coq Proof Assistant, version 8.7.2 ---------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.0.res.oracle��������������0000666�0000000�0000000�00000001334�13571573400�025663� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/convert.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_ceil : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_floor : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_plugin/oracle_qualif/convert.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/convert.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - 2 (1..12) 2 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.0.session/����������������0000777�0000000�0000000�00000000000�13571573400�025365� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.0.session/cache/����������0000777�0000000�0000000�00000000000�13571573400�026430� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.0.session/cache/41595c57ce7e98269d53becbfeb7bcb3.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.0.session/cache/41595c57ce0000666�0000000�0000000�00000000126�13571573400�027670� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0062, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.0.session/cache/997da10e0a56b9a3ff392e4d0e7b52b7.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.0.session/cache/997da10e0a0000666�0000000�0000000�00000000126�13571573400�027736� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0087, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.1.res.oracle��������������0000666�0000000�0000000�00000002031�13571573400�025657� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/convert.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: native support for alt-ergo is deprecated, use why3 instead [wp] 2 goals scheduled [wp] [Alt-Ergo (Native)] Goal typed_lemma_ceil : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_floor : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo: 2 [wp] Report in: 'tests/wp_plugin/oracle_qualif/convert.1.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/convert.1.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - - (20..32) 2 100% ------------------------------------------------------------- ------------------------------------------------------------- Axiomatics WP Alt-Ergo (Native) Total Success Lemma - 2 (20..32) 2 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.report.json����������������0000666�0000000�0000000�00000011070�13571573400�025401� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 6, "rank": 26 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 10, "valid": 10, "rank": 26 } }, "wp:functions": { "copy": { "copy_assert_B": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 26 }, "wp:main": { "total": 1, "valid": 1, "rank": 26 } }, "copy_assert_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "copy_loop_invariant_Copy": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "copy_loop_invariant_Range": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "copy_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "copy_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 14 } }, "copy_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 6, "rank": 26 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 10, "valid": 10, "rank": 26 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024657� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025722� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/3140ad3c2c0e7f22f4a38c1cf4630073.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/3140ad3c2c0e70000666�0000000�0000000�00000000127�13571573400�027530� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0288, "steps": 24 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/5bc3c212fe4290ff88ccb5e99871fd74.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/5bc3c212fe4290000666�0000000�0000000�00000000127�13571573400�027543� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0222, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/6d5890f1993535b246213e3d240ff1fa.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/6d5890f1993530000666�0000000�0000000�00000000127�13571573400�027350� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0277, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/81cbf3977a1b360e77c61be578e71228.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/81cbf3977a1b30000666�0000000�0000000�00000000127�13571573400�027551� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0409, "steps": 35 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/9c576504d70a15b48202a701c1077cae.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/9c576504d70a10000666�0000000�0000000�00000000130�13571573400�027402� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1354, "steps": 149 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/dbd1fa1555b07e233372cbf9a102eb50.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.0.session/cache/dbd1fa1555b070000666�0000000�0000000�00000000127�13571573400�027617� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0455, "steps": 56 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.i.0.report.json��������������0000666�0000000�0000000�00000011070�13571573400�025630� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 6, "rank": 26 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 10, "valid": 10, "rank": 26 } }, "wp:functions": { "copy": { "copy_assert_B": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 26 }, "wp:main": { "total": 1, "valid": 1, "rank": 26 } }, "copy_assert_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "copy_loop_invariant_Copy": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "copy_loop_invariant_Range": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "copy_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "copy_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 14 } }, "copy_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 6, "rank": 26 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 10, "valid": 10, "rank": 26 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/copy.res.oracle�������������������0000666�0000000�0000000�00000002363�13571573400�025022� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/copy.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 10 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_copy_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_copy_loop_invariant_Copy_preserved : Valid [wp] [Qed] Goal typed_copy_loop_invariant_Copy_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_copy_loop_invariant_Range_preserved : Valid [wp] [Qed] Goal typed_copy_loop_invariant_Range_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_copy_assert_A : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_copy_assert_B : Valid [wp] [Qed] Goal typed_copy_loop_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_copy_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_copy_assigns : Valid [wp] Proved goals: 10 / 10 Qed: 4 Alt-Ergo 2.0.0: 6 [wp] Report in: 'tests/wp_plugin/oracle_qualif/copy.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/copy.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success copy 4 6 (136..160) 10 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/����������������0000777�0000000�0000000�00000000000�13571573400�025331� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/cache/����������0000777�0000000�0000000�00000000000�13571573400�026374� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/cache/8004973d77211411c9d59b27077c16c6.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/cache/8004973d770000666�0000000�0000000�00000000127�13571573400�027477� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0326, "steps": 47 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/cache/b42d5e72c9522a062a198e91751c2c9a.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/cache/b42d5e72c90000666�0000000�0000000�00000000127�13571573400�027711� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0201, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/cache/dbfcb0e8dad365619370802f774d9de9.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/cache/dbfcb0e8da0000666�0000000�0000000�00000000072�13571573400�030200� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/cache/f9a8c7c2b4e60999d63dc9182c6a31ad.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.0.session/cache/f9a8c7c2b40000666�0000000�0000000�00000000126�13571573400�027772� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0205, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.i.0.report.json�����������0000666�0000000�0000000�00000026327�13571573400�026315� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 3, "unknown": 1, "rank": 13 }, "qed": { "total": 47, "valid": 47 }, "wp:main": { "total": 51, "valid": 50, "unknown": 1, "rank": 12 } }, "wp:functions": { "call": { "f1_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 13 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "call_call_point_f1_f2_s3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "call_ensures": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 13 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 4, "rank": 12 } } }, "guarded_call": { "guarded_call_call_point_g_s9": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "guarded_call_ensures_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "guarded_call_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 5, "valid": 5, "rank": 4 } } }, "behavior": { "behavior_call_point_h1_h2_s15": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "behavior_bhv1_assigns": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } }, "behavior_bhv1_ensures": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 9, "valid": 9 } } }, "some_behaviors": { "some_behaviors_call_point_h1_h2_h0_for_bhv1_s20": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "some_behaviors_call_point_h1_h2_h0_for_bhv0_s20": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "some_behaviors_bhv1_assigns": { "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 7, "valid": 7 } }, "some_behaviors_bhv0_assigns": { "qed": { "total": 9, "valid": 9 }, "wp:main": { "total": 9, "valid": 9 } }, "some_behaviors_bhv0_ensures": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "some_behaviors_bhv1_ensures": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:section": { "qed": { "total": 24, "valid": 24 }, "wp:main": { "total": 24, "valid": 24 } } }, "missing_context": { "missing_context_call_point_h1_s25": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "missing_context_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "missing_context_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 5, "valid": 4, "unknown": 1 } } }, "no_call": { "unreachable_g_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "no_call_call_point_unreachable_g_s32": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "no_call_ensures": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/dynamic.res.oracle����������������0000666�0000000�0000000�00000011612�13571573400�025471� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/dynamic.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] tests/wp_plugin/dynamic.i:78: Warning: Missing 'calls' for default behavior [wp] Warning: Missing RTE guards [wp] 51 goals scheduled [wp] [Qed] Goal typed_behavior_call_point_h1_h2_s15 : Valid [wp] [Qed] Goal typed_behavior_bhv1_ensures_part1 : Valid [wp] [Qed] Goal typed_behavior_bhv1_ensures_part2 : Valid [wp] [Qed] Goal typed_behavior_bhv1_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_behavior_bhv1_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_behavior_bhv1_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_behavior_bhv1_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_behavior_bhv1_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_behavior_bhv1_assigns_normal_part4 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_call_call_point_f1_f2_s3 : Valid [wp] [Qed] Goal typed_call_ensures_part1 : Valid [wp] [Qed] Goal typed_call_ensures_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_call_call_f1_requires : Valid [wp] [Qed] Goal typed_guarded_call_call_point_g_s9 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_guarded_call_ensures_part1 : Valid [wp] [Qed] Goal typed_guarded_call_ensures_part2 : Valid [wp] [Qed] Goal typed_guarded_call_ensures_2_part1 : Valid [wp] [Qed] Goal typed_guarded_call_ensures_2_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_missing_context_call_point_h1_s25 : Unsuccess [wp] [Qed] Goal typed_missing_context_ensures : Valid [wp] [Qed] Goal typed_missing_context_assigns_exit : Valid [wp] [Qed] Goal typed_missing_context_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_missing_context_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_no_call_call_point_unreachable_g_s32 : Valid [wp] [Qed] Goal typed_no_call_ensures_part1 : Valid [wp] [Qed] Goal typed_no_call_ensures_part2 : Valid [wp] [Qed] Goal typed_no_call_call_unreachable_g_requires : Valid [wp] [Qed] Goal typed_some_behaviors_call_point_h1_h2_h0_for_bhv0_s20 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_ensures_part1 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_ensures_part2 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_ensures_part3 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_assigns_normal_part5 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv0_assigns_normal_part6 : Valid [wp] [Qed] Goal typed_some_behaviors_call_point_h1_h2_h0_for_bhv1_s20 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_ensures_part1 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_ensures_part2 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_ensures_part3 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assigns_normal_part5 : Valid [wp] Proved goals: 50 / 51 Qed: 47 Alt-Ergo 2.0.0: 3 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/dynamic.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/dynamic.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success call 2 2 (40..52) 4 100% guarded_call 4 1 (4..16) 5 100% behavior 9 - 9 100% some_behaviors 24 - 24 100% missing_context 4 - 5 80.0% no_call 4 - 4 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'guarded_call': /*@ behavior typed: requires \separated(&X,p); */ void guarded_call(struct S *p); [wp] Warning: Memory model hypotheses for function 'behavior': /*@ behavior typed: requires \separated(&X1,p+(..)); */ int behavior(int (*p)(void)); [wp] Warning: Memory model hypotheses for function 'some_behaviors': /*@ behavior typed: requires \separated(&X1,p+(..)); */ int some_behaviors(int (*p)(void)); [wp] Warning: Memory model hypotheses for function 'missing_context': /*@ behavior typed: requires \separated(&X1,p); */ int missing_context(int (*p)(void)); ����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/f.dot�����������������������������0000666�0000000�0000000�00000005415�13571573400�023027� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph f { rankdir = TB ; node [ style = filled, shape = box ] ; N000 [ color = red, shape = circle, label = "*" ] ; N074 [ color=red , label="Prove f_ensures" ] ; N074 -> N000 [ style=dotted ] ; N075 [ color=red , label="Prove f_ensures_2" ] ; N075 -> N074 [ style=dotted ] ; N076 [ label="" , shape=circle ] ; N076 -> N075 ; N076 -> N074 ; N077 [ color=lightblue , label="F-out { a b }" ] ; N077 -> N076 ; N078 [ label="Label wp:post" ] ; N078 -> N077 ; N079 [ color=lightblue , label="B-out { __retres }" ] ; N079 -> N078 ; N080 [ color=orange , label="Return __retres" ] ; N080 -> N079 ; N081 [ color=lightblue , label="B-out { }" ] ; N081 -> N080 ; N082 [ color=lightblue , label="B-out { }" ] ; N082 -> N081 ; N083 [ color=lightblue , label="B-out { }" ] ; N083 -> N082 ; N084 [ label="Label wp:sid27 (Stmt s27)" ] ; N084 -> N083 ; N085 [ label="Label wp:sid26 (Stmt s26)" ] ; N085 -> N084 ; N086 [ color=green , label="Assume f_assert" ] ; N086 -> N085 ; N087 [ color=red , label="Prove f_assert" ] ; N087 -> N086 [ style=dotted ] ; N088 [ label="" , shape=circle ] ; N088 -> N087 ; N088 -> N086 ; N089 [ label="Label wp:sid25 (Stmt s25)" ] ; N089 -> N088 ; N090 [ color=orange , label="__retres := a + b" ] ; N090 -> N089 ; N091 [ label="Label wp:sid6 (Stmt s6)" ] ; N091 -> N090 ; N092 [ color=lightblue , label="B-in { }" ] ; N092 -> N091 ; N093 [ label="Label wp:sid24 (Stmt s24)" ] ; N093 -> N092 ; N094 [ color=lightblue , label="B-in { }" ] ; N094 -> N093 ; N095 [ color=orange , label="Return __retres" ] ; N095 -> N079 ; N096 [ label="Label wp:sid27 (Stmt s27)" ] ; N096 -> N095 ; N097 [ color=orange , label="__retres := -1" ] ; N097 -> N096 ; N098 [ label="Label wp:sid8 (Stmt s8)" ] ; N098 -> N097 ; N099 [ color=green , label="Assume f_ensures_3" ] ; N099 -> N098 ; N100 [ color=orange , label="Havoc f_assigns: assigns __retres;" ] ; N100 -> N099 ; N101 [ color=lightblue , label="B-in { }" ] ; N101 -> N000 [ style=dotted ]; N102 [ color=lightblue , label="B-out { }" ] ; N102 -> N101 ; N103 [ color=cyan , label="If a > 0" ] ; N103 -> N094 ; N103 -> N102 ; N104 [ label="Label wp:sid4 (Stmt s4)" ] ; N104 -> N103 ; N105 [ color=lightblue , label="B-in { }" ] ; N105 -> N104 ; N106 [ label="" , shape=circle ] ; N106 -> N100 ; N106 -> N105 ; N107 [ label="Label wp:sid2 (Stmt s2)" ] ; N107 -> N106 ; N108 [ color=lightblue , label="B-in { __retres }" ] ; N108 -> N107 ; N109 [ color=lightblue , label="F-frame { a b }" ] ; N109 -> N108 ; N110 [ label="Label wp:pre" ] ; N110 -> N109 ; N111 [ color=lightblue , label="F-in { a b }" ] ; N111 -> N110 ; N112 [ color=lightblue , label="Global { }" ] ; N112 -> N111 ; N113 [ color=cyan , label="Function f" ] ; N113 -> N112 ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/f_default_for_stmt_2.dot����������0000666�0000000�0000000�00000004777�13571573400�026703� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph f { rankdir = TB ; node [ style = filled, shape = box ] ; N000 [ color = red, shape = circle, label = "*" ] ; N114 [ color=lightblue , label="F-out { a b }" ] ; N114 -> N000 [ style=dotted ]; N115 [ label="Label wp:post" ] ; N115 -> N114 ; N116 [ color=lightblue , label="B-out { __retres }" ] ; N116 -> N115 ; N117 [ color=orange , label="Return __retres" ] ; N117 -> N116 ; N118 [ color=lightblue , label="B-out { }" ] ; N118 -> N117 ; N119 [ color=lightblue , label="B-out { }" ] ; N119 -> N118 ; N120 [ color=lightblue , label="B-out { }" ] ; N120 -> N119 ; N121 [ label="Label wp:sid27 (Stmt s27)" ] ; N121 -> N120 ; N122 [ label="Label wp:sid26 (Stmt s26)" ] ; N122 -> N121 ; N123 [ color=green , label="Assume f_assert" ] ; N123 -> N122 ; N124 [ label="Label wp:sid25 (Stmt s25)" ] ; N124 -> N123 ; N125 [ color=orange , label="__retres := a + b" ] ; N125 -> N124 ; N126 [ label="Label wp:sid6 (Stmt s6)" ] ; N126 -> N125 ; N127 [ color=lightblue , label="B-in { }" ] ; N127 -> N126 ; N128 [ label="Label wp:sid24 (Stmt s24)" ] ; N128 -> N127 ; N129 [ color=lightblue , label="B-in { }" ] ; N129 -> N128 ; N130 [ color=orange , label="Return __retres" ] ; N130 -> N116 ; N131 [ label="Label wp:sid27 (Stmt s27)" ] ; N131 -> N130 ; N132 [ color=orange , label="__retres := -1" ] ; N132 -> N131 ; N133 [ label="Label wp:sid8 (Stmt s8)" ] ; N133 -> N132 ; N134 [ color=green , label="Assume f_ensures_3" ] ; N134 -> N133 ; N135 [ color=red , label="Assigns f_assigns" ] ; N136 [ label="" , shape=circle ] ; N136 -> N135 ; N136 -> N134 ; N137 [ color=red , label="Prove f_ensures_3" ] ; N137 -> N136 [ style=dotted ] ; N138 [ label="" , shape=circle ] ; N138 -> N137 ; N138 -> N136 ; N139 [ color=lightblue , label="B-in { }" ] ; N139 -> N138 ; N140 [ color=lightblue , label="B-out { }" ] ; N140 -> N139 ; N141 [ color=cyan , label="If a > 0" ] ; N141 -> N129 ; N141 -> N140 ; N142 [ label="Label wp:sid4 (Stmt s4)" ] ; N142 -> N141 ; N143 [ color=lightblue , label="B-in { }" ] ; N143 -> N142 ; N144 [ label="Label wp:sid2 (Stmt s2)" ] ; N144 -> N143 ; N145 [ color=lightblue , label="B-in { __retres }" ] ; N145 -> N144 ; N146 [ color=lightblue , label="F-frame { a b }" ] ; N146 -> N145 ; N147 [ label="Label wp:pre" ] ; N147 -> N146 ; N148 [ color=lightblue , label="F-in { a b }" ] ; N148 -> N147 ; N149 [ color=lightblue , label="Global { }" ] ; N149 -> N148 ; N150 [ color=cyan , label="Function f" ] ; N150 -> N149 ; } �frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.res.oracle����������������0000666�0000000�0000000�00000002054�13571573400�025300� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 1 [...] [kernel] Parsing tests/wp_plugin/flash.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Qed] Goal typed_job_ensures_Events : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_A_reads : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_B_reads : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_B_writes : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_ReadValues : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_WriteValues : Unsuccess [wp] Proved goals: 1 / 6 Qed: 1 Alt-Ergo 2.0.0: 0 (unsuccess: 5) [wp] Report in: 'tests/wp_plugin/oracle_qualif/flash.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/flash.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 1 - 6 16.7% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�025002� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026045� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/1698f6d176f78548e841b5696d79f026.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/1698f6d176f70000666�0000000�0000000�00000000106�13571573400�027467� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/64c8e35016a398a56f0882104d837eaa.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/64c8e35016a30000666�0000000�0000000�00000000106�13571573400�027441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/ab0c36ef916b4a78d99270e7c4d27723.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/ab0c36ef916b0000666�0000000�0000000�00000000106�13571573400�027660� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/caccd9276079faaf886ed8d3279e4728.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/caccd92760790000666�0000000�0000000�00000000106�13571573400�027612� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/dbda47b47c29a1b3c4192f4c68c94771.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.0.session/cache/dbda47b47c290000666�0000000�0000000�00000000106�13571573400�027665� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.res.oracle����������������0000666�0000000�0000000�00000002267�13571573400�025307� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/flash.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] tests/wp_plugin/flash-ergo.driver:2: Warning: Redefinition of logic INDEX_init [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Qed] Goal typed_flash_flash-ergo_job_ensures_Events : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_flash_flash-ergo_job_ensures_A_reads : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_flash_flash-ergo_job_ensures_B_reads : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_flash_flash-ergo_job_ensures_B_writes : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_flash_flash-ergo_job_ensures_ReadValues : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_flash_flash-ergo_job_ensures_WriteValues : Valid [wp] Proved goals: 6 / 6 Qed: 1 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_plugin/oracle_qualif/flash.1.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/flash.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 1 5 (32..44) 6 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/������������������0000777�0000000�0000000�00000000000�13571573400�025003� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026046� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/26805f260519bc357ddfbab77162336d.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/26805f2605190000666�0000000�0000000�00000000127�13571573400�027312� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0346, "steps": 34 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/78930ca891a9430a1c4a252f99dae940.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/78930ca891a90000666�0000000�0000000�00000000127�13571573400�027463� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0357, "steps": 37 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/80325efaf7a8086892d0eca4f9c22550.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/80325efaf7a80000666�0000000�0000000�00000000127�13571573400�027614� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0362, "steps": 34 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/c8c1639da21238ff80c3f5a92311bf03.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/c8c1639da2120000666�0000000�0000000�00000000127�13571573400�027523� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0321, "steps": 39 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/fee62065a13cef000396b31ff5ca19d5.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.session/cache/fee62065a13c0000666�0000000�0000000�00000000126�13571573400�027602� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.038, "steps": 34 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.2.res.oracle����������������0000666�0000000�0000000�00000001715�13571573400�025305� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/flash.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Qed] Goal typed_flash_job_ensures_Events : Valid [wp] [Qed] Goal typed_flash_job_ensures_A_reads : Valid [wp] [Qed] Goal typed_flash_job_ensures_B_reads : Valid [wp] [Qed] Goal typed_flash_job_ensures_B_writes : Valid [wp] [Qed] Goal typed_flash_job_ensures_ReadValues : Valid [wp] [Qed] Goal typed_flash_job_ensures_WriteValues : Valid [wp] Proved goals: 6 / 6 Qed: 6 [wp] Report in: 'tests/wp_plugin/oracle_qualif/flash.2.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/flash.2.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 6 - 6 100% ------------------------------------------------------------- ���������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.c.0.report.json�������������0000666�0000000�0000000�00000005745�13571573400�025761� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "unknown": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 1, "unknown": 5 } }, "wp:functions": { "job": { "job_ensures_WriteValues": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "job_ensures_ReadValues": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "job_ensures_B_writes": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "job_ensures_B_reads": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "job_ensures_A_reads": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "job_ensures_Events": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "unknown": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 1, "unknown": 5 } } } } } ���������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.c.1.report.json�������������0000666�0000000�0000000�00000007405�13571573400�025755� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 9 } }, "wp:functions": { "job": { "job_ensures_WriteValues": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "job_ensures_ReadValues": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "job_ensures_B_writes": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "job_ensures_B_reads": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "job_ensures_A_reads": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "job_ensures_Events": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 9 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.c.2.report.json�������������0000666�0000000�0000000�00000004463�13571573400�025757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } }, "wp:functions": { "job": { "job_ensures_WriteValues": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_ReadValues": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_B_writes": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_B_reads": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_A_reads": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_Events": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.0.res.oracle���������0000666�0000000�0000000�00000002116�13571573400�026657� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/float_format.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_plugin/float_format.i:10: Warning: Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: native support for coq is deprecated, use tip instead [wp] 1 goal scheduled [wp] [Coq] Goal typed_output_ensures_KO : Default tactic [wp] [Coq (Native)] Goal typed_output_ensures_KO : Unsuccess [wp] Proved goals: 0 / 1 Coq: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/float_format.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/float_format.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success output - - 1 0.0% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.1.res.oracle���������0000666�0000000�0000000�00000002073�13571573400�026662� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 1 -wp-steps 50 [...] [kernel] Parsing tests/wp_plugin/float_format.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_plugin/float_format.i:10: Warning: Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: native support for alt-ergo is deprecated, use why3 instead [wp] 1 goal scheduled [wp] [Alt-Ergo (Native)] Goal typed_output_ensures_KO : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/float_format.1.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/float_format.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success output - - 1 0.0% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.1.session/�����������0000777�0000000�0000000�00000000000�13571573400�026363� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.1.session/cache/�����0000777�0000000�0000000�00000000000�13571573400�027426� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.1.session/cache/5f7ed05c194dba2e5f64e0c2e288f317.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.1.session/cache/5f7ed0000666�0000000�0000000�00000000107�13571573400�030261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.2.res.oracle���������0000666�0000000�0000000�00000001760�13571573400�026665� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 1 -wp-steps 50 [...] [kernel] Parsing tests/wp_plugin/float_format.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_plugin/float_format.i:10: Warning: Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_output_ensures_KO : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/float_format.2.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/float_format.2.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success output - - 1 0.0% ------------------------------------------------------------- ����������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.2.session/�����������0000777�0000000�0000000�00000000000�13571573400�026364� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.2.session/cache/�����0000777�0000000�0000000�00000000000�13571573400�027427� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.2.session/cache/5f7ed05c194dba2e5f64e0c2e288f317.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.2.session/cache/5f7ed0000666�0000000�0000000�00000000106�13571573400�030261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 1. } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.i.0.report.json������0000666�0000000�0000000�00000001337�13571573400�027340� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "coq": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "output": { "output_ensures_KO": { "coq": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "coq": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.i.1.report.json������0000666�0000000�0000000�00000001562�13571573400�027341� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "output": { "output_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.i.2.report.json������0000666�0000000�0000000�00000001562�13571573400�027342� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "output": { "output_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.0.res.oracle�����������0000666�0000000�0000000�00000001756�13571573400�026323� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Real)' [...] [kernel] Parsing tests/wp_plugin/float_real.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_plugin/float_real.i:19: Warning: Floating-point constant 1e-5 is not represented exactly. Will use 0x1.4f8b588e368f1p-17. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_real_dequal_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/float_real.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/float_real.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success dequal - 1 (20..32) 1 100% ------------------------------------------------------------- ������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026015� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027060� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.0.session/cache/005069532f5e111f1f882ee47ecb2236.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.0.session/cache/00506950000666�0000000�0000000�00000000127�13571573400�027633� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0186, "steps": 25 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.1.res.oracle�����������0000666�0000000�0000000�00000001736�13571573400�026322� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed' [...] [kernel] Parsing tests/wp_plugin/float_real.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_plugin/float_real.i:19: Warning: Floating-point constant 1e-5 is not represented exactly. Will use 0x1.4f8b588e368f1p-17. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_dequal_ensures : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/float_real.1.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/float_real.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success dequal - - 1 0.0% ------------------------------------------------------------- ����������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.1.session/�������������0000777�0000000�0000000�00000000000�13571573400�026016� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.1.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027061� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.1.session/cache/bd9564689062a5d819d3ecdcd86f1a1a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.1.session/cache/bd956460000666�0000000�0000000�00000000107�13571573400�030005� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.i.0.report.json��������0000666�0000000�0000000�00000002117�13571573400�026770� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "wp:functions": { "dequal": { "dequal_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_real.i.1.report.json��������0000666�0000000�0000000�00000001543�13571573400�026773� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "dequal": { "dequal_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.0.report.json���������������0000666�0000000�0000000�00000010407�13571573400�025524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "unknown": 4 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 6, "valid": 2, "unknown": 4 } }, "wp:functions": { "local": { "local_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "local_ensures_FRAMED": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "global": { "global_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "localref": { "localref_assert_FRAMED": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "localref_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "alias": { "alias_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�024777� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026042� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.0.session/cache/2d6105cda5f37243a24f7a2895f11ae9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.0.session/cache/2d6105cda5f30000666�0000000�0000000�00000000107�13571573400�027572� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.0.session/cache/985d0f98114267e42ecf4062e9da25ee.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.0.session/cache/985d0f9811420000666�0000000�0000000�00000000107�13571573400�027373� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.0.session/cache/cf9f0c2706019f16f1733c8811811eac.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.0.session/cache/cf9f0c2706010000666�0000000�0000000�00000000107�13571573400�027515� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.i.0.report.json�������������0000666�0000000�0000000�00000007731�13571573400�025761� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 4, "unknown": 4 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 6, "valid": 2, "unknown": 4 } }, "wp:functions": { "local": { "local_ensures_KO": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "local_ensures_FRAMED": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "global": { "global_ensures_KO": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "localref": { "localref_assert_FRAMED": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "localref_ensures_KO": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } }, "alias": { "alias_ensures_KO": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ���������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/frame.res.oracle������������������0000666�0000000�0000000�00000002260�13571573400�025136� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/frame.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_alias_ensures_KO : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_global_ensures_KO : Unsuccess [wp] [Qed] Goal typed_local_ensures_FRAMED : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_local_ensures_KO : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_localref_ensures_KO : Unsuccess [wp] [Qed] Goal typed_localref_assert_FRAMED : Valid [wp] Proved goals: 2 / 6 Qed: 2 Alt-Ergo 2.0.0: 0 (unsuccess: 4) [wp] Report in: 'tests/wp_plugin/oracle_qualif/frame.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/frame.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success local 1 - 2 50.0% global - - 1 0.0% localref 1 - 2 50.0% alias - - 1 0.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/g.dot�����������������������������0000666�0000000�0000000�00000003372�13571573400�023030� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph g { rankdir = TB ; node [ style = filled, shape = box ] ; N000 [ color = red, shape = circle, label = "*" ] ; N049 [ color=red , label="Prove g_ensures_2" ] ; N049 -> N000 [ style=dotted ] ; N050 [ color=lightblue , label="F-out { a b }" ] ; N050 -> N049 ; N051 [ label="Label wp:post" ] ; N051 -> N050 ; N052 [ color=lightblue , label="B-out { __retres }" ] ; N052 -> N051 ; N053 [ color=orange , label="Return __retres" ] ; N053 -> N052 ; N054 [ color=lightblue , label="B-out { }" ] ; N054 -> N053 ; N055 [ color=lightblue , label="B-out { }" ] ; N055 -> N054 ; N056 [ label="Label wp:sid32 (Stmt s32)" ] ; N056 -> N055 ; N057 [ label="Label wp:sid31 (Stmt s31)" ] ; N057 -> N056 ; N058 [ color=green , label="Assume g_assert" ] ; N058 -> N057 ; N059 [ color=red , label="Prove g_assert" ] ; N059 -> N058 [ style=dotted ] ; N060 [ label="" , shape=circle ] ; N060 -> N059 ; N060 -> N058 ; N061 [ label="Label wp:sid30 (Stmt s30)" ] ; N061 -> N060 ; N062 [ color=orange , label="__retres := a + b" ] ; N062 -> N061 ; N063 [ label="Label wp:sid13 (Stmt s13)" ] ; N063 -> N062 ; N064 [ color=lightblue , label="B-in { }" ] ; N064 -> N063 ; N065 [ label="Label wp:sid29 (Stmt s29)" ] ; N065 -> N064 ; N066 [ color=lightblue , label="B-in { }" ] ; N066 -> N065 ; N067 [ label="Label wp:sid11 (Stmt s11)" ] ; N067 -> N066 ; N068 [ color=lightblue , label="B-in { __retres }" ] ; N068 -> N067 ; N069 [ color=lightblue , label="F-frame { a b }" ] ; N069 -> N068 ; N070 [ label="Label wp:pre" ] ; N070 -> N069 ; N071 [ color=lightblue , label="F-in { a b }" ] ; N071 -> N070 ; N072 [ color=lightblue , label="Global { }" ] ; N072 -> N071 ; N073 [ color=cyan , label="Function g" ] ; N073 -> N072 ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/g_default_for_stmt_11.dot���������0000666�0000000�0000000�00000000176�13571573400�026751� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph g { rankdir = TB ; node [ style = filled, shape = box ] ; N000 [ color = red, shape = circle, label = "*" ] ; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/ground_real.0.report.json���������0000666�0000000�0000000�00000001722�13571573400�026733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "wp:axiomatics": { "": { "lemma_R": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } } } } } ����������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/ground_real.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026206� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/ground_real.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027251� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/ground_real.0.session/cache/b9ba36e18d95628c4dc26e47bdf41a0a.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/ground_real.0.session/cache/b9ba360000666�0000000�0000000�00000000126�13571573400�030161� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0063, "steps": 3 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/ground_real.i.0.report.json�������0000666�0000000�0000000�00000001517�13571573400�027164� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "wp:axiomatics": { "": { "lemma_R": { "alt-ergo": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 0 }, "wp:main": { "total": 1, "valid": 1, "rank": 0 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/ground_real.res.oracle������������0000666�0000000�0000000�00000001257�13571573400�026352� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/ground_real.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_R : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/ground_real.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/ground_real.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - 1 (1..8) 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/inductive.c.0.report.json���������0000666�0000000�0000000�00000001665�13571573400�026653� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "coq": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:axiomatics": { "": { "lemma_test": { "coq": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "lemma_offset": { "coq": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "coq": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } ���������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/inductive.res.oracle��������������0000666�0000000�0000000�00000001623�13571573400�026040� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 240 [...] [kernel] Parsing tests/wp_plugin/inductive.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: native support for coq is deprecated, use tip instead [wp] 2 goals scheduled [wp] [Coq] Goal typed_lemma_offset : Saved script [wp] [Coq (Native)] Goal typed_lemma_offset : Valid [wp] [Coq] Goal typed_lemma_test : Saved script [wp] [Coq (Native)] Goal typed_lemma_test : Valid [wp] Proved goals: 2 / 2 Qed: 0 Coq: 2 [wp] Report in: 'tests/wp_plugin/oracle_qualif/inductive.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/inductive.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - - 2 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026056� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027121� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const.0.session/cache/03322f9510d2676e91ad7ae2340e23ef.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const.0.session/cache/03322f90000666�0000000�0000000�00000000107�13571573400�027752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const.0.session/cache/0919645d26a767a053dbbd305257f300.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const.0.session/cache/09196450000666�0000000�0000000�00000000107�13571573400�027703� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const.i.0.report.json��������0000666�0000000�0000000�00000004605�13571573400�027035� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 2, "unknown": 2 } }, "wp:functions": { "fA": { "fA_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "fB": { "fB_ensures_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "fC": { "fC_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "fD": { "fD_ensures_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const.res.oracle�������������0000666�0000000�0000000�00000002051�13571573400�026213� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/init_const.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_fA_ensures_KO : Unsuccess [wp] [Qed] Goal typed_fB_ensures_OK : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_fC_ensures_KO : Unsuccess [wp] [Qed] Goal typed_fD_ensures_OK : Valid [wp] Proved goals: 2 / 4 Qed: 2 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_plugin/oracle_qualif/init_const.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/init_const.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success fA - - 1 0.0% fB 1 - 1 100% fC - - 1 0.0% fD 1 - 1 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.0.session/�������0000777�0000000�0000000�00000000000�13571573400�027240� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.0.session/cache/�0000777�0000000�0000000�00000000000�13571573400�030303� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.0.session/cache/1ad47165aab381beb89b339b538b35c9.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.0.session/cache/10000666�0000000�0000000�00000000127�13571573400�030366� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0203, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.0.session/cache/336ea90cae3def59085db6b73febe669.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.0.session/cache/30000666�0000000�0000000�00000000072�13571573400�030367� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.0.session/cache/81d910177d09bd437f5605c7e08689ba.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.0.session/cache/80000666�0000000�0000000�00000000127�13571573400�030375� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0217, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.i.0.report.json��0000666�0000000�0000000�00000010117�13571573400�030212� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 2, "unknown": 1, "rank": 5 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 7, "valid": 6, "unknown": 1, "rank": 5 } }, "wp:functions": { "f": { "f_ensures_Q_NotWrite": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Q_ReadOnly": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_Pointed_Valid": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "f_ensures_Const": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 4 } } }, "g": { "g_assert_Guard_against_Const": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "g_assert_Read": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "g_ensures_P_not_Const": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1, "rank": 5 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_const_guard.res.oracle�������0000666�0000000�0000000�00000002203�13571573400�027374� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/init_const_guard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 7 goals scheduled [wp] [Qed] Goal typed_f_ensures_Const : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_Pointed_Valid : Valid [wp] [Qed] Goal typed_f_ensures_Q_ReadOnly : Valid [wp] [Qed] Goal typed_f_ensures_Q_NotWrite : Valid [wp] [Qed] Goal typed_g_ensures_P_not_Const : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_g_assert_Read : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_g_assert_Guard_against_Const : Unsuccess [wp] Proved goals: 6 / 7 Qed: 4 Alt-Ergo 2.0.0: 2 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/init_const_guard.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/init_const_guard.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 3 1 (12..24) 4 100% g 1 1 (16..28) 3 66.7% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_extern.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026235� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_extern.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027300� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_extern.0.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_extern.0.session/cache/2d7c060000666�0000000�0000000�00000000072�13571573400�030127� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_extern.0.session/cache/9f69b51c20bff6d78ba77de6d29573a4.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_extern.0.session/cache/9f69b50000666�0000000�0000000�00000000107�13571573400�030145� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_extern.i.0.report.json�������0000666�0000000�0000000�00000003005�13571573400�027205� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } }, "wp:functions": { "f": { "f_ensures_KO_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_ensures_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_extern.res.oracle������������0000666�0000000�0000000�00000001623�13571573400�026376� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/init_extern.i (no preprocessing) [kernel] Parsing tests/wp_plugin/init_linker.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_f_ensures_OK : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_KO : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_KO_2 : Unsuccess [wp] Proved goals: 1 / 3 Qed: 1 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_plugin/oracle_qualif/init_extern.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/init_extern.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 1 - 3 33.3% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_valid.0.report.json����������0000666�0000000�0000000�00000004533�13571573400�026557� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 3, "unknown": 1 } }, "wp:functions": { "validA": { "validA_assert_OK_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "validA_assert_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "validB": { "validB_assert_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "validB_assert_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_valid.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026027� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_valid.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027072� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_valid.0.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_valid.0.session/cache/2d7c0670000666�0000000�0000000�00000000072�13571573400�030010� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_valid.i.0.report.json��������0000666�0000000�0000000�00000004342�13571573400�027004� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 3, "unknown": 1 } }, "wp:functions": { "validA": { "validA_assert_OK_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "validA_assert_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "validB": { "validB_assert_KO": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "validB_assert_OK": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/init_valid.res.oracle�������������0000666�0000000�0000000�00000001664�13571573400�026175� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/init_valid.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Qed] Goal typed_validA_assert_OK : Valid [wp] [Qed] Goal typed_validA_assert_OK_2 : Valid [wp] [Qed] Goal typed_validB_assert_OK : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_validB_assert_KO : Unsuccess [wp] Proved goals: 3 / 4 Qed: 3 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/init_valid.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/init_valid.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success validA 2 - 2 100% validB 1 - 2 50.0% ------------------------------------------------------------- ����������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/initarr.0.session/����������������0000777�0000000�0000000�00000000000�13571573400�025355� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/initarr.0.session/cache/����������0000777�0000000�0000000�00000000000�13571573400�026420� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/initarr.0.session/cache/0db5b2bd93ab415281ca907407740c69.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/initarr.0.session/cache/0db5b2bd930000666�0000000�0000000�00000000127�13571573400�030003� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0231, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/initarr.0.session/cache/ccc85e53f5794ab230694892164f63b9.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/initarr.0.session/cache/ccc85e53f50000666�0000000�0000000�00000000127�13571573400�030020� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0263, "steps": 34 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/initarr.i.0.report.json�����������0000666�0000000�0000000�00000002737�13571573400�026340� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 8 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "wp:functions": { "job": { "job_ensures_ALT": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "job_ensures_SEP": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 8 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } } } } } ���������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/initarr.res.oracle����������������0000666�0000000�0000000�00000001406�13571573400�025515� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/initarr.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_SEP : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_ensures_ALT : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_plugin/oracle_qualif/initarr.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/initarr.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job - 2 (28..40) 2 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.0.res.oracle�������������0000666�0000000�0000000�00000002527�13571573400�026025� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/injector.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 13 goals scheduled [wp] [Qed] Goal typed_f_call_g_requires : Valid [wp] [Qed] Goal typed_f_call_g_2_requires : Valid [wp] [Qed] Goal typed_f_FST_FAIL_ensures_qed_ok : Valid [wp] [Qed] Goal typed_f_FST_FAIL_ensures_qed_ok_2 : Valid [wp] [Qed] Goal typed_f_FST_FAIL_ensures_qed_ok_3 : Valid [wp] [Qed] Goal typed_f_SND_FAIL_ensures_qed_ok : Valid [wp] [Qed] Goal typed_f_SND_FAIL_ensures_qed_ok_2 : Valid [wp] [Qed] Goal typed_f_SND_FAIL_ensures_qed_ok_3 : Valid [wp] [Qed] Goal typed_f_SND_FAIL_ensures_qed_ok_4 : Valid [wp] [Qed] Goal typed_f_SUCCESS_ensures_qed_ok : Valid [wp] [Qed] Goal typed_f_SUCCESS_ensures_qed_ok_2 : Valid [wp] [Qed] Goal typed_f_SUCCESS_ensures_qed_ok_3 : Valid [wp] [Qed] Goal typed_f_SUCCESS_ensures_qed_ok_4 : Valid [wp] Proved goals: 13 / 13 Qed: 13 [wp] Report in: 'tests/wp_plugin/oracle_qualif/injector.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/injector.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 13 - 13 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.1.res.oracle�������������0000666�0000000�0000000�00000001654�13571573400�026026� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_plugin/injector.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ko_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f_ko_1_ensures_qed_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f_ko_1_ensures_qed_ko_2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f_ko_1_ensures_qed_ko_3 : Unsuccess [wp] Proved goals: 0 / 4 Alt-Ergo 2.0.0: 0 (unsuccess: 4) [wp] Report in: 'tests/wp_plugin/oracle_qualif/injector.1.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/injector.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 4 0.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.1.session/���������������0000777�0000000�0000000�00000000000�13571573400�025523� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.1.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026566� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.1.session/cache/22902ca7289610fdec09e1a4a8161028.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.1.session/cache/22902ca720000666�0000000�0000000�00000000107�13571573400�027642� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.1.session/cache/bb05ba082c84bad439158a8650b204b5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.1.session/cache/bb05ba0820000666�0000000�0000000�00000000072�13571573400�027775� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.1.session/cache/f8c939f0e411b5d911aec8b560c65159.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.1.session/cache/f8c939f0e0000666�0000000�0000000�00000000107�13571573400�030027� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.c.0.report.json����������0000666�0000000�0000000�00000011745�13571573400�026476� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 13, "valid": 13 }, "wp:main": { "total": 13, "valid": 13 } }, "wp:functions": { "f": { "g_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_SUCCESS_ensures_qed_ok_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_SUCCESS_ensures_qed_ok_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_SUCCESS_ensures_qed_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_SUCCESS_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_SND_FAIL_ensures_qed_ok_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_SND_FAIL_ensures_qed_ok_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_SND_FAIL_ensures_qed_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_SND_FAIL_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_FST_FAIL_ensures_qed_ok_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_FST_FAIL_ensures_qed_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_FST_FAIL_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 13, "valid": 13 }, "wp:main": { "total": 13, "valid": 13 } } } } } ���������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/injector.c.1.report.json����������0000666�0000000�0000000�00000003711�13571573400�026471� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "unknown": 4 }, "wp:main": { "total": 4, "unknown": 4 } }, "wp:functions": { "f": { "f_ko_1_ensures_qed_ko_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_ko_1_ensures_qed_ko_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_ko_1_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_ko_ensures_qed_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 4, "unknown": 4 }, "wp:main": { "total": 4, "unknown": 4 } } } } } �������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024656� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025721� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/399ec703f06dad6957a965ed8c343ca0.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/399ec703f06da0000666�0000000�0000000�00000000127�13571573400�027553� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0237, "steps": 32 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/40b122f0e00fce362b3986a91de91687.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/40b122f0e00fc0000666�0000000�0000000�00000000127�13571573400�027522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0316, "steps": 70 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/63650a5c524f80133df6ee0a87081cef.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/63650a5c524f80000666�0000000�0000000�00000000127�13571573400�027411� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0181, "steps": 29 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/680b47de429711710f8e789107aba188.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/680b47de429710000666�0000000�0000000�00000000127�13571573400�027416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0148, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/c22b2b7de2cf2f354d9edafa47d34589.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/c22b2b7de2cf20000666�0000000�0000000�00000000107�13571573400�027673� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/d82134accee9fa37acc671a4193d9c28.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.0.session/cache/d82134accee9f0000666�0000000�0000000�00000000127�13571573400�027711� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0129, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.i.0.report.json��������������0000666�0000000�0000000�00000007703�13571573400�025637� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 5, "unknown": 1, "rank": 16 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 9, "valid": 8, "unknown": 1, "rank": 16 } }, "wp:functions": { "init": { "init_loop_invariant_qed_ok_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 9 } }, "init_loop_invariant_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "init_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "init_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 16 } }, "init_ensures_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 5, "unknown": 1, "rank": 16 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 9, "valid": 8, "unknown": 1, "rank": 16 } } } } } �������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loop.res.oracle�������������������0000666�0000000�0000000�00000002364�13571573400�025022� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/loop.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 9 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_init_ensures_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_qed_ok_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_qed_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_qed_ok_2_preserved : Valid [wp] [Qed] Goal typed_init_loop_invariant_qed_ok_2_established : Valid [wp] [Qed] Goal typed_init_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_init_loop_assigns_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_assigns_part3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_assigns : Unsuccess [wp] Proved goals: 8 / 9 Qed: 3 Alt-Ergo 2.0.0: 5 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/loop.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/loop.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success init 3 5 (56..80) 9 88.9% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loopcurrent.0.report.json���������0000666�0000000�0000000�00000001641�13571573400�027006� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "wp:functions": { "f": { "f_loop_invariant_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "f_loop_invariant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } } } } �����������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loopcurrent.i.0.report.json�������0000666�0000000�0000000�00000001641�13571573400�027235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "wp:functions": { "f": { "f_loop_invariant_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "f_loop_invariant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } } } } �����������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loopcurrent.res.oracle������������0000666�0000000�0000000�00000001733�13571573400�026424� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/loopcurrent.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/loopcurrent.i:12: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 4 goals scheduled [wp] [Qed] Goal typed_f_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_f_loop_invariant_established : Valid [wp] [Qed] Goal typed_f_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_f_loop_invariant_2_established : Valid [wp] Proved goals: 4 / 4 Qed: 4 [wp] Report in: 'tests/wp_plugin/oracle_qualif/loopcurrent.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/loopcurrent.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 4 - 4 100% ------------------------------------------------------------- �������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loopentry.0.report.json�����������0000666�0000000�0000000�00000001641�13571573400�026465� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "wp:functions": { "f": { "f_loop_invariant_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "f_loop_invariant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } } } } �����������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loopentry.i.0.report.json���������0000666�0000000�0000000�00000001641�13571573400�026714� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "wp:functions": { "f": { "f_loop_invariant_2": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "f_loop_invariant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } } } } �����������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loopentry.res.oracle��������������0000666�0000000�0000000�00000001723�13571573400�026102� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/loopentry.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/loopentry.i:12: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 4 goals scheduled [wp] [Qed] Goal typed_f_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_f_loop_invariant_established : Valid [wp] [Qed] Goal typed_f_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_f_loop_invariant_2_established : Valid [wp] Proved goals: 4 / 4 Qed: 4 [wp] Report in: 'tests/wp_plugin/oracle_qualif/loopentry.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/loopentry.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 4 - 4 100% ------------------------------------------------------------- ���������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loopextra.0.report.json�����������0000666�0000000�0000000�00000001725�13571573400�026452� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:functions": { "f": { "f_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } �������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loopextra.i.0.report.json���������0000666�0000000�0000000�00000001725�13571573400�026701� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:functions": { "f": { "f_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } �������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/loopextra.res.oracle��������������0000666�0000000�0000000�00000001705�13571573400�026064� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/loopextra.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/loopextra.i:6: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp_plugin/loopextra.i:3: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 3 goals scheduled [wp] [Qed] Goal typed_f_assert : Valid [wp] [Qed] Goal typed_f_assert_2 : Valid [wp] [Qed] Goal typed_f_assert_3 : Valid [wp] Proved goals: 3 / 3 Qed: 3 [wp] Report in: 'tests/wp_plugin/oracle_qualif/loopextra.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/loopextra.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 3 - 3 100% ------------------------------------------------------------- �����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/mask.0.report.json����������������0000666�0000000�0000000�00000002033�13571573400�025361� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:functions": { "compute": { "compute_ensures_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "compute_ensures_A": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/mask.i.0.report.json��������������0000666�0000000�0000000�00000002033�13571573400�025610� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:functions": { "compute": { "compute_ensures_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "compute_ensures_A": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/mask.res.oracle�������������������0000666�0000000�0000000�00000001321�13571573400�024774� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/mask.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_compute_ensures_A : Valid [wp] [Qed] Goal typed_compute_ensures_B : Valid [wp] Proved goals: 2 / 2 Qed: 2 [wp] Report in: 'tests/wp_plugin/oracle_qualif/mask.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/mask.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success compute 2 - 2 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.res.oracle�����������������0000666�0000000�0000000�00000005012�13571573400�025131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 100 -wp-steps 1500 [...] [kernel] Parsing tests/wp_plugin/math.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 30 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_abs_neg : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_abs_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_atan_sin_cos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_cosh_opp : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_distance : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_exp_log_add_mul : Valid [wp] [Qed] Goal typed_lemma_exp_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_log_exp_mul_add : Valid [wp] [Qed] Goal typed_lemma_max_ac : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_max_inf : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_max_or : Valid [wp] [Qed] Goal typed_lemma_min_ac : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_min_inf : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_min_or : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_pow_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_sinh_opp : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_sqrt_mono : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_sqrt_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_tanh_opp : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ok_ensures_sin_asin : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ok_ensures_sin_asin_in_range : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ok_ensures_cos_acos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ok_ensures_cos_acos_in_range : Valid [wp] [Qed] Goal typed_ok_ensures_tan_atan : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ok_ensures_log_pow : Valid [wp] [Qed] Goal typed_ok_ensures_log_exp : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ok_ensures_exp_log : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ok_ensures_min_plus_distrib : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ok_ensures_sqrt_pos : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ok_ensures_sqrt_pos0 : Valid [wp] Proved goals: 30 / 30 Qed: 5 Alt-Ergo 2.0.0: 25 [wp] Report in: 'tests/wp_plugin/oracle_qualif/math.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/math.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma 3 16 (104..128) 19 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success ok 2 9 (88..112) 11 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024636� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025701� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/213b42a122d2ddf0d68abd0132ffa198.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/213b42a122d2d0000666�0000000�0000000�00000000127�13571573400�027421� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0174, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/216283795b958a5995693f6b04391255.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/216283795b9580000666�0000000�0000000�00000000127�13571573400�027246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0266, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/2bb9f22d5936cad4dafccff30f05d502.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/2bb9f22d5936c0000666�0000000�0000000�00000000127�13571573400�027532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0167, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/2d32ce8d5323849bb1cd1ea322b03fc6.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/2d32ce8d532380000666�0000000�0000000�00000000127�13571573400�027447� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0159, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/4eca6dd59584171a069c267a778ee47a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/4eca6dd5958410000666�0000000�0000000�00000000125�13571573400�027534� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.012, "steps": 8 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/5242bd61a48707f0dbeba4f38867c9f2.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/5242bd61a48700000666�0000000�0000000�00000000127�13571573400�027361� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0129, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/608785a9f24131b1483d79ac5364abfd.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/608785a9f24130000666�0000000�0000000�00000000127�13571573400�027317� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.043, "steps": 102 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/74c3e8d21260f1b900a321bdcbb800a0.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/74c3e8d21260f0000666�0000000�0000000�00000000127�13571573400�027446� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0148, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/88292638416b99243a8f32021f03109a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/88292638416b90000666�0000000�0000000�00000000127�13571573400�027247� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0226, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/953c0fa2728747865ab3cc4a8c6e542b.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/953c0fa2728740000666�0000000�0000000�00000000130�13571573400�027366� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0299, "steps": 102 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/9f5e2e6c71421110e2f65d8ed414c02e.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/9f5e2e6c714210000666�0000000�0000000�00000000130�13571573400�027445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0961, "steps": 112 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/a6000acb106889adb2406b9b4fe1d766.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/a6000acb106880000666�0000000�0000000�00000000127�13571573400�027427� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0111, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/be015da8ea402327f26ad277f16105be.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/be015da8ea4020000666�0000000�0000000�00000000127�13571573400�027571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0146, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/c2279ab65c88304c7da4f176ab90104a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/c2279ab65c8830000666�0000000�0000000�00000000127�13571573400�027456� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0159, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/cbb21de6be103d1c306d22fb5bcd151a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/cbb21de6be1030000666�0000000�0000000�00000000127�13571573400�027647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0226, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/cdd33c50e974deac92d7a61b7ef1b147.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/cdd33c50e974d0000666�0000000�0000000�00000000127�13571573400�027611� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0149, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/d19c016bf41554f2de4951c95fbeccd3.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/d19c016bf41550000666�0000000�0000000�00000000126�13571573400�027441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0091, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/d1d4887b46a0420ab75cc8918df27bab.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/d1d4887b46a040000666�0000000�0000000�00000000126�13571573400�027447� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0088, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/d21f257b332e78cc8f8cda8295a42bb6.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/d21f257b332e70000666�0000000�0000000�00000000126�13571573400�027443� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0082, "steps": 8 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/d7f2dfb78ccb8b374e7c31f3e400a87c.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/d7f2dfb78ccb80000666�0000000�0000000�00000000126�13571573400�027760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0102, "steps": 8 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/db7197273e4c9b70483c4b824b63758d.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/db7197273e4c90000666�0000000�0000000�00000000127�13571573400�027462� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0138, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/dc243cd01c34785cb9be1e4789152362.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/dc243cd01c3470000666�0000000�0000000�00000000127�13571573400�027514� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0172, "steps": 24 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/dcbbd5701a2bead6112fe6ba82e3b416.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/dcbbd5701a2be0000666�0000000�0000000�00000000127�13571573400�027731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0303, "steps": 28 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/df09915b27230dac460c7ec419a242c8.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/df09915b272300000666�0000000�0000000�00000000127�13571573400�027365� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0112, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/e1b094cde27b35f3f652d8dbb0006d05.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.0.session/cache/e1b094cde27b30000666�0000000�0000000�00000000127�13571573400�027602� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0285, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.1.res.oracle�����������������0000666�0000000�0000000�00000006077�13571573400�025146� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 100 -wp-steps 1500 [...] [kernel] Parsing tests/wp_plugin/math.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: native support for alt-ergo is deprecated, use why3 instead [wp] 30 goals scheduled [wp] [Alt-Ergo (Native)] Goal typed_lemma_abs_neg : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_abs_pos : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_atan_sin_cos : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_cosh_opp : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_distance : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_exp_log_add_mul : Valid [wp] [Qed] Goal typed_lemma_exp_pos : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_log_exp_mul_add : Valid [wp] [Qed] Goal typed_lemma_max_ac : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_max_inf : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_max_or : Valid [wp] [Qed] Goal typed_lemma_min_ac : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_min_inf : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_min_or : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_pow_2 : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_sinh_opp : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_sqrt_mono : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_sqrt_pos : Valid [wp] [Alt-Ergo (Native)] Goal typed_lemma_tanh_opp : Valid [wp] [Alt-Ergo (Native)] Goal typed_ok_ensures_sin_asin : Valid [wp] [Alt-Ergo (Native)] Goal typed_ok_ensures_sin_asin_in_range : Valid [wp] [Alt-Ergo (Native)] Goal typed_ok_ensures_cos_acos : Valid [wp] [Alt-Ergo (Native)] Goal typed_ok_ensures_cos_acos_in_range : Valid [wp] [Qed] Goal typed_ok_ensures_tan_atan : Valid [wp] [Alt-Ergo (Native)] Goal typed_ok_ensures_log_pow : Valid [wp] [Qed] Goal typed_ok_ensures_log_exp : Valid [wp] [Alt-Ergo (Native)] Goal typed_ok_ensures_exp_log : Valid [wp] [Alt-Ergo (Native)] Goal typed_ok_ensures_min_plus_distrib : Valid [wp] [Alt-Ergo (Native)] Goal typed_ok_ensures_sqrt_pos : Valid [wp] [Alt-Ergo (Native)] Goal typed_ok_ensures_sqrt_pos0 : Valid [wp] Proved goals: 30 / 30 Qed: 5 Alt-Ergo: 25 [wp] Report in: 'tests/wp_plugin/oracle_qualif/math.1.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/math.1.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma 3 - (96..120) 19 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success ok 2 - (288..336) 11 100% ------------------------------------------------------------- ------------------------------------------------------------- Axiomatics WP Alt-Ergo (Native) Total Success Lemma 3 16 (96..120) 19 100% ------------------------------------------------------------- Functions WP Alt-Ergo (Native) Total Success ok 2 9 (288..336) 11 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.res.oracle�����������������0000666�0000000�0000000�00000002407�13571573400�025140� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 1 -wp-steps 50 [...] [kernel] Parsing tests/wp_plugin/math.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 9 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_ko_ensures_ko_sin_asin : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ko_ensures_ko_cos_acos : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ko_ensures_ko_asin_sin : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ko_ensures_ko_acos_cos : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ko_ensures_ko_atan_tan : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ko_ensures_ko_log_pow : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ko_ensures_ko_exp_log : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ko_ensures_ko_exp_log_add_mul : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_ko_ensures_ko_sqrt_pos : Unsuccess [wp] Proved goals: 0 / 9 Alt-Ergo 2.0.0: 0 (unsuccess: 9) [wp] Report in: 'tests/wp_plugin/oracle_qualif/math.2.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/math.2.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success ko - - 9 0.0% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024640� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025703� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/13197ec1be944f7d7e647e0ec9e42a92.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/13197ec1be9440000666�0000000�0000000�00000000107�13571573400�027451� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/13df20db3083b249543b1b76494b44bd.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/13df20db3083b0000666�0000000�0000000�00000000107�13571573400�027511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/4b726b5654038ef80abec267b3ab0f40.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/4b726b56540380000666�0000000�0000000�00000000107�13571573400�027311� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/a2ffaa4a6ec6a720426ea37225a3de9f.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/a2ffaa4a6ec6a0000666�0000000�0000000�00000000107�13571573400�030016� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/a858d2bb68ec4cf0515963f97a2a0cc7.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/a858d2bb68ec40000666�0000000�0000000�00000000107�13571573400�027615� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/de75098d7ad46b5fbf6335788df2267a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/de75098d7ad460000666�0000000�0000000�00000000107�13571573400�027543� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/e1e85e0396eb4b3f9ecfd0ef9c975545.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/e1e85e0396eb40000666�0000000�0000000�00000000107�13571573400�027535� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/e56758316a511fb81fc9497c7c535a3e.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/e56758316a5110000666�0000000�0000000�00000000107�13571573400�027311� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/f4c19e502fd825db09fe53ba86788b3c.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.session/cache/f4c19e502fd820000666�0000000�0000000�00000000107�13571573400�027532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.3.res.oracle�����������������0000666�0000000�0000000�00000003116�13571573400�025137� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 1 [...] [kernel] Parsing tests/wp_plugin/math.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] Warning: native support for alt-ergo is deprecated, use why3 instead [wp] 9 goals scheduled [wp] [Alt-Ergo (Native)] Goal typed_ko_ensures_ko_sin_asin : Unsuccess [wp] [Alt-Ergo (Native)] Goal typed_ko_ensures_ko_cos_acos : Unsuccess [wp] [Alt-Ergo (Native)] Goal typed_ko_ensures_ko_asin_sin : Unsuccess [wp] [Alt-Ergo (Native)] Goal typed_ko_ensures_ko_acos_cos : Unsuccess [wp] [Alt-Ergo (Native)] Goal typed_ko_ensures_ko_atan_tan : Unsuccess [wp] [Alt-Ergo (Native)] Goal typed_ko_ensures_ko_log_pow : Unsuccess [wp] [Alt-Ergo (Native)] Goal typed_ko_ensures_ko_exp_log : Unsuccess [wp] [Alt-Ergo (Native)] Goal typed_ko_ensures_ko_exp_log_add_mul : Unsuccess [wp] [Alt-Ergo (Native)] Goal typed_ko_ensures_ko_sqrt_pos : Unsuccess [wp] Proved goals: 0 / 9 Alt-Ergo: 0 (unsuccess: 9) [wp] Report in: 'tests/wp_plugin/oracle_qualif/math.3.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/math.3.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success ko - - 9 0.0% ------------------------------------------------------------- ------------------------------------------------------------- Functions WP Alt-Ergo (Native) Total Success ko - - 9 0.0% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/model.res.oracle������������������0000666�0000000�0000000�00000006152�13571573400�025150� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/model.i (no preprocessing) [kernel] tests/wp_plugin/model.i:10: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled --------------------------------------------- --- Context 'typed_f' Cluster 'Compound' --------------------------------------------- theory Compound (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use frama_c_wp.memory.Memory *) function shift_sint32 (p:addr) (k:int) : addr = shift p k end --------------------------------------------- --- Context 'typed_f' Cluster 'Axiomatic' --------------------------------------------- theory Axiomatic (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) predicate P_P int end [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures : Typechecked [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/model.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/model.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 1 0.0% ------------------------------------------------------------- [wp] Running WP plugin... [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures : Typechecked --------------------------------------------- --- Context 'typed_ref_f' Cluster 'Compound' --------------------------------------------- theory Compound1 (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool1 *) (* use int.Int1 *) (* use int.ComputerDivision1 *) (* use real.RealInfix1 *) (* use frama_c_wp.qed.Qed1 *) (* use map.Map1 *) (* use frama_c_wp.memory.Memory1 *) function shift_sint321 (p:addr1) (k:int) : addr1 = shift1 p k end --------------------------------------------- --- Context 'typed_ref_f' Cluster 'Axiomatic' --------------------------------------------- theory Axiomatic1 (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool1 *) (* use int.Int1 *) (* use int.ComputerDivision1 *) (* use real.RealInfix1 *) (* use frama_c_wp.qed.Qed1 *) (* use map.Map1 *) predicate P_P1 int end [wp] [Alt-Ergo 2.0.0] Goal typed_ref_f_ensures : Typechecked [wp] Proved goals: 0 / 2 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_plugin/oracle_qualif/model.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/model.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 2 0.0% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nowp.0.report.json����������������0000666�0000000�0000000�00000000005�13571573400�025406� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nowp.res.oracle�������������������0000666�0000000�0000000�00000000652�13571573400�025032� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/nowp.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_plugin/oracle_qualif/nowp.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/nowp.0.report.json' ------------------------------------------------------------- ��������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.0.res.oracle������������������0000666�0000000�0000000�00000001435�13571573400�024776� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/nth.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_access_16_16_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_access_4_4_ok : Valid [wp] [Qed] Goal typed_lemma_eq_repeat_concat_3_ok : Valid [wp] Proved goals: 3 / 3 Qed: 1 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_plugin/oracle_qualif/nth.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/nth.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic Nth 1 2 (152..176) 3 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024476� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025541� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.0.session/cache/f02880d9f20c50d2696d69306b9f2210.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.0.session/cache/f02880d9f20c500000666�0000000�0000000�00000000130�13571573400�027362� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.5952, "steps": 165 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.0.session/cache/fe32aa00366c24b440cce98e1de247ca.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.0.session/cache/fe32aa00366c240000666�0000000�0000000�00000000127�13571573400�027435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0603, "steps": 94 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.1.res.oracle������������������0000666�0000000�0000000�00000001553�13571573400�025000� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/nth.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 4 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_access_16_16_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_access_4_4_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_access_repeat_concat_3_ok_lack : Valid [wp] [Qed] Goal typed_lemma_eq_repeat_concat_3_ok : Valid [wp] Proved goals: 4 / 4 Qed: 1 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_plugin/oracle_qualif/nth.1.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/nth.1.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic Nth 1 3 (152..176) 4 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.1.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024477� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.1.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025542� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.1.session/cache/af662533ee30f3d19d6e3a181c22b81a.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.1.session/cache/af662533ee30f30000666�0000000�0000000�00000000130�13571573400�027444� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.8449, "steps": 159 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.1.session/cache/f02880d9f20c50d2696d69306b9f2210.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.1.session/cache/f02880d9f20c500000666�0000000�0000000�00000000130�13571573400�027363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.4727, "steps": 165 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.1.session/cache/fe32aa00366c24b440cce98e1de247ca.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.1.session/cache/fe32aa00366c240000666�0000000�0000000�00000000126�13571573400�027435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.071, "steps": 94 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.i.0.report.json���������������0000666�0000000�0000000�00000004474�13571573400�025461� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 28 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 3, "rank": 28 } }, "wp:axiomatics": { "Nth": { "lemma_eq_repeat_concat_3_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_access_4_4_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 19 }, "wp:main": { "total": 1, "valid": 1, "rank": 19 } }, "lemma_access_16_16_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 28 }, "wp:main": { "total": 1, "valid": 1, "rank": 28 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 28 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 3, "rank": 28 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/nth.i.1.report.json���������������0000666�0000000�0000000�00000005340�13571573400�025453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 28 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 4, "valid": 4, "rank": 28 } }, "wp:axiomatics": { "Nth": { "lemma_eq_repeat_concat_3_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_access_repeat_concat_3_ok_lack": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 28 }, "wp:main": { "total": 1, "valid": 1, "rank": 28 } }, "lemma_access_4_4_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 19 }, "wp:main": { "total": 1, "valid": 1, "rank": 19 } }, "lemma_access_16_16_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 28 }, "wp:main": { "total": 1, "valid": 1, "rank": 28 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 28 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 4, "valid": 4, "rank": 28 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overarray.0.report.json�����������0000666�0000000�0000000�00000007446�13571573400�026455� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "unknown": 4 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 12, "valid": 8, "unknown": 4 } }, "wp:functions": { "f1_ok": { "f1_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f2_ok": { "f2_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f3_ok": { "f3_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f4_ok": { "f4_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f5_ko": { "f5_ko_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "f6_ko": { "f6_ko_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overarray.0.session/��������������0000777�0000000�0000000�00000000000�13571573400�025717� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overarray.0.session/cache/��������0000777�0000000�0000000�00000000000�13571573400�026762� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overarray.0.session/cache/2435783c50932d991f8ee829724a1949.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overarray.0.session/cache/2435783c0000666�0000000�0000000�00000000072�13571573400�027706� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overarray.0.session/cache/f9c13ffe00b0b154325d6265a980d603.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overarray.0.session/cache/f9c13ffe0000666�0000000�0000000�00000000072�13571573400�030212� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overarray.i.0.report.json���������0000666�0000000�0000000�00000007257�13571573400�026704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 4, "unknown": 4 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 12, "valid": 8, "unknown": 4 } }, "wp:functions": { "f1_ok": { "f1_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f2_ok": { "f2_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f3_ok": { "f3_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f4_ok": { "f4_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f5_ko": { "f5_ko_assigns": { "alt-ergo": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "alt-ergo": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "f6_ko": { "f6_ko_assigns": { "alt-ergo": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "alt-ergo": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overarray.res.oracle��������������0000666�0000000�0000000�00000003142�13571573400�026056� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/overarray.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 12 goals scheduled [wp] [Qed] Goal typed_f1_ok_assigns_exit : Valid [wp] [Qed] Goal typed_f1_ok_assigns_normal : Valid [wp] [Qed] Goal typed_f2_ok_assigns_exit : Valid [wp] [Qed] Goal typed_f2_ok_assigns_normal : Valid [wp] [Qed] Goal typed_f3_ok_assigns_exit : Valid [wp] [Qed] Goal typed_f3_ok_assigns_normal : Valid [wp] [Qed] Goal typed_f4_ok_assigns_exit : Valid [wp] [Qed] Goal typed_f4_ok_assigns_normal : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f5_ko_assigns_exit : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f5_ko_assigns_normal : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f6_ko_assigns_exit : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f6_ko_assigns_normal : Unsuccess [wp] Proved goals: 8 / 12 Qed: 8 Alt-Ergo 2.0.0: 0 (unsuccess: 4) [wp] Report in: 'tests/wp_plugin/oracle_qualif/overarray.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/overarray.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f1_ok 2 - 2 100% f2_ok 2 - 2 100% f3_ok 2 - 2 100% f4_ok 2 - 2 100% f5_ko - - 2 0.0% f6_ko - - 2 0.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.report.json����������0000666�0000000�0000000�00000010730�13571573400�026611� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 8, "valid": 4, "unknown": 4, "rank": 5 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 12, "valid": 8, "unknown": 4, "rank": 5 } }, "wp:functions": { "f1_ok": { "f1_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f2_ok": { "f2_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f3_ok": { "f3_ok_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 5 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 5 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } } }, "f4_ok": { "f4_ok_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 3 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 3 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } } }, "f5_ko": { "f5_ko_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "f6_ko": { "f6_ko_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } ����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026065� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027130� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/cache/4d61b75fe6abd8df19f1a9be60dd9763.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/cache/4d61b750000666�0000000�0000000�00000000072�13571573400�030046� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/cache/55eeed2d5cf9cb6cfa8e52612c324d9d.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/cache/55eeed20000666�0000000�0000000�00000000127�13571573400�030211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0196, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/cache/bd8277dfe06709be8acedb93fa4872f9.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/cache/bd8277d0000666�0000000�0000000�00000000127�13571573400�030134� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0196, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/cache/c10d88d85fe0d4ee0f388d8245f869f7.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.0.session/cache/c10d88d0000666�0000000�0000000�00000000072�13571573400�030125� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.i.0.report.json��������0000666�0000000�0000000�00000010576�13571573400�027050� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 8, "valid": 4, "unknown": 4, "rank": 6 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 12, "valid": 8, "unknown": 4, "rank": 6 } }, "wp:functions": { "f1_ok": { "f1_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f2_ok": { "f2_ok_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f3_ok": { "f3_ok_assigns": { "alt-ergo": { "total": 2, "valid": 2, "rank": 6 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "wp:section": { "alt-ergo": { "total": 2, "valid": 2, "rank": 6 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } } }, "f4_ok": { "f4_ok_assigns": { "alt-ergo": { "total": 2, "valid": 2, "rank": 5 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "wp:section": { "alt-ergo": { "total": 2, "valid": 2, "rank": 5 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } } }, "f5_ko": { "f5_ko_assigns": { "alt-ergo": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "alt-ergo": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } }, "f6_ko": { "f6_ko_assigns": { "alt-ergo": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:section": { "alt-ergo": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } ����������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/overassign.res.oracle�������������0000666�0000000�0000000�00000003221�13571573400�026222� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/overassign.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 12 goals scheduled [wp] [Qed] Goal typed_f1_ok_assigns_exit : Valid [wp] [Qed] Goal typed_f1_ok_assigns_normal : Valid [wp] [Qed] Goal typed_f2_ok_assigns_exit : Valid [wp] [Qed] Goal typed_f2_ok_assigns_normal : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f3_ok_assigns_exit : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f3_ok_assigns_normal : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f4_ok_assigns_exit : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f4_ok_assigns_normal : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f5_ko_assigns_exit : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f5_ko_assigns_normal : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f6_ko_assigns_exit : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f6_ko_assigns_normal : Unsuccess [wp] Proved goals: 8 / 12 Qed: 4 Alt-Ergo 2.0.0: 4 (unsuccess: 4) [wp] Report in: 'tests/wp_plugin/oracle_qualif/overassign.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/overassign.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f1_ok 2 - 2 100% f2_ok 2 - 2 100% f3_ok - 2 (16..28) 2 100% f4_ok - 2 (8..20) 2 100% f5_ko - - 2 0.0% f6_ko - - 2 0.0% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/params.0.report.json��������������0000666�0000000�0000000�00000002023�13571573400�025710� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:axiomatics": { "": { "lemma_lem": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/params.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�025170� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/params.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�026233� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/params.0.session/cache/c29b3bdbe3eb1277e4c71838ea2a4887.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/params.0.session/cache/c29b3bdbe3e0000666�0000000�0000000�00000000126�13571573400�030044� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0088, "steps": 4 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/params.i.0.report.json������������0000666�0000000�0000000�00000001706�13571573400�026146� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:axiomatics": { "": { "lemma_lem": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } ����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/params.res.oracle�����������������0000666�0000000�0000000�00000001242�13571573400�025326� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/params.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_lem : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/params.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/params.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - 1 (1..12) 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/plet.0.report.json����������������0000666�0000000�0000000�00000001763�13571573400�025403� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:axiomatics": { "Test": { "lemma_GOAL": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } } } } } �������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/plet.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024651� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/plet.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025714� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/plet.0.session/cache/570d6a8b3ed674b838476cd14ab30316.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/plet.0.session/cache/570d6a8b3ed670000666�0000000�0000000�00000000127�13571573400�027550� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0139, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/plet.i.0.report.json��������������0000666�0000000�0000000�00000001774�13571573400�025634� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:axiomatics": { "Test": { "lemma_GOAL": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } } } } ����frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/plet.res.oracle�������������������0000666�0000000�0000000�00000001235�13571573400�025011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/plet.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_GOAL : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/plet.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/plet.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Axiomatic Test - 1 (16..28) 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/polarity.0.report.json������������0000666�0000000�0000000�00000001343�13571573400�026274� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "f": { "f_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/polarity.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025550� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/polarity.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026613� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/polarity.0.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/polarity.0.session/cache/2d7c067450000666�0000000�0000000�00000000072�13571573400�027702� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/polarity.i.0.report.json����������0000666�0000000�0000000�00000001254�13571573400�026524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:functions": { "f": { "f_assert": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/polarity.res.oracle���������������0000666�0000000�0000000�00000001536�13571573400�025714� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/polarity.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/polarity.i:1: Warning: Allocation, initialization and danglingness not yet implemented (\initialized(\at(p,wp:pre))) [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert : Unsuccess (Stronger) [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/polarity.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/polarity.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 1 0.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�025206� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�026251� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/778a39b644999f1f9b43c71dd8ee9b0b.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/778a39b64490000666�0000000�0000000�00000000127�13571573400�027527� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0228, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/867e591f25a0a603f41701659323e11a.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/867e591f25a0000666�0000000�0000000�00000000127�13571573400�027602� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0271, "steps": 30 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/8bb2dfe3f4fe3359717a56a05cf8314b.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/8bb2dfe3f4f0000666�0000000�0000000�00000000127�13571573400�030073� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0246, "steps": 31 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/d9dc95959e010c582ac876a6d9a50fd5.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/d9dc95959e00000666�0000000�0000000�00000000127�13571573400�027671� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0224, "steps": 26 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/fd671e76634e44a48acb86857c5565b0.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.0.session/cache/fd671e766340000666�0000000�0000000�00000000130�13571573400�027574� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1358, "steps": 220 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.i.0.report.json������������0000666�0000000�0000000�00000011307�13571573400�026162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 35 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 12, "valid": 12, "rank": 35 } }, "wp:functions": { "diag": { "diag_loop_invariant_PJ": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 7 } }, "diag_loop_invariant_J": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "diag_loop_invariant_PI": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 7 } }, "diag_loop_invariant_I": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "diag_loop_assigns_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "diag_loop_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "diag_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 35 }, "wp:main": { "total": 1, "valid": 1, "rank": 35 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 35 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 12, "valid": 12, "rank": 35 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/prenex.res.oracle�����������������0000666�0000000�0000000�00000002617�13571573400�025353� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/prenex.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 12 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_diag_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_diag_loop_invariant_I_preserved : Valid [wp] [Qed] Goal typed_diag_loop_invariant_I_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_diag_loop_invariant_PI_preserved : Valid [wp] [Qed] Goal typed_diag_loop_invariant_PI_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_diag_loop_invariant_J_preserved : Valid [wp] [Qed] Goal typed_diag_loop_invariant_J_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_diag_loop_invariant_PJ_preserved : Valid [wp] [Qed] Goal typed_diag_loop_invariant_PJ_established : Valid [wp] [Qed] Goal typed_diag_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_diag_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_diag_loop_assigns_2 : Valid [wp] Proved goals: 12 / 12 Qed: 7 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_plugin/oracle_qualif/prenex.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/prenex.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success diag 7 5 (192..240) 12 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/removed.0.session/����������������0000777�0000000�0000000�00000000000�13571573400�025346� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/removed.0.session/cache/����������0000777�0000000�0000000�00000000000�13571573400�026411� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/removed.0.session/cache/4dc341b2d4deefe644f427eea94616b0.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/removed.0.session/cache/4dc341b2d40000666�0000000�0000000�00000000107�13571573400�027710� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/removed.res.oracle����������������0000666�0000000�0000000�00000001500�13571573400�025501� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_plugin/removed.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/wp_plugin/removed.i:10: Warning: signed overflow. assert 1 + i ≤ 2147483647; [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ [-2147483647..2147483647] [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_main_assert_Eva_signed_overflow : Unsuccess [wp] Proved goals: 0 / 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Running WP plugin... [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.report.json��������������0000666�0000000�0000000�00000022615�13571573400�025716� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 51 }, "qed": { "total": 42, "valid": 42 }, "wp:main": { "total": 47, "valid": 47, "rank": 51 } }, "wp:functions": { "master": { "master_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "master_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "unroll": { "unroll_loop_invariant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "unroll_assigns": { "qed": { "total": 22, "valid": 22 }, "wp:main": { "total": 22, "valid": 22 } }, "unroll_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 25, "valid": 25 }, "wp:main": { "total": 25, "valid": 25 } } }, "induction": { "induction_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 51 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 51 } }, "induction_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "induction_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "induction_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "induction_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 51 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 9, "valid": 9, "rank": 51 } } }, "shifted": { "shifted_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 51 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 51 } }, "shifted_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "shifted_assigns": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "shifted_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "shifted_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 45 }, "wp:main": { "total": 1, "valid": 1, "rank": 45 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 51 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 10, "valid": 10, "rank": 51 } } } } } �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�025165� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�026230� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/10a23103267207b4187f3b74e41ef72d.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/10a231032670000666�0000000�0000000�00000000127�13571573400�027364� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0189, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/15db3cdd6e613c3be1475c9017b1faaf.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/15db3cdd6e60000666�0000000�0000000�00000000130�13571573400�027757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.2244, "steps": 557 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/4233f9536c694126fa361ebeb7de55a2.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/4233f9536c60000666�0000000�0000000�00000000130�13571573400�027466� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.9089, "steps": 403 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/7a60c6978f1ede6682bd66a6423e5044.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/7a60c6978f10000666�0000000�0000000�00000000127�13571573400�027560� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0184, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/9d1b3fbe16b7a7d6baf2910a974c3d6a.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.0.session/cache/9d1b3fbe16b0000666�0000000�0000000�00000000130�13571573400�027755� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.1571, "steps": 555 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.c.0.report.json������������0000666�0000000�0000000�00000022615�13571573400�026137� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 51 }, "qed": { "total": 42, "valid": 42 }, "wp:main": { "total": 47, "valid": 47, "rank": 51 } }, "wp:functions": { "master": { "master_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "master_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "unroll": { "unroll_loop_invariant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "unroll_assigns": { "qed": { "total": 22, "valid": 22 }, "wp:main": { "total": 22, "valid": 22 } }, "unroll_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 25, "valid": 25 }, "wp:main": { "total": 25, "valid": 25 } } }, "induction": { "induction_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 51 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 51 } }, "induction_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "induction_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "induction_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "induction_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 51 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 9, "valid": 9, "rank": 51 } } }, "shifted": { "shifted_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 51 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 51 } }, "shifted_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "shifted_assigns": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } }, "shifted_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "shifted_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 45 }, "wp:main": { "total": 1, "valid": 1, "rank": 45 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 51 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 10, "valid": 10, "rank": 51 } } } } } �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/repeat.res.oracle�����������������0000666�0000000�0000000�00000007203�13571573400�025326� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/repeat.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/repeat.c:47: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 47 goals scheduled [wp] [Qed] Goal typed_induction_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_induction_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_induction_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_induction_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_induction_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_induction_loop_assigns : Valid [wp] [Qed] Goal typed_induction_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_induction_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_induction_assigns_normal : Valid [wp] [Qed] Goal typed_master_ensures : Valid [wp] [Qed] Goal typed_master_assigns_exit : Valid [wp] [Qed] Goal typed_master_assigns_normal : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_shifted_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_shifted_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_shifted_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_shifted_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_shifted_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_shifted_loop_assigns : Valid [wp] [Qed] Goal typed_shifted_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_shifted_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_shifted_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_shifted_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_unroll_ensures : Valid [wp] [Qed] Goal typed_unroll_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_unroll_loop_invariant_established : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part01 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part02 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part03 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part04 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part05 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part06 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part07 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part08 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part09 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part10 : Valid [wp] [Qed] Goal typed_unroll_assigns_exit_part11 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part01 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part02 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part03 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part04 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part05 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part06 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part07 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part08 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part09 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part10 : Valid [wp] [Qed] Goal typed_unroll_assigns_normal_part11 : Valid [wp] Proved goals: 47 / 47 Qed: 42 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_plugin/oracle_qualif/repeat.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/repeat.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success master 3 - 3 100% unroll 25 - 25 100% induction 7 2 (512..608) 9 100% shifted 7 3 (512..608) 10 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024477� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025542� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/3afdeebefb45f797fcaeee80a3130909.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/3afdeebefb45f70000666�0000000�0000000�00000000107�13571573400�030037� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/914472b8d4c8fb3a40937ea1f3009a96.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/914472b8d4c8fb0000666�0000000�0000000�00000000072�13571573400�027463� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/9f2022b03307856ff4ac275b4d10b064.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/9f2022b03307850000666�0000000�0000000�00000000107�13571573400�027223� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/bc9c09c9d7f65d10c82f09240d77fd35.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/bc9c09c9d7f65d0000666�0000000�0000000�00000000125�13571573400�027630� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.014, "steps": 9 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/fc54a11274dceec702d37696f5e88f2b.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.0.session/cache/fc54a11274dcee0000666�0000000�0000000�00000000072�13571573400�027606� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.i.0.report.json���������������0000666�0000000�0000000�00000007507�13571573400�025462� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "unknown": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 1, "unknown": 5 } }, "wp:functions": { "job": { "job_assert_rte_mem_access_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_assert_rte_signed_overflow_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "job_assert_rte_signed_overflow": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "job_assert_rte_mem_access_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "job_assert_rte_mem_access": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 4, "unknown": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 5, "valid": 1, "unknown": 4 } } }, "job3": { "job3_assert_rte_bool_value": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/rte.res.oracle��������������������0000666�0000000�0000000�00000002275�13571573400�024644� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-rte [...] [kernel] Parsing tests/wp_plugin/rte.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [rte] annotating function job [rte] annotating function job2 [rte] annotating function job3 [wp] 6 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_job_assert_rte_mem_access : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_job_assert_rte_mem_access_2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_job_assert_rte_signed_overflow : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_job_assert_rte_signed_overflow_2 : Unsuccess [wp] [Qed] Goal typed_job_assert_rte_mem_access_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job3_assert_rte_bool_value : Valid [wp] Proved goals: 2 / 6 Qed: 1 Alt-Ergo 2.0.0: 1 (unsuccess: 4) [wp] Report in: 'tests/wp_plugin/oracle_qualif/rte.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/rte.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 1 - 5 20.0% job3 - 1 (4..16) 1 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.res.oracle�������������0000666�0000000�0000000�00000007004�13571573400�026013� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_plugin/sequence.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 39 goals scheduled [wp] [Qed] Goal typed_caveat_loops_ensures_ok_first : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_ensures_ok_last : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_loop_invariant_ok_id_max_preserved : Valid [wp] [Qed] Goal typed_caveat_loops_loop_invariant_ok_id_max_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_loop_invariant_ok_id_min_preserved : Valid [wp] [Qed] Goal typed_caveat_loops_loop_invariant_ok_id_min_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_loop_invariant_ok_inv_preserved : Valid [wp] [Qed] Goal typed_caveat_loops_loop_invariant_ok_inv_established : Valid [wp] [Qed] Goal typed_caveat_loops_loop_assigns : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_normal_part3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_g_called_ensures_ok_u1 : Valid [wp] [Qed] Goal typed_caveat_loops_g_called_ensures_ok_u2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_g_not_called_ensures_ok_v1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_g_not_called_ensures_ok_v2 : Valid [wp] [Qed] Goal typed_caveat_no_calls_ensures_ok_m1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_no_calls_ensures_ok_m2 : Valid [wp] [Qed] Goal typed_caveat_no_calls_ensures_ok_bug_why3_n1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_no_calls_ensures_ok_n2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_no_calls_ensures_ok_n3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_no_calls_ensures_ok_bug_why3_n5 : Valid [wp] [Qed] Goal typed_caveat_no_calls_ensures_ok_bug_why3_n6 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_no_calls_ensures_ok_bug_why3_n5_ok : Valid [wp] [Qed] Goal typed_caveat_no_calls_ensures_ok_bug_why3_n6_ok : Valid [wp] [Qed] Goal typed_caveat_no_calls_assigns : Valid [wp] [Qed] Goal typed_caveat_sequence_assigns_exit : Valid [wp] [Qed] Goal typed_caveat_sequence_assigns_normal : Valid [wp] [Qed] Goal typed_caveat_sequence_g_called_ensures_ok_o1 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_called_ensures_ok_p1 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_called_ensures_ok_p2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_sequence_g_called_ensures_ok_p3 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_not_called_ensures_ok_o2 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_not_called_ensures_ok_q1 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_not_called_ensures_ok_q2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_sequence_g_not_called_ensures_ok_q3 : Valid [wp] Proved goals: 39 / 39 Qed: 25 Alt-Ergo 2.0.0: 14 [wp] Report in: 'tests/wp_plugin/oracle_qualif/sequence.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/sequence.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success no_calls 5 5 (4..16) 10 100% sequence 8 2 (12..24) 10 100% loops 12 7 (128..152) 19 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025515� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026560� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/05bf3d9a5dd94c3fb9bc16d3d4b6cf93.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/05bf3d9a50000666�0000000�0000000�00000000127�13571573400�030005� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0185, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/594fed1892de5619cb273dae40ac83ea.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/594fed1890000666�0000000�0000000�00000000127�13571573400�027745� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0181, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/5ed2e8c21a156adae7a0b25abc9c27bb.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/5ed2e8c210000666�0000000�0000000�00000000130�13571573400�027777� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0966, "steps": 141 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/66cef80b694298de7699f046dadd3a7a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/66cef80b60000666�0000000�0000000�00000000127�13571573400�030014� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0117, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/7574eb33ed23e94657554393efbad553.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/7574eb33e0000666�0000000�0000000�00000000127�13571573400�027733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0181, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/784a2a0777dc3fa9793867967284103e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/784a2a0770000666�0000000�0000000�00000000127�13571573400�027647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0177, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/86f836b1a4b0e86a126c21cada46e167.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/86f836b1a0000666�0000000�0000000�00000000126�13571573400�027732� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.012, "steps": 10 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/8e0fa0b1315a7ec1e10b590a424d9af5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/8e0fa0b130000666�0000000�0000000�00000000126�13571573400�027773� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0097, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/9101c7dc858a555edc2755b8060d142a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/9101c7dc80000666�0000000�0000000�00000000127�13571573400�027726� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0152, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/9821148ea670387683fe3d59f7309d93.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/9821148ea0000666�0000000�0000000�00000000127�13571573400�027651� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0131, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/9b4f07f146bbffd40781f95d7f400f8e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/9b4f07f140000666�0000000�0000000�00000000126�13571573400�027730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0124, "steps": 5 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/a63e4475b84df547e1877256ffba381f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/a63e4475b0000666�0000000�0000000�00000000127�13571573400�027727� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0214, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/ef0e894ee011e93e53fac9b69881e5bb.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.0.session/cache/ef0e894ee0000666�0000000�0000000�00000000127�13571573400�030101� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0464, "steps": 74 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.res.oracle�������������0000666�0000000�0000000�00000006217�13571573400�026021� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_plugin/sequence.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 34 goals scheduled [wp] [Qed] Goal typed_caveat_loops_ensures_ok_first : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_ensures_ok_last : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_loop_invariant_ok_id_max_preserved : Valid [wp] [Qed] Goal typed_caveat_loops_loop_invariant_ok_id_max_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_loop_invariant_ok_id_min_preserved : Valid [wp] [Qed] Goal typed_caveat_loops_loop_invariant_ok_id_min_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_loop_invariant_ok_inv_preserved : Valid [wp] [Qed] Goal typed_caveat_loops_loop_invariant_ok_inv_established : Valid [wp] [Qed] Goal typed_caveat_loops_loop_assigns : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_caveat_loops_assigns_normal_part3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_g_called_ensures_ok_u1 : Valid [wp] [Qed] Goal typed_caveat_loops_g_called_ensures_ok_u2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_g_not_called_ensures_ok_v1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_loops_g_not_called_ensures_ok_v2 : Valid [wp] [Qed] Goal typed_caveat_no_calls_ensures_ok_m1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_no_calls_ensures_ok_m2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_no_calls_ensures_ok_n2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_no_calls_ensures_ok_n3 : Valid [wp] [Qed] Goal typed_caveat_no_calls_assigns : Valid [wp] [Qed] Goal typed_caveat_sequence_assigns_exit : Valid [wp] [Qed] Goal typed_caveat_sequence_assigns_normal : Valid [wp] [Qed] Goal typed_caveat_sequence_g_called_ensures_ok_o1 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_called_ensures_ok_p1 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_called_ensures_ok_p2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_sequence_g_called_ensures_ok_p3 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_not_called_ensures_ok_o2 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_not_called_ensures_ok_q1 : Valid [wp] [Qed] Goal typed_caveat_sequence_g_not_called_ensures_ok_q2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_sequence_g_not_called_ensures_ok_q3 : Valid [wp] Proved goals: 34 / 34 Qed: 22 Alt-Ergo 2.0.0: 12 [wp] Report in: 'tests/wp_plugin/oracle_qualif/sequence.1.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/sequence.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success no_calls 2 3 (1..12) 5 100% sequence 8 2 (12..24) 10 100% loops 12 7 (128..152) 19 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/���������������0000777�0000000�0000000�00000000000�13571573400�025516� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026561� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/594fed1892de5619cb273dae40ac83ea.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/594fed1890000666�0000000�0000000�00000000127�13571573400�027746� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0121, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/5ed2e8c21a156adae7a0b25abc9c27bb.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/5ed2e8c210000666�0000000�0000000�00000000127�13571573400�030006� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.115, "steps": 141 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/66cef80b694298de7699f046dadd3a7a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/66cef80b60000666�0000000�0000000�00000000127�13571573400�030015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0194, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/7574eb33ed23e94657554393efbad553.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/7574eb33e0000666�0000000�0000000�00000000127�13571573400�027734� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0208, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/784a2a0777dc3fa9793867967284103e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/784a2a0770000666�0000000�0000000�00000000127�13571573400�027650� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0161, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/8e0fa0b1315a7ec1e10b590a424d9af5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/8e0fa0b130000666�0000000�0000000�00000000126�13571573400�027774� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0141, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/9101c7dc858a555edc2755b8060d142a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/9101c7dc80000666�0000000�0000000�00000000127�13571573400�027727� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0132, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/9821148ea670387683fe3d59f7309d93.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/9821148ea0000666�0000000�0000000�00000000126�13571573400�027651� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.017, "steps": 16 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/9b4f07f146bbffd40781f95d7f400f8e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/9b4f07f140000666�0000000�0000000�00000000126�13571573400�027731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0129, "steps": 5 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/a63e4475b84df547e1877256ffba381f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/a63e4475b0000666�0000000�0000000�00000000127�13571573400�027730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0241, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/ef0e894ee011e93e53fac9b69881e5bb.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.1.session/cache/ef0e894ee0000666�0000000�0000000�00000000127�13571573400�030102� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0404, "steps": 74 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.2.res.oracle�������������0000666�0000000�0000000�00000000734�13571573400�026020� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' -wp-steps 50 [...] [kernel] Parsing tests/wp_plugin/sequence.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_plugin/oracle_qualif/sequence.2.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/sequence.2.report.json' ------------------------------------------------------------- ������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.i.0.report.json����������0000666�0000000�0000000�00000036241�13571573400�026475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 14, "valid": 14, "rank": 25 }, "qed": { "total": 25, "valid": 25 }, "wp:main": { "total": 39, "valid": 39, "rank": 25 } }, "wp:functions": { "no_calls": { "no_calls_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "no_calls_ensures_ok_bug_why3_n6_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "no_calls_ensures_ok_bug_why3_n5_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "no_calls_ensures_ok_bug_why3_n6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "no_calls_ensures_ok_bug_why3_n5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "no_calls_ensures_ok_n3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "no_calls_ensures_ok_n2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "no_calls_ensures_ok_bug_why3_n1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "no_calls_ensures_ok_m2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "no_calls_ensures_ok_m1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 2 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 10, "valid": 10, "rank": 2 } } }, "sequence": { "sequence_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "sequence_g_not_called_ensures_ok_q3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "sequence_g_not_called_ensures_ok_q2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_not_called_ensures_ok_q1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_not_called_ensures_ok_o2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_called_ensures_ok_p3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "sequence_g_called_ensures_ok_p2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_called_ensures_ok_p1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_called_ensures_ok_o1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 10, "valid": 10, "rank": 4 } } }, "loops": { "loops_loop_invariant_ok_inv": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 25 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 25 } }, "loops_loop_invariant_ok_id_max": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "loops_loop_invariant_ok_id_min": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "loops_assigns": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } }, "loops_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "loops_g_not_called_ensures_ok_v2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "loops_g_not_called_ensures_ok_v1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "loops_g_called_ensures_ok_u2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "loops_g_called_ensures_ok_u1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "loops_ensures_ok_last": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 17 }, "wp:main": { "total": 1, "valid": 1, "rank": 17 } }, "loops_ensures_ok_first": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 7, "valid": 7, "rank": 25 }, "qed": { "total": 12, "valid": 12 }, "wp:main": { "total": 19, "valid": 19, "rank": 25 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.i.1.report.json����������0000666�0000000�0000000�00000033225�13571573400�026475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 12, "valid": 12, "rank": 25 }, "qed": { "total": 22, "valid": 22 }, "wp:main": { "total": 34, "valid": 34, "rank": 25 } }, "wp:functions": { "no_calls": { "no_calls_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "no_calls_ensures_ok_n3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "no_calls_ensures_ok_n2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "no_calls_ensures_ok_m2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "no_calls_ensures_ok_m1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 5, "valid": 5, "rank": 1 } } }, "sequence": { "sequence_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "sequence_g_not_called_ensures_ok_q3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "sequence_g_not_called_ensures_ok_q2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_not_called_ensures_ok_q1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_not_called_ensures_ok_o2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_called_ensures_ok_p3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "sequence_g_called_ensures_ok_p2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_called_ensures_ok_p1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "sequence_g_called_ensures_ok_o1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 10, "valid": 10, "rank": 4 } } }, "loops": { "loops_loop_invariant_ok_inv": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 25 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 25 } }, "loops_loop_invariant_ok_id_max": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "loops_loop_invariant_ok_id_min": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "loops_assigns": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } }, "loops_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "loops_g_not_called_ensures_ok_v2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "loops_g_not_called_ensures_ok_v1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "loops_g_called_ensures_ok_u2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "loops_g_called_ensures_ok_u1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "loops_ensures_ok_last": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 17 }, "wp:main": { "total": 1, "valid": 1, "rank": 17 } }, "loops_ensures_ok_first": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 7, "valid": 7, "rank": 25 }, "qed": { "total": 12, "valid": 12 }, "wp:main": { "total": 19, "valid": 19, "rank": 25 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/sequence.i.2.report.json����������0000666�0000000�0000000�00000000005�13571573400�026464� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/stmt.c.0.report.json��������������0000666�0000000�0000000�00000005565�13571573400�025653� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 10, "valid": 10 } }, "wp:functions": { "f": { "f_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "g": { "g_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "h": { "h_assert_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "h_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "h_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/stmt.log��������������������������0000666�0000000�0000000�00000001402�13571573400�023554� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_plugin/stmt.c (with preprocessing) [wp] Running WP plugin... [wp] [CFG] Goal f_exits : Valid (Unreachable) [wp] [CFG] Goal g_exits : Valid (Unreachable) [wp] [CFG] Goal g_assigns : Valid (Unreachable) [wp] [CFG] Goal g_ensures : Valid (Unreachable) [wp] [CFG] Goal g_exits : Valid (Unreachable) [wp] [CFG] Goal h_exits : Valid (Unreachable) [wp] [CFG] Goal h_assigns : Valid (Unreachable) [wp] [CFG] Goal h_ensures : Valid (Unreachable) [wp] [CFG] Goal h_exits : Valid (Unreachable) [wp] CFG h -> h [wp] CFG h -> h_NEG_stmt_15 [wp] CFG h -> h_POS_stmt_15 [wp] CFG h -> h_default_for_stmt_15 [wp] CFG g -> g [wp] CFG g -> g_default_for_stmt_11 [wp] CFG f -> f [wp] CFG f -> f_default_for_stmt_2 [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/stmt.res.oracle�������������������0000666�0000000�0000000�00000012050�13571573400�025031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/stmt.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] [CFG] Goal f_exits : Valid (Unreachable) [wp] [CFG] Goal g_exits : Valid (Unreachable) [wp] [CFG] Goal g_assigns : Valid (Unreachable) [wp] [CFG] Goal g_ensures : Valid (Unreachable) [wp] [CFG] Goal g_exits : Valid (Unreachable) [wp] [CFG] Goal h_exits : Valid (Unreachable) [wp] [CFG] Goal h_assigns : Valid (Unreachable) [wp] [CFG] Goal h_ensures : Valid (Unreachable) [wp] [CFG] Goal h_exits : Valid (Unreachable) [wp] Warning: Missing RTE guards [wp] 10 goals scheduled [wp] [Qed] Goal typed_f_ensures_2 : Valid [wp] [Qed] Goal typed_f_ensures_3 : Valid [wp] [Qed] Goal typed_f_assert : Valid [wp] [Qed] Goal typed_f_ensures : Valid [wp] [Qed] Goal typed_f_assigns : Valid [wp] [Qed] Goal typed_g_ensures_2 : Valid [wp] [Qed] Goal typed_g_assert : Valid [wp] [Qed] Goal typed_h_ensures_2 : Valid [wp] [Qed] Goal typed_h_assert : Valid [wp] [Qed] Goal typed_h_assert_2 : Valid [wp] Proved goals: 10 / 10 Qed: 10 [wp] Report in: 'tests/wp_plugin/oracle_qualif/stmt.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/stmt.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 5 - 5 100% g 2 - 2 100% h 3 - 3 100% ------------------------------------------------------------- [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Post-condition (file tests/wp_plugin/stmt.c, line 10) by Wp.typed. [ Valid ] Post-condition (file tests/wp_plugin/stmt.c, line 11) by Wp.typed. [ Valid ] Exit-condition (file tests/wp_plugin/stmt.c, line 15) at block by Unreachable Annotations. [ Valid ] Return-condition (file tests/wp_plugin/stmt.c, line 16) at block by Frama-C kernel. [ Valid ] Post-condition (file tests/wp_plugin/stmt.c, line 17) at block by Wp.typed. [ Valid ] Assigns (file tests/wp_plugin/stmt.c, line 21) at block by Wp.typed. [ Valid ] Assertion (file tests/wp_plugin/stmt.c, line 16) by Wp.typed. [ Valid ] Default behavior at block by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Post-condition (file tests/wp_plugin/stmt.c, line 27) by Wp.typed. [ Valid ] Exit-condition (file tests/wp_plugin/stmt.c, line 31) at block by Unreachable Annotations. [ Valid ] Return-condition (file tests/wp_plugin/stmt.c, line 32) at block by Frama-C kernel. by Unreachable Annotations. [ Valid ] Post-condition (file tests/wp_plugin/stmt.c, line 33) at block by Unreachable Annotations. [ Valid ] Assigns (file tests/wp_plugin/stmt.c, line 36) at block by Unreachable Annotations. [ Valid ] Assertion (file tests/wp_plugin/stmt.c, line 32) by Wp.typed. [ Valid ] Default behavior at block by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h' -------------------------------------------------------------------------------- [ Valid ] Post-condition (file tests/wp_plugin/stmt.c, line 40) by Wp.typed. [ Valid ] Exit-condition (file tests/wp_plugin/stmt.c, line 43) at block by Unreachable Annotations. [ Valid ] Post-condition (file tests/wp_plugin/stmt.c, line 44) at block by Unreachable Annotations. [ Valid ] Return-condition for 'POS' (file tests/wp_plugin/stmt.c, line 48) at block by Frama-C kernel. [ Valid ] Return-condition for 'NEG' (file tests/wp_plugin/stmt.c, line 51) at block by Frama-C kernel. [ Valid ] Assigns (file tests/wp_plugin/stmt.c, line 53) at block by Unreachable Annotations. [ Valid ] Assertion (generated) by Wp.typed. [ Valid ] Assertion (generated) by Wp.typed. [ Valid ] Behavior 'NEG' at block by Frama-C kernel. [ Valid ] Behavior 'POS' at block by Frama-C kernel. [ Valid ] Default behavior at block by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 29 Completely validated 29 Total -------------------------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.report.json������������0000666�0000000�0000000�00000036261�13571573400�026250� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 21, "valid": 21, "rank": 66 }, "qed": { "total": 23, "valid": 23 }, "wp:main": { "total": 44, "valid": 44, "rank": 66 } }, "wp:functions": { "memcpy": { "memcpy_loop_invariant_no_eva_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 55 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 55 } }, "memcpy_loop_invariant_no_eva": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 14 }, "wp:main": { "total": 2, "valid": 2, "rank": 14 } }, "memcpy_loop_variant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 14 } }, "memcpy_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "memcpy_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 19 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 19 } }, "memcpy_ensures_result_ptr": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "memcpy_ensures_copied_contents": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 40 }, "wp:main": { "total": 1, "valid": 1, "rank": 40 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 6, "rank": 55 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 12, "valid": 12, "rank": 55 } } }, "memmove": { "memmove_loop_invariant_no_eva_6": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 66 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 66 } }, "memmove_loop_invariant_no_eva_5": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 58 }, "wp:main": { "total": 2, "valid": 2, "rank": 58 } }, "memmove_loop_invariant_no_eva_4": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 17 }, "wp:main": { "total": 2, "valid": 2, "rank": 17 } }, "memmove_loop_invariant_no_eva_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 60 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 60 } }, "memmove_loop_invariant_no_eva_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 50 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 50 } }, "memmove_loop_invariant_no_eva": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 16 }, "wp:main": { "total": 2, "valid": 2, "rank": 16 } }, "memmove_loop_variant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 16 } }, "memmove_loop_variant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 16 } }, "memmove_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 8, "valid": 8, "rank": 5 } }, "memmove_loop_assigns_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 29 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 29 } }, "memmove_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 26 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 26 } }, "memmove_ensures_result_ptr": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "memmove_ensures_copied_contents": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 52 }, "wp:main": { "total": 1, "valid": 1, "rank": 52 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 15, "valid": 15, "rank": 66 }, "qed": { "total": 17, "valid": 17 }, "wp:main": { "total": 32, "valid": 32, "rank": 66 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025515� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026560� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/1fd19b1624fc53b9912d6f0ad221ec6f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/1fd19b1620000666�0000000�0000000�00000000126�13571573400�027721� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.049, "steps": 73 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/22ae9e720aa18673fde1bf5bf44f6cf7.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/22ae9e7200000666�0000000�0000000�00000000127�13571573400�027723� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0449, "steps": 65 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/37a769467fe16bd6c8e51bb795925ac2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/37a7694670000666�0000000�0000000�00000000127�13571573400�027604� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0241, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/3e3d4cc5ad35a080a3177a7f3ec258cc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/3e3d4cc5a0000666�0000000�0000000�00000000127�13571573400�030061� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0428, "steps": 57 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/475f43b5141cacef63a9fb29fc1cac5a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/475f43b510000666�0000000�0000000�00000000126�13571573400�027646� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.44, "steps": 584 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/562405020562c12a637e0806e8d2e002.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/5624050200000666�0000000�0000000�00000000130�13571573400�027464� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.3172, "steps": 322 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/62b32135ad2a3cac5d9211c8315c186d.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/62b32135a0000666�0000000�0000000�00000000127�13571573400�027633� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0446, "steps": 66 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/7ae2466dd8effcacd1b09685243d30ac.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/7ae2466dd0000666�0000000�0000000�00000000127�13571573400�030011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0421, "steps": 58 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/81cd25cebf3da9202e88c41378ec816b.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/81cd25ceb0000666�0000000�0000000�00000000127�13571573400�030063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0304, "steps": 34 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/8630b9236946264d9694e22731dbc58e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/8630b92360000666�0000000�0000000�00000000126�13571573400�027570� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.033, "steps": 45 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/8f1f07fefdcb2da5edaeb9947c3c94fa.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/8f1f07fef0000666�0000000�0000000�00000000130�13571573400�030071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1142, "steps": 173 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/959df566ba7701627b29205476f394dd.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/959df566b0000666�0000000�0000000�00000000127�13571573400�027746� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0453, "steps": 66 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/9eadc2bb4dfac638f224938d4827c98a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/9eadc2bb40000666�0000000�0000000�00000000130�13571573400�030134� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1016, "steps": 149 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/a408ee78b5aa14b900f8f4743c80c30f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/a408ee78b0000666�0000000�0000000�00000000127�13571573400�030012� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.789, "steps": 792 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/a6915fd039c2b41b75325a7a38af7922.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/a6915fd030000666�0000000�0000000�00000000130�13571573400�027717� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.7625, "steps": 832 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/c4a259dc1139cea44a64d59453d32ca8.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/c4a259dc10000666�0000000�0000000�00000000130�13571573400�027774� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.035, "steps": 1149 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/cfcb0b08ce7db18fba2ef14e3337c69c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/cfcb0b08c0000666�0000000�0000000�00000000130�13571573400�030127� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1327, "steps": 240 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/d458cf258c73a8c5e326b88ee299af29.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/d458cf2580000666�0000000�0000000�00000000130�13571573400�027731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.5189, "steps": 517 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/ecd44ac349286d334751a465a5cff5c2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/ecd44ac340000666�0000000�0000000�00000000130�13571573400�030053� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.6816, "steps": 695 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/f75bb0be87eb031e88d999b77f9192b5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/f75bb0be80000666�0000000�0000000�00000000127�13571573400�030067� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0691, "steps": 92 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/fa932219f75871937a0bf5a2463c35fa.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.0.session/cache/fa932219f0000666�0000000�0000000�00000000127�13571573400�027731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0417, "steps": 66 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.c.0.report.json����������0000666�0000000�0000000�00000035573�13571573400�026476� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 21, "valid": 21, "rank": 81 }, "qed": { "total": 23, "valid": 23 }, "wp:main": { "total": 44, "valid": 44, "rank": 81 } }, "wp:functions": { "memcpy": { "memcpy_loop_invariant_no_eva_2": { "alt-ergo": { "total": 1, "valid": 1, "rank": 62 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 62 } }, "memcpy_loop_invariant_no_eva": { "alt-ergo": { "total": 2, "valid": 2, "rank": 16 }, "wp:main": { "total": 2, "valid": 2, "rank": 16 } }, "memcpy_loop_variant": { "alt-ergo": { "total": 1, "valid": 1, "rank": 16 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 16 } }, "memcpy_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "memcpy_loop_assigns": { "alt-ergo": { "total": 1, "valid": 1, "rank": 43 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 43 } }, "memcpy_ensures_result_ptr": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "memcpy_ensures_copied_contents": { "alt-ergo": { "total": 1, "valid": 1, "rank": 48 }, "wp:main": { "total": 1, "valid": 1, "rank": 48 } }, "wp:section": { "alt-ergo": { "total": 6, "valid": 6, "rank": 62 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 12, "valid": 12, "rank": 62 } } }, "memmove": { "memmove_loop_invariant_no_eva_6": { "alt-ergo": { "total": 1, "valid": 1, "rank": 54 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 54 } }, "memmove_loop_invariant_no_eva_5": { "alt-ergo": { "total": 2, "valid": 2, "rank": 39 }, "wp:main": { "total": 2, "valid": 2, "rank": 39 } }, "memmove_loop_invariant_no_eva_4": { "alt-ergo": { "total": 2, "valid": 2, "rank": 18 }, "wp:main": { "total": 2, "valid": 2, "rank": 18 } }, "memmove_loop_invariant_no_eva_3": { "alt-ergo": { "total": 1, "valid": 1, "rank": 81 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 81 } }, "memmove_loop_invariant_no_eva_2": { "alt-ergo": { "total": 1, "valid": 1, "rank": 38 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 38 } }, "memmove_loop_invariant_no_eva": { "alt-ergo": { "total": 2, "valid": 2, "rank": 18 }, "wp:main": { "total": 2, "valid": 2, "rank": 18 } }, "memmove_loop_variant_2": { "alt-ergo": { "total": 1, "valid": 1, "rank": 18 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 18 } }, "memmove_loop_variant": { "alt-ergo": { "total": 1, "valid": 1, "rank": 18 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 18 } }, "memmove_assigns": { "alt-ergo": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 8, "valid": 8, "rank": 6 } }, "memmove_loop_assigns_2": { "alt-ergo": { "total": 1, "valid": 1, "rank": 48 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 48 } }, "memmove_loop_assigns": { "alt-ergo": { "total": 1, "valid": 1, "rank": 57 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 57 } }, "memmove_ensures_result_ptr": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "memmove_ensures_copied_contents": { "alt-ergo": { "total": 1, "valid": 1, "rank": 63 }, "wp:main": { "total": 1, "valid": 1, "rank": 63 } }, "wp:section": { "alt-ergo": { "total": 15, "valid": 15, "rank": 81 }, "qed": { "total": 17, "valid": 17 }, "wp:main": { "total": 32, "valid": 32, "rank": 81 } } } } } �������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/string_c.res.oracle���������������0000666�0000000�0000000�00000007266�13571573400�025667� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 120 -wp-steps 2500 [...] [kernel] Parsing tests/wp_plugin/string_c.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 44 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_ensures_copied_contents : Valid [wp] [Qed] Goal typed_memcpy_ensures_result_ptr : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_loop_invariant_no_eva_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_loop_invariant_no_eva_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_loop_invariant_no_eva_2_preserved : Valid [wp] [Qed] Goal typed_memcpy_loop_invariant_no_eva_2_established : Valid [wp] [Qed] Goal typed_memcpy_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_memcpy_loop_assigns_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_loop_assigns_part3 : Valid [wp] [Qed] Goal typed_memcpy_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_loop_variant_decrease : Valid [wp] [Qed] Goal typed_memcpy_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_ensures_copied_contents : Valid [wp] [Qed] Goal typed_memmove_ensures_result_ptr : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_invariant_no_eva_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_invariant_no_eva_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_invariant_no_eva_2_preserved : Valid [wp] [Qed] Goal typed_memmove_loop_invariant_no_eva_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_invariant_no_eva_3_preserved : Valid [wp] [Qed] Goal typed_memmove_loop_invariant_no_eva_3_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_invariant_no_eva_4_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_invariant_no_eva_4_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_invariant_no_eva_5_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_invariant_no_eva_5_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_invariant_no_eva_6_preserved : Valid [wp] [Qed] Goal typed_memmove_loop_invariant_no_eva_6_established : Valid [wp] [Qed] Goal typed_memmove_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_memmove_loop_assigns_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_assigns_part3 : Valid [wp] [Qed] Goal typed_memmove_loop_assigns_2_part1 : Valid [wp] [Qed] Goal typed_memmove_loop_assigns_2_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_assigns_2_part3 : Valid [wp] [Qed] Goal typed_memmove_assigns_exit : Valid [wp] [Qed] Goal typed_memmove_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_memmove_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_memmove_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_memmove_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_memmove_assigns_normal_part5 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_assigns_normal_part6 : Valid [wp] [Qed] Goal typed_memmove_assigns_normal_part7 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_variant_decrease : Valid [wp] [Qed] Goal typed_memmove_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memmove_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_memmove_loop_variant_2_positive : Valid [wp] Proved goals: 44 / 44 Qed: 23 Alt-Ergo 2.0.0: 21 [wp] Report in: 'tests/wp_plugin/oracle_qualif/string_c.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/string_c.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success memcpy 6 6 (640..736) 12 100% memmove 17 15 (1024..1216) 32 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct.i.0.report.json������������0000666�0000000�0000000�00000014205�13571573400�026205� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 18, "valid": 18 }, "wp:main": { "total": 18, "valid": 18 } }, "wp:functions": { "id": { "id_ensures_qed_ok_P2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "id_ensures_qed_ok_P1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "g": { "g_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_ensures_qed_ok_P5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_ensures_qed_ok_P4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_ensures_qed_ok_P3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 4, "valid": 4 } } }, "f": { "f_ensures_qed_ok_E11": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E10": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E9": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E8": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E7": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_qed_ok_E0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 12, "valid": 12 }, "wp:main": { "total": 12, "valid": 12 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct.res.oracle�����������������0000666�0000000�0000000�00000003153�13571573400�025372� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/struct.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 18 goals scheduled [wp] [Qed] Goal typed_f_ensures_qed_ok_E0 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E1 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E2 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E3 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E4 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E5 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E6 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E7 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E8 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E9 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E10 : Valid [wp] [Qed] Goal typed_f_ensures_qed_ok_E11 : Valid [wp] [Qed] Goal typed_g_ensures_qed_ok_P3 : Valid [wp] [Qed] Goal typed_g_ensures_qed_ok_P4 : Valid [wp] [Qed] Goal typed_g_ensures_qed_ok_P5 : Valid [wp] [Qed] Goal typed_g_assigns : Valid [wp] [Qed] Goal typed_id_ensures_qed_ok_P1 : Valid [wp] [Qed] Goal typed_id_ensures_qed_ok_P2 : Valid [wp] Proved goals: 18 / 18 Qed: 18 [wp] Report in: 'tests/wp_plugin/oracle_qualif/struct.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/struct.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success id 2 - 2 100% g 4 - 4 100% f 12 - 12 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026217� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027262� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/cache/03e9d9aea4caaaea78ebc830b62d8073.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/cache/03e9d90000666�0000000�0000000�00000000126�13571573400�030121� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.026, "steps": 22 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/cache/2df753a0bc45f4676e4c82cfa17ff8c2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/cache/2df7530000666�0000000�0000000�00000000127�13571573400�030117� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0291, "steps": 24 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/cache/b618ebdd987075885732173edc4f11fd.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/cache/b618eb0000666�0000000�0000000�00000000127�13571573400�030174� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0178, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/cache/b6842d965f810481a95fe4d330575379.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.0.session/cache/b6842d0000666�0000000�0000000�00000000127�13571573400�030116� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0176, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.i.0.report.json�������0000666�0000000�0000000�00000010261�13571573400�027171� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 4, "rank": 6 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 10, "valid": 10, "rank": 6 } }, "wp:functions": { "f0": { "f0_assert_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "f0_loop_invariant_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "f0_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 6 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 5, "valid": 5, "rank": 6 } } }, "f1": { "f1_assert_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "f1_loop_invariant_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "f1_loop_variant": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 5, "valid": 5, "rank": 4 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/struct_hack.res.oracle������������0000666�0000000�0000000�00000003303�13571573400�026355� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/struct_hack.i (no preprocessing) [kernel] tests/wp_plugin/struct_hack.i:46: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/struct_hack.i:37: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp_plugin/struct_hack.i:53: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 10 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f0_loop_invariant_qed_ok_preserved : Valid [wp] [Qed] Goal typed_f0_loop_invariant_qed_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f0_assert_qed_ok : Valid [wp] [Qed] Goal typed_f0_loop_variant_decrease : Valid [wp] [Qed] Goal typed_f0_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f1_loop_invariant_qed_ok_preserved : Valid [wp] [Qed] Goal typed_f1_loop_invariant_qed_ok_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f1_assert_qed_ok : Valid [wp] [Qed] Goal typed_f1_loop_variant_decrease : Valid [wp] [Qed] Goal typed_f1_loop_variant_positive : Valid [wp] Proved goals: 10 / 10 Qed: 6 Alt-Ergo 2.0.0: 4 [wp] Report in: 'tests/wp_plugin/oracle_qualif/struct_hack.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/struct_hack.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f0 3 2 (20..32) 5 100% f1 3 2 (12..24) 5 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset.0.report.json��������������0000666�0000000�0000000�00000002070�13571573400�025734� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 22 } }, "wp:functions": { "mem": { "mem_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 22 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 22 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�025212� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�026255� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset.0.session/cache/ef25e4fbee039799ba168684b032c1d6.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset.0.session/cache/ef25e4fbee00000666�0000000�0000000�00000000130�13571573400�030066� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0486, "steps": 118 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset.i.0.report.json������������0000666�0000000�0000000�00000002070�13571573400�026163� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 22 } }, "wp:functions": { "mem": { "mem_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 22 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 22 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset.res.oracle�����������������0000666�0000000�0000000�00000001305�13571573400�025350� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/subset.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_mem_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/subset.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/subset.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success mem - 1 (104..128) 1 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset_fopen.0.report.json��������0000666�0000000�0000000�00000004772�13571573400�027136� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 20 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 5, "valid": 4, "unknown": 1, "rank": 20 } }, "wp:functions": { "f": { "f_assert_Ok_E": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 20 }, "wp:main": { "total": 1, "valid": 1, "rank": 20 } }, "f_assert_Ok_D": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_Ok_C": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_Ok_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_Ok_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 20 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 5, "valid": 4, "unknown": 1, "rank": 20 } } } } } ������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset_fopen.0.session/�����������0000777�0000000�0000000�00000000000�13571573400�026401� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset_fopen.0.session/cache/�����0000777�0000000�0000000�00000000000�13571573400�027444� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset_fopen.0.session/cache/cb73f123a1cf6b187a7bd5666229a6c3.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset_fopen.0.session/cache/cb73f0000666�0000000�0000000�00000000107�13571573400�030271� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset_fopen.0.session/cache/e8364b07184fcc0b90ff66af1cab0d63.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset_fopen.0.session/cache/e83640000666�0000000�0000000�00000000127�13571573400�030140� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0661, "steps": 99 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset_fopen.c.0.report.json������0000666�0000000�0000000�00000004772�13571573400�027357� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 20 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 5, "valid": 4, "unknown": 1, "rank": 20 } }, "wp:functions": { "f": { "f_assert_Ok_E": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 20 }, "wp:main": { "total": 1, "valid": 1, "rank": 20 } }, "f_assert_Ok_D": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_Ok_C": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_Ok_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_Ok_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 20 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 5, "valid": 4, "unknown": 1, "rank": 20 } } } } } ������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/subset_fopen.res.oracle�����������0000666�0000000�0000000�00000001653�13571573400�026545� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/subset_fopen.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 5 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_Ok_A : Unsuccess [wp] [Qed] Goal typed_f_assert_Ok_B : Valid [wp] [Qed] Goal typed_f_assert_Ok_C : Valid [wp] [Qed] Goal typed_f_assert_Ok_D : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_Ok_E : Valid [wp] Proved goals: 4 / 5 Qed: 3 Alt-Ergo 2.0.0: 1 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/subset_fopen.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/subset_fopen.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 3 1 (88..112) 5 80.0% ------------------------------------------------------------- �������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.0.session/�������������������0000777�0000000�0000000�00000000000�13571573400�024652� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.0.session/cache/�������������0000777�0000000�0000000�00000000000�13571573400�025715� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.0.session/cache/9cac4e4c5ad2ba362cbff297e7e3f513.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.0.session/cache/9cac4e4c5ad2b0000666�0000000�0000000�00000000127�13571573400�027755� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0239, "steps": 47 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.0.session/cache/9fb4615e03fde8c0009bb7471774ef0b.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.0.session/cache/9fb4615e03fde0000666�0000000�0000000�00000000107�13571573400�027625� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000175�00000000000�007776� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.0.session/cache/b357f70199b976ad18756d76b6b46f96.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.0.session/cache/b357f70199b970000666�0000000�0000000�00000000127�13571573400�027422� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0242, "steps": 44 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.i.0.report.json��������������0000666�0000000�0000000�00000005503�13571573400�025627� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 2, "unknown": 1, "rank": 11 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 4, "valid": 3, "unknown": 1, "rank": 11 } }, "wp:functions": { "foo": { "fconcat_requires_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "foo_assert_qed_ok_B": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "foo_assert_qed_ok_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "wp:main": { "total": 1, "valid": 1, "rank": 11 } }, "foo_assert_qed_ok_S": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 11 }, "wp:main": { "total": 1, "valid": 1, "rank": 11 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 2, "unknown": 1, "rank": 11 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 4, "valid": 3, "unknown": 1, "rank": 11 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/trig.res.oracle�������������������0000666�0000000�0000000�00000001625�13571573400�025015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/trig.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_foo_assert_qed_ok_S : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_foo_assert_qed_ok_A : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_foo_assert_qed_ok_B : Unsuccess [wp] [Qed] Goal typed_foo_call_fconcat_requires_qed_ok : Valid [wp] Proved goals: 3 / 4 Qed: 1 Alt-Ergo 2.0.0: 2 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/trig.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/trig.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo 1 2 (40..52) 4 75.0% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unroll.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�025220� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unroll.0.session/script/����������0000777�0000000�0000000�00000000000�13571573400�026524� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unroll.0.session/script/typed_unrolled_loop_ensures_zero.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unroll.0.session/script/typed_unro0000666�0000000�0000000�00000011340�13571573400�030636� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "header": "Definition", "tactic": "Wp.unfold", "params": {}, "select": { "select": "clause-goal", "target": "(P_zeroed\n Mint_37[(shift_uint32 t_2 0)->0][(shift_uint32 t_2 1)->0]\n [(shift_uint32 t_2 2)->0][(shift_uint32 t_2 3)->0][(shift_uint32 t_2 4)\n ->0][(shift_uint32 t_2 5)->0][(shift_uint32 t_2 6)->0]\n [(shift_uint32 t_2 7)->0][(shift_uint32 t_2 8)->0][(shift_uint32 t_2 9)\n ->0][(shift_uint32 t_2 10)->0][(shift_uint32 t_2 11)->0]\n [(shift_uint32 t_2 12)->0][(shift_uint32 t_2 13)->0]\n [(shift_uint32 t_2 14)->0][(shift_uint32 t_2 15)->0] t_2 0 15)", "pattern": "P_zeroed[=]$t015[=]shift_uint320" }, "children": { "Unfold 'P_zeroed'": [ { "header": "Range", "tactic": "Wp.range", "params": { "inf": 0, "sup": 15 }, "select": { "select": "inside-goal", "occur": 0, "target": "i_0", "pattern": "$i" }, "children": { "Lower 0": [ { "prover": "qed", "verdict": "valid" } ], "Value 0": [ { "prover": "qed", "verdict": "valid" } ], "Value 1": [ { "prover": "qed", "verdict": "valid" } ], "Value 2": [ { "prover": "qed", "verdict": "valid" } ], "Value 3": [ { "prover": "qed", "verdict": "valid" } ], "Value 4": [ { "prover": "qed", "verdict": "valid" } ], "Value 5": [ { "prover": "qed", "verdict": "valid" } ], "Value 6": [ { "prover": "qed", "verdict": "valid" } ], "Value 7": [ { "prover": "qed", "verdict": "valid" } ], "Value 8": [ { "prover": "qed", "verdict": "valid" } ], "Value 9": [ { "prover": "qed", "verdict": "valid" } ], "Value 10": [ { "prover": "qed", "verdict": "valid" } ], "Value 11": [ { "prover": "qed", "verdict": "valid" } ], "Value 12": [ { "prover": "qed", "verdict": "valid" } ], "Value 13": [ { "prover": "qed", "verdict": "valid" } ], "Value 14": [ { "prover": "qed", "verdict": "valid" } ], "Value 15": [ { "prover": "qed", "verdict": "valid" } ], "Upper 15": [ { "prover": "qed", "verdict": "valid" } ] } } ] } } ] ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unroll.res.oracle�����������������0000666�0000000�0000000�00000001456�13571573400�025365� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unroll.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/unroll.i:20: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 1 goal scheduled [wp] [Tactical] Goal typed_unrolled_loop_ensures_zero : Valid [wp] Proved goals: 1 / 1 Qed: 0 Script: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/unroll.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/unroll.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success unrolled_loop - - 1 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsafe-arrays.0.report.json�������0000666�0000000�0000000�00000003340�13571573400�027210� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 5 } }, "wp:functions": { "f": { "f_ensures_INDIRP": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "f_ensures_STRUCT": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_ARRAYS": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 5 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsafe-arrays.0.session/����������0000777�0000000�0000000�00000000000�13571573400�026465� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsafe-arrays.0.session/cache/����0000777�0000000�0000000�00000000000�13571573400�027530� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000206�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsafe-arrays.0.session/cache/289db7d0541622b954c4cae7878c6f7b.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsafe-arrays.0.session/cache/289d0000666�0000000�0000000�00000000127�13571573400�030141� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0144, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsafe-arrays.i.0.report.json�����0000666�0000000�0000000�00000003276�13571573400�027447� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 5 } }, "wp:functions": { "f": { "f_ensures_INDIRP": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "f_ensures_STRUCT": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_ARRAYS": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 5 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsafe-arrays.res.oracle����������0000666�0000000�0000000�00000001476�13571573400�026634� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unsafe-arrays.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_f_ensures_ARRAYS : Valid [wp] [Qed] Goal typed_f_ensures_STRUCT : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_INDIRP : Valid [wp] Proved goals: 3 / 3 Qed: 2 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/unsafe-arrays.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/unsafe-arrays.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 2 1 (16..28) 3 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025521� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026564� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.0.session/cache/19c802b07f6d4113a2f12322c0298dfe.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.0.session/cache/19c802b070000666�0000000�0000000�00000000127�13571573400�027646� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0149, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.0.session/cache/66834a034e1789cc5e9adf1ea0729786.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.0.session/cache/66834a0340000666�0000000�0000000�00000000127�13571573400�027571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0153, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.0.session/script/��������0000777�0000000�0000000�00000000000�13571573400�027025� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000161�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.0.session/script/typed_lemma_U32.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.0.session/script/typed_le0000666�0000000�0000000�00000004736�13571573400�030567� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "header": "Bitwise Eq.", "tactic": "Wp.bitwised", "params": { "Wp.bitwised.range": 32 }, "select": { "select": "inside-goal", "occur": 0, "target": "(land 4294967295 x_0)=x_0", "pattern": "=land$x4294967295$x" }, "children": { "range": [ { "header": "Split", "tactic": "Wp.split", "params": {}, "select": { "select": "clause-goal", "target": "(0<=x_0) /\\ (0<=(land 4294967295 x_0)) /\\ (x_0<=4294967295)", "pattern": "&<=<=<=0$x0land$x42949672954294967295" }, "children": { "Goal 1/3": [ { "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0103, "steps": 10 } ], "Goal 2/3": [ { "header": "Bit Range", "tactic": "Wp.bitrange", "params": { "positive-land": true, "positive-lor": true }, "select": { "select": "clause-goal", "target": "0<=(land 4294967295 x_0)", "pattern": "<=0land4294967295$x" }, "children": { "bit-range": [ { "prover": "qed", "verdict": "valid" } ] } } ], "Goal 3/3": [ { "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0105, "steps": 10 } ] } } ], "bitwise": [ { "prover": "qed", "verdict": "valid" } ] } } ] ����������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.i.0.report.json����������0000666�0000000�0000000�00000001602�13571573400�026472� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "script": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:axiomatics": { "": { "lemma_U32": { "script": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "script": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } } } } } ������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsigned.res.oracle���������������0000666�0000000�0000000�00000001236�13571573400�025662� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unsigned.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 1 goal scheduled [wp] [Tactical] Goal typed_lemma_U32 : Valid [wp] Proved goals: 1 / 1 Qed: 0 Script: 1 [wp] Report in: 'tests/wp_plugin/oracle_qualif/unsigned.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/unsigned.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - - (4..16) 1 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsupported_init.0.report.json����0000666�0000000�0000000�00000002224�13571573400�030043� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "wp:functions": { "f": { "cp_requires_r1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_assert_a1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsupported_init.0.session/�������0000777�0000000�0000000�00000000000�13571573400�027320� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsupported_init.0.session/cache/�0000777�0000000�0000000�00000000000�13571573400�030363� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsupported_init.0.session/cache/863155426862d4055826840722d6b345.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsupported_init.0.session/cache/80000666�0000000�0000000�00000000072�13571573400�030454� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsupported_init.i.0.report.json��0000666�0000000�0000000�00000002163�13571573400�030274� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "wp:functions": { "f": { "cp_requires_r1": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_assert_a1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/oracle_qualif/unsupported_init.res.oracle�������0000666�0000000�0000000�00000001725�13571573400�027464� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_plugin/unsupported_init.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_plugin/unsupported_init.i:1: Warning: Allocation, initialization and danglingness not yet implemented (r1: \initialized(Y + (0 .. 99))) [wp] 2 goals scheduled [wp] [Qed] Goal typed_f_assert_a1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_call_cp_requires_r1 : Unsuccess (Degenerated) [wp] Proved goals: 1 / 2 Qed: 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_plugin/oracle_qualif/unsupported_init.0.report.json' [wp] Report out: 'tests/wp_plugin/result_qualif/unsupported_init.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 1 - 2 50.0% ------------------------------------------------------------- �������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/overarray.i�������������������������������������0000666�0000000�0000000�00000001026�13571573400�021442� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� //@ assigns p[0..9]; void g(int *p); int A[20]; /* In this test we try to over-assign parts of A via g. Remark: g shall require validity of p[0..9], which is NOT true in most cases. */ //@ assigns A[0..9]; void f1_ok(void) { g( A ); } //@ assigns A[10..19]; void f2_ok(void) { g( A + 10 ); } //@ assigns \nothing ; void f3_ok(void) { g( A + 20 ); } //@ assigns \nothing ; void f4_ok(void) { g( A - 10 ); } //@ assigns \nothing ; void f5_ko(void) { g( A + 15 ); } //@ assigns \nothing ; void f6_ko(void) { g( A - 5 ); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/overassign.i������������������������������������0000666�0000000�0000000�00000001204�13571573400�021606� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� //@ assigns p[0..9]; void g(int *p); int A[20]; int *p; /* In this test we try to over-assign parts of A via g. Remark: g shall require validity of p[0..9], which is NOT true in most cases. */ //@ requires p == A; assigns p[0..9]; void f1_ok(void) { g( p ); } //@ requires p == A; assigns p[10..19]; void f2_ok(void) { g( p + 10 ); } //@ requires p == A; assigns \nothing ; void f3_ok(void) { g( p + 20 ); } //@ requires p == A; assigns \nothing ; void f4_ok(void) { g( p - 10 ); } //@ requires p == A; assigns \nothing ; void f5_ko(void) { g( p + 15 ); } //@ requires p == A; assigns \nothing ; void f6_ko(void) { g( p - 5 ); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/params.i����������������������������������������0000666�0000000�0000000�00000000122�13571573400�020707� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /*@predicate p(double x, int y) = y;*/ /*@lemma lem : p((double) 0, (int) 1);*/ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/plet.i������������������������������������������0000666�0000000�0000000�00000000374�13571573400�020401� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ axiomatic Test { logic integer N ; predicate A ; predicate H(integer k) ; lemma GOAL: \let Hn = \forall integer i; 0 <= i < N ==> H(i) ; \let Dn = \exists integer i; 0 <= i < N && !H(i) ; (Hn ==> A) <==> (A || Dn) ; } */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/polarity.i��������������������������������������0000666�0000000�0000000�00000000106�13571573400�021271� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������//@ requires \initialized(p); void f(int *p) { //@ assert \false; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/prenex.i����������������������������������������0000666�0000000�0000000�00000001362�13571573400�020734� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-prenex */ /* run.config_qualif OPT: -wp-prenex */ /*@ requires 0 <= n && 0 <= m; ensures \result <==> ( \forall integer i; 0 <= i < n ==> \forall integer j; 0 <= j < m ==> p[i] < q[j] ); */ int diag(int *p,int n,int *q,int m) { /*@ loop invariant I: 0 <= i <= n ; loop invariant PI: \forall integer i0; 0 <= i0 < i ==> \forall integer j0; 0 <= j0 < m ==> p[i0] < q[j0]; loop assigns i; */ for (int i = 0; i<n; i++) /*@ loop invariant J: 0 <= j <= m ; loop invariant PJ: \forall integer j0; 0 <= j0 < j ==> p[i] < q[j0]; loop assigns j; */ for (int j = 0; j<m; j++) if (p[i] >= q[j]) return 0; return 1; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/removed.i���������������������������������������0000666�0000000�0000000�00000000547�13571573400�021100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif CMD: @frama-c@ -wp-share ./share -wp-msg-key no-cache-info,success-only -wp-par 1 -wp-session @PTEST_DIR@/oracle@PTEST_CONFIG@/@PTEST_NAME@.@PTEST_NUMBER@.session -wp-cache offline OPT: -eva -eva-msg-key=-summary -then -wp -then -no-eva -warn-unsigned-overflow -wp */ /* run.config DONTRUN: */ int main(int i) { return 1+i; } ���������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/repeat.c����������������������������������������0000666�0000000�0000000�00000002530�13571573400�020703� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������//@ghost int calls; /*@ axiomatic Sequence { logic \list<integer> sequence{L} reads calls; } */ #define F 1 #define G 2 #define U 9 #define N (U-1) #define CALL sequence{Here} #define CALL_PRE sequence{Pre} /*@ ensures CALL == (CALL_PRE ^ [| F |]); assigns calls; */ void f(void); /*@ ensures CALL == (CALL_PRE ^ [| G |]); assigns calls; */ void g(void); /*@ requires CALL_PRE == \Nil; ensures CALL == [| F,G,F |]; assigns calls; */ void master(void) { f(); g(); f(); } /*@ requires CALL_PRE == \Nil; ensures CALL == [| F , G |] *^ N ; assigns calls; */ void unroll(void) { /*@ loop pragma UNROLL "completely", U; */ for (int i = 0; i < N; i++) { f(); g(); } return; } /*@ requires 0 <= n ; requires CALL_PRE == \Nil; ensures CALL == [| F , G |] *^ n ; assigns calls; */ void induction(int n) { /*@ loop invariant 0 <= i <= n; loop invariant CALL == [| F , G |] *^ i; loop assigns i,calls; */ for (int i = 0; i < n; i++) { f(); g(); } return; } /*@ requires 0 <= n ; requires CALL_PRE == \Nil; ensures CALL == [| F , G |] *^ (n+1) ; assigns calls; */ void shifted(int n) { f(); /*@ loop invariant 0 <= i <= n; loop invariant CALL == ([| F , G |] *^ i ^ [| F |]); loop assigns i,calls; */ for (int i = 0; i < n; i++) { g(); f(); } g(); return; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/rte.i�������������������������������������������0000666�0000000�0000000�00000001540�13571573400�020223� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config CMD: @frama-c@ -wp -wp-prover none -wp-check -wp-share ./share -wp-msg-key shell -wp-msg-key rte OPT: -wp-rte -no-warn-invalid-bool -then -print -no-unicode OPT: -wp-rte -no-warn-signed-overflow -then -print -no-unicode OPT: -wp-rte -warn-unsigned-overflow -then -print -no-unicode OPT: -wp-rte -wp-model +nat -then -print -no-unicode OPT: -wp-rte -wp-model +nat -warn-unsigned-overflow -then -print -no-unicode OPT: -wp-no-rte -wp-model +nat OPT: -wp-rte -rte-no-mem -wp-model +nat */ /* run.config_qualif OPT: -wp-rte -warn-invalid-bool -wp-prop=rte */ //@ axiomatic Obs { predicate R(integer r); } //@ ensures R(\result); int job(int *p,int n) { return (*p += n) ; } //@ ensures R(\result); unsigned job2(unsigned a,unsigned b) { return a+b; } _Bool X; //@ ensures R(\result); int job3(void) { return X ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/sep.i�������������������������������������������0000666�0000000�0000000�00000002151�13571573400�020217� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-extern-arrays -wp-model Caveat */ /* run.config_qualif DONTRUN: No Proofs */ int a ; int b ; //HYP: none //@ ensures a == \old(a) + k; void f1_none(int k) { a += k ; } //HYP: \separated( p , &a ) //@ ensures a == \old(a) + *p; void f2_p_a(int *p) { a += *p; } //HYP: \separated( p , {&a,&b} ) //@ ensures a == b + *p; void f3_p_ab(int *p) { a = b + *p; } //HYP: \separated( p , q , {&a,&b} ) //@ ensures a == \old(a) + *p && b == \old(b) + *q ; void f4_pq_ab(int *p,int *q) { a += *p; b += *q; } //HYP: \separated( p , q ) //@ ensures *p == \old(*p) + *q; void f5_pq(int *p,int *q) { *p += *q; } //HYP: \separated( p+(..) , &a ) //@ ensures p[k] == a ; void f6_Pa(int *p,int k) { p[k] = a; } static int c ; static int d ; int * escape_addrof_d(void) { return &d; } //HYP: \separated( p , q , {&a,&d} ) because of static //@ ensures a == \old(a) + *q ; void f7_pq_ad(int *p,int *q) { c += *p; d += *q ; a += *q ; } //@ ghost int g ; //HYP: \separated( p , q , &a ) because of ghost //@ ensures a ==\old(a) + *q ; void f8_pq_a(int *p,int *q) { /*@ghost g += *p; */ a += *q ; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/sequence.i��������������������������������������0000666�0000000�0000000�00000006140�13571573400�021242� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Caveat */ /* run.config_qualif OPT: -wp -wp-model Caveat -wp-prover alt-ergo -wp-prop="-ko" OPT: -wp -wp-model Caveat -wp-prover why3:alt-ergo -wp-prop="-ko,-bug_why3" OPT: -wp -wp-model Caveat -wp-prover alt-ergo -wp-prop="ko" -wp-steps 50 */ //@ ghost int call_seq; /*@ axiomatic Call { @ logic \list<integer> call_obs{L} reads call_seq ; @ logic \list<integer> call_nil = [| |]; @ @ } @*/ /*@ assigns call_seq; ensures call_obs == (\old(call_obs) ^ [| a |]); */ void f(int a); /*@ assigns call_seq; ensures call_obs == (\old(call_obs) ^ [| b |]); */ void g(int b); //--- no calls ----------------------------------------- /*@ requires init: call_obs == \Nil; assigns call_seq; ensures ok: m1: \length (call_obs) == 0; ensures ok: m2: \length (call_obs) == \length (call_nil); ensures ok: bug_why3: n1: call_obs == \old(call_obs); ensures ok: n2: call_obs == call_nil; ensures ok: n3: call_obs == (call_nil ^ \old(call_obs) ^ \Nil); //ensures ok: n4: call_obs == (\Nil ^ \old(call_obs) ^ call_nil); ensures ok: bug_why3: n5: 0<=a ==> call_obs == (call_nil *^ a); ensures ok: bug_why3: n6: 0<=a ==> call_obs == (\old(call_obs) *^ a); ensures ok: bug_why3: n5_ok: call_obs == (call_nil *^ a); ensures ok: bug_why3: n6_ok: call_obs == (\old(call_obs) *^ a); */ void no_calls(int a) { ; } //--- sequential call --------------------------------- /*@ requires call_obs == \Nil; assigns call_seq; behavior g_called: assumes c!=0; ensures ok: o1: \length (call_obs) == 3; ensures ok: p1: call_obs == (\old(call_obs) ^ [| x, y, z |]); ensures ok: p2: call_obs == (\old(call_obs) ^ [| x |] ^ [| y |] ^ [| z |] ^ \Nil); ensures ok: p3: call_obs == (\old(call_obs) ^ [| x |] ^ \Nil ^ [| y |] ^ [| z |] ^ call_nil); behavior g_not_called: assumes c==0; ensures ok: o2: \length (call_obs) == 2; ensures ok: q1: call_obs == (\old(call_obs) ^ [| x, z |]); ensures ok: q2: call_obs == (\old(call_obs) ^ [| x |] ^ ([| y |] *^ c) ^ [| z |] ^ \Nil); ensures ok: q3: call_obs == (\old(call_obs) ^ [| x |] ^ call_nil ^ [| z |] ^ \Nil); */ void sequence(int c, int x, int y, int z) { f(x); if (c) g(y); f(z); } //--- sequential call --------------------------------- /*@ requires call_obs == \Nil; assigns call_seq; ensures ok: first: \nth(call_obs,0)==x; ensures ok: last: \nth(call_obs,\length(call_obs)-1)==z; behavior g_called: assumes n>0; ensures ok: u1: \length(call_obs) == 2 + n; ensures ok: u2: call_obs == (\old(call_obs) ^ [| x |] ^ ([| y |] *^ n) ^ [| z |]); behavior g_not_called: assumes n<=0; ensures ok: v1: \length(call_obs) == 2; ensures ok: v2: call_obs == (\old(call_obs) ^ [| x, z |]); */ void loops(int n, int x, int y, int z) { int i; f(x); /*@ loop assigns i, call_seq; loop invariant ok: id_min: 0 <= i; loop invariant ok: id_max: (0 <= n ? i <= n : i <= 0); loop invariant ok: inv: call_obs == (\at(call_obs,LoopEntry) ^ ([| y |] *^ i)) ; */ for (i=0; i<n; i++) g(y); f(z); } //--- end ------------ --------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/stmt.c������������������������������������������0000666�0000000�0000000�00000002264�13571573400�020416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -load-module report -then -report */ /* run.config_qualif OPT: -load-module report -then -report EXECNOW: LOG stmt.log LOG f.dot LOG f_default_for_stmt_2.dot LOG g.dot LOG g_default_for_stmt_11.dot @frama-c@ -no-autoload-plugins -load-module wp -wp-precond-weakening -wp -wp-model Dump -wp-out tests/wp_plugin/result_qualif -wp-cache none @PTEST_FILE@ 1> tests/wp_plugin/result_qualif/stmt.log */ /*@ ensures a > 0 ==> \result == a + b; @ ensures a <= 0 ==> \result == -1; */ int f(int a, int b) { /*@ exits \false; @ returns \result == a + b; @ ensures a <= 0; @ assigns \nothing; */ if (a > 0) return a + b; return -1; } /*@ ensures \result == a + b; */ int g(int a, int b) { /*@ exits \false; @ returns \result == a + b; @ ensures \false; @ assigns \nothing; */ return a + b; } /*@ ensures \result == (e ? a : b) ; */ int h(int e,int a,int b) { /*@ exits \false; @ ensures \false; @ assigns \nothing; @ behavior POS: @ assumes e ; @ returns \result == a; @ behavior NEG: @ assumes !e ; @ returns \result == b; */ if (e) return a; else return b; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/string_c.c��������������������������������������0000666�0000000�0000000�00000000243�13571573400�021232� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-wp-fct memcpy,memmove" */ /* run.config_qualif STDOPT: +"-wp-fct memcpy,memmove -wp-steps 2500 -wp-timeout 120" */ #include "string.c" �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/struct.i����������������������������������������0000666�0000000�0000000�00000003064�13571573400�020760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp -wp-par 1 */ /* -------------------------------------------------------------------------- */ /* --- Testing Performance of repeated access-update --- */ /* -------------------------------------------------------------------------- */ struct S { int i; int j; }; struct T { struct S a; struct S b; } q; /*@ ensures qed_ok: P1:\result.a.i == p.a.i && \result.a.j == p.a.j; @ ensures qed_ok: P2:\result.b.i == p.b.i && \result.b.j == p.b.j; @ */ struct T id(struct T p) { return p; } /*@ @ assigns qed_ok: q; @ ensures qed_ok: P3:q.a.i == p.a.i && q.a.j == p.a.j; @ ensures qed_ok: P4:q.b.i == p.b.i && q.b.j == p.b.j; @ ensures qed_ok: P5: q == p ; @ */ void g(struct T p) { q.a.i = p.a.i; q.b =p.b; q.a.j = p.a.j; } struct R { int f0 ; int f1 ; int f2 ; int f3 ; int f4 ; int f5 ; int f6 ; int f7 ; int f8 ; int f9 ; int f10 ; int f11 ; } s; /*@ ensures qed_ok: E0: s.f0 == 0 ; ensures qed_ok: E1: s.f1 == 1 ; ensures qed_ok: E2: s.f2 == 2 ; ensures qed_ok: E3: s.f3 == 3 ; ensures qed_ok: E4: s.f4 == 4 ; ensures qed_ok: E5: s.f5 == 5 ; ensures qed_ok: E6: s.f6 == 6 ; ensures qed_ok: E7: s.f7 == 7 ; ensures qed_ok: E8: s.f8 == 8 ; ensures qed_ok: E9: s.f9 == 9 ; ensures qed_ok: E10: s.f10 == 10 ; ensures qed_ok: E11: s.f11 == 11 ; */ void f (void) { s.f0 = 0 ; s.f1 = 1 ; s.f2 = 2 ; s.f3 = 3 ; s.f4 = 4 ; s.f5 = 5 ; s.f6 = 6 ; s.f7 = 7 ; s.f8 = 8 ; s.f9 = 9 ; s.f10 = 10 ; s.f11 = 11 ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/struct_hack.i�����������������������������������0000666�0000000�0000000�00000002320�13571573400�021740� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: test under construction */ /* run.config_qualif OPT: -wp -wp-par 1 -wp-prop qed_ok */ struct S { int i; int a[]; }; /*@ requires s.i >= 0 && \valid(s.a+(0..(s.i-1))); @ */ void f(struct S s) { int j; /*@ loop invariant 0 <= j <= s.i && \forall int k; 0 <= k < j ==> s.a[k] == 0; @ loop variant s.i - j; @ */ for (j = 0; j < s.i; j++) s.a[j] = 0; /*@ assert \forall int k; 0 <= k < s.i ==> s.a[k] == 0; */ } struct S0 { int i0; int *a0; }; /*@ requires s.i0 >= 0 && \valid(s.a0+(0..(s.i0-1))); @ */ void f0(struct S0 s) { int j; /*@ loop invariant qed_ok: 0 <= j <= s.i0 && \forall int k; 0 <= k < j ==> s.a0[k] == 0; @ loop variant qed_ok: s.i0 - j; @ */ for (j = 0; j < s.i0; j++) s.a0[j] = 0; /*@ assert qed_ok: \forall int k; 0 <= k < s.i0 ==> s.a0[k] == 0; */ } struct S1 { int i1; int a1[1]; }; /*@ requires s.i1 >= 0 && \valid_range(s.a1,0,s.i1-1); @ */ void f1(struct S1 s) { int j; /*@ loop invariant qed_ok: 0 <= j <= s.i1 && \forall int k; 0 <= k < j ==> s.a1[k] == 0; @ loop variant qed_ok: s.i1 - j; @ */ for (j = 0; j < s.i1; j++) s.a1[j] = 0; /*@ assert qed_ok: \forall int k; 0 <= k < s.i1 ==> s.a1[k] == 0; */ } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/subset.i����������������������������������������0000666�0000000�0000000�00000000260�13571573400�020734� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /*@ requires \base_addr(a) == \base_addr(b) ; ensures \subset(a , b + (0..n)) <==> \result ; */ int mem(int * a , int *b , int n) { return (b <= a) && (a <= b + n) ; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/subset_fopen.c����������������������������������0000666�0000000�0000000�00000001261�13571573400�022117� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* from value test tests/misc/subset.c */ #include "__fc_define_file.h" int t[10]; FILE __fc_fopen[512]; const FILE* _p__fc_fopen = __fc_fopen; /*@ assigns \result \from filename[..],mode[..], _p__fc_fopen; ensures \result==\null || (\subset(\result,&__fc_fopen[0 .. 512-1])) ; */ FILE *fopen(const char * restrict filename, const char * restrict mode); void f(int i, int j) { //@ assert Ok_A: \subset(&t[i], &t[..]); //@ assert Ok_B: !\subset(&t[0..5], &t[1..6]); //@ assert Ok_C: i >= 5 ==> !\subset(&t[i], &t[0..4]); if (i >= j) { //@ assert Ok_D: \subset(&t[0..j], &t[0..i]); } FILE* p = fopen ("bla", 0); //@ assert Ok_E: p != \null ==> \valid(p); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/trig.i������������������������������������������0000666�0000000�0000000�00000002147�13571573400�020402� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-wp-no-extensional" */ /* run.config_qualif OPT: -wp -wp-par 1 -wp-no-extensional */ typedef struct MSG { int size ; unsigned char text [65536] ; } message ; /*@ axiomatic Messages { @ logic message concat( message a , message b ); @ @ axiom cats: \forall message a,b ; @ concat(a,b).size == a.size + b.size ; @ @ axiom cat1: \forall message a,b,c ; \forall integer k ; @ c == concat(a,b) ==> @ 0 <= k < a.size ==> @ c.text[k] == a.text[k] ; @ @ axiom cat2: \forall message a,b,c ; \forall integer k ; @ (TRIGGER: c == concat(a,b)) ==> @ a.size <= k < a.size + b.size ==> @ (TRIGGER: c.text[k]) == b.text[k - a.size] ; @ @ } @ */ /*@ requires qed_ok: a.size >= 0 && b.size >= 0 ; @ ensures \result == concat(a,b) ; @ assigns \nothing ; @*/ message fconcat(message a,message b); /*@ requires a.size == 5 && b.size == 5 ; */ void foo(message a,message b) { message c = fconcat(a,b); //@ assert qed_ok: S: c.size == 10 ; //@ assert qed_ok: A: c.text[2] == a.text[2] ; //@ assert qed_ok: B: c.text[7] == b.text[2] ; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/tutorial.i��������������������������������������0000666�0000000�0000000�00000011571�13571573400�021301� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: test under construction */ /* run.config_qualif OPT: -wp -wp-par 1 -wp-prop="-qed_ko" OPT: -wp -wp-par 1 -wp-prop qed_ko -wp-steps 50 */ /* run.config DONTRUN: test under construction */ /*@ ensures qed_ok: \result==((x>y)?x:y); */ int max(int x, int y) { return (x > y) ? x : y; } /*@ ensures qed_ok: \result==((x>0)?x:-x); */ int absolue(int x) { return (x >= 0) ? x : -x; } /*@ ensures qed_ok: *x == \old(*y) && *y == \old(*x); */ void echange_valeur(int * x, int * y) { int a = *x; *x = *y; *y = a; } /*@ ensures qed_ko: x == \old(y) && y == \old(x); @*/ void echange_valeur_false(int x, int y) { int a = x; x = y; y = a; } /*@ requires a>=0 ; ensures \result == a*b; */ int produit(int a, int b) { int x = a, y = 0; /*@ loop invariant x*b+y==a*b && x>=0;*/ while (x > 0) { y += b; --x; } return (y); } /*@ requires n>=0; @ ensures (\result*\result) <= n < (\result+1)*(\result+1); @*/ int racine(int n) { int r = 0; /*@ loop invariant r*r <= n; @*/ while (n >= (r+1)*(r+1)) r = r + 1; return(r); } /*@ requires n>=0; @ ensures (\result*\result) <= n < (\result+1)*(\result+1); @*/ int racine_defaut(int n) { int r = (n/2) + 1; /*@ loop invariant ONLY_PROVED_BY_CVC3: n<(r+1)*(r+1) ;*/ while (r*r > n) --r; return(r); } /*@ inductive is_power(integer x, integer y, integer p) { @ case zero: @ \forall integer x; is_power(x, 0, 1); @ case non_zero: @ \forall integer x,y,p; is_power(x,y-1,p) ==> is_power(x,y,p*x); @ } @*/ /*@ requires b>=0 ; ensures UNSUPPORTED_INDUCTIVE_PREDICATE: is_power(a,b,\result); */ int puissance(int a, int b) { int p = 1, i = 1; /*@ loop invariant is_power(a,i-1,p) && i<=b+1; */ while (i <= b) { p *= a; ++i; } return (p); } /*@ inductive is_fibo(integer n,integer f) { case zero: is_fibo(0,0); case one: is_fibo(1,1); case other: \forall integer n,f1,f2; n>1 ==> is_fibo(n-1,f1) ==> is_fibo(n-2,f2) ==> is_fibo(n,f1+f2); } */ /*@ requires n >=0 ; ensures is_fibo(n,\result) ;*/ int fibonacci(int n) { int x = 0; int y, k, t; if (n != 0) { y = x; x = 1; k = 1; /*@ loop invariant is_fibo(k,x) && is_fibo(k-1,y) && k<=n; */ while(k<n) { t = y; y = x; x += t; ++k; } } return x; } int fact(int n) { int i = 1, f = 1; while (i <= n) { f *= i; ++i; } return (f); } /*@ requires \valid(a+(0..n-1)) && \valid(b+(0..n-1)); requires n>0; behavior same: assumes \forall integer i; 0<=i<n ==> a[i] == b[i] ; ensures \result == 1; behavior different: assumes \exists integer i; 0<=i<n && a[i] != b[i] ; ensures \result == 0; disjoint behaviors; // PROVABLE WITHOUT ARRAYS complete behaviors; // PROVABLE WITHOUT ARRAYS */ int comparer(int * a, int * b, int n) { int i = 0; /*@ loop invariant qed_ok: 0<=i<=n && \forall integer k; 0<=k<i ==> a[k]==b[k] ;*/ while (i < n) { if (a[i] != b[i]) return 0; ++i; } return 1; } /*@ requires \valid(a+(0..n-1)); ensures \forall integer i; 0<=i<n ==> a[\result]<=a[i]; */ int min_element(int * a, int n) { int i = 0, imin = i; /*@ loop invariant qed_ok: \forall integer k; 0<=k<i ==> a[imin]<=a[k]; */ while (i < n) { imin = (a[i] < a[imin] ? i : imin); ++i; } return imin; } /*@ predicate is_divisible(integer p,integer q) = \exists integer k; p==k*q; predicate pgcd(integer a,integer b,integer q) = is_divisible(a,q) && is_divisible(b,q) && \forall integer k; is_divisible(a,k) && is_divisible(b,k) ==> is_divisible(q,k); lemma pgcd_refl: \forall integer x; pgcd(x,x,x); // HOW TO PROVE IT???? lemma pgcd_minus:\forall integer x,y,k; pgcd(x,y,k)<==>pgcd(x,y-x,k);// HOW TO PROVE IT???? lemma pgcd_minus_2:\forall integer x,y,k; pgcd(x,y,k)<==>pgcd(x-y,y,k);// HOW TO PROVE IT???? */ /*@ requires a>0 && b>0; ensures pgcd(a,b,\result); // INVALID GOAL GENERATED IN THE GUI IF THE LOOP INVARIANT IS PROVED FIRST */ int pgcd(int a,int b) { int x = a, y = b; /*@ loop invariant \forall integer k; pgcd(x,y,k) ==> pgcd(a,b,k); loop variant (x-y>=0)?(x-y):(y-x); */ while (x != y) { if (x > y) x -= y; else y -= x; } return (y); } /*@ predicate is_prime(integer n) = n!=1 && \forall integer k; k>=0 ==> is_divisible(n,k) ==> k==1 || k==n; lemma div_mod: \forall integer a,b; is_divisible(a,b) <==> a%b==0; */ /*@ requires n>=0; behavior is_prime: assumes is_prime(n); ensures \result==1; behavior not_prime: assumes !is_prime(n); ensures \result==0; */ int premier (int n) { if (n<2) return 0; if (n==2) return 1; int i = 2; /*@ loop invariant \forall integer k; 2<=k<i ==> !is_divisible(n,k); loop invariant 2<=i<n; loop variant n-i;*/ while((i<=racine(n)) && (n%i != 0)) ++i; return (n%i!=0); } ���������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/unfold_assigns.i��������������������������������0000666�0000000�0000000�00000001370�13571573400�022450� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: OPT: -wp-unfold-assigns */ /* run.config_qualif DONTRUN: */ struct S { int a,b; }; //@ assigns (*p) ; void f(struct S *p); //@ assigns p->a , p->b ; void g(struct S *p); //@ assigns s->a, s->b ; void NO_UNFOLD_OK_1(struct S *s) { g(s); } //@ assigns (*s) ; void NO_UNFOLD_OK_2(struct S *s) { f(s); } //@ assigns (*s) ; void NO_UNFOLD_OK_3(struct S *s) { g(s); } //@ assigns s->a, s->b ; void NO_UNFOLD_KO(struct S *s) { f(s); } /*@ ensures \separated(p,q) ==> (*q == \old(*q)); assigns (*p) ; */ void USE_ASSIGN_UNFOLD_OK(struct S *p , struct S *q) { f(p); } /*@ ensures \separated(p,q) ==> (*q == \old(*q)); assigns p->a, p->b ; */ void USE_ASSIGN_UNFOLD_KO(struct S *p , struct S *q) { f(p); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/unroll.i����������������������������������������0000666�0000000�0000000�00000000773�13571573400�020753� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -ulevel=1 -wp-prop=@ensures */ /* run.config_qualif OPT: -ulevel=1 -wp-prop=@ensures -wp-prover script */ enum {Max = 16}; /*@ predicate zeroed (unsigned *p, integer a, integer b) = @ \forall integer k; a <= k <= b ==> p[k]==0 ; */ /*@ requires access: \valid(&t[0 .. (Max -1)]); @ assigns t[0 .. (Max -1)]; @ ensures zero: zeroed(t,0,Max-1); */ void unrolled_loop(unsigned *t){ //@ loop pragma UNROLL "completely", Max+1; for (unsigned i=0; i<Max; i++) t[i] = 0; } �����frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/unsafe-arrays.i���������������������������������0000666�0000000�0000000�00000000401�13571573400�022204� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -safe-arrays OPT: -unsafe-arrays */ struct { int f[10]; } s,*p; int a[10]; /*@ requires \valid(p); ensures ARRAYS: \valid(&a[..]); ensures STRUCT: \valid(&s.f[..]); ensures INDIRP: \valid(&p->f[..]); */ void f(void) { } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/unsigned.i��������������������������������������0000666�0000000�0000000�00000000233�13571573400�021243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: */ /* run.config_qualif OPT: -wp-prover script */ /*@ lemma U32: \forall unsigned int x; (x & ((1 << 32)-1)) == x ; */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/unsupported_init.i������������������������������0000666�0000000�0000000�00000000306�13571573400�023043� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ requires r1: \initialized(Y+(0 .. 99)); assigns X[0..99]; ensures X[0] == Y[0]; */ void cp( int *X, int *Y ); void f (int *A, int *B) { cp(B, A); /*@ assert a1: A[0] == B[0]; */ } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_plugin/volatile.i��������������������������������������0000666�0000000�0000000�00000000776�13571573400�021262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: OPT: -wp-no-volatile */ /* run.config_qualif DONTRUN: */ volatile int v ; void job_assigns(void) { v = 0; /*@ assert KO_WHEN_VOLATILE: v == 0 ; */ ; } void job_read(void) { int x = v; /*@ assert KO_WHEN_VOLATILE: x == v ; */ ; } struct st_v { int a ; int volatile v ; } sv; void job_struct(void) { sv.a = 0; if (sv.a) /*@ assert ok: dead_code: \false ; */ ; } void job_struct_assigns(struct st_v *p) { *p = sv; /*@ assert KO_WHEN_VOLATILE: *p == sv ; */ ; } ��frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017244� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/README.md���������������������������������������0000666�0000000�0000000�00000001014�13571573400�020517� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Testing WP/Region Use `./fc.sh -h|--help` to visualize the output before commiting changes. # Recommanded workflow With default configuration, put a single 'job' function in each test file. Then: 1. Run `./fc.sh test.i -r` to visualize the region graph and check the proofs 2. Run `./fc.sh test.i -u` to update the region-graph oracle (creates also the oracle directories) 3. Run `./fc.sh test.i -t` to check test is OK (eventually use `-t -show` or `-t -update`) 4. Run `./fc.sh test.i -q` to check qualif test is OK ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/annot/������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020363� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/annot/a.i���������������������������������������0000666�0000000�0000000�00000002006�13571573400�020753� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Generated by Frama-C */ struct N { double v ; int s ; }; typedef struct N *SN; struct L { int v ; int s ; }; typedef struct L *SL; struct Block { SN prm ; SN inp1 ; SN inp2 ; SN inp3 ; SN out1 ; SN out2 ; SN out3 ; SL idx1 ; SL idx2 ; SL idx3 ; SN sum ; }; typedef struct Block FB; /*@ region *fb; */ void fb_ADD(FB *fb) { (fb->out1)->v += (fb->out2)->v; (fb->out1)->s |= (fb->out2)->s; return; } /*@ region IN: \pattern{PMEM}, (fb->inp1..fb->inp3); region OUT: \pattern{PVECTOR}, (fb->out1..fb->out3); region IDX: \pattern{PVECTOR}, (fb->idx1..fb->idx3); */ void fb_SORT(FB *fb) { SN *inp = & fb->inp1; SN *out = & fb->out1; SL *idx = & fb->idx1; { int i = 0; while (i < 3) { (*(out + i))->v = (*(inp + i))->v + (fb->prm)->v; (*(out + i))->s = 0; (*(idx + i))->v = (*(inp + i))->s; (*(idx + i))->s = 0; i ++; } } (fb->sum)->v = ((fb->out1)->v + (fb->out2)->v) + (fb->out3)->v; (fb->sum)->s = 0; return; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/annot/b.i���������������������������������������0000666�0000000�0000000�00000002006�13571573400�020754� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Generated by Frama-C */ struct N { double v ; int s ; }; typedef struct N *SN; struct L { int v ; int s ; }; typedef struct L *SL; struct Block { SN prm ; SN inp1 ; SN inp2 ; SN inp3 ; SN out1 ; SN out2 ; SN out3 ; SL idx1 ; SL idx2 ; SL idx3 ; SN sum ; }; typedef struct Block FB; /*@ region *fb; */ void fb_ADD(FB *fb) { (fb->out1)->v += (fb->out2)->v; (fb->out1)->s |= (fb->out2)->s; return; } /*@ region IN: \pattern{PMEM}, (fb->inp1..fb->inp3); region OUT: \pattern{PVECTOR}, (fb->out1..fb->out3); region IDX: \pattern{PVECTOR}, (fb->idx1..fb->idx3); */ void fb_SORT(FB *fb) { SN *inp = & fb->inp1; SN *out = & fb->out1; SL *idx = & fb->idx1; { int i = 0; while (i < 3) { (*(out + i))->v = (*(inp + i))->v + (fb->prm)->v; (*(out + i))->s = 0; (*(idx + i))->v = (*(inp + i))->s; (*(idx + i))->s = 0; i ++; } } (fb->sum)->v = ((fb->out1)->v + (fb->out2)->v) + (fb->out3)->v; (fb->sum)->s = 0; return; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/annot.i�����������������������������������������0000666�0000000�0000000�00000002536�13571573400�020543� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -region-annot -print EXECNOW: @frama-c@ -region-annot -print @PTEST_DIR@/@PTEST_NAME@.i -ocode @PTEST_DIR@/@PTEST_NAME@/a.i EXECNOW: @frama-c@ -region-annot -print @PTEST_DIR@/@PTEST_NAME@/a.i -ocode @PTEST_DIR@/@PTEST_NAME@/b.i > /dev/null EXECNOW: diff @PTEST_DIR@/@PTEST_NAME@/a.i @PTEST_DIR@/@PTEST_NAME@/b.i > /dev/null */ /* run.config_qualif DONTRUN: */ // This test only checks that annotation are correctly parsed & printed typedef struct N { double v ; int s ; } *SN ; typedef struct L { int v ; int s ; } *SL ; typedef struct Block { SN prm ; SN inp1 ; SN inp2 ; SN inp3 ; SN out1 ; SN out2 ; SN out3 ; SL idx1 ; SL idx2 ; SL idx3 ; SN sum ; } FB ; //@ region *fb ; void fb_ADD(FB *fb) { fb->out1->v = fb->out1->v + fb->out2->v ; fb->out1->s = fb->out1->s | fb->out2->s ; } /*@ region IN: (fb->inp1 .. fb->inp3), \pattern{PMEM} ; region OUT: (fb->out1 .. fb->out3), \pattern{PVECTOR} ; region IDX: (fb->idx1 .. fb->idx3), \pattern{PVECTOR} ; */ void fb_SORT(FB *fb) { SN *inp = &(fb->inp1) ; SN *out = &(fb->out1) ; SL *idx = &(fb->idx1) ; for (int i = 0; i < 3; i++) { out[i]->v = inp[i]->v + fb->prm->v ; out[i]->s = 0 ; idx[i]->v = inp[i]->s ; idx[i]->s = 0 ; } fb->sum->v = fb->out1->v + fb->out2->v + fb->out3->v ; fb->sum->s = 0 ; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array1.i����������������������������������������0000666�0000000�0000000�00000000214�13571573400�020612� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������//@ region *p, *q ; int job( int n, int * p , int * q ) { int s = 0 ; for (int k = 0; k < n; k++) s += p[k] * q[k] ; return s ; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array1.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023230� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array2.i����������������������������������������0000666�0000000�0000000�00000000223�13571573400�020613� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������//@ region *p; region *q ; int job( int n, int * p , int * q ) { int s = 0 ; for (int k = 0; k < n; k++) s += p[k] * q[k] ; return s ; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array2.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023231� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array3.i����������������������������������������0000666�0000000�0000000�00000000120�13571573400�020610� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int job( int * p ) { int s = 0 ; while (!*p) { s+=*p ; p++; } return s; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array3.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023232� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array4.i����������������������������������������0000666�0000000�0000000�00000000137�13571573400�020621� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int job( int * p ) { int s = 0 ; int *q = p ; while (!*q) { s+=*q ; q++; } return s; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array4.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023233� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array5.i����������������������������������������0000666�0000000�0000000�00000000152�13571573400�020617� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int job( int * p , int * q ) { int s = 0 ; q = p ; while (!*q) { s+=*p ; p[s]; q++; } return s; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array5.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023234� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array6.i����������������������������������������0000666�0000000�0000000�00000000153�13571573400�020621� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int A[10] ; int B[20] ; int job(int k) { int s = 0 ; while (!A[k]) { s += A[k]; k++; } return s ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array6.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023235� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array7.i����������������������������������������0000666�0000000�0000000�00000000171�13571573400�020622� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int A[10] ; int B[20] ; int job(int k) { int s = 0 ; int * p = A+k ; while (!*p) { s += *p; p++; } return s ; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array7.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023236� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array8.i����������������������������������������0000666�0000000�0000000�00000000205�13571573400�020621� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int A[10] ; int B[20] ; int job(int c,int k) { int s = 0 ; int * p = (c?A:B)+k ; while (!*p) { s += *p; p++; } return s ; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/array8.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023237� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/fb_ADD.i����������������������������������������0000666�0000000�0000000�00000000600�13571573400�020451� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef struct N { double v ; int s ; } *SN ; typedef struct L { int v ; int s ; } *SL ; typedef struct Block { SN prm ; SN inp1 ; SN inp2 ; SN inp3 ; SN out1 ; SN out2 ; SN out3 ; SL idx1 ; SL idx2 ; SL idx3 ; SN sum ; } FB ; /*@ region A: fb ; */ void job(FB *fb) { fb->out1->v = fb->out1->v + fb->out2->v ; fb->out1->s = fb->out1->s | fb->out2->s ; } ��������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/fb_ADD.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023070� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/fb_SORT.i���������������������������������������0000666�0000000�0000000�00000001373�13571573400�020660� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef struct N { double v ; int s ; } *SN ; typedef struct L { int v ; int s ; } *SL ; typedef struct Block { SN prm ; SN inp1 ; SN inp2 ; SN inp3 ; SN out1 ; SN out2 ; SN out3 ; SL idx1 ; SL idx2 ; SL idx3 ; SN sum ; } FB ; /*@ region Shared: *(fb->inp1 .. fb->inp3); region IN: (fb->inp1 .. fb->inp3); region OUT: (fb->out1 .. fb->out3); region IDX: (fb->idx1 .. fb->idx3); */ void job(FB *fb) { SN *inp = &(fb->inp1) ; SN *out = &(fb->out1) ; SL *idx = &(fb->idx1) ; for (int i = 0; i < 3; i++) { out[i]->v = inp[i]->v + fb->prm->v ; out[i]->s = 0 ; idx[i]->v = inp[i]->s ; idx[i]->s = 0 ; } fb->sum->v = fb->out1->v + fb->out2->v + fb->out3->v ; fb->sum->s = 0 ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/fb_SORT.i.0.report.json�������������������������0000666�0000000�0000000�00000000005�13571573400�023267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/fc.sh�������������������������������������������0000777�0000000�0000000�00000006613�13571573400�020201� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Visualize output of WP/Region tests OPT= CMD=fc TEST="<none>" NAME="none" OPEN="none" DEFAULT="-wp-msg-key dot,chunk,roots,garbled" if type open &> /dev/null ; then OPEN=open elif type xpdf &> /dev/null ; then OPEN=xpdf elif type evince &> /dev/null ; then OPEN=evince fi while [ "$1" != "" ]; do case $1 in "-h"|"--help") echo "fc.sh [options...] <test.[ic]>" ; echo " -h,--help help and exit" ; echo " -D,--delete clean output directory and exit" ; echo " -g,--gui run in Frama-C Gui" ; echo " -r,--region visualize region graph" ; echo " -u,--update commit region graph in oracle" ; echo " -t,--test run ptests.opt on test file (or all files)" ; echo " -q,--qualif run ptests.opt with test-config qualif" ; echo " --open <cmd> opens pdf with '<cmd>'" ; echo " -k <keys> set message keys" ; echo " * any other Frama-C options" ; exit 0 ; ;; *.i) TEST=${1}; NAME=${TEST/.i/} ;; *.c) TEST=${1}; NAME=${TEST/.c/} ;; "-D"|"--delete") CMD=delete ;; "-u"|"--update") CMD=update ;; "-t"|"--test") CMD=test ;; "-q"|"--qualif") CMD=qualif ;; "-g"|"--gui") CMD=gui ;; "-r"|"--region") CMD=region ; OPT="${OPT} -wp-msg-key pdf" ;; "--open") shift ; CMD=region ; OPEN=${1} ;; "-k") shift ; CMD=region ; DEFAULT="" ; OPT="${OPT} -wp-msg-key $1" ;; *) OPT="${OPT} $1" ;; esac shift done BIN=../../../../../bin WP="-wp-region -wp-model Region -wp-fct job -wp-out result/${NAME}" case $CMD in "fc"|"region") echo "Running frama-c $TEST" $BIN/frama-c $WP $TEST $DEFAULT $OPT PDF="./result/${NAME}/region/job.pdf" if [ $CMD = region ] && [ -f $PDF ] then if [ $OPEN != none ] ; then echo "Source File:" cat $TEST $OPEN $PDF else echo "No command found for opening $PDF" echo "Use --open <cmd> option" fi fi ;; "gui") echo "Running frama-c $TEST (Gui)" $BIN/frama-c-gui $WP $TEST $OPT ;; "test") if [ $TEST == "<none>" ] then echo "Testing directory..." ( cd ../.. ; ../../../bin/ptests.opt tests/wp_region > /dev/null ) for test in *.i do name=${test/.i/} oracle=oracle/$name/region/job.dot result=result/$name/region/job.dot if [ -f $oracle ] && !( diff -q $oracle $result > /dev/null ) then echo "Diff: ./fc.sh $test -r" fi done else echo "Testing $TEST$OPT" ( cd ../.. ; ../../../bin/ptests.opt tests/wp_region/$TEST $OPT ) fi ;; "qualif") echo "Testing $TEST -config qualif$OPT" ( cd ../.. ; ../../../bin/ptests.opt tests/wp_region/$TEST -config qualif $OPT ) ;; "update") echo "Update './oracle/$NAME/region/job.dot" mkdir -p ./oracle/$NAME/region cp -f ./result/$NAME/region/job.dot ./oracle/$NAME/region/ ;; "delete") echo "Cleaning './result/$NAME'" rm -fr result/$NAME/* ;; esac ���������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/garbled.i���������������������������������������0000666�0000000�0000000�00000000077�13571573400�021022� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� float job(int *p,int *q) { return *q + *(float*)p + *p ; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/garbled.i.0.report.json�������������������������0000666�0000000�0000000�00000000005�13571573400�023431� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/index.i�����������������������������������������0000666�0000000�0000000�00000000106�13571573400�020522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int A[3][4][5] ; int job(int i,int j,int k) { return A[i][j][k]; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/index.i.0.report.json���������������������������0000666�0000000�0000000�00000000005�13571573400�023140� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/matrix.i����������������������������������������0000666�0000000�0000000�00000000273�13571573400�020724� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������void job( int cols , int rows , int ** m , int * v , int * r ) { for (int i = 0; i < rows; i++) { r[i] = 0 ; for (int j = 0; j < cols; j++) r[i] += m[i][j] * v[j] ; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/matrix.i.0.report.json��������������������������0000666�0000000�0000000�00000000005�13571573400�023335� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/�����������������������������������������0000777�0000000�0000000�00000000000�13571573400�020511� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/annot.res.oracle�������������������������0000666�0000000�0000000�00000002102�13571573400�023602� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/annot.i (no preprocessing) /* Generated by Frama-C */ struct N { double v ; int s ; }; typedef struct N *SN; struct L { int v ; int s ; }; typedef struct L *SL; struct Block { SN prm ; SN inp1 ; SN inp2 ; SN inp3 ; SN out1 ; SN out2 ; SN out3 ; SL idx1 ; SL idx2 ; SL idx3 ; SN sum ; }; typedef struct Block FB; /*@ region *fb; */ void fb_ADD(FB *fb) { (fb->out1)->v += (fb->out2)->v; (fb->out1)->s |= (fb->out2)->s; return; } /*@ region IN: \pattern{PMEM}, (fb->inp1..fb->inp3); region OUT: \pattern{PVECTOR}, (fb->out1..fb->out3); region IDX: \pattern{PVECTOR}, (fb->idx1..fb->idx3); */ void fb_SORT(FB *fb) { SN *inp = & fb->inp1; SN *out = & fb->out1; SL *idx = & fb->idx1; { int i = 0; while (i < 3) { (*(out + i))->v = (*(inp + i))->v + (fb->prm)->v; (*(out + i))->s = 0; (*(idx + i))->v = (*(inp + i))->s; (*(idx + i))->s = 0; i ++; } } (fb->sum)->v = ((fb->out1)->v + (fb->out2)->v) + (fb->out3)->v; (fb->sum)->s = 0; return; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array1/����������������������������������0000777�0000000�0000000�00000000000�13571573400�021710� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array1/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023173� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array1/region/job.dot��������������������0000666�0000000�0000000�00000004646�13571573400�024467� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="n", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="p", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="q", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="s", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; V004 [ label="k", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A004 ; A000 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _005 [ label="roots:&n", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _005; } _005 -> A000 [ arrowhead="tee" ]; _006 [ shape="record", label="Var sint32" ]; A000 -> _006:w [ arrowhead="tee" ]; A001 [ label="D", shape="oval" ]; _007 [ label="roots:&p", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _007; } _007 -> A001 [ arrowhead="tee" ]; _008 [ shape="record", label="<_p1> Ref" ]; _008:_p1 -> A005:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A001 -> _008:w [ arrowhead="tee" ]; A002 [ label="D", shape="oval" ]; _009 [ label="roots:&q", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _009; } _009 -> A002 [ arrowhead="tee" ]; _010 [ shape="record", label="<_p1> Ref" ]; _010:_p1 -> A005:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A002 -> _010:w [ arrowhead="tee" ]; A003 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _011 [ shape="record", label="Var sint32" ]; A003 -> _011:w [ arrowhead="tee" ]; A004 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _012 [ shape="record", label="Var sint32" ]; A004 -> _012:w [ arrowhead="tee" ]; A005 [ label="R[]&", shape="oval", fillcolor="orange", style="filled" ]; _013 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A005; _013; } _013 -> A005 [ arrowhead="tee" ]; _014 [ shape="record", label="Mem sint32" ]; A005 -> _014:w [ arrowhead="tee" ]; R015 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R015; A006; } R015 -> A006 ; A006 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _016 [ shape="record", label="Var sint32" ]; A006 -> _016:w [ arrowhead="tee" ]; } ������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array1.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023666� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/array1.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/array1/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array2/����������������������������������0000777�0000000�0000000�00000000000�13571573400�021711� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array2/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023174� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array2/region/job.dot��������������������0000666�0000000�0000000�00000005317�13571573400�024464� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="n", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="p", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="q", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="s", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; V004 [ label="k", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A004 ; A000 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _005 [ label="roots:&n", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _005; } _005 -> A000 [ arrowhead="tee" ]; _006 [ shape="record", label="Var sint32" ]; A000 -> _006:w [ arrowhead="tee" ]; A001 [ label="D", shape="oval" ]; _007 [ label="roots:&p", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _007; } _007 -> A001 [ arrowhead="tee" ]; _008 [ shape="record", label="<_p1> Ref" ]; _008:_p1 -> A005:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A001 -> _008:w [ arrowhead="tee" ]; A002 [ label="D", shape="oval" ]; _009 [ label="roots:&q", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _009; } _009 -> A002 [ arrowhead="tee" ]; _010 [ shape="record", label="<_p1> Ref" ]; _010:_p1 -> A006:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A002 -> _010:w [ arrowhead="tee" ]; A003 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _011 [ shape="record", label="Var sint32" ]; A003 -> _011:w [ arrowhead="tee" ]; A004 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _012 [ shape="record", label="Var sint32" ]; A004 -> _012:w [ arrowhead="tee" ]; A005 [ label="R[]", shape="oval", fillcolor="green", style="filled" ]; _013 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A005; _013; } _013 -> A005 [ arrowhead="tee" ]; _014 [ shape="record", label="Mem sint32" ]; A005 -> _014:w [ arrowhead="tee" ]; A006 [ label="R[]", shape="oval", fillcolor="green", style="filled" ]; _015 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A006; _015; } _015 -> A006 [ arrowhead="tee" ]; _016 [ shape="record", label="Mem sint32" ]; A006 -> _016:w [ arrowhead="tee" ]; R017 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R017; A007; } R017 -> A007 ; A007 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _018 [ shape="record", label="Var sint32" ]; A007 -> _018:w [ arrowhead="tee" ]; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array2.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023667� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/array2.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/array2/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array3/����������������������������������0000777�0000000�0000000�00000000000�13571573400�021712� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array3/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023175� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array3/region/job.dot��������������������0000666�0000000�0000000�00000002616�13571573400�024464� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="p", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="s", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; A000 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _002 [ label="roots:&p", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _002; } _002 -> A000 [ arrowhead="tee" ]; _003 [ shape="record", label="<_p1> Var ptr" ]; _003:_p1 -> A002:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A000 -> _003:w [ arrowhead="tee" ]; A001 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _004 [ shape="record", label="Var sint32" ]; A001 -> _004:w [ arrowhead="tee" ]; A002 [ label="R[]&", shape="oval", fillcolor="orange", style="filled" ]; _005 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _005; } _005 -> A002 [ arrowhead="tee" ]; _006 [ shape="record", label="Mem sint32" ]; A002 -> _006:w [ arrowhead="tee" ]; R007 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R007; A003; } R007 -> A003 ; A003 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _008 [ shape="record", label="Var sint32" ]; A003 -> _008:w [ arrowhead="tee" ]; } ������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array3.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023670� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/array3.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/array3/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array4/����������������������������������0000777�0000000�0000000�00000000000�13571573400�021713� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array4/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023176� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array4/region/job.dot��������������������0000666�0000000�0000000�00000003305�13571573400�024461� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="p", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="s", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="q", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; A000 [ label="D", shape="oval" ]; _003 [ label="roots:&p", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _003; } _003 -> A000 [ arrowhead="tee" ]; _004 [ shape="record", label="<_p1> Ref" ]; _004:_p1 -> A003:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A000 -> _004:w [ arrowhead="tee" ]; A001 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _005 [ shape="record", label="Var sint32" ]; A001 -> _005:w [ arrowhead="tee" ]; A002 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _006 [ shape="record", label="<_p1> Var ptr" ]; _006:_p1 -> A003:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A002 -> _006:w [ arrowhead="tee" ]; A003 [ label="R[]&", shape="oval", fillcolor="orange", style="filled" ]; _007 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A003; _007; } _007 -> A003 [ arrowhead="tee" ]; _008 [ shape="record", label="Mem sint32" ]; A003 -> _008:w [ arrowhead="tee" ]; R009 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R009; A004; } R009 -> A004 ; A004 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _010 [ shape="record", label="Var sint32" ]; A004 -> _010:w [ arrowhead="tee" ]; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array4.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023671� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/array4.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/array4/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array5/����������������������������������0000777�0000000�0000000�00000000000�13571573400�021714� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array5/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023177� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array5/region/job.dot��������������������0000666�0000000�0000000�00000004113�13571573400�024460� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="p", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="q", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="s", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="tmp", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; A000 [ label="D", shape="oval" ]; _004 [ label="roots:&p", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _004; } _004 -> A000 [ arrowhead="tee" ]; _005 [ shape="record", label="<_p1> Ref" ]; _005:_p1 -> A004:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A000 -> _005:w [ arrowhead="tee" ]; A001 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _006 [ label="roots:&q", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _006; } _006 -> A001 [ arrowhead="tee" ]; _007 [ shape="record", label="<_p1> Var ptr" ]; _007:_p1 -> A004:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A001 -> _007:w [ arrowhead="tee" ]; A002 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _008 [ shape="record", label="Var sint32" ]; A002 -> _008:w [ arrowhead="tee" ]; A003 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _009 [ shape="record", label="Var sint32" ]; A003 -> _009:w [ arrowhead="tee" ]; A004 [ label="R[]&", shape="oval", fillcolor="orange", style="filled" ]; _010 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A004; _010; } _010 -> A004 [ arrowhead="tee" ]; _011 [ shape="record", label="Mem sint32" ]; A004 -> _011:w [ arrowhead="tee" ]; R012 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R012; A005; } R012 -> A005 ; A005 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _013 [ shape="record", label="Var sint32" ]; A005 -> _013:w [ arrowhead="tee" ]; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array5.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023672� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/array5.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/array5/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array6/����������������������������������0000777�0000000�0000000�00000000000�13571573400�021715� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array6/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023200� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array6/region/job.dot��������������������0000666�0000000�0000000�00000003300�13571573400�024456� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="A", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="k", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="s", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; A000 [ label="", shape="oval" ]; _003 [ label="roots:&A", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _003; } _003 -> A000 [ arrowhead="tee" ]; _004 [ shape="record", label="<_p1> 0..319: D32[10]" ]; _004:_p1 -> A003 [ style="dotted" ]; A000 -> _004:w [ arrowhead="tee" ]; A001 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _005 [ label="roots:&k", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _005; } _005 -> A001 [ arrowhead="tee" ]; _006 [ shape="record", label="Var sint32" ]; A001 -> _006:w [ arrowhead="tee" ]; A002 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _007 [ shape="record", label="Var sint32" ]; A002 -> _007:w [ arrowhead="tee" ]; A003 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _008 [ label="roots:&A+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A003; _008; } _008 -> A003 [ arrowhead="tee" ]; _009 [ shape="record", label="Mem sint32" ]; A003 -> _009:w [ arrowhead="tee" ]; R010 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R010; A004; } R010 -> A004 ; A004 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _011 [ shape="record", label="Var sint32" ]; A004 -> _011:w [ arrowhead="tee" ]; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array6.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023673� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/array6.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/array6/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array7/����������������������������������0000777�0000000�0000000�00000000000�13571573400�021716� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array7/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023201� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array7/region/job.dot��������������������0000666�0000000�0000000�00000004026�13571573400�024465� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="A", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="k", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="s", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="p", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; A000 [ label="", shape="oval" ]; _004 [ label="roots:&A", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _004; } _004 -> A000 [ arrowhead="tee" ]; _005 [ shape="record", label="<_p1> 0..319: D32[10]" ]; _005:_p1 -> A004 [ style="dotted" ]; A000 -> _005:w [ arrowhead="tee" ]; A001 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _006 [ label="roots:&k", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _006; } _006 -> A001 [ arrowhead="tee" ]; _007 [ shape="record", label="Var sint32" ]; A001 -> _007:w [ arrowhead="tee" ]; A002 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _008 [ shape="record", label="Var sint32" ]; A002 -> _008:w [ arrowhead="tee" ]; A003 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _009 [ shape="record", label="<_p1> Var ptr" ]; _009:_p1 -> A004:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A003 -> _009:w [ arrowhead="tee" ]; A004 [ label="R[]&", shape="oval", fillcolor="orange", style="filled" ]; _010 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A004; _010; } _010 -> A004 [ arrowhead="tee" ]; _011 [ shape="record", label="Mem sint32" ]; A004 -> _011:w [ arrowhead="tee" ]; R012 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R012; A005; } R012 -> A005 ; A005 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _013 [ shape="record", label="Var sint32" ]; A005 -> _013:w [ arrowhead="tee" ]; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array7.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023674� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/array7.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/array7/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array8/����������������������������������0000777�0000000�0000000�00000000000�13571573400�021717� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array8/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023202� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array8/region/job.dot��������������������0000666�0000000�0000000�00000005035�13571573400�024467� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="A", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="B", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A000 ; V002 [ label="c", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A001 ; V003 [ label="k", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A002 ; V004 [ label="s", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A003 ; V005 [ label="p", shape="cds", style="filled", fillcolor="yellow" ]; V005:e -> A004 ; V006 [ label="tmp", shape="cds", style="filled", fillcolor="yellow" ]; V006:e -> A005 ; A000 [ label="R[]&", shape="oval", fillcolor="orange", style="filled" ]; _007 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _007; } _007 -> A000 [ arrowhead="tee" ]; _008 [ shape="record", label="Mem sint32" ]; A000 -> _008:w [ arrowhead="tee" ]; A001 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _009 [ label="roots:&c", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _009; } _009 -> A001 [ arrowhead="tee" ]; _010 [ shape="record", label="Var sint32" ]; A001 -> _010:w [ arrowhead="tee" ]; A002 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _011 [ label="roots:&k", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _011; } _011 -> A002 [ arrowhead="tee" ]; _012 [ shape="record", label="Var sint32" ]; A002 -> _012:w [ arrowhead="tee" ]; A003 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _013 [ shape="record", label="Var sint32" ]; A003 -> _013:w [ arrowhead="tee" ]; A004 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _014 [ shape="record", label="<_p1> Var ptr" ]; _014:_p1 -> A000:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A004 -> _014:w [ arrowhead="tee" ]; A005 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _015 [ shape="record", label="<_p1> Var ptr" ]; _015:_p1 -> A000:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A005 -> _015:w [ arrowhead="tee" ]; R016 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R016; A006; } R016 -> A006 ; A006 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _017 [ shape="record", label="Var sint32" ]; A006 -> _017:w [ arrowhead="tee" ]; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/array8.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023675� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/array8.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/array8/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/fb_ADD/����������������������������������0000777�0000000�0000000�00000000000�13571573400�021550� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/fb_ADD/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023033� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/fb_ADD/region/job.dot��������������������0000666�0000000�0000000�00000007153�13571573400�024323� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="fb", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; A000 [ label="D", shape="oval" ]; _001 [ label="roots:&fb", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _001; } _001 -> A000 [ arrowhead="tee" ]; _002 [ shape="record", label="<_p1> Ref" ]; _002:_p1 -> A001:w [ taillabel="*", labelangle="+30", color="red" ]; A000 -> _002:w [ arrowhead="tee" ]; A001 [ label="", shape="oval" ]; _003 [ label="roots:&fb", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _003; } _003 -> A001 [ arrowhead="tee" ]; _004 [ shape="record", label="<_p1> 128..159: D32|<_p2> 160..191: D32" ]; _004:_p2 -> A003 [ style="dotted" ]; _004:_p1 -> A002 [ style="dotted" ]; A001 -> _004:w [ arrowhead="tee" ]; A002 [ label="D", shape="oval" ]; _005 [ label="roots:&fb+128", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _005; } _005 -> A002 [ arrowhead="tee" ]; _006 [ shape="record", label="<_p1> Ref" ]; _006:_p1 -> A004:w [ taillabel="*", labelangle="+30", color="red" ]; A002 -> _006:w [ arrowhead="tee" ]; A003 [ label="D", shape="oval" ]; _007 [ label="roots:&fb+160", style="filled", color="lightblue", shape="box" ]; { rank=same; A003; _007; } _007 -> A003 [ arrowhead="tee" ]; _008 [ shape="record", label="<_p1> Ref" ]; _008:_p1 -> A005:w [ taillabel="*", labelangle="+30", color="red" ]; A003 -> _008:w [ arrowhead="tee" ]; A004 [ label="", shape="oval" ]; _009 [ label="roots:&fb+128", style="filled", color="lightblue", shape="box" ]; { rank=same; A004; _009; } _009 -> A004 [ arrowhead="tee" ]; _010 [ shape="record", label="<_p1> 0..63: D64|<_p2> 64..95: D32" ]; _010:_p2 -> A007 [ style="dotted" ]; _010:_p1 -> A006 [ style="dotted" ]; A004 -> _010:w [ arrowhead="tee" ]; A005 [ label="", shape="oval" ]; _011 [ label="roots:&fb+160", style="filled", color="lightblue", shape="box" ]; { rank=same; A005; _011; } _011 -> A005 [ arrowhead="tee" ]; _012 [ shape="record", label="<_p1> 0..63: D64|<_p2> 64..95: D32" ]; _012:_p2 -> A009 [ style="dotted" ]; _012:_p1 -> A008 [ style="dotted" ]; A005 -> _012:w [ arrowhead="tee" ]; A006 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _013 [ label="roots:&fb+128", style="filled", color="lightblue", shape="box" ]; { rank=same; A006; _013; } _013 -> A006 [ arrowhead="tee" ]; _014 [ shape="record", label="Var float64" ]; A006 -> _014:w [ arrowhead="tee" ]; A007 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _015 [ label="roots:&fb+192", style="filled", color="lightblue", shape="box" ]; { rank=same; A007; _015; } _015 -> A007 [ arrowhead="tee" ]; _016 [ shape="record", label="Var sint32" ]; A007 -> _016:w [ arrowhead="tee" ]; A008 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _017 [ label="roots:&fb+160", style="filled", color="lightblue", shape="box" ]; { rank=same; A008; _017; } _017 -> A008 [ arrowhead="tee" ]; _018 [ shape="record", label="Var float64" ]; A008 -> _018:w [ arrowhead="tee" ]; A009 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _019 [ label="roots:&fb+224", style="filled", color="lightblue", shape="box" ]; { rank=same; A009; _019; } _019 -> A009 [ arrowhead="tee" ]; _020 [ shape="record", label="Var sint32" ]; A009 -> _020:w [ arrowhead="tee" ]; R021 [ label="A", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R021; A000; } R021 -> A000 ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/fb_ADD.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023526� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/fb_ADD.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/fb_ADD/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/fb_SORT/���������������������������������0000777�0000000�0000000�00000000000�13571573400�021747� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/fb_SORT/region/��������������������������0000777�0000000�0000000�00000000000�13571573400�023232� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/fb_SORT/region/job.dot�������������������0000666�0000000�0000000�00000021724�13571573400�024522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="fb", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="inp", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="out", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="idx", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; V004 [ label="i", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A004 ; A000 [ label="D", shape="oval" ]; _005 [ label="roots:&fb", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _005; } _005 -> A000 [ arrowhead="tee" ]; _006 [ shape="record", label="<_p1> Ref" ]; _006:_p1 -> A005:w [ taillabel="*", labelangle="+30", color="red" ]; A000 -> _006:w [ arrowhead="tee" ]; A001 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _007 [ shape="record", label="<_p1> Var ptr" ]; _007:_p1 -> A006:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A001 -> _007:w [ arrowhead="tee" ]; A002 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _008 [ shape="record", label="<_p1> Var ptr" ]; _008:_p1 -> A007:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A002 -> _008:w [ arrowhead="tee" ]; A003 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _009 [ shape="record", label="<_p1> Var ptr" ]; _009:_p1 -> A008:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A003 -> _009:w [ arrowhead="tee" ]; A004 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _010 [ shape="record", label="Var sint32" ]; A004 -> _010:w [ arrowhead="tee" ]; A005 [ label="", shape="oval" ]; _011 [ label="roots:&fb", style="filled", color="lightblue", shape="box" ]; { rank=same; A005; _011; } _011 -> A005 [ arrowhead="tee" ]; _012 [ shape="record", label="<_p1> 0..31: D32|<_p2> 32..127: D32[3]|<_p3> 128..223: D32[3]|<_p4> 224..319: D32[3]|<_p5> 320..351: D32" ]; _012:_p5 -> A010 [ style="dotted" ]; _012:_p4 -> A008 [ style="dotted" ]; _012:_p3 -> A007 [ style="dotted" ]; _012:_p2 -> A006 [ style="dotted" ]; _012:_p1 -> A009 [ style="dotted" ]; A005 -> _012:w [ arrowhead="tee" ]; A006 [ label="D[]&", shape="oval", fillcolor="orange", style="filled" ]; _013 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A006; _013; } _013 -> A006 [ arrowhead="tee" ]; _014 [ shape="record", label="<_p1> Ref" ]; _014:_p1 -> A011:w [ taillabel="*", labelangle="+30", color="red" ]; A006 -> _014:w [ arrowhead="tee" ]; A007 [ label="D[]&", shape="oval", fillcolor="orange", style="filled" ]; _015 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A007; _015; } _015 -> A007 [ arrowhead="tee" ]; _016 [ shape="record", label="<_p1> Ref" ]; _016:_p1 -> A012:w [ taillabel="*", labelangle="+30", color="red" ]; A007 -> _016:w [ arrowhead="tee" ]; A008 [ label="D[]&", shape="oval", fillcolor="orange", style="filled" ]; _017 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A008; _017; } _017 -> A008 [ arrowhead="tee" ]; _018 [ shape="record", label="<_p1> Ref" ]; _018:_p1 -> A013:w [ taillabel="*", labelangle="+30", color="red" ]; A008 -> _018:w [ arrowhead="tee" ]; A009 [ label="D", shape="oval" ]; _019 [ label="roots:&fb", style="filled", color="lightblue", shape="box" ]; { rank=same; A009; _019; } _019 -> A009 [ arrowhead="tee" ]; _020 [ shape="record", label="<_p1> Ref" ]; _020:_p1 -> A014:w [ taillabel="*", labelangle="+30", color="red" ]; A009 -> _020:w [ arrowhead="tee" ]; A010 [ label="D", shape="oval" ]; _021 [ label="roots:&fb+320", style="filled", color="lightblue", shape="box" ]; { rank=same; A010; _021; } _021 -> A010 [ arrowhead="tee" ]; _022 [ shape="record", label="<_p1> Ref" ]; _022:_p1 -> A015:w [ taillabel="*", labelangle="+30", color="red" ]; A010 -> _022:w [ arrowhead="tee" ]; A011 [ label="&", shape="oval", fillcolor="orange", style="filled" ]; _023 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A011; _023; } _023 -> A011 [ arrowhead="tee" ]; _024 [ shape="record", label="<_p1> 0..63: D64|<_p2> 64..95: D32" ]; _024:_p2 -> A017 [ style="dotted" ]; _024:_p1 -> A016 [ style="dotted" ]; A011 -> _024:w [ arrowhead="tee" ]; A012 [ label="", shape="oval" ]; _025 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A012; _025; } _025 -> A012 [ arrowhead="tee" ]; _026 [ shape="record", label="<_p1> 0..63: D64|<_p2> 64..95: D32" ]; _026:_p2 -> A019 [ style="dotted" ]; _026:_p1 -> A018 [ style="dotted" ]; A012 -> _026:w [ arrowhead="tee" ]; A013 [ label="", shape="oval" ]; _027 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A013; _027; } _027 -> A013 [ arrowhead="tee" ]; _028 [ shape="record", label="<_p1> 0..31: D32|<_p2> 32..63: D32" ]; _028:_p2 -> A021 [ style="dotted" ]; _028:_p1 -> A020 [ style="dotted" ]; A013 -> _028:w [ arrowhead="tee" ]; A014 [ label="", shape="oval" ]; _029 [ label="roots:&fb", style="filled", color="lightblue", shape="box" ]; { rank=same; A014; _029; } _029 -> A014 [ arrowhead="tee" ]; _030 [ shape="record", label="<_p1> 0..63: D64" ]; _030:_p1 -> A022 [ style="dotted" ]; A014 -> _030:w [ arrowhead="tee" ]; A015 [ label="", shape="oval" ]; _031 [ label="roots:&fb+320", style="filled", color="lightblue", shape="box" ]; { rank=same; A015; _031; } _031 -> A015 [ arrowhead="tee" ]; _032 [ shape="record", label="<_p1> 0..63: D64|<_p2> 64..95: D32" ]; _032:_p2 -> A024 [ style="dotted" ]; _032:_p1 -> A023 [ style="dotted" ]; A015 -> _032:w [ arrowhead="tee" ]; A016 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _033 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A016; _033; } _033 -> A016 [ arrowhead="tee" ]; _034 [ shape="record", label="Mem float64" ]; A016 -> _034:w [ arrowhead="tee" ]; A017 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _035 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A017; _035; } _035 -> A017 [ arrowhead="tee" ]; _036 [ shape="record", label="Mem sint32" ]; A017 -> _036:w [ arrowhead="tee" ]; A018 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _037 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A018; _037; } _037 -> A018 [ arrowhead="tee" ]; _038 [ shape="record", label="Mem float64" ]; A018 -> _038:w [ arrowhead="tee" ]; A019 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _039 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A019; _039; } _039 -> A019 [ arrowhead="tee" ]; _040 [ shape="record", label="Mem sint32" ]; A019 -> _040:w [ arrowhead="tee" ]; A020 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _041 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A020; _041; } _041 -> A020 [ arrowhead="tee" ]; _042 [ shape="record", label="Mem sint32" ]; A020 -> _042:w [ arrowhead="tee" ]; A021 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _043 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A021; _043; } _043 -> A021 [ arrowhead="tee" ]; _044 [ shape="record", label="Mem sint32" ]; A021 -> _044:w [ arrowhead="tee" ]; A022 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _045 [ label="roots:&fb", style="filled", color="lightblue", shape="box" ]; { rank=same; A022; _045; } _045 -> A022 [ arrowhead="tee" ]; _046 [ shape="record", label="Var float64" ]; A022 -> _046:w [ arrowhead="tee" ]; A023 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _047 [ label="roots:&fb+320", style="filled", color="lightblue", shape="box" ]; { rank=same; A023; _047; } _047 -> A023 [ arrowhead="tee" ]; _048 [ shape="record", label="Var float64" ]; A023 -> _048:w [ arrowhead="tee" ]; A024 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _049 [ label="roots:&fb+384", style="filled", color="lightblue", shape="box" ]; { rank=same; A024; _049; } _049 -> A024 [ arrowhead="tee" ]; _050 [ shape="record", label="Var sint32" ]; A024 -> _050:w [ arrowhead="tee" ]; R051 [ label="IDX", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R051; A008; } R051 -> A008 ; R052 [ label="IN", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R052; A006; } R052 -> A006 ; R053 [ label="OUT", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R053; A007; } R053 -> A007 ; R054 [ label="Shared", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R054; A011; } R054 -> A011 ; } ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/fb_SORT.res.oracle�����������������������0000666�0000000�0000000�00000000272�13571573400�023727� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/fb_SORT.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/fb_SORT/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/garbled/���������������������������������0000777�0000000�0000000�00000000000�13571573400�022111� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/garbled/region/��������������������������0000777�0000000�0000000�00000000000�13571573400�023374� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/garbled/region/job.dot�������������������0000666�0000000�0000000�00000004112�13571573400�024654� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="p", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="q", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="__retres", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; A000 [ label="D", shape="oval" ]; _003 [ label="roots:&p", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _003; } _003 -> A000 [ arrowhead="tee" ]; _004 [ shape="record", label="<_p1> Ref" ]; _004:_p1 -> A003:w [ taillabel="*", labelangle="+30", color="red" ]; A000 -> _004:w [ arrowhead="tee" ]; A001 [ label="D", shape="oval" ]; _005 [ label="roots:&q", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _005; } _005 -> A001 [ arrowhead="tee" ]; _006 [ shape="record", label="<_p1> Ref" ]; _006:_p1 -> A004:w [ taillabel="*", labelangle="+30", color="red" ]; A001 -> _006:w [ arrowhead="tee" ]; A002 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _007 [ shape="record", label="Var float32" ]; A002 -> _007:w [ arrowhead="tee" ]; A003 [ label="R", shape="oval", color="red", fillcolor="red", style="filled" ]; _008 [ label="roots:&p", style="filled", color="lightblue", shape="box" ]; { rank=same; A003; _008; } _008 -> A003 [ arrowhead="tee" ]; _009 [ shape="record", label="Raw", fillcolor="red", style="filled" ]; A003 -> _009:w [ arrowhead="tee" ]; A004 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _010 [ label="roots:&q", style="filled", color="lightblue", shape="box" ]; { rank=same; A004; _010; } _010 -> A004 [ arrowhead="tee" ]; _011 [ shape="record", label="Var sint32" ]; A004 -> _011:w [ arrowhead="tee" ]; R012 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R012; A005; } R012 -> A005 ; A005 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _013 [ shape="record", label="Var float32" ]; A005 -> _013:w [ arrowhead="tee" ]; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/garbled.res.oracle�����������������������0000666�0000000�0000000�00000000521�13571573400�024066� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/garbled.i (no preprocessing) [wp:garbled] Garbled Clusters: A=sint32 B=float32 [wp:garbled] Garbled Clusters: A=garbled B=sint32 [wp:garbled] Garbled Clusters: A=garbled B=float32 [wp] Region Graph: tests/wp_region/result/garbled/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/index/�����������������������������������0000777�0000000�0000000�00000000000�13571573400�021620� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/index/region/����������������������������0000777�0000000�0000000�00000000000�13571573400�023103� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/index/region/job.dot���������������������0000666�0000000�0000000�00000004722�13571573400�024372� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="A", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="i", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="j", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="k", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; V004 [ label="__retres", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A004 ; A000 [ label="", shape="oval" ]; _005 [ label="roots:&A", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _005; } _005 -> A000 [ arrowhead="tee" ]; _006 [ shape="record", label="<_p1> 0..1919: D32[5,4,3]" ]; _006:_p1 -> A005 [ style="dotted" ]; A000 -> _006:w [ arrowhead="tee" ]; A001 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _007 [ label="roots:&i", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _007; } _007 -> A001 [ arrowhead="tee" ]; _008 [ shape="record", label="Var sint32" ]; A001 -> _008:w [ arrowhead="tee" ]; A002 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _009 [ label="roots:&j", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _009; } _009 -> A002 [ arrowhead="tee" ]; _010 [ shape="record", label="Var sint32" ]; A002 -> _010:w [ arrowhead="tee" ]; A003 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _011 [ label="roots:&k", style="filled", color="lightblue", shape="box" ]; { rank=same; A003; _011; } _011 -> A003 [ arrowhead="tee" ]; _012 [ shape="record", label="Var sint32" ]; A003 -> _012:w [ arrowhead="tee" ]; A004 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _013 [ shape="record", label="Var sint32" ]; A004 -> _013:w [ arrowhead="tee" ]; A005 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _014 [ label="roots:&A+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A005; _014; } _014 -> A005 [ arrowhead="tee" ]; _015 [ shape="record", label="Mem sint32" ]; A005 -> _015:w [ arrowhead="tee" ]; R016 [ label="\\result", shape="tab", style="filled", fillcolor="yellow" ]; { rank=same; R016; A006; } R016 -> A006 ; A006 [ label="W", shape="oval", fillcolor="green", style="filled" ]; _017 [ shape="record", label="Var sint32" ]; A006 -> _017:w [ arrowhead="tee" ]; } ����������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/index.res.oracle�������������������������0000666�0000000�0000000�00000000266�13571573400�023603� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/index.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/index/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/matrix/����������������������������������0000777�0000000�0000000�00000000000�13571573400�022015� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/matrix/region/���������������������������0000777�0000000�0000000�00000000000�13571573400�023300� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/matrix/region/job.dot��������������������0000666�0000000�0000000�00000007650�13571573400�024572� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="cols", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="rows", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="m", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="v", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; V004 [ label="r", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A004 ; V005 [ label="i", shape="cds", style="filled", fillcolor="yellow" ]; V005:e -> A005 ; V006 [ label="j", shape="cds", style="filled", fillcolor="yellow" ]; V006:e -> A006 ; A000 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _007 [ label="roots:&cols", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _007; } _007 -> A000 [ arrowhead="tee" ]; _008 [ shape="record", label="Var sint32" ]; A000 -> _008:w [ arrowhead="tee" ]; A001 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _009 [ label="roots:&rows", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _009; } _009 -> A001 [ arrowhead="tee" ]; _010 [ shape="record", label="Var sint32" ]; A001 -> _010:w [ arrowhead="tee" ]; A002 [ label="D", shape="oval" ]; _011 [ label="roots:&m", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _011; } _011 -> A002 [ arrowhead="tee" ]; _012 [ shape="record", label="<_p1> Ref" ]; _012:_p1 -> A007:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A002 -> _012:w [ arrowhead="tee" ]; A003 [ label="D", shape="oval" ]; _013 [ label="roots:&v", style="filled", color="lightblue", shape="box" ]; { rank=same; A003; _013; } _013 -> A003 [ arrowhead="tee" ]; _014 [ shape="record", label="<_p1> Ref" ]; _014:_p1 -> A008:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A003 -> _014:w [ arrowhead="tee" ]; A004 [ label="D", shape="oval" ]; _015 [ label="roots:&r", style="filled", color="lightblue", shape="box" ]; { rank=same; A004; _015; } _015 -> A004 [ arrowhead="tee" ]; _016 [ shape="record", label="<_p1> Ref" ]; _016:_p1 -> A009:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A004 -> _016:w [ arrowhead="tee" ]; A005 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _017 [ shape="record", label="Var sint32" ]; A005 -> _017:w [ arrowhead="tee" ]; A006 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _018 [ shape="record", label="Var sint32" ]; A006 -> _018:w [ arrowhead="tee" ]; A007 [ label="D[]", shape="oval" ]; _019 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A007; _019; } _019 -> A007 [ arrowhead="tee" ]; _020 [ shape="record", label="<_p1> Ref" ]; _020:_p1 -> A010:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A007 -> _020:w [ arrowhead="tee" ]; A008 [ label="R[]", shape="oval", fillcolor="green", style="filled" ]; _021 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A008; _021; } _021 -> A008 [ arrowhead="tee" ]; _022 [ shape="record", label="Mem sint32" ]; A008 -> _022:w [ arrowhead="tee" ]; A009 [ label="RW[]", shape="oval", fillcolor="green", style="filled" ]; _023 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A009; _023; } _023 -> A009 [ arrowhead="tee" ]; _024 [ shape="record", label="Mem sint32" ]; A009 -> _024:w [ arrowhead="tee" ]; A010 [ label="R[]", shape="oval", fillcolor="green", style="filled" ]; _025 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A010; _025; } _025 -> A010 [ arrowhead="tee" ]; _026 [ shape="record", label="Mem sint32" ]; A010 -> _026:w [ arrowhead="tee" ]; } ����������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/matrix.res.oracle������������������������0000666�0000000�0000000�00000000270�13571573400�023773� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/matrix.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/matrix/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray1/����������������������������0000777�0000000�0000000�00000000000�13571573400�023155� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray1/region/���������������������0000777�0000000�0000000�00000000000�13571573400�024440� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray1/region/job.dot��������������0000666�0000000�0000000�00000006073�13571573400�025730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="M", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="X", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="R", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="i", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; V004 [ label="j", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A004 ; A000 [ label="D", shape="oval" ]; _005 [ label="roots:&M", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _005; } _005 -> A000 [ arrowhead="tee" ]; _006 [ shape="record", label="<_p1> Ref" ]; _006:_p1 -> A005:w [ taillabel="*", labelangle="+30", color="red" ]; A000 -> _006:w [ arrowhead="tee" ]; A001 [ label="D", shape="oval" ]; _007 [ label="roots:&X", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _007; } _007 -> A001 [ arrowhead="tee" ]; _008 [ shape="record", label="<_p1> Ref" ]; _008:_p1 -> A006:w [ taillabel="*", labelangle="+30", color="red" ]; A001 -> _008:w [ arrowhead="tee" ]; A002 [ label="D", shape="oval" ]; _009 [ label="roots:&R", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _009; } _009 -> A002 [ arrowhead="tee" ]; _010 [ shape="record", label="<_p1> Ref" ]; _010:_p1 -> A006:w [ taillabel="*", labelangle="+30", color="red" ]; A002 -> _010:w [ arrowhead="tee" ]; A003 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _011 [ shape="record", label="Var sint32" ]; A003 -> _011:w [ arrowhead="tee" ]; A004 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _012 [ shape="record", label="Var sint32" ]; A004 -> _012:w [ arrowhead="tee" ]; A005 [ label="", shape="oval" ]; _013 [ label="roots:&M", style="filled", color="lightblue", shape="box" ]; { rank=same; A005; _013; } _013 -> A005 [ arrowhead="tee" ]; _014 [ shape="record", label="<_p1> 0..511: D32[4,4]" ]; _014:_p1 -> A007 [ style="dotted" ]; A005 -> _014:w [ arrowhead="tee" ]; A006 [ label="&", shape="oval", fillcolor="orange", style="filled" ]; _015 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A006; _015; } _015 -> A006 [ arrowhead="tee" ]; _016 [ shape="record", label="<_p1> 0..127: D32[4]" ]; _016:_p1 -> A008 [ style="dotted" ]; A006 -> _016:w [ arrowhead="tee" ]; A007 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _017 [ label="roots:&M+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A007; _017; } _017 -> A007 [ arrowhead="tee" ]; _018 [ shape="record", label="Mem sint32" ]; A007 -> _018:w [ arrowhead="tee" ]; A008 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _019 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A008; _019; } _019 -> A008 [ arrowhead="tee" ]; _020 [ shape="record", label="Mem sint32" ]; A008 -> _020:w [ arrowhead="tee" ]; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray1.res.oracle������������������0000666�0000000�0000000�00000000304�13571573400�025131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/structarray1.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/structarray1/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray2/����������������������������0000777�0000000�0000000�00000000000�13571573400�023156� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray2/region/���������������������0000777�0000000�0000000�00000000000�13571573400�024441� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray2/region/job.dot��������������0000666�0000000�0000000�00000010236�13571573400�025725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="M", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="X", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="R", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="i", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; V004 [ label="j", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A004 ; V005 [ label="C", shape="cds", style="filled", fillcolor="yellow" ]; V005:e -> A005 ; A000 [ label="D", shape="oval" ]; _006 [ label="roots:&M", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _006; } _006 -> A000 [ arrowhead="tee" ]; _007 [ shape="record", label="<_p1> Ref" ]; _007:_p1 -> A006:w [ taillabel="*", labelangle="+30", color="red" ]; A000 -> _007:w [ arrowhead="tee" ]; A001 [ label="D", shape="oval" ]; _008 [ label="roots:&X", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _008; } _008 -> A001 [ arrowhead="tee" ]; _009 [ shape="record", label="<_p1> Ref" ]; _009:_p1 -> A007:w [ taillabel="*", labelangle="+30", color="red" ]; A001 -> _009:w [ arrowhead="tee" ]; A002 [ label="D", shape="oval" ]; _010 [ label="roots:&R", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _010; } _010 -> A002 [ arrowhead="tee" ]; _011 [ shape="record", label="<_p1> Ref" ]; _011:_p1 -> A008:w [ taillabel="*", labelangle="+30", color="red" ]; A002 -> _011:w [ arrowhead="tee" ]; A003 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _012 [ shape="record", label="Var sint32" ]; A003 -> _012:w [ arrowhead="tee" ]; A004 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _013 [ shape="record", label="Var sint32" ]; A004 -> _013:w [ arrowhead="tee" ]; A005 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _014 [ shape="record", label="<_p1> Var ptr" ]; _014:_p1 -> A009:w [ taillabel="*", labelangle="+30", color="red" ]; A005 -> _014:w [ arrowhead="tee" ]; A006 [ label="", shape="oval" ]; _015 [ label="roots:&M", style="filled", color="lightblue", shape="box" ]; { rank=same; A006; _015; } _015 -> A006 [ arrowhead="tee" ]; _016 [ shape="record", label="<_p1> 0..511: D32[4,4]" ]; _016:_p1 -> A010 [ style="dotted" ]; A006 -> _016:w [ arrowhead="tee" ]; A007 [ label="", shape="oval" ]; _017 [ label="roots:&X", style="filled", color="lightblue", shape="box" ]; { rank=same; A007; _017; } _017 -> A007 [ arrowhead="tee" ]; _018 [ shape="record", label="<_p1> 0..127: D32[4]" ]; _018:_p1 -> A011 [ style="dotted" ]; A007 -> _018:w [ arrowhead="tee" ]; A008 [ label="", shape="oval" ]; _019 [ label="roots:&R", style="filled", color="lightblue", shape="box" ]; { rank=same; A008; _019; } _019 -> A008 [ arrowhead="tee" ]; _020 [ shape="record", label="<_p1> 0..127: D32[4]" ]; _020:_p1 -> A012 [ style="dotted" ]; A008 -> _020:w [ arrowhead="tee" ]; A009 [ label="&", shape="oval", fillcolor="orange", style="filled" ]; _021 [ shape="record", label="<_p1> 0..127: D32[4]" ]; _021:_p1 -> A010 [ style="dotted" ]; A009 -> _021:w [ arrowhead="tee" ]; A010 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _022 [ label="roots:&M+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A010; _022; } _022 -> A010 [ arrowhead="tee" ]; _023 [ shape="record", label="Mem sint32" ]; A010 -> _023:w [ arrowhead="tee" ]; A011 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _024 [ label="roots:&X+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A011; _024; } _024 -> A011 [ arrowhead="tee" ]; _025 [ shape="record", label="Mem sint32" ]; A011 -> _025:w [ arrowhead="tee" ]; A012 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _026 [ label="roots:&R+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A012; _026; } _026 -> A012 [ arrowhead="tee" ]; _027 [ shape="record", label="Mem sint32" ]; A012 -> _027:w [ arrowhead="tee" ]; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray2.res.oracle������������������0000666�0000000�0000000�00000000304�13571573400�025132� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/structarray2.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/structarray2/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray3/����������������������������0000777�0000000�0000000�00000000000�13571573400�023157� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray3/region/���������������������0000777�0000000�0000000�00000000000�13571573400�024442� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray3/region/job.dot��������������0000666�0000000�0000000�00000012126�13571573400�025726� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="c", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="P", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="Q", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="X", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; V004 [ label="R", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A004 ; V005 [ label="M", shape="cds", style="filled", fillcolor="yellow" ]; V005:e -> A005 ; V006 [ label="tmp", shape="cds", style="filled", fillcolor="yellow" ]; V006:e -> A006 ; V007 [ label="i", shape="cds", style="filled", fillcolor="yellow" ]; V007:e -> A007 ; V008 [ label="j", shape="cds", style="filled", fillcolor="yellow" ]; V008:e -> A008 ; A000 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _009 [ label="roots:&c", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _009; } _009 -> A000 [ arrowhead="tee" ]; _010 [ shape="record", label="Var sint32" ]; A000 -> _010:w [ arrowhead="tee" ]; A001 [ label="D", shape="oval" ]; _011 [ label="roots:&P", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _011; } _011 -> A001 [ arrowhead="tee" ]; _012 [ shape="record", label="<_p1> Ref" ]; _012:_p1 -> A009:w [ taillabel="*", labelangle="+30", color="red" ]; A001 -> _012:w [ arrowhead="tee" ]; A002 [ label="D", shape="oval" ]; _013 [ label="roots:&Q", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _013; } _013 -> A002 [ arrowhead="tee" ]; _014 [ shape="record", label="<_p1> Ref" ]; _014:_p1 -> A009:w [ taillabel="*", labelangle="+30", color="red" ]; A002 -> _014:w [ arrowhead="tee" ]; A003 [ label="D", shape="oval" ]; _015 [ label="roots:&X", style="filled", color="lightblue", shape="box" ]; { rank=same; A003; _015; } _015 -> A003 [ arrowhead="tee" ]; _016 [ shape="record", label="<_p1> Ref" ]; _016:_p1 -> A010:w [ taillabel="*", labelangle="+30", color="red" ]; A003 -> _016:w [ arrowhead="tee" ]; A004 [ label="D", shape="oval" ]; _017 [ label="roots:&R", style="filled", color="lightblue", shape="box" ]; { rank=same; A004; _017; } _017 -> A004 [ arrowhead="tee" ]; _018 [ shape="record", label="<_p1> Ref" ]; _018:_p1 -> A011:w [ taillabel="*", labelangle="+30", color="red" ]; A004 -> _018:w [ arrowhead="tee" ]; A005 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _019 [ shape="record", label="<_p1> Var ptr" ]; _019:_p1 -> A009:w [ taillabel="*", labelangle="+30", color="red" ]; A005 -> _019:w [ arrowhead="tee" ]; A006 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _020 [ shape="record", label="<_p1> Var ptr" ]; _020:_p1 -> A009:w [ taillabel="*", labelangle="+30", color="red" ]; A006 -> _020:w [ arrowhead="tee" ]; A007 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _021 [ shape="record", label="Var sint32" ]; A007 -> _021:w [ arrowhead="tee" ]; A008 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _022 [ shape="record", label="Var sint32" ]; A008 -> _022:w [ arrowhead="tee" ]; A009 [ label="&", shape="oval", fillcolor="orange", style="filled" ]; _023 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A009; _023; } _023 -> A009 [ arrowhead="tee" ]; _024 [ shape="record", label="<_p1> 0..511: D32[4,4]" ]; _024:_p1 -> A012 [ style="dotted" ]; A009 -> _024:w [ arrowhead="tee" ]; A010 [ label="", shape="oval" ]; _025 [ label="roots:&X", style="filled", color="lightblue", shape="box" ]; { rank=same; A010; _025; } _025 -> A010 [ arrowhead="tee" ]; _026 [ shape="record", label="<_p1> 0..127: D32[4]" ]; _026:_p1 -> A013 [ style="dotted" ]; A010 -> _026:w [ arrowhead="tee" ]; A011 [ label="", shape="oval" ]; _027 [ label="roots:&R", style="filled", color="lightblue", shape="box" ]; { rank=same; A011; _027; } _027 -> A011 [ arrowhead="tee" ]; _028 [ shape="record", label="<_p1> 0..127: D32[4]" ]; _028:_p1 -> A014 [ style="dotted" ]; A011 -> _028:w [ arrowhead="tee" ]; A012 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _029 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A012; _029; } _029 -> A012 [ arrowhead="tee" ]; _030 [ shape="record", label="Mem sint32" ]; A012 -> _030:w [ arrowhead="tee" ]; A013 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _031 [ label="roots:&X+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A013; _031; } _031 -> A013 [ arrowhead="tee" ]; _032 [ shape="record", label="Mem sint32" ]; A013 -> _032:w [ arrowhead="tee" ]; A014 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _033 [ label="roots:&R+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A014; _033; } _033 -> A014 [ arrowhead="tee" ]; _034 [ shape="record", label="Mem sint32" ]; A014 -> _034:w [ arrowhead="tee" ]; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray3.res.oracle������������������0000666�0000000�0000000�00000000304�13571573400�025133� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/structarray3.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/structarray3/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray4/����������������������������0000777�0000000�0000000�00000000000�13571573400�023160� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray4/region/���������������������0000777�0000000�0000000�00000000000�13571573400�024443� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray4/region/job.dot��������������0000666�0000000�0000000�00000011517�13571573400�025732� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="M", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="X", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="R", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; V003 [ label="p", shape="cds", style="filled", fillcolor="yellow" ]; V003:e -> A003 ; V004 [ label="i", shape="cds", style="filled", fillcolor="yellow" ]; V004:e -> A004 ; V005 [ label="j", shape="cds", style="filled", fillcolor="yellow" ]; V005:e -> A005 ; V006 [ label="C", shape="cds", style="filled", fillcolor="yellow" ]; V006:e -> A006 ; A000 [ label="D", shape="oval" ]; _007 [ label="roots:&M", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _007; } _007 -> A000 [ arrowhead="tee" ]; _008 [ shape="record", label="<_p1> Ref" ]; _008:_p1 -> A007:w [ taillabel="*", labelangle="+30", color="red" ]; A000 -> _008:w [ arrowhead="tee" ]; A001 [ label="D", shape="oval" ]; _009 [ label="roots:&X", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _009; } _009 -> A001 [ arrowhead="tee" ]; _010 [ shape="record", label="<_p1> Ref" ]; _010:_p1 -> A008:w [ taillabel="*", labelangle="+30", color="red" ]; A001 -> _010:w [ arrowhead="tee" ]; A002 [ label="D", shape="oval" ]; _011 [ label="roots:&R", style="filled", color="lightblue", shape="box" ]; { rank=same; A002; _011; } _011 -> A002 [ arrowhead="tee" ]; _012 [ shape="record", label="<_p1> Ref" ]; _012:_p1 -> A009:w [ taillabel="*", labelangle="+30", color="red" ]; A002 -> _012:w [ arrowhead="tee" ]; A003 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _013 [ shape="record", label="<_p1> Var ptr" ]; _013:_p1 -> A010:w [ taillabel="[..]", labeldistance="1.7", labelangle="+40", color="red" ]; A003 -> _013:w [ arrowhead="tee" ]; A004 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _014 [ shape="record", label="Var sint32" ]; A004 -> _014:w [ arrowhead="tee" ]; A005 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _015 [ shape="record", label="Var sint32" ]; A005 -> _015:w [ arrowhead="tee" ]; A006 [ label="DW", shape="oval", fillcolor="green", style="filled" ]; _016 [ shape="record", label="<_p1> Var ptr" ]; _016:_p1 -> A011:w [ taillabel="*", labelangle="+30", color="red" ]; A006 -> _016:w [ arrowhead="tee" ]; A007 [ label="", shape="oval" ]; _017 [ label="roots:&M", style="filled", color="lightblue", shape="box" ]; { rank=same; A007; _017; } _017 -> A007 [ arrowhead="tee" ]; _018 [ shape="record", label="<_p1> 0..511: D32[16]" ]; _018:_p1 -> A012 [ style="dotted" ]; A007 -> _018:w [ arrowhead="tee" ]; A008 [ label="", shape="oval" ]; _019 [ label="roots:&X", style="filled", color="lightblue", shape="box" ]; { rank=same; A008; _019; } _019 -> A008 [ arrowhead="tee" ]; _020 [ shape="record", label="<_p1> 0..127: D32[4]" ]; _020:_p1 -> A013 [ style="dotted" ]; A008 -> _020:w [ arrowhead="tee" ]; A009 [ label="", shape="oval" ]; _021 [ label="roots:&R", style="filled", color="lightblue", shape="box" ]; { rank=same; A009; _021; } _021 -> A009 [ arrowhead="tee" ]; _022 [ shape="record", label="<_p1> 0..127: D32[4]" ]; _022:_p1 -> A014 [ style="dotted" ]; A009 -> _022:w [ arrowhead="tee" ]; A010 [ label="[]&", shape="oval", fillcolor="orange", style="filled" ]; _023 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A010; _023; } _023 -> A010 [ arrowhead="tee" ]; _024 [ shape="record", label="<_p1> 0..511: D32[16]" ]; _024:_p1 -> A012 [ style="dotted" ]; A010 -> _024:w [ arrowhead="tee" ]; A011 [ label="&", shape="oval", fillcolor="orange", style="filled" ]; _025 [ shape="record", label="<_p1> 0..127: D32[4]" ]; _025:_p1 -> A012 [ style="dotted" ]; A011 -> _025:w [ arrowhead="tee" ]; A012 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _026 [ label="roots:*", style="filled", color="lightblue", shape="box" ]; { rank=same; A012; _026; } _026 -> A012 [ arrowhead="tee" ]; _027 [ shape="record", label="Mem sint32" ]; A012 -> _027:w [ arrowhead="tee" ]; A013 [ label="R", shape="oval", fillcolor="green", style="filled" ]; _028 [ label="roots:&X+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A013; _028; } _028 -> A013 [ arrowhead="tee" ]; _029 [ shape="record", label="Mem sint32" ]; A013 -> _029:w [ arrowhead="tee" ]; A014 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _030 [ label="roots:&R+(..)", style="filled", color="lightblue", shape="box" ]; { rank=same; A014; _030; } _030 -> A014 [ arrowhead="tee" ]; _031 [ shape="record", label="Mem sint32" ]; A014 -> _031:w [ arrowhead="tee" ]; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/structarray4.res.oracle������������������0000666�0000000�0000000�00000000304�13571573400�025134� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/structarray4.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/structarray4/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/swap/������������������������������������0000777�0000000�0000000�00000000000�13571573400�021463� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/swap/region/�����������������������������0000777�0000000�0000000�00000000000�13571573400�022746� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/swap/region/job.dot����������������������0000666�0000000�0000000�00000003400�13571573400�024225� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������digraph "job" { rankdir="LR" ; node [ fontname="monospace" ]; edge [ fontname="monospace" ]; V000 [ label="x", shape="cds", style="filled", fillcolor="yellow" ]; V000:e -> A000 ; V001 [ label="y", shape="cds", style="filled", fillcolor="yellow" ]; V001:e -> A001 ; V002 [ label="t", shape="cds", style="filled", fillcolor="yellow" ]; V002:e -> A002 ; A000 [ label="D", shape="oval" ]; _003 [ label="roots:&x", style="filled", color="lightblue", shape="box" ]; { rank=same; A000; _003; } _003 -> A000 [ arrowhead="tee" ]; _004 [ shape="record", label="<_p1> Ref" ]; _004:_p1 -> A003:w [ taillabel="*", labelangle="+30", color="red" ]; A000 -> _004:w [ arrowhead="tee" ]; A001 [ label="D", shape="oval" ]; _005 [ label="roots:&y", style="filled", color="lightblue", shape="box" ]; { rank=same; A001; _005; } _005 -> A001 [ arrowhead="tee" ]; _006 [ shape="record", label="<_p1> Ref" ]; _006:_p1 -> A004:w [ taillabel="*", labelangle="+30", color="red" ]; A001 -> _006:w [ arrowhead="tee" ]; A002 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _007 [ shape="record", label="Var sint32" ]; A002 -> _007:w [ arrowhead="tee" ]; A003 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _008 [ label="roots:&x", style="filled", color="lightblue", shape="box" ]; { rank=same; A003; _008; } _008 -> A003 [ arrowhead="tee" ]; _009 [ shape="record", label="Var sint32" ]; A003 -> _009:w [ arrowhead="tee" ]; A004 [ label="RW", shape="oval", fillcolor="green", style="filled" ]; _010 [ label="roots:&y", style="filled", color="lightblue", shape="box" ]; { rank=same; A004; _010; } _010 -> A004 [ arrowhead="tee" ]; _011 [ shape="record", label="Var sint32" ]; A004 -> _011:w [ arrowhead="tee" ]; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle/swap.res.oracle��������������������������0000666�0000000�0000000�00000000264�13571573400�023444� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_region/swap.i (no preprocessing) [wp] Region Graph: tests/wp_region/result/swap/region/job.dot [wp] Running WP plugin... [wp] Warning: Missing RTE guards ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/����������������������������������0000777�0000000�0000000�00000000000�13571573400�022052� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/array1.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025237� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/array1.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/array1.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/array1.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/array2.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/array2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/array2.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/array2.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/array3.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025241� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/array3.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/array3.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/array3.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/array4.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025242� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/array4.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/array4.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/array4.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/array5.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/array5.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/array5.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/array5.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/array6.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/array6.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/array6.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/array6.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/array7.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025245� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/array7.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/array7.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/array7.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/array8.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/array8.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/array8.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/array8.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/fb_ADD.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025077� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/fb_ADD.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/fb_ADD.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/fb_ADD.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/fb_SORT.res.oracle����������������0000666�0000000�0000000�00000000661�13571573400�025272� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/fb_SORT.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/fb_SORT.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/fb_SORT.0.report.json' ------------------------------------------------------------- �������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/garbled.res.oracle����������������0000666�0000000�0000000�00000000661�13571573400�025434� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/garbled.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/garbled.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/garbled.0.report.json' ------------------------------------------------------------- �������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/index.res.oracle������������������0000666�0000000�0000000�00000000653�13571573400�025144� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/index.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/index.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/index.0.report.json' ------------------------------------------------------------- �������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/matrix.res.oracle�����������������0000666�0000000�0000000�00000000656�13571573400�025344� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/matrix.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/matrix.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/matrix.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/structarray1.res.oracle�����������0000666�0000000�0000000�00000000700�13571573400�026472� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/structarray1.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/structarray1.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/structarray1.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/structarray2.res.oracle�����������0000666�0000000�0000000�00000000700�13571573400�026473� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/structarray2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/structarray2.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/structarray2.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/structarray3.res.oracle�����������0000666�0000000�0000000�00000000700�13571573400�026474� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/structarray3.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/structarray3.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/structarray3.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/structarray4.res.oracle�����������0000666�0000000�0000000�00000000700�13571573400�026475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/structarray4.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/structarray4.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/structarray4.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/oracle_qualif/swap.res.oracle�������������������0000666�0000000�0000000�00000000650�13571573400�025004� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_region/swap.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_region/oracle_qualif/swap.0.report.json' [wp] Report out: 'tests/wp_region/result_qualif/swap.0.report.json' ------------------------------------------------------------- ����������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/structarray1.i����������������������������������0000666�0000000�0000000�00000000506�13571573400�022063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef struct Vector { int coord[4]; } * vector ; typedef struct Matrix { int coef[4][4]; } * matrix ; //@ region *X , *R ; void job( matrix M , vector X , vector R ) { for (int i = 0; i < 4; i++) { R->coord[i] = 0 ; for (int j = 0; j < 4; i++) { R->coord[i] += M->coef[i][j] * X->coord[j]; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/structarray1.i.0.report.json��������������������0000666�0000000�0000000�00000000005�13571573400�024475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/structarray2.i����������������������������������0000666�0000000�0000000�00000000530�13571573400�022061� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef struct Vector { int coord[4]; } * vector ; typedef struct Matrix { int coef[4][4]; } * matrix ; void job( matrix M , vector X , vector R ) { for (int i = 0; i < 4; i++) { R->coord[i] = 0 ; for (int j = 0; j < 4; i++) { vector C = (vector) (M->coef[i]) ; R->coord[i] += C->coord[j] * X->coord[j]; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/structarray2.i.0.report.json��������������������0000666�0000000�0000000�00000000005�13571573400�024476� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/structarray3.i����������������������������������0000666�0000000�0000000�00000000535�13571573400�022067� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef struct Vector { int coord[4]; } * vector ; typedef struct Matrix { int coef[4][4]; } * matrix ; void job( int c , matrix P , matrix Q , vector X , vector R ) { matrix M = c ? P : Q ; for (int i = 0; i < 4; i++) { R->coord[i] = 0 ; for (int j = 0; j < 4; i++) { R->coord[i] += M->coef[i][j] * X->coord[j]; } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/structarray3.i.0.report.json��������������������0000666�0000000�0000000�00000000005�13571573400�024477� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/structarray4.i����������������������������������0000666�0000000�0000000�00000000604�13571573400�022065� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef struct Vector { int coord[4]; } * vector ; typedef struct Matrix { int coef[4][4]; } * matrix ; void job( matrix M , vector X , vector R ) { int * p = (int *) M->coef ; p[14] = 2 ; for (int i = 0; i < 4; i++) { R->coord[i] = 0 ; for (int j = 0; j < 4; i++) { vector C = (vector) (M->coef[i]) ; R->coord[i] += C->coord[j] * X->coord[j]; } } } ����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/structarray4.i.0.report.json��������������������0000666�0000000�0000000�00000000005�13571573400�024500� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/swap.i������������������������������������������0000666�0000000�0000000�00000000122�13571573400�020363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Test Config void job(int *x,int *y) { int t = *x ; *x = *y ; *y = t ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/swap.i.0.report.json����������������������������0000666�0000000�0000000�00000000005�13571573400�023003� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/test_config�������������������������������������0000666�0000000�0000000�00000000315�13571573400�021472� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CMD: @frama-c@ -no-autoload-plugins -load-module wp LOG: @PTEST_NAME@/region/job.dot OPT: -wp-prover none -wp-region -wp-msg-key dot,chunk,roots,garbled -wp-out @PTEST_DIR@/result/@PTEST_NAME@ -wp-fct job �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_region/test_config_qualif������������������������������0000666�0000000�0000000�00000000020�13571573400�023024� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������OPT: -wp-region ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/�������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017115� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/array.i������������������������������������������0000666�0000000�0000000�00000000444�13571573400�020407� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif COMMENT: */ int G [4]; /*@ requires 0<=i<=3 && 0<=j<=3 ; @ ensures P_startof: qed_ok: i<j ==> \result == &(G[0]) ; @ ensures P_addr_shift: qed_ok: i>=j ==> \result == &(G[i]) ; */ int * g (int i,int j) { if (i<j) return G ; else return G+i ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/natural.i����������������������������������������0000666�0000000�0000000�00000000314�13571573400�020733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif COMMENT: */ int x,y; /*@ requires \valid(&x); assigns \nothing ; ensures qed_ok: &z == &y ==> \result == x; */ int f (int z) { if (&z == &y) return x ; return 0; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/nonaliasing.i������������������������������������0000666�0000000�0000000�00000001256�13571573400�021575� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-prop="-qed_ko" OPT: -wp-steps 50 -wp-prop qed_ko */ /* -------------------------------------------------------------------------- */ /* --- GOAL: separation condition and interference with FunVar --- */ /* -------------------------------------------------------------------------- */ /*@ requires \valid(p); requires \valid(q); requires 0<= *p < 200 && 0<= *q < 200; ensures qed_ok: P: \separated(p,q) ==> *p==\old(*p)+1; ensures qed_ok: Q: \separated(p,q) ==> *q==\old(*q)+1; ensures qed_ko: P_oracle_ko: *p==\old(*p)+1; ensures qed_ko: Q_oracle_ko: *q==\old(*q)+1; */ void f(int *p,int *q) { *p+=1; *q+=1; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle/������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020362� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle/array.res.oracle��������������������������0000666�0000000�0000000�00000001060�13571573400�023454� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_store/array.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition 'P_startof,qed_ok' in 'g': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P_addr_shift,qed_ok' in 'g': Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle/natural.res.oracle������������������������0000666�0000000�0000000�00000001254�13571573400�024011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_store/natural.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'qed_ok' in 'f': Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'f' (1/2): Effect at line 12 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'f' (2/2): Effect at line 12 Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle/nonaliasing.res.oracle��������������������0000666�0000000�0000000�00000005327�13571573400�024652� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_store/nonaliasing.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'qed_ok,P' in 'f': Let x = Mint_0[p]. Let x_1 = Mint_0[q]. Let x_2 = 1 + x. Let m = Mint_0[p <- x_2]. Let x_3 = m[q]. Let x_4 = 1 + x_3. Let x_5 = m[q <- x_4][p]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x_5). (* Goal *) When: q != p. (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= x) /\ (0 <= x_1) /\ (x <= 199) /\ (x_1 <= 199) /\ valid_rw(Malloc_0, p, 1) /\ valid_rw(Malloc_0, q, 1). } Prove: x_5 = x_2. ------------------------------------------------------------ Goal Post-condition 'qed_ok,Q' in 'f': Let x = Mint_0[p]. Let x_1 = Mint_0[q]. Let m = Mint_0[p <- 1 + x]. Let x_2 = m[q]. Let x_3 = 1 + x_2. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(m[q <- x_3][p]). (* Goal *) When: q != p. (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= x) /\ (0 <= x_1) /\ (x <= 199) /\ (x_1 <= 199) /\ valid_rw(Malloc_0, p, 1) /\ valid_rw(Malloc_0, q, 1). } Prove: x_2 = x_1. ------------------------------------------------------------ Goal Post-condition 'qed_ko,P_oracle_ko' in 'f': Let x = Mint_0[p]. Let x_1 = Mint_0[q]. Let x_2 = 1 + x. Let m = Mint_0[p <- x_2]. Let x_3 = m[q]. Let x_4 = 1 + x_3. Let x_5 = m[q <- x_4][p]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x_5). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= x) /\ (0 <= x_1) /\ (x <= 199) /\ (x_1 <= 199) /\ valid_rw(Malloc_0, p, 1) /\ valid_rw(Malloc_0, q, 1). } Prove: x_5 = x_2. ------------------------------------------------------------ Goal Post-condition 'qed_ko,Q_oracle_ko' in 'f': Let x = Mint_0[p]. Let x_1 = Mint_0[q]. Let m = Mint_0[p <- 1 + x]. Let x_2 = m[q]. Let x_3 = 1 + x_2. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(m[q <- x_3][p]). (* Heap *) Have: (region(p.base) <= 0) /\ (region(q.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= x) /\ (0 <= x_1) /\ (x <= 199) /\ (x_1 <= 199) /\ valid_rw(Malloc_0, p, 1) /\ valid_rw(Malloc_0, q, 1). } Prove: x_2 = x_1. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle/struct.res.oracle�������������������������0000666�0000000�0000000�00000004632�13571573400�023672� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_store/struct.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'qed_ok' (file tests/wp_store/struct.i, line 21): Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_store/struct.i, line 10) in 'g'' in 'f' at call 'g' (file tests/wp_store/struct.i, line 20) : Let a_1 = shift_sint32(shiftfield_F1_t_tab(a), 0). Assume { (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, a, 5) /\ valid_rw(Malloc_0, a_1, 5). } Prove: valid_rw(Malloc_0, a_1, 1). ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Post-condition (file tests/wp_store/struct.i, line 11) in 'g': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_store/struct.i, line 12) in 'g': Effect at line 15 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Post-condition 'P,qed_ok' in 'main': Let a = global(G_v_28). Let a_1 = Load_S2_St(a, Mint_0). Assume { Type: IsS2_St(w) /\ IsS2_St(a_1). (* Initializer *) Init: (w.F2_St_a) = 1. (* Initializer *) Init: (w.F2_St_b) = 2. (* Initializer *) Init: Mint_0[shiftfield_F2_St_a(a)] = 1. (* Initializer *) Init: Mint_0[shiftfield_F2_St_b(a)] = 2. (* Heap *) Have: region(G_v_28) <= 0. } Prove: EqS2_St(a_1, w). ------------------------------------------------------------ Goal Post-condition 'Q,qed_ok' in 'main': Let a = global(G_v_28). Let a_1 = Load_S2_St(a, Mint_0). Assume { Type: IsS2_St(w) /\ IsS2_St(a_1). (* Initializer *) Init: (w.F2_St_a) = 1. (* Initializer *) Init: (w.F2_St_b) = 2. (* Initializer *) Init: Mint_0[shiftfield_F2_St_a(a)] = 1. (* Initializer *) Init: Mint_0[shiftfield_F2_St_b(a)] = 2. (* Heap *) Have: region(G_v_28) <= 0. } Prove: EqS2_St(a_1, w). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/�����������������������������������0000777�0000000�0000000�00000000000�13571573400�021723� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/array.0.report.json����������������0000666�0000000�0000000�00000002236�13571573400�025407� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:functions": { "g": { "g_ensures_P_addr_shift_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_ensures_P_startof_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/array.i.0.report.json��������������0000666�0000000�0000000�00000002236�13571573400�025636� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:functions": { "g": { "g_ensures_P_addr_shift_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_ensures_P_startof_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/array.res.oracle�������������������0000666�0000000�0000000�00000001346�13571573400�025024� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_store/array.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_g_ensures_P_startof_qed_ok : Valid [wp] [Qed] Goal typed_g_ensures_P_addr_shift_qed_ok : Valid [wp] Proved goals: 2 / 2 Qed: 2 [wp] Report in: 'tests/wp_store/oracle_qualif/array.0.report.json' [wp] Report out: 'tests/wp_store/result_qualif/array.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success g 2 - 2 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/natural.0.report.json��������������0000666�0000000�0000000�00000001512�13571573400�025733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:functions": { "f": { "f_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "f_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/natural.i.0.report.json������������0000666�0000000�0000000�00000001512�13571573400�026162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "wp:functions": { "f": { "f_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "f_ensures_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/natural.res.oracle�����������������0000666�0000000�0000000�00000001402�13571573400�025345� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_store/natural.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_f_ensures_qed_ok : Valid [wp] [Qed] Goal typed_f_assigns_part1 : Valid [wp] [Qed] Goal typed_f_assigns_part2 : Valid [wp] Proved goals: 3 / 3 Qed: 3 [wp] Report in: 'tests/wp_store/oracle_qualif/natural.0.report.json' [wp] Report out: 'tests/wp_store/result_qualif/natural.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 3 - 3 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.0.res.oracle�����������0000666�0000000�0000000�00000001425�13571573400�026344� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_store/nonaliasing.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ok_P : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ok_Q : Valid [wp] Proved goals: 2 / 2 Qed: 0 Alt-Ergo 2.0.0: 2 [wp] Report in: 'tests/wp_store/oracle_qualif/nonaliasing.0.report.json' [wp] Report out: 'tests/wp_store/result_qualif/nonaliasing.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 2 (16..28) 2 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026045� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027110� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.0.session/cache/1eacf7c3305a9cc892313ba746d6283c.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.0.session/cache/1eacf7c0000666�0000000�0000000�00000000127�13571573400�030244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0237, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.0.session/cache/5be6ae2606260e1c31e654d29333298b.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.0.session/cache/5be6ae20000666�0000000�0000000�00000000127�13571573400�030164� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0238, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.1.res.oracle�����������0000666�0000000�0000000�00000001466�13571573400�026352� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 50 [...] [kernel] Parsing tests/wp_store/nonaliasing.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ko_P_oracle_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures_qed_ko_Q_oracle_ko : Unsuccess [wp] Proved goals: 0 / 2 Alt-Ergo 2.0.0: 0 (unsuccess: 2) [wp] Report in: 'tests/wp_store/oracle_qualif/nonaliasing.1.report.json' [wp] Report out: 'tests/wp_store/result_qualif/nonaliasing.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - - 2 0.0% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.1.session/�������������0000777�0000000�0000000�00000000000�13571573400�026046� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.1.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027111� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.1.session/cache/339586df40fb4086fed3428656bab655.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.1.session/cache/339586d0000666�0000000�0000000�00000000107�13571573400�027757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.1.session/cache/fc10a843e258f1965ae63d31d71037ae.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.1.session/cache/fc10a840000666�0000000�0000000�00000000107�13571573400�030100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 50 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.i.0.report.json��������0000666�0000000�0000000�00000003121�13571573400�027014� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 5 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "wp:functions": { "f": { "f_ensures_qed_ok_Q": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "f_ensures_qed_ok_P": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 5 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/nonaliasing.i.1.report.json��������0000666�0000000�0000000�00000002561�13571573400�027024� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } }, "wp:functions": { "f": { "f_ensures_qed_ko_Q_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "f_ensures_qed_ko_P_oracle_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "unknown": 2 }, "wp:main": { "total": 2, "unknown": 2 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/struct.0.report.json���������������0000666�0000000�0000000�00000007070�13571573400�025616� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 9 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 6, "valid": 6, "rank": 10 } }, "wp:functions": { "g": { "g_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f": { "g_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "f_assert_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } } }, "main": { "main_ensures_Q_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 10 } }, "main_ensures_P_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 10 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 9 }, "wp:main": { "total": 2, "valid": 2, "rank": 10 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/struct.0.session/������������������0000777�0000000�0000000�00000000000�13571573400�025067� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/struct.0.session/cache/������������0000777�0000000�0000000�00000000000�13571573400�026132� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/struct.0.session/cache/0397215be1cc2dddcdf43bf1afd9ffe4.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/struct.0.session/cache/0397215be1cc0000666�0000000�0000000�00000000127�13571573400�027605� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0284, "steps": 36 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000176�00000000000�007777� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/struct.0.session/cache/64ebd3573ba64793b60c3a76b642f1bb.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/struct.0.session/cache/64ebd3573ba60000666�0000000�0000000�00000000127�13571573400�027674� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0177, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/struct.i.0.report.json�������������0000666�0000000�0000000�00000007070�13571573400�026045� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 9 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 6, "valid": 6, "rank": 10 } }, "wp:functions": { "g": { "g_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "g_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "f": { "g_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "f_assert_qed_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } } }, "main": { "main_ensures_Q_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 10 } }, "main_ensures_P_qed_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 10 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 9 }, "wp:main": { "total": 2, "valid": 2, "rank": 10 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/oracle_qualif/struct.res.oracle������������������0000666�0000000�0000000�00000002071�13571573400�025226� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_store/struct.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Qed] Goal typed_f_assert_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_call_g_requires : Valid [wp] [Qed] Goal typed_g_ensures : Valid [wp] [Qed] Goal typed_g_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_ensures_P_qed_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_ensures_Q_qed_ok : Valid [wp] Proved goals: 6 / 6 Qed: 3 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_store/oracle_qualif/struct.0.report.json' [wp] Report out: 'tests/wp_store/result_qualif/struct.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success g 2 - 2 100% f 1 1 (16..28) 2 100% main - 2 (36..48) 2 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_store/struct.i�����������������������������������������0000666�0000000�0000000�00000000727�13571573400�020621� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif COMMENT: */ struct t { int tab[5]; }; /*@ requires \valid(i); @ ensures *i == 1; @ assigns *i ; @ */ void g(int* i) { *i = 1; } /*@ requires \valid(a) && \valid(a->tab+(0..4)); */ void f(struct t* a) { g (&a->tab[0]); //@ assert qed_ok: a->tab[0] == 1; } struct St {int a; int b;}; struct St v={1,2}, w={1,2} ; struct St * p = &v ; /*@ ensures P: qed_ok: v == w; @ ensures Q: qed_ok: *p == w; */ void main(void) { return; } �����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/���������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016555� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/TacNOP.ml������������������������������������������0000666�0000000�0000000�00000004632�13571573400�020200� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2018 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Wp.Tactical (* ---------------------------------------------------------------------- *) (* --- NOP Tactical --- *) (* ---------------------------------------------------------------------- *) class nop = object inherit Wp.Tactical.make ~id:"Wp.Test.NOP" ~title:"NOP" ~descr:"Does nothing." ~params:[] method select feedback (s : Wp.Tactical.selection) = match s with | Empty -> Not_applicable | Compose _ | Inside _ | Clause _ -> feedback#set_title "NOP" ; feedback#set_descr "Does nothing; just for testing." ; Applicable (fun s -> ["Nop", s]) end let tactical = Wp.Tactical.export (new nop) (* -------------------------------------------------------------------------- *) ������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle/��������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020022� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle/tac_split_quantifiers.res.oracle������������0000666�0000000�0000000�00000003002�13571573400�026370� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_tip/tac_split_quantifiers.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function split ------------------------------------------------------------ Goal Post-condition 'Goal_Exist_Or' in 'split': Prove: exists i_2,i_1,i : Z. P_Q1(1) \/ P_P1(i_2) \/ P_P2(i_1, i) \/ (exists i_3 : Z. P_Q2(i_2, i_3)). ------------------------------------------------------------ Goal Post-condition 'Goal_Exist_And' in 'split': Prove: exists i_2,i_1,i : Z. P_P1(i_2) /\ P_Q1(i) /\ P_P2(i_1, i) /\ (exists i_3 : Z. P_Q2(i_2, i_3)). ------------------------------------------------------------ Goal Post-condition 'Goal_Exist_And_bis' in 'split': Prove: exists i_3,i_2,i_1,i : Z. P_Q1(1) /\ P_P2(i_3, i_2) /\ P_R2(i_2, i_1) /\ (exists i_4 : Z. P_Q2(i, i_4)). ------------------------------------------------------------ Goal Post-condition 'Hyp_Forall_And' in 'split': Assume { (* Goal *) When: forall i_2,i_1,i : Z. P_Q1(1) /\ P_P1(i_2) /\ P_P2(i_1, i) /\ (forall i_3 : Z. P_Q2(i_2, i_3)). } Prove: P_Q1(L_A). ------------------------------------------------------------ Goal Post-condition 'Hyp_Forall_Or_bis' in 'split': Assume { (* Goal *) When: forall i_3,i_2,i_1,i : Z. P_Q1(1) \/ P_P2(i_3, i_2) \/ P_R2(i_2, i_1) \/ (forall i_4 : Z. P_Q2(i, i_4)). } Prove: P_Q1(L_A). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/�������������������������������������0000777�0000000�0000000�00000000000�13571573400�021363� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/�����0000777�0000000�0000000�00000000000�13571573400�027577� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000147�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/script/��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/scrip0000777�0000000�0000000�00000000000�13571573400�030640� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000216�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/script/typed_split_ensures_Goal_Exist_And.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/scrip0000666�0000000�0000000�00000003611�13571573400�030643� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "header": "Split", "tactic": "Wp.split", "params": {}, "select": { "select": "clause-goal", "target": "exists i_0,i_1,i_2:int.\n(P_P1 i_0) /\\ (P_Q1 i_2) /\\ (P_P2 i_1 i_2)\n/\\ (exists i_3:int.\n (P_Q2 i_0 i_3))", "pattern": "\\E\\E\\E&P_P1P_Q1P_P2\\E#3#1#2#1P_Q2" }, "children": { "Goal 1/2": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0511159896851 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-goal", "target": "exists i_0,i_1:int. (P_Q1 i_0) /\\ (P_P2 i_1 i_0)", "pattern": "\\E\\E&P_Q1P_P2#1#0#1" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0514709949493 } ] } } ], "Goal 2/2": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0521941184998 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-goal", "target": "exists i_0:int. (P_P1 i_0) /\\ (exists i_1:int.\n (P_Q2 i_0 i_1))", "pattern": "\\E&P_P1\\E#1P_Q2#1#0" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0515058040619 } ] } } ] } } ] �����������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000222�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/script/typed_split_ensures_Goal_Exist_And_bis.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/scrip0000666�0000000�0000000�00000005056�13571573400�030650� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "header": "Split", "tactic": "Wp.split", "params": {}, "select": { "select": "clause-goal", "target": "exists i_0,i_1,i_2,i_3:int.\n(P_Q1 1) /\\ (P_P2 i_0 i_1) /\\ (P_R2 i_1 i_2)\n/\\ (exists i_4:int.\n (P_Q2 i_3 i_4))", "pattern": "\\E\\E\\E\\E&P_Q1P_P2P_R2\\E1#4#3#3#2" }, "children": { "Goal 1/3": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0512578487396 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-goal", "target": "exists i_0,i_1:int. (P_Q2 i_0 i_1)", "pattern": "\\E\\EP_Q2#1#0" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0515179634094 } ] } } ], "Goal 2/3": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0517938137054 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-goal", "target": "exists i_0,i_1,i_2:int. (P_P2 i_2 i_1) /\\ (P_R2 i_1 i_0)", "pattern": "\\E\\E\\E&P_P2P_R2#0#1#1#2" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0515098571777 } ] } } ], "Goal 3/3": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0528788566589 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-goal", "target": "(P_Q1 1)", "pattern": "P_Q11" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0515050888062 } ] } } ] } } ] ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000215�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/script/typed_split_ensures_Goal_Exist_Or.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/scrip0000666�0000000�0000000�00000002701�13571573400�030642� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "header": "Split", "tactic": "Wp.split", "params": {}, "select": { "select": "clause-goal", "target": "exists i_0,i_1,i_2:int.\n(P_Q1 1) \\/ (P_P1 i_0) \\/ (P_P2 i_1 i_2) \\/ (exists i_3:int.\n (P_Q2 i_0 i_3))", "pattern": "\\E\\E\\E|P_Q1P_P1P_P2\\E1#3#2#1P_Q2" }, "children": { "Distrib (exists or)": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0515348911285 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-goal", "target": "(P_Q1 1) \\/ (exists i_0:int.\n (P_P1 i_0)) \\/ (exists i_0,i_1:int.\n (P_P2 i_1 i_0))\n\\/ (exists i_0,i_1:int.\n (P_Q2 i_0 i_1))", "pattern": "|P_Q1\\E\\E\\E1P_P1\\E\\E#0P_P2P_Q2#0" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0513439178467 } ] } } ] } } ] ���������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000216�00000000000�007772� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/script/typed_split_ensures_Hyp_Forall_And.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/scrip0000666�0000000�0000000�00000003160�13571573400�030642� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "header": "Split", "tactic": "Wp.split", "params": {}, "select": { "select": "clause-step", "at": 0, "kind": "have", "target": "forall i_0,i_1,i_2:int.\n(P_Q1 1) /\\ (P_P1 i_0) /\\ (P_P2 i_1 i_2) /\\ (forall i_3:int.\n (P_Q2 i_0 i_3))", "pattern": "\\F\\F\\F&P_Q1P_P1P_P2\\F1#3#2#1P_Q2" }, "children": { "Distrib (forall and)": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.051558971405 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-step", "at": 0, "kind": "have", "target": "(P_Q1 1) /\\ (forall i_0:int.\n (P_P1 i_0)) /\\ (forall i_0,i_1:int.\n (P_P2 i_1 i_0))\n/\\ (forall i_0,i_1:int.\n (P_Q2 i_0 i_1))", "pattern": "&P_Q1\\F\\F\\F1P_P1\\F\\F#0P_P2P_Q2#0" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0513830184937 } ] } } ] } } ] ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000221�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/script/typed_split_ensures_Hyp_Forall_Or_bis.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.session/scrip0000666�0000000�0000000�00000005433�13571573400�030647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "header": "Split", "tactic": "Wp.split", "params": {}, "select": { "select": "clause-step", "at": 0, "kind": "have", "target": "forall i_0,i_1,i_2,i_3:int.\n(P_Q1 1) \\/ (P_P2 i_0 i_1) \\/ (P_R2 i_1 i_2)\n\\/ (forall i_4:int.\n (P_Q2 i_3 i_4))", "pattern": "\\F\\F\\F\\F|P_Q1P_P2P_R2\\F1#4#3#3#2" }, "children": { "Goal 1/3": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0511250495911 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-step", "at": 0, "kind": "have", "target": "forall i_0,i_1:int. (P_Q2 i_0 i_1)", "pattern": "\\F\\FP_Q2#1#0" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0515208244324 } ] } } ], "Goal 2/3": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0517539978027 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-step", "at": 0, "kind": "have", "target": "forall i_0,i_1,i_2:int. (P_P2 i_2 i_1) \\/ (P_R2 i_1 i_0)", "pattern": "\\F\\F\\F|P_P2P_R2#0#1#1#2" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0515398979187 } ] } } ], "Goal 3/3": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.0528609752655 }, { "header": "NOP", "tactic": "Wp.Test.NOP", "params": {}, "select": { "select": "clause-step", "at": 0, "kind": "have", "target": "(P_Q1 1)", "pattern": "P_Q11" }, "children": { "Nop": [ { "prover": "alt-ergo", "verdict": "unknown", "time": 0.051561832428 } ] } } ] } } ] �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.i.0.report.json0000666�0000000�0000000�00000005450�13571573400�030555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "script": { "total": 5, "unknown": 5 }, "wp:main": { "total": 5, "unknown": 5 } }, "wp:functions": { "split": { "split_ensures_Hyp_Forall_Or_bis": { "script": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "split_ensures_Hyp_Forall_And": { "script": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "split_ensures_Goal_Exist_And_bis": { "script": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "split_ensures_Goal_Exist_And": { "script": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "split_ensures_Goal_Exist_Or": { "script": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "script": { "total": 5, "unknown": 5 }, "wp:main": { "total": 5, "unknown": 5 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/oracle_qualif/tac_split_quantifiers.res.oracle�����0000666�0000000�0000000�00000001740�13571573400�027740� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_tip/tac_split_quantifiers.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 5 goals scheduled [wp] [Tactical] Goal typed_split_ensures_Goal_Exist_Or : Unsuccess [wp] [Tactical] Goal typed_split_ensures_Goal_Exist_And : Unsuccess [wp] [Tactical] Goal typed_split_ensures_Goal_Exist_And_bis : Unsuccess [wp] [Tactical] Goal typed_split_ensures_Hyp_Forall_And : Unsuccess [wp] [Tactical] Goal typed_split_ensures_Hyp_Forall_Or_bis : Unsuccess [wp] Proved goals: 0 / 5 [wp] Report in: 'tests/wp_tip/oracle_qualif/tac_split_quantifiers.0.report.json' [wp] Report out: 'tests/wp_tip/result_qualif/tac_split_quantifiers.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success split - - 5 0.0% ------------------------------------------------------------- ��������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_tip/tac_split_quantifiers.i����������������������������0000666�0000000�0000000�00000002365�13571573400�023331� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp -wp-prover none */ /* run.config_qualif OPT: -load-module tests/wp_tip/TacNOP.ml -wp -wp-par 1 -wp-prover script */ /*@ axiomatic A { logic integer A reads \nothing ; predicate P1(integer a1) reads \nothing ; predicate Q1(integer a1) reads \nothing ; predicate R1(integer a1) reads \nothing ; predicate P2(integer a1, integer a2) reads \nothing ; predicate Q2(integer a1, integer a2) reads \nothing ; predicate R2(integer a1, integer a2) reads \nothing ; } */ /*@ ensures Goal_Exist_Or: (\exists integer a, b, c ; P1(a) || P2(b, c) || Q1(1) || \exists integer d ; Q2(a,d)) ; @ ensures Goal_Exist_And: (\exists integer a, b, c ; P1(a) && P2(b, c) && Q1(c) && \exists integer d ; Q2(a,d)) ; @ ensures Goal_Exist_And_bis: (\exists integer a, b, c, d ; P2(a, b) && R2(b, c) && Q1(1) && \exists integer e ; Q2(d,e)) ; @ ensures Hyp_Forall_And: (\forall integer a, b, c ; P1(a) && P2(b, c) && Q1(1) && \forall integer d ; Q2(a,d) ) ==> Q1(A); @ ensures Hyp_Forall_Or_bis: (\forall integer a, b, c, d ; P2(a, b) || R2(b, c) || Q1(1) || \forall integer e ; Q2(d,e) ) ==> Q1(A); */ void split(void) { ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/�������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017106� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/array_initialized.c������������������������������0000666�0000000�0000000�00000030572�13571573400�022764� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-init-summarize-array -wp-init-const OPT: -wp-init-summarize-array -wp-init-const -cpp-extra-args="-D FORCE_VAR_IN_TYPED_MODEL" */ /* run.config_qualif OPT: -wp-init-summarize-array -wp-init-const OPT: -wp-init-summarize-array -wp-init-const -cpp-extra-args="-D FORCE_VAR_IN_TYPED_MODEL" */ /** Try to prove properties about initialized arrays */ const int g[500]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; void main1(){ #ifdef FORCE_VAR_IN_TYPED_MODEL int *i = &g; /* force g to be in the typed model */ #endif /*@ assert \forall integer k; 0 <= k < 500 ==> g[k] == 0; @*/ } const int h1[500]= { 0 , 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; const int h2[500]= { 0 , 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; void main2(){ #ifdef FORCE_VAR_IN_TYPED_MODEL int *i = &h1; i = &h2; #endif /*@ assert \forall integer k; 0 <= k < 500 ==> h1[k] == h2[k]; @*/ } void main3(){ #ifdef FORCE_VAR_IN_TYPED_MODEL int *i = &h1; #endif /*@ assert h1[50] == 0 && h1[51] == 0 && h1[52] == 0 && h1[53] == 0 && h1[54] == 0 && h1[55] == 0 && h1[56] == 0 && h1[57] == 0 && h1[58] == 0 && h1[59] == 0 && h1[60] == 0 && h1[61] == 0 && h1[62] == 0 && h1[63] == 0 && h1[64] == 0 && h1[65] == 0 && h1[66] == 0 && h1[67] == 0 && h1[68] == 0 && h1[69] == 0 && h1[70] == 0 && h1[71] == 0 && h1[72] == 0 && h1[73] == 0 && h1[74] == 0 && h1[75] == 0 && h1[76] == 0 && h1[77] == 0 && h1[78] == 0 && h1[79] == 0 && h1[80] == 0 && h1[81] == 0 && h1[82] == 0 && h1[83] == 0 && h1[84] == 0 && h1[85] == 0 && h1[86] == 0 && h1[87] == 0 && h1[88] == 0 && h1[89] == 0 && h1[90] == 0 && h1[91] == 0 && h1[92] == 0 && h1[93] == 0 && h1[94] == 0 && h1[95] == 0 && h1[96] == 0 && h1[97] == 0 && h1[98] == 0 && h1[99] == 0 && h1[150] == 0 && h1[151] == 0 && h1[152] == 0 && h1[153] == 0 && h1[154] == 0 && h1[155] == 0 && h1[156] == 0 && h1[157] == 0 && h1[158] == 0 && h1[159] == 0 && h1[160] == 0 && h1[161] == 0 && h1[162] == 0 && h1[163] == 0 && h1[164] == 0 && h1[165] == 0 && h1[166] == 0 && h1[167] == 0 && h1[168] == 0 && h1[169] == 0 && h1[170] == 0 && h1[171] == 0 && h1[172] == 0 && h1[173] == 0 && h1[174] == 0 && h1[175] == 0 && h1[176] == 0 && h1[177] == 0 && h1[178] == 0 && h1[179] == 0 && h1[180] == 0 && h1[181] == 0 && h1[182] == 0 && h1[183] == 0 && h1[184] == 0 && h1[185] == 0 && h1[186] == 0 && h1[187] == 0 && h1[188] == 0 && h1[189] == 0 && h1[190] == 0 && h1[191] == 0 && h1[192] == 0 && h1[193] == 0 && h1[194] == 0 && h1[195] == 0 && h1[196] == 0 && h1[197] == 0 && h1[198] == 0 && h1[199] == 0 && h1[250] == 0 && h1[251] == 0 && h1[252] == 0 && h1[253] == 0 && h1[254] == 0 && h1[255] == 0 && h1[256] == 0 && h1[257] == 0 && h1[258] == 0 && h1[259] == 0 && h1[260] == 0 && h1[261] == 0 && h1[262] == 0 && h1[263] == 0 && h1[264] == 0 && h1[265] == 0 && h1[266] == 0 && h1[267] == 0 && h1[268] == 0 && h1[269] == 0 && h1[270] == 0 && h1[271] == 0 && h1[272] == 0 && h1[273] == 0 && h1[274] == 0 && h1[275] == 0 && h1[276] == 0 && h1[277] == 0 && h1[278] == 0 && h1[279] == 0 && h1[280] == 0 && h1[281] == 0 && h1[282] == 0 && h1[283] == 0 && h1[284] == 0 && h1[285] == 0 && h1[286] == 0 && h1[287] == 0 && h1[288] == 0 && h1[289] == 0 && h1[290] == 0 && h1[291] == 0 && h1[292] == 0 && h1[293] == 0 && h1[294] == 0 && h1[295] == 0 && h1[296] == 0 && h1[297] == 0 && h1[298] == 0 && h1[299] == 0 && h1[350] == 0 && h1[351] == 0 && h1[352] == 0 && h1[353] == 0 && h1[354] == 0 && h1[355] == 0 && h1[356] == 0 && h1[357] == 0 && h1[358] == 0 && h1[359] == 0 && h1[360] == 0 && h1[361] == 0 && h1[362] == 0 && h1[363] == 0 && h1[364] == 0 && h1[365] == 0 && h1[366] == 0 && h1[367] == 0 && h1[368] == 0 && h1[369] == 0 && h1[370] == 0 && h1[371] == 0 && h1[372] == 0 && h1[373] == 0 && h1[374] == 0 && h1[375] == 0 && h1[376] == 0 && h1[377] == 0 && h1[378] == 0 && h1[379] == 0 && h1[380] == 0 && h1[381] == 0 && h1[382] == 0 && h1[383] == 0 && h1[384] == 0 && h1[385] == 0 && h1[386] == 0 && h1[387] == 0 && h1[388] == 0 && h1[389] == 0 && h1[390] == 0 && h1[391] == 0 && h1[392] == 0 && h1[393] == 0 && h1[394] == 0 && h1[395] == 0 && h1[396] == 0 && h1[397] == 0 && h1[398] == 0 && h1[399] == 0 && \true; @*/ } int p0; int* const p[500]= { &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, &p0 , &p0, &p0, &p0, &p0, }; void main_pointer(){ #ifdef FORCE_VAR_IN_TYPED_MODEL int **i = &p; #endif /*@ assert \forall integer k; 0 <= k < 500 ==> \valid(p[k]); @*/ } /*@ requires \forall integer i; 0 <= i < 50 ==> t[i] == t[0]; ensures \forall integer i; 0 <= i < 50 ==> (\result == 1 <==> t[i] >= 0); @*/ int simpl(int *t){ if(t[0] >= 0){ return 1; } else { return 0; } } ��������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/avar.i�������������������������������������������0000666�0000000�0000000�00000000126�13571573400�020210� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ requires \valid(p+(0..n-1)); */ void f(int *p,int n); void g(int x) { f(&x,1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/bug_9.c������������������������������������������0000666�0000000�0000000�00000000301�13571573400�020251� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif DONTRUN: */ /* bug gitlab #9 */ unsigned int *T1[1]; unsigned char *T2[1]; int main(void) { int **p = &T1; char **q = &T2; /*@ assert \true; */ return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/cast_fits.i��������������������������������������0000666�0000000�0000000�00000002104�13571573400�021234� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef struct { int i1; char c1; } L1 ; //@ ensures \result == p->i1; int fits1(L1 * p) { int * q = (int *) p; return *q; } typedef struct { char c2; int i2; } L2; //@ ensures \result == p->c2; int mismatch1(L2 * p) { int * q = (int *) p; return *q; } typedef struct { char c3; L1 ic3; int i3; } L3 ; //@ ensures \result == p->ic3.i1; int fits2(L3 * p) { L2 * q = (L2 *) p; return q->i2; } typedef struct { char c4; L1 ic4[2]; int i4; } L4 ; //@ ensures \result == p->ic4[0].i1; int fits3(L4 * p) { L2 * q = (L2 *) p; return q->i2; } typedef struct { L3 ci5[2]; } L5 ; typedef struct { L2 ci6[2]; char c6; } L6 ; //@ ensures \result == p->ci5[1].c3; int fits4(L5 * p) { L6 * q = (L6 *) p; return q->c6; } typedef union { int u7; } L7 ; //@ ensures \result == p->u7; int fits5(L7 * p) { int * q = (int *) p; return *q; } typedef union { int i8; char u8; double d8;} L8 ; //@ ensures \result == p->i8; int mismatch2(L8 * p) { int * q = (int *) p; return *q; } //@ ensures \result == *p; int mismatch3(int * p) { L8 * q = (L8 *) p; return q->i8; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/mvar.i�������������������������������������������0000666�0000000�0000000�00000000474�13571573400�020232� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������extern char A[20]; //@ predicate equal(integer x,integer y) = x==y ; /*@ ensures \forall integer i ; 0 <= i < n ==> \at( A[i] == *(p + i) , Pre); */ extern void Write(char *p, int n); /*@ ensures equal(A[0],1) ; */ void Job(void) { char DataWrite; DataWrite = 1 ; Write((& DataWrite),1); return; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020353� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/array_initialized.0.res.oracle������������0000666�0000000�0000000�00000015605�13571573400�026202� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/array_initialized.c (with preprocessing) [kernel] tests/wp_typed/array_initialized.c:13: Warning: Too many initializers for array g [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main1 ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/array_initialized.c, line 71): Assume { (* Goal *) When: (0 <= i) /\ (i <= 499). (* Initializer *) Init: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 499) -> (g[i_1] = 0))). } Prove: g[i] = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function main2 ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/array_initialized.c, line 185): Assume { (* Goal *) When: (0 <= i) /\ (i <= 499). (* Initializer *) Init: h2_0[0] = 0. (* Initializer *) Init: h2_0[1] = 1. (* Initializer *) Init: h2_0[2] = 2. (* Initializer *) Init: h2_0[3] = 3. (* Initializer *) Init: h2_0[4] = 4. (* Initializer *) Init: h2_0[5] = 5. (* Initializer *) Init: h2_0[6] = 6. (* Initializer *) Init: h2_0[7] = 7. (* Initializer *) Init: h2_0[8] = 8. (* Initializer *) Init: h2_0[9] = 9. (* Initializer *) Init: h2_0[10] = 10. (* Initializer *) Init: h2_0[11] = 11. (* Initializer *) Init: h2_0[12] = 12. (* Initializer *) Init: h2_0[13] = 13. (* Initializer *) Init: h2_0[14] = 14. (* Initializer *) Init: h2_0[15] = 15. (* Initializer *) Init: h2_0[16] = 16. (* Initializer *) Init: h2_0[17] = 17. (* Initializer *) Init: h2_0[18] = 18. (* Initializer *) Init: h2_0[19] = 19. (* Initializer *) Init: h2_0[20] = 20. (* Initializer *) Init: h2_0[21] = 21. (* Initializer *) Init: h2_0[22] = 22. (* Initializer *) Init: h2_0[23] = 23. (* Initializer *) Init: h2_0[24] = 24. (* Initializer *) Init: h2_0[25] = 25. (* Initializer *) Init: h2_0[26] = 26. (* Initializer *) Init: h2_0[27] = 27. (* Initializer *) Init: h2_0[28] = 28. (* Initializer *) Init: h2_0[29] = 29. (* Initializer *) Init: h2_0[30] = 30. (* Initializer *) Init: h2_0[31] = 31. (* Initializer *) Init: h2_0[32] = 32. (* Initializer *) Init: h2_0[33] = 33. (* Initializer *) Init: h2_0[34] = 34. (* Initializer *) Init: h2_0[35] = 35. (* Initializer *) Init: h2_0[36] = 36. (* Initializer *) Init: h2_0[37] = 37. (* Initializer *) Init: h2_0[38] = 38. (* Initializer *) Init: h2_0[39] = 39. (* Initializer *) Init: h2_0[40] = 40. (* Initializer *) Init: h2_0[41] = 41. (* Initializer *) Init: h2_0[42] = 42. (* Initializer *) Init: h2_0[43] = 43. (* Initializer *) Init: h2_0[44] = 44. (* Initializer *) Init: h2_0[45] = 45. (* Initializer *) Init: h2_0[46] = 46. (* Initializer *) Init: h2_0[47] = 47. (* Initializer *) Init: h2_0[48] = 48. (* Initializer *) Init: h2_0[49] = 49. (* Initializer *) Init: forall i_1 : Z. ((50 <= i_1) -> ((i_1 <= 499) -> (h2_0[i_1] = 0))). (* Initializer *) Init: h1_0[0] = 0. (* Initializer *) Init: h1_0[1] = 1. (* Initializer *) Init: h1_0[2] = 2. (* Initializer *) Init: h1_0[3] = 3. (* Initializer *) Init: h1_0[4] = 4. (* Initializer *) Init: h1_0[5] = 5. (* Initializer *) Init: h1_0[6] = 6. (* Initializer *) Init: h1_0[7] = 7. (* Initializer *) Init: h1_0[8] = 8. (* Initializer *) Init: h1_0[9] = 9. (* Initializer *) Init: h1_0[10] = 10. (* Initializer *) Init: h1_0[11] = 11. (* Initializer *) Init: h1_0[12] = 12. (* Initializer *) Init: h1_0[13] = 13. (* Initializer *) Init: h1_0[14] = 14. (* Initializer *) Init: h1_0[15] = 15. (* Initializer *) Init: h1_0[16] = 16. (* Initializer *) Init: h1_0[17] = 17. (* Initializer *) Init: h1_0[18] = 18. (* Initializer *) Init: h1_0[19] = 19. (* Initializer *) Init: h1_0[20] = 20. (* Initializer *) Init: h1_0[21] = 21. (* Initializer *) Init: h1_0[22] = 22. (* Initializer *) Init: h1_0[23] = 23. (* Initializer *) Init: h1_0[24] = 24. (* Initializer *) Init: h1_0[25] = 25. (* Initializer *) Init: h1_0[26] = 26. (* Initializer *) Init: h1_0[27] = 27. (* Initializer *) Init: h1_0[28] = 28. (* Initializer *) Init: h1_0[29] = 29. (* Initializer *) Init: h1_0[30] = 30. (* Initializer *) Init: h1_0[31] = 31. (* Initializer *) Init: h1_0[32] = 32. (* Initializer *) Init: h1_0[33] = 33. (* Initializer *) Init: h1_0[34] = 34. (* Initializer *) Init: h1_0[35] = 35. (* Initializer *) Init: h1_0[36] = 36. (* Initializer *) Init: h1_0[37] = 37. (* Initializer *) Init: h1_0[38] = 38. (* Initializer *) Init: h1_0[39] = 39. (* Initializer *) Init: h1_0[40] = 40. (* Initializer *) Init: h1_0[41] = 41. (* Initializer *) Init: h1_0[42] = 42. (* Initializer *) Init: h1_0[43] = 43. (* Initializer *) Init: h1_0[44] = 44. (* Initializer *) Init: h1_0[45] = 45. (* Initializer *) Init: h1_0[46] = 46. (* Initializer *) Init: h1_0[47] = 47. (* Initializer *) Init: h1_0[48] = 48. (* Initializer *) Init: h1_0[49] = 49. (* Initializer *) Init: forall i_1 : Z. ((50 <= i_1) -> ((i_1 <= 499) -> (h1_0[i_1] = 0))). } Prove: h2_0[i] = h1_0[i]. ------------------------------------------------------------ ------------------------------------------------------------ Function main3 ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/array_initialized.c, line 194): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main_pointer ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/array_initialized.c, line 283): Assume { (* Goal *) When: (0 <= i) /\ (i <= 499). (* Initializer *) Init: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 499) -> (p[i_1] = global(G_p0_28)))). (* Heap *) Have: linked(Malloc_0). } Prove: valid_rw(Malloc_0, p[i], 1). ------------------------------------------------------------ ------------------------------------------------------------ Function simpl ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/array_initialized.c, line 288) in 'simpl': Let x = Mint_0[shift_sint32(t, 0)]. Assume { Type: is_sint32(x). (* Goal *) When: (0 <= i) /\ (i <= 49). (* Heap *) Have: region(t.base) <= 0. (* Pre-condition *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 49) -> (Mint_0[shift_sint32(t, i_1)] = x))). If 0 <= x Then { (* Return *) Have: simpl_0 = 1. } Else { (* Return *) Have: simpl_0 = 0. } } Prove: (0 <= Mint_0[shift_sint32(t, i)]) <-> (simpl_0 = 1). ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/array_initialized.1.res.oracle������������0000666�0000000�0000000�00000022177�13571573400�026205� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/array_initialized.c (with preprocessing) [kernel] tests/wp_typed/array_initialized.c:13: Warning: Too many initializers for array g [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main1 ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/array_initialized.c, line 71): Let a = global(K_g_18). Assume { (* Goal *) When: (0 <= i) /\ (i <= 499). (* Initializer *) Init: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 499) -> (Mint_0[shift_sint32(a, i_1)] = 0))). } Prove: Mint_0[shift_sint32(a, i)] = 0. ------------------------------------------------------------ ------------------------------------------------------------ Function main2 ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/array_initialized.c, line 185): Let a = global(K_h1_24). Let a_1 = global(K_h2_25). Assume { (* Goal *) When: (0 <= i) /\ (i <= 499). (* Initializer *) Init: Mint_0[shift_sint32(a_1, 0)] = 0. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 1)] = 1. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 2)] = 2. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 3)] = 3. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 4)] = 4. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 5)] = 5. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 6)] = 6. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 7)] = 7. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 8)] = 8. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 9)] = 9. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 10)] = 10. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 11)] = 11. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 12)] = 12. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 13)] = 13. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 14)] = 14. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 15)] = 15. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 16)] = 16. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 17)] = 17. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 18)] = 18. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 19)] = 19. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 20)] = 20. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 21)] = 21. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 22)] = 22. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 23)] = 23. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 24)] = 24. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 25)] = 25. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 26)] = 26. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 27)] = 27. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 28)] = 28. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 29)] = 29. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 30)] = 30. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 31)] = 31. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 32)] = 32. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 33)] = 33. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 34)] = 34. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 35)] = 35. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 36)] = 36. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 37)] = 37. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 38)] = 38. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 39)] = 39. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 40)] = 40. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 41)] = 41. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 42)] = 42. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 43)] = 43. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 44)] = 44. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 45)] = 45. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 46)] = 46. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 47)] = 47. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 48)] = 48. (* Initializer *) Init: Mint_0[shift_sint32(a_1, 49)] = 49. (* Initializer *) Init: forall i_1 : Z. ((50 <= i_1) -> ((i_1 <= 499) -> (Mint_0[shift_sint32(a_1, i_1)] = 0))). (* Initializer *) Init: Mint_0[shift_sint32(a, 0)] = 0. (* Initializer *) Init: Mint_0[shift_sint32(a, 1)] = 1. (* Initializer *) Init: Mint_0[shift_sint32(a, 2)] = 2. (* Initializer *) Init: Mint_0[shift_sint32(a, 3)] = 3. (* Initializer *) Init: Mint_0[shift_sint32(a, 4)] = 4. (* Initializer *) Init: Mint_0[shift_sint32(a, 5)] = 5. (* Initializer *) Init: Mint_0[shift_sint32(a, 6)] = 6. (* Initializer *) Init: Mint_0[shift_sint32(a, 7)] = 7. (* Initializer *) Init: Mint_0[shift_sint32(a, 8)] = 8. (* Initializer *) Init: Mint_0[shift_sint32(a, 9)] = 9. (* Initializer *) Init: Mint_0[shift_sint32(a, 10)] = 10. (* Initializer *) Init: Mint_0[shift_sint32(a, 11)] = 11. (* Initializer *) Init: Mint_0[shift_sint32(a, 12)] = 12. (* Initializer *) Init: Mint_0[shift_sint32(a, 13)] = 13. (* Initializer *) Init: Mint_0[shift_sint32(a, 14)] = 14. (* Initializer *) Init: Mint_0[shift_sint32(a, 15)] = 15. (* Initializer *) Init: Mint_0[shift_sint32(a, 16)] = 16. (* Initializer *) Init: Mint_0[shift_sint32(a, 17)] = 17. (* Initializer *) Init: Mint_0[shift_sint32(a, 18)] = 18. (* Initializer *) Init: Mint_0[shift_sint32(a, 19)] = 19. (* Initializer *) Init: Mint_0[shift_sint32(a, 20)] = 20. (* Initializer *) Init: Mint_0[shift_sint32(a, 21)] = 21. (* Initializer *) Init: Mint_0[shift_sint32(a, 22)] = 22. (* Initializer *) Init: Mint_0[shift_sint32(a, 23)] = 23. (* Initializer *) Init: Mint_0[shift_sint32(a, 24)] = 24. (* Initializer *) Init: Mint_0[shift_sint32(a, 25)] = 25. (* Initializer *) Init: Mint_0[shift_sint32(a, 26)] = 26. (* Initializer *) Init: Mint_0[shift_sint32(a, 27)] = 27. (* Initializer *) Init: Mint_0[shift_sint32(a, 28)] = 28. (* Initializer *) Init: Mint_0[shift_sint32(a, 29)] = 29. (* Initializer *) Init: Mint_0[shift_sint32(a, 30)] = 30. (* Initializer *) Init: Mint_0[shift_sint32(a, 31)] = 31. (* Initializer *) Init: Mint_0[shift_sint32(a, 32)] = 32. (* Initializer *) Init: Mint_0[shift_sint32(a, 33)] = 33. (* Initializer *) Init: Mint_0[shift_sint32(a, 34)] = 34. (* Initializer *) Init: Mint_0[shift_sint32(a, 35)] = 35. (* Initializer *) Init: Mint_0[shift_sint32(a, 36)] = 36. (* Initializer *) Init: Mint_0[shift_sint32(a, 37)] = 37. (* Initializer *) Init: Mint_0[shift_sint32(a, 38)] = 38. (* Initializer *) Init: Mint_0[shift_sint32(a, 39)] = 39. (* Initializer *) Init: Mint_0[shift_sint32(a, 40)] = 40. (* Initializer *) Init: Mint_0[shift_sint32(a, 41)] = 41. (* Initializer *) Init: Mint_0[shift_sint32(a, 42)] = 42. (* Initializer *) Init: Mint_0[shift_sint32(a, 43)] = 43. (* Initializer *) Init: Mint_0[shift_sint32(a, 44)] = 44. (* Initializer *) Init: Mint_0[shift_sint32(a, 45)] = 45. (* Initializer *) Init: Mint_0[shift_sint32(a, 46)] = 46. (* Initializer *) Init: Mint_0[shift_sint32(a, 47)] = 47. (* Initializer *) Init: Mint_0[shift_sint32(a, 48)] = 48. (* Initializer *) Init: Mint_0[shift_sint32(a, 49)] = 49. (* Initializer *) Init: forall i_1 : Z. ((50 <= i_1) -> ((i_1 <= 499) -> (Mint_0[shift_sint32(a, i_1)] = 0))). } Prove: Mint_0[shift_sint32(a_1, i)] = Mint_0[shift_sint32(a, i)]. ------------------------------------------------------------ ------------------------------------------------------------ Function main3 ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/array_initialized.c, line 194): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main_pointer ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/array_initialized.c, line 283): Let a = global(K_p_32). Assume { (* Goal *) When: (0 <= i) /\ (i <= 499). (* Initializer *) Init: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 499) -> (Mptr_0[shift_PTR(a, i_1)] = global(G_p0_31)))). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). } Prove: valid_rw(Malloc_0, Mptr_0[shift_PTR(a, i)], 1). ------------------------------------------------------------ ------------------------------------------------------------ Function simpl ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/array_initialized.c, line 288) in 'simpl': Let x = Mint_0[shift_sint32(t, 0)]. Assume { Type: is_sint32(x). (* Goal *) When: (0 <= i) /\ (i <= 49). (* Heap *) Have: region(t.base) <= 0. (* Pre-condition *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 49) -> (Mint_0[shift_sint32(t, i_1)] = x))). If 0 <= x Then { (* Return *) Have: simpl_0 = 1. } Else { (* Return *) Have: simpl_0 = 0. } } Prove: (0 <= Mint_0[shift_sint32(t, i)]) <-> (simpl_0 = 1). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/avar.0.res.oracle�������������������������0000666�0000000�0000000�00000001231�13571573400�023416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/avar.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_typed/avar.i:4: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/avar.i, line 1) in 'f'' in 'g' at call 'f' (file tests/wp_typed/avar.i, line 4) : Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/avar.1.res.oracle�������������������������0000666�0000000�0000000�00000001261�13571573400�023422� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/avar.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_typed/avar.i:4: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/avar.i, line 1) in 'f'' in 'g' at call 'f' (file tests/wp_typed/avar.i, line 4) : Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/bug_9.0.res.oracle������������������������0000666�0000000�0000000�00000000677�13571573400�023507� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/bug_9.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/bug_9.c, line 14): Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/bug_9.1.res.oracle������������������������0000666�0000000�0000000�00000000727�13571573400�023504� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/bug_9.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/bug_9.c, line 14): Prove: true. ------------------------------------------------------------ �����������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/cast_fits.0.res.oracle��������������������0000666�0000000�0000000�00000011703�13571573400�024451� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/cast_fits.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/cast_fits.i:13: Warning: Cast with incompatible pointers types (source: __anonstruct_L2_2*) (target: sint32*) [wp] tests/wp_typed/cast_fits.i:54: Warning: Cast with incompatible pointers types (source: __anonunion_L8_8*) (target: sint32*) [wp] tests/wp_typed/cast_fits.i:60: Warning: Cast with incompatible pointers types (source: sint32*) (target: __anonunion_L8_8*) ------------------------------------------------------------ Function fits1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 3) in 'fits1': Let x = Mint_0[p]. Let x_1 = Mint_0[shiftfield_F1_i1(p)]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function fits2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 19) in 'fits2': Let x = Mint_0[shiftfield_F2_i2(p)]. Let x_1 = Mint_0[shiftfield_F1_i1(shiftfield_F3_ic3(p))]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function fits3 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 27) in 'fits3': Let x = Mint_0[shiftfield_F2_i2(p)]. Let x_1 = Mint_0 [shiftfield_F1_i1(shift___anonstruct_L1_1(shiftfield_F4_ic4(p), 0))]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function fits4 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 37) in 'fits4': Let x = Mchar_0[shiftfield_F6_c6(p)]. Let x_1 = Mchar_0 [shiftfield_F3_c3(shift___anonstruct_L3_3(shiftfield_F5_ci5(p), 1))]. Assume { Type: is_sint8(x) /\ is_sint32(x) /\ is_sint8(x_1). (* Heap *) Have: (region(p.base) <= 0) /\ sconst(Mchar_0). } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function fits5 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 45) in 'fits5': Let x = Mint_0[p]. Let x_1 = Mint_0[shiftfield_F7_u7(p)]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function mismatch1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 11) in 'mismatch1': tests/wp_typed/cast_fits.i:13: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: __anonstruct_L2_2*) (target: sint32*) Let x = Mint_0[q]. Let x_1 = Mchar_0[shiftfield_F2_c2(p)]. Assume { Type: is_sint32(x) /\ is_sint8(x_1). (* Heap *) Have: (region(p.base) <= 0) /\ sconst(Mchar_0). } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function mismatch2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 52) in 'mismatch2': tests/wp_typed/cast_fits.i:54: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: __anonunion_L8_8*) (target: sint32*) Let x = Mint_0[q]. Let x_1 = Mint_0[shiftfield_F8_i8(p)]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function mismatch3 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 58) in 'mismatch3': tests/wp_typed/cast_fits.i:60: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: __anonunion_L8_8*) Let x = Mint_0[p]. Let x_1 = Mint_0[shiftfield_F8_i8(q)]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ �������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/cast_fits.1.res.oracle��������������������0000666�0000000�0000000�00000011733�13571573400�024455� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/cast_fits.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/cast_fits.i:13: Warning: Cast with incompatible pointers types (source: __anonstruct_L2_2*) (target: sint32*) [wp] tests/wp_typed/cast_fits.i:54: Warning: Cast with incompatible pointers types (source: __anonunion_L8_8*) (target: sint32*) [wp] tests/wp_typed/cast_fits.i:60: Warning: Cast with incompatible pointers types (source: sint32*) (target: __anonunion_L8_8*) ------------------------------------------------------------ Function fits1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 3) in 'fits1': Let x = Mint_0[p]. Let x_1 = Mint_0[shiftfield_F1_i1(p)]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function fits2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 19) in 'fits2': Let x = Mint_0[shiftfield_F2_i2(p)]. Let x_1 = Mint_0[shiftfield_F1_i1(shiftfield_F3_ic3(p))]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function fits3 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 27) in 'fits3': Let x = Mint_0[shiftfield_F2_i2(p)]. Let x_1 = Mint_0 [shiftfield_F1_i1(shift___anonstruct_L1_1(shiftfield_F4_ic4(p), 0))]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function fits4 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 37) in 'fits4': Let x = Mchar_0[shiftfield_F6_c6(p)]. Let x_1 = Mchar_0 [shiftfield_F3_c3(shift___anonstruct_L3_3(shiftfield_F5_ci5(p), 1))]. Assume { Type: is_sint8(x) /\ is_sint32(x) /\ is_sint8(x_1). (* Heap *) Have: (region(p.base) <= 0) /\ sconst(Mchar_0). } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function fits5 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 45) in 'fits5': Let x = Mint_0[p]. Let x_1 = Mint_0[shiftfield_F7_u7(p)]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function mismatch1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 11) in 'mismatch1': tests/wp_typed/cast_fits.i:13: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: __anonstruct_L2_2*) (target: sint32*) Let x = Mint_0[q]. Let x_1 = Mchar_0[shiftfield_F2_c2(p)]. Assume { Type: is_sint32(x) /\ is_sint8(x_1). (* Heap *) Have: (region(p.base) <= 0) /\ sconst(Mchar_0). } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function mismatch2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 52) in 'mismatch2': tests/wp_typed/cast_fits.i:54: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: __anonunion_L8_8*) (target: sint32*) Let x = Mint_0[q]. Let x_1 = Mint_0[shiftfield_F8_i8(p)]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ ------------------------------------------------------------ Function mismatch3 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/cast_fits.i, line 58) in 'mismatch3': tests/wp_typed/cast_fits.i:60: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: __anonunion_L8_8*) Let x = Mint_0[p]. Let x_1 = Mint_0[shiftfield_F8_i8(q)]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: region(p.base) <= 0. } Prove: x_1 = x. ------------------------------------------------------------ �������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/mvar.0.res.oracle�������������������������0000666�0000000�0000000�00000001322�13571573400�023433� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/mvar.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_typed/mvar.i:14: Warning: No code nor implicit assigns clause for function Write, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function Job ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/mvar.i, line 12) in 'Job': Assume { (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Call 'Write' *) Have: A[0] = 1. } Prove: P_equal(1, 1). ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/mvar.1.res.oracle�������������������������0000666�0000000�0000000�00000001352�13571573400�023437� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/mvar.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_typed/mvar.i:14: Warning: No code nor implicit assigns clause for function Write, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function Job ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/mvar.i, line 12) in 'Job': Assume { (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Call 'Write' *) Have: A[0] = 1. } Prove: P_equal(1, 1). ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/shift_lemma.0.res.oracle������������������0000666�0000000�0000000�00000004207�13571573400�024763� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/shift_lemma.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 21): Let x = Mint_0[shiftfield_F2_s_d(p)]. Let a = shiftfield_F2_s_u(p). Assume { Type: is_sint32(x) /\ is_sint32(Mint_0[shiftfield_F2_s_e(p)]) /\ is_sint32(Mint_0[shiftfield_F1_t_c(shift_t(a, 0))]) /\ is_sint32(Mint_0[shiftfield_F1_t_c(shift_t(a, 1))]). (* Heap *) Have: region(p.base) <= 0. (* Pre-condition *) Have: P_inv(Mint_0, p). } Prove: x = 0. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 22): Let a = shiftfield_F2_s_u(p). Assume { Type: is_sint32(Mint_0[shiftfield_F2_s_e(p)]) /\ is_sint32(Mint_0[shiftfield_F1_t_c(shift_t(a, 0))]) /\ is_sint32(Mint_0[shiftfield_F1_t_c(shift_t(a, 1))]). (* Goal *) When: (0 <= i) /\ (i <= 9) /\ is_sint32(i). (* Heap *) Have: region(p.base) <= 0. (* Pre-condition *) Have: P_inv(Mint_0, p). (* Assertion *) Have: Mint_0[shiftfield_F2_s_d(p)] = 0. } Prove: Mint_0[shiftfield_F1_t_c(shift_t(a, i))] = 0. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 23): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 24): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 25): Let x = Mint_0[shiftfield_F2_s_e(p)]. Assume { Type: is_sint32(x). (* Heap *) Have: region(p.base) <= 0. (* Pre-condition *) Have: P_inv(Mint_0, p). (* Assertion *) Have: Mint_0[shiftfield_F2_s_d(p)] = 0. (* Assertion *) Have: forall i : Z. ((0 <= i) -> ((i <= 9) -> (Mint_0[shiftfield_F1_t_c(shift_t(shiftfield_F2_s_u(p), i))] = 0))). } Prove: x = 0. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/shift_lemma.1.res.oracle������������������0000666�0000000�0000000�00000004237�13571573400�024767� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/shift_lemma.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 21): Let x = Mint_0[shiftfield_F2_s_d(p)]. Let a = shiftfield_F2_s_u(p). Assume { Type: is_sint32(x) /\ is_sint32(Mint_0[shiftfield_F2_s_e(p)]) /\ is_sint32(Mint_0[shiftfield_F1_t_c(shift_t(a, 0))]) /\ is_sint32(Mint_0[shiftfield_F1_t_c(shift_t(a, 1))]). (* Heap *) Have: region(p.base) <= 0. (* Pre-condition *) Have: P_inv(Mint_0, p). } Prove: x = 0. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 22): Let a = shiftfield_F2_s_u(p). Assume { Type: is_sint32(Mint_0[shiftfield_F2_s_e(p)]) /\ is_sint32(Mint_0[shiftfield_F1_t_c(shift_t(a, 0))]) /\ is_sint32(Mint_0[shiftfield_F1_t_c(shift_t(a, 1))]). (* Goal *) When: (0 <= i) /\ (i <= 9) /\ is_sint32(i). (* Heap *) Have: region(p.base) <= 0. (* Pre-condition *) Have: P_inv(Mint_0, p). (* Assertion *) Have: Mint_0[shiftfield_F2_s_d(p)] = 0. } Prove: Mint_0[shiftfield_F1_t_c(shift_t(a, i))] = 0. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 23): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 24): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/shift_lemma.i, line 25): Let x = Mint_0[shiftfield_F2_s_e(p)]. Assume { Type: is_sint32(x). (* Heap *) Have: region(p.base) <= 0. (* Pre-condition *) Have: P_inv(Mint_0, p). (* Assertion *) Have: Mint_0[shiftfield_F2_s_d(p)] = 0. (* Assertion *) Have: forall i : Z. ((0 <= i) -> ((i <= 9) -> (Mint_0[shiftfield_F1_t_c(shift_t(shiftfield_F2_s_u(p), i))] = 0))). } Prove: x = 0. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/struct_array_type.res.oracle��������������0000666�0000000�0000000�00000003003�13571573400�026111� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/struct_array_type.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp:print-generated] theory WP (* use why3.BuiltIn.BuiltIn *) (* use bool.Bool *) (* use int.Int *) (* use int.ComputerDivision *) (* use real.RealInfix *) (* use frama_c_wp.qed.Qed *) (* use map.Map *) (* use S1_s *) (* use frama_c_wp.cint.Cint *) goal wp_goal : forall i:int, t:int -> S1_s. let a = get t i in let a1 = get (F1_s_b a) 0 in let a2 = get (F1_s_a a) 0 in let a3 = 2 * a2 in 0 <= i -> a1 < a2 -> i <= 9 -> is_uint32 i -> is_sint32 a2 -> is_sint32 a1 -> is_sint32 ((1 + ((- 1) * a1)) + a3) -> (2 * a1) <= a3 end [wp] 1 goal generated ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/struct_array_type.i, line 16) in 'f': Let a = t[SynchroId_0]. Let a_1 = (a.F1_s_b)[0]. Let a_2 = (a.F1_s_a)[0]. Let a_3 = 2 * a_2. Assume { Type: is_uint32(SynchroId_0) /\ is_sint32(a_2) /\ is_sint32(a_1) /\ is_sint32(1 + a_3 - a_1). (* Residual *) When: a_1 < a_2. (* Pre-condition *) Have: (0 <= SynchroId_0) /\ (SynchroId_0 <= 9). } Prove: (2 * a_1) <= a_3. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_alloc.0.res.oracle�������������������0000666�0000000�0000000�00000004003�13571573400�024616� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_alloc.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assigns nothing in 'f': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Assigns nothing in 'g': Effect at line 31 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function h ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/unit_alloc.i, line 33) in 'h': Assume { (* Heap *) Have: linked(Malloc_0). } Prove: !valid_rw(Malloc_0[P_x_38 <- 0], global(P_x_38), 1). ------------------------------------------------------------ ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_alloc.i, line 15): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_alloc.i, line 21): Assume { (* Heap *) Have: (region(p.base) <= 0) /\ linked(Malloc_0). } Prove: valid_rw(Malloc_0[L_y_23 <- 1], global(L_y_23), 1). ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_alloc.i, line 22): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_alloc.i, line 24): Let a = global(L_y_23). Assume { (* Heap *) Have: (region(p.base) <= 0) /\ linked(Malloc_0). (* Assertion *) Have: valid_rw(Malloc_0[L_y_23 <- 1], a, 1). } Prove: !valid_rw(Malloc_0[L_y_23 <- 0], a, 1). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_alloc.1.res.oracle�������������������0000666�0000000�0000000�00000004033�13571573400�024622� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_alloc.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assigns nothing in 'f': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function g ------------------------------------------------------------ Goal Assigns nothing in 'g': Effect at line 31 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function h ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/unit_alloc.i, line 33) in 'h': Assume { (* Heap *) Have: linked(Malloc_0). } Prove: !valid_rw(Malloc_0[P_x_38 <- 0], global(P_x_38), 1). ------------------------------------------------------------ ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_alloc.i, line 15): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_alloc.i, line 21): Assume { (* Heap *) Have: (region(p.base) <= 0) /\ linked(Malloc_0). } Prove: valid_rw(Malloc_0[L_y_23 <- 1], global(L_y_23), 1). ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_alloc.i, line 22): Prove: true. ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_alloc.i, line 24): Let a = global(L_y_23). Assume { (* Heap *) Have: (region(p.base) <= 0) /\ linked(Malloc_0). (* Assertion *) Have: valid_rw(Malloc_0[L_y_23 <- 1], a, 1). } Prove: !valid_rw(Malloc_0[L_y_23 <- 0], a, 1). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_bitwise.res.oracle�������������������0000666�0000000�0000000�00000037135�13571573400�025050� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_bitwise.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma band_sint8: Assume: 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: let x_1 = (land x_0 y_0) in (is_sint8 x_0) -> (is_sint8 y_0) -> ((to_sint8 x_1)=x_1) ------------------------------------------------------------ Lemma band_uint8: Assume: 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: let x_1 = (land x_0 y_0) in (is_uint8 x_0) -> (is_uint8 y_0) -> ((to_uint8 x_1)=x_1) ------------------------------------------------------------ Lemma blsr_sint8: Assume: 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: let x_1 = (lsr x_0 y_0) in (0<=y_0) -> (is_sint8 x_0) -> (is_sint8 y_0) -> ((to_sint8 x_1)=x_1) ------------------------------------------------------------ Lemma blsr_uint8: Assume: 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: let x_1 = (lsr x_0 y_0) in (0<=y_0) -> (is_uint8 x_0) -> (is_uint8 y_0) -> ((to_uint8 x_1)=x_1) ------------------------------------------------------------ Lemma bnot_sint8: Prove: let x_1 = (lnot x_0) in (is_sint8 x_0) -> ((to_sint8 x_1)=x_1) ------------------------------------------------------------ Lemma bor_sint8: Assume: 'bxor_sint8' 'bnot_sint8' Prove: let x_1 = (lor x_0 y_0) in (is_sint8 x_0) -> (is_sint8 y_0) -> ((to_sint8 x_1)=x_1) ------------------------------------------------------------ Lemma bor_uint8: Assume: 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: (is_uint8 x_0) -> (is_uint8 y_0) -> ((lor (to_uint8 x_0) (to_uint8 y_0))=(lor x_0 y_0)) ------------------------------------------------------------ Lemma bxor_sint8: Assume: 'bnot_sint8' Prove: let x_1 = (lxor x_0 y_0) in (is_sint8 x_0) -> (is_sint8 y_0) -> ((to_sint8 x_1)=x_1) ------------------------------------------------------------ Lemma land_abs: Assume: 'land_com' 'land_assoc' 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ Lemma land_assoc: Assume: 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ Lemma land_com: Assume: 'land_assoc' 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ Lemma land_stb: Assume: 'land_abs' 'land_com' 'land_assoc' 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ Lemma lor_assoc: Assume: 'land_stb' 'land_abs' 'land_com' 'land_assoc' 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ Lemma lor_com: Assume: 'lor_assoc' 'land_stb' 'land_abs' 'land_com' 'land_assoc' 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ Lemma lor_neu: Assume: 'lor_com' 'lor_assoc' 'land_stb' 'land_abs' 'land_com' 'land_assoc' 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ Lemma lor_stb: Assume: 'lor_neu' 'lor_com' 'lor_assoc' 'land_stb' 'land_abs' 'land_com' 'land_assoc' 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ Lemma lxor_assoc: Assume: 'lor_stb' 'lor_neu' 'lor_com' 'lor_assoc' 'land_stb' 'land_abs' 'land_com' 'land_assoc' 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ Lemma lxor_com: Assume: 'lxor_assoc' 'lor_stb' 'lor_neu' 'lor_com' 'lor_assoc' 'land_stb' 'land_abs' 'land_com' 'land_assoc' 'blsr_uint8' 'band_uint8' 'bor_uint8' 'blsr_sint8' 'band_sint8' 'bor_sint8' 'bxor_sint8' 'bnot_sint8' Prove: true ------------------------------------------------------------ ------------------------------------------------------------ Function band1_uchar ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 116): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 117): Let x = land(1, a). Assume { Type: is_uint8(a) /\ is_uint8(x). } Prove: 0 <= x. ------------------------------------------------------------ ------------------------------------------------------------ Function band1_uint ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 51): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 52): Let x = land(1, a). Assume { Type: is_uint32(a) /\ is_uint32(x). } Prove: 0 <= x. ------------------------------------------------------------ ------------------------------------------------------------ Function band1_ulong ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 169): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 170): Let x = land(1, a). Assume { Type: is_uint32(a) /\ is_uint32(x). } Prove: 0 <= x. ------------------------------------------------------------ ------------------------------------------------------------ Function band1_ushort ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 164): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 165): Let x = land(1, a). Assume { Type: is_uint16(a) /\ is_uint16(x). } Prove: 0 <= x. ------------------------------------------------------------ ------------------------------------------------------------ Function band_char ------------------------------------------------------------ Goal Post-condition 'ok' in 'band_char': Let x = land(a, b). Assume { Type: is_sint8(a) /\ is_sint8(b). } Prove: to_sint8(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function band_int ------------------------------------------------------------ Goal Post-condition 'ok' in 'band_int': Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 19): Prove: true. ------------------------------------------------------------ Goal Assertion 'ko' (file tests/wp_typed/unit_bitwise.c, line 20): Assume { Type: is_sint32(a). } Prove: land(281, a) <= 172. ------------------------------------------------------------ ------------------------------------------------------------ Function band_uchar ------------------------------------------------------------ Goal Post-condition 'ok' in 'band_uchar': Let x = land(a, b). Assume { Type: is_uint8(a) /\ is_uint8(b). } Prove: to_uint8(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function band_uint ------------------------------------------------------------ Goal Post-condition 'ok' in 'band_uint': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bnot_char ------------------------------------------------------------ Goal Post-condition 'ok' in 'bnot_char': Let x = lnot(a). Assume { Type: is_sint8(a). } Prove: to_sint8(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function bnot_int ------------------------------------------------------------ Goal Post-condition 'ok' in 'bnot_int': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bnot_uchar ------------------------------------------------------------ Goal Post-condition 'ok' in 'bnot_uchar': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko' in 'bnot_uchar': Let x = lnot(a). Assume { Type: is_uint8(a). } Prove: to_uint8(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function bnot_uint ------------------------------------------------------------ Goal Post-condition 'ok' in 'bnot_uint': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ko' in 'bnot_uint': Let x = lnot(a). Assume { Type: is_uint32(a). } Prove: to_uint32(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function bor_char ------------------------------------------------------------ Goal Post-condition 'ok' in 'bor_char': Let x = lor(a, b). Assume { Type: is_sint8(a) /\ is_sint8(b). } Prove: to_sint8(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function bor_int ------------------------------------------------------------ Goal Post-condition 'ok' in 'bor_int': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bor_uchar ------------------------------------------------------------ Goal Post-condition 'ok' in 'bor_uchar': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bor_uint ------------------------------------------------------------ Goal Post-condition 'ok' in 'bor_uint': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor_char ------------------------------------------------------------ Goal Post-condition 'ok' in 'bxor_char': Let x = lxor(a, b). Assume { Type: is_sint8(a) /\ is_sint8(b). } Prove: to_sint8(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor_int ------------------------------------------------------------ Goal Post-condition 'ok' in 'bxor_int': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor_uchar ------------------------------------------------------------ Goal Post-condition 'ok' in 'bxor_uchar': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok' in 'bxor_uchar': Let x = lxor(a, b). Assume { Type: is_uint8(a) /\ is_uint8(b). } Prove: to_uint8(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function bxor_uint ------------------------------------------------------------ Goal Post-condition 'ok' in 'bxor_uint': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ok' in 'bxor_uint': Let x = lxor(a, b). Assume { Type: is_uint32(a) /\ is_uint32(b). } Prove: to_uint32(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function cast ------------------------------------------------------------ Goal Post-condition 'ok' in 'cast': Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 176): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 177): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 178): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 180): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 181): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 182): Prove: true. ------------------------------------------------------------ Goal Assertion 'ok' (file tests/wp_typed/unit_bitwise.c, line 184): Prove: true. ------------------------------------------------------------ Goal Assertion 'ko' (file tests/wp_typed/unit_bitwise.c, line 186): Let x = to_sint8(c). Assume { Type: is_uint8(c). } Prove: to_uint32(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function lshift_char ------------------------------------------------------------ Goal Post-condition 'ok' in 'lshift_char': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function lshift_int ------------------------------------------------------------ Goal Post-condition 'ok' in 'lshift_int': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function lshift_uchar ------------------------------------------------------------ Goal Post-condition 'ok' in 'lshift_uchar': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function lshift_uint ------------------------------------------------------------ Goal Post-condition 'ok' in 'lshift_uint': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function rshift_char ------------------------------------------------------------ Goal Post-condition 'ok' in 'rshift_char': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function rshift_int ------------------------------------------------------------ Goal Post-condition 'ok' in 'rshift_int': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function rshift_uchar ------------------------------------------------------------ Goal Post-condition 'ok' in 'rshift_uchar': Let x = lsr(a, n). Assume { Type: is_uint8(a) /\ is_uint8(n). } Prove: to_uint8(x) = x. ------------------------------------------------------------ ------------------------------------------------------------ Function rshift_uint ------------------------------------------------------------ Goal Post-condition 'ok' in 'rshift_uint': Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_call.0.res.oracle��������������������0000666�0000000�0000000�00000001322�13571573400�024440� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_call.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_typed/unit_call.i:7: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_call.i, line 14): Assume { Type: is_sint32(r_1) /\ is_sint32(r). (* Call 'f' *) Have: r < 0. (* Call 'f' *) Have: 0 < r_1. } Prove: r != r_1. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_call.1.res.oracle��������������������0000666�0000000�0000000�00000001352�13571573400�024444� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_call.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_typed/unit_call.i:7: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/unit_call.i, line 14): Assume { Type: is_sint32(r_1) /\ is_sint32(r). (* Call 'f' *) Have: r < 0. (* Call 'f' *) Have: 0 < r_1. } Prove: r != r_1. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_cast.0.res.oracle��������������������0000666�0000000�0000000�00000001600�13571573400�024456� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_cast.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/unit_cast.i:4: Warning: Cast with incompatible pointers types (source: sint32*) (target: sint8*) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'OUT' (file tests/wp_typed/unit_cast.i, line 5): tests/wp_typed/unit_cast.i:4: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: sint8*) Let x = Mchar_0[w]. Assume { Type: is_sint8(x). (* Heap *) Have: (region(p.base) <= 0) /\ (region(v.base) <= 0) /\ sconst(Mchar_0). } Prove: x <= 255. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_cast.1.res.oracle��������������������0000666�0000000�0000000�00000001630�13571573400�024462� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_cast.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/unit_cast.i:4: Warning: Cast with incompatible pointers types (source: sint32*) (target: sint8*) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'OUT' (file tests/wp_typed/unit_cast.i, line 5): tests/wp_typed/unit_cast.i:4: warning from Typed Model: - Warning: Hide sub-term definition Reason: Cast with incompatible pointers types (source: sint32*) (target: sint8*) Let x = Mchar_0[w]. Assume { Type: is_sint8(x). (* Heap *) Have: (region(p.base) <= 0) /\ (region(v.base) <= 0) /\ sconst(Mchar_0). } Prove: x <= 255. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_cst.0.res.oracle���������������������0000666�0000000�0000000�00000001022�13571573400�024313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_cst.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'A' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'B' in 'f': Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_cst.1.res.oracle���������������������0000666�0000000�0000000�00000001052�13571573400�024317� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_cst.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition 'A' in 'f': Prove: true. ------------------------------------------------------------ Goal Post-condition 'B' in 'f': Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_float.res.oracle���������������������0000666�0000000�0000000�00000002374�13571573400�024504� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed' [...] [kernel] Parsing tests/wp_typed/unit_float.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_typed/unit_float.i:21: Warning: Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Post-condition 'CST_F' in 'main': Prove: true. ------------------------------------------------------------ Goal Post-condition 'CST_D' in 'main': Prove: true. ------------------------------------------------------------ Goal Post-condition 'CNV_F' in 'main': Prove: true. ------------------------------------------------------------ Goal Post-condition 'CNV_D' in 'main': Prove: true. ------------------------------------------------------------ Goal Post-condition 'VAR_F' in 'main': Prove: true. ------------------------------------------------------------ Goal Post-condition 'VAR_D' in 'main': Prove: true. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_hard.0.res.oracle��������������������0000666�0000000�0000000�00000001501�13571573400�024442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_hard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition 'p_is_33FF' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'q_is_66F0' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'r_is_q1_ko' in 'main': Let a = addr_of_int(26352). Assume { (* Heap *) Have: (region(addr_of_int(13311).base) <= 0) /\ (region(a.base) <= 0). } Prove: shift_sint32(a, 1) = addr_of_int(26360). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_hard.1.res.oracle��������������������0000666�0000000�0000000�00000001531�13571573400�024446� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_hard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Pre-condition 'p_is_33FF' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'q_is_66F0' in 'main': Prove: true. ------------------------------------------------------------ Goal Pre-condition 'r_is_q1_ko' in 'main': Let a = addr_of_int(26352). Assume { (* Heap *) Have: (region(addr_of_int(13311).base) <= 0) /\ (region(a.base) <= 0). } Prove: shift_sint32(a, 1) = addr_of_int(26360). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_ite.0.res.oracle���������������������0000666�0000000�0000000�00000000723�13571573400�024312� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_ite.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function check ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/unit_ite.i, line 2) in 'check': Prove: true. ------------------------------------------------------------ ���������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_ite.1.res.oracle���������������������0000666�0000000�0000000�00000001165�13571573400�024314� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_ite.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function check ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/unit_ite.i, line 2) in 'check': Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'check': /*@ behavior typed_ref: requires \valid(p); */ void check(int x, int *p); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_labels.0.res.oracle������������������0000666�0000000�0000000�00000004111�13571573400�024766� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_labels.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function duplet ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/unit_labels.i, line 5) in 'duplet': Let x = Mint_0[pi_0]. Let a_1 = shift_sint32(a, x). Let x_1 = Mint_0[pj_0]. Let m = Mint_0[a_1 <- Mint_0[shift_sint32(a, x_1)]]. Assume { Type: is_sint32(x) /\ is_sint32(x_1). (* Heap *) Have: (region(a.base) <= 0) /\ (region(pi_0.base) <= 0) /\ (region(pj_0.base) <= 0). (* Pre-condition *) Have: (pj_0 != pi_0) /\ (a_1 != pi_0) /\ (a_1 != pj_0). (* Assertion 'PI' *) Have: m[pi_0] = x. (* Assertion 'PJ' *) Have: m[pj_0] = x_1. } Prove: P_is_duplet(m, a, x, x_1). ------------------------------------------------------------ Goal Assertion 'PI' (file tests/wp_typed/unit_labels.i, line 9): Let x = Mint_0[pi_0]. Let a_1 = shift_sint32(a, x). Let x_1 = Mint_0[pj_0]. Let m = Mint_0[a_1 <- Mint_0[shift_sint32(a, x_1)]]. Let x_2 = m[pi_0]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(m[pj_0]). (* Heap *) Have: (region(a.base) <= 0) /\ (region(pi_0.base) <= 0) /\ (region(pj_0.base) <= 0). (* Pre-condition *) Have: (pj_0 != pi_0) /\ (a_1 != pi_0) /\ (a_1 != pj_0). } Prove: x_2 = x. ------------------------------------------------------------ Goal Assertion 'PJ' (file tests/wp_typed/unit_labels.i, line 10): Let x = Mint_0[pi_0]. Let a_1 = shift_sint32(a, x). Let x_1 = Mint_0[pj_0]. Let m = Mint_0[a_1 <- Mint_0[shift_sint32(a, x_1)]]. Let x_2 = m[pj_0]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Heap *) Have: (region(a.base) <= 0) /\ (region(pi_0.base) <= 0) /\ (region(pj_0.base) <= 0). (* Pre-condition *) Have: (pj_0 != pi_0) /\ (a_1 != pi_0) /\ (a_1 != pj_0). (* Assertion 'PI' *) Have: m[pi_0] = x. } Prove: x_2 = x_1. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_labels.1.res.oracle������������������0000666�0000000�0000000�00000002303�13571573400�024770� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_labels.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function duplet ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/unit_labels.i, line 5) in 'duplet': Assume { Type: is_sint32(pi_0) /\ is_sint32(pj_0). (* Heap *) Have: region(a.base) <= 0. } Prove: P_is_duplet(Mint_0[shift_sint32(a, pi_0) <- Mint_0[shift_sint32(a, pj_0)]], a, pi_0, pj_0). ------------------------------------------------------------ Goal Assertion 'PI' (file tests/wp_typed/unit_labels.i, line 9): Prove: true. ------------------------------------------------------------ Goal Assertion 'PJ' (file tests/wp_typed/unit_labels.i, line 10): Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'duplet': /*@ behavior typed_ref: requires \separated(pi,pj,a+(..)); requires \valid(pi); requires \valid(pj); */ void duplet(int *a, int *pi, int *pj); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_lemma.0.res.oracle�������������������0000666�0000000�0000000�00000003142�13571573400�024622� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_lemma.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma P23_KO: Prove: (P_P2 x_0) -> (P_P3 x_0) ------------------------------------------------------------ Lemma P52: Assume: 'P14' 'P34' 'P13' 'P23_KO' Prove: (P_P5 x_0) -> (P_P2 x_0) ------------------------------------------------------------ ------------------------------------------------------------ Axiomatic 'G1' ------------------------------------------------------------ Lemma P13: Assume: 'P23_KO' Prove: (P_P1 x_0) -> (P_P3 x_0) ------------------------------------------------------------ Lemma P14: Assume: 'P34' 'P13' 'P23_KO' Prove: (P_P1 x_0) -> (P_P4 x_0) ------------------------------------------------------------ ------------------------------------------------------------ Axiomatic 'G2' ------------------------------------------------------------ Lemma P54: Assume: 'P52' 'P14' 'P34' 'P13' 'P23_KO' Prove: (P_P5 x_0) -> (P_P4 x_0) ------------------------------------------------------------ ------------------------------------------------------------ Axiomatic 'Poluted' ------------------------------------------------------------ Lemma Foo: Prove: (P_H 0) -> (forall i_0:int. (0<i_0) -> (P_H i_0)) -> (forall i_0:int. (i_0<0) -> (P_H i_0)) -> (forall i_0:int. (P_H i_0)) ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_lemma.1.res.oracle�������������������0000666�0000000�0000000�00000003172�13571573400�024626� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_lemma.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma P23_KO: Prove: (P_P2 x_0) -> (P_P3 x_0) ------------------------------------------------------------ Lemma P52: Assume: 'P14' 'P34' 'P13' 'P23_KO' Prove: (P_P5 x_0) -> (P_P2 x_0) ------------------------------------------------------------ ------------------------------------------------------------ Axiomatic 'G1' ------------------------------------------------------------ Lemma P13: Assume: 'P23_KO' Prove: (P_P1 x_0) -> (P_P3 x_0) ------------------------------------------------------------ Lemma P14: Assume: 'P34' 'P13' 'P23_KO' Prove: (P_P1 x_0) -> (P_P4 x_0) ------------------------------------------------------------ ------------------------------------------------------------ Axiomatic 'G2' ------------------------------------------------------------ Lemma P54: Assume: 'P52' 'P14' 'P34' 'P13' 'P23_KO' Prove: (P_P5 x_0) -> (P_P4 x_0) ------------------------------------------------------------ ------------------------------------------------------------ Axiomatic 'Poluted' ------------------------------------------------------------ Lemma Foo: Prove: (P_H 0) -> (forall i_0:int. (0<i_0) -> (P_H i_0)) -> (forall i_0:int. (i_0<0) -> (P_H i_0)) -> (forall i_0:int. (P_H i_0)) ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_local.0.res.oracle�������������������0000666�0000000�0000000�00000001632�13571573400�024623� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_local.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function bar ------------------------------------------------------------ Goal Assigns nothing in 'bar': Effect at line 28 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Assigns nothing in 'foo' (1/2): Effect at line 18 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'foo' (2/2): Effect at line 19 Assume { (* Heap *) Have: linked(Malloc_0). } Prove: invalid(Malloc_0, global(L_a_21), 1). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_local.1.res.oracle�������������������0000666�0000000�0000000�00000002163�13571573400�024624� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Raw)' [...] [kernel] Parsing tests/wp_typed/unit_local.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function bar ------------------------------------------------------------ Goal Assigns nothing in 'bar': Effect at line 28 Assume { (* Heap *) Have: linked(Malloc_0). } Prove: invalid(Malloc_0, global(L_a_26), 1). ------------------------------------------------------------ ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Assigns nothing in 'foo' (1/2): Effect at line 18 Assume { (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, global(L_pa_22), 1). ------------------------------------------------------------ Goal Assigns nothing in 'foo' (2/2): Effect at line 19 Assume { (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). } Prove: invalid(Malloc_0, global(L_a_21), 1). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_loopscope.0.res.oracle���������������0000666�0000000�0000000�00000001570�13571573400�025535� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_loopscope.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/unit_loopscope.i:14: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_typed/unit_loopscope.i, line 13): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_typed/unit_loopscope.i, line 13): Assume { (* Heap *) Have: (region(written_0.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, written_0, 1). } Prove: false. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_loopscope.1.res.oracle���������������0000666�0000000�0000000�00000001615�13571573400�025536� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_loopscope.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/unit_loopscope.i:14: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_typed/unit_loopscope.i, line 13): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_typed/unit_loopscope.i, line 13): Prove: false. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'f': /*@ behavior typed_ref: requires \valid(written); */ void f(unsigned int *written); �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_matrix.0.res.oracle������������������0000666�0000000�0000000�00000002003�13571573400�025026� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_matrix.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function make ------------------------------------------------------------ Goal Post-condition 'OK1' in 'make': Let m = t[a <- t[a][b <- 1]]. Let x = m[c <- m[c][d <- 2]][a][b]. Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(c) /\ is_sint32(d) /\ is_sint32(x). (* Goal *) When: c != a. } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'OK2' in 'make': Prove: true. ------------------------------------------------------------ Goal Post-condition 'KO' in 'make': Let m = t[a <- t[a][b <- 1]]. Let x = m[c <- m[c][d <- 2]][a][b]. Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(c) /\ is_sint32(d) /\ is_sint32(x). } Prove: x = 1. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_matrix.1.res.oracle������������������0000666�0000000�0000000�00000002033�13571573400�025032� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_matrix.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function make ------------------------------------------------------------ Goal Post-condition 'OK1' in 'make': Let m = t[a <- t[a][b <- 1]]. Let x = m[c <- m[c][d <- 2]][a][b]. Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(c) /\ is_sint32(d) /\ is_sint32(x). (* Goal *) When: c != a. } Prove: x = 1. ------------------------------------------------------------ Goal Post-condition 'OK2' in 'make': Prove: true. ------------------------------------------------------------ Goal Post-condition 'KO' in 'make': Let m = t[a <- t[a][b <- 1]]. Let x = m[c <- m[c][d <- 2]][a][b]. Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(c) /\ is_sint32(d) /\ is_sint32(x). } Prove: x = 1. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_string.0.res.oracle������������������0000666�0000000�0000000�00000006314�13571573400�025041� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_string.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'AB' (file tests/wp_typed/unit_string.i, line 11): Assume { Type: is_sint8(Mchar_0[shift_sint8(global(Str_3), 3)]). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). } Prove: Str_4 != Str_3. ------------------------------------------------------------ Goal Assertion 'B_valid' (file tests/wp_typed/unit_string.i, line 12): Let a = global(Str_3). Assume { Type: is_sint8(Mchar_0[shift_sint8(a, 3)]). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. } Prove: valid_rd(Malloc_0, shift_sint8(a, 0), 3). ------------------------------------------------------------ Goal Assertion 'B_end' (file tests/wp_typed/unit_string.i, line 13): Let a = global(Str_3). Let a_1 = shift_sint8(a, 3). Let x = Mchar_0[a_1]. Assume { Type: is_sint8(x). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. (* Assertion 'B_valid' *) Have: valid_rd(Malloc_0, shift_sint8(a, 0), 3). } Prove: (x = 0) /\ valid_rd(Malloc_0, a_1, 1). ------------------------------------------------------------ Goal Assertion 'B_out' (file tests/wp_typed/unit_string.i, line 14): Let a = global(Str_3). Let a_1 = shift_sint8(a, 3). Assume { (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. (* Assertion 'B_valid' *) Have: valid_rd(Malloc_0, shift_sint8(a, 0), 3). (* Assertion 'B_end' *) Have: (Mchar_0[a_1] = 0) /\ valid_rd(Malloc_0, a_1, 1). } Prove: !valid_rd(Malloc_0, shift_sint8(a, 4), 1). ------------------------------------------------------------ Goal Assertion 'B_rw' (file tests/wp_typed/unit_string.i, line 15): Let a = global(Str_3). Let a_1 = shift_sint8(a, 3). Assume { (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. (* Assertion 'B_valid' *) Have: valid_rd(Malloc_0, shift_sint8(a, 0), 3). (* Assertion 'B_end' *) Have: (Mchar_0[a_1] = 0) /\ valid_rd(Malloc_0, a_1, 1). (* Assertion 'B_out' *) Have: !valid_rd(Malloc_0, shift_sint8(a, 4), 1). } Prove: !valid_rw(Malloc_0, shift_sint8(a, 1), 1). ------------------------------------------------------------ Goal Assertion 'VAL' (file tests/wp_typed/unit_string.i, line 16): Let a = global(Str_3). Let a_1 = shift_sint8(a, 3). Assume { (* Goal *) When: (0 <= i) /\ (i <= 2). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. (* Assertion 'B_valid' *) Have: valid_rd(Malloc_0, shift_sint8(a, 0), 3). (* Assertion 'B_end' *) Have: (Mchar_0[a_1] = 0) /\ valid_rd(Malloc_0, a_1, 1). (* Assertion 'B_out' *) Have: !valid_rd(Malloc_0, shift_sint8(a, 4), 1). (* Assertion 'B_rw' *) Have: !valid_rw(Malloc_0, shift_sint8(a, 1), 1). } Prove: Mchar_0[shift_sint8(global(Str_1), 3 + i)] = Mchar_0[shift_sint8(a, i)]. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_string.1.res.oracle������������������0000666�0000000�0000000�00000006344�13571573400�025045� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_string.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assertion 'AB' (file tests/wp_typed/unit_string.i, line 11): Assume { Type: is_sint8(Mchar_0[shift_sint8(global(Str_3), 3)]). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). } Prove: Str_4 != Str_3. ------------------------------------------------------------ Goal Assertion 'B_valid' (file tests/wp_typed/unit_string.i, line 12): Let a = global(Str_3). Assume { Type: is_sint8(Mchar_0[shift_sint8(a, 3)]). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. } Prove: valid_rd(Malloc_0, shift_sint8(a, 0), 3). ------------------------------------------------------------ Goal Assertion 'B_end' (file tests/wp_typed/unit_string.i, line 13): Let a = global(Str_3). Let a_1 = shift_sint8(a, 3). Let x = Mchar_0[a_1]. Assume { Type: is_sint8(x). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. (* Assertion 'B_valid' *) Have: valid_rd(Malloc_0, shift_sint8(a, 0), 3). } Prove: (x = 0) /\ valid_rd(Malloc_0, a_1, 1). ------------------------------------------------------------ Goal Assertion 'B_out' (file tests/wp_typed/unit_string.i, line 14): Let a = global(Str_3). Let a_1 = shift_sint8(a, 3). Assume { (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. (* Assertion 'B_valid' *) Have: valid_rd(Malloc_0, shift_sint8(a, 0), 3). (* Assertion 'B_end' *) Have: (Mchar_0[a_1] = 0) /\ valid_rd(Malloc_0, a_1, 1). } Prove: !valid_rd(Malloc_0, shift_sint8(a, 4), 1). ------------------------------------------------------------ Goal Assertion 'B_rw' (file tests/wp_typed/unit_string.i, line 15): Let a = global(Str_3). Let a_1 = shift_sint8(a, 3). Assume { (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. (* Assertion 'B_valid' *) Have: valid_rd(Malloc_0, shift_sint8(a, 0), 3). (* Assertion 'B_end' *) Have: (Mchar_0[a_1] = 0) /\ valid_rd(Malloc_0, a_1, 1). (* Assertion 'B_out' *) Have: !valid_rd(Malloc_0, shift_sint8(a, 4), 1). } Prove: !valid_rw(Malloc_0, shift_sint8(a, 1), 1). ------------------------------------------------------------ Goal Assertion 'VAL' (file tests/wp_typed/unit_string.i, line 16): Let a = global(Str_3). Let a_1 = shift_sint8(a, 3). Assume { (* Goal *) When: (0 <= i) /\ (i <= 2). (* Heap *) Have: linked(Malloc_0) /\ sconst(Mchar_0). (* Assertion 'AB' *) Have: Str_4 != Str_3. (* Assertion 'B_valid' *) Have: valid_rd(Malloc_0, shift_sint8(a, 0), 3). (* Assertion 'B_end' *) Have: (Mchar_0[a_1] = 0) /\ valid_rd(Malloc_0, a_1, 1). (* Assertion 'B_out' *) Have: !valid_rd(Malloc_0, shift_sint8(a, 4), 1). (* Assertion 'B_rw' *) Have: !valid_rw(Malloc_0, shift_sint8(a, 1), 1). } Prove: Mchar_0[shift_sint8(global(Str_1), 3 + i)] = Mchar_0[shift_sint8(a, i)]. ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_tset.0.res.oracle��������������������0000666�0000000�0000000�00000001654�13571573400�024514� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_tset.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function complex ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/unit_tset.i, line 6) in 'job'' in 'complex' at call 'job' (file tests/wp_typed/unit_tset.i, line 20) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function complex with behavior default_for_stmt_2 ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/unit_tset.i, line 19) at call 'job' (file tests/wp_typed/unit_tset.i, line 20): Call Effect at line 20 Prove: true. ------------------------------------------------------------ ������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/unit_tset.1.res.oracle��������������������0000666�0000000�0000000�00000001704�13571573400�024511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_tset.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function complex ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/unit_tset.i, line 6) in 'job'' in 'complex' at call 'job' (file tests/wp_typed/unit_tset.i, line 20) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function complex with behavior default_for_stmt_2 ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/unit_tset.i, line 19) at call 'job' (file tests/wp_typed/unit_tset.i, line 20): Call Effect at line 20 Prove: true. ------------------------------------------------------------ ������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_bitwise.0.res.oracle�����������������0000666�0000000�0000000�00000012444�13571573400�025201� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_bitwise.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function rl1 ------------------------------------------------------------ Goal Post-condition 'b0' in 'rl1': Prove: true. ------------------------------------------------------------ Goal Post-condition 'bk' in 'rl1': Let x_1 = lsr(x, 31). Assume { Type: is_uint32(x) /\ is_uint32(x_1). (* Goal *) When: (0 <= i) /\ (i <= 30) /\ is_sint32(i). } Prove: (land(lor(x_1, to_uint32(lsl(x, 1))), lsl(1, 1 + i)) != 0) <-> (land(x, lsl(1, i)) != 0). ------------------------------------------------------------ ------------------------------------------------------------ Function rln32 ------------------------------------------------------------ Goal Post-condition 'b1' in 'rln32': Let x_1 = -n. Let x_2 = lsr(x, 32 - n). Assume { Type: is_uint32(x) /\ is_sint32(n) /\ is_uint32(x_2). (* Goal *) When: (0 <= i) /\ (i < n) /\ is_sint32(i). (* Pre-condition *) Have: (0 < n) /\ (n <= 31). } Prove: (land(lor(to_uint32(lsl(x, n)), x_2), lsl(1, i)) != 0) <-> (land(x, lsl(1, 32 + i - n)) != 0). ------------------------------------------------------------ Goal Post-condition 'b2' in 'rln32': Let x_1 = i + n. Let x_2 = lsr(x, 32 - n). Assume { Type: is_uint32(x) /\ is_sint32(n) /\ is_uint32(x_2). (* Goal *) When: (0 <= i) /\ (x_1 <= 31) /\ is_sint32(i). (* Pre-condition *) Have: (0 < n) /\ (n <= 31). } Prove: (land(lor(to_uint32(lsl(x, n)), x_2), lsl(1, x_1)) != 0) <-> (land(x, lsl(1, i)) != 0). ------------------------------------------------------------ ------------------------------------------------------------ Function rln64 ------------------------------------------------------------ Goal Post-condition 'b1' in 'rln64': Let x_1 = -n. Let x_2 = lsr(x, 64 - n). Assume { Type: is_sint32(n) /\ is_uint64(x) /\ is_uint64(x_2). (* Goal *) When: (0 <= i) /\ (i < n) /\ is_sint32(i). (* Pre-condition *) Have: (0 < n) /\ (n <= 63). } Prove: (land(lor(to_uint64(lsl(x, n)), x_2), lsl(1, i)) != 0) <-> (land(x, lsl(1, 64 + i - n)) != 0). ------------------------------------------------------------ Goal Post-condition 'b2' in 'rln64': Let x_1 = i + n. Let x_2 = lsr(x, 64 - n). Assume { Type: is_sint32(n) /\ is_uint64(x) /\ is_uint64(x_2). (* Goal *) When: (0 <= i) /\ (x_1 <= 63) /\ is_sint32(i). (* Pre-condition *) Have: (0 < n) /\ (n <= 63). } Prove: (land(lor(to_uint64(lsl(x, n)), x_2), lsl(1, x_1)) != 0) <-> (land(x, lsl(1, i)) != 0). ------------------------------------------------------------ ------------------------------------------------------------ Function rr1 ------------------------------------------------------------ Goal Post-condition 'b0' in 'rr1': Assume { Type: is_uint32(x) /\ is_uint32(lsr(x, 1)). } Prove: (bit_test(x, 0) \/ bit_test(x, 32)) <-> bit_test(x, 0). ------------------------------------------------------------ Goal Post-condition 'bk' in 'rr1': Let x_1 = lsr(x, 1). Assume { Type: is_uint32(x) /\ is_uint32(x_1). (* Goal *) When: (0 <= i) /\ (i <= 30) /\ is_sint32(i). } Prove: (land(lor(x_1, to_uint32(lsl(x, 31))), lsl(1, i)) != 0) <-> (land(x, lsl(1, 1 + i)) != 0). ------------------------------------------------------------ ------------------------------------------------------------ Function rrn32 ------------------------------------------------------------ Goal Post-condition 'b1' in 'rrn32': Let x_1 = lsr(x, n). Let x_2 = -n. Assume { Type: is_uint32(x) /\ is_sint32(n) /\ is_uint32(x_1). (* Goal *) When: (0 <= i) /\ (i < n) /\ is_sint32(i). (* Pre-condition *) Have: (0 < n) /\ (n <= 31). } Prove: (land(lor(x_1, to_uint32(lsl(x, 32 - n))), lsl(1, 32 + i - n)) != 0) <-> (land(x, lsl(1, i)) != 0). ------------------------------------------------------------ Goal Post-condition 'b2' in 'rrn32': Let x_1 = i + n. Let x_2 = lsr(x, n). Assume { Type: is_uint32(x) /\ is_sint32(n) /\ is_uint32(x_2). (* Goal *) When: (0 <= i) /\ (x_1 <= 31) /\ is_sint32(i). (* Pre-condition *) Have: (0 < n) /\ (n <= 31). } Prove: (land(lor(x_2, to_uint32(lsl(x, 32 - n))), lsl(1, i)) != 0) <-> (land(x, lsl(1, x_1)) != 0). ------------------------------------------------------------ ------------------------------------------------------------ Function rrn64 ------------------------------------------------------------ Goal Post-condition 'b1' in 'rrn64': Let x_1 = lsr(x, n). Let x_2 = -n. Assume { Type: is_sint32(n) /\ is_uint64(x) /\ is_uint64(x_1). (* Goal *) When: (0 <= i) /\ (i < n) /\ is_sint32(i). (* Pre-condition *) Have: (0 < n) /\ (n <= 63). } Prove: (land(lor(x_1, to_uint64(lsl(x, 64 - n))), lsl(1, 64 + i - n)) != 0) <-> (land(x, lsl(1, i)) != 0). ------------------------------------------------------------ Goal Post-condition 'b2' in 'rrn64': Let x_1 = i + n. Let x_2 = lsr(x, n). Assume { Type: is_sint32(n) /\ is_uint64(x) /\ is_uint64(x_2). (* Goal *) When: (0 <= i) /\ (x_1 <= 63) /\ is_sint32(i). (* Pre-condition *) Have: (0 < n) /\ (n <= 63). } Prove: (land(lor(x_2, to_uint64(lsl(x, 64 - n))), lsl(1, i)) != 0) <-> (land(x, lsl(1, x_1)) != 0). ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_bitwise.1.res.oracle�����������������0000666�0000000�0000000�00000000351�13571573400�025174� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_bitwise.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] No proof obligations ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_collect.0.res.oracle�����������������0000666�0000000�0000000�00000025270�13571573400�025161� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_collect.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function caller ------------------------------------------------------------ Goal Post-condition 'K' in 'caller': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P1' in 'caller': Let x = k - 1. Let m = p[x <- v]. Let m_1 = m[k <- v_1]. Assume { Type: IsArray1_sint32(p) /\ is_sint32(k) /\ is_sint32(v_1) /\ is_sint32(v) /\ is_sint32(x1_0) /\ is_sint32(x2_0) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1_sint32(m) /\ IsArray1_sint32(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job' *) Have: (k <= 10) /\ EqArray1_int(10, m, p[x <- x1_0]). (* Call 'job' *) Have: EqArray1_int(10, m_1, m[k <- x2_0]). } Prove: x1_0 = v. ------------------------------------------------------------ Goal Post-condition 'P2' in 'caller': Let x = k - 1. Let m = p[x <- v_1]. Let m_1 = m[k <- v]. Assume { Type: IsArray1_sint32(p) /\ is_sint32(k) /\ is_sint32(v) /\ is_sint32(v_1) /\ is_sint32(x1_0) /\ is_sint32(x2_0) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1_sint32(m) /\ IsArray1_sint32(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job' *) Have: (k <= 10) /\ EqArray1_int(10, m, p[x <- x1_0]). (* Call 'job' *) Have: EqArray1_int(10, m_1, m[k <- x2_0]). } Prove: x2_0 = v. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 15) in 'job'' in 'caller' at call 'job' (file tests/wp_typed/user_collect.i, line 57) : Assume { Type: is_sint32(k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). } Prove: k <= 9. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 15) in 'job'' in 'caller' at call 'job' (file tests/wp_typed/user_collect.i, line 58) : Let m = p[k <- v]. Assume { Type: IsArray1_sint32(p) /\ is_sint32(k) /\ is_sint32(x1_0) /\ IsArray1_sint32(m) /\ is_sint32(1 + k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). (* Call 'job' *) Have: (k <= 9) /\ EqArray1_int(10, m, p[k <- x1_0]). } Prove: (-1) <= k. ------------------------------------------------------------ ------------------------------------------------------------ Function caller2 ------------------------------------------------------------ Goal Post-condition 'K' in 'caller2': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Q1' in 'caller2': Let x = k - 1. Let m = q[x <- v]. Let m_1 = m[k <- v_1]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v_1) /\ IsS1_S(v) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job2' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, q[x <- s1_0]). (* Call 'job2' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqS1_S(v, s1_0). ------------------------------------------------------------ Goal Post-condition 'Q2' in 'caller2': Let x = k - 1. Let m = q[x <- v_1]. Let m_1 = m[k <- v]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v) /\ IsS1_S(v_1) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job2' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, q[x <- s1_0]). (* Call 'job2' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqS1_S(v, s2_0). ------------------------------------------------------------ Goal Post-condition 'R' in 'caller2': Let x = k - 1. Let m = q[x <- v]. Let m_1 = m[k <- v_1]. Let m_2 = q[x <- s1_0]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v_1) /\ IsS1_S(v) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job2' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, m_2). (* Call 'job2' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqArray1_S1_S(10, m_1, m_2[k <- s2_0]). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 26) in 'job2'' in 'caller2' at call 'job2' (file tests/wp_typed/user_collect.i, line 70) : Assume { Type: is_sint32(k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). } Prove: k <= 9. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 26) in 'job2'' in 'caller2' at call 'job2' (file tests/wp_typed/user_collect.i, line 71) : Let m = q[k <- v]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ is_sint32(k) /\ IsArray1S1_S(m) /\ is_sint32(1 + k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). (* Call 'job2' *) Have: (k <= 9) /\ EqArray1_S1_S(10, m, q[k <- s1_0]). } Prove: (-1) <= k. ------------------------------------------------------------ ------------------------------------------------------------ Function caller3 ------------------------------------------------------------ Goal Post-condition 'K' in 'caller3': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Q1' in 'caller3': Let x = k - 1. Let m = q[x <- v]. Let m_1 = m[k <- v_1]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v_1) /\ IsS1_S(v) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job3' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, q[x <- s1_0]). (* Call 'job3' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqS1_S(v, s1_0). ------------------------------------------------------------ Goal Post-condition 'Q2' in 'caller3': Let x = k - 1. Let m = q[x <- v_1]. Let m_1 = m[k <- v]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v) /\ IsS1_S(v_1) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job3' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, q[x <- s1_0]). (* Call 'job3' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqS1_S(v, s2_0). ------------------------------------------------------------ Goal Post-condition 'R' in 'caller3': Let x = k - 1. Let m = q[x <- v]. Let m_1 = m[k <- v_1]. Let m_2 = q[x <- s1_0]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v_1) /\ IsS1_S(v) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job3' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, m_2). (* Call 'job3' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqArray1_S1_S(10, m_1, m_2[k <- s2_0]). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 37) in 'job3'' in 'caller3' at call 'job3' (file tests/wp_typed/user_collect.i, line 83) : Assume { Type: is_sint32(k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). } Prove: k <= 9. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 37) in 'job3'' in 'caller3' at call 'job3' (file tests/wp_typed/user_collect.i, line 84) : Let m = q[k <- v]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ is_sint32(k) /\ IsArray1S1_S(m) /\ is_sint32(1 + k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). (* Call 'job3' *) Have: (k <= 9) /\ EqArray1_S1_S(10, m, q[k <- s1_0]). } Prove: (-1) <= k. ------------------------------------------------------------ ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'K' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P' in 'job': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 18) in 'job' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 18) in 'job' (2/3): Effect at line 22 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 18) in 'job' (3/3): Effect at line 22 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job2 ------------------------------------------------------------ Goal Post-condition 'K' in 'job2': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Q' in 'job2': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 29) in 'job2' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 29) in 'job2' (2/3): Effect at line 33 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 29) in 'job2' (3/3): Effect at line 33 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job3 ------------------------------------------------------------ Goal Post-condition 'K' in 'job3': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Q' in 'job3': Let a = s.F1_S_f. Let m = q[k <- { F1_S_f = (q[k].F1_S_f)[0 <- a[0]][1 <- a[1]] }]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s) /\ is_sint32(k) /\ IsArray1S1_S(m). (* Pre-condition *) Have: (0 <= k) /\ (k <= 9). } Prove: EqArray1_S1_S(10, m, q[k <- s]). ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 40) in 'job3' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 40) in 'job3' (2/3): Effect at line 44 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 40) in 'job3' (3/3): Effect at line 45 Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_collect.1.res.oracle�����������������0000666�0000000�0000000�00000025320�13571573400�025156� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_collect.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function caller ------------------------------------------------------------ Goal Post-condition 'K' in 'caller': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P1' in 'caller': Let x = k - 1. Let m = p[x <- v]. Let m_1 = m[k <- v_1]. Assume { Type: IsArray1_sint32(p) /\ is_sint32(k) /\ is_sint32(v_1) /\ is_sint32(v) /\ is_sint32(x1_0) /\ is_sint32(x2_0) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1_sint32(m) /\ IsArray1_sint32(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job' *) Have: (k <= 10) /\ EqArray1_int(10, m, p[x <- x1_0]). (* Call 'job' *) Have: EqArray1_int(10, m_1, m[k <- x2_0]). } Prove: x1_0 = v. ------------------------------------------------------------ Goal Post-condition 'P2' in 'caller': Let x = k - 1. Let m = p[x <- v_1]. Let m_1 = m[k <- v]. Assume { Type: IsArray1_sint32(p) /\ is_sint32(k) /\ is_sint32(v) /\ is_sint32(v_1) /\ is_sint32(x1_0) /\ is_sint32(x2_0) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1_sint32(m) /\ IsArray1_sint32(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job' *) Have: (k <= 10) /\ EqArray1_int(10, m, p[x <- x1_0]). (* Call 'job' *) Have: EqArray1_int(10, m_1, m[k <- x2_0]). } Prove: x2_0 = v. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 15) in 'job'' in 'caller' at call 'job' (file tests/wp_typed/user_collect.i, line 57) : Assume { Type: is_sint32(k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). } Prove: k <= 9. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 15) in 'job'' in 'caller' at call 'job' (file tests/wp_typed/user_collect.i, line 58) : Let m = p[k <- v]. Assume { Type: IsArray1_sint32(p) /\ is_sint32(k) /\ is_sint32(x1_0) /\ IsArray1_sint32(m) /\ is_sint32(1 + k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). (* Call 'job' *) Have: (k <= 9) /\ EqArray1_int(10, m, p[k <- x1_0]). } Prove: (-1) <= k. ------------------------------------------------------------ ------------------------------------------------------------ Function caller2 ------------------------------------------------------------ Goal Post-condition 'K' in 'caller2': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Q1' in 'caller2': Let x = k - 1. Let m = q[x <- v]. Let m_1 = m[k <- v_1]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v_1) /\ IsS1_S(v) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job2' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, q[x <- s1_0]). (* Call 'job2' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqS1_S(v, s1_0). ------------------------------------------------------------ Goal Post-condition 'Q2' in 'caller2': Let x = k - 1. Let m = q[x <- v_1]. Let m_1 = m[k <- v]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v) /\ IsS1_S(v_1) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job2' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, q[x <- s1_0]). (* Call 'job2' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqS1_S(v, s2_0). ------------------------------------------------------------ Goal Post-condition 'R' in 'caller2': Let x = k - 1. Let m = q[x <- v]. Let m_1 = m[k <- v_1]. Let m_2 = q[x <- s1_0]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v_1) /\ IsS1_S(v) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job2' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, m_2). (* Call 'job2' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqArray1_S1_S(10, m_1, m_2[k <- s2_0]). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 26) in 'job2'' in 'caller2' at call 'job2' (file tests/wp_typed/user_collect.i, line 70) : Assume { Type: is_sint32(k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). } Prove: k <= 9. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 26) in 'job2'' in 'caller2' at call 'job2' (file tests/wp_typed/user_collect.i, line 71) : Let m = q[k <- v]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ is_sint32(k) /\ IsArray1S1_S(m) /\ is_sint32(1 + k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). (* Call 'job2' *) Have: (k <= 9) /\ EqArray1_S1_S(10, m, q[k <- s1_0]). } Prove: (-1) <= k. ------------------------------------------------------------ ------------------------------------------------------------ Function caller3 ------------------------------------------------------------ Goal Post-condition 'K' in 'caller3': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Q1' in 'caller3': Let x = k - 1. Let m = q[x <- v]. Let m_1 = m[k <- v_1]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v_1) /\ IsS1_S(v) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job3' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, q[x <- s1_0]). (* Call 'job3' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqS1_S(v, s1_0). ------------------------------------------------------------ Goal Post-condition 'Q2' in 'caller3': Let x = k - 1. Let m = q[x <- v_1]. Let m_1 = m[k <- v]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v) /\ IsS1_S(v_1) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job3' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, q[x <- s1_0]). (* Call 'job3' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqS1_S(v, s2_0). ------------------------------------------------------------ Goal Post-condition 'R' in 'caller3': Let x = k - 1. Let m = q[x <- v]. Let m_1 = m[k <- v_1]. Let m_2 = q[x <- s1_0]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ IsS1_S(s2_0) /\ IsS1_S(v_1) /\ IsS1_S(v) /\ is_sint32(k) /\ is_sint32(x) /\ is_sint32(1 + k) /\ IsArray1S1_S(m) /\ IsArray1S1_S(m_1). (* Pre-condition *) Have: (0 < k) /\ (k <= 9). (* Call 'job3' *) Have: (k <= 10) /\ EqArray1_S1_S(10, m, m_2). (* Call 'job3' *) Have: EqArray1_S1_S(10, m_1, m[k <- s2_0]). } Prove: EqArray1_S1_S(10, m_1, m_2[k <- s2_0]). ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 37) in 'job3'' in 'caller3' at call 'job3' (file tests/wp_typed/user_collect.i, line 83) : Assume { Type: is_sint32(k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). } Prove: k <= 9. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_collect.i, line 37) in 'job3'' in 'caller3' at call 'job3' (file tests/wp_typed/user_collect.i, line 84) : Let m = q[k <- v]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s1_0) /\ is_sint32(k) /\ IsArray1S1_S(m) /\ is_sint32(1 + k). (* Pre-condition *) Have: (0 <= k) /\ (k <= 8). (* Call 'job3' *) Have: (k <= 9) /\ EqArray1_S1_S(10, m, q[k <- s1_0]). } Prove: (-1) <= k. ------------------------------------------------------------ ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'K' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'P' in 'job': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 18) in 'job' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 18) in 'job' (2/3): Effect at line 22 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 18) in 'job' (3/3): Effect at line 22 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job2 ------------------------------------------------------------ Goal Post-condition 'K' in 'job2': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Q' in 'job2': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 29) in 'job2' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 29) in 'job2' (2/3): Effect at line 33 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 29) in 'job2' (3/3): Effect at line 33 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function job3 ------------------------------------------------------------ Goal Post-condition 'K' in 'job3': Prove: true. ------------------------------------------------------------ Goal Post-condition 'Q' in 'job3': Let a = s.F1_S_f. Let m = q[k <- { F1_S_f = (q[k].F1_S_f)[0 <- a[0]][1 <- a[1]] }]. Assume { Type: IsArray1S1_S(q) /\ IsS1_S(s) /\ is_sint32(k) /\ IsArray1S1_S(m). (* Pre-condition *) Have: (0 <= k) /\ (k <= 9). } Prove: EqArray1_S1_S(10, m, q[k <- s]). ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 40) in 'job3' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 40) in 'job3' (2/3): Effect at line 44 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_collect.i, line 40) in 'job3' (3/3): Effect at line 45 Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_init.0.res.oracle��������������������0000666�0000000�0000000�00000176712�13571573400�024507� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_init.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] [CFG] Goal init_exits : Valid (Unreachable) [wp] [CFG] Goal init_t1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v2_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v3_exits : Valid (Unreachable) [wp] Warning: Missing RTE guards [wp] Computing [100 goals...] ------------------------------------------------------------ Function init ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 10) in 'init': Let a_1 = shift_sint32(a, 0). Assume { Type: is_sint32(i) /\ is_sint32(n). (* Goal *) When: (0 <= i_1) /\ (i_1 < n) /\ is_sint32(i_1). (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ valid_rw(Malloc_0, a_1, n). (* Invariant 'Partial' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (havoc(Mint_undef_0, Mint_0, a_1, n)[shift_sint32(a, i_2)] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Else *) Have: n <= i. } Prove: havoc(Mint_undef_0, Mint_0, a_1, i)[shift_sint32(a, i_1)] = v. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 17): Let a_1 = shift_sint32(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, n). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i) /\ is_sint32(i_1). (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ valid_rw(Malloc_0, a_1, n). (* Invariant 'Partial' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_2[shift_sint32(a, i_2)] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: a_2[shift_sint32(a, i) <- v][shift_sint32(a, i_1)] = v. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 17): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range' (file tests/wp_typed/user_init.i, line 16): Let a_1 = shift_sint32(a, 0). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ valid_rw(Malloc_0, a_1, n). (* Invariant 'Partial' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (havoc(Mint_undef_0, Mint_0, a_1, n)[shift_sint32(a, i_1)] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant 'Range' (file tests/wp_typed/user_init.i, line 16): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'Zone' (1/2): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'Zone' (2/2): Effect at line 20 Let a_1 = shift_sint32(a, 0). Let a_2 = shift_sint32(a, i). Assume { Type: is_sint32(i) /\ is_sint32(n). (* Goal *) When: !invalid(Malloc_0, a_2, 1). (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ valid_rw(Malloc_0, a_1, n). (* Invariant 'Partial' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (havoc(Mint_undef_0, Mint_0, a_1, n)[shift_sint32(a, i_1)] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: included(a_2, 1, a_1, n). ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_init.i, line 9) in 'init': Effect at line 20 Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 20): Prove: true. ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 20): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 24) in 'init_t1': Assume { Type: is_uint32(i_1). (* Goal *) When: (0 <= i) /\ (i <= 9). (* Invariant 'Partial' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (t1_0[i_2] = v))). (* Invariant 'Range' *) Have: (0 <= i_1) /\ (i_1 <= 10). (* Else *) Have: 10 <= i_1. } Prove: t1_0[i] = v. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 32): Assume { Type: is_uint32(i). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + i)). (* Invariant 'Partial' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (t1_0[i_2] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: t1_0[i <- v][i_1] = v. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 32): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range' (file tests/wp_typed/user_init.i, line 31): Assume { Type: is_uint32(i). (* Invariant 'Partial' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (t1_0[i_1] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range' (file tests/wp_typed/user_init.i, line 31): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'Zone': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_init.i, line 26) in 'init_t1' (1/2): Effect at line 35 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_init.i, line 26) in 'init_t1' (2/2): Effect at line 35 Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 35): Assume { Type: is_uint32(i). (* Invariant 'Partial' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (t1_0[i_1] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 35): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_bis_v1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 127) in 'init_t2_bis_v1': Let a = global(G_t2_50). Assume { Type: is_uint32(i_2) /\ is_sint32(v). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone' *) Have: forall a_1 : addr. ((forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_4), i_3) != a_1)))))) -> (Mint_1[a_1] = Mint_0[a_1])). (* Invariant 'Partial' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i_2) -> ((0 <= i_3) -> ((i_3 <= 19) -> (Mint_0[shift_sint32(shift_A20_sint32(a, i_4), i_3)] = v))))). (* Invariant 'Range' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Else *) Have: 10 <= i_2. } Prove: Mint_0[shift_sint32(shift_A20_sint32(a, i), i_1)] = v. ------------------------------------------------------------ Goal Exit-condition (file tests/wp_typed/user_init.i, line 129) in 'init_t2_bis_v1': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 136): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Let a_2 = shift_sint32(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, 20). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Goal *) When: (0 <= i_1) /\ (0 <= i_2) /\ (i_1 < to_uint32(1 + i)) /\ (i_2 <= 19). (* Loop assigns 'lack,Zone' *) Have: forall a_4 : addr. ((forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_4), i_3) != a_4)))))) -> (Mint_1[a_4] = Mint_0[a_4])). (* Invariant 'Partial' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (Mint_0[shift_sint32(shift_A20_sint32(a, i_4), i_3)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 <= 19) -> (a_3[shift_sint32(a_1, i_3)] = v))). } Prove: a_3[shift_sint32(shift_A20_sint32(a, i_1), i_2)] = Mint_undef_0[a_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 136): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range' (file tests/wp_typed/user_init.i, line 135): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Loop assigns 'lack,Zone' *) Have: forall a_2 : addr. ((forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_2), i_1) != a_2)))))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_2), i_1)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_1)] = v))). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range' (file tests/wp_typed/user_init.i, line 135): Prove: true. ------------------------------------------------------------ Goal Assertion 'Offset' (file tests/wp_typed/user_init.i, line 141): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone' (2/3): Effect at line 139 Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i_2). Assume { Type: is_uint32(i_2) /\ is_sint32(v). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i_6) /\ (0 <= i) /\ (0 <= i_1) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19) /\ (i_6 <= 19) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone' *) Have: forall a_2 : addr. ((forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_8), i_7) != a_2)))))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_8), i_7)] = v))))). (* Invariant 'Range' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Call 'init' *) Have: forall i_7 : Z. ((0 <= i_7) -> ((i_7 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_7)] = v))). } Prove: exists i_8,i_7 : Z. (i_8 <= i) /\ (i_7 <= i_1) /\ (0 <= i_8) /\ (i <= i_8) /\ (0 <= i_7) /\ (i_1 <= i_7) /\ (i_8 <= 9) /\ (i_7 <= 19). ------------------------------------------------------------ Goal Loop assigns 'lack,Zone' (3/3): Call Effect at line 140 Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone' *) Have: forall a_2 : addr. ((forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_3), i_2) != a_2)))))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_3), i_2)] = v))))). (* Invariant 'Range' *) Have: i <= 10. (* Call 'init' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_2)] = v))). } Prove: exists i_3,i_2 : Z. (i_3 <= i) /\ (i_2 <= i_1) /\ (0 <= i_3) /\ (i <= i_3) /\ (0 <= i_2) /\ (i_1 <= i_2) /\ (i_3 <= 9) /\ (i_2 <= 19). ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (1/3): Effect at line 139 Prove: true. ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (2/3): Effect at line 139 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: 0 <= i_1. Have: i <= 9. Have: i_1 <= 19. (* Loop assigns 'lack,Zone' *) Have: forall a : addr. ((forall i_5,i_4 : Z. ((0 <= i_5) -> ((0 <= i_4) -> ((i_5 <= 9) -> ((i_4 <= 19) -> (shift_sint32(shift_A20_sint32(global(G_t2_50), i_5), i_4) != a)))))) -> (Mint_0[a] = Mint_1[a])). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (0 <= i_4) /\ (i_1 <= i_4) /\ (i_5 <= 9) /\ (i_4 <= 19). ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (3/3): Call Effect at line 140 Prove: true. ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (1/2): Effect at line 139 Prove: true. ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (2/2): Effect at line 139 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: 0 <= i_1. Have: i <= 9. Have: i_1 <= 19. (* Loop assigns 'lack,Zone' *) Have: forall a : addr. ((forall i_5,i_4 : Z. ((0 <= i_5) -> ((0 <= i_4) -> ((i_5 <= 9) -> ((i_4 <= 19) -> (shift_sint32(shift_A20_sint32(global(G_t2_50), i_5), i_4) != a)))))) -> (Mint_0[a] = Mint_1[a])). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (0 <= i_4) /\ (i_1 <= i_4) /\ (i_5 <= 9) /\ (i_4 <= 19). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 139): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Loop assigns 'lack,Zone' *) Have: forall a_2 : addr. ((forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_2), i_1) != a_2)))))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_2), i_1)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_1)] = v))). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 139): Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_init.i, line 7) in 'init'' in 'init_t2_bis_v1' at call 'init' (file tests/wp_typed/user_init.i, line 140) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_init.i, line 8) in 'init'' in 'init_t2_bis_v1' at call 'init' (file tests/wp_typed/user_init.i, line 140) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_bis_v2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 145) in 'init_t2_bis_v2': Let a = global(G_t2_50). Assume { Type: is_uint32(i_2) /\ is_sint32(v). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'tactic,Zone' *) Have: forall a_1 : addr. ((forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_4), i_3) != a_1)))) -> (Mint_1[a_1] = Mint_0[a_1])). (* Invariant 'Partial' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i_2) -> ((0 <= i_3) -> ((i_3 <= 19) -> (Mint_0[shift_sint32(shift_A20_sint32(a, i_4), i_3)] = v))))). (* Invariant 'Range' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Else *) Have: 10 <= i_2. } Prove: Mint_0[shift_sint32(shift_A20_sint32(a, i), i_1)] = v. ------------------------------------------------------------ Goal Exit-condition (file tests/wp_typed/user_init.i, line 147) in 'init_t2_bis_v2': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 154): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Let a_2 = shift_sint32(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, 20). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Goal *) When: (0 <= i_1) /\ (0 <= i_2) /\ (i_1 < to_uint32(1 + i)) /\ (i_2 <= 19). (* Loop assigns 'tactic,Zone' *) Have: forall a_4 : addr. ((forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_4), i_3) != a_4)))) -> (Mint_1[a_4] = Mint_0[a_4])). (* Invariant 'Partial' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (Mint_0[shift_sint32(shift_A20_sint32(a, i_4), i_3)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 <= 19) -> (a_3[shift_sint32(a_1, i_3)] = v))). } Prove: a_3[shift_sint32(shift_A20_sint32(a, i_1), i_2)] = Mint_undef_0[a_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 154): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range' (file tests/wp_typed/user_init.i, line 153): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Loop assigns 'tactic,Zone' *) Have: forall a_2 : addr. ((forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_2), i_1) != a_2)))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_2), i_1)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_1)] = v))). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range' (file tests/wp_typed/user_init.i, line 153): Prove: true. ------------------------------------------------------------ Goal Assertion 'Offset_i' (file tests/wp_typed/user_init.i, line 159): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone' (2/3): Effect at line 157 Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i_2). Assume { Type: is_uint32(i_2) /\ is_sint32(v). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Loop assigns 'tactic,Zone' *) Have: forall a_2 : addr. ((forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_7), i_6) != a_2)))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_7), i_6)] = v))))). (* Invariant 'Range' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Call 'init' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_6)] = v))). } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone' (3/3): Call Effect at line 158 Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'tactic,Zone' *) Have: forall a_2 : addr. ((forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_3), i_2) != a_2)))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_3), i_2)] = v))))). (* Invariant 'Range' *) Have: i <= 10. (* Call 'init' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_2)] = v))). } Prove: exists i_3,i_2 : Z. (i_3 <= i) /\ (i_2 <= i_1) /\ (0 <= i_3) /\ (i <= i_3) /\ (i_1 <= i_2) /\ (i_3 <= 9). ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (1/3): Effect at line 157 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (2/3): Effect at line 157 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: i <= 9. (* Loop assigns 'tactic,Zone' *) Have: forall a : addr. ((forall i_5,i_4 : Z. ((0 <= i_5) -> ((i_5 <= 9) -> (shift_sint32(shift_A20_sint32(global(G_t2_50), i_5), i_4) != a)))) -> (Mint_0[a] = Mint_1[a])). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (i_1 <= i_4) /\ (i_5 <= 9). ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (3/3): Call Effect at line 158 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (1/2): Effect at line 157 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (2/2): Effect at line 157 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: i <= 9. (* Loop assigns 'tactic,Zone' *) Have: forall a : addr. ((forall i_5,i_4 : Z. ((0 <= i_5) -> ((i_5 <= 9) -> (shift_sint32(shift_A20_sint32(global(G_t2_50), i_5), i_4) != a)))) -> (Mint_0[a] = Mint_1[a])). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (i_1 <= i_4) /\ (i_5 <= 9). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 157): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Loop assigns 'tactic,Zone' *) Have: forall a_2 : addr. ((forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_2), i_1) != a_2)))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_2), i_1)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_1)] = v))). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 157): Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_init.i, line 7) in 'init'' in 'init_t2_bis_v2' at call 'init' (file tests/wp_typed/user_init.i, line 158) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_init.i, line 8) in 'init'' in 'init_t2_bis_v2' at call 'init' (file tests/wp_typed/user_init.i, line 158) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_v1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 39) in 'init_t2_v1': Assume { (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (((i_3 < 0) \/ (i_2 < 0) \/ (10 <= i_3) \/ (20 <= i_2)) -> (t2_1[i_3][i_2] = t2_0[i_3][i_2])))))). (* Invariant 'Partial_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (t2_0[i_3][i_2] = v))))). } Prove: t2_0[i][i_1] = v. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 48): Let m = t2_0[i]. Assume { Type: is_uint32(i). (* Goal *) When: (0 <= i_1) /\ (0 <= i_2) /\ (i_1 < to_uint32(1 + i)) /\ (i_2 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (((i_4 < 0) \/ (i_3 < 0) \/ (10 <= i_4) \/ (20 <= i_3)) -> (t2_1[i_4][i_3] = t2_2[i_4][i_3])))))). (* Invariant 'Partial_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_2[i_4][i_3] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (((i_4 < 0) \/ (i_3 < 0) \/ (10 <= i_4) \/ (20 <= i_3)) -> (t2_0[i_4][i_3] = t2_2[i_4][i_3])))))). (* Invariant 'Previous_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_0[i_4][i_3] = t2_2[i_4][i_3]))))). (* Invariant 'Partial_j' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 <= 19) -> (m[i_3] = v))). } Prove: m[0] = t2_0[i_1][i_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 48): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 47): Assume { Type: is_uint32(i). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i][i_1] = v))). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 47): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 54): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + j)). (* Loop assigns 'lack,Zone_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (((i_3 < 0) \/ (i_2 < 0) \/ (10 <= i_3) \/ (20 <= i_2)) -> (t2_1[i_3][i_2] = t2_2[i_3][i_2])))))). (* Invariant 'Partial_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (t2_2[i_3][i_2] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (((i_3 < 0) \/ (i_2 < 0) \/ (10 <= i_3) \/ (20 <= i_2)) -> (t2_0[i_3][i_2] = t2_2[i_3][i_2])))))). (* Invariant 'Previous_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (t2_0[i_3][i_2] = t2_2[i_3][i_2]))))). (* Invariant 'Partial_j' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < j) -> (m[i_2] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: m[j <- v][i_1] = v. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 54): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Previous_i' (file tests/wp_typed/user_init.i, line 55): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i_1) /\ (i_1 < i) /\ (0 <= i_2) /\ (i_2 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (((i_4 < 0) \/ (i_3 < 0) \/ (10 <= i_4) \/ (20 <= i_3)) -> (t2_2[i_4][i_3] = t2_1[i_4][i_3])))))). (* Invariant 'Partial_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_1[i_4][i_3] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (((i_4 < 0) \/ (i_3 < 0) \/ (10 <= i_4) \/ (20 <= i_3)) -> (t2_0[i_4][i_3] = t2_1[i_4][i_3])))))). (* Invariant 'Previous_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_0[i_4][i_3] = t2_1[i_4][i_3]))))). (* Invariant 'Partial_j' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 < j) -> (m[i_3] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: t2_0[i <- m[j <- v]][i_1][i_2] = t2_1[i_1][i_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Previous_i' (file tests/wp_typed/user_init.i, line 55): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 53): Assume { Type: is_uint32(i) /\ is_uint32(j). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_2[i][i_1] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: to_uint32(1 + j) <= 20. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 53): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_j' (file tests/wp_typed/user_init.i, line 61): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_i' (file tests/wp_typed/user_init.i, line 64): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_i' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_i' (2/3): Effect at line 51 Assume { Type: is_uint32(i_2). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i_6) /\ (0 <= i) /\ (0 <= i_1) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19) /\ (i_6 <= 19) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_0[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Partial_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_1[i_8][i_7] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Previous_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7]))))). (* Invariant 'Partial_j' *) Have: forall i_7 : Z. ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_2][i_7] = v))). } Prove: exists i_8,i_7 : Z. (i_8 <= i) /\ (i_7 <= i_1) /\ (0 <= i_8) /\ (i <= i_8) /\ (0 <= i_7) /\ (i_1 <= i_7) /\ (i_8 <= 9) /\ (i_7 <= 19). ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_i' (3/3): Effect at line 58 Assume { Type: is_uint32(i_2). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i_6) /\ (0 <= i) /\ (0 <= i_1) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19) /\ (i_6 <= 19) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_0[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Partial_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_1[i_8][i_7] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Previous_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7]))))). (* Invariant 'Partial_j' *) Have: forall i_7 : Z. ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_2][i_7] = v))). } Prove: exists i_8,i_7 : Z. (i_8 <= i) /\ (i_7 <= i_1) /\ (0 <= i_8) /\ (i <= i_8) /\ (0 <= i_7) /\ (i_1 <= i_7) /\ (i_8 <= 9) /\ (i_7 <= 19). ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_j' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_j' (2/3): Effect at line 58 Assume { Type: is_uint32(i_2) /\ is_uint32(j). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i_6) /\ (0 <= i) /\ (0 <= i_1) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19) /\ (i_6 <= 19) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_0[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Partial_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_1[i_8][i_7] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Previous_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7]))))). (* Invariant 'Partial_j' *) Have: forall i_7 : Z. ((0 <= i_7) -> ((i_7 < j) -> (t2_2[i_2][i_7] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: exists i_8,i_7 : Z. (i_8 <= i) /\ (i_7 <= i_1) /\ (0 <= i_8) /\ (i <= i_8) /\ (0 <= i_7) /\ (i_1 <= i_7) /\ (i_8 <= 9) /\ (i_7 <= 19). ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_j' (3/3): Effect at line 59 Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i) /\ (0 <= j) /\ (i <= 9) /\ (j <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: i <= 10. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_2[i][i_1] = v))). (* Invariant 'Range_j' *) Have: j <= 20. } Prove: exists i_2,i_1 : Z. (i_2 <= i) /\ (0 <= i_2) /\ (i <= i_2) /\ (0 <= i_1) /\ (j <= i_1) /\ (i_1 <= j) /\ (i_2 <= 9) /\ (i_1 <= 19). ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_v1' (1/2): Effect at line 51 Prove: true. ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_v1' (2/2): Effect at line 51 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: 0 <= i_1. Have: i <= 9. Have: i_1 <= 19. (* Loop assigns 'lack,Zone_i' *) Have: forall i_5,i_4 : Z. ((0 <= i_5) -> ((0 <= i_4) -> ((i_5 <= 9) -> ((i_4 <= 19) -> (((i_5 < 0) \/ (i_4 < 0) \/ (10 <= i_5) \/ (20 <= i_4)) -> (t2_0[i_5][i_4] = t2_1[i_5][i_4])))))). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (0 <= i_4) /\ (i_1 <= i_4) /\ (i_5 <= 9) /\ (i_4 <= 19). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 51): Assume { Type: is_uint32(i). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i][i_1] = v))). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 51): Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 58): Assume { Type: is_uint32(i) /\ is_uint32(j). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_2[i][i_1] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: j < to_uint32(1 + j). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 58): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_v2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 68) in 'init_t2_v2': Assume { (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Invariant 'Partial_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (t2_0[i_3][i_2] = v))))). } Prove: t2_0[i][i_1] = v. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 77): Let m = t2_0[i]. Assume { Type: is_uint32(i). (* Goal *) When: (0 <= i_1) /\ (0 <= i_2) /\ (i_1 < to_uint32(1 + i)) /\ (i_2 <= 19). (* Invariant 'Partial_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_1[i_4][i_3] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_0[i_4][i_3] = t2_1[i_4][i_3]))))). (* Invariant 'Partial_j' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 <= 19) -> (m[i_3] = v))). } Prove: m[0] = t2_0[i_1][i_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 77): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 76): Assume { Type: is_uint32(i). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i][i_1] = v))). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 76): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 83): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + j)). (* Invariant 'Partial_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (t2_1[i_3][i_2] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (t2_0[i_3][i_2] = t2_1[i_3][i_2]))))). (* Invariant 'Partial_j' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < j) -> (m[i_2] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: m[j <- v][i_1] = v. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 83): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Previous_i' (file tests/wp_typed/user_init.i, line 84): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i_1) /\ (i_1 < i) /\ (0 <= i_2) /\ (i_2 <= 19). (* Invariant 'Partial_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_1[i_4][i_3] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_0[i_4][i_3] = t2_1[i_4][i_3]))))). (* Invariant 'Partial_j' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 < j) -> (m[i_3] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: t2_0[i <- m[j <- v]][i_1][i_2] = t2_1[i_1][i_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Previous_i' (file tests/wp_typed/user_init.i, line 84): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 82): Assume { Type: is_uint32(i) /\ is_uint32(j). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_1[i][i_1] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: to_uint32(1 + j) <= 20. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 82): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_j' (file tests/wp_typed/user_init.i, line 90): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_i' (file tests/wp_typed/user_init.i, line 93): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (2/3): Effect at line 80 Assume { Type: is_uint32(i_2). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Invariant 'Partial_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_0[i_7][i_6] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Invariant 'Previous_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_7][i_6] = t2_0[i_7][i_6]))))). (* Invariant 'Partial_j' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_2][i_6] = v))). } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (3/3): Effect at line 87 Assume { Type: is_uint32(i_2). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Invariant 'Partial_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_0[i_7][i_6] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Invariant 'Previous_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_7][i_6] = t2_0[i_7][i_6]))))). (* Invariant 'Partial_j' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_2][i_6] = v))). } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (2/3): Effect at line 87 Assume { Type: is_uint32(i_2) /\ is_uint32(j). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Invariant 'Partial_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_0[i_7][i_6] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Invariant 'Previous_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_7][i_6] = t2_0[i_7][i_6]))))). (* Invariant 'Partial_j' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 < j) -> (t2_1[i_2][i_6] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (3/3): Effect at line 88 Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i) /\ (0 <= j) /\ (i <= 9) /\ (j <= 19). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: i <= 10. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_1[i][i_1] = v))). (* Invariant 'Range_j' *) Have: j <= 20. } Prove: exists i_2,i_1 : Z. (i_2 <= i) /\ (0 <= i_2) /\ (i <= i_2) /\ (j <= i_1) /\ (i_1 <= j) /\ (i_2 <= 9). ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_v2' (1/2): Effect at line 80 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_v2' (2/2): Effect at line 80 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: i <= 9. } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (i_1 <= i_4) /\ (i_5 <= 9). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 80): Assume { Type: is_uint32(i). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i][i_1] = v))). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 80): Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 87): Assume { Type: is_uint32(i) /\ is_uint32(j). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_1[i][i_1] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: j < to_uint32(1 + j). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 87): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_v3 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 99) in 'init_t2_v3': Assume { Type: is_sint32(v). (* Goal *) When: (0 <= i) /\ (i <= 9). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 9) -> P_MemSet20(t2_0[i_1], 20, v))). } Prove: P_MemSet20(t2_0[i], 20, v). ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 108): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + i)). (* Invariant 'Partial_i' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> P_MemSet20(t2_0[i_2], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: P_MemSet20(t2_0[i <- v][i_1], 20, v_1). ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 108): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 107): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 107): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 114): Let m = v[j <- v_1]. Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_uint32(j) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]) /\ IsArray1_sint32(m). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, j, v_1). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: P_MemSet20(m, to_uint32(1 + j), v_1). ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 114): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_sint32(v) /\ IsArray1_sint32(m). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: P_MemSet20(m, 0, v). ------------------------------------------------------------ Goal Preservation of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 113): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_uint32(j) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, j, v_1). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: to_uint32(1 + j) <= 20. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 113): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_j' (file tests/wp_typed/user_init.i, line 120): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_i' (file tests/wp_typed/user_init.i, line 123): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (2/3): Effect at line 111 Assume { Type: IsArray1_sint32(v) /\ is_uint32(i_2) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i_2]). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Invariant 'Partial_i' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 < i_2) -> P_MemSet20(t2_0[i_6], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (3/3): Effect at line 117 Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Invariant 'Partial_i' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> P_MemSet20(t2_0[i_2], 20, v_1))). (* Invariant 'Range_i' *) Have: i <= 10. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: exists i_3,i_2 : Z. (i_3 <= i) /\ (i_2 <= i_1) /\ (0 <= i_3) /\ (i <= i_3) /\ (i_1 <= i_2) /\ (i_3 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (1/2): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (2/2): Effect at line 117 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_v3' (1/2): Effect at line 111 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_v3' (2/2): Effect at line 111 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: i <= 9. } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (i_1 <= i_4) /\ (i_5 <= 9). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 111): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 111): Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 117): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_uint32(j) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, j, v_1). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: j < to_uint32(1 + j). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 117): Prove: true. ------------------------------------------------------------ ������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_init.1.res.oracle��������������������0000666�0000000�0000000�00000176742�13571573400�024513� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_init.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] [CFG] Goal init_exits : Valid (Unreachable) [wp] [CFG] Goal init_t1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v2_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v3_exits : Valid (Unreachable) [wp] Warning: Missing RTE guards [wp] Computing [100 goals...] ------------------------------------------------------------ Function init ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 10) in 'init': Let a_1 = shift_sint32(a, 0). Assume { Type: is_sint32(i) /\ is_sint32(n). (* Goal *) When: (0 <= i_1) /\ (i_1 < n) /\ is_sint32(i_1). (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ valid_rw(Malloc_0, a_1, n). (* Invariant 'Partial' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (havoc(Mint_undef_0, Mint_0, a_1, n)[shift_sint32(a, i_2)] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Else *) Have: n <= i. } Prove: havoc(Mint_undef_0, Mint_0, a_1, i)[shift_sint32(a, i_1)] = v. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 17): Let a_1 = shift_sint32(a, 0). Let a_2 = havoc(Mint_undef_0, Mint_0, a_1, n). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i) /\ is_sint32(i_1). (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ valid_rw(Malloc_0, a_1, n). (* Invariant 'Partial' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_2[shift_sint32(a, i_2)] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: a_2[shift_sint32(a, i) <- v][shift_sint32(a, i_1)] = v. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 17): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range' (file tests/wp_typed/user_init.i, line 16): Let a_1 = shift_sint32(a, 0). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ valid_rw(Malloc_0, a_1, n). (* Invariant 'Partial' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (havoc(Mint_undef_0, Mint_0, a_1, n)[shift_sint32(a, i_1)] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant 'Range' (file tests/wp_typed/user_init.i, line 16): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'Zone' (1/2): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'Zone' (2/2): Effect at line 20 Let a_1 = shift_sint32(a, 0). Let a_2 = shift_sint32(a, i). Assume { Type: is_sint32(i) /\ is_sint32(n). (* Goal *) When: !invalid(Malloc_0, a_2, 1). (* Heap *) Have: (region(a.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: (0 <= n) /\ valid_rw(Malloc_0, a_1, n). (* Invariant 'Partial' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (havoc(Mint_undef_0, Mint_0, a_1, n)[shift_sint32(a, i_1)] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: included(a_2, 1, a_1, n). ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_init.i, line 9) in 'init': Effect at line 20 Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 20): Prove: true. ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 20): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 24) in 'init_t1': Assume { Type: is_uint32(i_1). (* Goal *) When: (0 <= i) /\ (i <= 9). (* Invariant 'Partial' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (t1_0[i_2] = v))). (* Invariant 'Range' *) Have: (0 <= i_1) /\ (i_1 <= 10). (* Else *) Have: 10 <= i_1. } Prove: t1_0[i] = v. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 32): Assume { Type: is_uint32(i). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + i)). (* Invariant 'Partial' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (t1_0[i_2] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: t1_0[i <- v][i_1] = v. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 32): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range' (file tests/wp_typed/user_init.i, line 31): Assume { Type: is_uint32(i). (* Invariant 'Partial' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (t1_0[i_1] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range' (file tests/wp_typed/user_init.i, line 31): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'Zone': Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_init.i, line 26) in 'init_t1' (1/2): Effect at line 35 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_typed/user_init.i, line 26) in 'init_t1' (2/2): Effect at line 35 Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 35): Assume { Type: is_uint32(i). (* Invariant 'Partial' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (t1_0[i_1] = v))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 35): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_bis_v1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 127) in 'init_t2_bis_v1': Let a = global(G_t2_50). Assume { Type: is_uint32(i_2) /\ is_sint32(v). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone' *) Have: forall a_1 : addr. ((forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_4), i_3) != a_1)))))) -> (Mint_1[a_1] = Mint_0[a_1])). (* Invariant 'Partial' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i_2) -> ((0 <= i_3) -> ((i_3 <= 19) -> (Mint_0[shift_sint32(shift_A20_sint32(a, i_4), i_3)] = v))))). (* Invariant 'Range' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Else *) Have: 10 <= i_2. } Prove: Mint_0[shift_sint32(shift_A20_sint32(a, i), i_1)] = v. ------------------------------------------------------------ Goal Exit-condition (file tests/wp_typed/user_init.i, line 129) in 'init_t2_bis_v1': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 136): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Let a_2 = shift_sint32(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, 20). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Goal *) When: (0 <= i_1) /\ (0 <= i_2) /\ (i_1 < to_uint32(1 + i)) /\ (i_2 <= 19). (* Loop assigns 'lack,Zone' *) Have: forall a_4 : addr. ((forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_4), i_3) != a_4)))))) -> (Mint_1[a_4] = Mint_0[a_4])). (* Invariant 'Partial' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (Mint_0[shift_sint32(shift_A20_sint32(a, i_4), i_3)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 <= 19) -> (a_3[shift_sint32(a_1, i_3)] = v))). } Prove: a_3[shift_sint32(shift_A20_sint32(a, i_1), i_2)] = Mint_undef_0[a_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 136): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range' (file tests/wp_typed/user_init.i, line 135): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Loop assigns 'lack,Zone' *) Have: forall a_2 : addr. ((forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_2), i_1) != a_2)))))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_2), i_1)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_1)] = v))). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range' (file tests/wp_typed/user_init.i, line 135): Prove: true. ------------------------------------------------------------ Goal Assertion 'Offset' (file tests/wp_typed/user_init.i, line 141): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone' (2/3): Effect at line 139 Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i_2). Assume { Type: is_uint32(i_2) /\ is_sint32(v). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i_6) /\ (0 <= i) /\ (0 <= i_1) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19) /\ (i_6 <= 19) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone' *) Have: forall a_2 : addr. ((forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_8), i_7) != a_2)))))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_8), i_7)] = v))))). (* Invariant 'Range' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Call 'init' *) Have: forall i_7 : Z. ((0 <= i_7) -> ((i_7 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_7)] = v))). } Prove: exists i_8,i_7 : Z. (i_8 <= i) /\ (i_7 <= i_1) /\ (0 <= i_8) /\ (i <= i_8) /\ (0 <= i_7) /\ (i_1 <= i_7) /\ (i_8 <= 9) /\ (i_7 <= 19). ------------------------------------------------------------ Goal Loop assigns 'lack,Zone' (3/3): Call Effect at line 140 Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone' *) Have: forall a_2 : addr. ((forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_3), i_2) != a_2)))))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_3), i_2)] = v))))). (* Invariant 'Range' *) Have: i <= 10. (* Call 'init' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_2)] = v))). } Prove: exists i_3,i_2 : Z. (i_3 <= i) /\ (i_2 <= i_1) /\ (0 <= i_3) /\ (i <= i_3) /\ (0 <= i_2) /\ (i_1 <= i_2) /\ (i_3 <= 9) /\ (i_2 <= 19). ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (1/3): Effect at line 139 Prove: true. ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (2/3): Effect at line 139 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: 0 <= i_1. Have: i <= 9. Have: i_1 <= 19. (* Loop assigns 'lack,Zone' *) Have: forall a : addr. ((forall i_5,i_4 : Z. ((0 <= i_5) -> ((0 <= i_4) -> ((i_5 <= 9) -> ((i_4 <= 19) -> (shift_sint32(shift_A20_sint32(global(G_t2_50), i_5), i_4) != a)))))) -> (Mint_0[a] = Mint_1[a])). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (0 <= i_4) /\ (i_1 <= i_4) /\ (i_5 <= 9) /\ (i_4 <= 19). ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (3/3): Call Effect at line 140 Prove: true. ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (1/2): Effect at line 139 Prove: true. ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_bis_v1' (2/2): Effect at line 139 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: 0 <= i_1. Have: i <= 9. Have: i_1 <= 19. (* Loop assigns 'lack,Zone' *) Have: forall a : addr. ((forall i_5,i_4 : Z. ((0 <= i_5) -> ((0 <= i_4) -> ((i_5 <= 9) -> ((i_4 <= 19) -> (shift_sint32(shift_A20_sint32(global(G_t2_50), i_5), i_4) != a)))))) -> (Mint_0[a] = Mint_1[a])). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (0 <= i_4) /\ (i_1 <= i_4) /\ (i_5 <= 9) /\ (i_4 <= 19). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 139): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Loop assigns 'lack,Zone' *) Have: forall a_2 : addr. ((forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (shift_sint32(shift_A20_sint32(a, i_2), i_1) != a_2)))))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_2), i_1)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_1)] = v))). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 139): Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_init.i, line 7) in 'init'' in 'init_t2_bis_v1' at call 'init' (file tests/wp_typed/user_init.i, line 140) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_init.i, line 8) in 'init'' in 'init_t2_bis_v1' at call 'init' (file tests/wp_typed/user_init.i, line 140) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_bis_v2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 145) in 'init_t2_bis_v2': Let a = global(G_t2_50). Assume { Type: is_uint32(i_2) /\ is_sint32(v). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'tactic,Zone' *) Have: forall a_1 : addr. ((forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_4), i_3) != a_1)))) -> (Mint_1[a_1] = Mint_0[a_1])). (* Invariant 'Partial' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i_2) -> ((0 <= i_3) -> ((i_3 <= 19) -> (Mint_0[shift_sint32(shift_A20_sint32(a, i_4), i_3)] = v))))). (* Invariant 'Range' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Else *) Have: 10 <= i_2. } Prove: Mint_0[shift_sint32(shift_A20_sint32(a, i), i_1)] = v. ------------------------------------------------------------ Goal Exit-condition (file tests/wp_typed/user_init.i, line 147) in 'init_t2_bis_v2': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 154): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Let a_2 = shift_sint32(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, 20). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Goal *) When: (0 <= i_1) /\ (0 <= i_2) /\ (i_1 < to_uint32(1 + i)) /\ (i_2 <= 19). (* Loop assigns 'tactic,Zone' *) Have: forall a_4 : addr. ((forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_4), i_3) != a_4)))) -> (Mint_1[a_4] = Mint_0[a_4])). (* Invariant 'Partial' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (Mint_0[shift_sint32(shift_A20_sint32(a, i_4), i_3)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 <= 19) -> (a_3[shift_sint32(a_1, i_3)] = v))). } Prove: a_3[shift_sint32(shift_A20_sint32(a, i_1), i_2)] = Mint_undef_0[a_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial' (file tests/wp_typed/user_init.i, line 154): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range' (file tests/wp_typed/user_init.i, line 153): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Loop assigns 'tactic,Zone' *) Have: forall a_2 : addr. ((forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_2), i_1) != a_2)))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_2), i_1)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_1)] = v))). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range' (file tests/wp_typed/user_init.i, line 153): Prove: true. ------------------------------------------------------------ Goal Assertion 'Offset_i' (file tests/wp_typed/user_init.i, line 159): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone' (2/3): Effect at line 157 Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i_2). Assume { Type: is_uint32(i_2) /\ is_sint32(v). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Loop assigns 'tactic,Zone' *) Have: forall a_2 : addr. ((forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_7), i_6) != a_2)))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_7), i_6)] = v))))). (* Invariant 'Range' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Call 'init' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_6)] = v))). } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone' (3/3): Call Effect at line 158 Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'tactic,Zone' *) Have: forall a_2 : addr. ((forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_3), i_2) != a_2)))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_3), i_2)] = v))))). (* Invariant 'Range' *) Have: i <= 10. (* Call 'init' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_2)] = v))). } Prove: exists i_3,i_2 : Z. (i_3 <= i) /\ (i_2 <= i_1) /\ (0 <= i_3) /\ (i <= i_3) /\ (i_1 <= i_2) /\ (i_3 <= 9). ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (1/3): Effect at line 157 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (2/3): Effect at line 157 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: i <= 9. (* Loop assigns 'tactic,Zone' *) Have: forall a : addr. ((forall i_5,i_4 : Z. ((0 <= i_5) -> ((i_5 <= 9) -> (shift_sint32(shift_A20_sint32(global(G_t2_50), i_5), i_4) != a)))) -> (Mint_0[a] = Mint_1[a])). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (i_1 <= i_4) /\ (i_5 <= 9). ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (3/3): Call Effect at line 158 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (1/2): Effect at line 157 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_bis_v2' (2/2): Effect at line 157 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: i <= 9. (* Loop assigns 'tactic,Zone' *) Have: forall a : addr. ((forall i_5,i_4 : Z. ((0 <= i_5) -> ((i_5 <= 9) -> (shift_sint32(shift_A20_sint32(global(G_t2_50), i_5), i_4) != a)))) -> (Mint_0[a] = Mint_1[a])). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (i_1 <= i_4) /\ (i_5 <= 9). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 157): Let a = global(G_t2_50). Let a_1 = shift_A20_sint32(a, i). Assume { Type: is_uint32(i) /\ is_sint32(v). (* Loop assigns 'tactic,Zone' *) Have: forall a_2 : addr. ((forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 <= 9) -> (shift_sint32(shift_A20_sint32(a, i_2), i_1) != a_2)))) -> (Mint_0[a_2] = Mint_1[a_2])). (* Invariant 'Partial' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (Mint_1[shift_sint32(shift_A20_sint32(a, i_2), i_1)] = v))))). (* Invariant 'Range' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Call 'init' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (havoc(Mint_undef_0, Mint_1, shift_sint32(a_1, 0), 20) [shift_sint32(a_1, i_1)] = v))). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 157): Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_init.i, line 7) in 'init'' in 'init_t2_bis_v2' at call 'init' (file tests/wp_typed/user_init.i, line 158) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_init.i, line 8) in 'init'' in 'init_t2_bis_v2' at call 'init' (file tests/wp_typed/user_init.i, line 158) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_v1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 39) in 'init_t2_v1': Assume { (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (((i_3 < 0) \/ (i_2 < 0) \/ (10 <= i_3) \/ (20 <= i_2)) -> (t2_1[i_3][i_2] = t2_0[i_3][i_2])))))). (* Invariant 'Partial_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (t2_0[i_3][i_2] = v))))). } Prove: t2_0[i][i_1] = v. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 48): Let m = t2_0[i]. Assume { Type: is_uint32(i). (* Goal *) When: (0 <= i_1) /\ (0 <= i_2) /\ (i_1 < to_uint32(1 + i)) /\ (i_2 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (((i_4 < 0) \/ (i_3 < 0) \/ (10 <= i_4) \/ (20 <= i_3)) -> (t2_1[i_4][i_3] = t2_2[i_4][i_3])))))). (* Invariant 'Partial_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_2[i_4][i_3] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (((i_4 < 0) \/ (i_3 < 0) \/ (10 <= i_4) \/ (20 <= i_3)) -> (t2_0[i_4][i_3] = t2_2[i_4][i_3])))))). (* Invariant 'Previous_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_0[i_4][i_3] = t2_2[i_4][i_3]))))). (* Invariant 'Partial_j' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 <= 19) -> (m[i_3] = v))). } Prove: m[0] = t2_0[i_1][i_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 48): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 47): Assume { Type: is_uint32(i). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i][i_1] = v))). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 47): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 54): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + j)). (* Loop assigns 'lack,Zone_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (((i_3 < 0) \/ (i_2 < 0) \/ (10 <= i_3) \/ (20 <= i_2)) -> (t2_1[i_3][i_2] = t2_2[i_3][i_2])))))). (* Invariant 'Partial_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (t2_2[i_3][i_2] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (((i_3 < 0) \/ (i_2 < 0) \/ (10 <= i_3) \/ (20 <= i_2)) -> (t2_0[i_3][i_2] = t2_2[i_3][i_2])))))). (* Invariant 'Previous_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (t2_0[i_3][i_2] = t2_2[i_3][i_2]))))). (* Invariant 'Partial_j' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < j) -> (m[i_2] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: m[j <- v][i_1] = v. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 54): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Previous_i' (file tests/wp_typed/user_init.i, line 55): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i_1) /\ (i_1 < i) /\ (0 <= i_2) /\ (i_2 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (((i_4 < 0) \/ (i_3 < 0) \/ (10 <= i_4) \/ (20 <= i_3)) -> (t2_2[i_4][i_3] = t2_1[i_4][i_3])))))). (* Invariant 'Partial_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_1[i_4][i_3] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((0 <= i_3) -> ((i_4 <= 9) -> ((i_3 <= 19) -> (((i_4 < 0) \/ (i_3 < 0) \/ (10 <= i_4) \/ (20 <= i_3)) -> (t2_0[i_4][i_3] = t2_1[i_4][i_3])))))). (* Invariant 'Previous_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_0[i_4][i_3] = t2_1[i_4][i_3]))))). (* Invariant 'Partial_j' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 < j) -> (m[i_3] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: t2_0[i <- m[j <- v]][i_1][i_2] = t2_1[i_1][i_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Previous_i' (file tests/wp_typed/user_init.i, line 55): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 53): Assume { Type: is_uint32(i) /\ is_uint32(j). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_2[i][i_1] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: to_uint32(1 + j) <= 20. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 53): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_j' (file tests/wp_typed/user_init.i, line 61): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_i' (file tests/wp_typed/user_init.i, line 64): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_i' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_i' (2/3): Effect at line 51 Assume { Type: is_uint32(i_2). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i_6) /\ (0 <= i) /\ (0 <= i_1) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19) /\ (i_6 <= 19) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_0[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Partial_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_1[i_8][i_7] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Previous_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7]))))). (* Invariant 'Partial_j' *) Have: forall i_7 : Z. ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_2][i_7] = v))). } Prove: exists i_8,i_7 : Z. (i_8 <= i) /\ (i_7 <= i_1) /\ (0 <= i_8) /\ (i <= i_8) /\ (0 <= i_7) /\ (i_1 <= i_7) /\ (i_8 <= 9) /\ (i_7 <= 19). ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_i' (3/3): Effect at line 58 Assume { Type: is_uint32(i_2). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i_6) /\ (0 <= i) /\ (0 <= i_1) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19) /\ (i_6 <= 19) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_0[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Partial_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_1[i_8][i_7] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Previous_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7]))))). (* Invariant 'Partial_j' *) Have: forall i_7 : Z. ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_2][i_7] = v))). } Prove: exists i_8,i_7 : Z. (i_8 <= i) /\ (i_7 <= i_1) /\ (0 <= i_8) /\ (i <= i_8) /\ (0 <= i_7) /\ (i_1 <= i_7) /\ (i_8 <= 9) /\ (i_7 <= 19). ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_j' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_j' (2/3): Effect at line 58 Assume { Type: is_uint32(i_2) /\ is_uint32(j). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i_6) /\ (0 <= i) /\ (0 <= i_1) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19) /\ (i_6 <= 19) /\ (i_1 <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_0[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Partial_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_1[i_8][i_7] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((0 <= i_7) -> ((i_8 <= 9) -> ((i_7 <= 19) -> (((i_8 < 0) \/ (i_7 < 0) \/ (10 <= i_8) \/ (20 <= i_7)) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7])))))). (* Invariant 'Previous_i' *) Have: forall i_8,i_7 : Z. ((0 <= i_8) -> ((i_8 < i_2) -> ((0 <= i_7) -> ((i_7 <= 19) -> (t2_2[i_8][i_7] = t2_1[i_8][i_7]))))). (* Invariant 'Partial_j' *) Have: forall i_7 : Z. ((0 <= i_7) -> ((i_7 < j) -> (t2_2[i_2][i_7] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: exists i_8,i_7 : Z. (i_8 <= i) /\ (i_7 <= i_1) /\ (0 <= i_8) /\ (i <= i_8) /\ (0 <= i_7) /\ (i_1 <= i_7) /\ (i_8 <= 9) /\ (i_7 <= 19). ------------------------------------------------------------ Goal Loop assigns 'lack,Zone_j' (3/3): Effect at line 59 Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i) /\ (0 <= j) /\ (i <= 9) /\ (j <= 19). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: i <= 10. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_2[i][i_1] = v))). (* Invariant 'Range_j' *) Have: j <= 20. } Prove: exists i_2,i_1 : Z. (i_2 <= i) /\ (0 <= i_2) /\ (i <= i_2) /\ (0 <= i_1) /\ (j <= i_1) /\ (i_1 <= j) /\ (i_2 <= 9) /\ (i_1 <= 19). ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_v1' (1/2): Effect at line 51 Prove: true. ------------------------------------------------------------ Goal Assigns 'lack' in 'init_t2_v1' (2/2): Effect at line 51 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: 0 <= i_1. Have: i <= 9. Have: i_1 <= 19. (* Loop assigns 'lack,Zone_i' *) Have: forall i_5,i_4 : Z. ((0 <= i_5) -> ((0 <= i_4) -> ((i_5 <= 9) -> ((i_4 <= 19) -> (((i_5 < 0) \/ (i_4 < 0) \/ (10 <= i_5) \/ (20 <= i_4)) -> (t2_0[i_5][i_4] = t2_1[i_5][i_4])))))). } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (0 <= i_4) /\ (i_1 <= i_4) /\ (i_5 <= 9) /\ (i_4 <= 19). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 51): Assume { Type: is_uint32(i). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i][i_1] = v))). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 51): Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 58): Assume { Type: is_uint32(i) /\ is_uint32(j). (* Loop assigns 'lack,Zone_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_0[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Loop assigns 'lack,Zone_j' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((0 <= i_1) -> ((i_2 <= 9) -> ((i_1 <= 19) -> (((i_2 < 0) \/ (i_1 < 0) \/ (10 <= i_2) \/ (20 <= i_1)) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1])))))). (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_2[i_2][i_1] = t2_1[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_2[i][i_1] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: j < to_uint32(1 + j). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 58): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_v2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 68) in 'init_t2_v2': Assume { (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Invariant 'Partial_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((0 <= i_2) -> ((i_3 <= 9) -> ((i_2 <= 19) -> (t2_0[i_3][i_2] = v))))). } Prove: t2_0[i][i_1] = v. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 77): Let m = t2_0[i]. Assume { Type: is_uint32(i). (* Goal *) When: (0 <= i_1) /\ (0 <= i_2) /\ (i_1 < to_uint32(1 + i)) /\ (i_2 <= 19). (* Invariant 'Partial_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_1[i_4][i_3] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_0[i_4][i_3] = t2_1[i_4][i_3]))))). (* Invariant 'Partial_j' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 <= 19) -> (m[i_3] = v))). } Prove: m[0] = t2_0[i_1][i_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 77): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 76): Assume { Type: is_uint32(i). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i][i_1] = v))). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 76): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 83): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + j)). (* Invariant 'Partial_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (t2_1[i_3][i_2] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_3,i_2 : Z. ((0 <= i_3) -> ((i_3 < i) -> ((0 <= i_2) -> ((i_2 <= 19) -> (t2_0[i_3][i_2] = t2_1[i_3][i_2]))))). (* Invariant 'Partial_j' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < j) -> (m[i_2] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: m[j <- v][i_1] = v. ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 83): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Previous_i' (file tests/wp_typed/user_init.i, line 84): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i_1) /\ (i_1 < i) /\ (0 <= i_2) /\ (i_2 <= 19). (* Invariant 'Partial_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_1[i_4][i_3] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_4,i_3 : Z. ((0 <= i_4) -> ((i_4 < i) -> ((0 <= i_3) -> ((i_3 <= 19) -> (t2_0[i_4][i_3] = t2_1[i_4][i_3]))))). (* Invariant 'Partial_j' *) Have: forall i_3 : Z. ((0 <= i_3) -> ((i_3 < j) -> (m[i_3] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: t2_0[i <- m[j <- v]][i_1][i_2] = t2_1[i_1][i_2]. ------------------------------------------------------------ Goal Establishment of Invariant 'Previous_i' (file tests/wp_typed/user_init.i, line 84): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 82): Assume { Type: is_uint32(i) /\ is_uint32(j). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_1[i][i_1] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: to_uint32(1 + j) <= 20. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 82): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_j' (file tests/wp_typed/user_init.i, line 90): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_i' (file tests/wp_typed/user_init.i, line 93): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (2/3): Effect at line 80 Assume { Type: is_uint32(i_2). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Invariant 'Partial_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_0[i_7][i_6] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Invariant 'Previous_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_7][i_6] = t2_0[i_7][i_6]))))). (* Invariant 'Partial_j' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_2][i_6] = v))). } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (3/3): Effect at line 87 Assume { Type: is_uint32(i_2). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Invariant 'Partial_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_0[i_7][i_6] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Invariant 'Previous_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_7][i_6] = t2_0[i_7][i_6]))))). (* Invariant 'Partial_j' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_2][i_6] = v))). } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (2/3): Effect at line 87 Assume { Type: is_uint32(i_2) /\ is_uint32(j). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Invariant 'Partial_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_0[i_7][i_6] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Invariant 'Previous_i' *) Have: forall i_7,i_6 : Z. ((0 <= i_7) -> ((i_7 < i_2) -> ((0 <= i_6) -> ((i_6 <= 19) -> (t2_1[i_7][i_6] = t2_0[i_7][i_6]))))). (* Invariant 'Partial_j' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 < j) -> (t2_1[i_2][i_6] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (3/3): Effect at line 88 Assume { Type: is_uint32(i) /\ is_uint32(j). (* Goal *) When: (0 <= i) /\ (0 <= j) /\ (i <= 9) /\ (j <= 19). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: i <= 10. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_1[i][i_1] = v))). (* Invariant 'Range_j' *) Have: j <= 20. } Prove: exists i_2,i_1 : Z. (i_2 <= i) /\ (0 <= i_2) /\ (i <= i_2) /\ (j <= i_1) /\ (i_1 <= j) /\ (i_2 <= 9). ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_v2' (1/2): Effect at line 80 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_v2' (2/2): Effect at line 80 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: i <= 9. } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (i_1 <= i_4) /\ (i_5 <= 9). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 80): Assume { Type: is_uint32(i). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i][i_1] = v))). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 80): Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 87): Assume { Type: is_uint32(i) /\ is_uint32(j). (* Invariant 'Partial_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_0[i_2][i_1] = v))))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Previous_i' *) Have: forall i_2,i_1 : Z. ((0 <= i_2) -> ((i_2 < i) -> ((0 <= i_1) -> ((i_1 <= 19) -> (t2_1[i_2][i_1] = t2_0[i_2][i_1]))))). (* Invariant 'Partial_j' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < j) -> (t2_1[i][i_1] = v))). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: j < to_uint32(1 + j). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 87): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function init_t2_v3 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_init.i, line 99) in 'init_t2_v3': Assume { Type: is_sint32(v). (* Goal *) When: (0 <= i) /\ (i <= 9). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 <= 9) -> P_MemSet20(t2_0[i_1], 20, v))). } Prove: P_MemSet20(t2_0[i], 20, v). ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 108): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Goal *) When: (0 <= i_1) /\ (i_1 < to_uint32(1 + i)). (* Invariant 'Partial_i' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> P_MemSet20(t2_0[i_2], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: P_MemSet20(t2_0[i <- v][i_1], 20, v_1). ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_i' (file tests/wp_typed/user_init.i, line 108): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 107): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: to_uint32(1 + i) <= 10. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_i' (file tests/wp_typed/user_init.i, line 107): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 114): Let m = v[j <- v_1]. Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_uint32(j) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]) /\ IsArray1_sint32(m). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, j, v_1). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: P_MemSet20(m, to_uint32(1 + j), v_1). ------------------------------------------------------------ Goal Establishment of Invariant 'Partial_j' (file tests/wp_typed/user_init.i, line 114): Let m = t2_0[i]. Assume { Type: is_uint32(i) /\ is_sint32(v) /\ IsArray1_sint32(m). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: P_MemSet20(m, 0, v). ------------------------------------------------------------ Goal Preservation of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 113): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_uint32(j) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, j, v_1). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: to_uint32(1 + j) <= 20. ------------------------------------------------------------ Goal Establishment of Invariant 'Range_j' (file tests/wp_typed/user_init.i, line 113): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_j' (file tests/wp_typed/user_init.i, line 120): Prove: true. ------------------------------------------------------------ Goal Assertion 'Last_i' (file tests/wp_typed/user_init.i, line 123): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (2/3): Effect at line 111 Assume { Type: IsArray1_sint32(v) /\ is_uint32(i_2) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i_2]). (* Goal *) When: (0 <= i_3) /\ (0 <= i_4) /\ (0 <= i_5) /\ (0 <= i) /\ (i_3 <= 9) /\ (i_5 <= 9) /\ (i <= 9) /\ (i_4 <= 19). (* Invariant 'Partial_i' *) Have: forall i_6 : Z. ((0 <= i_6) -> ((i_6 < i_2) -> P_MemSet20(t2_0[i_6], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i_2) /\ (i_2 <= 10). (* Then *) Have: i_2 <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: exists i_7,i_6 : Z. (i_7 <= i) /\ (i_6 <= i_1) /\ (0 <= i_7) /\ (i <= i_7) /\ (i_1 <= i_6) /\ (i_7 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_i' (3/3): Effect at line 117 Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Goal *) When: (0 <= i) /\ (0 <= i_1) /\ (i <= 9) /\ (i_1 <= 19). (* Invariant 'Partial_i' *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> P_MemSet20(t2_0[i_2], 20, v_1))). (* Invariant 'Range_i' *) Have: i <= 10. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: exists i_3,i_2 : Z. (i_3 <= i) /\ (i_2 <= i_1) /\ (0 <= i_3) /\ (i <= i_3) /\ (i_1 <= i_2) /\ (i_3 <= 9). ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (1/2): Prove: true. ------------------------------------------------------------ Goal Loop assigns 'tactic,Zone_j' (2/2): Effect at line 117 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_v3' (1/2): Effect at line 111 Prove: true. ------------------------------------------------------------ Goal Assigns 'tactic' in 'init_t2_v3' (2/2): Effect at line 111 Assume { Have: 0 <= i_2. Have: 0 <= i_3. Have: i_2 <= 9. Have: i_3 <= 19. Have: 0 <= i. Have: i <= 9. } Prove: exists i_5,i_4 : Z. (i_5 <= i) /\ (i_4 <= i_1) /\ (0 <= i_5) /\ (i <= i_5) /\ (i_1 <= i_4) /\ (i_5 <= 9). ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 111): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, 20, v_1). } Prove: i < to_uint32(1 + i). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 111): Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_init.i, line 117): Assume { Type: IsArray1_sint32(v) /\ is_uint32(i) /\ is_uint32(j) /\ is_sint32(v_1) /\ IsArray1_sint32(t2_0[i]). (* Invariant 'Partial_i' *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> P_MemSet20(t2_0[i_1], 20, v_1))). (* Invariant 'Range_i' *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. (* Invariant 'Partial_j' *) Have: P_MemSet20(v, j, v_1). (* Invariant 'Range_j' *) Have: (0 <= j) /\ (j <= 20). (* Then *) Have: j <= 19. } Prove: j < to_uint32(1 + j). ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_init.i, line 117): Prove: true. ------------------------------------------------------------ ������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_injector.res.oracle������������������0000666�0000000�0000000�00000005630�13571573400�025211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_injector.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'SEQ' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ID1' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'ID2' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'R1' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'R2' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'R0' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'E1' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'E2' in 'job': Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (1/3): Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (2/3): Effect at line 60 Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (3/3): Call Result at line 62 Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (1/9): Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (2/9): Effect at line 60 Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (3/9): Call Result at line 62 Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (4/9): Call Result at line 63 Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (5/9): Effect at line 65 Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (6/9): Effect at line 66 Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (7/9): Effect at line 68 Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (8/9): Effect at line 68 Prove: true. ------------------------------------------------------------ Goal Assigns 'A' in 'job' (9/9): Effect at line 68 Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'job': /*@ behavior typed: requires \separated(\union(&seq,&service_cpt,service_id+(..), service_result+(..)),error); */ int job(int a, int b, int *error); ��������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_rec.0.res.oracle���������������������0000666�0000000�0000000�00000015477�13571573400�024315� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_rec.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma fact_ge1: Prove: 0<(L_fact n_0) ------------------------------------------------------------ Lemma fact_next: Assume: 'fact_ge1' Prove: let x_0 = (L_fact m_0) in (0<n_0) -> (n_0<=m_0) -> ((x_0 div (L_fact (n_0-1)))=(n_0*(x_0 div (L_fact n_0)))) ------------------------------------------------------------ ------------------------------------------------------------ Function F1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_rec.i, line 9) in 'F1': Assume { Type: is_sint32(F1_0) /\ is_sint32(i) /\ is_sint32(n). If n <= 1 Then { (* Return *) Have: F1_0 = 1. } Else { (* Invariant *) Have: L_fact(i - 1) = F1_0. (* Invariant *) Have: (2 <= i) /\ (i <= (1 + n)). (* Else *) Have: n < i. } } Prove: L_fact(n) = F1_0. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_typed/user_rec.i, line 15): Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i) /\ is_sint32(L_fact(i - 1)). (* Else *) Have: 2 <= n. (* Invariant *) Have: (2 <= i) /\ (i <= (1 + n)). (* Then *) Have: i <= n. } Prove: 0 < i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_typed/user_rec.i, line 15): Assume { Type: is_sint32(n). (* Else *) Have: 2 <= n. } Prove: 0 < n. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_typed/user_rec.i, line 16): Let x = L_fact(i - 1). Let x_1 = i * x. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i) /\ is_sint32(x) /\ is_sint32(x_1). (* Else *) Have: 2 <= n. (* Invariant *) Have: (2 <= i) /\ (i <= (1 + n)). (* Then *) Have: i <= n. } Prove: x_1 = L_fact(i). ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_typed/user_rec.i, line 16): Assume { Type: is_sint32(n). (* Else *) Have: 2 <= n. } Prove: L_fact(1) = 1. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_typed/user_rec.i, line 17): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function F2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_rec.i, line 23) in 'F2': Assume { Type: is_sint32(F2_0) /\ is_sint32(i) /\ is_sint32(n). (* Invariant 'PART' *) Have: if (n <= 1) then (F2_0 = 1) else (L_fact(i - 1) = F2_0). (* Invariant 'RANGE' *) Have: if (n <= 1) then (i = 2) else ((2 <= i) /\ (i <= (1 + n))). (* Else *) Have: n < i. } Prove: L_fact(n) = F2_0. ------------------------------------------------------------ Goal Preservation of Invariant 'PART' (file tests/wp_typed/user_rec.i, line 29): Let x = i * p. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(p) /\ is_sint32(1 + i) /\ is_sint32(x). (* Invariant 'PART' *) Have: if (n <= 1) then (p = 1) else (L_fact(i - 1) = p). (* Invariant 'RANGE' *) Have: if (n <= 1) then (i = 2) else ((2 <= i) /\ (i <= (1 + n))). (* Then *) Have: i <= n. } Prove: if (n <= 1) then (x = 1) else (x = L_fact(i)). ------------------------------------------------------------ Goal Establishment of Invariant 'PART' (file tests/wp_typed/user_rec.i, line 29): Assume { Type: is_sint32(n). } Prove: (L_fact(1) = 1) \/ (n <= 1). ------------------------------------------------------------ Goal Preservation of Invariant 'RANGE' (file tests/wp_typed/user_rec.i, line 28): Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(p) /\ is_sint32(1 + i). (* Invariant 'PART' *) Have: if (n <= 1) then (p = 1) else (L_fact(i - 1) = p). (* Invariant 'RANGE' *) Have: if (n <= 1) then (i = 2) else ((2 <= i) /\ (i <= (1 + n))). (* Then *) Have: i <= n. } Prove: if (n <= 1) then (i = 1) else (0 < i). ------------------------------------------------------------ Goal Establishment of Invariant 'RANGE' (file tests/wp_typed/user_rec.i, line 28): Assume { Type: is_sint32(n). } Prove: (0 < n) \/ (n <= 1). ------------------------------------------------------------ Goal Loop assigns (file tests/wp_typed/user_rec.i, line 30): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function F4 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_rec.i, line 36) in 'F4': Let x = L_fact(n). Assume { Type: is_sint32(F4_0) /\ is_sint32(n) /\ is_sint32(n_1). (* Invariant 'NEVER' *) Have: if (n <= 1) then (F4_0 = 1) else ((x / L_fact(n_1)) = F4_0). (* Invariant 'RANGE' *) Have: if (n <= 1) then (n_1 = n) else ((0 < n_1) /\ (n_1 <= n)). (* Else *) Have: n_1 <= 1. } Prove: x = F4_0. ------------------------------------------------------------ Goal Preservation of Invariant 'NEVER' (file tests/wp_typed/user_rec.i, line 42): Let x = L_fact(n). Let x_1 = n_1 - 1. Let x_2 = n_1 * p. Assume { Type: is_sint32(n) /\ is_sint32(n_1) /\ is_sint32(p) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Invariant 'NEVER' *) Have: if (n <= 1) then (p = 1) else ((x / L_fact(n_1)) = p). (* Invariant 'RANGE' *) Have: if (n <= 1) then (n_1 = n) else ((0 < n_1) /\ (n_1 <= n)). (* Then *) Have: 2 <= n_1. } Prove: if (n <= 1) then (x_2 = 1) else ((x / L_fact(x_1)) = x_2). ------------------------------------------------------------ Goal Establishment of Invariant 'NEVER' (file tests/wp_typed/user_rec.i, line 42): Let x = L_fact(n). Assume { Type: is_sint32(n). } Prove: ((x / x) = 1) \/ (n <= 1). ------------------------------------------------------------ Goal Preservation of Invariant 'RANGE' (file tests/wp_typed/user_rec.i, line 41): Let x = 1 + n. Assume { Type: is_sint32(n) /\ is_sint32(n_1) /\ is_sint32(p) /\ is_sint32(n_1 - 1). (* Invariant 'NEVER' *) Have: if (n <= 1) then (p = 1) else ((L_fact(n) / L_fact(n_1)) = p). (* Invariant 'RANGE' *) Have: if (n <= 1) then (n_1 = n) else ((0 < n_1) /\ (n_1 <= n)). (* Then *) Have: 2 <= n_1. } Prove: if (n <= 1) then (x = n_1) else (n_1 <= x). ------------------------------------------------------------ Goal Establishment of Invariant 'RANGE' (file tests/wp_typed/user_rec.i, line 41): Assume { Type: is_sint32(n). } Prove: (0 < n) \/ (n <= 1). ------------------------------------------------------------ Goal Loop assigns (file tests/wp_typed/user_rec.i, line 43): Prove: true. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_rec.1.res.oracle���������������������0000666�0000000�0000000�00000015527�13571573400�024312� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_rec.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Global ------------------------------------------------------------ Lemma fact_ge1: Prove: 0<(L_fact n_0) ------------------------------------------------------------ Lemma fact_next: Assume: 'fact_ge1' Prove: let x_0 = (L_fact m_0) in (0<n_0) -> (n_0<=m_0) -> ((x_0 div (L_fact (n_0-1)))=(n_0*(x_0 div (L_fact n_0)))) ------------------------------------------------------------ ------------------------------------------------------------ Function F1 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_rec.i, line 9) in 'F1': Assume { Type: is_sint32(F1_0) /\ is_sint32(i) /\ is_sint32(n). If n <= 1 Then { (* Return *) Have: F1_0 = 1. } Else { (* Invariant *) Have: L_fact(i - 1) = F1_0. (* Invariant *) Have: (2 <= i) /\ (i <= (1 + n)). (* Else *) Have: n < i. } } Prove: L_fact(n) = F1_0. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_typed/user_rec.i, line 15): Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i) /\ is_sint32(L_fact(i - 1)). (* Else *) Have: 2 <= n. (* Invariant *) Have: (2 <= i) /\ (i <= (1 + n)). (* Then *) Have: i <= n. } Prove: 0 < i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_typed/user_rec.i, line 15): Assume { Type: is_sint32(n). (* Else *) Have: 2 <= n. } Prove: 0 < n. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_typed/user_rec.i, line 16): Let x = L_fact(i - 1). Let x_1 = i * x. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i) /\ is_sint32(x) /\ is_sint32(x_1). (* Else *) Have: 2 <= n. (* Invariant *) Have: (2 <= i) /\ (i <= (1 + n)). (* Then *) Have: i <= n. } Prove: x_1 = L_fact(i). ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_typed/user_rec.i, line 16): Assume { Type: is_sint32(n). (* Else *) Have: 2 <= n. } Prove: L_fact(1) = 1. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_typed/user_rec.i, line 17): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function F2 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_rec.i, line 23) in 'F2': Assume { Type: is_sint32(F2_0) /\ is_sint32(i) /\ is_sint32(n). (* Invariant 'PART' *) Have: if (n <= 1) then (F2_0 = 1) else (L_fact(i - 1) = F2_0). (* Invariant 'RANGE' *) Have: if (n <= 1) then (i = 2) else ((2 <= i) /\ (i <= (1 + n))). (* Else *) Have: n < i. } Prove: L_fact(n) = F2_0. ------------------------------------------------------------ Goal Preservation of Invariant 'PART' (file tests/wp_typed/user_rec.i, line 29): Let x = i * p. Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(p) /\ is_sint32(1 + i) /\ is_sint32(x). (* Invariant 'PART' *) Have: if (n <= 1) then (p = 1) else (L_fact(i - 1) = p). (* Invariant 'RANGE' *) Have: if (n <= 1) then (i = 2) else ((2 <= i) /\ (i <= (1 + n))). (* Then *) Have: i <= n. } Prove: if (n <= 1) then (x = 1) else (x = L_fact(i)). ------------------------------------------------------------ Goal Establishment of Invariant 'PART' (file tests/wp_typed/user_rec.i, line 29): Assume { Type: is_sint32(n). } Prove: (L_fact(1) = 1) \/ (n <= 1). ------------------------------------------------------------ Goal Preservation of Invariant 'RANGE' (file tests/wp_typed/user_rec.i, line 28): Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(p) /\ is_sint32(1 + i). (* Invariant 'PART' *) Have: if (n <= 1) then (p = 1) else (L_fact(i - 1) = p). (* Invariant 'RANGE' *) Have: if (n <= 1) then (i = 2) else ((2 <= i) /\ (i <= (1 + n))). (* Then *) Have: i <= n. } Prove: if (n <= 1) then (i = 1) else (0 < i). ------------------------------------------------------------ Goal Establishment of Invariant 'RANGE' (file tests/wp_typed/user_rec.i, line 28): Assume { Type: is_sint32(n). } Prove: (0 < n) \/ (n <= 1). ------------------------------------------------------------ Goal Loop assigns (file tests/wp_typed/user_rec.i, line 30): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function F4 ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_rec.i, line 36) in 'F4': Let x = L_fact(n). Assume { Type: is_sint32(F4_0) /\ is_sint32(n) /\ is_sint32(n_1). (* Invariant 'NEVER' *) Have: if (n <= 1) then (F4_0 = 1) else ((x / L_fact(n_1)) = F4_0). (* Invariant 'RANGE' *) Have: if (n <= 1) then (n_1 = n) else ((0 < n_1) /\ (n_1 <= n)). (* Else *) Have: n_1 <= 1. } Prove: x = F4_0. ------------------------------------------------------------ Goal Preservation of Invariant 'NEVER' (file tests/wp_typed/user_rec.i, line 42): Let x = L_fact(n). Let x_1 = n_1 - 1. Let x_2 = n_1 * p. Assume { Type: is_sint32(n) /\ is_sint32(n_1) /\ is_sint32(p) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Invariant 'NEVER' *) Have: if (n <= 1) then (p = 1) else ((x / L_fact(n_1)) = p). (* Invariant 'RANGE' *) Have: if (n <= 1) then (n_1 = n) else ((0 < n_1) /\ (n_1 <= n)). (* Then *) Have: 2 <= n_1. } Prove: if (n <= 1) then (x_2 = 1) else ((x / L_fact(x_1)) = x_2). ------------------------------------------------------------ Goal Establishment of Invariant 'NEVER' (file tests/wp_typed/user_rec.i, line 42): Let x = L_fact(n). Assume { Type: is_sint32(n). } Prove: ((x / x) = 1) \/ (n <= 1). ------------------------------------------------------------ Goal Preservation of Invariant 'RANGE' (file tests/wp_typed/user_rec.i, line 41): Let x = 1 + n. Assume { Type: is_sint32(n) /\ is_sint32(n_1) /\ is_sint32(p) /\ is_sint32(n_1 - 1). (* Invariant 'NEVER' *) Have: if (n <= 1) then (p = 1) else ((L_fact(n) / L_fact(n_1)) = p). (* Invariant 'RANGE' *) Have: if (n <= 1) then (n_1 = n) else ((0 < n_1) /\ (n_1 <= n)). (* Then *) Have: 2 <= n_1. } Prove: if (n <= 1) then (x = n_1) else (n_1 <= x). ------------------------------------------------------------ Goal Establishment of Invariant 'RANGE' (file tests/wp_typed/user_rec.i, line 41): Assume { Type: is_sint32(n). } Prove: (0 < n) \/ (n <= 1). ------------------------------------------------------------ Goal Loop assigns (file tests/wp_typed/user_rec.i, line 43): Prove: true. ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_string.0.res.oracle������������������0000666�0000000�0000000�00000012531�13571573400�025036� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_string.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function strlen ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_string.i, line 23) in 'strlen': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'BASE' (file tests/wp_typed/user_string.i, line 28): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'BASE' (file tests/wp_typed/user_string.i, line 28): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'RANGE' (file tests/wp_typed/user_string.i, line 29): Let x = Mchar_0[ss_0]. Let x_1 = s.base. Let a = shift_sint8(s, L_Length(Mchar_0, s)). Let a_1 = shift_sint8(ss_0, 1). Assume { Type: is_sint8(x). (* Heap *) Have: (region(x_1) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). (* Invariant 'ZERO' *) Have: forall i_2 : Z. ((0 <= i_2) -> (((i_2 + s.offset) < ss_0.offset) -> (Mchar_0[shift_sint8(s, i_2)] != 0))). (* Invariant 'RANGE' *) Have: addr_le(s, ss_0) /\ addr_le(ss_0, a). (* Invariant 'BASE' *) Have: ss_0.base = x_1. (* Then *) Have: x != 0. } Prove: addr_le(s, a_1) /\ addr_le(a_1, a). ------------------------------------------------------------ Goal Establishment of Invariant 'RANGE' (file tests/wp_typed/user_string.i, line 29): Assume { (* Heap *) Have: (region(s.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). } Prove: addr_le(s, s) /\ addr_le(s, shift_sint8(s, L_Length(Mchar_0, s))). ------------------------------------------------------------ Goal Preservation of Invariant 'ZERO' (file tests/wp_typed/user_string.i, line 30): Let x = Mchar_0[ss_0]. Let x_1 = s.base. Let x_2 = s.offset. Let x_3 = ss_0.offset. Assume { Type: is_sint8(x). (* Goal *) When: (0 <= i) /\ ((i + x_2) <= x_3). (* Heap *) Have: (region(x_1) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_2). (* Invariant 'ZERO' *) Have: forall i_3 : Z. ((0 <= i_3) -> (((i_3 + x_2) < x_3) -> (Mchar_0[shift_sint8(s, i_3)] != 0))). (* Invariant 'RANGE' *) Have: addr_le(s, ss_0) /\ addr_le(ss_0, shift_sint8(s, L_Length(Mchar_0, s))). (* Invariant 'BASE' *) Have: ss_0.base = x_1. (* Then *) Have: x != 0. } Prove: Mchar_0[shift_sint8(s, i)] != 0. ------------------------------------------------------------ Goal Establishment of Invariant 'ZERO' (file tests/wp_typed/user_string.i, line 30): Prove: true. ------------------------------------------------------------ Goal Assertion 'END' (file tests/wp_typed/user_string.i, line 37): Let x = s.base. Let x_1 = s.offset. Let x_2 = ss_0.offset. Assume { (* Heap *) Have: (region(x) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). (* Invariant 'ZERO' *) Have: forall i_2 : Z. ((0 <= i_2) -> (((i_2 + x_1) < x_2) -> (Mchar_0[shift_sint8(s, i_2)] != 0))). (* Invariant 'RANGE' *) Have: addr_le(s, ss_0) /\ addr_le(ss_0, shift_sint8(s, L_Length(Mchar_0, s))). (* Invariant 'BASE' *) Have: ss_0.base = x. (* Else *) Have: Mchar_0[ss_0] = 0. } Prove: P_Length_of_str_is(Malloc_0, Mchar_0, s, x_2 - x_1). ------------------------------------------------------------ Goal Loop assigns (file tests/wp_typed/user_string.i, line 31): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'strlen' (1/2): Effect at line 34 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'strlen' (2/2): Effect at line 38 Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_string.i, line 34): Prove: true. ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_string.i, line 34): Let x = Mchar_0[ss_0]. Let x_1 = s.base. Let x_2 = L_Length(Mchar_0, s). Let x_3 = s.offset. Let x_4 = ss_0.offset. Assume { Type: is_sint8(x). (* Heap *) Have: (region(x_1) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). (* Invariant 'ZERO' *) Have: forall i_2 : Z. ((0 <= i_2) -> (((i_2 + x_3) < x_4) -> (Mchar_0[shift_sint8(s, i_2)] != 0))). (* Invariant 'RANGE' *) Have: addr_le(s, ss_0) /\ addr_le(ss_0, shift_sint8(s, x_2)). (* Invariant 'BASE' *) Have: ss_0.base = x_1. (* Then *) Have: x != 0. } Prove: x_4 <= (x_3 + x_2). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_string.1.res.oracle������������������0000666�0000000�0000000�00000012561�13571573400�025042� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_string.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function strlen ------------------------------------------------------------ Goal Post-condition (file tests/wp_typed/user_string.i, line 23) in 'strlen': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'BASE' (file tests/wp_typed/user_string.i, line 28): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'BASE' (file tests/wp_typed/user_string.i, line 28): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'RANGE' (file tests/wp_typed/user_string.i, line 29): Let x = Mchar_0[ss_0]. Let x_1 = s.base. Let a = shift_sint8(s, L_Length(Mchar_0, s)). Let a_1 = shift_sint8(ss_0, 1). Assume { Type: is_sint8(x). (* Heap *) Have: (region(x_1) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). (* Invariant 'ZERO' *) Have: forall i_2 : Z. ((0 <= i_2) -> (((i_2 + s.offset) < ss_0.offset) -> (Mchar_0[shift_sint8(s, i_2)] != 0))). (* Invariant 'RANGE' *) Have: addr_le(s, ss_0) /\ addr_le(ss_0, a). (* Invariant 'BASE' *) Have: ss_0.base = x_1. (* Then *) Have: x != 0. } Prove: addr_le(s, a_1) /\ addr_le(a_1, a). ------------------------------------------------------------ Goal Establishment of Invariant 'RANGE' (file tests/wp_typed/user_string.i, line 29): Assume { (* Heap *) Have: (region(s.base) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). } Prove: addr_le(s, s) /\ addr_le(s, shift_sint8(s, L_Length(Mchar_0, s))). ------------------------------------------------------------ Goal Preservation of Invariant 'ZERO' (file tests/wp_typed/user_string.i, line 30): Let x = Mchar_0[ss_0]. Let x_1 = s.base. Let x_2 = s.offset. Let x_3 = ss_0.offset. Assume { Type: is_sint8(x). (* Goal *) When: (0 <= i) /\ ((i + x_2) <= x_3). (* Heap *) Have: (region(x_1) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_2). (* Invariant 'ZERO' *) Have: forall i_3 : Z. ((0 <= i_3) -> (((i_3 + x_2) < x_3) -> (Mchar_0[shift_sint8(s, i_3)] != 0))). (* Invariant 'RANGE' *) Have: addr_le(s, ss_0) /\ addr_le(ss_0, shift_sint8(s, L_Length(Mchar_0, s))). (* Invariant 'BASE' *) Have: ss_0.base = x_1. (* Then *) Have: x != 0. } Prove: Mchar_0[shift_sint8(s, i)] != 0. ------------------------------------------------------------ Goal Establishment of Invariant 'ZERO' (file tests/wp_typed/user_string.i, line 30): Prove: true. ------------------------------------------------------------ Goal Assertion 'END' (file tests/wp_typed/user_string.i, line 37): Let x = s.base. Let x_1 = s.offset. Let x_2 = ss_0.offset. Assume { (* Heap *) Have: (region(x) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). (* Invariant 'ZERO' *) Have: forall i_2 : Z. ((0 <= i_2) -> (((i_2 + x_1) < x_2) -> (Mchar_0[shift_sint8(s, i_2)] != 0))). (* Invariant 'RANGE' *) Have: addr_le(s, ss_0) /\ addr_le(ss_0, shift_sint8(s, L_Length(Mchar_0, s))). (* Invariant 'BASE' *) Have: ss_0.base = x. (* Else *) Have: Mchar_0[ss_0] = 0. } Prove: P_Length_of_str_is(Malloc_0, Mchar_0, s, x_2 - x_1). ------------------------------------------------------------ Goal Loop assigns (file tests/wp_typed/user_string.i, line 31): Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'strlen' (1/2): Effect at line 34 Prove: true. ------------------------------------------------------------ Goal Assigns nothing in 'strlen' (2/2): Effect at line 38 Prove: true. ------------------------------------------------------------ Goal Decreasing of Loop variant at loop (file tests/wp_typed/user_string.i, line 34): Prove: true. ------------------------------------------------------------ Goal Positivity of Loop variant at loop (file tests/wp_typed/user_string.i, line 34): Let x = Mchar_0[ss_0]. Let x_1 = s.base. Let x_2 = L_Length(Mchar_0, s). Let x_3 = s.offset. Let x_4 = ss_0.offset. Assume { Type: is_sint8(x). (* Heap *) Have: (region(x_1) <= 0) /\ linked(Malloc_0) /\ sconst(Mchar_0). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i). (* Pre-condition *) Have: P_Length_of_str_is(Malloc_0, Mchar_0, s, i_1). (* Invariant 'ZERO' *) Have: forall i_2 : Z. ((0 <= i_2) -> (((i_2 + x_3) < x_4) -> (Mchar_0[shift_sint8(s, i_2)] != 0))). (* Invariant 'RANGE' *) Have: addr_le(s, ss_0) /\ addr_le(ss_0, shift_sint8(s, x_2)). (* Invariant 'BASE' *) Have: ss_0.base = x_1. (* Then *) Have: x != 0. } Prove: x_4 <= (x_3 + x_2). ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_swap.0.res.oracle��������������������0000666�0000000�0000000�00000003501�13571573400�024477� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_swap.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/user_swap.i, line 25): Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_swap.i, line 6) in 'swap'' in 'main' at call 'swap' (file tests/wp_typed/user_swap.i, line 24) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_swap.i, line 7) in 'swap'' in 'main' at call 'swap' (file tests/wp_typed/user_swap.i, line 24) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function swap ------------------------------------------------------------ Goal Post-condition 'A' in 'swap': Let x = Mint_0[a]. Let x_1 = Mint_0[b]. Let x_2 = Mint_0[a <- x_1][b <- x][a]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2). (* Heap *) Have: (region(a.base) <= 0) /\ (region(b.base) <= 0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, a, 1) /\ valid_rw(Malloc_0, b, 1). } Prove: x_2 = x_1. ------------------------------------------------------------ Goal Post-condition 'B' in 'swap': Prove: true. ------------------------------------------------------------ Goal Assigns 'E' in 'swap' (1/2): Effect at line 16 Prove: true. ------------------------------------------------------------ Goal Assigns 'E' in 'swap' (2/2): Effect at line 17 Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle/user_swap.1.res.oracle��������������������0000666�0000000�0000000�00000003113�13571573400�024477� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_swap.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Assertion (file tests/wp_typed/user_swap.i, line 25): Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_swap.i, line 6) in 'swap'' in 'main' at call 'swap' (file tests/wp_typed/user_swap.i, line 24) : Prove: true. ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_typed/user_swap.i, line 7) in 'swap'' in 'main' at call 'swap' (file tests/wp_typed/user_swap.i, line 24) : Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function swap ------------------------------------------------------------ Goal Post-condition 'A' in 'swap': Prove: true. ------------------------------------------------------------ Goal Post-condition 'B' in 'swap': Prove: true. ------------------------------------------------------------ Goal Assigns 'E' in 'swap': Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'swap': /*@ behavior typed_ref: requires \separated(a,b); requires \valid(a); requires \valid(b); */ void swap(int *a, int *b); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/�����������������������������������0000777�0000000�0000000�00000000000�13571573400�021714� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.res.oracle�����0000666�0000000�0000000�00000002402�13571573400�027532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/array_initialized.c (with preprocessing) [kernel] tests/wp_typed/array_initialized.c:13: Warning: Too many initializers for array g [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 5 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_main1_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main2_assert : Valid [wp] [Qed] Goal typed_main3_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_pointer_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_simpl_ensures : Valid [wp] Proved goals: 5 / 5 Qed: 1 Alt-Ergo 2.0.0: 4 [wp] Report in: 'tests/wp_typed/oracle_qualif/array_initialized.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/array_initialized.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main1 - 1 (1..12) 1 100% main2 - 1 (96..120) 1 100% main3 1 - 1 100% main_pointer - 1 (36..48) 1 100% simpl - 1 (12..24) 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/�������0000777�0000000�0000000�00000000000�13571573400�027237� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/cache/�0000777�0000000�0000000�00000000000�13571573400�030302� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/cache/55baf89709405ac3477a55d65a1f7437.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/cache/50000666�0000000�0000000�00000000127�13571573400�030371� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0253, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/cache/62b28c9aaf5071f95b892ef8ca5a3403.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/cache/60000666�0000000�0000000�00000000126�13571573400�030371� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0092, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/cache/9c1dad50b414ee369fd69bc9d0573507.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/cache/90000666�0000000�0000000�00000000127�13571573400�030375� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0282, "steps": 41 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/cache/d517f1ea6e30eb4409edb1685ab99e1b.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.0.session/cache/d0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0508, "steps": 108 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.res.oracle�����0000666�0000000�0000000�00000002402�13571573400�027533� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/array_initialized.c (with preprocessing) [kernel] tests/wp_typed/array_initialized.c:13: Warning: Too many initializers for array g [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 5 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_main1_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main2_assert : Valid [wp] [Qed] Goal typed_main3_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_pointer_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_simpl_ensures : Valid [wp] Proved goals: 5 / 5 Qed: 1 Alt-Ergo 2.0.0: 4 [wp] Report in: 'tests/wp_typed/oracle_qualif/array_initialized.1.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/array_initialized.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main1 - 1 (8..20) 1 100% main2 - 1 (104..128) 1 100% main3 1 - 1 100% main_pointer - 1 (44..56) 1 100% simpl - 1 (12..24) 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/�������0000777�0000000�0000000�00000000000�13571573400�027240� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/cache/�0000777�0000000�0000000�00000000000�13571573400�030303� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/cache/0226c036aa5891898e194a949cb4bad8.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/cache/00000666�0000000�0000000�00000000126�13571573400�030364� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.017, "steps": 12 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/cache/4c40e531b30c4cea3f1a55402ed96a2b.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/cache/40000666�0000000�0000000�00000000127�13571573400�030371� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0229, "steps": 48 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/cache/55baf89709405ac3477a55d65a1f7437.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/cache/50000666�0000000�0000000�00000000127�13571573400�030372� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0233, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/cache/cf4bc14ebc2273cf1f578315cec5298f.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.1.session/cache/c0000666�0000000�0000000�00000000130�13571573400�030442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0633, "steps": 115 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.c.0.report.json��0000666�0000000�0000000�00000011026�13571573400�030203� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 4, "rank": 21 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 5, "valid": 5, "rank": 21 } }, "wp:functions": { "main1": { "main1_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } }, "main2": { "main2_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "wp:main": { "total": 1, "valid": 1, "rank": 21 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "wp:main": { "total": 1, "valid": 1, "rank": 21 } } }, "main3": { "main3_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "main_pointer": { "main_pointer_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 10 }, "wp:main": { "total": 1, "valid": 1, "rank": 10 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 10 }, "wp:main": { "total": 1, "valid": 1, "rank": 10 } } }, "simpl": { "simpl_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/array_initialized.c.1.report.json��0000666�0000000�0000000�00000011026�13571573400�030204� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 4, "rank": 22 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 5, "valid": 5, "rank": 23 } }, "wp:functions": { "main1": { "main1_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } }, "main2": { "main2_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 23 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 22 }, "wp:main": { "total": 1, "valid": 1, "rank": 23 } } }, "main3": { "main3_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "main_pointer": { "main_pointer_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 14 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 14 } } }, "simpl": { "simpl_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } } } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/avar.0.report.json�����������������0000666�0000000�0000000�00000001047�13571573400�025212� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "g": { "f_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/avar.i.0.report.json���������������0000666�0000000�0000000�00000001047�13571573400�025441� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "g": { "f_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/avar.res.oracle��������������������0000666�0000000�0000000�00000001455�13571573400�024631� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/avar.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_typed/avar.i:4: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Qed] Goal typed_g_call_f_requires : Valid [wp] Proved goals: 1 / 1 Qed: 1 [wp] Report in: 'tests/wp_typed/oracle_qualif/avar.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/avar.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success g 1 - 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.report.json������������0000666�0000000�0000000�00000015736�13571573400�026252� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 8, "valid": 5, "unknown": 3, "rank": 5 }, "wp:main": { "total": 8, "valid": 5, "unknown": 3, "rank": 5 } }, "wp:functions": { "fits1": { "fits1_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } }, "mismatch1": { "mismatch1_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "fits2": { "fits2_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } }, "fits3": { "fits3_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } } }, "fits4": { "fits4_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } }, "fits5": { "fits5_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } }, "mismatch2": { "mismatch2_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "mismatch3": { "mismatch3_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ����������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025513� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026556� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/01b31a8d32606bc4d753764a4effdb69.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/01b31a8d30000666�0000000�0000000�00000000127�13571573400�027707� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0223, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/350ab72a5631cc09a74f36f1df8e6ce6.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/350ab72a50000666�0000000�0000000�00000000127�13571573400�027712� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0253, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/93a495c6aa514eeff83763085fe00a21.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/93a495c6a0000666�0000000�0000000�00000000126�13571573400�027730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.023, "steps": 12 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/ac04114d85a36676f0a72989d04ad0a7.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/ac04114d80000666�0000000�0000000�00000000107�13571573400�027710� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/b231ae79ea0fe869fda1ef72009e17f4.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/b231ae79e0000666�0000000�0000000�00000000126�13571573400�030002� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.023, "steps": 14 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/c3302b7cff80d960e1fe9acbfedd37b2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/c3302b7cf0000666�0000000�0000000�00000000107�13571573400�027773� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/df19ca38260e48624376dada84dccd43.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.0.session/cache/df19ca3820000666�0000000�0000000�00000000107�13571573400�030003� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/cast_fits.res.oracle���������������0000666�0000000�0000000�00000003712�13571573400�025655� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/cast_fits.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/cast_fits.i:13: Warning: Cast with incompatible pointers types (source: __anonstruct_L2_2*) (target: sint32*) [wp] tests/wp_typed/cast_fits.i:54: Warning: Cast with incompatible pointers types (source: __anonunion_L8_8*) (target: sint32*) [wp] tests/wp_typed/cast_fits.i:60: Warning: Cast with incompatible pointers types (source: sint32*) (target: __anonunion_L8_8*) [wp] 8 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_fits1_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_fits2_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_fits3_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_fits4_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_fits5_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_mismatch1_ensures : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_mismatch2_ensures : Unsuccess (Stronger) [wp] [Alt-Ergo 2.0.0] Goal typed_mismatch3_ensures : Unsuccess (Stronger) [wp] Proved goals: 5 / 8 Qed: 0 Alt-Ergo 2.0.0: 5 (unsuccess: 3) [wp] Report in: 'tests/wp_typed/oracle_qualif/cast_fits.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/cast_fits.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success fits1 - 1 (8..20) 1 100% mismatch1 - - 1 0.0% fits2 - 1 (8..20) 1 100% fits3 - 1 (16..28) 1 100% fits4 - 1 (8..20) 1 100% fits5 - 1 (8..20) 1 100% mismatch2 - - 1 0.0% mismatch3 - - 1 0.0% ------------------------------------------------------------- ������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/mvar.0.report.json�����������������0000666�0000000�0000000�00000001333�13571573400�025224� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "Job": { "Job_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/mvar.0.session/��������������������0000777�0000000�0000000�00000000000�13571573400�024501� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/mvar.0.session/cache/��������������0000777�0000000�0000000�00000000000�13571573400�025544� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/mvar.0.session/cache/895ce5c124c30552810b4458d89f3885.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/mvar.0.session/cache/895ce5c124c3050000666�0000000�0000000�00000000126�13571573400�027375� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0081, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000174�00000000000�007775� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/mvar.0.session/cache/e5ffef57a0640be83d7c30f0890f6022.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/mvar.0.session/cache/e5ffef57a0640b0000666�0000000�0000000�00000000126�13571573400�027617� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0089, "steps": 5 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/mvar.res.oracle��������������������0000666�0000000�0000000�00000001521�13571573400�024637� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/mvar.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_typed/mvar.i:14: Warning: No code nor implicit assigns clause for function Write, generating default assigns from the prototype [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_Job_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_typed/oracle_qualif/mvar.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/mvar.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success Job - 1 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.0.report.json����������0000666�0000000�0000000�00000004615�13571573400�026555� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 5, "valid": 5, "rank": 6 } }, "wp:functions": { "f": { "f_assert_5": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_assert_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "f_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 5, "valid": 5, "rank": 6 } } } } } �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026024� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027067� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.0.session/cache/3fc118376c0d61686ee236278514e97e.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.0.session/cache/3fc11830000666�0000000�0000000�00000000126�13571573400�030001� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.026, "steps": 22 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.0.session/cache/96ef4de15a302b15c8381191688def2f.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.0.session/cache/96ef4de0000666�0000000�0000000�00000000127�13571573400�030160� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0223, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.0.session/cache/ea44c4fb1c9d9e05f845023195ef9af7.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.0.session/cache/ea44c4f0000666�0000000�0000000�00000000127�13571573400�030144� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0226, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.i.0.report.json��������0000666�0000000�0000000�00000004376�13571573400�027010� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 3, "valid": 3, "rank": 6 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 5, "valid": 5, "rank": 6 } }, "wp:functions": { "f": { "f_assert_5": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "f_assert_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_assert_2": { "alt-ergo": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "f_assert": { "alt-ergo": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "alt-ergo": { "total": 3, "valid": 3, "rank": 6 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 5, "valid": 5, "rank": 6 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/shift_lemma.res.oracle�������������0000666�0000000�0000000�00000001611�13571573400�026162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/shift_lemma.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 5 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_2 : Valid [wp] [Qed] Goal typed_f_assert_3 : Valid [wp] [Qed] Goal typed_f_assert_4 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_5 : Valid [wp] Proved goals: 5 / 5 Qed: 2 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_typed/oracle_qualif/shift_lemma.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/shift_lemma.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 2 3 (20..32) 5 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/struct_array_type.0.report.json����0000666�0000000�0000000�00000002023�13571573400�030037� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:functions": { "f": { "f_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/struct_array_type.0.session/�������0000777�0000000�0000000�00000000000�13571573400�027317� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/struct_array_type.0.session/cache/�0000777�0000000�0000000�00000000000�13571573400�030362� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000211�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/struct_array_type.0.session/cache/6d805359e3283381e46c2a08305c0c24.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/struct_array_type.0.session/cache/60000666�0000000�0000000�00000000127�13571573400�030452� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0145, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/struct_array_type.i.0.report.json��0000666�0000000�0000000�00000002023�13571573400�030266� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:functions": { "f": { "f_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/struct_array_type.res.oracle�������0000666�0000000�0000000�00000001341�13571573400�027455� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/struct_array_type.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_typed/oracle_qualif/struct_array_type.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/struct_array_type.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (12..24) 1 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.0.res.oracle������������0000666�0000000�0000000�00000002213�13571573400�026160� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_alloc.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 7 goals scheduled [wp] [Qed] Goal typed_f_assigns : Valid [wp] [Qed] Goal typed_g_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_h_ensures : Valid [wp] [Qed] Goal typed_job_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_assert_2 : Valid [wp] [Qed] Goal typed_job_assert_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job_assert_4 : Valid [wp] Proved goals: 7 / 7 Qed: 4 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_alloc.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_alloc.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 2 2 (16..28) 4 100% f 1 - 1 100% g 1 - 1 100% h - 1 (8..20) 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.0.session/��������������0000777�0000000�0000000�00000000000�13571573400�025665� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.0.session/cache/��������0000777�0000000�0000000�00000000000�13571573400�026730� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.0.session/cache/231adc600de0d1f2c32a5a61a667816d.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.0.session/cache/231adc600000666�0000000�0000000�00000000127�13571573400�027776� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0194, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.0.session/cache/858923f594ba95cfa2a175bc579173e8.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.0.session/cache/858923f50000666�0000000�0000000�00000000127�13571573400�027670� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0195, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.0.session/cache/f5a0ac770771c7dc02aed3d95f573fe5.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.0.session/cache/f5a0ac770000666�0000000�0000000�00000000127�13571573400�030070� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0175, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.1.res.oracle������������0000666�0000000�0000000�00000002277�13571573400�026173� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_alloc.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 7 goals scheduled [wp] [Qed] Goal typed_ref_f_assigns : Valid [wp] [Qed] Goal typed_ref_g_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_h_ensures : Valid [wp] [Qed] Goal typed_ref_job_assert : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_job_assert_2 : Valid [wp] [Qed] Goal typed_ref_job_assert_3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_job_assert_4 : Valid [wp] Proved goals: 7 / 7 Qed: 4 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_alloc.1.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_alloc.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 2 2 (16..28) 4 100% f 1 - 1 100% g 1 - 1 100% h - 1 (8..20) 1 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.1.session/��������������0000777�0000000�0000000�00000000000�13571573400�025666� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.1.session/cache/��������0000777�0000000�0000000�00000000000�13571573400�026731� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.1.session/cache/231adc600de0d1f2c32a5a61a667816d.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.1.session/cache/231adc600000666�0000000�0000000�00000000127�13571573400�027777� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0153, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.1.session/cache/858923f594ba95cfa2a175bc579173e8.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.1.session/cache/858923f50000666�0000000�0000000�00000000127�13571573400�027671� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0199, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.1.session/cache/f5a0ac770771c7dc02aed3d95f573fe5.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.1.session/cache/f5a0ac770000666�0000000�0000000�00000000127�13571573400�030071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0272, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.i.0.report.json���������0000666�0000000�0000000�00000007613�13571573400�026646� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 7, "valid": 7, "rank": 6 } }, "wp:functions": { "job": { "job_assert_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "job_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_assert_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "job_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 4, "rank": 6 } } }, "f": { "f_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "g": { "g_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "h": { "h_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } } } } ���������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_alloc.i.1.report.json���������0000666�0000000�0000000�00000007613�13571573400�026647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 7, "valid": 7, "rank": 6 } }, "wp:functions": { "job": { "job_assert_4": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "job_assert_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_assert_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "job_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 4, "valid": 4, "rank": 6 } } }, "f": { "f_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "g": { "g_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "h": { "h_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } } } } ���������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.res.oracle����������0000666�0000000�0000000�00000013122�13571573400�026535� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_bitwise.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 61 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_band_sint8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_band_uint8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_blsr_sint8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_blsr_uint8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_bnot_sint8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_bor_sint8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_bor_uint8 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_bxor_sint8 : Valid [wp] [Qed] Goal typed_lemma_land_abs : Valid [wp] [Qed] Goal typed_lemma_land_assoc : Valid [wp] [Qed] Goal typed_lemma_land_com : Valid [wp] [Qed] Goal typed_lemma_land_stb : Valid [wp] [Qed] Goal typed_lemma_lor_assoc : Valid [wp] [Qed] Goal typed_lemma_lor_com : Valid [wp] [Qed] Goal typed_lemma_lor_neu : Valid [wp] [Qed] Goal typed_lemma_lor_stb : Valid [wp] [Qed] Goal typed_lemma_lxor_assoc : Valid [wp] [Qed] Goal typed_lemma_lxor_com : Valid [wp] [Qed] Goal typed_band1_uchar_assert_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_band1_uchar_assert_ok_2 : Valid [wp] [Qed] Goal typed_band1_uint_assert_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_band1_uint_assert_ok_2 : Valid [wp] [Qed] Goal typed_band1_ulong_assert_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_band1_ulong_assert_ok_2 : Valid [wp] [Qed] Goal typed_band1_ushort_assert_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_band1_ushort_assert_ok_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_band_char_ensures_ok : Valid [wp] [Qed] Goal typed_band_int_ensures_ok : Valid [wp] [Qed] Goal typed_band_int_assert_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_band_uchar_ensures_ok : Valid [wp] [Qed] Goal typed_band_uint_ensures_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bnot_char_ensures_ok : Valid [wp] [Qed] Goal typed_bnot_int_ensures_ok : Valid [wp] [Qed] Goal typed_bnot_uchar_ensures_ok : Valid [wp] [Qed] Goal typed_bnot_uint_ensures_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bor_char_ensures_ok : Valid [wp] [Qed] Goal typed_bor_int_ensures_ok : Valid [wp] [Qed] Goal typed_bor_uchar_ensures_ok : Valid [wp] [Qed] Goal typed_bor_uint_ensures_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bxor_char_ensures_ok : Valid [wp] [Qed] Goal typed_bxor_int_ensures_ok : Valid [wp] [Qed] Goal typed_bxor_uchar_ensures_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bxor_uchar_ensures_ok_2 : Valid [wp] [Qed] Goal typed_bxor_uint_ensures_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_bxor_uint_ensures_ok_2 : Valid [wp] [Qed] Goal typed_cast_ensures_ok : Valid [wp] [Qed] Goal typed_cast_assert_ok : Valid [wp] [Qed] Goal typed_cast_assert_ok_2 : Valid [wp] [Qed] Goal typed_cast_assert_ok_3 : Valid [wp] [Qed] Goal typed_cast_assert_ok_4 : Valid [wp] [Qed] Goal typed_cast_assert_ok_5 : Valid [wp] [Qed] Goal typed_cast_assert_ok_6 : Valid [wp] [Qed] Goal typed_cast_assert_ok_7 : Valid [wp] [Qed] Goal typed_lshift_char_ensures_ok : Valid [wp] [Qed] Goal typed_lshift_int_ensures_ok : Valid [wp] [Qed] Goal typed_lshift_uchar_ensures_ok : Valid [wp] [Qed] Goal typed_lshift_uint_ensures_ok : Valid [wp] [Qed] Goal typed_rshift_char_ensures_ok : Valid [wp] [Qed] Goal typed_rshift_int_ensures_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_rshift_uchar_ensures_ok : Valid [wp] [Qed] Goal typed_rshift_uint_ensures_ok : Valid [wp] Proved goals: 61 / 61 Qed: 41 Alt-Ergo 2.0.0: 20 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_bitwise.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_bitwise.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma 10 8 (32..44) 18 100% ------------------------------------------------------------- Functions WP Alt-Ergo Total Success band_int 2 - 2 100% bor_int 1 - 1 100% bxor_int 1 - 1 100% bnot_int 1 - 1 100% lshift_int 1 - 1 100% rshift_int 1 - 1 100% band1_uint 1 1 (12..24) 2 100% band_uint 1 - 1 100% bor_uint 1 - 1 100% bxor_uint 1 1 (12..24) 2 100% bnot_uint 1 - 1 100% lshift_uint 1 - 1 100% rshift_uint 1 - 1 100% band_char - 1 (12..24) 1 100% bor_char - 1 (12..24) 1 100% bxor_char - 1 (12..24) 1 100% bnot_char - 1 (8..20) 1 100% lshift_char 1 - 1 100% rshift_char 1 - 1 100% band1_uchar 1 1 (12..24) 2 100% band_uchar - 1 (12..24) 1 100% bor_uchar 1 - 1 100% bxor_uchar 1 1 (12..24) 2 100% bnot_uchar 1 - 1 100% lshift_uchar 1 - 1 100% rshift_uchar - 1 (20..32) 1 100% band1_ushort 1 1 (12..24) 2 100% band1_ulong 1 1 (12..24) 2 100% cast 8 - 8 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026241� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027304� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/004ac845ae4a785d4fdbb86120f0c314.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/004ac80000666�0000000�0000000�00000000127�13571573400�030126� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0312, "steps": 38 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/1c32382179a4141d62bff5310e671fc0.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/1c32380000666�0000000�0000000�00000000127�13571573400�030052� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0244, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/1f9de386423d1492664e876701348c9a.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/1f9de30000666�0000000�0000000�00000000127�13571573400�030222� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0316, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/22cd352417dac14e9f1ae99c41abc82c.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/22cd350000666�0000000�0000000�00000000127�13571573400�030131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0343, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/3c4a5ebcfee080a4e312b27642ccc507.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/3c4a5e0000666�0000000�0000000�00000000127�13571573400�030213� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0345, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/3edc2498c4f9af53bc71844bf3b5decb.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/3edc240000666�0000000�0000000�00000000127�13571573400�030213� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0348, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/46a0d3c26a8bfd22eec332ddb17e9186.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/46a0d30000666�0000000�0000000�00000000127�13571573400�030130� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0263, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/5f80dcc2503e3d496d272d363bac8ec9.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/5f80dc0000666�0000000�0000000�00000000127�13571573400�030220� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0332, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/6b3a0fabc8fff3e8340a114e8f2f8775.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/6b3a0f0000666�0000000�0000000�00000000127�13571573400�030210� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0307, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/6b96b373a888d2ad22f6bbbded229fe7.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/6b96b30000666�0000000�0000000�00000000127�13571573400�030142� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0326, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/804ab2c0bc65ace18118a96bd3d80a72.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/804ab20000666�0000000�0000000�00000000127�13571573400�030127� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0345, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/8e7c71f6dec836843a055e2ab3408816.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/8e7c710000666�0000000�0000000�00000000127�13571573400�030145� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0213, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/90b79b6c24be599880dfa15b1a40a6d6.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/90b79b0000666�0000000�0000000�00000000127�13571573400�030143� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0267, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/9d8c715a87fa25adc41f169095de4869.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/9d8c710000666�0000000�0000000�00000000127�13571573400�030146� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0212, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/9e4ea6fcbc2695bea58f3794a22c3c1e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/9e4ea60000666�0000000�0000000�00000000127�13571573400�030224� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0242, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/b173d1a75f5baa2eaa2e8450f7146d2e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/b173d10000666�0000000�0000000�00000000127�13571573400�030130� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0332, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/b2047b599c8f9aa7acca4d4505be6502.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/b2047b0000666�0000000�0000000�00000000127�13571573400�030127� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0314, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/b706a11795e39a83472e7b7a00e99e63.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/b706a10000666�0000000�0000000�00000000126�13571573400�030126� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.018, "steps": 17 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/ff5e3e7eb06476367c989b0161633549.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.0.session/cache/ff5e3e0000666�0000000�0000000�00000000125�13571573400�030302� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.03, "steps": 26 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.res.oracle����������0000666�0000000�0000000�00000002111�13571573400�026532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_bitwise.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 4 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_band_int_assert_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bnot_uchar_ensures_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_bnot_uint_ensures_ko : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_cast_assert_ko : Unsuccess [wp] Proved goals: 0 / 4 Alt-Ergo 2.0.0: 0 (unsuccess: 4) [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_bitwise.1.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_bitwise.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success band_int - - 1 0.0% bnot_uint - - 1 0.0% bnot_uchar - - 1 0.0% cast - - 1 0.0% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/������������0000777�0000000�0000000�00000000000�13571573400�026242� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027305� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/cache/1dae8dc38cb748f9343ca0d69bb38c25.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/cache/1dae8d0000666�0000000�0000000�00000000107�13571573400�030274� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/cache/5945f10ed5fb50005716725df2ecbbab.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/cache/5945f10000666�0000000�0000000�00000000107�13571573400�030063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/cache/7c08477b9cbcfb3078d09847c3f5f71c.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/cache/7c08470000666�0000000�0000000�00000000107�13571573400�030062� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/cache/e155aee6d2195fbd92c7782b9764f20a.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.1.session/cache/e155ae0000666�0000000�0000000�00000000107�13571573400�030213� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.c.0.report.json�������0000666�0000000�0000000�00000115215�13571573400�027212� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 20, "valid": 20, "rank": 9 }, "qed": { "total": 41, "valid": 41 }, "wp:main": { "total": 61, "valid": 61, "rank": 8 } }, "wp:axiomatics": { "": { "lemma_lxor_com": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_lxor_assoc": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_lor_stb": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_lor_neu": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_lor_com": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_lor_assoc": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_land_stb": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_land_com": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_land_assoc": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_land_abs": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "lemma_bxor_sint8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "lemma_bor_uint8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "lemma_bor_sint8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "lemma_bnot_sint8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "lemma_blsr_uint8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "lemma_blsr_sint8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "lemma_band_uint8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "lemma_band_sint8": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 8, "valid": 8, "rank": 9 }, "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 18, "valid": 18, "rank": 8 } } } }, "wp:functions": { "band_int": { "band_int_assert_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "band_int_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } }, "bor_int": { "bor_int_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "bxor_int": { "bxor_int_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "bnot_int": { "bnot_int_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "lshift_int": { "lshift_int_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "rshift_int": { "rshift_int_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "band1_uint": { "band1_uint_assert_ok_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "band1_uint_assert_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } } }, "band_uint": { "band_uint_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "bor_uint": { "bor_uint_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "bxor_uint": { "bxor_uint_ensures_ok_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "bxor_uint_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } } }, "bnot_uint": { "bnot_uint_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "lshift_uint": { "lshift_uint_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "rshift_uint": { "rshift_uint_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "band_char": { "band_char_ensures_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "bor_char": { "bor_char_ensures_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "bxor_char": { "bxor_char_ensures_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "bnot_char": { "bnot_char_ensures_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "lshift_char": { "lshift_char_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "rshift_char": { "rshift_char_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "band1_uchar": { "band1_uchar_assert_ok_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "band1_uchar_assert_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } } }, "band_uchar": { "band_uchar_ensures_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } }, "bor_uchar": { "bor_uchar_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "bxor_uchar": { "bxor_uchar_ensures_ok_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "bxor_uchar_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } } }, "bnot_uchar": { "bnot_uchar_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "lshift_uchar": { "lshift_uchar_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } }, "rshift_uchar": { "rshift_uchar_ensures_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } } }, "band1_ushort": { "band1_ushort_assert_ok_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "band1_ushort_assert_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } } }, "band1_ulong": { "band1_ulong_assert_ok_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "band1_ulong_assert_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } } }, "cast": { "cast_assert_ok_7": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "cast_assert_ok_6": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "cast_assert_ok_5": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "cast_assert_ok_4": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "cast_assert_ok_3": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "cast_assert_ok_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "cast_assert_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "cast_ensures_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_bitwise.c.1.report.json�������0000666�0000000�0000000�00000006412�13571573400�027211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 4, "unknown": 4 }, "wp:main": { "total": 4, "unknown": 4 } }, "wp:functions": { "band_int": { "band_int_assert_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "bnot_uint": { "bnot_uint_ensures_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "bnot_uchar": { "bnot_uchar_ensures_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } }, "cast": { "cast_assert_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_call.0.report.json������������0000666�0000000�0000000�00000002051�13571573400�026227� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:functions": { "job": { "job_assert": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_call.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025506� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_call.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026551� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_call.0.session/cache/51a2c8924a7c354c4e5f2843179b1d10.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_call.0.session/cache/51a2c89240000666�0000000�0000000�00000000126�13571573400�027635� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0133, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_call.i.0.report.json����������0000666�0000000�0000000�00000001744�13571573400�026466� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:functions": { "job": { "job_assert": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } ����������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_call.res.oracle���������������0000666�0000000�0000000�00000001537�13571573400�025653� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_call.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [kernel] tests/wp_typed/unit_call.i:7: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_job_assert : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_call.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_call.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job - 1 (1..12) 1 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cast.0.report.json������������0000666�0000000�0000000�00000002041�13571573400�026245� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:functions": { "f": { "f_assert_OUT": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cast.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025525� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cast.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026570� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cast.0.session/cache/1acaacb2b2e244807c31b57b8cd645cc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cast.0.session/cache/1acaacb2b0000666�0000000�0000000�00000000127�13571573400�030212� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0232, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cast.i.0.report.json����������0000666�0000000�0000000�00000002041�13571573400�026474� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:functions": { "f": { "f_assert_OUT": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cast.res.oracle���������������0000666�0000000�0000000�00000001504�13571573400�025664� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_cast.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/unit_cast.i:4: Warning: Cast with incompatible pointers types (source: sint32*) (target: sint8*) [wp] 1 goal scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_OUT : Valid [wp] Proved goals: 1 / 1 Qed: 0 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_cast.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_cast.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 1 (16..28) 1 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cst.0.report.json�������������0000666�0000000�0000000�00000001407�13571573400�026111� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:functions": { "f": { "f_ensures_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_A": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cst.i.0.report.json�����������0000666�0000000�0000000�00000001407�13571573400�026340� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:functions": { "f": { "f_ensures_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "f_ensures_A": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_cst.res.oracle����������������0000666�0000000�0000000�00000001316�13571573400�025524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_cst.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_f_ensures_A : Valid [wp] [Qed] Goal typed_f_ensures_B : Valid [wp] Proved goals: 2 / 2 Qed: 2 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_cst.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_cst.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 2 - 2 100% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_float.i.0.report.json���������0000666�0000000�0000000�00000004351�13571573400�026655� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } }, "wp:functions": { "main": { "main_ensures_VAR_D": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_ensures_VAR_F": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_ensures_CNV_D": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_ensures_CNV_F": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_ensures_CST_D": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_ensures_CST_F": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_float.res.oracle��������������0000666�0000000�0000000�00000002261�13571573400�026040� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed' [...] [kernel] Parsing tests/wp_typed/unit_float.i (no preprocessing) [kernel:parser:decimal-float] tests/wp_typed/unit_float.i:21: Warning: Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Qed] Goal typed_main_ensures_CST_F : Valid [wp] [Qed] Goal typed_main_ensures_CST_D : Valid [wp] [Qed] Goal typed_main_ensures_CNV_F : Valid [wp] [Qed] Goal typed_main_ensures_CNV_D : Valid [wp] [Qed] Goal typed_main_ensures_VAR_F : Valid [wp] [Qed] Goal typed_main_ensures_VAR_D : Valid [wp] Proved goals: 6 / 6 Qed: 6 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_float.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_float.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main 6 - 6 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_hard.0.report.json������������0000666�0000000�0000000�00000003632�13571573400�026240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } }, "wp:functions": { "main": { "main_requires_r_is_q1_ko": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_q_is_66F0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_p_is_33FF": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } } } } } ������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_hard.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025511� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_hard.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026554� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_hard.0.session/cache/807b3a99c3272409cea9ce5b5c1dc040.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_hard.0.session/cache/807b3a99c0000666�0000000�0000000�00000000072�13571573400�027727� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_hard.i.0.report.json����������0000666�0000000�0000000�00000003604�13571573400�026466� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } }, "wp:functions": { "main": { "main_requires_r_is_q1_ko": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "main_requires_q_is_66F0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_requires_p_is_33FF": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1 } } } } } ����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_hard.res.oracle���������������0000666�0000000�0000000�00000001531�13571573400�025650� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_hard.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_main_requires_p_is_33FF : Valid [wp] [Qed] Goal typed_main_requires_q_is_66F0 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_main_requires_r_is_q1_ko : Unsuccess [wp] Proved goals: 2 / 3 Qed: 2 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_hard.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_hard.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success main 2 - 3 66.7% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_ite.0.report.json�������������0000666�0000000�0000000�00000001273�13571573400�026102� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "check": { "check_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_ite.i.0.report.json�����������0000666�0000000�0000000�00000001273�13571573400�026331� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:functions": { "check": { "check_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_ite.res.oracle����������������0000666�0000000�0000000�00000001245�13571573400�025515� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_ite.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 1 goal scheduled [wp] [Qed] Goal typed_check_ensures : Valid [wp] Proved goals: 1 / 1 Qed: 1 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_ite.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_ite.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success check 1 - 1 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.0.report.json����������0000666�0000000�0000000�00000004161�13571573400�026562� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "wp:main": { "total": 3, "valid": 3, "rank": 6 } }, "wp:functions": { "duplet": { "duplet_assert_PJ": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "duplet_assert_PI": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "duplet_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "wp:main": { "total": 3, "valid": 3, "rank": 6 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026035� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027100� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.0.session/cache/06d4ef6a685a7aee45be22bae851588a.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.0.session/cache/06d4ef60000666�0000000�0000000�00000000127�13571573400�030101� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0223, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.0.session/cache/2960c76fc29a64d478b8ca3fe6d93430.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.0.session/cache/2960c760000666�0000000�0000000�00000000127�13571573400�027743� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0208, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.0.session/cache/baec4d7980fe8e76cb398da63faaa0b4.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.0.session/cache/baec4d70000666�0000000�0000000�00000000127�13571573400�030234� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0234, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.i.0.report.json��������0000666�0000000�0000000�00000004161�13571573400�027011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "wp:main": { "total": 3, "valid": 3, "rank": 4 } }, "wp:functions": { "duplet": { "duplet_assert_PJ": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "duplet_assert_PI": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "duplet_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 5 }, "wp:main": { "total": 3, "valid": 3, "rank": 4 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_labels.res.oracle�������������0000666�0000000�0000000�00000001511�13571573400�026172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_labels.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_duplet_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_duplet_assert_PI : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_duplet_assert_PJ : Valid [wp] Proved goals: 3 / 3 Qed: 0 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_labels.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_labels.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success duplet - 3 (20..32) 3 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/��������������0000777�0000000�0000000�00000000000�13571573400�025666� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/��������0000777�0000000�0000000�00000000000�13571573400�026731� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/068e80340e8c40c1c577aba748dc1c92.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/068e80340000666�0000000�0000000�00000000126�13571573400�027654� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0066, "steps": 7 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/4840e191521173237ce2962142ae08c6.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/4840e1910000666�0000000�0000000�00000000126�13571573400�027652� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0067, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/739ea0a07fdb15c217020db88cb899d6.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/739ea0a00000666�0000000�0000000�00000000072�13571573400�030004� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/cfa5b5bda4db07159e0a722d1ea3ddeb.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/cfa5b5bd0000666�0000000�0000000�00000000126�13571573400�030226� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0091, "steps": 5 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/e363be29dbc13ae78d21c0ab0218ad5d.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/e363be290000666�0000000�0000000�00000000126�13571573400�030015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0101, "steps": 6 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/f9ca1daffc903faa8a9befb274be3d26.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.0.session/cache/f9ca1daf0000666�0000000�0000000�00000000125�13571573400�030230� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.011, "steps": 5 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.i.0.report.json���������0000666�0000000�0000000�00000011241�13571573400�026637� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 5, "unknown": 1, "rank": 1 }, "wp:main": { "total": 6, "valid": 5, "unknown": 1, "rank": 1 } }, "wp:axiomatics": { "": { "lemma_P52": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "lemma_P23_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1, "rank": 1 } } }, "G1": { "lemma_P14": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "lemma_P13": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 1 } } }, "G2": { "lemma_P54": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } }, "Poluted": { "lemma_Foo": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 1 }, "wp:main": { "total": 1, "valid": 1, "rank": 1 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_lemma.res.oracle��������������0000666�0000000�0000000�00000002160�13571573400�026024� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_lemma.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] 6 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_P23_KO : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_P52 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_P13 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_P14 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_P54 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_lemma_Foo : Valid [wp] Proved goals: 5 / 6 Qed: 0 Alt-Ergo 2.0.0: 5 (unsuccess: 1) [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_lemma.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_lemma.0.report.json' ------------------------------------------------------------- Axiomatics WP Alt-Ergo Total Success Lemma - 1 (1..12) 2 50.0% Axiomatic G1 - 2 (1..12) 2 100% Axiomatic G2 - 1 (1..12) 1 100% Axiomatic Poluted - 1 (1..12) 1 100% ------------------------------------------------------------- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.0.res.oracle������������0000666�0000000�0000000�00000001553�13571573400�026166� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_local.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Qed] Goal typed_bar_assigns : Valid [wp] [Qed] Goal typed_foo_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_foo_assigns_part2 : Valid [wp] Proved goals: 3 / 3 Qed: 2 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_local.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_local.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo 1 1 (16..28) 2 100% bar 1 - 1 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.0.session/��������������0000777�0000000�0000000�00000000000�13571573400�025665� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.0.session/cache/��������0000777�0000000�0000000�00000000000�13571573400�026730� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.0.session/cache/6e5fd2ad22b7c9f54f64d91dae29dde1.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.0.session/cache/6e5fd2ad0000666�0000000�0000000�00000000127�13571573400�030153� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0132, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.1.res.oracle������������0000666�0000000�0000000�00000001645�13571573400�026171� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Raw)' [...] [kernel] Parsing tests/wp_typed/unit_local.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_raw_bar_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_raw_foo_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_raw_foo_assigns_part2 : Valid [wp] Proved goals: 3 / 3 Qed: 0 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_local.1.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_local.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success foo - 2 (16..28) 2 100% bar - 1 (16..28) 1 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.1.session/��������������0000777�0000000�0000000�00000000000�13571573400�025666� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.1.session/cache/��������0000777�0000000�0000000�00000000000�13571573400�026731� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.1.session/cache/80a38b049190d6b75796d20a3ff8a48a.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.1.session/cache/80a38b040000666�0000000�0000000�00000000127�13571573400�027725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0177, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.1.session/cache/84b5fa3ae353adf589e77a910f9ec2c7.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.1.session/cache/84b5fa3a0000666�0000000�0000000�00000000127�13571573400�030071� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0161, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000202�00000000000�007765� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.1.session/cache/fb83e2c25fded1d5e6cee517f4302fad.json�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.1.session/cache/fb83e2c20000666�0000000�0000000�00000000127�13571573400�030072� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0157, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.c.0.report.json���������0000666�0000000�0000000�00000003574�13571573400�026642� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 3, "valid": 3, "rank": 5 } }, "wp:functions": { "foo": { "foo_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } } }, "bar": { "bar_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } } } } } ������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_local.c.1.report.json���������0000666�0000000�0000000�00000003571�13571573400�026640� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 6 }, "wp:main": { "total": 3, "valid": 3, "rank": 6 } }, "wp:functions": { "foo": { "foo_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 6 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 6 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } } }, "bar": { "bar_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 6 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.0.res.oracle��������0000666�0000000�0000000�00000001644�13571573400�027100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_loopscope.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/unit_loopscope.i:14: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 2 goals scheduled [wp] [Qed] Goal typed_f_loop_invariant_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_loop_invariant_established : Unsuccess [wp] Proved goals: 1 / 2 Qed: 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_loopscope.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_loopscope.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 1 - 2 50.0% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.0.session/����������0000777�0000000�0000000�00000000000�13571573400�026576� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.0.session/cache/����0000777�0000000�0000000�00000000000�13571573400�027641� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000206�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.0.session/cache/c089c450772a3a0346e02bc1e798bdb0.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.0.session/cache/c0890000666�0000000�0000000�00000000072�13571573400�030246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.1.res.oracle��������0000666�0000000�0000000�00000002124�13571573400�027073� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/unit_loopscope.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_typed/unit_loopscope.i:14: Warning: Missing assigns clause (assigns 'everything' instead) [wp] 2 goals scheduled [wp] [Qed] Goal typed_ref_f_loop_invariant_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_f_loop_invariant_established : Unsuccess [wp] Proved goals: 1 / 2 Qed: 1 Alt-Ergo 2.0.0: 0 (unsuccess: 1) [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_loopscope.1.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_loopscope.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f 1 - 2 50.0% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'f': /*@ behavior typed_ref: requires \valid(written); */ void f(unsigned int *written); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.1.session/����������0000777�0000000�0000000�00000000000�13571573400�026577� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.1.session/cache/����0000777�0000000�0000000�00000000000�13571573400�027642� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000206�00000000000�007771� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.1.session/cache/2d7c06745f3753a4a8a87aab2a863efc.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.1.session/cache/2d7c0000666�0000000�0000000�00000000072�13571573400�030323� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.i.0.report.json�����0000666�0000000�0000000�00000002314�13571573400�027550� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "wp:functions": { "f": { "f_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_loopscope.i.1.report.json�����0000666�0000000�0000000�00000002314�13571573400�027551� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "wp:functions": { "f": { "f_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_matrix.0.report.json����������0000666�0000000�0000000�00000004137�13571573400�026627� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1, "rank": 3 } }, "wp:functions": { "make": { "make_ensures_KO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "make_ensures_OK2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "make_ensures_OK1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 1, "unknown": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1, "rank": 3 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_matrix.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026077� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_matrix.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027142� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_matrix.0.session/cache/18f592a6c7a637717dc4f838b22cc228.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_matrix.0.session/cache/18f592a0000666�0000000�0000000�00000000127�13571573400�030064� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0095, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_matrix.0.session/cache/cc0d1ac6f6f59a78e04778f515e93997.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_matrix.0.session/cache/cc0d1ac0000666�0000000�0000000�00000000107�13571573400�030261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_matrix.i.0.report.json��������0000666�0000000�0000000�00000004052�13571573400�027052� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 2, "valid": 1, "unknown": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1, "rank": 3 } }, "wp:functions": { "make": { "make_ensures_KO": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "make_ensures_OK2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "make_ensures_OK1": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "alt-ergo": { "total": 2, "valid": 1, "unknown": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 2, "unknown": 1, "rank": 3 } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_matrix.res.oracle�������������0000666�0000000�0000000�00000001523�13571573400�026237� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_matrix.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 3 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_make_ensures_OK1 : Valid [wp] [Qed] Goal typed_make_ensures_OK2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_make_ensures_KO : Unsuccess [wp] Proved goals: 2 / 3 Qed: 1 Alt-Ergo 2.0.0: 1 (unsuccess: 1) [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_matrix.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_matrix.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success make 1 1 (8..20) 3 66.7% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026101� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027144� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/3edeafeea0a17e8e0e359ecd8e5a5090.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/3edeafe0000666�0000000�0000000�00000000127�13571573400�030363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0491, "steps": 70 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/4073bb68237268f1f8fb55a7493fe963.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/4073bb60000666�0000000�0000000�00000000127�13571573400�030056� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0374, "steps": 62 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/6a171da02d906e7eeb564bbf61683223.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/6a171da0000666�0000000�0000000�00000000127�13571573400�030133� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0246, "steps": 34 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/6ab91892d1fc5574e862b9592b5b0898.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/6ab91890000666�0000000�0000000�00000000127�13571573400�030072� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0512, "steps": 79 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/763383182ae33cdadbc4d0c8c7d84061.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/76338310000666�0000000�0000000�00000000127�13571573400�027725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0355, "steps": 59 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/b29cf8d3f11583cabff01ab730386006.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.0.session/cache/b29cf8d0000666�0000000�0000000�00000000127�13571573400�030230� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0395, "steps": 62 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.i.0.report.json��������0000666�0000000�0000000�00000006327�13571573400�027063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 6, "rank": 18 }, "wp:main": { "total": 6, "valid": 6, "rank": 17 } }, "wp:functions": { "f": { "f_assert_VAL": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 14 }, "wp:main": { "total": 1, "valid": 1, "rank": 15 } }, "f_assert_B_rw": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 15 }, "wp:main": { "total": 1, "valid": 1, "rank": 15 } }, "f_assert_B_out": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 15 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "f_assert_B_end": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 16 }, "wp:main": { "total": 1, "valid": 1, "rank": 16 } }, "f_assert_B_valid": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 18 }, "wp:main": { "total": 1, "valid": 1, "rank": 18 } }, "f_assert_AB": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "wp:main": { "total": 1, "valid": 1, "rank": 8 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 6, "valid": 6, "rank": 18 }, "wp:main": { "total": 6, "valid": 6, "rank": 17 } } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_string.res.oracle�������������0000666�0000000�0000000�00000001751�13571573400�026244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_string.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_AB : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_B_valid : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_B_end : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_B_out : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_B_rw : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_f_assert_VAL : Valid [wp] Proved goals: 6 / 6 Qed: 0 Alt-Ergo 2.0.0: 6 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_string.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_string.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success f - 6 (72..96) 6 100% ------------------------------------------------------------- �����������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_tset.i.0.report.json����������0000666�0000000�0000000�00000002001�13571573400�026515� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "wp:functions": { "complex": { "job_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "complex_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } } } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/unit_tset.res.oracle���������������0000666�0000000�0000000�00000001343�13571573400�025712� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/unit_tset.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 2 goals scheduled [wp] [Qed] Goal typed_complex_call_job_requires : Valid [wp] [Qed] Goal typed_complex_assigns : Valid [wp] Proved goals: 2 / 2 Qed: 2 [wp] Report in: 'tests/wp_typed/oracle_qualif/unit_tset.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/unit_tset.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success complex 2 - 2 100% ------------------------------------------------------------- ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.res.oracle����������0000666�0000000�0000000�00000003261�13571573400�026537� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_bitwise.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 12 goals scheduled [wp] [Qed] Goal typed_ref_rl1_ensures_b0 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rl1_ensures_bk : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rln32_ensures_b1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rln32_ensures_b2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rln64_ensures_b1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rln64_ensures_b2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rr1_ensures_b0 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rr1_ensures_bk : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rrn32_ensures_b1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rrn32_ensures_b2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rrn64_ensures_b1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_ref_rrn64_ensures_b2 : Valid [wp] Proved goals: 12 / 12 Qed: 1 Alt-Ergo 2.0.0: 11 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_bitwise.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_bitwise.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success rl1 1 1 (52..64) 2 100% rr1 - 2 (52..64) 2 100% rln32 - 2 (64..88) 2 100% rrn32 - 2 (64..88) 2 100% rln64 - 2 (64..88) 2 100% rrn64 - 2 (64..88) 2 100% ------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026240� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027303� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/2a99efd40d5dc72611e4194c15952930.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/2a99ef0000666�0000000�0000000�00000000127�13571573400�030225� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0335, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/71e00f8738f2f0572b0f7356c68b6d4e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/71e00f0000666�0000000�0000000�00000000127�13571573400�030130� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0629, "steps": 68 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/766a0e00f67af30922ebda94d841073e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/766a0e0000666�0000000�0000000�00000000127�13571573400�030136� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0778, "steps": 73 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/7b72b0d78e1465aa092ec6718f7dba34.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/7b72b00000666�0000000�0000000�00000000127�13571573400�030131� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0674, "steps": 72 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/9835ec6ee6e0aa525508f2538c4fe771.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/9835ec0000666�0000000�0000000�00000000127�13571573400�030146� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0617, "steps": 68 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/a78463f0759de4a4c64f6463d5ee4fa4.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/a784630000666�0000000�0000000�00000000127�13571573400�030062� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0767, "steps": 73 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/c532c9d58425e86864eab87cb87852c4.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/c532c90000666�0000000�0000000�00000000126�13571573400�030135� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.042, "steps": 67 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/c987f056b7a00d97c82cee451e558d5e.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/c987f00000666�0000000�0000000�00000000127�13571573400�030146� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0717, "steps": 72 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/cfc22935dd8816750938954336b944d8.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/cfc2290000666�0000000�0000000�00000000126�13571573400�030215� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.049, "steps": 58 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/e1cf4931c611c331b5828398e1f0f9ea.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/e1cf490000666�0000000�0000000�00000000127�13571573400�030221� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0629, "steps": 67 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/f2e288c6ba3fc74ec5ba8e7052418211.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.0.session/cache/f2e2880000666�0000000�0000000�00000000127�13571573400�030144� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0504, "steps": 56 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.1.res.oracle����������0000666�0000000�0000000�00000000725�13571573400�026542� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_bitwise.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 0 goal scheduled [wp] Proved goals: 0 / 0 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_bitwise.1.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_bitwise.1.report.json' ------------------------------------------------------------- �������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.i.0.report.json�������0000666�0000000�0000000�00000021222�13571573400�027211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 11, "valid": 11, "rank": 21 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 12, "valid": 12, "rank": 20 } }, "wp:functions": { "rl1": { "rl1_ensures_bk": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 13 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "rl1_ensures_b0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 13 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 12 } } }, "rr1": { "rr1_ensures_bk": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "rr1_ensures_b0": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 12 }, "wp:main": { "total": 2, "valid": 2, "rank": 11 } } }, "rln32": { "rln32_ensures_b2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "wp:main": { "total": 1, "valid": 1, "rank": 21 } }, "rln32_ensures_b1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 19 }, "wp:main": { "total": 1, "valid": 1, "rank": 19 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 21 }, "wp:main": { "total": 2, "valid": 2, "rank": 20 } } }, "rrn32": { "rrn32_ensures_b2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 18 }, "wp:main": { "total": 1, "valid": 1, "rank": 18 } }, "rrn32_ensures_b1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "wp:main": { "total": 1, "valid": 1, "rank": 21 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 21 }, "wp:main": { "total": 2, "valid": 2, "rank": 20 } } }, "rln64": { "rln64_ensures_b2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "wp:main": { "total": 1, "valid": 1, "rank": 21 } }, "rln64_ensures_b1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 19 }, "wp:main": { "total": 1, "valid": 1, "rank": 19 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 21 }, "wp:main": { "total": 2, "valid": 2, "rank": 20 } } }, "rrn64": { "rrn64_ensures_b2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 18 }, "wp:main": { "total": 1, "valid": 1, "rank": 18 } }, "rrn64_ensures_b1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "wp:main": { "total": 1, "valid": 1, "rank": 21 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 21 }, "wp:main": { "total": 2, "valid": 2, "rank": 20 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_bitwise.i.1.report.json�������0000666�0000000�0000000�00000000005�13571573400�027206� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.report.json���������0000666�0000000�0000000�00000033670�13571573400�026753� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 15, "valid": 15, "rank": 12 }, "qed": { "total": 17, "valid": 17 }, "wp:main": { "total": 32, "valid": 32, "rank": 13 } }, "wp:functions": { "job": { "job_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "job_ensures_P": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "job2": { "job2_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "job2_ensures_Q": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job2_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "job3": { "job3_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "job3_ensures_Q": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "job3_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 5, "valid": 5, "rank": 5 } } }, "caller": { "job_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "job_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "caller_ensures_P2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "caller_ensures_P1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "caller_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 4, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 5, "valid": 5, "rank": 9 } } }, "caller2": { "job2_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "job2_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "caller2_ensures_R": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "caller2_ensures_Q2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "caller2_ensures_Q1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "caller2_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 12 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 13 } } }, "caller3": { "job3_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "job3_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "caller3_ensures_R": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "caller3_ensures_Q2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 13 } }, "caller3_ensures_Q1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "caller3_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 12 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 13 } } } } } ������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026217� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027262� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/1e1971aba9e213a3834fd0075f0d16f2.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/1e19710000666�0000000�0000000�00000000126�13571573400�030033� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0128, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/36d1d613dcd28dbff9027bd624d9f1ea.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/36d1d60000666�0000000�0000000�00000000127�13571573400�030114� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0141, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/3db08a4ec3b1c26942faf4fef0c7c7dd.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/3db08a0000666�0000000�0000000�00000000127�13571573400�030166� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0174, "steps": 37 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/6063796664ffb4fa4f35179577f25d88.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/6063790000666�0000000�0000000�00000000127�13571573400�027763� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0119, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/950ad2561e5a99afcab1ec9cac18f07d.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/950ad20000666�0000000�0000000�00000000127�13571573400�030111� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0277, "steps": 39 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/ac50150b93111355c0d052553c80aead.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/ac50150000666�0000000�0000000�00000000127�13571573400�030103� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0245, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/bb874fe07e3ace324494b9fb02ec1462.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/bb874f0000666�0000000�0000000�00000000127�13571573400�030201� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0369, "steps": 49 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/c16210fcd8fef3377492b4e49810d049.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/c162100000666�0000000�0000000�00000000127�13571573400�030021� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0265, "steps": 37 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/e9df85a8bbbb031ff7f9d5f56814a985.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.0.session/cache/e9df850000666�0000000�0000000�00000000127�13571573400�030211� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0315, "steps": 50 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.i.0.report.json�������0000666�0000000�0000000�00000033670�13571573400�027202� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 15, "valid": 15, "rank": 12 }, "qed": { "total": 17, "valid": 17 }, "wp:main": { "total": 32, "valid": 32, "rank": 12 } }, "wp:functions": { "job": { "job_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "job_ensures_P": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "job2": { "job2_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "job2_ensures_Q": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job2_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 5, "valid": 5 } } }, "job3": { "job3_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "job3_ensures_Q": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "job3_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 5, "valid": 5, "rank": 5 } } }, "caller": { "job_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "job_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "caller_ensures_P2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "caller_ensures_P1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "caller_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 4, "valid": 4, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 5, "valid": 5, "rank": 9 } } }, "caller2": { "job2_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "job2_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "caller2_ensures_R": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "caller2_ensures_Q2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "caller2_ensures_Q1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "caller2_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 12 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 12 } } }, "caller3": { "job3_requires_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "job3_requires": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "caller3_ensures_R": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "caller3_ensures_Q2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "wp:main": { "total": 1, "valid": 1, "rank": 12 } }, "caller3_ensures_Q1": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 9 }, "wp:main": { "total": 1, "valid": 1, "rank": 9 } }, "caller3_ensures_K": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 12 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 12 } } } } } ������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_collect.res.oracle������������0000666�0000000�0000000�00000005226�13571573400�026363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_collect.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 32 goals scheduled [wp] [Qed] Goal typed_caller_ensures_K : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller_ensures_P1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller_ensures_P2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller_call_job_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller_call_job_2_requires : Valid [wp] [Qed] Goal typed_caller2_ensures_K : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller2_ensures_Q1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller2_ensures_Q2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller2_ensures_R : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller2_call_job2_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller2_call_job2_2_requires : Valid [wp] [Qed] Goal typed_caller3_ensures_K : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller3_ensures_Q1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller3_ensures_Q2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller3_ensures_R : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller3_call_job3_requires : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caller3_call_job3_2_requires : Valid [wp] [Qed] Goal typed_job_ensures_K : Valid [wp] [Qed] Goal typed_job_ensures_P : Valid [wp] [Qed] Goal typed_job_assigns_part1 : Valid [wp] [Qed] Goal typed_job_assigns_part2 : Valid [wp] [Qed] Goal typed_job_assigns_part3 : Valid [wp] [Qed] Goal typed_job2_ensures_K : Valid [wp] [Qed] Goal typed_job2_ensures_Q : Valid [wp] [Qed] Goal typed_job2_assigns_part1 : Valid [wp] [Qed] Goal typed_job2_assigns_part2 : Valid [wp] [Qed] Goal typed_job2_assigns_part3 : Valid [wp] [Qed] Goal typed_job3_ensures_K : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_job3_ensures_Q : Valid [wp] [Qed] Goal typed_job3_assigns_part1 : Valid [wp] [Qed] Goal typed_job3_assigns_part2 : Valid [wp] [Qed] Goal typed_job3_assigns_part3 : Valid [wp] Proved goals: 32 / 32 Qed: 17 Alt-Ergo 2.0.0: 15 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_collect.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_collect.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 5 - 5 100% job2 5 - 5 100% job3 4 1 (16..28) 5 100% caller 1 4 (32..44) 5 100% caller2 1 5 (48..60) 6 100% caller3 1 5 (48..60) 6 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.report.json������������0000666�0000000�0000000�00000046724�13571573400�026275� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 27, "valid": 16, "unknown": 11, "rank": 19 }, "qed": { "total": 27, "valid": 27 }, "wp:main": { "total": 54, "valid": 43, "unknown": 11, "rank": 19 } }, "wp:functions": { "init": { "init_loop_invariant_Partial": { "alt-ergo": { "total": 1, "valid": 1, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 9 } }, "init_loop_invariant_Range": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "init_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_loop_assigns": { "alt-ergo": { "total": 1, "valid": 1, "rank": 19 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 19 } }, "init_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "wp:section": { "alt-ergo": { "total": 4, "valid": 4, "rank": 19 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 8, "valid": 8, "rank": 19 } } }, "init_t1": { "init_t1_loop_invariant_Partial": { "alt-ergo": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "init_t1_loop_invariant_Range": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 2 } }, "init_t1_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "init_t1_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t1_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "alt-ergo": { "total": 3, "valid": 3, "rank": 4 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 8, "valid": 8, "rank": 4 } } }, "init_t2": { "init_t2_assert_i": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t2_assert_j": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t2_loop_invariant_Previous_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "init_t2_loop_invariant_Partial_j": { "alt-ergo": { "total": 1, "valid": 1, "rank": 8 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "init_t2_loop_invariant_Range_j": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } }, "init_t2_loop_invariant_Partial_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 11 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 11 } }, "init_t2_loop_invariant_Range_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 2 } }, "init_t2_assigns": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "init_t2_loop_assigns_2": { "alt-ergo": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } }, "init_t2_loop_assigns": { "alt-ergo": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } }, "init_t2_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "alt-ergo": { "total": 11, "valid": 6, "unknown": 5, "rank": 11 }, "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 21, "valid": 16, "unknown": 5, "rank": 11 } } }, "init_t2_bis": { "init_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t2_bis_assert_i": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t2_bis_loop_invariant_Partial_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 10 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 10 } }, "init_t2_bis_loop_invariant_Range_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } }, "init_t2_bis_assigns": { "alt-ergo": { "total": 3, "unknown": 3 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 5, "valid": 2, "unknown": 3 } }, "init_t2_bis_loop_assigns": { "alt-ergo": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } }, "init_t2_bis_exits": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "init_t2_bis_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "alt-ergo": { "total": 9, "valid": 3, "unknown": 6, "rank": 10 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 17, "valid": 11, "unknown": 6, "rank": 10 } } } } } ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.res.oracle�������������0000666�0000000�0000000�00000017125�13571573400�026040� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_init.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] [CFG] Goal init_exits : Valid (Unreachable) [wp] [CFG] Goal init_t1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v2_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v3_exits : Valid (Unreachable) [wp] Warning: Missing RTE guards [wp] 91 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_init_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_Partial_preserved : Valid [wp] [Qed] Goal typed_init_loop_invariant_Partial_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_Range_preserved : Valid [wp] [Qed] Goal typed_init_loop_invariant_Range_established : Valid [wp] [Qed] Goal typed_init_loop_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_init_assigns : Valid [wp] [Qed] Goal typed_init_loop_variant_decrease : Valid [wp] [Qed] Goal typed_init_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t1_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t1_loop_invariant_Partial_preserved : Valid [wp] [Qed] Goal typed_init_t1_loop_invariant_Partial_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t1_loop_invariant_Range_preserved : Valid [wp] [Qed] Goal typed_init_t1_loop_invariant_Range_established : Valid [wp] [Qed] Goal typed_init_t1_loop_assigns : Valid [wp] [Qed] Goal typed_init_t1_assigns_part1 : Valid [wp] [Qed] Goal typed_init_t1_assigns_part2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t1_loop_variant_decrease : Valid [wp] [Qed] Goal typed_init_t1_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v1_ensures : Valid [wp] [Qed] Goal typed_init_t2_bis_v1_exits : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v1_loop_invariant_Partial_preserved : Valid [wp] [Qed] Goal typed_init_t2_bis_v1_loop_invariant_Partial_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v1_loop_invariant_Range_preserved : Valid [wp] [Qed] Goal typed_init_t2_bis_v1_loop_invariant_Range_established : Valid [wp] [Qed] Goal typed_init_t2_bis_v1_assert_Offset : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v1_loop_variant_decrease : Valid [wp] [Qed] Goal typed_init_t2_bis_v1_loop_variant_positive : Valid [wp] [Qed] Goal typed_init_t2_bis_v1_call_init_requires : Valid [wp] [Qed] Goal typed_init_t2_bis_v1_call_init_requires_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v2_ensures : Valid [wp] [Qed] Goal typed_init_t2_bis_v2_exits : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v2_loop_invariant_Partial_preserved : Valid [wp] [Qed] Goal typed_init_t2_bis_v2_loop_invariant_Partial_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v2_loop_invariant_Range_preserved : Valid [wp] [Qed] Goal typed_init_t2_bis_v2_loop_invariant_Range_established : Valid [wp] [Qed] Goal typed_init_t2_bis_v2_assert_Offset_i : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v2_loop_variant_decrease : Valid [wp] [Qed] Goal typed_init_t2_bis_v2_loop_variant_positive : Valid [wp] [Qed] Goal typed_init_t2_bis_v2_call_init_requires : Valid [wp] [Qed] Goal typed_init_t2_bis_v2_call_init_requires_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_invariant_Partial_i_preserved : Valid [wp] [Qed] Goal typed_init_t2_v1_loop_invariant_Partial_i_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_invariant_Range_i_preserved : Valid [wp] [Qed] Goal typed_init_t2_v1_loop_invariant_Range_i_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_invariant_Partial_j_preserved : Valid [wp] [Qed] Goal typed_init_t2_v1_loop_invariant_Partial_j_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_invariant_Previous_i_preserved : Valid [wp] [Qed] Goal typed_init_t2_v1_loop_invariant_Previous_i_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_invariant_Range_j_preserved : Valid [wp] [Qed] Goal typed_init_t2_v1_loop_invariant_Range_j_established : Valid [wp] [Qed] Goal typed_init_t2_v1_assert_Last_j : Valid [wp] [Qed] Goal typed_init_t2_v1_assert_Last_i : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_variant_decrease : Valid [wp] [Qed] Goal typed_init_t2_v1_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_init_t2_v1_loop_variant_2_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v2_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v2_loop_invariant_Partial_i_preserved : Valid [wp] [Qed] Goal typed_init_t2_v2_loop_invariant_Partial_i_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v2_loop_invariant_Range_i_preserved : Valid [wp] [Qed] Goal typed_init_t2_v2_loop_invariant_Range_i_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v2_loop_invariant_Partial_j_preserved : Valid [wp] [Qed] Goal typed_init_t2_v2_loop_invariant_Partial_j_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v2_loop_invariant_Previous_i_preserved : Valid [wp] [Qed] Goal typed_init_t2_v2_loop_invariant_Previous_i_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v2_loop_invariant_Range_j_preserved : Valid [wp] [Qed] Goal typed_init_t2_v2_loop_invariant_Range_j_established : Valid [wp] [Qed] Goal typed_init_t2_v2_assert_Last_j : Valid [wp] [Qed] Goal typed_init_t2_v2_assert_Last_i : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v2_loop_variant_decrease : Valid [wp] [Qed] Goal typed_init_t2_v2_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v2_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_init_t2_v2_loop_variant_2_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v3_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v3_loop_invariant_Partial_i_preserved : Valid [wp] [Qed] Goal typed_init_t2_v3_loop_invariant_Partial_i_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v3_loop_invariant_Range_i_preserved : Valid [wp] [Qed] Goal typed_init_t2_v3_loop_invariant_Range_i_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v3_loop_invariant_Partial_j_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v3_loop_invariant_Partial_j_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v3_loop_invariant_Range_j_preserved : Valid [wp] [Qed] Goal typed_init_t2_v3_loop_invariant_Range_j_established : Valid [wp] [Qed] Goal typed_init_t2_v3_assert_Last_j : Valid [wp] [Qed] Goal typed_init_t2_v3_assert_Last_i : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v3_loop_variant_decrease : Valid [wp] [Qed] Goal typed_init_t2_v3_loop_variant_positive : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v3_loop_variant_2_decrease : Valid [wp] [Qed] Goal typed_init_t2_v3_loop_variant_2_positive : Valid [wp] Proved goals: 91 / 91 Qed: 51 Alt-Ergo 2.0.0: 40 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_init.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_init.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success init 6 4 (52..64) 10 100% init_t1 6 4 (12..24) 10 100% init_t2_v1 9 8 (48..60) 17 100% init_t2_v2 9 8 (36..48) 17 100% init_t2_v3 7 8 (32..44) 15 100% init_t2_bis_v1 7 4 (176..224) 11 100% init_t2_bis_v2 7 4 (176..224) 11 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025535� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026600� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/17ffcbe3e6038146194ef1fdae892a6f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/17ffcbe3e0000666�0000000�0000000�00000000126�13571573400�030167� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.019, "steps": 19 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/1a6f29802546cccc3383f2f3b5d85520.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/1a6f298020000666�0000000�0000000�00000000127�13571573400�027665� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0254, "steps": 24 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/1e8cf3361abc3e40c7b69eaefb0bee8e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/1e8cf33610000666�0000000�0000000�00000000127�13571573400�027746� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0208, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/228d52b71b2541eaaa93dd42fe5db1d4.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/228d52b710000666�0000000�0000000�00000000126�13571573400�027662� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0107, "steps": 8 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/2e2f38c80c32abeeee80bd2772efd1c3.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/2e2f38c800000666�0000000�0000000�00000000127�13571573400�027747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0168, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/3257bc02a1b4c4c0a054c65060bbb397.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/3257bc02a0000666�0000000�0000000�00000000127�13571573400�027733� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0233, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/4188555c4f042616866d63828ff5b2e5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/4188555c40000666�0000000�0000000�00000000127�13571573400�027615� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0212, "steps": 36 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/47cd09489b3e50fba17f77b299ccaa12.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/47cd094890000666�0000000�0000000�00000000127�13571573400�027702� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0256, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/4843af752a0384e05880a83b28c17a62.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/4843af7520000666�0000000�0000000�00000000126�13571573400�027671� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0116, "steps": 8 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/4f26762cc8a7431a2d798305a934b0b7.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/4f26762cc0000666�0000000�0000000�00000000130�13571573400�027743� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.2135, "steps": 195 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/56fc7f213e10ad404cc0057de958a129.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/56fc7f2130000666�0000000�0000000�00000000127�13571573400�027751� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0184, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/5a23d2fe56c6d03db907785acbfa66b4.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/5a23d2fe50000666�0000000�0000000�00000000130�13571573400�030015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.2206, "steps": 193 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/5d2128c35440220613e84b0e3693ed94.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/5d2128c350000666�0000000�0000000�00000000127�13571573400�027663� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0243, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/5da1562233ff52d4105c487410aad5f2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/5da1562230000666�0000000�0000000�00000000127�13571573400�027657� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0187, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/6339633fc0069471c27d0dbc6e00f234.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/6339633fc0000666�0000000�0000000�00000000127�13571573400�027674� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0308, "steps": 35 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/63936350508172f3a502497159f09d1d.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/6393635050000666�0000000�0000000�00000000127�13571573400�027532� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0166, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/65aaa0d0a807cda430e0edb1b315a27e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/65aaa0d0a0000666�0000000�0000000�00000000127�13571573400�030065� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0123, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/6b66ec30e1510c30a4a50320f9ce8915.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/6b66ec30e0000666�0000000�0000000�00000000127�13571573400�030026� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0174, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/6cebd2665383563c8d6f79868895551a.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/6cebd26650000666�0000000�0000000�00000000127�13571573400�030031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0213, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/72307f01c14b926050adf0e387958166.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/72307f01c0000666�0000000�0000000�00000000127�13571573400�027657� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0245, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/72f3565cf594cefa13d49fa68fbc55a6.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/72f3565cf0000666�0000000�0000000�00000000127�13571573400�027755� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0119, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/759b4f86531e161fd97b974d6e254585.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/759b4f8650000666�0000000�0000000�00000000127�13571573400�027706� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0294, "steps": 36 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/7958e2d72644d464557344ca48f74b69.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/7958e2d720000666�0000000�0000000�00000000127�13571573400�027703� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0161, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/80f119c647a7d44e844fb264e7de715b.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/80f119c640000666�0000000�0000000�00000000127�13571573400�027670� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0163, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/82dd09e758b61ed5e37c805feee4b424.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/82dd09e750000666�0000000�0000000�00000000127�13571573400�027756� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0247, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/9300d7aafc1b4a8b042fbd06f29ca7f2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/9300d7aaf0000666�0000000�0000000�00000000127�13571573400�030021� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0214, "steps": 21 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/a8972f010edd0a69f963e59097a090c9.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/a8972f0100000666�0000000�0000000�00000000127�13571573400�027664� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0392, "steps": 54 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/a96c9d5e0977498703591925319a2fe2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/a96c9d5e00000666�0000000�0000000�00000000126�13571573400�030033� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.016, "steps": 15 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/ab9758d98109ead2b00b740b739cbea7.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/ab9758d980000666�0000000�0000000�00000000127�13571573400�027767� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0154, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/be587dbd7143b1c7ce2d0963783d63e6.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/be587dbd70000666�0000000�0000000�00000000125�13571573400�030114� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.04, "steps": 42 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/c3e01e58641965407c42021976235616.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/c3e01e5860000666�0000000�0000000�00000000127�13571573400�027746� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0278, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/cc6ae51c4577487698ea0ca6d031b200.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/cc6ae51c40000666�0000000�0000000�00000000127�13571573400�030101� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0274, "steps": 28 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/d4df5778b285c01494d5f780cbcbea22.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/d4df5778b0000666�0000000�0000000�00000000127�13571573400�030041� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0186, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/dc1be4b07122fbb25abc778b0dc17a78.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/dc1be4b070000666�0000000�0000000�00000000127�13571573400�030076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0167, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/e35aa9db4b874c1ab88a964e7bccd040.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/e35aa9db40000666�0000000�0000000�00000000127�13571573400�030104� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0249, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/ed2dbebf05c2807c5acdbe5c8e76f346.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/ed2dbebf00000666�0000000�0000000�00000000127�13571573400�030240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0319, "steps": 36 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/f98305c0ceedf164df38d274061bf4f8.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/f98305c0c0000666�0000000�0000000�00000000127�13571573400�027747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0443, "steps": 56 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/faa56ce35a5497aae0306357d671727c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/faa56ce350000666�0000000�0000000�00000000127�13571573400�030105� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0158, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/fd21a301bed246119d512f8722bebe30.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/fd21a301b0000666�0000000�0000000�00000000127�13571573400�030006� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0128, "steps": 13 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/fd87cc7cce7bb9d33ea6b15c17320c14.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.0.session/cache/fd87cc7cc0000666�0000000�0000000�00000000127�13571573400�030176� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0165, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.res.oracle�������������0000666�0000000�0000000�00000005023�13571573400�026033� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_init.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] [CFG] Goal init_exits : Valid (Unreachable) [wp] [CFG] Goal init_t1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v2_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v3_exits : Valid (Unreachable) [wp] Warning: Missing RTE guards [wp] 23 goals scheduled [wp] [Qed] Goal typed_init_t2_bis_v2_loop_assigns_part1 : Valid [wp] [Tactical] Goal typed_init_t2_bis_v2_loop_assigns_part2 : Valid [wp] [Tactical] Goal typed_init_t2_bis_v2_loop_assigns_part3 : Valid [wp] [Tactical] Goal typed_init_t2_bis_v2_assigns_exit_part1 : Valid [wp] [Tactical] Goal typed_init_t2_bis_v2_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_init_t2_bis_v2_assigns_exit_part3 : Valid [wp] [Tactical] Goal typed_init_t2_bis_v2_assigns_normal_part1 : Valid [wp] [Tactical] Goal typed_init_t2_bis_v2_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_init_t2_v2_loop_assigns_part1 : Valid [wp] [Tactical] Goal typed_init_t2_v2_loop_assigns_part2 : Valid [wp] [Tactical] Goal typed_init_t2_v2_loop_assigns_part3 : Valid [wp] [Qed] Goal typed_init_t2_v2_loop_assigns_2_part1 : Valid [wp] [Tactical] Goal typed_init_t2_v2_loop_assigns_2_part2 : Valid [wp] [Tactical] Goal typed_init_t2_v2_loop_assigns_2_part3 : Valid [wp] [Tactical] Goal typed_init_t2_v2_assigns_part1 : Valid [wp] [Tactical] Goal typed_init_t2_v2_assigns_part2 : Valid [wp] [Qed] Goal typed_init_t2_v3_loop_assigns_part1 : Valid [wp] [Tactical] Goal typed_init_t2_v3_loop_assigns_part2 : Valid [wp] [Tactical] Goal typed_init_t2_v3_loop_assigns_part3 : Valid [wp] [Qed] Goal typed_init_t2_v3_loop_assigns_2_part1 : Valid [wp] [Tactical] Goal typed_init_t2_v3_loop_assigns_2_part2 : Valid [wp] [Tactical] Goal typed_init_t2_v3_assigns_part1 : Valid [wp] [Tactical] Goal typed_init_t2_v3_assigns_part2 : Valid [wp] Proved goals: 23 / 23 Qed: 11 Script: 12 Alt-Ergo 2.0.0: 0 (unsuccess: 12) [wp] Report in: 'tests/wp_typed/oracle_qualif/user_init.1.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_init.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success init_t2_v2 3 - (20..32) 8 100% init_t2_v3 4 - (20..32) 7 100% init_t2_bis_v2 4 - (24..36) 8 100% ------------------------------------------------------------- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/���������������0000777�0000000�0000000�00000000000�13571573400�025536� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026601� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/057dadfe08269b073b5fdb3f99f0cf54.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/057dadfe00000666�0000000�0000000�00000000127�13571573400�030103� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0194, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/0c3b278c42bf147df2e97f708aad39c7.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/0c3b278c40000666�0000000�0000000�00000000126�13571573400�027742� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.015, "steps": 18 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/158fd2c31ad9f3fb8884cdb74df5281d.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/158fd2c310000666�0000000�0000000�00000000107�13571573400�027742� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/1980519d8a76496098382d14d534dadf.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/1980519d80000666�0000000�0000000�00000000127�13571573400�027620� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0122, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/1da9df6b30b87e2c91aec83169ce811f.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/1da9df6b30000666�0000000�0000000�00000000107�13571573400�030105� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/1f309a1d5a32893ca637697bc07011bc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/1f309a1d50000666�0000000�0000000�00000000127�13571573400�027741� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0214, "steps": 24 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/224a90add7284f0760379d53a02297d5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/224a90add0000666�0000000�0000000�00000000072�13571573400�030015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/2b41b08d1284872f477fb2388e8800eb.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/2b41b08d10000666�0000000�0000000�00000000126�13571573400�027732� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.021, "steps": 21 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/2f1f28ca445ed465b0ae929f90868b82.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/2f1f28ca40000666�0000000�0000000�00000000107�13571573400�030022� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/5a0077053c40e3064cc4d801008327cf.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/5a00770530000666�0000000�0000000�00000000127�13571573400�027577� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0209, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/6d3a184c57d19bf5bec185cdd9a32977.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/6d3a184c50000666�0000000�0000000�00000000127�13571573400�027746� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0188, "steps": 12 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/83c1ab76624d77e68e878b15ed852b50.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/83c1ab7660000666�0000000�0000000�00000000127�13571573400�027750� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0101, "steps": 11 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/856ef6dc0590c047b1d3652564226902.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/856ef6dc00000666�0000000�0000000�00000000107�13571573400�030034� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/95cc8276bbb11044a4e3b015c9ee9b87.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/95cc8276b0000666�0000000�0000000�00000000127�13571573400�027760� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0244, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/96284b720d44be9937917112595ce737.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/96284b7200000666�0000000�0000000�00000000127�13571573400�027613� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0279, "steps": 28 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/999ef60012010d43899a9a6ec6b500fc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/999ef60010000666�0000000�0000000�00000000127�13571573400�027700� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0184, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/9dd4bd5439992f8110255fc40cb80f3c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/9dd4bd5430000666�0000000�0000000�00000000127�13571573400�030032� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0136, "steps": 23 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/9e42bdda7b75ea04a21390c1cd79e94e.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/9e42bdda70000666�0000000�0000000�00000000126�13571573400�030110� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0099, "steps": 9 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/9f720bd2b7cbd3d3b6184708001e37f5.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/9f720bd2b0000666�0000000�0000000�00000000127�13571573400�030025� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0203, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/a899e157a4902c73770f124eeb3cd657.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/a899e157a0000666�0000000�0000000�00000000107�13571573400�027757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/b05e910de5694eeeeb4ee951e4aed6dc.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/b05e910de0000666�0000000�0000000�00000000127�13571573400�030022� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0256, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/ba3dea951634b8bd7a5ca1f8baaa7eb0.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/ba3dea9510000666�0000000�0000000�00000000127�13571573400�030102� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0216, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/bff645c52a42a68ca1b84c1494fd1b13.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/bff645c520000666�0000000�0000000�00000000072�13571573400�030031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/d3665f048a98e8dab4915d8a84bd23b2.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/d3665f0480000666�0000000�0000000�00000000107�13571573400�027673� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/e492dc27edeac355abd81970ee07192c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/e492dc27e0000666�0000000�0000000�00000000127�13571573400�030034� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0143, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/e7d62ff8b93e37d744c6408bed5962da.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/e7d62ff8b0000666�0000000�0000000�00000000107�13571573400�030117� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/ed30e9104b38b725fca6f73bf271db4d.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.1.session/cache/ed30e91040000666�0000000�0000000�00000000127�13571573400�027742� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0235, "steps": 27 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.res.oracle�������������0000666�0000000�0000000�00000004142�13571573400�026035� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-steps 300 [...] [kernel] Parsing tests/wp_typed/user_init.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] [CFG] Goal init_exits : Valid (Unreachable) [wp] [CFG] Goal init_t1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v1_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v2_exits : Valid (Unreachable) [wp] [CFG] Goal init_t2_v3_exits : Valid (Unreachable) [wp] Warning: Missing RTE guards [wp] 16 goals scheduled [wp] [Qed] Goal typed_init_t2_bis_v1_loop_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v1_loop_assigns_part2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v1_loop_assigns_part3 : Unsuccess [wp] [Qed] Goal typed_init_t2_bis_v1_assigns_exit_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v1_assigns_exit_part2 : Unsuccess [wp] [Qed] Goal typed_init_t2_bis_v1_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_init_t2_bis_v1_assigns_normal_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_bis_v1_assigns_normal_part2 : Unsuccess [wp] [Qed] Goal typed_init_t2_v1_loop_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_assigns_part2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_assigns_part3 : Unsuccess [wp] [Qed] Goal typed_init_t2_v1_loop_assigns_2_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_assigns_2_part2 : Unsuccess [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_loop_assigns_2_part3 : Unsuccess [wp] [Qed] Goal typed_init_t2_v1_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_t2_v1_assigns_part2 : Unsuccess [wp] Proved goals: 7 / 16 Qed: 7 Alt-Ergo 2.0.0: 0 (unsuccess: 9) [wp] Report in: 'tests/wp_typed/oracle_qualif/user_init.2.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_init.2.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success init_t2_v1 3 - 8 37.5% init_t2_bis_v1 4 - 8 50.0% ------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/���������������0000777�0000000�0000000�00000000000�13571573400�025537� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026602� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/0100435d7eb5d5f3110823d4de973a7c.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/0100435d70000666�0000000�0000000�00000000107�13571573400�027572� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/0f79a147b89c832850e713eac0d64ca3.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/0f79a147b0000666�0000000�0000000�00000000110�13571573400�027741� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 300 } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/158946c941f7cb0d7f4adad7b651c5a9.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/158946c940000666�0000000�0000000�00000000110�13571573400�027615� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "stepout", "steps": 300 } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/17ca2e9a9e791668d493c5c26273b252.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/17ca2e9a90000666�0000000�0000000�00000000072�13571573400�030031� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/557f9df490c1ca5f511f15e95f2409d4.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/557f9df490000666�0000000�0000000�00000000107�13571573400�027771� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/caeaed7ca3a14a3a5355de6317aff0cd.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/caeaed7ca0000666�0000000�0000000�00000000072�13571573400�030321� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "unknown" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/d4d47565b23f563ed61355cca7c19925.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.2.session/cache/d4d47565b0000666�0000000�0000000�00000000107�13571573400�027753� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "timeout", "time": 10. } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.i.0.report.json����������0000666�0000000�0000000�00000046724�13571573400�026524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 27, "valid": 16, "unknown": 11, "rank": 19 }, "qed": { "total": 27, "valid": 27 }, "wp:main": { "total": 54, "valid": 43, "unknown": 11, "rank": 19 } }, "wp:functions": { "init": { "init_loop_invariant_Partial": { "alt-ergo": { "total": 1, "valid": 1, "rank": 9 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 9 } }, "init_loop_invariant_Range": { "alt-ergo": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "init_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_loop_assigns": { "alt-ergo": { "total": 1, "valid": 1, "rank": 19 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 19 } }, "init_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 7 }, "wp:main": { "total": 1, "valid": 1, "rank": 7 } }, "wp:section": { "alt-ergo": { "total": 4, "valid": 4, "rank": 19 }, "qed": { "total": 4, "valid": 4 }, "wp:main": { "total": 8, "valid": 8, "rank": 19 } } }, "init_t1": { "init_t1_loop_invariant_Partial": { "alt-ergo": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "init_t1_loop_invariant_Range": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 2 } }, "init_t1_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "init_t1_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t1_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "alt-ergo": { "total": 3, "valid": 3, "rank": 4 }, "qed": { "total": 5, "valid": 5 }, "wp:main": { "total": 8, "valid": 8, "rank": 4 } } }, "init_t2": { "init_t2_assert_i": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t2_assert_j": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t2_loop_invariant_Previous_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 5 } }, "init_t2_loop_invariant_Partial_j": { "alt-ergo": { "total": 1, "valid": 1, "rank": 8 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "init_t2_loop_invariant_Range_j": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } }, "init_t2_loop_invariant_Partial_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 11 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 11 } }, "init_t2_loop_invariant_Range_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 2 } }, "init_t2_assigns": { "alt-ergo": { "total": 1, "unknown": 1 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 1, "unknown": 1 } }, "init_t2_loop_assigns_2": { "alt-ergo": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } }, "init_t2_loop_assigns": { "alt-ergo": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } }, "init_t2_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 2 }, "wp:main": { "total": 1, "valid": 1, "rank": 2 } }, "wp:section": { "alt-ergo": { "total": 11, "valid": 6, "unknown": 5, "rank": 11 }, "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 21, "valid": 16, "unknown": 5, "rank": 11 } } }, "init_t2_bis": { "init_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t2_bis_assert_i": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "init_t2_bis_loop_invariant_Partial_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 10 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 10 } }, "init_t2_bis_loop_invariant_Range_i": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } }, "init_t2_bis_assigns": { "alt-ergo": { "total": 3, "unknown": 3 }, "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 5, "valid": 2, "unknown": 3 } }, "init_t2_bis_loop_assigns": { "alt-ergo": { "total": 2, "unknown": 2 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 3, "valid": 1, "unknown": 2 } }, "init_t2_bis_exits": { "alt-ergo": { "total": 1, "unknown": 1 }, "wp:main": { "total": 1, "unknown": 1 } }, "init_t2_bis_ensures": { "alt-ergo": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "alt-ergo": { "total": 9, "valid": 3, "unknown": 6, "rank": 10 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 17, "valid": 11, "unknown": 6, "rank": 10 } } } } } ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_init.res.oracle���������������0000666�0000000�0000000�00000002132�13571573400�025672� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-timeout 45 -wp-steps 1500 [...] [kernel] Parsing tests/wp_typed/user_init.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 8 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_init_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_Partial_preserved : Valid [wp] [Qed] Goal typed_init_loop_invariant_Partial_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_invariant_Range_preserved : Valid [wp] [Qed] Goal typed_init_loop_invariant_Range_established : Valid [wp] [Qed] Goal typed_init_loop_assigns_part1 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_init_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_init_assigns : Valid [wp] Proved goals: 8 / 8 Qed: 4 Alt-Ergo 2.0.0: 4 [wp] Report 'tests/wp_typed/user_init.i.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success init 4 4 (48..60) 8 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_injector.0.res.oracle���������0000666�0000000�0000000�00000003601�13571573400�026704� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_injector.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 20 goals scheduled [wp] [Qed] Goal typed_job_ensures_SEQ : Valid [wp] [Qed] Goal typed_job_ensures_ID1 : Valid [wp] [Qed] Goal typed_job_ensures_ID2 : Valid [wp] [Qed] Goal typed_job_ensures_R1 : Valid [wp] [Qed] Goal typed_job_ensures_R2 : Valid [wp] [Qed] Goal typed_job_ensures_R0 : Valid [wp] [Qed] Goal typed_job_ensures_E1 : Valid [wp] [Qed] Goal typed_job_ensures_E2 : Valid [wp] [Qed] Goal typed_job_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_job_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_job_assigns_exit_part3 : Valid [wp] [Qed] Goal typed_job_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_job_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_job_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_job_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_job_assigns_normal_part5 : Valid [wp] [Qed] Goal typed_job_assigns_normal_part6 : Valid [wp] [Qed] Goal typed_job_assigns_normal_part7 : Valid [wp] [Qed] Goal typed_job_assigns_normal_part8 : Valid [wp] [Qed] Goal typed_job_assigns_normal_part9 : Valid [wp] Proved goals: 20 / 20 Qed: 20 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_injector.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_injector.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 20 - 20 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'job': /*@ behavior typed: requires \separated(\union(&seq,&service_cpt,service_id+(..), service_result+(..)),error); */ int job(int a, int b, int *error); �������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_injector.1.res.oracle���������0000666�0000000�0000000�00000003425�13571573400�026711� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_injector.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 16 goals scheduled [wp] [Qed] Goal typed_ref_job_ensures_SEQ : Valid [wp] [Qed] Goal typed_ref_job_ensures_ID1 : Valid [wp] [Qed] Goal typed_ref_job_ensures_ID2 : Valid [wp] [Qed] Goal typed_ref_job_ensures_R1 : Valid [wp] [Qed] Goal typed_ref_job_ensures_R2 : Valid [wp] [Qed] Goal typed_ref_job_ensures_R0 : Valid [wp] [Qed] Goal typed_ref_job_ensures_E1 : Valid [wp] [Qed] Goal typed_ref_job_ensures_E2 : Valid [wp] [Qed] Goal typed_ref_job_assigns_exit_part1 : Valid [wp] [Qed] Goal typed_ref_job_assigns_exit_part2 : Valid [wp] [Qed] Goal typed_ref_job_assigns_normal_part1 : Valid [wp] [Qed] Goal typed_ref_job_assigns_normal_part2 : Valid [wp] [Qed] Goal typed_ref_job_assigns_normal_part3 : Valid [wp] [Qed] Goal typed_ref_job_assigns_normal_part4 : Valid [wp] [Qed] Goal typed_ref_job_assigns_normal_part5 : Valid [wp] [Qed] Goal typed_ref_job_assigns_normal_part6 : Valid [wp] Proved goals: 16 / 16 Qed: 16 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_injector.1.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_injector.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 16 - 16 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'job': /*@ behavior typed_ref: requires \separated(error, \union(&seq,&service_cpt,service_id+(..),service_result+(..))); requires \valid(error); */ int job(int a, int b, int *error); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_injector.i.0.report.json������0000666�0000000�0000000�00000005753�13571573400�027373� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 20, "valid": 20 }, "wp:main": { "total": 20, "valid": 20 } }, "wp:functions": { "job": { "job_assigns": { "qed": { "total": 12, "valid": 12 }, "wp:main": { "total": 12, "valid": 12 } }, "job_ensures_E2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_E1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_R0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_R2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_R1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_ID2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_ID1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_SEQ": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 20, "valid": 20 }, "wp:main": { "total": 20, "valid": 20 } } } } } ���������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_injector.i.1.report.json������0000666�0000000�0000000�00000005747�13571573400�027377� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 16, "valid": 16 }, "wp:main": { "total": 16, "valid": 16 } }, "wp:functions": { "job": { "job_assigns": { "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 8, "valid": 8 } }, "job_ensures_E2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_E1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_R0": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_R2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_R1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_ID2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_ID1": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_SEQ": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 16, "valid": 16 }, "wp:main": { "total": 16, "valid": 16 } } } } } �������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/����������������0000777�0000000�0000000�00000000000�13571573400�025343� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/����������0000777�0000000�0000000�00000000000�13571573400�026406� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/207326109c96065385229899bf6e8c06.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/207326109c0000666�0000000�0000000�00000000127�13571573400�027471� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0173, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/5016883671521c9b689c126ca9d08888.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/50168836710000666�0000000�0000000�00000000127�13571573400�027425� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0159, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/55046db71906c1c748d41dbb0ca37184.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/55046db7190000666�0000000�0000000�00000000127�13571573400�027563� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0183, "steps": 15 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/6015a9ab731f106ae004ce0d86d123ef.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/6015a9ab730000666�0000000�0000000�00000000127�13571573400�027633� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0185, "steps": 24 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/618c7efb305ce296bbbe05979547f4fa.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/618c7efb300000666�0000000�0000000�00000000127�13571573400�027721� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0185, "steps": 19 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/792e50cc7d21272b1e7001dd6c4dcd38.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/792e50cc7d0000666�0000000�0000000�00000000124�13571573400�027722� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.01, "steps": 7 } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/7e9ea7a08d3ac877fda2e5a31a718b6e.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/7e9ea7a08d0000666�0000000�0000000�00000000127�13571573400�030007� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.2956, "steps": 71 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/939f4f5607ea882e81415960715edb2b.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/939f4f56070000666�0000000�0000000�00000000127�13571573400�027577� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0162, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/aa84c6434886d4c88317bf14f38e87a7.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/aa84c643480000666�0000000�0000000�00000000127�13571573400�027642� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0151, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/b5f39dd55d1fe0185583a4d7f9432e90.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/b5f39dd55d0000666�0000000�0000000�00000000127�13571573400�030007� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0975, "steps": 61 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/c0abf618f311dc2132c4f217858f5dc4.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/c0abf618f30000666�0000000�0000000�00000000127�13571573400�027774� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0152, "steps": 10 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/c316400f931e0d4c6b9c98c176caf5ba.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/c316400f930000666�0000000�0000000�00000000126�13571573400�027552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.016, "steps": 10 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/d3b49ce61e9215ada7a98791ca384dae.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/d3b49ce61e0000666�0000000�0000000�00000000126�13571573400�030001� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0144, "steps": 8 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000200�00000000000�007763� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/ea71a5e55707a127b54654938f0eb56f.json�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.0.session/cache/ea71a5e5570000666�0000000�0000000�00000000127�13571573400�027722� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0164, "steps": 16 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.i.0.report.json�����������0000666�0000000�0000000�00000016207�13571573400�026323� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 15, "valid": 15, "rank": 17 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 18, "valid": 18, "rank": 16 } }, "wp:functions": { "F1": { "F1_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "F1_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 3 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } }, "F1_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "F1_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "wp:main": { "total": 1, "valid": 1, "rank": 3 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 3 } } }, "F2": { "F2_loop_invariant_PART": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 6 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "F2_loop_invariant_RANGE": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "F2_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "F2_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 5 } } }, "F4": { "F4_loop_invariant_NEVER": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 17 }, "wp:main": { "total": 2, "valid": 2, "rank": 17 } }, "F4_loop_invariant_RANGE": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 4 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "F4_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "F4_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 15 }, "wp:main": { "total": 1, "valid": 1, "rank": 15 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 17 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 6, "valid": 6, "rank": 16 } } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_rec.res.oracle����������������0000666�0000000�0000000�00000003652�13571573400�025510� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_rec.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 18 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_F1_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F1_loop_invariant_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F1_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F1_loop_invariant_2_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F1_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_F1_loop_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F2_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F2_loop_invariant_PART_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F2_loop_invariant_PART_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F2_loop_invariant_RANGE_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F2_loop_invariant_RANGE_established : Valid [wp] [Qed] Goal typed_F2_loop_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F4_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F4_loop_invariant_NEVER_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F4_loop_invariant_NEVER_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F4_loop_invariant_RANGE_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_F4_loop_invariant_RANGE_established : Valid [wp] [Qed] Goal typed_F4_loop_assigns : Valid [wp] Proved goals: 18 / 18 Qed: 3 Alt-Ergo 2.0.0: 15 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_rec.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_rec.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success F1 1 5 (12..24) 6 100% F2 1 5 (20..32) 6 100% F4 1 5 (64..88) 6 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.report.json����������0000666�0000000�0000000�00000011634�13571573400�026630� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 24 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 13, "valid": 13, "rank": 24 } }, "wp:functions": { "strlen": { "strlen_assert_END": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 24 }, "wp:main": { "total": 1, "valid": 1, "rank": 24 } }, "strlen_loop_invariant_ZERO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "strlen_loop_invariant_RANGE": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 14 }, "wp:main": { "total": 2, "valid": 2, "rank": 14 } }, "strlen_loop_invariant_BASE": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "strlen_loop_variant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 12 } }, "strlen_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "strlen_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "strlen_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 24 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 13, "valid": 13, "rank": 24 } } } } } ����������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/�������������0000777�0000000�0000000�00000000000�13571573400�026100� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/�������0000777�0000000�0000000�00000000000�13571573400�027143� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/318af641ec03fdd0322dd08dccac35c4.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/318af640000666�0000000�0000000�00000000127�13571573400�030062� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0278, "steps": 46 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/47a0c213ac046fed137967f11715854c.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/47a0c210000666�0000000�0000000�00000000127�13571573400�030047� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0335, "steps": 49 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/4b07f4b8b92a2f5950e483bd650d046b.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/4b07f4b0000666�0000000�0000000�00000000130�13571573400�030130� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0718, "steps": 128 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/d5d8241a0f94158a0f4c457ef4668e89.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/d5d82410000666�0000000�0000000�00000000127�13571573400�030061� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0435, "steps": 58 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000203�00000000000�007766� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/d78a3cf05e7f40c234f06683281536ab.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.0.session/cache/d78a3cf0000666�0000000�0000000�00000000127�13571573400�030225� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0289, "steps": 34 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.i.0.report.json��������0000666�0000000�0000000�00000011634�13571573400�027057� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 24 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 13, "valid": 13, "rank": 24 } }, "wp:functions": { "strlen": { "strlen_assert_END": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 24 }, "wp:main": { "total": 1, "valid": 1, "rank": 24 } }, "strlen_loop_invariant_ZERO": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 8 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 8 } }, "strlen_loop_invariant_RANGE": { "why3:Alt-Ergo,2.0.0": { "total": 2, "valid": 2, "rank": 14 }, "wp:main": { "total": 2, "valid": 2, "rank": 14 } }, "strlen_loop_invariant_BASE": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "strlen_loop_variant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 12 } }, "strlen_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "strlen_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "strlen_ensures": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 24 }, "qed": { "total": 8, "valid": 8 }, "wp:main": { "total": 13, "valid": 13, "rank": 24 } } } } } ����������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_string.res.oracle�������������0000666�0000000�0000000�00000002733�13571573400�026244� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_string.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 13 goals scheduled [wp] [Qed] Goal typed_strlen_ensures : Valid [wp] [Qed] Goal typed_strlen_loop_invariant_BASE_preserved : Valid [wp] [Qed] Goal typed_strlen_loop_invariant_BASE_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_strlen_loop_invariant_RANGE_preserved : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_strlen_loop_invariant_RANGE_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_strlen_loop_invariant_ZERO_preserved : Valid [wp] [Qed] Goal typed_strlen_loop_invariant_ZERO_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_strlen_assert_END : Valid [wp] [Qed] Goal typed_strlen_loop_assigns : Valid [wp] [Qed] Goal typed_strlen_assigns_part1 : Valid [wp] [Qed] Goal typed_strlen_assigns_part2 : Valid [wp] [Qed] Goal typed_strlen_loop_variant_decrease : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_strlen_loop_variant_positive : Valid [wp] Proved goals: 13 / 13 Qed: 8 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_string.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_string.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success strlen 8 5 (120..144) 13 100% ------------------------------------------------------------- �������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_swap.0.res.oracle�������������0000666�0000000�0000000�00000002060�13571573400�026037� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_typed/user_swap.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 7 goals scheduled [wp] [Qed] Goal typed_main_assert : Valid [wp] [Qed] Goal typed_main_call_swap_requires : Valid [wp] [Qed] Goal typed_main_call_swap_requires_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_swap_ensures_A : Valid [wp] [Qed] Goal typed_swap_ensures_B : Valid [wp] [Qed] Goal typed_swap_assigns_part1 : Valid [wp] [Qed] Goal typed_swap_assigns_part2 : Valid [wp] Proved goals: 7 / 7 Qed: 6 Alt-Ergo 2.0.0: 1 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_swap.0.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_swap.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success swap 3 1 (12..24) 4 100% main 3 - 3 100% ------------------------------------------------------------- ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_swap.0.session/���������������0000777�0000000�0000000�00000000000�13571573400�025544� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_swap.0.session/cache/���������0000777�0000000�0000000�00000000000�13571573400�026607� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000201�00000000000�007764� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_swap.0.session/cache/f04b8466b45644e5c7e745a6d56137ca.json������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_swap.0.session/cache/f04b8466b0000666�0000000�0000000�00000000127�13571573400�027757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0222, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_swap.1.res.oracle�������������0000666�0000000�0000000�00000002324�13571573400�026043� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_typed/user_swap.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 6 goals scheduled [wp] [Qed] Goal typed_ref_main_assert : Valid [wp] [Qed] Goal typed_ref_main_call_swap_requires : Valid [wp] [Qed] Goal typed_ref_main_call_swap_requires_2 : Valid [wp] [Qed] Goal typed_ref_swap_ensures_A : Valid [wp] [Qed] Goal typed_ref_swap_ensures_B : Valid [wp] [Qed] Goal typed_ref_swap_assigns : Valid [wp] Proved goals: 6 / 6 Qed: 6 [wp] Report in: 'tests/wp_typed/oracle_qualif/user_swap.1.report.json' [wp] Report out: 'tests/wp_typed/result_qualif/user_swap.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success swap 3 - 3 100% main 3 - 3 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'swap': /*@ behavior typed_ref: requires \separated(a,b); requires \valid(a); requires \valid(b); */ void swap(int *a, int *b); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_swap.i.0.report.json����������0000666�0000000�0000000�00000005625�13571573400�026526� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 7, "valid": 7, "rank": 5 } }, "wp:functions": { "swap": { "swap_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "swap_ensures_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_ensures_A": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 5 } } }, "main": { "swap_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } �����������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/oracle_qualif/user_swap.i.1.report.json����������0000666�0000000�0000000�00000004621�13571573400�026522� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 6, "valid": 6 } }, "wp:functions": { "swap": { "swap_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_ensures_B": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_ensures_A": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } }, "main": { "swap_requires_2": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "swap_requires": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "main_assert": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } } } } } ���������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/shift_lemma.i������������������������������������0000666�0000000�0000000�00000000712�13571573400�021550� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct t { int b; int c; }; struct s { int d; struct t u[10]; int e; }; /*@ predicate inv{L}(struct s *p) = p->d == 0 && p->e == 0 && \forall int i; 0 <= i < 10 ==> p->u[i].c == 0; @*/ /*@ requires inv(p); @*/ void f(struct s *p){ /*@ assert p->d == 0; @*/ /*@ assert \forall int i; 0 <= i < 10 ==> p->u[i].c == 0; @*/ /*@ assert p->u[0].c == 0; @*/ /*@ assert p->u[1].c == 0; @*/ /*@ assert p->e == 0; @*/ } ������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/struct_array_type.i������������������������������0000666�0000000�0000000�00000000706�13571573400�023046� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-msg-key print-generated -wp-prover why3 -wp-gen */ typedef unsigned int size_t; struct s { int a[10]; int b[10]; }; struct s t[10]; /*@ requires 0 <= SynchroId < 10; ensures \result > t[SynchroId].b[0]; @*/ int f(size_t const SynchroId){ if( t[SynchroId].a[0] > t[SynchroId].b[0]){ return 2*t[SynchroId].a[0] - t[SynchroId].b[0] + 1; } else { return 2*t[SynchroId].b[0] - t[SynchroId].a[0] + 1; } } ����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/test_config��������������������������������������0000666�0000000�0000000�00000000031�13571573400�021327� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������OPT: OPT: -wp-model +ref �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_alloc.i�������������������������������������0000666�0000000�0000000�00000000734�13571573400�021415� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: OPT: -wp-model +ref */ /* run.config_qualif OPT: OPT: -wp-model +ref */ int z ; int *p ; void job (int x) { //@ assert \valid(&x) ; { int y ; int z ; p = &y ; y = 4 ; //@ assert \valid(p) ; //@ assert \valid(&z) ; } //@ assert !\valid(p) ; } //@ assigns \nothing ; int f(int x) { return x; } //@ assigns \nothing ; int g(int x) { x++; return x; } //@ ensures !\valid(\result) ; int * h(int x) { return &x; } ������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_bitwise.c�����������������������������������0000666�0000000�0000000�00000011401�13571573400�021754� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: */ /* run.config_qualif OPT: -wp-prop="-ko" OPT: -wp-prop="ko" */ #include "unit_bitwise.h" //=============================================== //-- int //=============================================== /*@ ensures ok: \result == (a & b); */ int band_int(int a,int b) { //@ assert ok: (a & 172) <= 281 ; //@ assert ko: (a & 281) <= 172 ; return a & b ; } /*@ ensures ok: \result == (a | b); */ int bor_int(int a,int b) { return a | b ; } /*@ ensures ok: \result == (a ^ b); */ int bxor_int(int a,int b) { return a ^ b ; } /*@ ensures ok: \result == (~a) ; */ int bnot_int(int a) { return ~a ; } /*@ ensures ok: \result == (int) (a << n) ; */ int lshift_int(int a,int n) { return a << n ; } /*@ ensures ok: \result == (a >> n) ; */ int rshift_int(int a,int n) { return a >> n ; } //=============================================== //-- unsigned int //=============================================== typedef unsigned int uint; void band1_uint(uint a) { uint b = a & 1; //@ assert ok: b == 0 || b == 1; //@ assert ok: 0 <= b <= 1; } /*@ ensures ok: \result == (a & b); */ uint band_uint(uint a,uint b) { return a & b ; } /*@ ensures ok: \result == (a | b); */ uint bor_uint(uint a,uint b) { return a | b ; } /*@ ensures ok: \result == (uint)(a ^ b); ensures ok: \result == (a ^ b); */ uint bxor_uint(uint a,uint b) { return a ^ b ; } /*@ ensures ok: \result == (uint)(~a) ; ensures ko: \result == (~a) ; */ uint bnot_uint(uint a) { return ~a ; } /*@ ensures ok: \result == (uint) (a << n) ; */ uint lshift_uint(uint a,uint n) { return a << n ; } /*@ ensures ok: \result == (a >> n) ; */ uint rshift_uint(uint a,uint n) { return a >> n ; } //=============================================== //-- char //=============================================== /*@ ensures ok: \result == (a & b); */ char band_char(char a,char b) { return a & b ; } /*@ ensures ok: \result == (a | b); */ char bor_char(char a,char b) { return a | b ; } /*@ ensures ok: \result == (a ^ b); */ char bxor_char(char a,char b) { return a ^ b ; } /*@ ensures ok: \result == (~a) ; */ char bnot_char(char a) { return ~a ; } /*@ ensures ok: \result == (char) (a << n) ; */ char lshift_char(char a,char n) { return a << n ; } /*@ ensures ok: \result == (char) (a >> n) ; */ char rshift_char(char a,char n) { return a >> n ; } //=============================================== //-- unsigned char //=============================================== typedef unsigned char uchar; void band1_uchar(uchar a) { uchar b = a & 1; //@ assert ok: b == 0 || b == 1; //@ assert ok: 0 <= b <= 1; } /*@ ensures ok: \result == (a & b); */ uchar band_uchar(uchar a,uchar b) { return a & b ; } /*@ ensures ok: \result == (a | b); */ uchar bor_uchar(uchar a,uchar b) { return a | b ; } /*@ ensures ok: \result == (uchar)(a ^ b); ensures ok: \result == (a ^ b); */ uchar bxor_uchar(uchar a,uchar b) { return a ^ b ; } /*@ ensures ok: \result == (uchar)(~a) ; ensures ko: \result == (~a) ; */ uchar bnot_uchar(uchar a) { return ~a ; } /*@ ensures ok: \result == (uchar) (a << n) ; */ uchar lshift_uchar(uchar a,uchar n) { return a << n ; } /*@ ensures ok: \result == (a >> n) ; */ uchar rshift_uchar(uchar a,uchar n) { return a >> n ; } //=============================================== //-- Logic //=============================================== /*@ lemma land_assoc: \forall integer a,b,c; (a & (b & c)) == ((a & b) & c) ; @ lemma land_com: \forall integer a,b; (a & b) == (b & a) ; @ lemma land_abs: \forall integer a; (a & 0) == 0 ; @ lemma land_stb: \forall integer a; (a & a) == a ; @ lemma lor_assoc: \forall integer a,b,c; (a | (b | c)) == ((a | b) | c) ; @ lemma lor_com: \forall integer a,b; (a | b) == (b | a) ; @ lemma lor_neu: \forall integer a; (a | 0) == a ; @ lemma lor_stb: \forall integer a; (a | a) == a ; @ lemma lxor_assoc: \forall integer a,b,c; (a ^ (b ^ c)) == ((a ^ b) ^ c) ; @ lemma lxor_com: \forall integer a,b; (a ^ b) == (b ^ a) ; */ //=============================================== void band1_ushort(unsigned short a) { unsigned short b = a & 1; //@ assert ok: b == 0 || b == 1; //@ assert ok: 0 <= b <= 1; } void band1_ulong(unsigned long a) { unsigned long b = a & 1; //@ assert ok: b == 0 || b == 1; //@ assert ok: 0 <= b <= 1; } /*@ ensures ok: \result == c ; */ uchar cast(uchar c,uint i,long long j) { //@ assert ok: ((uint)((int) i)) == i ; //@ assert ok: ((int)((uint) i)) == (int)i ; //@ assert ok: ((uchar)((int) i)) == (uchar)i ; //@ assert ok: ((int)((uchar) c)) == (uchar)c ; //@ assert ok: ((int)((char) c)) == (char)c ; //@ assert ok: ((uint)((uchar) c)) == (uchar)c ; //@ assert ok: ((uint)(j & 3)) == (j & 3) ; //@ assert ko: ((uint)((char) c)) == (char)c ; return (uint) c ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_bitwise.h�����������������������������������0000666�0000000�0000000�00000002437�13571573400�021772� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ axiomatic bits { logic integer c2fc4_lbtest (integer x, integer n) ; predicate c2fc4_btest (integer x, integer n) = c2fc4_lbtest (x, n) != 0; axiom btest_bnot: \forall integer x,n ; n>0 ==> ((TRIGGER:c2fc4_btest(~x,n)) <==> !c2fc4_btest(x,n)); axiom btest_bxor: \forall integer x,y,n ; n>0 ==> ((TRIGGER:c2fc4_btest(x^y,n)) <==> ((c2fc4_btest(x,n) ^^ c2fc4_btest(y,n)))); axiom btest_bor: \forall integer x,y,n ; n>0 ==> ((TRIGGER:c2fc4_btest(x|y,n)) <==> ((c2fc4_btest(x,n) || c2fc4_btest(y,n)))); axiom btest_band: \forall integer x,y,n ; n>0 ==> ((TRIGGER:c2fc4_btest(x&y,n)) <==> ((c2fc4_btest(x,n) && c2fc4_btest(y,n)))); } lemma bnot_sint8: \forall signed char x ; (~x) == (signed char)(~x); lemma bxor_sint8: \forall signed char x,y ; (x ^ y) == (signed char)(x ^ y); lemma bor_sint8: \forall signed char x,y ; (x | y) == (signed char)(x | y); lemma band_sint8: \forall signed char x,y ; (x & y) == (signed char)(x & y); lemma blsr_sint8: \forall signed char x,y ; y >= 0 ==> (x >> y) == (signed char)(x >> y); lemma bor_uint8: \forall unsigned char x,y ; (x | y) == (unsigned char)(x | y); lemma band_uint8: \forall unsigned char x,y ; (x & y) == (unsigned char)(x & y); lemma blsr_uint8: \forall unsigned char x,y ; y >= 0 ==> (x >> y) == (unsigned char)(x >> y); */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_call.i��������������������������������������0000666�0000000�0000000�00000000317�13571573400�021233� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ ensures ( x==1 ==> \result < 0) ; ensures ( x==2 ==> \result > 0) ; */ int f(int x) ; void job(void) { int r ; r = f(1); L1: r = f(2); L2: //@ assert \at(r,L1) != \at(r,L2); return ; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_cast.i��������������������������������������0000666�0000000�0000000�00000000174�13571573400�021253� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// assigns p[-128..127] ; void f(int *p,int *v) { char k = *((char *) v ) ; /*@ assert OUT: k < 256 ; */ p[k] = 1 ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_cst.i���������������������������������������0000666�0000000�0000000�00000000321�13571573400�021104� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /*@ axiomatic C { logic int K1 = (int) 1 ; logic int K2 = (int) 2 ; logic integer A = 1 ; logic integer B = 2 ; } */ /*@ ensures A: K1 == A ; ensures B: K2+K1 == B+A ; */ void f(void) {} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_float.i�������������������������������������0000666�0000000�0000000�00000000560�13571573400�021425� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model FLOAT */ /* run.config_qualif OPT: -wp-model FLOAT */ float f ; double d ; /*@ ensures CST_F : 0.5 == 0.5f ; ensures CST_D : 0.5 == 0.5d ; ensures CNV_F : (float) 0.2 == 0.2f ; ensures CNV_D : (double) 0.2 == 0.2d ; ensures VAR_F : f == 0.2f ; ensures VAR_D : d == 0.2d ; */ void main() { f = 0.2; d = 0.2; } ������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_hard.i��������������������������������������0000666�0000000�0000000�00000000452�13571573400�021236� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� int * p = (int *) 0x0033FF ; int * q = (int *) 0x0066F0 ; int * r = (int *) 0x0066F8 ; /*@ requires p_is_33FF: p == (int *) 0x0033FF ; requires q_is_66F0: q == (int *) 0x0066F0 ; requires r_is_q1_ko: (q+1) == (int *) 0x0066F8 ; // DON'T WANT TO PROVE THIS ! */ void main(void) { return; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_ite.i���������������������������������������0000666�0000000�0000000�00000000124�13571573400�021075� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� //@ ensures *p == (x==0 ? 1 : 0) ; void check(int x , int *p) { *p = (x==0) ; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_labels.i������������������������������������0000666�0000000�0000000�00000000457�13571573400�021567� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ predicate is_duplet{L}(int *a, integer i, integer j) = a[i] == a[j]; @*/ /*@ requires \separated(a+(*pi),pi,pj); @ ensures is_duplet(a,*pi,*pj) ; @*/ void duplet(int *a, int *pi, int *pj) { a[*pi] = a[*pj] ; //@ assert PI: \at(*pi,Pre) == *pi ; //@ assert PJ: \at(*pj,Pre) == *pj ; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_lemma.i�������������������������������������0000666�0000000�0000000�00000001571�13571573400�021416� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: */ /*@ axiomatic D1 { predicate P1(integer x) ; predicate P2(integer x) ; predicate P3(integer x) ; predicate P4(integer x) ; axiom P12: \forall integer x ; P1(x) ==> P2(x) ; } */ /*@ axiomatic Poluted { predicate H(integer x) ; lemma Foo: H(0) ==> (\forall integer x ; x<0 ==> H(x)) ==> (\forall integer x ; x>0 ==> H(x)) ==> (\forall integer x ; H(x)) ; } */ /*@ lemma P23_KO: \forall integer x ; P2(x) ==> P3(x) ; */ /*@ axiomatic G1 { lemma P13: \forall integer x ; P1(x) ==> P3(x) ; axiom P34: \forall integer x ; P3(x) ==> P4(x) ; lemma P14: \forall integer x ; P1(x) ==> P4(x) ; } */ /*@ predicate P5(integer x) = P1(x) && P2(x) ; */ /*@ lemma P52: \forall integer x ; P5(x) ==> P2(x) ; */ /*@ axiomatic G2 { lemma P54: \forall integer x ; P5(x) ==> P4(x) ; } */ ���������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_local.c�������������������������������������0000666�0000000�0000000�00000000404�13571573400�021401� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: OPT: -wp-model +raw */ /* run.config_qualif OPT: OPT: -wp-model +raw */ /*@ assigns \nothing; */ void foo(void) { int a; int* pa; pa = &a; *pa = 1; } /*@ assigns \nothing; */ void bar(void) { int a; a = 1; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_loopscope.i���������������������������������0000666�0000000�0000000�00000000355�13571573400�022325� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: OPT: -wp-model +ref */ /*@ requires \valid(written); */ void f(unsigned int * written) { int n = 1; *written = (unsigned int)0; /*@ loop invariant \false ; */ while (n < 10) { n++; } return; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_matrix.i������������������������������������0000666�0000000�0000000�00000000304�13571573400�021620� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� int t[10][20] ; /*@ ensures OK1: a!=c ==> t[a][b] == 1 ; ensures OK2: t[c][d] == 2 ; ensures KO: t[a][b] == 1 ; */ void make(int a,int b,int c,int d) { t[a][b] = 1 ; t[c][d] = 2 ; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_string.i������������������������������������0000666�0000000�0000000�00000000710�13571573400�021623� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-literals */ void f(void) { char * a = "abc" ; char * b = "def" ; char * c = "def" ; char * d = "abcdef" ; //@ assert AB: \separated(a,b); //@ assert B_valid: \valid_read(b+(0..2)); //@ assert B_end: \valid_read(b+3) && b[3] == '\0'; //@ assert B_out: !\valid_read(b+4); //@ assert B_rw: !\valid(b+1); //@ assert VAL: \forall integer i; 0 <= i <= 2 ==> b[i] == d[3+i] ; /* The ending '0' is ok ! */ } ��������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/unit_tset.i��������������������������������������0000666�0000000�0000000�00000000462�13571573400�021300� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: */ /*@ requires \valid( p + (0..n-1) ); assigns p[0..n-1]; */ void job(int *p,int n); typedef struct S { int size ; int value[50] ; } ; /*@ requires s.size < 50; */ void complex(struct S s) { /*@ assigns s.value[1..s.size]; */ job( & s.value[1] , s.size ); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/user_bitwise.i�����������������������������������0000666�0000000�0000000�00000004330�13571573400�021764� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model +ref -wp-prop="-ko" OPT: -wp-model +ref -wp-prop="ko" */ /* run.config_qualif OPT: -wp-model +ref -wp-prop="-ko" OPT: -wp-model +ref -wp-prop="ko" */ /*---------------------------------------------------*/ /*@ ensures b0: (\result&(1<<0))!=0 <==> (x&(1<<31))!=0; @ ensures bk: \forall int k ; 0 <= k && k < 31 ==> ( (\result&(1<<(1+k)))!=0 <==> (x&(1<<k))!=0 ); */ unsigned rl1 (unsigned x) { return (x << 1) | (x >> 31); } /*@ ensures b0: (\result&(1<<31))!=0 <==> (x&(1<<0))!=0; @ ensures bk: \forall int k ; 0 <= k && k < 31 ==> ( (\result&(1<<k))!=0 <==> (x&(1<<(1+k)))!=0 ); */ unsigned rr1 (unsigned x) { return (x >> 1) | (x << 31); } /*---------------------------------------------------*/ /*@ requires r: 0 < n < 32 ; @ ensures b1: \forall int k ; 0 <= k && k < n ==> ( (\result&(1<<k)) <==> (x&(1<<(32-n+k))) ); @ ensures b2: \forall int k ; 0 <= k && k < 32-n ==> ( (x&(1<<k)) <==> (\result&(1<<(k+n))) ); */ unsigned rln32 (unsigned x, int n) { return (x << n) | (x >> (32 - n)); } /*@ requires r: 0 < n < 32 ; @ ensures b1: \forall int k ; 0 <= k && k < n ==> ( (\result&(1<<(32-n+k))) <==> (x&(1<<k)) ); @ ensures b2: \forall int k ; 0 <= k && k < 32-n ==> ( (\result&(1<<k)) <==> (x&(1<<(n+k))) ); */ unsigned rrn32 (unsigned x, int n) { return (x << (32 - n)) | (x >> n); } /*---------------------------------------------------*/ /*@ requires r: 0 < n < 64 ; @ ensures b1: \forall int k ; 0 <= k && k < n ==> ( (\result&(1<<k)) <==> (x&(1<<(64-n+k))) ); @ ensures b2: \forall int k ; 0 <= k && k < 64-n ==> ( (x&(1<<k)) <==> (\result&(1<<(k+n))) ); */ unsigned long long rln64 (unsigned long long x, int n) { return (x << n) | (x >> (64 - n)); } /*@ requires r: 0 < n < 64 ; @ ensures b1: \forall int k ; 0 <= k && k < n ==> ( (\result&(1<<(64-n+k))) <==> (x&(1<<k)) ); @ ensures b2: \forall int k ; 0 <= k && k < 64-n ==> ( (\result&(1<<k)) <==> (x&(1<<(n+k))) ); */ unsigned long long rrn64 (unsigned long long x, int n) { return (x << (64 - n)) | (x >> n); } /*---------------------------------------------------*/ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/user_collect.i�����������������������������������0000666�0000000�0000000�00000002714�13571573400�021747� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-wp-no-extensional" */ /* run.config_qualif STDOPT: +"-wp-no-extensional" */ int k ; int p[10] ; struct S { int f[2] ; } ; struct S q[10] ; /*@ requires 0 <= k < 10 ; ensures K: k == \old(k) + 1 ; ensures P: p == { \old(p) \with [\old(k)] = x } ; assigns k,p[k] ; */ void job(int x) { p[k++] = x ; } /*@ requires 0 <= k < 10 ; ensures K: k == \old(k) + 1 ; ensures Q: q == { \old(q) \with [\old(k)] = s } ; assigns k,q[k] ; */ void job2(struct S s) { q[k++] = s ; } /*@ requires 0 <= k < 10 ; ensures K: k == \old(k) + 1 ; ensures Q: q == { \old(q) \with [\old(k)] = s } ; assigns k,q[k] ; */ void job3(struct S s) { q[k].f[0] = s.f[0] ; q[k].f[1] = s.f[1] ; k++; } /*@ requires 0 <= k < 9 ; ensures K: k == \old(k)+2 ; ensures P1: p[\old(k)+0] == x1 ; ensures P2: p[\old(k)+1] == x2 ; */ void caller(int x1 , int x2) { job(x1); job(x2); } /*@ requires 0 <= k < 9 ; ensures K: k == \old(k)+2 ; ensures Q1: q[\old(k)+0] == s1 ; ensures Q2: q[\old(k)+1] == s2 ; ensures R: q == {{ \old(q) \with [\old(k)] = s1 } \with [\old(k)+1] = s2 } ; */ void caller2(struct S s1 , struct S s2) { job2(s1); job2(s2); } /*@ requires 0 <= k < 9 ; ensures K: k == \old(k)+2 ; ensures Q1: q[\old(k)+0] == s1 ; ensures Q2: q[\old(k)+1] == s2 ; ensures R: q == {{ \old(q) \with [\old(k)] = s1 } \with [\old(k)+1] = s2 } ; */ void caller3(struct S s1 , struct S s2) { job3(s1); job3(s2); } ����������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/user_init.i��������������������������������������0000666�0000000�0000000�00000011720�13571573400�021262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif EXECNOW: rm -rf @PTEST_DIR@/oracle@PTEST_CONFIG@/@PTEST_NAME@.1.session/script OPT: -wp-prop=-lack,-tactic OPT: -wp-prop=tactic -wp-auto=wp:split OPT: -wp-prop=lack -wp-steps 300 */ /*@ requires \valid(a+(0..n-1)) ; @ requires n >= 0 ; @ assigns a[0..n-1] ; @ ensures \forall int k ; 0 <= k < n ==> a[k] == v ; @ exits \false; */ void init( int * a , int n , int v ) { /*@ loop assigns Zone: i,a[0..n-1] ; @ loop invariant Range: 0 <= i <= n ; @ loop invariant Partial: \forall int k ; 0 <= k < i ==> a[k] == v ; @ loop variant Decr_i: n - i ; */ for (int i = 0 ; i < n ; i++) a[i] = v ; } //------------------------- int t1[10]; /*@ ensures \forall integer k; 0 <= k < 10 ==> t1[k] == v ; @ exits \false; @ assigns t1[0..9] ; */ void init_t1(int v) { unsigned i; /*@ loop assigns Zone: i,t1[0..9] ; @ loop invariant Range: 0 <= i <= 10 ; @ loop invariant Partial: \forall integer k ; 0 <= k < i ==> t1[k] ≡ v ; @ loop variant Decr: 10 - i ; */ for (i = 0 ; i < 10 ; i++) t1[i] = v ; } //------------------------- int t2[10][20]; /*@ ensures \forall integer k, l; 0 <= k < 10 && 0 <= l < 20 ==> t2[k][l] == v; @ exits \false; @ assigns lack: t2[0..9][0..19]; */ void init_t2_v1(int v) { unsigned i,j; /*@ loop assigns lack: Zone_i: i, j, t2[0..9][0..19]; @ loop invariant Range_i: 0 <= i <= 10 ; @ loop invariant Partial_i: \forall integer k,l; 0 <= k < i && 0 <= l < 20 ==> t2[k][l] == v; @ loop variant Decr_i: 10 - i ; */ for(i = 0; i <= 9; i++) { /*@ loop assigns lack: Zone_j: j, t2[0..9][0..19]; @ loop invariant Range_j: 0 <= j <= 20 ; @ loop invariant Partial_j: \forall integer l; 0 <= l < j ==> t2[i][l] == v; @ loop invariant Previous_i: \forall integer k,l; 0 <= k < i && 0 <= l < 20 ==> t2[k][l] == \at(t2[k][l], LoopEntry); @ loop variant Decr_j: 20 - j ; */ for(j = 0; j <= 19; j++) { t2[i][j] = v; } //@ assert Last_j: j==20; ; } //@ assert Last_i: i==10; ; } //------------------------- /*@ ensures \forall integer k, l; 0 <= k < 10 && 0 <= l < 20 ==> t2[k][l] == v; @ exits \false; @ assigns tactic: t2[..][..]; */ void init_t2_v2(int v) { unsigned i,j; /*@ loop assigns tactic: Zone_i: i, j, t2[..][..]; @ loop invariant Range_i: 0 <= i <= 10 ; @ loop invariant Partial_i: \forall integer k,l; 0 <= k < i && 0 <= l < 20 ==> t2[k][l] == v; @ loop variant Decr_i: 10 - i ; */ for(i = 0; i <= 9; i++) { /*@ loop assigns tactic: Zone_j: j, t2[..][..]; @ loop invariant Range_j: 0 <= j <= 20 ; @ loop invariant Partial_j: \forall integer l; 0 <= l < j ==> t2[i][l] == v; @ loop invariant Previous_i: \forall integer k,l; 0 <= k < i && 0 <= l < 20 ==> t2[k][l] == \at(t2[k][l], LoopEntry); @ loop variant Decr_j: 20 - j ; */ for(j = 0; j <= 19; j++) { t2[i][j] = v; } //@ assert Last_j: j==20; ; } //@ assert Last_i: i==10; ; } //------------------------- //@ predicate MemSet20(int t2[20], integer n, integer v) = n <= 20 && \forall integer k ; 0 <= k < n ==> t2[k] == v; /*@ ensures \forall integer k; 0 <= k < 10 ==> MemSet20(t2[k], 20, v); @ exits \false; @ assigns tactic: t2[..][..]; */ void init_t2_v3(int v) { unsigned i,j; /*@ loop assigns tactic: Zone_i: i, j, t2[..][..]; @ loop invariant Range_i: 0 <= i <= 10 ; @ loop invariant Partial_i: \forall integer k; 0 <= k < i ==> MemSet20(t2[k], 20, v); @ loop variant V_i: 10 - i ; */ for(i = 0; i <= 9; i++) { /*@ loop assigns tactic: Zone_j: j, t2[i][..]; @ loop invariant Range_j: 0 <= j <= 20 ; @ loop invariant Partial_j: MemSet20(t2[i], j, v); @ loop variant Decr_j: 20 - j ; */ for(j = 0; j <= 19; j++) { t2[i][j] = v; } //@ assert Last_j: j==20; ; } //@ assert Last_i: i==10; ; } //------------------------- /*@ ensures \forall integer k, l; 0 <= k < 10 && 0 <= l < 20 ==> t2[k][l] == v; @ assigns lack: t2[0..9][0..19]; @ exits \false; */ void init_t2_bis_v1(int v) { unsigned i; /*@ loop assigns lack: Zone: i, t2[0..9][0..19]; @ loop invariant Range: 0 <= i <= 10 ; @ loop invariant Partial: \forall integer k,l; 0 <= k < i && 0 <= l < 20 ==> t2[k][l] == v; @ loop variant Decr: 10 - i ; */ for(i = 0; i <= 9; i++) { init(&t2[i][0], 20, v); //@ assert Offset: &t2[i][0] == &t2[0][0] + 20*i; } } //------------------------- /*@ ensures \forall integer k, l; 0 <= k < 10 && 0 <= l < 20 ==> t2[k][l] == v; @ assigns tactic: t2[..][..]; @ exits \false; */ void init_t2_bis_v2(int v) { unsigned i; /*@ loop assigns tactic: Zone: i, t2[..][..]; @ loop invariant Range: 0 <= i <= 10 ; @ loop invariant Partial: \forall integer k,l; 0 <= k < i && 0 <= l < 20 ==> t2[k][l] == v; @ loop variant Decr: 10 - i ; */ for(i = 0; i <= 9; i++) { init(&t2[i][0], 20, v); //@ assert Offset_i: &t2[i][0] == &t2[0][0] + 20*i; ; } } ������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/user_injector.i����������������������������������0000666�0000000�0000000�00000004245�13571573400�022140� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-extern-arrays */ /* run.config_qualif OPT: -wp-extern-arrays OPT: -wp-extern-arrays -wp-model +ref */ /* -------------------------------------------------------------------------- */ /* --- Sequences --- */ /* -------------------------------------------------------------------------- */ /*@ axiomatic Sequences { logic int call( int seq , integer fct ); logic int concat( int seq1 , int seq2 ); } */ int seq = 0 ; /* -------------------------------------------------------------------------- */ /* --- Injector / Collector --- */ /* -------------------------------------------------------------------------- */ int service_cpt ; int service_id[] ; int service_result[] ; /*@ ensures ID: service_id == { \old(service_id) \with [service_cpt] = id } ; ensures RESULT: \result == service_result[service_cpt] ; ensures CPT: service_cpt == \old(service_cpt)+1 ; ensures SEQ: seq == call( \old(seq) , 0xF1 ); assigns A: seq,service_cpt,service_id[..]; */ int service(int id) ; /* -------------------------------------------------------------------------- */ /* --- Job --- */ /* -------------------------------------------------------------------------- */ /*@ ensures SEQ: seq == call( call ( \old(seq) , 0xF1 ) , 0xF1 ) ; ensures ID1: service_id[ \old(service_cpt)+1 ] == a ; ensures ID2: service_id[ \old(service_cpt)+2 ] == b ; ensures R1: \result != 0 ==> service_result[ \old(service_cpt)+1 ] != 0 ; ensures R2: \result != 0 ==> service_result[ \old(service_cpt)+2 ] != 0 ; ensures R0: \result != 0 ==> *error == 0 ; ensures E1: service_result[ \old(service_cpt)+1 ] == 0 ==> *error == a ; ensures E2: service_result[ \old(service_cpt)+1 ] != 0 ==> service_result[ \old(service_cpt)+2 ] == 0 ==> *error == b ; assigns A: seq,service_cpt,service_id[..],*error; */ int job( int a , int b , int * error ) { *error = 0 ; int ra = service( a ); int rb = service( b ); if (!ra) *error = a ; else if (!rb) *error = b ; return ra && rb ; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/user_rec.i���������������������������������������0000666�0000000�0000000�00000002165�13571573400�021073� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: -wp-prop=-lack */ /*@ logic integer fact(integer n) = n <= 1 ? 1 : n * fact (n-1) ; */ /*@ lemma fact_ge1: lack: \forall integer n ; fact(n) >= 1 ; */ /*@ lemma fact_next: lack: \forall integer n,m ; 0 < n <= m ==> (n*(fact(m)/fact(n))) == (fact(m)/fact(n-1)) ; */ /*@ ensures \result == fact(n) ; */ int F1(int n) { if (n<=1) return 1; int p=1,i=2 ; /*@ loop invariant 2 <= i <= (n+1) ; loop invariant p == fact(i-1) ; loop assigns p,i; */ while (i <= n) { p *= i ; i++; } return p; } /*@ ensures \result == fact(n) ; */ int F2(int n) { int p=1,i=2 ; /*@ loop invariant RANGE: n<=1 ? i==2 : 2 <= i <= (n+1) ; loop invariant PART: n<=1 ? p==1 : p == fact(i-1) ; loop assigns p,i; */ while (i <= n) { p *= i ; i++; } return p; } /*@ ensures \result == fact(n) ; */ int F4(int n) { int p=1 ; /*@ loop invariant RANGE: \at(n,Pre) <= 1 ? n == \at(n,Pre) : 1 <= n <= \at(n,Pre) ; loop invariant NEVER: \at(n,Pre) <= 1 ? p == 1 : p == fact(\at(n,Pre)) / fact(n) ; loop assigns p,n ; */ while (n > 1) { p *= n ; n--; } return p; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/user_string.i������������������������������������0000666�0000000�0000000�00000001627�13571573400�021632� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ axiomatic String { predicate Length_of_str_is(char * s,integer n) = \valid( s + (0..n) ) && s[n] == 0 && 0 <= n && \forall integer k ; 0 <= k < n ==> s[k] !=0 ; logic integer Length{L}(char *s) reads s[..] ; axiom Length_def : \forall char *s; \forall integer n; Length_of_str_is(s,n) ==> Length(s)==n ; } */ /*@ requires \exists integer i; Length_of_str_is(s,i); assigns \nothing; ensures \exists integer i; Length_of_str_is(s,i) && \result == i; @*/ int strlen(const char *s) { const char *ss = s; /*@ loop invariant BASE: \base_addr(s) == \base_addr(ss) ; loop invariant RANGE: s <= ss <= s+Length(s); loop invariant ZERO: \forall integer i; 0 <= i < (ss-s) ==> s[i] != 0; loop assigns ss; loop variant Length(s) - (ss-s) ; @*/ while (*ss) ss++; /*@ assert END: Length_of_str_is(s,ss-s); */ return ss - s; } ���������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_typed/user_swap.i��������������������������������������0000666�0000000�0000000�00000000552�13571573400�021272� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config_qualif OPT: OPT: -wp-model +ref */ /*@ requires \valid(a) ; @ requires \valid(b) ; @ ensures A: *a == \old(*b) ; @ ensures B: *b == \old(*a) ; @ assigns E: *a,*b ; @*/ void swap(int *a,int *b) { int tmp = *a ; *a = *b ; *b = tmp ; return ; } void main(int a,int b) { if (a >= b) swap(&a,&b) ; //@ assert a <= b ; } ������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/�������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017065� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/caveat.i�����������������������������������������0000666�0000000�0000000�00000001577�13571573400�020514� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: OPT: -wp-msg-key refusage -wp-model Caveat */ /* run.config_qualif DONTRUN: */ typedef struct S { int f ; int g ; } ; /*@ ensures a->f == \old(a->f)+1 ; ensures a->g == \old(a->g)+1 ; ensures *r == \old(a->f + a->g) ; */ void implicit(struct S * a , int * r) { int * p = &(a->f) ; int * q = &(a->g) ; *r = *p + *q ; (*p)++; (*q)++; } /*@ requires \separated(a,r); ensures a->f == \old(a->f)+1 ; ensures a->g == \old(a->g)+1 ; ensures *r == \old(a->f + a->g) ; */ void explicit(struct S * a , int * r) { int * p = &(a->f) ; int * q = &(a->g) ; *r = *p + *q ; (*p)++; (*q)++; } //@ predicate OBS(integer f,integer g,integer r); /*@ requires KO: OBS(a->f,a->g,*r); ensures KO: OBS(a->f,a->g,*r); */ void observer(struct S * a , int * r) { int * p = &(a->f) ; int * q = &(a->g) ; *r = *p + *q ; (*p)++; (*q)++; } ���������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/caveat2.i����������������������������������������0000666�0000000�0000000�00000001012�13571573400�020556� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Caveat */ /* run.config_qualif OPT: -wp-model Caveat */ typedef struct S { int n ; int a[4]; } ; /*@ requires 0 <= n < 4 ; ensures N: p->n == n ; ensures A: \forall integer k; 0 <= k < n ==> p->a[k] == b[k]; assigns *p ; */ void job( struct S * p , int n , int *b ) { p->n = n ; /*@ loop invariant 0 <= i <= n ; loop invariant \forall integer k; 0 <= k < i ==> p->a[k] == b[k]; loop assigns i, p->a[..]; */ for (int i = 0; i < n; i++) p->a[i] = b[i]; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/caveat_range.i�����������������������������������0000666�0000000�0000000�00000001167�13571573400�021663� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp -wp-model Caveat -wp-extern-arrays */ /* run.config_qualif OPT: -wp -wp-model Caveat -wp-extern-arrays */ struct S { int f ; int g ; } ; /*@ ensures \forall integer k ; 0 <= k < 10 ==> p[k].f == 1 ; ensures \forall integer k ; 0 <= k < 10 ==> p[k].g == 2 ; assigns p[0..9]; */ void reset(struct S * p) { /*@ loop invariant 0 <= i <= 10 ; loop invariant \forall integer k ; 0 <= k < i ==> p[k].f == 1 ; loop invariant \forall integer k ; 0 <= k < i ==> p[k].g == 2 ; loop assigns i, p[0..9] ; */ for (int i = 0 ; i < 10 ; i++) { p[i].f = 1 ; p[i].g = 2 ; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/code_spec.i��������������������������������������0000666�0000000�0000000�00000010466�13571573400�021172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-prop none -wp-msg-key refusage */ /* run.config_qualif DONTRUN: */ int x0, x1, x2, x3, x4, x5, x6, x7, x8, x9; int y0, y1, y2, y3, y4, y5, y6, y7, y8, y9; int z0, z1, z2, z3, z4, z5, z6, z7, z8, z9; int*p0,*p1,*p2,*p3,*p4,*p5,*p6,*p7,*p8,*p9; struct st { int c; int * pc; int tc[5]; } s0; int tab[], tab1[1], tab2[2]; char *ptr; //------------------------------------------------------- int no_access0; void no_access_undef(int noaccess1); void no_access(int noaccess2) { int noaccess3; } //------------------------------------------------------- void by_value_in_code(int x) { ptr=(char *) 0; if (y0) x0 = x ; while (!-(y1 - y2 + y3 * y4 / y5 & y6 | y7 ^ y8 % y9)) x0 = !-(x1 - x2 + x3 * x4 / x5 & x6 | x7 ^ x8 % x9); switch (z0) { int z=0 ; case 1: z1=1; break; } tab[1+z2]=0; } void by_reference_in_code(int *p, int **qq) { *p=0; **qq=*p1; } void by_addr_in_code(int v1, struct st s2, struct st s3) { if ((&x0 != &s0.c) && (&tab[5] != &v1) && (&s2.c != &s3.tc[3])) return; } void by_array_in_code(int *p, int *q, int **qq) { *(ptr+1)=0; *(p+1)=q[0]; p1[p2[0]]=*(p3+p4[*(p5+1)]); } //------------------------------------------------------- void by_value_in_code_annotation(int v, int *p, int*q) { //@ assert tab[v-1]==0 && \initialized (&x6); /*@ requires (x1?x2:x3)== 0; @ assigns x4; @*/ /*@ loop invariant x5<0; @ loop variant q-p; @*/ while (1) //@ assert 0 == \let term=1+\at(x7,Pre) ; 1+term; //@ assert \let pred=(x8==0) ; pred && x9==0; ; } //@ behavior no_exit: exits \false; void by_reference_in_code_annotation(int*p) { //@ for no_exit: assert \valid (p); //@ ensures \separated (p1,p2) && \freeable (p3) || \allocable (p5) <==> \initialized (p6); ; //@ loop invariant *p4<0; while (1); } void by_addr_in_code_annotation(void) { //@ requires (&x0 != &s0.c) && &tab[5]; return; } void by_array_in_code_annotation(int *p, int *q, int **qq) { //@ assert *(ptr+1)==0 && *(p+1)==q[0] && p1[p2[0]]==*(p3+p4[*(p5+1)]); ; } //------------------------------------------------------- /*@ assigns x0, p0; @ ensures p1+x1==p2; @*/ void by_value_in_spec (void); /*@ requires (\valid (p0) && \separated (p1,p2) ? \freeable (p3) || \allocable (p5) : \initialized (p6)); ensures *p4==0; assigns *p; */ void by_reference_in_spec (int * p); //@ requires (&x0 != &s0.c) && &tab[5]; void by_addr_in_spec (void); //@ behavior blabla: ensures *(ptr+1)==0 && *(p+1)==q[0] && p1[p2[0]]==*(p3+p4[*(p5+1)]); void by_array_in_spec (int *p, int *q, int **qq) ; //------------------------------------------------------- int val, *ref, *ref_bis, addr, *array, val_for_tab[], not_imported; /*@ requires by_value: !val && val_for_tab[1]; @ requires by_ref: \valid (ref) && !*ref_bis; @ requires by_addr: &addr!=(int*)0; @ assigns by_array: *(array+1); @*/ void global_spec (void) { not_imported = 0; } /*@ requires by_value: !val_arg1 && !val_arg2 && !val_arg3; @ requires by_ref: \separated (ref_arg1, ref_arg2, ref_arg3); @ requires by_addr: &addr_arg0.tc[5] != (char*) 0; @ assigns by_array: array_arg1[val_arg0], array_arg2[2], array_arg3[3]; @*/ void params_spec (int val_arg0, struct st addr_arg0, int **val_arg1, int *val_arg2, int *val_arg3, int **ref_arg1, int *ref_arg2, int *ref_arg3, int *array_arg1,int *array_arg2,int *array_arg3) { not_imported = 0; } int val1; //@ requires val1==v; void global_and_param_spec (int v) { not_imported = 0; } // Some global variables int val0; int *addr_val1, *val_val2, *val_val3; int *val_ref1, *ref_ref2, *array_ref3; void calling_spec (int v1, int v2, int v3, int v4) { // Some local variables struct st no_access_addr0; struct { int a; int b ;} val_array1; int *array_array2, *array_array3; global_spec(); params_spec (val0, no_access_addr0, &addr_val1, val_val2, val_val3+v1, &val_ref1, ref_ref2, array_ref3+v2, &val_array1.a, array_array2, array_array3+v3); global_and_param_spec (v4); } int addr_value; /*@ requires by_value: !val && !val_ref && !value_array && !addr_value; requires by_ref: \separated (ref, val_ref, array_ref) ; requires by_addr: &addr != &addr_value; @ assigns by_array: *(array+1), *(array_ref+1), *(value_array+1); */ void cup (int *val_ref, int *array_ref, int *value_array) ; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/core.i�������������������������������������������0000666�0000000�0000000�00000000526�13571573400�020172� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-no-core OPT: -wp-core */ /* run.config_qualif DONTRUN: */ int a,b,c,x; //@ predicate OBS(integer x,integer y); //@ ensures OBS(\old(x),x); void f(void) { if (a) //@ ensures x == \old(x); a++; if (b) //@ ensures x == \old(x); b++; x++; if (c) //@ ensures x == \old(x); c++; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/global.c�����������������������������������������0000666�0000000�0000000�00000000444�13571573400�020473� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model raw OPT: -wp-model var OPT: -wp-model ref */ /* run.config_qualif DONTRUN: */ int GLOBAL ; /*@ requires \valid(a); */ void foo(int* a) { /*@ assert no_address_taken: \separated(a, &GLOBAL); */ *a = 42; } int main() { foo(&GLOBAL); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/issue-189-bis.i����������������������������������0000666�0000000�0000000�00000006156�13571573400�021471� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-model Typed -wp-alias-vars src,dst OPT: -wp-model Typed -wp-context-vars src,dst -wp-fct memcpy_context_vars */ /* run.config_qualif OPT: -wp -wp-model Typed -wp-alias-vars src,dst -wp-par 1 OPT: -wp -wp-model Typed -wp-context-vars src,dst -wp-prop ok -wp-par 1 */ //----------------------------------------------------------------------------- // FUNCTION memcpy_alias_vars: since input pointers are MODIFIED, Caveat // model (setting 'src' and 'dst' in context) CANNOT be used. //----------------------------------------------------------------------------- /*@ requires write_access: \valid( dst + (0 .. len-1) ); @ requires read_access: \valid_read( src + (0 .. len-1) ); @ requires unaliasing: \separated( dst + (0 .. len-1) , src + (0 .. len-1) ); @ assigns dst[ 0 .. len-1 ]; @ ensures memcpy: \forall integer k; 0 <= k < len-1 ==> dst[k] == \old( src[k] ); @ ensures unmodified: \forall integer k; 0 <= k < len-1 ==> src[k] == \old( src[k] ); @*/ void memcpy_alias_vars (unsigned char *src, unsigned char *dst, int len) { /*@ loop invariant len: len <= \at( len, LoopEntry ); @ loop invariant src: src + len == \at( src + len, LoopEntry ); @ loop invariant dst: dst + len == \at( dst + len, LoopEntry ); @ loop assigns src, dst, len, \at( dst[0 .. len-1], LoopEntry ) ; @ loop invariant cpy: \let idx = \at( len, LoopEntry ) - len ; @ \forall integer k; 0 <= k < idx @ ==> \at( dst, LoopEntry )[k] == \at( src, LoopEntry )[k]; @*/ while (len > 0) { *(dst++) = *(src++); len--; } } //----------------------------------------------------------------------------- // FUNCTION memcpy_context_vars: since input pointers are UNMODIFIED, Caveat // model (setting 'src' and 'dst' in context) CAN be used. //----------------------------------------------------------------------------- /*@ requires write_access: \valid( dst + (0 .. len-1) ); @ requires read_access: \valid_read( src + (0 .. len-1) ); @ requires unaliasing: \separated( dst + (0 .. len-1) , src + (0 .. len-1) ); @ assigns dst[ 0 .. len-1 ]; @ ensures memcpy: ok: \forall integer k; 0 <= k < len-1 ==> dst[k] == \old( src[k] ); @ ensures unmodified: ok: \forall integer k; 0 <= k < len-1 ==> src[k] == \old( src[k] ); @*/ void memcpy_context_vars (unsigned char *src, unsigned char *dst, int len) { unsigned char *src2=src, *dst2=dst; /*@ loop invariant ok: len: len <= \at( len, LoopEntry ); @ loop invariant ok: src: src2 + len == \at( src2 + len, LoopEntry ); @ loop invariant ok: dst: dst2 + len == \at( dst2 + len, LoopEntry ); @ loop assigns src2, dst2, len, \at( dst2[0 .. len-1], LoopEntry ) ; @ loop invariant ok: cpy: \let idx = \at( len, LoopEntry ) - len ; @ \forall integer k; 0 <= k < idx @ ==> \at( dst2, LoopEntry )[k] == \at( src2, LoopEntry )[k]; @*/ while (len > 0) { *(dst2++) = *(src2++); len--; } } //----------------------------------------------------------------------------- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/issue-189.i��������������������������������������0000666�0000000�0000000�00000000632�13571573400�020707� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: OPT: -wp-msg-key refusage -wp-model Caveat OPT: -wp-msg-key refusage -wp-model Caveat -wp-unalias-vars src */ /* run.config_qualif DONTRUN: */ /*@ requires v1: \valid( ptr ); @ requires v2: \valid_read( src + idx ); @ requires s1: \separated( ptr, src + idx ); @ assigns *ptr; @*/ void f (char *ptr, char const *src, unsigned idx) { src += idx; *ptr = *src; } ������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020332� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/caveat.0.res.oracle�����������������������0000666�0000000�0000000�00000012324�13571573400�023714� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/caveat.i (no preprocessing) [kernel] tests/wp_usage/caveat.i:41: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function explicit ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 28) in 'explicit': Let a_1 = shiftfield_F1_S_f(a). Let x = Mint_0[a_1]. Let a_2 = shiftfield_F1_S_g(a). Let x_1 = Mint_0[a_2]. Let m = Mint_0[r <- x + x_1]. Let x_2 = m[a_1]. Let x_3 = m[a_2]. Let x_4 = 1 + x_2. Let x_5 = 1 + x_3. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x_5) /\ is_sint32(m[a_1 <- x_4][a_2 <- x_5][r]). (* Heap *) Have: (region(a.base) <= 0) /\ (region(r.base) <= 0). (* Pre-condition *) Have: separated(a, 2, r, 1). } Prove: x_2 = x. ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 29) in 'explicit': Let a_1 = shiftfield_F1_S_f(a). Let x = Mint_0[a_1]. Let a_2 = shiftfield_F1_S_g(a). Let x_1 = Mint_0[a_2]. Let m = Mint_0[r <- x + x_1]. Let x_2 = m[a_1]. Let x_3 = m[a_2]. Let x_4 = 1 + x_2. Let x_5 = 1 + x_3. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x_5) /\ is_sint32(m[a_1 <- x_4][a_2 <- x_5][r]). (* Heap *) Have: (region(a.base) <= 0) /\ (region(r.base) <= 0). (* Pre-condition *) Have: separated(a, 2, r, 1). } Prove: x_3 = x_1. ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 30) in 'explicit': Let a_1 = shiftfield_F1_S_f(a). Let x = Mint_0[a_1]. Let a_2 = shiftfield_F1_S_g(a). Let x_1 = Mint_0[a_2]. Let x_2 = x + x_1. Let m = Mint_0[r <- x_2]. Let x_3 = m[a_1]. Let x_4 = m[a_2]. Let x_5 = 1 + x_3. Let x_6 = 1 + x_4. Let x_7 = m[a_1 <- x_5][a_2 <- x_6][r]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x_5) /\ is_sint32(x_6) /\ is_sint32(x_7). (* Heap *) Have: (region(a.base) <= 0) /\ (region(r.base) <= 0). (* Pre-condition *) Have: separated(a, 2, r, 1). } Prove: x_7 = x_2. ------------------------------------------------------------ ------------------------------------------------------------ Function implicit ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 13) in 'implicit': Let a_1 = shiftfield_F1_S_f(a). Let x = Mint_0[a_1]. Let a_2 = shiftfield_F1_S_g(a). Let x_1 = Mint_0[a_2]. Let m = Mint_0[r <- x + x_1]. Let x_2 = m[a_1]. Let x_3 = m[a_2]. Let x_4 = 1 + x_2. Let x_5 = 1 + x_3. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x_5) /\ is_sint32(m[a_1 <- x_4][a_2 <- x_5][r]). (* Heap *) Have: (region(a.base) <= 0) /\ (region(r.base) <= 0). } Prove: x_2 = x. ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 14) in 'implicit': Let a_1 = shiftfield_F1_S_f(a). Let x = Mint_0[a_1]. Let a_2 = shiftfield_F1_S_g(a). Let x_1 = Mint_0[a_2]. Let m = Mint_0[r <- x + x_1]. Let x_2 = m[a_1]. Let x_3 = m[a_2]. Let x_4 = 1 + x_2. Let x_5 = 1 + x_3. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x_5) /\ is_sint32(m[a_1 <- x_4][a_2 <- x_5][r]). (* Heap *) Have: (region(a.base) <= 0) /\ (region(r.base) <= 0). } Prove: x_3 = x_1. ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 15) in 'implicit': Let a_1 = shiftfield_F1_S_f(a). Let x = Mint_0[a_1]. Let a_2 = shiftfield_F1_S_g(a). Let x_1 = Mint_0[a_2]. Let x_2 = x + x_1. Let m = Mint_0[r <- x_2]. Let x_3 = m[a_1]. Let x_4 = m[a_2]. Let x_5 = 1 + x_3. Let x_6 = 1 + x_4. Let x_7 = m[a_1 <- x_5][a_2 <- x_6][r]. Assume { Type: is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x_5) /\ is_sint32(x_6) /\ is_sint32(x_7). (* Heap *) Have: (region(a.base) <= 0) /\ (region(r.base) <= 0). } Prove: x_7 = x_2. ------------------------------------------------------------ ------------------------------------------------------------ Function observer ------------------------------------------------------------ Goal Post-condition 'KO' in 'observer': Let a_1 = shiftfield_F1_S_f(a). Let x = Mint_0[a_1]. Let a_2 = shiftfield_F1_S_g(a). Let x_1 = Mint_0[a_2]. Let x_2 = Mint_0[r]. Let m = Mint_0[r <- x + x_1]. Let x_3 = m[a_1]. Let x_4 = m[a_2]. Let x_5 = 1 + x_3. Let x_6 = 1 + x_4. Let x_7 = m[a_1 <- x_5][a_2 <- x_6][r]. Assume { Type: is_sint32(x_2) /\ is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x_5) /\ is_sint32(x_6) /\ is_sint32(x_7). (* Heap *) Have: (region(a.base) <= 0) /\ (region(r.base) <= 0). (* Pre-condition *) Have: P_OBS(x, x_1, x_2). } Prove: P_OBS(x_5, x_6, x_7). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/caveat.1.res.oracle�����������������������0000666�0000000�0000000�00000006021�13571573400�023712� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_usage/caveat.i (no preprocessing) [kernel] tests/wp_usage/caveat.i:41: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... ................................................. ... Ref Usage ................................................. Init: { } Function implicit: { a *r p q } Function explicit: { a *r p q } Function observer: { a *r p q } ................................................. [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function explicit ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 28) in 'explicit': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 29) in 'explicit': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 30) in 'explicit': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function implicit ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 13) in 'implicit': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 14) in 'implicit': Prove: true. ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat.i, line 15) in 'implicit': Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function observer ------------------------------------------------------------ Goal Post-condition 'KO' in 'observer': Let a = global(G_a_43). Let x = Mint_0[shiftfield_F1_S_f(a)]. Let x_1 = Mint_0[shiftfield_F1_S_g(a)]. Let x_2 = 1 + x. Let x_3 = 1 + x_1. Let x_4 = x + x_1. Assume { Type: is_sint32(r) /\ is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(x_4). (* Pre-condition *) Have: P_OBS(x, x_1, r). } Prove: P_OBS(x_2, x_3, x_4). ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'implicit': /*@ behavior typed_caveat: requires \separated(a,r); requires \valid(a); requires \valid(r); */ void implicit(struct S *a, int *r); [wp] Warning: Memory model hypotheses for function 'explicit': /*@ behavior typed_caveat: requires \separated(a,r); requires \valid(a); requires \valid(r); */ void explicit(struct S *a, int *r); [wp] Warning: Memory model hypotheses for function 'observer': /*@ behavior typed_caveat: requires \separated(a,r); requires \valid(a); requires \valid(r); */ void observer(struct S *a, int *r); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/caveat2.res.oracle������������������������0000666�0000000�0000000�00000006262�13571573400�023644� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_usage/caveat2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_usage/caveat2.i:22: Warning: Undefined array-size (sint32[]) ------------------------------------------------------------ Function job ------------------------------------------------------------ Goal Post-condition 'N' in 'job': Prove: true. ------------------------------------------------------------ Goal Post-condition 'A' in 'job': Let a = global(G_b_24). Assume { Type: is_sint32(i_1) /\ is_sint32(n). (* Goal *) When: (0 <= i) /\ (i < n). (* Pre-condition *) Have: (0 <= n) /\ (n <= 3). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (Mint_0[shift_sint32(a, i_2)] = v[i_2]))). (* Invariant *) Have: (0 <= i_1) /\ (i_1 <= n). (* Else *) Have: n <= i_1. } Prove: Mint_0[shift_sint32(a, i)] = v[i]. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_usage/caveat2.i, line 21): Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Pre-condition *) Have: (0 <= n) /\ (n <= 3). (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (Mint_0[shift_sint32(global(G_b_24), i_1)] = v[i_1]))). (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_usage/caveat2.i, line 21): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_usage/caveat2.i, line 22): tests/wp_usage/caveat2.i:22: warning from Typed Model: - Warning: No allocation size for variable 'b' Reason: Undefined array-size (sint32[]) Let a = global(G_b_24). Assume { Type: is_sint32(i) /\ is_sint32(n) /\ is_sint32(1 + i). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i). (* Pre-condition *) Have: (0 <= n) /\ (n <= 3). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (Mint_0[shift_sint32(a, i_2)] = v[i_2]))). (* Invariant *) Have: (0 <= i) /\ (i <= n). (* Then *) Have: i < n. } Prove: v[i <- Mint_0[shift_sint32(a, i)]][i_1] = Mint_0[shift_sint32(a, i_1)]. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_usage/caveat2.i, line 22): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/caveat2.i, line 23): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/caveat2.i, line 15) in 'job' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/caveat2.i, line 15) in 'job' (2/2): Effect at line 25 Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'job': /*@ behavior typed_caveat: requires \separated(p,b+(..)); requires \valid(p); requires \valid(b+(..)); */ void job(struct S *p, int n, int *b); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/caveat_range.res.oracle�������������������0000666�0000000�0000000�00000012050�13571573400�024726� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_usage/caveat_range.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function reset ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat_range.i, line 12) in 'reset': Let a = global(G_p_20). Let a_1 = havoc(Mint_undef_0, Mint_0, shift_S(a, 0), 20). Assume { Type: is_sint32(i_1). (* Goal *) When: (0 <= i) /\ (i <= 9). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (a_1[shiftfield_F1_S_g(shift_S(a, i_2))] = 2))). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (a_1[shiftfield_F1_S_f(shift_S(a, i_2))] = 1))). (* Invariant *) Have: (0 <= i_1) /\ (i_1 <= 10). (* Else *) Have: 10 <= i_1. } Prove: a_1[shiftfield_F1_S_f(shift_S(a, i))] = 1. ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/caveat_range.i, line 13) in 'reset': Let a = global(G_p_20). Let a_1 = havoc(Mint_undef_0, Mint_0, shift_S(a, 0), 20). Assume { Type: is_sint32(i_1). (* Goal *) When: (0 <= i) /\ (i <= 9). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (a_1[shiftfield_F1_S_g(shift_S(a, i_2))] = 2))). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i_1) -> (a_1[shiftfield_F1_S_f(shift_S(a, i_2))] = 1))). (* Invariant *) Have: (0 <= i_1) /\ (i_1 <= 10). (* Else *) Have: 10 <= i_1. } Prove: a_1[shiftfield_F1_S_g(shift_S(a, i))] = 2. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_usage/caveat_range.i, line 19): Let a = global(G_p_20). Let a_1 = havoc(Mint_undef_0, Mint_0, shift_S(a, 0), 20). Assume { Type: is_sint32(i) /\ is_sint32(1 + i). (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_1[shiftfield_F1_S_g(shift_S(a, i_1))] = 2))). (* Invariant *) Have: forall i_1 : Z. ((0 <= i_1) -> ((i_1 < i) -> (a_1[shiftfield_F1_S_f(shift_S(a, i_1))] = 1))). (* Invariant *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: (-1) <= i. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_usage/caveat_range.i, line 19): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_usage/caveat_range.i, line 20): Let a = global(G_p_20). Let a_1 = havoc(Mint_undef_0, Mint_0, shift_S(a, 0), 20). Assume { Type: is_sint32(i) /\ is_sint32(1 + i). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_1[shiftfield_F1_S_g(shift_S(a, i_2))] = 2))). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_1[shiftfield_F1_S_f(shift_S(a, i_2))] = 1))). (* Invariant *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: a_1[shiftfield_F1_S_f(shift_S(a, i)) <- 1] [shiftfield_F1_S_f(shift_S(a, i_1))] = 1. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_usage/caveat_range.i, line 20): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant (file tests/wp_usage/caveat_range.i, line 21): Let a = global(G_p_20). Let a_1 = havoc(Mint_undef_0, Mint_0, shift_S(a, 0), 20). Let a_2 = shift_S(a, i). Assume { Type: is_sint32(i) /\ is_sint32(1 + i). (* Goal *) When: (0 <= i_1) /\ (i_1 <= i). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_1[shiftfield_F1_S_g(shift_S(a, i_2))] = 2))). (* Invariant *) Have: forall i_2 : Z. ((0 <= i_2) -> ((i_2 < i) -> (a_1[shiftfield_F1_S_f(shift_S(a, i_2))] = 1))). (* Invariant *) Have: (0 <= i) /\ (i <= 10). (* Then *) Have: i <= 9. } Prove: a_1[shiftfield_F1_S_f(a_2) <- 1][shiftfield_F1_S_g(a_2) <- 2] [shiftfield_F1_S_g(shift_S(a, i_1))] = 2. ------------------------------------------------------------ Goal Establishment of Invariant (file tests/wp_usage/caveat_range.i, line 21): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/caveat_range.i, line 22) (1/3): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/caveat_range.i, line 22) (2/3): Effect at line 25 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/caveat_range.i, line 22) (3/3): Effect at line 26 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/caveat_range.i, line 14) in 'reset': Effect at line 24 Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'reset': /*@ behavior typed_caveat: requires \valid(p+(..)); */ void reset(struct S *p); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/code_spec.res.oracle����������������������0000666�0000000�0000000�00000004336�13571573400�024243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/code_spec.i (no preprocessing) [wp] Running WP plugin... [kernel] tests/wp_usage/code_spec.i:154: Warning: No code nor implicit assigns clause for function by_addr_in_spec, generating default assigns from the prototype [kernel] tests/wp_usage/code_spec.i:154: Warning: No code nor implicit assigns clause for function by_array_in_spec, generating default assigns from the prototype ................................................. ... Ref Usage ................................................. Init: { } Function no_access: { } Function by_value_in_code: { x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 y0 y1 y2 y3 y4 y5 y6 y7 y8 y9 z0 z1 z2 tab ptr x z } Function by_reference_in_code: { *p1 *p *qq } Function by_addr_in_code: { &x0 &s0 &tab &v1 &s2 &s3 } Function by_array_in_code: { p1[] p2[] p3[] p4[] p5[] ptr[] p[] q[] } Function by_value_in_code_annotation: { x1 x2 x3 x4 x5 x6 x7 x8 x9 tab v p q } Function by_reference_in_code_annotation: { *p1 *p2 *p3 *p4 *p5 *p6 *p } Function by_addr_in_code_annotation: { &x0 &s0 &tab } Function by_array_in_code_annotation: { p1[] p2[] p3[] p4[] p5[] ptr[] p[] q[] } Function by_value_in_spec: { x0 x1 p0 p1 p2 } Function by_reference_in_spec: { *p0 *p1 *p2 *p3 *p4 *p5 *p6 *p } Function by_addr_in_spec: { &x0 &s0 &tab } Function by_array_in_spec: { p1[] p2[] p3[] p4[] p5[] ptr[] p[] q[] } Function global_spec: { val *ref *ref_bis &addr array[] val_for_tab not_imported } Function params_spec: { not_imported val_arg0 &addr_arg0 val_arg1 val_arg2 val_arg3 *ref_arg1 *ref_arg2 *ref_arg3 array_arg1[] array_arg2[] array_arg3[] } Function global_and_param_spec: { not_imported val1 v } Function calling_spec: { val *ref *ref_bis &addr array[] val_for_tab val1 val0 &addr_val1 val_val2 val_val3 val_ref1 *ref_ref2 array_ref3[] v1 v2 v3 v4 val_array1 array_array2[] array_array3[] } Function cup: { val *ref &addr array[] &addr_value val_ref array_ref[] value_array } ................................................. [wp] Loading driver 'share/wp.driver' [wp] [CFG] Goal by_addr_in_code_annotation_requires : Valid (Unreachable) [wp] [CFG] Goal by_reference_in_code_annotation_no_exit_exits : Valid (Unreachable) [wp] Warning: Missing RTE guards [wp] No proof obligations ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/core.0.res.oracle�������������������������0000666�0000000�0000000�00000004530�13571573400�023401� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/core.i (no preprocessing) [kernel] tests/wp_usage/core.i:11: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_usage/core.i:24: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp_usage/core.i:20: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp_usage/core.i:17: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/core.i, line 12) in 'f': Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(c) /\ is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_3) /\ is_sint32(x_4). If a != 0 Then { Have: x_4 = x. } Else { Have: x_4 = x. } If b != 0 Then { Have: x_4 = x_3. } Else { Have: x_4 = x_3. } If c != 0 Then { Let x_5 = 1 + x_3. Have: x_5 = x_1. Have: (x_2 = x_1) /\ (x_5 = x_2). } Else { Have: x_5 = x_1. } } Prove: P_OBS(x, x_1). ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior default_for_stmt_15 ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/core.i, line 23) at instruction (file tests/wp_usage/core.i, line 24): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior default_for_stmt_4 ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/core.i, line 16) at instruction (file tests/wp_usage/core.i, line 17): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior default_for_stmt_9 ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/core.i, line 19) at instruction (file tests/wp_usage/core.i, line 20): Prove: true. ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/core.1.res.oracle�������������������������0000666�0000000�0000000�00000004050�13571573400�023377� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/core.i (no preprocessing) [kernel] tests/wp_usage/core.i:11: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_usage/core.i:24: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp_usage/core.i:20: Warning: Missing assigns clause (assigns 'everything' instead) [wp] tests/wp_usage/core.i:17: Warning: Missing assigns clause (assigns 'everything' instead) ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/core.i, line 12) in 'f': Let x_1 = 1 + x. Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(c) /\ is_sint32(x) /\ is_sint32(x_1). } Prove: P_OBS(x, x_1). ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior default_for_stmt_15 ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/core.i, line 23) at instruction (file tests/wp_usage/core.i, line 24): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior default_for_stmt_4 ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/core.i, line 16) at instruction (file tests/wp_usage/core.i, line 17): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function f with behavior default_for_stmt_9 ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/core.i, line 19) at instruction (file tests/wp_usage/core.i, line 20): Prove: true. ------------------------------------------------------------ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/global.0.res.oracle�����������������������0000666�0000000�0000000�00000002155�13571573400�023712� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Raw)' [...] [kernel] Parsing tests/wp_usage/global.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Assertion 'no_address_taken' (file tests/wp_usage/global.c, line 17): Let a = Mptr_0[global(P_a_21)]. Assume { (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rw(Malloc_0, a, 1). } Prove: a != global(G_GLOBAL_18). ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_usage/global.c, line 14) in 'foo'' in 'main' at call 'foo' (file tests/wp_usage/global.c, line 21) : Assume { (* Heap *) Have: linked(Malloc_0). } Prove: valid_rw(Malloc_0[L___retres_24 <- 1], global(G_GLOBAL_18), 1). ------------------------------------------------------------ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/global.1.res.oracle�����������������������0000666�0000000�0000000�00000001726�13571573400�023716� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed' [...] [kernel] Parsing tests/wp_usage/global.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Assertion 'no_address_taken' (file tests/wp_usage/global.c, line 17): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_usage/global.c, line 14) in 'foo'' in 'main' at call 'foo' (file tests/wp_usage/global.c, line 21) : Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'foo': /*@ behavior typed: requires \separated(&GLOBAL,a); */ void foo(int *a); ������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/global.2.res.oracle�����������������������0000666�0000000�0000000�00000001764�13571573400�023721� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Ref)' [...] [kernel] Parsing tests/wp_usage/global.c (with preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function foo ------------------------------------------------------------ Goal Assertion 'no_address_taken' (file tests/wp_usage/global.c, line 17): Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function main ------------------------------------------------------------ Goal Instance of 'Pre-condition (file tests/wp_usage/global.c, line 14) in 'foo'' in 'main' at call 'foo' (file tests/wp_usage/global.c, line 21) : Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'foo': /*@ behavior typed_ref: requires \separated(a,&GLOBAL); requires \valid(a); */ void foo(int *a); ������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/issue-189-bis.0.res.oracle����������������0000666�0000000�0000000�00000034611�13571573400�024676� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/issue-189-bis.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function memcpy_alias_vars ------------------------------------------------------------ Goal Post-condition 'memcpy' in 'memcpy_alias_vars': Let a = Mptr_0[global(P_src_22)]. Let a_1 = Mptr_0[global(P_dst_23)]. Let a_2 = shift_uint8(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, len_0). Let a_4 = shift_uint8(a, 0). Assume { Type: is_sint32(len_0) /\ is_sint32(len_1). (* Goal *) When: (0 <= i) /\ ((2 + i) <= len_0). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_4, len_0) /\ valid_rw(Malloc_0, a_2, len_0) /\ separated(a_2, len_0, a_4, len_0). (* Invariant 'cpy' *) Have: forall i_1 : Z. ((0 <= i_1) -> (((len_1 + i_1) < len_0) -> (a_3[shift_uint8(a, i_1)] = a_3[shift_uint8(a_1, i_1)]))). (* Invariant 'dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(v, len_1). (* Invariant 'src' *) Have: shift_uint8(a, len_0) = shift_uint8(v_1, len_1). (* Invariant 'len' *) Have: len_1 <= len_0. (* Else *) Have: len_1 <= 0. } Prove: a_3[shift_uint8(a_1, i)] = Mint_0[shift_uint8(a, i)]. ------------------------------------------------------------ Goal Post-condition 'unmodified' in 'memcpy_alias_vars': Let a = Mptr_0[global(P_src_22)]. Let a_1 = Mptr_0[global(P_dst_23)]. Let a_2 = shift_uint8(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, len_0). Let a_4 = shift_uint8(a, 0). Let a_5 = shift_uint8(a, i). Assume { Type: is_sint32(len_0) /\ is_sint32(len_1). (* Goal *) When: (0 <= i) /\ ((2 + i) <= len_0). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_4, len_0) /\ valid_rw(Malloc_0, a_2, len_0) /\ separated(a_2, len_0, a_4, len_0). (* Invariant 'cpy' *) Have: forall i_1 : Z. ((0 <= i_1) -> (((len_1 + i_1) < len_0) -> (a_3[shift_uint8(a, i_1)] = a_3[shift_uint8(a_1, i_1)]))). (* Invariant 'dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(v, len_1). (* Invariant 'src' *) Have: shift_uint8(a, len_0) = shift_uint8(v_1, len_1). (* Invariant 'len' *) Have: len_1 <= len_0. (* Else *) Have: len_1 <= 0. } Prove: a_3[a_5] = Mint_0[a_5]. ------------------------------------------------------------ Goal Preservation of Invariant 'cpy' (file tests/wp_usage/issue-189-bis.i, line 27): Let a = Mptr_0[global(P_src_22)]. Let a_1 = Mptr_0[global(P_dst_23)]. Let a_2 = shift_uint8(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, len_0). Let a_4 = shift_uint8(a, 0). Let a_5 = a_3[v <- a_3[v_1]]. Assume { Type: is_sint32(len_0) /\ is_sint32(len_1) /\ is_sint32(len_1 - 1). (* Goal *) When: (0 <= i) /\ ((i + len_1) <= len_0). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_4, len_0) /\ valid_rw(Malloc_0, a_2, len_0) /\ separated(a_2, len_0, a_4, len_0). (* Invariant 'cpy' *) Have: forall i_1 : Z. ((0 <= i_1) -> (((len_1 + i_1) < len_0) -> (a_3[shift_uint8(a, i_1)] = a_3[shift_uint8(a_1, i_1)]))). (* Invariant 'dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(v, len_1). (* Invariant 'src' *) Have: shift_uint8(a, len_0) = shift_uint8(v_1, len_1). (* Invariant 'len' *) Have: len_1 <= len_0. (* Then *) Have: 0 < len_1. } Prove: a_5[shift_uint8(a, i)] = a_5[shift_uint8(a_1, i)]. ------------------------------------------------------------ Goal Establishment of Invariant 'cpy' (file tests/wp_usage/issue-189-bis.i, line 27): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'dst' (file tests/wp_usage/issue-189-bis.i, line 25): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'dst' (file tests/wp_usage/issue-189-bis.i, line 25): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'len' (file tests/wp_usage/issue-189-bis.i, line 23): Let a = Mptr_0[global(P_src_22)]. Let a_1 = Mptr_0[global(P_dst_23)]. Let a_2 = shift_uint8(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, len_1). Let a_4 = shift_uint8(a, 0). Assume { Type: is_sint32(len_1) /\ is_sint32(len_0) /\ is_sint32(len_0 - 1). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_4, len_1) /\ valid_rw(Malloc_0, a_2, len_1) /\ separated(a_2, len_1, a_4, len_1). (* Invariant 'cpy' *) Have: forall i : Z. ((0 <= i) -> (((len_0 + i) < len_1) -> (a_3[shift_uint8(a, i)] = a_3[shift_uint8(a_1, i)]))). (* Invariant 'dst' *) Have: shift_uint8(a_1, len_1) = shift_uint8(v, len_0). (* Invariant 'src' *) Have: shift_uint8(a, len_1) = shift_uint8(v_1, len_0). (* Invariant 'len' *) Have: len_0 <= len_1. (* Then *) Have: 0 < len_0. } Prove: len_0 <= (1 + len_1). ------------------------------------------------------------ Goal Establishment of Invariant 'len' (file tests/wp_usage/issue-189-bis.i, line 23): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'src' (file tests/wp_usage/issue-189-bis.i, line 24): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'src' (file tests/wp_usage/issue-189-bis.i, line 24): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 26) (1/4): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 26) (2/4): Effect at line 32 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 26) (3/4): Effect at line 32 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 26) (4/4): Effect at line 32 Let a = global(P_src_22). Let a_1 = Mptr_0[a]. Let a_2 = global(P_dst_23). Let a_3 = Mptr_0[a_2]. Let a_4 = shift_uint8(a_3, 0). Let a_5 = havoc(Mint_undef_0, Mint_0, a_4, len_0). Let a_6 = shift_uint8(a_1, 0). Assume { Type: is_sint32(len_0) /\ is_sint32(len_1). (* Goal *) When: !invalid(Malloc_0[P_src_22 <- 1][P_dst_23 <- 1], v, 1). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_6, len_0) /\ valid_rw(Malloc_0, a_4, len_0) /\ separated(a_4, len_0, a_6, len_0). (* Invariant 'cpy' *) Have: forall i : Z. ((0 <= i) -> (((len_1 + i) < len_0) -> (a_5[shift_uint8(a_1, i)] = a_5[shift_uint8(a_3, i)]))). (* Invariant 'dst' *) Have: shift_uint8(a_3, len_0) = shift_uint8(v, len_1). (* Invariant 'src' *) Have: shift_uint8(a_1, len_0) = shift_uint8(v_1, len_1). (* Invariant 'len' *) Have: len_1 <= len_0. (* Then *) Have: 0 < len_1. } Prove: (a_2 = v) \/ (a = v) \/ included(v, 1, a_4, len_0). ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/issue-189-bis.i, line 18) in 'memcpy_alias_vars': Effect at line 31 Prove: true. ------------------------------------------------------------ ------------------------------------------------------------ Function memcpy_context_vars ------------------------------------------------------------ Goal Post-condition 'memcpy,ok' in 'memcpy_context_vars': Let a = Mptr_0[global(P_src_45)]. Let a_1 = Mptr_0[global(P_dst_46)]. Let a_2 = shift_uint8(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, len_0). Let a_4 = shift_uint8(a, 0). Assume { Type: is_sint32(len_0) /\ is_sint32(len_1). (* Goal *) When: (0 <= i) /\ ((2 + i) <= len_0). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_4, len_0) /\ valid_rw(Malloc_0, a_2, len_0) /\ separated(a_2, len_0, a_4, len_0). (* Invariant 'ok,cpy' *) Have: forall i_1 : Z. ((0 <= i_1) -> (((len_1 + i_1) < len_0) -> (a_3[shift_uint8(a, i_1)] = a_3[shift_uint8(a_1, i_1)]))). (* Invariant 'ok,dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(dst2_0, len_1). (* Invariant 'ok,src' *) Have: shift_uint8(a, len_0) = shift_uint8(src2_0, len_1). (* Invariant 'ok,len' *) Have: len_1 <= len_0. (* Else *) Have: len_1 <= 0. } Prove: a_3[shift_uint8(a_1, i)] = Mint_0[shift_uint8(a, i)]. ------------------------------------------------------------ Goal Post-condition 'unmodified,ok' in 'memcpy_context_vars': Let a = Mptr_0[global(P_src_45)]. Let a_1 = Mptr_0[global(P_dst_46)]. Let a_2 = shift_uint8(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, len_0). Let a_4 = shift_uint8(a, 0). Let a_5 = shift_uint8(a, i). Assume { Type: is_sint32(len_0) /\ is_sint32(len_1). (* Goal *) When: (0 <= i) /\ ((2 + i) <= len_0). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_4, len_0) /\ valid_rw(Malloc_0, a_2, len_0) /\ separated(a_2, len_0, a_4, len_0). (* Invariant 'ok,cpy' *) Have: forall i_1 : Z. ((0 <= i_1) -> (((len_1 + i_1) < len_0) -> (a_3[shift_uint8(a, i_1)] = a_3[shift_uint8(a_1, i_1)]))). (* Invariant 'ok,dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(dst2_0, len_1). (* Invariant 'ok,src' *) Have: shift_uint8(a, len_0) = shift_uint8(src2_0, len_1). (* Invariant 'ok,len' *) Have: len_1 <= len_0. (* Else *) Have: len_1 <= 0. } Prove: a_3[a_5] = Mint_0[a_5]. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,cpy' (file tests/wp_usage/issue-189-bis.i, line 55): Let a = Mptr_0[global(P_src_45)]. Let a_1 = Mptr_0[global(P_dst_46)]. Let a_2 = shift_uint8(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, len_0). Let a_4 = shift_uint8(a, 0). Let a_5 = a_3[dst2_0 <- a_3[src2_0]]. Assume { Type: is_sint32(len_0) /\ is_sint32(len_1) /\ is_sint32(len_1 - 1). (* Goal *) When: (0 <= i) /\ ((i + len_1) <= len_0). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_4, len_0) /\ valid_rw(Malloc_0, a_2, len_0) /\ separated(a_2, len_0, a_4, len_0). (* Invariant 'ok,cpy' *) Have: forall i_1 : Z. ((0 <= i_1) -> (((len_1 + i_1) < len_0) -> (a_3[shift_uint8(a, i_1)] = a_3[shift_uint8(a_1, i_1)]))). (* Invariant 'ok,dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(dst2_0, len_1). (* Invariant 'ok,src' *) Have: shift_uint8(a, len_0) = shift_uint8(src2_0, len_1). (* Invariant 'ok,len' *) Have: len_1 <= len_0. (* Then *) Have: 0 < len_1. } Prove: a_5[shift_uint8(a, i)] = a_5[shift_uint8(a_1, i)]. ------------------------------------------------------------ Goal Establishment of Invariant 'ok,cpy' (file tests/wp_usage/issue-189-bis.i, line 55): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,dst' (file tests/wp_usage/issue-189-bis.i, line 53): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'ok,dst' (file tests/wp_usage/issue-189-bis.i, line 53): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,len' (file tests/wp_usage/issue-189-bis.i, line 51): Let a = Mptr_0[global(P_src_45)]. Let a_1 = Mptr_0[global(P_dst_46)]. Let a_2 = shift_uint8(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, len_1). Let a_4 = shift_uint8(a, 0). Assume { Type: is_sint32(len_1) /\ is_sint32(len_0) /\ is_sint32(len_0 - 1). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_4, len_1) /\ valid_rw(Malloc_0, a_2, len_1) /\ separated(a_2, len_1, a_4, len_1). (* Invariant 'ok,cpy' *) Have: forall i : Z. ((0 <= i) -> (((len_0 + i) < len_1) -> (a_3[shift_uint8(a, i)] = a_3[shift_uint8(a_1, i)]))). (* Invariant 'ok,dst' *) Have: shift_uint8(a_1, len_1) = shift_uint8(dst2_0, len_0). (* Invariant 'ok,src' *) Have: shift_uint8(a, len_1) = shift_uint8(src2_0, len_0). (* Invariant 'ok,len' *) Have: len_0 <= len_1. (* Then *) Have: 0 < len_0. } Prove: len_0 <= (1 + len_1). ------------------------------------------------------------ Goal Establishment of Invariant 'ok,len' (file tests/wp_usage/issue-189-bis.i, line 51): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,src' (file tests/wp_usage/issue-189-bis.i, line 52): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'ok,src' (file tests/wp_usage/issue-189-bis.i, line 52): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 54) (1/4): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 54) (2/4): Effect at line 60 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 54) (3/4): Effect at line 60 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 54) (4/4): Effect at line 60 Let a = Mptr_0[global(P_src_45)]. Let a_1 = Mptr_0[global(P_dst_46)]. Let a_2 = shift_uint8(a_1, 0). Let a_3 = havoc(Mint_undef_0, Mint_0, a_2, len_0). Let a_4 = shift_uint8(a, 0). Assume { Type: is_sint32(len_0) /\ is_sint32(len_1). (* Goal *) When: !invalid(Malloc_0[P_src_45 <- 1][P_dst_46 <- 1], tmp_0, 1). (* Heap *) Have: framed(Mptr_0) /\ linked(Malloc_0). (* Pre-condition *) Have: valid_rd(Malloc_0, a_4, len_0) /\ valid_rw(Malloc_0, a_2, len_0) /\ separated(a_2, len_0, a_4, len_0). (* Invariant 'ok,cpy' *) Have: forall i : Z. ((0 <= i) -> (((len_1 + i) < len_0) -> (a_3[shift_uint8(a, i)] = a_3[shift_uint8(a_1, i)]))). (* Invariant 'ok,dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(tmp_0, len_1). (* Invariant 'ok,src' *) Have: shift_uint8(a, len_0) = shift_uint8(src2_0, len_1). (* Invariant 'ok,len' *) Have: len_1 <= len_0. (* Then *) Have: 0 < len_1. } Prove: included(tmp_0, 1, a_2, len_0). ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/issue-189-bis.i, line 44) in 'memcpy_context_vars': Effect at line 59 Prove: true. ------------------------------------------------------------ �����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/issue-189-bis.1.res.oracle����������������0000666�0000000�0000000�00000013621�13571573400�024675� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/issue-189-bis.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards Goal Post-condition 'memcpy,ok' in 'memcpy_context_vars': Let a = global(G_src_45). Let a_1 = global(G_dst_46). Let a_2 = havoc(Mint_undef_0, Mint_0, shift_uint8(a_1, 0), len_0). Assume { Type: is_sint32(len_0) /\ is_sint32(len_1). (* Goal *) When: (0 <= i) /\ ((2 + i) <= len_0). (* Heap *) Have: linked(Malloc_0). (* Pre-condition *) Have: ((0 < len_0) -> (len_0 <= 1)). (* Invariant 'ok,cpy' *) Have: forall i_1 : Z. ((0 <= i_1) -> (((len_1 + i_1) < len_0) -> (a_2[shift_uint8(a_1, i_1)] = Mint_0[shift_uint8(a, i_1)]))). (* Invariant 'ok,dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(dst2_0, len_1). (* Invariant 'ok,src' *) Have: shift_uint8(a, len_0) = shift_uint8(src2_0, len_1). (* Invariant 'ok,len' *) Have: len_1 <= len_0. (* Else *) Have: len_1 <= 0. } Prove: a_2[shift_uint8(a_1, i)] = Mint_0[shift_uint8(a, i)]. ------------------------------------------------------------ Goal Post-condition 'unmodified,ok' in 'memcpy_context_vars': Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,cpy' (file tests/wp_usage/issue-189-bis.i, line 55): Let a = global(G_src_45). Let a_1 = global(G_dst_46). Let a_2 = havoc(Mint_undef_0, Mint_0, shift_uint8(a_1, 0), len_0). Let a_3 = a_2[dst2_0 <- a_2[src2_0]]. Assume { Type: is_sint32(len_0) /\ is_sint32(len_1) /\ is_sint32(len_1 - 1). (* Goal *) When: (0 <= i) /\ ((i + len_1) <= len_0). (* Heap *) Have: linked(Malloc_0). (* Pre-condition *) Have: ((0 < len_0) -> (len_0 <= 1)). (* Invariant 'ok,cpy' *) Have: forall i_1 : Z. ((0 <= i_1) -> (((len_1 + i_1) < len_0) -> (a_2[shift_uint8(a_1, i_1)] = Mint_0[shift_uint8(a, i_1)]))). (* Invariant 'ok,dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(dst2_0, len_1). (* Invariant 'ok,src' *) Have: shift_uint8(a, len_0) = shift_uint8(src2_0, len_1). (* Invariant 'ok,len' *) Have: len_1 <= len_0. (* Then *) Have: 0 < len_1. } Prove: a_3[shift_uint8(a, i)] = a_3[shift_uint8(a_1, i)]. ------------------------------------------------------------ Goal Establishment of Invariant 'ok,cpy' (file tests/wp_usage/issue-189-bis.i, line 55): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,dst' (file tests/wp_usage/issue-189-bis.i, line 53): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'ok,dst' (file tests/wp_usage/issue-189-bis.i, line 53): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,len' (file tests/wp_usage/issue-189-bis.i, line 51): Let a = global(G_src_45). Let a_1 = global(G_dst_46). Assume { Type: is_sint32(len_1) /\ is_sint32(len_0) /\ is_sint32(len_0 - 1). (* Heap *) Have: linked(Malloc_0). (* Pre-condition *) Have: ((0 < len_1) -> (len_1 <= 1)). (* Invariant 'ok,cpy' *) Have: forall i : Z. ((0 <= i) -> (((len_0 + i) < len_1) -> (havoc(Mint_undef_0, Mint_0, shift_uint8(a_1, 0), len_1) [shift_uint8(a_1, i)] = Mint_0[shift_uint8(a, i)]))). (* Invariant 'ok,dst' *) Have: shift_uint8(a_1, len_1) = shift_uint8(dst2_0, len_0). (* Invariant 'ok,src' *) Have: shift_uint8(a, len_1) = shift_uint8(src2_0, len_0). (* Invariant 'ok,len' *) Have: len_0 <= len_1. (* Then *) Have: 0 < len_0. } Prove: len_0 <= (1 + len_1). ------------------------------------------------------------ Goal Establishment of Invariant 'ok,len' (file tests/wp_usage/issue-189-bis.i, line 51): Prove: true. ------------------------------------------------------------ Goal Preservation of Invariant 'ok,src' (file tests/wp_usage/issue-189-bis.i, line 52): Prove: true. ------------------------------------------------------------ Goal Establishment of Invariant 'ok,src' (file tests/wp_usage/issue-189-bis.i, line 52): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 54) (1/4): Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 54) (2/4): Effect at line 60 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 54) (3/4): Effect at line 60 Prove: true. ------------------------------------------------------------ Goal Loop assigns (file tests/wp_usage/issue-189-bis.i, line 54) (4/4): Effect at line 60 Let a = global(G_src_45). Let a_1 = global(G_dst_46). Let a_2 = shift_uint8(a_1, 0). Assume { Type: is_sint32(len_0) /\ is_sint32(len_1). (* Goal *) When: !invalid(Malloc_0, tmp_0, 1). (* Heap *) Have: linked(Malloc_0). (* Pre-condition *) Have: ((0 < len_0) -> (len_0 <= 1)). (* Invariant 'ok,cpy' *) Have: forall i : Z. ((0 <= i) -> (((len_1 + i) < len_0) -> (havoc(Mint_undef_0, Mint_0, a_2, len_0)[shift_uint8(a_1, i)] = Mint_0[shift_uint8(a, i)]))). (* Invariant 'ok,dst' *) Have: shift_uint8(a_1, len_0) = shift_uint8(tmp_0, len_1). (* Invariant 'ok,src' *) Have: shift_uint8(a, len_0) = shift_uint8(src2_0, len_1). (* Invariant 'ok,len' *) Have: len_1 <= len_0. (* Then *) Have: 0 < len_1. } Prove: included(tmp_0, 1, a_2, len_0). ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/issue-189-bis.i, line 44) in 'memcpy_context_vars': Effect at line 59 Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'memcpy_context_vars': /*@ behavior typed: requires \separated(src,dst); requires \valid(src); requires \valid(dst); */ void memcpy_context_vars(unsigned char *src, unsigned char *dst, int len); ���������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/issue-189.0.res.oracle��������������������0000666�0000000�0000000�00000001203�13571573400�024112� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/issue-189.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/issue-189.i, line 14) in 'f' (1/2): Effect at line 17 Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/issue-189.i, line 14) in 'f' (2/2): Effect at line 18 Prove: true. ------------------------------------------------------------ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/issue-189.1.res.oracle��������������������0000666�0000000�0000000�00000001466�13571573400�024126� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_usage/issue-189.i (no preprocessing) [wp] Running WP plugin... ................................................. ... Ref Usage ................................................. Init: { } Function f: { *ptr src idx } ................................................. [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_usage/issue-189.i:17: Warning: forbidden write to variable 'src' considered in an isolated context. Use model 'Typed' instead or specify '-wp-unalias-vars src' [wp] tests/wp_usage/issue-189.i:17: User Error: forbidden assigns to variable 'src' considered in an isolated context. Use model 'Typed' instead or specify '-wp-unalias-vars src' [kernel] Plug-in wp aborted: invalid user input. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/issue-189.2.res.oracle��������������������0000666�0000000�0000000�00000002057�13571573400�024124� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_usage/issue-189.i (no preprocessing) [wp] Running WP plugin... ................................................. ... Ref Usage ................................................. Init: { } Function f: { *ptr src idx } ................................................. [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/issue-189.i, line 14) in 'f' (1/2): Prove: true. ------------------------------------------------------------ Goal Assigns (file tests/wp_usage/issue-189.i, line 14) in 'f' (2/2): Effect at line 17 Prove: true. ------------------------------------------------------------ [wp] Warning: Memory model hypotheses for function 'f': /*@ behavior typed_caveat: requires \separated(ptr,src); requires \valid(ptr); */ void f(char *ptr, char const *src, unsigned int idx); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/reads.res.oracle��������������������������0000666�0000000�0000000�00000001345�13571573400�023412� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/reads.i (no preprocessing) [wp] Running WP plugin... [kernel] tests/wp_usage/reads.i:86: Warning: No code nor implicit assigns clause for function recursive_usage, generating default assigns from the prototype ................................................. ... Ref Usage ................................................. Init: { } Function f: { x y } Function g: { u v } Function modifies_y: { x y } Function modifies_x: { x y } Function declared_equals_x: { x p } Function defined_equals_x: { x p } Function recursive_usage: { x y b } ................................................. [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] No proof obligations �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/save_load.0.res.oracle��������������������0000666�0000000�0000000�00000000441�13571573400�024403� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Warning: ignoring source files specified on the command line while loading a global initial context. /* Generated by Frama-C */ /*@ ensures \old(a) + \old(b) > 0; */ int f(int a, int b, int c) { int __retres; if (c) a ++; else b --; __retres = a + b; return __retres; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/save_load.1.res.oracle��������������������0000666�0000000�0000000�00000001150�13571573400�024402� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Warning: ignoring source files specified on the command line while loading a global initial context. [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/save_load.i, line 16) in 'f': Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(b_1) /\ is_sint32(c). If c != 0 Then { Have: b_1 = b. } Else { Have: (1 + b_1) = b. } } Prove: 0 < (a + b). ------------------------------------------------------------ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/save_load.sav.err�������������������������0000666�0000000�0000000�00000000000�13571573400�023557� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/save_load.sav.res�������������������������0000666�0000000�0000000�00000001132�13571573400�023567� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/wp_usage/save_load.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function f ------------------------------------------------------------ Goal Post-condition (file tests/wp_usage/save_load.i, line 16) in 'f': Assume { Type: is_sint32(a) /\ is_sint32(b) /\ is_sint32(b_1) /\ is_sint32(c). If c != 0 Then { Have: b_1 = b. } Else { Have: (1 + b_1) = b. } } Prove: 0 < (a + b). ------------------------------------------------------------ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle/valinit.res.oracle������������������������0000666�0000000�0000000�00000001031�13571573400�023752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/valinit.i (no preprocessing) [wp] Running WP plugin... ................................................. ... Ref Usage ................................................. Init: { &y0 z0 x1 &y1 z1 q0 q1 p1 &a0 a1 s0 &v0 w0 s1 s2 s3 s4 s5 s6 } Function f: { &ly0 lz0 lx1 &ly1 lz1 lq0 lq1 lp1 &la0 la1 ls0 &lv0 lw0 ls1 ls2 ls3 ls4 ls5 ls6 } ................................................. [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] No proof obligations �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/�����������������������������������0000777�0000000�0000000�00000000000�13571573400�021673� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.0.session/�����������������0000777�0000000�0000000�00000000000�13571573400�025040� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.0.session/cache/�����������0000777�0000000�0000000�00000000000�13571573400�026103� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.0.session/cache/80f6701d0f80b164f372e92eff639c54.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.0.session/cache/80f6701d0f80000666�0000000�0000000�00000000127�13571573400�027423� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0149, "steps": 17 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.0.session/cache/ba6ce636da22fa507f53e0946883c712.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.0.session/cache/ba6ce636da20000666�0000000�0000000�00000000126�13571573400�027633� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.025, "steps": 21 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000177�00000000000�010000� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.0.session/cache/eceb5a78bf7fdc3bd9778841c5280885.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.0.session/cache/eceb5a78bf70000666�0000000�0000000�00000000127�13571573400�027730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0232, "steps": 24 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.i.0.report.json������������0000666�0000000�0000000�00000006412�13571573400�026015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "alt-ergo": { "total": 3, "valid": 3, "rank": 6 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 9, "valid": 9, "rank": 6 } }, "wp:functions": { "job": { "job_loop_invariant_2": { "alt-ergo": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "job_loop_invariant": { "alt-ergo": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "job_assigns": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "job_loop_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "job_ensures_A": { "alt-ergo": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "job_ensures_N": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "wp:section": { "alt-ergo": { "total": 3, "valid": 3, "rank": 6 }, "qed": { "total": 6, "valid": 6 }, "wp:main": { "total": 9, "valid": 9, "rank": 6 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat2.res.oracle�����������������0000666�0000000�0000000�00000003031�13571573400�025174� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_usage/caveat2.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] tests/wp_usage/caveat2.i:22: Warning: Undefined array-size (sint32[]) [wp] 9 goals scheduled [wp] [Qed] Goal typed_caveat_job_ensures_N : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_job_ensures_A : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_job_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_caveat_job_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_job_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_caveat_job_loop_invariant_2_established : Valid [wp] [Qed] Goal typed_caveat_job_loop_assigns : Valid [wp] [Qed] Goal typed_caveat_job_assigns_part1 : Valid [wp] [Qed] Goal typed_caveat_job_assigns_part2 : Valid [wp] Proved goals: 9 / 9 Qed: 6 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_usage/oracle_qualif/caveat2.0.report.json' [wp] Report out: 'tests/wp_usage/result_qualif/caveat2.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success job 6 3 (20..32) 9 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'job': /*@ behavior typed_caveat: requires \separated(p,b+(..)); requires \valid(p); requires \valid(b+(..)); */ void job(struct S *p, int n, int *b); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/������������0000777�0000000�0000000�00000000000�13571573400�026132� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/������0000777�0000000�0000000�00000000000�13571573400�027175� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/61be9475652004f8c05d1ea28f06fa09.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/61be940000666�0000000�0000000�00000000127�13571573400�030032� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0241, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/ae856774bc866a2144d8ffd2d286403f.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/ae85670000666�0000000�0000000�00000000127�13571573400�030037� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0491, "steps": 48 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/c2a508f6e1261d3b62db019669a4950d.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/c2a5080000666�0000000�0000000�00000000127�13571573400�030022� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0258, "steps": 20 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/ca384e03c7946b821ae8da538e1f6623.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/ca384e0000666�0000000�0000000�00000000127�13571573400�030107� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0187, "steps": 14 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000204�00000000000�007767� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/dc427c170a23ffc4f55bc2c62e565f39.json���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.0.session/cache/dc427c0000666�0000000�0000000�00000000127�13571573400�030106� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0318, "steps": 28 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.i.0.report.json�������0000666�0000000�0000000�00000011046�13571573400�027106� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 12 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 12, "valid": 12, "rank": 13 } }, "wp:functions": { "reset": { "reset_loop_invariant_3": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 12 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 13 } }, "reset_loop_invariant_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 7 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 7 } }, "reset_loop_invariant": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 3 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 3 } }, "reset_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "reset_loop_assigns": { "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 3, "valid": 3 } }, "reset_ensures_2": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "reset_ensures": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 5 }, "wp:main": { "total": 1, "valid": 1, "rank": 5 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 12 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 12, "valid": 12, "rank": 13 } } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/caveat_range.res.oracle������������0000666�0000000�0000000�00000003177�13571573400�026301� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp -wp-model 'Typed (Caveat)' [...] [kernel] Parsing tests/wp_usage/caveat_range.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 12 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_reset_ensures : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_reset_ensures_2 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_reset_loop_invariant_preserved : Valid [wp] [Qed] Goal typed_caveat_reset_loop_invariant_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_reset_loop_invariant_2_preserved : Valid [wp] [Qed] Goal typed_caveat_reset_loop_invariant_2_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_caveat_reset_loop_invariant_3_preserved : Valid [wp] [Qed] Goal typed_caveat_reset_loop_invariant_3_established : Valid [wp] [Qed] Goal typed_caveat_reset_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_caveat_reset_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_caveat_reset_loop_assigns_part3 : Valid [wp] [Qed] Goal typed_caveat_reset_assigns : Valid [wp] Proved goals: 12 / 12 Qed: 7 Alt-Ergo 2.0.0: 5 [wp] Report in: 'tests/wp_usage/oracle_qualif/caveat_range.0.report.json' [wp] Report out: 'tests/wp_usage/result_qualif/caveat_range.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success reset 7 5 (44..56) 12 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'reset': /*@ behavior typed_caveat: requires \valid(p+(..)); */ void reset(struct S *p); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.res.oracle���������0000666�0000000�0000000�00000005765�13571573400�026247� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/issue-189-bis.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 30 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_alias_vars_ensures_memcpy : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_alias_vars_ensures_unmodified : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_alias_vars_loop_invariant_cpy_preserved : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_loop_invariant_cpy_established : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_loop_invariant_dst_preserved : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_loop_invariant_dst_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_alias_vars_loop_invariant_len_preserved : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_loop_invariant_len_established : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_loop_invariant_src_preserved : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_loop_invariant_src_established : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_loop_assigns_part3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_alias_vars_loop_assigns_part4 : Valid [wp] [Qed] Goal typed_memcpy_alias_vars_assigns : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_context_vars_ensures_memcpy_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_context_vars_ensures_unmodified_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_context_vars_loop_invariant_ok_cpy_preserved : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_cpy_established : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_dst_preserved : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_dst_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_context_vars_loop_invariant_ok_len_preserved : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_len_established : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_src_preserved : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_src_established : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_assigns_part1 : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_assigns_part2 : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_assigns_part3 : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_context_vars_loop_assigns_part4 : Valid [wp] [Qed] Goal typed_memcpy_context_vars_assigns : Valid [wp] Proved goals: 30 / 30 Qed: 20 Alt-Ergo 2.0.0: 10 [wp] Report in: 'tests/wp_usage/oracle_qualif/issue-189-bis.0.report.json' [wp] Report out: 'tests/wp_usage/result_qualif/issue-189-bis.0.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success memcpy_alias_vars 10 5 (960..1152) 15 100% memcpy_context_vars 10 5 (960..1152) 15 100% ------------------------------------------------------------- �����������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/�����������0000777�0000000�0000000�00000000000�13571573400�025735� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/�����0000777�0000000�0000000�00000000000�13571573400�027000� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/00e94c6d1cb55703ffda9fab29b813b9.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/00e940000666�0000000�0000000�00000000130�13571573400�027456� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0679, "steps": 104 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/0bd1df0d0b2e1f1f6c86a11c4e3e7667.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/0bd1d0000666�0000000�0000000�00000000127�13571573400�027615� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1051, "steps": 95 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/1c5283d37d5a9530667280d4393f3269.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/1c5280000666�0000000�0000000�00000000130�13571573400�027457� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0908, "steps": 104 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/2e194c88ad379ec85c89d67c01925c2b.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/2e1940000666�0000000�0000000�00000000127�13571573400�027467� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0229, "steps": 22 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/56872fc33e8d31ec1a10fc59a5c51a39.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/568720000666�0000000�0000000�00000000130�13571573400�027410� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1045, "steps": 173 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/5b73230c42aef6290641f873c8e5187e.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/5b7320000666�0000000�0000000�00000000126�13571573400�027464� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.019, "steps": 22 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/bbc123de2b09fb50167cd299a220cf86.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/bbc120000666�0000000�0000000�00000000131�13571573400�027607� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.1764, "steps": 1031 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/e62e3d018c328d46bb7dffa103c2ba6b.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/e62e30000666�0000000�0000000�00000000131�13571573400�027542� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 1.2327, "steps": 1031 } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/e727bb5e1f0ab34c9f6384bba69e291c.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/e727b0000666�0000000�0000000�00000000130�13571573400�027543� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1119, "steps": 173 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/ed06e9d81948ded2110fb079a2394279.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.0.session/cache/ed06e0000666�0000000�0000000�00000000127�13571573400�027626� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.1088, "steps": 97 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.1.res.oracle���������0000666�0000000�0000000�00000003375�13571573400�026243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# frama-c -wp [...] [kernel] Parsing tests/wp_usage/issue-189-bis.i (no preprocessing) [wp] Running WP plugin... [wp] Loading driver 'share/wp.driver' [wp] Warning: Missing RTE guards [wp] 10 goals scheduled [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_context_vars_ensures_memcpy_ok : Valid [wp] [Qed] Goal typed_memcpy_context_vars_ensures_unmodified_ok : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_context_vars_loop_invariant_ok_cpy_preserved : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_cpy_established : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_dst_preserved : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_dst_established : Valid [wp] [Alt-Ergo 2.0.0] Goal typed_memcpy_context_vars_loop_invariant_ok_len_preserved : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_len_established : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_src_preserved : Valid [wp] [Qed] Goal typed_memcpy_context_vars_loop_invariant_ok_src_established : Valid [wp] Proved goals: 10 / 10 Qed: 7 Alt-Ergo 2.0.0: 3 [wp] Report in: 'tests/wp_usage/oracle_qualif/issue-189-bis.1.report.json' [wp] Report out: 'tests/wp_usage/result_qualif/issue-189-bis.1.report.json' ------------------------------------------------------------- Functions WP Alt-Ergo Total Success memcpy_context_vars 7 3 (56..68) 10 100% ------------------------------------------------------------- [wp] Warning: Memory model hypotheses for function 'memcpy_context_vars': /*@ behavior typed: requires \separated(src,dst); requires \valid(src); requires \valid(dst); */ void memcpy_context_vars(unsigned char *src, unsigned char *dst, int len); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.1.session/�����������0000777�0000000�0000000�00000000000�13571573400�025736� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.1.session/cache/�����0000777�0000000�0000000�00000000000�13571573400�027001� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.1.session/cache/6eed7c883e5da5d9f84f96967729ed87.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.1.session/cache/6eed70000666�0000000�0000000�00000000127�13571573400�027636� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0675, "steps": 63 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.1.session/cache/7fdefda153070e31f7bfa7092643c211.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.1.session/cache/7fdef0000666�0000000�0000000�00000000127�13571573400�027717� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0218, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������././@LongLink���������������������������������������������������������������������������������������0000644�0000000�0000000�00000000205�00000000000�007770� L����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.1.session/cache/d54c81800e8bf82aee1e1baf74b4b696.json��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.1.session/cache/d54c80000666�0000000�0000000�00000000127�13571573400�027553� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0221, "steps": 18 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.i.0.report.json������0000666�0000000�0000000�00000023615�13571573400�026716� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 10, "valid": 10, "rank": 65 }, "qed": { "total": 20, "valid": 20 }, "wp:main": { "total": 30, "valid": 30, "rank": 65 } }, "wp:functions": { "memcpy_alias_vars": { "memcpy_alias_vars_loop_invariant_cpy": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 65 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 65 } }, "memcpy_alias_vars_loop_invariant_dst": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "memcpy_alias_vars_loop_invariant_src": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "memcpy_alias_vars_loop_invariant_len": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "memcpy_alias_vars_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "memcpy_alias_vars_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 21 } }, "memcpy_alias_vars_ensures_unmodified": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "wp:main": { "total": 1, "valid": 1, "rank": 21 } }, "memcpy_alias_vars_ensures_memcpy": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 31 }, "wp:main": { "total": 1, "valid": 1, "rank": 31 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 65 }, "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 15, "valid": 15, "rank": 65 } } }, "memcpy_context_vars": { "memcpy_context_vars_loop_invariant_ok_cpy": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 65 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 65 } }, "memcpy_context_vars_loop_invariant_ok_dst": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "memcpy_context_vars_loop_invariant_ok_src": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "memcpy_context_vars_loop_invariant_ok_len": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 6 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 6 } }, "memcpy_context_vars_assigns": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "memcpy_context_vars_loop_assigns": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 20 }, "qed": { "total": 3, "valid": 3 }, "wp:main": { "total": 4, "valid": 4, "rank": 20 } }, "memcpy_context_vars_ensures_unmodified_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 21 }, "wp:main": { "total": 1, "valid": 1, "rank": 21 } }, "memcpy_context_vars_ensures_memcpy_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 31 }, "wp:main": { "total": 1, "valid": 1, "rank": 31 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 5, "valid": 5, "rank": 65 }, "qed": { "total": 10, "valid": 10 }, "wp:main": { "total": 15, "valid": 15, "rank": 65 } } } } } �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/oracle_qualif/issue-189-bis.i.1.report.json������0000666�0000000�0000000�00000007754�13571573400�026725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "wp:global": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 15 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 10, "valid": 10, "rank": 15 } }, "wp:functions": { "memcpy_context_vars": { "memcpy_context_vars_loop_invariant_ok_cpy": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 15 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 15 } }, "memcpy_context_vars_loop_invariant_ok_dst": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "memcpy_context_vars_loop_invariant_ok_src": { "qed": { "total": 2, "valid": 2 }, "wp:main": { "total": 2, "valid": 2 } }, "memcpy_context_vars_loop_invariant_ok_len": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 2, "valid": 2, "rank": 4 } }, "memcpy_context_vars_ensures_unmodified_ok": { "qed": { "total": 1, "valid": 1 }, "wp:main": { "total": 1, "valid": 1 } }, "memcpy_context_vars_ensures_memcpy_ok": { "why3:Alt-Ergo,2.0.0": { "total": 1, "valid": 1, "rank": 4 }, "wp:main": { "total": 1, "valid": 1, "rank": 4 } }, "wp:section": { "why3:Alt-Ergo,2.0.0": { "total": 3, "valid": 3, "rank": 15 }, "qed": { "total": 7, "valid": 7 }, "wp:main": { "total": 10, "valid": 10, "rank": 15 } } } } } ��������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/reads.i������������������������������������������0000666�0000000�0000000�00000003123�13571573400�020334� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-prop none -wp-msg-key refusage */ /* run.config_qualif DONTRUN: */ // Test for implicit variables int x ; int y ; int *u ; int *v ; /*@ axiomatic A { @ predicate P(int *p,int *q)= *p <= *q ; @ predicate Q= x <= y ; @ } @ */ /*@ requires Q ; @ requires 0<=x<=10 ; @ requires 0<=y<=10 ; @ ensures qed_ok: Q ; @ */ void f(void) { x++; y++; } /*@ requires P(u,v) ; @ requires 0<=*u<=10 ; @ requires 0<=*v<=10 ; @ ensures qed_ok: P(u,v) ; @ */ void g(void) { (*u)++; (*v)++; } /*@ axiomatic S { @ predicate f{L} reads \nothing ; @ predicate g{L} reads x ; @ predicate h{L} reads x,y ; @ predicate w{L} ; @ } @*/ /*@ requires H: f && g && h && w ; @ ensures qed_ok: F_OK: f ; @ ensures qed_ok: G_OK: g ; @ ensures qed_ko: H_KO: h ; @ ensures qed_ok: W_OK: todo: w ; @ */ void modifies_y () { y++ ; } /*@ requires H: f && g && h && w ; @ ensures qed_ok: F_OK: f ; @ ensures qed_ko: G_KO: g ; @ ensures qed_ko: H_KO: h ; @ ensures qed_ok: W_OK: todo: w ; @ */ void modifies_x () { x++ ; } /*@ axiomatic E { @ predicate Declared_equals_x{L}(int * q) reads *q,x ; @ predicate Defined_equals_x{L}(int * q) = *q == x ; @ } @ */ /*@ assigns \nothing; @ ensures (\result == 1) <==> Declared_equals_x(p); @ */ int declared_equals_x (int *p); /*@ assigns \nothing; @ ensures (\result == 1) <==> Defined_equals_x(p); @ */ int defined_equals_x (int *p); /*@ axiomatic R { @ logic integer f_rec(integer a) = (a < 100) ? f_rec(a+1+y) : x ; @ } @ */ //@ ensures \result == f_rec(b); int recursive_usage(int b); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/save_load.i��������������������������������������0000666�0000000�0000000�00000001431�13571573400�021173� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config EXECNOW: LOG save_load.sav.res LOG save_load.sav.err BIN @PTEST_NAME@.sav @frama-c@ -no-autoload-plugins -load-module wp -wp-share ./share -wp -wp-print -wp-prover none @PTEST_FILE@ -save @PTEST_DIR@/@PTEST_NAME@.sav > @PTEST_DIR@/result/@PTEST_NAME@.sav.res 2> @PTEST_DIR@/result/@PTEST_NAME@.sav.err CMD: @frama-c@ -no-autoload-plugins -load-module wp -load @PTEST_DIR@/@PTEST_NAME@.sav OPT: -print OPT: -wp -wp-prover none -wp-print */ /* run.config_qualif DONTRUN: */ // Unprovable contract, just here to check the WP generation. // The test case 1 checks that save/load do not crash in presence of WP. // The test case 2 checks that WP still works after save/load. //@ ensures (a+b) > 0 ; int f(int a,int b,int c) { if (c) a++; else b--; return a+b; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/tests/wp_usage/valinit.i����������������������������������������0000666�0000000�0000000�00000001266�13571573400�020712� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -wp-prop none -wp-msg-key refusage */ /* run.config_qualif DONTRUN: */ int x0, y0, z0, *p0; int x1=1, y1=1, z1=z0, *q0=(int*)0, *q1=&y0, *p1=&y1; struct s { int c; int* cp; } ; int a0, a1; struct s s0, v0, w0; struct s s1=s0; struct s s2={1,(int*)0}; struct s s3={1,&a0}; struct s s4={a1,(int*)0}; struct s s5={1,&v0.c}; struct s s6={w0.c,(int*)0}; void f(void) { int lx0, ly0, lz0, *lp0; int lx1=1, ly1=1, lz1=lz0, *lq0=(int*)0, *lq1=&ly0, *lp1=&ly1; int la0, la1; struct s ls0, lv0, lw0; struct s ls1=ls0; struct s ls2={1,(int*)0}; struct s ls3={1,&la0}; struct s ls4={la1,(int*)0}; struct s ls5={1,&lv0.c}; struct s ls6={lw0.c,(int*)0}; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpAnnot.ml������������������������������������������������������0000666�0000000�0000000�00000160246�13571573400�016102� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let dkey = Wp_parameters.register_category "annot" (* debugging key *) let debug fmt = Wp_parameters.debug ~dkey fmt (* This file groups functions that extract some annotations * and associates them with CFG edges. *) open Cil_types open Cil_datatype (* -------------------------------------------------------------------------- *) (* --- Selection of relevant assigns and postconditions --- *) (* -------------------------------------------------------------------------- *) (* Properties for kf-conditions of termination-kind 'tkind' *) let get_called_postconds (tkind:termination_kind) kf = let bhvs = Annotations.behaviors kf in List.fold_left (fun properties bhv -> List.fold_left (fun properties postcond -> if tkind = fst postcond then let pid_spec = Property.ip_of_ensures kf Kglobal bhv postcond in pid_spec :: properties else properties) properties bhv.b_post_cond) [] bhvs let get_called_post_conditions = get_called_postconds Cil_types.Normal let get_called_exit_conditions = get_called_postconds Cil_types.Exits (** Properties for assigns of kf *) let get_called_assigns kf = let bhvs = Annotations.behaviors kf in List.fold_left (fun properties bhv -> if Cil.is_default_behavior bhv then match Property.ip_assigns_of_behavior kf Kglobal [] bhv with | None -> properties | Some ip -> ip :: properties else properties) [] bhvs (* -------------------------------------------------------------------------- *) (* --- Status of Unreachable Annotations --- *) (* -------------------------------------------------------------------------- *) let wp_unreachable = Emitter.create "Unreachable Annotations" [ Emitter.Property_status ] ~correctness:[] (* TBC *) ~tuning:[] (* TBC *) let set_unreachable pid = let open Property in let emit = function | IPPredicate {ip_kind = PKAssumes _} -> () | p -> debug "unreachable annotation %a@." Property.pretty p; Property_status.emit wp_unreachable ~hyps:[] p Property_status.True in let pids = match WpPropId.property_of_id pid with | IPPredicate {ip_kind = PKAssumes _} -> [] | IPBehavior {ib_kf; ib_kinstr; ib_active; ib_bhv} -> let active = Datatype.String.Set.elements ib_active in (ip_post_cond_of_behavior ib_kf ib_kinstr active ib_bhv) @ (ip_requires_of_behavior ib_kf ib_kinstr ib_bhv) | IPExtended _ -> [] (* Extended clauses might concern anything. Don't validate them unless we know exactly what is going on. *) | p -> Wp_parameters.result "[CFG] Goal %a : Valid (Unreachable)" WpPropId.pp_propid pid ; [p] in List.iter emit pids (*----------------------------------------------------------------------------*) (* Proofs *) (*----------------------------------------------------------------------------*) type proof = { target : Property.t ; proved : proofpart array ; mutable dependencies : Property.Set.t ; } and proofpart = | Noproof | Complete | Parts of Bitvector.t let target p = p.target let dependencies p = Property.Set.elements (Property.Set.remove p.target p.dependencies) let create_proof p = let n = WpPropId.subproofs p in { target = WpPropId.property_of_id p ; proved = Array.make n Noproof ; dependencies = Property.Set.empty ; } let add_proof pf p hs = begin if not (Property.equal (WpPropId.property_of_id p) pf.target) then Wp_parameters.fatal "Partial proof inconsistency" ; List.iter (fun iph -> if not (WpPropId.is_requires iph) then pf.dependencies <- Property.Set.add iph pf.dependencies ) hs ; let k = WpPropId.subproof_idx p in match WpPropId.parts_of_id p with | None -> pf.proved.(k) <- Complete | Some(p,n) -> match pf.proved.(k) with | Complete -> () | Noproof -> let bv = Bitvector.create n in Bitvector.set_range bv 0 (p-1) ; Bitvector.set_range bv (p+1) (n-1) ; pf.proved.(k) <- Parts bv | Parts bv -> Bitvector.clear bv p ; if Bitvector.is_empty bv then pf.proved.(k) <- Complete end let is_composed pf = Array.length pf.proved > 1 let is_proved pf = try Array.iter (fun r -> if r<>Complete then raise Exit) pf.proved ; true with Exit -> false (* -------------------------------------------------------------------------- *) (* --- PID for Functions --- *) (* -------------------------------------------------------------------------- *) let mk_call_pre_id called_kf bhv s_call called_pre = (* TODOclean : quite dirty here ! *) let id = WpPropId.mk_pre_id called_kf Kglobal bhv called_pre in let called_pre = WpPropId.property_of_id id in let called_pre_p = Statuses_by_call.precondition_at_call called_kf called_pre s_call in WpPropId.mk_call_pre_id called_kf s_call called_pre called_pre_p (* -------------------------------------------------------------------------- *) (* --- Preconditions --- *) (* -------------------------------------------------------------------------- *) let call_preconditions = Statuses_by_call.all_call_preconditions_at ~warn_missing:true (* Preconditions at call-point as WpPropId.t *) let preconditions_at_call s = function | Cil2cfg.Static kf -> let preconds = call_preconditions kf s in let aux (pre, pre_call) = WpPropId.mk_call_pre_id kf s pre pre_call in List.map aux preconds | Cil2cfg.Dynamic _ -> [] let get_called_preconditions_at kf stmt = List.map snd (call_preconditions kf stmt) (* -------------------------------------------------------------------------- *) (* --- Prop Splitter --- *) (* -------------------------------------------------------------------------- *) (* prop-id splitter *) let split job pid goals = let n = Bag.length goals in if n <= 1 then Bag.iter (job pid) goals else let k = ref 0 in Bag.iter (fun g -> let pid_k = WpPropId.mk_part pid (!k,n) in incr k ; job pid_k g) goals (*----------------------------------------------------------------------------*) (* Strategy and annotations *) (*----------------------------------------------------------------------------*) (* This is to code what kind of properties we want to process. *) type asked_assigns = NoAssigns | OnlyAssigns | WithAssigns (* This is to code which behavior the computed strategy refers to. *) type asked_bhv = | FunBhv of funbehavior option (* None means default behavior when the function has no spec. This is useful to process internal properties even if the function has no default behavior *) | StmtBhv of Cil2cfg.node * stmt * Datatype.String.Set.t * funbehavior let name_of_asked_bhv = function | FunBhv (Some bhv) -> bhv.b_name | FunBhv None -> Cil.default_behavior_name | StmtBhv (_, _, _, bhv) -> bhv.b_name let asked_bhv = function | FunBhv None -> None | FunBhv (Some bhv) | StmtBhv (_,_,_,bhv) -> Some bhv.b_name (* This is to code what properties the user asked for in a given behavior. *) type asked_prop = | AllProps | NamedProp of string list | IdProp of Property.t | CallPre of stmt * Property.t option (** No specified property means all *) (* a table to keep the information about the statement default specification * associated with each edge in order to know in which strategy we should put a * default annotation on this edge. When an edge has no information in the table, * it means that the edge annotations belong to the [FunBhv] default behavior; * and when we find a statement [s], it means that they belong to the [StmtBhv s] * default behavior. The [int] information is only useful to build the table : * when an edge is included in 2 different [StmtBhv] we only keep the one that * has the fewer internal edges because it is necessarily included in the other. *) module HdefAnnotBhv = Cil2cfg.HE (struct type t = (stmt * int) end) (* Finally, a configuration is associated to a strategy computation to * summarize what is to be computed. *) type strategy_info = { kf : Kernel_function.t; cfg : Cil2cfg.t; cur_bhv : asked_bhv; asked_bhvs : asked_bhv list; asked_prop : asked_prop; assigns_filter : asked_assigns; def_annots_info : HdefAnnotBhv.t; } (*----------------------------------------------------------------------------*) (* Adding things in the strategy *) (*----------------------------------------------------------------------------*) (* Select annotations to take as Hyp/Goal/... *) let pp_assigns_mode fmt config = let str = match config.assigns_filter with | NoAssigns -> "without assigns" | OnlyAssigns -> "only with assigns" | WithAssigns -> "both assigns or not" in Format.fprintf fmt "%s" str let pp_asked_prop fmt = function | AllProps -> Format.fprintf fmt "all properties" | NamedProp names -> Format.fprintf fmt "properties %a" (Pretty_utils.pp_list ~sep:"," Format.pp_print_string) names | IdProp p -> Format.fprintf fmt "property %s" (Property.Names.get_prop_name_id p) | CallPre (s, Some p) -> Format.fprintf fmt "pre %s at stmt %a" (Property.Names.get_prop_name_id p) Stmt.pretty_sid s | CallPre (s, None) -> Format.fprintf fmt "all call preconditions at stmt %a" Stmt.pretty_sid s let pp_strategy_info fmt config = Format.fprintf fmt "'%a', " Kernel_function.pretty config.kf; let _ = match config.cur_bhv with | FunBhv _bhv -> Format.fprintf fmt "behavior '%s'" (name_of_asked_bhv config.cur_bhv) | StmtBhv (_, s, a, bhv) -> Format.fprintf fmt "behavior '%s' of statement %d%a" bhv.b_name s.sid (Pretty_utils.pp_list ~pre:" (for active behaviors " ~sep:"," Format.pp_print_string) (Datatype.String.Set.elements a) in Format.fprintf fmt ", %a, %a" pp_asked_prop config.asked_prop pp_assigns_mode config let cur_fct_default_bhv config = match config.cur_bhv with | FunBhv None -> true | FunBhv (Some bhv) -> bhv.b_name = Cil.default_behavior_name | _ -> false let filter_assign config pid = match config.assigns_filter, WpPropId.property_of_id pid with | NoAssigns, Property.IPAssigns _ -> false | (OnlyAssigns | WithAssigns), Property.IPAssigns _ -> true | OnlyAssigns, _ -> false | (NoAssigns | WithAssigns), _ -> true let filter_speconly config pid = if Cil2cfg.cfg_spec_only config.cfg then let open Property in match WpPropId.property_of_id pid with | IPPredicate {ip_kind = PKRequires _; ip_kinstr = Kglobal} -> true | _ -> false else true let filter_status pid = Wp_parameters.StatusAll.get () || begin let module C = Property_status.Consolidation in match C.get (WpPropId.property_of_id pid) with | C.Never_tried -> true | C.Considered_valid | C.Inconsistent _ -> false | C.Valid _ | C.Valid_under_hyp _ | C.Invalid_but_dead _ | C.Valid_but_dead _ | C.Unknown_but_dead _ -> Wp_parameters.StatusTrue.get () | C.Unknown _ -> Wp_parameters.StatusMaybe.get () | C.Invalid _ | C.Invalid_under_hyp _ -> Wp_parameters.StatusFalse.get () end let filter_configstatus config pid = (match config.asked_prop with IdProp _ -> true | _ -> false) || (filter_status pid) let filter_asked config pid = match config.asked_prop with | IdProp idp -> Property.equal (WpPropId.property_of_id pid) idp | CallPre (s_call, asked_pre) -> WpPropId.select_call_pre s_call asked_pre pid | NamedProp names -> WpPropId.select_by_name names pid | AllProps -> WpPropId.select_default pid let rec filter config pid = function | [] -> None | (f,name)::fs -> if f config pid then filter config pid fs else Some name let dkey = Wp_parameters.register_category "select" let goal_to_select config pid = let result = filter config pid [ filter_assign , "assigns/non-assigns pass" ; filter_asked , "user selection" ; filter_configstatus , "proved status" ; filter_speconly , "no code and not main precondition" ; ] in match result with | None -> Wp_parameters.debug ~dkey "Goal '%a' selected" WpPropId.pp_propid pid ; true | Some f -> Wp_parameters.debug ~dkey "Goal '%a' skipped (%s)" WpPropId.pp_propid pid f ; false (*----------------------------------------------------------------------------*) (* Add properties *) (* TODO: still have to remove these fonctions... *) let kind_to_select config kind id = match kind with | WpStrategy.Agoal -> if goal_to_select config id then Some WpStrategy.Agoal else None | WpStrategy.Aboth goal -> let goal = goal && goal_to_select config id in Some (WpStrategy.Aboth goal) | WpStrategy.AcutB goal -> let goal = goal && goal_to_select config id in Some (WpStrategy.AcutB goal) | WpStrategy.AcallPre(goal,fct) -> let goal = goal && goal_to_select config id in Some (WpStrategy.AcallPre(goal,fct)) | WpStrategy.Ahyp | WpStrategy.AcallHyp _ -> Some kind let add_prop_loop_inv ~established config acc kind s ca p = let id = WpPropId.mk_loop_inv_id ~established config.kf s ca in match kind_to_select config kind id with | None -> acc | Some kind -> WpStrategy.add_prop_loop_inv acc kind s ~established id p let add_prop_inv_fixpoint config acc kind s ca p = let id = WpPropId.mk_inv_hyp_id config.kf s ca in match kind_to_select config kind id with | None -> acc | Some kind -> WpStrategy.add_prop_loop_inv acc kind s ~established:false id p (*----------------------------------------------------------------------------*) (* Add Assigns *) let add_loop_assigns_goal config s (ca, assigns) acc = let id = WpPropId.mk_loop_assigns_id config.kf s ca assigns in match id with None -> acc | Some id -> if goal_to_select config id then let labels = NormAtLabels.labels_loop_assigns s in let assigns' = NormAtLabels.preproc_assigns labels assigns in let a_desc = WpPropId.mk_loop_assigns_desc s assigns' in WpStrategy.add_assigns acc WpStrategy.Agoal id a_desc else acc let add_stmt_assigns_goal config s active acc b l_post = match b.b_assigns with | WritesAny -> acc | Writes assigns -> let id = WpPropId.mk_stmt_assigns_id config.kf s active b assigns in match id with | None -> acc | Some id -> if goal_to_select config id then let kf = config.kf in let labels = NormAtLabels.labels_stmt_assigns ~kf s l_post in let assigns = NormAtLabels.preproc_assigns labels assigns in let a_desc = WpPropId.mk_stmt_assigns_desc s assigns in WpStrategy.add_assigns acc WpStrategy.Agoal id a_desc else acc let add_fct_assigns_goal config acc tkind b = match b.b_assigns with | WritesAny -> acc | Writes assigns -> let id = WpPropId.mk_fct_assigns_id config.kf b tkind assigns in match id with | None -> acc | Some id -> if goal_to_select config id then let labels = NormAtLabels.labels_fct_assigns in let assigns' = NormAtLabels.preproc_assigns labels assigns in let a_desc = WpPropId.mk_kf_assigns_desc assigns' in WpStrategy.add_assigns acc WpStrategy.Agoal id a_desc else acc (* ------------------------------------------------------------------------ *) (* --- Get annotations according to the behavior --- *) (* ------------------------------------------------------------------------ *) (** find the behavior named [name] in the list *) let get_named_bhv name bhv_list = try Some (List.find (fun b -> b.b_name = name) bhv_list) with Not_found -> None (** Select in [bhv_list] the behavior that has to be processed * according to [config] and [ki] current statement. *) let get_behav config ki bh_list = match config.cur_bhv, ki with | FunBhv _, Kglobal -> get_named_bhv (name_of_asked_bhv config.cur_bhv) bh_list | StmtBhv (_, s1, _, b), Kstmt s2 when s1.sid = s2.sid -> get_named_bhv b.b_name bh_list | _ -> None (** Tells weather the property belonging to the behaviors in [bhv_name_list] * has to be considered according to [config]. *) type test_behav_res = | TBRno (* [cur_bhv] is not concerned *) | TBRhyp (* the property belongs to [default_behavior], but not to [cur_bhv] : it doesn't have to be a Goal but can be considered as an hypothesis. *) | TBRpart (* the property has to be taken as a Goal, but even if it is proved for every [asked_bhvs], it will still be a partial proof. TODO: use this to generate PKPartial ! *) | TBRok (* Select as a Goal *) (** (see [test_behav_res] above). * If the annotation doesn't have "for" names, it is a bit complicated because * we have to know if the statement [s] is inside a stmt behavior or not. *) let is_annot_for_config config ?(loopassigns=false) node s_annot bhv_name_list = let edges_before = Cil2cfg.pred_e config.cfg node in debug "[is_annot_for_config] at sid:%d for %a ? @." s_annot.sid (Wp_error.pp_string_list ~sep:" " ~empty:"<default>") bhv_name_list; let hyp_but_not_at_post n = (* don't take assert at post pgpt (see #564) *) let s_post = match Cil2cfg.get_post_edges config.cfg n with | [] -> None | e::_ -> Cil2cfg.get_edge_next_stmt config.cfg e in match s_post with | Some s_post when s_post.sid = s_annot.sid && not loopassigns -> TBRno | _ -> TBRhyp in let res = match bhv_name_list with | [] -> (* no spec 'for' in the property *) begin let e = match edges_before with | e::_ -> e | _ -> Wp_parameters.fatal "annot with no edge ?" in match config.cur_bhv with | FunBhv _ when cur_fct_default_bhv config -> begin try let _ = HdefAnnotBhv.find config.def_annots_info e in TBRhyp with Not_found -> TBRok end | StmtBhv (n, sb, _, b) when b.b_name = Cil.default_behavior_name -> begin try let s,_ = HdefAnnotBhv.find config.def_annots_info e in if s.sid = sb.sid then TBRok else raise Not_found with Not_found -> hyp_but_not_at_post n end | FunBhv _ -> TBRhyp | StmtBhv (n,_,_,_) -> hyp_but_not_at_post n end | bhvs -> (* TODOopt : there is surely a better way to do this : *) let asked_bhv = name_of_asked_bhv config.cur_bhv in let goal = List.exists (fun bl -> bl = asked_bhv) bhvs in if goal then let full = (* TODO *) true (* List.for_all (fun bl -> is_in bl config.asked_bhvs) bhvs *) in (if full then TBRok else TBRpart) else TBRno in debug "[is_annot_for_config] -> %s@." (match res with TBRok -> "ok" | TBRhyp -> "hyp" | TBRno -> "no" | TBRpart -> "part"); res let add_fct_pre config acc spec = let kf = config.kf in let add_bhv_pre_hyp b acc = let impl_assumes = false in let kind = WpStrategy.Ahyp in WpStrategy.add_prop_fct_bhv_pre acc kind kf b ~impl_assumes in let add_def_pre_hyp acc = match Cil.find_default_behavior spec with | None -> acc | Some bdef -> add_bhv_pre_hyp bdef acc in let acc = if WpStrategy.is_main_init kf || Wp_parameters.PrecondWeakening.get () then acc else let kind = WpStrategy.Ahyp in List.fold_left (fun acc bhv -> WpStrategy.add_prop_fct_pre_bhv acc kind kf bhv) acc spec.spec_behavior in let acc = match get_behav config Kglobal spec.spec_behavior with | None -> add_def_pre_hyp acc | Some b -> let acc = if not (Cil.is_default_behavior b) then add_def_pre_hyp acc else acc in let acc = if WpStrategy.is_main_init kf then let add_both acc p = let id = WpPropId.mk_pre_id kf Kglobal b p in let goal = goal_to_select config id in let kind = WpStrategy.Aboth goal in WpStrategy.add_prop_fct_pre acc kind kf b ~assumes:None p in let acc = List.fold_left add_both acc b.b_requires in let add_hyp acc p = let kind = WpStrategy.Ahyp in WpStrategy.add_prop_fct_pre acc kind kf b ~assumes:None p in List.fold_left add_hyp acc b.b_assumes else add_bhv_pre_hyp b acc in acc in acc let add_variant acc spec = (* TODO *) let _ = match spec.spec_variant with None -> () | Some v -> Wp_parameters.warning ~once:true "Ignored 'decrease' specification:@, %a@." Printer.pp_decreases v in acc let add_terminates acc spec = (* TODO *) let _ = match spec.spec_terminates with None -> () | Some p -> Wp_parameters.warning ~once:true "Ignored 'terminates' specification:@, %a@." Printer.pp_predicate (Logic_const.pred_of_id_pred p) in acc let add_disjoint_behaviors_props config ki active spec acc = match spec.spec_disjoint_behaviors with | [] -> acc | l -> let add_disj acc bhv_names = let kf = config.kf in let id = WpPropId.mk_disj_bhv_id (kf, ki, active, bhv_names) in if goal_to_select config id then begin let prop = Ast_info.disjoint_behaviors spec bhv_names in let labels = match ki with | Kglobal -> NormAtLabels.labels_fct_pre | Kstmt s -> NormAtLabels.labels_stmt_pre ~kf s in let prop = WpStrategy.normalize id labels prop in WpStrategy.add_prop acc WpStrategy.Agoal id prop end else acc in List.fold_left add_disj acc l let add_complete_behaviors_props config ki active spec acc = match spec.spec_complete_behaviors with | [] -> acc | l -> let mk_prop acc bhv_names = let kf = config.kf in let id = WpPropId.mk_compl_bhv_id (kf, ki, active, bhv_names) in if goal_to_select config id then let prop = Ast_info.complete_behaviors spec bhv_names in let labels = match ki with | Kglobal -> NormAtLabels.labels_fct_pre | Kstmt s -> NormAtLabels.labels_stmt_pre ~kf s in let prop = WpStrategy.normalize id labels prop in WpStrategy.add_prop acc WpStrategy.Agoal id prop else acc in List.fold_left mk_prop acc l let add_behaviors_props config ki active spec acc = let add = match config.cur_bhv, ki with | FunBhv _, Kglobal when cur_fct_default_bhv config -> true | StmtBhv (_, cur_s, cur_a, b), Kstmt s when (s.sid = cur_s.sid && b.b_name = Cil.default_behavior_name && Datatype.String.Set.(equal cur_a (of_list active))) -> true | _ -> false in if add then let acc = add_complete_behaviors_props config ki active spec acc in let acc = add_disjoint_behaviors_props config ki active spec acc in acc else acc (** Add the post condition of the whole spec as hypothesis. * Add [old(assumes) => ensures] for all the behaviors, * and also add an upper approximation of the merged assigns information. *) let add_stmt_spec_post_as_hyp config v s spec acc = let l_post = Cil2cfg.get_post_label config.cfg v in let add_bhv_post acc b = let assumes = Some (Ast_info.behavior_assumes b) in let add tk acc p = WpStrategy.add_prop_stmt_post acc WpStrategy.Ahyp config.kf s b tk l_post ~assumes p in let p_acc, e_acc = WpStrategy.fold_bhv_post_cond ~warn:false (add Normal) (add Exits) acc b in let p_acc = WpStrategy.add_stmt_spec_assigns_hyp p_acc config.kf s l_post spec in (* let e_acc = TODO, but crach at the moment... why ? * add_spec_assigns_hyp config ki l_post e_acc spec in *) p_acc, e_acc in List.fold_left add_bhv_post acc spec.spec_behavior (** we want to prove this behavior: * - add the requires as preconditions to both prove and use as hyp, * - add the assumes as hypotheses, * - add the postconditions as goals. *) let add_stmt_bhv_as_goal config v s active b (b_acc, (p_acc, e_acc)) = let l_post = Cil2cfg.get_post_label config.cfg v in let assumes = None in (* [assumes] are used as separate hypotheses *) let add_pre_hyp acc p = WpStrategy.add_prop_stmt_pre acc WpStrategy.Ahyp config.kf s b ~assumes p in let add_pre_goal acc p = let id = WpPropId.mk_pre_id config.kf (Kstmt s) b p in let goal = goal_to_select config id in let kind = WpStrategy.Aboth goal in WpStrategy.add_prop_stmt_pre acc kind config.kf s b ~assumes p in let add_post tk acc p = let id = WpPropId.mk_stmt_post_id config.kf s b (tk, p) in let goal = goal_to_select config id in let kind = WpStrategy.Aboth goal in WpStrategy.add_prop_stmt_post acc kind config.kf s b tk l_post ~assumes p in let b_acc = List.fold_left add_pre_goal b_acc b.b_requires in let b_acc = List.fold_left add_pre_hyp b_acc b.b_assumes in let p_acc, e_acc = WpStrategy.fold_bhv_post_cond ~warn:true (add_post Normal) (add_post Exits) (p_acc, e_acc) b in let p_acc = add_stmt_assigns_goal config s active p_acc b l_post in (*let e_acc = TODO, but crash at the moment... why ? add_stmt_assigns config s e_acc b l_post in *) b_acc, (p_acc, e_acc) let is_empty_behavior bhv = bhv.b_requires = [] && bhv.b_assumes = [] && bhv.b_post_cond = [] && bhv.b_assigns = WritesAny && bhv.b_allocation = FreeAllocAny let is_empty_spec s = s.spec_variant = None && s.spec_terminates = None && List.for_all is_empty_behavior s.spec_behavior let add_stmt_spec_annots config v s active spec ((b_acc, (p_acc, e_acc)) as acc) = if is_empty_spec spec then acc else let acc = add_variant acc spec in let acc = add_terminates acc spec in match config.cur_bhv with | StmtBhv (_n, cur_s, cur_a, b) when s.sid = cur_s.sid && Datatype.String.Set.(equal cur_a (of_list active)) -> (* begin match get_behav config (Kstmt s) spec.spec_behavior with | None -> (* in some cases, it seems that we can have several spec for the same statement -> not an error *) acc | Some b -> *) let b_acc, a_acc = add_stmt_bhv_as_goal config v s active b acc in let b_acc = add_behaviors_props config (Kstmt s) active spec b_acc in b_acc, a_acc | _ -> (* in all other cases, use the specification as hypothesis *) let kind = WpStrategy.Aboth false in let b_acc = WpStrategy.add_prop_stmt_spec_pre b_acc kind config.kf s spec in let p_acc, e_acc = add_stmt_spec_post_as_hyp config v s spec (p_acc, e_acc) in b_acc, (p_acc, e_acc) (*----------------------------------------------------------------------------*) (* Call annotations *) (*----------------------------------------------------------------------------*) let add_called_pre config called_kf s spec acc = let add_behav acc b = (* pre for behavior is [assumes => requires] *) let assumes = (Ast_info.behavior_assumes b) in let add_pre acc pre = let id = mk_call_pre_id called_kf b s pre in let kind = WpStrategy.AcallPre (goal_to_select config id,called_kf) in WpStrategy.add_prop_call_pre acc kind id ~assumes pre in List.fold_left add_pre acc b.b_requires in List.fold_left add_behav acc spec.spec_behavior let add_called_post called_kf termination_kind acc = let spec = Annotations.funspec called_kf in let add_behav acc b = (* post for behavior is [\old(assumes) => ensures] *) let kind = WpStrategy.AcallHyp called_kf in let assumes = (Ast_info.behavior_assumes b) in let add_post acc (tk, p) = if tk = termination_kind then WpStrategy.add_prop_call_post acc kind called_kf b tk ~assumes p else acc in List.fold_left add_post acc b.b_post_cond in List.fold_left add_behav acc spec.spec_behavior let add_call_annots config s kf l_post (before,(posts,exits)) = let spec = Annotations.funspec kf in let before = add_called_pre config kf s spec before in let posts = add_called_post kf Normal posts in let posts = WpStrategy.add_call_assigns_hyp posts config.kf s ~called_kf:kf l_post (Some spec) in let exits = add_called_post kf Exits exits in before , ( posts , exits ) let get_call_annots config v s fct = let l_post = Cil2cfg.get_post_label config.cfg v in let empty = let e = WpStrategy.empty_acc in e,(e,e) in match fct with | Cil2cfg.Static kf -> add_call_annots config s kf l_post empty | Cil2cfg.Dynamic _ -> let bhv = asked_bhv config.cur_bhv in match Dyncall.get ?bhv s with | None | Some(_,[]) -> Wp_parameters.warning ~once:true ~source:(fst (Stmt.loc s)) "Missing 'calls' for %s" (match bhv with | None -> "default behavior" | Some b -> b) ; let annots = WpStrategy.add_call_assigns_any WpStrategy.empty_acc s in WpStrategy.empty_acc, (annots , annots) | Some(_,calls) -> List.fold_left (fun acc kf -> add_call_annots config s kf l_post acc) empty calls (*----------------------------------------------------------------------------*) let add_variant_annot config s ca var_exp loop_entry loop_back = let (vpos_id, vpos), (vdecr_id, vdecr) = WpStrategy.mk_variant_properties config.kf s ca var_exp in let add_variant acc kind id p = WpStrategy.add_prop_loop_inv acc kind s ~established:false id p in let add_hyp acc = let acc = add_variant acc WpStrategy.Ahyp vdecr_id vdecr in add_variant acc WpStrategy.Ahyp vpos_id vpos in let add_goal acc = let acc = if goal_to_select config vdecr_id then add_variant acc WpStrategy.Agoal vdecr_id vdecr else acc in if goal_to_select config vpos_id then add_variant acc WpStrategy.Agoal vpos_id vpos else acc in let loop_back = if cur_fct_default_bhv config then add_goal loop_back else add_hyp loop_back (*TODO: what about variant establishment ??? It seems that [0<v)] is not * proved by induction anymore. Why ? *) in loop_entry, loop_back let add_loop_invariant_annot config vloop s ca b_list inv acc = let assigns, loop_entry, loop_back , loop_core = acc in (* we have to prove that inv is true for each edge that goes * in the loop, so we can assume that inv is true for each edge * starting from this point. *) match is_annot_for_config config vloop s b_list with | TBRok | TBRpart (* TODO: PKPartial *) -> begin let loop_entry = add_prop_loop_inv ~established:true config loop_entry WpStrategy.Agoal s ca inv in let loop_back = add_prop_loop_inv ~established:false config loop_back WpStrategy.Agoal s ca inv in let loop_core = add_prop_inv_fixpoint config loop_core WpStrategy.Ahyp s ca inv in assigns, loop_entry , loop_back , loop_core end | TBRhyp -> let kind = WpStrategy.Ahyp in let loop_core = add_prop_inv_fixpoint config loop_core kind s ca inv in assigns, loop_entry , loop_back , loop_core | TBRno -> acc (** Returns the annotations for the three edges of the loop node: * - loop_entry : goals for the edge entering in the loop * - loop_back : goals for the edge looping to the entry point * - loop_core : fix-point hypothesis for the edge starting the loop core *) let get_loop_annots config vloop s = let do_annot _ a (assigns, loop_entry, loop_back , loop_core as acc) = match a.annot_content with | AInvariant (b_list, true, inv) -> add_loop_invariant_annot config vloop s a b_list inv acc | AVariant (var_exp, None) -> let loop_entry, loop_back = add_variant_annot config s a var_exp loop_entry loop_back in assigns, loop_entry , loop_back , loop_core | AVariant (_v, _rel) -> Wp_parameters.warning ~once:true "Ignored 'loop variant' specification with measure : %a" Printer.pp_code_annotation a; acc | AAssigns (_,WritesAny) -> assert false | AAssigns (b_list, Writes w) -> (* loop assigns *) let h_assigns, g_assigns = assigns in let check_assigns old cur = match old with None -> Some cur | Some _ -> Wp_parameters.fatal "At most one loop assigns can be associated to a behavior" in let assigns = match is_annot_for_config config ~loopassigns:true vloop s b_list with | TBRok | TBRpart -> check_assigns h_assigns (a,w), check_assigns g_assigns (a,w) | TBRhyp -> check_assigns h_assigns (a,w), g_assigns | TBRno -> assigns in (assigns, loop_entry , loop_back , loop_core) | _ -> acc (* see get_stmt_annots *) in let acc = ((None,None), WpStrategy.empty_acc, WpStrategy.empty_acc, WpStrategy.empty_acc) in let (h_assigns, g_assigns), loop_entry , loop_back , loop_core = Annotations.fold_code_annot do_annot s acc in let loop_back = match g_assigns with | None -> loop_back | Some a -> add_loop_assigns_goal config s a loop_back in let loop_core = WpStrategy.add_loop_assigns_hyp loop_core config.kf s h_assigns in (loop_entry , loop_back , loop_core) let get_stmt_annots config v s = let do_annot _ a ((b_acc, (a_acc, e_acc)) as acc) = match a.annot_content with | AInvariant (_blist, loop_inv, _inv) -> if loop_inv then (* see get_loop_annots *) acc else begin Wp_parameters.warning ~once:true "Unsupported generalized invariant, use loop invariant instead.\n\ Ignored invariant @[<hov 2>%a@]" Printer.pp_code_annotation a; acc end | AAssert (b_list, kind, p) -> let kf = config.kf in let acc = match is_annot_for_config config v s b_list with | TBRno -> acc | TBRhyp -> if kind = Check then acc else let b_acc = WpStrategy.add_prop_assert b_acc WpStrategy.Ahyp kf s a p in (b_acc, (a_acc, e_acc)) | TBRok | TBRpart -> let id = WpPropId.mk_assert_id config.kf s a in let check = kind = Check and goal = goal_to_select config id in if check && not goal then acc else let kind = WpStrategy.(if check then Agoal else Aboth goal) in let b_acc = WpStrategy.add_prop_assert b_acc kind kf s a p in (b_acc, (a_acc, e_acc)) in acc | AAllocation (_b_list, _frees_allocates) -> (* [PB] TODO *) acc | AAssigns (_b_list, _assigns) -> (* loop assigns: see get_loop_annots *) acc | AVariant (_v, _rel) -> (* see get_loop_annots *) acc | APragma _ -> acc | AStmtSpec (b_list, spec) -> if b_list <> [] then (* TODO ! *) Wp_parameters.warning ~once:true "Ignored specification 'for %a' (generalize to all behavior)" (Pretty_utils.pp_list ~sep:", " Format.pp_print_string) b_list; add_stmt_spec_annots config v s b_list spec acc | AExtended _ -> acc in let before_acc = WpStrategy.empty_acc in let after_acc = WpStrategy.empty_acc in let exits_acc = WpStrategy.empty_acc in let acc = before_acc, (after_acc, exits_acc) in Annotations.fold_code_annot do_annot s acc let get_fct_pre_annots config spec = let acc = WpStrategy.empty_acc in let acc = add_fct_pre config acc spec in let acc = add_behaviors_props config Kglobal [] spec acc in let acc = add_variant acc spec in let acc = add_terminates acc spec in acc let get_fct_post_annots config tkind spec = let acc = WpStrategy.empty_acc in match get_behav config Kglobal spec.spec_behavior with | None -> acc | Some b -> (* add the postconditions *) let f_nothing () _ = () in let add tk acc p = let id = WpPropId.mk_fct_post_id config.kf b (tk, p) in if goal_to_select config id then WpStrategy.add_prop_fct_post acc WpStrategy.Agoal config.kf b tk p else acc in let acc = match tkind with | Normal -> let acc, _ = WpStrategy.fold_bhv_post_cond ~warn:true (add Normal) f_nothing (acc, ()) b in acc | Exits -> let _, acc = WpStrategy.fold_bhv_post_cond ~warn:false f_nothing (add Exits) ((), acc) b in acc | _ -> assert false in (* also add the [assigns] *) let acc = if Kernel_function.is_definition config.kf then add_fct_assigns_goal config acc tkind b else WpStrategy.add_fct_bhv_assigns_hyp acc config.kf tkind b in acc (*----------------------------------------------------------------------------*) (* Build graph annotation for the strategy *) (*----------------------------------------------------------------------------*) (** Builds tables that give hypotheses and goals relative to [b] behavior * for edges of the cfg to consider during wp computation. * [b = None] means that we only consider internal properties to select for the * default behavior. This is useful when the function doesn't have any * specification. * @param asked_prop = Some id -> select only this goal (use all hyps). *) let get_behavior_annots config = debug "build strategy for %a@." pp_strategy_info config; let cfg = config.cfg in let spec = Annotations.funspec config.kf in let annots = WpStrategy.create_tbl () in let get_node_annot v = debug "get_node_annot for node %a" Cil2cfg.pp_node v; match Cil2cfg.node_type v with | Cil2cfg.Vstart | Cil2cfg.Vend -> () | Cil2cfg.VfctIn -> let pre = get_fct_pre_annots config spec in WpStrategy.add_on_edges annots pre (Cil2cfg.succ_e cfg v) | Cil2cfg.VfctOut -> let post = get_fct_post_annots config Normal spec in WpStrategy.add_on_edges annots post (Cil2cfg.succ_e cfg v) | Cil2cfg.Vexit -> let post = get_fct_post_annots config Exits spec in WpStrategy.add_on_edges annots post (Cil2cfg.succ_e cfg v) | Cil2cfg.VblkIn (Cil2cfg.Bstmt s, _) | Cil2cfg.Vstmt s | Cil2cfg.Vswitch (s,_) | Cil2cfg.Vtest (true, s, _) -> let stmt_annots = get_stmt_annots config v s in WpStrategy.add_node_annots annots cfg v stmt_annots | Cil2cfg.Vcall (s,_,fct,_) -> let stmt_annots = get_stmt_annots config v s in WpStrategy.add_node_annots annots cfg v stmt_annots; let call_annots = get_call_annots config v s fct in WpStrategy.add_node_annots annots cfg v call_annots | Cil2cfg.Vloop (_, s) -> let stmt_annots = get_stmt_annots config v s in let before, _after = stmt_annots in (* TODO: what about after ? *) WpStrategy.add_loop_annots annots cfg v ~entry:before ~back:WpStrategy.empty_acc ~core:WpStrategy.empty_acc; debug "add_loop_annots stmt ok"; let (entry , back , core) = get_loop_annots config v s in debug "get_loop_annots ok"; WpStrategy.add_loop_annots annots cfg v ~entry ~back ~core | Cil2cfg.Vloop2 _ -> (* nothing to do *) () | Cil2cfg.VblkIn (_, _) | Cil2cfg.VblkOut (_, _) -> (* nothing *) () | Cil2cfg.Vtest (false, _s, _) -> (* done in Cil2cfg.Vtest (true) *) () in Cil2cfg.iter_nodes get_node_annot cfg; annots (* ------------------------------------------------------------------------ *) (* --- Global Properties --- *) (* ------------------------------------------------------------------------ *) module GS = Cil_datatype.Global_annotation.Set let add_global_annotations annots = let rec do_global g = let (source,_) = Cil_datatype.Global_annotation.loc g in match g with | Daxiomatic (_ax_name, globs,_,_) -> do_globals globs | Dvolatile _ -> (* nothing to do *) () | Dfun_or_pred _ -> (* will be processed while translation is needed *) () | Dtype _ -> (* will be processed while translation is needed *) () | Dtype_annot (linfo,_) -> Wp_parameters.warning ~source ~once:true "Type invariant not handled yet ('%s' ignored)" linfo.l_var_info.lv_name; () | Dmodel_annot (mf,_) -> Wp_parameters.warning ~source ~once:true "Model fields not handled yet (model field '%s' ignored)" mf.mi_name; () | Dcustom_annot (_c,_n,_,_) -> Wp_parameters.warning ~source ~once:true "Custom annotation not handled (ignored)"; () | Dextended _ -> () (* nothing to do. It's the job of the extension's owner to generate the appropriate standard annotations. *) | Dinvariant (linfo,_) -> Wp_parameters.warning ~source ~once:true "Global invariant not handled yet ('%s' ignored)" linfo.l_var_info.lv_name; () | Dlemma (name,_,_,_,_,_,_) -> WpStrategy.add_axiom annots (LogicUsage.logic_lemma name) and do_globals gs = List.iter do_global gs in (*[LC]: forcing order of iteration: hash is not the same on 32 and 64 bits *) let pool = ref GS.empty in Annotations.iter_global (fun _ g -> pool := GS.add g !pool); GS.iter do_global !pool; annots (* ------------------------------------------------------------------------ *) (* --- Main functions to build the strategies --- *) (* ------------------------------------------------------------------------ *) let string_of_active active = Format.asprintf "%a" (Pretty_utils.pp_list (fun fmt s -> Format.fprintf fmt "_%s" s)) (Datatype.String.Set.elements active) let behavior_name_of_config config = match config.cur_bhv with | FunBhv None -> None | FunBhv (Some b) when b.b_name = Cil.default_behavior_name -> None | FunBhv (Some b) -> Some b.b_name | StmtBhv (_, s, active, b) when b.b_name = Cil.default_behavior_name -> Some( "default_for_stmt_"^(string_of_int s.sid)^(string_of_active active)) (*TODO better name ?*) | StmtBhv (_, s, active, b) -> Some (b.b_name^"_stmt_"^(string_of_int s.sid)^(string_of_active active)) let build_bhv_strategy config = let annots = get_behavior_annots config in let annots = add_global_annotations annots in let desc = Format.asprintf "%a" pp_strategy_info config in WpStrategy.mk_strategy desc config.cfg (behavior_name_of_config config) WpStrategy.SKannots annots (* Visit the CFG to find all the internal statement specifications. * (see [HdefAnnotBhv] documentation for information about this table). *) let internal_function_behaviors cfg = let def_annot_bhv = HdefAnnotBhv.create 42 in let get_stmt_bhv node stmt acc = let add_bhv_info active acc b = if is_empty_behavior b then acc else begin if b.b_name = Cil.default_behavior_name then begin let _, int_edges = Cil2cfg.get_internal_edges cfg node in let n = Cil2cfg.Eset.cardinal int_edges in let reg e = try let (_old_s, old_n) = HdefAnnotBhv.find def_annot_bhv e in if n < old_n then (* new spec is included in the old one : override. *) raise Not_found with Not_found -> HdefAnnotBhv.replace def_annot_bhv e (stmt, n) in Cil2cfg.Eset.iter reg int_edges end; (node, stmt, active, b)::acc end in let spec_bhv_names acc annot = match annot with | {annot_content = AStmtSpec (active, spec)} -> List.fold_left (add_bhv_info active) acc spec.spec_behavior | _ -> Wp_parameters.fatal "filter on is_contract didn't work ?" in let annots = Annotations.code_annot ~filter:Logic_utils.is_contract stmt in List.fold_left spec_bhv_names acc annots in let get_bhv n ((seen_stmts, bhvs) as l) = match Cil2cfg.start_stmt_of_node n with None -> l | Some s -> if List.mem s.sid seen_stmts then l else let seen_stmts = s.sid::seen_stmts in let bhvs = get_stmt_bhv n s bhvs in (seen_stmts, bhvs) in let _, bhvs = Cil2cfg.fold_nodes get_bhv cfg ([], []) in bhvs, def_annot_bhv (** empty [bhv_names] means all (whatever [ki] is) *) let find_behaviors kf cfg ki bhv_names = let f_bhvs = Annotations.behaviors kf in let s_bhvs, def_annot_bhv = internal_function_behaviors cfg in let add_fct_bhv (def, acc) b = let add () = let def = if Cil.is_default_behavior b then true else def in def, (FunBhv (Some b))::acc in if bhv_names = [] then add() else match ki with | None (* not specified ki *) | Some Kglobal -> if List.mem b.b_name bhv_names then add () else (def, acc) | Some Kstmt _ -> def, acc in let add_stmt_bhv acc (n,s,active,b) = let active = Datatype.String.Set.of_list active in if bhv_names = [] then (StmtBhv (n,s,active,b))::acc else if List.mem b.b_name bhv_names then let acc = match ki with | None -> (* not specified ki *) (StmtBhv (n, s, active, b))::acc | Some (Kstmt stmt) when stmt.sid = s.sid -> (StmtBhv (n, s, active, b))::acc | _ -> (* specified ki but not this one *) acc in acc else acc in let f_bhvs = List.rev f_bhvs in (* for compatibility with previous version *) let def, bhvs = List.fold_left add_fct_bhv (false, []) f_bhvs in let bhvs = List.fold_left add_stmt_bhv bhvs s_bhvs in let bhvs = if def then (* fct default behavior already in *) bhvs else if bhv_names = [] then (FunBhv None)::bhvs else match ki with | None (* not specified ki *) | Some Kglobal -> if List.mem Cil.default_behavior_name bhv_names then (FunBhv None)::bhvs else bhvs | Some Kstmt _ -> bhvs in def_annot_bhv, bhvs (*----------------------------------------------------------------------------*) (* Unreachable *) (*----------------------------------------------------------------------------*) class vexit kf acc = object inherit Visitor.frama_c_inplace val mutable ips = acc method acc = ips method! vstmt_aux stmt = Annotations.iter_code_annot (fun _e ca -> match ca.annot_content with | AStmtSpec(_,spec) -> List.iter (fun bhv -> List.iter (fun post -> if fst post = Exits then let ip = WpPropId.mk_stmt_post_id kf stmt bhv post in ips <- ip :: ips ) bhv.b_post_cond ) spec.spec_behavior | _ -> () ) stmt ; Cil.DoChildren end let process_unreached_annots cfg = debug "collecting unreachable annotations@."; let unreached = Cil2cfg.unreachable_nodes cfg in let kf = Cil2cfg.cfg_kf cfg in let spec = Annotations.funspec kf in let add_id acc id = if filter_status id then id::acc else (* non-selected property : nothing to do *) acc in let do_post b tk acc (termk, _ as p) = if tk = termk then add_id acc (WpPropId.mk_fct_post_id kf b p) else acc in let do_bhv termk acc b = List.fold_left (do_post b termk) acc b.b_post_cond in let do_annot s _ a acc = List.fold_left add_id acc (WpPropId.mk_code_annot_ids kf s a) in let do_node acc n = debug "process annotations of unreachable node %a@." Cil2cfg.pp_node_type n; match n with | Cil2cfg.Vstart -> Wp_parameters.fatal "Start must be reachable" | Cil2cfg.VfctIn -> Wp_parameters.fatal "FctIn must be reachable" | Cil2cfg.VfctOut -> List.fold_left (do_bhv Normal) acc spec.spec_behavior | Cil2cfg.Vexit -> let acc = List.fold_left (do_bhv Exits) acc spec.spec_behavior in let visitor = new vexit kf acc in ignore Visitor.(visitFramacKf (visitor :> frama_c_visitor) kf) ; visitor#acc | Cil2cfg.Vcall (s, _, call, _) -> Annotations.fold_code_annot (do_annot s) s acc @ preconditions_at_call s call | Cil2cfg.Vstmt s | Cil2cfg.VblkIn (Cil2cfg.Bstmt s, _) | Cil2cfg.VblkOut (Cil2cfg.Bstmt s, _) | Cil2cfg.Vtest (true, s, _) | Cil2cfg.Vloop (_, s) | Cil2cfg.Vswitch (s,_) -> Annotations.fold_code_annot (do_annot s) s acc | Cil2cfg.Vtest (false, _, _) | Cil2cfg.Vloop2 _ | Cil2cfg.VblkIn _ | Cil2cfg.VblkOut _ | Cil2cfg.Vend -> acc in let annots = List.fold_left do_node [] unreached in debug "found %d unreachable annotations@." (List.length annots) ; List.iter (fun pid -> set_unreachable pid) annots (*----------------------------------------------------------------------------*) (* Everything must go through here. *) (*----------------------------------------------------------------------------*) let get_cfg kf model = if Wp_parameters.RTE.get () then WpRTE.generate model kf ; let cfg = Cil2cfg.get kf in let _ = process_unreached_annots cfg in cfg let build_configs assigns kf model behaviors ki property = debug "[get_strategies] for behaviors names: %a@." (Wp_error.pp_string_list ~sep:" " ~empty:"<none>") (match behaviors with [] -> ["<all>"] | _ :: _ as l -> l) ; let _ = match ki with | None -> () | Some Kglobal -> debug "[get_strategies] select in function properties@." | Some (Kstmt s) -> debug "[get_strategies] select stmt %d properties@." s.sid in let cfg = get_cfg kf model in let def_annot_bhv, bhvs = find_behaviors kf cfg ki behaviors in if bhvs <> [] then debug "[get_strategies] %d behaviors" (List.length bhvs); let mk_bhv_config bhv = { kf = kf; cfg = cfg; cur_bhv = bhv; asked_prop = property; asked_bhvs = bhvs; assigns_filter = assigns; def_annots_info = def_annot_bhv } in List.map mk_bhv_config bhvs let get_strategies assigns kf model behaviors ki property = let configs = build_configs assigns kf model behaviors ki property in let rec add_stgs l = match l with [] -> [] | config::tl -> let stg = build_bhv_strategy config in stg::(add_stgs tl) in add_stgs configs (*----------------------------------------------------------------------------*) (* Public functions to build the strategies *) (*----------------------------------------------------------------------------*) let get_precond_strategies ~model p = debug "[get_precond_strategies] %s@." (Property.Names.get_prop_name_id p); let open Property in match p with | IPPredicate {ip_kind = PKRequires b; ip_kf; ip_kinstr = Kglobal} -> let strategies = if WpStrategy.is_main_init ip_kf then get_strategies NoAssigns ip_kf model [b.b_name] None (IdProp p) else [] in let call_sites = Kernel_function.find_syntactic_callsites ip_kf in let add_call_pre_strategy acc (kf_caller, stmt) = let asked = CallPre (stmt, Some p) in get_strategies NoAssigns kf_caller model [] None asked @ acc in if call_sites = [] then (Wp_parameters.warning ~once:true "No direct call sites for function '%a': cannot check pre-conditions" Kernel_function.pretty ip_kf; strategies) else List.fold_left add_call_pre_strategy strategies call_sites | _ -> invalid_arg "[get_precond_strategies] not a function precondition" let get_call_pre_strategies ~model stmt = debug "[get_call_pre_strategies] on statement %a@." Stmt.pretty_sid stmt; match stmt.skind with | Instr(Call(_,f,_,_)) -> let strategies = match Kernel_function.get_called f with | None -> Wp_parameters.warning "Call through function pointer not implemented yet: \ cannot check pre-conditions for statement %a" Stmt.pretty_sid stmt; [] | Some _kf_called -> let kf_caller = Kernel_function.find_englobing_kf stmt in let asked = CallPre (stmt, None) in get_strategies NoAssigns kf_caller model [] None asked in strategies | Instr(Local_init(_, ConsInit _, _)) -> let kf_caller = Kernel_function.find_englobing_kf stmt in let asked = CallPre(stmt, None) in get_strategies NoAssigns kf_caller model [] None asked | _ -> Wp_parameters.warning "[get_call_pre_strategies] this is not a call statement"; [] let get_id_prop_strategies ~model ?(assigns=WithAssigns) p = debug "[get_id_prop_strategies] %s@." (Property.Names.get_prop_name_id p); let open Property in match p with | IPCodeAnnot {ica_kf; ica_ca} -> let bhvs = match ica_ca.annot_content with | AAssert (l, _, _) | AInvariant (l, _, _) | AAssigns (l, _) -> l | _ -> [] in get_strategies assigns ica_kf model bhvs None (IdProp p) | IPAssigns {ias_kf = kf; ias_bhv = Id_loop _} (*loop assigns: belongs to the default behavior *) | IPDecrease {id_kf = kf} -> (* any variant property is attached to the default behavior of * the function, NOT to a statement behavior *) let bhvs = [ Cil.default_behavior_name ] in get_strategies assigns kf model bhvs None (IdProp p) | IPPredicate {ip_kind = PKRequires _; ip_kinstr = Kglobal} -> get_precond_strategies model p | _ -> let strategies = match get_kf p with | None -> Wp_parameters.warning "WP of property outside functions: ignore %s" (Property.Names.get_prop_name_id p); [] | Some kf -> let ki = Some (get_kinstr p) in let bhv = match get_behavior p with | None -> Cil.default_behavior_name | Some fb -> fb.b_name in get_strategies assigns kf model [bhv] ki (IdProp p) in strategies let get_function_strategies ~model ?(assigns=WithAssigns) ?(bhv=[]) ?(prop=[]) kf = let prop = match prop with [] -> AllProps | _ -> NamedProp prop in get_strategies assigns kf model bhv None prop ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpAnnot.mli�����������������������������������������������������0000666�0000000�0000000�00000007035�13571573400�016247� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Every access to annotations have to go through here, * so this is the place where we decide what the computation * is allowed to use. *) open Cil_types (*----------------------------------------------------------------------------*) (** splits a prop_id goals into prop_id parts for each sub-goals *) val split : ( WpPropId.prop_id -> 'a -> unit ) -> WpPropId.prop_id -> 'a Bag.t -> unit (** A proof accumulator for a set of related prop_id *) type proof val create_proof : WpPropId.prop_id -> proof (** to be used only once for one of the related prop_id *) val add_proof : proof -> WpPropId.prop_id -> Property.t list -> unit (** accumulate in the proof the partial proof for this prop_id *) val is_composed : proof -> bool (** whether a proof needs several lemma to be complete *) val is_proved : proof -> bool (** whether all partial proofs have been accumulated or not *) val target : proof -> Property.t val dependencies : proof -> Property.t list val filter_status : WpPropId.prop_id -> bool (*----------------------------------------------------------------------------*) val get_called_preconditions_at : kernel_function -> stmt -> Property.t list val get_called_post_conditions : kernel_function -> Property.t list val get_called_exit_conditions : kernel_function -> Property.t list val get_called_assigns : kernel_function -> Property.t list (*----------------------------------------------------------------------------*) type asked_assigns = NoAssigns | OnlyAssigns | WithAssigns val get_id_prop_strategies : model:WpContext.model -> ?assigns:asked_assigns -> Property.t -> WpStrategy.strategy list val get_call_pre_strategies : model:WpContext.model -> stmt -> WpStrategy.strategy list val get_function_strategies : model:WpContext.model -> ?assigns:asked_assigns -> ?bhv:string list -> ?prop:string list -> Kernel_function.t -> WpStrategy.strategy list (*----------------------------------------------------------------------------*) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpContext.ml����������������������������������������������������0000666�0000000�0000000�00000033755�13571573400�016453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Model Registry --- *) (* -------------------------------------------------------------------------- *) type model = { id : string ; (* Identifier Basename for Model (unique) *) descr : string ; (* Title of the Model (for pretty) *) emitter : Emitter.t ; hypotheses : hypotheses ; tuning : tuning list ; } and tuning = unit -> unit and scope = Global | Kf of Kernel_function.t and hypotheses = unit -> MemoryContext.clause list and context = model * scope and t = context let nohyp (_kf) = [] module MODEL = struct type t = model let id a = a.id let descr a = a.descr let hash a = Hashtbl.hash a.id let equal a b = String.equal a.id b.id let compare a b = String.compare a.id b.id let repr = { id = "?model" ; descr = "?model" ; emitter = Emitter.kernel ; tuning = [ fun () -> () ] ; hypotheses = nohyp ; } end module MODELS = struct module H = Datatype.String.Map let h = ref H.empty (* NOT PROJECTIFIED : Models are defined at Plugin load-time, for all projects *) let mem id = H.mem id !h let add m = h := H.add m.id m !h end let register ~id ?(descr=id) ?(tuning=[]) ?(hypotheses=nohyp) () = if MODELS.mem id then Wp_parameters.fatal "Duplicate model '%s'" id ; let emitter = let e_name = "Wp." ^ id in let correctness = [ ] in let tuning = [ Wp_parameters.Provers.parameter ] in Emitter.create e_name [ Emitter.Property_status ] ~correctness ~tuning in let model = { id = id ; descr ; emitter ; tuning ; hypotheses ; } in MODELS.add model ; model let get_descr m = m.descr let get_emitter m = m.emitter module SCOPE = struct type t = scope let id = function | Global -> "__frama_c_global" | Kf f -> Kernel_function.get_name f let compare f g = match f,g with | Global , Global -> 0 | Global , _ -> (-1) | _ , Global -> 1 | Kf f , Kf g -> Kernel_function.compare f g let equal f g = (compare f g = 0) let hash = function Global -> 0 | Kf kf -> Kernel_function.hash kf end module S = struct type t = context let id (model,scope) = match scope with | Global -> model.id | Kf kf -> Printf.sprintf "%s_%s" model.id (Kernel_function.get_name kf) let hash (m,s) = match s with | Global -> 2 * MODEL.hash m | Kf kf -> 3 * MODEL.hash m + 5 * Kernel_function.hash kf let equal (m1,s1) (m2,s2) = MODEL.equal m1 m2 && SCOPE.equal s1 s2 let compare (m1,s1) (m2,s2) = let cmp = MODEL.compare m1 m2 in if cmp<>0 then cmp else SCOPE.compare s1 s2 end let context : (string * context) Context.value = Context.create "WpContext" let configure (model,_) = List.iter (fun f -> f()) model.tuning let rollback = function None -> () | Some (_,ctxt) -> configure ctxt let on_context gamma f x = let id = S.id gamma in let current = Context.push context (id,gamma) in try Context.configure () ; configure gamma ; let result = f x in Context.pop context current ; rollback current ; result with err -> Context.pop context current ; rollback current ; raise err let is_defined () = Context.defined context let get_ident () = Context.get context |> fst let get_context () = Context.get context |> snd let get_model () = get_context () |> fst let get_scope () = get_context () |> snd let compute_hypotheses m f = on_context (m,Kf f) m.hypotheses () let directory () = get_model () |> MODEL.id |> Wp_parameters.get_output_dir module type Entries = sig type key type data val name : string val compare : key -> key -> int val pretty : Format.formatter -> key -> unit end module type Registry = sig module E : Entries type key = E.key type data = E.data val id : basename:string -> key -> string val mem : key -> bool val find : key -> data val get : key -> data option val clear : unit -> unit val remove : key -> unit val define : key -> data -> unit val update : key -> data -> unit val memoize : (key -> data) -> key -> data val compile : (key -> data) -> key -> unit val callback : (key -> data -> unit) -> unit val iter : (key -> data -> unit) -> unit val iter_sorted : (key -> data -> unit) -> unit end let types = Hashtbl.create 8 let freetype a = try let n = Hashtbl.find types a in Hashtbl.replace types a (succ n) ; Printf.sprintf "%s#%d" a n with Not_found -> Hashtbl.add types a 1 ; a module NAMES = FCMap.Make(String) module Index(E : Entries) = struct module E = E type key = E.key type data = E.data module KEY = struct type t = E.key let compare = E.compare end module MAP = FCMap.Make(KEY) module SET = FCSet.Make(KEY) let demon = ref [] type entries = { mutable index : E.data MAP.t ; mutable ident : string MAP.t ; mutable names : int NAMES.t ; mutable lock : SET.t ; } let create () = { index=MAP.empty; ident=MAP.empty; names=NAMES.empty; lock=SET.empty; } module ENTRIES : Datatype.S with type t = entries = Datatype.Make (struct type t = entries include Datatype.Undefined let mem_project = Datatype.never_any_project let reprs = [create ()] let name = freetype ("Wp.Context.Index." ^ E.name) end) module REGISTRY = State_builder.Hashtbl (Datatype.String.Hashtbl) (ENTRIES) (struct let name = freetype ("Wp.Context." ^ E.name) let dependencies = [Ast.self] let size = 32 end) (* Projectified entry map, indexed by model *) let entries () : entries = let cid = get_ident () in try REGISTRY.find cid with Not_found -> let e = create () in REGISTRY.add cid e ; e let clear () = begin let e = entries () in e.index <- MAP.empty ; e.lock <- SET.empty ; end let remove k = begin let e = entries () in e.index <- MAP.remove k e.index ; e.lock <- SET.remove k e.lock ; end let mem k = let e = entries () in MAP.mem k e.index || SET.mem k e.lock let find k = let e = entries () in MAP.find k e.index let get k = try Some (find k) with Not_found -> None let id ~basename k = begin let e = entries () in try MAP.find k e.ident with Not_found -> let kid,id = try let kid = succ (NAMES.find basename e.names) in kid,Printf.sprintf "%s_%d" basename kid with Not_found -> 0,basename in e.names <- NAMES.add basename kid e.names ; e.ident <- MAP.add k id e.ident ; id end let fire k d = List.iter (fun f -> f k d) !demon let callback f = demon := !demon @ [f] let define k d = begin let e = entries () in if MAP.mem k e.index then Wp_parameters.fatal "Duplicate definition (%s:%a)" E.name E.pretty k ; if SET.mem k e.lock then Wp_parameters.fatal "Locked definition (%s:%a)" E.name E.pretty k ; e.index <- MAP.add k d e.index ; fire k d ; end let update k d = begin let e = entries () in e.index <- MAP.add k d e.index ; fire k d ; end let memoize f k = let e = entries () in try MAP.find k e.index with Not_found -> let lock = e.lock in e.lock <- SET.add k e.lock ; let d = f k in e.index <- MAP.add k d e.index ; fire k d ; e.lock <- lock ; d (* in case of exception, the entry remains intentionally locked *) let compile f k = ignore (memoize f k) let iter f = MAP.iter f (entries()).index let iter_sorted f = let e = entries () in let s = MAP.fold (fun k _ s -> SET.add k s) e.index SET.empty in SET.iter (fun k -> f k (MAP.find k e.index)) s end module Static(E : Entries) = struct module E = E type key = E.key type data = E.data module KEY = struct type t = E.key let compare = E.compare end module MAP = FCMap.Make(KEY) module SET = FCSet.Make(KEY) let demon = ref [] type entries = { mutable index : E.data MAP.t ; mutable ident : string MAP.t ; mutable names : int NAMES.t ; mutable lock : SET.t ; } let create () = { index=MAP.empty; ident=MAP.empty; names=NAMES.empty; lock=SET.empty; } module ENTRIES : Datatype.S with type t = entries = Datatype.Make (struct type t = entries include Datatype.Undefined let reprs = [create ()] let name = "Wp.Context.Index." ^ E.name let mem_project = Datatype.never_any_project end) module REGISTRY = State_builder.Ref (ENTRIES) (struct let name = "Wp.Context." ^ E.name let dependencies = [Ast.self] let default = create end) (* Projectified entry map *) let entries () : entries = REGISTRY.get () let clear () = begin let e = entries () in e.index <- MAP.empty ; e.lock <- SET.empty ; end let remove k = begin let e = entries () in e.index <- MAP.remove k e.index ; e.lock <- SET.remove k e.lock ; end let mem k = let e = entries () in MAP.mem k e.index || SET.mem k e.lock let find k = let e = entries () in MAP.find k e.index let get k = try Some (find k) with Not_found -> None let id ~basename k = begin let e = entries () in try MAP.find k e.ident with Not_found -> let kid,id = try let kid = succ (NAMES.find basename e.names) in kid,Printf.sprintf "%s_%d" basename kid with Not_found -> 0,basename in e.names <- NAMES.add basename kid e.names ; e.ident <- MAP.add k id e.ident ; id end let fire k d = List.iter (fun f -> f k d) !demon let callback f = demon := !demon @ [f] let define k d = begin let e = entries () in if MAP.mem k e.index then Wp_parameters.fatal "Duplicate definition (%s:%a)" E.name E.pretty k ; if SET.mem k e.lock then Wp_parameters.fatal "Locked definition (%s:%a)" E.name E.pretty k ; e.index <- MAP.add k d e.index ; fire k d ; end let update k d = begin let e = entries () in e.index <- MAP.add k d e.index ; fire k d ; end let memoize f k = let e = entries () in try MAP.find k e.index with Not_found -> let lock = e.lock in e.lock <- SET.add k e.lock ; let d = f k in e.index <- MAP.add k d e.index ; fire k d ; e.lock <- lock ; d (* in case of exception, the entry remains intentionally locked *) let compile f k = ignore (memoize f k) let iter f = MAP.iter f (entries()).index let iter_sorted f = let e = entries () in let s = MAP.fold (fun k _ s -> SET.add k s) e.index SET.empty in SET.iter (fun k -> f k (MAP.find k e.index)) s end module type Key = sig type t val compare : t -> t -> int val pretty : Format.formatter -> t -> unit end module type Data = sig type key type data val name : string val compile : key -> data end module type IData = sig type key type data val name : string val basename : key -> string val compile : key -> string -> data end module type Generator = sig type key type data val get : key -> data val mem : key -> bool val clear : unit -> unit val remove : key -> unit end module StaticGenerator(K : Key)(D : Data with type key = K.t) = struct module G = Static (struct include K include D end) type key = D.key type data = D.data let get = G.memoize D.compile let mem = G.mem let clear = G.clear let remove = G.remove end module Generator(K : Key)(D : Data with type key = K.t) = struct module G = Index (struct include K include D end) type key = D.key type data = D.data let get = G.memoize D.compile let mem = G.mem let clear = G.clear let remove = G.remove end module GeneratorID(K : Key)(D : IData with type key = K.t) = struct module G = Index (struct include K include D end) type key = D.key type data = D.data let get = G.memoize (fun k -> D.compile k (G.id ~basename:(D.basename k) k)) let mem = G.mem let clear = G.clear let remove = G.remove end module StaticGeneratorID(K : Key)(D : IData with type key = K.t) = struct module G = Static (struct include K include D end) type key = D.key type data = D.data let get = G.memoize (fun k -> D.compile k (G.id ~basename:(D.basename k) k)) let mem = G.mem let clear = G.clear let remove = G.remove end �������������������frama-c-20.0-Calcium/src/plugins/wp/wpContext.mli���������������������������������������������������0000666�0000000�0000000�00000012130�13571573400�016604� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Model Registration *) type model type scope = Global | Kf of Kernel_function.t type tuning = (unit -> unit) type hypotheses = unit -> MemoryContext.clause list val register : id:string -> ?descr:string -> ?tuning:tuning list -> ?hypotheses:hypotheses -> unit -> model val get_descr : model -> string val get_emitter : model -> Emitter.t val compute_hypotheses : model -> Kernel_function.t -> MemoryContext.clause list type context = model * scope type t = context module S : sig type t = context val id : t -> string val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int end module MODEL : sig type t = model val id : t -> string val descr : t -> string val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int val repr : t end module SCOPE : sig type t = scope val id : t -> string val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int end val is_defined : unit -> bool val on_context : context -> ('a -> 'b) -> 'a -> 'b val get_model : unit -> model val get_scope : unit -> scope val get_context : unit -> context val directory : unit -> string (** Current model in ["-wp-out"] directory *) module type Entries = sig type key type data val name : string val compare : key -> key -> int val pretty : Format.formatter -> key -> unit end module type Registry = sig module E : Entries type key = E.key type data = E.data val id : basename:string -> key -> string val mem : key -> bool val find : key -> data val get : key -> data option val clear : unit -> unit val remove : key -> unit val define : key -> data -> unit (** no redefinition ; circularity protected *) val update : key -> data -> unit (** set current value, with no protection *) val memoize : (key -> data) -> key -> data (** with circularity protection *) val compile : (key -> data) -> key -> unit (** with circularity protection *) val callback : (key -> data -> unit) -> unit val iter : (key -> data -> unit) -> unit val iter_sorted : (key -> data -> unit) -> unit end module Index(E : Entries) : Registry with module E = E (** projectified, depend on the model, not serialized *) module Static(E : Entries) : Registry with module E = E (** projectified, independent from the model, not serialized *) module type Key = sig type t val compare : t -> t -> int val pretty : Format.formatter -> t -> unit end module type Data = sig type key type data val name : string val compile : key -> data end module type IData = sig type key type data val name : string val basename : key -> string val compile : key -> string -> data end module type Generator = sig type key type data val get : key -> data val mem : key -> bool val clear : unit -> unit val remove : key -> unit end (** projectified, depend on the model, not serialized *) module Generator(K : Key)(D : Data with type key = K.t) : Generator with type key = D.key and type data = D.data (** projectified, independent from the model, not serialized *) module StaticGenerator(K : Key)(D : Data with type key = K.t) : Generator with type key = D.key and type data = D.data (** projectified, depend on the model, not serialized *) module GeneratorID(K : Key)(D : IData with type key = K.t) : Generator with type key = D.key and type data = D.data (** projectified, independent from the model, not serialized *) module StaticGeneratorID(K : Key)(D : IData with type key = K.t) : Generator with type key = D.key and type data = D.data ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpPropId.ml�����������������������������������������������������0000666�0000000�0000000�00000107317�13571573400�016220� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Cil_datatype (*----------------------------------------------------------------------------*) (* Property identification *) (*----------------------------------------------------------------------------*) (** Beside the property identification, it can be found in different contexts * depending on which part of the computation is involved. * For instance, properties on loops are split in 2 parts : establishment and * preservation. *) type prop_kind = | PKTactic (** tactical sub-goal *) | PKCheck (** internal check *) | PKProp (** normal property *) | PKEstablished (** computation related to a loop property before the loop. *) | PKPreserved (** computation related to a loop property inside the loop. *) | PKPropLoop (** loop property used as hypothesis inside a loop. *) | PKVarDecr (** computation related to the decreasing of a variant in a loop *) | PKVarPos (** computation related to a loop variant being positive *) | PKAFctOut (** computation related to the function assigns on normal termination *) | PKAFctExit (** computation related to the function assigns on exit termination *) | PKPre of kernel_function * stmt * Property.t (** precondition for function at stmt, property of the require. Many information that should come from the p_prop part of the prop_id, but in the PKPre case, it seems that it is hidden in a IPBlob property ! *) type prop_id = { p_kind : prop_kind ; p_prop : Property.t ; p_part : (int * int) option ; } let tactical ~gid = let ip = "Wp.Tactical." ^ gid in { p_kind = PKTactic ; p_prop = Property.(ip_other ip (OLGlob Cil_datatype.Location.unknown)); p_part = None } (* -------------------------------------------------------------------------- *) (* --- Category --- *) (* -------------------------------------------------------------------------- *) let kind_of_id p = p.p_kind let parts_of_id p = p.p_part let property_of_id p = p.p_prop let mk_part pid (k, n) = { pid with p_part = Some (k,n) } let source_of_id p = fst (Property.location p.p_prop) exception Found of int let num_of_bhv_from bhv (out, _) = match bhv.b_assigns with WritesAny -> Wp_parameters.fatal "no \\from in this behavior ???" | Writes l -> let add n (o, f) = match f with FromAny -> n | From _ -> if Logic_utils.is_same_identified_term out o then raise (Found n) else n+1 in try let _ = List.fold_left add 1 l in Wp_parameters.fatal "didn't found this \\from" with Found n -> n (*----------------------------------------------------------------------------*) (* Constructors *) (*----------------------------------------------------------------------------*) let mk_prop kind prop = { p_kind=kind ; p_prop=prop ; p_part=None } let mk_check prop = { p_kind=PKCheck ; p_prop=prop ; p_part=None } let mk_property prop = { p_kind=PKProp ; p_prop=prop ; p_part=None } let mk_annot_id kf stmt ca = Property.ip_of_code_annot_single kf stmt ca let mk_annot_ids kf stmt ca = Property.ip_of_code_annot kf stmt ca let mk_code_annot_ids kf s ca = List.map (mk_prop PKProp) (mk_annot_ids kf s ca) let mk_assert_id kf s ca = mk_prop PKProp (mk_annot_id kf s ca) let mk_loop_inv_id kf s ~established ca = let kind = if established then PKEstablished else PKPreserved in mk_prop kind (mk_annot_id kf s ca) let mk_inv_hyp_id kf s ca = mk_prop PKPropLoop (mk_annot_id kf s ca) let mk_var_decr_id kf s ca = mk_prop PKVarDecr (mk_annot_id kf s ca) let mk_var_pos_id kf s ca = mk_prop PKVarPos (mk_annot_id kf s ca) let mk_loop_from_id kf s ca from = let id = Property.ip_of_from kf (Kstmt s) (Property.Id_loop ca) from in mk_prop PKPropLoop (Extlib.the id) let mk_bhv_from_id kf ki a bhv from = let a = Datatype.String.Set.of_list a in let id = Property.ip_of_from kf ki (Property.Id_contract (a,bhv)) from in mk_prop PKProp (Extlib.the id) let get_kind_for_tk kf tkind = match tkind with | Normal -> if Cil2cfg.has_exit (Cil2cfg.get kf) then PKAFctOut else PKProp | Exits -> PKAFctExit | _ -> assert false let mk_fct_from_id kf bhv tkind from = let contract_info = Property.Id_contract(Datatype.String.Set.empty,bhv) in let id = Property.ip_of_from kf Kglobal contract_info from in let kind = get_kind_for_tk kf tkind in mk_prop kind (Extlib.the id) let mk_disj_bhv_id (kf,ki,active,disj) = mk_prop PKProp (Property.ip_of_disjoint kf ki active disj) let mk_compl_bhv_id (kf,ki,active,comp) = mk_prop PKProp (Property.ip_of_complete kf ki active comp) let mk_decrease_id (kf, s, x) = mk_prop PKProp (Property.ip_of_decreases kf s x) let mk_lemma_id l = mk_prop PKProp (LogicUsage.ip_lemma l) let mk_stmt_assigns_id kf s active b a = let active = Datatype.String.Set.of_list active in let b = Property.Id_contract (active,b) in let p = Property.ip_of_assigns kf (Kstmt s) b (Writes a) in Extlib.opt_map (mk_prop PKProp) p let mk_loop_assigns_id kf s ca a = let ca = Property.Id_loop ca in let p = Property.ip_of_assigns kf (Kstmt s) ca (Writes a) in Extlib.opt_map (mk_prop PKPropLoop) p let mk_fct_assigns_id kf b tkind a = let b = Property.Id_contract(Datatype.String.Set.empty,b) in let kind = get_kind_for_tk kf tkind in let p = Property.ip_of_assigns kf Kglobal b (Writes a) in Extlib.opt_map (mk_prop kind) p let mk_pre_id kf ki b p = mk_prop PKProp (Property.ip_of_requires kf ki b p) let mk_stmt_post_id kf s b p = mk_prop PKProp (Property.ip_of_ensures kf (Kstmt s) b p) let mk_fct_post_id kf b p = mk_prop PKProp (Property.ip_of_ensures kf Kglobal b p) let mk_call_pre_id called_kf s_call called_pre called_pre_p = let kind = PKPre (called_kf, s_call, called_pre) in mk_prop kind called_pre_p (*----------------------------------------------------------------------------*) let kind_order = function | PKProp -> 0 | PKPre _ -> 1 | PKEstablished -> 2 | PKPreserved -> 3 | PKVarPos -> 4 | PKVarDecr -> 5 | PKPropLoop -> 6 | PKAFctOut -> 7 | PKAFctExit -> 8 | PKCheck -> 9 | PKTactic -> 10 let compare_kind k1 k2 = match k1, k2 with PKPre (kf1, ki1, p1), PKPre (kf2, ki2, p2) -> let cmp = Kernel_function.compare kf1 kf2 in if cmp <> 0 then cmp else let cmp = Stmt.compare ki1 ki2 in if cmp <> 0 then cmp else Property.compare p1 p2 | _,_ -> Transitioning.Stdlib.compare (kind_order k1) (kind_order k2) let compare_prop_id pid1 pid2 = (* This order of comparison groups together prop_pids with same properties *) let p1 = property_of_id pid1 in let p2 = property_of_id pid2 in let cmp = Description.full_compare p1 p2 in if cmp <> 0 then cmp else let cmp = compare_kind pid2.p_kind pid1.p_kind in if cmp <> 0 then cmp else Transitioning.Stdlib.compare pid1.p_part pid2.p_part module PropId = Datatype.Make_with_collections( struct type t = prop_id include Datatype.Undefined let name = "WpAnnot.prop_id" let reprs = List.map (fun x -> { p_kind = PKProp; p_prop = x; p_part = None }) Property.reprs let hash pid = Property.hash pid.p_prop let compare = compare_prop_id let equal pid1 pid2 = compare_prop_id pid1 pid2 = 0 let copy = Datatype.undefined let rehash = Datatype.identity let internal_pretty_code = Datatype.undefined let pretty = Datatype.undefined let mem_project = Datatype.never_any_project let varname = Datatype.undefined end) (* -------------------------------------------------------------------------- *) (* --- Lagacy Naming --- *) (* -------------------------------------------------------------------------- *) module NameUniquify(D:Datatype.S_with_collections)(S:sig val name: string val basename: D.t -> string end) : sig val unique_basename: D.t -> string end = struct module NamesTbl = State_builder.Hashtbl(Datatype.String.Hashtbl)(Datatype.Int) (struct let name = S.name^"Names" let dependencies = [ ] let size = 97 end) module IndexTbl = State_builder.Hashtbl(D.Hashtbl)(Datatype.String) (struct let name = S.name^"Index" let dependencies = [ Ast.self; NamesTbl.self; Globals.Functions.self; Annotations.code_annot_state; Annotations.funspec_state; Annotations.global_state ] let size = 97 end) (** returns the name that should be returned by the function [get_prop_name_id] if the given property has [name] as basename. That name is reserved so that [get_prop_name_id prop] can never return an identical name. *) let reserve_name_id pid = let basename = S.basename pid in try let speed_up_start = NamesTbl.find basename in (* this basename is already reserved *) let n,unique_name = Extlib.make_unique_name NamesTbl.mem ~sep:"_" ~start:speed_up_start basename in NamesTbl.replace basename (succ n) ; (* to speed up Extlib.make_unique_name for next time *) unique_name with Not_found -> (* first time that basename is reserved *) NamesTbl.add basename 2 ; basename (** returns a unique name identifying the property. This name is built from the basename of the property. *) let unique_basename pid = try IndexTbl.find pid with Not_found -> (* first time we are asking for a name for that [ip] *) let unique_name = reserve_name_id pid in IndexTbl.add pid unique_name ; unique_name end module LegacyNames : sig val get_prop_id_name: prop_id -> string end = struct let base_id_prop_txt = Property.LegacyNames.get_prop_name_id let basename_of_prop_id p = match p.p_kind , p.p_prop with | (PKTactic | PKCheck | PKProp | PKPropLoop) , p -> base_id_prop_txt p | PKEstablished , p -> base_id_prop_txt p ^ "_established" | PKPreserved , p -> base_id_prop_txt p ^ "_preserved" | PKVarDecr , p -> base_id_prop_txt p ^ "_decrease" | PKVarPos , p -> base_id_prop_txt p ^ "_positive" | PKAFctOut , p -> base_id_prop_txt p ^ "_normal" | PKAFctExit , p -> base_id_prop_txt p ^ "_exit" | PKPre(_kf,stmt,pre) , _ -> let kf_name_of_stmt = Kernel_function.get_name (Kernel_function.find_englobing_kf stmt) in Printf.sprintf "%s_call_%s" kf_name_of_stmt (base_id_prop_txt pre) (** function used to normalize basename *) let normalize_basename s = (* truncates basename in order to limit length of file name *) let max_len = Wp_parameters.TruncPropIdFileName.get () in if max_len > 0 && String.length s > max_len then if max_len > 3 then (String.sub s 0 (max_len-3)) ^ "___" else String.sub s 0 max_len else s (** returns the normalized basename of the property. *) let get_prop_id_basename p = let basename = basename_of_prop_id p in let basename = match p.p_part with | None -> basename | Some(k,n) -> if n < 10 then Printf.sprintf "%s_part%d" basename (succ k) else if n < 100 then Printf.sprintf "%s_part%02d" basename (succ k) else if n < 1000 then Printf.sprintf "%s_part%03d" basename (succ k) else Printf.sprintf "%s_part%06d" basename (succ k) in normalize_basename basename module UniquifyPropId = NameUniquify(PropId)(struct let name = "WpProperty" let basename = get_prop_id_basename end) (** returns a unique name identifying the property. This name is built from the basename of the property. *) let get_prop_id_name pid = UniquifyPropId.unique_basename pid end (* -------------------------------------------------------------------------- *) (* --- Naming Properties --- *) (* -------------------------------------------------------------------------- *) module Names: sig val get_prop_id_name: prop_id -> string end = struct (** Uniquify the first part of the prop_id *) module Uniquify1 = NameUniquify(Property)(struct let name = "Wp.WpPropId.Names." let basename ip = let truncate = max 20 (Wp_parameters.TruncPropIdFileName.get ()) in Property.Names.get_prop_basename ~truncate ip end) let get_ip ip = Uniquify1.unique_basename ip (** Uniquify call-site for precondition check. So that precondition of the same call-site are grouped *) module CallSite = Datatype.Triple_with_collections (Kernel_function)(Kernel_function)(Stmt) (struct let module_name = "Wp.WpPropId.CallSite" end) module Uniquify_Stmt = NameUniquify(CallSite)(struct let name = "Wp.WpPropId.Names3." let basename (caller_kf,callee_kf,_stmt) = (Kernel_function.get_name caller_kf)^"_call_"^(Kernel_function.get_name callee_kf) end) let get_prop_id_base p = match p.p_kind , p.p_prop with | (PKTactic | PKCheck | PKProp | PKPropLoop) , p -> get_ip p | PKEstablished , p -> get_ip p ^ "_established" | PKPreserved , p -> get_ip p ^ "_preserved" | PKVarDecr , p -> get_ip p ^ "_decrease" | PKVarPos , p -> get_ip p ^ "_positive" | PKAFctOut , p -> get_ip p ^ "_normal" | PKAFctExit , p -> get_ip p ^ "_exit" | PKPre(callee_kf,stmt,pre) , _ -> let caller_kf = Kernel_function.find_englobing_kf stmt in let call_string = Uniquify_Stmt.unique_basename (caller_kf,callee_kf,stmt) in (** remove name of callee kernel function given by get_ip *) let ip_string = get_ip pre in let ip_string = Extlib.opt_conv ip_string (Extlib.string_del_prefix ((Kernel_function.get_name callee_kf)^"_") ip_string) in call_string^"_"^ip_string let get_prop_id_basename p = let basename = get_prop_id_base p in match p.p_part with | None -> basename | Some(k,n) -> if n < 10 then Printf.sprintf "%s_part%d" basename (succ k) else if n < 100 then Printf.sprintf "%s_part%02d" basename (succ k) else if n < 1000 then Printf.sprintf "%s_part%03d" basename (succ k) else Printf.sprintf "%s_part%06d" basename (succ k) module Uniquify2 = NameUniquify(PropId)(struct let name = "Wp.WpPropId.Names2." let basename = get_prop_id_basename end) let get_prop_id_name p = Uniquify2.unique_basename p end (* -------------------------------------------------------------------------- *) (* --- Naming Accessors --- *) (* -------------------------------------------------------------------------- *) let get_legacy = LegacyNames.get_prop_id_name (** Legacy property PO name *) let get_propid = Names.get_prop_id_name (** Name related to a property PO *) let pp_propid fmt pid = Format.pp_print_string fmt (get_propid pid) let pp_names fmt l = match l with [] -> () | _ -> Format.fprintf fmt "_%a" (Wp_error.pp_string_list ~empty:"" ~sep:"_") l let ident_names names = List.filter (function "" -> true | _ as n -> '\"' <> (String.get n 0) ) names let code_annot_names ca = match ca.annot_content with | AAssert (_, Check, named_pred) -> "@check"::(ident_names named_pred.pred_name) | AAssert (_, Assert, named_pred) -> "@assert"::(ident_names named_pred.pred_name) | AInvariant (_,_,named_pred) -> "@invariant"::(ident_names named_pred.pred_name) | AVariant (term, _) -> "@variant"::(ident_names term.term_name) | AExtended(_,_,{ext_name}) -> [Printf.sprintf "@%s" ext_name] | _ -> [] (* TODO : add some more names ? *) (** This is used to give the name of the property that the user can give * to select it from the command line (-wp-prop option) *) let user_prop_names p = let open Property in match p with | IPPredicate {ip_kind; ip_pred} -> Format.asprintf "@@%a" Property.pretty_predicate_kind ip_kind :: ip_pred.ip_content.pred_name | IPExtended {ie_ext={ext_name}} -> [ Printf.sprintf "@%s" ext_name ] | IPCodeAnnot {ica_ca} -> code_annot_names ica_ca | IPComplete {ic_bhvs} -> let kind_name = "@complete_behaviors" in let name = Format.asprintf "complete_behaviors%a" pp_names ic_bhvs in kind_name::[name] | IPDisjoint {ic_bhvs} -> let kind_name = "@disjoint_behaviors" in let name = Format.asprintf "disjoint_behaviors%a" pp_names ic_bhvs in kind_name::[name] | IPAssigns {ias_froms} -> List.fold_left (fun acc (t,_) -> (ident_names t.it_content.term_name) @ acc) ["@assigns"] ias_froms | IPDecrease {id_ca=Some ca} -> "@decreases"::code_annot_names ca | IPDecrease _ -> [ "@decreases" ] | IPLemma {il_name = a; il_pred = l} -> let names = "@lemma"::a::(ident_names l.pred_name) in begin match LogicUsage.section_of_lemma a with | LogicUsage.Toplevel _ -> names | LogicUsage.Axiomatic ax -> ax.LogicUsage.ax_name::names end (* TODO *) | IPFrom _ | IPAllocation _ | IPAxiomatic _ | IPAxiom _ | IPBehavior _ | IPReachable _ | IPPropertyInstance _ | IPTypeInvariant _ | IPGlobalInvariant _ | IPOther _ -> [] let string_of_termination_kind = function Normal -> "post" | Exits -> "exits" | Breaks -> "breaks" | Continues -> "continues" | Returns -> "returns" let label_of_kind = function | PKTactic -> "Tactic" | PKCheck -> "Check" | PKProp -> "Property" | PKPropLoop -> "Invariant" (* should be assert false ??? *) | PKEstablished -> "Establishment" | PKPreserved -> "Preservation" | PKVarDecr -> "Decreasing" | PKVarPos -> "Positive" | PKAFctOut -> "Function assigns" | PKAFctExit -> "Exit assigns" | PKPre(kf,_,_) -> Printf.sprintf "Precondition for '%s'" (Kernel_function.get_name kf) let label_of_prop_id p = match p.p_part with | None -> label_of_kind p.p_kind | Some(k,n) -> Printf.sprintf "%s (%d/%d)" (label_of_kind p.p_kind) (succ k) n module Pretty = struct open Format let pp_part fmt p = match p.p_part with | None -> () | Some(k,n) -> fprintf fmt " (%d/%d)" (succ k) n let pp_subprop fmt p = match p.p_kind with | PKProp | PKTactic | PKCheck | PKPropLoop -> () | PKEstablished -> pp_print_string fmt " (established)" | PKPreserved -> pp_print_string fmt " (preserved)" | PKVarDecr -> pp_print_string fmt " (decrease)" | PKVarPos -> pp_print_string fmt " (positive)" | PKAFctOut -> pp_print_string fmt " (return)" | PKAFctExit -> pp_print_string fmt " (exit)" | PKPre(kf,_,_) -> fprintf fmt " (call '%s')" (Kernel_function.get_name kf) let pp_prop fmt p = Description.pp_localized ~kf:`Never ~ki:false ~kloc:false fmt p.p_prop let pp_local fmt p = begin pp_prop fmt p ; pp_subprop fmt p ; pp_part fmt p ; end end let pretty_local = Pretty.pp_local (* -------------------------------------------------------------------------- *) (* --- Hints --- *) (* -------------------------------------------------------------------------- *) type hints = { mutable required : string list ; mutable hints : string list ; } let add_hint hs x = if not (List.mem x hs.hints) then hs.hints <- x :: hs.hints let add_required hs x = if not (List.mem x hs.required) then hs.required <- x :: hs.required let stmt_hints hs s = List.iter (fun label -> match label with | Label(a,_,src) -> if src then add_hint hs a | Default _ -> add_hint hs "default" | Case(e,_) -> match Ctypes.get_int64 e with | Some k -> add_hint hs ("case-" ^ Int64.to_string k) | None -> () ) s.labels let kinstr_hints hs = function | Kstmt s -> stmt_hints hs s | Kglobal -> () let propid_hints hs p = let open Property in match p.p_kind , p.p_prop with | PKCheck , _ -> () | PKProp , IPAssigns {ias_kinstr=Kstmt _} -> add_required hs "stmt-assigns" | PKProp , IPAssigns {ias_kinstr=Kglobal} -> add_required hs "fct-assigns" | PKPropLoop , Property.IPAssigns _ -> add_required hs "loop-assigns" | PKPropLoop , _ -> add_required hs "invariant" | PKProp , _ -> add_required hs "property" | PKTactic , _ -> add_required hs "tactic" | PKEstablished , _ -> add_required hs "established" | PKPreserved , _ -> add_required hs "preserved" | PKVarDecr , _ -> add_required hs "decrease" | PKVarPos , _ -> add_required hs "positive" | PKAFctOut , _ -> add_required hs "return" | PKAFctExit , _ -> add_required hs "exit" | PKPre(kf,st,_) , _ -> add_required hs ("precond-" ^ Kernel_function.get_name kf) ; stmt_hints hs st let rec term_hints hs t = match t.term_node with | TLval(lv,_) -> lval_hints hs lv | TAddrOf(lv,_) -> lval_hints hs lv | TCastE(_,t) -> term_hints hs t | TBinOp((PlusPI|IndexPI|MinusPI),a,_) -> term_hints hs a | Tlet(_,t) -> term_hints hs t | _ -> () and lval_hints hs = function | TVar { lv_origin=Some { vorig_name=x } } | TVar { lv_name=x } -> add_hint hs x | TResult _ -> add_hint hs "result" | TMem t -> add_hint hs "*" ; term_hints hs t let assigns_hints hs froms = List.iter (fun ({it_content=t},_) -> term_hints hs t) froms let annot_hints hs = function | AAssert(bs,_,ipred) | AInvariant(bs,_,ipred) -> List.iter (add_hint hs) (ident_names ipred.pred_name) ; List.iter (add_hint hs) bs | AAssigns(bs,Writes froms) -> List.iter (add_hint hs) bs ; assigns_hints hs froms | AAllocation _ | AAssigns(_,WritesAny) | AStmtSpec _ | AVariant _ | APragma _ | AExtended _ -> () let property_hints hs = let open Property in function | IPAxiom {il_name; il_pred} | IPLemma {il_name; il_pred} -> List.iter (add_required hs) (il_name::il_pred.pred_name) | IPBehavior _ -> () | IPComplete {ic_bhvs} | IPDisjoint {ic_bhvs} -> List.iter (add_required hs) ic_bhvs | IPPredicate {ip_pred} -> List.iter (add_hint hs) ip_pred.ip_content.pred_name | IPExtended {ie_ext={ext_name}} -> List.iter (add_hint hs) [ext_name] | IPCodeAnnot {ica_ca} -> annot_hints hs ica_ca.annot_content | IPAssigns {ias_froms} -> assigns_hints hs ias_froms | IPAllocation _ (* TODO *) | IPFrom _ | Property.IPDecrease _ | Property.IPPropertyInstance _ | IPReachable _ | Property.IPAxiomatic _ | Property.IPOther _ | IPTypeInvariant _ | Property.IPGlobalInvariant _ -> () let prop_id_keys p = begin let hs = { hints=[] ; required=[] } in let opt add f = function None -> () | Some x -> add hs (f x) in propid_hints hs p ; property_hints hs p.p_prop ; opt add_required Kernel_function.get_name (Property.get_kf p.p_prop) ; opt add_required (fun b -> if Cil.is_default_behavior b then "default" else b.b_name) (Property.get_behavior p.p_prop) ; opt add_hint (fun (k,_) -> Printf.sprintf "part-%d" k) p.p_part ; kinstr_hints hs (Property.get_kinstr p.p_prop) ; List.sort String.compare hs.required , List.sort String.compare hs.hints end (*----------------------------------------------------------------------------*) (* Pretty-Print *) (*----------------------------------------------------------------------------*) let pp_goal_kind fmt = function | PKTactic | PKCheck | PKProp | PKPropLoop | PKAFctOut | PKAFctExit | PKPre _ -> () | PKEstablished -> Format.pp_print_string fmt "Establishment of " | PKPreserved -> Format.pp_print_string fmt "Preservation of " | PKVarDecr -> Format.pp_print_string fmt "Decreasing of " | PKVarPos -> Format.pp_print_string fmt "Positivity of " let pp_goal_part fmt = function | None -> () | Some(k,n) -> Format.fprintf fmt " (%d/%d)" (succ k) n let pretty fmt pid = begin pp_goal_kind fmt pid.p_kind ; Description.pp_property fmt pid.p_prop ; pp_goal_part fmt pid.p_part ; end let pretty_context kf fmt pid = begin pp_goal_kind fmt pid.p_kind ; Description.pp_localized ~kf ~ki:true ~kloc:true fmt pid.p_prop ; pp_goal_part fmt pid.p_part ; end (*----------------------------------------------------------------------------*) (* Comparison *) (*----------------------------------------------------------------------------*) let is_check p = p.p_kind = PKCheck let is_tactic p = p.p_kind = PKTactic let is_assigns p = match property_of_id p with | Property.IPAssigns _ -> true | _ -> false let is_requires = let open Property in function | IPPredicate {ip_kind = PKRequires _} -> true | _ -> false let is_loop_preservation p = match p.p_kind with | PKPreserved -> begin match Property.get_kinstr p.p_prop with | Kglobal -> Wp_parameters.fatal "Loop Preservation ? (%a)" Property.pretty p.p_prop | Kstmt st -> Some st end | _ -> None let user_prop_pid pid = let p_prop = match pid.p_kind with | PKPre (_,_,p_prop) -> p_prop | _ -> property_of_id pid in user_prop_names p_prop let select_default pid = let names = user_prop_pid pid in not (List.mem "no_wp" names) let select_by_name asked_names pid = let names = user_prop_pid pid in if List.mem "no_wp" names then false else let is_minus s = try s.[0] = '-' with _ -> false in let is_plus s = try s.[0] = '+' with _ -> false in let remove_first s = String.sub s 1 ((String.length s) -1) in let eval acc asked = let is_minus,a = match acc with | None -> if is_minus asked then true,true else false,false | Some a -> (is_minus asked),a in let eval () = let asked = if is_minus || (is_plus asked) then remove_first asked else asked in List.mem asked names in Some (if is_minus then a && (not (eval ())) else a || (eval ())) in match List.fold_left eval None asked_names with | Some false -> false | _ -> true let select_call_pre s_call asked_pre pid = match pid.p_kind with | PKPre (_, p_stmt, p_prop) -> Stmt.equal s_call p_stmt && (match asked_pre with | None -> true | Some asked_pre -> Property.equal p_prop asked_pre) | _ -> false (*----------------------------------------------------------------------------*) (* About assigns identification *) (*----------------------------------------------------------------------------*) type a_kind = LoopAssigns | StmtAssigns type effect_source = FromCode | FromCall | FromReturn type assigns_desc = { a_label : Clabels.c_label ; a_stmt : Cil_types.stmt option ; a_kind : a_kind ; a_assigns : Cil_types.assigns ; } let mk_asm_assigns_desc s = { a_label = Clabels.stmt s ; a_stmt = Some s ; a_kind = StmtAssigns ; a_assigns = WritesAny ; } let mk_loop_assigns_desc s assigns = { a_label = Clabels.stmt s ; a_stmt = Some s ; a_kind = LoopAssigns ; a_assigns = Writes assigns } let mk_stmt_assigns_desc s assigns = { a_label = Clabels.stmt s ; a_stmt = Some s ; a_kind = StmtAssigns ; a_assigns = Writes assigns ; } let mk_init_assigns = { a_label = Clabels.init ; a_stmt = None ; a_kind = StmtAssigns ; a_assigns = WritesAny ; } (* (** kf assigns for normal path when there is an exit path *) let mk_fout_assigns_desc assigns = { a_label = Logic_const.pre_label ; (* a_fun = Assigns_FctOut ; *) a_kind = StmtAssigns ; a_assigns = Writes assigns ; } (** kf assigns for exit path *) let mk_exit_assigns_desc assigns = { a_label = Logic_const.pre_label ; (* a_fun = Assigns_FctExit ; *) a_kind = StmtAssigns ; a_assigns = Writes assigns ; } *) let mk_kf_assigns_desc assigns = { a_label = Clabels.pre ; a_stmt = None ; a_kind = StmtAssigns ; a_assigns = Writes assigns ; } let is_call_assigns = function | {a_stmt=Some {skind=Instr(Call _ | Local_init (_, ConsInit _, _)) } } -> true | _ -> false let pp_assigns_desc fmt a = Wp_error.pp_assigns fmt a.a_assigns (*----------------------------------------------------------------------------*) (** * 2 kinds of annotations can be found : predicates and assigns. * because assigns properties can only be translated into predicates * by the memory model. * - Assigns properties are composed of the assigns list from Cil, * and a label to know where to stop. * - Predicates are just the predicate type from Cil. *) (*----------------------------------------------------------------------------*) type pred_info = prop_id * Cil_types.predicate let mk_pred_info id p = (id, p) let pred_info_id (id, _) = id let pp_pred_of_pred_info fmt (_id, p) = Printer.pp_predicate fmt p let pp_pred_info fmt (id, p) = Format.fprintf fmt "(@[%a:@ %a@])" pp_propid id Printer.pp_predicate p type assigns_info = prop_id * assigns_desc let assigns_info_id (id,_) = id type assigns_full_info = AssignsLocations of assigns_info | AssignsAny of assigns_desc | NoAssignsInfo let empty_assigns_info = NoAssignsInfo let mk_assigns_info id a = AssignsLocations (id, a) let mk_stmt_any_assigns_info s = let a = { a_label = Clabels.stmt s ; a_stmt = Some s ; a_kind = StmtAssigns ; a_assigns = WritesAny ; } in AssignsAny a let mk_kf_any_assigns_info () = let a = { a_label = Clabels.pre ; a_stmt = None ; a_kind = StmtAssigns ; a_assigns = WritesAny ; } in AssignsAny a let mk_loop_any_assigns_info s = let a = { a_label = Clabels.stmt s ; a_stmt = Some s ; a_kind = LoopAssigns ; a_assigns = WritesAny ; } in AssignsAny a (* let pp_assigns_id (id, _a) = pp_propid id *) let pp_assign_info k fmt a = match a with | NoAssignsInfo -> () | AssignsAny a -> let pkind = match a.a_kind with | StmtAssigns -> "" | LoopAssigns -> "loop" in Format.fprintf fmt "%s(@@%a): %s assigns everything@." k Clabels.pretty a.a_label pkind | AssignsLocations (_,a) -> Format.fprintf fmt "%s(@@%a): %a@." k Clabels.pretty a.a_label pp_assigns_desc a let merge_assign_info a1 a2 = match a1,a2 with | NoAssignsInfo, a | a, NoAssignsInfo -> a | (AssignsLocations _ | AssignsAny _), (AssignsLocations _ | AssignsAny _) -> Wp_parameters.fatal "Several assigns ?" type axiom_info = prop_id * LogicUsage.logic_lemma let mk_axiom_info lemma = let id = mk_lemma_id lemma in (id, lemma) let pp_axiom_info fmt (id,thm) = Format.fprintf fmt "(@[%a:@ %a@])" pp_propid id Printer.pp_predicate thm.LogicUsage.lem_property (* -------------------------------------------------------------------------- *) (* --- Prop Splitter --- *) (* -------------------------------------------------------------------------- *) (* prop-id splitter *) let _split job pid goals = let n = Bag.length goals in if n <= 1 then Bag.iter (job pid) goals else let k = ref 0 in Bag.iter (fun g -> let pid_k = mk_part pid (!k,n) in incr k ; job pid_k g) goals (*----------------------------------------------------------------------------*) (** About proofs *) (*----------------------------------------------------------------------------*) let subproofs id = match id.p_kind with | PKCheck -> 0 | PKProp | PKTactic | PKPre _ | PKPropLoop -> 1 | PKEstablished | PKPreserved | PKVarDecr | PKVarPos | PKAFctExit | PKAFctOut -> 2 let subproof_idx id = match id.p_kind with | PKCheck -> (-1) (* 0/0 *) | PKProp | PKTactic | PKPre _ | PKPropLoop -> 0 (* 1/1 *) | PKPreserved -> 0 (* 1/2 *) | PKEstablished-> 1 (* 2/2 *) | PKVarDecr -> 0 (* 1/2 *) | PKVarPos -> 1 (* 2/2 *) | PKAFctOut -> 0 (* 1/2 *) | PKAFctExit -> 1 (* 2/2 *) (** find the outer loop in which the stmt is. *) let get_loop_stmt kf stmt = (* because we don't have the cfg here, we can only use Cil information, * and then we can only recognize syntactic loops... TODO: use the cfg ? *) let rec is_in_blk b = List.exists is_in_stmt b.bstmts and is_in_stmt s = if s.sid = stmt.sid then true else match s.skind with | If (_, b1, b2,_) -> is_in_blk b1 || is_in_blk b2 | Switch (_, b, _, _) | Block b -> is_in_blk b | UnspecifiedSequence seq -> let b = Cil.block_from_unspecified_sequence seq in is_in_blk b | Loop (_, b, _, _, _) -> is_in_blk b | _ -> false and find_loop_in_blk blk = find_loop_in_stmts blk.bstmts and find_loop_in_stmts l = match l with | [] -> None | s::tl -> (match find_loop_in_stmt s with Some l -> Some l | None -> find_loop_in_stmts tl) and find_loop_in_stmt s = match s.skind with | (Loop _) -> if is_in_stmt s then Some s else None | If (_, b1, b2,_) -> (match find_loop_in_blk b1 with Some l -> Some l | None -> find_loop_in_blk b2) | Switch (_, b, _, _) | Block b -> find_loop_in_blk b | UnspecifiedSequence seq -> let b = Cil.block_from_unspecified_sequence seq in find_loop_in_blk b | _ -> None in let f = Kernel_function.get_definition kf in find_loop_in_blk f.sbody (** Quite don't understand what is going on here... what is it supposed to do ? * [2011-07-07-Anne] *) let get_induction p = let get_stmt = let open Property in function | IPDecrease {id_kf;id_kinstr=Kstmt stmt} -> Some (id_kf, stmt) | IPCodeAnnot {ica_kf;ica_stmt} -> Some (ica_kf, ica_stmt) | IPAssigns {ias_kf; ias_kinstr=Kstmt stmt} -> Some (ias_kf, stmt) | _ -> None in match p.p_kind with | PKCheck | PKAFctOut|PKAFctExit|PKPre _ | PKTactic -> None | PKProp -> let loop_stmt_opt = match get_stmt (property_of_id p) with | None -> None | Some (kf, s) -> get_loop_stmt kf s in loop_stmt_opt | PKPropLoop -> let open Property in let loop_stmt_opt = match property_of_id p with | IPCodeAnnot {ica_kf; ica_stmt; ica_ca = {annot_content = AInvariant(_, loop, _)}} -> if loop then (*loop invariant *) Some ica_stmt else (* invariant inside loop *) get_loop_stmt ica_kf ica_stmt | IPAssigns {ias_kinstr=Kstmt stmt; ias_bhv = Id_loop _} -> (* loop assigns *) Some stmt | _ -> None (* assert false ??? *) in loop_stmt_opt | PKEstablished|PKVarDecr|PKVarPos|PKPreserved -> (match get_stmt (property_of_id p) with | None -> None | Some (_, s) -> Some s) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpPropId.mli����������������������������������������������������0000666�0000000�0000000�00000024073�13571573400�016366� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open LogicUsage (** Beside the property identification, it can be found in different contexts * depending on which part of the computation is involved. * For instance, properties on loops are split in 2 parts : establishment and * preservation. *) (** Property.t information and kind of PO (establishment, preservation, etc) *) type prop_id (** returns the annotation which lead to the given PO. Dynamically exported. *) val property_of_id : prop_id -> Property.t val source_of_id : prop_id -> Filepath.position (*----------------------------------------------------------------------------*) module PropId : Datatype.S with type t = prop_id (*----------------------------------------------------------------------------*) val compare_prop_id : prop_id -> prop_id -> int val tactical : gid:string -> prop_id val is_check : prop_id -> bool val is_tactic : prop_id -> bool val is_assigns : prop_id -> bool val is_requires : Property.t -> bool val is_loop_preservation : prop_id -> stmt option (** test if the prop_id does not have a [no_wp:] in its name(s). *) val select_default : prop_id -> bool (** test if the prop_id has to be selected for the asked name. Also returns a debug message to explain then answer. Includes a test for [no_wp:]. *) val select_by_name : string list -> prop_id -> bool (** test if the prop_id has to be selected when we want to select the call * precondition the the [stmt] call (None means all the call preconditions). * Also returns a debug message to explain then answer. *) val select_call_pre : stmt -> Property.t option -> prop_id -> bool (*----------------------------------------------------------------------------*) val prop_id_keys : prop_id -> string list * string list (* required , hints *) val get_propid : prop_id -> string (** Unique identifier of [prop_id] *) val get_legacy : prop_id -> string (** Unique legacy identifier of [prop_id] *) val pp_propid : Format.formatter -> prop_id -> unit (** Print unique id of [prop_id] *) type prop_kind = | PKTactic (** tactical sub-goal *) | PKCheck (** internal check *) | PKProp (** normal property *) | PKEstablished (** computation related to a loop property before the loop. *) | PKPreserved (** computation related to a loop property inside the loop. *) | PKPropLoop (** loop property used as hypothesis inside a loop. *) | PKVarDecr (** computation related to the decreasing of a variant in a loop *) | PKVarPos (** computation related to a loop variant being positive *) | PKAFctOut (** computation related to the function assigns on normal termination *) | PKAFctExit (** computation related to the function assigns on exit termination *) | PKPre of kernel_function * stmt * Property.t (** precondition for function at stmt, property of the require. Many information that should come from the p_prop part of the prop_id, but in the PKPre case, it seems that it is hidden in a IPBlob property ! *) val pretty : Format.formatter -> prop_id -> unit val pretty_context : Description.kf -> Format.formatter -> prop_id -> unit val pretty_local : Format.formatter -> prop_id -> unit (** Short description of the kind of PO *) val label_of_prop_id: prop_id -> string (** TODO: should probably be somewhere else *) val string_of_termination_kind : termination_kind -> string val num_of_bhv_from : funbehavior -> from -> int (*----------------------------------------------------------------------------*) val mk_code_annot_ids : kernel_function -> stmt -> code_annotation -> prop_id list val mk_assert_id : kernel_function -> stmt -> code_annotation -> prop_id (** Invariant establishment and preservation *) val mk_loop_inv_id : kernel_function -> stmt -> established:bool -> code_annotation -> prop_id (** Invariant used as hypothesis *) val mk_inv_hyp_id : kernel_function -> stmt -> code_annotation -> prop_id (** Variant decrease *) val mk_var_decr_id : kernel_function -> stmt -> code_annotation -> prop_id (** Variant positive *) val mk_var_pos_id : kernel_function -> stmt -> code_annotation -> prop_id (** \from property of loop assigns. Must not be [FromAny] *) val mk_loop_from_id : kernel_function -> stmt -> code_annotation -> from -> prop_id (** \from property of function or statement behavior assigns. Must not be [FromAny] *) val mk_bhv_from_id : kernel_function -> kinstr -> string list -> funbehavior -> from -> prop_id (** \from property of function behavior assigns. Must not be [FromAny]. *) val mk_fct_from_id : kernel_function -> funbehavior -> termination_kind -> from -> prop_id (** disjoint behaviors property. See {!Property.ip_of_disjoint} for more information *) val mk_disj_bhv_id : kernel_function * kinstr * string list * string list -> prop_id (** complete behaviors property. See {!Property.ip_of_complete} for more information *) val mk_compl_bhv_id : kernel_function * kinstr * string list * string list -> prop_id val mk_decrease_id : kernel_function * kinstr * variant -> prop_id (** axiom identification *) val mk_lemma_id : logic_lemma -> prop_id val mk_stmt_assigns_id : kernel_function -> stmt -> string list -> funbehavior -> from list -> prop_id option val mk_loop_assigns_id : kernel_function -> stmt -> code_annotation -> from list -> prop_id option (** function assigns *) val mk_fct_assigns_id : kernel_function -> funbehavior -> termination_kind -> from list -> prop_id option val mk_pre_id : kernel_function -> kinstr -> funbehavior -> identified_predicate -> prop_id val mk_stmt_post_id : kernel_function -> stmt -> funbehavior -> termination_kind * identified_predicate -> prop_id val mk_fct_post_id : kernel_function -> funbehavior -> termination_kind * identified_predicate -> prop_id (** [mk_call_pre_id called_kf s_call called_pre] *) val mk_call_pre_id : kernel_function -> stmt -> Property.t -> Property.t -> prop_id val mk_property : Property.t -> prop_id val mk_check : Property.t -> prop_id (*----------------------------------------------------------------------------*) type a_kind = LoopAssigns | StmtAssigns type assigns_desc = private { a_label : Clabels.c_label ; a_stmt : Cil_types.stmt option ; a_kind : a_kind ; a_assigns : Cil_types.assigns ; } val pp_assigns_desc : Format.formatter -> assigns_desc -> unit type effect_source = FromCode | FromCall | FromReturn type assigns_info = prop_id * assigns_desc val assigns_info_id : assigns_info -> prop_id type assigns_full_info = private AssignsLocations of assigns_info | AssignsAny of assigns_desc | NoAssignsInfo val empty_assigns_info : assigns_full_info val mk_assigns_info : prop_id -> assigns_desc -> assigns_full_info val mk_stmt_any_assigns_info : stmt -> assigns_full_info val mk_kf_any_assigns_info : unit -> assigns_full_info val mk_loop_any_assigns_info : stmt -> assigns_full_info val pp_assign_info : string -> Format.formatter -> assigns_full_info -> unit val merge_assign_info : assigns_full_info -> assigns_full_info -> assigns_full_info val mk_loop_assigns_desc : stmt -> from list -> assigns_desc val mk_stmt_assigns_desc : stmt -> from list -> assigns_desc val mk_asm_assigns_desc : stmt -> assigns_desc val mk_kf_assigns_desc : from list -> assigns_desc val mk_init_assigns : assigns_desc val is_call_assigns : assigns_desc -> bool (*----------------------------------------------------------------------------*) type axiom_info = prop_id * LogicUsage.logic_lemma val mk_axiom_info : LogicUsage.logic_lemma -> axiom_info val pp_axiom_info : Format.formatter -> axiom_info -> unit type pred_info = (prop_id * Cil_types.predicate) val mk_pred_info : prop_id -> Cil_types.predicate -> pred_info val pred_info_id : pred_info -> prop_id val pp_pred_of_pred_info : Format.formatter -> pred_info -> unit val pp_pred_info : Format.formatter -> pred_info -> unit (*----------------------------------------------------------------------------*) (** [mk_part pid (k, n)] build the identification for the [k/n] part of [pid].*) val mk_part : prop_id -> (int * int) -> prop_id (** get the 'kind' information. *) val kind_of_id : prop_id -> prop_kind (** get the 'part' information. *) val parts_of_id : prop_id -> (int * int) option (** How many subproofs *) val subproofs : prop_id -> int (** subproof index of this propr_id *) val subproof_idx : prop_id -> int val get_induction : prop_id -> stmt option (*----------------------------------------------------------------------------*) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpRTE.ml��������������������������������������������������������0000666�0000000�0000000�00000011300�13571573400�015437� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let dkey = Wp_parameters.register_category "rte" type t = { name : string ; cint : bool ; kernel : (unit -> bool) ; option : string ; status : (unit -> Db.RteGen.status_accessor) ref ; } let option name = try name = "" || Dynamic.Parameter.Bool.get name () with _ -> false let status db kf = try (* Absolutely forbidden to use 'set' from Db.RteGen : this disables the generation of the associated RTE. *) let (_,_,get) = (!db) () in get kf with Failure _ -> Wp_parameters.warning ~once:true "Missing RTE plug-in: can not generate conditions" ; false let always _ = true let configure ~update ~generate kf cint rte = if not rte.cint || rte.kernel () then begin (* need RTE guard, but kernel option is set *) if not (status rte.status kf) then begin if option rte.option then let msg = if generate then "generate" else "missing" in Wp_parameters.debug ~dkey "function %a: %s rte for %s" Kernel_function.pretty kf msg rte.name ; else Wp_parameters.warning ~once:true ~current:false "-wp-rte can annotate %s because %s is not set" rte.name rte.option ; update := true ; end end else if generate then match cint with | Cint.Machine -> () (* RTE has been set *) | Cint.Natural -> Wp_parameters.warning ~once:true ~current:false "-wp-rte and model nat require kernel to warn against %s" rte.name let generator = [ { name = "memory access" ; kernel = always ; option = "-rte-mem" ; cint = false ; status = Db.RteGen.get_memAccess_status } ; { name = "division by zero" ; kernel = always ; option = "-rte-div" ; cint = false ; status = Db.RteGen.get_divMod_status } ; { name = "signed overflow" ; cint = true ; kernel = Kernel.SignedOverflow.get ; option = "" ; status = Db.RteGen.get_signedOv_status } ; { name = "unsigned overflow" ; cint = true ; kernel = Kernel.UnsignedOverflow.get ; option = "" ; status = Db.RteGen.get_unsignedOv_status } ; { name = "signed downcast" ; cint = true ; option = "" ; kernel = Kernel.SignedDowncast.get ; status = Db.RteGen.get_signed_downCast_status } ; { name = "unsigned downcast" ; cint = true ; option = "" ; kernel = Kernel.UnsignedDowncast.get ; status = Db.RteGen.get_unsignedDownCast_status } ; { name = "invalid bool value" ; cint = false ; option = "-warn-invalid-bool" ; kernel = Kernel.InvalidBool.get ; status = Db.RteGen.get_bool_value_status } ; ] let generate model kf = let update = ref false in let cint = WpContext.on_context (model,WpContext.Kf kf) Cint.current () in List.iter (configure ~update ~generate:true kf cint) generator ; if !update then !Db.RteGen.annotate_kf kf let missing_guards model kf = let update = ref false in let cint = WpContext.on_context (model,WpContext.Kf kf) Cint.current () in List.iter (configure ~update ~generate:false kf cint) generator ; !update (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpRTE.mli�������������������������������������������������������0000666�0000000�0000000�00000003650�13571573400�015621� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Invoke RTE to generate missing annotations for the given function and model. *) val generate : WpContext.model -> Kernel_function.t -> unit (** Returns [true] if RTE annotations should be generated for the given function and model (and are not generated yet). *) val missing_guards : WpContext.model -> Kernel_function.t -> bool ����������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpReport.ml�����������������������������������������������������0000666�0000000�0000000�00000073314�13571573400�016275� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Fast Report for WP --- *) (* -------------------------------------------------------------------------- *) let ladder = [| 1.0 ; 2.0 ; 3.0 ; 5.0 ; 10.0 ; 15.0 ; 20.0 ; 30.0 ; 40.0 ; 60.0 ; 90.0 ; 120.0 ; 180.0 ; (* 1', 1'30, 2', 3' *) 300.0 ; 600.0 ; 900.0 ; 1800.0 ; (* 5', 10', 15', 30' *) 3600.0 |] (* 1h *) (* -------------------------------------------------------------------------- *) (* --- Step Ranges --- *) (* -------------------------------------------------------------------------- *) let n0 = 16 let d0 = 4 (* Number of steps is divided into an infinite number of successive bundles. Each bundle number k=0,... is divided into n0 small intervals of size 2^k * d0. The rank r-th of a number n is the r-th interval in some bundle k. A number of steps is stabilized to its original rank r is it still belongs to the intervals that would be immediately before or after the original interval (in the _same_ bundle). *) let a0 = n0 * d0 let ak k = a0 lsl k - a0 (* first index of bundle k *) let dk k = d0 lsl k (* size of small intervals in bundle k *) (* Compute the range of values for rank k. If ~limit:false, returns all the values n that have the rank k. If ~limit:true, returns all the values n that are stabilized at rank k. *) let range ?(limit=true) r = let k = r / n0 in let i = r mod n0 in let a = ak k in let d = dk k in let i1 = if limit then i-1 else i in let i2 = if limit then i+2 else i+1 in max 1 (a + i1*d) , a + i2*d (* Compute the rank of number n *) let rank n = (* invariant a == ak k and a <= n *) let rec aux a k n = let b = ak (succ k) - 1 in if n <= b then let d = dk k in let i = (n-a) / d in n0 * k + i else aux b (succ k) n in let a = ak 0 in if n < a then (-1) else aux a 0 n (* -------------------------------------------------------------------------- *) (* --- Statistics --- *) (* -------------------------------------------------------------------------- *) type res = VALID | UNSUCCESS | INCONCLUSIVE | NORESULT let result (r:VCS.result) = match r.VCS.verdict with | VCS.NoResult | VCS.Checked | VCS.Computing _ -> NORESULT | VCS.Failed -> INCONCLUSIVE | VCS.Invalid | VCS.Unknown | VCS.Timeout | VCS.Stepout -> UNSUCCESS | VCS.Valid -> VALID let best_result a b = match a,b with | NORESULT,c | c,NORESULT -> c | VALID,_ | _,VALID -> VALID | UNSUCCESS,_ | _,UNSUCCESS -> UNSUCCESS | INCONCLUSIVE,INCONCLUSIVE -> INCONCLUSIVE type stats = { mutable valid : int ; (* Result is Valid *) mutable unsuccess : int ; (* verdict is NoResult, Unknown, Timeout, or Stepout, Invalid *) mutable inconclusive : int ; (* verdict is Failed *) mutable total : int ; (* valid + unsuccess + inconclusive *) mutable steps : int ; mutable time : float ; mutable rank : int ; } let stats () = { total=0 ; valid=0 ; unsuccess=0 ; inconclusive=0 ; steps=0 ; rank=(-1) ; time=0.0 ; } let add_stat (r:res) (st:int) (tm:float) (s:stats) = begin s.total <- succ s.total ; match r with | VALID -> if tm > s.time then s.time <- tm ; if st > s.steps then s.steps <- st ; s.valid <- succ s.valid | NORESULT | UNSUCCESS -> s.unsuccess <- succ s.unsuccess | INCONCLUSIVE -> s.inconclusive <- succ s.inconclusive end let add_qedstat (ts:float) (s:stats) = if ts > s.time then s.time <- ts let get_field js fd = try Json.field fd js with Not_found | Invalid_argument _ -> `Null let json_assoc fields = let fields = List.filter (fun (_,d) -> d<>`Null) fields in if fields = [] then `Null else `Assoc fields let json_of_stats s = let add fd v w = if v > 0 then (fd , `Int v)::w else w in json_assoc begin add "total" s.total @@ add "valid" s.valid @@ add "failed" s.inconclusive @@ add "unknown" s.unsuccess @@ (if s.rank >= 0 then [ "rank" , `Int s.rank ] else []) end let rankify_stats s js = let n = s.steps in if n > 0 then try let r0 = Json.field "rank" js |> Json.int in let a,b = range r0 in if a <= n && n <= b then s.rank <- r0 else s.rank <- rank n with Not_found | Invalid_argument _ -> s.rank <- rank n else s.rank <- (-1) (* -------------------------------------------------------------------------- *) (* --- Stats by Prover --- *) (* -------------------------------------------------------------------------- *) type pstats = { main : stats ; prover : (VCS.prover,stats) Hashtbl.t ; } let pstats () = { main = stats () ; prover = Hashtbl.create 7 ; } let json_of_pstats p = json_assoc begin Hashtbl.fold (fun p s w -> (VCS.name_of_prover p , json_of_stats s) :: w) p.prover [ "wp:main" , json_of_stats p.main ] end let rankify_pstats p js = begin rankify_stats p.main (get_field js "wp:main") ; Hashtbl.iter (fun p s -> rankify_stats s (get_field js @@ VCS.name_of_prover p) ; ) p.prover ; end let get_prover fs prover = try Hashtbl.find fs.prover prover with Not_found -> let s = stats () in Hashtbl.add fs.prover prover s ; s let add_results (plist:pstats list) (wpo:Wpo.t) = let ok = ref NORESULT in let tm = ref 0.0 in let sm = ref 0 in List.iter (fun (p,r) -> let re = result r in let st = Wpo.get_steps r in let tc = Wpo.get_time r in let ts = r.VCS.solver_time in if re <> NORESULT then begin List.iter (fun fs -> add_stat re st tc (get_prover fs p)) plist ; if p <> VCS.Qed && ts > 0.0 then List.iter (fun fs -> add_qedstat ts (get_prover fs VCS.Qed)) plist ; end ; ok := best_result !ok re ; if tc > !tm then tm := tc ; if st > !sm then sm := st ; ) (Wpo.get_results wpo) ; List.iter (fun fs -> add_stat !ok !sm !tm fs.main) plist (* -------------------------------------------------------------------------- *) (* --- Stats by Section --- *) (* -------------------------------------------------------------------------- *) type coverage = { mutable covered : Property.Set.t ; mutable proved : Property.Set.t ; } let coverage () = { covered = Property.Set.empty ; proved = Property.Set.empty } let add_cover (s:coverage) ok p = begin s.covered <- Property.Set.add p s.covered ; if ok then s.proved <- Property.Set.add p s.proved ; end type dstats = { dstats : pstats ; dcoverage : coverage ; mutable dmap : pstats Property.Map.t ; } let dstats () = { dstats = pstats () ; dcoverage = coverage () ; dmap = Property.Map.empty ; } let js_prop = Property.Names.get_prop_name_id let json_of_dstats d = json_assoc begin Property.Map.fold (fun prop ps w -> (js_prop prop , json_of_pstats ps) :: w) d.dmap [ "wp:section" , json_of_pstats d.dstats ] end let rankify_dstats d js = begin rankify_pstats d.dstats (get_field js "wp:section") ; Property.Map.iter (fun prop ps -> rankify_pstats ps (get_field js @@ js_prop prop) ) d.dmap ; end (* -------------------------------------------------------------------------- *) (* --- Stats WP --- *) (* -------------------------------------------------------------------------- *) type entry = | Axiom of string | Fun of Kernel_function.t let decode_chapter= function | Axiom _ -> "axiomatic" | Fun _ -> "function" module Smap = FCMap.Make (struct type t = entry let compare s1 s2 = match s1 , s2 with | Axiom a , Axiom b -> String.compare a b | Axiom _ , Fun _ -> (-1) | Fun _ , Axiom _ -> 1 | Fun f , Fun g -> Kernel_function.compare f g end) type fcstat = { global : pstats ; gcoverage : coverage ; mutable dsmap : dstats Smap.t ; } let json_of_fcstat (fc : fcstat) = begin let functions = ref [] in let axiomatics = ref [] in Smap.iter (fun entry ds -> let acc , key = match entry with | Axiom a -> axiomatics , a | Fun kf -> functions , Kernel_function.get_name kf in acc := ( key , json_of_dstats ds ) :: !acc ; ) fc.dsmap ; json_assoc [ "wp:global" , json_of_pstats fc.global ; "wp:axiomatics" , json_assoc (List.rev (!axiomatics)) ; "wp:functions" , json_assoc (List.rev (!functions)) ; ] ; end let rankify_fcstat fc js = begin rankify_pstats fc.global (get_field js "wp:global") ; let jfunctions = get_field js "wp:functions" in let jaxiomatics = get_field js "wp:axiomatics" in Smap.iter (fun entry ds -> let js = match entry with | Axiom a -> get_field jaxiomatics a | Fun kf -> get_field jfunctions (Kernel_function.get_name kf) in rankify_dstats ds js ) fc.dsmap ; end (* -------------------------------------------------------------------------- *) (* --- Computing Statistics --- *) (* -------------------------------------------------------------------------- *) let get_section gs s = try Smap.find s gs.dsmap with Not_found -> let ds = dstats () in gs.dsmap <- Smap.add s ds gs.dsmap ; ds let get_property ds p = try Property.Map.find p ds.dmap with Not_found -> let ps = pstats () in ds.dmap <- Property.Map.add p ps ds.dmap ; ps let add_goal (gs:fcstat) wpo = begin let section = match Wpo.get_index wpo with | Wpo.Axiomatic None -> Axiom "" | Wpo.Axiomatic (Some a) -> Axiom a | Wpo.Function(kf,_) -> Fun kf in let ds : dstats = get_section gs section in let (ok,prop) = Wpo.get_proof wpo in let ps : pstats = get_property ds prop in add_results [gs.global ; ds.dstats ; ps] wpo ; add_cover gs.gcoverage ok prop ; add_cover ds.dcoverage ok prop ; end let fcstat () = let fcstat : fcstat = { global = pstats () ; gcoverage = coverage () ; dsmap = Smap.empty ; } in Wpo.iter ~on_goal:(add_goal fcstat) () ; fcstat (* -------------------------------------------------------------------------- *) (* --- Iteration on Stats --- *) (* -------------------------------------------------------------------------- *) type istat = { fcstat: fcstat; chapters : (string * (entry * dstats) list) list; } (** start chapter stats *) let start_stat4chap fcstat = let chapter = ref "" in let decode_chapter e = let code = decode_chapter e in let is_new_code = (code <> !chapter) in if is_new_code then chapter := code; is_new_code in let close_chapter (na,ca,ga) = if ca = [] then !chapter,[],ga else !chapter,[],((na,List.rev ca)::ga) in let (_,_,ga) = let acc = Smap.fold (fun entry ds acc -> let is_new_chapter = decode_chapter entry in let (na,ca,ga) = if is_new_chapter then close_chapter acc else acc in na,((entry,ds)::ca),ga ) fcstat.dsmap ("",[],[]) in if !chapter <> "" then close_chapter acc else acc in if ga = [] then None else Some { fcstat = fcstat; chapters = List.rev ga; } (** next chapters stats *) let next_stat4chap istat = match istat.chapters with | ([] | _::[]) -> None | _::l -> Some { istat with chapters = l } type cistat = { cfcstat: fcstat; chapter : string; sections : (entry * dstats) list; } (** start section stats of a chapter*) let start_stat4sect istat = match istat.chapters with | [] -> None | (c,s)::_ -> Some { cfcstat = istat.fcstat; chapter = c; sections = s; } (** next section stats *) let next_stat4sect cistat = match cistat.sections with | ([] | _::[]) -> None | _::l -> Some { cistat with sections = l } type sistat = { sfcstat: fcstat; schapter : string ; section : (entry * dstats); properties : (Property.t * pstats) list; } (** start property stats of a section *) let start_stat4prop cistat = match cistat.sections with | [] -> None | ((_,ds) as s)::_ -> Some { sfcstat = cistat.cfcstat; schapter = cistat.chapter; section = s; properties = List.rev (Property.Map.fold (fun p ps acc -> (p,ps)::acc) ds.dmap []); } (** next property stats *) let next_stat4prop sistat = match sistat.properties with | ([] | _::[]) -> None | _::l -> Some { sfcstat = sistat.sfcstat; schapter = sistat.schapter; section = sistat.section; properties = l; } (** generic iterator *) let iter_stat ?first ?sep ?last ~from start next= if first<>None || sep<>None || last <> None then let items = ref (start from) in if !items <> None then begin let apply v = function | None -> () | Some app -> app v in let next app = let item = (Extlib.the !items) in apply item app; items := next item in next first; if sep<>None || last <> None then begin while !items <> None do next sep; done; apply () last; end end (* -------------------------------------------------------------------------- *) (* --- Rendering Numbers --- *) (* -------------------------------------------------------------------------- *) type config = { mutable status_passed : string ; mutable status_failed : string ; mutable status_inconclusive : string ; mutable status_untried : string ; mutable global_prefix : string ; mutable lemma_prefix : string ; mutable axiomatic_prefix : string ; mutable function_prefix : string ; mutable property_prefix : string ; mutable global_section: string ; mutable axiomatic_section: string ; mutable function_section : string ; mutable console : bool ; mutable zero : string ; } let pp_zero ~config fmt = if config.console then Format.fprintf fmt "%4s" config.zero else Format.pp_print_string fmt config.zero let percent ~config fmt number total = if total <= 0 || number < 0 then pp_zero ~config fmt else if number >= total then Format.pp_print_string fmt (if config.console then " 100" else "100") else let ratio = float_of_int number /. float_of_int total in Format.fprintf fmt "%4.1f" (100.0 *. ratio) let number ~config fmt k = if k = 0 then pp_zero ~config fmt else if config.console then Format.fprintf fmt "%4d" k else Format.pp_print_int fmt k let properties ~config fmt (s:coverage) = function | "" -> percent config fmt (Property.Set.cardinal s.proved) (Property.Set.cardinal s.covered) | "total" -> number config fmt (Property.Set.cardinal s.covered) | "valid" -> number config fmt (Property.Set.cardinal s.proved) | "failed" -> number config fmt (Property.Set.cardinal s.covered - Property.Set.cardinal s.proved) | _ -> raise Exit let is_stat_name = function | "success" | "total" | "valid" | "" | "failed" | "status" | "inconclusive" | "unsuccess" | "time" | "perf" | "steps" | "range" -> true | _ -> false let stat ~config fmt s = function | "success" -> percent config fmt s.valid s.total | "total" -> number config fmt s.total | "valid" | "" -> number config fmt s.valid | "failed" -> number config fmt (s.unsuccess + s.inconclusive) | "status" -> let msg = if s.inconclusive > 0 then config.status_inconclusive else if s.unsuccess > 0 then config.status_failed else if s.valid >= s.total then config.status_passed else config.status_untried in Format.pp_print_string fmt msg | "inconclusive" -> number config fmt s.inconclusive | "unsuccess" -> number config fmt s.unsuccess | "time" -> if s.time > 0.0 then Rformat.pp_time_range ladder fmt s.time | "perf" -> if s.time > Rformat.epsilon then Format.fprintf fmt "(%a)" Rformat.pp_time s.time | "steps" -> if s.steps > 0 then Format.fprintf fmt "(%d)" s.steps | "range" -> if s.rank >= 0 then let a,b = range s.rank in Format.fprintf fmt "(%d..%d)" a b | _ -> raise Exit let pstats ~config fmt s cmd arg = match cmd with | "wp" | "qed" -> stat ~config fmt (get_prover s VCS.Qed) arg | cmd when is_stat_name cmd -> stat ~config fmt s.main cmd | prover -> match (VCS.prover_of_name prover) with | None -> Wp_parameters.error ~once:true "Unknown prover name %s" prover | Some prover -> stat ~config fmt (get_prover s prover) arg let pcstats ~config fmt (s,c) cmd arg = match cmd with | "prop" -> properties ~config fmt c arg | _ -> pstats ~config fmt s cmd arg (* -------------------------------------------------------------------------- *) (* --- Rformat Environments --- *) (* -------------------------------------------------------------------------- *) let env_toplevel ~config gstat fmt cmd arg = try pcstats config fmt (gstat.global, gstat.gcoverage) cmd arg with Exit -> if arg="" then Wp_parameters.error ~once:true "Unknown toplevel-format '%%%s'" cmd else Wp_parameters.error ~once:true "Unknown toplevel-format '%%%s:%s'" cmd arg let env_chapter chapter_name fmt cmd arg = try match cmd with | "chapter" | "name" -> Format.pp_print_string fmt chapter_name | _ -> raise Exit with Exit -> if arg="" then Wp_parameters.error ~once:true "Unknown chapter-format '%%%s'" cmd else Wp_parameters.error ~once:true "Unknown chapter-format '%%%s:%s'" cmd arg let env_section ~config ~name sstat fmt cmd arg = try let entry,ds = match sstat.sections with | section_item::_others -> section_item | _ -> raise Exit in match cmd with | "chapter" -> let chapter = match entry with | Axiom _ -> config.axiomatic_section | Fun _ -> config.function_section in Format.pp_print_string fmt chapter | "name" | "section" | "global" | "axiomatic" | "function" -> if cmd <> "name" && cmd <> "section" && name <> cmd then Wp_parameters.error "Invalid section-format '%%%s' inside a section %s" cmd name; let prefix,name = match entry with | Axiom "" -> config.lemma_prefix,"" | Axiom a -> config.axiomatic_prefix,a | Fun kf -> config.function_prefix, ( Kernel_function.get_name kf) in Format.fprintf fmt "%s%s" prefix name | _ -> pcstats config fmt (ds.dstats, ds.dcoverage) cmd arg with Exit -> if arg="" then Wp_parameters.error ~once:true "Unknown section-format '%%%s'" cmd else Wp_parameters.error ~once:true "Unknown section-format '%%%s:%s'" cmd arg let env_property ~config ~name pstat fmt cmd arg = try let entry = fst pstat.section in let p,stat = match pstat.properties with | property_item::_others -> property_item | _ -> raise Exit in match cmd with | "chapter" -> let chapter = match entry with | Axiom _ -> config.axiomatic_section | Fun _ -> config.function_section in Format.pp_print_string fmt chapter | "section" | "global" | "axiomatic" | "function" -> if cmd <> "section" && name <> cmd then Wp_parameters.error "Invalid property-format '%%%s' inside a section %s" cmd name; let prefix,name = match entry with | Axiom "" -> config.lemma_prefix,"" | Axiom a -> config.axiomatic_prefix,a | Fun kf -> config.function_prefix, ( Kernel_function.get_name kf) in Format.fprintf fmt "%s%s" prefix name | "name" -> Format.fprintf fmt "%s%s" config.property_prefix (Property.Names.get_prop_name_id p) | "property" -> Description.pp_local fmt p | _ -> pstats config fmt stat cmd arg with Exit -> if arg="" then Wp_parameters.error ~once:true "Unknown property-format '%%%s'" cmd else Wp_parameters.error ~once:true "Unknown property-format '%%%s:%s'" cmd arg (* -------------------------------------------------------------------------- *) (* --- Statistics Printing --- *) (* -------------------------------------------------------------------------- *) let print_property (pstat:sistat) ~config ~name ~prop fmt = Rformat.pretty (env_property ~config ~name pstat) fmt prop let print_section (sstat:cistat) ~config ~name ~sect ~prop fmt = if sect <> "" then Rformat.pretty (env_section ~config ~name sstat) fmt sect ; if prop <> "" then let print_property pstat = print_property pstat ~config ~name ~prop fmt in iter_stat ~first:print_property ~sep:print_property ~from:sstat start_stat4prop next_stat4prop let print_chapter (cstat:istat) ~config ~chap ~sect ~glob ~axio ~func ~prop fmt = let chapter_item = match cstat.chapters with | chapter_item::_others -> chapter_item | _ -> raise Exit in let section_name = fst chapter_item in let section,chapter_name = match section_name with | "global" -> glob,config.global_section | "axiomatic" -> axio,config.axiomatic_section | "function" -> func,config.function_section | _ -> sect,"" in let section,section_name = if section <> "" then section,section_name else sect,"" in if chap <> "" then Rformat.pretty (env_chapter chapter_name) fmt chap ; if section <> "" || prop <> "" then let print_section sstat = print_section sstat ~config ~name:section_name ~sect:section ~prop fmt in iter_stat ~first:print_section ~sep:print_section ~from:cstat start_stat4sect next_stat4sect let print gstat ~config ~head ~tail ~chap ~sect ~glob ~axio ~func ~prop fmt = begin if head <> "" then Rformat.pretty (env_toplevel ~config gstat) fmt head ; if chap <> "" || sect <> "" || glob <> "" || axio <> "" || func <> "" || prop <> "" then let print_chapter cstat = print_chapter cstat ~config ~chap ~sect ~glob ~axio ~func ~prop fmt in iter_stat ~first:print_chapter ~sep:print_chapter ~from:gstat start_stat4chap next_stat4chap ; if tail <> "" then Rformat.pretty (env_toplevel ~config gstat) fmt tail ; end (* -------------------------------------------------------------------------- *) (* --- Report Printing --- *) (* -------------------------------------------------------------------------- *) type section = END | HEAD | TAIL | CHAPTER | SECTION | GLOB_SECTION | AXIO_SECTION | FUNC_SECTION | PROPERTY let export gstat specfile = let config = { console = false ; zero = "-" ; status_passed = " Ok " ; status_failed = "Failed" ; status_inconclusive = "*Bug**" ; status_untried = " " ; lemma_prefix = "Lemma " ; global_prefix = "(Global) " ; axiomatic_prefix = "Axiomatic " ; function_prefix = "" ; property_prefix = "" ; global_section = "Globals" ; axiomatic_section = "Axiomatics" ; function_section = "Functions" ; } in let head = Buffer.create 64 in let tail = Buffer.create 64 in let chap = Buffer.create 64 in (* chapter *) let sect = Buffer.create 64 in (* default section *) let glob = Buffer.create 64 in (* section *) let axio = Buffer.create 64 in (* section *) let func = Buffer.create 64 in (* section *) let sect_prop = Buffer.create 64 in (* default sub-section *) let file = ref None in let section = ref HEAD in begin let cin = open_in specfile in try while true do let line = input_line cin in match Rformat.command line with | Rformat.ARG("AXIOMATIC_PREFIX",f) -> config.axiomatic_prefix <- f | Rformat.ARG("FUNCTION_PREFIX",f) -> config.function_prefix <- f | Rformat.ARG("PROPERTY_PREFIX",f) -> config.property_prefix <- f | Rformat.ARG("LEMMA_PREFIX",f) -> config.lemma_prefix <- f | Rformat.ARG("GLOBAL_SECTION",f) -> config.global_section <- f | Rformat.ARG("AXIOMATIC_SECTION",f) -> config.axiomatic_section <- f | Rformat.ARG("FUNCTION_SECTION",f) -> config.function_section <- f | Rformat.ARG("PASSED",s) -> config.status_passed <- s | Rformat.ARG("FAILED",s) -> config.status_failed <- s | Rformat.ARG("INCONCLUSIVE",s) -> config.status_inconclusive <- s | Rformat.ARG("UNTRIED",s) -> config.status_untried <- s | Rformat.ARG("ZERO",z) -> config.zero <- z | Rformat.ARG("FILE",f) -> file := Some f | Rformat.ARG("SUFFIX",e) -> let basename = Wp_parameters.ReportName.get () in let filename = basename ^ e in file := Some filename | Rformat.CMD "CONSOLE" -> config.console <- true | Rformat.CMD "END" -> section := END | Rformat.CMD "HEAD" -> section := HEAD | Rformat.CMD "TAIL" -> section := TAIL | Rformat.CMD "CHAPTER" -> section := CHAPTER | Rformat.CMD "SECTION" -> section := SECTION | Rformat.CMD "GLOBAL" -> section := GLOB_SECTION | Rformat.CMD "AXIOMATIC" -> section := AXIO_SECTION | Rformat.CMD "FUNCTION" -> section := FUNC_SECTION | Rformat.CMD "PROPERTY" -> section := PROPERTY | Rformat.CMD a | Rformat.ARG(a,_) -> Wp_parameters.error "Report '%s': unknown command '%s'" specfile a | Rformat.TEXT -> if !section <> END then let text = match !section with | HEAD -> head | CHAPTER -> chap | SECTION -> sect | GLOB_SECTION -> glob | AXIO_SECTION -> axio | FUNC_SECTION -> func | PROPERTY -> sect_prop | TAIL|END -> tail in Buffer.add_string text line ; Buffer.add_char text '\n' ; done with | End_of_file -> close_in cin | err -> close_in cin ; raise err end ; match !file with | None -> Log.print_on_output (print gstat ~config ~head:(Buffer.contents head) ~tail:(Buffer.contents tail) ~chap:(Buffer.contents chap) ~sect:(Buffer.contents sect) ~glob:(Buffer.contents glob) ~axio:(Buffer.contents axio) ~func:(Buffer.contents func) ~prop:(Buffer.contents sect_prop)) | Some report -> Wp_parameters.feedback "Report '%s'" report ; let cout = open_out report in let fout = Format.formatter_of_out_channel cout in try print gstat ~config ~head:(Buffer.contents head) ~tail:(Buffer.contents tail) ~chap:(Buffer.contents chap) ~sect:(Buffer.contents sect) ~glob:(Buffer.contents glob) ~axio:(Buffer.contents axio) ~func:(Buffer.contents func) ~prop:(Buffer.contents sect_prop) fout ; Format.pp_print_flush fout () ; close_out cout ; with err -> Format.pp_print_flush fout () ; close_out cout ; raise err (* -------------------------------------------------------------------------- *) let export_json gstat ?jinput ~joutput () = begin let js = try let jfile = match jinput with | None -> Wp_parameters.feedback "Report '%s'" joutput ; joutput | Some jinput -> Wp_parameters.feedback "Report in: '%s'" jinput ; Wp_parameters.feedback "Report out: '%s'" joutput ; jinput in if Sys.file_exists jfile then Json.load_file jfile else `Null with Json.Error(file,line,msg) -> let source = Log.source ~file ~line in Wp_parameters.error ~source "Incorrect json file: %s" msg ; `Null in rankify_fcstat gstat js ; Json.save_file joutput (json_of_fcstat gstat) ; end (* -------------------------------------------------------------------------- *) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpReport.mli����������������������������������������������������0000666�0000000�0000000�00000004706�13571573400�016445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (** Export Statistics. Patterns for formatting: - ["%{cmd:arg}"] or "%cmd:arg" - ["%{cmd}"] or ["%cmd"] Patterns in [fct]: - ["%kf"] or ["%kf:name"] the name of the function. - ["%kf:<s>"] the stats in format [<s>] for the function. - ["%<p>:<s>"] the stats in format [<s>] for prover [<p>]. Patterns in [main]: - "%<s>" the global statistics with format [<s>]. Prover strings are ["wp"], ["ergo"], ["coq"] , ["z3"] and ["simplify"]. Format strings are "100" (percents of valid upon total, default), ["total"], ["valid"] and ["failed"] for respective number of verification conditions. Zero is printed as [zero]. Percentages are printed in decimal ["dd.d"]. *) type fcstat val fcstat : unit -> fcstat val export : fcstat -> string -> unit val export_json : fcstat -> ?jinput:string -> joutput:string -> unit -> unit ����������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpStrategy.ml���������������������������������������������������0000666�0000000�0000000�00000062742�13571573400�016627� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) let dkey = Wp_parameters.register_category "strategy" (* debugging key *) let debug fmt = Wp_parameters.debug ~dkey fmt open Cil_types open LogicUsage (* -------------------------------------------------------------------------- *) (** An annotation can be used for different purpose. *) type annot_kind = | Ahyp (* annotation is an hypothesis, but not a goal (see Aboth) : A => ...*) | Agoal (* annotation is a goal, but not an hypothesis (see Aboth): A /\ ...*) | Aboth of bool (* annotation can be used as both hypothesis and goal : - with true : considered as both : A /\ A=>.. - with false : we just want to use it as hyp right now. *) | AcutB of bool (* annotation is use as a cut : - with true (A is also a goal) -> A (+ proof obligation A => ...) - with false (A is an hyp only) -> True (+ proof obligation A => ...) *) | AcallHyp of kernel_function (* annotation is a called function property to consider as an Hyp. * The pre are not here but in AcallPre since they can also * be considered as goals. *) | AcallPre of bool * kernel_function (* annotation is a called function precondition : to be considered as hyp, and goal if bool=true *) (* -------------------------------------------------------------------------- *) (* --- Annotations for one program point. --- *) (* -------------------------------------------------------------------------- *) module ForCall = Kernel_function.Map (** Some elements can be used as both Hyp and Goal : because of the selection * mechanism, we need to add a boolean [as_goal] to tell if the element is to be * considered as a goal. If [false], the element can still be used as hypothesis. *) type annots = { p_hyp : WpPropId.pred_info list; p_goal : WpPropId.pred_info list; p_both : (bool * WpPropId.pred_info) list; p_cut : (bool * WpPropId.pred_info) list; call_hyp : WpPropId.pred_info list ForCall.t; (* post and pre *) call_pre : (bool * WpPropId.pred_info) list ForCall.t; (* goal only *) call_asgn : WpPropId.assigns_full_info ForCall.t; a_goal : WpPropId.assigns_full_info; a_hyp : WpPropId.assigns_full_info; a_call : WpPropId.assigns_full_info; (* dynamic calls *) } type t_annots = { has_asgn_goal : bool; has_prop_goal : bool; info: annots } (* --- Add annotations --- *) let empty_acc = let a = { p_hyp = []; p_goal = []; p_both = []; p_cut = []; call_hyp = ForCall.empty; call_pre = ForCall.empty; call_asgn = ForCall.empty; a_goal = WpPropId.empty_assigns_info; a_hyp = WpPropId.empty_assigns_info; a_call = WpPropId.empty_assigns_info; } in { has_asgn_goal = false; has_prop_goal = false; info = a; } let normalize id ?assumes labels p = try let p = NormAtLabels.preproc_annot labels p in match assumes with | None -> Some p | Some a -> let a = Logic_const.pat(a,Logic_const.pre_label) in let a = NormAtLabels.(preproc_annot labels_fct_pre a) in Some(Logic_const.pimplies(a,p)) with e -> let pid = WpPropId.get_propid id in NormAtLabels.catch_label_error e pid "annotation" ; None let add_prop acc kind id p = let get_p = match p with None -> None | Some p -> Some(WpPropId.mk_pred_info id p) in let add_hyp l = match get_p with None -> l | Some p -> p::l in let add_goal l = match get_p with None -> l | Some p -> p::l in let add_both goal l = match get_p with | None -> l | Some p -> (goal, p)::l in let add_hyp_call fct calls = let l = try ForCall.find fct calls with Not_found -> [] in ForCall.add fct (add_hyp l) calls in let add_both_call fct goal calls = let l = try ForCall.find fct calls with Not_found -> [] in ForCall.add fct (add_both goal l) calls in let info = acc.info in let goal, info = match kind with | Ahyp -> false, { info with p_hyp = add_hyp info.p_hyp } | Agoal -> true, { info with p_goal = add_goal info.p_goal } | Aboth goal -> goal, { info with p_both = add_both goal info.p_both } | AcutB goal -> goal, { info with p_cut = add_both goal info.p_cut } | AcallHyp fct -> false, { info with call_hyp = add_hyp_call fct info.call_hyp } | AcallPre (goal,fct) -> goal, { info with call_pre = add_both_call fct goal info.call_pre } in let acc = { acc with info = info } in if goal then { acc with has_prop_goal = true} else acc (* -------------------------------------------------------------------------- *) (* adding some specific properties. *) let add_prop_fct_pre_bhv acc kind kf bhv = let norm_pred pred = let p = Logic_const.pred_of_id_pred pred in Logic_const.(pat (p,pre_label)) in let requires = Logic_const.pands (List.map norm_pred bhv.b_requires) in let assumes = Logic_const.pands (List.map norm_pred bhv.b_assumes) in let precond = Logic_const.pimplies (assumes, requires) in let precond_id = Logic_const.new_predicate precond in let id = WpPropId.mk_pre_id kf Kglobal bhv precond_id in let labels = NormAtLabels.labels_fct_pre in let p = normalize id labels precond in add_prop acc kind id p let add_prop_fct_pre acc kind kf bhv ~assumes pre = let id = WpPropId.mk_pre_id kf Kglobal bhv pre in let labels = NormAtLabels.labels_fct_pre in let p = Logic_const.pred_of_id_pred pre in let p = Logic_const.(pat (p,pre_label)) in let p = normalize id ?assumes labels p in add_prop acc kind id p let add_prop_fct_post acc kind kf bhv tkind post = let id = WpPropId.mk_fct_post_id kf bhv (tkind, post) in let labels = NormAtLabels.labels_fct_post in let p = Logic_const.pred_of_id_pred post in let p = normalize id labels p in add_prop acc kind id p let add_prop_fct_bhv_pre acc kind kf bhv ~impl_assumes = let assumes = if impl_assumes then Some (Ast_info.behavior_assumes bhv) else None in let add acc p = add_prop_fct_pre acc kind kf bhv ~assumes p in let acc = List.fold_left add acc bhv.b_requires in if impl_assumes then acc else List.fold_left add acc bhv.b_assumes let add_prop_stmt_pre acc kind kf s bhv ~assumes pre = let id = WpPropId.mk_pre_id kf (Kstmt s) bhv pre in let labels = NormAtLabels.labels_stmt_pre ~kf s in let p = Logic_const.pred_of_id_pred pre in let p = normalize id labels ?assumes p in add_prop acc kind id p let add_prop_stmt_bhv_requires acc kind kf s bhv ~with_assumes = let assumes = if with_assumes then Some (Ast_info.behavior_assumes bhv) else None in let add acc pre = add_prop_stmt_pre acc kind kf s bhv ~assumes pre in List.fold_left add acc bhv.b_requires (** Process the stmt spec precondition as an hypothesis for external properties. * Add [assumes => requires] for all the behaviors. *) let add_prop_stmt_spec_pre acc kind kf s spec = let add_bhv_pre acc bhv = add_prop_stmt_bhv_requires acc kind kf s bhv ~with_assumes:true in List.fold_left add_bhv_pre acc spec.spec_behavior let add_prop_stmt_post acc kind kf s bhv tkind l_post ~assumes post = let id = WpPropId.mk_stmt_post_id kf s bhv (tkind, post) in let labels = NormAtLabels.labels_stmt_post ~kf s l_post in let p = Logic_const.pred_of_id_pred post in let p = normalize id labels ?assumes p in add_prop acc kind id p let add_prop_call_pre acc kind id ~assumes pre = let labels = NormAtLabels.labels_fct_pre in let p = Logic_const.pred_of_id_pred pre in (* assumes can be normalized in the same time *) let p = Logic_const.pimplies (assumes, p) in let p = normalize id labels p in add_prop acc kind id p let add_prop_call_post acc kind called_kf bhv tkind ~assumes post = let id = WpPropId.mk_fct_post_id called_kf bhv (tkind, post) in let labels = NormAtLabels.labels_fct_post in let p = Logic_const.pred_of_id_pred post in let p = normalize id labels ~assumes p in add_prop acc kind id p let add_prop_assert acc kind kf s ca p = let id = WpPropId.mk_assert_id kf s ca in let labels = NormAtLabels.labels_assert_before ~kf s in let p = normalize id labels p in add_prop acc kind id p let add_prop_loop_inv acc kind s ~established id p = let labels = NormAtLabels.labels_loop_inv ~established s in let p = normalize id labels p in add_prop acc kind id p (** apply [f_normal] on the [Normal] postconditions, * [f_exits] on the [Exits] postconditions, and warn on the others. *) let fold_bhv_post_cond ~warn f_normal f_exits acc b = let add (p_acc, e_acc) ((termination_kind, pe) as e) = match termination_kind with | Normal -> f_normal p_acc pe, e_acc | Exits -> p_acc, f_exits e_acc pe | Returns -> p_acc, e_acc (* HANDLED by an ASSERT from CIL *) | (Breaks|Continues) -> (* TODO *) begin if warn then Wp_parameters.warning "Abrupt statement termination property ignored:@, %a" Printer.pp_post_cond e; p_acc, e_acc end in List.fold_left add acc b.b_post_cond (* -------------------------------------------------------------------------- *) let add_assigns acc kind id a_desc = let take_assigns () = debug "take %a %a" WpPropId.pp_propid id WpPropId.pp_assigns_desc a_desc; WpPropId.mk_assigns_info id a_desc in let take_assigns_call fct info = let asgn = take_assigns () in { info with call_asgn = ForCall.add fct asgn info.call_asgn } in let info = acc.info in let goal, info = match kind with | Ahyp -> false, {info with a_hyp = take_assigns ()} | AcallHyp fct -> false, take_assigns_call fct info | Agoal -> true, {info with a_goal = take_assigns ()} | _ -> Wp_parameters.fatal "Assigns prop can only be Hyp or Goal" in let acc = { acc with info = info } in if goal then { acc with has_asgn_goal = true} else acc let add_assigns_any acc kind asgn = let take_call fct asgn info = { info with call_asgn = ForCall.add fct asgn info.call_asgn } in match kind with | Ahyp -> {acc with info = { acc.info with a_hyp = asgn}} | AcallHyp fct -> {acc with info = take_call fct asgn acc.info} | _ -> Wp_parameters.fatal "Assigns Any prop can only be Hyp" let assigns_upper_bound spec = let bhvs = spec.spec_behavior in let upper a b = match a, b.b_assigns with | None, Writes a when Cil.is_default_behavior b -> Some (b,a) (* default behavior always applies. *) | None, _ -> None (* WritesAny U X -> WritesAny *) | Some (b,_), _ when Cil.is_default_behavior b -> a (* default behavior prevails over other behaviors. *) | Some _, WritesAny -> None (* No default behavior and one behavior assigns everything. *) | Some(b,a1), Writes a2 -> Some (b,a1 @ a2) (* take the whole list of assigns. *) in match bhvs with | [] -> None | bhv::bhvs -> (* [VP 2011-02-04] Note that if there is no default and each behavior has a proper assigns clause we put dependencies only to the assigns of a more or less randomly selected behavior, but the datatypes above can't handle anything better. *) let acc = match bhv.b_assigns with WritesAny -> None | Writes a -> Some(bhv,a) in List.fold_left upper acc bhvs (* [VP 2011-02-04] These two functions below mix all the assigns of a function regardless of the behavior. At least now that we take WritesAny as soon as at least one behavior has no assigns clause, this is correct, but still imprecise. Needs refactoring of t_annots to go further, though. [AP 2011-03-11] I think that the merge of all assigns properties is intended because we are using it as an hypothesis to skip the statement or the function call. *) let add_stmt_spec_assigns_hyp acc kf s l_post spec = match assigns_upper_bound spec with | None -> add_assigns_any acc Ahyp (WpPropId.mk_stmt_any_assigns_info s) | Some(bhv, assigns) -> (* We are always using the spec covering all possible parent behaviors. *) let id = WpPropId.mk_stmt_assigns_id kf s [] bhv assigns in match id with | None -> add_assigns_any acc Ahyp (WpPropId.mk_stmt_any_assigns_info s) | Some id -> let labels = NormAtLabels.labels_stmt_assigns ~kf s l_post in let assigns = NormAtLabels.preproc_assigns labels assigns in let a_desc = WpPropId.mk_stmt_assigns_desc s assigns in add_assigns acc Ahyp id a_desc let add_call_assigns_any acc s = let asgn = WpPropId.mk_stmt_any_assigns_info s in {acc with info = { acc.info with a_call = asgn }} let add_call_assigns_hyp acc kf_caller s ~called_kf l_post spec_opt = match spec_opt with | None -> let pid = WpPropId.mk_stmt_any_assigns_info s in add_assigns_any acc (AcallHyp called_kf) pid | Some spec -> match assigns_upper_bound spec with | None -> let asgn = WpPropId.mk_stmt_any_assigns_info s in add_assigns_any acc (AcallHyp called_kf) asgn | Some(bhv, assigns) -> (* we're taking assigns from a function contract. They're not subject to any active behavior. *) let id = WpPropId.mk_stmt_assigns_id kf_caller s [] bhv assigns in match id with | None -> let asgn = WpPropId.mk_stmt_any_assigns_info s in add_assigns_any acc (AcallHyp called_kf) asgn | Some pid -> let kf = kf_caller in let labels = NormAtLabels.labels_stmt_assigns ~kf s l_post in let assigns = NormAtLabels.preproc_assigns labels assigns in let a_desc = WpPropId.mk_stmt_assigns_desc s assigns in add_assigns acc (AcallHyp called_kf) pid a_desc (* [VP 2011-01-28] following old behavior, not sure it is correct: why should we give to add_assigns the assigns with unnormalized labels? [AP 2011-03-11] to answer VP question, the source assigns are only used to build an identifier for the property which is use later to update its status and dependencies so we need to have the original one. *) let add_loop_assigns_hyp acc kf s asgn_opt = match asgn_opt with | None -> let asgn = WpPropId.mk_loop_any_assigns_info s in add_assigns_any acc Ahyp asgn | Some (ca, assigns) -> let id = WpPropId.mk_loop_assigns_id kf s ca assigns in match id with | None -> let asgn = WpPropId.mk_loop_any_assigns_info s in add_assigns_any acc Ahyp asgn | Some id -> let labels = NormAtLabels.labels_loop_assigns s in let assigns' = NormAtLabels.preproc_assigns labels assigns in let a_desc = WpPropId.mk_loop_assigns_desc s assigns' in add_assigns acc Ahyp id a_desc let add_fct_bhv_assigns_hyp acc kf tkind b = match b.b_assigns with | WritesAny -> let id = WpPropId.mk_kf_any_assigns_info () in add_assigns_any acc Ahyp id | Writes assigns -> let id = WpPropId.mk_fct_assigns_id kf b tkind assigns in match id with | None -> let id = WpPropId.mk_kf_any_assigns_info () in add_assigns_any acc Ahyp id | Some id -> let labels = NormAtLabels.labels_fct_assigns in let assigns' = NormAtLabels.preproc_assigns labels assigns in let a_desc = WpPropId.mk_kf_assigns_desc assigns' in add_assigns acc Ahyp id a_desc (* --- Get annotations --- *) let get_goal_only annots = annots.info.p_goal let get_hyp_only annots = annots.info.p_hyp let filter_both l = let add (h_acc, g_acc) (goal, p) = p::h_acc, if goal then p::g_acc else g_acc in List.fold_left add ([], []) l let get_both_hyp_goals annots = filter_both annots.info.p_both let get_call_hyp annots fct = try ForCall.find fct annots.info.call_hyp with Not_found -> [] let get_call_pre annots fct = try filter_both (ForCall.find fct annots.info.call_pre) with Not_found -> [],[] let get_call_asgn annots = function | None -> annots.info.a_call | Some fct -> try ForCall.find fct annots.info.call_asgn with Not_found -> WpPropId.empty_assigns_info let get_cut annots = annots.info.p_cut let get_asgn_hyp annots = annots.info.a_hyp let get_asgn_goal annots = annots.info.a_goal (* --- Print annotations --- *) let pp_annots fmt acc = let acc = acc.info in let pp_pred k b p = Format.fprintf fmt "%s%s: %a@." k (if b then "" else " (h)") WpPropId.pp_pred_of_pred_info p in let pp_pred_list k l = List.iter (fun p -> pp_pred k true p) l in let pp_pred_b_list k l = List.iter (fun (b, p) -> pp_pred k b p) l in begin pp_pred_list "H" acc.p_hyp; pp_pred_list "G" acc.p_goal; pp_pred_b_list "H+G" acc.p_both; pp_pred_b_list "C" acc.p_cut; ForCall.iter (fun kf hs -> let name = "CallHyp:" ^ (Kernel_function.get_name kf) in pp_pred_list name hs) acc.call_hyp; ForCall.iter (fun kf bhs -> let name = "CallPre:" ^ (Kernel_function.get_name kf) in pp_pred_b_list name bhs) acc.call_pre; ForCall.iter (fun kf asgn -> let name = "CallAsgn:" ^ (Kernel_function.get_name kf) in WpPropId.pp_assign_info name fmt asgn) acc.call_asgn; WpPropId.pp_assign_info "DC" fmt acc.a_call; WpPropId.pp_assign_info "HA" fmt acc.a_hyp; WpPropId.pp_assign_info "GA" fmt acc.a_goal; end let merge_calls f call1 call2 = ForCall.merge (fun _fct a b -> match a,b with | None,c | c,None -> c | Some a,Some b -> Some (f a b) ) call1 call2 (* TODO: it should be possible to do without this, but needs a big refactoring*) let merge_acc acc1 acc2 = { p_hyp = acc1.p_hyp @ acc2.p_hyp; p_goal = acc1.p_goal @ acc2.p_goal; p_both = acc1.p_both @ acc2.p_both; p_cut = acc1.p_cut @ acc2.p_cut; call_hyp = merge_calls (@) acc1.call_hyp acc2.call_hyp; call_pre = merge_calls (@) acc1.call_pre acc2.call_pre; call_asgn = merge_calls WpPropId.merge_assign_info acc1.call_asgn acc2.call_asgn; a_goal = WpPropId.merge_assign_info acc1.a_goal acc2.a_goal; a_hyp = WpPropId.merge_assign_info acc1.a_hyp acc2.a_hyp; a_call = WpPropId.merge_assign_info acc1.a_call acc2.a_call; } (* -------------------------------------------------------------------------- *) (* --- Annotation table --- *) (* -------------------------------------------------------------------------- *) (** This is an Hashtbl where some predicates are stored on CFG edges. * On each edge, we store hypotheses and goals. *) module Hannots = Cil2cfg.HE (struct type t = annots end) type annots_tbl = { tbl_annots : Hannots.t; mutable tbl_axioms : WpPropId.axiom_info list; mutable tbl_has_prop_goal : bool; mutable tbl_has_asgn_goal : bool; } let create_tbl () = { tbl_annots = Hannots.create 7; tbl_axioms = []; tbl_has_prop_goal = false; tbl_has_asgn_goal = false; } let add_on_edges tbl new_acc edges = if new_acc.has_prop_goal then tbl.tbl_has_prop_goal <- true; if new_acc.has_asgn_goal then tbl.tbl_has_asgn_goal <- true; let add_on_edge e = let acc = try let acc = Hannots.find tbl.tbl_annots e in merge_acc new_acc.info acc with Not_found -> new_acc.info in Hannots.replace tbl.tbl_annots e acc; in List.iter add_on_edge edges let add_node_annots tbl cfg v (before, (post, exits)) = debug "[add_node_annots] on %a@." Cil2cfg.pp_node v; add_on_edges tbl before (Cil2cfg.get_pre_edges cfg v); if post <> empty_acc then begin let edges_after = Cil2cfg.get_post_edges cfg v in if edges_after = [] then (* unreachable (see [process_unreached_annots]) *) () else add_on_edges tbl post edges_after end; if exits <> empty_acc then begin let edges_exits = Cil2cfg.get_exit_edges cfg v in if edges_exits = [] then (* unreachable (see [process_unreached_annots]) *) () else add_on_edges tbl exits edges_exits end let add_loop_annots tbl cfg vloop ~entry ~back ~core = debug "[add_loop_annots] on %a@."Cil2cfg.pp_node vloop; let edges_to_head = Cil2cfg.succ_e cfg vloop in debug "[add_loop_annots] %d edges_to_head" (List.length edges_to_head); let edges_to_loop = Cil2cfg.pred_e cfg vloop in debug "[add_loop_annots] %d edges_to_loop" (List.length edges_to_loop); let back_edges, entry_edges = List.partition Cil2cfg.is_back_edge edges_to_loop in debug "[add_loop_annots] %d back_edges + %d entry_edges" (List.length back_edges) (List.length entry_edges); add_on_edges tbl entry entry_edges; debug "[add_loop_annots on entry_edges ok]@."; add_on_edges tbl back back_edges; debug "[add_loop_annots on back_edges ok]@."; add_on_edges tbl core edges_to_head; debug "[add_loop_annots on edges_to_head ok]@." let add_axiom tbl lemma = try (* Labels does not need normalization *) let axiom = WpPropId.mk_axiom_info lemma in debug "take %a@." WpPropId.pp_axiom_info axiom; tbl.tbl_axioms <- axiom::tbl.tbl_axioms with e -> NormAtLabels.catch_label_error e ("axiom "^lemma.lem_name) "axiom" let add_all_axioms tbl = let rec do_g g = match g with | Daxiomatic (_ax_name, globs,_,_) -> do_globs globs | Dlemma (name,_,_,_,_,_,_) -> let lem = LogicUsage.logic_lemma name in add_axiom tbl lem | _ -> () and do_globs globs = List.iter do_g globs in Annotations.iter_global (fun _ -> do_g) let get_annots tbl e = try (* TODO clean : this is not very nice ! *) let info = Hannots.find tbl.tbl_annots e in { empty_acc with info = info} with Not_found -> empty_acc (* -------------------------------------------------------------------------- *) (* --- Strategy --- *) (* -------------------------------------------------------------------------- *) type strategy_for_froms = { get_pre : unit -> t_annots; more_vars : logic_var list } type strategy_kind = | SKannots (* normal mode for annotations *) | SKfroms of strategy_for_froms (* an object of this type is the only access to annotations * from the rest of the application. * The idea is to be able to tune which properties to use for a computation. *) type strategy = { desc : string ; cfg : Cil2cfg.t; behavior_name : string option ; strategy_kind : strategy_kind; annots : annots_tbl; } let get_kf s = Cil2cfg.cfg_kf s.cfg let get_bhv s = s.behavior_name let is_default_behavior s = match s.behavior_name with None -> true | Some _ -> false let mk_strategy desc cfg bhv_name kind tbl = { desc = desc; cfg = cfg; behavior_name = bhv_name; strategy_kind = kind; annots = tbl; } let cfg_of_strategy strat = strat.cfg let behavior_name_of_strategy strat = strat.behavior_name let global_axioms strat = strat.annots.tbl_axioms let strategy_kind strat = strat.strategy_kind let strategy_has_prop_goal strat = strat.annots.tbl_has_prop_goal let strategy_has_asgn_goal strat = strat.annots.tbl_has_asgn_goal let get_annots strat = get_annots strat.annots let pp_info_of_strategy fmt strat = Format.fprintf fmt "@[%s@]" strat.desc (* -------------------------------------------------------------------------- *) (* --- Helpers --- *) (* -------------------------------------------------------------------------- *) let is_main_init kf = if Kernel.LibEntry.get () then false else let is_main = try let main, _ = Globals.entry_point () in Kernel_function.equal kf main with Globals.No_such_entry_point _ -> false in debug "'%a' is %sthe main entry point@." Kernel_function.pretty kf (if is_main then "" else "NOT "); is_main let isInitConst () = Wp_parameters.Init.get () let isGlobalInitConst var = var.vglob && var.vstorage <> Extern && Cil.typeHasQualifier "const" var.vtype let mk_variant_properties kf s ca v = let vpos_id = WpPropId.mk_var_pos_id kf s ca in let vdecr_id = WpPropId.mk_var_decr_id kf s ca in let loc = v.term_loc in let lcurr = Clabels.to_logic (Clabels.loop_current s) in let vcurr = Logic_const.tat ~loc (v, lcurr) in let zero = Cil.lzero ~loc () in let vpos = Logic_const.prel ~loc (Rle, zero, vcurr) in let vdecr = Logic_const.prel ~loc (Rlt, v, vcurr) in (vpos_id, vpos), (vdecr_id, vdecr) (* -------------------------------------------------------------------------- *) ������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpStrategy.mli��������������������������������������������������0000666�0000000�0000000�00000026613�13571573400�016775� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open Cil_types open Clabels (* -------------------------------------------------------------------------- *) (** This file provide all the functions to build a strategy that can then * be used by the main generic calculus. *) (* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *) (** {2 Annotations} *) (* -------------------------------------------------------------------------- *) (** a set of annotations to be added to a program point. *) type t_annots val empty_acc : t_annots (** {3 How to use an annotation} *) (** An annotation can be used for different purpose. *) type annot_kind = | Ahyp (** annotation is an hypothesis, but not a goal (see Aboth) : A => ...*) | Agoal (** annotation is a goal, but not an hypothesis (see Aboth): A /\ ...*) | Aboth of bool (** annotation can be used as both hypothesis and goal : - with true : considered as both : A /\ A=>.. - with false : we just want to use it as hyp right now. *) | AcutB of bool (** annotation is use as a cut : - with true (A is also a goal) -> A (+ proof obligation A => ...) - with false (A is an hyp only) -> True (+ proof obligation A => ...) *) | AcallHyp of kernel_function (** annotation is a called function property to consider as an Hyp. * The pre are not here but in AcallPre since they can also * be considered as goals. *) | AcallPre of bool * kernel_function (** annotation is a called function precondition : to be considered as hyp, and goal if bool=true *) (** {3 Adding properties (predicates)} *) val normalize : WpPropId.prop_id -> ?assumes:predicate -> NormAtLabels.label_mapping -> predicate -> predicate option (** generic function to add a predicate property after normalisation. * All the [add_prop_xxx] functions below use this one. *) val add_prop : t_annots -> annot_kind -> WpPropId.prop_id -> predicate option -> t_annots val add_prop_fct_pre_bhv : t_annots -> annot_kind -> Cil_types.kernel_function -> Cil_types.funbehavior -> t_annots (** Add the predicate as a function precondition. * Add [assumes => pre] if [assumes] is given. *) val add_prop_fct_pre : t_annots -> annot_kind -> kernel_function -> funbehavior -> assumes: predicate option -> identified_predicate -> t_annots (** Add the preconditions of the behavior : * if [impl_assumes], add [b_assumes => b_requires] * else add both the [b_requires] and the [b_assumes] *) val add_prop_fct_bhv_pre : t_annots -> annot_kind -> kernel_function -> funbehavior -> impl_assumes:bool -> t_annots val add_prop_fct_post : t_annots -> annot_kind -> kernel_function -> funbehavior -> termination_kind -> identified_predicate -> t_annots (** Add the predicate as a stmt precondition. * Add [assumes => pre] if [assumes] is given. *) val add_prop_stmt_pre : t_annots -> annot_kind -> kernel_function -> stmt -> funbehavior -> assumes: predicate option -> identified_predicate -> t_annots (** Add the predicate as a stmt precondition. * Add [\old (assumes) => post] if [assumes] is given. *) val add_prop_stmt_post :t_annots -> annot_kind -> kernel_function -> stmt -> funbehavior -> termination_kind -> c_label option -> assumes:predicate option -> identified_predicate -> t_annots (** Add all the [b_requires]. Add [b_assumes => b_requires] if [with_assumes] *) val add_prop_stmt_bhv_requires : t_annots -> annot_kind -> kernel_function -> stmt -> funbehavior -> with_assumes:bool -> t_annots (** Process the stmt spec precondition as an hypothesis for external properties. * Add [assumes => requires] for all the behaviors. *) val add_prop_stmt_spec_pre : t_annots -> annot_kind -> kernel_function -> stmt -> funspec -> t_annots val add_prop_call_pre : t_annots -> annot_kind -> WpPropId.prop_id -> assumes:predicate -> identified_predicate -> t_annots (** Add a postcondition of a called function. Beware that [kf] and [bhv] * are the called one. *) val add_prop_call_post : t_annots -> annot_kind -> kernel_function -> funbehavior -> termination_kind -> assumes:predicate -> identified_predicate -> t_annots val add_prop_assert : t_annots -> annot_kind -> kernel_function -> stmt -> code_annotation -> predicate -> t_annots val add_prop_loop_inv : t_annots -> annot_kind -> stmt -> established:bool -> WpPropId.prop_id -> predicate -> t_annots (** {3 Adding assigns properties} *) (** generic function to add an assigns property. *) val add_assigns : t_annots -> annot_kind -> WpPropId.prop_id -> WpPropId.assigns_desc -> t_annots (** generic function to add a WriteAny assigns property. *) val add_assigns_any : t_annots -> annot_kind -> WpPropId.assigns_full_info -> t_annots (** shortcut to add a stmt spec assigns property as an hypothesis. *) val add_stmt_spec_assigns_hyp : t_annots -> kernel_function -> stmt -> c_label option -> funspec -> t_annots (** short cut to add a dynamic call *) val add_call_assigns_any : t_annots -> stmt -> t_annots (** shortcut to add a call assigns property as an hypothesis. *) val add_call_assigns_hyp : t_annots -> kernel_function -> stmt -> called_kf:kernel_function -> c_label option -> funspec option -> t_annots (** shortcut to add a loop assigns property as an hypothesis. *) val add_loop_assigns_hyp : t_annots -> kernel_function -> stmt -> (code_annotation * from list) option -> t_annots val add_fct_bhv_assigns_hyp : t_annots -> kernel_function -> termination_kind -> funbehavior -> t_annots val assigns_upper_bound : funspec -> (funbehavior * from list) option (** {3 Getting information from annotations} *) val get_hyp_only : t_annots -> WpPropId.pred_info list val get_goal_only : t_annots -> WpPropId.pred_info list val get_both_hyp_goals : t_annots -> WpPropId.pred_info list * WpPropId.pred_info list (** the [bool] in [get_cut] results says if the property has to be * considered as a both goal and hyp ([goal=true], or hyp only ([goal=false]) *) val get_cut : t_annots -> (bool * WpPropId.pred_info) list (** To be used as hypotheses around a call, (the pre are in * [get_call_pre_goal]) *) val get_call_hyp : t_annots -> kernel_function -> WpPropId.pred_info list (** Preconditions of a called function to be considered as hyp and goal * (similar to [get_both_hyp_goals]). *) val get_call_pre : t_annots -> kernel_function -> WpPropId.pred_info list * WpPropId.pred_info list val get_call_asgn : t_annots -> kernel_function option -> WpPropId.assigns_full_info val get_asgn_hyp : t_annots -> WpPropId.assigns_full_info val get_asgn_goal : t_annots -> WpPropId.assigns_full_info (** {3 Printing} *) val pp_annots : Format.formatter -> t_annots -> unit (* -------------------------------------------------------------------------- *) (** {2 Annotation table} *) (* -------------------------------------------------------------------------- *) type annots_tbl val create_tbl : unit -> annots_tbl val add_on_edges : annots_tbl -> t_annots -> Cil2cfg.edge list -> unit (** [add_node_annots cfg annots v (before, (after, exits))] * add the annotations for the node : * @param before preconditions * @param after postconditions * @param exits \exits properties *) val add_node_annots : annots_tbl -> Cil2cfg.t -> Cil2cfg.node -> (t_annots * (t_annots * t_annots)) -> unit val add_loop_annots : annots_tbl -> Cil2cfg.t -> Cil2cfg.node -> entry:t_annots -> back:t_annots -> core:t_annots -> unit val add_axiom : annots_tbl -> LogicUsage.logic_lemma -> unit val add_all_axioms : annots_tbl -> unit (* -------------------------------------------------------------------------- *) (** {2 Strategy} *) (* -------------------------------------------------------------------------- *) type strategy type strategy_for_froms = { get_pre : unit -> t_annots; more_vars : logic_var list } type strategy_kind = | SKannots (** normal mode for annotations *) | SKfroms of strategy_for_froms val mk_strategy : string -> Cil2cfg.t -> string option -> strategy_kind -> annots_tbl -> strategy val get_annots : strategy -> Cil2cfg.edge -> t_annots val strategy_has_asgn_goal : strategy -> bool val strategy_has_prop_goal : strategy -> bool val strategy_kind : strategy -> strategy_kind val global_axioms : strategy -> WpPropId.axiom_info list val behavior_name_of_strategy : strategy -> string option val is_default_behavior : strategy -> bool val cfg_of_strategy : strategy -> Cil2cfg.t val get_kf : strategy -> kernel_function val get_bhv : strategy -> string option val pp_info_of_strategy : Format.formatter -> strategy -> unit (* -------------------------------------------------------------------------- *) (** {2 Other useful things} *) (* -------------------------------------------------------------------------- *) (** The function is the main entry point AND it is not a lib entry *) val is_main_init : Cil_types.kernel_function -> bool (** True if both options [-const-readonly] and [-wp-init] are positioned, and the variable is global, not extern, with a ["const"] type (see [hasConstAttribute]). @since Sodium-20150201 *) val isInitConst : unit -> bool (** True if the variable is global, not extern, with a ["const"] qualifier type. {b Should} only apply when [isInitConst] is true. @since Sodium-20150201 *) val isGlobalInitConst : varinfo -> bool (** apply [f_normal] on the [Normal] postconditions, * [f_exits] on the [Exits] postconditions, and warn on the others. *) val fold_bhv_post_cond : warn:bool -> ('n_acc -> Cil_types.identified_predicate -> 'n_acc) -> ('e_acc -> Cil_types.identified_predicate -> 'e_acc) -> 'n_acc * 'e_acc -> funbehavior -> 'n_acc * 'e_acc val mk_variant_properties : kernel_function -> stmt -> code_annotation -> term -> (WpPropId.prop_id * predicate) * (WpPropId.prop_id * predicate) (* -------------------------------------------------------------------------- *) ���������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wp_error.ml�����������������������������������������������������0000666�0000000�0000000�00000007127�13571573400�016311� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ------------------------------------------------------------------------ *) (* --- Exception Handling in WP --- *) (* ------------------------------------------------------------------------ *) exception Error of string * string let current = ref "wp" let set_model m = current := m let unsupported ?(model= !current) fmt = let b = Buffer.create 80 in Buffer.add_string b "unsupported " ; let kf fmt = Format.pp_print_flush fmt () ; raise (Error(model,Buffer.contents b)) in Format.kfprintf kf (Format.formatter_of_buffer b) fmt let not_yet_implemented ?(model= !current) fmt = let b = Buffer.create 80 in let kf fmt = Format.pp_print_string fmt " not yet implemented" ; Format.pp_print_flush fmt () ; raise (Error(model,Buffer.contents b)) in Format.kfprintf kf (Format.formatter_of_buffer b) fmt open Cil_types let pp_logic_label fmt label = match label with | BuiltinLabel l -> Printer.pp_logic_builtin_label fmt l | FormalLabel s -> Format.pp_print_string fmt s | StmtLabel {contents=stmt} -> Format.pp_print_string fmt (let rec pickLabel = function | [] -> Printf.sprintf "__unknown_label_%d" stmt.sid | Label (l, _, _) :: _ -> l | _ :: rest -> pickLabel rest in pickLabel stmt.labels) let pp_assigns fmt asgns = match asgns with | WritesAny -> Format.fprintf fmt "<undef>" | _ -> Format.fprintf fmt "@[<hov 2>%a@]" (Printer.pp_full_assigns "") asgns let pp_string_list ?(sep=format_of_string "@ ") ~empty fmt l = match l with [] -> Format.fprintf fmt "%s" empty | _ -> Format.fprintf fmt "%a" (Pretty_utils.pp_list ~sep Format.pp_print_string) l let name = function | [] -> "" | [x] -> x | x::xs -> let buffer = Buffer.create 80 in Buffer.add_string buffer x ; List.iter (fun y -> if y <> "" then ( Buffer.add_char buffer '-' ; Buffer.add_string buffer y )) xs ; Buffer.contents buffer �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wp_error.mli����������������������������������������������������0000666�0000000�0000000�00000004671�13571573400�016463� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) val name : string list -> string (* ------------------------------------------------------------------------ *) (* --- Exception Handling in WP --- *) (* ------------------------------------------------------------------------ *) open Cil_types exception Error of string * string (** To be raised a feature of C/ACSL cannot be supported by a memory model or is not implemented, or ... *) val set_model : string -> unit val unsupported : ?model:string -> ('a,Format.formatter,unit,'b) format4 -> 'a val not_yet_implemented : ?model:string -> ('a,Format.formatter,unit,'b) format4 -> 'a val pp_logic_label : Format.formatter -> logic_label -> unit val pp_assigns : Format.formatter -> Cil_types.assigns -> unit val pp_string_list : ?sep:Pretty_utils.sformat -> empty:string -> Format.formatter -> string list -> unit �����������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wp_parameters.ml������������������������������������������������0000666�0000000�0000000�00000102304�13571573400�017314� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) module Fc_Config = Config let () = Plugin.is_share_visible () let () = Plugin.is_session_visible () include Plugin.Register (struct let name = "WP" let shortname = "wp" let help = "Proof by Weakest Precondition Calculus" end) (* localize all warnings inside WP *) let warning ?wkey ?current = match current with | None -> warning ?wkey ~current:true | Some b -> warning ?wkey ~current:b let resetdemon = ref [] let on_reset f = resetdemon := f :: !resetdemon let reset () = List.iter (fun f -> f ()) !resetdemon let has_dkey (k:category) = is_debug_key_enabled k (* ------------------------------------------------------------------------ *) (* --- WP Generation --- *) (* ------------------------------------------------------------------------ *) let wp_generation = add_group "Goal Selection" let () = Parameter_customize.set_group wp_generation let () = Parameter_customize.do_not_save () module WP = Action(struct let option_name = "-wp" let help = "Generate proof obligations for all (selected) properties." end) let () = on_reset WP.clear let () = Parameter_customize.set_group wp_generation let () = Parameter_customize.do_not_save () module Functions = Kernel_function_set (struct let option_name = "-wp-fct" let arg_name = "f,..." let help = "Select properties of given functions (defaults to all functions)." end) let () = on_reset Functions.clear let () = Parameter_customize.set_group wp_generation let () = Parameter_customize.do_not_save () module SkipFunctions = Kernel_function_set (struct let option_name = "-wp-skip-fct" let arg_name = "f,..." let help = "Skip the specified functions (defaults to none)." end) let () = on_reset SkipFunctions.clear let () = Parameter_customize.set_group wp_generation let () = Parameter_customize.do_not_save () module Behaviors = String_list (struct let option_name = "-wp-bhv" let arg_name = "b,..." let help = "Select properties of the given behaviors (defaults to all behaviors) of the selected functions." end) let () = on_reset Behaviors.clear let () = Parameter_customize.set_group wp_generation let () = Parameter_customize.do_not_save () let () = Parameter_customize.no_category () module Properties = String_list (struct let option_name = "-wp-prop" let arg_name = "p,..." let help = "Select properties having the one of the given tagnames (defaults to all properties).\n\ You may also replace the tagname by '@category' for the selection of all properties of the given category.\n\ Accepted categories are: lemmas, requires, assigns, ensures, exits, complete_behaviors, disjoint_behaviors, assert, check, invariant, variant, breaks, continues, returns.\n\ Starts by a minus character to remove properties from the selection." end) let () = on_reset Properties.clear let () = Parameter_customize.set_group wp_generation module StatusAll = False(struct let option_name = "-wp-status-all" let help = "Select properties with any status." end) let () = Parameter_customize.set_group wp_generation module StatusTrue = False(struct let option_name = "-wp-status-valid" let help = "Select properties with status 'Valid'." end) let () = Parameter_customize.set_group wp_generation module StatusFalse = False(struct let option_name = "-wp-status-invalid" let help = "Select properties with status 'Invalid'." end) let () = Parameter_customize.set_group wp_generation module StatusMaybe = True(struct let option_name = "-wp-status-maybe" let help = "Select properties with status 'Maybe'." end) (* ------------------------------------------------------------------------ *) (* --- Selected Functions --- *) (* ------------------------------------------------------------------------ *) module Fct = Cil_datatype.Kf.Set type functions = | Fct_none | Fct_all | Fct_skip of Fct.t | Fct_list of Fct.t let iter_fct phi = function | Fct_none -> () | Fct_all -> Globals.Functions.iter phi | Fct_skip fs -> Globals.Functions.iter (fun kf -> if not (Fct.mem kf fs) then phi kf) | Fct_list fs -> Fct.iter phi fs let get_kf () = if Functions.is_empty() then if SkipFunctions.is_empty () then Fct_all else Fct_skip (SkipFunctions.get()) else Fct_list (Fct.diff (Functions.get()) (SkipFunctions.get())) let get_wp () = if WP.get () || not (Functions.is_empty()) || not (Behaviors.is_empty()) || not (Properties.is_empty()) then get_kf () else Fct_none let iter_wp f = iter_fct f (get_wp ()) let iter_kf f = iter_fct f (get_kf ()) (* ------------------------------------------------------------------------ *) (* --- Memory Models --- *) (* ------------------------------------------------------------------------ *) let wp_model = add_group "Model Selection" let () = Parameter_customize.set_group wp_model module Model = String_list (struct let option_name = "-wp-model" let arg_name = "model+..." let help = "Memory model selection. Available selectors:\n\ * 'Hoare' logic variables only\n\ * 'Typed' typed pointers only\n\ * '+nocast' no pointer cast\n\ * '+cast' unsafe pointer casts\n\ * '+raw' no logic variable\n\ * '+ref' by-reference-style pointers detection\n\ * '+nat/+int' natural / machine-integers arithmetics\n\ * '+real/+float' real / IEEE floating point arithmetics" end) let () = Parameter_customize.set_group wp_model module ByValue = String_set (struct let option_name = "-wp-unalias-vars" let arg_name = "var,..." let help = "Consider variable names non-aliased." end) let () = Parameter_customize.set_group wp_model module ByRef = String_set (struct let option_name = "-wp-ref-vars" let arg_name = "var,..." let help = "Consider variable names by reference." end) let () = Parameter_customize.set_group wp_model module InHeap = String_set (struct let option_name = "-wp-alias-vars" let arg_name = "var,..." let help = "Consider variable names aliased." end) let () = Parameter_customize.set_group wp_model module AliasInit = False(struct let option_name = "-wp-alias-init" let help = "Use initializers for aliasing propagation." end) let () = Parameter_customize.set_group wp_model module InCtxt = String_set (struct let option_name = "-wp-context-vars" let arg_name = "var,..." let help = "Consider variable names in isolated context." end) let () = Parameter_customize.set_group wp_model module ExternArrays = False(struct let option_name = "-wp-extern-arrays" let help = "Put some default size for extern arrays." end) let () = Parameter_customize.set_group wp_model module Overflows = False(struct let option_name = "-wp-overflows" let help = "Collect hypotheses for absence of overflow and downcast\n\ (incompatible with RTE generator plug-in)" end) let () = Parameter_customize.set_group wp_model module Literals = False(struct let option_name = "-wp-literals" let help = "Export content of string literals." end) let () = Parameter_customize.set_group wp_model module Volatile = True(struct let option_name = "-wp-volatile" let help = "Sound modeling of volatile access.\n\ Use -wp-no-volatile to ignore volatile attributes." end) (* -------------------------------------------------------------------------- *) (* --- Region Model --- *) (* -------------------------------------------------------------------------- *) let wp_region = add_group "Region Analysis" let () = Parameter_customize.set_group wp_region let () = Parameter_customize.do_not_save () module Region = False (struct let option_name = "-wp-region" let help = "Perform Region Analysis (experimental)" end) let () = Parameter_customize.set_group wp_region let () = Parameter_customize.do_not_save () module Region_fixpoint = True (struct let option_name = "-wp-region-fixpoint" let help = "Compute region aliasing fixpoint" end) let () = Parameter_customize.set_group wp_region let () = Parameter_customize.do_not_save () module Region_cluster = True (struct let option_name = "-wp-region-cluster" let help = "Compute region clustering fixpoint" end) let () = Parameter_customize.set_group wp_region let () = Parameter_customize.do_not_save () module Region_inline = True (struct let option_name = "-wp-region-inline" let help = "Inline aliased sub-clusters" end) let () = Parameter_customize.set_group wp_region let () = Parameter_customize.do_not_save () module Region_rw = True (struct let option_name = "-wp-region-rw" let help = "Written region are considered read-write by default" end) let () = Parameter_customize.set_group wp_region let () = Parameter_customize.do_not_save () module Region_pack = True (struct let option_name = "-wp-region-pack" let help = "Pack clusters by default" end) let () = Parameter_customize.set_group wp_region let () = Parameter_customize.do_not_save () module Region_flat = False (struct let option_name = "-wp-region-flat" let help = "Flatten arrays by default" end) let () = Parameter_customize.set_group wp_region module Region_annot = False (struct let option_name = "-region-annot" let help = "Register '@region' ACSL Annotations (auto with -wp-region)" end) (* ------------------------------------------------------------------------ *) (* --- WP Strategy --- *) (* ------------------------------------------------------------------------ *) let wp_strategy = add_group "Computation Strategies" let () = Parameter_customize.set_group wp_strategy module Init = True(struct let option_name = "-wp-init-const" let help = "Use initializers for global const variables." end) let () = Parameter_customize.set_group wp_strategy module CalleePreCond = True(struct let option_name = "-wp-callee-precond" let help = "Use pre-conditions of callee." end) let () = Parameter_customize.set_group wp_strategy module RTE = False(struct let option_name = "-wp-rte" let help = "Generate RTE guards before WP." end) let () = Parameter_customize.set_group wp_strategy module Split = False(struct let option_name = "-wp-split" let help = "Split conjunctions into sub-goals." end) let () = Parameter_customize.set_group wp_strategy module UnfoldAssigns = False(struct let option_name = "-wp-unfold-assigns" let help = "Unfold aggregates in assigns." end) let () = Parameter_customize.set_group wp_strategy module SplitDepth = Int(struct let option_name = "-wp-split-depth" let default = 0 let arg_name = "p" let help = "Set depth of exploration for splitting conjunctions into sub-goals.\n\ Value `-1` means an unlimited depth." end) let () = Parameter_customize.set_group wp_strategy module DynCall = True(struct let option_name = "-wp-dynamic" let help = "Handle dynamic calls with specific annotations." end) let () = Parameter_customize.set_group wp_strategy module PrecondWeakening = False(struct let option_name = "-wp-precond-weakening" let help = "Discard pre-conditions of side behaviours (sound but incomplete optimisation)." end) (* ------------------------------------------------------------------------ *) (* --- Qed Simplifications --- *) (* ------------------------------------------------------------------------ *) let wp_simplifier = add_group "Qed Simplifications" let () = Parameter_customize.set_group wp_simplifier module Simpl = True(struct let option_name = "-wp-simpl" let help = "Enable Qed Simplifications." end) let () = Parameter_customize.set_group wp_simplifier module Let = True(struct let option_name = "-wp-let" let help = "Use variable elimination." end) let () = Parameter_customize.set_group wp_simplifier module Core = True(struct let option_name = "-wp-core" let help = "Lift core facts through branches." end) let () = Parameter_customize.set_group wp_simplifier module Prune = True(struct let option_name = "-wp-pruning" let help = "Prune trivial branches." end) let () = Parameter_customize.set_group wp_simplifier module Clean = True(struct let option_name = "-wp-clean" let help = "Use a simple cleaning in case of -wp-no-let." end) let () = Parameter_customize.set_group wp_simplifier module Ground = True(struct let option_name = "-wp-ground" let help = "Use aggressive ground simplifications." end) let () = Parameter_customize.set_group wp_simplifier module Reduce = True(struct let option_name = "-wp-reduce" let help = "Reduce function equalities with precedence to constructors." end) let () = Parameter_customize.set_group wp_simplifier module ExtEqual = True(struct let option_name = "-wp-extensional" let help = "Use extensional equality on compounds (hypotheses only)." end) let () = Parameter_customize.set_group wp_simplifier module Filter = True(struct let option_name = "-wp-filter" let help = "Filter non-used variables and related hypotheses." end) let () = Parameter_customize.set_group wp_simplifier module Parasite = True(struct let option_name = "-wp-parasite" let help = "Use singleton-variable filtering." end) let () = Parameter_customize.set_group wp_simplifier module Prenex = False(struct let option_name = "-wp-prenex" let help = "Normalize nested foralls into prenex-form" end) let () = Parameter_customize.set_group wp_simplifier module Bits = True(struct let option_name = "-wp-bits" let help = "Use bit-test simplifications." end) let () = Parameter_customize.set_group wp_simplifier module SimplifyIsCint = True(struct let option_name = "-wp-simplify-is-cint" let help = "Remove redundant machine integer range hypothesis." end) let () = Parameter_customize.set_group wp_simplifier module SimplifyLandMask = True(struct let option_name = "-wp-simplify-land-mask" let help = "Tight logical masks on unsigned integers." end) let () = Parameter_customize.set_group wp_simplifier module SimplifyForall = False(struct let option_name = "-wp-simplify-forall" let help = "Remove machine integer ranges in quantifiers." end) let () = Parameter_customize.set_group wp_simplifier module SimplifyType = False(struct let option_name = "-wp-simplify-type" let help = "Remove all `Type` constraints." end) let () = Parameter_customize.set_group wp_simplifier module InitWithForall = True(struct let option_name = "-wp-init-summarize-array" let help = "Summarize contiguous initializers with quantifiers." end) let () = Parameter_customize.set_group wp_simplifier module BoundForallUnfolding = Int(struct let option_name = "-wp-bound-forall-unfolding" let help = "Instantiate up to <n> forall-integers hypotheses." let arg_name="n" let default = 1000 end) (* ------------------------------------------------------------------------ *) (* --- Prover Interface --- *) (* ------------------------------------------------------------------------ *) let wp_prover = add_group "Prover Interface" let () = Parameter_customize.set_group wp_prover module Provers = String_list (struct let option_name = "-wp-prover" let arg_name = "dp,..." let help = "Submit proof obligations to external prover(s):\n\ - 'none' to skip provers\n\ - 'script' (session scripts only)\n\ - 'tip' (failed scripts only)\n\ - 'alt-ergo' (default)\n\ - 'altgr-ergo' (gui)\n\ - 'coq', 'coqide' (see also -wp-coq-script)\n\ - 'why3:<dp>' or '<dp>' (why3 prover, see -wp-detect)\n\ - 'native:alt-ergo'\n\ - 'native:coq'\n\ - 'native:coqide'\ " end) let () = Parameter_customize.set_group wp_prover module Cache = String (struct let option_name = "-wp-cache" let arg_name = "mode" let default = "" let help = "WP cache mode:\n\ - 'none': no cache, run provers (default)\n\ - 'update': use cache or run provers and update cache\n\ - 'cleanup': update mode with garbage collection\n\ - 'replay': update mode with no cache update\n\ - 'rebuild': always run provers and update cache\n\ - 'offline': use cache but never run provers\n\ This option is overriden by environment variable FRAMAC_WP_CACHE.\ " end) let () = Parameter_customize.set_group wp_prover module Generate = False (struct let option_name = "-wp-gen" let help = "Only generate prover files (default: no)." end) let () = on_reset Generate.clear let () = Parameter_customize.set_group wp_prover module Detect = Action (struct let option_name = "-wp-detect" let help = "List installed provers." end) let () = on_reset Detect.clear let () = Parameter_customize.set_group wp_prover module Drivers = String_list (struct let option_name = "-wp-driver" let arg_name = "file,..." let help = "Load drivers for linking to external libraries" end) let () = Parameter_customize.set_group wp_prover module Steps = Int(struct let option_name = "-wp-steps" let default = 0 let arg_name = "n" let help = "Set number of steps for provers." end) let () = Parameter_customize.set_group wp_prover module Timeout = Int(struct let option_name = "-wp-timeout" let default = 10 let arg_name = "n" let help = Printf.sprintf "Set the timeout (in seconds) for provers (default: %d)." default end) let () = Parameter_customize.set_group wp_prover module TimeExtra = Int(struct let option_name = "-wp-time-extra" let default = 5 let arg_name = "n" let help = Printf.sprintf "Set extra-time (in seconds) for proof replay (default: %d)." default end) let () = Parameter_customize.set_group wp_prover module TimeMargin = Int(struct let option_name = "-wp-time-margin" let default = 2 let arg_name = "n" let help = Printf.sprintf "Set margin-time (in seconds) for considering a proof automatic.\n\ When using the 'tip' prover, scripts are created or cancelled\n\ if the proof time is greater or lower than (timeout - margin).\n\ (default: %d)." default end) let () = Parameter_customize.set_group wp_prover module Procs = Int(struct let option_name = "-wp-par" let arg_name = "p" let default = 4 let help = Printf.sprintf "Number of parallel proof process (default: %d)" default end) let () = Parameter_customize.set_group wp_prover module ProofTrace = False (struct let option_name = "-wp-proof-trace" let help = "Keeps output of provers for valid POs (default: no)" end) (* ------------------------------------------------------------------------ *) (* --- Prover Options --- *) (* ------------------------------------------------------------------------ *) let wp_prover_options = add_group "Prover Options" let () = Parameter_customize.set_group wp_prover module Auto = String_list (struct let option_name = "-wp-auto" let arg_name = "s" let help = "Activate auto-search with strategy <s>.\n\ Use '-wp-auto <?>' for available strategies." end) let () = Parameter_customize.set_group wp_prover module AutoDepth = Int (struct let option_name = "-wp-auto-depth" let arg_name = "n" let default = 5 let help = "Depth of auto-search (-wp-auto only, default 5).\n\ Limits the number of nested level in strategies." end) let () = Parameter_customize.set_group wp_prover module AutoWidth = Int (struct let option_name = "-wp-auto-width" let arg_name = "n" let default = 10 let help = "Width of auto-search (-wp-auto only, default 10).\n\ Limits the number of pending goals in strategies." end) let () = Parameter_customize.set_group wp_prover module BackTrack = Int (struct let option_name = "-wp-auto-backtrack" let arg_name = "n" let default = 0 let help = "Backtracking limit (-wp-auto only, de-activated by default).\n\ Limits backtracking when applying strategies." end) let () = Parameter_customize.set_group wp_prover_options module Script = String(struct let option_name = "-wp-coq-script" let arg_name = "f.script" let default = "" let help = "Set user's file for Coq proofs." end) let () = Parameter_customize.set_group wp_prover_options module UpdateScript = True(struct let option_name = "-wp-update-coq-script" let help = "If turned off, do not save or modify user's proofs." end) let () = Parameter_customize.set_group wp_prover_options module CoqTimeout = Int(struct let option_name = "-wp-coq-timeout" let default = 30 let arg_name = "n" let help = Printf.sprintf "Set the timeout (in seconds) for Coq (default: %d)." default end) let () = Parameter_customize.set_group wp_prover_options module CoqCompiler = String(struct let option_name = "-wp-coqc" let default = "coqc" let arg_name = "cmd" let help = Printf.sprintf "Set the command line to run Coq Compiler (default 'coqc')." end) let () = Parameter_customize.set_group wp_prover_options module CoqIde = String(struct let option_name = "-wp-coqide" let default = "coqide" let arg_name = "cmd" let help = Printf.sprintf "Set the command line to run CoqIde (default 'coqide')\n\ If the command-line contains 'emacs' (case insentive),\n\ a coq-project file is used instead of coq options." end) let () = Parameter_customize.set_group wp_prover_options module CoqProject = String(struct let option_name = "-wp-coq-project" let default = "_CoqProject" let arg_name = "file" let help = Printf.sprintf "Set the Coq-Project file to used with Proof General (default '_CoqProject')" end) let () = Parameter_customize.set_group wp_prover_options module CoqTactic = String (struct let option_name = "-wp-coq-tactic" let arg_name = "proof" let default = "auto with zarith" let help = "Default tactic for Coq" end) let () = Parameter_customize.set_group wp_prover_options module TryHints = False (struct let option_name = "-wp-coq-tryhints" let help = "Try scripts from other goals (see also -wp-hints)" end) let () = Parameter_customize.set_group wp_prover_options module Hints = Int (struct let option_name = "-wp-coq-hints" let arg_name = "n" let default = 3 let help = "Maximum number of proposed Coq scripts (default 3)" end) let () = Parameter_customize.set_group wp_prover_options module CoqLibs = String_list (struct let option_name = "-wp-coq-lib" let arg_name = "*.v,*.vo" let help = "Additional libraries for Coq" end) let () = Parameter_customize.set_group wp_prover_options let () = Parameter_customize.no_category () module Why3Flags = String_list (struct let option_name = "-wp-why3-opt" let arg_name = "option,..." let help = "Additional options for Why3" end) let () = Parameter_customize.set_group wp_prover_options module AltErgo = String(struct let option_name = "-wp-alt-ergo" let default = "alt-ergo" let arg_name = "<cmd>" let help = "Command to run alt-ergo (default: 'alt-ergo')" end) let () = Parameter_customize.set_group wp_prover_options module AltGrErgo = String(struct let option_name = "-wp-altgr-ergo" let default = "altgr-ergo" let arg_name = "<cmd>" let help = "Command to run alt-ergo user interface (default: 'altgr-ergo')" end) let () = Parameter_customize.set_group wp_prover_options module AltErgoLibs = String_list (struct let option_name = "-wp-alt-ergo-lib" let arg_name = "*.mlw" let help = "Additional library file for Alt-Ergo" end) let () = Parameter_customize.set_group wp_prover_options let () = Parameter_customize.no_category () module AltErgoFlags = String_list (struct let option_name = "-wp-alt-ergo-opt" let arg_name = "option,..." let help = "Additional options for Alt-Ergo" end) (* ------------------------------------------------------------------------ *) (* --- PO Management --- *) (* ------------------------------------------------------------------------ *) let wp_po = add_group "Proof Obligations" let () = Parameter_customize.set_group wp_po module TruncPropIdFileName = Int(struct let option_name = "-wp-filename-truncation" let default = 60 let arg_name = "n" let help = "Truncate basename of proof obligation files after <n> characters.\n\ Since numbers can be added as suffixes to make theses names unique,\n\ filename lengths can be highter to <n>. No truncation is performed\n\ when the value equals to zero (default: 60)." end) let () = Parameter_customize.set_group wp_po let () = Parameter_customize.do_not_save () module Print = Action(struct let option_name = "-wp-print" let help = "Pretty-prints proof obligations on standard output." end) let () = on_reset Print.clear let () = Parameter_customize.set_group wp_po let () = Parameter_customize.do_not_save () module Report = String_list (struct let option_name = "-wp-report" let arg_name = "report,..." let help = "Report specification file(s)" end) let () = Parameter_customize.set_group wp_po let () = Parameter_customize.do_not_save () module ReportJson = String (struct let option_name = "-wp-report-json" let arg_name = "file.json" let default = "" let help = "Output report in json format into given file.\n\ If the file already exists, it is used for\n\ stabilizing range of steps in other reports." end) let () = Parameter_customize.set_group wp_po let () = Parameter_customize.do_not_save () module ReportName = String(struct let option_name = "-wp-report-basename" let arg_name = "file" let default = "wp-report" let help = Printf.sprintf "Basename of generated reports (default %S)" default end) let () = Parameter_customize.set_group wp_po let () = Parameter_customize.do_not_save () module MemoryContext = True (struct let option_name = "-wp-warn-memory-model" let help = "Warn Against Memory Model Hypotheses" end) let () = Parameter_customize.set_group wp_po module OutputDir = String(struct let option_name = "-wp-out" let arg_name = "dir" let default = "" let help = "Set working directory for generated files.\n\ Defaults to some temporary directory." end) let () = Parameter_customize.set_group wp_po let () = Parameter_customize.do_not_save () module Check = Action(struct let option_name = "-wp-check" let help = "Check the syntax and type of the produced file, instead of proving." end) let () = on_reset Print.clear (* -------------------------------------------------------------------------- *) (* --- Overflows --- *) (* -------------------------------------------------------------------------- *) let active_unless_rte option = if RTE.get () || Dynamic.Parameter.Bool.get "-rte" () then ( warning ~once:true "Option %s incompatiable with RTE (ignored)" option ; false ) else true let get_overflows () = Overflows.get () && active_unless_rte "-wp-overflows" (* -------------------------------------------------------------------------- *) (* --- Output Dir --- *) (* -------------------------------------------------------------------------- *) let dkey = register_category "prover" let has_out () = OutputDir.get () <> "" let make_output_dir dir = if Sys.file_exists dir then begin if not (Sys.is_directory dir) then abort "File '%s' is not a directory (WP aborted)" dir ; end else begin try Unix.mkdir dir 0o770 ; debug ~dkey "Created output directory '%s'" dir with Unix.Unix_error (err,_,_) -> let msg = Unix.error_message err in abort "System Error (%s)@\nCan not create output directory '%s'" msg dir end (*[LC] Do not projectify this reference : it is common to all projects *) let unique_tmp = ref None let make_tmp_dir () = match !unique_tmp with | None -> let tmp = try Extlib.temp_dir_cleanup_at_exit "wp" with Extlib.Temp_file_error s -> abort "Cannot create temporary file: %s" s in unique_tmp := Some tmp ; debug ~dkey "Created temporary directory '%s'" tmp ; tmp | Some tmp -> tmp let make_gui_dir () = try let home = try Sys.getenv "USERPROFILE" (*Win32*) with Not_found -> try Sys.getenv "HOME" (*Unix like*) with Not_found -> "." in let dir = home ^ "/" ^ ".frama-c-wp" in if Sys.file_exists dir && Sys.is_directory dir then Extlib.safe_remove_dir dir; make_output_dir dir ; dir with _ -> make_tmp_dir () (** call the construction of the directory only once *) let base_output = ref None let base_output () = match !base_output with | None -> let output = match OutputDir.get () with | "" -> if !Fc_Config.is_gui then make_gui_dir () else make_tmp_dir () | dir -> make_output_dir dir ; dir in base_output := Some output; Fc_Filepath.add_symbolic_dir "WPOUT" output ; output | Some output -> output let get_output () = let base = base_output () in let project = Project.current () in let name = Project.get_unique_name project in if name = "default" then base else let dir = base ^ "/" ^ name in make_output_dir dir ; dir let get_output_dir d = let base = get_output () in let path = Printf.sprintf "%s/%s" base d in make_output_dir path ; path (* -------------------------------------------------------------------------- *) (* --- Session dir --- *) (* -------------------------------------------------------------------------- *) let default = Sys.getcwd () ^ "/.frama-c" let has_session () = Session.Dir_name.is_set () || ( Sys.file_exists default && Sys.is_directory default ) let get_session () = Session.dir ~error:false () let get_session_dir d = let base = get_session () in let path = Printf.sprintf "%s/%s" base d in make_output_dir path ; path let cat_print_generated = register_category "print-generated" let has_print_generated () = has_dkey cat_print_generated let print_generated ?header file = let header = match header with | None -> Fc_Filepath.Normalized.to_pretty_string (Datatype.Filepath.of_string file) | Some head -> head in debug ~dkey:cat_print_generated "%S@\n%t@." header begin fun fmt -> if not (Sys.file_exists file) then Format.pp_print_string fmt "<missing file>" else Command.read_lines file (fun s -> Format.pp_print_string fmt s; Format.pp_print_newline fmt ()) end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wp_parameters.mli�����������������������������������������������0000666�0000000�0000000�00000013724�13571573400�017474� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) include Plugin.S val reset : unit -> unit (** {2 Function Selection} *) type functions = | Fct_none | Fct_all | Fct_skip of Cil_datatype.Kf.Set.t | Fct_list of Cil_datatype.Kf.Set.t val get_kf : unit -> functions val get_wp : unit -> functions val iter_fct : (Kernel_function.t -> unit) -> functions -> unit val iter_kf : (Kernel_function.t -> unit) -> unit val iter_wp : (Kernel_function.t -> unit) -> unit (** {2 Goal Selection} *) module WP : Parameter_sig.Bool module Behaviors : Parameter_sig.String_list module Properties : Parameter_sig.String_list module StatusAll : Parameter_sig.Bool module StatusTrue : Parameter_sig.Bool module StatusFalse : Parameter_sig.Bool module StatusMaybe : Parameter_sig.Bool (** {2 Model Selection} *) val has_dkey : category -> bool module Model : Parameter_sig.String_list module ByValue : Parameter_sig.String_set module ByRef : Parameter_sig.String_set module InHeap : Parameter_sig.String_set module AliasInit: Parameter_sig.Bool module InCtxt : Parameter_sig.String_set module ExternArrays: Parameter_sig.Bool module Literals : Parameter_sig.Bool module Volatile : Parameter_sig.Bool module Region: Parameter_sig.Bool module Region_rw: Parameter_sig.Bool module Region_pack: Parameter_sig.Bool module Region_flat: Parameter_sig.Bool module Region_annot: Parameter_sig.Bool module Region_inline: Parameter_sig.Bool module Region_fixpoint: Parameter_sig.Bool module Region_cluster: Parameter_sig.Bool (** {2 Computation Strategies} *) module Init: Parameter_sig.Bool module InitWithForall: Parameter_sig.Bool module BoundForallUnfolding: Parameter_sig.Int module RTE: Parameter_sig.Bool module Simpl: Parameter_sig.Bool module Let: Parameter_sig.Bool module Core: Parameter_sig.Bool module Prune: Parameter_sig.Bool module Clean: Parameter_sig.Bool module Filter: Parameter_sig.Bool module Parasite: Parameter_sig.Bool module Prenex: Parameter_sig.Bool module Bits: Parameter_sig.Bool module Ground: Parameter_sig.Bool module Reduce: Parameter_sig.Bool module ExtEqual : Parameter_sig.Bool module UnfoldAssigns : Parameter_sig.Bool module Split: Parameter_sig.Bool module SplitDepth: Parameter_sig.Int module DynCall : Parameter_sig.Bool module SimplifyIsCint : Parameter_sig.Bool module SimplifyLandMask : Parameter_sig.Bool module SimplifyForall : Parameter_sig.Bool module SimplifyType : Parameter_sig.Bool module CalleePreCond : Parameter_sig.Bool module PrecondWeakening : Parameter_sig.Bool (** {2 Prover Interface} *) module Detect: Parameter_sig.Bool module Generate:Parameter_sig.Bool module Provers: Parameter_sig.String_list module Cache: Parameter_sig.String module Drivers: Parameter_sig.String_list module Script: Parameter_sig.String module UpdateScript: Parameter_sig.Bool module Timeout: Parameter_sig.Int module TimeExtra: Parameter_sig.Int module TimeMargin: Parameter_sig.Int module CoqTimeout: Parameter_sig.Int module CoqCompiler : Parameter_sig.String module CoqIde : Parameter_sig.String module CoqProject : Parameter_sig.String module Steps: Parameter_sig.Int module Procs: Parameter_sig.Int module ProofTrace: Parameter_sig.Bool module CoqLibs: Parameter_sig.String_list module CoqTactic: Parameter_sig.String module Hints: Parameter_sig.Int module TryHints: Parameter_sig.Bool module Why3Flags: Parameter_sig.String_list module AltErgo: Parameter_sig.String module AltGrErgo: Parameter_sig.String module AltErgoLibs: Parameter_sig.String_list module AltErgoFlags: Parameter_sig.String_list module Auto: Parameter_sig.String_list module AutoDepth: Parameter_sig.Int module AutoWidth: Parameter_sig.Int module BackTrack: Parameter_sig.Int (** {2 Proof Obligations} *) module TruncPropIdFileName: Parameter_sig.Int module Print: Parameter_sig.Bool module Report: Parameter_sig.String_list module ReportJson: Parameter_sig.String module ReportName: Parameter_sig.String module MemoryContext: Parameter_sig.Bool module Check: Parameter_sig.Bool (** {2 Getters} *) val has_out : unit -> bool val has_session : unit -> bool val get_session : unit -> string val get_session_dir : string -> string val get_output : unit -> string val get_output_dir : string -> string val make_output_dir : string -> unit val get_overflows : unit -> bool (** {2 Debugging Categories} *) val has_print_generated: unit -> bool val print_generated: ?header:string -> string -> unit (** print the given file if the debugging category "print-generated" is set *) val cat_print_generated: category ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wpo.ml����������������������������������������������������������0000666�0000000�0000000�00000072752�13571573400�015265� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open LogicUsage open VCS open Cil_types open Cil_datatype open Lang type index = | Axiomatic of string option | Function of kernel_function * string option let bar = String.make 60 '-' let flow = ref false (* -------------------------------------------------------------------------- *) (* --- Pretty Printers --- *) (* -------------------------------------------------------------------------- *) let pp_index fmt = function | Axiomatic None -> Format.pp_print_string fmt "Axiomatics" | Axiomatic (Some a) -> Format.pp_print_string fmt a | Function(f,None) -> Kernel_function.pretty fmt f | Function(f,Some b) -> Format.fprintf fmt "%a for %s:" Kernel_function.pretty f b let pp_axiomatics fmt ax = flow := true ; match ax with | None -> Format.fprintf fmt "%s@\n Global@\n%s@\n@\n" bar bar | Some a -> Format.fprintf fmt "%s@\n Axiomatic '%s'@\n%s@\n@\n" bar a bar let pp_function fmt kf bhv = flow := true ; match bhv with | None -> Format.fprintf fmt "%s@\n Function %s@\n%s@\n@\n" bar (Kernel_function.get_name kf) bar | Some bhv -> Format.fprintf fmt "%s@\n Function %s with behavior %s@\n%s@\n@\n" bar (Kernel_function.get_name kf) bhv bar let pp_warnings fmt ws = List.iter (fun w -> Format.fprintf fmt "%a@\n" Warning.pretty w) ws let kf_context = function Axiomatic _ -> `Always | Function(kf,_) -> `Context kf let pp_dependency context fmt d = Format.fprintf fmt " - Assumes %a" (Description.pp_localized ~kf:context ~ki:false ~kloc:true) d let pp_dependencies context fmt ds = List.iter (fun d -> Format.fprintf fmt "%a@\n" (pp_dependency context) d) ds let pp_depend fmt d = Format.fprintf fmt " - Assumes %a" (Description.pp_localized ~kf:`Always ~ki:false ~kloc:true) d (* ------------------------------------------------------------------------ *) (* --- Proof Obligations Definition --- *) (* ------------------------------------------------------------------------ *) module DISK = struct let file ~id ~model ?prover ?suffix ~ext () = let mid = Wp_parameters.get_output_dir (WpContext.MODEL.id model) in let buffer = Buffer.create 80 in let fmt = Format.formatter_of_buffer buffer in Format.fprintf fmt "%s/%s" mid id ; (match prover with None -> () | Some p -> Format.fprintf fmt "_%s" (filename_for_prover p)) ; (match suffix with None -> () | Some s -> Format.fprintf fmt "_%s" s) ; Format.fprintf fmt ".%s" ext ; Format.pp_print_flush fmt (); Buffer.contents buffer let file_logout ~pid ~model ~prover = let id = WpPropId.get_propid pid in file ~id ~model ~prover ~ext:"out" () let file_logerr ~pid ~model ~prover = let id = WpPropId.get_propid pid in file ~id ~model ~prover ~ext:"err" () let file_goal ~pid ~model ~prover = let ext = match prover with | Qed -> "qed" | NativeAltErgo -> "mlw" | Why3 _ -> "why" | NativeCoq -> "v" | Tactical -> "tac" in let id = WpPropId.get_propid pid in file ~id ~model ~prover ~ext () let file_kf ~kf ~model ~prover = let ext = match prover with | Qed -> "qed" | NativeAltErgo -> "mlw" | Why3 _ -> "why" | NativeCoq -> "v" | Tactical -> "tac" in let id = (Kf.vi kf).vname in file ~id ~model ~prover ~ext () let dump_file fmt title file = if Sys.file_exists file then begin Format.fprintf fmt "--- %s ---------------------------------@\n" title ; Command.pp_from_file fmt file end let pretty ~pid ~model ~prover ~result fmt = begin Format.fprintf fmt "[%a] Goal %a : %a@\n" pp_prover prover WpPropId.pp_propid pid pp_result result ; dump_file fmt "StdOut" (file_logout ~pid ~model ~prover) ; dump_file fmt "StdErr" (file_logerr ~pid ~model ~prover) ; end let cache_log ~pid ~model ~prover ~result = (*TODO: put a cache here *) let dir = Wp_parameters.get_output () in let file = Printf.sprintf "%s/log.txt" dir in Command.print_file file (pretty ~pid ~model ~prover ~result) ; file let cache_descr pretty = (*TODO: put a cache here *) let dir = Wp_parameters.get_output () in let file = Printf.sprintf "%s/goal.txt" dir in Command.print_file file (fun fmt -> pretty fmt) ; file end module GOAL = struct type t = { mutable time : float ; mutable simplified : bool ; mutable sequent : Conditions.sequent ; mutable obligation : F.pred ; } let empty = Conditions.empty let dummy = { time = 0.0 ; simplified = false ; sequent = empty , F.p_false ; obligation = F.p_false ; } let trivial = { time = 0.0 ; simplified = true ; sequent = empty , F.p_true ; obligation = F.p_true ; } let make sequent = { time = 0.0 ; simplified = false ; sequent = sequent ; obligation = F.p_false ; } let is_trivial g = Conditions.is_trivial g.sequent let apply phi g = g.sequent <- phi g.sequent let default_simplifiers = [ Wp_parameters.SimplifyIsCint.get, Cint.is_cint_simplifier ; Wp_parameters.SimplifyLandMask.get, Cint.mask_simplifier ; ] let preprocess g = if Wp_parameters.Let.get () then begin apply Conditions.introduction_eq g ; let fold acc (get,solver) = if get () then solver::acc else acc in let solvers = List.fold_left fold [] default_simplifiers in apply (Conditions.simplify ~solvers) g ; if Wp_parameters.Prune.get () then apply (Conditions.pruning ~solvers) g ; if Wp_parameters.Filter.get () then apply Conditions.filter g ; if Wp_parameters.Parasite.get () then apply Conditions.parasite g ; end else begin if Wp_parameters.Clean.get () then apply Conditions.clean g ; end ; if Conditions.is_trivial g.sequent then g.sequent <- Conditions.trivial ; g.obligation <- Conditions.close g.sequent let dkey = Wp_parameters.register_category "prover" let safecompute g = begin g.simplified <- true ; let timer = ref 0.0 in Wp_parameters.debug ~dkey "Simplify goal" ; Command.time ~rmax:timer preprocess g ; Wp_parameters.debug ~dkey "Simplification time: %a" Rformat.pp_time !timer ; g.time <- !timer ; end let compute g = if not g.simplified then Lang.local ~vars:(Conditions.vars_seq g.sequent) safecompute g let compute_proof g = compute g ; g.obligation let compute_descr g = compute g ; g.sequent let get_descr g = g.sequent let qed_time g = g.time end module VC_Lemma = struct open Definitions type t = { lemma : Definitions.dlemma ; depends : logic_lemma list ; mutable sequent : Conditions.sequent option ; } let is_trivial vc = vc.lemma.l_lemma == F.p_true let sequent vc = match vc.sequent with | Some s -> s | None -> let s = Conditions.lemma vc.lemma.l_lemma in vc.sequent <- Some s ; s let pretty fmt vc results = begin Format.fprintf fmt "Lemma %s:@\n" vc.lemma.l_name ; if vc.depends <> [] then begin Format.fprintf fmt "@[<hov 2>@{<bf>Assume@}:" ; List.iter (fun a -> Format.fprintf fmt "@ '%s'" a.lem_name) vc.depends ; Format.fprintf fmt "@]@." ; end ; let env = F.env (List.fold_right F.Vars.add vc.lemma.l_forall F.Vars.empty) in Format.fprintf fmt "@{<bf>Prove@}: @[<hov 2>%a@]@." (F.pp_epred env) vc.lemma.l_lemma ; List.iter (fun (prover,result) -> if result.verdict <> NoResult then Format.fprintf fmt "Prover %a returns %a@\n" pp_prover prover pp_result result ) results ; end let cache_descr vc results = DISK.cache_descr (fun fmt -> pretty fmt vc results) end module VC_Annot = struct type t = { (* Generally empty, but for Lemma sub-goals *) axioms : Definitions.axioms option ; goal : GOAL.t ; tags : Splitter.tag list ; warn : Warning.t list ; deps : Property.Set.t ; path : Stmt.Set.t ; effect : (stmt * WpPropId.effect_source) option ; } let repr = { axioms = None ; goal = GOAL.dummy ; tags = [] ; warn = [] ; deps = Property.Set.empty ; path = Stmt.Set.empty ; effect = None ; } let resolve vcq = GOAL.compute_proof vcq.goal == Lang.F.p_true let is_trivial vcq = GOAL.is_trivial vcq.goal let pp_effect fmt = function | None -> () | Some(s,e) -> let loc = fst (Stmt.loc s) in let line = loc.Filepath.pos_lnum in let desc = match e with | WpPropId.FromCode -> "Effect" | WpPropId.FromCall -> "Call Effect" | WpPropId.FromReturn -> "Call Result" in Format.fprintf fmt "%s at line %d@\n" desc line let pretty fmt pid vc results = begin Format.fprintf fmt "@{<bf>Goal@} %a:@\n" WpPropId.pretty pid ; pp_effect fmt vc.effect ; if vc.tags <> [] then begin Format.fprintf fmt "@[<hov 2>@{<bf>Tags@}:" ; List.iter (fun tg -> Format.fprintf fmt "@ %a" Splitter.pretty tg) vc.tags ; Format.fprintf fmt "@].@\n" ; end ; pp_warnings fmt vc.warn ; Pcond.pretty fmt (GOAL.compute_descr vc.goal) ; List.iter (fun (prover,result) -> if result.verdict <> NoResult then Format.fprintf fmt "Prover %a returns %a@\n" pp_prover prover pp_result result ) results ; end let cache_descr ~pid vc results = DISK.cache_descr (fun fmt -> pretty fmt pid vc results) end (* ------------------------------------------------------------------------ *) (* --- Proof Obligations Database --- *) (* ------------------------------------------------------------------------ *) type formula = | GoalLemma of VC_Lemma.t | GoalAnnot of VC_Annot.t type po = t and t = { po_gid : string ; (* goal identifier *) po_leg : string ; (* legacy goal identifier *) po_sid : string ; (* goal short identifier (without model) *) po_name : string ; (* goal informal name *) po_idx : index ; (* goal index *) po_model : WpContext.model ; po_pid : WpPropId.prop_id ; (* goal target property *) po_formula : formula ; (* proof obligation *) } let get_index w = w.po_idx let get_label w = WpPropId.label_of_prop_id w.po_pid let get_model x = x.po_model let get_scope w = match w.po_idx with | Axiomatic _ -> WpContext.Global | Function(kf,_) -> WpContext.Kf kf let get_context w = w.po_model , get_scope w let get_depend = function | { po_formula = GoalAnnot { VC_Annot.deps = ips } } -> Property.Set.elements ips | { po_formula = GoalLemma { VC_Lemma.depends = ips } } -> List.map LogicUsage.ip_lemma ips let get_file_logout w prover = DISK.file_logout ~pid:w.po_pid ~model:(get_model w) ~prover let get_file_logerr w prover = DISK.file_logerr ~pid:w.po_pid ~model:(get_model w) ~prover module Index = struct type t = index let cmpopt a b = match a,b with | Some a,Some b -> String.compare a b | None,Some _ -> (-1) | Some _,None -> 1 | None,None -> 0 let compare a b = match a,b with | Axiomatic a , Axiomatic b -> cmpopt a b | Axiomatic _ , Function _ -> (-1) | Function _ , Axiomatic _ -> 1 | Function(f,a) , Function(g,b) -> let c = if Kernel_function.equal f g then 0 else String.compare (Kernel_function.get_name f) (Kernel_function.get_name g) in if c=0 then cmpopt a b else c end module S = Datatype.Make_with_collections (struct type t = po include Datatype.Undefined let hash a = FCHashtbl.hash a.po_gid let equal a b = (a.po_gid = b.po_gid) let compare a b = let c = Index.compare a.po_idx b.po_idx in if c<>0 then c else let c = WpPropId.compare_prop_id a.po_pid b.po_pid in if c<>0 then c else let ma = get_model a |> WpContext.MODEL.descr in let mb = get_model b |> WpContext.MODEL.descr in let c = String.compare ma mb in if c<>0 then c else String.compare a.po_gid b.po_gid let pretty fmt wpo = Format.pp_print_string fmt wpo.po_name let name = "Wpo.po" let reprs = [{ po_idx = Function(List.hd Kernel_function.reprs,Some "default") ; po_pid = List.hd WpPropId.PropId.reprs; po_sid = ""; po_gid = ""; po_leg = ""; po_model = WpContext.MODEL.repr ; po_name = "dummy"; po_formula = GoalAnnot VC_Annot.repr ; }] end) (* to get a "reasonable" API doc: *) let () = Type.set_ml_name S.ty (Some "Wpo.po") module WpoType = S module ProverType = Datatype.Make (struct type t = prover include Datatype.Undefined let name = "Wpo.prover" let reprs = [ NativeAltErgo; NativeCoq; Qed ] end) (* to get a "reasonable" API doc: *) let () = Type.set_ml_name ProverType.ty (Some "Wpo.prover") module ResultType = Datatype.Make (struct type t = result include Datatype.Undefined let name = "Wpo.result" let reprs = List.map VCS.result [ Valid ; Invalid ; Unknown ; Timeout ; Failed ] end) (* to get a "reasonable" API doc *) let () = Type.set_ml_name ResultType.ty (Some "Wpo.result") (* -------------------------------------------------------------------------- *) (* --- Getters --- *) (* -------------------------------------------------------------------------- *) let get_gid = Dynamic.register ~plugin:"Wp" "Wpo.get_gid" ~journalize:false (Datatype.func WpoType.ty Datatype.string) (fun g -> g.po_gid) let get_property = Dynamic.register ~plugin:"Wp" "Wpo.get_property" ~journalize:false (Datatype.func WpoType.ty Property.ty) (fun g -> WpPropId.property_of_id g.po_pid) let qed_time wpo = match wpo.po_formula with | GoalLemma _ -> 0.0 | GoalAnnot { VC_Annot.goal = g } -> GOAL.qed_time g (* -------------------------------------------------------------------------- *) (* --- Proof Collector --- *) (* -------------------------------------------------------------------------- *) let is_tactic t = WpPropId.is_tactic t.po_pid module Hproof = Hashtbl.Make(Datatype.Pair(Datatype.String)(Property)) (* Table indexed by ( Model name , Property proved ) *) module Results = struct type t = { mutable dps : result Pmap.t ; } let not_computing _ r = match r.verdict with VCS.Computing _ -> false | _ -> true let create () = { dps = Pmap.empty } let get w p = Pmap.find p w.dps let clear w = w.dps <- Pmap.empty let replace w p r = begin if p = Qed then begin w.dps <- Pmap.filter not_computing w.dps ; end ; w.dps <- Pmap.add p r w.dps end let list w = Pmap.fold (fun p r w -> if is_verdict r then (p,r)::w else w ) w.dps [] end (* -------------------------------------------------------------------------- *) (* --- Wpo Database --- *) (* -------------------------------------------------------------------------- *) module WPOset = WpoType.Set module WPOmap = WpoType.Map module Gmap = FCMap.Make(Index) module Fmap = Kernel_function.Map module Pmap = Property.Map let index_wpo iadd iget k w m = let set = try iget k m with Not_found -> WPOset.empty in iadd k (WPOset.add w set) m let unindex_wpo iadd iget k w m = try let set = iget k m in iadd k (WPOset.remove w set) m with Not_found -> m type system = { mutable wpo_idx : WPOset.t Gmap.t ; (* index -> WPOs *) mutable wpo_kf : WPOset.t Fmap.t ; (* kf -> WPOs *) mutable wpo_ip : WPOset.t Pmap.t ; (* ip -> WPOs *) mutable age : int WPOmap.t ; (* wpo -> age *) mutable results : Results.t WPOmap.t ; (* results collector *) proofs : WpAnnot.proof Hproof.t ; (* proof collector *) } let create_system () = { wpo_idx = Gmap.empty ; wpo_kf = Fmap.empty ; wpo_ip = Pmap.empty ; results = WPOmap.empty ; age = WPOmap.empty ; proofs = Hproof.create 131 ; } let clear_system system = begin system.wpo_idx <- Gmap.empty ; system.wpo_kf <- Fmap.empty ; system.wpo_ip <- Pmap.empty ; system.results <- WPOmap.empty ; system.age <- WPOmap.empty ; Hproof.clear system.proofs ; end module SYSTEM = State_builder.Ref (Datatype.Make (struct include Datatype.Undefined type t = system let name = "Wpo.SYSTEM.Datatype" let reprs = [ create_system () ] let mem_project = Datatype.never_any_project end)) (struct let name = "Wpo.SYSTEM.System" let dependencies = [ Ast.self ] let default = create_system end) let clear () = clear_system (SYSTEM.get ()) (* ------------------------------------------------------------------------ *) (* --- WPO Construction --- *) (* ------------------------------------------------------------------------ *) (* A WPO is uniquely determined by : 1. The model name (unique per updater by construction) 2. The kernel-function 3. The behavior 4. The target prop-id *) (* -------------------------------------------------------------------------- *) (* --- Registry of POs --- *) (* -------------------------------------------------------------------------- *) let added = ref 0 let age g = let system = SYSTEM.get () in try WPOmap.find g system.age with Not_found -> 0 let current_age = ref (-1) let proof g ip = ( get_context g |> WpContext.S.id , ip ) let add g = let system = SYSTEM.get () in begin let ip = WpPropId.property_of_id g.po_pid in Hproof.remove system.proofs (proof g ip) ; let age = incr current_age; !current_age in system.age <- WPOmap.add g age system.age ; system.results <- WPOmap.remove g system.results ; system.wpo_idx <- index_wpo Gmap.add Gmap.find g.po_idx g system.wpo_idx ; system.wpo_ip <- index_wpo Pmap.add Pmap.find ip g system.wpo_ip ; begin match g.po_idx with | Function(kf,_) -> system.wpo_kf <- index_wpo Fmap.add Fmap.find kf g system.wpo_kf | _ -> () end ; incr added ; if !added >= 100 then begin added := 0 ; Gmap.iter (fun _ ws -> WPOset.iter (fun _ -> incr added) ws) system.wpo_idx ; if not (Wp_parameters.has_dkey VCS.dkey_no_goals_info) then Wp_parameters.feedback ~ontty:`Feedback "Computing [%d goals...]" !added ; added := 0 ; end ; end let remove_hook = ref [] let on_remove f = remove_hook := !remove_hook @ [f] let remove g = let system = SYSTEM.get () in begin List.iter (fun f -> f g) !remove_hook ; let ip = WpPropId.property_of_id g.po_pid in system.wpo_idx <- unindex_wpo Gmap.add Gmap.find g.po_idx g system.wpo_idx ; system.wpo_ip <- unindex_wpo Pmap.add Pmap.find ip g system.wpo_ip ; begin match g.po_idx with | Function(kf,_) -> system.wpo_kf <- unindex_wpo Fmap.add Fmap.find kf g system.wpo_kf | Axiomatic _ -> () end ; system.results <- WPOmap.remove g system.results ; Hproof.remove system.proofs (proof g ip) ; end let warnings = function | { po_formula = GoalAnnot vcq } -> vcq.VC_Annot.warn | { po_formula = GoalLemma _ } -> [] let get_time = function { prover_time=t } -> t let get_steps= function { prover_steps=n } -> n let get_proof g = let system = SYSTEM.get () in let target = WpPropId.property_of_id g.po_pid in let status = try let proof = Hproof.find system.proofs (proof g target) in WpAnnot.is_proved proof with Not_found -> false in status , target let update_property_status g r = let system = SYSTEM.get () in try let pi = proof g (WpPropId.property_of_id g.po_pid) in let proof = try Hproof.find system.proofs pi with Not_found -> let proof = WpAnnot.create_proof g.po_pid in Hproof.add system.proofs pi proof ; proof in if is_valid r then WpAnnot.add_proof proof g.po_pid (get_depend g) ; let status = if WpAnnot.is_proved proof then Property_status.True else Property_status.Dont_know in let target = WpAnnot.target proof in let depends = WpAnnot.dependencies proof in let emitter = WpContext.get_emitter g.po_model in Property_status.emit emitter ~hyps:depends target status ; with err -> Wp_parameters.failure "Update-status failed (%s)" (Printexc.to_string err) ; raise err let clear_results g = let system = SYSTEM.get () in try let rs = WPOmap.find g system.results in Results.clear rs ; with Not_found -> () let set_result g p r = let system = SYSTEM.get () in begin let rs = try WPOmap.find g system.results with Not_found -> let rs = Results.create () in system.results <- WPOmap.add g rs system.results ; rs in Results.replace rs p r ; if not (WpPropId.is_check g.po_pid) && not (WpPropId.is_tactic g.po_pid) then update_property_status g r ; end let has_verdict g p = let system = SYSTEM.get () in try VCS.is_verdict (Results.get (WPOmap.find g system.results) p) with Not_found -> false let get_result g p : VCS.result = let system = SYSTEM.get () in try Results.get (WPOmap.find g system.results) p with Not_found -> VCS.no_result let get_results g = let system = SYSTEM.get () in try Results.list (WPOmap.find g system.results) with Not_found -> [] let is_trivial g = match g.po_formula with | GoalLemma vc -> VC_Lemma.is_trivial vc | GoalAnnot vc -> VC_Annot.is_trivial vc let reduce g = match g.po_formula with | GoalLemma vc -> WpContext.on_context (get_context g) VC_Lemma.is_trivial vc | GoalAnnot vc -> WpContext.on_context (get_context g) VC_Annot.resolve vc let resolve g = let valid = reduce g in if valid then ( let solver = qed_time g in set_result g VCS.Qed (VCS.result ~solver VCS.Valid) ) ; valid let compute g = let ctxt = get_context g in match g.po_formula with | GoalAnnot { VC_Annot.axioms ; VC_Annot.goal = goal } -> axioms , WpContext.on_context ctxt GOAL.compute_descr goal | GoalLemma ({ VC_Lemma.depends = depends ; VC_Lemma.lemma = lemma } as w) -> let open Definitions in Some( lemma.l_cluster , depends ) , WpContext.on_context ctxt VC_Lemma.sequent w let is_proved g = is_trivial g || List.exists (fun (_,r) -> VCS.is_valid r) (get_results g) let is_unknown g = List.exists (fun (_,r) -> VCS.is_verdict r && not (VCS.is_valid r)) ( get_results g ) let get_result = Dynamic.register ~plugin:"Wp" "Wpo.get_result" ~journalize:false (Datatype.func2 WpoType.ty ProverType.ty ResultType.ty) get_result let is_valid = Dynamic.register ~plugin:"Wp" "Wpo.is_valid" ~journalize:false (Datatype.func ResultType.ty Datatype.bool) VCS.is_valid (* -------------------------------------------------------------------------- *) (* --- Proof Obligations : Pretty-printing --- *) (* -------------------------------------------------------------------------- *) let pp_title fmt w = Format.pp_print_string fmt w.po_name let pp_goal_model fmt w = begin match w.po_formula with | GoalAnnot vcq -> VC_Annot.pretty fmt w.po_pid vcq (get_results w) | GoalLemma vca -> VC_Lemma.pretty fmt vca (get_results w) end let pp_goal fmt w = WpContext.on_context (get_context w) (pp_goal_model fmt) w let pp_goal_flow fmt g = begin if not !flow then Format.pp_print_newline fmt () ; pp_goal fmt g ; Format.fprintf fmt "@\n%s@." bar ; flow := false ; end (* -------------------------------------------------------------------------- *) (* --- Iterator --- *) (* -------------------------------------------------------------------------- *) type part = | Pnone | Paxiomatic of string option | Pbehavior of kernel_function * string option let iter ?ip ?index ?on_axiomatics ?on_behavior ?on_goal () = let system = SYSTEM.get () in let current = ref Pnone in let apply_lemma a = match on_axiomatics with None -> () | Some phi -> phi a in let apply_behavior f bhv = match on_behavior with None -> () | Some phi -> phi f bhv in let on_part idx = match !current , idx with | Paxiomatic a , Axiomatic b when a=b -> () | _ , Axiomatic b -> apply_lemma b ; current := Paxiomatic b | Pbehavior(f,None) , Function(g,None) when Kernel_function.equal f g -> () | Pbehavior(f,Some a) , Function(g,Some b) when Kernel_function.equal f g && a=b -> () | _ , Function(g,bhv) -> apply_behavior g bhv ; current := Pbehavior(g,bhv) in let on_goals poset = if not (WPOset.is_empty poset) then begin match on_goal with | None -> () | Some phi -> WPOset.iter phi poset end in match index,ip with | None,None -> Gmap.iter (fun idx ws -> on_part idx ; on_goals ws) system.wpo_idx | _,Some ip -> begin match on_goal with | None -> () | Some phi -> let poset = try Pmap.find ip system.wpo_ip with Not_found -> WPOset.empty in WPOset.iter phi poset end | Some (Function(kf,None)),None -> begin try on_goals (Fmap.find kf system.wpo_kf) with Not_found -> () end | Some idx,None -> begin try on_goals (Gmap.find idx system.wpo_idx) with Not_found -> () end let iter_on_goals = Dynamic.register ~plugin:"Wp" "Wpo.iter_on_goals" (Datatype.func (Datatype.func WpoType.ty Datatype.unit) Datatype.unit) ~journalize:true (fun on_goal -> iter ~on_goal ()) let goals_of_property prop = let system = SYSTEM.get () in let poset = try Pmap.find prop system.wpo_ip with Not_found -> WPOset.empty in WPOset.elements poset let goals_of_property = Dynamic.register ~plugin:"Wp" "Wpo.goals_of_property" (Datatype.func Property.ty (Datatype.list WpoType.ty)) ~journalize:false goals_of_property let prover_of_name = Dynamic.register ~plugin:"Wp" "Wpo.prover_of_name" ~journalize:false (Datatype.func Datatype.string (Datatype.option ProverType.ty)) VCS.prover_of_name (* -------------------------------------------------------------------------- *) (* --- Prover and Files --- *) (* -------------------------------------------------------------------------- *) let get_model w = w.po_model let get_logfile w prover result = let model = get_model w in DISK.cache_log ~pid:w.po_pid ~model ~prover ~result let _ignore = Dynamic.register ~plugin:"Wp" "Wpo.file_for_log_proof" ~journalize:false (Datatype.func2 WpoType.ty ProverType.ty (Datatype.pair Datatype.string Datatype.string)) (fun w p -> (DISK.file_logout w.po_pid (get_model w) p, DISK.file_logerr w.po_pid (get_model w) p)) let pp_logfile fmt w prover = let model = get_model w in let result = get_result w prover in DISK.pretty ~pid:w.po_pid ~model ~prover ~result fmt let is_computing = function VCS.Computing _ -> true | _ -> false let get_files w = let results = get_results w in let descr_files = match w.po_formula with | GoalAnnot vcq -> [ "Goal" , VC_Annot.cache_descr ~pid:w.po_pid vcq results ] | GoalLemma vca -> [ "Lemma" , VC_Lemma.cache_descr vca results ] in let result_files = List.fold_right (fun (prover,result) files -> if prover <> VCS.Qed && not (is_computing result.verdict) then let filename = get_logfile w prover result in if filename <> "" && Sys.file_exists filename then let title = title_of_prover prover in (title,filename) :: files else files else files ) results [] in descr_files @ result_files ����������������������frama-c-20.0-Calcium/src/plugins/wp/wpo.mli���������������������������������������������������������0000666�0000000�0000000�00000016201�13571573400�015421� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) open LogicUsage open VCS open Cil_types open Cil_datatype open WpPropId type index = | Axiomatic of string option | Function of kernel_function * string option (* ------------------------------------------------------------------------ *) (**{1 Proof Obligations} *) (* ------------------------------------------------------------------------ *) module DISK : sig val cache_log : pid:prop_id -> model:WpContext.model -> prover:prover -> result:result -> string val pretty : pid:prop_id -> model:WpContext.model -> prover:prover -> result:result -> Format.formatter -> unit val file_kf : kf:kernel_function -> model:WpContext.model -> prover:prover -> string val file_goal : pid:prop_id -> model:WpContext.model -> prover:prover -> string val file_logout : pid:prop_id -> model:WpContext.model -> prover:prover -> string val file_logerr : pid:prop_id -> model:WpContext.model -> prover:prover -> string end module GOAL : sig type t open Lang val dummy : t val trivial : t val is_trivial : t -> bool val make : Conditions.sequent -> t val compute_proof : t -> F.pred val compute_descr : t -> Conditions.sequent val get_descr : t -> Conditions.sequent val compute : t -> unit val qed_time : t -> float end module VC_Lemma : sig type t = { lemma : Definitions.dlemma ; depends : logic_lemma list ; mutable sequent : Conditions.sequent option ; } val is_trivial : t -> bool val cache_descr : t -> (prover * result) list -> string end module VC_Annot : sig type t = { axioms : Definitions.axioms option ; goal : GOAL.t ; tags : Splitter.tag list ; warn : Warning.t list ; deps : Property.Set.t ; path : Stmt.Set.t ; effect : (stmt * effect_source) option ; } val resolve : t -> bool val is_trivial : t -> bool val cache_descr : pid:prop_id -> t -> (prover * result) list -> string end (* ------------------------------------------------------------------------ *) (**{1 Proof Obligations} *) (* ------------------------------------------------------------------------ *) type formula = | GoalLemma of VC_Lemma.t | GoalAnnot of VC_Annot.t type po = t and t = { po_gid : string ; (** goal identifier *) po_leg : string ; (** legacy goal identifier *) po_sid : string ; (** goal short identifier (without model) *) po_name : string ; (** goal informal name *) po_idx : index ; (** goal index *) po_model : WpContext.model ; po_pid : WpPropId.prop_id ; (* goal target property *) po_formula : formula ; (* proof obligation *) } module S : Datatype.S_with_collections with type t = po module Index : Map.OrderedType with type t = index module Gmap : FCMap.S with type key = index (** Dynamically exported @since Nitrogen-20111001 *) val get_gid: t -> string (** Dynamically exported @since Oxygen-20120901 *) val get_property: t -> Property.t val get_index : t -> index val get_label : t -> string val get_model : t -> WpContext.model val get_scope : t -> WpContext.scope val get_context : t -> WpContext.context val get_file_logout : t -> prover -> string (** only filename, might not exists *) val get_file_logerr : t -> prover -> string (** only filename, might not exists *) val get_files : t -> (string * string) list val qed_time : t -> float val clear : unit -> unit val remove : t -> unit val on_remove : (t -> unit) -> unit val add : t -> unit val age : t -> int (* generation *) val reduce : t -> bool (** tries simplification *) val resolve : t -> bool (** tries simplification and set result if valid *) val set_result : t -> prover -> result -> unit val clear_results : t -> unit val compute : t -> Definitions.axioms option * Conditions.sequent val has_verdict : t -> prover -> bool val get_result : t -> prover -> result val get_results : t -> (prover * result) list val get_proof : t -> bool * Property.t val is_trivial : t -> bool (** do not tries simplification, do not check prover results *) val is_proved : t -> bool (** do not tries simplification, check prover results *) val is_unknown : t -> bool val warnings : t -> Warning.t list (** [true] if the result is valid. Dynamically exported. @since Nitrogen-20111001 *) val is_valid: result -> bool val get_time: result -> float val get_steps: result -> int val is_tactic : t -> bool val iter : ?ip:Property.t -> ?index:index -> ?on_axiomatics:(string option -> unit) -> ?on_behavior:(kernel_function -> string option -> unit) -> ?on_goal:(t -> unit) -> unit -> unit (** Dynamically exported. @since Nitrogen-20111001 *) val iter_on_goals: (t -> unit) -> unit (** All POs related to a given property. Dynamically exported @since Oxygen-20120901 *) val goals_of_property: Property.t -> t list val bar : string val kf_context : index -> Description.kf val pp_index : Format.formatter -> index -> unit val pp_warnings : Format.formatter -> Warning.t list -> unit val pp_depend : Format.formatter -> Property.t -> unit val pp_dependency : Description.kf -> Format.formatter -> Property.t -> unit val pp_dependencies : Description.kf -> Format.formatter -> Property.t list -> unit val pp_goal : Format.formatter -> t -> unit val pp_title : Format.formatter -> t -> unit val pp_logfile : Format.formatter -> t -> prover -> unit val pp_axiomatics : Format.formatter -> string option -> unit val pp_function : Format.formatter -> Kernel_function.t -> string option -> unit val pp_goal_flow : Format.formatter -> t -> unit (** Dynamically exported. *) val prover_of_name : string -> prover option �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wprop.ml��������������������������������������������������������0000666�0000000�0000000�00000007724�13571573400�015624� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* -------------------------------------------------------------------------- *) (* --- Indexed Interface --- *) (* -------------------------------------------------------------------------- *) type property = | Later of Property.t | Proxy of Property.t * Emitter.t * Property.t list module type Info = sig include State_builder.Info_with_size type key val property : key -> property end module type Indexed = sig type key val mem : key -> bool val property : key -> Property.t val add_hook : (key -> Property.t -> unit) -> unit end module type Indexed2 = sig type key1 type key2 val mem : key1 -> key2 -> bool val property : key1 -> key2 -> Property.t val add_hook : (key1 -> key2 -> Property.t -> unit) -> unit end (* -------------------------------------------------------------------------- *) (* --- Index-1 Implementation --- *) (* -------------------------------------------------------------------------- *) module Indexed (Key:Datatype.S_with_collections) (Info:Info with type key = Key.t) = struct type key = Key.t module H = State_builder.Hashtbl(Key.Hashtbl)(Property)(Info) let hooks = ref [] let add_hook f = hooks := !hooks @ [f] let mem = H.mem let property (key:key) = try H.find key with Not_found -> let ip = match Info.property key with | Later ip -> ip | Proxy(ip,emitter,ips) -> Property_status.logical_consequence emitter ip ips ; ip in List.iter (fun f -> f key ip) !hooks ; H.add key ip ; ip end (* -------------------------------------------------------------------------- *) (* --- Index-2 Wrapper --- *) (* -------------------------------------------------------------------------- *) module Indexed2 (Key1:Datatype.S_with_collections) (Key2:Datatype.S_with_collections) (Info:Info with type key = Key1.t * Key2.t) = struct module P = Datatype.Pair_with_collections(Key1)(Key2) (struct let module_name = Info.name end) module I = Indexed(P)(Info) type key1 = Key1.t type key2 = Key2.t let mem a b = I.mem (a,b) let property a b = I.property (a,b) let add_hook f = I.add_hook (fun (a,b) -> f a b) end (* -------------------------------------------------------------------------- *) ��������������������������������������������frama-c-20.0-Calcium/src/plugins/wp/wprop.mli�������������������������������������������������������0000666�0000000�0000000�00000005627�13571573400�015775� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(**************************************************************************) (* *) (* This file is part of WP plug-in of Frama-C. *) (* *) (* Copyright (C) 2007-2019 *) (* CEA (Commissariat a l'energie atomique et aux energies *) (* alternatives) *) (* *) (* you can redistribute it and/or modify it under the terms of the GNU *) (* Lesser General Public License as published by the Free Software *) (* Foundation, version 2.1. *) (* *) (* It is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) (* GNU Lesser General Public License for more details. *) (* *) (* See the GNU Lesser General Public License version 2.1 *) (* for more details (enclosed in the file licenses/LGPLv2.1). *) (* *) (**************************************************************************) (* ------------------------------------------------------------------------ *) (**{2 Indexed API} *) (* ------------------------------------------------------------------------ *) type property = | Later of Property.t | Proxy of Property.t * Emitter.t * Property.t list module type Info = sig include State_builder.Info_with_size type key val property : key -> property end module type Indexed = sig type key val mem : key -> bool val property : key -> Property.t val add_hook : (key -> Property.t -> unit) -> unit (** Hooks are executed once at property creation *) end module type Indexed2 = sig type key1 type key2 val mem : key1 -> key2 -> bool val property : key1 -> key2 -> Property.t val add_hook : (key1 -> key2 -> Property.t -> unit) -> unit (** Hooks are executed once at property creation *) end (* ------------------------------------------------------------------------ *) (**{2 Indexes} *) (* ------------------------------------------------------------------------ *) module Indexed (Key:Datatype.S_with_collections) (Info:Info with type key = Key.t) : Indexed with type key = Key.t module Indexed2 (Key1:Datatype.S_with_collections) (Key2:Datatype.S_with_collections) (Info:Info with type key = Key1.t * Key2.t) : Indexed2 with type key1 = Key1.t and type key2 = Key2.t ���������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/�������������������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�012355� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/bugs/��������������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�013315� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/bugs/check_specs.h�������������������������������������������������������0000666�0000000�0000000�00000001200�13571573400�015731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// for SSIZE_MAX //#include <limits.h> #undef putchar /* assigns \nothing; */ int putchar(int c); #ifdef NO_FRAMA_C /*@ assigns \nothing; */ void perror(const char *s); #else #define perror(s) #endif /* To avoid issue with errno with is defined as "int *__errno_location (void);" in system includes, we define our own errno. */ #undef errno #define errno global_error_number int global_error_number; /*@ requires \valid(s); assigns \nothing; */ int puts(const char *s); #ifdef NO_FRAMA_C /*@ assigns \nothing; */ int fputs(const char *s, FILE *stream); #else #define fputs(...) #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/bugs/enum.c��������������������������������������������������������������0000666�0000000�0000000�00000000136�13571573400�014425� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������enum fixed_addresses { A, B = -1UL, BASE, END = BASE, }; enum e f(void) { return A; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/����������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014206� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/.gitignore������������������������������������������������������0000666�0000000�0000000�00000000011�13571573400�016166� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/oracle_*�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/Longinit_sequencer.i��������������������������������������������0000666�0000000�0000000�00000000236�13571573400�020216� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -res-file @PTEST_RESULT@ */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/Longinit_sequencer.ml�������������������������������������������0000666�0000000�0000000�00000004762�13571573400�020406� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* Small script to test long_init*.c files, which require one test to run before the other. *) open Kernel include Plugin.Register (struct let name = "long init testing module" let shortname = "test-long-init" let help = "utility script for tests" end) module Res = String(struct let option_name = "-res-file" let help = "" let arg_name = "file" let default = "result" end) let ok = ref false let tmpfile () = Res.get () ^ "/Longinit_sequencer.sav" let () = at_exit (fun () -> let tmpfile = tmpfile () in if Debug.get () >= 1 || not !ok then result "Keeping temp file %s" tmpfile else try Sys.remove tmpfile with Sys_error _ -> ()) let main () = let tmpfile = tmpfile () in let fmt = Format.std_formatter in let display_results state = Format.fprintf fmt "@[%a@]@\n" !Db.Value.display state in Dynamic.Parameter.String.set "" "tests/builtins/long_init.c"; Dynamic.Parameter.String.set "-eva-save-fun-state" ("init_inner:" ^ tmpfile); Dynamic.Parameter.String.set "-eva-builtin" "malloc:Frama_C_malloc_fresh"; Dynamic.Parameter.Bool.set "-eva-alloc-returns-null" false; Dynamic.Parameter.String.set "-eva-warn-key" "builtins:override=inactive"; !Db.Value.compute (); Callgraph.Uses.iter_in_rev_order display_results; Files.clear (); Dynamic.Parameter.String.set "" "tests/builtins/long_init2.c"; (* clear and set parameters to the same value to recompute kernel function IDs *) Dynamic.Parameter.String.clear "-eva-save-fun-state" (); Dynamic.Parameter.String.set "-eva-save-fun-state" ("init_outer:" ^ tmpfile); Dynamic.Parameter.String.set "-eva-load-fun-state" ("init_inner:" ^ tmpfile); (* set builtins in a different order to force kernel to recompute kernel function IDs *) Dynamic.Parameter.String.set "-eva-builtin" "malloc:Frama_C_malloc_fresh"; !Db.Value.compute (); Callgraph.Uses.iter_in_rev_order display_results; Files.clear (); Dynamic.Parameter.String.set "" "tests/builtins/long_init3.c"; Dynamic.Parameter.String.clear "-eva-save-fun-state" (); Dynamic.Parameter.String.clear "-eva-load-fun-state" (); Dynamic.Parameter.String.set "-eva-load-fun-state" ("init_outer:" ^ tmpfile); (* set builtins in a different order to force kernel to recompute kernel function IDs *) Dynamic.Parameter.String.set "-eva-builtin" "malloc:Frama_C_malloc_fresh"; !Db.Value.compute (); Callgraph.Uses.iter_in_rev_order display_results; ok:=true (* no error, we can erase the file *) let () = Db.Main.extend main ��������������frama-c-20.0-Calcium/tests/builtins/alloc-vla.c�����������������������������������������������������0000666�0000000�0000000�00000000276�13571573400�016231� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <stdlib.h> volatile int nondet; int *f(int i) { int a[i]; if (nondet) free(a); // must fail return a; // will become dangling } void main() { int *t = f(4); free(t); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/alloc.c���������������������������������������������������������0000666�0000000�0000000�00000002164�13571573400�015447� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* GCC: STDOPT: #"-eva-no-builtins-auto" STDOPT: #"-eva-no-builtins-auto -absolute-valid-range 0x100-0x200 -main main_abs" */ #define malloc(n) Frama_C_malloc_fresh(n) #include "share/libc/stdlib.c" int *p,*q,*r,a,b; char *t,*u,*v; char ch = 44; void main(unsigned int c, int d, int e) { p = malloc(4); t = malloc (10); if (!c++) p[-1] = 0; if (!c++) p[1] = 0; if (!c++) t[-1] = 0; if (!c++) t[10] = 0; t[0] = t[9] = 'o'; *p = 'k'; q = malloc(4);*q=0; r = - (int) q; if (!c++) *r = *(r+1); // Invalid No value for r makes r and r+1 valid (*q)++; a = *q; /* it is incorrect to find 1 here */ u = malloc(!d); v = malloc(1 + !d); *u = ch; *u=33; if (e & 1) u[1] = ch; if (e & 2) u[1] = 34; *v = ch; *v=35; v[1] = ch; v[1]=36; if (e & 4) v[2] = ch; if (e & 8) v[2] = 37; } void main_abs(int c) { q = malloc(4);*q=0; r = - (int) q; *(int*)0x104=0; *r = (int) r; (*q)++; a = *q; /* it is incorrect to find 1 here */ } void bug(int c) { int a; p = &a; if (!c++) p[-1] = 0; if (!c++) p[-1] = 0; if (!c++) p[-1] = 0; if (!c++) p[-1] = 0; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/alloc_weak.c����������������������������������������������������0000666�0000000�0000000�00000003007�13571573400�016453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: +"-eva-no-alloc-returns-null" */ #include <stdlib.h> #include <string.h> volatile v; static void copy(void *dst_, void *src_, size_t off, size_t len) { char *dst = dst_; char *src = src_; memcpy(dst + off, src + off, len); } // Bug reported by Trust-in-Soft int main1(void) { int *t[2]; /*@ slevel 2; */ for (int i = 0; i < 2; i++) t[i] = malloc(0x80); int *p; size_t n = sizeof(void *); copy(&p, &t[1], 0, 1); copy(&p, &t[0], 1, n - 1); *p = 42; /* p should not be a valid pointer */ int r = *p; return r; } void main2() { // Test performance of iterating on strong malloced variables int t[1000]; int i = malloc(sizeof(int)); //@ slevel 10000; for (i = 0; i < 800; i++) { t[i] = i; } } /* Tests pointer subtraction and comparison on weak bases. */ void main3() { int *p, *q, *r; /* For the test to be meaningful, q and r must point to the same weak base at the end of the loop. */ for (int i = 0; i < 10; i++) { p = malloc(4); if (i % 2) q = p; else r = p; } /* At the end of the loop, q and r point on distinct allocated memory, so: - the subtraction must lead to a differing_blocks alarm; - the relational comparison must lead to a pointer_comparable alarm; - the equality must not be true (this also tests the backward propagators for the comparison). */ int d = q - r; int cmp = q < r; int eq; if (q == r) eq = 1; else eq = 0; } void main() { main1(); main2(); main3(); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/allocated.c�����������������������������������������������������0000666�0000000�0000000�00000006463�13571573400�016313� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: +"-slevel 1 -eva-mlevel 0" STDOPT: +"-slevel 999 -eva-builtin malloc:Frama_C_malloc_fresh,__fc_vla_alloc:Frama_C_malloc_fresh,__fc_vla_free:Frama_C_vla_free" */ #define assert_bottom(exp) if (nondet) {exp; Frama_C_show_each_unreachable();} #ifndef __FRAMAC__ #include <stdio.h> #define Frama_C_show_each_unreachable(...) #define Frama_C_show_each_p(...) #define Frama_C_show_each_p0(...) #define Frama_C_show_each_p_after_free(...) #define Frama_C_show_each_p1(...) #define Frama_C_show_each_p2(...) #define Frama_C_show_each_pj(e) printf("pj = %d\n", e); #endif #include <stdlib.h> volatile int nondet; int main() { int i, j; int *p; // constant size p = malloc(4); //@ assert \block_length(p) == 4; *p = 17; *p = 18; assert_bottom(p[1]); assert_bottom(p[2]); Frama_C_show_each_p(p); Frama_C_show_each_p0(p[0]); // after a weak update, p[0] IN {17, 18, UNINIT} free(p); Frama_C_show_each_p_after_free(p); // non-constant size, but constant int k = nondet ? 8 : 8; p = malloc(k); //@ assert \block_length(p) == 8; p[0] = 13; p[1] = 42; p[1] = 54; Frama_C_show_each_p(p); Frama_C_show_each_p0(p[0]); Frama_C_show_each_p1(p[1]); if (nondet) free(p); p[0] = 41; // must emit danglingness alarm free(p); // should emit double-free alarm assert_bottom(p[0] = 43); // strong free should result in bottom here // variable size k = nondet ? 8 : 12; p = malloc(k); //@ assert \block_length(p) >= 8 && \block_length(p) <= 12; p[0] = 13; p[1] = 42; p[2] = 77; // must emit alarm Frama_C_show_each_p(p); Frama_C_show_each_p0(p[0]); Frama_C_show_each_p1(p[1]); Frama_C_show_each_p2(p[2]); free(p); // loop with constant size, enough slevel => no alarms //@ slevel 1000; for (i = 0; i < 4; i++) { p = malloc(sizeof(int)); //@ assert \block_length(p) == sizeof(int); *p = i; Frama_C_show_each_p(p); Frama_C_show_each_p0(p[0]); free(p); } //@ slevel default; // loop with constant size, not enough slevel => possible alarms for (i = 0; i < 4; i++) { p = malloc(sizeof(int)); *p = i; Frama_C_show_each_p(p); Frama_C_show_each_p0(p[0]); free(p); } // loop with variable size, possible leak for (i = 0; i < 4; i++) { p = malloc(sizeof(int) * i); /*@ assert \block_length(p) >= 0 && \block_length(p) <= sizeof(int) * 4; */ for (j = 0; j < i; j++) { if (nondet) p[j] = 7 * i + 3 * j; } if (nondet) free(p); // possible alarm about freeability } //@ slevel merge; p = malloc(0); //@ assert \block_length(p) == 0; free(p); unsigned int size = nondet; //@ assert Assume: size <= 100; p = malloc(size); Frama_C_show_each(p); *p = 0; struct bitf { char i1: 1; char i2: 1; char i3: 1; char i4: 1; char i5: 1; char i6: 1; char i7: 1; char i8: 1; }; struct bitf *pb = p; Frama_C_show_each(pb->i1); // Alarm free(p); //@ assert size >= 1; p = malloc(size); Frama_C_show_each(p); *p = 0; pb = p; Frama_C_show_each(pb->i1); // No alarm free(p); p = malloc(0); Frama_C_show_each(p); pb = p; if (nondet) { Frama_C_show_each(pb->i1); // Alarm } free (p); for (i = 0; i < 10; i++) { int a[i+1]; for (j = 0; j <=i; j++) { a[j] = j; } Frama_C_show_each(a[i]); } return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/assert_builtin.i������������������������������������������������0000666�0000000�0000000�00000000161�13571573400�017405� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int t[10]; void Frama_C_assert(int cond); int main(unsigned int c){ Frama_C_assert(c < 10); return t[c]; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/big_local_array.i�����������������������������������������������0000666�0000000�0000000�00000000762�13571573400�017476� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* EXECNOW: make -s @PTEST_DIR@/big_local_array_script.cmxs OPT: @EVA_OPTIONS@ -print -journal-disable -eva -report OPT: @EVA_OPTIONS@ -load-module @PTEST_DIR@/big_local_array_script -then-on prj -print -report OPT: @EVA_OPTIONS@ -print -journal-disable -no-initialized-padding-locals -eva */ struct S { int a[50]; int b[32]; }; int main () { struct S x[32] = { [0] = { .a = { 1,2,3 }, .b = { [5] = 5, 6, 7 }}, [3] = { 0,1,2,3,.b = { [17]=17 } } }; } ��������������frama-c-20.0-Calcium/tests/builtins/big_local_array_script.ml���������������������������������������0000666�0000000�0000000�00000000427�13571573400�021240� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������let foo () = if Project.get_name (Project.current ()) <> "prj" then begin let prj = Project.create "prj" in let () = Project.set_current prj in File.init_from_c_files [File.from_filename "tests/builtins/big_local_array.i"] end let () = Db.Main.extend foo �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/calloc.c��������������������������������������������������������0000666�0000000�0000000�00000002224�13571573400�015607� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #"-eva-no-builtins-auto -eva-alloc-returns-null" STDOPT: #"-eva-no-builtins-auto -eva-alloc-returns-null -eva-builtin calloc:Frama_C_calloc_fresh" STDOPT: #"-eva-no-builtins-auto -eva-alloc-returns-null -eva-builtin calloc:Frama_C_calloc_by_stack" STDOPT: #"-eva-no-builtins-auto -eva-no-alloc-returns-null -eva-builtin calloc:Frama_C_calloc_fresh" STDOPT: #"-eva-no-builtins-auto -eva-no-alloc-returns-null -eva-builtin calloc:Frama_C_calloc_by_stack" */ #include <stdlib.h> #include <stdint.h> volatile int nondet; int main() { char *p1 = calloc(0, 0); if (!p1) return 1; char *p2 = calloc(1, 0); if (!p2) return 1; char *p3 = calloc(0, 1); if (!p3) return 1; char *p4 = calloc(1, 1); if (!p4) return 1; if (nondet) { //@ assert \valid(p4); // fails when builtin not used //@ assert *p4 == 0; } int *p5 = calloc(1024, sizeof(int)); if (!p5) return 1; if (nondet) { //@ assert \valid(p5+(0..1023)); // fails when builtin not used //@ assert *p5 == 0; //@ assert p5[1023] == 0; } char *p9001 = calloc(SIZE_MAX - 1, 2); if (p9001) return 1; //@ assert p9001 == \null; return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/diff_apron������������������������������������������������������0000666�0000000�0000000�00000016056�13571573400�016250� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff tests/builtins/oracle/Longinit_sequencer.res.oracle tests/builtins/oracle_apron/Longinit_sequencer.res.oracle 62,65c62,81 < [eva] tests/builtins/long_init.c:29: Reusing old results for call to subanalyze < [eva] tests/builtins/long_init.c:29: Reusing old results for call to subanalyze < [eva] tests/builtins/long_init.c:29: Reusing old results for call to subanalyze < [eva] tests/builtins/long_init.c:29: Reusing old results for call to subanalyze --- > [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- > main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- > main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- > main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- > main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze 153,154c169,216 < [eva] tests/builtins/long_init.c:93: Reusing old results for call to analyze < [eva] tests/builtins/long_init.c:94: Reusing old results for call to analyze --- > [eva] computing for function analyze <- main. > Called from tests/builtins/long_init.c:93. > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] Recording results for analyze > [eva] Done for function analyze > [eva] computing for function analyze <- main. > Called from tests/builtins/long_init.c:94. > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] Recording results for analyze > [eva] Done for function analyze 327c389 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_apron/Longinit_sequencer.sav 421,424c483,498 < [eva] tests/builtins/long_init2.c:29: Reusing old results for call to subanalyze < [eva] tests/builtins/long_init2.c:29: Reusing old results for call to subanalyze < [eva] tests/builtins/long_init2.c:29: Reusing old results for call to subanalyze < [eva] tests/builtins/long_init2.c:29: Reusing old results for call to subanalyze --- > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init2.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init2.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init2.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init2.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze 568c642 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_apron/Longinit_sequencer.sav 658,661c732,747 < [eva] tests/builtins/long_init3.c:29: Reusing old results for call to subanalyze < [eva] tests/builtins/long_init3.c:29: Reusing old results for call to subanalyze < [eva] tests/builtins/long_init3.c:29: Reusing old results for call to subanalyze < [eva] tests/builtins/long_init3.c:29: Reusing old results for call to subanalyze --- > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init3.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init3.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init3.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze > [eva] computing for function subanalyze <- analyze <- main. > Called from tests/builtins/long_init3.c:29. > [eva] Recording results for subanalyze > [eva] Done for function subanalyze diff tests/builtins/oracle/allocated.0.res.oracle tests/builtins/oracle_apron/allocated.0.res.oracle 260a261,263 > [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_alloc > [eva:malloc] tests/builtins/allocated.c:127: > resizing variable `__malloc_main_l127' (0..31/319) to fit 0..63/319 273c276 < j ∈ [1..2147483647] --- > j ∈ [1..10] diff tests/builtins/oracle/memexec-malloc.res.oracle tests/builtins/oracle_apron/memexec-malloc.res.oracle 20c20,23 < [eva] tests/builtins/memexec-malloc.c:25: Reusing old results for call to f --- > [eva] computing for function f <- main. > Called from tests/builtins/memexec-malloc.c:25. > [eva] Recording results for f > [eva] Done for function f 24c27,30 < [eva] tests/builtins/memexec-malloc.c:29: Reusing old results for call to f --- > [eva] computing for function f <- main. > Called from tests/builtins/memexec-malloc.c:29. > [eva] Recording results for f > [eva] Done for function f ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/diff_bitwise����������������������������������������������������0000666�0000000�0000000�00000035323�13571573400�016575� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff tests/builtins/oracle/Longinit_sequencer.res.oracle tests/builtins/oracle_bitwise/Longinit_sequencer.res.oracle 327c327 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_bitwise/Longinit_sequencer.sav 568c568 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_bitwise/Longinit_sequencer.sav diff tests/builtins/oracle/allocated.0.res.oracle tests/builtins/oracle_bitwise/allocated.0.res.oracle 260a261,263 > [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_alloc > [eva:malloc] tests/builtins/allocated.c:127: > resizing variable `__malloc_main_l127' (0..31/319) to fit 0..63/319 diff tests/builtins/oracle/allocated.1.res.oracle tests/builtins/oracle_bitwise/allocated.1.res.oracle 191a192,194 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_7 208a212,214 > strong free on bases: {__malloc_main_l82_7} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 223a230,232 > strong free on bases: {__malloc_main_l82_7} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 238a248,250 > strong free on bases: {__malloc_main_l82_7} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 252,254c264,266 < [eva] tests/builtins/allocated.c:82: < Call to builtin Frama_C_malloc_fresh for function malloc < [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_7 --- > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_7} 323a336,356 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_31 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_32 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_33 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_34 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_35 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_36 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_37 329,330d361 < Trace partitioning superposing up to 300 states < [eva] tests/builtins/allocated.c:84: 333a365,385 > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 403c455,473 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 475c545,563 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 547c635,653 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 619c725,743 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 691c815,833 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 763c905,923 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 835c995,1013 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 905,907c1083,1084 < [eva] tests/builtins/allocated.c:87: Call to builtin free < [eva:malloc] tests/builtins/allocated.c:87: < strong free on bases: {__malloc_main_l82_7} --- > [eva] tests/builtins/allocated.c:81: > Trace partitioning superposing up to 500 states 1069,1071c1246,1247 < __malloc_main_l82_7[0] ∈ {21} or UNINITIALIZED < [1] ∈ {24} or UNINITIALIZED < [2] ∈ {27} or UNINITIALIZED --- > __malloc_main_l82_7[0] ∈ {14} or UNINITIALIZED > [1] ∈ {17} or UNINITIALIZED 1140a1317,1337 > __malloc_main_l82_31[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_32[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_33[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_34[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_35[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_36[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_37[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED 1184c1381 < __malloc_main_l82_7[0..2] FROM __fc_heap_status; nondet (and SELF) --- > __malloc_main_l82_7[0..1] FROM __fc_heap_status; nondet (and SELF) 1207a1405,1411 > __malloc_main_l82_31[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_32[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_33[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_34[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_35[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_36[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_37[0..2] FROM __fc_heap_status; nondet (and SELF) 1231c1435 < __malloc_main_l82_6[0..1]; __malloc_main_l82_7[0..2]; --- > __malloc_main_l82_6[0..1]; __malloc_main_l82_7[0..1]; 1243,1244c1447,1452 < __malloc_main_l82_30[0..2]; __malloc_main_l97[0]; __malloc_main_l114[0..3]; < __malloc_main_l127; __malloc_main_l127_0[0..1]; __malloc_main_l127_1[0..2]; --- > __malloc_main_l82_30[0..2]; __malloc_main_l82_31[0..2]; > __malloc_main_l82_32[0..2]; __malloc_main_l82_33[0..2]; > __malloc_main_l82_34[0..2]; __malloc_main_l82_35[0..2]; > __malloc_main_l82_36[0..2]; __malloc_main_l82_37[0..2]; > __malloc_main_l97[0]; __malloc_main_l114[0..3]; __malloc_main_l127; > __malloc_main_l127_0[0..1]; __malloc_main_l127_1[0..2]; diff tests/builtins/oracle/malloc-optimistic.res.oracle tests/builtins/oracle_bitwise/malloc-optimistic.res.oracle 1945a1946,1948 > [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc > [eva:malloc] tests/builtins/malloc-optimistic.c:90: > resizing variable `__malloc_main7_l90' (0..31/3231) to fit 0..511/3231 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/diff_equalities�������������������������������������������������0000666�0000000�0000000�00000056042�13571573400�017275� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff tests/builtins/oracle/Longinit_sequencer.res.oracle tests/builtins/oracle_equalities/Longinit_sequencer.res.oracle 327c327 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_equalities/Longinit_sequencer.sav 568c568 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_equalities/Longinit_sequencer.sav diff tests/builtins/oracle/alloc_weak.res.oracle tests/builtins/oracle_equalities/alloc_weak.res.oracle 36,37d35 < [eva:alarm] tests/builtins/alloc_weak.c:30: Warning: < accessing uninitialized left-value. assert \initialized(p); 908c906 < r ∈ [--..--] --- > r ∈ {42} diff tests/builtins/oracle/allocated.1.res.oracle tests/builtins/oracle_equalities/allocated.1.res.oracle 191a192,194 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_7 208a212,214 > strong free on bases: {__malloc_main_l82_7} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 223a230,232 > strong free on bases: {__malloc_main_l82_7} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 238a248,250 > strong free on bases: {__malloc_main_l82_7} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 252,254c264,266 < [eva] tests/builtins/allocated.c:82: < Call to builtin Frama_C_malloc_fresh for function malloc < [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_7 --- > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_7} 323a336,356 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_31 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_32 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_33 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_34 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_35 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_36 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_37 329,330d361 < Trace partitioning superposing up to 300 states < [eva] tests/builtins/allocated.c:84: 333a365,385 > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 403c455,473 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 475c545,563 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 547c635,653 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 619c725,743 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 691c815,833 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 763c905,923 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 835c995,1013 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 905,907c1083,1084 < [eva] tests/builtins/allocated.c:87: Call to builtin free < [eva:malloc] tests/builtins/allocated.c:87: < strong free on bases: {__malloc_main_l82_7} --- > [eva] tests/builtins/allocated.c:81: > Trace partitioning superposing up to 500 states 1069,1071c1246,1247 < __malloc_main_l82_7[0] ∈ {21} or UNINITIALIZED < [1] ∈ {24} or UNINITIALIZED < [2] ∈ {27} or UNINITIALIZED --- > __malloc_main_l82_7[0] ∈ {14} or UNINITIALIZED > [1] ∈ {17} or UNINITIALIZED 1140a1317,1337 > __malloc_main_l82_31[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_32[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_33[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_34[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_35[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_36[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_37[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED 1184c1381 < __malloc_main_l82_7[0..2] FROM __fc_heap_status; nondet (and SELF) --- > __malloc_main_l82_7[0..1] FROM __fc_heap_status; nondet (and SELF) 1207a1405,1411 > __malloc_main_l82_31[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_32[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_33[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_34[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_35[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_36[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_37[0..2] FROM __fc_heap_status; nondet (and SELF) 1231c1435 < __malloc_main_l82_6[0..1]; __malloc_main_l82_7[0..2]; --- > __malloc_main_l82_6[0..1]; __malloc_main_l82_7[0..1]; 1243,1244c1447,1452 < __malloc_main_l82_30[0..2]; __malloc_main_l97[0]; __malloc_main_l114[0..3]; < __malloc_main_l127; __malloc_main_l127_0[0..1]; __malloc_main_l127_1[0..2]; --- > __malloc_main_l82_30[0..2]; __malloc_main_l82_31[0..2]; > __malloc_main_l82_32[0..2]; __malloc_main_l82_33[0..2]; > __malloc_main_l82_34[0..2]; __malloc_main_l82_35[0..2]; > __malloc_main_l82_36[0..2]; __malloc_main_l82_37[0..2]; > __malloc_main_l97[0]; __malloc_main_l114[0..3]; __malloc_main_l127; > __malloc_main_l127_0[0..1]; __malloc_main_l127_1[0..2]; diff tests/builtins/oracle/imprecise.res.oracle tests/builtins/oracle_equalities/imprecise.res.oracle 100a101,102 > [kernel] tests/builtins/imprecise.c:51: > imprecise size for variable v3 (abstract type 'struct u') 224a227,228 > [kernel] tests/builtins/imprecise.c:111: > more than 200(300) elements to enumerate. Approximating. 233a238,239 > [kernel] tests/builtins/imprecise.c:114: > more than 200(300) elements to enumerate. Approximating. 237,240d242 < [kernel] tests/builtins/imprecise.c:111: < more than 200(300) elements to enumerate. Approximating. < [kernel] tests/builtins/imprecise.c:114: < more than 200(300) elements to enumerate. Approximating. diff tests/builtins/oracle/linked_list.1.res.oracle tests/builtins/oracle_equalities/linked_list.1.res.oracle 455a456,457 > [kernel] tests/builtins/linked_list.c:19: > more than 100(128) elements to enumerate. Approximating. 506a509,510 > [kernel] tests/builtins/linked_list.c:43: > more than 100(128) elements to enumerate. Approximating. 508a513,514 > [kernel] tests/builtins/linked_list.c:44: > more than 100(128) elements to enumerate. Approximating. 600,603d605 < [kernel] tests/builtins/linked_list.c:43: < more than 100(128) elements to enumerate. Approximating. < [kernel] tests/builtins/linked_list.c:44: < more than 100(128) elements to enumerate. Approximating. diff tests/builtins/oracle/malloc-optimistic.res.oracle tests/builtins/oracle_equalities/malloc-optimistic.res.oracle 524,525d523 < [eva:alarm] tests/builtins/malloc-optimistic.c:79: Warning: < accessing uninitialized left-value. assert \initialized(p + i); 533c531 < k ∈ {-2; -1} --- > k ∈ {-1} 569c567 < k ∈ {-1; 0} --- > k ∈ {0} 607c605 < k ∈ {0; 1} --- > k ∈ {1} 647c645 < k ∈ {1; 2} --- > k ∈ {2} 689c687 < k ∈ {2; 3} --- > k ∈ {3} 733c731 < k ∈ {3; 4} --- > k ∈ {4} 779c777 < k ∈ {4; 5} --- > k ∈ {5} 827c825 < k ∈ {5; 6} --- > k ∈ {6} 877c875 < k ∈ {6; 7} --- > k ∈ {7} 1826,1827d1823 < [eva:alarm] tests/builtins/malloc-optimistic.c:92: Warning: < accessing uninitialized left-value. assert \initialized(p + i); 2018,2019d2013 < [eva:alarm] tests/builtins/malloc-optimistic.c:105: Warning: < accessing uninitialized left-value. assert \initialized(p + i); 2027c2021 < k ∈ {-2; -1} --- > k ∈ {-1} 2085c2079 < k ∈ {-1; 0} --- > k ∈ {0} 2145c2139 < k ∈ {0; 1} --- > k ∈ {1} 2207c2201 < k ∈ {1; 2} --- > k ∈ {2} 2271c2265 < k ∈ {2; 3} --- > k ∈ {3} 2337c2331 < k ∈ {3; 4} --- > k ∈ {4} 2405c2399 < k ∈ {4; 5} --- > k ∈ {5} 2475c2469 < k ∈ {5; 6} --- > k ∈ {6} 2547c2541 < k ∈ {6; 7} --- > k ∈ {7} 2621c2615 < k ∈ {7; 8} --- > k ∈ {8} 2697c2691 < k ∈ {8; 9} --- > k ∈ {9} 2775c2769 < k ∈ {9; 10} --- > k ∈ {10} 2855c2849 < k ∈ {10; 11} --- > k ∈ {11} 2937c2931 < k ∈ {11; 12} --- > k ∈ {12} 3018c3012 < k ∈ {12; 13} --- > k ∈ {13} 3064c3058 < k ∈ {12; 13; 14} --- > k ∈ {13; 14} 3109c3103 < k ∈ {12; 13; 14; 15} --- > k ∈ {13; 14; 15} 3154c3148 < k ∈ [12..97] --- > k ∈ [13..97] 3211c3205 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {1} 3219c3213 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {2} 3227c3221 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2; 3} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {3} 3235,3236c3229 < [eva] tests/builtins/malloc-optimistic.c:122: < Frama_C_show_each: {-20; 1; 2; 3; 4} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {4} 3244,3245c3237 < [eva] tests/builtins/malloc-optimistic.c:122: < Frama_C_show_each: {-20; 1; 2; 3; 4; 5} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {5} 3253,3254c3245 < [eva] tests/builtins/malloc-optimistic.c:122: < Frama_C_show_each: {-20; 1; 2; 3; 4; 5; 6} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {6} 3262,3263c3253 < [eva] tests/builtins/malloc-optimistic.c:122: < Frama_C_show_each: {-20; 1; 2; 3; 4; 5; 6; 7} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {7} 3271c3261 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..8] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {8} 3279c3269 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..9] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {9} 3287c3277 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..10] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {10} 3295c3285 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..11] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {11} 3303c3293 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..12] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {12} 3311c3301 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..13] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {13} 3319c3309 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..14] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {14} 3327c3317 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..15] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {15} 3335c3325 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..16] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {16} 3343c3333 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..17] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {17} 3351c3341 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..18] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {18} 3359c3349 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..19] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {19} 3367c3357 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..20] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {20} 3375c3365 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..21] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {21} 3383c3373 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..22] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {22} 3391c3381 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..23] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {23} 3399c3389 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..24] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {24} 3407c3397 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..25] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {25} 3415c3405 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..26] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {26} 3423c3413 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..27] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {27} 3431c3421 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..28] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {28} 3439c3429 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..29] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {29} 3447c3437 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..30] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {30} 3456c3446 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..31] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {30; 31} 3464c3454 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..32] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {30; 31; 32} 3472c3462 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..99] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [30..99] diff tests/builtins/oracle/write-const.res.oracle tests/builtins/oracle_equalities/write-const.res.oracle 84c84 < tmp ∈ {{ &a ; &b }} --- > tmp ∈ {{ &b }} 107c107 < tmp ∈ {{ &a ; &b }} --- > tmp ∈ {{ &b }} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/diff_gauges�����������������������������������������������������0000666�0000000�0000000�00000041174�13571573400�016403� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff tests/builtins/oracle/Longinit_sequencer.res.oracle tests/builtins/oracle_gauges/Longinit_sequencer.res.oracle 327c327 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_gauges/Longinit_sequencer.sav 568c568 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_gauges/Longinit_sequencer.sav diff tests/builtins/oracle/linked_list.0.res.oracle tests/builtins/oracle_gauges/linked_list.0.res.oracle 1094a1095,1100 > [eva] computing for function printf_va_1 <- main. > Called from tests/builtins/linked_list.c:51. > [eva] Done for function printf_va_1 > [eva] computing for function printf_va_1 <- main. > Called from tests/builtins/linked_list.c:51. > [eva] Done for function printf_va_1 diff tests/builtins/oracle/linked_list.1.res.oracle tests/builtins/oracle_gauges/linked_list.1.res.oracle 598a599,604 > [eva] computing for function printf_va_1 <- main. > Called from tests/builtins/linked_list.c:51. > [eva] Done for function printf_va_1 > [eva] computing for function printf_va_1 <- main. > Called from tests/builtins/linked_list.c:51. > [eva] Done for function printf_va_1 diff tests/builtins/oracle/malloc-size-zero.1.res.oracle tests/builtins/oracle_gauges/malloc-size-zero.1.res.oracle 31a32,41 > [eva] computing for function my_calloc <- main. > Called from tests/builtins/malloc-size-zero.c:29. > [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc > [eva] Recording results for my_calloc > [eva] Done for function my_calloc > [eva] computing for function my_calloc <- main. > Called from tests/builtins/malloc-size-zero.c:29. > [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc > [eva] Recording results for my_calloc > [eva] Done for function my_calloc diff tests/builtins/oracle/memcpy.res.oracle tests/builtins/oracle_gauges/memcpy.res.oracle 168a169,170 > [eva] tests/builtins/memcpy.c:96: Call to builtin memcpy > [eva] tests/builtins/memcpy.c:96: Call to builtin memcpy 449a452 > [eva] tests/builtins/memcpy.c:230: starting to merge loop iterations diff tests/builtins/oracle/realloc.res.oracle tests/builtins/oracle_gauges/realloc.res.oracle 689a690,1038 > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:150: starting to merge loop iterations > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== > [eva] tests/builtins/realloc.c:152: Call to builtin realloc > [eva:malloc] bases_to_realloc: {__realloc_w_main10_l152} > [eva:malloc] tests/builtins/realloc.c:152: > weak free on bases: {__realloc_w_main10_l152} > [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} > [eva] tests/builtins/realloc.c:155: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > Frama_C_entropy_source ∈ [--..--] > v ∈ [--..--] > p ∈ {{ &__realloc_w_main10_l152[0] }} > q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > __realloc_w_main10_l152[0] ∈ {4} > [1] ∈ UNINITIALIZED > ==END OF DUMP== ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/diff_octagons���������������������������������������������������0000666�0000000�0000000�00000037104�13571573400�016743� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff tests/builtins/oracle/Longinit_sequencer.res.oracle tests/builtins/oracle_octagons/Longinit_sequencer.res.oracle 327c327 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_octagons/Longinit_sequencer.sav 568c568 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_octagons/Longinit_sequencer.sav diff tests/builtins/oracle/allocated.0.res.oracle tests/builtins/oracle_octagons/allocated.0.res.oracle 273c273 < j ∈ [1..2147483647] --- > j ∈ {10} diff tests/builtins/oracle/allocated.1.res.oracle tests/builtins/oracle_octagons/allocated.1.res.oracle 191a192,194 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_7 208a212,214 > strong free on bases: {__malloc_main_l82_7} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 223a230,232 > strong free on bases: {__malloc_main_l82_7} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 238a248,250 > strong free on bases: {__malloc_main_l82_7} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 252,254c264,266 < [eva] tests/builtins/allocated.c:82: < Call to builtin Frama_C_malloc_fresh for function malloc < [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_7 --- > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_7} 323a336,356 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_31 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_32 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_33 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_34 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_35 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_36 > [eva] tests/builtins/allocated.c:82: > Call to builtin Frama_C_malloc_fresh for function malloc > [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_37 329,330d361 < Trace partitioning superposing up to 300 states < [eva] tests/builtins/allocated.c:84: 333a365,385 > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: 403c455,473 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 475c545,563 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 547c635,653 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 619c725,743 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 691c815,833 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 763c905,923 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 835c995,1013 < strong free on bases: {__malloc_main_l82_7} --- > strong free on bases: {__malloc_main_l82_37} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_36} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_35} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_34} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_33} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_32} > [eva] tests/builtins/allocated.c:87: Call to builtin free > [eva:malloc] tests/builtins/allocated.c:87: > strong free on bases: {__malloc_main_l82_31} 905,907c1083,1084 < [eva] tests/builtins/allocated.c:87: Call to builtin free < [eva:malloc] tests/builtins/allocated.c:87: < strong free on bases: {__malloc_main_l82_7} --- > [eva] tests/builtins/allocated.c:81: > Trace partitioning superposing up to 500 states 1069,1071c1246,1247 < __malloc_main_l82_7[0] ∈ {21} or UNINITIALIZED < [1] ∈ {24} or UNINITIALIZED < [2] ∈ {27} or UNINITIALIZED --- > __malloc_main_l82_7[0] ∈ {14} or UNINITIALIZED > [1] ∈ {17} or UNINITIALIZED 1140a1317,1337 > __malloc_main_l82_31[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_32[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_33[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_34[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_35[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_36[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED > __malloc_main_l82_37[0] ∈ {21} or UNINITIALIZED > [1] ∈ {24} or UNINITIALIZED > [2] ∈ {27} or UNINITIALIZED 1184c1381 < __malloc_main_l82_7[0..2] FROM __fc_heap_status; nondet (and SELF) --- > __malloc_main_l82_7[0..1] FROM __fc_heap_status; nondet (and SELF) 1207a1405,1411 > __malloc_main_l82_31[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_32[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_33[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_34[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_35[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_36[0..2] FROM __fc_heap_status; nondet (and SELF) > __malloc_main_l82_37[0..2] FROM __fc_heap_status; nondet (and SELF) 1231c1435 < __malloc_main_l82_6[0..1]; __malloc_main_l82_7[0..2]; --- > __malloc_main_l82_6[0..1]; __malloc_main_l82_7[0..1]; 1243,1244c1447,1452 < __malloc_main_l82_30[0..2]; __malloc_main_l97[0]; __malloc_main_l114[0..3]; < __malloc_main_l127; __malloc_main_l127_0[0..1]; __malloc_main_l127_1[0..2]; --- > __malloc_main_l82_30[0..2]; __malloc_main_l82_31[0..2]; > __malloc_main_l82_32[0..2]; __malloc_main_l82_33[0..2]; > __malloc_main_l82_34[0..2]; __malloc_main_l82_35[0..2]; > __malloc_main_l82_36[0..2]; __malloc_main_l82_37[0..2]; > __malloc_main_l97[0]; __malloc_main_l114[0..3]; __malloc_main_l127; > __malloc_main_l127_0[0..1]; __malloc_main_l127_1[0..2]; diff tests/builtins/oracle/imprecise.res.oracle tests/builtins/oracle_octagons/imprecise.res.oracle 224a225,226 > [kernel] tests/builtins/imprecise.c:111: > more than 200(300) elements to enumerate. Approximating. 233a236,237 > [kernel] tests/builtins/imprecise.c:114: > more than 200(300) elements to enumerate. Approximating. 237,240d240 < [kernel] tests/builtins/imprecise.c:111: < more than 200(300) elements to enumerate. Approximating. < [kernel] tests/builtins/imprecise.c:114: < more than 200(300) elements to enumerate. Approximating. diff tests/builtins/oracle/linked_list.1.res.oracle tests/builtins/oracle_octagons/linked_list.1.res.oracle 506a507,508 > [kernel] tests/builtins/linked_list.c:43: > more than 100(128) elements to enumerate. Approximating. 508a511,512 > [kernel] tests/builtins/linked_list.c:44: > more than 100(128) elements to enumerate. Approximating. 600,603d603 < [kernel] tests/builtins/linked_list.c:43: < more than 100(128) elements to enumerate. Approximating. < [kernel] tests/builtins/linked_list.c:44: < more than 100(128) elements to enumerate. Approximating. diff tests/builtins/oracle/malloc-optimistic.res.oracle tests/builtins/oracle_octagons/malloc-optimistic.res.oracle 3520c3520 < i ∈ [14..100] --- > i ∈ {98; 99; 100} 3524c3524 < i ∈ [14..100] --- > i ∈ {98; 99; 100} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/diff_symblocs���������������������������������������������������0000666�0000000�0000000�00000021522�13571573400�016756� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff tests/builtins/oracle/Longinit_sequencer.res.oracle tests/builtins/oracle_symblocs/Longinit_sequencer.res.oracle 327c327 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_symblocs/Longinit_sequencer.sav 568c568 < tests/builtins/result/Longinit_sequencer.sav --- > tests/builtins/result_symblocs/Longinit_sequencer.sav diff tests/builtins/oracle/alloc_weak.res.oracle tests/builtins/oracle_symblocs/alloc_weak.res.oracle 36,37d35 < [eva:alarm] tests/builtins/alloc_weak.c:30: Warning: < accessing uninitialized left-value. assert \initialized(p); 908c906 < r ∈ [--..--] --- > r ∈ {42} diff tests/builtins/oracle/imprecise.res.oracle tests/builtins/oracle_symblocs/imprecise.res.oracle 224a225,226 > [kernel] tests/builtins/imprecise.c:111: > more than 200(300) elements to enumerate. Approximating. 233a236,237 > [kernel] tests/builtins/imprecise.c:114: > more than 200(300) elements to enumerate. Approximating. 237,240d240 < [kernel] tests/builtins/imprecise.c:111: < more than 200(300) elements to enumerate. Approximating. < [kernel] tests/builtins/imprecise.c:114: < more than 200(300) elements to enumerate. Approximating. diff tests/builtins/oracle/linked_list.1.res.oracle tests/builtins/oracle_symblocs/linked_list.1.res.oracle 506a507,508 > [kernel] tests/builtins/linked_list.c:43: > more than 100(128) elements to enumerate. Approximating. 508a511,512 > [kernel] tests/builtins/linked_list.c:44: > more than 100(128) elements to enumerate. Approximating. 600,603d603 < [kernel] tests/builtins/linked_list.c:43: < more than 100(128) elements to enumerate. Approximating. < [kernel] tests/builtins/linked_list.c:44: < more than 100(128) elements to enumerate. Approximating. diff tests/builtins/oracle/malloc-optimistic.res.oracle tests/builtins/oracle_symblocs/malloc-optimistic.res.oracle 524,525d523 < [eva:alarm] tests/builtins/malloc-optimistic.c:79: Warning: < accessing uninitialized left-value. assert \initialized(p + i); 533c531 < k ∈ {-2; -1} --- > k ∈ {-1} 569c567 < k ∈ {-1; 0} --- > k ∈ {0} 607c605 < k ∈ {0; 1} --- > k ∈ {1} 647c645 < k ∈ {1; 2} --- > k ∈ {2} 689c687 < k ∈ {2; 3} --- > k ∈ {3} 733c731 < k ∈ {3; 4} --- > k ∈ {4} 779c777 < k ∈ {4; 5} --- > k ∈ {5} 827c825 < k ∈ {5; 6} --- > k ∈ {6} 877c875 < k ∈ {6; 7} --- > k ∈ {7} 1826,1827d1823 < [eva:alarm] tests/builtins/malloc-optimistic.c:92: Warning: < accessing uninitialized left-value. assert \initialized(p + i); 2018,2019d2013 < [eva:alarm] tests/builtins/malloc-optimistic.c:105: Warning: < accessing uninitialized left-value. assert \initialized(p + i); 2027c2021 < k ∈ {-2; -1} --- > k ∈ {-1} 2085c2079 < k ∈ {-1; 0} --- > k ∈ {0} 2145c2139 < k ∈ {0; 1} --- > k ∈ {1} 2207c2201 < k ∈ {1; 2} --- > k ∈ {2} 2271c2265 < k ∈ {2; 3} --- > k ∈ {3} 2337c2331 < k ∈ {3; 4} --- > k ∈ {4} 2405c2399 < k ∈ {4; 5} --- > k ∈ {5} 2475c2469 < k ∈ {5; 6} --- > k ∈ {6} 2547c2541 < k ∈ {6; 7} --- > k ∈ {7} 2621c2615 < k ∈ {7; 8} --- > k ∈ {8} 2697c2691 < k ∈ {8; 9} --- > k ∈ {9} 2775c2769 < k ∈ {9; 10} --- > k ∈ {10} 2855c2849 < k ∈ {10; 11} --- > k ∈ {11} 2937c2931 < k ∈ {11; 12} --- > k ∈ {12} 3018c3012 < k ∈ {12; 13} --- > k ∈ {13} 3064c3058 < k ∈ {12; 13; 14} --- > k ∈ {13; 14} 3109c3103 < k ∈ {12; 13; 14; 15} --- > k ∈ {13; 14; 15} 3154c3148 < k ∈ [12..97] --- > k ∈ [13..97] 3211c3205 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {1} 3219c3213 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {2} 3227c3221 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2; 3} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {3} 3235,3236c3229 < [eva] tests/builtins/malloc-optimistic.c:122: < Frama_C_show_each: {-20; 1; 2; 3; 4} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {4} 3244,3245c3237 < [eva] tests/builtins/malloc-optimistic.c:122: < Frama_C_show_each: {-20; 1; 2; 3; 4; 5} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {5} 3253,3254c3245 < [eva] tests/builtins/malloc-optimistic.c:122: < Frama_C_show_each: {-20; 1; 2; 3; 4; 5; 6} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {6} 3262,3263c3253 < [eva] tests/builtins/malloc-optimistic.c:122: < Frama_C_show_each: {-20; 1; 2; 3; 4; 5; 6; 7} --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {7} 3271c3261 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..8] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {8} 3279c3269 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..9] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {9} 3287c3277 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..10] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {10} 3295c3285 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..11] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {11} 3303c3293 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..12] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {12} 3311c3301 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..13] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {13} 3319c3309 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..14] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {14} 3327c3317 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..15] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {15} 3335c3325 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..16] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {16} 3343c3333 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..17] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {17} 3351c3341 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..18] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {18} 3359c3349 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..19] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {19} 3367c3357 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..20] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {20} 3375c3365 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..21] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {21} 3383c3373 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..22] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {22} 3391c3381 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..23] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {23} 3399c3389 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..24] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {24} 3407c3397 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..25] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {25} 3415c3405 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..26] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {26} 3423c3413 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..27] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {27} 3431c3421 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..28] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {28} 3439c3429 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..29] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {29} 3447c3437 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..30] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {30} 3456c3446 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..31] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {30; 31} 3464c3454 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..32] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {30; 31; 32} 3472c3462 < [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..99] --- > [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [30..99] ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/fam.c�����������������������������������������������������������0000666�0000000�0000000�00000000512�13571573400�015113� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include "string.h" typedef unsigned char uint8_t ; typedef struct { uint8_t length; uint8_t value[]; } TcpOption; void main (void) { uint8_t buf [100]; uint8_t value[2] = { 15, 20 }; buf[0] = 42; TcpOption * option = buf + 10; option->length = 5; Frama_C_show_each(option->value); memcpy(option->value, value, 2); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/free.c����������������������������������������������������������0000666�0000000�0000000�00000001274�13571573400�015277� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #" -eva-builtin malloc:Frama_C_malloc_fresh" */ #include "stdlib.h" volatile v; void main1() { int *p = malloc(40); p[1] = 1; int *q = malloc(40); q[2] = 2; int *r = v ? p : q; Frama_C_dump_each(); free(r); int *u = malloc(40); u[3] = 3; free(u); int* t = 0; free(t); int* s = malloc(40); s[4] = 4; s = v ? 0 : s; free(s); } void main2() { int *p; int i = 1; p = malloc(i * sizeof (int)); if (p != 0) { *p = i; } free(p); /* we must not backward-propagate information about p before and after the call, because it became dangling. */ } void main() { if (v) main1 (); else if (v) main2(); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/from_result.c���������������������������������������������������0000666�0000000�0000000�00000001407�13571573400�016715� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* OPT: @EVA_CONFIG@ -eva-no-builtins-auto -deps -journal-disable */ #define malloc(n) Frama_C_malloc_fresh(n) #include "../../share/libc/stdlib.c" struct T { int a; int b; }; /*@ assigns \result.b \from x; @ assigns \result.a \from y; */ struct T create_t(int x, int y); /*@ assigns \result.a \from x; @ assigns \result.b \from y; */ struct T create_t1(int x, int y); int* bar (int x) { int* ax = (int *)malloc(sizeof(int)); *ax = x; return ax; } void change_t(struct T* t0, int x, int y) { t0->a = x; t0->b = y; } //@ ensures \result == 3; assigns \nothing; int foo(void); int main() { int* t = bar(0); int* t1 = bar(1); struct T v = create_t(*t,*t1); struct T v1 = create_t1(*t,*t1); change_t(&v,0,0); foo(); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/gcc_zero_length_array.c�����������������������������������������0000666�0000000�0000000�00000001000�13571573400�020673� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: +"-machdep gcc_x86_32 -eva-builtin malloc:Frama_C_malloc_fresh -slevel 11" */ #include <stdlib.h> // valid usage of a GCC-style flexible array member typedef struct { int len; int buf[0]; } gcc_fam; gcc_fam *make_fam(int len) { int i; gcc_fam *p = malloc(sizeof(gcc_fam)+sizeof(int)*len); p->len = len; for (i = 0; i < len; i++) { p->buf[i] = i; } return p; } int main() { gcc_fam *pfam = make_fam(11); int res = pfam->buf[10]; free(pfam); return res; } frama-c-20.0-Calcium/tests/builtins/imprecise-malloc-free.c�����������������������������������������0000666�0000000�0000000�00000000726�13571573400�020523� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #" -eva-mlevel 0 -eva-no-alloc-returns-null" */ extern int i; #include "stdlib.h" void main() { int size1, size2; size1 = (int) (&size1 + i); size2 = i + ((int)&size2 >> 1); int *p = malloc((unsigned long)&i+(int)&i); int *q = malloc(size1); int *r = malloc(size2); Frama_C_show_each(p, q, r); Frama_C_show_each(p+(int)p); *p = (int) (p+1); *q = (int) (q+2); *r = (int) (r+3); free(p+(int)p); free(q+(int)r); } ������������������������������������������frama-c-20.0-Calcium/tests/builtins/imprecise.c�����������������������������������������������������0000666�0000000�0000000�00000006275�13571573400�016344� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: +" -eva-warn-copy-indeterminate=-cast_address -eva -out -input -deps -calldeps -eva-msg-key initial-state -absolute-valid-range 100-200 -inout -then -lib-entry" */ #include "string.h" struct s; //@ assigns *p \from \nothing; void f(struct s *p); void invalid_assigns_imprecise() { struct s *p = 0; f(p); // p is invalid, but could be considered valid since sizeof(*p) = Top } void write_garbled() { // Write through a garbled mix int i = 1; int j = 2; int k[5] = { 2, 3}; int *p = (&j + (int) &k) - (int) &k; // creates a garbled mix *p = 1; Frama_C_dump_each(); *p = (int) p; } volatile int v, addr; struct s v1, v2; struct u v3, v5; struct s* t[10]; void abstract_structs() { char *p = &v1; if (v) { char w1 = *p+1; } if (v) { char w = *p; } //if (v) { // struct s v4 = v1; // this is now a syntax error //} *p = 1; char q = *p; // if (v) { // v1 = v2; // Illegal according to C standard (assigning incomplete type) // } // v2 = v1; memset(&v3, -5, sizeof(v3)); // Also illegal, rejected by gcc int *p2 = ((int*)&v2)+1; *p2 = (int) &addr; // *t[5] = v2; // assigning incomplete type char *p4 = ((char*)&v5) + (short)v; *p4 = 18; char *p5 = ((char*)&v5) + (signed int)v; *p5 = 19; char *p6 = ((char*)&v5) + (unsigned int)v; *p6 = 20; } void cast_address() { int x; int *p = &x; char c1 = (char) p; char c2 = *((char*)&p); char c3 = *((char*)&p)+0; } int **p_gm_null; void * gm_f1 (void); void garbled_mix_null () { p_gm_null = gm_f1(); Frama_C_dump_each(); gm_f2(*p_gm_null); // Corrupts all the null base Frama_C_dump_each(); // Joining the state with the previous call to // Frama_C_dump_each may cause a crash is the offsetmap // for NULL is invalid } struct s s1, s2; void weak_update_imprecise_size() { // assigning to incomplete type: UB, rejected by gcc // s1 = s2; // Must not be considered a strong update int vx = 1; int vy; if (v) { vy = 1; } // Test 'link' on a Top range (when the effect of 's1 = s2' is erroneously // computed } struct u1 { int i1; short i2; }; #pragma pack (1) struct u2 { int i1; short i2; }; void many_writes() { struct u1 t_packed1[300]; struct u2 t_packed2[300]; t_packed1[v].i1 = 1; //@ assert t_packed1[3].i1 == 1; t_packed2[v].i1 = 1; // Due to packing, we cannot simply write '1' each // sizeof(int) //@ assert t_packed2[3].i1 == 1; } void overlap () { char t_char[100]; *(int *)((char*) t_char + v) = 1; // The write overlap, we must approximate } void paste_big () { struct s_big { char c [20480]; int i; }; unsigned int i = v; struct s_big s; memset(&s, 2, sizeof(s)); struct s_big t_big[300]; //@ assert i < 300; t_big[i] = s; // This triggers an imprecise copy (300 > plevel). Make sure // we do not read the struct as a precise integer, this is // too slow int v = * ((int *)&t_big + 48) ; } void main() { invalid_assigns_imprecise(); write_garbled(); abstract_structs(); cast_address(); garbled_mix_null(); weak_update_imprecise_size(); many_writes(); overlap(); paste_big (); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/linked_list.c���������������������������������������������������0000666�0000000�0000000�00000002044�13571573400�016653� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #"-load-module variadic -eva-no-builtins-auto" STDOPT: #"-load-module variadic -plevel 100 -big-ints-hex 257 -eva-no-builtins-auto" STDOPT: #"-load-module variadic -slevel 12 -big-ints-hex 257 -eva-no-builtins-auto" */ #include "__fc_define_size_t.h" #include "__fc_define_null.h" /* Size of mallocable memory in bytes. */ #define MEMORY_SIZE (1<<10) char MEMORY[MEMORY_SIZE]; void *malloc(size_t size) { static int next_free = 0; next_free += size; if (next_free>=MEMORY_SIZE) return NULL; return (MEMORY+(next_free-size)); } #include "stdio.h" #include "stdio.c" struct list_el { int val; struct list_el * next; }; typedef struct list_el item; void main() { item * curr, * head; int i; head = NULL; for(i=1;i<=10;i++) { Frama_C_dump_each(); curr = (item *)malloc(sizeof(item)); Frama_C_dump_each(); curr->val = i; curr->next = head; head = curr; } curr = head; while(curr) { printf("%d\n", curr->val); curr = curr->next ; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/long_init.c�����������������������������������������������������0000666�0000000�0000000�00000004345�13571573400�016342� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* DONTRUN: tests run by Longinit_sequencer.i */ #include <stdlib.h> #define N1 10 #define N2 50 #define N3 10 volatile int nondet; int a1[N1]; struct st { unsigned long t[N2]; double d[N3]; } stuff; double subanalyze(double *d) { return *d < 15 ? 1.0 : *d / 15.0; } double analyze(int *a, unsigned long *b, double *c) { int i; double res = 0.0; /*@ slevel 5; */ for (i = 0; i < 5; i++) { res += a[i + 3] + b[i * 2] + c[i + 1]; res += subanalyze(&c[i + 1]); } return res; } char garbled_mix = (char) "abc"; char *s = "abc"; //int another_global = 42; // from init_global2.c //int yet_another_global = 43; // from init_global3.c double *pr, *pr2, *pr_escaping, **ppr; int *alloc1, *alloc2, *alloc3; double dmin(double *pd1, double *pd2) { if (*pd1 < *pd2) return *pd1; else return *pd2; } int fun(int k) { return k+1; } typedef int (*i_fp_i)(int); i_fp_i fp = &fun; /*@ assigns a1[..], stuff, pr, pr2, pr_escaping, alloc1, alloc2 \from \nothing; */ void init_inner(int n, char const *tea) { int i; /*@ slevel N3; */ for (i = 0; i < N1; i++) { a1[i] = i; } for (i = 0; i < N2; i++) { stuff.t[i] = a1[i/5] + 3; } for (i = 0; i < N3; i++) { stuff.d[i] = 3.125 * i; } /*@ slevel 0; */ double r = analyze(a1, stuff.t, stuff.d); double r2 = analyze(a1, stuff.t+1, stuff.d+1); pr = nondet ? &r : &r2; pr2 = &r2; pr_escaping = &r2; alloc1 = malloc(sizeof(int*)); *alloc1 = (int) alloc1; alloc2 = malloc(2*sizeof(int)); *alloc2 = 37; free(alloc2); } int inited; /*@ assigns a1[..], stuff, pr, pr2, pr_escaping, alloc1, alloc2, inited \from \nothing; */ void init_outer() { init_inner(13, "tea"); inited = 1; } int main() { init_outer(); char *sa = s; Frama_C_dump_each(); double r = analyze(a1, stuff.t, stuff.d); double r2 = analyze(a1, stuff.t+1, stuff.d+1); pr = nondet ? &r : &r2; pr2 = nondet ? &r : &r2; ppr = nondet ? &pr : &pr2; double dm = dmin(pr, *ppr); int res_from_fp = (*fp)(31); int res = (int)r % 256; *alloc1 = inited; int local = *alloc1; free(alloc1); alloc3 = malloc(sizeof(int)); //local = another_global; // from init_global2.c //int local2 = yet_another_global; // from init_global3.c return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/long_init2.c����������������������������������������������������0000666�0000000�0000000�00000004263�13571573400�016423� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* DONTRUN: tests run by Longinit_sequencer.i */ #include <stdlib.h> #define N1 10 #define N2 50 #define N3 10 volatile int nondet; int a1[N1]; struct st { unsigned long t[N2]; double d[N3]; } stuff; double subanalyze(double *d) { return *d < 15 ? 1.0 : *d / 15.0; } double analyze(int *a, unsigned long *b, double *c) { int i; double res = 0.0; /*@ slevel 5; */ for (i = 0; i < 5; i++) { res += a[i + 3] + b[i * 2] + c[i + 1]; res += subanalyze(&c[i + 1]); } return res; } char garbled_mix = (char) "abc"; char *s = "abc"; int another_global = 42; //int yet_another_global = 43; // from init_global3.c double *pr, *pr2, *pr_escaping, **ppr; int *alloc1, *alloc2, *alloc3; double dmin(double *pd1, double *pd2) { if (*pd1 < *pd2) return *pd1; else return *pd2; } int fun(int k) { return k+1; } typedef int (*i_fp_i)(int); i_fp_i fp = &fun; /*@ assigns a1[..], stuff, pr, pr2, pr_escaping, alloc1, alloc2 \from \nothing; */ void init_inner(int n, char const *tea) { int i; /*@ slevel N3; */ for (i = 0; i < N1; i++) { a1[i] = i; } for (i = 0; i < N2; i++) { stuff.t[i] = a1[i/5] + 3; } for (i = 0; i < N3; i++) { stuff.d[i] = 3.125 * i; } /*@ slevel 0; */ double r = analyze(a1, stuff.t, stuff.d); double r2 = analyze(a1, stuff.t+1, stuff.d+1); pr = nondet ? &r : &r2; pr2 = &r2; pr_escaping = &r2; alloc1 = malloc(sizeof(int*)); *alloc1 = (int) alloc1; alloc2 = malloc(2*sizeof(int)); *alloc2 = 37; free(alloc2); } int inited; /*@ assigns a1[..], stuff, pr, pr2, pr_escaping, alloc1, alloc2, inited \from \nothing; */ void init_outer() { init_inner(13, "tea"); inited = 1; } int main() { init_outer(); char *sa = s; Frama_C_dump_each(); double r = analyze(a1, stuff.t, stuff.d); double r2 = analyze(a1, stuff.t+1, stuff.d+1); pr = nondet ? &r : &r2; pr2 = nondet ? &r : &r2; ppr = nondet ? &pr : &pr2; double dm = dmin(pr, *ppr); int res_from_fp = (*fp)(31); int res = (int)r % 256; *alloc1 = inited; int local = *alloc1; free(alloc1); alloc3 = malloc(sizeof(int)); local = another_global; //int local2 = yet_another_global; // from init_global3.c return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/long_init3.c����������������������������������������������������0000666�0000000�0000000�00000004201�13571573400�016414� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* DONTRUN: tests run by Longinit_sequencer.i */ #include <stdlib.h> #define N1 10 #define N2 50 #define N3 10 volatile int nondet; int a1[N1]; struct st { unsigned long t[N2]; double d[N3]; } stuff; double subanalyze(double *d) { return *d < 15 ? 1.0 : *d / 15.0; } double analyze(int *a, unsigned long *b, double *c) { int i; double res = 0.0; /*@ slevel 5; */ for (i = 0; i < 5; i++) { res += a[i + 3] + b[i * 2] + c[i + 1]; res += subanalyze(&c[i + 1]); } return res; } char garbled_mix = (char) "abc"; char *s = "abc"; int another_global = 42; int yet_another_global = 43; double *pr, *pr2, *pr_escaping, **ppr; int *alloc1, *alloc2, *alloc3; double dmin(double *pd1, double *pd2) { if (*pd1 < *pd2) return *pd1; else return *pd2; } int fun(int k) { return k+1; } typedef int (*i_fp_i)(int); i_fp_i fp = &fun; /*@ assigns a1[..], stuff, pr, pr2, pr_escaping, alloc1, alloc2 \from \nothing; */ void init_inner(int n, char const *tea) { int i; /*@ slevel N3; */ for (i = 0; i < N1; i++) { a1[i] = i; } for (i = 0; i < N2; i++) { stuff.t[i] = a1[i/5] + 3; } for (i = 0; i < N3; i++) { stuff.d[i] = 3.125 * i; } /*@ slevel 0; */ double r = analyze(a1, stuff.t, stuff.d); double r2 = analyze(a1, stuff.t+1, stuff.d+1); pr = nondet ? &r : &r2; pr2 = &r2; pr_escaping = &r2; alloc1 = malloc(sizeof(int*)); *alloc1 = (int) alloc1; alloc2 = malloc(2*sizeof(int)); *alloc2 = 37; free(alloc2); } int inited; /*@ assigns a1[..], stuff, pr, pr2, pr_escaping, alloc1, alloc2, inited \from \nothing; */ void init_outer() { init_inner(13, "tea"); inited = 1; } int main() { init_outer(); char *sa = s; Frama_C_dump_each(); double r = analyze(a1, stuff.t, stuff.d); double r2 = analyze(a1, stuff.t+1, stuff.d+1); pr = nondet ? &r : &r2; pr2 = nondet ? &r : &r2; ppr = nondet ? &pr : &pr2; double dm = dmin(pr, *ppr); int res_from_fp = (*fp)(31); int res = (int)r % 256; *alloc1 = inited; int local = *alloc1; free(alloc1); alloc3 = malloc(sizeof(int)); local = another_global; int local2 = yet_another_global; return 0; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/malloc-deps.i���������������������������������������������������0000666�0000000�0000000�00000001464�13571573400�016565� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* OPT: -eva @EVA_CONFIG@ -deps -calldeps -inout -slevel 5 -eva-msg-key malloc */ //@ assigns \result \from \nothing; void *Frama_C_malloc_fresh(unsigned long n); //@ assigns \result \from \nothing; void *Frama_C_malloc_fresh_weak(unsigned long n); //@ assigns \result \from \nothing; void *Frama_C_malloc_by_stack(unsigned long n); volatile int v; void g(int *p, int k) { p[k] = k; } void main(int i, int j) { int *p, *q; p = Frama_C_malloc_fresh_weak(100); *p = i; *p = j; // Cannnot perform strong update for deps, variable is weak q = Frama_C_malloc_fresh(100); *q = i; *q = j; // Can perform strong update for deps int *r; for (int l=0; l<10; l++) { r = Frama_C_malloc_by_stack((l+1)*4); g(r, l+v); // Again, we can only perform weak updates (after iteration 1) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/malloc-optimistic.c���������������������������������������������0000666�0000000�0000000�00000005507�13571573400�020012� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: +"-slevel 30 -eva-slevel-merge-after-loop @all -eva-malloc-functions malloc -eva-memexec" */ //@ assigns \result \from \nothing; void *malloc(unsigned long size); //@ assigns \nothing; frees p; void free(void *p); volatile v; void* main1() { int i, *p; i = v ? 0 : 1; Frama_C_show_each_1_1(i); p = malloc ((i+1)*sizeof(int)); Frama_C_show_each_1_2(i); p[i] = i; return p; } void* main2() { int i, *p; i = v ? 2 : 1; Frama_C_show_each_2_1(i); p = malloc ((i+1)*sizeof(int)); Frama_C_show_each_2_2(i); p[i] = i; return p; } void* main_3_aux(int i) { int *p = malloc ((i+1)*sizeof(int)); p[i] = i; return p; } void* main_4_aux(int i) { int *p = malloc ((i+1)*sizeof(int)); p[i] = i; return p; } void* main3() { int i, *p; i = v ? 0 : 1; p = main_3_aux(i); return p; } void* main4() { int i; int *p; i = v ? 2 : 1; p = main_4_aux(i); // a size of 2 is allocated first, then of 1, all accesses succeed return p; } void* main5() { int i, *p; for (int j=0; j<10; j++) { i = v ? j : j+1; p = malloc ((i+1)*sizeof(int)); p[i] = j; int k = p[i] - 2; Frama_C_dump_each(); free(p); } return 0; } void* main6() { int i, *p; for (int j=0; j<10; j++) { i = v ? j : j+1; p = malloc ((i+1)*sizeof(int)); p[i] = j; int k = p[i] - 2; Frama_C_dump_each(); if (i == j) free(p); // Leak, the variable allocated in p will become weak } return 0; } void* main7() { int i, *p; for (int j=0; j<100; j++) { i = v ? j : j+1; p = malloc ((i+1)*sizeof(int)); p[i] = j; int k = p[i] - 2; Frama_C_dump_each(); free(p); } return 0; } void* main8() { int i, *p; for (int j=0; j<100; j++) { i = v ? j : j+1; p = malloc ((i+1)*sizeof(int)); p[i] = j; int k = p[i] - 2; Frama_C_dump_each(); if (i == j) free(p); // Leak, the variable allocated in p will become weak } return 0; } void main9_aux(int *p) { *p = -20; } void* main9() { int i, *p; for (int j=0; j<100; j++) { p = malloc (4); Frama_C_show_each(j,p); *p = j; Frama_C_show_each(*p); main9_aux(p); } return 0; } void main() { void *p; /* main1 and main2 try to see if slevel makes a difference w.r.t to the allocation of bases. Currently, the answer is now, because the propagation strategy evaluates the two states on 'malloc', then the resulting states on 'p[i]=i'. See the difference with main3 and main4. */ p = main1(); free(p); p = main2(); free(p); p = main3(); free(p); p = main4(); free(p); main5(); // Well-parenthesized loop with allocation/free: variable remains strong main6(); // Ill-parenthesized loop with allocation/free: variable becomes weak // Same as above, with bigger loops (not fully unrolled) main7(); main8(); main9(); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/malloc-size-zero.c����������������������������������������������0000666�0000000�0000000�00000001344�13571573400�017550� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* OPT: -eva @EVA_CONFIG@ -eva-mlevel 3 OPT: -eva @EVA_CONFIG@ -eva-malloc-functions my_calloc */ #include <stdlib.h> void* my_calloc (int s, int n) { return malloc (s*n); } volatile foo; void main () { char *p1 = my_calloc (0, 0); if (p1 == 0) Frama_C_show_each_NULL_p1(); if (p1) Frama_C_show_each_not_NULL_p1(); else Frama_C_show_each_NULL_p1(); if (p1+1 == 0) Frama_C_show_each_NULL_p1_plus1(); // emit pointer comparable char *q1; while (foo) { if (foo) { q1 = my_calloc (0, 0); } } Frama_C_dump_each(); if (foo) { *p1 = 1; } free (p1); Frama_C_show_each(q1); //@ assert !\initialized(q1) || !\valid (q1); if (foo) { *q1 = 1; } free (q1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/malloc.c��������������������������������������������������������0000666�0000000�0000000�00000001047�13571573400�015623� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* OPT: -eva @EVA_CONFIG@ -slevel 10 -eva-mlevel 0 */ void *Frama_C_malloc_by_stack(unsigned long i); void *Frama_C_malloc_fresh(unsigned long i); void main(int c) { int x; int *s; if(c) { x = 1; s = Frama_C_malloc_by_stack(100); } else { x = 2; s = 0; } int *p = Frama_C_malloc_by_stack(c); int *q = Frama_C_malloc_by_stack(12); int *r = Frama_C_malloc_fresh(100); *p = 1; *(p+2) = 3; *(p+24999) = 4; *q = 1; Frama_C_show_each(q+2); *(q+2) = 3; *r = 1; *(r+2) = 3; // *s = 1; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/malloc_bug_tr.c�������������������������������������������������0000666�0000000�0000000�00000000650�13571573400�017164� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* OPT: -eva @EVA_CONFIG@ */ #include <stdlib.h> #include <string.h> #include <__fc_builtin.h> int main(void) { char *p; p = malloc(Frama_C_interval(4, 7)); memcpy(p, "foo", 4); memcpy(p + 4, "x", 2); // must produce alarm memcpy(p, p + 5, 1); // \valid_read((p + 5) + (0 .. (1 - 1))) p[5] = 'x'; // \valid(p + 5) int r = p[5]; // \valid_read(p + 5) free(p); return 0; } ����������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/malloc_individual.c���������������������������������������������0000666�0000000�0000000�00000000372�13571573400�020033� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #"-eva-no-builtins-auto" */ #define malloc(n) Frama_C_malloc_fresh(n) #include "share/libc/stdlib.c" int *p; int A,B,C; void main(int c) { p = malloc(sizeof(int)); if (c) *p = 3; A = *p; C = 1 + *p; B = A; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/malloc_memexec.c������������������������������������������������0000666�0000000�0000000�00000001444�13571573400�017327� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* OPT: -eva @EVA_CONFIG@ -eva-memexec -deps -inout -eva-mlevel 0 */ //@ assigns \result; void *Frama_C_malloc_fresh(unsigned long n); //@ assigns \result; void *Frama_C_malloc_fresh_weak(unsigned long n); void f(int *p, int i) { *p = i; } volatile v; void main() { int *p = Frama_C_malloc_fresh (4); if (v) { f(p, 2); f(p, 1); // This call or the corresponding one below could be cached. It is not, because we forbid memexec to take full updates to a strong variable into account for malloced bases, because they may become weak later } else { f(p, 1); } int *q = Frama_C_malloc_fresh_weak (4); if (v) { f(q, 2); f(q, 1); } else { f(q, 1); // This call cannot be cached; since q is weak, f(q, i) // actually depends on *q } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/malloc_multiple.c�����������������������������������������������0000666�0000000�0000000�00000001604�13571573400�017535� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* OPT: -eva @EVA_CONFIG@ -slevel 50 -eva-mlevel 5 */ #include<stdlib.h> #define MAX 10 long long *T[MAX]; int allocate_T(int v) { int counter; int error=0; T[0]=malloc(sizeof(long long)) ; for(counter=1;counter<MAX;counter++) { T[counter]=malloc(sizeof(long long)); *(T[counter]) = v; if (T[counter]==NULL) error++; } *(T[0]) = 111; *(T[1]) = 222; *(T[2]) = 333; *(T[3]) = 444; *(T[4]) = 555; return error; } int *F[MAX]; void allocate_and_free_last(void) { for(int counter=0;counter<MAX;counter++) { F[counter]=malloc(sizeof(int)); *(F[counter]) = counter; Frama_C_show_each_F(F[counter]); } free(F[MAX-1]); //@ assert !\dangling(F[0]); //@ assert !\dangling(F[MAX-2]); //@ assert \dangling(F[MAX-1]); return; } int main(int a) { allocate_T(1); allocate_T(2); allocate_and_free_last(); return 0; } ����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/memchr.c��������������������������������������������������������0000666�0000000�0000000�00000050367�13571573400�015640� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include "__fc_builtin.h" #include "string.h" // NOTE: all unnamed assertions should be valid. // Imprecise results should be defined using named // assertions placed after the less restrictive ones, // so that in the final output the following sentence // never arises: // Assertion got status unknown. // Only named assertions may remain unknown, e.g.: // Assertion 'refined' got status unknown. static volatile int nondet; #define assert_bottom(exp,id) if (nondet) { exp; Frama_C_show_each_unreachable_ ## id(); } // Definitions for C++ oracle checking typedef int Ival; typedef int RES; #define CHAR char #define NONDET(a,b) (nondet ? (a) : (b)) #define NONDET_STR(a,b) NONDET((a),(b)) #define NONDET_STR2(a,b) NONDET((a),(b)) #define IF_NONDET(var,val) if (nondet) var = val #define RANGE(from,to) Frama_C_interval(from,to) #define CHAR_ARRAY(var,n) char var[n] #define CHAR_PTR(var) char *var #define STRING(var,str) var = str; #define TSZ 12 const char* tab_str[TSZ] = { "" , // 0 "a", // 1 "aa" , // 2 "aaa" , // 3 "aaaa" , // 4 "aaaaa" , // 5 "aaaaaa" , // 6 /* hole */ "aaaaaaaaa" , // 9 "aaaaaaaaaa" , "aaaaaaaaaaa", "aaaaaaaaaaaa" , "aaaaaaaaaaaaa" }; // 13 #define MEMCHR_no_decl(lv_var, _p, _offs, _c, _n) \ do { \ const char *_s = (const char*) _p; \ char *_ss = memchr(_s+_offs,_c,_n); \ int _res; \ if (_ss == 0) { \ _res = -1; \ } else { \ _res = _ss - (char*)_p; \ } \ Frama_C_show_each_mymemchr(_res); \ lv_var = _res; \ } while (0) \ #define MEMCHR(lv_type, lv_var, _p, _offs, _c, _n) \ lv_type lv_var; \ MEMCHR_no_decl(lv_var, _p, _offs, _c, _n) #define MEMCHR_bottom(s, offs, c, n) assert_bottom(memchr(s+offs,c,n), s) #define MEMCHR2(lv_type, lv_var, _base, _offs1, _offs2, _c, _n) \ lv_type lv_var; \ do { \ const char *_p = (const char *) _base; \ _p += NONDET(_offs1, _offs2); \ char *_ss = memchr(_p,_c,_n); \ int _res; \ if (_ss == 0) { \ _res = -1; \ } else { \ _res = _ss - (char*)_base; \ } \ Frama_C_show_each_mymemchr2(_res); \ lv_var = _res; \ } while (0) \ //DELPHIC_TEST void memchr_small_sets() { CHAR c = 0; CHAR_PTR(s); STRING(s,"abc"); Ival o = NONDET(0, 1); MEMCHR(RES, z1, s, o, c, 4); //@ assert (z1 == 3); STRING(s,"\0bc"); o = NONDET(0,1); MEMCHR(RES, z2, s, o, c, 3); //@ assert (z2 == 0 || z2 == 3); STRING(s,""); MEMCHR(RES, z3, s, 0, c, 0); //@ assert (z3 == -1); STRING(s,"b\0c"); o = NONDET(0,2); MEMCHR(RES, z4, s, o, c, 2); //@ assert (z4 == 1 || z4 == 3); CHAR_ARRAY(t, 4); t[0] = t[1] = NONDET(0, 1); t[2] = t[3] = 1; MEMCHR(RES, z5, t, 0, c, 4); // no warning //@ assert (z5 == -1 || z5 == 0 || z5 == 1); } //DELPHIC_TEST void memchr_zero_termination() { CHAR c = 0; CHAR_ARRAY(empty_or_non_terminated, 1); empty_or_non_terminated[0] = NONDET(0, 100); MEMCHR(RES, z1, empty_or_non_terminated, 0, c, 1); //@ assert (z1 == -1 || z1 == 0); CHAR_ARRAY(non_terminated, 1); non_terminated[0] = 'X'; MEMCHR(RES, z2, non_terminated, 0, c, 1); //@ assert (z2 == -1); MEMCHR_bottom(non_terminated, 0, c, 2); CHAR_ARRAY(non_terminated2, 4); non_terminated2[0] = 76; non_terminated2[1] = 0; non_terminated2[2] = 28; non_terminated2[3] = 14; Ival o = NONDET(2, 3); MEMCHR_bottom(non_terminated2, o, c, 4); } //DELPHIC_TEST void memchr_initialization() { CHAR c = 0; CHAR_ARRAY(empty_or_uninitialized, 1); IF_NONDET(empty_or_uninitialized[0], 0); MEMCHR(RES, z1, empty_or_uninitialized, 0, c, 1); // alarm: uninit //@ assert (z1 == 0); CHAR_ARRAY(uninitialized, 1); MEMCHR_bottom(uninitialized, 0, c, 1); CHAR_ARRAY(s, 2); IF_NONDET(s[0], 1); s[1] = 0; MEMCHR(RES, z2, s, 0, c, 2); //@ assert (z2 == 1); CHAR_ARRAY(t,4); t[0] = t[1] = 10; IF_NONDET(t[2], 10); t[3] = 0; MEMCHR(RES, z3, t, 0, c, 4); //@ assert (z3 == 3); } typedef struct { int a:8; int b:8; int c:17; } st; void memchr_bitfields() { CHAR c = 0; st s; s.a = 3; s.b = 1; s.c = 7; CHAR_PTR(p); p = &s; assert_bottom(memchr(p, c, 3),bitfields); } typedef struct { int a:4; int b:4; int c:17; } st2; void memchr_bitfields2() { CHAR c = 0; st2 s; s.a = 3; s.b = 1; s.c = 7; CHAR_PTR(p); p = &s; MEMCHR(RES, z1, p, 0, c, 3); //@assert (z1 == 2); } void init_array_nondet(char *a, int from, int to, int val1, int val2) { int val = NONDET(val1, val2); memset(a + from, val, to-from+1); from = to = val1 = val2 = -1; // reset to minimize oracle changes } //DELPHIC_TEST void memchr_large() { CHAR c = 0; CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 99, 1, 2); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); MEMCHR(RES, z1, a, offset, c, 100); // alarm from precondition //@ assert (z1 >= -1 && z1 <= 75); //@ assert refined: (z1 == 20 || z1 == 75); offset = RANGE(5, 17); MEMCHR(RES, z2, a, offset, c, 100); // alarm from precondition //@ assert (z2 >= -1 && z2 <= 20); //@ assert refined: (z2 == 20); offset = RANGE(60, 74); MEMCHR(RES, z3, a, offset, c, 100); // alarm from precondition //@ assert (z3 >= -1 && z3 <= 75); //@ assert refined: (z3 == 75); offset = RANGE(63, 80); MEMCHR(RES, z4, a, offset, c, 100); // alarm from precondition //@ assert (z4 >= -1 && z4 <= 79); //@ assert refined: (z4 == 75); init_array_nondet(a, 0, 99, 0, 2); offset = RANGE(50, 70); MEMCHR(RES, z5, a, offset, c, 100); // alarm from precondition //@ assert (z5 >= -1 && z5 <= 99); //@ assert refined: (z5 >= 50 && z5 <= 99); } //DELPHIC_TEST void memchr_large_uninit() { CHAR c = 0; CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 39, 1, 2); init_array_nondet(a, 50, 94, 3, 4); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); MEMCHR(RES, z1, a, offset, c, 100); //alarm: Uninit //@ assert (z1 >= -1 && z1 <= 29); //@ assert refined: (z1 == 20); a[98] = 0; offset = RANGE(63, 80); MEMCHR(RES, z2, a, offset, c, 100); //alarm: Uninit //@ assert (z2 >= -1 && z2 <= 79); //@ assert refined: (z2 == 75); offset = RANGE(45, 55); MEMCHR(RES, z3, a, offset, c, 100); //alarm: Uninit //@ assert (z3 >= -1 && z3 <= 75); //@ assert refined: (z3 == 75); offset = 0; // avoid oracle diffs when changed } void memchr_escaping() { CHAR c = 0; CHAR_ARRAY(s,4); { int x; *((int *)s) = (int) &x; } IF_NONDET(s[0], 0); MEMCHR(RES, z1, s, 0, c, 4); // alarm //@ assert (z1 == 0); s[0] = 0; MEMCHR(RES, z2, s, 0, c, 4); // alarm in precondition //@ assert (z2 == 0); } void memchr_misc_array() { CHAR c = 0; Ival i = RANGE(0,TSZ-1); MEMCHR(RES, sz3, tab_str[i], 0, c, 14); //@ assert (sz3 >= 0 && sz3 <= 13); } //DELPHIC_TEST void memchr_misc() { CHAR c = 0; static CHAR_PTR(static_str); STRING(static_str, "Hello World\n"); static CHAR_PTR(zero_str); STRING(zero_str, "abc\0\0\0abc"); CHAR_PTR(loc_str); STRING(loc_str, "Bonjour Monde\n"); CHAR_ARRAY(loc_char_array, 5); int x = 0xabcdef00; CHAR_PTR(str); CHAR_ARRAY(unterminated_string, 12); unterminated_string[0] = 'u'; unterminated_string[1] = 'n'; unterminated_string[2] = 't'; unterminated_string[3] = 'e'; unterminated_string[4] = 'r'; unterminated_string[5] = 'm'; unterminated_string[6] = 'i'; unterminated_string[7] = 'n'; unterminated_string[8] = 'a'; unterminated_string[9] = 't'; unterminated_string[10] = 'e'; unterminated_string[11] = 'd'; MEMCHR_bottom(unterminated_string, 0, c, 13); str = NONDET_STR2(static_str, loc_str); MEMCHR(RES, sz1, str, 0, c, 15); // false alarm (pointers from 2 bases) //@ assert (sz1 == 12 || sz1 == 14); str = &x; MEMCHR2(RES, sz2, str, 0, 3, c, 12); // alarm in precondition //@ assert (sz2 == 0); // alarm loc_char_array[3] = '\0'; MEMCHR_bottom(loc_char_array, 0, c, 5); // alarm in precondition MEMCHR(RES, sz4a, zero_str, 0, c, 9); // no alarm //@ assert (sz4a == 3); MEMCHR(RES, sz4b, zero_str, 4, c, 9); // alarm in precondition //@ assert (sz4b == 4); MEMCHR(RES, sz4c, zero_str, 5, c, 9); // alarm in precondition //@ assert (sz4c == 5); MEMCHR(RES, sz4d, zero_str, 6, c, 9); // alarm in precondition //@ assert (sz4d == 9); } //DELPHIC_TEST void memchr_misc2() { CHAR c = 0; CHAR_PTR(s1); s1 = NONDET_STR("abc", "ABCD"); MEMCHR2(RES, sz5, s1, 0, 1, c, 5); // alarm in precondition //@ assert (sz5 == 3 || sz5 == 4); s1 = NONDET_STR("efg", "EFGH"); MEMCHR2(RES, sz6, s1, 1, 2, c, 5); // alarm in precondition //@ assert (sz6 == 3 || sz6 == 4); s1 = NONDET_STR("mno\0pqr", "MNOP\0QRS"); for (int j = 0; j < 8; j++) { MEMCHR(RES, sz7, s1, j, c, 10); // alarm in precondition //@ assert (sz7 == 3 || sz7 == 4 || sz7 == 7 || sz7 == 8); } CHAR_ARRAY(maybe_init, 2); maybe_init[1] = '\0'; IF_NONDET(maybe_init[0], 'A'); MEMCHR(RES, sz8, maybe_init, 0, c, 2); // alarm //@ assert (sz8 == 1); } void memchr_big_array () { CHAR c = 0; int u[200]; int r[201]; int t[1000000]; int *p; p = &u[nondet]; *p = 0x10230067; p = &r[nondet]; *p = 0x10230067; p = &t[nondet]; *p = 0x10230067; // All memchr calls in this function emit alarms due to preconditions. // The actual length is unsigned, but due to our representation // of NULL via -1, we actually use it as signed long len_u; long len_r; long len_t; MEMCHR_no_decl(len_u, u, 0, c, 800); // below plevel; precise MEMCHR_no_decl(len_r, r, 0, c, 805); // above plevel; imprecise MEMCHR_no_decl(len_t, t, 0, c, 4000001); // *far* above plevel Frama_C_show_each(len_u, len_r, len_t); //@ assert len_u == 1; //@ assert len_r >= 1 && len_r <= 801; //@ assert len_t >= 1 && len_t <= 3999997; MEMCHR_no_decl(len_u, u, 0, c, 1600); // should be precise MEMCHR_no_decl(len_r, r, 0, c, 1608); MEMCHR_no_decl(len_t, t, 0, c, 8000000); Frama_C_show_each(len_u, len_r, len_t); //@ assert len_u >= 0 && len_u <= 3; //@ assert len_r >= 0 && len_r <= 802; //@ assert len_t >= 0 && len_t <= 3999998; } //DELPHIC_TEST void memchr_no_zero_but_ok() { CHAR c = 0; CHAR_ARRAY(s,20); s[0] = s[1] = s[2] = s[3] = s[4] = s[5] = s[6] = s[7] = s[8] = s[9] = 1; s[10] = 0; s[11] = s[12] = s[13] = 1; s[14] = s[15] = s[16] = s[17] = s[18] = s[19] = NONDET(1, 0); MEMCHR(RES, z1, s, 0, c, 5); //@assert (z1 == -1); MEMCHR(RES, z2, s, 0, c, 11); //@assert (z2 == 10); MEMCHR2(RES, z3, s, 1, 8, c, 11); //@assert (z3 == 10); MEMCHR2(RES, z4, s, 7, 11, c, 4); //@assert (z4 == -1 || z4 == 10 || z4 == 14); MEMCHR2(RES, z5, s, 7, 18, c, 5); // maybe_indet = true //@assert (z5 == 10 || z5 == 18 || z5 == 19); } //DELPHIC_TEST void memchr_small_sets_n() { CHAR c = 0; CHAR_PTR(s); STRING(s,"abcde"); CHAR n = NONDET(2, 5); MEMCHR2(RES, z1, s, 0, 1, c, n); //@assert (z1 == -1 || z1 == 5); STRING(s,"\0bcdef"); n = NONDET(1, 6); MEMCHR2(RES, z2, s, 0, 1, c, n); //@assert (z2 == -1 || z2 == 0 || z2 == 6); STRING(s,"bcd\0efg"); MEMCHR2(RES, z3a, s, 0, 2, c, 4); //@assert (z3a == 3); n = NONDET(3, 4); MEMCHR2(RES, z3b, s, 0, 2, c, n); //@assert (z3b == -1 || z3b == 3); n = NONDET(2, 3); MEMCHR2(RES, z3, s, 0, 2, c, n); //@assert (z3 == -1 || z3 == 3); n = NONDET(2, 7); MEMCHR2(RES, z4, s, 2, 4, c, n); // alarm //@assert (z4 == -1 || z4 == 3 || z4 == 7); } //DELPHIC_TEST void memchr_large_n() { CHAR c = 0; CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 99, 1, 2); a[15] = 0; a[28] = 0; a[40] = 0; a[75] = 0; Ival offset = RANGE(3, 30); Ival n = RANGE(10, 20); MEMCHR(RES, z1, a, offset, c, n); //@assert (z1 >= -1 && z1 <= 40); //@assert refined: (z1 == -1 || z1 == 15 || z1 == 28 || z1 == 40); a[28] = 1; a[29] = 0; MEMCHR(RES, z2, a, offset, c, n); //@assert (z2 >= -1 && z2 <= 40); //@assert refined: (z2 == -1 || z2 == 15 || z2 == 29 || z2 == 40); a[40] = 1; MEMCHR(RES, z3, a, offset, c, n); // no alarm //@assert (z3 >= -1 && z3 <= 29); //@assert refined: (z3 == -1 || z3 == 15 || z3 == 29); offset = RANGE(5, 17); MEMCHR(RES, z4, a, offset, c, n); //@assert (z4 >= -1 && z4 <= 29); //@assert refined: (z4 == -1 || z4 == 15 || z4 == 29); offset = RANGE(60, 74); MEMCHR(RES, z5, a, offset, c, n); //@assert (z5 >= -1 && z5 <= 75); //@assert refined: (z5 == -1 || z5 == 75); offset = RANGE(63, 80); MEMCHR(RES, z6, a, offset, c, n); // no alarm //@assert (z6 >= -1 && z6 <= 79); //@assert refined: (z6 == -1 || z6 == 75); init_array_nondet(a, 0, 99, 0, 2); offset = RANGE(50, 70); MEMCHR(RES, z7, a, offset, c, n); //@assert (z7 >= -1 && z7 <= 89); n = RANGE(0, 100); MEMCHR(RES, z8, a, offset, c, n); // alarm: Invalid //@assert (z8 >= -1 && z8 <= 99); offset = RANGE(0, 10); n = RANGE(0, 90); MEMCHR(RES, z9, a, offset, c, n); // no alarm //@assert (z9 >= -1 && z9 <= 99); } void memchr_unbounded_n() { CHAR c = 0; int n = nondet; if (n < 0) n = 0; CHAR_PTR(s); STRING(s,"abc"); MEMCHR(RES, zu1, s, 0, c, n); // warning from precondition //@ assert (zu1 == -1 || zu1 == 3); Ival o = NONDET(0,1); MEMCHR(RES, zu2, s, o, c, n); // warning from precondition //@ assert (zu2 == -1 || zu2 == 2 || zu2 == 3); STRING(s,"bcd\0eg"); MEMCHR(RES, zu3, s, 0, c, n); // warning from precondition //@ assert (zu3 == -1 || zu3 == 3); } //DELPHIC_TEST void memchr_intervals() { CHAR c = 0; CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 9, 0, 1); init_array_nondet(a, 3, 6, 1, 1); init_array_nondet(a, 11, 11, 0, 1); init_array_nondet(a, 12, 15, 1, 1); init_array_nondet(a, 16, 19, 0, 1); Ival offset = RANGE(0,9); Ival n = RANGE(0, 10); MEMCHR(RES, z1, a, offset, c, n); // warning from precondition (a[10] UNINIT) //@ assert (z1 >= -1 && z1 <= 9); //@ assert refined: (z1 == -1 || z1 == 0 || z1 == 1 || z1 == 2 || z1 == 7 || z1 == 8 || z1 == 9); offset = RANGE(3,9); n = RANGE(2,10); MEMCHR(RES, z2, a, offset, c, n); // warning from precondition (a[10] UNINIT) //@ assert (z2 == -1 || z2 == 7 || z2 == 8 || z2 == 9); offset = RANGE(3,9); n = RANGE(0,11); MEMCHR(RES, z3, a, offset, c, n); // warning from precondition (a[10] UNINIT) //@ assert (z3 == -1 || z3 == 7 || z3 == 8 || z3 == 9); offset = RANGE(3,10); n = RANGE(0,9); MEMCHR(RES, z4, a, offset, c, n); // warning from precondition (a[10] UNINIT) //@ assert (z4 == -1 || z4 == 7 || z4 == 8 || z4 == 9); offset = RANGE(3,10); n = RANGE(0,10); MEMCHR(RES, z5, a, offset, c, n); // warning from precondition (a[10] UNINIT) //@ assert (z5 == -1 || z5 == 7 || z5 == 8 || z5 == 9); offset = RANGE(3,10); n = RANGE(0,11); MEMCHR(RES, z6, a, offset, c, n); // warning from precondition (a[10] UNINIT) //@ assert (z6 == -1 || z6 == 7 || z6 == 8 || z6 == 9); offset = RANGE(3,11); n = RANGE(0,10); MEMCHR(RES, z7, a, offset, c, n); // warning from precondition (a[10] UNINIT) //@ assert (z7 >= -1 && z7 <= 19); offset = RANGE(3,11); n = RANGE(0,10); MEMCHR(RES, z8, a, offset, c, n); // warning from precondition (a[10] UNINIT) //@ assert (z8 >= -1 && z8 <= 19); offset = RANGE(3,11); n = RANGE(0,11); MEMCHR(RES, z9, a, offset, c, n); // warning from precondition (a[10] UNINIT) //@ assert (z9 >= -1 && z9 <= 19); } // In the macro below: alarm from precondition in first call to memchr #define SMALL_SETS_NO_ASSERTIONS(i, c, res) \ CHAR_ARRAY(t_ ## i, 4); \ do { \ CHAR_PTR(s); \ STRING(s,"abc"); \ Ival o = NONDET(0, 1); \ MEMCHR_no_decl(res[0], s, o, c, 4); \ STRING(s,"\0bc"); \ o = NONDET(0,1); \ MEMCHR_no_decl(res[1], s, o, c, 3); \ STRING(s,""); \ MEMCHR_no_decl(res[2], s, 0, c, 0); \ STRING(s,"b\0c"); \ o = NONDET(0,2); \ MEMCHR_no_decl(res[3], s, o, c, 2); \ t_ ## i[0] = t_ ## i[1] = NONDET(c, 1); \ t_ ## i[2] = t_ ## i[3] = 1; \ MEMCHR_no_decl(res[4], t_ ## i, 0, c, 4); \ } while (0) //DELPHIC_TEST void memchr_small_sets_chars() { // NOTE: some tests here may contain extra results due to imprecisions. In such cases, an extra test containing // a more imprecise range is performed before it. // This means that only the second test is allowed to return "unknown". CHAR c = 'a'; RES res[5]; Frama_C_show_each_c(c); SMALL_SETS_NO_ASSERTIONS(0, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); //@ assert (res[0] == 0); // alarm //@ assert (res[1] == -1); // no alarm //@ assert (res[2] == -1); // no alarm //@ assert (res[3] == -1); // no alarm //@ assert (res[4] == -1 || res[4] == 0 || res[4] == 1); // no alarm c = 'b'; Frama_C_show_each_c(c); SMALL_SETS_NO_ASSERTIONS(1, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); //@ assert (res[0] == 1); // no alarm //@ assert (res[1] == 1); // no alarm //@ assert (res[2] == -1); // no alarm //@ assert (res[3] == -1 || res[3] == 0); // no alarm //@ assert (res[4] == -1 || res[4] == 0 || res[4] == 1); // no alarm c = NONDET('a', 'b'); // c IN {a; b} Frama_C_show_each_c(c); SMALL_SETS_NO_ASSERTIONS(2, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); //@ assert (res[0] == -1 || res[0] == 0 || res[0] == 1); // alarm //@ assert refined: (res[0] == 0 || res[0] == 1); // alarm //@ assert (res[1] == -1 || res[1] == 1); // no alarm //@ assert (res[2] == -1); // no alarm //@ assert (res[3] == -1 || res[3] == 0); // no alarm //@ assert (res[4] == -1 || res[4] == 0 || res[4] == 1); // no alarm c = NONDET('b', 'c'); // c IN {b; c} Frama_C_show_each_c(c); SMALL_SETS_NO_ASSERTIONS(3, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); //@ assert (res[0] == -1 || res[0] == 1 || res[0] == 2); // no alarm //@ assert refined: (res[0] == 1 || res[0] == 2); // no alarm //@ assert (res[1] == -1 || res[1] == 1 || res[1] == 2); // no alarm //@ assert refined: (res[1] == 1 || res[1] == 2); // no alarm //@ assert (res[2] == -1); // no alarm //@ assert (res[3] == -1 || res[3] == 0 || res[3] == 2); // no alarm //@ assert (res[4] == -1 || res[4] == 0 || res[4] == 1); // no alarm IF_NONDET(c, 0); // c IN {b; c; 0} Frama_C_show_each_c(c); SMALL_SETS_NO_ASSERTIONS(4, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); //@ assert (res[0] == -1 || res[0] >= 1 && res[0] <= 3); // no alarm //@ assert refined: (res[0] >= 1 && res[0] <= 3); // no alarm //@ assert (res[1] >= -1 && res[1] <= 3); // no alarm //@ assert refined: (res[1] >= 0 && res[1] <= 3); // no alarm //@ assert (res[2] == -1); // no alarm //@ assert (res[3] >= -1 && res[3] <= 3); // no alarm //@ assert (res[4] == -1 || res[4] == 0 || res[4] == 1); // no alarm } int main () { memchr_small_sets(); memchr_zero_termination(); memchr_initialization(); memchr_large(); memchr_large_uninit(); memchr_misc_array(); memchr_misc(); memchr_misc2(); memchr_bitfields(); memchr_bitfields2(); memchr_escaping(); memchr_big_array(); memchr_no_zero_but_ok(); memchr_small_sets_n(); memchr_large_n(); memchr_unbounded_n(); memchr_intervals(); memchr_small_sets_chars(); return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/memcpy.c��������������������������������������������������������0000666�0000000�0000000�00000010510�13571573400�015641� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: +"-calldeps -slevel-function init:2000 -eva-msg-key imprecision -plevel 150 -main main_all -inout -no-deps -absolute-valid-range 100000-100001 -then -load-module report -report" */ #include "string.h" volatile int i; char src[20]; char dst1[20], dst2[20], dst3[20]; char dst4[20], dst5[100]; void init () { int j; for (j=0;j<20;j++) { src[j] = j+1; dst1[j] = -1; dst2[j] = -1; dst3[j] = -1; dst4[j] = -1; } for (j=0;j<100;j++) dst5[j] = -1; } volatile maybe; void buggy () { char c; char *p = maybe ? &c: "abc"; memcpy(p,"d",1); } int tm[1000]; int um[1000]; typedef struct { short ts; int ti; } typ; typ ttyp[1000]; void many() { char s[] = "abcd"; unsigned int p = maybe; //@ assert p < 1000; tm[0]=0; memcpy(&tm[p],s,4); um[0]=0; memcpy(&um[p],s,2); typ ty = {1, 2}; ttyp[0] = ty; memcpy(&ttyp[p],&ty,sizeof(typ)); } struct t1 { int x; int y; int* p; char padding[24];} v1,v2, v3, v4, v5; struct t1 t[4]; void main (int a, int b){ buggy (); many (); init (); //@ assert 5 <= b && b <= 15; memcpy(dst1+1, src+2, b); memcpy(dst2+1, src+2, 2*b); //@ assert 5 <= b && b <= 14; memcpy(dst3+5, src+2, b); memcpy(dst4+5, src+2, 2*b); v2 = v2; v2.p = &v1.y; t[1]=v2; v1.x = 5; v1.y = 7; memcpy(&v2, &v1, sizeof(v1)); memcpy(t+2, t, (1+!a)*sizeof(v1)); memcpy(&v3, t+(int)t, sizeof(v1)); memcpy(&v4 + (int)&v4, &v1, sizeof(v1)-20); v4.y = (int) &t[0]; memcpy(&v5 + (int)&v5, &v4, sizeof(v4)-20); if (maybe) { int x=1; while(1) memcpy((void *)&x, (void const*)&x, i); } char *p; p = maybe ? &dst5[0] : &dst5[20]; memcpy(p, &src[0], b); b = maybe; //@ assert 1 <= b < 20; p = maybe ? &dst5[40] : &dst5[70]; memcpy(p, &src[0], b); // Destination pointer is unbounded char ptop1[800]; int *pptop = ptop1; while (1) { pptop++; if (maybe) break; } memcpy(pptop, src, 4); char ptop2[800]; pptop = &ptop2[750]; while (1) { pptop--; if (maybe) break; } memcpy(pptop, src+1, 4); char ptop3[800]; pptop = &ptop3[2]; while (1) { if (maybe) pptop--; if (maybe) pptop++; if (maybe) break; } memcpy(pptop, src+2, 4); char ptop4[800]; pptop = &ptop4[2]; while (1) { if (maybe) pptop--; if (maybe) pptop++; if (maybe) break; } memcpy(pptop, src+2, 5); // Size is a garbled mix char garbledsize[100]; int* pgarbledsize = &garbledsize[10]; memcpy(pgarbledsize, src, (unsigned int)garbledsize); // Sure size may be zero char dstmaybesize1[15], dstmaybesize2[150]; int maybesize = maybe; //@ assert 0 <= maybesize <= 22; // >= plevel / 10 memcpy(dstmaybesize1, src, maybesize); //@ assert 0 <= maybesize <= 6; memcpy(dstmaybesize2, src, maybesize); } /*@ assigns \result \from l, u; ensures l <= \result <= u; */ int itv(int l, int u); /*@ requires \valid(p + (0 .. l-1)); assigns p[0 .. l-1] \from maybe; ensures \initialized(p + (0 .. l-1)); */ void make_unknown(unsigned char *p, size_t l); void main_uninit () { unsigned char a[50]; unsigned char b[50]; int r = 0; if (maybe) { memcpy(b, a, 10); //@ assert !\initialized(&b[8]); memcpy(b, a, itv(0,25)); //@ assert !\initialized(&b[11]); } else if (maybe) { make_unknown(a, 10); memcpy(b, a, 10); //@ assert \initialized(&b[8]); memcpy(b, a, itv(0,25)); r += b[11]; // initialisation unknown } else if (maybe) { make_unknown(b, 10); if (maybe) { memcpy(b, a, 10); // de-initialize b //@ assert !\initialized(&b[8]); } else { memcpy(b, a, itv(0,25)); // copy completely uninitialized in an unsure way //@ assert !\initialized(&b[11]); // already NOT initialized r += b[8]; // initialisation unknown } } else if (maybe) { make_unknown(a, 10); make_unknown(b, 10); memcpy(b, a, 10); //@ assert \initialized(&b[8]); memcpy(b, a, itv(0,25)); r += b[11]; // initialisation unknown } } void main_local() { int* p, *q; { int y; q = &y; memcpy(&p, &q, sizeof(int *)); q = 0; } Frama_C_dump_each(); } void copy_0() { int l; if (i) memcpy(0, &l, 0); if (i) memcpy(&l, 0, 0); } void main_all () { if (maybe) main (maybe, maybe); else if (maybe) main_uninit (); else if (maybe) main_local (); else if (maybe) copy_0 (); while (1); // results of main are unimportant } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/memcpy2.c�������������������������������������������������������0000666�0000000�0000000�00000000454�13571573400�015731� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include "__fc_builtin.h" #include "string.h" int main(int c, char **v) { char t[512]; char s[512] = { 0 }; int l; l = Frama_C_interval(0,511); memcpy(t, s, l); Frama_C_dump_each(); l = Frama_C_interval(0,512); memcpy(t, s, l); l = Frama_C_interval(1,512); memcpy(t, s, l); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/memcpy_invalid.c������������������������������������������������0000666�0000000�0000000�00000000736�13571573400�017360� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* OPT: -eva @EVA_CONFIG@ -journal-disable -calldeps */ /*@ assigns \result \from min, max; @ ensures min <= \result <= max; */ extern int Frama_C_interval(int min, int max); #include "string.h" volatile int v; static void test(int max) { char dst, src = 0; unsigned long i = Frama_C_interval(0, max) * 2U; memcpy(&dst, (char *)&src + i, sizeof(src) - i); } extern int main(void) { if (v) test(7); if (v) test(8); return 0; } ����������������������������������frama-c-20.0-Calcium/tests/builtins/memexec-malloc.c������������������������������������������������0000666�0000000�0000000�00000000727�13571573400�017250� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #"-eva-malloc-functions alloc,Frama_C_malloc_by_stack -eva-mlevel 0" */ #define N 2000 int t[N]; void f() { for (int i=0; i<N; i++) t[i] = i; } int *alloc() { return Frama_C_malloc_by_stack(4); } int *k() { return alloc(); } void main() { f(); f(); f(); Frama_C_show_each(t[1]); Frama_C_show_each(t[1]); Frama_C_show_each(t[2]); f(); int *p1 = alloc(); int *p2 = alloc(); int *p3 = k(); int *p4 = k(); } �����������������������������������������frama-c-20.0-Calcium/tests/builtins/memset.c��������������������������������������������������������0000666�0000000�0000000�00000002461�13571573400�015647� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #"-calldeps -eva-msg-key imprecision -plevel 500" +"-inout -no-deps" */ #include "string.h" int t1[100]; int t2[100]; int t3[100]; int t4[100]; int t5[100]; int t6[100]; int t7[100]; int t8[100]; int t9[100]; int t10[100]; int t11[100]; int t12[100]; struct s { char f1; short f2; int f3; int f4[3]; }; struct s ts[5]; volatile int vol; void main() { void * dst = memset(t1, 0x11, sizeof(t1)); // basic memset(t2+(int)t2, 0x12, sizeof(t2)); // garbled dest memset(t3+10, 0x11, (unsigned long)t1); // garbled size if (vol) { memset(t4+1, 1, sizeof(t4)); // out of bounds } memset(t5, (int)t1, sizeof(t4)); // garbled char int *p = vol ? t6+10 : t7; memset(p, 0x22, 16); // multiple dest p = vol ? (char*) 0 : t8; memset(p, 0x22, 16); // one valid dest; TODO p = t9+20; while (1) { if (vol) break; p++; } memset(p, 0x8FE, 4); // imprecise dest unsigned long s = 12; if (vol) s += 24; memset(t10+4, 0x88, s); // imprecise size unsigned long s1 = 8; if (vol) s1 += 8; p = t11 + 2; if (vol) p++; memset(p, 0x99, s1); // imprecise dest+size with juxtaposition if (vol) memset(ts, 254, sizeof(ts)); unsigned k = vol; //@ assert Assume: k <= 12; memset(t12+k*8, 1, 4); // Imprecise, because of double congruences } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/memset_block.i��������������������������������������������������0000666�0000000�0000000�00000000675�13571573400�017034� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #"-initialized-padding-locals" STDOPT: #"-no-initialized-padding-locals" */ int main(void) { const char S[5] = "12345"; struct t1 { int x; int y; int name[10];} v1; struct t1 TS[29] = {1,3,01234570110}; struct t2 { int x2; short int y2; char *ptr;} v2; char C; char PC[]= "lkjlj"; struct t2 T2[50] = {{1,2,&PC[0]},{1,2,0}}; int T[10] = {1,0}; int U[] = {3,4}; int x = sizeof(U); int y = sizeof(T); return sizeof(U); } �������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/memset_malloc_0.c�����������������������������������������������0000666�0000000�0000000�00000000272�13571573400�017413� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* */ #include <stdlib.h> #include <string.h> long *p; int main(){ long l; p = malloc(0); memset(p, 0, 0); // succeeds if p != NULL (implementation-defined) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/���������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015453� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/Longinit_sequencer.res.oracle����������������������������0000666�0000000�0000000�00000057142�13571573400�023300� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/Longinit_sequencer.i (no preprocessing) [kernel] Parsing tests/builtins/long_init.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] tests/builtins/long_init.c:34: Assigning imprecise value to garbled_mix. The imprecision originates from Arithmetic {tests/builtins/long_init.c:34} [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] a1[0..9] ∈ {0} stuff ∈ {0} garbled_mix ∈ {{ garbled mix of &{"abc"} (origin: Arithmetic {tests/builtins/long_init.c:34}) }} s ∈ {{ "abc" }} pr ∈ {0} pr2 ∈ {0} pr_escaping ∈ {0} ppr ∈ {0} alloc1 ∈ {0} alloc2 ∈ {0} alloc3 ∈ {0} fp ∈ {{ &fun }} inited ∈ {0} [eva] computing for function init_outer <- main. Called from tests/builtins/long_init.c:90. [eva] computing for function init_inner <- init_outer <- main. Called from tests/builtins/long_init.c:85. [eva] tests/builtins/long_init.c:61: starting to merge loop iterations [eva] computing for function analyze <- init_inner <- init_outer <- main. Called from tests/builtins/long_init.c:68. [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- main. Called from tests/builtins/long_init.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- main. Called from tests/builtins/long_init.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- main. Called from tests/builtins/long_init.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- main. Called from tests/builtins/long_init.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- main. Called from tests/builtins/long_init.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] Recording results for analyze [eva] Done for function analyze [eva] computing for function analyze <- init_inner <- init_outer <- main. Called from tests/builtins/long_init.c:69. [eva] tests/builtins/long_init.c:29: Reusing old results for call to subanalyze [eva] tests/builtins/long_init.c:29: Reusing old results for call to subanalyze [eva] tests/builtins/long_init.c:29: Reusing old results for call to subanalyze [eva] tests/builtins/long_init.c:29: Reusing old results for call to subanalyze [eva] computing for function subanalyze <- analyze <- init_inner <- init_outer <- main. Called from tests/builtins/long_init.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] Recording results for analyze [eva] Done for function analyze [eva] tests/builtins/long_init.c:73: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/long_init.c:73: allocating variable __malloc_init_inner_l73 [eva] tests/builtins/long_init.c:75: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/long_init.c:75: allocating variable __malloc_init_inner_l75 [eva] tests/builtins/long_init.c:77: Call to builtin free [eva] tests/builtins/long_init.c:77: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/long_init.c:77: strong free on bases: {__malloc_init_inner_l75} [eva] Recording results for init_inner [eva] Done for function init_inner [eva:locals-escaping] tests/builtins/long_init.c:85: Warning: locals {r, r2} escaping the scope of init_inner through pr [eva:locals-escaping] tests/builtins/long_init.c:85: Warning: locals {r2} escaping the scope of init_inner through pr2 [eva:locals-escaping] tests/builtins/long_init.c:85: Warning: locals {r2} escaping the scope of init_inner through pr_escaping [eva] Recording results for init_outer [eva] Done for function init_outer [eva] tests/builtins/long_init.c:92: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] nondet ∈ [--..--] a1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} stuff.t[0..4] ∈ {3} .t[5..9] ∈ {4} .t[10..49] ∈ [0..12] .d[0] ∈ {0} .d[1] ∈ {3.125} .d[2] ∈ {6.25} .d[3] ∈ {9.375} .d[4] ∈ {12.5} .d[5] ∈ {15.625} .d[6] ∈ {18.75} .d[7] ∈ {21.875} .d[8] ∈ {25.} .d[9] ∈ {28.125} garbled_mix ∈ {{ garbled mix of &{"abc"} (origin: Arithmetic {tests/builtins/long_init.c:34}) }} s ∈ {{ "abc" }} pr ∈ ESCAPINGADDR pr2 ∈ ESCAPINGADDR pr_escaping ∈ ESCAPINGADDR ppr ∈ {0} alloc1 ∈ {{ &__malloc_init_inner_l73 }} alloc2 ∈ ESCAPINGADDR alloc3 ∈ {0} fp ∈ {{ &fun }} inited ∈ {1} sa ∈ {{ "abc" }} tmp_2 ∈ UNINITIALIZED __retres ∈ UNINITIALIZED S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_init_inner_l73 ∈ {{ (int)&__malloc_init_inner_l73 }} ==END OF DUMP== [eva] tests/builtins/long_init.c:93: Reusing old results for call to analyze [eva] tests/builtins/long_init.c:94: Reusing old results for call to analyze [eva] computing for function dmin <- main. Called from tests/builtins/long_init.c:98. [eva] Recording results for dmin [eva] Done for function dmin [eva] computing for function fun <- main. Called from tests/builtins/long_init.c:99. [eva] Recording results for fun [eva] Done for function fun [eva] tests/builtins/long_init.c:103: Call to builtin free [eva] tests/builtins/long_init.c:103: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/long_init.c:103: strong free on bases: {__malloc_init_inner_l73} [eva] tests/builtins/long_init.c:104: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/long_init.c:104: allocating variable __malloc_main_l104 [eva] Recording results for main [eva] done for function main [eva] Saving globals state after call to function: init_inner Values at end of function dmin: __retres ∈ [93.9166666667 .. 110.791666667] Values at end of function fun: __retres ∈ {32} Values at end of function subanalyze: Values at end of function analyze: i ∈ {5} res ∈ [93.9166666667 .. 110.791666667] Values at end of function init_inner: __fc_heap_status ∈ [--..--] a1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} stuff.t[0..4] ∈ {3} .t[5..9] ∈ {4} .t[10..49] ∈ [0..12] .d[0] ∈ {0} .d[1] ∈ {3.125} .d[2] ∈ {6.25} .d[3] ∈ {9.375} .d[4] ∈ {12.5} .d[5] ∈ {15.625} .d[6] ∈ {18.75} .d[7] ∈ {21.875} .d[8] ∈ {25.} .d[9] ∈ {28.125} pr ∈ {{ &r ; &r2 }} pr2 ∈ {{ &r2 }} pr_escaping ∈ {{ &r2 }} alloc1 ∈ {{ &__malloc_init_inner_l73 }} alloc2 ∈ ESCAPINGADDR i ∈ {10} r ∈ {93.9166666667} r2 ∈ {110.791666667} __malloc_init_inner_l73 ∈ {{ (int)&__malloc_init_inner_l73 }} Values at end of function init_outer: __fc_heap_status ∈ [--..--] a1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} stuff.t[0..4] ∈ {3} .t[5..9] ∈ {4} .t[10..49] ∈ [0..12] .d[0] ∈ {0} .d[1] ∈ {3.125} .d[2] ∈ {6.25} .d[3] ∈ {9.375} .d[4] ∈ {12.5} .d[5] ∈ {15.625} .d[6] ∈ {18.75} .d[7] ∈ {21.875} .d[8] ∈ {25.} .d[9] ∈ {28.125} pr ∈ ESCAPINGADDR pr2 ∈ ESCAPINGADDR pr_escaping ∈ ESCAPINGADDR alloc1 ∈ {{ &__malloc_init_inner_l73 }} alloc2 ∈ ESCAPINGADDR inited ∈ {1} __malloc_init_inner_l73 ∈ {{ (int)&__malloc_init_inner_l73 }} Values at end of function main: __fc_heap_status ∈ [--..--] a1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} stuff.t[0..4] ∈ {3} .t[5..9] ∈ {4} .t[10..49] ∈ [0..12] .d[0] ∈ {0} .d[1] ∈ {3.125} .d[2] ∈ {6.25} .d[3] ∈ {9.375} .d[4] ∈ {12.5} .d[5] ∈ {15.625} .d[6] ∈ {18.75} .d[7] ∈ {21.875} .d[8] ∈ {25.} .d[9] ∈ {28.125} pr ∈ {{ &r ; &r2 }} pr2 ∈ {{ &r ; &r2 }} pr_escaping ∈ ESCAPINGADDR ppr ∈ {{ &pr ; &pr2 }} alloc1 ∈ ESCAPINGADDR alloc2 ∈ ESCAPINGADDR alloc3 ∈ {{ &__malloc_main_l104 }} inited ∈ {1} sa ∈ {{ "abc" }} r ∈ {93.9166666667} r2 ∈ {110.791666667} dm ∈ [93.9166666667 .. 110.791666667] res_from_fp ∈ {32} res ∈ {93} local ∈ {1} __retres ∈ {0}[kernel] Parsing tests/builtins/long_init2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] tests/builtins/long_init2.c:34: Assigning imprecise value to garbled_mix. The imprecision originates from Arithmetic {tests/builtins/long_init2.c:34} [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] a1[0..9] ∈ {0} stuff ∈ {0} garbled_mix ∈ {{ garbled mix of &{"abc"} (origin: Arithmetic {tests/builtins/long_init2.c:34}) }} s ∈ {{ "abc" }} another_global ∈ {42} pr ∈ {0} pr2 ∈ {0} pr_escaping ∈ {0} ppr ∈ {0} alloc1 ∈ {0} alloc2 ∈ {0} alloc3 ∈ {0} fp ∈ {{ &fun }} inited ∈ {0} [eva] computing for function init_outer <- main. Called from tests/builtins/long_init2.c:90. [eva] tests/builtins/long_init2.c:85: Call to builtin Frama_C_load_state for function init_inner [eva] Skipping call to init_inner, loading globals state from file: tests/builtins/result/Longinit_sequencer.sav [eva] Warning: importing garbled mix, locations may have changed [eva] Warning: variable `r' is not global, possibly an escaping value; ignoring [eva] Warning: variable `r2' is not global, possibly an escaping value; ignoring [eva] Warning: variable `r2' is not global, possibly an escaping value; ignoring [eva] Warning: found new global variable `another_global' [eva] Recording results for init_outer [eva] Done for function init_outer [eva] tests/builtins/long_init2.c:92: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] nondet ∈ [--..--] a1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} stuff.t[0..4] ∈ {3} .t[5..9] ∈ {4} .t[10..49] ∈ [0..12] .d[0] ∈ {0} .d[1] ∈ {3.125} .d[2] ∈ {6.25} .d[3] ∈ {9.375} .d[4] ∈ {12.5} .d[5] ∈ {15.625} .d[6] ∈ {18.75} .d[7] ∈ {21.875} .d[8] ∈ {25.} .d[9] ∈ {28.125} garbled_mix ∈ {{ garbled mix of &{"abc"} (origin: Arithmetic {tests/builtins/long_init.c:34}) }} s ∈ {{ "abc" }} another_global ∈ {42} pr ∈ ESCAPINGADDR pr2 ∈ ESCAPINGADDR pr_escaping ∈ ESCAPINGADDR ppr ∈ {0} alloc1 ∈ {{ &__malloc_init_inner_l73 }} alloc2 ∈ ESCAPINGADDR alloc3 ∈ {0} fp ∈ {{ &fun }} inited ∈ {1} sa ∈ {{ "abc" }} tmp_2 ∈ UNINITIALIZED __retres ∈ UNINITIALIZED S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_init_inner_l73 ∈ {{ (int)&__malloc_init_inner_l73 }} ==END OF DUMP== [eva] computing for function analyze <- main. Called from tests/builtins/long_init2.c:93. [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init2.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init2.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init2.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init2.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init2.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] Recording results for analyze [eva] Done for function analyze [eva] computing for function analyze <- main. Called from tests/builtins/long_init2.c:94. [eva] tests/builtins/long_init2.c:29: Reusing old results for call to subanalyze [eva] tests/builtins/long_init2.c:29: Reusing old results for call to subanalyze [eva] tests/builtins/long_init2.c:29: Reusing old results for call to subanalyze [eva] tests/builtins/long_init2.c:29: Reusing old results for call to subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init2.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] Recording results for analyze [eva] Done for function analyze [eva] computing for function dmin <- main. Called from tests/builtins/long_init2.c:98. [eva] Recording results for dmin [eva] Done for function dmin [eva] computing for function fun <- main. Called from tests/builtins/long_init2.c:99. [eva] Recording results for fun [eva] Done for function fun [eva] tests/builtins/long_init2.c:103: Call to builtin free [eva] tests/builtins/long_init2.c:103: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/long_init2.c:103: strong free on bases: {__malloc_init_inner_l73} [eva] tests/builtins/long_init2.c:104: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/long_init2.c:104: allocating variable __malloc_main_l104 [eva] Recording results for main [eva] done for function main [eva] Saving globals state after call to function: init_outer Values at end of function dmin: __retres ∈ [93.9166666667 .. 110.791666667] Values at end of function fun: __retres ∈ {32} Values at end of function init_outer: a1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} stuff.t[0..4] ∈ {3} .t[5..9] ∈ {4} .t[10..49] ∈ [0..12] .d[0] ∈ {0} .d[1] ∈ {3.125} .d[2] ∈ {6.25} .d[3] ∈ {9.375} .d[4] ∈ {12.5} .d[5] ∈ {15.625} .d[6] ∈ {18.75} .d[7] ∈ {21.875} .d[8] ∈ {25.} .d[9] ∈ {28.125} pr ∈ ESCAPINGADDR pr2 ∈ ESCAPINGADDR pr_escaping ∈ ESCAPINGADDR alloc1 ∈ {{ &__malloc_init_inner_l73 }} alloc2 ∈ ESCAPINGADDR inited ∈ {1} Values at end of function subanalyze: Values at end of function analyze: i ∈ {5} res ∈ [93.9166666667 .. 110.791666667] Values at end of function main: __fc_heap_status ∈ [--..--] a1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} stuff.t[0..4] ∈ {3} .t[5..9] ∈ {4} .t[10..49] ∈ [0..12] .d[0] ∈ {0} .d[1] ∈ {3.125} .d[2] ∈ {6.25} .d[3] ∈ {9.375} .d[4] ∈ {12.5} .d[5] ∈ {15.625} .d[6] ∈ {18.75} .d[7] ∈ {21.875} .d[8] ∈ {25.} .d[9] ∈ {28.125} pr ∈ {{ &r ; &r2 }} pr2 ∈ {{ &r ; &r2 }} pr_escaping ∈ ESCAPINGADDR ppr ∈ {{ &pr ; &pr2 }} alloc1 ∈ ESCAPINGADDR alloc2 ∈ ESCAPINGADDR alloc3 ∈ {{ &__malloc_main_l104 }} inited ∈ {1} sa ∈ {{ "abc" }} r ∈ {93.9166666667} r2 ∈ {110.791666667} dm ∈ [93.9166666667 .. 110.791666667] res_from_fp ∈ {32} res ∈ {93} local ∈ {42} __retres ∈ {0}[kernel] Parsing tests/builtins/long_init3.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] tests/builtins/long_init3.c:34: Assigning imprecise value to garbled_mix. The imprecision originates from Arithmetic {tests/builtins/long_init3.c:34} [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] a1[0..9] ∈ {0} stuff ∈ {0} garbled_mix ∈ {{ garbled mix of &{"abc"} (origin: Arithmetic {tests/builtins/long_init3.c:34}) }} s ∈ {{ "abc" }} another_global ∈ {42} yet_another_global ∈ {43} pr ∈ {0} pr2 ∈ {0} pr_escaping ∈ {0} ppr ∈ {0} alloc1 ∈ {0} alloc2 ∈ {0} alloc3 ∈ {0} fp ∈ {{ &fun }} inited ∈ {0} [eva] tests/builtins/long_init3.c:90: Call to builtin Frama_C_load_state for function init_outer [eva] Skipping call to init_outer, loading globals state from file: tests/builtins/result/Longinit_sequencer.sav [eva] Warning: importing garbled mix, locations may have changed [eva] Warning: found new global variable `yet_another_global' [eva] tests/builtins/long_init3.c:92: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] nondet ∈ [--..--] a1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} stuff.t[0..4] ∈ {3} .t[5..9] ∈ {4} .t[10..49] ∈ [0..12] .d[0] ∈ {0} .d[1] ∈ {3.125} .d[2] ∈ {6.25} .d[3] ∈ {9.375} .d[4] ∈ {12.5} .d[5] ∈ {15.625} .d[6] ∈ {18.75} .d[7] ∈ {21.875} .d[8] ∈ {25.} .d[9] ∈ {28.125} garbled_mix ∈ {{ garbled mix of &{"abc"} (origin: Arithmetic {tests/builtins/long_init.c:34}) }} s ∈ {{ "abc" }} another_global ∈ {42} yet_another_global ∈ {43} pr ∈ ESCAPINGADDR pr2 ∈ ESCAPINGADDR pr_escaping ∈ ESCAPINGADDR ppr ∈ {0} alloc1 ∈ {{ &__malloc_init_inner_l73 }} alloc2 ∈ ESCAPINGADDR alloc3 ∈ {0} fp ∈ {{ &fun }} inited ∈ {1} sa ∈ {{ "abc" }} tmp_2 ∈ UNINITIALIZED __retres ∈ UNINITIALIZED S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_init_inner_l73 ∈ {{ (int)&__malloc_init_inner_l73 }} ==END OF DUMP== [eva] computing for function analyze <- main. Called from tests/builtins/long_init3.c:93. [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init3.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init3.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init3.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init3.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init3.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] Recording results for analyze [eva] Done for function analyze [eva] computing for function analyze <- main. Called from tests/builtins/long_init3.c:94. [eva] tests/builtins/long_init3.c:29: Reusing old results for call to subanalyze [eva] tests/builtins/long_init3.c:29: Reusing old results for call to subanalyze [eva] tests/builtins/long_init3.c:29: Reusing old results for call to subanalyze [eva] tests/builtins/long_init3.c:29: Reusing old results for call to subanalyze [eva] computing for function subanalyze <- analyze <- main. Called from tests/builtins/long_init3.c:29. [eva] Recording results for subanalyze [eva] Done for function subanalyze [eva] Recording results for analyze [eva] Done for function analyze [eva] computing for function dmin <- main. Called from tests/builtins/long_init3.c:98. [eva] Recording results for dmin [eva] Done for function dmin [eva] computing for function fun <- main. Called from tests/builtins/long_init3.c:99. [eva] Recording results for fun [eva] Done for function fun [eva] tests/builtins/long_init3.c:103: Call to builtin free [eva] tests/builtins/long_init3.c:103: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/long_init3.c:103: strong free on bases: {__malloc_init_inner_l73} [eva] tests/builtins/long_init3.c:104: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/long_init3.c:104: allocating variable __malloc_main_l104 [eva] Recording results for main [eva] done for function main Values at end of function dmin: __retres ∈ [93.9166666667 .. 110.791666667] Values at end of function fun: __retres ∈ {32} Values at end of function subanalyze: Values at end of function analyze: i ∈ {5} res ∈ [93.9166666667 .. 110.791666667] Values at end of function main: __fc_heap_status ∈ [--..--] a1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} stuff.t[0..4] ∈ {3} .t[5..9] ∈ {4} .t[10..49] ∈ [0..12] .d[0] ∈ {0} .d[1] ∈ {3.125} .d[2] ∈ {6.25} .d[3] ∈ {9.375} .d[4] ∈ {12.5} .d[5] ∈ {15.625} .d[6] ∈ {18.75} .d[7] ∈ {21.875} .d[8] ∈ {25.} .d[9] ∈ {28.125} pr ∈ {{ &r ; &r2 }} pr2 ∈ {{ &r ; &r2 }} pr_escaping ∈ ESCAPINGADDR ppr ∈ {{ &pr ; &pr2 }} alloc1 ∈ ESCAPINGADDR alloc2 ∈ ESCAPINGADDR alloc3 ∈ {{ &__malloc_main_l104 }} inited ∈ {1} sa ∈ {{ "abc" }} r ∈ {93.9166666667} r2 ∈ {110.791666667} dm ∈ [93.9166666667 .. 110.791666667] res_from_fp ∈ {32} res ∈ {93} local ∈ {42} local2 ∈ {43} __retres ∈ {0} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/alloc-vla.res.oracle�������������������������������������0000666�0000000�0000000�00000005126�13571573400�021310� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/alloc-vla.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function f <- main. Called from tests/builtins/alloc-vla.c:12. [eva] tests/builtins/alloc-vla.c:6: assertion 'alloca_bounds' got status valid. [eva] tests/builtins/alloc-vla.c:6: Call to builtin __fc_vla_alloc [eva] tests/builtins/alloc-vla.c:6: allocating variable __malloc_f_l6 [eva] tests/builtins/alloc-vla.c:7: Call to builtin free [eva:alarm] tests/builtins/alloc-vla.c:7: Warning: function free: precondition 'freeable' got status invalid. [eva] tests/builtins/alloc-vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/alloc-vla.c:6: strong free on bases: {__malloc_f_l6} [eva:alarm] tests/builtins/alloc-vla.c:8: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&a); [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] tests/builtins/alloc-vla.c:8: assertion 'Eva,dangling_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __fc_heap_status ∈ [--..--] a ∈ ESCAPINGADDR __lengthof_a ∈ {4} [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function f [from] Computing for function __fc_vla_alloc <-f [from] Done for function __fc_vla_alloc [from] Computing for function free <-f [from] Done for function free [from] Computing for function __fc_vla_free <-f [from] Done for function __fc_vla_free [from] Done for function f [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function __fc_vla_alloc: \result FROM \nothing [from] Function __fc_vla_free: NO EFFECTS [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function f: __fc_heap_status FROM __fc_heap_status; nondet (and SELF) \result FROM \nothing [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __fc_heap_status; a; __lengthof_a [inout] Inputs for function f: __fc_heap_status; nondet [inout] Out (internal) for function main: __fc_heap_status; t [inout] Inputs for function main: __fc_heap_status; nondet ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/alloc.0.res.oracle���������������������������������������0000666�0000000�0000000�00000014504�13571573400�020666� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/alloc.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} q ∈ {0} r ∈ {0} a ∈ {0} b ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} ch ∈ {44} [eva] tests/builtins/alloc.c:16: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/alloc.c:16: allocating variable __malloc_main_l16 [eva] tests/builtins/alloc.c:17: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/alloc.c:17: allocating variable __malloc_main_l17 [eva:alarm] tests/builtins/alloc.c:18: Warning: out of bounds write. assert \valid(p + (int)(-1)); [kernel] tests/builtins/alloc.c:18: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/builtins/alloc.c:19: Warning: out of bounds write. assert \valid(p + 1); [kernel] tests/builtins/alloc.c:19: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/builtins/alloc.c:20: Warning: out of bounds write. assert \valid(t + (int)(-1)); [kernel] tests/builtins/alloc.c:20: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/builtins/alloc.c:21: Warning: out of bounds write. assert \valid(t + 10); [kernel] tests/builtins/alloc.c:21: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/alloc.c:25: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/alloc.c:25: allocating variable __malloc_main_l25 [eva:alarm] tests/builtins/alloc.c:26: Warning: signed overflow. assert -2147483648 ≤ -((int)q); [eva:alarm] tests/builtins/alloc.c:26: Warning: signed overflow. assert -((int)q) ≤ 2147483647; [eva] tests/builtins/alloc.c:26: Assigning imprecise value to r. The imprecision originates from Arithmetic {tests/builtins/alloc.c:26} [eva:alarm] tests/builtins/alloc.c:27: Warning: out of bounds write. assert \valid(r); [eva:alarm] tests/builtins/alloc.c:27: Warning: out of bounds read. assert \valid_read(r + 1); [eva] tests/builtins/alloc.c:32: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/alloc.c:32: allocating variable __malloc_main_l32 [eva] tests/builtins/alloc.c:33: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/alloc.c:33: allocating variable __malloc_main_l33 [eva:alarm] tests/builtins/alloc.c:34: Warning: out of bounds write. assert \valid(u); [eva:alarm] tests/builtins/alloc.c:35: Warning: out of bounds write. assert \valid(u); [eva:alarm] tests/builtins/alloc.c:36: Warning: out of bounds write. assert \valid(u + 1); [kernel] tests/builtins/alloc.c:36: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/builtins/alloc.c:37: Warning: out of bounds write. assert \valid(u + 1); [kernel] tests/builtins/alloc.c:37: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/builtins/alloc.c:40: Warning: out of bounds write. assert \valid(v + 1); [eva:alarm] tests/builtins/alloc.c:41: Warning: out of bounds write. assert \valid(v + 1); [eva:alarm] tests/builtins/alloc.c:42: Warning: out of bounds write. assert \valid(v + 2); [kernel] tests/builtins/alloc.c:42: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/builtins/alloc.c:43: Warning: out of bounds write. assert \valid(v + 2); [kernel] tests/builtins/alloc.c:43: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/builtins/alloc.c:18: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/alloc.c:19: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/alloc.c:20: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/alloc.c:21: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/alloc.c:36: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/alloc.c:37: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/alloc.c:42: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/alloc.c:43: assertion 'Eva,mem_access' got final status invalid. [scope:rm_asserts] removing 2 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p ∈ {{ &__malloc_main_l16 }} q ∈ {{ &__malloc_main_l25 }} r ∈ {{ garbled mix of &{__malloc_main_l25} (origin: Arithmetic {tests/builtins/alloc.c:26}) }} a ∈ {1} t ∈ {{ &__malloc_main_l17[0] }} u ∈ {{ &__malloc_main_l32[0] }} v ∈ {{ &__malloc_main_l33[0] }} c ∈ [--..--] __malloc_main_l16 ∈ {107} __malloc_main_l17[0] ∈ {111} [1..8] ∈ UNINITIALIZED [9] ∈ {111} __malloc_main_l25 ∈ {1} __malloc_main_l32[0] ∈ {33} __malloc_main_l33[0] ∈ {35} [1] ∈ {36} [from] Computing for function main [from] Computing for function Frama_C_malloc_fresh <-main [from] Done for function Frama_C_malloc_fresh [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_malloc_fresh: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function main: __fc_heap_status FROM __fc_heap_status; d (and SELF) p FROM __fc_heap_status q FROM __fc_heap_status r FROM __fc_heap_status a FROM __fc_heap_status; c t FROM __fc_heap_status u FROM __fc_heap_status; d v FROM __fc_heap_status; d __malloc_main_l16 FROM __fc_heap_status __malloc_main_l17{[0]; [9]} FROM __fc_heap_status __malloc_main_l25 FROM __fc_heap_status; c __malloc_main_l32[0] FROM __fc_heap_status; d __malloc_main_l33[0..1] FROM __fc_heap_status; d [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; p; q; r; a; t; u; v; c; tmp; tmp_0; tmp_1; tmp_2; tmp_3; tmp_4; __malloc_main_l16; __malloc_main_l17{[0]; [9]}; __malloc_main_l25; __malloc_main_l32[0]; __malloc_main_l33[0..1] [inout] Inputs for function main: __fc_heap_status; p; q; r; t; u; v; ch; __malloc_main_l25 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/alloc.1.res.oracle���������������������������������������0000666�0000000�0000000�00000005260�13571573400�020666� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/alloc.c (with preprocessing) [eva] Analyzing a complete application starting at main_abs [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 2048 to 4103] ∈ [--..--] p ∈ {0} q ∈ {0} r ∈ {0} a ∈ {0} b ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} ch ∈ {44} [eva] tests/builtins/alloc.c:50: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/alloc.c:50: allocating variable __malloc_main_abs_l50 [eva:alarm] tests/builtins/alloc.c:51: Warning: signed overflow. assert -2147483648 ≤ -((int)q); [eva:alarm] tests/builtins/alloc.c:51: Warning: signed overflow. assert -((int)q) ≤ 2147483647; [eva] tests/builtins/alloc.c:51: Assigning imprecise value to r. The imprecision originates from Arithmetic {tests/builtins/alloc.c:51} [eva:alarm] tests/builtins/alloc.c:54: Warning: out of bounds write. assert \valid(r); [eva:alarm] tests/builtins/alloc.c:56: Warning: signed overflow. assert -2147483648 ≤ *q + 1; [eva:alarm] tests/builtins/alloc.c:56: Warning: signed overflow. assert *q + 1 ≤ 2147483647; [eva] Recording results for main_abs [eva] done for function main_abs [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main_abs: NULL[rbits 2048 to 4103] ∈ {{ garbled mix of &{__malloc_main_abs_l50} (origin: Misaligned {tests/builtins/alloc.c:54}) }} __fc_heap_status ∈ [--..--] q ∈ {{ &__malloc_main_abs_l50 }} r ∈ {{ NULL + [256..509] ; &__malloc_main_abs_l50 }} a ∈ {{ NULL + [1..510] ; &__malloc_main_abs_l50 + {1} }} __malloc_main_abs_l50 ∈ {{ NULL + [1..510] ; &__malloc_main_abs_l50 + {1} }} [from] Computing for function main_abs [from] Computing for function Frama_C_malloc_fresh <-main_abs [from] Done for function Frama_C_malloc_fresh [from] Done for function main_abs [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_malloc_fresh: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function main_abs: NULL{[256..259]; [264..512]} FROM __fc_heap_status (and SELF) [260..263] FROM __fc_heap_status __fc_heap_status FROM __fc_heap_status (and SELF) q FROM __fc_heap_status r FROM __fc_heap_status a FROM __fc_heap_status __malloc_main_abs_l50 FROM __fc_heap_status [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main_abs: NULL[256..512]; __fc_heap_status; q; r; a; __malloc_main_abs_l50 [inout] Inputs for function main_abs: __fc_heap_status; q; r; __malloc_main_abs_l50 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/alloc_weak.res.oracle������������������������������������0000666�0000000�0000000�00000053566�13571573400�021552� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/alloc_weak.c (with preprocessing) [kernel:typing:int-conversion] tests/builtins/alloc_weak.c:37: Warning: Conversion from a pointer to an integer without an explicit cast [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/builtins/alloc_weak.c:72. [eva] tests/builtins/alloc_weak.c:23: Call to builtin malloc [eva] tests/builtins/alloc_weak.c:23: allocating variable __malloc_main1_l23 [eva] tests/builtins/alloc_weak.c:23: Call to builtin malloc [eva:malloc:weak] tests/builtins/alloc_weak.c:23: marking variable `__malloc_main1_l23' as weak [eva] computing for function copy <- main1 <- main. Called from tests/builtins/alloc_weak.c:27. [eva] tests/builtins/alloc_weak.c:14: Call to builtin memcpy [eva] tests/builtins/alloc_weak.c:14: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/alloc_weak.c:14: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/alloc_weak.c:14: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] Recording results for copy [eva] Done for function copy [eva] computing for function copy <- main1 <- main. Called from tests/builtins/alloc_weak.c:28. [eva] tests/builtins/alloc_weak.c:14: Call to builtin memcpy [eva] Recording results for copy [eva] Done for function copy [eva:alarm] tests/builtins/alloc_weak.c:29: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/alloc_weak.c:30: Warning: accessing uninitialized left-value. assert \initialized(p); [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/builtins/alloc_weak.c:73. [eva] tests/builtins/alloc_weak.c:37: Call to builtin malloc [eva] tests/builtins/alloc_weak.c:37: allocating variable __malloc_main2_l37 [eva] tests/builtins/alloc_weak.c:40: Trace partitioning superposing up to 100 states [eva] tests/builtins/alloc_weak.c:40: Trace partitioning superposing up to 200 states [eva] tests/builtins/alloc_weak.c:40: Trace partitioning superposing up to 300 states [eva] tests/builtins/alloc_weak.c:40: Trace partitioning superposing up to 400 states [eva] tests/builtins/alloc_weak.c:40: Trace partitioning superposing up to 500 states [eva] tests/builtins/alloc_weak.c:40: Trace partitioning superposing up to 600 states [eva] tests/builtins/alloc_weak.c:40: Trace partitioning superposing up to 700 states [eva] tests/builtins/alloc_weak.c:40: Trace partitioning superposing up to 800 states [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/builtins/alloc_weak.c:74. [eva] tests/builtins/alloc_weak.c:51: Call to builtin malloc [eva] tests/builtins/alloc_weak.c:51: allocating variable __malloc_main3_l51 [eva] tests/builtins/alloc_weak.c:50: starting to merge loop iterations [eva] tests/builtins/alloc_weak.c:51: Call to builtin malloc [eva:malloc:weak] tests/builtins/alloc_weak.c:51: marking variable `__malloc_main3_l51' as weak [eva] tests/builtins/alloc_weak.c:51: Call to builtin malloc [eva] tests/builtins/alloc_weak.c:51: Call to builtin malloc [eva:alarm] tests/builtins/alloc_weak.c:62: Warning: accessing uninitialized left-value. assert \initialized(&q); [eva:alarm] tests/builtins/alloc_weak.c:62: Warning: accessing uninitialized left-value. assert \initialized(&r); [eva:alarm] tests/builtins/alloc_weak.c:62: Warning: pointer subtraction. assert \base_addr(q) ≡ \base_addr(r); [eva:alarm] tests/builtins/alloc_weak.c:63: Warning: pointer comparison. assert \pointer_comparable((void *)q, (void *)r); [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: __fc_heap_status ∈ [--..--] t[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [10] ∈ {10} [11] ∈ {11} [12] ∈ {12} [13] ∈ {13} [14] ∈ {14} [15] ∈ {15} [16] ∈ {16} [17] ∈ {17} [18] ∈ {18} [19] ∈ {19} [20] ∈ {20} [21] ∈ {21} [22] ∈ {22} [23] ∈ {23} [24] ∈ {24} [25] ∈ {25} [26] ∈ {26} [27] ∈ {27} [28] ∈ {28} [29] ∈ {29} [30] ∈ {30} [31] ∈ {31} [32] ∈ {32} [33] ∈ {33} [34] ∈ {34} [35] ∈ {35} [36] ∈ {36} [37] ∈ {37} [38] ∈ {38} [39] ∈ {39} [40] ∈ {40} [41] ∈ {41} [42] ∈ {42} [43] ∈ {43} [44] ∈ {44} [45] ∈ {45} [46] ∈ {46} [47] ∈ {47} [48] ∈ {48} [49] ∈ {49} [50] ∈ {50} [51] ∈ {51} [52] ∈ {52} [53] ∈ {53} [54] ∈ {54} [55] ∈ {55} [56] ∈ {56} [57] ∈ {57} [58] ∈ {58} [59] ∈ {59} [60] ∈ {60} [61] ∈ {61} [62] ∈ {62} [63] ∈ {63} [64] ∈ {64} [65] ∈ {65} [66] ∈ {66} [67] ∈ {67} [68] ∈ {68} [69] ∈ {69} [70] ∈ {70} [71] ∈ {71} [72] ∈ {72} [73] ∈ {73} [74] ∈ {74} [75] ∈ {75} [76] ∈ {76} [77] ∈ {77} [78] ∈ {78} [79] ∈ {79} [80] ∈ {80} [81] ∈ {81} [82] ∈ {82} [83] ∈ {83} [84] ∈ {84} [85] ∈ {85} [86] ∈ {86} [87] ∈ {87} [88] ∈ {88} [89] ∈ {89} [90] ∈ {90} [91] ∈ {91} [92] ∈ {92} [93] ∈ {93} [94] ∈ {94} [95] ∈ {95} [96] ∈ {96} [97] ∈ {97} [98] ∈ {98} [99] ∈ {99} [100] ∈ {100} [101] ∈ {101} [102] ∈ {102} [103] ∈ {103} [104] ∈ {104} [105] ∈ {105} [106] ∈ {106} [107] ∈ {107} [108] ∈ {108} [109] ∈ {109} [110] ∈ {110} [111] ∈ {111} [112] ∈ {112} [113] ∈ {113} [114] ∈ {114} [115] ∈ {115} [116] ∈ {116} [117] ∈ {117} [118] ∈ {118} [119] ∈ {119} [120] ∈ {120} [121] ∈ {121} [122] ∈ {122} [123] ∈ {123} [124] ∈ {124} [125] ∈ {125} [126] ∈ {126} [127] ∈ {127} [128] ∈ {128} [129] ∈ {129} [130] ∈ {130} [131] ∈ {131} [132] ∈ {132} [133] ∈ {133} [134] ∈ {134} [135] ∈ {135} [136] ∈ {136} [137] ∈ {137} [138] ∈ {138} [139] ∈ {139} [140] ∈ {140} [141] ∈ {141} [142] ∈ {142} [143] ∈ {143} [144] ∈ {144} [145] ∈ {145} [146] ∈ {146} [147] ∈ {147} [148] ∈ {148} [149] ∈ {149} [150] ∈ {150} [151] ∈ {151} [152] ∈ {152} [153] ∈ {153} [154] ∈ {154} [155] ∈ {155} [156] ∈ {156} [157] ∈ {157} [158] ∈ {158} [159] ∈ {159} [160] ∈ {160} [161] ∈ {161} [162] ∈ {162} [163] ∈ {163} [164] ∈ {164} [165] ∈ {165} [166] ∈ {166} [167] ∈ {167} [168] ∈ {168} [169] ∈ {169} [170] ∈ {170} [171] ∈ {171} [172] ∈ {172} [173] ∈ {173} [174] ∈ {174} [175] ∈ {175} [176] ∈ {176} [177] ∈ {177} [178] ∈ {178} [179] ∈ {179} [180] ∈ {180} [181] ∈ {181} [182] ∈ {182} [183] ∈ {183} [184] ∈ {184} [185] ∈ {185} [186] ∈ {186} [187] ∈ {187} [188] ∈ {188} [189] ∈ {189} [190] ∈ {190} [191] ∈ {191} [192] ∈ {192} [193] ∈ {193} [194] ∈ {194} [195] ∈ {195} [196] ∈ {196} [197] ∈ {197} [198] ∈ {198} [199] ∈ {199} [200] ∈ {200} [201] ∈ {201} [202] ∈ {202} [203] ∈ {203} [204] ∈ {204} [205] ∈ {205} [206] ∈ {206} [207] ∈ {207} [208] ∈ {208} [209] ∈ {209} [210] ∈ {210} [211] ∈ {211} [212] ∈ {212} [213] ∈ {213} [214] ∈ {214} [215] ∈ {215} [216] ∈ {216} [217] ∈ {217} [218] ∈ {218} [219] ∈ {219} [220] ∈ {220} [221] ∈ {221} [222] ∈ {222} [223] ∈ {223} [224] ∈ {224} [225] ∈ {225} [226] ∈ {226} [227] ∈ {227} [228] ∈ {228} [229] ∈ {229} [230] ∈ {230} [231] ∈ {231} [232] ∈ {232} [233] ∈ {233} [234] ∈ {234} [235] ∈ {235} [236] ∈ {236} [237] ∈ {237} [238] ∈ {238} [239] ∈ {239} [240] ∈ {240} [241] ∈ {241} [242] ∈ {242} [243] ∈ {243} [244] ∈ {244} [245] ∈ {245} [246] ∈ {246} [247] ∈ {247} [248] ∈ {248} [249] ∈ {249} [250] ∈ {250} [251] ∈ {251} [252] ∈ {252} [253] ∈ {253} [254] ∈ {254} [255] ∈ {255} [256] ∈ {256} [257] ∈ {257} [258] ∈ {258} [259] ∈ {259} [260] ∈ {260} [261] ∈ {261} [262] ∈ {262} [263] ∈ {263} [264] ∈ {264} [265] ∈ {265} [266] ∈ {266} [267] ∈ {267} [268] ∈ {268} [269] ∈ {269} [270] ∈ {270} [271] ∈ {271} [272] ∈ {272} [273] ∈ {273} [274] ∈ {274} [275] ∈ {275} [276] ∈ {276} [277] ∈ {277} [278] ∈ {278} [279] ∈ {279} [280] ∈ {280} [281] ∈ {281} [282] ∈ {282} [283] ∈ {283} [284] ∈ {284} [285] ∈ {285} [286] ∈ {286} [287] ∈ {287} [288] ∈ {288} [289] ∈ {289} [290] ∈ {290} [291] ∈ {291} [292] ∈ {292} [293] ∈ {293} [294] ∈ {294} [295] ∈ {295} [296] ∈ {296} [297] ∈ {297} [298] ∈ {298} [299] ∈ {299} [300] ∈ {300} [301] ∈ {301} [302] ∈ {302} [303] ∈ {303} [304] ∈ {304} [305] ∈ {305} [306] ∈ {306} [307] ∈ {307} [308] ∈ {308} [309] ∈ {309} [310] ∈ {310} [311] ∈ {311} [312] ∈ {312} [313] ∈ {313} [314] ∈ {314} [315] ∈ {315} [316] ∈ {316} [317] ∈ {317} [318] ∈ {318} [319] ∈ {319} [320] ∈ {320} [321] ∈ {321} [322] ∈ {322} [323] ∈ {323} [324] ∈ {324} [325] ∈ {325} [326] ∈ {326} [327] ∈ {327} [328] ∈ {328} [329] ∈ {329} [330] ∈ {330} [331] ∈ {331} [332] ∈ {332} [333] ∈ {333} [334] ∈ {334} [335] ∈ {335} [336] ∈ {336} [337] ∈ {337} [338] ∈ {338} [339] ∈ {339} [340] ∈ {340} [341] ∈ {341} [342] ∈ {342} [343] ∈ {343} [344] ∈ {344} [345] ∈ {345} [346] ∈ {346} [347] ∈ {347} [348] ∈ {348} [349] ∈ {349} [350] ∈ {350} [351] ∈ {351} [352] ∈ {352} [353] ∈ {353} [354] ∈ {354} [355] ∈ {355} [356] ∈ {356} [357] ∈ {357} [358] ∈ {358} [359] ∈ {359} [360] ∈ {360} [361] ∈ {361} [362] ∈ {362} [363] ∈ {363} [364] ∈ {364} [365] ∈ {365} [366] ∈ {366} [367] ∈ {367} [368] ∈ {368} [369] ∈ {369} [370] ∈ {370} [371] ∈ {371} [372] ∈ {372} [373] ∈ {373} [374] ∈ {374} [375] ∈ {375} [376] ∈ {376} [377] ∈ {377} [378] ∈ {378} [379] ∈ {379} [380] ∈ {380} [381] ∈ {381} [382] ∈ {382} [383] ∈ {383} [384] ∈ {384} [385] ∈ {385} [386] ∈ {386} [387] ∈ {387} [388] ∈ {388} [389] ∈ {389} [390] ∈ {390} [391] ∈ {391} [392] ∈ {392} [393] ∈ {393} [394] ∈ {394} [395] ∈ {395} [396] ∈ {396} [397] ∈ {397} [398] ∈ {398} [399] ∈ {399} [400] ∈ {400} [401] ∈ {401} [402] ∈ {402} [403] ∈ {403} [404] ∈ {404} [405] ∈ {405} [406] ∈ {406} [407] ∈ {407} [408] ∈ {408} [409] ∈ {409} [410] ∈ {410} [411] ∈ {411} [412] ∈ {412} [413] ∈ {413} [414] ∈ {414} [415] ∈ {415} [416] ∈ {416} [417] ∈ {417} [418] ∈ {418} [419] ∈ {419} [420] ∈ {420} [421] ∈ {421} [422] ∈ {422} [423] ∈ {423} [424] ∈ {424} [425] ∈ {425} [426] ∈ {426} [427] ∈ {427} [428] ∈ {428} [429] ∈ {429} [430] ∈ {430} [431] ∈ {431} [432] ∈ {432} [433] ∈ {433} [434] ∈ {434} [435] ∈ {435} [436] ∈ {436} [437] ∈ {437} [438] ∈ {438} [439] ∈ {439} [440] ∈ {440} [441] ∈ {441} [442] ∈ {442} [443] ∈ {443} [444] ∈ {444} [445] ∈ {445} [446] ∈ {446} [447] ∈ {447} [448] ∈ {448} [449] ∈ {449} [450] ∈ {450} [451] ∈ {451} [452] ∈ {452} [453] ∈ {453} [454] ∈ {454} [455] ∈ {455} [456] ∈ {456} [457] ∈ {457} [458] ∈ {458} [459] ∈ {459} [460] ∈ {460} [461] ∈ {461} [462] ∈ {462} [463] ∈ {463} [464] ∈ {464} [465] ∈ {465} [466] ∈ {466} [467] ∈ {467} [468] ∈ {468} [469] ∈ {469} [470] ∈ {470} [471] ∈ {471} [472] ∈ {472} [473] ∈ {473} [474] ∈ {474} [475] ∈ {475} [476] ∈ {476} [477] ∈ {477} [478] ∈ {478} [479] ∈ {479} [480] ∈ {480} [481] ∈ {481} [482] ∈ {482} [483] ∈ {483} [484] ∈ {484} [485] ∈ {485} [486] ∈ {486} [487] ∈ {487} [488] ∈ {488} [489] ∈ {489} [490] ∈ {490} [491] ∈ {491} [492] ∈ {492} [493] ∈ {493} [494] ∈ {494} [495] ∈ {495} [496] ∈ {496} [497] ∈ {497} [498] ∈ {498} [499] ∈ {499} [500] ∈ {500} [501] ∈ {501} [502] ∈ {502} [503] ∈ {503} [504] ∈ {504} [505] ∈ {505} [506] ∈ {506} [507] ∈ {507} [508] ∈ {508} [509] ∈ {509} [510] ∈ {510} [511] ∈ {511} [512] ∈ {512} [513] ∈ {513} [514] ∈ {514} [515] ∈ {515} [516] ∈ {516} [517] ∈ {517} [518] ∈ {518} [519] ∈ {519} [520] ∈ {520} [521] ∈ {521} [522] ∈ {522} [523] ∈ {523} [524] ∈ {524} [525] ∈ {525} [526] ∈ {526} [527] ∈ {527} [528] ∈ {528} [529] ∈ {529} [530] ∈ {530} [531] ∈ {531} [532] ∈ {532} [533] ∈ {533} [534] ∈ {534} [535] ∈ {535} [536] ∈ {536} [537] ∈ {537} [538] ∈ {538} [539] ∈ {539} [540] ∈ {540} [541] ∈ {541} [542] ∈ {542} [543] ∈ {543} [544] ∈ {544} [545] ∈ {545} [546] ∈ {546} [547] ∈ {547} [548] ∈ {548} [549] ∈ {549} [550] ∈ {550} [551] ∈ {551} [552] ∈ {552} [553] ∈ {553} [554] ∈ {554} [555] ∈ {555} [556] ∈ {556} [557] ∈ {557} [558] ∈ {558} [559] ∈ {559} [560] ∈ {560} [561] ∈ {561} [562] ∈ {562} [563] ∈ {563} [564] ∈ {564} [565] ∈ {565} [566] ∈ {566} [567] ∈ {567} [568] ∈ {568} [569] ∈ {569} [570] ∈ {570} [571] ∈ {571} [572] ∈ {572} [573] ∈ {573} [574] ∈ {574} [575] ∈ {575} [576] ∈ {576} [577] ∈ {577} [578] ∈ {578} [579] ∈ {579} [580] ∈ {580} [581] ∈ {581} [582] ∈ {582} [583] ∈ {583} [584] ∈ {584} [585] ∈ {585} [586] ∈ {586} [587] ∈ {587} [588] ∈ {588} [589] ∈ {589} [590] ∈ {590} [591] ∈ {591} [592] ∈ {592} [593] ∈ {593} [594] ∈ {594} [595] ∈ {595} [596] ∈ {596} [597] ∈ {597} [598] ∈ {598} [599] ∈ {599} [600] ∈ {600} [601] ∈ {601} [602] ∈ {602} [603] ∈ {603} [604] ∈ {604} [605] ∈ {605} [606] ∈ {606} [607] ∈ {607} [608] ∈ {608} [609] ∈ {609} [610] ∈ {610} [611] ∈ {611} [612] ∈ {612} [613] ∈ {613} [614] ∈ {614} [615] ∈ {615} [616] ∈ {616} [617] ∈ {617} [618] ∈ {618} [619] ∈ {619} [620] ∈ {620} [621] ∈ {621} [622] ∈ {622} [623] ∈ {623} [624] ∈ {624} [625] ∈ {625} [626] ∈ {626} [627] ∈ {627} [628] ∈ {628} [629] ∈ {629} [630] ∈ {630} [631] ∈ {631} [632] ∈ {632} [633] ∈ {633} [634] ∈ {634} [635] ∈ {635} [636] ∈ {636} [637] ∈ {637} [638] ∈ {638} [639] ∈ {639} [640] ∈ {640} [641] ∈ {641} [642] ∈ {642} [643] ∈ {643} [644] ∈ {644} [645] ∈ {645} [646] ∈ {646} [647] ∈ {647} [648] ∈ {648} [649] ∈ {649} [650] ∈ {650} [651] ∈ {651} [652] ∈ {652} [653] ∈ {653} [654] ∈ {654} [655] ∈ {655} [656] ∈ {656} [657] ∈ {657} [658] ∈ {658} [659] ∈ {659} [660] ∈ {660} [661] ∈ {661} [662] ∈ {662} [663] ∈ {663} [664] ∈ {664} [665] ∈ {665} [666] ∈ {666} [667] ∈ {667} [668] ∈ {668} [669] ∈ {669} [670] ∈ {670} [671] ∈ {671} [672] ∈ {672} [673] ∈ {673} [674] ∈ {674} [675] ∈ {675} [676] ∈ {676} [677] ∈ {677} [678] ∈ {678} [679] ∈ {679} [680] ∈ {680} [681] ∈ {681} [682] ∈ {682} [683] ∈ {683} [684] ∈ {684} [685] ∈ {685} [686] ∈ {686} [687] ∈ {687} [688] ∈ {688} [689] ∈ {689} [690] ∈ {690} [691] ∈ {691} [692] ∈ {692} [693] ∈ {693} [694] ∈ {694} [695] ∈ {695} [696] ∈ {696} [697] ∈ {697} [698] ∈ {698} [699] ∈ {699} [700] ∈ {700} [701] ∈ {701} [702] ∈ {702} [703] ∈ {703} [704] ∈ {704} [705] ∈ {705} [706] ∈ {706} [707] ∈ {707} [708] ∈ {708} [709] ∈ {709} [710] ∈ {710} [711] ∈ {711} [712] ∈ {712} [713] ∈ {713} [714] ∈ {714} [715] ∈ {715} [716] ∈ {716} [717] ∈ {717} [718] ∈ {718} [719] ∈ {719} [720] ∈ {720} [721] ∈ {721} [722] ∈ {722} [723] ∈ {723} [724] ∈ {724} [725] ∈ {725} [726] ∈ {726} [727] ∈ {727} [728] ∈ {728} [729] ∈ {729} [730] ∈ {730} [731] ∈ {731} [732] ∈ {732} [733] ∈ {733} [734] ∈ {734} [735] ∈ {735} [736] ∈ {736} [737] ∈ {737} [738] ∈ {738} [739] ∈ {739} [740] ∈ {740} [741] ∈ {741} [742] ∈ {742} [743] ∈ {743} [744] ∈ {744} [745] ∈ {745} [746] ∈ {746} [747] ∈ {747} [748] ∈ {748} [749] ∈ {749} [750] ∈ {750} [751] ∈ {751} [752] ∈ {752} [753] ∈ {753} [754] ∈ {754} [755] ∈ {755} [756] ∈ {756} [757] ∈ {757} [758] ∈ {758} [759] ∈ {759} [760] ∈ {760} [761] ∈ {761} [762] ∈ {762} [763] ∈ {763} [764] ∈ {764} [765] ∈ {765} [766] ∈ {766} [767] ∈ {767} [768] ∈ {768} [769] ∈ {769} [770] ∈ {770} [771] ∈ {771} [772] ∈ {772} [773] ∈ {773} [774] ∈ {774} [775] ∈ {775} [776] ∈ {776} [777] ∈ {777} [778] ∈ {778} [779] ∈ {779} [780] ∈ {780} [781] ∈ {781} [782] ∈ {782} [783] ∈ {783} [784] ∈ {784} [785] ∈ {785} [786] ∈ {786} [787] ∈ {787} [788] ∈ {788} [789] ∈ {789} [790] ∈ {790} [791] ∈ {791} [792] ∈ {792} [793] ∈ {793} [794] ∈ {794} [795] ∈ {795} [796] ∈ {796} [797] ∈ {797} [798] ∈ {798} [799] ∈ {799} [800..999] ∈ UNINITIALIZED i ∈ {800} [eva:final-states] Values at end of function main3: __fc_heap_status ∈ [--..--] p ∈ {{ &__malloc_w_main3_l51 }} or UNINITIALIZED q ∈ {{ &__malloc_w_main3_l51 }} r ∈ {{ &__malloc_w_main3_l51 }} d ∈ {0} cmp ∈ {0; 1} eq ∈ {0; 1} [eva:final-states] Values at end of function copy: dst ∈ {{ (char *)&p }} src ∈ {{ (char *)&t{[0], [1]} }} p[bits 0 to 7]# ∈ {{ (? *)&__malloc_w_main1_l23 }}%32, bits 0 to 7 [bits 8 to 31]# ∈ {{ (? *)&__malloc_w_main1_l23 }} or UNINITIALIZED%32, bits 8 to 31 [eva:final-states] Values at end of function main1: __fc_heap_status ∈ [--..--] t[0..1] ∈ {{ &__malloc_w_main1_l23[0] }} p ∈ {{ &__malloc_w_main1_l23 + [0..124] }} n ∈ {4} r ∈ [--..--] __malloc_w_main1_l23[0..31] ∈ [--..--] or UNINITIALIZED [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] __malloc_w_main1_l23[0..31] ∈ [--..--] or UNINITIALIZED [from] Computing for function main2 [from] Computing for function malloc <-main2 [from] Done for function malloc [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function copy [from] Computing for function memcpy <-copy [from] Done for function memcpy [from] Done for function copy [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function main2: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function main3: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function memcpy: p FROM t{[0][bits 8 to 31]; [1][bits 0 to 23]} (and SELF) \result FROM dest [from] Function copy: p FROM t{[0][bits 8 to 31]; [1][bits 0 to 23]} (and SELF) [from] Function main1: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_w_main1_l23[0..31] FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status; __malloc_w_main1_l23[0..31] [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_w_main1_l23[0..31] FROM __fc_heap_status (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: __fc_heap_status; t[0..799]; i; tmp [inout] Inputs for function main2: __fc_heap_status [inout] Out (internal) for function main3: __fc_heap_status; p; q; r; i; d; cmp; eq [inout] Inputs for function main3: __fc_heap_status [inout] Out (internal) for function copy: dst; src; p [inout] Inputs for function copy: t[0..1] [inout] Out (internal) for function main1: __fc_heap_status; t[0..1]; i; p; n; r; __malloc_w_main1_l23[0..31] [inout] Inputs for function main1: __fc_heap_status; __malloc_w_main1_l23[0..31] [inout] Out (internal) for function main: __fc_heap_status; __malloc_w_main1_l23[0..31] [inout] Inputs for function main: __fc_heap_status; __malloc_w_main1_l23[0..31] ������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/allocated.0.res.oracle�����������������������������������0000666�0000000�0000000�00000040767�13571573400�021536� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/allocated.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] tests/builtins/allocated.c:25: Call to builtin malloc [eva] tests/builtins/allocated.c:25: allocating variable __malloc_main_l25 [eva] tests/builtins/allocated.c:25: assertion got status valid. [eva:alarm] tests/builtins/allocated.c:27: Warning: out of bounds read. assert \valid_read(p + 1); [eva:alarm] tests/builtins/allocated.c:28: Warning: out of bounds read. assert \valid_read(p + 2); [eva] tests/builtins/allocated.c:29: Frama_C_show_each_p: {{ &__malloc_main_l25 }} [eva] tests/builtins/allocated.c:30: Frama_C_show_each_p0: {18} [eva] tests/builtins/allocated.c:31: Call to builtin free [eva] tests/builtins/allocated.c:31: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:31: strong free on bases: {__malloc_main_l25} [eva] tests/builtins/allocated.c:32: Frama_C_show_each_p_after_free: Bottom [eva] tests/builtins/allocated.c:36: Call to builtin malloc [eva] tests/builtins/allocated.c:36: allocating variable __malloc_main_l36 [eva] tests/builtins/allocated.c:36: assertion got status valid. [eva] tests/builtins/allocated.c:40: Frama_C_show_each_p: {{ &__malloc_main_l36 }} [eva] tests/builtins/allocated.c:41: Frama_C_show_each_p0: {13} [eva] tests/builtins/allocated.c:42: Frama_C_show_each_p1: {54} [eva] tests/builtins/allocated.c:43: Call to builtin free [eva] tests/builtins/allocated.c:43: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:43: strong free on bases: {__malloc_main_l36} [eva:alarm] tests/builtins/allocated.c:44: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [eva] tests/builtins/allocated.c:45: Call to builtin free [eva] tests/builtins/allocated.c:45: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:45: strong free on bases: {__malloc_main_l36} [eva:alarm] tests/builtins/allocated.c:46: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [kernel] tests/builtins/allocated.c:46: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/allocated.c:50: Call to builtin malloc [eva] tests/builtins/allocated.c:50: allocating variable __malloc_main_l50 [eva] tests/builtins/allocated.c:50: assertion got status valid. [eva:alarm] tests/builtins/allocated.c:53: Warning: out of bounds write. assert \valid(p + 2); [eva] tests/builtins/allocated.c:54: Frama_C_show_each_p: {{ &__malloc_main_l50 }} [eva] tests/builtins/allocated.c:55: Frama_C_show_each_p0: {13} [eva] tests/builtins/allocated.c:56: Frama_C_show_each_p1: {42} [eva] tests/builtins/allocated.c:57: Frama_C_show_each_p2: {77} [eva] tests/builtins/allocated.c:58: Call to builtin free [eva] tests/builtins/allocated.c:58: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:58: strong free on bases: {__malloc_main_l50} [eva] tests/builtins/allocated.c:63: Call to builtin malloc [eva] tests/builtins/allocated.c:63: allocating variable __malloc_main_l63 [eva] tests/builtins/allocated.c:63: assertion got status valid. [eva] tests/builtins/allocated.c:65: Frama_C_show_each_p: {{ &__malloc_main_l63 }} [eva] tests/builtins/allocated.c:66: Frama_C_show_each_p0: {0} [eva] tests/builtins/allocated.c:67: Call to builtin free [eva] tests/builtins/allocated.c:67: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:67: strong free on bases: {__malloc_main_l63} [eva] tests/builtins/allocated.c:63: Call to builtin malloc [eva] tests/builtins/allocated.c:65: Frama_C_show_each_p: {{ &__malloc_main_l63 }} [eva] tests/builtins/allocated.c:66: Frama_C_show_each_p0: {1} [eva] tests/builtins/allocated.c:67: Call to builtin free [eva:malloc] tests/builtins/allocated.c:67: strong free on bases: {__malloc_main_l63} [eva] tests/builtins/allocated.c:63: Call to builtin malloc [eva] tests/builtins/allocated.c:65: Frama_C_show_each_p: {{ &__malloc_main_l63 }} [eva] tests/builtins/allocated.c:66: Frama_C_show_each_p0: {2} [eva] tests/builtins/allocated.c:67: Call to builtin free [eva:malloc] tests/builtins/allocated.c:67: strong free on bases: {__malloc_main_l63} [eva] tests/builtins/allocated.c:63: Call to builtin malloc [eva] tests/builtins/allocated.c:65: Frama_C_show_each_p: {{ &__malloc_main_l63 }} [eva] tests/builtins/allocated.c:66: Frama_C_show_each_p0: {3} [eva] tests/builtins/allocated.c:67: Call to builtin free [eva:malloc] tests/builtins/allocated.c:67: strong free on bases: {__malloc_main_l63} [eva] tests/builtins/allocated.c:73: Call to builtin malloc [eva] tests/builtins/allocated.c:73: allocating variable __malloc_main_l73 [eva] tests/builtins/allocated.c:75: Frama_C_show_each_p: {{ &__malloc_main_l73 }} [eva] tests/builtins/allocated.c:76: Frama_C_show_each_p0: {0} [eva] tests/builtins/allocated.c:77: Call to builtin free [eva] tests/builtins/allocated.c:77: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:77: strong free on bases: {__malloc_main_l73} [eva] tests/builtins/allocated.c:73: Call to builtin malloc [eva] tests/builtins/allocated.c:75: Frama_C_show_each_p: {{ &__malloc_main_l73 }} [eva] tests/builtins/allocated.c:76: Frama_C_show_each_p0: {1} [eva] tests/builtins/allocated.c:77: Call to builtin free [eva:malloc] tests/builtins/allocated.c:77: strong free on bases: {__malloc_main_l73} [eva] tests/builtins/allocated.c:72: starting to merge loop iterations [eva] tests/builtins/allocated.c:73: Call to builtin malloc [eva] tests/builtins/allocated.c:75: Frama_C_show_each_p: {{ &__malloc_main_l73 }} [eva] tests/builtins/allocated.c:76: Frama_C_show_each_p0: {1; 2} [eva] tests/builtins/allocated.c:77: Call to builtin free [eva:malloc] tests/builtins/allocated.c:77: strong free on bases: {__malloc_main_l73} [eva] tests/builtins/allocated.c:73: Call to builtin malloc [eva] tests/builtins/allocated.c:75: Frama_C_show_each_p: {{ &__malloc_main_l73 }} [eva] tests/builtins/allocated.c:76: Frama_C_show_each_p0: {1; 2; 3} [eva] tests/builtins/allocated.c:77: Call to builtin free [eva:malloc] tests/builtins/allocated.c:77: strong free on bases: {__malloc_main_l73} [eva] tests/builtins/allocated.c:82: Call to builtin malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82 [eva] tests/builtins/allocated.c:82: assertion got status valid. [eva] tests/builtins/allocated.c:87: Call to builtin free [eva] tests/builtins/allocated.c:87: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82} [eva] tests/builtins/allocated.c:82: Call to builtin malloc [eva:malloc:weak] tests/builtins/allocated.c:82: marking variable `__malloc_main_l82' as weak [eva:malloc] tests/builtins/allocated.c:82: resizing variable `__malloc_w_main_l82' (0..-1) to fit 0..31 [eva:alarm] tests/builtins/allocated.c:85: Warning: out of bounds write. assert \valid(p + j); [eva] tests/builtins/allocated.c:84: starting to merge loop iterations [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: weak free on bases: {__malloc_w_main_l82} [eva] tests/builtins/allocated.c:81: starting to merge loop iterations [eva] tests/builtins/allocated.c:82: Call to builtin malloc [eva:malloc] tests/builtins/allocated.c:82: resizing variable `__malloc_w_main_l82' (0..-1/31) to fit 0..31/63 [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: weak free on bases: {__malloc_w_main_l82} [eva] tests/builtins/allocated.c:82: Call to builtin malloc [eva:malloc] tests/builtins/allocated.c:82: resizing variable `__malloc_w_main_l82' (0..-1/63) to fit 0..31/95 [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: weak free on bases: {__malloc_w_main_l82} [eva] tests/builtins/allocated.c:82: Call to builtin malloc [eva:malloc] tests/builtins/allocated.c:82: resizing variable `__malloc_w_main_l82' (0..-1/95) to fit 0..31/95 [eva] tests/builtins/allocated.c:91: Call to builtin malloc [eva] tests/builtins/allocated.c:91: allocating variable __malloc_main_l91 [eva] tests/builtins/allocated.c:91: assertion got status valid. [eva] tests/builtins/allocated.c:92: Call to builtin free [eva] tests/builtins/allocated.c:92: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:92: strong free on bases: {__malloc_main_l91} [eva:alarm] tests/builtins/allocated.c:96: Warning: assertion 'Assume' got status unknown. [eva] tests/builtins/allocated.c:97: Call to builtin malloc [eva] tests/builtins/allocated.c:97: allocating variable __malloc_main_l97 [eva] tests/builtins/allocated.c:97: Frama_C_show_each: {{ &__malloc_main_l97 }} [eva:alarm] tests/builtins/allocated.c:98: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/allocated.c:110: Frama_C_show_each: {0} [eva] tests/builtins/allocated.c:111: Call to builtin free [eva] tests/builtins/allocated.c:111: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:111: strong free on bases: {__malloc_main_l97} [eva:alarm] tests/builtins/allocated.c:113: Warning: assertion got status unknown. [eva] tests/builtins/allocated.c:114: Call to builtin malloc [eva] tests/builtins/allocated.c:114: allocating variable __malloc_main_l114 [eva] tests/builtins/allocated.c:114: Frama_C_show_each: {{ &__malloc_main_l114 }} [eva:alarm] tests/builtins/allocated.c:115: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/allocated.c:117: Frama_C_show_each: {0} [eva] tests/builtins/allocated.c:118: Call to builtin free [eva] tests/builtins/allocated.c:118: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:118: strong free on bases: {__malloc_main_l114} [eva] tests/builtins/allocated.c:120: Call to builtin malloc [eva] tests/builtins/allocated.c:120: allocating variable __malloc_main_l120 [eva] tests/builtins/allocated.c:120: Frama_C_show_each: {{ &__malloc_main_l120 }} [eva] tests/builtins/allocated.c:123: Frama_C_show_each: Bottom [eva] tests/builtins/allocated.c:125: Call to builtin free [eva] tests/builtins/allocated.c:125: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:125: strong free on bases: {__malloc_main_l120} [eva] tests/builtins/allocated.c:127: assertion 'alloca_bounds' got status valid. [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {0} [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127} [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/allocated.c:127: resizing variable `__malloc_main_l127' (0..31) to fit 0..63 [eva] tests/builtins/allocated.c:128: starting to merge loop iterations [eva:alarm] tests/builtins/allocated.c:129: Warning: out of bounds write. assert \valid(a + j); [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {0; 1} [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127} [eva] tests/builtins/allocated.c:126: starting to merge loop iterations [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/allocated.c:127: resizing variable `__malloc_main_l127' (0..31/63) to fit 0..63/95 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {0; 1; 2} [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127} [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/allocated.c:127: resizing variable `__malloc_main_l127' (0..31/95) to fit 0..63/127 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: [0..2147483647] [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127} [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/allocated.c:127: resizing variable `__malloc_main_l127' (0..31/127) to fit 0..63/159 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: [0..2147483647] [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127} [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/allocated.c:127: resizing variable `__malloc_main_l127' (0..31/159) to fit 0..63/191 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: [0..2147483647] [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127} [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/allocated.c:127: resizing variable `__malloc_main_l127' (0..31/191) to fit 0..63/319 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: [0..2147483647] [eva] tests/builtins/allocated.c:127: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127} [eva] Recording results for main [eva] done for function main [eva] tests/builtins/allocated.c:27: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/allocated.c:28: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/allocated.c:46: assertion 'Eva,dangling_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] i ∈ {10} j ∈ [1..2147483647] p ∈ ESCAPINGADDR k ∈ {8; 12} size ∈ [1..100] pb ∈ ESCAPINGADDR __retres ∈ {0} __malloc_w_main_l82[0..1] ∈ [7..2147483647] or UNINITIALIZED [2] ∈ [7..27] or UNINITIALIZED [from] Computing for function main [from] Computing for function malloc <-main [from] Done for function malloc [from] Computing for function free <-main [from] Done for function free [from] Computing for function __fc_vla_alloc <-main [from] Done for function __fc_vla_alloc [from] Computing for function __fc_vla_free <-main [from] Done for function __fc_vla_free [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function __fc_vla_alloc: \result FROM \nothing [from] Function __fc_vla_free: NO EFFECTS [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function main: __fc_heap_status FROM __fc_heap_status; nondet (and SELF) __malloc_main_l25 FROM __fc_heap_status __malloc_main_l36[0..1] FROM __fc_heap_status; nondet __malloc_main_l50[0..2] FROM __fc_heap_status; nondet __malloc_main_l63 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l73 FROM __fc_heap_status; nondet (and SELF) __malloc_w_main_l82[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l97[0] FROM __fc_heap_status; nondet __malloc_main_l114[0..3] FROM __fc_heap_status; nondet __malloc_main_l127[0..9] FROM \nothing (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; i; j; p; tmp; tmp_3; k; tmp_0; size; pb; a; __lengthof_a; __retres; __malloc_main_l25; __malloc_main_l36[0..1]; __malloc_main_l50[0..2]; __malloc_main_l63; __malloc_main_l73; __malloc_w_main_l82[0..2]; __malloc_main_l97[0]; __malloc_main_l114[0..3]; __malloc_main_l127[0..9] [inout] Inputs for function main: __fc_heap_status; nondet; __malloc_main_l25; __malloc_main_l36[0..1]; __malloc_main_l50[0..2]; __malloc_main_l63; __malloc_main_l73; __malloc_main_l97[0][bits 0 to 0]; __malloc_main_l114[0][bits 0 to 0]; __malloc_main_l127[0..9] ���������frama-c-20.0-Calcium/tests/builtins/oracle/allocated.1.res.oracle�����������������������������������0000666�0000000�0000000�00000177333�13571573400�021537� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/allocated.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] tests/builtins/allocated.c:25: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:25: allocating variable __malloc_main_l25 [eva] tests/builtins/allocated.c:25: assertion got status valid. [eva:alarm] tests/builtins/allocated.c:27: Warning: out of bounds read. assert \valid_read(p + 1); [eva:alarm] tests/builtins/allocated.c:28: Warning: out of bounds read. assert \valid_read(p + 2); [eva] tests/builtins/allocated.c:29: Frama_C_show_each_p: {{ &__malloc_main_l25 }} [eva] tests/builtins/allocated.c:30: Frama_C_show_each_p0: {18} [eva] tests/builtins/allocated.c:31: Call to builtin free [eva] tests/builtins/allocated.c:31: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:31: strong free on bases: {__malloc_main_l25} [eva] tests/builtins/allocated.c:32: Frama_C_show_each_p_after_free: Bottom [eva] tests/builtins/allocated.c:36: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:36: allocating variable __malloc_main_l36 [eva] tests/builtins/allocated.c:36: assertion got status valid. [eva] tests/builtins/allocated.c:40: Frama_C_show_each_p: {{ &__malloc_main_l36 }} [eva] tests/builtins/allocated.c:41: Frama_C_show_each_p0: {13} [eva] tests/builtins/allocated.c:42: Frama_C_show_each_p1: {54} [eva] tests/builtins/allocated.c:43: Call to builtin free [eva] tests/builtins/allocated.c:43: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:43: strong free on bases: {__malloc_main_l36} [eva:alarm] tests/builtins/allocated.c:44: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [kernel] tests/builtins/allocated.c:44: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/allocated.c:45: Call to builtin free [eva] tests/builtins/allocated.c:45: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:45: strong free on bases: {__malloc_main_l36} [eva:alarm] tests/builtins/allocated.c:46: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [kernel] tests/builtins/allocated.c:46: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/allocated.c:50: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:50: allocating variable __malloc_main_l50 [eva] tests/builtins/allocated.c:50: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:50: allocating variable __malloc_main_l50_0 [eva] tests/builtins/allocated.c:50: assertion got status valid. [eva:alarm] tests/builtins/allocated.c:53: Warning: out of bounds write. assert \valid(p + 2); [kernel] tests/builtins/allocated.c:53: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/allocated.c:54: Frama_C_show_each_p: {{ &__malloc_main_l50_0 }} [eva] tests/builtins/allocated.c:55: Frama_C_show_each_p0: {13} [eva] tests/builtins/allocated.c:56: Frama_C_show_each_p1: {42} [eva] tests/builtins/allocated.c:57: Frama_C_show_each_p2: {77} [eva] tests/builtins/allocated.c:58: Call to builtin free [eva] tests/builtins/allocated.c:58: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:58: strong free on bases: {__malloc_main_l50_0} [eva] tests/builtins/allocated.c:63: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:63: allocating variable __malloc_main_l63 [eva] tests/builtins/allocated.c:63: assertion got status valid. [eva] tests/builtins/allocated.c:65: Frama_C_show_each_p: {{ &__malloc_main_l63 }} [eva] tests/builtins/allocated.c:66: Frama_C_show_each_p0: {0} [eva] tests/builtins/allocated.c:67: Call to builtin free [eva] tests/builtins/allocated.c:67: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:67: strong free on bases: {__malloc_main_l63} [eva] tests/builtins/allocated.c:63: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:63: allocating variable __malloc_main_l63_0 [eva] tests/builtins/allocated.c:65: Frama_C_show_each_p: {{ &__malloc_main_l63_0 }} [eva] tests/builtins/allocated.c:66: Frama_C_show_each_p0: {1} [eva] tests/builtins/allocated.c:67: Call to builtin free [eva:malloc] tests/builtins/allocated.c:67: strong free on bases: {__malloc_main_l63_0} [eva] tests/builtins/allocated.c:63: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:63: allocating variable __malloc_main_l63_1 [eva] tests/builtins/allocated.c:65: Frama_C_show_each_p: {{ &__malloc_main_l63_1 }} [eva] tests/builtins/allocated.c:66: Frama_C_show_each_p0: {2} [eva] tests/builtins/allocated.c:67: Call to builtin free [eva:malloc] tests/builtins/allocated.c:67: strong free on bases: {__malloc_main_l63_1} [eva] tests/builtins/allocated.c:63: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:63: allocating variable __malloc_main_l63_2 [eva] tests/builtins/allocated.c:65: Frama_C_show_each_p: {{ &__malloc_main_l63_2 }} [eva] tests/builtins/allocated.c:66: Frama_C_show_each_p0: {3} [eva] tests/builtins/allocated.c:67: Call to builtin free [eva:malloc] tests/builtins/allocated.c:67: strong free on bases: {__malloc_main_l63_2} [eva] tests/builtins/allocated.c:73: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:73: allocating variable __malloc_main_l73 [eva] tests/builtins/allocated.c:75: Frama_C_show_each_p: {{ &__malloc_main_l73 }} [eva] tests/builtins/allocated.c:76: Frama_C_show_each_p0: {0} [eva] tests/builtins/allocated.c:77: Call to builtin free [eva] tests/builtins/allocated.c:77: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:77: strong free on bases: {__malloc_main_l73} [eva] tests/builtins/allocated.c:73: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:73: allocating variable __malloc_main_l73_0 [eva] tests/builtins/allocated.c:75: Frama_C_show_each_p: {{ &__malloc_main_l73_0 }} [eva] tests/builtins/allocated.c:76: Frama_C_show_each_p0: {1} [eva] tests/builtins/allocated.c:77: Call to builtin free [eva:malloc] tests/builtins/allocated.c:77: strong free on bases: {__malloc_main_l73_0} [eva] tests/builtins/allocated.c:73: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:73: allocating variable __malloc_main_l73_1 [eva] tests/builtins/allocated.c:75: Frama_C_show_each_p: {{ &__malloc_main_l73_1 }} [eva] tests/builtins/allocated.c:76: Frama_C_show_each_p0: {2} [eva] tests/builtins/allocated.c:77: Call to builtin free [eva:malloc] tests/builtins/allocated.c:77: strong free on bases: {__malloc_main_l73_1} [eva] tests/builtins/allocated.c:73: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:73: allocating variable __malloc_main_l73_2 [eva] tests/builtins/allocated.c:75: Frama_C_show_each_p: {{ &__malloc_main_l73_2 }} [eva] tests/builtins/allocated.c:76: Frama_C_show_each_p0: {3} [eva] tests/builtins/allocated.c:77: Call to builtin free [eva:malloc] tests/builtins/allocated.c:77: strong free on bases: {__malloc_main_l73_2} [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82 [eva] tests/builtins/allocated.c:82: assertion got status valid. [eva] tests/builtins/allocated.c:87: Call to builtin free [eva] tests/builtins/allocated.c:87: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82} [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_0 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_1 [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_1} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_0} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_1} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_0} [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_2 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_3 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_4 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_5 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_6 [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_2} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_3} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_4} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_5} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_6} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_2} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_3} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_4} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_5} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_6} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_2} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_3} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_4} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_5} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_6} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_2} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_3} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_4} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_5} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_6} [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_7 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_8 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_9 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_10 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_11 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_12 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_13 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_14 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_15 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_16 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_17 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_18 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_19 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_20 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_21 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_22 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_23 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_24 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_25 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_26 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_27 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_28 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_29 [eva] tests/builtins/allocated.c:82: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:82: allocating variable __malloc_main_l82_30 [eva] tests/builtins/allocated.c:84: Trace partitioning superposing up to 100 states [eva] tests/builtins/allocated.c:84: Trace partitioning superposing up to 200 states [eva] tests/builtins/allocated.c:84: Trace partitioning superposing up to 300 states [eva] tests/builtins/allocated.c:84: Trace partitioning superposing up to 400 states [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_30} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_29} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_28} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_27} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_26} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_25} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_24} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_23} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_22} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_21} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_20} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_19} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_18} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_17} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_16} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_15} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_14} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_13} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_12} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_11} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_10} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_9} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_8} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_7} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_30} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_29} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_28} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_27} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_26} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_25} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_24} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_23} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_22} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_21} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_20} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_19} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_18} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_17} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_16} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_15} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_14} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_13} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_12} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_11} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_10} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_9} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_8} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_7} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_30} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_29} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_28} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_27} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_26} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_25} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_24} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_23} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_22} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_21} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_20} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_19} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_18} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_17} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_16} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_15} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_14} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_13} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_12} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_11} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_10} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_9} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_8} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_7} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_30} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_29} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_28} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_27} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_26} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_25} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_24} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_23} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_22} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_21} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_20} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_19} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_18} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_17} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_16} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_15} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_14} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_13} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_12} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_11} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_10} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_9} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_8} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_7} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_30} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_29} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_28} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_27} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_26} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_25} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_24} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_23} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_22} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_21} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_20} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_19} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_18} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_17} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_16} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_15} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_14} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_13} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_12} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_11} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_10} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_9} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_8} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_7} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_30} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_29} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_28} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_27} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_26} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_25} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_24} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_23} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_22} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_21} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_20} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_19} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_18} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_17} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_16} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_15} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_14} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_13} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_12} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_11} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_10} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_9} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_8} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_7} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_30} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_29} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_28} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_27} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_26} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_25} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_24} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_23} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_22} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_21} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_20} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_19} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_18} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_17} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_16} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_15} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_14} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_13} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_12} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_11} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_10} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_9} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_8} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_7} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_30} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_29} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_28} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_27} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_26} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_25} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_24} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_23} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_22} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_21} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_20} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_19} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_18} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_17} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_16} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_15} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_14} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_13} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_12} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_11} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_10} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_9} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_8} [eva] tests/builtins/allocated.c:87: Call to builtin free [eva:malloc] tests/builtins/allocated.c:87: strong free on bases: {__malloc_main_l82_7} [eva] tests/builtins/allocated.c:91: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:91: allocating variable __malloc_main_l91 [eva] tests/builtins/allocated.c:91: assertion got status valid. [eva] tests/builtins/allocated.c:92: Call to builtin free [eva] tests/builtins/allocated.c:92: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:92: strong free on bases: {__malloc_main_l91} [eva:alarm] tests/builtins/allocated.c:96: Warning: assertion 'Assume' got status unknown. [eva] tests/builtins/allocated.c:97: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:97: allocating variable __malloc_main_l97 [eva] tests/builtins/allocated.c:97: Frama_C_show_each: {{ &__malloc_main_l97 }} [eva:alarm] tests/builtins/allocated.c:98: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/allocated.c:110: Frama_C_show_each: {0} [eva] tests/builtins/allocated.c:111: Call to builtin free [eva] tests/builtins/allocated.c:111: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:111: strong free on bases: {__malloc_main_l97} [eva:alarm] tests/builtins/allocated.c:113: Warning: assertion got status unknown. [eva] tests/builtins/allocated.c:114: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:114: allocating variable __malloc_main_l114 [eva] tests/builtins/allocated.c:114: Frama_C_show_each: {{ &__malloc_main_l114 }} [eva:alarm] tests/builtins/allocated.c:115: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/allocated.c:117: Frama_C_show_each: {0} [eva] tests/builtins/allocated.c:118: Call to builtin free [eva] tests/builtins/allocated.c:118: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:118: strong free on bases: {__malloc_main_l114} [eva] tests/builtins/allocated.c:120: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/allocated.c:120: allocating variable __malloc_main_l120 [eva] tests/builtins/allocated.c:120: Frama_C_show_each: {{ &__malloc_main_l120 }} [eva] tests/builtins/allocated.c:123: Frama_C_show_each: Bottom [eva] tests/builtins/allocated.c:125: Call to builtin free [eva] tests/builtins/allocated.c:125: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/allocated.c:125: strong free on bases: {__malloc_main_l120} [eva] tests/builtins/allocated.c:127: assertion 'alloca_bounds' got status valid. [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {0} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127_0 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {1} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127_0} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127_1 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {2} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127_1} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127_2 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {3} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127_2} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127_3 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {4} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127_3} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127_4 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {5} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127_4} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127_5 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {6} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127_5} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127_6 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {7} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127_6} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127_7 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {8} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127_7} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_malloc_fresh for function __fc_vla_alloc [eva] tests/builtins/allocated.c:127: allocating variable __malloc_main_l127_8 [eva] tests/builtins/allocated.c:131: Frama_C_show_each: {9} [eva] tests/builtins/allocated.c:127: Call to builtin Frama_C_vla_free for function __fc_vla_free [eva:malloc] tests/builtins/allocated.c:127: strong free on bases: {__malloc_main_l127_8} [eva] Recording results for main [eva] done for function main [eva] tests/builtins/allocated.c:27: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/allocated.c:28: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/allocated.c:46: assertion 'Eva,dangling_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] i ∈ {10} j ∈ {10} p ∈ ESCAPINGADDR k ∈ {12} size ∈ [1..100] pb ∈ ESCAPINGADDR __retres ∈ {0} __malloc_main_l82_0 ∈ {7} or UNINITIALIZED __malloc_main_l82_1 ∈ {7} or UNINITIALIZED __malloc_main_l82_2[0] ∈ {14} or UNINITIALIZED [1] ∈ {17} or UNINITIALIZED __malloc_main_l82_3[0] ∈ {14} or UNINITIALIZED [1] ∈ {17} or UNINITIALIZED __malloc_main_l82_4[0] ∈ {14} or UNINITIALIZED [1] ∈ {17} or UNINITIALIZED __malloc_main_l82_5[0] ∈ {14} or UNINITIALIZED [1] ∈ {17} or UNINITIALIZED __malloc_main_l82_6[0] ∈ {14} or UNINITIALIZED [1] ∈ {17} or UNINITIALIZED __malloc_main_l82_7[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_8[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_9[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_10[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_11[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_12[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_13[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_14[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_15[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_16[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_17[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_18[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_19[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_20[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_21[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_22[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_23[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_24[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_25[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_26[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_27[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_28[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_29[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED __malloc_main_l82_30[0] ∈ {21} or UNINITIALIZED [1] ∈ {24} or UNINITIALIZED [2] ∈ {27} or UNINITIALIZED [from] Computing for function main [from] Computing for function malloc <-main [from] Done for function malloc [from] Computing for function free <-main [from] Done for function free [from] Computing for function __fc_vla_alloc <-main [from] Done for function __fc_vla_alloc [from] Computing for function __fc_vla_free <-main [from] Done for function __fc_vla_free [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function __fc_vla_alloc: \result FROM \nothing [from] Function __fc_vla_free: NO EFFECTS [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function main: __fc_heap_status FROM __fc_heap_status; nondet (and SELF) __malloc_main_l25 FROM __fc_heap_status __malloc_main_l36[0..1] FROM __fc_heap_status; nondet __malloc_main_l50[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l50_0[0..1] FROM __fc_heap_status; nondet (and SELF) [2] FROM __fc_heap_status; nondet __malloc_main_l63 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l63_0 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l63_1 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l63_2 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l73 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l73_0 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l73_1 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l73_2 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_0 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_1 FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_2[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_3[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_4[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_5[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_6[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_7[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_8[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_9[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_10[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_11[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_12[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_13[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_14[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_15[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_16[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_17[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_18[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_19[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_20[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_21[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_22[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_23[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_24[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_25[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_26[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_27[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_28[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_29[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l82_30[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_main_l97[0] FROM __fc_heap_status; nondet __malloc_main_l114[0..3] FROM __fc_heap_status; nondet __malloc_main_l127 FROM \nothing (and SELF) __malloc_main_l127_0[0..1] FROM \nothing (and SELF) __malloc_main_l127_1[0..2] FROM \nothing (and SELF) __malloc_main_l127_2[0..3] FROM \nothing (and SELF) __malloc_main_l127_3[0..4] FROM \nothing (and SELF) __malloc_main_l127_4[0..5] FROM \nothing (and SELF) __malloc_main_l127_5[0..6] FROM \nothing (and SELF) __malloc_main_l127_6[0..7] FROM \nothing (and SELF) __malloc_main_l127_7[0..8] FROM \nothing (and SELF) __malloc_main_l127_8[0..9] FROM \nothing (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; i; j; p; tmp; tmp_3; k; tmp_0; size; pb; a; __lengthof_a; __retres; __malloc_main_l25; __malloc_main_l36[0..1]; __malloc_main_l50[0..1]; __malloc_main_l50_0[0..2]; __malloc_main_l63; __malloc_main_l63_0; __malloc_main_l63_1; __malloc_main_l63_2; __malloc_main_l73; __malloc_main_l73_0; __malloc_main_l73_1; __malloc_main_l73_2; __malloc_main_l82_0; __malloc_main_l82_1; __malloc_main_l82_2[0..1]; __malloc_main_l82_3[0..1]; __malloc_main_l82_4[0..1]; __malloc_main_l82_5[0..1]; __malloc_main_l82_6[0..1]; __malloc_main_l82_7[0..2]; __malloc_main_l82_8[0..2]; __malloc_main_l82_9[0..2]; __malloc_main_l82_10[0..2]; __malloc_main_l82_11[0..2]; __malloc_main_l82_12[0..2]; __malloc_main_l82_13[0..2]; __malloc_main_l82_14[0..2]; __malloc_main_l82_15[0..2]; __malloc_main_l82_16[0..2]; __malloc_main_l82_17[0..2]; __malloc_main_l82_18[0..2]; __malloc_main_l82_19[0..2]; __malloc_main_l82_20[0..2]; __malloc_main_l82_21[0..2]; __malloc_main_l82_22[0..2]; __malloc_main_l82_23[0..2]; __malloc_main_l82_24[0..2]; __malloc_main_l82_25[0..2]; __malloc_main_l82_26[0..2]; __malloc_main_l82_27[0..2]; __malloc_main_l82_28[0..2]; __malloc_main_l82_29[0..2]; __malloc_main_l82_30[0..2]; __malloc_main_l97[0]; __malloc_main_l114[0..3]; __malloc_main_l127; __malloc_main_l127_0[0..1]; __malloc_main_l127_1[0..2]; __malloc_main_l127_2[0..3]; __malloc_main_l127_3[0..4]; __malloc_main_l127_4[0..5]; __malloc_main_l127_5[0..6]; __malloc_main_l127_6[0..7]; __malloc_main_l127_7[0..8]; __malloc_main_l127_8[0..9] [inout] Inputs for function main: __fc_heap_status; nondet; __malloc_main_l25; __malloc_main_l36[0..1]; __malloc_main_l50_0[0..2]; __malloc_main_l63; __malloc_main_l63_0; __malloc_main_l63_1; __malloc_main_l63_2; __malloc_main_l73; __malloc_main_l73_0; __malloc_main_l73_1; __malloc_main_l73_2; __malloc_main_l97[0][bits 0 to 0]; __malloc_main_l114[0][bits 0 to 0]; __malloc_main_l127; __malloc_main_l127_0[0..1]; __malloc_main_l127_1[0..2]; __malloc_main_l127_2[0..3]; __malloc_main_l127_3[0..4]; __malloc_main_l127_4[0..5]; __malloc_main_l127_5[0..6]; __malloc_main_l127_6[0..7]; __malloc_main_l127_7[0..8]; __malloc_main_l127_8[0..9] �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/assert_builtin.res.oracle��������������������������������0000666�0000000�0000000�00000002357�13571573400�022470� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/assert_builtin.i (no preprocessing) [kernel:annot:missing-spec] tests/builtins/assert_builtin.i:5: Warning: Neither code nor specification for function Frama_C_assert, generating default assigns from the prototype [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ {0} [eva] tests/builtins/assert_builtin.i:6: Call to builtin Frama_C_assert [eva] tests/builtins/assert_builtin.i:6: Warning: Frama_C_assert: unknown [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function main [from] Computing for function Frama_C_assert <-main [from] Done for function Frama_C_assert [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_assert: NO EFFECTS [from] Function main: \result FROM t[0..9]; c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres [inout] Inputs for function main: t[0..9] ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/big_local_array.0.res.oracle�����������������������������0000666�0000000�0000000�00000002342�13571573400�022702� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/big_local_array.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x[0].a[0] ∈ {1} [0].a[1] ∈ {2} [0].a[2] ∈ {3} [0]{.a[3..49]; .b[0..4]} ∈ {0} [0].b[5] ∈ {5} [0].b[6] ∈ {6} [0].b[7] ∈ {7} {[0].b[8..31]; [1..2]; [3].a[0]} ∈ {0} [3].a[1] ∈ {1} [3].a[2] ∈ {2} [3].a[3] ∈ {3} [3]{.a[4..49]; .b[0..16]} ∈ {0} [3].b[17] ∈ {17} {[3].b[18..31]; [4..31]} ∈ {0} __retres ∈ {0} [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- /* Generated by Frama-C */ struct S { int a[50] ; int b[32] ; }; int main(void) { int __retres; struct S x[32] = {{.a = {1, 2, 3}, .b = {[5] = 5, 6, 7}}, [3] = {.a = {0, 1, 2, 3}, .b = {[17] = 17}}}; __retres = 0; return __retres; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/big_local_array.1.res.oracle�����������������������������0000666�0000000�0000000�00000001156�13571573400�022705� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/big_local_array.i (no preprocessing) [kernel] Parsing tests/builtins/big_local_array.i (no preprocessing) [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- /* Generated by Frama-C */ struct S { int a[50] ; int b[32] ; }; int main(void) { int __retres; struct S x[32] = {{.a = {1, 2, 3}, .b = {[5] = 5, 6, 7}}, [3] = {.a = {0, 1, 2, 3}, .b = {[17] = 17}}}; __retres = 0; return __retres; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/big_local_array.2.res.oracle�����������������������������0000666�0000000�0000000�00000002000�13571573400�022673� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/big_local_array.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x[0].a[0] ∈ {1} [0].a[1] ∈ {2} [0].a[2] ∈ {3} [0]{.a[3..49]; .b[0..4]} ∈ {0} [0].b[5] ∈ {5} [0].b[6] ∈ {6} [0].b[7] ∈ {7} {[0].b[8..31]; [1..2]; [3].a[0]} ∈ {0} [3].a[1] ∈ {1} [3].a[2] ∈ {2} [3].a[3] ∈ {3} [3]{.a[4..49]; .b[0..16]} ∈ {0} [3].b[17] ∈ {17} {[3].b[18..31]; [4..31]} ∈ {0} __retres ∈ {0} /* Generated by Frama-C */ struct S { int a[50] ; int b[32] ; }; int main(void) { int __retres; struct S x[32] = {{.a = {1, 2, 3}, .b = {[5] = 5, 6, 7}}, [3] = {.a = {0, 1, 2, 3}, .b = {[17] = 17}}}; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/builtins/oracle/calloc.0.res.oracle��������������������������������������0000666�0000000�0000000�00000005364�13571573400�021035� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/calloc.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function calloc <- main. Called from tests/builtins/calloc.c:14. [eva] using specification for function calloc [eva] tests/builtins/calloc.c:14: Warning: ignoring unsupported \allocates clause [eva] Done for function calloc [eva] computing for function calloc <- main. Called from tests/builtins/calloc.c:17. [eva] tests/builtins/calloc.c:17: Warning: ignoring unsupported \allocates clause [eva] Done for function calloc [eva] computing for function calloc <- main. Called from tests/builtins/calloc.c:20. [eva] tests/builtins/calloc.c:20: Warning: ignoring unsupported \allocates clause [eva] Done for function calloc [eva] computing for function calloc <- main. Called from tests/builtins/calloc.c:23. [eva] tests/builtins/calloc.c:23: Warning: ignoring unsupported \allocates clause [eva] Done for function calloc [eva:alarm] tests/builtins/calloc.c:26: Warning: assertion got status invalid (stopping propagation). [eva] computing for function calloc <- main. Called from tests/builtins/calloc.c:30. [eva] tests/builtins/calloc.c:30: Warning: ignoring unsupported \allocates clause [eva] Done for function calloc [eva:alarm] tests/builtins/calloc.c:33: Warning: assertion got status invalid (stopping propagation). [eva] computing for function calloc <- main. Called from tests/builtins/calloc.c:38. [eva] tests/builtins/calloc.c:38: Warning: ignoring unsupported \allocates clause [eva] Done for function calloc [eva] tests/builtins/calloc.c:40: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p1 ∈ [--..--] p2 ∈ [--..--] p3 ∈ [--..--] p4 ∈ [--..--] p5 ∈ [--..--] p9001 ∈ {0} __retres ∈ {0; 1} [from] Computing for function main [from] Computing for function calloc <-main [from] Done for function calloc [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function calloc: __fc_heap_status FROM __fc_heap_status; nmemb; size (and SELF) \result FROM __fc_heap_status; nmemb; size [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; p1; p2; p3; p4; p5; p9001; __retres [inout] Inputs for function main: __fc_heap_status; nondet ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/calloc.1.res.oracle��������������������������������������0000666�0000000�0000000�00000005302�13571573400�021026� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/calloc.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] tests/builtins/calloc.c:14: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:14: allocating variable __calloc_main_l14 [eva] tests/builtins/calloc.c:17: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:17: allocating variable __calloc_main_l17 [eva] tests/builtins/calloc.c:20: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:20: allocating variable __calloc_main_l20 [eva] tests/builtins/calloc.c:23: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:23: allocating variable __calloc_main_l23 [eva] tests/builtins/calloc.c:26: assertion got status valid. [eva] tests/builtins/calloc.c:27: assertion got status valid. [eva] tests/builtins/calloc.c:30: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:30: allocating variable __calloc_main_l30 [eva] tests/builtins/calloc.c:33: assertion got status valid. [eva] tests/builtins/calloc.c:34: assertion got status valid. [eva] tests/builtins/calloc.c:35: assertion got status valid. [eva] tests/builtins/calloc.c:38: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:38: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva] tests/builtins/calloc.c:40: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p1 ∈ {{ &__calloc_main_l14[0] }} p2 ∈ {{ &__calloc_main_l17[0] }} p3 ∈ {{ &__calloc_main_l20[0] }} p4 ∈ {{ &__calloc_main_l23 }} p5 ∈ {{ &__calloc_main_l30[0] }} p9001 ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Computing for function calloc <-main [from] Done for function calloc [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function calloc: __fc_heap_status FROM __fc_heap_status; nmemb; size (and SELF) \result FROM __fc_heap_status; nmemb; size [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; p1; p2; p3; p4; p5; p9001; __retres [inout] Inputs for function main: __fc_heap_status; nondet ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/calloc.2.res.oracle��������������������������������������0000666�0000000�0000000�00000005324�13571573400�021033� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/calloc.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] tests/builtins/calloc.c:14: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:14: allocating variable __calloc_main_l14 [eva] tests/builtins/calloc.c:17: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:17: allocating variable __calloc_main_l17 [eva] tests/builtins/calloc.c:20: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:20: allocating variable __calloc_main_l20 [eva] tests/builtins/calloc.c:23: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:23: allocating variable __calloc_main_l23 [eva] tests/builtins/calloc.c:26: assertion got status valid. [eva] tests/builtins/calloc.c:27: assertion got status valid. [eva] tests/builtins/calloc.c:30: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:30: allocating variable __calloc_main_l30 [eva] tests/builtins/calloc.c:33: assertion got status valid. [eva] tests/builtins/calloc.c:34: assertion got status valid. [eva] tests/builtins/calloc.c:35: assertion got status valid. [eva] tests/builtins/calloc.c:38: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:38: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva] tests/builtins/calloc.c:40: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p1 ∈ {{ &__calloc_main_l14[0] }} p2 ∈ {{ &__calloc_main_l17[0] }} p3 ∈ {{ &__calloc_main_l20[0] }} p4 ∈ {{ &__calloc_main_l23 }} p5 ∈ {{ &__calloc_main_l30[0] }} p9001 ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Computing for function calloc <-main [from] Done for function calloc [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function calloc: __fc_heap_status FROM __fc_heap_status; nmemb; size (and SELF) \result FROM __fc_heap_status; nmemb; size [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; p1; p2; p3; p4; p5; p9001; __retres [inout] Inputs for function main: __fc_heap_status; nondet ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/calloc.3.res.oracle��������������������������������������0000666�0000000�0000000�00000005302�13571573400�021030� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/calloc.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] tests/builtins/calloc.c:14: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:14: allocating variable __calloc_main_l14 [eva] tests/builtins/calloc.c:17: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:17: allocating variable __calloc_main_l17 [eva] tests/builtins/calloc.c:20: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:20: allocating variable __calloc_main_l20 [eva] tests/builtins/calloc.c:23: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:23: allocating variable __calloc_main_l23 [eva] tests/builtins/calloc.c:26: assertion got status valid. [eva] tests/builtins/calloc.c:27: assertion got status valid. [eva] tests/builtins/calloc.c:30: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:30: allocating variable __calloc_main_l30 [eva] tests/builtins/calloc.c:33: assertion got status valid. [eva] tests/builtins/calloc.c:34: assertion got status valid. [eva] tests/builtins/calloc.c:35: assertion got status valid. [eva] tests/builtins/calloc.c:38: Call to builtin Frama_C_calloc_fresh for function calloc [eva] tests/builtins/calloc.c:38: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva] tests/builtins/calloc.c:40: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p1 ∈ {{ &__calloc_main_l14[0] }} p2 ∈ {{ &__calloc_main_l17[0] }} p3 ∈ {{ &__calloc_main_l20[0] }} p4 ∈ {{ &__calloc_main_l23 }} p5 ∈ {{ &__calloc_main_l30[0] }} p9001 ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Computing for function calloc <-main [from] Done for function calloc [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function calloc: __fc_heap_status FROM __fc_heap_status; nmemb; size (and SELF) \result FROM __fc_heap_status; nmemb; size [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; p1; p2; p3; p4; p5; p9001; __retres [inout] Inputs for function main: __fc_heap_status; nondet ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/calloc.4.res.oracle��������������������������������������0000666�0000000�0000000�00000005324�13571573400�021035� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/calloc.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] tests/builtins/calloc.c:14: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:14: allocating variable __calloc_main_l14 [eva] tests/builtins/calloc.c:17: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:17: allocating variable __calloc_main_l17 [eva] tests/builtins/calloc.c:20: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:20: allocating variable __calloc_main_l20 [eva] tests/builtins/calloc.c:23: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:23: allocating variable __calloc_main_l23 [eva] tests/builtins/calloc.c:26: assertion got status valid. [eva] tests/builtins/calloc.c:27: assertion got status valid. [eva] tests/builtins/calloc.c:30: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:30: allocating variable __calloc_main_l30 [eva] tests/builtins/calloc.c:33: assertion got status valid. [eva] tests/builtins/calloc.c:34: assertion got status valid. [eva] tests/builtins/calloc.c:35: assertion got status valid. [eva] tests/builtins/calloc.c:38: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/builtins/calloc.c:38: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva] tests/builtins/calloc.c:40: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p1 ∈ {{ &__calloc_main_l14[0] }} p2 ∈ {{ &__calloc_main_l17[0] }} p3 ∈ {{ &__calloc_main_l20[0] }} p4 ∈ {{ &__calloc_main_l23 }} p5 ∈ {{ &__calloc_main_l30[0] }} p9001 ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Computing for function calloc <-main [from] Done for function calloc [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function calloc: __fc_heap_status FROM __fc_heap_status; nmemb; size (and SELF) \result FROM __fc_heap_status; nmemb; size [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; p1; p2; p3; p4; p5; p9001; __retres [inout] Inputs for function main: __fc_heap_status; nondet ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/fam.res.oracle�������������������������������������������0000666�0000000�0000000�00000003173�13571573400�020201� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/fam.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/builtins/fam.c:15: Frama_C_show_each: {{ &buf + {11} }} [eva] tests/builtins/fam.c:16: Call to builtin memcpy [eva] tests/builtins/fam.c:16: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/fam.c:16: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/fam.c:16: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: buf[0] ∈ {42} [1..9] ∈ UNINITIALIZED [10] ∈ {5} [11] ∈ {15} [12] ∈ {20} [13..99] ∈ UNINITIALIZED value[0] ∈ {15} [1] ∈ {20} option ∈ {{ (TcpOption *)&buf[10] }} [from] Computing for function main [from] Computing for function memcpy <-main [from] Done for function memcpy [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function memcpy: buf[11..12] FROM value[0..1] \result FROM dest [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: buf{[0]; [10..12]}; value[0..1]; option [inout] Inputs for function main: \nothing �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/free.res.oracle������������������������������������������0000666�0000000�0000000�00000015624�13571573400�020363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/free.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/builtins/free.c:44. [eva] tests/builtins/free.c:8: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/free.c:8: allocating variable __malloc_main1_l8 [eva] tests/builtins/free.c:10: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/free.c:10: allocating variable __malloc_main1_l10 [eva] tests/builtins/free.c:13: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] v ∈ [--..--] p ∈ {{ &__malloc_main1_l8[0] }} q ∈ {{ &__malloc_main1_l10[0] }} r ∈ {{ &__malloc_main1_l8[0] ; &__malloc_main1_l10[0] }} tmp_1 ∈ {{ &__malloc_main1_l8[0] ; &__malloc_main1_l10[0] }} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main1_l8[0] ∈ UNINITIALIZED [1] ∈ {1} [2..9] ∈ UNINITIALIZED __malloc_main1_l10[0..1] ∈ UNINITIALIZED [2] ∈ {2} [3..9] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/free.c:14: Call to builtin free [eva] tests/builtins/free.c:14: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/free.c:14: weak free on bases: {__malloc_main1_l8, __malloc_main1_l10} [eva] tests/builtins/free.c:16: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/free.c:16: allocating variable __malloc_main1_l16 [eva] tests/builtins/free.c:18: Call to builtin free [eva] tests/builtins/free.c:18: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/free.c:18: strong free on bases: {__malloc_main1_l16} [eva] tests/builtins/free.c:21: Call to builtin free [eva] tests/builtins/free.c:21: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/free.c:21: strong free on bases: {} [eva] tests/builtins/free.c:23: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/free.c:23: allocating variable __malloc_main1_l23 [eva] tests/builtins/free.c:26: Call to builtin free [eva] tests/builtins/free.c:26: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/free.c:26: weak free on bases: {__malloc_main1_l23} [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/builtins/free.c:45. [eva] tests/builtins/free.c:35: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/free.c:35: allocating variable __malloc_main2_l35 [eva] tests/builtins/free.c:39: Call to builtin free [eva] tests/builtins/free.c:39: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/free.c:39: strong free on bases: {__malloc_main2_l35} [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: __fc_heap_status ∈ [--..--] p ∈ {{ &__malloc_main1_l8[0] }} or ESCAPINGADDR q ∈ {{ &__malloc_main1_l10[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main1_l8[0] ; &__malloc_main1_l10[0] }} or ESCAPINGADDR u ∈ ESCAPINGADDR t ∈ {0} s ∈ {{ NULL ; &__malloc_main1_l23[0] }} or ESCAPINGADDR __malloc_main1_l8[0] ∈ UNINITIALIZED [1] ∈ {1} [2..9] ∈ UNINITIALIZED __malloc_main1_l10[0..1] ∈ UNINITIALIZED [2] ∈ {2} [3..9] ∈ UNINITIALIZED __malloc_main1_l23[0..3] ∈ UNINITIALIZED [4] ∈ {4} [5..9] ∈ UNINITIALIZED [eva:final-states] Values at end of function main2: __fc_heap_status ∈ [--..--] p ∈ ESCAPINGADDR i ∈ {1} [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] __malloc_main1_l8[0] ∈ UNINITIALIZED [1] ∈ {1} [2..9] ∈ UNINITIALIZED __malloc_main1_l10[0..1] ∈ UNINITIALIZED [2] ∈ {2} [3..9] ∈ UNINITIALIZED __malloc_main1_l23[0..3] ∈ UNINITIALIZED [4] ∈ {4} [5..9] ∈ UNINITIALIZED [from] Computing for function main1 [from] Computing for function malloc <-main1 [from] Done for function malloc [from] Computing for function free <-main1 [from] Done for function free [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function main1: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_main1_l8[1] FROM __fc_heap_status __malloc_main1_l10[2] FROM __fc_heap_status __malloc_main1_l16[3] FROM __fc_heap_status __malloc_main1_l23[4] FROM __fc_heap_status [from] Function main2: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_main2_l35 FROM __fc_heap_status [from] Function main: __fc_heap_status FROM __fc_heap_status; v (and SELF) __malloc_main1_l8[1] FROM __fc_heap_status; v (and SELF) __malloc_main1_l10[2] FROM __fc_heap_status; v (and SELF) __malloc_main1_l16[3] FROM __fc_heap_status; v (and SELF) __malloc_main1_l23[4] FROM __fc_heap_status; v (and SELF) __malloc_main2_l35 FROM __fc_heap_status; v (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: __fc_heap_status; p; q; r; tmp_1; u; t; s; __malloc_main1_l8[1]; __malloc_main1_l10[2]; __malloc_main1_l16[3]; __malloc_main1_l23[4] [inout] Inputs for function main1: __fc_heap_status; v [inout] Out (internal) for function main2: __fc_heap_status; p; i; __malloc_main2_l35 [inout] Inputs for function main2: __fc_heap_status [inout] Out (internal) for function main: __fc_heap_status; __malloc_main1_l8[1]; __malloc_main1_l10[2]; __malloc_main1_l16[3]; __malloc_main1_l23[4]; __malloc_main2_l35 [inout] Inputs for function main: __fc_heap_status; v ������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/from_result.res.oracle�����������������������������������0000666�0000000�0000000�00000006135�13571573400�022000� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/from_result.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function bar <- main. Called from tests/builtins/from_result.c:32. [eva] tests/builtins/from_result.c:18: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/from_result.c:18: allocating variable __malloc_bar_l18 [eva] Recording results for bar [eva] Done for function bar [eva] computing for function bar <- main. Called from tests/builtins/from_result.c:33. [eva] tests/builtins/from_result.c:18: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/from_result.c:18: allocating variable __malloc_bar_l18_0 [eva] Recording results for bar [eva] Done for function bar [eva] computing for function create_t <- main. Called from tests/builtins/from_result.c:34. [eva] using specification for function create_t [eva] Done for function create_t [eva] computing for function create_t1 <- main. Called from tests/builtins/from_result.c:35. [eva] using specification for function create_t1 [eva] Done for function create_t1 [eva] computing for function change_t <- main. Called from tests/builtins/from_result.c:36. [eva] Recording results for change_t [eva] Done for function change_t [eva] computing for function foo <- main. Called from tests/builtins/from_result.c:37. [eva] using specification for function foo [eva] tests/builtins/from_result.c:29: Warning: no 'assigns \result \from ...' clause specified for function foo [eva] Done for function foo [eva] Recording results for main [eva] done for function main [from] Computing for function bar [from] Computing for function Frama_C_malloc_fresh <-bar [from] Done for function Frama_C_malloc_fresh [from] Done for function bar [from] Computing for function change_t [from] Done for function change_t [from] Computing for function main [from] Computing for function create_t <-main [from] Done for function create_t [from] Computing for function create_t1 <-main [from] Done for function create_t1 [from] Computing for function foo <-main [from] Done for function foo [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_malloc_fresh: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function bar: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_bar_l18 FROM __fc_heap_status; x (and SELF) __malloc_bar_l18_0 FROM __fc_heap_status; x (and SELF) \result FROM __fc_heap_status [from] Function change_t: v.a FROM t0; x .b FROM t0; y [from] Function create_t: \result FROM x; y [from] Function create_t1: \result FROM x; y [from] Function foo: \result FROM ANYTHING(origin:Unknown) [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_bar_l18 FROM __fc_heap_status (and SELF) __malloc_bar_l18_0 FROM __fc_heap_status (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/gcc_zero_length_array.res.oracle�������������������������0000666�0000000�0000000�00000006225�13571573400�023771� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/gcc_zero_length_array.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function make_fam <- main. Called from tests/builtins/gcc_zero_length_array.c:24. [eva] tests/builtins/gcc_zero_length_array.c:15: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/gcc_zero_length_array.c:15: allocating variable __malloc_make_fam_l15 [eva] Recording results for make_fam [eva] Done for function make_fam [eva] tests/builtins/gcc_zero_length_array.c:26: Call to builtin free [eva] tests/builtins/gcc_zero_length_array.c:26: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/gcc_zero_length_array.c:26: strong free on bases: {__malloc_make_fam_l15} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function make_fam: __fc_heap_status ∈ [--..--] i ∈ {11} p ∈ {{ &__malloc_make_fam_l15[0] }} __malloc_make_fam_l15[0].len ∈ {11} [1] ∈ {0} [2].len ∈ {1} [3].len ∈ {2} [4].len ∈ {3} [5].len ∈ {4} [6].len ∈ {5} [7].len ∈ {6} [8].len ∈ {7} [9].len ∈ {8} [10].len ∈ {9} [11].len ∈ {10} [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] pfam ∈ ESCAPINGADDR res ∈ {10} [from] Computing for function make_fam [from] Computing for function malloc <-make_fam [from] Done for function malloc [from] Done for function make_fam [from] Computing for function main [from] Computing for function free <-main [from] Done for function free [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function make_fam: __fc_heap_status FROM __fc_heap_status; len (and SELF) __malloc_make_fam_l15[0] FROM __fc_heap_status; len [1..11] FROM __fc_heap_status; len (and SELF) \result FROM __fc_heap_status; len [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_make_fam_l15[0] FROM __fc_heap_status [1..11] FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status; __malloc_make_fam_l15[11] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function make_fam: __fc_heap_status; i; p; __malloc_make_fam_l15[0..11] [inout] Inputs for function make_fam: __fc_heap_status [inout] Out (internal) for function main: __fc_heap_status; pfam; res; __malloc_make_fam_l15[0..11] [inout] Inputs for function main: __fc_heap_status; __malloc_make_fam_l15[11] ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/imprecise-malloc-free.res.oracle�������������������������0000666�0000000�0000000�00000010416�13571573400�023600� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/imprecise-malloc-free.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ [--..--] [eva:alarm] tests/builtins/imprecise-malloc-free.c:13: Warning: signed overflow. assert -2147483648 ≤ i + (int)((int)(&size2) >> 1); [eva:alarm] tests/builtins/imprecise-malloc-free.c:13: Warning: signed overflow. assert i + (int)((int)(&size2) >> 1) ≤ 2147483647; [eva] tests/builtins/imprecise-malloc-free.c:13: Assigning imprecise value to size2. The imprecision originates from Arithmetic {tests/builtins/imprecise-malloc-free.c:13} [eva] tests/builtins/imprecise-malloc-free.c:14: Call to builtin malloc [eva] tests/builtins/imprecise-malloc-free.c:14: allocating variable __malloc_main_l14 [eva] tests/builtins/imprecise-malloc-free.c:15: Call to builtin malloc [eva] tests/builtins/imprecise-malloc-free.c:15: allocating variable __malloc_main_l15 [eva] tests/builtins/imprecise-malloc-free.c:16: Call to builtin malloc [eva] tests/builtins/imprecise-malloc-free.c:16: allocating variable __malloc_main_l16 [eva] tests/builtins/imprecise-malloc-free.c:18: Frama_C_show_each: {{ &__malloc_main_l14 }}, {{ &__malloc_main_l15 }}, {{ &__malloc_main_l16 }} [eva] tests/builtins/imprecise-malloc-free.c:19: Frama_C_show_each: {{ garbled mix of &{__malloc_main_l14} (origin: Arithmetic {tests/builtins/imprecise-malloc-free.c:19}) }} [eva:alarm] tests/builtins/imprecise-malloc-free.c:21: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/imprecise-malloc-free.c:22: Warning: out of bounds write. assert \valid(q); [eva:alarm] tests/builtins/imprecise-malloc-free.c:23: Warning: out of bounds write. assert \valid(r); [eva] tests/builtins/imprecise-malloc-free.c:25: Call to builtin free [eva:alarm] tests/builtins/imprecise-malloc-free.c:25: Warning: function free: precondition 'freeable' got status unknown. [eva:malloc] tests/builtins/imprecise-malloc-free.c:25: weak free on bases: {__malloc_main_l14} [eva] tests/builtins/imprecise-malloc-free.c:26: Call to builtin free [eva:alarm] tests/builtins/imprecise-malloc-free.c:26: Warning: function free: precondition 'freeable' got status unknown. [eva:malloc] tests/builtins/imprecise-malloc-free.c:26: weak free on bases: {__malloc_main_l15, __malloc_main_l16} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] size1 ∈ {{ &size1 + [-8589934592..8589934588],0%4 }} size2 ∈ {{ garbled mix of &{size2} (origin: Arithmetic {tests/builtins/imprecise-malloc-free.c:13}) }} p ∈ {{ &__malloc_main_l14[0] }} or ESCAPINGADDR q ∈ {{ &__malloc_main_l15[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main_l16[0] }} or ESCAPINGADDR __malloc_main_l14[0] ∈ {{ (int)&__malloc_main_l14[1] }} or ESCAPINGADDR [1..1073741823] ∈ UNINITIALIZED __malloc_main_l15[0] ∈ {{ (int)&__malloc_main_l15[2] }} or ESCAPINGADDR [1..1073741823] ∈ UNINITIALIZED __malloc_main_l16[0] ∈ {{ (int)&__malloc_main_l16[3] }} or ESCAPINGADDR [1..1073741823] ∈ UNINITIALIZED [from] Computing for function main [from] Computing for function malloc <-main [from] Done for function malloc [from] Computing for function free <-main [from] Done for function free [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function main: __fc_heap_status FROM i; __fc_heap_status (and SELF) __malloc_main_l14[0] FROM __fc_heap_status __malloc_main_l15[0] FROM i; __fc_heap_status __malloc_main_l16[0] FROM i; __fc_heap_status [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; size1; size2; p; q; r; __malloc_main_l14[0]; __malloc_main_l15[0]; __malloc_main_l16[0] [inout] Inputs for function main: i; __fc_heap_status ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/imprecise.res.oracle�������������������������������������0000666�0000000�0000000�00000132145�13571573400�021420� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/imprecise.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/builtins/imprecise.c:77: Warning: Calling undeclared function gm_f2. Old style K&R code? [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] tests/builtins/imprecise.c:27: Warning: during initialization of variable 'v1', size of type 'struct s' cannot be computed (abstract type 'struct s') [eva] tests/builtins/imprecise.c:27: Warning: during initialization of variable 'v2', size of type 'struct s' cannot be computed (abstract type 'struct s') [eva] tests/builtins/imprecise.c:28: Warning: during initialization of variable 'v3', size of type 'struct u' cannot be computed (abstract type 'struct u') [eva] tests/builtins/imprecise.c:28: Warning: during initialization of variable 'v5', size of type 'struct u' cannot be computed (abstract type 'struct u') [eva] tests/builtins/imprecise.c:83: Warning: during initialization of variable 's1', size of type 'struct s' cannot be computed (abstract type 'struct s') [eva] tests/builtins/imprecise.c:83: Warning: during initialization of variable 's2', size of type 'struct s' cannot be computed (abstract type 'struct s') [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 800 to 1607] ∈ [--..--] v ∈ [--..--] addr ∈ [--..--] v1.[bits 0 to ..] ∈ {0} or UNINITIALIZED v2.[bits 0 to ..] ∈ {0} or UNINITIALIZED v3.[bits 0 to ..] ∈ {0} or UNINITIALIZED v5.[bits 0 to ..] ∈ {0} or UNINITIALIZED t[0..9] ∈ {0} p_gm_null ∈ {0} s1.[bits 0 to ..] ∈ {0} or UNINITIALIZED s2.[bits 0 to ..] ∈ {0} or UNINITIALIZED [eva] computing for function invalid_assigns_imprecise <- main. Called from tests/builtins/imprecise.c:144. [eva] computing for function f <- invalid_assigns_imprecise <- main. Called from tests/builtins/imprecise.c:11. [eva] using specification for function f [eva:invalid-assigns] tests/builtins/imprecise.c:11: Completely invalid destination for assigns clause *p. Ignoring. [eva] Done for function f [eva] Recording results for invalid_assigns_imprecise [from] Computing for function invalid_assigns_imprecise [from] Done for function invalid_assigns_imprecise [eva] Done for function invalid_assigns_imprecise [eva] computing for function write_garbled <- main. Called from tests/builtins/imprecise.c:145. [eva] tests/builtins/imprecise.c:19: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/builtins/imprecise.c:19} [eva:alarm] tests/builtins/imprecise.c:20: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/imprecise.c:21: Frama_C_dump_each: # Cvalue domain: NULL[rbits 800 to 1607] ∈ [--..--] __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} i ∈ {1} j ∈ {1; 2} k[0..4] ∈ [--..--] p ∈ {{ NULL + [100..197] ; &j ; &k + [0..16] }} v ∈ [--..--] addr ∈ [--..--] v1.[bits 0 to ..] ∈ {0} or UNINITIALIZED v2.[bits 0 to ..] ∈ {0} or UNINITIALIZED v3.[bits 0 to ..] ∈ {0} or UNINITIALIZED v5.[bits 0 to ..] ∈ {0} or UNINITIALIZED t[0..9] ∈ {0} p_gm_null ∈ {0} s1.[bits 0 to ..] ∈ {0} or UNINITIALIZED s2.[bits 0 to ..] ∈ {0} or UNINITIALIZED ==END OF DUMP== [eva] Recording results for write_garbled [from] Computing for function write_garbled [from] Done for function write_garbled [eva] Done for function write_garbled [eva:locals-escaping] tests/builtins/imprecise.c:145: Warning: locals {j, k} escaping the scope of write_garbled through NULL [eva] computing for function abstract_structs <- main. Called from tests/builtins/imprecise.c:146. [eva:alarm] tests/builtins/imprecise.c:37: Warning: accessing uninitialized left-value. assert \initialized(p); [eva:alarm] tests/builtins/imprecise.c:37: Warning: out of bounds read. assert \valid_read(p); [eva:alarm] tests/builtins/imprecise.c:40: Warning: accessing uninitialized left-value. assert \initialized(p); [eva:alarm] tests/builtins/imprecise.c:40: Warning: out of bounds read. assert \valid_read(p); [eva:alarm] tests/builtins/imprecise.c:45: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/imprecise.c:46: Warning: out of bounds read. assert \valid_read(p); [eva] tests/builtins/imprecise.c:51: Call to builtin memset [eva:alarm] tests/builtins/imprecise.c:51: Warning: function memset: precondition 'valid_s' got status unknown. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva:alarm] tests/builtins/imprecise.c:53: Warning: out of bounds write. assert \valid(p2); [eva:alarm] tests/builtins/imprecise.c:56: Warning: out of bounds write. assert \valid(p4); [eva:alarm] tests/builtins/imprecise.c:58: Warning: out of bounds write. assert \valid(p5); [eva:alarm] tests/builtins/imprecise.c:60: Warning: out of bounds write. assert \valid(p6); [eva] Recording results for abstract_structs [from] Computing for function abstract_structs [from] Done for function abstract_structs [eva] Done for function abstract_structs [eva] computing for function cast_address <- main. Called from tests/builtins/imprecise.c:147. [eva] tests/builtins/imprecise.c:66: Assigning imprecise value to c1. The imprecision originates from Arithmetic {tests/builtins/imprecise.c:66} [eva:alarm] tests/builtins/imprecise.c:68: Warning: signed overflow. assert -2147483648 ≤ (int)*((char *)(&p)) + 0; [eva:alarm] tests/builtins/imprecise.c:68: Warning: signed overflow. assert (int)*((char *)(&p)) + 0 ≤ 2147483647; [eva] tests/builtins/imprecise.c:68: Assigning imprecise value to c3. The imprecision originates from Misaligned {tests/builtins/imprecise.c:68} [eva] Recording results for cast_address [from] Computing for function cast_address [from] Done for function cast_address [eva] Done for function cast_address [eva] computing for function garbled_mix_null <- main. Called from tests/builtins/imprecise.c:148. [eva] computing for function gm_f1 <- garbled_mix_null <- main. Called from tests/builtins/imprecise.c:75. [kernel:annot:missing-spec] tests/builtins/imprecise.c:75: Warning: Neither code nor specification for function gm_f1, generating default assigns from the prototype [eva] using specification for function gm_f1 [eva] Done for function gm_f1 [eva] tests/builtins/imprecise.c:76: Frama_C_dump_each: # Cvalue domain: NULL[rbits 800 to 1607] ∈ [--..--] or ESCAPINGADDR __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} v ∈ [--..--] addr ∈ [--..--] v1.[bits 0 to 7] ∈ {1} .[bits 8 to ..] ∈ {0} or UNINITIALIZED v2.[bits 0 to 31] ∈ {0} or UNINITIALIZED .[bits 32 to 63] ∈ {{ (? *)&addr }} .[bits 64 to ..] ∈ {0} or UNINITIALIZED v3.[bits 0 to ..]# ∈ {0; 251} or UNINITIALIZED repeated %8 v5.[bits 0 to 262143]# ∈ {0; 18; 19; 20} or UNINITIALIZED repeated %8 .[bits 262144 to 17179869183]# ∈ {0; 19; 20} or UNINITIALIZED repeated %8 .[bits 17179869184 to ..]# ∈ {0; 20} or UNINITIALIZED repeated %8 t[0..9] ∈ {0} p_gm_null ∈ [--..--] s1.[bits 0 to ..] ∈ {0} or UNINITIALIZED s2.[bits 0 to ..] ∈ {0} or UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/builtins/imprecise.c:77: Warning: out of bounds read. assert \valid_read(p_gm_null); [eva:alarm] tests/builtins/imprecise.c:77: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(p_gm_null); [eva] computing for function gm_f2 <- garbled_mix_null <- main. Called from tests/builtins/imprecise.c:77. [kernel:annot:missing-spec] tests/builtins/imprecise.c:77: Warning: Neither code nor specification for function gm_f2, generating default assigns from the prototype [eva] using specification for function gm_f2 [eva] Done for function gm_f2 [eva] tests/builtins/imprecise.c:78: Frama_C_dump_each: # Cvalue domain: NULL[rbits 800 to 1607] ∈ [--..--] or ESCAPINGADDR __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} v ∈ [--..--] addr ∈ [--..--] v1.[bits 0 to 7] ∈ {1} .[bits 8 to ..] ∈ {0} or UNINITIALIZED v2.[bits 0 to 31] ∈ {0} or UNINITIALIZED .[bits 32 to 63] ∈ {{ (? *)&addr }} .[bits 64 to ..] ∈ {0} or UNINITIALIZED v3.[bits 0 to ..]# ∈ {0; 251} or UNINITIALIZED repeated %8 v5.[bits 0 to 262143]# ∈ {0; 18; 19; 20} or UNINITIALIZED repeated %8 .[bits 262144 to 17179869183]# ∈ {0; 19; 20} or UNINITIALIZED repeated %8 .[bits 17179869184 to ..]# ∈ {0; 20} or UNINITIALIZED repeated %8 t[0..9] ∈ {0} p_gm_null ∈ [100..197] s1.[bits 0 to ..] ∈ {0} or UNINITIALIZED s2.[bits 0 to ..] ∈ {0} or UNINITIALIZED ==END OF DUMP== [eva] Recording results for garbled_mix_null [from] Computing for function garbled_mix_null [from] Done for function garbled_mix_null [eva] Done for function garbled_mix_null [eva] computing for function weak_update_imprecise_size <- main. Called from tests/builtins/imprecise.c:149. [eva] Recording results for weak_update_imprecise_size [from] Computing for function weak_update_imprecise_size [from] Done for function weak_update_imprecise_size [eva] Done for function weak_update_imprecise_size [eva] computing for function many_writes <- main. Called from tests/builtins/imprecise.c:150. [eva:alarm] tests/builtins/imprecise.c:111: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/builtins/imprecise.c:111: Warning: accessing out of bounds index. assert v < 300; [kernel] tests/builtins/imprecise.c:111: more than 200(300) locations to update in array. Approximating. [eva:alarm] tests/builtins/imprecise.c:112: Warning: assertion got status unknown. [eva:alarm] tests/builtins/imprecise.c:114: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/builtins/imprecise.c:114: Warning: accessing out of bounds index. assert v < 300; [kernel] tests/builtins/imprecise.c:114: more than 200(300) locations to update in array. Approximating. [kernel] tests/builtins/imprecise.c:114: approximating value to write. [eva:alarm] tests/builtins/imprecise.c:116: Warning: assertion got status unknown. [eva] Recording results for many_writes [kernel] tests/builtins/imprecise.c:111: more than 200(300) elements to enumerate. Approximating. [kernel] tests/builtins/imprecise.c:114: more than 200(300) elements to enumerate. Approximating. [from] Computing for function many_writes [kernel] tests/builtins/imprecise.c:111: more than 200(300) dependencies to update. Approximating. [kernel] tests/builtins/imprecise.c:114: more than 200(300) dependencies to update. Approximating. [from] Done for function many_writes [eva] Done for function many_writes [eva] computing for function overlap <- main. Called from tests/builtins/imprecise.c:151. [eva:alarm] tests/builtins/imprecise.c:122: Warning: out of bounds write. assert \valid((int *)(&t_char[v])); [eva] Recording results for overlap [from] Computing for function overlap [from] Done for function overlap [eva] Done for function overlap [eva] computing for function paste_big <- main. Called from tests/builtins/imprecise.c:152. [eva] tests/builtins/imprecise.c:133: Call to builtin memset [eva] tests/builtins/imprecise.c:133: function memset: precondition 'valid_s' got status valid. [eva:alarm] tests/builtins/imprecise.c:136: Warning: assertion got status unknown. [kernel] tests/builtins/imprecise.c:137: too many locations to update in array. Approximating. [eva:alarm] tests/builtins/imprecise.c:140: Warning: accessing uninitialized left-value. assert \initialized((int *)(&t_big) + 48); [eva] Recording results for paste_big [from] Computing for function paste_big [from] Done for function paste_big [eva] Done for function paste_big [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function cast_address: p ∈ {{ &x }} c1 ∈ {{ garbled mix of &{x} (origin: Arithmetic {tests/builtins/imprecise.c:66}) }} c2# ∈ {{ (? *)&x }}%32, bits 0 to 7 c3 ∈ {{ garbled mix of &{x} (origin: Misaligned {tests/builtins/imprecise.c:68}) }} [eva:final-states] Values at end of function garbled_mix_null: NULL[rbits 800 to 1607] ∈ [--..--] or ESCAPINGADDR p_gm_null ∈ [100..197] [eva:final-states] Values at end of function invalid_assigns_imprecise: p ∈ {0} [eva:final-states] Values at end of function many_writes: t_packed1{[0..298]{.i1; .i2#; .[bits 48 to 63]#}; [299].i1} ∈ {1} or UNINITIALIZED repeated %32 [299]{.i2; .[bits 48 to 63]} ∈ UNINITIALIZED t_packed2{[0..298]; [299].i1} ∈ [--..--] or UNINITIALIZED [299].i2 ∈ UNINITIALIZED [eva:final-states] Values at end of function abstract_structs: v1.[bits 0 to 7] ∈ {1} .[bits 8 to ..] ∈ {0} or UNINITIALIZED v2.[bits 0 to 31] ∈ {0} or UNINITIALIZED .[bits 32 to 63] ∈ {{ (? *)&addr }} .[bits 64 to ..] ∈ {0} or UNINITIALIZED v3.[bits 0 to ..]# ∈ {0; 251} or UNINITIALIZED repeated %8 v5.[bits 0 to 262143]# ∈ {0; 18; 19; 20} or UNINITIALIZED repeated %8 .[bits 262144 to 17179869183]# ∈ {0; 19; 20} or UNINITIALIZED repeated %8 .[bits 17179869184 to ..]# ∈ {0; 20} or UNINITIALIZED repeated %8 p ∈ {{ (char *)&v1 }} q ∈ {1} p2 ∈ {{ &v2 + {4} }} p4 ∈ {{ &v5 + [0..32767] }} p5 ∈ {{ &v5 + [0..2147483647] }} p6 ∈ {{ &v5 + [0..4294967295] }} [eva:final-states] Values at end of function overlap: t_char[0..99] ∈ [--..--] or UNINITIALIZED [eva:final-states] Values at end of function paste_big: i ∈ [0..299] s.c[0..20479] ∈ {2} .i ∈ {33686018} t_big[0].c[0..191] ∈ [--..--] or UNINITIALIZED [0].c[192..195] ∈ [--..--] {[0]{.c[196..20479]; .i}; [1..299]} ∈ [--..--] or UNINITIALIZED v_0 ∈ [--..--] [eva:final-states] Values at end of function weak_update_imprecise_size: vx ∈ {1} vy ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function write_garbled: NULL[rbits 800 to 1607] ∈ {{ garbled mix of &{j; k} (origin: Misaligned {tests/builtins/imprecise.c:22}) }} i ∈ {1} j ∈ {{ NULL + [1..197] ; (int)&j ; &k + [0..16] }} k[0..4] ∈ {{ garbled mix of &{j; k} (origin: Misaligned {tests/builtins/imprecise.c:22}) }} p ∈ {{ NULL + [100..197] ; &j ; &k + [0..16] }} [eva:final-states] Values at end of function main: NULL[rbits 800 to 1607] ∈ [--..--] or ESCAPINGADDR v1.[bits 0 to 7] ∈ {1} .[bits 8 to ..] ∈ {0} or UNINITIALIZED v2.[bits 0 to 31] ∈ {0} or UNINITIALIZED .[bits 32 to 63] ∈ {{ (? *)&addr }} .[bits 64 to ..] ∈ {0} or UNINITIALIZED v3.[bits 0 to ..]# ∈ {0; 251} or UNINITIALIZED repeated %8 v5.[bits 0 to 262143]# ∈ {0; 18; 19; 20} or UNINITIALIZED repeated %8 .[bits 262144 to 17179869183]# ∈ {0; 19; 20} or UNINITIALIZED repeated %8 .[bits 17179869184 to ..]# ∈ {0; 20} or UNINITIALIZED repeated %8 p_gm_null ∈ [100..197] [from] Computing for function cast_address [from] Done for function cast_address [from] Computing for function garbled_mix_null [from] Computing for function gm_f1 <-garbled_mix_null [from] Done for function gm_f1 [from] Computing for function gm_f2 <-garbled_mix_null [from] Done for function gm_f2 [from] Done for function garbled_mix_null [from] Computing for function invalid_assigns_imprecise [from] Computing for function f <-invalid_assigns_imprecise [from] Done for function f [from] Done for function invalid_assigns_imprecise [from] Computing for function many_writes [from] Done for function many_writes [from] Computing for function abstract_structs [from] Computing for function memset <-abstract_structs [from] Done for function memset [from] Done for function abstract_structs [from] Computing for function overlap [from] Done for function overlap [from] Computing for function paste_big [from] Done for function paste_big [from] Computing for function weak_update_imprecise_size [from] Done for function weak_update_imprecise_size [from] Computing for function write_garbled [from] Done for function write_garbled [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function cast_address: NO EFFECTS [from] Function f: NULL[100..200] FROM \nothing (and SELF) [from] Function gm_f1: \result FROM \nothing [from] Function gm_f2: NULL[100..200] FROM NULL[100..200] (and SELF) \result FROM NULL[100..200] [from] Function garbled_mix_null: NULL[100..200] FROM NULL[100..200] (and SELF) p_gm_null FROM \nothing [from] Function invalid_assigns_imprecise: NULL[100..200] FROM \nothing (and SELF) [from] Function many_writes: NO EFFECTS [from] Function memset: v3.[bits 0 to 34359738359] FROM c (and SELF) s FROM c (and SELF) \result FROM s [from] Function abstract_structs: v1.[bits 0 to 7] FROM \nothing v2.[bits 32 to 63] FROM \nothing v3.[bits 0 to 34359738359] FROM \nothing (and SELF) v5.[bits 0 to ..] FROM v (and SELF) [from] Function overlap: NO EFFECTS [from] Function paste_big: v3.[bits 0 to 34359738359] FROM \nothing (and SELF) [from] Function weak_update_imprecise_size: NO EFFECTS [from] Function write_garbled: NULL[100..200] FROM \nothing (and SELF) [from] Function main: NULL[100..200] FROM NULL[100..200] (and SELF) v1.[bits 0 to 7] FROM \nothing v2.[bits 32 to 63] FROM \nothing v3.[bits 0 to 34359738359] FROM \nothing (and SELF) v5.[bits 0 to ..] FROM v (and SELF) p_gm_null FROM \nothing [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to gm_f1 at tests/builtins/imprecise.c:75 (by garbled_mix_null): \result FROM \nothing [from] call to Frama_C_dump_each at tests/builtins/imprecise.c:76 (by garbled_mix_null): \result FROM \nothing [from] call to gm_f2 at tests/builtins/imprecise.c:77 (by garbled_mix_null): NULL[100..200] FROM NULL[100..200] (and SELF) \result FROM NULL[100..200] [from] call to Frama_C_dump_each at tests/builtins/imprecise.c:78 (by garbled_mix_null): \result FROM \nothing [from] call to f at tests/builtins/imprecise.c:11 (by invalid_assigns_imprecise): NULL[100..200] FROM \nothing (and SELF) [from] call to memset at tests/builtins/imprecise.c:51 (by abstract_structs): v3.[bits 0 to ..] FROM c (and SELF) \result FROM s [from] call to memset at tests/builtins/imprecise.c:133 (by paste_big): s FROM c \result FROM s [from] call to Frama_C_dump_each at tests/builtins/imprecise.c:21 (by write_garbled): \result FROM \nothing [from] call to invalid_assigns_imprecise at tests/builtins/imprecise.c:144 (by main): NULL[100..200] FROM \nothing (and SELF) [from] call to write_garbled at tests/builtins/imprecise.c:145 (by main): NULL[100..200] FROM \nothing (and SELF) [from] call to abstract_structs at tests/builtins/imprecise.c:146 (by main): v1.[bits 0 to 7] FROM \nothing v2.[bits 32 to 63] FROM \nothing v3.[bits 0 to ..] FROM \nothing (and SELF) v5.[bits 0 to ..] FROM v (and SELF) [from] call to cast_address at tests/builtins/imprecise.c:147 (by main): NO EFFECTS [from] call to garbled_mix_null at tests/builtins/imprecise.c:148 (by main): NULL[100..200] FROM NULL[100..200] (and SELF) p_gm_null FROM \nothing [from] call to weak_update_imprecise_size at tests/builtins/imprecise.c:149 (by main): NO EFFECTS [from] call to many_writes at tests/builtins/imprecise.c:150 (by main): NO EFFECTS [from] call to overlap at tests/builtins/imprecise.c:151 (by main): NO EFFECTS [from] call to paste_big at tests/builtins/imprecise.c:152 (by main): NO EFFECTS [from] entry point: NULL[100..200] FROM NULL[100..200] (and SELF) v1.[bits 0 to 7] FROM \nothing v2.[bits 32 to 63] FROM \nothing v3.[bits 0 to ..] FROM \nothing (and SELF) v5.[bits 0 to ..] FROM v (and SELF) p_gm_null FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function cast_address: p; c1; c2; c3 [inout] Inputs for function cast_address: \nothing [inout] InOut (internal) for function cast_address: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: p; c1; c2; c3 [inout] Out (internal) for function garbled_mix_null: NULL[100..200]; p_gm_null [inout] Inputs for function garbled_mix_null: NULL[100..200]; p_gm_null [inout] InOut (internal) for function garbled_mix_null: Operational inputs: NULL[100..200] Operational inputs on termination: NULL[100..200] Sure outputs: p_gm_null [inout] Out (internal) for function invalid_assigns_imprecise: p [inout] Inputs for function invalid_assigns_imprecise: \nothing [inout] InOut (internal) for function invalid_assigns_imprecise: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: p [inout] Out (internal) for function many_writes: t_packed1{[0..298]; [299].i1}; t_packed2{[0..298]; [299].i1} [inout] Inputs for function many_writes: v [inout] InOut (internal) for function many_writes: Operational inputs: v Operational inputs on termination: v Sure outputs: \nothing [inout] Out (internal) for function abstract_structs: v1.[bits 0 to 7]; v2.[bits 32 to 63]; v3.[bits 0 to ..]; v5.[bits 0 to ..]; p; w1; w; q; p2; p4; p5; p6 [inout] Inputs for function abstract_structs: v; v1.[bits 0 to 7] [inout] InOut (internal) for function abstract_structs: Operational inputs: v; v1.[bits 0 to 7] Operational inputs on termination: v; v1.[bits 0 to 7] Sure outputs: v1.[bits 0 to 7]; v2.[bits 32 to 63]; p; q; p2; p4; p5; p6 [inout] Out (internal) for function overlap: t_char[0..99] [inout] Inputs for function overlap: v [inout] InOut (internal) for function overlap: Operational inputs: v Operational inputs on termination: v Sure outputs: \nothing [inout] Out (internal) for function paste_big: i; s; t_big[0..299]; v_0 [inout] Inputs for function paste_big: v [inout] InOut (internal) for function paste_big: Operational inputs: v; t_big[0].c[192..195] Operational inputs on termination: v; t_big[0].c[192..195] Sure outputs: i; s; v_0 [inout] Out (internal) for function weak_update_imprecise_size: vx; vy [inout] Inputs for function weak_update_imprecise_size: v [inout] InOut (internal) for function weak_update_imprecise_size: Operational inputs: v Operational inputs on termination: v Sure outputs: vx [inout] Out (internal) for function write_garbled: NULL[100..200]; i; j; k[0..4]; p [inout] Inputs for function write_garbled: \nothing [inout] InOut (internal) for function write_garbled: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: i; j; k[0..4]; p [inout] Out (internal) for function main: NULL[100..200]; v1.[bits 0 to 7]; v2.[bits 32 to 63]; v3.[bits 0 to ..]; v5.[bits 0 to ..]; p_gm_null [inout] Inputs for function main: NULL[100..200]; v; v1.[bits 0 to 7]; p_gm_null [inout] InOut (internal) for function main: Operational inputs: NULL[100..200]; v; v1.[bits 0 to 7] Operational inputs on termination: NULL[100..200]; v; v1.[bits 0 to 7] Sure outputs: v1.[bits 0 to 7]; v2.[bits 32 to 63]; p_gm_null [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva:initial-state] creating variable S_0_t with imprecise size (type struct s [2]) [eva] tests/builtins/imprecise.c:29: Warning: during initialization of variable 't', size of type 'struct s' cannot be computed (abstract type 'struct s') [eva:initial-state] creating variable S_1_t with imprecise size (type struct s [2]) [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 800 to 1607] ∈ [--..--] v ∈ [--..--] addr ∈ [--..--] v1.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v2.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v3.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v5.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED t[0] ∈ {{ NULL ; (struct s *)&S_0_t }} [1] ∈ {{ NULL ; (struct s *)&S_1_t }} [2..9] ∈ {{ NULL ; (struct s *)&S_0_t ; (struct s *)&S_1_t }} p_gm_null ∈ {{ NULL ; &S_p_gm_null[0] }} s1.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED s2.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_0_t[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_t[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_p_gm_null[0] ∈ {{ NULL ; &S_0_S_p_gm_null[0] }} [1] ∈ {{ NULL ; &S_1_S_p_gm_null[0] }} S_0_S_p_gm_null[0..1] ∈ [--..--] S_1_S_p_gm_null[0..1] ∈ [--..--] [eva] computing for function invalid_assigns_imprecise <- main. Called from tests/builtins/imprecise.c:144. [eva] computing for function f <- invalid_assigns_imprecise <- main. Called from tests/builtins/imprecise.c:11. [eva] Done for function f [eva] Recording results for invalid_assigns_imprecise [from] Computing for function invalid_assigns_imprecise [from] Done for function invalid_assigns_imprecise [eva] Done for function invalid_assigns_imprecise [eva] computing for function write_garbled <- main. Called from tests/builtins/imprecise.c:145. [eva:alarm] tests/builtins/imprecise.c:20: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/imprecise.c:21: Frama_C_dump_each: # Cvalue domain: NULL[rbits 800 to 1607] ∈ [--..--] __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {{ NULL ; &S___fc_strtok_ptr[0] }} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} i ∈ {1} j ∈ {1; 2} k[0..4] ∈ [--..--] p ∈ {{ NULL + [100..197] ; &j ; &k + [0..16] }} v ∈ [--..--] addr ∈ [--..--] v1.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v2.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v3.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v5.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED t[0] ∈ {{ NULL ; (struct s *)&S_0_t }} [1] ∈ {{ NULL ; (struct s *)&S_1_t }} [2..9] ∈ {{ NULL ; (struct s *)&S_0_t ; (struct s *)&S_1_t }} p_gm_null ∈ {{ NULL ; &S_p_gm_null[0] }} s1.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED s2.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S___fc_strtok_ptr[0..1] ∈ [--..--] S_0_t[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_t[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_p_gm_null[0] ∈ {{ NULL ; &S_0_S_p_gm_null[0] }} [1] ∈ {{ NULL ; &S_1_S_p_gm_null[0] }} S_0_S_p_gm_null[0..1] ∈ [--..--] S_1_S_p_gm_null[0..1] ∈ [--..--] ==END OF DUMP== [eva] Recording results for write_garbled [from] Computing for function write_garbled [from] Done for function write_garbled [eva] Done for function write_garbled [eva] computing for function abstract_structs <- main. Called from tests/builtins/imprecise.c:146. [eva:alarm] tests/builtins/imprecise.c:37: Warning: accessing uninitialized left-value. assert \initialized(p); [eva:alarm] tests/builtins/imprecise.c:37: Warning: out of bounds read. assert \valid_read(p); [eva:alarm] tests/builtins/imprecise.c:40: Warning: accessing uninitialized left-value. assert \initialized(p); [eva:alarm] tests/builtins/imprecise.c:40: Warning: out of bounds read. assert \valid_read(p); [eva:alarm] tests/builtins/imprecise.c:45: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/imprecise.c:46: Warning: out of bounds read. assert \valid_read(p); [eva] tests/builtins/imprecise.c:51: Call to builtin memset [eva:alarm] tests/builtins/imprecise.c:53: Warning: out of bounds write. assert \valid(p2); [eva:alarm] tests/builtins/imprecise.c:56: Warning: out of bounds write. assert \valid(p4); [eva:alarm] tests/builtins/imprecise.c:58: Warning: out of bounds write. assert \valid(p5); [eva:alarm] tests/builtins/imprecise.c:60: Warning: out of bounds write. assert \valid(p6); [eva] Recording results for abstract_structs [from] Computing for function abstract_structs [from] Done for function abstract_structs [eva] Done for function abstract_structs [eva] computing for function cast_address <- main. Called from tests/builtins/imprecise.c:147. [eva:alarm] tests/builtins/imprecise.c:68: Warning: signed overflow. assert -2147483648 ≤ (int)*((char *)(&p)) + 0; [eva:alarm] tests/builtins/imprecise.c:68: Warning: signed overflow. assert (int)*((char *)(&p)) + 0 ≤ 2147483647; [eva] Recording results for cast_address [from] Computing for function cast_address [from] Done for function cast_address [eva] Done for function cast_address [eva] computing for function garbled_mix_null <- main. Called from tests/builtins/imprecise.c:148. [eva] computing for function gm_f1 <- garbled_mix_null <- main. Called from tests/builtins/imprecise.c:75. [eva] Done for function gm_f1 [eva] tests/builtins/imprecise.c:76: Frama_C_dump_each: # Cvalue domain: NULL[rbits 800 to 1607] ∈ [--..--] or ESCAPINGADDR __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {{ NULL ; &S___fc_strtok_ptr[0] }} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} v ∈ [--..--] addr ∈ [--..--] v1.[bits 0 to 7] ∈ {1} .[bits 8 to ..] ∈ [--..--] or UNINITIALIZED v2.[bits 0 to 31] ∈ [--..--] or UNINITIALIZED .[bits 32 to 63] ∈ {{ (? *)&addr }} .[bits 64 to ..] ∈ [--..--] or UNINITIALIZED v3.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v5.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED t[0] ∈ {{ NULL ; (struct s *)&S_0_t }} [1] ∈ {{ NULL ; (struct s *)&S_1_t }} [2..9] ∈ {{ NULL ; (struct s *)&S_0_t ; (struct s *)&S_1_t }} p_gm_null ∈ [--..--] s1.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED s2.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S___fc_strtok_ptr[0..1] ∈ [--..--] S_0_t[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_t[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_p_gm_null[0] ∈ {{ NULL ; &S_0_S_p_gm_null[0] }} [1] ∈ {{ NULL ; &S_1_S_p_gm_null[0] }} S_0_S_p_gm_null[0..1] ∈ [--..--] S_1_S_p_gm_null[0..1] ∈ [--..--] ==END OF DUMP== [eva:alarm] tests/builtins/imprecise.c:77: Warning: out of bounds read. assert \valid_read(p_gm_null); [eva:alarm] tests/builtins/imprecise.c:77: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(p_gm_null); [eva] computing for function gm_f2 <- garbled_mix_null <- main. Called from tests/builtins/imprecise.c:77. [eva] Done for function gm_f2 [eva] tests/builtins/imprecise.c:78: Frama_C_dump_each: # Cvalue domain: NULL[rbits 800 to 1607] ∈ [--..--] or ESCAPINGADDR __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {{ NULL ; &S___fc_strtok_ptr[0] }} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} v ∈ [--..--] addr ∈ [--..--] v1.[bits 0 to 7] ∈ {1} .[bits 8 to ..] ∈ [--..--] or UNINITIALIZED v2.[bits 0 to 31] ∈ [--..--] or UNINITIALIZED .[bits 32 to 63] ∈ {{ (? *)&addr }} .[bits 64 to ..] ∈ [--..--] or UNINITIALIZED v3.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v5.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED t[0] ∈ {{ NULL ; (struct s *)&S_0_t }} [1] ∈ {{ NULL ; (struct s *)&S_1_t }} [2..9] ∈ {{ NULL ; (struct s *)&S_0_t ; (struct s *)&S_1_t }} p_gm_null ∈ [100..197] s1.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED s2.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S___fc_strtok_ptr[0..1] ∈ [--..--] S_0_t[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_t[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_p_gm_null[0] ∈ {{ NULL ; &S_0_S_p_gm_null[0] }} [1] ∈ {{ NULL ; &S_1_S_p_gm_null[0] }} S_0_S_p_gm_null[0..1] ∈ [--..--] S_1_S_p_gm_null[0..1] ∈ [--..--] ==END OF DUMP== [eva] Recording results for garbled_mix_null [from] Computing for function garbled_mix_null [from] Done for function garbled_mix_null [eva] Done for function garbled_mix_null [eva] computing for function weak_update_imprecise_size <- main. Called from tests/builtins/imprecise.c:149. [eva] Recording results for weak_update_imprecise_size [from] Computing for function weak_update_imprecise_size [from] Done for function weak_update_imprecise_size [eva] Done for function weak_update_imprecise_size [eva] computing for function many_writes <- main. Called from tests/builtins/imprecise.c:150. [eva:alarm] tests/builtins/imprecise.c:111: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/builtins/imprecise.c:111: Warning: accessing out of bounds index. assert v < 300; [eva:alarm] tests/builtins/imprecise.c:114: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/builtins/imprecise.c:114: Warning: accessing out of bounds index. assert v < 300; [eva] Recording results for many_writes [from] Computing for function many_writes [from] Done for function many_writes [eva] Done for function many_writes [eva] computing for function overlap <- main. Called from tests/builtins/imprecise.c:151. [eva:alarm] tests/builtins/imprecise.c:122: Warning: out of bounds write. assert \valid((int *)(&t_char[v])); [eva] Recording results for overlap [from] Computing for function overlap [from] Done for function overlap [eva] Done for function overlap [eva] computing for function paste_big <- main. Called from tests/builtins/imprecise.c:152. [eva] tests/builtins/imprecise.c:133: Call to builtin memset [eva:alarm] tests/builtins/imprecise.c:140: Warning: accessing uninitialized left-value. assert \initialized((int *)(&t_big) + 48); [eva] Recording results for paste_big [from] Computing for function paste_big [from] Done for function paste_big [eva] Done for function paste_big [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function cast_address: p ∈ {{ &x }} c1 ∈ {{ garbled mix of &{x} (origin: Arithmetic {tests/builtins/imprecise.c:66}) }} c2# ∈ {{ (? *)&x }}%32, bits 0 to 7 c3 ∈ {{ garbled mix of &{x} (origin: Misaligned {tests/builtins/imprecise.c:68}) }} [eva:final-states] Values at end of function garbled_mix_null: NULL[rbits 800 to 1607] ∈ [--..--] or ESCAPINGADDR p_gm_null ∈ [100..197] [eva:final-states] Values at end of function invalid_assigns_imprecise: p ∈ {0} [eva:final-states] Values at end of function many_writes: t_packed1{[0..298]{.i1; .i2#; .[bits 48 to 63]#}; [299].i1} ∈ {1} or UNINITIALIZED repeated %32 [299]{.i2; .[bits 48 to 63]} ∈ UNINITIALIZED t_packed2{[0..298]; [299].i1} ∈ [--..--] or UNINITIALIZED [299].i2 ∈ UNINITIALIZED [eva:final-states] Values at end of function abstract_structs: v1.[bits 0 to 7] ∈ {1} .[bits 8 to ..] ∈ [--..--] or UNINITIALIZED v2.[bits 0 to 31] ∈ [--..--] or UNINITIALIZED .[bits 32 to 63] ∈ {{ (? *)&addr }} .[bits 64 to ..] ∈ [--..--] or UNINITIALIZED v3.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v5.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED p ∈ {{ (char *)&v1 }} q ∈ {1} p2 ∈ {{ &v2 + {4} }} p4 ∈ {{ &v5 + [0..32767] }} p5 ∈ {{ &v5 + [0..2147483647] }} p6 ∈ {{ &v5 + [0..4294967295] }} [eva:final-states] Values at end of function overlap: t_char[0..99] ∈ [--..--] or UNINITIALIZED [eva:final-states] Values at end of function paste_big: i ∈ [0..299] s.c[0..20479] ∈ {2} .i ∈ {33686018} t_big[0].c[0..191] ∈ [--..--] or UNINITIALIZED [0].c[192..195] ∈ [--..--] {[0]{.c[196..20479]; .i}; [1..299]} ∈ [--..--] or UNINITIALIZED v_0 ∈ [--..--] [eva:final-states] Values at end of function weak_update_imprecise_size: vx ∈ {1} vy ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function write_garbled: NULL[rbits 800 to 1607] ∈ {{ garbled mix of &{j; k} (origin: Misaligned {tests/builtins/imprecise.c:22}) }} i ∈ {1} j ∈ {{ NULL + [1..197] ; (int)&j ; &k + [0..16] }} k[0..4] ∈ {{ garbled mix of &{j; k} (origin: Misaligned {tests/builtins/imprecise.c:22}) }} p ∈ {{ NULL + [100..197] ; &j ; &k + [0..16] }} [eva:final-states] Values at end of function main: NULL[rbits 800 to 1607] ∈ [--..--] or ESCAPINGADDR v1.[bits 0 to 7] ∈ {1} .[bits 8 to ..] ∈ [--..--] or UNINITIALIZED v2.[bits 0 to 31] ∈ [--..--] or UNINITIALIZED .[bits 32 to 63] ∈ {{ (? *)&addr }} .[bits 64 to ..] ∈ [--..--] or UNINITIALIZED v3.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED v5.[bits 0 to ..] ∈ [--..--] or UNINITIALIZED p_gm_null ∈ [100..197] [from] Computing for function cast_address [from] Done for function cast_address [from] Computing for function garbled_mix_null [from] Computing for function gm_f1 <-garbled_mix_null [from] Done for function gm_f1 [from] Computing for function gm_f2 <-garbled_mix_null [from] Done for function gm_f2 [from] Done for function garbled_mix_null [from] Computing for function invalid_assigns_imprecise [from] Computing for function f <-invalid_assigns_imprecise [from] Done for function f [from] Done for function invalid_assigns_imprecise [from] Computing for function many_writes [from] Done for function many_writes [from] Computing for function abstract_structs [from] Computing for function memset <-abstract_structs [from] Done for function memset [from] Done for function abstract_structs [from] Computing for function overlap [from] Done for function overlap [from] Computing for function paste_big [from] Done for function paste_big [from] Computing for function weak_update_imprecise_size [from] Done for function weak_update_imprecise_size [from] Computing for function write_garbled [from] Done for function write_garbled [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function cast_address: NO EFFECTS [from] Function f: NULL[100..200] FROM \nothing (and SELF) [from] Function gm_f1: \result FROM \nothing [from] Function gm_f2: NULL[100..200] FROM NULL[100..200] (and SELF) \result FROM NULL[100..200] [from] Function garbled_mix_null: NULL[100..200] FROM NULL[100..200] (and SELF) p_gm_null FROM \nothing [from] Function invalid_assigns_imprecise: NULL[100..200] FROM \nothing (and SELF) [from] Function many_writes: NO EFFECTS [from] Function memset: v3.[bits 0 to 34359738359] FROM c (and SELF) s FROM c (and SELF) \result FROM s [from] Function abstract_structs: v1.[bits 0 to 7] FROM \nothing v2.[bits 32 to 63] FROM \nothing v3.[bits 0 to 34359738359] FROM \nothing (and SELF) v5.[bits 0 to ..] FROM v (and SELF) [from] Function overlap: NO EFFECTS [from] Function paste_big: v3.[bits 0 to 34359738359] FROM \nothing (and SELF) [from] Function weak_update_imprecise_size: NO EFFECTS [from] Function write_garbled: NULL[100..200] FROM \nothing (and SELF) [from] Function main: NULL[100..200] FROM NULL[100..200] (and SELF) v1.[bits 0 to 7] FROM \nothing v2.[bits 32 to 63] FROM \nothing v3.[bits 0 to 34359738359] FROM \nothing (and SELF) v5.[bits 0 to ..] FROM v (and SELF) p_gm_null FROM \nothing [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to gm_f1 at tests/builtins/imprecise.c:75 (by garbled_mix_null): \result FROM \nothing [from] call to Frama_C_dump_each at tests/builtins/imprecise.c:76 (by garbled_mix_null): \result FROM \nothing [from] call to gm_f2 at tests/builtins/imprecise.c:77 (by garbled_mix_null): NULL[100..200] FROM NULL[100..200] (and SELF) \result FROM NULL[100..200] [from] call to Frama_C_dump_each at tests/builtins/imprecise.c:78 (by garbled_mix_null): \result FROM \nothing [from] call to f at tests/builtins/imprecise.c:11 (by invalid_assigns_imprecise): NULL[100..200] FROM \nothing (and SELF) [from] call to memset at tests/builtins/imprecise.c:51 (by abstract_structs): v3.[bits 0 to ..] FROM c (and SELF) \result FROM s [from] call to memset at tests/builtins/imprecise.c:133 (by paste_big): s FROM c \result FROM s [from] call to Frama_C_dump_each at tests/builtins/imprecise.c:21 (by write_garbled): \result FROM \nothing [from] call to invalid_assigns_imprecise at tests/builtins/imprecise.c:144 (by main): NULL[100..200] FROM \nothing (and SELF) [from] call to write_garbled at tests/builtins/imprecise.c:145 (by main): NULL[100..200] FROM \nothing (and SELF) [from] call to abstract_structs at tests/builtins/imprecise.c:146 (by main): v1.[bits 0 to 7] FROM \nothing v2.[bits 32 to 63] FROM \nothing v3.[bits 0 to ..] FROM \nothing (and SELF) v5.[bits 0 to ..] FROM v (and SELF) [from] call to cast_address at tests/builtins/imprecise.c:147 (by main): NO EFFECTS [from] call to garbled_mix_null at tests/builtins/imprecise.c:148 (by main): NULL[100..200] FROM NULL[100..200] (and SELF) p_gm_null FROM \nothing [from] call to weak_update_imprecise_size at tests/builtins/imprecise.c:149 (by main): NO EFFECTS [from] call to many_writes at tests/builtins/imprecise.c:150 (by main): NO EFFECTS [from] call to overlap at tests/builtins/imprecise.c:151 (by main): NO EFFECTS [from] call to paste_big at tests/builtins/imprecise.c:152 (by main): NO EFFECTS [from] entry point: NULL[100..200] FROM NULL[100..200] (and SELF) v1.[bits 0 to 7] FROM \nothing v2.[bits 32 to 63] FROM \nothing v3.[bits 0 to ..] FROM \nothing (and SELF) v5.[bits 0 to ..] FROM v (and SELF) p_gm_null FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function cast_address: p; c1; c2; c3 [inout] Inputs for function cast_address: \nothing [inout] InOut (internal) for function cast_address: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: p; c1; c2; c3 [inout] Out (internal) for function garbled_mix_null: NULL[100..200]; p_gm_null [inout] Inputs for function garbled_mix_null: NULL[100..200]; p_gm_null [inout] InOut (internal) for function garbled_mix_null: Operational inputs: NULL[100..200] Operational inputs on termination: NULL[100..200] Sure outputs: p_gm_null [inout] Out (internal) for function invalid_assigns_imprecise: p [inout] Inputs for function invalid_assigns_imprecise: \nothing [inout] InOut (internal) for function invalid_assigns_imprecise: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: p [inout] Out (internal) for function many_writes: t_packed1{[0..298]; [299].i1}; t_packed2{[0..298]; [299].i1} [inout] Inputs for function many_writes: v [inout] InOut (internal) for function many_writes: Operational inputs: v Operational inputs on termination: v Sure outputs: \nothing [inout] Out (internal) for function abstract_structs: v1.[bits 0 to 7]; v2.[bits 32 to 63]; v3.[bits 0 to ..]; v5.[bits 0 to ..]; p; w1; w; q; p2; p4; p5; p6 [inout] Inputs for function abstract_structs: v; v1.[bits 0 to 7] [inout] InOut (internal) for function abstract_structs: Operational inputs: v; v1.[bits 0 to 7] Operational inputs on termination: v; v1.[bits 0 to 7] Sure outputs: v1.[bits 0 to 7]; v2.[bits 32 to 63]; p; q; p2; p4; p5; p6 [inout] Out (internal) for function overlap: t_char[0..99] [inout] Inputs for function overlap: v [inout] InOut (internal) for function overlap: Operational inputs: v Operational inputs on termination: v Sure outputs: \nothing [inout] Out (internal) for function paste_big: i; s; t_big[0..299]; v_0 [inout] Inputs for function paste_big: v [inout] InOut (internal) for function paste_big: Operational inputs: v; t_big[0].c[192..195] Operational inputs on termination: v; t_big[0].c[192..195] Sure outputs: i; s; v_0 [inout] Out (internal) for function weak_update_imprecise_size: vx; vy [inout] Inputs for function weak_update_imprecise_size: v [inout] InOut (internal) for function weak_update_imprecise_size: Operational inputs: v Operational inputs on termination: v Sure outputs: vx [inout] Out (internal) for function write_garbled: NULL[100..200]; i; j; k[0..4]; p [inout] Inputs for function write_garbled: \nothing [inout] InOut (internal) for function write_garbled: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: i; j; k[0..4]; p [inout] Out (internal) for function main: NULL[100..200]; v1.[bits 0 to 7]; v2.[bits 32 to 63]; v3.[bits 0 to ..]; v5.[bits 0 to ..]; p_gm_null [inout] Inputs for function main: NULL[100..200]; v; v1.[bits 0 to 7]; p_gm_null [inout] InOut (internal) for function main: Operational inputs: NULL[100..200]; v; v1.[bits 0 to 7] Operational inputs on termination: NULL[100..200]; v; v1.[bits 0 to 7] Sure outputs: v1.[bits 0 to 7]; v2.[bits 32 to 63]; p_gm_null ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/linked_list.0.res.oracle���������������������������������0000666�0000000�0000000�00000212543�13571573400�022100� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/linked_list.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization MEMORY[0..1023] ∈ {0} malloc_next_free ∈ {0} [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[0..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ UNINITIALIZED head ∈ {0} i ∈ {1} malloc_next_free ∈ {0} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva:alarm] share/libc/stdlib.h:394: Warning: function malloc, behavior allocation: postcondition 'allocation' got status unknown. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[0..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY }} head ∈ {0} i ∈ {1} malloc_next_free ∈ {8} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:39: starting to merge loop iterations [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1} [4..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY }} or UNINITIALIZED head ∈ {{ NULL ; (item *)&MEMORY }} i ∈ {1; 2} malloc_next_free ∈ {0; 8} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1} [4..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8]} }} head ∈ {{ NULL ; (item *)&MEMORY }} i ∈ {1; 2} malloc_next_free ∈ {8; 16} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1; 2} [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY }} [bits 64 to 95] ∈ {0; 1; 2} [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY }} [16..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8]} }} or UNINITIALIZED head ∈ {{ NULL ; (item *)&MEMORY{[0], [8]} }} i ∈ {1; 2; 3} malloc_next_free ∈ {0; 8; 16} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1; 2} [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY }} [bits 64 to 95] ∈ {0; 1; 2} [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY }} [16..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16]} }} head ∈ {{ NULL ; (item *)&MEMORY{[0], [8]} }} i ∈ {1; 2; 3} malloc_next_free ∈ {8; 16; 24} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1; 2; 3} [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [bits 64 to 95] ∈ {0; 1; 2; 3} [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [bits 128 to 159] ∈ {0; 1; 2; 3} [bits 160 to 191] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [24..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16]} }} or UNINITIALIZED head ∈ {{ NULL ; (item *)&MEMORY{[0], [8], [16]} }} i ∈ [1..10] malloc_next_free ∈ {0; 8; 16; 24} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1; 2; 3} [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [bits 64 to 95] ∈ {0; 1; 2; 3} [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [bits 128 to 159] ∈ {0; 1; 2; 3} [bits 160 to 191] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [24..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16], [24]} }} head ∈ {{ NULL ; (item *)&MEMORY{[0], [8], [16]} }} i ∈ [1..10] malloc_next_free ∈ {8; 16; 24; 32} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [32..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16], [24]} }} or UNINITIALIZED head ∈ {{ NULL ; (item *)&MEMORY{[0], [8], [16], [24]} }} i ∈ [1..10] malloc_next_free ∈ {0; 8; 16; 24; 32} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [32..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16], [24], [32]} }} head ∈ {{ NULL ; (item *)&MEMORY{[0], [8], [16], [24]} }} i ∈ [1..10] malloc_next_free ∈ {8; 16; 24; 32; 40} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 256 to 287] ∈ [0..10] [bits 288 to 319] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16], [24]} }} [40..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ &MEMORY + [0..1016],0%8 }} or UNINITIALIZED head ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} i ∈ [1..10] malloc_next_free ∈ [0..2147483640],0%8 S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 256 to 287] ∈ [0..10] [bits 288 to 319] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16], [24]} }} [40..1023] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ NULL ; &MEMORY + [0..4294967288],0%8 }} head ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} i ∈ [1..10] malloc_next_free ∈ [-2147483648..2147483640],0%8 S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva:alarm] tests/builtins/linked_list.c:43: Warning: out of bounds write. assert \valid(&curr->val); [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 256 to 287] ∈ [0..10] [bits 288 to 319] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 320 to 351] ∈ [0..10] [bits 352 to 383] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 384 to 415] ∈ [0..10] [bits 416 to 447] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 448 to 479] ∈ [0..10] [bits 480 to 511] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 512 to 543] ∈ [0..10] [bits 544 to 575] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 576 to 607] ∈ [0..10] [bits 608 to 639] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 640 to 671] ∈ [0..10] [bits 672 to 703] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 704 to 735] ∈ [0..10] [bits 736 to 767] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 768 to 799] ∈ [0..10] [bits 800 to 831] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 832 to 863] ∈ [0..10] [bits 864 to 895] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 896 to 927] ∈ [0..10] [bits 928 to 959] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 960 to 991] ∈ [0..10] [bits 992 to 1023] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1024 to 1055] ∈ [0..10] [bits 1056 to 1087] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1088 to 1119] ∈ [0..10] [bits 1120 to 1151] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1152 to 1183] ∈ [0..10] [bits 1184 to 1215] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1216 to 1247] ∈ [0..10] [bits 1248 to 1279] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1280 to 1311] ∈ [0..10] [bits 1312 to 1343] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1344 to 1375] ∈ [0..10] [bits 1376 to 1407] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1408 to 1439] ∈ [0..10] [bits 1440 to 1471] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1472 to 1503] ∈ [0..10] [bits 1504 to 1535] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1536 to 1567] ∈ [0..10] [bits 1568 to 1599] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1600 to 1631] ∈ [0..10] [bits 1632 to 1663] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1664 to 1695] ∈ [0..10] [bits 1696 to 1727] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1728 to 1759] ∈ [0..10] [bits 1760 to 1791] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1792 to 1823] ∈ [0..10] [bits 1824 to 1855] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1856 to 1887] ∈ [0..10] [bits 1888 to 1919] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1920 to 1951] ∈ [0..10] [bits 1952 to 1983] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1984 to 2015] ∈ [0..10] [bits 2016 to 2047] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2048 to 2079] ∈ [0..10] [bits 2080 to 2111] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2112 to 2143] ∈ [0..10] [bits 2144 to 2175] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2176 to 2207] ∈ [0..10] [bits 2208 to 2239] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2240 to 2271] ∈ [0..10] [bits 2272 to 2303] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2304 to 2335] ∈ [0..10] [bits 2336 to 2367] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2368 to 2399] ∈ [0..10] [bits 2400 to 2431] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2432 to 2463] ∈ [0..10] [bits 2464 to 2495] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2496 to 2527] ∈ [0..10] [bits 2528 to 2559] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2560 to 2591] ∈ [0..10] [bits 2592 to 2623] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2624 to 2655] ∈ [0..10] [bits 2656 to 2687] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2688 to 2719] ∈ [0..10] [bits 2720 to 2751] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2752 to 2783] ∈ [0..10] [bits 2784 to 2815] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2816 to 2847] ∈ [0..10] [bits 2848 to 2879] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2880 to 2911] ∈ [0..10] [bits 2912 to 2943] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2944 to 2975] ∈ [0..10] [bits 2976 to 3007] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3008 to 3039] ∈ [0..10] [bits 3040 to 3071] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3072 to 3103] ∈ [0..10] [bits 3104 to 3135] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3136 to 3167] ∈ [0..10] [bits 3168 to 3199] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3200 to 3231] ∈ [0..10] [bits 3232 to 3263] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3264 to 3295] ∈ [0..10] [bits 3296 to 3327] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3328 to 3359] ∈ [0..10] [bits 3360 to 3391] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3392 to 3423] ∈ [0..10] [bits 3424 to 3455] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3456 to 3487] ∈ [0..10] [bits 3488 to 3519] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3520 to 3551] ∈ [0..10] [bits 3552 to 3583] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3584 to 3615] ∈ [0..10] [bits 3616 to 3647] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3648 to 3679] ∈ [0..10] [bits 3680 to 3711] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3712 to 3743] ∈ [0..10] [bits 3744 to 3775] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3776 to 3807] ∈ [0..10] [bits 3808 to 3839] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3840 to 3871] ∈ [0..10] [bits 3872 to 3903] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3904 to 3935] ∈ [0..10] [bits 3936 to 3967] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3968 to 3999] ∈ [0..10] [bits 4000 to 4031] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4032 to 4063] ∈ [0..10] [bits 4064 to 4095] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4096 to 4127] ∈ [0..10] [bits 4128 to 4159] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4160 to 4191] ∈ [0..10] [bits 4192 to 4223] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4224 to 4255] ∈ [0..10] [bits 4256 to 4287] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4288 to 4319] ∈ [0..10] [bits 4320 to 4351] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4352 to 4383] ∈ [0..10] [bits 4384 to 4415] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4416 to 4447] ∈ [0..10] [bits 4448 to 4479] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4480 to 4511] ∈ [0..10] [bits 4512 to 4543] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4544 to 4575] ∈ [0..10] [bits 4576 to 4607] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4608 to 4639] ∈ [0..10] [bits 4640 to 4671] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4672 to 4703] ∈ [0..10] [bits 4704 to 4735] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4736 to 4767] ∈ [0..10] [bits 4768 to 4799] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4800 to 4831] ∈ [0..10] [bits 4832 to 4863] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4864 to 4895] ∈ [0..10] [bits 4896 to 4927] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4928 to 4959] ∈ [0..10] [bits 4960 to 4991] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4992 to 5023] ∈ [0..10] [bits 5024 to 5055] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5056 to 5087] ∈ [0..10] [bits 5088 to 5119] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5120 to 5151] ∈ [0..10] [bits 5152 to 5183] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5184 to 5215] ∈ [0..10] [bits 5216 to 5247] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5248 to 5279] ∈ [0..10] [bits 5280 to 5311] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5312 to 5343] ∈ [0..10] [bits 5344 to 5375] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5376 to 5407] ∈ [0..10] [bits 5408 to 5439] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5440 to 5471] ∈ [0..10] [bits 5472 to 5503] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5504 to 5535] ∈ [0..10] [bits 5536 to 5567] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5568 to 5599] ∈ [0..10] [bits 5600 to 5631] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5632 to 5663] ∈ [0..10] [bits 5664 to 5695] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5696 to 5727] ∈ [0..10] [bits 5728 to 5759] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5760 to 5791] ∈ [0..10] [bits 5792 to 5823] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5824 to 5855] ∈ [0..10] [bits 5856 to 5887] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5888 to 5919] ∈ [0..10] [bits 5920 to 5951] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5952 to 5983] ∈ [0..10] [bits 5984 to 6015] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6016 to 6047] ∈ [0..10] [bits 6048 to 6079] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6080 to 6111] ∈ [0..10] [bits 6112 to 6143] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6144 to 6175] ∈ [0..10] [bits 6176 to 6207] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6208 to 6239] ∈ [0..10] [bits 6240 to 6271] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6272 to 6303] ∈ [0..10] [bits 6304 to 6335] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6336 to 6367] ∈ [0..10] [bits 6368 to 6399] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6400 to 6431] ∈ [0..10] [bits 6432 to 6463] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6464 to 6495] ∈ [0..10] [bits 6496 to 6527] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6528 to 6559] ∈ [0..10] [bits 6560 to 6591] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6592 to 6623] ∈ [0..10] [bits 6624 to 6655] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6656 to 6687] ∈ [0..10] [bits 6688 to 6719] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6720 to 6751] ∈ [0..10] [bits 6752 to 6783] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6784 to 6815] ∈ [0..10] [bits 6816 to 6847] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6848 to 6879] ∈ [0..10] [bits 6880 to 6911] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6912 to 6943] ∈ [0..10] [bits 6944 to 6975] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6976 to 7007] ∈ [0..10] [bits 7008 to 7039] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7040 to 7071] ∈ [0..10] [bits 7072 to 7103] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7104 to 7135] ∈ [0..10] [bits 7136 to 7167] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7168 to 7199] ∈ [0..10] [bits 7200 to 7231] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7232 to 7263] ∈ [0..10] [bits 7264 to 7295] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7296 to 7327] ∈ [0..10] [bits 7328 to 7359] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7360 to 7391] ∈ [0..10] [bits 7392 to 7423] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7424 to 7455] ∈ [0..10] [bits 7456 to 7487] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7488 to 7519] ∈ [0..10] [bits 7520 to 7551] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7552 to 7583] ∈ [0..10] [bits 7584 to 7615] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7616 to 7647] ∈ [0..10] [bits 7648 to 7679] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7680 to 7711] ∈ [0..10] [bits 7712 to 7743] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7744 to 7775] ∈ [0..10] [bits 7776 to 7807] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7808 to 7839] ∈ [0..10] [bits 7840 to 7871] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7872 to 7903] ∈ [0..10] [bits 7904 to 7935] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7936 to 7967] ∈ [0..10] [bits 7968 to 7999] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 8000 to 8031] ∈ [0..10] [bits 8032 to 8063] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 8064 to 8095] ∈ [0..10] [bits 8096 to 8127] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 8128 to 8159] ∈ [0..10] [bits 8160 to 8191] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ &MEMORY + [0..1016],0%8 }} or UNINITIALIZED head ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} i ∈ [1..10] malloc_next_free ∈ [-2147483648..2147483640],0%8 S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 256 to 287] ∈ [0..10] [bits 288 to 319] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 320 to 351] ∈ [0..10] [bits 352 to 383] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 384 to 415] ∈ [0..10] [bits 416 to 447] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 448 to 479] ∈ [0..10] [bits 480 to 511] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 512 to 543] ∈ [0..10] [bits 544 to 575] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 576 to 607] ∈ [0..10] [bits 608 to 639] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 640 to 671] ∈ [0..10] [bits 672 to 703] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 704 to 735] ∈ [0..10] [bits 736 to 767] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 768 to 799] ∈ [0..10] [bits 800 to 831] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 832 to 863] ∈ [0..10] [bits 864 to 895] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 896 to 927] ∈ [0..10] [bits 928 to 959] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 960 to 991] ∈ [0..10] [bits 992 to 1023] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1024 to 1055] ∈ [0..10] [bits 1056 to 1087] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1088 to 1119] ∈ [0..10] [bits 1120 to 1151] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1152 to 1183] ∈ [0..10] [bits 1184 to 1215] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1216 to 1247] ∈ [0..10] [bits 1248 to 1279] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1280 to 1311] ∈ [0..10] [bits 1312 to 1343] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1344 to 1375] ∈ [0..10] [bits 1376 to 1407] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1408 to 1439] ∈ [0..10] [bits 1440 to 1471] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1472 to 1503] ∈ [0..10] [bits 1504 to 1535] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1536 to 1567] ∈ [0..10] [bits 1568 to 1599] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1600 to 1631] ∈ [0..10] [bits 1632 to 1663] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1664 to 1695] ∈ [0..10] [bits 1696 to 1727] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1728 to 1759] ∈ [0..10] [bits 1760 to 1791] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1792 to 1823] ∈ [0..10] [bits 1824 to 1855] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1856 to 1887] ∈ [0..10] [bits 1888 to 1919] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1920 to 1951] ∈ [0..10] [bits 1952 to 1983] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1984 to 2015] ∈ [0..10] [bits 2016 to 2047] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2048 to 2079] ∈ [0..10] [bits 2080 to 2111] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2112 to 2143] ∈ [0..10] [bits 2144 to 2175] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2176 to 2207] ∈ [0..10] [bits 2208 to 2239] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2240 to 2271] ∈ [0..10] [bits 2272 to 2303] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2304 to 2335] ∈ [0..10] [bits 2336 to 2367] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2368 to 2399] ∈ [0..10] [bits 2400 to 2431] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2432 to 2463] ∈ [0..10] [bits 2464 to 2495] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2496 to 2527] ∈ [0..10] [bits 2528 to 2559] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2560 to 2591] ∈ [0..10] [bits 2592 to 2623] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2624 to 2655] ∈ [0..10] [bits 2656 to 2687] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2688 to 2719] ∈ [0..10] [bits 2720 to 2751] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2752 to 2783] ∈ [0..10] [bits 2784 to 2815] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2816 to 2847] ∈ [0..10] [bits 2848 to 2879] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2880 to 2911] ∈ [0..10] [bits 2912 to 2943] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2944 to 2975] ∈ [0..10] [bits 2976 to 3007] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3008 to 3039] ∈ [0..10] [bits 3040 to 3071] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3072 to 3103] ∈ [0..10] [bits 3104 to 3135] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3136 to 3167] ∈ [0..10] [bits 3168 to 3199] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3200 to 3231] ∈ [0..10] [bits 3232 to 3263] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3264 to 3295] ∈ [0..10] [bits 3296 to 3327] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3328 to 3359] ∈ [0..10] [bits 3360 to 3391] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3392 to 3423] ∈ [0..10] [bits 3424 to 3455] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3456 to 3487] ∈ [0..10] [bits 3488 to 3519] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3520 to 3551] ∈ [0..10] [bits 3552 to 3583] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3584 to 3615] ∈ [0..10] [bits 3616 to 3647] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3648 to 3679] ∈ [0..10] [bits 3680 to 3711] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3712 to 3743] ∈ [0..10] [bits 3744 to 3775] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3776 to 3807] ∈ [0..10] [bits 3808 to 3839] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3840 to 3871] ∈ [0..10] [bits 3872 to 3903] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3904 to 3935] ∈ [0..10] [bits 3936 to 3967] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3968 to 3999] ∈ [0..10] [bits 4000 to 4031] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4032 to 4063] ∈ [0..10] [bits 4064 to 4095] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4096 to 4127] ∈ [0..10] [bits 4128 to 4159] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4160 to 4191] ∈ [0..10] [bits 4192 to 4223] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4224 to 4255] ∈ [0..10] [bits 4256 to 4287] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4288 to 4319] ∈ [0..10] [bits 4320 to 4351] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4352 to 4383] ∈ [0..10] [bits 4384 to 4415] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4416 to 4447] ∈ [0..10] [bits 4448 to 4479] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4480 to 4511] ∈ [0..10] [bits 4512 to 4543] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4544 to 4575] ∈ [0..10] [bits 4576 to 4607] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4608 to 4639] ∈ [0..10] [bits 4640 to 4671] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4672 to 4703] ∈ [0..10] [bits 4704 to 4735] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4736 to 4767] ∈ [0..10] [bits 4768 to 4799] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4800 to 4831] ∈ [0..10] [bits 4832 to 4863] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4864 to 4895] ∈ [0..10] [bits 4896 to 4927] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4928 to 4959] ∈ [0..10] [bits 4960 to 4991] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4992 to 5023] ∈ [0..10] [bits 5024 to 5055] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5056 to 5087] ∈ [0..10] [bits 5088 to 5119] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5120 to 5151] ∈ [0..10] [bits 5152 to 5183] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5184 to 5215] ∈ [0..10] [bits 5216 to 5247] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5248 to 5279] ∈ [0..10] [bits 5280 to 5311] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5312 to 5343] ∈ [0..10] [bits 5344 to 5375] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5376 to 5407] ∈ [0..10] [bits 5408 to 5439] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5440 to 5471] ∈ [0..10] [bits 5472 to 5503] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5504 to 5535] ∈ [0..10] [bits 5536 to 5567] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5568 to 5599] ∈ [0..10] [bits 5600 to 5631] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5632 to 5663] ∈ [0..10] [bits 5664 to 5695] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5696 to 5727] ∈ [0..10] [bits 5728 to 5759] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5760 to 5791] ∈ [0..10] [bits 5792 to 5823] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5824 to 5855] ∈ [0..10] [bits 5856 to 5887] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5888 to 5919] ∈ [0..10] [bits 5920 to 5951] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5952 to 5983] ∈ [0..10] [bits 5984 to 6015] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6016 to 6047] ∈ [0..10] [bits 6048 to 6079] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6080 to 6111] ∈ [0..10] [bits 6112 to 6143] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6144 to 6175] ∈ [0..10] [bits 6176 to 6207] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6208 to 6239] ∈ [0..10] [bits 6240 to 6271] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6272 to 6303] ∈ [0..10] [bits 6304 to 6335] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6336 to 6367] ∈ [0..10] [bits 6368 to 6399] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6400 to 6431] ∈ [0..10] [bits 6432 to 6463] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6464 to 6495] ∈ [0..10] [bits 6496 to 6527] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6528 to 6559] ∈ [0..10] [bits 6560 to 6591] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6592 to 6623] ∈ [0..10] [bits 6624 to 6655] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6656 to 6687] ∈ [0..10] [bits 6688 to 6719] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6720 to 6751] ∈ [0..10] [bits 6752 to 6783] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6784 to 6815] ∈ [0..10] [bits 6816 to 6847] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6848 to 6879] ∈ [0..10] [bits 6880 to 6911] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6912 to 6943] ∈ [0..10] [bits 6944 to 6975] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6976 to 7007] ∈ [0..10] [bits 7008 to 7039] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7040 to 7071] ∈ [0..10] [bits 7072 to 7103] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7104 to 7135] ∈ [0..10] [bits 7136 to 7167] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7168 to 7199] ∈ [0..10] [bits 7200 to 7231] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7232 to 7263] ∈ [0..10] [bits 7264 to 7295] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7296 to 7327] ∈ [0..10] [bits 7328 to 7359] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7360 to 7391] ∈ [0..10] [bits 7392 to 7423] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7424 to 7455] ∈ [0..10] [bits 7456 to 7487] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7488 to 7519] ∈ [0..10] [bits 7520 to 7551] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7552 to 7583] ∈ [0..10] [bits 7584 to 7615] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7616 to 7647] ∈ [0..10] [bits 7648 to 7679] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7680 to 7711] ∈ [0..10] [bits 7712 to 7743] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7744 to 7775] ∈ [0..10] [bits 7776 to 7807] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7808 to 7839] ∈ [0..10] [bits 7840 to 7871] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7872 to 7903] ∈ [0..10] [bits 7904 to 7935] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7936 to 7967] ∈ [0..10] [bits 7968 to 7999] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 8000 to 8031] ∈ [0..10] [bits 8032 to 8063] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 8064 to 8095] ∈ [0..10] [bits 8096 to 8127] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 8128 to 8159] ∈ [0..10] [bits 8160 to 8191] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..2047] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ NULL ; &MEMORY + [0..4294967288],0%8 }} head ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} i ∈ [1..10] malloc_next_free ∈ [-2147483648..2147483640],0%8 S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] using specification for function printf_va_1 [eva] tests/builtins/linked_list.c:51: function printf_va_1: precondition got status valid. [eva] Done for function printf_va_1 [eva] tests/builtins/linked_list.c:50: starting to merge loop iterations [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function malloc: malloc_next_free ∈ [-2147483648..2147483640],0%8 __retres ∈ {{ NULL ; &MEMORY + [0..4294967288],0%8 }} [eva:final-states] Values at end of function main: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 256 to 287] ∈ [0..10] [bits 288 to 319] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 320 to 351] ∈ [0..10] [bits 352 to 383] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 384 to 415] ∈ [0..10] [bits 416 to 447] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 448 to 479] ∈ [0..10] [bits 480 to 511] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 512 to 543] ∈ [0..10] [bits 544 to 575] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 576 to 607] ∈ [0..10] [bits 608 to 639] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 640 to 671] ∈ [0..10] [bits 672 to 703] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 704 to 735] ∈ [0..10] [bits 736 to 767] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 768 to 799] ∈ [0..10] [bits 800 to 831] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 832 to 863] ∈ [0..10] [bits 864 to 895] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 896 to 927] ∈ [0..10] [bits 928 to 959] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 960 to 991] ∈ [0..10] [bits 992 to 1023] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1024 to 1055] ∈ [0..10] [bits 1056 to 1087] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1088 to 1119] ∈ [0..10] [bits 1120 to 1151] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1152 to 1183] ∈ [0..10] [bits 1184 to 1215] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1216 to 1247] ∈ [0..10] [bits 1248 to 1279] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1280 to 1311] ∈ [0..10] [bits 1312 to 1343] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1344 to 1375] ∈ [0..10] [bits 1376 to 1407] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1408 to 1439] ∈ [0..10] [bits 1440 to 1471] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1472 to 1503] ∈ [0..10] [bits 1504 to 1535] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1536 to 1567] ∈ [0..10] [bits 1568 to 1599] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1600 to 1631] ∈ [0..10] [bits 1632 to 1663] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1664 to 1695] ∈ [0..10] [bits 1696 to 1727] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1728 to 1759] ∈ [0..10] [bits 1760 to 1791] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1792 to 1823] ∈ [0..10] [bits 1824 to 1855] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1856 to 1887] ∈ [0..10] [bits 1888 to 1919] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1920 to 1951] ∈ [0..10] [bits 1952 to 1983] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 1984 to 2015] ∈ [0..10] [bits 2016 to 2047] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2048 to 2079] ∈ [0..10] [bits 2080 to 2111] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2112 to 2143] ∈ [0..10] [bits 2144 to 2175] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2176 to 2207] ∈ [0..10] [bits 2208 to 2239] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2240 to 2271] ∈ [0..10] [bits 2272 to 2303] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2304 to 2335] ∈ [0..10] [bits 2336 to 2367] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2368 to 2399] ∈ [0..10] [bits 2400 to 2431] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2432 to 2463] ∈ [0..10] [bits 2464 to 2495] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2496 to 2527] ∈ [0..10] [bits 2528 to 2559] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2560 to 2591] ∈ [0..10] [bits 2592 to 2623] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2624 to 2655] ∈ [0..10] [bits 2656 to 2687] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2688 to 2719] ∈ [0..10] [bits 2720 to 2751] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2752 to 2783] ∈ [0..10] [bits 2784 to 2815] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2816 to 2847] ∈ [0..10] [bits 2848 to 2879] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2880 to 2911] ∈ [0..10] [bits 2912 to 2943] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 2944 to 2975] ∈ [0..10] [bits 2976 to 3007] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3008 to 3039] ∈ [0..10] [bits 3040 to 3071] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3072 to 3103] ∈ [0..10] [bits 3104 to 3135] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3136 to 3167] ∈ [0..10] [bits 3168 to 3199] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3200 to 3231] ∈ [0..10] [bits 3232 to 3263] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3264 to 3295] ∈ [0..10] [bits 3296 to 3327] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3328 to 3359] ∈ [0..10] [bits 3360 to 3391] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3392 to 3423] ∈ [0..10] [bits 3424 to 3455] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3456 to 3487] ∈ [0..10] [bits 3488 to 3519] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3520 to 3551] ∈ [0..10] [bits 3552 to 3583] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3584 to 3615] ∈ [0..10] [bits 3616 to 3647] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3648 to 3679] ∈ [0..10] [bits 3680 to 3711] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3712 to 3743] ∈ [0..10] [bits 3744 to 3775] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3776 to 3807] ∈ [0..10] [bits 3808 to 3839] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3840 to 3871] ∈ [0..10] [bits 3872 to 3903] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3904 to 3935] ∈ [0..10] [bits 3936 to 3967] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 3968 to 3999] ∈ [0..10] [bits 4000 to 4031] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4032 to 4063] ∈ [0..10] [bits 4064 to 4095] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4096 to 4127] ∈ [0..10] [bits 4128 to 4159] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4160 to 4191] ∈ [0..10] [bits 4192 to 4223] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4224 to 4255] ∈ [0..10] [bits 4256 to 4287] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4288 to 4319] ∈ [0..10] [bits 4320 to 4351] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4352 to 4383] ∈ [0..10] [bits 4384 to 4415] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4416 to 4447] ∈ [0..10] [bits 4448 to 4479] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4480 to 4511] ∈ [0..10] [bits 4512 to 4543] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4544 to 4575] ∈ [0..10] [bits 4576 to 4607] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4608 to 4639] ∈ [0..10] [bits 4640 to 4671] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4672 to 4703] ∈ [0..10] [bits 4704 to 4735] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4736 to 4767] ∈ [0..10] [bits 4768 to 4799] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4800 to 4831] ∈ [0..10] [bits 4832 to 4863] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4864 to 4895] ∈ [0..10] [bits 4896 to 4927] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4928 to 4959] ∈ [0..10] [bits 4960 to 4991] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 4992 to 5023] ∈ [0..10] [bits 5024 to 5055] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5056 to 5087] ∈ [0..10] [bits 5088 to 5119] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5120 to 5151] ∈ [0..10] [bits 5152 to 5183] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5184 to 5215] ∈ [0..10] [bits 5216 to 5247] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5248 to 5279] ∈ [0..10] [bits 5280 to 5311] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5312 to 5343] ∈ [0..10] [bits 5344 to 5375] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5376 to 5407] ∈ [0..10] [bits 5408 to 5439] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5440 to 5471] ∈ [0..10] [bits 5472 to 5503] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5504 to 5535] ∈ [0..10] [bits 5536 to 5567] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5568 to 5599] ∈ [0..10] [bits 5600 to 5631] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5632 to 5663] ∈ [0..10] [bits 5664 to 5695] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5696 to 5727] ∈ [0..10] [bits 5728 to 5759] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5760 to 5791] ∈ [0..10] [bits 5792 to 5823] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5824 to 5855] ∈ [0..10] [bits 5856 to 5887] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5888 to 5919] ∈ [0..10] [bits 5920 to 5951] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 5952 to 5983] ∈ [0..10] [bits 5984 to 6015] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6016 to 6047] ∈ [0..10] [bits 6048 to 6079] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6080 to 6111] ∈ [0..10] [bits 6112 to 6143] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6144 to 6175] ∈ [0..10] [bits 6176 to 6207] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6208 to 6239] ∈ [0..10] [bits 6240 to 6271] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6272 to 6303] ∈ [0..10] [bits 6304 to 6335] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6336 to 6367] ∈ [0..10] [bits 6368 to 6399] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6400 to 6431] ∈ [0..10] [bits 6432 to 6463] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6464 to 6495] ∈ [0..10] [bits 6496 to 6527] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6528 to 6559] ∈ [0..10] [bits 6560 to 6591] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6592 to 6623] ∈ [0..10] [bits 6624 to 6655] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6656 to 6687] ∈ [0..10] [bits 6688 to 6719] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6720 to 6751] ∈ [0..10] [bits 6752 to 6783] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6784 to 6815] ∈ [0..10] [bits 6816 to 6847] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6848 to 6879] ∈ [0..10] [bits 6880 to 6911] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6912 to 6943] ∈ [0..10] [bits 6944 to 6975] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 6976 to 7007] ∈ [0..10] [bits 7008 to 7039] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7040 to 7071] ∈ [0..10] [bits 7072 to 7103] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7104 to 7135] ∈ [0..10] [bits 7136 to 7167] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7168 to 7199] ∈ [0..10] [bits 7200 to 7231] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7232 to 7263] ∈ [0..10] [bits 7264 to 7295] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7296 to 7327] ∈ [0..10] [bits 7328 to 7359] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7360 to 7391] ∈ [0..10] [bits 7392 to 7423] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7424 to 7455] ∈ [0..10] [bits 7456 to 7487] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7488 to 7519] ∈ [0..10] [bits 7520 to 7551] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7552 to 7583] ∈ [0..10] [bits 7584 to 7615] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7616 to 7647] ∈ [0..10] [bits 7648 to 7679] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7680 to 7711] ∈ [0..10] [bits 7712 to 7743] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7744 to 7775] ∈ [0..10] [bits 7776 to 7807] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7808 to 7839] ∈ [0..10] [bits 7840 to 7871] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7872 to 7903] ∈ [0..10] [bits 7904 to 7935] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 7936 to 7967] ∈ [0..10] [bits 7968 to 7999] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 8000 to 8031] ∈ [0..10] [bits 8032 to 8063] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 8064 to 8095] ∈ [0..10] [bits 8096 to 8127] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} [bits 8128 to 8159] ∈ [0..10] [bits 8160 to 8191] ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ [--..--] curr ∈ {0} head ∈ {{ NULL ; &MEMORY + [0..1016],0%8 }} i ∈ {11} malloc_next_free ∈ [-2147483648..2147483640],0%8 [from] Computing for function malloc [from] Done for function malloc [from] Computing for function main [from] Computing for function printf_va_1 <-main [from] Done for function printf_va_1 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function malloc: malloc_next_free FROM size; malloc_next_free \result FROM size; malloc_next_free [from] Function printf_va_1: __fc_initial_stdout.__fc_FILE_data FROM __fc_initial_stdout; param0; "%d\n" (and SELF) \result FROM __fc_initial_stdout; param0; "%d\n" [from] Function main: MEMORY{[0..3]; [8..11]; [16..19]; [24..27]; [32..35]; [40..43]; [48..51]; [56..59]; [64..67]; [72..75]; [80..83]; [88..91]; [96..99]; [104..107]; [112..115]; [120..123]; [128..131]; [136..139]; [144..147]; [152..155]; [160..163]; [168..171]; [176..179]; [184..187]; [192..195]; [200..203]; [208..211]; [216..219]; [224..227]; [232..235]; [240..243]; [248..251]; [256..259]; [264..267]; [272..275]; [280..283]; [288..291]; [296..299]; [304..307]; [312..315]; [320..323]; [328..331]; [336..339]; [344..347]; [352..355]; [360..363]; [368..371]; [376..379]; [384..387]; [392..395]; [400..403]; [408..411]; [416..419]; [424..427]; [432..435]; [440..443]; [448..451]; [456..459]; [464..467]; [472..475]; [480..483]; [488..491]; [496..499]; [504..507]; [512..515]; [520..523]; [528..531]; [536..539]; [544..547]; [552..555]; [560..563]; [568..571]; [576..579]; [584..587]; [592..595]; [600..603]; [608..611]; [616..619]; [624..627]; [632..635]; [640..643]; [648..651]; [656..659]; [664..667]; [672..675]; [680..683]; [688..691]; [696..699]; [704..707]; [712..715]; [720..723]; [728..731]; [736..739]; [744..747]; [752..755]; [760..763]; [768..771]; [776..779]; [784..787]; [792..795]; [800..803]; [808..811]; [816..819]; [824..827]; [832..835]; [840..843]; [848..851]; [856..859]; [864..867]; [872..875]; [880..883]; [888..891]; [896..899]; [904..907]; [912..915]; [920..923]; [928..931]; [936..939]; [944..947]; [952..955]; [960..963]; [968..971]; [976..979]; [984..987]; [992..995]; [1000..1003]; [1008..1011]; [1016..1019]} FROM malloc_next_free (and SELF) {[4..7]; [12..15]; [20..23]; [28..31]; [36..39]; [44..47]; [52..55]; [60..63]; [68..71]; [76..79]; [84..87]; [92..95]; [100..103]; [108..111]; [116..119]; [124..127]; [132..135]; [140..143]; [148..151]; [156..159]; [164..167]; [172..175]; [180..183]; [188..191]; [196..199]; [204..207]; [212..215]; [220..223]; [228..231]; [236..239]; [244..247]; [252..255]; [260..263]; [268..271]; [276..279]; [284..287]; [292..295]; [300..303]; [308..311]; [316..319]; [324..327]; [332..335]; [340..343]; [348..351]; [356..359]; [364..367]; [372..375]; [380..383]; [388..391]; [396..399]; [404..407]; [412..415]; [420..423]; [428..431]; [436..439]; [444..447]; [452..455]; [460..463]; [468..471]; [476..479]; [484..487]; [492..495]; [500..503]; [508..511]; [516..519]; [524..527]; [532..535]; [540..543]; [548..551]; [556..559]; [564..567]; [572..575]; [580..583]; [588..591]; [596..599]; [604..607]; [612..615]; [620..623]; [628..631]; [636..639]; [644..647]; [652..655]; [660..663]; [668..671]; [676..679]; [684..687]; [692..695]; [700..703]; [708..711]; [716..719]; [724..727]; [732..735]; [740..743]; [748..751]; [756..759]; [764..767]; [772..775]; [780..783]; [788..791]; [796..799]; [804..807]; [812..815]; [820..823]; [828..831]; [836..839]; [844..847]; [852..855]; [860..863]; [868..871]; [876..879]; [884..887]; [892..895]; [900..903]; [908..911]; [916..919]; [924..927]; [932..935]; [940..943]; [948..951]; [956..959]; [964..967]; [972..975]; [980..983]; [988..991]; [996..999]; [1004..1007]; [1012..1015]; [1020..1023]} FROM malloc_next_free (and SELF) __fc_initial_stdout.__fc_FILE_data FROM MEMORY[0..1023]; __fc_initial_stdout; malloc_next_free; "%d\n" (and SELF) malloc_next_free FROM malloc_next_free (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function malloc: malloc_next_free; __retres [inout] Inputs for function malloc: malloc_next_free [inout] Out (internal) for function main: MEMORY[0..1023]; __fc_initial_stdout.__fc_FILE_data; curr; head; i; malloc_next_free [inout] Inputs for function main: MEMORY[0..1023]; __fc_initial_stdout; malloc_next_free; "%d\n" �������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/linked_list.1.res.oracle���������������������������������0000666�0000000�0000000�00000065611�13571573400�022103� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/linked_list.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization MEMORY[0..0x3FF] ∈ {0} malloc_next_free ∈ {0} [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[0..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ UNINITIALIZED head ∈ {0} i ∈ {1} malloc_next_free ∈ {0} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva:alarm] share/libc/stdlib.h:394: Warning: function malloc, behavior allocation: postcondition 'allocation' got status unknown. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[0..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY }} head ∈ {0} i ∈ {1} malloc_next_free ∈ {8} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:39: starting to merge loop iterations [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1} [4..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY }} or UNINITIALIZED head ∈ {{ NULL ; (item *)&MEMORY }} i ∈ {1; 2} malloc_next_free ∈ {0; 8} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1} [4..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8]} }} head ∈ {{ NULL ; (item *)&MEMORY }} i ∈ {1; 2} malloc_next_free ∈ {8; 16} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1; 2} [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY }} [bits 64 to 95] ∈ {0; 1; 2} [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY }} [16..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8]} }} or UNINITIALIZED head ∈ {{ NULL ; (item *)&MEMORY{[0], [8]} }} i ∈ {1; 2; 3} malloc_next_free ∈ {0; 8; 16} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1; 2} [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY }} [bits 64 to 95] ∈ {0; 1; 2} [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY }} [16..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16]} }} head ∈ {{ NULL ; (item *)&MEMORY{[0], [8]} }} i ∈ {1; 2; 3} malloc_next_free ∈ {8; 16; 24} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1; 2; 3} [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [bits 64 to 95] ∈ {0; 1; 2; 3} [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [bits 128 to 159] ∈ {0; 1; 2; 3} [bits 160 to 191] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [24..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16]} }} or UNINITIALIZED head ∈ {{ NULL ; (item *)&MEMORY{[0], [8], [16]} }} i ∈ [1..10] malloc_next_free ∈ {0; 8; 16; 24} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {0; 1; 2; 3} [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [bits 64 to 95] ∈ {0; 1; 2; 3} [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [bits 128 to 159] ∈ {0; 1; 2; 3} [bits 160 to 191] ∈ {{ NULL ; (? *)&MEMORY{[0], [8]} }} [24..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16], [24]} }} head ∈ {{ NULL ; (item *)&MEMORY{[0], [8], [16]} }} i ∈ [1..10] malloc_next_free ∈ {8; 16; 24; 32} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [32..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16], [24]} }} or UNINITIALIZED head ∈ {{ NULL ; (item *)&MEMORY{[0], [8], [16], [24]} }} i ∈ [1..10] malloc_next_free ∈ {0; 8; 16; 24; 32} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16]} }} [32..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY{[0], [8], [16], [24], [32]} }} head ∈ {{ NULL ; (item *)&MEMORY{[0], [8], [16], [24]} }} i ∈ [1..10] malloc_next_free ∈ {8; 16; 24; 32; 40} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} [bits 256 to 0x11F] ∈ [0..10] [bits 0x120 to 0x13F] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16], [24]} }} [40..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ &MEMORY + [0..0x3F8],0%8 }} or UNINITIALIZED head ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} i ∈ [1..10] malloc_next_free ∈ [0..0x7FFFFFF8],0%8 S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 63] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} [bits 64 to 95] ∈ [0..10] [bits 96 to 127] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} [bits 128 to 159] ∈ [0..10] [bits 160 to 191] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} [bits 192 to 223] ∈ [0..10] [bits 224 to 255] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} [bits 256 to 0x11F] ∈ [0..10] [bits 0x120 to 0x13F] ∈ {{ NULL ; (? *)&MEMORY{[0], [8], [16], [24]} }} [40..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ NULL ; &MEMORY + [0..0xFFFFFFF8],0%8 }} head ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} i ∈ [1..10] malloc_next_free ∈ [-0x80000000..0x7FFFFFF8],0%8 S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva:alarm] tests/builtins/linked_list.c:43: Warning: out of bounds write. assert \valid(&curr->val); [kernel] tests/builtins/linked_list.c:43: more than 100(128) locations to update in array. Approximating. [kernel] tests/builtins/linked_list.c:44: more than 100(128) locations to update in array. Approximating. [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 0x1FDF]# ∈ {{ NULL + [0..10] ; &MEMORY + [0..0x3F8],0%8 }} repeated %32 [bits 0x1FE0 to 0x1FFF] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ &MEMORY + [0..0x3F8],0%8 }} or UNINITIALIZED head ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} i ∈ [1..10] malloc_next_free ∈ [-0x80000000..0x7FFFFFF8],0%8 S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 0x1FDF]# ∈ {{ NULL + [0..10] ; &MEMORY + [0..0x3F8],0%8 }} repeated %32 [bits 0x1FE0 to 0x1FFF] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ NULL ; &MEMORY + [0..0xFFFFFFF8],0%8 }} head ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} i ∈ [1..10] malloc_next_free ∈ [-0x80000000..0x7FFFFFF8],0%8 S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] using specification for function printf_va_1 [eva] tests/builtins/linked_list.c:51: function printf_va_1: precondition got status valid. [eva] Done for function printf_va_1 [eva] tests/builtins/linked_list.c:50: starting to merge loop iterations [eva:alarm] tests/builtins/linked_list.c:51: Warning: out of bounds read. assert \valid_read(&curr->val); [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] Recording results for main [kernel] tests/builtins/linked_list.c:43: more than 100(128) elements to enumerate. Approximating. [kernel] tests/builtins/linked_list.c:44: more than 100(128) elements to enumerate. Approximating. [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function malloc: malloc_next_free ∈ [-0x80000000..0x7FFFFFF8],0%8 __retres ∈ {{ NULL ; &MEMORY + [0..0xFFFFFFF8],0%8 }} [eva:final-states] Values at end of function main: MEMORY[bits 0 to 31] ∈ [0..10] [bits 32 to 0x1FDF]# ∈ {{ NULL + [0..10] ; &MEMORY + [0..0x3F8],0%8 }} repeated %32 [bits 0x1FE0 to 0x1FFF] ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {{ garbled mix of &{MEMORY} (origin: Library function {tests/builtins/linked_list.c:51}) }} curr ∈ {0} head ∈ {{ NULL ; &MEMORY + [0..0x3F8],0%8 }} i ∈ {11} malloc_next_free ∈ [-0x80000000..0x7FFFFFF8],0%8 [from] Computing for function malloc [from] Done for function malloc [from] Computing for function main [kernel] tests/builtins/linked_list.c:43: more than 100(128) dependencies to update. Approximating. [kernel] tests/builtins/linked_list.c:44: more than 100(128) dependencies to update. Approximating. [from] Computing for function printf_va_1 <-main [from] Done for function printf_va_1 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function malloc: malloc_next_free FROM size; malloc_next_free \result FROM size; malloc_next_free [from] Function printf_va_1: __fc_initial_stdout.__fc_FILE_data FROM __fc_initial_stdout; param0; "%d\n" (and SELF) \result FROM __fc_initial_stdout; param0; "%d\n" [from] Function main: MEMORY[0..3] FROM malloc_next_free (and SELF) [4..0x3FF] FROM malloc_next_free (and SELF) __fc_initial_stdout.__fc_FILE_data FROM MEMORY[0..0x3FF]; __fc_initial_stdout; malloc_next_free; "%d\n" (and SELF) malloc_next_free FROM malloc_next_free (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function malloc: malloc_next_free; __retres [inout] Inputs for function malloc: malloc_next_free [inout] Out (internal) for function main: MEMORY[0..0x3FF]; __fc_initial_stdout.__fc_FILE_data; curr; head; i; malloc_next_free [inout] Inputs for function main: MEMORY[0..0x3FF]; __fc_initial_stdout; malloc_next_free; "%d\n" �����������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/linked_list.2.res.oracle���������������������������������0000666�0000000�0000000�00000115716�13571573400�022106� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/linked_list.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization MEMORY[0..0x3FF] ∈ {0} malloc_next_free ∈ {0} [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[0..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ UNINITIALIZED head ∈ {0} i ∈ {1} malloc_next_free ∈ {0} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva:alarm] share/libc/stdlib.h:394: Warning: function malloc, behavior allocation: postcondition 'allocation' got status unknown. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[0..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY }} head ∈ {0} i ∈ {1} malloc_next_free ∈ {8} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY }} head ∈ {{ (item *)&MEMORY }} i ∈ {2} malloc_next_free ∈ {8} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[8] }} head ∈ {{ (item *)&MEMORY }} i ∈ {2} malloc_next_free ∈ {16} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [16..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[8] }} head ∈ {{ (item *)&MEMORY[8] }} i ∈ {3} malloc_next_free ∈ {16} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [16..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[16] }} head ∈ {{ (item *)&MEMORY[8] }} i ∈ {3} malloc_next_free ∈ {24} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [24..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[16] }} head ∈ {{ (item *)&MEMORY[16] }} i ∈ {4} malloc_next_free ∈ {24} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [24..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[24] }} head ∈ {{ (item *)&MEMORY[16] }} i ∈ {4} malloc_next_free ∈ {32} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [32..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[24] }} head ∈ {{ (item *)&MEMORY[24] }} i ∈ {5} malloc_next_free ∈ {32} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [32..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[32] }} head ∈ {{ (item *)&MEMORY[24] }} i ∈ {5} malloc_next_free ∈ {40} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [40..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[32] }} head ∈ {{ (item *)&MEMORY[32] }} i ∈ {6} malloc_next_free ∈ {40} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [40..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[40] }} head ∈ {{ (item *)&MEMORY[32] }} i ∈ {6} malloc_next_free ∈ {48} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [bits 0x140 to 0x15F] ∈ {6} [bits 0x160 to 0x17F] ∈ {{ (? *)&MEMORY[32] }} [48..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[40] }} head ∈ {{ (item *)&MEMORY[40] }} i ∈ {7} malloc_next_free ∈ {48} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [bits 0x140 to 0x15F] ∈ {6} [bits 0x160 to 0x17F] ∈ {{ (? *)&MEMORY[32] }} [48..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[48] }} head ∈ {{ (item *)&MEMORY[40] }} i ∈ {7} malloc_next_free ∈ {56} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [bits 0x140 to 0x15F] ∈ {6} [bits 0x160 to 0x17F] ∈ {{ (? *)&MEMORY[32] }} [bits 0x180 to 0x19F] ∈ {7} [bits 0x1A0 to 0x1BF] ∈ {{ (? *)&MEMORY[40] }} [56..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[48] }} head ∈ {{ (item *)&MEMORY[48] }} i ∈ {8} malloc_next_free ∈ {56} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [bits 0x140 to 0x15F] ∈ {6} [bits 0x160 to 0x17F] ∈ {{ (? *)&MEMORY[32] }} [bits 0x180 to 0x19F] ∈ {7} [bits 0x1A0 to 0x1BF] ∈ {{ (? *)&MEMORY[40] }} [56..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[56] }} head ∈ {{ (item *)&MEMORY[48] }} i ∈ {8} malloc_next_free ∈ {64} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [bits 0x140 to 0x15F] ∈ {6} [bits 0x160 to 0x17F] ∈ {{ (? *)&MEMORY[32] }} [bits 0x180 to 0x19F] ∈ {7} [bits 0x1A0 to 0x1BF] ∈ {{ (? *)&MEMORY[40] }} [bits 0x1C0 to 0x1DF] ∈ {8} [bits 0x1E0 to 0x1FF] ∈ {{ (? *)&MEMORY[48] }} [64..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[56] }} head ∈ {{ (item *)&MEMORY[56] }} i ∈ {9} malloc_next_free ∈ {64} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [bits 0x140 to 0x15F] ∈ {6} [bits 0x160 to 0x17F] ∈ {{ (? *)&MEMORY[32] }} [bits 0x180 to 0x19F] ∈ {7} [bits 0x1A0 to 0x1BF] ∈ {{ (? *)&MEMORY[40] }} [bits 0x1C0 to 0x1DF] ∈ {8} [bits 0x1E0 to 0x1FF] ∈ {{ (? *)&MEMORY[48] }} [64..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[64] }} head ∈ {{ (item *)&MEMORY[56] }} i ∈ {9} malloc_next_free ∈ {72} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/builtins/linked_list.c:40: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [bits 0x140 to 0x15F] ∈ {6} [bits 0x160 to 0x17F] ∈ {{ (? *)&MEMORY[32] }} [bits 0x180 to 0x19F] ∈ {7} [bits 0x1A0 to 0x1BF] ∈ {{ (? *)&MEMORY[40] }} [bits 0x1C0 to 0x1DF] ∈ {8} [bits 0x1E0 to 0x1FF] ∈ {{ (? *)&MEMORY[48] }} [bits 0x200 to 0x21F] ∈ {9} [bits 0x220 to 0x23F] ∈ {{ (? *)&MEMORY[56] }} [72..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[64] }} head ∈ {{ (item *)&MEMORY[64] }} i ∈ {10} malloc_next_free ∈ {72} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function malloc <- main. Called from tests/builtins/linked_list.c:41. [eva] Recording results for malloc [eva] Done for function malloc [eva] tests/builtins/linked_list.c:42: Frama_C_dump_each: # Cvalue domain: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [bits 0x140 to 0x15F] ∈ {6} [bits 0x160 to 0x17F] ∈ {{ (? *)&MEMORY[32] }} [bits 0x180 to 0x19F] ∈ {7} [bits 0x1A0 to 0x1BF] ∈ {{ (? *)&MEMORY[40] }} [bits 0x1C0 to 0x1DF] ∈ {8} [bits 0x1E0 to 0x1FF] ∈ {{ (? *)&MEMORY[48] }} [bits 0x200 to 0x21F] ∈ {9} [bits 0x220 to 0x23F] ∈ {{ (? *)&MEMORY[56] }} [72..0x3FF] ∈ {0} __fc_errno ∈ [--..--] __fc_stderr ∈ {{ &__fc_initial_stderr }} __fc_stdin ∈ {{ &__fc_initial_stdin }} __fc_stdout ∈ {{ &__fc_initial_stdout }} __fc_fopen[0..15] ∈ {0} __fc_p_fopen ∈ {{ &__fc_fopen[0] }} __fc_tmpnam[0..0x7FF] ∈ {0} __fc_p_tmpnam ∈ {{ &__fc_tmpnam[0] }} __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {0x7FFF} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..0xFFF] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ {0} __fc_initial_stderr.__fc_FILE_id ∈ {2} .__fc_FILE_data ∈ {0} __fc_initial_stdin ∈ {0} curr ∈ {{ (item *)&MEMORY[72] }} head ∈ {{ (item *)&MEMORY[64] }} i ∈ {10} malloc_next_free ∈ {80} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] using specification for function printf_va_1 [eva] tests/builtins/linked_list.c:51: function printf_va_1: precondition got status valid. [eva] Done for function printf_va_1 [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] computing for function printf_va_1 <- main. Called from tests/builtins/linked_list.c:51. [eva] Done for function printf_va_1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function malloc: malloc_next_free ∈ [8..80],0%8 __retres ∈ {{ &MEMORY + [0..72],0%8 }} [eva:final-states] Values at end of function main: MEMORY[bits 0 to 31] ∈ {1} [4..7] ∈ {0} [bits 64 to 95] ∈ {2} [bits 96 to 127] ∈ {{ (? *)&MEMORY }} [bits 128 to 159] ∈ {3} [bits 160 to 191] ∈ {{ (? *)&MEMORY[8] }} [bits 192 to 223] ∈ {4} [bits 224 to 255] ∈ {{ (? *)&MEMORY[16] }} [bits 256 to 0x11F] ∈ {5} [bits 0x120 to 0x13F] ∈ {{ (? *)&MEMORY[24] }} [bits 0x140 to 0x15F] ∈ {6} [bits 0x160 to 0x17F] ∈ {{ (? *)&MEMORY[32] }} [bits 0x180 to 0x19F] ∈ {7} [bits 0x1A0 to 0x1BF] ∈ {{ (? *)&MEMORY[40] }} [bits 0x1C0 to 0x1DF] ∈ {8} [bits 0x1E0 to 0x1FF] ∈ {{ (? *)&MEMORY[48] }} [bits 0x200 to 0x21F] ∈ {9} [bits 0x220 to 0x23F] ∈ {{ (? *)&MEMORY[56] }} [bits 0x240 to 0x25F] ∈ {10} [bits 0x260 to 0x27F] ∈ {{ (? *)&MEMORY[64] }} [80..0x3FF] ∈ {0} __fc_initial_stdout.__fc_FILE_id ∈ {1} .__fc_FILE_data ∈ [--..--] curr ∈ {0} head ∈ {{ (item *)&MEMORY[72] }} i ∈ {11} malloc_next_free ∈ {80} [from] Computing for function malloc [from] Done for function malloc [from] Computing for function main [from] Computing for function printf_va_1 <-main [from] Done for function printf_va_1 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function malloc: malloc_next_free FROM size; malloc_next_free \result FROM size; malloc_next_free [from] Function printf_va_1: __fc_initial_stdout.__fc_FILE_data FROM __fc_initial_stdout; param0; "%d\n" (and SELF) \result FROM __fc_initial_stdout; param0; "%d\n" [from] Function main: MEMORY{[0..3]; [8..11]; [16..19]; [24..27]; [32..35]; [40..43]; [48..51]; [56..59]; [64..67]; [72..75]} FROM malloc_next_free (and SELF) {[4..7]; [12..15]; [20..23]; [28..31]; [36..39]; [44..47]; [52..55]; [60..63]; [68..71]; [76..79]} FROM malloc_next_free (and SELF) __fc_initial_stdout.__fc_FILE_data FROM MEMORY[0..79]; __fc_initial_stdout; malloc_next_free; "%d\n" (and SELF) malloc_next_free FROM malloc_next_free (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function malloc: malloc_next_free; __retres [inout] Inputs for function malloc: malloc_next_free [inout] Out (internal) for function main: MEMORY[0..79]; __fc_initial_stdout.__fc_FILE_data; curr; head; i; malloc_next_free [inout] Inputs for function main: MEMORY[0..79]; __fc_initial_stdout; malloc_next_free; "%d\n" ��������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/malloc-deps.res.oracle�����������������������������������0000666�0000000�0000000�00000016626�13571573400�021645� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/malloc-deps.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] tests/builtins/malloc-deps.i:17: Call to builtin Frama_C_malloc_fresh_weak [eva] tests/builtins/malloc-deps.i:17: allocating weak variable __malloc_w_main_l17 [eva] tests/builtins/malloc-deps.i:21: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/malloc-deps.i:21: allocating variable __malloc_main_l21 [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva] tests/builtins/malloc-deps.i:28: allocating variable __malloc_main_l28 [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva:alarm] tests/builtins/malloc-deps.i:13: Warning: out of bounds write. assert \valid(p + k); [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva:malloc:weak] tests/builtins/malloc-deps.i:28: marking variable `__malloc_main_l28' as weak [eva:malloc] tests/builtins/malloc-deps.i:28: resizing variable `__malloc_w_main_l28' (0..31) to fit 0..63 [eva:alarm] tests/builtins/malloc-deps.i:29: Warning: signed overflow. assert l + v ≤ 2147483647; [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva:malloc] tests/builtins/malloc-deps.i:28: resizing variable `__malloc_w_main_l28' (0..31/63) to fit 0..95 [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva:malloc] tests/builtins/malloc-deps.i:28: resizing variable `__malloc_w_main_l28' (0..31/95) to fit 0..127 [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva:malloc] tests/builtins/malloc-deps.i:28: resizing variable `__malloc_w_main_l28' (0..31/127) to fit 0..159 [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva:malloc] tests/builtins/malloc-deps.i:28: resizing variable `__malloc_w_main_l28' (0..31/159) to fit 0..191 [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/builtins/malloc-deps.i:27: starting to merge loop iterations [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva:malloc] tests/builtins/malloc-deps.i:28: resizing variable `__malloc_w_main_l28' (0..31/191) to fit 0..191/223 [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva:malloc] tests/builtins/malloc-deps.i:28: resizing variable `__malloc_w_main_l28' (0..31/223) to fit 0..191/255 [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva:malloc] tests/builtins/malloc-deps.i:28: resizing variable `__malloc_w_main_l28' (0..31/255) to fit 0..191/319 [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/builtins/malloc-deps.i:28: Call to builtin Frama_C_malloc_by_stack [eva:malloc] tests/builtins/malloc-deps.i:28: resizing variable `__malloc_w_main_l28' (0..31/319) to fit 0..191/319 [eva] computing for function g <- main. Called from tests/builtins/malloc-deps.i:29. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: __malloc_w_main_l28[0..9] ∈ [0..9] or UNINITIALIZED [eva:final-states] Values at end of function main: p ∈ {{ &__malloc_w_main_l17[0] }} q ∈ {{ &__malloc_main_l21[0] }} r ∈ {{ &__malloc_w_main_l28[0] }} __malloc_w_main_l17[0] ∈ [--..--] or UNINITIALIZED [1..24] ∈ UNINITIALIZED __malloc_main_l21[0] ∈ [--..--] [1..24] ∈ UNINITIALIZED __malloc_w_main_l28[0..9] ∈ [0..9] or UNINITIALIZED [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Computing for function Frama_C_malloc_fresh_weak <-main [from] Done for function Frama_C_malloc_fresh_weak [from] Computing for function Frama_C_malloc_fresh <-main [from] Done for function Frama_C_malloc_fresh [from] Computing for function Frama_C_malloc_by_stack <-main [from] Done for function Frama_C_malloc_by_stack [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_malloc_by_stack: \result FROM \nothing [from] Function Frama_C_malloc_fresh: \result FROM \nothing [from] Function Frama_C_malloc_fresh_weak: \result FROM \nothing [from] Function g: __malloc_w_main_l28[0..9] FROM p; k (and SELF) [from] Function main: __malloc_w_main_l17[0] FROM i; j (and SELF) __malloc_main_l21[0] FROM j __malloc_w_main_l28[0..9] FROM v (and SELF) [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to Frama_C_malloc_fresh_weak at tests/builtins/malloc-deps.i:17 (by main): \result FROM \nothing [from] call to Frama_C_malloc_fresh at tests/builtins/malloc-deps.i:21 (by main): \result FROM \nothing [from] call to Frama_C_malloc_by_stack at tests/builtins/malloc-deps.i:28 (by main): \result FROM \nothing [from] call to g at tests/builtins/malloc-deps.i:29 (by main): __malloc_w_main_l28[0..9] FROM p; k (and SELF) [from] entry point: __malloc_w_main_l17[0] FROM i; j (and SELF) __malloc_main_l21[0] FROM j __malloc_w_main_l28[0..9] FROM v (and SELF) [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] InOut (internal) for function g: Operational inputs: p; k Operational inputs on termination: p; k Sure outputs: \nothing [inout] InOut (internal) for function main: Operational inputs: v; i; j Operational inputs on termination: v; i; j Sure outputs: p; q; l; __malloc_main_l21[0] ����������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/malloc-optimistic.res.oracle�����������������������������0000666�0000000�0000000�00000473276�13571573400�023106� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/malloc-optimistic.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/builtins/malloc-optimistic.c:135. [eva] tests/builtins/malloc-optimistic.c:16: Frama_C_show_each_1_1: {0} [eva] tests/builtins/malloc-optimistic.c:16: Frama_C_show_each_1_1: {1} [eva] tests/builtins/malloc-optimistic.c:17: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:17: allocating variable __malloc_main1_l17 [eva] tests/builtins/malloc-optimistic.c:17: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:17: resizing variable `__malloc_main1_l17' (0..31) to fit 0..63 [eva] tests/builtins/malloc-optimistic.c:18: Frama_C_show_each_1_2: {0} [eva] tests/builtins/malloc-optimistic.c:18: Frama_C_show_each_1_2: {1} [eva:alarm] tests/builtins/malloc-optimistic.c:19: Warning: out of bounds write. assert \valid(p + i); [eva] Recording results for main1 [eva] Done for function main1 [eva] tests/builtins/malloc-optimistic.c:136: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:136: strong free on bases: {__malloc_main1_l17} [eva] computing for function main2 <- main. Called from tests/builtins/malloc-optimistic.c:137. [eva] tests/builtins/malloc-optimistic.c:26: Frama_C_show_each_2_1: {2} [eva] tests/builtins/malloc-optimistic.c:26: Frama_C_show_each_2_1: {1} [eva] tests/builtins/malloc-optimistic.c:27: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:27: allocating variable __malloc_main2_l27 [eva] tests/builtins/malloc-optimistic.c:27: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:27: resizing variable `__malloc_main2_l27' (0..95) to fit 0..63 [eva] tests/builtins/malloc-optimistic.c:28: Frama_C_show_each_2_2: {2} [eva] tests/builtins/malloc-optimistic.c:28: Frama_C_show_each_2_2: {1} [eva:alarm] tests/builtins/malloc-optimistic.c:29: Warning: out of bounds write. assert \valid(p + i); [eva] Recording results for main2 [eva] Done for function main2 [eva] tests/builtins/malloc-optimistic.c:138: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:138: strong free on bases: {__malloc_main2_l27} [eva] computing for function main3 <- main. Called from tests/builtins/malloc-optimistic.c:139. [eva] computing for function main_3_aux <- main3 <- main. Called from tests/builtins/malloc-optimistic.c:48. [eva] tests/builtins/malloc-optimistic.c:34: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:34: allocating variable __malloc_main_3_aux_l34 [eva] Recording results for main_3_aux [eva] Done for function main_3_aux [eva] computing for function main_3_aux <- main3 <- main. Called from tests/builtins/malloc-optimistic.c:48. [eva] tests/builtins/malloc-optimistic.c:34: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:34: resizing variable `__malloc_main_3_aux_l34' (0..31) to fit 0..63 [eva:alarm] tests/builtins/malloc-optimistic.c:35: Warning: out of bounds write. assert \valid(p + i); [eva] Recording results for main_3_aux [eva] Done for function main_3_aux [eva] Recording results for main3 [eva] Done for function main3 [eva] tests/builtins/malloc-optimistic.c:140: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:140: strong free on bases: {__malloc_main_3_aux_l34} [eva] computing for function main4 <- main. Called from tests/builtins/malloc-optimistic.c:141. [eva] computing for function main_4_aux <- main4 <- main. Called from tests/builtins/malloc-optimistic.c:56. [eva] tests/builtins/malloc-optimistic.c:40: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:40: allocating variable __malloc_main_4_aux_l40 [eva] Recording results for main_4_aux [eva] Done for function main_4_aux [eva] computing for function main_4_aux <- main4 <- main. Called from tests/builtins/malloc-optimistic.c:56. [eva] tests/builtins/malloc-optimistic.c:40: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:40: resizing variable `__malloc_main_4_aux_l40' (0..95) to fit 0..63 [eva] Recording results for main_4_aux [eva] Done for function main_4_aux [eva] Recording results for main4 [eva] Done for function main4 [eva] tests/builtins/malloc-optimistic.c:142: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:142: strong free on bases: {__malloc_main_4_aux_l40} [eva] computing for function main5 <- main. Called from tests/builtins/malloc-optimistic.c:144. [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:64: allocating variable __malloc_main5_l64 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31) to fit 0..63 [eva:alarm] tests/builtins/malloc-optimistic.c:65: Warning: out of bounds write. assert \valid(p + i); [eva:alarm] tests/builtins/malloc-optimistic.c:66: Warning: out of bounds read. assert \valid_read(p + i); [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {0} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {0} k ∈ {-2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0] ∈ {0} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {1} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {0} k ∈ {-2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0] ∈ UNINITIALIZED [1] ∈ {0} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/63) to fit 0..63 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/63) to fit 0..95 [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {1} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {1} k ∈ {-1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0] ∈ UNINITIALIZED [1] ∈ {1} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {2} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {1} k ∈ {-1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..1] ∈ UNINITIALIZED [2] ∈ {1} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/95) to fit 0..95 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/95) to fit 0..127 [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {2} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {2} k ∈ {0} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..1] ∈ UNINITIALIZED [2] ∈ {2} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {3} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {2} k ∈ {0} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..2] ∈ UNINITIALIZED [3] ∈ {2} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/127) to fit 0..127 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/127) to fit 0..159 [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {3} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {3} k ∈ {1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..2] ∈ UNINITIALIZED [3] ∈ {3} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {4} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {3} k ∈ {1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..3] ∈ UNINITIALIZED [4] ∈ {3} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/159) to fit 0..159 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/159) to fit 0..191 [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {4} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {4} k ∈ {2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..3] ∈ UNINITIALIZED [4] ∈ {4} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {5} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {4} k ∈ {2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..4] ∈ UNINITIALIZED [5] ∈ {4} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/191) to fit 0..191 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/191) to fit 0..223 [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {5} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {5} k ∈ {3} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..4] ∈ UNINITIALIZED [5] ∈ {5} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {6} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {5} k ∈ {3} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..5] ∈ UNINITIALIZED [6] ∈ {5} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/223) to fit 0..223 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/223) to fit 0..255 [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {6} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {6} k ∈ {4} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..5] ∈ UNINITIALIZED [6] ∈ {6} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {7} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {6} k ∈ {4} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..6] ∈ UNINITIALIZED [7] ∈ {6} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/255) to fit 0..255 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/255) to fit 0..287 [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {7} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {7} k ∈ {5} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..6] ∈ UNINITIALIZED [7] ∈ {7} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {8} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {7} k ∈ {5} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..7] ∈ UNINITIALIZED [8] ∈ {7} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/287) to fit 0..287 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/287) to fit 0..319 [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {8} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {8} k ∈ {6} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..7] ∈ UNINITIALIZED [8] ∈ {8} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {9} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {8} k ∈ {6} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..8] ∈ UNINITIALIZED [9] ∈ {8} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/319) to fit 0..319 [eva] tests/builtins/malloc-optimistic.c:64: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:64: resizing variable `__malloc_main5_l64' (0..31/319) to fit 0..351 [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {9} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {9} k ∈ {7} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..8] ∈ UNINITIALIZED [9] ∈ {9} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {10} p ∈ {{ &__malloc_main5_l64[0] }} j ∈ {9} k ∈ {7} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main5_l64[0..9] ∈ UNINITIALIZED [10] ∈ {9} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] tests/builtins/malloc-optimistic.c:68: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:68: strong free on bases: {__malloc_main5_l64} [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/builtins/malloc-optimistic.c:145. [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:77: allocating variable __malloc_main6_l77 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_main6_l77' (0..31) to fit 0..63 [eva:alarm] tests/builtins/malloc-optimistic.c:78: Warning: out of bounds write. assert \valid(p + i); [eva:alarm] tests/builtins/malloc-optimistic.c:79: Warning: out of bounds read. assert \valid_read(p + i); [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {0} p ∈ {{ &__malloc_main6_l77[0] }} j ∈ {0} k ∈ {-2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main6_l77[0] ∈ {0} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {1} p ∈ {{ &__malloc_main6_l77[0] }} j ∈ {0} k ∈ {-2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: strong free on bases: {__malloc_main6_l77} [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc:weak] tests/builtins/malloc-optimistic.c:77: marking variable `__malloc_main6_l77' as weak [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/63) to fit 0..63 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/63) to fit 0..95 [eva:alarm] tests/builtins/malloc-optimistic.c:79: Warning: accessing uninitialized left-value. assert \initialized(p + i); [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {1} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {1} k ∈ {-2; -1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {2} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {1} k ∈ {-1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0} or UNINITIALIZED [2] ∈ {1} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: weak free on bases: {__malloc_w_main6_l77} [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/95) to fit 0..95 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/95) to fit 0..127 [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {2} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {2} k ∈ {-1; 0} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {3} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {2} k ∈ {0} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1} or UNINITIALIZED [3] ∈ {2} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: weak free on bases: {__malloc_w_main6_l77} [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/127) to fit 0..127 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/127) to fit 0..159 [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {3} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {3} k ∈ {0; 1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {4} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {3} k ∈ {1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2} or UNINITIALIZED [4] ∈ {3} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: weak free on bases: {__malloc_w_main6_l77} [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/159) to fit 0..159 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/159) to fit 0..191 [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {4} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {4} k ∈ {1; 2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {5} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {4} k ∈ {2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3} or UNINITIALIZED [5] ∈ {4} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: weak free on bases: {__malloc_w_main6_l77} [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/191) to fit 0..191 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/191) to fit 0..223 [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {5} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {5} k ∈ {2; 3} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {6} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {5} k ∈ {3} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4} or UNINITIALIZED [6] ∈ {5} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: weak free on bases: {__malloc_w_main6_l77} [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/223) to fit 0..223 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/223) to fit 0..255 [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {6} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {6} k ∈ {3; 4} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {7} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {6} k ∈ {4} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5} or UNINITIALIZED [7] ∈ {6} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: weak free on bases: {__malloc_w_main6_l77} [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/255) to fit 0..255 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/255) to fit 0..287 [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {7} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {7} k ∈ {4; 5} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {8} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {7} k ∈ {5} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6} or UNINITIALIZED [8] ∈ {7} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: weak free on bases: {__malloc_w_main6_l77} [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/287) to fit 0..287 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/287) to fit 0..319 [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {8} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {8} k ∈ {5; 6} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {9} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {8} k ∈ {6} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7} or UNINITIALIZED [9] ∈ {8} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: weak free on bases: {__malloc_w_main6_l77} [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/319) to fit 0..319 [eva] tests/builtins/malloc-optimistic.c:77: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:77: resizing variable `__malloc_w_main6_l77' (0..31/319) to fit 0..351 [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {9} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {9} k ∈ {6; 7} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:80: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {10} p ∈ {{ &__malloc_w_main6_l77[0] }} j ∈ {9} k ∈ {7} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:81: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:81: weak free on bases: {__malloc_w_main6_l77} [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/builtins/malloc-optimistic.c:148. [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:90: allocating variable __malloc_main7_l90 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31) to fit 0..63 [eva:alarm] tests/builtins/malloc-optimistic.c:91: Warning: out of bounds write. assert \valid(p + i); [eva:alarm] tests/builtins/malloc-optimistic.c:92: Warning: out of bounds read. assert \valid_read(p + i); [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {0} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {0} k ∈ {-2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0] ∈ {0} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {1} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {0} k ∈ {-2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0] ∈ UNINITIALIZED [1] ∈ {0} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/63) to fit 0..63 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/63) to fit 0..95 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {1} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {1} k ∈ {-1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0] ∈ UNINITIALIZED [1] ∈ {1} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {2} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {1} k ∈ {-1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..1] ∈ UNINITIALIZED [2] ∈ {1} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/95) to fit 0..95 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/95) to fit 0..127 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {2} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {2} k ∈ {0} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..1] ∈ UNINITIALIZED [2] ∈ {2} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {3} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {2} k ∈ {0} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..2] ∈ UNINITIALIZED [3] ∈ {2} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/127) to fit 0..127 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/127) to fit 0..159 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {3} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {3} k ∈ {1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..2] ∈ UNINITIALIZED [3] ∈ {3} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {4} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {3} k ∈ {1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..3] ∈ UNINITIALIZED [4] ∈ {3} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/159) to fit 0..159 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/159) to fit 0..191 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {4} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {4} k ∈ {2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..3] ∈ UNINITIALIZED [4] ∈ {4} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {5} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {4} k ∈ {2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..4] ∈ UNINITIALIZED [5] ∈ {4} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/191) to fit 0..191 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/191) to fit 0..223 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {5} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {5} k ∈ {3} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..4] ∈ UNINITIALIZED [5] ∈ {5} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {6} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {5} k ∈ {3} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..5] ∈ UNINITIALIZED [6] ∈ {5} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/223) to fit 0..223 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/223) to fit 0..255 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {6} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {6} k ∈ {4} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..5] ∈ UNINITIALIZED [6] ∈ {6} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {7} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {6} k ∈ {4} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..6] ∈ UNINITIALIZED [7] ∈ {6} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/255) to fit 0..255 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/255) to fit 0..287 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {7} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {7} k ∈ {5} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..6] ∈ UNINITIALIZED [7] ∈ {7} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {8} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {7} k ∈ {5} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..7] ∈ UNINITIALIZED [8] ∈ {7} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/287) to fit 0..287 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/287) to fit 0..319 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {8} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {8} k ∈ {6} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..7] ∈ UNINITIALIZED [8] ∈ {8} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {9} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {8} k ∈ {6} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..8] ∈ UNINITIALIZED [9] ∈ {8} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/319) to fit 0..319 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/319) to fit 0..351 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {9} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {9} k ∈ {7} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..8] ∈ UNINITIALIZED [9] ∈ {9} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {10} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {9} k ∈ {7} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..9] ∈ UNINITIALIZED [10] ∈ {9} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/351) to fit 0..351 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/351) to fit 0..383 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {10} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {10} k ∈ {8} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..9] ∈ UNINITIALIZED [10] ∈ {10} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {11} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {10} k ∈ {8} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..10] ∈ UNINITIALIZED [11] ∈ {10} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/383) to fit 0..383 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/383) to fit 0..415 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {11} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {11} k ∈ {9} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..10] ∈ UNINITIALIZED [11] ∈ {11} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {12} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {11} k ∈ {9} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..11] ∈ UNINITIALIZED [12] ∈ {11} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/415) to fit 0..415 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/415) to fit 0..447 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {12} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {12} k ∈ {10} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..11] ∈ UNINITIALIZED [12] ∈ {12} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {13} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {12} k ∈ {10} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..12] ∈ UNINITIALIZED [13] ∈ {12} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/447) to fit 0..447 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/447) to fit 0..479 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {13} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {13} k ∈ {11} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..12] ∈ UNINITIALIZED [13] ∈ {13} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {14} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {13} k ∈ {11} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..13] ∈ UNINITIALIZED [14] ∈ {13} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/479) to fit 0..479 [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/479) to fit 0..511 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {14} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {14} k ∈ {12} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..13] ∈ UNINITIALIZED [14] ∈ {14} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {15} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {14} k ∈ {12} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..14] ∈ UNINITIALIZED [15] ∈ {14} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/511) to fit 0..511/543 [eva:alarm] tests/builtins/malloc-optimistic.c:92: Warning: accessing uninitialized left-value. assert \initialized(p + i); [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {15; 16} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {15} k ∈ {13} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..14] ∈ UNINITIALIZED [15..16] ∈ {15} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:88: starting to merge loop iterations [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/543) to fit 0..511/575 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {15; 16; 17} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {15; 16} k ∈ {13; 14} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..14] ∈ UNINITIALIZED [15..17] ∈ {15; 16} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/575) to fit 0..511/607 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {15; 16; 17; 18} p ∈ {{ &__malloc_main7_l90[0] }} j ∈ {15; 16; 17} k ∈ {13; 14; 15} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..14] ∈ UNINITIALIZED [15..18] ∈ {15; 16; 17} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] tests/builtins/malloc-optimistic.c:90: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:90: resizing variable `__malloc_main7_l90' (0..31/607) to fit 0..511/3231 [eva] tests/builtins/malloc-optimistic.c:93: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ [15..100] p ∈ {{ &__malloc_main7_l90[0] }} j ∈ [15..99] k ∈ [13..97] p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main7_l90[0..14] ∈ UNINITIALIZED [15..100] ∈ [15..99] or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:94: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:94: strong free on bases: {__malloc_main7_l90} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/builtins/malloc-optimistic.c:149. [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:103: allocating variable __malloc_main8_l103 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_main8_l103' (0..31) to fit 0..63 [eva:alarm] tests/builtins/malloc-optimistic.c:104: Warning: out of bounds write. assert \valid(p + i); [eva:alarm] tests/builtins/malloc-optimistic.c:105: Warning: out of bounds read. assert \valid_read(p + i); [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {0} p ∈ {{ &__malloc_main8_l103[0] }} j ∈ {0} k ∈ {-2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main8_l103[0] ∈ {0} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {1} p ∈ {{ &__malloc_main8_l103[0] }} j ∈ {0} k ∈ {-2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0} ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: strong free on bases: {__malloc_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc:weak] tests/builtins/malloc-optimistic.c:103: marking variable `__malloc_main8_l103' as weak [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/63) to fit 0..63 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/63) to fit 0..95 [eva:alarm] tests/builtins/malloc-optimistic.c:105: Warning: accessing uninitialized left-value. assert \initialized(p + i); [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {1} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {1} k ∈ {-2; -1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {2} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {1} k ∈ {-1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0} or UNINITIALIZED [2] ∈ {1} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/95) to fit 0..95 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/95) to fit 0..127 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {2} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {2} k ∈ {-1; 0} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {3} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {2} k ∈ {0} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1} or UNINITIALIZED [3] ∈ {2} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/127) to fit 0..127 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/127) to fit 0..159 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {3} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {3} k ∈ {0; 1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {4} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {3} k ∈ {1} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2} or UNINITIALIZED [4] ∈ {3} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/159) to fit 0..159 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/159) to fit 0..191 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {4} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {4} k ∈ {1; 2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {5} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {4} k ∈ {2} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3} or UNINITIALIZED [5] ∈ {4} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/191) to fit 0..191 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/191) to fit 0..223 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {5} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {5} k ∈ {2; 3} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {6} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {5} k ∈ {3} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4} or UNINITIALIZED [6] ∈ {5} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/223) to fit 0..223 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/223) to fit 0..255 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {6} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {6} k ∈ {3; 4} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {7} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {6} k ∈ {4} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5} or UNINITIALIZED [7] ∈ {6} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/255) to fit 0..255 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/255) to fit 0..287 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {7} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {7} k ∈ {4; 5} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {8} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {7} k ∈ {5} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6} or UNINITIALIZED [8] ∈ {7} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/287) to fit 0..287 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/287) to fit 0..319 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {8} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {8} k ∈ {5; 6} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {9} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {8} k ∈ {6} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7} or UNINITIALIZED [9] ∈ {8} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/319) to fit 0..319 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/319) to fit 0..351 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {9} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {9} k ∈ {6; 7} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {10} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {9} k ∈ {7} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/351) to fit 0..351 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/351) to fit 0..383 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {10} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {10} k ∈ {7; 8} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {11} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {10} k ∈ {8} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED [11] ∈ {10} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/383) to fit 0..383 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/383) to fit 0..415 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {11} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {11} k ∈ {8; 9} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {12} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {11} k ∈ {9} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10} or UNINITIALIZED [12] ∈ {11} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/415) to fit 0..415 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/415) to fit 0..447 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {12} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {12} k ∈ {9; 10} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {13} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {12} k ∈ {10} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11} or UNINITIALIZED [13] ∈ {12} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/447) to fit 0..447 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/447) to fit 0..479 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {13} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {13} k ∈ {10; 11} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12; 13} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {14} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {13} k ∈ {11} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12} or UNINITIALIZED [14] ∈ {13} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/479) to fit 0..479 [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/479) to fit 0..511 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {14} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {14} k ∈ {11; 12} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12; 13} or UNINITIALIZED [14] ∈ {13; 14} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {15} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {14} k ∈ {12} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12; 13} or UNINITIALIZED [14] ∈ {13} or UNINITIALIZED [15] ∈ {14} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/511) to fit 0..511/543 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {15; 16} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {15} k ∈ {12; 13} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12; 13} or UNINITIALIZED [14] ∈ {13; 14} or UNINITIALIZED [15] ∈ {14; 15} or UNINITIALIZED [16] ∈ {15} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:101: starting to merge loop iterations [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/543) to fit 0..511/575 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {15; 16; 17} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {15; 16} k ∈ {12; 13; 14} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12; 13} or UNINITIALIZED [14] ∈ {13; 14} or UNINITIALIZED [15] ∈ {14; 15; 16} or UNINITIALIZED [16..17] ∈ {15; 16} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/575) to fit 0..511/607 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ {15; 16; 17; 18} p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ {15; 16; 17} k ∈ {12; 13; 14; 15} p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12; 13} or UNINITIALIZED [14] ∈ {13; 14} or UNINITIALIZED [15] ∈ {14; 15; 16; 17} or UNINITIALIZED [16..18] ∈ {15; 16; 17} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/607) to fit 0..511/3231 [eva] tests/builtins/malloc-optimistic.c:106: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] i ∈ [15..100] p ∈ {{ &__malloc_w_main8_l103[0] }} j ∈ [15..99] k ∈ [12..97] p ∈ ESCAPINGADDR __retres ∈ UNINITIALIZED __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12; 13} or UNINITIALIZED [14] ∈ {13; 14} or UNINITIALIZED [15] ∈ [14..99] or UNINITIALIZED [16..100] ∈ [15..99] or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/malloc-optimistic.c:107: Call to builtin free [eva:malloc] tests/builtins/malloc-optimistic.c:107: weak free on bases: {__malloc_w_main8_l103} [eva] tests/builtins/malloc-optimistic.c:103: Call to builtin malloc [eva:malloc] tests/builtins/malloc-optimistic.c:103: resizing variable `__malloc_w_main8_l103' (0..31/3231) to fit 0..511/3231 [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/builtins/malloc-optimistic.c:150. [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:119: allocating variable __malloc_main9_l119 [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {0}, {{ &__malloc_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {0} [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva:malloc:weak] tests/builtins/malloc-optimistic.c:119: marking variable `__malloc_main9_l119' as weak [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {1}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1} [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {2}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2} [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {3}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2; 3} [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {4}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2; 3; 4} [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {5}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2; 3; 4; 5} [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {6}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2; 3; 4; 5; 6} [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {7}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: {-20; 1; 2; 3; 4; 5; 6; 7} [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {8}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..8] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {9}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..9] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {10}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..10] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {11}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..11] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {12}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..12] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {13}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..13] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {14}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..14] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {15}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..15] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {16}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..16] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {17}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..17] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {18}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..18] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {19}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..19] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {20}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..20] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {21}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..21] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {22}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..22] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {23}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..23] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {24}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..24] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {25}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..25] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {26}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..26] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {27}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..27] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {28}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..28] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {29}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..29] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {30}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..30] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:118: starting to merge loop iterations [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {30; 31}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..31] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: {30; 31; 32}, {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..32] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: [30..99], {{ &__malloc_w_main9_l119 }} [eva] tests/builtins/malloc-optimistic.c:122: Frama_C_show_each: [-20..99] [eva] computing for function main9_aux <- main9 <- main. Called from tests/builtins/malloc-optimistic.c:123. [eva] Recording results for main9_aux [eva] Done for function main9_aux [eva] tests/builtins/malloc-optimistic.c:119: Call to builtin malloc [eva] tests/builtins/malloc-optimistic.c:120: Frama_C_show_each: [30..99], {{ &__malloc_w_main9_l119 }} [eva] Recording results for main9 [eva] Done for function main9 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main9_aux: __malloc_w_main9_l119 ∈ [-20..99] or UNINITIALIZED [eva:final-states] Values at end of function main1: i ∈ {0; 1} p ∈ {{ &__malloc_main1_l17[0] }} __retres ∈ {{ (void *)&__malloc_main1_l17 }} __malloc_main1_l17[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} [eva:final-states] Values at end of function main2: i ∈ {1; 2} p ∈ {{ &__malloc_main2_l27[0] }} __retres ∈ {{ (void *)&__malloc_main2_l27 }} __malloc_main2_l27[0] ∈ UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} [eva:final-states] Values at end of function main5: i ∈ {9; 10} p ∈ ESCAPINGADDR __retres ∈ {0} [eva:final-states] Values at end of function main6: i ∈ {9; 10} p ∈ {{ &__malloc_w_main6_l77[0] }} or ESCAPINGADDR __retres ∈ {0} __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED [eva:final-states] Values at end of function main7: i ∈ [14..100] p ∈ ESCAPINGADDR __retres ∈ {0} [eva:final-states] Values at end of function main8: i ∈ [14..100] p ∈ {{ &__malloc_w_main8_l103[0] }} or ESCAPINGADDR __retres ∈ {0} __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12; 13} or UNINITIALIZED [14] ∈ {13; 14} or UNINITIALIZED [15] ∈ [14..99] or UNINITIALIZED [16..100] ∈ [15..99] or UNINITIALIZED [eva:final-states] Values at end of function main9: p ∈ {{ &__malloc_w_main9_l119 }} __retres ∈ {0} __malloc_w_main9_l119 ∈ [-20..99] or UNINITIALIZED [eva:final-states] Values at end of function main_3_aux: p ∈ {{ &__malloc_main_3_aux_l34[0] }} __retres ∈ {{ (void *)&__malloc_main_3_aux_l34 }} __malloc_main_3_aux_l34[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} [eva:final-states] Values at end of function main3: i ∈ {0; 1} p ∈ {{ &__malloc_main_3_aux_l34[0] }} __retres ∈ {{ (void *)&__malloc_main_3_aux_l34 }} __malloc_main_3_aux_l34[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} [eva:final-states] Values at end of function main_4_aux: p ∈ {{ &__malloc_main_4_aux_l40[0] }} __retres ∈ {{ (void *)&__malloc_main_4_aux_l40 }} __malloc_main_4_aux_l40[0] ∈ UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} [eva:final-states] Values at end of function main4: i ∈ {1; 2} p ∈ {{ &__malloc_main_4_aux_l40[0] }} __retres ∈ {{ (void *)&__malloc_main_4_aux_l40 }} __malloc_main_4_aux_l40[0] ∈ UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} [eva:final-states] Values at end of function main: p ∈ ESCAPINGADDR __malloc_w_main6_l77[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9} or UNINITIALIZED __malloc_w_main8_l103[0] ∈ UNINITIALIZED [1] ∈ {0; 1} or UNINITIALIZED [2] ∈ {1; 2} or UNINITIALIZED [3] ∈ {2; 3} or UNINITIALIZED [4] ∈ {3; 4} or UNINITIALIZED [5] ∈ {4; 5} or UNINITIALIZED [6] ∈ {5; 6} or UNINITIALIZED [7] ∈ {6; 7} or UNINITIALIZED [8] ∈ {7; 8} or UNINITIALIZED [9] ∈ {8; 9} or UNINITIALIZED [10] ∈ {9; 10} or UNINITIALIZED [11] ∈ {10; 11} or UNINITIALIZED [12] ∈ {11; 12} or UNINITIALIZED [13] ∈ {12; 13} or UNINITIALIZED [14] ∈ {13; 14} or UNINITIALIZED [15] ∈ [14..99] or UNINITIALIZED [16..100] ∈ [15..99] or UNINITIALIZED __malloc_w_main9_l119 ∈ [-20..99] or UNINITIALIZED [from] Computing for function main9_aux [from] Done for function main9_aux [from] Computing for function main1 [from] Computing for function malloc <-main1 [from] Done for function malloc [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main5 [from] Computing for function free <-main5 [from] Done for function free [from] Done for function main5 [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8 [from] Done for function main8 [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main_3_aux [from] Done for function main_3_aux [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main_4_aux [from] Done for function main_4_aux [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function free: NO EFFECTS [from] Function main9_aux: __malloc_w_main9_l119 FROM p (and SELF) [from] Function malloc: \result FROM \nothing [from] Function main1: __malloc_main1_l17[0..1] FROM v (and SELF) \result FROM \nothing [from] Function main2: __malloc_main2_l27[1..2] FROM v (and SELF) \result FROM \nothing [from] Function main5: __malloc_main5_l64[0..10] FROM v (and SELF) \result FROM \nothing [from] Function main6: __malloc_w_main6_l77[0..10] FROM v (and SELF) \result FROM \nothing [from] Function main7: __malloc_main7_l90[0..100] FROM v (and SELF) \result FROM \nothing [from] Function main8: __malloc_w_main8_l103[0..100] FROM v (and SELF) \result FROM \nothing [from] Function main9: __malloc_w_main9_l119 FROM \nothing (and SELF) \result FROM \nothing [from] Function main_3_aux: __malloc_main_3_aux_l34[0..1] FROM i (and SELF) \result FROM \nothing [from] Function main3: __malloc_main_3_aux_l34[0..1] FROM v (and SELF) \result FROM \nothing [from] Function main_4_aux: __malloc_main_4_aux_l40[1..2] FROM i (and SELF) \result FROM \nothing [from] Function main4: __malloc_main_4_aux_l40[1..2] FROM v (and SELF) \result FROM \nothing [from] Function main: __malloc_main1_l17[0..1] FROM v (and SELF) __malloc_main2_l27[1..2] FROM v (and SELF) __malloc_main_3_aux_l34[0..1] FROM v (and SELF) __malloc_main_4_aux_l40[1..2] FROM v (and SELF) __malloc_main5_l64[0..10] FROM v (and SELF) __malloc_w_main6_l77[0..10] FROM v (and SELF) __malloc_main7_l90[0..100] FROM v (and SELF) __malloc_w_main8_l103[0..100] FROM v (and SELF) __malloc_w_main9_l119 FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main9_aux: __malloc_w_main9_l119 [inout] Inputs for function main9_aux: \nothing [inout] Out (internal) for function main1: i; p; __retres; __malloc_main1_l17[0..1] [inout] Inputs for function main1: v [inout] Out (internal) for function main2: i; p; __retres; __malloc_main2_l27[1..2] [inout] Inputs for function main2: v [inout] Out (internal) for function main5: i; p; j; k; __retres; __malloc_main5_l64[0..10] [inout] Inputs for function main5: v; __malloc_main5_l64[0..10] [inout] Out (internal) for function main6: i; p; j; k; __retres; __malloc_w_main6_l77[0..10] [inout] Inputs for function main6: v; __malloc_w_main6_l77[0..10] [inout] Out (internal) for function main7: i; p; j; k; __retres; __malloc_main7_l90[0..100] [inout] Inputs for function main7: v; __malloc_main7_l90[0..100] [inout] Out (internal) for function main8: i; p; j; k; __retres; __malloc_w_main8_l103[0..100] [inout] Inputs for function main8: v; __malloc_w_main8_l103[0..100] [inout] Out (internal) for function main9: p; j; __retres; __malloc_w_main9_l119 [inout] Inputs for function main9: __malloc_w_main9_l119 [inout] Out (internal) for function main_3_aux: p; __retres; __malloc_main_3_aux_l34[0..1] [inout] Inputs for function main_3_aux: \nothing [inout] Out (internal) for function main3: i; p; __retres; __malloc_main_3_aux_l34[0..1] [inout] Inputs for function main3: v [inout] Out (internal) for function main_4_aux: p; __retres; __malloc_main_4_aux_l40[1..2] [inout] Inputs for function main_4_aux: \nothing [inout] Out (internal) for function main4: i; p; __retres; __malloc_main_4_aux_l40[1..2] [inout] Inputs for function main4: v [inout] Out (internal) for function main: p; __malloc_main1_l17[0..1]; __malloc_main2_l27[1..2]; __malloc_main_3_aux_l34[0..1]; __malloc_main_4_aux_l40[1..2]; __malloc_main5_l64[0..10]; __malloc_w_main6_l77[0..10]; __malloc_main7_l90[0..100]; __malloc_w_main8_l103[0..100]; __malloc_w_main9_l119 [inout] Inputs for function main: v; __malloc_main5_l64[0..10]; __malloc_w_main6_l77[0..10]; __malloc_main7_l90[0..100]; __malloc_w_main8_l103[0..100]; __malloc_w_main9_l119 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/malloc-size-zero.0.res.oracle����������������������������0000666�0000000�0000000�00000013403�13571573400�022765� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/malloc-size-zero.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization foo ∈ [--..--] [eva] computing for function my_calloc <- main. Called from tests/builtins/malloc-size-zero.c:16. [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc [eva] tests/builtins/malloc-size-zero.c:10: allocating variable __malloc_my_calloc_l10 [eva] Recording results for my_calloc [eva] Done for function my_calloc [eva] tests/builtins/malloc-size-zero.c:20: Frama_C_show_each_not_NULL_p1: [eva:alarm] tests/builtins/malloc-size-zero.c:24: Warning: pointer comparison. assert \pointer_comparable((void *)(p1 + 1), (void *)0); [eva] computing for function my_calloc <- main. Called from tests/builtins/malloc-size-zero.c:29. [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc [eva] tests/builtins/malloc-size-zero.c:10: allocating variable __malloc_my_calloc_l10_0 [eva] Recording results for my_calloc [eva] Done for function my_calloc [eva] tests/builtins/malloc-size-zero.c:27: starting to merge loop iterations [eva] computing for function my_calloc <- main. Called from tests/builtins/malloc-size-zero.c:29. [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc [eva] tests/builtins/malloc-size-zero.c:10: allocating variable __malloc_my_calloc_l10_1 [eva] Recording results for my_calloc [eva] Done for function my_calloc [eva] computing for function my_calloc <- main. Called from tests/builtins/malloc-size-zero.c:29. [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc [eva] tests/builtins/malloc-size-zero.c:10: allocating variable __malloc_my_calloc_l10_2 [eva] Recording results for my_calloc [eva] Done for function my_calloc [eva] computing for function my_calloc <- main. Called from tests/builtins/malloc-size-zero.c:29. [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc [eva] tests/builtins/malloc-size-zero.c:10: allocating variable __malloc_my_calloc_l10_3 [eva] Recording results for my_calloc [eva] Done for function my_calloc [eva] computing for function my_calloc <- main. Called from tests/builtins/malloc-size-zero.c:29. [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc [eva:malloc:weak] tests/builtins/malloc-size-zero.c:10: marking variable `__malloc_my_calloc_l10_3' as weak [eva] Recording results for my_calloc [eva] Done for function my_calloc [eva] tests/builtins/malloc-size-zero.c:33: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] foo ∈ [--..--] p1 ∈ {{ &__malloc_my_calloc_l10[0] }} q1 ∈ {{ &__malloc_my_calloc_l10_0[0] ; &__malloc_my_calloc_l10_1[0] ; &__malloc_my_calloc_l10_2[0] ; &__malloc_w_my_calloc_l10_3[0] }} or UNINITIALIZED S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_my_calloc_l10∈ ∅ __malloc_my_calloc_l10_0∈ ∅ __malloc_my_calloc_l10_1∈ ∅ __malloc_my_calloc_l10_2∈ ∅ __malloc_w_my_calloc_l10_3∈ ∅ ==END OF DUMP== [eva:alarm] tests/builtins/malloc-size-zero.c:35: Warning: out of bounds write. assert \valid(p1); [kernel] tests/builtins/malloc-size-zero.c:35: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/malloc-size-zero.c:37: Call to builtin free [eva] tests/builtins/malloc-size-zero.c:37: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/malloc-size-zero.c:37: strong free on bases: {__malloc_my_calloc_l10} [eva] tests/builtins/malloc-size-zero.c:39: Frama_C_show_each: {{ &__malloc_my_calloc_l10_0 ; &__malloc_my_calloc_l10_1 ; &__malloc_my_calloc_l10_2 ; &__malloc_w_my_calloc_l10_3 }} [eva] tests/builtins/malloc-size-zero.c:40: assertion got status valid. [eva:alarm] tests/builtins/malloc-size-zero.c:42: Warning: accessing uninitialized left-value. assert \initialized(&q1); [eva:alarm] tests/builtins/malloc-size-zero.c:42: Warning: out of bounds write. assert \valid(q1); [kernel] tests/builtins/malloc-size-zero.c:42: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/builtins/malloc-size-zero.c:44: Warning: accessing uninitialized left-value. assert \initialized(&q1); [eva] tests/builtins/malloc-size-zero.c:44: Call to builtin free [eva] tests/builtins/malloc-size-zero.c:44: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/malloc-size-zero.c:44: weak free on bases: {__malloc_my_calloc_l10_0, __malloc_my_calloc_l10_1, __malloc_my_calloc_l10_2, __malloc_w_my_calloc_l10_3} [eva] Recording results for main [eva] done for function main [eva] tests/builtins/malloc-size-zero.c:35: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/malloc-size-zero.c:42: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function my_calloc: __fc_heap_status ∈ [--..--] [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR q1 ∈ {{ &__malloc_my_calloc_l10_0[0] ; &__malloc_my_calloc_l10_1[0] ; &__malloc_my_calloc_l10_2[0] ; &__malloc_w_my_calloc_l10_3[0] }} or ESCAPINGADDR �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/malloc-size-zero.1.res.oracle����������������������������0000666�0000000�0000000�00000010347�13571573400�022772� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/malloc-size-zero.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization foo ∈ [--..--] [eva] computing for function my_calloc <- main. Called from tests/builtins/malloc-size-zero.c:16. [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc [eva] tests/builtins/malloc-size-zero.c:10: allocating variable __malloc_main_l16 [eva] Recording results for my_calloc [eva] Done for function my_calloc [eva] tests/builtins/malloc-size-zero.c:20: Frama_C_show_each_not_NULL_p1: [eva:alarm] tests/builtins/malloc-size-zero.c:24: Warning: pointer comparison. assert \pointer_comparable((void *)(p1 + 1), (void *)0); [eva] computing for function my_calloc <- main. Called from tests/builtins/malloc-size-zero.c:29. [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc [eva] tests/builtins/malloc-size-zero.c:10: allocating variable __malloc_main_l29 [eva] Recording results for my_calloc [eva] Done for function my_calloc [eva] tests/builtins/malloc-size-zero.c:27: starting to merge loop iterations [eva] computing for function my_calloc <- main. Called from tests/builtins/malloc-size-zero.c:29. [eva] tests/builtins/malloc-size-zero.c:10: Call to builtin malloc [eva:malloc:weak] tests/builtins/malloc-size-zero.c:10: marking variable `__malloc_main_l29' as weak [eva] Recording results for my_calloc [eva] Done for function my_calloc [eva] tests/builtins/malloc-size-zero.c:33: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] foo ∈ [--..--] p1 ∈ {{ &__malloc_main_l16[0] }} q1 ∈ {{ &__malloc_w_main_l29[0] }} or UNINITIALIZED S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main_l16∈ ∅ __malloc_w_main_l29∈ ∅ ==END OF DUMP== [eva:alarm] tests/builtins/malloc-size-zero.c:35: Warning: out of bounds write. assert \valid(p1); [kernel] tests/builtins/malloc-size-zero.c:35: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/malloc-size-zero.c:37: Call to builtin free [eva] tests/builtins/malloc-size-zero.c:37: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/malloc-size-zero.c:37: strong free on bases: {__malloc_main_l16} [eva] tests/builtins/malloc-size-zero.c:39: Frama_C_show_each: {{ &__malloc_w_main_l29 }} [eva] tests/builtins/malloc-size-zero.c:40: assertion got status valid. [eva:alarm] tests/builtins/malloc-size-zero.c:42: Warning: accessing uninitialized left-value. assert \initialized(&q1); [eva:alarm] tests/builtins/malloc-size-zero.c:42: Warning: out of bounds write. assert \valid(q1); [kernel] tests/builtins/malloc-size-zero.c:42: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/builtins/malloc-size-zero.c:44: Warning: accessing uninitialized left-value. assert \initialized(&q1); [eva] tests/builtins/malloc-size-zero.c:44: Call to builtin free [eva] tests/builtins/malloc-size-zero.c:44: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/malloc-size-zero.c:44: weak free on bases: {__malloc_w_main_l29} [eva] Recording results for main [eva] done for function main [eva] tests/builtins/malloc-size-zero.c:35: assertion 'Eva,mem_access' got final status invalid. [eva] tests/builtins/malloc-size-zero.c:42: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function my_calloc: __fc_heap_status ∈ [--..--] [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR q1 ∈ {{ &__malloc_w_main_l29[0] }} or ESCAPINGADDR �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/malloc.res.oracle����������������������������������������0000666�0000000�0000000�00000006014�13571573400�020702� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/malloc.c (with preprocessing) [kernel:annot:missing-spec] tests/builtins/malloc.c:8: Warning: Neither code nor specification for function Frama_C_malloc_fresh, generating default assigns from the prototype [kernel:annot:missing-spec] tests/builtins/malloc.c:8: Warning: Neither code nor specification for function Frama_C_malloc_by_stack, generating default assigns from the prototype [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/builtins/malloc.c:13: Call to builtin Frama_C_malloc_by_stack [eva] tests/builtins/malloc.c:13: allocating variable __malloc_main_l13 [eva] tests/builtins/malloc.c:19: Call to builtin Frama_C_malloc_by_stack [eva] tests/builtins/malloc.c:19: allocating variable __malloc_main_l19 [eva] tests/builtins/malloc.c:19: Call to builtin Frama_C_malloc_by_stack [eva:malloc] tests/builtins/malloc.c:19: resizing variable `__malloc_main_l19' (0..-1/34359738359) to fit 0..-1 [eva] tests/builtins/malloc.c:20: Call to builtin Frama_C_malloc_by_stack [eva] tests/builtins/malloc.c:20: allocating variable __malloc_main_l20 [eva] tests/builtins/malloc.c:20: Call to builtin Frama_C_malloc_by_stack [eva] tests/builtins/malloc.c:21: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/malloc.c:21: allocating variable __malloc_main_l21 [eva] tests/builtins/malloc.c:21: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/malloc.c:21: allocating variable __malloc_main_l21_0 [eva:alarm] tests/builtins/malloc.c:22: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/malloc.c:23: Warning: out of bounds write. assert \valid(p + 2); [eva:alarm] tests/builtins/malloc.c:24: Warning: out of bounds write. assert \valid(p + 24999); [eva] tests/builtins/malloc.c:27: Frama_C_show_each: {{ &__malloc_main_l20 + {8} }} [eva] tests/builtins/malloc.c:27: Frama_C_show_each: {{ &__malloc_main_l20 + {8} }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {1; 2} s ∈ {{ NULL ; &__malloc_main_l13[0] }} p ∈ {{ (int *)&__malloc_main_l19 }} q ∈ {{ &__malloc_main_l20[0] }} r ∈ {{ &__malloc_main_l21[0] ; &__malloc_main_l21_0[0] }} __malloc_main_l19[bits 0 to 31] ∈ {1} [4..7] ∈ UNINITIALIZED [bits 64 to 95] ∈ {3} [12..99995] ∈ UNINITIALIZED [bits 799968 to 799999] ∈ {4} [100000..4294967294] ∈ UNINITIALIZED __malloc_main_l20[0] ∈ {1} [1] ∈ UNINITIALIZED [2] ∈ {3} __malloc_main_l21[0] ∈ {1} [1] ∈ UNINITIALIZED [2] ∈ {3} [3..24] ∈ UNINITIALIZED __malloc_main_l21_0[0] ∈ {1} [1] ∈ UNINITIALIZED [2] ∈ {3} [3..24] ∈ UNINITIALIZED ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/malloc_bug_tr.res.oracle���������������������������������0000666�0000000�0000000�00000005230�13571573400�022243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/malloc_bug_tr.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function Frama_C_interval <- main. Called from tests/builtins/malloc_bug_tr.c:12. [eva] using specification for function Frama_C_interval [eva] tests/builtins/malloc_bug_tr.c:12: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/malloc_bug_tr.c:12: Call to builtin malloc [eva] tests/builtins/malloc_bug_tr.c:12: allocating variable __malloc_main_l12 [eva] tests/builtins/malloc_bug_tr.c:13: Call to builtin memcpy [eva] tests/builtins/malloc_bug_tr.c:13: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/malloc_bug_tr.c:13: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/malloc_bug_tr.c:13: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] tests/builtins/malloc_bug_tr.c:14: Call to builtin memcpy [eva:alarm] tests/builtins/malloc_bug_tr.c:14: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva] tests/builtins/malloc_bug_tr.c:14: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/malloc_bug_tr.c:14: function memcpy: precondition 'separation' got status valid. [eva] tests/builtins/malloc_bug_tr.c:15: Call to builtin memcpy [eva] tests/builtins/malloc_bug_tr.c:15: function memcpy: precondition 'valid_dest' got status valid. [eva:alarm] tests/builtins/malloc_bug_tr.c:15: Warning: function memcpy: precondition 'valid_src' got status unknown. [eva] tests/builtins/malloc_bug_tr.c:15: function memcpy: precondition 'separation' got status valid. [eva:alarm] tests/builtins/malloc_bug_tr.c:16: Warning: out of bounds write. assert \valid(p + 5); [eva:alarm] tests/builtins/malloc_bug_tr.c:17: Warning: out of bounds read. assert \valid_read(p + 5); [eva] tests/builtins/malloc_bug_tr.c:18: Call to builtin free [eva] tests/builtins/malloc_bug_tr.c:18: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/malloc_bug_tr.c:18: strong free on bases: {__malloc_main_l12} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ ESCAPINGADDR r ∈ {120} __retres ∈ {0} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/malloc_individual.res.oracle�����������������������������0000666�0000000�0000000�00000003411�13571573400�023110� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/malloc_individual.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} A ∈ {0} B ∈ {0} C ∈ {0} [eva] tests/builtins/malloc_individual.c:12: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/malloc_individual.c:12: allocating variable __malloc_main_l12 [eva:alarm] tests/builtins/malloc_individual.c:15: Warning: accessing uninitialized left-value. assert \initialized(p); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p ∈ {{ &__malloc_main_l12 }} A ∈ {3} B ∈ {3} C ∈ {4} __malloc_main_l12 ∈ {3} [from] Computing for function main [from] Computing for function Frama_C_malloc_fresh <-main [from] Done for function Frama_C_malloc_fresh [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_malloc_fresh: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) p FROM __fc_heap_status A FROM __fc_heap_status; c; __malloc_main_l12 B FROM __fc_heap_status; c; __malloc_main_l12 C FROM __fc_heap_status; c; __malloc_main_l12 __malloc_main_l12 FROM __fc_heap_status; c (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; p; A; B; C; __malloc_main_l12 [inout] Inputs for function main: __fc_heap_status; p; A; __malloc_main_l12 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/malloc_memexec.res.oracle��������������������������������0000666�0000000�0000000�00000006067�13571573400�022415� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/malloc_memexec.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] tests/builtins/malloc_memexec.c:19: Call to builtin Frama_C_malloc_fresh [eva] tests/builtins/malloc_memexec.c:19: allocating variable __malloc_main_l19 [eva] computing for function f <- main. Called from tests/builtins/malloc_memexec.c:21. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/builtins/malloc_memexec.c:22. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/builtins/malloc_memexec.c:24. [eva] Recording results for f [eva] Done for function f [eva] tests/builtins/malloc_memexec.c:27: Call to builtin Frama_C_malloc_fresh_weak [eva] tests/builtins/malloc_memexec.c:27: allocating weak variable __malloc_w_main_l27 [eva] computing for function f <- main. Called from tests/builtins/malloc_memexec.c:29. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/builtins/malloc_memexec.c:30. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/builtins/malloc_memexec.c:32. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __malloc_main_l19 ∈ {1; 2} __malloc_w_main_l27[0] ∈ {1; 2} or UNINITIALIZED [eva:final-states] Values at end of function main: p ∈ {{ &__malloc_main_l19 }} q ∈ {{ &__malloc_w_main_l27[0] }} __malloc_main_l19 ∈ {1} __malloc_w_main_l27[0] ∈ {1; 2} or UNINITIALIZED [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Computing for function Frama_C_malloc_fresh <-main [from] Done for function Frama_C_malloc_fresh [from] Computing for function Frama_C_malloc_fresh_weak <-main [from] Done for function Frama_C_malloc_fresh_weak [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_malloc_fresh: \result FROM ANYTHING(origin:Unknown) [from] Function Frama_C_malloc_fresh_weak: \result FROM ANYTHING(origin:Unknown) [from] Function f: __malloc_main_l19 FROM p; i (and SELF) __malloc_w_main_l27[0] FROM p; i (and SELF) [from] Function main: __malloc_main_l19 FROM ANYTHING(origin:Unknown) (and SELF) __malloc_w_main_l27[0] FROM ANYTHING(origin:Unknown) (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] InOut (internal) for function f: Operational inputs: p; i Operational inputs on termination: p; i Sure outputs: \nothing [inout] InOut (internal) for function main: Operational inputs: v Operational inputs on termination: v Sure outputs: p; q; __malloc_main_l19 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/malloc_multiple.res.oracle�������������������������������0000666�0000000�0000000�00000024443�13571573400�022623� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/malloc_multiple.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} F[0..9] ∈ {0} [eva] computing for function allocate_T <- main. Called from tests/builtins/malloc_multiple.c:42. [eva] tests/builtins/malloc_multiple.c:11: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:11: allocating variable __malloc_allocate_T_l11 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_0 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_1 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_2 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_3 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_4 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva:malloc:weak] tests/builtins/malloc_multiple.c:14: marking variable `__malloc_allocate_T_l14_4' as weak [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] Recording results for allocate_T [eva] Done for function allocate_T [eva] computing for function allocate_T <- main. Called from tests/builtins/malloc_multiple.c:43. [eva] tests/builtins/malloc_multiple.c:11: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:11: allocating variable __malloc_allocate_T_l11_0 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_5 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_6 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_7 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_8 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_9 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: allocating variable __malloc_allocate_T_l14_10 [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva:malloc:weak] tests/builtins/malloc_multiple.c:14: marking variable `__malloc_allocate_T_l14_10' as weak [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:14: Call to builtin malloc [eva] Recording results for allocate_T [eva] Done for function allocate_T [eva] computing for function allocate_and_free_last <- main. Called from tests/builtins/malloc_multiple.c:44. [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:29: allocating variable __malloc_allocate_and_free_last_l29 [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_allocate_and_free_last_l29 }} [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:29: allocating variable __malloc_allocate_and_free_last_l29_0 [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_allocate_and_free_last_l29_0 }} [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:29: allocating variable __malloc_allocate_and_free_last_l29_1 [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_allocate_and_free_last_l29_1 }} [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:29: allocating variable __malloc_allocate_and_free_last_l29_2 [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_allocate_and_free_last_l29_2 }} [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:29: allocating variable __malloc_allocate_and_free_last_l29_3 [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_allocate_and_free_last_l29_3 }} [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:29: allocating variable __malloc_allocate_and_free_last_l29_4 [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_allocate_and_free_last_l29_4 }} [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva:malloc:weak] tests/builtins/malloc_multiple.c:29: marking variable `__malloc_allocate_and_free_last_l29_4' as weak [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_w_allocate_and_free_last_l29_4 }} [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_w_allocate_and_free_last_l29_4 }} [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_w_allocate_and_free_last_l29_4 }} [eva] tests/builtins/malloc_multiple.c:29: Call to builtin malloc [eva] tests/builtins/malloc_multiple.c:31: Frama_C_show_each_F: {{ &__malloc_w_allocate_and_free_last_l29_4 }} [eva] tests/builtins/malloc_multiple.c:34: Call to builtin free [eva] tests/builtins/malloc_multiple.c:34: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/malloc_multiple.c:34: weak free on bases: {__malloc_w_allocate_and_free_last_l29_4} [eva] tests/builtins/malloc_multiple.c:35: assertion got status valid. [eva:alarm] tests/builtins/malloc_multiple.c:36: Warning: assertion got status unknown. [eva:alarm] tests/builtins/malloc_multiple.c:37: Warning: assertion got status unknown. [eva] Recording results for allocate_and_free_last [eva] Done for function allocate_and_free_last [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function allocate_T: __fc_heap_status ∈ [--..--] T[0] ∈ {{ &__malloc_allocate_T_l11 ; &__malloc_allocate_T_l11_0 }} [1] ∈ {{ &__malloc_allocate_T_l14 ; &__malloc_allocate_T_l14_5 }} [2] ∈ {{ &__malloc_allocate_T_l14_0 ; &__malloc_allocate_T_l14_6 }} [3] ∈ {{ &__malloc_allocate_T_l14_1 ; &__malloc_allocate_T_l14_7 }} [4] ∈ {{ &__malloc_allocate_T_l14_2 ; &__malloc_allocate_T_l14_8 }} [5] ∈ {{ &__malloc_allocate_T_l14_3 ; &__malloc_allocate_T_l14_9 }} [6..9] ∈ {{ &__malloc_w_allocate_T_l14_4 ; &__malloc_w_allocate_T_l14_10 }} counter ∈ {10} error ∈ {0} __malloc_allocate_T_l11 ∈ {111} __malloc_allocate_T_l14 ∈ {222} __malloc_allocate_T_l14_0 ∈ {333} __malloc_allocate_T_l14_1 ∈ {444} __malloc_allocate_T_l14_2 ∈ {555} __malloc_allocate_T_l14_3 ∈ {1} __malloc_w_allocate_T_l14_4 ∈ {1} or UNINITIALIZED __malloc_allocate_T_l11_0 ∈ {111} __malloc_allocate_T_l14_5 ∈ {222} __malloc_allocate_T_l14_6 ∈ {333} __malloc_allocate_T_l14_7 ∈ {444} __malloc_allocate_T_l14_8 ∈ {555} __malloc_allocate_T_l14_9 ∈ {2} __malloc_w_allocate_T_l14_10 ∈ {2} or UNINITIALIZED [eva:final-states] Values at end of function allocate_and_free_last: __fc_heap_status ∈ [--..--] F[0] ∈ {{ &__malloc_allocate_and_free_last_l29 }} [1] ∈ {{ &__malloc_allocate_and_free_last_l29_0 }} [2] ∈ {{ &__malloc_allocate_and_free_last_l29_1 }} [3] ∈ {{ &__malloc_allocate_and_free_last_l29_2 }} [4] ∈ {{ &__malloc_allocate_and_free_last_l29_3 }} [5..9] ∈ {{ &__malloc_w_allocate_and_free_last_l29_4 }} or ESCAPINGADDR __malloc_allocate_and_free_last_l29 ∈ {0} __malloc_allocate_and_free_last_l29_0 ∈ {1} __malloc_allocate_and_free_last_l29_1 ∈ {2} __malloc_allocate_and_free_last_l29_2 ∈ {3} __malloc_allocate_and_free_last_l29_3 ∈ {4} __malloc_w_allocate_and_free_last_l29_4 ∈ {5; 6; 7; 8; 9} or UNINITIALIZED [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] T[0] ∈ {{ &__malloc_allocate_T_l11_0 }} [1] ∈ {{ &__malloc_allocate_T_l14_5 }} [2] ∈ {{ &__malloc_allocate_T_l14_6 }} [3] ∈ {{ &__malloc_allocate_T_l14_7 }} [4] ∈ {{ &__malloc_allocate_T_l14_8 }} [5] ∈ {{ &__malloc_allocate_T_l14_9 }} [6..9] ∈ {{ &__malloc_w_allocate_T_l14_10 }} F[0] ∈ {{ &__malloc_allocate_and_free_last_l29 }} [1] ∈ {{ &__malloc_allocate_and_free_last_l29_0 }} [2] ∈ {{ &__malloc_allocate_and_free_last_l29_1 }} [3] ∈ {{ &__malloc_allocate_and_free_last_l29_2 }} [4] ∈ {{ &__malloc_allocate_and_free_last_l29_3 }} [5..9] ∈ {{ &__malloc_w_allocate_and_free_last_l29_4 }} or ESCAPINGADDR __retres ∈ {0} __malloc_allocate_T_l11 ∈ {111} __malloc_allocate_T_l14 ∈ {222} __malloc_allocate_T_l14_0 ∈ {333} __malloc_allocate_T_l14_1 ∈ {444} __malloc_allocate_T_l14_2 ∈ {555} __malloc_allocate_T_l14_3 ∈ {1} __malloc_w_allocate_T_l14_4 ∈ {1} or UNINITIALIZED __malloc_allocate_T_l11_0 ∈ {111} __malloc_allocate_T_l14_5 ∈ {222} __malloc_allocate_T_l14_6 ∈ {333} __malloc_allocate_T_l14_7 ∈ {444} __malloc_allocate_T_l14_8 ∈ {555} __malloc_allocate_T_l14_9 ∈ {2} __malloc_w_allocate_T_l14_10 ∈ {2} or UNINITIALIZED __malloc_allocate_and_free_last_l29 ∈ {0} __malloc_allocate_and_free_last_l29_0 ∈ {1} __malloc_allocate_and_free_last_l29_1 ∈ {2} __malloc_allocate_and_free_last_l29_2 ∈ {3} __malloc_allocate_and_free_last_l29_3 ∈ {4} __malloc_w_allocate_and_free_last_l29_4 ∈ {5; 6; 7; 8; 9} or UNINITIALIZED �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/memchr.res.oracle����������������������������������������0000666�0000000�0000000�00000263336�13571573400�020722� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/memchr.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization tab_str[0] ∈ {{ "" }} [1] ∈ {{ "a" }} [2] ∈ {{ "aa" }} [3] ∈ {{ "aaa" }} [4] ∈ {{ "aaaa" }} [5] ∈ {{ "aaaaa" }} [6] ∈ {{ "aaaaaa" }} [7] ∈ {{ "aaaaaaaaa" }} [8] ∈ {{ "aaaaaaaaaa" }} [9] ∈ {{ "aaaaaaaaaaa" }} [10] ∈ {{ "aaaaaaaaaaaa" }} [11] ∈ {{ "aaaaaaaaaaaaa" }} nondet ∈ [--..--] memchr_misc_static_str ∈ {0} memchr_misc_zero_str ∈ {0} [eva] computing for function memchr_small_sets <- main. Called from tests/builtins/memchr.c:652. [eva] tests/builtins/memchr.c:90: Call to builtin memchr [eva] share/libc/string.h:69: Cannot evaluate range bound memchr_off((char *)s, c, n) (unsupported ACSL construct: logic function memchr_off). Approximating [eva:alarm] tests/builtins/memchr.c:90: Warning: function memchr: precondition 'valid' got status unknown. [eva] share/libc/string.h:72: Cannot evaluate range bound memchr_off((char *)s, c, n) (unsupported ACSL construct: logic function memchr_off). Approximating [eva:alarm] tests/builtins/memchr.c:90: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:90: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] share/libc/string.h:78: cannot evaluate ACSL term, unsupported ACSL construct: logic function memchr [eva] share/libc/string.h:85: cannot evaluate ACSL term, unsupported ACSL construct: logic function memchr [eva] tests/builtins/memchr.c:90: Frama_C_show_each_mymemchr: {3} [eva] tests/builtins/memchr.c:91: assertion got status valid. [eva] tests/builtins/memchr.c:94: Call to builtin memchr [eva] tests/builtins/memchr.c:94: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:94: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:94: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:94: Frama_C_show_each_mymemchr: {0; 3} [eva] tests/builtins/memchr.c:95: assertion got status valid. [eva] tests/builtins/memchr.c:97: Call to builtin memchr [eva] tests/builtins/memchr.c:97: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:97: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:97: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:97: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:98: assertion got status valid. [eva] tests/builtins/memchr.c:101: Call to builtin memchr [eva] tests/builtins/memchr.c:101: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:101: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:101: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:101: Frama_C_show_each_mymemchr: {1; 3} [eva] tests/builtins/memchr.c:102: assertion got status valid. [eva] tests/builtins/memchr.c:106: Call to builtin memchr [eva] tests/builtins/memchr.c:106: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:106: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:106: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:106: Frama_C_show_each_mymemchr: {-1; 0; 1} [eva] tests/builtins/memchr.c:107: assertion got status valid. [eva] Recording results for memchr_small_sets [eva] Done for function memchr_small_sets [eva] computing for function memchr_zero_termination <- main. Called from tests/builtins/memchr.c:653. [eva] tests/builtins/memchr.c:115: Call to builtin memchr [eva] tests/builtins/memchr.c:115: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:115: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:115: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:115: Frama_C_show_each_mymemchr: {-1; 0} [eva] tests/builtins/memchr.c:116: assertion got status valid. [eva] tests/builtins/memchr.c:120: Call to builtin memchr [eva] tests/builtins/memchr.c:120: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:120: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:120: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:120: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:121: assertion got status valid. [eva] tests/builtins/memchr.c:122: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:122: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:122: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:122: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:128: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:128: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:128: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:128: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] Recording results for memchr_zero_termination [eva] Done for function memchr_zero_termination [eva] computing for function memchr_initialization <- main. Called from tests/builtins/memchr.c:654. [eva] tests/builtins/memchr.c:136: Call to builtin memchr [eva] tests/builtins/memchr.c:136: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:136: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:136: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:136: Frama_C_show_each_mymemchr: {0} [eva] tests/builtins/memchr.c:137: assertion got status valid. [eva] tests/builtins/memchr.c:140: Call to builtin memchr [eva] tests/builtins/memchr.c:140: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:140: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:140: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:145: Call to builtin memchr [eva] tests/builtins/memchr.c:145: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:145: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:145: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:145: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:146: assertion got status valid. [eva] tests/builtins/memchr.c:152: Call to builtin memchr [eva] tests/builtins/memchr.c:152: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:152: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:152: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:152: Frama_C_show_each_mymemchr: {3} [eva] tests/builtins/memchr.c:153: assertion got status valid. [eva] Recording results for memchr_initialization [eva] Done for function memchr_initialization [eva] computing for function memchr_large <- main. Called from tests/builtins/memchr.c:655. [eva] computing for function init_array_nondet <- memchr_large <- main. Called from tests/builtins/memchr.c:201. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] tests/builtins/memchr.c:193: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- memchr_large <- main. Called from tests/builtins/memchr.c:204. [eva] using specification for function Frama_C_interval [eva] tests/builtins/memchr.c:204: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:205: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:205: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:205: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:205: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:205: Frama_C_show_each_mymemchr: {20; 75} [eva] tests/builtins/memchr.c:206: assertion got status valid. [eva] tests/builtins/memchr.c:207: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- memchr_large <- main. Called from tests/builtins/memchr.c:209. [eva] tests/builtins/memchr.c:209: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:210: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:210: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:210: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:210: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:210: Frama_C_show_each_mymemchr: {20} [eva] tests/builtins/memchr.c:211: assertion got status valid. [eva] tests/builtins/memchr.c:212: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- memchr_large <- main. Called from tests/builtins/memchr.c:214. [eva] tests/builtins/memchr.c:214: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:215: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:215: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:215: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:215: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:215: Frama_C_show_each_mymemchr: {75} [eva] tests/builtins/memchr.c:216: assertion got status valid. [eva] tests/builtins/memchr.c:217: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- memchr_large <- main. Called from tests/builtins/memchr.c:219. [eva] tests/builtins/memchr.c:219: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:220: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:220: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:220: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:220: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:220: Frama_C_show_each_mymemchr: {75} [eva] tests/builtins/memchr.c:221: assertion got status valid. [eva] tests/builtins/memchr.c:222: assertion 'refined' got status valid. [eva] computing for function init_array_nondet <- memchr_large <- main. Called from tests/builtins/memchr.c:224. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- memchr_large <- main. Called from tests/builtins/memchr.c:225. [eva] tests/builtins/memchr.c:225: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:226: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:226: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:226: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:226: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:226: Frama_C_show_each_mymemchr: [50..99] [eva] tests/builtins/memchr.c:227: assertion got status valid. [eva] tests/builtins/memchr.c:228: assertion 'refined' got status valid. [eva] Recording results for memchr_large [eva] Done for function memchr_large [eva] computing for function memchr_large_uninit <- main. Called from tests/builtins/memchr.c:656. [eva] computing for function init_array_nondet <- memchr_large_uninit <- main. Called from tests/builtins/memchr.c:235. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- memchr_large_uninit <- main. Called from tests/builtins/memchr.c:236. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- memchr_large_uninit <- main. Called from tests/builtins/memchr.c:240. [eva] tests/builtins/memchr.c:240: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:241: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:241: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:241: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:241: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:241: Frama_C_show_each_mymemchr: {20} [eva] tests/builtins/memchr.c:242: assertion got status valid. [eva] tests/builtins/memchr.c:243: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- memchr_large_uninit <- main. Called from tests/builtins/memchr.c:246. [eva] tests/builtins/memchr.c:246: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:247: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:247: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:247: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:247: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:247: Frama_C_show_each_mymemchr: {75} [eva] tests/builtins/memchr.c:248: assertion got status valid. [eva] tests/builtins/memchr.c:249: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- memchr_large_uninit <- main. Called from tests/builtins/memchr.c:251. [eva] tests/builtins/memchr.c:251: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:252: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:252: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:252: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:252: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:252: Frama_C_show_each_mymemchr: {75} [eva] tests/builtins/memchr.c:253: assertion got status valid. [eva] tests/builtins/memchr.c:254: assertion 'refined' got status valid. [eva] Recording results for memchr_large_uninit [eva] Done for function memchr_large_uninit [eva] computing for function memchr_misc_array <- main. Called from tests/builtins/memchr.c:657. [eva] computing for function Frama_C_interval <- memchr_misc_array <- main. Called from tests/builtins/memchr.c:276. [eva] tests/builtins/memchr.c:276: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:277: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:277: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:277: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:277: Warning: function memchr: precondition 'danglingness' got status unknown. [eva:alarm] tests/builtins/memchr.c:277: Warning: pointer subtraction. assert \base_addr(_ss) ≡ \base_addr(tab_str[i]); [eva] tests/builtins/memchr.c:277: Frama_C_show_each_mymemchr: [0..13] [eva] tests/builtins/memchr.c:278: assertion got status valid. [eva] Recording results for memchr_misc_array [eva] Done for function memchr_misc_array [eva] computing for function memchr_misc <- main. Called from tests/builtins/memchr.c:658. [eva] tests/builtins/memchr.c:307: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:307: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:307: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:307: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:310: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:310: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:310: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:310: Warning: function memchr: precondition 'danglingness' got status unknown. [eva:alarm] tests/builtins/memchr.c:310: Warning: pointer subtraction. assert \base_addr(_ss) ≡ \base_addr(str); [eva] tests/builtins/memchr.c:310: Frama_C_show_each_mymemchr: {12; 14} [eva] tests/builtins/memchr.c:311: assertion got status valid. [eva] tests/builtins/memchr.c:313: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:313: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:313: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:313: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:313: Frama_C_show_each_mymemchr2: {0} [eva] tests/builtins/memchr.c:314: assertion got status valid. [eva] tests/builtins/memchr.c:316: Call to builtin memchr [eva] tests/builtins/memchr.c:316: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:316: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:316: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:317: Call to builtin memchr [eva] tests/builtins/memchr.c:317: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:317: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:317: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:317: Frama_C_show_each_mymemchr: {3} [eva] tests/builtins/memchr.c:318: assertion got status valid. [eva] tests/builtins/memchr.c:319: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:319: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:319: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:319: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:319: Frama_C_show_each_mymemchr: {4} [eva] tests/builtins/memchr.c:320: assertion got status valid. [eva] tests/builtins/memchr.c:321: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:321: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:321: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:321: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:321: Frama_C_show_each_mymemchr: {5} [eva] tests/builtins/memchr.c:322: assertion got status valid. [eva] tests/builtins/memchr.c:323: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:323: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:323: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:323: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:323: Frama_C_show_each_mymemchr: {9} [eva] tests/builtins/memchr.c:324: assertion got status valid. [eva] Recording results for memchr_misc [eva] Done for function memchr_misc [eva] computing for function memchr_misc2 <- main. Called from tests/builtins/memchr.c:659. [eva] tests/builtins/memchr.c:332: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:332: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:332: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:332: Warning: function memchr: precondition 'danglingness' got status unknown. [eva:alarm] tests/builtins/memchr.c:332: Warning: pointer subtraction. assert \base_addr(_ss) ≡ \base_addr(s1); [eva] tests/builtins/memchr.c:332: Frama_C_show_each_mymemchr2: {3; 4} [eva] tests/builtins/memchr.c:333: assertion got status valid. [eva] tests/builtins/memchr.c:336: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:336: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:336: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:336: Warning: function memchr: precondition 'danglingness' got status unknown. [eva:alarm] tests/builtins/memchr.c:336: Warning: pointer subtraction. assert \base_addr(_ss_0) ≡ \base_addr(s1); [eva] tests/builtins/memchr.c:336: Frama_C_show_each_mymemchr2: {3; 4} [eva] tests/builtins/memchr.c:337: assertion got status valid. [eva] tests/builtins/memchr.c:341: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:341: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:341: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:341: Warning: function memchr: precondition 'danglingness' got status unknown. [eva:alarm] tests/builtins/memchr.c:341: Warning: pointer subtraction. assert \base_addr(_ss_1) ≡ \base_addr(s1); [eva] tests/builtins/memchr.c:341: Frama_C_show_each_mymemchr: {3; 4} [eva] tests/builtins/memchr.c:342: assertion got status valid. [eva] tests/builtins/memchr.c:340: starting to merge loop iterations [eva] tests/builtins/memchr.c:341: Call to builtin memchr [eva] tests/builtins/memchr.c:341: Frama_C_show_each_mymemchr: {3; 4} [eva] tests/builtins/memchr.c:341: Call to builtin memchr [eva] tests/builtins/memchr.c:341: Frama_C_show_each_mymemchr: {3; 4} [eva] tests/builtins/memchr.c:341: Call to builtin memchr [eva] tests/builtins/memchr.c:341: Frama_C_show_each_mymemchr: {3; 4; 7; 8} [eva] tests/builtins/memchr.c:348: Call to builtin memchr [eva] tests/builtins/memchr.c:348: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:348: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:348: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:348: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:349: assertion got status valid. [eva] Recording results for memchr_misc2 [eva] Done for function memchr_misc2 [eva] computing for function memchr_bitfields <- main. Called from tests/builtins/memchr.c:660. [eva] tests/builtins/memchr.c:170: Call to builtin memchr [eva] tests/builtins/memchr.c:170: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:170: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:170: function memchr: precondition 'danglingness' got status valid. [eva] Recording results for memchr_bitfields [eva] Done for function memchr_bitfields [eva] computing for function memchr_bitfields2 <- main. Called from tests/builtins/memchr.c:661. [eva] tests/builtins/memchr.c:187: Call to builtin memchr [eva] tests/builtins/memchr.c:187: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:187: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:187: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:187: Frama_C_show_each_mymemchr: {2} [eva] tests/builtins/memchr.c:188: assertion got status valid. [eva] Recording results for memchr_bitfields2 [eva] Done for function memchr_bitfields2 [eva] computing for function memchr_escaping <- main. Called from tests/builtins/memchr.c:662. [eva:locals-escaping] tests/builtins/memchr.c:264: Warning: locals {x} escaping the scope of a block of memchr_escaping through s [eva] tests/builtins/memchr.c:267: Call to builtin memchr [eva] tests/builtins/memchr.c:267: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:267: function memchr: precondition 'initialization' got status valid. [eva:alarm] tests/builtins/memchr.c:267: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:267: Frama_C_show_each_mymemchr: {0} [eva] tests/builtins/memchr.c:268: assertion got status valid. [eva] tests/builtins/memchr.c:270: Call to builtin memchr [eva] tests/builtins/memchr.c:270: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:270: function memchr: precondition 'initialization' got status valid. [eva:alarm] tests/builtins/memchr.c:270: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:270: Frama_C_show_each_mymemchr: {0} [eva] tests/builtins/memchr.c:271: assertion got status valid. [eva] Recording results for memchr_escaping [eva] Done for function memchr_escaping [eva] computing for function memchr_big_array <- main. Called from tests/builtins/memchr.c:663. [eva:alarm] tests/builtins/memchr.c:359: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/memchr.c:361: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/memchr.c:363: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/memchr.c:371: Call to builtin memchr [eva] tests/builtins/memchr.c:371: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:371: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:371: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:371: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:372: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:372: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:372: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:372: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:372: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:373: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:373: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:373: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:373: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:373: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:374: Frama_C_show_each: {1}, {1}, {1} [eva] tests/builtins/memchr.c:375: assertion got status valid. [eva] tests/builtins/memchr.c:376: assertion got status valid. [eva] tests/builtins/memchr.c:377: assertion got status valid. [eva] tests/builtins/memchr.c:379: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:379: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:379: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:379: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:379: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:380: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:380: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:380: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:380: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:380: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:381: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:381: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:381: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:381: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:381: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:382: Frama_C_show_each: {1}, {1}, {1} [eva] tests/builtins/memchr.c:383: assertion got status valid. [eva] tests/builtins/memchr.c:384: assertion got status valid. [eva] tests/builtins/memchr.c:385: assertion got status valid. [eva] Recording results for memchr_big_array [eva] Done for function memchr_big_array [eva] computing for function memchr_no_zero_but_ok <- main. Called from tests/builtins/memchr.c:664. [eva] tests/builtins/memchr.c:396: Call to builtin memchr [eva] tests/builtins/memchr.c:396: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:396: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:396: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:396: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:397: assertion got status valid. [eva] tests/builtins/memchr.c:398: Call to builtin memchr [eva] tests/builtins/memchr.c:398: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:398: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:398: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:398: Frama_C_show_each_mymemchr: {10} [eva] tests/builtins/memchr.c:399: assertion got status valid. [eva] tests/builtins/memchr.c:400: Call to builtin memchr [eva] tests/builtins/memchr.c:400: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:400: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:400: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:400: Frama_C_show_each_mymemchr2: {10} [eva] tests/builtins/memchr.c:401: assertion got status valid. [eva] tests/builtins/memchr.c:402: Call to builtin memchr [eva] tests/builtins/memchr.c:402: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:402: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:402: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:402: Frama_C_show_each_mymemchr2: {-1; 10; 14} [eva] tests/builtins/memchr.c:403: assertion got status valid. [eva] tests/builtins/memchr.c:404: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:404: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:404: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:404: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:404: Frama_C_show_each_mymemchr2: {10; 18; 19} [eva] tests/builtins/memchr.c:405: assertion got status valid. [eva] Recording results for memchr_no_zero_but_ok [eva] Done for function memchr_no_zero_but_ok [eva] computing for function memchr_small_sets_n <- main. Called from tests/builtins/memchr.c:665. [eva] tests/builtins/memchr.c:414: Call to builtin memchr [eva] tests/builtins/memchr.c:414: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:414: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:414: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:414: Frama_C_show_each_mymemchr2: {-1; 5} [eva] tests/builtins/memchr.c:415: assertion got status valid. [eva] tests/builtins/memchr.c:419: Call to builtin memchr [eva] tests/builtins/memchr.c:419: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:419: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:419: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:419: Frama_C_show_each_mymemchr2: {-1; 0; 6} [eva] tests/builtins/memchr.c:420: assertion got status valid. [eva] tests/builtins/memchr.c:423: Call to builtin memchr [eva] tests/builtins/memchr.c:423: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:423: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:423: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:423: Frama_C_show_each_mymemchr2: {3} [eva] tests/builtins/memchr.c:424: assertion got status valid. [eva] tests/builtins/memchr.c:427: Call to builtin memchr [eva] tests/builtins/memchr.c:427: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:427: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:427: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:427: Frama_C_show_each_mymemchr2: {-1; 3} [eva] tests/builtins/memchr.c:428: assertion got status valid. [eva] tests/builtins/memchr.c:431: Call to builtin memchr [eva] tests/builtins/memchr.c:431: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:431: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:431: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:431: Frama_C_show_each_mymemchr2: {-1; 3} [eva] tests/builtins/memchr.c:432: assertion got status valid. [eva] tests/builtins/memchr.c:435: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:435: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:435: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:435: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:435: Frama_C_show_each_mymemchr2: {-1; 3; 7} [eva] tests/builtins/memchr.c:436: assertion got status valid. [eva] Recording results for memchr_small_sets_n [eva] Done for function memchr_small_sets_n [eva] computing for function memchr_large_n <- main. Called from tests/builtins/memchr.c:666. [eva] computing for function init_array_nondet <- memchr_large_n <- main. Called from tests/builtins/memchr.c:443. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- memchr_large_n <- main. Called from tests/builtins/memchr.c:448. [eva] tests/builtins/memchr.c:448: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_large_n <- main. Called from tests/builtins/memchr.c:449. [eva] tests/builtins/memchr.c:449: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:450: Call to builtin memchr [eva] tests/builtins/memchr.c:450: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:450: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:450: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:450: Frama_C_show_each_mymemchr: {-1; 15; 28; 40} [eva] tests/builtins/memchr.c:451: assertion got status valid. [eva] tests/builtins/memchr.c:452: assertion 'refined' got status valid. [eva] tests/builtins/memchr.c:456: Call to builtin memchr [eva] tests/builtins/memchr.c:456: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:456: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:456: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:456: Frama_C_show_each_mymemchr: {-1; 15; 29; 40} [eva] tests/builtins/memchr.c:457: assertion got status valid. [eva] tests/builtins/memchr.c:458: assertion 'refined' got status valid. [eva] tests/builtins/memchr.c:461: Call to builtin memchr [eva] tests/builtins/memchr.c:461: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:461: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:461: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:461: Frama_C_show_each_mymemchr: {-1; 15; 29} [eva] tests/builtins/memchr.c:462: assertion got status valid. [eva] tests/builtins/memchr.c:463: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- memchr_large_n <- main. Called from tests/builtins/memchr.c:465. [eva] tests/builtins/memchr.c:465: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:466: Call to builtin memchr [eva] tests/builtins/memchr.c:466: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:466: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:466: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:466: Frama_C_show_each_mymemchr: {-1; 15; 29} [eva] tests/builtins/memchr.c:467: assertion got status valid. [eva] tests/builtins/memchr.c:468: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- memchr_large_n <- main. Called from tests/builtins/memchr.c:470. [eva] tests/builtins/memchr.c:470: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:471: Call to builtin memchr [eva] tests/builtins/memchr.c:471: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:471: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:471: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:471: Frama_C_show_each_mymemchr: {-1; 75} [eva] tests/builtins/memchr.c:472: assertion got status valid. [eva] tests/builtins/memchr.c:473: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- memchr_large_n <- main. Called from tests/builtins/memchr.c:475. [eva] tests/builtins/memchr.c:475: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:476: Call to builtin memchr [eva] tests/builtins/memchr.c:476: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:476: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:476: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:476: Frama_C_show_each_mymemchr: {-1; 75} [eva] tests/builtins/memchr.c:477: assertion got status valid. [eva] tests/builtins/memchr.c:478: assertion 'refined' got status valid. [eva] computing for function init_array_nondet <- memchr_large_n <- main. Called from tests/builtins/memchr.c:480. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- memchr_large_n <- main. Called from tests/builtins/memchr.c:481. [eva] tests/builtins/memchr.c:481: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:482: Call to builtin memchr [eva] tests/builtins/memchr.c:482: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:482: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:482: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:482: Frama_C_show_each_mymemchr: [-1..89] [eva] tests/builtins/memchr.c:483: assertion got status valid. [eva] computing for function Frama_C_interval <- memchr_large_n <- main. Called from tests/builtins/memchr.c:485. [eva] tests/builtins/memchr.c:485: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:486: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:486: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:486: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:486: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:486: Frama_C_show_each_mymemchr: [-1..99] [eva] tests/builtins/memchr.c:487: assertion got status valid. [eva] computing for function Frama_C_interval <- memchr_large_n <- main. Called from tests/builtins/memchr.c:489. [eva] tests/builtins/memchr.c:489: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_large_n <- main. Called from tests/builtins/memchr.c:490. [eva] tests/builtins/memchr.c:490: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:491: Call to builtin memchr [eva] tests/builtins/memchr.c:491: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:491: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:491: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:491: Frama_C_show_each_mymemchr: [-1..99] [eva] tests/builtins/memchr.c:492: assertion got status valid. [eva] Recording results for memchr_large_n [eva] Done for function memchr_large_n [eva] computing for function memchr_unbounded_n <- main. Called from tests/builtins/memchr.c:667. [eva] tests/builtins/memchr.c:501: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:501: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:501: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:501: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:501: Frama_C_show_each_mymemchr: {-1; 3} [eva] tests/builtins/memchr.c:502: assertion got status valid. [eva] tests/builtins/memchr.c:504: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:504: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:504: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:504: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:504: Frama_C_show_each_mymemchr: {-1; 3} [eva] tests/builtins/memchr.c:505: assertion got status valid. [eva] tests/builtins/memchr.c:507: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:507: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:507: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:507: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:507: Frama_C_show_each_mymemchr: {-1; 3} [eva] tests/builtins/memchr.c:508: assertion got status valid. [eva] Recording results for memchr_unbounded_n [eva] Done for function memchr_unbounded_n [eva] computing for function memchr_intervals <- main. Called from tests/builtins/memchr.c:668. [eva] computing for function init_array_nondet <- memchr_intervals <- main. Called from tests/builtins/memchr.c:515. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- memchr_intervals <- main. Called from tests/builtins/memchr.c:516. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- memchr_intervals <- main. Called from tests/builtins/memchr.c:517. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- memchr_intervals <- main. Called from tests/builtins/memchr.c:518. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- memchr_intervals <- main. Called from tests/builtins/memchr.c:519. [eva] tests/builtins/memchr.c:193: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:521. [eva] tests/builtins/memchr.c:521: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:522. [eva] tests/builtins/memchr.c:522: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:523: Call to builtin memchr [eva] tests/builtins/memchr.c:523: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:523: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:523: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:523: Frama_C_show_each_mymemchr: {-1; 0; 1; 2; 7; 8; 9} [eva] tests/builtins/memchr.c:524: assertion got status valid. [eva] tests/builtins/memchr.c:525: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:527. [eva] tests/builtins/memchr.c:527: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:528. [eva] tests/builtins/memchr.c:528: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:529: Call to builtin memchr [eva] tests/builtins/memchr.c:529: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:529: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:529: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:529: Frama_C_show_each_mymemchr: {-1; 7; 8; 9} [eva] tests/builtins/memchr.c:530: assertion got status valid. [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:532. [eva] tests/builtins/memchr.c:532: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:533. [eva] tests/builtins/memchr.c:533: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:534: Call to builtin memchr [eva] tests/builtins/memchr.c:534: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:534: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:534: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:534: Frama_C_show_each_mymemchr: {-1; 7; 8; 9} [eva] tests/builtins/memchr.c:535: assertion got status valid. [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:537. [eva] tests/builtins/memchr.c:537: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:538. [eva] tests/builtins/memchr.c:538: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:539: Call to builtin memchr [eva] tests/builtins/memchr.c:539: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:539: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:539: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:539: Frama_C_show_each_mymemchr: {-1; 7; 8; 9} [eva] tests/builtins/memchr.c:540: assertion got status valid. [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:542. [eva] tests/builtins/memchr.c:542: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:543. [eva] tests/builtins/memchr.c:543: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:544: Call to builtin memchr [eva] tests/builtins/memchr.c:544: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:544: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:544: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:544: Frama_C_show_each_mymemchr: {-1; 7; 8; 9} [eva] tests/builtins/memchr.c:545: assertion got status valid. [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:547. [eva] tests/builtins/memchr.c:547: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:548. [eva] tests/builtins/memchr.c:548: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:549: Call to builtin memchr [eva] tests/builtins/memchr.c:549: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:549: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:549: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:549: Frama_C_show_each_mymemchr: {-1; 7; 8; 9} [eva] tests/builtins/memchr.c:550: assertion got status valid. [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:552. [eva] tests/builtins/memchr.c:552: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:553. [eva] tests/builtins/memchr.c:553: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:554: Call to builtin memchr [eva] tests/builtins/memchr.c:554: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:554: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:554: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:554: Frama_C_show_each_mymemchr: [-1..19] [eva] tests/builtins/memchr.c:555: assertion got status valid. [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:557. [eva] tests/builtins/memchr.c:557: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:558. [eva] tests/builtins/memchr.c:558: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:559: Call to builtin memchr [eva] tests/builtins/memchr.c:559: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:559: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:559: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:559: Frama_C_show_each_mymemchr: [-1..19] [eva] tests/builtins/memchr.c:560: assertion got status valid. [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:562. [eva] tests/builtins/memchr.c:562: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- memchr_intervals <- main. Called from tests/builtins/memchr.c:563. [eva] tests/builtins/memchr.c:563: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memchr.c:564: Call to builtin memchr [eva] tests/builtins/memchr.c:564: function memchr: precondition 'valid' got status valid. [eva:alarm] tests/builtins/memchr.c:564: Warning: function memchr: precondition 'initialization' got status unknown. [eva] tests/builtins/memchr.c:564: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:564: Frama_C_show_each_mymemchr: [-1..19] [eva] tests/builtins/memchr.c:565: assertion got status valid. [eva] Recording results for memchr_intervals [eva] Done for function memchr_intervals [eva] computing for function memchr_small_sets_chars <- main. Called from tests/builtins/memchr.c:669. [eva] tests/builtins/memchr.c:596: Frama_C_show_each_c: {97} [eva] tests/builtins/memchr.c:597: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:597: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:597: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:597: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:597: Frama_C_show_each_mymemchr: {0} [eva] tests/builtins/memchr.c:597: Call to builtin memchr [eva] tests/builtins/memchr.c:597: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:597: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:597: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:597: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:597: Call to builtin memchr [eva] tests/builtins/memchr.c:597: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:597: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:597: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:597: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:597: Call to builtin memchr [eva] tests/builtins/memchr.c:597: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:597: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:597: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:597: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:597: Call to builtin memchr [eva] tests/builtins/memchr.c:597: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:597: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:597: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:597: Frama_C_show_each_mymemchr: {-1; 0; 1} [eva] tests/builtins/memchr.c:598: Frama_C_show_each_res: {0}, {-1}, {-1}, {-1}, {-1; 0; 1} [eva] tests/builtins/memchr.c:599: assertion got status valid. [eva] tests/builtins/memchr.c:600: assertion got status valid. [eva] tests/builtins/memchr.c:601: assertion got status valid. [eva] tests/builtins/memchr.c:602: assertion got status valid. [eva] tests/builtins/memchr.c:603: assertion got status valid. [eva] tests/builtins/memchr.c:606: Frama_C_show_each_c: {98} [eva] tests/builtins/memchr.c:607: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:607: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:607: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:607: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:607: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:607: Call to builtin memchr [eva] tests/builtins/memchr.c:607: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:607: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:607: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:607: Frama_C_show_each_mymemchr: {1} [eva] tests/builtins/memchr.c:607: Call to builtin memchr [eva] tests/builtins/memchr.c:607: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:607: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:607: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:607: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:607: Call to builtin memchr [eva] tests/builtins/memchr.c:607: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:607: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:607: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:607: Frama_C_show_each_mymemchr: {-1; 0} [eva] tests/builtins/memchr.c:607: Call to builtin memchr [eva] tests/builtins/memchr.c:607: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:607: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:607: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:607: Frama_C_show_each_mymemchr: {-1; 0; 1} [eva] tests/builtins/memchr.c:608: Frama_C_show_each_res: {1}, {1}, {-1}, {-1; 0}, {-1; 0; 1} [eva] tests/builtins/memchr.c:609: assertion got status valid. [eva] tests/builtins/memchr.c:610: assertion got status valid. [eva] tests/builtins/memchr.c:611: assertion got status valid. [eva] tests/builtins/memchr.c:612: assertion got status valid. [eva] tests/builtins/memchr.c:613: assertion got status valid. [eva] tests/builtins/memchr.c:616: Frama_C_show_each_c: {97; 98} [eva] tests/builtins/memchr.c:617: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:617: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:617: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:617: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:617: Frama_C_show_each_mymemchr: {0; 1} [eva] tests/builtins/memchr.c:617: Call to builtin memchr [eva] tests/builtins/memchr.c:617: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:617: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:617: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:617: Frama_C_show_each_mymemchr: {-1; 1} [eva] tests/builtins/memchr.c:617: Call to builtin memchr [eva] tests/builtins/memchr.c:617: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:617: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:617: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:617: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:617: Call to builtin memchr [eva] tests/builtins/memchr.c:617: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:617: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:617: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:617: Frama_C_show_each_mymemchr: {-1; 0} [eva] tests/builtins/memchr.c:617: Call to builtin memchr [eva] tests/builtins/memchr.c:617: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:617: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:617: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:617: Frama_C_show_each_mymemchr: {-1; 0; 1} [eva] tests/builtins/memchr.c:618: Frama_C_show_each_res: {0; 1}, {-1; 1}, {-1}, {-1; 0}, {-1; 0; 1} [eva] tests/builtins/memchr.c:619: assertion got status valid. [eva] tests/builtins/memchr.c:620: assertion 'refined' got status valid. [eva] tests/builtins/memchr.c:621: assertion got status valid. [eva] tests/builtins/memchr.c:622: assertion got status valid. [eva] tests/builtins/memchr.c:623: assertion got status valid. [eva] tests/builtins/memchr.c:624: assertion got status valid. [eva] tests/builtins/memchr.c:627: Frama_C_show_each_c: {98; 99} [eva] tests/builtins/memchr.c:628: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:628: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:628: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:628: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:628: Frama_C_show_each_mymemchr: {1; 2} [eva] tests/builtins/memchr.c:628: Call to builtin memchr [eva] tests/builtins/memchr.c:628: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:628: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:628: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:628: Frama_C_show_each_mymemchr: {1; 2} [eva] tests/builtins/memchr.c:628: Call to builtin memchr [eva] tests/builtins/memchr.c:628: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:628: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:628: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:628: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:628: Call to builtin memchr [eva] tests/builtins/memchr.c:628: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:628: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:628: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:628: Frama_C_show_each_mymemchr: {-1; 0; 2} [eva] tests/builtins/memchr.c:628: Call to builtin memchr [eva] tests/builtins/memchr.c:628: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:628: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:628: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:628: Frama_C_show_each_mymemchr: {-1; 0; 1} [eva] tests/builtins/memchr.c:629: Frama_C_show_each_res: {1; 2}, {1; 2}, {-1}, {-1; 0; 2}, {-1; 0; 1} [eva] tests/builtins/memchr.c:630: assertion got status valid. [eva] tests/builtins/memchr.c:631: assertion 'refined' got status valid. [eva] tests/builtins/memchr.c:632: assertion got status valid. [eva] tests/builtins/memchr.c:633: assertion 'refined' got status valid. [eva] tests/builtins/memchr.c:634: assertion got status valid. [eva] tests/builtins/memchr.c:635: assertion got status valid. [eva] tests/builtins/memchr.c:636: assertion got status valid. [eva] tests/builtins/memchr.c:639: Frama_C_show_each_c: {0; 98; 99} [eva] tests/builtins/memchr.c:640: Call to builtin memchr [eva:alarm] tests/builtins/memchr.c:640: Warning: function memchr: precondition 'valid' got status unknown. [eva:alarm] tests/builtins/memchr.c:640: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/memchr.c:640: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] tests/builtins/memchr.c:640: Frama_C_show_each_mymemchr: {1; 2; 3} [eva] tests/builtins/memchr.c:640: Call to builtin memchr [eva] tests/builtins/memchr.c:640: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:640: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:640: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:640: Frama_C_show_each_mymemchr: {0; 1; 2; 3} [eva] tests/builtins/memchr.c:640: Call to builtin memchr [eva] tests/builtins/memchr.c:640: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:640: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:640: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:640: Frama_C_show_each_mymemchr: {-1} [eva] tests/builtins/memchr.c:640: Call to builtin memchr [eva] tests/builtins/memchr.c:640: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:640: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:640: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:640: Frama_C_show_each_mymemchr: {-1; 0; 1; 2; 3} [eva] tests/builtins/memchr.c:640: Call to builtin memchr [eva] tests/builtins/memchr.c:640: function memchr: precondition 'valid' got status valid. [eva] tests/builtins/memchr.c:640: function memchr: precondition 'initialization' got status valid. [eva] tests/builtins/memchr.c:640: function memchr: precondition 'danglingness' got status valid. [eva] tests/builtins/memchr.c:640: Frama_C_show_each_mymemchr: {-1; 0; 1} [eva] tests/builtins/memchr.c:641: Frama_C_show_each_res: {1; 2; 3}, {0; 1; 2; 3}, {-1}, {-1; 0; 1; 2; 3}, {-1; 0; 1} [eva] tests/builtins/memchr.c:642: assertion got status valid. [eva] tests/builtins/memchr.c:643: assertion 'refined' got status valid. [eva] tests/builtins/memchr.c:644: assertion got status valid. [eva] tests/builtins/memchr.c:645: assertion 'refined' got status valid. [eva] tests/builtins/memchr.c:646: assertion got status valid. [eva] tests/builtins/memchr.c:647: assertion got status valid. [eva] tests/builtins/memchr.c:648: assertion got status valid. [eva] Recording results for memchr_small_sets_chars [eva] Done for function memchr_small_sets_chars [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function memchr_big_array: c ∈ {0} u[0..199] ∈ {270729319} or UNINITIALIZED r[0..200] ∈ {270729319} or UNINITIALIZED t[0..999999] ∈ {270729319} or UNINITIALIZED p ∈ {{ &t + [0..3999996],0%4 }} len_u ∈ {1} len_r ∈ {1} len_t ∈ {1} [eva:final-states] Values at end of function memchr_bitfields: c ∈ {0} s.a ∈ {3} .b ∈ {1} .[bits 16 to 31] ∈ UNINITIALIZED .c ∈ {7} .[bits 49 to 63] ∈ UNINITIALIZED p ∈ {{ (char *)&s }} [eva:final-states] Values at end of function memchr_bitfields2: c ∈ {0} s.a ∈ {3} .b ∈ {1} .c ∈ {7} .[bits 25 to 31] ∈ UNINITIALIZED p ∈ {{ (char *)&s }} z1 ∈ {2} [eva:final-states] Values at end of function memchr_escaping: c ∈ {0} s[0] ∈ {0} [1..3] ∈ ESCAPINGADDR z1 ∈ {0} z2 ∈ {0} [eva:final-states] Values at end of function memchr_initialization: c ∈ {0} empty_or_uninitialized[0] ∈ {0} or UNINITIALIZED z1 ∈ {0} s[0] ∈ {1} or UNINITIALIZED [1] ∈ {0} z2 ∈ {1} t[0..1] ∈ {10} [2] ∈ {10} or UNINITIALIZED [3] ∈ {0} z3 ∈ {3} [eva:final-states] Values at end of function memchr_misc: c ∈ {0} loc_str ∈ {{ "Bonjour Monde\n" }} loc_char_array[0..2] ∈ UNINITIALIZED [3] ∈ {0} [4] ∈ UNINITIALIZED x ∈ {-1412567296} str ∈ {{ (char *)&x }} unterminated_string[0] ∈ {117} [1] ∈ {110} [2] ∈ {116} [3] ∈ {101} [4] ∈ {114} [5] ∈ {109} [6] ∈ {105} [7] ∈ {110} [8] ∈ {97} [9] ∈ {116} [10] ∈ {101} [11] ∈ {100} sz1 ∈ {12; 14} sz2 ∈ {0} sz4a ∈ {3} sz4b ∈ {4} sz4c ∈ {5} sz4d ∈ {9} memchr_misc_static_str ∈ {{ "Hello World\n" }} memchr_misc_zero_str ∈ {{ "abc\000\000\000abc" }} [eva:final-states] Values at end of function memchr_misc2: c ∈ {0} s1 ∈ {{ "mno\000pqr" ; "MNOP\000QRS" }} sz5 ∈ {3; 4} sz6 ∈ {3; 4} maybe_init[0] ∈ {65} or UNINITIALIZED [1] ∈ {0} sz8 ∈ {1} [eva:final-states] Values at end of function memchr_misc_array: Frama_C_entropy_source ∈ [--..--] c ∈ {0} i ∈ [0..11] sz3 ∈ [0..13] [eva:final-states] Values at end of function memchr_no_zero_but_ok: c ∈ {0} s[0..9] ∈ {1} [10] ∈ {0} [11..13] ∈ {1} [14..19] ∈ {0; 1} z1 ∈ {-1} z2 ∈ {10} z3 ∈ {10} z4 ∈ {-1; 10; 14} z5 ∈ {10; 18; 19} [eva:final-states] Values at end of function memchr_small_sets: c ∈ {0} s ∈ {{ "b\000c" }} o ∈ {0; 2} z1 ∈ {3} z2 ∈ {0; 3} z3 ∈ {-1} z4 ∈ {1; 3} t[0..1] ∈ {0; 1} [2..3] ∈ {1} z5 ∈ {-1; 0; 1} [eva:final-states] Values at end of function memchr_small_sets_chars: c ∈ {0; 98; 99} res[0] ∈ {1; 2; 3} [1] ∈ {0; 1; 2; 3} [2] ∈ {-1} [3] ∈ {-1; 0; 1; 2; 3} [4] ∈ {-1; 0; 1} t_0[0..1] ∈ {1; 97} [2..3] ∈ {1} t_1[0..1] ∈ {1; 98} [2..3] ∈ {1} t_2[0..1] ∈ {1; 97; 98} [2..3] ∈ {1} t_3[0..1] ∈ {1; 98; 99} [2..3] ∈ {1} t_4[0..1] ∈ {0; 1; 98; 99} [2..3] ∈ {1} [eva:final-states] Values at end of function memchr_small_sets_n: c ∈ {0} s ∈ {{ "bcd\000efg" }} n ∈ {2; 7} z1 ∈ {-1; 5} z2 ∈ {-1; 0; 6} z3a ∈ {3} z3b ∈ {-1; 3} z3 ∈ {-1; 3} z4 ∈ {-1; 3; 7} [eva:final-states] Values at end of function memchr_unbounded_n: c ∈ {0} n ∈ [0..2147483647] s ∈ {{ "bcd\000eg" }} zu1 ∈ {-1; 3} o ∈ {0; 1} zu2 ∈ {-1; 3} zu3 ∈ {-1; 3} [eva:final-states] Values at end of function memchr_zero_termination: c ∈ {0} empty_or_non_terminated[0] ∈ {0; 100} z1 ∈ {-1; 0} non_terminated[0] ∈ {88} z2 ∈ {-1} non_terminated2[0] ∈ {76} [1] ∈ {0} [2] ∈ {28} [3] ∈ {14} o ∈ {2; 3} [eva:final-states] Values at end of function init_array_nondet: from ∈ {-1} to ∈ {-1} val1 ∈ {-1} val2 ∈ {-1} val ∈ {0; 1; 2; 3; 4} a[0..99] ∈ {0; 1; 2} a[0..39] ∈ {1; 2} [40..49] ∈ UNINITIALIZED [50..94] ∈ {3; 4} or UNINITIALIZED [95..99] ∈ UNINITIALIZED a[0..99] ∈ {0; 1; 2} a[0..9] ∈ {0; 1} [10] ∈ UNINITIALIZED [11] ∈ {0; 1} or UNINITIALIZED [12..15] ∈ {1} or UNINITIALIZED [16..19] ∈ {0; 1} or UNINITIALIZED [20..99] ∈ UNINITIALIZED [eva:final-states] Values at end of function memchr_intervals: Frama_C_entropy_source ∈ [--..--] c ∈ {0} a[0..2] ∈ {0; 1} [3..6] ∈ {1} [7..9] ∈ {0; 1} [10] ∈ UNINITIALIZED [11] ∈ {0; 1} [12..15] ∈ {1} [16..19] ∈ {0; 1} [20..99] ∈ UNINITIALIZED offset ∈ [3..11] n ∈ [0..11] z1 ∈ {-1; 0; 1; 2; 7; 8; 9} z2 ∈ {-1; 7; 8; 9} z3 ∈ {-1; 7; 8; 9} z4 ∈ {-1; 7; 8; 9} z5 ∈ {-1; 7; 8; 9} z6 ∈ {-1; 7; 8; 9} z7 ∈ [-1..19] z8 ∈ [-1..19] z9 ∈ [-1..19] [eva:final-states] Values at end of function memchr_large: Frama_C_entropy_source ∈ [--..--] c ∈ {0} a[0..99] ∈ {0; 2} offset ∈ [50..70] z1 ∈ {20; 75} z2 ∈ {20} z3 ∈ {75} z4 ∈ {75} z5 ∈ [50..99] [eva:final-states] Values at end of function memchr_large_n: Frama_C_entropy_source ∈ [--..--] c ∈ {0} a[0..99] ∈ {0; 2} offset ∈ [0..10] n ∈ [0..90] z1 ∈ {-1; 15; 28; 40} z2 ∈ {-1; 15; 29; 40} z3 ∈ {-1; 15; 29} z4 ∈ {-1; 15; 29} z5 ∈ {-1; 75} z6 ∈ {-1; 75} z7 ∈ [-1..89] z8 ∈ [-1..99] z9 ∈ [-1..99] [eva:final-states] Values at end of function memchr_large_uninit: Frama_C_entropy_source ∈ [--..--] c ∈ {0} a[0..19] ∈ {1; 2} [20] ∈ {0} [21..39] ∈ {1; 2} [40..49] ∈ UNINITIALIZED [50..74] ∈ {3; 4} [75] ∈ {0} [76..94] ∈ {3; 4} [95..97] ∈ UNINITIALIZED [98] ∈ {0} [99] ∈ UNINITIALIZED offset ∈ {0} z1 ∈ {20} z2 ∈ {75} z3 ∈ {75} [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] memchr_misc_static_str ∈ {{ "Hello World\n" }} memchr_misc_zero_str ∈ {{ "abc\000\000\000abc" }} __retres ∈ {0} [from] Computing for function memchr_big_array [from] Computing for function memchr <-memchr_big_array [from] Done for function memchr [from] Done for function memchr_big_array [from] Computing for function memchr_bitfields [from] Done for function memchr_bitfields [from] Computing for function memchr_bitfields2 [from] Done for function memchr_bitfields2 [from] Computing for function memchr_escaping [from] Done for function memchr_escaping [from] Computing for function memchr_initialization [from] Done for function memchr_initialization [from] Computing for function memchr_misc [from] Done for function memchr_misc [from] Computing for function memchr_misc2 [from] Done for function memchr_misc2 [from] Computing for function memchr_misc_array [from] Computing for function Frama_C_interval <-memchr_misc_array [from] Done for function Frama_C_interval [from] Done for function memchr_misc_array [from] Computing for function memchr_no_zero_but_ok [from] Done for function memchr_no_zero_but_ok [from] Computing for function memchr_small_sets [from] Done for function memchr_small_sets [from] Computing for function memchr_small_sets_chars [from] Done for function memchr_small_sets_chars [from] Computing for function memchr_small_sets_n [from] Done for function memchr_small_sets_n [from] Computing for function memchr_unbounded_n [from] Done for function memchr_unbounded_n [from] Computing for function memchr_zero_termination [from] Done for function memchr_zero_termination [from] Computing for function init_array_nondet [from] Computing for function memset <-init_array_nondet [from] Done for function memset [from] Done for function init_array_nondet [from] Computing for function memchr_intervals [from] Done for function memchr_intervals [from] Computing for function memchr_large [from] Done for function memchr_large [from] Computing for function memchr_large_n [from] Done for function memchr_large_n [from] Computing for function memchr_large_uninit [from] Done for function memchr_large_uninit [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function memchr: \result FROM s; c; t[0..3]; empty_or_non_terminated[0]; non_terminated[0]; non_terminated2[2..3]; empty_or_uninitialized[0]; uninitialized[0]; s[0..1]; t[0..3]; s; s; a[3..99]; a[3..99]; s[0..3]; loc_char_array[0..4]; x; unterminated_string[0..11]; maybe_init[0..1]; u[0..199]; r[0..200]; t[0..999999]; s[0..19]; a[0..99]; a[0..99]; t_0[0..3]; t_1[0..3]; t_2[0..3]; t_3[0..3]; t_4[0..3]; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111]; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; "Bonjour Monde\n"[bits 0 to 119]; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71]; "abcde"[bits 0 to 47]; "\000bcdef"[bits 0 to 55]; "bcd\000efg"[bits 0 to 63]; "abc"; "bcd\000eg"[bits 0 to 55]; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c" [from] Function memchr_big_array: NO EFFECTS [from] Function memchr_bitfields: NO EFFECTS [from] Function memchr_bitfields2: NO EFFECTS [from] Function memchr_escaping: NO EFFECTS [from] Function memchr_initialization: NO EFFECTS [from] Function memchr_misc: memchr_misc_static_str FROM \nothing memchr_misc_zero_str FROM \nothing [from] Function memchr_misc2: NO EFFECTS [from] Function memchr_misc_array: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function memchr_no_zero_but_ok: NO EFFECTS [from] Function memchr_small_sets: NO EFFECTS [from] Function memchr_small_sets_chars: NO EFFECTS [from] Function memchr_small_sets_n: NO EFFECTS [from] Function memchr_unbounded_n: NO EFFECTS [from] Function memchr_zero_termination: NO EFFECTS [from] Function memset: a[0..99] FROM c (and SELF) a[0..99] FROM c (and SELF) a[0..99] FROM c (and SELF) a[0..99] FROM c (and SELF) \result FROM s [from] Function init_array_nondet: a[0..99] FROM val1; val2; nondet (and SELF) a[0..99] FROM val1; val2; nondet (and SELF) a[0..99] FROM val1; val2; nondet (and SELF) a[0..99] FROM val1; val2; nondet (and SELF) [from] Function memchr_intervals: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function memchr_large: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function memchr_large_n: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function memchr_large_uninit: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) memchr_misc_static_str FROM \nothing memchr_misc_zero_str FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function memchr_big_array: c; u[0..199]; r[0..200]; t[0..999999]; p; len_u; len_r; len_t; _s; _ss; _res; _s_0; _ss_0; _res_0; _s_1; _ss_1; _res_1; _s_2; _ss_2; _res_2; _s_3; _ss_3; _res_3; _s_4; _ss_4; _res_4 [inout] Inputs for function memchr_big_array: nondet [inout] Out (internal) for function memchr_bitfields: c; s{{.a; .b}; .c}; p [inout] Inputs for function memchr_bitfields: nondet [inout] Out (internal) for function memchr_bitfields2: c; s{.a; .b; .c}; p; z1; _s; _ss; _res [inout] Inputs for function memchr_bitfields2: \nothing [inout] Out (internal) for function memchr_escaping: c; s[0..3]; z1; _s; _ss; _res; z2; _s_0; _ss_0; _res_0 [inout] Inputs for function memchr_escaping: nondet [inout] Out (internal) for function memchr_initialization: c; empty_or_uninitialized[0]; z1; _s; _ss; _res; s[0..1]; z2; _s_0; _ss_0; _res_0; t[0..3]; z3; _s_1; _ss_1; _res_1 [inout] Inputs for function memchr_initialization: nondet [inout] Out (internal) for function memchr_misc: c; loc_str; loc_char_array[3]; x; str; unterminated_string[0..11]; sz1; _s; _ss; _res; sz2; _p; tmp_0; _ss_0; _res_0; sz4a; _s_0; _ss_1; _res_1; sz4b; _s_1; _ss_2; _res_2; sz4c; _s_2; _ss_3; _res_3; sz4d; _s_3; _ss_4; _res_4; memchr_misc_static_str; memchr_misc_zero_str [inout] Inputs for function memchr_misc: nondet; memchr_misc_static_str; memchr_misc_zero_str; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; "Bonjour Monde\n"[bits 0 to 119] [inout] Out (internal) for function memchr_misc2: c; s1; sz5; _p; tmp; _ss; _res; sz6; _p_0; tmp_1; _ss_0; _res_0; j; sz7; _s; _ss_1; _res_1; maybe_init[0..1]; sz8; _s_0; _ss_2; _res_2 [inout] Inputs for function memchr_misc2: nondet; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71] [inout] Out (internal) for function memchr_misc_array: Frama_C_entropy_source; c; i; sz3; _s; _ss; _res [inout] Inputs for function memchr_misc_array: Frama_C_entropy_source; tab_str[0..11]; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111] [inout] Out (internal) for function memchr_no_zero_but_ok: c; s[0..19]; z1; _s; _ss; _res; z2; _s_0; _ss_0; _res_0; z3; _p; tmp_1; _ss_1; _res_1; z4; _p_0; tmp_3; _ss_2; _res_2; z5; _p_1; tmp_5; _ss_3; _res_3 [inout] Inputs for function memchr_no_zero_but_ok: nondet [inout] Out (internal) for function memchr_small_sets: c; s; o; tmp; z1; _s; _ss; _res; z2; _s_0; _ss_0; _res_0; z3; _s_1; _ss_1; _res_1; z4; _s_2; _ss_2; _res_2; t[0..3]; z5; _s_3; _ss_3; _res_3 [inout] Inputs for function memchr_small_sets: nondet; "abc"; "\000bc"; "b\000c" [inout] Out (internal) for function memchr_small_sets_chars: c; res[0..4]; t_0[0..3]; s; o; tmp; _s; _ss; _res; _s_0; _ss_0; _res_0; _s_1; _ss_1; _res_1; _s_2; _ss_2; _res_2; _s_3; _ss_3; _res_3; t_1[0..3]; s_0; o_0; tmp_5; _s_4; _ss_4; _res_4; _s_5; _ss_5; _res_5; _s_6; _ss_6; _res_6; _s_7; _ss_7; _res_7; _s_8; _ss_8; _res_8; t_2[0..3]; s_1; o_1; tmp_11; _s_9; _ss_9; _res_9; _s_10; _ss_10; _res_10; _s_11; _ss_11; _res_11; _s_12; _ss_12; _res_12; _s_13; _ss_13; _res_13; t_3[0..3]; s_2; o_2; tmp_17; _s_14; _ss_14; _res_14; _s_15; _ss_15; _res_15; _s_16; _ss_16; _res_16; _s_17; _ss_17; _res_17; _s_18; _ss_18; _res_18; t_4[0..3]; s_3; o_3; tmp_23; _s_19; _ss_19; _res_19; _s_20; _ss_20; _res_20; _s_21; _ss_21; _res_21; _s_22; _ss_22; _res_22; _s_23; _ss_23; _res_23 [inout] Inputs for function memchr_small_sets_chars: nondet; "abc"; "\000bc"; "b\000c"; "abc"; "\000bc"; "b\000c"; "abc"; "\000bc"; "b\000c"; "abc"; "\000bc"; "b\000c"; "abc"; "\000bc"; "b\000c" [inout] Out (internal) for function memchr_small_sets_n: c; s; n; tmp; z1; _p; tmp_0; _ss; _res; z2; _p_0; tmp_2; _ss_0; _res_0; z3a; _p_1; tmp_4; _ss_1; _res_1; z3b; _p_2; tmp_6; _ss_2; _res_2; z3; _p_3; tmp_8; _ss_3; _res_3; z4; _p_4; tmp_10; _ss_4; _res_4 [inout] Inputs for function memchr_small_sets_n: nondet; "abcde"[bits 0 to 47]; "\000bcdef"[bits 0 to 55]; "bcd\000efg"[bits 0 to 63] [inout] Out (internal) for function memchr_unbounded_n: c; n; s; zu1; _s; _ss; _res; o; tmp_0; zu2; _s_0; _ss_0; _res_0; zu3; _s_1; _ss_1; _res_1 [inout] Inputs for function memchr_unbounded_n: nondet; "abc"; "bcd\000eg"[bits 0 to 55] [inout] Out (internal) for function memchr_zero_termination: c; empty_or_non_terminated[0]; z1; _s; _ss; _res; non_terminated[0]; z2; _s_0; _ss_0; _res_0; non_terminated2[0..3]; o; tmp_1 [inout] Inputs for function memchr_zero_termination: nondet [inout] Out (internal) for function init_array_nondet: from; to; val1; val2; val; tmp; a[0..99]; a{[0..39]; [50..94]}; a[0..99]; a{[0..9]; [11..19]} [inout] Inputs for function init_array_nondet: nondet [inout] Out (internal) for function memchr_intervals: Frama_C_entropy_source; c; a{[0..9]; [11..19]}; offset; n; z1; _s; _ss; _res; z2; _s_0; _ss_0; _res_0; z3; _s_1; _ss_1; _res_1; z4; _s_2; _ss_2; _res_2; z5; _s_3; _ss_3; _res_3; z6; _s_4; _ss_4; _res_4; z7; _s_5; _ss_5; _res_5; z8; _s_6; _ss_6; _res_6; z9; _s_7; _ss_7; _res_7 [inout] Inputs for function memchr_intervals: Frama_C_entropy_source; nondet [inout] Out (internal) for function memchr_large: Frama_C_entropy_source; c; a[0..99]; offset; z1; _s; _ss; _res; z2; _s_0; _ss_0; _res_0; z3; _s_1; _ss_1; _res_1; z4; _s_2; _ss_2; _res_2; z5; _s_3; _ss_3; _res_3 [inout] Inputs for function memchr_large: Frama_C_entropy_source; nondet [inout] Out (internal) for function memchr_large_n: Frama_C_entropy_source; c; a[0..99]; offset; n; z1; _s; _ss; _res; z2; _s_0; _ss_0; _res_0; z3; _s_1; _ss_1; _res_1; z4; _s_2; _ss_2; _res_2; z5; _s_3; _ss_3; _res_3; z6; _s_4; _ss_4; _res_4; z7; _s_5; _ss_5; _res_5; z8; _s_6; _ss_6; _res_6; z9; _s_7; _ss_7; _res_7 [inout] Inputs for function memchr_large_n: Frama_C_entropy_source; nondet [inout] Out (internal) for function memchr_large_uninit: Frama_C_entropy_source; c; a{[0..39]; [50..94]; [98]}; offset; z1; _s; _ss; _res; z2; _s_0; _ss_0; _res_0; z3; _s_1; _ss_1; _res_1 [inout] Inputs for function memchr_large_uninit: Frama_C_entropy_source; nondet [inout] Out (internal) for function main: Frama_C_entropy_source; memchr_misc_static_str; memchr_misc_zero_str; __retres [inout] Inputs for function main: Frama_C_entropy_source; tab_str[0..11]; nondet; memchr_misc_static_str; memchr_misc_zero_str; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111]; "abc"; "\000bc"; "b\000c"; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; "Bonjour Monde\n"[bits 0 to 119]; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71]; "abcde"[bits 0 to 47]; "\000bcdef"[bits 0 to 55]; "bcd\000efg"[bits 0 to 63]; "abc"; "bcd\000eg"[bits 0 to 55]; "abc"; "\000bc"; "b\000c"; "abc"; "\000bc"; "b\000c"; "abc"; "\000bc"; "b\000c"; "abc"; "\000bc"; "b\000c"; "abc"; "\000bc"; "b\000c" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/memcpy.res.oracle����������������������������������������0000666�0000000�0000000�00000271645�13571573400�020743� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/memcpy.c (with preprocessing) [eva] Analyzing a complete application starting at main_all [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 800000 to 800015] ∈ [--..--] i ∈ [--..--] src[0..19] ∈ {0} dst1[0..19] ∈ {0} dst2[0..19] ∈ {0} dst3[0..19] ∈ {0} dst4[0..19] ∈ {0} dst5[0..99] ∈ {0} maybe ∈ [--..--] tm[0..999] ∈ {0} um[0..999] ∈ {0} ttyp[0..999] ∈ {0} v1 ∈ {0} v2 ∈ {0} v3 ∈ {0} v4 ∈ {0} v5 ∈ {0} t[0..3] ∈ {0} [eva] computing for function main <- main_all. Called from tests/builtins/memcpy.c:226. [eva] computing for function buggy <- main <- main_all. Called from tests/builtins/memcpy.c:61. [eva] tests/builtins/memcpy.c:28: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:28: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva] tests/builtins/memcpy.c:28: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:28: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] Recording results for buggy [from] Computing for function buggy [from] Done for function buggy [eva] Done for function buggy [eva] computing for function many <- main <- main_all. Called from tests/builtins/memcpy.c:63. [eva:alarm] tests/builtins/memcpy.c:44: Warning: assertion got status unknown. [eva] tests/builtins/memcpy.c:47: Call to builtin memcpy [eva] tests/builtins/memcpy.c:47: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:47: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:47: function memcpy: precondition 'separation' got status valid. [kernel] tests/builtins/memcpy.c:47: too many locations to update in array. Approximating. [eva] tests/builtins/memcpy.c:49: Call to builtin memcpy [eva] tests/builtins/memcpy.c:49: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:49: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:49: function memcpy: precondition 'separation' got status valid. [kernel] tests/builtins/memcpy.c:49: too many locations to update in array. Approximating. [kernel] tests/builtins/memcpy.c:49: more than 150(1000) locations to update in array. Approximating. [kernel] tests/builtins/memcpy.c:49: more than 150(1000) elements to enumerate. Approximating. [eva] tests/builtins/memcpy.c:53: Call to builtin memcpy [eva] tests/builtins/memcpy.c:53: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:53: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:53: function memcpy: precondition 'separation' got status valid. [kernel] tests/builtins/memcpy.c:53: too many locations to update in array. Approximating. [eva] Recording results for many [from] Computing for function many [from] Done for function many [eva] Done for function many [eva] computing for function init <- main <- main_all. Called from tests/builtins/memcpy.c:65. [eva] tests/builtins/memcpy.c:20: Trace partitioning superposing up to 100 states [eva] Recording results for init [from] Computing for function init [from] Done for function init [eva] Done for function init [eva:alarm] tests/builtins/memcpy.c:67: Warning: assertion got status unknown. [eva] tests/builtins/memcpy.c:68: Call to builtin memcpy [eva] tests/builtins/memcpy.c:68: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:68: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:68: function memcpy: precondition 'separation' got status valid. [eva] tests/builtins/memcpy.c:70: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:70: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva:alarm] tests/builtins/memcpy.c:70: Warning: function memcpy: precondition 'valid_src' got status unknown. [eva] tests/builtins/memcpy.c:70: function memcpy: precondition 'separation' got status valid. [eva:alarm] tests/builtins/memcpy.c:72: Warning: assertion got status unknown. [eva] tests/builtins/memcpy.c:73: Call to builtin memcpy [eva] tests/builtins/memcpy.c:73: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:73: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:73: function memcpy: precondition 'separation' got status valid. [eva] tests/builtins/memcpy.c:75: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:75: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva:alarm] tests/builtins/memcpy.c:75: Warning: function memcpy: precondition 'valid_src' got status unknown. [eva] tests/builtins/memcpy.c:75: function memcpy: precondition 'separation' got status valid. [eva] tests/builtins/memcpy.c:83: Call to builtin memcpy [eva] tests/builtins/memcpy.c:83: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:83: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:83: function memcpy: precondition 'separation' got status valid. [eva] tests/builtins/memcpy.c:85: Call to builtin memcpy [eva] tests/builtins/memcpy.c:85: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:85: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:85: function memcpy: precondition 'separation' got status valid. [eva] tests/builtins/memcpy.c:87: Call to builtin memcpy [eva] tests/builtins/memcpy.c:87: function memcpy: precondition 'valid_dest' got status valid. [eva:alarm] tests/builtins/memcpy.c:87: Warning: function memcpy: precondition 'valid_src' got status unknown. [eva] tests/builtins/memcpy.c:87: function memcpy: precondition 'separation' got status valid. [eva] tests/builtins/memcpy.c:89: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:89: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva] tests/builtins/memcpy.c:89: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:89: function memcpy: precondition 'separation' got status valid. [kernel] tests/builtins/memcpy.c:89: writing somewhere in {NULL; v4} because of Arithmetic {tests/builtins/memcpy.c:89}. [eva] tests/builtins/memcpy.c:91: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:91: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva] tests/builtins/memcpy.c:91: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:91: function memcpy: precondition 'separation' got status valid. [kernel] tests/builtins/memcpy.c:91: writing somewhere in {NULL; v5} because of Arithmetic {tests/builtins/memcpy.c:91}. [eva] tests/builtins/memcpy.c:96: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:96: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva:alarm] tests/builtins/memcpy.c:96: Warning: function memcpy: precondition 'valid_src' got status unknown. [eva:alarm] tests/builtins/memcpy.c:96: Warning: function memcpy: precondition 'separation' got status unknown. [eva:imprecision] tests/builtins/memcpy.c:96: In memcpy builtin: too many sizes to enumerate, possible loss of precision [eva] tests/builtins/memcpy.c:95: starting to merge loop iterations [eva] tests/builtins/memcpy.c:96: Call to builtin memcpy [eva] tests/builtins/memcpy.c:101: Call to builtin memcpy [eva] tests/builtins/memcpy.c:101: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:101: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:101: function memcpy: precondition 'separation' got status valid. [eva:alarm] tests/builtins/memcpy.c:103: Warning: assertion got status unknown. [eva] tests/builtins/memcpy.c:105: Call to builtin memcpy [eva] tests/builtins/memcpy.c:105: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:105: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:105: function memcpy: precondition 'separation' got status valid. [eva:imprecision] tests/builtins/memcpy.c:105: In memcpy builtin: too many sizes to enumerate, possible loss of precision [eva] tests/builtins/memcpy.c:110: starting to merge loop iterations [eva] tests/builtins/memcpy.c:114: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:114: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva] tests/builtins/memcpy.c:114: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:114: function memcpy: precondition 'separation' got status valid. [kernel] tests/builtins/memcpy.c:114: too many locations to update in array. Approximating. [eva] tests/builtins/memcpy.c:118: starting to merge loop iterations [eva] tests/builtins/memcpy.c:122: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:122: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva] tests/builtins/memcpy.c:122: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:122: function memcpy: precondition 'separation' got status valid. [kernel] tests/builtins/memcpy.c:122: too many locations to update in array. Approximating. [eva] tests/builtins/memcpy.c:126: starting to merge loop iterations [eva] tests/builtins/memcpy.c:131: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:131: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva] tests/builtins/memcpy.c:131: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:131: function memcpy: precondition 'separation' got status valid. [kernel] tests/builtins/memcpy.c:131: too many locations to update in array. Approximating. [eva] tests/builtins/memcpy.c:135: starting to merge loop iterations [eva] tests/builtins/memcpy.c:140: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:140: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva] tests/builtins/memcpy.c:140: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:140: function memcpy: precondition 'separation' got status valid. [kernel] tests/builtins/memcpy.c:140: too many locations to update in array. Approximating. [eva] tests/builtins/memcpy.c:145: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:145: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva:alarm] tests/builtins/memcpy.c:145: Warning: function memcpy: precondition 'valid_src' got status unknown. [eva] tests/builtins/memcpy.c:145: function memcpy: precondition 'separation' got status valid. [eva:imprecision] tests/builtins/memcpy.c:145: In memcpy builtin: too many sizes to enumerate, possible loss of precision [eva:alarm] tests/builtins/memcpy.c:150: Warning: assertion got status unknown. [eva] tests/builtins/memcpy.c:151: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:151: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva:alarm] tests/builtins/memcpy.c:151: Warning: function memcpy: precondition 'valid_src' got status unknown. [eva] tests/builtins/memcpy.c:151: function memcpy: precondition 'separation' got status valid. [eva:imprecision] tests/builtins/memcpy.c:151: In memcpy builtin: too many sizes to enumerate, possible loss of precision [eva:alarm] tests/builtins/memcpy.c:152: Warning: assertion got status unknown. [eva] tests/builtins/memcpy.c:153: Call to builtin memcpy [eva] tests/builtins/memcpy.c:153: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:153: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:153: function memcpy: precondition 'separation' got status valid. [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] Done for function main [eva] computing for function main_uninit <- main_all. Called from tests/builtins/memcpy.c:227. [eva] tests/builtins/memcpy.c:172: Call to builtin memcpy [eva] tests/builtins/memcpy.c:172: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:172: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:172: function memcpy: precondition 'separation' got status valid. [eva:imprecision] tests/builtins/memcpy.c:172: In memcpy builtin: precise copy of indeterminate values UNINITIALIZED [eva] tests/builtins/memcpy.c:173: assertion got status valid. [eva] computing for function itv <- main_uninit <- main_all. Called from tests/builtins/memcpy.c:174. [eva] using specification for function itv [eva] Done for function itv [eva] tests/builtins/memcpy.c:174: Call to builtin memcpy [eva] tests/builtins/memcpy.c:174: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:174: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:174: function memcpy: precondition 'separation' got status valid. [eva:imprecision] tests/builtins/memcpy.c:174: In memcpy builtin: too many sizes to enumerate, possible loss of precision [eva:imprecision] tests/builtins/memcpy.c:174: In memcpy builtin: imprecise copy of indeterminate values [eva] tests/builtins/memcpy.c:175: assertion got status valid. [eva] computing for function make_unknown <- main_uninit <- main_all. Called from tests/builtins/memcpy.c:178. [eva] using specification for function make_unknown [eva] tests/builtins/memcpy.c:178: function make_unknown: precondition got status valid. [eva] Done for function make_unknown [eva] tests/builtins/memcpy.c:179: Call to builtin memcpy [eva] tests/builtins/memcpy.c:179: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:179: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:179: function memcpy: precondition 'separation' got status valid. [eva] tests/builtins/memcpy.c:180: assertion got status valid. [eva] computing for function itv <- main_uninit <- main_all. Called from tests/builtins/memcpy.c:181. [eva] Done for function itv [eva] tests/builtins/memcpy.c:181: Call to builtin memcpy [eva] tests/builtins/memcpy.c:181: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:181: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:181: function memcpy: precondition 'separation' got status valid. [eva:imprecision] tests/builtins/memcpy.c:181: In memcpy builtin: too many sizes to enumerate, possible loss of precision [eva:imprecision] tests/builtins/memcpy.c:181: In memcpy builtin: imprecise copy of indeterminate values [eva:alarm] tests/builtins/memcpy.c:182: Warning: accessing uninitialized left-value. assert \initialized(&b[11]); [eva] computing for function make_unknown <- main_uninit <- main_all. Called from tests/builtins/memcpy.c:185. [eva] tests/builtins/memcpy.c:185: function make_unknown: precondition got status valid. [eva] Done for function make_unknown [eva] tests/builtins/memcpy.c:187: Call to builtin memcpy [eva] tests/builtins/memcpy.c:187: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:187: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:187: function memcpy: precondition 'separation' got status valid. [eva:imprecision] tests/builtins/memcpy.c:187: In memcpy builtin: precise copy of indeterminate values UNINITIALIZED [eva] tests/builtins/memcpy.c:188: assertion got status valid. [eva] computing for function itv <- main_uninit <- main_all. Called from tests/builtins/memcpy.c:190. [eva] Done for function itv [eva] tests/builtins/memcpy.c:190: Call to builtin memcpy [eva] tests/builtins/memcpy.c:190: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:190: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:190: function memcpy: precondition 'separation' got status valid. [eva:imprecision] tests/builtins/memcpy.c:190: In memcpy builtin: too many sizes to enumerate, possible loss of precision [eva:imprecision] tests/builtins/memcpy.c:190: In memcpy builtin: imprecise copy of indeterminate values [eva] tests/builtins/memcpy.c:191: assertion got status valid. [eva:alarm] tests/builtins/memcpy.c:192: Warning: accessing uninitialized left-value. assert \initialized(&b[8]); [eva] computing for function make_unknown <- main_uninit <- main_all. Called from tests/builtins/memcpy.c:196. [eva] tests/builtins/memcpy.c:196: function make_unknown: precondition got status valid. [eva] Done for function make_unknown [eva] computing for function make_unknown <- main_uninit <- main_all. Called from tests/builtins/memcpy.c:197. [eva] tests/builtins/memcpy.c:197: function make_unknown: precondition got status valid. [eva] Done for function make_unknown [eva] tests/builtins/memcpy.c:198: Call to builtin memcpy [eva] tests/builtins/memcpy.c:198: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:198: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:198: function memcpy: precondition 'separation' got status valid. [eva] tests/builtins/memcpy.c:199: assertion got status valid. [eva] computing for function itv <- main_uninit <- main_all. Called from tests/builtins/memcpy.c:200. [eva] Done for function itv [eva] tests/builtins/memcpy.c:200: Call to builtin memcpy [eva] tests/builtins/memcpy.c:200: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:200: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:200: function memcpy: precondition 'separation' got status valid. [eva:imprecision] tests/builtins/memcpy.c:200: In memcpy builtin: too many sizes to enumerate, possible loss of precision [eva:imprecision] tests/builtins/memcpy.c:200: In memcpy builtin: imprecise copy of indeterminate values [eva:alarm] tests/builtins/memcpy.c:201: Warning: accessing uninitialized left-value. assert \initialized(&b[11]); [eva] Recording results for main_uninit [from] Computing for function main_uninit [from] Done for function main_uninit [eva] Done for function main_uninit [eva] computing for function main_local <- main_all. Called from tests/builtins/memcpy.c:228. [eva] tests/builtins/memcpy.c:209: Call to builtin memcpy [eva] tests/builtins/memcpy.c:209: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy.c:209: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:209: function memcpy: precondition 'separation' got status valid. [eva:locals-escaping] tests/builtins/memcpy.c:210: Warning: locals {y} escaping the scope of a block of main_local through p [eva] tests/builtins/memcpy.c:212: Frama_C_dump_each: # Cvalue domain: NULL[rbits 800000 to 800015] ∈ [--..--] __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} i ∈ [--..--] src[0..19] ∈ {0} dst1[0..19] ∈ {0} dst2[0..19] ∈ {0} dst3[0..19] ∈ {0} dst4[0..19] ∈ {0} dst5[0..99] ∈ {0} maybe ∈ [--..--] tm[0..999] ∈ {0} um[0..999] ∈ {0} ttyp[0..999] ∈ {0} v1 ∈ {0} v2 ∈ {0} v3 ∈ {0} v4 ∈ {0} v5 ∈ {0} t[0..3] ∈ {0} p ∈ ESCAPINGADDR q ∈ {0} ==END OF DUMP== [eva] Recording results for main_local [from] Computing for function main_local [from] Done for function main_local [eva] Done for function main_local [eva] computing for function copy_0 <- main_all. Called from tests/builtins/memcpy.c:229. [eva] tests/builtins/memcpy.c:220: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy.c:220: Warning: function memcpy: precondition 'valid_dest' got status invalid. [eva] tests/builtins/memcpy.c:220: function memcpy: no state left, precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy.c:220: function memcpy: no state left, precondition 'separation' got status valid. [eva] tests/builtins/memcpy.c:221: Call to builtin memcpy [eva] tests/builtins/memcpy.c:221: function memcpy: precondition 'valid_dest' got status valid. [eva:alarm] tests/builtins/memcpy.c:221: Warning: function memcpy: precondition 'valid_src' got status invalid. [eva] tests/builtins/memcpy.c:221: function memcpy: no state left, precondition 'separation' got status valid. [eva] Recording results for copy_0 [from] Computing for function copy_0 [from] Done for function copy_0 [eva] Done for function copy_0 [eva] Recording results for main_all [from] Computing for function main_all [from] Non-terminating function main_all (no dependencies) [from] Done for function main_all [eva] done for function main_all [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function init: src[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} [10] ∈ {11} [11] ∈ {12} [12] ∈ {13} [13] ∈ {14} [14] ∈ {15} [15] ∈ {16} [16] ∈ {17} [17] ∈ {18} [18] ∈ {19} [19] ∈ {20} dst1[0..19] ∈ {-1} dst2[0..19] ∈ {-1} dst3[0..19] ∈ {-1} dst4[0..19] ∈ {-1} dst5[0..99] ∈ {-1} j ∈ {100} [eva:final-states] Values at end of function buggy: c ∈ {100} p ∈ {{ &c ; "abc" }} [eva:final-states] Values at end of function copy_0: [eva:final-states] Values at end of function main_local: p ∈ ESCAPINGADDR q ∈ {0} [eva:final-states] Values at end of function main_uninit: a[0..9] ∈ [--..--] or UNINITIALIZED [10..49] ∈ UNINITIALIZED b[0..24] ∈ [--..--] or UNINITIALIZED [25..49] ∈ UNINITIALIZED r ∈ [0..255] [eva:final-states] Values at end of function many: tm[0..999] ∈ {0; 1684234849} um{[0..998]#; [999][bits 0 to 15]} ∈ {0; 25185} repeated %16 [999][bits 16 to 31] ∈ {0} ttyp[0].ts ∈ [--..--] [0].[bits 16 to 31]# ∈ {0; 8589934593}%64, bits 16 to 31 [0].ti ∈ [--..--] [1..999]{.ts#; .ti#; .[bits 16 to 31]#} ∈ {0; 8589934593} repeated %64 s[0] ∈ {97} [1] ∈ {98} [2] ∈ {99} [3] ∈ {100} [4] ∈ {0} p ∈ [0..999] ty.ts ∈ {1} .[bits 16 to 31] ∈ {0} .ti ∈ {2} [eva:final-states] Values at end of function main: src[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} [10] ∈ {11} [11] ∈ {12} [12] ∈ {13} [13] ∈ {14} [14] ∈ {15} [15] ∈ {16} [16] ∈ {17} [17] ∈ {18} [18] ∈ {19} [19] ∈ {20} dst1[0] ∈ {-1} [1] ∈ {3} [2] ∈ {4} [3] ∈ {5} [4] ∈ {6} [5] ∈ {7} [6] ∈ {-1; 8} [7] ∈ {-1; 9} [8] ∈ {-1; 10} [9] ∈ {-1; 11} [10] ∈ {-1; 12} [11] ∈ {-1; 13} [12] ∈ {-1; 14} [13] ∈ {-1; 15} [14] ∈ {-1; 16} [15] ∈ {-1; 17} [16..19] ∈ {-1} dst2[0] ∈ {-1} [1] ∈ {3} [2] ∈ {4} [3] ∈ {5} [4] ∈ {6} [5] ∈ {7} [6] ∈ {8} [7] ∈ {9} [8] ∈ {10} [9] ∈ {11} [10] ∈ {12} [11] ∈ {-1; 13} [12] ∈ {-1; 14} [13] ∈ {-1; 15} [14] ∈ {-1; 16} [15] ∈ {-1; 17} [16] ∈ {-1; 18} [17] ∈ {-1; 19} [18] ∈ {-1; 20} [19] ∈ {-1} dst3[0..4] ∈ {-1} [5] ∈ {3} [6] ∈ {4} [7] ∈ {5} [8] ∈ {6} [9] ∈ {7} [10] ∈ {-1; 8} [11] ∈ {-1; 9} [12] ∈ {-1; 10} [13] ∈ {-1; 11} [14] ∈ {-1; 12} [15] ∈ {-1; 13} [16] ∈ {-1; 14} [17] ∈ {-1; 15} [18] ∈ {-1; 16} [19] ∈ {-1} dst4[0..4] ∈ {-1} [5] ∈ {3} [6] ∈ {4} [7] ∈ {5} [8] ∈ {6} [9] ∈ {7} [10] ∈ {8} [11] ∈ {9} [12] ∈ {10} [13] ∈ {11} [14] ∈ {12} [15] ∈ {-1; 13} [16] ∈ {-1; 14} [17] ∈ {-1; 15} [18] ∈ {-1; 16} [19] ∈ {-1} dst5[0] ∈ {-1; 1} [1] ∈ {-1; 2} [2] ∈ {-1; 3} [3] ∈ {-1; 4} [4] ∈ {-1; 5} [5] ∈ {-1; 6} [6] ∈ {-1; 7} [7] ∈ {-1; 8} [8] ∈ {-1; 9} [9] ∈ {-1; 10} [10] ∈ {-1; 11} [11] ∈ {-1; 12} [12] ∈ {-1; 13} [13] ∈ {-1; 14} [14..19] ∈ {-1} [20] ∈ {-1; 1} [21] ∈ {-1; 2} [22] ∈ {-1; 3} [23] ∈ {-1; 4} [24] ∈ {-1; 5} [25] ∈ {-1; 6} [26] ∈ {-1; 7} [27] ∈ {-1; 8} [28] ∈ {-1; 9} [29] ∈ {-1; 10} [30] ∈ {-1; 11} [31] ∈ {-1; 12} [32] ∈ {-1; 13} [33] ∈ {-1; 14} [34..39] ∈ {-1} [40] ∈ {-1; 1} [41..88] ∈ [-1..19] [89..99] ∈ {-1} tm[0..999] ∈ {0; 1684234849} um{[0..998]#; [999][bits 0 to 15]} ∈ {0; 25185} repeated %16 [999][bits 16 to 31] ∈ {0} ttyp[0].ts ∈ [--..--] [0].[bits 16 to 31]# ∈ {0; 8589934593}%64, bits 16 to 31 [0].ti ∈ [--..--] [1..999]{.ts#; .ti#; .[bits 16 to 31]#} ∈ {0; 8589934593} repeated %64 v1.x ∈ {5} .y ∈ {7} {.p; .padding[0..23]} ∈ {0} v2.x ∈ {5} .y ∈ {7} {.p; .padding[0..23]} ∈ {0} v3 ∈ {{ garbled mix of &{v1} (origin: Misaligned {tests/builtins/memcpy.c:87}) }} v4.x ∈ [--..--] .y ∈ {{ (int)&t }} {.p; .padding[0..23]} ∈ [--..--] v5 ∈ {{ garbled mix of &{t} (origin: Misaligned {tests/builtins/memcpy.c:91}) }} t{[0]; [1]{.x; .y}} ∈ {0} [1].p ∈ {{ &v1.y }} {[1].padding[0..23]; [2]; [3]{.x; .y}} ∈ {0} [3].p ∈ {{ NULL ; &v1.y }} [3].padding[0..23] ∈ {0} b ∈ [1..19] p ∈ {{ &dst5{[40], [70]} }} ptop1[0..3] ∈ UNINITIALIZED [bits 32 to 6399]# ∈ {67305985} or UNINITIALIZED repeated %32 pptop ∈ {{ &ptop4 + [--..--],2%4 }} ptop2[0..1] ∈ UNINITIALIZED [bits 16 to 5999]# ∈ {84148994} or UNINITIALIZED repeated %32 [750..799] ∈ UNINITIALIZED ptop3[0..1] ∈ UNINITIALIZED [bits 16 to 6383]# ∈ {100992003} or UNINITIALIZED repeated %32 [798..799] ∈ UNINITIALIZED ptop4[0..1] ∈ UNINITIALIZED [2..798] ∈ [--..--] or UNINITIALIZED [799] ∈ UNINITIALIZED garbledsize[0..9] ∈ UNINITIALIZED [10..99] ∈ [1..20] or UNINITIALIZED pgarbledsize ∈ {{ (int *)&garbledsize[10] }} dstmaybesize1[0..14] ∈ [1..20] or UNINITIALIZED dstmaybesize2[0] ∈ {1} or UNINITIALIZED [1] ∈ {2} or UNINITIALIZED [2] ∈ {3} or UNINITIALIZED [3] ∈ {4} or UNINITIALIZED [4] ∈ {5} or UNINITIALIZED [5] ∈ {6} or UNINITIALIZED [6..149] ∈ UNINITIALIZED maybesize ∈ {0; 1; 2; 3; 4; 5; 6} [eva:final-states] Values at end of function main_all: NON TERMINATING FUNCTION [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to memcpy at tests/builtins/memcpy.c:28 (by buggy): c FROM "d"[bits 0 to 7] \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:220 (by copy_0): \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:221 (by copy_0): \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:209 (by main_local): p FROM q \result FROM dest [from] call to Frama_C_dump_each at tests/builtins/memcpy.c:212 (by main_local): \result FROM \nothing [from] call to memcpy at tests/builtins/memcpy.c:172 (by main_uninit): b[0..9] FROM a[0..9] \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:174 (by main_uninit): b[0..24] FROM a[0..24] (and SELF) \result FROM dest [from] call to itv at tests/builtins/memcpy.c:174 (by main_uninit): \result FROM l; u [from] call to make_unknown at tests/builtins/memcpy.c:178 (by main_uninit): a[0..9] FROM maybe [from] call to memcpy at tests/builtins/memcpy.c:179 (by main_uninit): b[0..9] FROM a[0..9] \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:181 (by main_uninit): b[0..24] FROM a[0..24] (and SELF) \result FROM dest [from] call to itv at tests/builtins/memcpy.c:181 (by main_uninit): \result FROM l; u [from] call to make_unknown at tests/builtins/memcpy.c:185 (by main_uninit): b[0..9] FROM maybe [from] call to memcpy at tests/builtins/memcpy.c:187 (by main_uninit): b[0..9] FROM a[0..9] \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:190 (by main_uninit): b[0..24] FROM a[0..24] (and SELF) \result FROM dest [from] call to itv at tests/builtins/memcpy.c:190 (by main_uninit): \result FROM l; u [from] call to make_unknown at tests/builtins/memcpy.c:196 (by main_uninit): a[0..9] FROM maybe [from] call to make_unknown at tests/builtins/memcpy.c:197 (by main_uninit): b[0..9] FROM maybe [from] call to memcpy at tests/builtins/memcpy.c:198 (by main_uninit): b[0..9] FROM a[0..9] \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:200 (by main_uninit): b[0..24] FROM a[0..24] (and SELF) \result FROM dest [from] call to itv at tests/builtins/memcpy.c:200 (by main_uninit): \result FROM l; u [from] call to memcpy at tests/builtins/memcpy.c:47 (by many): tm[0..999] FROM s[0..3] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:49 (by many): um{[0..998]; [999][bits 0 to 15]} FROM s[0..1] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:53 (by many): ttyp[0..999] FROM ty (and SELF) \result FROM dest [from] call to buggy at tests/builtins/memcpy.c:61 (by main): NO EFFECTS [from] call to many at tests/builtins/memcpy.c:63 (by main): tm[0] FROM \nothing [1..999] FROM \nothing (and SELF) um[0] FROM \nothing {[1..998]; [999][bits 0 to 15]} FROM \nothing (and SELF) ttyp[0] FROM \nothing [1..999] FROM \nothing (and SELF) [from] call to init at tests/builtins/memcpy.c:65 (by main): src[0..19] FROM \nothing (and SELF) dst1[0..19] FROM \nothing (and SELF) dst2[0..19] FROM \nothing (and SELF) dst3[0..19] FROM \nothing (and SELF) dst4[0..19] FROM \nothing (and SELF) dst5[0..99] FROM \nothing (and SELF) [from] call to memcpy at tests/builtins/memcpy.c:68 (by main): dst1[1..5] FROM src[2..6] [6..15] FROM src[7..16] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:70 (by main): dst2[1..10] FROM src[2..11] [11..19] FROM src[12..19] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:73 (by main): dst3[5..9] FROM src[2..6] [10..18] FROM src[7..15] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:75 (by main): dst4[5..14] FROM src[2..11] [15..19] FROM src[12..19] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:83 (by main): v2 FROM v1 \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:85 (by main): t[2] FROM t[0] [3] FROM t[1] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:87 (by main): v3 FROM t[0..3] \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:89 (by main): v4 FROM v1{.x; .y; .p; .padding[0..3]} (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:91 (by main): v5 FROM v4{.x; .y; .p; .padding[0..3]} (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:96 (by main): x FROM x (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:101 (by main): dst5[0..4] FROM src[0..4] (and SELF) {[5..19]; [25..33]} FROM src[5..13] (and SELF) [20..24] FROM src[0..13] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:105 (by main): dst5[40] FROM src[0] (and SELF) {[41..69]; [71..88]} FROM src[1..18] (and SELF) [70] FROM src[0..18] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:114 (by main): ptop1[4..799] FROM src[0..3] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:122 (by main): ptop2[2..749] FROM src[1..4] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:131 (by main): ptop3[2..797] FROM src[2..5] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:140 (by main): ptop4[2..798] FROM src[2..6] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:145 (by main): garbledsize[10..99] FROM src[0..19] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:151 (by main): dstmaybesize1[0..14] FROM src[0..19] (and SELF) \result FROM dest [from] call to memcpy at tests/builtins/memcpy.c:153 (by main): dstmaybesize2[0..5] FROM src[0..5] (and SELF) \result FROM dest [from] call to main at tests/builtins/memcpy.c:226 (by main_all): src[0..19] FROM \nothing (and SELF) dst1{[0]; [16..19]} FROM \nothing (and SELF) [1..5] FROM src[2..6] [6..15] FROM src[7..16] (and SELF) dst2[0] FROM \nothing (and SELF) [1..10] FROM src[2..11] [11..19] FROM src[12..19] (and SELF) dst3{[0..4]; [19]} FROM \nothing (and SELF) [5..9] FROM src[2..6] [10..18] FROM src[7..15] (and SELF) dst4[0..4] FROM \nothing (and SELF) [5..14] FROM src[2..11] [15..19] FROM src[12..19] (and SELF) dst5[0..4] FROM src[0..4] (and SELF) {[5..19]; [25..33]} FROM src[5..13] (and SELF) [20..24] FROM src[0..13] (and SELF) {[34..39]; [89..99]} FROM \nothing (and SELF) [40] FROM src[0] (and SELF) {[41..69]; [71..88]} FROM src[1..18] (and SELF) [70] FROM src[0..18] (and SELF) tm[0] FROM \nothing [1..999] FROM \nothing (and SELF) um[0] FROM \nothing {[1..998]; [999][bits 0 to 15]} FROM \nothing (and SELF) ttyp[0] FROM \nothing [1..999] FROM \nothing (and SELF) v1{.x; .y} FROM \nothing v2 FROM v1{.p; .padding[0..23]} v3 FROM v2; t{[0]; [3]} v4{.x; {.p; .padding[0..23]}} FROM v1{.p; .padding[0..3]} (and SELF) .y FROM \nothing v5 FROM v1{.p; .padding[0..3]}; v4{.x; {.p; .padding[0..3]}} (and SELF) t[1] FROM v2 [2] FROM t[0] [3] FROM v2 (and SELF) [from] call to main_uninit at tests/builtins/memcpy.c:227 (by main_all): NO EFFECTS [from] call to main_local at tests/builtins/memcpy.c:228 (by main_all): NO EFFECTS [from] call to copy_0 at tests/builtins/memcpy.c:229 (by main_all): NO EFFECTS [from] entry point: NON TERMINATING - NO EFFECTS [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function init: src[0..19]; dst1[0..19]; dst2[0..19]; dst3[0..19]; dst4[0..19]; dst5[0..99]; j [inout] Inputs for function init: \nothing [inout] InOut (internal) for function init: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: j [inout] Out (internal) for function buggy: c; p; tmp [inout] Inputs for function buggy: maybe; "d"[bits 0 to 7] [inout] InOut (internal) for function buggy: Operational inputs: maybe; "d"[bits 0 to 7] Operational inputs on termination: maybe; "d"[bits 0 to 7] Sure outputs: c; p; tmp [inout] Out (internal) for function copy_0: \nothing [inout] Inputs for function copy_0: i [inout] InOut (internal) for function copy_0: Operational inputs: i Operational inputs on termination: i Sure outputs: \nothing [inout] Out (internal) for function main_local: p; q [inout] Inputs for function main_local: \nothing [inout] InOut (internal) for function main_local: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: p; q [inout] Out (internal) for function main_uninit: a[0..9]; b[0..24]; r; tmp; tmp_0; tmp_1; tmp_2 [inout] Inputs for function main_uninit: maybe [inout] InOut (internal) for function main_uninit: Operational inputs: maybe; a[0..24]; b[11] Operational inputs on termination: maybe; a[0..24]; b[11] Sure outputs: r [inout] Out (internal) for function many: tm[0..999]; um{[0..998]; [999][bits 0 to 15]}; ttyp[0..999]; s[0..4]; p; ty{.ts; .ti} [inout] Inputs for function many: maybe [inout] InOut (internal) for function many: Operational inputs: maybe; ty.[bits 16 to 31] Operational inputs on termination: maybe; ty.[bits 16 to 31] Sure outputs: tm[0]; um[0]; ttyp[0]; s[0..4]; p; ty{.ts; .ti} [inout] Out (internal) for function main: src[0..19]; dst1[0..19]; dst2[0..19]; dst3[0..19]; dst4[0..19]; dst5[0..99]; tm[0..999]; um{[0..998]; [999][bits 0 to 15]}; ttyp[0..999]; v1{.x; .y}; v2; v3; v4; v5; t[1..3]; b; x; p; ptop1[4..799]; pptop; ptop2[2..749]; ptop3[2..797]; ptop4[2..798]; garbledsize[10..99]; pgarbledsize; dstmaybesize1[0..14]; dstmaybesize2[0..5]; maybesize [inout] Inputs for function main: NULL[100000..100001]; i; src[0..19]; maybe; v1; v2; v4{.x; .y; .p; .padding[0..3]}; t[0..3]; "d"[bits 0 to 7] [inout] InOut (internal) for function main: Operational inputs: i; src[0..19]; maybe; v1{.p; .padding[0..23]}; v2; v4{.x; {.p; .padding[0..3]}}; t{[0]; [3]}; a; b; "d"[bits 0 to 7] Operational inputs on termination: src[0..19]; maybe; v1{.p; .padding[0..23]}; v2; v4{.x; {.p; .padding[0..3]}}; t{[0]; [3]}; a; b; "d"[bits 0 to 7] Sure outputs: dst1[1..5]; dst2[1..10]; dst3[5..9]; dst4[5..14]; tm[0]; um[0]; ttyp[0]; v1{.x; .y}; v2; v3; v4.y; t[1..2]; b; p; pptop; pgarbledsize; maybesize [inout] Out (internal) for function main_all: src[0..19]; dst1[0..19]; dst2[0..19]; dst3[0..19]; dst4[0..19]; dst5[0..99]; tm[0..999]; um{[0..998]; [999][bits 0 to 15]}; ttyp[0..999]; v1{.x; .y}; v2; v3; v4; v5; t[1..3] [inout] Inputs for function main_all: NULL[100000..100001]; i; src[0..19]; maybe; v1; v2; v4{.x; .y; .p; .padding[0..3]}; t[0..3]; "d"[bits 0 to 7] [inout] InOut (internal) for function main_all: Operational inputs: i; src[0..19]; maybe; v1{.p; .padding[0..23]}; v2; v4{.x; {.p; .padding[0..3]}}; t{[0]; [3]}; "d"[bits 0 to 7] Operational inputs on termination: \nothing Sure outputs: ANYTHING(origin:Unknown) [report] Computing properties status... -------------------------------------------------------------------------------- --- Global Properties -------------------------------------------------------------------------------- [ Extern ] Axiom 'memchr_def' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_left' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_right' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_shift_left' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_shift_right' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'memset_def' Unverifiable but considered Valid. [ Extern ] Axiom 'never_allocable' Unverifiable but considered Valid. [ Extern ] Axiom 'strchr_def' Unverifiable but considered Valid. [ Extern ] Axiom 'strcmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_at_null' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_before_null' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_create' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_create_shift' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_neg' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_not_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_pos_or_null' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_shift' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_sup' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'strncmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wcschr_def' Unverifiable but considered Valid. [ Extern ] Axiom 'wcscmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_at_null' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_before_null' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_create' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_create_shift' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_neg' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_not_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_pos_or_null' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_shift' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_sup' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wcsncmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wmemchr_def' Unverifiable but considered Valid. [ Valid ] Axiomatic 'MemChr' by Frama-C kernel. [ Valid ] Axiomatic 'MemCmp' by Frama-C kernel. [ Valid ] Axiomatic 'MemSet' by Frama-C kernel. [ Valid ] Axiomatic 'StrChr' by Frama-C kernel. [ Valid ] Axiomatic 'StrCmp' by Frama-C kernel. [ Valid ] Axiomatic 'StrLen' by Frama-C kernel. [ Valid ] Axiomatic 'StrNCmp' by Frama-C kernel. [ Valid ] Axiomatic 'WMemChr' by Frama-C kernel. [ Valid ] Axiomatic 'WcsChr' by Frama-C kernel. [ Valid ] Axiomatic 'WcsCmp' by Frama-C kernel. [ Valid ] Axiomatic 'WcsLen' by Frama-C kernel. [ Valid ] Axiomatic 'WcsNCmp' by Frama-C kernel. [ Valid ] Axiomatic 'dynamic_allocation' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'memcmp' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'logic_spec' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 61) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'memchr' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'found' 'result_same_base' Unverifiable but considered Valid. [ Extern ] Post-condition for 'found' 'result_char' Unverifiable but considered Valid. [ Extern ] Post-condition for 'found' 'result_in_str' Unverifiable but considered Valid. [ Extern ] Post-condition for 'not_found' 'result_null' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 76) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'found' by Frama-C kernel. [ Valid ] Behavior 'not_found' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'memcpy' -------------------------------------------------------------------------------- [ Alarm ] Pre-condition 'valid_dest' By Call Preconditions, with pending: - Unreachable call 'memcpy' (file tests/builtins/memcpy.c, line 220) - Instance of 'Pre-condition 'valid_dest'' of 'buggy' at call 'memcpy' (file tests/builtins/memcpy.c, line 28) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 70) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 75) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 89) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 91) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 96) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 114) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 122) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 131) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 140) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 145) - Instance of 'Pre-condition 'valid_dest'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 151) [ Alarm ] Pre-condition 'valid_src' By Call Preconditions, with pending: - Unreachable call 'memcpy' (file tests/builtins/memcpy.c, line 221) - Instance of 'Pre-condition 'valid_src'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 70) - Instance of 'Pre-condition 'valid_src'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 75) - Instance of 'Pre-condition 'valid_src'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 87) - Instance of 'Pre-condition 'valid_src'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 96) - Instance of 'Pre-condition 'valid_src'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 145) - Instance of 'Pre-condition 'valid_src'' of 'main' at call 'memcpy' (file tests/builtins/memcpy.c, line 151) [ - ] Pre-condition 'separation' tried with Call Preconditions. [ Extern ] Post-condition 'copied_contents' Unverifiable but considered Valid. [ Extern ] Post-condition 'result_ptr' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 96) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 96) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 97) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'memmove' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'copied_contents' Unverifiable but considered Valid. [ Extern ] Post-condition 'result_ptr' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 106) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 106) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 107) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'memset' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'acsl_c_equiv' Unverifiable but considered Valid. [ Extern ] Post-condition 'result_ptr' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 116) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 116) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 117) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strlen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'acsl_c_equiv' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 126) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strnlen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_bounded' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 132) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strcmp' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'acsl_c_equiv' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 139) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strncmp' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'acsl_c_equiv' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 146) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strcoll' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 153) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strchr' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'found' 'result_char' Unverifiable but considered Valid. [ Extern ] Post-condition for 'found' 'result_same_base' Unverifiable but considered Valid. [ Extern ] Post-condition for 'found' 'result_in_length' Unverifiable but considered Valid. [ Extern ] Post-condition for 'found' 'result_valid_string' Unverifiable but considered Valid. [ Extern ] Post-condition for 'found' 'result_first_occur' Unverifiable but considered Valid. [ Extern ] Post-condition for 'not_found' 'result_null' Unverifiable but considered Valid. [ Extern ] Post-condition for 'default' 'result_null_or_same_base' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 158) Unverifiable but considered Valid. [ Valid ] Behavior 'default' by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'found' by Frama-C kernel. [ Valid ] Behavior 'not_found' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strrchr' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'found' 'result_char' Unverifiable but considered Valid. [ Extern ] Post-condition for 'found' 'result_same_base' Unverifiable but considered Valid. [ Extern ] Post-condition for 'found' 'result_valid_string' Unverifiable but considered Valid. [ Extern ] Post-condition for 'not_found' 'result_null' Unverifiable but considered Valid. [ Extern ] Post-condition for 'default' 'result_null_or_same_base' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 176) Unverifiable but considered Valid. [ Valid ] Behavior 'default' by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'found' by Frama-C kernel. [ Valid ] Behavior 'not_found' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strcspn' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_bounded' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 193) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strspn' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_bounded' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 200) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 200) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 201) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strpbrk' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_same_base' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 208) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strstr' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_in_haystack' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 216) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strcasestr' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_in_haystack' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 227) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strtok' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'new_str' 'result_subset' Unverifiable but considered Valid. [ Extern ] Post-condition for 'new_str' 'ptr_subset' Unverifiable but considered Valid. [ Extern ] Post-condition for 'resume_str' 'result_subset' Unverifiable but considered Valid. [ Extern ] Post-condition for 'resume_str' 'ptr_subset' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 240) Unverifiable but considered Valid. [ Extern ] Assigns for 'new_str' (file share/libc/string.h, line 255) Unverifiable but considered Valid. [ Extern ] Assigns for 'resume_str' (file share/libc/string.h, line 263) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 240) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 242) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 244) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 246) Unverifiable but considered Valid. [ Extern ] Froms for 'new_str' (file share/libc/string.h, line 255) Unverifiable but considered Valid. [ Extern ] Froms for 'new_str' (file share/libc/string.h, line 256) Unverifiable but considered Valid. [ Extern ] Froms for 'new_str' (file share/libc/string.h, line 257) Unverifiable but considered Valid. [ Extern ] Froms for 'resume_str' (file share/libc/string.h, line 263) Unverifiable but considered Valid. [ Extern ] Froms for 'resume_str' (file share/libc/string.h, line 266) Unverifiable but considered Valid. [ Extern ] Froms for 'resume_str' (file share/libc/string.h, line 269) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'new_str' by Frama-C kernel. [ Valid ] Behavior 'resume_str' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strtok_r' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'new_str' 'result_subset' Unverifiable but considered Valid. [ Extern ] Post-condition for 'new_str' 'initialization' Unverifiable but considered Valid. [ Extern ] Post-condition for 'new_str' 'saveptr_subset' Unverifiable but considered Valid. [ Extern ] Post-condition for 'resume_str' 'result_subset' Unverifiable but considered Valid. [ Extern ] Post-condition for 'resume_str' 'saveptr_subset' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 282) Unverifiable but considered Valid. [ Extern ] Assigns for 'new_str' (file share/libc/string.h, line 297) Unverifiable but considered Valid. [ Extern ] Assigns for 'resume_str' (file share/libc/string.h, line 307) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 282) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 284) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 286) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 288) Unverifiable but considered Valid. [ Extern ] Froms for 'new_str' (file share/libc/string.h, line 297) Unverifiable but considered Valid. [ Extern ] Froms for 'new_str' (file share/libc/string.h, line 298) Unverifiable but considered Valid. [ Extern ] Froms for 'new_str' (file share/libc/string.h, line 299) Unverifiable but considered Valid. [ Extern ] Froms for 'resume_str' (file share/libc/string.h, line 307) Unverifiable but considered Valid. [ Extern ] Froms for 'resume_str' (file share/libc/string.h, line 310) Unverifiable but considered Valid. [ Extern ] Froms for 'resume_str' (file share/libc/string.h, line 313) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'new_str' by Frama-C kernel. [ Valid ] Behavior 'resume_str' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strsep' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/string.h, line 325) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 325) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 326) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strerror' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_internal_str' Unverifiable but considered Valid. [ Extern ] Post-condition 'result_nul_terminated' Unverifiable but considered Valid. [ Extern ] Post-condition 'result_valid_string' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 336) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strcpy' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'equal_contents' Unverifiable but considered Valid. [ Extern ] Post-condition 'result_ptr' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 349) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 349) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 350) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strncpy' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_ptr' Unverifiable but considered Valid. [ Extern ] Post-condition 'initialization' Unverifiable but considered Valid. [ Extern ] Post-condition for 'complete' 'equal_after_copy' Unverifiable but considered Valid. [ Extern ] Post-condition for 'partial' 'equal_prefix' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 361) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 361) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 362) Unverifiable but considered Valid. [ Valid ] Behavior 'complete' by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'partial' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strlcpy' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'initialization' Unverifiable but considered Valid. [ Extern ] Post-condition 'bounded_result' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 380) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 380) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 381) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'stpcpy' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'equal_contents' Unverifiable but considered Valid. [ Extern ] Post-condition 'points_to_end' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 392) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 392) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 393) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strcat' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'sum_of_lengths' Unverifiable but considered Valid. [ Extern ] Post-condition 'initialization,dest' Unverifiable but considered Valid. [ Extern ] Post-condition 'dest_null_terminated' Unverifiable but considered Valid. [ Extern ] Post-condition 'result_ptr' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 403) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 403) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 406) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strncat' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_ptr' Unverifiable but considered Valid. [ Extern ] Post-condition for 'complete' 'sum_of_lengths' Unverifiable but considered Valid. [ Extern ] Post-condition for 'partial' 'sum_of_bounded_lengths' Unverifiable but considered Valid. [ Extern ] Assigns for 'complete' (file share/libc/string.h, line 423) Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 417) Unverifiable but considered Valid. [ Extern ] Assigns for 'partial' (file share/libc/string.h, line 431) Unverifiable but considered Valid. [ Extern ] Froms for 'complete' (file share/libc/string.h, line 423) Unverifiable but considered Valid. [ Extern ] Froms for 'complete' (file share/libc/string.h, line 425) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 417) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 418) Unverifiable but considered Valid. [ Extern ] Froms for 'partial' (file share/libc/string.h, line 431) Unverifiable but considered Valid. [ Extern ] Froms for 'partial' (file share/libc/string.h, line 433) Unverifiable but considered Valid. [ Valid ] Behavior 'complete' by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'partial' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strlcat' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'bounded_result' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/string.h, line 443) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 443) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 444) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strxfrm' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/string.h, line 452) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 452) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 453) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strdup' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'allocation' 'allocation' Unverifiable but considered Valid. [ Extern ] Post-condition for 'allocation' 'result_valid_string_and_same_contents' Unverifiable but considered Valid. [ Extern ] Post-condition for 'no_allocation' 'result_null' Unverifiable but considered Valid. [ Extern ] Assigns for 'allocation' (file share/libc/string.h, line 465) Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Assigns for 'no_allocation' nothing Unverifiable but considered Valid. [ Extern ] Froms for 'allocation' (file share/libc/string.h, line 465) Unverifiable but considered Valid. [ Extern ] Froms for 'allocation' (file share/libc/string.h, line 466) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 462) Unverifiable but considered Valid. [ Extern ] Froms for 'no_allocation' (file share/libc/string.h, line 472) Unverifiable but considered Valid. [ Valid ] Behavior 'allocation' by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'no_allocation' by Frama-C kernel. [ Extern ] Frees/Allocates nothing/(file share/libc/string.h, line 461) Unverifiable but considered Valid. [ Extern ] Frees/Allocates for 'no_allocation' nothing/nothing Unverifiable but considered Valid. -------------------------------------------------------------------------------- --- Properties of Function 'strndup' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'allocation' 'allocation' Unverifiable but considered Valid. [ Extern ] Post-condition for 'allocation' 'result_valid_string_bounded_and_same_prefix' Unverifiable but considered Valid. [ Extern ] Post-condition for 'no_allocation' 'result_null' Unverifiable but considered Valid. [ Extern ] Assigns for 'allocation' (file share/libc/string.h, line 483) Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Assigns for 'no_allocation' nothing Unverifiable but considered Valid. [ Extern ] Froms for 'allocation' (file share/libc/string.h, line 483) Unverifiable but considered Valid. [ Extern ] Froms for 'allocation' (file share/libc/string.h, line 484) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 479) Unverifiable but considered Valid. [ Extern ] Froms for 'no_allocation' (file share/libc/string.h, line 493) Unverifiable but considered Valid. [ Valid ] Behavior 'allocation' by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'no_allocation' by Frama-C kernel. [ Extern ] Frees/Allocates nothing/(file share/libc/string.h, line 478) Unverifiable but considered Valid. [ Extern ] Frees/Allocates for 'no_allocation' nothing/nothing Unverifiable but considered Valid. -------------------------------------------------------------------------------- --- Properties of Function 'strsignal' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_internal_str' Unverifiable but considered Valid. [ Extern ] Post-condition 'result_nul_terminated' Unverifiable but considered Valid. [ Extern ] Post-condition 'result_valid_string' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/string.h, line 509) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'bzero' -------------------------------------------------------------------------------- [ Extern ] Post-condition 's_initialized,initialization' Unverifiable but considered Valid. [ Extern ] Post-condition 'zero_initialized' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/strings.h, line 37) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/strings.h, line 37) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strcasecmp' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/strings.h, line 48) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'strncasecmp' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/strings.h, line 55) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'buggy' -------------------------------------------------------------------------------- [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 28) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 28) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 28) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'many' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/builtins/memcpy.c, line 44) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 47) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 47) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 47) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 49) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 49) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 49) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 53) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 53) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 53) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/builtins/memcpy.c, line 67) tried with Eva. [ - ] Assertion (file tests/builtins/memcpy.c, line 72) tried with Eva. [ - ] Assertion (file tests/builtins/memcpy.c, line 103) tried with Eva. [ - ] Assertion (file tests/builtins/memcpy.c, line 150) tried with Eva. [ - ] Assertion (file tests/builtins/memcpy.c, line 152) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 68) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 68) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 68) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 70) tried with Eva. [ - ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 70) tried with Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 70) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 73) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 73) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 73) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 75) tried with Eva. [ - ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 75) tried with Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 75) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 83) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 83) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 83) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 85) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 85) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 85) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 87) by Eva. [ - ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 87) tried with Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 87) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 89) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 89) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 89) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 91) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 91) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 91) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 96) tried with Eva. [ - ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 96) tried with Eva. [ - ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 96) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 101) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 101) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 101) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 105) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 105) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 105) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 114) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 114) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 114) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 122) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 122) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 122) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 131) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 131) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 131) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 140) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 140) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 140) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 145) tried with Eva. [ - ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 145) tried with Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 145) by Eva. [ - ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 151) tried with Eva. [ - ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 151) tried with Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 151) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 153) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 153) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 153) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'itv' -------------------------------------------------------------------------------- [ Extern ] Post-condition (file tests/builtins/memcpy.c, line 158) Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file tests/builtins/memcpy.c, line 157) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'make_unknown' -------------------------------------------------------------------------------- [ Valid ] Pre-condition (file tests/builtins/memcpy.c, line 161) by Call Preconditions. [ Extern ] Post-condition (file tests/builtins/memcpy.c, line 163) Unverifiable but considered Valid. [ Extern ] Assigns (file tests/builtins/memcpy.c, line 162) Unverifiable but considered Valid. [ Extern ] Froms (file tests/builtins/memcpy.c, line 162) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main_uninit' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/builtins/memcpy.c, line 173) by Eva. [ Valid ] Assertion (file tests/builtins/memcpy.c, line 175) by Eva. [ Valid ] Assertion (file tests/builtins/memcpy.c, line 180) by Eva. [ Valid ] Assertion (file tests/builtins/memcpy.c, line 188) by Eva. [ Valid ] Assertion (file tests/builtins/memcpy.c, line 191) by Eva. [ Valid ] Assertion (file tests/builtins/memcpy.c, line 199) by Eva. [ - ] Assertion 'Eva,initialization' (file tests/builtins/memcpy.c, line 182) tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/builtins/memcpy.c, line 192) tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/builtins/memcpy.c, line 201) tried with Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 172) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 172) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 172) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 174) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 174) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 174) by Eva. [ Valid ] Instance of 'Pre-condition (file tests/builtins/memcpy.c, line 161)' at call 'make_unknown' (file tests/builtins/memcpy.c, line 178) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 179) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 179) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 179) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 181) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 181) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 181) by Eva. [ Valid ] Instance of 'Pre-condition (file tests/builtins/memcpy.c, line 161)' at call 'make_unknown' (file tests/builtins/memcpy.c, line 185) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 187) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 187) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 187) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 190) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 190) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 190) by Eva. [ Valid ] Instance of 'Pre-condition (file tests/builtins/memcpy.c, line 161)' at call 'make_unknown' (file tests/builtins/memcpy.c, line 196) by Eva. [ Valid ] Instance of 'Pre-condition (file tests/builtins/memcpy.c, line 161)' at call 'make_unknown' (file tests/builtins/memcpy.c, line 197) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 198) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 198) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 198) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 200) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 200) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 200) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main_local' -------------------------------------------------------------------------------- [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 209) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 209) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 209) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'copy_0' -------------------------------------------------------------------------------- [ Alarm ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 220) By Eva, with pending: - Unreachable call 'memcpy' (file tests/builtins/memcpy.c, line 220) [ Valid ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 220) by Eva. [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 220) by Eva. [ Valid ] Instance of 'Pre-condition 'valid_dest'' at call 'memcpy' (file tests/builtins/memcpy.c, line 221) by Eva. [ Alarm ] Instance of 'Pre-condition 'valid_src'' at call 'memcpy' (file tests/builtins/memcpy.c, line 221) By Eva, with pending: - Unreachable call 'memcpy' (file tests/builtins/memcpy.c, line 221) [ Valid ] Instance of 'Pre-condition 'separation'' at call 'memcpy' (file tests/builtins/memcpy.c, line 221) by Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 162 Completely validated 239 Considered valid 29 To be validated 4 Alarms emitted 434 Total -------------------------------------------------------------------------------- �������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/memcpy2.res.oracle���������������������������������������0000666�0000000�0000000�00000007726�13571573400�021022� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/memcpy2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function Frama_C_interval <- main. Called from tests/builtins/memcpy2.c:9. [eva] using specification for function Frama_C_interval [eva] tests/builtins/memcpy2.c:9: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memcpy2.c:10: Call to builtin memcpy [eva] tests/builtins/memcpy2.c:10: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy2.c:10: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy2.c:10: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] tests/builtins/memcpy2.c:12: Frama_C_dump_each: # Cvalue domain: Frama_C_entropy_source ∈ [--..--] __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} c ∈ [--..--] v ∈ {{ NULL ; &S_v[0] }} t[0..510] ∈ {0} or UNINITIALIZED [511] ∈ UNINITIALIZED s[0..511] ∈ {0} l ∈ [0..511] __retres ∈ UNINITIALIZED S_v[0] ∈ {{ NULL ; &S_0_S_v[0] }} [1] ∈ {{ NULL ; &S_1_S_v[0] }} S_0_S_v[0..1] ∈ [--..--] S_1_S_v[0..1] ∈ [--..--] ==END OF DUMP== [eva] computing for function Frama_C_interval <- main. Called from tests/builtins/memcpy2.c:14. [eva] tests/builtins/memcpy2.c:14: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memcpy2.c:15: Call to builtin memcpy [eva] tests/builtins/memcpy2.c:15: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy2.c:15: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy2.c:15: function memcpy: precondition 'separation' got status valid. [eva] computing for function Frama_C_interval <- main. Called from tests/builtins/memcpy2.c:17. [eva] tests/builtins/memcpy2.c:17: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/memcpy2.c:18: Call to builtin memcpy [eva] tests/builtins/memcpy2.c:18: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/builtins/memcpy2.c:18: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/memcpy2.c:18: function memcpy: precondition 'separation' got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] t[0] ∈ {0} [1..511] ∈ {0} or UNINITIALIZED s[0..511] ∈ {0} l ∈ [1..512] __retres ∈ {0} [from] Computing for function main [from] Computing for function Frama_C_interval <-main [from] Done for function Frama_C_interval [from] Computing for function memcpy <-main [from] Done for function memcpy [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function memcpy: t[0..511] FROM s[0..511] (and SELF) \result FROM dest [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: Frama_C_entropy_source; t[0..511]; s[0..511]; l; __retres [inout] Inputs for function main: Frama_C_entropy_source ������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/memcpy_invalid.res.oracle��������������������������������0000666�0000000�0000000�00000004752�13571573400�022442� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/memcpy_invalid.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function test <- main. Called from tests/builtins/memcpy_invalid.c:22. [eva] computing for function Frama_C_interval <- test <- main. Called from tests/builtins/memcpy_invalid.c:16. [eva] using specification for function Frama_C_interval [eva] Done for function Frama_C_interval [eva] tests/builtins/memcpy_invalid.c:17: Call to builtin memcpy [eva:alarm] tests/builtins/memcpy_invalid.c:17: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva:alarm] tests/builtins/memcpy_invalid.c:17: Warning: function memcpy: precondition 'valid_src' got status invalid. [eva] tests/builtins/memcpy_invalid.c:17: function memcpy: no state left, precondition 'separation' got status valid. [eva] Recording results for test [from] Computing for function test [from] Non-terminating function test (no dependencies) [from] Done for function test [eva] Done for function test [eva] computing for function test <- main. Called from tests/builtins/memcpy_invalid.c:23. [eva] computing for function Frama_C_interval <- test <- main. Called from tests/builtins/memcpy_invalid.c:16. [eva] Done for function Frama_C_interval [eva] tests/builtins/memcpy_invalid.c:17: Call to builtin memcpy [eva] Recording results for test [from] Computing for function test [from] Non-terminating function test (no dependencies) [from] Done for function test [eva] Done for function test [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: __retres ∈ {0} [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to Frama_C_interval at tests/builtins/memcpy_invalid.c:16 (by test): \result FROM min; max [from] call to memcpy at tests/builtins/memcpy_invalid.c:17 (by test): dst FROM src \result FROM dest [from] call to test at tests/builtins/memcpy_invalid.c:22 (by main): NON TERMINATING - NO EFFECTS [from] call to test at tests/builtins/memcpy_invalid.c:23 (by main): NON TERMINATING - NO EFFECTS [from] entry point: \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== ����������������������frama-c-20.0-Calcium/tests/builtins/oracle/memexec-malloc.res.oracle��������������������������������0000666�0000000�0000000�00000011246�13571573400�022326� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/memexec-malloc.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/builtins/memexec-malloc.c:15: Warning: Calling undeclared function Frama_C_malloc_by_stack. Old style K&R code? [kernel:annot:missing-spec] tests/builtins/memexec-malloc.c:22: Warning: Neither code nor specification for function Frama_C_malloc_by_stack, generating default assigns from the prototype [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..1999] ∈ {0} [eva] computing for function f <- main. Called from tests/builtins/memexec-malloc.c:23. [eva] tests/builtins/memexec-malloc.c:10: starting to merge loop iterations [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/builtins/memexec-malloc.c:24. [eva] Recording results for f [eva] Done for function f [eva] tests/builtins/memexec-malloc.c:25: Reusing old results for call to f [eva] tests/builtins/memexec-malloc.c:26: Frama_C_show_each: [0..1999] [eva] tests/builtins/memexec-malloc.c:27: Frama_C_show_each: [0..1999] [eva] tests/builtins/memexec-malloc.c:28: Frama_C_show_each: [0..1999] [eva] tests/builtins/memexec-malloc.c:29: Reusing old results for call to f [eva] computing for function alloc <- main. Called from tests/builtins/memexec-malloc.c:31. [eva] tests/builtins/memexec-malloc.c:15: Call to builtin Frama_C_malloc_by_stack [eva] tests/builtins/memexec-malloc.c:15: allocating variable __malloc_main_l31 [eva] Recording results for alloc [eva] Done for function alloc [eva] computing for function alloc <- main. Called from tests/builtins/memexec-malloc.c:32. [eva] tests/builtins/memexec-malloc.c:15: Call to builtin Frama_C_malloc_by_stack [eva] tests/builtins/memexec-malloc.c:15: allocating variable __malloc_main_l32 [eva] Recording results for alloc [eva] Done for function alloc [eva] computing for function k <- main. Called from tests/builtins/memexec-malloc.c:34. [eva] computing for function alloc <- k <- main. Called from tests/builtins/memexec-malloc.c:19. [eva] tests/builtins/memexec-malloc.c:15: Call to builtin Frama_C_malloc_by_stack [eva] tests/builtins/memexec-malloc.c:15: allocating variable __malloc_k_l19 [eva] Recording results for alloc [eva] Done for function alloc [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- main. Called from tests/builtins/memexec-malloc.c:35. [eva] computing for function alloc <- k <- main. Called from tests/builtins/memexec-malloc.c:19. [eva] tests/builtins/memexec-malloc.c:15: Call to builtin Frama_C_malloc_by_stack [eva] tests/builtins/memexec-malloc.c:15: allocating variable __malloc_k_l19_0 [eva] Recording results for alloc [eva] Done for function alloc [eva] Recording results for k [eva] Done for function k [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function alloc: __retres ∈ {{ &__malloc_main_l31 ; &__malloc_main_l32 ; &__malloc_k_l19 ; &__malloc_k_l19_0 }} [eva:final-states] Values at end of function f: t[0..1999] ∈ [0..1999] i ∈ {2000} [eva:final-states] Values at end of function k: [eva:final-states] Values at end of function main: t[0..1999] ∈ [0..1999] p1 ∈ {{ &__malloc_main_l31 }} p2 ∈ {{ &__malloc_main_l32 }} p3 ∈ {{ &__malloc_k_l19 }} p4 ∈ {{ &__malloc_k_l19_0 }} [from] Computing for function alloc [from] Computing for function Frama_C_malloc_by_stack <-alloc [from] Done for function Frama_C_malloc_by_stack [from] Done for function alloc [from] Computing for function f [from] Done for function f [from] Computing for function k [from] Done for function k [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_malloc_by_stack: \result FROM x_0 [from] Function alloc: \result FROM \nothing [from] Function f: t[0..1999] FROM \nothing (and SELF) [from] Function k: \result FROM \nothing [from] Function main: t[0..1999] FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function alloc: tmp; __retres [inout] Inputs for function alloc: \nothing [inout] Out (internal) for function f: t[0..1999]; i [inout] Inputs for function f: \nothing [inout] Out (internal) for function k: tmp [inout] Inputs for function k: \nothing [inout] Out (internal) for function main: t[0..1999]; p1; p2; p3; p4 [inout] Inputs for function main: t[1..2] ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/memset.res.oracle����������������������������������������0000666�0000000�0000000�00000020720�13571573400�020725� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/memset.c (with preprocessing) [kernel] tests/builtins/memset.c:46: Warning: A.QUESTION: char * does not match int * (different integer types: 'char' and 'int') [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t1[0..99] ∈ {0} t2[0..99] ∈ {0} t3[0..99] ∈ {0} t4[0..99] ∈ {0} t5[0..99] ∈ {0} t6[0..99] ∈ {0} t7[0..99] ∈ {0} t8[0..99] ∈ {0} t9[0..99] ∈ {0} t10[0..99] ∈ {0} t11[0..99] ∈ {0} t12[0..99] ∈ {0} ts[0..4] ∈ {0} vol ∈ [--..--] [eva] tests/builtins/memset.c:33: Call to builtin memset [eva] tests/builtins/memset.c:33: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] tests/builtins/memset.c:34: Call to builtin memset [eva:alarm] tests/builtins/memset.c:34: Warning: function memset: precondition 'valid_s' got status unknown. [eva:imprecision] tests/builtins/memset.c:34: Call to builtin precise_memset(({{ garbled mix of &{t2} (origin: Arithmetic {tests/builtins/memset.c:34}) }},{18}, {400})) failed; destination is not exact [eva] tests/builtins/memset.c:35: Call to builtin memset [eva:alarm] tests/builtins/memset.c:35: Warning: function memset: precondition 'valid_s' got status unknown. [eva:imprecision] tests/builtins/memset.c:35: Call to builtin precise_memset(({{ (void *)&t3[10] }},{17}, {{ (unsigned int)&t1 }})) failed; size is imprecise [eva] tests/builtins/memset.c:38: Call to builtin memset [eva:alarm] tests/builtins/memset.c:38: Warning: function memset: precondition 'valid_s' got status invalid. [eva] tests/builtins/memset.c:41: Call to builtin memset [eva] tests/builtins/memset.c:41: function memset: precondition 'valid_s' got status valid. [eva:imprecision] tests/builtins/memset.c:41: Call to builtin precise_memset(({{ (void *)&t5 }},{{ (int)&t1 }},{400})) failed; value to write is imprecise [eva] tests/builtins/memset.c:44: Call to builtin memset [eva] tests/builtins/memset.c:44: function memset: precondition 'valid_s' got status valid. [eva:imprecision] tests/builtins/memset.c:44: Call to builtin precise_memset(({{ (void *)&t6[10] ; (void *)&t7 }},{34}, {16})) failed; destination is not exact [eva] tests/builtins/memset.c:47: Call to builtin memset [eva:alarm] tests/builtins/memset.c:47: Warning: function memset: precondition 'valid_s' got status unknown. [eva:imprecision] tests/builtins/memset.c:47: Call to builtin precise_memset(({{ NULL ; (void *)&t8 }},{34},{16})) failed; destination is not exact [eva] tests/builtins/memset.c:50: starting to merge loop iterations [eva] tests/builtins/memset.c:54: Call to builtin memset [eva:alarm] tests/builtins/memset.c:54: Warning: function memset: precondition 'valid_s' got status unknown. [eva:imprecision] tests/builtins/memset.c:54: Call to builtin precise_memset(({{ &t9 + [80..--],0%4 }},{2302},{4})) failed; destination is not exact [eva] tests/builtins/memset.c:58: Call to builtin memset [eva] tests/builtins/memset.c:58: function memset: precondition 'valid_s' got status valid. [eva:imprecision] tests/builtins/memset.c:58: Call to builtin precise_memset(({{ (void *)&t10[4] }},{136},{12; 36})) failed; size is imprecise [eva] tests/builtins/memset.c:65: Call to builtin memset [eva] tests/builtins/memset.c:65: function memset: precondition 'valid_s' got status valid. [eva:imprecision] tests/builtins/memset.c:65: Call to builtin precise_memset(({{ (void *)&t11{[2], [3]} }},{153},{8; 16})) failed; size is imprecise [eva] tests/builtins/memset.c:68: Call to builtin memset [eva] tests/builtins/memset.c:68: function memset: precondition 'valid_s' got status valid. [eva:alarm] tests/builtins/memset.c:71: Warning: assertion 'Assume' got status unknown. [eva] tests/builtins/memset.c:72: Call to builtin memset [eva] tests/builtins/memset.c:72: function memset: precondition 'valid_s' got status valid. [eva:imprecision] tests/builtins/memset.c:72: Call to builtin precise_memset(({{ &t12 + [0..384],0%32 }},{1},{4})) failed; destination is not exact [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t1[0..99] ∈ {286331153} t2[0..99] ∈ [--..--] t3[0..9] ∈ {0} [10..99]# ∈ {0; 17} repeated %8 t4[0..99] ∈ {0} t5[0..99] ∈ {{ garbled mix of &{t1} (origin: Misaligned {tests/builtins/memset.c:41}) }} t6[0..9] ∈ {0} [10..13]# ∈ {0; 34} repeated %8 [14..99] ∈ {0} t7[0..3]# ∈ {0; 34} repeated %8 [4..99] ∈ {0} t8[0..3]# ∈ {0; 34} repeated %8 [4..99] ∈ {0} t9[0..19] ∈ {0} [20..99]# ∈ {0; 254} repeated %8 t10[0..3] ∈ {0} [4..6]# ∈ {136} repeated %8 [7..12]# ∈ {0; 136} repeated %8 [13..99] ∈ {0} t11[0..1] ∈ {0} [2]# ∈ {0; 153} repeated %8 [3]# ∈ {153} repeated %8 [4..6]# ∈ {0; 153} repeated %8 [7..99] ∈ {0} t12[0..96]# ∈ {0; 1} repeated %8 [97..99] ∈ {0} ts[0].f1 ∈ {-2; 0} [0].[bits 8 to 15] ∈ {0; 254} [0].f2 ∈ {-258; 0} [0]{.f3; .f4[0..2]} ∈ {-16843010; 0} [1].f1 ∈ {-2; 0} [1].[bits 8 to 15] ∈ {0; 254} [1].f2 ∈ {-258; 0} [1]{.f3; .f4[0..2]} ∈ {-16843010; 0} [2].f1 ∈ {-2; 0} [2].[bits 8 to 15] ∈ {0; 254} [2].f2 ∈ {-258; 0} [2]{.f3; .f4[0..2]} ∈ {-16843010; 0} [3].f1 ∈ {-2; 0} [3].[bits 8 to 15] ∈ {0; 254} [3].f2 ∈ {-258; 0} [3]{.f3; .f4[0..2]} ∈ {-16843010; 0} [4].f1 ∈ {-2; 0} [4].[bits 8 to 15] ∈ {0; 254} [4].f2 ∈ {-258; 0} [4]{.f3; .f4[0..2]} ∈ {-16843010; 0} dst ∈ {{ (void *)&t1 }} p ∈ {{ &t11{[2], [3]} }} s ∈ {12; 36} s1 ∈ {8; 16} k ∈ [0..12] [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to memset at tests/builtins/memset.c:33 (by main): t1[0..99] FROM c \result FROM s [from] call to memset at tests/builtins/memset.c:34 (by main): t2[0..99] FROM c (and SELF) \result FROM s [from] call to memset at tests/builtins/memset.c:35 (by main): t3[10..99] FROM c (and SELF) \result FROM s [from] call to memset at tests/builtins/memset.c:38 (by main): t4[1..99] FROM c \result FROM s [from] call to memset at tests/builtins/memset.c:41 (by main): t5[0..99] FROM c \result FROM s [from] call to memset at tests/builtins/memset.c:44 (by main): t6[10..13] FROM c (and SELF) t7[0..3] FROM c (and SELF) \result FROM s [from] call to memset at tests/builtins/memset.c:47 (by main): t8[0..3] FROM c (and SELF) \result FROM s [from] call to memset at tests/builtins/memset.c:54 (by main): t9[20..99] FROM c (and SELF) \result FROM s [from] call to memset at tests/builtins/memset.c:58 (by main): t10[4..6] FROM c [7..12] FROM c (and SELF) \result FROM s [from] call to memset at tests/builtins/memset.c:65 (by main): t11{[2]; [4..6]} FROM c (and SELF) [3] FROM c \result FROM s [from] call to memset at tests/builtins/memset.c:68 (by main): ts[0..4] FROM c \result FROM s [from] call to memset at tests/builtins/memset.c:72 (by main): t12[0..96] FROM c (and SELF) \result FROM s [from] entry point: t1[0..99] FROM \nothing t2[0..99] FROM \nothing (and SELF) t3[10..99] FROM \nothing (and SELF) t4[1..99] FROM vol (and SELF) t5[0..99] FROM \nothing t6[10..13] FROM \nothing (and SELF) t7[0..3] FROM \nothing (and SELF) t8[0..3] FROM \nothing (and SELF) t9[20..99] FROM \nothing (and SELF) t10[4..6] FROM \nothing [7..12] FROM \nothing (and SELF) t11{[2]; [4..6]} FROM \nothing (and SELF) [3] FROM \nothing t12[0..96] FROM \nothing (and SELF) ts[0..4] FROM vol (and SELF) [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function main: t1[0..99]; t2[0..99]; t3[10..99]; t4[1..99]; t5[0..99]; t6[10..13]; t7[0..3]; t8[0..3]; t9[20..99]; t10[4..12]; t11[2..6]; t12[0..96]; ts[0..4]; dst; p; tmp_0; s; s1; k [inout] Inputs for function main: vol [inout] InOut (internal) for function main: Operational inputs: vol Operational inputs on termination: vol Sure outputs: t1[0..99]; t5[0..99]; t10[4..6]; t11[3]; dst; p; tmp_0; s; s1; k ������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/memset_block.0.res.oracle��������������������������������0000666�0000000�0000000�00000005615�13571573400�022243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/memset_block.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: S[0] ∈ {49} [1] ∈ {50} [2] ∈ {51} [3] ∈ {52} [4] ∈ {53} TS[0].x ∈ {1} [0].y ∈ {3} [0].name[0] ∈ {175304776} {[0].name[1..9]; [1..28]} ∈ {0} PC[0] ∈ {108} [1] ∈ {107} [2] ∈ {106} [3] ∈ {108} [4] ∈ {106} [5] ∈ {0} T2[0].x2 ∈ {1} [0].y2 ∈ {2} [0].[bits 48 to 63] ∈ {0} [0].ptr ∈ {{ &PC[0] }} [1].x2 ∈ {1} [1].y2 ∈ {2} {[1]{.ptr; .[bits 48 to 63]}; [2..49]} ∈ {0} T[0] ∈ {1} [1..9] ∈ {0} U[0] ∈ {3} [1] ∈ {4} x ∈ {8} y ∈ {40} __retres ∈ {8} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: S[0..4]; TS[0..28]; PC[0..5]; T2{[0]{.x2; .y2}; {[0].ptr; [1]{.x2; .y2}}; {[1].ptr; [2]{.x2; .y2}}; {[2].ptr; [3]{.x2; .y2}}; {[3].ptr; [4]{.x2; .y2}}; {[4].ptr; [5]{.x2; .y2}}; {[5].ptr; [6]{.x2; .y2}}; {[6].ptr; [7]{.x2; .y2}}; {[7].ptr; [8]{.x2; .y2}}; {[8].ptr; [9]{.x2; .y2}}; {[9].ptr; [10]{.x2; .y2}}; {[10].ptr; [11]{.x2; .y2}}; {[11].ptr; [12]{.x2; .y2}}; {[12].ptr; [13]{.x2; .y2}}; {[13].ptr; [14]{.x2; .y2}}; {[14].ptr; [15]{.x2; .y2}}; {[15].ptr; [16]{.x2; .y2}}; {[16].ptr; [17]{.x2; .y2}}; {[17].ptr; [18]{.x2; .y2}}; {[18].ptr; [19]{.x2; .y2}}; {[19].ptr; [20]{.x2; .y2}}; {[20].ptr; [21]{.x2; .y2}}; {[21].ptr; [22]{.x2; .y2}}; {[22].ptr; [23]{.x2; .y2}}; {[23].ptr; [24]{.x2; .y2}}; {[24].ptr; [25]{.x2; .y2}}; {[25].ptr; [26]{.x2; .y2}}; {[26].ptr; [27]{.x2; .y2}}; {[27].ptr; [28]{.x2; .y2}}; {[28].ptr; [29]{.x2; .y2}}; {[29].ptr; [30]{.x2; .y2}}; {[30].ptr; [31]{.x2; .y2}}; {[31].ptr; [32]{.x2; .y2}}; {[32].ptr; [33]{.x2; .y2}}; {[33].ptr; [34]{.x2; .y2}}; {[34].ptr; [35]{.x2; .y2}}; {[35].ptr; [36]{.x2; .y2}}; {[36].ptr; [37]{.x2; .y2}}; {[37].ptr; [38]{.x2; .y2}}; {[38].ptr; [39]{.x2; .y2}}; {[39].ptr; [40]{.x2; .y2}}; {[40].ptr; [41]{.x2; .y2}}; {[41].ptr; [42]{.x2; .y2}}; {[42].ptr; [43]{.x2; .y2}}; {[43].ptr; [44]{.x2; .y2}}; {[44].ptr; [45]{.x2; .y2}}; {[45].ptr; [46]{.x2; .y2}}; {[46].ptr; [47]{.x2; .y2}}; {[47].ptr; [48]{.x2; .y2}}; {[48].ptr; [49]{.x2; .y2}}; [49].ptr}; T[0..9]; U[0..1]; x; y; __retres [inout] Inputs for function main: \nothing �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/memset_block.1.res.oracle��������������������������������0000666�0000000�0000000�00000015352�13571573400�022243� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/memset_block.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: S[0] ∈ {49} [1] ∈ {50} [2] ∈ {51} [3] ∈ {52} [4] ∈ {53} TS[0].x ∈ {1} [0].y ∈ {3} [0].name[0] ∈ {175304776} {[0].name[1..9]; [1..28]} ∈ {0} PC[0] ∈ {108} [1] ∈ {107} [2] ∈ {106} [3] ∈ {108} [4] ∈ {106} [5] ∈ {0} T2[0].x2 ∈ {1} [0].y2 ∈ {2} [0].[bits 48 to 63] ∈ UNINITIALIZED [0].ptr ∈ {{ &PC[0] }} [1].x2 ∈ {1} [1].y2 ∈ {2} [1].[bits 48 to 63] ∈ UNINITIALIZED {[1].ptr; [2]{.x2; .y2}} ∈ {0} [2].[bits 48 to 63] ∈ UNINITIALIZED {[2].ptr; [3]{.x2; .y2}} ∈ {0} [3].[bits 48 to 63] ∈ UNINITIALIZED {[3].ptr; [4]{.x2; .y2}} ∈ {0} [4].[bits 48 to 63] ∈ UNINITIALIZED {[4].ptr; [5]{.x2; .y2}} ∈ {0} [5].[bits 48 to 63] ∈ UNINITIALIZED {[5].ptr; [6]{.x2; .y2}} ∈ {0} [6].[bits 48 to 63] ∈ UNINITIALIZED {[6].ptr; [7]{.x2; .y2}} ∈ {0} [7].[bits 48 to 63] ∈ UNINITIALIZED {[7].ptr; [8]{.x2; .y2}} ∈ {0} [8].[bits 48 to 63] ∈ UNINITIALIZED {[8].ptr; [9]{.x2; .y2}} ∈ {0} [9].[bits 48 to 63] ∈ UNINITIALIZED {[9].ptr; [10]{.x2; .y2}} ∈ {0} [10].[bits 48 to 63] ∈ UNINITIALIZED {[10].ptr; [11]{.x2; .y2}} ∈ {0} [11].[bits 48 to 63] ∈ UNINITIALIZED {[11].ptr; [12]{.x2; .y2}} ∈ {0} [12].[bits 48 to 63] ∈ UNINITIALIZED {[12].ptr; [13]{.x2; .y2}} ∈ {0} [13].[bits 48 to 63] ∈ UNINITIALIZED {[13].ptr; [14]{.x2; .y2}} ∈ {0} [14].[bits 48 to 63] ∈ UNINITIALIZED {[14].ptr; [15]{.x2; .y2}} ∈ {0} [15].[bits 48 to 63] ∈ UNINITIALIZED {[15].ptr; [16]{.x2; .y2}} ∈ {0} [16].[bits 48 to 63] ∈ UNINITIALIZED {[16].ptr; [17]{.x2; .y2}} ∈ {0} [17].[bits 48 to 63] ∈ UNINITIALIZED {[17].ptr; [18]{.x2; .y2}} ∈ {0} [18].[bits 48 to 63] ∈ UNINITIALIZED {[18].ptr; [19]{.x2; .y2}} ∈ {0} [19].[bits 48 to 63] ∈ UNINITIALIZED {[19].ptr; [20]{.x2; .y2}} ∈ {0} [20].[bits 48 to 63] ∈ UNINITIALIZED {[20].ptr; [21]{.x2; .y2}} ∈ {0} [21].[bits 48 to 63] ∈ UNINITIALIZED {[21].ptr; [22]{.x2; .y2}} ∈ {0} [22].[bits 48 to 63] ∈ UNINITIALIZED {[22].ptr; [23]{.x2; .y2}} ∈ {0} [23].[bits 48 to 63] ∈ UNINITIALIZED {[23].ptr; [24]{.x2; .y2}} ∈ {0} [24].[bits 48 to 63] ∈ UNINITIALIZED {[24].ptr; [25]{.x2; .y2}} ∈ {0} [25].[bits 48 to 63] ∈ UNINITIALIZED {[25].ptr; [26]{.x2; .y2}} ∈ {0} [26].[bits 48 to 63] ∈ UNINITIALIZED {[26].ptr; [27]{.x2; .y2}} ∈ {0} [27].[bits 48 to 63] ∈ UNINITIALIZED {[27].ptr; [28]{.x2; .y2}} ∈ {0} [28].[bits 48 to 63] ∈ UNINITIALIZED {[28].ptr; [29]{.x2; .y2}} ∈ {0} [29].[bits 48 to 63] ∈ UNINITIALIZED {[29].ptr; [30]{.x2; .y2}} ∈ {0} [30].[bits 48 to 63] ∈ UNINITIALIZED {[30].ptr; [31]{.x2; .y2}} ∈ {0} [31].[bits 48 to 63] ∈ UNINITIALIZED {[31].ptr; [32]{.x2; .y2}} ∈ {0} [32].[bits 48 to 63] ∈ UNINITIALIZED {[32].ptr; [33]{.x2; .y2}} ∈ {0} [33].[bits 48 to 63] ∈ UNINITIALIZED {[33].ptr; [34]{.x2; .y2}} ∈ {0} [34].[bits 48 to 63] ∈ UNINITIALIZED {[34].ptr; [35]{.x2; .y2}} ∈ {0} [35].[bits 48 to 63] ∈ UNINITIALIZED {[35].ptr; [36]{.x2; .y2}} ∈ {0} [36].[bits 48 to 63] ∈ UNINITIALIZED {[36].ptr; [37]{.x2; .y2}} ∈ {0} [37].[bits 48 to 63] ∈ UNINITIALIZED {[37].ptr; [38]{.x2; .y2}} ∈ {0} [38].[bits 48 to 63] ∈ UNINITIALIZED {[38].ptr; [39]{.x2; .y2}} ∈ {0} [39].[bits 48 to 63] ∈ UNINITIALIZED {[39].ptr; [40]{.x2; .y2}} ∈ {0} [40].[bits 48 to 63] ∈ UNINITIALIZED {[40].ptr; [41]{.x2; .y2}} ∈ {0} [41].[bits 48 to 63] ∈ UNINITIALIZED {[41].ptr; [42]{.x2; .y2}} ∈ {0} [42].[bits 48 to 63] ∈ UNINITIALIZED {[42].ptr; [43]{.x2; .y2}} ∈ {0} [43].[bits 48 to 63] ∈ UNINITIALIZED {[43].ptr; [44]{.x2; .y2}} ∈ {0} [44].[bits 48 to 63] ∈ UNINITIALIZED {[44].ptr; [45]{.x2; .y2}} ∈ {0} [45].[bits 48 to 63] ∈ UNINITIALIZED {[45].ptr; [46]{.x2; .y2}} ∈ {0} [46].[bits 48 to 63] ∈ UNINITIALIZED {[46].ptr; [47]{.x2; .y2}} ∈ {0} [47].[bits 48 to 63] ∈ UNINITIALIZED {[47].ptr; [48]{.x2; .y2}} ∈ {0} [48].[bits 48 to 63] ∈ UNINITIALIZED {[48].ptr; [49]{.x2; .y2}} ∈ {0} [49].[bits 48 to 63] ∈ UNINITIALIZED [49].ptr ∈ {0} T[0] ∈ {1} [1..9] ∈ {0} U[0] ∈ {3} [1] ∈ {4} x ∈ {8} y ∈ {40} __retres ∈ {8} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: S[0..4]; TS[0..28]; PC[0..5]; T2{[0]{.x2; .y2}; {[0].ptr; [1]{.x2; .y2}}; {[1].ptr; [2]{.x2; .y2}}; {[2].ptr; [3]{.x2; .y2}}; {[3].ptr; [4]{.x2; .y2}}; {[4].ptr; [5]{.x2; .y2}}; {[5].ptr; [6]{.x2; .y2}}; {[6].ptr; [7]{.x2; .y2}}; {[7].ptr; [8]{.x2; .y2}}; {[8].ptr; [9]{.x2; .y2}}; {[9].ptr; [10]{.x2; .y2}}; {[10].ptr; [11]{.x2; .y2}}; {[11].ptr; [12]{.x2; .y2}}; {[12].ptr; [13]{.x2; .y2}}; {[13].ptr; [14]{.x2; .y2}}; {[14].ptr; [15]{.x2; .y2}}; {[15].ptr; [16]{.x2; .y2}}; {[16].ptr; [17]{.x2; .y2}}; {[17].ptr; [18]{.x2; .y2}}; {[18].ptr; [19]{.x2; .y2}}; {[19].ptr; [20]{.x2; .y2}}; {[20].ptr; [21]{.x2; .y2}}; {[21].ptr; [22]{.x2; .y2}}; {[22].ptr; [23]{.x2; .y2}}; {[23].ptr; [24]{.x2; .y2}}; {[24].ptr; [25]{.x2; .y2}}; {[25].ptr; [26]{.x2; .y2}}; {[26].ptr; [27]{.x2; .y2}}; {[27].ptr; [28]{.x2; .y2}}; {[28].ptr; [29]{.x2; .y2}}; {[29].ptr; [30]{.x2; .y2}}; {[30].ptr; [31]{.x2; .y2}}; {[31].ptr; [32]{.x2; .y2}}; {[32].ptr; [33]{.x2; .y2}}; {[33].ptr; [34]{.x2; .y2}}; {[34].ptr; [35]{.x2; .y2}}; {[35].ptr; [36]{.x2; .y2}}; {[36].ptr; [37]{.x2; .y2}}; {[37].ptr; [38]{.x2; .y2}}; {[38].ptr; [39]{.x2; .y2}}; {[39].ptr; [40]{.x2; .y2}}; {[40].ptr; [41]{.x2; .y2}}; {[41].ptr; [42]{.x2; .y2}}; {[42].ptr; [43]{.x2; .y2}}; {[43].ptr; [44]{.x2; .y2}}; {[44].ptr; [45]{.x2; .y2}}; {[45].ptr; [46]{.x2; .y2}}; {[46].ptr; [47]{.x2; .y2}}; {[47].ptr; [48]{.x2; .y2}}; {[48].ptr; [49]{.x2; .y2}}; [49].ptr}; T[0..9]; U[0..1]; x; y; __retres [inout] Inputs for function main: \nothing ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/memset_malloc_0.res.oracle�������������������������������0000666�0000000�0000000�00000003262�13571573400�022475� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/memset_malloc_0.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} [eva] tests/builtins/memset_malloc_0.c:17: Call to builtin malloc [eva] tests/builtins/memset_malloc_0.c:17: allocating variable __malloc_main_l17 [eva] tests/builtins/memset_malloc_0.c:18: Call to builtin memset [eva] tests/builtins/memset_malloc_0.c:18: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] p ∈ {{ &__malloc_main_l17[0] }} __retres ∈ {0} [from] Computing for function main [from] Computing for function malloc <-main [from] Done for function malloc [from] Computing for function memset <-main [from] Done for function memset [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function memset: \result FROM s [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) p FROM __fc_heap_status \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; p; __retres [inout] Inputs for function main: __fc_heap_status; p ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/precise_memset.res.oracle��������������������������������0000666�0000000�0000000�00000023626�13571573400�022447� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/precise_memset.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] x ∈ {0} t[0..49] ∈ {0} u[0..11] ∈ {0} f ∈ {0} fnan ∈ {0} d ∈ {0} dnan ∈ {0} w1[0..3] ∈ {0} w2[0..3] ∈ {0} bitf ∈ {0} tone[0] ∈ {0} vs ∈ {0} vv ∈ {0} t_b[0..1023] ∈ {0} t_s[0..1023] ∈ {0} [eva] tests/builtins/precise_memset.c:72: Call to builtin memset [eva] tests/builtins/precise_memset.c:72: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] tests/builtins/precise_memset.c:73: Call to builtin memset [eva] tests/builtins/precise_memset.c:73: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:74: Call to builtin memset [eva] tests/builtins/precise_memset.c:74: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:75: Call to builtin memset [eva] tests/builtins/precise_memset.c:75: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:76: Call to builtin memset [eva] tests/builtins/precise_memset.c:76: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:77: Call to builtin memset [eva] tests/builtins/precise_memset.c:77: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:78: Call to builtin memset [eva] tests/builtins/precise_memset.c:78: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:79: Call to builtin memset [eva] tests/builtins/precise_memset.c:79: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:80: Call to builtin memset [eva] tests/builtins/precise_memset.c:80: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:81: Call to builtin memset [eva] tests/builtins/precise_memset.c:81: function memset: precondition 'valid_s' got status valid. [eva:alarm] tests/builtins/precise_memset.c:84: Warning: assertion got status unknown. [eva] tests/builtins/precise_memset.c:85: Call to builtin memset [eva] tests/builtins/precise_memset.c:85: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:87: Call to builtin memset [eva] tests/builtins/precise_memset.c:87: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:88: Call to builtin memset [eva] tests/builtins/precise_memset.c:88: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:89: Call to builtin memset [eva] tests/builtins/precise_memset.c:89: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:90: Call to builtin memset [eva] tests/builtins/precise_memset.c:90: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:91: Call to builtin memset [eva] tests/builtins/precise_memset.c:91: function memset: precondition 'valid_s' got status valid. [eva] tests/builtins/precise_memset.c:92: Call to builtin memset [eva] tests/builtins/precise_memset.c:92: function memset: precondition 'valid_s' got status valid. [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {33686018} t[0..14] ∈ {771} [15..34] ∈ {1799} [35..49] ∈ {771} u[0..11] ∈ {-1701143910} f ∈ {9.55146781436e-38} fnan ∈ {4294967295} d ∈ {5.37794075127e-299} dnan ∈ {18446744073709551615} w1[0].s ∈ {514} [0].[bits 16 to 31]# ∈ {2} repeated %8 [0].i ∈ {33686018} [0]{.c; .[bits 72 to 95]#} ∈ {2} repeated %8 [1].s ∈ {514} [1].[bits 16 to 31]# ∈ {2} repeated %8 [1].i ∈ {33686018} [1]{.c; .[bits 72 to 95]#} ∈ {2} repeated %8 [2].s ∈ {514} [2].[bits 16 to 31]# ∈ {2} repeated %8 [2].i ∈ {33686018} [2]{.c; .[bits 72 to 95]#} ∈ {2} repeated %8 [3].s ∈ {514} [3].[bits 16 to 31]# ∈ {2} repeated %8 [3].i ∈ {33686018} [3]{.c; .[bits 72 to 95]#} ∈ {2} repeated %8 w2[0].s ∈ {257; 514; 771; 1028; 1285; 1542; 1799; 2056} [0].[bits 16 to 31]# ∈ {1; 2; 3; 4; 5; 6; 7; 8} repeated %8 [0].i ∈ {16843009; 33686018; 50529027; 67372036; 84215045; 101058054; 117901063; 134744072} [0]{.c; .[bits 72 to 95]#} ∈ {1; 2; 3; 4; 5; 6; 7; 8} repeated %8 [1].s ∈ {257; 514; 771; 1028; 1285; 1542; 1799; 2056} [1].[bits 16 to 31]# ∈ {1; 2; 3; 4; 5; 6; 7; 8} repeated %8 [1].i ∈ {16843009; 33686018; 50529027; 67372036; 84215045; 101058054; 117901063; 134744072} [1]{.c; .[bits 72 to 95]#} ∈ {1; 2; 3; 4; 5; 6; 7; 8} repeated %8 [2].s ∈ {257; 514; 771; 1028; 1285; 1542; 1799; 2056} [2].[bits 16 to 31]# ∈ {1; 2; 3; 4; 5; 6; 7; 8} repeated %8 [2].i ∈ {16843009; 33686018; 50529027; 67372036; 84215045; 101058054; 117901063; 134744072} [2]{.c; .[bits 72 to 95]#} ∈ {1; 2; 3; 4; 5; 6; 7; 8} repeated %8 [3].s ∈ {257; 514; 771; 1028; 1285; 1542; 1799; 2056} [3].[bits 16 to 31]# ∈ {1; 2; 3; 4; 5; 6; 7; 8} repeated %8 [3].i ∈ {16843009; 33686018; 50529027; 67372036; 84215045; 101058054; 117901063; 134744072} [3]{.c; .[bits 72 to 95]#} ∈ {1; 2; 3; 4; 5; 6; 7; 8} repeated %8 bitf.i1 ∈ {-2} .i2 ∈ {7} {.i3; .[bits 6 to 7]#} ∈ {126} repeated %8, bits 6 to 15 .i4 ∈ {126} .i5 ∈ {252} {.i6; .[bits 31 to 31]#} ∈ {126} repeated %8, bits 7 to 15 .i7 ∈ {0} .i8 ∈ {1} {.i9; .i10} ∈ {-1} {.i11; .i12} ∈ {1} .i13 ∈ {-1} .i14 ∈ {0} .[bits 48 to 63]# ∈ {126} repeated %8 tone[0] ∈ {101058054} vs.c1 ∈ {1028} .[bits 16 to 31] ∈ {0} .t[0..9] ∈ {33686018} {.c2; .[bits 360 to 383]} ∈ {0} vv.c3.s ∈ {1542} {.c3{.i; .c; .[bits 16 to 31]; .[bits 72 to 95]}; .c4} ∈ {0} t_b[0..1023] ∈ {5} t_s[0..1023] ∈ {4883} n ∈ {1; 2; 3; 4; 5; 6; 7; 8} [from] Computing for function main [from] Computing for function memset <-main [from] Done for function memset [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function memset: x FROM c (and SELF) t[0..49] FROM c (and SELF) u[0..11] FROM c (and SELF) f FROM c (and SELF) fnan FROM c (and SELF) d FROM c (and SELF) dnan FROM c (and SELF) w1[0..3] FROM c (and SELF) w2[0..3] FROM c (and SELF) bitf FROM c (and SELF) tone[0] FROM c (and SELF) vs FROM c (and SELF) vv FROM c (and SELF) t_b[0..1023] FROM c (and SELF) t_s[0..1023] FROM c (and SELF) \result FROM s [from] Function main: x FROM v (and SELF) t[0..49] FROM v (and SELF) u[0..11] FROM v (and SELF) f FROM v (and SELF) fnan FROM v (and SELF) d FROM v (and SELF) dnan FROM v (and SELF) w1[0..3] FROM v (and SELF) w2[0..3] FROM v (and SELF) bitf FROM v (and SELF) tone[0] FROM v (and SELF) vs FROM v (and SELF) vv FROM v (and SELF) t_b[0..1023] FROM v (and SELF) t_s[0..1023] FROM v (and SELF) [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to memset at tests/builtins/precise_memset.c:72 (by main): x FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:73 (by main): t[0..49] FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:74 (by main): u[0..11] FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:75 (by main): f FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:76 (by main): fnan FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:77 (by main): d FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:78 (by main): dnan FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:79 (by main): w1[0..3] FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:80 (by main): bitf FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:81 (by main): tone[0] FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:85 (by main): w2[0..3] FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:87 (by main): vs.c1 FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:88 (by main): vs.t[0..9] FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:89 (by main): vv.c3.s FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:90 (by main): t[15..34] FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:91 (by main): t_b[0..1023] FROM c \result FROM s [from] call to memset at tests/builtins/precise_memset.c:92 (by main): t_s[0..1023] FROM c \result FROM s [from] entry point: x FROM \nothing t[0..49] FROM \nothing u[0..11] FROM \nothing f FROM \nothing fnan FROM \nothing d FROM \nothing dnan FROM \nothing w1[0..3] FROM \nothing w2[0..3] FROM v bitf FROM \nothing tone[0] FROM \nothing vs{.c1; .t[0..9]} FROM \nothing vv.c3.s FROM \nothing t_b[0..1023] FROM \nothing t_s[0..1023] FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function main: x; t[0..49]; u[0..11]; f; fnan; d; dnan; w1[0..3]; w2[0..3]; bitf; tone[0]; vs{.c1; .t[0..9]}; vv.c3.s; t_b[0..1023]; t_s[0..1023]; n [inout] Inputs for function main: v ����������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/realloc.res.oracle���������������������������������������0000666�0000000�0000000�00000112671�13571573400�021063� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/realloc.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/builtins/realloc.c:160. [eva] tests/builtins/realloc.c:12: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:12: allocating variable __malloc_main1_l12 [eva] tests/builtins/realloc.c:15: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main1_l12 }} pp ∈ {{ &__malloc_main1_l12 }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main1_l12 ∈ {17} ==END OF DUMP== [eva] tests/builtins/realloc.c:16: Call to builtin realloc [eva] tests/builtins/realloc.c:16: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main1_l12} [eva] tests/builtins/realloc.c:16: allocating variable __realloc_main1_l16 [eva:malloc] tests/builtins/realloc.c:16: strong free on bases: {__malloc_main1_l12} [eva] tests/builtins/realloc.c:17: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ ESCAPINGADDR pp ∈ ESCAPINGADDR q ∈ {{ &__realloc_main1_l16[0] }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __realloc_main1_l16[0] ∈ {17} [1] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/realloc.c:18: Call to builtin free [eva] tests/builtins/realloc.c:18: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:18: strong free on bases: {__realloc_main1_l16} [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/builtins/realloc.c:161. [eva] computing for function Frama_C_interval <- main2 <- main. Called from tests/builtins/realloc.c:22. [eva] using specification for function Frama_C_interval [eva] tests/builtins/realloc.c:22: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc.c:23: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:23: allocating variable __malloc_main2_l23 [eva:alarm] tests/builtins/realloc.c:24: Warning: out of bounds write. assert \valid(r + i); [eva] tests/builtins/realloc.c:26: Call to builtin realloc [eva] tests/builtins/realloc.c:26: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main2_l23} [eva] tests/builtins/realloc.c:26: allocating variable __realloc_main2_l26 [eva:malloc] tests/builtins/realloc.c:26: strong free on bases: {__malloc_main2_l23} [eva] tests/builtins/realloc.c:27: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] x ∈ {3; 4} r ∈ ESCAPINGADDR s ∈ {{ &__realloc_main2_l26[0] }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __realloc_main2_l26[0..2] ∈ {6} [3] ∈ {6} or UNINITIALIZED [4..5] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/realloc.c:28: Call to builtin free [eva] tests/builtins/realloc.c:28: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:28: strong free on bases: {__realloc_main2_l26} [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/builtins/realloc.c:162. [eva] tests/builtins/realloc.c:32: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:32: allocating variable __malloc_main3_l32 [eva] tests/builtins/realloc.c:35: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:35: allocating variable __malloc_main3_l35 [eva] computing for function Frama_C_interval <- main3 <- main. Called from tests/builtins/realloc.c:39. [eva] tests/builtins/realloc.c:39: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc.c:44: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main3_l32[0] }} r ∈ {{ &__malloc_main3_l35[0] }} p ∈ {{ &__malloc_main3_l32[0] ; &__malloc_main3_l35[0] }} x ∈ {0; 1} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main3_l32[0..4] ∈ {5} __malloc_main3_l35[0..5] ∈ {6} ==END OF DUMP== [eva] tests/builtins/realloc.c:46: Call to builtin realloc [eva] tests/builtins/realloc.c:46: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main3_l32, __malloc_main3_l35} [eva] tests/builtins/realloc.c:46: allocating variable __realloc_main3_l46 [eva:malloc] tests/builtins/realloc.c:46: weak free on bases: {__malloc_main3_l32, __malloc_main3_l35} [eva] tests/builtins/realloc.c:48: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main3_l32[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main3_l35[0] }} or ESCAPINGADDR p ∈ {{ &__malloc_main3_l32[0] ; &__malloc_main3_l35[0] }} or ESCAPINGADDR x ∈ {0; 1} s ∈ {{ &__realloc_main3_l46[0] }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main3_l32[0..4] ∈ {5} __malloc_main3_l35[0..5] ∈ {6} __realloc_main3_l46[0..4] ∈ {5; 6} [5] ∈ {6} or UNINITIALIZED [6] ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/builtins/realloc.c:49: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&q); [eva] tests/builtins/realloc.c:49: Call to builtin free [eva] tests/builtins/realloc.c:49: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:49: strong free on bases: {__malloc_main3_l32} [eva:alarm] tests/builtins/realloc.c:49: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&r); [eva] tests/builtins/realloc.c:49: Call to builtin free [eva] tests/builtins/realloc.c:49: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:49: strong free on bases: {__malloc_main3_l35} [eva] tests/builtins/realloc.c:49: Call to builtin free [eva] tests/builtins/realloc.c:49: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:49: strong free on bases: {__realloc_main3_l46} [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/builtins/realloc.c:163. [eva] computing for function Frama_C_interval <- main4 <- main. Called from tests/builtins/realloc.c:53. [eva] tests/builtins/realloc.c:53: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- main4 <- main. Called from tests/builtins/realloc.c:54. [eva] tests/builtins/realloc.c:54: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc.c:55: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:55: allocating variable __malloc_main4_l55 [eva] tests/builtins/realloc.c:56: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:56: allocating variable __malloc_main4_l56 [eva:alarm] tests/builtins/realloc.c:59: Warning: out of bounds write. assert \valid(q + i); [eva:alarm] tests/builtins/realloc.c:58: Warning: out of bounds write. assert \valid(p + i); [eva] tests/builtins/realloc.c:61: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] sizep ∈ [2..10] sizeq ∈ [0..10] p ∈ {{ &__malloc_main4_l55[0] }} q ∈ {{ &__malloc_main4_l56[0] }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main4_l55[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} __malloc_main4_l56[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} ==END OF DUMP== [eva] tests/builtins/realloc.c:67: Call to builtin realloc [eva] tests/builtins/realloc.c:67: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main4_l55} [eva] tests/builtins/realloc.c:67: allocating variable __realloc_main4_l67 [eva:malloc] tests/builtins/realloc.c:67: strong free on bases: {__malloc_main4_l55} [eva] tests/builtins/realloc.c:68: Call to builtin realloc [eva] tests/builtins/realloc.c:68: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main4_l56} [eva] tests/builtins/realloc.c:68: allocating variable __realloc_main4_l68 [eva:malloc] tests/builtins/realloc.c:68: strong free on bases: {__malloc_main4_l56} [eva] tests/builtins/realloc.c:69: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] sizep ∈ [2..10] sizeq ∈ [0..10] p ∈ ESCAPINGADDR q ∈ ESCAPINGADDR rp ∈ {{ &__realloc_main4_l67[0] }} rq ∈ {{ &__realloc_main4_l68[0] }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __realloc_main4_l67[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} or UNINITIALIZED [3] ∈ {3} or UNINITIALIZED [4] ∈ {4} or UNINITIALIZED [5] ∈ {5} or UNINITIALIZED [6] ∈ {6} or UNINITIALIZED [7] ∈ {7} or UNINITIALIZED [8] ∈ {8} or UNINITIALIZED [9] ∈ {9} or UNINITIALIZED [10..14] ∈ UNINITIALIZED __realloc_main4_l68[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} or UNINITIALIZED [3] ∈ {3} or UNINITIALIZED [4] ∈ {4} or UNINITIALIZED [5] ∈ {5} or UNINITIALIZED [6] ∈ {6} or UNINITIALIZED [7] ∈ {7} or UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/realloc.c:72: Call to builtin free [eva] tests/builtins/realloc.c:72: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:72: strong free on bases: {__realloc_main4_l67} [eva] tests/builtins/realloc.c:72: Call to builtin free [eva] tests/builtins/realloc.c:72: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:72: strong free on bases: {__realloc_main4_l68} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/builtins/realloc.c:164. [eva] tests/builtins/realloc.c:76: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:76: allocating variable __malloc_main5_l76 [eva] computing for function Frama_C_interval <- main5 <- main. Called from tests/builtins/realloc.c:78. [eva] tests/builtins/realloc.c:78: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc.c:83: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main5_l76 }} c ∈ {0; 1} q ∈ {{ NULL ; &__malloc_main5_l76 }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main5_l76 ∈ {1} ==END OF DUMP== [eva] tests/builtins/realloc.c:85: Call to builtin realloc [eva] tests/builtins/realloc.c:85: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main5_l76} [eva] tests/builtins/realloc.c:85: allocating variable __realloc_main5_l85 [eva:malloc] tests/builtins/realloc.c:85: weak free on bases: {__malloc_main5_l76} [eva] tests/builtins/realloc.c:86: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main5_l76 }} or ESCAPINGADDR c ∈ {0; 1} q ∈ {{ NULL ; &__malloc_main5_l76 }} or ESCAPINGADDR r ∈ {{ &__realloc_main5_l85[0] }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main5_l76 ∈ {1} __realloc_main5_l85[0] ∈ {1} or UNINITIALIZED [1] ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/builtins/realloc.c:88: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [eva] tests/builtins/realloc.c:88: Call to builtin free [eva] tests/builtins/realloc.c:88: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:88: strong free on bases: {__malloc_main5_l76} [eva] tests/builtins/realloc.c:88: Call to builtin free [eva] tests/builtins/realloc.c:88: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:88: strong free on bases: {__realloc_main5_l85} [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/builtins/realloc.c:165. [eva] computing for function Frama_C_interval <- main6 <- main. Called from tests/builtins/realloc.c:92. [eva] tests/builtins/realloc.c:92: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc.c:93: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:93: allocating variable __malloc_main6_l93 [eva] tests/builtins/realloc.c:102: Frama_C_show_each: {{ &x ; &__malloc_main6_l93 + {4} }} [eva] tests/builtins/realloc.c:103: Call to builtin realloc [eva:alarm] tests/builtins/realloc.c:103: Warning: function realloc: precondition 'freeable' got status invalid. [eva] tests/builtins/realloc.c:106: Call to builtin free [eva] tests/builtins/realloc.c:106: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:106: strong free on bases: {__malloc_main6_l93} [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/builtins/realloc.c:166. [eva] tests/builtins/realloc.c:110: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:110: allocating variable __malloc_main7_l110 [eva] tests/builtins/realloc.c:115: Call to builtin realloc [eva] tests/builtins/realloc.c:115: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main7_l110} [eva] tests/builtins/realloc.c:115: allocating variable __realloc_main7_l115 [eva:malloc] tests/builtins/realloc.c:115: strong free on bases: {__malloc_main7_l110} [eva] tests/builtins/realloc.c:116: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ ESCAPINGADDR q ∈ {{ &__realloc_main7_l115[0] }} x ∈ UNINITIALIZED v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __realloc_main7_l115[0] ∈ {{ &x }} [1] ∈ UNINITIALIZED ==END OF DUMP== [eva:locals-escaping] tests/builtins/realloc.c:116: Warning: locals {x} escaping the scope of a block of main7 through __realloc_main7_l115 [eva] tests/builtins/realloc.c:118: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ ESCAPINGADDR q ∈ {{ &__realloc_main7_l115[0] }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __realloc_main7_l115[0] ∈ ESCAPINGADDR [1] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/realloc.c:119: Call to builtin free [eva] tests/builtins/realloc.c:119: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:119: strong free on bases: {__realloc_main7_l115} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/builtins/realloc.c:167. [eva] tests/builtins/realloc.c:123: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:123: allocating variable __malloc_main8_l123 [eva] tests/builtins/realloc.c:126: Call to builtin realloc [eva] tests/builtins/realloc.c:126: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main8_l123} [eva] tests/builtins/realloc.c:126: allocating variable __realloc_main8_l126 [eva:malloc] tests/builtins/realloc.c:126: strong free on bases: {__malloc_main8_l123} [eva] tests/builtins/realloc.c:127: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ ESCAPINGADDR q ∈ {{ &__realloc_main8_l126[0] }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __realloc_main8_l126∈ ∅ ==END OF DUMP== [eva] tests/builtins/realloc.c:128: Call to builtin free [eva] tests/builtins/realloc.c:128: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:128: strong free on bases: {__realloc_main8_l126} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/builtins/realloc.c:168. [eva] tests/builtins/realloc.c:132: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:132: allocating variable __malloc_main9_l132 [eva] tests/builtins/realloc.c:135: Call to builtin realloc [eva] tests/builtins/realloc.c:135: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main9_l132} [eva] tests/builtins/realloc.c:135: allocating variable __realloc_main9_l135 [eva:malloc] tests/builtins/realloc.c:135: strong free on bases: {__malloc_main9_l132} [eva] tests/builtins/realloc.c:136: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ ESCAPINGADDR q ∈ {{ (int *)&__realloc_main9_l135 }} v ∈ [--..--] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __realloc_main9_l135# ∈ {1}%32, bits 0 to 7 ==END OF DUMP== [eva] tests/builtins/realloc.c:137: Call to builtin free [eva] tests/builtins/realloc.c:137: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc.c:137: strong free on bases: {__realloc_main9_l135} [eva] Recording results for main9 [eva] Done for function main9 [eva] computing for function main10 <- main. Called from tests/builtins/realloc.c:169. [eva] tests/builtins/realloc.c:147: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc.c:147: allocating variable __malloc_main10_l147 [eva] tests/builtins/realloc.c:152: Call to builtin realloc [eva] tests/builtins/realloc.c:152: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main10_l147} [eva] tests/builtins/realloc.c:152: allocating variable __realloc_main10_l152 [eva:malloc] tests/builtins/realloc.c:152: strong free on bases: {__malloc_main10_l147} [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} [eva] tests/builtins/realloc.c:155: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] v ∈ [--..--] p ∈ {{ &__realloc_main10_l152[0] }} q ∈ ESCAPINGADDR S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __realloc_main10_l152[0] ∈ {4} [1] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/realloc.c:152: Call to builtin realloc [eva:malloc] bases_to_realloc: {__realloc_main10_l152} [eva:malloc:weak] tests/builtins/realloc.c:152: marking variable `__realloc_main10_l152' as weak [eva:malloc] tests/builtins/realloc.c:152: weak free on bases: {__realloc_w_main10_l152} [eva] tests/builtins/realloc.c:154: Frama_C_show_each_main10: {4} [eva] tests/builtins/realloc.c:155: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] v ∈ [--..--] p ∈ {{ &__realloc_w_main10_l152[0] }} q ∈ {{ &__realloc_w_main10_l152[0] }} or ESCAPINGADDR S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __realloc_w_main10_l152[0] ∈ {4} [1] ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for main10 [eva] Done for function main10 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: __fc_heap_status ∈ [--..--] p ∈ ESCAPINGADDR pp ∈ ESCAPINGADDR q ∈ ESCAPINGADDR [eva:final-states] Values at end of function main10: __fc_heap_status ∈ [--..--] p ∈ {{ &__malloc_main10_l147 ; &__realloc_w_main10_l152[0] }} q ∈ {{ &__realloc_w_main10_l152[0] }} or UNINITIALIZED or ESCAPINGADDR __malloc_main10_l147 ∈ {4} __realloc_w_main10_l152[0] ∈ {4} [1] ∈ UNINITIALIZED [eva:final-states] Values at end of function main2: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] x ∈ {3; 4} r ∈ ESCAPINGADDR s ∈ ESCAPINGADDR [eva:final-states] Values at end of function main3: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ ESCAPINGADDR r ∈ ESCAPINGADDR p ∈ ESCAPINGADDR x ∈ {0; 1} s ∈ ESCAPINGADDR [eva:final-states] Values at end of function main4: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] sizep ∈ [2..10] sizeq ∈ [0..10] p ∈ ESCAPINGADDR q ∈ ESCAPINGADDR rp ∈ ESCAPINGADDR rq ∈ ESCAPINGADDR [eva:final-states] Values at end of function main5: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ ESCAPINGADDR c ∈ {0; 1} q ∈ {0} or ESCAPINGADDR r ∈ ESCAPINGADDR [eva:final-states] Values at end of function main6: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] c ∈ {0} m ∈ ESCAPINGADDR [eva:final-states] Values at end of function main7: __fc_heap_status ∈ [--..--] p ∈ ESCAPINGADDR q ∈ ESCAPINGADDR [eva:final-states] Values at end of function main8: __fc_heap_status ∈ [--..--] p ∈ ESCAPINGADDR q ∈ ESCAPINGADDR [eva:final-states] Values at end of function main9: __fc_heap_status ∈ [--..--] p ∈ ESCAPINGADDR q ∈ ESCAPINGADDR [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] __malloc_main10_l147 ∈ {4} __realloc_w_main10_l152[0] ∈ {4} [1] ∈ UNINITIALIZED [from] Computing for function main1 [from] Computing for function malloc <-main1 [from] Done for function malloc [from] Computing for function realloc <-main1 [from] Done for function realloc [from] Computing for function free <-main1 [from] Done for function free [from] Done for function main1 [from] Computing for function main10 [from] Done for function main10 [from] Computing for function main2 [from] Computing for function Frama_C_interval <-main2 [from] Done for function Frama_C_interval [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8 [from] Done for function main8 [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function realloc: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status; ptr; size [from] Function main1: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_main1_l12 FROM __fc_heap_status [from] Function main10: __fc_heap_status FROM __fc_heap_status; v (and SELF) __malloc_main10_l147 FROM __fc_heap_status __realloc_w_main10_l152[0] FROM __fc_heap_status; v; __realloc_w_main10_l152[0] (and SELF) [from] Function main2: __fc_heap_status FROM __fc_heap_status; Frama_C_entropy_source (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main2_l23[0..3] FROM __fc_heap_status; Frama_C_entropy_source (and SELF) [from] Function main3: __fc_heap_status FROM __fc_heap_status (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main3_l32[0..4] FROM __fc_heap_status (and SELF) __malloc_main3_l35[0..5] FROM __fc_heap_status (and SELF) [from] Function main4: __fc_heap_status FROM __fc_heap_status; Frama_C_entropy_source (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main4_l55[0..9] FROM __fc_heap_status; Frama_C_entropy_source (and SELF) __malloc_main4_l56[0..9] FROM __fc_heap_status; Frama_C_entropy_source (and SELF) [from] Function main5: __fc_heap_status FROM __fc_heap_status (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main5_l76 FROM __fc_heap_status [from] Function main6: __fc_heap_status FROM __fc_heap_status (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function main7: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_main7_l110 FROM __fc_heap_status [from] Function main8: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_main8_l123[0..1] FROM __fc_heap_status [from] Function main9: __fc_heap_status FROM __fc_heap_status (and SELF) __malloc_main9_l132[0..1] FROM __fc_heap_status [from] Function main: __fc_heap_status FROM __fc_heap_status; Frama_C_entropy_source; v (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main1_l12 FROM __fc_heap_status __malloc_main2_l23[0..3] FROM __fc_heap_status; Frama_C_entropy_source (and SELF) __malloc_main3_l32[0..4] FROM __fc_heap_status; Frama_C_entropy_source (and SELF) __malloc_main3_l35[0..5] FROM __fc_heap_status; Frama_C_entropy_source (and SELF) __malloc_main4_l55[0..9] FROM __fc_heap_status; Frama_C_entropy_source (and SELF) __malloc_main4_l56[0..9] FROM __fc_heap_status; Frama_C_entropy_source (and SELF) __malloc_main5_l76 FROM __fc_heap_status; Frama_C_entropy_source __malloc_main7_l110 FROM __fc_heap_status; Frama_C_entropy_source __malloc_main8_l123[0..1] FROM __fc_heap_status; Frama_C_entropy_source __malloc_main9_l132[0..1] FROM __fc_heap_status; Frama_C_entropy_source __malloc_main10_l147 FROM __fc_heap_status; Frama_C_entropy_source __realloc_w_main10_l152[0] FROM __fc_heap_status; Frama_C_entropy_source; v; __realloc_w_main10_l152[0] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: __fc_heap_status; p; pp; q; __malloc_main1_l12 [inout] Inputs for function main1: __fc_heap_status [inout] Out (internal) for function main10: __fc_heap_status; p; q; __malloc_main10_l147; __realloc_w_main10_l152[0] [inout] Inputs for function main10: __fc_heap_status; v; __realloc_w_main10_l152[0] [inout] Out (internal) for function main2: __fc_heap_status; Frama_C_entropy_source; x; r; i; s; __malloc_main2_l23[0..3] [inout] Inputs for function main2: __fc_heap_status; Frama_C_entropy_source [inout] Out (internal) for function main3: __fc_heap_status; Frama_C_entropy_source; q; i; r; i_0; p; x; s; __malloc_main3_l32[0..4]; __malloc_main3_l35[0..5] [inout] Inputs for function main3: __fc_heap_status; Frama_C_entropy_source [inout] Out (internal) for function main4: __fc_heap_status; Frama_C_entropy_source; sizep; sizeq; p; q; i; rp; rq; __malloc_main4_l55[0..9]; __malloc_main4_l56[0..9] [inout] Inputs for function main4: __fc_heap_status; Frama_C_entropy_source [inout] Out (internal) for function main5: __fc_heap_status; Frama_C_entropy_source; p; c; q; r; __malloc_main5_l76 [inout] Inputs for function main5: __fc_heap_status; Frama_C_entropy_source [inout] Out (internal) for function main6: __fc_heap_status; Frama_C_entropy_source; c; m; x; p; q [inout] Inputs for function main6: __fc_heap_status; Frama_C_entropy_source [inout] Out (internal) for function main7: __fc_heap_status; p; q; __malloc_main7_l110 [inout] Inputs for function main7: __fc_heap_status [inout] Out (internal) for function main8: __fc_heap_status; p; q; __malloc_main8_l123[0..1] [inout] Inputs for function main8: __fc_heap_status [inout] Out (internal) for function main9: __fc_heap_status; p; q; __malloc_main9_l132[0..1] [inout] Inputs for function main9: __fc_heap_status [inout] Out (internal) for function main: __fc_heap_status; Frama_C_entropy_source; __malloc_main1_l12; __malloc_main2_l23[0..3]; __malloc_main3_l32[0..4]; __malloc_main3_l35[0..5]; __malloc_main4_l55[0..9]; __malloc_main4_l56[0..9]; __malloc_main5_l76; __malloc_main7_l110; __malloc_main8_l123[0..1]; __malloc_main9_l132[0..1]; __malloc_main10_l147; __realloc_w_main10_l152[0] [inout] Inputs for function main: __fc_heap_status; Frama_C_entropy_source; v; __realloc_w_main10_l152[0] �����������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/realloc2.res.oracle��������������������������������������0000666�0000000�0000000�00000350557�13571573400�021154� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/realloc2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function test_exact_null <- main. Called from tests/builtins/realloc2.c:194. [eva] tests/builtins/realloc2.c:27: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:27: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {} [eva] tests/builtins/realloc2.c:27: allocating variable __realloc_test_exact_null_l27 [eva:malloc] tests/builtins/realloc2.c:27: strong free on bases: {} [eva] computing for function fill <- test_exact_null <- main. Called from tests/builtins/realloc2.c:28. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_exact_null [eva] Done for function test_exact_null [eva] computing for function test_exact_null_free <- main. Called from tests/builtins/realloc2.c:195. [eva] tests/builtins/realloc2.c:32: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:32: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {} [eva] tests/builtins/realloc2.c:32: allocating variable __realloc_test_exact_null_free_l32 [eva:malloc] tests/builtins/realloc2.c:32: strong free on bases: {} [eva] Recording results for test_exact_null_free [eva] Done for function test_exact_null_free [eva] computing for function test_exact_nonnull_expand <- main. Called from tests/builtins/realloc2.c:196. [eva] tests/builtins/realloc2.c:36: Call to builtin malloc [eva] tests/builtins/realloc2.c:36: allocating variable __malloc_test_exact_nonnull_expand_l36 [eva] computing for function fill <- test_exact_nonnull_expand <- main. Called from tests/builtins/realloc2.c:37. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:38: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:38: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_exact_nonnull_expand_l36} [eva] tests/builtins/realloc2.c:38: allocating variable __realloc_test_exact_nonnull_expand_l38 [eva:malloc] tests/builtins/realloc2.c:38: strong free on bases: {__malloc_test_exact_nonnull_expand_l36} [eva] computing for function fill <- test_exact_nonnull_expand <- main. Called from tests/builtins/realloc2.c:39. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_exact_nonnull_expand [eva] Done for function test_exact_nonnull_expand [eva] computing for function test_exact_nonnull_shrink <- main. Called from tests/builtins/realloc2.c:197. [eva] tests/builtins/realloc2.c:44: Call to builtin malloc [eva] tests/builtins/realloc2.c:44: allocating variable __malloc_test_exact_nonnull_shrink_l44 [eva] computing for function fill <- test_exact_nonnull_shrink <- main. Called from tests/builtins/realloc2.c:45. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:46: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:46: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_exact_nonnull_shrink_l44} [eva] tests/builtins/realloc2.c:46: allocating variable __realloc_test_exact_nonnull_shrink_l46 [eva:malloc] tests/builtins/realloc2.c:46: strong free on bases: {__malloc_test_exact_nonnull_shrink_l44} [eva] computing for function fill <- test_exact_nonnull_shrink <- main. Called from tests/builtins/realloc2.c:47. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_exact_nonnull_shrink [eva] Done for function test_exact_nonnull_shrink [eva] computing for function test_exact_nonnull_free <- main. Called from tests/builtins/realloc2.c:198. [eva] tests/builtins/realloc2.c:51: Call to builtin malloc [eva] tests/builtins/realloc2.c:51: allocating variable __malloc_test_exact_nonnull_free_l51 [eva] computing for function fill <- test_exact_nonnull_free <- main. Called from tests/builtins/realloc2.c:52. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:53: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:53: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_exact_nonnull_free_l51} [eva] tests/builtins/realloc2.c:53: allocating variable __realloc_test_exact_nonnull_free_l53 [eva:malloc] tests/builtins/realloc2.c:53: strong free on bases: {__malloc_test_exact_nonnull_free_l51} [eva] Recording results for test_exact_nonnull_free [eva] Done for function test_exact_nonnull_free [eva] computing for function test_maybe_nonnull <- main. Called from tests/builtins/realloc2.c:199. [eva] tests/builtins/realloc2.c:57: Call to builtin malloc [eva] tests/builtins/realloc2.c:57: allocating variable __malloc_test_maybe_nonnull_l57 [eva] tests/builtins/realloc2.c:58: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:58: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_maybe_nonnull_l57} [eva] tests/builtins/realloc2.c:58: allocating variable __realloc_test_maybe_nonnull_l58 [eva:malloc] tests/builtins/realloc2.c:58: weak free on bases: {__malloc_test_maybe_nonnull_l57} [eva] computing for function fill <- test_maybe_nonnull <- main. Called from tests/builtins/realloc2.c:59. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_maybe_nonnull [eva] Done for function test_maybe_nonnull [eva] computing for function test_same_size <- main. Called from tests/builtins/realloc2.c:200. [eva] tests/builtins/realloc2.c:63: Call to builtin malloc [eva] tests/builtins/realloc2.c:63: allocating variable __malloc_test_same_size_l63 [eva] computing for function fill <- test_same_size <- main. Called from tests/builtins/realloc2.c:64. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:65: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:65: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_same_size_l63} [eva] tests/builtins/realloc2.c:65: allocating variable __realloc_test_same_size_l65 [eva:malloc] tests/builtins/realloc2.c:65: strong free on bases: {__malloc_test_same_size_l63} [eva] Recording results for test_same_size [eva] Done for function test_same_size [eva] computing for function test_imprecise_size <- main. Called from tests/builtins/realloc2.c:201. [eva] tests/builtins/realloc2.c:70: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:70: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {} [eva] tests/builtins/realloc2.c:70: allocating variable __realloc_test_imprecise_size_l70 [eva:malloc] tests/builtins/realloc2.c:70: strong free on bases: {} [eva] computing for function fill <- test_imprecise_size <- main. Called from tests/builtins/realloc2.c:71. [eva:alarm] tests/builtins/realloc2.c:11: Warning: out of bounds write. assert \valid(b + i); [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_imprecise_size [eva] Done for function test_imprecise_size [eva] computing for function test_imprecise_size_but_precise_fill <- main. Called from tests/builtins/realloc2.c:202. [eva] tests/builtins/realloc2.c:76: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:76: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {} [eva] tests/builtins/realloc2.c:76: allocating variable __realloc_test_imprecise_size_but_precise_fill_l76 [eva:malloc] tests/builtins/realloc2.c:76: strong free on bases: {} [eva] computing for function fill <- test_imprecise_size_but_precise_fill <- main. Called from tests/builtins/realloc2.c:77. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_imprecise_size_but_precise_fill [eva] Done for function test_imprecise_size_but_precise_fill [eva] computing for function test_imprecise_size_free <- main. Called from tests/builtins/realloc2.c:203. [eva] tests/builtins/realloc2.c:81: Call to builtin malloc [eva] tests/builtins/realloc2.c:81: allocating variable __malloc_test_imprecise_size_free_l81 [eva] computing for function fill <- test_imprecise_size_free <- main. Called from tests/builtins/realloc2.c:82. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:84: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:84: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_imprecise_size_free_l81} [eva] tests/builtins/realloc2.c:84: allocating variable __realloc_test_imprecise_size_free_l84 [eva:malloc] tests/builtins/realloc2.c:84: strong free on bases: {__malloc_test_imprecise_size_free_l81} [eva] computing for function fill <- test_imprecise_size_free <- main. Called from tests/builtins/realloc2.c:85. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_imprecise_size_free [eva] Done for function test_imprecise_size_free [eva] computing for function test_imprecise_both <- main. Called from tests/builtins/realloc2.c:204. [eva] tests/builtins/realloc2.c:89: Call to builtin malloc [eva] tests/builtins/realloc2.c:89: allocating variable __malloc_test_imprecise_both_l89 [eva] tests/builtins/realloc2.c:91: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:91: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_imprecise_both_l89} [eva] tests/builtins/realloc2.c:91: allocating variable __realloc_test_imprecise_both_l91 [eva:malloc] tests/builtins/realloc2.c:91: weak free on bases: {__malloc_test_imprecise_both_l89} [eva] computing for function fill <- test_imprecise_both <- main. Called from tests/builtins/realloc2.c:92. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_imprecise_both [eva] Done for function test_imprecise_both [eva] computing for function test_possibly_invalid_realloc <- main. Called from tests/builtins/realloc2.c:205. [eva] tests/builtins/realloc2.c:96: Call to builtin malloc [eva] tests/builtins/realloc2.c:96: allocating variable __malloc_test_possibly_invalid_realloc_l96 [eva] tests/builtins/realloc2.c:99: Call to builtin Frama_C_realloc for function realloc [eva:alarm] tests/builtins/realloc2.c:99: Warning: function realloc: precondition 'freeable' got status unknown. [eva:malloc] bases_to_realloc: {__malloc_test_possibly_invalid_realloc_l96} [eva] tests/builtins/realloc2.c:99: allocating variable __realloc_test_possibly_invalid_realloc_l99 [eva:malloc] tests/builtins/realloc2.c:99: strong free on bases: {__malloc_test_possibly_invalid_realloc_l96} [eva] computing for function fill <- test_possibly_invalid_realloc <- main. Called from tests/builtins/realloc2.c:100. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_possibly_invalid_realloc [eva] Done for function test_possibly_invalid_realloc [eva] computing for function test_invalid_realloc <- main. Called from tests/builtins/realloc2.c:206. [eva] tests/builtins/realloc2.c:104: Call to builtin malloc [eva] tests/builtins/realloc2.c:104: allocating variable __malloc_test_invalid_realloc_l104 [eva] tests/builtins/realloc2.c:106: Call to builtin Frama_C_realloc for function realloc [eva:alarm] tests/builtins/realloc2.c:106: Warning: function realloc: precondition 'freeable' got status invalid. [eva] Recording results for test_invalid_realloc [eva] Done for function test_invalid_realloc [eva] computing for function test_invalid_realloc2 <- main. Called from tests/builtins/realloc2.c:207. [eva] tests/builtins/realloc2.c:111: Call to builtin Frama_C_realloc for function realloc [eva:alarm] tests/builtins/realloc2.c:111: Warning: function realloc: precondition 'freeable' got status invalid. [eva] Recording results for test_invalid_realloc2 [eva] Done for function test_invalid_realloc2 [eva] computing for function test_invalid_realloc3 <- main. Called from tests/builtins/realloc2.c:208. [eva] tests/builtins/realloc2.c:116: Call to builtin malloc [eva] tests/builtins/realloc2.c:116: allocating variable __malloc_test_invalid_realloc3_l116 [eva] tests/builtins/realloc2.c:119: Call to builtin Frama_C_realloc for function realloc [eva:alarm] tests/builtins/realloc2.c:119: Warning: function realloc: precondition 'freeable' got status invalid. [eva] Recording results for test_invalid_realloc3 [eva] Done for function test_invalid_realloc3 [eva] computing for function test_realloc_sequence <- main. Called from tests/builtins/realloc2.c:209. [eva] tests/builtins/realloc2.c:124: Call to builtin malloc [eva] tests/builtins/realloc2.c:124: allocating variable __malloc_test_realloc_sequence_l124 [eva] tests/builtins/realloc2.c:125: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:125: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_realloc_sequence_l124} [eva] tests/builtins/realloc2.c:125: allocating variable __realloc_test_realloc_sequence_l125 [eva:malloc] tests/builtins/realloc2.c:125: strong free on bases: {__malloc_test_realloc_sequence_l124} [eva] tests/builtins/realloc2.c:126: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:126: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__realloc_test_realloc_sequence_l125} [eva] tests/builtins/realloc2.c:126: allocating variable __realloc_test_realloc_sequence_l126 [eva:malloc] tests/builtins/realloc2.c:126: strong free on bases: {__realloc_test_realloc_sequence_l125} [eva] computing for function fill <- test_realloc_sequence <- main. Called from tests/builtins/realloc2.c:127. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_realloc_sequence [eva] Done for function test_realloc_sequence [eva] computing for function test_realloc_loop <- main. Called from tests/builtins/realloc2.c:210. [eva] tests/builtins/realloc2.c:131: Call to builtin malloc [eva] tests/builtins/realloc2.c:131: allocating variable __malloc_test_realloc_loop_l131 [eva] computing for function fill <- test_realloc_loop <- main. Called from tests/builtins/realloc2.c:134. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:138: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:138: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_realloc_loop_l131} [eva] tests/builtins/realloc2.c:138: allocating variable __realloc_test_realloc_loop_l138 [eva:malloc] tests/builtins/realloc2.c:138: strong free on bases: {__malloc_test_realloc_loop_l131} [eva] computing for function fill <- test_realloc_loop <- main. Called from tests/builtins/realloc2.c:142. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:138: Call to builtin Frama_C_realloc for function realloc [eva:malloc] bases_to_realloc: {__realloc_test_realloc_loop_l138} [eva:malloc:weak] tests/builtins/realloc2.c:138: marking variable `__realloc_test_realloc_loop_l138' as weak [eva:malloc] tests/builtins/realloc2.c:138: resizing variable `__realloc_w_test_realloc_loop_l138' (0..79) to fit 0..119 [eva:malloc] tests/builtins/realloc2.c:138: weak free on bases: {__realloc_w_test_realloc_loop_l138} [eva] computing for function fill <- test_realloc_loop <- main. Called from tests/builtins/realloc2.c:142. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:138: Call to builtin Frama_C_realloc for function realloc [eva:malloc] bases_to_realloc: {__realloc_w_test_realloc_loop_l138} [eva:malloc] tests/builtins/realloc2.c:138: resizing variable `__realloc_w_test_realloc_loop_l138' (0..79/119) to fit 0..159 [eva:malloc] tests/builtins/realloc2.c:138: weak free on bases: {__realloc_w_test_realloc_loop_l138} [eva] computing for function fill <- test_realloc_loop <- main. Called from tests/builtins/realloc2.c:142. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:138: Call to builtin Frama_C_realloc for function realloc [eva:malloc] bases_to_realloc: {__realloc_w_test_realloc_loop_l138} [eva:malloc] tests/builtins/realloc2.c:138: resizing variable `__realloc_w_test_realloc_loop_l138' (0..79/159) to fit 0..199 [eva:malloc] tests/builtins/realloc2.c:138: weak free on bases: {__realloc_w_test_realloc_loop_l138} [eva] computing for function fill <- test_realloc_loop <- main. Called from tests/builtins/realloc2.c:142. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:138: Call to builtin Frama_C_realloc for function realloc [eva:malloc] bases_to_realloc: {__realloc_w_test_realloc_loop_l138} [eva:malloc] tests/builtins/realloc2.c:138: resizing variable `__realloc_w_test_realloc_loop_l138' (0..79/199) to fit 0..239 [eva:malloc] tests/builtins/realloc2.c:138: weak free on bases: {__realloc_w_test_realloc_loop_l138} [eva] computing for function fill <- test_realloc_loop <- main. Called from tests/builtins/realloc2.c:142. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_realloc_loop [eva] Done for function test_realloc_loop [eva] computing for function test_realloc_multiple_bases <- main. Called from tests/builtins/realloc2.c:211. [eva] tests/builtins/realloc2.c:151: Call to builtin malloc [eva] tests/builtins/realloc2.c:151: allocating variable __malloc_test_realloc_multiple_bases_l151 [eva] tests/builtins/realloc2.c:154: Call to builtin malloc [eva] tests/builtins/realloc2.c:154: allocating variable __malloc_test_realloc_multiple_bases_l154 [eva] tests/builtins/realloc2.c:156: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:156: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_realloc_multiple_bases_l151} [eva] tests/builtins/realloc2.c:156: allocating variable __realloc_test_realloc_multiple_bases_l156 [eva:malloc] tests/builtins/realloc2.c:156: strong free on bases: {__malloc_test_realloc_multiple_bases_l151} [eva] tests/builtins/realloc2.c:158: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:158: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_realloc_multiple_bases_l154, __realloc_test_realloc_multiple_bases_l156} [eva] tests/builtins/realloc2.c:158: allocating variable __realloc_test_realloc_multiple_bases_l158 [eva:malloc] tests/builtins/realloc2.c:158: weak free on bases: {__malloc_test_realloc_multiple_bases_l154, __realloc_test_realloc_multiple_bases_l156} [eva] computing for function fill <- test_realloc_multiple_bases <- main. Called from tests/builtins/realloc2.c:159. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_realloc_multiple_bases [eva] Done for function test_realloc_multiple_bases [eva] computing for function test_realloc_multiple_bases2 <- main. Called from tests/builtins/realloc2.c:212. [eva] tests/builtins/realloc2.c:163: Call to builtin malloc [eva] tests/builtins/realloc2.c:163: allocating variable __malloc_test_realloc_multiple_bases2_l163 [eva] computing for function fill <- test_realloc_multiple_bases2 <- main. Called from tests/builtins/realloc2.c:165. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:166: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:166: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_realloc_multiple_bases2_l163} [eva] tests/builtins/realloc2.c:166: allocating variable __realloc_test_realloc_multiple_bases2_l166 [eva:malloc] tests/builtins/realloc2.c:166: strong free on bases: {__malloc_test_realloc_multiple_bases2_l163} [eva] tests/builtins/realloc2.c:166: Call to builtin malloc [eva] tests/builtins/realloc2.c:166: allocating variable __malloc_test_realloc_multiple_bases2_l166 [eva] computing for function fill2 <- test_realloc_multiple_bases2 <- main. Called from tests/builtins/realloc2.c:168. [eva] Recording results for fill2 [eva] Done for function fill2 [eva] tests/builtins/realloc2.c:169: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:169: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__realloc_test_realloc_multiple_bases2_l166, __malloc_test_realloc_multiple_bases2_l166} [eva] tests/builtins/realloc2.c:169: allocating variable __realloc_test_realloc_multiple_bases2_l169 [eva:malloc] tests/builtins/realloc2.c:169: weak free on bases: {__realloc_test_realloc_multiple_bases2_l166, __malloc_test_realloc_multiple_bases2_l166} [eva] tests/builtins/realloc2.c:171: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:171: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__realloc_test_realloc_multiple_bases2_l169} [eva] tests/builtins/realloc2.c:171: allocating variable __realloc_test_realloc_multiple_bases2_l171 [eva:malloc] tests/builtins/realloc2.c:171: strong free on bases: {__realloc_test_realloc_multiple_bases2_l169} [eva] computing for function fill <- test_realloc_multiple_bases2 <- main. Called from tests/builtins/realloc2.c:173. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:174: Call to builtin malloc [eva] tests/builtins/realloc2.c:174: allocating variable __malloc_test_realloc_multiple_bases2_l174 [eva] computing for function fill2 <- test_realloc_multiple_bases2 <- main. Called from tests/builtins/realloc2.c:176. [eva] Recording results for fill2 [eva] Done for function fill2 [eva] tests/builtins/realloc2.c:177: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:177: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__realloc_test_realloc_multiple_bases2_l171, __malloc_test_realloc_multiple_bases2_l174} [eva] tests/builtins/realloc2.c:177: allocating variable __realloc_test_realloc_multiple_bases2_l177 [eva:malloc] tests/builtins/realloc2.c:177: weak free on bases: {__realloc_test_realloc_multiple_bases2_l171, __malloc_test_realloc_multiple_bases2_l174} [eva] computing for function fill <- test_realloc_multiple_bases2 <- main. Called from tests/builtins/realloc2.c:179. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_realloc_multiple_bases2 [eva] Done for function test_realloc_multiple_bases2 [eva] computing for function test_realloc_multiple_bases_loop <- main. Called from tests/builtins/realloc2.c:213. [eva] tests/builtins/realloc2.c:184: Call to builtin malloc [eva] tests/builtins/realloc2.c:184: allocating variable __malloc_test_realloc_multiple_bases_loop_l184 [eva] tests/builtins/realloc2.c:187: Call to builtin Frama_C_realloc for function realloc [eva] tests/builtins/realloc2.c:187: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_test_realloc_multiple_bases_loop_l184} [eva] tests/builtins/realloc2.c:187: allocating variable __realloc_test_realloc_multiple_bases_loop_l187 [eva:malloc] tests/builtins/realloc2.c:187: strong free on bases: {__malloc_test_realloc_multiple_bases_loop_l184} [eva] computing for function fill <- test_realloc_multiple_bases_loop <- main. Called from tests/builtins/realloc2.c:189. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:185: starting to merge loop iterations [eva] tests/builtins/realloc2.c:187: Call to builtin Frama_C_realloc for function realloc [eva:malloc] bases_to_realloc: {__malloc_test_realloc_multiple_bases_loop_l184, __realloc_test_realloc_multiple_bases_loop_l187} [eva:malloc:weak] tests/builtins/realloc2.c:187: marking variable `__realloc_test_realloc_multiple_bases_loop_l187' as weak [eva:malloc] tests/builtins/realloc2.c:187: resizing variable `__realloc_w_test_realloc_multiple_bases_loop_l187' (0..79) to fit 0..79/95 [eva:malloc] tests/builtins/realloc2.c:187: weak free on bases: {__malloc_test_realloc_multiple_bases_loop_l184, __realloc_w_test_realloc_multiple_bases_loop_l187} [eva] computing for function fill <- test_realloc_multiple_bases_loop <- main. Called from tests/builtins/realloc2.c:189. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:187: Call to builtin Frama_C_realloc for function realloc [eva:malloc] bases_to_realloc: {__malloc_test_realloc_multiple_bases_loop_l184, __realloc_w_test_realloc_multiple_bases_loop_l187} [eva:malloc] tests/builtins/realloc2.c:187: resizing variable `__realloc_w_test_realloc_multiple_bases_loop_l187' (0..79/95) to fit 0..79/111 [eva:malloc] tests/builtins/realloc2.c:187: weak free on bases: {__malloc_test_realloc_multiple_bases_loop_l184, __realloc_w_test_realloc_multiple_bases_loop_l187} [eva] computing for function fill <- test_realloc_multiple_bases_loop <- main. Called from tests/builtins/realloc2.c:189. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:187: Call to builtin Frama_C_realloc for function realloc [eva:malloc] bases_to_realloc: {__malloc_test_realloc_multiple_bases_loop_l184, __realloc_w_test_realloc_multiple_bases_loop_l187} [eva:malloc] tests/builtins/realloc2.c:187: resizing variable `__realloc_w_test_realloc_multiple_bases_loop_l187' (0..79/111) to fit 0..79/223 [eva:malloc] tests/builtins/realloc2.c:187: weak free on bases: {__malloc_test_realloc_multiple_bases_loop_l184, __realloc_w_test_realloc_multiple_bases_loop_l187} [eva] computing for function fill <- test_realloc_multiple_bases_loop <- main. Called from tests/builtins/realloc2.c:189. [eva] Recording results for fill [eva] Done for function fill [eva] tests/builtins/realloc2.c:187: Call to builtin Frama_C_realloc for function realloc [eva:malloc] bases_to_realloc: {__malloc_test_realloc_multiple_bases_loop_l184, __realloc_w_test_realloc_multiple_bases_loop_l187} [eva:malloc] tests/builtins/realloc2.c:187: weak free on bases: {__malloc_test_realloc_multiple_bases_loop_l184, __realloc_w_test_realloc_multiple_bases_loop_l187} [eva] computing for function fill <- test_realloc_multiple_bases_loop <- main. Called from tests/builtins/realloc2.c:189. [eva] Recording results for fill [eva] Done for function fill [eva] Recording results for test_realloc_multiple_bases_loop [eva] Done for function test_realloc_multiple_bases_loop [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fill: __realloc_test_exact_null_l27[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} __malloc_test_exact_nonnull_expand_l36[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __realloc_test_exact_nonnull_expand_l38[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} __malloc_test_exact_nonnull_shrink_l44[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __realloc_test_exact_nonnull_shrink_l46[0] ∈ {0} [1] ∈ {1} __malloc_test_exact_nonnull_free_l51[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __realloc_test_maybe_nonnull_l58[0] ∈ {0} [1] ∈ {1} __malloc_test_same_size_l63[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __realloc_test_imprecise_size_l70[0] ∈ {0} [1] ∈ {1} or UNINITIALIZED __realloc_test_imprecise_size_but_precise_fill_l76[0] ∈ {0} [1] ∈ UNINITIALIZED __malloc_test_imprecise_size_free_l81[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __realloc_test_imprecise_size_free_l84[0] ∈ {0} [1] ∈ {1} __realloc_test_imprecise_both_l91[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED __realloc_test_possibly_invalid_realloc_l99[0] ∈ {0} [1] ∈ {1} __realloc_test_realloc_sequence_l126[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __malloc_test_realloc_loop_l131[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5..9] ∈ UNINITIALIZED __realloc_w_test_realloc_loop_l138[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {0} [6] ∈ {1} [7] ∈ {2} [8] ∈ {3} [9] ∈ {4} [10] ∈ {0} or UNINITIALIZED [11] ∈ {1} or UNINITIALIZED [12] ∈ {2} or UNINITIALIZED [13] ∈ {3} or UNINITIALIZED [14] ∈ {4} or UNINITIALIZED [15] ∈ {0} or UNINITIALIZED [16] ∈ {1} or UNINITIALIZED [17] ∈ {2} or UNINITIALIZED [18] ∈ {3} or UNINITIALIZED [19] ∈ {4} or UNINITIALIZED [20] ∈ {0} or UNINITIALIZED [21] ∈ {1} or UNINITIALIZED [22] ∈ {2} or UNINITIALIZED [23] ∈ {3} or UNINITIALIZED [24] ∈ {4} or UNINITIALIZED [25] ∈ {0} or UNINITIALIZED [26] ∈ {1} or UNINITIALIZED [27] ∈ {2} or UNINITIALIZED [28] ∈ {3} or UNINITIALIZED [29] ∈ {4} or UNINITIALIZED __realloc_test_realloc_multiple_bases_l158[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __malloc_test_realloc_multiple_bases2_l163[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} __realloc_test_realloc_multiple_bases2_l171[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __realloc_test_realloc_multiple_bases2_l177[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} __malloc_test_realloc_multiple_bases_loop_l184[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} or UNINITIALIZED [3] ∈ {3} or UNINITIALIZED [4] ∈ {4} or UNINITIALIZED [5] ∈ {5} or UNINITIALIZED [6] ∈ {6} or UNINITIALIZED [7] ∈ {7} or UNINITIALIZED [8] ∈ {8} or UNINITIALIZED [9] ∈ {9} or UNINITIALIZED __realloc_w_test_realloc_multiple_bases_loop_l187[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} or UNINITIALIZED [3] ∈ {3} or UNINITIALIZED [4] ∈ {4} or UNINITIALIZED [5] ∈ {5} or UNINITIALIZED [6] ∈ {6} or UNINITIALIZED [7] ∈ {7} or UNINITIALIZED [8] ∈ {8} or UNINITIALIZED [9] ∈ {9} or UNINITIALIZED [10] ∈ {10} or UNINITIALIZED [11] ∈ {11} or UNINITIALIZED [12] ∈ {12} or UNINITIALIZED [13] ∈ {13} or UNINITIALIZED [14] ∈ {14} or UNINITIALIZED [15] ∈ {15} or UNINITIALIZED [16] ∈ {16} or UNINITIALIZED [17] ∈ {17} or UNINITIALIZED [18] ∈ {18} or UNINITIALIZED [19] ∈ {19} or UNINITIALIZED [20] ∈ {20} or UNINITIALIZED [21] ∈ {21} or UNINITIALIZED [22] ∈ {22} or UNINITIALIZED [23] ∈ {23} or UNINITIALIZED [24] ∈ {24} or UNINITIALIZED [25] ∈ {25} or UNINITIALIZED [26] ∈ {26} or UNINITIALIZED [27] ∈ {27} or UNINITIALIZED [eva:final-states] Values at end of function fill2: __realloc_test_realloc_multiple_bases2_l166[0] ∈ {0} [1] ∈ {1; 10} [2] ∈ {2} [3] ∈ {3} [4..5] ∈ UNINITIALIZED __malloc_test_realloc_multiple_bases2_l166[0] ∈ {0} or UNINITIALIZED [1] ∈ {10} or UNINITIALIZED __malloc_test_realloc_multiple_bases2_l174[0] ∈ {0} [1] ∈ {10} [2] ∈ {20} [3..5] ∈ UNINITIALIZED [eva:final-states] Values at end of function test_exact_nonnull_expand: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR p2 ∈ {{ &__realloc_test_exact_nonnull_expand_l38[0] }} __realloc_test_exact_nonnull_expand_l38[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [eva:final-states] Values at end of function test_exact_nonnull_free: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR p2 ∈ {{ &__realloc_test_exact_nonnull_free_l53[0] }} [eva:final-states] Values at end of function test_exact_nonnull_shrink: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR p2 ∈ {{ &__realloc_test_exact_nonnull_shrink_l46[0] }} __realloc_test_exact_nonnull_shrink_l46[0] ∈ {0} [1] ∈ {1} [eva:final-states] Values at end of function test_exact_null: p ∈ {{ &__realloc_test_exact_null_l27[0] }} __realloc_test_exact_null_l27[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [eva:final-states] Values at end of function test_exact_null_free: p ∈ {{ &__realloc_test_exact_null_free_l32[0] }} [eva:final-states] Values at end of function test_imprecise_both: __fc_heap_status ∈ [--..--] p1 ∈ {{ NULL ; (void *)&__malloc_test_imprecise_both_l89 }} or ESCAPINGADDR s ∈ {0; 2} p2 ∈ {{ &__realloc_test_imprecise_both_l91[0] }} __realloc_test_imprecise_both_l91[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function test_imprecise_size: s ∈ {1; 2} p ∈ {{ &__realloc_test_imprecise_size_l70[0] }} __realloc_test_imprecise_size_l70[0] ∈ {0} [1] ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function test_imprecise_size_but_precise_fill: s ∈ {1; 2} p ∈ {{ &__realloc_test_imprecise_size_but_precise_fill_l76[0] }} __realloc_test_imprecise_size_but_precise_fill_l76[0] ∈ {0} [1] ∈ UNINITIALIZED [eva:final-states] Values at end of function test_imprecise_size_free: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR s ∈ {0; 2} p2 ∈ {{ &__realloc_test_imprecise_size_free_l84[0] }} __realloc_test_imprecise_size_free_l84[0] ∈ {0} [1] ∈ {1} [eva:final-states] Values at end of function test_invalid_realloc: NON TERMINATING FUNCTION [eva:final-states] Values at end of function test_invalid_realloc2: NON TERMINATING FUNCTION [eva:final-states] Values at end of function test_invalid_realloc3: NON TERMINATING FUNCTION [eva:final-states] Values at end of function test_maybe_nonnull: __fc_heap_status ∈ [--..--] p1 ∈ {{ NULL ; (void *)&__malloc_test_maybe_nonnull_l57 }} or ESCAPINGADDR p2 ∈ {{ &__realloc_test_maybe_nonnull_l58[0] }} __realloc_test_maybe_nonnull_l58[0] ∈ {0} [1] ∈ {1} [eva:final-states] Values at end of function test_possibly_invalid_realloc: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR offset ∈ {0; 10; 20} p2 ∈ {{ &__realloc_test_possibly_invalid_realloc_l99[0] }} __realloc_test_possibly_invalid_realloc_l99[0] ∈ {0} [1] ∈ {1} [eva:final-states] Values at end of function test_realloc_loop: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR p2 ∈ {{ &__realloc_w_test_realloc_loop_l138[0] }} __realloc_w_test_realloc_loop_l138[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {0} [6] ∈ {1} [7] ∈ {2} [8] ∈ {3} [9] ∈ {4} [10] ∈ {0} or UNINITIALIZED [11] ∈ {1} or UNINITIALIZED [12] ∈ {2} or UNINITIALIZED [13] ∈ {3} or UNINITIALIZED [14] ∈ {4} or UNINITIALIZED [15] ∈ {0} or UNINITIALIZED [16] ∈ {1} or UNINITIALIZED [17] ∈ {2} or UNINITIALIZED [18] ∈ {3} or UNINITIALIZED [19] ∈ {4} or UNINITIALIZED [20] ∈ {0} or UNINITIALIZED [21] ∈ {1} or UNINITIALIZED [22] ∈ {2} or UNINITIALIZED [23] ∈ {3} or UNINITIALIZED [24] ∈ {4} or UNINITIALIZED [25] ∈ {0} or UNINITIALIZED [26] ∈ {1} or UNINITIALIZED [27] ∈ {2} or UNINITIALIZED [28] ∈ {3} or UNINITIALIZED [29] ∈ {4} or UNINITIALIZED [eva:final-states] Values at end of function test_realloc_multiple_bases: __fc_heap_status ∈ [--..--] p1 ∈ {{ (void *)&__malloc_test_realloc_multiple_bases_l151 }} or ESCAPINGADDR p2 ∈ {{ &__malloc_test_realloc_multiple_bases_l154[0] ; &__realloc_test_realloc_multiple_bases_l156[0] }} or ESCAPINGADDR p3 ∈ {{ &__realloc_test_realloc_multiple_bases_l158[0] }} __realloc_test_realloc_multiple_bases_l158[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [eva:final-states] Values at end of function test_realloc_multiple_bases2: __fc_heap_status ∈ [--..--] p1 ∈ {{ (void *)&__malloc_test_realloc_multiple_bases2_l163 }} or ESCAPINGADDR p2 ∈ {{ &__realloc_test_realloc_multiple_bases2_l166[0] ; &__malloc_test_realloc_multiple_bases2_l166[0] }} or ESCAPINGADDR p3 ∈ ESCAPINGADDR p4 ∈ {{ &__realloc_test_realloc_multiple_bases2_l171[0] }} or ESCAPINGADDR p5 ∈ {{ &__malloc_test_realloc_multiple_bases2_l174[0] }} or ESCAPINGADDR p6 ∈ {{ &__realloc_test_realloc_multiple_bases2_l177[0] }} __malloc_test_realloc_multiple_bases2_l163[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} __realloc_test_realloc_multiple_bases2_l166[0] ∈ {0} [1] ∈ {1; 10} [2] ∈ {2} [3] ∈ {3} [4..5] ∈ UNINITIALIZED __malloc_test_realloc_multiple_bases2_l166[0] ∈ {0} or UNINITIALIZED [1] ∈ {10} or UNINITIALIZED __realloc_test_realloc_multiple_bases2_l171[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __malloc_test_realloc_multiple_bases2_l174[0] ∈ {0} [1] ∈ {10} [2] ∈ {20} [3..5] ∈ UNINITIALIZED __realloc_test_realloc_multiple_bases2_l177[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [eva:final-states] Values at end of function test_realloc_multiple_bases_loop: __fc_heap_status ∈ [--..--] size ∈ {10} p ∈ {{ &__malloc_test_realloc_multiple_bases_loop_l184[0] ; &__realloc_w_test_realloc_multiple_bases_loop_l187[0] }} __malloc_test_realloc_multiple_bases_loop_l184[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} or UNINITIALIZED [3] ∈ {3} or UNINITIALIZED [4] ∈ {4} or UNINITIALIZED [5] ∈ {5} or UNINITIALIZED [6] ∈ {6} or UNINITIALIZED [7] ∈ {7} or UNINITIALIZED [8] ∈ {8} or UNINITIALIZED [9] ∈ {9} or UNINITIALIZED __realloc_w_test_realloc_multiple_bases_loop_l187[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} or UNINITIALIZED [3] ∈ {3} or UNINITIALIZED [4] ∈ {4} or UNINITIALIZED [5] ∈ {5} or UNINITIALIZED [6] ∈ {6} or UNINITIALIZED [7] ∈ {7} or UNINITIALIZED [8] ∈ {8} or UNINITIALIZED [9] ∈ {9} or UNINITIALIZED [10] ∈ {10} or UNINITIALIZED [11] ∈ {11} or UNINITIALIZED [12] ∈ {12} or UNINITIALIZED [13] ∈ {13} or UNINITIALIZED [14] ∈ {14} or UNINITIALIZED [15] ∈ {15} or UNINITIALIZED [16] ∈ {16} or UNINITIALIZED [17] ∈ {17} or UNINITIALIZED [18] ∈ {18} or UNINITIALIZED [19] ∈ {19} or UNINITIALIZED [20] ∈ {20} or UNINITIALIZED [21] ∈ {21} or UNINITIALIZED [22] ∈ {22} or UNINITIALIZED [23] ∈ {23} or UNINITIALIZED [24] ∈ {24} or UNINITIALIZED [25] ∈ {25} or UNINITIALIZED [26] ∈ {26} or UNINITIALIZED [27] ∈ {27} or UNINITIALIZED [eva:final-states] Values at end of function test_realloc_sequence: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR p2 ∈ ESCAPINGADDR p3 ∈ {{ &__realloc_test_realloc_sequence_l126[0] }} __realloc_test_realloc_sequence_l126[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [eva:final-states] Values at end of function test_same_size: __fc_heap_status ∈ [--..--] p1 ∈ ESCAPINGADDR p2 ∈ {{ &__realloc_test_same_size_l65[0] }} __realloc_test_same_size_l65[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] __retres ∈ {0} __realloc_test_exact_null_l27[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} __realloc_test_exact_nonnull_expand_l38[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} __realloc_test_exact_nonnull_shrink_l46[0] ∈ {0} [1] ∈ {1} __realloc_test_maybe_nonnull_l58[0] ∈ {0} [1] ∈ {1} __realloc_test_same_size_l65[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __realloc_test_imprecise_size_l70[0] ∈ {0} [1] ∈ {1} or UNINITIALIZED __realloc_test_imprecise_size_but_precise_fill_l76[0] ∈ {0} [1] ∈ UNINITIALIZED __realloc_test_imprecise_size_free_l84[0] ∈ {0} [1] ∈ {1} __realloc_test_imprecise_both_l91[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED __realloc_test_possibly_invalid_realloc_l99[0] ∈ {0} [1] ∈ {1} __realloc_test_realloc_sequence_l126[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __realloc_w_test_realloc_loop_l138[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {0} [6] ∈ {1} [7] ∈ {2} [8] ∈ {3} [9] ∈ {4} [10] ∈ {0} or UNINITIALIZED [11] ∈ {1} or UNINITIALIZED [12] ∈ {2} or UNINITIALIZED [13] ∈ {3} or UNINITIALIZED [14] ∈ {4} or UNINITIALIZED [15] ∈ {0} or UNINITIALIZED [16] ∈ {1} or UNINITIALIZED [17] ∈ {2} or UNINITIALIZED [18] ∈ {3} or UNINITIALIZED [19] ∈ {4} or UNINITIALIZED [20] ∈ {0} or UNINITIALIZED [21] ∈ {1} or UNINITIALIZED [22] ∈ {2} or UNINITIALIZED [23] ∈ {3} or UNINITIALIZED [24] ∈ {4} or UNINITIALIZED [25] ∈ {0} or UNINITIALIZED [26] ∈ {1} or UNINITIALIZED [27] ∈ {2} or UNINITIALIZED [28] ∈ {3} or UNINITIALIZED [29] ∈ {4} or UNINITIALIZED __realloc_test_realloc_multiple_bases_l158[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __malloc_test_realloc_multiple_bases2_l163[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} __realloc_test_realloc_multiple_bases2_l166[0] ∈ {0} [1] ∈ {1; 10} [2] ∈ {2} [3] ∈ {3} [4..5] ∈ UNINITIALIZED __malloc_test_realloc_multiple_bases2_l166[0] ∈ {0} or UNINITIALIZED [1] ∈ {10} or UNINITIALIZED __realloc_test_realloc_multiple_bases2_l171[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} __malloc_test_realloc_multiple_bases2_l174[0] ∈ {0} [1] ∈ {10} [2] ∈ {20} [3..5] ∈ UNINITIALIZED __realloc_test_realloc_multiple_bases2_l177[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} __malloc_test_realloc_multiple_bases_loop_l184[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} or UNINITIALIZED [3] ∈ {3} or UNINITIALIZED [4] ∈ {4} or UNINITIALIZED [5] ∈ {5} or UNINITIALIZED [6] ∈ {6} or UNINITIALIZED [7] ∈ {7} or UNINITIALIZED [8] ∈ {8} or UNINITIALIZED [9] ∈ {9} or UNINITIALIZED __realloc_w_test_realloc_multiple_bases_loop_l187[0] ∈ {0} or UNINITIALIZED [1] ∈ {1} or UNINITIALIZED [2] ∈ {2} or UNINITIALIZED [3] ∈ {3} or UNINITIALIZED [4] ∈ {4} or UNINITIALIZED [5] ∈ {5} or UNINITIALIZED [6] ∈ {6} or UNINITIALIZED [7] ∈ {7} or UNINITIALIZED [8] ∈ {8} or UNINITIALIZED [9] ∈ {9} or UNINITIALIZED [10] ∈ {10} or UNINITIALIZED [11] ∈ {11} or UNINITIALIZED [12] ∈ {12} or UNINITIALIZED [13] ∈ {13} or UNINITIALIZED [14] ∈ {14} or UNINITIALIZED [15] ∈ {15} or UNINITIALIZED [16] ∈ {16} or UNINITIALIZED [17] ∈ {17} or UNINITIALIZED [18] ∈ {18} or UNINITIALIZED [19] ∈ {19} or UNINITIALIZED [20] ∈ {20} or UNINITIALIZED [21] ∈ {21} or UNINITIALIZED [22] ∈ {22} or UNINITIALIZED [23] ∈ {23} or UNINITIALIZED [24] ∈ {24} or UNINITIALIZED [25] ∈ {25} or UNINITIALIZED [26] ∈ {26} or UNINITIALIZED [27] ∈ {27} or UNINITIALIZED [from] Computing for function fill [from] Done for function fill [from] Computing for function fill2 [from] Done for function fill2 [from] Computing for function test_exact_nonnull_expand [from] Computing for function malloc <-test_exact_nonnull_expand [from] Done for function malloc [from] Computing for function realloc <-test_exact_nonnull_expand [from] Done for function realloc [from] Done for function test_exact_nonnull_expand [from] Computing for function test_exact_nonnull_free [from] Done for function test_exact_nonnull_free [from] Computing for function test_exact_nonnull_shrink [from] Done for function test_exact_nonnull_shrink [from] Computing for function test_exact_null [from] Done for function test_exact_null [from] Computing for function test_exact_null_free [from] Done for function test_exact_null_free [from] Computing for function test_imprecise_both [from] Done for function test_imprecise_both [from] Computing for function test_imprecise_size [from] Done for function test_imprecise_size [from] Computing for function test_imprecise_size_but_precise_fill [from] Done for function test_imprecise_size_but_precise_fill [from] Computing for function test_imprecise_size_free [from] Done for function test_imprecise_size_free [from] Computing for function test_invalid_realloc [from] Non-terminating function test_invalid_realloc (no dependencies) [from] Done for function test_invalid_realloc [from] Computing for function test_invalid_realloc2 [from] Non-terminating function test_invalid_realloc2 (no dependencies) [from] Done for function test_invalid_realloc2 [from] Computing for function test_invalid_realloc3 [from] Non-terminating function test_invalid_realloc3 (no dependencies) [from] Done for function test_invalid_realloc3 [from] Computing for function test_maybe_nonnull [from] Done for function test_maybe_nonnull [from] Computing for function test_possibly_invalid_realloc [from] Done for function test_possibly_invalid_realloc [from] Computing for function test_realloc_loop [from] Done for function test_realloc_loop [from] Computing for function test_realloc_multiple_bases [from] Done for function test_realloc_multiple_bases [from] Computing for function test_realloc_multiple_bases2 [from] Done for function test_realloc_multiple_bases2 [from] Computing for function test_realloc_multiple_bases_loop [from] Done for function test_realloc_multiple_bases_loop [from] Computing for function test_realloc_sequence [from] Done for function test_realloc_sequence [from] Computing for function test_same_size [from] Done for function test_same_size [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function fill: __realloc_test_exact_null_l27[0..9] FROM b; n (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM b; n (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM b; n (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM b; n (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM b; n (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM b; n (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM b; n (and SELF) __malloc_test_same_size_l63[0..4] FROM b; n (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM b; n (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM b; n (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM b; n (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM b; n (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM b; n (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM b; n (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM b; n (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM b; n (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM b; n (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM b; n (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM b; n (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM b; n (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM b; n (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM b; n (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM b; n (and SELF) [from] Function fill2: __realloc_test_realloc_multiple_bases2_l166[0..2] FROM b; n (and SELF) __malloc_test_realloc_multiple_bases2_l166[0..1] FROM b; n (and SELF) __malloc_test_realloc_multiple_bases2_l174[0..2] FROM b; n (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function realloc: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status; ptr; size [from] Function test_exact_nonnull_expand: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status (and SELF) [from] Function test_exact_nonnull_free: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status (and SELF) [from] Function test_exact_nonnull_shrink: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status (and SELF) [from] Function test_exact_null: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status (and SELF) [from] Function test_exact_null_free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function test_imprecise_both: __fc_heap_status FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) [from] Function test_imprecise_size: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) [from] Function test_imprecise_size_but_precise_fill: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) [from] Function test_imprecise_size_free: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) [from] Function test_invalid_realloc: NON TERMINATING - NO EFFECTS [from] Function test_invalid_realloc2: NON TERMINATING - NO EFFECTS [from] Function test_invalid_realloc3: NON TERMINATING - NO EFFECTS [from] Function test_maybe_nonnull: __fc_heap_status FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) [from] Function test_possibly_invalid_realloc: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) [from] Function test_realloc_loop: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status (and SELF) [from] Function test_realloc_multiple_bases: __fc_heap_status FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) [from] Function test_realloc_multiple_bases2: __fc_heap_status FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l166[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l166[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l174[0..2] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) [from] Function test_realloc_multiple_bases_loop: __fc_heap_status FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) [from] Function test_realloc_sequence: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status (and SELF) [from] Function test_same_size: __fc_heap_status FROM __fc_heap_status (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status (and SELF) __realloc_test_same_size_l65[0] FROM __fc_heap_status __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status (and SELF) [from] Function main: __fc_heap_status FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_null_l27[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_expand_l36[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_expand_l38[0..9] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_shrink_l44[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_exact_nonnull_shrink_l46[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_exact_nonnull_free_l51[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_maybe_nonnull_l58[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_same_size_l63[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_same_size_l65[0] FROM __fc_heap_status; nondet __realloc_test_imprecise_size_l70[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_but_precise_fill_l76[0..1] FROM __fc_heap_status; nondet (and SELF) __malloc_test_imprecise_size_free_l81[0..4] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_size_free_l84[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_imprecise_both_l91[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_possibly_invalid_realloc_l99[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_sequence_l126[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_loop_l131[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_loop_l138[5..29] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases_l158[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l163[0..3] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l166[0..2] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l166[0..1] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l171[0..4] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases2_l174[0..2] FROM __fc_heap_status; nondet (and SELF) __realloc_test_realloc_multiple_bases2_l177[0..3] FROM __fc_heap_status; nondet (and SELF) __malloc_test_realloc_multiple_bases_loop_l184[0..9] FROM __fc_heap_status; nondet (and SELF) __realloc_w_test_realloc_multiple_bases_loop_l187[0..27] FROM __fc_heap_status; nondet (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== �������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/realloc_multiple.0.res.oracle����������������������������0000666�0000000�0000000�00000046772�13571573400�023144� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/realloc_multiple.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main1 <- main. Called from tests/builtins/realloc_multiple.c:75. [eva] tests/builtins/realloc_multiple.c:9: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:9: allocating variable __malloc_main1_l9 [eva] tests/builtins/realloc_multiple.c:12: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:12: allocating variable __malloc_main1_l12 [eva] computing for function Frama_C_interval <- main1 <- main. Called from tests/builtins/realloc_multiple.c:16. [eva] using specification for function Frama_C_interval [eva] tests/builtins/realloc_multiple.c:16: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc_multiple.c:21: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main1_l9[0] }} r ∈ {{ &__malloc_main1_l12[0] }} p ∈ {{ &__malloc_main1_l9[0] ; &__malloc_main1_l12[0] }} x ∈ {0; 1} v ∈ {1} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main1_l9[0..4] ∈ {5} __malloc_main1_l12[0..5] ∈ {6} ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:23: Call to builtin Frama_C_realloc_multiple for function realloc [eva] tests/builtins/realloc_multiple.c:23: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main1_l12} [eva] tests/builtins/realloc_multiple.c:23: allocating variable __realloc_main1_l23 [eva:malloc] bases_to_realloc: {__malloc_main1_l9} [eva] tests/builtins/realloc_multiple.c:23: allocating variable __realloc_main1_l23_0 [eva:malloc] tests/builtins/realloc_multiple.c:23: weak free on bases: {__malloc_main1_l9, __malloc_main1_l12} [eva] tests/builtins/realloc_multiple.c:25: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main1_l9[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main1_l12[0] }} or ESCAPINGADDR p ∈ {{ &__malloc_main1_l9[0] ; &__malloc_main1_l12[0] }} or ESCAPINGADDR x ∈ {0; 1} s ∈ {{ &__realloc_main1_l23[0] ; &__realloc_main1_l23_0[0] }} v ∈ {1} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main1_l9[0..4] ∈ {5} __malloc_main1_l12[0..5] ∈ {6} __realloc_main1_l23[0..5] ∈ {6} [6] ∈ UNINITIALIZED __realloc_main1_l23_0[0..4] ∈ {5} [5..6] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:26: Call to builtin free [eva] tests/builtins/realloc_multiple.c:26: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc_multiple.c:26: weak free on bases: {__realloc_main1_l23, __realloc_main1_l23_0} [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/builtins/realloc_multiple.c:76. [eva] tests/builtins/realloc_multiple.c:30: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:30: allocating variable __malloc_main2_l30 [eva] tests/builtins/realloc_multiple.c:33: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:33: allocating variable __malloc_main2_l33 [eva] computing for function Frama_C_interval <- main2 <- main. Called from tests/builtins/realloc_multiple.c:37. [eva] tests/builtins/realloc_multiple.c:37: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc_multiple.c:43: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main2_l30[0] }} r ∈ {{ &__malloc_main2_l33[0] }} p ∈ {{ NULL ; &__malloc_main2_l30[0] ; &__malloc_main2_l33[0] }} x ∈ {0; 1; 2} v ∈ {2} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main2_l30[0..4] ∈ {7} __malloc_main2_l33[0..5] ∈ {8} ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:45: Call to builtin Frama_C_realloc_multiple for function realloc [eva] tests/builtins/realloc_multiple.c:45: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main2_l33} [eva] tests/builtins/realloc_multiple.c:45: allocating variable __realloc_main2_l45 [eva:malloc] bases_to_realloc: {__malloc_main2_l30} [eva] tests/builtins/realloc_multiple.c:45: allocating variable __realloc_main2_l45_0 [eva:malloc] bases_to_realloc: {} [eva] tests/builtins/realloc_multiple.c:45: allocating variable __realloc_main2_l45_1 [eva:malloc] tests/builtins/realloc_multiple.c:45: weak free on bases: {__malloc_main2_l30, __malloc_main2_l33} [eva] tests/builtins/realloc_multiple.c:47: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main2_l30[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main2_l33[0] }} or ESCAPINGADDR p ∈ {{ NULL ; &__malloc_main2_l30[0] ; &__malloc_main2_l33[0] }} or ESCAPINGADDR x ∈ {0; 1; 2} s ∈ {{ &__realloc_main2_l45[0] ; &__realloc_main2_l45_0[0] ; &__realloc_main2_l45_1[0] }} v ∈ {2} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main2_l30[0..4] ∈ {7} __malloc_main2_l33[0..5] ∈ {8} __realloc_main2_l45[0..5] ∈ {8} [6] ∈ UNINITIALIZED __realloc_main2_l45_0[0..4] ∈ {7} [5..6] ∈ UNINITIALIZED __realloc_main2_l45_1[0..6] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:48: Call to builtin free [eva] tests/builtins/realloc_multiple.c:48: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc_multiple.c:48: weak free on bases: {__realloc_main2_l45, __realloc_main2_l45_0, __realloc_main2_l45_1} [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/builtins/realloc_multiple.c:77. [eva] tests/builtins/realloc_multiple.c:52: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:52: allocating variable __malloc_main3_l52 [eva] tests/builtins/realloc_multiple.c:53: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:53: allocating variable __malloc_main3_l53 [eva] computing for function Frama_C_interval <- main3 <- main. Called from tests/builtins/realloc_multiple.c:59. [eva] tests/builtins/realloc_multiple.c:59: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc_multiple.c:64: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main3_l52 }} q ∈ {{ &__malloc_main3_l53 }} r ∈ {{ NULL ; &__malloc_main3_l52 ; &__malloc_main3_l53 }} s ∈ UNINITIALIZED x ∈ UNINITIALIZED y ∈ UNINITIALIZED c ∈ {0; 1; 2} v ∈ {3} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main3_l52 ∈ {{ &x }} __malloc_main3_l53 ∈ {{ &y }} ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:65: Call to builtin Frama_C_realloc_multiple for function realloc [eva] tests/builtins/realloc_multiple.c:65: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main3_l53} [eva] tests/builtins/realloc_multiple.c:65: allocating variable __realloc_main3_l65 [eva:malloc] bases_to_realloc: {__malloc_main3_l52} [eva] tests/builtins/realloc_multiple.c:65: allocating variable __realloc_main3_l65_0 [eva:malloc] bases_to_realloc: {} [eva] tests/builtins/realloc_multiple.c:65: allocating variable __realloc_main3_l65_1 [eva:malloc] tests/builtins/realloc_multiple.c:65: weak free on bases: {__malloc_main3_l52, __malloc_main3_l53} [eva:alarm] tests/builtins/realloc_multiple.c:66: Warning: accessing uninitialized left-value. assert \initialized(s); [eva] tests/builtins/realloc_multiple.c:67: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main3_l52 }} or ESCAPINGADDR q ∈ {{ &__malloc_main3_l53 }} or ESCAPINGADDR r ∈ {{ NULL ; &__malloc_main3_l52 ; &__malloc_main3_l53 }} or ESCAPINGADDR s ∈ {{ &__realloc_main3_l65[0] ; &__realloc_main3_l65_0[0] }} x ∈ {17} or UNINITIALIZED y ∈ {17} or UNINITIALIZED c ∈ {0; 1; 2} v ∈ {3} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main3_l52 ∈ {{ &x }} __malloc_main3_l53 ∈ {{ &y }} __realloc_main3_l65[0] ∈ {{ &y }} [1] ∈ UNINITIALIZED __realloc_main3_l65_0[0] ∈ {{ &x }} [1] ∈ UNINITIALIZED __realloc_main3_l65_1[0..1] ∈ UNINITIALIZED ==END OF DUMP== [eva:locals-escaping] tests/builtins/realloc_multiple.c:67: Warning: locals {x} escaping the scope of a block of main3 through __malloc_main3_l52 [eva:locals-escaping] tests/builtins/realloc_multiple.c:67: Warning: locals {y} escaping the scope of a block of main3 through __malloc_main3_l53 [eva:locals-escaping] tests/builtins/realloc_multiple.c:67: Warning: locals {y} escaping the scope of a block of main3 through __realloc_main3_l65 [eva:locals-escaping] tests/builtins/realloc_multiple.c:67: Warning: locals {x} escaping the scope of a block of main3 through __realloc_main3_l65_0 [eva] tests/builtins/realloc_multiple.c:69: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main3_l52 }} or ESCAPINGADDR q ∈ {{ &__malloc_main3_l53 }} or ESCAPINGADDR r ∈ {{ NULL ; &__malloc_main3_l52 ; &__malloc_main3_l53 }} or ESCAPINGADDR s ∈ {{ &__realloc_main3_l65[0] ; &__realloc_main3_l65_0[0] }} v ∈ {3} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main3_l52 ∈ ESCAPINGADDR __malloc_main3_l53 ∈ ESCAPINGADDR __realloc_main3_l65[0] ∈ ESCAPINGADDR [1] ∈ UNINITIALIZED __realloc_main3_l65_0[0] ∈ ESCAPINGADDR [1] ∈ UNINITIALIZED __realloc_main3_l65_1[0..1] ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/builtins/realloc_multiple.c:70: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&q); [eva] tests/builtins/realloc_multiple.c:70: Call to builtin free [eva] tests/builtins/realloc_multiple.c:70: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc_multiple.c:70: strong free on bases: {__malloc_main3_l53} [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main1_l9[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main1_l12[0] }} or ESCAPINGADDR p ∈ {{ &__malloc_main1_l9[0] ; &__malloc_main1_l12[0] }} or ESCAPINGADDR x ∈ {0; 1} s ∈ {{ &__realloc_main1_l23[0] ; &__realloc_main1_l23_0[0] }} or ESCAPINGADDR __malloc_main1_l9[0..4] ∈ {5} __malloc_main1_l12[0..5] ∈ {6} [eva:final-states] Values at end of function main2: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main2_l30[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main2_l33[0] }} or ESCAPINGADDR p ∈ {{ NULL ; &__malloc_main2_l30[0] ; &__malloc_main2_l33[0] }} or ESCAPINGADDR x ∈ {0; 1; 2} s ∈ {{ &__realloc_main2_l45[0] ; &__realloc_main2_l45_0[0] ; &__realloc_main2_l45_1[0] }} or ESCAPINGADDR __malloc_main2_l30[0..4] ∈ {7} __malloc_main2_l33[0..5] ∈ {8} [eva:final-states] Values at end of function main3: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main3_l52 }} or ESCAPINGADDR q ∈ ESCAPINGADDR r ∈ {{ NULL ; &__malloc_main3_l52 }} or ESCAPINGADDR s ∈ {{ &__realloc_main3_l65[0] ; &__realloc_main3_l65_0[0] }} __malloc_main3_l52 ∈ ESCAPINGADDR [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] __malloc_main1_l9[0..4] ∈ {5} __malloc_main1_l12[0..5] ∈ {6} __malloc_main2_l30[0..4] ∈ {7} __malloc_main2_l33[0..5] ∈ {8} __malloc_main3_l52 ∈ ESCAPINGADDR [from] Computing for function main1 [from] Computing for function malloc <-main1 [from] Done for function malloc [from] Computing for function Frama_C_interval <-main1 [from] Done for function Frama_C_interval [from] Computing for function realloc <-main1 [from] Done for function realloc [from] Computing for function free <-main1 [from] Done for function free [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function realloc: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status; ptr; size [from] Function main1: __fc_heap_status FROM __fc_heap_status (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main1_l9[0..4] FROM __fc_heap_status (and SELF) __malloc_main1_l12[0..5] FROM __fc_heap_status (and SELF) [from] Function main2: __fc_heap_status FROM __fc_heap_status (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main2_l30[0..4] FROM __fc_heap_status (and SELF) __malloc_main2_l33[0..5] FROM __fc_heap_status (and SELF) [from] Function main3: __fc_heap_status FROM __fc_heap_status (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main3_l52 FROM __fc_heap_status __malloc_main3_l53 FROM __fc_heap_status [from] Function main: __fc_heap_status FROM __fc_heap_status; v (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source; v (and SELF) __malloc_main1_l9[0..4] FROM __fc_heap_status; v (and SELF) __malloc_main1_l12[0..5] FROM __fc_heap_status; v (and SELF) __malloc_main2_l30[0..4] FROM __fc_heap_status; v (and SELF) __malloc_main2_l33[0..5] FROM __fc_heap_status; v (and SELF) __malloc_main3_l52 FROM __fc_heap_status; v (and SELF) __malloc_main3_l53 FROM __fc_heap_status; v (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: __fc_heap_status; Frama_C_entropy_source; q; i; r; i_0; p; x; s; __malloc_main1_l9[0..4]; __malloc_main1_l12[0..5] [inout] Inputs for function main1: __fc_heap_status; Frama_C_entropy_source [inout] Out (internal) for function main2: __fc_heap_status; Frama_C_entropy_source; q; i; r; i_0; p; x; s; __malloc_main2_l30[0..4]; __malloc_main2_l33[0..5] [inout] Inputs for function main2: __fc_heap_status; Frama_C_entropy_source [inout] Out (internal) for function main3: __fc_heap_status; Frama_C_entropy_source; p; q; r; s; x; y; c; __malloc_main3_l52; __malloc_main3_l53 [inout] Inputs for function main3: __fc_heap_status; Frama_C_entropy_source; __realloc_main3_l65[0]; __realloc_main3_l65_0[0]; __realloc_main3_l65_1[0] [inout] Out (internal) for function main: __fc_heap_status; Frama_C_entropy_source; __malloc_main1_l9[0..4]; __malloc_main1_l12[0..5]; __malloc_main2_l30[0..4]; __malloc_main2_l33[0..5]; __malloc_main3_l52; __malloc_main3_l53 [inout] Inputs for function main: __fc_heap_status; Frama_C_entropy_source; __realloc_main3_l65[0]; __realloc_main3_l65_0[0]; __realloc_main3_l65_1[0] ������frama-c-20.0-Calcium/tests/builtins/oracle/realloc_multiple.1.res.oracle����������������������������0000666�0000000�0000000�00000056651�13571573400�023142� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/realloc_multiple.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main1 <- main. Called from tests/builtins/realloc_multiple.c:75. [eva] tests/builtins/realloc_multiple.c:9: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:9: allocating variable __malloc_main1_l9 [eva:alarm] tests/builtins/realloc_multiple.c:10: Warning: out of bounds write. assert \valid(q + i); [kernel] tests/builtins/realloc_multiple.c:10: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/realloc_multiple.c:12: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:12: allocating variable __malloc_main1_l12 [eva:alarm] tests/builtins/realloc_multiple.c:13: Warning: out of bounds write. assert \valid(r + i_0); [kernel] tests/builtins/realloc_multiple.c:13: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] computing for function Frama_C_interval <- main1 <- main. Called from tests/builtins/realloc_multiple.c:16. [eva] using specification for function Frama_C_interval [eva] tests/builtins/realloc_multiple.c:16: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc_multiple.c:21: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main1_l9[0] }} r ∈ {{ &__malloc_main1_l12[0] }} p ∈ {{ &__malloc_main1_l9[0] ; &__malloc_main1_l12[0] }} x ∈ {0; 1} v ∈ {1} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main1_l9[0..4] ∈ {5} __malloc_main1_l12[0..5] ∈ {6} ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:23: Call to builtin Frama_C_realloc_multiple for function realloc [eva] tests/builtins/realloc_multiple.c:23: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main1_l12} [eva] tests/builtins/realloc_multiple.c:23: allocating variable __realloc_main1_l23 [eva:malloc] bases_to_realloc: {__malloc_main1_l9} [eva] tests/builtins/realloc_multiple.c:23: allocating variable __realloc_main1_l23_0 [eva:malloc] tests/builtins/realloc_multiple.c:23: weak free on bases: {__malloc_main1_l9, __malloc_main1_l12} [eva] tests/builtins/realloc_multiple.c:25: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main1_l9[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main1_l12[0] }} or ESCAPINGADDR p ∈ {{ &__malloc_main1_l9[0] ; &__malloc_main1_l12[0] }} or ESCAPINGADDR x ∈ {0; 1} s ∈ {{ &__realloc_main1_l23[0] ; &__realloc_main1_l23_0[0] }} v ∈ {1} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main1_l9[0..4] ∈ {5} __malloc_main1_l12[0..5] ∈ {6} __realloc_main1_l23[0..5] ∈ {6} [6] ∈ UNINITIALIZED __realloc_main1_l23_0[0..4] ∈ {5} [5..6] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:25: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main1_l9[0] }} r ∈ {{ &__malloc_main1_l12[0] }} p ∈ {{ &__malloc_main1_l9[0] ; &__malloc_main1_l12[0] }} x ∈ {0; 1} s ∈ {0} v ∈ {1} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main1_l9[0..4] ∈ {5} __malloc_main1_l12[0..5] ∈ {6} ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:26: Call to builtin free [eva] tests/builtins/realloc_multiple.c:26: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc_multiple.c:26: weak free on bases: {__realloc_main1_l23, __realloc_main1_l23_0} [eva] tests/builtins/realloc_multiple.c:26: Call to builtin free [eva:malloc] tests/builtins/realloc_multiple.c:26: strong free on bases: {} [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/builtins/realloc_multiple.c:76. [eva] tests/builtins/realloc_multiple.c:30: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:30: allocating variable __malloc_main2_l30 [eva:alarm] tests/builtins/realloc_multiple.c:31: Warning: out of bounds write. assert \valid(q + i); [kernel] tests/builtins/realloc_multiple.c:31: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/realloc_multiple.c:33: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:33: allocating variable __malloc_main2_l33 [eva:alarm] tests/builtins/realloc_multiple.c:34: Warning: out of bounds write. assert \valid(r + i_0); [kernel] tests/builtins/realloc_multiple.c:34: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] computing for function Frama_C_interval <- main2 <- main. Called from tests/builtins/realloc_multiple.c:37. [eva] tests/builtins/realloc_multiple.c:37: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc_multiple.c:43: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main2_l30[0] }} r ∈ {{ &__malloc_main2_l33[0] }} p ∈ {{ NULL ; &__malloc_main2_l30[0] ; &__malloc_main2_l33[0] }} x ∈ {0; 1; 2} v ∈ {2} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main2_l30[0..4] ∈ {7} __malloc_main2_l33[0..5] ∈ {8} ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:45: Call to builtin Frama_C_realloc_multiple for function realloc [eva] tests/builtins/realloc_multiple.c:45: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main2_l33} [eva] tests/builtins/realloc_multiple.c:45: allocating variable __realloc_main2_l45 [eva:malloc] bases_to_realloc: {__malloc_main2_l30} [eva] tests/builtins/realloc_multiple.c:45: allocating variable __realloc_main2_l45_0 [eva:malloc] bases_to_realloc: {} [eva] tests/builtins/realloc_multiple.c:45: allocating variable __realloc_main2_l45_1 [eva:malloc] tests/builtins/realloc_multiple.c:45: weak free on bases: {__malloc_main2_l30, __malloc_main2_l33} [eva] tests/builtins/realloc_multiple.c:47: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main2_l30[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main2_l33[0] }} or ESCAPINGADDR p ∈ {{ NULL ; &__malloc_main2_l30[0] ; &__malloc_main2_l33[0] }} or ESCAPINGADDR x ∈ {0; 1; 2} s ∈ {{ &__realloc_main2_l45[0] ; &__realloc_main2_l45_0[0] ; &__realloc_main2_l45_1[0] }} v ∈ {2} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main2_l30[0..4] ∈ {7} __malloc_main2_l33[0..5] ∈ {8} __realloc_main2_l45[0..5] ∈ {8} [6] ∈ UNINITIALIZED __realloc_main2_l45_0[0..4] ∈ {7} [5..6] ∈ UNINITIALIZED __realloc_main2_l45_1[0..6] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:47: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main2_l30[0] }} r ∈ {{ &__malloc_main2_l33[0] }} p ∈ {{ NULL ; &__malloc_main2_l30[0] ; &__malloc_main2_l33[0] }} x ∈ {0; 1; 2} s ∈ {0} v ∈ {2} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main2_l30[0..4] ∈ {7} __malloc_main2_l33[0..5] ∈ {8} ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:48: Call to builtin free [eva] tests/builtins/realloc_multiple.c:48: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc_multiple.c:48: weak free on bases: {__realloc_main2_l45, __realloc_main2_l45_0, __realloc_main2_l45_1} [eva] tests/builtins/realloc_multiple.c:48: Call to builtin free [eva:malloc] tests/builtins/realloc_multiple.c:48: strong free on bases: {} [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/builtins/realloc_multiple.c:77. [eva] tests/builtins/realloc_multiple.c:52: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:52: allocating variable __malloc_main3_l52 [eva] tests/builtins/realloc_multiple.c:53: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:53: allocating variable __malloc_main3_l53 [eva] tests/builtins/realloc_multiple.c:53: Call to builtin Frama_C_malloc_fresh for function malloc [eva] tests/builtins/realloc_multiple.c:53: allocating variable __malloc_main3_l53_0 [eva:alarm] tests/builtins/realloc_multiple.c:57: Warning: out of bounds write. assert \valid(p); [kernel] tests/builtins/realloc_multiple.c:57: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/builtins/realloc_multiple.c:58: Warning: out of bounds write. assert \valid(q); [kernel] tests/builtins/realloc_multiple.c:58: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] computing for function Frama_C_interval <- main3 <- main. Called from tests/builtins/realloc_multiple.c:59. [eva] tests/builtins/realloc_multiple.c:59: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/realloc_multiple.c:64: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main3_l52 }} q ∈ {{ &__malloc_main3_l53 }} r ∈ {{ NULL ; &__malloc_main3_l52 ; &__malloc_main3_l53 }} s ∈ UNINITIALIZED x ∈ UNINITIALIZED y ∈ UNINITIALIZED c ∈ {0; 1; 2} v ∈ {3} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main3_l52 ∈ {{ &x }} __malloc_main3_l53 ∈ {{ &y }} ==END OF DUMP== [eva] tests/builtins/realloc_multiple.c:65: Call to builtin Frama_C_realloc_multiple for function realloc [eva] tests/builtins/realloc_multiple.c:65: function realloc: precondition 'freeable' got status valid. [eva:malloc] bases_to_realloc: {__malloc_main3_l53} [eva] tests/builtins/realloc_multiple.c:65: allocating variable __realloc_main3_l65 [eva:malloc] bases_to_realloc: {__malloc_main3_l52} [eva] tests/builtins/realloc_multiple.c:65: allocating variable __realloc_main3_l65_0 [eva:malloc] bases_to_realloc: {} [eva] tests/builtins/realloc_multiple.c:65: allocating variable __realloc_main3_l65_1 [eva:malloc] tests/builtins/realloc_multiple.c:65: weak free on bases: {__malloc_main3_l52, __malloc_main3_l53} [eva:alarm] tests/builtins/realloc_multiple.c:66: Warning: accessing uninitialized left-value. assert \initialized(s); [eva:alarm] tests/builtins/realloc_multiple.c:66: Warning: out of bounds read. assert \valid_read(s); [kernel] tests/builtins/realloc_multiple.c:66: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/builtins/realloc_multiple.c:67: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main3_l52 }} or ESCAPINGADDR q ∈ {{ &__malloc_main3_l53 }} or ESCAPINGADDR r ∈ {{ NULL ; &__malloc_main3_l52 ; &__malloc_main3_l53 }} or ESCAPINGADDR s ∈ {{ &__realloc_main3_l65[0] ; &__realloc_main3_l65_0[0] }} x ∈ {17} or UNINITIALIZED y ∈ {17} or UNINITIALIZED c ∈ {0; 1; 2} v ∈ {3} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main3_l52 ∈ {{ &x }} __malloc_main3_l53 ∈ {{ &y }} __realloc_main3_l65[0] ∈ {{ &y }} [1] ∈ UNINITIALIZED __realloc_main3_l65_0[0] ∈ {{ &x }} [1] ∈ UNINITIALIZED __realloc_main3_l65_1[0..1] ∈ UNINITIALIZED ==END OF DUMP== [eva:locals-escaping] tests/builtins/realloc_multiple.c:67: Warning: locals {x} escaping the scope of a block of main3 through __malloc_main3_l52 [eva:locals-escaping] tests/builtins/realloc_multiple.c:67: Warning: locals {y} escaping the scope of a block of main3 through __malloc_main3_l53 [eva:locals-escaping] tests/builtins/realloc_multiple.c:67: Warning: locals {y} escaping the scope of a block of main3 through __realloc_main3_l65 [eva:locals-escaping] tests/builtins/realloc_multiple.c:67: Warning: locals {x} escaping the scope of a block of main3 through __realloc_main3_l65_0 [eva] tests/builtins/realloc_multiple.c:69: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main3_l52 }} or ESCAPINGADDR q ∈ {{ &__malloc_main3_l53 }} or ESCAPINGADDR r ∈ {{ NULL ; &__malloc_main3_l52 ; &__malloc_main3_l53 }} or ESCAPINGADDR s ∈ {{ &__realloc_main3_l65[0] ; &__realloc_main3_l65_0[0] }} v ∈ {3} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] __malloc_main3_l52 ∈ ESCAPINGADDR __malloc_main3_l53 ∈ ESCAPINGADDR __realloc_main3_l65[0] ∈ ESCAPINGADDR [1] ∈ UNINITIALIZED __realloc_main3_l65_0[0] ∈ ESCAPINGADDR [1] ∈ UNINITIALIZED __realloc_main3_l65_1[0..1] ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/builtins/realloc_multiple.c:70: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&q); [eva] tests/builtins/realloc_multiple.c:70: Call to builtin free [eva] tests/builtins/realloc_multiple.c:70: function free: precondition 'freeable' got status valid. [eva:malloc] tests/builtins/realloc_multiple.c:70: strong free on bases: {__malloc_main3_l53} [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main1_l9[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main1_l12[0] }} or ESCAPINGADDR p ∈ {{ &__malloc_main1_l9[0] ; &__malloc_main1_l12[0] }} or ESCAPINGADDR x ∈ {0; 1} s ∈ {{ NULL ; &__realloc_main1_l23[0] ; &__realloc_main1_l23_0[0] }} or ESCAPINGADDR __malloc_main1_l9[0..4] ∈ {5} __malloc_main1_l12[0..5] ∈ {6} [eva:final-states] Values at end of function main2: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] q ∈ {{ &__malloc_main2_l30[0] }} or ESCAPINGADDR r ∈ {{ &__malloc_main2_l33[0] }} or ESCAPINGADDR p ∈ {{ NULL ; &__malloc_main2_l30[0] ; &__malloc_main2_l33[0] }} or ESCAPINGADDR x ∈ {0; 1; 2} s ∈ {{ NULL ; &__realloc_main2_l45[0] ; &__realloc_main2_l45_0[0] ; &__realloc_main2_l45_1[0] }} or ESCAPINGADDR __malloc_main2_l30[0..4] ∈ {7} __malloc_main2_l33[0..5] ∈ {8} [eva:final-states] Values at end of function main3: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__malloc_main3_l52 }} or ESCAPINGADDR q ∈ ESCAPINGADDR r ∈ {{ NULL ; &__malloc_main3_l52 }} or ESCAPINGADDR s ∈ {{ &__realloc_main3_l65[0] ; &__realloc_main3_l65_0[0] }} __malloc_main3_l52 ∈ ESCAPINGADDR [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] __malloc_main1_l9[0..4] ∈ {5} __malloc_main1_l12[0..5] ∈ {6} __malloc_main2_l30[0..4] ∈ {7} __malloc_main2_l33[0..5] ∈ {8} __malloc_main3_l52 ∈ ESCAPINGADDR [from] Computing for function main1 [from] Computing for function malloc <-main1 [from] Done for function malloc [from] Computing for function Frama_C_interval <-main1 [from] Done for function Frama_C_interval [from] Computing for function realloc <-main1 [from] Done for function realloc [from] Computing for function free <-main1 [from] Done for function free [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function realloc: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status; ptr; size [from] Function main1: __fc_heap_status FROM __fc_heap_status (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main1_l9[0..4] FROM __fc_heap_status (and SELF) __malloc_main1_l12[0..5] FROM __fc_heap_status (and SELF) [from] Function main2: __fc_heap_status FROM __fc_heap_status (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main2_l30[0..4] FROM __fc_heap_status (and SELF) __malloc_main2_l33[0..5] FROM __fc_heap_status (and SELF) [from] Function main3: __fc_heap_status FROM __fc_heap_status (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) __malloc_main3_l52 FROM __fc_heap_status __malloc_main3_l53 FROM __fc_heap_status [from] Function main: __fc_heap_status FROM __fc_heap_status; v (and SELF) Frama_C_entropy_source FROM Frama_C_entropy_source; v (and SELF) __malloc_main1_l9[0..4] FROM __fc_heap_status; v (and SELF) __malloc_main1_l12[0..5] FROM __fc_heap_status; v (and SELF) __malloc_main2_l30[0..4] FROM __fc_heap_status; v (and SELF) __malloc_main2_l33[0..5] FROM __fc_heap_status; v (and SELF) __malloc_main3_l52 FROM __fc_heap_status; v (and SELF) __malloc_main3_l53 FROM __fc_heap_status; v (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: __fc_heap_status; Frama_C_entropy_source; q; i; r; i_0; p; x; s; __malloc_main1_l9[0..4]; __malloc_main1_l12[0..5] [inout] Inputs for function main1: __fc_heap_status; Frama_C_entropy_source [inout] Out (internal) for function main2: __fc_heap_status; Frama_C_entropy_source; q; i; r; i_0; p; x; s; __malloc_main2_l30[0..4]; __malloc_main2_l33[0..5] [inout] Inputs for function main2: __fc_heap_status; Frama_C_entropy_source [inout] Out (internal) for function main3: __fc_heap_status; Frama_C_entropy_source; p; q; r; s; x; y; c; __malloc_main3_l52; __malloc_main3_l53 [inout] Inputs for function main3: __fc_heap_status; Frama_C_entropy_source; __realloc_main3_l65[0]; __realloc_main3_l65_0[0]; __realloc_main3_l65_1[0] [inout] Out (internal) for function main: __fc_heap_status; Frama_C_entropy_source; __malloc_main1_l9[0..4]; __malloc_main1_l12[0..5]; __malloc_main2_l30[0..4]; __malloc_main2_l33[0..5]; __malloc_main3_l52; __malloc_main3_l53 [inout] Inputs for function main: __fc_heap_status; Frama_C_entropy_source; __realloc_main3_l65[0]; __realloc_main3_l65_0[0]; __realloc_main3_l65_1[0] ���������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/str_allocated.res.oracle���������������������������������0000666�0000000�0000000�00000006741�13571573400�022262� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/str_allocated.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function memchr_bug <- main. Called from tests/builtins/str_allocated.c:19. [eva] tests/builtins/str_allocated.c:12: Call to builtin malloc [eva] tests/builtins/str_allocated.c:12: allocating variable __malloc_memchr_bug_l12 [eva] tests/builtins/str_allocated.c:11: starting to merge loop iterations [eva] tests/builtins/str_allocated.c:12: Call to builtin malloc [eva:malloc:weak] tests/builtins/str_allocated.c:12: marking variable `__malloc_memchr_bug_l12' as weak [eva:malloc] tests/builtins/str_allocated.c:12: resizing variable `__malloc_w_memchr_bug_l12' (0..-1) to fit 0..-1/7 [eva] tests/builtins/str_allocated.c:12: Call to builtin malloc [eva:alarm] tests/builtins/str_allocated.c:14: Warning: accessing uninitialized left-value. assert \initialized(&b); [eva] tests/builtins/str_allocated.c:14: Call to builtin memchr [eva] share/libc/string.h:69: Cannot evaluate range bound memchr_off((char *)s, c, n) (unsupported ACSL construct: logic function memchr_off). Approximating [eva:alarm] tests/builtins/str_allocated.c:14: Warning: function memchr: precondition 'valid' got status unknown. [eva] share/libc/string.h:72: Cannot evaluate range bound memchr_off((char *)s, c, n) (unsupported ACSL construct: logic function memchr_off). Approximating [eva:alarm] tests/builtins/str_allocated.c:14: Warning: function memchr: precondition 'initialization' got status unknown. [eva:alarm] tests/builtins/str_allocated.c:14: Warning: function memchr: precondition 'danglingness' got status unknown. [eva] share/libc/string.h:78: cannot evaluate ACSL term, unsupported ACSL construct: logic function memchr [eva] share/libc/string.h:85: cannot evaluate ACSL term, unsupported ACSL construct: logic function memchr [eva] Recording results for memchr_bug [eva] Done for function memchr_bug [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function memchr_bug: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] __retres ∈ {0} [from] Computing for function memchr_bug [from] Computing for function malloc <-memchr_bug [from] Done for function malloc [from] Computing for function memchr <-memchr_bug [from] Done for function memchr [from] Non-terminating function memchr_bug (no dependencies) [from] Done for function memchr_bug [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function memchr: \result FROM s; c; __malloc_w_memchr_bug_l12[0] [from] Function memchr_bug: NON TERMINATING - NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function memchr_bug: __fc_heap_status; b; i [inout] Inputs for function memchr_bug: __fc_heap_status; __malloc_w_memchr_bug_l12[0] [inout] Out (internal) for function main: __fc_heap_status; __retres [inout] Inputs for function main: __fc_heap_status; nondet; __malloc_w_memchr_bug_l12[0] �������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/strchr.res.oracle����������������������������������������0000666�0000000�0000000�00000155735�13571573400�020757� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/strchr.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization tab_str[0] ∈ {{ "" }} [1] ∈ {{ "a" }} [2] ∈ {{ "aa" }} [3] ∈ {{ "aaa" }} [4] ∈ {{ "aaaa" }} [5] ∈ {{ "aaaaa" }} [6] ∈ {{ "aaaaaa" }} [7] ∈ {{ "aaaaaaaaa" }} [8] ∈ {{ "aaaaaaaaaa" }} [9] ∈ {{ "aaaaaaaaaaa" }} [10] ∈ {{ "aaaaaaaaaaaa" }} [11] ∈ {{ "aaaaaaaaaaaaa" }} nondet ∈ [--..--] strchr_misc_static_str ∈ {0} strchr_misc_zero_str ∈ {0} [eva] computing for function strchr_small_sets <- main. Called from tests/builtins/strchr.c:546. [eva] tests/builtins/strchr.c:88: Call to builtin strchr [eva] tests/builtins/strchr.c:88: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:88: Frama_C_show_each_mystrchr: {3} [eva] tests/builtins/strchr.c:89: assertion got status valid. [eva] tests/builtins/strchr.c:92: Call to builtin strchr [eva] tests/builtins/strchr.c:92: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:92: Frama_C_show_each_mystrchr: {0; 3} [eva] tests/builtins/strchr.c:93: assertion got status valid. [eva] tests/builtins/strchr.c:95: Call to builtin strchr [eva] tests/builtins/strchr.c:95: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:95: Frama_C_show_each_mystrchr: {0} [eva] tests/builtins/strchr.c:96: assertion got status valid. [eva] tests/builtins/strchr.c:99: Call to builtin strchr [eva] tests/builtins/strchr.c:99: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:99: Frama_C_show_each_mystrchr: {1; 3} [eva] tests/builtins/strchr.c:100: assertion got status valid. [eva] tests/builtins/strchr.c:104: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:104: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:104: Frama_C_show_each_mystrchr: {0; 1} [eva] tests/builtins/strchr.c:105: assertion got status valid. [eva] Recording results for strchr_small_sets [eva] Done for function strchr_small_sets [eva] computing for function strchr_zero_termination <- main. Called from tests/builtins/strchr.c:547. [eva] tests/builtins/strchr.c:113: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:113: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:113: Frama_C_show_each_mystrchr: {0} [eva] tests/builtins/strchr.c:114: assertion got status valid. [eva] tests/builtins/strchr.c:118: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:118: Warning: function strchr: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strchr.c:124: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:124: Warning: function strchr: precondition 'valid_string_s' got status invalid. [eva] Recording results for strchr_zero_termination [eva] Done for function strchr_zero_termination [eva] computing for function strchr_initialization <- main. Called from tests/builtins/strchr.c:548. [eva] tests/builtins/strchr.c:132: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:132: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:132: Frama_C_show_each_mystrchr: {0} [eva] tests/builtins/strchr.c:133: assertion got status valid. [eva] tests/builtins/strchr.c:136: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:136: Warning: function strchr: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strchr.c:141: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:141: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:141: Frama_C_show_each_mystrchr: {1} [eva] tests/builtins/strchr.c:142: assertion got status valid. [eva] tests/builtins/strchr.c:148: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:148: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:148: Frama_C_show_each_mystrchr: {3} [eva] tests/builtins/strchr.c:149: assertion got status valid. [eva] Recording results for strchr_initialization [eva] Done for function strchr_initialization [eva] computing for function strchr_large <- main. Called from tests/builtins/strchr.c:549. [eva] computing for function init_array_nondet <- strchr_large <- main. Called from tests/builtins/strchr.c:197. [eva] tests/builtins/strchr.c:189: Call to builtin memset [eva] tests/builtins/strchr.c:189: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- strchr_large <- main. Called from tests/builtins/strchr.c:200. [eva] using specification for function Frama_C_interval [eva] tests/builtins/strchr.c:200: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strchr.c:201: Call to builtin strchr [eva] tests/builtins/strchr.c:201: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:201: Frama_C_show_each_mystrchr: {20; 75} [eva] tests/builtins/strchr.c:202: assertion got status valid. [eva] computing for function Frama_C_interval <- strchr_large <- main. Called from tests/builtins/strchr.c:204. [eva] tests/builtins/strchr.c:204: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strchr.c:205: Call to builtin strchr [eva] tests/builtins/strchr.c:205: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:205: Frama_C_show_each_mystrchr: {20} [eva] tests/builtins/strchr.c:206: assertion got status valid. [eva] tests/builtins/strchr.c:207: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- strchr_large <- main. Called from tests/builtins/strchr.c:209. [eva] tests/builtins/strchr.c:209: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strchr.c:210: Call to builtin strchr [eva] tests/builtins/strchr.c:210: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:210: Frama_C_show_each_mystrchr: {75} [eva] tests/builtins/strchr.c:211: assertion got status valid. [eva] tests/builtins/strchr.c:212: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- strchr_large <- main. Called from tests/builtins/strchr.c:214. [eva] tests/builtins/strchr.c:214: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strchr.c:215: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:215: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:215: Frama_C_show_each_mystrchr: {75} [eva] tests/builtins/strchr.c:216: assertion got status valid. [eva] tests/builtins/strchr.c:217: assertion 'refined' got status valid. [eva] computing for function init_array_nondet <- strchr_large <- main. Called from tests/builtins/strchr.c:219. [eva] tests/builtins/strchr.c:189: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- strchr_large <- main. Called from tests/builtins/strchr.c:220. [eva] tests/builtins/strchr.c:220: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strchr.c:221: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:221: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:221: Frama_C_show_each_mystrchr: [50..99] [eva] tests/builtins/strchr.c:222: assertion got status valid. [eva] Recording results for strchr_large [eva] Done for function strchr_large [eva] computing for function strchr_large_uninit <- main. Called from tests/builtins/strchr.c:550. [eva] computing for function init_array_nondet <- strchr_large_uninit <- main. Called from tests/builtins/strchr.c:229. [eva] tests/builtins/strchr.c:189: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- strchr_large_uninit <- main. Called from tests/builtins/strchr.c:230. [eva] tests/builtins/strchr.c:189: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- strchr_large_uninit <- main. Called from tests/builtins/strchr.c:234. [eva] tests/builtins/strchr.c:234: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strchr.c:235: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:235: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:235: Frama_C_show_each_mystrchr: {20} [eva] tests/builtins/strchr.c:236: assertion got status valid. [eva] tests/builtins/strchr.c:237: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- strchr_large_uninit <- main. Called from tests/builtins/strchr.c:240. [eva] tests/builtins/strchr.c:240: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strchr.c:241: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:241: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:241: Frama_C_show_each_mystrchr: {75} [eva] tests/builtins/strchr.c:242: assertion got status valid. [eva] tests/builtins/strchr.c:243: assertion 'refined' got status valid. [eva] computing for function Frama_C_interval <- strchr_large_uninit <- main. Called from tests/builtins/strchr.c:245. [eva] tests/builtins/strchr.c:245: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strchr.c:246: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:246: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:246: Frama_C_show_each_mystrchr: {75} [eva] tests/builtins/strchr.c:247: assertion got status valid. [eva] tests/builtins/strchr.c:248: assertion 'refined' got status valid. [eva] Recording results for strchr_large_uninit [eva] Done for function strchr_large_uninit [eva] computing for function strchr_misc_array <- main. Called from tests/builtins/strchr.c:551. [eva] computing for function Frama_C_interval <- strchr_misc_array <- main. Called from tests/builtins/strchr.c:270. [eva] tests/builtins/strchr.c:270: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strchr.c:271: Call to builtin strchr [eva] tests/builtins/strchr.c:271: function strchr: precondition 'valid_string_s' got status valid. [eva:alarm] tests/builtins/strchr.c:271: Warning: pointer subtraction. assert \base_addr(_ss) ≡ \base_addr(tab_str[i]); [eva] tests/builtins/strchr.c:271: Frama_C_show_each_mystrchr: [0..13] [eva] tests/builtins/strchr.c:272: assertion got status valid. [eva] Recording results for strchr_misc_array [eva] Done for function strchr_misc_array [eva] computing for function strchr_misc <- main. Called from tests/builtins/strchr.c:552. [eva] tests/builtins/strchr.c:301: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:301: Warning: function strchr: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strchr.c:304: Call to builtin strchr [eva] tests/builtins/strchr.c:304: function strchr: precondition 'valid_string_s' got status valid. [eva:alarm] tests/builtins/strchr.c:304: Warning: pointer subtraction. assert \base_addr(_ss) ≡ \base_addr(str); [eva] tests/builtins/strchr.c:304: Frama_C_show_each_mystrchr: {12; 14} [eva] tests/builtins/strchr.c:305: assertion got status valid. [eva] tests/builtins/strchr.c:307: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:307: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:307: Frama_C_show_each_mystrchr2: {0} [eva] tests/builtins/strchr.c:308: assertion got status valid. [eva] tests/builtins/strchr.c:310: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:310: Warning: function strchr: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strchr.c:311: Call to builtin strchr [eva] tests/builtins/strchr.c:311: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:311: Frama_C_show_each_mystrchr: {3} [eva] tests/builtins/strchr.c:312: assertion got status valid. [eva] tests/builtins/strchr.c:313: Call to builtin strchr [eva] tests/builtins/strchr.c:313: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:313: Frama_C_show_each_mystrchr: {4} [eva] tests/builtins/strchr.c:314: assertion got status valid. [eva] tests/builtins/strchr.c:315: Call to builtin strchr [eva] tests/builtins/strchr.c:315: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:315: Frama_C_show_each_mystrchr: {5} [eva] tests/builtins/strchr.c:316: assertion got status valid. [eva] tests/builtins/strchr.c:317: Call to builtin strchr [eva] tests/builtins/strchr.c:317: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:317: Frama_C_show_each_mystrchr: {9} [eva] tests/builtins/strchr.c:318: assertion got status valid. [eva] Recording results for strchr_misc [eva] Done for function strchr_misc [eva] computing for function strchr_misc2 <- main. Called from tests/builtins/strchr.c:553. [eva] tests/builtins/strchr.c:326: Call to builtin strchr [eva] tests/builtins/strchr.c:326: function strchr: precondition 'valid_string_s' got status valid. [eva:alarm] tests/builtins/strchr.c:326: Warning: pointer subtraction. assert \base_addr(_s) ≡ \base_addr(s1); [eva] tests/builtins/strchr.c:326: Frama_C_show_each_mystrchr2: {3; 4} [eva] tests/builtins/strchr.c:327: assertion got status valid. [eva] tests/builtins/strchr.c:330: Call to builtin strchr [eva] tests/builtins/strchr.c:330: function strchr: precondition 'valid_string_s' got status valid. [eva:alarm] tests/builtins/strchr.c:330: Warning: pointer subtraction. assert \base_addr(_s_0) ≡ \base_addr(s1); [eva] tests/builtins/strchr.c:330: Frama_C_show_each_mystrchr2: {3; 4} [eva] tests/builtins/strchr.c:331: assertion got status valid. [eva] tests/builtins/strchr.c:335: Call to builtin strchr [eva] tests/builtins/strchr.c:335: function strchr: precondition 'valid_string_s' got status valid. [eva:alarm] tests/builtins/strchr.c:335: Warning: pointer subtraction. assert \base_addr(_ss) ≡ \base_addr(s1); [eva] tests/builtins/strchr.c:335: Frama_C_show_each_mystrchr: {3; 4} [eva] tests/builtins/strchr.c:336: assertion got status valid. [eva] tests/builtins/strchr.c:334: starting to merge loop iterations [eva] tests/builtins/strchr.c:335: Call to builtin strchr [eva] tests/builtins/strchr.c:335: Frama_C_show_each_mystrchr: {3; 4} [eva] tests/builtins/strchr.c:335: Call to builtin strchr [eva] tests/builtins/strchr.c:335: Frama_C_show_each_mystrchr: {3; 4} [eva] tests/builtins/strchr.c:335: Call to builtin strchr [eva] tests/builtins/strchr.c:335: Frama_C_show_each_mystrchr: {3; 4; 7; 8} [eva] tests/builtins/strchr.c:342: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:342: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:342: Frama_C_show_each_mystrchr: {1} [eva] tests/builtins/strchr.c:343: assertion got status valid. [eva] Recording results for strchr_misc2 [eva] Done for function strchr_misc2 [eva] computing for function strchr_bitfields <- main. Called from tests/builtins/strchr.c:554. [eva] tests/builtins/strchr.c:166: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:166: Warning: function strchr: precondition 'valid_string_s' got status invalid. [eva] Recording results for strchr_bitfields [eva] Done for function strchr_bitfields [eva] computing for function strchr_bitfields2 <- main. Called from tests/builtins/strchr.c:555. [eva] tests/builtins/strchr.c:183: Call to builtin strchr [eva] tests/builtins/strchr.c:183: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:183: Frama_C_show_each_mystrchr: {2} [eva] tests/builtins/strchr.c:184: assertion got status valid. [eva] Recording results for strchr_bitfields2 [eva] Done for function strchr_bitfields2 [eva] computing for function strchr_escaping <- main. Called from tests/builtins/strchr.c:556. [eva:locals-escaping] tests/builtins/strchr.c:258: Warning: locals {x} escaping the scope of a block of strchr_escaping through s [eva] tests/builtins/strchr.c:261: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:261: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:261: Frama_C_show_each_mystrchr: {0} [eva] tests/builtins/strchr.c:262: assertion got status valid. [eva] tests/builtins/strchr.c:264: Call to builtin strchr [eva] tests/builtins/strchr.c:264: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:264: Frama_C_show_each_mystrchr: {0} [eva] tests/builtins/strchr.c:265: assertion got status valid. [eva] Recording results for strchr_escaping [eva] Done for function strchr_escaping [eva] computing for function strchr_big_array <- main. Called from tests/builtins/strchr.c:557. [eva:alarm] tests/builtins/strchr.c:353: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strchr.c:355: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strchr.c:357: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/strchr.c:366: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:366: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:366: Frama_C_show_each_mystrchr: {1} [eva] tests/builtins/strchr.c:367: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:367: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:367: Frama_C_show_each_mystrchr: {1} [eva] tests/builtins/strchr.c:368: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:368: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:368: Frama_C_show_each_mystrchr: {1} [eva] tests/builtins/strchr.c:369: Frama_C_show_each: {1}, {1}, {1} [eva] tests/builtins/strchr.c:370: assertion got status valid. [eva] tests/builtins/strchr.c:371: assertion got status valid. [eva] tests/builtins/strchr.c:372: assertion got status valid. [eva] tests/builtins/strchr.c:374: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:374: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:374: Frama_C_show_each_mystrchr: [1..797],1%4 [eva] tests/builtins/strchr.c:375: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:375: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:375: Frama_C_show_each_mystrchr: [1..801],1%4 [eva] tests/builtins/strchr.c:376: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:376: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:376: Frama_C_show_each_mystrchr: [1..3999997],1%4 [eva] tests/builtins/strchr.c:377: Frama_C_show_each: [1..797],1%4, [1..801],1%4, [1..3999997],1%4 [eva] tests/builtins/strchr.c:378: assertion got status valid. [eva] tests/builtins/strchr.c:379: assertion got status valid. [eva] tests/builtins/strchr.c:380: assertion got status valid. [eva:alarm] tests/builtins/strchr.c:381: Warning: assertion 'refined' got status unknown. [eva:alarm] tests/builtins/strchr.c:382: Warning: assertion 'refined' got status unknown. [eva:alarm] tests/builtins/strchr.c:383: Warning: assertion 'refined' got status unknown. [eva] computing for function init_array_nondet <- strchr_big_array <- main. Called from tests/builtins/strchr.c:385. [eva] tests/builtins/strchr.c:189: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- strchr_big_array <- main. Called from tests/builtins/strchr.c:386. [eva] tests/builtins/strchr.c:189: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- strchr_big_array <- main. Called from tests/builtins/strchr.c:387. [eva] tests/builtins/strchr.c:189: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva:alarm] tests/builtins/strchr.c:389: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strchr.c:391: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strchr.c:393: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/strchr.c:394: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:394: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:394: Frama_C_show_each_mystrchr: [0..799] [eva] tests/builtins/strchr.c:395: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:395: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:395: Frama_C_show_each_mystrchr: [0..803] [eva] tests/builtins/strchr.c:396: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:396: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:396: Frama_C_show_each_mystrchr: [0..3999999] [eva] tests/builtins/strchr.c:397: Frama_C_show_each: [0..799], [0..803], [0..3999999] [eva] tests/builtins/strchr.c:398: assertion got status valid. [eva] tests/builtins/strchr.c:399: assertion got status valid. [eva] tests/builtins/strchr.c:400: assertion got status valid. [eva] tests/builtins/strchr.c:402: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:402: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:402: Frama_C_show_each_mystrchr: [0..799] [eva] tests/builtins/strchr.c:403: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:403: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:403: Frama_C_show_each_mystrchr: [0..803] [eva] tests/builtins/strchr.c:404: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:404: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:404: Frama_C_show_each_mystrchr: [0..3999999] [eva] tests/builtins/strchr.c:405: Frama_C_show_each: [0..799], [0..803], [0..3999999] [eva] tests/builtins/strchr.c:406: assertion got status valid. [eva] tests/builtins/strchr.c:407: assertion got status valid. [eva] tests/builtins/strchr.c:408: assertion got status valid. [eva] tests/builtins/strchr.c:409: assertion 'refined' got status valid. [eva] tests/builtins/strchr.c:410: assertion 'refined' got status valid. [eva] tests/builtins/strchr.c:411: assertion 'refined' got status valid. [eva] Recording results for strchr_big_array [eva] Done for function strchr_big_array [eva] computing for function strchr_no_zero_but_ok <- main. Called from tests/builtins/strchr.c:558. [eva] tests/builtins/strchr.c:422: Call to builtin strchr [eva] tests/builtins/strchr.c:422: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:422: Frama_C_show_each_mystrchr: {10} [eva] tests/builtins/strchr.c:423: assertion got status valid. [eva] tests/builtins/strchr.c:424: Call to builtin strchr [eva] tests/builtins/strchr.c:424: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:424: Frama_C_show_each_mystrchr: {10} [eva] tests/builtins/strchr.c:425: assertion got status valid. [eva] tests/builtins/strchr.c:427: Call to builtin strchr [eva] tests/builtins/strchr.c:427: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:427: Frama_C_show_each_mystrchr: {10} [eva] tests/builtins/strchr.c:428: assertion got status valid. [eva] tests/builtins/strchr.c:430: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:430: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:430: Frama_C_show_each_mystrchr: {10; 14; 15; 16; 17; 18; 19} [eva] tests/builtins/strchr.c:431: assertion got status valid. [eva] tests/builtins/strchr.c:433: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:433: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strchr.c:433: Frama_C_show_each_mystrchr: {10; 18; 19} [eva] tests/builtins/strchr.c:434: assertion got status valid. [eva] Recording results for strchr_no_zero_but_ok [eva] Done for function strchr_no_zero_but_ok [eva] computing for function strchr_small_sets_chars <- main. Called from tests/builtins/strchr.c:559. [eva] tests/builtins/strchr.c:463: Frama_C_show_each_c: {97} [eva] tests/builtins/strchr.c:464: Call to builtin strchr [eva] tests/builtins/strchr.c:464: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:464: Frama_C_show_each_mystrchr: {-1; 0} [eva] tests/builtins/strchr.c:464: Call to builtin strchr [eva] tests/builtins/strchr.c:464: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:464: Frama_C_show_each_mystrchr: {-1} [eva] tests/builtins/strchr.c:464: Call to builtin strchr [eva] tests/builtins/strchr.c:464: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:464: Frama_C_show_each_mystrchr: {-1} [eva] tests/builtins/strchr.c:464: Call to builtin strchr [eva] tests/builtins/strchr.c:464: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:464: Frama_C_show_each_mystrchr: {-1} [eva] tests/builtins/strchr.c:464: Call to builtin strchr [eva] tests/builtins/strchr.c:464: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:464: Frama_C_show_each_mystrchr: {-1; 0; 1} [eva] tests/builtins/strchr.c:465: Frama_C_show_each_res: {-1; 0}, {-1}, {-1}, {-1}, {-1; 0; 1} [eva] tests/builtins/strchr.c:466: assertion got status valid. [eva] tests/builtins/strchr.c:467: assertion got status valid. [eva] tests/builtins/strchr.c:468: assertion got status valid. [eva] tests/builtins/strchr.c:469: assertion got status valid. [eva] tests/builtins/strchr.c:470: assertion got status valid. [eva] tests/builtins/strchr.c:473: Call to builtin strchr [eva] tests/builtins/strchr.c:473: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:473: Frama_C_show_each_mystrchr: {1} [eva] tests/builtins/strchr.c:473: Call to builtin strchr [eva] tests/builtins/strchr.c:473: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:473: Frama_C_show_each_mystrchr: {-1; 1} [eva] tests/builtins/strchr.c:473: Call to builtin strchr [eva] tests/builtins/strchr.c:473: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:473: Frama_C_show_each_mystrchr: {-1} [eva] tests/builtins/strchr.c:473: Call to builtin strchr [eva] tests/builtins/strchr.c:473: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:473: Frama_C_show_each_mystrchr: {-1; 0} [eva] tests/builtins/strchr.c:473: Call to builtin strchr [eva] tests/builtins/strchr.c:473: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:473: Frama_C_show_each_mystrchr: {-1; 0; 1} [eva] tests/builtins/strchr.c:474: Frama_C_show_each_res: {1}, {-1; 1}, {-1}, {-1; 0}, {-1; 0; 1} [eva] tests/builtins/strchr.c:475: assertion got status valid. [eva] tests/builtins/strchr.c:476: assertion got status valid. [eva] tests/builtins/strchr.c:477: assertion got status valid. [eva] tests/builtins/strchr.c:478: assertion got status valid. [eva] tests/builtins/strchr.c:479: assertion got status valid. [eva] tests/builtins/strchr.c:482: Frama_C_show_each_c: {97; 98} [eva] tests/builtins/strchr.c:483: Call to builtin strchr [eva] tests/builtins/strchr.c:483: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:483: Frama_C_show_each_mystrchr: {-1; 0; 1} [eva] tests/builtins/strchr.c:483: Call to builtin strchr [eva] tests/builtins/strchr.c:483: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:483: Frama_C_show_each_mystrchr: {-1; 1} [eva] tests/builtins/strchr.c:483: Call to builtin strchr [eva] tests/builtins/strchr.c:483: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:483: Frama_C_show_each_mystrchr: {-1} [eva] tests/builtins/strchr.c:483: Call to builtin strchr [eva] tests/builtins/strchr.c:483: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:483: Frama_C_show_each_mystrchr: {-1; 0} [eva] tests/builtins/strchr.c:483: Call to builtin strchr [eva] tests/builtins/strchr.c:483: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:483: Frama_C_show_each_mystrchr: {-1; 0; 1} [eva] tests/builtins/strchr.c:484: Frama_C_show_each_res: {-1; 0; 1}, {-1; 1}, {-1}, {-1; 0}, {-1; 0; 1} [eva] tests/builtins/strchr.c:486: assertion got status valid. [eva] tests/builtins/strchr.c:487: assertion got status valid. [eva] tests/builtins/strchr.c:488: assertion got status valid. [eva] tests/builtins/strchr.c:489: assertion got status valid. [eva] tests/builtins/strchr.c:490: assertion got status valid. [eva] tests/builtins/strchr.c:493: Frama_C_show_each_c: {98; 99} [eva] tests/builtins/strchr.c:494: Call to builtin strchr [eva] tests/builtins/strchr.c:494: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:494: Frama_C_show_each_mystrchr: {1; 2} [eva] tests/builtins/strchr.c:494: Call to builtin strchr [eva] tests/builtins/strchr.c:494: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:494: Frama_C_show_each_mystrchr: {-1; 1; 2} [eva] tests/builtins/strchr.c:494: Call to builtin strchr [eva] tests/builtins/strchr.c:494: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:494: Frama_C_show_each_mystrchr: {-1} [eva] tests/builtins/strchr.c:494: Call to builtin strchr [eva] tests/builtins/strchr.c:494: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:494: Frama_C_show_each_mystrchr: {-1; 0; 2} [eva] tests/builtins/strchr.c:494: Call to builtin strchr [eva] tests/builtins/strchr.c:494: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:494: Frama_C_show_each_mystrchr: {-1; 0; 1} [eva] tests/builtins/strchr.c:495: Frama_C_show_each_res: {1; 2}, {-1; 1; 2}, {-1}, {-1; 0; 2}, {-1; 0; 1} [eva] tests/builtins/strchr.c:496: assertion got status valid. [eva] tests/builtins/strchr.c:497: assertion 'refined' got status valid. [eva] tests/builtins/strchr.c:498: assertion got status valid. [eva] tests/builtins/strchr.c:499: assertion got status valid. [eva] tests/builtins/strchr.c:500: assertion got status valid. [eva] tests/builtins/strchr.c:501: assertion got status valid. [eva] tests/builtins/strchr.c:504: Frama_C_show_each_c: {0; 98; 99} [eva] tests/builtins/strchr.c:505: Call to builtin strchr [eva] tests/builtins/strchr.c:505: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:505: Frama_C_show_each_mystrchr: {-1; 1; 2; 3} [eva] tests/builtins/strchr.c:505: Call to builtin strchr [eva] tests/builtins/strchr.c:505: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:505: Frama_C_show_each_mystrchr: {-1; 0; 1; 2; 3} [eva] tests/builtins/strchr.c:505: Call to builtin strchr [eva] tests/builtins/strchr.c:505: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:505: Frama_C_show_each_mystrchr: {-1; 0} [eva] tests/builtins/strchr.c:505: Call to builtin strchr [eva] tests/builtins/strchr.c:505: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:505: Frama_C_show_each_mystrchr: {-1; 0; 1; 2; 3} [eva] tests/builtins/strchr.c:505: Call to builtin strchr [eva] tests/builtins/strchr.c:505: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:505: Frama_C_show_each_mystrchr: {-1; 0; 1; 3} [eva] tests/builtins/strchr.c:506: Frama_C_show_each_res: {-1; 1; 2; 3}, {-1; 0; 1; 2; 3}, {-1; 0}, {-1; 0; 1; 2; 3}, {-1; 0; 1; 3} [eva] tests/builtins/strchr.c:507: assertion got status valid. [eva:alarm] tests/builtins/strchr.c:508: Warning: assertion 'refined' got status unknown. [eva] tests/builtins/strchr.c:509: assertion got status valid. [eva] tests/builtins/strchr.c:510: assertion got status valid. [eva] tests/builtins/strchr.c:511: assertion got status valid. [eva] tests/builtins/strchr.c:512: assertion got status valid. [eva] Recording results for strchr_small_sets_chars [eva] Done for function strchr_small_sets_chars [eva] computing for function strchr_unbounded <- main. Called from tests/builtins/strchr.c:560. [eva] tests/builtins/strchr.c:519: Call to builtin strchr [eva] tests/builtins/strchr.c:519: function strchr: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strchr.c:519: Frama_C_show_each_mystrchr: {-1; 0; 1; 2; 3; 4} [eva] tests/builtins/strchr.c:520: assertion got status valid. [eva] tests/builtins/strchr.c:524: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:524: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva:alarm] tests/builtins/strchr.c:524: Warning: pointer subtraction. assert \base_addr(_ss_0) ≡ \base_addr(s); [eva] tests/builtins/strchr.c:524: Frama_C_show_each_mystrchr: [-1..26] [eva] tests/builtins/strchr.c:525: assertion got status valid. [eva] computing for function init_array_nondet <- strchr_unbounded <- main. Called from tests/builtins/strchr.c:526. [eva] tests/builtins/strchr.c:189: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] tests/builtins/strchr.c:527: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:527: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva:alarm] tests/builtins/strchr.c:527: Warning: pointer subtraction. assert \base_addr(_ss_1) ≡ \base_addr(s); [eva] tests/builtins/strchr.c:527: Frama_C_show_each_mystrchr: [-1..29] [eva] tests/builtins/strchr.c:528: assertion got status valid. [eva] tests/builtins/strchr.c:529: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:529: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva:alarm] tests/builtins/strchr.c:529: Warning: pointer subtraction. assert \base_addr(_ss_2) ≡ \base_addr(s); [eva] tests/builtins/strchr.c:529: Frama_C_show_each_mystrchr: [-1..29] [eva] tests/builtins/strchr.c:530: assertion got status valid. [eva] Recording results for strchr_unbounded [eva] Done for function strchr_unbounded [eva] computing for function strchr_invalid <- main. Called from tests/builtins/strchr.c:561. [eva] tests/builtins/strchr.c:536: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:536: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva:alarm] tests/builtins/strchr.c:536: Warning: pointer comparison. assert \pointer_comparable((void *)_ss, (void *)0); [eva:alarm] tests/builtins/strchr.c:536: Warning: pointer subtraction. assert \base_addr(_ss) ≡ \base_addr(s); [eva:alarm] tests/builtins/strchr.c:536: Warning: signed overflow. assert -2147483648 ≤ _ss - s; [eva:alarm] tests/builtins/strchr.c:536: Warning: signed overflow. assert _ss - s ≤ 2147483647; [eva] tests/builtins/strchr.c:536: Frama_C_show_each_mystrchr: [-2147483648..2147483647] [eva] Recording results for strchr_invalid [eva] Done for function strchr_invalid [eva] computing for function strchr_garbled_mix_in_char <- main. Called from tests/builtins/strchr.c:562. [eva] tests/builtins/strchr.c:541: Assigning imprecise value to garbled. The imprecision originates from Arithmetic {tests/builtins/strchr.c:541} [eva] tests/builtins/strchr.c:542: Call to builtin strchr [eva:alarm] tests/builtins/strchr.c:542: Warning: function strchr: precondition 'valid_string_s' got status invalid. [eva] Recording results for strchr_garbled_mix_in_char [eva] Done for function strchr_garbled_mix_in_char [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function init_array_nondet: from ∈ {-1} to ∈ {-1} val1 ∈ {-1} val2 ∈ {-1} val ∈ {0; 1; 2; 3; 4} a[0..99] ∈ {0; 1; 2} a[0..39] ∈ {1; 2} [40..49] ∈ UNINITIALIZED [50..94] ∈ {3; 4} or UNINITIALIZED [95..99] ∈ UNINITIALIZED u[0..199] ∈ {0; 16843009} r[0..200] ∈ {0; 16843009; 270729319} or UNINITIALIZED t[0..999999] ∈ {0; 16843009; 270729319} or UNINITIALIZED t[0..29] ∈ {0; 1} [eva:final-states] Values at end of function strchr_big_array: c ∈ {0} u[0..199] ∈ {0; 16843009; 270729319} r[0..200] ∈ {0; 16843009; 270729319} t[0..999999] ∈ {0; 16843009; 270729319} p ∈ {{ &t + [0..3999996],0%4 }} len_u ∈ [0..799] len_r ∈ [0..803] len_t ∈ [0..3999999] [eva:final-states] Values at end of function strchr_bitfields: c ∈ {0} s.a ∈ {3} .b ∈ {1} .[bits 16 to 31] ∈ UNINITIALIZED .c ∈ {7} .[bits 49 to 63] ∈ UNINITIALIZED p ∈ {{ (char *)&s }} [eva:final-states] Values at end of function strchr_bitfields2: c ∈ {0} s.a ∈ {3} .b ∈ {1} .c ∈ {7} .[bits 25 to 31] ∈ UNINITIALIZED p ∈ {{ (char *)&s }} z1 ∈ {2} [eva:final-states] Values at end of function strchr_escaping: c ∈ {0} s[0] ∈ {0} [1..3] ∈ ESCAPINGADDR z1 ∈ {0} z2 ∈ {0} [eva:final-states] Values at end of function strchr_garbled_mix_in_char: garbled ∈ {{ garbled mix of &{x} (origin: Arithmetic {tests/builtins/strchr.c:541}) }} [eva:final-states] Values at end of function strchr_initialization: c ∈ {0} empty_or_uninitialized[0] ∈ {0} or UNINITIALIZED z1 ∈ {0} s[0] ∈ {1} or UNINITIALIZED [1] ∈ {0} z2 ∈ {1} t[0..1] ∈ {10} [2] ∈ {10} or UNINITIALIZED [3] ∈ {0} z3 ∈ {3} [eva:final-states] Values at end of function strchr_invalid: s ∈ {{ "hello" }} unused ∈ [--..--] [eva:final-states] Values at end of function strchr_large: Frama_C_entropy_source ∈ [--..--] c ∈ {0} a[0..99] ∈ {0; 2} offset ∈ [50..70] z1 ∈ {20; 75} z2 ∈ {20} z3 ∈ {75} z4 ∈ {75} z5 ∈ [50..99] [eva:final-states] Values at end of function strchr_large_uninit: Frama_C_entropy_source ∈ [--..--] c ∈ {0} a[0..19] ∈ {1; 2} [20] ∈ {0} [21..39] ∈ {1; 2} [40..49] ∈ UNINITIALIZED [50..74] ∈ {3; 4} [75] ∈ {0} [76..94] ∈ {3; 4} [95..97] ∈ UNINITIALIZED [98] ∈ {0} [99] ∈ UNINITIALIZED offset ∈ {0} z1 ∈ {20} z2 ∈ {75} z3 ∈ {75} [eva:final-states] Values at end of function strchr_misc: c ∈ {0} loc_str ∈ {{ "Bonjour Monde\n" }} loc_char_array[0..2] ∈ UNINITIALIZED [3] ∈ {0} [4] ∈ UNINITIALIZED x ∈ {-1412567296} str ∈ {{ (char *)&x }} unterminated_string[0] ∈ {117} [1] ∈ {110} [2] ∈ {116} [3] ∈ {101} [4] ∈ {114} [5] ∈ {109} [6] ∈ {105} [7] ∈ {110} [8] ∈ {97} [9] ∈ {116} [10] ∈ {101} [11] ∈ {100} sz1 ∈ {12; 14} sz2 ∈ {0} sz4a ∈ {3} sz4b ∈ {4} sz4c ∈ {5} sz4d ∈ {9} strchr_misc_static_str ∈ {{ "Hello World\n" }} strchr_misc_zero_str ∈ {{ "abc\000\000\000abc" }} [eva:final-states] Values at end of function strchr_misc2: c ∈ {0} s1 ∈ {{ "mno\000pqr" ; "MNOP\000QRS" }} sz5 ∈ {3; 4} sz6 ∈ {3; 4} maybe_init[0] ∈ {65} or UNINITIALIZED [1] ∈ {0} sz8 ∈ {1} [eva:final-states] Values at end of function strchr_misc_array: Frama_C_entropy_source ∈ [--..--] c ∈ {0} i ∈ [0..11] sz3 ∈ [0..13] [eva:final-states] Values at end of function strchr_no_zero_but_ok: c ∈ {0} s[0..9] ∈ {1} [10] ∈ {0} [11..13] ∈ {1} [14..19] ∈ {0; 1} z1 ∈ {10} z2 ∈ {10} offs ∈ {7; 18} z3 ∈ {10} z4 ∈ {10; 14; 15; 16; 17; 18; 19} z5 ∈ {10; 18; 19} [eva:final-states] Values at end of function strchr_small_sets: c ∈ {0} s ∈ {{ "b\000c" }} o ∈ {0; 2} z1 ∈ {3} z2 ∈ {0; 3} z3 ∈ {0} z4 ∈ {1; 3} t[0..1] ∈ {0; 1} [2..3] ∈ {1} z5 ∈ {0; 1} [eva:final-states] Values at end of function strchr_small_sets_chars: c ∈ {0; 98; 99} res[0] ∈ {1; 2; 3} [1] ∈ {-1; 0; 1; 2; 3} [2] ∈ {-1; 0} [3] ∈ {-1; 0; 1; 2; 3} [4] ∈ {-1; 0; 1; 3} t_0[0..1] ∈ {1; 97} [2] ∈ {1} [3] ∈ {0} t_1[0..1] ∈ {1; 98} [2] ∈ {1} [3] ∈ {0} t_2[0..1] ∈ {1; 97; 98} [2] ∈ {1} [3] ∈ {0} t_3[0..1] ∈ {1; 98; 99} [2] ∈ {1} [3] ∈ {0} t_4[0..1] ∈ {0; 1; 98; 99} [2] ∈ {1} [3] ∈ {0} [eva:final-states] Values at end of function strchr_unbounded: c ∈ [--..--] s ∈ {{ &t[0] ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ" }} u1 ∈ {-1; 0; 1; 2; 3; 4} t[0..29] ∈ {0; 1} u2 ∈ [-1..26] u3 ∈ [-1..29] u4 ∈ [-1..29] [eva:final-states] Values at end of function strchr_zero_termination: c ∈ {0} empty_or_non_terminated[0] ∈ {0; 100} z1 ∈ {0} non_terminated[0] ∈ {88} non_terminated2[0] ∈ {76} [1] ∈ {0} [2] ∈ {28} [3] ∈ {14} o ∈ {2; 3} [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] strchr_misc_static_str ∈ {{ "Hello World\n" }} strchr_misc_zero_str ∈ {{ "abc\000\000\000abc" }} __retres ∈ {0} [from] Computing for function init_array_nondet [from] Computing for function memset <-init_array_nondet [from] Done for function memset [from] Done for function init_array_nondet [from] Computing for function strchr_big_array [from] Computing for function strchr <-strchr_big_array [from] Done for function strchr [from] Done for function strchr_big_array [from] Computing for function strchr_bitfields [from] Done for function strchr_bitfields [from] Computing for function strchr_bitfields2 [from] Done for function strchr_bitfields2 [from] Computing for function strchr_escaping [from] Done for function strchr_escaping [from] Computing for function strchr_garbled_mix_in_char [from] Done for function strchr_garbled_mix_in_char [from] Computing for function strchr_initialization [from] Done for function strchr_initialization [from] Computing for function strchr_invalid [from] Done for function strchr_invalid [from] Computing for function strchr_large [from] Computing for function Frama_C_interval <-strchr_large [from] Done for function Frama_C_interval [from] Done for function strchr_large [from] Computing for function strchr_large_uninit [from] Done for function strchr_large_uninit [from] Computing for function strchr_misc [from] Done for function strchr_misc [from] Computing for function strchr_misc2 [from] Done for function strchr_misc2 [from] Computing for function strchr_misc_array [from] Done for function strchr_misc_array [from] Computing for function strchr_no_zero_but_ok [from] Done for function strchr_no_zero_but_ok [from] Computing for function strchr_small_sets [from] Done for function strchr_small_sets [from] Computing for function strchr_small_sets_chars [from] Done for function strchr_small_sets_chars [from] Computing for function strchr_unbounded [from] Done for function strchr_unbounded [from] Computing for function strchr_zero_termination [from] Done for function strchr_zero_termination [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function memset: a[0..99] FROM c (and SELF) a[0..99] FROM c (and SELF) u[0..199] FROM c (and SELF) r[0..200] FROM c (and SELF) t[0..999999] FROM c (and SELF) t[0..29] FROM c (and SELF) \result FROM s [from] Function init_array_nondet: a[0..99] FROM val1; val2; nondet (and SELF) a[0..99] FROM val1; val2; nondet (and SELF) u[0..199] FROM val1; val2; nondet (and SELF) r[0..200] FROM val1; val2; nondet (and SELF) t[0..999999] FROM val1; val2; nondet (and SELF) t[0..29] FROM val1; val2; nondet (and SELF) [from] Function strchr: \result FROM s; c; t[0..3]; empty_or_non_terminated[0]; non_terminated[0]; non_terminated2[0..3]; empty_or_uninitialized[0]; uninitialized[0]; s[0..1]; t[0..3]; s; s; a[0..99]; a[0..99]; s[0..3]; loc_char_array[0..4]; x; unterminated_string[0..11]; maybe_init[0..1]; u[0..199]; r[0..200]; t[0..999999]; s[0..19]; t_0[0..3]; t_1[0..3]; t_2[0..3]; t_3[0..3]; t_4[0..3]; t[0..29]; s; x; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111]; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; "Bonjour Monde\n"[bits 0 to 119]; "abc"; "ABCD"[bits 0 to 39]; "efg"; "EFGH"[bits 0 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71]; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abcd"[bits 0 to 39]; "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[bits 0 to 215]; "hello"[bits 0 to 47] [from] Function strchr_big_array: NO EFFECTS [from] Function strchr_bitfields: NO EFFECTS [from] Function strchr_bitfields2: NO EFFECTS [from] Function strchr_escaping: NO EFFECTS [from] Function strchr_garbled_mix_in_char: NO EFFECTS [from] Function strchr_initialization: NO EFFECTS [from] Function strchr_invalid: NO EFFECTS [from] Function strchr_large: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function strchr_large_uninit: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function strchr_misc: strchr_misc_static_str FROM \nothing strchr_misc_zero_str FROM \nothing [from] Function strchr_misc2: NO EFFECTS [from] Function strchr_misc_array: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function strchr_no_zero_but_ok: NO EFFECTS [from] Function strchr_small_sets: NO EFFECTS [from] Function strchr_small_sets_chars: NO EFFECTS [from] Function strchr_unbounded: NO EFFECTS [from] Function strchr_zero_termination: NO EFFECTS [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) strchr_misc_static_str FROM \nothing strchr_misc_zero_str FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function init_array_nondet: from; to; val1; val2; val; tmp; a[0..99]; a{[0..39]; [50..94]}; u[0..199]; r[0..200]; t[0..999999]; t[0..29] [inout] Inputs for function init_array_nondet: nondet [inout] Out (internal) for function strchr_big_array: c; u[0..199]; r[0..200]; t[0..999999]; p; len_u; len_r; len_t; _ss; _res; _ss_0; _res_0; _ss_1; _res_1; _ss_2; _res_2; _ss_3; _res_3; _ss_4; _res_4; _ss_5; _res_5; _ss_6; _res_6; _ss_7; _res_7; _ss_8; _res_8; _ss_9; _res_9; _ss_10; _res_10 [inout] Inputs for function strchr_big_array: nondet [inout] Out (internal) for function strchr_bitfields: c; s{{.a; .b}; .c}; p [inout] Inputs for function strchr_bitfields: nondet [inout] Out (internal) for function strchr_bitfields2: c; s{.a; .b; .c}; p; z1; _ss; _res [inout] Inputs for function strchr_bitfields2: \nothing [inout] Out (internal) for function strchr_escaping: c; s[0..3]; z1; _ss; _res; z2; _ss_0; _res_0 [inout] Inputs for function strchr_escaping: nondet [inout] Out (internal) for function strchr_garbled_mix_in_char: garbled [inout] Inputs for function strchr_garbled_mix_in_char: nondet [inout] Out (internal) for function strchr_initialization: c; empty_or_uninitialized[0]; z1; _ss; _res; s[0..1]; z2; _ss_0; _res_0; t[0..3]; z3; _ss_1; _res_1 [inout] Inputs for function strchr_initialization: nondet [inout] Out (internal) for function strchr_invalid: s; unused; _ss; _res [inout] Inputs for function strchr_invalid: "hello"[bits 0 to 47] [inout] Out (internal) for function strchr_large: Frama_C_entropy_source; c; a[0..99]; offset; z1; _ss; _res; z2; _ss_0; _res_0; z3; _ss_1; _res_1; z4; _ss_2; _res_2; z5; _ss_3; _res_3 [inout] Inputs for function strchr_large: Frama_C_entropy_source; nondet [inout] Out (internal) for function strchr_large_uninit: Frama_C_entropy_source; c; a{[0..39]; [50..94]; [98]}; offset; z1; _ss; _res; z2; _ss_0; _res_0; z3; _ss_1; _res_1 [inout] Inputs for function strchr_large_uninit: Frama_C_entropy_source; nondet [inout] Out (internal) for function strchr_misc: c; loc_str; loc_char_array[3]; x; str; unterminated_string[0..11]; sz1; _ss; _res; sz2; _p; tmp_0; _s; _res_0; sz4a; _ss_0; _res_1; sz4b; _ss_1; _res_2; sz4c; _ss_2; _res_3; sz4d; _ss_3; _res_4; strchr_misc_static_str; strchr_misc_zero_str [inout] Inputs for function strchr_misc: nondet; strchr_misc_static_str; strchr_misc_zero_str; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; "Bonjour Monde\n"[bits 0 to 119] [inout] Out (internal) for function strchr_misc2: c; s1; sz5; _p; tmp; _s; _res; sz6; _p_0; tmp_1; _s_0; _res_0; j; sz7; _ss; _res_1; maybe_init[0..1]; sz8; _ss_0; _res_2 [inout] Inputs for function strchr_misc2: nondet; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71] [inout] Out (internal) for function strchr_misc_array: Frama_C_entropy_source; c; i; sz3; _ss; _res [inout] Inputs for function strchr_misc_array: Frama_C_entropy_source; tab_str[0..11]; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111] [inout] Out (internal) for function strchr_no_zero_but_ok: c; s[0..19]; z1; _ss; _res; z2; _ss_0; _res_0; offs; tmp_1; z3; _ss_1; _res_1; z4; _ss_2; _res_2; z5; _ss_3; _res_3 [inout] Inputs for function strchr_no_zero_but_ok: nondet [inout] Out (internal) for function strchr_small_sets: c; s; o; tmp; z1; _ss; _res; z2; _ss_0; _res_0; z3; _ss_1; _res_1; z4; _ss_2; _res_2; t[0..3]; z5; _ss_3; _res_3 [inout] Inputs for function strchr_small_sets: nondet; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c" [inout] Out (internal) for function strchr_small_sets_chars: c; res[0..4]; t_0[0..3]; s; o; tmp; _ss; _res; _ss_0; _res_0; _ss_1; _res_1; _ss_2; _res_2; _ss_3; _res_3; t_1[0..3]; s_0; o_0; tmp_5; _ss_4; _res_4; _ss_5; _res_5; _ss_6; _res_6; _ss_7; _res_7; _ss_8; _res_8; t_2[0..3]; s_1; o_1; tmp_11; _ss_9; _res_9; _ss_10; _res_10; _ss_11; _res_11; _ss_12; _res_12; _ss_13; _res_13; t_3[0..3]; s_2; o_2; tmp_17; _ss_14; _res_14; _ss_15; _res_15; _ss_16; _res_16; _ss_17; _res_17; _ss_18; _res_18; t_4[0..3]; s_3; o_3; tmp_23; _ss_19; _res_19; _ss_20; _res_20; _ss_21; _res_21; _ss_22; _res_22; _ss_23; _res_23 [inout] Inputs for function strchr_small_sets_chars: nondet; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c" [inout] Out (internal) for function strchr_unbounded: c; s; u1; _ss; _res; t[0..29]; u2; _ss_0; _res_0; u3; _ss_1; _res_1; u4; _ss_2; _res_2 [inout] Inputs for function strchr_unbounded: nondet; "abcd"[bits 0 to 39]; "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[bits 0 to 215] [inout] Out (internal) for function strchr_zero_termination: c; empty_or_non_terminated[0]; z1; _ss; _res; non_terminated[0]; non_terminated2[0..3]; o; tmp_0 [inout] Inputs for function strchr_zero_termination: nondet [inout] Out (internal) for function main: Frama_C_entropy_source; strchr_misc_static_str; strchr_misc_zero_str; __retres [inout] Inputs for function main: Frama_C_entropy_source; tab_str[0..11]; nondet; strchr_misc_static_str; strchr_misc_zero_str; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111]; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; "Bonjour Monde\n"[bits 0 to 119]; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71]; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "abcd"[bits 0 to 39]; "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[bits 0 to 215]; "hello"[bits 0 to 47] �����������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/strlen.res.oracle����������������������������������������0000666�0000000�0000000�00000073270�13571573400�020752� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/strlen.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization static_str ∈ {{ "Hello World\n" }} zero_str ∈ {{ "abc\000\000\000abc" }} tab_str[0] ∈ {{ "" }} [1] ∈ {{ "a" }} [2] ∈ {{ "aa" }} [3] ∈ {{ "aaa" }} [4] ∈ {{ "aaaa" }} [5] ∈ {{ "aaaaa" }} [6] ∈ {{ "aaaaaa" }} [7] ∈ {{ "aaaaaaaaa" }} [8] ∈ {{ "aaaaaaaaaa" }} [9] ∈ {{ "aaaaaaaaaaa" }} [10] ∈ {{ "aaaaaaaaaaaa" }} [11] ∈ {{ "aaaaaaaaaaaaa" }} unterminated_string[0] ∈ {117} [1] ∈ {110} [2] ∈ {116} [3] ∈ {101} [4] ∈ {114} [5] ∈ {109} [6] ∈ {105} [7] ∈ {110} [8] ∈ {97} [9] ∈ {116} [10] ∈ {101} [11] ∈ {100} nondet ∈ [--..--] [eva] computing for function small_sets <- main. Called from tests/builtins/strlen.c:334. [eva] tests/builtins/strlen.c:60: Call to builtin strlen [eva] tests/builtins/strlen.c:60: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:61: assertion got status valid. [eva] tests/builtins/strlen.c:65: Call to builtin strlen [eva] tests/builtins/strlen.c:65: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:66: assertion got status valid. [eva] tests/builtins/strlen.c:70: Call to builtin strlen [eva] tests/builtins/strlen.c:70: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:71: assertion got status valid. [eva] tests/builtins/strlen.c:75: Call to builtin strlen [eva] tests/builtins/strlen.c:75: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:76: assertion got status valid. [eva] tests/builtins/strlen.c:81: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:81: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:82: assertion got status valid. [eva] Recording results for small_sets [eva] Done for function small_sets [eva] computing for function zero_termination <- main. Called from tests/builtins/strlen.c:335. [eva] tests/builtins/strlen.c:89: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:89: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:90: assertion got status valid. [eva] tests/builtins/strlen.c:93: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:93: Warning: function strlen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strlen.c:97: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:97: Warning: function strlen: precondition 'valid_string_s' got status invalid. [eva] Recording results for zero_termination [eva] Done for function zero_termination [eva] computing for function strlen_initialization <- main. Called from tests/builtins/strlen.c:336. [eva] tests/builtins/strlen.c:105: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:105: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:106: assertion got status valid. [eva] tests/builtins/strlen.c:109: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:109: Warning: function strlen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strlen.c:116: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:116: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:117: assertion got status valid. [eva] tests/builtins/strlen.c:124: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:124: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:125: assertion got status valid. [eva] Recording results for strlen_initialization [eva] Done for function strlen_initialization [eva] computing for function strlen_large <- main. Called from tests/builtins/strlen.c:337. [eva] computing for function init_array_nondet <- strlen_large <- main. Called from tests/builtins/strlen.c:168. [eva] tests/builtins/strlen.c:161: Call to builtin memset [eva] tests/builtins/strlen.c:161: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- strlen_large <- main. Called from tests/builtins/strlen.c:171. [eva] using specification for function Frama_C_interval [eva] tests/builtins/strlen.c:171: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:172: Call to builtin strlen [eva] tests/builtins/strlen.c:172: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:173: assertion got status valid. [eva] computing for function Frama_C_interval <- strlen_large <- main. Called from tests/builtins/strlen.c:175. [eva] tests/builtins/strlen.c:175: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:176: Call to builtin strlen [eva] tests/builtins/strlen.c:176: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:177: assertion got status valid. [eva] computing for function Frama_C_interval <- strlen_large <- main. Called from tests/builtins/strlen.c:179. [eva] tests/builtins/strlen.c:179: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:180: Call to builtin strlen [eva] tests/builtins/strlen.c:180: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:181: assertion got status valid. [eva] computing for function Frama_C_interval <- strlen_large <- main. Called from tests/builtins/strlen.c:183. [eva] tests/builtins/strlen.c:183: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:184: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:184: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:185: assertion got status valid. [eva] computing for function init_array_nondet <- strlen_large <- main. Called from tests/builtins/strlen.c:187. [eva] tests/builtins/strlen.c:161: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- strlen_large <- main. Called from tests/builtins/strlen.c:188. [eva] tests/builtins/strlen.c:188: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:189: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:189: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:190: assertion got status valid. [eva] Recording results for strlen_large [eva] Done for function strlen_large [eva] computing for function strlen_large_uninit <- main. Called from tests/builtins/strlen.c:338. [eva] computing for function init_array_nondet <- strlen_large_uninit <- main. Called from tests/builtins/strlen.c:197. [eva] tests/builtins/strlen.c:161: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- strlen_large_uninit <- main. Called from tests/builtins/strlen.c:198. [eva] tests/builtins/strlen.c:161: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- strlen_large_uninit <- main. Called from tests/builtins/strlen.c:202. [eva] tests/builtins/strlen.c:202: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:203: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:203: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:204: assertion got status valid. [eva] computing for function Frama_C_interval <- strlen_large_uninit <- main. Called from tests/builtins/strlen.c:207. [eva] tests/builtins/strlen.c:207: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:208: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:208: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:209: assertion got status valid. [eva] computing for function Frama_C_interval <- strlen_large_uninit <- main. Called from tests/builtins/strlen.c:211. [eva] tests/builtins/strlen.c:211: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:212: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:212: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:213: assertion got status valid. [eva] Recording results for strlen_large_uninit [eva] Done for function strlen_large_uninit [eva] computing for function misc <- main. Called from tests/builtins/strlen.c:339. [eva] tests/builtins/strlen.c:241: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:241: Warning: function strlen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strlen.c:244: Call to builtin strlen [eva] tests/builtins/strlen.c:244: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:245: assertion got status valid. [eva] tests/builtins/strlen.c:248: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:248: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:249: assertion got status valid. [eva] computing for function Frama_C_interval <- misc <- main. Called from tests/builtins/strlen.c:250. [eva] tests/builtins/strlen.c:250: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:252: Call to builtin strlen [eva] tests/builtins/strlen.c:252: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:253: assertion got status valid. [eva] tests/builtins/strlen.c:255: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:255: Warning: function strlen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strlen.c:256: Call to builtin strlen [eva] tests/builtins/strlen.c:256: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:257: assertion got status valid. [eva] tests/builtins/strlen.c:260: Call to builtin strlen [eva] tests/builtins/strlen.c:260: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:261: assertion got status valid. [eva] tests/builtins/strlen.c:265: Call to builtin strlen [eva] tests/builtins/strlen.c:265: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:266: assertion got status valid. [eva] tests/builtins/strlen.c:270: Call to builtin strlen [eva] tests/builtins/strlen.c:270: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:271: assertion got status valid. [eva] tests/builtins/strlen.c:269: starting to merge loop iterations [eva] tests/builtins/strlen.c:270: Call to builtin strlen [eva] tests/builtins/strlen.c:270: Call to builtin strlen [eva] tests/builtins/strlen.c:270: Call to builtin strlen [eva] tests/builtins/strlen.c:270: Call to builtin strlen [eva] tests/builtins/strlen.c:277: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:277: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:278: assertion got status valid. [eva] Recording results for misc [eva] Done for function misc [eva] computing for function bitfields <- main. Called from tests/builtins/strlen.c:340. [eva] tests/builtins/strlen.c:140: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:140: Warning: function strlen: precondition 'valid_string_s' got status invalid. [eva] Recording results for bitfields [eva] Done for function bitfields [eva] computing for function bitfields2 <- main. Called from tests/builtins/strlen.c:341. [eva] tests/builtins/strlen.c:155: Call to builtin strlen [eva] tests/builtins/strlen.c:155: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:156: assertion got status valid. [eva] Recording results for bitfields2 [eva] Done for function bitfields2 [eva] computing for function escaping <- main. Called from tests/builtins/strlen.c:342. [eva:locals-escaping] tests/builtins/strlen.c:222: Warning: locals {x} escaping the scope of a block of escaping through s [eva] tests/builtins/strlen.c:225: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:225: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:226: assertion got status valid. [eva] tests/builtins/strlen.c:228: Call to builtin strlen [eva] tests/builtins/strlen.c:228: function strlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strlen.c:229: assertion got status valid. [eva] Recording results for escaping [eva] Done for function escaping [eva] computing for function big_array <- main. Called from tests/builtins/strlen.c:343. [eva:alarm] tests/builtins/strlen.c:287: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strlen.c:289: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strlen.c:291: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/strlen.c:297: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:297: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:298: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:298: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:299: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:299: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:300: Frama_C_show_each: {1}, {1}, {1} [eva] tests/builtins/strlen.c:302: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:302: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:303: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:303: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:304: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:304: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strlen.c:305: Frama_C_show_each: {1}, {1}, {1} [eva] Recording results for big_array [eva] Done for function big_array [eva] computing for function negative_offsets <- main. Called from tests/builtins/strlen.c:344. [eva] tests/builtins/strlen.c:310: starting to merge loop iterations [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strlen.c:314. [eva] tests/builtins/strlen.c:314: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:315: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:315: Warning: function strlen: precondition 'valid_string_s' got status invalid. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strlen.c:318. [eva] tests/builtins/strlen.c:318: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:319: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:319: Warning: function strlen: precondition 'valid_string_s' got status invalid. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strlen.c:321. [eva] tests/builtins/strlen.c:321: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:322: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:322: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strlen.c:323. [eva] tests/builtins/strlen.c:323: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:324: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:324: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strlen.c:325. [eva] tests/builtins/strlen.c:325: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:326: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:326: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strlen.c:327. [eva] tests/builtins/strlen.c:327: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strlen.c:329: Call to builtin strlen [eva:alarm] tests/builtins/strlen.c:329: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] Recording results for negative_offsets [eva] Done for function negative_offsets [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function init_array_nondet: from ∈ {-1} to ∈ {-1} val1 ∈ {-1} val2 ∈ {-1} val ∈ {0; 1; 2; 3; 4} a[0..99] ∈ {0; 1; 2} a[0..39] ∈ {1; 2} [40..49] ∈ UNINITIALIZED [50..94] ∈ {3; 4} or UNINITIALIZED [95..99] ∈ UNINITIALIZED [eva:final-states] Values at end of function big_array: t[0..999999] ∈ {270729319} or UNINITIALIZED u[0..199] ∈ {270729319} or UNINITIALIZED r[0..200] ∈ {270729319} or UNINITIALIZED p ∈ {{ &r + [0..800],0%4 }} len_u ∈ {1} len_r ∈ {1} len_t ∈ {1} [eva:final-states] Values at end of function bitfields: s.a ∈ {3} .b ∈ {1} .[bits 16 to 31] ∈ UNINITIALIZED .c ∈ {7} .[bits 49 to 63] ∈ UNINITIALIZED p ∈ {{ (char *)&s }} [eva:final-states] Values at end of function bitfields2: s.a ∈ {3} .b ∈ {1} .c ∈ {7} .[bits 25 to 31] ∈ UNINITIALIZED p ∈ {{ (char *)&s }} z1 ∈ {2} [eva:final-states] Values at end of function escaping: s[0] ∈ {0} [1..3] ∈ ESCAPINGADDR z1 ∈ {0} z2 ∈ {0} [eva:final-states] Values at end of function misc: Frama_C_entropy_source ∈ [--..--] loc_str ∈ {{ "Bonjour Monde\n" }} loc_char_array[0..2] ∈ UNINITIALIZED [3] ∈ {0} [4] ∈ UNINITIALIZED sz1 ∈ {12; 14} sz2 ∈ {0} sz3 ∈ [0..13] sz4 ∈ {3} sz5 ∈ {2; 3; 4} sz6 ∈ {1; 2; 3} sz7 ∈ {0; 1; 2; 3; 4} or UNINITIALIZED sz8 ∈ {1} x ∈ {-1412567296} z ∈ {305419776} i ∈ [0..11] str ∈ {{ "" ; "a" ; "aa" ; "aaa" ; "aaaa" ; "aaaaa" ; "aaaaaa" ; "aaaaaaaaa" ; "aaaaaaaaaa" ; "aaaaaaaaaaa" ; "aaaaaaaaaaaa" ; "aaaaaaaaaaaaa" }} s1 ∈ {{ "mno\000pqr" ; "MNOP\000QRS" }} s2 ∈ {{ "efg" + {1; 2} ; "EFGH" + {1; 2} }} maybe_init[0] ∈ {65} or UNINITIALIZED [1] ∈ {0} [eva:final-states] Values at end of function negative_offsets: Frama_C_entropy_source ∈ [--..--] buf[0..98] ∈ {65} or UNINITIALIZED [99] ∈ {0} len1 ∈ UNINITIALIZED len2 ∈ UNINITIALIZED len3 ∈ {99} len4 ∈ {97; 98; 99} len5 ∈ {92; 93; 94; 95; 96; 97; 98; 99} len6 ∈ {99} offset3 ∈ {-1; 0} offset4 ∈ {-1; 0; 1; 2} offset5 ∈ [-4..7] offset6 ∈ [-10..0] p ∈ {{ &buf + [-10..0] }} [eva:final-states] Values at end of function small_sets: s ∈ {{ "b\000c" }} p ∈ {{ "b\000c" + {0; 2} }} z1 ∈ {2; 3} z2 ∈ {0; 2} z3 ∈ {0} z4 ∈ {1} t[0..1] ∈ {0; 1} [2..3] ∈ {1} z5 ∈ {0; 1} [eva:final-states] Values at end of function strlen_initialization: empty_or_uninitialized[0] ∈ {0} or UNINITIALIZED z1 ∈ {0} s[0] ∈ {1} or UNINITIALIZED [1] ∈ {0} p ∈ {{ &t[0] }} z2 ∈ {1} t[0..1] ∈ {10} [2] ∈ {10} or UNINITIALIZED [3] ∈ {0} z3 ∈ {3} [eva:final-states] Values at end of function strlen_large: Frama_C_entropy_source ∈ [--..--] a[0..99] ∈ {0; 2} offset ∈ [50..70] z1 ∈ [0..54] z2 ∈ [3..15] z3 ∈ [1..15] z4 ∈ [0..12] z5 ∈ [0..49] [eva:final-states] Values at end of function strlen_large_uninit: Frama_C_entropy_source ∈ [--..--] a[0..19] ∈ {1; 2} [20] ∈ {0} [21..39] ∈ {1; 2} [40..49] ∈ UNINITIALIZED [50..74] ∈ {3; 4} [75] ∈ {0} [76..94] ∈ {3; 4} [95..97] ∈ UNINITIALIZED [98] ∈ {0} [99] ∈ UNINITIALIZED offset ∈ {0} z1 ∈ [0..17] z2 ∈ [0..12] z3 ∈ {20; 21; 22; 23; 24; 25} [eva:final-states] Values at end of function zero_termination: empty_or_non_terminated[0] ∈ {0; 100} z1 ∈ {0} non_terminated[0] ∈ {88} non_terminated2[0] ∈ {76} [1] ∈ {0} [2] ∈ {28} [3] ∈ {14} p ∈ {{ &non_terminated2{[2], [3]} }} [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] __retres ∈ {0} [from] Computing for function init_array_nondet [from] Computing for function memset <-init_array_nondet [from] Done for function memset [from] Done for function init_array_nondet [from] Computing for function big_array [from] Computing for function strlen <-big_array [from] Done for function strlen [from] Done for function big_array [from] Computing for function bitfields [from] Done for function bitfields [from] Computing for function bitfields2 [from] Done for function bitfields2 [from] Computing for function escaping [from] Done for function escaping [from] Computing for function misc [from] Computing for function Frama_C_interval <-misc [from] Done for function Frama_C_interval [from] Done for function misc [from] Computing for function negative_offsets [from] Done for function negative_offsets [from] Computing for function small_sets [from] Done for function small_sets [from] Computing for function strlen_initialization [from] Done for function strlen_initialization [from] Computing for function strlen_large [from] Done for function strlen_large [from] Computing for function strlen_large_uninit [from] Done for function strlen_large_uninit [from] Computing for function zero_termination [from] Done for function zero_termination [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function memset: a[0..99] FROM c (and SELF) a[0..99] FROM c (and SELF) \result FROM s [from] Function init_array_nondet: a[0..99] FROM val1; val2; nondet (and SELF) a[0..99] FROM val1; val2; nondet (and SELF) [from] Function strlen: \result FROM unterminated_string[0..11]; t[0..3]; empty_or_non_terminated[0]; non_terminated[0]; non_terminated2[2..3]; empty_or_uninitialized[0]; uninitialized[0]; s[0..1]; t[0..3]; s; s; a[3..99]; a[3..99]; s[0..3]; loc_char_array[0..4]; x; maybe_init[0..1]; t[0..999999]; u[0..199]; r[0..200]; buf[0..99]; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111]; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "Bonjour Monde\n"[bits 0 to 119]; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71] [from] Function big_array: NO EFFECTS [from] Function bitfields: NO EFFECTS [from] Function bitfields2: NO EFFECTS [from] Function escaping: NO EFFECTS [from] Function misc: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function negative_offsets: Frama_C_entropy_source FROM Frama_C_entropy_source; nondet (and SELF) [from] Function small_sets: NO EFFECTS [from] Function strlen_initialization: NO EFFECTS [from] Function strlen_large: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function strlen_large_uninit: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function zero_termination: NO EFFECTS [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source; nondet (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function init_array_nondet: from; to; val1; val2; val; tmp; a[0..99]; a{[0..39]; [50..94]} [inout] Inputs for function init_array_nondet: nondet [inout] Out (internal) for function big_array: t[0..999999]; u[0..199]; r[0..200]; p; len_u; len_r; len_t [inout] Inputs for function big_array: nondet [inout] Out (internal) for function bitfields: s{{.a; .b}; .c}; p [inout] Inputs for function bitfields: nondet [inout] Out (internal) for function bitfields2: s{.a; .b; .c}; p; z1; tmp [inout] Inputs for function bitfields2: \nothing [inout] Out (internal) for function escaping: s[0..3]; z1; tmp; z2; tmp_0 [inout] Inputs for function escaping: nondet [inout] Out (internal) for function misc: Frama_C_entropy_source; loc_str; loc_char_array[3]; sz1; sz2; sz3; sz4; sz5; sz6; sz7; sz8; x; z; i; str; s1; tmp; s2; tmp_0; j; maybe_init[0..1] [inout] Inputs for function misc: Frama_C_entropy_source; static_str; zero_str; tab_str[0..11]; unterminated_string[0..11]; nondet; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111]; "Bonjour Monde\n"[bits 0 to 119]; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71] [inout] Out (internal) for function negative_offsets: Frama_C_entropy_source; buf[0..99]; i; len1; len2; len3; len4; len5; len6; offset1; offset2; offset3; offset4; offset5; offset6; p [inout] Inputs for function negative_offsets: Frama_C_entropy_source; nondet [inout] Out (internal) for function small_sets: s; p; tmp; z1; tmp_0; z2; tmp_1; z3; tmp_2; z4; tmp_3; t[0..3]; z5; tmp_4 [inout] Inputs for function small_sets: nondet; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c" [inout] Out (internal) for function strlen_initialization: empty_or_uninitialized[0]; z1; tmp; s[0..1]; p; z2; tmp_0; t[0..3]; z3; tmp_1 [inout] Inputs for function strlen_initialization: nondet [inout] Out (internal) for function strlen_large: Frama_C_entropy_source; a[0..99]; offset; z1; tmp_0; z2; tmp_1; z3; tmp_2; z4; tmp_3; z5; tmp_4 [inout] Inputs for function strlen_large: Frama_C_entropy_source; nondet [inout] Out (internal) for function strlen_large_uninit: Frama_C_entropy_source; a{[0..39]; [50..94]; [98]}; offset; z1; tmp_0; z2; tmp_1; z3; tmp_2 [inout] Inputs for function strlen_large_uninit: Frama_C_entropy_source; nondet [inout] Out (internal) for function zero_termination: empty_or_non_terminated[0]; z1; tmp; non_terminated[0]; non_terminated2[0..3]; p; tmp_0 [inout] Inputs for function zero_termination: nondet [inout] Out (internal) for function main: Frama_C_entropy_source; __retres [inout] Inputs for function main: Frama_C_entropy_source; static_str; zero_str; tab_str[0..11]; unterminated_string[0..11]; nondet; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111]; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "Bonjour Monde\n"[bits 0 to 119]; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71] ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/strlen_align.res.oracle����������������������������������0000666�0000000�0000000�00000002237�13571573400�022117� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/strlen_align.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/builtins/strlen_align.c:24: Call to builtin strlen [eva] tests/builtins/strlen_align.c:24: function strlen: precondition 'valid_string_s' got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: o.e ∈ UNINITIALIZED .obval ∈ {{ "a" }} .c ∈ {32} p ∈ {{ &o + {12} }} k ∈ {0} z ∈ {0} [from] Computing for function main [from] Computing for function strlen <-main [from] Done for function strlen [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function strlen: \result FROM o.c[bits 32 to 63] [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: o{.obval; .c}; p; k; z [inout] Inputs for function main: \nothing �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/strnlen.res.oracle���������������������������������������0000666�0000000�0000000�00000006703�13571573400�021125� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/strnlen.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t1[0] ∈ {97} [1] ∈ {98} [2] ∈ {99} [3] ∈ {100} [4] ∈ {101} t2[0] ∈ {97} [1] ∈ {98} [2] ∈ {99} [3] ∈ {100} [4] ∈ {101} [5] ∈ {0} [eva] tests/builtins/strnlen.c:9: Call to builtin strnlen [eva] tests/builtins/strnlen.c:9: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen.c:10: Call to builtin strnlen [eva] tests/builtins/strnlen.c:10: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen.c:11: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen.c:11: Warning: function strnlen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strnlen.c:13: Call to builtin strnlen [eva] tests/builtins/strnlen.c:13: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen.c:14: Call to builtin strnlen [eva] tests/builtins/strnlen.c:14: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen.c:15: Call to builtin strnlen [eva] tests/builtins/strnlen.c:15: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen.c:17: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} t1[0] ∈ {97} [1] ∈ {98} [2] ∈ {99} [3] ∈ {100} [4] ∈ {101} t2[0] ∈ {97} [1] ∈ {98} [2] ∈ {99} [3] ∈ {100} [4] ∈ {101} [5] ∈ {0} c ∈ [-2147483648..2147483646],0%2 r1a ∈ {3} r1b ∈ {5} r1c ∈ UNINITIALIZED r2a ∈ {3} r2b ∈ {5} r2c ∈ {5} tmp ∈ {3} tmp_0 ∈ {5} tmp_2 ∈ {3} tmp_3 ∈ {5} tmp_4 ∈ {5} __retres ∈ UNINITIALIZED S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: r1a ∈ {3} r1b ∈ {5} r2a ∈ {3} r2b ∈ {5} r2c ∈ {5} __retres ∈ {0} [from] Computing for function main [from] Computing for function strnlen <-main [from] Done for function strnlen [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function strnlen: \result FROM n; t1[0..4]; t2[0..5] [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: r1a; r1b; r2a; r2b; r2c; tmp; tmp_0; tmp_1; tmp_2; tmp_3; tmp_4; __retres [inout] Inputs for function main: t1[0..4]; t2[0..5] �������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/strnlen2.res.oracle��������������������������������������0000666�0000000�0000000�00000153567�13571573400�021222� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/strnlen2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization static_str ∈ {{ "Hello World\n" }} zero_str ∈ {{ "abc\000\000\000abc" }} tab_str[0] ∈ {{ "" }} [1] ∈ {{ "a" }} [2] ∈ {{ "aa" }} [3] ∈ {{ "aaa" }} [4] ∈ {{ "aaaa" }} [5] ∈ {{ "aaaaa" }} [6] ∈ {{ "aaaaaa" }} [7] ∈ {{ "aaaaaaaaa" }} [8] ∈ {{ "aaaaaaaaaa" }} [9] ∈ {{ "aaaaaaaaaaa" }} [10] ∈ {{ "aaaaaaaaaaaa" }} [11] ∈ {{ "aaaaaaaaaaaaa" }} unterminated_string[0] ∈ {117} [1] ∈ {110} [2] ∈ {116} [3] ∈ {101} [4] ∈ {114} [5] ∈ {109} [6] ∈ {105} [7] ∈ {110} [8] ∈ {97} [9] ∈ {116} [10] ∈ {101} [11] ∈ {100} nondet ∈ [--..--] [eva] computing for function small_sets <- main. Called from tests/builtins/strnlen2.c:513. [eva] tests/builtins/strnlen2.c:45: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:45: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:46: assertion got status valid. [eva] tests/builtins/strnlen2.c:49: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:49: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:50: assertion got status valid. [eva] tests/builtins/strnlen2.c:52: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:52: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:53: assertion got status valid. [eva] tests/builtins/strnlen2.c:56: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:56: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:57: assertion got status valid. [eva] tests/builtins/strnlen2.c:61: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:61: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:62: assertion got status valid. [eva] Recording results for small_sets [eva] Done for function small_sets [eva] computing for function zero_termination <- main. Called from tests/builtins/strnlen2.c:514. [eva] tests/builtins/strnlen2.c:68: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:68: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:69: assertion got status valid. [eva] tests/builtins/strnlen2.c:73: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:73: Warning: function strnlen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strnlen2.c:79: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:79: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] Recording results for zero_termination [eva] Done for function zero_termination [eva] computing for function initialization <- main. Called from tests/builtins/strnlen2.c:516. [eva] tests/builtins/strnlen2.c:85: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:85: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:86: assertion got status valid. [eva] tests/builtins/strnlen2.c:89: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:89: Warning: function strnlen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strnlen2.c:94: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:94: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:95: assertion got status valid. [eva] tests/builtins/strnlen2.c:101: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:101: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:102: assertion got status valid. [eva] Recording results for initialization [eva] Done for function initialization [eva] computing for function large <- main. Called from tests/builtins/strnlen2.c:517. [eva] computing for function init_array_nondet <- large <- main. Called from tests/builtins/strnlen2.c:144. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] tests/builtins/strnlen2.c:138: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- large <- main. Called from tests/builtins/strnlen2.c:147. [eva] using specification for function Frama_C_interval [eva] tests/builtins/strnlen2.c:147: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:148: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:148: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:149: assertion got status valid. [eva] computing for function Frama_C_interval <- large <- main. Called from tests/builtins/strnlen2.c:151. [eva] tests/builtins/strnlen2.c:151: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:152: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:152: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:153: assertion got status valid. [eva] computing for function Frama_C_interval <- large <- main. Called from tests/builtins/strnlen2.c:155. [eva] tests/builtins/strnlen2.c:155: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:156: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:156: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:157: assertion got status valid. [eva] computing for function Frama_C_interval <- large <- main. Called from tests/builtins/strnlen2.c:159. [eva] tests/builtins/strnlen2.c:159: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:160: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:160: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:161: assertion got status valid. [eva] computing for function init_array_nondet <- large <- main. Called from tests/builtins/strnlen2.c:163. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- large <- main. Called from tests/builtins/strnlen2.c:164. [eva] tests/builtins/strnlen2.c:164: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:165: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:165: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:166: assertion got status valid. [eva] Recording results for large [eva] Done for function large [eva] computing for function large_uninit <- main. Called from tests/builtins/strnlen2.c:518. [eva] computing for function init_array_nondet <- large_uninit <- main. Called from tests/builtins/strnlen2.c:171. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- large_uninit <- main. Called from tests/builtins/strnlen2.c:172. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- large_uninit <- main. Called from tests/builtins/strnlen2.c:176. [eva] tests/builtins/strnlen2.c:176: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:177: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:177: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:178: assertion got status valid. [eva] computing for function Frama_C_interval <- large_uninit <- main. Called from tests/builtins/strnlen2.c:181. [eva] tests/builtins/strnlen2.c:181: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:182: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:182: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:183: assertion got status valid. [eva] computing for function Frama_C_interval <- large_uninit <- main. Called from tests/builtins/strnlen2.c:185. [eva] tests/builtins/strnlen2.c:185: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:186: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:186: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:187: assertion got status valid. [eva] Recording results for large_uninit [eva] Done for function large_uninit [eva] computing for function misc <- main. Called from tests/builtins/strnlen2.c:519. [eva] tests/builtins/strnlen2.c:215: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:215: Warning: function strnlen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strnlen2.c:218: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:218: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:219: assertion got status valid. [eva] tests/builtins/strnlen2.c:222: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:222: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:223: assertion got status valid. [eva] computing for function Frama_C_interval <- misc <- main. Called from tests/builtins/strnlen2.c:224. [eva] tests/builtins/strnlen2.c:224: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:226: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:226: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:227: assertion got status valid. [eva] tests/builtins/strnlen2.c:229: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:229: Warning: function strnlen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/strnlen2.c:230: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:230: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:231: assertion got status valid. [eva] tests/builtins/strnlen2.c:234: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:234: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:235: assertion got status valid. [eva] tests/builtins/strnlen2.c:239: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:239: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:240: assertion got status valid. [eva] tests/builtins/strnlen2.c:244: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:244: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:245: assertion got status valid. [eva] tests/builtins/strnlen2.c:243: starting to merge loop iterations [eva] tests/builtins/strnlen2.c:244: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:244: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:244: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:244: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:251: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:251: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:252: assertion got status valid. [eva] Recording results for misc [eva] Done for function misc [eva] computing for function bitfields <- main. Called from tests/builtins/strnlen2.c:520. [eva] tests/builtins/strnlen2.c:117: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:117: Warning: function strnlen: precondition 'valid_string_s' got status invalid. [eva] Recording results for bitfields [eva] Done for function bitfields [eva] computing for function bitfields2 <- main. Called from tests/builtins/strnlen2.c:521. [eva] tests/builtins/strnlen2.c:132: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:132: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:133: assertion got status valid. [eva] Recording results for bitfields2 [eva] Done for function bitfields2 [eva] computing for function escaping <- main. Called from tests/builtins/strnlen2.c:522. [eva:locals-escaping] tests/builtins/strnlen2.c:196: Warning: locals {x} escaping the scope of a block of escaping through s [eva] tests/builtins/strnlen2.c:199: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:199: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:200: assertion got status valid. [eva] tests/builtins/strnlen2.c:202: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:202: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:203: assertion got status valid. [eva] Recording results for escaping [eva] Done for function escaping [eva] computing for function big_array <- main. Called from tests/builtins/strnlen2.c:523. [eva:alarm] tests/builtins/strnlen2.c:261: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strnlen2.c:263: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strnlen2.c:265: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/strnlen2.c:272: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:272: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:273: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:273: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:274: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:274: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:275: assertion got status valid. [eva] tests/builtins/strnlen2.c:276: assertion got status valid. [eva] tests/builtins/strnlen2.c:277: assertion got status valid. [eva] tests/builtins/strnlen2.c:278: Frama_C_show_each: {1}, {1}, {1} [eva] tests/builtins/strnlen2.c:282: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:282: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:283: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:283: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:284: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:284: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:285: assertion got status valid. [eva] tests/builtins/strnlen2.c:286: assertion got status valid. [eva] tests/builtins/strnlen2.c:287: assertion got status valid. [eva] tests/builtins/strnlen2.c:288: Frama_C_show_each: {1}, {1}, {1} [eva] computing for function init_array_nondet <- big_array <- main. Called from tests/builtins/strnlen2.c:291. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- big_array <- main. Called from tests/builtins/strnlen2.c:292. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- big_array <- main. Called from tests/builtins/strnlen2.c:293. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva:alarm] tests/builtins/strnlen2.c:295: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strnlen2.c:297: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/strnlen2.c:299: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/strnlen2.c:300: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:300: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:301: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:301: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:302: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:302: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:303: assertion got status valid. [eva] tests/builtins/strnlen2.c:304: assertion got status valid. [eva] tests/builtins/strnlen2.c:305: assertion got status valid. [eva] tests/builtins/strnlen2.c:306: Frama_C_show_each: [0..800], [0..804], [0..4000000] [eva] tests/builtins/strnlen2.c:308: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:308: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:309: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:309: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:310: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:310: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:311: assertion got status valid. [eva] tests/builtins/strnlen2.c:312: assertion got status valid. [eva] tests/builtins/strnlen2.c:313: assertion got status valid. [eva] tests/builtins/strnlen2.c:314: Frama_C_show_each: [0..799], [0..803], [0..3999999] [eva] Recording results for big_array [eva] Done for function big_array [eva] computing for function no_zero_but_ok <- main. Called from tests/builtins/strnlen2.c:525. [eva] tests/builtins/strnlen2.c:325: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:325: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:326: assertion got status valid. [eva] tests/builtins/strnlen2.c:327: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:327: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:328: assertion got status valid. [eva] tests/builtins/strnlen2.c:330: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:330: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:331: assertion got status valid. [eva] tests/builtins/strnlen2.c:333: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:333: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:334: assertion got status valid. [eva] tests/builtins/strnlen2.c:336: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:336: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:337: assertion got status valid. [eva] Recording results for no_zero_but_ok [eva] Done for function no_zero_but_ok [eva] computing for function small_sets_n <- main. Called from tests/builtins/strnlen2.c:526. [eva] tests/builtins/strnlen2.c:345: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:345: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:346: assertion got status valid. [eva] tests/builtins/strnlen2.c:351: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:351: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:352: assertion got status valid. [eva] tests/builtins/strnlen2.c:356: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:356: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:357: assertion got status valid. [eva] tests/builtins/strnlen2.c:361: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:361: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:362: assertion got status valid. [eva] tests/builtins/strnlen2.c:366: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:366: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:367: assertion got status valid. [eva] Recording results for small_sets_n [eva] Done for function small_sets_n [eva] computing for function large_n <- main. Called from tests/builtins/strnlen2.c:527. [eva] computing for function init_array_nondet <- large_n <- main. Called from tests/builtins/strnlen2.c:372. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- large_n <- main. Called from tests/builtins/strnlen2.c:377. [eva] tests/builtins/strnlen2.c:377: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- large_n <- main. Called from tests/builtins/strnlen2.c:378. [eva] tests/builtins/strnlen2.c:378: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:379: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:379: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:380: assertion got status valid. [eva] tests/builtins/strnlen2.c:384: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:384: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:385: assertion got status valid. [eva] tests/builtins/strnlen2.c:388: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:388: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:389: assertion got status valid. [eva] computing for function Frama_C_interval <- large_n <- main. Called from tests/builtins/strnlen2.c:391. [eva] tests/builtins/strnlen2.c:391: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:392: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:392: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:393: assertion got status valid. [eva] computing for function Frama_C_interval <- large_n <- main. Called from tests/builtins/strnlen2.c:395. [eva] tests/builtins/strnlen2.c:395: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:396: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:396: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:397: assertion got status valid. [eva] computing for function Frama_C_interval <- large_n <- main. Called from tests/builtins/strnlen2.c:399. [eva] tests/builtins/strnlen2.c:399: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:400: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:400: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:401: assertion got status valid. [eva] computing for function init_array_nondet <- large_n <- main. Called from tests/builtins/strnlen2.c:403. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- large_n <- main. Called from tests/builtins/strnlen2.c:404. [eva] tests/builtins/strnlen2.c:404: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:405: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:405: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:406: assertion got status valid. [eva] computing for function Frama_C_interval <- large_n <- main. Called from tests/builtins/strnlen2.c:408. [eva] tests/builtins/strnlen2.c:408: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:409: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:409: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:410: assertion got status valid. [eva] computing for function Frama_C_interval <- large_n <- main. Called from tests/builtins/strnlen2.c:412. [eva] tests/builtins/strnlen2.c:412: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- large_n <- main. Called from tests/builtins/strnlen2.c:413. [eva] tests/builtins/strnlen2.c:413: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:414: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:414: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:415: assertion got status valid. [eva] Recording results for large_n [eva] Done for function large_n [eva] computing for function unbounded_n <- main. Called from tests/builtins/strnlen2.c:529. [eva] tests/builtins/strnlen2.c:423: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:423: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:424: assertion got status valid. [eva] tests/builtins/strnlen2.c:426: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:426: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:427: assertion got status valid. [eva] tests/builtins/strnlen2.c:429: Call to builtin strnlen [eva] tests/builtins/strnlen2.c:429: function strnlen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/strnlen2.c:430: assertion got status valid. [eva] Recording results for unbounded_n [eva] Done for function unbounded_n [eva] computing for function intervals <- main. Called from tests/builtins/strnlen2.c:530. [eva] computing for function init_array_nondet <- intervals <- main. Called from tests/builtins/strnlen2.c:435. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- intervals <- main. Called from tests/builtins/strnlen2.c:436. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- intervals <- main. Called from tests/builtins/strnlen2.c:437. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- intervals <- main. Called from tests/builtins/strnlen2.c:438. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- intervals <- main. Called from tests/builtins/strnlen2.c:439. [eva] tests/builtins/strnlen2.c:138: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:441. [eva] tests/builtins/strnlen2.c:441: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:442. [eva] tests/builtins/strnlen2.c:442: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:443: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:443: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:444: assertion got status valid. [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:446. [eva] tests/builtins/strnlen2.c:446: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:447. [eva] tests/builtins/strnlen2.c:447: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:448: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:448: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:449: assertion got status valid. [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:451. [eva] tests/builtins/strnlen2.c:451: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:452. [eva] tests/builtins/strnlen2.c:452: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:453: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:453: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:454: assertion got status valid. [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:456. [eva] tests/builtins/strnlen2.c:456: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:457. [eva] tests/builtins/strnlen2.c:457: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:458: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:458: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:459: assertion got status valid. [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:461. [eva] tests/builtins/strnlen2.c:461: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:462. [eva] tests/builtins/strnlen2.c:462: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:463: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:463: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:464: assertion got status valid. [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:466. [eva] tests/builtins/strnlen2.c:466: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:467. [eva] tests/builtins/strnlen2.c:467: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:468: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:468: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:469: assertion got status valid. [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:471. [eva] tests/builtins/strnlen2.c:471: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:472. [eva] tests/builtins/strnlen2.c:472: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:473: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:473: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:474: assertion got status valid. [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:476. [eva] tests/builtins/strnlen2.c:476: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:477. [eva] tests/builtins/strnlen2.c:477: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:478: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:478: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:479: assertion got status valid. [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:481. [eva] tests/builtins/strnlen2.c:481: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- intervals <- main. Called from tests/builtins/strnlen2.c:482. [eva] tests/builtins/strnlen2.c:482: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:483: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:483: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/strnlen2.c:484: assertion got status valid. [eva] Recording results for intervals [eva] Done for function intervals [eva] computing for function negative_offsets <- main. Called from tests/builtins/strnlen2.c:532. [eva] tests/builtins/strnlen2.c:489: starting to merge loop iterations [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strnlen2.c:493. [eva] tests/builtins/strnlen2.c:493: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:494: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:494: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strnlen2.c:497. [eva] tests/builtins/strnlen2.c:497: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:498: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:498: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strnlen2.c:500. [eva] tests/builtins/strnlen2.c:500: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:501: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:501: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strnlen2.c:502. [eva] tests/builtins/strnlen2.c:502: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:503: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:503: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strnlen2.c:504. [eva] tests/builtins/strnlen2.c:504: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:505: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:505: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/strnlen2.c:506. [eva] tests/builtins/strnlen2.c:506: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/strnlen2.c:508: Call to builtin strnlen [eva:alarm] tests/builtins/strnlen2.c:508: Warning: function strnlen: precondition 'valid_string_s' got status unknown. [eva] Recording results for negative_offsets [eva] Done for function negative_offsets [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function init_array_nondet: from ∈ {-1} to ∈ {-1} val1 ∈ {-1} val2 ∈ {-1} val ∈ {0; 1; 2; 3; 4} a[0..99] ∈ {0; 1; 2} a[0..39] ∈ {1; 2} [40..49] ∈ UNINITIALIZED [50..94] ∈ {3; 4} or UNINITIALIZED [95..99] ∈ UNINITIALIZED u[0..199] ∈ {0; 16843009} r[0..200] ∈ {0; 16843009; 270729319} or UNINITIALIZED t[0..999999] ∈ {0; 16843009; 270729319} or UNINITIALIZED a[0..99] ∈ {0; 1; 2} a[0..9] ∈ {0; 1} [10] ∈ UNINITIALIZED [11] ∈ {0; 1} or UNINITIALIZED [12..15] ∈ {1} or UNINITIALIZED [16..19] ∈ {0; 1} or UNINITIALIZED [20..99] ∈ UNINITIALIZED [eva:final-states] Values at end of function big_array: u[0..199] ∈ {0; 16843009; 270729319} r[0..200] ∈ {0; 16843009; 270729319} t[0..999999] ∈ {0; 16843009; 270729319} p ∈ {{ &t + [0..3999996],0%4 }} len_u ∈ [0..799] len_r ∈ [0..803] len_t ∈ [0..3999999] [eva:final-states] Values at end of function bitfields: s.a ∈ {3} .b ∈ {1} .[bits 16 to 31] ∈ UNINITIALIZED .c ∈ {7} .[bits 49 to 63] ∈ UNINITIALIZED p ∈ {{ (char *)&s }} [eva:final-states] Values at end of function bitfields2: s.a ∈ {3} .b ∈ {1} .c ∈ {7} .[bits 25 to 31] ∈ UNINITIALIZED p ∈ {{ (char *)&s }} z1 ∈ {2} [eva:final-states] Values at end of function escaping: s[0] ∈ {0} [1..3] ∈ ESCAPINGADDR z1 ∈ {0} z2 ∈ {0} [eva:final-states] Values at end of function initialization: empty_or_uninitialized[0] ∈ {0} or UNINITIALIZED z1 ∈ {0} s[0] ∈ {1} or UNINITIALIZED [1] ∈ {0} z2 ∈ {1} t[0..1] ∈ {10} [2] ∈ {10} or UNINITIALIZED [3] ∈ {0} z3 ∈ {3} [eva:final-states] Values at end of function intervals: Frama_C_entropy_source ∈ [--..--] a[0..2] ∈ {0; 1} [3..6] ∈ {1} [7..9] ∈ {0; 1} [10] ∈ UNINITIALIZED [11] ∈ {0; 1} [12..15] ∈ {1} [16..19] ∈ {0; 1} [20..99] ∈ UNINITIALIZED offset ∈ [3..11] n ∈ [0..11] z1 ∈ [0..9] z2 ∈ {0; 1; 2; 3; 4; 5; 6; 7} z3 ∈ {0; 1; 2; 3; 4; 5; 6; 7} z4 ∈ {0; 1; 2; 3; 4; 5; 6; 7} z5 ∈ {0; 1; 2; 3; 4; 5; 6; 7} z6 ∈ {0; 1; 2; 3; 4; 5; 6; 7} z7 ∈ [0..9] z8 ∈ [0..9] z9 ∈ [0..9] [eva:final-states] Values at end of function large: Frama_C_entropy_source ∈ [--..--] a[0..99] ∈ {0; 2} offset ∈ [50..70] z1 ∈ [0..54] z2 ∈ [3..15] z3 ∈ [1..15] z4 ∈ [0..12] z5 ∈ [0..49] [eva:final-states] Values at end of function large_n: Frama_C_entropy_source ∈ [--..--] a[0..99] ∈ {0; 2} offset ∈ [0..10] n ∈ [0..90] z1 ∈ [0..12] z2 ∈ [0..13] z3 ∈ [0..20] z4 ∈ [0..13] z5 ∈ [1..15] z6 ∈ [0..20] z7 ∈ [0..20] z8 ∈ [0..50] z9 ∈ [0..90] [eva:final-states] Values at end of function large_uninit: Frama_C_entropy_source ∈ [--..--] a[0..19] ∈ {1; 2} [20] ∈ {0} [21..39] ∈ {1; 2} [40..49] ∈ UNINITIALIZED [50..74] ∈ {3; 4} [75] ∈ {0} [76..94] ∈ {3; 4} [95..97] ∈ UNINITIALIZED [98] ∈ {0} [99] ∈ UNINITIALIZED offset ∈ {0} z1 ∈ [0..17] z2 ∈ [0..12] z3 ∈ {20; 21; 22; 23; 24; 25} [eva:final-states] Values at end of function misc: Frama_C_entropy_source ∈ [--..--] loc_str ∈ {{ "Bonjour Monde\n" }} loc_char_array[0..2] ∈ UNINITIALIZED [3] ∈ {0} [4] ∈ UNINITIALIZED sz1 ∈ {12; 14} sz2 ∈ {0} sz3 ∈ [0..13] sz4 ∈ {3} sz5 ∈ {2; 3; 4} sz6 ∈ {1; 2; 3} sz7 ∈ {0; 1; 2; 3; 4} or UNINITIALIZED sz8 ∈ {1} x ∈ {-1412567296} z ∈ {305419776} i ∈ [0..11] str ∈ {{ "" ; "a" ; "aa" ; "aaa" ; "aaaa" ; "aaaaa" ; "aaaaaa" ; "aaaaaaaaa" ; "aaaaaaaaaa" ; "aaaaaaaaaaa" ; "aaaaaaaaaaaa" ; "aaaaaaaaaaaaa" }} s1 ∈ {{ "mno\000pqr" ; "MNOP\000QRS" }} s2 ∈ {{ "efg" + {1; 2} ; "EFGH" + {1; 2} }} maybe_init[0] ∈ {65} or UNINITIALIZED [1] ∈ {0} [eva:final-states] Values at end of function negative_offsets: Frama_C_entropy_source ∈ [--..--] buf[0..98] ∈ {65} or UNINITIALIZED [99] ∈ {0} len1 ∈ UNINITIALIZED len2 ∈ UNINITIALIZED len3 ∈ {99} len4 ∈ {97; 98; 99} len5 ∈ {92; 93; 94; 95; 96; 97; 98; 99} len6 ∈ {99} offset3 ∈ {-1; 0} offset4 ∈ {-1; 0; 1; 2} offset5 ∈ [-4..7] offset6 ∈ [-10..0] p ∈ {{ &buf + [-10..0] }} [eva:final-states] Values at end of function no_zero_but_ok: s[0..9] ∈ {1} [10] ∈ {0} [11..13] ∈ {1} [14..19] ∈ {0; 1} z1 ∈ {5} z2 ∈ {10} p ∈ {{ &s{[7], [18]} }} z3 ∈ {2; 9} z4 ∈ {3; 4} z5 ∈ {0; 1; 3} [eva:final-states] Values at end of function small_sets: s ∈ {{ "b\000c" }} o ∈ {0; 2} z1 ∈ {2; 3} z2 ∈ {0; 2} z3 ∈ {0} z4 ∈ {1} t[0..1] ∈ {0; 1} [2..3] ∈ {1} z5 ∈ {0; 1; 4} [eva:final-states] Values at end of function small_sets_n: s ∈ {{ "bcd\000efg" }} p ∈ {{ "bcd\000efg" + {0; 2; 4} }} n ∈ {2; 5} z1 ∈ {2; 4; 5} z2 ∈ {0; 1; 4} z3a ∈ {1; 2} z3 ∈ {1; 2; 3} z4 ∈ {1; 2; 3} [eva:final-states] Values at end of function unbounded_n: n ∈ [0..2147483647] s ∈ {{ "bcd\000eg" }} zu1 ∈ {0; 1; 2; 3} o ∈ {0; 1} zu2 ∈ {0; 1; 2; 3} zu3 ∈ {0; 1; 2; 3} [eva:final-states] Values at end of function zero_termination: empty_or_non_terminated[0] ∈ {0; 100} z1 ∈ {0; 1} non_terminated[0] ∈ {88} non_terminated2[0] ∈ {76} [1] ∈ {0} [2] ∈ {28} [3] ∈ {14} o ∈ {2; 3} [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] __retres ∈ {0} [from] Computing for function init_array_nondet [from] Computing for function memset <-init_array_nondet [from] Done for function memset [from] Done for function init_array_nondet [from] Computing for function big_array [from] Computing for function strnlen <-big_array [from] Done for function strnlen [from] Done for function big_array [from] Computing for function bitfields [from] Done for function bitfields [from] Computing for function bitfields2 [from] Done for function bitfields2 [from] Computing for function escaping [from] Done for function escaping [from] Computing for function initialization [from] Done for function initialization [from] Computing for function intervals [from] Computing for function Frama_C_interval <-intervals [from] Done for function Frama_C_interval [from] Done for function intervals [from] Computing for function large [from] Done for function large [from] Computing for function large_n [from] Done for function large_n [from] Computing for function large_uninit [from] Done for function large_uninit [from] Computing for function misc [from] Done for function misc [from] Computing for function negative_offsets [from] Done for function negative_offsets [from] Computing for function no_zero_but_ok [from] Done for function no_zero_but_ok [from] Computing for function small_sets [from] Done for function small_sets [from] Computing for function small_sets_n [from] Done for function small_sets_n [from] Computing for function unbounded_n [from] Done for function unbounded_n [from] Computing for function zero_termination [from] Done for function zero_termination [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function memset: a[0..99] FROM c (and SELF) a[0..99] FROM c (and SELF) u[0..199] FROM c (and SELF) r[0..200] FROM c (and SELF) t[0..999999] FROM c (and SELF) a[0..99] FROM c (and SELF) a[0..99] FROM c (and SELF) \result FROM s [from] Function init_array_nondet: a[0..99] FROM val1; val2; nondet (and SELF) a[0..99] FROM val1; val2; nondet (and SELF) u[0..199] FROM val1; val2; nondet (and SELF) r[0..200] FROM val1; val2; nondet (and SELF) t[0..999999] FROM val1; val2; nondet (and SELF) a[0..99] FROM val1; val2; nondet (and SELF) a[0..99] FROM val1; val2; nondet (and SELF) [from] Function strnlen: \result FROM n; unterminated_string[0..11]; t[0..3]; empty_or_non_terminated[0]; non_terminated[0]; non_terminated2[2..3]; empty_or_uninitialized[0]; uninitialized[0]; s[0..1]; t[0..3]; s; s; a[3..99]; a[3..99]; s[0..3]; loc_char_array[0..4]; x; maybe_init[0..1]; u[0..199]; r[0..200]; t[0..999999]; s[0..19]; a[0..99]; a[0..99]; buf[0..99]; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 79]; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 111]; "abc"; "\000bc"; ""[bits 0 to 7]; "b\000c"; "Bonjour Monde\n"[bits 0 to 119]; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71]; "abcde"[bits 0 to 47]; "\000bcdef"[bits 0 to 55]; "bcd\000efg"[bits 0 to 63]; "abc"; "bcd\000eg"[bits 0 to 55] [from] Function big_array: NO EFFECTS [from] Function bitfields: NO EFFECTS [from] Function bitfields2: NO EFFECTS [from] Function escaping: NO EFFECTS [from] Function initialization: NO EFFECTS [from] Function intervals: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function large: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function large_n: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function large_uninit: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function misc: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function negative_offsets: Frama_C_entropy_source FROM Frama_C_entropy_source; nondet (and SELF) [from] Function no_zero_but_ok: NO EFFECTS [from] Function small_sets: NO EFFECTS [from] Function small_sets_n: NO EFFECTS [from] Function unbounded_n: NO EFFECTS [from] Function zero_termination: NO EFFECTS [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source; nondet (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function init_array_nondet: from; to; val1; val2; val; tmp; a[0..99]; a{[0..39]; [50..94]}; u[0..199]; r[0..200]; t[0..999999]; a[0..99]; a{[0..9]; [11..19]} [inout] Inputs for function init_array_nondet: nondet [inout] Out (internal) for function big_array: u[0..199]; r[0..200]; t[0..999999]; p; len_u; len_r; len_t [inout] Inputs for function big_array: nondet [inout] Out (internal) for function bitfields: s{{.a; .b}; .c}; p [inout] Inputs for function bitfields: nondet [inout] Out (internal) for function bitfields2: s{.a; .b; .c}; p; z1; tmp [inout] Inputs for function bitfields2: \nothing [inout] Out (internal) for function escaping: s[0..3]; z1; tmp; z2; tmp_0 [inout] Inputs for function escaping: nondet [inout] Out (internal) for function initialization: empty_or_uninitialized[0]; z1; tmp; s[0..1]; z2; tmp_0; t[0..3]; z3; tmp_1 [inout] Inputs for function initialization: nondet [inout] Out (internal) for function intervals: Frama_C_entropy_source; a{[0..9]; [11..19]}; offset; n; z1; tmp_1; z2; tmp_2; z3; tmp_3; z4; tmp_4; z5; tmp_5; z6; tmp_6; z7; tmp_7; z8; tmp_8; z9; tmp_9 [inout] Inputs for function intervals: Frama_C_entropy_source; nondet [inout] Out (internal) for function large: Frama_C_entropy_source; a[0..99]; offset; z1; tmp_0; z2; tmp_1; z3; tmp_2; z4; tmp_3; z5; tmp_4 [inout] Inputs for function large: Frama_C_entropy_source; nondet [inout] Out (internal) for function large_n: Frama_C_entropy_source; a[0..99]; offset; n; z1; tmp_1; z2; tmp_2; z3; tmp_3; z4; tmp_4; z5; tmp_5; z6; tmp_6; z7; tmp_7; z8; tmp_8; z9; tmp_9 [inout] Inputs for function large_n: Frama_C_entropy_source; nondet [inout] Out (internal) for function large_uninit: Frama_C_entropy_source; a{[0..39]; [50..94]; [98]}; offset; z1; tmp_0; z2; tmp_1; z3; tmp_2 [inout] Inputs for function large_uninit: Frama_C_entropy_source; nondet [inout] Out (internal) for function misc: Frama_C_entropy_source; loc_str; loc_char_array[3]; sz1; sz2; sz3; sz4; sz5; sz6; sz7; sz8; x; z; i; str; s1; tmp; s2; tmp_0; j; maybe_init[0..1] [inout] Inputs for function misc: Frama_C_entropy_source; static_str; zero_str; tab_str[0..11]; unterminated_string[0..11]; nondet; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 71]; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 103]; "Bonjour Monde\n"[bits 0 to 111]; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71] [inout] Out (internal) for function negative_offsets: Frama_C_entropy_source; buf[0..99]; i; len1; len2; len3; len4; len5; len6; offset1; offset2; offset3; offset4; offset5; offset6; p [inout] Inputs for function negative_offsets: Frama_C_entropy_source; nondet [inout] Out (internal) for function no_zero_but_ok: s[0..19]; z1; tmp; z2; tmp_0; p; tmp_1; z3; tmp_2; z4; tmp_3; z5; tmp_4 [inout] Inputs for function no_zero_but_ok: nondet [inout] Out (internal) for function small_sets: s; o; tmp; z1; tmp_0; z2; tmp_1; z3; tmp_2; z4; tmp_3; t[0..3]; z5; tmp_4 [inout] Inputs for function small_sets: nondet; "abc"; "\000bc"[bits 0 to 23]; "b\000c" [inout] Out (internal) for function small_sets_n: s; p; tmp; n; tmp_0; z1; tmp_1; z2; tmp_2; z3a; tmp_3; z3; tmp_4; tmp_5; z4; tmp_6 [inout] Inputs for function small_sets_n: nondet; "abcde"[bits 0 to 47]; "\000bcdef"[bits 0 to 39]; "bcd\000efg"[bits 0 to 63] [inout] Out (internal) for function unbounded_n: n; s; zu1; tmp; o; tmp_0; zu2; tmp_1; zu3; tmp_2 [inout] Inputs for function unbounded_n: nondet; "abc"; "bcd\000eg"[bits 0 to 55] [inout] Out (internal) for function zero_termination: empty_or_non_terminated[0]; z1; tmp; non_terminated[0]; non_terminated2[0..3]; o; tmp_0 [inout] Inputs for function zero_termination: nondet [inout] Out (internal) for function main: Frama_C_entropy_source; __retres [inout] Inputs for function main: Frama_C_entropy_source; static_str; zero_str; tab_str[0..11]; unterminated_string[0..11]; nondet; "Hello World\n"[bits 0 to 103]; "abc\000\000\000abc"[bits 0 to 71]; ""[bits 0 to 7]; "a"[bits 0 to 15]; "aa"[bits 0 to 23]; "aaa"; "aaaa"[bits 0 to 39]; "aaaaa"[bits 0 to 47]; "aaaaaa"[bits 0 to 55]; "aaaaaaaaa"[bits 0 to 79]; "aaaaaaaaaa"[bits 0 to 87]; "aaaaaaaaaaa"[bits 0 to 95]; "aaaaaaaaaaaa"[bits 0 to 103]; "aaaaaaaaaaaaa"[bits 0 to 103]; "abc"; "\000bc"[bits 0 to 23]; "b\000c"; "Bonjour Monde\n"[bits 0 to 111]; "abc"; "ABCD"[bits 0 to 39]; "efg"[bits 8 to 31]; "EFGH"[bits 8 to 39]; "mno\000pqr"[bits 0 to 63]; "MNOP\000QRS"[bits 0 to 71]; "abcde"[bits 0 to 47]; "\000bcdef"[bits 0 to 39]; "bcd\000efg"[bits 0 to 63]; "abc"; "bcd\000eg"[bits 0 to 55] �����������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/vla.res.oracle�������������������������������������������0000666�0000000�0000000�00000015414�13571573400�020221� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/vla.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/builtins/vla.c:20. [eva] tests/builtins/vla.c:6: assertion 'alloca_bounds' got status valid. [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_alloc [eva] tests/builtins/vla.c:6: allocating variable __malloc_f_l6 [eva] tests/builtins/vla.c:7: Frama_C_show_each: {{ &__malloc_f_l6 }} [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/vla.c:6: strong free on bases: {__malloc_f_l6} [eva] Recording results for f [eva] Done for function f [eva] tests/builtins/vla.c:20: freeing automatic bases: {__malloc_f_l6} [eva:malloc] tests/builtins/vla.c:20: strong free on bases: {__malloc_f_l6} [eva] computing for function f <- main. Called from tests/builtins/vla.c:20. [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/vla.c:6: resizing variable `__malloc_f_l6' (0..63) to fit 0..95 [eva] tests/builtins/vla.c:7: Frama_C_show_each: {{ &__malloc_f_l6 }} [eva:alarm] tests/builtins/vla.c:8: Warning: out of bounds write. assert \valid(t + i); [eva:alarm] tests/builtins/vla.c:9: Warning: out of bounds read. assert \valid_read(t + i); [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/vla.c:6: strong free on bases: {__malloc_f_l6} [eva] Recording results for f [eva] Done for function f [eva:malloc] tests/builtins/vla.c:20: strong free on bases: {__malloc_f_l6} [eva] computing for function f <- main. Called from tests/builtins/vla.c:20. [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/vla.c:6: resizing variable `__malloc_f_l6' (0..63/95) to fit 0..127 [eva] tests/builtins/vla.c:7: Frama_C_show_each: {{ &__malloc_f_l6 }} [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/vla.c:6: strong free on bases: {__malloc_f_l6} [eva] Recording results for f [eva] Done for function f [eva:malloc] tests/builtins/vla.c:20: strong free on bases: {__malloc_f_l6} [eva] computing for function f <- main. Called from tests/builtins/vla.c:20. [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/vla.c:6: resizing variable `__malloc_f_l6' (0..63/127) to fit 0..159 [eva] tests/builtins/vla.c:7: Frama_C_show_each: {{ &__malloc_f_l6 }} [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/vla.c:6: strong free on bases: {__malloc_f_l6} [eva] Recording results for f [eva] Done for function f [eva:malloc] tests/builtins/vla.c:20: strong free on bases: {__malloc_f_l6} [eva] computing for function f <- main. Called from tests/builtins/vla.c:20. [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/vla.c:6: resizing variable `__malloc_f_l6' (0..63/159) to fit 0..191 [eva] tests/builtins/vla.c:7: Frama_C_show_each: {{ &__malloc_f_l6 }} [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/vla.c:6: strong free on bases: {__malloc_f_l6} [eva] Recording results for f [eva] Done for function f [eva:malloc] tests/builtins/vla.c:20: strong free on bases: {__malloc_f_l6} [eva] computing for function f <- main. Called from tests/builtins/vla.c:20. [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/vla.c:6: resizing variable `__malloc_f_l6' (0..63/191) to fit 0..223 [eva] tests/builtins/vla.c:7: Frama_C_show_each: {{ &__malloc_f_l6 }} [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/vla.c:6: strong free on bases: {__malloc_f_l6} [eva] Recording results for f [eva] Done for function f [eva:malloc] tests/builtins/vla.c:20: strong free on bases: {__malloc_f_l6} [eva] computing for function f <- main. Called from tests/builtins/vla.c:20. [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/vla.c:6: resizing variable `__malloc_f_l6' (0..63/223) to fit 0..255 [eva] tests/builtins/vla.c:7: Frama_C_show_each: {{ &__malloc_f_l6 }} [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/vla.c:6: strong free on bases: {__malloc_f_l6} [eva] Recording results for f [eva] Done for function f [eva:malloc] tests/builtins/vla.c:20: strong free on bases: {__malloc_f_l6} [eva] computing for function f <- main. Called from tests/builtins/vla.c:20. [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/vla.c:6: resizing variable `__malloc_f_l6' (0..63/255) to fit 0..287 [eva] tests/builtins/vla.c:7: Frama_C_show_each: {{ &__malloc_f_l6 }} [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/vla.c:6: strong free on bases: {__malloc_f_l6} [eva] Recording results for f [eva] Done for function f [eva:malloc] tests/builtins/vla.c:20: strong free on bases: {__malloc_f_l6} [eva] computing for function f <- main. Called from tests/builtins/vla.c:20. [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_alloc [eva:malloc] tests/builtins/vla.c:6: resizing variable `__malloc_f_l6' (0..63/287) to fit 0..319 [eva] tests/builtins/vla.c:7: Frama_C_show_each: {{ &__malloc_f_l6 }} [eva] tests/builtins/vla.c:6: Call to builtin __fc_vla_free [eva:malloc] tests/builtins/vla.c:6: strong free on bases: {__malloc_f_l6} [eva] Recording results for f [eva] Done for function f [eva:malloc] tests/builtins/vla.c:20: strong free on bases: {__malloc_f_l6} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: t ∈ ESCAPINGADDR __lengthof_t ∈ [2..10] [eva:final-states] Values at end of function main: i ∈ {10} [from] Computing for function f [from] Computing for function __fc_vla_alloc <-f [from] Done for function __fc_vla_alloc [from] Computing for function __fc_vla_free <-f [from] Done for function __fc_vla_free [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function __fc_vla_alloc: \result FROM \nothing [from] Function __fc_vla_free: NO EFFECTS [from] Function f: __malloc_f_l6[1..9] FROM i (and SELF) [from] Function main: __malloc_f_l6[1..9] FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: t; __lengthof_t; __malloc_f_l6[1..9] [inout] Inputs for function f: __malloc_f_l6[1..9] [inout] Out (internal) for function main: i; __malloc_f_l6[1..9] [inout] Inputs for function main: __malloc_f_l6[1..9] ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/watch.res.oracle�����������������������������������������0000666�0000000�0000000�00000004603�13571573400�020543� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/watch.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/builtins/watch.c:5: Warning: Calling undeclared function Frama_C_watch_value. Old style K&R code? [kernel:typing:implicit-function-declaration] tests/builtins/watch.c:11: Warning: Calling undeclared function u. Old style K&R code? [kernel:annot:missing-spec] tests/builtins/watch.c:3: Warning: Neither code nor specification for function Frama_C_watch_value, generating default assigns from the prototype [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} [eva] tests/builtins/watch.c:5: Call to builtin Frama_C_watch_value [eva] tests/builtins/watch.c:8: Watchpoint: & c [--..--] [eva] tests/builtins/watch.c:9: Watchpoint: & c [--..--] [eva] computing for function u <- main. Called from tests/builtins/watch.c:11. [kernel:annot:missing-spec] tests/builtins/watch.c:11: Warning: Neither code nor specification for function u, generating default assigns from the prototype [eva] using specification for function u [eva] Done for function u [eva] tests/builtins/watch.c:12: Watchpoint: & c [--..--] [eva] tests/builtins/watch.c:13: Watchpoint: & c [--..--] [eva] tests/builtins/watch.c:14: Watchpoint: & c [--..--] [eva] User Error: Degeneration occurred: results are not correct for lines of code that can be reached from the degeneration point. [from] Computing for function main [from] Computing for function Frama_C_watch_value <-main [from] Done for function Frama_C_watch_value [from] Computing for function u <-main [from] Done for function u [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_watch_value: c FROM c; x_1; x_2; x_3 (and SELF) \result FROM c; x_1; x_2; x_3 [from] Function u: \result FROM \nothing [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; c [inout] Inputs for function main: x [eva] User Error: Deferred error message was emitted during execution. See above messages for more information. [kernel] Plug-in eva aborted: invalid user input. �����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/wcslen.res.oracle����������������������������������������0000666�0000000�0000000�00000074437�13571573400�020744� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/wcslen.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization static_str ∈ {{ L"Hello World\n" }} zero_str ∈ {{ L"abc\000\000\000abc" }} tab_str[0] ∈ {{ L"" }} [1] ∈ {{ L"a" }} [2] ∈ {{ L"aa" }} [3] ∈ {{ L"aaa" }} [4] ∈ {{ L"aaaa" }} [5] ∈ {{ L"aaaaa" }} [6] ∈ {{ L"aaaaaa" }} [7] ∈ {{ L"aaaaaaaaa" }} [8] ∈ {{ L"aaaaaaaaaa" }} [9] ∈ {{ L"aaaaaaaaaaa" }} [10] ∈ {{ L"aaaaaaaaaaaa" }} [11] ∈ {{ L"aaaaaaaaaaaaa" }} unterminated_string[0] ∈ {117} [1] ∈ {110} [2] ∈ {116} [3] ∈ {101} [4] ∈ {114} [5] ∈ {109} [6] ∈ {105} [7] ∈ {110} [8] ∈ {97} [9] ∈ {116} [10] ∈ {101} [11] ∈ {100} nondet ∈ [--..--] [eva] computing for function small_sets <- main. Called from tests/builtins/wcslen.c:339. [eva] tests/builtins/wcslen.c:60: Call to builtin wcslen [eva] tests/builtins/wcslen.c:60: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:61: assertion got status valid. [eva] tests/builtins/wcslen.c:65: Call to builtin wcslen [eva] tests/builtins/wcslen.c:65: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:66: assertion got status valid. [eva] tests/builtins/wcslen.c:70: Call to builtin wcslen [eva] tests/builtins/wcslen.c:70: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:71: assertion got status valid. [eva] tests/builtins/wcslen.c:75: Call to builtin wcslen [eva] tests/builtins/wcslen.c:75: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:76: assertion got status valid. [eva] tests/builtins/wcslen.c:81: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:81: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:82: assertion got status valid. [eva] Recording results for small_sets [eva] Done for function small_sets [eva] computing for function zero_termination <- main. Called from tests/builtins/wcslen.c:340. [eva] tests/builtins/wcslen.c:89: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:89: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:90: assertion got status valid. [eva] tests/builtins/wcslen.c:93: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:93: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/wcslen.c:97: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:97: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] Recording results for zero_termination [eva] Done for function zero_termination [eva] computing for function wcslen_initialization <- main. Called from tests/builtins/wcslen.c:341. [eva] tests/builtins/wcslen.c:105: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:105: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:106: assertion got status valid. [eva] tests/builtins/wcslen.c:109: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:109: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/wcslen.c:116: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:116: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:117: assertion got status valid. [eva] tests/builtins/wcslen.c:124: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:124: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:125: assertion got status valid. [eva] Recording results for wcslen_initialization [eva] Done for function wcslen_initialization [eva] computing for function wcslen_large <- main. Called from tests/builtins/wcslen.c:342. [eva] computing for function init_array_nondet <- wcslen_large <- main. Called from tests/builtins/wcslen.c:168. [eva] tests/builtins/wcslen.c:161: Call to builtin memset [eva] tests/builtins/wcslen.c:161: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- wcslen_large <- main. Called from tests/builtins/wcslen.c:171. [eva] using specification for function Frama_C_interval [eva] tests/builtins/wcslen.c:171: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:172: Call to builtin wcslen [eva] tests/builtins/wcslen.c:172: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:173: assertion got status valid. [eva] computing for function Frama_C_interval <- wcslen_large <- main. Called from tests/builtins/wcslen.c:175. [eva] tests/builtins/wcslen.c:175: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:176: Call to builtin wcslen [eva] tests/builtins/wcslen.c:176: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:177: assertion got status valid. [eva] computing for function Frama_C_interval <- wcslen_large <- main. Called from tests/builtins/wcslen.c:179. [eva] tests/builtins/wcslen.c:179: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:180: Call to builtin wcslen [eva] tests/builtins/wcslen.c:180: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:181: assertion got status valid. [eva] computing for function Frama_C_interval <- wcslen_large <- main. Called from tests/builtins/wcslen.c:183. [eva] tests/builtins/wcslen.c:183: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:184: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:184: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:185: assertion got status valid. [eva] computing for function init_array_nondet <- wcslen_large <- main. Called from tests/builtins/wcslen.c:187. [eva] tests/builtins/wcslen.c:161: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- wcslen_large <- main. Called from tests/builtins/wcslen.c:188. [eva] tests/builtins/wcslen.c:188: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:189: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:189: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:190: assertion got status valid. [eva] Recording results for wcslen_large [eva] Done for function wcslen_large [eva] computing for function wcslen_large_uninit <- main. Called from tests/builtins/wcslen.c:343. [eva] computing for function init_array_nondet <- wcslen_large_uninit <- main. Called from tests/builtins/wcslen.c:197. [eva] tests/builtins/wcslen.c:161: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function init_array_nondet <- wcslen_large_uninit <- main. Called from tests/builtins/wcslen.c:198. [eva] tests/builtins/wcslen.c:161: Call to builtin memset [eva] Recording results for init_array_nondet [eva] Done for function init_array_nondet [eva] computing for function Frama_C_interval <- wcslen_large_uninit <- main. Called from tests/builtins/wcslen.c:202. [eva] tests/builtins/wcslen.c:202: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:203: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:203: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:204: assertion got status valid. [eva] computing for function Frama_C_interval <- wcslen_large_uninit <- main. Called from tests/builtins/wcslen.c:207. [eva] tests/builtins/wcslen.c:207: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:208: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:208: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:209: assertion got status valid. [eva] computing for function Frama_C_interval <- wcslen_large_uninit <- main. Called from tests/builtins/wcslen.c:211. [eva] tests/builtins/wcslen.c:211: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:212: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:212: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:213: assertion got status valid. [eva] Recording results for wcslen_large_uninit [eva] Done for function wcslen_large_uninit [eva] computing for function misc <- main. Called from tests/builtins/wcslen.c:344. [eva] tests/builtins/wcslen.c:241: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:241: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/wcslen.c:244: Call to builtin wcslen [eva] tests/builtins/wcslen.c:244: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:245: assertion got status valid. [eva] tests/builtins/wcslen.c:248: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:248: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:249: assertion got status valid. [eva] computing for function Frama_C_interval <- misc <- main. Called from tests/builtins/wcslen.c:250. [eva] tests/builtins/wcslen.c:250: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:252: Call to builtin wcslen [eva] tests/builtins/wcslen.c:252: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:253: assertion got status valid. [eva] tests/builtins/wcslen.c:255: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:255: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/builtins/wcslen.c:256: Call to builtin wcslen [eva] tests/builtins/wcslen.c:256: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:257: assertion got status valid. [eva] tests/builtins/wcslen.c:260: Call to builtin wcslen [eva] tests/builtins/wcslen.c:260: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:261: assertion got status valid. [eva] tests/builtins/wcslen.c:265: Call to builtin wcslen [eva] tests/builtins/wcslen.c:265: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:266: assertion got status valid. [eva] tests/builtins/wcslen.c:270: Call to builtin wcslen [eva] tests/builtins/wcslen.c:270: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:271: assertion got status valid. [eva] tests/builtins/wcslen.c:269: starting to merge loop iterations [eva] tests/builtins/wcslen.c:270: Call to builtin wcslen [eva] tests/builtins/wcslen.c:270: Call to builtin wcslen [eva] tests/builtins/wcslen.c:270: Call to builtin wcslen [eva] tests/builtins/wcslen.c:270: Call to builtin wcslen [eva] tests/builtins/wcslen.c:277: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:277: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:278: assertion got status valid. [eva] Recording results for misc [eva] Done for function misc [eva] computing for function bitfields <- main. Called from tests/builtins/wcslen.c:345. [eva] tests/builtins/wcslen.c:140: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:140: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] Recording results for bitfields [eva] Done for function bitfields [eva] computing for function bitfields2 <- main. Called from tests/builtins/wcslen.c:346. [eva] tests/builtins/wcslen.c:155: Call to builtin wcslen [eva] tests/builtins/wcslen.c:155: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:156: assertion got status valid. [eva] Recording results for bitfields2 [eva] Done for function bitfields2 [eva] computing for function escaping <- main. Called from tests/builtins/wcslen.c:347. [eva:locals-escaping] tests/builtins/wcslen.c:222: Warning: locals {x} escaping the scope of a block of escaping through s [eva] tests/builtins/wcslen.c:225: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:225: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:226: assertion got status valid. [eva] tests/builtins/wcslen.c:228: Call to builtin wcslen [eva] tests/builtins/wcslen.c:228: function wcslen: precondition 'valid_string_s' got status valid. [eva] tests/builtins/wcslen.c:229: assertion got status valid. [eva] Recording results for escaping [eva] Done for function escaping [eva] computing for function big_array <- main. Called from tests/builtins/wcslen.c:348. [eva:alarm] tests/builtins/wcslen.c:287: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/wcslen.c:291: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/builtins/wcslen.c:294: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/wcslen.c:301: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:301: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:302: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:302: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:303: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:303: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:304: Frama_C_show_each: {0}, {0}, {0} [eva] tests/builtins/wcslen.c:306: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:306: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:307: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:307: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:308: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:308: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] tests/builtins/wcslen.c:309: Frama_C_show_each: {0}, {0}, {0} [eva] Recording results for big_array [eva] Done for function big_array [eva] computing for function negative_offsets <- main. Called from tests/builtins/wcslen.c:349. [eva] tests/builtins/wcslen.c:314: starting to merge loop iterations [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/wcslen.c:318. [eva] tests/builtins/wcslen.c:318: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:319: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:319: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/wcslen.c:322. [eva] tests/builtins/wcslen.c:322: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:323: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:323: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/wcslen.c:325. [eva] tests/builtins/wcslen.c:325: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:326: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:326: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/wcslen.c:327. [eva] tests/builtins/wcslen.c:327: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:328: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:328: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/wcslen.c:329. [eva] tests/builtins/wcslen.c:329: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:330: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:330: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] computing for function Frama_C_interval <- negative_offsets <- main. Called from tests/builtins/wcslen.c:331. [eva] tests/builtins/wcslen.c:331: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/builtins/wcslen.c:333: Call to builtin wcslen [eva:alarm] tests/builtins/wcslen.c:333: Warning: function wcslen: precondition 'valid_string_s' got status unknown. [eva] Recording results for negative_offsets [eva] Done for function negative_offsets [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function init_array_nondet: from ∈ {-1} to ∈ {-1} val1 ∈ {-1} val2 ∈ {-1} val ∈ {0; 1; 2; 3; 4} a[0..99] ∈ {0; 16843009; 33686018} a[0..39] ∈ {16843009; 33686018} [40..49] ∈ UNINITIALIZED [50..94] ∈ {50529027; 67372036} or UNINITIALIZED [95..99] ∈ UNINITIALIZED [eva:final-states] Values at end of function big_array: t[0..999999] ∈ {1162886966899900416} or UNINITIALIZED u[0..199] ∈ {1162886966899900416} or UNINITIALIZED r[0..200] ∈ {1162886966899900416} or UNINITIALIZED p ∈ {{ &r + [0..1600],0%8 }} len_u ∈ {0} len_r ∈ {0} len_t ∈ {0} [eva:final-states] Values at end of function bitfields: s.a ∈ {3} .b ∈ {1} .c ∈ {7} .[bits 127 to 127] ∈ UNINITIALIZED p ∈ {{ (wchar_t *)&s }} [eva:final-states] Values at end of function bitfields2: s.a ∈ {3} .b ∈ {1} .c ∈ {458752} .[bits 159 to 159] ∈ UNINITIALIZED p ∈ {{ (wchar_t *)&s }} z1 ∈ {2} [eva:final-states] Values at end of function escaping: s[0] ∈ {0} [1..3] ∈ ESCAPINGADDR z1 ∈ {0} z2 ∈ {0} [eva:final-states] Values at end of function misc: Frama_C_entropy_source ∈ [--..--] loc_str ∈ {{ L"Bonjour Monde\n" }} loc_char_array[0..2] ∈ UNINITIALIZED [3] ∈ {0} [4] ∈ UNINITIALIZED sz1 ∈ {12; 14} sz2 ∈ {0} sz3 ∈ [0..13] sz4 ∈ {3} sz5 ∈ {2; 3; 4} sz6 ∈ {1; 2; 3} sz7 ∈ {0; 1; 2; 3; 4} or UNINITIALIZED sz8 ∈ {1} x[0] ∈ {0} [1] ∈ {239} [2] ∈ {205} [3] ∈ {171} z[0] ∈ {0} [1] ∈ {86} [2] ∈ {35} [3] ∈ {18} i ∈ [0..11] str ∈ {{ L"" ; L"a" ; L"aa" ; L"aaa" ; L"aaaa" ; L"aaaaa" ; L"aaaaaa" ; L"aaaaaaaaa" ; L"aaaaaaaaaa" ; L"aaaaaaaaaaa" ; L"aaaaaaaaaaaa" ; L"aaaaaaaaaaaaa" }} s1 ∈ {{ L"mno\000pqr" ; L"MNOP\000QRS" }} s2 ∈ {{ L"efg" + {4; 8} ; L"EFGH" + {4; 8} }} maybe_init[0] ∈ {65} or UNINITIALIZED [1] ∈ {0} [eva:final-states] Values at end of function negative_offsets: Frama_C_entropy_source ∈ [--..--] buf[0..88] ∈ {65} or UNINITIALIZED [89..98] ∈ {0; 65} or UNINITIALIZED [99] ∈ {0} len1 ∈ UNINITIALIZED len2 ∈ UNINITIALIZED len3 ∈ {99} len4 ∈ {97; 98; 99} len5 ∈ {92; 93; 94; 95; 96; 97; 98; 99} len6 ∈ {99} offset3 ∈ {-1; 0} offset4 ∈ {-1; 0; 1; 2} offset5 ∈ [-4..7] offset6 ∈ [-10..0] p ∈ {{ &buf + [-40..0],0%4 }} [eva:final-states] Values at end of function small_sets: s ∈ {{ L"b\000c" }} p ∈ {{ L"b\000c" + {0; 8} }} z1 ∈ {2; 3} z2 ∈ {0; 2} z3 ∈ {0} z4 ∈ {1} t[0..1] ∈ {0; 1} [2..3] ∈ {1} z5 ∈ {0; 1} [eva:final-states] Values at end of function wcslen_initialization: empty_or_uninitialized[0] ∈ {0} or UNINITIALIZED z1 ∈ {0} s[0] ∈ {1} or UNINITIALIZED [1] ∈ {0} p ∈ {{ &t[0] }} z2 ∈ {1} t[0..1] ∈ {10} [2] ∈ {10} or UNINITIALIZED [3] ∈ {0} z3 ∈ {3} [eva:final-states] Values at end of function wcslen_large: Frama_C_entropy_source ∈ [--..--] a[0..99] ∈ {0; 33686018} offset ∈ [50..70] z1 ∈ [0..54] z2 ∈ [3..15] z3 ∈ [1..15] z4 ∈ [0..12] z5 ∈ [0..49] [eva:final-states] Values at end of function wcslen_large_uninit: Frama_C_entropy_source ∈ [--..--] a[0..19] ∈ {16843009; 33686018} [20] ∈ {0} [21..39] ∈ {16843009; 33686018} [40..49] ∈ UNINITIALIZED [50..74] ∈ {50529027; 67372036} [75] ∈ {0} [76..94] ∈ {50529027; 67372036} [95..97] ∈ UNINITIALIZED [98] ∈ {0} [99] ∈ UNINITIALIZED offset ∈ {0} z1 ∈ [0..17] z2 ∈ [0..12] z3 ∈ {20; 21; 22; 23; 24; 25} [eva:final-states] Values at end of function zero_termination: empty_or_non_terminated[0] ∈ {0; 100} z1 ∈ {0} non_terminated[0] ∈ {88} non_terminated2[0] ∈ {76} [1] ∈ {0} [2] ∈ {28} [3] ∈ {14} p ∈ {{ &non_terminated2{[2], [3]} }} [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] __retres ∈ {0} [from] Computing for function init_array_nondet [from] Computing for function memset <-init_array_nondet [from] Done for function memset [from] Done for function init_array_nondet [from] Computing for function big_array [from] Computing for function wcslen <-big_array [from] Done for function wcslen [from] Done for function big_array [from] Computing for function bitfields [from] Done for function bitfields [from] Computing for function bitfields2 [from] Done for function bitfields2 [from] Computing for function escaping [from] Done for function escaping [from] Computing for function misc [from] Computing for function Frama_C_interval <-misc [from] Done for function Frama_C_interval [from] Done for function misc [from] Computing for function negative_offsets [from] Done for function negative_offsets [from] Computing for function small_sets [from] Done for function small_sets [from] Computing for function wcslen_initialization [from] Done for function wcslen_initialization [from] Computing for function wcslen_large [from] Done for function wcslen_large [from] Computing for function wcslen_large_uninit [from] Done for function wcslen_large_uninit [from] Computing for function zero_termination [from] Done for function zero_termination [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function memset: a[0..99] FROM c (and SELF) a[0..99] FROM c (and SELF) \result FROM s [from] Function init_array_nondet: a[0..99] FROM val1; val2; nondet (and SELF) a[0..99] FROM val1; val2; nondet (and SELF) [from] Function wcslen: \result FROM unterminated_string[0..11]; t[0..3]; empty_or_non_terminated[0]; non_terminated[0]; non_terminated2[2..3]; empty_or_uninitialized[0]; uninitialized[0]; s[0..1]; t[0..3]; s; s; a[3..99]; a[3..99]; s[0..3]; loc_char_array[0..4]; x[0..3]; maybe_init[0..1]; t[0..999999]; u[0..199]; r[0..200]; buf[0..99]; L"Hello World\n"[bits 0 to 415]; L"abc\000\000\000abc"[bits 0 to 319]; L""; L"a"[bits 0 to 63]; L"aa"[bits 0 to 95]; L"aaa"[bits 0 to 127]; L"aaaa"[bits 0 to 159]; L"aaaaa"[bits 0 to 191]; L"aaaaaa"[bits 0 to 223]; L"aaaaaaaaa"[bits 0 to 319]; L"aaaaaaaaaa"[bits 0 to 351]; L"aaaaaaaaaaa"[bits 0 to 383]; L"aaaaaaaaaaaa"[bits 0 to 415]; L"aaaaaaaaaaaaa"[bits 0 to 447]; L"abc"[bits 0 to 127]; L"\000bc"[bits 0 to 127]; L""; L"b\000c"[bits 0 to 127]; L"Bonjour Monde\n"[bits 0 to 479]; L"abc"[bits 0 to 127]; L"ABCD"[bits 0 to 159]; L"efg"[bits 32 to 127]; L"EFGH"[bits 32 to 159]; L"mno\000pqr"[bits 0 to 255]; L"MNOP\000QRS"[bits 0 to 287] [from] Function big_array: NO EFFECTS [from] Function bitfields: NO EFFECTS [from] Function bitfields2: NO EFFECTS [from] Function escaping: NO EFFECTS [from] Function misc: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function negative_offsets: Frama_C_entropy_source FROM Frama_C_entropy_source; nondet (and SELF) [from] Function small_sets: NO EFFECTS [from] Function wcslen_initialization: NO EFFECTS [from] Function wcslen_large: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function wcslen_large_uninit: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function zero_termination: NO EFFECTS [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source; nondet (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function init_array_nondet: from; to; val1; val2; val; tmp; a[0..99]; a{[0..39]; [50..94]} [inout] Inputs for function init_array_nondet: nondet [inout] Out (internal) for function big_array: t[0..999999]; u[0..199]; r[0..200]; p; len_u; len_r; len_t [inout] Inputs for function big_array: nondet [inout] Out (internal) for function bitfields: s{.a; .b; .c}; p [inout] Inputs for function bitfields: nondet [inout] Out (internal) for function bitfields2: s{.a; .b; .c}; p; z1; tmp [inout] Inputs for function bitfields2: \nothing [inout] Out (internal) for function escaping: s[0..3]; z1; tmp; z2; tmp_0 [inout] Inputs for function escaping: nondet [inout] Out (internal) for function misc: Frama_C_entropy_source; loc_str; loc_char_array[3]; sz1; sz2; sz3; sz4; sz5; sz6; sz7; sz8; x[0..3]; z[0..3]; i; str; s1; tmp; s2; tmp_0; j; maybe_init[0..1] [inout] Inputs for function misc: Frama_C_entropy_source; static_str; zero_str; tab_str[0..11]; unterminated_string[0..11]; nondet; L"Hello World\n"[bits 0 to 415]; L"abc\000\000\000abc"[bits 0 to 127]; L""; L"a"[bits 0 to 63]; L"aa"[bits 0 to 95]; L"aaa"[bits 0 to 127]; L"aaaa"[bits 0 to 159]; L"aaaaa"[bits 0 to 191]; L"aaaaaa"[bits 0 to 223]; L"aaaaaaaaa"[bits 0 to 319]; L"aaaaaaaaaa"[bits 0 to 351]; L"aaaaaaaaaaa"[bits 0 to 383]; L"aaaaaaaaaaaa"[bits 0 to 415]; L"aaaaaaaaaaaaa"[bits 0 to 447]; L"Bonjour Monde\n"[bits 0 to 479]; L"abc"[bits 0 to 127]; L"ABCD"[bits 0 to 159]; L"efg"[bits 32 to 127]; L"EFGH"[bits 32 to 159]; L"mno\000pqr"[bits 0 to 255]; L"MNOP\000QRS"[bits 0 to 287] [inout] Out (internal) for function negative_offsets: Frama_C_entropy_source; buf[0..99]; i; len1; len2; len3; len4; len5; len6; offset1; offset2; offset3; offset4; offset5; offset6; p [inout] Inputs for function negative_offsets: Frama_C_entropy_source; nondet [inout] Out (internal) for function small_sets: s; p; tmp; z1; tmp_0; z2; tmp_1; z3; tmp_2; z4; tmp_3; t[0..3]; z5; tmp_4 [inout] Inputs for function small_sets: nondet; L"abc"[bits 0 to 127]; L"\000bc"[bits 0 to 127]; L""; L"b\000c"[bits 0 to 127] [inout] Out (internal) for function wcslen_initialization: empty_or_uninitialized[0]; z1; tmp; s[0..1]; p; z2; tmp_0; t[0..3]; z3; tmp_1 [inout] Inputs for function wcslen_initialization: nondet [inout] Out (internal) for function wcslen_large: Frama_C_entropy_source; a[0..99]; offset; z1; tmp_0; z2; tmp_1; z3; tmp_2; z4; tmp_3; z5; tmp_4 [inout] Inputs for function wcslen_large: Frama_C_entropy_source; nondet [inout] Out (internal) for function wcslen_large_uninit: Frama_C_entropy_source; a{[0..39]; [50..94]; [98]}; offset; z1; tmp_0; z2; tmp_1; z3; tmp_2 [inout] Inputs for function wcslen_large_uninit: Frama_C_entropy_source; nondet [inout] Out (internal) for function zero_termination: empty_or_non_terminated[0]; z1; tmp; non_terminated[0]; non_terminated2[0..3]; p; tmp_0 [inout] Inputs for function zero_termination: nondet [inout] Out (internal) for function main: Frama_C_entropy_source; __retres [inout] Inputs for function main: Frama_C_entropy_source; static_str; zero_str; tab_str[0..11]; unterminated_string[0..11]; nondet; L"Hello World\n"[bits 0 to 415]; L"abc\000\000\000abc"[bits 0 to 127]; L""; L"a"[bits 0 to 63]; L"aa"[bits 0 to 95]; L"aaa"[bits 0 to 127]; L"aaaa"[bits 0 to 159]; L"aaaaa"[bits 0 to 191]; L"aaaaaa"[bits 0 to 223]; L"aaaaaaaaa"[bits 0 to 319]; L"aaaaaaaaaa"[bits 0 to 351]; L"aaaaaaaaaaa"[bits 0 to 383]; L"aaaaaaaaaaaa"[bits 0 to 415]; L"aaaaaaaaaaaaa"[bits 0 to 447]; L"abc"[bits 0 to 127]; L"\000bc"[bits 0 to 127]; L""; L"b\000c"[bits 0 to 127]; L"Bonjour Monde\n"[bits 0 to 479]; L"abc"[bits 0 to 127]; L"ABCD"[bits 0 to 159]; L"efg"[bits 32 to 127]; L"EFGH"[bits 32 to 159]; L"mno\000pqr"[bits 0 to 255]; L"MNOP\000QRS"[bits 0 to 287] ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/oracle/write-const.res.oracle�����������������������������������0000666�0000000�0000000�00000012575�13571573400�021722� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/builtins/write-const.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] a ∈ {-1} b ∈ {0} [eva] computing for function main0 <- main. Called from tests/builtins/write-const.c:44. [eva] tests/builtins/write-const.c:18: Call to builtin memcpy [eva:alarm] tests/builtins/write-const.c:18: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva] tests/builtins/write-const.c:18: function memcpy: precondition 'valid_src' got status valid. [eva] tests/builtins/write-const.c:18: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] tests/builtins/write-const.c:19: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} v ∈ [--..--] a ∈ {-1} b ∈ {1} p ∈ {{ &a ; &b }} tmp ∈ {{ &a ; &b }} x ∈ {1} ==END OF DUMP== [eva] Recording results for main0 [from] Computing for function main0 [from] Done for function main0 [eva] Done for function main0 [eva] computing for function main1 <- main. Called from tests/builtins/write-const.c:45. [eva] tests/builtins/write-const.c:25: Call to builtin memset [eva:alarm] tests/builtins/write-const.c:25: Warning: function memset: precondition 'valid_s' got status unknown. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] tests/builtins/write-const.c:26: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} v ∈ [--..--] a ∈ {-1} b ∈ {84215045} p ∈ {{ &a ; &b }} tmp ∈ {{ &a ; &b }} x ∈ {1} ==END OF DUMP== [eva] Recording results for main1 [from] Computing for function main1 [from] Done for function main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/builtins/write-const.c:46. [eva:alarm] tests/builtins/write-const.c:32: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/write-const.c:33: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} v ∈ [--..--] a ∈ {-1} b ∈ {1} p ∈ {{ &b }} tmp ∈ {{ &a ; &b }} ==END OF DUMP== [eva] Recording results for main2 [from] Computing for function main2 [from] Done for function main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/builtins/write-const.c:47. [eva:alarm] tests/builtins/write-const.c:39: Warning: out of bounds write. assert \valid(p); [eva] tests/builtins/write-const.c:40: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_strtok_ptr ∈ {0} __fc_strerror[0..63] ∈ [--..--] __fc_p_strerror ∈ {{ &__fc_strerror[0] }} __fc_strsignal[0..63] ∈ [--..--] __fc_p_strsignal ∈ {{ &__fc_strsignal[0] }} v ∈ [--..--] a ∈ {-1} b ∈ {2} p ∈ {{ &b }} tmp ∈ {{ &a ; &b }} y ∈ {2} ==END OF DUMP== [eva] Recording results for main3 [from] Computing for function main3 [from] Done for function main3 [eva] Done for function main3 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: b ∈ {1} p ∈ {{ &b }} [eva:final-states] Values at end of function main3: b ∈ {2} p ∈ {{ &b }} y ∈ {2} [eva:final-states] Values at end of function main0: b ∈ {1} p ∈ {{ &a ; &b }} x ∈ {1} [eva:final-states] Values at end of function main1: b ∈ {84215045} p ∈ {{ &a ; &b }} x ∈ {1} [eva:final-states] Values at end of function main: b ∈ {2} [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to Frama_C_dump_each at tests/builtins/write-const.c:33 (by main2): \result FROM \nothing [from] call to Frama_C_dump_each at tests/builtins/write-const.c:40 (by main3): \result FROM \nothing [from] call to memcpy at tests/builtins/write-const.c:18 (by main0): b FROM x \result FROM dest [from] call to Frama_C_dump_each at tests/builtins/write-const.c:19 (by main0): \result FROM \nothing [from] call to memset at tests/builtins/write-const.c:25 (by main1): b FROM c \result FROM s [from] call to Frama_C_dump_each at tests/builtins/write-const.c:26 (by main1): \result FROM \nothing [from] call to main0 at tests/builtins/write-const.c:44 (by main): b FROM \nothing [from] call to main1 at tests/builtins/write-const.c:45 (by main): b FROM \nothing [from] call to main2 at tests/builtins/write-const.c:46 (by main): b FROM v [from] call to main3 at tests/builtins/write-const.c:47 (by main): b FROM v [from] entry point: b FROM v [from] ====== END OF CALLWISE DEPENDENCIES ====== �����������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/precise_memset.c������������������������������������������������0000666�0000000�0000000�00000002643�13571573400�017363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #" -eva -calldeps " */ #include "string.h" volatile v; int x; short t[50]; int u[12]; float f, fnan; double d, dnan; struct s { short s; int i; char c; }; struct s w1[4]; struct s w2[4]; struct _bitf { int i1 : 3; unsigned int i2 : 3; char i3; unsigned int i4: 7; unsigned int i5: 8; char i6; signed int i7: 1; unsigned int i8: 1; signed int i9: 1; signed int i10: 1; unsigned int i11: 1; unsigned int i12: 1; signed int i13: 1; unsigned int i14: 1; }; struct _bitf bitf; int tone[1]; struct sub { short c1; int t[10]; char c2; }; struct sub vs; struct structstruct { struct s c3; int c4; }; struct structstruct vv; typedef unsigned char BYTE; #define SIZE 0x400 char t_b[SIZE]; short t_s[SIZE]; void main() { memset (&x, 0x2, sizeof(x)); memset (&t, 0x3, sizeof(t)); memset (&u, 154, sizeof(u)); memset (&f, 0x2, sizeof(float)); memset (&fnan, 0xFF, sizeof(float)); memset (&d, 0x2, sizeof(double)); memset (&dnan, 0xFF, sizeof(double)); memset (&w1, 0x2, sizeof(w1)); memset (&bitf, 126, sizeof(bitf)); memset (&tone, 0x6, sizeof(tone)); int n = v; //@ assert 1 <= n <= 8; memset (&w2, n, sizeof(w2)); memset(&vs, 0x04, sizeof(short)); memset(vs.t, 0x02, sizeof(vs.t)); memset(&vv, 0x06, sizeof(short)); memset(&t[15], 0x07, 20*sizeof(short)); memset(t_b, 0x05, sizeof(t_b)); memset(t_s, 0x13, sizeof(t_s)); } ���������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/realloc.c�������������������������������������������������������0000666�0000000�0000000�00000006671�13571573400�016005� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: +"-slevel 10 -eva-builtin malloc:Frama_C_malloc_fresh -eva-malloc-functions malloc,realloc -eva-warn-copy-indeterminate @all" */ #include <stdlib.h> #include "__fc_builtin.h" /*@ assigns ((char*)\result)[0..s-1] \from ((char*)p)[0..s-1]; */ void *Frama_C_realloc(void *p, size_t s); void main1(){ int *p = malloc(sizeof(int)); *p = 17; int *pp = p; Frama_C_dump_each(); int *q = realloc(p, 2 * sizeof(int)); Frama_C_dump_each(); free (q); } void main2() { int x=Frama_C_interval(3,4); int *r = (int *) malloc(x*sizeof(int)); for (int i=0;i<x;i++){r[i]=6;} //@ slevel merge; int * s= realloc(r,6*sizeof(int)); Frama_C_dump_each(); free(s); } void main3() { int *q = (int *) malloc(5*sizeof(int)); for (int i=0;i<5;i++){q[i]=5;} int *r = (int *) malloc(6*sizeof(int)); for (int i=0;i<6;i++){r[i]=6;} int *p; int x=Frama_C_interval(0,1); if (x != 0){p=r;}else{p=q;} //@ slevel merge; Frama_C_dump_each(); int * s=(int *) realloc(p,7*sizeof(int)); Frama_C_dump_each(); free(q); free (r); free (s); } void main4() { int sizep = Frama_C_interval(2,10); int sizeq = Frama_C_interval(0,10); int *p = malloc(sizep*sizeof(int)); int *q = malloc(sizeq*sizeof(int)); for (int i = 0; i < 10; i++) { p[i] = i; q[i] = i; } Frama_C_dump_each(); // p[..] and q[..] are fully initialized: if the cell is valid, // its value has been written (but validity alarms have been emitted) // The example is a bit simplistic though, because only traces with // a validity of 10 are possible here. int *rp = realloc(p, 15*sizeof(int)); int *rq = realloc(q, 8*sizeof(int)); Frama_C_dump_each(); // rp and rq are partially initialized: if size is e.g. 4, realloc can copy // only the first 4 ints, the remainder is left unchanged free(rp); free(rq); } void main5() { int *p = malloc(sizeof(int)); *p = 1; int c = Frama_C_interval(0, 1); int *q; if (c) { q = p; } else { q = NULL; } //@ slevel merge; Frama_C_dump_each(); int *r = realloc(q, 2*sizeof(int)); Frama_C_dump_each(); free(p); free(r); } void main6() { int c = Frama_C_interval(0, 10); int *m = malloc(sizeof(int) * 2); if (c) { int x = 1; int *p; if (c == 2) p = m+1; else p = &x; //@ slevel merge; Frama_C_show_each(p); int *q = realloc(p, 2*sizeof(int)); // Always invalid, non-malloced vars //@ assert UNREACHED: \false; } free(m); } void main7() { int **p = malloc(sizeof(int *)); int **q; { int x; *p = &x; q = realloc(p, 2 * sizeof(int *)); Frama_C_dump_each(); } Frama_C_dump_each(); // &x must no appear in q[..] free(q); } void main8() { int *p = malloc(sizeof(int) * 2); p[0] = 1; p[1] = 2; int *q = realloc(p, 0); Frama_C_dump_each(); free (q); } void main9() { int *p = malloc(sizeof(int) * 2); p[0] = 1; p[1] = 2; int *q = realloc(p, 1); // Size reduction Frama_C_dump_each(); free (q); } volatile v; void f(int x) { Frama_C_show_each(x); } void main10() { int *p = malloc(sizeof(int)); int *q; *p = 4; while (v) { q = p; p = realloc(p, 2*sizeof(int)); // the same base is reallocated. Nothing is dangling except q *p = *p; // always succeeds (provided realloc does not return NULL) Frama_C_show_each_main10(*p); Frama_C_dump_each(); } } void main() { main1(); main2(); main3(); main4(); main5(); main6(); main7(); main8(); main9(); main10(); } �����������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/realloc2.c������������������������������������������������������0000666�0000000�0000000�00000010651�13571573400�016060� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #"-eva-builtin realloc:Frama_C_realloc -eva-mlevel 0 -inout-callwise -inout-no-print " */ #include <stdlib.h> volatile int nondet; void fill(char *b, int n) { //@slevel 10000; for (int i = 0; i < n; i++) { b[i] = i; } //@slevel default; ; } void fill2(char *b, int n) { //@slevel 10000; for (int i = 0; i < n; i++) { b[i] = 10*i; } //@slevel default; ; } void test_exact_null() { char *p = realloc(NULL, 10); if (p) fill(p, 10); } void test_exact_null_free() { char *p = realloc(NULL, 0); } void test_exact_nonnull_expand() { void *p1 = malloc(5); if (p1) fill(p1, 5); char *p2 = realloc(p1, 10); if (p2) fill(p2, 10); else if (p1) fill(p1, 5); // realloc failed - p1 should not have changed } void test_exact_nonnull_shrink() { void *p1 = malloc(5); if (p1) fill(p1, 5); char *p2 = realloc(p1, 2); if (p2) fill(p2, 2); } void test_exact_nonnull_free() { void *p1 = malloc(5); if (p1) fill(p1, 5); char *p2 = realloc(p1, 0); } void test_maybe_nonnull() { void *p1 = nondet ? NULL : malloc(5); char *p2 = realloc(p1, 2); if (p2) fill(p2, 2); } void test_same_size() { void *p1 = malloc(5); if (p1) fill(p1, 5); char *p2 = realloc(p1, 5); if (p2) { *p2 = 0; } } void test_imprecise_size() { size_t s = nondet ? 1 : 2; char *p = realloc(NULL, s); if (p) fill(p, s); } void test_imprecise_size_but_precise_fill() { size_t s = nondet ? 1 : 2; char *p = realloc(NULL, s); if (p) fill(p, 1); } void test_imprecise_size_free() { void *p1 = malloc(5); if (p1) fill(p1, 5); size_t s = nondet ? 0 : 2; char *p2 = realloc(p1, s); if (p2) fill(p2, s); } void test_imprecise_both() { void *p1 = nondet ? NULL : malloc(5); size_t s = nondet ? 0 : 2; char *p2 = realloc(p1, s); if (p2) fill(p2, s); } void test_possibly_invalid_realloc() { char *p1 = malloc(5); if (!p1) return; int offset = nondet ? 0 : (nondet ? 10 : 20); char *p2 = realloc(p1 + offset, 2); if (p2) fill(p2, 2); } void test_invalid_realloc() { char *p1 = malloc(5); if (!p1) return; char *p2 = realloc(p1+1, 2); if (p2) fill(p2, 2); } void test_invalid_realloc2() { char *p = realloc((void*)100, 2); if (p) fill(p, 2); } void test_invalid_realloc3() { char *p1 = malloc(5); if (!p1) return; int offset = nondet ? 10 : (nondet ? 20 : 30); char *p2 = realloc(p1 + offset, 2); if (p2) fill(p2, 2); } void test_realloc_sequence() { void *p1 = malloc(2); char *p2 = realloc(p1, 3); char *p3 = realloc(p2, 5); if (p3) fill(p3, 5); } void test_realloc_loop() { void *p1 = malloc(10); if (!p1) return; char *p2 = p1; if (p2) fill(p2, 5); else return; //@ slevel 32; for (int i = 0; i < 5; i++) { char *p3 = realloc(p2, 10+5*i); if (!p3) { /* could not reallocate */ fill(p2, 10); // checks that the previous pointer is still valid } else { fill(p3+10+5*(i-1), 5); p2 = p3; } } //@ slevel default; ; } void test_realloc_multiple_bases() { void *p1 = malloc(2); char *p2; if (nondet) { p2 = malloc(3); } else { p2 = realloc(p1, 3); } char *p3 = realloc(p2, 5); if (p3) fill(p3, 5); } void test_realloc_multiple_bases2() { void *p1 = malloc(4); if (!p1) return; fill(p1, 4); char *p2 = nondet ? realloc(p1, 6) : malloc(2); if (!p2) return; fill2(p2, 2); char *p3 = realloc(p2, 10); if (!p3) return; char *p4 = realloc(p3, 5); if (!p4) return; fill(p4, 5); char *p5 = malloc(6); if (!p5) return; fill2(p5, 3); char *p6 = realloc(nondet ? p4 : p5, 4); if (!p6) return; fill(p6, 4); } void test_realloc_multiple_bases_loop() { size_t size = 10; char *p = malloc(size); for (int i = 0; i < 10; i++) { size_t new_size = nondet ? size : 10+2*i; p = nondet ? realloc(p, new_size) : p; if (!p) return; fill(p, new_size); } } int main(){ test_exact_null(); test_exact_null_free(); test_exact_nonnull_expand(); test_exact_nonnull_shrink(); test_exact_nonnull_free(); test_maybe_nonnull(); test_same_size(); test_imprecise_size(); test_imprecise_size_but_precise_fill(); test_imprecise_size_free(); test_imprecise_both(); test_possibly_invalid_realloc(); if (nondet) test_invalid_realloc(); if (nondet) test_invalid_realloc2(); if (nondet) test_invalid_realloc3(); test_realloc_sequence(); test_realloc_loop(); test_realloc_multiple_bases(); test_realloc_multiple_bases2(); test_realloc_multiple_bases_loop(); return 0; } ���������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/realloc_multiple.c����������������������������������������������0000666�0000000�0000000�00000003205�13571573400�017706� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: +"-slevel 10 -eva-builtin malloc:Frama_C_malloc_fresh,realloc:Frama_C_realloc_multiple -eva-malloc-functions malloc,realloc" STDOPT: +"-slevel 10 -eva-builtin malloc:Frama_C_malloc_fresh,realloc:Frama_C_realloc_multiple -eva-malloc-functions malloc,realloc -eva-alloc-returns-null" */ #include <stdlib.h> #include "__fc_builtin.h" void main1() { int *q = (int *) malloc(5*sizeof(int)); for (int i=0;i<5;i++){q[i]=5;} int *r = (int *) malloc(6*sizeof(int)); for (int i=0;i<6;i++){r[i]=6;} int *p; int x=Frama_C_interval(0,1); if (x != 0){p=r;}else{p=q;} //@ slevel merge; Frama_C_dump_each(); int * s=(int *) realloc(p,7*sizeof(int)); Frama_C_dump_each(); free (s); } void main2() { int *q = (int *) malloc(5*sizeof(int)); for (int i=0;i<5;i++){q[i]=7;} int *r = (int *) malloc(6*sizeof(int)); for (int i=0;i<6;i++){r[i]=8;} int *p; int x=Frama_C_interval(0,2); if (x != 0){p=r;}else{p=q;} if (x == 2) p = NULL; //@ slevel merge; Frama_C_dump_each(); int * s=(int *) realloc(p,7*sizeof(int)); Frama_C_dump_each(); free (s); } void main3() { int **p = malloc(sizeof(int *)); int **q = malloc(sizeof(int *)); int **r, **s; { int x, y; *p = &x; *q = &y; int c = Frama_C_interval (0, 2); if (c == 0) r = NULL; else if (c == 1) r = p; else r = q; //@ slevel merge; Frama_C_dump_each(); s = realloc(r, 2 * sizeof(int *)); **s = 17; Frama_C_dump_each(); } Frama_C_dump_each(); // &x must no appear in q[..] free(q); } void main(int v) { if (v == 1) main1(); else if (v == 2) main2(); else if (v == 3) main3(); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/str_allocated.c�������������������������������������������������0000666�0000000�0000000�00000000533�13571573400�017173� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* */ #include <string.h> #include <stdlib.h> volatile int nondet; void memchr_bug() { char *b; int i; for (i = 0; i < 2; i++) { b = malloc(i); } memchr(b, 1, 1); // Results in Bottom, but should not result in // degeneration of the analysis } int main() { if (nondet) memchr_bug(); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/strchr.c��������������������������������������������������������0000666�0000000�0000000�00000041571�13571573400�015667� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include "__fc_builtin.h" #include "string.h" // NOTE: all unnamed assertions should be valid. // Imprecise results should be defined using named // assertions placed after the less restrictive ones, // so that in the final output the following sentence // never arises: // Assertion got status unknown. // Only named assertions may remain unknown, e.g.: // Assertion 'refined' got status unknown. static volatile int nondet; #define assert_bottom(exp,id) if (nondet) { exp; Frama_C_show_each_unreachable_ ## id(); } // Definitions for C++ oracle checking typedef int Ival; typedef int RES; #define CHAR char #define NONDET(a,b) (nondet ? (a) : (b)) #define NONDET_STR(a,b) NONDET((a),(b)) #define NONDET_STR2(a,b) NONDET((a),(b)) #define IF_NONDET(var,val) if (nondet) var = val #define RANGE(from,to) Frama_C_interval(from,to) #define CHAR_ARRAY(var,n) char var[n] #define CHAR_PTR(var) char *var #define STRING(var,str) var = str; #define TSZ 12 const char* tab_str[TSZ] = { "" , // 0 "a", // 1 "aa" , // 2 "aaa" , // 3 "aaaa" , // 4 "aaaaa" , // 5 "aaaaaa" , // 6 /* hole */ "aaaaaaaaa" , // 9 "aaaaaaaaaa" , "aaaaaaaaaaa", "aaaaaaaaaaaa" , "aaaaaaaaaaaaa" }; // 13 #define STRCHR_no_decl(lv_var, _s, _offs, _c) \ do { \ char *_ss = strchr(_s+_offs,_c); \ int _res; \ if (_ss == 0) { \ _res = -1; \ } else { \ _res = _ss - _s; \ } \ Frama_C_show_each_mystrchr(_res); \ lv_var = _res; \ } while (0) \ #define STRCHR(lv_type, lv_var, _s, _offs, _c) \ lv_type lv_var; \ STRCHR_no_decl(lv_var, _s, _offs, _c) \ #define STRCHR_bottom(s, offs, c) assert_bottom(strchr(s+offs,c), s) #define STRCHR2(lv_type, lv_var, _base, _offs1, _offs2, _c) \ lv_type lv_var; \ do { \ const char *_p = ((const char *)_base)+NONDET(_offs1, _offs2); \ char *_s = strchr(_p,_c); \ int _res; \ if (_s == 0) { \ _res = -1; \ } else { \ _res = _s - (char*)_base; \ } \ Frama_C_show_each_mystrchr2(_res); \ lv_var = _res; \ } while (0) \ //DELPHIC_TEST void strchr_small_sets() { CHAR c = 0; CHAR_PTR(s); STRING(s,"abc"); Ival o = NONDET(0, 1); STRCHR(RES, z1, s, o, c); //@ assert (z1 == 3); STRING(s,"\0bc"); o = NONDET(0,1); STRCHR(RES, z2, s, o, c); //@ assert (z2 == 0 || z2 == 3); STRING(s,""); STRCHR(RES, z3, s, 0, c); //@ assert (z3 == 0); STRING(s,"b\0c"); o = NONDET(0,2); STRCHR(RES, z4, s, o, c); //@ assert (z4 == 1 || z4 == 3); CHAR_ARRAY(t, 4); t[0] = t[1] = NONDET(0, 1); t[2] = t[3] = 1; STRCHR(RES, z5, t, 0, c); // warning //@ assert (z5 == -1 || z5 == 0 || z5 == 1); } //DELPHIC_TEST void strchr_zero_termination() { CHAR c = 0; CHAR_ARRAY(empty_or_non_terminated, 1); empty_or_non_terminated[0] = NONDET(0, 100); STRCHR(RES, z1, empty_or_non_terminated, 0, c); // alarm //@ assert (z1 == -1 || z1 == 0); CHAR_ARRAY(non_terminated, 1); non_terminated[0] = 'X'; STRCHR_bottom(non_terminated, 0, c); CHAR_ARRAY(non_terminated2, 4); non_terminated2[0] = 76; non_terminated2[1] = 0; non_terminated2[2] = 28; non_terminated2[3] = 14; Ival o = NONDET(2, 3); STRCHR_bottom(non_terminated2, 2, c); } //DELPHIC_TEST void strchr_initialization() { CHAR c = 0; CHAR_ARRAY(empty_or_uninitialized, 1); IF_NONDET(empty_or_uninitialized[0], 0); STRCHR(RES, z1, empty_or_uninitialized, 0, c); // alarm //@ assert (z1 == 0); CHAR_ARRAY(uninitialized, 1); STRCHR_bottom(uninitialized, 0, c); CHAR_ARRAY(s, 2); IF_NONDET(s[0], 1); s[1] = 0; STRCHR(RES, z2, s, 0, c); // alarm //@ assert (z2 == 1); CHAR_ARRAY(t,4); t[0] = t[1] = 10; IF_NONDET(t[2], 10); t[3] = 0; STRCHR(RES, z3, t, 0, c); // alarm //@ assert (z3 == 3); } typedef struct { int a:8; int b:8; int c:17; } st; void strchr_bitfields() { CHAR c = 0; st s; s.a = 3; s.b = 1; s.c = 7; CHAR_PTR(p); p = &s; assert_bottom(strchr(p, c),bitfields); } typedef struct { int a:4; int b:4; int c:17; } st2; void strchr_bitfields2() { CHAR c = 0; st2 s; s.a = 3; s.b = 1; s.c = 7; CHAR_PTR(p); p = &s; STRCHR(RES, z1, p, 0, c); //@assert (z1 == 2); } void init_array_nondet(void *a, int from, int to, int val1, int val2) { int val = NONDET(val1, val2); memset(((char*)a) + from, val, to-from+1); from = to = val1 = val2 = -1; // reset to minimize oracle changes } //DELPHIC_TEST void strchr_large() { CHAR c = 0; CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 99, 1, 2); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); STRCHR(RES, z1, a, offset, c); //@ assert (z1 == 20 || z1 == 75); offset = RANGE(5, 17); STRCHR(RES, z2, a, offset, c); //@ assert (z2 >= -1 && z2 <= 20); //@ assert refined: (z2 == 20); offset = RANGE(60, 74); STRCHR(RES, z3, a, offset, c); //@ assert (z3 >= -1 && z3 <= 75); //@ assert refined: (z3 == 75); offset = RANGE(63, 80); STRCHR(RES, z4, a, offset, c); // alarm //@ assert (z4 >= -1 && z4 <= 79); //@ assert refined: (z4 == 75); init_array_nondet(a, 0, 99, 0, 2); offset = RANGE(50, 70); STRCHR(RES, z5, a, offset, c); // alarm //@ assert (z5 >= -1 && z5 <= 99); } //DELPHIC_TEST void strchr_large_uninit() { CHAR c = 0; CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 39, 1, 2); init_array_nondet(a, 50, 94, 3, 4); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); STRCHR(RES, z1, a, offset, c); // alarm: Uninit //@ assert (z1 >= -1 && z1 <= 29); //@ assert refined: (z1 == 20); a[98] = 0; offset = RANGE(63, 80); STRCHR(RES, z2, a, offset, c); // alarm: Uninit //@ assert (z2 >= -1 && z2 <= 79); //@ assert refined: (z2 == 75); offset = RANGE(45, 55); STRCHR(RES, z3, a, offset, c); // alarm: Uninit //@ assert (z3 >= -1 && z3 <= 75); //@ assert refined: (z3 == 75); offset = 0; // avoid oracle diffs when changed } void strchr_escaping() { CHAR c = 0; CHAR_ARRAY(s,4); { int x; *((int *)s) = (int) &x; } IF_NONDET(s[0], 0); STRCHR(RES, z1, s, 0, c); // alarm //@ assert (z1 == 0); s[0] = 0; STRCHR(RES, z2, s, 0, c); // no alarm //@ assert (z2 == 0); } void strchr_misc_array() { CHAR c = 0; Ival i = RANGE(0,TSZ-1); STRCHR(RES, sz3, tab_str[i], 0, c); //@ assert (sz3 >= 0 && sz3 <= 13); } //DELPHIC_TEST void strchr_misc() { CHAR c = 0; static CHAR_PTR(static_str); STRING(static_str, "Hello World\n"); static CHAR_PTR(zero_str); STRING(zero_str, "abc\0\0\0abc"); CHAR_PTR(loc_str); STRING(loc_str, "Bonjour Monde\n"); CHAR_ARRAY(loc_char_array, 5); int x = 0xabcdef00; CHAR_PTR(str); CHAR_ARRAY(unterminated_string, 12); unterminated_string[0] = 'u'; unterminated_string[1] = 'n'; unterminated_string[2] = 't'; unterminated_string[3] = 'e'; unterminated_string[4] = 'r'; unterminated_string[5] = 'm'; unterminated_string[6] = 'i'; unterminated_string[7] = 'n'; unterminated_string[8] = 'a'; unterminated_string[9] = 't'; unterminated_string[10] = 'e'; unterminated_string[11] = 'd'; STRCHR_bottom(unterminated_string, 0, c); str = NONDET_STR2(static_str, loc_str); STRCHR(RES, sz1, str, 0, c); // false alarm (pointers from 2 bases) //@ assert(sz1 == 12 || sz1 == 14); str = &x; STRCHR2(RES, sz2, str, 0, 3, c); //@ assert(sz2 == 0); // alarm loc_char_array[3] = '\0'; STRCHR_bottom(loc_char_array, 0, c); STRCHR(RES, sz4a, zero_str, 0, c); //@ assert(sz4a == 3); STRCHR(RES, sz4b, zero_str, 4, c); //@ assert(sz4b == 4); STRCHR(RES, sz4c, zero_str, 5, c); //@ assert(sz4c == 5); STRCHR(RES, sz4d, zero_str, 6, c); //@ assert(sz4d == 9); } //DELPHIC_TEST void strchr_misc2() { CHAR c = 0; CHAR_PTR(s1); s1 = NONDET_STR("abc", "ABCD"); STRCHR2(RES, sz5, s1, 0, 1, c); //@ assert (sz5 == 3 || sz5 == 4); s1 = NONDET_STR("efg", "EFGH"); STRCHR2(RES, sz6, s1, 1, 2, c); //@ assert (sz6 == 3 || sz6 == 4); s1 = NONDET_STR("mno\0pqr", "MNOP\0QRS"); for (int j = 0; j < 8; j++) { STRCHR(RES, sz7, s1, j, c); //@ assert (sz7 == 3 || sz7 == 4 || sz7 == 7 || sz7 == 8); } CHAR_ARRAY(maybe_init, 2); maybe_init[1] = '\0'; IF_NONDET(maybe_init[0], 'A'); STRCHR(RES, sz8, maybe_init, 0, c); // alarm //@ assert(sz8 == 1); } void strchr_big_array () { CHAR c = 0; int u[200]; int r[201]; int t[1000000]; int *p; p = &u[nondet]; *p = 0x10230067; p = &r[nondet]; *p = 0x10230067; p = &t[nondet]; *p = 0x10230067; // the actual length is unsigned, but due to our representation // of NULL via -1, we actually use it as signed long len_u; long len_r; long len_t; // All strchr calls in this function emit alarms due to preconditions. // without initialization, most accesses are invalid, so the result is precise STRCHR_no_decl(len_u, (char const *)u, 0, c); // below plevel; precise STRCHR_no_decl(len_r, (char const *)r, 0, c); // above plevel; imprecise STRCHR_no_decl(len_t, (char const *)t, 0, c); // *far* above plevel Frama_C_show_each(len_u, len_r, len_t); //@ assert (len_u == 1); //@ assert (len_r == 1); //@ assert (len_t == 1); STRCHR_no_decl(len_u, (char const *)u, nondet, c); // should be precise STRCHR_no_decl(len_r, (char const *)r, nondet, c); STRCHR_no_decl(len_t, (char const *)t, nondet, c); Frama_C_show_each(len_u, len_r, len_t); //@ assert (len_u >= -1 && len_u <= 799); //@ assert (len_r >= -1 && len_r <= 803); //@ assert (len_t >= -1 && len_t <= 3999999); //@ assert refined: (len_u >= 0 && len_u <= 3); //@ assert refined: (len_r >= 0 && len_r <= 800); //@ assert refined: (len_t >= 0 && len_t <= 3999996); init_array_nondet(u, 0, sizeof(int)*200-1, 0, 1); init_array_nondet(r, 0, sizeof(int)*201-1, 0, 1); init_array_nondet(t, 0, sizeof(int)*1000000-1, 0, 1); p = &u[nondet]; *p = 0x10230067; p = &r[nondet]; *p = 0x10230067; p = &t[nondet]; *p = 0x10230067; STRCHR_no_decl(len_u, (char const *)u, 0, c); // below plevel; precise STRCHR_no_decl(len_r, (char const *)r, 0, c); // above plevel; imprecise STRCHR_no_decl(len_t, (char const *)t, 0, c); // *far* above plevel Frama_C_show_each(len_u, len_r, len_t); //@ assert (len_u >= 0 && len_u <= 799); //@ assert (len_r >= 0 && len_r <= 803); //@ assert (len_t >= 0 && len_t <= 3999999); STRCHR_no_decl(len_u, (char const *)u, nondet, c); // should be precise STRCHR_no_decl(len_r, (char const *)r, nondet, c); STRCHR_no_decl(len_t, (char const *)t, nondet, c); Frama_C_show_each(len_u, len_r, len_t); //@ assert (len_u >= -1 && len_u <= 799); //@ assert (len_r >= -1 && len_r <= 803); //@ assert (len_t >= -1 && len_t <= 3999999); //@ assert refined: (len_u >= 0 && len_u <= 799); //@ assert refined: (len_r >= 0 && len_r <= 803); //@ assert refined: (len_t >= 0 && len_t <= 3999999); } //DELPHIC_TEST void strchr_no_zero_but_ok() { CHAR c = 0; CHAR_ARRAY(s,20); s[0] = s[1] = s[2] = s[3] = s[4] = s[5] = s[6] = s[7] = s[8] = s[9] = 1; s[10] = 0; s[11] = s[12] = s[13] = 1; s[14] = s[15] = s[16] = s[17] = s[18] = s[19] = NONDET(1, 0); STRCHR(RES, z1, s, 0, c); //@assert (z1 == 10); STRCHR(RES, z2, s, 0, c); //@assert (z2 == 10); Ival offs = NONDET(1, 8); STRCHR(RES, z3, s, offs, c); //@assert (z3 == 10); offs = NONDET(7, 11); STRCHR(RES, z4, s, offs, c); // alarm //@assert (z4 >= -1 && z4 <= 19); offs = NONDET(7, 18); STRCHR(RES, z5, s, offs, c); // alarm //@assert (z5 == -1 || z5 == 10 || z5 == 18 || z5 == 19); } // In the macro below: alarm from precondition in first call to strchr #define SMALL_SETS_NO_ASSERTIONS(i, c, res) \ CHAR_ARRAY(t_ ## i, 4); \ do { \ CHAR_PTR(s); \ STRING(s,"abc"); \ Ival o = NONDET(0, 1); \ STRCHR_no_decl(res[0], s, o, c); \ STRING(s,"\0bc"); \ o = NONDET(0,1); \ STRCHR_no_decl(res[1], s, o, c); \ STRING(s,""); \ STRCHR_no_decl(res[2], s, 0, c); \ STRING(s,"b\0c"); \ o = NONDET(0,2); \ STRCHR_no_decl(res[3], s, o, c); \ t_ ## i[0] = t_ ## i[1] = NONDET(c, 1); \ t_ ## i[2] = 1; \ t_ ## i[3] = 0; \ STRCHR_no_decl(res[4], t_ ## i, 0, c); \ } while (0) //DELPHIC_TEST void strchr_small_sets_chars() { CHAR c = 'a'; RES res[5]; Frama_C_show_each_c(c); SMALL_SETS_NO_ASSERTIONS(0, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); //@ assert (res[0] == -1 || res[0] == 0); // no alarm //@ assert (res[1] == -1); // no alarm //@ assert (res[2] == -1); // no alarm //@ assert (res[3] == -1); // no alarm //@ assert (res[4] >= -1 && res[4] <= 1); // no alarm c = 'b'; SMALL_SETS_NO_ASSERTIONS(1, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); //@ assert (res[0] == 1); // no alarm //@ assert (res[1] == -1 || res[1] == 1); // no alarm //@ assert (res[2] == -1); // no alarm //@ assert (res[3] == -1 || res[3] == 0); // no alarm //@ assert (res[4] >= -1 && res[4] <= 1); // no alarm c = NONDET('a', 'b'); // c IN {'a'; 'b'} Frama_C_show_each_c(c); SMALL_SETS_NO_ASSERTIONS(2, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); // for the first assert below, we may be looking for 'a' starting from s+1 //@ assert (res[0] == -1 || res[0] == 0 || res[0] == 1); // no alarm //@ assert (res[1] == -1 || res[0] == 1 || res[1] == 1); // no alarm //@ assert (res[2] == -1); // no alarm //@ assert (res[3] == -1 || res[3] == 0); // no alarm //@ assert (res[4] >= -1 && res[4] <= 1); // no alarm c = NONDET('b', 'c'); // c IN {'b'; 'c'} Frama_C_show_each_c(c); SMALL_SETS_NO_ASSERTIONS(3, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); //@ assert (res[0] == -1 || res[0] == 1 || res[0] == 2); // no alarm //@ assert refined: (res[0] == 1 || res[0] == 2); // no alarm //@ assert (res[1] == -1 || res[1] == 1 || res[1] == 2); // no alarm //@ assert (res[2] == -1); // no alarm //@ assert (res[3] == -1 || res[3] == 0 || res[3] == 2); // no alarm //@ assert (res[4] >= -1 && res[4] <= 1); // no alarm IF_NONDET(c, 0); // c IN {0; 'b'; 'c'} Frama_C_show_each_c(c); SMALL_SETS_NO_ASSERTIONS(4, c, res); Frama_C_show_each_res(res[0], res[1], res[2], res[3], res[4]); //@ assert (res[0] == -1 || res[0] >= 1 && res[0] <= 3); // no alarm //@ assert refined: (res[0] >= 1 && res[0] <= 3); // no alarm //@ assert (res[1] >= -1 && res[1] <= 3); // no alarm //@ assert (res[2] == -1 || res[2] == 0); // no alarm //@ assert (res[3] >= -1 && res[3] <= 3); // no alarm //@ assert (res[4] == -1 || res[4] == 0 || res[4] == 1 || res[4] == 3); // no alarm } void strchr_unbounded() { CHAR c = nondet; CHAR_PTR(s); STRING(s,"abcd"); STRCHR(RES, u1, s, 0, c); //@ assert (u1 >= -1 && u1 <= 4); // no alarm STRING(s,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"); CHAR_ARRAY(t,30); // uninitialized IF_NONDET(s, t); STRCHR(RES, u2, s, 0, c); // alarm //@ assert (u2 >= -1 && u2 <= 26); // alarm init_array_nondet(t, 0, 29, 0, 1); STRCHR(RES, u3, s, 0, c); // alarm //@ assert (u3 >= -1 && u3 <= 29); // alarm STRCHR(RES, u4, s, nondet, c); // alarm //@ assert (u4 >= -1 && u4 <= 29); // alarm } void strchr_invalid() { CHAR_PTR(s); STRING(s,"hello"); STRCHR(RES, unused, s, (unsigned int)&s, 1); // alarm } void strchr_garbled_mix_in_char() { int x; char *garbled = ((int)(&x + (int)&x)); if (nondet) strchr(garbled, (int)garbled); // must not crash } int main () { strchr_small_sets(); strchr_zero_termination(); strchr_initialization(); strchr_large(); strchr_large_uninit(); strchr_misc_array(); strchr_misc(); strchr_misc2(); strchr_bitfields(); strchr_bitfields2(); strchr_escaping(); strchr_big_array(); strchr_no_zero_but_ok(); strchr_small_sets_chars(); strchr_unbounded(); strchr_invalid(); strchr_garbled_mix_in_char(); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/strlen.c��������������������������������������������������������0000666�0000000�0000000�00000017203�13571573400�015664� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include "__fc_builtin.h" #include "string.h" // NOTE: all unnamed assertions should be valid. // Imprecise results should be defined using named // assertions placed after the less restrictive ones, // so that in the final output the following sentence // never arises: // Assertion got status unknown. // Only named assertions may remain unknown, e.g.: // Assertion 'refined' got status unknown. static volatile int nondet; #define assert_bottom(exp,id) if (nondet) { exp; Frama_C_show_each_unreachable_ ## id(); } // Definitions for C++ oracle checking typedef int Ival; typedef int RES; #define CHAR char #define NONDET(a,b) (nondet ? (a) : (b)) #define NONDET_STR(a,b) NONDET((a),(b)) #define NONDET_STR2(a,b) NONDET((a),(b)) #define IF_NONDET(var,val) if (nondet) var = val #define RANGE(from,to) Frama_C_interval(from,to) #define CHAR_ARRAY(var,n) char var[n] #define CHAR_PTR(var) char *var #define STRING(var,str) var = str; const char* static_str = "Hello World\n"; const char* zero_str = "abc\0\0\0abc"; #define TSZ 12 const char* tab_str[TSZ] = { "" , // 0 "a", // 1 "aa" , // 2 "aaa" , // 3 "aaaa" , // 4 "aaaaa" , // 5 "aaaaaa" , // 6 /* hole */ "aaaaaaaaa" , // 9 "aaaaaaaaaa" , "aaaaaaaaaaa", "aaaaaaaaaaaa" , "aaaaaaaaaaaaa" }; // 13 char unterminated_string[12] = "unterminated"; #define STRLEN(s, offs) strlen(s+offs) void small_sets() { char *s = "abc"; char *p = nondet ? s : (s+1); int z1 = strlen(p); //@ assert (z1 == 2 || z1 == 3); s = "\0bc"; p = nondet ? s : (s+1); int z2 = strlen(p); //@ assert (z2 == 0 || z2 == 2); s = ""; p = s; int z3 = strlen(p); //@ assert (z3 == 0); s = "b\0c"; p = nondet ? s : (s+2); int z4 = strlen(p); //@ assert (z4 == 1); char t[4]; t[0] = t[1] = nondet ? 0 : 1; t[2] = t[3] = 1; int z5 = strlen(t); // warning //@ assert z5 == 0 || z5 == 1; } void zero_termination() { char empty_or_non_terminated[1]; empty_or_non_terminated[0] = nondet ? 0 : 100; int z1 = strlen(empty_or_non_terminated); //@ assert (z1 == 0); char non_terminated[1] = {'X'}; assert_bottom(strlen(non_terminated), non_terminated); char non_terminated2[4] = { 76, 0, 28, 14 }; char *p = nondet ? ((char *)&non_terminated2) + 2 : ((char *)&non_terminated2) + 3; assert_bottom(strlen(p), p); } //DELPHIC_TEST void strlen_initialization() { CHAR_ARRAY(empty_or_uninitialized, 1); IF_NONDET(empty_or_uninitialized[0], 0); RES z1 = STRLEN(empty_or_uninitialized, 0); // alarm //@ assert (z1 == 0); CHAR_ARRAY(uninitialized, 1); assert_bottom(STRLEN(uninitialized, 0), uninitialized); CHAR_ARRAY(s, 2); IF_NONDET(s[0], 1); s[1] = 0; CHAR_PTR(p); p = s; RES z2 = STRLEN(p, 0); // alarm //@ assert (z2 == 1); CHAR_ARRAY(t, 4); t[0] = t[1] = 10; IF_NONDET(t[2], 10); t[3] = 0; p = t; RES z3 = STRLEN(p, 0); // alarm //@ assert (z3 == 3); } typedef struct { int a:8; int b:8; int c:17; } st; void bitfields() { st s; s.a = 3; s.b = 1; s.c = 7; char *p = &s; assert_bottom(strlen(p), p); } typedef struct { int a:4; int b:4; int c:17; } st2; void bitfields2() { st2 s; s.a = 3; s.b = 1; s.c = 7; char *p = &s; int z1 = strlen(p); //@assert (z1 == 2); } void init_array_nondet(char *a, int from, int to, int val1, int val2) { int val = NONDET(val1, val2); memset(a + from, val, to-from+1); from = to = val1 = val2 = -1; // reset to minimize oracle changes } //DELPHIC_TEST void strlen_large() { CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 99, 1, 2); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); RES z1 = STRLEN(a, offset); //@ assert (z1 >= 0 && z1 <= 54); offset = RANGE(5, 17); RES z2 = STRLEN(a, offset); //@ assert (z2 >= 3 && z2 <= 15); offset = RANGE(60, 74); RES z3 = STRLEN(a, offset); //@ assert (z3 >= 1 && z3 <= 15); offset = RANGE(63, 80); RES z4 = STRLEN(a, offset); // alarm //@ assert (z4 >= 0 && z4 <= 12); init_array_nondet(a, 0, 99, 0, 2); offset = RANGE(50, 70); RES z5 = STRLEN(a, offset); // alarm //@ assert (z5 >= 0 && z5 <= 49); } //DELPHIC_TEST void strlen_large_uninit() { CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 39, 1, 2); init_array_nondet(a, 50, 94, 3, 4); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); RES z1 = STRLEN(a, offset); // alarm //@ assert (z1 >= 0 && z1 <= 17); a[98] = 0; offset = RANGE(63, 80); RES z2 = STRLEN(a, offset); // alarm //@ assert (z2 >= 0 && z2 <= 12); offset = RANGE(45, 55); RES z3 = STRLEN(a, offset); // alarm //@ assert (z3 >= 20 && z3 <= 25); offset = 0; // avoid oracle diffs when changed } void escaping() { char s[4]; { int x; *((int *)s) = (int) &x; } if (nondet) s[0] = 0; int z1 = strlen(s); // alarm //@ assert (z1 == 0); s[0] = 0; int z2 = strlen(s); // no alarm //@ assert (z2 == 0); } void misc() { const char* loc_str = "Bonjour Monde\n"; char loc_char_array[5]; size_t sz1,sz2,sz3,sz4,sz5,sz6,sz7,sz8; int x = 0xabcdef00; int z = 0x12345600; int i; char *str; assert_bottom(strlen(unterminated_string), unterminated_string); str = nondet ? static_str : loc_str; sz1 = strlen(str); //@ assert(sz1 == 12) || (sz1 == 14); str = &x; str = nondet ? str : str + 3; sz2 = strlen(str); //@ assert(sz2 == 0) ; // no, could also do an RTE i = Frama_C_interval(0,TSZ-1); str = tab_str[i]; sz3 = strlen(str); //@ assert (sz3 >= 0) && (sz3 <= 13); loc_char_array[3] = '\0'; assert_bottom(strlen(loc_char_array), loc_char_array); sz4 = strlen(zero_str); //@ assert(sz4 == 3); char *s1 = nondet ? "abc" : "ABCD"; char *s2 = nondet ? s1 : s1+1; sz5 = strlen(s2); //@ assert(sz5 >= 2 && sz5 <= 4); s1 = nondet ? "efg" : "EFGH"; s2 = nondet ? s1+1 : s1+2; sz6 = strlen(s2); //@ assert(sz6 >= 1 && sz6 <= 3); s1 = nondet ? "mno\0pqr" : "MNOP\0QRS"; for (int j = 0; j < 8; j++) { sz7 = strlen(s1 + j); //@ assert(sz7 >= 0 && sz7 <= 4); } char maybe_init[2]; maybe_init[1] = '\0'; if (nondet) maybe_init[0] = 'A'; sz8 = strlen(maybe_init); //@ assert(sz8 == 1); } void big_array () { int t[1000000]; int u[200]; int r[201]; int *p; p = &t[nondet]; *p = 0x10230067; p = &u[nondet]; *p = 0x10230067; p = &r[nondet]; *p = 0x10230067; unsigned long len_u; unsigned long len_r; unsigned long len_t; len_u = strlen((char const *)u); // below plevel; precise len_r = strlen((char const *)r); // above plevel; imprecise len_t = strlen((char const *)t); // *far* above plevel Frama_C_show_each(len_u, len_r, len_t); len_u = strlen((char const *)(u+nondet)); // should be precise len_r = strlen((char const *)(r+nondet)); len_t = strlen((char const *)(t+nondet)); Frama_C_show_each(len_u, len_r, len_t); } void negative_offsets() { char buf[100]; for (int i = 0; i < 100; i++) buf[i] = 'A'; //avoid memset due to C++ oracles buf[99] = 0; unsigned len1, len2, len3, len4, len5, len6; if (nondet) { int offset1 = Frama_C_interval(-10, -8); len1 = strlen(buf + offset1); } if (nondet) { int offset2 = Frama_C_interval(-2, -1); len2 = strlen(buf + offset2); } int offset3 = Frama_C_interval(-1, -0); len3 = strlen(buf + offset3); int offset4 = Frama_C_interval(-1, 2); len4 = strlen(buf + offset4); int offset5 = Frama_C_interval(-4, 7); len5 = strlen(buf + offset5); int offset6 = Frama_C_interval(-10, 0); char *p = buf + offset6; len6 = strlen(p); char dest[100 * 2]; } int main (int c) { small_sets(); zero_termination(); strlen_initialization(); strlen_large(); strlen_large_uninit(); misc(); bitfields(); bitfields2(); escaping(); big_array(); negative_offsets(); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/strlen_align.c��������������������������������������������������0000666�0000000�0000000�00000000461�13571573400�017034� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #"" */ #include <string.h> typedef struct { int e; char *obval; long long c; } ob; typedef struct { long long a; int b; char stval[2]; } st; void main() { ob o; o.obval = "a"; o.c = 32; char *p = ((st *)&o)->stval; char k = *p; size_t z = strlen(p); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/strnlen.c�������������������������������������������������������0000666�0000000�0000000�00000000532�13571573400�016037� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <stdlib.h> // for size_t #include <string.h> char t1[5] = "abcde"; char t2[] = "abcde"; int main(int c){ int r1a, r1b, r1c, r2a, r2b, r2c; r1a = strnlen(t1, 3); r1b = strnlen(t1, 5); if (c & 1) r1c = strnlen(t1, 6); r2a = strnlen(t2, 3); r2b = strnlen(t2, 5); r2c = strnlen(t2, 6); Frama_C_dump_each(); return 0; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/strnlen2.c������������������������������������������������������0000666�0000000�0000000�00000031107�13571573400�016123� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include "__fc_builtin.h" #include "string.h" static volatile int nondet; #define assert_bottom(exp,id) if (nondet) { exp; Frama_C_show_each_unreachable_ ## id(); } const char* static_str = "Hello World\n"; const char* zero_str = "abc\0\0\0abc"; #define TSZ 12 // Definitions for C++ oracle checking typedef int Ival; typedef int RES; #define NONDET(a,b) (nondet ? (a) : (b)) #define IF_NONDET(var,val) if (nondet) var = val #define RANGE(from,to) Frama_C_interval(from,to) #define STRNLEN(base,offs,n) strnlen(base+offs,n) #define CHAR_ARRAY(var,n) char var[n] #define CHAR_PTR(var) char *var #define STRING(var,str) var = str; const char* tab_str[TSZ] = { "" , // 0 "a", // 1 "aa" , // 2 "aaa" , // 3 "aaaa" , // 4 "aaaaa" , // 5 "aaaaaa" , // 6 /* hole */ "aaaaaaaaa" , // 9 "aaaaaaaaaa" , "aaaaaaaaaaa", "aaaaaaaaaaaa" , "aaaaaaaaaaaaa" }; // 13 char unterminated_string[12] = "unterminated"; void small_sets() { CHAR_PTR(s); STRING(s,"abc"); Ival o = NONDET(0, 1); RES z1 = STRNLEN(s, o, 3); //@ assert (z1 == 2 || z1 == 3); STRING(s,"\0bc"); o = NONDET(0,1); RES z2 = STRNLEN(s, o, 2); //@ assert (z2 == 0 || z2 == 2); STRING(s,""); RES z3 = STRNLEN(s, 0, 0); //@ assert (z3 == 0); STRING(s,"b\0c"); o = NONDET(0,2); RES z4 = STRNLEN(s, o, 2); //@ assert (z4 == 1); CHAR_ARRAY(t, 4); t[0] = t[1] = NONDET(0, 1); t[2] = t[3] = 1; RES z5 = STRNLEN(t, 0, 4); // no warning //@ assert z5 == 0 || z5 == 1 || z5 == 4; } void zero_termination() { CHAR_ARRAY(empty_or_non_terminated, 1); empty_or_non_terminated[0] = NONDET(0, 100); RES z1 = STRNLEN(empty_or_non_terminated, 0, 1); //@ assert z1 == 0 || z1 == 1; CHAR_ARRAY(non_terminated, 1); non_terminated[0] = 'X'; assert_bottom(STRNLEN(non_terminated, 0, 2), non_terminated); CHAR_ARRAY(non_terminated2, 4); non_terminated2[0] = 76; non_terminated2[1] = 0; non_terminated2[2] = 28; non_terminated2[3] = 14; Ival o = NONDET(2, 3); assert_bottom(STRNLEN(non_terminated2, o, 4), non_terminated2); } void initialization() { char empty_or_uninitialized[1]; IF_NONDET(empty_or_uninitialized[0], 0); RES z1 = strnlen(empty_or_uninitialized, 1); //@ assert (z1 == 0); char uninitialized[1]; assert_bottom(strnlen(uninitialized, 1),uninitialized); CHAR_ARRAY(s, 2); IF_NONDET(s[0], 1); s[1] = 0; RES z2 = strnlen(s, 2); //@ assert (z2 == 1); CHAR_ARRAY(t,4); t[0] = t[1] = 10; IF_NONDET(t[2], 10); t[3] = 0; RES z3 = strnlen(t, 4); //@ assert (z3 == 3); } typedef struct { int a:8; int b:8; int c:17; } st; void bitfields() { st s; s.a = 3; s.b = 1; s.c = 7; char *p = &s; assert_bottom(strnlen(p, 3),bitfields); } typedef struct { int a:4; int b:4; int c:17; } st2; void bitfields2() { st2 s; s.a = 3; s.b = 1; s.c = 7; char *p = &s; RES z1 = strnlen(p, 3); //@assert (z1 == 2); } void init_array_nondet(void *a, int from, int to, int val1, int val2) { int val = nondet ? val1 : val2; memset(((char*)a) + from, val, to-from+1); from = to = val1 = val2 = -1; // reset to minimize oracle changes } void large() { char a[100]; init_array_nondet(a, 0, 99, 1, 2); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); RES z1 = STRNLEN(a, offset, 100); //@ assert (z1 >= 0 && z1 <= 54); offset = RANGE(5, 17); RES z2 = STRNLEN(a, offset, 100); //@ assert (z2 >= 3 && z2 <= 15); offset = RANGE(60, 74); RES z3 = STRNLEN(a, offset, 100); //@ assert (z3 >= 1 && z3 <= 15); offset = RANGE(63, 80); RES z4 = STRNLEN(a, offset, 100); //@ assert (z4 >= 0 && z4 <= 12); init_array_nondet(a, 0, 99, 0, 2); offset = RANGE(50, 70); RES z5 = STRNLEN(a, offset, 100); //@ assert (z5 >= 0 && z5 <= 49); } void large_uninit() { char a[100]; init_array_nondet(a, 0, 39, 1, 2); init_array_nondet(a, 50, 94, 3, 4); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); RES z1 = STRNLEN(a, offset, 100); //@ assert (z1 >= 0 && z1 <= 17); a[98] = 0; offset = RANGE(63, 80); RES z2 = STRNLEN(a, offset, 100); //@ assert (z2 >= 0 && z2 <= 12); offset = RANGE(45, 55); RES z3 = STRNLEN(a, offset, 100); //@ assert (z3 >= 20 && z3 <= 25); offset = 0; // avoid oracle diffs when changed } void escaping() { CHAR_ARRAY(s,4); { int x; *((int *)s) = (int) &x; } IF_NONDET(s[0], 0); RES z1 = strnlen(s, 4); // alarm //@ assert (z1 == 0); s[0] = 0; RES z2 = strnlen(s, 4); // no alarm //@ assert (z2 == 0); } void misc() { const char* loc_str = "Bonjour Monde\n"; char loc_char_array[5]; size_t sz1,sz2,sz3,sz4,sz5,sz6,sz7,sz8; int x = 0xabcdef00; RES z = 0x12345600; int i; char *str; assert_bottom(strnlen(unterminated_string, 13),unterminated_string); str = nondet ? static_str : loc_str; sz1 = strnlen(str, 14); //@ assert(sz1 == 12) || (sz1 == 14); str = &x; str = nondet ? str : str + 3; sz2 = strnlen(str, 12); //@ assert(sz2 == 0) ; // no, could also do an RTE i = Frama_C_interval(0,TSZ-1); str = tab_str[i]; sz3 = strnlen(str, 13); //@ assert (sz3 >= 0) && (sz3 <= 13); loc_char_array[3] = '\0'; assert_bottom(strnlen(loc_char_array, 5),loc_char_array); sz4 = strnlen(zero_str, 9); //@ assert(sz4 == 3); char *s1 = nondet ? "abc" : "ABCD"; char *s2 = nondet ? s1 : s1+1; sz5 = strnlen(s2, 5); //@ assert(sz5 >= 2 && sz5 <= 4); s1 = nondet ? "efg" : "EFGH"; s2 = nondet ? s1+1 : s1+2; sz6 = strnlen(s2, 5); //@ assert(sz6 >= 1 && sz6 <= 3); s1 = nondet ? "mno\0pqr" : "MNOP\0QRS"; for (int j = 0; j < 8; j++) { sz7 = strnlen(s1 + j, 10); //@ assert(sz7 >= 0 && sz7 <= 4); } char maybe_init[2]; maybe_init[1] = '\0'; IF_NONDET(maybe_init[0], 'A'); sz8 = strnlen(maybe_init, 2); //@ assert(sz8 == 1); } void big_array () { int u[200]; int r[201]; int t[1000000]; int *p; p = &u[nondet]; *p = 0x10230067; p = &r[nondet]; *p = 0x10230067; p = &t[nondet]; *p = 0x10230067; unsigned long len_u; unsigned long len_r; unsigned long len_t; // without initialization, most accesses are invalid, so the result is precise len_u = strnlen((char const *)u, 800); // below plevel; precise len_r = strnlen((char const *)r, 804); // above plevel; imprecise len_t = strnlen((char const *)t, 4000000); // *far* above plevel //@ assert len_u == 1; //@ assert len_r == 1; //@ assert len_t == 1; Frama_C_show_each(len_u, len_r, len_t); // less precise results here, but uninitialized values at the end of the // arrays ensure a slightly better result than afterwards len_u = strnlen((char const *)(u+nondet),801); // should be precise len_r = strnlen((char const *)(r+nondet),805); len_t = strnlen((char const *)(t+nondet),4000001); //@ assert len_u >= 0 && len_u <= 3; //@ assert len_r >= 0 && len_r <= 800; //@ assert len_t >= 0 && len_t <= 3999996; Frama_C_show_each(len_u, len_r, len_t); // initialization leads to less precise results init_array_nondet(u, 0, sizeof(u)-1, 0, 1); init_array_nondet(r, 0, sizeof(r)-1, 0, 1); init_array_nondet(t, 0, sizeof(t)-1, 0, 1); p = &u[nondet]; *p = 0x10230067; p = &r[nondet]; *p = 0x10230067; p = &t[nondet]; *p = 0x10230067; len_u = strnlen((char const *)u, 800); // below plevel; precise len_r = strnlen((char const *)r, 804); // above plevel; imprecise len_t = strnlen((char const *)t, 4000000); // *far* above plevel //@ assert len_u >= 0 && len_u <= 800; //@ assert len_r >= 0 && len_r <= 804; //@ assert len_t >= 0 && len_t <= 4000000; Frama_C_show_each(len_u, len_r, len_t); len_u = strnlen((char const *)(u+nondet),801); // should be precise len_r = strnlen((char const *)(r+nondet),805); len_t = strnlen((char const *)(t+nondet),4000001); //@ assert len_u >= 0 && len_u <= 799; //@ assert len_r >= 0 && len_r <= 803; //@ assert len_t >= 0 && len_t <= 3999999; Frama_C_show_each(len_u, len_r, len_t); } void no_zero_but_ok() { CHAR_ARRAY(s,20); s[0] = s[1] = s[2] = s[3] = s[4] = s[5] = s[6] = s[7] = s[8] = s[9] = 1; s[10] = 0; s[11] = s[12] = s[13] = 1; s[14] = s[15] = s[16] = s[17] = s[18] = s[19] = nondet ? 1 : 0; RES z1 = strnlen(s, 5); //@assert z1 == 5; RES z2 = strnlen(s, 10); //@assert z2 == 10; char *p = nondet ? s+1 : s+8; RES z3 = strnlen(p, 10); //@assert z3 == 2 || z3 == 9; p = nondet ? s+7 : s+11; RES z4 = strnlen(p,4); //@assert z4 == 3 || z4 == 4; p = nondet ? s+7 : s+18; RES z5 = strnlen(p,4); // maybe_indet = true //@assert z5 == 0 || z5 == 1 || z5 == 3; } void small_sets_n() { char *s; STRING(s,"abcde"); char *p = nondet ? s : s+1; char n = nondet ? 2 : 5; RES z1 = strnlen(p, n); //@assert z1 == 2 || z1 == 4 || z1 == 5; STRING(s,"\0bcdef"); p = nondet ? s : s+1; n = nondet ? 1 : 4; RES z2 = strnlen(p, n); //@assert z2 == 0 || z2 == 1 || z2 == 4; STRING(s,"bcd\0efg"); p = nondet ? s : s+2; RES z3a = strnlen(p, 2); //@assert z3a == 1 || z3a == 2; p = nondet ? s : s+2; n = nondet ? 2 : 3; RES z3 = strnlen(p, n); //@assert z3 == 1 || z3 == 2 || z3 == 3; p = nondet ? s : nondet ? s+2 : s+4; n = nondet ? 2 : 5; RES z4 = strnlen(p, n); //@assert z4 == 1 || z4 == 2 || z4 == 3; } void large_n() { CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 99, 1, 2); a[15] = 0; a[28] = 0; a[40] = 0; a[75] = 0; Ival offset = RANGE(3, 30); Ival n = RANGE(10, 20); RES z1 = STRNLEN(a, offset, n); //@assert z1 <= 12; a[28] = 1; a[29] = 0; RES z2 = STRNLEN(a, offset, n); //@assert z2 <= 13; a[40] = 1; RES z3 = STRNLEN(a, offset, n); // no alarm //@assert z3 <= 20; offset = RANGE(5, 17); RES z4 = STRNLEN(a, offset, n); //@assert z4 <= 13; offset = RANGE(60, 74); RES z5 = STRNLEN(a, offset, n); //@assert z5 >= 1 && z5 <= 15; offset = RANGE(63, 80); RES z6 = STRNLEN(a, offset, n); // no alarm //@assert z6 <= 20; init_array_nondet(a, 0, 99, 0, 2); offset = RANGE(50, 70); RES z7 = STRNLEN(a, offset, n); //@assert z7 <= 20; n = RANGE(0, 100); RES z8 = STRNLEN(a, offset, n); // alarm //@assert z8 <= 50; offset = RANGE(0, 10); n = RANGE(0, 90); RES z9 = STRNLEN(a, offset, n); // no alarm //@assert z9 <= 90; } void unbounded_n() { int n = nondet; if (n < 0) n = 0; char *s; STRING(s,"abc"); RES zu1 = strnlen(s, n); //@ assert 0 <= zu1 <= 3; Ival o = NONDET(0,1); RES zu2 = strnlen(s+o, n); //@ assert 0 <= zu2 <= 3; STRING(s,"bcd\0eg"); RES zu3 = strnlen(s, n); //@ assert 0 <= zu3 <= 3; } void intervals() { CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 9, 0, 1); init_array_nondet(a, 3, 6, 1, 1); init_array_nondet(a, 11, 11, 0, 1); init_array_nondet(a, 12, 15, 1, 1); init_array_nondet(a, 16, 19, 0, 1); Ival offset = RANGE(0,9); Ival n = RANGE(0, 9); RES z1 = STRNLEN(a, offset, n); //@ assert z1 >= 0 && z1 <= 9; offset = RANGE(3,9); n = RANGE(2,10); RES z2 = STRNLEN(a, offset, n); //@ assert z2 >= 0 && z2 <= 7; offset = RANGE(3,9); n = RANGE(0,11); RES z3 = STRNLEN(a, offset, n); //@ assert z3 >= 0 && z3 <= 7; offset = RANGE(3,10); n = RANGE(0,9); RES z4 = STRNLEN(a, offset, n); //@ assert z4 >= 0 && z4 <= 7; offset = RANGE(3,10); n = RANGE(0,10); RES z5 = STRNLEN(a, offset, n); //@ assert z5 >= 0 && z5 <= 7; offset = RANGE(3,10); n = RANGE(0,11); RES z6 = STRNLEN(a, offset, n); //@ assert z6 >= 0 && z6 <= 7; offset = RANGE(3,11); n = RANGE(0,9); RES z7 = STRNLEN(a, offset, n); //@ assert z7 >= 0 && z7 <= 9; offset = RANGE(3,11); n = RANGE(0,10); RES z8 = STRNLEN(a, offset, n); //@ assert z8 >= 0 && z8 <= 9; offset = RANGE(3,11); n = RANGE(0,11); RES z9 = STRNLEN(a, offset, n); //@ assert z9 >= 0 && z9 <= 9; } void negative_offsets() { char buf[100]; for (int i = 0; i < 100; i++) buf[i] = 'A'; //avoid memset due to C++ oracles buf[99] = 0; unsigned len1, len2, len3, len4, len5, len6; if (nondet) { int offset1 = Frama_C_interval(-10, -8); len1 = strnlen(buf + offset1, 100); } if (nondet) { int offset2 = Frama_C_interval(-2, -1); len2 = strnlen(buf + offset2, 100); } int offset3 = Frama_C_interval(-1, -0); len3 = strnlen(buf + offset3, 100); int offset4 = Frama_C_interval(-1, 2); len4 = strnlen(buf + offset4, 100); int offset5 = Frama_C_interval(-4, 7); len5 = strnlen(buf + offset5, 100); int offset6 = Frama_C_interval(-10, 0); char *p = buf + offset6; len6 = strnlen(p, 100); char dest[100 * 2]; } int main (int c) { small_sets(); zero_termination(); initialization(); large(); large_uninit(); misc(); bitfields(); bitfields2(); escaping(); big_array(); no_zero_but_ok(); small_sets_n(); large_n(); unbounded_n(); intervals(); negative_offsets(); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/test_config�����������������������������������������������������0000666�0000000�0000000�00000000415�13571573400�016435� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MACRO: EVA_OPTIONS @EVA_OPTIONS@ -eva-msg-key malloc -eva-warn-key malloc:weak=feedback -eva-no-alloc-returns-null MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/test_config_apron�����������������������������������������������0000666�0000000�0000000�00000000471�13571573400�017636� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MACRO: EVA_OPTIONS @EVA_OPTIONS@ -eva-msg-key malloc -eva-warn-key malloc:weak=feedback -eva-no-alloc-returns-null -eva-apron-oct -eva-msg-key experimental-ok MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/test_config_bitwise���������������������������������������������0000666�0000000�0000000�00000000441�13571573400�020162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MACRO: EVA_OPTIONS @EVA_OPTIONS@ -eva-msg-key malloc -eva-warn-key malloc:weak=feedback -eva-no-alloc-returns-null -eva-bitwise-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/test_config_equalities������������������������������������������0000666�0000000�0000000�00000000442�13571573400�020662� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MACRO: EVA_OPTIONS @EVA_OPTIONS@ -eva-msg-key malloc -eva-warn-key malloc:weak=feedback -eva-no-alloc-returns-null -eva-equality-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/test_config_gauges����������������������������������������������0000666�0000000�0000000�00000000440�13571573400�017766� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MACRO: EVA_OPTIONS @EVA_OPTIONS@ -eva-msg-key malloc -eva-warn-key malloc:weak=feedback -eva-no-alloc-returns-null -eva-gauges-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/test_config_octagons��������������������������������������������0000666�0000000�0000000�00000000441�13571573400�020331� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MACRO: EVA_OPTIONS @EVA_OPTIONS@ -eva-msg-key malloc -eva-warn-key malloc:weak=feedback -eva-no-alloc-returns-null -eva-octagon-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/test_config_symblocs��������������������������������������������0000666�0000000�0000000�00000000454�13571573400�020353� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MACRO: EVA_OPTIONS @EVA_OPTIONS@ -eva-msg-key malloc -eva-warn-key malloc:weak=feedback -eva-no-alloc-returns-null -eva-symbolic-locations-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/vla.c�����������������������������������������������������������0000666�0000000�0000000�00000001061�13571573400�015132� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* STDOPT: #"-slevel 10 -eva-builtins-auto" */ void f(int i) { int t[i+1]; Frama_C_show_each(t); t[i] = i; if (t[i] != i) { // test that we can always perform a strong update on the // base corresponding to the vla. This works with the current allocation // builtin (Frama_C_malloc_by_stack) because bases that are allocated // multiple times, but that are never allocated twice _in the same state_ // are never changed into weak bases. //@ assert \false; } } void main() { for (int i=1; i<10; i++) f(i); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/watch.c���������������������������������������������������������0000666�0000000�0000000�00000000311�13571573400�015453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int x,y,z; int main(int c){ x = 1; Frama_C_watch_value(&c, sizeof(c), 2000000000, 5); x = 2; c = !!c; x = 3; c = u(); x = 4; x++; x++; x++; x++; x++; x++; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/wcslen.c��������������������������������������������������������0000666�0000000�0000000�00000020602�13571573400�015645� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include "__fc_builtin.h" #include "string.h" #include <wchar.h> // NOTE: all unnamed assertions should be valid. // Imprecise results should be defined using named // assertions placed after the less restrictive ones, // so that in the final output the following sentence // never arises: // Assertion got status unknown. // Only named assertions may remain unknown, e.g.: // Assertion 'refined' got status unknown. static volatile int nondet; #define assert_bottom(exp,id) if (nondet) { exp; Frama_C_show_each_unreachable_ ## id(); } // Definitions for C++ oracle checking typedef int Ival; typedef int RES; #define CHAR wchar_t #define NONDET(a,b) (nondet ? (a) : (b)) #define NONDET_STR(a,b) NONDET((a),(b)) #define NONDET_STR2(a,b) NONDET((a),(b)) #define IF_NONDET(var,val) if (nondet) var = val #define RANGE(from,to) Frama_C_interval(from,to) #define CHAR_ARRAY(var,n) wchar_t var[n] #define CHAR_PTR(var) wchar_t *var #define STRING(var,str) var = str; const wchar_t* static_str = L"Hello World\n"; const wchar_t* zero_str = L"abc\0\0\0abc"; #define TSZ 12 const wchar_t* tab_str[TSZ] = { L"" , // 0 L"a", // 1 L"aa" , // 2 L"aaa" , // 3 L"aaaa" , // 4 L"aaaaa" , // 5 L"aaaaaa" , // 6 /* hole */ L"aaaaaaaaa" , // 9 L"aaaaaaaaaa" , L"aaaaaaaaaaa", L"aaaaaaaaaaaa" , L"aaaaaaaaaaaaa" }; // 13 wchar_t unterminated_string[12] = L"unterminated"; #define WCSLEN(s, offs) wcslen(s+offs) void small_sets() { wchar_t *s = L"abc"; wchar_t *p = nondet ? s : (s+1); int z1 = wcslen(p); //@ assert (z1 == 2 || z1 == 3); s = L"\0bc"; p = nondet ? s : (s+1); int z2 = wcslen(p); //@ assert (z2 == 0 || z2 == 2); s = L""; p = s; int z3 = wcslen(p); //@ assert (z3 == 0); s = L"b\0c"; p = nondet ? s : (s+2); int z4 = wcslen(p); //@ assert (z4 == 1); wchar_t t[4]; t[0] = t[1] = nondet ? 0 : 1; t[2] = t[3] = 1; int z5 = wcslen(t); // warning //@ assert z5 == 0 || z5 == 1; } void zero_termination() { wchar_t empty_or_non_terminated[1]; empty_or_non_terminated[0] = nondet ? 0 : 100; int z1 = wcslen(empty_or_non_terminated); //@ assert (z1 == 0); wchar_t non_terminated[1] = {'X'}; assert_bottom(wcslen(non_terminated), non_terminated); wchar_t non_terminated2[4] = { 76, 0, 28, 14 }; wchar_t *p = nondet ? ((wchar_t *)&non_terminated2) + 2 : ((wchar_t *)&non_terminated2) + 3; assert_bottom(wcslen(p), p); } //DELPHIC_TEST void wcslen_initialization() { CHAR_ARRAY(empty_or_uninitialized, 1); IF_NONDET(empty_or_uninitialized[0], 0); RES z1 = WCSLEN(empty_or_uninitialized, 0); // alarm //@ assert (z1 == 0); CHAR_ARRAY(uninitialized, 1); assert_bottom(WCSLEN(uninitialized, 0), uninitialized); CHAR_ARRAY(s, 2); IF_NONDET(s[0], 1); s[1] = 0; CHAR_PTR(p); p = s; RES z2 = WCSLEN(p, 0); // alarm //@ assert (z2 == 1); CHAR_ARRAY(t, 4); t[0] = t[1] = 10; IF_NONDET(t[2], 10); t[3] = 0; p = t; RES z3 = WCSLEN(p, 0); // alarm //@ assert (z3 == 3); } typedef struct { int64_t a:32; int64_t b:32; int64_t c:63; } st; void bitfields() { st s; s.a = 3; s.b = 1; s.c = 7; wchar_t *p = &s; assert_bottom(wcslen(p), p); } typedef struct { int64_t a:33; int64_t b:63; int64_t c:63; } st2; void bitfields2() { st2 s; s.a = 3; s.b = 1; s.c = 0x70000; wchar_t *p = &s; int z1 = wcslen(p); //@assert (z1 == 2); } void init_array_nondet(wchar_t *a, int from, int to, int val1, int val2) { int val = NONDET(val1, val2); memset(a + from, val, sizeof(wchar_t)*(to-from+1)); from = to = val1 = val2 = -1; // reset to minimize oracle changes } //DELPHIC_TEST void wcslen_large() { CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 99, 1, 2); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); RES z1 = WCSLEN(a, offset); //@ assert (z1 >= 0 && z1 <= 54); offset = RANGE(5, 17); RES z2 = WCSLEN(a, offset); //@ assert (z2 >= 3 && z2 <= 15); offset = RANGE(60, 74); RES z3 = WCSLEN(a, offset); //@ assert (z3 >= 1 && z3 <= 15); offset = RANGE(63, 80); RES z4 = WCSLEN(a, offset); // alarm //@ assert (z4 >= 0 && z4 <= 12); init_array_nondet(a, 0, 99, 0, 2); offset = RANGE(50, 70); RES z5 = WCSLEN(a, offset); // alarm //@ assert (z5 >= 0 && z5 <= 49); } //DELPHIC_TEST void wcslen_large_uninit() { CHAR_ARRAY(a, 100); init_array_nondet(a, 0, 39, 1, 2); init_array_nondet(a, 50, 94, 3, 4); a[20] = 0; a[75] = 0; Ival offset = RANGE(3, 30); RES z1 = WCSLEN(a, offset); // alarm //@ assert (z1 >= 0 && z1 <= 17); a[98] = 0; offset = RANGE(63, 80); RES z2 = WCSLEN(a, offset); // alarm //@ assert (z2 >= 0 && z2 <= 12); offset = RANGE(45, 55); RES z3 = WCSLEN(a, offset); // alarm //@ assert (z3 >= 20 && z3 <= 25); offset = 0; // avoid oracle diffs when changed } void escaping() { wchar_t s[4]; { int x; *((int *)s) = (int)&x; *((int *)&s[1]) = (int)&x; *((int *)&s[2]) = (int)&x; *((int *)&s[3]) = (int)&x; } if (nondet) s[0] = 0; int z1 = wcslen(s); // alarm //@ assert (z1 == 0); s[0] = 0; int z2 = wcslen(s); // no alarm //@ assert (z2 == 0); } void misc() { const wchar_t* loc_str = L"Bonjour Monde\n"; wchar_t loc_char_array[5]; size_t sz1,sz2,sz3,sz4,sz5,sz6,sz7,sz8; int x[4]; x[0] = 0; x[1] = 0xef; x[2] = 0xcd; x[3] = 0xab; int z[4]; z[0] = 0; z[1] = 0x56; z[2] = 0x23; z[3] = 0x12; int i; wchar_t *str; assert_bottom(wcslen(unterminated_string), unterminated_string); str = nondet ? static_str : loc_str; sz1 = wcslen(str); //@ assert(sz1 == 12) || (sz1 == 14); str = x; str = nondet ? str : str + 3; sz2 = wcslen(str); //@ assert(sz2 == 0) ; // no, could also do an RTE i = Frama_C_interval(0,TSZ-1); str = tab_str[i]; sz3 = wcslen(str); //@ assert (sz3 >= 0) && (sz3 <= 13); loc_char_array[3] = L'\0'; assert_bottom(wcslen(loc_char_array), loc_char_array); sz4 = wcslen(zero_str); //@ assert(sz4 == 3); wchar_t *s1 = nondet ? L"abc" : L"ABCD"; wchar_t *s2 = nondet ? s1 : s1+1; sz5 = wcslen(s2); //@ assert(sz5 >= 2 && sz5 <= 4); s1 = nondet ? L"efg" : L"EFGH"; s2 = nondet ? s1+1 : s1+2; sz6 = wcslen(s2); //@ assert(sz6 >= 1 && sz6 <= 3); s1 = nondet ? L"mno\0pqr" : L"MNOP\0QRS"; for (int j = 0; j < 8; j++) { sz7 = wcslen(s1 + j); //@ assert(sz7 >= 0 && sz7 <= 4); } wchar_t maybe_init[2]; maybe_init[1] = L'\0'; if (nondet) maybe_init[0] = L'A'; sz8 = wcslen(maybe_init); //@ assert(sz8 == 1); } void big_array () { int64_t t[1000000]; int64_t u[200]; int64_t r[201]; int64_t *p; p = &t[nondet]; *p = 0x1023678900000000; //int64_t v[2] = {0x00006767, 0x10102323}; //memcpy(p, v, sizeof(v));// *p = 0x67676767; *(p+1) = 0; *(p+2) = 0x23232323; *(p+3) = 0x10101010; p = &u[nondet]; *p = 0x1023678900000000; //memcpy(p, v, sizeof(v));// *p = 0x67676767; *(p+1) = 0; *(p+2) = 0x23232323; *(p+3) = 0x10101010; p = &r[nondet]; *p = 0x1023678900000000; //memcpy(p, v, sizeof(v));// *p = 0x67676767; *(p+1) = 0; *(p+2) = 0x23232323; *(p+3) = 0x10101010; unsigned long len_u; unsigned long len_r; unsigned long len_t; len_u = wcslen((wchar_t const *)u); // below plevel; precise len_r = wcslen((wchar_t const *)r); // above plevel; imprecise len_t = wcslen((wchar_t const *)t); // *far* above plevel Frama_C_show_each(len_u, len_r, len_t); len_u = wcslen((wchar_t const *)(u+nondet)); // should be precise len_r = wcslen((wchar_t const *)(r+nondet)); len_t = wcslen((wchar_t const *)(t+nondet)); Frama_C_show_each(len_u, len_r, len_t); } void negative_offsets() { wchar_t buf[100]; for (int i = 0; i < 100; i++) buf[i] = L'A'; //avoid memset due to C++ oracles buf[99] = 0; unsigned len1, len2, len3, len4, len5, len6; if (nondet) { int offset1 = Frama_C_interval(-10, -8); len1 = wcslen(buf + offset1); } if (nondet) { int offset2 = Frama_C_interval(-2, -1); len2 = wcslen(buf + offset2); } int offset3 = Frama_C_interval(-1, -0); len3 = wcslen(buf + offset3); int offset4 = Frama_C_interval(-1, 2); len4 = wcslen(buf + offset4); int offset5 = Frama_C_interval(-4, 7); len5 = wcslen(buf + offset5); int offset6 = Frama_C_interval(-10, 0); wchar_t *p = buf + offset6; len6 = wcslen(p); *(p+len6) = 0; wchar_t dest[100 * 2]; } int main (int c) { small_sets(); zero_termination(); wcslen_initialization(); wcslen_large(); wcslen_large_uninit(); misc(); bitfields(); bitfields2(); escaping(); big_array(); negative_offsets(); return 0; } ������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/builtins/write-const.c���������������������������������������������������0000666�0000000�0000000�00000001261�13571573400�016630� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config* OPT: -eva @EVA_CONFIG@ -journal-disable -eva-builtins-auto -calldeps */ // This test verifies that writing in a memory location that may be const // is correctly handled #include "string.h" volatile int v; const int a = -1; int b; void main0() { int *p = v ? &a : &b; int x = 1; memcpy(p, &x, sizeof(x)); Frama_C_dump_each(); } void main1() { int *p = v ? &a : &b; int x = 1; memset(p, 5, sizeof(x)); Frama_C_dump_each(); } void main2() { int *p = v ? &a : &b; *p = 1; Frama_C_dump_each(); } void main3() { int *p = v ? &a : &b; int y = 2; *p = y; Frama_C_dump_each(); } void main() { main0(); main1(); main2(); main3(); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/���������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014312� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/function_pointer.i���������������������������������������������0000666�0000000�0000000�00000001324�13571573400�020051� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config COMMENT: Test option -cg-function-pointers EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -cg-function-pointers -no-autoload-plugins -load-module eva,@PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -cg-no-services -cg-function-pointers -no-autoload-plugins -load-module eva,@PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -cg-no-function-pointers -no-autoload-plugins -load-module eva,@PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -cg-no-services -cg-no-function-pointers -no-autoload-plugins -load-module eva,@PTEST_DIR@/@PTEST_NAME@.cmxs */ int (*fptr)(int); int f(int x) { return x; } int g(int x) { return x-1; } int main(void) { int x = 0; fptr = f; x = (*fptr)(1); fptr = g; x = (*fptr)(1); return x; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/function_pointer.ml��������������������������������������������0000666�0000000�0000000�00000000162�13571573400�020230� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������let main () = Format.printf "number of calls = %d@." (Callgraph.Uses.nb_calls ()) let () = Db.Main.extend main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/issue_55_iter_over_unregistered_function.i���������������������0000666�0000000�0000000�00000000345�13571573400�024672� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config COMMENT: Test call to Callgraph.Uses.iter_on_callers/callees (through Inout) OPT: -inout */ /*@ assigns *p \from x; */ extern void f(int x, int *p); int main(void) { int *q; f(0, q); return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/no_fp_unsound_warning.i����������������������������������������0000666�0000000�0000000�00000000273�13571573400�021067� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config COMMENT: Test that callgraph users are warned about -cg-no-function-pointers OPT: -cg-function-pointers -out OPT: -cg-no-function-pointers -out */ void main() { } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/oracle/��������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015557� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/oracle/function_pointer.0.res.oracle���������������������������0000666�0000000�0000000�00000000133�13571573400�023256� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/callgraph/function_pointer.i (no preprocessing) number of calls = 2 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/oracle/function_pointer.1.res.oracle���������������������������0000666�0000000�0000000�00000000133�13571573400�023257� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/callgraph/function_pointer.i (no preprocessing) number of calls = 2 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/oracle/function_pointer.2.res.oracle���������������������������0000666�0000000�0000000�00000000133�13571573400�023260� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/callgraph/function_pointer.i (no preprocessing) number of calls = 0 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/oracle/function_pointer.3.res.oracle���������������������������0000666�0000000�0000000�00000000133�13571573400�023261� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/callgraph/function_pointer.i (no preprocessing) number of calls = 0 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/oracle/issue_55_iter_over_unregistered_function.res.oracle�����0000666�0000000�0000000�00000003001�13571573400�027734� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/callgraph/issue_55_iter_over_unregistered_function.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/callgraph/issue_55_iter_over_unregistered_function.i:12: Warning: accessing uninitialized left-value. assert \initialized(&q); [eva] done for function main [eva] tests/callgraph/issue_55_iter_over_unregistered_function.i:12: assertion 'Eva,initialization' got final status invalid. [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 1 statements reached (out of 3): 33% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 1 alarm generated by the analysis: 1 access to uninitialized left-values 1 of them is a sure alarm (invalid status). ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [inout] InOut (internal) for function main: Operational inputs: q Operational inputs on termination: \nothing Sure outputs: ANYTHING(origin:Unknown) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/oracle/no_fp_unsound_warning.0.res.oracle����������������������0000666�0000000�0000000�00000002020�13571573400�024267� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/callgraph/no_fp_unsound_warning.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 1 statements reached (out of 1): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [inout] Out (internal) for function main: \nothing ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/callgraph/oracle/no_fp_unsound_warning.1.res.oracle����������������������0000666�0000000�0000000�00000002161�13571573400�024276� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/callgraph/no_fp_unsound_warning.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 1 statements reached (out of 1): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [cg] Warning: using callgraph while option -cg-function-pointers is unset, result may be unsound [inout] Out (internal) for function main: \nothing ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/���������������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�013124� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/Change_formals.ml����������������������������������������������������0000666�0000000�0000000�00000004533�13571573400�016373� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_types module Options = Plugin.Register(struct let name = "Test" let shortname= "test" let help = "test" end) class transform prj = object(_self) inherit Visitor.frama_c_copy prj method! vglob_aux = function | GFun (_fdec, _loc) as g -> let mk_formal = function l -> begin match l with | GFun (fundec, loc) :: [] -> Project.on prj (fun () -> Options.feedback "current prj = %a" Project.pretty (Project.current ()); ignore(Cil.makeFormalVar fundec "ok" Cil.intType)) (); let g = GFun({ fundec with svar = fundec.svar }, loc) in [g] | _ -> assert false end in Cil.ChangeDoChildrenPost( [g], mk_formal) | GFunDecl (_fspec, _vi, _loc) as g -> let mk_gvar_decl = function l -> begin match l with | (GFunDecl (_fspec, vi, _loc) as g) :: [] -> if not (Cil.Frama_c_builtins.mem vi.vname) then begin match vi.vtype with | TFun(typ, args, varity, attr) -> let vtype = Cil.argsToList args in let new_fun_typ = TFun( typ, Some (vtype @ [ "ok", Cil.intType, [] ]), varity, attr) in vi.vtype <- new_fun_typ; Project.on prj (fun () -> Cil.setFormalsDecl vi new_fun_typ;) (); [ g ] | _ -> assert false end else [g] | _ -> assert false end in Cil.ChangeDoChildrenPost ([g], mk_gvar_decl) | GVarDecl _ | GVar _ | GType _ | GCompTag _ | GCompTagDecl _ | GEnumTag _ | GEnumTagDecl _ | GAsm _ | GPragma _ | GText _ | GAnnot _ -> Cil.DoChildren method! vinst = function | Call(_,{ Cil_types.enode = Lval (Var _, NoOffset)},_,_) as i -> let add_zero = function | [Call(res,f,args,loc)] -> let args = args @ [ Cil.zero ~loc ] in [Call(res,f,args,loc)] | _ -> assert false in Cil.ChangeDoChildrenPost([i], add_zero) | _ -> Cil.DoChildren end let generate_code name = let transform prj = new transform prj in File.create_project_from_visitor name transform let main () = if Project.get_name (Project.current()) <> "test" then ignore (generate_code "test") let () = Db.Main.extend main (* Local Variables: compile-command: "make -C ../.. tests/misc/Change_formals.cmo" End: *) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/acsl-comments.i������������������������������������������������������0000666�0000000�0000000�00000000064�13571573400�016043� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*@ ensures /* FOO */ \false; */ void job(void) { } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/annot.c��������������������������������������������������������������0000666�0000000�0000000�00000000235�13571573400�014407� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int fact(int n) { int r = 1 ; while ( n > 0 ) { //@ assert n > 0 ; before: r *= n-- ; //@ assert r == \at(r*n,before) ; } return r ; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/branch.c�������������������������������������������������������������0000666�0000000�0000000�00000000153�13571573400�014524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT:-print */ int f(int a,int b) { if (a<b) return a++ ; else return b-- ; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/bts297.c�������������������������������������������������������������0000666�0000000�0000000�00000000241�13571573400�014317� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /* Doc example 2.45 */ int abrupt (int x) { while (x > 0) /*@ requires \true ; ensures x==3; */ {if (x) x++ ;} } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/bts342.c�������������������������������������������������������������0000666�0000000�0000000�00000000277�13571573400�014317� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: invalid C file */ typedef struct { int i1; int i2; } s; /*@ requires @ \valid(x + i) && &x[i]->i1 != 0; @*/ int f (s x[], int i) { return 1 / (&x[i])->i1; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/bts882.i�������������������������������������������������������������0000666�0000000�0000000�00000000213�13571573400�014324� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT:-print */ void main () { int r; switch(1) { case 2: r = (int) f(1); break; default: break; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/bts892.i�������������������������������������������������������������0000666�0000000�0000000�00000000212�13571573400�014324� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int tab[16]; void* main(void) { int i; static const int* t[] = { &tab[1], &tab[3], &tab[4], &i }; return &t; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/change_formals.c�����������������������������������������������������0000666�0000000�0000000�00000000764�13571573400�016247� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config EXECNOW: make -s tests/cil/Change_formals.cmxs OPT: -load-module tests/cil/Change_formals.cmxs -cpp-extra-args="-DNO_PROTO" -then-on test -print OPT: -load-module tests/cil/Change_formals.cmxs -cpp-extra-args="-DNO_IMPLEM" -then-on test -print OPT: -load-module tests/cil/Change_formals.cmxs -then-on test -print */ #ifndef NO_PROTO int f(int x); #endif #ifndef NO_IMPLEM int f(int x) { return x; } #endif // needed to prevent erasure of f in NO_IMPLEM case int g() { return f(0); } ������������frama-c-20.0-Calcium/tests/cil/change_to_instr.i����������������������������������������������������0000666�0000000�0000000�00000000316�13571573400�016444� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -load-script tests/cil/change_to_instr.ml -print */ int main(){ int i = 0 ; //@ ghost int j = 0 ; i++ ; //@ ghost j++ ; { //@ ghost int x = 0; //@ ghost x++ ; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/change_to_instr.ml���������������������������������������������������0000666�0000000�0000000�00000000531�13571573400�016623� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class add_skip = object(_) inherit Visitor.frama_c_inplace method! vfunc f = File.must_recompute_cfg f ; Cil.DoChildren method! vinst i = let open Cil_types in Cil.ChangeTo [ Skip(Cil.CurrentLoc.get()) ; i ] end let run () = Visitor.visitFramacFileSameGlobals (new add_skip) (Ast.get()) let () = Db.Main.extend run �����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/comments.c�����������������������������������������������������������0000666�0000000�0000000�00000000546�13571573400�015122� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -print -keep-comments */ /* ABC */ void f() {} //ABD/*FOO*/ /*ABC*/ /*ABC */ /*@ requires \true ; // FOO */ void g() { /*@ ghost int x = 0; // ghost_comment */ } int bts_2176() { int r=0; int i=0; /* comment 1 */ r = /* comment 2 */ 1; //@ loop pragma UNROLL 10; for(i=0; i<10; i++) { r += 1; } return r; } ����������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/cpu_a.c��������������������������������������������������������������0000666�0000000�0000000�00000000176�13571573400�014363� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: tests/cil/cpu_b.c -machdep x86_16 -print */ typedef unsigned short DWORD ; DWORD f(void) { return 0; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/cpu_b.c��������������������������������������������������������������0000666�0000000�0000000�00000000217�13571573400�014360� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: tests/cil/cpu_a.c -machdep x86_16 -print */ typedef unsigned int DWORD ; DWORD f(void); DWORD g(void) { return f(); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/digraphs_c99.c�������������������������������������������������������0000666�0000000�0000000�00000000673�13571573400�015563� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������%:define N 5 #define xstr(s) str(s) %:define str(s) #s %:define get_first1(a) (a[0]) #define get_first2(a) (a<:0:>) #define conc(a,b) a ## b #define conc2(a,b) a %:%: b int main() <% int a<:N:> = <%2,1,0%>; // implicit initialization of remaining elements char *s = "a<:"; // digraph inside quotes char *b = xstr(get_first1(a)); char *c = xstr(get_first2(a)); int d1, d2; conc(d, 1) = 7; conc2(d, 2) = 9; return a<:4:>; %> ���������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/duplicate-labels.c���������������������������������������������������0000666�0000000�0000000�00000000635�13571573400�016506� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -keep-switch -print -journal-disable */ int foo18(int a) { int x = 0, y = 1; x = ({ 3; goto l ; l: 3;}); goto l; return x; } void foo(int z) { int i; for (i=0; i<10; i++) { __Cont: z++; if (z < 5) continue; else goto __Cont; } } void f() { int i = 0; while_1_break: while (i < 10) { ++i; } goto while_1_break; } ���������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/empty_cond.c���������������������������������������������������������0000666�0000000�0000000�00000000064�13571573400�015431� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������int y,z; void main(int x) { if(z++) ; return; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/insert_formal.i������������������������������������������������������0000666�0000000�0000000�00000004103�13571573400�016140� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config MODULE: @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -print */ // v void void_circumflex( void ) { } // v void void_circumflex_g( void ) { } // v void void_dollar( void ) { } // v void void_dollar_g( void ) { } // v void a_circumflex( int a ) { } // v void a_dollar( int a ) { } // v void a_circumflex_g( int a ) { } // v void a_dollar_g( int a ) { } // v void a_a( int a ){ } // v void ghost_a_circumflex( void ) /*@ ghost ( int a ) */ { } // v void ghost_a_dollar( void ) /*@ ghost ( int a ) */ { } // v void ghost_a_circumflex_g( void ) /*@ ghost ( int a ) */ { } // v void ghost_a_dollar_g( void ) /*@ ghost ( int a ) */ { } // v void ghost_a_a( void ) /*@ ghost ( int a ) */ { } // v void a_b_c_a (int a, int b, int c) { } // v void b_a_c_a (int b, int a, int c) { } // v void all_ghost_a_b_c_a ( void )/*@ ghost (int a, int b, int c) */ { } // v void all_ghost_b_a_c_a ( void )/*@ ghost (int b, int a, int c) */ { } // v void a_ghost_b_c_a ( int a )/*@ ghost (int b, int c) */ { } // v void b_ghost_a_c_a ( int b )/*@ ghost (int a, int c) */ { } /*@ ghost // v void g_void_circumflex( void ) { } // v void g_void_dollar( void ) { } // v void g_a_circumflex( int a ) { } // v void g_a_dollar( int a ) { } // v void g_a_a( int a ){ } // v void g_a_b_c_a (int a, int b, int c) { } // v void g_b_a_c_a (int b, int a, int c) { } */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/insert_formal.ml�����������������������������������������������������0000666�0000000�0000000�00000003312�13571573400�016321� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_types let update_func f = let insert_circ f = Cil.makeFormalVar f ~where:"^" "x" Cil.intType in let insert_dollar f = Cil.makeFormalVar f ~where:"$" "x" Cil.intType in let insert_circ_g f = Cil.makeFormalVar f ~ghost:true ~where:"^" "x" Cil.intType in let insert_dollar_g f = Cil.makeFormalVar f ~ghost:true ~where:"$" "x" Cil.intType in let insert_a f = Cil.makeFormalVar f ~where:"a" "x" Cil.intType in let insert_a_g f = Cil.makeFormalVar f ~ghost:true ~where:"a" "x" Cil.intType in let circ_list = [ "void_circumflex" ; "a_circumflex" ; "ghost_a_circumflex" ] in let dollar_list = [ "void_dollar" ; "a_dollar" ; "ghost_a_dollar" ] in let circ_g_list = [ "void_circumflex_g" ; "a_circumflex_g" ; "ghost_a_circumflex_g" ; "g_void_circumflex" ; "g_a_circumflex" ] in let dollar_g_list = [ "void_dollar_g" ; "a_dollar_g" ; "ghost_a_dollar_g" ; "g_void_dollar" ; "g_a_dollar" ] in let a_list = [ "a_a" ; "a_b_c_a" ; "b_a_c_a" ; "a_ghost_b_c_a" ; ] in let a_g_list = [ "ghost_a_a" ; "all_ghost_a_b_c_a" ; "all_ghost_b_a_c_a" ; "b_ghost_a_c_a" ; "g_a_a" ; "g_a_b_c_a" ; "g_b_a_c_a" ] in if List.mem f.svar.vname circ_list then ignore(insert_circ f) ; if List.mem f.svar.vname dollar_list then ignore(insert_dollar f) ; if List.mem f.svar.vname circ_g_list then ignore(insert_circ_g f) ; if List.mem f.svar.vname dollar_g_list then ignore(insert_dollar_g f) ; if List.mem f.svar.vname a_list then ignore(insert_a f) ; if List.mem f.svar.vname a_g_list then ignore(insert_a_g f) ; () let run () = Globals.Functions.iter_on_fundecs update_func let () = Db.Main.extend run ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/issues.c�������������������������������������������������������������0000666�0000000�0000000�00000017130�13571573400�014605� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: some issues with Cil parsing and pretty printing */ #include <stdio.h> /*OK: Unspecified statements */ int main() { struct l { struct l** next; } s[4]; struct l* a; struct l* p[4]; struct l* old; p[0] = s; p[0]->next = &p[0]; old = (*p[0]->next); a = ((*p[0]->next) += 1); if (old + 1 != a) printf("bug!\n"); return 0; } /*OK: Correct switch */ int foo(int i) { switch (i) case 0: case 1: ; return 0; } /*KO: Wrong Order of declaration after pretty printing */ extern int base_files[]; const char *const lang_dir_names[] = { "c" }; int base_files[sizeof (lang_dir_names) / sizeof (lang_dir_names[0])]; /*OK: no visible problem. */ struct record { int references; char buffer[1]; }; typedef struct { char * base; } buffer; int bar(int flags ) { return ((flags & (0x0004)) ? __builtin_offsetof (struct record, buffer[0]) : __builtin_offsetof (struct record, references)); } /*OK: $ in identifiers */ static void foo$bar() { } /*OK: typdef void */ typedef void tVoid; int pimInit(void); int pimInit(tVoid) { return 1; } /*KO: conditional intializers */ #if 0 typedef long int time_t; struct time_t_is_integer { char a[(((time_t) 1.5 == 1)) ? 1 : -1]; }; #endif #if 0 /*KO: complex array size */ int mySize(void) {return 1;} int main1(void) { union { int x; char a[mySize() * 2]; } u; u.a[0]++; return 1; } #endif /*OK: packed attribute prettun printing*/ typedef enum { MFT_RECORD_IN_USE = (0x0001), MFT_RECORD_IS_DIRECTORY = (0x0002), MFT_REC_SPACE_FILLER = 0xffff } __attribute__ ((__packed__)) MFT_RECORD_FLAGS; MFT_RECORD_FLAGS foo1; /*OK: packed attribute parsing */ struct __attribute__ ((__packed__)) s; typedef struct { int x1; short x2; short x3; } __attribute__ ((__packed__)) s; s foo2; /*OK: pretty print an unused label */ void foo3(int z) { int i; for (i=0; i<10; i++) { z++; if (z < 5) continue; else break; } } /*OK: local pragma */ void foo4() { #pragma TCS_atomic printf("hello!"); } /* OK: bitfields */ typedef struct { int free : 1; int counter : 3; } __attribute__ ((packed)) tpsn_node_t; typedef struct { tpsn_node_t tpsn_node[7]; } __attribute__ ((packed)) app_state_t; int foo5() { app_state_t s; s.tpsn_node[0].counter--; return 0; } /*OK: constfold attributes */ struct swsusp_info { unsigned long num_physpages; int cpus; unsigned long image_pages; unsigned long pages; unsigned long size; } __attribute__((aligned((1UL << 12)))); struct swsusp_info foo6; /*OK: attribute on label */ int tcf_exts_dump() { goto rtattr_failure; return 0; rtattr_failure: __attribute__ ((unused)) return -1; } /*OK: Empty attribute */ int strnvis(char *, const char *, size_t, int) __attribute__ (()) {return 1;} /*OK: Compound initializer share statements */ struct bars { int x; }; struct foos { struct bars b; int y; }; int rand(void); void foo7(void) { int t = rand(); struct foos f = { .b = { .x = (t?2:3), }, .y = 42 }; return; } /*OK: Missing cast */ #include <stdio.h> #include <stdlib.h> int foo8(void) { char *p; int i; p = malloc(2*sizeof(int)); *(int *)p = 1; *((int *)p + 1) = 2; i = *((int *)p)++; printf("%d\n", i); i = *((int *)p)++; printf("%d\n", i); return 0; } /*OK: tricky assigns with cast */ typedef struct tTestStructX { int x; } tTestStructX; typedef struct tTestStruct { tTestStructX x; int a; int b; struct tTestStruct* ptr; char c; short int x16; int x32; } tTestStruct; typedef struct tTestStruct2 { tTestStructX x; int a; int b; struct tTestStruct2* ptr; char c; short int x16; int x32; } tTestStruct2; void testaccess2(void) { tTestStruct *p = NULL; int z; tTestStruct t2; tTestStruct *p2 = &t2; p = (tTestStruct *) modMalloc(sizeof(tTestStruct), 0); p->ptr = NULL; (tTestStructX*) p2->ptr = (tTestStructX*) p; } /*OK: typeOf problem */ struct foo10 { int x; }; struct foo10 foof(int y) { return (struct foo10) { y } ; } int goo(int z) { __typeof__(foof(3)) a = foof(3); if (a.x == z) return 1; return 0; } /*OK: complexity problem in conditionals */ extern __attribute__((const, noreturn)) int ____ilog2_NaN(void); int __ilog2_u32(int n); int __ilog2_u64(int n); #define ilog2(n) \ ( \ __builtin_constant_p(n) ? ( \ (n) < 1 ? ____ilog2_NaN() : \ (n) & (1ULL << 63) ? 63 : \ (n) & (1ULL << 62) ? 62 : \ (n) & (1ULL << 61) ? 61 : \ (n) & (1ULL << 60) ? 60 : \ (n) & (1ULL << 59) ? 59 : \ (n) & (1ULL << 58) ? 58 : \ (n) & (1ULL << 57) ? 57 : \ (n) & (1ULL << 56) ? 56 : \ (n) & (1ULL << 55) ? 55 : \ (n) & (1ULL << 54) ? 54 : \ (n) & (1ULL << 53) ? 53 : \ (n) & (1ULL << 52) ? 52 : \ (n) & (1ULL << 51) ? 51 : \ (n) & (1ULL << 50) ? 50 : \ (n) & (1ULL << 49) ? 49 : \ (n) & (1ULL << 48) ? 48 : \ (n) & (1ULL << 47) ? 47 : \ (n) & (1ULL << 46) ? 46 : \ (n) & (1ULL << 45) ? 45 : \ (n) & (1ULL << 44) ? 44 : \ (n) & (1ULL << 43) ? 43 : \ (n) & (1ULL << 42) ? 42 : \ (n) & (1ULL << 41) ? 41 : \ (n) & (1ULL << 40) ? 40 : \ (n) & (1ULL << 39) ? 39 : \ (n) & (1ULL << 38) ? 38 : \ (n) & (1ULL << 37) ? 37 : \ (n) & (1ULL << 36) ? 36 : \ (n) & (1ULL << 35) ? 35 : \ (n) & (1ULL << 34) ? 34 : \ (n) & (1ULL << 33) ? 33 : \ (n) & (1ULL << 32) ? 32 : \ (n) & (1ULL << 31) ? 31 : \ (n) & (1ULL << 30) ? 30 : \ (n) & (1ULL << 29) ? 29 : \ (n) & (1ULL << 28) ? 28 : \ (n) & (1ULL << 27) ? 27 : \ (n) & (1ULL << 26) ? 26 : \ (n) & (1ULL << 25) ? 25 : \ (n) & (1ULL << 24) ? 24 : \ (n) & (1ULL << 23) ? 23 : \ (n) & (1ULL << 22) ? 22 : \ (n) & (1ULL << 21) ? 21 : \ (n) & (1ULL << 20) ? 20 : \ (n) & (1ULL << 19) ? 19 : \ (n) & (1ULL << 18) ? 18 : \ (n) & (1ULL << 17) ? 17 : \ (n) & (1ULL << 16) ? 16 : \ (n) & (1ULL << 15) ? 15 : \ (n) & (1ULL << 14) ? 14 : \ (n) & (1ULL << 13) ? 13 : \ (n) & (1ULL << 12) ? 12 : \ (n) & (1ULL << 11) ? 11 : \ (n) & (1ULL << 10) ? 10 : \ (n) & (1ULL << 9) ? 9 : \ (n) & (1ULL << 8) ? 8 : \ (n) & (1ULL << 7) ? 7 : \ (n) & (1ULL << 6) ? 6 : \ (n) & (1ULL << 5) ? 5 : \ (n) & (1ULL << 4) ? 4 : \ (n) & (1ULL << 3) ? 3 : \ (n) & (1ULL << 2) ? 2 : \ (n) & (1ULL << 1) ? 1 : \ (n) & (1ULL << 0) ? 0 : \ ____ilog2_NaN() \ ) : \ (sizeof(n) <= 4) ? \ __ilog2_u32(n) : \ __ilog2_u64(n) \ ) void foo11(int n) { int x = ilog2(20); } #if 0 /*KO: local struct */ int foo12() { { struct B; struct B { double d; }; { struct B; extern void bar(struct B d); struct B { int k; short h; }; struct B p = { 1, 2}; bar(p); } } return 0; } #endif /*OK: Huge constants */ enum { HUGE_BYTES = (18446744073709551615ULL) == (127 * 2 + 1) }; void foo13() { int x = HUGE_BYTES; } /*OK: permutation of typedefs */ typedef volatile int mytype_t; /* line 1 */ typedef int volatile mytype_t; /* line 2 */ mytype_t my; typedef struct ATTR {int len;} attr; typedef attr *pattr; typedef struct TUPLEDESC {pattr *attrs;} *t; int foo14(t desc) { pattr *att = desc->attrs; return att[0]->len; } /*OK: Large constant */ void foo15 (unsigned long long f); int foo16 (int argc, char **argv) { foo15 (0xFFFFFFFFFFFFFFFFULL); // Should be 16 F's return 0; } void foo17 (unsigned long long f) { } /*KO: duplicate labels */ int foo18(int a) { int x = 0, y = 1; (a ? x : y) = ({ 2; goto l ; l: 3;}); return x; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/long_neg_cdiv.i������������������������������������������������������0000666�0000000�0000000�00000000227�13571573400�016074� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// checks that division with longs in constfold rounds towards zero void main() { int t1 = (int)(-1/2L) ? 0 : 1; int t2 = (int)(-1/2LL) ? 0 : 1; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/merge.c��������������������������������������������������������������0000666�0000000�0000000�00000000072�13571573400�014366� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: tests/cil/merge2.c -print */ int x; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/merge2.c�������������������������������������������������������������0000666�0000000�0000000�00000000075�13571573400�014453� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: tests/cil/merge.c -print */ int x =2; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/mkBinOp.i������������������������������������������������������������0000666�0000000�0000000�00000000644�13571573400�014641� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print -constfold */ int main(void) { /* test Cil.constFoldBinOp called by mkBinOp for '%': the sign of the result is the sign of the divident */ int res = 3 % 2 == -1; // 0 res = 3 % -2 == -1; // 0 res = -3 % 2 == 1; // 0 res = -3 % -2 == 1; // 0 return res; } ��������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/mkBinOp.ml�����������������������������������������������������������0000666�0000000�0000000�00000001547�13571573400�015024� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_datatype open Cil let loc = Location.unknown let null () = let e = zero ~loc in mkCast ~force:true ~e ~newt:voidPtrType let inull () = let e = zero ~loc in mkCast ~force:true ~e ~newt:intPtrType let cone () = let e = one ~loc in mkCast ~force:true ~e ~newt:charPtrType let ione () = let e = one ~loc in mkCast ~force:true ~e ~newt:intPtrType let test = let n = ref 0 in fun e1 e2 -> incr n; let e = Cil.mkBinOp ~loc Cil_types.Eq (e1 ()) (e2 ()) in Format.printf "TEST %d: %a@." !n Exp.pretty e; let e = Cil.mkBinOp_safe_ptr_cmp ~loc Cil_types.Eq (e1()) (e2()) in Format.printf "TEST %d (safe ptr cmp): %a@." !n Exp.pretty e let main () = test null null; test null inull; test inull null; test null cone; test cone null; test cone cone; test cone ione; test ione cone let () = Db.Main.extend main ���������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/ocaml32bits3_11_0.i��������������������������������������������������0000666�0000000�0000000�00000000132�13571573400�016217� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������enum { OK=0x1111EEEEu, KO=0x99996666u, // fixed bug of Ocaml 32bits 3.11.0 } v ; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/��������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014371� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/acsl-comments.res.oracle��������������������������������������0000666�0000000�0000000�00000000556�13571573400�021123� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/acsl-comments.i (no preprocessing) [kernel:annot-error] tests/cil/acsl-comments.i:1: Warning: lexical error, unexpected block-comment opening [kernel] User Error: warning annot-error treated as fatal error. [kernel] User Error: stopping on file "tests/cil/acsl-comments.i" that has errors. [kernel] Frama-C aborted: invalid user input. ��������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/annot.res.oracle����������������������������������������������0000666�0000000�0000000�00000000533�13571573400�017470� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/annot.c (with preprocessing) /* Generated by Frama-C */ int fact(int n) { int r = 1; while (n > 0) { int tmp; /*@ assert n > 0; */ ; before: { /* sequence */ tmp = n; n --; r *= tmp; } /*@ assert r ≡ \at(r * n,before); */ ; } return r; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/branch.res.oracle���������������������������������������������0000666�0000000�0000000�00000000557�13571573400�017614� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/branch.c (with preprocessing) /* Generated by Frama-C */ int f(int a, int b) { int __retres; if (a < b) { int tmp; tmp = a; a ++; ; __retres = tmp; goto return_label; } else { int tmp_0; tmp_0 = b; b --; ; __retres = tmp_0; goto return_label; } return_label: return __retres; } �������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/bts297.res.oracle���������������������������������������������0000666�0000000�0000000�00000000613�13571573400�017402� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/bts297.c (with preprocessing) [kernel] tests/cil/bts297.c:4: Warning: Body of function abrupt falls-through. Adding a return statement /* Generated by Frama-C */ int abrupt(int x) { int __retres; while (x > 0) /*@ requires \true; ensures x ≡ 3; */ if (x) x ++; /*@ assert missing_return: \false; */ ; __retres = 0; return __retres; } ���������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/bts882.res.oracle���������������������������������������������0000666�0000000�0000000�00000000565�13571573400�017410� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/bts882.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/cil/bts882.i:8: Warning: Calling undeclared function f. Old style K&R code? /* Generated by Frama-C */ extern int ( /* missing proto */ f)(int x_0); void main(void) { int r; switch (1) { case 2: r = f(1); break; default: break; } return; } �������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/bts892.res.oracle���������������������������������������������0000666�0000000�0000000�00000000433�13571573400�017403� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/bts892.i (no preprocessing) [kernel] tests/cil/bts892.i:11: User Error: Forbidden access to local variable i in static initializer [kernel] User Error: stopping on file "tests/cil/bts892.i" that has errors. [kernel] Frama-C aborted: invalid user input. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/change_formals.0.res.oracle�����������������������������������0000666�0000000�0000000�00000000407�13571573400�021457� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/change_formals.c (with preprocessing) [test] current prj = project "test" [test] current prj = project "test" /* Generated by Frama-C */ int f(int x, int ok) { return x; } int g(int ok) { int tmp; tmp = f(0,0); return tmp; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/change_formals.1.res.oracle�����������������������������������0000666�0000000�0000000�00000000324�13571573400�021456� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/change_formals.c (with preprocessing) [test] current prj = project "test" /* Generated by Frama-C */ int f(int x, int ok); int g(int ok) { int tmp; tmp = f(0,0); return tmp; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/change_formals.2.res.oracle�����������������������������������0000666�0000000�0000000�00000000436�13571573400�021463� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/change_formals.c (with preprocessing) [test] current prj = project "test" [test] current prj = project "test" /* Generated by Frama-C */ int f(int x, int ok); int f(int x, int ok) { return x; } int g(int ok) { int tmp; tmp = f(0,0); return tmp; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/change_to_instr.res.oracle������������������������������������0000666�0000000�0000000�00000000566�13571573400�021525� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/change_to_instr.i (no preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; ; int i = 0; /*@ ghost ; */ /*@ ghost int j = 0; */ ; i ++; /*@ ghost ; */ /*@ ghost j ++; */ { /*@ ghost ; */ /*@ ghost int x = 0; */ /*@ ghost ; */ /*@ ghost x ++; */ } ; __retres = 0; return __retres; } ������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/comments.res.oracle�������������������������������������������0000666�0000000�0000000�00000002527�13571573400�020203� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/comments.c (with preprocessing) /* Generated by Frama-C */ /* run.config OPT: -print -keep-comments */ /* ABC */ void f(void) { return; } /* ABD/*FOO*/ */ /* ABC */ /* ABC */ /*@ requires \true; */ void g(void) { /*@ ghost int x = 0; */ /* ghost_comment */ return; } int bts_2176(void) { int r = 0; int i = 0; /* comment 1 */ /* comment 2 */ r = 1; i = 0; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_12_loop: ; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_11_loop: ; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_10_loop: ; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_9_loop: ; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_8_loop: ; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_7_loop: ; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_6_loop: ; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_5_loop: ; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_4_loop: ; if (! (i < 10)) goto unrolling_2_loop; r ++; i ++; unrolling_3_loop: ; /*@ loop pragma UNROLL 10; loop pragma UNROLL "done", 10; */ while (i < 10) { r ++; i ++; } unrolling_2_loop: ; return r; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/cpu_a.res.oracle����������������������������������������������0000666�0000000�0000000�00000000475�13571573400�017445� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/cpu_a.c (with preprocessing) [kernel] Parsing tests/cil/cpu_b.c (with preprocessing) /* Generated by Frama-C */ typedef unsigned short DWORD; DWORD f(void) { DWORD __retres; __retres = (unsigned short)0; return __retres; } DWORD g(void) { DWORD tmp; tmp = f(); return tmp; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/cpu_b.res.oracle����������������������������������������������0000666�0000000�0000000�00000000513�13571573400�017437� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/cpu_b.c (with preprocessing) [kernel] Parsing tests/cil/cpu_a.c (with preprocessing) /* Generated by Frama-C */ typedef unsigned int DWORD; DWORD f(void); DWORD g(void) { DWORD tmp; tmp = f(); return tmp; } DWORD f(void) { DWORD __retres; __retres = (unsigned short)0; return __retres; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/digraphs_c99.res.oracle���������������������������������������0000666�0000000�0000000�00000000476�13571573400�020644� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/digraphs_c99.c (with preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; int d1; int d2; int a[5] = {2, 1, 0}; char *s = (char *)"a<:"; char *b = (char *)"(a[0])"; char *c = (char *)"(a<:0:>)"; d1 = 7; d2 = 9; __retres = a[4]; return __retres; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/duplicate-labels.res.oracle�����������������������������������0000666�0000000�0000000�00000000702�13571573400�021561� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/duplicate-labels.c (with preprocessing) /* Generated by Frama-C */ int foo18(int a) { int x = 0; int y = 1; goto l; l: ; x = 3; goto l; return x; } void foo(int z) { int i; i = 0; while (i < 10) { __Cont: z ++; if (z < 5) goto __Cont_0; else goto __Cont; __Cont_0: i ++; } return; } void f(void) { int i = 0; while_1_break: while (i < 10) i ++; goto while_1_break; return; } ��������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/empty_cond.res.oracle�����������������������������������������0000666�0000000�0000000�00000000217�13571573400�020511� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/empty_cond.c (with preprocessing) /* Generated by Frama-C */ int y; int z; void main(int x) { z ++; return; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/insert_formal.res.oracle��������������������������������������0000666�0000000�0000000�00000003660�13571573400�021221� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/insert_formal.i (no preprocessing) /* Generated by Frama-C */ void void_circumflex(int x) { return; } void void_circumflex_g(void) /*@ ghost (int x) */ { return; } void void_dollar(int x) { return; } void void_dollar_g(void) /*@ ghost (int x) */ { return; } void a_circumflex(int x, int a) { return; } void a_dollar(int a, int x) { return; } void a_circumflex_g(int a) /*@ ghost (int x) */ { return; } void a_dollar_g(int a) /*@ ghost (int x) */ { return; } void a_a(int a, int x) { return; } void ghost_a_circumflex(int x) /*@ ghost (int a) */ { return; } void ghost_a_dollar(int x) /*@ ghost (int a) */ { return; } void ghost_a_circumflex_g(void) /*@ ghost (int x, int a) */ { return; } void ghost_a_dollar_g(void) /*@ ghost (int a, int x) */ { return; } void ghost_a_a(void) /*@ ghost (int a, int x) */ { return; } void a_b_c_a(int a, int x, int b, int c) { return; } void b_a_c_a(int b, int a, int x, int c) { return; } void all_ghost_a_b_c_a(void) /*@ ghost (int a, int x, int b, int c) */ { return; } void all_ghost_b_a_c_a(void) /*@ ghost (int b, int a, int x, int c) */ { return; } void a_ghost_b_c_a(int a, int x) /*@ ghost (int b, int c) */ { return; } void b_ghost_a_c_a(int b) /*@ ghost (int a, int x, int c) */ { return; } /*@ ghost void g_void_circumflex(int x) { return; } */ /*@ ghost void g_void_dollar(int x) { return; } */ /*@ ghost void g_a_circumflex(int x, int a) { return; } */ /*@ ghost void g_a_dollar(int a, int x) { return; } */ /*@ ghost void g_a_a(int a, int x) { return; } */ /*@ ghost void g_a_b_c_a(int a, int x, int b, int c) { return; } */ /*@ ghost void g_b_a_c_a(int b, int a, int x, int c) { return; } */ ��������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/long_neg_cdiv.res.oracle��������������������������������������0000666�0000000�0000000�00000000225�13571573400�021144� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/long_neg_cdiv.i (no preprocessing) /* Generated by Frama-C */ void main(void) { int t1 = 1; int t2 = 1; return; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/merge.res.oracle����������������������������������������������0000666�0000000�0000000�00000000240�13571573400�017443� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/merge.c (with preprocessing) [kernel] Parsing tests/cil/merge2.c (with preprocessing) /* Generated by Frama-C */ int x; int x = 2; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/merge2.res.oracle���������������������������������������������0000666�0000000�0000000�00000000230�13571573400�017524� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/merge2.c (with preprocessing) [kernel] Parsing tests/cil/merge.c (with preprocessing) /* Generated by Frama-C */ int x = 2; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/mkBinOp.res.oracle��������������������������������������������0000666�0000000�0000000�00000001646�13571573400�017716� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/mkBinOp.i (no preprocessing) TEST 1: (void *)0 == (void *)0 TEST 1 (safe ptr cmp): (void *)0 == (void *)0 TEST 2: (void *)0 == (void *)0 TEST 2 (safe ptr cmp): (void *)0 == (void *)0 TEST 3: (int *)0 == (int *)0 TEST 3 (safe ptr cmp): (int *)0 == (int *)0 TEST 4: (char *)0 == (char *)1 TEST 4 (safe ptr cmp): (char *)0 == (char *)1 TEST 5: (char *)1 == (char *)0 TEST 5 (safe ptr cmp): (char *)1 == (char *)0 TEST 6: (char *)1 == (char *)1 TEST 6 (safe ptr cmp): (unsigned int)((char *)1) == (unsigned int)((char *)1) TEST 7: (unsigned int)((char *)1) == (unsigned int)((int *)1) TEST 7 (safe ptr cmp): (unsigned int)((char *)1) == (unsigned int)((int *)1) TEST 8: (unsigned int)((int *)1) == (unsigned int)((char *)1) TEST 8 (safe ptr cmp): (unsigned int)((int *)1) == (unsigned int)((char *)1) /* Generated by Frama-C */ int main(void) { int res = 0; res = 0; res = 0; res = 0; return res; } ������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/ocaml32bits3_11_0.res.oracle����������������������������������0000666�0000000�0000000�00000000271�13571573400�021275� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/ocaml32bits3_11_0.i (no preprocessing) /* Generated by Frama-C */ enum __anonenum_v_1 { OK = 0x1111EEEEu, KO = 0x99996666u }; enum __anonenum_v_1 v; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/overlap.res.oracle��������������������������������������������0000666�0000000�0000000�00000001420�13571573400�020015� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/overlap.c (with preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; int z[8]; int n = 8; { int i = 0; while (i < n) { int tmp; int tmp_0; int tmp_1; int tmp_2; int tmp_3; int tmp_4; first: { /* sequence */ tmp = i; i ++; tmp_0 = i; i ++; tmp_1 = i; i --; z[tmp] = z[tmp_0] + tmp_1; } last: { /* sequence */ tmp_2 = i; i ++; tmp_3 = i; i ++; tmp_4 = i; i --; z[tmp_2] = z[tmp_3] + tmp_4; } /*@ assert \at(0 ≤ i < n,first); */ ; /*@ assert \at(0 ≤ i < n,last); */ ; } } __retres = z[n - 1]; return __retres; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/queue_ghost_instr.res.oracle����������������������������������0000666�0000000�0000000�00000000660�13571573400�022121� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/queue_ghost_instr.i (no preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; ; int i = 0; /*@ ghost ; */ /*@ ghost int j = 0; */ ; i ++; /*@ ghost ; */ /*@ ghost j ++; */ { /*@ ghost ; */ /*@ ghost int x = 0; */ /*@ ghost ; */ /*@ ghost x ++; */ } ; if (i) ; /*@ ghost ; */ /*@ ghost if (j) ; */ ; __retres = 0; return __retres; } ��������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/oracle/union_to_union.res.oracle�������������������������������������0000666�0000000�0000000�00000000714�13571573400�021414� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/cil/union_to_union.i (no preprocessing) /* Generated by Frama-C */ union X { int a ; short b ; short c ; }; int main(void) { int __retres; union X u; union X v; union X w; union X x; int a; short b; union X __constr_expr_0 = u; v = __constr_expr_0; union X __constr_expr_1 = {.a = a}; w = __constr_expr_1; union X __constr_expr_2 = {.b = b}; x = __constr_expr_2; __retres = 0; return __retres; } ����������������������������������������������������frama-c-20.0-Calcium/tests/cil/overlap.c������������������������������������������������������������0000666�0000000�0000000�00000000414�13571573400�014737� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT:-print */ int main() { int n = 8 ; int z[8] ; for (int i=0;i<n;) { first: z[i++] = z[i++]+(i--) ; last: z[i++] = z[i++]+(i--) ; //@ assert \at( 0<=i<n , first ) ; //@ assert \at( 0<=i<n , last ) ; } return z[n-1]; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/queue_ghost_instr.i��������������������������������������������������0000666�0000000�0000000�00000000404�13571573400�017043� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -load-script tests/cil/queue_ghost_instr.ml -print */ int main(){ int i = 0 ; //@ ghost int j = 0 ; i++ ; //@ ghost j++ ; { //@ ghost int x = 0; //@ ghost x++ ; } if(i){ ; } /*@ ghost if(j){ } */ } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/queue_ghost_instr.ml�������������������������������������������������0000666�0000000�0000000�00000001051�13571573400�017222� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class add_skip = object(this) inherit Visitor.frama_c_inplace method! vfunc f = File.must_recompute_cfg f ; Cil.DoChildren method! vstmt s = let open Cil_types in begin match s.skind with | If(_) -> this#queueInstr([Skip(Cil.CurrentLoc.get())]) | _ -> () end ; Cil.DoChildren method! vinst _ = let open Cil_types in this#queueInstr([Skip(Cil.CurrentLoc.get())]) ; Cil.DoChildren end let run () = Visitor.visitFramacFileSameGlobals (new add_skip) (Ast.get()) let () = Db.Main.extend run ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/test_config����������������������������������������������������������0000666�0000000�0000000�00000000013�13571573400�015345� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������OPT:-print ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/cil/union_to_union.i�����������������������������������������������������0000666�0000000�0000000�00000000375�13571573400�016345� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������union X { int a; short b; short c; }; int main() { union X u,v,w,x; v = (union X) u; int a; // GCC extension. See https://gcc.gnu.org/onlinedocs/gcc/Cast-to-Union.html w = (union X) a; short b; x = (union X) b; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/����������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�016611� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/array_pointers.i������������������������������������0000666�0000000�0000000�00000000167�13571573400�022030� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-eva" */ void *p; void main() { void **q = &p+1; void **r = q+1; void *s = p + 1; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/bts-1787-bis.i��������������������������������������0000666�0000000�0000000�00000002231�13571573400�020730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -print -journal-disable STDOPT: STDOPT: +"-scf-allow-cast" */ typedef struct { int s; } S1_t; typedef struct { const S1_t* p1; S1_t* p2; S1_t* p3; } S2_t; struct { S1_t c12; S1_t c3; } G1; static S2_t const G2 = { &G1.c12, &G1.c12, &G1.c3 }; void h1(S2_t const* q) { S1_t *s1 = q->p1; // gcc warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] } void h2(S2_t const* q) { S1_t *s2 = (S1_t *)(q->p1); // same AST than h1 (cast explicited by the kernel) for the right-value } void h3(S2_t const* q) { S1_t *s3 = (S1_t *)G2.p1; } void h4(S2_t const* q) { S1_t *s5 = (S1_t const *)(& G1.c12); // gcc warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] } void h5(S2_t const* q) { S1_t *s6 = & G1.c12; // same AST than h4 (cast removed by the kernel) for the right-value } // The result for h1 to h5 can be &G1.c12 for both value of the option -scf-allow-cast int main(int c) { int s = c ? 1 : 2; G1.c12.s = s; h1(&G2); h2(&G2); h3(&G2); h4(&G2); h5(&G2); return G1.c3.s; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/bts-1787.i������������������������������������������0000666�0000000�0000000�00000001174�13571573400�020162� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-scf-allow-cast" STDOPT: */ typedef struct { int s; } S1_t; typedef struct { const S1_t* p1; S1_t* p2; S1_t* p3; } S2_t; struct { S1_t c12; S1_t c3; } G1; static S2_t const G2 = { &G1.c12, &G1.c12, &G1.c3 }; void g(S2_t const* q) { S1_t *s1 = (S1_t *)(q->p1); /* incorrect to inline because of const qualifier */ (*(q->p3)).s = (*(q->p1)).s + (*(q->p2)).s ; // (*(q->p1)).s += (*(q->p1)).s; /* statement to be rejected by the C typechecker */ s1->s = 3; } int main(int c) { int s = c ? 1 : 2; G1.c12.s = s; g(&G2); return G1.c3.s; } int a = 0; int b = a; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/bts117.c��������������������������������������������0000666�0000000�0000000�00000000604�13571573400�017776� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -journal-disable -print OPT: -journal-disable -semantic-const-folding @EVA_OPTIONS@ OPT: -journal-disable -sparecode-analysis @EVA_OPTIONS@ */ int main1 (void) { int r ; if (1) r = 0; else r = 2; return r; } int main2 (void){ int r = 1; if (r) r = 0; else r = 2; return r; } int main (void) { int x1 = main1(); int x2 = main2(); return x1 + x2; } ����������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/const_field_return_struct.i�������������������������0000666�0000000�0000000�00000000213�13571573400�024253� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-eva" */ struct S { const int f0; int f1; } T, U; struct S main(int c) { if (c) return T; return U; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/const_propagate.c�����������������������������������0000666�0000000�0000000�00000003054�13571573400�022147� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -eva @EVA_OPTIONS@ -deps -out -input -scf -journal-disable OPT: -scf @EVA_OPTIONS@ -cast-from-constant -semantic-const-fold add3 -main init -journal-disable */ int x,y,z; int TAB[10]; struct st { int a, b ; } s1, s2; typedef struct st ST ; void test_struct (void) { ST s = {0,1}; s1 = s ; s1.a++; s2.a = s1.a; s.a++; s2 = s; s.b--; } void test_tab (int v) { TAB[s1.b] = TAB[++s2.b]; int * r = &TAB[4]; *r = v; r[1] = v; char * q = (char *)r; *q = v; q[1] = v; int decal = sizeof(int); q[decal] = v; } int * test_ptr(int v) { int * p = &x ; char *s= (char *)p; *s = v; int decal = 1; s[decal] = v; s = ((char *)p) + decal; *s = v; *p = v; return &x; } int * test_struct_ptr(void) { int * q = &s1.b; return &s1.a ; } int add3 (int v1, int v2, int v3) { return v1 + v2 + v3; } int init (int v) { int zero = 0; int sept = 7; x = v; y = sept; z = add3 (x, y, zero); // TODO: add3(x, 7, 0); z = 12; int z1 = z ; return zero ; } unsigned long long ull; void test_ull () { ull = ull - 1L; } float f0, f1, f2, f3; double d0, d1, d2, d3; void test_float_double (void) { d1 = d0; d2 = d1 + d0; d3 = d2 + 1.0; f1 = f0; f2 = f1 + f0; f3 = f2 + 1.0; } void main(int a) { test_ull (); test_struct () ; test_struct_ptr () ; test_tab (13) ; test_float_double (); int b = init(5); // TODO: init(5); b = 0; z = add3 (a, 0, 0); int *p = test_ptr (y); //@ assert *p == 7 ; int *q = a?p:&y; int yy = *q; //@ assert a==0 ==> q==&y ; //@ assert *q == 7 ; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/declaration.c���������������������������������������0000666�0000000�0000000�00000000626�13571573400�021246� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -eva @EVA_OPTIONS@ -then -scf -then-on propagated -scf @EVA_OPTIONS@ */ void f(int *x, int *y, void (*p)(int *x, int *y)) { (*x)++; (*y)++; p(x, y); } void g(int *x, int *y, void (*p)(int *x, int *y)) { (*x)++; (*y)++; p(x, y); } extern int X; int Y = -42; void h(int *x, int *y) { *x += 2; *y += 5; } int main () { f(&X, &Y, h); g(&X, &Y, h); return Y; } ����������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/declaration2.c��������������������������������������0000666�0000000�0000000�00000000222�13571573400�021320� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: -eva @EVA_OPTIONS@ -scf -journal-disable */ void f(int *x) { (*x)++; } int main () { int Y = 42; f(&Y); return Y; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/enum.i����������������������������������������������0000666�0000000�0000000�00000000335�13571573400�017730� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: */ enum E { A, B, C, D }; int f(enum E e) { return e + 1; } int main (int c, unsigned u) { enum E x = A; int y = f(x); int z = f(D); int t = B + c; int v = C + u; return y+z+t+v; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/fct_ptr.i�������������������������������������������0000666�0000000�0000000�00000000215�13571573400�020422� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-then-on propagated" */ void (*pf)(void); void g() { pf (); } void f(void); int main() { pf = f; g(); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/introduction_of_non_explicit_cast.c�����������������0000666�0000000�0000000�00000002523�13571573400�025751� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -eva @EVA_OPTIONS@ -deps -journal-disable */ int x,y,z; int TAB[10]; struct st { int a, b ; } s1, s2; typedef struct st ST ; void test_struct (void) { ST s = {0,1}; s1 = s ; s1.a++; s2.a = s1.a; s.a++; s2 = s; s.b--; } void test_tab (int v) { TAB[s1.b] = TAB[++s2.b]; int * r = &TAB[4]; *r = v; r[1] = v; char * q = (char *)r; *q = v; q[1] = v; int decal = sizeof(int); q[decal] = v; } int * test_ptr(int v) { int * p = &x ; char *s= (char *)p; *s = v; int decal = 1; s[decal] = v; s = ((char *)p) + decal; *s = v; *p = v; return &x; } int * test_struct_ptr(void) { int * q = &s1.b; return &s1.a ; } int add3 (int v1, int v2, int v3) { return v1 + v2 + v3; } int init (int v) { int zero = 0; int sept = 7; x = v; y = sept; z = add3 (x, y, zero); // TODO: add3(x, 7, 0); z = 12; int z1 = z ; return zero ; } unsigned long long ull; void test_ull () { ull = ull - 1L; } void main(int a) { test_ull (); test_struct () ; test_struct_ptr () ; test_tab (13) ; int b = init(5); // TODO: init(5); b = 0; z = add3 (a, 0, 0); int *p = test_ptr (y); //@ assert *p == 7 ; int *q = a?p:&y; int yy = *q; //@ assert a==0 ==> q==&y ; //@ assert *q == 7 ; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/introduction_of_non_explicit_cast.ml����������������0000666�0000000�0000000�00000000536�13571573400�026141� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� let main _ = let all = Cil_datatype.Fundec.Set.empty in let new_proj = Constant_Propagation.Api.get all ~cast_intro:true in Project.on new_proj (fun () -> Kernel.CodeOutput.output (fun fmt -> Format.fprintf fmt "After Constant propagation :@.")) (); File.pretty_ast ~prj:new_proj ();; let () = Db.Main.extend main ������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/���������������������������������������������0000777�0000000�0000000�00000000000�13571573400�020056� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/array_pointers.res.oracle��������������������0000666�0000000�0000000�00000001522�13571573400�025076� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/array_pointers.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} [kernel] tests/constant_propagation/array_pointers.i:10: Warning: using size of 'void' [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: q ∈ {{ &p + {4} }} r ∈ {{ &p + {8} }} s ∈ {1} [scf] beginning constant propagation [kernel] tests/constant_propagation/array_pointers.i:10: Warning: using size of 'void' /* Generated by Frama-C */ void *p; void main(void) { void **q = & p + 1; void **r = & p + 2; void *s = p + 1; return; } [scf] constant propagation done ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/bts-1787-bis.0.res.oracle��������������������0000666�0000000�0000000�00000001773�13571573400�024152� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/bts-1787-bis.i (no preprocessing) /* Generated by Frama-C */ struct __anonstruct_S1_t_1 { int s ; }; typedef struct __anonstruct_S1_t_1 S1_t; struct __anonstruct_S2_t_2 { S1_t const *p1 ; S1_t *p2 ; S1_t *p3 ; }; typedef struct __anonstruct_S2_t_2 S2_t; struct __anonstruct_G1_3 { S1_t c12 ; S1_t c3 ; }; struct __anonstruct_G1_3 G1; static S2_t const G2 = {.p1 = (S1_t const *)(& G1.c12), .p2 = & G1.c12, .p3 = & G1.c3}; void h1(S2_t const *q) { S1_t *s1 = (S1_t *)q->p1; return; } void h2(S2_t const *q) { S1_t *s2 = (S1_t *)q->p1; return; } void h3(S2_t const *q) { S1_t *s3 = (S1_t *)G2.p1; return; } void h4(S2_t const *q) { S1_t *s5 = & G1.c12; return; } void h5(S2_t const *q) { S1_t *s6 = & G1.c12; return; } int main(int c) { int __retres; int tmp; if (c) tmp = 1; else tmp = 2; int s = tmp; G1.c12.s = s; h1(& G2); h2(& G2); h3(& G2); h4(& G2); h5(& G2); __retres = G1.c3.s; return __retres; } �����frama-c-20.0-Calcium/tests/constant_propagation/oracle/bts-1787-bis.1.res.oracle��������������������0000666�0000000�0000000�00000004167�13571573400�024153� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/bts-1787-bis.i (no preprocessing) [scf] beginning constant propagation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} G2{.p1; .p2} ∈ {{ (? *)&G1 }} .p3 ∈ {{ &G1.c3 }} [eva] computing for function h1 <- main. Called from tests/constant_propagation/bts-1787-bis.i:50. [eva] Recording results for h1 [eva] Done for function h1 [eva] computing for function h2 <- main. Called from tests/constant_propagation/bts-1787-bis.i:51. [eva] Recording results for h2 [eva] Done for function h2 [eva] computing for function h3 <- main. Called from tests/constant_propagation/bts-1787-bis.i:52. [eva] Recording results for h3 [eva] Done for function h3 [eva] computing for function h4 <- main. Called from tests/constant_propagation/bts-1787-bis.i:53. [eva] Recording results for h4 [eva] Done for function h4 [eva] computing for function h5 <- main. Called from tests/constant_propagation/bts-1787-bis.i:54. [eva] Recording results for h5 [eva] Done for function h5 [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ struct __anonstruct_S1_t_1 { int s ; }; typedef struct __anonstruct_S1_t_1 S1_t; struct __anonstruct_S2_t_2 { S1_t const *p1 ; S1_t *p2 ; S1_t *p3 ; }; typedef struct __anonstruct_S2_t_2 S2_t; struct __anonstruct_G1_3 { S1_t c12 ; S1_t c3 ; }; struct __anonstruct_G1_3 G1; static S2_t const G2 = {.p1 = (S1_t const *)(& G1.c12), .p2 = & G1.c12, .p3 = & G1.c3}; void h1(S2_t const *q) { S1_t *s1 = & G1.c12; return; } void h2(S2_t const *q) { S1_t *s2 = & G1.c12; return; } void h3(S2_t const *q) { S1_t *s3 = & G1.c12; return; } void h4(S2_t const *q) { S1_t *s5 = & G1.c12; return; } void h5(S2_t const *q) { S1_t *s6 = & G1.c12; return; } int main(int c) { int __retres; int tmp; if (c) tmp = 1; else tmp = 2; int s = tmp; G1.c12.s = s; h1(& G2); h2(& G2); h3(& G2); h4(& G2); h5(& G2); __retres = 0; return __retres; } [scf] constant propagation done ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/bts-1787-bis.2.res.oracle��������������������0000666�0000000�0000000�00000004167�13571573400�024154� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/bts-1787-bis.i (no preprocessing) [scf] beginning constant propagation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} G2{.p1; .p2} ∈ {{ (? *)&G1 }} .p3 ∈ {{ &G1.c3 }} [eva] computing for function h1 <- main. Called from tests/constant_propagation/bts-1787-bis.i:50. [eva] Recording results for h1 [eva] Done for function h1 [eva] computing for function h2 <- main. Called from tests/constant_propagation/bts-1787-bis.i:51. [eva] Recording results for h2 [eva] Done for function h2 [eva] computing for function h3 <- main. Called from tests/constant_propagation/bts-1787-bis.i:52. [eva] Recording results for h3 [eva] Done for function h3 [eva] computing for function h4 <- main. Called from tests/constant_propagation/bts-1787-bis.i:53. [eva] Recording results for h4 [eva] Done for function h4 [eva] computing for function h5 <- main. Called from tests/constant_propagation/bts-1787-bis.i:54. [eva] Recording results for h5 [eva] Done for function h5 [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ struct __anonstruct_S1_t_1 { int s ; }; typedef struct __anonstruct_S1_t_1 S1_t; struct __anonstruct_S2_t_2 { S1_t const *p1 ; S1_t *p2 ; S1_t *p3 ; }; typedef struct __anonstruct_S2_t_2 S2_t; struct __anonstruct_G1_3 { S1_t c12 ; S1_t c3 ; }; struct __anonstruct_G1_3 G1; static S2_t const G2 = {.p1 = (S1_t const *)(& G1.c12), .p2 = & G1.c12, .p3 = & G1.c3}; void h1(S2_t const *q) { S1_t *s1 = & G1.c12; return; } void h2(S2_t const *q) { S1_t *s2 = & G1.c12; return; } void h3(S2_t const *q) { S1_t *s3 = & G1.c12; return; } void h4(S2_t const *q) { S1_t *s5 = & G1.c12; return; } void h5(S2_t const *q) { S1_t *s6 = & G1.c12; return; } int main(int c) { int __retres; int tmp; if (c) tmp = 1; else tmp = 2; int s = tmp; G1.c12.s = s; h1(& G2); h2(& G2); h3(& G2); h4(& G2); h5(& G2); __retres = 0; return __retres; } [scf] constant propagation done ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/bts-1787.0.res.oracle������������������������0000666�0000000�0000000�00000002457�13571573400�023377� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/bts-1787.i (no preprocessing) [scf] beginning constant propagation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} a ∈ {0} b ∈ {0} G2{.p1; .p2} ∈ {{ (? *)&G1 }} .p3 ∈ {{ &G1.c3 }} [eva] computing for function g <- main. Called from tests/constant_propagation/bts-1787.i:39. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ struct __anonstruct_S1_t_1 { int s ; }; typedef struct __anonstruct_S1_t_1 S1_t; struct __anonstruct_S2_t_2 { S1_t const *p1 ; S1_t *p2 ; S1_t *p3 ; }; typedef struct __anonstruct_S2_t_2 S2_t; struct __anonstruct_G1_3 { S1_t c12 ; S1_t c3 ; }; struct __anonstruct_G1_3 G1; static S2_t const G2 = {.p1 = (S1_t const *)(& G1.c12), .p2 = & G1.c12, .p3 = & G1.c3}; void g(S2_t const *q) { S1_t *s1 = & G1.c12; G1.c3.s = G1.c12.s + G1.c12.s; G1.c12.s = 3; return; } int main(int c) { int __retres; int tmp; if (c) tmp = 1; else tmp = 2; int s = tmp; G1.c12.s = s; g(& G2); __retres = G1.c3.s; return __retres; } int a = 0; int b = a; [scf] constant propagation done �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/bts-1787.1.res.oracle������������������������0000666�0000000�0000000�00000002457�13571573400�023400� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/bts-1787.i (no preprocessing) [scf] beginning constant propagation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} a ∈ {0} b ∈ {0} G2{.p1; .p2} ∈ {{ (? *)&G1 }} .p3 ∈ {{ &G1.c3 }} [eva] computing for function g <- main. Called from tests/constant_propagation/bts-1787.i:39. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ struct __anonstruct_S1_t_1 { int s ; }; typedef struct __anonstruct_S1_t_1 S1_t; struct __anonstruct_S2_t_2 { S1_t const *p1 ; S1_t *p2 ; S1_t *p3 ; }; typedef struct __anonstruct_S2_t_2 S2_t; struct __anonstruct_G1_3 { S1_t c12 ; S1_t c3 ; }; struct __anonstruct_G1_3 G1; static S2_t const G2 = {.p1 = (S1_t const *)(& G1.c12), .p2 = & G1.c12, .p3 = & G1.c3}; void g(S2_t const *q) { S1_t *s1 = & G1.c12; G1.c3.s = G1.c12.s + G1.c12.s; G1.c12.s = 3; return; } int main(int c) { int __retres; int tmp; if (c) tmp = 1; else tmp = 2; int s = tmp; G1.c12.s = s; g(& G2); __retres = G1.c3.s; return __retres; } int a = 0; int b = a; [scf] constant propagation done �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/bts117.0.res.oracle��������������������������0000666�0000000�0000000�00000000530�13571573400�023212� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/bts117.c (with preprocessing) /* Generated by Frama-C */ int main1(void) { int r; r = 0; return r; } int main2(void) { int r = 1; if (r) r = 0; else r = 2; return r; } int main(void) { int __retres; int x1 = main1(); int x2 = main2(); __retres = x1 + x2; return __retres; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/bts117.1.res.oracle��������������������������0000666�0000000�0000000�00000001707�13571573400�023222� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/bts117.c (with preprocessing) [scf] beginning constant propagation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main1 <- main. Called from tests/constant_propagation/bts117.c:19. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/constant_propagation/bts117.c:20. [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ int main1(void) { int r; r = 0; return r; } int main2(void) { int r = 1; if (1) r = 0; else r = 2; return r; } int main(void) { int __retres; int x1 = main1(); int x2 = main2(); __retres = 0; return __retres; } [scf] constant propagation done ���������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/bts117.2.res.oracle��������������������������0000666�0000000�0000000�00000002512�13571573400�023216� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/bts117.c (with preprocessing) [sparecode] remove unused code... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main1 <- main. Called from tests/constant_propagation/bts117.c:19. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/constant_propagation/bts117.c:20. [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [pdg] done for function main [pdg] computing for function main2 [pdg] done for function main2 [pdg] computing for function main1 [pdg] done for function main1 [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int main1(void) { int r; r = 0; return r; } int main2(void) { int r; r = 0; return r; } int main(void) { int __retres; int x1 = main1(); int x2 = main2(); __retres = x1 + x2; return __retres; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/const_field_return_struct.res.oracle���������0000666�0000000�0000000�00000001403�13571573400�027327� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/const_field_return_struct.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T ∈ {0} U ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [scf] beginning constant propagation /* Generated by Frama-C */ struct S { int const f0 ; int f1 ; }; struct S T; struct S U; struct S main(int c) { struct S __retres; if (c) { __retres = T; goto return_label; } __retres = U; return_label: return __retres; } [scf] constant propagation done �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/const_propagate.0.res.oracle�����������������0000666�0000000�0000000�00000021235�13571573400�025366� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/const_propagate.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} TAB[0..9] ∈ {0} s1 ∈ {0} s2 ∈ {0} ull ∈ {0} f0 ∈ {0} f1 ∈ {0} f2 ∈ {0} f3 ∈ {0} d0 ∈ {0} d1 ∈ {0} d2 ∈ {0} d3 ∈ {0} [eva] computing for function test_ull <- main. Called from tests/constant_propagation/const_propagate.c:78. [eva] Recording results for test_ull [eva] Done for function test_ull [eva] computing for function test_struct <- main. Called from tests/constant_propagation/const_propagate.c:79. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_struct_ptr <- main. Called from tests/constant_propagation/const_propagate.c:80. [eva] Recording results for test_struct_ptr [eva] Done for function test_struct_ptr [eva] computing for function test_tab <- main. Called from tests/constant_propagation/const_propagate.c:81. [eva] Recording results for test_tab [eva] Done for function test_tab [eva] computing for function test_float_double <- main. Called from tests/constant_propagation/const_propagate.c:82. [eva] Recording results for test_float_double [eva] Done for function test_float_double [eva] computing for function init <- main. Called from tests/constant_propagation/const_propagate.c:84. [eva] computing for function add3 <- init <- main. Called from tests/constant_propagation/const_propagate.c:56. [eva] Recording results for add3 [eva] Done for function add3 [eva] Recording results for init [eva] Done for function init [eva] computing for function add3 <- main. Called from tests/constant_propagation/const_propagate.c:85. [eva] Recording results for add3 [eva] Done for function add3 [eva] computing for function test_ptr <- main. Called from tests/constant_propagation/const_propagate.c:87. [eva] Recording results for test_ptr [eva] Done for function test_ptr [eva] tests/constant_propagation/const_propagate.c:88: assertion got status valid. [eva:alarm] tests/constant_propagation/const_propagate.c:91: Warning: assertion got status unknown. [eva] tests/constant_propagation/const_propagate.c:92: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function add3: __retres ∈ [--..--] [eva:final-states] Values at end of function init: x ∈ {5} y ∈ {7} z ∈ {12} zero ∈ {0} sept ∈ {7} z1 ∈ {12} [eva:final-states] Values at end of function test_float_double: f1 ∈ {0} f2 ∈ {0} f3 ∈ {1.} d1 ∈ {0} d2 ∈ {0} d3 ∈ {1.} [eva:final-states] Values at end of function test_ptr: x ∈ {7} p ∈ {{ &x }} s ∈ {{ &x + {1} }} decal ∈ {1} __retres ∈ {{ &x }} [eva:final-states] Values at end of function test_struct: s1{.a; .b} ∈ {1} s2{.a; .b} ∈ {1} s.a ∈ {1} .b ∈ {0} [eva:final-states] Values at end of function test_struct_ptr: q ∈ {{ &s1.b }} __retres ∈ {{ &s1.a }} [eva:final-states] Values at end of function test_tab: TAB[0..3] ∈ {0} [4][bits 0 to 15]# ∈ {13} repeated %8 [4][bits 16 to 31]# ∈ {13}%32, bits 16 to 31 [5][bits 0 to 7] ∈ {13} [5][bits 8 to 31]# ∈ {13}%32, bits 8 to 31 [6..9] ∈ {0} s2.a ∈ {1} .b ∈ {2} r ∈ {{ &TAB[4] }} q ∈ {{ (char *)&TAB[4] }} decal ∈ {4} [eva:final-states] Values at end of function test_ull: ull ∈ {18446744073709551615} [eva:final-states] Values at end of function main: x ∈ {7} y ∈ {7} z ∈ [--..--] TAB[0..3] ∈ {0} [4][bits 0 to 15]# ∈ {13} repeated %8 [4][bits 16 to 31]# ∈ {13}%32, bits 16 to 31 [5][bits 0 to 7] ∈ {13} [5][bits 8 to 31]# ∈ {13}%32, bits 8 to 31 [6..9] ∈ {0} s1{.a; .b} ∈ {1} s2.a ∈ {1} .b ∈ {2} ull ∈ {18446744073709551615} f1 ∈ {0} f2 ∈ {0} f3 ∈ {1.} d1 ∈ {0} d2 ∈ {0} d3 ∈ {1.} b ∈ {0} p ∈ {{ &x }} q ∈ {{ &x ; &y }} yy ∈ {7} [scf] beginning constant propagation /* Generated by Frama-C */ struct st { int a ; int b ; }; typedef struct st ST; int x; int y; int z; int TAB[10]; struct st s1; struct st s2; void test_struct(void) { ST s = {.a = 0, .b = 1}; s1 = s; s1.a = 1; s2.a = 1; s.a = 1; s2 = s; s.b = 0; return; } void test_tab(int v) { s2.b = 2; TAB[1] = 0; int *r = & TAB[4]; TAB[4] = 13; TAB[5] = 13; char *q = (char *)(& TAB[4]); *q = (char)13; *(q + 1) = (char)13; int decal = 4; *(q + 4) = (char)13; return; } int *test_ptr(int v) { int *__retres; int *p = & x; char *s = (char *)(& x); *s = (char)7; int decal = 1; *(s + 1) = (char)7; s = (char *)(& x) + 1; *s = (char)7; x = 7; __retres = & x; return __retres; } int *test_struct_ptr(void) { int *__retres; int *q = & s1.b; __retres = & s1.a; return __retres; } int add3(int v1, int v2, int v3) { int __retres; __retres = (v1 + v2) + 0; return __retres; } int init(int v) { int zero = 0; int sept = 7; x = 5; y = 7; z = add3(5,7,0); int z1 = 12; return zero; } unsigned long long ull; void test_ull(void) { ull = 18446744073709551615ULL; return; } float f0; float f1; float f2; float f3; double d0; double d1; double d2; double d3; void test_float_double(void) { d1 = 0.; d2 = 0.; d3 = 1.; f1 = 0.f; f2 = 0.f; f3 = 1.f; return; } void main(int a) { int *tmp_1; test_ull(); test_struct(); test_struct_ptr(); test_tab(13); test_float_double(); int b = init(5); z = add3(a,0,0); int *p = test_ptr(7); /*@ assert *p ≡ 7; */ ; if (a) tmp_1 = & x; else tmp_1 = & y; int *q = tmp_1; int yy = 7; /*@ assert a ≡ 0 ⇒ q ≡ &y; */ ; /*@ assert *q ≡ 7; */ ; return; } [scf] constant propagation done [from] Computing for function add3 [from] Done for function add3 [from] Computing for function init [from] Done for function init [from] Computing for function test_float_double [from] Done for function test_float_double [from] Computing for function test_ptr [from] Done for function test_ptr [from] Computing for function test_struct [from] Done for function test_struct [from] Computing for function test_struct_ptr [from] Done for function test_struct_ptr [from] Computing for function test_tab [from] Done for function test_tab [from] Computing for function test_ull [from] Done for function test_ull [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function add3: \result FROM v1; v2; v3 [from] Function init: x FROM v y FROM \nothing z FROM v \result FROM \nothing [from] Function test_float_double: f1 FROM f0 f2 FROM f0 f3 FROM f0 d1 FROM d0 d2 FROM d0 d3 FROM d0 [from] Function test_ptr: x FROM v \result FROM \nothing [from] Function test_struct: s1 FROM \nothing s2 FROM \nothing [from] Function test_struct_ptr: \result FROM \nothing [from] Function test_tab: TAB[1] FROM TAB[2]; s1.b; s2.b [4..5] FROM v s2.b FROM s2.b [from] Function test_ull: ull FROM ull [from] Function main: x FROM \nothing y FROM \nothing z FROM a TAB[1] FROM TAB[2] [4..5] FROM \nothing s1 FROM \nothing s2 FROM \nothing ull FROM ull f1 FROM f0 f2 FROM f0 f3 FROM f0 d1 FROM d0 d2 FROM d0 d3 FROM d0 [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function add3: __retres [inout] Inputs for function add3: \nothing [inout] Out (internal) for function init: x; y; z; zero; sept; z1 [inout] Inputs for function init: x; y; z [inout] Out (internal) for function test_float_double: f1; f2; f3; d1; d2; d3 [inout] Inputs for function test_float_double: f0; f1; f2; d0; d1; d2 [inout] Out (internal) for function test_ptr: x; p; s; decal; __retres [inout] Inputs for function test_ptr: \nothing [inout] Out (internal) for function test_struct: s1; s2; s [inout] Inputs for function test_struct: s1.a [inout] Out (internal) for function test_struct_ptr: q; __retres [inout] Inputs for function test_struct_ptr: \nothing [inout] Out (internal) for function test_tab: TAB{[1]; [4..5]}; s2.b; r; q; decal [inout] Inputs for function test_tab: TAB[2]; s1.b; s2.b [inout] Out (internal) for function test_ull: ull [inout] Inputs for function test_ull: ull [inout] Out (internal) for function main: x; y; z; TAB{[1]; [4..5]}; s1; s2; ull; f1; f2; f3; d1; d2; d3; b; p; q; tmp_1; yy [inout] Inputs for function main: x; y; z; TAB[2]; s1; s2.b; ull; f0; f1; f2; d0; d1; d2 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/const_propagate.1.res.oracle�����������������0000666�0000000�0000000�00000005233�13571573400�025367� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/const_propagate.c (with preprocessing) [scf] beginning constant propagation [eva] Analyzing a complete application starting at init [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} TAB[0..9] ∈ {0} s1 ∈ {0} s2 ∈ {0} ull ∈ {0} f0 ∈ {0} f1 ∈ {0} f2 ∈ {0} f3 ∈ {0} d0 ∈ {0} d1 ∈ {0} d2 ∈ {0} d3 ∈ {0} [eva] computing for function add3 <- init. Called from tests/constant_propagation/const_propagate.c:56. [eva:alarm] tests/constant_propagation/const_propagate.c:48: Warning: signed overflow. assert v1 + v2 ≤ 2147483647; [eva] Recording results for add3 [eva] Done for function add3 [eva] Recording results for init [eva] done for function init /* Generated by Frama-C */ struct st { int a ; int b ; }; typedef struct st ST; int x; int y; int z; int TAB[10]; struct st s1; struct st s2; void test_struct(void) { ST s = {.a = 0, .b = 1}; s1 = s; (s1.a) ++; s2.a = s1.a; (s.a) ++; s2 = s; (s.b) --; return; } void test_tab(int v) { (s2.b) ++; TAB[s1.b] = TAB[s2.b]; int *r = & TAB[4]; *r = v; *(r + 1) = v; char *q = (char *)r; *q = (char)v; *(q + 1) = (char)v; int decal = (int)sizeof(int); *(q + decal) = (char)v; return; } int *test_ptr(int v) { int *__retres; int *p = & x; char *s = (char *)p; *s = (char)v; int decal = 1; *(s + decal) = (char)v; s = (char *)p + decal; *s = (char)v; *p = v; __retres = & x; return __retres; } int *test_struct_ptr(void) { int *__retres; int *q = & s1.b; __retres = & s1.a; return __retres; } int add3(int v1, int v2, int v3) { int __retres; /*@ assert Eva: signed_overflow: v1 + v2 ≤ 2147483647; */ __retres = (v1 + 7) + 0; return __retres; } int init(int v) { int zero = 0; int sept = 7; x = v; y = sept; z = add3(x,y,zero); int z1 = z; return zero; } unsigned long long ull; void test_ull(void) { ull -= (unsigned long long)1L; return; } float f0; float f1; float f2; float f3; double d0; double d1; double d2; double d3; void test_float_double(void) { d1 = d0; d2 = d1 + d0; d3 = d2 + 1.0; f1 = f0; f2 = f1 + f0; f3 = (float)((double)f2 + 1.0); return; } void main(int a) { int *tmp_1; test_ull(); test_struct(); test_struct_ptr(); test_tab(13); test_float_double(); int b = init(5); z = add3(a,0,0); int *p = test_ptr(y); /*@ assert *p ≡ 7; */ ; if (a) tmp_1 = p; else tmp_1 = & y; int *q = tmp_1; int yy = *q; /*@ assert a ≡ 0 ⇒ q ≡ &y; */ ; /*@ assert *q ≡ 7; */ ; return; } [scf] constant propagation done ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/declaration.res.oracle�����������������������0000666�0000000�0000000�00000010657�13571573400�024333� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/declaration.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ [--..--] Y ∈ {-42} [eva] computing for function f <- main. Called from tests/constant_propagation/declaration.c:27. [eva:alarm] tests/constant_propagation/declaration.c:6: Warning: signed overflow. assert *x + 1 ≤ 2147483647; [eva] computing for function h <- f <- main. Called from tests/constant_propagation/declaration.c:8. [eva:alarm] tests/constant_propagation/declaration.c:22: Warning: signed overflow. assert *x + 2 ≤ 2147483647; [eva] Recording results for h [eva] Done for function h [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/constant_propagation/declaration.c:28. [eva:alarm] tests/constant_propagation/declaration.c:12: Warning: signed overflow. assert *x + 1 ≤ 2147483647; [eva] computing for function h <- g <- main. Called from tests/constant_propagation/declaration.c:14. [eva] Recording results for h [eva] Done for function h [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function h: X ∈ [-2147483645..2147483647] Y ∈ {-36; -30} [eva:final-states] Values at end of function f: X ∈ [-2147483645..2147483647] Y ∈ {-36} [eva:final-states] Values at end of function g: X ∈ [-2147483642..2147483647] Y ∈ {-30} [eva:final-states] Values at end of function main: X ∈ [-2147483642..2147483647] Y ∈ {-30} [scf] beginning constant propagation /* Generated by Frama-C */ void h(int *x, int *y); int Y; extern int X; void f(int *x, int *y, void (*p)(int *x, int *y)) { /*@ assert Eva: signed_overflow: *x + 1 ≤ 2147483647; */ X ++; Y = -41; h(& X,& Y); return; } void g(int *x, int *y, void (*p)(int *x, int *y)) { /*@ assert Eva: signed_overflow: *x + 1 ≤ 2147483647; */ X ++; Y = -35; h(& X,& Y); return; } int Y = -42; void h(int *x, int *y) { /*@ assert Eva: signed_overflow: *x + 2 ≤ 2147483647; */ X += 2; Y += 5; return; } int main(void) { f(& X,& Y,& h); g(& X,& Y,& h); return Y; } [scf] constant propagation done [scf] beginning constant propagation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ [--..--] Y ∈ {-42} [eva] computing for function f <- main. Called from tests/constant_propagation/declaration.c:27. [eva:alarm] tests/constant_propagation/declaration.c:6: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] computing for function h <- f <- main. Called from tests/constant_propagation/declaration.c:8. [eva:alarm] tests/constant_propagation/declaration.c:22: Warning: signed overflow. assert X + 2 ≤ 2147483647; [eva] Recording results for h [eva] Done for function h [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/constant_propagation/declaration.c:28. [eva:alarm] tests/constant_propagation/declaration.c:12: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] computing for function h <- g <- main. Called from tests/constant_propagation/declaration.c:14. [eva] Recording results for h [eva] Done for function h [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ void h(int *x, int *y); int Y; extern int X; void f(int *x, int *y, void (*p)(int *x, int *y)) { /*@ assert Eva: signed_overflow: *x + 1 ≤ 2147483647; */ /*@ assert Eva: signed_overflow: X + 1 ≤ 2147483647; */ X ++; Y = -41; h(& X,& Y); return; } void g(int *x, int *y, void (*p)(int *x, int *y)) { /*@ assert Eva: signed_overflow: *x + 1 ≤ 2147483647; */ /*@ assert Eva: signed_overflow: X + 1 ≤ 2147483647; */ X ++; Y = -35; h(& X,& Y); return; } int Y = -42; void h(int *x, int *y) { /*@ assert Eva: signed_overflow: *x + 2 ≤ 2147483647; */ /*@ assert Eva: signed_overflow: X + 2 ≤ 2147483647; */ X += 2; Y += 5; return; } int main(void) { f(& X,& Y,& h); g(& X,& Y,& h); return Y; } [scf] constant propagation done, result is in project `propagated 2` ���������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/declaration2.res.oracle����������������������0000666�0000000�0000000�00000001472�13571573400�024410� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/declaration2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/constant_propagation/declaration2.c:9. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: Y ∈ {43} [eva:final-states] Values at end of function main: Y ∈ {43} [scf] beginning constant propagation /* Generated by Frama-C */ void f(int *x) { *x = 43; return; } int main(void) { int Y = 42; f(& Y); return Y; } [scf] constant propagation done ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/enum.res.oracle������������������������������0000666�0000000�0000000�00000003443�13571573400�023005� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/enum.i (no preprocessing) [scf] beginning constant propagation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/constant_propagation/enum.i:11. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/constant_propagation/enum.i:12. [eva] Recording results for f [eva] Done for function f [eva:alarm] tests/constant_propagation/enum.i:13: Warning: signed overflow. assert B + c ≤ 2147483647; [eva:alarm] tests/constant_propagation/enum.i:15: Warning: signed overflow. assert (int)(y + z) + t ≤ 2147483647; [eva:alarm] tests/constant_propagation/enum.i:15: Warning: signed overflow. assert -2147483648 ≤ (int)((int)(y + z) + t) + v; [eva:alarm] tests/constant_propagation/enum.i:15: Warning: signed overflow. assert (int)((int)(y + z) + t) + v ≤ 2147483647; [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ enum E { A = 0, B = 1, C = 2, D = 3 }; int f(enum E e) { int __retres; __retres = (int)(e + 1U); return __retres; } int main(int c, unsigned int u) { int __retres; enum E x = A; int y = f(0U); int z = f(D); /*@ assert Eva: signed_overflow: B + c ≤ 2147483647; */ int t = B + c; int v = (int)(2U + u); /*@ assert Eva: signed_overflow: (int)(y + z) + t ≤ 2147483647; */ /*@ assert Eva: signed_overflow: -2147483648 ≤ (int)((int)(y + z) + t) + v; */ /*@ assert Eva: signed_overflow: (int)((int)(y + z) + t) + v ≤ 2147483647; */ __retres = (5 + t) + v; return __retres; } [scf] constant propagation done �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/fct_ptr.res.oracle���������������������������0000666�0000000�0000000�00000002101�13571573400�023470� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/fct_ptr.i (no preprocessing) [scf] beginning constant propagation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization pf ∈ {0} [eva] computing for function g <- main. Called from tests/constant_propagation/fct_ptr.i:15. [eva] computing for function f <- g <- main. Called from tests/constant_propagation/fct_ptr.i:8. [kernel:annot:missing-spec] tests/constant_propagation/fct_ptr.i:8: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ void (*pf)(void); /*@ assigns \nothing; */ void f(void); void g(void) { f(); return; } int main(void) { int __retres; pf = & f; g(); __retres = 0; return __retres; } [scf] constant propagation done ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/introduction_of_non_explicit_cast.res.oracle�0000666�0000000�0000000�00000015337�13571573400�031040� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/introduction_of_non_explicit_cast.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} TAB[0..9] ∈ {0} s1 ∈ {0} s2 ∈ {0} ull ∈ {0} [eva] computing for function test_ull <- main. Called from tests/constant_propagation/introduction_of_non_explicit_cast.c:68. [eva] Recording results for test_ull [eva] Done for function test_ull [eva] computing for function test_struct <- main. Called from tests/constant_propagation/introduction_of_non_explicit_cast.c:69. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_struct_ptr <- main. Called from tests/constant_propagation/introduction_of_non_explicit_cast.c:70. [eva] Recording results for test_struct_ptr [eva] Done for function test_struct_ptr [eva] computing for function test_tab <- main. Called from tests/constant_propagation/introduction_of_non_explicit_cast.c:71. [eva] Recording results for test_tab [eva] Done for function test_tab [eva] computing for function init <- main. Called from tests/constant_propagation/introduction_of_non_explicit_cast.c:73. [eva] computing for function add3 <- init <- main. Called from tests/constant_propagation/introduction_of_non_explicit_cast.c:57. [eva] Recording results for add3 [eva] Done for function add3 [eva] Recording results for init [eva] Done for function init [eva] computing for function add3 <- main. Called from tests/constant_propagation/introduction_of_non_explicit_cast.c:74. [eva] Recording results for add3 [eva] Done for function add3 [eva] computing for function test_ptr <- main. Called from tests/constant_propagation/introduction_of_non_explicit_cast.c:76. [eva] Recording results for test_ptr [eva] Done for function test_ptr [eva] tests/constant_propagation/introduction_of_non_explicit_cast.c:77: assertion got status valid. [eva:alarm] tests/constant_propagation/introduction_of_non_explicit_cast.c:80: Warning: assertion got status unknown. [eva] tests/constant_propagation/introduction_of_non_explicit_cast.c:81: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function add3: __retres ∈ [--..--] [eva:final-states] Values at end of function init: x ∈ {5} y ∈ {7} z ∈ {12} zero ∈ {0} sept ∈ {7} z1 ∈ {12} [eva:final-states] Values at end of function test_ptr: x ∈ {7} p ∈ {{ &x }} s ∈ {{ &x + {1} }} decal ∈ {1} __retres ∈ {{ &x }} [eva:final-states] Values at end of function test_struct: s1{.a; .b} ∈ {1} s2{.a; .b} ∈ {1} s.a ∈ {1} .b ∈ {0} [eva:final-states] Values at end of function test_struct_ptr: q ∈ {{ &s1.b }} __retres ∈ {{ &s1.a }} [eva:final-states] Values at end of function test_tab: TAB[0..3] ∈ {0} [4][bits 0 to 15]# ∈ {13} repeated %8 [4][bits 16 to 31]# ∈ {13}%32, bits 16 to 31 [5][bits 0 to 7] ∈ {13} [5][bits 8 to 31]# ∈ {13}%32, bits 8 to 31 [6..9] ∈ {0} s2.a ∈ {1} .b ∈ {2} r ∈ {{ &TAB[4] }} q ∈ {{ (char *)&TAB[4] }} decal ∈ {4} [eva:final-states] Values at end of function test_ull: ull ∈ {18446744073709551615} [eva:final-states] Values at end of function main: x ∈ {7} y ∈ {7} z ∈ [--..--] TAB[0..3] ∈ {0} [4][bits 0 to 15]# ∈ {13} repeated %8 [4][bits 16 to 31]# ∈ {13}%32, bits 16 to 31 [5][bits 0 to 7] ∈ {13} [5][bits 8 to 31]# ∈ {13}%32, bits 8 to 31 [6..9] ∈ {0} s1{.a; .b} ∈ {1} s2.a ∈ {1} .b ∈ {2} ull ∈ {18446744073709551615} b ∈ {0} p ∈ {{ &x }} q ∈ {{ &x ; &y }} yy ∈ {7} [from] Computing for function add3 [from] Done for function add3 [from] Computing for function init [from] Done for function init [from] Computing for function test_ptr [from] Done for function test_ptr [from] Computing for function test_struct [from] Done for function test_struct [from] Computing for function test_struct_ptr [from] Done for function test_struct_ptr [from] Computing for function test_tab [from] Done for function test_tab [from] Computing for function test_ull [from] Done for function test_ull [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function add3: \result FROM v1; v2; v3 [from] Function init: x FROM v y FROM \nothing z FROM v \result FROM \nothing [from] Function test_ptr: x FROM v \result FROM \nothing [from] Function test_struct: s1 FROM \nothing s2 FROM \nothing [from] Function test_struct_ptr: \result FROM \nothing [from] Function test_tab: TAB[1] FROM TAB[2]; s1.b; s2.b [4..5] FROM v s2.b FROM s2.b [from] Function test_ull: ull FROM ull [from] Function main: x FROM \nothing y FROM \nothing z FROM a TAB[1] FROM TAB[2] [4..5] FROM \nothing s1 FROM \nothing s2 FROM \nothing ull FROM ull [from] ====== END OF DEPENDENCIES ====== After Constant propagation : /* Generated by Frama-C */ struct st { int a ; int b ; }; typedef struct st ST; int x; int y; int z; int TAB[10]; struct st s1; struct st s2; void test_struct(void) { ST s = {.a = 0, .b = 1}; s1 = s; s1.a = 1; s2.a = 1; s.a = 1; s2 = s; s.b = 0; return; } void test_tab(int v) { s2.b = 2; TAB[1] = 0; int *r = & TAB[4]; TAB[4] = 13; TAB[5] = 13; char *q = (char *)(& TAB[4]); *((char *)(& TAB[4])) = (char)13; *((char *)(& TAB[4]) + 1) = (char)13; int decal = 4; *((char *)(& TAB[5])) = (char)13; return; } int *test_ptr(int v) { int *__retres; int *p = & x; char *s = (char *)(& x); *((char *)(& x)) = (char)7; int decal = 1; *((char *)(& x) + 1) = (char)7; s = (char *)(& x) + 1; *((char *)(& x) + 1) = (char)7; x = 7; __retres = & x; return __retres; } int *test_struct_ptr(void) { int *__retres; int *q = & s1.b; __retres = & s1.a; return __retres; } int add3(int v1, int v2, int v3) { int __retres; __retres = (v1 + v2) + 0; return __retres; } int init(int v) { int zero = 0; int sept = 7; x = 5; y = 7; z = add3(5,7,0); int z1 = 12; return zero; } unsigned long long ull; void test_ull(void) { ull = 18446744073709551615ULL; return; } void main(int a) { int *tmp_1; test_ull(); test_struct(); test_struct_ptr(); test_tab(13); int b = init(5); z = add3(a,0,0); int *p = test_ptr(7); /*@ assert *p ≡ 7; */ ; if (a) tmp_1 = & x; else tmp_1 = & y; int *q = tmp_1; int yy = 7; /*@ assert a ≡ 0 ⇒ q ≡ &y; */ ; /*@ assert *q ≡ 7; */ ; return; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/oracle/struct_field.res.oracle����������������������0000666�0000000�0000000�00000002265�13571573400�024531� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Parsing tests/constant_propagation/struct_field.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ {0} v ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p1 ∈ {{ &S.f0 }} p2 ∈ {{ &S.f1[0] }} p6 ∈ {{ &S.f1[4] }} pp ∈ {{ &p6 }} p11 ∈ {{ &S.f2[0].u1 }} p14 ∈ {{ &S.f2[1].u2.b }} p ∈ {{ &v.f2.c4 }} [scf] beginning constant propagation /* Generated by Frama-C */ struct st { int a ; int b ; }; union u { int u1 ; struct st u2 ; }; struct __anonstruct_S_1 { int f0 ; int f1[9] ; union u f2[3] ; }; struct s1 { char c1 ; int c2 ; }; struct s2 { int c3 ; char c4 ; }; union v { struct s1 f1 ; struct s2 f2 ; }; struct __anonstruct_S_1 S; union v v; void main(void) { int *p1 = & S.f0; int *p2 = & S.f1[0]; int *p6 = & S.f1[4]; int **pp = & p6; int *p11 = & S.f2[0].u1; int *p14 = & S.f2[1].u2.b; char *p = & v.f2.c4; return; } [scf] constant propagation done �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/constant_propagation/struct_field.i��������������������������������������0000666�0000000�0000000�00000000744�13571573400�021457� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config STDOPT: +"-eva" */ struct st { int a, b; } ; union u { int u1; struct st u2; } ; struct { int f0; int f1[9]; union u f2[3]; } S; /* specific test for union */ struct s1 { char c1; int c2; }; struct s2 { int c3; char c4; }; union v { struct s1 f1; struct s2 f2; }; union v v; void main() { int *p1 = &S; int *p2 = p1 + 1; int *p6 = p2 + 4; int **pp = &p6; int *p11 = *pp+5; int *p14 = p11+3; char *p = (char *) &v + 4; } ����������������������������frama-c-20.0-Calcium/tests/constant_propagation/test_config�����������������������������������������0000666�0000000�0000000�00000000051�13571573400�021034� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������OPT: -journal-disable -scf @EVA_OPTIONS@ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/crowbar/�����������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014014� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/crowbar/.merlin����������������������������������������������������������0000666�0000000�0000000�00000000020�13571573400�015273� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������PKG crowbar REC ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/crowbar/complete_type.ml�������������������������������������������������0000666�0000000�0000000�00000013077�13571573400�017227� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_types open Crowbar let loc = Cil_datatype.Location.unknown let field_name = let count = ref 0 in fun () -> let c = Char.chr(Char.code 'a' + (!count mod 26)) in incr count; String.make 1 c let type_name = let count = ref 0 in fun () -> let c = Char.chr(Char.code 'A' + (!count mod 26)) in let base = String.make 1 c in let res = if !count < 26 then base else base ^ "_" ^ (string_of_int (!count / 26)) in incr count; res type kind = Complete | FAM_array | FAM_struct | Incomplete (* pointers are always complete. *) let mk_ptr_type (is_gcc,typ, types,_) = (is_gcc,TPtr (typ,[]), types, Complete) let gen_length = choose [ const None; const (Some 0); const (Some 1); ] let mk_array_type (is_gcc, typ, types, kind) length = let kind = match kind, length with | Incomplete, _ -> Incomplete | FAM_array, _ -> Incomplete | FAM_struct, _ -> Incomplete | Complete, None -> FAM_array | Complete, Some 0 -> if is_gcc then FAM_array else Incomplete | Complete, Some _ -> Complete in let length = Extlib.opt_map (Cil.kinteger ~loc Cil.(theMachine.kindOfSizeOf)) length in (is_gcc, TArray (typ, length, { scache = Not_Computed }, []), types, kind) let mk_named_type (is_gcc, ttype, types, kind) = let tname = type_name () in let typedef = { torig_name = tname; tname; ttype; treferenced = true } in (is_gcc, TNamed(typedef,[]), GType(typedef, loc) :: types, kind) let mk_comp_type cstruct nb_fields (is_gcc, typ1, types1, kind1) (_, typ2, types2, kind2) = let mk_field ftype = let fname = field_name () in (fname, ftype, None, [], loc) in let mk_fields compinfo = match nb_fields with | 0 -> compinfo.cdefined <- false; [] | 1 -> compinfo.cdefined <- true; [ mk_field typ1 ] | _ -> compinfo.cdefined <- true; [ mk_field typ1; mk_field typ2 ] in let compinfo = Cil.mkCompInfo cstruct (type_name()) mk_fields [] in let kind = match cstruct, nb_fields, kind1, kind2 with | _, 0, _, _ -> Incomplete | _, _, Incomplete, _ -> Incomplete | _, _, FAM_struct, _ -> Incomplete | _, 1, Complete, _ -> Complete | true, 1, FAM_array, _ -> Incomplete | _, _, FAM_array, _ -> Incomplete | _, _, _, Incomplete -> Incomplete | _, _, _, FAM_struct -> Incomplete | true, _, Complete, FAM_array -> FAM_struct | _, _, _, FAM_array -> Incomplete | _, _, Complete, Complete -> Complete in let types = match nb_fields with | 0 -> [] | 1 -> types1 | _ -> types1 @ types2 in let glob = if nb_fields = 0 then GCompTagDecl (compinfo, loc) else GCompTag (compinfo,loc) in (is_gcc, TComp (compinfo, { scache = Not_Computed }, []), glob :: types, kind) let mk_enum_type is_def is_gcc = let ename = type_name () in let eihost = { eorig_name = ename; ename; eitems = []; eattr = []; ereferenced = true; ekind = IInt } in if is_def then begin let einame = field_name () in let eival = Cil.kinteger ~loc IInt 0 in let item = { eiorig_name = einame; einame; eival; eihost; eiloc = loc } in eihost.eitems <- [ item ] end; let glob = if is_def then GEnumTag(eihost,loc) else GEnumTagDecl(eihost,loc) in let kind = if is_def then Complete else Incomplete in (is_gcc, TEnum (eihost, []), [ glob ], kind) let gen_type = let open Crowbar in fix (fun gen_type -> choose [ map [bool] (fun is_gcc -> (is_gcc, TVoid [], [], Incomplete)); map [bool] (fun is_gcc -> (is_gcc, TInt (IInt, []), [], Complete)); map [ gen_type ] mk_ptr_type; map [ gen_type; gen_length ] mk_array_type; map [ gen_type ] mk_named_type; map [ bool; range 2; gen_type; gen_type ] mk_comp_type; map [ bool; bool ] mk_enum_type ]) let generate_failure_file is_complete = let count = ref 0 in let kind = if is_complete then "complete" else "incomplete" in fun (typ, types) -> incr count; let name = "test_case_" ^ kind ^ "_" ^ string_of_int !count ^ ".i" in let dirname = Filename.dirname Sys.executable_name in let name = Filepath.Normalized.of_string (dirname ^ "/" ^ name) in let out = open_out (name:>string) in let fmt = Format.formatter_of_out_channel out in let fundec = Cil.emptyFunction "f" in let s = Cil.mkPureExpr ~valid_sid:true ~fundec (Cil.new_exp ~loc (SizeOf typ)) in let b = Cil.mkBlock [ s ] in fundec.sbody <- b; let file = { fileName = name; globals = List.rev types @ [ GFun (fundec, loc) ]; globinit = None; globinitcalled = true } in Kernel.add_debug_keys Kernel.dkey_print_attrs; Format.fprintf fmt "%a@." Cil_printer.pp_file file; close_out out; Filepath.Normalized.to_pretty_string name let test (allowZeroSizeArrays, typ, types, kind) = match kind with | Complete | FAM_struct -> if not (Cil.isCompleteType ~allowZeroSizeArrays typ) then begin let filename = generate_failure_file true (typ, types) in Crowbar.fail ("isCompleteType declared as incomplete a complete type. \ See example in file '" ^ filename ^ "'.") end; true | Incomplete | FAM_array -> if Cil.isCompleteType typ then begin let filename = generate_failure_file false (typ, types) in Crowbar.fail ("isCompleteType declared as complate an incomplete type. \ See example in file '" ^ filename ^ "', which should trigger an error.") end; true let () = Crowbar.add_test ~name:"mutable typeOffset" [ gen_type ] @@ (fun x -> Crowbar.check (test x)) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/crowbar/input/�����������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015153� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/crowbar/input/testcase���������������������������������������������������0000666�0000000�0000000�00000000002�13571573400�016701� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������fo������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/crowbar/integer_bb_pretty.ml���������������������������������������������0000666�0000000�0000000�00000003523�13571573400�020060� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Crowbar let reparse v s = let failure info = Crowbar.fail ("Pretty-printing '" ^ (Z.to_string v) ^ "' returns '" ^ s ^ "'" ^ info) in if String.length s <= 2 then failure ""; let is_neg = s.[0] = '1' in let is_hex = s.[1] = 'x' in let s = String.(concat "" (split_on_char '_' s)) in let v' = if is_neg then begin let chr = if is_hex then 'F' else '1' in let module M = struct exception Found of int end in let check i c = if i > 1 && c <> chr then raise (M.Found i) in try String.iteri check s; Z.minus_one with M.Found idx -> let len, v' = if is_hex then begin let remains = String.sub s idx (String.length s - idx) in let v' = Z.of_string ("0x" ^ remains) in 4 * (String.length remains), v' end else begin let remains = String.sub s idx (String.length s - idx) in let v' = Z.of_string ("0b" ^ remains) in String.length remains, v' end in let m = Z.(one lsl len) in let m = Z.pred m in let v' = Z.logxor m v' in Z.pred (Z.lognot (Z.pred v')) end else Z.of_string s in if not (Z.equal v v') then failure (" reparsed as '" ^ Z.format "%b" v' ^ "' (" ^ Z.to_string v' ^ ")") let test z is_hex nbits has_sep = guard (nbits >= 0 && nbits <= 1024); let sep = if has_sep then Some "_" else None in let pp z = if is_hex then Integer.pp_hex ~nbits ?sep z else Integer.pp_bin ~nbits ?sep z in let s = Format.asprintf "%a" pp z in reparse z s let zarith = let open Crowbar in fix (fun zarith -> choose [ map [int64] Z.of_int64; map [zarith; int64] (fun z i -> Z.((z lsl 64) + of_int64 i)) ]) let () = Crowbar.add_test ~name:"pp_bin_hex" [ zarith; Crowbar.bool; Crowbar.int; Crowbar.bool ] test �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/crowbar/list_slice.ml����������������������������������������������������0000666�0000000�0000000�00000004234�13571573400�016503� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Crowbar let process_output_to_list2 = fun command -> let chan = Unix.open_process_in command in let res = ref ([] : string list) in let rec process_otl_aux () = let e = input_line chan in res := e::!res; process_otl_aux() in try process_otl_aux () with End_of_file -> let stat = Unix.close_process_in chan in (List.rev !res,stat) let cmd_to_list command = let (l,_) = process_output_to_list2 command in l let python_list_re = Str.regexp "\\[\\(-?[0-9]+ ?,? ?\\)*\\]" let python_elem_re = Str.regexp "\\(-?[0-9]+\\) ?,? ?" let parse_python_list s = if Str.string_match python_list_re s 0 then begin let n = ref 1 in let ls = ref [] in while Str.string_match python_elem_re s !n do let number = Str.matched_group 1 s in let i = int_of_string number in ls := i :: !ls; let matched_len = String.length (Str.matched_string s) in n := !n + matched_len; done; Some (List.rev !ls) end else None let pp_arg = Pretty_utils.pp_opt Format.pp_print_int let python_slice list first last = let input = Format.asprintf "[%a][%a:%a]" (Pretty_utils.pp_list ~sep:", " Format.pp_print_int) list pp_arg first pp_arg last in let cmd = Format.asprintf "python -c 'print(%s)'" input in let res = cmd_to_list cmd in parse_python_list (List.hd res) let test l first last = begin match python_slice l first last with | None -> Crowbar.fail ("could not parse python list slice") | Some oracle -> let result = Extlib.list_slice ?first ?last l in if oracle <> result then Crowbar.fail (Format.asprintf "oracle: [%a], result: [%a]" (Pretty_utils.pp_list ~sep:"; " Format.pp_print_int) oracle (Pretty_utils.pp_list ~sep:"; " Format.pp_print_int) result ) end; true let mk_arg = Crowbar.map [ Crowbar.option (Crowbar.range 20) ] (fun opt_x -> match opt_x with | None -> None | Some x -> Some (x - 10)) let gen_list = Crowbar.list (Crowbar.range 10000) let () = Crowbar.add_test ~name:"Extlib.list_slice" [ gen_list; mk_arg; mk_arg ] @@ (fun l first last -> Crowbar.check (test l first last)) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/crowbar/mutable.ml�������������������������������������������������������0000666�0000000�0000000�00000010770�13571573400�016004� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_types open Crowbar let field_name = let count = ref 0 in fun () -> let c = Char.chr(Char.code 'a' + (!count mod 26)) in incr count; String.make 1 c let struct_name = let count = ref 0 in fun () -> let c = Char.chr(Char.code 'A' + (!count mod 26)) in let base = String.make 1 c in let res = if !count < 26 then base else base ^ "_" ^ (string_of_int (!count / 26)) in incr count; res type attr_kind = NoAttr | Const | Mutable let attr_of_kind = function NoAttr | Const -> [] | Mutable -> [ Attr( Cil.frama_c_mutable, []) ] let tattr_of_kind = function NoAttr | Mutable -> [] | Const -> [ Attr ("const",[]) ] let merge_kind field_kind subobj_kind = match field_kind, subobj_kind with | _, NoAttr -> field_kind | _, Mutable -> Mutable | _, Const -> Const let gen_attr = choose [ const NoAttr; const Const; const Mutable ] let mk_type ftype attr = let tname = struct_name () in let fname = field_name () in let mk_type _ = [ fname, ftype, None, attr, Cil_datatype.Location.unknown ] in Cil.mkCompInfo true tname ~norig:tname mk_type [] let mk_int_type field_kind = let field_attr = attr_of_kind field_kind in let typ_attr = tattr_of_kind field_kind in [ mk_type (TInt (IInt, typ_attr)) field_attr ], field_kind let mk_composite_type field_kind (subtypes, subkind) = let field_attr = attr_of_kind field_kind in let typ_attr = tattr_of_kind field_kind in let subtype = List.hd subtypes in let kind = merge_kind field_kind subkind in let field_type = TComp (subtype, { scache = Not_Computed }, typ_attr) in (mk_type field_type field_attr) :: subtypes, kind let rec mk_offset { cfields } = let field = List.hd cfields in let offset = match field.ftype with TComp(comp,_,_) -> mk_offset comp | _ -> NoOffset in Field (field, offset) let gen_type = let open Crowbar in fix (fun gen_type -> choose [ map [ gen_attr ] mk_int_type; map [ gen_attr; gen_type ] mk_composite_type ]) let generate_failure_file is_const = let count = ref 0 in let kind = if is_const then "const" else "mutable" in let loc = Cil_datatype.Location.unknown in fun types -> incr count; let name = "test_case_" ^ kind ^ "_" ^ string_of_int !count ^ ".i" in let dirname = Filename.dirname Sys.executable_name in let name = Filepath.Normalized.of_string (dirname ^ "/" ^ name) in let out = open_out (name:>string) in let fmt = Format.formatter_of_out_channel out in let typ = List.hd types in let x = Cil.makeGlobalVar "x" (TComp (typ, { scache = Not_Computed }, [])) in let y = Cil.makeGlobalVar "y" (TInt (IInt,[])) in let lvx = Var x, mk_offset typ in let lvy = Var y, NoOffset in let lv, rv = if is_const then lvy, lvx else lvx, lvy in let instr = Set (lv, Cil.new_exp ~loc (Lval rv),loc) in let s = Cil.mkStmtOneInstr instr in let b = Cil.mkBlock [ s ] in let f = Cil.makeGlobalVar "f" (TFun (TVoid [], Some [], false, [])) in let fdef = { svar = f; sformals = []; slocals = []; smaxid = 0; sbody = b; smaxstmtid = None; sallstmts = [ s ]; sspec = Cil.empty_funspec () } in let file = { fileName = name; globals = List.rev_map (fun typ -> GCompTag (typ,loc)) types @ [ GVarDecl (x,loc); GVarDecl(y,loc); GFun (fdef, loc) ]; globinit = None; globinitcalled = true } in Kernel.add_debug_keys Kernel.dkey_print_attrs; Format.fprintf fmt "%a@." Cil_printer.pp_file file; close_out out; Filepath.Normalized.to_pretty_string name let test (types, kind) = let out_type = List.hd types in let offset = mk_offset out_type in let inner_type = Cil.typeOffset (TComp (out_type, { scache = Not_Computed }, [])) offset in match kind with | NoAttr | Mutable -> if Cil.typeHasAttribute "const" inner_type then begin let filename = generate_failure_file false types in Crowbar.fail ("typeOffset declared const a field that should have been mutable. \ See example in file '" ^ filename ^ "'.") end; true | Const -> if not (Cil.typeHasAttribute "const" inner_type) then begin let filename = generate_failure_file true types in Crowbar.fail ("typeOffset should have marked a field as const. \ See example in file '" ^ filename ^ "'.") end; true let () = Crowbar.add_test ~name:"mutable typeOffset" [ gen_type ] @@ (fun x -> Crowbar.check (test x)) ��������frama-c-20.0-Calcium/tests/crowbar/mutable_const_fail.ml��������������������������������������������0000666�0000000�0000000�00000000774�13571573400�020210� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_types let main () = Ast.compute (); let def = Kernel_function.get_definition (Globals.Functions.find_def_by_name "f") in let s = List.hd (def.sbody.bstmts) in match s.skind with | Instr (Set (_,{ enode = Lval (Var x,offset) },_)) -> Format.printf "Type of variable: %a@\nOffset: %a@." Printer.pp_typ x.vtype Printer.pp_offset offset; assert (Cil.typeHasAttribute "const" (Cil.typeOffset x.vtype offset)) | _ -> assert false let () = Db.Main.extend main ����frama-c-20.0-Calcium/tests/crowbar/mutable_mutable_fail.ml������������������������������������������0000666�0000000�0000000�00000000761�13571573400�020507� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_types let main () = Ast.compute (); let def = Kernel_function.get_definition (Globals.Functions.find_def_by_name "f") in let s = List.hd (def.sbody.bstmts) in match s.skind with | Instr (Set ((Var x,offset),_,_)) -> Format.printf "Type of variable: %a@\nOffset: %a@." Printer.pp_typ x.vtype Printer.pp_offset offset; assert (not (Cil.typeHasAttribute "const" (Cil.typeOffset x.vtype offset))) | _ -> assert false let () = Db.Main.extend main ���������������frama-c-20.0-Calcium/tests/crowbar/offset_anonymous_field.ml����������������������������������������0000666�0000000�0000000�00000015540�13571573400�021114� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Cil_types open Crowbar let field_name = let count = ref 0 in fun () -> let c = Char.chr(Char.code 'a' + (!count mod 26)) in incr count; String.make 1 c let anonFieldName = let count = ref 0 in fun () -> incr count; Format.sprintf "%s_%d" Cabs2cil.anonCompFieldName !count let struct_name = let count = ref 0 in fun () -> let c = Char.chr(Char.code 'A' + (!count mod 26)) in let base = String.make 1 c in let res = if !count < 26 then base else base ^ "_" ^ (string_of_int (!count / 26)) in incr count; res let mk_compinfo cstruct field1 field2 field3 = let tname = struct_name () in let mk_type _ = [ field1; field2; field3 ] in Cil.mkCompInfo cstruct tname ~norig:tname mk_type [] type result = { designator: string option; offsets: offset list Datatype.String.Map.t; mytype: Cil_types.typ; structs: compinfo list } let int_result = { designator = None; offsets = Datatype.String.Map.empty; mytype = TInt (IInt,[]); structs = [] } let mk_field { mytype } anon = let name = if anon then begin match mytype with | TComp (_, _, _) -> anonFieldName () | _ -> Cil.missingFieldName end else field_name () in name, mytype, None, [], Cil_datatype.Location.unknown let lift_offset cstruct res1 anon1 field1 res2 anon2 field2 res3 anon3 field3 = let add_offsets anon field name offsets acc = if (not cstruct) && Datatype.String.Map.mem name acc then acc else let old_offsets = match Datatype.String.Map.find_opt name acc with | None -> [] | Some l -> l in if anon then begin let offsets = List.map (fun o -> Field(field, o)) offsets in Datatype.String.Map.add name (old_offsets @ offsets) acc end else if field.fname = name then Datatype.String.Map.add name [Field(field, NoOffset)] acc else acc in let add_all_offsets anon field map acc = Datatype.String.Map.fold (add_offsets anon field) map acc in Datatype.String.Map.empty |> add_all_offsets anon1 field1 res1.offsets |> add_all_offsets anon2 field2 res2.offsets |> add_all_offsets anon3 field3 res3.offsets let lift_designator anon designator field = if anon then begin match designator with | None -> bad_test () | Some _ -> designator end else Some field.fname let mk_composite_type choice cstruct res1 anon1 res2 anon2 res3 anon3 = let field1 = mk_field res1 anon1 in let field2 = mk_field res2 anon2 in let field3 = mk_field res3 anon3 in let info = mk_compinfo cstruct field1 field2 field3 in let field1, field2, field3 = match info.cfields with | [ field1; field2; field3 ] -> field1, field2, field3 | _ -> bad_test() in let designator = match choice with | 0 -> lift_designator anon1 res1.designator field1 | 1 -> lift_designator anon2 res2.designator field2 | 2 -> lift_designator anon3 res3.designator field3 | _ -> bad_test() in let offsets = lift_offset cstruct res1 anon1 field1 res2 anon2 field2 res3 anon3 field3 in let mytype = TComp (info, { scache = Not_Computed }, []) in let structs = info :: res1.structs @ res2.structs @ res3.structs in { designator; mytype; structs; offsets } let rec mk_offset { cfields } = let field = List.hd cfields in let offset = match field.ftype with TComp(comp,_,_) -> mk_offset comp | _ -> NoOffset in Field (field, offset) let rec gen_type_l n = if n <= 0 then lazy (const int_result) else lazy (let open Crowbar in choose [ const int_result; map [ range 3; bool; gen_type (n-1); bool; gen_type (n-1); bool; gen_type (n-1); bool] mk_composite_type ]) and gen_type n = unlazy (gen_type_l n) let generate_failure_file = let count = ref 0 in let loc = Cil_datatype.Location.unknown in fun offset types -> incr count; let name = "test_case_" ^ string_of_int !count ^ ".i" in let dirname = Filename.dirname Sys.executable_name in let name = Filepath.Normalized.of_string (dirname ^ "/" ^ name) in let out = open_out (name:>string) in let fmt = Format.formatter_of_out_channel out in let typ = List.hd types in let x = Cil.makeGlobalVar "x" (TComp (typ, { scache = Not_Computed }, [])) in let lvx = Var x, offset in let typ = Cil.typeOfLval lvx in let init = Cil.makeZeroInit ~loc typ in let f = Cil.makeGlobalVar "f" (TFun (TVoid [], Some [], false, [])) in let fdef = { svar = f; sformals = []; slocals = []; smaxid = 0; sbody = Cil.mkBlock []; smaxstmtid = None; sallstmts = [ ]; sspec = Cil.empty_funspec () } in let y = Cil.makeLocalVar fdef "y" typ in let init_instr = Local_init (y, AssignInit init, loc) in let instr = Set (lvx, Cil.evar ~loc y,loc) in let s1 = Cil.mkStmtOneInstr init_instr in let s2 = Cil.mkStmtOneInstr instr in let b = Cil.mkBlock [ s1; s2 ] in fdef.sallstmts <- [ s1; s2 ]; fdef.sbody <- b; let file = { fileName = name; globals = List.rev_map (fun typ -> GCompTag (typ,loc)) types @ [ GVarDecl (x,loc); GFun (fdef, loc) ]; globinit = None; globinitcalled = true } in Kernel.add_debug_keys Kernel.dkey_print_attrs; Format.fprintf fmt "%a@." Cil_printer.pp_file file; close_out out; Filepath.Normalized.to_pretty_string name let test { designator; offsets; structs } = match structs with | [] -> bad_test () | comp :: _ -> (match designator with | None -> bad_test () | Some field -> let offset, expected = match Datatype.String.Map.find_opt field offsets with | None | Some [] -> bad_test () | Some (hd :: _ as l) -> hd, l in try let result = Cabs2cil.fieldsToInit comp designator in if List.length result <> List.length expected || not (List.for_all2 Cil_datatype.Offset.equal result expected) then begin let filename = generate_failure_file offset structs in let pp_sep fmt () = Format.pp_print_string fmt " " in Crowbar.fail (Format.asprintf "fieldsToInit didn't find appropriate offset for %s in %s.\n\ expected offsets were %a\n\ returned offsets are %a" field filename (Format.pp_print_list ~pp_sep Cil_printer.pp_offset) expected (Format.pp_print_list ~pp_sep Cil_printer.pp_offset) result) end with Log.AbortFatal _ -> let filename = generate_failure_file offset structs in Crowbar.fail ("fieldsToInit failed on the test given in file " ^ filename ^ ", for field " ^ field)) let () = Crowbar.add_test ~name:"designator and anonymous fields" [ gen_type 20 ] @@ test ����������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/�����������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014001� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/README�����������������������������������������������������������0000666�0000000�0000000�00000001350�13571573400�014660� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������This file is an empty file in order to test dynamic plugin engine. For this purpose, we test four part in this engine: I. Test path loading engine II. Test registering engine I. Test path loading engine In the dynamic plugin engine, we can add a path to load modules, but this path must be a directory path.So we tempt to add a file path and a unknown path in order to raise errors. We tempt to add a directory path to check if the engine runs. II. Test registering engine In this part, we try to register some functions with dynamic engine and to apply them. For this purpose, we test with a mutual recursive function separated in two files. This test is also an example of how to write a good dynamic plugin. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/abstract.ml������������������������������������������������������0000666�0000000�0000000�00000011020�13571573400�016130� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* Disable warning about partial function applications. *) [@@@warning "-5"] (* register functions using abstract types "t" and "u" *) module A : sig end = struct type t = A of int | B of bool type tt = t let mk () = 1.05 let _ = B false let f = function A n -> n | B false -> min_int | B true -> max_int module T = Datatype.Make(struct type t = tt let name = "A.t" let reprs = [ A 1 ] include Datatype.Undefined end) let t = T.ty module U = Datatype.Make(struct type t = float let name = "A.u" let reprs = [ 1.0 ] include Datatype.Undefined end) let u = U.ty let mk = Dynamic.register ~plugin:"A" ~journalize:false "mk" (Datatype.func Datatype.unit u) mk let _ = Dynamic.register ~plugin:"A" ~journalize:false "f" (Datatype.func t Datatype.int) f let _ = Dynamic.register ~plugin:"A" ~journalize:false "g" (Datatype.func u Datatype.int) (fun x -> Format.printf "%f@." x; int_of_float x) let v1 = Dynamic.register ~plugin:"A" ~journalize:false "v1" t (A 1) let _ = Dynamic.register ~plugin:"A" ~journalize:false "v2" t (A 2) let _ = Dynamic.register ~plugin:"A" ~journalize:false "h" (Datatype.func t (Datatype.func u Datatype.bool)) (fun x y -> match x with A x -> Format.printf "params = %d %f@." x y; x = int_of_float y | B _ -> false) let _ = Dynamic.register ~plugin:"A" ~journalize:false "succ" (Datatype.func Datatype.int Datatype.int) succ let _ = Dynamic.register ~journalize:false "ho" ~plugin:"A" (Datatype.func (Datatype.func Datatype.int Datatype.int) (Datatype.func t u)) (fun ff x -> float (ff (f x))) let _ = Dynamic.register ~journalize:false ~plugin:"A" "ppu" (Datatype.func u Datatype.unit) (fun f -> Format.printf "ppu %f@." f) let ho2 = Dynamic.register ~plugin:"A" "ho2" ~journalize:false (Datatype.func (Datatype.func t Datatype.int) (Datatype.func t u)) (fun f x -> float (f x)) let _ = ignore (Dynamic.get ~plugin:"A" "mk" (Datatype.func Datatype.unit u) ()) module UA = Type.Abstract(struct let name = "A.u" end) let __ : UA.t = Dynamic.get ~plugin:"A" "mk" (Datatype.func Datatype.unit UA.ty) () let _ = Dynamic.register ~journalize:false ~plugin:"A" "poly" (Datatype.list u) [ 1.; 2.; 3. ] let _ = Dynamic.register ~journalize:false ~plugin:"A" "poly2" (Datatype.list u) [ mk (); ho2 (function A n -> n | B _ -> min_int) v1; ho2 f v1 ] end (* use of the abstract functions *) module B = struct module T = Type.Abstract(struct let name = "A.t" end) let ty = T.ty let _ = Type.register ~ml_name:None ~name:"B.t" Structural_descr.t_unknown [ 0.0 ] module U = Type.Abstract(struct let name = "A.u" end) let ty' = U.ty let fut = Datatype.func Datatype.unit ty' let mk = Dynamic.get ~plugin:"A" "mk" fut let g = Dynamic.get ~plugin:"A" "g" (Datatype.func ty' Datatype.int) let f = Dynamic.get ~plugin:"A" "f" (Datatype.func ty Datatype.int) let h = Dynamic.get ~plugin:"A" "h" (Datatype.func ty (Datatype.func ty' Datatype.bool)) let v1 = Dynamic.get ~plugin:"A" "v1" ty let v2 = Dynamic.get ~plugin:"A" "v2" ty let cinq = Dynamic.get ~plugin:"A" "succ" (Datatype.func Datatype.int Datatype.int) 4 let () = Format.printf "succ=%d@." cinq let () = Format.printf "n=%d@." (g (mk ())) let () = Format.printf "v1=%d@." (f v2) let () = Format.printf "b1=%b@." (h v1 (mk ())) let () = Format.printf "b2=%b@." (h v2 (mk ())) let ho = Dynamic.get ~plugin:"A" "ho" (Datatype.func (Datatype.func Datatype.int Datatype.int) (Datatype.func ty ty')) let ppu = Dynamic.get ~plugin:"A" "ppu" (Datatype.func ty' Datatype.unit) let res = ho (Dynamic.get ~plugin:"A" "succ" (Datatype.func Datatype.int Datatype.int)) v2 let () = Format.printf "print:@."; ppu res let ho_bug = try ignore (Dynamic.get ~plugin:"A" "ho" (Datatype.func (Datatype.func ty Datatype.int) (Datatype.func ty ty')) f v2); assert false with Dynamic.Incompatible_type s -> print_endline s (* let () = (* is now statically checked and no more dynamically *) try List.iter (Dynamic.get ~plugin:"A" "ppu" (Datatype.func ty' Datatype.unit)) (Dynamic.get ~plugin:"A" "poly" (Datatype.list ty')); assert false with Dynamic.Incompatible_type s -> print_endline s*) let () = List.iter (Dynamic.get ~plugin:"A" "ppu" (Datatype.func ty' Datatype.unit)) (Dynamic.get ~plugin:"A" "poly2" (Datatype.list ty')) end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/abstract2.ml�����������������������������������������������������0000666�0000000�0000000�00000001723�13571573400�016223� 0����������������������������������������������������������������������������������������������������ustar �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� module AA : sig end = struct type _t = string let ty = Type.register ~name:"AA.t" ~ml_name:None Structural_descr.t_unknown [ "" ] let _mk = Dynamic.register ~plugin:"AA" ~journalize:false "mk" (Datatype.func Datatype.unit ty) (fun () -> "a") end module BB : sig end = struct type _t = float let ty = Type.register ~name:"BB.t" ~ml_name:None Structural_descr.t_unknown [ 1.0 ] let _print = Dynamic.register ~plugin:"BB" ~journalize:false "print" (Datatype.func ty Datatype.unit) print_float end let main () = let module A = Type.Abstract(struct let name = "AA.t" end) in let a = A.ty in let module B = Type.Abstract(struct let name = "BB.t" end) in let _b = B.ty in let _s = Dynamic.get ~plugin:"AA" "mk" (Datatype.func Datatype.unit a) () in (* is now statically checked and no more dynamically *) (* Dynamic.get ~plugin:"BB" "print" (Datatype.func b Datatype.unit) s;*) () let () = Db.Main.extend main ���������������������������������������������frama-c-20.0-Calcium/tests/dynamic/directory_path/��������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�017021� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/directory_path/README��������������������������������������������0000666�0000000�0000000�00000000077�13571573400�017705� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DO NOT DELETE THIS DIRECTORY: use for testing dynamic loading. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/dynamic.i��������������������������������������������������������0000666�0000000�0000000�00000000565�13571573400�015605� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*run.config EXECNOW: make tests/dynamic/empty.cmo tests/dynamic/abstract.cmo tests/dynamic/abstract2.cmo CMD: FRAMAC_PLUGIN=tests/dynamic bin/toplevel.byte OPT: -add-path tests/dynamic/file_path -add-path tests/dynamic/directory_path -add-path tests/dynamic/none OPT: -load-module tests/dynamic/empty.cmo,tests/dynamic/abstract.cmo,tests/dynamic/abstract2.cmo */ �������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/empty.ml���������������������������������������������������������0000666�0000000�0000000�00000000066�13571573400�015473� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(* An empty ml file in order to test dynamic module*) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/file_path��������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015650� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/oracle/����������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015246� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/oracle/dynamic.0.res.oracle��������������������������������������0000666�0000000�0000000�00000000313�13571573400�021004� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[kernel] Warning: cannot load 'tests/dynamic/none' (not a directory) [kernel] Warning: cannot load 'tests/dynamic/file_path' (not a directory) [kernel] Parsing tests/dynamic/dynamic.i (no preprocessing) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic/oracle/dynamic.1.res.oracle��������������������������������������0000666�0000000�0000000�00000000443�13571573400�021011� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������succ=5 1.050000 n=1 v1=2 params = 1 1.050000 b1=true params = 2 1.050000 b2=false print: ppu 3.000000 A.ho has type (int -> int) -> A.t -> A.u but is used with type (A.t -> int) -> A.t -> A.u ppu 1.050000 ppu 1.000000 ppu 1.000000 [kernel] Parsing tests/dynamic/dynamic.i (no preprocessing) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic_plugin/����������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015357� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic_plugin/apply.ml��������������������������������������������������0000666�0000000�0000000�00000001525�13571573400�017041� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������open Datatype module Param = Plugin.Register (struct let name = "apply" let shortname = "apply" let help = "testing purpose" end) module Test = Param.False (struct let option_name = "-dynamic-test" let help = "print dynamic test" end) let main () = if Dynamic.Parameter.Bool.get "-dynamic-test" () then begin ignore (Dynamic.get ~plugin:"Register_mod2" "g_test" (func int int) 41); try Dynamic.get ~plugin:"Register_mod2" "g_test" (func int (func (list char) (func (pair string float) unit))) 42 ['a'] ("r",6.8) with Dynamic.Incompatible_type s -> Param.feedback "%s" s; try Dynamic.get ~plugin:"Register_mod2" "unknown" (func unit unit) () with Dynamic.Unbound_value s -> Param.feedback "value %S not registered" s end let () = Db.Main.extend main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic_plugin/register_mod1.ml������������������������������������������0000666�0000000�0000000�00000000557�13571573400�020464� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������module L = List open Datatype module List = L (* Test with a mutual recursive function *) let f_test i j= Format.printf "Use f_test %d %d@." i j; if i = 0 then j else Dynamic.get ~plugin:"Register_mod2" "g_test" (func int int) (j-1) let __ : int = Dynamic.register ~plugin:"Register_mod1" "f_test" ~journalize:false (func int (func int int)) f_test 3 4 �������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/dynamic_plugin/register_mod2.ml������������������������������������������0000666�0000000�0000000�00000000615�13571573400�020460� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������module L = List open Datatype module List = L (* Test with a mutual recursive function *) let g_test j= Format.printf "Use g_test %d@." j; if j mod 3 = 0 then j else Dynamic.get ~plugin:"Register_mod1" "f_test" (func int (func int int)) (j-1) j let __ : int -> int = Dynamic.register ~journalize:false ~plugin:"Register_mod2" "g_test" (func int int) g_test �������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/���������������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�014331� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/flamegraph.txt�������������������������������������������������0000666�0000000�0000000�00000000151�13571573400�017175� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������main;f1 2.0 main;f2;f3 2.0 main;f2;f3;f4 2.0 main;f2 2.0 main;f1 1.5 main;f1;f2 2.5 main;f1 0.5 main 1.0 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/for-find-fun.c�������������������������������������������������0000666�0000000�0000000�00000000274�13571573400�016772� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: test run by main.c */ int main2 (char *c, int i); struct s { char c; }; struct s **main3( struct s *p1, struct s s2 ) { } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/for-find-fun2.c������������������������������������������������0000666�0000000�0000000�00000000746�13571573400�017060� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: test run by main.c */ struct s ** main3( struct s *p1, struct s s2 ) ; // tests to avoid false positives void f() { int (*false_positive)(); } void g() { int i = 0; false_positive(i); } void h() { (void)false_positive((int)42); } //void false_positive(); void false_positive(); // this is a "voluntary" false negative (space before): // it allows us to avoid false positives more easily ��������������������������frama-c-20.0-Calcium/tests/fc_script/list_files.json������������������������������������������������0000666�0000000�0000000�00000000531�13571573400�017360� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[ { "arguments": [ "cc", "main.c" ], "directory": "tests/fc_script", "file": "main.c" }, { "directory": "tests/fc_script", "command": "gcc -DUH", "file": "main2.c" }, { "directory": "tests/fc_script", "command": "gcc", "file": "main3.c" } ] �����������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/main.c���������������������������������������������������������0000666�0000000�0000000�00000002344�13571573400�015424� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config OPT: EXECNOW: LOG GNUmakefile LOG make_template.res LOG make_template.err PTESTS_TESTING= bin/frama-c-script make-template @PTEST_DIR@/result < @PTEST_DIR@/make_template.input > @PTEST_DIR@/result/make_template.res 2> @PTEST_DIR@/result/make_template.err EXECNOW: LOG list_files.res LOG list_files.err bin/frama-c-script list-files @PTEST_DIR@/list_files.json > @PTEST_DIR@/result/list_files.res 2> @PTEST_DIR@/result/list_files.err EXECNOW: LOG flamegraph.html LOG flamegraph.res LOG flamegraph.err NOGUI=1 bin/frama-c-script flamegraph @PTEST_DIR@/flamegraph.txt @PTEST_DIR@/result > @PTEST_DIR@/result/flamegraph.res 2> @PTEST_DIR@/result/flamegraph.err && rm -f @PTEST_DIR@/result/flamegraph.svg EXECNOW: LOG find_fun1.res LOG find_fun1.err bin/frama-c-script find-fun main2 @PTEST_DIR@ > @PTEST_DIR@/result/find_fun1.res 2> @PTEST_DIR@/result/find_fun1.err EXECNOW: LOG find_fun2.res LOG find_fun2.err bin/frama-c-script find-fun main3 @PTEST_DIR@ > @PTEST_DIR@/result/find_fun2.res 2> @PTEST_DIR@/result/find_fun2.err EXECNOW: LOG find_fun3.res LOG find_fun3.err bin/frama-c-script find-fun false_positive @PTEST_DIR@ > @PTEST_DIR@/result/find_fun3.res 2> @PTEST_DIR@/result/find_fun3.err */ void main() { } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/main2.c��������������������������������������������������������0000666�0000000�0000000�00000000167�13571573400�015507� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: COMMENT: used by main.c */ void fake_main() { } void domain() { } void main2() { } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/main3.c��������������������������������������������������������0000666�0000000�0000000�00000000142�13571573400�015501� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* run.config DONTRUN: COMMENT: used by main.c */ int main( int argc, char *argv[] ) { } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/make_template.input��������������������������������������������0000666�0000000�0000000�00000000115�13571573400�020217� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������fc_script_main file1.c file*.c dir/more_files.c y y invalid_machdep n x86_64 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/��������������������������������������������������������0000777�0000000�0000000�00000000000�13571573400�015576� 5����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/GNUmakefile���������������������������������������������0000666�0000000�0000000�00000004556�13571573400�017662� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# TEMPLATE FOR MAKEFILE TO USE IN FRAMA-C/EVA CASE STUDIES # DO NOT EDIT THE LINES BETWEEN THE '#'S ############################################################################### # Improves analysis time, at the cost of extra memory usage export FRAMA_C_MEMORY_FOOTPRINT = 8 # # frama-c-path.mk contains variables which are specific to each # user and should not be versioned, such as the path to the # frama-c binaries (e.g. FRAMAC and FRAMAC_GUI). # It is an optional include, unnecessary if frama-c is in the PATH -include frama-c-path.mk # # FRAMAC_CONFIG is defined in frama-c-path.mk when it is included, so the # line below will be safely ignored if this is the case FRAMAC_CONFIG ?= frama-c-config # # frama-c.mk contains the main rules and targets -include $(shell $(FRAMAC_CONFIG) -print-share-path)/analysis-scripts/frama-c.mk # ############################################################################### # EDIT VARIABLES AND TARGETS BELOW AS NEEDED # The flags below are only suggestions to use with Eva, and can be removed # (Optional) preprocessing flags, usually handled by -json-compilation-database CPPFLAGS += # (Optional) Frama-C general flags (parsing and kernel) FCFLAGS += \ -main eva_main \ -machdep x86_64 \ -json-compilation-database . \ -kernel-warn-key annot:missing-spec=abort \ -kernel-warn-key typing:implicit-function-declaration=abort \ # (Optional) Eva-specific flags EVAFLAGS += \ -eva-warn-key builtins:missing-spec=abort \ # (MANDATORY) Name of the main target MAIN_TARGET := fc_script_main # Add other targets if needed TARGETS = $(MAIN_TARGET).eva # Default target all: $(TARGETS) # (MANDATORY) List of source files used by MAIN_TARGET. # If there is a JSON compilation database, # 'frama-c-script list-files' can help obtain it $(MAIN_TARGET).parse: fc_stubs.c file1.c file*.c dir/more_files.c # The following targets are optional and provided for convenience only parse: $(TARGETS:%.eva=%.parse) loop: $(TARGETS:%.eva=%.parse.loop) $(TARGETS:%=%.loop) gui: $(MAIN_TARGET).eva.gui # Run 'make <TARGET>.eva.loop' to obtain a .loop file, fine-tune it by hand, # then rename it to <TARGET>.slevel to prevent it from being overwritten. # If such file exists, use it to define per-function slevel values. ifneq (,$(wildcard $(MAIN_TARGET).slevel)) $(MAIN_TARGET).eva: \ EVAFLAGS += $(shell cat $(MAIN_TARGET).slevel | tr -d '\n\\') endif ��������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/find_fun1.err�������������������������������������������0000666�0000000�0000000�00000000000�13571573400�020147� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/find_fun1.res�������������������������������������������0000666�0000000�0000000�00000000354�13571573400�020164� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Looking for 'main2' inside 5 file(s)... Possible declarations for function 'main2' in the following file(s): tests/fc_script/for-find-fun.c Possible definitions for function 'main2' in the following file(s): tests/fc_script/main2.c ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/find_fun2.err�������������������������������������������0000666�0000000�0000000�00000000000�13571573400�020150� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/find_fun2.res�������������������������������������������0000666�0000000�0000000�00000000364�13571573400�020166� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Looking for 'main3' inside 5 file(s)... Possible declarations for function 'main3' in the following file(s): tests/fc_script/for-find-fun2.c Possible definitions for function 'main3' in the following file(s): tests/fc_script/for-find-fun.c ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/find_fun3.err�������������������������������������������0000666�0000000�0000000�00000000000�13571573400�020151� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/find_fun3.res�������������������������������������������0000666�0000000�0000000�00000000157�13571573400�020167� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Looking for 'false_positive' inside 5 file(s)... No declaration/definition found for function 'false_positive' �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/flamegraph.err������������������������������������������0000666�0000000�0000000�00000000000�13571573400�020404� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������frama-c-20.0-Calcium/tests/fc_script/oracle/flamegraph.html�����������������������������������������0000666�0000000�0000000�00000000342�13571573400�020571� 0����������������������������������������������������������������������������������������������������ustar ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Eva Flamegraph frama-c-20.0-Calcium/tests/fc_script/oracle/flamegraph.res0000666000000000000000000000000013571573400020405 0ustar frama-c-20.0-Calcium/tests/fc_script/oracle/list_files.err0000666000000000000000000000000013571573400020433 0ustar frama-c-20.0-Calcium/tests/fc_script/oracle/list_files.res0000666000000000000000000000030613571573400020445 0ustar SRCS=\ tests/fc_script/main.c \ tests/fc_script/main2.c \ tests/fc_script/main3.c \ # Possible definition of main function in the following file(s): tests/fc_script/main.c tests/fc_script/main3.c frama-c-20.0-Calcium/tests/fc_script/oracle/main.res.oracle0000666000000000000000000000007513571573400020503 0ustar [kernel] Parsing tests/fc_script/main.c (with preprocessing) frama-c-20.0-Calcium/tests/fc_script/oracle/make_template.err0000666000000000000000000000000013571573400021106 0ustar frama-c-20.0-Calcium/tests/fc_script/oracle/make_template.res0000666000000000000000000000125613571573400021125 0ustar Running ptests: setting up mock files... Main target name: Source files separated by spaces (default if empty: *.c): compile_commands.json exists, add option -json-compilation-database? [Y/n] Add stub for function main (only needed if it uses command-line arguments)? [y/N] Please define the architectural model (machdep) of the target machine. Known machdeps: x86_16 x86_32 x86_64 gcc_x86_16 gcc_x86_32 gcc_x86_64 ppc_32 msvc_x86_64 Please enter the machdep [x86_32]: 'invalid_machdep' is not a standard machdep. Proceed anyway? [y/N]Please enter the machdep [x86_32]: Created stub for main function: fc_stubs.c Template created: GNUmakefile Running ptests: cleaning up after tests... frama-c-20.0-Calcium/tests/float/0000777000000000000000000000000013571573400013462 5ustar frama-c-20.0-Calcium/tests/float/.gitignore0000666000000000000000000000001113571573400015442 0ustar /oracle_*frama-c-20.0-Calcium/tests/float/absorb.c0000666000000000000000000000173713571573400015106 0ustar /* run.config COMMENT: run.config is intentionally not-* EXECNOW: BIN absorb.sav LOG absorb_sav.res LOG absorb_sav.err FRAMAC_PLUGIN=tests/.empty @frama-c@ -journal-disable -save @PTEST_DIR@/result/absorb.sav @PTEST_FILE@ > @PTEST_DIR@/result/absorb_sav.res 2> @PTEST_DIR@/result/absorb_sav.err EXECNOW: BIN absorb.sav2 LOG absorb_sav2.res LOG absorb_sav2.err @frama-c@ -load @PTEST_DIR@/result/absorb.sav -eva @EVA_CONFIG@ -journal-disable -float-hex -save @PTEST_DIR@/result/absorb.sav2 > @PTEST_DIR@/result/absorb_sav2.res 2> @PTEST_DIR@/result/absorb_sav2.err OPT: -load @PTEST_DIR@/result/absorb.sav2 -deps -out -input */ /* run.config* DONTRUN: */ #include "__fc_builtin.h" float x = 1.0, y = 0.0, z, t, min_f, min_fl, den; void main() { long long b = Frama_C_interval(-2000000001, 2000000001); b = b * b; z = y + 1e-286; while (y != x) { y = x ; x+=1E-286; } t = b; min_f = 1.175494351e-38; min_fl = -1.1754943505e-38; den = min_f / 128.; } frama-c-20.0-Calcium/tests/float/alarms.i0000666000000000000000000000306013571573400015112 0ustar /* run.config* OPT: -eva @EVA_CONFIG@ -warn-special-float non-finite OPT: -eva @EVA_CONFIG@ -warn-special-float nan OPT: -eva @EVA_CONFIG@ -warn-special-float none */ union { long long l ; float f ; double d ; } u1, u2; float f; double d, big; unsigned long long ull; double fd(void); volatile rand; void main1 (long long l){ u1.l = l; f = u1.f + 1.0; u2.l = l; d = u2.d + 1.0; Frama_C_dump_each(); float vf = fd(); double vd = fd(); long long i = vd; long long j = vf; vd = fd(); double mvd = -vd / 4.; big = 0x1.8p63; ull = big; } /* Tests the emission of is_nan and is_finite alarms depending on the -warn-special-float parameter, and the evaluation and reduction by ¬\is_NaN assertions. */ void main2 () { float f = rand ? -3. : 17.; float f_infinity = rand ? f : 1. / 0.;; float f_nan = rand ? f : 0. / 0.;; float f_infinity_nan = rand ? f_nan : f_infinity; /*@ assert ¬\is_NaN(f); */ /*@ assert ¬\is_NaN(f_infinity); */ /*@ assert ¬\is_NaN(f_nan); */ /*@ assert ¬\is_NaN(f_infinity_nan); */ if (rand) { float infinity = 1. / 0.; /*@ assert ¬\is_NaN(infinity); */ } if (rand) { float nan = 0. / 0.; /*@ assert ¬\is_NaN(nan); */ } } /* Tests the backward propagation of comparisons with NaN. When -warn-special-float is none, the result must include NaN. */ double fabs(double x) { if (x < 0) return -x; else if (x == 0) return 0.0; else return x; } void main3 () { double d = fd(); double r = fabs(d); } void main (long long l) { main1(l); main2(); main3(); } frama-c-20.0-Calcium/tests/float/builtins.c0000666000000000000000000000250013571573400015454 0ustar /* run.config* OPT: -eva @EVA_CONFIG@ -then -main main_log_exp */ #include <__fc_builtin.h> #include "math.h" void main(int c, char **v) { float f; double d; f = Frama_C_float_interval(-1.0, 1.0); d = Frama_C_double_interval(-1.0, 1.0); } volatile v; void main_log_exp(double d) { double l1, l2, l3, l4, l5, l6, l7, l8; double m1, m2, m3, m4, m5, m6; double e1, e2, e3, e4, e5, e6; if (v) { l1 = log(1); m1 = log10(1.); } if (v) { l2 = log(2.72); m2 = log10(10.); } if (v) { l3 = log(3.); m3 = log10(20.); } if (v) { //@ assert 10 <= d <= 100; l4 = log(d); } if (v) { //@ assert 10 <= d <= 101; m4 = log10(d); } if (v) { l5 = log(d); } if (v) { m5 = log10(d); // Same } if (v) { l6 = log(-1); } if (v) { m6 = log10(-1); } if (v) { e1 = exp(0.); } if (v) { e2 = exp(-0x1.fffffffffffffp+1023); } if (v) { e3 = exp(100); } if (v) { //@ assert 100 <= d <= 1000; e4 = exp(d); } if (v) { e5 = exp(1000); } if (v) { double max1 = 0x1.62e42fefa39efp9; double max2 = log(0x1.fffffffffffffp+1023); //@ assert max1 == max2; e6 = exp(0x1.62e42fefa39efp9); } if (v) { l7 = log((double)(int)&d); } if (v) { int x; l8 = log(x); } } frama-c-20.0-Calcium/tests/float/cast.i0000666000000000000000000000075113571573400014571 0ustar volatile double v; /*@ requires \is_finite(d); requires (0.0 < d < 0x1p-1022); assigns \nothing; */ void assert_subnormal(double d); /* Tests an edge case of backward_cast_float_to_double. */ void main () { float f = v; /* assert_subnormal reduces its double argument to a range of values without single precision values. The backward propagation of this reduction to the concrete argument [f] (which is a float) should lead to bottom. */ assert_subnormal(f); } frama-c-20.0-Calcium/tests/float/cond.c0000666000000000000000000000072413571573400014554 0ustar /* run.config* OPT: -eva @EVA_CONFIG@ -journal-disable -float-hex */ #include "__fc_builtin.h" float x, y, z; double dx, dy, dz, dt; int c1,c2; void main(int c) { x = Frama_C_float_interval(-10.0, 10.0); x = x >= 0.0 ? x : 0.0; dx = Frama_C_float_interval(-10.0, 10.0); dx = dx >= 0.0 ? dx : 0.0; c1 = dx >= 0; /*@ assert ! (0. <= dx <= 1.) ; */ dz = Frama_C_float_interval(-10.0, 10.0); dt = dz < 1.0 ? dz : 0.0; dz = dz > 1.0 ? dz : 2.0; } frama-c-20.0-Calcium/tests/float/cond_cast_int_to_float.c0000666000000000000000000000112613571573400020324 0ustar volatile v; //@ requires c; assigns \nothing; void __assert(int c); #define TEST(cond) \ if ((float) x cond ) { \ __assert ((float)x cond ); \ Frama_C_show_each_then(__LINE__, x); \ } else { \ __assert (! ((float)x cond ) ); \ Frama_C_show_each_else(__LINE__, x); \ } //@ requires -10000 <= x <= 10000; void main(int x) { TEST ( > 30.1f ) TEST ( > 30.f ) TEST ( >= 30.f ) TEST ( > -30.1f ) TEST ( >= -30.f ) TEST ( > -30.f ) } frama-c-20.0-Calcium/tests/float/const.i0000666000000000000000000001715013571573400014766 0ustar /* run.config* OPT: -eva @EVA_CONFIG@ -float-hex -warn-decimal-float all -journal-disable -then -out -deps */ typedef double mydouble; float f0, f_ , f00, f1 = 3.0, f2, f3, f_0, f13, f26, fic0,fic1,fic2,fic4, fec0,fec2,fec4; mydouble m0, m_ , m00, m1 = 3.0, m2, m3, m_0, m13, m26; double d0, d1 = 3.0, d2, d3, d4, d5, d6, d7; int A,B,C,D,E,F,G,H,I,J,K,L,P,Q,R; int Am,Bm,Cm,Dm,Em,Fm,Gm,Hm,Im,Jm,Km,Lm; int t1,t2,t3,t4,t5,t6,t7,t8,t9,C0=0,C2=2; int s1,s2,s3,s4,s5,s6,s7,s8,s9; int if1,if2,if3,ite1,ite2,ite3; int ca1,ca2,ca3,ca4; double corner_case_small0 = 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024703282292062327208828439643411068618252990130716238221279284125033775363510437593264991818081799618989828234772285886546332835517796989819938739800539093906315035659515570226392290858392449105184435931802849936536152500319370457678249219365623669863658480757001585769269903706311928279558551332927834338409351978015531246597263579574622766465272827220056374006485499977096599470454020828166226237857393450736339007967761930577506740176324673600968951340535537458516661134223766678604162159680461914467291840300530057530849048765391711386591646239524912623653881879636239373280423891018672348497668235089863388587925628302755995657524455507255189313690836254779186948667994968324049705821028513185451396213837722826145437693412532098591327667236328125; /* midpoint between 0 and smallest subnormal, should round to zero because zero is "even" */ double corner_case_small1 = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002470328229206232720882843964341106861825299013071623822127928412503377536351043759326499181808179961898982823477228588654633283551779698981993873980053909390631503565951557022639229085839244910518443593180284993653615250031937045767824921936562366986365848075700158576926990370631192827955855133292783433840935197801553124659726357957462276646527282722005637400648549997709659947045402082816622623785739345073633900796776193057750674017632467360096895134053553745851666113422376667860416215968046191446729184030053005753084904876539171138659164623952491262365388187963623937328042389101867234849766823508986338858792562830275599565752445550725518931369083625477918694866799496832404970582102851318545139621383772282614543769341253209859132766723632812501; double corner_case_small2 = 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002470328229206232720882843964341106861825299013071623822127928412503377536351043759326499181808179961898982823477228588654633283551779698981993873980053909390631503565951557022639229085839244910518443593180284993653615250031937045767824921936562366986365848075700158576926990370631192827955855133292783433840935197801553124659726357957462276646527282722005637400648549997709659947045402082816622623785739345073633900796776193057750674017632467360096895134053553745851666113422376667860416215968046191446729184030053005753084904876539171138659164623952491262365388187963623937328042389101867234849766823508986338858792562830275599565752445550725518931369083625477918694866799496832404970582102851318545139621383772282614543769341253209859132766723632812499; float smallest_pos0 = 0.00000000000000000000000000000000000000000000140129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125; float smallest_pos1 = 0.0000000000000000000000000000000000000000000014012984643248170709237295832899161312802619418765157717570682838897910826858606014866381883621215820312499; float smallest_pos2 = 0.0000000000000000000000000000000000000000000014012984643248170709237295832899161312802619418765157717570682838897910826858606014866381883621215820312501; float smallest_pos3 = 0.00000000000000000000000000000000000000000000140129846432481707092372958328991613128026194187651577175706828388979108268586060148663818836212158203125f; float smallest_pos4 = 0.0000000000000000000000000000000000000000000014012984643248170709237295832899161312802619418765157717570682838897910826858606014866381883621215820312499f; float smallest_pos5 = 0.0000000000000000000000000000000000000000000014012984643248170709237295832899161312802619418765157717570682838897910826858606014866381883621215820312501f; float half_smallest_pos0 = 0.000000000000000000000000000000000000000000000700649232162408535461864791644958065640130970938257885878534141944895541342930300743319094181060791015625; float half_smallest_pos1 = 0.00000000000000000000000000000000000000000000070064923216240853546186479164495806564013097093825788587853414194489554134293030074331909418106079101562499; float half_smallest_pos2 = 0.00000000000000000000000000000000000000000000070064923216240853546186479164495806564013097093825788587853414194489554134293030074331909418106079101562501; float half_smallest_pos3 = 0.000000000000000000000000000000000000000000000700649232162408535461864791644958065640130970938257885878534141944895541342930300743319094181060791015625f; float half_smallest_pos4 = 0.00000000000000000000000000000000000000000000070064923216240853546186479164495806564013097093825788587853414194489554134293030074331909418106079101562499f; float half_smallest_pos5 = 0.00000000000000000000000000000000000000000000070064923216240853546186479164495806564013097093825788587853414194489554134293030074331909418106079101562501f; void main(int c1, int c2) { f_ = - f0; f_0 = c1 ? f0 : f_; f00 = - f_; f2 = f1; f13 = c1 ? 1.0 : 3.0; f26 = f13 + f13; /*@ assert f26 >= -1.0 ; */ ca1 = f_0; ca2 = f13; ca3 = f0; ca4 = f00; m_ = - m0; m_0 = c1 ? m0 : m_; m00 = - m_; m2 = m1; m13 = c1 ? 1.0 : 3.0; m26 = m13 + m13; if (f2 == f1) d2 = d1; f3 = f1 + f0; if (f3 == f1) d6 = d1; f13 = c1 ? 1.0 : 3.0; A = f0 == f_; B = f0 == f1; C = f0 == f0; D = f_ == f1; E = f_ == f_; F = f_0 == f0; G = f_0 == f_; H = (c1 ? f0 : 3.0) == f_; I = (c1 ? f0 : 3.0) == f0; J = f13 == f_; K = f13 == f0; L = f13 == (c2? 3.0 : 5.0); P = f13 != (c2? 3.0 : 5.0); Q = f0 != f_; R = f0 != f1; Am = m0 == m_; Bm = m0 == m1; Cm = m0 == m0; Dm = m_ == m1; Em = m_ == m_; Fm = m_0 == m0; Gm = m_0 == m_; Hm = (c1 ? m0 : 3.0) == m_; Im = (c1 ? m0 : 3.0) == m0; Jm = m13 == m_; Km = m13 == m0; Lm = m13 == (c2? 3.0 : 5.0); t1 = f_0 <= f0; t2 = f0 <= f_0; t3 = f0 <= f13; t4 = f13 <= f26; t5 = f26 <= f13; t6 = 1.0 <= f26; t7 = f26 <= 1.0; t8 = f1 <= f1; s1 = f_0 < f0; s2 = f0 < f_0; s3 = f0 < f13; s4 = f13 < f26; s5 = f26 < f13; s6 = 1.0 < f26; s7 = f26 < 1.0; s8 = f1 < f1; d3 = d1 + 2.0; d4 = d1 + 2; if (1.0) if1 = 1; if (0.0) if2 = 1; if (-0.0) if3 = 1; if (1.0) ite1 = 1; else ite1 = 2; if (0.0) ite2 = 1; else ite2 = 2; if (-0.0) ite3 = 1; else ite3 = 2; fic0 = C0; fic1 = 1; fic2 = C2; fic4 = C2 + C2; fec0 = (float) C0; fec2 = (float) C2; fec4 = (float) (C2 + C2); d5 = (c2 ? -3.0 : 9.0) / f13; d7 = (c2 ? -3.0 : 9.0) / (-f13); } frama-c-20.0-Calcium/tests/float/const1.i0000666000000000000000000000007713571573400015047 0ustar unsigned long long l = 1e40f; int main() { double d2 = l; } frama-c-20.0-Calcium/tests/float/const2.i0000666000000000000000000000016013571573400015041 0ustar float f1 = 1e-40f; float f2 = 1e40f; int main() { Frama_C_dump_each(); double d1 = f1; double d2 = f2; } frama-c-20.0-Calcium/tests/float/const3.i0000666000000000000000000000034613571573400015050 0ustar /* run.config* STDOPT: #"-warn-decimal-float all" STDOPT: #"-warn-decimal-float all -all-rounding-modes-constants -float-hex" */ double f1 = 1e-40f; double d0 = 1e-40; int main() { Frama_C_dump_each(); double d1 = f1; } frama-c-20.0-Calcium/tests/float/const4.i0000666000000000000000000000034013571573400015043 0ustar /* run.config* STDOPT: #"-warn-decimal-float all" STDOPT: #"-warn-decimal-float all -all-rounding-modes-constants" */ double f1 = 3.4e38f; double f2 = 3.405e38f; int main() { Frama_C_dump_each(); double d2 = f2; } frama-c-20.0-Calcium/tests/float/conv.i0000666000000000000000000000415013571573400014601 0ustar /* run.config* STDOPT: #"-big-ints-hex 65536" */ float f; double d; volatile v; // Conversion from binary integer representation to float void main1() { int i; i = 0; Frama_C_show_each(*(float *)&i); i = 1; Frama_C_show_each(*(float *)&i); i = v ? 100 : 10000000000; f = *(float *)&i; Frama_C_show_each(f); i = *(int *)&f; //@ assert *(int *)&f == i; i = 0x7F7FFFFF; f = *(float *)&i; Frama_C_show_each(f); //@ assert *(int *)&f == i; i += 1; if (v) { f = *(float *)&i; // fails Frama_C_show_each_unreached(f); } i = 0xff7fffff; f = *(float *)&i; Frama_C_show_each(f); //@ assert *(int *)&f == i; i ++ ; if (v) { f = *(float *)&i; // fails Frama_C_show_each_unreached(f); } i = v ? 1 : (-0x7FFFFFFF-1); // ok f = *(float *)&i; Frama_C_show_each(f); f += 0; if (v) { i = v; //@ assert -10 <= i <= -1; f = *(float *)&i; Frama_C_show_each_unreached(f); /* Fails */ } i = v ? 0 : 0x7FFFFFFF; // problem with 0x7FFFFFFF f = *(float *)&i; Frama_C_show_each(f); if (v) { unsigned int ui = 0xFFFFFFFF; f = *(float *)&ui; Frama_C_show_each(f); /* Fails */ } } // Conversion from binary integer representation to double void main2() { long long i; i = 0; Frama_C_show_each(*(double *)&i); i = 1; Frama_C_show_each(*(double *)&i); i = v ? 100 : 7000000000000000000LL; Frama_C_show_each(*(double *)&i); i = 0x7fefffffffffffff; d = *(double *)&i; Frama_C_show_each(d); //@ assert *(long long*)&d == i; i ++; Frama_C_show_each(*(double *)&i); // fails i = -1; Frama_C_show_each(*(double *)&i); // fails i = 0xffefffffffffffff; d = *(double *)&i; Frama_C_show_each(d); //@ assert *(long long*)&d == i; i ++; Frama_C_show_each(*(double *)&i); // fails i = v ? 1 : (-0xffffffffffffffff-1); Frama_C_show_each(*(double *)&i); i = v; //@ assert -10 <= i <= -1; Frama_C_show_each(*(double *)&i); // fails i = v ? 0 : -1; // problem with -1 Frama_C_show_each(*(double *)&i); unsigned long long ui = 0xFFFFFFFFFFFFFFFF; Frama_C_show_each(*(double *)&ui); // fails } void main() { main1(); main2(); } frama-c-20.0-Calcium/tests/float/cte_overflow.i0000666000000000000000000000045013571573400016331 0ustar /* run.config* STDOPT: #"-warn-decimal-float all" */ int volatile v; int main() { double t=0.0; if (v) { t = 1e500 * 1e500; Frama_C_dump_each(); // does not execute } if (v) { t = 1e80f * 1e500f; Frama_C_dump_each(); // does not execute } return 0; } frama-c-20.0-Calcium/tests/float/diff_apron0000666000000000000000000000041513571573400015514 0ustar Only in tests/float/oracle: absorb.res.oracle Only in tests/float/oracle: absorb_sav.err Only in tests/float/oracle: absorb_sav.res Only in tests/float/oracle: absorb_sav2.err Only in tests/float/oracle: absorb_sav2.res Only in tests/float/oracle: fval_test.res.oracle frama-c-20.0-Calcium/tests/float/diff_bitwise0000666000000000000000000000041513571573400016043 0ustar Only in tests/float/oracle: absorb.res.oracle Only in tests/float/oracle: absorb_sav.err Only in tests/float/oracle: absorb_sav.res Only in tests/float/oracle: absorb_sav2.err Only in tests/float/oracle: absorb_sav2.res Only in tests/float/oracle: fval_test.res.oracle frama-c-20.0-Calcium/tests/float/diff_equalities0000666000000000000000000000346113571573400016546 0ustar Only in tests/float/oracle: absorb.res.oracle Only in tests/float/oracle: absorb_sav.err Only in tests/float/oracle: absorb_sav.res Only in tests/float/oracle: absorb_sav2.err Only in tests/float/oracle: absorb_sav2.res diff tests/float/oracle/alarms.0.res.oracle tests/float/oracle_equalities/alarms.0.res.oracle 137,139c137,138 < u1{.l[bits 0 to 31]; .f; .d[bits 0 to 31]} ∈ < [-3.40282346639e+38 .. 3.40282346639e+38] < {.l[bits 32 to 63]; .f[bits 32 to 63]; .d[bits 32 to 63]} ∈ [--..--] --- > u1{.l; .f[bits 0 to 63]; .d} ∈ > [-9223372036854775808..9218868437227405311] diff tests/float/oracle/alarms.1.res.oracle tests/float/oracle_equalities/alarms.1.res.oracle 126,127c126,127 < u1{.l[bits 0 to 31]; .f; .d[bits 0 to 31]} ∈ [-inf .. inf] < {.l[bits 32 to 63]; .f[bits 32 to 63]; .d[bits 32 to 63]} ∈ [--..--] --- > u1{.l; .f[bits 0 to 63]; .d} ∈ > [-9223372036854775808..9218868437227405312] diff tests/float/oracle/cond.res.oracle tests/float/oracle_equalities/cond.res.oracle 45,46c45,46 < dz ∈ [0x1.0000000000001p0 .. 0x1.4000000000000p3] < dt ∈ [-0x1.4000000000000p3 .. 0x1.fffffffffffffp-1] --- > dz ∈ [0x1.0000020000000p0 .. 0x1.4000000000000p3] > dt ∈ [-0x1.4000000000000p3 .. 0x1.fffffe0000000p-1] Only in tests/float/oracle: fval_test.res.oracle diff tests/float/oracle/nonlin.1.res.oracle tests/float/oracle_equalities/nonlin.1.res.oracle 60a61 > [eva:nonlin] tests/float/nonlin.c:42: subdividing on a diff tests/float/oracle/nonlin.3.res.oracle tests/float/oracle_equalities/nonlin.3.res.oracle 60a61 > [eva:nonlin] tests/float/nonlin.c:42: subdividing on a diff tests/float/oracle/parse.res.oracle tests/float/oracle_equalities/parse.res.oracle 21a22,23 > [eva] tests/float/parse.i:37: Warning: > cannot parse floating-point constant, returning imprecise result frama-c-20.0-Calcium/tests/float/diff_gauges0000666000000000000000000000041513571573400015650 0ustar Only in tests/float/oracle: absorb.res.oracle Only in tests/float/oracle: absorb_sav.err Only in tests/float/oracle: absorb_sav.res Only in tests/float/oracle: absorb_sav2.err Only in tests/float/oracle: absorb_sav2.res Only in tests/float/oracle: fval_test.res.oracle frama-c-20.0-Calcium/tests/float/diff_octagons0000666000000000000000000000153513571573400016216 0ustar Only in tests/float/oracle: absorb.res.oracle Only in tests/float/oracle: absorb_sav.err Only in tests/float/oracle: absorb_sav.res Only in tests/float/oracle: absorb_sav2.err Only in tests/float/oracle: absorb_sav2.res Only in tests/float/oracle: fval_test.res.oracle diff tests/float/oracle/nonlin.1.res.oracle tests/float/oracle_octagons/nonlin.1.res.oracle 253a254,255 > [eva:nonlin] tests/float/nonlin.c:101: non-linear 'f + f', lv 'f' > [eva:nonlin] tests/float/nonlin.c:101: subdividing on f 257d258 < [eva:nonlin] tests/float/nonlin.c:101: subdividing on f diff tests/float/oracle/nonlin.3.res.oracle tests/float/oracle_octagons/nonlin.3.res.oracle 253a254,255 > [eva:nonlin] tests/float/nonlin.c:101: non-linear 'f + f', lv 'f' > [eva:nonlin] tests/float/nonlin.c:101: subdividing on f 257d258 < [eva:nonlin] tests/float/nonlin.c:101: subdividing on f frama-c-20.0-Calcium/tests/float/diff_symblocs0000666000000000000000000000041513571573400016230 0ustar Only in tests/float/oracle: absorb.res.oracle Only in tests/float/oracle: absorb_sav.err Only in tests/float/oracle: absorb_sav.res Only in tests/float/oracle: absorb_sav2.err Only in tests/float/oracle: absorb_sav2.res Only in tests/float/oracle: fval_test.res.oracle frama-c-20.0-Calcium/tests/float/div.i0000666000000000000000000000051513571573400014417 0ustar volatile v; void main() { double d1, d2; if (v) { d1 = v ? 0 : 4; d2 = v ? 0 : 3; //@ assert d1 / d2 >= 0; // Does not hold, but we want to test the division itself. In the logic this is tricky //@ assert !\is_finite((double)(d1 / d2)); //@ assert \is_finite((double)(d1 / d2)); //@ assert \false; } } frama-c-20.0-Calcium/tests/float/dr.i0000666000000000000000000000114313571573400014240 0ustar /* run.config* STDOPT: STDOPT: #"-float-hex" STDOPT: #"-all-rounding-modes-constants" */ float big = 100e30f; float big2 = 100.126E30f; float ne1 = -0.1f, ne2 = -.5f, nodigits = 10.f; float smaller = 1e-99999999999999999999999f; // larger = 1e99999999999999999999999f; causes initial state to bottomify float he = 0X1.8p1f; float g1 = 0.1 ; float f1 = 0.1f, f9 = 0.999999999999999999f, ep = 1.25e+10f; float g2 = 1.01161128282547 ; float f2 = 1.01161128282547f; double d2 = 1.01161128282547 ; int e1, e2; int main(){ e1 = f1 == g1; e2 = f2 == g2; Frama_C_show_each(e1, e2); return 0; } frama-c-20.0-Calcium/tests/float/dr_infinity.i0000666000000000000000000000207713571573400016160 0ustar /* run.config* STDOPT: #"-warn-decimal-float all -float-hex" */ volatile v; void main(void) { float x; double d; x = 3.4028235677973366e+38f; Frama_C_show_each(x); if (v) { x = (float) 3.402823567797366e+38; // double constant, that overflows the valid range for float32 Frama_C_show_each_dead_x_1(x); // dead; } if (v) { x = 3.4e38; x = x * x; Frama_C_show_each_dead_x_2(x); // dead; } if (v) { d = 1e308; d = d * 10; Frama_C_show_each_dead_d_1(d); // dead; } if (v) { d = -0.; d = 2/d; Frama_C_show_each_dead_d_2(d); // dead; } if (v) { d = 1e308; d = d / 0.01; Frama_C_show_each_dead_d_3(d); // dead; } if (v) { x = 1e38; x = x / 0.001; Frama_C_show_each_dead_x_3(x); // dead; } if (v) { d = 0; d = d / 0. ; Frama_C_show_each_dead_d_4(x); // dead; } } frama-c-20.0-Calcium/tests/float/extract_bits.i0000666000000000000000000000123113571573400016324 0ustar /* run.config* OPT: -eva @EVA_CONFIG@ -slevel 10 -big-ints-hex 0 -machdep ppc_32 -float-normal -warn-decimal-float all OPT: -eva @EVA_CONFIG@ -slevel 10 -big-ints-hex 0 -machdep x86_32 -float-normal -warn-decimal-float all */ float f = 3.14; double d = 2.71; double stdtod_bug = 1.8254370818746402660437411213933955878019332885742187; /* http://www.exploringbinary.com/a-bug-in-the-bigcomp-function-of-david-gays-strtod/ */ int fr[4]; int dr[8]; void main() { int i; for (i=0; i<4; i++) fr[i] = ((unsigned char*) &f)[i]; for (i=0; i<8; i++) dr[i] = ((unsigned char*) &d)[i]; long double x = 1.; Frama_C_show_each(*(unsigned char *)&x); } frama-c-20.0-Calcium/tests/float/float_cast_implicite.i0000666000000000000000000000052613571573400020015 0ustar int C0 = 0, C2 = 2, CBP = 2000000000; float fic0, fic1, fic2, fic4, fec0, fec2, fec4, ficbp, ficbn, fecbp, fecbn; void main(void) { fic0 = C0; fic1 = 1; fic2 = C2; fic4 = C2 + C2; fec0 = (float) C0; fec2 = (float) C2; fec4 = (float) (C2 + C2); ficbp = CBP; fecbp = (float) CBP; ficbn = -CBP; fecbn = (float) (-CBP); } frama-c-20.0-Calcium/tests/float/fval_test.i0000666000000000000000000000021713571573400015623 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@ */ /* run.config* DONTRUN: */ frama-c-20.0-Calcium/tests/float/fval_test.ml0000666000000000000000000002366713571573400016021 0ustar (* Programmatic tests of the interval semantics of floating-point values in Fval. Run by fval_test.i. *) module Stdlib = struct let sqrt = sqrt let log = log let log10 = log10 let exp = exp let floor = floor let ceil = ceil let cos = cos let sin = sin let atan2 = atan2 end open Fval (* If true, prints each operation performed for the tests. Otherwise, only prints wrong operations. *) let print = false let report bug format = if print || bug then Kernel.result ("%s" ^^ format) (if bug then "BUG " else "") else Format.ifprintf Format.std_formatter format (* Comparison between floats that distinguish between -0. and 0.. *) module Float = struct [@@@ warning "-3"] external compare : float -> float -> int = "float_compare_total" "noalloc" [@@@ warning "+3"] let eq f1 f2 = compare f1 f2 = 0 let le f1 f2 = compare f1 f2 <= 0 end let round fkind = if fkind = Single then Floating_point.round_to_single_precision_float else fun f -> f (* Inject a float as a singleton interval. *) let inject f = if classify_float f = FP_nan then nan else inject_singleton (F.of_float f) (* Creates the interval [f1..f2]. *) let inject_range f1 f2 = join (inject f1) (inject f2) (* A list of interesting floating-point values. The functions below test the abstract semantics of Fval for all possible intervals built from these values. *) let interesting_double = [-.infinity; -1.2e307; -120.; -1.2e-323; -0.; infinity; 1.3e308; 130.; 1.3e-323; +0.; ] let interesting_float = [-.infinity; -2.2e37; -120.; -1.5e-33; -0.; infinity; 2.3e37; 130.; 1.6e-33; +0.; ] let product itvs = let l = Extlib.product (fun a b -> (a, b)) itvs itvs in List.filter (fun (a, b) -> Float.le a b) l let interesting = function | Single | Real | Long_Double -> interesting_float | Double -> interesting_double (* Tests the abstract operation [fval_op fval = fval_r] by adding NaN to fval. The function checks that the result is [fval_r] plus NaN. *) let test_unop_for_nan ?(exact=true) fkind fval_op sop fval fval_r = let fval_nan = join nan fval in let fval_r_nan = join nan fval_r in let check f = let f_r = fval_op fkind f in let bug = not ((if exact then equal else is_included) fval_r_nan f_r) in report bug "NAN %s %a -> %a && %a" sop pretty f pretty fval_r_nan pretty f_r in check fval_nan (* Tests the abstract operation [fval_op] on interval [b..e]. [op] is the concrete caml operation. *) let test_unop_on_itv ?exact fkind op fval_op str_op (b, e) = let round = round fkind in let b, e = round b, round e in let fval = inject_range b e in let fval_r = fval_op fkind fval in test_unop_for_nan ?exact fkind fval_op str_op fval fval_r; if Float.eq b e then let r = round (op b) in let bug = not (is_included (inject r) fval_r) in let bug = bug || (fkind <> Real && not (is_singleton fval_r)) in report bug "SINGLE %s %F -> %F || %a" str_op b r pretty fval_r; else let check x = if Float.le b x && Float.le x e then let r = round (op x) in let bug = not (is_included (inject r) fval_r) in report bug "ITV %s %F -> %F && %s %a -> %a" str_op x r str_op pretty fval pretty fval_r in List.iter check (interesting fkind) (* Tests the abstract operation [fval_1 fval_op fval_2 = fval_r] by adding NaN to fval_1 and fval_2. The result must then be [fval_r] plus NaN, except for the pow operator, as [pow 1 NaN] = [pow NaN 0] = 1 (and not NaN). The argument [pow] must be true if [fval_op] is pow. *) let test_binop_for_nan ~pow fkind fval_op sop fval_1 fval_2 fval_r = let fval_1_nan = join nan fval_1 in let fval_2_nan = join nan fval_2 in let fval_r_nan = join nan fval_r in let check ~nan f_1 f_2 = let f_r = fval_op fkind f_1 f_2 in let expected_r = if nan then fval_r_nan else fval_r in let bug = not (equal f_r expected_r) in report bug "NAN %a %s %a -> %a && %a" pretty f_1 sop pretty f_2 pretty expected_r pretty f_r in let nan_1 = not (pow && is_included fval_2 zeros) in check ~nan:nan_1 fval_1_nan fval_2; let nan_2 = not (pow && equal (inject 1.) fval_1) in check ~nan:nan_2 fval_1 fval_2_nan; check ~nan:true fval_1_nan fval_2_nan (* Tests the abstract operation [fval_op] on intervals [b1..e1] and [b2..e2]. [op] is the concrete caml operation. *) let test_binop_on_itv ~pow fkind op fval_op str_op ((b1, e1), (b2, e2)) = let round = round fkind in let b1, e1, b2, e2 = round b1, round e1, round b2, round e2 in let fval_1 = inject_range b1 e1 in let fval_2 = inject_range b2 e2 in let fval_r = fval_op fkind fval_1 fval_2 in test_binop_for_nan ~pow fkind fval_op str_op fval_1 fval_2 fval_r; if Float.eq b1 e1 && Float.eq b2 e2 then let r = round (op b1 b2) in let bug = not (is_included (inject r) fval_r) in let bug = bug || (fkind <> Real && not (is_singleton fval_r)) in report bug "SINGLE %F %s %F -> %F && %a" b1 str_op b2 r pretty fval_r; else let check x y = if Float.le b1 x && Float.le x e1 && Float.le b2 y && Float.le y e2 then begin let r = round (op x y) in let bug = not (is_included (inject r) fval_r) in report bug "ITV %F %s %F -> %F && %a %s %a -> %a" x str_op y r pretty fval_1 str_op pretty fval_2 pretty fval_r end in let interesting = interesting fkind in List.iter (fun x -> List.iter (fun y -> check x y) interesting) interesting let pretty_truth fmt = let open Abstract_interp in function | True -> Format.pp_print_string fmt "True" | False -> Format.pp_print_string fmt "False" | Unknown -> Format.pp_print_string fmt "Unknown" let test_comp_on_nan ~ne fval_op sop fval_1 fval_2 = let fval_1_nan = join nan fval_1 in let fval_2_nan = join nan fval_2 in let check f_1 f_2 = let f_r = forward_comp fval_op f_1 f_2 in let bug = f_r = Abstract_interp.Comp.(if ne then False else True) in report bug "NAN %a %s %a -> %b && %a" pretty f_1 sop pretty f_2 ne pretty_truth f_r in check nan fval_2; check fval_1 nan; check fval_1_nan fval_2; check fval_1 fval_2_nan; check fval_1_nan fval_2_nan let test_comp_on_itv ~ne op fval_op str_op ((b1, e1), (b2, e2)) = let fval_1 = inject_range b1 e1 in let fval_2 = inject_range b2 e2 in let fval_r = forward_comp fval_op fval_1 fval_2 in test_comp_on_nan ~ne fval_op str_op fval_1 fval_2; let check x y = let r = op x y in let bug = fval_r = Abstract_interp.Comp.(if r then False else True) in report bug "COMP %F %s %F -> %b && %a %s %a -> %a" x str_op y r pretty fval_1 str_op pretty fval_2 pretty_truth fval_r in check b1 b2; check b1 e2; check e1 b2; check e1 e2 external c_powf: float -> float -> float = "c_powf" (* Round-trip of reinterpretation. Is the identity in the concrete. *) let reinterpret fkind f = let signed = false in let i_f = Ival.inject_float f in let i_f_int, fkind = match fkind with | Single -> Ival.reinterpret_as_int i_f ~signed ~size:(Integer.of_int 32), Cil_types.FFloat | Double -> Ival.reinterpret_as_int i_f ~signed ~size:(Integer.of_int 64), Cil_types.FDouble | Real | Long_Double -> assert false in let i_f' = Ival.reinterpret_as_float fkind i_f_int in Ival.project_float i_f' let test_forward_unop () = let test_unop ?exact fkind op fval_op str_op = let l2 = product (interesting fkind) in let str_op = Format.asprintf "%s%a" str_op pretty_kind fkind in List.iter (test_unop_on_itv ?exact fkind op fval_op str_op) l2 in let test_unop ?exact op ?(fkinds=[Single; Double; Real]) fval_op str_op = List.iter (fun fkind -> test_unop ?exact fkind op fval_op str_op) fkinds in test_unop ( ~-. ) (fun _ -> neg) "-."; test_unop Stdlib.sqrt sqrt "sqrt"; test_unop Stdlib.log log "log"; test_unop Stdlib.log10 log10 "log10"; test_unop Stdlib.exp exp "exp"; test_unop Stdlib.floor floor "floor"; test_unop Stdlib.ceil ceil "ceil"; (* TODO: use interesting floating-point values for trigonometry. *) test_unop ~fkinds:[Double] Stdlib.cos cos "cos"; test_unop ~fkinds:[Single] Floating_point.cosf cos "cos"; test_unop ~fkinds:[Double] Stdlib.sin sin "sin"; test_unop ~fkinds:[Single] Floating_point.sinf sin "sin"; test_unop ~exact:false ~fkinds:[Single; Double] (fun f -> f) reinterpret "reinterpret"; ;; let test_forward_binop () = let test_binop ~pow fkind op fval_op str_op = let l2 = product (interesting fkind) in let l4 = Extlib.product (fun a b -> (a, b)) l2 l2 in let str_op = Format.asprintf "%s%a" str_op pretty_kind fkind in List.iter (test_binop_on_itv ~pow fkind op fval_op str_op) l4 in let test_binop ~pow fkinds op fval_op str_op = List.iter (fun fkind -> test_binop ~pow fkind op fval_op str_op) fkinds in let fkinds = [Single; Double; Real] in test_binop ~pow:false fkinds ( +. ) add "*"; test_binop ~pow:false fkinds ( -. ) sub "*"; test_binop ~pow:false fkinds ( *. ) mul "*"; test_binop ~pow:false fkinds ( /. ) div "/"; test_binop ~pow:false [Single; Double] mod_float fmod "mod"; test_binop ~pow:true [Double] ( ** ) pow "pow"; test_binop ~pow:true [Single] Floating_point.powf pow "pow"; test_binop ~pow:false [Double] Stdlib.atan2 atan2 "atan2"; test_binop ~pow:false [Single] Floating_point.atan2f atan2 "atan2" let interesting_for_comp = [-.infinity; -1.2e-323; -0.; infinity; 1.3e-323; +0.; ] let test_forward_comp () = let test_comp ~ne op fval_op str_op = let l2 = product interesting_for_comp in let l4 = Extlib.product (fun a b -> (a, b)) l2 l2 in List.iter (test_comp_on_itv ~ne op fval_op str_op) l4 in let ne = false in let open Abstract_interp in test_comp ~ne (=) Comp.Eq "=="; test_comp ~ne (<) Comp.Lt "<"; test_comp ~ne (<=) Comp.Le "<="; test_comp ~ne (>) Comp.Gt ">"; test_comp ~ne (>=) Comp.Ge ">="; test_comp ~ne:true (<>) Comp.Ne "<>" let main _ = test_forward_unop (); test_forward_binop (); test_forward_comp (); ;; let () = Db.Main.extend main frama-c-20.0-Calcium/tests/float/init_float.i0000666000000000000000000000147513571573400015773 0ustar /* run.config* OPT: -eva @EVA_CONFIG@ -journal-disable -float-normal -lib-entry */ typedef struct S { float y; } S; S s; double r, cv, un, zp, zm, zs; long long l; double Ha[5], THa[5]; /*@ requires -1000.0 <= x <= 1000.0; requires 0.0 <= s.y <= 0.0; */ int main(float x) { Ha[2] = 0.5; Ha[3] = 0x0.8000000000001p0; Ha[4] = 0x0.8000000000002p0; Ha[1] = 0x0.7ffffffffffffp0; Ha[0] = 0x0.7fffffffffffep0; THa[2] = 1.5; THa[3] = 0x1.8000000000001p0; THa[4] = 0x1.8000000000002p0; THa[1] = 0x1.7ffffffffffffp0; THa[0] = 0x1.7fffffffffffep0; if (l >= 4700000000000000000ll) l = 4700000000000000000ll; if (l <= 4500000000000000001ll) l = 4500000000000000001ll; cv = *(double*)&l + 1.0; r = x; s.y = s.y * 1.0; un = 1.0; zp = un - un; zm = - (un - un); zs = zp + zm; return 1; } frama-c-20.0-Calcium/tests/float/leaf_ensures.i0000666000000000000000000000143613571573400016313 0ustar double d1, d2, d3, d4, d5; /*@ assigns d1, d2, d3, \result \from \nothing; ensures \is_finite(\result); ensures \is_finite(d1); ensures \is_finite(d2) && -1 < d2 < 1; ensures -1 < d3 < 1; */ double d(void); float f1, f2, f3, f4, f5, f6; /*@ assigns f1, f2, f3, \result \from \nothing; ensures \is_finite(\result); ensures \is_finite(f1); ensures \is_finite(f2) && -1 < f2 < 1; ensures -1 < f3 < 1; */ float f(void); typedef float FLOAT; /*@ assigns \result \from \nothing; ensures \is_finite(\result); */ FLOAT g(void); /*@ assigns \result \from \nothing; ensures \is_finite((float)\result); // Always true. */ int h(void); double y; int main(){ d4 = d(); f4 = f(); f5 = h(); // 2^31 - 1 is "rounded" to 2^31. by the assignment d5 = h(); f6 = g(); } frama-c-20.0-Calcium/tests/float/logic.i0000666000000000000000000001345013571573400014734 0ustar /* run.config* STDOPT: #"-warn-decimal-float all -float-hex" STDOPT: #"-warn-decimal-float all -float-hex -warn-special-float none" */ volatile v; volatile float any_float; volatile double any_double; void test_equality () { if (v) { double d = 0.1; //@ assert !(d == 0.1); } if (v) { double d = 0.1; //@ assert d == 0.1f; } if (v) { float f = 0.1; //@ assert !(f == 0.1); } // assert 0.1 == v; } /* Tests the evaluation of logic comparison operators. */ void test_comparison_evaluation () { /* Evaluation with singletons. */ float zero = 0.; float minus_zero = -0.; float one = 1.; /*@ check \eq_float(one, one); */ // true /*@ check \eq_float(zero, minus_zero); */ // true /*@ check \ne_float(zero, one); */ // true /*@ check \lt_float(zero, one); */ // true /*@ check \ge_float(minus_zero, zero); */ // true /*@ check \eq_float(zero, one); */ // false /*@ check \ne_float(one, one); */ // false /*@ check \ne_float(zero, minus_zero); */ // false /*@ check \lt_float(zero, minus_zero); */ // false if (v) { float inf = 1. / 0.; float nan = 0. / 0.; /*@ check \gt_float(inf, one); */ // true /*@ check \ge_float(inf, inf); */ // true /*@ check \le_float(inf, one); */ // false /*@ check \lt_float(inf, inf); */ // false /*@ check \ne_float(zero, nan); */ // true /*@ check \ne_float(inf, nan); */ // true /*@ check \ne_float(nan, nan); */ // true /*@ check \eq_float(one, nan); */ // false /*@ check \eq_float(nan, nan); */ // false /*@ check \ge_float(one, nan); */ // false /*@ check \ge_float(inf, nan); */ // false /*@ check \ge_float(nan, nan); */ // false } /* Evaluation with intervals. */ float higher = v ? 3.14 : 12.5; float middle = v ? 3.14 : -3.14; float lower = v ? -3.14 : -11.1; /*@ check \eq_float(middle, middle); */ // unknown /*@ check \ne_float(middle, middle); */ // unknown /*@ check \gt_float(middle, middle); */ // unknown /*@ check \ne_float(higher, lower); */ // true /*@ check \eq_float(higher, lower); */ // false /*@ check \ge_float(higher, middle); */ // true /*@ check \ge_float(higher, lower); */ // true /*@ check \gt_float(higher, middle); */ // unknown /*@ check \gt_float(higher, lower); */ // true /*@ check \ge_float(middle, higher); */ // unknown /*@ check \gt_float(middle, higher); */ // false /*@ check \gt_float(lower, higher); */ // false } /* Tests the reduction of a variable [d] evaluating to any double by the evaluation of a logic comparison with [bound]. */ void test_comparison_reduction (double bound) { double d = any_double; if (v) { /*@ assert d == bound; */ Frama_C_show_each_eq(bound, d); } if (v) { /*@ assert d < bound; */ Frama_C_show_each_lt(bound, d); } if (v) { /*@ assert d <= bound; */ Frama_C_show_each_lt(bound, d); } if (v) { /*@ assert \eq_double(d, bound); */ Frama_C_show_each_eq_double(bound, d); } if (v) { /*@ assert \lt_double(d, bound); */ Frama_C_show_each_lt_double(bound, d); } if (v) { /*@ assert \le_double(d, bound); */ Frama_C_show_each_le_double(bound, d); } if (v) { /*@ assert \ne_double(d, bound); */ Frama_C_show_each_ne_double(bound, d); } } /* Tests the evaluation and reduction by the builtin comparison operators eq_float, lt_float, etc. */ void test_builtin_comparisons () { test_comparison_evaluation(); /* Comparisons with a singleton bound. */ test_comparison_reduction(-1.); test_comparison_reduction(-0.); test_comparison_reduction(0.); test_comparison_reduction(0.1); /* Comparisons with an interval bound. */ double bound = -10.; if (v) bound = -1.; test_comparison_reduction(bound); if (v) bound = -0.; test_comparison_reduction(bound); if (v) bound = 0.; test_comparison_reduction(bound); if (v) bound = 0.1; test_comparison_reduction(bound); /* Comparisons with an infinite or NaN bound. */ if (v) { test_comparison_reduction(1. / 0.); test_comparison_reduction(0. / 0.); } } /*@ assigns \result \from f; ensures \is_finite(\result); ensures \result >= 0; ensures \result == f || \result == -f; */ float my_fabs(float f); /*@ assigns \nothing; ensures \is_finite(\result); ensures -1. < \result < 1.; */ float my_ratio_body(float f){ return f/(my_fabs( f) + 0.5); } /*@ assigns \nothing; ensures \is_finite(\result); ensures -1. < \result < 1.; */ float my_ratio(float f); void test_is_finite(void) { /*@ assert \is_finite((float)0.1); */ /* assert \is_finite((float)(0.1/0.0)); */ // false because the computation is done in real (result undefined) extern int undet; extern volatile int top_int; /* Reduces f1 from top_ival to top_float. */ float f1; * (int *) (&f1) = top_int; /*@ assert \is_finite(f1); */ // false, but we want to test the reduction /* Should not reduce the fs. */ float f2, f3; * (int *) (&f2) = top_int; * (int *) (&f3) = top_int; float *p; if (undet) p = &f2; else p = &f3; /*@ assert \is_finite(*p); */ // false, but we cannot learn anything by reduction (in the Cvalue domain /* Returns the exact value from the spec. */ float g1 = my_fabs(-3.3); float g2 = my_fabs(3.3); /* Tests that we could approximate the result */ float g3 = my_ratio(-3.3); /* Tests that is_finite validates the input. */ float g4 = my_ratio_body(-3.3); } int main () { test_equality(); test_builtin_comparisons(); test_is_finite(); } frama-c-20.0-Calcium/tests/float/math_builtins.c0000666000000000000000000004431413571573400016476 0ustar /* run.config* FILTER: sed -e '/f32__/ s/\([0-9][.][0-9]\{6\}\)[0-9]\{10\}/\1/g' COMMENT: 'sed' filter is a temporary workaround due to libc imprecisions STDOPT: +"-float-normal -eva -eva-no-memexec -eva-builtin sqrt:Frama_C_sqrt,exp:Frama_C_exp,log:Frama_C_log,log10:Frama_C_log10,cos:Frama_C_cos,sin:Frama_C_sin,atan2:Frama_C_atan2,pow:Frama_C_pow,fmod:Frama_C_fmod,sqrtf:Frama_C_sqrtf,expf:Frama_C_expf,logf:Frama_C_logf,log10f:Frama_C_log10f,powf:Frama_C_powf,floor:Frama_C_floor,ceil:Frama_C_ceil,trunc:Frama_C_trunc,round:Frama_C_round,floorf:Frama_C_floorf,ceilf:Frama_C_ceilf,truncf:Frama_C_truncf,roundf:Frama_C_roundf -then -print" */ #include static volatile int nondet; #define assert_bottom(exp) if (nondet) { exp; Frama_C_show_each_unreachable(); } double double_interval(double min, double max) { if (nondet) return min; else return max; } void test_cos_det() { double x = cos(1.); double y = cos(0.); double z = cos(-1.); } void test_sin_det() { double x = sin(1.); double y = sin(0.); double z = sin(-1.); } void test_atan2_det() { double a = atan2(1.,0.); double b = atan2(0.,1.); double c = atan2(1.,-0.); double d = atan2(-0.,1.); double e = atan2(-1.,0.); double f = atan2(-1.,0.); double g = atan2(-1.,-0.); double h = atan2(-1.,-0.); double i = atan2(0.,0.); double j = atan2(2.,1.); double k = atan2(-2.,1.); double l = atan2(2.,-1.); double m = atan2(-2.,-1.); } void test_atan2() { double x, y; y = double_interval(0.125, 10.); x = double_interval(0.125, 10.); double a = atan2(y, x); x = double_interval(-2.5, 3.); double b = atan2(y, x); y = double_interval(-1.25, -0.5); double c = atan2(y, x); x = double_interval(-3., -2.5); double d = atan2(y, x); x = double_interval(-0., +0.); double e = atan2(y, x); x = double_interval(1., 5.); y = double_interval(-1., -0.); double f = atan2(y, x); y = double_interval(0., 0.5); double g = atan2(y, x); y = double_interval(-0., 0.5); double h = atan2(y, x); y = double_interval(-0.5, 0.); double i = atan2(y, x); y = double_interval(-0., 0.); double j = atan2(y, x); double k = atan2(0., x); double l = atan2(-0., x); double m = atan2(0., -x); double n = atan2(-0., -x); } void test_pow_det() { double a = pow(1.,8.); double b = pow(0.,1.); double c = pow(12.,0.); double d = pow(2.25,0.25); double e = pow(178.25,0.25); double f = pow(129.5,-0.25); double g = pow(512.,-2.25); double h = pow(0.,0.); } void test_powf_det() { float f32__a = powf(1.,8.); float f32__b = powf(0.,1.); float f32__c = powf(12.,0.); float f32__d = powf(2.25,0.25); float f32__e = powf(178.25,0.25); float f32__f = powf(129.5,-0.25); float f32__g = powf(512.,-2.25); float f32__h = powf(0.,0.); } void test_pow_singleton_exp() { double x; x = double_interval(-3.5, -2.75); // error: x contains only negative values, and y is a non-integer assert_bottom(pow(x, 1.5)); // again, but with negative y assert_bottom(pow(x, -1.5)); // warning: x contains both negative and positive values, y is non-integer x = double_interval(-3.5, 2.75); double c = pow(x, 1.5); double d = pow(x, -1.5); // warning: x contains zero, and y is negative (but integer) double e = pow(x, -3.); // odd y -> Top double f = pow(x, -2.); // even y -> [0.epsilon,+oo] // warning: positive/negative overflow (large values) x = double_interval(1LL<<50, 1LL<<62); double g = pow(x, 19.5); x = double_interval(-(1LL<<49), -.75); double h = pow(x, 23.0); // partial underflow x = double_interval(0.125, 0.25); double i = pow(x, 500.); Frama_C_show_each_i(i); x = double_interval(1.25, 2.0); double j = pow(x, -1024.); Frama_C_show_each_j(j); // "clean" cases // x contains zero double k = pow(x, 2.5); double l = pow(x, 3.5); // x does not contain zero x = double_interval(0.25, 4.125); double m = pow(x, -2.25); double n = pow(x, -1.5); double o = pow(x, 0.25); double p = pow(x, 1.625); double q = pow(x, 4.); // x contains only negative values x = double_interval(-3.5, -0.125); double r = pow(x, -2.); double s = pow(x, -1.); } void test_pow() { double x, y; // special cases: y = 0, x = 1 y = double_interval(-18.5, 12.125); double a = pow(1.0, y); x = double_interval(-15.25, 32.75); double b = pow(x, 0.0); y = double_interval(-0.0, 0.0); double c = pow(x, y); // "general" case: y is not a singleton // test combinations of: x contains or not negative values; // y is assumed integer or not; // y crosses 1 x = double_interval(-4.0,7.5); y = double_interval(2.125, 2.875); double d = pow(x, y); y = double_interval(2.125, 4.875); double e = pow(x, y); y = double_interval(2.0, 3.0); double f = pow(x, y); y = double_interval(-0.75, -0.); x = double_interval(0.125,7.5); double g = pow(x, y); // y crosses 1 y = double_interval(0.25, 2.5); x = double_interval(0.5, 1.25); double h = pow(x, y); // x contains negative values x = double_interval(-1.0, 1.0); y = double_interval(-1.0, 1.0); // int(y) = [-1..1] double i = pow(x, y); x = double_interval(-1.0, 1.0); y = double_interval(-0.5, 1.0); // int(y) = [0..1] double j = pow(x, y); // y is positive but spans both even and odd numbers, and // x crosses 0; minimum value is (-13)^5 x = double_interval(-13.,430.); y = double_interval(3.,6.); double k = pow(x,y); // y is positive but spans both even and odd numbers, and x is negative x = double_interval(-4.,-2.); // maximum is (-4)^4 y = double_interval(3.,5.); double l = pow(x,y); // positive interval containing -0.0 x = double_interval(-0.,10.); y = double_interval(-0.,5.); double m = pow(x,y); // x contains -0.0, but y contains no odd integer x = double_interval(-0.0,10.0); y = double_interval(-4.5,-3.5); double n = pow(x,y); // negative x and non-integer y x = double_interval(-5.,-0.5); y = double_interval(-0.875,-0.125); assert_bottom(pow(x,y)); y = double_interval(-0.25,0.25); double o = pow(x,y); y = double_interval(10.,11.5); double p = pow(x,y); y = double_interval(-9876.5,1234.5); double q = pow(x,y); // +oo for all values of x and y x = double_interval(1e10, 1e11); y = double_interval(1e14, 1e15); assert_bottom(pow(x,y)); // -oo for all values of x and y x = double_interval(-1e11, -1e10); y = double_interval(1e14, 1e15); assert_bottom(pow(x,y)); y = double_interval(-0.5, 9.5); double r = pow(10.0,y); } void test_powf_singleton_exp() { float f32__x; f32__x = double_interval(-3.5, -2.75); // error: f32__x contains only negative values, and f32__y is a non-integer assert_bottom(powf(f32__x, 1.5)); // again, but with negative f32__y assert_bottom(powf(f32__x, -1.5)); // warning: f32__x contains both negative and positive values, f32__y is non-integer f32__x = double_interval(-3.5, 2.75); float f32__c = powf(f32__x, 1.5); float f32__d = powf(f32__x, -1.5); // warning: f32__x contains zero, and f32__y is negative (but integer) float f32__e = powf(f32__x, -3.); // odd f32__y -> Top float f32__f = powf(f32__x, -2.); // even f32__y -> [0,+oo] // warning: positive/negative overflow (large values) f32__x = double_interval(1LL<<20, 1LL<<21); float f32__g = powf(f32__x, 5.8); f32__x = double_interval(-(1LL<<49), -.75); float f32__h = powf(f32__x, 23.0); // partial underflow f32__x = double_interval(0.125, 0.25); float f32__i = powf(f32__x, 60.); Frama_C_show_each_i(f32__i); f32__x = double_interval(1.25, 2.0); float f32__j = powf(f32__x, -1024.); Frama_C_show_each_j(f32__j); // "clean" cases // f32__x contains zero float f32__k = powf(f32__x, 2.5); float f32__l = powf(f32__x, 3.5); // f32__x does not contain zero f32__x = double_interval(0.25, 4.125); float f32__m = powf(f32__x, -2.25); float f32__n = powf(f32__x, -1.5); float f32__o = powf(f32__x, 0.25); float f32__p = powf(f32__x, 1.625); float f32__q = powf(f32__x, 4.); // f32__x contains only negative values f32__x = double_interval(-3.5, -0.125); float f32__r = powf(f32__x, -2.); float f32__s = powf(f32__x, -1.); } void test_powf() { float f32__x, f32__y; // special cases: f32__y = 0, f32__x = 1 f32__y = double_interval(-18.5, 12.125); float f32__a = powf(1.0, f32__y); f32__x = double_interval(-15.25, 32.75); float f32__b = powf(f32__x, 0.0); f32__y = double_interval(-0.0, 0.0); float f32__c = powf(f32__x, f32__y); // "general" case: f32__y is not a singleton // test combinations of: f32__x contains or not negative values; // f32__y is assumed integer or not; // f32__y crosses 1 f32__x = double_interval(-4.0,7.5); f32__y = double_interval(2.125, 2.875); float f32__d = powf(f32__x, f32__y); f32__y = double_interval(2.125, 4.875); float f32__e = powf(f32__x, f32__y); f32__y = double_interval(2.0, 3.0); float f32__f = powf(f32__x, f32__y); f32__y = double_interval(-0.75, -0.); f32__x = double_interval(0.125,7.5); float f32__g = powf(f32__x, f32__y); // f32__y crosses 1 f32__y = double_interval(0.25, 2.5); f32__x = double_interval(0.5, 1.25); float f32__h = powf(f32__x, f32__y); // f32__x contains negative values, f32__y assumed integer f32__x = double_interval(-1.0, 1.0); f32__y = double_interval(-1.0, 1.0); float f32__i = powf(f32__x, f32__y); // f32__x contains negative values, but f32__y not assumed integer f32__x = double_interval(-1.0, 1.0); f32__y = double_interval(-0.5, 1.0); float f32__j = powf(f32__x, f32__y); // f32__y is positive but spans both even and odd numbers, and // f32__x crosses 0 f32__x = double_interval(-13.,430.); f32__y = double_interval(3.,6.); float f32__k = powf(f32__x,f32__y); // f32__y is positive but spans both even and odd numbers, and x is negative f32__x = double_interval(-4.,-2.); f32__y = double_interval(3.,5.); float f32__l = powf(f32__x,f32__y); // positive interval containing -0.0 f32__x = double_interval(-0.,10.); f32__y = double_interval(-0.,5.); float f32__m = powf(f32__x,f32__y); } void test_fmod_det() { double a = fmod(4.0, 2.25); double b = fmod(-4.0, 2.25); double c = fmod(-0.0, 2.25); double d = fmod(0.0, 2.25); double e = fmod(0.0, 0.0009765625); double f = fmod(1.25, 0.0009765625); assert_bottom(fmod(0.125, 0.0)); } void test_fmod() { double x, y; x = double_interval(2., 9.5); double a = fmod(x, 1.5); double b = fmod(x, -1.5); double c = fmod(-x, 1.5); double d = fmod(-x, -1.5); x = double_interval(.75, 1.25); double e = fmod(x, 1.5); double f = fmod(x, -1.5); x = double_interval(4., 5.5); y = double_interval(6.5, 8.); double g = fmod(x, y); x = double_interval(6.5, 8.); y = double_interval(4., 5.5); double h = fmod(x, y); double i = fmod(x, -y); x = double_interval(-9., 8.75); y = double_interval(-2., 4.5); double j = fmod(x, y); x = double_interval(-2., 4.5); y = double_interval(-9., 8.75); double k = fmod(x, y); y = double_interval(-0.0, 0.0); assert_bottom(fmod(x, y)); y = double_interval(0.0, 0.125); double l = fmod(x, y); y = double_interval(-0.125, -0.0); double m = fmod(x, y); x = double_interval(1e308, 1.1e308); double n = fmod(x, 0.001953125); // imprecise x = double_interval(-1.1e308, -1e308); double o = fmod(x, 0.001953125); // imprecise x = double_interval(1e308, 1.00001e308); double p = fmod(x, 0.001953125); // imprecise x = double_interval(1.600000000000001e11, 1.600000000000005e11); double q = fmod(x, 0.001953125); // precise x = double_interval(1.759218604000011e13, 1759218604000015e13); double r = fmod(x, 0.00195313); // imprecise x = double_interval(0.5, 0.505); double s = fmod(x, 0.1); x = -double_interval(0.5, 0.505); double t = fmod(x, 0.1); x = double_interval(-8, -6.5); double u = fmod(x, 4); x = double_interval(6, 7); y = double_interval(-5,-4); double v1 = fmod(x, y); y = double_interval(4,5); double v2 = fmod(x, y); x = double_interval(-7, -6); double v3 = fmod(x, y); y = double_interval(-5,-4); double v4 = fmod(x, y); x = double_interval(2,3); y = double_interval(-4,5); double w1 = fmod(x, y); x = double_interval(-2,3); double w2 = fmod(x, y); x = double_interval(-3,2); double w3 = fmod(x, y); } void test_sqrt_det() { double a = sqrt(42.125); double b = sqrt(0.125); assert_bottom(sqrt(-2.)); double c = sqrt(0.); double d = sqrt(-0.); } void test_sqrt() { double x = double_interval(-0.0, 5.0); double a = sqrt(x); x = double_interval(-6.5, 0.0); double b = sqrt(x); x = double_interval(-6.5, -0.0); double c = sqrt(x); x = double_interval(-6.5, -0.1); assert_bottom(sqrt(x)); } void test_sqrtf_det() { float f32__a = sqrtf(42.125); float f32__b = sqrtf(0.125); assert_bottom(sqrtf(-2.)); float f32__c = sqrtf(0.); float f32__d = sqrtf(-0.); } void test_sqrtf() { float f32__x = double_interval(-0.0, 5.0); float f32__a = sqrtf(f32__x); f32__x = double_interval(-6.5, 0.0); float b = sqrtf(f32__x); f32__x = double_interval(-6.5, -0.0); float c = sqrtf(f32__x); f32__x = double_interval(-6.5, -0.1); assert_bottom(sqrt(f32__x)); } void test_exp_det() { double a = exp(42.125); double b = exp(-2.); double c = exp(0.); double d = exp(-0.); double e = exp(-1.); assert_bottom(exp(1e100)); } void test_expf_det() { float f32__a = expf(42.125); float f32__b = expf(-2.); float f32__c = expf(0.); float f32__d = expf(-0.); float f32__e = expf(-1.); } void test_log_det() { double a = log(42.125); double b = log(0.125); assert_bottom(log(-2.)); assert_bottom(log(0.)); assert_bottom(log(-0.)); assert_bottom(log(-1.)); } void test_logf_det() { float f32__a = logf(42.125); float f32__b = logf(0.125); assert_bottom(logf(-2.)); assert_bottom(logf(0.)); assert_bottom(logf(-0.)); assert_bottom(logf(-1.)); } void test_log10_det() { double a = log10(42.125); double b = log10(0.125); assert_bottom(log10(-2.)); assert_bottom(log10(0.)); assert_bottom(log10(-0.)); assert_bottom(log10(-1.)); } void test_log10f_det() { float f32__a = log10f(42.125); float f32__b = log10f(0.125); assert_bottom(log10f(-2.)); assert_bottom(log10f(0.)); assert_bottom(log10f(-0.)); assert_bottom(log10f(-1.)); } void test_diff_pow_powf() { double d = pow(0.11, 30.); float f32__f = powf(0.11, 30.); } void test_floor_det() { double a = floor(1.5); double b = floor(0.5); double c = floor(0.0); double d = floor(-0.0); double e = floor(-0.5); double f = floor(-1.5); } void test_ceil_det() { double a = ceil(1.5); double b = ceil(0.5); double c = ceil(0.0); double d = ceil(-0.0); double e = ceil(-0.5); double f = ceil(-1.5); } void test_trunc_det() { double a = trunc(1.5); double b = trunc(0.5); double c = trunc(0.0); double d = trunc(-0.0); double e = trunc(-0.5); double f = trunc(-1.5); } void test_round_det() { double a = round(1.5); double b = round(0.5); double c = round(0.0); double d = round(-0.0); double e = round(-0.5); double f = round(-1.5); } void test_floor() { double x; x = double_interval(-0.5,1.5); double a = floor(x); x = double_interval(-0.0,0.5); double b = floor(x); x = double_interval(-2.5,-0.5); double c = floor(x); } void test_ceil() { double x; x = double_interval(-0.5,1.5); double a = ceil(x); x = double_interval(-0.0,0.5); double b = ceil(x); x = double_interval(-2.5,-0.5); double c = ceil(x); } void test_trunc() { double x; x = double_interval(-0.5,1.5); double a = trunc(x); x = double_interval(-0.0,0.5); double b = trunc(x); x = double_interval(-2.5,-0.5); double c = trunc(x); } void test_round() { double x; x = double_interval(-0.5,1.5); double a = round(x); x = double_interval(-0.0,0.5); double b = round(x); x = double_interval(-2.5,-0.5); double c = round(x); } void test_floorf_det() { float f32__a = floorf(1.5); float f32__b = floorf(0.5); float f32__c = floorf(0.0); float f32__d = floorf(-0.0); float f32__e = floorf(-0.5); float f32__f = floorf(-1.5); } void test_ceilf_det() { float f32__a = ceilf(1.5); float f32__b = ceilf(0.5); float f32__c = ceilf(0.0); float f32__d = ceilf(-0.0); float f32__e = ceilf(-0.5); float f32__f = ceilf(-1.5); } void test_truncf_det() { float f32__a = truncf(1.5); float f32__b = truncf(0.5); float f32__c = truncf(0.0); float f32__d = truncf(-0.0); float f32__e = truncf(-0.5); float f32__f = truncf(-1.5); } void test_roundf_det() { float f32__a = roundf(1.5); float f32__b = roundf(0.5); float f32__c = roundf(0.0); float f32__d = roundf(-0.0); float f32__e = roundf(-0.5); float f32__f = roundf(-1.5); } void test_floorf() { float f32__x; f32__x = double_interval(-0.5,1.5); float f32__a = floorf(f32__x); f32__x = double_interval(-0.0,0.5); float f32__b = floorf(f32__x); f32__x = double_interval(-2.5,-0.5); float f32__c = floorf(f32__x); } void test_ceilf() { float f32__x; f32__x = double_interval(-0.5,1.5); float f32__a = ceilf(f32__x); f32__x = double_interval(-0.0,0.5); float f32__b = ceilf(f32__x); f32__x = double_interval(-2.5,-0.5); float f32__c = ceilf(f32__x); } void test_truncf() { float f32__x; f32__x = double_interval(-0.5,1.5); float f32__a = truncf(f32__x); f32__x = double_interval(-0.0,0.5); float f32__b = truncf(f32__x); f32__x = double_interval(-2.5,-0.5); float f32__c = truncf(f32__x); } void test_roundf() { float f32__x; f32__x = double_interval(-0.5,1.5); float f32__a = roundf(f32__x); f32__x = double_interval(-0.0,0.5); float f32__b = roundf(f32__x); f32__x = double_interval(-2.5,-0.5); float f32__c = roundf(f32__x); } int main() { test_cos_det(); test_sin_det(); test_atan2_det(); test_atan2(); test_pow_det(); test_pow_singleton_exp(); test_pow(); test_fmod_det(); test_fmod(); test_sqrt_det(); test_sqrt(); test_exp_det(); test_log_det(); test_log10_det(); test_powf_det(); test_powf_singleton_exp(); test_powf(); test_sqrtf_det(); test_sqrtf(); test_expf_det(); test_logf_det(); test_log10f_det(); test_diff_pow_powf(); test_floor_det(); test_ceil_det(); test_trunc_det(); test_round_det(); test_floor(); test_ceil(); test_trunc(); test_round(); test_floorf_det(); test_ceilf_det(); test_truncf_det(); test_roundf_det(); test_floorf(); test_ceilf(); test_truncf(); test_roundf(); return 0; } frama-c-20.0-Calcium/tests/float/nonlin.c0000666000000000000000000000566213571573400015134 0ustar /* run.config* OPT: -eva-msg-key nonlin -slevel 30 -eva @EVA_CONFIG@ -cpp-extra-args="-DFLOAT=double" -float-hex -journal-disable -eva-subdivide-non-linear 0 OPT: -eva-msg-key nonlin -slevel 30 -eva @EVA_CONFIG@ -cpp-extra-args="-DFLOAT=double" -float-hex -journal-disable -eva-subdivide-non-linear 10 OPT: -eva-msg-key nonlin -slevel 30 -eva @EVA_CONFIG@ -cpp-extra-args="-DFLOAT=float" -float-hex -journal-disable -eva-subdivide-non-linear 0 OPT: -eva-msg-key nonlin -slevel 30 -eva @EVA_CONFIG@ -cpp-extra-args="-DFLOAT=float" -float-hex -journal-disable -eva-subdivide-non-linear 10 */ #include "__fc_builtin.h" FLOAT a, b, c, r1, r2, d, i, s, zf, s2, sq, h; int t[10]={1,2,3,4,5,6,7,8,9,10},r,x,y,z; void nonlin_f() { a = Frama_C_float_interval(5.0, 7.0); b = Frama_C_float_interval(0.0, 1.0); c = 7.0; d = a; /*@ assert (5.0 <= d) ; */ r1 = a + (b * (c - a)); /*@ assert (5.0 <= a <= 5.125) || (5.125 <= a <= 5.25) || (5.25 <= a <= 5.375) || (5.375 <= a <= 5.5) || (5.5 <= a <= 5.625) || (5.625 <= a <= 5.75) || (5.75 <= a <= 5.875) || (5.875 <= a <= 6.0) || (6.0 <= a <= 6.125) || (6.125 <= a <= 6.25) || (6.25 <= a <= 6.375) || (6.375 <= a <= 6.5) || (6.5 <= a <= 6.625) || (6.625 <= a <= 6.75) || (6.75 <= a <= 6.875) || (6.875 <= a <= 7.0) ; */ r2 = (b * (c - a)) + a; Frama_C_show_each_a_r2("a", a, "r2", r2); } unsigned long rbits1; int rbits2; int access_bits(FLOAT X ) { unsigned long x0; x0 = *((unsigned long *)(& X)); if (x0 > 2UL) return 1; rbits1 = x0; return 0; } volatile float v; void other() { i = Frama_C_float_interval(-133.0,142.0); s = Frama_C_float_interval(-133.0,142.0); r = 1 + t[(int)(i*i+2.0)]; z = (int)(10000.0 * (s - s)); zf = s - s; s2 = s + s; sq = s * s; h = s * (1 - s); rbits2 = access_bits(i); x = Frama_C_interval(0,42); y = (1 / x) * x; } void split_alarm() { // No alarm with sufficient subdivide-float-var float ff = v; double d = 1 / ((double)ff * ff + 0.000000001); } void norm() { float v1 = v; float v2 = v; double square = (double)v1*v1+(double)v2*v2; } // a bug resulted in an invalid interval due to the presence of garbled mix void garbled() { int x; float a = (float)((int)(&x + (int)&x)); float f = a + a; } // Tests possible bugs of the subdivision around the zero values. void around_zeros() { /* [f1] is the smallest positive float, and [f] has values in [-0 .. f1]. While [next_float_ieee -0. = f1], the interval [-0. .. f1] contains three float values, so its subdivision should not forget +0. */ float f1 = 1.4E-45; float f = Frama_C_float_interval(-0, f1); /* The +f-f is needed to activate the subdivisions. The [f1] value is removed from [f], which must become [-0. .. 0.] and not the singleton {-0.}. */ float res = f1 / (f+f-f - f1); } void main() { nonlin_f(); other (); split_alarm(); norm(); garbled(); around_zeros(); } frama-c-20.0-Calcium/tests/float/oracle/0000777000000000000000000000000013571573400014727 5ustar frama-c-20.0-Calcium/tests/float/oracle/absorb.res.oracle0000666000000000000000000000175413571573400020165 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. [from] Computing for function main [from] Computing for function Frama_C_interval <-main [from] Done for function Frama_C_interval [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) x FROM x; y (and SELF) y FROM x; y (and SELF) z FROM y t FROM Frama_C_entropy_source min_f FROM \nothing min_fl FROM \nothing den FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: Frama_C_entropy_source; x; y; z; t; min_f; min_fl; den; b; tmp [inout] Inputs for function main: Frama_C_entropy_source; x; y; min_f frama-c-20.0-Calcium/tests/float/oracle/absorb_sav.err0000666000000000000000000000000013571573400017550 0ustar frama-c-20.0-Calcium/tests/float/oracle/absorb_sav.res0000666000000000000000000000046213571573400017565 0ustar [kernel] Parsing tests/float/absorb.c (with preprocessing) [kernel:parser:decimal-float] tests/float/absorb.c:17: Warning: Floating-point constant 1e-286 is not represented exactly. Will use 0x1.e74404f3daadbp-951. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) frama-c-20.0-Calcium/tests/float/oracle/absorb_sav2.err0000666000000000000000000000000013571573400017632 0ustar frama-c-20.0-Calcium/tests/float/oracle/absorb_sav2.res0000666000000000000000000000213613571573400017647 0ustar [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0x1.0000000000000p0} y ∈ {0} z ∈ {0} t ∈ {0} min_f ∈ {0} min_fl ∈ {0} den ∈ {0} [eva] computing for function Frama_C_interval <- main. Called from tests/float/absorb.c:15. [eva] using specification for function Frama_C_interval [eva] tests/float/absorb.c:15: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/float/absorb.c:18: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] x ∈ {0x1.0000000000000p0} y ∈ {0x1.0000000000000p0} z ∈ {0} t ∈ [-0x1.bc16d60000000p61 .. 0x1.bc16d60000000p61] min_f ∈ {0x1.0000000000000p-126} min_fl ∈ {-0x1.0000000000000p-126} den ∈ {0x1.0000000000000p-133} b ∈ [-4000000004000000001..4000000004000000001] frama-c-20.0-Calcium/tests/float/oracle/alarms.0.res.oracle0000666000000000000000000001412213571573400020323 0ustar [kernel] Parsing tests/float/alarms.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization u1 ∈ {0} u2 ∈ {0} f ∈ {0} d ∈ {0} big ∈ {0} ull ∈ {0} rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/float/alarms.i:70. [eva:alarm] tests/float/alarms.i:16: Warning: non-finite float value. assert \is_finite(u1.f); [eva:alarm] tests/float/alarms.i:18: Warning: non-finite double value. assert \is_finite(u2.d); [eva] tests/float/alarms.i:19: Frama_C_dump_each: # Cvalue domain: u1{.l[bits 0 to 31]; .f; .d[bits 0 to 31]} ∈ [-3.40282346639e+38 .. 3.40282346639e+38] {.l[bits 32 to 63]; .f[bits 32 to 63]; .d[bits 32 to 63]} ∈ [--..--] u2{.l; .f[bits 0 to 63]; .d} ∈ [-1.79769313486e+308 .. 1.79769313486e+308] f ∈ [-3.40282346639e+38 .. 3.40282346639e+38] d ∈ [-1.79769313486e+308 .. 1.79769313486e+308] big ∈ {0} ull ∈ {0} rand ∈ [--..--] l ∈ [--..--] tmp ∈ UNINITIALIZED l ∈ [--..--] ==END OF DUMP== [eva] computing for function fd <- main1 <- main. Called from tests/float/alarms.i:21. [kernel:annot:missing-spec] tests/float/alarms.i:21: Warning: Neither code nor specification for function fd, generating default assigns from the prototype [eva] using specification for function fd [eva] Done for function fd [eva:alarm] tests/float/alarms.i:21: Warning: non-finite double value. assert \is_finite(tmp); (tmp from fd()) [eva:alarm] tests/float/alarms.i:21: Warning: non-finite float value. assert \is_finite((float)tmp); (tmp from fd()) [eva] computing for function fd <- main1 <- main. Called from tests/float/alarms.i:22. [eva] Done for function fd [eva:alarm] tests/float/alarms.i:23: Warning: non-finite double value. assert \is_finite(vd); [eva:alarm] tests/float/alarms.i:23: Warning: overflow in conversion from floating-point to integer. assert -9223372036854775809 < vd; [eva:alarm] tests/float/alarms.i:23: Warning: overflow in conversion from floating-point to integer. assert vd < 9223372036854775808; [eva:alarm] tests/float/alarms.i:24: Warning: overflow in conversion from floating-point to integer. assert -9223372036854775809 < vf; [eva:alarm] tests/float/alarms.i:24: Warning: overflow in conversion from floating-point to integer. assert vf < 9223372036854775808; [eva] computing for function fd <- main1 <- main. Called from tests/float/alarms.i:25. [eva] Done for function fd [eva:alarm] tests/float/alarms.i:26: Warning: non-finite double value. assert \is_finite(vd); [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/float/alarms.i:71. [eva:alarm] tests/float/alarms.i:38: Warning: non-finite double value. assert \is_finite((double)(1. / 0.)); [eva:alarm] tests/float/alarms.i:39: Warning: non-finite double value. assert \is_finite((double)(0. / 0.)); [eva] tests/float/alarms.i:41: assertion got status valid. [eva] tests/float/alarms.i:42: assertion got status valid. [eva] tests/float/alarms.i:43: assertion got status valid. [eva] tests/float/alarms.i:44: assertion got status valid. [eva:alarm] tests/float/alarms.i:46: Warning: non-finite double value. assert \is_finite((double)(1. / 0.)); [eva:alarm] tests/float/alarms.i:50: Warning: non-finite double value. assert \is_finite((double)(0. / 0.)); [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/float/alarms.i:72. [eva] computing for function fd <- main3 <- main. Called from tests/float/alarms.i:64. [eva] Done for function fd [eva:alarm] tests/float/alarms.i:65: Warning: non-finite double value. assert \is_finite(d_0); [eva] computing for function fabs <- main3 <- main. Called from tests/float/alarms.i:65. [eva] Recording results for fabs [eva] Done for function fabs [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] tests/float/alarms.i:38: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/alarms.i:39: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/alarms.i:46: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/alarms.i:50: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fabs: __retres ∈ [0. .. 1.79769313486e+308] [eva:final-states] Values at end of function main1: u1{.l[bits 0 to 31]; .f; .d[bits 0 to 31]} ∈ [-3.40282346639e+38 .. 3.40282346639e+38] {.l[bits 32 to 63]; .f[bits 32 to 63]; .d[bits 32 to 63]} ∈ [--..--] u2{.l; .f[bits 0 to 63]; .d} ∈ [-1.79769313486e+308 .. 1.79769313486e+308] f ∈ [-3.40282346639e+38 .. 3.40282346639e+38] d ∈ [-1.79769313486e+308 .. 1.79769313486e+308] big ∈ {1.38350580553e+19} ull ∈ {13835058055282163712} vf ∈ [-9.22337203685e+18 .. 9.2233714871e+18] vd ∈ [-1.79769313486e+308 .. 1.79769313486e+308] i ∈ [-9223372036854775808..9223372036854774784] j ∈ [-9223372036854775808..9223371487098961920] mvd ∈ [-4.49423283716e+307 .. 4.49423283716e+307] [eva:final-states] Values at end of function main2: f_0 ∈ [-3. .. 17.] f_infinity ∈ [-3. .. 17.] f_nan ∈ [-3. .. 17.] f_infinity_nan ∈ [-3. .. 17.] [eva:final-states] Values at end of function main3: d_0 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] r ∈ [0. .. 1.79769313486e+308] [eva:final-states] Values at end of function main: u1{.l[bits 0 to 31]; .f; .d[bits 0 to 31]} ∈ [-3.40282346639e+38 .. 3.40282346639e+38] {.l[bits 32 to 63]; .f[bits 32 to 63]; .d[bits 32 to 63]} ∈ [--..--] u2{.l; .f[bits 0 to 63]; .d} ∈ [-1.79769313486e+308 .. 1.79769313486e+308] f ∈ [-3.40282346639e+38 .. 3.40282346639e+38] d ∈ [-1.79769313486e+308 .. 1.79769313486e+308] big ∈ {1.38350580553e+19} ull ∈ {13835058055282163712} frama-c-20.0-Calcium/tests/float/oracle/alarms.1.res.oracle0000666000000000000000000001232113571573400020323 0ustar [kernel] Parsing tests/float/alarms.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization u1 ∈ {0} u2 ∈ {0} f ∈ {0} d ∈ {0} big ∈ {0} ull ∈ {0} rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/float/alarms.i:70. [eva:alarm] tests/float/alarms.i:16: Warning: NaN float value. assert ¬\is_NaN(u1.f); [eva:alarm] tests/float/alarms.i:18: Warning: NaN double value. assert ¬\is_NaN(u2.d); [eva] tests/float/alarms.i:19: Frama_C_dump_each: # Cvalue domain: u1{.l[bits 0 to 31]; .f; .d[bits 0 to 31]} ∈ [-inf .. inf] {.l[bits 32 to 63]; .f[bits 32 to 63]; .d[bits 32 to 63]} ∈ [--..--] u2{.l; .f[bits 0 to 63]; .d} ∈ [-inf .. inf] f ∈ [-inf .. inf] d ∈ [-inf .. inf] big ∈ {0} ull ∈ {0} rand ∈ [--..--] l ∈ [--..--] tmp ∈ UNINITIALIZED l ∈ [--..--] ==END OF DUMP== [eva] computing for function fd <- main1 <- main. Called from tests/float/alarms.i:21. [kernel:annot:missing-spec] tests/float/alarms.i:21: Warning: Neither code nor specification for function fd, generating default assigns from the prototype [eva] using specification for function fd [eva] Done for function fd [eva:alarm] tests/float/alarms.i:21: Warning: NaN double value. assert ¬\is_NaN(tmp); (tmp from fd()) [eva] computing for function fd <- main1 <- main. Called from tests/float/alarms.i:22. [eva] Done for function fd [eva:alarm] tests/float/alarms.i:23: Warning: non-finite double value. assert \is_finite(vd); [eva:alarm] tests/float/alarms.i:23: Warning: NaN double value. assert ¬\is_NaN(vd); [eva:alarm] tests/float/alarms.i:23: Warning: overflow in conversion from floating-point to integer. assert -9223372036854775809 < vd; [eva:alarm] tests/float/alarms.i:23: Warning: overflow in conversion from floating-point to integer. assert vd < 9223372036854775808; [eva:alarm] tests/float/alarms.i:24: Warning: non-finite float value. assert \is_finite(vf); [eva:alarm] tests/float/alarms.i:24: Warning: overflow in conversion from floating-point to integer. assert -9223372036854775809 < vf; [eva:alarm] tests/float/alarms.i:24: Warning: overflow in conversion from floating-point to integer. assert vf < 9223372036854775808; [eva] computing for function fd <- main1 <- main. Called from tests/float/alarms.i:25. [eva] Done for function fd [eva:alarm] tests/float/alarms.i:26: Warning: NaN double value. assert ¬\is_NaN(vd); [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/float/alarms.i:71. [eva:alarm] tests/float/alarms.i:39: Warning: NaN double value. assert ¬\is_NaN((double)(0. / 0.)); [eva] tests/float/alarms.i:41: assertion got status valid. [eva] tests/float/alarms.i:42: assertion got status valid. [eva] tests/float/alarms.i:43: assertion got status valid. [eva] tests/float/alarms.i:44: assertion got status valid. [eva] tests/float/alarms.i:47: assertion got status valid. [eva:alarm] tests/float/alarms.i:50: Warning: NaN double value. assert ¬\is_NaN((double)(0. / 0.)); [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/float/alarms.i:72. [eva] computing for function fd <- main3 <- main. Called from tests/float/alarms.i:64. [eva] Done for function fd [eva:alarm] tests/float/alarms.i:65: Warning: NaN double value. assert ¬\is_NaN(d_0); [eva] computing for function fabs <- main3 <- main. Called from tests/float/alarms.i:65. [eva] Recording results for fabs [eva] Done for function fabs [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] tests/float/alarms.i:39: assertion 'Eva,is_nan' got final status invalid. [eva] tests/float/alarms.i:50: assertion 'Eva,is_nan' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fabs: __retres ∈ [0. .. inf] [eva:final-states] Values at end of function main1: u1{.l[bits 0 to 31]; .f; .d[bits 0 to 31]} ∈ [-inf .. inf] {.l[bits 32 to 63]; .f[bits 32 to 63]; .d[bits 32 to 63]} ∈ [--..--] u2{.l; .f[bits 0 to 63]; .d} ∈ [-inf .. inf] f ∈ [-inf .. inf] d ∈ [-inf .. inf] big ∈ {1.38350580553e+19} ull ∈ {13835058055282163712} vf ∈ [-9.22337203685e+18 .. 9.2233714871e+18] vd ∈ [-inf .. inf] i ∈ [-9223372036854775808..9223372036854774784] j ∈ [-9223372036854775808..9223371487098961920] mvd ∈ [-inf .. inf] [eva:final-states] Values at end of function main2: f_0 ∈ [-3. .. 17.] f_infinity ∈ [-3. .. inf] f_nan ∈ [-3. .. 17.] f_infinity_nan ∈ [-3. .. inf] [eva:final-states] Values at end of function main3: d_0 ∈ [-inf .. inf] r ∈ [0. .. inf] [eva:final-states] Values at end of function main: u1{.l[bits 0 to 31]; .f; .d[bits 0 to 31]} ∈ [-inf .. inf] {.l[bits 32 to 63]; .f[bits 32 to 63]; .d[bits 32 to 63]} ∈ [--..--] u2{.l; .f[bits 0 to 63]; .d} ∈ [-inf .. inf] f ∈ [-inf .. inf] d ∈ [-inf .. inf] big ∈ {1.38350580553e+19} ull ∈ {13835058055282163712} frama-c-20.0-Calcium/tests/float/oracle/alarms.2.res.oracle0000666000000000000000000001012313571573400020322 0ustar [kernel] Parsing tests/float/alarms.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization u1 ∈ {0} u2 ∈ {0} f ∈ {0} d ∈ {0} big ∈ {0} ull ∈ {0} rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/float/alarms.i:70. [eva] tests/float/alarms.i:19: Frama_C_dump_each: # Cvalue domain: u1 ∈ [--..--] u2 ∈ [--..--] f ∈ [-inf .. inf] ∪ {NaN} d ∈ [-inf .. inf] ∪ {NaN} big ∈ {0} ull ∈ {0} rand ∈ [--..--] l ∈ [--..--] tmp ∈ UNINITIALIZED l ∈ [--..--] ==END OF DUMP== [eva] computing for function fd <- main1 <- main. Called from tests/float/alarms.i:21. [kernel:annot:missing-spec] tests/float/alarms.i:21: Warning: Neither code nor specification for function fd, generating default assigns from the prototype [eva] using specification for function fd [eva] Done for function fd [eva] computing for function fd <- main1 <- main. Called from tests/float/alarms.i:22. [eva] Done for function fd [eva:alarm] tests/float/alarms.i:23: Warning: non-finite double value. assert \is_finite(vd); [eva:alarm] tests/float/alarms.i:23: Warning: overflow in conversion from floating-point to integer. assert -9223372036854775809 < vd; [eva:alarm] tests/float/alarms.i:23: Warning: overflow in conversion from floating-point to integer. assert vd < 9223372036854775808; [eva:alarm] tests/float/alarms.i:24: Warning: non-finite float value. assert \is_finite(vf); [eva:alarm] tests/float/alarms.i:24: Warning: overflow in conversion from floating-point to integer. assert -9223372036854775809 < vf; [eva:alarm] tests/float/alarms.i:24: Warning: overflow in conversion from floating-point to integer. assert vf < 9223372036854775808; [eva] computing for function fd <- main1 <- main. Called from tests/float/alarms.i:25. [eva] Done for function fd [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/float/alarms.i:71. [eva] tests/float/alarms.i:41: assertion got status valid. [eva] tests/float/alarms.i:42: assertion got status valid. [eva:alarm] tests/float/alarms.i:43: Warning: assertion got status unknown. [eva:alarm] tests/float/alarms.i:44: Warning: assertion got status unknown. [eva] tests/float/alarms.i:47: assertion got status valid. [eva:alarm] tests/float/alarms.i:51: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/float/alarms.i:72. [eva] computing for function fd <- main3 <- main. Called from tests/float/alarms.i:64. [eva] Done for function fd [eva] computing for function fabs <- main3 <- main. Called from tests/float/alarms.i:65. [eva] Recording results for fabs [eva] Done for function fabs [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fabs: __retres ∈ [0. .. inf] ∪ {NaN} [eva:final-states] Values at end of function main1: u1 ∈ [--..--] u2 ∈ [--..--] f ∈ [-inf .. inf] ∪ {NaN} d ∈ [-inf .. inf] ∪ {NaN} big ∈ {1.38350580553e+19} ull ∈ {13835058055282163712} vf ∈ [-9.22337203685e+18 .. 9.2233714871e+18] vd ∈ [-inf .. inf] ∪ {NaN} i ∈ [-9223372036854775808..9223372036854774784] j ∈ [-9223372036854775808..9223371487098961920] mvd ∈ [-inf .. inf] ∪ {NaN} [eva:final-states] Values at end of function main2: f_0 ∈ [-3. .. 17.] f_infinity ∈ [-3. .. inf] f_nan ∈ [-3. .. 17.] f_infinity_nan ∈ [-3. .. inf] [eva:final-states] Values at end of function main3: d_0 ∈ [-inf .. inf] ∪ {NaN} r ∈ [0. .. inf] ∪ {NaN} [eva:final-states] Values at end of function main: u1 ∈ [--..--] u2 ∈ [--..--] f ∈ [-inf .. inf] ∪ {NaN} d ∈ [-inf .. inf] ∪ {NaN} big ∈ {1.38350580553e+19} ull ∈ {13835058055282163712} frama-c-20.0-Calcium/tests/float/oracle/builtins.res.oracle0000666000000000000000000002101113571573400020532 0ustar [kernel] Parsing tests/float/builtins.c (with preprocessing) [kernel:parser:decimal-float] tests/float/builtins.c:55: Warning: Floating-point constant 2.72 is not represented exactly. Will use 0x1.5c28f5c28f5c3p1. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function Frama_C_float_interval <- main. Called from tests/float/builtins.c:12. [eva] using specification for function Frama_C_float_interval [eva] tests/float/builtins.c:12: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/builtins.c:12: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_double_interval <- main. Called from tests/float/builtins.c:13. [eva] using specification for function Frama_C_double_interval [eva] tests/float/builtins.c:13: function Frama_C_double_interval: precondition 'finite' got status valid. [eva] tests/float/builtins.c:13: function Frama_C_double_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_double_interval [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] f ∈ [-1. .. 1.] d ∈ [-1. .. 1.] [eva] Analyzing a complete application starting at main_log_exp [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] tests/float/builtins.c:51: Call to builtin log [eva] tests/float/builtins.c:51: function log: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:51: function log: precondition 'arg_positive' got status valid. [eva] tests/float/builtins.c:52: Call to builtin log10 [eva] tests/float/builtins.c:52: function log10: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:52: function log10: precondition 'arg_positive' got status valid. [eva] tests/float/builtins.c:55: Call to builtin log [eva] tests/float/builtins.c:55: function log: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:55: function log: precondition 'arg_positive' got status valid. [eva] tests/float/builtins.c:56: Call to builtin log10 [eva] tests/float/builtins.c:56: function log10: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:56: function log10: precondition 'arg_positive' got status valid. [eva] tests/float/builtins.c:59: Call to builtin log [eva] tests/float/builtins.c:59: function log: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:59: function log: precondition 'arg_positive' got status valid. [eva] tests/float/builtins.c:60: Call to builtin log10 [eva] tests/float/builtins.c:60: function log10: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:60: function log10: precondition 'arg_positive' got status valid. [eva:alarm] tests/float/builtins.c:63: Warning: assertion got status unknown. [eva] tests/float/builtins.c:64: Call to builtin log [eva] tests/float/builtins.c:64: function log: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:64: function log: precondition 'arg_positive' got status valid. [eva:alarm] tests/float/builtins.c:67: Warning: assertion got status unknown. [eva] tests/float/builtins.c:68: Call to builtin log10 [eva] tests/float/builtins.c:68: function log10: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:68: function log10: precondition 'arg_positive' got status valid. [eva] tests/float/builtins.c:72: Call to builtin log [eva] tests/float/builtins.c:72: function log: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/builtins.c:72: Warning: function log: precondition 'arg_positive' got status unknown. [eva] tests/float/builtins.c:75: Call to builtin log10 [eva] tests/float/builtins.c:75: function log10: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/builtins.c:75: Warning: function log10: precondition 'arg_positive' got status unknown. [eva] tests/float/builtins.c:78: Call to builtin log [eva] tests/float/builtins.c:78: function log: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/builtins.c:78: Warning: function log: precondition 'arg_positive' got status invalid. [eva] tests/float/builtins.c:81: Call to builtin log10 [eva] tests/float/builtins.c:81: function log10: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/builtins.c:81: Warning: function log10: precondition 'arg_positive' got status invalid. [eva] tests/float/builtins.c:85: Call to builtin exp [eva] tests/float/builtins.c:85: function exp: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:85: function exp: precondition 'finite_domain' got status valid. [eva] tests/float/builtins.c:88: Call to builtin exp [eva] tests/float/builtins.c:88: function exp: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:88: function exp: precondition 'finite_domain' got status valid. [eva] tests/float/builtins.c:91: Call to builtin exp [eva] tests/float/builtins.c:91: function exp: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:91: function exp: precondition 'finite_domain' got status valid. [eva:alarm] tests/float/builtins.c:94: Warning: assertion got status unknown. [eva] tests/float/builtins.c:95: Call to builtin exp [eva] tests/float/builtins.c:95: function exp: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/builtins.c:95: Warning: function exp: precondition 'finite_domain' got status unknown. [eva] tests/float/builtins.c:98: Call to builtin exp [eva] tests/float/builtins.c:98: function exp: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/builtins.c:98: Warning: function exp: precondition 'finite_domain' got status invalid. [eva] tests/float/builtins.c:102: Call to builtin log [eva] tests/float/builtins.c:102: function log: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:102: function log: precondition 'arg_positive' got status valid. [eva] tests/float/builtins.c:103: assertion got status valid. [eva] tests/float/builtins.c:104: Call to builtin exp [eva] tests/float/builtins.c:104: function exp: precondition 'finite_arg' got status valid. [eva] tests/float/builtins.c:104: function exp: precondition 'finite_domain' got status valid. [eva:alarm] tests/float/builtins.c:107: Warning: non-finite double value. assert \is_finite((double)((int)(&d))); [eva] tests/float/builtins.c:107: Call to builtin log [eva:alarm] tests/float/builtins.c:107: Warning: function log: precondition 'finite_arg' got status unknown. [eva:alarm] tests/float/builtins.c:107: Warning: function log: precondition 'arg_positive' got status unknown. [eva] tests/float/builtins.c:107: function Frama_C_log applied to address [eva] tests/float/builtins.c:107: Assigning imprecise value to l7. The imprecision originates from Arithmetic {tests/float/builtins.c:107} [eva:alarm] tests/float/builtins.c:111: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for main_log_exp [eva] done for function main_log_exp [eva] tests/float/builtins.c:111: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main_log_exp: l1 ∈ {0} or UNINITIALIZED l2 ∈ {1.00063188031} or UNINITIALIZED l3 ∈ {1.09861228867} or UNINITIALIZED l4 ∈ [2.30258509299 .. 4.60517018599] or UNINITIALIZED l5 ∈ [-1.79769313486e+308 .. 709.782712893] or UNINITIALIZED l6 ∈ UNINITIALIZED l7 ∈ {{ garbled mix of &{d} (origin: Arithmetic {tests/float/builtins.c:107}) }} or UNINITIALIZED l8 ∈ UNINITIALIZED m1 ∈ {0} or UNINITIALIZED m2 ∈ {1.} or UNINITIALIZED m3 ∈ {1.30102999566} or UNINITIALIZED m4 ∈ [1. .. 2.00432137378] or UNINITIALIZED m5 ∈ [-1.79769313486e+308 .. 308.25471556] or UNINITIALIZED m6 ∈ UNINITIALIZED e1 ∈ {1.} or UNINITIALIZED e2 ∈ {0} or UNINITIALIZED e3 ∈ {2.68811714182e+43} or UNINITIALIZED e4 ∈ [2.68811714182e+43 .. 1.79769313486e+308] or UNINITIALIZED e5 ∈ UNINITIALIZED e6 ∈ {1.79769313486e+308} or UNINITIALIZED frama-c-20.0-Calcium/tests/float/oracle/cast.res.oracle0000666000000000000000000000307513571573400017645 0ustar [kernel] Parsing tests/float/cast.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:alarm] tests/float/cast.i:11: Warning: non-finite double value. assert \is_finite(v); [eva:alarm] tests/float/cast.i:11: Warning: non-finite float value. assert \is_finite((float)v); [eva] computing for function assert_subnormal <- main. Called from tests/float/cast.i:15. [eva] using specification for function assert_subnormal [eva] tests/float/cast.i:15: function assert_subnormal: precondition \is_finite(d) got status valid. [eva:alarm] tests/float/cast.i:15: Warning: function assert_subnormal: precondition 0.0 < d < 0x1p-1022 got status unknown. [eva] Done for function assert_subnormal [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Computing for function assert_subnormal <-main [from] Done for function assert_subnormal [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function assert_subnormal: NO EFFECTS [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: f [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/float/oracle/cond.res.oracle0000666000000000000000000000365213571573400017637 0ustar [kernel] Parsing tests/float/cond.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} dx ∈ {0} dy ∈ {0} dz ∈ {0} dt ∈ {0} c1 ∈ {0} c2 ∈ {0} [eva] computing for function Frama_C_float_interval <- main. Called from tests/float/cond.c:12. [eva] using specification for function Frama_C_float_interval [eva] tests/float/cond.c:12: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/cond.c:12: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_float_interval <- main. Called from tests/float/cond.c:15. [eva] tests/float/cond.c:15: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/cond.c:15: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva:alarm] tests/float/cond.c:18: Warning: assertion got status unknown. [eva] computing for function Frama_C_float_interval <- main. Called from tests/float/cond.c:20. [eva] tests/float/cond.c:20: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/cond.c:20: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] x ∈ [-0x0.0000000000000p-1022 .. 0x1.4000000000000p3] dx ∈ [0x1.0000000000001p0 .. 0x1.4000000000000p3] dz ∈ [0x1.0000000000001p0 .. 0x1.4000000000000p3] dt ∈ [-0x1.4000000000000p3 .. 0x1.fffffffffffffp-1] c1 ∈ {1} frama-c-20.0-Calcium/tests/float/oracle/cond_cast_int_to_float.res.oracle0000666000000000000000000001220413571573400023403 0ustar [kernel] Parsing tests/float/cond_cast_int_to_float.c (with preprocessing) [kernel:parser:decimal-float] tests/float/cond_cast_int_to_float.c:18: Warning: Floating-point constant 30.1f is not represented exactly. Will use 0x1.e1999a0000000p4. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:alarm] tests/float/cond_cast_int_to_float.c:15: Warning: function main: precondition got status unknown. [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:18. [eva] using specification for function __assert [eva] tests/float/cond_cast_int_to_float.c:18: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:18: Frama_C_show_each_then: {18}, [31..10000] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:18. [eva] tests/float/cond_cast_int_to_float.c:18: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:18: Frama_C_show_each_else: {18}, [-10000..30] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:19. [eva] tests/float/cond_cast_int_to_float.c:19: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:19: Frama_C_show_each_then: {19}, [31..10000] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:19. [eva] tests/float/cond_cast_int_to_float.c:19: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:19: Frama_C_show_each_else: {19}, [-10000..30] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:20. [eva] tests/float/cond_cast_int_to_float.c:20: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:20: Frama_C_show_each_then: {20}, [30..10000] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:20. [eva] tests/float/cond_cast_int_to_float.c:20: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:20: Frama_C_show_each_else: {20}, [-10000..29] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:22. [eva] tests/float/cond_cast_int_to_float.c:22: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:22: Frama_C_show_each_then: {22}, [-30..10000] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:22. [eva] tests/float/cond_cast_int_to_float.c:22: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:22: Frama_C_show_each_else: {22}, [-10000..-31] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:23. [eva] tests/float/cond_cast_int_to_float.c:23: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:23: Frama_C_show_each_then: {23}, [-30..10000] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:23. [eva] tests/float/cond_cast_int_to_float.c:23: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:23: Frama_C_show_each_else: {23}, [-10000..-31] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:24. [eva] tests/float/cond_cast_int_to_float.c:24: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:24: Frama_C_show_each_then: {24}, [-29..10000] [eva] computing for function __assert <- main. Called from tests/float/cond_cast_int_to_float.c:24. [eva] tests/float/cond_cast_int_to_float.c:24: function __assert: precondition got status valid. [eva] Done for function __assert [eva] tests/float/cond_cast_int_to_float.c:24: Frama_C_show_each_else: {24}, [-10000..-30] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Computing for function __assert <-main [from] Done for function __assert [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function __assert: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/float/oracle/const.res.oracle0000666000000000000000000002776113571573400020051 0ustar [kernel] Parsing tests/float/const.i (no preprocessing) [kernel:parser:decimal-float] tests/float/const.i:21: Warning: Floating-point constant 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024703282292062327208828439643411068618252990130716238221279284125033775363510437593264991818081799618989828234772285886546332835517796989819938739800539093906315035659515570226392290858392449105184435931802849936536152500319370457678249219365623669863658480757001585769269903706311928279558551332927834338409351978015531246597263579574622766465272827220056374006485499977096599470454020828166226237857393450736339007967761930577506740176324673600968951340535537458516661134223766678604162159680461914467291840300530057530849048765391711386591646239524912623653881879636239373280423891018672348497668235089863388587925628302755995657524455507255189313690836254779186948667994968324049705821028513185451396213837722826145437693412532098591327667236328125 is not represented exactly. Will use 0x0.0000000000000p-1022. [kernel:parser:decimal-float] tests/float/const.i:22: Warning: Floating-point constant 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002470328229206232720882843964341106861825299013071623822127928412503377536351043759326499181808179961898982823477228588654633283551779698981993873980053909390631503565951557022639229085839244910518443593180284993653615250031937045767824921936562366986365848075700158576926990370631192827955855133292783433840935197801553124659726357957462276646527282722005637400648549997709659947045402082816622623785739345073633900796776193057750674017632467360096895134053553745851666113422376667860416215968046191446729184030053005753084904876539171138659164623952491262365388187963623937328042389101867234849766823508986338858792562830275599565752445550725518931369083625477918694866799496832404970582102851318545139621383772282614543769341253209859132766723632812501 is not represented exactly. Will use 0x0.0000000000001p-1022. [kernel:parser:decimal-float] tests/float/const.i:23: Warning: Floating-point constant 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002470328229206232720882843964341106861825299013071623822127928412503377536351043759326499181808179961898982823477228588654633283551779698981993873980053909390631503565951557022639229085839244910518443593180284993653615250031937045767824921936562366986365848075700158576926990370631192827955855133292783433840935197801553124659726357957462276646527282722005637400648549997709659947045402082816622623785739345073633900796776193057750674017632467360096895134053553745851666113422376667860416215968046191446729184030053005753084904876539171138659164623952491262365388187963623937328042389101867234849766823508986338858792562830275599565752445550725518931369083625477918694866799496832404970582102851318545139621383772282614543769341253209859132766723632812499 is not represented exactly. Will use 0x0.0000000000000p-1022. [kernel:parser:decimal-float] tests/float/const.i:26: Warning: Floating-point constant 0.0000000000000000000000000000000000000000000014012984643248170709237295832899161312802619418765157717570682838897910826858606014866381883621215820312499 is not represented exactly. Will use 0x1.0000000000000p-149. [kernel:parser:decimal-float] tests/float/const.i:27: Warning: Floating-point constant 0.0000000000000000000000000000000000000000000014012984643248170709237295832899161312802619418765157717570682838897910826858606014866381883621215820312501 is not represented exactly. Will use 0x1.0000000000000p-149. [kernel:parser:decimal-float] tests/float/const.i:29: Warning: Floating-point constant 0.0000000000000000000000000000000000000000000014012984643248170709237295832899161312802619418765157717570682838897910826858606014866381883621215820312499f is not represented exactly. Will use 0x1.0000000000000p-149. [kernel:parser:decimal-float] tests/float/const.i:30: Warning: Floating-point constant 0.0000000000000000000000000000000000000000000014012984643248170709237295832899161312802619418765157717570682838897910826858606014866381883621215820312501f is not represented exactly. Will use 0x1.0000000000000p-149. [kernel:parser:decimal-float] tests/float/const.i:33: Warning: Floating-point constant 0.00000000000000000000000000000000000000000000070064923216240853546186479164495806564013097093825788587853414194489554134293030074331909418106079101562499 is not represented exactly. Will use 0x1.0000000000000p-150. [kernel:parser:decimal-float] tests/float/const.i:34: Warning: Floating-point constant 0.00000000000000000000000000000000000000000000070064923216240853546186479164495806564013097093825788587853414194489554134293030074331909418106079101562501 is not represented exactly. Will use 0x1.0000000000000p-150. [kernel:parser:decimal-float] tests/float/const.i:35: Warning: Floating-point constant 0.000000000000000000000000000000000000000000000700649232162408535461864791644958065640130970938257885878534141944895541342930300743319094181060791015625f is not represented exactly. Will use 0x0.0000000000000p-1022. [kernel:parser:decimal-float] tests/float/const.i:36: Warning: Floating-point constant 0.00000000000000000000000000000000000000000000070064923216240853546186479164495806564013097093825788587853414194489554134293030074331909418106079101562499f is not represented exactly. Will use 0x0.0000000000000p-1022. [kernel:parser:decimal-float] tests/float/const.i:37: Warning: Floating-point constant 0.00000000000000000000000000000000000000000000070064923216240853546186479164495806564013097093825788587853414194489554134293030074331909418106079101562501f is not represented exactly. Will use 0x1.0000000000000p-149. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization f0 ∈ {0} f_ ∈ {0} f00 ∈ {0} f1 ∈ {0x1.8000000000000p1} f2 ∈ {0} f3 ∈ {0} f_0 ∈ {0} f13 ∈ {0} f26 ∈ {0} fic0 ∈ {0} fic1 ∈ {0} fic2 ∈ {0} fic4 ∈ {0} fec0 ∈ {0} fec2 ∈ {0} fec4 ∈ {0} m0 ∈ {0} m_ ∈ {0} m00 ∈ {0} m1 ∈ {0x1.8000000000000p1} m2 ∈ {0} m3 ∈ {0} m_0 ∈ {0} m13 ∈ {0} m26 ∈ {0} d0 ∈ {0} d1 ∈ {0x1.8000000000000p1} d2 ∈ {0} d3 ∈ {0} d4 ∈ {0} d5 ∈ {0} d6 ∈ {0} d7 ∈ {0} A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} H ∈ {0} I ∈ {0} J ∈ {0} K ∈ {0} L ∈ {0} P ∈ {0} Q ∈ {0} R ∈ {0} Am ∈ {0} Bm ∈ {0} Cm ∈ {0} Dm ∈ {0} Em ∈ {0} Fm ∈ {0} Gm ∈ {0} Hm ∈ {0} Im ∈ {0} Jm ∈ {0} Km ∈ {0} Lm ∈ {0} t1 ∈ {0} t2 ∈ {0} t3 ∈ {0} t4 ∈ {0} t5 ∈ {0} t6 ∈ {0} t7 ∈ {0} t8 ∈ {0} t9 ∈ {0} C0 ∈ {0} C2 ∈ {2} s1 ∈ {0} s2 ∈ {0} s3 ∈ {0} s4 ∈ {0} s5 ∈ {0} s6 ∈ {0} s7 ∈ {0} s8 ∈ {0} s9 ∈ {0} if1 ∈ {0} if2 ∈ {0} if3 ∈ {0} ite1 ∈ {0} ite2 ∈ {0} ite3 ∈ {0} ca1 ∈ {0} ca2 ∈ {0} ca3 ∈ {0} ca4 ∈ {0} corner_case_small0 ∈ {0} corner_case_small1 ∈ {0x0.0000000000001p-1022} corner_case_small2 ∈ {0} smallest_pos0 ∈ {0x1.0000000000000p-149} smallest_pos1 ∈ {0x1.0000000000000p-149} smallest_pos2 ∈ {0x1.0000000000000p-149} smallest_pos3 ∈ {0x1.0000000000000p-149} smallest_pos4 ∈ {0x1.0000000000000p-149} smallest_pos5 ∈ {0x1.0000000000000p-149} half_smallest_pos0 ∈ {0} half_smallest_pos1 ∈ {0} half_smallest_pos2 ∈ {0} half_smallest_pos3 ∈ {0} half_smallest_pos4 ∈ {0} half_smallest_pos5 ∈ {0x1.0000000000000p-149} [eva] tests/float/const.i:48: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: f_ ∈ {-0x0.0000000000000p-1022} f00 ∈ {0} f2 ∈ {0x1.8000000000000p1} f3 ∈ {0x1.8000000000000p1} f_0 ∈ [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] f13 ∈ [0x1.0000000000000p0 .. 0x1.8000000000000p1] f26 ∈ [0x1.0000000000000p1 .. 0x1.8000000000000p2] fic0 ∈ {0} fic1 ∈ {0x1.0000000000000p0} fic2 ∈ {0x1.0000000000000p1} fic4 ∈ {0x1.0000000000000p2} fec0 ∈ {0} fec2 ∈ {0x1.0000000000000p1} fec4 ∈ {0x1.0000000000000p2} m_ ∈ {-0x0.0000000000000p-1022} m00 ∈ {0} m2 ∈ {0x1.8000000000000p1} m_0 ∈ [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] m13 ∈ [0x1.0000000000000p0 .. 0x1.8000000000000p1] m26 ∈ [0x1.0000000000000p1 .. 0x1.8000000000000p2] d2 ∈ {0x1.8000000000000p1} d3 ∈ {0x1.4000000000000p2} d4 ∈ {0x1.4000000000000p2} d5 ∈ [-0x1.8000000000000p1 .. 0x1.2000000000000p3] d6 ∈ {0x1.8000000000000p1} d7 ∈ [-0x1.2000000000000p3 .. 0x1.8000000000000p1] A ∈ {1} B ∈ {0} C ∈ {1} D ∈ {0} E ∈ {1} F ∈ {1} G ∈ {1} H ∈ {0; 1} I ∈ {0; 1} J ∈ {0} K ∈ {0} L ∈ {0; 1} P ∈ {0; 1} Q ∈ {0} R ∈ {1} Am ∈ {1} Bm ∈ {0} Cm ∈ {1} Dm ∈ {0} Em ∈ {1} Fm ∈ {1} Gm ∈ {1} Hm ∈ {0; 1} Im ∈ {0; 1} Jm ∈ {0} Km ∈ {0} Lm ∈ {0; 1} t1 ∈ {1} t2 ∈ {1} t3 ∈ {1} t4 ∈ {0; 1} t5 ∈ {0; 1} t6 ∈ {1} t7 ∈ {0} t8 ∈ {1} s1 ∈ {0} s2 ∈ {0} s3 ∈ {1} s4 ∈ {0; 1} s5 ∈ {0; 1} s6 ∈ {1} s7 ∈ {0} s8 ∈ {0} if1 ∈ {1} ite1 ∈ {1} ite2 ∈ {2} ite3 ∈ {2} ca1 ∈ {0} ca2 ∈ {1; 2; 3} ca3 ∈ {0} ca4 ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: f_ FROM f0 f00 FROM f0 f2 FROM f1 f3 FROM f0; f1 f_0 FROM f0; c1 f13 FROM c1 f26 FROM c1 fic0 FROM C0 fic1 FROM \nothing fic2 FROM C2 fic4 FROM C2 fec0 FROM C0 fec2 FROM C2 fec4 FROM C2 m_ FROM m0 m00 FROM m0 m2 FROM m1 m_0 FROM m0; c1 m13 FROM c1 m26 FROM c1 d2 FROM f1; d1 d3 FROM d1 d4 FROM d1 d5 FROM c1; c2 d6 FROM f0; f1; d1 d7 FROM c1; c2 A FROM f0 B FROM f0; f1 C FROM f0 D FROM f0; f1 E FROM f0 F FROM f0; c1 G FROM f0; c1 H FROM f0; c1 I FROM f0; c1 J FROM f0; c1 K FROM f0; c1 L FROM c1; c2 P FROM c1; c2 Q FROM f0 R FROM f0; f1 Am FROM m0 Bm FROM m0; m1 Cm FROM m0 Dm FROM m0; m1 Em FROM m0 Fm FROM m0; c1 Gm FROM m0; c1 Hm FROM m0; c1 Im FROM m0; c1 Jm FROM m0; c1 Km FROM m0; c1 Lm FROM c1; c2 t1 FROM f0; c1 t2 FROM f0; c1 t3 FROM f0; c1 t4 FROM c1 t5 FROM c1 t6 FROM c1 t7 FROM c1 t8 FROM f1 s1 FROM f0; c1 s2 FROM f0; c1 s3 FROM f0; c1 s4 FROM c1 s5 FROM c1 s6 FROM c1 s7 FROM c1 s8 FROM f1 if1 FROM \nothing (and SELF) ite1 FROM \nothing ite2 FROM \nothing ite3 FROM \nothing ca1 FROM f0; c1 ca2 FROM c1 ca3 FROM f0 ca4 FROM f0 [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: f_; f00; f2; f3; f_0; f13; f26; fic0; fic1; fic2; fic4; fec0; fec2; fec4; m_; m00; m2; m_0; m13; m26; d2; d3; d4; d5; d6; d7; A; B; C; D; E; F; G; H; I; J; K; L; P; Q; R; Am; Bm; Cm; Dm; Em; Fm; Gm; Hm; Im; Jm; Km; Lm; t1; t2; t3; t4; t5; t6; t7; t8; s1; s2; s3; s4; s5; s6; s7; s8; if1; ite1; ite2; ite3; ca1; ca2; ca3; ca4; tmp; tmp_0; tmp_1; tmp_2; tmp_3; tmp_4; tmp_5; tmp_6; tmp_7 frama-c-20.0-Calcium/tests/float/oracle/const1.res.oracle0000666000000000000000000000161013571573400020113 0ustar [kernel] Parsing tests/float/const1.i (no preprocessing) [kernel:parser:decimal-float] tests/float/const1.i:1: Warning: Floating-point constant 1e40f is not represented exactly. Will use inf. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva:alarm] tests/float/const1.i:1: Warning: non-finite float value. assert \is_finite(1e40f); [eva] tests/float/const1.i:1: Warning: evaluation of initializer '(unsigned long long)1e40f' failed [eva] Initial state computed [eva:initial-state] Values of globals at initialization NOT ACCESSIBLE [eva] Eva not started because globals initialization is not computable. [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] ====== END OF DEPENDENCIES ====== frama-c-20.0-Calcium/tests/float/oracle/const2.res.oracle0000666000000000000000000000160513571573400020120 0ustar [kernel] Parsing tests/float/const2.i (no preprocessing) [kernel:parser:decimal-float] tests/float/const2.i:1: Warning: Floating-point constant 1e-40f is not represented exactly. Will use 0x1.16c2000000000p-133. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva:alarm] tests/float/const2.i:2: Warning: non-finite float value. assert \is_finite(1e40f); [eva] tests/float/const2.i:2: Warning: evaluation of initializer '1e40f' failed [eva] Initial state computed [eva:initial-state] Values of globals at initialization NOT ACCESSIBLE [eva] Eva not started because globals initialization is not computable. [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] ====== END OF DEPENDENCIES ====== frama-c-20.0-Calcium/tests/float/oracle/const3.0.res.oracle0000666000000000000000000000245213571573400020260 0ustar [kernel] Parsing tests/float/const3.i (no preprocessing) [kernel:parser:decimal-float] tests/float/const3.i:6: Warning: Floating-point constant 1e-40f is not represented exactly. Will use 0x1.16c2000000000p-133. [kernel:parser:decimal-float] tests/float/const3.i:7: Warning: Floating-point constant 1e-40 is not represented exactly. Will use 0x1.16c262777579cp-133. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization f1 ∈ {9.99994610111e-41} d0 ∈ {1e-40} [eva] tests/float/const3.i:11: Frama_C_dump_each: # Cvalue domain: f1 ∈ {9.99994610111e-41} d0 ∈ {1e-40} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: d1 ∈ {9.99994610111e-41} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: d1; __retres [inout] Inputs for function main: f1 frama-c-20.0-Calcium/tests/float/oracle/const3.1.res.oracle0000666000000000000000000000273513571573400020265 0ustar [kernel] Parsing tests/float/const3.i (no preprocessing) [kernel:parser:decimal-float] tests/float/const3.i:6: Warning: Floating-point constant 1e-40f is not represented exactly. Will use 0x1.16c2000000000p-133. [kernel:parser:decimal-float] tests/float/const3.i:7: Warning: Floating-point constant 1e-40 is not represented exactly. Will use 0x1.16c262777579cp-133. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization f1 ∈ [0x1.16c2000000000p-133 .. 0x1.16c3000000000p-133] d0 ∈ [0x1.16c262777579cp-133 .. 0x1.16c262777579dp-133] [eva] tests/float/const3.i:11: Frama_C_dump_each: # Cvalue domain: f1 ∈ [0x1.16c2000000000p-133 .. 0x1.16c3000000000p-133] d0 ∈ [0x1.16c262777579cp-133 .. 0x1.16c262777579dp-133] __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: d1 ∈ [0x1.16c2000000000p-133 .. 0x1.16c3000000000p-133] __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: d1; __retres [inout] Inputs for function main: f1 frama-c-20.0-Calcium/tests/float/oracle/const4.0.res.oracle0000666000000000000000000000171613571573400020263 0ustar [kernel] Parsing tests/float/const4.i (no preprocessing) [kernel:parser:decimal-float] tests/float/const4.i:6: Warning: Floating-point constant 3.4e38f is not represented exactly. Will use 0x1.ff933c0000000p127. [kernel:parser:decimal-float] tests/float/const4.i:7: Warning: Floating-point constant 3.405e38f is not represented exactly. Will use inf. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva:alarm] tests/float/const4.i:7: Warning: non-finite float value. assert \is_finite(3.405e38f); [eva] tests/float/const4.i:7: Warning: evaluation of initializer '(double)3.405e38f' failed [eva] Initial state computed [eva:initial-state] Values of globals at initialization NOT ACCESSIBLE [eva] Eva not started because globals initialization is not computable. [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] ====== END OF DEPENDENCIES ====== frama-c-20.0-Calcium/tests/float/oracle/const4.1.res.oracle0000666000000000000000000000304113571573400020255 0ustar [kernel] Parsing tests/float/const4.i (no preprocessing) [kernel:parser:decimal-float] tests/float/const4.i:6: Warning: Floating-point constant 3.4e38f is not represented exactly. Will use 0x1.ff933c0000000p127. [kernel:parser:decimal-float] tests/float/const4.i:7: Warning: Floating-point constant 3.405e38f is not represented exactly. Will use inf. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva:alarm] tests/float/const4.i:7: Warning: non-finite float value. assert \is_finite(3.405e38f); [eva] Initial state computed [eva:initial-state] Values of globals at initialization f1 ∈ [3.39999995214e+38 .. 3.40000015497e+38] f2 ∈ {3.40282346639e+38} [eva] tests/float/const4.i:11: Frama_C_dump_each: # Cvalue domain: f1 ∈ [3.39999995214e+38 .. 3.40000015497e+38] f2 ∈ {3.40282346639e+38} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] tests/float/const4.i:7: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: d2 ∈ {3.40282346639e+38} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: d2; __retres [inout] Inputs for function main: f2 frama-c-20.0-Calcium/tests/float/oracle/conv.res.oracle0000666000000000000000000001035413571573400017656 0ustar [kernel] Parsing tests/float/conv.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization f ∈ {0} d ∈ {0} v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/float/conv.i:105. [eva] tests/float/conv.i:15: Frama_C_show_each: {0} [eva] tests/float/conv.i:18: Frama_C_show_each: {1.40129846432e-45} [eva] tests/float/conv.i:22: Frama_C_show_each: [1.40129846432e-43 .. 2.40330263757e+12] [eva:alarm] tests/float/conv.i:24: Warning: assertion got status unknown. [eva] tests/float/conv.i:28: Frama_C_show_each: {3.40282346639e+38} [eva] tests/float/conv.i:29: assertion got status valid. [eva:alarm] tests/float/conv.i:32: Warning: non-finite float value. assert \is_finite(*((float *)(&i))); [eva] tests/float/conv.i:37: Frama_C_show_each: {-3.40282346639e+38} [eva] tests/float/conv.i:38: assertion got status valid. [eva:alarm] tests/float/conv.i:41: Warning: non-finite float value. assert \is_finite(*((float *)(&i))); [eva] tests/float/conv.i:45: Frama_C_show_each: [-0. .. 1.40129846432e-45] [eva:alarm] tests/float/conv.i:48: Warning: assertion got status unknown. [eva:alarm] tests/float/conv.i:49: Warning: non-finite float value. assert \is_finite(*((float *)(&i))); [eva:alarm] tests/float/conv.i:52: Warning: non-finite float value. assert \is_finite(*((float *)(&i))); [eva] tests/float/conv.i:52: Frama_C_show_each: {0} [eva:alarm] tests/float/conv.i:55: Warning: non-finite float value. assert \is_finite(*((float *)(&ui))); [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/float/conv.i:106. [eva] tests/float/conv.i:63: Frama_C_show_each: {0} [eva] tests/float/conv.i:66: Frama_C_show_each: {4.94065645841e-324} [eva] tests/float/conv.i:69: Frama_C_show_each: [4.94065645841e-322 .. 9.22442153475e+159] [eva] tests/float/conv.i:73: Frama_C_show_each: {1.79769313486e+308} [eva] tests/float/conv.i:74: assertion got status valid. [eva] tests/float/conv.i:77: Frama_C_show_each: Bottom [eva] tests/float/conv.i:80: Frama_C_show_each: Bottom [eva] tests/float/conv.i:84: Frama_C_show_each: {-1.79769313486e+308} [eva] tests/float/conv.i:85: assertion got status valid. [eva] tests/float/conv.i:88: Frama_C_show_each: Bottom [eva] tests/float/conv.i:91: Frama_C_show_each: [0. .. 4.94065645841e-324] [eva:alarm] tests/float/conv.i:94: Warning: assertion got status unknown. [eva] tests/float/conv.i:95: Frama_C_show_each: Bottom [eva] tests/float/conv.i:98: Frama_C_show_each: {0} [eva] tests/float/conv.i:101: Frama_C_show_each: Bottom [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] tests/float/conv.i:32: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/conv.i:41: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/conv.i:49: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/conv.i:55: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: f ∈ {0} i ∈ {0} [eva:final-states] Values at end of function main2: d ∈ {-1.79769313486e+308} i ∈ {-1; 0} ui ∈ {0xFFFFFFFFFFFFFFFF} [eva:final-states] Values at end of function main: f ∈ {0} d ∈ {-1.79769313486e+308} [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: f FROM v [from] Function main2: d FROM \nothing [from] Function main: f FROM v d FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: f; i; ui [inout] Inputs for function main1: f; v [inout] Out (internal) for function main2: d; i; ui [inout] Inputs for function main2: d; v [inout] Out (internal) for function main: f; d [inout] Inputs for function main: f; d; v frama-c-20.0-Calcium/tests/float/oracle/cte_overflow.res.oracle0000666000000000000000000000340213571573400021403 0ustar [kernel] Parsing tests/float/cte_overflow.i (no preprocessing) [kernel:parser:decimal-float] tests/float/cte_overflow.i:12: Warning: Floating-point constant 1e500 is not represented exactly. Will use inf. [kernel:parser:decimal-float] tests/float/cte_overflow.i:12: Warning: Floating-point constant 1e500 is not represented exactly. Will use inf. [kernel:parser:decimal-float] tests/float/cte_overflow.i:17: Warning: Floating-point constant 1e80f is not represented exactly. Will use inf. [kernel:parser:decimal-float] tests/float/cte_overflow.i:17: Warning: Floating-point constant 1e500f is not represented exactly. Will use inf. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:alarm] tests/float/cte_overflow.i:12: Warning: non-finite double value. assert \is_finite(1e500); [eva:alarm] tests/float/cte_overflow.i:17: Warning: non-finite float value. assert \is_finite(1e80f); [eva] Recording results for main [eva] done for function main [eva] tests/float/cte_overflow.i:12: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/cte_overflow.i:17: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t; __retres [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/float/oracle/div.res.oracle0000666000000000000000000000212213571573400017465 0ustar [kernel] Parsing tests/float/div.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:alarm] tests/float/div.i:8: Warning: assertion got status unknown. [eva:alarm] tests/float/div.i:9: Warning: assertion got status unknown. [eva:alarm] tests/float/div.i:10: Warning: assertion got status unknown. [eva:alarm] tests/float/div.i:11: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: d1 ∈ UNINITIALIZED d2 ∈ UNINITIALIZED [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: d1; d2 [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/float/oracle/dr.0.res.oracle0000666000000000000000000000272313571573400017455 0ustar [kernel] Parsing tests/float/dr.i (no preprocessing) [kernel:parser:decimal-float] tests/float/dr.i:7: Warning: Floating-point constant 100e30f is not represented exactly. Will use 0x1.3b8b5c0000000p106. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization big ∈ {1.00000003318e+32} big2 ∈ {1.00126002403e+32} ne1 ∈ {-0.10000000149} ne2 ∈ {-0.5} nodigits ∈ {10.} smaller ∈ {0} he ∈ {3.} g1 ∈ {0.10000000149} f1 ∈ {0.10000000149} f9 ∈ {1.} ep ∈ {12499999744.} g2 ∈ {1.01161122322} f2 ∈ {1.01161134243} d2 ∈ {1.01161128283} e1 ∈ {0} e2 ∈ {0} [eva] tests/float/dr.i:26: Frama_C_show_each: {1}, {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: e1 ∈ {1} e2 ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: e1 FROM g1; f1 e2 FROM g2; f2 \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: e1; e2; __retres [inout] Inputs for function main: g1; f1; g2; f2; e1; e2 frama-c-20.0-Calcium/tests/float/oracle/dr.1.res.oracle0000666000000000000000000000311513571573400017452 0ustar [kernel] Parsing tests/float/dr.i (no preprocessing) [kernel:parser:decimal-float] tests/float/dr.i:7: Warning: Floating-point constant 100e30f is not represented exactly. Will use 0x1.3b8b5c0000000p106. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization big ∈ {0x1.3b8b5c0000000p106} big2 ∈ {0x1.3bf1240000000p106} ne1 ∈ {-0x1.99999a0000000p-4} ne2 ∈ {-0x1.0000000000000p-1} nodigits ∈ {0x1.4000000000000p3} smaller ∈ {0} he ∈ {0x1.8000000000000p1} g1 ∈ {0x1.99999a0000000p-4} f1 ∈ {0x1.99999a0000000p-4} f9 ∈ {0x1.0000000000000p0} ep ∈ {0x1.74876e0000000p33} g2 ∈ {0x1.02f8f40000000p0} f2 ∈ {0x1.02f8f60000000p0} d2 ∈ {0x1.02f8f50000000p0} e1 ∈ {0} e2 ∈ {0} [eva] tests/float/dr.i:26: Frama_C_show_each: {1}, {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: e1 ∈ {1} e2 ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: e1 FROM g1; f1 e2 FROM g2; f2 \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: e1; e2; __retres [inout] Inputs for function main: g1; f1; g2; f2; e1; e2 frama-c-20.0-Calcium/tests/float/oracle/dr.2.res.oracle0000666000000000000000000000323313571573400017454 0ustar [kernel] Parsing tests/float/dr.i (no preprocessing) [kernel:parser:decimal-float] tests/float/dr.i:7: Warning: Floating-point constant 100e30f is not represented exactly. Will use 0x1.3b8b5c0000000p106. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization big ∈ [9.99999936467e+31 .. 1.00000003318e+32] big2 ∈ [1.00125992731e+32 .. 1.00126002403e+32] ne1 ∈ [-0.10000000149 .. -0.0999999940395] ne2 ∈ {-0.5} nodigits ∈ {10.} smaller ∈ [0. .. 1.40129846432e-45] he ∈ {3.} g1 ∈ {0.10000000149} f1 ∈ [0.0999999940395 .. 0.10000000149] f9 ∈ [0.999999940395 .. 1.] ep ∈ [12499999744. .. 12500000768.] g2 ∈ [1.01161122322 .. 1.01161134243] f2 ∈ [1.01161122322 .. 1.01161134243] d2 ∈ [1.01161128283 .. 1.01161128283] e1 ∈ {0} e2 ∈ {0} [eva] tests/float/dr.i:26: Frama_C_show_each: {0; 1}, {0; 1} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: e1 ∈ {0; 1} e2 ∈ {0; 1} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: e1 FROM g1; f1 e2 FROM g2; f2 \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: e1; e2; __retres [inout] Inputs for function main: g1; f1; g2; f2; e1; e2 frama-c-20.0-Calcium/tests/float/oracle/dr_infinity.res.oracle0000666000000000000000000000676113571573400021236 0ustar [kernel] Parsing tests/float/dr_infinity.i (no preprocessing) [kernel:parser:decimal-float] tests/float/dr_infinity.i:8: Warning: Floating-point constant 3.4028235677973366e+38f is not represented exactly. Will use 0x1.fffffe0000000p127. [kernel:parser:decimal-float] tests/float/dr_infinity.i:11: Warning: Floating-point constant 3.402823567797366e+38 is not represented exactly. Will use 0x1.ffffff000004ep127. [kernel:parser:decimal-float] tests/float/dr_infinity.i:15: Warning: Floating-point constant 3.4e38 is not represented exactly. Will use 0x1.ff933c78cdfadp127. [kernel:parser:decimal-float] tests/float/dr_infinity.i:20: Warning: Floating-point constant 1e308 is not represented exactly. Will use 0x1.1ccf385ebc8a0p1023. [kernel:parser:decimal-float] tests/float/dr_infinity.i:30: Warning: Floating-point constant 1e308 is not represented exactly. Will use 0x1.1ccf385ebc8a0p1023. [kernel:parser:decimal-float] tests/float/dr_infinity.i:31: Warning: Floating-point constant 0.01 is not represented exactly. Will use 0x1.47ae147ae147bp-7. [kernel:parser:decimal-float] tests/float/dr_infinity.i:35: Warning: Floating-point constant 1e38 is not represented exactly. Will use 0x1.2ced32a16a1b1p126. [kernel:parser:decimal-float] tests/float/dr_infinity.i:36: Warning: Floating-point constant 0.001 is not represented exactly. Will use 0x1.0624dd2f1a9fcp-10. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] tests/float/dr_infinity.i:9: Frama_C_show_each: {0x1.fffffe0000000p127} [eva:alarm] tests/float/dr_infinity.i:11: Warning: non-finite float value. assert \is_finite((float)3.402823567797366e+38); [eva:alarm] tests/float/dr_infinity.i:16: Warning: non-finite float value. assert \is_finite((float)(x * x)); [eva:alarm] tests/float/dr_infinity.i:21: Warning: non-finite double value. assert \is_finite((double)(d * (double)10)); [eva:alarm] tests/float/dr_infinity.i:26: Warning: non-finite double value. assert \is_finite((double)((double)2 / d)); [eva:alarm] tests/float/dr_infinity.i:31: Warning: non-finite double value. assert \is_finite((double)(d / 0.01)); [eva:alarm] tests/float/dr_infinity.i:36: Warning: non-finite float value. assert \is_finite((float)((double)((double)x / 0.001))); [eva:alarm] tests/float/dr_infinity.i:41: Warning: non-finite double value. assert \is_finite((double)(d / 0.)); [eva] Recording results for main [eva] done for function main [eva] tests/float/dr_infinity.i:11: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/dr_infinity.i:16: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/dr_infinity.i:26: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/dr_infinity.i:36: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/dr_infinity.i:41: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {0x1.fffffe0000000p127} d ∈ UNINITIALIZED [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; d [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/float/oracle/extract_bits.0.res.oracle0000666000000000000000000000257413571573400021547 0ustar [kernel] Parsing tests/float/extract_bits.i (no preprocessing) [kernel:parser:decimal-float] tests/float/extract_bits.i:6: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/extract_bits.i:7: Warning: Floating-point constant 2.71 is not represented exactly. Will use 0x1.5ae147ae147aep1. [kernel:parser:decimal-float] tests/float/extract_bits.i:9: Warning: Floating-point constant 1.8254370818746402660437411213933955878019332885742187 is not represented exactly. Will use 0x1.d34fd8378ea83p0. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization f ∈ {3.1400001049041748} d ∈ {2.7099999999999999} stdtod_bug ∈ {1.8254370818746401} fr[0..0x3] ∈ {0} dr[0..0x7] ∈ {0} [eva] tests/float/extract_bits.i:25: Frama_C_show_each: [0..0xFF] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: fr[0] ∈ {0x40} [0x1] ∈ {0x48} [0x2] ∈ {0xF5} [0x3] ∈ {0xC3} dr[0] ∈ {0x40} [0x1] ∈ {0x5} [0x2] ∈ {0xAE} [0x3] ∈ {0x14} [0x4] ∈ {0x7A} [0x5] ∈ {0xE1} [0x6] ∈ {0x47} [0x7] ∈ {0xAE} i ∈ {0x8} x ∈ {1.0000000000000000} frama-c-20.0-Calcium/tests/float/oracle/extract_bits.1.res.oracle0000666000000000000000000000257413571573400021550 0ustar [kernel] Parsing tests/float/extract_bits.i (no preprocessing) [kernel:parser:decimal-float] tests/float/extract_bits.i:6: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/extract_bits.i:7: Warning: Floating-point constant 2.71 is not represented exactly. Will use 0x1.5ae147ae147aep1. [kernel:parser:decimal-float] tests/float/extract_bits.i:9: Warning: Floating-point constant 1.8254370818746402660437411213933955878019332885742187 is not represented exactly. Will use 0x1.d34fd8378ea83p0. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization f ∈ {3.1400001049041748} d ∈ {2.7099999999999999} stdtod_bug ∈ {1.8254370818746401} fr[0..0x3] ∈ {0} dr[0..0x7] ∈ {0} [eva] tests/float/extract_bits.i:25: Frama_C_show_each: [0..0xFF] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: fr[0] ∈ {0xC3} [0x1] ∈ {0xF5} [0x2] ∈ {0x48} [0x3] ∈ {0x40} dr[0] ∈ {0xAE} [0x1] ∈ {0x47} [0x2] ∈ {0xE1} [0x3] ∈ {0x7A} [0x4] ∈ {0x14} [0x5] ∈ {0xAE} [0x6] ∈ {0x5} [0x7] ∈ {0x40} i ∈ {0x8} x ∈ {1.0000000000000000} frama-c-20.0-Calcium/tests/float/oracle/float_cast_implicite.res.oracle0000666000000000000000000000261013571573400023063 0ustar [kernel] Parsing tests/float/float_cast_implicite.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization C0 ∈ {0} C2 ∈ {2} CBP ∈ {2000000000} fic0 ∈ {0} fic1 ∈ {0} fic2 ∈ {0} fic4 ∈ {0} fec0 ∈ {0} fec2 ∈ {0} fec4 ∈ {0} ficbp ∈ {0} ficbn ∈ {0} fecbp ∈ {0} fecbn ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: fic0 ∈ {0} fic1 ∈ {1.} fic2 ∈ {2.} fic4 ∈ {4.} fec0 ∈ {0} fec2 ∈ {2.} fec4 ∈ {4.} ficbp ∈ {2000000000.} ficbn ∈ {-2000000000.} fecbp ∈ {2000000000.} fecbn ∈ {-2000000000.} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: fic0 FROM C0 fic1 FROM \nothing fic2 FROM C2 fic4 FROM C2 fec0 FROM C0 fec2 FROM C2 fec4 FROM C2 ficbp FROM CBP ficbn FROM CBP fecbp FROM CBP fecbn FROM CBP [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: fic0; fic1; fic2; fic4; fec0; fec2; fec4; ficbp; ficbn; fecbp; fecbn [inout] Inputs for function main: C0; C2; CBP frama-c-20.0-Calcium/tests/float/oracle/fval_test.res.oracle0000666000000000000000000000007413571573400020676 0ustar [kernel] Parsing tests/float/fval_test.i (no preprocessing) frama-c-20.0-Calcium/tests/float/oracle/init_float.res.oracle0000666000000000000000000000363413571573400021044 0ustar [kernel] Parsing tests/float/init_float.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s.y ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] r ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] cv ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] un ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] zp ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] zm ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] zs ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] l ∈ [--..--] Ha[0..4] ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] THa[0..4] ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] [eva:alarm] tests/float/init_float.i:16: Warning: function main: precondition -1000.0 ≤ x ≤ 1000.0 got status unknown. [eva:alarm] tests/float/init_float.i:17: Warning: function main: precondition 0.0 ≤ s.y ≤ 0.0 got status unknown. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s.y ∈ [-0.0000000000000000 .. 0.0000000000000000] r ∈ [-1000.0000000000000000 .. 1000.0000000000000000] cv ∈ [1.0000000715686179 .. 1.6096441013214644*2^20] un ∈ {1.0000000000000000} zp ∈ {0} zm ∈ {-0.0000000000000000} zs ∈ {0} l ∈ [4500000000000000001..4700000000000000000] Ha[0] ∈ {1.9999999999999982*2^-2} [1] ∈ {1.9999999999999991*2^-2} [2] ∈ {1.0000000000000000*2^-1} [3] ∈ {1.0000000000000004*2^-1} [4] ∈ {1.0000000000000008*2^-1} THa[0] ∈ {1.4999999999999996} [1] ∈ {1.4999999999999998} [2] ∈ {1.5000000000000000} [3] ∈ {1.5000000000000002} [4] ∈ {1.5000000000000004} __retres ∈ {1} frama-c-20.0-Calcium/tests/float/oracle/leaf_ensures.res.oracle0000666000000000000000000000552713571573400021372 0ustar [kernel] Parsing tests/float/leaf_ensures.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization d1 ∈ {0} d2 ∈ {0} d3 ∈ {0} d4 ∈ {0} d5 ∈ {0} f1 ∈ {0} f2 ∈ {0} f3 ∈ {0} f4 ∈ {0} f5 ∈ {0} f6 ∈ {0} y ∈ {0} [eva] computing for function d <- main. Called from tests/float/leaf_ensures.i:34. [eva] using specification for function d [eva] Done for function d [eva] computing for function f <- main. Called from tests/float/leaf_ensures.i:35. [eva] using specification for function f [eva] Done for function f [eva] computing for function h <- main. Called from tests/float/leaf_ensures.i:36. [eva] using specification for function h [eva] Done for function h [eva] computing for function h <- main. Called from tests/float/leaf_ensures.i:37. [eva] Done for function h [eva] computing for function g <- main. Called from tests/float/leaf_ensures.i:38. [eva] using specification for function g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: d1 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] d2 ∈ [-1. .. 1.] d3 ∈ [--..--] d4 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] d5 ∈ [-2147483648. .. 2147483647.] f1 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f2 ∈ [-0.999999940395 .. 0.999999940395] f3 ∈ [--..--] f4 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f5 ∈ [-2147483648. .. 2147483648.] f6 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] __retres ∈ {0} [from] Computing for function main [from] Computing for function d <-main [from] Done for function d [from] Computing for function f <-main [from] Done for function f [from] Computing for function h <-main [from] Done for function h [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function d: d1 FROM \nothing d2 FROM \nothing d3 FROM \nothing \result FROM \nothing [from] Function f: f1 FROM \nothing f2 FROM \nothing f3 FROM \nothing \result FROM \nothing [from] Function g: \result FROM \nothing [from] Function h: \result FROM \nothing [from] Function main: d1 FROM \nothing d2 FROM \nothing d3 FROM \nothing d4 FROM \nothing d5 FROM \nothing f1 FROM \nothing f2 FROM \nothing f3 FROM \nothing f4 FROM \nothing f5 FROM \nothing f6 FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: d1; d2; d3; d4; d5; f1; f2; f3; f4; f5; f6; tmp; tmp_0; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/float/oracle/logic.0.res.oracle0000666000000000000000000005143613571573400020152 0ustar [kernel] Parsing tests/float/logic.i (no preprocessing) [kernel:parser:decimal-float] tests/float/logic.i:12: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:17: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:22: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:61: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/logic.i:62: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/logic.i:62: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/logic.i:63: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/logic.i:63: Warning: Floating-point constant 11.1 is not represented exactly. Will use 0x1.6333333333333p3. [kernel:parser:decimal-float] tests/float/logic.i:120: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:129: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:177: Warning: Floating-point constant 3.3 is not represented exactly. Will use 0x1.a666666666666p1. [kernel:parser:decimal-float] tests/float/logic.i:178: Warning: Floating-point constant 3.3 is not represented exactly. Will use 0x1.a666666666666p1. [kernel:parser:decimal-float] tests/float/logic.i:181: Warning: Floating-point constant 3.3 is not represented exactly. Will use 0x1.a666666666666p1. [kernel:parser:decimal-float] tests/float/logic.i:184: Warning: Floating-point constant 3.3 is not represented exactly. Will use 0x1.a666666666666p1. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] any_float ∈ [--..--] any_double ∈ [--..--] undet ∈ [--..--] top_int ∈ [--..--] [eva] computing for function test_equality <- main. Called from tests/float/logic.i:189. [eva:alarm] tests/float/logic.i:13: Warning: assertion got status unknown. [eva:alarm] tests/float/logic.i:18: Warning: assertion got status invalid (stopping propagation). [eva] tests/float/logic.i:23: assertion got status valid. [eva] Recording results for test_equality [eva] Done for function test_equality [eva] computing for function test_builtin_comparisons <- main. Called from tests/float/logic.i:190. [eva] computing for function test_comparison_evaluation <- test_builtin_comparisons <- main. Called from tests/float/logic.i:115. [eva] tests/float/logic.i:35: check got status valid. [eva] tests/float/logic.i:36: check got status valid. [eva] tests/float/logic.i:37: check got status valid. [eva] tests/float/logic.i:38: check got status valid. [eva] tests/float/logic.i:39: check got status valid. [eva:alarm] tests/float/logic.i:40: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:41: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:42: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:43: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:45: Warning: non-finite double value. assert \is_finite((double)(1. / 0.)); [eva:alarm] tests/float/logic.i:64: Warning: check got status unknown. [eva:alarm] tests/float/logic.i:65: Warning: check got status unknown. [eva:alarm] tests/float/logic.i:66: Warning: check got status unknown. [eva] tests/float/logic.i:67: check got status valid. [eva:alarm] tests/float/logic.i:68: Warning: check got status invalid. [eva] tests/float/logic.i:69: check got status valid. [eva] tests/float/logic.i:70: check got status valid. [eva:alarm] tests/float/logic.i:71: Warning: check got status unknown. [eva] tests/float/logic.i:72: check got status valid. [eva:alarm] tests/float/logic.i:73: Warning: check got status unknown. [eva:alarm] tests/float/logic.i:74: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:75: Warning: check got status invalid. [eva] Recording results for test_comparison_evaluation [eva] Done for function test_comparison_evaluation [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:117. [eva:alarm] tests/float/logic.i:81: Warning: non-finite double value. assert \is_finite(any_double); [eva:alarm] tests/float/logic.i:83: Warning: assertion got status unknown. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: {-0x1.0000000000000p0}, {-0x1.0000000000000p0} [eva:alarm] tests/float/logic.i:87: Warning: assertion got status unknown. [eva] tests/float/logic.i:88: Frama_C_show_each_lt: {-0x1.0000000000000p0}, [-0x1.fffffffffffffp1023 .. -0x1.0000000000001p0] [eva:alarm] tests/float/logic.i:91: Warning: assertion got status unknown. [eva] tests/float/logic.i:92: Frama_C_show_each_lt: {-0x1.0000000000000p0}, [-0x1.fffffffffffffp1023 .. -0x1.0000000000000p0] [eva:alarm] tests/float/logic.i:95: Warning: assertion got status unknown. [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: {-0x1.0000000000000p0}, {-0x1.0000000000000p0} [eva:alarm] tests/float/logic.i:99: Warning: assertion got status unknown. [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: {-0x1.0000000000000p0}, [-0x1.fffffffffffffp1023 .. -0x1.0000000000001p0] [eva:alarm] tests/float/logic.i:103: Warning: assertion got status unknown. [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: {-0x1.0000000000000p0}, [-0x1.fffffffffffffp1023 .. -0x1.0000000000000p0] [eva:alarm] tests/float/logic.i:107: Warning: assertion got status unknown. [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: {-0x1.0000000000000p0}, [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:118. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: {-0x0.0000000000000p-1022}, [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:88: Frama_C_show_each_lt: {-0x0.0000000000000p-1022}, [-0x1.fffffffffffffp1023 .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:92: Frama_C_show_each_lt: {-0x0.0000000000000p-1022}, [-0x1.fffffffffffffp1023 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: {-0x0.0000000000000p-1022}, [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: {-0x0.0000000000000p-1022}, [-0x1.fffffffffffffp1023 .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: {-0x0.0000000000000p-1022}, [-0x1.fffffffffffffp1023 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: {-0x0.0000000000000p-1022}, [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:119. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: {0}, [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:88: Frama_C_show_each_lt: {0}, [-0x1.fffffffffffffp1023 .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:92: Frama_C_show_each_lt: {0}, [-0x1.fffffffffffffp1023 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: {0}, [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: {0}, [-0x1.fffffffffffffp1023 .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: {0}, [-0x1.fffffffffffffp1023 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: {0}, [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:120. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: {0x1.999999999999ap-4}, {0x1.999999999999ap-4} [eva] tests/float/logic.i:88: Frama_C_show_each_lt: {0x1.999999999999ap-4}, [-0x1.fffffffffffffp1023 .. 0x1.9999999999999p-4] [eva] tests/float/logic.i:92: Frama_C_show_each_lt: {0x1.999999999999ap-4}, [-0x1.fffffffffffffp1023 .. 0x1.999999999999ap-4] [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: {0x1.999999999999ap-4}, {0x1.999999999999ap-4} [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: {0x1.999999999999ap-4}, [-0x1.fffffffffffffp1023 .. 0x1.9999999999999p-4] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: {0x1.999999999999ap-4}, [-0x1.fffffffffffffp1023 .. 0x1.999999999999ap-4] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: {0x1.999999999999ap-4}, [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:124. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-0x1.4000000000000p3 .. -0x1.0000000000000p0] [eva] tests/float/logic.i:88: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-0x1.fffffffffffffp1023 .. -0x1.0000000000001p0] [eva] tests/float/logic.i:92: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-0x1.fffffffffffffp1023 .. -0x1.0000000000000p0] [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-0x1.4000000000000p3 .. -0x1.0000000000000p0] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-0x1.fffffffffffffp1023 .. -0x1.0000000000001p0] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-0x1.fffffffffffffp1023 .. -0x1.0000000000000p0] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:126. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:88: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:92: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:128. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:88: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:92: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:130. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-0x1.4000000000000p3 .. 0x1.999999999999ap-4] [eva] tests/float/logic.i:88: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-0x1.fffffffffffffp1023 .. 0x1.9999999999999p-4] [eva] tests/float/logic.i:92: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-0x1.fffffffffffffp1023 .. 0x1.999999999999ap-4] [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-0x1.4000000000000p3 .. 0x1.999999999999ap-4] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-0x1.fffffffffffffp1023 .. 0x1.9999999999999p-4] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-0x1.fffffffffffffp1023 .. 0x1.999999999999ap-4] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva:alarm] tests/float/logic.i:133: Warning: non-finite double value. assert \is_finite((double)(1. / 0.)); [eva] Recording results for test_builtin_comparisons [eva] Done for function test_builtin_comparisons [eva] computing for function test_is_finite <- main. Called from tests/float/logic.i:191. [eva] tests/float/logic.i:157: assertion got status valid. [eva:alarm] tests/float/logic.i:166: Warning: assertion got status unknown. [eva:alarm] tests/float/logic.i:174: Warning: assertion got status unknown. [eva] computing for function my_fabs <- test_is_finite <- main. Called from tests/float/logic.i:177. [eva] using specification for function my_fabs [eva] Done for function my_fabs [eva] computing for function my_fabs <- test_is_finite <- main. Called from tests/float/logic.i:178. [eva] Done for function my_fabs [eva] computing for function my_ratio <- test_is_finite <- main. Called from tests/float/logic.i:181. [eva] using specification for function my_ratio [eva] tests/float/logic.i:153: Warning: no 'assigns \result \from ...' clause specified for function my_ratio [eva] Done for function my_ratio [eva] computing for function my_ratio_body <- test_is_finite <- main. Called from tests/float/logic.i:184. [eva] computing for function my_fabs <- my_ratio_body <- test_is_finite <- main. Called from tests/float/logic.i:148. [eva] Done for function my_fabs [eva] tests/float/logic.i:146: function my_ratio_body: postcondition got status valid. [eva] tests/float/logic.i:147: function my_ratio_body: postcondition got status valid. [eva] Recording results for my_ratio_body [eva] Done for function my_ratio_body [eva] Recording results for test_is_finite [eva] Done for function test_is_finite [eva] Recording results for main [eva] done for function main [eva] tests/float/logic.i:45: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/logic.i:133: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function my_ratio_body: __retres ∈ {-0x1.bca1b00000000p-1} [eva:final-states] Values at end of function test_comparison_evaluation: zero ∈ {0} minus_zero ∈ {-0x0.0000000000000p-1022} one ∈ {0x1.0000000000000p0} higher ∈ [0x1.91eb860000000p1 .. 0x1.9000000000000p3] middle ∈ [-0x1.91eb860000000p1 .. 0x1.91eb860000000p1] lower ∈ [-0x1.6333340000000p3 .. -0x1.91eb860000000p1] [eva:final-states] Values at end of function test_comparison_reduction: d ∈ [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva:final-states] Values at end of function test_builtin_comparisons: bound ∈ [-0x1.4000000000000p3 .. 0x1.999999999999ap-4] [eva:final-states] Values at end of function test_equality: [eva:final-states] Values at end of function test_is_finite: f1 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] f2 ∈ [--..--] f3 ∈ [--..--] p ∈ {{ &f2 ; &f3 }} g1 ∈ {0x1.a666660000000p1} g2 ∈ {0x1.a666660000000p1} g3 ∈ [-0x1.fffffe0000000p-1 .. 0x1.fffffe0000000p-1] g4 ∈ {-0x1.bca1b00000000p-1} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function my_ratio_body [from] Computing for function my_fabs <-my_ratio_body [from] Done for function my_fabs [from] Done for function my_ratio_body [from] Computing for function test_comparison_evaluation [from] Done for function test_comparison_evaluation [from] Computing for function test_comparison_reduction [from] Done for function test_comparison_reduction [from] Computing for function test_builtin_comparisons [from] Done for function test_builtin_comparisons [from] Computing for function test_equality [from] Done for function test_equality [from] Computing for function test_is_finite [from] Computing for function my_ratio <-test_is_finite [from] Done for function my_ratio [from] Done for function test_is_finite [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function my_fabs: \result FROM f [from] Function my_ratio: \result FROM ANYTHING(origin:Unknown) [from] Function my_ratio_body: \result FROM f [from] Function test_comparison_evaluation: NO EFFECTS [from] Function test_comparison_reduction: NO EFFECTS [from] Function test_builtin_comparisons: NO EFFECTS [from] Function test_equality: NO EFFECTS [from] Function test_is_finite: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function my_ratio_body: tmp; __retres [inout] Inputs for function my_ratio_body: \nothing [inout] Out (internal) for function test_comparison_evaluation: zero; minus_zero; one; inf; higher; tmp; middle; tmp_0; lower; tmp_1 [inout] Inputs for function test_comparison_evaluation: v [inout] Out (internal) for function test_comparison_reduction: d [inout] Inputs for function test_comparison_reduction: v; any_double [inout] Out (internal) for function test_builtin_comparisons: bound [inout] Inputs for function test_builtin_comparisons: v; any_double [inout] Out (internal) for function test_equality: d; d_0; f [inout] Inputs for function test_equality: v [inout] Out (internal) for function test_is_finite: f1; f2; f3; p; g1; g2; g3; g4 [inout] Inputs for function test_is_finite: undet; top_int [inout] Out (internal) for function main: __retres [inout] Inputs for function main: v; any_double; undet; top_int frama-c-20.0-Calcium/tests/float/oracle/logic.1.res.oracle0000666000000000000000000005327613571573400020157 0ustar [kernel] Parsing tests/float/logic.i (no preprocessing) [kernel:parser:decimal-float] tests/float/logic.i:12: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:17: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:22: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:61: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/logic.i:62: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/logic.i:62: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/logic.i:63: Warning: Floating-point constant 3.14 is not represented exactly. Will use 0x1.91eb851eb851fp1. [kernel:parser:decimal-float] tests/float/logic.i:63: Warning: Floating-point constant 11.1 is not represented exactly. Will use 0x1.6333333333333p3. [kernel:parser:decimal-float] tests/float/logic.i:120: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:129: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. [kernel:parser:decimal-float] tests/float/logic.i:177: Warning: Floating-point constant 3.3 is not represented exactly. Will use 0x1.a666666666666p1. [kernel:parser:decimal-float] tests/float/logic.i:178: Warning: Floating-point constant 3.3 is not represented exactly. Will use 0x1.a666666666666p1. [kernel:parser:decimal-float] tests/float/logic.i:181: Warning: Floating-point constant 3.3 is not represented exactly. Will use 0x1.a666666666666p1. [kernel:parser:decimal-float] tests/float/logic.i:184: Warning: Floating-point constant 3.3 is not represented exactly. Will use 0x1.a666666666666p1. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] any_float ∈ [--..--] any_double ∈ [--..--] undet ∈ [--..--] top_int ∈ [--..--] [eva] computing for function test_equality <- main. Called from tests/float/logic.i:189. [eva:alarm] tests/float/logic.i:13: Warning: assertion got status unknown. [eva:alarm] tests/float/logic.i:18: Warning: assertion got status invalid (stopping propagation). [eva] tests/float/logic.i:23: assertion got status valid. [eva] Recording results for test_equality [eva] Done for function test_equality [eva] computing for function test_builtin_comparisons <- main. Called from tests/float/logic.i:190. [eva] computing for function test_comparison_evaluation <- test_builtin_comparisons <- main. Called from tests/float/logic.i:115. [eva] tests/float/logic.i:35: check got status valid. [eva] tests/float/logic.i:36: check got status valid. [eva] tests/float/logic.i:37: check got status valid. [eva] tests/float/logic.i:38: check got status valid. [eva] tests/float/logic.i:39: check got status valid. [eva:alarm] tests/float/logic.i:40: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:41: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:42: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:43: Warning: check got status invalid. [eva] tests/float/logic.i:47: check got status valid. [eva] tests/float/logic.i:48: check got status valid. [eva:alarm] tests/float/logic.i:49: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:50: Warning: check got status invalid. [eva] tests/float/logic.i:51: check got status valid. [eva] tests/float/logic.i:52: check got status valid. [eva] tests/float/logic.i:53: check got status valid. [eva:alarm] tests/float/logic.i:54: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:55: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:56: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:57: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:58: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:64: Warning: check got status unknown. [eva:alarm] tests/float/logic.i:65: Warning: check got status unknown. [eva:alarm] tests/float/logic.i:66: Warning: check got status unknown. [eva] tests/float/logic.i:67: check got status valid. [eva:alarm] tests/float/logic.i:68: Warning: check got status invalid. [eva] tests/float/logic.i:69: check got status valid. [eva] tests/float/logic.i:70: check got status valid. [eva:alarm] tests/float/logic.i:71: Warning: check got status unknown. [eva] tests/float/logic.i:72: check got status valid. [eva:alarm] tests/float/logic.i:73: Warning: check got status unknown. [eva:alarm] tests/float/logic.i:74: Warning: check got status invalid. [eva:alarm] tests/float/logic.i:75: Warning: check got status invalid. [eva] Recording results for test_comparison_evaluation [eva] Done for function test_comparison_evaluation [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:117. [eva:alarm] tests/float/logic.i:83: Warning: assertion got status unknown. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: {-0x1.0000000000000p0}, [-inf .. inf] ∪ {NaN} [eva:alarm] tests/float/logic.i:87: Warning: assertion got status unknown. [eva] tests/float/logic.i:88: Frama_C_show_each_lt: {-0x1.0000000000000p0}, [-inf .. inf] ∪ {NaN} [eva:alarm] tests/float/logic.i:91: Warning: assertion got status unknown. [eva] tests/float/logic.i:92: Frama_C_show_each_lt: {-0x1.0000000000000p0}, [-inf .. inf] ∪ {NaN} [eva:alarm] tests/float/logic.i:95: Warning: assertion got status unknown. [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: {-0x1.0000000000000p0}, {-0x1.0000000000000p0} [eva:alarm] tests/float/logic.i:99: Warning: assertion got status unknown. [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: {-0x1.0000000000000p0}, [-inf .. -0x1.0000000000001p0] [eva:alarm] tests/float/logic.i:103: Warning: assertion got status unknown. [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: {-0x1.0000000000000p0}, [-inf .. -0x1.0000000000000p0] [eva:alarm] tests/float/logic.i:107: Warning: assertion got status unknown. [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: {-0x1.0000000000000p0}, [-inf .. inf] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:118. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: {-0x0.0000000000000p-1022}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:88: Frama_C_show_each_lt: {-0x0.0000000000000p-1022}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:92: Frama_C_show_each_lt: {-0x0.0000000000000p-1022}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: {-0x0.0000000000000p-1022}, [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: {-0x0.0000000000000p-1022}, [-inf .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: {-0x0.0000000000000p-1022}, [-inf .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: {-0x0.0000000000000p-1022}, [-inf .. inf] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:119. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: {0}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:88: Frama_C_show_each_lt: {0}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:92: Frama_C_show_each_lt: {0}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: {0}, [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: {0}, [-inf .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: {0}, [-inf .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: {0}, [-inf .. inf] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:120. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: {0x1.999999999999ap-4}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:88: Frama_C_show_each_lt: {0x1.999999999999ap-4}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:92: Frama_C_show_each_lt: {0x1.999999999999ap-4}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: {0x1.999999999999ap-4}, {0x1.999999999999ap-4} [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: {0x1.999999999999ap-4}, [-inf .. 0x1.9999999999999p-4] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: {0x1.999999999999ap-4}, [-inf .. 0x1.999999999999ap-4] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: {0x1.999999999999ap-4}, [-inf .. inf] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:124. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:88: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:92: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-0x1.4000000000000p3 .. -0x1.0000000000000p0] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-inf .. -0x1.0000000000001p0] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-inf .. -0x1.0000000000000p0] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: [-0x1.4000000000000p3 .. -0x1.0000000000000p0], [-inf .. inf] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:126. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:88: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:92: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-inf .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-inf .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: [-0x1.4000000000000p3 .. -0x0.0000000000000p-1022], [-inf .. inf] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:128. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:88: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:92: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-inf .. -0x0.0000000000001p-1022] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-inf .. 0x0.0000000000000p-1022] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: [-0x1.4000000000000p3 .. 0x0.0000000000000p-1022], [-inf .. inf] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:130. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:88: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:92: Frama_C_show_each_lt: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-0x1.4000000000000p3 .. 0x1.999999999999ap-4] [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-inf .. 0x1.9999999999999p-4] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-inf .. 0x1.999999999999ap-4] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: [-0x1.4000000000000p3 .. 0x1.999999999999ap-4], [-inf .. inf] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:133. [eva] tests/float/logic.i:84: Frama_C_show_each_eq: {inf}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:88: Frama_C_show_each_lt: {inf}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:92: Frama_C_show_each_lt: {inf}, [-inf .. inf] ∪ {NaN} [eva] tests/float/logic.i:96: Frama_C_show_each_eq_double: {inf}, {inf} [eva] tests/float/logic.i:100: Frama_C_show_each_lt_double: {inf}, [-inf .. 0x1.fffffffffffffp1023] [eva] tests/float/logic.i:104: Frama_C_show_each_le_double: {inf}, [-inf .. inf] [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: {inf}, [-inf .. 0x1.fffffffffffffp1023] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] computing for function test_comparison_reduction <- test_builtin_comparisons <- main. Called from tests/float/logic.i:134. [eva:alarm] tests/float/logic.i:83: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/float/logic.i:87: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/float/logic.i:91: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/float/logic.i:95: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/float/logic.i:99: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/float/logic.i:103: Warning: assertion got status invalid (stopping propagation). [eva] tests/float/logic.i:107: assertion got status valid. [eva] tests/float/logic.i:108: Frama_C_show_each_ne_double: NaN, [-inf .. inf] ∪ {NaN} [eva] Recording results for test_comparison_reduction [eva] Done for function test_comparison_reduction [eva] Recording results for test_builtin_comparisons [eva] Done for function test_builtin_comparisons [eva] computing for function test_is_finite <- main. Called from tests/float/logic.i:191. [eva] tests/float/logic.i:157: assertion got status valid. [eva:alarm] tests/float/logic.i:166: Warning: assertion got status unknown. [eva:alarm] tests/float/logic.i:174: Warning: assertion got status unknown. [eva] computing for function my_fabs <- test_is_finite <- main. Called from tests/float/logic.i:177. [eva] using specification for function my_fabs [eva] Done for function my_fabs [eva] computing for function my_fabs <- test_is_finite <- main. Called from tests/float/logic.i:178. [eva] Done for function my_fabs [eva] computing for function my_ratio <- test_is_finite <- main. Called from tests/float/logic.i:181. [eva] using specification for function my_ratio [eva] tests/float/logic.i:153: Warning: no 'assigns \result \from ...' clause specified for function my_ratio [eva] Done for function my_ratio [eva] computing for function my_ratio_body <- test_is_finite <- main. Called from tests/float/logic.i:184. [eva] computing for function my_fabs <- my_ratio_body <- test_is_finite <- main. Called from tests/float/logic.i:148. [eva] Done for function my_fabs [eva] tests/float/logic.i:146: function my_ratio_body: postcondition got status valid. [eva] tests/float/logic.i:147: function my_ratio_body: postcondition got status valid. [eva] Recording results for my_ratio_body [eva] Done for function my_ratio_body [eva] Recording results for test_is_finite [eva] Done for function test_is_finite [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function my_ratio_body: __retres ∈ {-0x1.bca1b00000000p-1} [eva:final-states] Values at end of function test_comparison_evaluation: zero ∈ {0} minus_zero ∈ {-0x0.0000000000000p-1022} one ∈ {0x1.0000000000000p0} higher ∈ [0x1.91eb860000000p1 .. 0x1.9000000000000p3] middle ∈ [-0x1.91eb860000000p1 .. 0x1.91eb860000000p1] lower ∈ [-0x1.6333340000000p3 .. -0x1.91eb860000000p1] [eva:final-states] Values at end of function test_comparison_reduction: d ∈ [-inf .. inf] ∪ {NaN} [eva:final-states] Values at end of function test_builtin_comparisons: bound ∈ [-0x1.4000000000000p3 .. 0x1.999999999999ap-4] [eva:final-states] Values at end of function test_equality: [eva:final-states] Values at end of function test_is_finite: f1 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] f2 ∈ [--..--] f3 ∈ [--..--] p ∈ {{ &f2 ; &f3 }} g1 ∈ {0x1.a666660000000p1} g2 ∈ {0x1.a666660000000p1} g3 ∈ [-0x1.fffffe0000000p-1 .. 0x1.fffffe0000000p-1] g4 ∈ {-0x1.bca1b00000000p-1} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function my_ratio_body [from] Computing for function my_fabs <-my_ratio_body [from] Done for function my_fabs [from] Done for function my_ratio_body [from] Computing for function test_comparison_evaluation [from] Done for function test_comparison_evaluation [from] Computing for function test_comparison_reduction [from] Done for function test_comparison_reduction [from] Computing for function test_builtin_comparisons [from] Done for function test_builtin_comparisons [from] Computing for function test_equality [from] Done for function test_equality [from] Computing for function test_is_finite [from] Computing for function my_ratio <-test_is_finite [from] Done for function my_ratio [from] Done for function test_is_finite [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function my_fabs: \result FROM f [from] Function my_ratio: \result FROM ANYTHING(origin:Unknown) [from] Function my_ratio_body: \result FROM f [from] Function test_comparison_evaluation: NO EFFECTS [from] Function test_comparison_reduction: NO EFFECTS [from] Function test_builtin_comparisons: NO EFFECTS [from] Function test_equality: NO EFFECTS [from] Function test_is_finite: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function my_ratio_body: tmp; __retres [inout] Inputs for function my_ratio_body: \nothing [inout] Out (internal) for function test_comparison_evaluation: zero; minus_zero; one; inf; nan; higher; tmp; middle; tmp_0; lower; tmp_1 [inout] Inputs for function test_comparison_evaluation: v [inout] Out (internal) for function test_comparison_reduction: d [inout] Inputs for function test_comparison_reduction: v; any_double [inout] Out (internal) for function test_builtin_comparisons: bound [inout] Inputs for function test_builtin_comparisons: v; any_double [inout] Out (internal) for function test_equality: d; d_0; f [inout] Inputs for function test_equality: v [inout] Out (internal) for function test_is_finite: f1; f2; f3; p; g1; g2; g3; g4 [inout] Inputs for function test_is_finite: undet; top_int [inout] Out (internal) for function main: __retres [inout] Inputs for function main: v; any_double; undet; top_int frama-c-20.0-Calcium/tests/float/oracle/math_builtins.res.oracle0000666000000000000000000047452413571573400021570 0ustar [kernel] Parsing tests/float/math_builtins.c (with preprocessing) [kernel:parser:decimal-float] tests/float/math_builtins.c:248: Warning: Floating-point constant 5.8 is not represented exactly. Will use 0x1.7333333333333p2. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function test_cos_det <- main. Called from tests/float/math_builtins.c:656. [eva] tests/float/math_builtins.c:17: Call to builtin Frama_C_cos for function cos [eva] tests/float/math_builtins.c:17: function cos: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:18: Call to builtin Frama_C_cos for function cos [eva] tests/float/math_builtins.c:18: function cos: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:19: Call to builtin Frama_C_cos for function cos [eva] tests/float/math_builtins.c:19: function cos: precondition 'finite_arg' got status valid. [eva] Recording results for test_cos_det [eva] Done for function test_cos_det [eva] computing for function test_sin_det <- main. Called from tests/float/math_builtins.c:657. [eva] tests/float/math_builtins.c:23: Call to builtin Frama_C_sin for function sin [eva] tests/float/math_builtins.c:23: function sin: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:24: Call to builtin Frama_C_sin for function sin [eva] tests/float/math_builtins.c:24: function sin: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:25: Call to builtin Frama_C_sin for function sin [eva] tests/float/math_builtins.c:25: function sin: precondition 'finite_arg' got status valid. [eva] Recording results for test_sin_det [eva] Done for function test_sin_det [eva] computing for function test_atan2_det <- main. Called from tests/float/math_builtins.c:658. [eva] tests/float/math_builtins.c:29: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:29: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:29: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:30: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:30: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:30: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:31: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:31: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:31: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:32: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:32: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:32: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:33: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:33: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:33: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:34: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:34: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:34: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:35: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:35: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:35: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:36: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:36: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:36: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:37: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:37: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:37: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:38: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:38: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:38: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:39: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:39: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:39: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:40: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:40: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:40: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:41: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:41: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:41: function atan2: precondition 'finite_result' got status valid. [eva] Recording results for test_atan2_det [eva] Done for function test_atan2_det [eva] computing for function test_atan2 <- main. Called from tests/float/math_builtins.c:659. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:46. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:47. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:48: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:48: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:48: function atan2: precondition 'finite_result' got status valid. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:49. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:50: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:50: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:50: function atan2: precondition 'finite_result' got status valid. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:51. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:52: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:52: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:52: function atan2: precondition 'finite_result' got status valid. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:53. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:54: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:54: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:54: function atan2: precondition 'finite_result' got status valid. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:55. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:56: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:56: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:56: function atan2: precondition 'finite_result' got status valid. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:57. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:58. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:59: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:59: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:59: function atan2: precondition 'finite_result' got status valid. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:60. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:61: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:61: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:61: function atan2: precondition 'finite_result' got status valid. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:62. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:63: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:63: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:63: function atan2: precondition 'finite_result' got status valid. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:64. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:65: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:65: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:65: function atan2: precondition 'finite_result' got status valid. [eva] computing for function double_interval <- test_atan2 <- main. Called from tests/float/math_builtins.c:66. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:67: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:67: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:67: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:68: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:68: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:68: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:69: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:69: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:69: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:70: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:70: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:70: function atan2: precondition 'finite_result' got status valid. [eva] tests/float/math_builtins.c:71: Call to builtin Frama_C_atan2 for function atan2 [eva] tests/float/math_builtins.c:71: function atan2: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:71: function atan2: precondition 'finite_result' got status valid. [eva] Recording results for test_atan2 [eva] Done for function test_atan2 [eva] computing for function test_pow_det <- main. Called from tests/float/math_builtins.c:660. [eva] tests/float/math_builtins.c:75: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:75: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:75: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:76: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:76: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:76: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:77: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:77: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:77: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:78: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:78: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:78: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:79: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:79: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:79: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:80: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:80: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:80: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:81: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:81: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:81: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:82: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:82: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:82: function pow: precondition 'finite_logic_res' got status valid. [eva] Recording results for test_pow_det [eva] Done for function test_pow_det [eva] computing for function test_pow_singleton_exp <- main. Called from tests/float/math_builtins.c:661. [eva] computing for function double_interval <- test_pow_singleton_exp <- main. Called from tests/float/math_builtins.c:98. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:100: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:100: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:100: Warning: function pow: precondition 'finite_logic_res' got status invalid. [eva] tests/float/math_builtins.c:102: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:102: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:102: Warning: function pow: precondition 'finite_logic_res' got status invalid. [eva] computing for function double_interval <- test_pow_singleton_exp <- main. Called from tests/float/math_builtins.c:105. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:106: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:106: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:106: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] tests/float/math_builtins.c:107: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:107: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:107: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] tests/float/math_builtins.c:110: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:110: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:110: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] tests/float/math_builtins.c:111: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:111: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:111: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow_singleton_exp <- main. Called from tests/float/math_builtins.c:114. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:115: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:115: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:115: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow_singleton_exp <- main. Called from tests/float/math_builtins.c:116. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:117: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:117: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:117: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow_singleton_exp <- main. Called from tests/float/math_builtins.c:120. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:121: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:121: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:121: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:122: Frama_C_show_each_i: [0.0000000000000000 .. 1.0000000000000000*2^-1000] [eva] computing for function double_interval <- test_pow_singleton_exp <- main. Called from tests/float/math_builtins.c:123. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:124: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:124: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:124: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:125: Frama_C_show_each_j: [0.2500000000000000*2^-1022 .. 1.2707064924076672*2^-330] [eva] tests/float/math_builtins.c:129: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:129: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:129: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:130: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:130: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:130: function pow: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_pow_singleton_exp <- main. Called from tests/float/math_builtins.c:132. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:133: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:133: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:133: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:134: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:134: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:134: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:135: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:135: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:135: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:136: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:136: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:136: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:137: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:137: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:137: function pow: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_pow_singleton_exp <- main. Called from tests/float/math_builtins.c:139. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:140: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:140: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:140: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:141: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:141: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:141: function pow: precondition 'finite_logic_res' got status valid. [eva] Recording results for test_pow_singleton_exp [eva] Done for function test_pow_singleton_exp [eva] computing for function test_pow <- main. Called from tests/float/math_builtins.c:662. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:147. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:148: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:148: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:148: function pow: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:149. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:150: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:150: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:150: function pow: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:151. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:152: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:152: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:152: function pow: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:158. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:159. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:160: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:160: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:160: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:161. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:162: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:162: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:162: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:163. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:164: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:164: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:164: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:165. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:166. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:167: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:167: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:167: function pow: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:170. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:171. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:172: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:172: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:172: function pow: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:175. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:176. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:177: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:177: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:177: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:178. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:179. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:180: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:180: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:180: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:184. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:185. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:186: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:186: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:186: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:189. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:190. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:191: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:191: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:191: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:194. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:195. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:196: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:196: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:196: function pow: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:199. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:200. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:201: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:201: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:201: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:204. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:205. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:206: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:206: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:206: Warning: function pow: precondition 'finite_logic_res' got status invalid. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:207. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:208: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:208: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:208: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:209. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:210: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:210: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:210: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:211. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:212: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:212: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:212: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:215. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:216. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:217: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:217: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:217: Warning: function pow: precondition 'finite_logic_res' got status invalid. [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:220. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:221. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:222: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:222: function pow: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:222: Warning: function pow: precondition 'finite_logic_res' got status unknown. [eva] tests/float/math_builtins.c:222: Frama_C_show_each_unreachable: [eva] computing for function double_interval <- test_pow <- main. Called from tests/float/math_builtins.c:224. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:225: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:225: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:225: function pow: precondition 'finite_logic_res' got status valid. [eva] Recording results for test_pow [eva] Done for function test_pow [eva] computing for function test_fmod_det <- main. Called from tests/float/math_builtins.c:663. [eva] tests/float/math_builtins.c:335: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:335: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:335: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:336: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:336: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:336: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:337: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:337: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:337: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:338: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:338: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:338: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:339: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:339: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:339: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:340: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:340: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:340: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:341: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:341: function fmod: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:341: Warning: function fmod: precondition 'finite_logic_result' got status invalid. [eva] Recording results for test_fmod_det [eva] Done for function test_fmod_det [eva] computing for function test_fmod <- main. Called from tests/float/math_builtins.c:664. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:346. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:347: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:347: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:347: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:348: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:348: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:348: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:349: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:349: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:349: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:350: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:350: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:350: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:351. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:352: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:352: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:352: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:353: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:353: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:353: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:354. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:355. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:356: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:356: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:356: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:357. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:358. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:359: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:359: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:359: function fmod: precondition 'finite_logic_result' got status valid. [eva] tests/float/math_builtins.c:360: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:360: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:360: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:361. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:362. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:363: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:363: function fmod: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:363: Warning: function fmod: precondition 'finite_logic_result' got status unknown. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:364. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:365. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:366: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:366: function fmod: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:366: Warning: function fmod: precondition 'finite_logic_result' got status unknown. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:367. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:368: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:368: function fmod: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:368: Warning: function fmod: precondition 'finite_logic_result' got status invalid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:369. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:370: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:370: function fmod: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:370: Warning: function fmod: precondition 'finite_logic_result' got status unknown. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:371. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:372: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:372: function fmod: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:372: Warning: function fmod: precondition 'finite_logic_result' got status unknown. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:373. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:374: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:374: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:374: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:375. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:376: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:376: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:376: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:377. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:378: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:378: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:378: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:379. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:380: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:380: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:380: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:381. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:382: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:382: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:382: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:383. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:384: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:384: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:384: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:385. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:386: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:386: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:386: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:387. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:388: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:388: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:388: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:389. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:390. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:391: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:391: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:391: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:392. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:393: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:393: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:393: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:394. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:395: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:395: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:395: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:396. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:397: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:397: function fmod: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:397: function fmod: precondition 'finite_logic_result' got status valid. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:398. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:399. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:400: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:400: function fmod: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:400: Warning: function fmod: precondition 'finite_logic_result' got status unknown. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:401. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:402: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:402: function fmod: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:402: Warning: function fmod: precondition 'finite_logic_result' got status unknown. [eva] computing for function double_interval <- test_fmod <- main. Called from tests/float/math_builtins.c:403. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:404: Call to builtin Frama_C_fmod for function fmod [eva] tests/float/math_builtins.c:404: function fmod: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:404: Warning: function fmod: precondition 'finite_logic_result' got status unknown. [eva] Recording results for test_fmod [eva] Done for function test_fmod [eva] computing for function test_sqrt_det <- main. Called from tests/float/math_builtins.c:665. [eva] tests/float/math_builtins.c:408: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:408: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:408: function sqrt: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:409: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:409: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:409: function sqrt: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:410: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:410: function sqrt: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:410: Warning: function sqrt: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:411: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:411: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:411: function sqrt: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:412: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:412: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:412: function sqrt: precondition 'arg_positive' got status valid. [eva] Recording results for test_sqrt_det [eva] Done for function test_sqrt_det [eva] computing for function test_sqrt <- main. Called from tests/float/math_builtins.c:666. [eva] computing for function double_interval <- test_sqrt <- main. Called from tests/float/math_builtins.c:416. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:417: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:417: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:417: function sqrt: precondition 'arg_positive' got status valid. [eva] computing for function double_interval <- test_sqrt <- main. Called from tests/float/math_builtins.c:418. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:419: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:419: function sqrt: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:419: Warning: function sqrt: precondition 'arg_positive' got status unknown. [eva] computing for function double_interval <- test_sqrt <- main. Called from tests/float/math_builtins.c:420. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:421: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:421: function sqrt: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:421: Warning: function sqrt: precondition 'arg_positive' got status unknown. [eva] computing for function double_interval <- test_sqrt <- main. Called from tests/float/math_builtins.c:422. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:423: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:423: function sqrt: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:423: Warning: function sqrt: precondition 'arg_positive' got status invalid. [eva] Recording results for test_sqrt [eva] Done for function test_sqrt [eva] computing for function test_exp_det <- main. Called from tests/float/math_builtins.c:667. [eva] tests/float/math_builtins.c:446: Call to builtin Frama_C_exp for function exp [eva] tests/float/math_builtins.c:446: function exp: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:446: function exp: precondition 'finite_domain' got status valid. [eva] tests/float/math_builtins.c:447: Call to builtin Frama_C_exp for function exp [eva] tests/float/math_builtins.c:447: function exp: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:447: function exp: precondition 'finite_domain' got status valid. [eva] tests/float/math_builtins.c:448: Call to builtin Frama_C_exp for function exp [eva] tests/float/math_builtins.c:448: function exp: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:448: function exp: precondition 'finite_domain' got status valid. [eva] tests/float/math_builtins.c:449: Call to builtin Frama_C_exp for function exp [eva] tests/float/math_builtins.c:449: function exp: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:449: function exp: precondition 'finite_domain' got status valid. [eva] tests/float/math_builtins.c:450: Call to builtin Frama_C_exp for function exp [eva] tests/float/math_builtins.c:450: function exp: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:450: function exp: precondition 'finite_domain' got status valid. [eva] tests/float/math_builtins.c:451: Call to builtin Frama_C_exp for function exp [eva] tests/float/math_builtins.c:451: function exp: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:451: Warning: function exp: precondition 'finite_domain' got status invalid. [eva] Recording results for test_exp_det [eva] Done for function test_exp_det [eva] computing for function test_log_det <- main. Called from tests/float/math_builtins.c:668. [eva] tests/float/math_builtins.c:463: Call to builtin Frama_C_log for function log [eva] tests/float/math_builtins.c:463: function log: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:463: function log: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:464: Call to builtin Frama_C_log for function log [eva] tests/float/math_builtins.c:464: function log: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:464: function log: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:465: Call to builtin Frama_C_log for function log [eva] tests/float/math_builtins.c:465: function log: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:465: Warning: function log: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:466: Call to builtin Frama_C_log for function log [eva] tests/float/math_builtins.c:466: function log: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:466: Warning: function log: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:467: Call to builtin Frama_C_log for function log [eva] tests/float/math_builtins.c:467: function log: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:467: Warning: function log: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:468: Call to builtin Frama_C_log for function log [eva] tests/float/math_builtins.c:468: function log: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:468: Warning: function log: precondition 'arg_positive' got status invalid. [eva] Recording results for test_log_det [eva] Done for function test_log_det [eva] computing for function test_log10_det <- main. Called from tests/float/math_builtins.c:669. [eva] tests/float/math_builtins.c:481: Call to builtin Frama_C_log10 for function log10 [eva] tests/float/math_builtins.c:481: function log10: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:481: function log10: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:482: Call to builtin Frama_C_log10 for function log10 [eva] tests/float/math_builtins.c:482: function log10: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:482: function log10: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:483: Call to builtin Frama_C_log10 for function log10 [eva] tests/float/math_builtins.c:483: function log10: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:483: Warning: function log10: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:484: Call to builtin Frama_C_log10 for function log10 [eva] tests/float/math_builtins.c:484: function log10: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:484: Warning: function log10: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:485: Call to builtin Frama_C_log10 for function log10 [eva] tests/float/math_builtins.c:485: function log10: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:485: Warning: function log10: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:486: Call to builtin Frama_C_log10 for function log10 [eva] tests/float/math_builtins.c:486: function log10: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:486: Warning: function log10: precondition 'arg_positive' got status invalid. [eva] Recording results for test_log10_det [eva] Done for function test_log10_det [eva] computing for function test_powf_det <- main. Called from tests/float/math_builtins.c:671. [eva] tests/float/math_builtins.c:86: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:86: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:86: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:87: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:87: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:87: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:88: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:88: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:88: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:89: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:89: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:89: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:90: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:90: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:90: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:91: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:91: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:91: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:92: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:92: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:92: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:93: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:93: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:93: function powf: precondition 'finite_logic_res' got status valid. [eva] Recording results for test_powf_det [eva] Done for function test_powf_det [eva] computing for function test_powf_singleton_exp <- main. Called from tests/float/math_builtins.c:672. [eva] computing for function double_interval <- test_powf_singleton_exp <- main. Called from tests/float/math_builtins.c:231. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:233: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:233: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:233: Warning: function powf: precondition 'finite_logic_res' got status invalid. [eva] tests/float/math_builtins.c:235: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:235: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:235: Warning: function powf: precondition 'finite_logic_res' got status invalid. [eva] computing for function double_interval <- test_powf_singleton_exp <- main. Called from tests/float/math_builtins.c:238. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:239: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:239: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:239: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] tests/float/math_builtins.c:240: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:240: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:240: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] tests/float/math_builtins.c:243: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:243: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:243: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] tests/float/math_builtins.c:244: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:244: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:244: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_powf_singleton_exp <- main. Called from tests/float/math_builtins.c:247. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:248: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:248: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:248: function powf: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_powf_singleton_exp <- main. Called from tests/float/math_builtins.c:249. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:250: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:250: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:250: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_powf_singleton_exp <- main. Called from tests/float/math_builtins.c:253. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:254: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:254: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:254: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:255: Frama_C_show_each_i: [0.0000000000000000 .. 1.0000000000000000*2^-120] [eva] computing for function double_interval <- test_powf_singleton_exp <- main. Called from tests/float/math_builtins.c:256. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:257: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:257: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:257: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:258: Frama_C_show_each_j: {0} [eva] tests/float/math_builtins.c:262: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:262: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:262: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:263: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:263: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:263: function powf: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_powf_singleton_exp <- main. Called from tests/float/math_builtins.c:265. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:266: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:266: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:266: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:267: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:267: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:267: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:268: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:268: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:268: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:269: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:269: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:269: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:270: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:270: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:270: function powf: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_powf_singleton_exp <- main. Called from tests/float/math_builtins.c:272. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:273: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:273: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:273: function powf: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:274: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:274: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:274: function powf: precondition 'finite_logic_res' got status valid. [eva] Recording results for test_powf_singleton_exp [eva] Done for function test_powf_singleton_exp [eva] computing for function test_powf <- main. Called from tests/float/math_builtins.c:673. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:280. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:281: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:281: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:281: function powf: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:282. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:283: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:283: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:283: function powf: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:284. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:285: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:285: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:285: function powf: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:291. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:292. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:293: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:293: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:293: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:294. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:295: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:295: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:295: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:296. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:297: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:297: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:297: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:298. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:299. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:300: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:300: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:300: function powf: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:303. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:304. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:305: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:305: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:305: function powf: precondition 'finite_logic_res' got status valid. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:308. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:309. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:310: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:310: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:310: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:313. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:314. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:315: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:315: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:315: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:319. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:320. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:321: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:321: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:321: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:324. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:325. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:326: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:326: function powf: precondition 'finite_args' got status valid. [eva:alarm] tests/float/math_builtins.c:326: Warning: function powf: precondition 'finite_logic_res' got status unknown. [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:329. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] computing for function double_interval <- test_powf <- main. Called from tests/float/math_builtins.c:330. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:331: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:331: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:331: function powf: precondition 'finite_logic_res' got status valid. [eva] Recording results for test_powf [eva] Done for function test_powf [eva] computing for function test_sqrtf_det <- main. Called from tests/float/math_builtins.c:674. [eva] tests/float/math_builtins.c:427: Call to builtin Frama_C_sqrtf for function sqrtf [eva] tests/float/math_builtins.c:427: function sqrtf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:427: function sqrtf: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:428: Call to builtin Frama_C_sqrtf for function sqrtf [eva] tests/float/math_builtins.c:428: function sqrtf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:428: function sqrtf: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:429: Call to builtin Frama_C_sqrtf for function sqrtf [eva] tests/float/math_builtins.c:429: function sqrtf: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:429: Warning: function sqrtf: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:430: Call to builtin Frama_C_sqrtf for function sqrtf [eva] tests/float/math_builtins.c:430: function sqrtf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:430: function sqrtf: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:431: Call to builtin Frama_C_sqrtf for function sqrtf [eva] tests/float/math_builtins.c:431: function sqrtf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:431: function sqrtf: precondition 'arg_positive' got status valid. [eva] Recording results for test_sqrtf_det [eva] Done for function test_sqrtf_det [eva] computing for function test_sqrtf <- main. Called from tests/float/math_builtins.c:675. [eva] computing for function double_interval <- test_sqrtf <- main. Called from tests/float/math_builtins.c:435. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:436: Call to builtin Frama_C_sqrtf for function sqrtf [eva] tests/float/math_builtins.c:436: function sqrtf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:436: function sqrtf: precondition 'arg_positive' got status valid. [eva] computing for function double_interval <- test_sqrtf <- main. Called from tests/float/math_builtins.c:437. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:438: Call to builtin Frama_C_sqrtf for function sqrtf [eva] tests/float/math_builtins.c:438: function sqrtf: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:438: Warning: function sqrtf: precondition 'arg_positive' got status unknown. [eva] computing for function double_interval <- test_sqrtf <- main. Called from tests/float/math_builtins.c:439. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:440: Call to builtin Frama_C_sqrtf for function sqrtf [eva] tests/float/math_builtins.c:440: function sqrtf: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:440: Warning: function sqrtf: precondition 'arg_positive' got status unknown. [eva] computing for function double_interval <- test_sqrtf <- main. Called from tests/float/math_builtins.c:441. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:442: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/float/math_builtins.c:442: function sqrt: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:442: Warning: function sqrt: precondition 'arg_positive' got status invalid. [eva] Recording results for test_sqrtf [eva] Done for function test_sqrtf [eva] computing for function test_expf_det <- main. Called from tests/float/math_builtins.c:676. [eva] tests/float/math_builtins.c:455: Call to builtin Frama_C_expf for function expf [eva] tests/float/math_builtins.c:455: function expf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:455: function expf: precondition 'res_finite' got status valid. [eva] tests/float/math_builtins.c:456: Call to builtin Frama_C_expf for function expf [eva] tests/float/math_builtins.c:456: function expf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:456: function expf: precondition 'res_finite' got status valid. [eva] tests/float/math_builtins.c:457: Call to builtin Frama_C_expf for function expf [eva] tests/float/math_builtins.c:457: function expf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:457: function expf: precondition 'res_finite' got status valid. [eva] tests/float/math_builtins.c:458: Call to builtin Frama_C_expf for function expf [eva] tests/float/math_builtins.c:458: function expf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:458: function expf: precondition 'res_finite' got status valid. [eva] tests/float/math_builtins.c:459: Call to builtin Frama_C_expf for function expf [eva] tests/float/math_builtins.c:459: function expf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:459: function expf: precondition 'res_finite' got status valid. [eva] Recording results for test_expf_det [eva] Done for function test_expf_det [eva] computing for function test_logf_det <- main. Called from tests/float/math_builtins.c:677. [eva] tests/float/math_builtins.c:472: Call to builtin Frama_C_logf for function logf [eva] tests/float/math_builtins.c:472: function logf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:472: function logf: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:473: Call to builtin Frama_C_logf for function logf [eva] tests/float/math_builtins.c:473: function logf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:473: function logf: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:474: Call to builtin Frama_C_logf for function logf [eva] tests/float/math_builtins.c:474: function logf: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:474: Warning: function logf: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:475: Call to builtin Frama_C_logf for function logf [eva] tests/float/math_builtins.c:475: function logf: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:475: Warning: function logf: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:476: Call to builtin Frama_C_logf for function logf [eva] tests/float/math_builtins.c:476: function logf: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:476: Warning: function logf: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:477: Call to builtin Frama_C_logf for function logf [eva] tests/float/math_builtins.c:477: function logf: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:477: Warning: function logf: precondition 'arg_positive' got status invalid. [eva] Recording results for test_logf_det [eva] Done for function test_logf_det [eva] computing for function test_log10f_det <- main. Called from tests/float/math_builtins.c:678. [eva] tests/float/math_builtins.c:490: Call to builtin Frama_C_log10f for function log10f [eva] tests/float/math_builtins.c:490: function log10f: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:490: function log10f: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:491: Call to builtin Frama_C_log10f for function log10f [eva] tests/float/math_builtins.c:491: function log10f: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:491: function log10f: precondition 'arg_positive' got status valid. [eva] tests/float/math_builtins.c:492: Call to builtin Frama_C_log10f for function log10f [eva] tests/float/math_builtins.c:492: function log10f: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:492: Warning: function log10f: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:493: Call to builtin Frama_C_log10f for function log10f [eva] tests/float/math_builtins.c:493: function log10f: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:493: Warning: function log10f: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:494: Call to builtin Frama_C_log10f for function log10f [eva] tests/float/math_builtins.c:494: function log10f: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:494: Warning: function log10f: precondition 'arg_positive' got status invalid. [eva] tests/float/math_builtins.c:495: Call to builtin Frama_C_log10f for function log10f [eva] tests/float/math_builtins.c:495: function log10f: precondition 'finite_arg' got status valid. [eva:alarm] tests/float/math_builtins.c:495: Warning: function log10f: precondition 'arg_positive' got status invalid. [eva] Recording results for test_log10f_det [eva] Done for function test_log10f_det [eva] computing for function test_diff_pow_powf <- main. Called from tests/float/math_builtins.c:680. [eva] tests/float/math_builtins.c:499: Call to builtin Frama_C_pow for function pow [eva] tests/float/math_builtins.c:499: function pow: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:499: function pow: precondition 'finite_logic_res' got status valid. [eva] tests/float/math_builtins.c:500: Call to builtin Frama_C_powf for function powf [eva] tests/float/math_builtins.c:500: function powf: precondition 'finite_args' got status valid. [eva] tests/float/math_builtins.c:500: function powf: precondition 'finite_logic_res' got status valid. [eva] Recording results for test_diff_pow_powf [eva] Done for function test_diff_pow_powf [eva] computing for function test_floor_det <- main. Called from tests/float/math_builtins.c:682. [eva] tests/float/math_builtins.c:504: Call to builtin Frama_C_floor for function floor [eva] tests/float/math_builtins.c:504: function floor: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:505: Call to builtin Frama_C_floor for function floor [eva] tests/float/math_builtins.c:505: function floor: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:506: Call to builtin Frama_C_floor for function floor [eva] tests/float/math_builtins.c:506: function floor: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:507: Call to builtin Frama_C_floor for function floor [eva] tests/float/math_builtins.c:507: function floor: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:508: Call to builtin Frama_C_floor for function floor [eva] tests/float/math_builtins.c:508: function floor: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:509: Call to builtin Frama_C_floor for function floor [eva] tests/float/math_builtins.c:509: function floor: precondition 'finite_arg' got status valid. [eva] Recording results for test_floor_det [eva] Done for function test_floor_det [eva] computing for function test_ceil_det <- main. Called from tests/float/math_builtins.c:683. [eva] tests/float/math_builtins.c:513: Call to builtin Frama_C_ceil for function ceil [eva] tests/float/math_builtins.c:513: function ceil: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:514: Call to builtin Frama_C_ceil for function ceil [eva] tests/float/math_builtins.c:514: function ceil: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:515: Call to builtin Frama_C_ceil for function ceil [eva] tests/float/math_builtins.c:515: function ceil: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:516: Call to builtin Frama_C_ceil for function ceil [eva] tests/float/math_builtins.c:516: function ceil: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:517: Call to builtin Frama_C_ceil for function ceil [eva] tests/float/math_builtins.c:517: function ceil: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:518: Call to builtin Frama_C_ceil for function ceil [eva] tests/float/math_builtins.c:518: function ceil: precondition 'finite_arg' got status valid. [eva] Recording results for test_ceil_det [eva] Done for function test_ceil_det [eva] computing for function test_trunc_det <- main. Called from tests/float/math_builtins.c:684. [eva] tests/float/math_builtins.c:522: Call to builtin Frama_C_trunc for function trunc [eva] tests/float/math_builtins.c:522: function trunc: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:523: Call to builtin Frama_C_trunc for function trunc [eva] tests/float/math_builtins.c:523: function trunc: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:524: Call to builtin Frama_C_trunc for function trunc [eva] tests/float/math_builtins.c:524: function trunc: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:525: Call to builtin Frama_C_trunc for function trunc [eva] tests/float/math_builtins.c:525: function trunc: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:526: Call to builtin Frama_C_trunc for function trunc [eva] tests/float/math_builtins.c:526: function trunc: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:527: Call to builtin Frama_C_trunc for function trunc [eva] tests/float/math_builtins.c:527: function trunc: precondition 'finite_arg' got status valid. [eva] Recording results for test_trunc_det [eva] Done for function test_trunc_det [eva] computing for function test_round_det <- main. Called from tests/float/math_builtins.c:685. [eva] tests/float/math_builtins.c:531: Call to builtin Frama_C_round for function round [eva] tests/float/math_builtins.c:531: function round: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:532: Call to builtin Frama_C_round for function round [eva] tests/float/math_builtins.c:532: function round: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:533: Call to builtin Frama_C_round for function round [eva] tests/float/math_builtins.c:533: function round: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:534: Call to builtin Frama_C_round for function round [eva] tests/float/math_builtins.c:534: function round: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:535: Call to builtin Frama_C_round for function round [eva] tests/float/math_builtins.c:535: function round: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:536: Call to builtin Frama_C_round for function round [eva] tests/float/math_builtins.c:536: function round: precondition 'finite_arg' got status valid. [eva] Recording results for test_round_det [eva] Done for function test_round_det [eva] computing for function test_floor <- main. Called from tests/float/math_builtins.c:686. [eva] computing for function double_interval <- test_floor <- main. Called from tests/float/math_builtins.c:541. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:542: Call to builtin Frama_C_floor for function floor [eva] tests/float/math_builtins.c:542: function floor: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_floor <- main. Called from tests/float/math_builtins.c:543. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:544: Call to builtin Frama_C_floor for function floor [eva] tests/float/math_builtins.c:544: function floor: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_floor <- main. Called from tests/float/math_builtins.c:545. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:546: Call to builtin Frama_C_floor for function floor [eva] tests/float/math_builtins.c:546: function floor: precondition 'finite_arg' got status valid. [eva] Recording results for test_floor [eva] Done for function test_floor [eva] computing for function test_ceil <- main. Called from tests/float/math_builtins.c:687. [eva] computing for function double_interval <- test_ceil <- main. Called from tests/float/math_builtins.c:551. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:552: Call to builtin Frama_C_ceil for function ceil [eva] tests/float/math_builtins.c:552: function ceil: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_ceil <- main. Called from tests/float/math_builtins.c:553. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:554: Call to builtin Frama_C_ceil for function ceil [eva] tests/float/math_builtins.c:554: function ceil: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_ceil <- main. Called from tests/float/math_builtins.c:555. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:556: Call to builtin Frama_C_ceil for function ceil [eva] tests/float/math_builtins.c:556: function ceil: precondition 'finite_arg' got status valid. [eva] Recording results for test_ceil [eva] Done for function test_ceil [eva] computing for function test_trunc <- main. Called from tests/float/math_builtins.c:688. [eva] computing for function double_interval <- test_trunc <- main. Called from tests/float/math_builtins.c:561. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:562: Call to builtin Frama_C_trunc for function trunc [eva] tests/float/math_builtins.c:562: function trunc: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_trunc <- main. Called from tests/float/math_builtins.c:563. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:564: Call to builtin Frama_C_trunc for function trunc [eva] tests/float/math_builtins.c:564: function trunc: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_trunc <- main. Called from tests/float/math_builtins.c:565. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:566: Call to builtin Frama_C_trunc for function trunc [eva] tests/float/math_builtins.c:566: function trunc: precondition 'finite_arg' got status valid. [eva] Recording results for test_trunc [eva] Done for function test_trunc [eva] computing for function test_round <- main. Called from tests/float/math_builtins.c:689. [eva] computing for function double_interval <- test_round <- main. Called from tests/float/math_builtins.c:571. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:572: Call to builtin Frama_C_round for function round [eva] tests/float/math_builtins.c:572: function round: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_round <- main. Called from tests/float/math_builtins.c:573. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:574: Call to builtin Frama_C_round for function round [eva] tests/float/math_builtins.c:574: function round: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_round <- main. Called from tests/float/math_builtins.c:575. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:576: Call to builtin Frama_C_round for function round [eva] tests/float/math_builtins.c:576: function round: precondition 'finite_arg' got status valid. [eva] Recording results for test_round [eva] Done for function test_round [eva] computing for function test_floorf_det <- main. Called from tests/float/math_builtins.c:691. [eva] tests/float/math_builtins.c:580: Call to builtin Frama_C_floorf for function floorf [eva] tests/float/math_builtins.c:580: function floorf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:581: Call to builtin Frama_C_floorf for function floorf [eva] tests/float/math_builtins.c:581: function floorf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:582: Call to builtin Frama_C_floorf for function floorf [eva] tests/float/math_builtins.c:582: function floorf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:583: Call to builtin Frama_C_floorf for function floorf [eva] tests/float/math_builtins.c:583: function floorf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:584: Call to builtin Frama_C_floorf for function floorf [eva] tests/float/math_builtins.c:584: function floorf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:585: Call to builtin Frama_C_floorf for function floorf [eva] tests/float/math_builtins.c:585: function floorf: precondition 'finite_arg' got status valid. [eva] Recording results for test_floorf_det [eva] Done for function test_floorf_det [eva] computing for function test_ceilf_det <- main. Called from tests/float/math_builtins.c:692. [eva] tests/float/math_builtins.c:589: Call to builtin Frama_C_ceilf for function ceilf [eva] tests/float/math_builtins.c:589: function ceilf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:590: Call to builtin Frama_C_ceilf for function ceilf [eva] tests/float/math_builtins.c:590: function ceilf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:591: Call to builtin Frama_C_ceilf for function ceilf [eva] tests/float/math_builtins.c:591: function ceilf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:592: Call to builtin Frama_C_ceilf for function ceilf [eva] tests/float/math_builtins.c:592: function ceilf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:593: Call to builtin Frama_C_ceilf for function ceilf [eva] tests/float/math_builtins.c:593: function ceilf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:594: Call to builtin Frama_C_ceilf for function ceilf [eva] tests/float/math_builtins.c:594: function ceilf: precondition 'finite_arg' got status valid. [eva] Recording results for test_ceilf_det [eva] Done for function test_ceilf_det [eva] computing for function test_truncf_det <- main. Called from tests/float/math_builtins.c:693. [eva] tests/float/math_builtins.c:598: Call to builtin Frama_C_truncf for function truncf [eva] tests/float/math_builtins.c:598: function truncf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:599: Call to builtin Frama_C_truncf for function truncf [eva] tests/float/math_builtins.c:599: function truncf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:600: Call to builtin Frama_C_truncf for function truncf [eva] tests/float/math_builtins.c:600: function truncf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:601: Call to builtin Frama_C_truncf for function truncf [eva] tests/float/math_builtins.c:601: function truncf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:602: Call to builtin Frama_C_truncf for function truncf [eva] tests/float/math_builtins.c:602: function truncf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:603: Call to builtin Frama_C_truncf for function truncf [eva] tests/float/math_builtins.c:603: function truncf: precondition 'finite_arg' got status valid. [eva] Recording results for test_truncf_det [eva] Done for function test_truncf_det [eva] computing for function test_roundf_det <- main. Called from tests/float/math_builtins.c:694. [eva] tests/float/math_builtins.c:607: Call to builtin Frama_C_roundf for function roundf [eva] tests/float/math_builtins.c:607: function roundf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:608: Call to builtin Frama_C_roundf for function roundf [eva] tests/float/math_builtins.c:608: function roundf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:609: Call to builtin Frama_C_roundf for function roundf [eva] tests/float/math_builtins.c:609: function roundf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:610: Call to builtin Frama_C_roundf for function roundf [eva] tests/float/math_builtins.c:610: function roundf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:611: Call to builtin Frama_C_roundf for function roundf [eva] tests/float/math_builtins.c:611: function roundf: precondition 'finite_arg' got status valid. [eva] tests/float/math_builtins.c:612: Call to builtin Frama_C_roundf for function roundf [eva] tests/float/math_builtins.c:612: function roundf: precondition 'finite_arg' got status valid. [eva] Recording results for test_roundf_det [eva] Done for function test_roundf_det [eva] computing for function test_floorf <- main. Called from tests/float/math_builtins.c:695. [eva] computing for function double_interval <- test_floorf <- main. Called from tests/float/math_builtins.c:617. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:618: Call to builtin Frama_C_floorf for function floorf [eva] tests/float/math_builtins.c:618: function floorf: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_floorf <- main. Called from tests/float/math_builtins.c:619. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:620: Call to builtin Frama_C_floorf for function floorf [eva] tests/float/math_builtins.c:620: function floorf: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_floorf <- main. Called from tests/float/math_builtins.c:621. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:622: Call to builtin Frama_C_floorf for function floorf [eva] tests/float/math_builtins.c:622: function floorf: precondition 'finite_arg' got status valid. [eva] Recording results for test_floorf [eva] Done for function test_floorf [eva] computing for function test_ceilf <- main. Called from tests/float/math_builtins.c:696. [eva] computing for function double_interval <- test_ceilf <- main. Called from tests/float/math_builtins.c:627. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:628: Call to builtin Frama_C_ceilf for function ceilf [eva] tests/float/math_builtins.c:628: function ceilf: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_ceilf <- main. Called from tests/float/math_builtins.c:629. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:630: Call to builtin Frama_C_ceilf for function ceilf [eva] tests/float/math_builtins.c:630: function ceilf: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_ceilf <- main. Called from tests/float/math_builtins.c:631. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:632: Call to builtin Frama_C_ceilf for function ceilf [eva] tests/float/math_builtins.c:632: function ceilf: precondition 'finite_arg' got status valid. [eva] Recording results for test_ceilf [eva] Done for function test_ceilf [eva] computing for function test_truncf <- main. Called from tests/float/math_builtins.c:697. [eva] computing for function double_interval <- test_truncf <- main. Called from tests/float/math_builtins.c:637. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:638: Call to builtin Frama_C_truncf for function truncf [eva] tests/float/math_builtins.c:638: function truncf: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_truncf <- main. Called from tests/float/math_builtins.c:639. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:640: Call to builtin Frama_C_truncf for function truncf [eva] tests/float/math_builtins.c:640: function truncf: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_truncf <- main. Called from tests/float/math_builtins.c:641. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:642: Call to builtin Frama_C_truncf for function truncf [eva] tests/float/math_builtins.c:642: function truncf: precondition 'finite_arg' got status valid. [eva] Recording results for test_truncf [eva] Done for function test_truncf [eva] computing for function test_roundf <- main. Called from tests/float/math_builtins.c:698. [eva] computing for function double_interval <- test_roundf <- main. Called from tests/float/math_builtins.c:647. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:648: Call to builtin Frama_C_roundf for function roundf [eva] tests/float/math_builtins.c:648: function roundf: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_roundf <- main. Called from tests/float/math_builtins.c:649. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:650: Call to builtin Frama_C_roundf for function roundf [eva] tests/float/math_builtins.c:650: function roundf: precondition 'finite_arg' got status valid. [eva] computing for function double_interval <- test_roundf <- main. Called from tests/float/math_builtins.c:651. [eva] Recording results for double_interval [eva] Done for function double_interval [eva] tests/float/math_builtins.c:652: Call to builtin Frama_C_roundf for function roundf [eva] tests/float/math_builtins.c:652: function roundf: precondition 'finite_arg' got status valid. [eva] Recording results for test_roundf [eva] Done for function test_roundf [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function double_interval: __retres ∈ [-1.2237906221789607*2^1023 .. 1.2237906221789607*2^1023] [eva:final-states] Values at end of function test_atan2: x ∈ [1.0000000000000000 .. 5.0000000000000000] y ∈ [-0.0000000000000000 .. 0.0000000000000000] a ∈ [1.5999166744782948*2^-7 .. 1.5582969777755348] b ∈ [1.3325625311548295*2^-5 .. 3.0916342578678506] c ∈ [-2.9441970937399126 .. -1.3211894193170146*2^-3] d ∈ [-2.9764439761751662 .. -2.6779450445889869] e ∈ {-1.5707963267948965} f ∈ [-1.5707963267948965*2^-1 .. -0.0000000000000000] g ∈ [0.0000000000000000 .. 1.8545904360032243*2^-2] h ∈ [-3.1415929794311523 .. 3.1415929794311523] i ∈ [-3.1415929794311523 .. 3.1415929794311523] j ∈ [-3.1415929794311523 .. 3.1415929794311523] k ∈ {0} l ∈ {-0.0000000000000000} m ∈ {3.1415926535897931} n ∈ {-3.1415926535897931} [eva:final-states] Values at end of function test_atan2_det: a ∈ {1.5707963267948965} b ∈ {0} c ∈ {1.5707963267948965} d ∈ {-0.0000000000000000} e ∈ {-1.5707963267948965} f ∈ {-1.5707963267948965} g ∈ {-1.5707963267948965} h ∈ {-1.5707963267948965} i ∈ {0} j ∈ {1.1071487177940904} k ∈ {-1.1071487177940904} l ∈ {2.0344439357957027} m ∈ {-2.0344439357957027} [eva:final-states] Values at end of function test_ceil: x ∈ [-2.5000000000000000 .. -1.0000000000000000*2^-1] a ∈ [-0.0000000000000000 .. 2.0000000000000000] b ∈ [-0.0000000000000000 .. 1.0000000000000000] c ∈ [-2.0000000000000000 .. -0.0000000000000000] [eva:final-states] Values at end of function test_ceil_det: a ∈ {2.0000000000000000} b ∈ {1.0000000000000000} c ∈ {0} d ∈ {-0.0000000000000000} e ∈ {-0.0000000000000000} f ∈ {-1.0000000000000000} [eva:final-states] Values at end of function test_ceilf: f32__x ∈ [-2.500000 .. -1.000000*2^-1] f32__a ∈ [-0.000000 .. 2.000000] f32__b ∈ [-0.000000 .. 1.000000] f32__c ∈ [-2.000000 .. -0.000000] [eva:final-states] Values at end of function test_ceilf_det: f32__a ∈ {2.000000} f32__b ∈ {1.000000} f32__c ∈ {0} f32__d ∈ {-0.000000} f32__e ∈ {-0.000000} f32__f ∈ {-1.000000} [eva:final-states] Values at end of function test_cos_det: x ∈ {1.0806046117362795*2^-1} y ∈ {1.0000000000000000} z ∈ {1.0806046117362795*2^-1} [eva:final-states] Values at end of function test_diff_pow_powf: d ∈ {1.3824840787361052*2^-96} f32__f ∈ {1.382483*2^-96} [eva:final-states] Values at end of function test_exp_det: a ∈ {1.7094457008275896*2^60} b ∈ {1.0826822658929016*2^-3} c ∈ {1.0000000000000000} d ∈ {1.0000000000000000} e ∈ {1.4715177646857693*2^-2} [eva:final-states] Values at end of function test_expf_det: f32__a ∈ {1.709445*2^60} f32__b ∈ {1.082682*2^-3} f32__c ∈ {1.000000} f32__d ∈ {1.000000} f32__e ∈ {1.471517*2^-2} [eva:final-states] Values at end of function test_floor: x ∈ [-2.5000000000000000 .. -1.0000000000000000*2^-1] a ∈ [-1.0000000000000000 .. 1.0000000000000000] b ∈ [-0.0000000000000000 .. 0.0000000000000000] c ∈ [-3.0000000000000000 .. -1.0000000000000000] [eva:final-states] Values at end of function test_floor_det: a ∈ {1.0000000000000000} b ∈ {0} c ∈ {0} d ∈ {-0.0000000000000000} e ∈ {-1.0000000000000000} f ∈ {-2.0000000000000000} [eva:final-states] Values at end of function test_floorf: f32__x ∈ [-2.500000 .. -1.000000*2^-1] f32__a ∈ [-1.000000 .. 1.000000] f32__b ∈ [-0.000000 .. 0.000000] f32__c ∈ [-3.000000 .. -1.000000] [eva:final-states] Values at end of function test_floorf_det: f32__a ∈ {1.000000} f32__b ∈ {0} f32__c ∈ {0} f32__d ∈ {-0.000000} f32__e ∈ {-1.000000} f32__f ∈ {-2.000000} [eva:final-states] Values at end of function test_fmod: x ∈ [-3.0000000000000000 .. 2.0000000000000000] y ∈ [-4.0000000000000000 .. 5.0000000000000000] a ∈ [0.0000000000000000 .. 1.4999999999999998] b ∈ [0.0000000000000000 .. 1.4999999999999998] c ∈ [-1.4999999999999998 .. -0.0000000000000000] d ∈ [-1.4999999999999998 .. -0.0000000000000000] e ∈ [1.5000000000000000*2^-1 .. 1.2500000000000000] f ∈ [1.5000000000000000*2^-1 .. 1.2500000000000000] g ∈ [4.0000000000000000 .. 5.5000000000000000] h ∈ [0.0000000000000000 .. 5.4999999999999991] i ∈ [0.0000000000000000 .. 5.4999999999999991] j ∈ [-4.4999999999999991 .. 4.4999999999999991] k ∈ [-2.0000000000000000 .. 4.5000000000000000] l ∈ [-1.9999999999999998*2^-4 .. 1.9999999999999998*2^-4] m ∈ [-1.9999999999999998*2^-4 .. 1.9999999999999998*2^-4] n ∈ [0.0000000000000000 .. 1.9999999999999998*2^-10] o ∈ [-1.9999999999999998*2^-10 .. -0.0000000000000000] p ∈ [0.0000000000000000 .. 1.9999999999999998*2^-10] q ∈ [1.5000000000000000*2^-14 .. 1.0000000000000000*2^-11] r ∈ [0.0000000000000000 .. 1.0000025599999997*2^-9] s ∈ [0.0000000000000000 .. 1.5999999999999998*2^-4] t ∈ [-1.5999999999999998*2^-4 .. -0.0000000000000000] u ∈ [-3.9999999999999996 .. -0.0000000000000000] v1 ∈ [1.0000000000000000 .. 3.0000000000000000] v2 ∈ [1.0000000000000000 .. 3.0000000000000000] v3 ∈ [-3.0000000000000000 .. -1.0000000000000000] v4 ∈ [-3.0000000000000000 .. -1.0000000000000000] w1 ∈ [0.0000000000000000 .. 3.0000000000000000] w2 ∈ [-2.0000000000000000 .. 3.0000000000000000] w3 ∈ [-3.0000000000000000 .. 2.0000000000000000] [eva:final-states] Values at end of function test_fmod_det: a ∈ {1.7500000000000000} b ∈ {-1.7500000000000000} c ∈ {-0.0000000000000000} d ∈ {0} e ∈ {0} f ∈ {0} [eva:final-states] Values at end of function test_log10_det: a ∈ {1.6245399138793950} b ∈ {-1.8061799739838871*2^-1} [eva:final-states] Values at end of function test_log10f_det: f32__a ∈ {1.624539} f32__b ∈ {-1.806180*2^-1} [eva:final-states] Values at end of function test_log_det: a ∈ {3.7406413886725258} b ∈ {-2.0794415416798357} [eva:final-states] Values at end of function test_logf_det: f32__a ∈ {3.740641} f32__b ∈ {-2.079441} [eva:final-states] Values at end of function test_pow: x ∈ [-1.4551915228366852*2^36 .. -1.1641532182693481*2^33] y ∈ [-1.0000000000000000*2^-1 .. 9.5000000000000000] a ∈ {1.0000000000000000} b ∈ {1.0000000000000000} c ∈ {1.0000000000000000} d ∈ [0.0000000000000000 .. 327.9450894181683225] e ∈ [-64.0000000000000000 .. 1.1259101122907695*2^14] f ∈ [-64.0000000000000000 .. 421.8750000000000000] g ∈ [1.7652004904783322*2^-3 .. 4.7568284600108841] h ∈ [1.4142135623730951*2^-3 .. 1.7469281074217106] i ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] j ∈ [-1.0000000000000000 .. 1.9999999999999998*2^1023] k ∈ [-1.4163703918457031*2^18 .. 1.4036245608028963*2^52] l ∈ [-1024.0000000000000000 .. 256.0000000000000000] m ∈ [-0.0000000000000000 .. 1.5258789062500000*2^16] n ∈ [1.0362151436839746*2^-15 .. 1.9999999999999998*2^1023] o ∈ {1.0000000000000000} p ∈ [-1.4551915228366852*2^25 .. 1.1641532182693481*2^23] q ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] r ∈ [1.2649110640673517*2^-2 .. 1.4725502860585131*2^31] [eva:final-states] Values at end of function test_pow_det: a ∈ {1.0000000000000000} b ∈ {0} c ∈ {1.0000000000000000} d ∈ {1.2247448713915889} e ∈ {3.6539061185009513} f ∈ {1.1857484052378015*2^-2} g ∈ {1.6817928305074290*2^-21} h ∈ {1.0000000000000000} [eva:final-states] Values at end of function test_pow_singleton_exp: x ∈ [-3.5000000000000000 .. -1.0000000000000000*2^-3] c ∈ [0.0000000000000000 .. 4.5603590867386749] d ∈ [1.7542478229978975*2^-3 .. 1.9999999999999998*2^1023] e ∈ [-1.9999999999999998*2^1023 .. 1.9999999999999998*2^1023] f ∈ [1.3061224489795917*2^-4 .. 1.9999999999999998*2^1023] g ∈ [1.0000000000000000*2^975 .. 1.9999999999999998*2^1023] h ∈ [-1.9999999999999998*2^1023 .. -1.3699635576194850*2^-10] i ∈ [0.0000000000000000 .. 1.0000000000000000*2^-1000] j ∈ [0.2500000000000000*2^-1022 .. 1.2707064924076672*2^-330] k ∈ [1.7469281074217106 .. 5.6568542494923805] l ∈ [2.1836601342771384 .. 11.3137084989847611] m ∈ [1.3196114778086369*2^-5 .. 22.6274169979695223] n ∈ [1.9097831327702532*2^-4 .. 8.0000000000000000] o ∈ [1.4142135623730951*2^-1 .. 1.4251349413858991] p ∈ [1.6817928305074290*2^-4 .. 10.0014719999210708] q ∈ [1.0000000000000000*2^-8 .. 289.5314941406250000] r ∈ [1.3061224489795917*2^-4 .. 64.0000000000000000] s ∈ [-8.0000000000000000 .. -1.1428571428571428*2^-2] [eva:final-states] Values at end of function test_powf: f32__x ∈ [-0.000000 .. 10.000000] f32__y ∈ [-0.000000 .. 5.000000] f32__a ∈ {1.000000} f32__b ∈ {1.000000} f32__c ∈ {1.000000} f32__d ∈ [0.000000 .. 327.945098] f32__e ∈ [-64.000000 .. 1.125910*2^14] f32__f ∈ [-64.000000 .. 421.875000] f32__g ∈ [1.765200*2^-3 .. 4.756828] f32__h ∈ [1.414213*2^-3 .. 1.746928] f32__i ∈ [-1.999999*2^127 .. 1.999999*2^127] f32__j ∈ [-1.000000 .. 1.999999*2^127] f32__k ∈ [-1.416370*2^18 .. 1.403624*2^52] f32__l ∈ [-1024.000000 .. 256.000000] f32__m ∈ [-0.000000 .. 1.525878*2^16] [eva:final-states] Values at end of function test_powf_det: f32__a ∈ {1.000000} f32__b ∈ {0} f32__c ∈ {1.000000} f32__d ∈ {1.224744} f32__e ∈ {3.653906} f32__f ∈ {1.185748*2^-2} f32__g ∈ {1.681792*2^-21} f32__h ∈ {1.000000} [eva:final-states] Values at end of function test_powf_singleton_exp: f32__x ∈ [-3.500000 .. -1.000000*2^-3] f32__c ∈ [0.000000 .. 4.560359] f32__d ∈ [1.754247*2^-3 .. 1.999999*2^127] f32__e ∈ [-1.999999*2^127 .. 1.999999*2^127] f32__f ∈ [1.306122*2^-4 .. 1.999999*2^127] f32__g ∈ [1.000002*2^116 .. 1.741105*2^121] f32__h ∈ [-1.999999*2^127 .. -1.369963*2^-10] f32__i ∈ [0.000000 .. 1.000000*2^-120] f32__j ∈ {0} f32__k ∈ [1.746928 .. 5.656854] f32__l ∈ [2.183660 .. 11.313708] f32__m ∈ [1.319611*2^-5 .. 22.627416] f32__n ∈ [1.909783*2^-4 .. 8.000000] f32__o ∈ [1.414213*2^-1 .. 1.425134] f32__p ∈ [1.681792*2^-4 .. 10.001472] f32__q ∈ [1.000000*2^-8 .. 289.531494] f32__r ∈ [1.306122*2^-4 .. 64.000000] f32__s ∈ [-8.000000 .. -1.142857*2^-2] [eva:final-states] Values at end of function test_round: x ∈ [-2.5000000000000000 .. -1.0000000000000000*2^-1] a ∈ [-1.0000000000000000 .. 2.0000000000000000] b ∈ [-0.0000000000000000 .. 1.0000000000000000] c ∈ [-3.0000000000000000 .. -1.0000000000000000] [eva:final-states] Values at end of function test_round_det: a ∈ {2.0000000000000000} b ∈ {1.0000000000000000} c ∈ {0} d ∈ {-0.0000000000000000} e ∈ {-1.0000000000000000} f ∈ {-2.0000000000000000} [eva:final-states] Values at end of function test_roundf: f32__x ∈ [-2.500000 .. -1.000000*2^-1] f32__a ∈ [-1.000000 .. 2.000000] f32__b ∈ [-0.000000 .. 1.000000] f32__c ∈ [-3.000000 .. -1.000000] [eva:final-states] Values at end of function test_roundf_det: f32__a ∈ {2.000000} f32__b ∈ {1.000000} f32__c ∈ {0} f32__d ∈ {-0.000000} f32__e ∈ {-1.000000} f32__f ∈ {-2.000000} [eva:final-states] Values at end of function test_sin_det: x ∈ {1.6829419696157930*2^-1} y ∈ {0} z ∈ {-1.6829419696157930*2^-1} [eva:final-states] Values at end of function test_sqrt: x ∈ [-6.5000000000000000 .. -1.6000000000000000*2^-4] a ∈ [-0.0000000000000000 .. 2.2360679774997898] b ∈ [-0.0000000000000000 .. 0.0000000000000000] c ∈ {-0.0000000000000000} [eva:final-states] Values at end of function test_sqrt_det: a ∈ {6.4903774928735851} b ∈ {1.4142135623730951*2^-2} c ∈ {0} d ∈ {-0.0000000000000000} [eva:final-states] Values at end of function test_sqrtf: f32__x ∈ [-6.500000 .. -1.600000*2^-4] f32__a ∈ [-0.000000 .. 2.236068] b ∈ [-0.0000000000000000 .. 0.0000000000000000] c ∈ {-0.0000000000000000} [eva:final-states] Values at end of function test_sqrtf_det: f32__a ∈ {6.490377} f32__b ∈ {1.414213*2^-2} f32__c ∈ {0} f32__d ∈ {-0.000000} [eva:final-states] Values at end of function test_trunc: x ∈ [-2.5000000000000000 .. -1.0000000000000000*2^-1] a ∈ [-0.0000000000000000 .. 1.0000000000000000] b ∈ [-0.0000000000000000 .. 0.0000000000000000] c ∈ [-2.0000000000000000 .. -0.0000000000000000] [eva:final-states] Values at end of function test_trunc_det: a ∈ {1.0000000000000000} b ∈ {0} c ∈ {0} d ∈ {-0.0000000000000000} e ∈ {-0.0000000000000000} f ∈ {-1.0000000000000000} [eva:final-states] Values at end of function test_truncf: f32__x ∈ [-2.500000 .. -1.000000*2^-1] f32__a ∈ [-0.000000 .. 1.000000] f32__b ∈ [-0.000000 .. 0.000000] f32__c ∈ [-2.000000 .. -0.000000] [eva:final-states] Values at end of function test_truncf_det: f32__a ∈ {1.000000} f32__b ∈ {0} f32__c ∈ {0} f32__d ∈ {-0.000000} f32__e ∈ {-0.000000} f32__f ∈ {-1.000000} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function double_interval [from] Done for function double_interval [from] Computing for function test_atan2 [from] Computing for function atan2 <-test_atan2 [from] Done for function atan2 [from] Done for function test_atan2 [from] Computing for function test_atan2_det [from] Done for function test_atan2_det [from] Computing for function test_ceil [from] Computing for function ceil <-test_ceil [from] Done for function ceil [from] Done for function test_ceil [from] Computing for function test_ceil_det [from] Done for function test_ceil_det [from] Computing for function test_ceilf [from] Computing for function ceilf <-test_ceilf [from] Done for function ceilf [from] Done for function test_ceilf [from] Computing for function test_ceilf_det [from] Done for function test_ceilf_det [from] Computing for function test_cos_det [from] Computing for function cos <-test_cos_det [from] Done for function cos [from] Done for function test_cos_det [from] Computing for function test_diff_pow_powf [from] Computing for function pow <-test_diff_pow_powf [from] Done for function pow [from] Computing for function powf <-test_diff_pow_powf [from] Done for function powf [from] Done for function test_diff_pow_powf [from] Computing for function test_exp_det [from] Computing for function exp <-test_exp_det [from] Done for function exp [from] Done for function test_exp_det [from] Computing for function test_expf_det [from] Computing for function expf <-test_expf_det [from] Done for function expf [from] Done for function test_expf_det [from] Computing for function test_floor [from] Computing for function floor <-test_floor [from] Done for function floor [from] Done for function test_floor [from] Computing for function test_floor_det [from] Done for function test_floor_det [from] Computing for function test_floorf [from] Computing for function floorf <-test_floorf [from] Done for function floorf [from] Done for function test_floorf [from] Computing for function test_floorf_det [from] Done for function test_floorf_det [from] Computing for function test_fmod [from] Computing for function fmod <-test_fmod [from] Done for function fmod [from] Done for function test_fmod [from] Computing for function test_fmod_det [from] Done for function test_fmod_det [from] Computing for function test_log10_det [from] Computing for function log10 <-test_log10_det [from] Done for function log10 [from] Done for function test_log10_det [from] Computing for function test_log10f_det [from] Computing for function log10f <-test_log10f_det [from] Done for function log10f [from] Done for function test_log10f_det [from] Computing for function test_log_det [from] Computing for function log <-test_log_det [from] Done for function log [from] Done for function test_log_det [from] Computing for function test_logf_det [from] Computing for function logf <-test_logf_det [from] Done for function logf [from] Done for function test_logf_det [from] Computing for function test_pow [from] Done for function test_pow [from] Computing for function test_pow_det [from] Done for function test_pow_det [from] Computing for function test_pow_singleton_exp [from] Done for function test_pow_singleton_exp [from] Computing for function test_powf [from] Done for function test_powf [from] Computing for function test_powf_det [from] Done for function test_powf_det [from] Computing for function test_powf_singleton_exp [from] Done for function test_powf_singleton_exp [from] Computing for function test_round [from] Computing for function round <-test_round [from] Done for function round [from] Done for function test_round [from] Computing for function test_round_det [from] Done for function test_round_det [from] Computing for function test_roundf [from] Computing for function roundf <-test_roundf [from] Done for function roundf [from] Done for function test_roundf [from] Computing for function test_roundf_det [from] Done for function test_roundf_det [from] Computing for function test_sin_det [from] Computing for function sin <-test_sin_det [from] Done for function sin [from] Done for function test_sin_det [from] Computing for function test_sqrt [from] Computing for function sqrt <-test_sqrt [from] Done for function sqrt [from] Done for function test_sqrt [from] Computing for function test_sqrt_det [from] Done for function test_sqrt_det [from] Computing for function test_sqrtf [from] Computing for function sqrtf <-test_sqrtf [from] Done for function sqrtf [from] Done for function test_sqrtf [from] Computing for function test_sqrtf_det [from] Done for function test_sqrtf_det [from] Computing for function test_trunc [from] Computing for function trunc <-test_trunc [from] Done for function trunc [from] Done for function test_trunc [from] Computing for function test_trunc_det [from] Done for function test_trunc_det [from] Computing for function test_truncf [from] Computing for function truncf <-test_truncf [from] Done for function truncf [from] Done for function test_truncf [from] Computing for function test_truncf_det [from] Done for function test_truncf_det [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function atan2: \result FROM y; x [from] Function ceil: \result FROM x [from] Function ceilf: \result FROM x [from] Function cos: \result FROM x [from] Function double_interval: \result FROM min; max; nondet [from] Function exp: \result FROM x [from] Function expf: \result FROM x [from] Function floor: \result FROM x [from] Function floorf: \result FROM x [from] Function fmod: \result FROM x; y [from] Function log: \result FROM x [from] Function log10: \result FROM x [from] Function log10f: \result FROM x [from] Function logf: \result FROM x [from] Function pow: \result FROM x; y [from] Function powf: \result FROM x; y [from] Function round: \result FROM x [from] Function roundf: \result FROM x [from] Function sin: \result FROM x [from] Function sqrt: \result FROM x [from] Function sqrtf: \result FROM x [from] Function test_atan2: NO EFFECTS [from] Function test_atan2_det: NO EFFECTS [from] Function test_ceil: NO EFFECTS [from] Function test_ceil_det: NO EFFECTS [from] Function test_ceilf: NO EFFECTS [from] Function test_ceilf_det: NO EFFECTS [from] Function test_cos_det: NO EFFECTS [from] Function test_diff_pow_powf: NO EFFECTS [from] Function test_exp_det: NO EFFECTS [from] Function test_expf_det: NO EFFECTS [from] Function test_floor: NO EFFECTS [from] Function test_floor_det: NO EFFECTS [from] Function test_floorf: NO EFFECTS [from] Function test_floorf_det: NO EFFECTS [from] Function test_fmod: NO EFFECTS [from] Function test_fmod_det: NO EFFECTS [from] Function test_log10_det: NO EFFECTS [from] Function test_log10f_det: NO EFFECTS [from] Function test_log_det: NO EFFECTS [from] Function test_logf_det: NO EFFECTS [from] Function test_pow: NO EFFECTS [from] Function test_pow_det: NO EFFECTS [from] Function test_pow_singleton_exp: NO EFFECTS [from] Function test_powf: NO EFFECTS [from] Function test_powf_det: NO EFFECTS [from] Function test_powf_singleton_exp: NO EFFECTS [from] Function test_round: NO EFFECTS [from] Function test_round_det: NO EFFECTS [from] Function test_roundf: NO EFFECTS [from] Function test_roundf_det: NO EFFECTS [from] Function test_sin_det: NO EFFECTS [from] Function test_sqrt: NO EFFECTS [from] Function test_sqrt_det: NO EFFECTS [from] Function test_sqrtf: NO EFFECTS [from] Function test_sqrtf_det: NO EFFECTS [from] Function trunc: \result FROM x [from] Function test_trunc: NO EFFECTS [from] Function test_trunc_det: NO EFFECTS [from] Function truncf: \result FROM x [from] Function test_truncf: NO EFFECTS [from] Function test_truncf_det: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function double_interval: __retres [inout] Inputs for function double_interval: nondet [inout] Out (internal) for function test_atan2: x; y; a; b; c; d; e; f; g; h; i; j; k; l; m; n [inout] Inputs for function test_atan2: nondet [inout] Out (internal) for function test_atan2_det: a; b; c; d; e; f; g; h; i; j; k; l; m [inout] Inputs for function test_atan2_det: \nothing [inout] Out (internal) for function test_ceil: x; a; b; c [inout] Inputs for function test_ceil: nondet [inout] Out (internal) for function test_ceil_det: a; b; c; d; e; f [inout] Inputs for function test_ceil_det: \nothing [inout] Out (internal) for function test_ceilf: f32__x; tmp; f32__a; tmp_1; f32__b; tmp_3; f32__c [inout] Inputs for function test_ceilf: nondet [inout] Out (internal) for function test_ceilf_det: f32__a; f32__b; f32__c; f32__d; f32__e; f32__f [inout] Inputs for function test_ceilf_det: \nothing [inout] Out (internal) for function test_cos_det: x; y; z [inout] Inputs for function test_cos_det: \nothing [inout] Out (internal) for function test_diff_pow_powf: d; f32__f [inout] Inputs for function test_diff_pow_powf: \nothing [inout] Out (internal) for function test_exp_det: a; b; c; d; e [inout] Inputs for function test_exp_det: nondet [inout] Out (internal) for function test_expf_det: f32__a; f32__b; f32__c; f32__d; f32__e [inout] Inputs for function test_expf_det: \nothing [inout] Out (internal) for function test_floor: x; a; b; c [inout] Inputs for function test_floor: nondet [inout] Out (internal) for function test_floor_det: a; b; c; d; e; f [inout] Inputs for function test_floor_det: \nothing [inout] Out (internal) for function test_floorf: f32__x; tmp; f32__a; tmp_1; f32__b; tmp_3; f32__c [inout] Inputs for function test_floorf: nondet [inout] Out (internal) for function test_floorf_det: f32__a; f32__b; f32__c; f32__d; f32__e; f32__f [inout] Inputs for function test_floorf_det: \nothing [inout] Out (internal) for function test_fmod: x; y; a; b; c; d; e; f; g; h; i; j; k; l; m; n; o; p; q; r; s; tmp_18; t; u; v1; v2; v3; v4; w1; w2; w3 [inout] Inputs for function test_fmod: nondet [inout] Out (internal) for function test_fmod_det: a; b; c; d; e; f [inout] Inputs for function test_fmod_det: nondet [inout] Out (internal) for function test_log10_det: a; b [inout] Inputs for function test_log10_det: nondet [inout] Out (internal) for function test_log10f_det: f32__a; f32__b [inout] Inputs for function test_log10f_det: nondet [inout] Out (internal) for function test_log_det: a; b [inout] Inputs for function test_log_det: nondet [inout] Out (internal) for function test_logf_det: f32__a; f32__b [inout] Inputs for function test_logf_det: nondet [inout] Out (internal) for function test_pow: x; y; a; b; c; d; e; f; g; h; i; j; k; l; m; n; o; p; q; r [inout] Inputs for function test_pow: nondet [inout] Out (internal) for function test_pow_det: a; b; c; d; e; f; g; h [inout] Inputs for function test_pow_det: \nothing [inout] Out (internal) for function test_pow_singleton_exp: x; c; d; e; f; g; h; i; j; k; l; m; n; o; p; q; r; s [inout] Inputs for function test_pow_singleton_exp: nondet [inout] Out (internal) for function test_powf: f32__x; f32__y; tmp; f32__a; tmp_1; f32__b; tmp_3; f32__c; tmp_5; tmp_6; f32__d; tmp_8; f32__e; tmp_10; f32__f; tmp_12; tmp_13; f32__g; tmp_15; tmp_16; f32__h; tmp_18; tmp_19; f32__i; tmp_21; tmp_22; f32__j; tmp_24; tmp_25; f32__k; tmp_27; tmp_28; f32__l; tmp_30; tmp_31; f32__m [inout] Inputs for function test_powf: nondet [inout] Out (internal) for function test_powf_det: f32__a; f32__b; f32__c; f32__d; f32__e; f32__f; f32__g; f32__h [inout] Inputs for function test_powf_det: \nothing [inout] Out (internal) for function test_powf_singleton_exp: f32__x; tmp; tmp_0; f32__c; f32__d; f32__e; f32__f; tmp_5; f32__g; tmp_7; f32__h; tmp_9; f32__i; tmp_11; f32__j; f32__k; f32__l; tmp_15; f32__m; f32__n; f32__o; f32__p; f32__q; tmp_21; f32__r; f32__s [inout] Inputs for function test_powf_singleton_exp: nondet [inout] Out (internal) for function test_round: x; a; b; c [inout] Inputs for function test_round: nondet [inout] Out (internal) for function test_round_det: a; b; c; d; e; f [inout] Inputs for function test_round_det: \nothing [inout] Out (internal) for function test_roundf: f32__x; tmp; f32__a; tmp_1; f32__b; tmp_3; f32__c [inout] Inputs for function test_roundf: nondet [inout] Out (internal) for function test_roundf_det: f32__a; f32__b; f32__c; f32__d; f32__e; f32__f [inout] Inputs for function test_roundf_det: \nothing [inout] Out (internal) for function test_sin_det: x; y; z [inout] Inputs for function test_sin_det: \nothing [inout] Out (internal) for function test_sqrt: x; a; b; c [inout] Inputs for function test_sqrt: nondet [inout] Out (internal) for function test_sqrt_det: a; b; c; d [inout] Inputs for function test_sqrt_det: nondet [inout] Out (internal) for function test_sqrtf: f32__x; tmp; f32__a; tmp_1; b; tmp_3; c; tmp_5 [inout] Inputs for function test_sqrtf: nondet [inout] Out (internal) for function test_sqrtf_det: f32__a; f32__b; f32__c; f32__d [inout] Inputs for function test_sqrtf_det: nondet [inout] Out (internal) for function test_trunc: x; a; b; c [inout] Inputs for function test_trunc: nondet [inout] Out (internal) for function test_trunc_det: a; b; c; d; e; f [inout] Inputs for function test_trunc_det: \nothing [inout] Out (internal) for function test_truncf: f32__x; tmp; f32__a; tmp_1; f32__b; tmp_3; f32__c [inout] Inputs for function test_truncf: nondet [inout] Out (internal) for function test_truncf_det: f32__a; f32__b; f32__c; f32__d; f32__e; f32__f [inout] Inputs for function test_truncf_det: \nothing [inout] Out (internal) for function main: __retres [inout] Inputs for function main: nondet /* Generated by Frama-C */ #include "errno.h" #include "math.h" static int volatile nondet; double double_interval(double min, double max) { double __retres; if (nondet) { __retres = min; goto return_label; } else { __retres = max; goto return_label; } return_label: return __retres; } void test_cos_det(void) { double x = cos(1.); double y = cos(0.); double z = cos(- 1.); return; } void test_sin_det(void) { double x = sin(1.); double y = sin(0.); double z = sin(- 1.); return; } void test_atan2_det(void) { double a = atan2(1.,0.); double b = atan2(0.,1.); double c = atan2(1.,- 0.); double d = atan2(- 0.,1.); double e = atan2(- 1.,0.); double f = atan2(- 1.,0.); double g = atan2(- 1.,- 0.); double h = atan2(- 1.,- 0.); double i = atan2(0.,0.); double j = atan2(2.,1.); double k = atan2(- 2.,1.); double l = atan2(2.,- 1.); double m = atan2(- 2.,- 1.); return; } void test_atan2(void) { double x; double y; y = double_interval(0.125,10.); x = double_interval(0.125,10.); double a = atan2(y,x); x = double_interval(- 2.5,3.); double b = atan2(y,x); y = double_interval(- 1.25,- 0.5); double c = atan2(y,x); x = double_interval(- 3.,- 2.5); double d = atan2(y,x); x = double_interval(- 0.,0.); double e = atan2(y,x); x = double_interval(1.,5.); y = double_interval(- 1.,- 0.); double f = atan2(y,x); y = double_interval(0.,0.5); double g = atan2(y,x); y = double_interval(- 0.,0.5); double h = atan2(y,x); y = double_interval(- 0.5,0.); double i = atan2(y,x); y = double_interval(- 0.,0.); double j = atan2(y,x); double k = atan2(0.,x); double l = atan2(- 0.,x); double m = atan2(0.,- x); double n = atan2(- 0.,- x); return; } void test_pow_det(void) { double a = pow(1.,8.); double b = pow(0.,1.); double c = pow(12.,0.); double d = pow(2.25,0.25); double e = pow(178.25,0.25); double f = pow(129.5,- 0.25); double g = pow(512.,- 2.25); double h = pow(0.,0.); return; } void test_powf_det(void) { float f32__a = powf((float)1.,(float)8.); float f32__b = powf((float)0.,(float)1.); float f32__c = powf((float)12.,(float)0.); float f32__d = powf((float)2.25,(float)0.25); float f32__e = powf((float)178.25,(float)0.25); float f32__f = powf((float)129.5,(float)(- 0.25)); float f32__g = powf((float)512.,(float)(- 2.25)); float f32__h = powf((float)0.,(float)0.); return; } /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_unreachable)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_i)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_j)(); void test_pow_singleton_exp(void) { double x; x = double_interval(- 3.5,- 2.75); if (nondet) { pow(x,1.5); Frama_C_show_each_unreachable(); } if (nondet) { pow(x,- 1.5); Frama_C_show_each_unreachable(); } x = double_interval(- 3.5,2.75); double c = pow(x,1.5); double d = pow(x,- 1.5); double e = pow(x,- 3.); double f = pow(x,- 2.); x = double_interval((double)(1LL << 50),(double)(1LL << 62)); double g = pow(x,19.5); x = double_interval((double)(- (1LL << 49)),- .75); double h = pow(x,23.0); x = double_interval(0.125,0.25); double i = pow(x,500.); Frama_C_show_each_i(i); x = double_interval(1.25,2.0); double j = pow(x,- 1024.); Frama_C_show_each_j(j); double k = pow(x,2.5); double l = pow(x,3.5); x = double_interval(0.25,4.125); double m = pow(x,- 2.25); double n = pow(x,- 1.5); double o = pow(x,0.25); double p = pow(x,1.625); double q = pow(x,4.); x = double_interval(- 3.5,- 0.125); double r = pow(x,- 2.); double s = pow(x,- 1.); return; } void test_pow(void) { double x; double y; y = double_interval(- 18.5,12.125); double a = pow(1.0,y); x = double_interval(- 15.25,32.75); double b = pow(x,0.0); y = double_interval(- 0.0,0.0); double c = pow(x,y); x = double_interval(- 4.0,7.5); y = double_interval(2.125,2.875); double d = pow(x,y); y = double_interval(2.125,4.875); double e = pow(x,y); y = double_interval(2.0,3.0); double f = pow(x,y); y = double_interval(- 0.75,- 0.); x = double_interval(0.125,7.5); double g = pow(x,y); y = double_interval(0.25,2.5); x = double_interval(0.5,1.25); double h = pow(x,y); x = double_interval(- 1.0,1.0); y = double_interval(- 1.0,1.0); double i = pow(x,y); x = double_interval(- 1.0,1.0); y = double_interval(- 0.5,1.0); double j = pow(x,y); x = double_interval(- 13.,430.); y = double_interval(3.,6.); double k = pow(x,y); x = double_interval(- 4.,- 2.); y = double_interval(3.,5.); double l = pow(x,y); x = double_interval(- 0.,10.); y = double_interval(- 0.,5.); double m = pow(x,y); x = double_interval(- 0.0,10.0); y = double_interval(- 4.5,- 3.5); double n = pow(x,y); x = double_interval(- 5.,- 0.5); y = double_interval(- 0.875,- 0.125); if (nondet) { pow(x,y); Frama_C_show_each_unreachable(); } y = double_interval(- 0.25,0.25); double o = pow(x,y); y = double_interval(10.,11.5); double p = pow(x,y); y = double_interval(- 9876.5,1234.5); double q = pow(x,y); x = double_interval(1e10,1e11); y = double_interval(1e14,1e15); if (nondet) { pow(x,y); Frama_C_show_each_unreachable(); } x = double_interval(- 1e11,- 1e10); y = double_interval(1e14,1e15); if (nondet) { pow(x,y); Frama_C_show_each_unreachable(); } y = double_interval(- 0.5,9.5); double r = pow(10.0,y); return; } void test_powf_singleton_exp(void) { float f32__x; double tmp; double tmp_0; double tmp_5; double tmp_7; double tmp_9; double tmp_11; double tmp_15; double tmp_21; tmp = double_interval(- 3.5,- 2.75); f32__x = (float)tmp; if (nondet) { powf(f32__x,(float)1.5); Frama_C_show_each_unreachable(); } if (nondet) { powf(f32__x,(float)(- 1.5)); Frama_C_show_each_unreachable(); } tmp_0 = double_interval(- 3.5,2.75); f32__x = (float)tmp_0; float f32__c = powf(f32__x,(float)1.5); float f32__d = powf(f32__x,(float)(- 1.5)); float f32__e = powf(f32__x,(float)(- 3.)); float f32__f = powf(f32__x,(float)(- 2.)); tmp_5 = double_interval((double)(1LL << 20),(double)(1LL << 21)); f32__x = (float)tmp_5; float f32__g = powf(f32__x,(float)5.8); tmp_7 = double_interval((double)(- (1LL << 49)),- .75); f32__x = (float)tmp_7; float f32__h = powf(f32__x,(float)23.0); tmp_9 = double_interval(0.125,0.25); f32__x = (float)tmp_9; float f32__i = powf(f32__x,(float)60.); Frama_C_show_each_i(f32__i); tmp_11 = double_interval(1.25,2.0); f32__x = (float)tmp_11; float f32__j = powf(f32__x,(float)(- 1024.)); Frama_C_show_each_j(f32__j); float f32__k = powf(f32__x,(float)2.5); float f32__l = powf(f32__x,(float)3.5); tmp_15 = double_interval(0.25,4.125); f32__x = (float)tmp_15; float f32__m = powf(f32__x,(float)(- 2.25)); float f32__n = powf(f32__x,(float)(- 1.5)); float f32__o = powf(f32__x,(float)0.25); float f32__p = powf(f32__x,(float)1.625); float f32__q = powf(f32__x,(float)4.); tmp_21 = double_interval(- 3.5,- 0.125); f32__x = (float)tmp_21; float f32__r = powf(f32__x,(float)(- 2.)); float f32__s = powf(f32__x,(float)(- 1.)); return; } void test_powf(void) { float f32__x; float f32__y; double tmp; double tmp_1; double tmp_3; double tmp_5; double tmp_6; double tmp_8; double tmp_10; double tmp_12; double tmp_13; double tmp_15; double tmp_16; double tmp_18; double tmp_19; double tmp_21; double tmp_22; double tmp_24; double tmp_25; double tmp_27; double tmp_28; double tmp_30; double tmp_31; tmp = double_interval(- 18.5,12.125); f32__y = (float)tmp; float f32__a = powf((float)1.0,f32__y); tmp_1 = double_interval(- 15.25,32.75); f32__x = (float)tmp_1; float f32__b = powf(f32__x,(float)0.0); tmp_3 = double_interval(- 0.0,0.0); f32__y = (float)tmp_3; float f32__c = powf(f32__x,f32__y); tmp_5 = double_interval(- 4.0,7.5); f32__x = (float)tmp_5; tmp_6 = double_interval(2.125,2.875); f32__y = (float)tmp_6; float f32__d = powf(f32__x,f32__y); tmp_8 = double_interval(2.125,4.875); f32__y = (float)tmp_8; float f32__e = powf(f32__x,f32__y); tmp_10 = double_interval(2.0,3.0); f32__y = (float)tmp_10; float f32__f = powf(f32__x,f32__y); tmp_12 = double_interval(- 0.75,- 0.); f32__y = (float)tmp_12; tmp_13 = double_interval(0.125,7.5); f32__x = (float)tmp_13; float f32__g = powf(f32__x,f32__y); tmp_15 = double_interval(0.25,2.5); f32__y = (float)tmp_15; tmp_16 = double_interval(0.5,1.25); f32__x = (float)tmp_16; float f32__h = powf(f32__x,f32__y); tmp_18 = double_interval(- 1.0,1.0); f32__x = (float)tmp_18; tmp_19 = double_interval(- 1.0,1.0); f32__y = (float)tmp_19; float f32__i = powf(f32__x,f32__y); tmp_21 = double_interval(- 1.0,1.0); f32__x = (float)tmp_21; tmp_22 = double_interval(- 0.5,1.0); f32__y = (float)tmp_22; float f32__j = powf(f32__x,f32__y); tmp_24 = double_interval(- 13.,430.); f32__x = (float)tmp_24; tmp_25 = double_interval(3.,6.); f32__y = (float)tmp_25; float f32__k = powf(f32__x,f32__y); tmp_27 = double_interval(- 4.,- 2.); f32__x = (float)tmp_27; tmp_28 = double_interval(3.,5.); f32__y = (float)tmp_28; float f32__l = powf(f32__x,f32__y); tmp_30 = double_interval(- 0.,10.); f32__x = (float)tmp_30; tmp_31 = double_interval(- 0.,5.); f32__y = (float)tmp_31; float f32__m = powf(f32__x,f32__y); return; } void test_fmod_det(void) { double a = fmod(4.0,2.25); double b = fmod(- 4.0,2.25); double c = fmod(- 0.0,2.25); double d = fmod(0.0,2.25); double e = fmod(0.0,0.0009765625); double f = fmod(1.25,0.0009765625); if (nondet) { fmod(0.125,0.0); Frama_C_show_each_unreachable(); } return; } void test_fmod(void) { double x; double y; double tmp_18; x = double_interval(2.,9.5); double a = fmod(x,1.5); double b = fmod(x,- 1.5); double c = fmod(- x,1.5); double d = fmod(- x,- 1.5); x = double_interval(.75,1.25); double e = fmod(x,1.5); double f = fmod(x,- 1.5); x = double_interval(4.,5.5); y = double_interval(6.5,8.); double g = fmod(x,y); x = double_interval(6.5,8.); y = double_interval(4.,5.5); double h = fmod(x,y); double i = fmod(x,- y); x = double_interval(- 9.,8.75); y = double_interval(- 2.,4.5); double j = fmod(x,y); x = double_interval(- 2.,4.5); y = double_interval(- 9.,8.75); double k = fmod(x,y); y = double_interval(- 0.0,0.0); if (nondet) { fmod(x,y); Frama_C_show_each_unreachable(); } y = double_interval(0.0,0.125); double l = fmod(x,y); y = double_interval(- 0.125,- 0.0); double m = fmod(x,y); x = double_interval(1e308,1.1e308); double n = fmod(x,0.001953125); x = double_interval(- 1.1e308,- 1e308); double o = fmod(x,0.001953125); x = double_interval(1e308,1.00001e308); double p = fmod(x,0.001953125); x = double_interval(1.600000000000001e11,1.600000000000005e11); double q = fmod(x,0.001953125); x = double_interval(1.759218604000011e13,1759218604000015e13); double r = fmod(x,0.00195313); x = double_interval(0.5,0.505); double s = fmod(x,0.1); tmp_18 = double_interval(0.5,0.505); x = - tmp_18; double t = fmod(x,0.1); x = double_interval((double)(-8),- 6.5); double u = fmod(x,(double)4); x = double_interval((double)6,(double)7); y = double_interval((double)(-5),(double)(-4)); double v1 = fmod(x,y); y = double_interval((double)4,(double)5); double v2 = fmod(x,y); x = double_interval((double)(-7),(double)(-6)); double v3 = fmod(x,y); y = double_interval((double)(-5),(double)(-4)); double v4 = fmod(x,y); x = double_interval((double)2,(double)3); y = double_interval((double)(-4),(double)5); double w1 = fmod(x,y); x = double_interval((double)(-2),(double)3); double w2 = fmod(x,y); x = double_interval((double)(-3),(double)2); double w3 = fmod(x,y); return; } void test_sqrt_det(void) { double a = sqrt(42.125); double b = sqrt(0.125); if (nondet) { sqrt(- 2.); Frama_C_show_each_unreachable(); } double c = sqrt(0.); double d = sqrt(- 0.); return; } void test_sqrt(void) { double x = double_interval(- 0.0,5.0); double a = sqrt(x); x = double_interval(- 6.5,0.0); double b = sqrt(x); x = double_interval(- 6.5,- 0.0); double c = sqrt(x); x = double_interval(- 6.5,- 0.1); if (nondet) { sqrt(x); Frama_C_show_each_unreachable(); } return; } void test_sqrtf_det(void) { float f32__a = sqrtf((float)42.125); float f32__b = sqrtf((float)0.125); if (nondet) { sqrtf((float)(- 2.)); Frama_C_show_each_unreachable(); } float f32__c = sqrtf((float)0.); float f32__d = sqrtf((float)(- 0.)); return; } void test_sqrtf(void) { double tmp; double tmp_1; double tmp_3; double tmp_5; tmp = double_interval(- 0.0,5.0); float f32__x = (float)tmp; float f32__a = sqrtf(f32__x); tmp_1 = double_interval(- 6.5,0.0); f32__x = (float)tmp_1; float b = sqrtf(f32__x); tmp_3 = double_interval(- 6.5,- 0.0); f32__x = (float)tmp_3; float c = sqrtf(f32__x); tmp_5 = double_interval(- 6.5,- 0.1); f32__x = (float)tmp_5; if (nondet) { sqrt((double)f32__x); Frama_C_show_each_unreachable(); } return; } void test_exp_det(void) { double a = exp(42.125); double b = exp(- 2.); double c = exp(0.); double d = exp(- 0.); double e = exp(- 1.); if (nondet) { exp(1e100); Frama_C_show_each_unreachable(); } return; } void test_expf_det(void) { float f32__a = expf((float)42.125); float f32__b = expf((float)(- 2.)); float f32__c = expf((float)0.); float f32__d = expf((float)(- 0.)); float f32__e = expf((float)(- 1.)); return; } void test_log_det(void) { double a = log(42.125); double b = log(0.125); if (nondet) { log(- 2.); Frama_C_show_each_unreachable(); } if (nondet) { log(0.); Frama_C_show_each_unreachable(); } if (nondet) { log(- 0.); Frama_C_show_each_unreachable(); } if (nondet) { log(- 1.); Frama_C_show_each_unreachable(); } return; } void test_logf_det(void) { float f32__a = logf((float)42.125); float f32__b = logf((float)0.125); if (nondet) { logf((float)(- 2.)); Frama_C_show_each_unreachable(); } if (nondet) { logf((float)0.); Frama_C_show_each_unreachable(); } if (nondet) { logf((float)(- 0.)); Frama_C_show_each_unreachable(); } if (nondet) { logf((float)(- 1.)); Frama_C_show_each_unreachable(); } return; } void test_log10_det(void) { double a = log10(42.125); double b = log10(0.125); if (nondet) { log10(- 2.); Frama_C_show_each_unreachable(); } if (nondet) { log10(0.); Frama_C_show_each_unreachable(); } if (nondet) { log10(- 0.); Frama_C_show_each_unreachable(); } if (nondet) { log10(- 1.); Frama_C_show_each_unreachable(); } return; } void test_log10f_det(void) { float f32__a = log10f((float)42.125); float f32__b = log10f((float)0.125); if (nondet) { log10f((float)(- 2.)); Frama_C_show_each_unreachable(); } if (nondet) { log10f((float)0.); Frama_C_show_each_unreachable(); } if (nondet) { log10f((float)(- 0.)); Frama_C_show_each_unreachable(); } if (nondet) { log10f((float)(- 1.)); Frama_C_show_each_unreachable(); } return; } void test_diff_pow_powf(void) { double d = pow(0.11,30.); float f32__f = powf((float)0.11,(float)30.); return; } void test_floor_det(void) { double a = floor(1.5); double b = floor(0.5); double c = floor(0.0); double d = floor(- 0.0); double e = floor(- 0.5); double f = floor(- 1.5); return; } void test_ceil_det(void) { double a = ceil(1.5); double b = ceil(0.5); double c = ceil(0.0); double d = ceil(- 0.0); double e = ceil(- 0.5); double f = ceil(- 1.5); return; } void test_trunc_det(void) { double a = trunc(1.5); double b = trunc(0.5); double c = trunc(0.0); double d = trunc(- 0.0); double e = trunc(- 0.5); double f = trunc(- 1.5); return; } void test_round_det(void) { double a = round(1.5); double b = round(0.5); double c = round(0.0); double d = round(- 0.0); double e = round(- 0.5); double f = round(- 1.5); return; } void test_floor(void) { double x; x = double_interval(- 0.5,1.5); double a = floor(x); x = double_interval(- 0.0,0.5); double b = floor(x); x = double_interval(- 2.5,- 0.5); double c = floor(x); return; } void test_ceil(void) { double x; x = double_interval(- 0.5,1.5); double a = ceil(x); x = double_interval(- 0.0,0.5); double b = ceil(x); x = double_interval(- 2.5,- 0.5); double c = ceil(x); return; } void test_trunc(void) { double x; x = double_interval(- 0.5,1.5); double a = trunc(x); x = double_interval(- 0.0,0.5); double b = trunc(x); x = double_interval(- 2.5,- 0.5); double c = trunc(x); return; } void test_round(void) { double x; x = double_interval(- 0.5,1.5); double a = round(x); x = double_interval(- 0.0,0.5); double b = round(x); x = double_interval(- 2.5,- 0.5); double c = round(x); return; } void test_floorf_det(void) { float f32__a = floorf((float)1.5); float f32__b = floorf((float)0.5); float f32__c = floorf((float)0.0); float f32__d = floorf((float)(- 0.0)); float f32__e = floorf((float)(- 0.5)); float f32__f = floorf((float)(- 1.5)); return; } void test_ceilf_det(void) { float f32__a = ceilf((float)1.5); float f32__b = ceilf((float)0.5); float f32__c = ceilf((float)0.0); float f32__d = ceilf((float)(- 0.0)); float f32__e = ceilf((float)(- 0.5)); float f32__f = ceilf((float)(- 1.5)); return; } void test_truncf_det(void) { float f32__a = truncf((float)1.5); float f32__b = truncf((float)0.5); float f32__c = truncf((float)0.0); float f32__d = truncf((float)(- 0.0)); float f32__e = truncf((float)(- 0.5)); float f32__f = truncf((float)(- 1.5)); return; } void test_roundf_det(void) { float f32__a = roundf((float)1.5); float f32__b = roundf((float)0.5); float f32__c = roundf((float)0.0); float f32__d = roundf((float)(- 0.0)); float f32__e = roundf((float)(- 0.5)); float f32__f = roundf((float)(- 1.5)); return; } void test_floorf(void) { float f32__x; double tmp; double tmp_1; double tmp_3; tmp = double_interval(- 0.5,1.5); f32__x = (float)tmp; float f32__a = floorf(f32__x); tmp_1 = double_interval(- 0.0,0.5); f32__x = (float)tmp_1; float f32__b = floorf(f32__x); tmp_3 = double_interval(- 2.5,- 0.5); f32__x = (float)tmp_3; float f32__c = floorf(f32__x); return; } void test_ceilf(void) { float f32__x; double tmp; double tmp_1; double tmp_3; tmp = double_interval(- 0.5,1.5); f32__x = (float)tmp; float f32__a = ceilf(f32__x); tmp_1 = double_interval(- 0.0,0.5); f32__x = (float)tmp_1; float f32__b = ceilf(f32__x); tmp_3 = double_interval(- 2.5,- 0.5); f32__x = (float)tmp_3; float f32__c = ceilf(f32__x); return; } void test_truncf(void) { float f32__x; double tmp; double tmp_1; double tmp_3; tmp = double_interval(- 0.5,1.5); f32__x = (float)tmp; float f32__a = truncf(f32__x); tmp_1 = double_interval(- 0.0,0.5); f32__x = (float)tmp_1; float f32__b = truncf(f32__x); tmp_3 = double_interval(- 2.5,- 0.5); f32__x = (float)tmp_3; float f32__c = truncf(f32__x); return; } void test_roundf(void) { float f32__x; double tmp; double tmp_1; double tmp_3; tmp = double_interval(- 0.5,1.5); f32__x = (float)tmp; float f32__a = roundf(f32__x); tmp_1 = double_interval(- 0.0,0.5); f32__x = (float)tmp_1; float f32__b = roundf(f32__x); tmp_3 = double_interval(- 2.5,- 0.5); f32__x = (float)tmp_3; float f32__c = roundf(f32__x); return; } int main(void) { int __retres; test_cos_det(); test_sin_det(); test_atan2_det(); test_atan2(); test_pow_det(); test_pow_singleton_exp(); test_pow(); test_fmod_det(); test_fmod(); test_sqrt_det(); test_sqrt(); test_exp_det(); test_log_det(); test_log10_det(); test_powf_det(); test_powf_singleton_exp(); test_powf(); test_sqrtf_det(); test_sqrtf(); test_expf_det(); test_logf_det(); test_log10f_det(); test_diff_pow_powf(); test_floor_det(); test_ceil_det(); test_trunc_det(); test_round_det(); test_floor(); test_ceil(); test_trunc(); test_round(); test_floorf_det(); test_ceilf_det(); test_truncf_det(); test_roundf_det(); test_floorf(); test_ceilf(); test_truncf(); test_roundf(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/float/oracle/nonlin.0.res.oracle0000666000000000000000000002660313571573400020350 0ustar [kernel] Parsing tests/float/nonlin.c (with preprocessing) [kernel:parser:decimal-float] tests/float/nonlin.c:75: Warning: Floating-point constant 0.000000001 is not represented exactly. Will use 0x1.12e0be826d695p-30. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} r1 ∈ {0} r2 ∈ {0} d ∈ {0} i ∈ {0} s ∈ {0} zf ∈ {0} s2 ∈ {0} sq ∈ {0} h ∈ {0} t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} r ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} rbits1 ∈ {0} rbits2 ∈ {0} v ∈ [--..--] [eva] computing for function nonlin_f <- main. Called from tests/float/nonlin.c:105. [eva] computing for function Frama_C_float_interval <- nonlin_f <- main. Called from tests/float/nonlin.c:16. [eva] using specification for function Frama_C_float_interval [eva] tests/float/nonlin.c:16: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:16: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_float_interval <- nonlin_f <- main. Called from tests/float/nonlin.c:17. [eva] tests/float/nonlin.c:17: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:17: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] tests/float/nonlin.c:20: assertion got status valid. [eva] tests/float/nonlin.c:24: assertion got status valid. [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.4000000000000p2 .. 0x1.4800000000000p2], {{ "r2" }}, [0x1.4000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.4800000000000p2 .. 0x1.5000000000000p2], {{ "r2" }}, [0x1.4800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.5000000000000p2 .. 0x1.5800000000000p2], {{ "r2" }}, [0x1.5000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.5800000000000p2 .. 0x1.6000000000000p2], {{ "r2" }}, [0x1.5800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.6000000000000p2 .. 0x1.6800000000000p2], {{ "r2" }}, [0x1.6000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.6800000000000p2 .. 0x1.7000000000000p2], {{ "r2" }}, [0x1.6800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.7000000000000p2 .. 0x1.7800000000000p2], {{ "r2" }}, [0x1.7000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.7800000000000p2 .. 0x1.8000000000000p2], {{ "r2" }}, [0x1.7800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.8000000000000p2 .. 0x1.8800000000000p2], {{ "r2" }}, [0x1.8000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.8800000000000p2 .. 0x1.9000000000000p2], {{ "r2" }}, [0x1.8800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.9000000000000p2 .. 0x1.9800000000000p2], {{ "r2" }}, [0x1.9000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.9800000000000p2 .. 0x1.a000000000000p2], {{ "r2" }}, [0x1.9800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.a000000000000p2 .. 0x1.a800000000000p2], {{ "r2" }}, [0x1.a000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.a800000000000p2 .. 0x1.b000000000000p2], {{ "r2" }}, [0x1.a800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.b000000000000p2 .. 0x1.b800000000000p2], {{ "r2" }}, [0x1.b000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.b800000000000p2 .. 0x1.c000000000000p2], {{ "r2" }}, [0x1.b800000000000p2 .. 0x1.c800000000000p2] [eva] Recording results for nonlin_f [eva] Done for function nonlin_f [eva] computing for function other <- main. Called from tests/float/nonlin.c:106. [eva] computing for function Frama_C_float_interval <- other <- main. Called from tests/float/nonlin.c:59. [eva] tests/float/nonlin.c:59: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:59: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_float_interval <- other <- main. Called from tests/float/nonlin.c:60. [eva] tests/float/nonlin.c:60: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:60: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva:alarm] tests/float/nonlin.c:61: Warning: accessing out of bounds index. assert 0 ≤ (int)((double)((double)(i * i) + 2.0)); [eva:alarm] tests/float/nonlin.c:61: Warning: accessing out of bounds index. assert (int)((double)((double)(i * i) + 2.0)) < 10; [eva] computing for function access_bits <- other <- main. Called from tests/float/nonlin.c:67. [eva] Recording results for access_bits [eva] Done for function access_bits [eva] computing for function Frama_C_interval <- other <- main. Called from tests/float/nonlin.c:69. [eva] using specification for function Frama_C_interval [eva] tests/float/nonlin.c:69: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/float/nonlin.c:70: Warning: division by zero. assert x ≢ 0; [eva] Recording results for other [eva] Done for function other [eva] computing for function split_alarm <- main. Called from tests/float/nonlin.c:107. [eva:alarm] tests/float/nonlin.c:74: Warning: non-finite float value. assert \is_finite(v); [eva:alarm] tests/float/nonlin.c:75: Warning: non-finite double value. assert \is_finite((double)((double)1 / (double)((double)((double)ff * (double)ff) + 0.000000001))); [eva] Recording results for split_alarm [eva] Done for function split_alarm [eva] computing for function norm <- main. Called from tests/float/nonlin.c:108. [eva:alarm] tests/float/nonlin.c:79: Warning: non-finite float value. assert \is_finite(v); [eva:alarm] tests/float/nonlin.c:80: Warning: non-finite float value. assert \is_finite(v); [eva] Recording results for norm [eva] Done for function norm [eva] computing for function garbled <- main. Called from tests/float/nonlin.c:109. [eva:alarm] tests/float/nonlin.c:87: Warning: non-finite float value. assert \is_finite((float)((int)(&x_0 + (int)(&x_0)))); [eva] tests/float/nonlin.c:87: Assigning imprecise value to a_0. The imprecision originates from Arithmetic {tests/float/nonlin.c:87} [eva:alarm] tests/float/nonlin.c:88: Warning: non-finite float value. assert \is_finite(a_0); [eva:alarm] tests/float/nonlin.c:88: Warning: non-finite float value. assert \is_finite((float)(a_0 + a_0)); [eva] tests/float/nonlin.c:88: Assigning imprecise value to f. The imprecision originates from Arithmetic [eva] Recording results for garbled [eva] Done for function garbled [eva] computing for function around_zeros <- main. Called from tests/float/nonlin.c:110. [eva] computing for function Frama_C_float_interval <- around_zeros <- main. Called from tests/float/nonlin.c:97. [eva] tests/float/nonlin.c:97: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:97: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva:alarm] tests/float/nonlin.c:101: Warning: non-finite float value. assert \is_finite((float)(f1 / (float)((float)((float)(f + f) - f) - f1))); [eva] Recording results for around_zeros [eva] Done for function around_zeros [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function access_bits: rbits1 ∈ {0; 1; 2} x0 ∈ [--..--] __retres ∈ {0; 1} [eva:final-states] Values at end of function around_zeros: Frama_C_entropy_source ∈ [--..--] f1 ∈ {0x1.0000000000000p-149} f ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p-149] res ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] [eva:final-states] Values at end of function garbled: a_0 ∈ {{ garbled mix of &{x_0} (origin: Arithmetic {tests/float/nonlin.c:87}) }} f ∈ {{ garbled mix of &{x_0} (origin: Arithmetic) }} [eva:final-states] Values at end of function nonlin_f: Frama_C_entropy_source ∈ [--..--] a ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] b ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p0] c ∈ {0x1.c000000000000p2} r1 ∈ [0x1.4000000000000p2 .. 0x1.2000000000000p3] r2 ∈ [0x1.4000000000000p2 .. 0x1.c800000000000p2] d ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] [eva:final-states] Values at end of function norm: v1 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] v2 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] square ∈ [-0x1.fffffc0000020p256 .. 0x1.fffffc0000020p256] [eva:final-states] Values at end of function other: Frama_C_entropy_source ∈ [--..--] i ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] s ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] zf ∈ [-0x1.1300000000000p8 .. 0x1.1300000000000p8] s2 ∈ [-0x1.0a00000000000p8 .. 0x1.1c00000000000p8] sq ∈ [-0x1.2718000000000p14 .. 0x1.3b10000000000p14] h ∈ [-0x1.38d8000000000p14 .. 0x1.2950000000000p14] r ∈ [2..11] x ∈ [1..42] y ∈ [0..42] z ∈ [-2750000..2750000] rbits1 ∈ {0; 1; 2} rbits2 ∈ {0; 1} [eva:final-states] Values at end of function split_alarm: ff ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] d_0 ∈ [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] a ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] b ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p0] c ∈ {0x1.c000000000000p2} r1 ∈ [0x1.4000000000000p2 .. 0x1.2000000000000p3] r2 ∈ [0x1.4000000000000p2 .. 0x1.c800000000000p2] d ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] i ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] s ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] zf ∈ [-0x1.1300000000000p8 .. 0x1.1300000000000p8] s2 ∈ [-0x1.0a00000000000p8 .. 0x1.1c00000000000p8] sq ∈ [-0x1.2718000000000p14 .. 0x1.3b10000000000p14] h ∈ [-0x1.38d8000000000p14 .. 0x1.2950000000000p14] r ∈ [2..11] x ∈ [1..42] y ∈ [0..42] z ∈ [-2750000..2750000] rbits1 ∈ {0; 1; 2} rbits2 ∈ {0; 1} frama-c-20.0-Calcium/tests/float/oracle/nonlin.1.res.oracle0000666000000000000000000003137213571573400020350 0ustar [kernel] Parsing tests/float/nonlin.c (with preprocessing) [kernel:parser:decimal-float] tests/float/nonlin.c:75: Warning: Floating-point constant 0.000000001 is not represented exactly. Will use 0x1.12e0be826d695p-30. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} r1 ∈ {0} r2 ∈ {0} d ∈ {0} i ∈ {0} s ∈ {0} zf ∈ {0} s2 ∈ {0} sq ∈ {0} h ∈ {0} t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} r ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} rbits1 ∈ {0} rbits2 ∈ {0} v ∈ [--..--] [eva] computing for function nonlin_f <- main. Called from tests/float/nonlin.c:105. [eva] computing for function Frama_C_float_interval <- nonlin_f <- main. Called from tests/float/nonlin.c:16. [eva] using specification for function Frama_C_float_interval [eva] tests/float/nonlin.c:16: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:16: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_float_interval <- nonlin_f <- main. Called from tests/float/nonlin.c:17. [eva] tests/float/nonlin.c:17: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:17: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] tests/float/nonlin.c:20: assertion got status valid. [eva:nonlin] tests/float/nonlin.c:22: non-linear 'a + b * (c - a)', lv 'a' [eva:nonlin] tests/float/nonlin.c:22: subdividing on a [eva] tests/float/nonlin.c:24: assertion got status valid. [eva:nonlin] tests/float/nonlin.c:41: non-linear 'b * (c - a) + a', lv 'a' [eva:nonlin] tests/float/nonlin.c:41: subdividing on a [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.4000000000000p2 .. 0x1.4800000000000p2], {{ "r2" }}, [0x1.4000000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.4800000000000p2 .. 0x1.5000000000000p2], {{ "r2" }}, [0x1.4800000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.5000000000000p2 .. 0x1.5800000000000p2], {{ "r2" }}, [0x1.5000000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.5800000000000p2 .. 0x1.6000000000000p2], {{ "r2" }}, [0x1.5800000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.6000000000000p2 .. 0x1.6800000000000p2], {{ "r2" }}, [0x1.6000000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.6800000000000p2 .. 0x1.7000000000000p2], {{ "r2" }}, [0x1.6800000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.7000000000000p2 .. 0x1.7800000000000p2], {{ "r2" }}, [0x1.7000000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.7800000000000p2 .. 0x1.8000000000000p2], {{ "r2" }}, [0x1.7800000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.8000000000000p2 .. 0x1.8800000000000p2], {{ "r2" }}, [0x1.8000000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.8800000000000p2 .. 0x1.9000000000000p2], {{ "r2" }}, [0x1.8800000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.9000000000000p2 .. 0x1.9800000000000p2], {{ "r2" }}, [0x1.9000000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.9800000000000p2 .. 0x1.a000000000000p2], {{ "r2" }}, [0x1.9800000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.a000000000000p2 .. 0x1.a800000000000p2], {{ "r2" }}, [0x1.a000000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.a800000000000p2 .. 0x1.b000000000000p2], {{ "r2" }}, [0x1.a800000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.b000000000000p2 .. 0x1.b800000000000p2], {{ "r2" }}, [0x1.b000000000000p2 .. 0x1.c0fffffffffffp2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.b800000000000p2 .. 0x1.c000000000000p2], {{ "r2" }}, [0x1.b800000000000p2 .. 0x1.c0fffffffffffp2] [eva] Recording results for nonlin_f [eva] Done for function nonlin_f [eva] computing for function other <- main. Called from tests/float/nonlin.c:106. [eva] computing for function Frama_C_float_interval <- other <- main. Called from tests/float/nonlin.c:59. [eva] tests/float/nonlin.c:59: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:59: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_float_interval <- other <- main. Called from tests/float/nonlin.c:60. [eva] tests/float/nonlin.c:60: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:60: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva:nonlin] tests/float/nonlin.c:61: non-linear 'i * i', lv 'i' [eva:nonlin] tests/float/nonlin.c:61: subdividing on i [eva:alarm] tests/float/nonlin.c:61: Warning: accessing out of bounds index. assert (int)((double)((double)(i * i) + 2.0)) < 10; [eva:nonlin] tests/float/nonlin.c:62: non-linear 's - s', lv 's' [eva:nonlin] tests/float/nonlin.c:62: subdividing on s [eva:nonlin] tests/float/nonlin.c:63: non-linear 's - s', lv 's' [eva:nonlin] tests/float/nonlin.c:63: subdividing on s [eva:nonlin] tests/float/nonlin.c:64: non-linear 's + s', lv 's' [eva:nonlin] tests/float/nonlin.c:64: subdividing on s [eva:nonlin] tests/float/nonlin.c:65: non-linear 's * s', lv 's' [eva:nonlin] tests/float/nonlin.c:65: subdividing on s [eva:nonlin] tests/float/nonlin.c:66: non-linear 's * ((double)1 - s)', lv 's' [eva:nonlin] tests/float/nonlin.c:66: subdividing on s [eva] computing for function access_bits <- other <- main. Called from tests/float/nonlin.c:67. [eva] Recording results for access_bits [eva] Done for function access_bits [eva] computing for function Frama_C_interval <- other <- main. Called from tests/float/nonlin.c:69. [eva] using specification for function Frama_C_interval [eva] tests/float/nonlin.c:69: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:nonlin] tests/float/nonlin.c:70: non-linear '(1 / x) * x', lv 'x' [eva:nonlin] tests/float/nonlin.c:70: subdividing on x [eva:alarm] tests/float/nonlin.c:70: Warning: division by zero. assert x ≢ 0; [eva] Recording results for other [eva] Done for function other [eva] computing for function split_alarm <- main. Called from tests/float/nonlin.c:107. [eva:alarm] tests/float/nonlin.c:74: Warning: non-finite float value. assert \is_finite(v); [eva:nonlin] tests/float/nonlin.c:75: non-linear '(double)ff * (double)ff', lv 'ff' [eva:nonlin] tests/float/nonlin.c:75: subdividing on ff [eva] Recording results for split_alarm [eva] Done for function split_alarm [eva] computing for function norm <- main. Called from tests/float/nonlin.c:108. [eva:alarm] tests/float/nonlin.c:79: Warning: non-finite float value. assert \is_finite(v); [eva:alarm] tests/float/nonlin.c:80: Warning: non-finite float value. assert \is_finite(v); [eva:nonlin] tests/float/nonlin.c:81: non-linear '(double)v1 * (double)v1', lv 'v1' [eva:nonlin] tests/float/nonlin.c:81: non-linear '(double)v2 * (double)v2', lv 'v2' [eva:nonlin] tests/float/nonlin.c:81: subdividing on v1 [eva:nonlin] tests/float/nonlin.c:81: subdividing on v2 [eva] Recording results for norm [eva] Done for function norm [eva] computing for function garbled <- main. Called from tests/float/nonlin.c:109. [eva:alarm] tests/float/nonlin.c:87: Warning: non-finite float value. assert \is_finite((float)((int)(&x_0 + (int)(&x_0)))); [eva] tests/float/nonlin.c:87: Assigning imprecise value to a_0. The imprecision originates from Arithmetic {tests/float/nonlin.c:87} [eva:alarm] tests/float/nonlin.c:88: Warning: non-finite float value. assert \is_finite(a_0); [eva:alarm] tests/float/nonlin.c:88: Warning: non-finite float value. assert \is_finite((float)(a_0 + a_0)); [eva] tests/float/nonlin.c:88: Assigning imprecise value to f. The imprecision originates from Arithmetic [eva] Recording results for garbled [eva] Done for function garbled [eva] computing for function around_zeros <- main. Called from tests/float/nonlin.c:110. [eva] computing for function Frama_C_float_interval <- around_zeros <- main. Called from tests/float/nonlin.c:97. [eva] tests/float/nonlin.c:97: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:97: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva:nonlin] tests/float/nonlin.c:101: non-linear '(f + f) - f', lv 'f' [eva:nonlin] tests/float/nonlin.c:101: non-linear 'f1 / (((f + f) - f) - f1)', lv 'f1' [eva:nonlin] tests/float/nonlin.c:101: subdividing on f [eva:alarm] tests/float/nonlin.c:101: Warning: non-finite float value. assert \is_finite((float)(f1 / (float)((float)((float)(f + f) - f) - f1))); [eva] Recording results for around_zeros [eva] Done for function around_zeros [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function access_bits: rbits1 ∈ {0; 1; 2} x0 ∈ [--..--] __retres ∈ {0; 1} [eva:final-states] Values at end of function around_zeros: Frama_C_entropy_source ∈ [--..--] f1 ∈ {0x1.0000000000000p-149} f ∈ [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] res ∈ {-0x1.0000000000000p0} [eva:final-states] Values at end of function garbled: a_0 ∈ {{ garbled mix of &{x_0} (origin: Arithmetic {tests/float/nonlin.c:87}) }} f ∈ {{ garbled mix of &{x_0} (origin: Arithmetic) }} [eva:final-states] Values at end of function nonlin_f: Frama_C_entropy_source ∈ [--..--] a ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] b ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p0] c ∈ {0x1.c000000000000p2} r1 ∈ [0x1.4000000000000p2 .. 0x1.cffffffffffffp2] r2 ∈ [0x1.4000000000000p2 .. 0x1.c0fffffffffffp2] d ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] [eva:final-states] Values at end of function norm: v1 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] v2 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] square ∈ [-0x0.0000000000000p-1022 .. 0x1.fffffc0000020p256] [eva:final-states] Values at end of function other: Frama_C_entropy_source ∈ [--..--] i ∈ [-0x1.714fffffffff7p1 .. 0x1.71c0000000003p1] s ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] zf ∈ [-0x1.12ffffffffffep4 .. 0x1.12ffffffffffep4] s2 ∈ [-0x1.0a00000000000p8 .. 0x1.1c00000000000p8] sq ∈ [-0x1.b37ffffffff34p-7 .. 0x1.3b10000000000p14] h ∈ [-0x1.38d8000000000p14 .. 0x1.3250000000034p-1] r ∈ [3..11] x ∈ [1..42] y ∈ {0; 1} z ∈ [-171874..171874] rbits1 ∈ {0; 1; 2} rbits2 ∈ {0; 1} [eva:final-states] Values at end of function split_alarm: ff ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] d_0 ∈ [0x1.0000020000030p-256 .. 0x1.dcd64ffffffffp29] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] a ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] b ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p0] c ∈ {0x1.c000000000000p2} r1 ∈ [0x1.4000000000000p2 .. 0x1.cffffffffffffp2] r2 ∈ [0x1.4000000000000p2 .. 0x1.c0fffffffffffp2] d ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] i ∈ [-0x1.714fffffffff7p1 .. 0x1.71c0000000003p1] s ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] zf ∈ [-0x1.12ffffffffffep4 .. 0x1.12ffffffffffep4] s2 ∈ [-0x1.0a00000000000p8 .. 0x1.1c00000000000p8] sq ∈ [-0x1.b37ffffffff34p-7 .. 0x1.3b10000000000p14] h ∈ [-0x1.38d8000000000p14 .. 0x1.3250000000034p-1] r ∈ [3..11] x ∈ [1..42] y ∈ {0; 1} z ∈ [-171874..171874] rbits1 ∈ {0; 1; 2} rbits2 ∈ {0; 1} frama-c-20.0-Calcium/tests/float/oracle/nonlin.2.res.oracle0000666000000000000000000002663413571573400020356 0ustar [kernel] Parsing tests/float/nonlin.c (with preprocessing) [kernel:parser:decimal-float] tests/float/nonlin.c:75: Warning: Floating-point constant 0.000000001 is not represented exactly. Will use 0x1.12e0be826d695p-30. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} r1 ∈ {0} r2 ∈ {0} d ∈ {0} i ∈ {0} s ∈ {0} zf ∈ {0} s2 ∈ {0} sq ∈ {0} h ∈ {0} t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} r ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} rbits1 ∈ {0} rbits2 ∈ {0} v ∈ [--..--] [eva] computing for function nonlin_f <- main. Called from tests/float/nonlin.c:105. [eva] computing for function Frama_C_float_interval <- nonlin_f <- main. Called from tests/float/nonlin.c:16. [eva] using specification for function Frama_C_float_interval [eva] tests/float/nonlin.c:16: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:16: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_float_interval <- nonlin_f <- main. Called from tests/float/nonlin.c:17. [eva] tests/float/nonlin.c:17: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:17: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] tests/float/nonlin.c:20: assertion got status valid. [eva] tests/float/nonlin.c:24: assertion got status valid. [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.4000000000000p2 .. 0x1.4800000000000p2], {{ "r2" }}, [0x1.4000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.4800000000000p2 .. 0x1.5000000000000p2], {{ "r2" }}, [0x1.4800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.5000000000000p2 .. 0x1.5800000000000p2], {{ "r2" }}, [0x1.5000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.5800000000000p2 .. 0x1.6000000000000p2], {{ "r2" }}, [0x1.5800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.6000000000000p2 .. 0x1.6800000000000p2], {{ "r2" }}, [0x1.6000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.6800000000000p2 .. 0x1.7000000000000p2], {{ "r2" }}, [0x1.6800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.7000000000000p2 .. 0x1.7800000000000p2], {{ "r2" }}, [0x1.7000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.7800000000000p2 .. 0x1.8000000000000p2], {{ "r2" }}, [0x1.7800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.8000000000000p2 .. 0x1.8800000000000p2], {{ "r2" }}, [0x1.8000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.8800000000000p2 .. 0x1.9000000000000p2], {{ "r2" }}, [0x1.8800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.9000000000000p2 .. 0x1.9800000000000p2], {{ "r2" }}, [0x1.9000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.9800000000000p2 .. 0x1.a000000000000p2], {{ "r2" }}, [0x1.9800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.a000000000000p2 .. 0x1.a800000000000p2], {{ "r2" }}, [0x1.a000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.a800000000000p2 .. 0x1.b000000000000p2], {{ "r2" }}, [0x1.a800000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.b000000000000p2 .. 0x1.b800000000000p2], {{ "r2" }}, [0x1.b000000000000p2 .. 0x1.c800000000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.b800000000000p2 .. 0x1.c000000000000p2], {{ "r2" }}, [0x1.b800000000000p2 .. 0x1.c800000000000p2] [eva] Recording results for nonlin_f [eva] Done for function nonlin_f [eva] computing for function other <- main. Called from tests/float/nonlin.c:106. [eva] computing for function Frama_C_float_interval <- other <- main. Called from tests/float/nonlin.c:59. [eva] tests/float/nonlin.c:59: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:59: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_float_interval <- other <- main. Called from tests/float/nonlin.c:60. [eva] tests/float/nonlin.c:60: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:60: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva:alarm] tests/float/nonlin.c:61: Warning: accessing out of bounds index. assert 0 ≤ (int)((double)((double)((float)(i * i)) + 2.0)); [eva:alarm] tests/float/nonlin.c:61: Warning: accessing out of bounds index. assert (int)((double)((double)((float)(i * i)) + 2.0)) < 10; [eva] computing for function access_bits <- other <- main. Called from tests/float/nonlin.c:67. [eva] Recording results for access_bits [eva] Done for function access_bits [eva] computing for function Frama_C_interval <- other <- main. Called from tests/float/nonlin.c:69. [eva] using specification for function Frama_C_interval [eva] tests/float/nonlin.c:69: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/float/nonlin.c:70: Warning: division by zero. assert x ≢ 0; [eva] Recording results for other [eva] Done for function other [eva] computing for function split_alarm <- main. Called from tests/float/nonlin.c:107. [eva:alarm] tests/float/nonlin.c:74: Warning: non-finite float value. assert \is_finite(v); [eva:alarm] tests/float/nonlin.c:75: Warning: non-finite double value. assert \is_finite((double)((double)1 / (double)((double)((double)ff * (double)ff) + 0.000000001))); [eva] Recording results for split_alarm [eva] Done for function split_alarm [eva] computing for function norm <- main. Called from tests/float/nonlin.c:108. [eva:alarm] tests/float/nonlin.c:79: Warning: non-finite float value. assert \is_finite(v); [eva:alarm] tests/float/nonlin.c:80: Warning: non-finite float value. assert \is_finite(v); [eva] Recording results for norm [eva] Done for function norm [eva] computing for function garbled <- main. Called from tests/float/nonlin.c:109. [eva:alarm] tests/float/nonlin.c:87: Warning: non-finite float value. assert \is_finite((float)((int)(&x_0 + (int)(&x_0)))); [eva] tests/float/nonlin.c:87: Assigning imprecise value to a_0. The imprecision originates from Arithmetic {tests/float/nonlin.c:87} [eva:alarm] tests/float/nonlin.c:88: Warning: non-finite float value. assert \is_finite(a_0); [eva:alarm] tests/float/nonlin.c:88: Warning: non-finite float value. assert \is_finite((float)(a_0 + a_0)); [eva] tests/float/nonlin.c:88: Assigning imprecise value to f. The imprecision originates from Arithmetic [eva] Recording results for garbled [eva] Done for function garbled [eva] computing for function around_zeros <- main. Called from tests/float/nonlin.c:110. [eva] computing for function Frama_C_float_interval <- around_zeros <- main. Called from tests/float/nonlin.c:97. [eva] tests/float/nonlin.c:97: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:97: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva:alarm] tests/float/nonlin.c:101: Warning: non-finite float value. assert \is_finite((float)(f1 / (float)((float)((float)(f + f) - f) - f1))); [eva] Recording results for around_zeros [eva] Done for function around_zeros [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function access_bits: rbits1 ∈ {0; 1; 2} x0 ∈ [0..3271884800] __retres ∈ {0; 1} [eva:final-states] Values at end of function around_zeros: Frama_C_entropy_source ∈ [--..--] f1 ∈ {0x1.0000000000000p-149} f ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p-149] res ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] [eva:final-states] Values at end of function garbled: a_0 ∈ {{ garbled mix of &{x_0} (origin: Arithmetic {tests/float/nonlin.c:87}) }} f ∈ {{ garbled mix of &{x_0} (origin: Arithmetic) }} [eva:final-states] Values at end of function nonlin_f: Frama_C_entropy_source ∈ [--..--] a ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] b ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p0] c ∈ {0x1.c000000000000p2} r1 ∈ [0x1.4000000000000p2 .. 0x1.2000000000000p3] r2 ∈ [0x1.4000000000000p2 .. 0x1.c800000000000p2] d ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] [eva:final-states] Values at end of function norm: v1 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] v2 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] square ∈ [-0x1.fffffc0000020p256 .. 0x1.fffffc0000020p256] [eva:final-states] Values at end of function other: Frama_C_entropy_source ∈ [--..--] i ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] s ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] zf ∈ [-0x1.1300000000000p8 .. 0x1.1300000000000p8] s2 ∈ [-0x1.0a00000000000p8 .. 0x1.1c00000000000p8] sq ∈ [-0x1.2718000000000p14 .. 0x1.3b10000000000p14] h ∈ [-0x1.38d8000000000p14 .. 0x1.2950000000000p14] r ∈ [2..11] x ∈ [1..42] y ∈ [0..42] z ∈ [-2750000..2750000] rbits1 ∈ {0; 1; 2} rbits2 ∈ {0; 1} [eva:final-states] Values at end of function split_alarm: ff ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] d_0 ∈ [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] a ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] b ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p0] c ∈ {0x1.c000000000000p2} r1 ∈ [0x1.4000000000000p2 .. 0x1.2000000000000p3] r2 ∈ [0x1.4000000000000p2 .. 0x1.c800000000000p2] d ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] i ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] s ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] zf ∈ [-0x1.1300000000000p8 .. 0x1.1300000000000p8] s2 ∈ [-0x1.0a00000000000p8 .. 0x1.1c00000000000p8] sq ∈ [-0x1.2718000000000p14 .. 0x1.3b10000000000p14] h ∈ [-0x1.38d8000000000p14 .. 0x1.2950000000000p14] r ∈ [2..11] x ∈ [1..42] y ∈ [0..42] z ∈ [-2750000..2750000] rbits1 ∈ {0; 1; 2} rbits2 ∈ {0; 1} frama-c-20.0-Calcium/tests/float/oracle/nonlin.3.res.oracle0000666000000000000000000003141113571573400020344 0ustar [kernel] Parsing tests/float/nonlin.c (with preprocessing) [kernel:parser:decimal-float] tests/float/nonlin.c:75: Warning: Floating-point constant 0.000000001 is not represented exactly. Will use 0x1.12e0be826d695p-30. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} r1 ∈ {0} r2 ∈ {0} d ∈ {0} i ∈ {0} s ∈ {0} zf ∈ {0} s2 ∈ {0} sq ∈ {0} h ∈ {0} t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} r ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} rbits1 ∈ {0} rbits2 ∈ {0} v ∈ [--..--] [eva] computing for function nonlin_f <- main. Called from tests/float/nonlin.c:105. [eva] computing for function Frama_C_float_interval <- nonlin_f <- main. Called from tests/float/nonlin.c:16. [eva] using specification for function Frama_C_float_interval [eva] tests/float/nonlin.c:16: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:16: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_float_interval <- nonlin_f <- main. Called from tests/float/nonlin.c:17. [eva] tests/float/nonlin.c:17: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:17: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] tests/float/nonlin.c:20: assertion got status valid. [eva:nonlin] tests/float/nonlin.c:22: non-linear 'a + b * (c - a)', lv 'a' [eva:nonlin] tests/float/nonlin.c:22: subdividing on a [eva] tests/float/nonlin.c:24: assertion got status valid. [eva:nonlin] tests/float/nonlin.c:41: non-linear 'b * (c - a) + a', lv 'a' [eva:nonlin] tests/float/nonlin.c:41: subdividing on a [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.4000000000000p2 .. 0x1.4800000000000p2], {{ "r2" }}, [0x1.4000000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.4800000000000p2 .. 0x1.5000000000000p2], {{ "r2" }}, [0x1.4800000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.5000000000000p2 .. 0x1.5800000000000p2], {{ "r2" }}, [0x1.5000000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.5800000000000p2 .. 0x1.6000000000000p2], {{ "r2" }}, [0x1.5800000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.6000000000000p2 .. 0x1.6800000000000p2], {{ "r2" }}, [0x1.6000000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.6800000000000p2 .. 0x1.7000000000000p2], {{ "r2" }}, [0x1.6800000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.7000000000000p2 .. 0x1.7800000000000p2], {{ "r2" }}, [0x1.7000000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.7800000000000p2 .. 0x1.8000000000000p2], {{ "r2" }}, [0x1.7800000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.8000000000000p2 .. 0x1.8800000000000p2], {{ "r2" }}, [0x1.8000000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.8800000000000p2 .. 0x1.9000000000000p2], {{ "r2" }}, [0x1.8800000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.9000000000000p2 .. 0x1.9800000000000p2], {{ "r2" }}, [0x1.9000000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.9800000000000p2 .. 0x1.a000000000000p2], {{ "r2" }}, [0x1.9800000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.a000000000000p2 .. 0x1.a800000000000p2], {{ "r2" }}, [0x1.a000000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.a800000000000p2 .. 0x1.b000000000000p2], {{ "r2" }}, [0x1.a800000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.b000000000000p2 .. 0x1.b800000000000p2], {{ "r2" }}, [0x1.b000000000000p2 .. 0x1.c0fffe0000000p2] [eva] tests/float/nonlin.c:42: Frama_C_show_each_a_r2: {{ "a" }}, [0x1.b800000000000p2 .. 0x1.c000000000000p2], {{ "r2" }}, [0x1.b800000000000p2 .. 0x1.c0fffe0000000p2] [eva] Recording results for nonlin_f [eva] Done for function nonlin_f [eva] computing for function other <- main. Called from tests/float/nonlin.c:106. [eva] computing for function Frama_C_float_interval <- other <- main. Called from tests/float/nonlin.c:59. [eva] tests/float/nonlin.c:59: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:59: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] computing for function Frama_C_float_interval <- other <- main. Called from tests/float/nonlin.c:60. [eva] tests/float/nonlin.c:60: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:60: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva:nonlin] tests/float/nonlin.c:61: non-linear 'i * i', lv 'i' [eva:nonlin] tests/float/nonlin.c:61: subdividing on i [eva:alarm] tests/float/nonlin.c:61: Warning: accessing out of bounds index. assert (int)((double)((double)((float)(i * i)) + 2.0)) < 10; [eva:nonlin] tests/float/nonlin.c:62: non-linear 's - s', lv 's' [eva:nonlin] tests/float/nonlin.c:62: subdividing on s [eva:nonlin] tests/float/nonlin.c:63: non-linear 's - s', lv 's' [eva:nonlin] tests/float/nonlin.c:63: subdividing on s [eva:nonlin] tests/float/nonlin.c:64: non-linear 's + s', lv 's' [eva:nonlin] tests/float/nonlin.c:64: subdividing on s [eva:nonlin] tests/float/nonlin.c:65: non-linear 's * s', lv 's' [eva:nonlin] tests/float/nonlin.c:65: subdividing on s [eva:nonlin] tests/float/nonlin.c:66: non-linear 's * ((float)1 - s)', lv 's' [eva:nonlin] tests/float/nonlin.c:66: subdividing on s [eva] computing for function access_bits <- other <- main. Called from tests/float/nonlin.c:67. [eva] Recording results for access_bits [eva] Done for function access_bits [eva] computing for function Frama_C_interval <- other <- main. Called from tests/float/nonlin.c:69. [eva] using specification for function Frama_C_interval [eva] tests/float/nonlin.c:69: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:nonlin] tests/float/nonlin.c:70: non-linear '(1 / x) * x', lv 'x' [eva:nonlin] tests/float/nonlin.c:70: subdividing on x [eva:alarm] tests/float/nonlin.c:70: Warning: division by zero. assert x ≢ 0; [eva] Recording results for other [eva] Done for function other [eva] computing for function split_alarm <- main. Called from tests/float/nonlin.c:107. [eva:alarm] tests/float/nonlin.c:74: Warning: non-finite float value. assert \is_finite(v); [eva:nonlin] tests/float/nonlin.c:75: non-linear '(double)ff * (double)ff', lv 'ff' [eva:nonlin] tests/float/nonlin.c:75: subdividing on ff [eva] Recording results for split_alarm [eva] Done for function split_alarm [eva] computing for function norm <- main. Called from tests/float/nonlin.c:108. [eva:alarm] tests/float/nonlin.c:79: Warning: non-finite float value. assert \is_finite(v); [eva:alarm] tests/float/nonlin.c:80: Warning: non-finite float value. assert \is_finite(v); [eva:nonlin] tests/float/nonlin.c:81: non-linear '(double)v1 * (double)v1', lv 'v1' [eva:nonlin] tests/float/nonlin.c:81: non-linear '(double)v2 * (double)v2', lv 'v2' [eva:nonlin] tests/float/nonlin.c:81: subdividing on v1 [eva:nonlin] tests/float/nonlin.c:81: subdividing on v2 [eva] Recording results for norm [eva] Done for function norm [eva] computing for function garbled <- main. Called from tests/float/nonlin.c:109. [eva:alarm] tests/float/nonlin.c:87: Warning: non-finite float value. assert \is_finite((float)((int)(&x_0 + (int)(&x_0)))); [eva] tests/float/nonlin.c:87: Assigning imprecise value to a_0. The imprecision originates from Arithmetic {tests/float/nonlin.c:87} [eva:alarm] tests/float/nonlin.c:88: Warning: non-finite float value. assert \is_finite(a_0); [eva:alarm] tests/float/nonlin.c:88: Warning: non-finite float value. assert \is_finite((float)(a_0 + a_0)); [eva] tests/float/nonlin.c:88: Assigning imprecise value to f. The imprecision originates from Arithmetic [eva] Recording results for garbled [eva] Done for function garbled [eva] computing for function around_zeros <- main. Called from tests/float/nonlin.c:110. [eva] computing for function Frama_C_float_interval <- around_zeros <- main. Called from tests/float/nonlin.c:97. [eva] tests/float/nonlin.c:97: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/nonlin.c:97: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva:nonlin] tests/float/nonlin.c:101: non-linear '(f + f) - f', lv 'f' [eva:nonlin] tests/float/nonlin.c:101: non-linear 'f1 / (((f + f) - f) - f1)', lv 'f1' [eva:nonlin] tests/float/nonlin.c:101: subdividing on f [eva:alarm] tests/float/nonlin.c:101: Warning: non-finite float value. assert \is_finite((float)(f1 / (float)((float)((float)(f + f) - f) - f1))); [eva] Recording results for around_zeros [eva] Done for function around_zeros [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function access_bits: rbits1 ∈ {0; 1; 2} x0 ∈ [0..3224938487] __retres ∈ {0; 1} [eva:final-states] Values at end of function around_zeros: Frama_C_entropy_source ∈ [--..--] f1 ∈ {0x1.0000000000000p-149} f ∈ [-0x0.0000000000000p-1022 .. 0x0.0000000000000p-1022] res ∈ {-0x1.0000000000000p0} [eva:final-states] Values at end of function garbled: a_0 ∈ {{ garbled mix of &{x_0} (origin: Arithmetic {tests/float/nonlin.c:87}) }} f ∈ {{ garbled mix of &{x_0} (origin: Arithmetic) }} [eva:final-states] Values at end of function nonlin_f: Frama_C_entropy_source ∈ [--..--] a ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] b ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p0] c ∈ {0x1.c000000000000p2} r1 ∈ [0x1.4000000000000p2 .. 0x1.cffffe0000000p2] r2 ∈ [0x1.4000000000000p2 .. 0x1.c0fffe0000000p2] d ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] [eva:final-states] Values at end of function norm: v1 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] v2 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] square ∈ [-0x0.0000000000000p-1022 .. 0x1.fffffc0000020p256] [eva:final-states] Values at end of function other: Frama_C_entropy_source ∈ [--..--] i ∈ [-0x1.714fee0000000p1 .. 0x1.71c0040000000p1] s ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] zf ∈ [-0x1.12fffc0000000p4 .. 0x1.12fffc0000000p4] s2 ∈ [-0x1.0a00000000000p8 .. 0x1.1c00000000000p8] sq ∈ [-0x1.b37e680000000p-7 .. 0x1.3b10000000000p14] h ∈ [-0x1.38d8000000000p14 .. 0x1.3250680000000p-1] r ∈ [3..11] x ∈ [1..42] y ∈ {0; 1} z ∈ [-171874..171874] rbits1 ∈ {0; 1; 2} rbits2 ∈ {0; 1} [eva:final-states] Values at end of function split_alarm: ff ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] d_0 ∈ [0x1.0000020000030p-256 .. 0x1.dcd64ffffffffp29] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] a ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] b ∈ [-0x0.0000000000000p-1022 .. 0x1.0000000000000p0] c ∈ {0x1.c000000000000p2} r1 ∈ [0x1.4000000000000p2 .. 0x1.cffffe0000000p2] r2 ∈ [0x1.4000000000000p2 .. 0x1.c0fffe0000000p2] d ∈ [0x1.4000000000000p2 .. 0x1.c000000000000p2] i ∈ [-0x1.714fee0000000p1 .. 0x1.71c0040000000p1] s ∈ [-0x1.0a00000000000p7 .. 0x1.1c00000000000p7] zf ∈ [-0x1.12fffc0000000p4 .. 0x1.12fffc0000000p4] s2 ∈ [-0x1.0a00000000000p8 .. 0x1.1c00000000000p8] sq ∈ [-0x1.b37e680000000p-7 .. 0x1.3b10000000000p14] h ∈ [-0x1.38d8000000000p14 .. 0x1.3250680000000p-1] r ∈ [3..11] x ∈ [1..42] y ∈ {0; 1} z ∈ [-171874..171874] rbits1 ∈ {0; 1; 2} rbits2 ∈ {0; 1} frama-c-20.0-Calcium/tests/float/oracle/parse.res.oracle0000666000000000000000000000464613571573400020032 0ustar [kernel] Parsing tests/float/parse.i (no preprocessing) [kernel:parser:decimal-float] tests/float/parse.i:25: Warning: Floating-point constant 0.00000000000000000000000000000000000000001e310 is not represented exactly. Will use 0x1.83a99c3ec7eb0p893. [kernel:parser:decimal-float] tests/float/parse.i:30: Warning: Floating-point constant 0.0000001E9999999999999999999 is not represented exactly. Will use inf. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] tests/float/parse.i:10: Frama_C_show_each: {0}, {{ "reached" }} [eva] tests/float/parse.i:15: Frama_C_show_each: {0}, {{ "reached" }} [eva] tests/float/parse.i:21: Frama_C_show_each: {0}, {0}, {{ "reached" }} [eva] tests/float/parse.i:26: Frama_C_show_each: {0x1.83a99c3ec7eb0p893}, {{ "reached" }} [eva:alarm] tests/float/parse.i:30: Warning: non-finite double value. assert \is_finite(0.0000001E9999999999999999999); [eva] tests/float/parse.i:36: Warning: cannot parse floating-point constant, returning imprecise result [eva:alarm] tests/float/parse.i:36: Warning: non-finite long double value. assert \is_finite(0x1p32767L); [eva:alarm] tests/float/parse.i:37: Warning: non-finite long double value. assert \is_finite(l); [eva:alarm] tests/float/parse.i:37: Warning: non-finite long double value. assert \is_finite(l); [eva:alarm] tests/float/parse.i:37: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < l; [eva:alarm] tests/float/parse.i:37: Warning: overflow in conversion from floating-point to integer. assert l < 2147483648; [eva] Recording results for main [eva] done for function main [eva] tests/float/parse.i:30: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/float/parse.i:36: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: d; d_0; d1; d2; d_1; d_2; l; long_double; __retres [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/float/oracle/precise_cos_sin.res.oracle0000666000000000000000000002337013571573400022062 0ustar [kernel] Parsing tests/float/precise_cos_sin.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function Frama_C_float_interval <- main. Called from tests/float/precise_cos_sin.c:12. [eva] using specification for function Frama_C_float_interval [eva] tests/float/precise_cos_sin.c:12: function Frama_C_float_interval: precondition 'finite' got status valid. [eva] tests/float/precise_cos_sin.c:12: function Frama_C_float_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_float_interval [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: function sin: precondition 'finite_arg' got status valid. [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: function cos: precondition 'finite_arg' got status valid. [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.2692141532897949*2^-1 .. -1.6947050094604492*2^-2] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [1.5456699132919311*2^-1 .. 1.8116273880004883*2^-1] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.6947050094604492*2^-2 .. -1.4912263154983521*2^-3] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [1.8116273880004883*2^-1 .. 1.9649466276168823*2^-1] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.4912263154983521*2^-3 .. 1.9986981153488159*2^-5] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [1.9649466276168823*2^-1 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [1.9986981153488159*2^-5 .. 1.2297540903091430*2^-2] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [1.9031358957290649*2^-1 .. 1.9960950613021851*2^-1] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [1.2297540903091430*2^-2 .. 1.0666053295135498*2^-1] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [1.6918489933013916*2^-1 .. 1.9031358957290649*2^-1] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:15: Call to builtin sin [eva] tests/float/precise_cos_sin.c:15: Frama_C_show_each_s: [-1.0000000000000000 .. 1.0000000000000000] [eva] tests/float/precise_cos_sin.c:16: Call to builtin cos [eva] tests/float/precise_cos_sin.c:16: Frama_C_show_each_c: [-1.0000000000000000 .. 1.0000000000000000] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] f ∈ [3.1875002384185791 .. 3.4375000000000000] __retres ∈ {0} frama-c-20.0-Calcium/tests/float/oracle/round10d.res.oracle0000666000000000000000000000303613571573400020344 0ustar [kernel] Parsing tests/float/round10d.i (no preprocessing) [kernel:parser:decimal-float] tests/float/round10d.i:9: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/float/round10d.i:9: Frama_C_show_each_dixieme: {1.6000000000000000*2^-4} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.6000000000000000*2^-4} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.6000000000000000*2^-3} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.2000000000000001*2^-2} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.6000000000000000*2^-2} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.0000000000000000*2^-1} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.1999999999999999*2^-1} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.3999999999999999*2^-1} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.5999999999999998*2^-1} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.7999999999999998*2^-1} [eva] tests/float/round10d.i:14: Frama_C_show_each_t: {1.9999999999999998*2^-1} [eva:alarm] tests/float/round10d.i:16: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== frama-c-20.0-Calcium/tests/float/oracle/s.res.oracle0000666000000000000000000003157513571573400017163 0ustar [kernel] Parsing tests/float/s.i (no preprocessing) [kernel:parser:decimal-float] tests/float/s.i:18: Warning: Floating-point constant 1.882f is not represented exactly. Will use 0x1.e1cac00000000p0. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G3 ∈ {42} G5[0..63] ∈ {0} G6 ∈ {42} G7 ∈ {0} G8 ∈ {0} G9[0] ∈ {0x1.0000000000000p1} [1] ∈ {0x1.e1cac00000000p0} [2] ∈ {0x1.c72b020000000p0} [3] ∈ {0x1.af1aa00000000p0} [4] ∈ {0x1.99999a0000000p0} [5] ∈ {0x1.85e3540000000p0} [6] ∈ {0x1.747ae20000000p0} [7] ∈ {0x1.6418940000000p0} [8] ∈ {0x1.553f7c0000000p0} [9] ∈ {0x1.47ae140000000p0} [10] ∈ {0x1.3b22d00000000p0} [11] ∈ {0x1.2f5c280000000p0} [12] ∈ {0x1.249ba60000000p0} [13] ∈ {0x1.1020c40000000p0} [14] ∈ {0x1.0000000000000p0} [15] ∈ {0x1.e353f80000000p-1} [16] ∈ {0x1.ca3d700000000p-1} [17] ∈ {0x1.b333340000000p-1} [18] ∈ {0x1.9eb8520000000p-1} [19] ∈ {0x1.8bc6a80000000p-1} [20] ∈ {0x1.7a5e360000000p-1} [21] ∈ {0x1.6a7efa0000000p-1} [22] ∈ {0x1.5c28f60000000p-1} [23] ∈ {0x1.4ed9160000000p-1} [24] ∈ {0x1.428f5c0000000p-1} [25] ∈ {0x1.36c8b40000000p-1} [26] ∈ {0x1.2c08320000000p-1} [27] ∈ {0x1.224dd20000000p-1} [28] ∈ {0x1.1893740000000p-1} [29] ∈ {0x1.0000000000000p-1} [30] ∈ {0x1.e24dd20000000p-2} [31] ∈ {0x1.c6a7f00000000p-2} [32] ∈ {0x1.af1aa00000000p-2} [33] ∈ {0x1.99999a0000000p-2} [34] ∈ {0x1.8624de0000000p-2} [35] ∈ {0x1.74bc6a0000000p-2} [36] ∈ {0x1.645a1c0000000p-2} [37] ∈ {0x1.54fdf40000000p-2} [38] ∈ {0x1.47ae140000000p-2} [39] ∈ {0x1.3b645a0000000p-2} [40] ∈ {0x1.2f1aa00000000p-2} [41] ∈ {0x1.24dd300000000p-2} [42] ∈ {0x1.1a9fbe0000000p-2} [43] ∈ {0x1.1168720000000p-2} [44] ∈ {0x1.0831260000000p-2} [45] ∈ {0x1.0000000000000p-2} [46] ∈ {0x1.e353f80000000p-3} [47] ∈ {0x1.c6a7f00000000p-3} [48] ∈ {0x1.b020c40000000p-3} [49] ∈ {0x1.99999a0000000p-3} [50] ∈ {0x1.851eb80000000p-3} [51] ∈ {0x1.74bc6a0000000p-3} [52] ∈ {0x1.645a1c0000000p-3} [53] ∈ {0x1.5604180000000p-3} [54] ∈ {0x1.47ae140000000p-3} [55] ∈ {0x1.3b645a0000000p-3} [56] ∈ {0x1.2f1aa00000000p-3} [57] ∈ {0x1.24dd300000000p-3} [58] ∈ {0x1.1a9fbe0000000p-3} [59] ∈ {0x1.10624e0000000p-3} [60] ∈ {0x1.0831260000000p-3} [61] ∈ {0x1.0000000000000p-3} [62] ∈ {0x1.e353f80000000p-4} [63] ∈ {0x1.c6a7f00000000p-4} G10[0] ∈ {0x1.a1e8c60000000p-5} [1] ∈ {0x1.af8fa40000000p-5} [2] ∈ {0x1.c09e7a0000000p-5} [3] ∈ {0x1.ce42800000000p-5} [4] ∈ {0x1.df4da60000000p-5} [5] ∈ {0x1.f056a60000000p-5} [6] ∈ {0x1.0262740000000p-4} [7] ∈ {0x1.0c97e80000000p-4} [8] ∈ {0x1.16cba00000000p-4} [9] ∈ {0x1.2463180000000p-4} [10] ∈ {0x1.3044e20000000p-4} [11] ∈ {0x1.3f87cc0000000p-4} [12] ∈ {0x1.4ec6100000000p-4} [13] ∈ {0x1.6160dc0000000p-4} [14] ∈ {0x1.73f3fa0000000p-4} [15] ∈ {0x1.89dd340000000p-4} [16] ∈ {0x1.a3167c0000000p-4} [17] ∈ {0x1.b083800000000p-4} [18] ∈ {0x1.bdeb8c0000000p-4} [19] ∈ {0x1.ccfa780000000p-4} [20] ∈ {0x1.ddadd40000000p-4} [21] ∈ {0x1.f002ce0000000p-4} [22] ∈ {0x1.0126800000000p-3} [23] ∈ {0x1.0b1a0a0000000p-3} [24] ∈ {0x1.15da100000000p-3} [25] ∈ {0x1.2236fa0000000p-3} [26] ∈ {0x1.2f59f00000000p-3} [27] ∈ {0x1.3d3fca0000000p-3} [28] ∈ {0x1.4cb4ae0000000p-3} [29] ∈ {0x1.5db0f00000000p-3} [30] ∈ {0x1.702b7a0000000p-3} [31] ∈ {0x1.85aff00000000p-3} [32] ∈ {0x1.9c93820000000p-3} [33] ∈ {0x1.a9e1aa0000000p-3} [34] ∈ {0x1.b719b40000000p-3} [35] ∈ {0x1.c5c4dc0000000p-3} [36] ∈ {0x1.d515d80000000p-3} [37] ∈ {0x1.e5c7f00000000p-3} [38] ∈ {0x1.f64fcc0000000p-3} [39] ∈ {0x1.0471d00000000p-2} [40] ∈ {0x1.0e59140000000p-2} [41] ∈ {0x1.1930760000000p-2} [42] ∈ {0x1.24e8cc0000000p-2} [43] ∈ {0x1.3170760000000p-2} [44] ∈ {0x1.3eb3140000000p-2} [45] ∈ {0x1.4d402c0000000p-2} [46] ∈ {0x1.5cebf20000000p-2} [47] ∈ {0x1.6dcf5c0000000p-2} [48] ∈ {0x1.7fea3e0000000p-2} [49] ∈ {0x1.89682c0000000p-2} [50] ∈ {0x1.935f9c0000000p-2} [51] ∈ {0x1.9d75840000000p-2} [52] ∈ {0x1.a8112c0000000p-2} [53] ∈ {0x1.b2943c0000000p-2} [54] ∈ {0x1.bd88ba0000000p-2} [55] ∈ {0x1.c87cb20000000p-2} [56] ∈ {0x1.d335de0000000p-2} [57] ∈ {0x1.ddc3220000000p-2} [58] ∈ {0x1.e7dc420000000p-2} [59] ∈ {0x1.f0dc4a0000000p-2} [60] ∈ {0x1.f88a800000000p-2} [61] ∈ {0x1.fde7e00000000p-2} [62] ∈ {0x1.fffff40000000p-2} [63] ∈ {0x1.fd48c00000000p-2} G11[0] ∈ {0x1.fd53fe0000000p0} [1] ∈ {0x1.fd26740000000p0} [2] ∈ {0x1.fceb760000000p0} [3] ∈ {0x1.fcbaa00000000p0} [4] ∈ {0x1.fc7b840000000p0} [5] ∈ {0x1.fc3a220000000p0} [6] ∈ {0x1.fbe8a60000000p0} [7] ∈ {0x1.fb93e20000000p0} [8] ∈ {0x1.fb3bd60000000p0} [9] ∈ {0x1.fac1560000000p0} [10] ∈ {0x1.fa51600000000p0} [11] ∈ {0x1.f9bade0000000p0} [12] ∈ {0x1.f91cfe0000000p0} [13] ∈ {0x1.f852100000000p0} [14] ∈ {0x1.f77c2c0000000p0} [15] ∈ {0x1.f671460000000p0} [16] ∈ {0x1.f52a5c0000000p0} [17] ∈ {0x1.f473b80000000p0} [18] ∈ {0x1.f3b7540000000p0} [19] ∈ {0x1.f2dc840000000p0} [20] ∈ {0x1.f1e0e00000000p0} [21] ∈ {0x1.f0c1be0000000p0} [22] ∈ {0x1.ef97ce0000000p0} [23] ∈ {0x1.ee46800000000p0} [24] ∈ {0x1.eccaa80000000p0} [25] ∈ {0x1.eb01ca0000000p0} [26] ∈ {0x1.e904940000000p0} [27] ∈ {0x1.e6cee80000000p0} [28] ∈ {0x1.e438c60000000p0} [29] ∈ {0x1.e138680000000p0} [30] ∈ {0x1.ddc3220000000p0} [31] ∈ {0x1.d979fa0000000p0} [32] ∈ {0x1.d49a7e0000000p0} [33] ∈ {0x1.d19e3e0000000p0} [34] ∈ {0x1.ce89d00000000p0} [35] ∈ {0x1.cafc360000000p0} [36] ∈ {0x1.c71e960000000p0} [37] ∈ {0x1.c2b83a0000000p0} [38] ∈ {0x1.be2aae0000000p0} [39] ∈ {0x1.b8cf1e0000000p0} [40] ∈ {0x1.b2ce400000000p0} [41] ∈ {0x1.abdfde0000000p0} [42] ∈ {0x1.a3f02e0000000p0} [43] ∈ {0x1.9aea260000000p0} [44] ∈ {0x1.90b7b60000000p0} [45] ∈ {0x1.84b34c0000000p0} [46] ∈ {0x1.76b2600000000p0} [47] ∈ {0x1.663a460000000p0} [48] ∈ {0x1.52c0a60000000p0} [49] ∈ {0x1.47ae660000000p0} [50] ∈ {0x1.3b54d20000000p0} [51] ∈ {0x1.2dfc740000000p0} [52] ∈ {0x1.1ee6300000000p0} [53] ∈ {0x1.0eb64e0000000p0} [54] ∈ {0x1.f88d840000000p-1} [55] ∈ {0x1.cfbd460000000p-1} [56] ∈ {0x1.a2d91c0000000p-1} [57] ∈ {0x1.702b7a0000000p-1} [58] ∈ {0x1.36b7840000000p-1} [59] ∈ {0x1.ee589c0000000p-2} [60] ∈ {0x1.5c4eaa0000000p-2} [61] ∈ {0x1.7217880000000p-3} [62] ∈ {-0x1.b739f80000000p-10} [63] ∈ {-0x1.a5529a0000000p-3} G12[0] ∈ {0x1.5555560000000p-1} [1] ∈ {0x1.2f684c0000000p-1} [2] ∈ {0x1.1111120000000p-1} [3] ∈ {0x1.f07c200000000p-2} [4] ∈ {0x1.c71c720000000p-2} [5] ∈ {0x1.a41a420000000p-2} [6] ∈ {0x1.8618620000000p-2} [7] ∈ {0x1.6c16c20000000p-2} [8] ∈ {0x1.5555560000000p-2} [9] ∈ {0x1.2f684c0000000p-2} [10] ∈ {0x1.1111120000000p-2} [11] ∈ {0x1.f07c200000000p-3} [12] ∈ {0x1.c71c720000000p-3} [13] ∈ {0x1.a41a420000000p-3} [14] ∈ {0x1.8618620000000p-3} [15] ∈ {0x1.6c16c20000000p-3} [16] ∈ {0x1.5555560000000p-3} [17] ∈ {0x1.2f684c0000000p-3} [18] ∈ {0x1.1111120000000p-3} [19] ∈ {0x1.f07c200000000p-4} [20] ∈ {0x1.c71c720000000p-4} [21] ∈ {0x1.a41a420000000p-4} [22] ∈ {0x1.8618620000000p-4} [23] ∈ {0x1.6c16c20000000p-4} [24] ∈ {0x1.5555560000000p-4} [25] ∈ {0x1.2f684c0000000p-4} [26] ∈ {0x1.1111120000000p-4} [27] ∈ {0x1.f07c200000000p-5} [28] ∈ {0x1.c71c720000000p-5} [29] ∈ {0x1.a41a420000000p-5} [30] ∈ {0x1.8618620000000p-5} [31] ∈ {0x1.6c16c20000000p-5} G13 ∈ {0} G14 ∈ {0} G15 ∈ {0} G16 ∈ {0} G17 ∈ {0} G18 ∈ {0} G19 ∈ {0} [eva] computing for function F4 <- main. Called from tests/float/s.i:260. [eva] computing for function F1 <- F4 <- main. Called from tests/float/s.i:230. [kernel:annot:missing-spec] tests/float/s.i:230: Warning: Neither code nor specification for function F1, generating default assigns from the prototype [eva] using specification for function F1 [eva] Done for function F1 [eva:alarm] tests/float/s.i:231: Warning: accessing out of bounds index. assert 0 ≤ V4; [eva:alarm] tests/float/s.i:231: Warning: accessing out of bounds index. assert V4 < 64; [eva] computing for function F2 <- F4 <- main. Called from tests/float/s.i:233. [kernel:annot:missing-spec] tests/float/s.i:233: Warning: Neither code nor specification for function F2, generating default assigns from the prototype [eva] using specification for function F2 [eva] Done for function F2 [eva:alarm] tests/float/s.i:238: Warning: accessing out of bounds index. assert 0 ≤ V5; [eva:alarm] tests/float/s.i:238: Warning: accessing out of bounds index. assert V5 < 64; [eva] computing for function F2 <- F4 <- main. Called from tests/float/s.i:241. [eva] Done for function F2 [eva:alarm] tests/float/s.i:242: Warning: accessing out of bounds index. assert 0 ≤ V6; [eva:alarm] tests/float/s.i:242: Warning: accessing out of bounds index. assert V6 < 64; [eva] computing for function F3 <- F4 <- main. Called from tests/float/s.i:244. [kernel:annot:missing-spec] tests/float/s.i:244: Warning: Neither code nor specification for function F3, generating default assigns from the prototype [eva] using specification for function F3 [eva] Done for function F3 [eva:alarm] tests/float/s.i:245: Warning: accessing out of bounds index. assert 0 ≤ V7; [eva:alarm] tests/float/s.i:245: Warning: accessing out of bounds index. assert V7 < 32; [eva] Recording results for F4 [eva] Done for function F4 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function F4: V1 ∈ {0} V2 ∈ [-0x1.a4cfc20000000p-3 .. 0x1.fcb5d00000000p0] V3 ∈ [-0x1.fec1fc0000000p-1 .. -0x1.f3f3f40000000p-1] V4 ∈ [0..63] V5 ∈ [0..63] V6 ∈ [0..63] V7 ∈ [0..31] G14 ∈ [0x1.3e68360000000p-10 .. 0x1.8618580000000p-7] G15 ∈ [-0x1.a5529a0000000p-3 .. 0x1.fd53fe0000000p0] G16 ∈ [0x1.c6a7f00000000p-4 .. 0x1.0000000000000p1] G17 ∈ [0x1.6c16c20000000p-5 .. 0x1.5555560000000p-1] G18 ∈ [0x1.f9f9fa0000000p-1 .. 0x1.ff60fe0000000p-1] G19 ∈ [0x1.176b480000000p-13 .. 0x1.859f320000000p-6] [eva:final-states] Values at end of function main: V8 ∈ {0} G14 ∈ [0x1.3e68360000000p-10 .. 0x1.8618580000000p-7] G15 ∈ [-0x1.a5529a0000000p-3 .. 0x1.fd53fe0000000p0] G16 ∈ [0x1.c6a7f00000000p-4 .. 0x1.0000000000000p1] G17 ∈ [0x1.6c16c20000000p-5 .. 0x1.5555560000000p-1] G18 ∈ [0x1.f9f9fa0000000p-1 .. 0x1.ff60fe0000000p-1] G19 ∈ [0x1.176b480000000p-13 .. 0x1.859f320000000p-6] [from] Computing for function F4 [from] Computing for function F1 <-F4 [from] Done for function F1 [from] Computing for function F2 <-F4 [from] Done for function F2 [from] Computing for function F3 <-F4 [from] Done for function F3 [from] Done for function F4 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function F1: \result FROM G1 [from] Function F2: \result FROM G2 [from] Function F3: \result FROM G4 [from] Function F4: G14 FROM G3; G10[0..63]; G13 G15 FROM G11[0..63]; G13 G16 FROM G9[0..63]; G13 G17 FROM G12[0..31]; G13 G18 FROM G3; G10[0..63]; G13 G19 FROM G3; G9[0..63]; G10[0..63]; G13 [from] Function main: G14 FROM G3; G10[0..63]; G13 G15 FROM G11[0..63]; G13 G16 FROM G9[0..63]; G13 G17 FROM G12[0..31]; G13 G18 FROM G3; G10[0..63]; G13 G19 FROM G3; G9[0..63]; G10[0..63]; G13 \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function F4: V1; V2; V3; V4; V5; V6; V7; G14; G15; G16; G17; G18; G19 [inout] Inputs for function F4: G3; G9[0..63]; G10[0..63]; G11[0..63]; G12[0..31]; G13; G14; G15; G16; G18 [inout] Out (internal) for function main: V8; G14; G15; G16; G17; G18; G19 [inout] Inputs for function main: G3; G9[0..63]; G10[0..63]; G11[0..63]; G12[0..31]; G13; G14; G15; G16; G18 frama-c-20.0-Calcium/tests/float/oracle/some.0.res.oracle0000666000000000000000000000521713571573400020014 0ustar [kernel] Parsing tests/float/some.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {1.0000000000000000} [1..54] ∈ {0} y ∈ {1.0000000000000000*2^-1} [eva] tests/float/some.c:11: Trace partitioning superposing up to 10 states [eva] tests/float/some.c:11: Trace partitioning superposing up to 20 states [eva] tests/float/some.c:11: Trace partitioning superposing up to 30 states [eva] tests/float/some.c:11: Trace partitioning superposing up to 40 states [eva] tests/float/some.c:11: Trace partitioning superposing up to 50 states [eva] tests/float/some.c:16: Frama_C_dump_each: # Cvalue domain: t[0] ∈ {1.0000000000000000} [1] ∈ {1.5000000000000000} [2] ∈ {1.7500000000000000} [3] ∈ {1.8750000000000000} [4] ∈ {1.9375000000000000} [5] ∈ {1.9687500000000000} [6] ∈ {1.9843750000000000} [7] ∈ {1.9921875000000000} [8] ∈ {1.9960937500000000} [9] ∈ {1.9980468750000000} [10] ∈ {1.9990234375000000} [11] ∈ {1.9995117187500000} [12] ∈ {1.9997558593750000} [13] ∈ {1.9998779296875000} [14] ∈ {1.9999389648437500} [15] ∈ {1.9999694824218750} [16] ∈ {1.9999847412109375} [17] ∈ {1.9999923706054688} [18] ∈ {1.9999961853027344} [19] ∈ {1.9999980926513672} [20] ∈ {1.9999990463256836} [21] ∈ {1.9999995231628418} [22] ∈ {1.9999997615814209} [23] ∈ {1.9999998807907104} [24] ∈ {1.9999999403953552} [25] ∈ {1.9999999701976776} [26] ∈ {1.9999999850988388} [27] ∈ {1.9999999925494194} [28] ∈ {1.9999999962747097} [29] ∈ {1.9999999981373549} [30] ∈ {1.9999999990686774} [31] ∈ {1.9999999995343387} [32] ∈ {1.9999999997671694} [33] ∈ {1.9999999998835847} [34] ∈ {1.9999999999417923} [35] ∈ {1.9999999999708962} [36] ∈ {1.9999999999854481} [37] ∈ {1.9999999999927240} [38] ∈ {1.9999999999963620} [39] ∈ {1.9999999999981810} [40] ∈ {1.9999999999990905} [41] ∈ {1.9999999999995453} [42] ∈ {1.9999999999997726} [43] ∈ {1.9999999999998863} [44] ∈ {1.9999999999999432} [45] ∈ {1.9999999999999716} [46] ∈ {1.9999999999999858} [47] ∈ {1.9999999999999929} [48] ∈ {1.9999999999999964} [49] ∈ {1.9999999999999982} [50] ∈ {1.9999999999999991} [51] ∈ {1.9999999999999996} [52] ∈ {1.9999999999999998} [53..54] ∈ {2.0000000000000000} y ∈ {1.0000000000000000*2^-55} i ∈ {55} ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== frama-c-20.0-Calcium/tests/float/oracle/some.1.res.oracle0000666000000000000000000000252613571573400020015 0ustar [kernel] Parsing tests/float/some.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {1.0000000000000000} [1..25] ∈ {0} y ∈ {1.0000000000000000*2^-1} [eva] tests/float/some.c:16: Frama_C_dump_each: # Cvalue domain: t[0] ∈ {1.0000000000000000} [1] ∈ {1.5000000000000000} [2] ∈ {1.7500000000000000} [3] ∈ {1.8750000000000000} [4] ∈ {1.9375000000000000} [5] ∈ {1.9687500000000000} [6] ∈ {1.9843750000000000} [7] ∈ {1.9921875000000000} [8] ∈ {1.9960937500000000} [9] ∈ {1.9980468750000000} [10] ∈ {1.9990234375000000} [11] ∈ {1.9995117187500000} [12] ∈ {1.9997558593750000} [13] ∈ {1.9998779296875000} [14] ∈ {1.9999389648437500} [15] ∈ {1.9999694824218750} [16] ∈ {1.9999847412109375} [17] ∈ {1.9999923706054688} [18] ∈ {1.9999961853027344} [19] ∈ {1.9999980926513672} [20] ∈ {1.9999990463256836} [21] ∈ {1.9999995231628418} [22] ∈ {1.9999997615814209} [23] ∈ {1.9999998807907104} [24..25] ∈ {2.0000000000000000} y ∈ {1.0000000000000000*2^-26} i ∈ {26} ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== frama-c-20.0-Calcium/tests/float/oracle/special_floats.res.oracle0000666000000000000000000000777213571573400021713 0ustar [kernel] Parsing tests/float/special_floats.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] any_double ∈ [--..--] global_infinity ∈ {inf} global_nan ∈ NaN [eva] computing for function nan_comparisons <- main. Called from tests/float/special_floats.c:94. [eva] Recording results for nan_comparisons [eva] Done for function nan_comparisons [eva] computing for function is_infinite <- main. Called from tests/float/special_floats.c:95. [eva] tests/float/special_floats.c:29: check 'true' got status valid. [eva:alarm] tests/float/special_floats.c:30: Warning: check 'false' got status invalid. [eva:alarm] tests/float/special_floats.c:31: Warning: check 'false' got status invalid. [eva:alarm] tests/float/special_floats.c:32: Warning: check 'false' got status invalid. [eva:alarm] tests/float/special_floats.c:34: Warning: check 'false' got status invalid. [eva] tests/float/special_floats.c:35: check 'true' got status valid. [eva] tests/float/special_floats.c:36: check 'true' got status valid. [eva:alarm] tests/float/special_floats.c:37: Warning: check 'false' got status invalid. [eva:alarm] tests/float/special_floats.c:39: Warning: check 'false' got status invalid. [eva] tests/float/special_floats.c:40: check 'true' got status valid. [eva:alarm] tests/float/special_floats.c:41: Warning: check 'false' got status invalid. [eva:alarm] tests/float/special_floats.c:42: Warning: check 'false' got status invalid. [eva:alarm] tests/float/special_floats.c:46: Warning: assertion got status unknown. [eva] tests/float/special_floats.c:47: Frama_C_show_each_pos_infinity: {inf} [eva:alarm] tests/float/special_floats.c:50: Warning: assertion got status unknown. [eva] tests/float/special_floats.c:51: Frama_C_show_each_neg_infinity: {-inf} [eva:alarm] tests/float/special_floats.c:54: Warning: assertion got status unknown. [eva:alarm] tests/float/special_floats.c:55: Warning: assertion got status unknown. [eva] tests/float/special_floats.c:56: Frama_C_show_each_finite_nan: [-1.79769313486e+308 .. 1.79769313486e+308] ∪ {NaN} [eva:alarm] tests/float/special_floats.c:59: Warning: assertion got status unknown. [eva] tests/float/special_floats.c:60: Frama_C_show_each_top: [-inf .. inf] ∪ {NaN} [eva:alarm] tests/float/special_floats.c:63: Warning: assertion got status unknown. [eva] tests/float/special_floats.c:64: Frama_C_show_each_pos_infinity: {inf;NaN} [eva] Recording results for is_infinite [eva] Done for function is_infinite [eva] computing for function macro_infinity <- main. Called from tests/float/special_floats.c:96. [eva] tests/float/special_floats.c:74: Frama_C_show_each_infinity: {inf} [eva] tests/float/special_floats.c:75: assertion got status valid. [eva] Recording results for macro_infinity [eva] Done for function macro_infinity [eva] computing for function macro_nan <- main. Called from tests/float/special_floats.c:97. [eva] tests/float/special_floats.c:84: Frama_C_show_each_nan: NaN [eva] tests/float/special_floats.c:85: assertion got status valid. [eva] tests/float/special_floats.c:86: assertion got status valid. [eva] tests/float/special_floats.c:87: assertion got status valid. [eva] Recording results for macro_nan [eva] Done for function macro_nan [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function is_infinite: zero ∈ {-0.} inf ∈ {inf} nan_0 ∈ NaN d ∈ [-inf .. inf] ∪ {NaN} [eva:final-states] Values at end of function macro_infinity: infinity_f ∈ {inf} infinity_d ∈ {inf} [eva:final-states] Values at end of function macro_nan: nan_f ∈ NaN [eva:final-states] Values at end of function nan_comparisons: n ∈ NaN d ∈ [-10. .. 10.] eq1 ∈ {0} comp1 ∈ {0; 1} ne1 ∈ {1} eq2 ∈ {0} comp2 ∈ {0; 1} ne2 ∈ {1} [eva:final-states] Values at end of function main: frama-c-20.0-Calcium/tests/float/oracle/sqrt.0.res.oracle0000666000000000000000000000373613571573400020046 0ustar [kernel] Parsing tests/float/sqrt.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/float/sqrt.c:11: Call to builtin sqrt [eva] tests/float/sqrt.c:11: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/float/sqrt.c:11: function sqrt: precondition 'arg_positive' got status valid. [eva] tests/float/sqrt.c:12: assertion got status valid. [eva] tests/float/sqrt.c:14: assertion got status valid. [eva] tests/float/sqrt.c:19: Frama_C_dump_each: # Cvalue domain: __fc_errno ∈ [--..--] k ∈ UNINITIALIZED i ∈ {-0.} j ∈ {-0.} r ∈ UNINITIALIZED p ∈ {{ (unsigned long long *)&j }} c[0..7] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/float/sqrt.c:23: Frama_C_dump_each: # Cvalue domain: __fc_errno ∈ [--..--] k ∈ UNINITIALIZED i ∈ {-0.} j ∈ {-0.} r ∈ {-0x8000000000000000} p ∈ {{ (unsigned long long *)&j }} c[0..7] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/float/sqrt.c:25: Frama_C_show_each_long_long: {-0x8000000000000000} [eva] tests/float/sqrt.c:26: Frama_C_show_each_double: {-0.} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: k ∈ {8} i ∈ {-0.} j ∈ {-0.} r ∈ {-0x8000000000000000} p ∈ {{ (unsigned long long *)&j }} c[0..6] ∈ {0} [7] ∈ {128} [from] Computing for function main [from] Computing for function sqrt <-main [from] Done for function sqrt [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function sqrt: \result FROM x [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: k; i; j; r; p; c[0..7] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/float/oracle/sqrt.1.res.oracle0000666000000000000000000000373613571573400020047 0ustar [kernel] Parsing tests/float/sqrt.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/float/sqrt.c:11: Call to builtin sqrt [eva] tests/float/sqrt.c:11: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/float/sqrt.c:11: function sqrt: precondition 'arg_positive' got status valid. [eva] tests/float/sqrt.c:12: assertion got status valid. [eva] tests/float/sqrt.c:14: assertion got status valid. [eva] tests/float/sqrt.c:19: Frama_C_dump_each: # Cvalue domain: __fc_errno ∈ [--..--] k ∈ UNINITIALIZED i ∈ {-0.} j ∈ {-0.} r ∈ UNINITIALIZED p ∈ {{ (unsigned long long *)&j }} c[0..7] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/float/sqrt.c:23: Frama_C_dump_each: # Cvalue domain: __fc_errno ∈ [--..--] k ∈ UNINITIALIZED i ∈ {-0.} j ∈ {-0.} r ∈ {-0x8000000000000000} p ∈ {{ (unsigned long long *)&j }} c[0..7] ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/float/sqrt.c:25: Frama_C_show_each_long_long: {-0x8000000000000000} [eva] tests/float/sqrt.c:26: Frama_C_show_each_double: {-0.} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: k ∈ {8} i ∈ {-0.} j ∈ {-0.} r ∈ {-0x8000000000000000} p ∈ {{ (unsigned long long *)&j }} c[0] ∈ {128} [1..7] ∈ {0} [from] Computing for function main [from] Computing for function sqrt <-main [from] Done for function sqrt [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function sqrt: \result FROM x [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: k; i; j; r; p; c[0..7] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/float/oracle/uninit.res.oracle0000666000000000000000000000174413571573400020222 0ustar [kernel] Parsing tests/float/uninit.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/float/uninit.i:5: Warning: accessing uninitialized left-value. assert \initialized(&f); [eva] Recording results for main [eva] done for function main [eva] tests/float/uninit.i:5: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: f ∈ UNINITIALIZED __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: f; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/float/oracle/widen.0.res.oracle0000666000000000000000000000453313571573400020157 0ustar [kernel] Parsing tests/float/widen.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/float/widen.c:50. [eva] tests/float/widen.c:13: starting to merge loop iterations [eva:alarm] tests/float/widen.c:14: Warning: non-finite double value. assert \is_finite((double)(max * 2.)); [eva] tests/float/widen.c:16: starting to merge loop iterations [eva] tests/float/widen.c:24: Frama_C_show_each_double_inf: [1. .. 1.79769313486e+308] [eva] tests/float/widen.c:25: starting to merge loop iterations [eva:alarm] tests/float/widen.c:27: Warning: non-finite float value. assert \is_finite((float)max); [eva] tests/float/widen.c:34: Frama_C_show_each_float_inf: [1. .. 3.40282346639e+38] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/float/widen.c:51. [eva] tests/float/widen.c:40: starting to merge loop iterations [eva] tests/float/widen.c:45: Frama_C_show_each: [-0. .. 0.] [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: max ∈ [1. .. 1.79769313486e+308] f ∈ [1. .. 3.40282346639e+38] d ∈ [1. .. 1.79769313486e+308] [eva:final-states] Values at end of function main2: d ∈ [-0. .. 0.] [eva:final-states] Values at end of function main: [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: max; f; d [inout] Inputs for function main1: rand [inout] Out (internal) for function main2: d [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: rand frama-c-20.0-Calcium/tests/float/oracle/widen.1.res.oracle0000666000000000000000000000406513571573400020160 0ustar [kernel] Parsing tests/float/widen.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/float/widen.c:50. [eva] tests/float/widen.c:13: starting to merge loop iterations [eva] tests/float/widen.c:16: starting to merge loop iterations [eva] tests/float/widen.c:24: Frama_C_show_each_double_inf: [1. .. inf] [eva] tests/float/widen.c:25: starting to merge loop iterations [eva] tests/float/widen.c:34: Frama_C_show_each_float_inf: [1. .. inf] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/float/widen.c:51. [eva] tests/float/widen.c:40: starting to merge loop iterations [eva] tests/float/widen.c:45: Frama_C_show_each: [-0. .. 0.] [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: max ∈ [1. .. inf] f ∈ [1. .. inf] d ∈ [1. .. inf] [eva:final-states] Values at end of function main2: d ∈ [-0. .. 0.] [eva:final-states] Values at end of function main: [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: max; f; d [inout] Inputs for function main1: rand [inout] Out (internal) for function main2: d [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: rand frama-c-20.0-Calcium/tests/float/oracle/zero.res.oracle0000666000000000000000000000447213571573400017674 0ustar [kernel] Parsing tests/float/zero.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/float/zero.i:55. [eva:alarm] tests/float/zero.i:55: Warning: function main1: precondition got status unknown. [eva] tests/float/zero.i:10: Frama_C_show_each: {1} [eva] tests/float/zero.i:17: Frama_C_show_each: {1} [eva] tests/float/zero.i:23: Frama_C_show_each_1: [1.40129846432e-45 .. 3.40282346639e+38] [eva] tests/float/zero.i:25: Frama_C_show_each_2: [-0. .. 0.] [eva] tests/float/zero.i:29: Frama_C_show_each_3: [-3.40282346639e+38 .. -1.40129846432e-45] [eva] tests/float/zero.i:31: Frama_C_show_each_4: [-0. .. 0.] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function equality_between_zeros <- main. Called from tests/float/zero.i:56. [eva] Recording results for equality_between_zeros [eva] Done for function equality_between_zeros [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function equality_between_zeros: f1 ∈ [0. .. 10.] f2 ∈ [-0. .. 10.] r ∈ [-0. .. 10.] [eva:final-states] Values at end of function main1: f ∈ {-0.} i1 ∈ {1} i2 ∈ {1} i3 ∈ {0} [eva:final-states] Values at end of function main: [from] Computing for function equality_between_zeros [from] Done for function equality_between_zeros [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function equality_between_zeros: NO EFFECTS [from] Function main1: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function equality_between_zeros: f1; tmp; f2; tmp_0; r [inout] Inputs for function equality_between_zeros: rand [inout] Out (internal) for function main1: f; i1; i2; i3 [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: rand frama-c-20.0-Calcium/tests/float/parse.i0000666000000000000000000000137313571573400014752 0ustar /* run.config* STDOPT: #"-warn-decimal-float all -float-hex" */ volatile v; int main() { if (v) { double d = 0.0E9999999999999999999; Frama_C_show_each(d, "reached"); } if (v) { double d = 0.0E-9999999999999999999; Frama_C_show_each(d, "reached"); } if (v) { double d1 = 0e500; double d2 = 0.0e500; Frama_C_show_each(d1, d2, "reached"); } if (v) { double d = 0.00000000000000000000000000000000000000001e310; Frama_C_show_each(d, "reached"); } if (v) { double d = 0.0000001E9999999999999999999; Frama_C_show_each("unreached"); } // Shows several issues with long double in Eva, but should at least not crash. if (v) { long double l = 0x1p32767L; int long_double = (int)l; } } frama-c-20.0-Calcium/tests/float/precise_cos_sin.c0000666000000000000000000000065413571573400017002 0ustar /* run.config* OPT: -eva @EVA_CONFIG@ -slevel 1000 -journal-disable -float-normal */ #include <__fc_builtin.h> #include float Frama_C_float_interval(float, float); int main(){ float f = Frama_C_float_interval(-3.1875, -3.1875+0.25); while (f <= 3.1875) { //Frama_C_show_each_f(f); Frama_C_show_each_s((float)sin(f)); Frama_C_show_each_c((float)cos(f)); f += 0.25; } return 0; } frama-c-20.0-Calcium/tests/float/round10d.i0000666000000000000000000000050213571573400015265 0ustar /* run.config* OPT: -eva @EVA_CONFIG@ -float-normal -journal-disable -no-results */ int main() { double t=0.0; int i; Frama_C_show_each_dixieme(0.1); //@ loop pragma UNROLL 10; for(i=0;i<10;i++) { t = t + 0.1; Frama_C_show_each_t(t); } //@ assert t>=1.0; return 0; } frama-c-20.0-Calcium/tests/float/s.i0000666000000000000000000003040013571573400014073 0ustar /* run.config* STDOPT: #"-float-hex" */ typedef float T1; typedef int T2; typedef int T3; extern int F1(int G1 ) ; extern int F2(int G2 ) ; int const G3 = (int const )42; extern int F3(int G4 ) ; T3 G5[64] ; int const G6 = (int const )42; int G7 ; T2 G8 ; T1 const G9[64] = {(T1 const )2.000f, (T1 const )1.882f, (T1 const )1.778f, (T1 const )1.684f, (T1 const )1.600f, (T1 const )1.523f, (T1 const )1.455f, (T1 const )1.391f, (T1 const )1.333f, (T1 const )1.280f, (T1 const )1.231f, (T1 const )1.185f, (T1 const )1.143f, (T1 const )1.063f, (T1 const )1.000f, (T1 const )0.944f, (T1 const )0.895f, (T1 const )0.850f, (T1 const )0.810f, (T1 const )0.773f, (T1 const )0.739f, (T1 const )0.708f, (T1 const )0.680f, (T1 const )0.654f, (T1 const )0.630f, (T1 const )0.607f, (T1 const )0.586f, (T1 const )0.567f, (T1 const )0.548f, (T1 const )0.500f, (T1 const )0.471f, (T1 const )0.444f, (T1 const )0.421f, (T1 const )0.400f, (T1 const )0.381f, (T1 const )0.364f, (T1 const )0.348f, (T1 const )0.333f, (T1 const )0.320f, (T1 const )0.308f, (T1 const )0.296f, (T1 const )0.286f, (T1 const )0.276f, (T1 const )0.267f, (T1 const )0.258f, (T1 const )0.250f, (T1 const )0.236f, (T1 const )0.222f, (T1 const )0.211f, (T1 const )0.200f, (T1 const )0.190f, (T1 const )0.182f, (T1 const )0.174f, (T1 const )0.167f, (T1 const )0.160f, (T1 const )0.154f, (T1 const )0.148f, (T1 const )0.143f, (T1 const )0.138f, (T1 const )0.133f, (T1 const )0.129f, (T1 const )0.125f, (T1 const )0.118f, (T1 const )0.111f}; T1 const G10[64] = {(T1 const )0.0510143148127383f, (T1 const )0.0526807976019492f, (T1 const )0.0547630669950585f, (T1 const )0.0564281924367408f, (T1 const )0.0585087059708387f, (T1 const )0.0605881929148253f, (T1 const )0.0630821707769080f, (T1 const )0.0655745547964065f, (T1 const )0.0680652820004121f, (T1 const )0.0713835655737245f, (T1 const )0.0742844385649674f, (T1 const )0.0780103647018580f, (T1 const )0.0817318560546706f, (T1 const )0.0862740143728233f, (T1 const )0.0908088461410527f, (T1 const )0.0961582204249914f, (T1 const )0.1023163627594810f, (T1 const )0.1055941606958780f, (T1 const )0.1088672156067600f, (T1 const )0.1125435499383810f, (T1 const )0.1166208530287330f, (T1 const )0.1210964219228140f, (T1 const )0.1255617070832910f, (T1 const )0.1304207531449480f, (T1 const )0.1356698301501220f, (T1 const )0.1417064222370730f, (T1 const )0.1481207659913060f, (T1 const )0.1549068205428340f, (T1 const )0.1624539893402380f, (T1 const )0.1707476333220120f, (T1 const )0.1797704190221740f, (T1 const )0.1902769765139430f, (T1 const )0.2014532178568310f, (T1 const )0.2079499479102800f, (T1 const )0.2144044999107600f, (T1 const )0.2215668881520150f, (T1 const )0.2290455646566350f, (T1 const )0.2371977623669650f, (T1 const )0.2452693886855440f, (T1 const )0.2543404121628250f, (T1 const )0.2640116929021380f, (T1 const )0.2745989285199270f, (T1 const )0.2860443073244380f, (T1 const )0.2982805530233570f, (T1 const )0.3112299993821370f, (T1 const )0.3254401125978740f, (T1 const )0.3407438063507600f, (T1 const )0.3572363398164020f, (T1 const )0.3749169970825380f, (T1 const )0.3841864461394160f, (T1 const )0.3939193988832260f, (T1 const )0.4037685876851210f, (T1 const )0.4141279920488020f, (T1 const )0.4243935880669410f, (T1 const )0.4350918773347630f, (T1 const )0.4457881609076350f, (T1 const )0.4562601664070490f, (T1 const )0.4665646755216170f, (T1 const )0.4764261613996570f, (T1 const )0.4852153448066030f, (T1 const )0.4927158273036620f, (T1 const )0.4979548345880140f, (T1 const )0.4999998245403760f, (T1 const )0.4973478192101480f}; T1 const G11[64] = {(T1 const )1.98956292560627f, (T1 const )1.98886795364206f, (T1 const )1.98796783271076f, (T1 const )1.98722262104002f, (T1 const )1.98625972652367f, (T1 const )1.98526198121786f, (T1 const )1.98401870850080f, (T1 const )1.98272530730105f, (T1 const )1.98138181029787f, (T1 const )1.97951261300748f, (T1 const )1.97780412452634f, (T1 const )1.97550756211798f, (T1 const )1.97309869476763f, (T1 const )1.97000221093885f, (T1 const )1.96673843085462f, (T1 const )1.96266592835235f, (T1 const )1.95767765236944f, (T1 const )1.95489078253260f, (T1 const )1.95201610389272f, (T1 const )1.94867729238996f, (T1 const )1.94483758350707f, (T1 const )1.94045626221254f, (T1 const )1.93591015375954f, (T1 const )1.93076327766655f, (T1 const )1.92496731270757f, (T1 const )1.91799599539423f, (T1 const )1.91022611722130f, (T1 const )1.90159460221914f, (T1 const )1.89149126922623f, (T1 const )1.87976698860229f, (T1 const )1.86625870208647f, (T1 const )1.84951743850643f, (T1 const )1.83048234524184f, (T1 const )1.81882080113072f, (T1 const )1.80679034940091f, (T1 const )1.79291099198876f, (T1 const )1.77781047048834f, (T1 const )1.76062362373384f, (T1 const )1.74283872793243f, (T1 const )1.72191035650916f, (T1 const )1.69845965986100f, (T1 const )1.67138471193539f, (T1 const )1.64038363438451f, (T1 const )1.60513531735156f, (T1 const )1.56530322933083f, (T1 const )1.51836086942351f, (T1 const )1.46365929605818f, (T1 const )1.39932668102673f, (T1 const )1.32325202617558f, (T1 const )1.28000484125813f, (T1 const )1.23176301086518f, (T1 const )1.17963335048658f, (T1 const )1.12069982565629f, (T1 const )1.05746929909226f, (T1 const )0.98545468309658f, (T1 const )0.90574093951495f, (T1 const )0.81806269246518f, (T1 const )0.71908167608869f, (T1 const )0.60686885217797f, (T1 const )0.48275988506435f, (T1 const )0.34014381721778f, (T1 const )0.18070894655987f, (T1 const )(- 0.00167551588592f), (T1 const )(- 0.20572395978728f)}; T1 const G12[32] = {(T1 const )0.666666666666667f, (T1 const )0.592592592592593f, (T1 const )0.533333333333333f, (T1 const )0.484848484848485f, (T1 const )0.444444444444444f, (T1 const )0.410256410256410f, (T1 const )0.380952380952381f, (T1 const )0.355555555555556f, (T1 const )0.333333333333333f, (T1 const )0.296296296296296f, (T1 const )0.266666666666667f, (T1 const )0.242424242424242f, (T1 const )0.222222222222222f, (T1 const )0.205128205128205f, (T1 const )0.190476190476191f, (T1 const )0.177777777777778f, (T1 const )0.166666666666667f, (T1 const )0.148148148148148f, (T1 const )0.133333333333333f, (T1 const )0.121212121212121f, (T1 const )0.111111111111111f, (T1 const )0.102564102564103f, (T1 const )0.095238095238095f, (T1 const )0.088888888888889f, (T1 const )0.083333333333333f, (T1 const )0.074074074074074f, (T1 const )0.066666666666667f, (T1 const )0.060606060606061f, (T1 const )0.055555555555556f, (T1 const )0.051282051282051f, (T1 const )0.047619047619048f, (T1 const )0.044444444444445f}; static T2 G13 ; static T1 G14 ; static T1 G15 ; static T1 G16 ; static T1 G17 ; static T1 G18 ; static T1 G19 ; void F4(void) { T1 V1 ; T1 V2 ; T1 V3 ; int V4 ; int V5 ; int V6 ; int V7 ; {{V1 = (float )0.0; V4 = F1(G13); G16 = (float )G9[V4];} {V5 = F2(G13); /* JLCo G14 = (float )(G10[V5] / (T1 const )((float )G3)); G14 = (float )(G10[V5] / (T1 const )G3); */ G14 = (float )(G10[V5] / G3); } {V6 = F2(G13); G15 = (float )G11[V6];} {V7 = F3(G13); G17 = (float )G12[V7];} {G18 = (float )(1.0 / ((double )G14 + 1.0)); V2 = G15 * G18;} {V3 = (float )(((double )G14 - 1.0) * (double )G18); G19 = (G16 * G14) * G18;} return;} } int main(void) { int V8 ; {F4(); V8 = 0; return (V8);} } frama-c-20.0-Calcium/tests/float/some.c0000666000000000000000000000071013571573400014567 0ustar /* run.config* OPT: -eva-show-slevel 10 -slevel 100 -eva @EVA_CONFIG@ -cpp-extra-args="-DFLOAT=double -DN=55" -float-normal -journal-disable -no-results OPT: -slevel 100 -eva @EVA_CONFIG@ -cpp-extra-args="-DFLOAT=float -DN=26" -float-normal -journal-disable -no-results */ FLOAT t[N] = { 1. } ; FLOAT y = 0.5; int main(){ int i; for (i=1 ; i /* Tests the logical predicates \is_plus_infinite & co. */ void is_infinite () { /* Tests the evaluation on singletons. */ double zero = -0.; /*@ check true: \is_finite(zero); */ /*@ check false: !\is_finite(zero); */ /*@ check false: \is_plus_infinity(zero); */ /*@ check false: \is_minus_infinity(zero); */ double inf = INFINITY; /*@ check false: \is_finite(inf); */ /*@ check true: !\is_finite(inf); */ /*@ check true: \is_plus_infinity(inf); */ /*@ check false: \is_minus_infinity(inf); */ double nan = NAN; /*@ check false: \is_finite(nan); */ /*@ check true: !\is_finite(nan); */ /*@ check false: \is_plus_infinity(nan); */ /*@ check false: \is_minus_infinity(nan); */ double d = any_double; /* Tests the reduction by assertions. */ if (rand) { /*@ assert \is_plus_infinity(d); */ Frama_C_show_each_pos_infinity(d); } if (rand) { /*@ assert \is_minus_infinity(d); */ Frama_C_show_each_neg_infinity(d); } if (rand) { /*@ assert !\is_plus_infinity(d); */ /*@ assert !\is_minus_infinity(d); */ Frama_C_show_each_finite_nan(d); } if (rand) { /*@ assert !\is_finite(d); */ Frama_C_show_each_top(d); } if (d > 0.) { /*@ assert !\is_finite(d); */ Frama_C_show_each_pos_infinity(d); } } float global_infinity = INFINITY; float global_nan = NAN; /* Tests the C and logic macros INFINITY and HUGE_VAL. */ void macro_infinity () { float infinity_f = INFINITY; Frama_C_show_each_infinity(infinity_f); /*@ assert \eq_float(infinity_f,INFINITY); @*/ double infinity_d = HUGE_VAL; if(INFINITY != infinity_d) /*@ assert \false; @*/; } /* Tests the C and logic macros NAN. */ void macro_nan () { float nan_f = NAN; Frama_C_show_each_nan(nan_f); /*@ assert \is_NaN(nan_f); @*/ /*@ assert \ne_float(nan_f,NAN); @*/ /*@ assert \subset({nan_f},{NAN}); @*/ if(NAN == nan_f) /*@ assert \false; @*/; } void main () { nan_comparisons (); is_infinite (); macro_infinity (); macro_nan (); } frama-c-20.0-Calcium/tests/float/sqrt.c0000666000000000000000000000103313571573400014614 0ustar /* run.config* STDOPT: #"-slevel 10 -big-ints-hex 257" STDOPT: #"-slevel 10 -big-ints-hex 257 -machdep ppc_32" */ #include void main() { int k; double i = -(double)0; double j = sqrt (i); //@ assert i == j; //@ assert sizeof(long long) == sizeof(double); long long r; unsigned long long *p = &j; unsigned int c[8]; Frama_C_dump_each(); r = *p; Frama_C_dump_each(); Frama_C_show_each_long_long(r); Frama_C_show_each_double(j); for (k=0; k<8; k++) c[k] = ((unsigned char*)&i)[k]; } frama-c-20.0-Calcium/tests/float/uninit.i0000666000000000000000000000007513571573400015144 0ustar int main(int c){ float f; if (c) f++; return 0; } frama-c-20.0-Calcium/tests/float/widen.c0000666000000000000000000000206513571573400014737 0ustar /* run.config* STDOPT: #"-warn-special-float non-finite -wlevel 3" STDOPT: #"-warn-special-float none -wlevel 3" */ volatile int rand; /* Tests the widening near infinity. See gitlab issue #493. */ void main1 () { double max = 1.; float f = 1.; double d = 1.; while (rand) { max *= 2.; } while (rand) { if (d >= 3.) d = max; else d += 1.; } /* In -warn-special-float non-finite, d should not reach infinity. In -warn-special-float none, d should reach infinity. */ Frama_C_show_each_double_inf(d); while (rand) { if (f >= 3.) f = max; else f += 1.; } /* In -warn-special-float non-finite, f should not reach infinity. In -warn-special-float none, f should reach infinity. In no case f should have 64 bits finite bounds. */ Frama_C_show_each_float_inf(f); } /* Tests the widening near -0. */ void main2 () { double d = 3.; while (d > 0.) { d -= 1.; d = (d <= 0. ? -0. : d); } /* d must contain -0.0. */ Frama_C_show_each(d); } void main () { main1(); main2(); } frama-c-20.0-Calcium/tests/float/zero.i0000666000000000000000000000210713571573400014613 0ustar /* run.config* */ volatile int rand; //@ requires f1 >= 0. && f2 <= 0.; void main1(float f1, float f2) { float f = 0.; if (f == -0.) { Frama_C_show_each(1); } else { Frama_C_show_each(2); } f = -0.; if (f == 0.) { Frama_C_show_each(1); } else { Frama_C_show_each(2); } if (f1 != 0) { Frama_C_show_each_1(f1); } else { Frama_C_show_each_2(f1); } if (f2 != 0) { Frama_C_show_each_3(f2); } else { Frama_C_show_each_4(f2); } int i1 = ! (0. + 0.); int i2 = ! -0.; int i3 = ! (1. + 0.); // For comparison } /* Test for the equality domain: 0. and -0. are equal values, and this must not lead to unsound reductions. */ void equality_between_zeros () { /* Bypass the heuristics of the equality domain that avoids retaining equality between singletons. */ float f1 = rand ? 0. : 10.; float f2 = rand ? -0. : 10.; float r = 0.; /* Despite the equality, -0. must still be in [f2], and so in [r]. */ if (f1 == f2) r = f2; } void main (float f1, float f2) { main1(f1, f2); equality_between_zeros(); } frama-c-20.0-Calcium/tests/idct/0000777000000000000000000000000013571573400013300 5ustar frama-c-20.0-Calcium/tests/idct/.gitignore0000666000000000000000000000001113571573400015260 0ustar /oracle_*frama-c-20.0-Calcium/tests/idct/diff_apron0000666000000000000000000027546013571573400015350 0ustar diff tests/idct/oracle/ieee_1180_1990.res.oracle tests/idct/oracle_apron/ieee_1180_1990.res.oracle 147,158c147,170 < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand --- > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand 413,431c425,462 < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] Recording results for IEEE_1180_1990_mkbk < [eva] Done for function IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:258: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:259: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct --- > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:258. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:259. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:260. > [eva] Recording results for idct > [eva] Done for function idct 456,460c487,498 < [eva] tests/idct/ieee_1180_1990.c:282: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:283: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct --- > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:282. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:283. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:284. > [eva] Recording results for idct > [eva] Done for function idct 487,505c525,562 < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] Recording results for IEEE_1180_1990_mkbk < [eva] Done for function IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:304: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:305: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct --- > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:304. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:305. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:306. > [eva] Recording results for idct > [eva] Done for function idct 530,534c587,598 < [eva] tests/idct/ieee_1180_1990.c:328: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:329: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct --- > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:328. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:329. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:330. > [eva] Recording results for idct > [eva] Done for function idct 558,571c622,1921 < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand < [eva] tests/idct/ieee_1180_1990.c:85: < Reusing old results for call to IEEE_1180_1990_rand --- > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:212. > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:213. > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:214. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:236. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:237. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:238. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:257. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:258. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:259. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:260. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:282. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:283. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:284. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:303. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:304. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:305. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:306. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:328. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:329. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:330. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:211. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:212. > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:213. > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:214. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:236. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:237. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:238. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:257. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:258. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:259. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:260. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:282. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:283. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:284. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:303. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:304. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:305. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:306. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:328. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:329. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:330. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:211. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:212. > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:213. > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:214. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:236. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:237. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:238. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:257. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:258. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:259. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:260. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:282. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:283. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:284. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:303. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:304. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:305. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:306. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:328. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:329. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:330. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:211. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:212. > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:213. > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:214. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:236. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:237. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:238. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:257. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:258. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:259. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:260. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:282. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:283. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:284. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:303. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:304. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:305. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:306. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:328. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:329. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:330. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:211. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:212. > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:213. > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:214. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:236. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:237. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:238. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:257. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:258. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:259. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:260. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:282. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:283. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:284. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:303. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:304. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:305. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:306. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:328. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:329. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:330. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:211. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:212. > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:213. > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:214. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:236. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:237. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:238. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:257. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:258. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:259. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:260. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:282. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:283. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:284. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:303. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:304. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:305. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:306. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:328. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:329. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:330. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:211. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand 626,871c1976,2103 < [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:236: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:237: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:257: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:258: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:259: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:282: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:283: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:303: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:304: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:305: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:328: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:329: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:211: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:212: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:213: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:236: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:237: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:257: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:258: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:259: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:282: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:283: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:303: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:304: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:305: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:328: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:329: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:211: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:212: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:213: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:236: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:237: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:257: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:258: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:259: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:282: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:283: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:303: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:304: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:305: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:328: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:329: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:211: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:212: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:213: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:236: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:237: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:257: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:258: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:259: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:282: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:283: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:303: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:304: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:305: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:328: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:329: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:211: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:212: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:213: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:236: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:237: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:257: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:258: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:259: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:282: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:283: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:303: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:304: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:305: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:328: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:329: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:211: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:212: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:213: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:236: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:237: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:257: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:258: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:259: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:282: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:283: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:303: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:304: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:305: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:328: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:329: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:211: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:212: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:213: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:236: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:237: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:257: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:258: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:259: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:282: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:283: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:303: < Reusing old results for call to IEEE_1180_1990_mkbk < [eva] tests/idct/ieee_1180_1990.c:304: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:305: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct < [eva] tests/idct/ieee_1180_1990.c:328: < Reusing old results for call to IEEE_1180_1990_dctf < [eva] tests/idct/ieee_1180_1990.c:329: < Reusing old results for call to IEEE_1180_1990_idctf < [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct --- > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:214. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:236. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:237. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:238. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:257. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:258. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:259. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:260. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:282. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:283. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:284. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:303. > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. > Called from tests/idct/ieee_1180_1990.c:85. > [eva] Recording results for IEEE_1180_1990_rand > [eva] Done for function IEEE_1180_1990_rand > [eva] Recording results for IEEE_1180_1990_mkbk > [eva] Done for function IEEE_1180_1990_mkbk > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:304. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:305. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:306. > [eva] Recording results for idct > [eva] Done for function idct > [eva] computing for function IEEE_1180_1990_dctf <- main. > Called from tests/idct/ieee_1180_1990.c:328. > [eva] Recording results for IEEE_1180_1990_dctf > [eva] Done for function IEEE_1180_1990_dctf > [eva] computing for function IEEE_1180_1990_idctf <- main. > Called from tests/idct/ieee_1180_1990.c:329. > [eva] Recording results for IEEE_1180_1990_idctf > [eva] Done for function IEEE_1180_1990_idctf > [eva] computing for function idct <- main. > Called from tests/idct/ieee_1180_1990.c:330. > [eva] Recording results for idct > [eva] Done for function idct frama-c-20.0-Calcium/tests/idct/diff_bitwise0000666000000000000000000000000013571573400015647 0ustar frama-c-20.0-Calcium/tests/idct/diff_equalities0000666000000000000000000001304713571573400016365 0ustar diff tests/idct/oracle/ieee_1180_1990.res.oracle tests/idct/oracle_equalities/ieee_1180_1990.res.oracle 356a357,358 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:219: Warning: > 2's complement assumed for overflow 360a363,364 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:220: Warning: > 2's complement assumed for overflow 366,367d369 < [eva:signed-overflow] tests/idct/ieee_1180_1990.c:219: Warning: < 2's complement assumed for overflow 392a395,396 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:243: Warning: > 2's complement assumed for overflow 396a401,402 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:244: Warning: > 2's complement assumed for overflow 402,403d407 < [eva:signed-overflow] tests/idct/ieee_1180_1990.c:243: Warning: < 2's complement assumed for overflow 424a429,436 > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand 437a450,451 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:265: Warning: > 2's complement assumed for overflow 441a456,457 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:266: Warning: > 2's complement assumed for overflow 447,448d462 < [eva:signed-overflow] tests/idct/ieee_1180_1990.c:265: Warning: < 2's complement assumed for overflow 466a481,482 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:289: Warning: > 2's complement assumed for overflow 470a487,488 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:290: Warning: > 2's complement assumed for overflow 476,477d493 < [eva:signed-overflow] tests/idct/ieee_1180_1990.c:289: Warning: < 2's complement assumed for overflow 498a515,522 > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand 511a536,537 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:311: Warning: > 2's complement assumed for overflow 515a542,543 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:312: Warning: > 2's complement assumed for overflow 521,522d548 < [eva:signed-overflow] tests/idct/ieee_1180_1990.c:311: Warning: < 2's complement assumed for overflow 540a567,568 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:335: Warning: > 2's complement assumed for overflow 544a573,574 > [eva:signed-overflow] tests/idct/ieee_1180_1990.c:336: Warning: > 2's complement assumed for overflow 550,551d579 < [eva:signed-overflow] tests/idct/ieee_1180_1990.c:335: Warning: < 2's complement assumed for overflow 571a600,607 > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand 579a616,633 > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt 581a636,637 > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt 583a640,641 > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt 605a664,677 > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt 607a680,681 > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt 609a684,689 > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt 980c1060 < by the Eva analyzer: 0 errors 42 warnings --- > by the Eva analyzer: 0 errors 48 warnings frama-c-20.0-Calcium/tests/idct/diff_gauges0000666000000000000000000000046613571573400015474 0ustar diff tests/idct/oracle/ieee_1180_1990.res.oracle tests/idct/oracle_gauges/ieee_1180_1990.res.oracle 579a580,581 > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt 605a608,609 > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt frama-c-20.0-Calcium/tests/idct/diff_octagons0000666000000000000000000000651413571573400016036 0ustar diff tests/idct/oracle/ieee_1180_1990.res.oracle tests/idct/oracle_octagons/ieee_1180_1990.res.oracle 424a425,432 > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand 498a507,514 > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand 571a588,595 > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand > [eva] tests/idct/ieee_1180_1990.c:85: > Reusing old results for call to IEEE_1180_1990_rand 579a604,617 > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt 581a620,621 > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt 583a624,629 > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:101: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:100: > Call to builtin Frama_C_sqrt for function sqrt 605a652,661 > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt 607a664,665 > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt 609a668,677 > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt > [eva] tests/idct/ieee_1180_1990.c:141: > Call to builtin Frama_C_cos for function cos > [eva] tests/idct/ieee_1180_1990.c:140: > Call to builtin Frama_C_sqrt for function sqrt frama-c-20.0-Calcium/tests/idct/diff_symblocs0000666000000000000000000000000013571573400016034 0ustar frama-c-20.0-Calcium/tests/idct/idct.c0000666000000000000000000001656613571573400014405 0ustar /* run.config* GCC: DONTRUN: */ /* IDCT: a fixed point IDCT implementation. * Copyright (C) 2001 Renaud Pacalet * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * Renaud Pacalet * Departement Comunications et Electronique, * Ecole Nationale Superieure des Telecommunications * 46, Rue Barrault 75634 Paris Cedex 13 * Tel : +33 1 45 81 78 08 * Fax : +33 1 45 80 40 36 * Email : pacalet@enst.fr * * The following code implements a 2-steps IDCT. The * computations are done in finite accuracy, controlled by the 3 macros * NBC1, NBI, NBC2. It behaves exactly the same as our hardware * distributed arithmetics based architecture. The default values for * NBC1, NBI and NBC2 (14, 14 and 14) are a kind of best choice if you * need to pass the IEEE 1180-1990 requirements but want the different * dynamics to be as small as possible. You can play with them but be * aware that accuracy strongly depends on them. * * The input of the function should be a 8x8 matrix of integers in the * range of -2048 ... 2047 (2's complement coded on 12 bits). * The output will be a 8x8 matrix of integers in the * range -256 ... 255. */ #include "math.h" #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #define TH M_PI/16.0 #define NBC1 14 /* Number of bits used to represent the first pass hard-coded cosines * matrix. */ #define NBI 14 /* Number of bits kept on partial results after first pass. This will * be the word length of the transposition RAM. */ #define NBC2 14 /* Number of bits used to represent the second pass hard-coded cosines * matrix (usually the same as NBC1 but...). */ void idct (long m1[8][8], long m2[8][8]) /* m1 is the input 8x8 matrix of DCT coefficients. m2 will hold the * IDCT result. */ { long i, j, k, tmp1[8][8], tmp2[8][8]; /* Loops indexes and temporary matrices. */ double ftmp1, ftmp2; /* Temporary variables used for rounding purpose when computing the * hard-coded cosines matrices. */ static int init = 1; /* A simple flag that tells it's the first time the function is called. * When init is true we will compute the hard-coded cosines matrices for * pass one and pass two, then reset init and compute the IDCT. If not * we will only compute the IDCT. */ static long mc1[8][8], mc2[8][8]; /* hard-coded cosines matrices. */ if (init) { /* If init (it's the first time the function is called), let's compute * the hard-coded cosines matrices for pass one and pass two. */ for (i = 0; i < 8; i++) for (j = 0; j < 8; j++) { ftmp1 = ((j == 0) ? 0.5 / sqrt (2.0) : 0.5) * cos ((2.0 * i + 1.0) * j * TH); ftmp2 = ftmp1; /* The well known formula. The max absolute value for ftmp1 and ftmp2 is 0.5. */ ftmp1 *= (1 << NBC1); /* Multiply the cosine coefficient by 2^NBC1. The max absolute value for * ftmp1 is 2^(NBC1-1). */ if (ftmp1 < 0) ftmp1 -= 0.5; else ftmp1 += 0.5; /* For symetrical rounding. */ mc1[i][j] = ftmp1; /* The rounding itself. mc1 * contains now the cosines reprensented in 2's complement form, fixed * point on NBC1 bits. */ ftmp2 *= (1 << NBC2); /* Multiply the cosine coefficient by 2^NBC2. The max absolute value for * ftmp2 is 2^(NBC2-1). */ if (ftmp2 < 0) ftmp2 -= 0.5; else ftmp2 += 0.5; /* For symetrical rounding. */ mc2[i][j] = ftmp2; /* The rounding itself. mc2 * contains now the cosines reprensented in 2's complement form, fixed * point on NBC2 bits. */ } init = 0; /* Reset the init flag. On the next call mc1 and mc2 will not be * computed anymore. */ } /* Then the first pass. */ for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) { for(k = 0, tmp1[i][j] = 0; k < 8; k++) tmp1[i][j] += mc1[i][k] * m1[k][j]; /* The [i,j] coefficient of the matrix product MC1*M1. */ tmp1[i][j] >>= (NBC1 + 10 - NBI); /* In order to keep NBI bits only. The DCT coefficients of m1 are * integers, 2's complement coded on 12 bits. The result should be * reprensented on NBC1 + 12 + 3 bits (sum of 8 partial products, each * of them beeing reprensented on NBC1 + 12 bits). A dynamic study can * prove that m1 beeing a DCT output tmp1[i][j] can be represented on * NBC1 + 11 bits only. * So as we have a NBC1 + 11 long integer and want to * keep NBI bits only we first drop NBC1 + 10 - NBI bits. We will drop * the last bit after rounding. */ tmp1[i][j] += 1; /* For rounding purpose. */ tmp1[i][j] >>= 1; /* Final rounding. tmp1[i][j] is now represented on NBI bits. */ if (tmp1[i][j] < -(1 << (NBI - 1))) tmp2[j][i] = -(1 << (NBI - 1)); else if (tmp1[i][j] >= (1 << (NBI - 1))) tmp2[j][i] = (1 << (NBI - 1)) - 1; else tmp2[j][i] = tmp1[i][j]; /* Saturation and transposition at the same time. Why saturation? I * wrote above that it can be proved that tmp1[i][j] can be represented * on NBI bits after truncation and rounding but it assumed that m1 was * a DCT output, which is usually not the case because of quantization * and inverse quantization. So saturation is needed. */ } /* Then the second pass. Looks like the first one. */ for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) { for(k = 0, tmp1[i][j] = 0; k < 8; k++) tmp1[i][j] += mc2[i][k] * tmp2[k][j]; /* The [i,j] coefficient of the matrix product MC2*TMP2, that is, * MC2*t(TMP1) = MC2*t(MC1*M1) = MC2*tM1*tMC1. */ tmp1[i][j] >>= (NBC2 + NBI - 12); /* In order to keep 9 bits only. The coefficients of tmp2 are fixed * point, 2's complement coded on NBI bits. The result should be * reprensented on NBC2 + NBI + 3 bits (sum of 8 partial products, each * of them beeing reprensented on NBC2 + NBI bits). A dynamic study can * prove that m1 beeing a DCT output tmp2[i][j] can be represented on * NBC2 + NBI - 2 bits only (I wrote a paper on this study once; If * you're interested...). So as we have a NBC2 + NBI - 2 long integer * and want to keep 9 bits only we first drop NBC2 + NBI - 12 bits. We * will drop the last bit after rounding. */ tmp1[i][j] += 1; /* For rounding purpose. */ tmp1[i][j] >>= 1; /* Final rounding. tmp2[i][j] is now represented on 9 bits. */ if (tmp1[i][j] < -256) m2[j][i] = -256; else if (tmp1[i][j] > 255) m2[j][i] = 255; else m2[j][i] = tmp1[i][j]; /* Saturation and transposition at the same time. Why saturation? I * wrote above that it can be proved that tmp2[i][j] can be represented * on 9 bits after truncation and rounding but it assumed that m1 was * a DCT output, which is usually not the case because of quantization * and inverse quantization. So saturation is needed. The last * transposition leads to M2 = t(MC2*tM1*tMC1) = MC1*M1*tMC2, that is, * the IDCT formula of M1. */ } } frama-c-20.0-Calcium/tests/idct/ieee_1180_1990.c0000666000000000000000000002641213571573400015513 0ustar /* run.config* GCC: STDOPT: +"-eva-msg-key=summary -load-module report,scope,variadic -float-normal -no-warn-signed-overflow tests/idct/idct.c -remove-redundant-alarms -eva-memexec -eva-builtin sqrt:Frama_C_sqrt,cos:Frama_C_cos -then -report -report-print-properties" */ /* IEEE_1180_1990: a testbed for IDCT accuracy * Copyright (C) 2001 Renaud Pacalet * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * Renaud Pacalet * Departement Comunications et Electronique, * Ecole Nationale Superieure des Telecommunications * 46, Rue Barrault 75634 Paris Cedex 13 * Tel : +33 1 45 81 78 08 * Fax : +33 1 45 80 40 36 * Email : pacalet@enst.fr * * The following program checks a IDCT C-code against the IEEE * 1180-1990 Standard Specification for the Implementation of 8x8 * Inverse Discrete Cosine Transform */ #include "stdio.h" #include "math.h" #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #define IEEE_1180_1990_TH M_PI/16.0 #define IEEE_1180_1990_ABS(a) ((a < 0) ? -a : a) extern void idct (long m1[8][8], long m2[8][8]); static long M1[8][8]; typedef struct { long pmse[8][8]; long pme[8][8]; } IEEE_1180_1990_stat_set; /* The random generator of the IEEE 1180/1990 standard */ long IEEE_1180_1990_rand(long L, long H) { static long randx = 1; static double z = (double)0x7fffffff; long i, j; double x; randx = (randx * 1103515245) + 12345; i = randx & 0x7ffffffe; x = ((double)i) / z; x *= (L + H + 1); j = x; return(j - L); } /* Generates random blocks with values between min and max */ static void IEEE_1180_1990_mkbk(long min, long max) { long i, j; for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) M1[i][j] = IEEE_1180_1990_rand(-min, max); } /* Floating point DCT */ void IEEE_1180_1990_dctf(long m1[8][8], long m2[8][8]) { long i, j, k; double tmp1[8][8], tmp2[8][8]; static double mcos[8][8]; static int init = 1; if(init) { for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) mcos[i][j] = ((j == 0) ? 0.5 / sqrt(2.0) : 0.5) * cos((2.0 * i + 1.0) * j * IEEE_1180_1990_TH); init = 0; } for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) { tmp1[i][j] = 0.0; for(k = 0; k < 8; k++) tmp1[i][j] = tmp1[i][j] + mcos[k][i] * m1[k][j]; } for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) { tmp2[i][j] = 0.0; for(k = 0; k < 8; k++) tmp2[i][j] = tmp2[i][j] + tmp1[i][k] * mcos[k][j]; if(tmp2[i][j] < -2048.0) m2[i][j] = -2048; else if(tmp2[i][j] > 2047.0) m2[i][j] = 2047; else if(tmp2[i][j] > 0.0) m2[i][j] = tmp2[i][j] + 0.5; else m2[i][j] = tmp2[i][j] - 0.5; } } /* Floating point IDCT */ void IEEE_1180_1990_idctf(long m1[8][8], long m2[8][8]) { long i, j, k; double tmp1[8][8], tmp2[8][8]; static double mcos[8][8]; static int init = 1; if(init) { for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) mcos[i][j] = ((j == 0) ? 0.5 / sqrt(2.0) : 0.5) * cos((2.0 * i + 1.0) * j * IEEE_1180_1990_TH); init = 0; } for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) { tmp1[i][j] = 0.0; for(k = 0; k < 8; k++) tmp1[i][j] = tmp1[i][j] + mcos[i][k] * m1[k][j]; } for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) { tmp2[i][j] = 0.0; for(k = 0; k < 8; k++) tmp2[i][j] = tmp2[i][j] + tmp1[i][k] * mcos[j][k]; if(tmp2[i][j] < -256.0) m2[i][j] = -256; else if(tmp2[i][j] > 255.0) m2[i][j] = 255; else if(tmp2[i][j] > 0.0) m2[i][j] = tmp2[i][j] + 0.5; else m2[i][j] = tmp2[i][j] - 0.5; } } int main() { IEEE_1180_1990_stat_set res[6]; long i, j, k, m1[8][8], m2[8][8], m3[8][8], m4[8][8], succ, omse, ome, err; succ = 1; /*@ loop pragma UNROLL 7; */ for(i = 0; i < 6; i++) for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) { res[i].pmse[j][k] = 0; res[i].pme[j][k] = 0; } for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) M1[i][j] = 0; idct(M1, m2); for(i = 0; i < 8; i++) for(j = 0; j < 8; j++) if(m2[i][j] != 0) succ = 0; if(succ != 1) { printf("For all-zero input, the proposed IDCT shall generate all-zero "); printf("output.\n"); ; } /*fprintf(stderr, "------------------------------------------------->\n");*/ /* loop pragma UNROLL 0 */ for(i = 0; i < 10000; i++) { if((i + 1) % 200 == 0) { /* fprintf(stderr, "*"); fflush(stderr); */ } IEEE_1180_1990_mkbk(-256, 255); IEEE_1180_1990_dctf(M1, m2); IEEE_1180_1990_idctf(m2, m3); idct(m2, m4); for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) { err = m4[j][k] - m3[j][k]; res[0].pme[j][k] = res[0].pme[j][k] + err; if(IEEE_1180_1990_ABS(err) > 1) { /* printf("For any pixel location, the peak error (ppe) shall not "); printf("exceed 1 in magnitude.\n"); printf(" (%ld in set 1, block %ld, line %ld, column %ld).\n", err, i, j, k); */ succ = 0; } err = err * err; res[0].pmse[j][k] = res[0].pmse[j][k] + err; } for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) M1[j][k] = - M1[j][k]; IEEE_1180_1990_dctf(M1, m2); IEEE_1180_1990_idctf(m2, m3); idct(m2, m4); for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) { err = m4[j][k] - m3[j][k]; res[3].pme[j][k] = res[3].pme[j][k] + err; if(IEEE_1180_1990_ABS(err) > 1) { /* printf("For any pixel location, the peak error (ppe) shall not "); printf("exceed 1 in magnitude.\n"); printf(" (%ld in set 4, block %ld, line %ld, column %ld).\n", err, i, j, k); */ succ = 0; } err = err * err; res[3].pmse[j][k] = res[3].pmse[j][k] + err; } IEEE_1180_1990_mkbk(-5, 5); IEEE_1180_1990_dctf(M1, m2); IEEE_1180_1990_idctf(m2, m3); idct(m2, m4); for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) { err = m4[j][k] - m3[j][k]; res[1].pme[j][k] = res[1].pme[j][k] + err; if(IEEE_1180_1990_ABS(err) > 1) { /* printf("For any pixel location, the peak error (ppe) shall not "); printf("exceed 1 in magnitude.\n"); printf(" (%ld in set 2, block %ld, line %ld, column %ld).\n", err, i, j, k); */ succ = 0; } err = err * err; res[1].pmse[j][k] = res[1].pmse[j][k] + err; } for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) M1[j][k] = - M1[j][k]; IEEE_1180_1990_dctf(M1, m2); IEEE_1180_1990_idctf(m2, m3); idct(m2, m4); for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) { err = m4[j][k] - m3[j][k]; res[4].pme[j][k] = res[4].pme[j][k] + err; if(IEEE_1180_1990_ABS(err) > 1) { /* printf("For any pixel location, the peak error (ppe) shall not "); printf("exceed 1 in magnitude.\n"); printf(" (%ld in set 5, block %ld, line %ld, column %ld).\n", err, i, j, k); */ succ = 0; } err = err * err; res[4].pmse[j][k] = res[4].pmse[j][k] + err; } IEEE_1180_1990_mkbk(-300, 300); IEEE_1180_1990_dctf(M1, m2); IEEE_1180_1990_idctf(m2, m3); idct(m2, m4); for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) { err = m4[j][k] - m3[j][k]; res[2].pme[j][k] = res[2].pme[j][k] + err; if(IEEE_1180_1990_ABS(err) > 1) { /* printf("For any pixel location, the peak error (ppe) shall not "); printf("exceed 1 in magnitude.\n"); printf(" (%ld in set 3, block %ld, line %ld, column %ld).\n", err, i, j, k); */ succ = 0; } err = err * err; res[2].pmse[j][k] = res[2].pmse[j][k] + err; } for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) M1[j][k] = - M1[j][k]; IEEE_1180_1990_dctf(M1, m2); IEEE_1180_1990_idctf(m2, m3); idct(m2, m4); for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) { err = m4[j][k] - m3[j][k]; res[5].pme[j][k] = res[5].pme[j][k] + err; if(IEEE_1180_1990_ABS(err) > 1) { /* printf("For any pixel location, the peak error (ppe) shall not "); printf("exceed 1 in magnitude.\n"); printf(" (%ld in set 6, block %ld, line %ld, column %ld).\n", err, i, j, k); */ succ = 0; } err = err * err; res[5].pmse[j][k] = res[5].pmse[j][k] + err; } } for(i = 0; i < 6; i++) { omse = 0; ome = 0; for(j = 0; j < 8; j++) for(k = 0; k < 8; k++) { omse = omse + res[i].pmse[j][k]; if(res[i].pmse[j][k] > 600) { /* printf("For any pixel location, the mean square error (pmse) shall "); printf("not exceed 0.06.\n"); printf(" (%0.5f in set %ld, line %ld, column %ld).\n", res[i].pmse[j][k] / 10000.0, i, j, k); */ succ = 0; } ome = ome + res[i].pme[j][k]; if(IEEE_1180_1990_ABS(res[i].pme[j][k]) > 150) { /* printf("For any pixel location, the mean error (pme) shall "); printf("not exceed 0.015 in magnitude.\n"); printf(" (%0.5f in set %ld, line %ld, column %ld).\n", res[i].pme[j][k] / 10000.0, i, j, k); */ succ = 0; } } if(omse > 12800) { /* printf("Overall, the mean square error (omse) shall "); printf("not exceed 0.02 in magnitude.\n"); printf(" (%0.5f in set %ld).\n", omse / 640000.0, i); */ succ = 0; } if(IEEE_1180_1990_ABS(ome) > 960) { /* printf("Overall, the mean error (ome) shall "); printf("not exceed 0.0015 in magnitude.\n"); printf(" (%0.5f in set %ld).\n", ome / 640000.0, i); */ succ = 0; } } /* fprintf(stderr, "\n"); */ if(succ == 1) { /* fprintf(stderr, "Your IDCT meets the IEEE Std 1180-1990 accuracy "); fprintf(stderr, "requirements.\n"); */ return (0); } else { /* fprintf(stderr, "Your IDCT does not meet the IEEE Std 1180-1990 accuracy "); fprintf(stderr, "requirements.\n"); */ return (1); } } frama-c-20.0-Calcium/tests/idct/oracle/0000777000000000000000000000000013571573400014545 5ustar frama-c-20.0-Calcium/tests/idct/oracle/ieee_1180_1990.res.oracle0000666000000000000000000055656413571573400020613 0ustar [kernel] Parsing tests/idct/ieee_1180_1990.c (with preprocessing) [kernel] Parsing tests/idct/idct.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization M1[0..7][0..7] ∈ {0} IEEE_1180_1990_rand_randx ∈ {1} IEEE_1180_1990_rand_z ∈ {1.9999999990686774*2^30} IEEE_1180_1990_dctf_mcos[0..7][0..7] ∈ {0} IEEE_1180_1990_dctf_init ∈ {1} IEEE_1180_1990_idctf_mcos[0..7][0..7] ∈ {0} IEEE_1180_1990_idctf_init ∈ {1} idct_init ∈ {1} idct_mc1[0..7][0..7] ∈ {0} idct_mc2[0..7][0..7] ∈ {0} [eva] tests/idct/ieee_1180_1990.c:179: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:178: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:185: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:184: starting to merge loop iterations [eva] computing for function idct <- main. Called from tests/idct/ieee_1180_1990.c:187. [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:90: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/idct/idct.c:90: function sqrt: precondition 'arg_positive' got status valid. [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:91: function cos: precondition 'finite_arg' got status valid. [eva] tests/idct/idct.c:88: starting to merge loop iterations [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:87: starting to merge loop iterations [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:90: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/idct.c:91: Call to builtin Frama_C_cos for function cos [eva] tests/idct/idct.c:128: starting to merge loop iterations [eva] tests/idct/idct.c:126: starting to merge loop iterations [eva:alarm] tests/idct/idct.c:129: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:131: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:141: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:143: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:145: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:147: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:150: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:signed-overflow] tests/idct/idct.c:141: Warning: 2's complement assumed for overflow [eva] tests/idct/idct.c:125: starting to merge loop iterations [eva:signed-overflow] tests/idct/idct.c:163: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/idct.c:163: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[k][j]); [eva] tests/idct/idct.c:162: starting to merge loop iterations [eva] tests/idct/idct.c:160: starting to merge loop iterations [eva:alarm] tests/idct/idct.c:163: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:166: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:signed-overflow] tests/idct/idct.c:176: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/idct.c:176: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:178: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:180: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:182: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva:alarm] tests/idct/idct.c:185: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva] tests/idct/idct.c:159: starting to merge loop iterations [eva] Recording results for idct [eva] Done for function idct [eva:alarm] tests/idct/ieee_1180_1990.c:191: Warning: accessing uninitialized left-value. assert \initialized(&m2[i][j]); [eva] tests/idct/ieee_1180_1990.c:190: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:189: starting to merge loop iterations [eva] computing for function printf_va_1 <- main. Called from tests/idct/ieee_1180_1990.c:195. [eva] using specification for function printf_va_1 [eva] tests/idct/ieee_1180_1990.c:195: function printf_va_1: precondition got status valid. [eva] Done for function printf_va_1 [eva] computing for function printf_va_2 <- main. Called from tests/idct/ieee_1180_1990.c:196. [eva] using specification for function printf_va_2 [eva] tests/idct/ieee_1180_1990.c:196: function printf_va_2: precondition got status valid. [eva] Done for function printf_va_2 [eva] computing for function IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:211. [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:85. [eva] Recording results for IEEE_1180_1990_rand [eva] Done for function IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:84: starting to merge loop iterations [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:85. [eva:signed-overflow] tests/idct/ieee_1180_1990.c:69: Warning: 2's complement assumed for overflow [eva] Recording results for IEEE_1180_1990_rand [eva] Done for function IEEE_1180_1990_rand [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:85. [eva] Recording results for IEEE_1180_1990_rand [eva] Done for function IEEE_1180_1990_rand [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:85. [eva] Recording results for IEEE_1180_1990_rand [eva] Done for function IEEE_1180_1990_rand [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:85. [eva] Recording results for IEEE_1180_1990_rand [eva] Done for function IEEE_1180_1990_rand [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:85. [eva] Recording results for IEEE_1180_1990_rand [eva] Done for function IEEE_1180_1990_rand [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:85. [eva] Recording results for IEEE_1180_1990_rand [eva] Done for function IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:83: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] Recording results for IEEE_1180_1990_mkbk [eva] Done for function IEEE_1180_1990_mkbk [eva] computing for function IEEE_1180_1990_dctf <- main. Called from tests/idct/ieee_1180_1990.c:212. [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:100: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/idct/ieee_1180_1990.c:100: function sqrt: precondition 'arg_positive' got status valid. [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:101: function cos: precondition 'finite_arg' got status valid. [eva] tests/idct/ieee_1180_1990.c:99: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:98: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:108: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:105: starting to merge loop iterations [eva:alarm] tests/idct/ieee_1180_1990.c:109: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva] tests/idct/ieee_1180_1990.c:104: starting to merge loop iterations [eva:alarm] tests/idct/ieee_1180_1990.c:116: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][k]); [eva] tests/idct/ieee_1180_1990.c:115: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:112: starting to merge loop iterations [eva:alarm] tests/idct/ieee_1180_1990.c:116: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:117: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:119: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:121: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:122: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:122: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < tmp2[i][j] + 0.5; [eva:alarm] tests/idct/ieee_1180_1990.c:122: Warning: overflow in conversion from floating-point to integer. assert tmp2[i][j] + 0.5 < 2147483648; [eva:alarm] tests/idct/ieee_1180_1990.c:124: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:124: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < tmp2[i][j] - 0.5; [eva:alarm] tests/idct/ieee_1180_1990.c:124: Warning: overflow in conversion from floating-point to integer. assert tmp2[i][j] - 0.5 < 2147483648; [eva] tests/idct/ieee_1180_1990.c:111: starting to merge loop iterations [eva] Recording results for IEEE_1180_1990_dctf [eva] Done for function IEEE_1180_1990_dctf [eva] computing for function IEEE_1180_1990_idctf <- main. Called from tests/idct/ieee_1180_1990.c:213. [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:140: function sqrt: precondition 'finite_arg' got status valid. [eva] tests/idct/ieee_1180_1990.c:140: function sqrt: precondition 'arg_positive' got status valid. [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:141: function cos: precondition 'finite_arg' got status valid. [eva] tests/idct/ieee_1180_1990.c:139: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:138: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva:alarm] tests/idct/ieee_1180_1990.c:150: Warning: accessing uninitialized left-value. assert \initialized(&(*(m1 + k))[j]); [eva] tests/idct/ieee_1180_1990.c:149: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:146: starting to merge loop iterations [eva:alarm] tests/idct/ieee_1180_1990.c:150: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][j]); [eva] tests/idct/ieee_1180_1990.c:145: starting to merge loop iterations [eva:alarm] tests/idct/ieee_1180_1990.c:157: Warning: accessing uninitialized left-value. assert \initialized(&tmp1[i][k]); [eva] tests/idct/ieee_1180_1990.c:156: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:153: starting to merge loop iterations [eva:alarm] tests/idct/ieee_1180_1990.c:157: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:158: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:160: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:162: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:163: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:163: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < tmp2[i][j] + 0.5; [eva:alarm] tests/idct/ieee_1180_1990.c:163: Warning: overflow in conversion from floating-point to integer. assert tmp2[i][j] + 0.5 < 2147483648; [eva:alarm] tests/idct/ieee_1180_1990.c:165: Warning: accessing uninitialized left-value. assert \initialized(&tmp2[i][j]); [eva:alarm] tests/idct/ieee_1180_1990.c:165: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < tmp2[i][j] - 0.5; [eva:alarm] tests/idct/ieee_1180_1990.c:165: Warning: overflow in conversion from floating-point to integer. assert tmp2[i][j] - 0.5 < 2147483648; [eva] tests/idct/ieee_1180_1990.c:152: starting to merge loop iterations [eva] Recording results for IEEE_1180_1990_idctf [eva] Done for function IEEE_1180_1990_idctf [eva] computing for function idct <- main. Called from tests/idct/ieee_1180_1990.c:214. [eva:signed-overflow] tests/idct/idct.c:129: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/idct.c:129: Warning: accessing uninitialized left-value. assert \initialized(&(*(m1 + k))[j]); [eva] Recording results for idct [eva] Done for function idct [eva:signed-overflow] tests/idct/ieee_1180_1990.c:218: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:218: Warning: accessing uninitialized left-value. assert \initialized(&m3[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:218: Warning: accessing uninitialized left-value. assert \initialized(&m4[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:219: Warning: accessing uninitialized left-value. assert \initialized(&res[0].pme[j][k]); [eva:signed-overflow] tests/idct/ieee_1180_1990.c:220: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:230: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:231: Warning: accessing uninitialized left-value. assert \initialized(&res[0].pmse[j][k]); [eva] tests/idct/ieee_1180_1990.c:216: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:219: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:231: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:215: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:234: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:233: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:235: Warning: 2's complement assumed for overflow [eva] computing for function IEEE_1180_1990_dctf <- main. Called from tests/idct/ieee_1180_1990.c:236. [eva] Recording results for IEEE_1180_1990_dctf [eva] Done for function IEEE_1180_1990_dctf [eva] computing for function IEEE_1180_1990_idctf <- main. Called from tests/idct/ieee_1180_1990.c:237. [eva] Recording results for IEEE_1180_1990_idctf [eva] Done for function IEEE_1180_1990_idctf [eva] computing for function idct <- main. Called from tests/idct/ieee_1180_1990.c:238. [eva] Recording results for idct [eva] Done for function idct [eva:signed-overflow] tests/idct/ieee_1180_1990.c:242: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:242: Warning: accessing uninitialized left-value. assert \initialized(&m3[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:242: Warning: accessing uninitialized left-value. assert \initialized(&m4[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:243: Warning: accessing uninitialized left-value. assert \initialized(&res[3].pme[j][k]); [eva:signed-overflow] tests/idct/ieee_1180_1990.c:244: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:254: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:255: Warning: accessing uninitialized left-value. assert \initialized(&res[3].pmse[j][k]); [eva] tests/idct/ieee_1180_1990.c:240: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:243: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:255: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:239: starting to merge loop iterations [eva] computing for function IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:257. [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:85. [eva] Recording results for IEEE_1180_1990_rand [eva] Done for function IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] Recording results for IEEE_1180_1990_mkbk [eva] Done for function IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:258: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:259: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct [eva:signed-overflow] tests/idct/ieee_1180_1990.c:264: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:264: Warning: accessing uninitialized left-value. assert \initialized(&m3[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:264: Warning: accessing uninitialized left-value. assert \initialized(&m4[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:265: Warning: accessing uninitialized left-value. assert \initialized(&res[1].pme[j][k]); [eva:signed-overflow] tests/idct/ieee_1180_1990.c:266: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:276: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:277: Warning: accessing uninitialized left-value. assert \initialized(&res[1].pmse[j][k]); [eva] tests/idct/ieee_1180_1990.c:262: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:265: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:277: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:261: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:281: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:280: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:279: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:282: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:283: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct [eva:signed-overflow] tests/idct/ieee_1180_1990.c:288: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:288: Warning: accessing uninitialized left-value. assert \initialized(&m3[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:288: Warning: accessing uninitialized left-value. assert \initialized(&m4[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:289: Warning: accessing uninitialized left-value. assert \initialized(&res[4].pme[j][k]); [eva:signed-overflow] tests/idct/ieee_1180_1990.c:290: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:300: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:301: Warning: accessing uninitialized left-value. assert \initialized(&res[4].pmse[j][k]); [eva] tests/idct/ieee_1180_1990.c:286: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:289: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:301: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:285: starting to merge loop iterations [eva] computing for function IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:303. [eva] computing for function IEEE_1180_1990_rand <- IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:85. [eva] Recording results for IEEE_1180_1990_rand [eva] Done for function IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] Recording results for IEEE_1180_1990_mkbk [eva] Done for function IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:304: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:305: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct [eva:signed-overflow] tests/idct/ieee_1180_1990.c:310: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:310: Warning: accessing uninitialized left-value. assert \initialized(&m3[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:310: Warning: accessing uninitialized left-value. assert \initialized(&m4[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:311: Warning: accessing uninitialized left-value. assert \initialized(&res[2].pme[j][k]); [eva:signed-overflow] tests/idct/ieee_1180_1990.c:312: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:322: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:323: Warning: accessing uninitialized left-value. assert \initialized(&res[2].pmse[j][k]); [eva] tests/idct/ieee_1180_1990.c:308: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:311: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:323: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:307: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:327: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:326: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:325: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:328: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:329: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct [eva:signed-overflow] tests/idct/ieee_1180_1990.c:334: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:334: Warning: accessing uninitialized left-value. assert \initialized(&m3[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:334: Warning: accessing uninitialized left-value. assert \initialized(&m4[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:335: Warning: accessing uninitialized left-value. assert \initialized(&res[5].pme[j][k]); [eva:signed-overflow] tests/idct/ieee_1180_1990.c:336: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:346: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:347: Warning: accessing uninitialized left-value. assert \initialized(&res[5].pmse[j][k]); [eva] tests/idct/ieee_1180_1990.c:332: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:335: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/idct/ieee_1180_1990.c:347: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:331: starting to merge loop iterations [eva] tests/idct/ieee_1180_1990.c:202: starting to merge loop iterations [eva] computing for function IEEE_1180_1990_mkbk <- main. Called from tests/idct/ieee_1180_1990.c:211. [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] tests/idct/ieee_1180_1990.c:85: Reusing old results for call to IEEE_1180_1990_rand [eva] Recording results for IEEE_1180_1990_mkbk [eva] Done for function IEEE_1180_1990_mkbk [eva] computing for function IEEE_1180_1990_dctf <- main. Called from tests/idct/ieee_1180_1990.c:212. [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:100: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:101: Call to builtin Frama_C_cos for function cos [eva] Recording results for IEEE_1180_1990_dctf [eva] Done for function IEEE_1180_1990_dctf [eva] computing for function IEEE_1180_1990_idctf <- main. Called from tests/idct/ieee_1180_1990.c:213. [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] tests/idct/ieee_1180_1990.c:140: Call to builtin Frama_C_sqrt for function sqrt [eva] tests/idct/ieee_1180_1990.c:141: Call to builtin Frama_C_cos for function cos [eva] Recording results for IEEE_1180_1990_idctf [eva] Done for function IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:236: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:237: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:257: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:258: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:259: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:282: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:283: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:303: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:304: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:305: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:328: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:329: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:211: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:212: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:213: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:236: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:237: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:257: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:258: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:259: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:282: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:283: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:303: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:304: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:305: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:328: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:329: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:211: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:212: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:213: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:236: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:237: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:257: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:258: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:259: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:282: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:283: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:303: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:304: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:305: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:328: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:329: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:211: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:212: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:213: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:236: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:237: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:257: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:258: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:259: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:282: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:283: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:303: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:304: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:305: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:328: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:329: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:211: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:212: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:213: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:236: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:237: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:257: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:258: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:259: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:282: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:283: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:303: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:304: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:305: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:328: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:329: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:211: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:212: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:213: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:236: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:237: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:257: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:258: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:259: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:282: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:283: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:303: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:304: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:305: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:328: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:329: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:211: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:212: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:213: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:214: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:236: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:237: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:238: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:257: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:258: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:259: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:260: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:282: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:283: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:284: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:303: Reusing old results for call to IEEE_1180_1990_mkbk [eva] tests/idct/ieee_1180_1990.c:304: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:305: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:306: Reusing old results for call to idct [eva] tests/idct/ieee_1180_1990.c:328: Reusing old results for call to IEEE_1180_1990_dctf [eva] tests/idct/ieee_1180_1990.c:329: Reusing old results for call to IEEE_1180_1990_idctf [eva] tests/idct/ieee_1180_1990.c:330: Reusing old results for call to idct [eva:alarm] tests/idct/ieee_1180_1990.c:357: Warning: accessing uninitialized left-value. assert \initialized(&res[i].pmse[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:368: Warning: accessing uninitialized left-value. assert \initialized(&res[i].pme[j][k]); [eva:signed-overflow] tests/idct/ieee_1180_1990.c:369: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:355: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:357: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:358: Warning: accessing uninitialized left-value. assert \initialized(&res[i].pmse[j][k]); [eva:signed-overflow] tests/idct/ieee_1180_1990.c:368: Warning: 2's complement assumed for overflow [eva:alarm] tests/idct/ieee_1180_1990.c:369: Warning: accessing uninitialized left-value. assert \initialized(&res[i].pme[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:369: Warning: accessing uninitialized left-value. assert \initialized(&res[i].pme[j][k]); [eva:alarm] tests/idct/ieee_1180_1990.c:369: Warning: accessing uninitialized left-value. assert \initialized(&res[i].pme[j][k]); [eva] tests/idct/ieee_1180_1990.c:354: starting to merge loop iterations [eva:signed-overflow] tests/idct/ieee_1180_1990.c:389: Warning: 2's complement assumed for overflow [eva] tests/idct/ieee_1180_1990.c:350: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 16 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function IEEE_1180_1990_rand: i ∈ [0..2147483646],0%2 j ∈ [0..600] x ∈ [0.0000000000000000 .. 600.9999997201375663] IEEE_1180_1990_rand_randx ∈ [--..--] __retres ∈ [-300..300] [eva:final-states] Values at end of function IEEE_1180_1990_mkbk: i ∈ {8} j ∈ {8} or UNINITIALIZED M1[0..7][0..7] ∈ [--..--] IEEE_1180_1990_rand_randx ∈ [--..--] [eva:final-states] Values at end of function IEEE_1180_1990_dctf: i ∈ {8} j ∈ {8} or UNINITIALIZED k ∈ {8} or UNINITIALIZED tmp1[0..7][0..7] ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] or UNINITIALIZED tmp2[0..7][0..7] ∈ [-1.6867516709168837*2^265 .. 1.6867516709168837*2^265] or UNINITIALIZED m2[0..7][0..7] ∈ [--..--] or UNINITIALIZED IEEE_1180_1990_dctf_mcos[0..7][0..7] ∈ [-1.0000000000000000*2^-1 .. 1.0000000000000000*2^-1] IEEE_1180_1990_dctf_init ∈ {0} [eva:final-states] Values at end of function IEEE_1180_1990_idctf: i ∈ {8} j ∈ {8} or UNINITIALIZED k ∈ {8} or UNINITIALIZED tmp1[0..7][0..7] ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] or UNINITIALIZED tmp2[0..7][0..7] ∈ [-1.6867516709168837*2^265 .. 1.6867516709168837*2^265] or UNINITIALIZED m3[0..7][0..7] ∈ [--..--] or UNINITIALIZED IEEE_1180_1990_idctf_mcos[0..7][0..7] ∈ [-1.0000000000000000*2^-1 .. 1.0000000000000000*2^-1] IEEE_1180_1990_idctf_init ∈ {0} [eva:final-states] Values at end of function idct: m2[0..7][0..7] ∈ [--..--] or UNINITIALIZED m4[0..7][0..7] ∈ [--..--] or UNINITIALIZED i ∈ {8} j ∈ {8} or UNINITIALIZED k ∈ {8} or UNINITIALIZED tmp1[0..7][0..7] ∈ [--..--] or UNINITIALIZED tmp2[0..7][0..7] ∈ [--..--] or UNINITIALIZED ftmp1 ∈ [-1.0000610351562500*2^13 .. 1.0000610351562500*2^13] or UNINITIALIZED ftmp2 ∈ [-1.0000610351562500*2^13 .. 1.0000610351562500*2^13] or UNINITIALIZED idct_init ∈ {0} idct_mc1[0..7][0..7] ∈ [-8192..8192] idct_mc2[0..7][0..7] ∈ [-8192..8192] [eva:final-states] Values at end of function main: res[0..5] ∈ [--..--] or UNINITIALIZED i ∈ {6} j ∈ {8} k ∈ {8} or UNINITIALIZED m2[0..7][0..7] ∈ [--..--] or UNINITIALIZED m3[0..7][0..7] ∈ [--..--] or UNINITIALIZED m4[0..7][0..7] ∈ [--..--] or UNINITIALIZED succ ∈ {0; 1} omse ∈ [--..--] or UNINITIALIZED ome ∈ [--..--] or UNINITIALIZED err ∈ [--..--] or UNINITIALIZED M1[0..7][0..7] ∈ [--..--] IEEE_1180_1990_rand_randx ∈ [--..--] IEEE_1180_1990_dctf_mcos[0..7][0..7] ∈ [-1.0000000000000000*2^-1 .. 1.0000000000000000*2^-1] IEEE_1180_1990_dctf_init ∈ {0; 1} IEEE_1180_1990_idctf_mcos[0..7][0..7] ∈ [-1.0000000000000000*2^-1 .. 1.0000000000000000*2^-1] IEEE_1180_1990_idctf_init ∈ {0; 1} idct_init ∈ {0} idct_mc1[0..7][0..7] ∈ [-8192..8192] idct_mc2[0..7][0..7] ∈ [-8192..8192] __retres ∈ {0; 1} S___fc_stdout[0..1] ∈ [--..--] [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 6 functions analyzed (out of 6): 100% coverage. In these functions, 588 statements reached (out of 626): 93% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 42 warnings by the Frama-C kernel: 0 errors 0 warnings ---------------------------------------------------------------------------- 72 alarms generated by the analysis: 64 accesses to uninitialized left-values 8 illegal conversions from floating-point to integer ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 0 valid 0 unknown 0 invalid 0 total Preconditions 11 valid 0 unknown 0 invalid 11 total 100% of the logical properties reached have been proven. ---------------------------------------------------------------------------- [from] Computing for function IEEE_1180_1990_rand [from] Done for function IEEE_1180_1990_rand [from] Computing for function IEEE_1180_1990_mkbk [from] Done for function IEEE_1180_1990_mkbk [from] Computing for function IEEE_1180_1990_dctf [from] Computing for function sqrt <-IEEE_1180_1990_dctf [from] Done for function sqrt [from] Computing for function cos <-IEEE_1180_1990_dctf [from] Done for function cos [from] Done for function IEEE_1180_1990_dctf [from] Computing for function IEEE_1180_1990_idctf [from] Done for function IEEE_1180_1990_idctf [from] Computing for function idct [from] Done for function idct [from] Computing for function main [from] Computing for function printf_va_1 <-main [from] Done for function printf_va_1 [from] Computing for function printf_va_2 <-main [from] Done for function printf_va_2 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function IEEE_1180_1990_rand: IEEE_1180_1990_rand_randx FROM IEEE_1180_1990_rand_randx \result FROM L; H; IEEE_1180_1990_rand_randx; IEEE_1180_1990_rand_z [from] Function IEEE_1180_1990_mkbk: M1[0..7][0..7] FROM min; max; IEEE_1180_1990_rand_randx; IEEE_1180_1990_rand_z (and SELF) IEEE_1180_1990_rand_randx FROM IEEE_1180_1990_rand_randx (and SELF) [from] Function cos: \result FROM x [from] Function printf_va_1: S___fc_stdout[0].__fc_FILE_data FROM S___fc_stdout[0]; "For all-zero input, the proposed IDCT shall generate all-zero "[bits 0 to 503] (and SELF) \result FROM S___fc_stdout[0]; "For all-zero input, the proposed IDCT shall generate all-zero "[bits 0 to 503] [from] Function printf_va_2: S___fc_stdout[0].__fc_FILE_data FROM S___fc_stdout[0]; "output.\n"[bits 0 to 71] (and SELF) \result FROM S___fc_stdout[0]; "output.\n"[bits 0 to 71] [from] Function sqrt: \result FROM x [from] Function IEEE_1180_1990_dctf: m2[0..7][0..7] FROM m1; m2; M1[0..7][0..7]; IEEE_1180_1990_dctf_mcos[0..7][0..7]; IEEE_1180_1990_dctf_init (and SELF) IEEE_1180_1990_dctf_mcos[0..7][0..7] FROM IEEE_1180_1990_dctf_init (and SELF) IEEE_1180_1990_dctf_init FROM IEEE_1180_1990_dctf_init (and SELF) [from] Function IEEE_1180_1990_idctf: m3[0..7][0..7] FROM m1; m2; m2[0..7][0..7]; IEEE_1180_1990_idctf_mcos[0..7][0..7]; IEEE_1180_1990_idctf_init (and SELF) IEEE_1180_1990_idctf_mcos[0..7][0..7] FROM IEEE_1180_1990_idctf_init (and SELF) IEEE_1180_1990_idctf_init FROM IEEE_1180_1990_idctf_init (and SELF) [from] Function idct: m2[0..7][0..7] FROM m2[0..7][0..7]; m1; m2; M1[0..7][0..7]; idct_init; idct_mc1[0..7][0..7]; idct_mc2[0..7][0..7] (and SELF) m4[0..7][0..7] FROM m2[0..7][0..7]; m1; m2; M1[0..7][0..7]; idct_init; idct_mc1[0..7][0..7]; idct_mc2[0..7][0..7] (and SELF) idct_init FROM idct_init (and SELF) idct_mc1[0..7][0..7] FROM idct_init (and SELF) idct_mc2[0..7][0..7] FROM idct_init (and SELF) [from] Function main: M1[0..7][0..7] FROM M1[0..7][0..7]; IEEE_1180_1990_rand_randx; IEEE_1180_1990_rand_z (and SELF) IEEE_1180_1990_rand_randx FROM IEEE_1180_1990_rand_randx (and SELF) IEEE_1180_1990_dctf_mcos[0..7][0..7] FROM IEEE_1180_1990_dctf_init (and SELF) IEEE_1180_1990_dctf_init FROM IEEE_1180_1990_dctf_init (and SELF) IEEE_1180_1990_idctf_mcos[0..7][0..7] FROM IEEE_1180_1990_idctf_init (and SELF) IEEE_1180_1990_idctf_init FROM IEEE_1180_1990_idctf_init (and SELF) idct_init FROM idct_init (and SELF) idct_mc1[0..7][0..7] FROM idct_init (and SELF) idct_mc2[0..7][0..7] FROM idct_init (and SELF) S___fc_stdout[0].__fc_FILE_data FROM M1[0..7][0..7]; idct_init; idct_mc1[0..7][0..7]; idct_mc2[0..7][0..7]; S___fc_stdout[0]; "For all-zero input, the proposed IDCT shall generate all-zero "[bits 0 to 503]; "output.\n"[bits 0 to 71] (and SELF) \result FROM M1[0..7][0..7]; IEEE_1180_1990_rand_randx; IEEE_1180_1990_rand_z; IEEE_1180_1990_dctf_mcos[0..7][0..7]; IEEE_1180_1990_dctf_init; IEEE_1180_1990_idctf_mcos[0..7][0..7]; IEEE_1180_1990_idctf_init; idct_init; idct_mc1[0..7][0..7]; idct_mc2[0..7][0..7] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function IEEE_1180_1990_rand: i; j; x; IEEE_1180_1990_rand_randx; __retres [inout] Inputs for function IEEE_1180_1990_rand: IEEE_1180_1990_rand_randx; IEEE_1180_1990_rand_z [inout] Out (internal) for function IEEE_1180_1990_mkbk: i; j; M1[0..7][0..7]; IEEE_1180_1990_rand_randx [inout] Inputs for function IEEE_1180_1990_mkbk: IEEE_1180_1990_rand_randx; IEEE_1180_1990_rand_z [inout] Out (internal) for function IEEE_1180_1990_dctf: i; j; k; tmp1[0..7][0..7]; tmp2[0..7][0..7]; tmp; tmp_0; tmp_1; m2[0..7][0..7]; IEEE_1180_1990_dctf_mcos[0..7][0..7]; IEEE_1180_1990_dctf_init [inout] Inputs for function IEEE_1180_1990_dctf: M1[0..7][0..7]; IEEE_1180_1990_dctf_mcos[0..7][0..7]; IEEE_1180_1990_dctf_init [inout] Out (internal) for function IEEE_1180_1990_idctf: i; j; k; tmp1[0..7][0..7]; tmp2[0..7][0..7]; tmp; tmp_0; tmp_1; m3[0..7][0..7]; IEEE_1180_1990_idctf_mcos[0..7][0..7]; IEEE_1180_1990_idctf_init [inout] Inputs for function IEEE_1180_1990_idctf: m2[0..7][0..7]; IEEE_1180_1990_idctf_mcos[0..7][0..7]; IEEE_1180_1990_idctf_init [inout] Out (internal) for function idct: m2[0..7][0..7]; m4[0..7][0..7]; i; j; k; tmp1[0..7][0..7]; tmp2[0..7][0..7]; ftmp1; ftmp2; tmp; tmp_0; tmp_1; idct_init; idct_mc1[0..7][0..7]; idct_mc2[0..7][0..7] [inout] Inputs for function idct: m2[0..7][0..7]; M1[0..7][0..7]; idct_init; idct_mc1[0..7][0..7]; idct_mc2[0..7][0..7] [inout] Out (internal) for function main: res[0..5]; i; j; k; m2[0..7][0..7]; m3[0..7][0..7]; m4[0..7][0..7]; succ; omse; ome; err; tmp; tmp_0; tmp_1; tmp_2; tmp_3; tmp_4; tmp_5; tmp_6; M1[0..7][0..7]; IEEE_1180_1990_rand_randx; IEEE_1180_1990_dctf_mcos[0..7][0..7]; IEEE_1180_1990_dctf_init; IEEE_1180_1990_idctf_mcos[0..7][0..7]; IEEE_1180_1990_idctf_init; idct_init; idct_mc1[0..7][0..7]; idct_mc2[0..7][0..7]; __retres; S___fc_stdout[0].__fc_FILE_data [inout] Inputs for function main: M1[0..7][0..7]; IEEE_1180_1990_rand_randx; IEEE_1180_1990_rand_z; IEEE_1180_1990_dctf_mcos[0..7][0..7]; IEEE_1180_1990_dctf_init; IEEE_1180_1990_idctf_mcos[0..7][0..7]; IEEE_1180_1990_idctf_init; idct_init; idct_mc1[0..7][0..7]; idct_mc2[0..7][0..7]; S___fc_stdout[0]; "For all-zero input, the proposed IDCT shall generate all-zero "[bits 0 to 503]; "output.\n"[bits 0 to 71] [report] Computing properties status... -------------------------------------------------------------------------------- --- Global Properties -------------------------------------------------------------------------------- [ Extern ] Axiom 'memchr_def' axiom memchr_def Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_left' axiom memcmp_strlen_left Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_right' axiom memcmp_strlen_right Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_shift_left' axiom memcmp_strlen_shift_left Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_shift_right' axiom memcmp_strlen_shift_right Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_zero' axiom memcmp_zero Unverifiable but considered Valid. [ Extern ] Axiom 'memset_def' axiom memset_def Unverifiable but considered Valid. [ Extern ] Axiom 'strchr_def' axiom strchr_def Unverifiable but considered Valid. [ Extern ] Axiom 'strcmp_zero' axiom strcmp_zero Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_at_null' axiom strlen_at_null Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_before_null' axiom strlen_before_null Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_create' axiom strlen_create Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_create_shift' axiom strlen_create_shift Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_neg' axiom strlen_neg Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_not_zero' axiom strlen_not_zero Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_pos_or_null' axiom strlen_pos_or_null Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_shift' axiom strlen_shift Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_sup' axiom strlen_sup Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_zero' axiom strlen_zero Unverifiable but considered Valid. [ Extern ] Axiom 'strncmp_zero' axiom strncmp_zero Unverifiable but considered Valid. [ Extern ] Axiom 'wcschr_def' axiom wcschr_def Unverifiable but considered Valid. [ Extern ] Axiom 'wcscmp_zero' axiom wcscmp_zero Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_at_null' axiom wcslen_at_null Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_before_null' axiom wcslen_before_null Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_create' axiom wcslen_create Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_create_shift' axiom wcslen_create_shift Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_neg' axiom wcslen_neg Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_not_zero' axiom wcslen_not_zero Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_pos_or_null' axiom wcslen_pos_or_null Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_shift' axiom wcslen_shift Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_sup' axiom wcslen_sup Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_zero' axiom wcslen_zero Unverifiable but considered Valid. [ Extern ] Axiom 'wcsncmp_zero' axiom wcsncmp_zero Unverifiable but considered Valid. [ Extern ] Axiom 'wmemchr_def' axiom wmemchr_def Unverifiable but considered Valid. [ Valid ] Axiomatic 'GetsLength' axiomatic GetsLength by Frama-C kernel. [ Valid ] Axiomatic 'MemChr' axiomatic MemChr by Frama-C kernel. [ Valid ] Axiomatic 'MemCmp' axiomatic MemCmp by Frama-C kernel. [ Valid ] Axiomatic 'MemSet' axiomatic MemSet by Frama-C kernel. [ Valid ] Axiomatic 'StrChr' axiomatic StrChr by Frama-C kernel. [ Valid ] Axiomatic 'StrCmp' axiomatic StrCmp by Frama-C kernel. [ Valid ] Axiomatic 'StrLen' axiomatic StrLen by Frama-C kernel. [ Valid ] Axiomatic 'StrNCmp' axiomatic StrNCmp by Frama-C kernel. [ Valid ] Axiomatic 'WMemChr' axiomatic WMemChr by Frama-C kernel. [ Valid ] Axiomatic 'WcsChr' axiomatic WcsChr by Frama-C kernel. [ Valid ] Axiomatic 'WcsCmp' axiomatic WcsCmp by Frama-C kernel. [ Valid ] Axiomatic 'WcsLen' axiomatic WcsLen by Frama-C kernel. [ Valid ] Axiomatic 'WcsNCmp' axiomatic WcsNCmp by Frama-C kernel. [ Valid ] Axiomatic 'format_length' axiomatic format_length by Frama-C kernel. [ Valid ] Axiomatic 'pipe_streams' axiomatic pipe_streams by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'remove' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_ok_or_error' ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1 Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 76) assigns \result \from (indirect: *(filename + (0 .. strlen{Old}(filename)))); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'rename' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_ok_or_error' ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1 Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 85) assigns \result \from (indirect: *(old_name + (0 .. strlen{Old}(old_name)))), (indirect: *(new_name + (0 .. strlen{Old}(new_name)))); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'tmpfile' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_valid_fd' ensures result_null_or_valid_fd: \result ≡ \null ∨ \subset(\result, &__fc_fopen[0 .. 16 - 1]) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 95) assigns \result \from __fc_p_fopen; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'tmpnam' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_string_or_null' ensures result_string_or_null: \result ≡ \null ∨ \result ≡ \old(s) ∨ \result ≡ __fc_p_tmpnam Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 109) assigns *(__fc_p_tmpnam + (0 .. 2048)), *(s + (0 .. 2048)), \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 109) assigns *(__fc_p_tmpnam + (0 .. 2048)) \from *(__fc_p_tmpnam + (0 .. 2048)), (indirect: s); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 111) assigns *(s + (0 .. 2048)) \from (indirect: s), *(__fc_p_tmpnam + (0 .. 2048)); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 112) assigns \result \from s, __fc_p_tmpnam; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fclose' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_zero_or_EOF' ensures result_zero_or_EOF: \result ≡ 0 ∨ \result ≡ -1 Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 121) assigns \result \from (indirect: stream), (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fflush' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_zero_or_EOF' ensures result_zero_or_EOF: \result ≡ 0 ∨ \result ≡ -1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 130) assigns \result, *stream, __fc_fopen[0 .. 16 - 1]; Unverifiable but considered Valid. [ Extern ] Assigns for 'flush_all' (file share/libc/stdio.h, line 137) assigns __fc_fopen[0 .. 16 - 1], \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'flush_stream' (file share/libc/stdio.h, line 142) assigns *stream, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 130) assigns \result \from (indirect: *stream), (indirect: __fc_fopen[0 .. 16 - 1]); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 132) assigns *stream \from (indirect: stream), *stream, __fc_fopen[0 .. 16 - 1]; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 132) assigns __fc_fopen[0 .. 16 - 1] \from (indirect: stream), *stream, __fc_fopen[0 .. 16 - 1]; Unverifiable but considered Valid. [ Extern ] Froms for 'flush_all' (file share/libc/stdio.h, line 137) assigns __fc_fopen[0 .. 16 - 1] \from __fc_fopen[0 .. 16 - 1]; Unverifiable but considered Valid. [ Extern ] Froms for 'flush_all' (file share/libc/stdio.h, line 139) assigns \result \from (indirect: __fc_fopen[0 .. 16 - 1]); Unverifiable but considered Valid. [ Extern ] Froms for 'flush_stream' (file share/libc/stdio.h, line 142) assigns *stream \from *stream; Unverifiable but considered Valid. [ Extern ] Froms for 'flush_stream' (file share/libc/stdio.h, line 143) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'flush_all' behavior flush_all by Frama-C kernel. [ Valid ] Behavior 'flush_stream' behavior flush_stream by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fopen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_valid_fd' ensures result_null_or_valid_fd: \result ≡ \null ∨ \subset(\result, &__fc_fopen[0 .. 16 - 1]) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 152) assigns \result \from (indirect: *(filename + (0 .. strlen{Old}(filename)))), (indirect: *(mode + (0 .. strlen{Old}(mode)))), __fc_p_fopen; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fdopen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_valid_fd' ensures result_null_or_valid_fd: \result ≡ \null ∨ \subset(\result, &__fc_fopen[0 .. 16 - 1]) Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 162) assigns \result, __fc_fopen[fd]; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 162) assigns \result \from (indirect: fd), (indirect: *(mode + (0 .. strlen{Old}(mode)))), (indirect: __fc_fopen[fd]), __fc_p_fopen; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 162) assigns __fc_fopen[fd] \from (indirect: fd), (indirect: *(mode + (0 .. strlen{Old}(mode)))), (indirect: __fc_fopen[fd]), __fc_p_fopen; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'freopen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_valid_fd' ensures result_null_or_valid_fd: \result ≡ \null ∨ \result ∈ &__fc_fopen[0 .. 16 - 1] Unverifiable but considered Valid. [ Extern ] Post-condition 'stream_opened' ensures stream_opened: *\old(stream) ∈ __fc_fopen[0 .. 16 - 1] Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 174) assigns \result, *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 174) assigns \result \from (indirect: *(filename + (..))), (indirect: *(mode + (..))), __fc_p_fopen, (indirect: stream); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 176) assigns *stream \from (indirect: *(filename + (..))), (indirect: *(mode + (..))), __fc_p_fopen, (indirect: stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'setbuf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 187) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 187) assigns *stream \from buf; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'setvbuf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 191) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 191) assigns *stream \from buf, mode, size; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vfprintf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 220) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 220) assigns *stream \from *(format + (..)), arg; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vfscanf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 225) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 225) assigns *stream \from *(format + (..)), *stream; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vprintf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 231) assigns *__fc_stdout; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 231) assigns *__fc_stdout \from arg; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vscanf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 235) assigns *__fc_stdin; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 235) assigns *__fc_stdin \from *(format + (..)); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vsnprintf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 240) assigns *(s + (0 .. n - 1)); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 240) assigns *(s + (0 .. n - 1)) \from *(format + (..)), arg; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vsprintf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 246) assigns *(s + (0 ..)); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 246) assigns *(s + (0 ..)) \from *(format + (..)), arg; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fgetc' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_uchar_or_eof' ensures result_uchar_or_eof: (0 ≤ \result ≤ 255) ∨ \result ≡ -1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 259) assigns *stream, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 259) assigns *stream \from *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 260) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fgets' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_same' ensures result_null_or_same: \result ≡ \null ∨ \result ≡ \old(s) Unverifiable but considered Valid. [ Extern ] Post-condition 'initialization,at_least_one' ensures initialization: at_least_one: \result ≢ \null ⇒ \initialized(\old(s) + 0) Unverifiable but considered Valid. [ Extern ] Post-condition 'terminated_string_on_success' ensures terminated_string_on_success: \result ≢ \null ⇒ valid_string(\old(s)) Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 268) assigns *(s + (0 .. size - 1)), \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 268) assigns *(s + (0 .. size - 1)) \from (indirect: size), (indirect: *stream); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 269) assigns \result \from s, (indirect: size), (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fputc' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 282) assigns *stream, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 282) assigns *stream \from c, *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 283) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fputs' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 289) assigns *stream, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 289) assigns *stream \from *(s + (0 .. strlen{Old}(s))), *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 290) assigns \result \from (indirect: *(s + (0 .. strlen{Old}(s)))), (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'getc' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 297) assigns \result, *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 297) assigns \result \from *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 297) assigns *stream \from *stream; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'getchar' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 302) assigns \result, *__fc_stdin; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 302) assigns \result \from *__fc_stdin; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 302) assigns *__fc_stdin \from *__fc_stdin; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'gets' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_same' ensures result_null_or_same: \result ≡ \old(s) ∨ \result ≡ \null Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 315) assigns *(s + (0 .. gets_length{Old})), \result, *__fc_stdin; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 315) assigns *(s + (0 .. gets_length{Old})) \from *__fc_stdin; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 316) assigns \result \from s, *__fc_stdin; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 317) assigns *__fc_stdin \from *__fc_stdin; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'putc' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 324) assigns *stream, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 324) assigns *stream \from c, *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 325) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'putchar' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 330) assigns *__fc_stdout, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 330) assigns *__fc_stdout \from c, *__fc_stdout; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 331) assigns \result \from (indirect: *__fc_stdout); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'puts' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 337) assigns *__fc_stdout, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 337) assigns *__fc_stdout \from *(s + (0 .. strlen{Old}(s))), *__fc_stdout; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 338) assigns \result \from (indirect: *(s + (0 .. strlen{Old}(s)))), (indirect: *__fc_stdout); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ungetc' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_ok_or_error' ensures result_ok_or_error: \result ≡ \old(c) ∨ \result ≡ -1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 344) assigns *stream, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 344) assigns *stream \from (indirect: c); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 345) assigns \result \from (indirect: c), (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fread' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'size_read' ensures size_read: \result ≤ \old(nmemb) Unverifiable but considered Valid. [ Extern ] Post-condition 'initialization' ensures initialization: \initialized((char *)\old(ptr) + (0 .. \result * \old(size) - 1)) Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 353) assigns *((char *)ptr + (0 .. nmemb * size - 1)), *stream, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 353) assigns *((char *)ptr + (0 .. nmemb * size - 1)) \from (indirect: size), (indirect: nmemb), (indirect: *stream); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 353) assigns *stream \from (indirect: size), (indirect: nmemb), (indirect: *stream); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 355) assigns \result \from size, (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fwrite' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'size_written' ensures size_written: \result ≤ \old(nmemb) Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 366) assigns *stream, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 366) assigns *stream \from (indirect: *((char *)ptr + (0 .. nmemb * size - 1))); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 366) assigns \result \from (indirect: *((char *)ptr + (0 .. nmemb * size - 1))); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fgetpos' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 377) assigns *pos, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 377) assigns *pos \from (indirect: *stream); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 378) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fseek' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 386) assigns *stream, \result, __fc_errno; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 386) assigns *stream \from *stream, (indirect: offset), (indirect: whence); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 387) assigns \result \from (indirect: *stream), (indirect: offset), (indirect: whence); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 387) assigns __fc_errno \from (indirect: *stream), (indirect: offset), (indirect: whence); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fsetpos' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 396) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 396) assigns *stream \from *pos; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ftell' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'success_or_error' ensures success_or_error: \result ≡ -1 ∨ (\result ≥ 0 ∧ __fc_errno ≡ \old(__fc_errno)) Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 402) assigns \result, __fc_errno; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 402) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 402) assigns __fc_errno \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'rewind' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 410) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 410) assigns *stream \from \nothing; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'clearerr' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 416) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 416) assigns *stream \from \nothing; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'feof' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 422) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fileno' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 428) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'flockfile' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 434) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 434) assigns *stream \from \nothing; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'funlockfile' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 440) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 440) assigns *stream \from \nothing; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ftrylockfile' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 446) assigns \result, *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 446) assigns \result \from \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 446) assigns *stream \from \nothing; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ferror' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 452) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'perror' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 458) assigns __fc_stdout; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 458) assigns __fc_stdout \from __fc_errno, *(s + (0 .. strlen{Old}(s))); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'getc_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 464) assigns \result, *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 464) assigns \result \from *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 464) assigns *stream \from *stream; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'getchar_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 469) assigns \result \from *__fc_stdin; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'putc_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 475) assigns *stream, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 475) assigns *stream \from c; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 476) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'putchar_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 481) assigns *__fc_stdout, \result; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 481) assigns *__fc_stdout \from c; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 482) assigns \result \from (indirect: *__fc_stdout); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'clearerr_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 488) assigns *stream; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 488) assigns *stream \from \nothing; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'feof_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 494) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ferror_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 500) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fileno_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 506) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'popen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_error_or_valid_open_pipe' ensures result_error_or_valid_open_pipe: \result ≡ \null ∨ (\subset(\result, &__fc_fopen[0 .. 16 - 1]) ∧ is_open_pipe(\result)) Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 533) assigns \result, __fc_fopen[0 ..]; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 533) assigns \result \from (indirect: *command), (indirect: *type), __fc_p_fopen; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 535) assigns __fc_fopen[0 ..] \from (indirect: *command), (indirect: *type), __fc_fopen[0 ..]; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'pclose' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'closed_stream' ensures closed_stream: ¬is_open_pipe(\old(stream)) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 547) assigns \result \from (indirect: *stream); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function '__fc_fpclassifyf' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'nan' 'fp_nan' ensures fp_nan: \result ≡ 0 Unverifiable but considered Valid. [ Extern ] Post-condition for 'inf' 'fp_infinite' ensures fp_infinite: \result ≡ 1 Unverifiable but considered Valid. [ Extern ] Post-condition for 'zero' 'fp_zero' ensures fp_zero: \result ≡ 2 Unverifiable but considered Valid. [ Extern ] Post-condition for 'subnormal' 'fp_subnormal' ensures fp_subnormal: \result ≡ 3 Unverifiable but considered Valid. [ Extern ] Post-condition for 'normal' 'fp_normal' ensures fp_normal: \result ≡ 4 Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 67) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'inf' behavior inf by Frama-C kernel. [ Valid ] Behavior 'nan' behavior nan by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. [ Valid ] Behavior 'subnormal' behavior subnormal by Frama-C kernel. [ Valid ] Behavior 'zero' behavior zero by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function '__fc_fpclassify' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'nan' 'fp_nan' ensures fp_nan: \result ≡ 0 Unverifiable but considered Valid. [ Extern ] Post-condition for 'inf' 'fp_infinite' ensures fp_infinite: \result ≡ 1 Unverifiable but considered Valid. [ Extern ] Post-condition for 'zero' 'fp_zero' ensures fp_zero: \result ≡ 2 Unverifiable but considered Valid. [ Extern ] Post-condition for 'subnormal' 'fp_subnormal' ensures fp_subnormal: \result ≡ 3 Unverifiable but considered Valid. [ Extern ] Post-condition for 'normal' 'fp_normal' ensures fp_normal: \result ≡ 4 Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 91) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'inf' behavior inf by Frama-C kernel. [ Valid ] Behavior 'nan' behavior nan by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. [ Valid ] Behavior 'subnormal' behavior subnormal by Frama-C kernel. [ Valid ] Behavior 'zero' behavior zero by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'acos' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'normal' 'positive_result' ensures positive_result: \is_finite(\result) ∧ \result ≥ 0 Unverifiable but considered Valid. [ Extern ] Post-condition for 'domain_error' 'errno_set' ensures errno_set: __fc_errno ≡ 1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/math.h, line 128) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'domain_error' (file share/libc/math.h, line 135) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'normal' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 128) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 128) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 135) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 135) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'normal' (file share/libc/math.h, line 131) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'domain_error' behavior domain_error by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'acosf' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'normal' 'positive_result' ensures positive_result: \is_finite(\result) ∧ \result ≥ 0 Unverifiable but considered Valid. [ Extern ] Post-condition for 'domain_error' 'errno_set' ensures errno_set: __fc_errno ≡ 1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/math.h, line 142) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'domain_error' (file share/libc/math.h, line 149) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'normal' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 142) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 142) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 149) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 149) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'normal' (file share/libc/math.h, line 145) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'domain_error' behavior domain_error by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'acosl' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'normal' 'positive_result' ensures positive_result: \is_finite(\result) ∧ \result ≥ 0 Unverifiable but considered Valid. [ Extern ] Post-condition for 'domain_error' 'errno_set' ensures errno_set: __fc_errno ≡ 1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/math.h, line 156) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'domain_error' (file share/libc/math.h, line 163) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'normal' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 156) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 156) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 163) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 163) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'normal' (file share/libc/math.h, line 159) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'domain_error' behavior domain_error by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'asin' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'normal' 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition for 'domain_error' 'errno_set' ensures errno_set: __fc_errno ≡ 1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/math.h, line 170) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'domain_error' (file share/libc/math.h, line 177) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'normal' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 170) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 170) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 177) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 177) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'normal' (file share/libc/math.h, line 173) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'domain_error' behavior domain_error by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'asinf' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'normal' 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition for 'domain_error' 'errno_set' ensures errno_set: __fc_errno ≡ 1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/math.h, line 184) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'domain_error' (file share/libc/math.h, line 191) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'normal' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 184) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 184) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 191) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 191) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'normal' (file share/libc/math.h, line 187) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'domain_error' behavior domain_error by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'asinl' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'normal' 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition for 'domain_error' 'errno_set' ensures errno_set: __fc_errno ≡ 1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/math.h, line 198) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'domain_error' (file share/libc/math.h, line 205) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'normal' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 198) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 198) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 205) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 205) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'normal' (file share/libc/math.h, line 201) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'domain_error' behavior domain_error by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'atanf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'result_domain' ensures result_domain: -1.571 ≤ \result ≤ 1.571 Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 212) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'atan' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'result_domain' ensures result_domain: -1.571 ≤ \result ≤ 1.571 Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 219) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'atanl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'result_domain' ensures result_domain: -1.571 ≤ \result ≤ 1.571 Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 226) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'atan2' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 234) assigns \result \from x, y; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'atan2f' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 241) assigns \result \from x, y; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'cos' -------------------------------------------------------------------------------- [ Valid ] Pre-condition 'finite_arg' requires finite_arg: \is_finite(x) by Call Preconditions. [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'result_domain' ensures result_domain: -1. ≤ \result ≤ 1. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 249) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'cosf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'result_domain' ensures result_domain: -1. ≤ \result ≤ 1. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 256) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'cosl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'result_domain' ensures result_domain: -1. ≤ \result ≤ 1. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 263) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'sin' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'result_domain' ensures result_domain: -1. ≤ \result ≤ 1. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 270) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'sinf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'result_domain' ensures result_domain: -1. ≤ \result ≤ 1. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 277) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'sinl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'result_domain' ensures result_domain: -1. ≤ \result ≤ 1. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 284) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'acosh' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'normal' 'positive_result' ensures positive_result: \is_finite(\result) ∧ \result ≥ 0 Unverifiable but considered Valid. [ Extern ] Post-condition for 'infinite' 'result_plus_infinity' ensures result_plus_infinity: \is_plus_infinity(\result) Unverifiable but considered Valid. [ Extern ] Post-condition for 'domain_error' 'errno_set' ensures errno_set: __fc_errno ≡ 1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/math.h, line 295) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'domain_error' (file share/libc/math.h, line 306) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'infinite' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Assigns for 'normal' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 295) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 295) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 306) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 306) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'infinite' (file share/libc/math.h, line 302) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'normal' (file share/libc/math.h, line 298) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'domain_error' behavior domain_error by Frama-C kernel. [ Valid ] Behavior 'infinite' behavior infinite by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'acoshf' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'normal' 'positive_result' ensures positive_result: \is_finite(\result) ∧ \result ≥ 0 Unverifiable but considered Valid. [ Extern ] Post-condition for 'infinite' 'result_plus_infinity' ensures result_plus_infinity: \is_plus_infinity(\result) Unverifiable but considered Valid. [ Extern ] Post-condition for 'domain_error' 'errno_set' ensures errno_set: __fc_errno ≡ 1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/math.h, line 313) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'domain_error' (file share/libc/math.h, line 324) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'infinite' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Assigns for 'normal' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 313) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 313) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 324) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 324) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'infinite' (file share/libc/math.h, line 320) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'normal' (file share/libc/math.h, line 316) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'domain_error' behavior domain_error by Frama-C kernel. [ Valid ] Behavior 'infinite' behavior infinite by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'acoshl' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'normal' 'positive_result' ensures positive_result: \is_finite(\result) ∧ \result ≥ 0 Unverifiable but considered Valid. [ Extern ] Post-condition for 'infinite' 'result_plus_infinity' ensures result_plus_infinity: \is_plus_infinity(\result) Unverifiable but considered Valid. [ Extern ] Post-condition for 'domain_error' 'errno_set' ensures errno_set: __fc_errno ≡ 1 Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/math.h, line 331) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'domain_error' (file share/libc/math.h, line 342) assigns __fc_errno, \result; Unverifiable but considered Valid. [ Extern ] Assigns for 'infinite' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Assigns for 'normal' nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 331) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 331) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 342) assigns __fc_errno \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'domain_error' (file share/libc/math.h, line 342) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'infinite' (file share/libc/math.h, line 338) assigns \result \from x; Unverifiable but considered Valid. [ Extern ] Froms for 'normal' (file share/libc/math.h, line 334) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. [ Valid ] Behavior 'domain_error' behavior domain_error by Frama-C kernel. [ Valid ] Behavior 'infinite' behavior infinite by Frama-C kernel. [ Valid ] Behavior 'normal' behavior normal by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'exp' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'res_finite' ensures res_finite: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'positive_result' ensures positive_result: \result > 0. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 370) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'expf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'res_finite' ensures res_finite: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'positive_result' ensures positive_result: \result > 0. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 378) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'log' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 408) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'logf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 415) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'logl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 422) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'log10' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 429) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'log10f' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 436) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'log10l' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 443) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'log2' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 454) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'log2f' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 461) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'log2l' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 468) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fabs' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'res_finite' ensures res_finite: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'positive_result' ensures positive_result: \result ≥ 0. Unverifiable but considered Valid. [ Extern ] Post-condition 'equal_magnitude_result' ensures equal_magnitude_result: \result ≡ \old(x) ∨ \result ≡ -\old(x) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 494) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fabsf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'res_finite' ensures res_finite: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'positive_result' ensures positive_result: \result ≥ 0. Unverifiable but considered Valid. [ Extern ] Post-condition 'equal_magnitude_result' ensures equal_magnitude_result: \result ≡ \old(x) ∨ \result ≡ -\old(x) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 502) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fabsl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'res_finite' ensures res_finite: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'positive_result' ensures positive_result: \result ≥ 0. Unverifiable but considered Valid. [ Extern ] Post-condition 'equal_magnitude_result' ensures equal_magnitude_result: \result ≡ \old(x) ∨ \result ≡ -\old(x) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 510) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'pow' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 523) assigns \result \from x, y; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'powf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 530) assigns \result \from x, y; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'sqrt' -------------------------------------------------------------------------------- [ Valid ] Pre-condition 'finite_arg' requires finite_arg: \is_finite(x) by Call Preconditions. [ Valid ] Pre-condition 'arg_positive' requires arg_positive: x ≥ -0. by Call Preconditions. [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'positive_result' ensures positive_result: \result ≥ -0. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 539) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'sqrtf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'positive_result' ensures positive_result: \result ≥ -0. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 547) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'sqrtl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Post-condition 'positive_result' ensures positive_result: \result ≥ -0. Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 555) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ceil' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 578) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ceilf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 584) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ceill' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 591) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'floor' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 597) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'floorf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 603) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'floorl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 609) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'round' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 631) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'roundf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 637) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'roundl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 643) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'trunc' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 657) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'truncf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 663) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'truncl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 669) assigns \result \from x; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fmod' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 676) assigns \result \from x, y; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fmodf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'finite_result' ensures finite_result: \is_finite(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 683) assigns \result \from x, y; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'nan' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_is_nan' ensures result_is_nan: \is_NaN(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 704) assigns \result \from (indirect: *(tagp + (0 ..))); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'nanf' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_is_nan' ensures result_is_nan: \is_NaN(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 711) assigns \result \from (indirect: *(tagp + (0 ..))); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'nanl' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_is_nan' ensures result_is_nan: \is_NaN(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 718) assigns \result \from (indirect: *(tagp + (0 ..))); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function '__fc_infinity' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_is_infinity' ensures result_is_infinity: \is_plus_infinity(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 766) assigns \result \from \nothing; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function '__fc_nan' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_is_nan' ensures result_is_nan: \is_NaN(\result) Unverifiable but considered Valid. [ Extern ] Assigns nothing assigns \nothing; Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/math.h, line 772) assigns \result \from \nothing; Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'idct' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 129) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 131) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 141) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 143) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 145) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ Partial ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 147) assert Eva: initialization: \initialized(&tmp1[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/idct.c, line 145) [ Partial ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 150) assert Eva: initialization: \initialized(&tmp1[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/idct.c, line 145) [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 163) assert Eva: initialization: \initialized(&tmp2[k][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 163) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 166) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 176) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 178) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 180) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ Partial ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 182) assert Eva: initialization: \initialized(&tmp1[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/idct.c, line 180) [ Partial ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 185) assert Eva: initialization: \initialized(&tmp1[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/idct.c, line 180) [ - ] Assertion 'Eva,initialization' (file tests/idct/idct.c, line 129) assert Eva: initialization: \initialized(&(*(m1 + k))[j]); tried with Eva. [ Valid ] Instance of 'Pre-condition 'finite_arg'' at call 'sqrt' (file tests/idct/idct.c, line 90) status of 'requires finite_arg: \is_finite(x)' of sqrt at stmt 525 by Eva. [ Valid ] Instance of 'Pre-condition 'arg_positive'' at call 'sqrt' (file tests/idct/idct.c, line 90) status of 'requires arg_positive: x ≥ -0.' of sqrt at stmt 525 by Eva. [ Valid ] Instance of 'Pre-condition 'finite_arg'' at call 'cos' (file tests/idct/idct.c, line 91) status of 'requires finite_arg: \is_finite(x)' of cos at stmt 528 by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'IEEE_1180_1990_dctf' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 109) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 116) assert Eva: initialization: \initialized(&tmp1[i][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 116) assert Eva: initialization: \initialized(&tmp2[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 117) assert Eva: initialization: \initialized(&tmp2[i][j]); tried with Eva. [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 119) assert Eva: initialization: \initialized(&tmp2[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 117) [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 121) assert Eva: initialization: \initialized(&tmp2[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 117) [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 122) assert Eva: initialization: \initialized(&tmp2[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 117) [ - ] Assertion 'Eva,float_to_int' (file tests/idct/ieee_1180_1990.c, line 122) assert Eva: float_to_int: -2147483649 < tmp2[i][j] + 0.5; tried with Eva. [ - ] Assertion 'Eva,float_to_int' (file tests/idct/ieee_1180_1990.c, line 122) assert Eva: float_to_int: tmp2[i][j] + 0.5 < 2147483648; tried with Eva. [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 124) assert Eva: initialization: \initialized(&tmp2[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 117) [ - ] Assertion 'Eva,float_to_int' (file tests/idct/ieee_1180_1990.c, line 124) assert Eva: float_to_int: -2147483649 < tmp2[i][j] - 0.5; tried with Eva. [ - ] Assertion 'Eva,float_to_int' (file tests/idct/ieee_1180_1990.c, line 124) assert Eva: float_to_int: tmp2[i][j] - 0.5 < 2147483648; tried with Eva. [ Valid ] Instance of 'Pre-condition 'finite_arg'' at call 'sqrt' (file tests/idct/ieee_1180_1990.c, line 100) status of 'requires finite_arg: \is_finite(x)' of sqrt at stmt 41 by Eva. [ Valid ] Instance of 'Pre-condition 'arg_positive'' at call 'sqrt' (file tests/idct/ieee_1180_1990.c, line 100) status of 'requires arg_positive: x ≥ -0.' of sqrt at stmt 41 by Eva. [ Valid ] Instance of 'Pre-condition 'finite_arg'' at call 'cos' (file tests/idct/ieee_1180_1990.c, line 101) status of 'requires finite_arg: \is_finite(x)' of cos at stmt 44 by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'IEEE_1180_1990_idctf' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 150) assert Eva: initialization: \initialized(&(*(m1 + k))[j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 150) assert Eva: initialization: \initialized(&tmp1[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 157) assert Eva: initialization: \initialized(&tmp1[i][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 157) assert Eva: initialization: \initialized(&tmp2[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 158) assert Eva: initialization: \initialized(&tmp2[i][j]); tried with Eva. [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 160) assert Eva: initialization: \initialized(&tmp2[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 158) [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 162) assert Eva: initialization: \initialized(&tmp2[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 158) [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 163) assert Eva: initialization: \initialized(&tmp2[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 158) [ - ] Assertion 'Eva,float_to_int' (file tests/idct/ieee_1180_1990.c, line 163) assert Eva: float_to_int: -2147483649 < tmp2[i][j] + 0.5; tried with Eva. [ - ] Assertion 'Eva,float_to_int' (file tests/idct/ieee_1180_1990.c, line 163) assert Eva: float_to_int: tmp2[i][j] + 0.5 < 2147483648; tried with Eva. [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 165) assert Eva: initialization: \initialized(&tmp2[i][j]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 158) [ - ] Assertion 'Eva,float_to_int' (file tests/idct/ieee_1180_1990.c, line 165) assert Eva: float_to_int: -2147483649 < tmp2[i][j] - 0.5; tried with Eva. [ - ] Assertion 'Eva,float_to_int' (file tests/idct/ieee_1180_1990.c, line 165) assert Eva: float_to_int: tmp2[i][j] - 0.5 < 2147483648; tried with Eva. [ Valid ] Instance of 'Pre-condition 'finite_arg'' at call 'sqrt' (file tests/idct/ieee_1180_1990.c, line 140) status of 'requires finite_arg: \is_finite(x)' of sqrt at stmt 121 by Eva. [ Valid ] Instance of 'Pre-condition 'arg_positive'' at call 'sqrt' (file tests/idct/ieee_1180_1990.c, line 140) status of 'requires arg_positive: x ≥ -0.' of sqrt at stmt 121 by Eva. [ Valid ] Instance of 'Pre-condition 'finite_arg'' at call 'cos' (file tests/idct/ieee_1180_1990.c, line 141) status of 'requires finite_arg: \is_finite(x)' of cos at stmt 124 by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 191) assert Eva: initialization: \initialized(&m2[i][j]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 218) assert Eva: initialization: \initialized(&m3[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 218) assert Eva: initialization: \initialized(&m4[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 219) assert Eva: initialization: \initialized(&res[0].pme[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 231) assert Eva: initialization: \initialized(&res[0].pmse[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 242) assert Eva: initialization: \initialized(&m3[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 242) assert Eva: initialization: \initialized(&m4[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 243) assert Eva: initialization: \initialized(&res[3].pme[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 255) assert Eva: initialization: \initialized(&res[3].pmse[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 264) assert Eva: initialization: \initialized(&m3[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 264) assert Eva: initialization: \initialized(&m4[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 265) assert Eva: initialization: \initialized(&res[1].pme[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 277) assert Eva: initialization: \initialized(&res[1].pmse[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 288) assert Eva: initialization: \initialized(&m3[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 288) assert Eva: initialization: \initialized(&m4[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 289) assert Eva: initialization: \initialized(&res[4].pme[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 301) assert Eva: initialization: \initialized(&res[4].pmse[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 310) assert Eva: initialization: \initialized(&m3[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 310) assert Eva: initialization: \initialized(&m4[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 311) assert Eva: initialization: \initialized(&res[2].pme[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 323) assert Eva: initialization: \initialized(&res[2].pmse[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 334) assert Eva: initialization: \initialized(&m3[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 334) assert Eva: initialization: \initialized(&m4[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 335) assert Eva: initialization: \initialized(&res[5].pme[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 347) assert Eva: initialization: \initialized(&res[5].pmse[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 357) assert Eva: initialization: \initialized(&res[i].pmse[j][k]); tried with Eva. [ - ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 368) assert Eva: initialization: \initialized(&res[i].pme[j][k]); tried with Eva. [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 358) assert Eva: initialization: \initialized(&res[i].pmse[j][k]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 357) [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 369) assert Eva: initialization: \initialized(&res[i].pme[j][k]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 368) [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 369) assert Eva: initialization: \initialized(&res[i].pme[j][k]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 368) [ Partial ] Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 369) assert Eva: initialization: \initialized(&res[i].pme[j][k]); By RedundantAlarms, with pending: - Assertion 'Eva,initialization' (file tests/idct/ieee_1180_1990.c, line 368) [ Valid ] Instance of 'Pre-condition (file tests/idct/ieee_1180_1990.c, line 195)' at call 'printf_va_1' (file tests/idct/ieee_1180_1990.c, line 195) status of 'requires valid_read_string(format)' of printf_va_1 at stmt 238 by Eva. [ Valid ] Instance of 'Pre-condition (file tests/idct/ieee_1180_1990.c, line 196)' at call 'printf_va_2' (file tests/idct/ieee_1180_1990.c, line 196) status of 'requires valid_read_string(format)' of printf_va_2 at stmt 239 by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'printf_va_1' -------------------------------------------------------------------------------- [ Valid ] Pre-condition (file tests/idct/ieee_1180_1990.c, line 195) requires valid_read_string(format) by Call Preconditions. [ Extern ] Assigns (file tests/idct/ieee_1180_1990.c, line 195) assigns \result, __fc_stdout->__fc_FILE_data; Unverifiable but considered Valid. [ Extern ] Froms (file tests/idct/ieee_1180_1990.c, line 195) assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))); Unverifiable but considered Valid. [ Extern ] Froms (file tests/idct/ieee_1180_1990.c, line 195) assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'printf_va_2' -------------------------------------------------------------------------------- [ Valid ] Pre-condition (file tests/idct/ieee_1180_1990.c, line 196) requires valid_read_string(format) by Call Preconditions. [ Extern ] Assigns (file tests/idct/ieee_1180_1990.c, line 196) assigns \result, __fc_stdout->__fc_FILE_data; Unverifiable but considered Valid. [ Extern ] Froms (file tests/idct/ieee_1180_1990.c, line 196) assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))); Unverifiable but considered Valid. [ Extern ] Froms (file tests/idct/ieee_1180_1990.c, line 196) assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))); Unverifiable but considered Valid. [ Valid ] Default behavior default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 179 Completely validated 16 Locally validated 484 Considered valid 56 To be validated 735 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/impact/0000777000000000000000000000000013571573400013632 5ustar frama-c-20.0-Calcium/tests/impact/alias.i0000666000000000000000000000047213571573400015100 0ustar /* run.config STDOPT: +"-impact-pragma f" +"-lib-entry" +"-main f" +"-remove-redundant-alarms" */ int P,c; /*@ requires \valid(x); */ int f(int *x) { /*@ impact pragma stmt; */ int *y = x+1; *y = 4; int a = *(x+1) + 2; *y = 2; if (c) return *(x+1); else { y = P; return *y; } } frama-c-20.0-Calcium/tests/impact/call.i0000666000000000000000000000164413571573400014724 0ustar /* run.config GCC: STDOPT: +"-impact-pragma main" STDOPT: +"-impact-pragma main2" +"-main main2" STDOPT: +"-impact-pragma main3" +"-main main3" */ /*@ ghost int G; */ /*@ assigns G \from p; */ void p1 (int p); void p2 (int); int X; void test (void) { if (X) p1(1); else p2(0); } /* ************************************************************************* */ void main (int x) { /*@ impact pragma stmt; */ X = x; test (); } /* ************************************************************************* */ void call_test (void) { test (); } void main2(int x) { /*@ impact pragma stmt; */ X = x; call_test (); } /* ************************************************************************* */ /*@ assigns G; */ void p3 (int); void test3 (void) { if (X) p3(1); else p2(0); } void call_test3 (void) { test3 (); } void main3(int x) { /*@ impact pragma stmt; */ X = x; call_test3 (); } frama-c-20.0-Calcium/tests/impact/called.i0000666000000000000000000000063613571573400015235 0ustar /* run.config STDOPT: +"-impact-pragma g" +"-lib-entry" +"-main g" STDOPT: +"-impact-pragma h" +"-lib-entry" +"-main h" */ int X; int f(int x, int y) { X = x; return y; } void g() { int a, b, c, d; b = 0; /*@ impact pragma stmt; */ a = 0; c = f(a,b); d = X; c = f(a,d); } void h() { int a, b, c, d; /*@ impact pragma stmt; */ b = 0; a = 0; c = f(a,b); d = X; c = f(a,d); } frama-c-20.0-Calcium/tests/impact/depend1.i0000666000000000000000000000033413571573400015324 0ustar /* run.config STDOPT: +"-impact-pragma main" */ int find(int x) { return x; } int main() { int a = find(1); /*@ impact pragma stmt; */ int b = find(2); int c = find(b); int d = find(3); return c ; } frama-c-20.0-Calcium/tests/impact/depend2.i0000666000000000000000000000035713571573400015332 0ustar /* run.config STDOPT: +"-impact-pragma main" */ int find(int x) { return x; } int apply(int x,int y) { return find(x)+y; } int main() { int a = apply(1,100); /*@ impact pragma stmt; */ int b = apply(2,200); return a+b ; } frama-c-20.0-Calcium/tests/impact/depend3.c0000666000000000000000000000064413571573400015324 0ustar /* run.config STDOPT: +"-impact-pragma main" */ #define N 32 extern int ring[N] ; int find(int x) { for (int k=0; k tests/impact/call.i:16 (sid 3): p1(1); tests/impact/call.i:16 (sid 4): p2(0); tests/impact/call.i:24 (sid 9): test(); [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/call.1.res.oracle0000666000000000000000000000405013571573400020127 0ustar [kernel] Parsing tests/impact/call.i (no preprocessing) [impact] beginning analysis [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} X ∈ {0} [eva] computing for function call_test <- main2. Called from tests/impact/call.i:36. [eva] computing for function test <- call_test <- main2. Called from tests/impact/call.i:30. [eva] computing for function p1 <- test <- call_test <- main2. Called from tests/impact/call.i:16. [eva] using specification for function p1 [eva] Done for function p1 [eva] computing for function p2 <- test <- call_test <- main2. Called from tests/impact/call.i:16. [kernel:annot:missing-spec] tests/impact/call.i:16: Warning: Neither code nor specification for function p2, generating default assigns from the prototype [eva] using specification for function p2 [eva] Done for function p2 [eva] Recording results for test [eva] Done for function test [eva] Recording results for call_test [eva] Done for function call_test [eva] Recording results for main2 [eva] done for function main2 [pdg] computing for function main2 [from] Computing for function call_test [from] Computing for function test <-call_test [from] Computing for function p1 <-test <-call_test [from] Done for function p1 [from] Computing for function p2 <-test <-call_test [from] Done for function p2 [from] Done for function test [from] Done for function call_test [pdg] done for function main2 [pdg] computing for function call_test [pdg] done for function call_test [pdg] computing for function test [pdg] done for function test [pdg] computing for function p1 [pdg] done for function p1 [pdg] computing for function p2 [pdg] done for function p2 [impact] impacted statements of stmt(s) 16 are: tests/impact/call.i:16 (sid 2): if(X) <..> tests/impact/call.i:16 (sid 3): p1(1); tests/impact/call.i:16 (sid 4): p2(0); tests/impact/call.i:30 (sid 12): test(); tests/impact/call.i:36 (sid 17): call_test(); [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/call.2.res.oracle0000666000000000000000000000377313571573400020143 0ustar [kernel] Parsing tests/impact/call.i (no preprocessing) [impact] beginning analysis [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} X ∈ {0} [eva] computing for function call_test3 <- main3. Called from tests/impact/call.i:55. [eva] computing for function test3 <- call_test3 <- main3. Called from tests/impact/call.i:49. [eva] computing for function p3 <- test3 <- call_test3 <- main3. Called from tests/impact/call.i:45. [eva] using specification for function p3 [eva] tests/impact/call.i:41: Warning: no \from part for clause 'assigns G;' [eva] Done for function p3 [eva] computing for function p2 <- test3 <- call_test3 <- main3. Called from tests/impact/call.i:45. [kernel:annot:missing-spec] tests/impact/call.i:45: Warning: Neither code nor specification for function p2, generating default assigns from the prototype [eva] using specification for function p2 [eva] Done for function p2 [eva] Recording results for test3 [eva] Done for function test3 [eva] Recording results for call_test3 [eva] Done for function call_test3 [eva] Recording results for main3 [eva] done for function main3 [pdg] computing for function main3 [from] Computing for function call_test3 [from] Computing for function test3 <-call_test3 [from] Computing for function p3 <-test3 <-call_test3 [from] Done for function p3 [from] Computing for function p2 <-test3 <-call_test3 [from] Done for function p2 [from] Done for function test3 [from] Done for function call_test3 [pdg] done for function main3 [pdg] computing for function call_test3 [pdg] done for function call_test3 [pdg] computing for function test3 [pdg] done for function test3 [pdg] computing for function p3 [pdg] done for function p3 [impact] impacted statements of stmt(s) 30 are: tests/impact/call.i:45 (sid 22): p3(1); tests/impact/call.i:49 (sid 26): test3(); tests/impact/call.i:55 (sid 31): call_test3(); [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/called.0.res.oracle0000666000000000000000000000176113571573400020445 0ustar [kernel] Parsing tests/impact/called.i (no preprocessing) [impact] beginning analysis [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ [--..--] [eva] computing for function f <- g. Called from tests/impact/called.i:15. [eva] Recording results for f [eva] Done for function f [eva] tests/impact/called.i:17: Reusing old results for call to f [eva] Recording results for g [eva] done for function g [pdg] computing for function g [from] Computing for function f [from] Done for function f [pdg] done for function g [pdg] computing for function f [pdg] done for function f [impact] impacted statements of stmt(s) 7 are: tests/impact/called.i:8 (sid 1): X = x; tests/impact/called.i:8 (sid 3): return y; tests/impact/called.i:15 (sid 8): c = f(a,b); tests/impact/called.i:16 (sid 9): d = X; tests/impact/called.i:17 (sid 10): c = f(a,d); [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/called.1.res.oracle0000666000000000000000000000154713571573400020450 0ustar [kernel] Parsing tests/impact/called.i (no preprocessing) [impact] beginning analysis [eva] Analyzing an incomplete application starting at h [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ [--..--] [eva] computing for function f <- h. Called from tests/impact/called.i:25. [eva] Recording results for f [eva] Done for function f [eva] tests/impact/called.i:27: Reusing old results for call to f [eva] Recording results for h [eva] done for function h [pdg] computing for function h [from] Computing for function f [from] Done for function f [pdg] done for function h [pdg] computing for function f [pdg] done for function f [impact] impacted statements of stmt(s) 14 are: tests/impact/called.i:8 (sid 3): return y; tests/impact/called.i:25 (sid 16): c = f(a,b); [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/depend1.res.oracle0000666000000000000000000000233613571573400020402 0ustar [kernel] Parsing tests/impact/depend1.i (no preprocessing) [impact] beginning analysis [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function find <- main. Called from tests/impact/depend1.i:10. [eva] Recording results for find [eva] Done for function find [eva] computing for function find <- main. Called from tests/impact/depend1.i:12. [eva] Recording results for find [eva] Done for function find [eva] tests/impact/depend1.i:13: Reusing old results for call to find [eva] computing for function find <- main. Called from tests/impact/depend1.i:14. [eva] Recording results for find [eva] Done for function find [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function find [from] Done for function find [pdg] done for function main [pdg] computing for function find [pdg] done for function find [impact] impacted statements of stmt(s) 6 are: tests/impact/depend1.i:6 (sid 2): return x; tests/impact/depend1.i:13 (sid 7): int c = find(b); tests/impact/depend1.i:15 (sid 10): return c; [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/depend2.res.oracle0000666000000000000000000000254713571573400020407 0ustar [kernel] Parsing tests/impact/depend2.i (no preprocessing) [impact] beginning analysis [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function apply <- main. Called from tests/impact/depend2.i:11. [eva] computing for function find <- apply <- main. Called from tests/impact/depend2.i:7. [eva] Recording results for find [eva] Done for function find [eva] Recording results for apply [eva] Done for function apply [eva] computing for function apply <- main. Called from tests/impact/depend2.i:13. [eva] computing for function find <- apply <- main. Called from tests/impact/depend2.i:7. [eva] Recording results for find [eva] Done for function find [eva] Recording results for apply [eva] Done for function apply [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function apply [from] Computing for function find <-apply [from] Done for function find [from] Done for function apply [pdg] done for function main [pdg] computing for function apply [pdg] done for function apply [impact] impacted statements of stmt(s) 11 are: tests/impact/depend2.i:14 (sid 13): __retres = a + b; tests/impact/depend2.i:14 (sid 18): return __retres; [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/depend3.res.oracle0000666000000000000000000000260313571573400020401 0ustar [kernel] Parsing tests/impact/depend3.c (with preprocessing) [impact] beginning analysis [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization ring[0..31] ∈ [--..--] [eva] computing for function apply <- main. Called from tests/impact/depend3.c:22. [eva] computing for function find <- apply <- main. Called from tests/impact/depend3.c:18. [eva] Recording results for find [eva] Done for function find [eva] Recording results for apply [eva] Done for function apply [eva] computing for function apply <- main. Called from tests/impact/depend3.c:24. [eva] computing for function find <- apply <- main. Called from tests/impact/depend3.c:18. [eva] Recording results for find [eva] Done for function find [eva] Recording results for apply [eva] Done for function apply [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function apply [from] Computing for function find <-apply [from] Done for function find [from] Done for function apply [pdg] done for function main [pdg] computing for function apply [pdg] done for function apply [impact] impacted statements of stmt(s) 34 are: tests/impact/depend3.c:25 (sid 36): __retres = a + b; tests/impact/depend3.c:25 (sid 45): return __retres; [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/depend4.res.oracle0000666000000000000000000000467613571573400020416 0ustar [kernel] Parsing tests/impact/depend4.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} r1 ∈ {0} r2 ∈ {0} [eva] computing for function g1 <- main. Called from tests/impact/depend4.i:27. [eva] computing for function aux <- g1 <- main. Called from tests/impact/depend4.i:19. [eva] Recording results for aux [from] Computing for function aux [from] Done for function aux [eva] Done for function aux [eva] Recording results for g1 [from] Computing for function g1 [from] Done for function g1 [eva] Done for function g1 [eva] computing for function f <- main. Called from tests/impact/depend4.i:29. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function g2 <- main. Called from tests/impact/depend4.i:30. [eva] computing for function aux <- g2 <- main. Called from tests/impact/depend4.i:23. [eva] Recording results for aux [from] Computing for function aux [from] Done for function aux [eva] Done for function aux [eva] Recording results for g2 [from] Computing for function g2 [from] Done for function g2 [eva] Done for function g2 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to aux at tests/impact/depend4.i:19 (by g1): r2 FROM a; p; cond [from] call to aux at tests/impact/depend4.i:23 (by g2): r1 FROM a; p; cond [from] call to g1 at tests/impact/depend4.i:27 (by main): r2 FROM a [from] call to f at tests/impact/depend4.i:29 (by main): a FROM \nothing [from] call to g2 at tests/impact/depend4.i:30 (by main): r1 FROM a [from] entry point: a FROM \nothing r1 FROM \nothing r2 FROM a [from] ====== END OF CALLWISE DEPENDENCIES ====== [impact] beginning analysis [pdg] computing for function main [pdg] done for function main [pdg] computing for function f [pdg] done for function f [pdg] computing for function g2 [pdg] done for function g2 [pdg] computing for function aux [pdg] done for function aux [impact] impacted statements of stmt(s) 18 are: tests/impact/depend4.i:13 (sid 6): r1 = *p; tests/impact/depend4.i:15 (sid 7): r2 = *p; tests/impact/depend4.i:23 (sid 13): aux(& a,1); tests/impact/depend4.i:30 (sid 19): g2(); [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/depend5.res.oracle0000666000000000000000000000357513571573400020414 0ustar [kernel] Parsing tests/impact/depend5.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} d ∈ {0} e ∈ {0} [eva] computing for function f <- main. Called from tests/impact/depend5.i:23. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/impact/depend5.i:25. [eva] computing for function f <- g <- main. Called from tests/impact/depend5.i:18. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/impact/depend5.i:18 (by g): b FROM a; e [from] call to f at tests/impact/depend5.i:23 (by main): c FROM a; d [from] call to g at tests/impact/depend5.i:25 (by main): b FROM a d FROM \nothing e FROM \nothing [from] entry point: a FROM \nothing b FROM \nothing c FROM d d FROM \nothing e FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [impact] beginning analysis [pdg] computing for function g [pdg] done for function g [pdg] computing for function main [pdg] done for function main [pdg] computing for function f [pdg] done for function f [impact] impacted statements of stmt(s) 8 are: tests/impact/depend5.i:11 (sid 4): b = e; tests/impact/depend5.i:17 (sid 9): e = d; tests/impact/depend5.i:18 (sid 10): f(); tests/impact/depend5.i:25 (sid 16): g(); [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/first.res.oracle0000666000000000000000000000254313571573400020211 0ustar [kernel] Parsing tests/impact/first.i (no preprocessing) [impact] beginning analysis [eva] Analyzing an incomplete application starting at impact [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ [--..--] b ∈ [--..--] c ∈ [--..--] e ∈ [--..--] x ∈ [--..--] y ∈ [--..--] z ∈ [--..--] f ∈ [--..--] w ∈ [--..--] [eva:alarm] tests/impact/first.i:12: Warning: signed overflow. assert -2147483648 ≤ b + c; [eva:alarm] tests/impact/first.i:12: Warning: signed overflow. assert b + c ≤ 2147483647; [eva:alarm] tests/impact/first.i:13: Warning: signed overflow. assert -2147483648 ≤ x + e; [eva:alarm] tests/impact/first.i:13: Warning: signed overflow. assert x + e ≤ 2147483647; [eva:alarm] tests/impact/first.i:17: Warning: signed overflow. assert -2147483648 ≤ y + f; [eva:alarm] tests/impact/first.i:17: Warning: signed overflow. assert y + f ≤ 2147483647; [eva] Recording results for impact [eva] done for function impact [pdg] computing for function impact [pdg] done for function impact [impact] impacted statements of stmt(s) 2 are: tests/impact/first.i:12 (sid 5): x = b + c; tests/impact/first.i:13 (sid 6): y = x + e; tests/impact/first.i:17 (sid 9): z = y + f; tests/impact/first.i:18 (sid 10): w = b; [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/initial.res.oracle0000666000000000000000000000774713571573400020526 0ustar [kernel] Parsing tests/impact/initial.i (no preprocessing) [impact] beginning analysis [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x1 ∈ {0} x2 ∈ {0} y2 ∈ {0} z2 ∈ {0} x3 ∈ {0} c ∈ [--..--] [eva] computing for function g1 <- main1. Called from tests/impact/initial.i:25. [eva] computing for function f1 <- g1 <- main1. Called from tests/impact/initial.i:19. [eva] Recording results for f1 [eva] Done for function f1 [eva] Recording results for g1 [eva] Done for function g1 [eva] tests/impact/initial.i:24: starting to merge loop iterations [eva] computing for function g1 <- main1. Called from tests/impact/initial.i:25. [eva] tests/impact/initial.i:19: Reusing old results for call to f1 [eva] Recording results for g1 [eva] Done for function g1 [eva] Recording results for main1 [eva] done for function main1 [from] Computing for function f1 [from] Done for function f1 [from] Computing for function g1 [from] Done for function g1 [pdg] tests/impact/initial.i:24: Warning: no final state. Probably unreachable... [impact] impacted statements of stmt(s) 7 are: [impact] analysis done [impact] beginning analysis [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x1 ∈ {0} x2 ∈ {0} y2 ∈ {0} z2 ∈ {0} x3 ∈ {0} c ∈ [--..--] [eva] computing for function h2 <- main2. Called from tests/impact/initial.i:58. [eva] computing for function g2 <- h2 <- main2. Called from tests/impact/initial.i:52. [eva] computing for function f2 <- g2 <- h2 <- main2. Called from tests/impact/initial.i:46. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function aux2 <- g2 <- h2 <- main2. Called from tests/impact/initial.i:47. [eva] Recording results for aux2 [eva] Done for function aux2 [eva] Recording results for g2 [eva] Done for function g2 [eva] Recording results for h2 [eva] Done for function h2 [eva] Recording results for main2 [eva] done for function main2 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function aux2 [from] Done for function aux2 [from] Computing for function g2 [from] Done for function g2 [from] Computing for function h2 [from] Done for function h2 [pdg] tests/impact/initial.i:57: Warning: no final state. Probably unreachable... [impact] impacted statements of stmt(s) 24 are: tests/impact/initial.i:35 (sid 15): x2 = y2; tests/impact/initial.i:40 (sid 18): y2 = z2; tests/impact/initial.i:46 (sid 24): f2(); tests/impact/initial.i:47 (sid 27): aux2(); tests/impact/initial.i:52 (sid 32): g2(); tests/impact/initial.i:53 (sid 33): z2 = x2; tests/impact/initial.i:58 (sid 38): h2(); [impact] analysis done [impact] beginning analysis [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x1 ∈ {0} x2 ∈ {0} y2 ∈ {0} z2 ∈ {0} x3 ∈ {0} c ∈ [--..--] [eva] computing for function g3 <- main3. Called from tests/impact/initial.i:81. [eva] computing for function f3 <- g3 <- main3. Called from tests/impact/initial.i:69. [eva] Recording results for f3 [eva] Done for function f3 [eva] Recording results for g3 [eva] Done for function g3 [eva] tests/impact/initial.i:80: starting to merge loop iterations [eva] tests/impact/initial.i:81: Reusing old results for call to g3 [eva] Recording results for main3 [eva] done for function main3 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function g3 [from] Done for function g3 [pdg] tests/impact/initial.i:80: Warning: no final state. Probably unreachable... [impact] impacted statements of stmt(s) 44 are: tests/impact/initial.i:71 (sid 47): x3 = x3; tests/impact/initial.i:81 (sid 53): g3(); [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/loop.res.oracle0000666000000000000000000000210713571573400020027 0ustar [kernel] Parsing tests/impact/loop.i (no preprocessing) [impact] beginning analysis [eva] Analyzing an incomplete application starting at loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] x ∈ [--..--] y ∈ [--..--] z ∈ [--..--] w ∈ [--..--] [eva:alarm] tests/impact/loop.i:10: Warning: signed overflow. assert w + 1 ≤ 2147483647; [eva:alarm] tests/impact/loop.i:11: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva:alarm] tests/impact/loop.i:13: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva:alarm] tests/impact/loop.i:14: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for loop [eva] done for function loop [pdg] computing for function loop [pdg] done for function loop [impact] impacted statements of stmt(s) 9 are: tests/impact/loop.i:11 (sid 7): z = y + 1; tests/impact/loop.i:13 (sid 9): x ++; tests/impact/loop.i:14 (sid 10): y = x + 1; tests/impact/loop.i:16 (sid 11): w = z; [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/loop2.res.oracle0000666000000000000000000001667413571573400020127 0ustar [kernel] Parsing tests/impact/loop2.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] t[0..9] ∈ [--..--] u[0..9] ∈ [--..--] w[0..9] ∈ [--..--] [eva] computing for function init <- main. Called from tests/impact/loop2.i:24. [eva] tests/impact/loop2.i:11: starting to merge loop iterations [eva] Recording results for init [from] Computing for function init [from] Done for function init [eva] Done for function init [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] tests/impact/loop2.i:25: starting to merge loop iterations [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to init at tests/impact/loop2.i:24 (by main): u[0..9] FROM v (and SELF) [from] call to f at tests/impact/loop2.i:27 (by main): t[0..9] FROM u[0..9]; i (and SELF) w[0..9] FROM i (and SELF) [from] entry point: t[0..9] FROM v; t[0..9]; u[0..9] (and SELF) u[0..9] FROM v (and SELF) w[0..9] FROM v; t[0..9]; u[0..9] (and SELF) [from] ====== END OF CALLWISE DEPENDENCIES ====== [impact] beginning analysis [pdg] computing for function main [pdg] done for function main [pdg] computing for function init [pdg] done for function init [pdg] computing for function f [pdg] done for function f [impact] impacted statements of stmt(s) 17 are: tests/impact/loop2.i:17 (sid 11): int v_0 = t[i]; tests/impact/loop2.i:18 (sid 12): w[i] = i; tests/impact/loop2.i:19 (sid 13): t[i] = u[i]; tests/impact/loop2.i:26 (sid 26): if(t[i]) <..> tests/impact/loop2.i:27 (sid 27): f(i); [impact] analysis done [kernel] Parsing tests/impact/loop2.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] t[0..9] ∈ [--..--] u[0..9] ∈ [--..--] w[0..9] ∈ [--..--] [eva] computing for function init <- main. Called from tests/impact/loop2.i:24. [eva] Recording results for init [from] Computing for function init [from] Done for function init [eva] Done for function init [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/impact/loop2.i:27. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to init at tests/impact/loop2.i:24 (by main): u[0..9] FROM v [from] call to f at tests/impact/loop2.i:27 (by main): t[9] FROM u[9]; i w[9] FROM i [from] call to f at tests/impact/loop2.i:27 (by main): t[8] FROM u[8]; i w[8] FROM i [from] call to f at tests/impact/loop2.i:27 (by main): t[7] FROM u[7]; i w[7] FROM i [from] call to f at tests/impact/loop2.i:27 (by main): t[6] FROM u[6]; i w[6] FROM i [from] call to f at tests/impact/loop2.i:27 (by main): t[5] FROM u[5]; i w[5] FROM i [from] call to f at tests/impact/loop2.i:27 (by main): t[4] FROM u[4]; i w[4] FROM i [from] call to f at tests/impact/loop2.i:27 (by main): t[3] FROM u[3]; i w[3] FROM i [from] call to f at tests/impact/loop2.i:27 (by main): t[2] FROM u[2]; i w[2] FROM i [from] call to f at tests/impact/loop2.i:27 (by main): t[1] FROM u[1]; i w[1] FROM i [from] call to f at tests/impact/loop2.i:27 (by main): t[0] FROM u[0]; i w[0] FROM i [from] entry point: t[0] FROM v; t[0] (and SELF) [1] FROM v; t[1] (and SELF) [2] FROM v; t[2] (and SELF) [3] FROM v; t[3] (and SELF) [4] FROM v; t[4] (and SELF) [5] FROM v; t[5] (and SELF) [6] FROM v; t[6] (and SELF) [7] FROM v; t[7] (and SELF) [8] FROM v; t[8] (and SELF) [9] FROM v; t[9] (and SELF) u[0..9] FROM v w[0] FROM t[0] (and SELF) [1] FROM t[1] (and SELF) [2] FROM t[2] (and SELF) [3] FROM t[3] (and SELF) [4] FROM t[4] (and SELF) [5] FROM t[5] (and SELF) [6] FROM t[6] (and SELF) [7] FROM t[7] (and SELF) [8] FROM t[8] (and SELF) [9] FROM t[9] (and SELF) [from] ====== END OF CALLWISE DEPENDENCIES ====== [impact] beginning analysis [pdg] computing for function main [pdg] done for function main [pdg] computing for function init [pdg] done for function init [pdg] computing for function f [pdg] done for function f [impact] impacted statements of stmt(s) 57 are: tests/impact/loop2.i:19 (sid 53): t[i] = u[i]; tests/impact/loop2.i:27 (sid 149): f(i); tests/impact/loop2.i:27 (sid 156): f(i); tests/impact/loop2.i:27 (sid 163): f(i); tests/impact/loop2.i:27 (sid 170): f(i); tests/impact/loop2.i:27 (sid 177): f(i); tests/impact/loop2.i:27 (sid 184): f(i); tests/impact/loop2.i:27 (sid 191): f(i); tests/impact/loop2.i:27 (sid 198): f(i); tests/impact/loop2.i:27 (sid 205): f(i); tests/impact/loop2.i:27 (sid 212): f(i); [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/slicing.res.oracle0000666000000000000000000000415213571573400020510 0ustar [kernel] Parsing tests/impact/slicing.i (no preprocessing) [impact] beginning analysis [eva] Analyzing an incomplete application starting at impact [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ [--..--] b ∈ [--..--] c ∈ [--..--] e ∈ [--..--] x ∈ [--..--] y ∈ [--..--] z ∈ [--..--] f ∈ [--..--] w ∈ [--..--] [eva:alarm] tests/impact/slicing.i:13: Warning: signed overflow. assert -2147483648 ≤ b + c; [eva:alarm] tests/impact/slicing.i:13: Warning: signed overflow. assert b + c ≤ 2147483647; [eva:alarm] tests/impact/slicing.i:14: Warning: signed overflow. assert -2147483648 ≤ x + e; [eva:alarm] tests/impact/slicing.i:14: Warning: signed overflow. assert x + e ≤ 2147483647; [eva:alarm] tests/impact/slicing.i:18: Warning: signed overflow. assert -2147483648 ≤ y + f; [eva:alarm] tests/impact/slicing.i:18: Warning: signed overflow. assert y + f ≤ 2147483647; [eva] Recording results for impact [eva] done for function impact [pdg] computing for function impact [pdg] done for function impact [impact] impacted statements of stmt(s) 6 are: tests/impact/slicing.i:13 (sid 9): x = b + c; tests/impact/slicing.i:14 (sid 10): y = x + e; tests/impact/slicing.i:18 (sid 13): z = y + f; tests/impact/slicing.i:19 (sid 14): w = b; [slicing] initializing slicing ... [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'impact slicing'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'impact slicing tmp' [sparecode] removed unused global declarations in new project 'impact slicing' [impact] analysis done /* Generated by Frama-C */ int a; int b; int c; int e; int x; int y; int z; int f; int w; void impact(void) { if (c) a = 18; /*@ impact pragma stmt; */ b = a; if (c) { x = b + c; y = x + e; } z = y + f; w = b; return; } frama-c-20.0-Calcium/tests/impact/oracle/topbot.res.oracle0000666000000000000000000000303313571573400020364 0ustar [kernel] Parsing tests/impact/topbot.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/impact/topbot.c:15. [eva:alarm] tests/impact/topbot.c:15: Warning: function f: precondition got status invalid. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [pdg] computing for function f [pdg] Warning: unreachable entry point (sid:14, function f) [pdg] Bottom for function f [pdg] computing for function main [from] Computing for function f [from] Non-terminating function f (no dependencies) [from] Done for function f [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for f Bottom PDG [pdg] PDG for main {n2}: InCtrl {n3}: VarDecl : c -[a--]-> 4 {n4}: In1 -[a--]-> 3 {n5}: VarDecl : x {n6}: VarDecl : y {n7}: VarDecl : z {n8}: int x = 1; -[-c-]-> 2 -[a--]-> 5 {n9}: c -[-c-]-> 2 -[--d]-> 3 -[--d]-> 4 {n10}: y = x; -[-c-]-> 2 -[--d]-> 5 -[a--]-> 6 -[--d]-> 8 -[-c-]-> 9 {n11}: Call8-InCtrl : f(); -[-c-]-> 2 -[-c-]-> 9 {n12}: z = x; -[-c-]-> 2 -[--d]-> 5 -[a--]-> 7 -[--d]-> 8 {n13}: return; -[-c-]-> 2 [impact] beginning analysis [impact] impacted statements of stmt(s) 4 are: tests/impact/topbot.c:14 (sid 7): y = x; tests/impact/topbot.c:18 (sid 11): z = x; [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/undef_function.res.oracle0000666000000000000000000000177213571573400022073 0ustar [kernel] Parsing tests/impact/undef_function.i (no preprocessing) [impact] beginning analysis [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization y ∈ {0} [eva] computing for function g <- main. Called from tests/impact/undef_function.i:10. [kernel:annot:missing-spec] tests/impact/undef_function.i:10: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function g [from] Done for function g [pdg] done for function main [pdg] computing for function g [pdg] done for function g [impact] impacted statements of stmt(s) 2 are: tests/impact/undef_function.i:10 (sid 3): g(y); tests/impact/undef_function.i:11 (sid 5): return y; [impact] analysis done frama-c-20.0-Calcium/tests/impact/oracle/variadic.res.oracle0000666000000000000000000001571113571573400020645 0ustar [kernel] Parsing tests/impact/variadic.i (no preprocessing) [impact] beginning analysis [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization y ∈ {0} z ∈ {0} [eva] computing for function f <- main. Called from tests/impact/variadic.i:12. [kernel:annot:missing-spec] tests/impact/variadic.i:12: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [pdg] computing for function f [pdg] done for function f [impact] impacted statements of stmt(s) 3 are: tests/impact/variadic.i:12 (sid 50): f(i,(void * const *)(__va_args)); [impact] analysis done [impact] beginning analysis [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization y ∈ {0} z ∈ {0} [eva] computing for function g1 <- main1. Called from tests/impact/variadic.i:29. [eva] Recording results for g1 [eva] Done for function g1 [eva] computing for function g1 <- main1. Called from tests/impact/variadic.i:30. [eva] Recording results for g1 [eva] Done for function g1 [eva] Recording results for main1 [eva] done for function main1 [pdg] computing for function main1 [from] Computing for function g1 [from] Done for function g1 [pdg] done for function main1 [pdg] computing for function g1 [pdg] done for function g1 [impact] impacted statements of stmt(s) 12 are: tests/impact/variadic.i:19 (sid 7): y = x + y; tests/impact/variadic.i:31 (sid 15): return y; tests/impact/variadic.i:29 (sid 52): int __va_arg0 = 2; tests/impact/variadic.i:29 (sid 53): int __va_arg1 = 3; tests/impact/variadic.i:29 (sid 54): void *__va_args[2] = {& __va_arg0, & __va_arg1}; tests/impact/variadic.i:29 (sid 55): g1(1,(void * const *)(__va_args)); tests/impact/variadic.i:30 (sid 58): g1(1,(void * const *)(__va_args_8)); [impact] analysis done [impact] beginning analysis [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization y ∈ {0} z ∈ {0} [eva] computing for function g2 <- main2. Called from tests/impact/variadic.i:37. [eva] using specification for function g2 [eva] Done for function g2 [eva] computing for function g2 <- main2. Called from tests/impact/variadic.i:38. [eva] Done for function g2 [eva] Recording results for main2 [eva] done for function main2 [pdg] computing for function main2 [from] Computing for function g2 [from] Done for function g2 [pdg] done for function main2 [pdg] computing for function g2 [pdg] done for function g2 [impact] impacted statements of stmt(s) 19 are: tests/impact/variadic.i:37 (sid 60): int __va_arg0 = 2; tests/impact/variadic.i:37 (sid 61): int __va_arg1 = 3; tests/impact/variadic.i:37 (sid 62): void *__va_args[2] = {& __va_arg0, & __va_arg1}; tests/impact/variadic.i:37 (sid 63): g2(1,(void * const *)(__va_args)); [impact] analysis done [impact] beginning analysis [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization y ∈ {0} z ∈ {0} [eva] computing for function aux3 <- main3. Called from tests/impact/variadic.i:57. [eva] computing for function g1 <- aux3 <- main3. Called from tests/impact/variadic.i:51. [eva] Recording results for g1 [eva] Done for function g1 [eva] computing for function g1 <- aux3 <- main3. Called from tests/impact/variadic.i:52. [eva] Recording results for g1 [eva] Done for function g1 [eva] Recording results for aux3 [eva] Done for function aux3 [eva] computing for function aux3 <- main3. Called from tests/impact/variadic.i:58. [eva] computing for function g1 <- aux3 <- main3. Called from tests/impact/variadic.i:51. [eva] Recording results for g1 [eva] Done for function g1 [eva] computing for function g1 <- aux3 <- main3. Called from tests/impact/variadic.i:52. [eva] Recording results for g1 [eva] Done for function g1 [eva] Recording results for aux3 [eva] Done for function aux3 [eva] Recording results for main3 [eva] done for function main3 [pdg] computing for function aux3 [from] Computing for function g1 [from] Done for function g1 [pdg] done for function aux3 [pdg] computing for function main3 [from] Computing for function aux3 [from] Done for function aux3 [pdg] done for function main3 [pdg] computing for function g1 [pdg] done for function g1 [impact] impacted statements of stmt(s) 26 are: tests/impact/variadic.i:19 (sid 7): y = x + y; tests/impact/variadic.i:53 (sid 29): return y; tests/impact/variadic.i:59 (sid 34): return y; tests/impact/variadic.i:51 (sid 68): void *__va_args[1] = {(void *)0}; tests/impact/variadic.i:51 (sid 69): g1(t,(void * const *)(__va_args)); tests/impact/variadic.i:52 (sid 71): g1(t,(void * const *)(__va_args_5)); tests/impact/variadic.i:57 (sid 75): aux3(1,(void * const *)(__va_args)); tests/impact/variadic.i:58 (sid 78): aux3(2,(void * const *)(__va_args_6)); [impact] analysis done [impact] beginning analysis [eva] Analyzing a complete application starting at main4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization y ∈ {0} z ∈ {0} [eva] computing for function aux4bis <- main4. Called from tests/impact/variadic.i:73. [eva] computing for function aux4 <- aux4bis <- main4. Called from tests/impact/variadic.i:68. [eva] Recording results for aux4 [eva] Done for function aux4 [eva] Recording results for aux4bis [eva] Done for function aux4bis [eva] computing for function aux4bis <- main4. Called from tests/impact/variadic.i:74. [eva] tests/impact/variadic.i:68: Reusing old results for call to aux4 [eva] Recording results for aux4bis [eva] Done for function aux4bis [eva] Recording results for main4 [eva] done for function main4 [pdg] computing for function aux4 [pdg] done for function aux4 [pdg] computing for function aux4bis [from] Computing for function aux4 [from] Done for function aux4 [pdg] done for function aux4bis [pdg] computing for function main4 [from] Computing for function aux4bis [from] Done for function aux4bis [pdg] done for function main4 [impact] impacted statements of stmt(s) 37 are: tests/impact/variadic.i:69 (sid 42): return y; tests/impact/variadic.i:75 (sid 47): return y; tests/impact/variadic.i:73 (sid 82): aux4bis(1,(void * const *)(__va_args)); tests/impact/variadic.i:74 (sid 86): aux4bis(1, (void * const *)(__va_args_7)); [impact] analysis done frama-c-20.0-Calcium/tests/impact/slicing.i0000666000000000000000000000055413571573400015440 0ustar /* run.config GCC: STDOPT: +"-impact-pragma impact" +"-lib-entry" +"-main impact" +"-impact-slicing" +"-then-on 'impact slicing'" +"-print" */ int a, b, c, e, x, y, z, f, w; void impact() { if (c) a = 18; else x = 5; /*@ impact pragma stmt; */ b = a; if (c) { x = b + c; y = x + e; } else z = 12; z = 13; z = y + f; w = b; } frama-c-20.0-Calcium/tests/impact/test_config0000666000000000000000000000006213571573400016057 0ustar OPT: -journal-disable -impact-print @EVA_OPTIONS@ frama-c-20.0-Calcium/tests/impact/topbot.c0000666000000000000000000000037213571573400015307 0ustar /* run.config STDOPT: +"-impact-pragma main -pdg -pdg-print" */ //@ requires \false; void f() { // Bottom PDG } void main(int c) { /*@ impact pragma stmt; */ int x = 1; int y, z; if (c) { y = x; f(); z = x; } z = x; } frama-c-20.0-Calcium/tests/impact/undef_function.i0000666000000000000000000000022213571573400017006 0ustar /* run.config STDOPT: +"-impact-pragma main" */ int y; void g(int); int main() { /*@ impact pragma stmt; */ y=2; g(y); return y; } frama-c-20.0-Calcium/tests/impact/variadic.i0000666000000000000000000000212513571573400015566 0ustar /* run.config COMMENT: also tests the parsing of cmdline options of type string_set STDOPT: +"-impact-pragma main" +"-then -main main1 -impact-pragma='-main,+main1'" +"-then -main main2 -impact-pragma='-@all,+main2'" +"-then -main main3 -impact-pragma='+aux3,-main2'" +"-then -main main4 -impact-pragma='-aux3,+aux4'" */ int f(int, ...); int main () { int i=0; /*@ impact pragma stmt; */ i++; f(i); } int y; //@ assigns y \from y, x; void g1(int x, ...) { y = x + y; } //@ assigns y \from x; void g2(int x, ...); int main1() { int x = 3; //@ impact pragma stmt; g1(1, 2, 3); g1(1, 2); return y; } int main2() { int x = 3; //@ impact pragma stmt; g2(1, 2, 3); g2(1, 2); return y; } int z; //@ assigns z \from y; void g3(int , ...); int aux3(int x, ...) { int t = 3; //@ impact pragma stmt; g1(t); g1(t); return y; } int main3() { aux3(1, 2); aux3(2, 3); return y; } void aux4(int x) { //@ impact pragma stmt; y = x; } int aux4bis(int x, ...) { aux4(x); return y; } int main4() { aux4bis(1, 2); aux4bis(1, 2, 3); return y; } frama-c-20.0-Calcium/tests/jcdb/0000777000000000000000000000000013571573400013257 5ustar frama-c-20.0-Calcium/tests/jcdb/compile_commands.json0000666000000000000000000000133613571573400017466 0ustar [ { "directory": "tests/jcdb", "command": "g++ -DDUPLICATE_FLAGS_THAT_WILL_BE_OVERWRITTEN", "file": "jcdb.c" }, { "directory": "tests/jcdb", "command": "g++ -DDUPLICATE_FLAGS_THAT_WILL_BE_OVERWRITTEN", "file": "jcdb.c" }, { "directory": "tests/jcdb", "command": "/usr/bin/clang++ -D'MSG=\"a \\\" \\\"b\"' -D'SINGLE_DOUBLE(a)=\"a \\\"with spaces and tab \"' -DSOMEDEF=\"With spaces, quotes and \\-es.\" -D\"DOUBLE_SINGLE(a)=a \\\"macro with spaces and non-escaped \\\\'\\\"\" -DEMPTY='' -DEMPTY2= -DTEST=42 -D'MACRO_FOR_INCR(s)=s+1' -DTOUNDEF -UTOUNDEF", "file": "jcdb.c" }, { "command": "testing entry without 'directory' key", "file": "jcdb.c" } ] frama-c-20.0-Calcium/tests/jcdb/compile_commands_working.json0000666000000000000000000000027613571573400021230 0ustar [ { "directory": "tests/jcdb", "command": "gcc", "file": "jcdb.c" }, { "directory": "tests/jcdb", "command": "gcc", "file": "file_without_main.c" } ] frama-c-20.0-Calcium/tests/jcdb/file_without_main.c0000666000000000000000000000021513571573400017127 0ustar /* run.config DONTRUN: */ // declares but does not define main void main(void); // looks similar to main(), but isn't void remain(void) {} frama-c-20.0-Calcium/tests/jcdb/jcdb.c0000666000000000000000000000142513571573400014327 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -json-compilation-database @PTEST_DIR@ -print OPT: @PTEST_DIR@/jcdb2.c -json-compilation-database @PTEST_DIR@/with_arguments.json -print OPT: -json-compilation-database @PTEST_DIR@/with_arguments.json -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs EXECNOW: LOG list_files.res LOG list_files.err share/analysis-scripts/list_files.py @PTEST_DIR@/compile_commands_working.json > @PTEST_DIR@/result/list_files.res 2> @PTEST_DIR@/result/list_files.err */ #include #ifdef TOUNDEF #error TOUNDEF must be undefined by the compilation database #endif int main () { char *s = DOUBLE_SINGLE("a "); #ifndef __FRAMAC__ printf("%s\n", s); // for GCC debugging #endif return MACRO_FOR_INCR(TEST); } frama-c-20.0-Calcium/tests/jcdb/jcdb.ml0000666000000000000000000000052613571573400014516 0ustar let print_json () = Kernel.feedback "Value of -json-compilation-database in %s is %s" (Project.get_name (Project.current())) (Kernel.JsonCompilationDatabase.get()) let run () = print_json (); Ast.compute(); let prj = Project.create_by_copy ~last:true "copy" in Project.on prj print_json () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/jcdb/jcdb2.c0000666000000000000000000000014513571573400014407 0ustar /* run.config DONTRUN: COMMENT: only used to test parsing of options in with_arguments.json */ frama-c-20.0-Calcium/tests/jcdb/oracle/0000777000000000000000000000000013571573400014524 5ustar frama-c-20.0-Calcium/tests/jcdb/oracle/jcdb.0.res.oracle0000666000000000000000000000152513571573400017546 0ustar [kernel:pp:compilation-db] Warning: found duplicate flags for 'tests/jcdb/jcdb.c', replacing old flags. Old flags no longer present: -D'MSG="a \" \"b"' -D'SINGLE_DOUBLE(a)="a \"with spaces and tab "' -DSOMEDEF="With spaces, quotes and \-es." -D"DOUBLE_SINGLE(a)=a \"macro with spaces and non-escaped \\'\"" -DEMPTY='' -DEMPTY2= -DTEST=42 -D'MACRO_FOR_INCR(s)=s+1' -DTOUNDEF -UTOUNDEF New flags not previously present: -DDUPLICATE_FLAGS_THAT_WILL_BE_OVERWRITTEN (warn-once: no further messages from category 'pp:compilation-db' will be emitted) [kernel] Parsing tests/jcdb/jcdb.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "stdarg.h" #include "stddef.h" #include "stdio.h" int main(void) { int __retres; char *s = (char *)"a macro with spaces and non-escaped \'"; __retres = 42 + 1; return __retres; } frama-c-20.0-Calcium/tests/jcdb/oracle/jcdb.1.res.oracle0000666000000000000000000000054513571573400017550 0ustar [kernel] Parsing tests/jcdb/jcdb.c (with preprocessing) [kernel] Parsing tests/jcdb/jcdb2.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "stdarg.h" #include "stddef.h" #include "stdio.h" int main(void) { int __retres; char *s = (char *)"a macro with spaces and non-escaped \'"; __retres = 42 + 1; return __retres; } frama-c-20.0-Calcium/tests/jcdb/oracle/jcdb.2.res.oracle0000666000000000000000000000035113571573400017544 0ustar [kernel] Parsing tests/jcdb/jcdb.c (with preprocessing) [kernel] Value of -json-compilation-database in default is tests/jcdb/with_arguments.json [kernel] Value of -json-compilation-database in copy is tests/jcdb/with_arguments.json frama-c-20.0-Calcium/tests/jcdb/oracle/list_files.err0000666000000000000000000000000013571573400017361 0ustar frama-c-20.0-Calcium/tests/jcdb/oracle/list_files.res0000666000000000000000000000022113571573400017367 0ustar SRCS=\ tests/jcdb/file_without_main.c \ tests/jcdb/jcdb.c \ # Possible definition of main function in the following file(s): tests/jcdb/jcdb.c frama-c-20.0-Calcium/tests/jcdb/with_arguments.json0000666000000000000000000000120513571573400017210 0ustar [ { "directory": "tests/jcdb", "arguments": [ "cc", "-c", "-DDOUBLE_SINGLE(a)=a \"macro with spaces and non-escaped '\"", "-DEMPTY=", "-DEMPTY2=", "-DTEST=42", "-DMACRO_FOR_INCR(s)=s+1", "-DSINGLE_DOUBLE(a)=\"a \\\"with spaces and\ttab \"", "-DMSG=\"a \\\" \\\"b\"", "-o", "a", "-DTOUNDEF", "-UTOUNDEF" ], "file": "jcdb.c" }, { "directory": "tests/jcdb", "command": "/usr/bin/cc -DONION_VERSION=\\\"0.1.tr\\\" -Ibla -o jcdb2.o -c jcdb2.c jcdb.c", "file": "jcdb2.c" } ] frama-c-20.0-Calcium/tests/journal/0000777000000000000000000000000013571573400014027 5ustar frama-c-20.0-Calcium/tests/journal/abstract_cpt.ml0000666000000000000000000000125213571573400017032 0ustar let mk () = ref 0 let incr c = incr c; !c include Datatype.Make(struct (* order of lines below does matter *) include Datatype.Serializable_undefined include Datatype.Ref(Datatype.Int) let varname _ = "cpt" let name = "Abstract_cpt.t" end) let mk = Dynamic.register ~journalize:true ~plugin:"Abstract_cpt" "mk" (Datatype.func Datatype.unit ty) mk let incr = Dynamic.register ~journalize:true ~plugin:"Abstract_cpt" "incr" (Datatype.func ty Datatype.int) incr let pretty = Dynamic.register ~journalize:true ~plugin:"Abstract_cpt" "pretty" (Datatype.func ty Datatype.unit) (fun n -> Format.printf "%d@." !n) frama-c-20.0-Calcium/tests/journal/control.i0000666000000000000000000000243113571573400015661 0ustar /* run.config COMMENT: do not compare generated journals since they depend on current time EXECNOW: BIN control_journal.ml BIN control_journal_bis.ml (./bin/toplevel.opt -journal-enable -check -eva -deps -out @EVA_OPTIONS@ -main f -journal-name tests/journal/result/control_journal.ml tests/journal/control.i && cp tests/journal/result/control_journal.ml tests/journal/result/control_journal_bis.ml) > /dev/null 2> /dev/null CMD: FRAMAC_LIB=lib/fc ./bin/toplevel.byte OPT: -load-script tests/journal/result/control_journal -journal-disable CMD: FRAMAC_LIB=lib/fc ./bin/toplevel.byte OPT: -load-script tests/journal/result/control_journal_bis -calldeps -journal-disable EXECNOW: make -s @PTEST_DIR@/abstract_cpt.cmxs EXECNOW: BIN abstract_cpt_journal.ml FRAMAC_LIB=lib/fc ./bin/toplevel.byte -journal-enable -load-module @PTEST_DIR@/abstract_cpt -load-script tests/journal/use_cpt.ml -journal-name tests/journal/result/abstract_cpt_journal.ml > /dev/null 2> /dev/null CMD: FRAMAC_LIB=lib/fc ./bin/toplevel.byte OPT: -load-script tests/journal/result/abstract_cpt_journal.ml -load-module @PTEST_DIR@/abstract_cpt -load-script tests/journal/use_cpt.ml */ int x,y,c,d; void f() { int i; for(i=0; i<4 ; i++) { if (c) { if (d) {y++;} else {x++;}} else {}; x=x+1; } } frama-c-20.0-Calcium/tests/journal/control2.c0000666000000000000000000000146713571573400015745 0ustar /* run.config EXECNOW: BIN control_journal2.ml ./bin/toplevel.opt -journal-enable -eva -deps -out -main f -journal-name tests/journal/result/control_journal2.ml tests/journal/control2.c > /dev/null 2> /dev/null EXECNOW: LOG control2_sav.res LOG control2_sav.err BIN control_journal_next2.ml FRAMAC_LIB=lib/fc ./bin/toplevel.byte -journal-enable -load-script tests/journal/result/control_journal2 -lib-entry -journal-name tests/journal/result/control_journal_next2.ml tests/journal/control2.c > ./tests/journal/result/control2_sav.res 2> ./tests/journal/result/control2_sav.err CMD: FRAMAC_LIB=lib/fc ./bin/toplevel.byte OPT: -load-script tests/journal/result/control_journal_next2 */ int x,y,c,d; void f() { int i; for(i=0; i<4 ; i++) { if (c) { if (d) {y++;} else {x++;}} else {}; x=x+1; } } frama-c-20.0-Calcium/tests/journal/intra.i0000666000000000000000000000515413571573400015323 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs EXECNOW: BIN intra_journal.ml @frama-c@ -eva-show-progress -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -journal-enable -journal-name tests/journal/result/intra_journal.ml @PTEST_DIR@/@PTEST_NAME@.i > /dev/null 2> /dev/null CMD: @frama-c@ -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-script tests/journal/result/intra_journal -journal-disable */ /* Waiting for results such as: * spare code analysis removes statements having variables with * prefix "spare_" * * slicing analysis removes statement having variables with * prefix "spare_" and "any_" */ int G; int tmp (int a) { int x = a; //@ assert x == a ; int w = 1; //@ assert w == 1 ; // w is not spare or else // the assertion should be removed ! int spare_z = 1; int spare_y = a+spare_z; return x; } int param (int a, int spare_b) { return a; } int spare_called_fct (int a) { return a; } int two_outputs (int a, int b) { G += b; return a; } int call_two_outputs (void) { int x, spare_y; int any_b = 1; int any_a = 2; int a = 1; int b = any_b; x = two_outputs (a, b); G = 1; /* don't use b = any_b; */ b = 2; a = any_a; spare_y = two_outputs (a, b); /* don't use spare_y so don't use a = any_a */ return x; } void assign (int *p, int *q) { *p = *q ; } int loop (int x, int y, int z) { int i = 0; //@ assert i < z ; //@ loop invariant i < y ; /* should keep y in sparecode analysis even if it is not used in the function */ while (i < x) { i ++; } return i; } void stop(void) __attribute__ ((noreturn)) ; int main (int noreturn, int halt) { int res = 0; int spare_tmp = 3; int spare_param = 2 + spare_tmp; int spare_ref = 3; int x = 1; int y = 2; res += param (2, spare_param); res += tmp (4); spare_called_fct (5); res += call_two_outputs (); res += loop (10, 15, 20); assign (&x, &spare_ref) ; /* <- Here, best can be done for spare analysis */ assign (&x, &y) ; if (noreturn) { if (halt) stop () ; else while (1); //@ assert \false ; // What should be done with // assertions related to dead code? } return res + G + x; } /*-------------------------------------*/ struct { struct { int x; int y; } a; int b; } X10; int Y10; int f10 (int x) { //@ slice pragma expr X10; //@ slice pragma expr X10.a; //@ slice pragma expr X10.a.x; //@ slice pragma expr Y10; //@ assert X10.a.x >= 0; return x; } int main2 () { Y10 = 0; X10.b = 0; X10.a.y += f10 (3); return X10.a.x + X10.a.y; } /*-------------------------------------*/ frama-c-20.0-Calcium/tests/journal/intra.ml0000666000000000000000000000011513571573400015473 0ustar let () = Db.Main.extend (fun _ -> ignore (Sparecode.Register.get true true)) frama-c-20.0-Calcium/tests/journal/oracle/0000777000000000000000000000000013571573400015274 5ustar frama-c-20.0-Calcium/tests/journal/oracle/control.0.res.oracle0000666000000000000000000000334713571573400021100 0ustar [kernel] Parsing tests/journal/control.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} c ∈ {0} d ∈ {0} [eva] tests/journal/control.i:18: starting to merge loop iterations [eva:alarm] tests/journal/control.i:21: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ [0..2147483647] i ∈ {4} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 9 statements reached (out of 12): 75% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 1 alarm generated by the analysis: 1 integer overflow ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] Computing for function f [from] Done for function f [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: x FROM x (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: x; i frama-c-20.0-Calcium/tests/journal/oracle/control.1.res.oracle0000666000000000000000000000635713571573400021105 0ustar [kernel] Parsing tests/journal/control.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} c ∈ {0} d ∈ {0} [eva] tests/journal/control.i:18: starting to merge loop iterations [eva:alarm] tests/journal/control.i:21: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ [0..2147483647] i ∈ {4} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 9 statements reached (out of 12): 75% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 1 alarm generated by the analysis: 1 integer overflow ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] Computing for function f [from] Done for function f [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: x FROM x (and SELF) [from] ====== END OF DEPENDENCIES ====== [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} c ∈ {0} d ∈ {0} [eva:alarm] tests/journal/control.i:21: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ [0..2147483647] i ∈ {4} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 9 statements reached (out of 12): 75% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 0 warnings by the Frama-C kernel: 0 errors 1 warning ---------------------------------------------------------------------------- 1 alarm generated by the analysis: 1 integer overflow ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] entry point: x FROM x (and SELF) [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function f: x; i frama-c-20.0-Calcium/tests/journal/oracle/control.2.res.oracle0000666000000000000000000000017213571573400021073 0ustar 1 2 3 [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. 1 2 3 frama-c-20.0-Calcium/tests/journal/oracle/control2.res.oracle0000666000000000000000000000630113571573400021015 0ustar [kernel] Parsing tests/journal/control2.c (with preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} c ∈ {0} d ∈ {0} [eva] tests/journal/control2.c:12: starting to merge loop iterations [eva:alarm] tests/journal/control2.c:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ [0..2147483647] i ∈ {4} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 9 statements reached (out of 12): 75% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 1 alarm generated by the analysis: 1 integer overflow ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] Computing for function f [from] Done for function f [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ [--..--] y ∈ [--..--] c ∈ [--..--] d ∈ [--..--] [eva:alarm] tests/journal/control2.c:13: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva:alarm] tests/journal/control2.c:13: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva:alarm] tests/journal/control2.c:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ [--..--] y ∈ [--..--] i ∈ {4} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 12 statements reached (out of 12): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 3 alarms generated by the analysis: 3 integer overflows ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] Computing for function f [from] Done for function f [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: x FROM x; c; d (and SELF) y FROM y; c; d (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: x; y; i frama-c-20.0-Calcium/tests/journal/oracle/control2_sav.err0000666000000000000000000000000013571573400020407 0ustar frama-c-20.0-Calcium/tests/journal/oracle/control2_sav.res0000666000000000000000000000661113571573400020426 0ustar [kernel] Parsing tests/journal/control2.c (with preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} c ∈ {0} d ∈ {0} [eva] tests/journal/control2.c:12: starting to merge loop iterations [eva:alarm] tests/journal/control2.c:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ [0..2147483647] i ∈ {4} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 9 statements reached (out of 12): 75% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 1 alarm generated by the analysis: 1 integer overflow ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] Computing for function f [from] Done for function f [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ [--..--] y ∈ [--..--] c ∈ [--..--] d ∈ [--..--] [eva:alarm] tests/journal/control2.c:13: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva:alarm] tests/journal/control2.c:13: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva:alarm] tests/journal/control2.c:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ [--..--] y ∈ [--..--] i ∈ {4} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 12 statements reached (out of 12): 100% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 0 warnings by the Frama-C kernel: 0 errors 1 warning ---------------------------------------------------------------------------- 3 alarms generated by the analysis: 3 integer overflows ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: x FROM x; c; d (and SELF) y FROM y; c; d (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: x; y; i [kernel] writing journal in file `tests/journal/result/control_journal_next2.ml'. frama-c-20.0-Calcium/tests/journal/oracle/intra.res.oracle0000666000000000000000000001213713571573400020374 0ustar [kernel] Parsing tests/journal/intra.i (no preprocessing) [sparecode] remove unused code... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} X10 ∈ {0} Y10 ∈ {0} [eva] computing for function param <- main. Called from tests/journal/intra.i:81. [eva] Recording results for param [eva] Done for function param [eva] computing for function tmp <- main. Called from tests/journal/intra.i:82. [eva] tests/journal/intra.i:20: assertion got status valid. [eva] tests/journal/intra.i:22: assertion got status valid. [eva] Recording results for tmp [eva] Done for function tmp [eva] computing for function spare_called_fct <- main. Called from tests/journal/intra.i:83. [eva] Recording results for spare_called_fct [eva] Done for function spare_called_fct [eva] computing for function call_two_outputs <- main. Called from tests/journal/intra.i:84. [eva] computing for function two_outputs <- call_two_outputs <- main. Called from tests/journal/intra.i:48. [eva] Recording results for two_outputs [eva] Done for function two_outputs [eva] computing for function two_outputs <- call_two_outputs <- main. Called from tests/journal/intra.i:52. [eva] Recording results for two_outputs [eva] Done for function two_outputs [eva] Recording results for call_two_outputs [eva] Done for function call_two_outputs [eva] computing for function loop <- main. Called from tests/journal/intra.i:85. [eva] tests/journal/intra.i:63: assertion got status valid. [eva] tests/journal/intra.i:64: loop invariant got status valid. [eva] tests/journal/intra.i:66: starting to merge loop iterations [eva] Recording results for loop [eva] Done for function loop [eva] computing for function assign <- main. Called from tests/journal/intra.i:86. [eva] Recording results for assign [eva] Done for function assign [eva] computing for function assign <- main. Called from tests/journal/intra.i:87. [eva] Recording results for assign [eva] Done for function assign [eva] computing for function stop <- main. Called from tests/journal/intra.i:90. [kernel:annot:missing-spec] tests/journal/intra.i:90: Warning: Neither code nor specification for function stop, generating default assigns from the prototype [eva] using specification for function stop [eva] Done for function stop [eva] Recording results for main [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 8 functions analyzed (out of 10): 80% coverage. In these functions, 58 statements reached (out of 59): 98% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 0 warnings by the Frama-C kernel: 0 errors 1 warning ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 4 valid 0 unknown 0 invalid 4 total Preconditions 0 valid 0 unknown 0 invalid 0 total 100% of the logical properties reached have been proven. ---------------------------------------------------------------------------- [pdg] computing for function main [from] Computing for function param [from] Done for function param [from] Computing for function tmp [from] Done for function tmp [from] Computing for function spare_called_fct [from] Done for function spare_called_fct [from] Computing for function call_two_outputs [from] Computing for function two_outputs <-call_two_outputs [from] Done for function two_outputs [from] Done for function call_two_outputs [from] Computing for function loop [from] Done for function loop [from] Computing for function assign [from] Done for function assign [from] Computing for function stop [from] Done for function stop [pdg] done for function main [pdg] computing for function call_two_outputs [pdg] done for function call_two_outputs [pdg] computing for function assign [pdg] done for function assign [pdg] computing for function loop [pdg] done for function loop [pdg] computing for function tmp [pdg] done for function tmp [pdg] computing for function param [pdg] done for function param [pdg] computing for function two_outputs [pdg] done for function two_outputs [pdg] computing for function f10 [pdg] Warning: unreachable entry point (sid:79, function f10) [pdg] Bottom for function f10 [pdg] computing for function main2 [pdg] Warning: unreachable entry point (sid:87, function main2) [pdg] Bottom for function main2 [pdg] computing for function spare_called_fct [pdg] done for function spare_called_fct [pdg] computing for function stop [pdg] done for function stop [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/journal/use_cpt.ml0000666000000000000000000000103713571573400016024 0ustar let main () = let module T = Type.Abstract(struct let name = "Abstract_cpt.t" end) in let c = Dynamic.get ~plugin:"Abstract_cpt" "mk" (Datatype.func Datatype.unit T.ty) () in let incr = Dynamic.get ~plugin:"Abstract_cpt" "incr" (Datatype.func T.ty Datatype.int) in let pretty = Dynamic.get ~plugin:"Abstract_cpt" "pretty" (Datatype.func T.ty Datatype.unit) in let incr_and_pretty c = ignore (incr c); pretty c in for _i = 1 to 3 do incr_and_pretty c done let () = Db.Main.extend main frama-c-20.0-Calcium/tests/libc/0000777000000000000000000000000013571573400013266 5ustar frama-c-20.0-Calcium/tests/libc/alloca_h.c0000666000000000000000000000163313571573400015177 0ustar #include volatile int nondet; char *f() { char *p = alloca(3); char *q = malloc(4); char *r = nondet ? p : q; free(r); // warning: q can be free'd, but not p return p; // p will be dangling after function exit } char *f2(char *allocaed) { // allocaed must contain at least 2 bytes *allocaed = 42; *(allocaed+1) = 43; char *p = alloca(5); return p; } char *loop() { char *q = 0; for (int i = 0; i < 100; i++) { char *p = alloca(i); q = nondet ? q : p; } return q; } int main() { int *a = alloca(sizeof(int)); //@ assert !\initialized(a); *a = 42; char *p; { char *local = alloca(2); local[0] = 'A'; local[1] = 0; p = local; } //@ assert !\dangling(&p); char *q = f(); //@ assert \dangling(&q); char *r = loop(); //@ assert \dangling(&r); char *in = alloca(2); char *s = f2(in); *in = 44; //@ assert \dangling(&s); return 0; } frama-c-20.0-Calcium/tests/libc/assert_h.c0000666000000000000000000000055513571573400015247 0ustar /*run.config STDOPT: +"-warn-special-float none" */ #include void (*fp)(int); volatile double naan; struct s { int a; } s1; volatile int nondet; void main() { if (nondet) assert(nondet); // unknown if (nondet) assert(0); // invalid if (nondet) assert(1); // valid if (nondet) assert(fp); // invalid if (nondet) assert(naan); // unknown } frama-c-20.0-Calcium/tests/libc/check_compliance.ml0000666000000000000000000001323713571573400017075 0ustar open Cil_types let add_headers tbl id headers = try let old_headers = Hashtbl.find tbl id in Hashtbl.replace tbl id (old_headers @ headers) with Not_found -> Hashtbl.replace tbl id headers class stdlib_visitor = object inherit Visitor.frama_c_inplace val in_stdlib = ref false val idents : (string, string list) Hashtbl.t = Hashtbl.create 500 method! vglob_aux g = match Cil.findAttribute "fc_stdlib" (Cil.global_attributes g) with | [] -> in_stdlib := false; Cil.SkipChildren | attrparams -> let headers = Extlib.filter_map' (fun ap -> match ap with | AStr s -> s | _ -> assert false ) (Extlib.string_suffix ".h") attrparams in in_stdlib := true; begin match g with | GEnumTag ({eorig_name = id}, _loc) | GEnumTagDecl ({eorig_name = id}, _loc) | GCompTag ({corig_name = id}, _loc) | GCompTagDecl ({corig_name = id}, _loc) | GVar ({vorig_name = id}, _, _loc) | GVarDecl ({vorig_name = id}, _loc) | GFunDecl (_, {vorig_name = id}, _loc) | GFun ({svar = {vorig_name = id}}, _loc) -> add_headers idents id headers | _ -> () end; Cil.DoChildren method get_idents = idents end let run_once = ref false module StringSet = Set.Make(String) let get_idents dir f = let file = Filename.concat dir f in let open Yojson.Basic.Util in Kernel.feedback "parsing %s" f; let json = Yojson.Basic.from_file file in let elements = json |> member "data" |> to_list in List.fold_left (fun acc e -> let ident = e |> member "ident" |> to_string in StringSet.add ident acc ) StringSet.empty elements let get_ident_headers dir f = let file = Filename.concat dir f in let idents = Hashtbl.create 500 in let open Yojson.Basic.Util in Kernel.feedback "parsing %s" f; let json = Yojson.Basic.from_file file in let elements = json |> member "data" |> to_list in List.iter (fun e -> let ident = e |> member "ident" |> to_string in let header = e |> member "header" |> to_string in Hashtbl.replace idents ident header ) elements; idents let get_ident_headers_and_extensions dir f = let file = Filename.concat dir f in let idents = Hashtbl.create 500 in let open Yojson.Basic.Util in Kernel.feedback "parsing %s" f; let json = Yojson.Basic.from_file file in let elements = json |> member "data" |> to_list in List.iter (fun e -> let ident = e |> member "ident" |> to_string in let header = e |> member "header" |> to_string in let extensions = e |> member "extensions" |> to_list in Hashtbl.replace idents ident (header, extensions) ) elements; idents let () = Db.Main.extend (fun () -> if not !run_once then begin run_once := true; let vis = new stdlib_visitor in ignore (Visitor.visitFramacFile (vis :> Visitor.frama_c_visitor) (Ast.get ())); let fc_stdlib_idents = vis#get_idents in let dir = Filename.concat Config.datadir "compliance" in let c11_idents = get_ident_headers dir "c11_functions.json" in let glibc_idents = get_idents dir "glibc_functions.json" in let posix_idents = get_ident_headers_and_extensions dir "posix_identifiers.json" in let nonstandard_idents = get_idents dir "nonstandard_identifiers.json" in Hashtbl.iter (fun id headers -> if not (Extlib.string_prefix "__" id) && not (Extlib.string_prefix "Frama_C" id) && List.filter (fun h -> not (Extlib.string_prefix "__fc" h)) headers <> [] then let id_in_c11 = Hashtbl.mem c11_idents id in let id_in_posix = Hashtbl.mem posix_idents id in let id_in_glibc = StringSet.mem id glibc_idents in let id_in_nonstd = StringSet.mem id nonstandard_idents in if id_in_c11 then begin (* Check that the header is the expected one. Note that some symbols may appear in more than one header, possibly due to collisions (e.g. 'flock' as type and function). *) let h = Hashtbl.find c11_idents id in if not (List.mem h headers) then Kernel.warning "<%a>:%s : C11 says %s" (Pretty_utils.pp_list ~sep:"," Format.pp_print_string) headers id h end else if id_in_posix then begin (* check the header is the expected one *) let (h, _) = Hashtbl.find posix_idents id in (* arpa/inet.h and netinet/in.h are special cases: due to mutual inclusion, there are always issues with their symbols; also, timezone is a special case, since it is a type in sys/time.h, but a variable in time.h in POSIX. However, its declaration as extern is erased by rmtmps, since it is unused. *) if not (List.mem h headers) && not (List.mem "arpa/inet.h" headers && h = "netinet/in.h" || List.mem "netinet/in.h" headers && h = "arpa/inet.h") && id <> "timezone" then Kernel.warning "<%a>:%s : POSIX says %s" (Pretty_utils.pp_list ~sep:"," Format.pp_print_string) headers id h end else if not (id_in_glibc || id_in_nonstd) then Kernel.warning "<%a>:%s : unknown identifier" (Pretty_utils.pp_list ~sep:"," Format.pp_print_string) headers id ) fc_stdlib_idents; end) frama-c-20.0-Calcium/tests/libc/check_const.ml0000666000000000000000000000421313571573400016103 0ustar open Cil_types (* known exceptions to the const/valid_read rule *) let non_const_exceptions = [ "putenv"; ] let warn_if_const string typ vi loc = if Cil.typeHasQualifier "const" typ then Kernel.result ~source:(fst loc) "'requires \\valid%s' of a const variable %a. \ You probably meant '\\valid_read%s' instead" string Printer.pp_varinfo vi string let warn_if_not_const kf string typ vi loc = if not (List.mem (Kernel_function.get_name kf) non_const_exceptions) then if not (Cil.typeHasQualifier "const" typ) then Kernel.result ~source:(fst loc) "'requires \\valid_read%s' of a non-const variable %a. \ You may have meant '\\valid%s'" string Printer.pp_varinfo vi string let check_annot kf _ (a: identified_predicate) = let p = a.ip_content.pred_content in match p with | Pvalid (_, t) | Pvalid_read (_, t) | Papp ({l_var_info={lv_name=("valid_string"|"valid_read_string")}}, _, [t]) -> begin let warn = match p with | Pvalid _ -> warn_if_const "" | Papp ({l_var_info={lv_name="valid_string"}},_,_) -> warn_if_const "_string" | Pvalid_read _ -> warn_if_not_const kf "" | Papp ({l_var_info={lv_name="valid_read_string"}},_,_) -> warn_if_not_const kf "_string" | _ -> assert false in match t.term_node with | TAddrOf (TVar lvi, _) -> begin match lvi.lv_origin with | Some ({vtype = typ} as vi) -> warn typ vi t.term_loc | _ -> () end | TBinOp ((PlusPI | MinusPI | IndexPI), ({term_node = TLval (TVar lvi, _)} | {term_node = TCastE (_, {term_node = TLval (TVar lvi, _)})}), _) | TLval (TVar lvi, _) -> begin match lvi.lv_origin with | Some vi -> warn (Cil.typeOf_pointed vi.vtype) vi t.term_loc | _ -> () end | _ -> () end | _ -> () let check () = let check_kf kf = let bhvs = Annotations.behaviors ~populate:false kf in List.iter (fun bhv -> Annotations.iter_requires (check_annot kf) kf bhv.b_name) bhvs in Globals.Functions.iter check_kf let () = Db.Main.extend check frama-c-20.0-Calcium/tests/libc/check_full_libc.sh0000777000000000000000000000045713571573400016723 0ustar #!/bin/sh cd share/libc for A in `ls *.h */*.h`; do if ! grep -q $A ../../tests/libc/fc_libc.c ; then echo "#include \"$A"\"; fi ; done; for A in `ls *.c`; do if ! grep -q $A __fc_runtime.c ../../tests/libc/fc_libc.c ; then echo Not included implementation \'$A\'; fi ; done; frama-c-20.0-Calcium/tests/libc/check_libc_anonymous_tags.ml0000666000000000000000000000322313571573400021014 0ustar (* Checks that the Frama-C libc does not declare any anonymous enums/structs/unions *) open Cil_types class tags_visitor = object inherit Visitor.frama_c_inplace val in_stdlib = ref false method! vglob_aux g = if Cil.hasAttribute "fc_stdlib" (Cil.global_attributes g) then begin in_stdlib := true; begin match g with | GEnumTag (ei, loc) | GEnumTagDecl (ei, loc) -> if ei.eorig_name = "" && !in_stdlib then Kernel.warning ~source:(fst loc) ~once:true "anonymous enum in Frama-C stdlib"; | GCompTag (ci, loc) | GCompTagDecl (ci, loc) -> if ci.corig_name = "" && !in_stdlib then Kernel.warning ~source:(fst loc) ~once:true "anonymous %s in Frama-C stdlib" (if ci.cstruct then "struct" else "union"); | _ -> () end; Cil.DoChildren end else begin in_stdlib := false; Cil.SkipChildren end method! vtype typ = begin match typ with | TEnum (ei, _) when ei.eorig_name = "" && !in_stdlib -> Kernel.warning ~current:true ~once:true "anonymous enum in Frama-C stdlib"; () | TComp (ci, _, _) when ci.corig_name = "" && !in_stdlib -> Kernel.warning ~current:true ~once:true "anonymous %s in Frama-C stdlib" (if ci.cstruct then "struct" else "union") | _ -> () end; Cil.DoChildren end let run_once = ref false let () = Db.Main.extend (fun () -> if not !run_once then begin run_once := true; Visitor.visitFramacFile (new tags_visitor) (Ast.get ()) end) frama-c-20.0-Calcium/tests/libc/check_libc_naming_conventions.ml0000666000000000000000000000553413571573400021653 0ustar (* Performs syntactic checks related to naming conventions in Frama-C's libc *) open Cil_types let warn_if_unnamed pred_type pred = if pred.pred_name = [] then Kernel.warning ~source:(fst pred.pred_loc) ~once:true "unnamed %s" pred_type class special_pred_visitor p_cond p_name required_name outermost_pred_name = object inherit Visitor.frama_c_inplace method! vpredicate pred = if p_cond pred.pred_content && not (List.mem required_name outermost_pred_name) then begin Kernel.warning ~source:(fst pred.pred_loc) ~once:true "clause with '%s' must contain name '%s'" p_name required_name; Cil.SkipChildren end else Cil.DoChildren end let contains_special_predicate p_cond p_name required_name pred = let outermost_pred_name = pred.pred_name in ignore (Visitor.visitFramacPredicate (new special_pred_visitor p_cond p_name required_name outermost_pred_name) pred) let check_initialized = contains_special_predicate (fun p -> match p with | Pinitialized _ -> true | _ -> false) "\\initialized" "initialization" let check_dangling = contains_special_predicate (fun p -> match p with | Pdangling _ -> true | _ -> false) "\\dangling" "danglingness" let check_separated = contains_special_predicate (fun p -> match p with | Pseparated _ -> true | _ -> false) "\\separated" "separation" let run_once = ref false let () = Db.Main.extend (fun () -> if not !run_once then begin run_once := true; Globals.Functions.fold (fun kf () -> let fun_attrs = match kf.fundec with | Definition (fd, _) -> fd.svar.vattr | Declaration (_, vi, _, _) -> vi.vattr in if Cil.hasAttribute "fc_stdlib" fun_attrs then begin Annotations.iter_behaviors (fun _emitter bhv -> List.iter (fun ip -> let pred = ip.ip_content in warn_if_unnamed "requires" pred; check_initialized pred; check_dangling pred; check_separated pred; ) bhv.b_requires; List.iter (fun ip -> let pred = ip.ip_content in warn_if_unnamed "assumes" pred; check_initialized pred; check_dangling pred; check_separated pred; ) bhv.b_assumes; List.iter (fun (_termination, ip) -> let pred = ip.ip_content in warn_if_unnamed "ensures" pred; check_initialized pred; check_dangling pred; check_separated pred; ) bhv.b_post_cond; ) kf; end ) () end ) frama-c-20.0-Calcium/tests/libc/check_parsing_individual_headers.ml0000666000000000000000000000307013571573400022323 0ustar (* Performs syntactic checks related to parseability of Frama-C libc headers *) let run_once = ref false let header_re = Str.regexp ".*\\.h$" let is_header f = Str.string_match header_re f 0 (* Files which are *not* supposed to be parsed *) let blacklist () = let libc = (Filename.concat (Sys.getenv "FRAMAC_SHARE") "libc") in List.map (fun f -> Datatype.Filepath.of_string (Filename.concat libc f)) ["tgmath.h"; "complex.h"; "__fc_machdep_linux_shared.h"] (* only goes down one level, which is enough for the libc *) let collect_headers libc_dir = let contents = List.map (Filename.concat libc_dir) (Array.to_list (Sys.readdir libc_dir)) in let subdirs = List.filter Sys.is_directory contents in let base_headers = List.filter is_header contents in let all_headers = List.fold_left (fun acc dir -> let contents = Array.to_list (Sys.readdir dir) in let headers = Extlib.filter_map is_header (Filename.concat dir) contents in acc @ headers ) base_headers subdirs in let all_headers = List.sort Extlib.compare_ignore_case all_headers in let to_skip = blacklist () in List.iter (fun header -> let header_path = Datatype.Filepath.of_string header in if List.mem header_path to_skip then Format.printf "skipping %a@." Datatype.Filepath.pretty header_path else begin Kernel.Files.clear (); Dynamic.Parameter.String.set "" header; Ast.compute (); end ) all_headers let () = Db.Main.apply (collect_headers (Filename.concat (Sys.getenv "FRAMAC_SHARE") "libc")) frama-c-20.0-Calcium/tests/libc/compile_and_run.sh0000777000000000000000000000023413571573400016762 0ustar #!/bin/sh if command -v valgrind then VALGRIND=`command -v valgrind`" -q" else VALGRIND="" fi gcc -Wall $1 -o $1.exe && $VALGRIND ./$1.exe && rm ./$1.exe frama-c-20.0-Calcium/tests/libc/coverage.c0000666000000000000000000000033113571573400015222 0ustar /* run.config* OPT: -eva-no-builtins-auto @EVA_OPTIONS@ share/libc/string.c -eva -slevel 6 -metrics-eva-cover -then -metrics-libc */ #include "string.h" void main() { char *s = "blabli"; int l = strlen(s); } frama-c-20.0-Calcium/tests/libc/ctype.c0000666000000000000000000001210413571573400014554 0ustar /* run.config STDOPT: #"-slevel 4" */ #include #include int main() { int r; r = isascii(EOF); //@ assert r == 0; r = isascii(0); //@ assert r != 0; r = isascii(1); //@ assert r != 0; r = isascii(32); //@ assert r != 0; r = isascii(48); //@ assert r != 0; r = isascii(65); //@ assert r != 0; r = isascii(122); //@ assert r != 0; r = isalnum(EOF); //@ assert r == 0; r = isalnum(0); //@ assert r == 0; r = isalnum(1); //@ assert r == 0; r = isalnum(32); //@ assert r == 0; r = isalnum(48); //@ assert r != 0; r = isalnum(65); //@ assert r != 0; r = isalnum(122); //@ assert r != 0; r = isalpha(EOF); //@ assert r == 0; r = isalpha(0); //@ assert r == 0; r = isalpha(1); //@ assert r == 0; r = isalpha(32); //@ assert r == 0; r = isalpha(48); //@ assert r == 0; r = isalpha(65); //@ assert r != 0; r = isalpha(122); //@ assert r != 0; r = isascii(EOF); //@ assert r == 0; r = isascii(0); //@ assert r != 0; r = isascii(1); //@ assert r != 0; r = isascii(32); //@ assert r != 0; r = isascii(48); //@ assert r != 0; r = isascii(65); //@ assert r != 0; r = isascii(122); //@ assert r != 0; r = isascii(255); //@ assert r == 0; r = isblank(EOF); //@ assert r == 0; r = isblank(0); //@ assert r == 0; r = isblank(1); //@ assert r == 0; r = isblank(32); //@ assert r != 0; r = isblank(48); //@ assert r == 0; r = isblank(65); //@ assert r == 0; r = isblank(122); //@ assert r == 0; r = iscntrl(EOF); //@ assert r == 0; r = iscntrl(0); //@ assert r != 0; r = iscntrl(1); //@ assert r != 0; r = iscntrl(32); //@ assert r == 0; r = iscntrl(48); //@ assert r == 0; r = iscntrl(65); //@ assert r == 0; r = iscntrl(122); //@ assert r == 0; r = isdigit(EOF); //@ assert r == 0; r = isdigit(0); //@ assert r == 0; r = isdigit(1); //@ assert r == 0; r = isdigit(32); //@ assert r == 0; r = isdigit(48); //@ assert r != 0; r = isdigit(65); //@ assert r == 0; r = isdigit(122); //@ assert r == 0; r = isdigit(255); //@ assert r == 0; r = isgraph(EOF); //@ assert r == 0; r = isgraph(0); //@ assert r == 0; r = isgraph(1); //@ assert r == 0; r = isgraph(32); //@ assert r == 0; r = isgraph(48); //@ assert r != 0; r = isgraph(65); //@ assert r != 0; r = isgraph(122); //@ assert r != 0; r = islower(EOF); //@ assert r == 0; r = islower(0); //@ assert r == 0; r = islower(1); //@ assert r == 0; r = islower(32); //@ assert r == 0; r = islower(48); //@ assert r == 0; r = islower(65); //@ assert r == 0; r = islower(122); //@ assert r != 0; r = isprint(EOF); //@ assert r == 0; r = isprint(0); //@ assert r == 0; r = isprint(1); //@ assert r == 0; r = isprint(32); //@ assert r != 0; r = isprint(48); //@ assert r != 0; r = isprint(65); //@ assert r != 0; r = isprint(122); //@ assert r != 0; r = ispunct(EOF); //@ assert r == 0; r = ispunct(0); //@ assert r == 0; r = ispunct(1); //@ assert r == 0; r = ispunct(32); //@ assert r == 0; r = ispunct(48); //@ assert r == 0; r = ispunct(65); //@ assert r == 0; r = ispunct(122); //@ assert r == 0; r = isspace(EOF); //@ assert r == 0; r = isspace(0); //@ assert r == 0; r = isspace(1); //@ assert r == 0; r = isspace(32); //@ assert r != 0; r = isspace(48); //@ assert r == 0; r = isspace(65); //@ assert r == 0; r = isspace(122); //@ assert r == 0; r = isupper(EOF); //@ assert r == 0; r = isupper(0); //@ assert r == 0; r = isupper(1); //@ assert r == 0; r = isupper(32); //@ assert r == 0; r = isupper(48); //@ assert r == 0; r = isupper(65); //@ assert r != 0; r = isupper(122); //@ assert r == 0; r = isxdigit(EOF); //@ assert r == 0; r = isxdigit(0); //@ assert r == 0; r = isxdigit(1); //@ assert r == 0; r = isxdigit(32); //@ assert r == 0; r = isxdigit(48); //@ assert r != 0; r = isxdigit(65); //@ assert r != 0; r = isxdigit(122); //@ assert r == 0; r = isxdigit(255); //@ assert r == 0; r = tolower(EOF); //@ assert r == EOF; r = tolower(0); //@ assert r == 0; r = tolower(1); //@ assert r == 1; r = tolower(32); //@ assert r == 32; r = tolower(48); //@ assert r == 48; r = tolower(65); //@ assert r == 97; r = tolower(122); //@ assert r == 122; r = toupper(EOF); //@ assert r == EOF; r = toupper(0); //@ assert r == 0; r = toupper(1); //@ assert r == 1; r = toupper(32); //@ assert r == 32; r = toupper(48); //@ assert r == 48; r = toupper(65); //@ assert r == 65; r = toupper(122); //@ assert r == 90; } frama-c-20.0-Calcium/tests/libc/fc_libc.c0000666000000000000000000001077213571573400015022 0ustar /* run.config* EXECNOW: make -s @PTEST_DIR@/check_libc_naming_conventions.cmxs EXECNOW: make -s @PTEST_DIR@/check_const.cmxs EXECNOW: make -s @PTEST_DIR@/check_parsing_individual_headers.cmxs EXECNOW: make -s @PTEST_DIR@/check_libc_anonymous_tags.cmxs EXECNOW: make -s @PTEST_DIR@/check_compliance.cmxs OPT: -load-module @PTEST_DIR@/check_libc_naming_conventions -print -cpp-extra-args='-nostdinc -Ishare/libc' -metrics -metrics-libc -load-module @PTEST_DIR@/check_const -load-module metrics -eva @EVA_CONFIG@ -then -lib-entry -no-print -metrics-no-libc OPT: -print -print-libc OPT: -load-module @PTEST_DIR@/check_parsing_individual_headers OPT: -load-module @PTEST_DIR@/check_libc_anonymous_tags OPT: -load-module @PTEST_DIR@/check_compliance -kernel-msg-key printer:attrs CMD: ./tests/libc/check_full_libc.sh OPT: **/ #define __FC_REG_TEST // Some functions such as usleep() are only defined for older of POSIX headers, // while others may be defined only by newer ones, so it is not possible to // test all of them. We nevertheless define some headers to test additional // functions. #define _XOPEN_SOURCE 600 #define _POSIX_C_SOURCE 200112L #define _GNU_SOURCE 1 #include "share/libc/__fc_runtime.c" #include "alloca.h" #include "arpa/inet.h" #include "assert.h" #include "byteswap.h" #include "complex.h" #include "ctype.h" #include "dirent.h" #include "dlfcn.h" #include "endian.h" #include "errno.h" #include "__fc_alloc_axiomatic.h" #include "__fc_builtin.h" #include "__fc_define_blkcnt_t.h" #include "__fc_define_blksize_t.h" #include "__fc_define_clockid_t.h" #include "__fc_define_dev_t.h" #include "__fc_define_eof.h" #include "__fc_define_fd_set_t.h" #include "__fc_define_file.h" #include "__fc_define_fpos_t.h" #include "__fc_define_id_t.h" #include "__fc_define_ino_t.h" #include "__fc_define_intptr_t.h" #include "__fc_define_iovec.h" #include "__fc_define_key_t.h" #include "__fc_define_mode_t.h" #include "__fc_define_nlink_t.h" #include "__fc_define_null.h" #include "__fc_define_off_t.h" #include "__fc_define_pid_t.h" #include "__fc_define_pthread_types.h" #include "__fc_define_sa_family_t.h" #include "__fc_define_seek_macros.h" #include "__fc_define_sigset_t.h" #include "__fc_define_size_t.h" #include "__fc_define_sockaddr.h" #include "__fc_define_ssize_t.h" #include "__fc_define_stat.h" #include "__fc_define_suseconds_t.h" #include "__fc_define_timespec.h" #include "__fc_define_time_t.h" #include "__fc_define_timer_t.h" #include "__fc_define_uid_and_gid.h" #include "__fc_define_useconds_t.h" #include "__fc_define_wchar_t.h" #include "__fc_define_wint_t.h" #include "__fc_gcc_builtins.h" #include "__fc_inet.h" #include "__fc_machdep.h" //#include "__fc_machdep_linux_shared.h" #include "fcntl.h" #include "__fc_select.h" #include "__fc_string_axiomatic.h" #include "features.h" #include "fenv.h" #include "float.h" #include "fnmatch.h" #include "ftw.h" #include "getopt.h" #include "glob.h" #include "grp.h" #include "iconv.h" #include "ifaddrs.h" #include "inttypes.h" #include "iso646.h" #include "libgen.h" #include "limits.h" #include "locale.h" #include "malloc.h" #include "math.h" #include "memory.h" #include "netdb.h" #include "net/if.h" #include "netinet/in.h" #include "netinet/tcp.h" #include "nl_types.h" #include "poll.h" #include "pthread.h" #include "pwd.h" #include "regex.h" #include "resolv.h" #include "sched.h" #include "semaphore.h" #include "setjmp.h" #include "signal.h" #include "stdarg.h" #include "stdbool.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "strings.h" #include "stropts.h" #include "sys/file.h" #include "sys/ioctl.h" #include "sys/ipc.h" #include "syslog.h" #include "sys/mman.h" #include "sys/random.h" #include "sys/resource.h" #include "sys/select.h" #include "sys/shm.h" #include "sys/signal.h" #include "sys/socket.h" #include "sys/stat.h" #include "sys/time.h" #include "sys/times.h" #include "sys/timex.h" #include "sys/types.h" #include "sys/uio.h" #include "sys/un.h" #include "sys/utsname.h" #include "sys/wait.h" #include "termios.h" #include "tgmath.h" #include "time.h" #include "unistd.h" #include "utime.h" #include "utmpx.h" #include "wchar.h" #include "wctype.h" void main() { /* The variables below must be const; otherwise the preconditions and the assigns/from of some functions will not match */ //@ assert __fc_p_fopen == (FILE *)&__fc_fopen; //@ assert __fc_p_opendir == (DIR*)&__fc_opendir; //@ assert __fc_p_time_tm == &__fc_time_tm; //@ assert __fc_p_strerror == __fc_strerror; } frama-c-20.0-Calcium/tests/libc/fpclassify.c0000666000000000000000000000305513571573400015600 0ustar /* run.config STDOPT: #"-warn-special-float none" */ #include volatile int v; void main() { double d; float f; int classd, classf; char is_nan, is_inf, is_normal; d = v ? 0.1 : 1e307; classd = fpclassify(d); //@ assert classd == FP_NORMAL; is_nan = isnan(d); //@ assert is_nan == 0; is_inf = isinf(d); //@ assert is_inf == 0; is_normal = isnormal(d); //@ assert is_normal != 0; d = v ? -0.0 : 0.0; classd = fpclassify(d); //@ assert classd == FP_ZERO; is_normal = isnormal(d); //@ assert is_normal == 0; classd = fpclassify(1e999); //@ assert classd == FP_INFINITE; is_nan = isnan(1e999); //@ assert is_nan == 0; is_inf = isinf(1e999); //@ assert is_inf != 0; is_normal = isnormal(1e999); //@ assert is_normal == 0; d = v ? 1e-320 : 1e-310; classd = fpclassify(d); //@ assert classd == FP_SUBNORMAL; is_normal = isnormal(d); //@ assert is_normal == 0; classd = fpclassify(0.0/0.0); //@ assert classd == FP_NAN; is_nan = isnan(0.0/0.0); //@ assert is_nan != 0; classf = fpclassify(1e-40f); //@ assert classf == FP_SUBNORMAL; is_normal = isnormal(1e-40f); //@ assert is_normal == 0; classf = fpclassify(1e40f); //@ assert classf == FP_INFINITE; is_inf = isinf(1e40f); //@ assert is_inf != 0; is_normal = isnormal(1e40f); //@ assert is_normal == 0; d = v ? -1e-309 : 0.0; classd = fpclassify(d); //@ assert classd == FP_ZERO || classd == FP_SUBNORMAL; f = v ? 1e37f : 1e40f; classf = fpclassify(f); //@ assert classf == FP_NORMAL || classf == FP_INFINITE; } frama-c-20.0-Calcium/tests/libc/glob_c.c0000666000000000000000000000162113571573400014657 0ustar /* run.config STDOPT: */ #include "glob.c" #include #include volatile int v; int globerr0(const char *epath, int eerrno) { #ifndef __FRAMAC__ fprintf(stderr, "%s: %s\n", epath, strerror(eerrno)); #endif return 0; } int globerr1(const char *epath, int eerrno) { #ifndef __FRAMAC__ fprintf(stderr, "%s: %s\n", epath, strerror(eerrno)); #endif return 1; } int main() { int ret, flags; glob_t gl; gl.gl_offs = 1; flags = GLOB_DOOFFS; ret = glob("bla", flags, globerr0, &gl); if (gl.gl_pathc > 0) globfree(&gl); flags = GLOB_ERR; ret = glob("ble", flags, globerr0, &gl); if (gl.gl_pathc > 0) globfree(&gl); flags = GLOB_NOCHECK; ret = glob("bli", flags, globerr1, &gl); if (gl.gl_pathc > 0) globfree(&gl); gl.gl_offs = 1; flags = GLOB_DOOFFS | GLOB_NOCHECK; ret = glob("blo", flags, globerr1, &gl); if (gl.gl_pathc > 0) globfree(&gl); return 0; } frama-c-20.0-Calcium/tests/libc/inttypes_h.c0000666000000000000000000000232213571573400015617 0ustar /* run.config OPT: -machdep x86_16 -print OPT: -machdep x86_32 -print OPT: -machdep x86_64 -print OPT: -machdep gcc_x86_16 -print OPT: -machdep gcc_x86_32 -print OPT: -machdep gcc_x86_64 -print OPT: -machdep ppc_32 -print OPT: -machdep msvc_x86_64 -print */ #include #include #define CHECK_SIGNED(kind,KIND,size) \ { int##kind##size##_t x; \ scanf("%"SCNd##KIND##size,&x); \ printf("%"PRId##KIND##size,x); \ scanf("%"SCNi##KIND##size,&x); \ printf("%"PRIi##KIND##size,x); \ } #define CHECK_UNSIGNED(kind,KIND,size) \ { uint##kind##size##_t x; \ scanf("%"SCNo##KIND##size,&x); \ printf("%"PRIo##KIND##size,x); \ scanf("%"SCNu##KIND##size,&x); \ printf("%"PRIu##KIND##size,x); \ scanf("%"SCNx##KIND##size,&x); \ printf("%"PRIx##KIND##size,x); \ scanf("%"SCNx##KIND##size,&x); \ printf("%"PRIX##KIND##size,x); \ } #define CHECK(kind,KIND,size) \ CHECK_SIGNED(kind,KIND,size) \ CHECK_UNSIGNED(kind,KIND,size) #define CHECK_KIND(kind,KIND) \ CHECK(kind,KIND,8) \ CHECK(kind,KIND,16) \ CHECK(kind,KIND,32) \ CHECK(kind,KIND,64) int main () { CHECK_KIND(,); CHECK_KIND(_least,LEAST); CHECK_KIND(_fast,FAST); CHECK(max,MAX,); CHECK(ptr,PTR,); } frama-c-20.0-Calcium/tests/libc/inttypes_h2.c0000666000000000000000000000070613571573400015705 0ustar #include volatile int nondet; void main() { intmax_t a, b; imaxdiv_t r; if (nondet) { a = INTMAX_MIN; b = -1; r = imaxdiv(a, b); //@ assert unreachable: \false; } if (nondet) { a = INTMAX_MAX; b = 0; r = imaxdiv(a, b); //@ assert unreachable: \false; } a = INTMAX_MAX; b = INTMAX_MAX/2; // note: division rounds down r = imaxdiv(a, b); //@ assert r.quot == 2; //@ assert r.rem == 1; } frama-c-20.0-Calcium/tests/libc/libgen_h.c0000666000000000000000000000054113571573400015201 0ustar /*run.config */ #include int main() { char path[128] = "/tmp/bla/ble.c"; char *base = basename(path); //@ assert valid_string(base); char *base2 = basename(0); //@ assert valid_string(base2); char *dir = dirname(path); //@ assert valid_string(dir); char *dir2 = dirname(0); //@ assert valid_string(dir2); return 0; } frama-c-20.0-Calcium/tests/libc/limits_h.c0000666000000000000000000000354113571573400015245 0ustar /*run.config STDOPT: #"-machdep x86_16" STDOPT: #"-machdep x86_32" STDOPT: #"-machdep x86_64" STDOPT: #"-machdep gcc_x86_16" STDOPT: #"-machdep gcc_x86_32" STDOPT: #"-machdep gcc_x86_64" STDOPT: #"-machdep ppc_32" STDOPT: #"-machdep msvc_x86_64" */ #include #include #include void main() { /*@ assert LLONG_MIN <= LONG_MIN <= INT_MIN <= SHRT_MIN <= SCHAR_MIN <= CHAR_MIN <= 0; */ /*@ assert 0 <= CHAR_MAX <= UCHAR_MAX <= SHRT_MAX <= USHRT_MAX; */ /*@ assert SHRT_MAX <= INT_MAX <= LONG_MAX <= LLONG_MAX; */ /*@ assert USHRT_MAX <= UINT_MAX <= ULONG_MAX <= ULLONG_MAX; */ /*@ assert INT_MAX <= UINT_MAX; */ /*@ assert LONG_MAX <= ULONG_MAX; */ /*@ assert LLONG_MAX <= ULLONG_MAX; */ /*@ assert SCHAR_MIN == -SCHAR_MAX -1; */ /*@ assert SHRT_MIN == -SHRT_MAX -1; */ /*@ assert INT_MIN == -INT_MAX -1; */ /*@ assert LONG_MIN == -LONG_MAX -1; */ /*@ assert LLONG_MIN == -LLONG_MAX -1; */ /*@ assert UINT_LEAST8_MAX >= INT_LEAST8_MAX == -INT_LEAST8_MIN -1; */ /*@ assert UINT_FAST8_MAX >= INT_FAST8_MAX == -INT_FAST8_MIN -1; */ /*@ assert UINT_LEAST16_MAX >= INT_LEAST16_MAX == -INT_LEAST16_MIN -1; */ /*@ assert UINT_FAST16_MAX >= INT_FAST16_MAX == -INT_FAST16_MIN -1; */ /*@ assert UINT_LEAST32_MAX >= INT_LEAST32_MAX == -INT_LEAST32_MIN -1; */ /*@ assert UINT_FAST32_MAX >= INT_FAST32_MAX == -INT_FAST32_MIN -1; */ /*@ assert UINT_LEAST64_MAX >= INT_LEAST64_MAX == -INT_LEAST64_MIN -1; */ /*@ assert UINT_FAST64_MAX >= INT_FAST64_MAX == -INT_FAST64_MIN -1; */ /*@ assert INTMAX_MIN == -INTMAX_MAX -1; */ /*@ assert WCHAR_MIN <= WCHAR_MAX; */ size_t size_max = SIZE_MAX; #ifdef __FC_POSIX_VERSION ssize_t ssize_max = SSIZE_MAX; #endif intptr_t intptr_max = INTPTR_MAX; intptr_t intptr_min = INTPTR_MIN; uintptr_t uintptr_max = UINTPTR_MAX; uintmax_t uintmax_max = UINTMAX_MAX; } frama-c-20.0-Calcium/tests/libc/math_h.c0000666000000000000000000000303013571573400014666 0ustar #include const double pi = 3.14159265358979323846264338327950288; const double half_pi = 1.57079632679489661923132169163975144; const double e = 2.718281828459045090795598298427648842334747314453125; volatile double top; const float f_pi = 3.14159265358979323846264338327950288F; const float f_half_pi = 1.57079632679489661923132169163975144F; const float f_e = 2.718281828459045090795598298427648842334747314453125F; volatile float f_top; const long double ld_pi = 3.14159265358979323846264338327950288L; const long double ld_half_pi = 1.57079632679489661923132169163975144L; const long double ld_e = 2.718281828459045090795598298427648842334747314453125L; volatile long double ld_top; const double zero = 0.0; const double minus_zero = -0.0; const double one = 1.0; const double minus_one = -1.0; const double large = 1e38; #define TEST_VAL(type,f,c) type f##_##c = f(c) #define TEST_FUN(type,f,prefix) \ TEST_VAL(type,f,prefix##pi); \ TEST_VAL(type,f,prefix##half_pi); \ TEST_VAL(type,f,prefix##e); \ TEST_VAL(type,f,zero); \ TEST_VAL(type,f,minus_zero); \ TEST_VAL(type,f,one); \ TEST_VAL(type,f,minus_one); \ TEST_VAL(type,f,large); \ TEST_VAL(type,f,prefix##top) int main() { TEST_FUN(double,atan,); TEST_FUN(float,atanf,f_); TEST_FUN(long double,atanl,ld_); TEST_FUN(double,fabs,); TEST_FUN(float,fabsf,f_); TEST_FUN(long double,fabsl,ld_); } frama-c-20.0-Calcium/tests/libc/more_gcc_builtins.c0000666000000000000000000000265113571573400017125 0ustar /* run.config STDOPT: #"-machdep gcc_x86_32" */ #include int main() { int res; _Bool r = __builtin_sadd_overflow(42, 43, &res); //@ assert res == 42 + 43; //@ assert r == 0; r = __builtin_sadd_overflow(42, INT_MAX, &res); //@ assert res == (int)(42 + INT_MAX); //@ assert r == 1; long lres; r = __builtin_saddl_overflow(42, LONG_MAX, &lres); //@ assert lres == (long)(42 + LONG_MAX); //@ assert r == 1; r = __builtin_saddl_overflow(-2, -LONG_MAX, &lres); //@ assert lres == (long)(-2 - LONG_MAX); //@ assert r == 1; long long llres; r = __builtin_saddll_overflow(-5, -LLONG_MAX, &llres); //@ assert llres == (long long)(-5 - LLONG_MAX); //@ assert r == 1; unsigned ures; r = __builtin_uadd_overflow(9, UINT_MAX, &ures); //@ assert ures == (unsigned)(9 + UINT_MAX); //@ assert r == 1; unsigned long ulres; r = __builtin_uaddl_overflow(9, ULONG_MAX, &ulres); //@ assert ulres == (unsigned long)(9 + ULONG_MAX); //@ assert r == 1; unsigned long long ullres; r = __builtin_uaddll_overflow(9, ULLONG_MAX, &ullres); //@ assert ullres == (unsigned long long)(9 + ULLONG_MAX); //@ assert r == 1; r = __builtin_usubll_overflow(-5, ULLONG_MAX, &ullres); //@ assert ullres == (unsigned long long)(-5 - ULLONG_MAX); //@ assert r == 1; r = __builtin_smulll_overflow(-1, LLONG_MIN, &llres); //@ assert llres == (long long)(-1 * LLONG_MIN); //@ assert r == 1; return 0; } frama-c-20.0-Calcium/tests/libc/netdb_c.c0000666000000000000000000000364413571573400015037 0ustar /*run.config STDOPT: #"-eva-split-return auto -slevel 2" */ // Extract based on Linux Programmer's Manual, GETADDRINFO(3) man page #include #include #include #include #include #include #include "netdb.c" #define BUF_SIZE 500 // Non-POSIX #ifndef NI_MAXHOST # define NI_MAXHOST 1025 #endif #ifndef NI_MAXSERV # define NI_MAXSERV 32 #endif int main() { struct addrinfo hints; struct addrinfo *result, *rp; int sfd, s; struct sockaddr_storage peer_addr; socklen_t peer_addr_len; ssize_t nread; char buf[BUF_SIZE]; char *addr = "localhost"; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */ hints.ai_protocol = 0; /* Any protocol */ hints.ai_canonname = NULL; hints.ai_addr = NULL; hints.ai_next = NULL; s = getaddrinfo(NULL, addr, &hints, &result); if (s != 0) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(s)); exit(EXIT_FAILURE); } /* getaddrinfo() returns a list of address structures. Try each address until we successfully bind(2). If socket(2) (or bind(2)) fails, we (close the socket and) try the next address. */ for (rp = result; rp != NULL; rp = rp->ai_next) { sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (sfd == -1) continue; if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == 0) break; /* Success */ close(sfd); } if (rp == NULL) { /* No address succeeded */ fprintf(stderr, "Could not bind\n"); exit(EXIT_FAILURE); } freeaddrinfo(result); /* No longer needed */ struct hostent *h = gethostbyname("localhost"); if (h) { char *addrs = h->h_addr; int l = h->h_length; } return 0; } frama-c-20.0-Calcium/tests/libc/netinet_in_h.c0000666000000000000000000000017113571573400016074 0ustar #include #include int main() { struct in_addr addr = {0}; printf("%s", inet_ntoa(addr)); } frama-c-20.0-Calcium/tests/libc/oracle/0000777000000000000000000000000013571573400014533 5ustar frama-c-20.0-Calcium/tests/libc/oracle/alloca_h.res.oracle0000666000000000000000000000734513571573400020265 0ustar [kernel] Parsing tests/libc/alloca_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] tests/libc/alloca_h.c:30: Call to builtin alloca [eva] tests/libc/alloca_h.c:30: allocating variable __alloca_main_l30 [eva] tests/libc/alloca_h.c:31: assertion got status valid. [eva] tests/libc/alloca_h.c:35: Call to builtin alloca [eva] tests/libc/alloca_h.c:35: allocating variable __alloca_main_l35 [eva] tests/libc/alloca_h.c:40: assertion got status valid. [eva] computing for function f <- main. Called from tests/libc/alloca_h.c:41. [eva] tests/libc/alloca_h.c:6: Call to builtin alloca [eva] tests/libc/alloca_h.c:6: allocating variable __alloca_f_l6 [eva] tests/libc/alloca_h.c:7: Call to builtin malloc [eva] tests/libc/alloca_h.c:7: allocating variable __malloc_f_l7 [eva] tests/libc/alloca_h.c:9: Call to builtin free [eva:alarm] tests/libc/alloca_h.c:9: Warning: function free: precondition 'freeable' got status unknown. [eva:alarm] tests/libc/alloca_h.c:10: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [eva] Recording results for f [eva] Done for function f [eva] tests/libc/alloca_h.c:41: freeing automatic bases: {__alloca_f_l6} [eva] tests/libc/alloca_h.c:42: assertion got status valid. [eva] computing for function loop <- main. Called from tests/libc/alloca_h.c:43. [eva] tests/libc/alloca_h.c:23: Call to builtin alloca [eva] tests/libc/alloca_h.c:23: allocating variable __alloca_loop_l23 [eva] tests/libc/alloca_h.c:22: starting to merge loop iterations [eva] tests/libc/alloca_h.c:23: Call to builtin alloca [eva] tests/libc/alloca_h.c:23: Call to builtin alloca [eva] tests/libc/alloca_h.c:23: Call to builtin alloca [eva] tests/libc/alloca_h.c:23: Call to builtin alloca [eva] Recording results for loop [eva] Done for function loop [eva] tests/libc/alloca_h.c:43: freeing automatic bases: {__alloca_w_loop_l23} [eva:alarm] tests/libc/alloca_h.c:44: Warning: assertion got status unknown. [eva] tests/libc/alloca_h.c:45: Call to builtin alloca [eva] tests/libc/alloca_h.c:45: allocating variable __alloca_main_l45 [eva] computing for function f2 <- main. Called from tests/libc/alloca_h.c:46. [eva] tests/libc/alloca_h.c:16: Call to builtin alloca [eva] tests/libc/alloca_h.c:16: allocating variable __alloca_f2_l16 [eva] Recording results for f2 [eva] Done for function f2 [eva] tests/libc/alloca_h.c:46: freeing automatic bases: {__alloca_f2_l16} [eva] tests/libc/alloca_h.c:48: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f2: __fc_stack_status ∈ [--..--] p ∈ {{ &__alloca_f2_l16[0] }} __alloca_main_l45[0] ∈ {42} [1] ∈ {43} [eva:final-states] Values at end of function loop: __fc_stack_status ∈ [--..--] q ∈ {{ NULL ; &__alloca_w_loop_l23[0] }} [eva:final-states] Values at end of function f: __fc_heap_status ∈ [--..--] __fc_stack_status ∈ [--..--] p ∈ {{ &__alloca_f_l6[0] }} or ESCAPINGADDR q ∈ {{ NULL ; &__malloc_f_l7[0] }} or ESCAPINGADDR r ∈ {{ NULL ; &__alloca_f_l6[0] ; &__malloc_f_l7[0] }} or ESCAPINGADDR [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] __fc_stack_status ∈ [--..--] a ∈ {{ &__alloca_main_l30 }} p ∈ {{ &__alloca_main_l35[0] }} q ∈ ESCAPINGADDR r ∈ ESCAPINGADDR in ∈ {{ &__alloca_main_l45[0] }} s ∈ ESCAPINGADDR __retres ∈ {0} __alloca_main_l30 ∈ {42} __alloca_main_l35[0] ∈ {65} [1] ∈ {0} __alloca_main_l45[0] ∈ {44} [1] ∈ {43} frama-c-20.0-Calcium/tests/libc/oracle/assert_h.res.oracle0000666000000000000000000000324413571573400020325 0ustar [kernel] Parsing tests/libc/assert_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization fp ∈ {0} naan ∈ [--..--] s1 ∈ {0} nondet ∈ [--..--] [eva] computing for function __FC_assert <- main. Called from tests/libc/assert_h.c:13. [eva] using specification for function __FC_assert [eva:alarm] tests/libc/assert_h.c:13: Warning: function __FC_assert: precondition 'nonnull_c' got status unknown. [eva] Done for function __FC_assert [eva] computing for function __FC_assert <- main. Called from tests/libc/assert_h.c:14. [eva:alarm] tests/libc/assert_h.c:14: Warning: function __FC_assert: precondition 'nonnull_c' got status invalid. [eva] Done for function __FC_assert [eva] computing for function __FC_assert <- main. Called from tests/libc/assert_h.c:15. [eva] tests/libc/assert_h.c:15: function __FC_assert: precondition 'nonnull_c' got status valid. [eva] Done for function __FC_assert [eva] computing for function __FC_assert <- main. Called from tests/libc/assert_h.c:16. [eva:alarm] tests/libc/assert_h.c:16: Warning: function __FC_assert: precondition 'nonnull_c' got status invalid. [eva] Done for function __FC_assert [eva] computing for function __FC_assert <- main. Called from tests/libc/assert_h.c:17. [eva:alarm] tests/libc/assert_h.c:17: Warning: function __FC_assert: precondition 'nonnull_c' got status unknown. [eva] Done for function __FC_assert [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: frama-c-20.0-Calcium/tests/libc/oracle/coverage.res.oracle0000666000000000000000000000257713571573400020320 0ustar [kernel] Parsing tests/libc/coverage.c (with preprocessing) [kernel] Parsing share/libc/string.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function strlen <- main. Called from tests/libc/coverage.c:9. [eva] Recording results for strlen [eva] Done for function strlen [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function strlen: i ∈ {6} [eva:final-states] Values at end of function main: s ∈ {{ "blabli" }} l ∈ {6} [metrics] Eva coverage statistics ======================= Syntactically reachable functions = 1 (out of 1) Semantically reached functions = 1 Coverage estimation = 100.0% [metrics] Statements analyzed by Eva -------------------------- 4 stmts in analyzed functions, 4 stmts analyzed (100.0%) main: 4 stmts out of 4 (100.0%) [metrics] Eva coverage statistics ======================= Syntactically reachable functions = 2 (out of 112) Semantically reached functions = 2 Coverage estimation = 100.0% [metrics] Statements analyzed by Eva -------------------------- 10 stmts in analyzed functions, 10 stmts analyzed (100.0%) main: 4 stmts out of 4 (100.0%) strlen: 6 stmts out of 6 (100.0%) frama-c-20.0-Calcium/tests/libc/oracle/ctype.res.oracle0000666000000000000000000010664313571573400017650 0ustar [kernel] Parsing tests/libc/ctype.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:9. [eva] using specification for function isascii [eva] tests/libc/ctype.c:9: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] tests/libc/ctype.c:10: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:11. [eva] tests/libc/ctype.c:11: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] tests/libc/ctype.c:12: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:13. [eva] tests/libc/ctype.c:13: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:13. [eva] Done for function isascii [eva] tests/libc/ctype.c:14: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:15. [eva] tests/libc/ctype.c:15: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:15. [eva] Done for function isascii [eva] tests/libc/ctype.c:16: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:17. [eva] tests/libc/ctype.c:17: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:17. [eva] Done for function isascii [eva] tests/libc/ctype.c:18: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:19. [eva] tests/libc/ctype.c:19: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:19. [eva] Done for function isascii [eva] tests/libc/ctype.c:20: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:21. [eva] tests/libc/ctype.c:21: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:21. [eva] Done for function isascii [eva] tests/libc/ctype.c:22: assertion got status valid. [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:23. [eva] using specification for function isalnum [eva] tests/libc/ctype.c:23: function isalnum: precondition 'c_uchar_or_eof_or_EOF' got status valid. [eva] Done for function isalnum [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:23. [eva] Done for function isalnum [eva] tests/libc/ctype.c:24: assertion got status valid. [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:25. [eva] tests/libc/ctype.c:25: function isalnum: precondition 'c_uchar_or_eof_or_EOF' got status valid. [eva] Done for function isalnum [eva] tests/libc/ctype.c:26: assertion got status valid. [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:27. [eva] tests/libc/ctype.c:27: function isalnum: precondition 'c_uchar_or_eof_or_EOF' got status valid. [eva] Done for function isalnum [eva] tests/libc/ctype.c:28: assertion got status valid. [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:29. [eva] tests/libc/ctype.c:29: function isalnum: precondition 'c_uchar_or_eof_or_EOF' got status valid. [eva] Done for function isalnum [eva] tests/libc/ctype.c:30: assertion got status valid. [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:31. [eva] tests/libc/ctype.c:31: function isalnum: precondition 'c_uchar_or_eof_or_EOF' got status valid. [eva] Done for function isalnum [eva] tests/libc/ctype.c:32: assertion got status valid. [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:33. [eva] tests/libc/ctype.c:33: function isalnum: precondition 'c_uchar_or_eof_or_EOF' got status valid. [eva] Done for function isalnum [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:33. [eva] Done for function isalnum [eva] tests/libc/ctype.c:34: assertion got status valid. [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:35. [eva] tests/libc/ctype.c:35: function isalnum: precondition 'c_uchar_or_eof_or_EOF' got status valid. [eva] Done for function isalnum [eva] computing for function isalnum <- main. Called from tests/libc/ctype.c:35. [eva] Done for function isalnum [eva] tests/libc/ctype.c:36: assertion got status valid. [eva] computing for function isalpha <- main. Called from tests/libc/ctype.c:37. [eva] using specification for function isalpha [eva] tests/libc/ctype.c:37: function isalpha: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isalpha [eva] computing for function isalpha <- main. Called from tests/libc/ctype.c:37. [eva] Done for function isalpha [eva] tests/libc/ctype.c:38: assertion got status valid. [eva] computing for function isalpha <- main. Called from tests/libc/ctype.c:39. [eva] tests/libc/ctype.c:39: function isalpha: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isalpha [eva] tests/libc/ctype.c:40: assertion got status valid. [eva] computing for function isalpha <- main. Called from tests/libc/ctype.c:41. [eva] tests/libc/ctype.c:41: function isalpha: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isalpha [eva] tests/libc/ctype.c:42: assertion got status valid. [eva] computing for function isalpha <- main. Called from tests/libc/ctype.c:43. [eva] tests/libc/ctype.c:43: function isalpha: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isalpha [eva] tests/libc/ctype.c:44: assertion got status valid. [eva] computing for function isalpha <- main. Called from tests/libc/ctype.c:45. [eva] tests/libc/ctype.c:45: function isalpha: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isalpha [eva] tests/libc/ctype.c:46: assertion got status valid. [eva] computing for function isalpha <- main. Called from tests/libc/ctype.c:47. [eva] tests/libc/ctype.c:47: function isalpha: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isalpha [eva] tests/libc/ctype.c:48: assertion got status valid. [eva] computing for function isalpha <- main. Called from tests/libc/ctype.c:49. [eva] tests/libc/ctype.c:49: function isalpha: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isalpha [eva] computing for function isalpha <- main. Called from tests/libc/ctype.c:49. [eva] Done for function isalpha [eva] tests/libc/ctype.c:50: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:51. [eva] tests/libc/ctype.c:51: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:51. [eva] Done for function isascii [eva] tests/libc/ctype.c:52: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:53. [eva] tests/libc/ctype.c:53: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] tests/libc/ctype.c:54: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:55. [eva] tests/libc/ctype.c:55: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:55. [eva] Done for function isascii [eva] tests/libc/ctype.c:56: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:57. [eva] tests/libc/ctype.c:57: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:57. [eva] Done for function isascii [eva] tests/libc/ctype.c:58: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:59. [eva] tests/libc/ctype.c:59: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:59. [eva] Done for function isascii [eva] tests/libc/ctype.c:60: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:61. [eva] tests/libc/ctype.c:61: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:61. [eva] Done for function isascii [eva] tests/libc/ctype.c:62: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:63. [eva] tests/libc/ctype.c:63: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:63. [eva] Done for function isascii [eva] tests/libc/ctype.c:64: assertion got status valid. [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:65. [eva] tests/libc/ctype.c:65: function isascii: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isascii [eva] computing for function isascii <- main. Called from tests/libc/ctype.c:65. [eva] Done for function isascii [eva] tests/libc/ctype.c:66: assertion got status valid. [eva] computing for function isblank <- main. Called from tests/libc/ctype.c:67. [eva] using specification for function isblank [eva] tests/libc/ctype.c:67: function isblank: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isblank [eva] tests/libc/ctype.c:68: assertion got status valid. [eva] computing for function isblank <- main. Called from tests/libc/ctype.c:69. [eva] tests/libc/ctype.c:69: function isblank: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isblank [eva] tests/libc/ctype.c:70: assertion got status valid. [eva] computing for function isblank <- main. Called from tests/libc/ctype.c:71. [eva] tests/libc/ctype.c:71: function isblank: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isblank [eva] tests/libc/ctype.c:72: assertion got status valid. [eva] computing for function isblank <- main. Called from tests/libc/ctype.c:73. [eva] tests/libc/ctype.c:73: function isblank: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isblank [eva] tests/libc/ctype.c:74: assertion got status valid. [eva] computing for function isblank <- main. Called from tests/libc/ctype.c:75. [eva] tests/libc/ctype.c:75: function isblank: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isblank [eva] computing for function isblank <- main. Called from tests/libc/ctype.c:75. [eva] Done for function isblank [eva] tests/libc/ctype.c:76: assertion got status valid. [eva] computing for function isblank <- main. Called from tests/libc/ctype.c:77. [eva] tests/libc/ctype.c:77: function isblank: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isblank [eva] tests/libc/ctype.c:78: assertion got status valid. [eva] computing for function isblank <- main. Called from tests/libc/ctype.c:79. [eva] tests/libc/ctype.c:79: function isblank: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isblank [eva] tests/libc/ctype.c:80: assertion got status valid. [eva] computing for function iscntrl <- main. Called from tests/libc/ctype.c:81. [eva] using specification for function iscntrl [eva] tests/libc/ctype.c:81: function iscntrl: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function iscntrl [eva] tests/libc/ctype.c:82: assertion got status valid. [eva] computing for function iscntrl <- main. Called from tests/libc/ctype.c:83. [eva] tests/libc/ctype.c:83: function iscntrl: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function iscntrl [eva] tests/libc/ctype.c:84: assertion got status valid. [eva] computing for function iscntrl <- main. Called from tests/libc/ctype.c:85. [eva] tests/libc/ctype.c:85: function iscntrl: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function iscntrl [eva] computing for function iscntrl <- main. Called from tests/libc/ctype.c:85. [eva] Done for function iscntrl [eva] tests/libc/ctype.c:86: assertion got status valid. [eva] computing for function iscntrl <- main. Called from tests/libc/ctype.c:87. [eva] tests/libc/ctype.c:87: function iscntrl: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function iscntrl [eva] computing for function iscntrl <- main. Called from tests/libc/ctype.c:87. [eva] Done for function iscntrl [eva] tests/libc/ctype.c:88: assertion got status valid. [eva] computing for function iscntrl <- main. Called from tests/libc/ctype.c:89. [eva] tests/libc/ctype.c:89: function iscntrl: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function iscntrl [eva] tests/libc/ctype.c:90: assertion got status valid. [eva] computing for function iscntrl <- main. Called from tests/libc/ctype.c:91. [eva] tests/libc/ctype.c:91: function iscntrl: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function iscntrl [eva] tests/libc/ctype.c:92: assertion got status valid. [eva] computing for function iscntrl <- main. Called from tests/libc/ctype.c:93. [eva] tests/libc/ctype.c:93: function iscntrl: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function iscntrl [eva] tests/libc/ctype.c:94: assertion got status valid. [eva] computing for function isdigit <- main. Called from tests/libc/ctype.c:95. [eva] using specification for function isdigit [eva] tests/libc/ctype.c:95: function isdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isdigit [eva] tests/libc/ctype.c:96: assertion got status valid. [eva] computing for function isdigit <- main. Called from tests/libc/ctype.c:97. [eva] tests/libc/ctype.c:97: function isdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isdigit [eva] tests/libc/ctype.c:98: assertion got status valid. [eva] computing for function isdigit <- main. Called from tests/libc/ctype.c:99. [eva] tests/libc/ctype.c:99: function isdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isdigit [eva] tests/libc/ctype.c:100: assertion got status valid. [eva] computing for function isdigit <- main. Called from tests/libc/ctype.c:101. [eva] tests/libc/ctype.c:101: function isdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isdigit [eva] tests/libc/ctype.c:102: assertion got status valid. [eva] computing for function isdigit <- main. Called from tests/libc/ctype.c:103. [eva] tests/libc/ctype.c:103: function isdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isdigit [eva] tests/libc/ctype.c:104: assertion got status valid. [eva] computing for function isdigit <- main. Called from tests/libc/ctype.c:105. [eva] tests/libc/ctype.c:105: function isdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isdigit [eva] computing for function isdigit <- main. Called from tests/libc/ctype.c:105. [eva] Done for function isdigit [eva] tests/libc/ctype.c:106: assertion got status valid. [eva] computing for function isdigit <- main. Called from tests/libc/ctype.c:107. [eva] tests/libc/ctype.c:107: function isdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isdigit [eva] tests/libc/ctype.c:108: assertion got status valid. [eva] computing for function isdigit <- main. Called from tests/libc/ctype.c:109. [eva] tests/libc/ctype.c:109: function isdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isdigit [eva] tests/libc/ctype.c:110: assertion got status valid. [eva] computing for function isgraph <- main. Called from tests/libc/ctype.c:111. [eva] using specification for function isgraph [eva] tests/libc/ctype.c:111: function isgraph: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isgraph [eva] tests/libc/ctype.c:112: assertion got status valid. [eva] computing for function isgraph <- main. Called from tests/libc/ctype.c:113. [eva] tests/libc/ctype.c:113: function isgraph: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isgraph [eva] tests/libc/ctype.c:114: assertion got status valid. [eva] computing for function isgraph <- main. Called from tests/libc/ctype.c:115. [eva] tests/libc/ctype.c:115: function isgraph: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isgraph [eva] tests/libc/ctype.c:116: assertion got status valid. [eva] computing for function isgraph <- main. Called from tests/libc/ctype.c:117. [eva] tests/libc/ctype.c:117: function isgraph: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isgraph [eva] tests/libc/ctype.c:118: assertion got status valid. [eva] computing for function isgraph <- main. Called from tests/libc/ctype.c:119. [eva] tests/libc/ctype.c:119: function isgraph: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isgraph [eva] tests/libc/ctype.c:120: assertion got status valid. [eva] computing for function isgraph <- main. Called from tests/libc/ctype.c:121. [eva] tests/libc/ctype.c:121: function isgraph: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isgraph [eva] computing for function isgraph <- main. Called from tests/libc/ctype.c:121. [eva] Done for function isgraph [eva] tests/libc/ctype.c:122: assertion got status valid. [eva] computing for function isgraph <- main. Called from tests/libc/ctype.c:123. [eva] tests/libc/ctype.c:123: function isgraph: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isgraph [eva] computing for function isgraph <- main. Called from tests/libc/ctype.c:123. [eva] Done for function isgraph [eva] tests/libc/ctype.c:124: assertion got status valid. [eva] computing for function islower <- main. Called from tests/libc/ctype.c:125. [eva] using specification for function islower [eva] tests/libc/ctype.c:125: function islower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function islower [eva] computing for function islower <- main. Called from tests/libc/ctype.c:125. [eva] Done for function islower [eva] tests/libc/ctype.c:126: assertion got status valid. [eva] computing for function islower <- main. Called from tests/libc/ctype.c:127. [eva] tests/libc/ctype.c:127: function islower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function islower [eva] tests/libc/ctype.c:128: assertion got status valid. [eva] computing for function islower <- main. Called from tests/libc/ctype.c:129. [eva] tests/libc/ctype.c:129: function islower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function islower [eva] tests/libc/ctype.c:130: assertion got status valid. [eva] computing for function islower <- main. Called from tests/libc/ctype.c:131. [eva] tests/libc/ctype.c:131: function islower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function islower [eva] tests/libc/ctype.c:132: assertion got status valid. [eva] computing for function islower <- main. Called from tests/libc/ctype.c:133. [eva] tests/libc/ctype.c:133: function islower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function islower [eva] tests/libc/ctype.c:134: assertion got status valid. [eva] computing for function islower <- main. Called from tests/libc/ctype.c:135. [eva] tests/libc/ctype.c:135: function islower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function islower [eva] tests/libc/ctype.c:136: assertion got status valid. [eva] computing for function islower <- main. Called from tests/libc/ctype.c:137. [eva] tests/libc/ctype.c:137: function islower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function islower [eva] tests/libc/ctype.c:138: assertion got status valid. [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:139. [eva] using specification for function isprint [eva] tests/libc/ctype.c:139: function isprint: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isprint [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:139. [eva] Done for function isprint [eva] tests/libc/ctype.c:140: assertion got status valid. [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:141. [eva] tests/libc/ctype.c:141: function isprint: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isprint [eva] tests/libc/ctype.c:142: assertion got status valid. [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:143. [eva] tests/libc/ctype.c:143: function isprint: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isprint [eva] tests/libc/ctype.c:144: assertion got status valid. [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:145. [eva] tests/libc/ctype.c:145: function isprint: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isprint [eva] tests/libc/ctype.c:146: assertion got status valid. [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:147. [eva] tests/libc/ctype.c:147: function isprint: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isprint [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:147. [eva] Done for function isprint [eva] tests/libc/ctype.c:148: assertion got status valid. [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:149. [eva] tests/libc/ctype.c:149: function isprint: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isprint [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:149. [eva] Done for function isprint [eva] tests/libc/ctype.c:150: assertion got status valid. [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:151. [eva] tests/libc/ctype.c:151: function isprint: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isprint [eva] computing for function isprint <- main. Called from tests/libc/ctype.c:151. [eva] Done for function isprint [eva] tests/libc/ctype.c:152: assertion got status valid. [eva] computing for function ispunct <- main. Called from tests/libc/ctype.c:153. [eva] using specification for function ispunct [eva] tests/libc/ctype.c:153: function ispunct: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function ispunct [eva] computing for function ispunct <- main. Called from tests/libc/ctype.c:153. [eva] Done for function ispunct [eva] tests/libc/ctype.c:154: assertion got status valid. [eva] computing for function ispunct <- main. Called from tests/libc/ctype.c:155. [eva] tests/libc/ctype.c:155: function ispunct: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function ispunct [eva] tests/libc/ctype.c:156: assertion got status valid. [eva] computing for function ispunct <- main. Called from tests/libc/ctype.c:157. [eva] tests/libc/ctype.c:157: function ispunct: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function ispunct [eva] tests/libc/ctype.c:158: assertion got status valid. [eva] computing for function ispunct <- main. Called from tests/libc/ctype.c:159. [eva] tests/libc/ctype.c:159: function ispunct: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function ispunct [eva] tests/libc/ctype.c:160: assertion got status valid. [eva] computing for function ispunct <- main. Called from tests/libc/ctype.c:161. [eva] tests/libc/ctype.c:161: function ispunct: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function ispunct [eva] tests/libc/ctype.c:162: assertion got status valid. [eva] computing for function ispunct <- main. Called from tests/libc/ctype.c:163. [eva] tests/libc/ctype.c:163: function ispunct: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function ispunct [eva] tests/libc/ctype.c:164: assertion got status valid. [eva] computing for function ispunct <- main. Called from tests/libc/ctype.c:165. [eva] tests/libc/ctype.c:165: function ispunct: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function ispunct [eva] tests/libc/ctype.c:166: assertion got status valid. [eva] computing for function isspace <- main. Called from tests/libc/ctype.c:167. [eva] using specification for function isspace [eva] tests/libc/ctype.c:167: function isspace: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isspace [eva] tests/libc/ctype.c:168: assertion got status valid. [eva] computing for function isspace <- main. Called from tests/libc/ctype.c:169. [eva] tests/libc/ctype.c:169: function isspace: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isspace [eva] tests/libc/ctype.c:170: assertion got status valid. [eva] computing for function isspace <- main. Called from tests/libc/ctype.c:171. [eva] tests/libc/ctype.c:171: function isspace: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isspace [eva] tests/libc/ctype.c:172: assertion got status valid. [eva] computing for function isspace <- main. Called from tests/libc/ctype.c:173. [eva] tests/libc/ctype.c:173: function isspace: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isspace [eva] tests/libc/ctype.c:174: assertion got status valid. [eva] computing for function isspace <- main. Called from tests/libc/ctype.c:175. [eva] tests/libc/ctype.c:175: function isspace: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isspace [eva] computing for function isspace <- main. Called from tests/libc/ctype.c:175. [eva] Done for function isspace [eva] tests/libc/ctype.c:176: assertion got status valid. [eva] computing for function isspace <- main. Called from tests/libc/ctype.c:177. [eva] tests/libc/ctype.c:177: function isspace: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isspace [eva] tests/libc/ctype.c:178: assertion got status valid. [eva] computing for function isspace <- main. Called from tests/libc/ctype.c:179. [eva] tests/libc/ctype.c:179: function isspace: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isspace [eva] tests/libc/ctype.c:180: assertion got status valid. [eva] computing for function isupper <- main. Called from tests/libc/ctype.c:181. [eva] using specification for function isupper [eva] tests/libc/ctype.c:181: function isupper: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isupper [eva] tests/libc/ctype.c:182: assertion got status valid. [eva] computing for function isupper <- main. Called from tests/libc/ctype.c:183. [eva] tests/libc/ctype.c:183: function isupper: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isupper [eva] tests/libc/ctype.c:184: assertion got status valid. [eva] computing for function isupper <- main. Called from tests/libc/ctype.c:185. [eva] tests/libc/ctype.c:185: function isupper: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isupper [eva] tests/libc/ctype.c:186: assertion got status valid. [eva] computing for function isupper <- main. Called from tests/libc/ctype.c:187. [eva] tests/libc/ctype.c:187: function isupper: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isupper [eva] tests/libc/ctype.c:188: assertion got status valid. [eva] computing for function isupper <- main. Called from tests/libc/ctype.c:189. [eva] tests/libc/ctype.c:189: function isupper: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isupper [eva] tests/libc/ctype.c:190: assertion got status valid. [eva] computing for function isupper <- main. Called from tests/libc/ctype.c:191. [eva] tests/libc/ctype.c:191: function isupper: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isupper [eva] tests/libc/ctype.c:192: assertion got status valid. [eva] computing for function isupper <- main. Called from tests/libc/ctype.c:193. [eva] tests/libc/ctype.c:193: function isupper: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isupper [eva] computing for function isupper <- main. Called from tests/libc/ctype.c:193. [eva] Done for function isupper [eva] tests/libc/ctype.c:194: assertion got status valid. [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:195. [eva] using specification for function isxdigit [eva] tests/libc/ctype.c:195: function isxdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isxdigit [eva] tests/libc/ctype.c:196: assertion got status valid. [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:197. [eva] tests/libc/ctype.c:197: function isxdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isxdigit [eva] tests/libc/ctype.c:198: assertion got status valid. [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:199. [eva] tests/libc/ctype.c:199: function isxdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isxdigit [eva] tests/libc/ctype.c:200: assertion got status valid. [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:201. [eva] tests/libc/ctype.c:201: function isxdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isxdigit [eva] tests/libc/ctype.c:202: assertion got status valid. [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:203. [eva] tests/libc/ctype.c:203: function isxdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isxdigit [eva] tests/libc/ctype.c:204: assertion got status valid. [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:205. [eva] tests/libc/ctype.c:205: function isxdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isxdigit [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:205. [eva] Done for function isxdigit [eva] tests/libc/ctype.c:206: assertion got status valid. [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:207. [eva] tests/libc/ctype.c:207: function isxdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isxdigit [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:207. [eva] Done for function isxdigit [eva] tests/libc/ctype.c:208: assertion got status valid. [eva] computing for function isxdigit <- main. Called from tests/libc/ctype.c:209. [eva] tests/libc/ctype.c:209: function isxdigit: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function isxdigit [eva] tests/libc/ctype.c:210: assertion got status valid. [eva] computing for function tolower <- main. Called from tests/libc/ctype.c:211. [eva] using specification for function tolower [eva] tests/libc/ctype.c:211: function tolower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function tolower [eva] tests/libc/ctype.c:212: assertion got status valid. [eva] computing for function tolower <- main. Called from tests/libc/ctype.c:213. [eva] tests/libc/ctype.c:213: function tolower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function tolower [eva] tests/libc/ctype.c:214: assertion got status valid. [eva] computing for function tolower <- main. Called from tests/libc/ctype.c:215. [eva] tests/libc/ctype.c:215: function tolower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function tolower [eva] tests/libc/ctype.c:216: assertion got status valid. [eva] computing for function tolower <- main. Called from tests/libc/ctype.c:217. [eva] tests/libc/ctype.c:217: function tolower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function tolower [eva] tests/libc/ctype.c:218: assertion got status valid. [eva] computing for function tolower <- main. Called from tests/libc/ctype.c:219. [eva] tests/libc/ctype.c:219: function tolower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function tolower [eva] tests/libc/ctype.c:220: assertion got status valid. [eva] computing for function tolower <- main. Called from tests/libc/ctype.c:221. [eva] tests/libc/ctype.c:221: function tolower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function tolower [eva] tests/libc/ctype.c:222: assertion got status valid. [eva] computing for function tolower <- main. Called from tests/libc/ctype.c:223. [eva] tests/libc/ctype.c:223: function tolower: precondition 'c_uchar_or_eof' got status valid. [eva] Done for function tolower [eva] tests/libc/ctype.c:224: assertion got status valid. [eva] computing for function toupper <- main. Called from tests/libc/ctype.c:225. [eva] using specification for function toupper [eva] tests/libc/ctype.c:225: function toupper: precondition 'c_uchar_of_eof' got status valid. [eva] Done for function toupper [eva] tests/libc/ctype.c:226: assertion got status valid. [eva] computing for function toupper <- main. Called from tests/libc/ctype.c:227. [eva] tests/libc/ctype.c:227: function toupper: precondition 'c_uchar_of_eof' got status valid. [eva] Done for function toupper [eva] tests/libc/ctype.c:228: assertion got status valid. [eva] computing for function toupper <- main. Called from tests/libc/ctype.c:229. [eva] tests/libc/ctype.c:229: function toupper: precondition 'c_uchar_of_eof' got status valid. [eva] Done for function toupper [eva] tests/libc/ctype.c:230: assertion got status valid. [eva] computing for function toupper <- main. Called from tests/libc/ctype.c:231. [eva] tests/libc/ctype.c:231: function toupper: precondition 'c_uchar_of_eof' got status valid. [eva] Done for function toupper [eva] tests/libc/ctype.c:232: assertion got status valid. [eva] computing for function toupper <- main. Called from tests/libc/ctype.c:233. [eva] tests/libc/ctype.c:233: function toupper: precondition 'c_uchar_of_eof' got status valid. [eva] Done for function toupper [eva] tests/libc/ctype.c:234: assertion got status valid. [eva] computing for function toupper <- main. Called from tests/libc/ctype.c:235. [eva] tests/libc/ctype.c:235: function toupper: precondition 'c_uchar_of_eof' got status valid. [eva] Done for function toupper [eva] tests/libc/ctype.c:236: assertion got status valid. [eva] computing for function toupper <- main. Called from tests/libc/ctype.c:237. [eva] tests/libc/ctype.c:237: function toupper: precondition 'c_uchar_of_eof' got status valid. [eva] Done for function toupper [eva] tests/libc/ctype.c:238: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: r ∈ {90} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/fc_libc.0.res.oracle0000666000000000000000000003224213571573400020234 0ustar [kernel] Parsing tests/libc/fc_libc.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/fc_libc.c:153: assertion got status valid. [eva] tests/libc/fc_libc.c:154: assertion got status valid. [eva] tests/libc/fc_libc.c:155: assertion got status valid. [eva] tests/libc/fc_libc.c:156: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [metrics] Defined functions (82) ====================== Frama_C_abort (1 call); Frama_C_char_interval (1 call); Frama_C_double_interval (0 call); Frama_C_float_interval (0 call); Frama_C_interval (14 calls); Frama_C_make_unknown (4 calls); Frama_C_nondet (12 calls); Frama_C_nondet_ptr (0 call); Frama_C_update_entropy (7 calls); __FC_assert (0 call); __fc_initenv (4 calls); __finite (0 call); __finitef (0 call); abs (0 call); atoi (0 call); calloc (0 call); char_equal_ignore_case (1 call); fabs (0 call); fabsf (0 call); feholdexcept (0 call); fesetenv (0 call); fetestexcept (0 call); getaddrinfo (0 call); getenv (0 call); gethostbyname (0 call); getline (0 call); glob (0 call); globfree (0 call); imaxabs (0 call); imaxdiv (0 call); isalnum (0 call); isalpha (0 call); isblank (0 call); iscntrl (0 call); isdigit (3 calls); isgraph (0 call); islower (0 call); isprint (0 call); ispunct (0 call); isspace (1 call); isupper (0 call); isxdigit (0 call); localeconv (0 call); main (0 call); memchr (0 call); memcmp (0 call); memcpy (4 calls); memmove (0 call); memoverlap (1 call); memrchr (0 call); memset (1 call); posix_memalign (0 call); putenv (0 call); res_search (1 call); setenv (0 call); setlocale (0 call); strcasecmp (0 call); strcat (0 call); strchr (3 calls); strcmp (0 call); strcpy (0 call); strdup (0 call); strerror (0 call); strlen (6 calls); strncat (0 call); strncmp (0 call); strncpy (2 calls); strndup (0 call); strnlen (0 call); strrchr (0 call); strsignal (0 call); strstr (0 call); tolower (0 call); toupper (0 call); unsetenv (0 call); wcscat (0 call); wcscpy (0 call); wcslen (2 calls); wcsncat (0 call); wcsncpy (0 call); wmemcpy (0 call); wmemset (0 call); Undefined functions (384) ========================= FD_CLR (0 call); FD_ISSET (0 call); FD_SET (0 call); FD_ZERO (0 call); Frama_C_int_interval (0 call); Frama_C_long_interval (0 call); Frama_C_long_long_interval (0 call); Frama_C_real_interval_as_double (0 call); Frama_C_short_interval (0 call); Frama_C_size_t_interval (0 call); Frama_C_unsigned_char_interval (0 call); Frama_C_unsigned_int_interval (0 call); Frama_C_unsigned_long_interval (0 call); Frama_C_unsigned_long_long_interval (0 call); Frama_C_unsigned_short_interval (0 call); _Exit (0 call); __builtin_abort (1 call); __builtin_sadd_overflow (0 call); __builtin_saddl_overflow (0 call); __builtin_saddll_overflow (0 call); __builtin_smul_overflow (0 call); __builtin_smull_overflow (0 call); __builtin_smulll_overflow (0 call); __builtin_ssub_overflow (0 call); __builtin_ssubl_overflow (0 call); __builtin_ssubll_overflow (0 call); __builtin_uadd_overflow (0 call); __builtin_uaddl_overflow (0 call); __builtin_uaddll_overflow (0 call); __builtin_umul_overflow (0 call); __builtin_umull_overflow (0 call); __builtin_umulll_overflow (0 call); __builtin_usub_overflow (0 call); __builtin_usubl_overflow (0 call); __builtin_usubll_overflow (0 call); __fc_fpclassify (0 call); __fc_fpclassifyf (0 call); __fc_infinity (0 call); __fc_nan (0 call); __va_fcntl_flock (0 call); __va_fcntl_int (0 call); __va_fcntl_void (0 call); __va_ioctl_int (0 call); __va_ioctl_ptr (0 call); __va_ioctl_void (0 call); __va_open_mode_t (0 call); __va_open_void (0 call); __va_openat_mode_t (0 call); __va_openat_void (0 call); _exit (0 call); abort (0 call); accept (0 call); access (0 call); acos (0 call); acosf (0 call); acosh (0 call); acoshf (0 call); acoshl (0 call); acosl (0 call); alloca (0 call); asin (0 call); asinf (0 call); asinl (0 call); at_quick_exit (0 call); atan (0 call); atan2 (0 call); atan2f (0 call); atanf (0 call); atanl (0 call); atexit (0 call); atof (0 call); atol (0 call); atoll (0 call); basename (0 call); bind (0 call); bsearch (0 call); bzero (0 call); ceil (0 call); ceilf (0 call); ceill (0 call); chdir (0 call); chown (0 call); chroot (0 call); clearerr (0 call); clearerr_unlocked (0 call); clock (0 call); clock_gettime (0 call); clock_nanosleep (0 call); close (0 call); closedir (0 call); closelog (0 call); connect (0 call); cos (0 call); cosf (0 call); cosl (0 call); creat (0 call); ctime (0 call); difftime (0 call); dirname (0 call); div (0 call); drand48 (0 call); dup (0 call); dup2 (0 call); erand48 (0 call); execl (0 call); execle (0 call); execlp (0 call); execv (0 call); execve (0 call); execvp (0 call); exit (0 call); exp (0 call); expf (0 call); fabsl (0 call); fclose (0 call); fcntl (0 call); fdopen (0 call); feof (2 calls); feof_unlocked (0 call); ferror (2 calls); ferror_unlocked (0 call); fflush (0 call); fgetc (1 call); fgetpos (0 call); fgets (0 call); fgetws (0 call); fileno (0 call); fileno_unlocked (0 call); flock (0 call); flockfile (0 call); floor (0 call); floorf (0 call); floorl (0 call); fmod (0 call); fmodf (0 call); fopen (0 call); fork (0 call); fputc (0 call); fputs (0 call); fread (0 call); free (1 call); freeaddrinfo (0 call); freopen (0 call); fseek (0 call); fsetpos (0 call); ftell (0 call); ftrylockfile (0 call); funlockfile (0 call); fwrite (0 call); gai_strerror (0 call); getc (0 call); getc_unlocked (0 call); getchar (0 call); getchar_unlocked (0 call); getcwd (0 call); getegid (0 call); geteuid (0 call); getgid (0 call); gethostname (0 call); getitimer (0 call); getopt (0 call); getopt_long (0 call); getopt_long_only (0 call); getpgid (0 call); getpgrp (0 call); getpid (0 call); getppid (0 call); getpriority (0 call); getpwnam (0 call); getpwuid (0 call); getresgid (0 call); getresuid (0 call); getrlimit (0 call); getrusage (0 call); gets (0 call); getsid (0 call); getsockopt (0 call); gettimeofday (0 call); getuid (0 call); gmtime (0 call); htonl (0 call); htons (0 call); iconv (0 call); iconv_close (0 call); iconv_open (0 call); inet_addr (2 calls); inet_ntoa (0 call); inet_ntop (0 call); inet_pton (0 call); isascii (0 call); isatty (0 call); jrand48 (0 call); kill (0 call); killpg (0 call); labs (0 call); lcong48 (0 call); ldiv (0 call); listen (0 call); llabs (0 call); lldiv (0 call); localtime (0 call); log (0 call); log10 (0 call); log10f (0 call); log10l (0 call); log2 (0 call); log2f (0 call); log2l (0 call); logf (0 call); logl (0 call); longjmp (0 call); lrand48 (0 call); lseek (0 call); malloc (7 calls); mblen (0 call); mbstowcs (0 call); mbtowc (0 call); mkdir (0 call); mkstemp (0 call); mktime (0 call); mrand48 (0 call); nan (0 call); nanf (0 call); nanl (0 call); nanosleep (0 call); nrand48 (0 call); ntohl (0 call); ntohs (0 call); open (0 call); openat (0 call); opendir (0 call); openlog (0 call); pathconf (0 call); pclose (0 call); perror (0 call); pipe (0 call); poll (0 call); popen (0 call); pow (0 call); powf (0 call); pthread_cond_broadcast (0 call); pthread_cond_destroy (0 call); pthread_cond_init (0 call); pthread_cond_wait (0 call); pthread_create (0 call); pthread_join (0 call); pthread_mutex_destroy (0 call); pthread_mutex_init (0 call); pthread_mutex_lock (0 call); pthread_mutex_unlock (0 call); putc (0 call); putc_unlocked (0 call); putchar (0 call); putchar_unlocked (0 call); puts (0 call); qsort (0 call); quick_exit (0 call); raise (0 call); rand (0 call); random (0 call); read (0 call); readdir (0 call); readv (0 call); realloc (3 calls); recv (0 call); recvmsg (0 call); remove (0 call); rename (0 call); rewind (0 call); round (0 call); roundf (0 call); roundl (0 call); seed48 (0 call); select (0 call); send (0 call); setbuf (0 call); setegid (0 call); seteuid (0 call); setgid (0 call); sethostname (0 call); setitimer (0 call); setjmp (0 call); setlogmask (0 call); setpgid (0 call); setpriority (0 call); setregid (0 call); setresgid (0 call); setresuid (0 call); setreuid (0 call); setrlimit (0 call); setsid (0 call); setsockopt (0 call); settimeofday (0 call); setuid (0 call); setvbuf (0 call); shutdown (0 call); sigaction (0 call); sigaddset (0 call); sigdelset (0 call); sigemptyset (0 call); sigfillset (0 call); sigismember (0 call); siglongjmp (0 call); signal (0 call); sigprocmask (0 call); sin (0 call); sinf (0 call); sinl (0 call); socket (0 call); socketpair (0 call); sqrt (0 call); sqrtf (0 call); sqrtl (0 call); srand (0 call); srand48 (0 call); srandom (0 call); stat (0 call); stpcpy (0 call); strcasestr (0 call); strcoll (0 call); strcspn (0 call); strftime (0 call); strlcat (0 call); strlcpy (0 call); strncasecmp (0 call); strpbrk (0 call); strsep (0 call); strspn (0 call); strtod (0 call); strtof (0 call); strtoimax (0 call); strtok (0 call); strtok_r (0 call); strtol (0 call); strtold (0 call); strtoll (0 call); strtoul (0 call); strtoull (0 call); strxfrm (0 call); sync (0 call); sysconf (0 call); syslog (0 call); system (0 call); tcgetattr (0 call); tcsetattr (0 call); time (0 call); times (0 call); tmpfile (0 call); tmpnam (0 call); trunc (0 call); truncf (0 call); truncl (0 call); ttyname (0 call); tzset (0 call); umask (0 call); ungetc (0 call); unlink (0 call); usleep (0 call); utimes (0 call); vfprintf (0 call); vfscanf (0 call); vprintf (0 call); vscanf (0 call); vsnprintf (0 call); vsprintf (0 call); vsyslog (0 call); wait (0 call); waitpid (0 call); wcschr (0 call); wcscmp (0 call); wcscspn (0 call); wcslcat (0 call); wcslcpy (0 call); wcsncmp (0 call); wcspbrk (0 call); wcsrchr (0 call); wcsspn (0 call); wcsstr (0 call); wcstombs (0 call); wctomb (0 call); wmemchr (0 call); wmemcmp (0 call); wmemmove (0 call); write (0 call); 'Extern' global variables (17) ============================== __fc_basename; __fc_dirname; __fc_getpwuid_pw_dir; __fc_getpwuid_pw_name; __fc_getpwuid_pw_passwd; __fc_getpwuid_pw_shell; __fc_hostname; __fc_locale; __fc_locale_names; __fc_mblen_state; __fc_mbtowc_state; __fc_ttyname; __fc_wctomb_state; optarg; opterr; optopt; tzname Potential entry points (1) ========================== main; Global metrics ============== Sloc = 1083 Decision point = 204 Global variables = 70 If = 195 Loop = 43 Goto = 89 Assignment = 438 Exit point = 82 Function = 466 Function call = 89 Pointer dereferencing = 158 Cyclomatic complexity = 286 /* Generated by Frama-C */ #include "__fc_builtin.c" #include "__fc_builtin.h" #include "__fc_define_fd_set_t.h" #include "__fc_gcc_builtins.h" #include "__fc_select.h" #include "alloca.h" #include "assert.c" #include "assert.h" #include "ctype.c" #include "ctype.h" #include "dirent.h" #include "errno.c" #include "errno.h" #include "fcntl.h" #include "fenv.c" #include "fenv.h" #include "getopt.c" #include "getopt.h" #include "glob.c" #include "glob.h" #include "iconv.h" #include "inttypes.c" #include "inttypes.h" #include "libgen.h" #include "locale.c" #include "locale.h" #include "math.c" #include "math.h" #include "netdb.c" #include "netdb.h" #include "netinet/in.h" #include "poll.h" #include "pthread.h" #include "pwd.h" #include "setjmp.h" #include "signal.c" #include "signal.h" #include "stdarg.h" #include "stdint.h" #include "stdio.c" #include "stdio.h" #include "stdlib.c" #include "stdlib.h" #include "string.c" #include "string.h" #include "strings.h" #include "stropts.h" #include "sys/file.h" #include "sys/resource.h" #include "sys/socket.h" #include "sys/stat.h" #include "sys/time.h" #include "sys/times.h" #include "sys/types.h" #include "sys/uio.h" #include "sys/wait.h" #include "syslog.h" #include "termios.h" #include "time.h" #include "unistd.h" #include "wchar.c" #include "wchar.h" void main(void) { /*@ assert __fc_p_fopen ≡ (FILE *)(&__fc_fopen); */ ; /*@ assert __fc_p_opendir ≡ (DIR *)(&__fc_opendir); */ ; /*@ assert __fc_p_time_tm ≡ &__fc_time_tm; */ ; /*@ assert __fc_p_strerror ≡ (char *)__fc_strerror; */ ; return; } [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [metrics] Defined functions (1) ===================== main (0 call); Undefined functions (0) ======================= 'Extern' global variables (0) ============================= Potential entry points (1) ========================== main; Global metrics ============== Sloc = 5 Decision point = 0 Global variables = 0 If = 0 Loop = 0 Goto = 0 Assignment = 0 Exit point = 1 Function = 1 Function call = 0 Pointer dereferencing = 0 Cyclomatic complexity = 1 frama-c-20.0-Calcium/tests/libc/oracle/fc_libc.1.res.oracle0000666000000000000000000075471413571573400020254 0ustar [kernel] Parsing tests/libc/fc_libc.c (with preprocessing) /* Generated by Frama-C */ typedef unsigned int size_t; struct __fc_fenv_t { unsigned short __control_word ; unsigned short __unused1 ; unsigned short __status_word ; unsigned short __unused2 ; unsigned short __tags ; unsigned short __unused3 ; unsigned int __eip ; unsigned short __cs_selector ; unsigned int __opcode : 11 ; unsigned int __unused4 : 5 ; unsigned int __data_offset ; unsigned short __data_selector ; unsigned short __unused5 ; }; typedef struct __fc_fenv_t fenv_t; typedef int wchar_t; typedef int ssize_t; typedef unsigned int gid_t; typedef unsigned int uid_t; typedef long off_t; typedef int pid_t; typedef unsigned int useconds_t; struct option { char const *name ; int has_arg ; int *flag ; int val ; }; struct __fc_glob_t { unsigned int gl_pathc ; char **gl_pathv ; unsigned int gl_offs ; int gl_flags ; void (*gl_closedir)(void *) ; void *(*gl_readdir)(void *) ; void *(*gl_opendir)(char const *) ; int (*gl_lstat)(char const * __restrict , void * __restrict ) ; int (*gl_stat)(char const * __restrict , void * __restrict ) ; }; typedef struct __fc_glob_t glob_t; struct __fc_div_t { int quot ; int rem ; }; typedef struct __fc_div_t div_t; struct __fc_ldiv_t { long quot ; long rem ; }; typedef struct __fc_ldiv_t ldiv_t; struct __fc_lldiv_t { long long quot ; long long rem ; }; typedef struct __fc_lldiv_t lldiv_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned int uintptr_t; typedef long long intmax_t; struct __fc_imaxdiv_t { intmax_t quot ; intmax_t rem ; }; typedef struct __fc_imaxdiv_t imaxdiv_t; struct lconv { char *decimal_point ; char *thousands_sep ; char *grouping ; char *int_curr_symbol ; char *currency_symbol ; char *mon_decimal_point ; char *mon_thousands_sep ; char *mon_grouping ; char *positive_sign ; char *negative_sign ; char int_frac_digits ; char frac_digits ; char p_cs_precedes ; char p_sep_by_space ; char n_cs_precedes ; char n_sep_by_space ; char p_sign_posn ; char n_sign_posn ; char int_p_cs_precedes ; char int_p_sep_by_space ; char int_n_cs_precedes ; char int_n_sep_by_space ; char int_p_sign_posn ; char int_n_sign_posn ; }; union __fc_u_finitef { float f ; unsigned short w[2] ; }; union __fc_u_finite { double d ; unsigned short w[4] ; }; struct __fc_pthread_attr_t { int _fc ; }; typedef struct __fc_pthread_attr_t pthread_attr_t; struct __fc_pthread_cond_t { int _fc ; }; typedef struct __fc_pthread_cond_t pthread_cond_t; struct __fc_pthread_condattr_t { int _fc ; }; typedef struct __fc_pthread_condattr_t pthread_condattr_t; struct __fc_pthread_mutex_t { int _fc ; }; typedef struct __fc_pthread_mutex_t pthread_mutex_t; struct __fc_pthread_mutexattr_t { int _fc ; }; typedef struct __fc_pthread_mutexattr_t pthread_mutexattr_t; struct __fc_pthread_t { int _fc ; }; typedef struct __fc_pthread_t pthread_t; typedef unsigned long sigset_t; union sigval { int sival_int ; void *sival_ptr ; }; struct __fc_siginfo_t { int si_signo ; int si_code ; union sigval si_value ; int si_errno ; pid_t si_pid ; uid_t si_uid ; void *si_addr ; int si_status ; int si_band ; }; typedef struct __fc_siginfo_t siginfo_t; struct sigaction { void (*sa_handler)(int ) ; void (*sa_sigaction)(int , siginfo_t *, void *) ; sigset_t sa_mask ; int sa_flags ; }; typedef unsigned int socklen_t; typedef unsigned short sa_family_t; struct sockaddr { sa_family_t sa_family ; char sa_data[14] ; }; struct iovec { void *iov_base ; size_t iov_len ; }; struct msghdr { void *msg_name ; socklen_t msg_namelen ; struct iovec *msg_iov ; int msg_iovlen ; void *msg_control ; socklen_t msg_controllen ; int msg_flags ; }; struct __fc_sockfds_type { int x ; }; typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr ; }; struct in6_addr { uint8_t s6_addr[16] ; }; enum __fc_ipproto { IPPROTO_IP = 0, IPPROTO_HOPOPTS = 0, IPPROTO_ICMP = 1, IPPROTO_IGMP = 2, IPPROTO_IPIP = 4, IPPROTO_TCP = 6, IPPROTO_EGP = 8, IPPROTO_PUP = 12, IPPROTO_UDP = 17, IPPROTO_IDP = 22, IPPROTO_TP = 29, IPPROTO_DCCP = 33, IPPROTO_IPV6 = 41, IPPROTO_ROUTING = 43, IPPROTO_FRAGMENT = 44, IPPROTO_RSVP = 46, IPPROTO_GRE = 47, IPPROTO_ESP = 50, IPPROTO_AH = 51, IPPROTO_ICMPV6 = 58, IPPROTO_NONE = 59, IPPROTO_DSTOPTS = 60, IPPROTO_MTP = 92, IPPROTO_ENCAP = 98, IPPROTO_PIM = 103, IPPROTO_COMP = 108, IPPROTO_SCTP = 132, IPPROTO_UDPLITE = 136, IPPROTO_RAW = 255, IPPROTO_MAX = 256 }; struct hostent { char *h_name ; char **h_aliases ; int h_addrtype ; int h_length ; char **h_addr_list ; }; struct addrinfo { int ai_flags ; int ai_family ; int ai_socktype ; int ai_protocol ; socklen_t ai_addrlen ; struct sockaddr *ai_addr ; char *ai_canonname ; struct addrinfo *ai_next ; }; struct __fc_gethostbyname { struct hostent host ; unsigned char host_addr[sizeof(struct in_addr)] ; char *h_addr_ptrs[2 + 1] ; char *host_aliases[2] ; char hostbuf[128] ; }; typedef void * const * va_list; typedef unsigned int ino_t; typedef long time_t; typedef unsigned int blkcnt_t; typedef unsigned int blksize_t; typedef unsigned int dev_t; typedef unsigned int mode_t; typedef unsigned int nlink_t; struct stat { dev_t st_dev ; ino_t st_ino ; mode_t st_mode ; nlink_t st_nlink ; uid_t st_uid ; gid_t st_gid ; dev_t st_rdev ; off_t st_size ; time_t st_atime ; time_t st_mtime ; time_t st_ctime ; blksize_t st_blksize ; blkcnt_t st_blocks ; }; struct __fc_pos_t { unsigned long __fc_stdio_position ; }; typedef struct __fc_pos_t fpos_t; struct __fc_FILE { unsigned int __fc_FILE_id ; unsigned int __fc_FILE_data ; }; typedef struct __fc_FILE FILE; typedef unsigned int id_t; typedef int suseconds_t; typedef int clockid_t; typedef unsigned int clock_t; struct tm { int tm_sec ; int tm_min ; int tm_hour ; int tm_mday ; int tm_mon ; int tm_year ; int tm_wday ; int tm_yday ; int tm_isdst ; }; struct timespec { long tv_sec ; long tv_nsec ; }; struct dirent { ino_t d_ino ; off_t d_off ; unsigned short d_reclen ; unsigned char d_type ; char d_name[256] ; }; struct DIR { unsigned int __fc_dir_id ; unsigned int __fc_dir_position ; struct stat *__fc_dir_inode ; struct dirent **__fc_dir_entries ; }; typedef struct DIR DIR; struct __fc_fd_set { long __fc_fd_set[(unsigned int)1024 / ((unsigned int)8 * sizeof(long))] ; }; typedef struct __fc_fd_set fd_set; struct flock { short l_type ; short l_whence ; off_t l_start ; off_t l_len ; pid_t l_pid ; }; struct timeval { time_t tv_sec ; suseconds_t tv_usec ; }; struct timezone { int tz_minuteswest ; int tz_dsttime ; }; struct itimerval { struct timeval it_interval ; struct timeval it_value ; }; typedef void * iconv_t; struct pollfd { int fd ; short events ; short revents ; }; typedef unsigned long nfds_t; struct passwd { char *pw_name ; char *pw_passwd ; uid_t pw_uid ; gid_t pw_gid ; char *pw_gecos ; char *pw_dir ; char *pw_shell ; }; typedef int ( jmp_buf)[5]; struct __fc_sigjmp_buf { jmp_buf buf ; sigset_t sigs ; }; typedef struct __fc_sigjmp_buf sigjmp_buf; struct __fc_code { char const *c_name ; int c_val ; }; typedef struct __fc_code CODE; typedef unsigned long rlim_t; struct rlimit { rlim_t rlim_cur ; rlim_t rlim_max ; }; struct rusage { struct timeval ru_utime ; struct timeval ru_stime ; }; struct tms { clock_t tms_utime ; clock_t tms_stime ; clock_t tms_cutime ; clock_t tms_cstime ; }; typedef unsigned int tcflag_t; typedef unsigned char cc_t; struct termios { tcflag_t c_iflag ; tcflag_t c_oflag ; tcflag_t c_cflag ; tcflag_t c_lflag ; cc_t c_cc[32] ; }; int volatile Frama_C_entropy_source __attribute__((__unused__, __FRAMA_C_MODEL__)); void Frama_C_make_unknown(char *p, size_t l); int Frama_C_nondet(int a, int b); void *Frama_C_nondet_ptr(void *a, void *b); int Frama_C_interval(int min, int max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern int Frama_C_interval_split(int min, int max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern unsigned char Frama_C_unsigned_char_interval(unsigned char min, unsigned char max); char Frama_C_char_interval(char min, char max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern unsigned short Frama_C_unsigned_short_interval(unsigned short min, unsigned short max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern short Frama_C_short_interval(short min, short max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern unsigned int Frama_C_unsigned_int_interval(unsigned int min, unsigned int max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern int Frama_C_int_interval(int min, int max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern unsigned long Frama_C_unsigned_long_interval(unsigned long min, unsigned long max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern long Frama_C_long_interval(long min, long max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern unsigned long long Frama_C_unsigned_long_long_interval(unsigned long long min, unsigned long long max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern long long Frama_C_long_long_interval(long long min, long long max); /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern size_t Frama_C_size_t_interval(size_t min, size_t max); float Frama_C_float_interval(float min, float max); double Frama_C_double_interval(double min, double max); /*@ requires finite: \is_finite(min) ∧ \is_finite(max); requires order: min ≤ max; ensures result_bounded: \is_finite(\result) ∧ \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern double Frama_C_real_interval_as_double(double min, double max); __attribute__((__noreturn__)) void Frama_C_abort(void); /*@ assigns \result; assigns \result \from p; */ extern size_t Frama_C_offset(void const *p); /*@ assigns \result; assigns \result \from i; */ extern long long Frama_C_abstract_cardinal(long long i); /*@ assigns \result; assigns \result \from i; */ extern long long Frama_C_abstract_max(long long i); /*@ assigns \result; assigns \result \from i; */ extern long long Frama_C_abstract_min(long long i); /*@ assigns Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ void Frama_C_update_entropy(void) { Frama_C_entropy_source = Frama_C_entropy_source; return; } /*@ requires valid_p: \valid(p + (0 .. l - 1)); ensures initialization: \initialized(\old(p) + (0 .. \old(l) - 1)); assigns *(p + (0 .. l - 1)), Frama_C_entropy_source; assigns *(p + (0 .. l - 1)) \from Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ void Frama_C_make_unknown(char *p, size_t l) { Frama_C_update_entropy(); { size_t i = (unsigned int)0; while (i < l) { *(p + i) = (char)Frama_C_entropy_source; i += (size_t)1; } } return; } /*@ ensures result_a_or_b: \result ≡ \old(a) ∨ \result ≡ \old(b); assigns \result, Frama_C_entropy_source; assigns \result \from a, b, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ int Frama_C_nondet(int a, int b) { int tmp; Frama_C_update_entropy(); if (Frama_C_entropy_source) tmp = a; else tmp = b; return tmp; } /*@ ensures result_a_or_b: \result ≡ \old(a) ∨ \result ≡ \old(b); assigns \result, Frama_C_entropy_source; assigns \result \from a, b, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ void *Frama_C_nondet_ptr(void *a, void *b) { void *tmp; Frama_C_update_entropy(); if (Frama_C_entropy_source) tmp = a; else tmp = b; return tmp; } /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ int Frama_C_interval(int min, int max) { int r; int aux; Frama_C_update_entropy(); aux = Frama_C_entropy_source; if (aux >= min) if (aux <= max) r = aux; else r = min; else r = min; return r; } /*@ requires order: min ≤ max; ensures result_bounded: \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ char Frama_C_char_interval(char min, char max) { char __retres; int r; char aux; Frama_C_update_entropy(); aux = (char)Frama_C_entropy_source; if ((int)aux >= (int)min) if ((int)aux <= (int)max) r = (int)aux; else r = (int)min; else r = (int)min; __retres = (char)r; return __retres; } /*@ requires finite: \is_finite(min) ∧ \is_finite(max); requires order: min ≤ max; ensures result_bounded: \is_finite(\result) ∧ \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ float Frama_C_float_interval(float min, float max) { float tmp; Frama_C_update_entropy(); if (Frama_C_entropy_source) tmp = min; else tmp = max; return tmp; } /*@ requires finite: \is_finite(min) ∧ \is_finite(max); requires order: min ≤ max; ensures result_bounded: \is_finite(\result) ∧ \old(min) ≤ \result ≤ \old(max); assigns \result, Frama_C_entropy_source; assigns \result \from min, max, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ double Frama_C_double_interval(double min, double max) { double tmp; Frama_C_update_entropy(); if (Frama_C_entropy_source) tmp = min; else tmp = max; return tmp; } extern __attribute__((__noreturn__)) void __builtin_abort(void); /*@ terminates \false; ensures never_terminates: \false; assigns \nothing; */ __attribute__((__noreturn__)) void Frama_C_abort(void); void Frama_C_abort(void) { __builtin_abort(); return; } void __FC_assert(int c, char const *file, int line, char const *expr); /*@ assigns \nothing; */ extern void Frama_C_show_each_warning(); /*@ requires nonnull_c: c ≢ 0; terminates c ≢ 0; assigns \nothing; */ void __FC_assert(int c, char const *file, int line, char const *expr) { if (! c) { Frama_C_show_each_warning("Assertion may fail",file,line,expr); Frama_C_abort(); } return; } int isalnum(int c); int isalpha(int c); int isblank(int c); int iscntrl(int c); int isdigit(int c); int isgraph(int c); int islower(int c); int isprint(int c); int ispunct(int c); int isspace(int c); int isupper(int c); int isxdigit(int c); int tolower(int c); int toupper(int c); /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior match: assumes c_ascii: 0 ≤ c ≤ 127; ensures nonzero_result: \result < 0 ∨ \result > 0; behavior no_match: assumes c_non_ascii: ¬(0 ≤ c ≤ 127); ensures zero_result: \result ≡ 0; complete behaviors no_match, match; disjoint behaviors no_match, match; */ extern int isascii(int c); /*@ requires c_uchar_or_eof_or_EOF: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior definitely_match: assumes c_alnum: ('A' ≤ c ≤ 'Z') ∨ ('a' ≤ c ≤ 'z') ∨ ('0' ≤ c ≤ '9'); ensures nonzero_result: \result < 0 ∨ \result > 0; behavior definitely_not_match: assumes c_non_alnum: c ≡ -1 ∨ (0 ≤ c ≤ 47) ∨ (58 ≤ c ≤ 64) ∨ (91 ≤ c ≤ 96) ∨ (123 ≤ c ≤ 127); ensures zero_result: \result ≡ 0; disjoint behaviors definitely_not_match, definitely_match; */ int isalnum(int c) { int tmp; if (c >= 'A') { if (c <= 'Z') tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (c >= 'a') { if (c <= 'z') tmp = 1; else goto _LAND; } else { _LAND: ; if (c >= '0') if (c <= '9') tmp = 1; else tmp = 0; else tmp = 0; } } return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior definitely_match: assumes c_alpha: ('A' ≤ c ≤ 'Z') ∨ ('a' ≤ c ≤ 'z'); ensures nonzero_result: \result < 0 ∨ \result > 0; behavior definitely_not_match: assumes c_non_alpha: c ≡ -1 ∨ (0 ≤ c ≤ 64) ∨ (91 ≤ c ≤ 96) ∨ (123 ≤ c ≤ 127); ensures zero_result: \result ≡ 0; disjoint behaviors definitely_not_match, definitely_match; */ int isalpha(int c) { int tmp; if (c >= 'A') { if (c <= 'Z') tmp = 1; else goto _LAND; } else { _LAND: ; if (c >= 'a') if (c <= 'z') tmp = 1; else tmp = 0; else tmp = 0; } return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior match: assumes c_tab_or_space: c ≡ ' ' ∨ c ≡ '\t'; ensures nonzero_result: \result < 0 ∨ \result > 0; behavior no_match: assumes c_non_blank: c ≢ ' ' ∧ c ≢ '\t'; ensures zero_result: \result ≡ 0; complete behaviors no_match, match; disjoint behaviors no_match, match; */ int isblank(int c) { int tmp; if (c == ' ') tmp = 1; else if (c == '\t') tmp = 1; else if (c == ' ') tmp = 1; else if (c == '\f') tmp = 1; else if (c == '\n') tmp = 1; else if (c == '\r') tmp = 1; else if (c == '\t') tmp = 1; else if (c == '\v') tmp = 1; else tmp = 0; return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior definitely_match: assumes c_control_char: (0 ≤ c ≤ 31) ∨ c ≡ 127; ensures nonzero_result: \result < 0 ∨ \result > 0; behavior definitely_not_match: assumes c_non_control_char: c ≡ -1 ∨ (32 ≤ c ≤ 126); ensures zero_result: \result ≡ 0; disjoint behaviors definitely_not_match, definitely_match; */ int iscntrl(int c) { int tmp; tmp = Frama_C_nondet(0,1); return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior match: assumes c_digit: '0' ≤ c ≤ '9'; ensures nonzero_result: \result < 0 ∨ \result > 0; behavior no_match: assumes c_non_digit: c < '0' ∨ c > '9'; ensures zero_result: \result ≡ 0; complete behaviors no_match, match; disjoint behaviors no_match, match; */ int isdigit(int c) { int tmp; if (c >= '0') if (c <= '9') tmp = 1; else tmp = 0; else tmp = 0; return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior definitely_match: assumes c_graphical: 33 ≤ c ≤ 126; ensures nonzero_result: \result < 0 ∨ \result > 0; behavior definitely_not_match: assumes c_non_graphical: c ≡ -1 ∨ (0 ≤ c ≤ 32) ∨ c ≡ 127; ensures zero_result: \result ≡ 0; disjoint behaviors definitely_not_match, definitely_match; */ int isgraph(int c) { int tmp; tmp = Frama_C_nondet(0,1); return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior definitely_match: assumes c_lower: 'a' ≤ c ≤ 'z'; ensures nonzero_result: \result < 0 ∨ \result > 0; behavior definitely_not_match: assumes c_non_lower: c ≡ -1 ∨ (0 ≤ c < 'a') ∨ ('z' < c < 127); ensures zero_result: \result ≡ 0; disjoint behaviors definitely_not_match, definitely_match; */ int islower(int c) { int tmp; if (c >= 'a') if (c <= 'z') tmp = 1; else tmp = 0; else tmp = 0; return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior definitely_match: assumes c_printable: 32 ≤ c ≤ 126; ensures nonzero_result: \result < 0 ∨ \result > 0; behavior definitely_not_match: assumes c_non_printable: c ≡ -1 ∨ (0 ≤ c ≤ 31) ∨ c ≡ 127; ensures zero_result: \result ≡ 0; disjoint behaviors definitely_not_match, definitely_match; */ int isprint(int c) { int tmp; tmp = Frama_C_nondet(0,1); return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior definitely_match: assumes c_punct: (33 ≤ c ≤ 47) ∨ (58 ≤ c ≤ 64) ∨ (91 ≤ c ≤ 96) ∨ (123 ≤ c ≤ 126); ensures nonzero_result: \result < 0 ∨ \result > 0; behavior definitely_not_match: assumes c_non_punct: c ≡ -1 ∨ (0 ≤ c ≤ 32) ∨ (48 ≤ c ≤ 57) ∨ (65 ≤ c ≤ 90) ∨ (97 ≤ c ≤ 122) ∨ c ≡ 127; ensures zero_result: \result ≡ 0; disjoint behaviors definitely_not_match, definitely_match; */ int ispunct(int c) { int tmp; tmp = Frama_C_nondet(0,1); return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior definitely_match: assumes c_space: (9 ≤ c ≤ 13) ∨ c ≡ ' '; ensures nonzero_result: \result < 0 ∨ \result > 0; behavior definitely_not_match: assumes c_non_space: c ≡ -1 ∨ (0 ≤ c ≤ 8) ∨ (14 ≤ c < ' ') ∨ (' ' < c ≤ 127); ensures zero_result: \result ≡ 0; disjoint behaviors definitely_not_match, definitely_match; */ int isspace(int c) { int tmp; if (c == ' ') tmp = 1; else if (c == '\f') tmp = 1; else if (c == '\n') tmp = 1; else if (c == '\r') tmp = 1; else if (c == '\t') tmp = 1; else if (c == '\v') tmp = 1; else tmp = 0; return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior definitely_match: assumes c_upper: 'A' ≤ c ≤ 'Z'; ensures nonzero_result: \result < 0 ∨ \result > 0; behavior definitely_not_match: assumes c_non_upper: c ≡ -1 ∨ (0 ≤ c < 'A') ∨ ('Z' < c ≤ 127); ensures zero_result: \result ≡ 0; disjoint behaviors definitely_not_match, definitely_match; */ int isupper(int c) { int tmp; if (c >= 'A') if (c <= 'Z') tmp = 1; else tmp = 0; else tmp = 0; return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; assigns \result; assigns \result \from c; behavior match: assumes c_hexa_digit: ('0' ≤ c ≤ '9') ∨ ('A' ≤ c ≤ 'F') ∨ ('a' ≤ c ≤ 'f'); ensures nonzero_result: \result < 0 ∨ \result > 0; behavior no_match: assumes c_non_hexa_digit: ¬(('0' ≤ c ≤ '9') ∨ ('A' ≤ c ≤ 'F') ∨ ('a' ≤ c ≤ 'f')); ensures zero_result: \result ≡ 0; complete behaviors no_match, match; disjoint behaviors no_match, match; */ int isxdigit(int c) { int tmp; if (c >= '0') { if (c <= '9') tmp = 1; else goto _LAND_0; } else { _LAND_0: ; if (c >= 'a') { if (c <= 'f') tmp = 1; else goto _LAND; } else { _LAND: ; if (c >= 'A') if (c <= 'F') tmp = 1; else tmp = 0; else tmp = 0; } } return tmp; } /*@ requires c_uchar_or_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; ensures result_uchar_of_eof: (0 ≤ \result ≤ 255) ∨ \result ≡ -1; assigns \result; assigns \result \from c; behavior definitely_changed: assumes c_ascii_upper: 'A' ≤ c ≤ 'Z'; ensures result_ascii_lower: \result ≡ \old(c) + 32; behavior definitely_not_changed: assumes c_ascii_but_non_upper: c ≡ -1 ∨ (0 ≤ c < 'A') ∨ ('Z' < c ≤ 127); ensures result_unchanged: \result ≡ \old(c); disjoint behaviors definitely_not_changed, definitely_changed; */ int tolower(int c) { int __retres; if (c >= 'A') if (c <= 'Z') { __retres = c + 0x20; goto return_label; } __retres = c; return_label: return __retres; } /*@ requires c_uchar_of_eof: (0 ≤ c ≤ 255) ∨ c ≡ -1; ensures result_uchar_of_eof: (0 ≤ \result ≤ 255) ∨ \result ≡ -1; assigns \result; assigns \result \from c; behavior definitely_changed: assumes c_ascii_lower: 'a' ≤ c ≤ 'z'; ensures result_ascii_upper: \result ≡ \old(c) - 32; behavior definitely_not_changed: assumes c_ascii_but_non_lower: c ≡ -1 ∨ (0 ≤ c < 'a') ∨ ('z' < c ≤ 127); ensures result_unchanged: \result ≡ \old(c); disjoint behaviors definitely_not_changed, definitely_changed; */ int toupper(int c) { int __retres; if (c >= 'a') if (c <= 'z') { __retres = c - 0x20; goto return_label; } __retres = c; return_label: return __retres; } int __fc_errno; int __fc_errno = 0; int fetestexcept(int excepts); int feholdexcept(fenv_t *envp); int fesetenv(fenv_t const *envp); static int volatile fetestexcept___fc_random_fetestexcept __attribute__(( __FRAMA_C_MODEL__)); int fetestexcept(int excepts) { int __retres; __retres = 0x00FF & fetestexcept___fc_random_fetestexcept; return __retres; } fenv_t volatile __fc_fenv_state __attribute__((__FRAMA_C_MODEL__)); int feholdexcept(fenv_t *envp) { int __retres; *envp = __fc_fenv_state; __retres = 0; return __retres; } int fesetenv(fenv_t const *envp) { int __retres; __fc_fenv_state = *envp; __retres = 0; return __retres; } /*@ axiomatic MemCmp { logic ℤ memcmp{L1, L2}(char *s1, char *s2, ℤ n) reads \at(*(s1 + (0 .. n - 1)),L1), \at(*(s2 + (0 .. n - 1)),L2); axiom memcmp_zero{L1, L2}: ∀ char *s1, char *s2; ∀ ℤ n; memcmp{L1, L2}(s1, s2, n) ≡ 0 ⇔ (∀ ℤ i; 0 ≤ i < n ⇒ \at(*(s1 + i),L1) ≡ \at(*(s2 + i),L2)); } */ /*@ axiomatic MemChr { logic 𝔹 memchr{L}(char *s, ℤ c, ℤ n) reads *(s + (0 .. n - 1)); logic ℤ memchr_off{L}(char *s, ℤ c, ℤ n) reads *(s + (0 .. n - 1)); axiom memchr_def{L}: ∀ char *s; ∀ ℤ c; ∀ ℤ n; memchr(s, c, n) ≡ \true ⇔ (∃ int i; 0 ≤ i < n ∧ *(s + i) ≡ c); } */ /*@ axiomatic MemSet { logic 𝔹 memset{L}(char *s, ℤ c, ℤ n) reads *(s + (0 .. n - 1)); axiom memset_def{L}: ∀ char *s; ∀ ℤ c; ∀ ℤ n; memset(s, c, n) ≡ \true ⇔ (∀ ℤ i; 0 ≤ i < n ⇒ *(s + i) ≡ c); } */ /*@ axiomatic StrLen { logic ℤ strlen{L}(char *s) reads *(s + (0 ..)); axiom strlen_pos_or_null{L}: ∀ char *s; ∀ ℤ i; 0 ≤ i ∧ (∀ ℤ j; 0 ≤ j < i ⇒ *(s + j) ≢ '\000') ∧ *(s + i) ≡ '\000' ⇒ strlen(s) ≡ i; axiom strlen_neg{L}: ∀ char *s; (∀ ℤ i; 0 ≤ i ⇒ *(s + i) ≢ '\000') ⇒ strlen(s) < 0; axiom strlen_before_null{L}: ∀ char *s; ∀ ℤ i; 0 ≤ i < strlen(s) ⇒ *(s + i) ≢ '\000'; axiom strlen_at_null{L}: ∀ char *s; 0 ≤ strlen(s) ⇒ *(s + strlen(s)) ≡ '\000'; axiom strlen_not_zero{L}: ∀ char *s; ∀ ℤ i; 0 ≤ i ≤ strlen(s) ∧ *(s + i) ≢ '\000' ⇒ i < strlen(s); axiom strlen_zero{L}: ∀ char *s; ∀ ℤ i; 0 ≤ i ≤ strlen(s) ∧ *(s + i) ≡ '\000' ⇒ i ≡ strlen(s); axiom strlen_sup{L}: ∀ char *s; ∀ ℤ i; 0 ≤ i ∧ *(s + i) ≡ '\000' ⇒ 0 ≤ strlen(s) ≤ i; axiom strlen_shift{L}: ∀ char *s; ∀ ℤ i; 0 ≤ i ≤ strlen(s) ⇒ strlen(s + i) ≡ strlen(s) - i; axiom strlen_create{L}: ∀ char *s; ∀ ℤ i; 0 ≤ i ∧ *(s + i) ≡ '\000' ⇒ 0 ≤ strlen(s) ≤ i; axiom strlen_create_shift{L}: ∀ char *s; ∀ ℤ i; ∀ ℤ k; 0 ≤ k ≤ i ∧ *(s + i) ≡ '\000' ⇒ 0 ≤ strlen(s + k) ≤ i - k; axiom memcmp_strlen_left{L}: ∀ char *s1, char *s2; ∀ ℤ n; memcmp{L, L}(s1, s2, n) ≡ 0 ∧ strlen(s1) < n ⇒ strlen(s1) ≡ strlen(s2); axiom memcmp_strlen_right{L}: ∀ char *s1, char *s2; ∀ ℤ n; memcmp{L, L}(s1, s2, n) ≡ 0 ∧ strlen(s2) < n ⇒ strlen(s1) ≡ strlen(s2); axiom memcmp_strlen_shift_left{L}: ∀ char *s1, char *s2; ∀ ℤ k, ℤ n; memcmp{L, L}(s1, s2 + k, n) ≡ 0 ≤ k ∧ strlen(s1) < n ⇒ 0 ≤ strlen(s2) ≤ k + strlen(s1); axiom memcmp_strlen_shift_right{L}: ∀ char *s1, char *s2; ∀ ℤ k, ℤ n; memcmp{L, L}(s1 + k, s2, n) ≡ 0 ≤ k ∧ strlen(s2) < n ⇒ 0 ≤ strlen(s1) ≤ k + strlen(s2); } */ /*@ axiomatic StrCmp { logic ℤ strcmp{L}(char *s1, char *s2) reads *(s1 + (0 .. strlen(s1))), *(s2 + (0 .. strlen(s2))); axiom strcmp_zero{L}: ∀ char *s1, char *s2; strcmp(s1, s2) ≡ 0 ⇔ strlen(s1) ≡ strlen(s2) ∧ (∀ ℤ i; 0 ≤ i ≤ strlen(s1) ⇒ *(s1 + i) ≡ *(s2 + i)); } */ /*@ axiomatic StrNCmp { logic ℤ strncmp{L}(char *s1, char *s2, ℤ n) reads *(s1 + (0 .. n - 1)), *(s2 + (0 .. n - 1)); axiom strncmp_zero{L}: ∀ char *s1, char *s2; ∀ ℤ n; strncmp(s1, s2, n) ≡ 0 ⇔ (strlen(s1) < n ∧ strcmp(s1, s2) ≡ 0) ∨ (∀ ℤ i; 0 ≤ i < n ⇒ *(s1 + i) ≡ *(s2 + i)); } */ /*@ axiomatic StrChr { logic 𝔹 strchr{L}(char *s, ℤ c) reads *(s + (0 .. strlen(s))); axiom strchr_def{L}: ∀ char *s; ∀ ℤ c; strchr(s, c) ≡ \true ⇔ (∃ ℤ i; 0 ≤ i ≤ strlen(s) ∧ *(s + i) ≡ (char)c); } */ /*@ axiomatic WMemChr { logic 𝔹 wmemchr{L}(wchar_t *s, wchar_t c, ℤ n) reads *(s + (0 .. n - 1)); logic ℤ wmemchr_off{L}(wchar_t *s, wchar_t c, ℤ n) reads *(s + (0 .. n - 1)); axiom wmemchr_def{L}: ∀ wchar_t *s; ∀ int c; ∀ ℤ n; wmemchr(s, c, n) ≡ \true ⇔ (∃ int i; 0 ≤ i < n ∧ *(s + i) ≡ c); } */ /*@ axiomatic WcsLen { logic ℤ wcslen{L}(wchar_t *s) reads *(s + (0 ..)); axiom wcslen_pos_or_null{L}: ∀ wchar_t *s; ∀ ℤ i; 0 ≤ i ∧ (∀ ℤ j; 0 ≤ j < i ⇒ *(s + j) ≢ 0) ∧ *(s + i) ≡ 0 ⇒ wcslen(s) ≡ i; axiom wcslen_neg{L}: ∀ wchar_t *s; (∀ ℤ i; 0 ≤ i ⇒ *(s + i) ≢ 0) ⇒ wcslen(s) < 0; axiom wcslen_before_null{L}: ∀ wchar_t *s; ∀ int i; 0 ≤ i < wcslen(s) ⇒ *(s + i) ≢ 0; axiom wcslen_at_null{L}: ∀ wchar_t *s; 0 ≤ wcslen(s) ⇒ *(s + wcslen(s)) ≡ 0; axiom wcslen_not_zero{L}: ∀ wchar_t *s; ∀ int i; 0 ≤ i ≤ wcslen(s) ∧ *(s + i) ≢ 0 ⇒ i < wcslen(s); axiom wcslen_zero{L}: ∀ wchar_t *s; ∀ int i; 0 ≤ i ≤ wcslen(s) ∧ *(s + i) ≡ 0 ⇒ i ≡ wcslen(s); axiom wcslen_sup{L}: ∀ wchar_t *s; ∀ int i; 0 ≤ i ∧ *(s + i) ≡ 0 ⇒ 0 ≤ wcslen(s) ≤ i; axiom wcslen_shift{L}: ∀ wchar_t *s; ∀ int i; 0 ≤ i ≤ wcslen(s) ⇒ wcslen(s + i) ≡ wcslen(s) - i; axiom wcslen_create{L}: ∀ wchar_t *s; ∀ int i; 0 ≤ i ∧ *(s + i) ≡ 0 ⇒ 0 ≤ wcslen(s) ≤ i; axiom wcslen_create_shift{L}: ∀ wchar_t *s; ∀ int i; ∀ int k; 0 ≤ k ≤ i ∧ *(s + i) ≡ 0 ⇒ 0 ≤ wcslen(s + k) ≤ i - k; } */ /*@ axiomatic WcsCmp { logic ℤ wcscmp{L}(wchar_t *s1, wchar_t *s2) reads *(s1 + (0 .. wcslen(s1))), *(s2 + (0 .. wcslen(s2))); axiom wcscmp_zero{L}: ∀ wchar_t *s1, wchar_t *s2; wcscmp(s1, s2) ≡ 0 ⇔ wcslen(s1) ≡ wcslen(s2) ∧ (∀ ℤ i; 0 ≤ i ≤ wcslen(s1) ⇒ *(s1 + i) ≡ *(s2 + i)); } */ /*@ axiomatic WcsNCmp { logic ℤ wcsncmp{L}(wchar_t *s1, wchar_t *s2, ℤ n) reads *(s1 + (0 .. n - 1)), *(s2 + (0 .. n - 1)); axiom wcsncmp_zero{L}: ∀ wchar_t *s1, wchar_t *s2; ∀ ℤ n; wcsncmp(s1, s2, n) ≡ 0 ⇔ (wcslen(s1) < n ∧ wcscmp(s1, s2) ≡ 0) ∨ (∀ ℤ i; 0 ≤ i < n ⇒ *(s1 + i) ≡ *(s2 + i)); } */ /*@ axiomatic WcsChr { logic 𝔹 wcschr{L}(wchar_t *wcs, ℤ wc) reads *(wcs + (0 .. wcslen(wcs))); axiom wcschr_def{L}: ∀ wchar_t *wcs; ∀ ℤ wc; wcschr(wcs, wc) ≡ \true ⇔ (∃ ℤ i; 0 ≤ i ≤ wcslen(wcs) ∧ *(wcs + i) ≡ (int)wc); } */ /*@ logic ℤ minimum(ℤ i, ℤ j) = i < j? i: j; */ /*@ logic ℤ maximum(ℤ i, ℤ j) = i < j? j: i; */ /*@ predicate valid_string{L}(char *s) = 0 ≤ strlen(s) ∧ \valid(s + (0 .. strlen(s))); */ /*@ predicate valid_read_string{L}(char *s) = 0 ≤ strlen(s) ∧ \valid_read(s + (0 .. strlen(s))); */ /*@ predicate valid_read_nstring{L}(char *s, ℤ n) = (\valid_read(s + (0 .. n - 1)) ∧ \initialized(s + (0 .. n - 1))) ∨ valid_read_string(s); */ /*@ predicate valid_string_or_null{L}(char *s) = s ≡ \null ∨ valid_string(s); */ /*@ predicate valid_wstring{L}(wchar_t *s) = 0 ≤ wcslen(s) ∧ \valid(s + (0 .. wcslen(s))); */ /*@ predicate valid_read_wstring{L}(wchar_t *s) = 0 ≤ wcslen(s) ∧ \valid_read(s + (0 .. wcslen(s))); */ /*@ predicate valid_read_nwstring{L}(wchar_t *s, ℤ n) = (\valid_read(s + (0 .. n - 1)) ∧ \initialized(s + (0 .. n - 1))) ∨ valid_read_wstring(s); */ /*@ predicate valid_wstring_or_null{L}(wchar_t *s) = s ≡ \null ∨ valid_wstring(s); */ /*@ ghost int __fc_fds[1024]; */ /*@ requires valid_string_path: valid_read_string(path); requires valid_amode: (amode & ~((4 | 2) | 1)) ≡ 0 ∨ amode ≡ 0; ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: path), (indirect: *(path + (0 ..))), (indirect: amode); */ extern int access(char const *path, int amode); /*@ requires valid_string_path: valid_read_string(path); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: path), (indirect: *(path + (0 ..))); */ extern int chdir(char const *path); /*@ requires valid_string_path: valid_read_string(path); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: path), (indirect: *(path + (0 ..))); */ extern int chroot(char const *path); /*@ requires valid_string_path: valid_read_string(path); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: path), (indirect: *(path + (0 ..))), (indirect: owner), (indirect: group); */ extern int chown(char const *path, uid_t owner, gid_t group); /*@ requires valid_fd: 0 ≤ fd < 1024; ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns __fc_fds[fd], \result; assigns __fc_fds[fd] \from fd, __fc_fds[fd]; assigns \result \from (indirect: fd), (indirect: __fc_fds[fd]); */ extern int close(int fd); /*@ requires valid_fildes: 0 ≤ fildes < 1024; ensures result_valid_fildes_or_error: \result ≡ -1 ∨ (\old(fildes) ≤ \result < 1024); assigns __fc_fds[fildes ..], \result; assigns __fc_fds[fildes ..] \from fildes; assigns \result \from fildes; */ extern int dup(int fildes); /*@ requires valid_fildes: 0 ≤ fildes < 1024; requires valid_fildes2: 0 ≤ fildes2 < 1024; ensures result_fildes2_or_error: \result ≡ \old(fildes2) ∨ \result ≡ -1; assigns __fc_fds[fildes2], \result; assigns __fc_fds[fildes2] \from fildes, fildes2, __fc_fds[fildes2]; assigns \result \from fildes, fildes2, __fc_fds[fildes], __fc_fds[fildes2]; */ extern int dup2(int fildes, int fildes2); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_arg: valid_read_string(arg); assigns \result; assigns \result \from *(path + (0 ..)), *(arg + (0 ..)); */ extern int execl(char const *path, char const *arg, void * const *__va_params); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_arg: valid_read_string(arg); assigns \result; assigns \result \from *(path + (0 ..)), *(arg + (0 ..)); */ extern int execle(char const *path, char const *arg, void * const *__va_params); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_arg: valid_read_string(arg); assigns \result; assigns \result \from *(path + (0 ..)), *(arg + (0 ..)); */ extern int execlp(char const *path, char const *arg, void * const *__va_params); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_argv0: valid_read_string(*(argv + 0)); assigns \result; assigns \result \from *(path + (0 ..)), *(argv + (0 ..)); */ extern int execv(char const *path, char * const *argv); /*@ requires valid_path: valid_read_string(path); requires valid_argv0: valid_read_string(*(argv + 0)); assigns \result; assigns \result \from *(path + (0 ..)), *(argv + (0 ..)); */ extern int execve(char const *path, char * const *argv, char * const *env); /*@ requires valid_string_path: valid_read_string(path); requires valid_string_argv0: valid_read_string(*(argv + 0)); assigns \result; assigns \result \from *(path + (0 ..)), *(argv + (0 ..)); */ extern int execvp(char const *path, char * const *argv); /*@ ensures never_terminates: \false; assigns \nothing; */ extern __attribute__((__noreturn__)) void _exit(int); /*@ ensures result_ok_child_or_error: \result ≡ 0 ∨ \result > 0 ∨ \result ≡ -1; assigns \result; assigns \result \from \nothing; */ extern pid_t fork(void); /*@ requires valid_buf: \valid(buf + (0 .. size - 1)); ensures result_ok_or_error: \result ≡ \null ∨ \result ≡ \old(buf); assigns *(buf + (0 .. size - 1)), \result; assigns *(buf + (0 .. size - 1)) \from (indirect: buf), (indirect: size); assigns \result \from buf, (indirect: size); */ extern char *getcwd(char *buf, size_t size); /*@ assigns \result; assigns \result \from \nothing; */ extern gid_t getegid(void); /*@ assigns \result; assigns \result \from \nothing; */ extern uid_t geteuid(void); /*@ assigns \result; assigns \result \from \nothing; */ extern gid_t getgid(void); extern char volatile __fc_hostname[64]; /*@ requires name_has_room: \valid(name + (0 .. len - 1)); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result, *(name + (0 .. len - 1)); assigns \result \from (indirect: __fc_hostname[0 .. len]), (indirect: len); assigns *(name + (0 .. len - 1)) \from (indirect: __fc_hostname[0 .. len]), (indirect: len); */ extern int gethostname(char *name, size_t len); /*@ requires name_valid_string: valid_read_nstring(name, len); requires bounded_len: len ≤ 64; ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns __fc_hostname[0 .. len], \result; assigns __fc_hostname[0 .. len] \from *(name + (0 .. len - 1)), (indirect: len); assigns \result \from (indirect: __fc_hostname[0 .. len]); */ extern int sethostname(char const *name, size_t len); /*@ assigns \result; assigns \result \from (indirect: pid); */ extern pid_t getpgid(pid_t pid); /*@ assigns \result; assigns \result \from \nothing; */ extern pid_t getpgrp(void); /*@ assigns \result; assigns \result \from \nothing; */ extern pid_t getpid(void); /*@ assigns \result; assigns \result \from \nothing; */ extern pid_t getppid(void); /*@ assigns \result; assigns \result \from \nothing; */ extern pid_t getsid(pid_t); /*@ assigns \result; assigns \result \from \nothing; */ extern uid_t getuid(void); /*@ ensures result_true_or_false: \result ≡ 0 ∨ \result ≡ 1; assigns \result; assigns \result \from (indirect: fd), (indirect: __fc_fds[fd]); */ extern int isatty(int fd); /*@ requires valid_fd: 0 ≤ fd < 1024; requires valid_whence: whence ≡ 0 ∨ whence ≡ 1 ∨ whence ≡ 2; ensures result_error_or_offset: \result ≡ -1 ∨ 0 ≤ \result; assigns \result, __fc_fds[fd]; assigns \result \from (indirect: fd), (indirect: __fc_fds[fd]), (indirect: offset), (indirect: whence); assigns __fc_fds[fd] \from (indirect: fd), __fc_fds[fd], (indirect: offset), (indirect: whence); */ extern off_t lseek(int fd, off_t offset, int whence); /*@ requires valid_path: valid_read_string(path); assigns \result; assigns \result \from (indirect: *(path + (0 ..))), (indirect: name); */ extern long pathconf(char const *path, int name); /*@ requires valid_pipefd: \valid(pipefd + (0 .. 1)); ensures initialization: pipefd: \initialized(\old(pipefd) + (0 .. 1)); ensures valid_fd0: 0 ≤ *(\old(pipefd) + 0) < 1024; ensures valid_fd1: 0 ≤ *(\old(pipefd) + 1) < 1024; ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *(pipefd + (0 .. 1)), \result; assigns *(pipefd + (0 .. 1)) \from (indirect: __fc_fds[0 ..]); assigns \result \from (indirect: __fc_fds[0 ..]); */ extern int pipe(int * /*[2]*/ pipefd); /*@ requires valid_fd: 0 ≤ fd < 1024; requires buf_has_room: \valid((char *)buf + (0 .. count - 1)); ensures result_error_or_read_length: (0 ≤ \result ≤ \old(count)) ∨ \result ≡ -1; ensures initialization: buf: \initialized((char *)\old(buf) + (0 .. \result - 1)); assigns __fc_fds[fd], \result, *((char *)buf + (0 .. count - 1)); assigns __fc_fds[fd] \from __fc_fds[fd]; assigns \result \from (indirect: __fc_fds[fd]), (indirect: count); assigns *((char *)buf + (0 .. count - 1)) \from (indirect: __fc_fds[fd]), (indirect: count); */ extern ssize_t read(int fd, void *buf, size_t count); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: gid); */ extern int setegid(gid_t gid); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: uid); */ extern int seteuid(uid_t uid); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: gid); */ extern int setgid(gid_t gid); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: pid), (indirect: pgid); */ extern int setpgid(pid_t pid, pid_t pgid); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: rgid), (indirect: egid); */ extern int setregid(gid_t rgid, gid_t egid); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: ruid), (indirect: euid); */ extern int setreuid(uid_t ruid, uid_t euid); /*@ ensures result_pgid_or_error: \result ≡ -1 ∨ \result ≥ 0; assigns \result; assigns \result \from \nothing; */ extern pid_t setsid(void); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: uid); */ extern int setuid(uid_t uid); /*@ assigns \nothing; */ extern void sync(void); /*@ assigns \result; assigns \result \from (indirect: name); */ extern long sysconf(int name); extern char volatile __fc_ttyname[32]; char volatile *__fc_p_ttyname = __fc_ttyname; /*@ requires valid_fildes: 0 ≤ fildes < 1024; ensures result_name_or_null: \result ≡ __fc_p_ttyname ∨ \result ≡ \null; assigns \result; assigns \result \from __fc_p_ttyname, (indirect: fildes); */ extern char *ttyname(int fildes); /*@ requires valid_string_path: valid_read_string(path); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from *(path + (0 ..)); */ extern int unlink(char const *path); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result, Frama_C_entropy_source; assigns \result \from (indirect: usec), (indirect: Frama_C_entropy_source); assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern int usleep(useconds_t usec); /*@ requires valid_fd: 0 ≤ fd < 1024; requires buf_has_room: \valid_read((char *)buf + (0 .. count - 1)); ensures result_error_or_written_bytes: \result ≡ -1 ∨ (0 ≤ \result ≤ \old(count)); assigns __fc_fds[fd], \result; assigns __fc_fds[fd] \from (indirect: fd), (indirect: count), __fc_fds[fd]; assigns \result \from (indirect: fd), (indirect: count), (indirect: __fc_fds[fd]); */ extern ssize_t write(int fd, void const *buf, size_t count); /*@ requires valid_ruid: \valid(ruid); requires valid_euid: \valid(suid); requires valid_suid: \valid(euid); ensures initialization: result_ok_or_error: (\result ≡ 0 ∧ \initialized(\old(ruid)) ∧ \initialized(\old(euid)) ∧ \initialized(\old(suid))) ∨ \result ≡ -1; assigns *ruid, *euid, *suid, \result; assigns *ruid \from \nothing; assigns *euid \from \nothing; assigns *suid \from \nothing; assigns \result \from (indirect: ruid), (indirect: euid), (indirect: suid); */ int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: ruid), (indirect: euid), (indirect: suid); */ int setresuid(uid_t ruid, uid_t euid, uid_t suid); /*@ requires valid_rgid: \valid(rgid); requires valid_egid: \valid(sgid); requires valid_sgid: \valid(egid); ensures initialization: result_ok_or_error: (\result ≡ 0 ∧ \initialized(\old(rgid)) ∧ \initialized(\old(egid)) ∧ \initialized(\old(sgid))) ∨ \result ≡ -1; assigns *rgid, *egid, *sgid, \result; assigns *rgid \from \nothing; assigns *egid \from \nothing; assigns *sgid \from \nothing; assigns \result \from (indirect: rgid), (indirect: egid), (indirect: sgid); */ int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: rgid), (indirect: egid), (indirect: sgid); */ int setresgid(gid_t rgid, gid_t egid, gid_t sgid); extern char *optarg; int optind; extern int opterr; extern int optopt; /*@ assigns \result, *optarg, optind, opterr, optopt; assigns \result \from argc, *(argv + (0 .. argc - 1)), *(optstring + (0 ..)); assigns *optarg \from argc, *(argv + (0 .. argc - 1)), *(optstring + (0 ..)); assigns optind \from argc, *(argv + (0 .. argc - 1)), *(optstring + (0 ..)); assigns opterr \from argc, *(argv + (0 .. argc - 1)), *(optstring + (0 ..)); assigns optopt \from argc, *(argv + (0 .. argc - 1)), *(optstring + (0 ..)); */ extern int getopt(int argc, char * const *argv, char const *optstring); /*@ assigns \result, *optarg, optind, opterr, optopt, *((longopts + (0 ..))->flag); assigns \result \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns *optarg \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns optind \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns opterr \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns optopt \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns *((longopts + (0 ..))->flag) \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); */ extern int getopt_long(int argc, char * const *argv, char const *shortopts, struct option const *longopts, int *longind); /*@ assigns \result, *optarg, optind, opterr, optopt, *((longopts + (0 ..))->flag); assigns \result \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns *optarg \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns optind \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns opterr \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns optopt \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); assigns *((longopts + (0 ..))->flag) \from argc, *(argv + (0 .. argc - 1)), *(shortopts + (0 ..)), *(longopts + (0 ..)); */ extern int getopt_long_only(int argc, char * const *argv, char const *shortopts, struct option const *longopts, int *longind); int optind = 1; int glob(char const *pattern, int flags, int (*errfunc)(char const *epath, int eerrno), glob_t *pglob); void globfree(glob_t *pglob); /*@ ghost extern int __fc_heap_status __attribute__((__FRAMA_C_MODEL__)); */ /*@ axiomatic dynamic_allocation { predicate is_allocable{L}(ℤ n) reads __fc_heap_status; axiom never_allocable{L}: ∀ ℤ i; i < 0 ∨ i > 4294967295U ⇒ ¬is_allocable(i); } */ /*@ requires valid_nptr: \valid_read(nptr); assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); */ extern double atof(char const *nptr); int atoi(char const *p); /*@ requires valid_nptr: \valid_read(nptr); assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); */ extern long atol(char const *nptr); /*@ requires valid_nptr: \valid_read(nptr); assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); */ extern long long atoll(char const *nptr); /*@ requires valid_nptr: \valid_read(nptr); requires separation: \separated(nptr, endptr); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr); behavior no_storage: assumes null_endptr: endptr ≡ \null; assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); behavior store_position: assumes nonnull_endptr: endptr ≢ \null; requires valid_endptr: \valid(endptr); ensures initialization: \initialized(\old(endptr)); ensures valid_endptr: \valid_read(\old(endptr)); ensures position_subset: \subset(*\old(endptr), \old(nptr) + (0 ..)); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr); complete behaviors store_position, no_storage; disjoint behaviors store_position, no_storage; */ extern double strtod(char const * __restrict nptr, char ** __restrict endptr); /*@ requires valid_nptr: \valid_read(nptr); requires separation: \separated(nptr, endptr); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr); behavior no_storage: assumes null_endptr: endptr ≡ \null; assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); behavior store_position: assumes nonnull_endptr: endptr ≢ \null; requires valid_endptr: \valid(endptr); ensures initialization: \initialized(\old(endptr)); ensures valid_endptr: \valid_read(\old(endptr)); ensures position_subset: \subset(*\old(endptr), \old(nptr) + (0 ..)); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr); complete behaviors store_position, no_storage; disjoint behaviors store_position, no_storage; */ extern float strtof(char const * __restrict nptr, char ** __restrict endptr); /*@ requires valid_nptr: \valid_read(nptr); requires separation: \separated(nptr, endptr); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr); behavior no_storage: assumes null_endptr: endptr ≡ \null; assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); behavior store_position: assumes nonnull_endptr: endptr ≢ \null; requires valid_endptr: \valid(endptr); ensures initialization: \initialized(\old(endptr)); ensures valid_endptr: \valid_read(\old(endptr)); ensures position_subset: \subset(*\old(endptr), \old(nptr) + (0 ..)); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr); complete behaviors store_position, no_storage; disjoint behaviors store_position, no_storage; */ extern long double strtold(char const * __restrict nptr, char ** __restrict endptr); /*@ requires valid_nptr: \valid_read(nptr); requires separation: \separated(nptr, endptr); requires base_range: base ≡ 0 ∨ (2 ≤ base ≤ 36); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr), (indirect: base); behavior no_storage: assumes null_endptr: endptr ≡ \null; assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); behavior store_position: assumes nonnull_endptr: endptr ≢ \null; requires valid_endptr: \valid(endptr); ensures initialization: \initialized(\old(endptr)); ensures valid_endptr: \valid_read(\old(endptr)); ensures position_subset: \subset(*\old(endptr), \old(nptr) + (0 ..)); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr), (indirect: base); complete behaviors store_position, no_storage; disjoint behaviors store_position, no_storage; */ extern long strtol(char const * __restrict nptr, char ** __restrict endptr, int base); /*@ requires valid_nptr: \valid_read(nptr); requires separation: \separated(nptr, endptr); requires base_range: base ≡ 0 ∨ (2 ≤ base ≤ 36); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr), (indirect: base); behavior no_storage: assumes null_endptr: endptr ≡ \null; assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); behavior store_position: assumes nonnull_endptr: endptr ≢ \null; requires valid_endptr: \valid(endptr); ensures initialization: \initialized(\old(endptr)); ensures valid_endptr: \valid_read(\old(endptr)); ensures position_subset: \subset(*\old(endptr), \old(nptr) + (0 ..)); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr), (indirect: base); complete behaviors store_position, no_storage; disjoint behaviors store_position, no_storage; */ extern long long strtoll(char const * __restrict nptr, char ** __restrict endptr, int base); /*@ requires valid_nptr: \valid_read(nptr); requires separation: \separated(nptr, endptr); requires base_range: base ≡ 0 ∨ (2 ≤ base ≤ 36); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr), (indirect: base); behavior no_storage: assumes null_endptr: endptr ≡ \null; assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); behavior store_position: assumes nonnull_endptr: endptr ≢ \null; requires valid_endptr: \valid(endptr); ensures initialization: \initialized(\old(endptr)); ensures valid_endptr: \valid_read(\old(endptr)); ensures position_subset: \subset(*\old(endptr), \old(nptr) + (0 ..)); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr), (indirect: base); complete behaviors store_position, no_storage; disjoint behaviors store_position, no_storage; */ extern unsigned long strtoul(char const * __restrict nptr, char ** __restrict endptr, int base); /*@ requires valid_nptr: \valid_read(nptr); requires separation: \separated(nptr, endptr); requires base_range: base ≡ 0 ∨ (2 ≤ base ≤ 36); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr), (indirect: base); behavior no_storage: assumes null_endptr: endptr ≡ \null; assigns \result; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); behavior store_position: assumes nonnull_endptr: endptr ≢ \null; requires valid_endptr: \valid(endptr); ensures initialization: \initialized(\old(endptr)); ensures valid_endptr: \valid_read(\old(endptr)); ensures position_subset: \subset(*\old(endptr), \old(nptr) + (0 ..)); assigns \result, *endptr; assigns \result \from (indirect: nptr), (indirect: *(nptr + (0 ..))), (indirect: base); assigns *endptr \from nptr, (indirect: *(nptr + (0 ..))), (indirect: endptr), (indirect: base); complete behaviors store_position, no_storage; disjoint behaviors store_position, no_storage; */ extern unsigned long long strtoull(char const * __restrict nptr, char ** __restrict endptr, int base); /*@ ghost extern int __fc_random_counter __attribute__((__unused__, __FRAMA_C_MODEL__)); */ unsigned long const __fc_rand_max = (unsigned long)32767; /*@ ensures result_range: 0 ≤ \result ≤ __fc_rand_max; assigns \result, __fc_random_counter; assigns \result \from __fc_random_counter; assigns __fc_random_counter \from __fc_random_counter; */ extern int rand(void); /*@ assigns __fc_random_counter; assigns __fc_random_counter \from seed; */ extern void srand(unsigned int seed); /*@ ensures result_range: 0 ≤ \result ≤ __fc_rand_max; assigns \result; assigns \result \from __fc_random_counter; */ extern long random(void); /*@ assigns __fc_random_counter; assigns __fc_random_counter \from seed; */ extern void srandom(unsigned int seed); int __fc_random48_init __attribute__((__FRAMA_C_MODEL__)); unsigned short __fc_random48_counter[3] __attribute__((__FRAMA_C_MODEL__)); unsigned short *__fc_p_random48_counter = __fc_random48_counter; /*@ ensures random48_initialized: __fc_random48_init ≡ 1; assigns __fc_random48_counter[0 .. 2], __fc_random48_init; assigns __fc_random48_counter[0 .. 2] \from seed; assigns __fc_random48_init \from \nothing; */ extern void srand48(long seed); /*@ requires initialization: initialized_seed16v: \initialized(seed16v + (0 .. 2)); ensures random48_initialized: __fc_random48_init ≡ 1; ensures result_counter: \result ≡ __fc_p_random48_counter; assigns __fc_random48_counter[0 .. 2], __fc_random48_init, \result; assigns __fc_random48_counter[0 .. 2] \from (indirect: *(seed16v + (0 .. 2))); assigns __fc_random48_init \from \nothing; assigns \result \from __fc_p_random48_counter; */ extern unsigned short *seed48(unsigned short * /*[3]*/ seed16v); /*@ ensures random48_initialized: __fc_random48_init ≡ 1; assigns __fc_random48_counter[0 .. 2], __fc_random48_init; assigns __fc_random48_counter[0 .. 2] \from *(param + (0 .. 5)); assigns __fc_random48_init \from \nothing; */ extern void lcong48(unsigned short * /*[7]*/ param); /*@ requires random48_initialized: __fc_random48_init ≡ 1; ensures result_range: \is_finite(\result) ∧ 0.0 ≤ \result < 1.0; assigns __fc_random48_counter[0 .. 2], \result; assigns __fc_random48_counter[0 .. 2] \from __fc_random48_counter[0 .. 2]; assigns \result \from __fc_random48_counter[0 .. 2]; */ extern double drand48(void); /*@ requires initialization: initialized_xsubi: \initialized(xsubi + (0 .. 2)); ensures result_range: \is_finite(\result) ∧ 0.0 ≤ \result < 1.0; assigns __fc_random48_counter[0 .. 2], \result; assigns __fc_random48_counter[0 .. 2] \from __fc_random48_counter[0 .. 2]; assigns \result \from __fc_random48_counter[0 .. 2]; */ extern double erand48(unsigned short * /*[3]*/ xsubi); /*@ requires random48_initialized: __fc_random48_init ≡ 1; ensures result_range: 0 ≤ \result < 2147483648; assigns __fc_random48_counter[0 .. 2], \result; assigns __fc_random48_counter[0 .. 2] \from __fc_random48_counter[0 .. 2]; assigns \result \from __fc_random48_counter[0 .. 2]; */ extern long lrand48(void); /*@ requires initialization: initialized_xsubi: \initialized(xsubi + (0 .. 2)); ensures result_range: 0 ≤ \result < 2147483648; assigns __fc_random48_counter[0 .. 2], \result; assigns __fc_random48_counter[0 .. 2] \from __fc_random48_counter[0 .. 2]; assigns \result \from __fc_random48_counter[0 .. 2]; */ extern long nrand48(unsigned short * /*[3]*/ xsubi); /*@ requires random48_initialized: __fc_random48_init ≡ 1; ensures result_range: -2147483648 ≤ \result < 2147483648; assigns __fc_random48_counter[0 .. 2], \result; assigns __fc_random48_counter[0 .. 2] \from __fc_random48_counter[0 .. 2]; assigns \result \from __fc_random48_counter[0 .. 2]; */ extern long mrand48(void); /*@ requires initialization: initialized_xsubi: \initialized(xsubi + (0 .. 2)); ensures result_range: -2147483648 ≤ \result < 2147483648; assigns __fc_random48_counter[0 .. 2], \result; assigns __fc_random48_counter[0 .. 2] \from __fc_random48_counter[0 .. 2]; assigns \result \from __fc_random48_counter[0 .. 2]; */ extern long jrand48(unsigned short * /*[3]*/ xsubi); void *calloc(size_t nmemb, size_t size); /*@ assigns __fc_heap_status, \result; assigns __fc_heap_status \from size, __fc_heap_status; assigns \result \from (indirect: size), (indirect: __fc_heap_status); allocates \result; behavior allocation: assumes can_allocate: is_allocable(size); ensures allocation: \fresh{Old, Here}(\result,\old(size)); assigns __fc_heap_status, \result; assigns __fc_heap_status \from size, __fc_heap_status; assigns \result \from (indirect: size), (indirect: __fc_heap_status); behavior no_allocation: assumes cannot_allocate: ¬is_allocable(size); ensures null_result: \result ≡ \null; assigns \result; assigns \result \from \nothing; allocates \nothing; complete behaviors no_allocation, allocation; disjoint behaviors no_allocation, allocation; */ extern void *malloc(size_t size); /*@ requires freeable: p ≡ \null ∨ \freeable(p); assigns __fc_heap_status; assigns __fc_heap_status \from __fc_heap_status; frees p; behavior deallocation: assumes nonnull_p: p ≢ \null; ensures freed: \allocable(\old(p)); assigns __fc_heap_status; assigns __fc_heap_status \from __fc_heap_status; behavior no_deallocation: assumes null_p: p ≡ \null; assigns \nothing; allocates \nothing; complete behaviors no_deallocation, deallocation; disjoint behaviors no_deallocation, deallocation; */ extern void free(void *p); /*@ requires freeable: ptr ≡ \null ∨ \freeable(ptr); assigns __fc_heap_status, \result; assigns __fc_heap_status \from __fc_heap_status; assigns \result \from size, ptr, __fc_heap_status; frees ptr; allocates \result; behavior allocation: assumes can_allocate: is_allocable(size); ensures allocation: \fresh{Old, Here}(\result,\old(size)); assigns \result; assigns \result \from size, __fc_heap_status; allocates \result; behavior deallocation: assumes nonnull_ptr: ptr ≢ \null; assumes can_allocate: is_allocable(size); ensures freed: \allocable(\old(ptr)); ensures freeable: \result ≡ \null ∨ \freeable(\result); frees ptr; behavior fail: assumes cannot_allocate: ¬is_allocable(size); ensures null_result: \result ≡ \null; assigns \result; assigns \result \from size, __fc_heap_status; allocates \nothing; complete behaviors fail, deallocation, allocation; disjoint behaviors allocation, fail; disjoint behaviors deallocation, fail; */ extern void *realloc(void *ptr, size_t size); /*@ exits status: \exit_status ≢ 0; ensures never_terminates: \false; assigns \exit_status \from \nothing; */ extern __attribute__((__noreturn__)) void abort(void); /*@ assigns \result; assigns \result \from \nothing; */ extern int atexit(void (*func)(void)); /*@ assigns \result; assigns \result \from \nothing; */ extern int at_quick_exit(void (*func)(void)); /*@ exits status: \exit_status ≡ \old(status); ensures never_terminates: \false; assigns \exit_status \from status; */ extern __attribute__((__noreturn__)) void exit(int status); /*@ ensures never_terminates: \false; assigns \nothing; */ extern __attribute__((__noreturn__)) void _Exit(int status); char *__fc_env[4096] __attribute__((__FRAMA_C_MODEL__)); char *getenv(char const *name); int putenv(char *string); int setenv(char const *name, char const *value, int overwrite); int unsetenv(char const *name); /*@ ensures never_terminates: \false; assigns \nothing; */ extern __attribute__((__noreturn__)) void quick_exit(int status); /*@ requires null_or_valid_string_command: command ≡ \null ∨ valid_read_string(command); assigns \result; assigns \result \from (indirect: command), (indirect: *(command + (0 ..))); */ extern int system(char const *command); /*@ requires valid_function_compar: \valid_function(compar); ensures null_or_correct_result: \result ≡ \null ∨ \subset(\result, (void *)((char *)\old(base) + (0 .. \old(size) * (\old(nmemb) - 1)))); assigns \result; assigns \result \from (indirect: key), *((char *)key + (0 .. size - 1)), base, *((char *)base + (0 .. size * (nmemb - 1))), (indirect: nmemb), (indirect: size), (indirect: *compar); */ extern void *bsearch(void const *key, void const *base, size_t nmemb, size_t size, int (*compar)(void const *, void const *)); /*@ requires valid_function_compar: \valid_function(compar); assigns *((char *)base + (0 ..)); assigns *((char *)base + (0 ..)) \from (indirect: base), *((char *)base + (0 ..)), (indirect: nmemb), (indirect: size), (indirect: compar), (indirect: *compar); */ extern void qsort(void *base, size_t nmemb, size_t size, int (*compar)(void const *, void const *)); int abs(int i); /*@ requires abs_representable: j > -2147483647L - 1L; assigns \result; assigns \result \from j; behavior negative: assumes negative: j < 0; ensures opposite_result: \result ≡ -\old(j); behavior nonnegative: assumes nonnegative: j ≥ 0; ensures same_result: \result ≡ \old(j); complete behaviors nonnegative, negative; disjoint behaviors nonnegative, negative; */ extern long labs(long j); /*@ requires abs_representable: j > -9223372036854775807LL - 1LL; assigns \result; assigns \result \from j; behavior negative: assumes negative: j < 0; ensures opposite_result: \result ≡ -\old(j); behavior nonnegative: assumes nonnegative: j ≥ 0; ensures same_result: \result ≡ \old(j); complete behaviors nonnegative, negative; disjoint behaviors nonnegative, negative; */ extern long long llabs(long long j); /*@ assigns \result; assigns \result \from numer, denom; */ extern div_t div(int numer, int denom); /*@ assigns \result; assigns \result \from numer, denom; */ extern ldiv_t ldiv(long numer, long denom); /*@ assigns \result; assigns \result \from numer, denom; */ extern lldiv_t lldiv(long long numer, long long denom); /*@ ghost extern int __fc_mblen_state; */ /*@ assigns \result, __fc_mblen_state; assigns \result \from (indirect: s), (indirect: *(s + (0 ..))), (indirect: n), __fc_mblen_state; assigns __fc_mblen_state \from (indirect: s), (indirect: *(s + (0 ..))), (indirect: n), __fc_mblen_state; */ extern int mblen(char const *s, size_t n); /*@ ghost extern int __fc_mbtowc_state; */ /*@ requires separation: \separated(pwc, s); ensures consumed_range: \result ≤ \old(n); assigns \result, *(pwc + (0 .. \result - 1)), __fc_mbtowc_state; assigns \result \from (indirect: s), (indirect: *(s + (0 .. n - 1))), (indirect: n), __fc_mbtowc_state; assigns *(pwc + (0 .. \result - 1)) \from (indirect: s), *(s + (0 .. n - 1)), (indirect: n), __fc_mbtowc_state; assigns __fc_mbtowc_state \from (indirect: s), *(s + (0 .. n - 1)), (indirect: n), __fc_mbtowc_state; */ extern int mbtowc(wchar_t * __restrict pwc, char const * __restrict s, size_t n); /*@ ghost extern int __fc_wctomb_state; */ /*@ assigns \result, *(s + (0 ..)), __fc_wctomb_state; assigns \result \from (indirect: wc), __fc_wctomb_state; assigns *(s + (0 ..)) \from wc, __fc_wctomb_state; assigns __fc_wctomb_state \from wc, __fc_wctomb_state; */ extern int wctomb(char *s, wchar_t wc); /*@ requires separation: \separated(pwcs, s); assigns \result, *(pwcs + (0 .. n - 1)); assigns \result \from (indirect: s), (indirect: *(s + (0 .. n - 1))), (indirect: n); assigns *(pwcs + (0 .. n - 1)) \from (indirect: s), *(s + (0 .. n - 1)), (indirect: n); */ extern size_t mbstowcs(wchar_t * __restrict pwcs, char const * __restrict s, size_t n); /*@ requires separation: \separated(s, pwcs); assigns \result, *(s + (0 .. n - 1)); assigns \result \from (indirect: pwcs), (indirect: *(pwcs + (0 .. n - 1))), (indirect: n); assigns *(s + (0 .. n - 1)) \from (indirect: pwcs), *(pwcs + (0 .. n - 1)), (indirect: n); */ extern size_t wcstombs(char * __restrict s, wchar_t const * __restrict pwcs, size_t n); int posix_memalign(void **memptr, size_t alignment, size_t size); /*@ requires valid_template: valid_string(templat); ensures result_error_or_valid_fd: \result ≡ -1 ∨ (0 ≤ \result < 16); assigns *(templat + (0 ..)), \result; assigns *(templat + (0 ..)) \from \nothing; assigns \result \from \nothing; */ extern int mkstemp(char *templat); int glob(char const *pattern, int flags, int (*errfunc)(char const *epath, int eerrno), glob_t *pglob) { int __retres; int tmp; unsigned int tmp_0; char **tmp_1; int tmp_4; tmp = Frama_C_interval(0,10); pglob->gl_pathc = (unsigned int)tmp; if (flags & (1 << 3)) tmp_0 = pglob->gl_offs; else tmp_0 = (unsigned int)0; size_t reserve_offs = tmp_0; size_t prev_len = (unsigned int)0; if (flags & (1 << 5)) while (*(pglob->gl_pathv + (reserve_offs + prev_len))) prev_len += (size_t)1; if (flags & (1 << 5)) tmp_1 = pglob->gl_pathv; else tmp_1 = (char **)0; char **path = tmp_1; if (pglob->gl_pathc == (unsigned int)0) if (flags & (1 << 4)) { pglob->gl_pathv = (char **)realloc((void *)path, ((reserve_offs + prev_len) + (size_t)2) * sizeof(char *)); if (! pglob->gl_pathv) { __retres = 1; goto return_label; } { size_t i = (unsigned int)0; while (i < reserve_offs) { *(pglob->gl_pathv + i) = (char *)0; i += (size_t)1; } } *(pglob->gl_pathv + (reserve_offs + prev_len)) = (char *)pattern; *(pglob->gl_pathv + ((reserve_offs + prev_len) + (size_t)1)) = (char *)0; __retres = 0; goto return_label; } else { __retres = 3; goto return_label; } pglob->gl_pathv = (char **)realloc((void *)path, (((reserve_offs + prev_len) + pglob->gl_pathc) + (size_t)1) * sizeof(char *)); if (! pglob->gl_pathv) { __retres = 1; goto return_label; } { size_t i_0 = (unsigned int)0; while (i_0 < reserve_offs) { *(pglob->gl_pathv + i_0) = (char *)0; i_0 += (size_t)1; } } { size_t i_1 = (unsigned int)0; while (i_1 < pglob->gl_pathc) { *(pglob->gl_pathv + ((reserve_offs + prev_len) + i_1)) = (char *)"glob result"; i_1 += (size_t)1; } } *(pglob->gl_pathv + ((prev_len + reserve_offs) + pglob->gl_pathc)) = (char *)0; tmp_4 = Frama_C_nondet(0,1); if (tmp_4) { __retres = 0; goto return_label; } else { if (errfunc) { int tmp_3; int tmp_2; tmp_2 = Frama_C_interval(0,255); tmp_3 = (*errfunc)("glob.c error path",tmp_2); int res = tmp_3; if (res) { __retres = 2; goto return_label; } else if (flags & (1 << 0)) { __retres = 2; goto return_label; } } __retres = 0; goto return_label; } return_label: return __retres; } void globfree(glob_t *pglob) { if (pglob->gl_pathc > (unsigned int)0) free((void *)pglob->gl_pathv); return; } intmax_t imaxabs(intmax_t c); imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); /*@ assigns \result, *(endptr + (..)), __fc_errno; assigns \result \from *(nptr + (..)), base; assigns *(endptr + (..)) \from *(nptr + (..)), base; assigns __fc_errno \from *(nptr + (..)), base; */ extern intmax_t strtoimax(char const * __restrict nptr, char ** __restrict endptr, int base); /*@ requires abs_representable: (long long)(-c) ≢ c; assigns \result; assigns \result \from c; */ intmax_t imaxabs(intmax_t c) { intmax_t __retres; if (c > (intmax_t)0) { __retres = c; goto return_label; } else { __retres = - c; goto return_label; } return_label: return __retres; } /*@ requires no_div_by_zero: denom ≢ 0; requires no_overflow: denom ≢ -1 ∨ (long long)(-numer) ≢ numer; ensures correct_div: \result.quot ≡ \old(numer) / \old(denom); ensures correct_mod: \result.rem ≡ \old(numer) % \old(denom); assigns \result; assigns \result \from numer, denom; */ imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom) { imaxdiv_t r; r.quot = numer / denom; r.rem = numer % denom; return r; } extern struct lconv *__fc_locale; extern char *__fc_locale_names[512]; char *setlocale(int category, char const *locale); struct lconv *localeconv(void); struct lconv __C_locale = {.decimal_point = (char *)".", .thousands_sep = (char *)"", .grouping = (char *)"", .int_curr_symbol = (char *)"", .currency_symbol = (char *)"", .mon_decimal_point = (char *)"", .mon_thousands_sep = (char *)"", .mon_grouping = (char *)"", .positive_sign = (char *)"", .negative_sign = (char *)"", .int_frac_digits = (char)127, .frac_digits = (char)127, .p_cs_precedes = (char)127, .p_sep_by_space = (char)127, .n_cs_precedes = (char)127, .n_sep_by_space = (char)127, .p_sign_posn = (char)127, .n_sign_posn = (char)127, .int_p_cs_precedes = (char)127, .int_p_sep_by_space = (char)127, .int_n_cs_precedes = (char)127, .int_n_sep_by_space = (char)127, .int_p_sign_posn = (char)127, .int_n_sign_posn = (char)127}; struct lconv *__frama_c_locale = & __C_locale; char *__frama_c_locale_names[512] = {(char *)"C"}; /*@ requires locale_null_or_valid_string: locale ≡ \null ∨ valid_read_string(locale); ensures result_null_or_locale_name: \result ≡ \null ∨ (\valid(\result) ∧ (∃ ℤ i; \result ≡ __fc_locale_names[i])); assigns __fc_locale, \result; assigns __fc_locale \from category, *(locale + (..)); assigns \result \from __fc_locale, category, *(locale + (..)); */ char *setlocale(int category, char const *locale) { char *__retres; if ((int)*locale == 'C') { __frama_c_locale = & __C_locale; __retres = __frama_c_locale_names[0]; goto return_label; } __retres = (char *)0; return_label: return __retres; } /*@ ensures result_current_locale: \result ≡ __fc_locale; assigns \nothing; */ struct lconv *localeconv(void) { return __frama_c_locale; } /*@ assigns \result; assigns \result \from x; behavior nan: assumes is_nan: \is_NaN(x); ensures fp_nan: \result ≡ 0; behavior inf: assumes is_infinite: ¬\is_NaN(x) ∧ ¬\is_finite(x); ensures fp_infinite: \result ≡ 1; behavior zero: assumes is_a_zero: x ≡ 0.0; ensures fp_zero: \result ≡ 2; behavior subnormal: assumes is_finite: \is_finite(x); assumes is_subnormal: (x > 0.0 ∧ x < 0x1p-126) ∨ (x < 0.0 ∧ x > -0x1p-126); ensures fp_subnormal: \result ≡ 3; behavior normal: assumes is_finite: \is_finite(x); assumes not_subnormal: x ≤ -0x1p-126 ∨ x ≥ 0x1p-126; ensures fp_normal: \result ≡ 4; complete behaviors normal, subnormal, zero, inf, nan; disjoint behaviors normal, subnormal, zero, inf, nan; */ int __fc_fpclassifyf(float x); /*@ assigns \result; assigns \result \from x; behavior nan: assumes is_nan: \is_NaN(x); ensures fp_nan: \result ≡ 0; behavior inf: assumes is_infinite: ¬\is_NaN(x) ∧ ¬\is_finite(x); ensures fp_infinite: \result ≡ 1; behavior zero: assumes is_a_zero: x ≡ 0.0; ensures fp_zero: \result ≡ 2; behavior subnormal: assumes is_finite: \is_finite(x); assumes is_subnormal: (x > 0.0 ∧ x < 0x1p-1022) ∨ (x < 0.0 ∧ x > -0x1p-1022); ensures fp_subnormal: \result ≡ 3; behavior normal: assumes is_finite: \is_finite(x); assumes not_subnormal: x ≤ -0x1p-1022 ∨ x ≥ 0x1p-1022; ensures fp_normal: \result ≡ 4; complete behaviors normal, subnormal, zero, inf, nan; disjoint behaviors normal, subnormal, zero, inf, nan; */ int __fc_fpclassify(double x); /*@ assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; behavior normal: assumes in_domain: \is_finite(x) ∧ \abs(x) ≤ 1; ensures positive_result: \is_finite(\result) ∧ \result ≥ 0; assigns \result; assigns \result \from x; behavior domain_error: assumes out_of_domain: \is_infinite(x) ∨ (\is_finite(x) ∧ \abs(x) > 1); ensures errno_set: __fc_errno ≡ 1; assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; disjoint behaviors domain_error, normal; */ extern double acos(double x); /*@ assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; behavior normal: assumes in_domain: \is_finite(x) ∧ \abs(x) ≤ 1; ensures positive_result: \is_finite(\result) ∧ \result ≥ 0; assigns \result; assigns \result \from x; behavior domain_error: assumes out_of_domain: \is_infinite(x) ∨ (\is_finite(x) ∧ \abs(x) > 1); ensures errno_set: __fc_errno ≡ 1; assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; disjoint behaviors domain_error, normal; */ extern float acosf(float x); /*@ assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; behavior normal: assumes in_domain: \is_finite(x) ∧ \abs(x) ≤ 1; ensures positive_result: \is_finite(\result) ∧ \result ≥ 0; assigns \result; assigns \result \from x; behavior domain_error: assumes out_of_domain: \is_infinite(x) ∨ (\is_finite(x) ∧ \abs(x) > 1); ensures errno_set: __fc_errno ≡ 1; assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; disjoint behaviors domain_error, normal; */ extern long double acosl(long double x); /*@ assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; behavior normal: assumes in_domain: \is_finite(x) ∧ \abs(x) ≤ 1; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; behavior domain_error: assumes out_of_domain: \is_infinite(x) ∨ (\is_finite(x) ∧ \abs(x) > 1); ensures errno_set: __fc_errno ≡ 1; assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; disjoint behaviors domain_error, normal; */ extern double asin(double x); /*@ assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; behavior normal: assumes in_domain: \is_finite(x) ∧ \abs(x) ≤ 1; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; behavior domain_error: assumes out_of_domain: \is_infinite(x) ∨ (\is_finite(x) ∧ \abs(x) > 1); ensures errno_set: __fc_errno ≡ 1; assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; disjoint behaviors domain_error, normal; */ extern float asinf(float x); /*@ assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; behavior normal: assumes in_domain: \is_finite(x) ∧ \abs(x) ≤ 1; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; behavior domain_error: assumes out_of_domain: \is_infinite(x) ∨ (\is_finite(x) ∧ \abs(x) > 1); ensures errno_set: __fc_errno ≡ 1; assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; disjoint behaviors domain_error, normal; */ extern long double asinl(long double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); ensures result_domain: -1.571 ≤ \result ≤ 1.571; assigns \result; assigns \result \from x; */ extern float atanf(float x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); ensures result_domain: -1.571 ≤ \result ≤ 1.571; assigns \result; assigns \result \from x; */ extern double atan(double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); ensures result_domain: -1.571 ≤ \result ≤ 1.571; assigns \result; assigns \result \from x; */ extern long double atanl(long double x); /*@ requires finite_args: \is_finite(x) ∧ \is_finite(y); requires finite_result: \is_finite(atan2(x, y)); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x, y; */ extern double atan2(double y, double x); /*@ requires finite_args: \is_finite(x) ∧ \is_finite(y); requires finite_logic_result: \is_finite(atan2f(x, y)); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x, y; */ extern float atan2f(float y, float x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); ensures result_domain: -1. ≤ \result ≤ 1.; assigns \result; assigns \result \from x; */ extern double cos(double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); ensures result_domain: -1. ≤ \result ≤ 1.; assigns \result; assigns \result \from x; */ extern float cosf(float x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); ensures result_domain: -1. ≤ \result ≤ 1.; assigns \result; assigns \result \from x; */ extern long double cosl(long double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); ensures result_domain: -1. ≤ \result ≤ 1.; assigns \result; assigns \result \from x; */ extern double sin(double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); ensures result_domain: -1. ≤ \result ≤ 1.; assigns \result; assigns \result \from x; */ extern float sinf(float x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); ensures result_domain: -1. ≤ \result ≤ 1.; assigns \result; assigns \result \from x; */ extern long double sinl(long double x); /*@ assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; behavior normal: assumes in_domain: \is_finite(x) ∧ x ≥ 1; ensures positive_result: \is_finite(\result) ∧ \result ≥ 0; assigns \result; assigns \result \from x; behavior infinite: assumes is_plus_infinity: \is_plus_infinity(x); ensures result_plus_infinity: \is_plus_infinity(\result); assigns \result; assigns \result \from x; behavior domain_error: assumes out_of_domain: \is_minus_infinity(x) ∨ (\is_finite(x) ∧ x < 1); ensures errno_set: __fc_errno ≡ 1; assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; disjoint behaviors domain_error, infinite, normal; */ extern double acosh(double x); /*@ assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; behavior normal: assumes in_domain: \is_finite(x) ∧ x ≥ 1; ensures positive_result: \is_finite(\result) ∧ \result ≥ 0; assigns \result; assigns \result \from x; behavior infinite: assumes is_plus_infinity: \is_plus_infinity(x); ensures result_plus_infinity: \is_plus_infinity(\result); assigns \result; assigns \result \from x; behavior domain_error: assumes out_of_domain: \is_minus_infinity(x) ∨ (\is_finite(x) ∧ x < 1); ensures errno_set: __fc_errno ≡ 1; assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; disjoint behaviors domain_error, infinite, normal; */ extern float acoshf(float x); /*@ assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; behavior normal: assumes in_domain: \is_finite(x) ∧ x ≥ 1; ensures positive_result: \is_finite(\result) ∧ \result ≥ 0; assigns \result; assigns \result \from x; behavior infinite: assumes is_plus_infinity: \is_plus_infinity(x); ensures result_plus_infinity: \is_plus_infinity(\result); assigns \result; assigns \result \from x; behavior domain_error: assumes out_of_domain: \is_minus_infinity(x) ∨ (\is_finite(x) ∧ x < 1); ensures errno_set: __fc_errno ≡ 1; assigns __fc_errno, \result; assigns __fc_errno \from x; assigns \result \from x; disjoint behaviors domain_error, infinite, normal; */ extern long double acoshl(long double x); /*@ requires finite_arg: \is_finite(x); requires finite_domain: x ≤ 0x1.62e42fefa39efp+9; ensures res_finite: \is_finite(\result); ensures positive_result: \result > 0.; assigns \result; assigns \result \from x; */ extern double exp(double x); /*@ requires finite_arg: \is_finite(x); requires res_finite: x ≤ 0x1.62e42ep+6; ensures res_finite: \is_finite(\result); ensures positive_result: \result > 0.; assigns \result; assigns \result \from x; */ extern float expf(float x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern double log(double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern float logf(float x); /*@ requires finite_arg: \is_finite(x); requires arg_pos: x > 0; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern long double logl(long double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern double log10(double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern float log10f(float x); /*@ requires finite_arg: \is_finite(x); requires arg_postive: x > 0; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern long double log10l(long double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern double log2(double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern float log2f(float x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x > 0; ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern long double log2l(long double x); double fabs(double x); float fabsf(float x); /*@ requires finite_arg: \is_finite(x); ensures res_finite: \is_finite(\result); ensures positive_result: \result ≥ 0.; ensures equal_magnitude_result: \result ≡ \old(x) ∨ \result ≡ -\old(x); assigns \result; assigns \result \from x; */ extern long double fabsl(long double x); /*@ requires finite_args: \is_finite(x) ∧ \is_finite(y); requires finite_logic_res: \is_finite(pow(x, y)); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x, y; */ extern double pow(double x, double y); /*@ requires finite_args: \is_finite(x) ∧ \is_finite(y); requires finite_logic_res: \is_finite(powf(x, y)); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x, y; */ extern float powf(float x, float y); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x ≥ -0.; ensures finite_result: \is_finite(\result); ensures positive_result: \result ≥ -0.; assigns \result; assigns \result \from x; */ extern double sqrt(double x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x ≥ -0.; ensures finite_result: \is_finite(\result); ensures positive_result: \result ≥ -0.; assigns \result; assigns \result \from x; */ extern float sqrtf(float x); /*@ requires finite_arg: \is_finite(x); requires arg_positive: x ≥ -0.; ensures finite_result: \is_finite(\result); ensures positive_result: \result ≥ -0.; assigns \result; assigns \result \from x; */ extern long double sqrtl(long double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern double ceil(double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern float ceilf(float x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern long double ceill(long double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern double floor(double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern float floorf(float x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern long double floorl(long double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern double round(double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern float roundf(float x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern long double roundl(long double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern double trunc(double x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern float truncf(float x); /*@ requires finite_arg: \is_finite(x); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x; */ extern long double truncl(long double x); /*@ requires finite_args: \is_finite(x) ∧ \is_finite(y); requires finite_logic_result: \is_finite(fmod(x, y)); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x, y; */ extern double fmod(double x, double y); /*@ requires finite_args: \is_finite(x) ∧ \is_finite(y); requires finite_logic_result: \is_finite(fmodf(x, y)); ensures finite_result: \is_finite(\result); assigns \result; assigns \result \from x, y; */ extern float fmodf(float x, float y); /*@ requires tagp_valid_string: valid_read_string(tagp); ensures result_is_nan: \is_NaN(\result); assigns \result; assigns \result \from (indirect: *(tagp + (0 ..))); */ extern double nan(char const *tagp); /*@ requires tagp_valid_string: valid_read_string(tagp); ensures result_is_nan: \is_NaN(\result); assigns \result; assigns \result \from (indirect: *(tagp + (0 ..))); */ extern float nanf(char const *tagp); /*@ requires tagp_valid_string: valid_read_string(tagp); ensures result_is_nan: \is_NaN(\result); assigns \result; assigns \result \from (indirect: *(tagp + (0 ..))); */ extern long double nanl(char const *tagp); int __finitef(float f); int __finite(double d); /*@ logic float __fc_infinity(ℤ x) = \plus_infinity; */ /*@ logic float __fc_nan(ℤ x) = \NaN; */ /*@ ensures result_is_infinity: \is_plus_infinity(\result); assigns \result; assigns \result \from \nothing; */ extern float __fc_infinity(int x); /*@ ensures result_is_nan: \is_NaN(\result); assigns \result; assigns \result \from \nothing; */ extern float __fc_nan(int x); /*@ requires finite_arg: \is_finite(x); ensures res_finite: \is_finite(\result); ensures positive_result: \result ≥ 0.; ensures equal_magnitude_result: \result ≡ \old(x) ∨ \result ≡ -\old(x); assigns \result; assigns \result \from x; */ double fabs(double x) { double __retres; if (x == 0.0) { __retres = 0.0; goto return_label; } if (x > 0.0) { __retres = x; goto return_label; } __retres = - x; return_label: return __retres; } /*@ requires finite_arg: \is_finite(x); ensures res_finite: \is_finite(\result); ensures positive_result: \result ≥ 0.; ensures equal_magnitude_result: \result ≡ \old(x) ∨ \result ≡ -\old(x); assigns \result; assigns \result \from x; */ float fabsf(float x) { float __retres; if (x == 0.0f) { __retres = 0.0f; goto return_label; } else if (x > 0.0f) { __retres = x; goto return_label; } else { __retres = - x; goto return_label; } return_label: return __retres; } int __finitef(float f) { int __retres; union __fc_u_finitef u; unsigned short usExp; u.f = f; usExp = (unsigned short)((int)u.w[1] & 0x7F80); usExp = (unsigned short)((int)usExp >> 7); __retres = ! ((int)usExp == 0xff); return __retres; } int __finite(double d) { int __retres; union __fc_u_finite u; unsigned short usExp; u.d = d; usExp = (unsigned short)((int)u.w[3] & 0x7F80); usExp = (unsigned short)((int)usExp >> 7); __retres = ! ((int)usExp == 0xff); return __retres; } /*@ assigns \nothing; */ extern void (*signal(int sig, void (*func)(int )))(int ); /*@ ensures never_terminates: \false; assigns \nothing; */ extern int raise(int sig); /*@ requires valid_set: \valid(set); ensures initialization: set: \initialized(\old(set)); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *set, \result; assigns *set \from \nothing; assigns \result \from \nothing; */ extern int sigemptyset(sigset_t *set); /*@ requires valid_set: \valid(set); ensures initialization: set: \initialized(\old(set)); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *set, \result; assigns *set \from \nothing; assigns \result \from \nothing; */ extern int sigfillset(sigset_t *set); /*@ requires valid_set: \valid(set); requires initialization: set: \initialized(set); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *set, \result; assigns *set \from (indirect: signum); assigns \result \from signum; */ extern int sigaddset(sigset_t *set, int signum); /*@ requires valid_set: \valid(set); requires initialization: set: \initialized(set); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *set, \result; assigns *set \from (indirect: signum); assigns \result \from signum; */ extern int sigdelset(sigset_t *set, int signum); /*@ requires valid_read_set: \valid_read(set); requires initialization: set: \initialized(set); ensures result_found_not_found_or_error: \result ≡ 0 ∨ \result ≡ 1 ∨ \result ≡ -1; assigns \result; assigns \result \from *set, signum; */ extern int sigismember(sigset_t const *set, int signum); struct sigaction __fc_sigaction[64 + 1]; struct sigaction *__fc_p_sigaction = __fc_sigaction; /*@ requires valid_signal: 0 ≤ signum ≤ 64; requires valid_oldact_or_null: oldact ≡ \null ∨ \valid(oldact); requires valid_read_act_or_null: act ≡ \null ∨ \valid_read(act); requires separation: separated_acts: \separated(act, oldact); ensures act_changed: \old(act) ≡ \null ∨ \subset(*(__fc_p_sigaction + \old(signum)), *\old(act)); ensures oldact_assigned: \old(oldact) ≡ \null ∨ *\old(oldact) ∈ *(__fc_p_sigaction + \old(signum)); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *oldact, *(__fc_p_sigaction + signum), \result; assigns *oldact \from __fc_p_sigaction; assigns *(__fc_p_sigaction + signum) \from *act; assigns \result \from (indirect: signum), (indirect: act), (indirect: *act), (indirect: oldact), (indirect: *oldact); */ extern int sigaction(int signum, struct sigaction const * __restrict act, struct sigaction * __restrict oldact); /*@ requires valid_set_or_null: set ≡ \null ∨ \valid_read(set); requires valid_how: set ≢ \null ⇒ how ∈ {0, 2, 1}; requires valid_oldset_or_null: oldset ≡ \null ∨ \valid(oldset); requires separation: (set ≡ oldset ≡ \null) ∨ \separated(set, oldset); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; ensures initialization: oldset_initialized: \old(oldset) ≢ \null ∧ \result ≡ 0 ⇒ \initialized(\old(oldset)); assigns \result, *oldset; assigns \result \from (indirect: how), (indirect: set), (indirect: oldset); assigns *oldset \from (indirect: how), (indirect: oldset); */ extern int sigprocmask(int how, sigset_t const * __restrict set, sigset_t * __restrict oldset); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: pid), (indirect: sig); */ extern int kill(pid_t pid, int sig); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: pgrp), (indirect: sig); */ extern int killpg(pid_t pgrp, int sig); /*@ requires valid_read_iov: \valid_read(iov + (0 .. iovcnt - 1)); assigns *((char *)(iov + (0 .. iovcnt - 1))->iov_base + (0 ..)); */ extern ssize_t readv(int fd, struct iovec const *iov, int iovcnt); /*@ ghost struct __fc_sockfds_type __fc_sockfds[1024]; */ /*@ ghost extern int __fc_socket_counter __attribute__((__FRAMA_C_MODEL__)); */ /*@ ghost int volatile __fc_open_sock_fds; */ /*@ requires valid_sockfd: 0 ≤ sockfd < 1024; ensures result_error_or_valid_new_sockfd: \result ≡ -1 ∨ (0 ≤ \result < 1024); assigns \result, *((char *)addr + (0 .. *addrlen - 1)), __fc_sockfds[sockfd]; assigns \result \from *addr, *addrlen, __fc_sockfds[sockfd]; assigns *((char *)addr + (0 .. *addrlen - 1)) \from *addr, *addrlen, __fc_sockfds[sockfd]; assigns __fc_sockfds[sockfd] \from *addr, *addrlen, __fc_sockfds[sockfd]; behavior addr_null: assumes addr_is_null: addr ≡ \null; requires addrlen_should_be_null: addrlen ≡ \null; assigns \result, __fc_sockfds[sockfd]; assigns \result \from __fc_sockfds[sockfd]; assigns __fc_sockfds[sockfd] \from __fc_sockfds[sockfd]; behavior addr_not_null: assumes addr_is_not_null: addr ≢ \null; requires valid_addrlen: \valid(addrlen); requires addr_has_room: \valid((char *)addr + (0 .. *addrlen - 1)); ensures initialization: addr: \initialized((char *)\old(addr) + (0 .. *\old(addrlen) - 1)); disjoint behaviors addr_not_null, addr_null; */ extern int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); /*@ requires valid_sockfd: sockfd: 0 ≤ sockfd < 1024; requires valid_read_addr: \valid_read((char *)addr + (0 .. addrlen - 1)); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns __fc_sockfds[sockfd], \result; assigns __fc_sockfds[sockfd] \from sockfd, *addr, addrlen, __fc_sockfds[sockfd]; assigns \result \from (indirect: sockfd), (indirect: *addr), (indirect: addrlen), (indirect: __fc_sockfds[sockfd]); */ extern int bind(int sockfd, struct sockaddr const *addr, socklen_t addrlen); /*@ requires valid_sockfd: 0 ≤ sockfd < 1024; requires valid_read_addr: \valid_read((char *)addr + (0 .. addrlen - 1)); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns __fc_sockfds[sockfd], \result; assigns __fc_sockfds[sockfd] \from __fc_sockfds[sockfd], (indirect: sockfd), (indirect: addr), (indirect: *addr), (indirect: addrlen); assigns \result \from (indirect: __fc_sockfds[sockfd]), (indirect: sockfd), (indirect: addr), (indirect: *addr), (indirect: addrlen); */ extern int connect(int sockfd, struct sockaddr const *addr, socklen_t addrlen); /*@ requires valid_sockfd: 0 ≤ sockfd < 1024; requires valid_optlen: \valid(optlen); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *((char *)optval + (0 ..)), \result, *optlen; assigns *((char *)optval + (0 ..)) \from (indirect: sockfd), (indirect: level), (indirect: optname), (indirect: *optlen), (indirect: optval), (indirect: __fc_sockfds[sockfd]); assigns \result \from (indirect: sockfd), (indirect: level), (indirect: optname), (indirect: *optlen), (indirect: optval), (indirect: __fc_sockfds[sockfd]); assigns *optlen \from (indirect: sockfd), (indirect: level), (indirect: optname), *optlen, (indirect: optval), (indirect: __fc_sockfds[sockfd]); behavior so_error: assumes optname_is_error: level ≡ 1 ∧ optname ≡ 4; requires valid_optlen: \valid(optlen); requires optlen_value: *optlen ≡ sizeof(int); requires valid_optval: \valid((int *)optval); assigns *((int *)optval), \result; assigns *((int *)optval) \from (indirect: sockfd), (indirect: optlen), (indirect: __fc_sockfds[sockfd]); assigns \result \from (indirect: sockfd), (indirect: optlen), (indirect: __fc_sockfds[sockfd]); behavior other_options: assumes optname_not_error: ¬(level ≡ 1 ∧ optname ≡ 4); requires optval_null_or_valid: optval ≡ \null ∨ \valid((char *)optval + (0 ..)); assigns *((char *)optval + (0 ..)), \result, *optlen; assigns *((char *)optval + (0 ..)) \from (indirect: sockfd), (indirect: level), (indirect: optname), (indirect: *optlen), (indirect: optval), (indirect: __fc_sockfds[sockfd]); assigns \result \from (indirect: sockfd), (indirect: level), (indirect: optname), (indirect: *optlen), (indirect: optval), (indirect: __fc_sockfds[sockfd]); assigns *optlen \from (indirect: sockfd), (indirect: level), (indirect: optname), *optlen, (indirect: optval), (indirect: __fc_sockfds[sockfd]); complete behaviors other_options, so_error; disjoint behaviors other_options, so_error; */ extern int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); /*@ requires valid_sockfd: 0 ≤ sockfd < 1024; ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result, __fc_sockfds[sockfd]; assigns \result \from sockfd, __fc_sockfds[sockfd]; assigns __fc_sockfds[sockfd] \from sockfd, backlog, __fc_sockfds[sockfd]; */ extern int listen(int sockfd, int backlog); /*@ requires valid_sockfd: 0 ≤ sockfd < 1024; requires valid_buffer_length: \valid((char *)buf + (0 .. len - 1)); ensures result_error_or_received_length: \result ≡ -1 ∨ (0 ≤ \result ≤ \old(len)); ensures initialization: \initialized((char *)\old(buf) + (0 .. \result - 1)); assigns *((char *)buf + (0 .. len - 1)), __fc_sockfds[sockfd], \result; assigns *((char *)buf + (0 .. len - 1)) \from sockfd, len, flags, __fc_sockfds[sockfd]; assigns __fc_sockfds[sockfd] \from sockfd, len, flags, __fc_sockfds[sockfd]; assigns \result \from sockfd, len, flags, __fc_sockfds[sockfd]; */ extern ssize_t recv(int sockfd, void *buf, size_t len, int flags); /*@ requires valid_sockfd: 0 ≤ sockfd < 1024; requires msg_control_has_room: \valid((char *)hdr->msg_control + (0 .. hdr->msg_controllen - 1)); requires msg_iov_has_room: \valid(hdr->msg_iov + (0 .. hdr->msg_iovlen - 1)); requires msg_name_null_or_has_room: hdr->msg_name ≡ \null ∨ \valid((char *)hdr->msg_name + (0 .. hdr->msg_namelen - 1)); ensures result_error_or_received_length: \result ≡ -1 ∨ (0 ≤ \result ≤ \old(hdr)->msg_iovlen); assigns *((char *)hdr->msg_name + (0 .. hdr->msg_namelen - 1)), hdr->msg_namelen, *((char *)(hdr->msg_iov + (0 .. hdr->msg_iovlen - 1))->iov_base + (0 ..)), *((char *)hdr->msg_control + (0 .. hdr->msg_controllen - 1)), \result, hdr->msg_controllen, hdr->msg_flags, __fc_sockfds[sockfd]; assigns *((char *)hdr->msg_name + (0 .. hdr->msg_namelen - 1)) \from __fc_sockfds[sockfd]; assigns hdr->msg_namelen \from __fc_sockfds[sockfd]; assigns *((char *)(hdr->msg_iov + (0 .. hdr->msg_iovlen - 1))->iov_base + (0 ..)) \from __fc_sockfds[sockfd]; assigns *((char *)hdr->msg_control + (0 .. hdr->msg_controllen - 1)) \from __fc_sockfds[sockfd]; assigns \result \from __fc_sockfds[sockfd]; assigns hdr->msg_controllen \from __fc_sockfds[sockfd]; assigns hdr->msg_flags \from __fc_sockfds[sockfd]; assigns __fc_sockfds[sockfd] \from __fc_sockfds[sockfd]; */ extern ssize_t recvmsg(int sockfd, struct msghdr *hdr, int flags); /*@ requires available_sockfd: 0 ≤ sockfd < 1024; requires buf_len_ok: \valid_read((char *)buf + (0 .. len - 1)); ensures error_or_chars_sent: \result ≡ -1 ∨ (0 ≤ \result ≤ \old(len)); assigns __fc_errno, __fc_sockfds[sockfd], \result; assigns __fc_errno \from (indirect: sockfd), (indirect: __fc_sockfds[sockfd]), (indirect: *((char *)buf + (0 .. len))), flags; assigns __fc_sockfds[sockfd] \from __fc_sockfds[sockfd], *((char *)buf + (0 .. len)), flags; assigns \result \from (indirect: sockfd), (indirect: __fc_sockfds[sockfd]), (indirect: *((char *)buf + (0 .. len))), (indirect: flags); */ extern ssize_t send(int sockfd, void const *buf, size_t len, int flags); /*@ requires valid_sockfd: 0 ≤ sockfd < 1024; requires optval_null_or_has_room: optval ≡ \null ∨ \valid_read((char *)optval + (0 .. optlen - 1)); ensures result_error_or_ok: \result ≡ 0 ∨ \result ≡ -1; assigns \result, __fc_sockfds[sockfd]; assigns \result \from __fc_sockfds[sockfd], level, optname, *((char *)optval + (0 .. optlen - 1)), optlen; assigns __fc_sockfds[sockfd] \from __fc_sockfds[sockfd], level, optname, *((char *)optval + (0 .. optlen - 1)), optlen; */ extern int setsockopt(int sockfd, int level, int optname, void const *optval, socklen_t optlen); /*@ requires valid_sockfd: 0 ≤ sockfd < 1024; ensures result_error_or_ok: \result ≡ 0 ∨ \result ≡ -1; assigns \result, __fc_sockfds[sockfd]; assigns \result \from how, __fc_sockfds[sockfd]; assigns __fc_sockfds[sockfd] \from how, __fc_sockfds[sockfd]; */ extern int shutdown(int sockfd, int how); /*@ ensures result_error_or_valid_new_sockfd: (0 ≤ \result < 1024) ∨ \result ≡ -1; assigns \result, __fc_socket_counter; assigns \result \from (indirect: domain), (indirect: type), (indirect: protocol), (indirect: __fc_socket_counter); assigns __fc_socket_counter \from (indirect: domain), (indirect: type), (indirect: protocol), __fc_socket_counter; */ extern int socket(int domain, int type, int protocol); /*@ requires valid_socket_sector: \valid(sv + (0 .. 1)); ensures result_error_or_ok: \result ≡ 0 ∨ \result ≡ -1; ensures initialization: sv: \initialized(\old(sv) + (0 .. 1)); ensures valid_new_sockfd: sv0: 0 ≤ *(\old(sv) + 0) < 1024; ensures valid_new_sockfd: sv1: 0 ≤ *(\old(sv) + 1) < 1024; assigns \result, __fc_socket_counter, *(sv + (0 .. 1)); assigns \result \from __fc_socket_counter; assigns __fc_socket_counter \from __fc_socket_counter; assigns *(sv + (0 .. 1)) \from __fc_socket_counter; */ extern int socketpair(int domain, int type, int protocol, int * /*[2]*/ sv); struct in6_addr const in6addr_any = {.s6_addr = {(unsigned char)0}}; struct in6_addr const in6addr_loopback = {.s6_addr = {(unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF, (unsigned char)0xFF}}; /*@ assigns \result; assigns \result \from arg; */ extern uint32_t htonl(uint32_t arg); /*@ assigns \result; assigns \result \from arg; */ extern uint16_t htons(uint16_t arg); /*@ assigns \result; assigns \result \from arg; */ extern uint32_t ntohl(uint32_t arg); /*@ assigns \result; assigns \result \from arg; */ extern uint16_t ntohs(uint16_t arg); /*@ requires valid_arg: valid_read_string(arg); assigns \result; assigns \result \from (indirect: *(arg + (0 ..))); */ extern in_addr_t inet_addr(char const *arg); char volatile __fc_inet_ntoa_array[16]; char *__fc_inet_ntoa = (char *)(__fc_inet_ntoa_array); /*@ ensures result_static_string: \result ≡ __fc_inet_ntoa; ensures result_null_terminated: *(\result + 15) ≡ 0; ensures result_valid_string: valid_read_string(\result); assigns \result, *(__fc_inet_ntoa + (0 ..)); assigns \result \from (indirect: arg), __fc_inet_ntoa; assigns *(__fc_inet_ntoa + (0 ..)) \from (indirect: arg); */ extern char *inet_ntoa(struct in_addr arg); /*@ assigns \result, *(dst + (0 .. size - 1)); assigns \result \from dst, af, *((char *)src + (0 ..)); assigns *(dst + (0 .. size - 1)) \from af, *((char *)src + (0 ..)); */ extern char const *inet_ntop(int af, void const *src, char *dst, socklen_t size); /*@ assigns \result, *((char *)dst + (0 ..)); assigns \result \from af, *(src + (..)); assigns *((char *)dst + (0 ..)) \from af, *(src + (0 ..)); */ extern int inet_pton(int af, char const *src, void *dst); int h_errno; /*@ requires addrinfo_valid: \valid(addrinfo); ensures allocation: \allocable(\old(addrinfo)); assigns \nothing; frees addrinfo; */ extern void freeaddrinfo(struct addrinfo *addrinfo); char *__fc_gai_strerror = (char *)""; /*@ ensures result_string: \result ≡ __fc_gai_strerror; ensures result_valid_string: valid_read_string(\result); assigns \result; assigns \result \from (indirect: errcode), __fc_gai_strerror; */ extern char const *gai_strerror(int errcode); int getaddrinfo(char const * __restrict nodename, char const * __restrict servname, struct addrinfo const * __restrict hints, struct addrinfo ** __restrict res); struct hostent *gethostbyname(char const *name); /*@ predicate non_escaping{L}(void *s, size_t n) = ∀ unsigned int i; 0 ≤ i < n ⇒ ¬\dangling((char *)s + i); */ /*@ predicate empty_block{L}(void *s) = \block_length((char *)s) ≡ 0 ∧ \offset((char *)s) ≡ 0; */ /*@ predicate valid_or_empty{L}(void *s, size_t n) = (empty_block(s) ∨ \valid_read((char *)s)) ∧ \valid((char *)s + (0 .. n - 1)); */ /*@ predicate valid_read_or_empty{L}(void *s, size_t n) = (empty_block(s) ∨ \valid_read((char *)s)) ∧ \valid_read((char *)s + (1 .. n - 1)); */ int memcmp(void const *s1, void const *s2, size_t n); void *memchr(void const *s, int c, size_t n); void *memcpy(void * __restrict dest, void const * __restrict src, size_t n); void *memmove(void *dest, void const *src, size_t n); void *memset(void *s, int c, size_t n); size_t strlen(char const *s); size_t strnlen(char const *s, size_t maxlen); int strcmp(char const *s1, char const *s2); int strncmp(char const *s1, char const *s2, size_t n); /*@ requires valid_string_s1: valid_read_string(s1); requires valid_string_s2: valid_read_string(s2); assigns \result; assigns \result \from (indirect: *(s1 + (0 ..))), (indirect: *(s2 + (0 ..))); */ extern int strcoll(char const *s1, char const *s2); char *strchr(char const *s, int c); char *strrchr(char const *s, int c); /*@ requires valid_string_s: valid_read_string(s); requires valid_string_reject: valid_read_string(reject); ensures result_bounded: 0 ≤ \result ≤ strlen(\old(s)); assigns \result; assigns \result \from (indirect: *(s + (0 ..))), (indirect: *(reject + (0 ..))); */ extern size_t strcspn(char const *s, char const *reject); /*@ requires valid_string_s: valid_read_string(s); requires valid_string_accept: valid_read_string(accept); ensures result_bounded: 0 ≤ \result ≤ strlen(\old(s)); assigns \result, \result; assigns \result \from *(s + (0 ..)), *(accept + (0 ..)); assigns \result \from (indirect: *(s + (0 ..))), (indirect: *(accept + (0 ..))); */ extern size_t strspn(char const *s, char const *accept); /*@ requires valid_string_s: valid_read_string(s); requires valid_string_accept: valid_read_string(accept); ensures result_null_or_same_base: \result ≡ \null ∨ \base_addr(\result) ≡ \base_addr(\old(s)); assigns \result; assigns \result \from s, *(s + (0 ..)), *(accept + (0 ..)); */ extern char *strpbrk(char const *s, char const *accept); char *strstr(char const *haystack, char const *needle); /*@ requires valid_string_haystack: valid_read_string(haystack); requires valid_string_needle: valid_read_string(needle); ensures result_null_or_in_haystack: \result ≡ \null ∨ (\subset(\result, \old(haystack) + (0 ..)) ∧ \valid_read(\result)); assigns \result; assigns \result \from haystack, (indirect: *(haystack + (0 ..))), (indirect: *(needle + (0 ..))); */ extern char *strcasestr(char const *haystack, char const *needle); char *__fc_strtok_ptr; /*@ requires valid_string_delim: valid_read_string(delim); assigns *(s + (0 ..)), *(__fc_strtok_ptr + (0 ..)), \result, __fc_strtok_ptr; assigns *(s + (0 ..)) \from *(s + (0 ..)), (indirect: s), (indirect: __fc_strtok_ptr), (indirect: *(delim + (0 ..))); assigns *(__fc_strtok_ptr + (0 ..)) \from *(__fc_strtok_ptr + (0 ..)), (indirect: s), (indirect: __fc_strtok_ptr), (indirect: *(delim + (0 ..))); assigns \result \from s, __fc_strtok_ptr, (indirect: *(s + (0 ..))), (indirect: *(__fc_strtok_ptr + (0 ..))), (indirect: *(delim + (0 ..))); assigns __fc_strtok_ptr \from \old(__fc_strtok_ptr), s, (indirect: *(__fc_strtok_ptr + (0 ..))), (indirect: *(delim + (0 ..))); behavior new_str: assumes s_not_null: s ≢ \null; requires valid_string_s_or_delim_not_found: valid_string(s) ∨ (valid_read_string(s) ∧ (∀ int i; 0 ≤ i < strlen(delim) ⇒ ¬(strchr(s, *(delim + i)) ≡ \true))); ensures result_subset: \result ≡ \null ∨ \subset(\result, \old(s) + (0 ..)); ensures ptr_subset: \subset(__fc_strtok_ptr, \old(s) + (0 ..)); assigns __fc_strtok_ptr, *(s + (0 ..)), \result; assigns __fc_strtok_ptr \from s, (indirect: *(s + (0 ..))), (indirect: *(delim + (0 ..))); assigns *(s + (0 ..)) \from *(s + (0 ..)), (indirect: s), (indirect: *(delim + (0 ..))); assigns \result \from s, (indirect: *(s + (0 ..))), (indirect: *(delim + (0 ..))); behavior resume_str: assumes s_null: s ≡ \null; requires not_first_call: __fc_strtok_ptr ≢ \null; ensures result_subset: \result ≡ \null ∨ \subset(\result, \old(__fc_strtok_ptr) + (0 ..)); ensures ptr_subset: \subset(__fc_strtok_ptr, \old(__fc_strtok_ptr) + (0 ..)); assigns *(__fc_strtok_ptr + (0 ..)), __fc_strtok_ptr, \result; assigns *(__fc_strtok_ptr + (0 ..)) \from *(__fc_strtok_ptr + (0 ..)), (indirect: __fc_strtok_ptr), (indirect: *(delim + (0 ..))); assigns __fc_strtok_ptr \from \old(__fc_strtok_ptr), (indirect: *(__fc_strtok_ptr + (0 ..))), (indirect: *(delim + (0 ..))); assigns \result \from __fc_strtok_ptr, (indirect: *(__fc_strtok_ptr + (0 ..))), (indirect: *(delim + (0 ..))); complete behaviors resume_str, new_str; disjoint behaviors resume_str, new_str; */ extern char *strtok(char * __restrict s, char const * __restrict delim); /*@ requires valid_string_delim: valid_read_string(delim); requires valid_saveptr: \valid(saveptr); assigns *(s + (0 ..)), *(*saveptr + (0 ..)), \result, *saveptr; assigns *(s + (0 ..)) \from *(s + (0 ..)), (indirect: s), (indirect: *saveptr), (indirect: *(delim + (0 ..))); assigns *(*saveptr + (0 ..)) \from *(*saveptr + (0 ..)), (indirect: s), (indirect: *saveptr), (indirect: *(delim + (0 ..))); assigns \result \from s, *saveptr, (indirect: *(s + (0 ..))), (indirect: *(*saveptr + (0 ..))), (indirect: *(delim + (0 ..))); assigns *saveptr \from \old(*saveptr), s, (indirect: *(*saveptr + (0 ..))), (indirect: *(delim + (0 ..))); behavior new_str: assumes s_not_null: s ≢ \null; requires valid_string_s_or_delim_not_found: valid_string(s) ∨ (valid_read_string(s) ∧ (∀ int i; 0 ≤ i < strlen(delim) ⇒ ¬(strchr(s, *(delim + i)) ≡ \true))); ensures result_subset: \result ≡ \null ∨ \subset(\result, \old(s) + (0 ..)); ensures initialization: \initialized(\old(saveptr)); ensures saveptr_subset: \subset(*\old(saveptr), \old(s) + (0 ..)); assigns *saveptr, *(s + (0 ..)), \result; assigns *saveptr \from s, (indirect: *(s + (0 ..))), (indirect: *(delim + (0 ..))); assigns *(s + (0 ..)) \from *(s + (0 ..)), (indirect: s), (indirect: *(delim + (0 ..))); assigns \result \from s, (indirect: *(s + (0 ..))), (indirect: *(delim + (0 ..))); behavior resume_str: assumes s_null: s ≡ \null; requires not_first_call: *saveptr ≢ \null; requires initialization: saveptr: \initialized(saveptr); ensures result_subset: \result ≡ \null ∨ \subset(\result, \old(*saveptr) + (0 ..)); ensures saveptr_subset: \subset(*\old(saveptr), \old(*saveptr) + (0 ..)); assigns *(*saveptr + (0 ..)), *saveptr, \result; assigns *(*saveptr + (0 ..)) \from *(*saveptr + (0 ..)), (indirect: *saveptr), (indirect: *(delim + (0 ..))); assigns *saveptr \from \old(*saveptr), (indirect: *(*saveptr + (0 ..))), (indirect: *(delim + (0 ..))); assigns \result \from *saveptr, (indirect: *(*saveptr + (0 ..))), (indirect: *(delim + (0 ..))); complete behaviors resume_str, new_str; disjoint behaviors resume_str, new_str; */ extern char *strtok_r(char * __restrict s, char const * __restrict delim, char ** __restrict saveptr); /*@ requires valid_string_stringp: \valid(stringp) ∧ valid_string(*stringp); requires valid_string_delim: valid_read_string(delim); assigns *stringp, \result; assigns *stringp \from *(delim + (..)), *(*(stringp + (..))); assigns \result \from *(delim + (..)), *(*(stringp + (..))); */ extern char *strsep(char **stringp, char const *delim); char __fc_strerror[64]; char * const __fc_p_strerror = __fc_strerror; char *strerror(int errnum); char *strcpy(char *dest, char const *src); char *strncpy(char *dest, char const *src, size_t n); /*@ requires valid_string_src: valid_read_string(src); requires room_nstring: \valid(dest + (0 .. n - 1)); requires separation: \separated( dest + (0 .. n - 1), src + (0 .. \max(n - 1, strlen(src))) ); ensures initialization: \initialized(\old(dest) + (0 .. \min(strlen(\old(src)), \old(n) - 1))); ensures bounded_result: \result ≡ strlen(\old(src)); assigns *(dest + (0 .. n - 1)), \result; assigns *(dest + (0 .. n - 1)) \from *(src + (0 .. n - 1)); assigns \result \from (indirect: src), (indirect: *(src + (0 .. n - 1))), (indirect: n); */ size_t strlcpy(char * __restrict dest, char const * __restrict src, size_t n); /*@ requires valid_string_src: valid_read_string(src); requires room_string: \valid(dest + (0 .. strlen(src))); requires separation: \separated(dest + (0 .. strlen(src)), src + (0 .. strlen(src))); ensures equal_contents: strcmp(\old(dest), \old(src)) ≡ 0; ensures points_to_end: \result ≡ \old(dest) + strlen(\old(dest)); assigns *(dest + (0 .. strlen{Old}(src))), \result; assigns *(dest + (0 .. strlen{Old}(src))) \from *(src + (0 .. strlen{Old}(src))); assigns \result \from dest; */ extern char *stpcpy(char * __restrict dest, char const * __restrict src); char *strcat(char *dest, char const *src); char *strncat(char *dest, char const *src, size_t n); /*@ requires valid_string_src: valid_read_string(src); requires valid_string_dest: valid_string(dest); requires room_nstring: \valid(dest + (0 .. n - 1)); ensures bounded_result: \result ≡ strlen(\old(dest)) + strlen(\old(src)); assigns *(dest + (strlen{Old}(dest) .. n)), \result; assigns *(dest + (strlen{Old}(dest) .. n)) \from (indirect: n), *(src + (0 .. strlen{Old}(src))); assigns \result \from (indirect: src), (indirect: *(src + (0 .. n - 1))), (indirect: n); */ extern size_t strlcat(char * __restrict dest, char const * __restrict src, size_t n); /*@ requires valid_dest: \valid(dest + (0 .. n - 1)); requires valid_string_src: valid_read_string(src); assigns *(dest + (0 .. n - 1)), \result; assigns *(dest + (0 .. n - 1)) \from (indirect: *(src + (0 ..))), (indirect: n); assigns \result \from dest; */ extern size_t strxfrm(char * __restrict dest, char const * __restrict src, size_t n); char *strdup(char const *s); char *strndup(char const *s, size_t n); char __fc_strsignal[64]; char * const __fc_p_strsignal = __fc_strsignal; char *strsignal(int signum); /*@ requires valid_memory_area: \valid((char *)s + (0 .. n - 1)); ensures s_initialized: initialization: \initialized((char *)\old(s) + (0 .. \old(n) - 1)); ensures zero_initialized: \subset(*((char *)\old(s) + (0 .. \old(n) - 1)), {0}); assigns *((char *)s + (0 .. n - 1)); assigns *((char *)s + (0 .. n - 1)) \from \nothing; */ extern void bzero(void *s, size_t n); int strcasecmp(char const *s1, char const *s2); /*@ requires valid_string_s1: valid_read_nstring(s1, n); requires valid_string_s2: valid_read_nstring(s2, n); assigns \result; assigns \result \from (indirect: n), (indirect: *(s1 + (0 .. n - 1))), (indirect: *(s2 + (0 .. n - 1))); */ extern int strncasecmp(char const *s1, char const *s2, size_t n); static unsigned int volatile getaddrinfo_net_state; /*@ requires nodename_string: nodename ≡ \null ∨ valid_read_string(nodename); requires servname_string: servname ≡ \null ∨ valid_read_string(servname); requires hints_option: hints ≡ \null ∨ \valid_read(hints); requires valid_res: \valid(res); assigns *res, \result, __fc_errno; assigns *res \from (indirect: nodename), (indirect: servname), (indirect: hints); assigns \result \from (indirect: nodename), (indirect: servname), (indirect: hints); assigns __fc_errno \from (indirect: nodename), (indirect: servname), (indirect: hints); allocates *\old(res); behavior empty_request: assumes empty: nodename ≡ \null ∧ servname ≡ \null; ensures no_name: \result ≡ -2; assigns \result; assigns \result \from (indirect: nodename), (indirect: servname); behavior normal_request: assumes has_name: nodename ≢ \null ∨ servname ≢ \null; ensures initialization: allocation: success_or_error: (\result ≡ 0 ∧ \fresh{Old, Here}(*\old(res),sizeof(*\old(res))) ∧ \initialized(*\old(res))) ∨ \result ≡ -3 ∨ \result ≡ -1 ∨ \result ≡ -4 ∨ \result ≡ -6 ∨ \result ≡ -10 ∨ \result ≡ -8 ∨ \result ≡ -7 ∨ \result ≡ -11; complete behaviors normal_request, empty_request; disjoint behaviors normal_request, empty_request; */ int getaddrinfo(char const * __restrict nodename, char const * __restrict servname, struct addrinfo const * __restrict hints, struct addrinfo ** __restrict res) { int __retres; if (nodename == (char const *)0) if (servname == (char const *)0) { __retres = -2; goto return_label; } switch (getaddrinfo_net_state) { case (unsigned int)0: __retres = -1; goto return_label; case (unsigned int)1: __retres = -3; goto return_label; case (unsigned int)2: __retres = -4; goto return_label; case (unsigned int)3: __retres = -6; goto return_label; case (unsigned int)5: __retres = -8; goto return_label; case (unsigned int)6: __retres = -7; goto return_label; case (unsigned int)7: { __fc_errno = 5; __retres = -11; goto return_label; } default: { struct addrinfo *tmp_0; struct sockaddr *tmp_2; int tmp_3; struct addrinfo *ai = malloc(sizeof(*tmp_0)); if (! ai) { __retres = -10; goto return_label; } struct sockaddr *sa = malloc(sizeof(*tmp_2)); if (! sa) { __retres = -10; goto return_label; } tmp_3 = Frama_C_interval(0,43); sa->sa_family = (unsigned short)tmp_3; /*@ slevel 15; */ { int i = 0; while (i < 14) { { int tmp_4; tmp_4 = Frama_C_interval(-128,127); sa->sa_data[i] = (char)tmp_4; } i ++; } } /*@ slevel default; */ ai->ai_flags = 0; ai->ai_family = (int)sa->sa_family; ai->ai_socktype = Frama_C_interval(0,5); ai->ai_protocol = Frama_C_interval(0,IPPROTO_MAX); ai->ai_addrlen = sizeof(*sa); ai->ai_addr = sa; ai->ai_canonname = (char *)"dummy"; ai->ai_next = (struct addrinfo *)0; *res = ai; __retres = 0; goto return_label; } } return_label: return __retres; } struct __fc_gethostbyname __fc_ghbn; int res_search(char const *dname, int class, int type, char *answer, int anslen) { int tmp; { int i = 0; while (i < anslen - 1) { *(answer + i) = Frama_C_char_interval((char)(-128),(char)127); i ++; } } *(answer + (anslen - 1)) = (char)0; tmp = Frama_C_interval(-1,anslen); return tmp; } struct hostent *gethostbyname(char const *name) { struct hostent *__retres; char buf[128]; char const *cp; int n; int tmp; __fc_ghbn.host.h_addrtype = 2; __fc_ghbn.host.h_length = (int)sizeof(struct in_addr); if ((int)*name >= '0') if ((int)*name <= '9') { cp = name; while (1) { if (! *cp) { struct in_addr addr; cp --; ; if ((int)*cp == '.') break; addr.s_addr = inet_addr(name); if (addr.s_addr == 0xffffffff) { __retres = (struct hostent *)0; goto return_label; } memcpy((void *)(__fc_ghbn.host_addr),(void const *)(& addr), (unsigned int)__fc_ghbn.host.h_length); strncpy(__fc_ghbn.hostbuf,name,(unsigned int)(128 - 1)); __fc_ghbn.hostbuf[128 - 1] = (char)'\000'; __fc_ghbn.host.h_name = __fc_ghbn.hostbuf; __fc_ghbn.host.h_aliases = __fc_ghbn.host_aliases; __fc_ghbn.host_aliases[0] = (char *)0; __fc_ghbn.h_addr_ptrs[0] = (char *)(__fc_ghbn.host_addr); __fc_ghbn.h_addr_ptrs[1] = (char *)0; __fc_ghbn.host.h_addr_list = __fc_ghbn.h_addr_ptrs; __retres = & __fc_ghbn.host; goto return_label; } if ((int)*cp < '0') if ((int)*cp > '9') if ((int)*cp != '.') break; cp ++; } } n = res_search(name,1,1,buf,(int)sizeof(buf)); if (n < 0) { __retres = (struct hostent *)0; goto return_label; } tmp = Frama_C_nondet(0,1); if (tmp) { __retres = (struct hostent *)0; goto return_label; } else { struct in_addr addr_0; addr_0.s_addr = inet_addr(name); memcpy((void *)(__fc_ghbn.host_addr),(void const *)(& addr_0), (unsigned int)__fc_ghbn.host.h_length); strncpy(__fc_ghbn.hostbuf,name,(unsigned int)(128 - 1)); __fc_ghbn.hostbuf[128 - 1] = (char)'\000'; __fc_ghbn.host.h_name = __fc_ghbn.hostbuf; __fc_ghbn.host.h_aliases = __fc_ghbn.host_aliases; __fc_ghbn.host_aliases[0] = (char *)0; __fc_ghbn.h_addr_ptrs[0] = (char *)(__fc_ghbn.host_addr); __fc_ghbn.h_addr_ptrs[1] = (char *)0; __fc_ghbn.host.h_addr_list = __fc_ghbn.h_addr_ptrs; __retres = & __fc_ghbn.host; goto return_label; } return_label: return __retres; } FILE *__fc_stderr; FILE *__fc_stdin; FILE *__fc_stdout; /*@ requires valid_filename: valid_read_string(filename); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: *(filename + (0 .. strlen{Old}(filename)))); */ extern int remove(char const *filename); /*@ requires valid_old_name: valid_read_string(old_name); requires valid_new_name: valid_read_string(new_name); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: *(old_name + (0 .. strlen{Old}(old_name)))), (indirect: *(new_name + (0 .. strlen{Old}(new_name)))); */ extern int rename(char const *old_name, char const *new_name); FILE __fc_fopen[16]; FILE * const __fc_p_fopen = __fc_fopen; /*@ ensures result_null_or_valid_fd: \result ≡ \null ∨ \subset(\result, &__fc_fopen[0 .. 16 - 1]); assigns \result; assigns \result \from __fc_p_fopen; */ extern FILE *tmpfile(void); char __fc_tmpnam[2048]; char * const __fc_p_tmpnam = __fc_tmpnam; /*@ requires valid_s_or_null: s ≡ \null ∨ \valid(s + (0 .. 2048)); ensures result_string_or_null: \result ≡ \null ∨ \result ≡ \old(s) ∨ \result ≡ __fc_p_tmpnam; assigns *(__fc_p_tmpnam + (0 .. 2048)), *(s + (0 .. 2048)), \result; assigns *(__fc_p_tmpnam + (0 .. 2048)) \from *(__fc_p_tmpnam + (0 .. 2048)), (indirect: s); assigns *(s + (0 .. 2048)) \from (indirect: s), *(__fc_p_tmpnam + (0 .. 2048)); assigns \result \from s, __fc_p_tmpnam; */ extern char *tmpnam(char *s); /*@ requires valid_stream: \valid(stream); ensures result_zero_or_EOF: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: stream), (indirect: *stream); */ extern int fclose(FILE *stream); /*@ requires null_or_valid_stream: stream ≡ \null ∨ \valid_read(stream); ensures result_zero_or_EOF: \result ≡ 0 ∨ \result ≡ -1; assigns \result, *stream, __fc_fopen[0 .. 16 - 1]; assigns \result \from (indirect: *stream), (indirect: __fc_fopen[0 .. 16 - 1]); assigns *stream \from (indirect: stream), *stream, __fc_fopen[0 .. 16 - 1]; assigns __fc_fopen[0 .. 16 - 1] \from (indirect: stream), *stream, __fc_fopen[0 .. 16 - 1]; behavior flush_all: assumes all_streams: stream ≡ \null; assigns __fc_fopen[0 .. 16 - 1], \result; assigns __fc_fopen[0 .. 16 - 1] \from __fc_fopen[0 .. 16 - 1]; assigns \result \from (indirect: __fc_fopen[0 .. 16 - 1]); behavior flush_stream: assumes single_stream: stream ≢ \null; assigns *stream, \result; assigns *stream \from *stream; assigns \result \from (indirect: *stream); complete behaviors flush_stream, flush_all; disjoint behaviors flush_stream, flush_all; */ extern int fflush(FILE *stream); /*@ requires valid_filename: valid_read_string(filename); requires valid_mode: valid_read_string(mode); ensures result_null_or_valid_fd: \result ≡ \null ∨ \subset(\result, &__fc_fopen[0 .. 16 - 1]); assigns \result; assigns \result \from (indirect: *(filename + (0 .. strlen{Old}(filename)))), (indirect: *(mode + (0 .. strlen{Old}(mode)))), __fc_p_fopen; */ extern FILE *fopen(char const * __restrict filename, char const * __restrict mode); /*@ requires valid_mode: valid_read_string(mode); ensures result_null_or_valid_fd: \result ≡ \null ∨ \subset(\result, &__fc_fopen[0 .. 16 - 1]); assigns \result, __fc_fopen[fd]; assigns \result \from (indirect: fd), (indirect: *(mode + (0 .. strlen{Old}(mode)))), (indirect: __fc_fopen[fd]), __fc_p_fopen; assigns __fc_fopen[fd] \from (indirect: fd), (indirect: *(mode + (0 .. strlen{Old}(mode)))), (indirect: __fc_fopen[fd]), __fc_p_fopen; */ extern FILE *fdopen(int fd, char const *mode); /*@ requires valid_filename: valid_read_string(filename); requires valid_mode: valid_read_string(mode); requires valid_stream: \valid(stream); ensures result_null_or_valid_fd: \result ≡ \null ∨ \result ∈ &__fc_fopen[0 .. 16 - 1]; ensures stream_opened: *\old(stream) ∈ __fc_fopen[0 .. 16 - 1]; assigns \result, *stream; assigns \result \from (indirect: *(filename + (..))), (indirect: *(mode + (..))), __fc_p_fopen, (indirect: stream); assigns *stream \from (indirect: *(filename + (..))), (indirect: *(mode + (..))), __fc_p_fopen, (indirect: stream); */ extern FILE *freopen(char const * __restrict filename, char const * __restrict mode, FILE * __restrict stream); /*@ assigns *stream; assigns *stream \from buf; */ extern void setbuf(FILE * __restrict stream, char * __restrict buf); /*@ assigns *stream; assigns *stream \from buf, mode, size; */ extern int setvbuf(FILE * __restrict stream, char * __restrict buf, int mode, size_t size); /*@ axiomatic format_length { logic ℤ format_length{L}(char *format) ; } */ /*@ assigns *stream; assigns *stream \from *(format + (..)), arg; */ extern int vfprintf(FILE * __restrict stream, char const * __restrict format, va_list arg); /*@ assigns *stream; assigns *stream \from *(format + (..)), *stream; */ extern int vfscanf(FILE * __restrict stream, char const * __restrict format, va_list arg); /*@ assigns *__fc_stdout; assigns *__fc_stdout \from arg; */ extern int vprintf(char const * __restrict format, va_list arg); /*@ assigns *__fc_stdin; assigns *__fc_stdin \from *(format + (..)); */ extern int vscanf(char const * __restrict format, va_list arg); /*@ assigns *(s + (0 .. n - 1)); assigns *(s + (0 .. n - 1)) \from *(format + (..)), arg; */ extern int vsnprintf(char * __restrict s, size_t n, char const * __restrict format, va_list arg); /*@ assigns *(s + (0 ..)); assigns *(s + (0 ..)) \from *(format + (..)), arg; */ extern int vsprintf(char * __restrict s, char const * __restrict format, va_list arg); /*@ requires valid_stream: \valid(stream); ensures result_uchar_or_eof: (0 ≤ \result ≤ 255) ∨ \result ≡ -1; assigns *stream, \result; assigns *stream \from *stream; assigns \result \from (indirect: *stream); */ extern int fgetc(FILE *stream); /*@ requires valid_stream: \valid(stream); requires room_s: \valid(s + (0 .. size - 1)); ensures result_null_or_same: \result ≡ \null ∨ \result ≡ \old(s); ensures initialization: at_least_one: \result ≢ \null ⇒ \initialized(\old(s) + 0); ensures terminated_string_on_success: \result ≢ \null ⇒ valid_string(\old(s)); assigns *(s + (0 .. size - 1)), \result; assigns *(s + (0 .. size - 1)) \from (indirect: size), (indirect: *stream); assigns \result \from s, (indirect: size), (indirect: *stream); */ extern char *fgets(char * __restrict s, int size, FILE * __restrict stream); /*@ requires valid_stream: \valid(stream); assigns *stream, \result; assigns *stream \from c, *stream; assigns \result \from (indirect: *stream); */ extern int fputc(int c, FILE *stream); /*@ requires valid_string_s: valid_read_string(s); assigns *stream, \result; assigns *stream \from *(s + (0 .. strlen{Old}(s))), *stream; assigns \result \from (indirect: *(s + (0 .. strlen{Old}(s)))), (indirect: *stream); */ extern int fputs(char const * __restrict s, FILE * __restrict stream); /*@ requires valid_stream: \valid(stream); assigns \result, *stream; assigns \result \from *stream; assigns *stream \from *stream; */ extern int getc(FILE *stream); /*@ assigns \result, *__fc_stdin; assigns \result \from *__fc_stdin; assigns *__fc_stdin \from *__fc_stdin; */ extern int getchar(void); /*@ axiomatic GetsLength { logic size_t gets_length{L} reads *__fc_stdin; } */ /*@ requires room_s: \valid(s + (0 .. gets_length)); ensures result_null_or_same: \result ≡ \old(s) ∨ \result ≡ \null; assigns *(s + (0 .. gets_length{Old})), \result, *__fc_stdin; assigns *(s + (0 .. gets_length{Old})) \from *__fc_stdin; assigns \result \from s, *__fc_stdin; assigns *__fc_stdin \from *__fc_stdin; */ extern char *gets(char *s); /*@ requires valid_stream: \valid(stream); assigns *stream, \result; assigns *stream \from c, *stream; assigns \result \from (indirect: *stream); */ extern int putc(int c, FILE *stream); /*@ assigns *__fc_stdout, \result; assigns *__fc_stdout \from c, *__fc_stdout; assigns \result \from (indirect: *__fc_stdout); */ extern int putchar(int c); /*@ requires valid_string_s: valid_read_string(s); assigns *__fc_stdout, \result; assigns *__fc_stdout \from *(s + (0 .. strlen{Old}(s))), *__fc_stdout; assigns \result \from (indirect: *(s + (0 .. strlen{Old}(s)))), (indirect: *__fc_stdout); */ extern int puts(char const *s); /*@ requires valid_stream: \valid(stream); ensures result_ok_or_error: \result ≡ \old(c) ∨ \result ≡ -1; assigns *stream, \result; assigns *stream \from (indirect: c); assigns \result \from (indirect: c), (indirect: *stream); */ extern int ungetc(int c, FILE *stream); /*@ requires valid_ptr_block: \valid((char *)ptr + (0 .. nmemb * size - 1)); requires valid_stream: \valid(stream); ensures size_read: \result ≤ \old(nmemb); ensures initialization: \initialized((char *)\old(ptr) + (0 .. \result * \old(size) - 1)); assigns *((char *)ptr + (0 .. nmemb * size - 1)), *stream, \result; assigns *((char *)ptr + (0 .. nmemb * size - 1)) \from (indirect: size), (indirect: nmemb), (indirect: *stream); assigns *stream \from (indirect: size), (indirect: nmemb), (indirect: *stream); assigns \result \from size, (indirect: *stream); */ extern size_t fread(void * __restrict ptr, size_t size, size_t nmemb, FILE * __restrict stream); /*@ requires valid_ptr_block: \valid_read((char *)ptr + (0 .. nmemb * size - 1)); requires valid_stream: \valid(stream); ensures size_written: \result ≤ \old(nmemb); assigns *stream, \result; assigns *stream \from (indirect: *((char *)ptr + (0 .. nmemb * size - 1))); assigns \result \from (indirect: *((char *)ptr + (0 .. nmemb * size - 1))); */ extern size_t fwrite(void const * __restrict ptr, size_t size, size_t nmemb, FILE * __restrict stream); /*@ requires valid_stream: \valid(stream); requires valid_pos: \valid(pos); requires initialization: pos: \initialized(pos); assigns *pos, \result; assigns *pos \from (indirect: *stream); assigns \result \from (indirect: *stream); */ extern int fgetpos(FILE * __restrict stream, fpos_t * __restrict pos); /*@ requires valid_stream: \valid(stream); requires whence_enum: whence ≡ 0 ∨ whence ≡ 1 ∨ whence ≡ 2; assigns *stream, \result, __fc_errno; assigns *stream \from *stream, (indirect: offset), (indirect: whence); assigns \result \from (indirect: *stream), (indirect: offset), (indirect: whence); assigns __fc_errno \from (indirect: *stream), (indirect: offset), (indirect: whence); */ extern int fseek(FILE *stream, long offset, int whence); /*@ requires valid_stream: \valid(stream); requires valid_pos: \valid_read(pos); requires initialization: pos: \initialized(pos); assigns *stream; assigns *stream \from *pos; */ extern int fsetpos(FILE *stream, fpos_t const *pos); /*@ requires valid_stream: \valid(stream); ensures success_or_error: \result ≡ -1 ∨ (\result ≥ 0 ∧ __fc_errno ≡ \old(__fc_errno)); assigns \result, __fc_errno; assigns \result \from (indirect: *stream); assigns __fc_errno \from (indirect: *stream); */ extern long ftell(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns *stream; assigns *stream \from \nothing; */ extern void rewind(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns *stream; assigns *stream \from \nothing; */ extern void clearerr(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result; assigns \result \from (indirect: *stream); */ extern int feof(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result; assigns \result \from (indirect: *stream); */ extern int fileno(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns *stream; assigns *stream \from \nothing; */ extern void flockfile(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns *stream; assigns *stream \from \nothing; */ extern void funlockfile(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result, *stream; assigns \result \from \nothing; assigns *stream \from \nothing; */ extern int ftrylockfile(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result; assigns \result \from (indirect: *stream); */ extern int ferror(FILE *stream); /*@ requires valid_string_s: valid_read_string(s); assigns __fc_stdout; assigns __fc_stdout \from __fc_errno, *(s + (0 .. strlen{Old}(s))); */ extern void perror(char const *s); /*@ requires valid_stream: \valid(stream); assigns \result, *stream; assigns \result \from *stream; assigns *stream \from *stream; */ extern int getc_unlocked(FILE *stream); /*@ assigns \result; assigns \result \from *__fc_stdin; */ extern int getchar_unlocked(void); /*@ requires valid_stream: \valid(stream); assigns *stream, \result; assigns *stream \from c; assigns \result \from (indirect: *stream); */ extern int putc_unlocked(int c, FILE *stream); /*@ assigns *__fc_stdout, \result; assigns *__fc_stdout \from c; assigns \result \from (indirect: *__fc_stdout); */ extern int putchar_unlocked(int c); /*@ requires valid_stream: \valid(stream); assigns *stream; assigns *stream \from \nothing; */ extern void clearerr_unlocked(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result; assigns \result \from (indirect: *stream); */ extern int feof_unlocked(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result; assigns \result \from (indirect: *stream); */ extern int ferror_unlocked(FILE *stream); /*@ requires valid_stream: \valid(stream); assigns \result; assigns \result \from (indirect: *stream); */ extern int fileno_unlocked(FILE *stream); /*@ axiomatic pipe_streams { predicate is_open_pipe{L}(FILE *stream) ; } */ /*@ requires valid_command: valid_read_string(command); requires valid_type: valid_read_string(type); ensures result_error_or_valid_open_pipe: \result ≡ \null ∨ (\subset(\result, &__fc_fopen[0 .. 16 - 1]) ∧ is_open_pipe(\result)); assigns \result, __fc_fopen[0 ..]; assigns \result \from (indirect: *command), (indirect: *type), __fc_p_fopen; assigns __fc_fopen[0 ..] \from (indirect: *command), (indirect: *type), __fc_fopen[0 ..]; */ extern FILE *popen(char const *command, char const *type); /*@ requires valid_stream: \valid(stream); requires open_pipe: is_open_pipe(stream); ensures closed_stream: ¬is_open_pipe(\old(stream)); assigns \result; assigns \result \from (indirect: *stream); */ extern int pclose(FILE *stream); ssize_t getline(char **lineptr, size_t *n, FILE *stream); FILE __fc_initial_stdout = {.__fc_FILE_id = (unsigned int)1, .__fc_FILE_data = 0U}; FILE *__fc_stdout = & __fc_initial_stdout; FILE __fc_initial_stderr = {.__fc_FILE_id = (unsigned int)2, .__fc_FILE_data = 0U}; FILE *__fc_stderr = & __fc_initial_stderr; FILE __fc_initial_stdin = {.__fc_FILE_id = (unsigned int)0, .__fc_FILE_data = 0U}; FILE *__fc_stdin = & __fc_initial_stdin; ssize_t getline(char **lineptr, size_t *n, FILE *stream) { ssize_t __retres; int tmp; if (! lineptr) goto _LOR; else if (! n) goto _LOR; else if (! stream) { _LOR: { __fc_errno = 22; __retres = -1; goto return_label; } } tmp = ferror(stream); if (tmp) goto _LOR_0; else { int tmp_0; tmp_0 = feof(stream); if (tmp_0) { _LOR_0: { __retres = -1; goto return_label; } } } if (! *lineptr) goto _LOR_1; else if (*n == (size_t)0) { _LOR_1: { *lineptr = (char *)malloc((unsigned int)2); if (! lineptr) { __fc_errno = 12; __retres = -1; goto return_label; } *n = (unsigned int)2; } } size_t cur = (unsigned int)0; while (1) { int tmp_3; tmp_3 = ferror(stream); if (tmp_3) break; else { int tmp_4; tmp_4 = feof(stream); if (tmp_4) break; } { while (cur < *n - (size_t)1) { int tmp_1; tmp_1 = fgetc(stream); char c = (char)tmp_1; if ((int)c == -1) if (cur == (size_t)0) { __retres = -1; goto return_label; } if ((int)c != -1) { size_t tmp_2; tmp_2 = cur; cur += (size_t)1; *(*lineptr + tmp_2) = c; } if ((int)c == '\n') goto _LOR_2; else if ((int)c == -1) { _LOR_2: { *(*lineptr + cur) = (char)'\000'; __retres = (int)cur; goto return_label; } } } if (*n == (size_t)2147483647) { __fc_errno = 75; __retres = -1; goto return_label; } size_t new_size = *n + (size_t)1; *lineptr = (char *)realloc((void *)*lineptr,new_size); if (! *lineptr) { __fc_errno = 12; __retres = -1; goto return_label; } *n = new_size; } } __retres = -1; return_label: return __retres; } /*@ requires abs_representable: i > -2147483647 - 1; assigns \result; assigns \result \from i; behavior negative: assumes negative: i < 0; ensures opposite_result: \result ≡ -\old(i); behavior nonnegative: assumes nonnegative: i ≥ 0; ensures same_result: \result ≡ \old(i); complete behaviors nonnegative, negative; disjoint behaviors nonnegative, negative; */ int abs(int i) { int __retres; if (i < 0) { __retres = - i; goto return_label; } __retres = i; return_label: return __retres; } /*@ requires valid_nptr: \valid_read(p); assigns \result; assigns \result \from (indirect: p), (indirect: *(p + (0 ..))); */ int atoi(char const *p) { int __retres; int n; int c; int tmp_1; int tmp_3; int neg = 0; unsigned char *up = (unsigned char *)p; c = (int)*up; tmp_1 = isdigit(c); if (! tmp_1) { int tmp_0; while (1) { int tmp; tmp = isspace(c); if (! tmp) break; up ++; c = (int)*up; } switch (c) { case '-': neg ++; case '+': { /* sequence */ up ++; c = (int)*up; } } tmp_0 = isdigit(c); if (! tmp_0) { __retres = 0; goto return_label; } } n = '0' - c; while (1) { int tmp_2; up ++; c = (int)*up; tmp_2 = isdigit(c); if (! tmp_2) break; n *= 10; n += '0' - c; } if (neg) tmp_3 = n; else tmp_3 = - n; __retres = tmp_3; return_label: return __retres; } /*@ assigns __fc_heap_status, \result; assigns __fc_heap_status \from (indirect: nmemb), (indirect: size), __fc_heap_status; assigns \result \from (indirect: nmemb), (indirect: size), (indirect: __fc_heap_status); allocates \result; behavior allocation: assumes can_allocate: is_allocable(nmemb * size); ensures allocation: \fresh{Old, Here}(\result,\old(nmemb) * \old(size)); ensures initialization: \initialized((char *)\result + (0 .. \old(nmemb) * \old(size) - 1)); ensures zero_initialization: \subset(*((char *)\result + (0 .. \old(nmemb) * \old(size) - 1)), {0}); behavior no_allocation: assumes cannot_allocate: ¬is_allocable(nmemb * size); ensures null_result: \result ≡ \null; assigns \result; assigns \result \from \nothing; allocates \nothing; complete behaviors no_allocation, allocation; disjoint behaviors no_allocation, allocation; */ void *calloc(size_t nmemb, size_t size) { void *__retres; size_t l = nmemb * size; if (size != (size_t)0) if (l / size != nmemb) { __retres = (void *)0; goto return_label; } char *p = malloc(l); if (p) memset((void *)p,0,l); __retres = (void *)p; return_label: return __retres; } static char __fc_env_strings[64]; static char __fc_initenv_init; static void __fc_initenv(void) { if (! __fc_initenv_init) { Frama_C_make_unknown(__fc_env_strings,(unsigned int)(64 - 1)); { int i = 0; while (i < 4096) { { int tmp; tmp = Frama_C_interval(0,64 - 1); __fc_env[i] = & __fc_env_strings[tmp]; } i ++; } } __fc_initenv_init = (char)1; } return; } /*@ requires valid_name: valid_read_string(name); ensures null_or_valid_result: \result ≡ \null ∨ \valid(\result); assigns \result; assigns \result \from __fc_env[0 ..], (indirect: name), *(name + (0 ..)); */ char *getenv(char const *name) { char *__retres; int tmp_0; /*@ assert ¬(strchr(name, '=') ≡ \true); */ ; __fc_initenv(); tmp_0 = Frama_C_nondet(0,1); if (tmp_0) { int tmp; tmp = Frama_C_interval(0,4096 - 1); ; __retres = __fc_env[tmp]; goto return_label; } else { __retres = (char *)0; goto return_label; } return_label: return __retres; } /*@ requires valid_string: valid_read_string(string); assigns __fc_env[0 ..], \result; assigns __fc_env[0 ..] \from __fc_env[0 ..], string; assigns \result \from (indirect: __fc_env[0 ..]), (indirect: string); */ int putenv(char *string) { int __retres; int tmp_3; char *separator = strchr((char const *)string,'='); /*@ assert string_contains_separator: separator ≢ \null; */ ; /*@ assert name_is_not_empty: separator ≢ string; */ ; __fc_initenv(); tmp_3 = Frama_C_nondet(0,1); if (tmp_3) { int tmp_1; int tmp_2; tmp_1 = Frama_C_nondet(0,1); if (tmp_1) { int tmp_0; tmp_0 = Frama_C_interval(-2147483647 - 1,2147483647); __retres = tmp_0; goto return_label; } tmp_2 = Frama_C_interval(0,4096 - 1); __fc_env[tmp_2] = string; } __retres = 0; return_label: return __retres; } /*@ requires valid_name: valid_read_string(name); requires valid_value: valid_read_string(value); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result, __fc_env[0 ..]; assigns \result \from __fc_env[0 ..], (indirect: name), (indirect: *(name + (0 ..))), (indirect: value), (indirect: *(value + (0 ..))), (indirect: overwrite); assigns __fc_env[0 ..] \from __fc_env[0 ..], (indirect: name), (indirect: *(name + (0 ..))), (indirect: value), (indirect: *(value + (0 ..))), (indirect: overwrite); */ int setenv(char const *name, char const *value, int overwrite) { int __retres; char *tmp; int tmp_4; tmp = strchr(name,'='); if (tmp) { __retres = -1; goto return_label; } size_t namelen = strlen(name); if (namelen == (size_t)0) { __retres = -1; goto return_label; } __fc_initenv(); tmp_4 = Frama_C_nondet(0,1); if (tmp_4) { __retres = -1; goto return_label; } else { int tmp_1; int tmp_2; int tmp_3; tmp_1 = Frama_C_nondet(0,1); if (tmp_1) Frama_C_make_unknown(__fc_env_strings,(unsigned int)(64 - 1)); tmp_2 = Frama_C_interval(0,4096 - 1); tmp_3 = Frama_C_interval(0,64 - 1); __fc_env[tmp_2] = & __fc_env_strings[tmp_3]; __retres = 0; goto return_label; } return_label: return __retres; } /*@ requires valid_name: valid_read_string(name); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result, __fc_env[0 ..]; assigns \result \from __fc_env[0 ..], (indirect: name), (indirect: *(name + (0 ..))); assigns __fc_env[0 ..] \from __fc_env[0 ..], (indirect: name), (indirect: *(name + (0 ..))); */ int unsetenv(char const *name) { int __retres; char *tmp; int tmp_2; tmp = strchr(name,'='); if (tmp) { __retres = -1; goto return_label; } size_t namelen = strlen(name); if (namelen == (size_t)0) { __retres = -1; goto return_label; } __fc_initenv(); tmp_2 = Frama_C_nondet(0,1); if (tmp_2) { int tmp_1; tmp_1 = Frama_C_interval(0,4096 - 1); __fc_env[tmp_1] = (char *)0; } __retres = 0; return_label: return __retres; } /*@ requires valid_memptr: \valid(memptr); requires alignment_is_a_suitable_power_of_two: alignment ≥ sizeof(void *) ∧ ((size_t)alignment & ((size_t)alignment - 1)) ≡ 0; assigns __fc_heap_status, \result; assigns __fc_heap_status \from (indirect: alignment), size, __fc_heap_status; assigns \result \from (indirect: alignment), (indirect: size), (indirect: __fc_heap_status); allocates *\old(memptr); behavior allocation: assumes can_allocate: is_allocable(size); ensures allocation: \fresh{Old, Here}(*\old(memptr),\old(size)); ensures result_zero: \result ≡ 0; assigns __fc_heap_status, \result; assigns __fc_heap_status \from (indirect: alignment), size, __fc_heap_status; assigns \result \from (indirect: alignment), (indirect: size), (indirect: __fc_heap_status); behavior no_allocation: assumes cannot_allocate: ¬is_allocable(size); ensures result_non_zero: \result < 0 ∨ \result > 0; assigns \result; assigns \result \from (indirect: alignment); allocates \nothing; complete behaviors no_allocation, allocation; disjoint behaviors no_allocation, allocation; */ int posix_memalign(void **memptr, size_t alignment, size_t size) { int __retres; /*@ assert alignment_is_a_suitable_power_of_two: alignment ≥ sizeof(void *) ∧ ((size_t)alignment & ((size_t)alignment - 1)) ≡ 0; */ ; *memptr = malloc(size); if (! *memptr) { __retres = 12; goto return_label; } __retres = 0; return_label: return __retres; } /*@ requires valid_dest: valid_or_empty(dest, n); requires valid_src: valid_read_or_empty(src, n); requires separation: \separated((char *)dest + (0 .. n - 1), (char *)src + (0 .. n - 1)); ensures copied_contents: memcmp{Post, Pre}((char *)\old(dest), (char *)\old(src), \old(n)) ≡ 0; ensures result_ptr: \result ≡ \old(dest); assigns *((char *)dest + (0 .. n - 1)), \result; assigns *((char *)dest + (0 .. n - 1)) \from *((char *)src + (0 .. n - 1)); assigns \result \from dest; */ void *memcpy(void * __restrict dest, void const * __restrict src, size_t n) { { size_t i = (unsigned int)0; /*@ loop invariant no_eva: 0 ≤ i ≤ n; loop invariant no_eva: ∀ ℤ k; 0 ≤ k < i ⇒ *((char *)dest + k) ≡ *((char *)src + k); loop assigns i, *((char *)dest + (0 .. n - 1)); loop variant n - i; */ while (i < n) { *((char *)dest + i) = *((char *)src + i); i += (size_t)1; } } return dest; } /*@ assigns \result; assigns \result \from (indirect: p), (indirect: q), (indirect: n); behavior separated: assumes separation: no_overlap: \separated(p + (0 .. n - 1), q + (0 .. n - 1)); ensures result_no_overlap: \result ≡ 0; behavior not_separated_lt: assumes separation: overlap: ¬\separated(p + (0 .. n - 1), q + (0 .. n - 1)); assumes p_before_q: p ≤ q < p + n; ensures result_p_before_q: \result ≡ -1; behavior not_separated_gt: assumes separation: overlap: ¬\separated(p + (0 .. n - 1), q + (0 .. n - 1)); assumes p_after_q: q < p ≤ q + n; ensures result_p_after_q: \result ≡ 1; complete behaviors not_separated_gt, not_separated_lt, separated; disjoint behaviors not_separated_gt, not_separated_lt, separated; */ static int memoverlap(char const *p, char const *q, size_t n) { int __retres; uintptr_t p1 = (unsigned int)p; uintptr_t p2 = (unsigned int)(p + n); uintptr_t q1 = (unsigned int)q; uintptr_t q2 = (unsigned int)(q + n); if (p1 <= q1) { if (p2 > q1) { __retres = -1; goto return_label; } else goto _LAND; } else { _LAND: ; if (q1 <= p1) if (q2 > p1) { __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } } return_label: return __retres; } /*@ requires valid_dest: valid_or_empty(dest, n); requires valid_src: valid_read_or_empty(src, n); ensures copied_contents: memcmp{Post, Pre}((char *)\old(dest), (char *)\old(src), \old(n)) ≡ 0; ensures result_ptr: \result ≡ \old(dest); assigns *((char *)dest + (0 .. n - 1)), \result; assigns *((char *)dest + (0 .. n - 1)) \from *((char *)src + (0 .. n - 1)); assigns \result \from dest; */ void *memmove(void *dest, void const *src, size_t n) { void *__retres; int tmp; if (n == (size_t)0) { __retres = dest; goto return_label; } char *s = (char *)src; char *d = (char *)dest; tmp = memoverlap((char const *)dest,(char const *)src,n); if (tmp <= 0) { size_t i = (unsigned int)0; /*@ loop invariant no_eva: 0 ≤ i ≤ n; loop invariant no_eva: ∀ ℤ k; 0 ≤ k < i ⇒ *((char *)dest + k) ≡ \at(*((char *)src + k),LoopEntry); loop invariant no_eva: ∀ ℤ k; i ≤ k < n ⇒ *((char *)src + k) ≡ \at(*((char *)src + k),LoopEntry); loop assigns i, *((char *)dest + (0 .. n - 1)); loop variant n - i; */ while (i < n) { *(d + i) = *(s + i); i += (size_t)1; } } else { { size_t i_0 = n - (size_t)1; /*@ loop invariant no_eva: 0 ≤ i_0 < n; loop invariant no_eva: ∀ ℤ k; i_0 < k < n ⇒ *((char *)dest + k) ≡ \at(*((char *)src + k),LoopEntry); loop invariant no_eva: ∀ ℤ k; 0 ≤ k ≤ i_0 ⇒ *((char *)src + k) ≡ \at(*((char *)src + k),LoopEntry); loop assigns i_0, *((char *)dest + (0 .. n - 1)); loop variant i_0; */ while (i_0 > (size_t)0) { *(d + i_0) = *(s + i_0); i_0 -= (size_t)1; } } *(d + 0) = *(s + 0); } __retres = dest; return_label: return __retres; } /*@ requires valid_string_s: valid_read_string(s); ensures acsl_c_equiv: \result ≡ strlen(\old(s)); assigns \result; assigns \result \from (indirect: *(s + (0 ..))); */ size_t strlen(char const *s) { size_t i; i = (unsigned int)0; while ((int)*(s + i) != 0) i += (size_t)1; return i; } /*@ requires valid_string_s: valid_read_nstring(s, maxlen); ensures result_bounded: \result ≡ strlen(\old(s)) ∨ \result ≡ \old(maxlen); assigns \result; assigns \result \from (indirect: *(s + (0 .. maxlen - 1))), (indirect: maxlen); */ size_t strnlen(char const *s, size_t maxlen) { size_t i; i = (unsigned int)0; while (1) { if (i < maxlen) { if (! ((int)*(s + i) != 0)) break; } else break; i += (size_t)1; } return i; } /*@ requires valid_s: valid_or_empty(s, n); ensures acsl_c_equiv: memset((char *)\old(s), \old(c), \old(n)) ≡ \true; ensures result_ptr: \result ≡ \old(s); assigns *((char *)s + (0 .. n - 1)), \result; assigns *((char *)s + (0 .. n - 1)) \from c; assigns \result \from s; */ void *memset(void *s, int c, size_t n) { unsigned char *p = (unsigned char *)s; { size_t i = (unsigned int)0; while (i < n) { *(p + i) = (unsigned char)c; i += (size_t)1; } } return s; } /*@ requires valid_string_s1: valid_read_string(s1); requires valid_string_s2: valid_read_string(s2); ensures acsl_c_equiv: \result ≡ strcmp(\old(s1), \old(s2)); assigns \result; assigns \result \from (indirect: *(s1 + (0 ..))), (indirect: *(s2 + (0 ..))); */ int strcmp(char const *s1, char const *s2) { int __retres; size_t i; i = (unsigned int)0; while ((int)*(s1 + i) == (int)*(s2 + i)) { if ((int)*(s1 + i) == 0) { __retres = 0; goto return_label; } i += (size_t)1; } __retres = (int)*((unsigned char *)s1 + i) - (int)*((unsigned char *)s2 + i); return_label: return __retres; } /*@ requires valid_string_s1: valid_read_nstring(s1, n); requires valid_string_s2: valid_read_nstring(s2, n); ensures acsl_c_equiv: \result ≡ strncmp(\old(s1), \old(s2), \old(n)); assigns \result; assigns \result \from (indirect: *(s1 + (0 .. n - 1))), (indirect: *(s2 + (0 .. n - 1))), (indirect: n); */ int strncmp(char const *s1, char const *s2, size_t n) { int __retres; { size_t i = (unsigned int)0; while (i < n) { if ((int)*(s1 + i) != (int)*(s2 + i)) { __retres = (int)*((unsigned char *)s1 + i) - (int)*((unsigned char *)s2 + i); goto return_label; } if ((int)*(s1 + i) == 0) { __retres = 0; goto return_label; } i += (size_t)1; } } __retres = 0; return_label: return __retres; } /*@ requires valid_s1: valid_read_or_empty(s1, n); requires valid_s2: valid_read_or_empty(s2, n); requires initialization: s1: \initialized((char *)s1 + (0 .. n - 1)); requires initialization: s2: \initialized((char *)s2 + (0 .. n - 1)); requires danglingness: s1: non_escaping(s1, n); requires danglingness: s2: non_escaping(s2, n); ensures logic_spec: \result ≡ memcmp{Pre, Pre}((char *)\old(s1), (char *)\old(s2), \old(n)); assigns \result; assigns \result \from (indirect: *((char *)s1 + (0 .. n - 1))), (indirect: *((char *)s2 + (0 .. n - 1))); */ int memcmp(void const *s1, void const *s2, size_t n) { int __retres; unsigned char const *p1; unsigned char const *p2; p1 = (unsigned char const *)s1; p2 = (unsigned char const *)s2; { size_t i = (unsigned int)0; while (i < n) { if ((int)*(p1 + i) != (int)*(p2 + i)) { __retres = (int)*(p1 + i) - (int)*(p2 + i); goto return_label; } i += (size_t)1; } } __retres = 0; return_label: return __retres; } static int char_equal_ignore_case(char c1, char c2) { int __retres; if ((int)c1 >= 'A') if ((int)c1 <= 'Z') c1 = (char)((int)c1 - ('A' - 'a')); if ((int)c2 >= 'A') if ((int)c2 <= 'Z') c2 = (char)((int)c2 - ('A' - 'a')); if ((int)c1 == (int)c2) { __retres = 0; goto return_label; } else { __retres = (int)((unsigned char)c2) - (int)((unsigned char)c1); goto return_label; } return_label: return __retres; } /*@ requires valid_string_s1: valid_read_string(s1); requires valid_string_s2: valid_read_string(s2); assigns \result; assigns \result \from (indirect: *(s1 + (0 ..))), (indirect: *(s2 + (0 ..))); */ int strcasecmp(char const *s1, char const *s2) { int __retres; size_t i; i = (unsigned int)0; while (1) { if ((int)*(s1 + i) != 0) { if (! ((int)*(s2 + i) != 0)) break; } else break; { int res = char_equal_ignore_case(*(s1 + i),*(s2 + i)); if (res != 0) { __retres = res; goto return_label; } } i += (size_t)1; } if ((int)*(s1 + i) == 0) { if ((int)*(s2 + i) == 0) { __retres = 0; goto return_label; } else goto _LAND; } else { _LAND: ; if ((int)*(s1 + i) == 0) { __retres = -1; goto return_label; } else { __retres = 1; goto return_label; } } return_label: return __retres; } /*@ requires valid_string_src: valid_read_string(src); requires valid_string_dest: valid_string(dest); requires room_string: \valid(dest + (0 .. strlen(dest) + strlen(src))); ensures sum_of_lengths: strlen(\old(dest)) ≡ \old(strlen(dest) + strlen(src)); ensures initialization: dest: \initialized(\old(dest) + (0 .. \old(strlen(dest) + strlen(src)))); ensures dest_null_terminated: *(\old(dest) + \old(strlen(dest) + strlen(src))) ≡ 0; ensures result_ptr: \result ≡ \old(dest); assigns *(dest + (strlen{Old}(dest) .. strlen{Old}(dest) + strlen{Old}(src))), \result; assigns *(dest + (strlen{Old}(dest) .. strlen{Old}(dest) + strlen{Old}(src))) \from *(src + (0 .. strlen{Old}(src))); assigns \result \from dest; */ char *strcat(char *dest, char const *src) { size_t i; size_t n = strlen((char const *)dest); i = (unsigned int)0; while ((int)*(src + i) != 0) { *(dest + (n + i)) = *(src + i); i += (size_t)1; } *(dest + (n + i)) = (char)0; return dest; } /*@ requires valid_nstring_src: valid_read_nstring(src, n); requires valid_string_dest: valid_string(dest); ensures result_ptr: \result ≡ \old(dest); assigns *(dest + (strlen{Old}(dest) .. strlen{Old}(dest) + n)), \result; assigns *(dest + (strlen{Old}(dest) .. strlen{Old}(dest) + n)) \from *(src + (0 .. n)); assigns \result \from dest; behavior complete: assumes valid_string_src_fits: valid_read_string(src) ∧ strlen(src) ≤ n; requires room_string: \valid((dest + strlen(dest)) + (0 .. strlen(src))); ensures sum_of_lengths: strlen(\old(dest)) ≡ \old(strlen(dest) + strlen(src)); assigns *(dest + (strlen{Old}(dest) .. strlen{Old}(dest) + strlen{Old}(src))), \result; assigns *(dest + (strlen{Old}(dest) .. strlen{Old}(dest) + strlen{Old}(src))) \from *(src + (0 .. strlen{Old}(src))); assigns \result \from dest; behavior partial: assumes valid_string_src_too_large: ¬(valid_read_string(src) ∧ strlen(src) ≤ n); requires room_string: \valid((dest + strlen(dest)) + (0 .. n)); ensures sum_of_bounded_lengths: strlen(\old(dest)) ≡ \old(strlen(dest)) + \old(n); assigns *(dest + (strlen{Old}(dest) .. strlen{Old}(dest) + n)), \result; assigns *(dest + (strlen{Old}(dest) .. strlen{Old}(dest) + n)) \from *(src + (0 .. strlen{Old}(src))); assigns \result \from dest; */ char *strncat(char *dest, char const *src, size_t n) { size_t i; size_t dest_len = strlen((char const *)dest); i = (unsigned int)0; while (i < n) { if ((int)*(src + i) == 0) break; *(dest + (dest_len + i)) = *(src + i); i += (size_t)1; } *(dest + (dest_len + i)) = (char)0; return dest; } /*@ requires valid_string_src: valid_read_string(src); requires room_string: \valid(dest + (0 .. strlen(src))); requires separation: \separated(dest + (0 .. strlen(src)), src + (0 .. strlen(src))); ensures equal_contents: strcmp(\old(dest), \old(src)) ≡ 0; ensures result_ptr: \result ≡ \old(dest); assigns *(dest + (0 .. strlen{Old}(src))), \result; assigns *(dest + (0 .. strlen{Old}(src))) \from *(src + (0 .. strlen{Old}(src))); assigns \result \from dest; */ char *strcpy(char *dest, char const *src) { size_t i; i = (unsigned int)0; while ((int)*(src + i) != 0) { *(dest + i) = *(src + i); i += (size_t)1; } *(dest + i) = (char)0; return dest; } /*@ requires valid_string_src: valid_read_string(src); requires room_nstring: \valid(dest + (0 .. n - 1)); requires separation: \separated(dest + (0 .. n - 1), src + (0 .. n - 1)); ensures result_ptr: \result ≡ \old(dest); ensures initialization: \initialized(\old(dest) + (0 .. \old(n) - 1)); assigns *(dest + (0 .. n - 1)), \result; assigns *(dest + (0 .. n - 1)) \from *(src + (0 .. n - 1)); assigns \result \from dest; behavior complete: assumes src_fits: strlen(src) < n; ensures equal_after_copy: strcmp(\old(dest), \old(src)) ≡ 0; behavior partial: assumes src_too_long: n ≤ strlen(src); ensures equal_prefix: memcmp{Post, Post}(\old(dest), \old(src), \old(n)) ≡ 0; */ char *strncpy(char *dest, char const *src, size_t n) { size_t i; i = (unsigned int)0; while (i < n) { *(dest + i) = *(src + i); if ((int)*(src + i) == 0) break; i += (size_t)1; } while (i < n) { *(dest + i) = (char)0; i += (size_t)1; } return dest; } /*@ requires valid_string_s: valid_read_string(s); assigns \result; assigns \result \from s, *(s + (0 ..)), c; behavior found: assumes char_found: strchr(s, c) ≡ \true; ensures result_char: *\result ≡ (char)\old(c); ensures result_same_base: \base_addr(\result) ≡ \base_addr(\old(s)); ensures result_in_length: \old(s) ≤ \result ≤ \old(s) + strlen(\old(s)); ensures result_valid_string: valid_read_string(\result); ensures result_first_occur: ∀ char *p; \old(s) ≤ p < \result ⇒ *p ≢ (char)\old(c); behavior not_found: assumes char_not_found: ¬(strchr(s, c) ≡ \true); ensures result_null: \result ≡ \null; behavior default: ensures result_null_or_same_base: \result ≡ \null ∨ \base_addr(\result) ≡ \base_addr(\old(s)); */ char *strchr(char const *s, int c) { char *__retres; size_t i; char const ch = (char)c; i = (unsigned int)0; while ((int)*(s + i) != (int)ch) { if ((int)*(s + i) == 0) { __retres = (char *)0; goto return_label; } i += (size_t)1; } __retres = (char *)(s + i); return_label: return __retres; } /*@ requires valid_string_s: valid_read_string(s); assigns \result; assigns \result \from s, *(s + (0 ..)), c; behavior found: assumes char_found: strchr(s, c) ≡ \true; ensures result_char: (int)*\result ≡ \old(c); ensures result_same_base: \base_addr(\result) ≡ \base_addr(\old(s)); ensures result_valid_string: valid_read_string(\result); behavior not_found: assumes char_not_found: ¬(strchr(s, c) ≡ \true); ensures result_null: \result ≡ \null; behavior default: ensures result_null_or_same_base: \result ≡ \null ∨ \base_addr(\result) ≡ \base_addr(\old(s)); */ char *strrchr(char const *s, int c) { char *__retres; char const ch = (char)c; { size_t tmp; tmp = strlen(s); size_t i = tmp + (size_t)1; while (i > (size_t)0) { if ((int)*(s + (i - (size_t)1)) == (int)ch) { __retres = (char *)(s + (i - (size_t)1)); goto return_label; } i -= (size_t)1; } } __retres = (char *)0; return_label: return __retres; } /*@ requires valid: valid_read_or_empty(s, n) ∨ \valid_read((unsigned char *)s + (0 .. memchr_off((char *)s, c, n))); requires initialization: \initialized((unsigned char *)s + (0 .. n - 1)) ∨ \initialized((unsigned char *)s + (0 .. memchr_off((char *)s, c, n))); requires danglingness: non_escaping(s, n) ∨ non_escaping(s, (unsigned int)(memchr_off((char *)s, c, n) + 1)); assigns \result; assigns \result \from s, c, *((unsigned char *)s + (0 .. n - 1)); behavior found: assumes char_found: memchr((char *)s, c, n) ≡ \true; ensures result_same_base: \base_addr(\result) ≡ \base_addr(\old(s)); ensures result_char: (int)*((char *)\result) ≡ \old(c); ensures result_in_str: ∀ ℤ i; 0 ≤ i < \old(n) ⇒ *((unsigned char *)\old(s) + i) ≡ \old(c) ⇒ \result ≤ \old(s) + i; behavior not_found: assumes char_not_found: ¬(memchr((char *)s, c, n) ≡ \true); ensures result_null: \result ≡ \null; */ void *memchr(void const *s, int c, size_t n) { void *__retres; unsigned char const ch = (unsigned char)c; unsigned char const *ss = (unsigned char const *)s; { size_t i = (unsigned int)0; while (i < n) { if ((int)*(ss + i) == (int)ch) { __retres = (void *)(ss + i); goto return_label; } i += (size_t)1; } } __retres = (void *)0; return_label: return __retres; } void *memrchr(void const *s, int c, size_t n) { void *__retres; unsigned char const ch = (unsigned char)c; unsigned char const *ss = (unsigned char const *)s; { size_t i = n; while (i > (size_t)0) { if ((int)*(ss + (i - (size_t)1)) == (int)ch) { __retres = (void *)(ss + (i - (size_t)1)); goto return_label; } i -= (size_t)1; } } __retres = (void *)0; return_label: return __retres; } /*@ requires valid_string_haystack: valid_read_string(haystack); requires valid_string_needle: valid_read_string(needle); ensures result_null_or_in_haystack: \result ≡ \null ∨ (\subset(\result, \old(haystack) + (0 ..)) ∧ \valid_read(\result) ∧ memcmp{Pre, Pre}(\result, \old(needle), strlen(\old(needle))) ≡ 0); assigns \result; assigns \result \from haystack, (indirect: *(haystack + (0 ..))), (indirect: *(needle + (0 ..))); */ char *strstr(char const *haystack, char const *needle) { char *__retres; if ((int)*(needle + 0) == 0) { __retres = (char *)haystack; goto return_label; } { size_t i = (unsigned int)0; while ((int)*(haystack + i) != 0) { { size_t j; j = (unsigned int)0; while ((int)*(haystack + (i + j)) != 0) { if ((int)*(haystack + (i + j)) != (int)*(needle + j)) break; j += (size_t)1; } if ((int)*(needle + j) == 0) { __retres = (char *)(haystack + i); goto return_label; } } i += (size_t)1; } } __retres = (char *)0; return_label: return __retres; } static int __fc_strerror_init; /*@ ensures result_internal_str: \result ≡ __fc_p_strerror; ensures result_nul_terminated: *(\result + 63) ≡ 0; ensures result_valid_string: valid_read_string(\result); assigns \result; assigns \result \from __fc_p_strerror, (indirect: errnum); */ char *strerror(int errnum) { char *__retres; if (! __fc_strerror_init) { Frama_C_make_unknown(__fc_strerror,(unsigned int)63); __fc_strerror[63] = (char)0; __fc_strerror_init = 1; } __retres = __fc_strerror; return __retres; } /*@ requires valid_string_s: valid_read_string(s); assigns \result; assigns \result \from (indirect: *(s + (0 .. strlen{Old}(s)))), (indirect: __fc_heap_status); allocates \result; behavior allocation: assumes can_allocate: is_allocable(strlen(s)); ensures allocation: \fresh{Old, Here}(\result,strlen(\old(s))); ensures result_valid_string_and_same_contents: valid_string(\result) ∧ strcmp(\result, \old(s)) ≡ 0; assigns __fc_heap_status, \result; assigns __fc_heap_status \from (indirect: s), __fc_heap_status; assigns \result \from (indirect: *(s + (0 .. strlen{Old}(s)))), (indirect: __fc_heap_status); behavior no_allocation: assumes cannot_allocate: ¬is_allocable(strlen(s)); ensures result_null: \result ≡ \null; assigns \result; assigns \result \from \nothing; allocates \nothing; */ char *strdup(char const *s) { char *__retres; size_t tmp; tmp = strlen(s); size_t l = tmp + (size_t)1; char *p = malloc(l); if (! p) { __fc_errno = 12; __retres = (char *)0; goto return_label; } memcpy((void *)p,(void const *)s,l); __retres = p; return_label: return __retres; } /*@ assigns \result; assigns \result \from (indirect: *(s + (0 .. strlen{Old}(s)))), (indirect: n), (indirect: __fc_heap_status); allocates \result; behavior allocation: assumes can_allocate: is_allocable(\min(strlen(s), n + 1)); ensures allocation: \fresh{Old, Here}(\result,\min(strlen(\old(s)), \old(n) + 1)); ensures result_valid_string_bounded_and_same_prefix: \valid(\result + (0 .. \min(strlen(\old(s)), \old(n)))) ∧ valid_string(\result) ∧ strlen(\result) ≤ \old(n) ∧ strncmp(\result, \old(s), \old(n)) ≡ 0; assigns __fc_heap_status, \result; assigns __fc_heap_status \from (indirect: s), (indirect: n), __fc_heap_status; assigns \result \from (indirect: *(s + (0 .. strlen{Old}(s)))), (indirect: n), (indirect: __fc_heap_status); behavior no_allocation: assumes cannot_allocate: ¬is_allocable(\min(strlen(s), n + 1)); ensures result_null: \result ≡ \null; assigns \result; assigns \result \from \nothing; allocates \nothing; */ char *strndup(char const *s, size_t n) { char *__retres; size_t l; l = (unsigned int)0; while (l < n) { if ((int)*(s + l) == 0) break; l += (size_t)1; } char *p = malloc(l + (size_t)1); if (! p) { __fc_errno = 12; __retres = (char *)0; goto return_label; } memcpy((void *)p,(void const *)s,l); *(p + l) = (char)0; __retres = p; return_label: return __retres; } static int __fc_strsignal_init; /*@ ensures result_internal_str: \result ≡ __fc_p_strsignal; ensures result_nul_terminated: *(\result + 63) ≡ 0; ensures result_valid_string: valid_read_string(\result); assigns \result; assigns \result \from __fc_p_strsignal, (indirect: signum); */ char *strsignal(int signum) { char *__retres; if (! __fc_strsignal_init) { Frama_C_make_unknown(__fc_strsignal,(unsigned int)63); __fc_strsignal[63] = (char)0; __fc_strsignal_init = 1; } __retres = __fc_strsignal; return __retres; } /*@ ghost unsigned int volatile __fc_time __attribute__((__FRAMA_C_MODEL__)); */ /*@ assigns \result; assigns \result \from __fc_time; */ extern clock_t clock(void); /*@ assigns \result; assigns \result \from time1, time0; */ extern double difftime(time_t time1, time_t time0); /*@ requires valid_timeptr: \valid(timeptr); assigns *timeptr, \result; assigns *timeptr \from *timeptr; assigns \result \from (indirect: *timeptr); */ extern time_t mktime(struct tm *timeptr); /*@ assigns *timer, \result; assigns *timer \from __fc_time; assigns \result \from __fc_time; behavior null: assumes timer_null: timer ≡ \null; assigns \result; assigns \result \from __fc_time; behavior not_null: assumes timer_non_null: timer ≢ \null; requires valid_timer: \valid(timer); ensures initialization: timer: \initialized(\old(timer)); assigns *timer, \result; assigns *timer \from __fc_time; assigns \result \from __fc_time; complete behaviors not_null, null; disjoint behaviors not_null, null; */ extern time_t time(time_t *timer); char __fc_ctime[26]; char * const __fc_p_ctime = __fc_ctime; /*@ requires valid_timer: \valid_read(timer); requires initialization: init_timer: \initialized(timer); ensures result_points_to_ctime: \result ≡ __fc_p_ctime; ensures result_valid_string: valid_read_string(__fc_p_ctime); assigns __fc_ctime[0 .. 25], \result; assigns __fc_ctime[0 .. 25] \from (indirect: *timer), (indirect: __fc_time); assigns \result \from (indirect: *timer), (indirect: __fc_time), __fc_p_ctime; */ extern char *ctime(time_t const *timer); struct tm __fc_time_tm; struct tm * const __fc_p_time_tm = & __fc_time_tm; /*@ requires valid_timer: \valid_read(timer); ensures result_null_or_internal_tm: \result ≡ &__fc_time_tm ∨ \result ≡ \null; assigns \result, __fc_time_tm; assigns \result \from __fc_p_time_tm; assigns __fc_time_tm \from *timer; */ extern struct tm *gmtime(time_t const *timer); /*@ requires valid_timer: \valid_read(timer); ensures result_null_or_internal_tm: \result ≡ &__fc_time_tm ∨ \result ≡ \null; assigns \result, __fc_time_tm; assigns \result \from __fc_p_time_tm; assigns __fc_time_tm \from *timer; */ extern struct tm *localtime(time_t const *timer); /*@ requires dst_has_room: \valid(s + (0 .. max - 1)); requires valid_format: valid_read_string(format); requires valid_tm: \valid_read(tm); ensures result_bounded: \result ≤ \old(max); assigns *(s + (0 .. max - 1)), \result; assigns *(s + (0 .. max - 1)) \from (indirect: max), (indirect: *(format + (0 ..))), (indirect: *tm); assigns \result \from (indirect: max), (indirect: *(format + (0 ..))), (indirect: *tm); */ extern size_t strftime(char * __restrict s, size_t max, char const * __restrict format, struct tm const * __restrict tm); /*@ requires tp: \valid(tp); assigns \result, *tp, __fc_time; assigns \result \from __fc_time; assigns *tp \from __fc_time; assigns __fc_time \from __fc_time; behavior realtime_clock: assumes realtime: clk_id ≡ 666; ensures success: \result ≡ 0; ensures initialization: \initialized(\old(tp)); behavior monotonic_clock: assumes monotonic: clk_id ≡ 1; ensures success: \result ≡ 0; ensures initialization: \initialized(\old(tp)); behavior bad_clock_id: assumes bad_id: clk_id ≢ 666 ∧ clk_id ≢ 1; ensures error: \result ≡ 22; assigns \result; assigns \result \from clk_id; complete behaviors bad_clock_id, monotonic_clock, realtime_clock; disjoint behaviors bad_clock_id, monotonic_clock, realtime_clock; */ extern int clock_gettime(clockid_t clk_id, struct timespec *tp); /*@ axiomatic nanosleep_predicates { predicate abs_clock_in_range{L}(clockid_t id, struct timespec *tm) reads __fc_time; predicate valid_clock_id{L}(clockid_t id) reads __fc_time; } */ /*@ ghost int volatile __fc_interrupted __attribute__((__FRAMA_C_MODEL__)); */ /*@ requires valid_request: \valid_read(rqtp); requires initialization: initialized_request: \initialized(&rqtp->tv_sec) ∧ \initialized(&rqtp->tv_nsec); requires valid_nanosecs: 0 ≤ rqtp->tv_nsec < 1000000000; requires valid_remaining_or_null: rmtp ≡ \null ∨ \valid(rmtp); assigns \result; assigns \result \from (indirect: __fc_time), (indirect: __fc_interrupted), (indirect: clock_id), (indirect: flags), (indirect: rqtp), (indirect: *rqtp); behavior absolute: assumes absolute_time: (flags & 1) ≢ 0; assumes no_einval: abs_clock_in_range(clock_id, rqtp) ∧ valid_clock_id(clock_id); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ 4 ∨ \result ≡ 22 ∨ \result ≡ 95; assigns \result; assigns \result \from (indirect: __fc_time), (indirect: __fc_interrupted), (indirect: clock_id), (indirect: rqtp), (indirect: *rqtp); behavior relative_interrupted: assumes relative_time: (flags & 1) ≡ 0; assumes interrupted: __fc_interrupted ≢ 0; assumes no_einval: valid_clock_id(clock_id); ensures result_interrupted: \result ≡ 4; ensures initialization: interrupted_remaining: \old(rmtp) ≢ \null ⇒ \initialized(&\old(rmtp)->tv_sec) ∧ \initialized(&\old(rmtp)->tv_nsec); ensures interrupted_remaining_decreases: \old(rmtp) ≢ \null ⇒ \old(rqtp)->tv_sec * 1000000000 + \old(rqtp)->tv_nsec ≥ \old(rmtp)->tv_sec * 1000000000 + \old(rmtp)->tv_nsec; ensures remaining_valid: \old(rmtp) ≢ \null ⇒ 0 ≤ \old(rmtp)->tv_nsec < 1000000000; assigns \result, *rmtp; assigns \result \from (indirect: __fc_time), (indirect: clock_id), (indirect: rqtp), (indirect: *rqtp); assigns *rmtp \from __fc_time, (indirect: clock_id), (indirect: rqtp), (indirect: *rqtp), (indirect: rmtp); behavior relative_no_error: assumes relative_time: (flags & 1) ≡ 0; assumes not_interrupted: __fc_interrupted ≡ 0; assumes no_einval: valid_clock_id(clock_id); ensures result_ok: \result ≡ 0; assigns \result; assigns \result \from (indirect: __fc_time), (indirect: clock_id), (indirect: rqtp), (indirect: *rqtp); behavior relative_invalid_clock_id: assumes relative_time: (flags & 1) ≡ 0; assumes not_interrupted: __fc_interrupted ≡ 0; assumes einval: ¬valid_clock_id(clock_id); ensures result_einval: \result ≡ 22; assigns \result; assigns \result \from (indirect: __fc_time), (indirect: clock_id), (indirect: rqtp), (indirect: *rqtp); complete behaviors relative_invalid_clock_id, relative_no_error, relative_interrupted, absolute; disjoint behaviors relative_invalid_clock_id, relative_no_error, relative_interrupted, absolute; */ extern int clock_nanosleep(clockid_t clock_id, int flags, struct timespec const *rqtp, struct timespec *rmtp); /*@ requires valid_request: \valid_read(rqtp); requires initialization: initialized_request: \initialized(&rqtp->tv_sec) ∧ \initialized(&rqtp->tv_nsec); requires valid_nanosecs: 0 ≤ rqtp->tv_nsec < 1000000000; requires valid_remaining_or_null: rmtp ≡ \null ∨ \valid(rmtp); ensures result_elapsed_or_interrupted: \result ≡ 0 ∨ \result ≡ -1; ensures initialization: interrupted_remaining: \old(rmtp) ≢ \null ∧ \result ≡ -1 ⇒ \initialized(&\old(rmtp)->tv_sec) ∧ \initialized(&\old(rmtp)->tv_nsec); ensures interrupted_remaining_decreases: \old(rmtp) ≢ \null ∧ \result ≡ -1 ⇒ \old(rqtp)->tv_sec * 1000000000 + \old(rqtp)->tv_nsec ≥ \old(rmtp)->tv_sec * 1000000000 + \old(rmtp)->tv_nsec; ensures interrupted_remaining_valid: \old(rmtp) ≢ \null ∧ \result ≡ -1 ⇒ 0 ≤ \old(rmtp)->tv_nsec < 1000000000; assigns \result, *rmtp; assigns \result \from (indirect: __fc_time), (indirect: rqtp), (indirect: *rqtp); assigns *rmtp \from (indirect: __fc_time), (indirect: rqtp), (indirect: *rqtp), (indirect: rmtp); */ extern int nanosleep(struct timespec const *rqtp, struct timespec *rmtp); extern char *tzname[2]; /*@ assigns *(tzname[0 .. 1] + (0 ..)); assigns *(tzname[0 .. 1] + (0 ..)) \from \nothing; */ extern void tzset(void); /*@ requires valid: valid_read_or_empty((void *)s, (unsigned int)(sizeof(wchar_t) * n)) ∨ \valid_read((unsigned char *)s + (0 .. wmemchr_off(s, c, n))); requires initialization: \initialized(s + (0 .. n - 1)) ∨ \initialized(s + (0 .. wmemchr_off(s, c, n))); requires danglingness: non_escaping((void *)s, (unsigned int)(sizeof(wchar_t) * n)) ∨ non_escaping((void *)s, (unsigned int)(sizeof(wchar_t) * (wmemchr_off(s, c, n) + 1))); ensures result_null_or_inside_s: \result ≡ \null ∨ \subset(\result, \old(s) + (0 .. \old(n) - 1)); assigns \result; assigns \result \from s, (indirect: *(s + (0 .. n - 1))), (indirect: c), (indirect: n); */ extern wchar_t *wmemchr(wchar_t const *s, wchar_t c, size_t n); /*@ requires valid_s1: valid_read_or_empty((void *)s1, (unsigned int)(sizeof(wchar_t) * n)); requires valid_s2: valid_read_or_empty((void *)s2, (unsigned int)(sizeof(wchar_t) * n)); requires initialization: s1: \initialized(s1 + (0 .. n - 1)); requires initialization: s2: \initialized(s2 + (0 .. n - 1)); requires danglingness: s1: non_escaping((void *)s1, (unsigned int)(sizeof(wchar_t) * n)); requires danglingness: s2: non_escaping((void *)s2, (unsigned int)(sizeof(wchar_t) * n)); assigns \result; assigns \result \from (indirect: *(s1 + (0 .. n - 1))), (indirect: *(s2 + (0 .. n - 1))), (indirect: n); */ extern int wmemcmp(wchar_t const *s1, wchar_t const *s2, size_t n); wchar_t *wmemcpy(wchar_t *dest, wchar_t const *src, size_t n); /*@ requires valid_src: \valid_read(src + (0 .. n - 1)); requires valid_dest: \valid(dest + (0 .. n - 1)); ensures result_ptr: \result ≡ \old(dest); assigns *(dest + (0 .. n - 1)), \result; assigns *(dest + (0 .. n - 1)) \from *(src + (0 .. n - 1)), (indirect: src), (indirect: n); assigns \result \from dest; */ extern wchar_t *wmemmove(wchar_t *dest, wchar_t const *src, size_t n); wchar_t *wmemset(wchar_t *dest, wchar_t val, size_t len); wchar_t *wcscat(wchar_t *dest, wchar_t const *src); /*@ requires valid_wstring_src: valid_read_wstring(wcs); ensures result_null_or_inside_wcs: \result ≡ \null ∨ \subset(\result, \old(wcs) + (0 ..)); assigns \result; assigns \result \from wcs, (indirect: *(wcs + (0 ..))), (indirect: wc); */ extern wchar_t *wcschr(wchar_t const *wcs, wchar_t wc); /*@ requires valid_wstring_s1: valid_read_wstring(s1); requires valid_wstring_s2: valid_read_wstring(s2); assigns \result; assigns \result \from (indirect: *(s1 + (0 ..))), (indirect: *(s2 + (0 ..))); */ extern int wcscmp(wchar_t const *s1, wchar_t const *s2); wchar_t *wcscpy(wchar_t *dest, wchar_t const *src); /*@ requires valid_wstring_wcs: valid_read_wstring(wcs); requires valid_wstring_accept: valid_read_wstring(accept); assigns \result; assigns \result \from (indirect: *(wcs + (0 ..))), (indirect: *(accept + (0 ..))); */ extern size_t wcscspn(wchar_t const *wcs, wchar_t const *accept); /*@ requires valid_nwstring_src: valid_read_nwstring(src, n); requires valid_wstring_dest: valid_wstring(dest); requires room_for_concatenation: \valid(dest + (wcslen(dest) .. wcslen(dest) + \min(wcslen(src), n))); requires separation: \separated( dest + (0 .. wcslen(dest) + wcslen(src)), src + (0 .. wcslen(src)) ); assigns *(dest + (0 ..)), \result; assigns *(dest + (0 ..)) \from *(dest + (0 ..)), (indirect: dest), *(src + (0 .. n - 1)), (indirect: src), (indirect: n); assigns \result \from (indirect: *(dest + (0 ..))), (indirect: *(src + (0 .. n - 1))), (indirect: n); */ extern size_t wcslcat(wchar_t * __restrict dest, wchar_t const * __restrict src, size_t n); /*@ requires valid_wstring_src: valid_read_wstring(src); requires room_nwstring: \valid(dest + (0 .. n)); requires separation: dest: src: \separated(dest + (0 .. n - 1), src + (0 .. n - 1)); assigns *(dest + (0 .. n - 1)), \result; assigns *(dest + (0 .. n - 1)) \from *(src + (0 .. n - 1)), (indirect: src), (indirect: n); assigns \result \from (indirect: *(dest + (0 .. n - 1))), (indirect: dest), (indirect: *(src + (0 .. n - 1))), (indirect: src), (indirect: n); */ extern size_t wcslcpy(wchar_t *dest, wchar_t const *src, size_t n); size_t wcslen(wchar_t const *str); wchar_t *wcsncat(wchar_t *dest, wchar_t const *src, size_t n); /*@ requires valid_wstring_s1: valid_read_wstring(s1); requires valid_wstring_s2: valid_read_wstring(s2); assigns \result; assigns \result \from (indirect: *(s1 + (0 .. n - 1))), (indirect: *(s2 + (0 .. n - 1))), (indirect: n); */ extern int wcsncmp(wchar_t const *s1, wchar_t const *s2, size_t n); wchar_t *wcsncpy(wchar_t *dest, wchar_t const *src, size_t n); /*@ requires valid_wstring_wcs: valid_read_wstring(wcs); requires valid_wstring_accept: valid_read_wstring(accept); ensures result_null_or_inside_wcs: \result ≡ \null ∨ \subset(\result, \old(wcs) + (0 ..)); assigns \result; assigns \result \from wcs, (indirect: *(wcs + (0 ..))), (indirect: *(accept + (0 ..))); */ extern wchar_t *wcspbrk(wchar_t const *wcs, wchar_t const *accept); /*@ requires valid_wstring_wcs: valid_read_wstring(wcs); ensures result_null_or_inside_wcs: \result ≡ \null ∨ \subset(\result, \old(wcs) + (0 ..)); assigns \result; assigns \result \from wcs, (indirect: *(wcs + (0 .. wcslen{Old}(wcs)))), (indirect: wc); */ extern wchar_t *wcsrchr(wchar_t const *wcs, wchar_t wc); /*@ requires valid_wstring_wcs: valid_read_wstring(wcs); requires valid_wstring_accept: valid_read_wstring(accept); assigns \result; assigns \result \from (indirect: *(wcs + (0 .. wcslen{Old}(wcs)))), (indirect: *(accept + (0 .. wcslen{Old}(accept)))); */ extern size_t wcsspn(wchar_t const *wcs, wchar_t const *accept); /*@ requires valid_wstring_haystack: valid_read_wstring(haystack); requires valid_wstring_needle: valid_read_wstring(needle); ensures result_null_or_inside_haystack: \result ≡ \null ∨ \subset(\result, \old(haystack) + (0 ..)); assigns \result; assigns \result \from haystack, (indirect: *(haystack + (0 ..))), (indirect: *(needle + (0 ..))); */ extern wchar_t *wcsstr(wchar_t const *haystack, wchar_t const *needle); /*@ requires room_nwstring: \valid(ws + (0 .. n - 1)); requires valid_stream: \valid(stream); ensures result_null_or_same: \result ≡ \null ∨ \result ≡ \old(ws); ensures terminated_string_on_success: \result ≢ \null ⇒ valid_wstring(\old(ws)); assigns *(ws + (0 .. n - 1)), \result; assigns *(ws + (0 .. n - 1)) \from (indirect: n), (indirect: *stream); assigns \result \from ws, (indirect: n), (indirect: *stream); */ extern wchar_t *fgetws(wchar_t * __restrict ws, int n, FILE * __restrict stream); /*@ axiomatic wformat_length { logic ℤ wformat_length{L}(wchar_t *format) ; } */ /*@ requires valid_dest: valid_or_empty((void *)dest, (unsigned int)(sizeof(wchar_t) * n)); requires valid_src: valid_read_or_empty((void *)src, (unsigned int)(sizeof(wchar_t) * n)); requires separation: dest: src: \separated(dest + (0 .. n - 1), src + (0 .. n - 1)); ensures result_ptr: \result ≡ \old(dest); assigns *(dest + (0 .. n - 1)), \result; assigns *(dest + (0 .. n - 1)) \from *(src + (0 .. n - 1)), (indirect: src), (indirect: n); assigns \result \from dest; */ wchar_t *wmemcpy(wchar_t *dest, wchar_t const *src, size_t n) { { size_t i = (unsigned int)0; while (i < n) { *(dest + i) = *(src + i); i += (size_t)1; } } return dest; } /*@ requires valid_wcs: \valid(dest + (0 .. len - 1)); ensures result_ptr: \result ≡ \old(dest); ensures initialization: wcs: \initialized(\old(dest) + (0 .. \old(len) - 1)); ensures contents_equal_wc: \subset(*(\old(dest) + (0 .. \old(len) - 1)), \old(val)); assigns *(dest + (0 .. len - 1)), \result; assigns *(dest + (0 .. len - 1)) \from val, (indirect: len); assigns \result \from dest; */ wchar_t *wmemset(wchar_t *dest, wchar_t val, size_t len) { { size_t i = (unsigned int)0; while (i < len) { *(dest + i) = val; i += (size_t)1; } } return dest; } /*@ requires valid_wstring_src: valid_read_wstring(src); requires room_wstring: \valid(dest + (0 .. wcslen(src))); requires separation: \separated(dest + (0 .. wcslen(src)), src + (0 .. wcslen(src))); ensures result_ptr: \result ≡ \old(dest); assigns *(dest + (0 .. wcslen{Old}(src))), \result; assigns *(dest + (0 .. wcslen{Old}(src))) \from *(src + (0 .. wcslen{Old}(src))), (indirect: src); assigns \result \from dest; */ wchar_t *wcscpy(wchar_t *dest, wchar_t const *src) { size_t i; i = (unsigned int)0; while (*(src + i) != 0) { *(dest + i) = *(src + i); i += (size_t)1; } *(dest + i) = 0; return dest; } /*@ requires valid_string_s: valid_read_wstring(str); ensures result_is_length: \result ≡ wcslen(\old(str)); assigns \result; assigns \result \from (indirect: *(str + (0 .. wcslen{Old}(str)))); */ size_t wcslen(wchar_t const *str) { size_t i; i = (unsigned int)0; while (*(str + i) != 0) i += (size_t)1; return i; } /*@ requires valid_wstring_src: valid_read_wstring(src); requires room_nwstring: \valid(dest + (0 .. n - 1)); requires separation: dest: src: \separated(dest + (0 .. n - 1), src + (0 .. n - 1)); ensures result_ptr: \result ≡ \old(dest); ensures initialization: \initialized(\old(dest) + (0 .. \old(n) - 1)); assigns *(dest + (0 .. n - 1)), \result; assigns *(dest + (0 .. n - 1)) \from *(src + (0 .. n - 1)), (indirect: src), (indirect: n); assigns \result \from dest; */ wchar_t *wcsncpy(wchar_t *dest, wchar_t const *src, size_t n) { size_t i; i = (unsigned int)0; while (i < n) { *(dest + i) = *(src + i); if (*(src + i) == 0) break; i += (size_t)1; } while (i < n) { *(dest + i) = 0; i += (size_t)1; } return dest; } /*@ requires valid_wstring_src: valid_read_wstring(src); requires valid_wstring_dest: valid_wstring(dest); requires room_for_concatenation: \valid(dest + (wcslen(dest) .. wcslen(dest) + wcslen(src))); requires separation: \separated( dest + (0 .. wcslen(dest) + wcslen(src)), src + (0 .. wcslen(src)) ); ensures result_ptr: \result ≡ \old(dest); assigns *(dest + (0 ..)), \result; assigns *(dest + (0 ..)) \from *(dest + (0 ..)), (indirect: dest), *(src + (0 ..)), (indirect: src); assigns \result \from dest; */ wchar_t *wcscat(wchar_t *dest, wchar_t const *src) { size_t i; size_t n = wcslen((wchar_t const *)dest); i = (unsigned int)0; while (*(src + i) != 0) { *(dest + (n + i)) = *(src + i); i += (size_t)1; } *(dest + (n + i)) = 0; return dest; } /*@ requires valid_nwstring_src: valid_read_nwstring(src, n); requires valid_wstring_dest: valid_wstring(dest); requires room_for_concatenation: \valid(dest + (wcslen(dest) .. wcslen(dest) + \min(wcslen(src), n))); requires separation: \separated( dest + (0 .. wcslen(dest) + wcslen(src)), src + (0 .. wcslen(src)) ); ensures result_ptr: \result ≡ \old(dest); assigns *(dest + (0 ..)), \result; assigns *(dest + (0 ..)) \from *(dest + (0 ..)), (indirect: dest), *(src + (0 .. n - 1)), (indirect: src), (indirect: n); assigns \result \from dest; */ wchar_t *wcsncat(wchar_t *dest, wchar_t const *src, size_t n) { size_t i; size_t dest_len = wcslen((wchar_t const *)dest); i = (unsigned int)0; while (1) { if (i < n) { if (! (*(src + i) != 0)) break; } else break; *(dest + (dest_len + i)) = *(src + i); i += (size_t)1; } *(dest + (dest_len + i)) = 0; return dest; } /*@ ghost extern int __fc_stack_status __attribute__((__FRAMA_C_MODEL__)); */ /*@ ensures allocation: \fresh{Old, Here}(\result,\old(size)); assigns __fc_stack_status, \result; assigns __fc_stack_status \from size, __fc_stack_status; assigns \result \from (indirect: size), (indirect: __fc_stack_status); allocates \result; */ extern void *alloca(size_t size); DIR __fc_opendir[16]; DIR * const __fc_p_opendir = __fc_opendir; /*@ requires dirp_valid_dir_stream: \subset(dirp, &__fc_opendir[0 .. 16 - 1]); ensures err_or_closed_on_success: (\result ≡ 0 ∧ \old(dirp)->__fc_dir_inode ≡ \null) ∨ \result ≡ -1; assigns \result, __fc_errno, *dirp; assigns \result \from dirp, *dirp, __fc_p_opendir; assigns __fc_errno \from dirp, *dirp, __fc_p_opendir; assigns *dirp \from dirp, *dirp, __fc_p_opendir; */ extern int closedir(DIR *dirp); /*@ ensures result_null_or_valid: \result ≡ \null ∨ \valid(\result); ensures valid_dir_stream_on_success: \result ≢ \null ⇒ \result ≡ &__fc_opendir[\result->__fc_dir_id]; ensures stream_positioned_on_success: \result ≢ \null ⇒ \result->__fc_dir_inode ≢ \null; assigns \result, __fc_errno; assigns \result \from *(path + (0 ..)), __fc_p_opendir; assigns __fc_errno \from *(path + (0 ..)), __fc_p_opendir; */ extern DIR *opendir(char const *path); /*@ requires dirp_valid_dir_stream: \subset(dirp, &__fc_opendir[0 .. 16 - 1]); ensures result_null_or_valid: \result ≡ \null ∨ \valid(\result); assigns \result, dirp->__fc_dir_position, __fc_errno; assigns \result \from *dirp, __fc_p_opendir; assigns dirp->__fc_dir_position \from dirp->__fc_dir_position; assigns __fc_errno \from dirp, *dirp, __fc_p_opendir; */ extern struct dirent *readdir(DIR *dirp); /*@ requires valid_fdset: \valid(fdset); requires initialization: \initialized(fdset); assigns *fdset; assigns *fdset \from *fdset, (indirect: fd); */ extern void FD_CLR(int fd, fd_set *fdset); /*@ requires valid_fdset: \valid_read(fdset); requires initialization: \initialized(fdset); assigns \result; assigns \result \from (indirect: *fdset), (indirect: fd); */ extern int FD_ISSET(int fd, fd_set const *fdset); /*@ requires valid_fdset: \valid(fdset); requires initialization: \initialized(fdset); assigns *fdset; assigns *fdset \from *fdset, (indirect: fd); */ extern void FD_SET(int fd, fd_set *fdset); /*@ requires valid_fdset: \valid(fdset); ensures initialization: \initialized(\old(fdset)); assigns *fdset; assigns *fdset \from \nothing; */ extern void FD_ZERO(fd_set *fdset); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (int)(\old(a) + \old(b)); ensures result_overflow: \old(a) + \old(b) ≡ (int)(\old(a) + \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_sadd_overflow(int a, int b, int *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (long)(\old(a) + \old(b)); ensures result_overflow: \old(a) + \old(b) ≡ (long)(\old(a) + \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_saddl_overflow(long a, long b, long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (long long)(\old(a) + \old(b)); ensures result_overflow: \old(a) + \old(b) ≡ (long long)(\old(a) + \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_saddll_overflow(long long a, long long b, long long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (unsigned int)(\old(a) + \old(b)); ensures result_overflow: \old(a) + \old(b) ≡ (unsigned int)(\old(a) + \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_uadd_overflow(unsigned int a, unsigned int b, unsigned int *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (unsigned long)(\old(a) + \old(b)); ensures result_overflow: \old(a) + \old(b) ≡ (unsigned long)(\old(a) + \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_uaddl_overflow(unsigned long a, unsigned long b, unsigned long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (unsigned long long)(\old(a) + \old(b)); ensures result_overflow: \old(a) + \old(b) ≡ (unsigned long long)(\old(a) + \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_uaddll_overflow(unsigned long long a, unsigned long long b, unsigned long long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (int)(\old(a) - \old(b)); ensures result_overflow: \old(a) - \old(b) ≡ (int)(\old(a) - \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_ssub_overflow(int a, int b, int *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (long)(\old(a) - \old(b)); ensures result_overflow: \old(a) - \old(b) ≡ (long)(\old(a) - \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_ssubl_overflow(long a, long b, long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (long long)(\old(a) - \old(b)); ensures result_overflow: \old(a) - \old(b) ≡ (long long)(\old(a) - \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_ssubll_overflow(long long a, long long b, long long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (unsigned int)(\old(a) - \old(b)); ensures result_overflow: \old(a) - \old(b) ≡ (unsigned int)(\old(a) - \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_usub_overflow(unsigned int a, unsigned int b, unsigned int *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (unsigned long)(\old(a) - \old(b)); ensures result_overflow: \old(a) - \old(b) ≡ (unsigned long)(\old(a) - \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_usubl_overflow(unsigned long a, unsigned long b, unsigned long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (unsigned long long)(\old(a) - \old(b)); ensures result_overflow: \old(a) - \old(b) ≡ (unsigned long long)(\old(a) - \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_usubll_overflow(unsigned long long a, unsigned long long b, unsigned long long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (int)(\old(a) * \old(b)); ensures result_overflow: \old(a) * \old(b) ≡ (int)(\old(a) * \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_smul_overflow(int a, int b, int *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (long)(\old(a) * \old(b)); ensures result_overflow: \old(a) * \old(b) ≡ (long)(\old(a) * \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_smull_overflow(long a, long b, long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (long long)(\old(a) * \old(b)); ensures result_overflow: \old(a) * \old(b) ≡ (long long)(\old(a) * \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_smulll_overflow(long long a, long long b, long long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (unsigned int)(\old(a) * \old(b)); ensures result_overflow: \old(a) * \old(b) ≡ (unsigned int)(\old(a) * \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_umul_overflow(unsigned int a, unsigned int b, unsigned int *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (unsigned long)(\old(a) * \old(b)); ensures result_overflow: \old(a) * \old(b) ≡ (unsigned long)(\old(a) * \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_umull_overflow(unsigned long a, unsigned long b, unsigned long *res); /*@ requires valid_res: \valid(res); ensures initialization: res: \initialized(\old(res)); ensures res_wrapped: *\old(res) ≡ (unsigned long long)(\old(a) * \old(b)); ensures result_overflow: \old(a) * \old(b) ≡ (unsigned long long)(\old(a) * \old(b))? \result ≡ 0: \result ≡ 1; assigns \result, *res; assigns \result \from a, b; assigns *res \from a, b; */ _Bool __builtin_umulll_overflow(unsigned long long a, unsigned long long b, unsigned long long *res); /*@ requires valid_filename: valid_read_string(filename); assigns \result; assigns \result \from (indirect: *(filename + (0 ..))), (indirect: mode); */ extern int creat(char const *filename, mode_t mode); /*@ assigns \result; assigns \result \from fd, cmd; */ extern int fcntl(int fd, int cmd, void * const *__va_params); /*@ requires valid_filename: valid_read_string(filename); assigns \result; assigns \result \from (indirect: *(filename + (0 ..))), (indirect: flags); */ extern int open(char const *filename, int flags, void * const *__va_params); /*@ requires valid_filename: valid_read_string(filename); assigns \result; assigns \result \from (indirect: dirfd), (indirect: *(filename + (0 ..))), (indirect: flags); */ extern int openat(int dirfd, char const *filename, int flags, void * const *__va_params); /*@ requires cmd_has_void_arg: cmd ≡ 1 ∨ cmd ≡ 3 ∨ cmd ≡ 9; assigns \result; assigns \result \from fd, cmd; */ extern int __va_fcntl_void(int fd, int cmd); /*@ requires cmd_has_int_arg: cmd ≡ 0 ∨ cmd ≡ 0x406 ∨ cmd ≡ 4 ∨ cmd ≡ 8 ∨ cmd ≡ 2; assigns \result; assigns \result \from fd, cmd, arg; */ extern int __va_fcntl_int(int fd, int cmd, int arg); /*@ requires cmd_as_flock_arg: cmd ≡ 5 ∨ cmd ≡ 6 ∨ cmd ≡ 7; requires valid_arg: \valid(arg); assigns \result, *arg; assigns \result \from fd, cmd, *arg; assigns *arg \from fd, cmd, *arg; */ extern int __va_fcntl_flock(int fd, int cmd, struct flock *arg); /*@ requires valid_filename: valid_read_string(filename); requires flag_not_CREAT: (flags & 0x40) ≡ 0; assigns \result; assigns \result \from (indirect: *(filename + (0 ..))), (indirect: flags); */ extern int __va_open_void(char const *filename, int flags); /*@ requires valid_filename: valid_read_string(filename); assigns \result; assigns \result \from (indirect: *(filename + (0 ..))), (indirect: flags), (indirect: mode); */ extern int __va_open_mode_t(char const *filename, int flags, mode_t mode); /*@ requires valid_filename: valid_read_string(filename); requires flag_not_CREAT: (flags & 0x40) ≡ 0; assigns \result; assigns \result \from (indirect: dirfd), (indirect: *(filename + (0 ..))), (indirect: flags); */ extern int __va_openat_void(int dirfd, char const *filename, int flags); /*@ requires valid_filename: valid_read_string(filename); assigns \result; assigns \result \from (indirect: dirfd), (indirect: *(filename + (0 ..))), (indirect: flags), (indirect: mode); */ extern int __va_openat_mode_t(int dirfd, char const *filename, int flags, mode_t mode); /*@ ghost extern int __fc_tz __attribute__((__FRAMA_C_MODEL__)); */ /*@ requires valid_path: valid_read_string(path); requires valid_times_or_null: \valid_read(times + (0 .. 1)) ∨ times ≡ \null; assigns \result; assigns \result \from (indirect: *(path + (0 .. strlen{Old}(path)))), (indirect: times), (indirect: *(times + (0 .. 1))); */ extern int utimes(char const *path, struct timeval const * /*[2]*/ times); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns tv->tv_sec, tv->tv_usec, *((struct timezone *)tz), \result; assigns tv->tv_sec \from __fc_time; assigns tv->tv_usec \from __fc_time; assigns *((struct timezone *)tz) \from __fc_tz; assigns \result \from (indirect: tv), (indirect: tz), *tv, *((struct timezone *)tz), __fc_tz; behavior tv_and_tz_null: assumes null_tv_tz: tv ≡ \null ∧ tz ≡ \null; assigns \result; assigns \result \from (indirect: __fc_tz); behavior tv_not_null: assumes non_null_tv_null_tz: tv ≢ \null ∧ tz ≡ \null; ensures initialization: tv_sec: tv_usec: \initialized(&\old(tv)->tv_sec) ∧ \initialized(&\old(tv)->tv_usec); ensures tv_usec_bounded: 0 ≤ \old(tv)->tv_usec ≤ 999999; assigns tv->tv_sec, tv->tv_usec, \result; assigns tv->tv_sec \from (indirect: __fc_time); assigns tv->tv_usec \from (indirect: __fc_time); assigns \result \from (indirect: *tv), (indirect: __fc_tz); behavior tz_not_null: assumes null_tv_non_null_tz: tv ≡ \null ∧ tz ≢ \null; ensures initialization: tz: \initialized((struct timezone *)\old(tz)); assigns *((struct timezone *)tz), \result; assigns *((struct timezone *)tz) \from __fc_tz; assigns \result \from (indirect: *((struct timezone *)tz)), (indirect: __fc_tz); behavior tv_and_tz_not_null: assumes non_null_tv_tz: tv ≢ \null ∧ tz ≢ \null; ensures initialization: tv_sec: tv_usec: \initialized(&\old(tv)->tv_sec) ∧ \initialized(&\old(tv)->tv_usec); ensures initialization: tz: \initialized((struct timezone *)\old(tz)); assigns tv->tv_sec, tv->tv_usec, *((struct timezone *)tz), \result; assigns tv->tv_sec \from (indirect: __fc_time); assigns tv->tv_usec \from (indirect: __fc_time); assigns *((struct timezone *)tz) \from __fc_tz; assigns \result \from (indirect: *tv), (indirect: *((struct timezone *)tz)), (indirect: __fc_tz); complete behaviors tv_and_tz_not_null, tz_not_null, tv_not_null, tv_and_tz_null; disjoint behaviors tv_and_tz_not_null, tz_not_null, tv_not_null, tv_and_tz_null; */ extern int gettimeofday(struct timeval * __restrict tv, void * __restrict tz); /*@ requires valid_tv_or_null: \valid_read(tv) ∨ tv ≡ \null; requires valid_tz_or_null: \valid_read(tz) ∨ tz ≡ \null; ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns __fc_time, __fc_tz, \result; assigns __fc_time \from tv->tv_sec, tv->tv_usec, tz->tz_dsttime, tz->tz_minuteswest; assigns __fc_tz \from tv->tv_sec, tv->tv_usec, tz->tz_dsttime, tz->tz_minuteswest; assigns \result \from (indirect: *tv), (indirect: *tz); */ extern int settimeofday(struct timeval const *tv, struct timezone const *tz); /*@ ghost struct itimerval volatile __fc_itimer_real __attribute__((__FRAMA_C_MODEL__)); */ /*@ ghost struct itimerval volatile __fc_itimer_virtual __attribute__((__FRAMA_C_MODEL__)); */ /*@ ghost struct itimerval volatile __fc_itimer_prof __attribute__((__FRAMA_C_MODEL__)); */ /*@ requires valid_curr_value: \valid(curr_value); ensures initialization: curr_value: \initialized(\old(curr_value)); assigns \result, *curr_value; assigns \result \from (indirect: which); assigns *curr_value \from __fc_itimer_real, __fc_itimer_virtual, __fc_itimer_prof; behavior real: assumes itimer_real: which ≡ 0; ensures result_ok: \result ≡ 0; assigns \result, *curr_value; assigns \result \from \nothing; assigns *curr_value \from __fc_itimer_real; behavior virtual: assumes itimer_virtual: which ≡ 1; ensures result_ok: \result ≡ 0; assigns \result, *curr_value; assigns \result \from \nothing; assigns *curr_value \from __fc_itimer_virtual; behavior prof: assumes itimer_prof: which ≡ 2; ensures result_ok: \result ≡ 0; assigns \result, *curr_value; assigns \result \from \nothing; assigns *curr_value \from __fc_itimer_prof; behavior invalid: assumes invalid_which: which ≢ 0 ∧ which ≢ 1 ∧ which ≢ 2; ensures result_error: \result ≡ -1; assigns \result; assigns \result \from \nothing; complete behaviors invalid, prof, virtual, real; disjoint behaviors invalid, prof, virtual, real; */ extern int getitimer(int which, struct itimerval *curr_value); /*@ requires valid_new_value: \valid_read(new_value); requires old_value_null_or_valid: old_value ≡ \null ∨ \valid(old_value); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *old_value, \result; assigns *old_value \from (indirect: which), (indirect: old_value), (indirect: new_value), __fc_itimer_real, __fc_itimer_virtual, __fc_itimer_prof; assigns \result \from (indirect: which), (indirect: new_value), (indirect: *new_value); behavior real: assumes itimer_real_and_valid: which ≡ 0 ≤ new_value->it_value.tv_usec ≤ 999999 ∧ 0 ≤ new_value->it_interval.tv_usec ≤ 999999; ensures result_ok: \result ≡ 0; ensures initialization: old_value: \initialized(\old(old_value)); assigns \result, *old_value, __fc_itimer_real; assigns \result \from \nothing; assigns *old_value \from __fc_itimer_real; assigns __fc_itimer_real \from *new_value; behavior virtual: assumes itimer_virtual_and_valid: which ≡ 1 ∧ 0 ≤ new_value->it_value.tv_usec ≤ 999999 ∧ 0 ≤ new_value->it_interval.tv_usec ≤ 999999; ensures result_ok: \result ≡ 0; ensures initialization: old_value: \initialized(\old(old_value)); assigns \result, *old_value; assigns \result \from \nothing; assigns *old_value \from __fc_itimer_virtual; behavior prof: assumes itimer_prof_and_valid: which ≡ 2 ∧ 0 ≤ new_value->it_value.tv_usec ≤ 999999 ∧ 0 ≤ new_value->it_interval.tv_usec ≤ 999999; ensures result_ok: \result ≡ 0; ensures initialization: old_value: \initialized(\old(old_value)); assigns \result, *old_value; assigns \result \from \nothing; assigns *old_value \from __fc_itimer_prof; behavior invalid: assumes invalid_itimer_or_new_value: (which ≢ 0 ∧ which ≢ 1 ∧ which ≢ 2) ∨ ¬(0 ≤ new_value->it_value.tv_usec ≤ 999999 ∧ 0 ≤ new_value->it_interval.tv_usec ≤ 999999); ensures result_error: \result ≡ -1; assigns \result; assigns \result \from \nothing; disjoint behaviors invalid, prof, virtual, real; */ extern int setitimer(int which, struct itimerval const * __restrict new_value, struct itimerval * __restrict old_value); /*@ ghost int volatile __fc_fds_state; */ /*@ requires nfds: nfds ≥ 0; requires readfs: readfds ≡ \null ∨ \valid(readfds); requires writefds: writefds ≡ \null ∨ \valid(writefds); requires errorfds: errorfds ≡ \null ∨ \valid(errorfds); requires timeout: timeout ≡ \null ∨ \valid(timeout); assigns __fc_fds_state, *readfds, *writefds, *errorfds, *timeout, \result; assigns __fc_fds_state \from __fc_fds_state; assigns *readfds \from (indirect: nfds), (indirect: readfds), (indirect: *readfds), (indirect: writefds), (indirect: *writefds), (indirect: errorfds), (indirect: *errorfds), (indirect: timeout), (indirect: *timeout), __fc_fds_state; assigns *writefds \from (indirect: nfds), (indirect: readfds), (indirect: *readfds), (indirect: writefds), (indirect: *writefds), (indirect: errorfds), (indirect: *errorfds), (indirect: timeout), (indirect: *timeout), __fc_fds_state; assigns *errorfds \from (indirect: nfds), (indirect: readfds), (indirect: *readfds), (indirect: writefds), (indirect: *writefds), (indirect: errorfds), (indirect: *errorfds), (indirect: timeout), (indirect: *timeout), __fc_fds_state; assigns *timeout \from (indirect: nfds), (indirect: readfds), (indirect: *readfds), (indirect: writefds), (indirect: *writefds), (indirect: errorfds), (indirect: *errorfds), (indirect: timeout), (indirect: *timeout), __fc_fds_state; assigns \result \from (indirect: nfds), (indirect: readfds), (indirect: *readfds), (indirect: writefds), (indirect: *writefds), (indirect: errorfds), (indirect: *errorfds), (indirect: timeout), (indirect: *timeout), __fc_fds_state; behavior read_notnull: assumes readfds_is_not_null: readfds ≢ \null; ensures initialization: readfds: \initialized(\old(readfds)); behavior write_notnull: assumes writefds_is_not_null: writefds ≢ \null; ensures initialization: writefds: \initialized(\old(writefds)); behavior error_notnull: assumes errorfds_is_not_null: errorfds ≢ \null; ensures initialization: errorfds: \initialized(\old(errorfds)); behavior timeout_notnull: assumes timeout_is_not_null: timeout ≢ \null; ensures initialization: timeout: \initialized(\old(timeout)); */ extern int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout); /*@ requires valid_string_path: valid_read_string(path); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: path), (indirect: *(path + (0 ..))), (indirect: mode); */ extern int mkdir(char const *path, mode_t mode); /*@ requires valid_pathname: valid_read_string(pathname); requires valid_buf: \valid(buf); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; ensures init_on_success: initialization: buf: \result ≡ 0 ⇒ \initialized(\old(buf)); assigns \result, *buf; assigns \result \from *(pathname + (0 ..)); assigns *buf \from *(pathname + (0 ..)); */ extern int stat(char const *pathname, struct stat *buf); /*@ assigns \result; assigns \result \from (indirect: cmask); */ extern mode_t umask(mode_t cmask); /*@ assigns *(*(outbuf + (0 .. *outbytesleft - 1))), __fc_errno; assigns *(*(outbuf + (0 .. *outbytesleft - 1))) \from *(*(inbuf + (0 .. *inbytesleft - 1))); */ extern size_t iconv(iconv_t cd, char ** __restrict inbuf, size_t * __restrict inbytesleft, char ** __restrict outbuf, size_t * __restrict outbytesleft); /*@ ensures result_zero_or_neg: \result ≡ 0 ∨ \result ≡ -1; assigns __fc_errno; */ extern int iconv_close(iconv_t); /*@ assigns \result, __fc_errno; assigns \result \from *(tocode + (..)), *(fromcode + (..)); */ extern iconv_t iconv_open(char const *tocode, char const *fromcode); extern char __fc_basename[256]; char *__fc_p_basename = __fc_basename; /*@ requires null_or_valid_string_path: path ≡ \null ∨ valid_read_string(path); ensures result_points_to_internal_storage_or_path: \subset(\result, {__fc_p_basename, \old(path)}); assigns *(path + (0 ..)), __fc_basename[0 ..], \result; assigns *(path + (0 ..)) \from *(path + (0 ..)), __fc_basename[0 ..]; assigns __fc_basename[0 ..] \from *(path + (0 ..)), __fc_basename[0 ..]; assigns \result \from __fc_p_basename, path; */ extern char *basename(char *path); extern char __fc_dirname[256]; char *__fc_p_dirname = __fc_dirname; /*@ requires null_or_valid_string_path: path ≡ \null ∨ valid_read_string(path); ensures result_points_to_internal_storage_or_path: \subset(\result, {__fc_p_dirname, \old(path)}); assigns *(path + (0 ..)), __fc_dirname[0 ..], \result; assigns *(path + (0 ..)) \from *(path + (0 ..)), __fc_dirname[0 ..]; assigns __fc_dirname[0 ..] \from *(path + (0 ..)), __fc_dirname[0 ..]; assigns \result \from __fc_p_dirname, path; */ extern char *dirname(char *path); /*@ requires valid_file_descriptors: \valid(fds + (0 .. nfds - 1)); ensures error_timeout_or_bounded: \result ≡ -1 ∨ \result ≡ 0 ∨ (1 ≤ \result ≤ \old(nfds)); ensures initialization: revents: \initialized(&(\old(fds) + (0 .. \old(nfds) - 1))->revents); assigns (fds + (0 .. nfds - 1))->revents, \result; assigns (fds + (0 .. nfds - 1))->revents \from (indirect: (fds + (0 .. nfds - 1))->fd), (fds + (0 .. nfds - 1))->events, (indirect: nfds), (indirect: timeout), (indirect: Frama_C_entropy_source); assigns \result \from (indirect: (fds + (0 .. nfds - 1))->fd), (indirect: (fds + (0 .. nfds - 1))->events), (indirect: nfds), (indirect: timeout), (indirect: Frama_C_entropy_source); */ extern int poll(struct pollfd *fds, nfds_t nfds, int timeout); /*@ requires valid_cond: \valid(cond); ensures sucess: \result ≡ 0; assigns \result; assigns \result \from \nothing; */ extern int pthread_cond_broadcast(pthread_cond_t *cond); /*@ requires valid_cond: \valid(cond); ensures success_or_error: \result ≡ 0 ∨ \result ≡ 16; assigns \result; assigns \result \from (indirect: *cond); */ extern int pthread_cond_destroy(pthread_cond_t *cond); /*@ requires valid_cond: \valid(cond); requires valid_null_attr: attr ≡ \null ∨ \valid_read(attr); ensures initialization: cond: \initialized(\old(cond)); ensures success: \result ≡ 0; assigns *cond, \result; assigns *cond \from *attr; assigns \result \from \nothing; */ extern int pthread_cond_init(pthread_cond_t * __restrict cond, pthread_condattr_t const * __restrict attr); /*@ requires valid_cond: \valid(cond); requires valid_mutex: \valid(mutex); ensures success: \result ≡ 0; assigns \result; assigns \result \from \nothing; */ extern int pthread_cond_wait(pthread_cond_t * __restrict cond, pthread_mutex_t * __restrict mutex); /*@ requires valid_thread: \valid(thread); requires valid_null_attr: attr ≡ \null ∨ \valid_read(attr); requires valid_routine: \valid_function(start_routine); requires valid_null_arg: arg ≡ \null ∨ \valid((char *)arg); ensures success_or_error: \result ≡ 0 ∨ \result ≡ 11 ∨ \result ≡ 22 ∨ \result ≡ 1; assigns *thread, \result; assigns *thread \from *attr; assigns \result \from (indirect: *attr); */ extern int pthread_create(pthread_t * __restrict thread, pthread_attr_t const * __restrict attr, void *(*start_routine)(void *), void * __restrict arg); /*@ requires valid_or_null_retval: retval ≡ \null ∨ \valid(retval); ensures success_or_error: \result ≡ 0 ∨ \result ≡ 35 ∨ \result ≡ 22 ∨ \result ≡ 3; assigns *retval, \result; assigns *retval \from thread; assigns \result \from (indirect: thread); behavior ignore_retval: assumes null_retval: retval ≡ \null; assigns \result; assigns \result \from (indirect: thread); behavior use_retval: assumes valid_retval: \valid(retval); assigns *retval, \result; assigns *retval \from thread; assigns \result \from (indirect: thread); */ extern int pthread_join(pthread_t thread, void **retval); /*@ requires mutex_valid: \valid(mutex); ensures init_or_busy: \result ≡ 0 ∨ \result ≡ 16; assigns *mutex, \result; assigns *mutex \from *mutex; assigns \result \from (indirect: *mutex); */ extern int pthread_mutex_destroy(pthread_mutex_t *mutex); /*@ requires mutex_valid: \valid(mutex); requires attrs_valid_or_null: attrs ≡ \null ∨ \valid_read(attrs); ensures initialization: success_or_error: (\result ≡ 0 ∧ \initialized(\old(mutex))) ∨ \result ≡ 11 ∨ \result ≡ 12 ∨ \result ≡ 1 ∨ \result ≡ 22; assigns *mutex, \result; assigns *mutex \from *mutex, *attrs; assigns \result \from (indirect: *mutex), (indirect: *attrs); */ extern int pthread_mutex_init(pthread_mutex_t * __restrict mutex, pthread_mutexattr_t const * __restrict attrs); /*@ requires mutex_valid: \valid(mutex); ensures success_or_error: \result ≡ 0 ∨ \result ≡ 11 ∨ \result ≡ 22 ∨ \result ≡ 35; assigns *mutex, \result; assigns *mutex \from *mutex; assigns \result \from (indirect: *mutex); */ extern int pthread_mutex_lock(pthread_mutex_t *mutex); /*@ requires mutex_valid: \valid(mutex); ensures success_or_error: \result ≡ 0 ∨ \result ≡ 1; assigns *mutex, \result; assigns *mutex \from *mutex; assigns \result \from (indirect: *mutex); */ extern int pthread_mutex_unlock(pthread_mutex_t *mutex); extern char __fc_getpwuid_pw_name[64]; extern char __fc_getpwuid_pw_passwd[64]; extern char __fc_getpwuid_pw_dir[64]; extern char __fc_getpwuid_pw_shell[64]; struct passwd __fc_pwd = {.pw_name = __fc_getpwuid_pw_name, .pw_passwd = __fc_getpwuid_pw_passwd, .pw_uid = 0U, .pw_gid = 0U, .pw_gecos = (char *)0, .pw_dir = __fc_getpwuid_pw_dir, .pw_shell = __fc_getpwuid_pw_shell}; struct passwd *__fc_p_pwd = & __fc_pwd; /*@ requires valid_name: valid_read_string(name); ensures result_null_or_internal_struct: \result ≡ \null ∨ \result ≡ __fc_p_pwd; assigns \result, __fc_pwd; assigns \result \from __fc_p_pwd, (indirect: *(name + (0 ..))); assigns __fc_pwd \from (indirect: *(name + (0 ..))); */ extern struct passwd *getpwnam(char const *name); /*@ ensures result_null_or_internal_struct: \result ≡ \null ∨ \result ≡ __fc_p_pwd; assigns \result, __fc_pwd; assigns \result \from __fc_p_pwd, (indirect: uid); assigns __fc_pwd \from (indirect: uid); */ extern struct passwd *getpwuid(uid_t uid); /*@ assigns *(env + (0 .. 4)); */ extern int setjmp(int * /*[5]*/ env); /*@ ensures never_terminates: \false; assigns \nothing; */ extern void longjmp(int * /*[5]*/ env, int val); /*@ ensures never_terminates: \false; assigns \nothing; */ extern void siglongjmp(sigjmp_buf env, int val); /*@ assigns \result; assigns \result \from (indirect: fd), (indirect: request); */ extern int __va_ioctl_void(int fd, int request); /*@ assigns \result; assigns \result \from (indirect: fd), (indirect: request), (indirect: arg); */ extern int __va_ioctl_int(int fd, int request, int arg); /*@ assigns \result, *((char *)argp + (0 ..)); assigns \result \from (indirect: fd), (indirect: request), (indirect: *((char *)argp + (0 ..))); assigns *((char *)argp + (0 ..)) \from (indirect: fd), (indirect: request), *((char *)argp + (0 ..)); */ extern int __va_ioctl_ptr(int fd, int request, void *argp); /*@ ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns \result; assigns \result \from (indirect: fd), (indirect: operation); */ extern int flock(int fd, int operation); CODE facilitynames[23] = {{.c_name = "auth", .c_val = 4 << 3}, {.c_name = "authpriv", .c_val = 10 << 3}, {.c_name = "cron", .c_val = 9 << 3}, {.c_name = "daemon", .c_val = 3 << 3}, {.c_name = "ftp", .c_val = 11 << 3}, {.c_name = "kern", .c_val = 0 << 3}, {.c_name = "lpr", .c_val = 6 << 3}, {.c_name = "mail", .c_val = 2 << 3}, {.c_name = "mark", .c_val = 24 | 0}, {.c_name = "news", .c_val = 7 << 3}, {.c_name = "security", .c_val = 4 << 3}, {.c_name = "syslog", .c_val = 5 << 3}, {.c_name = "user", .c_val = 1 << 3}, {.c_name = "uucp", .c_val = 8 << 3}, {.c_name = "local0", .c_val = 16 << 3}, {.c_name = "local1", .c_val = 17 << 3}, {.c_name = "local2", .c_val = 18 << 3}, {.c_name = "local3", .c_val = 19 << 3}, {.c_name = "local4", .c_val = 20 << 3}, {.c_name = "local5", .c_val = 21 << 3}, {.c_name = "local6", .c_val = 22 << 3}, {.c_name = "local7", .c_val = 23 << 3}, {.c_name = (char const *)0, .c_val = -1}}; CODE prioritynames[13] = {{.c_name = "alert", .c_val = 1}, {.c_name = "crit", .c_val = 2}, {.c_name = "debug", .c_val = 7}, {.c_name = "emerg", .c_val = 0}, {.c_name = "err", .c_val = 3}, {.c_name = "error", .c_val = 3}, {.c_name = "info", .c_val = 6}, {.c_name = "none", .c_val = 0x10}, {.c_name = "notice", .c_val = 5}, {.c_name = "panic", .c_val = 0}, {.c_name = "warn", .c_val = 4}, {.c_name = "warning", .c_val = 4}, {.c_name = (char const *)0, .c_val = -1}}; /*@ assigns \nothing; */ extern void closelog(void); /*@ assigns \nothing; */ extern void openlog(char const *, int, int); /*@ assigns \nothing; */ extern int setlogmask(int); /*@ assigns \nothing; */ extern void syslog(int, char const *, void * const *__va_params); /*@ assigns \nothing; */ extern void vsyslog(int, char const *, va_list); /*@ assigns \result; assigns \result \from which, who; */ extern int getpriority(int which, id_t who); /*@ assigns \result; assigns \result \from which, who, prio; */ extern int setpriority(int which, id_t who, int prio); /*@ requires valid_rlp: \valid(rlp); assigns \result, *rlp; assigns \result \from resource; assigns *rlp \from resource; */ extern int getrlimit(int resource, struct rlimit *rlp); /*@ requires valid_r_usage: \valid(r_usage); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *r_usage, \result; assigns *r_usage \from who; assigns \result \from (indirect: who); */ extern int getrusage(int who, struct rusage *r_usage); /*@ requires valid_rlp: \valid_read(rlp); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *rlp, \result; assigns *rlp \from resource; assigns \result \from (indirect: resource), (indirect: *rlp); */ extern int setrlimit(int resource, struct rlimit const *rlp); /*@ requires valid_buffer: \valid(buffer); assigns \result, *buffer; assigns \result \from __fc_time; assigns *buffer \from __fc_time; */ extern clock_t times(struct tms *buffer); /*@ ensures result_ok_or_error: \result ≡ -1 ∨ \result ≥ 0; ensures initialization: stat_loc_init_on_success: \result ≥ 0 ∧ \old(stat_loc) ≢ \null ⇒ \initialized(\old(stat_loc)); assigns \result, *stat_loc; assigns \result \from \nothing; assigns *stat_loc \from \nothing; behavior stat_loc_null: assumes stat_loc_null: stat_loc ≡ \null; assigns \result; assigns \result \from \nothing; behavior stat_loc_non_null: assumes stat_loc_non_null: stat_loc ≢ \null; requires valid_stat_loc: \valid(stat_loc); */ extern pid_t wait(int *stat_loc); /*@ ensures result_ok_or_error: \result ≡ -1 ∨ \result ≥ 0; ensures initialization: stat_loc_init_on_success: \result ≥ 0 ∧ \old(stat_loc) ≢ \null ⇒ \initialized(\old(stat_loc)); assigns \result, *stat_loc; assigns \result \from (indirect: options); assigns *stat_loc \from (indirect: options); behavior stat_loc_null: assumes stat_loc_null: stat_loc ≡ \null; assigns \result; assigns \result \from \nothing; behavior stat_loc_non_null: assumes stat_loc_non_null: stat_loc ≢ \null; requires valid_stat_loc: \valid(stat_loc); */ extern pid_t waitpid(pid_t pid, int *stat_loc, int options); /*@ requires valid_termios_p: \valid(termios_p); assigns \result, *termios_p, Frama_C_entropy_source; assigns \result \from (indirect: fd), (indirect: Frama_C_entropy_source); assigns *termios_p \from (indirect: fd), (indirect: Frama_C_entropy_source); assigns Frama_C_entropy_source \from Frama_C_entropy_source; behavior ok: assumes nondet: Frama_C_entropy_source ≡ 0; ensures initialization: termios_p: \initialized(\old(termios_p)); ensures result_ok: \result ≡ 0; behavior error: assumes nondet: Frama_C_entropy_source ≢ 0; ensures result_error: \result ≡ -1; complete behaviors error, ok; disjoint behaviors error, ok; */ extern int tcgetattr(int fd, struct termios *termios_p); /*@ requires valid_termios_p: \valid(termios_p); ensures result_ok_or_error: \result ≡ 0 ∨ \result ≡ -1; assigns *termios_p, Frama_C_entropy_source, \result; assigns *termios_p \from (indirect: fd), (indirect: optional_actions), (indirect: Frama_C_entropy_source), *termios_p; assigns Frama_C_entropy_source \from Frama_C_entropy_source; assigns \result \from (indirect: fd), (indirect: optional_actions), (indirect: Frama_C_entropy_source), (indirect: *termios_p); */ extern int tcsetattr(int fd, int optional_actions, struct termios *termios_p); void main(void) { /*@ assert __fc_p_fopen ≡ (FILE *)(&__fc_fopen); */ ; /*@ assert __fc_p_opendir ≡ (DIR *)(&__fc_opendir); */ ; /*@ assert __fc_p_time_tm ≡ &__fc_time_tm; */ ; /*@ assert __fc_p_strerror ≡ (char *)__fc_strerror; */ ; return; } frama-c-20.0-Calcium/tests/libc/oracle/fc_libc.2.res.oracle0000666000000000000000000001700613571573400020237 0ustar [kernel] Parsing share/libc/__fc_alloc_axiomatic.h (with preprocessing) [kernel] Parsing share/libc/__fc_builtin.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_blkcnt_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_blksize_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_clockid_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_dev_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_eof.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_fd_set_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_file.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_fpos_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_id_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_ino_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_intptr_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_iovec.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_key_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_mode_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_nlink_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_null.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_off_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_pid_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_pthread_types.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_sa_family_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_seek_macros.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_sigset_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_size_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_sockaddr.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_ssize_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_stat.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_suseconds_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_time_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_timer_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_timespec.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_uid_and_gid.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_useconds_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_wchar_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_define_wint_t.h (with preprocessing) [kernel] Parsing share/libc/__fc_gcc_builtins.h (with preprocessing) [kernel] Parsing share/libc/__fc_inet.h (with preprocessing) [kernel] Parsing share/libc/__fc_integer.h (with preprocessing) [kernel] Parsing share/libc/__fc_machdep.h (with preprocessing) skipping share/libc/__fc_machdep_linux_shared.h [kernel] Parsing share/libc/__fc_select.h (with preprocessing) [kernel] Parsing share/libc/__fc_string_axiomatic.h (with preprocessing) [kernel] Parsing share/libc/alloca.h (with preprocessing) [kernel] Parsing share/libc/arpa/inet.h (with preprocessing) [kernel] Parsing share/libc/assert.h (with preprocessing) [kernel] Parsing share/libc/byteswap.h (with preprocessing) skipping share/libc/complex.h [kernel] Parsing share/libc/ctype.h (with preprocessing) [kernel] Parsing share/libc/dirent.h (with preprocessing) [kernel] Parsing share/libc/dlfcn.h (with preprocessing) [kernel] Parsing share/libc/endian.h (with preprocessing) [kernel] Parsing share/libc/errno.h (with preprocessing) [kernel] Parsing share/libc/fcntl.h (with preprocessing) [kernel] Parsing share/libc/features.h (with preprocessing) [kernel] Parsing share/libc/fenv.h (with preprocessing) [kernel] Parsing share/libc/float.h (with preprocessing) [kernel] Parsing share/libc/fnmatch.h (with preprocessing) [kernel] Parsing share/libc/ftw.h (with preprocessing) [kernel] Parsing share/libc/getopt.h (with preprocessing) [kernel] Parsing share/libc/glob.h (with preprocessing) [kernel] Parsing share/libc/grp.h (with preprocessing) [kernel] Parsing share/libc/iconv.h (with preprocessing) [kernel] Parsing share/libc/ifaddrs.h (with preprocessing) [kernel] Parsing share/libc/inttypes.h (with preprocessing) [kernel] Parsing share/libc/iso646.h (with preprocessing) [kernel] Parsing share/libc/libgen.h (with preprocessing) [kernel] Parsing share/libc/limits.h (with preprocessing) [kernel] Parsing share/libc/locale.h (with preprocessing) [kernel] Parsing share/libc/malloc.h (with preprocessing) [kernel] Parsing share/libc/math.h (with preprocessing) [kernel] Parsing share/libc/memory.h (with preprocessing) [kernel] Parsing share/libc/net/if.h (with preprocessing) [kernel] Parsing share/libc/netdb.h (with preprocessing) [kernel] Parsing share/libc/netinet/in.h (with preprocessing) [kernel] Parsing share/libc/netinet/tcp.h (with preprocessing) [kernel] Parsing share/libc/nl_types.h (with preprocessing) [kernel] Parsing share/libc/poll.h (with preprocessing) [kernel] Parsing share/libc/pthread.h (with preprocessing) [kernel] Parsing share/libc/pwd.h (with preprocessing) [kernel] Parsing share/libc/regex.h (with preprocessing) [kernel] Parsing share/libc/resolv.h (with preprocessing) [kernel] Parsing share/libc/sched.h (with preprocessing) [kernel] Parsing share/libc/semaphore.h (with preprocessing) [kernel] Parsing share/libc/setjmp.h (with preprocessing) [kernel] Parsing share/libc/signal.h (with preprocessing) [kernel] Parsing share/libc/stdarg.h (with preprocessing) [kernel] Parsing share/libc/stdbool.h (with preprocessing) [kernel] Parsing share/libc/stddef.h (with preprocessing) [kernel] Parsing share/libc/stdint.h (with preprocessing) [kernel] Parsing share/libc/stdio.h (with preprocessing) [kernel] Parsing share/libc/stdlib.h (with preprocessing) [kernel] Parsing share/libc/string.h (with preprocessing) [kernel] Parsing share/libc/strings.h (with preprocessing) [kernel] Parsing share/libc/stropts.h (with preprocessing) [kernel] Parsing share/libc/sys/file.h (with preprocessing) [kernel] Parsing share/libc/sys/ioctl.h (with preprocessing) [kernel] Parsing share/libc/sys/ipc.h (with preprocessing) [kernel] Parsing share/libc/sys/mman.h (with preprocessing) [kernel] Parsing share/libc/sys/random.h (with preprocessing) [kernel] Parsing share/libc/sys/resource.h (with preprocessing) [kernel] Parsing share/libc/sys/select.h (with preprocessing) [kernel] Parsing share/libc/sys/shm.h (with preprocessing) [kernel] Parsing share/libc/sys/signal.h (with preprocessing) [kernel] Parsing share/libc/sys/socket.h (with preprocessing) [kernel] Parsing share/libc/sys/stat.h (with preprocessing) [kernel] Parsing share/libc/sys/time.h (with preprocessing) [kernel] Parsing share/libc/sys/times.h (with preprocessing) [kernel] Parsing share/libc/sys/timex.h (with preprocessing) [kernel] Parsing share/libc/sys/types.h (with preprocessing) [kernel] Parsing share/libc/sys/uio.h (with preprocessing) [kernel] Parsing share/libc/sys/un.h (with preprocessing) [kernel] Parsing share/libc/sys/utsname.h (with preprocessing) [kernel] Parsing share/libc/sys/wait.h (with preprocessing) [kernel] Parsing share/libc/syslog.h (with preprocessing) [kernel] Parsing share/libc/termios.h (with preprocessing) skipping share/libc/tgmath.h [kernel] Parsing share/libc/time.h (with preprocessing) [kernel] Parsing share/libc/unistd.h (with preprocessing) [kernel] Parsing share/libc/utime.h (with preprocessing) [kernel] Parsing share/libc/utmpx.h (with preprocessing) [kernel] Parsing share/libc/wchar.h (with preprocessing) [kernel] Parsing share/libc/wctype.h (with preprocessing) [kernel] Parsing tests/libc/fc_libc.c (with preprocessing) frama-c-20.0-Calcium/tests/libc/oracle/fc_libc.3.res.oracle0000666000000000000000000000007313571573400020234 0ustar [kernel] Parsing tests/libc/fc_libc.c (with preprocessing) frama-c-20.0-Calcium/tests/libc/oracle/fc_libc.4.res.oracle0000666000000000000000000000033313571573400020234 0ustar [kernel] Parsing tests/libc/fc_libc.c (with preprocessing) [kernel] parsing c11_functions.json [kernel] parsing glibc_functions.json [kernel] parsing posix_identifiers.json [kernel] parsing nonstandard_identifiers.json frama-c-20.0-Calcium/tests/libc/oracle/fc_libc.5.res.oracle0000666000000000000000000000003213571573400020231 0ustar #include "__fc_integer.h" frama-c-20.0-Calcium/tests/libc/oracle/fpclassify.res.oracle0000666000000000000000000001172613571573400020664 0ustar [kernel] Parsing tests/libc/fpclassify.c (with preprocessing) [kernel:parser:decimal-float] tests/libc/fpclassify.c:13: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:14. [eva] using specification for function __fc_fpclassify [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:15: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:16. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:17: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:18. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:19: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:20. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:21: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:24. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:25: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:26. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:27: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:29. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:30: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:31. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:32: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:33. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:34: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:35. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:36: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:39. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:40: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:41. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:42: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:44. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:45: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:46. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:47: assertion got status valid. [eva] computing for function __fc_fpclassifyf <- main. Called from tests/libc/fpclassify.c:49. [eva] using specification for function __fc_fpclassifyf [eva] Done for function __fc_fpclassifyf [eva] tests/libc/fpclassify.c:50: assertion got status valid. [eva] computing for function __fc_fpclassifyf <- main. Called from tests/libc/fpclassify.c:51. [eva] Done for function __fc_fpclassifyf [eva] tests/libc/fpclassify.c:52: assertion got status valid. [eva] computing for function __fc_fpclassifyf <- main. Called from tests/libc/fpclassify.c:54. [eva] Done for function __fc_fpclassifyf [eva] tests/libc/fpclassify.c:55: assertion got status valid. [eva] computing for function __fc_fpclassifyf <- main. Called from tests/libc/fpclassify.c:56. [eva] Done for function __fc_fpclassifyf [eva] tests/libc/fpclassify.c:57: assertion got status valid. [eva] computing for function __fc_fpclassifyf <- main. Called from tests/libc/fpclassify.c:58. [eva] Done for function __fc_fpclassifyf [eva] tests/libc/fpclassify.c:59: assertion got status valid. [eva] computing for function __fc_fpclassify <- main. Called from tests/libc/fpclassify.c:62. [eva] Done for function __fc_fpclassify [eva] tests/libc/fpclassify.c:63: assertion got status valid. [eva] computing for function __fc_fpclassifyf <- main. Called from tests/libc/fpclassify.c:66. [eva] Done for function __fc_fpclassifyf [eva] tests/libc/fpclassify.c:67: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: d ∈ [-1e-309 .. 0.] f ∈ [9.99999993382e+36 .. inf] classd ∈ {2; 3} classf ∈ {1; 4} is_nan ∈ {1} is_inf ∈ {1} is_normal ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/glob_c.res.oracle0000666000000000000000000002311713571573400017743 0ustar [kernel] Parsing tests/libc/glob_c.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function glob <- main. Called from tests/libc/glob_c.c:30. [eva] computing for function Frama_C_interval <- glob <- main. Called from share/libc/glob.c:32. [eva] using specification for function Frama_C_interval [eva] share/libc/glob.c:32: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] share/libc/glob.c:66: Call to builtin realloc [eva] share/libc/glob.c:66: function realloc: precondition 'freeable' got status valid. [eva] share/libc/glob.c:66: allocating variable __realloc_glob_l66 [eva] share/libc/glob.c:71: starting to merge loop iterations [eva] share/libc/glob.c:73: starting to merge loop iterations [eva:alarm] share/libc/glob.c:74: Warning: out of bounds write. assert \valid(pglob->gl_pathv + (unsigned int)((unsigned int)(reserve_offs + prev_len) + i_1)); [eva:alarm] share/libc/glob.c:76: Warning: out of bounds write. assert \valid(pglob->gl_pathv + (unsigned int)((unsigned int)(prev_len + reserve_offs) + pglob->gl_pathc)); [eva] computing for function Frama_C_nondet <- glob <- main. Called from share/libc/glob.c:77. [eva] using specification for function Frama_C_nondet [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- glob <- main. Called from share/libc/glob.c:82. [eva] share/libc/glob.c:82: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function globerr0 <- glob <- main. Called from share/libc/glob.c:82. [eva] Recording results for globerr0 [eva] Done for function globerr0 [eva] Recording results for glob [eva] Done for function glob [eva] computing for function globfree <- main. Called from tests/libc/glob_c.c:31. [eva:alarm] share/libc/glob.c:93: Warning: accessing uninitialized left-value. assert \initialized(&pglob->gl_pathv); [eva] share/libc/glob.c:93: Call to builtin free [eva] share/libc/glob.c:93: function free: precondition 'freeable' got status valid. [eva] Recording results for globfree [eva] Done for function globfree [eva] computing for function glob <- main. Called from tests/libc/glob_c.c:33. [eva] computing for function Frama_C_interval <- glob <- main. Called from share/libc/glob.c:32. [eva] Done for function Frama_C_interval [eva] share/libc/glob.c:66: Call to builtin realloc [eva] share/libc/glob.c:66: allocating variable __realloc_glob_l66_0 [eva] computing for function Frama_C_nondet <- glob <- main. Called from share/libc/glob.c:77. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- glob <- main. Called from share/libc/glob.c:82. [eva] Done for function Frama_C_interval [eva] share/libc/glob.c:82: Reusing old results for call to globerr0 [eva] Recording results for glob [eva] Done for function glob [eva] computing for function globfree <- main. Called from tests/libc/glob_c.c:34. [eva:alarm] share/libc/glob.c:93: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&pglob->gl_pathv); [eva] share/libc/glob.c:93: Call to builtin free [eva] Recording results for globfree [eva] Done for function globfree [eva] computing for function glob <- main. Called from tests/libc/glob_c.c:36. [eva] computing for function Frama_C_interval <- glob <- main. Called from share/libc/glob.c:32. [eva] Done for function Frama_C_interval [eva] share/libc/glob.c:50: Call to builtin realloc [eva] share/libc/glob.c:50: function realloc: precondition 'freeable' got status valid. [eva] share/libc/glob.c:50: allocating variable __realloc_glob_l50 [eva] share/libc/glob.c:66: Call to builtin realloc [eva] share/libc/glob.c:66: allocating variable __realloc_glob_l66_1 [eva] computing for function Frama_C_nondet <- glob <- main. Called from share/libc/glob.c:77. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- glob <- main. Called from share/libc/glob.c:82. [eva] Done for function Frama_C_interval [eva] computing for function globerr1 <- glob <- main. Called from share/libc/glob.c:82. [eva] Recording results for globerr1 [eva] Done for function globerr1 [eva] Recording results for glob [eva] Done for function glob [eva] computing for function globfree <- main. Called from tests/libc/glob_c.c:37. [eva] share/libc/glob.c:93: Call to builtin free [eva] Recording results for globfree [eva] Done for function globfree [eva] computing for function glob <- main. Called from tests/libc/glob_c.c:40. [eva] computing for function Frama_C_interval <- glob <- main. Called from share/libc/glob.c:32. [eva] Done for function Frama_C_interval [eva] share/libc/glob.c:50: Call to builtin realloc [eva] share/libc/glob.c:50: allocating variable __realloc_glob_l50_0 [eva] share/libc/glob.c:54: starting to merge loop iterations [eva] share/libc/glob.c:66: Call to builtin realloc [eva] share/libc/glob.c:66: allocating variable __realloc_glob_l66_2 [eva] computing for function Frama_C_nondet <- glob <- main. Called from share/libc/glob.c:77. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- glob <- main. Called from share/libc/glob.c:82. [eva] Done for function Frama_C_interval [eva] share/libc/glob.c:82: Reusing old results for call to globerr1 [eva] Recording results for glob [eva] Done for function glob [eva] computing for function globfree <- main. Called from tests/libc/glob_c.c:41. [eva] share/libc/glob.c:93: Call to builtin free [eva] Recording results for globfree [eva] Done for function globfree [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function globerr0: __retres ∈ {0} [eva:final-states] Values at end of function globerr1: __retres ∈ {1} [eva:final-states] Values at end of function globfree: gl.gl_pathc ∈ [1..10] .gl_pathv ∈ {{ NULL ; &__realloc_glob_l66[0] ; &__realloc_glob_l66_0[0] ; &__realloc_glob_l50[0] ; &__realloc_glob_l66_1[0] ; &__realloc_glob_l50_0[0] ; &__realloc_glob_l66_2[0] }} or ESCAPINGADDR .gl_offs ∈ {1} {.gl_flags; .gl_closedir; .gl_readdir; .gl_opendir; .gl_lstat; .gl_stat} ∈ UNINITIALIZED [eva:final-states] Values at end of function glob: Frama_C_entropy_source ∈ [--..--] reserve_offs ∈ {0; 1} prev_len ∈ {0} path ∈ {0} gl.gl_pathc ∈ [0..10] .gl_pathv ∈ {{ NULL ; &__realloc_glob_l66[0] ; &__realloc_glob_l66_0[0] ; &__realloc_glob_l50[0] ; &__realloc_glob_l66_1[0] ; &__realloc_glob_l50_0[0] ; &__realloc_glob_l66_2[0] }} or UNINITIALIZED or ESCAPINGADDR .gl_offs ∈ {1} {.gl_flags; .gl_closedir; .gl_readdir; .gl_opendir; .gl_lstat; .gl_stat} ∈ UNINITIALIZED __retres ∈ {0; 1; 2; 3} __realloc_glob_l66[0] ∈ {0} or UNINITIALIZED [1] ∈ {{ "glob result" }} or UNINITIALIZED [2..10] ∈ {{ NULL ; "glob result" }} or UNINITIALIZED [11] ∈ {0} or UNINITIALIZED __realloc_glob_l66_0[0] ∈ {{ "glob result" }} or UNINITIALIZED [1..9] ∈ {{ NULL ; "glob result" }} or UNINITIALIZED [10] ∈ {0} or UNINITIALIZED __realloc_glob_l50[0] ∈ {{ "bli" }} or UNINITIALIZED [1] ∈ {0} or UNINITIALIZED __realloc_glob_l66_1[0] ∈ {{ "glob result" }} or UNINITIALIZED [1..9] ∈ {{ NULL ; "glob result" }} or UNINITIALIZED [10] ∈ {0} or UNINITIALIZED __realloc_glob_l50_0[0] ∈ {0} or UNINITIALIZED [1] ∈ {{ "blo" }} or UNINITIALIZED [2] ∈ {0} or UNINITIALIZED __realloc_glob_l66_2[0] ∈ {0} or UNINITIALIZED [1] ∈ {{ "glob result" }} or UNINITIALIZED [2..10] ∈ {{ NULL ; "glob result" }} or UNINITIALIZED [11] ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] ret ∈ {0; 1; 2} flags ∈ {24} gl.gl_pathc ∈ [0..10] .gl_pathv ∈ {{ NULL ; &__realloc_glob_l50_0[0] ; &__realloc_glob_l66_2[0] }} or ESCAPINGADDR .gl_offs ∈ {1} {.gl_flags; .gl_closedir; .gl_readdir; .gl_opendir; .gl_lstat; .gl_stat} ∈ UNINITIALIZED __retres ∈ {0} __realloc_glob_l66[0] ∈ {0} or UNINITIALIZED [1] ∈ {{ "glob result" }} or UNINITIALIZED [2..10] ∈ {{ NULL ; "glob result" }} or UNINITIALIZED [11] ∈ {0} or UNINITIALIZED __realloc_glob_l66_0[0] ∈ {{ "glob result" }} or UNINITIALIZED [1..9] ∈ {{ NULL ; "glob result" }} or UNINITIALIZED [10] ∈ {0} or UNINITIALIZED __realloc_glob_l50[0] ∈ {{ "bli" }} or UNINITIALIZED [1] ∈ {0} or UNINITIALIZED __realloc_glob_l66_1[0] ∈ {{ "glob result" }} or UNINITIALIZED [1..9] ∈ {{ NULL ; "glob result" }} or UNINITIALIZED [10] ∈ {0} or UNINITIALIZED __realloc_glob_l50_0[0] ∈ {0} or UNINITIALIZED [1] ∈ {{ "blo" }} or UNINITIALIZED [2] ∈ {0} or UNINITIALIZED __realloc_glob_l66_2[0] ∈ {0} or UNINITIALIZED [1] ∈ {{ "glob result" }} or UNINITIALIZED [2..10] ∈ {{ NULL ; "glob result" }} or UNINITIALIZED [11] ∈ {0} or UNINITIALIZED frama-c-20.0-Calcium/tests/libc/oracle/inttypes_h.0.res.oracle0000666000000000000000000033313613571573400021047 0ustar [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "inttypes.h" #include "stdarg.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_1(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_1(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_2(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_2(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_3(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_4(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_4(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_5(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_5(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_6(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_6(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_7(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_7(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_8(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_8(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_9(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_9(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_10(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_10(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_11(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_11(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_12(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_12(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_13(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_13(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_14(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_14(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_15(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_15(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_16(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_16(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_17(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_17(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_18(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_18(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_19(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_19(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_20(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_20(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_21(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_21(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_22(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_22(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_23(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_23(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_24(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_24(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_25(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_25(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_26(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_26(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_27(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_27(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_28(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_28(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_29(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_29(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_30(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_30(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_31(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_31(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_32(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_32(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_33(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_33(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_34(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_34(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_35(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_35(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_36(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_36(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_37(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_37(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_38(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_38(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_39(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_39(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_40(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_40(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_41(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_41(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_42(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_42(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_43(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_43(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_44(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_44(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_45(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_45(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_46(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_46(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_47(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_47(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_48(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_48(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_49(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_49(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_50(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_50(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_51(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_51(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_52(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_52(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_53(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_53(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_54(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_54(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_55(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_55(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_56(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_56(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_57(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_57(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_58(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_58(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_59(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_59(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_60(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_60(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_61(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_61(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_62(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_62(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_63(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_63(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_64(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_64(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_65(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_65(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_66(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_66(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_67(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_67(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_68(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_68(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_69(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_69(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_70(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_70(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_71(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_71(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_72(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_72(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_73(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_73(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_74(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_74(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_75(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_75(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_76(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_76(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_77(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_77(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_78(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_78(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_79(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_79(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_80(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_80(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_81(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_81(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_82(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_82(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_83(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_83(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_84(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_84(char const * __restrict format, unsigned long param0); int main(void) { int __retres; { int8_t x; scanf_va_1("%hhd",(signed char *)(& x)); printf_va_1("%hhd",(int)x); scanf_va_2("%hhi",(signed char *)(& x)); printf_va_2("%hhi",(int)x); } { uint8_t x_0; scanf_va_3("%hho",(unsigned char *)(& x_0)); printf_va_3("%hho",(int)x_0); scanf_va_4("%hhu",(unsigned char *)(& x_0)); printf_va_4("%hhu",(int)x_0); scanf_va_5("%hhx",(unsigned char *)(& x_0)); printf_va_5("%hhx",(int)x_0); scanf_va_6("%hhx",(unsigned char *)(& x_0)); printf_va_6("%hhX",(int)x_0); } { int16_t x_1; scanf_va_7("%hd",(short *)(& x_1)); printf_va_7("%hd",(int)x_1); scanf_va_8("%hi",(short *)(& x_1)); printf_va_8("%hi",(int)x_1); } { uint16_t x_2; scanf_va_9("%ho",(unsigned short *)(& x_2)); printf_va_9("%ho",(unsigned int)x_2); scanf_va_10("%hu",(unsigned short *)(& x_2)); printf_va_10("%hu",(unsigned int)x_2); scanf_va_11("%hx",(unsigned short *)(& x_2)); printf_va_11("%hx",(unsigned int)x_2); scanf_va_12("%hx",(unsigned short *)(& x_2)); printf_va_12("%hX",(unsigned int)x_2); } { int32_t x_3; scanf_va_13("%ld",(long *)(& x_3)); printf_va_13("%ld",x_3); scanf_va_14("%li",(long *)(& x_3)); printf_va_14("%li",x_3); } { uint32_t x_4; scanf_va_15("%lo",(unsigned long *)(& x_4)); printf_va_15("%lo",x_4); scanf_va_16("%lu",(unsigned long *)(& x_4)); printf_va_16("%lu",x_4); scanf_va_17("%lx",(unsigned long *)(& x_4)); printf_va_17("%lx",x_4); scanf_va_18("%lx",(unsigned long *)(& x_4)); printf_va_18("%lX",x_4); } { int64_t x_5; scanf_va_19("%lld",(long long *)(& x_5)); printf_va_19("%lld",x_5); scanf_va_20("%lli",(long long *)(& x_5)); printf_va_20("%lli",x_5); } { uint64_t x_6; scanf_va_21("%llo",(unsigned long long *)(& x_6)); printf_va_21("%llo",x_6); scanf_va_22("%llu",(unsigned long long *)(& x_6)); printf_va_22("%llu",x_6); scanf_va_23("%llx",(unsigned long long *)(& x_6)); printf_va_23("%llx",x_6); scanf_va_24("%llx",(unsigned long long *)(& x_6)); printf_va_24("%llX",x_6); } { int_least8_t x_7; scanf_va_25("%hhd",(signed char *)(& x_7)); printf_va_25("%hhd",(int)x_7); scanf_va_26("%hhi",(signed char *)(& x_7)); printf_va_26("%hhi",(int)x_7); } { uint_least8_t x_8; scanf_va_27("%hho",(unsigned char *)(& x_8)); printf_va_27("%hho",(int)x_8); scanf_va_28("%hhu",(unsigned char *)(& x_8)); printf_va_28("%hhu",(int)x_8); scanf_va_29("%hhx",(unsigned char *)(& x_8)); printf_va_29("%hhx",(int)x_8); scanf_va_30("%hhx",(unsigned char *)(& x_8)); printf_va_30("%hhX",(int)x_8); } { int_least16_t x_9; scanf_va_31("%hd",(short *)(& x_9)); printf_va_31("%hd",(int)x_9); scanf_va_32("%hi",(short *)(& x_9)); printf_va_32("%hi",(int)x_9); } { uint_least16_t x_10; scanf_va_33("%ho",(unsigned short *)(& x_10)); printf_va_33("%ho",(unsigned int)x_10); scanf_va_34("%hu",(unsigned short *)(& x_10)); printf_va_34("%hu",(unsigned int)x_10); scanf_va_35("%hx",(unsigned short *)(& x_10)); printf_va_35("%hx",(unsigned int)x_10); scanf_va_36("%hx",(unsigned short *)(& x_10)); printf_va_36("%hX",(unsigned int)x_10); } { int_least32_t x_11; scanf_va_37("%ld",(long *)(& x_11)); printf_va_37("%ld",x_11); scanf_va_38("%li",(long *)(& x_11)); printf_va_38("%li",x_11); } { uint_least32_t x_12; scanf_va_39("%lo",(unsigned long *)(& x_12)); printf_va_39("%lo",x_12); scanf_va_40("%lu",(unsigned long *)(& x_12)); printf_va_40("%lu",x_12); scanf_va_41("%lx",(unsigned long *)(& x_12)); printf_va_41("%lx",x_12); scanf_va_42("%lx",(unsigned long *)(& x_12)); printf_va_42("%lX",x_12); } { int_least64_t x_13; scanf_va_43("%lld",(long long *)(& x_13)); printf_va_43("%lld",x_13); scanf_va_44("%lli",(long long *)(& x_13)); printf_va_44("%lli",x_13); } { uint_least64_t x_14; scanf_va_45("%llo",(unsigned long long *)(& x_14)); printf_va_45("%llo",x_14); scanf_va_46("%llu",(unsigned long long *)(& x_14)); printf_va_46("%llu",x_14); scanf_va_47("%llx",(unsigned long long *)(& x_14)); printf_va_47("%llx",x_14); scanf_va_48("%llx",(unsigned long long *)(& x_14)); printf_va_48("%llX",x_14); } { int_fast8_t x_15; scanf_va_49("%hhd",(signed char *)(& x_15)); printf_va_49("%hhd",(int)x_15); scanf_va_50("%hhi",(signed char *)(& x_15)); printf_va_50("%hhi",(int)x_15); } { uint_fast8_t x_16; scanf_va_51("%hho",(unsigned char *)(& x_16)); printf_va_51("%hho",(int)x_16); scanf_va_52("%hhu",(unsigned char *)(& x_16)); printf_va_52("%hhu",(int)x_16); scanf_va_53("%hhx",(unsigned char *)(& x_16)); printf_va_53("%hhx",(int)x_16); scanf_va_54("%hhx",(unsigned char *)(& x_16)); printf_va_54("%hhX",(int)x_16); } { int_fast16_t x_17; scanf_va_55("%d",(int *)(& x_17)); printf_va_55("%d",x_17); scanf_va_56("%i",(int *)(& x_17)); printf_va_56("%i",x_17); } { uint_fast16_t x_18; scanf_va_57("%o",(unsigned int *)(& x_18)); printf_va_57("%o",x_18); scanf_va_58("%u",(unsigned int *)(& x_18)); printf_va_58("%u",x_18); scanf_va_59("%x",(unsigned int *)(& x_18)); printf_va_59("%x",x_18); scanf_va_60("%x",(unsigned int *)(& x_18)); printf_va_60("%X",x_18); } { int_fast32_t x_19; scanf_va_61("%ld",(long *)(& x_19)); printf_va_61("%ld",x_19); scanf_va_62("%li",(long *)(& x_19)); printf_va_62("%li",x_19); } { uint_fast32_t x_20; scanf_va_63("%lo",(unsigned long *)(& x_20)); printf_va_63("%lo",x_20); scanf_va_64("%lu",(unsigned long *)(& x_20)); printf_va_64("%lu",x_20); scanf_va_65("%lx",(unsigned long *)(& x_20)); printf_va_65("%lx",x_20); scanf_va_66("%lx",(unsigned long *)(& x_20)); printf_va_66("%lX",x_20); } { int_fast64_t x_21; scanf_va_67("%lld",(long long *)(& x_21)); printf_va_67("%lld",x_21); scanf_va_68("%lli",(long long *)(& x_21)); printf_va_68("%lli",x_21); } { uint_fast64_t x_22; scanf_va_69("%llo",(unsigned long long *)(& x_22)); printf_va_69("%llo",x_22); scanf_va_70("%llu",(unsigned long long *)(& x_22)); printf_va_70("%llu",x_22); scanf_va_71("%llx",(unsigned long long *)(& x_22)); printf_va_71("%llx",x_22); scanf_va_72("%llx",(unsigned long long *)(& x_22)); printf_va_72("%llX",x_22); } { intmax_t x_23; scanf_va_73("%lld",(long long *)(& x_23)); printf_va_73("%lld",x_23); scanf_va_74("%lli",(long long *)(& x_23)); printf_va_74("%lli",x_23); } { uintmax_t x_24; scanf_va_75("%llo",(unsigned long long *)(& x_24)); printf_va_75("%llo",x_24); scanf_va_76("%llu",(unsigned long long *)(& x_24)); printf_va_76("%llu",x_24); scanf_va_77("%llx",(unsigned long long *)(& x_24)); printf_va_77("%llx",x_24); scanf_va_78("%llx",(unsigned long long *)(& x_24)); printf_va_78("%llX",x_24); } { intptr_t x_25; scanf_va_79("%ld",(long *)(& x_25)); printf_va_79("%ld",x_25); scanf_va_80("%li",(long *)(& x_25)); printf_va_80("%li",x_25); } { uintptr_t x_26; scanf_va_81("%lo",(unsigned long *)(& x_26)); printf_va_81("%lo",x_26); scanf_va_82("%lu",(unsigned long *)(& x_26)); printf_va_82("%lu",x_26); scanf_va_83("%lx",(unsigned long *)(& x_26)); printf_va_83("%lx",x_26); scanf_va_84("%lx",(unsigned long *)(& x_26)); printf_va_84("%lX",x_26); } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/libc/oracle/inttypes_h.1.res.oracle0000666000000000000000000033252613571573400021052 0ustar [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "inttypes.h" #include "stdarg.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_1(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_1(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_2(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_2(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_3(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_4(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_4(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_5(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_5(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_6(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_6(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_7(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_7(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_8(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_8(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_9(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_9(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_10(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_10(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_11(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_11(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_12(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_12(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_13(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_13(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_14(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_14(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_15(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_15(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_16(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_16(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_17(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_17(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_18(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_18(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_19(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_19(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_20(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_20(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_21(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_21(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_22(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_22(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_23(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_23(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_24(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_24(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_25(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_25(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_26(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_26(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_27(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_27(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_28(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_28(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_29(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_29(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_30(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_30(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_31(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_31(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_32(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_32(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_33(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_33(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_34(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_34(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_35(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_35(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_36(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_36(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_37(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_37(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_38(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_38(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_39(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_39(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_40(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_40(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_41(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_41(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_42(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_42(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_43(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_43(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_44(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_44(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_45(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_45(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_46(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_46(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_47(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_47(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_48(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_48(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_49(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_49(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_50(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_50(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_51(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_51(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_52(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_52(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_53(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_53(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_54(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_54(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_55(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_55(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_56(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_56(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_57(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_57(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_58(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_58(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_59(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_59(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_60(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_60(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_61(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_61(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_62(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_62(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_63(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_63(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_64(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_64(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_65(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_65(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_66(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_66(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_67(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_67(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_68(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_68(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_69(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_69(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_70(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_70(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_71(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_71(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_72(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_72(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_73(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_73(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_74(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_74(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_75(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_75(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_76(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_76(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_77(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_77(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_78(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_78(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_79(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_79(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_80(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_80(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_81(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_81(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_82(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_82(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_83(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_83(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_84(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_84(char const * __restrict format, unsigned int param0); int main(void) { int __retres; { int8_t x; scanf_va_1("%hhd",(signed char *)(& x)); printf_va_1("%hhd",(int)x); scanf_va_2("%hhi",(signed char *)(& x)); printf_va_2("%hhi",(int)x); } { uint8_t x_0; scanf_va_3("%hho",(unsigned char *)(& x_0)); printf_va_3("%hho",(int)x_0); scanf_va_4("%hhu",(unsigned char *)(& x_0)); printf_va_4("%hhu",(int)x_0); scanf_va_5("%hhx",(unsigned char *)(& x_0)); printf_va_5("%hhx",(int)x_0); scanf_va_6("%hhx",(unsigned char *)(& x_0)); printf_va_6("%hhX",(int)x_0); } { int16_t x_1; scanf_va_7("%hd",(short *)(& x_1)); printf_va_7("%hd",(int)x_1); scanf_va_8("%hi",(short *)(& x_1)); printf_va_8("%hi",(int)x_1); } { uint16_t x_2; scanf_va_9("%ho",(unsigned short *)(& x_2)); printf_va_9("%ho",(int)x_2); scanf_va_10("%hu",(unsigned short *)(& x_2)); printf_va_10("%hu",(int)x_2); scanf_va_11("%hx",(unsigned short *)(& x_2)); printf_va_11("%hx",(int)x_2); scanf_va_12("%hx",(unsigned short *)(& x_2)); printf_va_12("%hX",(int)x_2); } { int32_t x_3; scanf_va_13("%d",(int *)(& x_3)); printf_va_13("%d",x_3); scanf_va_14("%i",(int *)(& x_3)); printf_va_14("%i",x_3); } { uint32_t x_4; scanf_va_15("%o",(unsigned int *)(& x_4)); printf_va_15("%o",x_4); scanf_va_16("%u",(unsigned int *)(& x_4)); printf_va_16("%u",x_4); scanf_va_17("%x",(unsigned int *)(& x_4)); printf_va_17("%x",x_4); scanf_va_18("%x",(unsigned int *)(& x_4)); printf_va_18("%X",x_4); } { int64_t x_5; scanf_va_19("%lld",(long long *)(& x_5)); printf_va_19("%lld",x_5); scanf_va_20("%lli",(long long *)(& x_5)); printf_va_20("%lli",x_5); } { uint64_t x_6; scanf_va_21("%llo",(unsigned long long *)(& x_6)); printf_va_21("%llo",x_6); scanf_va_22("%llu",(unsigned long long *)(& x_6)); printf_va_22("%llu",x_6); scanf_va_23("%llx",(unsigned long long *)(& x_6)); printf_va_23("%llx",x_6); scanf_va_24("%llx",(unsigned long long *)(& x_6)); printf_va_24("%llX",x_6); } { int_least8_t x_7; scanf_va_25("%hhd",(signed char *)(& x_7)); printf_va_25("%hhd",(int)x_7); scanf_va_26("%hhi",(signed char *)(& x_7)); printf_va_26("%hhi",(int)x_7); } { uint_least8_t x_8; scanf_va_27("%hho",(unsigned char *)(& x_8)); printf_va_27("%hho",(int)x_8); scanf_va_28("%hhu",(unsigned char *)(& x_8)); printf_va_28("%hhu",(int)x_8); scanf_va_29("%hhx",(unsigned char *)(& x_8)); printf_va_29("%hhx",(int)x_8); scanf_va_30("%hhx",(unsigned char *)(& x_8)); printf_va_30("%hhX",(int)x_8); } { int_least16_t x_9; scanf_va_31("%hd",(short *)(& x_9)); printf_va_31("%hd",(int)x_9); scanf_va_32("%hi",(short *)(& x_9)); printf_va_32("%hi",(int)x_9); } { uint_least16_t x_10; scanf_va_33("%ho",(unsigned short *)(& x_10)); printf_va_33("%ho",(int)x_10); scanf_va_34("%hu",(unsigned short *)(& x_10)); printf_va_34("%hu",(int)x_10); scanf_va_35("%hx",(unsigned short *)(& x_10)); printf_va_35("%hx",(int)x_10); scanf_va_36("%hx",(unsigned short *)(& x_10)); printf_va_36("%hX",(int)x_10); } { int_least32_t x_11; scanf_va_37("%d",(int *)(& x_11)); printf_va_37("%d",x_11); scanf_va_38("%i",(int *)(& x_11)); printf_va_38("%i",x_11); } { uint_least32_t x_12; scanf_va_39("%o",(unsigned int *)(& x_12)); printf_va_39("%o",x_12); scanf_va_40("%u",(unsigned int *)(& x_12)); printf_va_40("%u",x_12); scanf_va_41("%x",(unsigned int *)(& x_12)); printf_va_41("%x",x_12); scanf_va_42("%x",(unsigned int *)(& x_12)); printf_va_42("%X",x_12); } { int_least64_t x_13; scanf_va_43("%lld",(long long *)(& x_13)); printf_va_43("%lld",x_13); scanf_va_44("%lli",(long long *)(& x_13)); printf_va_44("%lli",x_13); } { uint_least64_t x_14; scanf_va_45("%llo",(unsigned long long *)(& x_14)); printf_va_45("%llo",x_14); scanf_va_46("%llu",(unsigned long long *)(& x_14)); printf_va_46("%llu",x_14); scanf_va_47("%llx",(unsigned long long *)(& x_14)); printf_va_47("%llx",x_14); scanf_va_48("%llx",(unsigned long long *)(& x_14)); printf_va_48("%llX",x_14); } { int_fast8_t x_15; scanf_va_49("%hhd",(signed char *)(& x_15)); printf_va_49("%hhd",(int)x_15); scanf_va_50("%hhi",(signed char *)(& x_15)); printf_va_50("%hhi",(int)x_15); } { uint_fast8_t x_16; scanf_va_51("%hho",(unsigned char *)(& x_16)); printf_va_51("%hho",(int)x_16); scanf_va_52("%hhu",(unsigned char *)(& x_16)); printf_va_52("%hhu",(int)x_16); scanf_va_53("%hhx",(unsigned char *)(& x_16)); printf_va_53("%hhx",(int)x_16); scanf_va_54("%hhx",(unsigned char *)(& x_16)); printf_va_54("%hhX",(int)x_16); } { int_fast16_t x_17; scanf_va_55("%d",(int *)(& x_17)); printf_va_55("%d",x_17); scanf_va_56("%i",(int *)(& x_17)); printf_va_56("%i",x_17); } { uint_fast16_t x_18; scanf_va_57("%o",(unsigned int *)(& x_18)); printf_va_57("%o",x_18); scanf_va_58("%u",(unsigned int *)(& x_18)); printf_va_58("%u",x_18); scanf_va_59("%x",(unsigned int *)(& x_18)); printf_va_59("%x",x_18); scanf_va_60("%x",(unsigned int *)(& x_18)); printf_va_60("%X",x_18); } { int_fast32_t x_19; scanf_va_61("%d",(int *)(& x_19)); printf_va_61("%d",x_19); scanf_va_62("%i",(int *)(& x_19)); printf_va_62("%i",x_19); } { uint_fast32_t x_20; scanf_va_63("%o",(unsigned int *)(& x_20)); printf_va_63("%o",x_20); scanf_va_64("%u",(unsigned int *)(& x_20)); printf_va_64("%u",x_20); scanf_va_65("%x",(unsigned int *)(& x_20)); printf_va_65("%x",x_20); scanf_va_66("%x",(unsigned int *)(& x_20)); printf_va_66("%X",x_20); } { int_fast64_t x_21; scanf_va_67("%lld",(long long *)(& x_21)); printf_va_67("%lld",x_21); scanf_va_68("%lli",(long long *)(& x_21)); printf_va_68("%lli",x_21); } { uint_fast64_t x_22; scanf_va_69("%llo",(unsigned long long *)(& x_22)); printf_va_69("%llo",x_22); scanf_va_70("%llu",(unsigned long long *)(& x_22)); printf_va_70("%llu",x_22); scanf_va_71("%llx",(unsigned long long *)(& x_22)); printf_va_71("%llx",x_22); scanf_va_72("%llx",(unsigned long long *)(& x_22)); printf_va_72("%llX",x_22); } { intmax_t x_23; scanf_va_73("%lld",(long long *)(& x_23)); printf_va_73("%lld",x_23); scanf_va_74("%lli",(long long *)(& x_23)); printf_va_74("%lli",x_23); } { uintmax_t x_24; scanf_va_75("%llo",(unsigned long long *)(& x_24)); printf_va_75("%llo",x_24); scanf_va_76("%llu",(unsigned long long *)(& x_24)); printf_va_76("%llu",x_24); scanf_va_77("%llx",(unsigned long long *)(& x_24)); printf_va_77("%llx",x_24); scanf_va_78("%llx",(unsigned long long *)(& x_24)); printf_va_78("%llX",x_24); } { intptr_t x_25; scanf_va_79("%d",(int *)(& x_25)); printf_va_79("%d",x_25); scanf_va_80("%i",(int *)(& x_25)); printf_va_80("%i",x_25); } { uintptr_t x_26; scanf_va_81("%o",(unsigned int *)(& x_26)); printf_va_81("%o",x_26); scanf_va_82("%u",(unsigned int *)(& x_26)); printf_va_82("%u",x_26); scanf_va_83("%x",(unsigned int *)(& x_26)); printf_va_83("%x",x_26); scanf_va_84("%x",(unsigned int *)(& x_26)); printf_va_84("%X",x_26); } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/libc/oracle/inttypes_h.2.res.oracle0000666000000000000000000033210213571573400021041 0ustar [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "inttypes.h" #include "stdarg.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_1(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_1(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_2(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_2(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_3(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_4(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_4(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_5(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_5(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_6(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_6(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_7(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_7(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_8(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_8(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_9(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_9(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_10(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_10(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_11(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_11(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_12(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_12(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_13(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_13(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_14(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_14(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_15(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_15(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_16(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_16(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_17(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_17(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_18(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_18(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_19(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_19(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_20(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_20(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_21(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_21(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_22(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_22(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_23(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_23(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_24(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_24(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_25(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_25(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_26(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_26(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_27(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_27(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_28(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_28(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_29(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_29(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_30(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_30(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_31(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_31(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_32(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_32(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_33(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_33(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_34(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_34(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_35(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_35(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_36(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_36(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_37(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_37(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_38(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_38(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_39(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_39(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_40(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_40(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_41(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_41(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_42(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_42(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_43(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_43(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_44(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_44(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_45(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_45(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_46(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_46(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_47(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_47(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_48(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_48(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_49(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_49(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_50(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_50(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_51(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_51(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_52(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_52(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_53(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_53(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_54(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_54(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_55(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_55(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_56(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_56(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_57(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_57(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_58(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_58(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_59(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_59(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_60(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_60(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_61(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_61(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_62(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_62(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_63(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_63(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_64(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_64(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_65(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_65(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_66(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_66(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_67(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_67(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_68(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_68(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_69(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_69(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_70(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_70(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_71(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_71(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_72(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_72(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_73(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_73(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_74(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_74(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_75(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_75(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_76(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_76(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_77(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_77(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_78(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_78(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_79(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_79(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_80(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_80(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_81(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_81(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_82(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_82(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_83(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_83(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_84(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_84(char const * __restrict format, unsigned long param0); int main(void) { int __retres; { int8_t x; scanf_va_1("%hhd",(signed char *)(& x)); printf_va_1("%hhd",(int)x); scanf_va_2("%hhi",(signed char *)(& x)); printf_va_2("%hhi",(int)x); } { uint8_t x_0; scanf_va_3("%hho",(unsigned char *)(& x_0)); printf_va_3("%hho",(int)x_0); scanf_va_4("%hhu",(unsigned char *)(& x_0)); printf_va_4("%hhu",(int)x_0); scanf_va_5("%hhx",(unsigned char *)(& x_0)); printf_va_5("%hhx",(int)x_0); scanf_va_6("%hhx",(unsigned char *)(& x_0)); printf_va_6("%hhX",(int)x_0); } { int16_t x_1; scanf_va_7("%hd",(short *)(& x_1)); printf_va_7("%hd",(int)x_1); scanf_va_8("%hi",(short *)(& x_1)); printf_va_8("%hi",(int)x_1); } { uint16_t x_2; scanf_va_9("%ho",(unsigned short *)(& x_2)); printf_va_9("%ho",(int)x_2); scanf_va_10("%hu",(unsigned short *)(& x_2)); printf_va_10("%hu",(int)x_2); scanf_va_11("%hx",(unsigned short *)(& x_2)); printf_va_11("%hx",(int)x_2); scanf_va_12("%hx",(unsigned short *)(& x_2)); printf_va_12("%hX",(int)x_2); } { int32_t x_3; scanf_va_13("%d",(int *)(& x_3)); printf_va_13("%d",x_3); scanf_va_14("%i",(int *)(& x_3)); printf_va_14("%i",x_3); } { uint32_t x_4; scanf_va_15("%o",(unsigned int *)(& x_4)); printf_va_15("%o",x_4); scanf_va_16("%u",(unsigned int *)(& x_4)); printf_va_16("%u",x_4); scanf_va_17("%x",(unsigned int *)(& x_4)); printf_va_17("%x",x_4); scanf_va_18("%x",(unsigned int *)(& x_4)); printf_va_18("%X",x_4); } { int64_t x_5; scanf_va_19("%ld",(long *)(& x_5)); printf_va_19("%ld",x_5); scanf_va_20("%li",(long *)(& x_5)); printf_va_20("%li",x_5); } { uint64_t x_6; scanf_va_21("%lo",(unsigned long *)(& x_6)); printf_va_21("%lo",x_6); scanf_va_22("%lu",(unsigned long *)(& x_6)); printf_va_22("%lu",x_6); scanf_va_23("%lx",(unsigned long *)(& x_6)); printf_va_23("%lx",x_6); scanf_va_24("%lx",(unsigned long *)(& x_6)); printf_va_24("%lX",x_6); } { int_least8_t x_7; scanf_va_25("%hhd",(signed char *)(& x_7)); printf_va_25("%hhd",(int)x_7); scanf_va_26("%hhi",(signed char *)(& x_7)); printf_va_26("%hhi",(int)x_7); } { uint_least8_t x_8; scanf_va_27("%hho",(unsigned char *)(& x_8)); printf_va_27("%hho",(int)x_8); scanf_va_28("%hhu",(unsigned char *)(& x_8)); printf_va_28("%hhu",(int)x_8); scanf_va_29("%hhx",(unsigned char *)(& x_8)); printf_va_29("%hhx",(int)x_8); scanf_va_30("%hhx",(unsigned char *)(& x_8)); printf_va_30("%hhX",(int)x_8); } { int_least16_t x_9; scanf_va_31("%hd",(short *)(& x_9)); printf_va_31("%hd",(int)x_9); scanf_va_32("%hi",(short *)(& x_9)); printf_va_32("%hi",(int)x_9); } { uint_least16_t x_10; scanf_va_33("%ho",(unsigned short *)(& x_10)); printf_va_33("%ho",(int)x_10); scanf_va_34("%hu",(unsigned short *)(& x_10)); printf_va_34("%hu",(int)x_10); scanf_va_35("%hx",(unsigned short *)(& x_10)); printf_va_35("%hx",(int)x_10); scanf_va_36("%hx",(unsigned short *)(& x_10)); printf_va_36("%hX",(int)x_10); } { int_least32_t x_11; scanf_va_37("%d",(int *)(& x_11)); printf_va_37("%d",x_11); scanf_va_38("%i",(int *)(& x_11)); printf_va_38("%i",x_11); } { uint_least32_t x_12; scanf_va_39("%o",(unsigned int *)(& x_12)); printf_va_39("%o",x_12); scanf_va_40("%u",(unsigned int *)(& x_12)); printf_va_40("%u",x_12); scanf_va_41("%x",(unsigned int *)(& x_12)); printf_va_41("%x",x_12); scanf_va_42("%x",(unsigned int *)(& x_12)); printf_va_42("%X",x_12); } { int_least64_t x_13; scanf_va_43("%ld",(long *)(& x_13)); printf_va_43("%ld",x_13); scanf_va_44("%li",(long *)(& x_13)); printf_va_44("%li",x_13); } { uint_least64_t x_14; scanf_va_45("%lo",(unsigned long *)(& x_14)); printf_va_45("%lo",x_14); scanf_va_46("%lu",(unsigned long *)(& x_14)); printf_va_46("%lu",x_14); scanf_va_47("%lx",(unsigned long *)(& x_14)); printf_va_47("%lx",x_14); scanf_va_48("%lx",(unsigned long *)(& x_14)); printf_va_48("%lX",x_14); } { int_fast8_t x_15; scanf_va_49("%hhd",(signed char *)(& x_15)); printf_va_49("%hhd",(int)x_15); scanf_va_50("%hhi",(signed char *)(& x_15)); printf_va_50("%hhi",(int)x_15); } { uint_fast8_t x_16; scanf_va_51("%hho",(unsigned char *)(& x_16)); printf_va_51("%hho",(int)x_16); scanf_va_52("%hhu",(unsigned char *)(& x_16)); printf_va_52("%hhu",(int)x_16); scanf_va_53("%hhx",(unsigned char *)(& x_16)); printf_va_53("%hhx",(int)x_16); scanf_va_54("%hhx",(unsigned char *)(& x_16)); printf_va_54("%hhX",(int)x_16); } { int_fast16_t x_17; scanf_va_55("%d",(int *)(& x_17)); printf_va_55("%d",x_17); scanf_va_56("%i",(int *)(& x_17)); printf_va_56("%i",x_17); } { uint_fast16_t x_18; scanf_va_57("%o",(unsigned int *)(& x_18)); printf_va_57("%o",x_18); scanf_va_58("%u",(unsigned int *)(& x_18)); printf_va_58("%u",x_18); scanf_va_59("%x",(unsigned int *)(& x_18)); printf_va_59("%x",x_18); scanf_va_60("%x",(unsigned int *)(& x_18)); printf_va_60("%X",x_18); } { int_fast32_t x_19; scanf_va_61("%d",(int *)(& x_19)); printf_va_61("%d",x_19); scanf_va_62("%i",(int *)(& x_19)); printf_va_62("%i",x_19); } { uint_fast32_t x_20; scanf_va_63("%o",(unsigned int *)(& x_20)); printf_va_63("%o",x_20); scanf_va_64("%u",(unsigned int *)(& x_20)); printf_va_64("%u",x_20); scanf_va_65("%x",(unsigned int *)(& x_20)); printf_va_65("%x",x_20); scanf_va_66("%x",(unsigned int *)(& x_20)); printf_va_66("%X",x_20); } { int_fast64_t x_21; scanf_va_67("%ld",(long *)(& x_21)); printf_va_67("%ld",x_21); scanf_va_68("%li",(long *)(& x_21)); printf_va_68("%li",x_21); } { uint_fast64_t x_22; scanf_va_69("%lo",(unsigned long *)(& x_22)); printf_va_69("%lo",x_22); scanf_va_70("%lu",(unsigned long *)(& x_22)); printf_va_70("%lu",x_22); scanf_va_71("%lx",(unsigned long *)(& x_22)); printf_va_71("%lx",x_22); scanf_va_72("%lx",(unsigned long *)(& x_22)); printf_va_72("%lX",x_22); } { intmax_t x_23; scanf_va_73("%lld",(long long *)(& x_23)); printf_va_73("%lld",x_23); scanf_va_74("%lli",(long long *)(& x_23)); printf_va_74("%lli",x_23); } { uintmax_t x_24; scanf_va_75("%llo",(unsigned long long *)(& x_24)); printf_va_75("%llo",x_24); scanf_va_76("%llu",(unsigned long long *)(& x_24)); printf_va_76("%llu",x_24); scanf_va_77("%llx",(unsigned long long *)(& x_24)); printf_va_77("%llx",x_24); scanf_va_78("%llx",(unsigned long long *)(& x_24)); printf_va_78("%llX",x_24); } { intptr_t x_25; scanf_va_79("%ld",(long *)(& x_25)); printf_va_79("%ld",x_25); scanf_va_80("%li",(long *)(& x_25)); printf_va_80("%li",x_25); } { uintptr_t x_26; scanf_va_81("%lo",(unsigned long *)(& x_26)); printf_va_81("%lo",x_26); scanf_va_82("%lu",(unsigned long *)(& x_26)); printf_va_82("%lu",x_26); scanf_va_83("%lx",(unsigned long *)(& x_26)); printf_va_83("%lx",x_26); scanf_va_84("%lx",(unsigned long *)(& x_26)); printf_va_84("%lX",x_26); } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/libc/oracle/inttypes_h.3.res.oracle0000666000000000000000000033313613571573400021052 0ustar [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "inttypes.h" #include "stdarg.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_1(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_1(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_2(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_2(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_3(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_4(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_4(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_5(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_5(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_6(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_6(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_7(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_7(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_8(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_8(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_9(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_9(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_10(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_10(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_11(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_11(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_12(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_12(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_13(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_13(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_14(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_14(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_15(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_15(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_16(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_16(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_17(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_17(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_18(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_18(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_19(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_19(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_20(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_20(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_21(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_21(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_22(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_22(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_23(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_23(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_24(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_24(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_25(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_25(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_26(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_26(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_27(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_27(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_28(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_28(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_29(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_29(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_30(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_30(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_31(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_31(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_32(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_32(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_33(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_33(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_34(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_34(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_35(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_35(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_36(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_36(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_37(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_37(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_38(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_38(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_39(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_39(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_40(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_40(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_41(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_41(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_42(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_42(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_43(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_43(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_44(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_44(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_45(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_45(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_46(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_46(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_47(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_47(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_48(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_48(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_49(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_49(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_50(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_50(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_51(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_51(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_52(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_52(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_53(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_53(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_54(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_54(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_55(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_55(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_56(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_56(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_57(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_57(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_58(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_58(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_59(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_59(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_60(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_60(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_61(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_61(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_62(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_62(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_63(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_63(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_64(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_64(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_65(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_65(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_66(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_66(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_67(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_67(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_68(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_68(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_69(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_69(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_70(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_70(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_71(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_71(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_72(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_72(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_73(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_73(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_74(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_74(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_75(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_75(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_76(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_76(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_77(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_77(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_78(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_78(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_79(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_79(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_80(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_80(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_81(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_81(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_82(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_82(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_83(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_83(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_84(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_84(char const * __restrict format, unsigned long param0); int main(void) { int __retres; { int8_t x; scanf_va_1("%hhd",(signed char *)(& x)); printf_va_1("%hhd",(int)x); scanf_va_2("%hhi",(signed char *)(& x)); printf_va_2("%hhi",(int)x); } { uint8_t x_0; scanf_va_3("%hho",(unsigned char *)(& x_0)); printf_va_3("%hho",(int)x_0); scanf_va_4("%hhu",(unsigned char *)(& x_0)); printf_va_4("%hhu",(int)x_0); scanf_va_5("%hhx",(unsigned char *)(& x_0)); printf_va_5("%hhx",(int)x_0); scanf_va_6("%hhx",(unsigned char *)(& x_0)); printf_va_6("%hhX",(int)x_0); } { int16_t x_1; scanf_va_7("%hd",(short *)(& x_1)); printf_va_7("%hd",(int)x_1); scanf_va_8("%hi",(short *)(& x_1)); printf_va_8("%hi",(int)x_1); } { uint16_t x_2; scanf_va_9("%ho",(unsigned short *)(& x_2)); printf_va_9("%ho",(unsigned int)x_2); scanf_va_10("%hu",(unsigned short *)(& x_2)); printf_va_10("%hu",(unsigned int)x_2); scanf_va_11("%hx",(unsigned short *)(& x_2)); printf_va_11("%hx",(unsigned int)x_2); scanf_va_12("%hx",(unsigned short *)(& x_2)); printf_va_12("%hX",(unsigned int)x_2); } { int32_t x_3; scanf_va_13("%ld",(long *)(& x_3)); printf_va_13("%ld",x_3); scanf_va_14("%li",(long *)(& x_3)); printf_va_14("%li",x_3); } { uint32_t x_4; scanf_va_15("%lo",(unsigned long *)(& x_4)); printf_va_15("%lo",x_4); scanf_va_16("%lu",(unsigned long *)(& x_4)); printf_va_16("%lu",x_4); scanf_va_17("%lx",(unsigned long *)(& x_4)); printf_va_17("%lx",x_4); scanf_va_18("%lx",(unsigned long *)(& x_4)); printf_va_18("%lX",x_4); } { int64_t x_5; scanf_va_19("%lld",(long long *)(& x_5)); printf_va_19("%lld",x_5); scanf_va_20("%lli",(long long *)(& x_5)); printf_va_20("%lli",x_5); } { uint64_t x_6; scanf_va_21("%llo",(unsigned long long *)(& x_6)); printf_va_21("%llo",x_6); scanf_va_22("%llu",(unsigned long long *)(& x_6)); printf_va_22("%llu",x_6); scanf_va_23("%llx",(unsigned long long *)(& x_6)); printf_va_23("%llx",x_6); scanf_va_24("%llx",(unsigned long long *)(& x_6)); printf_va_24("%llX",x_6); } { int_least8_t x_7; scanf_va_25("%hhd",(signed char *)(& x_7)); printf_va_25("%hhd",(int)x_7); scanf_va_26("%hhi",(signed char *)(& x_7)); printf_va_26("%hhi",(int)x_7); } { uint_least8_t x_8; scanf_va_27("%hho",(unsigned char *)(& x_8)); printf_va_27("%hho",(int)x_8); scanf_va_28("%hhu",(unsigned char *)(& x_8)); printf_va_28("%hhu",(int)x_8); scanf_va_29("%hhx",(unsigned char *)(& x_8)); printf_va_29("%hhx",(int)x_8); scanf_va_30("%hhx",(unsigned char *)(& x_8)); printf_va_30("%hhX",(int)x_8); } { int_least16_t x_9; scanf_va_31("%hd",(short *)(& x_9)); printf_va_31("%hd",(int)x_9); scanf_va_32("%hi",(short *)(& x_9)); printf_va_32("%hi",(int)x_9); } { uint_least16_t x_10; scanf_va_33("%ho",(unsigned short *)(& x_10)); printf_va_33("%ho",(unsigned int)x_10); scanf_va_34("%hu",(unsigned short *)(& x_10)); printf_va_34("%hu",(unsigned int)x_10); scanf_va_35("%hx",(unsigned short *)(& x_10)); printf_va_35("%hx",(unsigned int)x_10); scanf_va_36("%hx",(unsigned short *)(& x_10)); printf_va_36("%hX",(unsigned int)x_10); } { int_least32_t x_11; scanf_va_37("%ld",(long *)(& x_11)); printf_va_37("%ld",x_11); scanf_va_38("%li",(long *)(& x_11)); printf_va_38("%li",x_11); } { uint_least32_t x_12; scanf_va_39("%lo",(unsigned long *)(& x_12)); printf_va_39("%lo",x_12); scanf_va_40("%lu",(unsigned long *)(& x_12)); printf_va_40("%lu",x_12); scanf_va_41("%lx",(unsigned long *)(& x_12)); printf_va_41("%lx",x_12); scanf_va_42("%lx",(unsigned long *)(& x_12)); printf_va_42("%lX",x_12); } { int_least64_t x_13; scanf_va_43("%lld",(long long *)(& x_13)); printf_va_43("%lld",x_13); scanf_va_44("%lli",(long long *)(& x_13)); printf_va_44("%lli",x_13); } { uint_least64_t x_14; scanf_va_45("%llo",(unsigned long long *)(& x_14)); printf_va_45("%llo",x_14); scanf_va_46("%llu",(unsigned long long *)(& x_14)); printf_va_46("%llu",x_14); scanf_va_47("%llx",(unsigned long long *)(& x_14)); printf_va_47("%llx",x_14); scanf_va_48("%llx",(unsigned long long *)(& x_14)); printf_va_48("%llX",x_14); } { int_fast8_t x_15; scanf_va_49("%hhd",(signed char *)(& x_15)); printf_va_49("%hhd",(int)x_15); scanf_va_50("%hhi",(signed char *)(& x_15)); printf_va_50("%hhi",(int)x_15); } { uint_fast8_t x_16; scanf_va_51("%hho",(unsigned char *)(& x_16)); printf_va_51("%hho",(int)x_16); scanf_va_52("%hhu",(unsigned char *)(& x_16)); printf_va_52("%hhu",(int)x_16); scanf_va_53("%hhx",(unsigned char *)(& x_16)); printf_va_53("%hhx",(int)x_16); scanf_va_54("%hhx",(unsigned char *)(& x_16)); printf_va_54("%hhX",(int)x_16); } { int_fast16_t x_17; scanf_va_55("%d",(int *)(& x_17)); printf_va_55("%d",x_17); scanf_va_56("%i",(int *)(& x_17)); printf_va_56("%i",x_17); } { uint_fast16_t x_18; scanf_va_57("%o",(unsigned int *)(& x_18)); printf_va_57("%o",x_18); scanf_va_58("%u",(unsigned int *)(& x_18)); printf_va_58("%u",x_18); scanf_va_59("%x",(unsigned int *)(& x_18)); printf_va_59("%x",x_18); scanf_va_60("%x",(unsigned int *)(& x_18)); printf_va_60("%X",x_18); } { int_fast32_t x_19; scanf_va_61("%ld",(long *)(& x_19)); printf_va_61("%ld",x_19); scanf_va_62("%li",(long *)(& x_19)); printf_va_62("%li",x_19); } { uint_fast32_t x_20; scanf_va_63("%lo",(unsigned long *)(& x_20)); printf_va_63("%lo",x_20); scanf_va_64("%lu",(unsigned long *)(& x_20)); printf_va_64("%lu",x_20); scanf_va_65("%lx",(unsigned long *)(& x_20)); printf_va_65("%lx",x_20); scanf_va_66("%lx",(unsigned long *)(& x_20)); printf_va_66("%lX",x_20); } { int_fast64_t x_21; scanf_va_67("%lld",(long long *)(& x_21)); printf_va_67("%lld",x_21); scanf_va_68("%lli",(long long *)(& x_21)); printf_va_68("%lli",x_21); } { uint_fast64_t x_22; scanf_va_69("%llo",(unsigned long long *)(& x_22)); printf_va_69("%llo",x_22); scanf_va_70("%llu",(unsigned long long *)(& x_22)); printf_va_70("%llu",x_22); scanf_va_71("%llx",(unsigned long long *)(& x_22)); printf_va_71("%llx",x_22); scanf_va_72("%llx",(unsigned long long *)(& x_22)); printf_va_72("%llX",x_22); } { intmax_t x_23; scanf_va_73("%lld",(long long *)(& x_23)); printf_va_73("%lld",x_23); scanf_va_74("%lli",(long long *)(& x_23)); printf_va_74("%lli",x_23); } { uintmax_t x_24; scanf_va_75("%llo",(unsigned long long *)(& x_24)); printf_va_75("%llo",x_24); scanf_va_76("%llu",(unsigned long long *)(& x_24)); printf_va_76("%llu",x_24); scanf_va_77("%llx",(unsigned long long *)(& x_24)); printf_va_77("%llx",x_24); scanf_va_78("%llx",(unsigned long long *)(& x_24)); printf_va_78("%llX",x_24); } { intptr_t x_25; scanf_va_79("%ld",(long *)(& x_25)); printf_va_79("%ld",x_25); scanf_va_80("%li",(long *)(& x_25)); printf_va_80("%li",x_25); } { uintptr_t x_26; scanf_va_81("%lo",(unsigned long *)(& x_26)); printf_va_81("%lo",x_26); scanf_va_82("%lu",(unsigned long *)(& x_26)); printf_va_82("%lu",x_26); scanf_va_83("%lx",(unsigned long *)(& x_26)); printf_va_83("%lx",x_26); scanf_va_84("%lx",(unsigned long *)(& x_26)); printf_va_84("%lX",x_26); } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/libc/oracle/inttypes_h.4.res.oracle0000666000000000000000000033252613571573400021055 0ustar [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "inttypes.h" #include "stdarg.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_1(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_1(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_2(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_2(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_3(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_4(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_4(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_5(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_5(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_6(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_6(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_7(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_7(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_8(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_8(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_9(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_9(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_10(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_10(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_11(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_11(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_12(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_12(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_13(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_13(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_14(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_14(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_15(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_15(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_16(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_16(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_17(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_17(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_18(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_18(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_19(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_19(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_20(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_20(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_21(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_21(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_22(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_22(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_23(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_23(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_24(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_24(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_25(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_25(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_26(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_26(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_27(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_27(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_28(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_28(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_29(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_29(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_30(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_30(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_31(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_31(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_32(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_32(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_33(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_33(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_34(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_34(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_35(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_35(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_36(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_36(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_37(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_37(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_38(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_38(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_39(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_39(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_40(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_40(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_41(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_41(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_42(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_42(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_43(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_43(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_44(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_44(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_45(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_45(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_46(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_46(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_47(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_47(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_48(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_48(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_49(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_49(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_50(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_50(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_51(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_51(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_52(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_52(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_53(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_53(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_54(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_54(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_55(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_55(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_56(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_56(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_57(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_57(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_58(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_58(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_59(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_59(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_60(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_60(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_61(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_61(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_62(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_62(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_63(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_63(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_64(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_64(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_65(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_65(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_66(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_66(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_67(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_67(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_68(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_68(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_69(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_69(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_70(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_70(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_71(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_71(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_72(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_72(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_73(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_73(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_74(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_74(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_75(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_75(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_76(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_76(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_77(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_77(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_78(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_78(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_79(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_79(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_80(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_80(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_81(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_81(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_82(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_82(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_83(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_83(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_84(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_84(char const * __restrict format, unsigned int param0); int main(void) { int __retres; { int8_t x; scanf_va_1("%hhd",(signed char *)(& x)); printf_va_1("%hhd",(int)x); scanf_va_2("%hhi",(signed char *)(& x)); printf_va_2("%hhi",(int)x); } { uint8_t x_0; scanf_va_3("%hho",(unsigned char *)(& x_0)); printf_va_3("%hho",(int)x_0); scanf_va_4("%hhu",(unsigned char *)(& x_0)); printf_va_4("%hhu",(int)x_0); scanf_va_5("%hhx",(unsigned char *)(& x_0)); printf_va_5("%hhx",(int)x_0); scanf_va_6("%hhx",(unsigned char *)(& x_0)); printf_va_6("%hhX",(int)x_0); } { int16_t x_1; scanf_va_7("%hd",(short *)(& x_1)); printf_va_7("%hd",(int)x_1); scanf_va_8("%hi",(short *)(& x_1)); printf_va_8("%hi",(int)x_1); } { uint16_t x_2; scanf_va_9("%ho",(unsigned short *)(& x_2)); printf_va_9("%ho",(int)x_2); scanf_va_10("%hu",(unsigned short *)(& x_2)); printf_va_10("%hu",(int)x_2); scanf_va_11("%hx",(unsigned short *)(& x_2)); printf_va_11("%hx",(int)x_2); scanf_va_12("%hx",(unsigned short *)(& x_2)); printf_va_12("%hX",(int)x_2); } { int32_t x_3; scanf_va_13("%d",(int *)(& x_3)); printf_va_13("%d",x_3); scanf_va_14("%i",(int *)(& x_3)); printf_va_14("%i",x_3); } { uint32_t x_4; scanf_va_15("%o",(unsigned int *)(& x_4)); printf_va_15("%o",x_4); scanf_va_16("%u",(unsigned int *)(& x_4)); printf_va_16("%u",x_4); scanf_va_17("%x",(unsigned int *)(& x_4)); printf_va_17("%x",x_4); scanf_va_18("%x",(unsigned int *)(& x_4)); printf_va_18("%X",x_4); } { int64_t x_5; scanf_va_19("%lld",(long long *)(& x_5)); printf_va_19("%lld",x_5); scanf_va_20("%lli",(long long *)(& x_5)); printf_va_20("%lli",x_5); } { uint64_t x_6; scanf_va_21("%llo",(unsigned long long *)(& x_6)); printf_va_21("%llo",x_6); scanf_va_22("%llu",(unsigned long long *)(& x_6)); printf_va_22("%llu",x_6); scanf_va_23("%llx",(unsigned long long *)(& x_6)); printf_va_23("%llx",x_6); scanf_va_24("%llx",(unsigned long long *)(& x_6)); printf_va_24("%llX",x_6); } { int_least8_t x_7; scanf_va_25("%hhd",(signed char *)(& x_7)); printf_va_25("%hhd",(int)x_7); scanf_va_26("%hhi",(signed char *)(& x_7)); printf_va_26("%hhi",(int)x_7); } { uint_least8_t x_8; scanf_va_27("%hho",(unsigned char *)(& x_8)); printf_va_27("%hho",(int)x_8); scanf_va_28("%hhu",(unsigned char *)(& x_8)); printf_va_28("%hhu",(int)x_8); scanf_va_29("%hhx",(unsigned char *)(& x_8)); printf_va_29("%hhx",(int)x_8); scanf_va_30("%hhx",(unsigned char *)(& x_8)); printf_va_30("%hhX",(int)x_8); } { int_least16_t x_9; scanf_va_31("%hd",(short *)(& x_9)); printf_va_31("%hd",(int)x_9); scanf_va_32("%hi",(short *)(& x_9)); printf_va_32("%hi",(int)x_9); } { uint_least16_t x_10; scanf_va_33("%ho",(unsigned short *)(& x_10)); printf_va_33("%ho",(int)x_10); scanf_va_34("%hu",(unsigned short *)(& x_10)); printf_va_34("%hu",(int)x_10); scanf_va_35("%hx",(unsigned short *)(& x_10)); printf_va_35("%hx",(int)x_10); scanf_va_36("%hx",(unsigned short *)(& x_10)); printf_va_36("%hX",(int)x_10); } { int_least32_t x_11; scanf_va_37("%d",(int *)(& x_11)); printf_va_37("%d",x_11); scanf_va_38("%i",(int *)(& x_11)); printf_va_38("%i",x_11); } { uint_least32_t x_12; scanf_va_39("%o",(unsigned int *)(& x_12)); printf_va_39("%o",x_12); scanf_va_40("%u",(unsigned int *)(& x_12)); printf_va_40("%u",x_12); scanf_va_41("%x",(unsigned int *)(& x_12)); printf_va_41("%x",x_12); scanf_va_42("%x",(unsigned int *)(& x_12)); printf_va_42("%X",x_12); } { int_least64_t x_13; scanf_va_43("%lld",(long long *)(& x_13)); printf_va_43("%lld",x_13); scanf_va_44("%lli",(long long *)(& x_13)); printf_va_44("%lli",x_13); } { uint_least64_t x_14; scanf_va_45("%llo",(unsigned long long *)(& x_14)); printf_va_45("%llo",x_14); scanf_va_46("%llu",(unsigned long long *)(& x_14)); printf_va_46("%llu",x_14); scanf_va_47("%llx",(unsigned long long *)(& x_14)); printf_va_47("%llx",x_14); scanf_va_48("%llx",(unsigned long long *)(& x_14)); printf_va_48("%llX",x_14); } { int_fast8_t x_15; scanf_va_49("%hhd",(signed char *)(& x_15)); printf_va_49("%hhd",(int)x_15); scanf_va_50("%hhi",(signed char *)(& x_15)); printf_va_50("%hhi",(int)x_15); } { uint_fast8_t x_16; scanf_va_51("%hho",(unsigned char *)(& x_16)); printf_va_51("%hho",(int)x_16); scanf_va_52("%hhu",(unsigned char *)(& x_16)); printf_va_52("%hhu",(int)x_16); scanf_va_53("%hhx",(unsigned char *)(& x_16)); printf_va_53("%hhx",(int)x_16); scanf_va_54("%hhx",(unsigned char *)(& x_16)); printf_va_54("%hhX",(int)x_16); } { int_fast16_t x_17; scanf_va_55("%d",(int *)(& x_17)); printf_va_55("%d",x_17); scanf_va_56("%i",(int *)(& x_17)); printf_va_56("%i",x_17); } { uint_fast16_t x_18; scanf_va_57("%o",(unsigned int *)(& x_18)); printf_va_57("%o",x_18); scanf_va_58("%u",(unsigned int *)(& x_18)); printf_va_58("%u",x_18); scanf_va_59("%x",(unsigned int *)(& x_18)); printf_va_59("%x",x_18); scanf_va_60("%x",(unsigned int *)(& x_18)); printf_va_60("%X",x_18); } { int_fast32_t x_19; scanf_va_61("%d",(int *)(& x_19)); printf_va_61("%d",x_19); scanf_va_62("%i",(int *)(& x_19)); printf_va_62("%i",x_19); } { uint_fast32_t x_20; scanf_va_63("%o",(unsigned int *)(& x_20)); printf_va_63("%o",x_20); scanf_va_64("%u",(unsigned int *)(& x_20)); printf_va_64("%u",x_20); scanf_va_65("%x",(unsigned int *)(& x_20)); printf_va_65("%x",x_20); scanf_va_66("%x",(unsigned int *)(& x_20)); printf_va_66("%X",x_20); } { int_fast64_t x_21; scanf_va_67("%lld",(long long *)(& x_21)); printf_va_67("%lld",x_21); scanf_va_68("%lli",(long long *)(& x_21)); printf_va_68("%lli",x_21); } { uint_fast64_t x_22; scanf_va_69("%llo",(unsigned long long *)(& x_22)); printf_va_69("%llo",x_22); scanf_va_70("%llu",(unsigned long long *)(& x_22)); printf_va_70("%llu",x_22); scanf_va_71("%llx",(unsigned long long *)(& x_22)); printf_va_71("%llx",x_22); scanf_va_72("%llx",(unsigned long long *)(& x_22)); printf_va_72("%llX",x_22); } { intmax_t x_23; scanf_va_73("%lld",(long long *)(& x_23)); printf_va_73("%lld",x_23); scanf_va_74("%lli",(long long *)(& x_23)); printf_va_74("%lli",x_23); } { uintmax_t x_24; scanf_va_75("%llo",(unsigned long long *)(& x_24)); printf_va_75("%llo",x_24); scanf_va_76("%llu",(unsigned long long *)(& x_24)); printf_va_76("%llu",x_24); scanf_va_77("%llx",(unsigned long long *)(& x_24)); printf_va_77("%llx",x_24); scanf_va_78("%llx",(unsigned long long *)(& x_24)); printf_va_78("%llX",x_24); } { intptr_t x_25; scanf_va_79("%d",(int *)(& x_25)); printf_va_79("%d",x_25); scanf_va_80("%i",(int *)(& x_25)); printf_va_80("%i",x_25); } { uintptr_t x_26; scanf_va_81("%o",(unsigned int *)(& x_26)); printf_va_81("%o",x_26); scanf_va_82("%u",(unsigned int *)(& x_26)); printf_va_82("%u",x_26); scanf_va_83("%x",(unsigned int *)(& x_26)); printf_va_83("%x",x_26); scanf_va_84("%x",(unsigned int *)(& x_26)); printf_va_84("%X",x_26); } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/libc/oracle/inttypes_h.5.res.oracle0000666000000000000000000033210213571573400021044 0ustar [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "inttypes.h" #include "stdarg.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_1(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_1(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_2(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_2(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_3(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_4(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_4(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_5(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_5(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_6(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_6(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_7(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_7(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_8(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_8(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_9(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_9(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_10(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_10(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_11(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_11(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_12(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_12(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_13(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_13(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_14(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_14(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_15(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_15(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_16(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_16(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_17(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_17(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_18(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_18(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_19(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_19(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_20(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_20(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_21(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_21(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_22(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_22(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_23(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_23(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_24(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_24(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_25(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_25(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_26(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_26(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_27(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_27(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_28(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_28(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_29(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_29(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_30(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_30(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_31(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_31(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_32(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_32(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_33(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_33(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_34(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_34(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_35(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_35(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_36(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_36(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_37(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_37(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_38(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_38(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_39(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_39(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_40(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_40(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_41(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_41(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_42(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_42(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_43(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_43(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_44(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_44(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_45(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_45(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_46(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_46(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_47(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_47(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_48(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_48(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_49(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_49(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_50(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_50(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_51(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_51(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_52(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_52(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_53(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_53(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_54(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_54(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_55(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_55(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_56(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_56(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_57(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_57(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_58(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_58(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_59(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_59(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_60(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_60(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_61(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_61(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_62(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_62(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_63(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_63(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_64(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_64(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_65(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_65(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_66(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_66(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_67(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_67(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_68(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_68(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_69(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_69(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_70(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_70(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_71(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_71(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_72(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_72(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_73(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_73(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_74(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_74(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_75(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_75(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_76(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_76(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_77(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_77(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_78(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_78(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_79(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_79(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_80(char const * __restrict format, long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_80(char const * __restrict format, long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_81(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_81(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_82(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_82(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_83(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_83(char const * __restrict format, unsigned long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_84(char const * __restrict format, unsigned long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_84(char const * __restrict format, unsigned long param0); int main(void) { int __retres; { int8_t x; scanf_va_1("%hhd",(signed char *)(& x)); printf_va_1("%hhd",(int)x); scanf_va_2("%hhi",(signed char *)(& x)); printf_va_2("%hhi",(int)x); } { uint8_t x_0; scanf_va_3("%hho",(unsigned char *)(& x_0)); printf_va_3("%hho",(int)x_0); scanf_va_4("%hhu",(unsigned char *)(& x_0)); printf_va_4("%hhu",(int)x_0); scanf_va_5("%hhx",(unsigned char *)(& x_0)); printf_va_5("%hhx",(int)x_0); scanf_va_6("%hhx",(unsigned char *)(& x_0)); printf_va_6("%hhX",(int)x_0); } { int16_t x_1; scanf_va_7("%hd",(short *)(& x_1)); printf_va_7("%hd",(int)x_1); scanf_va_8("%hi",(short *)(& x_1)); printf_va_8("%hi",(int)x_1); } { uint16_t x_2; scanf_va_9("%ho",(unsigned short *)(& x_2)); printf_va_9("%ho",(int)x_2); scanf_va_10("%hu",(unsigned short *)(& x_2)); printf_va_10("%hu",(int)x_2); scanf_va_11("%hx",(unsigned short *)(& x_2)); printf_va_11("%hx",(int)x_2); scanf_va_12("%hx",(unsigned short *)(& x_2)); printf_va_12("%hX",(int)x_2); } { int32_t x_3; scanf_va_13("%d",(int *)(& x_3)); printf_va_13("%d",x_3); scanf_va_14("%i",(int *)(& x_3)); printf_va_14("%i",x_3); } { uint32_t x_4; scanf_va_15("%o",(unsigned int *)(& x_4)); printf_va_15("%o",x_4); scanf_va_16("%u",(unsigned int *)(& x_4)); printf_va_16("%u",x_4); scanf_va_17("%x",(unsigned int *)(& x_4)); printf_va_17("%x",x_4); scanf_va_18("%x",(unsigned int *)(& x_4)); printf_va_18("%X",x_4); } { int64_t x_5; scanf_va_19("%ld",(long *)(& x_5)); printf_va_19("%ld",x_5); scanf_va_20("%li",(long *)(& x_5)); printf_va_20("%li",x_5); } { uint64_t x_6; scanf_va_21("%lo",(unsigned long *)(& x_6)); printf_va_21("%lo",x_6); scanf_va_22("%lu",(unsigned long *)(& x_6)); printf_va_22("%lu",x_6); scanf_va_23("%lx",(unsigned long *)(& x_6)); printf_va_23("%lx",x_6); scanf_va_24("%lx",(unsigned long *)(& x_6)); printf_va_24("%lX",x_6); } { int_least8_t x_7; scanf_va_25("%hhd",(signed char *)(& x_7)); printf_va_25("%hhd",(int)x_7); scanf_va_26("%hhi",(signed char *)(& x_7)); printf_va_26("%hhi",(int)x_7); } { uint_least8_t x_8; scanf_va_27("%hho",(unsigned char *)(& x_8)); printf_va_27("%hho",(int)x_8); scanf_va_28("%hhu",(unsigned char *)(& x_8)); printf_va_28("%hhu",(int)x_8); scanf_va_29("%hhx",(unsigned char *)(& x_8)); printf_va_29("%hhx",(int)x_8); scanf_va_30("%hhx",(unsigned char *)(& x_8)); printf_va_30("%hhX",(int)x_8); } { int_least16_t x_9; scanf_va_31("%hd",(short *)(& x_9)); printf_va_31("%hd",(int)x_9); scanf_va_32("%hi",(short *)(& x_9)); printf_va_32("%hi",(int)x_9); } { uint_least16_t x_10; scanf_va_33("%ho",(unsigned short *)(& x_10)); printf_va_33("%ho",(int)x_10); scanf_va_34("%hu",(unsigned short *)(& x_10)); printf_va_34("%hu",(int)x_10); scanf_va_35("%hx",(unsigned short *)(& x_10)); printf_va_35("%hx",(int)x_10); scanf_va_36("%hx",(unsigned short *)(& x_10)); printf_va_36("%hX",(int)x_10); } { int_least32_t x_11; scanf_va_37("%d",(int *)(& x_11)); printf_va_37("%d",x_11); scanf_va_38("%i",(int *)(& x_11)); printf_va_38("%i",x_11); } { uint_least32_t x_12; scanf_va_39("%o",(unsigned int *)(& x_12)); printf_va_39("%o",x_12); scanf_va_40("%u",(unsigned int *)(& x_12)); printf_va_40("%u",x_12); scanf_va_41("%x",(unsigned int *)(& x_12)); printf_va_41("%x",x_12); scanf_va_42("%x",(unsigned int *)(& x_12)); printf_va_42("%X",x_12); } { int_least64_t x_13; scanf_va_43("%ld",(long *)(& x_13)); printf_va_43("%ld",x_13); scanf_va_44("%li",(long *)(& x_13)); printf_va_44("%li",x_13); } { uint_least64_t x_14; scanf_va_45("%lo",(unsigned long *)(& x_14)); printf_va_45("%lo",x_14); scanf_va_46("%lu",(unsigned long *)(& x_14)); printf_va_46("%lu",x_14); scanf_va_47("%lx",(unsigned long *)(& x_14)); printf_va_47("%lx",x_14); scanf_va_48("%lx",(unsigned long *)(& x_14)); printf_va_48("%lX",x_14); } { int_fast8_t x_15; scanf_va_49("%hhd",(signed char *)(& x_15)); printf_va_49("%hhd",(int)x_15); scanf_va_50("%hhi",(signed char *)(& x_15)); printf_va_50("%hhi",(int)x_15); } { uint_fast8_t x_16; scanf_va_51("%hho",(unsigned char *)(& x_16)); printf_va_51("%hho",(int)x_16); scanf_va_52("%hhu",(unsigned char *)(& x_16)); printf_va_52("%hhu",(int)x_16); scanf_va_53("%hhx",(unsigned char *)(& x_16)); printf_va_53("%hhx",(int)x_16); scanf_va_54("%hhx",(unsigned char *)(& x_16)); printf_va_54("%hhX",(int)x_16); } { int_fast16_t x_17; scanf_va_55("%d",(int *)(& x_17)); printf_va_55("%d",x_17); scanf_va_56("%i",(int *)(& x_17)); printf_va_56("%i",x_17); } { uint_fast16_t x_18; scanf_va_57("%o",(unsigned int *)(& x_18)); printf_va_57("%o",x_18); scanf_va_58("%u",(unsigned int *)(& x_18)); printf_va_58("%u",x_18); scanf_va_59("%x",(unsigned int *)(& x_18)); printf_va_59("%x",x_18); scanf_va_60("%x",(unsigned int *)(& x_18)); printf_va_60("%X",x_18); } { int_fast32_t x_19; scanf_va_61("%d",(int *)(& x_19)); printf_va_61("%d",x_19); scanf_va_62("%i",(int *)(& x_19)); printf_va_62("%i",x_19); } { uint_fast32_t x_20; scanf_va_63("%o",(unsigned int *)(& x_20)); printf_va_63("%o",x_20); scanf_va_64("%u",(unsigned int *)(& x_20)); printf_va_64("%u",x_20); scanf_va_65("%x",(unsigned int *)(& x_20)); printf_va_65("%x",x_20); scanf_va_66("%x",(unsigned int *)(& x_20)); printf_va_66("%X",x_20); } { int_fast64_t x_21; scanf_va_67("%ld",(long *)(& x_21)); printf_va_67("%ld",x_21); scanf_va_68("%li",(long *)(& x_21)); printf_va_68("%li",x_21); } { uint_fast64_t x_22; scanf_va_69("%lo",(unsigned long *)(& x_22)); printf_va_69("%lo",x_22); scanf_va_70("%lu",(unsigned long *)(& x_22)); printf_va_70("%lu",x_22); scanf_va_71("%lx",(unsigned long *)(& x_22)); printf_va_71("%lx",x_22); scanf_va_72("%lx",(unsigned long *)(& x_22)); printf_va_72("%lX",x_22); } { intmax_t x_23; scanf_va_73("%lld",(long long *)(& x_23)); printf_va_73("%lld",x_23); scanf_va_74("%lli",(long long *)(& x_23)); printf_va_74("%lli",x_23); } { uintmax_t x_24; scanf_va_75("%llo",(unsigned long long *)(& x_24)); printf_va_75("%llo",x_24); scanf_va_76("%llu",(unsigned long long *)(& x_24)); printf_va_76("%llu",x_24); scanf_va_77("%llx",(unsigned long long *)(& x_24)); printf_va_77("%llx",x_24); scanf_va_78("%llx",(unsigned long long *)(& x_24)); printf_va_78("%llX",x_24); } { intptr_t x_25; scanf_va_79("%ld",(long *)(& x_25)); printf_va_79("%ld",x_25); scanf_va_80("%li",(long *)(& x_25)); printf_va_80("%li",x_25); } { uintptr_t x_26; scanf_va_81("%lo",(unsigned long *)(& x_26)); printf_va_81("%lo",x_26); scanf_va_82("%lu",(unsigned long *)(& x_26)); printf_va_82("%lu",x_26); scanf_va_83("%lx",(unsigned long *)(& x_26)); printf_va_83("%lx",x_26); scanf_va_84("%lx",(unsigned long *)(& x_26)); printf_va_84("%lX",x_26); } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/libc/oracle/inttypes_h.6.res.oracle0000666000000000000000000033252613571573400021057 0ustar [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "inttypes.h" #include "stdarg.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_1(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_1(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_2(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_2(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_3(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_4(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_4(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_5(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_5(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_6(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_6(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_7(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_7(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_8(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_8(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_9(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_9(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_10(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_10(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_11(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_11(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_12(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_12(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_13(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_13(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_14(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_14(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_15(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_15(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_16(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_16(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_17(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_17(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_18(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_18(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_19(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_19(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_20(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_20(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_21(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_21(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_22(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_22(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_23(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_23(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_24(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_24(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_25(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_25(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_26(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_26(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_27(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_27(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_28(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_28(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_29(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_29(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_30(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_30(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_31(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_31(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_32(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_32(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_33(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_33(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_34(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_34(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_35(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_35(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_36(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_36(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_37(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_37(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_38(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_38(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_39(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_39(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_40(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_40(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_41(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_41(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_42(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_42(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_43(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_43(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_44(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_44(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_45(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_45(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_46(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_46(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_47(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_47(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_48(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_48(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_49(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_49(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_50(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_50(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_51(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_51(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_52(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_52(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_53(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_53(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_54(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_54(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_55(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_55(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_56(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_56(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_57(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_57(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_58(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_58(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_59(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_59(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_60(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_60(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_61(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_61(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_62(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_62(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_63(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_63(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_64(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_64(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_65(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_65(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_66(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_66(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_67(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_67(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_68(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_68(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_69(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_69(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_70(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_70(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_71(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_71(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_72(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_72(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_73(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_73(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_74(char const * __restrict format, long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_74(char const * __restrict format, long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_75(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_75(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_76(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_76(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_77(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_77(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_78(char const * __restrict format, unsigned long long *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_78(char const * __restrict format, unsigned long long param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_79(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_79(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_80(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_80(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_81(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_81(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_82(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_82(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_83(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_83(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_84(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_84(char const * __restrict format, unsigned int param0); int main(void) { int __retres; { int8_t x; scanf_va_1("%hhd",(signed char *)(& x)); printf_va_1("%hhd",(int)x); scanf_va_2("%hhi",(signed char *)(& x)); printf_va_2("%hhi",(int)x); } { uint8_t x_0; scanf_va_3("%hho",(unsigned char *)(& x_0)); printf_va_3("%hho",(int)x_0); scanf_va_4("%hhu",(unsigned char *)(& x_0)); printf_va_4("%hhu",(int)x_0); scanf_va_5("%hhx",(unsigned char *)(& x_0)); printf_va_5("%hhx",(int)x_0); scanf_va_6("%hhx",(unsigned char *)(& x_0)); printf_va_6("%hhX",(int)x_0); } { int16_t x_1; scanf_va_7("%hd",(short *)(& x_1)); printf_va_7("%hd",(int)x_1); scanf_va_8("%hi",(short *)(& x_1)); printf_va_8("%hi",(int)x_1); } { uint16_t x_2; scanf_va_9("%ho",(unsigned short *)(& x_2)); printf_va_9("%ho",(int)x_2); scanf_va_10("%hu",(unsigned short *)(& x_2)); printf_va_10("%hu",(int)x_2); scanf_va_11("%hx",(unsigned short *)(& x_2)); printf_va_11("%hx",(int)x_2); scanf_va_12("%hx",(unsigned short *)(& x_2)); printf_va_12("%hX",(int)x_2); } { int32_t x_3; scanf_va_13("%d",(int *)(& x_3)); printf_va_13("%d",x_3); scanf_va_14("%i",(int *)(& x_3)); printf_va_14("%i",x_3); } { uint32_t x_4; scanf_va_15("%o",(unsigned int *)(& x_4)); printf_va_15("%o",x_4); scanf_va_16("%u",(unsigned int *)(& x_4)); printf_va_16("%u",x_4); scanf_va_17("%x",(unsigned int *)(& x_4)); printf_va_17("%x",x_4); scanf_va_18("%x",(unsigned int *)(& x_4)); printf_va_18("%X",x_4); } { int64_t x_5; scanf_va_19("%lld",(long long *)(& x_5)); printf_va_19("%lld",x_5); scanf_va_20("%lli",(long long *)(& x_5)); printf_va_20("%lli",x_5); } { uint64_t x_6; scanf_va_21("%llo",(unsigned long long *)(& x_6)); printf_va_21("%llo",x_6); scanf_va_22("%llu",(unsigned long long *)(& x_6)); printf_va_22("%llu",x_6); scanf_va_23("%llx",(unsigned long long *)(& x_6)); printf_va_23("%llx",x_6); scanf_va_24("%llx",(unsigned long long *)(& x_6)); printf_va_24("%llX",x_6); } { int_least8_t x_7; scanf_va_25("%hhd",(signed char *)(& x_7)); printf_va_25("%hhd",(int)x_7); scanf_va_26("%hhi",(signed char *)(& x_7)); printf_va_26("%hhi",(int)x_7); } { uint_least8_t x_8; scanf_va_27("%hho",(unsigned char *)(& x_8)); printf_va_27("%hho",(int)x_8); scanf_va_28("%hhu",(unsigned char *)(& x_8)); printf_va_28("%hhu",(int)x_8); scanf_va_29("%hhx",(unsigned char *)(& x_8)); printf_va_29("%hhx",(int)x_8); scanf_va_30("%hhx",(unsigned char *)(& x_8)); printf_va_30("%hhX",(int)x_8); } { int_least16_t x_9; scanf_va_31("%hd",(short *)(& x_9)); printf_va_31("%hd",(int)x_9); scanf_va_32("%hi",(short *)(& x_9)); printf_va_32("%hi",(int)x_9); } { uint_least16_t x_10; scanf_va_33("%ho",(unsigned short *)(& x_10)); printf_va_33("%ho",(int)x_10); scanf_va_34("%hu",(unsigned short *)(& x_10)); printf_va_34("%hu",(int)x_10); scanf_va_35("%hx",(unsigned short *)(& x_10)); printf_va_35("%hx",(int)x_10); scanf_va_36("%hx",(unsigned short *)(& x_10)); printf_va_36("%hX",(int)x_10); } { int_least32_t x_11; scanf_va_37("%d",(int *)(& x_11)); printf_va_37("%d",x_11); scanf_va_38("%i",(int *)(& x_11)); printf_va_38("%i",x_11); } { uint_least32_t x_12; scanf_va_39("%o",(unsigned int *)(& x_12)); printf_va_39("%o",x_12); scanf_va_40("%u",(unsigned int *)(& x_12)); printf_va_40("%u",x_12); scanf_va_41("%x",(unsigned int *)(& x_12)); printf_va_41("%x",x_12); scanf_va_42("%x",(unsigned int *)(& x_12)); printf_va_42("%X",x_12); } { int_least64_t x_13; scanf_va_43("%lld",(long long *)(& x_13)); printf_va_43("%lld",x_13); scanf_va_44("%lli",(long long *)(& x_13)); printf_va_44("%lli",x_13); } { uint_least64_t x_14; scanf_va_45("%llo",(unsigned long long *)(& x_14)); printf_va_45("%llo",x_14); scanf_va_46("%llu",(unsigned long long *)(& x_14)); printf_va_46("%llu",x_14); scanf_va_47("%llx",(unsigned long long *)(& x_14)); printf_va_47("%llx",x_14); scanf_va_48("%llx",(unsigned long long *)(& x_14)); printf_va_48("%llX",x_14); } { int_fast8_t x_15; scanf_va_49("%hhd",(signed char *)(& x_15)); printf_va_49("%hhd",(int)x_15); scanf_va_50("%hhi",(signed char *)(& x_15)); printf_va_50("%hhi",(int)x_15); } { uint_fast8_t x_16; scanf_va_51("%hho",(unsigned char *)(& x_16)); printf_va_51("%hho",(int)x_16); scanf_va_52("%hhu",(unsigned char *)(& x_16)); printf_va_52("%hhu",(int)x_16); scanf_va_53("%hhx",(unsigned char *)(& x_16)); printf_va_53("%hhx",(int)x_16); scanf_va_54("%hhx",(unsigned char *)(& x_16)); printf_va_54("%hhX",(int)x_16); } { int_fast16_t x_17; scanf_va_55("%d",(int *)(& x_17)); printf_va_55("%d",x_17); scanf_va_56("%i",(int *)(& x_17)); printf_va_56("%i",x_17); } { uint_fast16_t x_18; scanf_va_57("%o",(unsigned int *)(& x_18)); printf_va_57("%o",x_18); scanf_va_58("%u",(unsigned int *)(& x_18)); printf_va_58("%u",x_18); scanf_va_59("%x",(unsigned int *)(& x_18)); printf_va_59("%x",x_18); scanf_va_60("%x",(unsigned int *)(& x_18)); printf_va_60("%X",x_18); } { int_fast32_t x_19; scanf_va_61("%d",(int *)(& x_19)); printf_va_61("%d",x_19); scanf_va_62("%i",(int *)(& x_19)); printf_va_62("%i",x_19); } { uint_fast32_t x_20; scanf_va_63("%o",(unsigned int *)(& x_20)); printf_va_63("%o",x_20); scanf_va_64("%u",(unsigned int *)(& x_20)); printf_va_64("%u",x_20); scanf_va_65("%x",(unsigned int *)(& x_20)); printf_va_65("%x",x_20); scanf_va_66("%x",(unsigned int *)(& x_20)); printf_va_66("%X",x_20); } { int_fast64_t x_21; scanf_va_67("%lld",(long long *)(& x_21)); printf_va_67("%lld",x_21); scanf_va_68("%lli",(long long *)(& x_21)); printf_va_68("%lli",x_21); } { uint_fast64_t x_22; scanf_va_69("%llo",(unsigned long long *)(& x_22)); printf_va_69("%llo",x_22); scanf_va_70("%llu",(unsigned long long *)(& x_22)); printf_va_70("%llu",x_22); scanf_va_71("%llx",(unsigned long long *)(& x_22)); printf_va_71("%llx",x_22); scanf_va_72("%llx",(unsigned long long *)(& x_22)); printf_va_72("%llX",x_22); } { intmax_t x_23; scanf_va_73("%lld",(long long *)(& x_23)); printf_va_73("%lld",x_23); scanf_va_74("%lli",(long long *)(& x_23)); printf_va_74("%lli",x_23); } { uintmax_t x_24; scanf_va_75("%llo",(unsigned long long *)(& x_24)); printf_va_75("%llo",x_24); scanf_va_76("%llu",(unsigned long long *)(& x_24)); printf_va_76("%llu",x_24); scanf_va_77("%llx",(unsigned long long *)(& x_24)); printf_va_77("%llx",x_24); scanf_va_78("%llx",(unsigned long long *)(& x_24)); printf_va_78("%llX",x_24); } { intptr_t x_25; scanf_va_79("%d",(int *)(& x_25)); printf_va_79("%d",x_25); scanf_va_80("%i",(int *)(& x_25)); printf_va_80("%i",x_25); } { uintptr_t x_26; scanf_va_81("%o",(unsigned int *)(& x_26)); printf_va_81("%o",x_26); scanf_va_82("%u",(unsigned int *)(& x_26)); printf_va_82("%u",x_26); scanf_va_83("%x",(unsigned int *)(& x_26)); printf_va_83("%x",x_26); scanf_va_84("%x",(unsigned int *)(& x_26)); printf_va_84("%X",x_26); } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/libc/oracle/inttypes_h.7.res.oracle0000666000000000000000000033244613571573400021061 0ustar [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "inttypes.h" #include "stdarg.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_1(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_1(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_2(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_2(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_3(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_4(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_4(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_5(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_5(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_6(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_6(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_7(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_7(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_8(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_8(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_9(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_9(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_10(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_10(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_11(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_11(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_12(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_12(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_13(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_13(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_14(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_14(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_15(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_15(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_16(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_16(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_17(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_17(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_18(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_18(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_19(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_19(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_20(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_20(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_21(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_21(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_22(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_22(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_23(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_23(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_24(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_24(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_25(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_25(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_26(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_26(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_27(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_27(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_28(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_28(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_29(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_29(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_30(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_30(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_31(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_31(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_32(char const * __restrict format, short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_32(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_33(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_33(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_34(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_34(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_35(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_35(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_36(char const * __restrict format, unsigned short *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_36(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_37(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_37(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_38(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_38(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_39(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_39(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_40(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_40(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_41(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_41(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_42(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_42(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_43(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_43(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_44(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_44(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_45(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_45(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_46(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_46(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_47(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_47(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_48(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_48(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_49(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_49(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_50(char const * __restrict format, signed char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_50(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_51(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_51(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_52(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_52(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_53(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_53(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_54(char const * __restrict format, unsigned char *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_54(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_55(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_55(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_56(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_56(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_57(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_57(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_58(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_58(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_59(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_59(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_60(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_60(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_61(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_61(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_62(char const * __restrict format, int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_62(char const * __restrict format, int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_63(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_63(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_64(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_64(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_65(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_65(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_66(char const * __restrict format, unsigned int *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_66(char const * __restrict format, unsigned int param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_67(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_67(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_68(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_68(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_69(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_69(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_70(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_70(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_71(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_71(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_72(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_72(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_73(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_73(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_74(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_74(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_75(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_75(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_76(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_76(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_77(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_77(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_78(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_78(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_79(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_79(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_80(char const * __restrict format, __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_80(char const * __restrict format, __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_81(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_81(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_82(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_82(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_83(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_83(char const * __restrict format, unsigned __int64 param0); /*@ requires valid_read_string(format); requires \valid(param0); ensures \initialized(param0); assigns \result, __fc_stdin->__fc_FILE_data, *param0; assigns \result \from (indirect: __fc_stdin->__fc_FILE_id), (indirect: __fc_stdin->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdin->__fc_FILE_data \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); assigns *param0 \from (indirect: __fc_stdin->__fc_FILE_id), __fc_stdin->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int scanf_va_84(char const * __restrict format, unsigned __int64 *param0); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_84(char const * __restrict format, unsigned __int64 param0); int main(void) { int __retres; { int8_t x; scanf_va_1("%hhd",(signed char *)(& x)); printf_va_1("%hhd",(int)x); scanf_va_2("%hhi",(signed char *)(& x)); printf_va_2("%hhi",(int)x); } { uint8_t x_0; scanf_va_3("%hho",(unsigned char *)(& x_0)); printf_va_3("%hho",(int)x_0); scanf_va_4("%hhu",(unsigned char *)(& x_0)); printf_va_4("%hhu",(int)x_0); scanf_va_5("%hhx",(unsigned char *)(& x_0)); printf_va_5("%hhx",(int)x_0); scanf_va_6("%hhx",(unsigned char *)(& x_0)); printf_va_6("%hhX",(int)x_0); } { int16_t x_1; scanf_va_7("%hd",(short *)(& x_1)); printf_va_7("%hd",(int)x_1); scanf_va_8("%hi",(short *)(& x_1)); printf_va_8("%hi",(int)x_1); } { uint16_t x_2; scanf_va_9("%ho",(unsigned short *)(& x_2)); printf_va_9("%ho",(int)x_2); scanf_va_10("%hu",(unsigned short *)(& x_2)); printf_va_10("%hu",(int)x_2); scanf_va_11("%hx",(unsigned short *)(& x_2)); printf_va_11("%hx",(int)x_2); scanf_va_12("%hx",(unsigned short *)(& x_2)); printf_va_12("%hX",(int)x_2); } { int32_t x_3; scanf_va_13("%d",(int *)(& x_3)); printf_va_13("%d",x_3); scanf_va_14("%i",(int *)(& x_3)); printf_va_14("%i",x_3); } { uint32_t x_4; scanf_va_15("%o",(unsigned int *)(& x_4)); printf_va_15("%o",x_4); scanf_va_16("%u",(unsigned int *)(& x_4)); printf_va_16("%u",x_4); scanf_va_17("%x",(unsigned int *)(& x_4)); printf_va_17("%x",x_4); scanf_va_18("%x",(unsigned int *)(& x_4)); printf_va_18("%X",x_4); } { int64_t x_5; scanf_va_19("%lld",(__int64 *)(& x_5)); printf_va_19("%lld",x_5); scanf_va_20("%lli",(__int64 *)(& x_5)); printf_va_20("%lli",x_5); } { uint64_t x_6; scanf_va_21("%llo",(unsigned __int64 *)(& x_6)); printf_va_21("%llo",x_6); scanf_va_22("%llu",(unsigned __int64 *)(& x_6)); printf_va_22("%llu",x_6); scanf_va_23("%llx",(unsigned __int64 *)(& x_6)); printf_va_23("%llx",x_6); scanf_va_24("%llx",(unsigned __int64 *)(& x_6)); printf_va_24("%llX",x_6); } { int_least8_t x_7; scanf_va_25("%hhd",(signed char *)(& x_7)); printf_va_25("%hhd",(int)x_7); scanf_va_26("%hhi",(signed char *)(& x_7)); printf_va_26("%hhi",(int)x_7); } { uint_least8_t x_8; scanf_va_27("%hho",(unsigned char *)(& x_8)); printf_va_27("%hho",(int)x_8); scanf_va_28("%hhu",(unsigned char *)(& x_8)); printf_va_28("%hhu",(int)x_8); scanf_va_29("%hhx",(unsigned char *)(& x_8)); printf_va_29("%hhx",(int)x_8); scanf_va_30("%hhx",(unsigned char *)(& x_8)); printf_va_30("%hhX",(int)x_8); } { int_least16_t x_9; scanf_va_31("%hd",(short *)(& x_9)); printf_va_31("%hd",(int)x_9); scanf_va_32("%hi",(short *)(& x_9)); printf_va_32("%hi",(int)x_9); } { uint_least16_t x_10; scanf_va_33("%ho",(unsigned short *)(& x_10)); printf_va_33("%ho",(int)x_10); scanf_va_34("%hu",(unsigned short *)(& x_10)); printf_va_34("%hu",(int)x_10); scanf_va_35("%hx",(unsigned short *)(& x_10)); printf_va_35("%hx",(int)x_10); scanf_va_36("%hx",(unsigned short *)(& x_10)); printf_va_36("%hX",(int)x_10); } { int_least32_t x_11; scanf_va_37("%d",(int *)(& x_11)); printf_va_37("%d",x_11); scanf_va_38("%i",(int *)(& x_11)); printf_va_38("%i",x_11); } { uint_least32_t x_12; scanf_va_39("%o",(unsigned int *)(& x_12)); printf_va_39("%o",x_12); scanf_va_40("%u",(unsigned int *)(& x_12)); printf_va_40("%u",x_12); scanf_va_41("%x",(unsigned int *)(& x_12)); printf_va_41("%x",x_12); scanf_va_42("%x",(unsigned int *)(& x_12)); printf_va_42("%X",x_12); } { int_least64_t x_13; scanf_va_43("%lld",(__int64 *)(& x_13)); printf_va_43("%lld",x_13); scanf_va_44("%lli",(__int64 *)(& x_13)); printf_va_44("%lli",x_13); } { uint_least64_t x_14; scanf_va_45("%llo",(unsigned __int64 *)(& x_14)); printf_va_45("%llo",x_14); scanf_va_46("%llu",(unsigned __int64 *)(& x_14)); printf_va_46("%llu",x_14); scanf_va_47("%llx",(unsigned __int64 *)(& x_14)); printf_va_47("%llx",x_14); scanf_va_48("%llx",(unsigned __int64 *)(& x_14)); printf_va_48("%llX",x_14); } { int_fast8_t x_15; scanf_va_49("%hhd",(signed char *)(& x_15)); printf_va_49("%hhd",(int)x_15); scanf_va_50("%hhi",(signed char *)(& x_15)); printf_va_50("%hhi",(int)x_15); } { uint_fast8_t x_16; scanf_va_51("%hho",(unsigned char *)(& x_16)); printf_va_51("%hho",(int)x_16); scanf_va_52("%hhu",(unsigned char *)(& x_16)); printf_va_52("%hhu",(int)x_16); scanf_va_53("%hhx",(unsigned char *)(& x_16)); printf_va_53("%hhx",(int)x_16); scanf_va_54("%hhx",(unsigned char *)(& x_16)); printf_va_54("%hhX",(int)x_16); } { int_fast16_t x_17; scanf_va_55("%d",(int *)(& x_17)); printf_va_55("%d",x_17); scanf_va_56("%i",(int *)(& x_17)); printf_va_56("%i",x_17); } { uint_fast16_t x_18; scanf_va_57("%o",(unsigned int *)(& x_18)); printf_va_57("%o",x_18); scanf_va_58("%u",(unsigned int *)(& x_18)); printf_va_58("%u",x_18); scanf_va_59("%x",(unsigned int *)(& x_18)); printf_va_59("%x",x_18); scanf_va_60("%x",(unsigned int *)(& x_18)); printf_va_60("%X",x_18); } { int_fast32_t x_19; scanf_va_61("%d",(int *)(& x_19)); printf_va_61("%d",x_19); scanf_va_62("%i",(int *)(& x_19)); printf_va_62("%i",x_19); } { uint_fast32_t x_20; scanf_va_63("%o",(unsigned int *)(& x_20)); printf_va_63("%o",x_20); scanf_va_64("%u",(unsigned int *)(& x_20)); printf_va_64("%u",x_20); scanf_va_65("%x",(unsigned int *)(& x_20)); printf_va_65("%x",x_20); scanf_va_66("%x",(unsigned int *)(& x_20)); printf_va_66("%X",x_20); } { int_fast64_t x_21; scanf_va_67("%lld",(__int64 *)(& x_21)); printf_va_67("%lld",x_21); scanf_va_68("%lli",(__int64 *)(& x_21)); printf_va_68("%lli",x_21); } { uint_fast64_t x_22; scanf_va_69("%llo",(unsigned __int64 *)(& x_22)); printf_va_69("%llo",x_22); scanf_va_70("%llu",(unsigned __int64 *)(& x_22)); printf_va_70("%llu",x_22); scanf_va_71("%llx",(unsigned __int64 *)(& x_22)); printf_va_71("%llx",x_22); scanf_va_72("%llx",(unsigned __int64 *)(& x_22)); printf_va_72("%llX",x_22); } { intmax_t x_23; scanf_va_73("%lld",(__int64 *)(& x_23)); printf_va_73("%lld",x_23); scanf_va_74("%lli",(__int64 *)(& x_23)); printf_va_74("%lli",x_23); } { uintmax_t x_24; scanf_va_75("%llo",(unsigned __int64 *)(& x_24)); printf_va_75("%llo",x_24); scanf_va_76("%llu",(unsigned __int64 *)(& x_24)); printf_va_76("%llu",x_24); scanf_va_77("%llx",(unsigned __int64 *)(& x_24)); printf_va_77("%llx",x_24); scanf_va_78("%llx",(unsigned __int64 *)(& x_24)); printf_va_78("%llX",x_24); } { intptr_t x_25; scanf_va_79("%lld",(__int64 *)(& x_25)); printf_va_79("%lld",x_25); scanf_va_80("%lli",(__int64 *)(& x_25)); printf_va_80("%lli",x_25); } { uintptr_t x_26; scanf_va_81("%llo",(unsigned __int64 *)(& x_26)); printf_va_81("%llo",x_26); scanf_va_82("%llu",(unsigned __int64 *)(& x_26)); printf_va_82("%llu",x_26); scanf_va_83("%llx",(unsigned __int64 *)(& x_26)); printf_va_83("%llx",x_26); scanf_va_84("%llx",(unsigned __int64 *)(& x_26)); printf_va_84("%llX",x_26); } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/libc/oracle/inttypes_h2.res.oracle0000666000000000000000000000324213571573400020763 0ustar [kernel] Parsing tests/libc/inttypes_h2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function imaxdiv <- main. Called from tests/libc/inttypes_h2.c:11. [eva] using specification for function imaxdiv [eva] tests/libc/inttypes_h2.c:11: function imaxdiv: precondition 'no_div_by_zero' got status valid. [eva:alarm] tests/libc/inttypes_h2.c:11: Warning: function imaxdiv: precondition 'no_overflow' got status invalid. [eva] Done for function imaxdiv [eva] computing for function imaxdiv <- main. Called from tests/libc/inttypes_h2.c:17. [eva:alarm] tests/libc/inttypes_h2.c:17: Warning: function imaxdiv: precondition 'no_div_by_zero' got status invalid. [eva] tests/libc/inttypes_h2.c:17: function imaxdiv: no state left, precondition 'no_overflow' got status valid. [eva] Done for function imaxdiv [eva] computing for function imaxdiv <- main. Called from tests/libc/inttypes_h2.c:22. [eva] tests/libc/inttypes_h2.c:22: function imaxdiv: precondition 'no_div_by_zero' got status valid. [eva] tests/libc/inttypes_h2.c:22: function imaxdiv: precondition 'no_overflow' got status valid. [eva] Done for function imaxdiv [eva] tests/libc/inttypes_h2.c:23: assertion got status valid. [eva] tests/libc/inttypes_h2.c:24: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {9223372036854775807} b ∈ {4611686018427387903} r.quot ∈ {2} .rem ∈ {1} frama-c-20.0-Calcium/tests/libc/oracle/libgen_h.res.oracle0000666000000000000000000000434713571573400020271 0ustar [kernel] Parsing tests/libc/libgen_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function basename <- main. Called from tests/libc/libgen_h.c:9. [eva] using specification for function basename [eva] tests/libc/libgen_h.c:9: function basename: precondition 'null_or_valid_string_path' got status valid. [eva] Done for function basename [eva:alarm] tests/libc/libgen_h.c:10: Warning: assertion got status unknown. [eva] computing for function basename <- main. Called from tests/libc/libgen_h.c:11. [eva] tests/libc/libgen_h.c:11: function basename: precondition 'null_or_valid_string_path' got status valid. [eva:invalid-assigns] tests/libc/libgen_h.c:11: Completely invalid destination for assigns clause *(path + (0 ..)). Ignoring. [eva] Done for function basename [eva:alarm] tests/libc/libgen_h.c:12: Warning: assertion got status unknown. [eva] computing for function dirname <- main. Called from tests/libc/libgen_h.c:14. [eva] using specification for function dirname [eva:alarm] tests/libc/libgen_h.c:14: Warning: function dirname: precondition 'null_or_valid_string_path' got status unknown. [eva] Done for function dirname [eva:alarm] tests/libc/libgen_h.c:15: Warning: assertion got status unknown. [eva] computing for function dirname <- main. Called from tests/libc/libgen_h.c:16. [eva] tests/libc/libgen_h.c:16: function dirname: precondition 'null_or_valid_string_path' got status valid. [eva:invalid-assigns] tests/libc/libgen_h.c:16: Completely invalid destination for assigns clause *(path + (0 ..)). Ignoring. [eva] Done for function dirname [eva:alarm] tests/libc/libgen_h.c:17: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_basename[0..255] ∈ [--..--] __fc_dirname[0..255] ∈ [--..--] path[0..127] ∈ [--..--] base ∈ {{ &__fc_basename[0] ; &path[0] }} base2 ∈ {{ NULL ; &__fc_basename[0] }} dir ∈ {{ &__fc_dirname[0] ; &path[0] }} dir2 ∈ {{ NULL ; &__fc_dirname[0] }} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/limits_h.0.res.oracle0000666000000000000000000000361313571573400020463 0ustar [kernel] Parsing tests/libc/limits_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/limits_h.c:16: assertion got status valid. [eva] tests/libc/limits_h.c:18: assertion got status valid. [eva] tests/libc/limits_h.c:19: assertion got status valid. [eva] tests/libc/limits_h.c:20: assertion got status valid. [eva] tests/libc/limits_h.c:21: assertion got status valid. [eva] tests/libc/limits_h.c:22: assertion got status valid. [eva] tests/libc/limits_h.c:23: assertion got status valid. [eva] tests/libc/limits_h.c:24: assertion got status valid. [eva] tests/libc/limits_h.c:25: assertion got status valid. [eva] tests/libc/limits_h.c:26: assertion got status valid. [eva] tests/libc/limits_h.c:27: assertion got status valid. [eva] tests/libc/limits_h.c:28: assertion got status valid. [eva] tests/libc/limits_h.c:29: assertion got status valid. [eva] tests/libc/limits_h.c:30: assertion got status valid. [eva] tests/libc/limits_h.c:31: assertion got status valid. [eva] tests/libc/limits_h.c:32: assertion got status valid. [eva] tests/libc/limits_h.c:33: assertion got status valid. [eva] tests/libc/limits_h.c:34: assertion got status valid. [eva] tests/libc/limits_h.c:35: assertion got status valid. [eva] tests/libc/limits_h.c:36: assertion got status valid. [eva] tests/libc/limits_h.c:37: assertion got status valid. [eva] tests/libc/limits_h.c:38: assertion got status valid. [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 6 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: size_max ∈ {65535} ssize_max ∈ {2147483647} intptr_max ∈ {2147483647} intptr_min ∈ {-2147483648} uintptr_max ∈ {4294967295} uintmax_max ∈ {18446744073709551615} frama-c-20.0-Calcium/tests/libc/oracle/limits_h.1.res.oracle0000666000000000000000000000362013571573400020462 0ustar [kernel] Parsing tests/libc/limits_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/limits_h.c:16: assertion got status valid. [eva] tests/libc/limits_h.c:18: assertion got status valid. [eva] tests/libc/limits_h.c:19: assertion got status valid. [eva] tests/libc/limits_h.c:20: assertion got status valid. [eva] tests/libc/limits_h.c:21: assertion got status valid. [eva] tests/libc/limits_h.c:22: assertion got status valid. [eva] tests/libc/limits_h.c:23: assertion got status valid. [eva] tests/libc/limits_h.c:24: assertion got status valid. [eva] tests/libc/limits_h.c:25: assertion got status valid. [eva] tests/libc/limits_h.c:26: assertion got status valid. [eva] tests/libc/limits_h.c:27: assertion got status valid. [eva] tests/libc/limits_h.c:28: assertion got status valid. [eva] tests/libc/limits_h.c:29: assertion got status valid. [eva] tests/libc/limits_h.c:30: assertion got status valid. [eva] tests/libc/limits_h.c:31: assertion got status valid. [eva] tests/libc/limits_h.c:32: assertion got status valid. [eva] tests/libc/limits_h.c:33: assertion got status valid. [eva] tests/libc/limits_h.c:34: assertion got status valid. [eva] tests/libc/limits_h.c:35: assertion got status valid. [eva] tests/libc/limits_h.c:36: assertion got status valid. [eva] tests/libc/limits_h.c:37: assertion got status valid. [eva] tests/libc/limits_h.c:38: assertion got status valid. [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 7 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: size_max ∈ {4294967295} ssize_max ∈ {2147483647} intptr_max ∈ {2147483647} intptr_min ∈ {-2147483648} uintptr_max ∈ {4294967295} uintmax_max ∈ {18446744073709551615} frama-c-20.0-Calcium/tests/libc/oracle/limits_h.2.res.oracle0000666000000000000000000000367713571573400020477 0ustar [kernel] Parsing tests/libc/limits_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/limits_h.c:16: assertion got status valid. [eva] tests/libc/limits_h.c:18: assertion got status valid. [eva] tests/libc/limits_h.c:19: assertion got status valid. [eva] tests/libc/limits_h.c:20: assertion got status valid. [eva] tests/libc/limits_h.c:21: assertion got status valid. [eva] tests/libc/limits_h.c:22: assertion got status valid. [eva] tests/libc/limits_h.c:23: assertion got status valid. [eva] tests/libc/limits_h.c:24: assertion got status valid. [eva] tests/libc/limits_h.c:25: assertion got status valid. [eva] tests/libc/limits_h.c:26: assertion got status valid. [eva] tests/libc/limits_h.c:27: assertion got status valid. [eva] tests/libc/limits_h.c:28: assertion got status valid. [eva] tests/libc/limits_h.c:29: assertion got status valid. [eva] tests/libc/limits_h.c:30: assertion got status valid. [eva] tests/libc/limits_h.c:31: assertion got status valid. [eva] tests/libc/limits_h.c:32: assertion got status valid. [eva] tests/libc/limits_h.c:33: assertion got status valid. [eva] tests/libc/limits_h.c:34: assertion got status valid. [eva] tests/libc/limits_h.c:35: assertion got status valid. [eva] tests/libc/limits_h.c:36: assertion got status valid. [eva] tests/libc/limits_h.c:37: assertion got status valid. [eva] tests/libc/limits_h.c:38: assertion got status valid. [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 7 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: size_max ∈ {18446744073709551615} ssize_max ∈ {9223372036854775807} intptr_max ∈ {9223372036854775807} intptr_min ∈ {-9223372036854775808} uintptr_max ∈ {18446744073709551615} uintmax_max ∈ {18446744073709551615} frama-c-20.0-Calcium/tests/libc/oracle/limits_h.3.res.oracle0000666000000000000000000000361313571573400020466 0ustar [kernel] Parsing tests/libc/limits_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/limits_h.c:16: assertion got status valid. [eva] tests/libc/limits_h.c:18: assertion got status valid. [eva] tests/libc/limits_h.c:19: assertion got status valid. [eva] tests/libc/limits_h.c:20: assertion got status valid. [eva] tests/libc/limits_h.c:21: assertion got status valid. [eva] tests/libc/limits_h.c:22: assertion got status valid. [eva] tests/libc/limits_h.c:23: assertion got status valid. [eva] tests/libc/limits_h.c:24: assertion got status valid. [eva] tests/libc/limits_h.c:25: assertion got status valid. [eva] tests/libc/limits_h.c:26: assertion got status valid. [eva] tests/libc/limits_h.c:27: assertion got status valid. [eva] tests/libc/limits_h.c:28: assertion got status valid. [eva] tests/libc/limits_h.c:29: assertion got status valid. [eva] tests/libc/limits_h.c:30: assertion got status valid. [eva] tests/libc/limits_h.c:31: assertion got status valid. [eva] tests/libc/limits_h.c:32: assertion got status valid. [eva] tests/libc/limits_h.c:33: assertion got status valid. [eva] tests/libc/limits_h.c:34: assertion got status valid. [eva] tests/libc/limits_h.c:35: assertion got status valid. [eva] tests/libc/limits_h.c:36: assertion got status valid. [eva] tests/libc/limits_h.c:37: assertion got status valid. [eva] tests/libc/limits_h.c:38: assertion got status valid. [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 6 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: size_max ∈ {65535} ssize_max ∈ {2147483647} intptr_max ∈ {2147483647} intptr_min ∈ {-2147483648} uintptr_max ∈ {4294967295} uintmax_max ∈ {18446744073709551615} frama-c-20.0-Calcium/tests/libc/oracle/limits_h.4.res.oracle0000666000000000000000000000362013571573400020465 0ustar [kernel] Parsing tests/libc/limits_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/limits_h.c:16: assertion got status valid. [eva] tests/libc/limits_h.c:18: assertion got status valid. [eva] tests/libc/limits_h.c:19: assertion got status valid. [eva] tests/libc/limits_h.c:20: assertion got status valid. [eva] tests/libc/limits_h.c:21: assertion got status valid. [eva] tests/libc/limits_h.c:22: assertion got status valid. [eva] tests/libc/limits_h.c:23: assertion got status valid. [eva] tests/libc/limits_h.c:24: assertion got status valid. [eva] tests/libc/limits_h.c:25: assertion got status valid. [eva] tests/libc/limits_h.c:26: assertion got status valid. [eva] tests/libc/limits_h.c:27: assertion got status valid. [eva] tests/libc/limits_h.c:28: assertion got status valid. [eva] tests/libc/limits_h.c:29: assertion got status valid. [eva] tests/libc/limits_h.c:30: assertion got status valid. [eva] tests/libc/limits_h.c:31: assertion got status valid. [eva] tests/libc/limits_h.c:32: assertion got status valid. [eva] tests/libc/limits_h.c:33: assertion got status valid. [eva] tests/libc/limits_h.c:34: assertion got status valid. [eva] tests/libc/limits_h.c:35: assertion got status valid. [eva] tests/libc/limits_h.c:36: assertion got status valid. [eva] tests/libc/limits_h.c:37: assertion got status valid. [eva] tests/libc/limits_h.c:38: assertion got status valid. [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 7 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: size_max ∈ {4294967295} ssize_max ∈ {2147483647} intptr_max ∈ {2147483647} intptr_min ∈ {-2147483648} uintptr_max ∈ {4294967295} uintmax_max ∈ {18446744073709551615} frama-c-20.0-Calcium/tests/libc/oracle/limits_h.5.res.oracle0000666000000000000000000000367713571573400020502 0ustar [kernel] Parsing tests/libc/limits_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/limits_h.c:16: assertion got status valid. [eva] tests/libc/limits_h.c:18: assertion got status valid. [eva] tests/libc/limits_h.c:19: assertion got status valid. [eva] tests/libc/limits_h.c:20: assertion got status valid. [eva] tests/libc/limits_h.c:21: assertion got status valid. [eva] tests/libc/limits_h.c:22: assertion got status valid. [eva] tests/libc/limits_h.c:23: assertion got status valid. [eva] tests/libc/limits_h.c:24: assertion got status valid. [eva] tests/libc/limits_h.c:25: assertion got status valid. [eva] tests/libc/limits_h.c:26: assertion got status valid. [eva] tests/libc/limits_h.c:27: assertion got status valid. [eva] tests/libc/limits_h.c:28: assertion got status valid. [eva] tests/libc/limits_h.c:29: assertion got status valid. [eva] tests/libc/limits_h.c:30: assertion got status valid. [eva] tests/libc/limits_h.c:31: assertion got status valid. [eva] tests/libc/limits_h.c:32: assertion got status valid. [eva] tests/libc/limits_h.c:33: assertion got status valid. [eva] tests/libc/limits_h.c:34: assertion got status valid. [eva] tests/libc/limits_h.c:35: assertion got status valid. [eva] tests/libc/limits_h.c:36: assertion got status valid. [eva] tests/libc/limits_h.c:37: assertion got status valid. [eva] tests/libc/limits_h.c:38: assertion got status valid. [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 7 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: size_max ∈ {18446744073709551615} ssize_max ∈ {9223372036854775807} intptr_max ∈ {9223372036854775807} intptr_min ∈ {-9223372036854775808} uintptr_max ∈ {18446744073709551615} uintmax_max ∈ {18446744073709551615} frama-c-20.0-Calcium/tests/libc/oracle/limits_h.6.res.oracle0000666000000000000000000000362013571573400020467 0ustar [kernel] Parsing tests/libc/limits_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/limits_h.c:16: assertion got status valid. [eva] tests/libc/limits_h.c:18: assertion got status valid. [eva] tests/libc/limits_h.c:19: assertion got status valid. [eva] tests/libc/limits_h.c:20: assertion got status valid. [eva] tests/libc/limits_h.c:21: assertion got status valid. [eva] tests/libc/limits_h.c:22: assertion got status valid. [eva] tests/libc/limits_h.c:23: assertion got status valid. [eva] tests/libc/limits_h.c:24: assertion got status valid. [eva] tests/libc/limits_h.c:25: assertion got status valid. [eva] tests/libc/limits_h.c:26: assertion got status valid. [eva] tests/libc/limits_h.c:27: assertion got status valid. [eva] tests/libc/limits_h.c:28: assertion got status valid. [eva] tests/libc/limits_h.c:29: assertion got status valid. [eva] tests/libc/limits_h.c:30: assertion got status valid. [eva] tests/libc/limits_h.c:31: assertion got status valid. [eva] tests/libc/limits_h.c:32: assertion got status valid. [eva] tests/libc/limits_h.c:33: assertion got status valid. [eva] tests/libc/limits_h.c:34: assertion got status valid. [eva] tests/libc/limits_h.c:35: assertion got status valid. [eva] tests/libc/limits_h.c:36: assertion got status valid. [eva] tests/libc/limits_h.c:37: assertion got status valid. [eva] tests/libc/limits_h.c:38: assertion got status valid. [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 7 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: size_max ∈ {4294967295} ssize_max ∈ {2147483647} intptr_max ∈ {2147483647} intptr_min ∈ {-2147483648} uintptr_max ∈ {4294967295} uintmax_max ∈ {18446744073709551615} frama-c-20.0-Calcium/tests/libc/oracle/limits_h.7.res.oracle0000666000000000000000000000363113571573400020472 0ustar [kernel] Parsing tests/libc/limits_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/limits_h.c:16: assertion got status valid. [eva] tests/libc/limits_h.c:18: assertion got status valid. [eva] tests/libc/limits_h.c:19: assertion got status valid. [eva] tests/libc/limits_h.c:20: assertion got status valid. [eva] tests/libc/limits_h.c:21: assertion got status valid. [eva] tests/libc/limits_h.c:22: assertion got status valid. [eva] tests/libc/limits_h.c:23: assertion got status valid. [eva] tests/libc/limits_h.c:24: assertion got status valid. [eva] tests/libc/limits_h.c:25: assertion got status valid. [eva] tests/libc/limits_h.c:26: assertion got status valid. [eva] tests/libc/limits_h.c:27: assertion got status valid. [eva] tests/libc/limits_h.c:28: assertion got status valid. [eva] tests/libc/limits_h.c:29: assertion got status valid. [eva] tests/libc/limits_h.c:30: assertion got status valid. [eva] tests/libc/limits_h.c:31: assertion got status valid. [eva] tests/libc/limits_h.c:32: assertion got status valid. [eva] tests/libc/limits_h.c:33: assertion got status valid. [eva] tests/libc/limits_h.c:34: assertion got status valid. [eva] tests/libc/limits_h.c:35: assertion got status valid. [eva] tests/libc/limits_h.c:36: assertion got status valid. [eva] tests/libc/limits_h.c:37: assertion got status valid. [eva] tests/libc/limits_h.c:38: assertion got status valid. [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 7 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: size_max ∈ {18446744073709551615} intptr_max ∈ {9223372036854775807} intptr_min ∈ {-9223372036854775808} uintptr_max ∈ {18446744073709551615} uintmax_max ∈ {18446744073709551615} frama-c-20.0-Calcium/tests/libc/oracle/math_h.res.oracle0000666000000000000000000003521213571573400017755 0ustar [kernel] Parsing tests/libc/math_h.c (with preprocessing) [kernel:parser:decimal-float] tests/libc/math_h.c:3: Warning: Floating-point constant 3.14159265358979323846264338327950288 is not represented exactly. Will use 0x1.921fb54442d18p1. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization pi ∈ {3.14159265359} half_pi ∈ {1.57079632679} e ∈ {2.71828182846} top ∈ [--..--] f_pi ∈ {3.14159274101} f_half_pi ∈ {1.57079637051} f_e ∈ {2.71828174591} f_top ∈ [--..--] ld_pi ∈ [3.14159265359 .. 3.14159265359] ld_half_pi ∈ [1.57079632679 .. 1.57079632679] ld_e ∈ {2.71828182846} ld_top ∈ [--..--] zero ∈ {0} minus_zero ∈ {-0.} one ∈ {1.} minus_one ∈ {-1.} large ∈ {1e+38} [eva] computing for function atan <- main. Called from tests/libc/math_h.c:35. [eva] using specification for function atan [eva] tests/libc/math_h.c:35: function atan: precondition 'finite_arg' got status valid. [eva] Done for function atan [eva] computing for function atan <- main. Called from tests/libc/math_h.c:35. [eva] tests/libc/math_h.c:35: function atan: precondition 'finite_arg' got status valid. [eva] Done for function atan [eva] computing for function atan <- main. Called from tests/libc/math_h.c:35. [eva] tests/libc/math_h.c:35: function atan: precondition 'finite_arg' got status valid. [eva] Done for function atan [eva] computing for function atan <- main. Called from tests/libc/math_h.c:35. [eva] tests/libc/math_h.c:35: function atan: precondition 'finite_arg' got status valid. [eva] Done for function atan [eva] computing for function atan <- main. Called from tests/libc/math_h.c:35. [eva] tests/libc/math_h.c:35: function atan: precondition 'finite_arg' got status valid. [eva] Done for function atan [eva] computing for function atan <- main. Called from tests/libc/math_h.c:35. [eva] tests/libc/math_h.c:35: function atan: precondition 'finite_arg' got status valid. [eva] Done for function atan [eva] computing for function atan <- main. Called from tests/libc/math_h.c:35. [eva] tests/libc/math_h.c:35: function atan: precondition 'finite_arg' got status valid. [eva] Done for function atan [eva] computing for function atan <- main. Called from tests/libc/math_h.c:35. [eva] tests/libc/math_h.c:35: function atan: precondition 'finite_arg' got status valid. [eva] Done for function atan [eva:alarm] tests/libc/math_h.c:35: Warning: non-finite double value. assert \is_finite(top); [eva] computing for function atan <- main. Called from tests/libc/math_h.c:35. [eva] tests/libc/math_h.c:35: function atan: precondition 'finite_arg' got status valid. [eva] Done for function atan [eva] computing for function atanf <- main. Called from tests/libc/math_h.c:36. [eva] using specification for function atanf [eva] tests/libc/math_h.c:36: function atanf: precondition 'finite_arg' got status valid. [eva] Done for function atanf [eva] computing for function atanf <- main. Called from tests/libc/math_h.c:36. [eva] tests/libc/math_h.c:36: function atanf: precondition 'finite_arg' got status valid. [eva] Done for function atanf [eva] computing for function atanf <- main. Called from tests/libc/math_h.c:36. [eva] tests/libc/math_h.c:36: function atanf: precondition 'finite_arg' got status valid. [eva] Done for function atanf [eva] computing for function atanf <- main. Called from tests/libc/math_h.c:36. [eva] tests/libc/math_h.c:36: function atanf: precondition 'finite_arg' got status valid. [eva] Done for function atanf [eva] computing for function atanf <- main. Called from tests/libc/math_h.c:36. [eva] tests/libc/math_h.c:36: function atanf: precondition 'finite_arg' got status valid. [eva] Done for function atanf [eva] computing for function atanf <- main. Called from tests/libc/math_h.c:36. [eva] tests/libc/math_h.c:36: function atanf: precondition 'finite_arg' got status valid. [eva] Done for function atanf [eva] computing for function atanf <- main. Called from tests/libc/math_h.c:36. [eva] tests/libc/math_h.c:36: function atanf: precondition 'finite_arg' got status valid. [eva] Done for function atanf [eva] computing for function atanf <- main. Called from tests/libc/math_h.c:36. [eva] tests/libc/math_h.c:36: function atanf: precondition 'finite_arg' got status valid. [eva] Done for function atanf [eva:alarm] tests/libc/math_h.c:36: Warning: non-finite float value. assert \is_finite(f_top); [eva] computing for function atanf <- main. Called from tests/libc/math_h.c:36. [eva] tests/libc/math_h.c:36: function atanf: precondition 'finite_arg' got status valid. [eva] Done for function atanf [eva] computing for function atanl <- main. Called from tests/libc/math_h.c:37. [eva] using specification for function atanl [eva] tests/libc/math_h.c:37: function atanl: precondition 'finite_arg' got status valid. [eva] Done for function atanl [eva] computing for function atanl <- main. Called from tests/libc/math_h.c:37. [eva] tests/libc/math_h.c:37: function atanl: precondition 'finite_arg' got status valid. [eva] Done for function atanl [eva] computing for function atanl <- main. Called from tests/libc/math_h.c:37. [eva] tests/libc/math_h.c:37: function atanl: precondition 'finite_arg' got status valid. [eva] Done for function atanl [eva] computing for function atanl <- main. Called from tests/libc/math_h.c:37. [eva] tests/libc/math_h.c:37: function atanl: precondition 'finite_arg' got status valid. [eva] Done for function atanl [eva] computing for function atanl <- main. Called from tests/libc/math_h.c:37. [eva] tests/libc/math_h.c:37: function atanl: precondition 'finite_arg' got status valid. [eva] Done for function atanl [eva] computing for function atanl <- main. Called from tests/libc/math_h.c:37. [eva] tests/libc/math_h.c:37: function atanl: precondition 'finite_arg' got status valid. [eva] Done for function atanl [eva] computing for function atanl <- main. Called from tests/libc/math_h.c:37. [eva] tests/libc/math_h.c:37: function atanl: precondition 'finite_arg' got status valid. [eva] Done for function atanl [eva] computing for function atanl <- main. Called from tests/libc/math_h.c:37. [eva] tests/libc/math_h.c:37: function atanl: precondition 'finite_arg' got status valid. [eva] Done for function atanl [eva:alarm] tests/libc/math_h.c:37: Warning: non-finite long double value. assert \is_finite(ld_top); [eva] computing for function atanl <- main. Called from tests/libc/math_h.c:37. [eva:alarm] tests/libc/math_h.c:37: Warning: function atanl: precondition 'finite_arg' got status unknown. [eva] Done for function atanl [eva] computing for function fabs <- main. Called from tests/libc/math_h.c:38. [eva] using specification for function fabs [eva] tests/libc/math_h.c:38: function fabs: precondition 'finite_arg' got status valid. [eva] Done for function fabs [eva] computing for function fabs <- main. Called from tests/libc/math_h.c:38. [eva] tests/libc/math_h.c:38: function fabs: precondition 'finite_arg' got status valid. [eva] Done for function fabs [eva] computing for function fabs <- main. Called from tests/libc/math_h.c:38. [eva] tests/libc/math_h.c:38: function fabs: precondition 'finite_arg' got status valid. [eva] Done for function fabs [eva] computing for function fabs <- main. Called from tests/libc/math_h.c:38. [eva] tests/libc/math_h.c:38: function fabs: precondition 'finite_arg' got status valid. [eva] Done for function fabs [eva] computing for function fabs <- main. Called from tests/libc/math_h.c:38. [eva] tests/libc/math_h.c:38: function fabs: precondition 'finite_arg' got status valid. [eva] Done for function fabs [eva] computing for function fabs <- main. Called from tests/libc/math_h.c:38. [eva] tests/libc/math_h.c:38: function fabs: precondition 'finite_arg' got status valid. [eva] Done for function fabs [eva] computing for function fabs <- main. Called from tests/libc/math_h.c:38. [eva] tests/libc/math_h.c:38: function fabs: precondition 'finite_arg' got status valid. [eva] Done for function fabs [eva] computing for function fabs <- main. Called from tests/libc/math_h.c:38. [eva] tests/libc/math_h.c:38: function fabs: precondition 'finite_arg' got status valid. [eva] Done for function fabs [eva:alarm] tests/libc/math_h.c:38: Warning: non-finite double value. assert \is_finite(top); [eva] computing for function fabs <- main. Called from tests/libc/math_h.c:38. [eva] tests/libc/math_h.c:38: function fabs: precondition 'finite_arg' got status valid. [eva] Done for function fabs [eva] computing for function fabsf <- main. Called from tests/libc/math_h.c:39. [eva] using specification for function fabsf [eva] tests/libc/math_h.c:39: function fabsf: precondition 'finite_arg' got status valid. [eva] Done for function fabsf [eva] computing for function fabsf <- main. Called from tests/libc/math_h.c:39. [eva] tests/libc/math_h.c:39: function fabsf: precondition 'finite_arg' got status valid. [eva] Done for function fabsf [eva] computing for function fabsf <- main. Called from tests/libc/math_h.c:39. [eva] tests/libc/math_h.c:39: function fabsf: precondition 'finite_arg' got status valid. [eva] Done for function fabsf [eva] computing for function fabsf <- main. Called from tests/libc/math_h.c:39. [eva] tests/libc/math_h.c:39: function fabsf: precondition 'finite_arg' got status valid. [eva] Done for function fabsf [eva] computing for function fabsf <- main. Called from tests/libc/math_h.c:39. [eva] tests/libc/math_h.c:39: function fabsf: precondition 'finite_arg' got status valid. [eva] Done for function fabsf [eva] computing for function fabsf <- main. Called from tests/libc/math_h.c:39. [eva] tests/libc/math_h.c:39: function fabsf: precondition 'finite_arg' got status valid. [eva] Done for function fabsf [eva] computing for function fabsf <- main. Called from tests/libc/math_h.c:39. [eva] tests/libc/math_h.c:39: function fabsf: precondition 'finite_arg' got status valid. [eva] Done for function fabsf [eva] computing for function fabsf <- main. Called from tests/libc/math_h.c:39. [eva] tests/libc/math_h.c:39: function fabsf: precondition 'finite_arg' got status valid. [eva] Done for function fabsf [eva:alarm] tests/libc/math_h.c:39: Warning: non-finite float value. assert \is_finite(f_top); [eva] computing for function fabsf <- main. Called from tests/libc/math_h.c:39. [eva] tests/libc/math_h.c:39: function fabsf: precondition 'finite_arg' got status valid. [eva] Done for function fabsf [eva] computing for function fabsl <- main. Called from tests/libc/math_h.c:40. [eva] using specification for function fabsl [eva] tests/libc/math_h.c:40: function fabsl: precondition 'finite_arg' got status valid. [eva] Done for function fabsl [eva] computing for function fabsl <- main. Called from tests/libc/math_h.c:40. [eva] tests/libc/math_h.c:40: function fabsl: precondition 'finite_arg' got status valid. [eva] Done for function fabsl [eva] computing for function fabsl <- main. Called from tests/libc/math_h.c:40. [eva] tests/libc/math_h.c:40: function fabsl: precondition 'finite_arg' got status valid. [eva] Done for function fabsl [eva] computing for function fabsl <- main. Called from tests/libc/math_h.c:40. [eva] tests/libc/math_h.c:40: function fabsl: precondition 'finite_arg' got status valid. [eva] Done for function fabsl [eva] computing for function fabsl <- main. Called from tests/libc/math_h.c:40. [eva] tests/libc/math_h.c:40: function fabsl: precondition 'finite_arg' got status valid. [eva] Done for function fabsl [eva] computing for function fabsl <- main. Called from tests/libc/math_h.c:40. [eva] tests/libc/math_h.c:40: function fabsl: precondition 'finite_arg' got status valid. [eva] Done for function fabsl [eva] computing for function fabsl <- main. Called from tests/libc/math_h.c:40. [eva] tests/libc/math_h.c:40: function fabsl: precondition 'finite_arg' got status valid. [eva] Done for function fabsl [eva] computing for function fabsl <- main. Called from tests/libc/math_h.c:40. [eva] tests/libc/math_h.c:40: function fabsl: precondition 'finite_arg' got status valid. [eva] Done for function fabsl [eva:alarm] tests/libc/math_h.c:40: Warning: non-finite long double value. assert \is_finite(ld_top); [eva] computing for function fabsl <- main. Called from tests/libc/math_h.c:40. [eva:alarm] tests/libc/math_h.c:40: Warning: function fabsl: precondition 'finite_arg' got status unknown. [eva] Done for function fabsl [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: atan_pi ∈ [-1.571 .. 1.571] atan_half_pi ∈ [-1.571 .. 1.571] atan_e ∈ [-1.571 .. 1.571] atan_zero ∈ [-1.571 .. 1.571] atan_minus_zero ∈ [-1.571 .. 1.571] atan_one ∈ [-1.571 .. 1.571] atan_minus_one ∈ [-1.571 .. 1.571] atan_large ∈ [-1.571 .. 1.571] atan_top ∈ [-1.571 .. 1.571] atanf_f_pi ∈ [-1.57099997997 .. 1.57099997997] atanf_f_half_pi ∈ [-1.57099997997 .. 1.57099997997] atanf_f_e ∈ [-1.57099997997 .. 1.57099997997] atanf_zero ∈ [-1.57099997997 .. 1.57099997997] atanf_minus_zero ∈ [-1.57099997997 .. 1.57099997997] atanf_one ∈ [-1.57099997997 .. 1.57099997997] atanf_minus_one ∈ [-1.57099997997 .. 1.57099997997] atanf_large ∈ [-1.57099997997 .. 1.57099997997] atanf_f_top ∈ [-1.57099997997 .. 1.57099997997] atanl_ld_pi ∈ [-inf .. inf] atanl_ld_half_pi ∈ [-inf .. inf] atanl_ld_e ∈ [-inf .. inf] atanl_zero ∈ [-inf .. inf] atanl_minus_zero ∈ [-inf .. inf] atanl_one ∈ [-inf .. inf] atanl_minus_one ∈ [-inf .. inf] atanl_large ∈ [-inf .. inf] atanl_ld_top ∈ [-inf .. inf] fabs_pi ∈ {3.14159265359} fabs_half_pi ∈ {1.57079632679} fabs_e ∈ {2.71828182846} fabs_zero ∈ [-0. .. 0.] fabs_minus_zero ∈ [-0. .. 0.] fabs_one ∈ {1.} fabs_minus_one ∈ {1.} fabs_large ∈ {1e+38} fabs_top ∈ [-0. .. 1.79769313486e+308] fabsf_f_pi ∈ {3.14159274101} fabsf_f_half_pi ∈ {1.57079637051} fabsf_f_e ∈ {2.71828174591} fabsf_zero ∈ [-0. .. 0.] fabsf_minus_zero ∈ [-0. .. 0.] fabsf_one ∈ {1.} fabsf_minus_one ∈ {1.} fabsf_large ∈ {9.99999968029e+37} fabsf_f_top ∈ [-0. .. 3.40282346639e+38] fabsl_ld_pi ∈ [-inf .. inf] fabsl_ld_half_pi ∈ [-inf .. inf] fabsl_ld_e ∈ [-inf .. inf] fabsl_zero ∈ [-inf .. inf] fabsl_minus_zero ∈ [-inf .. inf] fabsl_one ∈ [-inf .. inf] fabsl_minus_one ∈ [-inf .. inf] fabsl_large ∈ [-inf .. inf] fabsl_ld_top ∈ [-inf .. inf] __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/more_gcc_builtins.res.oracle0000666000000000000000000001226413571573400022206 0ustar [kernel] Parsing tests/libc/more_gcc_builtins.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function __builtin_sadd_overflow <- main. Called from tests/libc/more_gcc_builtins.c:10. [eva] using specification for function __builtin_sadd_overflow [eva] tests/libc/more_gcc_builtins.c:10: function __builtin_sadd_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_sadd_overflow [eva] tests/libc/more_gcc_builtins.c:11: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:12: assertion got status valid. [eva] computing for function __builtin_sadd_overflow <- main. Called from tests/libc/more_gcc_builtins.c:13. [eva] tests/libc/more_gcc_builtins.c:13: function __builtin_sadd_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_sadd_overflow [eva] tests/libc/more_gcc_builtins.c:14: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:15: assertion got status valid. [eva] computing for function __builtin_saddl_overflow <- main. Called from tests/libc/more_gcc_builtins.c:17. [eva] using specification for function __builtin_saddl_overflow [eva] tests/libc/more_gcc_builtins.c:17: function __builtin_saddl_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_saddl_overflow [eva] tests/libc/more_gcc_builtins.c:18: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:19: assertion got status valid. [eva] computing for function __builtin_saddl_overflow <- main. Called from tests/libc/more_gcc_builtins.c:20. [eva] tests/libc/more_gcc_builtins.c:20: function __builtin_saddl_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_saddl_overflow [eva] tests/libc/more_gcc_builtins.c:21: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:22: assertion got status valid. [eva] computing for function __builtin_saddll_overflow <- main. Called from tests/libc/more_gcc_builtins.c:24. [eva] using specification for function __builtin_saddll_overflow [eva] tests/libc/more_gcc_builtins.c:24: function __builtin_saddll_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_saddll_overflow [eva] tests/libc/more_gcc_builtins.c:25: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:26: assertion got status valid. [eva] computing for function __builtin_uadd_overflow <- main. Called from tests/libc/more_gcc_builtins.c:28. [eva] using specification for function __builtin_uadd_overflow [eva] tests/libc/more_gcc_builtins.c:28: function __builtin_uadd_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_uadd_overflow [eva] tests/libc/more_gcc_builtins.c:29: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:30: assertion got status valid. [eva] computing for function __builtin_uaddl_overflow <- main. Called from tests/libc/more_gcc_builtins.c:32. [eva] using specification for function __builtin_uaddl_overflow [eva] tests/libc/more_gcc_builtins.c:32: function __builtin_uaddl_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_uaddl_overflow [eva] tests/libc/more_gcc_builtins.c:33: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:34: assertion got status valid. [eva] computing for function __builtin_uaddll_overflow <- main. Called from tests/libc/more_gcc_builtins.c:36. [eva] using specification for function __builtin_uaddll_overflow [eva] tests/libc/more_gcc_builtins.c:36: function __builtin_uaddll_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_uaddll_overflow [eva] tests/libc/more_gcc_builtins.c:37: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:38: assertion got status valid. [eva] computing for function __builtin_usubll_overflow <- main. Called from tests/libc/more_gcc_builtins.c:39. [eva] using specification for function __builtin_usubll_overflow [eva] tests/libc/more_gcc_builtins.c:39: function __builtin_usubll_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_usubll_overflow [eva] tests/libc/more_gcc_builtins.c:40: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:41: assertion got status valid. [eva] computing for function __builtin_smulll_overflow <- main. Called from tests/libc/more_gcc_builtins.c:42. [eva] using specification for function __builtin_smulll_overflow [eva] tests/libc/more_gcc_builtins.c:42: function __builtin_smulll_overflow: precondition 'valid_res' got status valid. [eva] Done for function __builtin_smulll_overflow [eva] tests/libc/more_gcc_builtins.c:43: assertion got status valid. [eva] tests/libc/more_gcc_builtins.c:44: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: res ∈ {-2147483607} r ∈ {1} lres ∈ {2147483647} llres ∈ {-9223372036854775808} ures ∈ {8} ulres ∈ {8} ullres ∈ {18446744073709551612} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/netdb_c.res.oracle0000666000000000000000000003546713571573400020127 0ustar [kernel] Parsing tests/libc/netdb_c.c (with preprocessing) [eva] Splitting return states on: \return(tmpfile) == 0 (auto) \return(tmpnam) == 0 (auto) \return(fopen) == 0 (auto) \return(fdopen) == 0 (auto) \return(freopen) == 0 (auto) \return(fgets) == 0 (auto) \return(gets) == 0 (auto) \return(popen) == 0 (auto) \return(seed48) == 0 (auto) \return(calloc) == 0 (auto) \return(malloc) == 0 (auto) \return(realloc) == 0 (auto) \return(getenv) == 0 (auto) \return(bsearch) == 0 (auto) \return(getcwd) == 0 (auto) \return(ttyname) == 0 (auto) \return(memchr) == 0 (auto) \return(memcpy) == 0 (auto) \return(memmove) == 0 (auto) \return(memset) == 0 (auto) \return(strchr) == 0 (auto) \return(strrchr) == 0 (auto) \return(strpbrk) == 0 (auto) \return(strstr) == 0 (auto) \return(strcasestr) == 0 (auto) \return(strtok) == 0 (auto) \return(strtok_r) == 0 (auto) \return(strsep) == 0 (auto) \return(strerror) == 0 (auto) \return(strcpy) == 0 (auto) \return(strncpy) == 0 (auto) \return(stpcpy) == 0 (auto) \return(strcat) == 0 (auto) \return(strncat) == 0 (auto) \return(strdup) == 0 (auto) \return(strndup) == 0 (auto) \return(strsignal) == 0 (auto) \return(bind) == 0 (auto) \return(socket) == -1 (auto) \return(signal) == 0 (auto) \return(inet_addr) == 4294967295 (auto) \return(inet_ntoa) == 0 (auto) \return(inet_ntop) == 0 (auto) \return(gai_strerror) == 0 (auto) \return(getaddrinfo) == 0 (auto) \return(gethostbyname) == 0 (auto) \return(Frama_C_nondet) == 0 (auto) \return(Frama_C_nondet_ptr) == 0 (auto) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/netdb_c.c:33: Call to builtin memset [eva] tests/libc/netdb_c.c:33: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] computing for function getaddrinfo <- main. Called from tests/libc/netdb_c.c:42. [eva] share/libc/netdb.c:56: Call to builtin malloc [eva] share/libc/netdb.c:56: allocating variable __malloc_getaddrinfo_l56 [eva] share/libc/netdb.c:58: Call to builtin malloc [eva] share/libc/netdb.c:58: allocating variable __malloc_getaddrinfo_l58 [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:60. [eva] using specification for function Frama_C_interval [eva] share/libc/netdb.c:60: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] share/libc/netdb.c:63: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:63. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:68. [eva] share/libc/netdb.c:68: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- getaddrinfo <- main. Called from share/libc/netdb.c:69. [eva] share/libc/netdb.c:69: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] Recording results for getaddrinfo [eva] Done for function getaddrinfo [eva] computing for function gai_strerror <- main. Called from tests/libc/netdb_c.c:44. [eva] using specification for function gai_strerror [eva] Done for function gai_strerror [eva] computing for function fprintf_va_1 <- main. Called from tests/libc/netdb_c.c:44. [eva] using specification for function fprintf_va_1 [eva] tests/libc/netdb_c.c:44: function fprintf_va_1: precondition valid_read_string(format) got status valid. [eva] tests/libc/netdb_c.c:44: function fprintf_va_1: precondition valid_read_string(param0) got status valid. [eva] Done for function fprintf_va_1 [eva] computing for function exit <- main. Called from tests/libc/netdb_c.c:45. [eva] using specification for function exit [eva] Done for function exit [eva] computing for function socket <- main. Called from tests/libc/netdb_c.c:54. [eva] using specification for function socket [eva] Done for function socket [eva] computing for function bind <- main. Called from tests/libc/netdb_c.c:59. [eva] using specification for function bind [eva] tests/libc/netdb_c.c:59: function bind: precondition 'valid_sockfd,sockfd' got status valid. [eva] tests/libc/netdb_c.c:59: function bind: precondition 'valid_read_addr' got status valid. [eva] Done for function bind [eva] computing for function close <- main. Called from tests/libc/netdb_c.c:62. [eva] using specification for function close [eva] tests/libc/netdb_c.c:62: function close: precondition 'valid_fd' got status valid. [eva] Done for function close [eva] computing for function fprintf_va_2 <- main. Called from tests/libc/netdb_c.c:65. [eva] using specification for function fprintf_va_2 [eva] tests/libc/netdb_c.c:65: function fprintf_va_2: precondition got status valid. [eva] Done for function fprintf_va_2 [eva] computing for function exit <- main. Called from tests/libc/netdb_c.c:66. [eva] Done for function exit [eva] computing for function freeaddrinfo <- main. Called from tests/libc/netdb_c.c:69. [eva] using specification for function freeaddrinfo [eva] tests/libc/netdb_c.c:69: Warning: ignoring unsupported \allocates clause [eva] tests/libc/netdb_c.c:69: function freeaddrinfo: precondition 'addrinfo_valid' got status valid. [eva] Done for function freeaddrinfo [eva] computing for function gethostbyname <- main. Called from tests/libc/netdb_c.c:71. [eva] computing for function res_search <- gethostbyname <- main. Called from share/libc/netdb.c:139. [eva] computing for function Frama_C_char_interval <- res_search <- gethostbyname <- main. Called from share/libc/netdb.c:97. [eva] using specification for function Frama_C_char_interval [eva] share/libc/netdb.c:97: function Frama_C_char_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_char_interval [eva] computing for function Frama_C_char_interval <- res_search <- gethostbyname <- main. Called from share/libc/netdb.c:97. [eva] Done for function Frama_C_char_interval [eva] computing for function Frama_C_char_interval <- res_search <- gethostbyname <- main. Called from share/libc/netdb.c:97. [eva] Done for function Frama_C_char_interval [eva] share/libc/netdb.c:96: starting to merge loop iterations [eva] computing for function Frama_C_char_interval <- res_search <- gethostbyname <- main. Called from share/libc/netdb.c:97. [eva] Done for function Frama_C_char_interval [eva] computing for function Frama_C_char_interval <- res_search <- gethostbyname <- main. Called from share/libc/netdb.c:97. [eva] Done for function Frama_C_char_interval [eva] computing for function Frama_C_char_interval <- res_search <- gethostbyname <- main. Called from share/libc/netdb.c:97. [eva] Done for function Frama_C_char_interval [eva] computing for function Frama_C_char_interval <- res_search <- gethostbyname <- main. Called from share/libc/netdb.c:97. [eva] Done for function Frama_C_char_interval [eva] computing for function Frama_C_interval <- res_search <- gethostbyname <- main. Called from share/libc/netdb.c:100. [eva] share/libc/netdb.c:100: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] Recording results for res_search [eva] Done for function res_search [eva] computing for function Frama_C_nondet <- gethostbyname <- main. Called from share/libc/netdb.c:142. [eva] using specification for function Frama_C_nondet [eva] Done for function Frama_C_nondet [eva] computing for function inet_addr <- gethostbyname <- main. Called from share/libc/netdb.c:145. [eva] using specification for function inet_addr [eva] share/libc/netdb.c:145: function inet_addr: precondition 'valid_arg' got status valid. [eva] Done for function inet_addr [eva] share/libc/netdb.c:146: Call to builtin memcpy [eva] share/libc/netdb.c:146: function memcpy: precondition 'valid_dest' got status valid. [eva] share/libc/netdb.c:146: function memcpy: precondition 'valid_src' got status valid. [eva] share/libc/netdb.c:146: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] computing for function strncpy <- gethostbyname <- main. Called from share/libc/netdb.c:147. [eva] using specification for function strncpy [eva] share/libc/netdb.c:147: function strncpy: precondition 'valid_string_src' got status valid. [eva] share/libc/netdb.c:147: function strncpy: precondition 'room_nstring' got status valid. [eva] share/libc/netdb.c:147: function strncpy: precondition 'separation' got status valid. [eva] share/libc/string.h:367: cannot evaluate ACSL term, unsupported ACSL construct: logic function strcmp [eva] Done for function strncpy [eva] Recording results for gethostbyname [eva] Done for function gethostbyname [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function getaddrinfo: __fc_errno ∈ [--..--] __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] result ∈ {{ &__malloc_getaddrinfo_l56 }} or UNINITIALIZED __retres ∈ [-11..0] __malloc_getaddrinfo_l56.ai_flags ∈ {0} or UNINITIALIZED .ai_family ∈ [0..43] or UNINITIALIZED .ai_socktype ∈ {0; 1; 2; 3; 4; 5} or UNINITIALIZED .ai_protocol ∈ [0..256] or UNINITIALIZED .ai_addrlen ∈ {16} or UNINITIALIZED .ai_addr ∈ {{ &__malloc_getaddrinfo_l58 }} or UNINITIALIZED .ai_canonname ∈ {{ "dummy" }} or UNINITIALIZED .ai_next ∈ {0} or UNINITIALIZED __malloc_getaddrinfo_l58.sa_family ∈ [0..43] .sa_data[0..13] ∈ [--..--] [eva:final-states] Values at end of function res_search: Frama_C_entropy_source ∈ [--..--] buf[0..1] ∈ [--..--] [2..126] ∈ [--..--] or UNINITIALIZED [127] ∈ {0} [eva:final-states] Values at end of function gethostbyname: Frama_C_entropy_source ∈ [--..--] __fc_ghbn.host.h_name ∈ {{ NULL ; &__fc_ghbn.hostbuf[0] }} .host.h_aliases ∈ {{ NULL ; &__fc_ghbn.host_aliases[0] }} .host.h_addrtype ∈ {2} .host.h_length ∈ {4} .host.h_addr_list ∈ {{ NULL ; &__fc_ghbn.h_addr_ptrs[0] }} .host_addr[0..3] ∈ [--..--] .h_addr_ptrs[0] ∈ {{ NULL ; (char *)&__fc_ghbn.host_addr }} {.h_addr_ptrs[1..2]; .host_aliases[0..1]} ∈ {0} .hostbuf[0..126] ∈ [--..--] .hostbuf[127] ∈ {0} buf[0..1] ∈ [--..--] [2..126] ∈ [--..--] or UNINITIALIZED [127] ∈ {0} n ∈ [-1..128] __retres ∈ {{ NULL ; &__fc_ghbn.host }} [eva:final-states] Values at end of function main: __fc_errno ∈ [--..--] __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] __fc_fds[0..1023] ∈ {0} __fc_sockfds[0..1023] ∈ [--..--] __fc_socket_counter ∈ [--..--] __fc_ghbn.host.h_name ∈ {{ NULL ; &__fc_ghbn.hostbuf[0] }} .host.h_aliases ∈ {{ NULL ; &__fc_ghbn.host_aliases[0] }} .host.h_addrtype ∈ {2} .host.h_length ∈ {4} .host.h_addr_list ∈ {{ NULL ; &__fc_ghbn.h_addr_ptrs[0] }} .host_addr[0..3] ∈ [--..--] .h_addr_ptrs[0] ∈ {{ NULL ; (char *)&__fc_ghbn.host_addr }} {.h_addr_ptrs[1..2]; .host_aliases[0..1]} ∈ {0} .hostbuf[0..126] ∈ [--..--] .hostbuf[127] ∈ {0} hints.ai_flags ∈ {1} .ai_family ∈ {0} .ai_socktype ∈ {2} {.ai_protocol; .ai_addrlen; .ai_addr; .ai_canonname; .ai_next} ∈ {0} result ∈ {{ &__malloc_getaddrinfo_l56 }} rp ∈ {{ &__malloc_getaddrinfo_l56 }} sfd ∈ [0..1023] s ∈ {0} addr ∈ {{ "localhost" }} h ∈ {{ NULL ; &__fc_ghbn.host }} __retres ∈ {0} S___fc_stderr[0..1] ∈ [--..--] __malloc_getaddrinfo_l56.ai_flags ∈ {0} .ai_family ∈ [0..43] .ai_socktype ∈ {0; 1; 2; 3; 4; 5} .ai_protocol ∈ [0..256] .ai_addrlen ∈ {16} .ai_addr ∈ {{ &__malloc_getaddrinfo_l58 }} .ai_canonname ∈ {{ "dummy" }} .ai_next ∈ {0} __malloc_getaddrinfo_l58.sa_family ∈ [0..43] .sa_data[0..13] ∈ [--..--] frama-c-20.0-Calcium/tests/libc/oracle/netinet_in_h.res.oracle0000666000000000000000000000214213571573400021154 0ustar [kernel] Parsing tests/libc/netinet_in_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function inet_ntoa <- main. Called from tests/libc/netinet_in_h.c:6. [eva] using specification for function inet_ntoa [eva] Done for function inet_ntoa [eva] computing for function printf_va_1 <- main. Called from tests/libc/netinet_in_h.c:6. [eva] using specification for function printf_va_1 [eva] tests/libc/netinet_in_h.c:6: function printf_va_1: precondition valid_read_string(format) got status valid. [eva] tests/libc/netinet_in_h.c:6: function printf_va_1: precondition valid_read_string(param0) got status valid. [eva] Done for function printf_va_1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_inet_ntoa_array[0..14] ∈ [--..--] [15] ∈ {0} addr ∈ {0} __retres ∈ {0} S___fc_stdout[0..1] ∈ [--..--] frama-c-20.0-Calcium/tests/libc/oracle/poll.res.oracle0000666000000000000000000000216313571573400017462 0ustar [kernel] Parsing tests/libc/poll.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function poll <- main. Called from tests/libc/poll.c:11. [eva] using specification for function poll [eva] tests/libc/poll.c:11: function poll: precondition 'valid_file_descriptors' got status valid. [eva] Done for function poll [eva] computing for function perror <- main. Called from tests/libc/poll.c:12. [eva] using specification for function perror [eva] tests/libc/poll.c:12: function perror: precondition 'valid_string_s' got status valid. [eva] Done for function perror [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_stdout ∈ {{ NULL + [--..--] ; &S___fc_stdout[0] }} ufds.fd ∈ {0} .events ∈ {3} .revents ∈ [--..--] r ∈ {-1; 0; 1} can_read ∈ {0; 1} can_read_out_of_band ∈ {0; 2} invalid_fd ∈ {0; 32} __retres ∈ [0..127] frama-c-20.0-Calcium/tests/libc/oracle/pwd_h.res.oracle0000666000000000000000000000342513571573400017617 0ustar [kernel] Parsing tests/libc/pwd_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization uid ∈ [--..--] [eva] computing for function getpwuid <- main. Called from tests/libc/pwd_h.c:10. [eva] using specification for function getpwuid [eva] Done for function getpwuid [eva:alarm] tests/libc/pwd_h.c:13: Warning: assertion got status unknown. [eva:alarm] tests/libc/pwd_h.c:14: Warning: assertion got status unknown. [eva:alarm] tests/libc/pwd_h.c:15: Warning: assertion got status unknown. [eva:alarm] tests/libc/pwd_h.c:16: Warning: assertion got status unknown. [eva] computing for function getpwnam <- main. Called from tests/libc/pwd_h.c:18. [eva] using specification for function getpwnam [eva] tests/libc/pwd_h.c:18: function getpwnam: precondition 'valid_name' got status valid. [eva] Done for function getpwnam [eva:alarm] tests/libc/pwd_h.c:21: Warning: assertion got status unknown. [eva:alarm] tests/libc/pwd_h.c:22: Warning: assertion got status unknown. [eva:alarm] tests/libc/pwd_h.c:23: Warning: assertion got status unknown. [eva:alarm] tests/libc/pwd_h.c:24: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_pwd.pw_name ∈ {{ NULL + [--..--] ; &__fc_getpwuid_pw_name[0] }} .pw_passwd ∈ {{ NULL + [--..--] ; &__fc_getpwuid_pw_passwd[0] }} {.pw_uid; .pw_gid; .pw_gecos} ∈ [--..--] .pw_dir ∈ {{ NULL + [--..--] ; &__fc_getpwuid_pw_dir[0] }} .pw_shell ∈ {{ NULL + [--..--] ; &__fc_getpwuid_pw_shell[0] }} pw ∈ {{ NULL ; &__fc_pwd }} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/runtime.res.oracle0000666000000000000000000000000013571573400020163 0ustar frama-c-20.0-Calcium/tests/libc/oracle/signal_h.res.oracle0000666000000000000000000003461113571573400020303 0ustar [kernel] Parsing tests/libc/signal_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function sigemptyset <- main. Called from tests/libc/signal_h.c:10. [eva] using specification for function sigemptyset [eva] tests/libc/signal_h.c:10: function sigemptyset: precondition 'valid_set' got status valid. [eva] Done for function sigemptyset [eva] computing for function sigaddset <- main. Called from tests/libc/signal_h.c:11. [eva] using specification for function sigaddset [eva] tests/libc/signal_h.c:11: function sigaddset: precondition 'valid_set' got status valid. [eva] tests/libc/signal_h.c:11: function sigaddset: precondition 'initialization,set' got status valid. [eva] Done for function sigaddset [eva] computing for function sigdelset <- main. Called from tests/libc/signal_h.c:14. [eva] using specification for function sigdelset [eva] tests/libc/signal_h.c:14: function sigdelset: precondition 'valid_set' got status valid. [eva] tests/libc/signal_h.c:14: function sigdelset: precondition 'initialization,set' got status valid. [eva] Done for function sigdelset [eva] computing for function sigismember <- main. Called from tests/libc/signal_h.c:17. [eva] using specification for function sigismember [eva] tests/libc/signal_h.c:17: function sigismember: precondition 'valid_read_set' got status valid. [eva] tests/libc/signal_h.c:17: function sigismember: precondition 'initialization,set' got status valid. [eva] Done for function sigismember [eva] computing for function sigfillset <- main. Called from tests/libc/signal_h.c:18. [eva] using specification for function sigfillset [eva] tests/libc/signal_h.c:18: function sigfillset: precondition 'valid_set' got status valid. [eva] Done for function sigfillset [eva] computing for function sigismember <- main. Called from tests/libc/signal_h.c:19. [eva] tests/libc/signal_h.c:19: function sigismember: precondition 'valid_read_set' got status valid. [eva] tests/libc/signal_h.c:19: function sigismember: precondition 'initialization,set' got status valid. [eva] Done for function sigismember [eva] computing for function sigaddset <- main. Called from tests/libc/signal_h.c:22. [eva] tests/libc/signal_h.c:22: function sigaddset: precondition 'valid_set' got status valid. [eva:alarm] tests/libc/signal_h.c:22: Warning: function sigaddset: precondition 'initialization,set' got status invalid. [eva] Done for function sigaddset [eva] computing for function sigprocmask <- main. Called from tests/libc/signal_h.c:29. [eva] using specification for function sigprocmask [eva] tests/libc/signal_h.c:29: function sigprocmask: precondition 'valid_set_or_null' got status valid. [eva] tests/libc/signal_h.c:29: function sigprocmask: precondition 'valid_how' got status valid. [eva] tests/libc/signal_h.c:29: function sigprocmask: precondition 'valid_oldset_or_null' got status valid. [eva] tests/libc/signal_h.c:29: function sigprocmask: precondition 'separation' got status valid. [eva] Done for function sigprocmask [eva] computing for function sigaddset <- main. Called from tests/libc/signal_h.c:32. [eva] tests/libc/signal_h.c:32: function sigaddset: precondition 'valid_set' got status valid. [eva] tests/libc/signal_h.c:32: function sigaddset: precondition 'initialization,set' got status valid. [eva] Done for function sigaddset [eva] computing for function sigprocmask <- main. Called from tests/libc/signal_h.c:35. [eva] tests/libc/signal_h.c:35: function sigprocmask: precondition 'valid_set_or_null' got status valid. [eva] tests/libc/signal_h.c:35: function sigprocmask: precondition 'valid_how' got status valid. [eva] tests/libc/signal_h.c:35: function sigprocmask: precondition 'valid_oldset_or_null' got status valid. [eva] tests/libc/signal_h.c:35: function sigprocmask: precondition 'separation' got status valid. [eva:invalid-assigns] tests/libc/signal_h.c:35: Completely invalid destination for assigns clause *oldset. Ignoring. [eva] Done for function sigprocmask [eva] computing for function sigprocmask <- main. Called from tests/libc/signal_h.c:38. [eva] tests/libc/signal_h.c:38: function sigprocmask: precondition 'valid_set_or_null' got status valid. [eva] tests/libc/signal_h.c:38: function sigprocmask: precondition 'valid_how' got status valid. [eva] tests/libc/signal_h.c:38: function sigprocmask: precondition 'valid_oldset_or_null' got status valid. [eva] tests/libc/signal_h.c:38: function sigprocmask: precondition 'separation' got status valid. [eva] Done for function sigprocmask [eva] computing for function kill <- main. Called from tests/libc/signal_h.c:42. [eva] using specification for function kill [eva] Done for function kill [eva] computing for function sigaction <- main. Called from tests/libc/signal_h.c:45. [eva] using specification for function sigaction [eva] tests/libc/signal_h.c:45: function sigaction: precondition 'valid_signal' got status valid. [eva] tests/libc/signal_h.c:45: function sigaction: precondition 'valid_oldact_or_null' got status valid. [eva] tests/libc/signal_h.c:45: function sigaction: precondition 'valid_read_act_or_null' got status valid. [eva] tests/libc/signal_h.c:45: function sigaction: precondition 'separation,separated_acts' got status valid. [eva] Done for function sigaction [eva] computing for function sigaction <- main. Called from tests/libc/signal_h.c:45. [eva] Done for function sigaction [eva] computing for function sigaction <- main. Called from tests/libc/signal_h.c:48. [eva] tests/libc/signal_h.c:48: function sigaction: precondition 'valid_signal' got status valid. [eva] tests/libc/signal_h.c:48: function sigaction: precondition 'valid_oldact_or_null' got status valid. [eva] tests/libc/signal_h.c:48: function sigaction: precondition 'valid_read_act_or_null' got status valid. [eva] tests/libc/signal_h.c:48: function sigaction: precondition 'separation,separated_acts' got status valid. [eva] share/libc/signal.h:212: cannot evaluate ACSL term, unsupported ACSL construct: logic coercion struct sigaction -> set [eva] Done for function sigaction [eva] computing for function sigaction <- main. Called from tests/libc/signal_h.c:51. [eva] tests/libc/signal_h.c:51: function sigaction: precondition 'valid_signal' got status valid. [eva] tests/libc/signal_h.c:51: function sigaction: precondition 'valid_oldact_or_null' got status valid. [eva] tests/libc/signal_h.c:51: function sigaction: precondition 'valid_read_act_or_null' got status valid. [eva] tests/libc/signal_h.c:51: function sigaction: precondition 'separation,separated_acts' got status valid. [eva:invalid-assigns] tests/libc/signal_h.c:51: Completely invalid destination for assigns clause *oldact. Ignoring. [eva] Done for function sigaction [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_sigaction[0]{.sa_handler; .sa_sigaction} ∈ {0} [0]{.sa_mask; .sa_flags} ∈ [--..--] [1]{.sa_handler; .sa_sigaction} ∈ {0} [1]{.sa_mask; .sa_flags} ∈ [--..--] [2]{.sa_handler; .sa_sigaction} ∈ {0} [2]{.sa_mask; .sa_flags} ∈ [--..--] [3]{.sa_handler; .sa_sigaction} ∈ {0} [3]{.sa_mask; .sa_flags} ∈ [--..--] [4]{.sa_handler; .sa_sigaction} ∈ {0} [4]{.sa_mask; .sa_flags} ∈ [--..--] [5]{.sa_handler; .sa_sigaction} ∈ {0} [5]{.sa_mask; .sa_flags} ∈ [--..--] [6]{.sa_handler; .sa_sigaction} ∈ {0} [6]{.sa_mask; .sa_flags} ∈ [--..--] [7]{.sa_handler; .sa_sigaction} ∈ {0} [7]{.sa_mask; .sa_flags} ∈ [--..--] [8]{.sa_handler; .sa_sigaction} ∈ {0} [8]{.sa_mask; .sa_flags} ∈ [--..--] [9]{.sa_handler; .sa_sigaction} ∈ {0} [9]{.sa_mask; .sa_flags} ∈ [--..--] [10] ∈ {{ garbled mix of &{__fc_sigaction} (origin: Library function) }} [11]{.sa_handler; .sa_sigaction} ∈ {0} [11]{.sa_mask; .sa_flags} ∈ [--..--] [12]{.sa_handler; .sa_sigaction} ∈ {0} [12]{.sa_mask; .sa_flags} ∈ [--..--] [13]{.sa_handler; .sa_sigaction} ∈ {0} [13]{.sa_mask; .sa_flags} ∈ [--..--] [14]{.sa_handler; .sa_sigaction} ∈ {0} [14]{.sa_mask; .sa_flags} ∈ [--..--] [15]{.sa_handler; .sa_sigaction} ∈ {0} [15]{.sa_mask; .sa_flags} ∈ [--..--] [16]{.sa_handler; .sa_sigaction} ∈ {0} {[16]{.sa_mask; .sa_flags}; [17]} ∈ [--..--] [18] ∈ {{ garbled mix of &{__fc_sigaction} (origin: Library function) }} [19]{.sa_handler; .sa_sigaction} ∈ {0} [19]{.sa_mask; .sa_flags} ∈ [--..--] [20]{.sa_handler; .sa_sigaction} ∈ {0} [20]{.sa_mask; .sa_flags} ∈ [--..--] [21]{.sa_handler; .sa_sigaction} ∈ {0} [21]{.sa_mask; .sa_flags} ∈ [--..--] [22]{.sa_handler; .sa_sigaction} ∈ {0} [22]{.sa_mask; .sa_flags} ∈ [--..--] [23]{.sa_handler; .sa_sigaction} ∈ {0} [23]{.sa_mask; .sa_flags} ∈ [--..--] [24]{.sa_handler; .sa_sigaction} ∈ {0} [24]{.sa_mask; .sa_flags} ∈ [--..--] [25]{.sa_handler; .sa_sigaction} ∈ {0} [25]{.sa_mask; .sa_flags} ∈ [--..--] [26]{.sa_handler; .sa_sigaction} ∈ {0} [26]{.sa_mask; .sa_flags} ∈ [--..--] [27]{.sa_handler; .sa_sigaction} ∈ {0} [27]{.sa_mask; .sa_flags} ∈ [--..--] [28]{.sa_handler; .sa_sigaction} ∈ {0} [28]{.sa_mask; .sa_flags} ∈ [--..--] [29]{.sa_handler; .sa_sigaction} ∈ {0} [29]{.sa_mask; .sa_flags} ∈ [--..--] [30]{.sa_handler; .sa_sigaction} ∈ {0} [30]{.sa_mask; .sa_flags} ∈ [--..--] [31]{.sa_handler; .sa_sigaction} ∈ {0} [31]{.sa_mask; .sa_flags} ∈ [--..--] [32]{.sa_handler; .sa_sigaction} ∈ {0} [32]{.sa_mask; .sa_flags} ∈ [--..--] [33]{.sa_handler; .sa_sigaction} ∈ {0} [33]{.sa_mask; .sa_flags} ∈ [--..--] [34]{.sa_handler; .sa_sigaction} ∈ {0} [34]{.sa_mask; .sa_flags} ∈ [--..--] [35]{.sa_handler; .sa_sigaction} ∈ {0} [35]{.sa_mask; .sa_flags} ∈ [--..--] [36]{.sa_handler; .sa_sigaction} ∈ {0} [36]{.sa_mask; .sa_flags} ∈ [--..--] [37]{.sa_handler; .sa_sigaction} ∈ {0} [37]{.sa_mask; .sa_flags} ∈ [--..--] [38]{.sa_handler; .sa_sigaction} ∈ {0} [38]{.sa_mask; .sa_flags} ∈ [--..--] [39]{.sa_handler; .sa_sigaction} ∈ {0} [39]{.sa_mask; .sa_flags} ∈ [--..--] [40]{.sa_handler; .sa_sigaction} ∈ {0} [40]{.sa_mask; .sa_flags} ∈ [--..--] [41]{.sa_handler; .sa_sigaction} ∈ {0} [41]{.sa_mask; .sa_flags} ∈ [--..--] [42]{.sa_handler; .sa_sigaction} ∈ {0} [42]{.sa_mask; .sa_flags} ∈ [--..--] [43]{.sa_handler; .sa_sigaction} ∈ {0} [43]{.sa_mask; .sa_flags} ∈ [--..--] [44]{.sa_handler; .sa_sigaction} ∈ {0} [44]{.sa_mask; .sa_flags} ∈ [--..--] [45]{.sa_handler; .sa_sigaction} ∈ {0} [45]{.sa_mask; .sa_flags} ∈ [--..--] [46]{.sa_handler; .sa_sigaction} ∈ {0} [46]{.sa_mask; .sa_flags} ∈ [--..--] [47]{.sa_handler; .sa_sigaction} ∈ {0} [47]{.sa_mask; .sa_flags} ∈ [--..--] [48]{.sa_handler; .sa_sigaction} ∈ {0} [48]{.sa_mask; .sa_flags} ∈ [--..--] [49]{.sa_handler; .sa_sigaction} ∈ {0} [49]{.sa_mask; .sa_flags} ∈ [--..--] [50]{.sa_handler; .sa_sigaction} ∈ {0} [50]{.sa_mask; .sa_flags} ∈ [--..--] [51]{.sa_handler; .sa_sigaction} ∈ {0} [51]{.sa_mask; .sa_flags} ∈ [--..--] [52]{.sa_handler; .sa_sigaction} ∈ {0} [52]{.sa_mask; .sa_flags} ∈ [--..--] [53]{.sa_handler; .sa_sigaction} ∈ {0} [53]{.sa_mask; .sa_flags} ∈ [--..--] [54]{.sa_handler; .sa_sigaction} ∈ {0} [54]{.sa_mask; .sa_flags} ∈ [--..--] [55]{.sa_handler; .sa_sigaction} ∈ {0} [55]{.sa_mask; .sa_flags} ∈ [--..--] [56]{.sa_handler; .sa_sigaction} ∈ {0} [56]{.sa_mask; .sa_flags} ∈ [--..--] [57]{.sa_handler; .sa_sigaction} ∈ {0} [57]{.sa_mask; .sa_flags} ∈ [--..--] [58]{.sa_handler; .sa_sigaction} ∈ {0} [58]{.sa_mask; .sa_flags} ∈ [--..--] [59]{.sa_handler; .sa_sigaction} ∈ {0} [59]{.sa_mask; .sa_flags} ∈ [--..--] [60]{.sa_handler; .sa_sigaction} ∈ {0} [60]{.sa_mask; .sa_flags} ∈ [--..--] [61]{.sa_handler; .sa_sigaction} ∈ {0} [61]{.sa_mask; .sa_flags} ∈ [--..--] [62]{.sa_handler; .sa_sigaction} ∈ {0} [62]{.sa_mask; .sa_flags} ∈ [--..--] [63]{.sa_handler; .sa_sigaction} ∈ {0} [63]{.sa_mask; .sa_flags} ∈ [--..--] [64]{.sa_handler; .sa_sigaction} ∈ {0} [64]{.sa_mask; .sa_flags} ∈ [--..--] s ∈ [--..--] uninit ∈ UNINITIALIZED old ∈ [--..--] or UNINITIALIZED kill_res ∈ {-1; 0} sa1 ∈ {{ garbled mix of &{__fc_sigaction} (origin: Library function) }} or UNINITIALIZED sa2 ∈ {{ garbled mix of &{__fc_sigaction} (origin: Library function {tests/libc/signal_h.c:48}) }} or UNINITIALIZED __retres ∈ {-1; 0; 1; 2; 3} frama-c-20.0-Calcium/tests/libc/oracle/socket.0.res.oracle0000666000000000000000000003172713571573400020152 0ustar [kernel] Parsing tests/libc/socket.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization sent_msg ∈ {{ "World" }} rcv_buffer[0..9] ∈ {0} socket_fd[0..1] ∈ {0} nondet ∈ [--..--] [eva] computing for function init_sockets <- main. Called from tests/libc/socket.c:125. [eva] computing for function socketpair <- init_sockets <- main. Called from tests/libc/socket.c:50. [eva] using specification for function socketpair [eva] tests/libc/socket.c:50: function socketpair: precondition 'valid_socket_sector' got status valid. [eva] Done for function socketpair [eva] computing for function fprintf_va_1 <- init_sockets <- main. Called from tests/libc/socket.c:52. [eva] using specification for function fprintf_va_1 [eva] tests/libc/socket.c:52: function fprintf_va_1: precondition got status valid. [eva] Done for function fprintf_va_1 [eva] computing for function exit <- init_sockets <- main. Called from tests/libc/socket.c:53. [eva] using specification for function exit [eva] Done for function exit [eva] tests/libc/socket.c:55: assertion got status valid. [eva] Recording results for init_sockets [eva] Done for function init_sockets [eva] computing for function test_read <- main. Called from tests/libc/socket.c:126. [eva] computing for function init_reception <- test_read <- main. Called from tests/libc/socket.c:60. [eva] computing for function bzero <- init_reception <- test_read <- main. Called from tests/libc/socket.c:43. [eva] using specification for function bzero [eva] tests/libc/socket.c:43: function bzero: precondition 'valid_memory_area' got status valid. [eva] Done for function bzero [eva] computing for function write <- init_reception <- test_read <- main. Called from tests/libc/socket.c:44. [eva] using specification for function write [eva] tests/libc/socket.c:44: function write: precondition 'valid_fd' got status valid. [eva] tests/libc/socket.c:44: function write: precondition 'buf_has_room' got status valid. [eva] Done for function write [eva] Recording results for init_reception [eva] Done for function init_reception [eva] computing for function read <- test_read <- main. Called from tests/libc/socket.c:61. [eva] using specification for function read [eva] tests/libc/socket.c:61: function read: precondition 'valid_fd' got status valid. [eva] tests/libc/socket.c:61: function read: precondition 'buf_has_room' got status valid. [eva] Done for function read [eva] computing for function printf_va_1 <- test_read <- main. Called from tests/libc/socket.c:62. [eva] using specification for function printf_va_1 [eva] tests/libc/socket.c:62: function printf_va_1: precondition valid_read_string(format) got status valid. [eva:alarm] tests/libc/socket.c:62: Warning: function printf_va_1: precondition valid_read_string(param0) got status unknown. [eva] Done for function printf_va_1 [eva] Recording results for test_read [eva] Done for function test_read [eva] computing for function test_readv <- main. Called from tests/libc/socket.c:127. [eva] computing for function init_reception <- test_readv <- main. Called from tests/libc/socket.c:68. [eva] computing for function bzero <- init_reception <- test_readv <- main. Called from tests/libc/socket.c:43. [eva] Done for function bzero [eva] computing for function write <- init_reception <- test_readv <- main. Called from tests/libc/socket.c:44. [eva] Done for function write [eva] Recording results for init_reception [eva] Done for function init_reception [eva] computing for function readv <- test_readv <- main. Called from tests/libc/socket.c:69. [eva] using specification for function readv [eva] tests/libc/socket.c:69: function readv: precondition 'valid_read_iov' got status valid. [eva] share/libc/sys/uio.h:37: Warning: no \from part for clause 'assigns *((char *)(iov + (0 .. iovcnt - 1))->iov_base + (0 ..));' [eva] Done for function readv [eva:alarm] tests/libc/socket.c:72: Warning: accessing uninitialized left-value. assert \initialized((char *)rcv_buffer_scattered1); [eva] computing for function printf_va_2 <- test_readv <- main. Called from tests/libc/socket.c:75. [eva] using specification for function printf_va_2 [eva] tests/libc/socket.c:75: function printf_va_2: precondition valid_read_string(format) got status valid. [eva:alarm] tests/libc/socket.c:75: Warning: function printf_va_2: precondition valid_read_nstring(param1, 3) got status unknown. [eva:alarm] tests/libc/socket.c:75: Warning: function printf_va_2: precondition valid_read_nstring(param0, 2) got status unknown. [eva] Done for function printf_va_2 [eva] Recording results for test_readv [eva] Done for function test_readv [eva] computing for function test_recvmsg <- main. Called from tests/libc/socket.c:128. [eva] tests/libc/socket.c:82: Reusing old results for call to init_reception [eva] computing for function recvmsg <- test_recvmsg <- main. Called from tests/libc/socket.c:90. [eva] using specification for function recvmsg [eva] tests/libc/socket.c:90: function recvmsg: precondition 'valid_sockfd' got status valid. [eva] tests/libc/socket.c:90: function recvmsg: precondition 'msg_control_has_room' got status valid. [eva] tests/libc/socket.c:90: function recvmsg: precondition 'msg_iov_has_room' got status valid. [eva] tests/libc/socket.c:90: function recvmsg: precondition 'msg_name_null_or_has_room' got status valid. [eva] Done for function recvmsg [eva:alarm] tests/libc/socket.c:92: Warning: accessing uninitialized left-value. assert \initialized((char *)rcv_buffer_scattered1); [eva] computing for function printf_va_3 <- test_recvmsg <- main. Called from tests/libc/socket.c:95. [eva] using specification for function printf_va_3 [eva] tests/libc/socket.c:95: function printf_va_3: precondition valid_read_string(format) got status valid. [eva:alarm] tests/libc/socket.c:95: Warning: function printf_va_3: precondition valid_read_nstring(param1, 3) got status unknown. [eva:alarm] tests/libc/socket.c:95: Warning: function printf_va_3: precondition valid_read_nstring(param0, 2) got status unknown. [eva] Done for function printf_va_3 [eva] Recording results for test_recvmsg [eva] Done for function test_recvmsg [eva] computing for function test_server_echo <- main. Called from tests/libc/socket.c:129. [eva] computing for function socket <- test_server_echo <- main. Called from tests/libc/socket.c:100. [eva] using specification for function socket [eva] Done for function socket [eva] computing for function memset <- test_server_echo <- main. Called from tests/libc/socket.c:103. [eva] using specification for function memset [eva] tests/libc/socket.c:103: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] Done for function memset [eva] computing for function bind <- test_server_echo <- main. Called from tests/libc/socket.c:107. [eva] using specification for function bind [eva] tests/libc/socket.c:107: function bind: precondition 'valid_sockfd,sockfd' got status valid. [eva] tests/libc/socket.c:107: function bind: precondition 'valid_read_addr' got status valid. [eva] Done for function bind [eva] computing for function listen <- test_server_echo <- main. Called from tests/libc/socket.c:108. [eva] using specification for function listen [eva] tests/libc/socket.c:108: function listen: precondition 'valid_sockfd' got status valid. [eva] Done for function listen [eva] computing for function accept <- test_server_echo <- main. Called from tests/libc/socket.c:111. [eva] using specification for function accept [eva] tests/libc/socket.c:111: function accept: precondition 'valid_sockfd' got status valid. [eva] tests/libc/socket.c:111: function accept, behavior addr_null: assumes got status invalid; behavior not evaluated. [eva] tests/libc/socket.c:111: function accept, behavior addr_not_null: precondition 'valid_addrlen' got status valid. [eva] tests/libc/socket.c:111: function accept, behavior addr_not_null: precondition 'addr_has_room' got status valid. [eva] Done for function accept [eva] computing for function accept <- test_server_echo <- main. Called from tests/libc/socket.c:112. [eva] tests/libc/socket.c:112: function accept: precondition 'valid_sockfd' got status valid. [eva] tests/libc/socket.c:112: function accept, behavior addr_not_null: assumes got status invalid; behavior not evaluated. [eva] tests/libc/socket.c:112: function accept, behavior addr_null: precondition 'addrlen_should_be_null' got status valid. [eva] Done for function accept [eva] computing for function read <- test_server_echo <- main. Called from tests/libc/socket.c:115. [eva] tests/libc/socket.c:115: function read: precondition 'valid_fd' got status valid. [eva] tests/libc/socket.c:115: function read: precondition 'buf_has_room' got status valid. [eva] Done for function read [eva] computing for function write <- test_server_echo <- main. Called from tests/libc/socket.c:117. [eva] tests/libc/socket.c:117: function write: precondition 'valid_fd' got status valid. [eva] tests/libc/socket.c:117: function write: precondition 'buf_has_room' got status valid. [eva] Done for function write [eva] computing for function close <- test_server_echo <- main. Called from tests/libc/socket.c:118. [eva] using specification for function close [eva] tests/libc/socket.c:118: function close: precondition 'valid_fd' got status valid. [eva] Done for function close [eva] computing for function close <- test_server_echo <- main. Called from tests/libc/socket.c:119. [eva] tests/libc/socket.c:119: function close: precondition 'valid_fd' got status valid. [eva] Done for function close [eva] Recording results for test_server_echo [eva] Done for function test_server_echo [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function init_sockets: __fc_socket_counter ∈ [--..--] socket_fd[0..1] ∈ [0..1023] S___fc_stderr[0..1] ∈ [--..--] [eva:final-states] Values at end of function init_reception: __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ {0} [eva:final-states] Values at end of function test_read: __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ [--..--] S___fc_stdout[0..1] ∈ [--..--] [eva:final-states] Values at end of function test_readv: __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ {0} rcv_buffer_scattered1[0] ∈ [--..--] [1] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered2[0..4] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered3[0..2] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered_iovec[0].iov_base ∈ {{ (void *)&rcv_buffer_scattered1 }} [0].iov_len ∈ {2} [1].iov_base ∈ {{ (void *)&rcv_buffer_scattered2 }} [1].iov_len ∈ {5} [2].iov_base ∈ {{ (void *)&rcv_buffer_scattered3 }} [2].iov_len ∈ {3} S___fc_stdout[0..1] ∈ [--..--] [eva:final-states] Values at end of function test_recvmsg: __fc_sockfds[0..1023] ∈ [--..--] __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ {0} rcv_buffer_scattered1[0] ∈ [--..--] [1] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered2[0..4] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered3[0..2] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered_iovec[0].iov_base ∈ {{ (void *)&rcv_buffer_scattered1 }} [0].iov_len ∈ {2} [1].iov_base ∈ {{ (void *)&rcv_buffer_scattered2 }} [1].iov_len ∈ {5} [2].iov_base ∈ {{ (void *)&rcv_buffer_scattered3 }} [2].iov_len ∈ {3} hdr.msg_name ∈ {0} .msg_namelen ∈ [--..--] .msg_iov ∈ {{ &rcv_buffer_scattered_iovec[0] }} .msg_iovlen ∈ {3} .msg_control ∈ {0} .msg_controllen ∈ [--..--] .msg_flags ∈ [--..--] or UNINITIALIZED S___fc_stdout[0..1] ∈ [--..--] [eva:final-states] Values at end of function test_server_echo: __fc_sockfds[0..1023] ∈ [--..--] __fc_socket_counter ∈ [--..--] __fc_fds[0..1023] ∈ [--..--] fd ∈ [-1..1023] addr ∈ [--..--] or UNINITIALIZED addrlen ∈ {8} client_fd ∈ [-1..1023] buf[0..63] ∈ [--..--] or UNINITIALIZED r ∈ [-1..64] __retres ∈ {0; 1; 5; 20; 100; 200; 300; 400} [eva:final-states] Values at end of function main: __fc_sockfds[0..1023] ∈ [--..--] __fc_socket_counter ∈ [--..--] __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ {0} socket_fd[0..1] ∈ [0..1023] r ∈ {0; 1; 5; 20; 100; 200; 300; 400} __retres ∈ {0} S___fc_stderr[0..1] ∈ [--..--] S___fc_stdout[0..1] ∈ [--..--] frama-c-20.0-Calcium/tests/libc/oracle/socket.1.res.oracle0000666000000000000000000003205213571573400020143 0ustar [kernel] Parsing tests/libc/socket.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization sent_msg ∈ {{ "World" }} rcv_buffer[0..9] ∈ {0} socket_fd[0..1] ∈ {0} nondet ∈ [--..--] [eva] computing for function init_sockets <- main. Called from tests/libc/socket.c:125. [eva] computing for function socketpair <- init_sockets <- main. Called from tests/libc/socket.c:50. [eva] using specification for function socketpair [eva] tests/libc/socket.c:50: function socketpair: precondition 'valid_socket_sector' got status valid. [eva] Done for function socketpair [eva] computing for function fprintf_va_1 <- init_sockets <- main. Called from tests/libc/socket.c:52. [eva] using specification for function fprintf_va_1 [eva] tests/libc/socket.c:52: function fprintf_va_1: precondition got status valid. [eva] Done for function fprintf_va_1 [eva] computing for function exit <- init_sockets <- main. Called from tests/libc/socket.c:53. [eva] using specification for function exit [eva] Done for function exit [eva] tests/libc/socket.c:55: assertion got status valid. [eva] Recording results for init_sockets [eva] Done for function init_sockets [eva] computing for function test_read <- main. Called from tests/libc/socket.c:126. [eva] computing for function init_reception <- test_read <- main. Called from tests/libc/socket.c:60. [eva] computing for function bzero <- init_reception <- test_read <- main. Called from tests/libc/socket.c:43. [eva] using specification for function bzero [eva] tests/libc/socket.c:43: function bzero: precondition 'valid_memory_area' got status valid. [eva] Done for function bzero [eva] computing for function write <- init_reception <- test_read <- main. Called from tests/libc/socket.c:44. [eva] using specification for function write [eva] tests/libc/socket.c:44: function write: precondition 'valid_fd' got status valid. [eva] tests/libc/socket.c:44: function write: precondition 'buf_has_room' got status valid. [eva] Done for function write [eva] Recording results for init_reception [eva] Done for function init_reception [eva] computing for function read <- test_read <- main. Called from tests/libc/socket.c:61. [eva] using specification for function read [eva] tests/libc/socket.c:61: function read: precondition 'valid_fd' got status valid. [eva] tests/libc/socket.c:61: function read: precondition 'buf_has_room' got status valid. [eva] Done for function read [eva] computing for function printf_va_1 <- test_read <- main. Called from tests/libc/socket.c:62. [eva] using specification for function printf_va_1 [eva] tests/libc/socket.c:62: function printf_va_1: precondition valid_read_string(format) got status valid. [eva:alarm] tests/libc/socket.c:62: Warning: function printf_va_1: precondition valid_read_string(param0) got status unknown. [eva] Done for function printf_va_1 [eva] Recording results for test_read [eva] Done for function test_read [eva] computing for function test_readv <- main. Called from tests/libc/socket.c:127. [eva] computing for function init_reception <- test_readv <- main. Called from tests/libc/socket.c:68. [eva] computing for function bzero <- init_reception <- test_readv <- main. Called from tests/libc/socket.c:43. [eva] Done for function bzero [eva] computing for function write <- init_reception <- test_readv <- main. Called from tests/libc/socket.c:44. [eva] Done for function write [eva] Recording results for init_reception [eva] Done for function init_reception [eva] computing for function readv <- test_readv <- main. Called from tests/libc/socket.c:69. [eva] using specification for function readv [eva] tests/libc/socket.c:69: function readv: precondition 'valid_read_iov' got status valid. [eva] share/libc/sys/uio.h:37: Warning: no \from part for clause 'assigns *((char *)(iov + (0 .. iovcnt - 1))->iov_base + (0 ..));' [eva] Done for function readv [eva:alarm] tests/libc/socket.c:72: Warning: accessing uninitialized left-value. assert \initialized((char *)rcv_buffer_scattered1); [eva] computing for function printf_va_2 <- test_readv <- main. Called from tests/libc/socket.c:75. [eva] using specification for function printf_va_2 [eva] tests/libc/socket.c:75: function printf_va_2: precondition valid_read_string(format) got status valid. [eva:alarm] tests/libc/socket.c:75: Warning: function printf_va_2: precondition valid_read_nstring(param1, 3) got status unknown. [eva:alarm] tests/libc/socket.c:75: Warning: function printf_va_2: precondition valid_read_nstring(param0, 2) got status unknown. [eva] Done for function printf_va_2 [eva] Recording results for test_readv [eva] Done for function test_readv [eva] computing for function test_recvmsg <- main. Called from tests/libc/socket.c:128. [eva] tests/libc/socket.c:82: Reusing old results for call to init_reception [eva] computing for function recvmsg <- test_recvmsg <- main. Called from tests/libc/socket.c:90. [eva] using specification for function recvmsg [eva] tests/libc/socket.c:90: function recvmsg: precondition 'valid_sockfd' got status valid. [eva] tests/libc/socket.c:90: function recvmsg: precondition 'msg_control_has_room' got status valid. [eva] tests/libc/socket.c:90: function recvmsg: precondition 'msg_iov_has_room' got status valid. [eva] tests/libc/socket.c:90: function recvmsg: precondition 'msg_name_null_or_has_room' got status valid. [eva] Done for function recvmsg [eva:alarm] tests/libc/socket.c:92: Warning: accessing uninitialized left-value. assert \initialized((char *)rcv_buffer_scattered1); [eva] computing for function printf_va_3 <- test_recvmsg <- main. Called from tests/libc/socket.c:95. [eva] using specification for function printf_va_3 [eva] tests/libc/socket.c:95: function printf_va_3: precondition valid_read_string(format) got status valid. [eva:alarm] tests/libc/socket.c:95: Warning: function printf_va_3: precondition valid_read_nstring(param1, 3) got status unknown. [eva:alarm] tests/libc/socket.c:95: Warning: function printf_va_3: precondition valid_read_nstring(param0, 2) got status unknown. [eva] Done for function printf_va_3 [eva] Recording results for test_recvmsg [eva] Done for function test_recvmsg [eva] computing for function test_server_echo <- main. Called from tests/libc/socket.c:129. [eva] computing for function socket <- test_server_echo <- main. Called from tests/libc/socket.c:100. [eva] using specification for function socket [eva] Done for function socket [eva] computing for function memset <- test_server_echo <- main. Called from tests/libc/socket.c:103. [eva] using specification for function memset [eva] tests/libc/socket.c:103: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] Done for function memset [eva] computing for function bind <- test_server_echo <- main. Called from tests/libc/socket.c:107. [eva] using specification for function bind [eva] tests/libc/socket.c:107: function bind: precondition 'valid_sockfd,sockfd' got status valid. [eva] tests/libc/socket.c:107: function bind: precondition 'valid_read_addr' got status valid. [eva] Done for function bind [eva] computing for function listen <- test_server_echo <- main. Called from tests/libc/socket.c:108. [eva] using specification for function listen [eva] tests/libc/socket.c:108: function listen: precondition 'valid_sockfd' got status valid. [eva] Done for function listen [eva] computing for function accept <- test_server_echo <- main. Called from tests/libc/socket.c:111. [eva] using specification for function accept [eva] tests/libc/socket.c:111: function accept: precondition 'valid_sockfd' got status valid. [eva] tests/libc/socket.c:111: function accept, behavior addr_null: assumes got status invalid; behavior not evaluated. [eva] tests/libc/socket.c:111: function accept, behavior addr_not_null: precondition 'valid_addrlen' got status valid. [eva] tests/libc/socket.c:111: function accept, behavior addr_not_null: precondition 'addr_has_room' got status valid. [eva] Done for function accept [eva] computing for function accept <- test_server_echo <- main. Called from tests/libc/socket.c:112. [eva] tests/libc/socket.c:112: function accept: precondition 'valid_sockfd' got status valid. [eva] tests/libc/socket.c:112: function accept, behavior addr_not_null: assumes got status invalid; behavior not evaluated. [eva] tests/libc/socket.c:112: function accept, behavior addr_null: precondition 'addrlen_should_be_null' got status valid. [eva] Done for function accept [eva] computing for function read <- test_server_echo <- main. Called from tests/libc/socket.c:115. [eva] tests/libc/socket.c:115: function read: precondition 'valid_fd' got status valid. [eva] tests/libc/socket.c:115: function read: precondition 'buf_has_room' got status valid. [eva] Done for function read [eva] computing for function write <- test_server_echo <- main. Called from tests/libc/socket.c:117. [eva] tests/libc/socket.c:117: function write: precondition 'valid_fd' got status valid. [eva] tests/libc/socket.c:117: function write: precondition 'buf_has_room' got status valid. [eva] Done for function write [eva] computing for function close <- test_server_echo <- main. Called from tests/libc/socket.c:118. [eva] using specification for function close [eva] tests/libc/socket.c:118: function close: precondition 'valid_fd' got status valid. [eva] Done for function close [eva] computing for function close <- test_server_echo <- main. Called from tests/libc/socket.c:119. [eva] tests/libc/socket.c:119: function close: precondition 'valid_fd' got status valid. [eva] Done for function close [eva] Recording results for test_server_echo [eva] Done for function test_server_echo [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function init_sockets: __fc_socket_counter ∈ [--..--] socket_fd[0..1] ∈ [0..1023] S___fc_stderr[0..1] ∈ [--..--] [eva:final-states] Values at end of function init_reception: __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ {0} [eva:final-states] Values at end of function test_read: __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ [--..--] S___fc_stdout[0..1] ∈ [--..--] [eva:final-states] Values at end of function test_readv: __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ {0} rcv_buffer_scattered1[0] ∈ [--..--] [1] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered2[0..4] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered3[0..2] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered_iovec[0].iov_base ∈ {{ (void *)&rcv_buffer_scattered1 }} [0].iov_len ∈ {2} [1].iov_base ∈ {{ (void *)&rcv_buffer_scattered2 }} [1].iov_len ∈ {5} [2].iov_base ∈ {{ (void *)&rcv_buffer_scattered3 }} [2].iov_len ∈ {3} S___fc_stdout[0..1] ∈ [--..--] [eva:final-states] Values at end of function test_recvmsg: __fc_sockfds[0..1023] ∈ [--..--] __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ {0} rcv_buffer_scattered1[0] ∈ [--..--] [1] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered2[0..4] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered3[0..2] ∈ [--..--] or UNINITIALIZED rcv_buffer_scattered_iovec[0].iov_base ∈ {{ (void *)&rcv_buffer_scattered1 }} [0].iov_len ∈ {2} [1].iov_base ∈ {{ (void *)&rcv_buffer_scattered2 }} [1].iov_len ∈ {5} [2].iov_base ∈ {{ (void *)&rcv_buffer_scattered3 }} [2].iov_len ∈ {3} hdr.msg_name ∈ {0} .msg_namelen ∈ [--..--] .[bits 96 to 127] ∈ UNINITIALIZED .msg_iov ∈ {{ &rcv_buffer_scattered_iovec[0] }} .msg_iovlen ∈ {3} .[bits 224 to 255] ∈ UNINITIALIZED .msg_control ∈ {0} .msg_controllen ∈ [--..--] .msg_flags ∈ [--..--] or UNINITIALIZED S___fc_stdout[0..1] ∈ [--..--] [eva:final-states] Values at end of function test_server_echo: __fc_sockfds[0..1023] ∈ [--..--] __fc_socket_counter ∈ [--..--] __fc_fds[0..1023] ∈ [--..--] fd ∈ [-1..1023] addr ∈ [--..--] or UNINITIALIZED addrlen ∈ {8} client_fd ∈ [-1..1023] buf[0..63] ∈ [--..--] or UNINITIALIZED r ∈ [-1..64] __retres ∈ {0; 1; 5; 20; 100; 200; 300; 400} [eva:final-states] Values at end of function main: __fc_sockfds[0..1023] ∈ [--..--] __fc_socket_counter ∈ [--..--] __fc_fds[0..1023] ∈ [--..--] rcv_buffer[0..9] ∈ {0} socket_fd[0..1] ∈ [0..1023] r ∈ {0; 1; 5; 20; 100; 200; 300; 400} __retres ∈ {0} S___fc_stderr[0..1] ∈ [--..--] S___fc_stdout[0..1] ∈ [--..--] frama-c-20.0-Calcium/tests/libc/oracle/socket_h.res.oracle0000666000000000000000000000502613571573400020314 0ustar [kernel] Parsing tests/libc/socket_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function socket <- main. Called from tests/libc/socket_h.c:7. [eva] using specification for function socket [eva] Done for function socket [eva] computing for function exit <- main. Called from tests/libc/socket_h.c:8. [eva] using specification for function exit [eva] Done for function exit [eva] computing for function inet_addr <- main. Called from tests/libc/socket_h.c:11. [eva] using specification for function inet_addr [eva] tests/libc/socket_h.c:11: function inet_addr: precondition 'valid_arg' got status valid. [eva] Done for function inet_addr [eva] computing for function htons <- main. Called from tests/libc/socket_h.c:12. [eva] using specification for function htons [eva] Done for function htons [eva] computing for function connect <- main. Called from tests/libc/socket_h.c:13. [eva] using specification for function connect [eva] tests/libc/socket_h.c:13: function connect: precondition 'valid_sockfd' got status valid. [eva] tests/libc/socket_h.c:13: function connect: precondition 'valid_read_addr' got status valid. [eva] Done for function connect [eva] computing for function exit <- main. Called from tests/libc/socket_h.c:14. [eva] Done for function exit [eva] computing for function getsockopt <- main. Called from tests/libc/socket_h.c:18. [eva] using specification for function getsockopt [eva] tests/libc/socket_h.c:18: function getsockopt: precondition 'valid_sockfd' got status valid. [eva] tests/libc/socket_h.c:18: function getsockopt: precondition 'valid_optlen' got status valid. [eva] tests/libc/socket_h.c:18: function getsockopt, behavior so_error: precondition 'valid_optlen' got status valid. [eva] tests/libc/socket_h.c:18: function getsockopt, behavior so_error: precondition 'optlen_value' got status valid. [eva] tests/libc/socket_h.c:18: function getsockopt, behavior so_error: precondition 'valid_optval' got status valid. [eva] Done for function getsockopt [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_sockfds[0..1023] ∈ [--..--] __fc_socket_counter ∈ [--..--] sockfd ∈ [0..1023] addr.sin_family ∈ {2} {.sin_port; .sin_addr} ∈ [--..--] rc ∈ {-1; 0} optval ∈ [--..--] or UNINITIALIZED optlen ∈ {4} frama-c-20.0-Calcium/tests/libc/oracle/stdint_h.res.oracle0000666000000000000000000000106013571573400020323 0ustar [kernel] Parsing tests/libc/stdint_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/stdint_h.c:7: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: min ∈ {-9223372036854775808} max ∈ {9223372036854775807} umax ∈ {18446744073709551615} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/stdio_c.res.oracle0000666000000000000000000002720213571573400020141 0ustar [kernel] Parsing tests/libc/stdio_c.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function fopen <- main. Called from tests/libc/stdio_c.c:11. [eva] using specification for function fopen [eva] tests/libc/stdio_c.c:11: function fopen: precondition 'valid_filename' got status valid. [eva] tests/libc/stdio_c.c:11: function fopen: precondition 'valid_mode' got status valid. [eva] Done for function fopen [eva] computing for function getline <- main. Called from tests/libc/stdio_c.c:13. [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:46. [eva] using specification for function ferror [eva] share/libc/stdio.c:46: function ferror: precondition 'valid_stream' got status valid. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:46. [eva] using specification for function feof [eva] share/libc/stdio.c:46: function feof: precondition 'valid_stream' got status valid. [eva] Done for function feof [eva] share/libc/stdio.c:51: Call to builtin malloc [eva] share/libc/stdio.c:51: allocating variable __malloc_getline_l51 [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] share/libc/stdio.c:60: function ferror: precondition 'valid_stream' got status valid. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] share/libc/stdio.c:60: function feof: precondition 'valid_stream' got status valid. [eva] Done for function feof [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] using specification for function fgetc [eva] share/libc/stdio.c:62: function fgetc: precondition 'valid_stream' got status valid. [eva] Done for function fgetc [eva:alarm] share/libc/stdio.c:68: Warning: out of bounds write. assert \valid(*lineptr + tmp_2); (tmp_2 from cur++) [eva] share/libc/stdio.c:61: starting to merge loop iterations [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] share/libc/stdio.c:82: Call to builtin realloc [eva] share/libc/stdio.c:82: function realloc: precondition 'freeable' got status valid. [eva] share/libc/stdio.c:82: allocating variable __realloc_getline_l82 [eva] share/libc/stdio.c:60: starting to merge loop iterations [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] share/libc/stdio.c:82: Call to builtin realloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] share/libc/stdio.c:82: Call to builtin realloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] share/libc/stdio.c:82: Call to builtin realloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] share/libc/stdio.c:82: Call to builtin realloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva:alarm] share/libc/stdio.c:71: Warning: out of bounds write. assert \valid(*lineptr + cur); [eva] Recording results for getline [eva] Done for function getline [eva:alarm] tests/libc/stdio_c.c:14: Warning: assertion 'read_ok' got status unknown. [eva] tests/libc/stdio_c.c:15: Call to builtin strlen [eva:alarm] tests/libc/stdio_c.c:15: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva:alarm] tests/libc/stdio_c.c:16: Warning: assertion 'read_bytes' got status unknown. [eva:alarm] tests/libc/stdio_c.c:17: Warning: assertion 'allocated_enough' got status unknown. [eva] tests/libc/stdio_c.c:13: starting to merge loop iterations [eva] computing for function getline <- main. Called from tests/libc/stdio_c.c:13. [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:46. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:46. [eva] Done for function feof [eva] share/libc/stdio.c:51: Call to builtin malloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] share/libc/stdio.c:82: Call to builtin realloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] Recording results for getline [eva] Done for function getline [eva] tests/libc/stdio_c.c:15: Call to builtin strlen [eva] computing for function getline <- main. Called from tests/libc/stdio_c.c:13. [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:46. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:46. [eva] Done for function feof [eva] share/libc/stdio.c:51: Call to builtin malloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] share/libc/stdio.c:82: Call to builtin realloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] Recording results for getline [eva] Done for function getline [eva] tests/libc/stdio_c.c:15: Call to builtin strlen [eva] computing for function getline <- main. Called from tests/libc/stdio_c.c:13. [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:46. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:46. [eva] Done for function feof [eva] share/libc/stdio.c:51: Call to builtin malloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] computing for function fgetc <- getline <- main. Called from share/libc/stdio.c:62. [eva] Done for function fgetc [eva] share/libc/stdio.c:82: Call to builtin realloc [eva] computing for function ferror <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function ferror [eva] computing for function feof <- getline <- main. Called from share/libc/stdio.c:60. [eva] Done for function feof [eva] Recording results for getline [eva] Done for function getline [eva] tests/libc/stdio_c.c:15: Call to builtin strlen [eva] tests/libc/stdio_c.c:19: Call to builtin free [eva] tests/libc/stdio_c.c:19: function free: precondition 'freeable' got status valid. [eva] computing for function fclose <- main. Called from tests/libc/stdio_c.c:20. [eva] using specification for function fclose [eva] tests/libc/stdio_c.c:20: function fclose: precondition 'valid_stream' got status valid. [eva] Done for function fclose [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function getline: __fc_heap_status ∈ [--..--] __fc_errno ∈ [--..--] __fc_fopen[0..15] ∈ [--..--] cur ∈ [0..2147483647] line ∈ {{ NULL ; &__malloc_w_getline_l51[0] ; &__realloc_w_getline_l82[0] }} len ∈ [0..2147483647] __retres ∈ [-1..2147483646] __malloc_w_getline_l51[0..1] ∈ [--..--] or UNINITIALIZED __realloc_w_getline_l82[0..2147483645] ∈ [--..--] or UNINITIALIZED [2147483646] ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] __fc_errno ∈ [--..--] __fc_fopen[0..15] ∈ [--..--] stream ∈ {{ NULL ; &__fc_fopen + [0..120],0%8 }} line ∈ {{ NULL ; &__malloc_w_getline_l51[0] ; &__realloc_w_getline_l82[0] }} or ESCAPINGADDR len ∈ [0..2147483647] total_len ∈ [--..--] read ∈ {-1} or UNINITIALIZED __retres ∈ {0; 1} __malloc_w_getline_l51[0..1] ∈ [--..--] or UNINITIALIZED __realloc_w_getline_l82[0..2147483645] ∈ [--..--] or UNINITIALIZED [2147483646] ∈ {0} or UNINITIALIZED frama-c-20.0-Calcium/tests/libc/oracle/stdio_h.res.oracle0000666000000000000000000001141213571573400020142 0ustar [kernel] Parsing tests/libc/stdio_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function fopen <- main. Called from tests/libc/stdio_h.c:6. [eva] using specification for function fopen [eva] tests/libc/stdio_h.c:6: function fopen: precondition 'valid_filename' got status valid. [eva] tests/libc/stdio_h.c:6: function fopen: precondition 'valid_mode' got status valid. [eva] Done for function fopen [eva] computing for function fseek <- main. Called from tests/libc/stdio_h.c:8. [eva] using specification for function fseek [eva] tests/libc/stdio_h.c:8: function fseek: precondition 'valid_stream' got status valid. [eva] tests/libc/stdio_h.c:8: function fseek: precondition 'whence_enum' got status valid. [eva] Done for function fseek [eva] computing for function fseek <- main. Called from tests/libc/stdio_h.c:10. [eva:alarm] tests/libc/stdio_h.c:10: Warning: function fseek: precondition 'valid_stream' got status invalid. [eva] tests/libc/stdio_h.c:10: function fseek: no state left, precondition 'whence_enum' got status valid. [eva] Done for function fseek [eva] computing for function Frama_C_interval <- main. Called from tests/libc/stdio_h.c:16. [eva] using specification for function Frama_C_interval [eva] tests/libc/stdio_h.c:16: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function fseek <- main. Called from tests/libc/stdio_h.c:19. [eva] tests/libc/stdio_h.c:19: function fseek: precondition 'valid_stream' got status valid. [eva:alarm] tests/libc/stdio_h.c:19: Warning: function fseek: precondition 'whence_enum' got status invalid. [eva] Done for function fseek [eva] computing for function tmpfile <- main. Called from tests/libc/stdio_h.c:23. [eva] using specification for function tmpfile [eva] Done for function tmpfile [eva] computing for function fseek <- main. Called from tests/libc/stdio_h.c:25. [eva] tests/libc/stdio_h.c:25: function fseek: precondition 'valid_stream' got status valid. [eva] tests/libc/stdio_h.c:25: function fseek: precondition 'whence_enum' got status valid. [eva] Done for function fseek [eva] computing for function fclose <- main. Called from tests/libc/stdio_h.c:26. [eva] using specification for function fclose [eva] tests/libc/stdio_h.c:26: function fclose: precondition 'valid_stream' got status valid. [eva] Done for function fclose [eva] computing for function freopen <- main. Called from tests/libc/stdio_h.c:28. [eva] using specification for function freopen [eva] tests/libc/stdio_h.c:28: function freopen: precondition 'valid_filename' got status valid. [eva] tests/libc/stdio_h.c:28: function freopen: precondition 'valid_mode' got status valid. [eva:alarm] tests/libc/stdio_h.c:28: Warning: function freopen: precondition 'valid_stream' got status unknown. [eva] Done for function freopen [eva] computing for function printf_va_1 <- main. Called from tests/libc/stdio_h.c:30. [eva] using specification for function printf_va_1 [eva] tests/libc/stdio_h.c:30: function printf_va_1: precondition got status valid. [eva] Done for function printf_va_1 [eva] computing for function fclose <- main. Called from tests/libc/stdio_h.c:31. [eva] tests/libc/stdio_h.c:31: function fclose: precondition 'valid_stream' got status valid. [eva] Done for function fclose [eva] computing for function fgets <- main. Called from tests/libc/stdio_h.c:34. [eva] using specification for function fgets [eva] tests/libc/stdio_h.c:34: function fgets: precondition 'valid_stream' got status valid. [eva] tests/libc/stdio_h.c:34: function fgets: precondition 'room_s' got status valid. [eva] Done for function fgets [eva:alarm] tests/libc/stdio_h.c:36: Warning: check got status unknown. [eva] computing for function fgets <- main. Called from tests/libc/stdio_h.c:38. [eva] tests/libc/stdio_h.c:38: function fgets: precondition 'valid_stream' got status valid. [eva:alarm] tests/libc/stdio_h.c:38: Warning: function fgets: precondition 'room_s' got status invalid. [eva] Done for function fgets [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_errno ∈ [--..--] __fc_fopen[0..15] ∈ [--..--] Frama_C_entropy_source ∈ [--..--] f ∈ {{ NULL ; &__fc_fopen + [0..120],0%8 }} r ∈ [--..--] tmp_2 ∈ {{ NULL ; &__fc_fopen + [0..120],0%8 }} redirected ∈ {{ NULL ; &__fc_fopen + [0..120],0%8 }} fgets_buf0[0] ∈ [--..--] or UNINITIALIZED fgets_res ∈ {{ NULL ; &fgets_buf0[0] }} __retres ∈ {0; 1; 2; 3} S___fc_stdout[0..1] ∈ [--..--] frama-c-20.0-Calcium/tests/libc/oracle/stdlib_c.0.res.oracle0000666000000000000000000001376413571573400020446 0ustar [kernel] Parsing tests/libc/stdlib_c.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/stdlib_c.c:14: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:14: allocating variable __calloc_main_l14 [eva] tests/libc/stdlib_c.c:16: assertion got status valid. [eva] computing for function Frama_C_size_t_interval <- main. Called from tests/libc/stdlib_c.c:20. [eva] using specification for function Frama_C_size_t_interval [eva] tests/libc/stdlib_c.c:20: function Frama_C_size_t_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_size_t_interval [eva] computing for function Frama_C_size_t_interval <- main. Called from tests/libc/stdlib_c.c:20. [eva] Done for function Frama_C_size_t_interval [eva] tests/libc/stdlib_c.c:21: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:21: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva] tests/libc/stdlib_c.c:21: allocating variable __calloc_main_l21 [eva] tests/libc/stdlib_c.c:21: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:23: assertion got status valid. [eva] tests/libc/stdlib_c.c:27: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:27: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva] tests/libc/stdlib_c.c:27: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:27: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:27: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:28: assertion got status valid. [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:32: allocating variable __calloc_main_l32 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31) to fit 0..63 [eva:alarm] tests/libc/stdlib_c.c:33: Warning: out of bounds write. assert \valid(s + (unsigned int)(i - 1)); [eva] tests/libc/stdlib_c.c:31: starting to merge loop iterations [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/63) to fit 0..63/95 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/95) to fit 0..63/127 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:32: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/127) to fit 0..63/34359738367 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/34359738367) to fit 0..63/34359738367 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/34359738367) to fit 0..63/34359738367 [eva] computing for function posix_memalign <- main. Called from tests/libc/stdlib_c.c:37. [eva] share/libc/stdlib.c:196: assertion 'alignment_is_a_suitable_power_of_two' got status valid. [eva] share/libc/stdlib.c:199: Call to builtin Frama_C_malloc_by_stack [eva] share/libc/stdlib.c:199: allocating variable __malloc_posix_memalign_l199 [eva] Recording results for posix_memalign [eva] Done for function posix_memalign [eva] computing for function free <- main. Called from tests/libc/stdlib_c.c:38. [eva] using specification for function free [eva] tests/libc/stdlib_c.c:38: Warning: ignoring unsupported \allocates clause [eva] tests/libc/stdlib_c.c:38: function free: precondition 'freeable' got status valid. [eva] Done for function free [eva] computing for function posix_memalign <- main. Called from tests/libc/stdlib_c.c:39. [eva] share/libc/stdlib.c:199: Call to builtin Frama_C_malloc_by_stack [eva] share/libc/stdlib.c:199: allocating variable __malloc_posix_memalign_l199_0 [eva] Recording results for posix_memalign [eva] Done for function posix_memalign [eva] computing for function free <- main. Called from tests/libc/stdlib_c.c:40. [eva] tests/libc/stdlib_c.c:40: Warning: ignoring unsupported \allocates clause [eva] tests/libc/stdlib_c.c:40: function free: precondition 'freeable' got status valid. [eva] Done for function free [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function posix_memalign: __fc_heap_status ∈ [--..--] p_al0 ∈ {{ NULL ; &__malloc_posix_memalign_l199[0] }} p_al1 ∈ {{ NULL ; &__malloc_posix_memalign_l199_0[0] }} or UNINITIALIZED __retres ∈ {0; 12} [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ NULL ; &__calloc_main_l14 }} nmemb ∈ [1..4294967295] q ∈ {{ NULL ; &__calloc_main_l21[0] }} r ∈ {0} s ∈ {{ NULL ; &__calloc_w_main_l32[0] }} p_al0 ∈ {{ NULL ; &__malloc_posix_memalign_l199[0] }} p_al1 ∈ {{ NULL ; &__malloc_posix_memalign_l199_0[0] }} p_memal_res ∈ {0; 12} p_memal_res2 ∈ {0; 12} __retres ∈ {0} __calloc_w_main_l32[0..1073741823] ∈ {0; 42} frama-c-20.0-Calcium/tests/libc/oracle/stdlib_c.1.res.oracle0000666000000000000000000001565513571573400020450 0ustar [kernel] Parsing tests/libc/stdlib_c.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/stdlib_c.c:14: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:14: allocating variable __calloc_main_l14 [eva] tests/libc/stdlib_c.c:16: assertion got status valid. [eva] computing for function Frama_C_size_t_interval <- main. Called from tests/libc/stdlib_c.c:20. [eva] using specification for function Frama_C_size_t_interval [eva] tests/libc/stdlib_c.c:20: function Frama_C_size_t_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_size_t_interval [eva] tests/libc/stdlib_c.c:21: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:21: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva] tests/libc/stdlib_c.c:21: allocating variable __calloc_main_l21 [eva] tests/libc/stdlib_c.c:23: assertion got status valid. [eva] tests/libc/stdlib_c.c:27: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:27: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva] tests/libc/stdlib_c.c:27: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:28: assertion got status valid. [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:32: allocating variable __calloc_main_l32 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31) to fit 0..63 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/63) to fit 0..63 [eva:alarm] tests/libc/stdlib_c.c:33: Warning: out of bounds write. assert \valid(s + (unsigned int)(i - 1)); [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/63) to fit 0..95 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/95) to fit 0..95 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/95) to fit 0..127 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/127) to fit 0..127 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/127) to fit 0..159 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/159) to fit 0..159 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/159) to fit 0..191 [eva] tests/libc/stdlib_c.c:31: starting to merge loop iterations [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/191) to fit 0..191/223 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/223) to fit 0..191/255 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva] tests/libc/stdlib_c.c:32: Warning: calloc out of bounds: assert(nmemb * size <= SIZE_MAX) [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/255) to fit 0..191/34359738367 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/34359738367) to fit 0..191/34359738367 [eva] tests/libc/stdlib_c.c:32: Call to builtin Frama_C_calloc_by_stack for function calloc [eva:malloc] tests/libc/stdlib_c.c:32: resizing variable `__calloc_w_main_l32' (0..31/34359738367) to fit 0..191/34359738367 [eva] computing for function posix_memalign <- main. Called from tests/libc/stdlib_c.c:37. [eva] share/libc/stdlib.c:196: assertion 'alignment_is_a_suitable_power_of_two' got status valid. [eva] share/libc/stdlib.c:199: Call to builtin Frama_C_malloc_by_stack [eva] share/libc/stdlib.c:199: allocating variable __malloc_posix_memalign_l199 [eva] Recording results for posix_memalign [eva] Done for function posix_memalign [eva] computing for function free <- main. Called from tests/libc/stdlib_c.c:38. [eva] using specification for function free [eva] tests/libc/stdlib_c.c:38: Warning: ignoring unsupported \allocates clause [eva] tests/libc/stdlib_c.c:38: function free: precondition 'freeable' got status valid. [eva] Done for function free [eva] computing for function posix_memalign <- main. Called from tests/libc/stdlib_c.c:39. [eva] share/libc/stdlib.c:199: Call to builtin Frama_C_malloc_by_stack [eva] share/libc/stdlib.c:199: allocating variable __malloc_posix_memalign_l199_0 [eva] Recording results for posix_memalign [eva] Done for function posix_memalign [eva] computing for function free <- main. Called from tests/libc/stdlib_c.c:40. [eva] tests/libc/stdlib_c.c:40: Warning: ignoring unsupported \allocates clause [eva] tests/libc/stdlib_c.c:40: function free: precondition 'freeable' got status valid. [eva] Done for function free [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function posix_memalign: __fc_heap_status ∈ [--..--] p_al0 ∈ {{ &__malloc_posix_memalign_l199[0] }} p_al1 ∈ {{ &__malloc_posix_memalign_l199_0[0] }} or UNINITIALIZED __retres ∈ {0} [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ &__calloc_main_l14 }} nmemb ∈ [1..4294967295] q ∈ {{ NULL ; &__calloc_main_l21[0] }} r ∈ {0} s ∈ {{ NULL ; &__calloc_w_main_l32[0] }} p_al0 ∈ {{ &__malloc_posix_memalign_l199[0] }} p_al1 ∈ {{ &__malloc_posix_memalign_l199_0[0] }} p_memal_res ∈ {0} p_memal_res2 ∈ {0} __retres ∈ {0} __calloc_w_main_l32[0..1073741823] ∈ {0; 42} frama-c-20.0-Calcium/tests/libc/oracle/stdlib_c.2.res.oracle0000666000000000000000000001641213571573400020441 0ustar [kernel] Parsing tests/libc/stdlib_c.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function calloc <- main. Called from tests/libc/stdlib_c.c:14. [eva] share/libc/stdlib.c:72: Call to builtin Frama_C_malloc_by_stack [eva] share/libc/stdlib.c:72: allocating variable __malloc_calloc_l72 [eva] computing for function memset <- calloc <- main. Called from share/libc/stdlib.c:73. [eva] using specification for function memset [eva] share/libc/stdlib.c:73: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] Done for function memset [eva] Recording results for calloc [eva] Done for function calloc [eva] tests/libc/stdlib_c.c:16: assertion got status valid. [eva] computing for function Frama_C_size_t_interval <- main. Called from tests/libc/stdlib_c.c:20. [eva] using specification for function Frama_C_size_t_interval [eva] tests/libc/stdlib_c.c:20: function Frama_C_size_t_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_size_t_interval [eva] computing for function calloc <- main. Called from tests/libc/stdlib_c.c:21. [eva] share/libc/stdlib.c:72: Call to builtin Frama_C_malloc_by_stack [eva] share/libc/stdlib.c:72: allocating variable __malloc_calloc_l72_0 [eva] computing for function memset <- calloc <- main. Called from share/libc/stdlib.c:73. [eva:alarm] share/libc/stdlib.c:73: Warning: function memset: precondition 'valid_s' got status unknown. [eva] Done for function memset [eva] Recording results for calloc [eva] Done for function calloc [eva:alarm] tests/libc/stdlib_c.c:23: Warning: assertion got status unknown. [eva] computing for function calloc <- main. Called from tests/libc/stdlib_c.c:27. [eva] Recording results for calloc [eva] Done for function calloc [eva] tests/libc/stdlib_c.c:28: assertion got status valid. [eva] computing for function calloc <- main. Called from tests/libc/stdlib_c.c:32. [eva] share/libc/stdlib.c:72: Call to builtin Frama_C_malloc_by_stack [eva] share/libc/stdlib.c:72: allocating variable __malloc_calloc_l72_1 [eva] computing for function memset <- calloc <- main. Called from share/libc/stdlib.c:73. [eva] Done for function memset [eva] Recording results for calloc [eva] Done for function calloc [eva] tests/libc/stdlib_c.c:31: starting to merge loop iterations [eva] computing for function calloc <- main. Called from tests/libc/stdlib_c.c:32. [eva] share/libc/stdlib.c:72: Call to builtin Frama_C_malloc_by_stack [eva] computing for function memset <- calloc <- main. Called from share/libc/stdlib.c:73. [eva] Done for function memset [eva] Recording results for calloc [eva] Done for function calloc [eva:alarm] tests/libc/stdlib_c.c:33: Warning: out of bounds write. assert \valid(s + (unsigned int)(i - 1)); [eva] computing for function calloc <- main. Called from tests/libc/stdlib_c.c:32. [eva] share/libc/stdlib.c:72: Call to builtin Frama_C_malloc_by_stack [eva] computing for function memset <- calloc <- main. Called from share/libc/stdlib.c:73. [eva] Done for function memset [eva] Recording results for calloc [eva] Done for function calloc [eva] computing for function calloc <- main. Called from tests/libc/stdlib_c.c:32. [eva] share/libc/stdlib.c:72: Call to builtin Frama_C_malloc_by_stack [eva] computing for function memset <- calloc <- main. Called from share/libc/stdlib.c:73. [eva] Done for function memset [eva] Recording results for calloc [eva] Done for function calloc [eva] computing for function calloc <- main. Called from tests/libc/stdlib_c.c:32. [eva] share/libc/stdlib.c:72: Call to builtin Frama_C_malloc_by_stack [eva] computing for function memset <- calloc <- main. Called from share/libc/stdlib.c:73. [eva] Done for function memset [eva] Recording results for calloc [eva] Done for function calloc [eva] computing for function calloc <- main. Called from tests/libc/stdlib_c.c:32. [eva] share/libc/stdlib.c:72: Call to builtin Frama_C_malloc_by_stack [eva] computing for function memset <- calloc <- main. Called from share/libc/stdlib.c:73. [eva] Done for function memset [eva] Recording results for calloc [eva] Done for function calloc [eva] computing for function posix_memalign <- main. Called from tests/libc/stdlib_c.c:37. [eva] share/libc/stdlib.c:196: assertion 'alignment_is_a_suitable_power_of_two' got status valid. [eva] share/libc/stdlib.c:199: Call to builtin Frama_C_malloc_by_stack [eva] share/libc/stdlib.c:199: allocating variable __malloc_posix_memalign_l199 [eva] Recording results for posix_memalign [eva] Done for function posix_memalign [eva] computing for function free <- main. Called from tests/libc/stdlib_c.c:38. [eva] using specification for function free [eva] tests/libc/stdlib_c.c:38: Warning: ignoring unsupported \allocates clause [eva] tests/libc/stdlib_c.c:38: function free: precondition 'freeable' got status valid. [eva] Done for function free [eva] computing for function posix_memalign <- main. Called from tests/libc/stdlib_c.c:39. [eva] share/libc/stdlib.c:199: Call to builtin Frama_C_malloc_by_stack [eva] share/libc/stdlib.c:199: allocating variable __malloc_posix_memalign_l199_0 [eva] Recording results for posix_memalign [eva] Done for function posix_memalign [eva] computing for function free <- main. Called from tests/libc/stdlib_c.c:40. [eva] tests/libc/stdlib_c.c:40: Warning: ignoring unsupported \allocates clause [eva] tests/libc/stdlib_c.c:40: function free: precondition 'freeable' got status valid. [eva] Done for function free [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function calloc: __fc_heap_status ∈ [--..--] l ∈ [0..4294967292],0%4 p ∈ {{ NULL ; &__malloc_calloc_l72[0] ; &__malloc_calloc_l72_0[0] ; &__malloc_w_calloc_l72_1[0] }} __retres ∈ {{ NULL ; (void *)&__malloc_calloc_l72 ; (void *)&__malloc_calloc_l72_0 ; (void *)&__malloc_w_calloc_l72_1 }} __malloc_calloc_l72[0..3] ∈ [--..--] or UNINITIALIZED __malloc_calloc_l72_0[0..4294967291] ∈ [--..--] or UNINITIALIZED __malloc_w_calloc_l72_1[0..4294967291] ∈ [--..--] or UNINITIALIZED [eva:final-states] Values at end of function posix_memalign: __fc_heap_status ∈ [--..--] p_al0 ∈ {{ NULL ; &__malloc_posix_memalign_l199[0] }} p_al1 ∈ {{ NULL ; &__malloc_posix_memalign_l199_0[0] }} or UNINITIALIZED __retres ∈ {0; 12} [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] Frama_C_entropy_source ∈ [--..--] p ∈ {{ NULL ; (int *)&__malloc_calloc_l72 }} nmemb ∈ [1..4294967295] q ∈ {{ NULL ; (int *)&__malloc_calloc_l72_0 }} r ∈ {0} s ∈ {{ NULL ; (int *)&__malloc_w_calloc_l72_1 }} or UNINITIALIZED p_al0 ∈ {{ NULL ; &__malloc_posix_memalign_l199[0] }} p_al1 ∈ {{ NULL ; &__malloc_posix_memalign_l199_0[0] }} p_memal_res ∈ {0; 12} p_memal_res2 ∈ {0; 12} __retres ∈ {0} __malloc_calloc_l72[0..3] ∈ [--..--] or UNINITIALIZED __malloc_calloc_l72_0[0..4294967291] ∈ [--..--] or UNINITIALIZED __malloc_w_calloc_l72_1[0..4294967291] ∈ [--..--] or UNINITIALIZED frama-c-20.0-Calcium/tests/libc/oracle/stdlib_c_env.res.oracle0000666000000000000000000003446713571573400021163 0ustar [kernel] Parsing tests/libc/stdlib_c_env.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function putenv <- main. Called from tests/libc/stdlib_c_env.c:8. [eva] share/libc/stdlib.c:114: Call to builtin strchr [eva] share/libc/stdlib.c:114: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/stdlib.c:115: assertion 'string_contains_separator' got status valid. [eva] share/libc/stdlib.c:116: assertion 'name_is_not_empty' got status valid. [eva] computing for function __fc_initenv <- putenv <- main. Called from share/libc/stdlib.c:118. [eva] computing for function Frama_C_make_unknown <- __fc_initenv <- putenv <- main. Called from share/libc/stdlib.c:87. [eva] using specification for function Frama_C_make_unknown [eva] share/libc/stdlib.c:87: function Frama_C_make_unknown: precondition 'valid_p' got status valid. [eva] Done for function Frama_C_make_unknown [eva] computing for function Frama_C_interval <- __fc_initenv <- putenv <- main. Called from share/libc/stdlib.c:89. [eva] using specification for function Frama_C_interval [eva] share/libc/stdlib.c:89: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] share/libc/stdlib.c:88: starting to merge loop iterations [eva] computing for function Frama_C_interval <- __fc_initenv <- putenv <- main. Called from share/libc/stdlib.c:89. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- __fc_initenv <- putenv <- main. Called from share/libc/stdlib.c:89. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- __fc_initenv <- putenv <- main. Called from share/libc/stdlib.c:89. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- __fc_initenv <- putenv <- main. Called from share/libc/stdlib.c:89. [eva] Done for function Frama_C_interval [eva] Recording results for __fc_initenv [eva] Done for function __fc_initenv [eva] computing for function Frama_C_nondet <- putenv <- main. Called from share/libc/stdlib.c:125. [eva] using specification for function Frama_C_nondet [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_nondet <- putenv <- main. Called from share/libc/stdlib.c:126. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- putenv <- main. Called from share/libc/stdlib.c:128. [eva] share/libc/stdlib.c:128: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- putenv <- main. Called from share/libc/stdlib.c:130. [eva] share/libc/stdlib.c:130: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] Recording results for putenv [eva] Done for function putenv [eva] computing for function putenv <- main. Called from tests/libc/stdlib_c_env.c:10. [eva] share/libc/stdlib.c:114: Call to builtin strchr [eva] computing for function __fc_initenv <- putenv <- main. Called from share/libc/stdlib.c:118. [eva] Recording results for __fc_initenv [eva] Done for function __fc_initenv [eva] computing for function Frama_C_nondet <- putenv <- main. Called from share/libc/stdlib.c:125. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_nondet <- putenv <- main. Called from share/libc/stdlib.c:126. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- putenv <- main. Called from share/libc/stdlib.c:128. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- putenv <- main. Called from share/libc/stdlib.c:130. [eva] Done for function Frama_C_interval [eva] Recording results for putenv [eva] Done for function putenv [eva] computing for function getenv <- main. Called from tests/libc/stdlib_c_env.c:11. [eva] share/libc/stdlib.c:102: assertion got status valid. [eva] share/libc/stdlib.c:104: Reusing old results for call to __fc_initenv [eva] computing for function Frama_C_nondet <- getenv <- main. Called from share/libc/stdlib.c:105. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- getenv <- main. Called from share/libc/stdlib.c:106. [eva] share/libc/stdlib.c:106: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] Recording results for getenv [eva] Done for function getenv [eva] tests/libc/stdlib_c_env.c:13: assertion got status valid. [eva] computing for function strcpy <- main. Called from tests/libc/stdlib_c_env.c:15. [eva] using specification for function strcpy [eva] tests/libc/stdlib_c_env.c:15: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/stdlib_c_env.c:15: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/stdlib_c_env.c:15: function strcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:351: cannot evaluate ACSL term, unsupported ACSL construct: logic function strcmp [eva] Done for function strcpy [eva] computing for function getenv <- main. Called from tests/libc/stdlib_c_env.c:16. [eva] share/libc/stdlib.c:104: Reusing old results for call to __fc_initenv [eva] computing for function Frama_C_nondet <- getenv <- main. Called from share/libc/stdlib.c:105. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- getenv <- main. Called from share/libc/stdlib.c:106. [eva] Done for function Frama_C_interval [eva] Recording results for getenv [eva] Done for function getenv [eva] computing for function setenv <- main. Called from tests/libc/stdlib_c_env.c:17. [eva] share/libc/stdlib.c:137: Call to builtin strchr [eva] share/libc/stdlib.c:137: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/stdlib.c:141: Call to builtin strlen [eva] share/libc/stdlib.c:141: function strlen: precondition 'valid_string_s' got status valid. [eva] share/libc/stdlib.c:147: Reusing old results for call to __fc_initenv [eva] computing for function Frama_C_nondet <- setenv <- main. Called from share/libc/stdlib.c:153. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_nondet <- setenv <- main. Called from share/libc/stdlib.c:157. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_make_unknown <- setenv <- main. Called from share/libc/stdlib.c:158. [eva] share/libc/stdlib.c:158: function Frama_C_make_unknown: precondition 'valid_p' got status valid. [eva] Done for function Frama_C_make_unknown [eva] computing for function Frama_C_interval <- setenv <- main. Called from share/libc/stdlib.c:160. [eva] share/libc/stdlib.c:160: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- setenv <- main. Called from share/libc/stdlib.c:160. [eva] share/libc/stdlib.c:160: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] Recording results for setenv [eva] Done for function setenv [eva] computing for function setenv <- main. Called from tests/libc/stdlib_c_env.c:18. [eva] share/libc/stdlib.c:137: Call to builtin strchr [eva:alarm] share/libc/stdlib.c:137: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] share/libc/stdlib.c:141: Call to builtin strlen [eva:alarm] share/libc/stdlib.c:141: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] share/libc/stdlib.c:147: Reusing old results for call to __fc_initenv [eva] computing for function Frama_C_nondet <- setenv <- main. Called from share/libc/stdlib.c:153. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_nondet <- setenv <- main. Called from share/libc/stdlib.c:157. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_make_unknown <- setenv <- main. Called from share/libc/stdlib.c:158. [eva] Done for function Frama_C_make_unknown [eva] computing for function Frama_C_interval <- setenv <- main. Called from share/libc/stdlib.c:160. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- setenv <- main. Called from share/libc/stdlib.c:160. [eva] Done for function Frama_C_interval [eva] Recording results for setenv [eva] Done for function setenv [eva] computing for function setenv <- main. Called from tests/libc/stdlib_c_env.c:19. [eva] share/libc/stdlib.c:137: Call to builtin strchr [eva] share/libc/stdlib.c:141: Call to builtin strlen [eva] share/libc/stdlib.c:147: Reusing old results for call to __fc_initenv [eva] computing for function Frama_C_nondet <- setenv <- main. Called from share/libc/stdlib.c:153. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_nondet <- setenv <- main. Called from share/libc/stdlib.c:157. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_make_unknown <- setenv <- main. Called from share/libc/stdlib.c:158. [eva] Done for function Frama_C_make_unknown [eva] computing for function Frama_C_interval <- setenv <- main. Called from share/libc/stdlib.c:160. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- setenv <- main. Called from share/libc/stdlib.c:160. [eva] Done for function Frama_C_interval [eva] Recording results for setenv [eva] Done for function setenv [eva] computing for function unsetenv <- main. Called from tests/libc/stdlib_c_env.c:20. [eva] share/libc/stdlib.c:167: Call to builtin strchr [eva] share/libc/stdlib.c:167: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/stdlib.c:171: Call to builtin strlen [eva] share/libc/stdlib.c:171: function strlen: precondition 'valid_string_s' got status valid. [eva] share/libc/stdlib.c:177: Reusing old results for call to __fc_initenv [eva] computing for function Frama_C_nondet <- unsetenv <- main. Called from share/libc/stdlib.c:179. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- unsetenv <- main. Called from share/libc/stdlib.c:180. [eva] share/libc/stdlib.c:180: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] Recording results for unsetenv [eva] Done for function unsetenv [eva] tests/libc/stdlib_c_env.c:21: assertion got status valid. [eva] computing for function unsetenv <- main. Called from tests/libc/stdlib_c_env.c:22. [eva] share/libc/stdlib.c:167: Call to builtin strchr [eva] Recording results for unsetenv [eva] Done for function unsetenv [eva] tests/libc/stdlib_c_env.c:23: assertion got status valid. [eva] computing for function unsetenv <- main. Called from tests/libc/stdlib_c_env.c:24. [eva] share/libc/stdlib.c:167: Call to builtin strchr [eva:alarm] share/libc/stdlib.c:167: Warning: function strchr: precondition 'valid_string_s' got status unknown. [eva] share/libc/stdlib.c:171: Call to builtin strlen [eva:alarm] share/libc/stdlib.c:171: Warning: function strlen: precondition 'valid_string_s' got status unknown. [eva] share/libc/stdlib.c:177: Reusing old results for call to __fc_initenv [eva] computing for function Frama_C_nondet <- unsetenv <- main. Called from share/libc/stdlib.c:179. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- unsetenv <- main. Called from share/libc/stdlib.c:180. [eva] Done for function Frama_C_interval [eva] Recording results for unsetenv [eva] Done for function unsetenv [eva] computing for function getenv <- main. Called from tests/libc/stdlib_c_env.c:25. [eva:alarm] share/libc/stdlib.c:102: Warning: assertion got status unknown. [eva] share/libc/stdlib.c:104: Reusing old results for call to __fc_initenv [eva] computing for function Frama_C_nondet <- getenv <- main. Called from share/libc/stdlib.c:105. [eva] Done for function Frama_C_nondet [eva] computing for function Frama_C_interval <- getenv <- main. Called from share/libc/stdlib.c:106. [eva] Done for function Frama_C_interval [eva] Recording results for getenv [eva] Done for function getenv [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function __fc_initenv: __fc_env[0..4095] ∈ {{ NULL ; &__fc_env_strings + [0..63] ; "BLA=1" }} Frama_C_entropy_source ∈ [--..--] __fc_env_strings[0..62] ∈ [--..--] [63] ∈ {0} __fc_initenv_init ∈ {1} [eva:final-states] Values at end of function getenv: Frama_C_entropy_source ∈ [--..--] __retres ∈ {{ NULL ; &s[0] ; &__fc_env_strings + [0..63] ; "BLA=1" }} [eva:final-states] Values at end of function putenv: __fc_env[0..4095] ∈ {{ NULL ; &s[0] ; &__fc_env_strings + [0..63] ; "BLA=1" }} Frama_C_entropy_source ∈ [--..--] separator ∈ {{ &s[4] ; "BLA=1" + {3} }} __fc_env_strings[0..62] ∈ [--..--] [63] ∈ {0} __fc_initenv_init ∈ {1} __retres ∈ [--..--] [eva:final-states] Values at end of function setenv: __fc_env[0..4095] ∈ {{ NULL ; &s[0] ; &__fc_env_strings + [0..63] ; "BLA=1" }} Frama_C_entropy_source ∈ [--..--] namelen ∈ [0..63] __fc_env_strings[0..62] ∈ [--..--] [63] ∈ {0} __retres ∈ {-1; 0} [eva:final-states] Values at end of function unsetenv: __fc_env[0..4095] ∈ {{ NULL ; &s[0] ; &__fc_env_strings + [0..63] ; "BLA=1" }} Frama_C_entropy_source ∈ [--..--] namelen ∈ [0..63] __retres ∈ {-1; 0} [eva:final-states] Values at end of function main: __fc_env[0..4095] ∈ {{ NULL ; &s[0] ; &__fc_env_strings + [0..63] ; "BLA=1" }} Frama_C_entropy_source ∈ [--..--] env0 ∈ {{ "BLA=1" }} i1 ∈ [--..--] s[0..7] ∈ [--..--] [8..9] ∈ {0} i2 ∈ [--..--] r1 ∈ {{ NULL ; &s[0] ; &__fc_env_strings + [0..63] ; "BLA=1" }} r2 ∈ {{ NULL ; &s[0] ; &__fc_env_strings + [0..63] ; "BLA=1" }} i3 ∈ {-1; 0} i4 ∈ {-1; 0} i5 ∈ {-1; 0} i6 ∈ {0} i7 ∈ {-1} i8 ∈ {-1; 0} r3 ∈ {{ NULL ; &s[0] ; &__fc_env_strings + [0..63] ; "BLA=1" }} __fc_env_strings[0..62] ∈ [--..--] [63] ∈ {0} __fc_initenv_init ∈ {1} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/stdlib_h.res.oracle0000666000000000000000000004010713571573400020304 0ustar [kernel] Parsing tests/libc/stdlib_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function strtol <- main. Called from tests/libc/stdlib_h.c:20. [eva] using specification for function strtol [eva] tests/libc/stdlib_h.c:20: function strtol: precondition 'valid_nptr' got status valid. [eva] tests/libc/stdlib_h.c:20: function strtol: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:20: function strtol: precondition 'base_range' got status valid. [eva] tests/libc/stdlib_h.c:20: function strtol, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtol [eva] computing for function strtol <- main. Called from tests/libc/stdlib_h.c:21. [eva:alarm] tests/libc/stdlib_h.c:21: Warning: function strtol: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:21: function strtol: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:21: function strtol: precondition 'base_range' got status valid. [eva] tests/libc/stdlib_h.c:21: function strtol, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtol [eva] computing for function strtol <- main. Called from tests/libc/stdlib_h.c:22. [eva:alarm] tests/libc/stdlib_h.c:22: Warning: function strtol: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:22: function strtol: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:22: function strtol: precondition 'base_range' got status valid. [eva] Done for function strtol [eva] computing for function strtol <- main. Called from tests/libc/stdlib_h.c:23. [eva] tests/libc/stdlib_h.c:23: function strtol: precondition 'valid_nptr' got status valid. [eva] tests/libc/stdlib_h.c:23: function strtol: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:23: function strtol: precondition 'base_range' got status valid. [eva] Done for function strtol [eva] computing for function strtoll <- main. Called from tests/libc/stdlib_h.c:27. [eva] using specification for function strtoll [eva] tests/libc/stdlib_h.c:27: function strtoll: precondition 'valid_nptr' got status valid. [eva] tests/libc/stdlib_h.c:27: function strtoll: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:27: function strtoll: precondition 'base_range' got status valid. [eva] tests/libc/stdlib_h.c:27: function strtoll, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtoll [eva] computing for function strtoll <- main. Called from tests/libc/stdlib_h.c:28. [eva:alarm] tests/libc/stdlib_h.c:28: Warning: function strtoll: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:28: function strtoll: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:28: function strtoll: precondition 'base_range' got status valid. [eva] tests/libc/stdlib_h.c:28: function strtoll, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtoll [eva] computing for function strtoll <- main. Called from tests/libc/stdlib_h.c:29. [eva:alarm] tests/libc/stdlib_h.c:29: Warning: function strtoll: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:29: function strtoll: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:29: function strtoll: precondition 'base_range' got status valid. [eva] Done for function strtoll [eva] computing for function strtoul <- main. Called from tests/libc/stdlib_h.c:33. [eva] using specification for function strtoul [eva] tests/libc/stdlib_h.c:33: function strtoul: precondition 'valid_nptr' got status valid. [eva] tests/libc/stdlib_h.c:33: function strtoul: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:33: function strtoul: precondition 'base_range' got status valid. [eva] tests/libc/stdlib_h.c:33: function strtoul, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtoul [eva] computing for function strtoul <- main. Called from tests/libc/stdlib_h.c:34. [eva:alarm] tests/libc/stdlib_h.c:34: Warning: function strtoul: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:34: function strtoul: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:34: function strtoul: precondition 'base_range' got status valid. [eva] tests/libc/stdlib_h.c:34: function strtoul, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtoul [eva] computing for function strtoul <- main. Called from tests/libc/stdlib_h.c:35. [eva:alarm] tests/libc/stdlib_h.c:35: Warning: function strtoul: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:35: function strtoul: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:35: function strtoul: precondition 'base_range' got status valid. [eva] Done for function strtoul [eva] computing for function strtoull <- main. Called from tests/libc/stdlib_h.c:39. [eva] using specification for function strtoull [eva] tests/libc/stdlib_h.c:39: function strtoull: precondition 'valid_nptr' got status valid. [eva] tests/libc/stdlib_h.c:39: function strtoull: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:39: function strtoull: precondition 'base_range' got status valid. [eva] tests/libc/stdlib_h.c:39: function strtoull, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtoull [eva] computing for function strtoull <- main. Called from tests/libc/stdlib_h.c:40. [eva:alarm] tests/libc/stdlib_h.c:40: Warning: function strtoull: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:40: function strtoull: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:40: function strtoull: precondition 'base_range' got status valid. [eva] tests/libc/stdlib_h.c:40: function strtoull, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtoull [eva] computing for function strtoull <- main. Called from tests/libc/stdlib_h.c:41. [eva:alarm] tests/libc/stdlib_h.c:41: Warning: function strtoull: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:41: function strtoull: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:41: function strtoull: precondition 'base_range' got status valid. [eva] Done for function strtoull [eva] computing for function strtod <- main. Called from tests/libc/stdlib_h.c:46. [eva] using specification for function strtod [eva] tests/libc/stdlib_h.c:46: function strtod: precondition 'valid_nptr' got status valid. [eva] tests/libc/stdlib_h.c:46: function strtod: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:46: function strtod, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtod [eva] computing for function strtod <- main. Called from tests/libc/stdlib_h.c:47. [eva:alarm] tests/libc/stdlib_h.c:47: Warning: function strtod: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:47: function strtod: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:47: function strtod, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtod [eva] computing for function strtod <- main. Called from tests/libc/stdlib_h.c:48. [eva:alarm] tests/libc/stdlib_h.c:48: Warning: function strtod: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:48: function strtod: precondition 'separation' got status valid. [eva] Done for function strtod [eva] computing for function strtold <- main. Called from tests/libc/stdlib_h.c:52. [eva] using specification for function strtold [eva] tests/libc/stdlib_h.c:52: function strtold: precondition 'valid_nptr' got status valid. [eva] tests/libc/stdlib_h.c:52: function strtold: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:52: function strtold, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtold [eva] computing for function strtold <- main. Called from tests/libc/stdlib_h.c:53. [eva:alarm] tests/libc/stdlib_h.c:53: Warning: function strtold: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:53: function strtold: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:53: function strtold, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtold [eva] computing for function strtold <- main. Called from tests/libc/stdlib_h.c:54. [eva:alarm] tests/libc/stdlib_h.c:54: Warning: function strtold: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:54: function strtold: precondition 'separation' got status valid. [eva] Done for function strtold [eva] computing for function strtof <- main. Called from tests/libc/stdlib_h.c:58. [eva] using specification for function strtof [eva] tests/libc/stdlib_h.c:58: function strtof: precondition 'valid_nptr' got status valid. [eva] tests/libc/stdlib_h.c:58: function strtof: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:58: function strtof, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtof [eva] computing for function strtof <- main. Called from tests/libc/stdlib_h.c:59. [eva:alarm] tests/libc/stdlib_h.c:59: Warning: function strtof: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:59: function strtof: precondition 'separation' got status valid. [eva] tests/libc/stdlib_h.c:59: function strtof, behavior store_position: precondition 'valid_endptr' got status valid. [eva] Done for function strtof [eva] computing for function strtof <- main. Called from tests/libc/stdlib_h.c:60. [eva:alarm] tests/libc/stdlib_h.c:60: Warning: function strtof: precondition 'valid_nptr' got status unknown. [eva] tests/libc/stdlib_h.c:60: function strtof: precondition 'separation' got status valid. [eva] Done for function strtof [eva] computing for function bsearch <- main. Called from tests/libc/stdlib_h.c:64. [eva] using specification for function bsearch [eva] tests/libc/stdlib_h.c:64: function bsearch: precondition 'valid_function_compar' got status valid. [eva] Done for function bsearch [eva:alarm] tests/libc/stdlib_h.c:65: Warning: assertion got status unknown. [eva] computing for function bsearch <- main. Called from tests/libc/stdlib_h.c:67. [eva] tests/libc/stdlib_h.c:67: function bsearch: precondition 'valid_function_compar' got status valid. [eva] Done for function bsearch [eva:alarm] tests/libc/stdlib_h.c:68: Warning: assertion got status unknown. [eva] computing for function mkstemp <- main. Called from tests/libc/stdlib_h.c:82. [eva] using specification for function mkstemp [eva] tests/libc/stdlib_h.c:82: function mkstemp: precondition 'valid_template' got status valid. [eva] Done for function mkstemp [eva] computing for function drand48 <- main. Called from tests/libc/stdlib_h.c:86. [eva] using specification for function drand48 [eva:alarm] tests/libc/stdlib_h.c:86: Warning: function drand48: precondition 'random48_initialized' got status invalid. [eva] Done for function drand48 [eva] computing for function lrand48 <- main. Called from tests/libc/stdlib_h.c:90. [eva] using specification for function lrand48 [eva:alarm] tests/libc/stdlib_h.c:90: Warning: function lrand48: precondition 'random48_initialized' got status invalid. [eva] Done for function lrand48 [eva] computing for function mrand48 <- main. Called from tests/libc/stdlib_h.c:94. [eva] using specification for function mrand48 [eva:alarm] tests/libc/stdlib_h.c:94: Warning: function mrand48: precondition 'random48_initialized' got status invalid. [eva] Done for function mrand48 [eva] computing for function erand48 <- main. Called from tests/libc/stdlib_h.c:99. [eva] using specification for function erand48 [eva:alarm] tests/libc/stdlib_h.c:99: Warning: function erand48: precondition 'initialization,initialized_xsubi' got status invalid. [eva] Done for function erand48 [eva] computing for function erand48 <- main. Called from tests/libc/stdlib_h.c:104. [eva] tests/libc/stdlib_h.c:104: function erand48: precondition 'initialization,initialized_xsubi' got status valid. [eva] Done for function erand48 [eva] tests/libc/stdlib_h.c:105: assertion got status valid. [eva] computing for function jrand48 <- main. Called from tests/libc/stdlib_h.c:106. [eva] using specification for function jrand48 [eva] tests/libc/stdlib_h.c:106: function jrand48: precondition 'initialization,initialized_xsubi' got status valid. [eva] Done for function jrand48 [eva] tests/libc/stdlib_h.c:107: assertion got status valid. [eva] computing for function nrand48 <- main. Called from tests/libc/stdlib_h.c:108. [eva] using specification for function nrand48 [eva] tests/libc/stdlib_h.c:108: function nrand48: precondition 'initialization,initialized_xsubi' got status valid. [eva] Done for function nrand48 [eva] tests/libc/stdlib_h.c:109: assertion got status valid. [eva] computing for function srand48 <- main. Called from tests/libc/stdlib_h.c:111. [eva] using specification for function srand48 [eva] Done for function srand48 [eva] computing for function seed48 <- main. Called from tests/libc/stdlib_h.c:113. [eva] using specification for function seed48 [eva] tests/libc/stdlib_h.c:113: function seed48: precondition 'initialization,initialized_seed16v' got status valid. [eva] Done for function seed48 [eva] computing for function lcong48 <- main. Called from tests/libc/stdlib_h.c:115. [eva] using specification for function lcong48 [eva] Done for function lcong48 [eva] computing for function drand48 <- main. Called from tests/libc/stdlib_h.c:117. [eva] tests/libc/stdlib_h.c:117: function drand48: precondition 'random48_initialized' got status valid. [eva] Done for function drand48 [eva] tests/libc/stdlib_h.c:118: assertion got status valid. [eva] computing for function mrand48 <- main. Called from tests/libc/stdlib_h.c:119. [eva] tests/libc/stdlib_h.c:119: function mrand48: precondition 'random48_initialized' got status valid. [eva] Done for function mrand48 [eva] tests/libc/stdlib_h.c:120: assertion got status valid. [eva] computing for function lrand48 <- main. Called from tests/libc/stdlib_h.c:121. [eva] tests/libc/stdlib_h.c:121: function lrand48: precondition 'random48_initialized' got status valid. [eva] Done for function lrand48 [eva] tests/libc/stdlib_h.c:122: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_random48_init ∈ {1} __fc_random48_counter[0..2] ∈ [--..--] base ∈ {0; 2; 36} sl ∈ {{ "12 34 -56" }} s ∈ {{ " 3.14 0x1.2p2" }} pl ∈ {{ "12 34 -56" + [0..--] }} q ∈ {{ " 3.14 0x1.2p2" + [0..--] }} l ∈ [0..2147483647] pll ∈ {{ "12 34 -56" + [0..--] }} ll ∈ [--..--] pul ∈ {{ "12 34 -56" + [0..--] }} ul ∈ [--..--] pull ∈ {{ "12 34 -56" + [0..--] }} ull ∈ [--..--] sd ∈ {{ " 3.14 0x1.2p2" }} pd ∈ {{ " 3.14 0x1.2p2" + [0..--] }} d ∈ [-0. .. 1.] pld ∈ {{ " 3.14 0x1.2p2" + [0..--] }} ld ∈ [-inf .. inf] ∪ {NaN} pf ∈ {{ " 3.14 0x1.2p2" + [0..--] }} f ∈ [-inf .. inf] ∪ {NaN} ai[0] ∈ {1} [1] ∈ {-1} [2] ∈ {50000} [3] ∈ {20} key ∈ {-1} p ∈ {{ &ai[1] }} tempFilename[0..9] ∈ [--..--] r ∈ [-1..19] xsubi[0..2] ∈ {42} seed48v[0] ∈ {0} [1] ∈ {4} [2] ∈ {2} res ∈ {{ &__fc_random48_counter[0] }} param[0] ∈ {0} [1] ∈ {4} [2] ∈ {2} [3] ∈ {0} [4] ∈ {4} [5] ∈ {2} [6] ∈ {0} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/string_c.res.oracle0000666000000000000000000014757113571573400020341 0ustar [kernel] Parsing tests/libc/string_c.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function test_memcpy <- main. Called from tests/libc/string_c.c:281. [eva] computing for function memcpy <- test_memcpy <- main. Called from tests/libc/string_c.c:10. [eva] tests/libc/string_c.c:10: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/libc/string_c.c:10: function memcpy: precondition 'valid_src' got status valid. [eva] tests/libc/string_c.c:10: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva:alarm] share/libc/string.h:98: Warning: function memcpy: postcondition 'copied_contents' got status unknown. [eva] share/libc/string.h:99: function memcpy: postcondition 'result_ptr' got status valid. [eva] Recording results for memcpy [eva] Done for function memcpy [eva] tests/libc/string_c.c:11: assertion got status valid. [eva] tests/libc/string_c.c:12: assertion got status valid. [eva] tests/libc/string_c.c:13: assertion got status valid. [eva] tests/libc/string_c.c:14: assertion got status valid. [eva] computing for function memcpy <- test_memcpy <- main. Called from tests/libc/string_c.c:16. [eva] tests/libc/string_c.c:16: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/libc/string_c.c:16: function memcpy: precondition 'valid_src' got status valid. [eva] tests/libc/string_c.c:16: function memcpy: precondition 'separation' got status valid. [eva] Recording results for memcpy [eva] Done for function memcpy [eva] tests/libc/string_c.c:17: assertion got status valid. [eva] tests/libc/string_c.c:18: assertion got status valid. [eva] computing for function memcpy <- test_memcpy <- main. Called from tests/libc/string_c.c:19. [eva] tests/libc/string_c.c:19: function memcpy: precondition 'valid_dest' got status valid. [eva:alarm] tests/libc/string_c.c:19: Warning: function memcpy: precondition 'valid_src' got status unknown. [eva] tests/libc/string_c.c:19: function memcpy: precondition 'separation' got status valid. [eva] Recording results for memcpy [eva] Done for function memcpy [eva] computing for function memcpy <- test_memcpy <- main. Called from tests/libc/string_c.c:20. [eva:alarm] tests/libc/string_c.c:20: Warning: function memcpy: precondition 'valid_dest' got status unknown. [eva:alarm] tests/libc/string_c.c:20: Warning: function memcpy: precondition 'valid_src' got status unknown. [eva] tests/libc/string_c.c:20: function memcpy: precondition 'separation' got status valid. [eva] Recording results for memcpy [eva] Done for function memcpy [eva] computing for function memcpy <- test_memcpy <- main. Called from tests/libc/string_c.c:23. [eva] tests/libc/string_c.c:23: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/libc/string_c.c:23: function memcpy: precondition 'valid_src' got status valid. [eva] tests/libc/string_c.c:23: function memcpy: precondition 'separation' got status valid. [eva] Recording results for memcpy [eva] Done for function memcpy [eva] tests/libc/string_c.c:23: Reusing old results for call to memcpy [eva] tests/libc/string_c.c:24: assertion got status valid. [eva] tests/libc/string_c.c:25: assertion got status valid. [eva] Recording results for test_memcpy [eva] Done for function test_memcpy [eva] computing for function test_memmove <- main. Called from tests/libc/string_c.c:282. [eva] tests/libc/string_c.c:34: Frama_C_show_each_s0: {1} [eva] tests/libc/string_c.c:35: Frama_C_show_each_s0: {2} [eva] tests/libc/string_c.c:36: Frama_C_show_each_s0: {3} [eva] tests/libc/string_c.c:37: Frama_C_show_each_s0: {4} [eva] tests/libc/string_c.c:38: Frama_C_show_each_s0: {3} [eva] tests/libc/string_c.c:39: Frama_C_show_each_s0: {4} [eva] tests/libc/string_c.c:40: Frama_C_show_each_s0: {5} [eva] tests/libc/string_c.c:41: Frama_C_show_each_s0: {6} [eva] computing for function memmove <- test_memmove <- main. Called from tests/libc/string_c.c:42. [eva] tests/libc/string_c.c:42: function memmove: precondition 'valid_dest' got status valid. [eva] tests/libc/string_c.c:42: function memmove: precondition 'valid_src' got status valid. [eva] computing for function memoverlap <- memmove <- test_memmove <- main. Called from share/libc/string.c:77. [eva] share/libc/string.c:59: function memoverlap, behavior not_separated_gt: postcondition 'result_p_after_q' got status valid. [eva] Recording results for memoverlap [eva] Done for function memoverlap [eva] share/libc/string.h:108: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva:alarm] share/libc/string.h:108: Warning: function memmove: postcondition 'copied_contents' got status unknown. [eva] share/libc/string.h:109: function memmove: postcondition 'result_ptr' got status valid. [eva] Recording results for memmove [eva] Done for function memmove [eva] tests/libc/string_c.c:43: assertion got status valid. [eva] tests/libc/string_c.c:44: assertion got status valid. [eva] computing for function memmove <- test_memmove <- main. Called from tests/libc/string_c.c:49. [eva] tests/libc/string_c.c:49: function memmove: precondition 'valid_dest' got status valid. [eva] tests/libc/string_c.c:49: function memmove: precondition 'valid_src' got status valid. [eva] computing for function memoverlap <- memmove <- test_memmove <- main. Called from share/libc/string.c:77. [eva] share/libc/string.c:55: function memoverlap, behavior not_separated_lt: postcondition 'result_p_before_q' got status valid. [eva] Recording results for memoverlap [eva] Done for function memoverlap [eva] Recording results for memmove [eva] Done for function memmove [eva] tests/libc/string_c.c:50: assertion got status valid. [eva] computing for function memmove <- test_memmove <- main. Called from tests/libc/string_c.c:52. [eva] tests/libc/string_c.c:52: function memmove: precondition 'valid_dest' got status valid. [eva] tests/libc/string_c.c:52: function memmove: precondition 'valid_src' got status valid. [eva] computing for function memoverlap <- memmove <- test_memmove <- main. Called from share/libc/string.c:77. [eva] Recording results for memoverlap [eva] Done for function memoverlap [eva] Recording results for memmove [eva] Done for function memmove [eva] tests/libc/string_c.c:53: assertion got status valid. [eva] computing for function memmove <- test_memmove <- main. Called from tests/libc/string_c.c:56. [eva] tests/libc/string_c.c:56: function memmove: precondition 'valid_dest' got status valid. [eva] tests/libc/string_c.c:56: function memmove: precondition 'valid_src' got status valid. [eva] computing for function memoverlap <- memmove <- test_memmove <- main. Called from share/libc/string.c:77. [eva] share/libc/string.c:51: function memoverlap, behavior separated: postcondition 'result_no_overlap' got status valid. [eva] Recording results for memoverlap [eva] Done for function memoverlap [eva] Recording results for memmove [eva] Done for function memmove [eva] tests/libc/string_c.c:57: assertion got status valid. [eva] Recording results for test_memmove [eva] Done for function test_memmove [eva] computing for function test_strlen <- main. Called from tests/libc/string_c.c:283. [eva] computing for function strlen <- test_strlen <- main. Called from tests/libc/string_c.c:64. [eva] tests/libc/string_c.c:64: function strlen: precondition 'valid_string_s' got status valid. [eva] share/libc/string.h:127: function strlen: postcondition 'acsl_c_equiv' got status valid. [eva] Recording results for strlen [eva] Done for function strlen [eva] tests/libc/string_c.c:65: assertion got status valid. [eva] computing for function strlen <- test_strlen <- main. Called from tests/libc/string_c.c:66. [eva] tests/libc/string_c.c:66: function strlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strlen [eva] Done for function strlen [eva] tests/libc/string_c.c:67: assertion got status valid. [eva] computing for function strlen <- test_strlen <- main. Called from tests/libc/string_c.c:68. [eva] tests/libc/string_c.c:68: function strlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strlen [eva] Done for function strlen [eva] tests/libc/string_c.c:69: assertion got status valid. [eva] Recording results for test_strlen [eva] Done for function test_strlen [eva] computing for function test_strnlen <- main. Called from tests/libc/string_c.c:284. [eva] computing for function strnlen <- test_strnlen <- main. Called from tests/libc/string_c.c:75. [eva] tests/libc/string_c.c:75: function strnlen: precondition 'valid_string_s' got status valid. [eva] share/libc/string.h:133: function strnlen: postcondition 'result_bounded' got status valid. [eva] Recording results for strnlen [eva] Done for function strnlen [eva] tests/libc/string_c.c:76: assertion got status valid. [eva] computing for function strnlen <- test_strnlen <- main. Called from tests/libc/string_c.c:77. [eva] tests/libc/string_c.c:77: function strnlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strnlen [eva] Done for function strnlen [eva] tests/libc/string_c.c:78: assertion got status valid. [eva] computing for function strnlen <- test_strnlen <- main. Called from tests/libc/string_c.c:79. [eva] tests/libc/string_c.c:79: function strnlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strnlen [eva] Done for function strnlen [eva] tests/libc/string_c.c:80: assertion got status valid. [eva] computing for function strnlen <- test_strnlen <- main. Called from tests/libc/string_c.c:81. [eva] tests/libc/string_c.c:81: function strnlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strnlen [eva] Done for function strnlen [eva] tests/libc/string_c.c:82: assertion got status valid. [eva] computing for function strnlen <- test_strnlen <- main. Called from tests/libc/string_c.c:83. [eva] tests/libc/string_c.c:83: function strnlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strnlen [eva] Done for function strnlen [eva] tests/libc/string_c.c:84: assertion got status valid. [eva] computing for function strnlen <- test_strnlen <- main. Called from tests/libc/string_c.c:85. [eva] tests/libc/string_c.c:85: function strnlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strnlen [eva] Done for function strnlen [eva] tests/libc/string_c.c:86: assertion got status valid. [eva] Recording results for test_strnlen [eva] Done for function test_strnlen [eva] computing for function test_memset <- main. Called from tests/libc/string_c.c:285. [eva] computing for function memset <- test_memset <- main. Called from tests/libc/string_c.c:92. [eva] tests/libc/string_c.c:92: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva:alarm] share/libc/string.h:118: Warning: function memset: postcondition 'acsl_c_equiv' got status unknown. [eva] share/libc/string.h:119: function memset: postcondition 'result_ptr' got status valid. [eva] Recording results for memset [eva] Done for function memset [eva] tests/libc/string_c.c:93: assertion got status valid. [eva] tests/libc/string_c.c:94: assertion got status valid. [eva] tests/libc/string_c.c:95: assertion got status valid. [eva] computing for function memset <- test_memset <- main. Called from tests/libc/string_c.c:96. [eva] tests/libc/string_c.c:96: function memset: precondition 'valid_s' got status valid. [eva] Recording results for memset [eva] Done for function memset [eva] tests/libc/string_c.c:97: assertion got status valid. [eva] Recording results for test_memset [eva] Done for function test_memset [eva] computing for function test_strcmp <- main. Called from tests/libc/string_c.c:286. [eva] computing for function strcmp <- test_strcmp <- main. Called from tests/libc/string_c.c:104. [eva] tests/libc/string_c.c:104: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:104: function strcmp: precondition 'valid_string_s2' got status valid. [eva] share/libc/string.h:140: cannot evaluate ACSL term, unsupported ACSL construct: logic function strcmp [eva:alarm] share/libc/string.h:140: Warning: function strcmp: postcondition 'acsl_c_equiv' got status unknown. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] tests/libc/string_c.c:105: assertion got status valid. [eva] computing for function strcmp <- test_strcmp <- main. Called from tests/libc/string_c.c:106. [eva] tests/libc/string_c.c:106: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:106: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] tests/libc/string_c.c:107: assertion got status valid. [eva] computing for function strcmp <- test_strcmp <- main. Called from tests/libc/string_c.c:108. [eva] tests/libc/string_c.c:108: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:108: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] tests/libc/string_c.c:109: assertion got status valid. [eva] computing for function strcmp <- test_strcmp <- main. Called from tests/libc/string_c.c:110. [eva] tests/libc/string_c.c:110: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:110: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] tests/libc/string_c.c:111: assertion got status valid. [eva] computing for function strcmp <- test_strcmp <- main. Called from tests/libc/string_c.c:112. [eva] tests/libc/string_c.c:112: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:112: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] tests/libc/string_c.c:113: assertion got status valid. [eva] computing for function strcmp <- test_strcmp <- main. Called from tests/libc/string_c.c:114. [eva] tests/libc/string_c.c:114: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:114: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] tests/libc/string_c.c:115: assertion got status valid. [eva] computing for function strcmp <- test_strcmp <- main. Called from tests/libc/string_c.c:116. [eva] tests/libc/string_c.c:116: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:116: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] tests/libc/string_c.c:117: assertion got status valid. [eva] Recording results for test_strcmp [eva] Done for function test_strcmp [eva] computing for function test_strncmp <- main. Called from tests/libc/string_c.c:287. [eva] computing for function strncmp <- test_strncmp <- main. Called from tests/libc/string_c.c:167. [eva] tests/libc/string_c.c:167: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:167: function strncmp: precondition 'valid_string_s2' got status valid. [eva] share/libc/string.h:147: cannot evaluate ACSL term, unsupported ACSL construct: logic function strncmp [eva:alarm] share/libc/string.h:147: Warning: function strncmp: postcondition 'acsl_c_equiv' got status unknown. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] tests/libc/string_c.c:168: assertion got status valid. [eva] computing for function strncmp <- test_strncmp <- main. Called from tests/libc/string_c.c:169. [eva] tests/libc/string_c.c:169: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:169: function strncmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] tests/libc/string_c.c:170: assertion got status valid. [eva] computing for function strncmp <- test_strncmp <- main. Called from tests/libc/string_c.c:172. [eva] tests/libc/string_c.c:172: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:172: function strncmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] tests/libc/string_c.c:173: assertion got status valid. [eva] computing for function strncmp <- test_strncmp <- main. Called from tests/libc/string_c.c:174. [eva] tests/libc/string_c.c:174: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:174: function strncmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] tests/libc/string_c.c:175: assertion got status valid. [eva] computing for function strncmp <- test_strncmp <- main. Called from tests/libc/string_c.c:176. [eva] tests/libc/string_c.c:176: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:176: function strncmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] tests/libc/string_c.c:177: assertion got status valid. [eva] computing for function strncmp <- test_strncmp <- main. Called from tests/libc/string_c.c:178. [eva] tests/libc/string_c.c:178: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:178: function strncmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] tests/libc/string_c.c:179: assertion got status valid. [eva] computing for function strncmp <- test_strncmp <- main. Called from tests/libc/string_c.c:180. [eva] tests/libc/string_c.c:180: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:180: function strncmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] tests/libc/string_c.c:181: assertion got status valid. [eva] computing for function strncmp <- test_strncmp <- main. Called from tests/libc/string_c.c:182. [eva] tests/libc/string_c.c:182: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c.c:182: function strncmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] tests/libc/string_c.c:183: assertion got status valid. [eva] Recording results for test_strncmp [eva] Done for function test_strncmp [eva] computing for function test_memcmp <- main. Called from tests/libc/string_c.c:288. [eva] computing for function memcmp <- test_memcmp <- main. Called from tests/libc/string_c.c:188. [eva] tests/libc/string_c.c:188: function memcmp: precondition 'valid_s1' got status valid. [eva] tests/libc/string_c.c:188: function memcmp: precondition 'valid_s2' got status valid. [eva] tests/libc/string_c.c:188: function memcmp: precondition 'initialization,s1' got status valid. [eva] tests/libc/string_c.c:188: function memcmp: precondition 'initialization,s2' got status valid. [eva] tests/libc/string_c.c:188: function memcmp: precondition 'danglingness,s1' got status valid. [eva] tests/libc/string_c.c:188: function memcmp: precondition 'danglingness,s2' got status valid. [eva] share/libc/string.h:63: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva:alarm] share/libc/string.h:63: Warning: function memcmp: postcondition 'logic_spec' got status unknown. [eva] Recording results for memcmp [eva] Done for function memcmp [eva] tests/libc/string_c.c:189: assertion got status valid. [eva] computing for function memcmp <- test_memcmp <- main. Called from tests/libc/string_c.c:190. [eva] tests/libc/string_c.c:190: function memcmp: precondition 'valid_s1' got status valid. [eva] tests/libc/string_c.c:190: function memcmp: precondition 'valid_s2' got status valid. [eva] tests/libc/string_c.c:190: function memcmp: precondition 'initialization,s1' got status valid. [eva] tests/libc/string_c.c:190: function memcmp: precondition 'initialization,s2' got status valid. [eva] tests/libc/string_c.c:190: function memcmp: precondition 'danglingness,s1' got status valid. [eva] tests/libc/string_c.c:190: function memcmp: precondition 'danglingness,s2' got status valid. [eva] Recording results for memcmp [eva] Done for function memcmp [eva] tests/libc/string_c.c:191: assertion got status valid. [eva] computing for function memcmp <- test_memcmp <- main. Called from tests/libc/string_c.c:192. [eva] tests/libc/string_c.c:192: function memcmp: precondition 'valid_s1' got status valid. [eva] tests/libc/string_c.c:192: function memcmp: precondition 'valid_s2' got status valid. [eva] tests/libc/string_c.c:192: function memcmp: precondition 'initialization,s1' got status valid. [eva] tests/libc/string_c.c:192: function memcmp: precondition 'initialization,s2' got status valid. [eva] tests/libc/string_c.c:192: function memcmp: precondition 'danglingness,s1' got status valid. [eva] tests/libc/string_c.c:192: function memcmp: precondition 'danglingness,s2' got status valid. [eva] Recording results for memcmp [eva] Done for function memcmp [eva] tests/libc/string_c.c:193: assertion got status valid. [eva] computing for function memcmp <- test_memcmp <- main. Called from tests/libc/string_c.c:194. [eva] tests/libc/string_c.c:194: function memcmp: precondition 'valid_s1' got status valid. [eva] tests/libc/string_c.c:194: function memcmp: precondition 'valid_s2' got status valid. [eva] tests/libc/string_c.c:194: function memcmp: precondition 'initialization,s1' got status valid. [eva] tests/libc/string_c.c:194: function memcmp: precondition 'initialization,s2' got status valid. [eva] tests/libc/string_c.c:194: function memcmp: precondition 'danglingness,s1' got status valid. [eva] tests/libc/string_c.c:194: function memcmp: precondition 'danglingness,s2' got status valid. [eva] Recording results for memcmp [eva] Done for function memcmp [eva] tests/libc/string_c.c:195: assertion got status valid. [eva] Recording results for test_memcmp [eva] Done for function test_memcmp [eva] computing for function test_strcat <- main. Called from tests/libc/string_c.c:289. [eva] computing for function strcat <- test_strcat <- main. Called from tests/libc/string_c.c:124. [eva] tests/libc/string_c.c:124: function strcat: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:124: function strcat: precondition 'valid_string_dest' got status valid. [eva] tests/libc/string_c.c:124: function strcat: precondition 'room_string' got status valid. [eva] computing for function strlen <- strcat <- test_strcat <- main. Called from share/libc/string.c:182. [eva] share/libc/string.c:182: function strlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strlen [eva] Done for function strlen [eva] share/libc/string.h:405: function strcat: postcondition 'sum_of_lengths' got status valid. [eva] share/libc/string.h:408: function strcat: postcondition 'initialization,dest' got status valid. [eva] share/libc/string.h:409: function strcat: postcondition 'dest_null_terminated' got status valid. [eva] share/libc/string.h:410: function strcat: postcondition 'result_ptr' got status valid. [eva] Recording results for strcat [eva] Done for function strcat [eva] tests/libc/string_c.c:125: assertion got status valid. [eva] tests/libc/string_c.c:126: assertion got status valid. [eva] computing for function strcat <- test_strcat <- main. Called from tests/libc/string_c.c:132. [eva] tests/libc/string_c.c:132: function strcat: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:132: function strcat: precondition 'valid_string_dest' got status valid. [eva] tests/libc/string_c.c:132: function strcat: precondition 'room_string' got status valid. [eva] computing for function strlen <- strcat <- test_strcat <- main. Called from share/libc/string.c:182. [eva] Recording results for strlen [eva] Done for function strlen [eva] Recording results for strcat [eva] Done for function strcat [eva] tests/libc/string_c.c:133: assertion got status valid. [eva] computing for function strcat <- test_strcat <- main. Called from tests/libc/string_c.c:134. [eva] tests/libc/string_c.c:134: function strcat: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:134: function strcat: precondition 'valid_string_dest' got status valid. [eva] tests/libc/string_c.c:134: function strcat: precondition 'room_string' got status valid. [eva] computing for function strlen <- strcat <- test_strcat <- main. Called from share/libc/string.c:182. [eva] Recording results for strlen [eva] Done for function strlen [eva] Recording results for strcat [eva] Done for function strcat [eva] computing for function strcat <- test_strcat <- main. Called from tests/libc/string_c.c:135. [eva] tests/libc/string_c.c:135: function strcat: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:135: function strcat: precondition 'valid_string_dest' got status valid. [eva] tests/libc/string_c.c:135: function strcat: precondition 'room_string' got status valid. [eva] share/libc/string.c:182: Reusing old results for call to strlen [eva] Recording results for strcat [eva] Done for function strcat [eva] tests/libc/string_c.c:136: assertion got status valid. [eva] Recording results for test_strcat [eva] Done for function test_strcat [eva] computing for function test_strcpy <- main. Called from tests/libc/string_c.c:291. [eva] computing for function strcpy <- test_strcpy <- main. Called from tests/libc/string_c.c:142. [eva] tests/libc/string_c.c:142: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:142: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c.c:142: function strcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:351: cannot evaluate ACSL term, unsupported ACSL construct: logic function strcmp [eva:alarm] share/libc/string.h:351: Warning: function strcpy: postcondition 'equal_contents' got status unknown. [eva] share/libc/string.h:352: function strcpy: postcondition 'result_ptr' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] tests/libc/string_c.c:143: assertion got status valid. [eva] tests/libc/string_c.c:144: assertion got status valid. [eva] computing for function strcpy <- test_strcpy <- main. Called from tests/libc/string_c.c:145. [eva] tests/libc/string_c.c:145: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:145: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c.c:145: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] tests/libc/string_c.c:146: assertion got status valid. [eva] computing for function strcpy <- test_strcpy <- main. Called from tests/libc/string_c.c:147. [eva] tests/libc/string_c.c:147: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:147: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c.c:147: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] tests/libc/string_c.c:148: assertion got status valid. [eva] Recording results for test_strcpy [eva] Done for function test_strcpy [eva] computing for function test_strncpy <- main. Called from tests/libc/string_c.c:292. [eva] computing for function strncpy <- test_strncpy <- main. Called from tests/libc/string_c.c:154. [eva] tests/libc/string_c.c:154: function strncpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:154: function strncpy: precondition 'room_nstring' got status valid. [eva] tests/libc/string_c.c:154: function strncpy: precondition 'separation' got status valid. [eva] share/libc/string.h:363: function strncpy: postcondition 'result_ptr' got status valid. [eva] share/libc/string.h:364: function strncpy: postcondition 'initialization' got status valid. [eva] share/libc/string.h:367: cannot evaluate ACSL term, unsupported ACSL construct: logic function strcmp [eva:alarm] share/libc/string.h:367: Warning: function strncpy, behavior complete: postcondition 'equal_after_copy' got status unknown. [eva] Recording results for strncpy [eva] Done for function strncpy [eva] tests/libc/string_c.c:155: assertion got status valid. [eva] tests/libc/string_c.c:156: assertion got status valid. [eva] computing for function strncpy <- test_strncpy <- main. Called from tests/libc/string_c.c:157. [eva] tests/libc/string_c.c:157: function strncpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:157: function strncpy: precondition 'room_nstring' got status valid. [eva] tests/libc/string_c.c:157: function strncpy: precondition 'separation' got status valid. [eva] share/libc/string.h:370: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva:alarm] share/libc/string.h:370: Warning: function strncpy, behavior partial: postcondition 'equal_prefix' got status unknown. [eva] Recording results for strncpy [eva] Done for function strncpy [eva] tests/libc/string_c.c:158: assertion got status valid. [eva] computing for function strncpy <- test_strncpy <- main. Called from tests/libc/string_c.c:159. [eva] tests/libc/string_c.c:159: function strncpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:159: function strncpy: precondition 'room_nstring' got status valid. [eva] tests/libc/string_c.c:159: function strncpy: precondition 'separation' got status valid. [eva] Recording results for strncpy [eva] Done for function strncpy [eva] tests/libc/string_c.c:160: assertion got status valid. [eva] computing for function strncpy <- test_strncpy <- main. Called from tests/libc/string_c.c:161. [eva] tests/libc/string_c.c:161: function strncpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c.c:161: function strncpy: precondition 'room_nstring' got status valid. [eva] tests/libc/string_c.c:161: function strncpy: precondition 'separation' got status valid. [eva] Recording results for strncpy [eva] Done for function strncpy [eva] tests/libc/string_c.c:162: assertion got status valid. [eva] Recording results for test_strncpy [eva] Done for function test_strncpy [eva] computing for function test_strchr <- main. Called from tests/libc/string_c.c:293. [eva] computing for function strchr <- test_strchr <- main. Called from tests/libc/string_c.c:201. [eva] tests/libc/string_c.c:201: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.h:161: function strchr, behavior found: postcondition 'result_char' got status valid. [eva] share/libc/string.h:162: function strchr, behavior found: postcondition 'result_same_base' got status valid. [eva] share/libc/string.h:163: function strchr, behavior found: postcondition 'result_in_length' got status valid. [eva] share/libc/string.h:164: function strchr, behavior found: postcondition 'result_valid_string' got status valid. [eva:alarm] share/libc/string.h:165: Warning: function strchr, behavior found: postcondition 'result_first_occur' got status unknown. [eva] share/libc/string.h:171: function strchr, behavior default: postcondition 'result_null_or_same_base' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] tests/libc/string_c.c:202: assertion got status valid. [eva] computing for function strchr <- test_strchr <- main. Called from tests/libc/string_c.c:203. [eva] tests/libc/string_c.c:203: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.h:168: function strchr, behavior not_found: postcondition 'result_null' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] tests/libc/string_c.c:204: assertion got status valid. [eva] computing for function strchr <- test_strchr <- main. Called from tests/libc/string_c.c:205. [eva] tests/libc/string_c.c:205: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] tests/libc/string_c.c:206: assertion got status valid. [eva] computing for function strchr <- test_strchr <- main. Called from tests/libc/string_c.c:207. [eva] tests/libc/string_c.c:207: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] tests/libc/string_c.c:208: assertion got status valid. [eva] Recording results for test_strchr [eva] Done for function test_strchr [eva] computing for function test_strrchr <- main. Called from tests/libc/string_c.c:294. [eva] computing for function strrchr <- test_strrchr <- main. Called from tests/libc/string_c.c:214. [eva] tests/libc/string_c.c:214: function strrchr: precondition 'valid_string_s' got status valid. [eva] computing for function strlen <- strrchr <- test_strrchr <- main. Called from share/libc/string.c:237. [eva] share/libc/string.c:237: function strlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strlen [eva] Done for function strlen [eva] share/libc/string.h:179: function strrchr, behavior found: postcondition 'result_char' got status valid. [eva] share/libc/string.h:180: function strrchr, behavior found: postcondition 'result_same_base' got status valid. [eva] share/libc/string.h:181: function strrchr, behavior found: postcondition 'result_valid_string' got status valid. [eva] share/libc/string.h:187: function strrchr, behavior default: postcondition 'result_null_or_same_base' got status valid. [eva] Recording results for strrchr [eva] Done for function strrchr [eva] tests/libc/string_c.c:215: assertion got status valid. [eva] computing for function strrchr <- test_strrchr <- main. Called from tests/libc/string_c.c:216. [eva] tests/libc/string_c.c:216: function strrchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.c:237: Reusing old results for call to strlen [eva] share/libc/string.h:184: function strrchr, behavior not_found: postcondition 'result_null' got status valid. [eva] Recording results for strrchr [eva] Done for function strrchr [eva] tests/libc/string_c.c:217: assertion got status valid. [eva] computing for function strrchr <- test_strrchr <- main. Called from tests/libc/string_c.c:218. [eva] tests/libc/string_c.c:218: function strrchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.c:237: Reusing old results for call to strlen [eva] Recording results for strrchr [eva] Done for function strrchr [eva] tests/libc/string_c.c:219: assertion got status valid. [eva] computing for function strrchr <- test_strrchr <- main. Called from tests/libc/string_c.c:220. [eva] tests/libc/string_c.c:220: function strrchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.c:237: Reusing old results for call to strlen [eva] Recording results for strrchr [eva] Done for function strrchr [eva] tests/libc/string_c.c:221: assertion got status valid. [eva] Recording results for test_strrchr [eva] Done for function test_strrchr [eva] computing for function test_memchr <- main. Called from tests/libc/string_c.c:295. [eva] computing for function memchr <- test_memchr <- main. Called from tests/libc/string_c.c:227. [eva] tests/libc/string_c.c:227: function memchr: precondition 'valid' got status valid. [eva] tests/libc/string_c.c:227: function memchr: precondition 'initialization' got status valid. [eva] tests/libc/string_c.c:227: function memchr: precondition 'danglingness' got status valid. [eva] share/libc/string.h:78: cannot evaluate ACSL term, unsupported ACSL construct: logic function memchr [eva] share/libc/string.h:85: cannot evaluate ACSL term, unsupported ACSL construct: logic function memchr [eva] share/libc/string.h:79: function memchr, behavior found: postcondition 'result_same_base' got status valid. (Behavior may be inactive, no reduction performed.) [eva] share/libc/string.h:80: function memchr, behavior found: postcondition 'result_char' got status valid. (Behavior may be inactive, no reduction performed.) [eva:alarm] share/libc/string.h:81: Warning: function memchr, behavior found: postcondition 'result_in_str' got status unknown. (Behavior may be inactive, no reduction performed.) [eva:alarm] share/libc/string.h:86: Warning: function memchr, behavior not_found: postcondition 'result_null' got status invalid. (Behavior may be inactive, no reduction performed.) [eva] Recording results for memchr [eva] Done for function memchr [eva] tests/libc/string_c.c:228: assertion got status valid. [eva] computing for function memchr <- test_memchr <- main. Called from tests/libc/string_c.c:229. [eva] tests/libc/string_c.c:229: function memchr: precondition 'valid' got status valid. [eva] tests/libc/string_c.c:229: function memchr: precondition 'initialization' got status valid. [eva] tests/libc/string_c.c:229: function memchr: precondition 'danglingness' got status valid. [eva:alarm] share/libc/string.h:79: Warning: function memchr, behavior found: postcondition 'result_same_base' got status invalid. (Behavior may be inactive, no reduction performed.) [eva:alarm] share/libc/string.h:80: Warning: function memchr, behavior found: postcondition 'result_char' got status unknown. (Behavior may be inactive, no reduction performed.) [eva] share/libc/string.h:86: function memchr, behavior not_found: postcondition 'result_null' got status valid. (Behavior may be inactive, no reduction performed.) [eva] Recording results for memchr [eva] Done for function memchr [eva] tests/libc/string_c.c:230: assertion got status valid. [eva] computing for function memchr <- test_memchr <- main. Called from tests/libc/string_c.c:231. [eva] tests/libc/string_c.c:231: function memchr: precondition 'valid' got status valid. [eva] tests/libc/string_c.c:231: function memchr: precondition 'initialization' got status valid. [eva] tests/libc/string_c.c:231: function memchr: precondition 'danglingness' got status valid. [eva] Recording results for memchr [eva] Done for function memchr [eva] tests/libc/string_c.c:232: assertion got status valid. [eva] computing for function memchr <- test_memchr <- main. Called from tests/libc/string_c.c:233. [eva] tests/libc/string_c.c:233: function memchr: precondition 'valid' got status valid. [eva] tests/libc/string_c.c:233: function memchr: precondition 'initialization' got status valid. [eva] tests/libc/string_c.c:233: function memchr: precondition 'danglingness' got status valid. [eva] Recording results for memchr [eva] Done for function memchr [eva] tests/libc/string_c.c:234: assertion got status valid. [eva] computing for function memchr <- test_memchr <- main. Called from tests/libc/string_c.c:235. [eva] tests/libc/string_c.c:235: function memchr: precondition 'valid' got status valid. [eva] tests/libc/string_c.c:235: function memchr: precondition 'initialization' got status valid. [eva] tests/libc/string_c.c:235: function memchr: precondition 'danglingness' got status valid. [eva] Recording results for memchr [eva] Done for function memchr [eva] tests/libc/string_c.c:236: assertion got status valid. [eva] computing for function memchr <- test_memchr <- main. Called from tests/libc/string_c.c:237. [eva] tests/libc/string_c.c:237: function memchr: precondition 'valid' got status valid. [eva] tests/libc/string_c.c:237: function memchr: precondition 'initialization' got status valid. [eva] tests/libc/string_c.c:237: function memchr: precondition 'danglingness' got status valid. [eva] Recording results for memchr [eva] Done for function memchr [eva] tests/libc/string_c.c:238: assertion got status valid. [eva] Recording results for test_memchr [eva] Done for function test_memchr [eva] computing for function test_memrchr <- main. Called from tests/libc/string_c.c:296. [eva] computing for function memrchr <- test_memrchr <- main. Called from tests/libc/string_c.c:244. [eva] Recording results for memrchr [eva] Done for function memrchr [eva] tests/libc/string_c.c:245: assertion got status valid. [eva] computing for function memrchr <- test_memrchr <- main. Called from tests/libc/string_c.c:246. [eva] Recording results for memrchr [eva] Done for function memrchr [eva] tests/libc/string_c.c:247: assertion got status valid. [eva] computing for function memrchr <- test_memrchr <- main. Called from tests/libc/string_c.c:248. [eva] Recording results for memrchr [eva] Done for function memrchr [eva] tests/libc/string_c.c:249: assertion got status valid. [eva] computing for function memrchr <- test_memrchr <- main. Called from tests/libc/string_c.c:250. [eva] Recording results for memrchr [eva] Done for function memrchr [eva] tests/libc/string_c.c:251: assertion got status valid. [eva] computing for function memrchr <- test_memrchr <- main. Called from tests/libc/string_c.c:252. [eva] Recording results for memrchr [eva] Done for function memrchr [eva] tests/libc/string_c.c:253: assertion got status valid. [eva] computing for function memrchr <- test_memrchr <- main. Called from tests/libc/string_c.c:254. [eva] Recording results for memrchr [eva] Done for function memrchr [eva] tests/libc/string_c.c:255: assertion got status valid. [eva] Recording results for test_memrchr [eva] Done for function test_memrchr [eva] computing for function test_strstr <- main. Called from tests/libc/string_c.c:297. [eva] computing for function strstr <- test_strstr <- main. Called from tests/libc/string_c.c:261. [eva] tests/libc/string_c.c:261: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c.c:261: function strstr: precondition 'valid_string_needle' got status valid. [eva] share/libc/string.h:221: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva:alarm] share/libc/string.h:219: Warning: function strstr: postcondition 'result_null_or_in_haystack' got status unknown. [eva] Recording results for strstr [eva] Done for function strstr [eva] tests/libc/string_c.c:262: assertion got status valid. [eva] computing for function strstr <- test_strstr <- main. Called from tests/libc/string_c.c:263. [eva] tests/libc/string_c.c:263: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c.c:263: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] tests/libc/string_c.c:264: assertion got status valid. [eva] computing for function strstr <- test_strstr <- main. Called from tests/libc/string_c.c:265. [eva] tests/libc/string_c.c:265: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c.c:265: function strstr: precondition 'valid_string_needle' got status valid. [eva] share/libc/string.h:219: function strstr: postcondition 'result_null_or_in_haystack' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] tests/libc/string_c.c:266: assertion got status valid. [eva] computing for function strstr <- test_strstr <- main. Called from tests/libc/string_c.c:267. [eva] tests/libc/string_c.c:267: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c.c:267: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] tests/libc/string_c.c:268: assertion got status valid. [eva] computing for function strstr <- test_strstr <- main. Called from tests/libc/string_c.c:269. [eva] tests/libc/string_c.c:269: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c.c:269: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] tests/libc/string_c.c:270: assertion got status valid. [eva] computing for function strstr <- test_strstr <- main. Called from tests/libc/string_c.c:271. [eva] tests/libc/string_c.c:271: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c.c:271: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] tests/libc/string_c.c:272: assertion got status valid. [eva] computing for function strstr <- test_strstr <- main. Called from tests/libc/string_c.c:273. [eva] tests/libc/string_c.c:273: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c.c:273: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] tests/libc/string_c.c:274: assertion got status valid. [eva] computing for function strstr <- test_strstr <- main. Called from tests/libc/string_c.c:275. [eva] tests/libc/string_c.c:275: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c.c:275: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] tests/libc/string_c.c:276: assertion got status valid. [eva] Recording results for test_strstr [eva] Done for function test_strstr [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function memchr: ch ∈ {1; 2; 5} ss ∈ {{ (unsigned char const *)&s }} __retres ∈ {{ NULL ; (void *)&s{[0], [1]} }} [eva:final-states] Values at end of function memcmp: p1 ∈ {{ "hallo" ; "hallo" ; "a\000b" ; "a\000b" }} p2 ∈ {{ (unsigned char const *)&hello ; "a\000c" ; "a\000c" }} __retres ∈ {-4; -1; 0} [eva:final-states] Values at end of function memcpy: dest[0] ∈ {65; 97; 104} [1] ∈ {0; 56; 101} [2] ∈ {9; 98; 108} [3] ∈ {0; 18; 108} [4] ∈ {0; 111} [5] ∈ {0} [eva:final-states] Values at end of function memoverlap: p1 ∈ {{ (unsigned int)&buf{[0], [2], [3]} }} p2 ∈ {{ (unsigned int)&buf{[4], [6]} }} q1 ∈ {{ (unsigned int)&buf{[0], [2]} }} q2 ∈ {{ (unsigned int)&buf{[3], [4], [6]} }} __retres ∈ {-1; 0; 1} [eva:final-states] Values at end of function memmove: s ∈ {{ &buf{[0], [2]} }} d ∈ {{ &buf{[0], [2], [3]} }} buf[0] ∈ {1; 3} [1] ∈ {2; 4} [2] ∈ {1; 5} [3] ∈ {2; 3; 6} [4] ∈ {3; 4; 5} [5] ∈ {4; 5; 6} __retres ∈ {{ (void *)&buf{[0], [2], [3]} }} [eva:final-states] Values at end of function memrchr: ch ∈ {1; 2; 5} ss ∈ {{ (unsigned char const *)&s }} __retres ∈ {{ NULL ; (void *)&s{[0], [3], [4]} }} [eva:final-states] Values at end of function memset: p ∈ {{ (unsigned char *)&dest }} dest[0..2] ∈ {42} [3] ∈ {0} [eva:final-states] Values at end of function strchr: ch ∈ {0; 72; 104; 108} i ∈ {0; 2; 5} __retres ∈ {{ NULL ; "hello" + {0; 2; 5} }} [eva:final-states] Values at end of function strcmp: i ∈ {0; 1; 4; 5} __retres ∈ {-111; -104; -32; 0; 111} [eva:final-states] Values at end of function strcpy: i ∈ {0; 5; 6} s[0] ∈ {0; 54; 104} [1] ∈ {53; 101} [2] ∈ {52; 108} [3] ∈ {51; 108} [4] ∈ {50; 111} [5] ∈ {0; 49} [6] ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function strlen: i ∈ {0; 2; 4; 5; 7} [eva:final-states] Values at end of function strcat: i ∈ {0; 1; 3; 5} n ∈ {0; 4; 7} s[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {104; 111} [5] ∈ {0; 101} [6] ∈ {108} or UNINITIALIZED [7] ∈ {0; 120} or UNINITIALIZED [8] ∈ {0} or UNINITIALIZED [9] ∈ UNINITIALIZED [eva:final-states] Values at end of function strncmp: __retres ∈ {-104; -4; 0; 111} [eva:final-states] Values at end of function strncpy: i ∈ {0; 3; 5; 7} s[0] ∈ {97; 98; 104} [1] ∈ {98; 101; 121} [2] ∈ {0; 101; 108} [3] ∈ {0; 108} [4] ∈ {0; 111} [5..6] ∈ {0} [eva:final-states] Values at end of function strnlen: i ∈ {0; 2; 4; 5} [eva:final-states] Values at end of function strrchr: ch ∈ {0; 72; 104; 108} __retres ∈ {{ NULL ; "hello" + {0; 3; 5} }} [eva:final-states] Values at end of function strstr: __retres ∈ {{ NULL ; "hello" + {0; 2; 3} }} [eva:final-states] Values at end of function test_memchr: s[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {1} [4] ∈ {2} [5] ∈ {4} p ∈ {{ &s[0] }} [eva:final-states] Values at end of function test_memcmp: hello[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} res1 ∈ {-4} res2 ∈ {0} res3 ∈ {0} res4 ∈ {-1} [eva:final-states] Values at end of function test_memcpy: dest[0] ∈ {65} [1] ∈ {56} [2] ∈ {9} [3] ∈ {18} [4..5] ∈ {0} src[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} p ∈ {{ NULL ; &dest[0] }} src2[0] ∈ {97} [1] ∈ {0} [2] ∈ {98} [3..4] ∈ {0} x ∈ {302594113} [eva:final-states] Values at end of function test_memmove: buf[0] ∈ {3} [1] ∈ {4} [2] ∈ {5} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} s ∈ {{ &buf[0] }} d ∈ {{ &buf[3] }} p ∈ {{ &buf[2] }} [eva:final-states] Values at end of function test_memrchr: s[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {1} [4] ∈ {2} [5] ∈ {4} p ∈ {{ &s[0] }} [eva:final-states] Values at end of function test_memset: dest[0..2] ∈ {42} [3] ∈ {0} p ∈ {{ &dest[0] }} [eva:final-states] Values at end of function test_strcat: s[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {104} [5] ∈ {101} [6] ∈ {108} [7] ∈ {120} [8] ∈ {0} [9] ∈ UNINITIALIZED p ∈ {{ &s[0] }} [eva:final-states] Values at end of function test_strchr: s ∈ {{ "hello" }} p ∈ {{ "hello" + {5} }} [eva:final-states] Values at end of function test_strcmp: hello[0] ∈ {104} [1] ∈ {97} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} res ∈ {0} res2 ∈ {-111} res3 ∈ {111} res4 ∈ {-32} res5 ∈ {-104} res6 ∈ {0} res7 ∈ {0} [eva:final-states] Values at end of function test_strcpy: s[0] ∈ {0} [1] ∈ {53} [2] ∈ {52} [3] ∈ {51} [4] ∈ {50} [5] ∈ {49} [6] ∈ {0} p ∈ {{ &s[0] }} [eva:final-states] Values at end of function test_strlen: s ∈ {{ "hello" }} n ∈ {0} [eva:final-states] Values at end of function test_strncmp: hello[0] ∈ {104} [1] ∈ {97} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} res1 ∈ {-4} res2 ∈ {0} res3 ∈ {0} res4 ∈ {111} res5 ∈ {0} res6 ∈ {-104} res7 ∈ {0} res8 ∈ {0} [eva:final-states] Values at end of function test_strncpy: s[0] ∈ {97} [1] ∈ {98} [2..6] ∈ {0} p ∈ {{ &s[0] }} [eva:final-states] Values at end of function test_strnlen: s ∈ {{ "hello" }} n ∈ {0} [eva:final-states] Values at end of function test_strrchr: s ∈ {{ "hello" }} p ∈ {{ "hello" + {5} }} [eva:final-states] Values at end of function test_strstr: s ∈ {{ "hello" }} p ∈ {{ "hello" }} [eva:final-states] Values at end of function main: __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/string_c_generic.res.oracle0000666000000000000000000004454413571573400022031 0ustar [kernel] Parsing tests/libc/string_c_generic.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function strcpy <- main. Called from tests/libc/string_c_generic.c:56. [eva] tests/libc/string_c_generic.c:56: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:56: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c_generic.c:56: function strcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:351: cannot evaluate ACSL term, unsupported ACSL construct: logic function strcmp [eva:alarm] share/libc/string.h:351: Warning: function strcpy: postcondition 'equal_contents' got status unknown. [eva] share/libc/string.h:352: function strcpy: postcondition 'result_ptr' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strcmp <- main. Called from tests/libc/string_c_generic.c:57. [eva] tests/libc/string_c_generic.c:57: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:57: function strcmp: precondition 'valid_string_s2' got status valid. [eva] share/libc/string.h:140: cannot evaluate ACSL term, unsupported ACSL construct: logic function strcmp [eva:alarm] share/libc/string.h:140: Warning: function strcmp: postcondition 'acsl_c_equiv' got status unknown. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] computing for function strcpy <- main. Called from tests/libc/string_c_generic.c:58. [eva] tests/libc/string_c_generic.c:58: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:58: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c_generic.c:58: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strcmp <- main. Called from tests/libc/string_c_generic.c:59. [eva] tests/libc/string_c_generic.c:59: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:59: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] computing for function strcpy <- main. Called from tests/libc/string_c_generic.c:60. [eva] tests/libc/string_c_generic.c:60: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:60: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c_generic.c:60: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strcmp <- main. Called from tests/libc/string_c_generic.c:61. [eva] tests/libc/string_c_generic.c:61: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:61: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] computing for function strcpy <- main. Called from tests/libc/string_c_generic.c:62. [eva] tests/libc/string_c_generic.c:62: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:62: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c_generic.c:62: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strcmp <- main. Called from tests/libc/string_c_generic.c:63. [eva] tests/libc/string_c_generic.c:63: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:63: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] computing for function strcpy <- main. Called from tests/libc/string_c_generic.c:65. [eva] tests/libc/string_c_generic.c:65: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:65: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c_generic.c:65: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strcmp <- main. Called from tests/libc/string_c_generic.c:66. [eva] tests/libc/string_c_generic.c:66: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:66: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] computing for function strcpy <- main. Called from tests/libc/string_c_generic.c:67. [eva] tests/libc/string_c_generic.c:67: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:67: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c_generic.c:67: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strcmp <- main. Called from tests/libc/string_c_generic.c:68. [eva] tests/libc/string_c_generic.c:68: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:68: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] computing for function strcpy <- main. Called from tests/libc/string_c_generic.c:69. [eva] tests/libc/string_c_generic.c:69: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:69: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c_generic.c:69: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strcmp <- main. Called from tests/libc/string_c_generic.c:70. [eva] tests/libc/string_c_generic.c:70: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:70: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] computing for function memset <- main. Called from tests/libc/string_c_generic.c:72. [eva] tests/libc/string_c_generic.c:72: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva:alarm] share/libc/string.h:118: Warning: function memset: postcondition 'acsl_c_equiv' got status unknown. [eva] share/libc/string.h:119: function memset: postcondition 'result_ptr' got status valid. [eva] Recording results for memset [eva] Done for function memset [eva] computing for function strncpy <- main. Called from tests/libc/string_c_generic.c:73. [eva] tests/libc/string_c_generic.c:73: function strncpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:73: function strncpy: precondition 'room_nstring' got status valid. [eva] tests/libc/string_c_generic.c:73: function strncpy: precondition 'separation' got status valid. [eva] share/libc/string.c:220: starting to merge loop iterations [eva] share/libc/string.h:363: function strncpy: postcondition 'result_ptr' got status valid. [eva] share/libc/string.h:364: function strncpy: postcondition 'initialization' got status valid. [eva] share/libc/string.h:367: cannot evaluate ACSL term, unsupported ACSL construct: logic function strcmp [eva:alarm] share/libc/string.h:367: Warning: function strncpy, behavior complete: postcondition 'equal_after_copy' got status unknown. [eva] Recording results for strncpy [eva] Done for function strncpy [eva] computing for function memcmp <- main. Called from tests/libc/string_c_generic.c:74. [eva] tests/libc/string_c_generic.c:74: function memcmp: precondition 'valid_s1' got status valid. [eva] tests/libc/string_c_generic.c:74: function memcmp: precondition 'valid_s2' got status valid. [eva] tests/libc/string_c_generic.c:74: function memcmp: precondition 'initialization,s1' got status valid. [eva] tests/libc/string_c_generic.c:74: function memcmp: precondition 'initialization,s2' got status valid. [eva] tests/libc/string_c_generic.c:74: function memcmp: precondition 'danglingness,s1' got status valid. [eva] tests/libc/string_c_generic.c:74: function memcmp: precondition 'danglingness,s2' got status valid. [eva] share/libc/string.h:63: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva:alarm] share/libc/string.h:63: Warning: function memcmp: postcondition 'logic_spec' got status unknown. [eva] Recording results for memcmp [eva] Done for function memcmp [eva] computing for function strncpy <- main. Called from tests/libc/string_c_generic.c:78. [eva] tests/libc/string_c_generic.c:78: function strncpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:78: function strncpy: precondition 'room_nstring' got status valid. [eva] tests/libc/string_c_generic.c:78: function strncpy: precondition 'separation' got status valid. [eva] share/libc/string.h:370: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva:alarm] share/libc/string.h:370: Warning: function strncpy, behavior partial: postcondition 'equal_prefix' got status unknown. [eva] Recording results for strncpy [eva] Done for function strncpy [eva] computing for function strncmp <- main. Called from tests/libc/string_c_generic.c:82. [eva] tests/libc/string_c_generic.c:82: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:82: function strncmp: precondition 'valid_string_s2' got status valid. [eva] share/libc/string.c:138: starting to merge loop iterations [eva] share/libc/string.h:147: cannot evaluate ACSL term, unsupported ACSL construct: logic function strncmp [eva:alarm] share/libc/string.h:147: Warning: function strncmp: postcondition 'acsl_c_equiv' got status unknown. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] computing for function strncmp <- main. Called from tests/libc/string_c_generic.c:83. [eva] tests/libc/string_c_generic.c:83: function strncmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:83: function strncmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strncmp [eva] Done for function strncmp [eva] computing for function strcpy <- main. Called from tests/libc/string_c_generic.c:85. [eva] tests/libc/string_c_generic.c:85: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:85: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c_generic.c:85: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strncat <- main. Called from tests/libc/string_c_generic.c:86. [eva] tests/libc/string_c_generic.c:86: function strncat: precondition 'valid_nstring_src' got status valid. [eva] tests/libc/string_c_generic.c:86: function strncat: precondition 'valid_string_dest' got status valid. [eva] tests/libc/string_c_generic.c:86: function strncat, behavior partial: precondition 'room_string' got status valid. [eva] computing for function strlen <- strncat <- main. Called from share/libc/string.c:193. [eva] share/libc/string.c:193: function strlen: precondition 'valid_string_s' got status valid. [eva] share/libc/string.h:127: function strlen: postcondition 'acsl_c_equiv' got status valid. [eva] Recording results for strlen [eva] Done for function strlen [eva] share/libc/string.h:419: function strncat: postcondition 'result_ptr' got status valid. [eva] share/libc/string.h:434: function strncat, behavior partial: postcondition 'sum_of_bounded_lengths' got status valid. [eva] Recording results for strncat [eva] Done for function strncat [eva] computing for function strcmp <- main. Called from tests/libc/string_c_generic.c:88. [eva] tests/libc/string_c_generic.c:88: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_c_generic.c:88: function strcmp: precondition 'valid_string_s2' got status valid. [eva] Recording results for strcmp [eva] Done for function strcmp [eva] computing for function strcpy <- main. Called from tests/libc/string_c_generic.c:90. [eva] tests/libc/string_c_generic.c:90: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_c_generic.c:90: function strcpy: precondition 'room_string' got status valid. [eva] tests/libc/string_c_generic.c:90: function strcpy: precondition 'separation' got status valid. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strchr <- main. Called from tests/libc/string_c_generic.c:91. [eva] tests/libc/string_c_generic.c:91: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.h:161: function strchr, behavior found: postcondition 'result_char' got status valid. [eva] share/libc/string.h:162: function strchr, behavior found: postcondition 'result_same_base' got status valid. [eva] share/libc/string.h:163: function strchr, behavior found: postcondition 'result_in_length' got status valid. [eva] share/libc/string.h:164: function strchr, behavior found: postcondition 'result_valid_string' got status valid. [eva:alarm] share/libc/string.h:165: Warning: function strchr, behavior found: postcondition 'result_first_occur' got status unknown. [eva] share/libc/string.h:171: function strchr, behavior default: postcondition 'result_null_or_same_base' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_generic.c:92. [eva] tests/libc/string_c_generic.c:92: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.h:168: function strchr, behavior not_found: postcondition 'result_null' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strrchr <- main. Called from tests/libc/string_c_generic.c:93. [eva] tests/libc/string_c_generic.c:93: function strrchr: precondition 'valid_string_s' got status valid. [eva] computing for function strlen <- strrchr <- main. Called from share/libc/string.c:237. [eva] share/libc/string.c:237: function strlen: precondition 'valid_string_s' got status valid. [eva] Recording results for strlen [eva] Done for function strlen [eva] share/libc/string.h:179: function strrchr, behavior found: postcondition 'result_char' got status valid. [eva] share/libc/string.h:180: function strrchr, behavior found: postcondition 'result_same_base' got status valid. [eva] share/libc/string.h:181: function strrchr, behavior found: postcondition 'result_valid_string' got status valid. [eva] share/libc/string.h:187: function strrchr, behavior default: postcondition 'result_null_or_same_base' got status valid. [eva] Recording results for strrchr [eva] Done for function strrchr [eva] computing for function strrchr <- main. Called from tests/libc/string_c_generic.c:94. [eva] tests/libc/string_c_generic.c:94: function strrchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.c:237: Reusing old results for call to strlen [eva] share/libc/string.c:237: starting to merge loop iterations [eva] share/libc/string.h:184: function strrchr, behavior not_found: postcondition 'result_null' got status valid. [eva] Recording results for strrchr [eva] Done for function strrchr [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function memcmp: p1 ∈ {{ (unsigned char const *)&b }} p2 ∈ {{ "abc\000\000\000\000" }} __retres ∈ {0} [eva:final-states] Values at end of function memset: p ∈ {{ (unsigned char *)&b }} b[0..31] ∈ {120} [eva:final-states] Values at end of function strchr: ch ∈ {98; 101} i ∈ {3; 20} __retres ∈ {{ NULL ; &b[3] }} [eva:final-states] Values at end of function strcmp: i ∈ {0; 1; 2; 3; 6} __retres ∈ {0} [eva:final-states] Values at end of function strcpy: i ∈ {0; 1; 2; 3; 20} b[0] ∈ {97} [1] ∈ {97; 98} [2] ∈ {97; 98; 99} [3] ∈ {0; 97; 98; 99} [4] ∈ {0; 97; 98; 99} or UNINITIALIZED [5] ∈ {0; 98; 99} or UNINITIALIZED [6..7] ∈ {0; 99} or UNINITIALIZED [8..9] ∈ {0; 100; 120} or UNINITIALIZED [10..12] ∈ {0; 48; 120} or UNINITIALIZED [13..14] ∈ {0; 49; 120} or UNINITIALIZED [15] ∈ {0; 50; 120} or UNINITIALIZED [16] ∈ {0; 50; 97; 120} [17] ∈ {0; 50; 98; 120} [18] ∈ {0; 50; 99; 120} [19] ∈ {0; 51; 120} [20..30] ∈ {0; 120} or UNINITIALIZED [31] ∈ {120} or UNINITIALIZED [eva:final-states] Values at end of function strlen: i ∈ {3; 20} [eva:final-states] Values at end of function strncat: dest_len ∈ {3} i ∈ {3} b[0] ∈ {97} [1] ∈ {98} [2] ∈ {99} [3] ∈ {49} [4] ∈ {50} [5] ∈ {51} [6..7] ∈ {0} [8..30] ∈ {0; 120} [31] ∈ {120} [eva:final-states] Values at end of function strncmp: __retres ∈ {-1; 0} [eva:final-states] Values at end of function strncpy: i ∈ [3..2147483647] b[0] ∈ {97} [1] ∈ {98} [2] ∈ {99} [3] ∈ {0; 120} [4..7] ∈ {0} [8..30] ∈ {0; 120} [31] ∈ {120} [eva:final-states] Values at end of function strrchr: ch ∈ {98; 101} __retres ∈ {{ NULL ; &b[5] }} [eva:final-states] Values at end of function main: b[0..2] ∈ {97} [3] ∈ {98} [4] ∈ {97} [5] ∈ {98} [6..7] ∈ {99} [8..9] ∈ {100} [10..12] ∈ {48} [13..14] ∈ {49} [15..18] ∈ {50} [19] ∈ {51} [20] ∈ {0} [21..30] ∈ {0; 120} [31] ∈ {120} s ∈ {0} i ∈ {0} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/string_c_strchr.res.oracle0000666000000000000000000003655213571573400021722 0ustar [kernel] Parsing tests/libc/string_c_strchr.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/libc/string_c_strchr.c:57: Trace partitioning superposing up to 100 states [eva] tests/libc/string_c_strchr.c:59: Trace partitioning superposing up to 200 states [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:62. [eva] tests/libc/string_c_strchr.c:62: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.h:168: function strchr, behavior not_found: postcondition 'result_null' got status valid. [eva] share/libc/string.h:171: function strchr, behavior default: postcondition 'result_null_or_same_base' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:63. [eva] tests/libc/string_c_strchr.c:63: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:64. [eva] tests/libc/string_c_strchr.c:64: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:65. [eva] tests/libc/string_c_strchr.c:65: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:66. [eva] tests/libc/string_c_strchr.c:66: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:67. [eva] tests/libc/string_c_strchr.c:67: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.c:229: Trace partitioning superposing up to 100 states [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:68. [eva] tests/libc/string_c_strchr.c:68: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:70. [eva] tests/libc/string_c_strchr.c:70: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.h:161: function strchr, behavior found: postcondition 'result_char' got status valid. [eva] share/libc/string.h:162: function strchr, behavior found: postcondition 'result_same_base' got status valid. [eva] share/libc/string.h:163: function strchr, behavior found: postcondition 'result_in_length' got status valid. [eva] share/libc/string.h:164: function strchr, behavior found: postcondition 'result_valid_string' got status valid. [eva:alarm] share/libc/string.h:165: Warning: function strchr, behavior found: postcondition 'result_first_occur' got status unknown. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:71. [eva] tests/libc/string_c_strchr.c:71: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:72. [eva] tests/libc/string_c_strchr.c:72: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:73. [eva] tests/libc/string_c_strchr.c:73: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:74. [eva] tests/libc/string_c_strchr.c:74: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:75. [eva] tests/libc/string_c_strchr.c:75: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:76. [eva] tests/libc/string_c_strchr.c:76: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:77. [eva] tests/libc/string_c_strchr.c:77: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:78. [eva] tests/libc/string_c_strchr.c:78: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:79. [eva] tests/libc/string_c_strchr.c:79: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:80. [eva] tests/libc/string_c_strchr.c:80: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:81. [eva] tests/libc/string_c_strchr.c:81: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:82. [eva] tests/libc/string_c_strchr.c:82: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:83. [eva] tests/libc/string_c_strchr.c:83: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:84. [eva] tests/libc/string_c_strchr.c:84: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:85. [eva] tests/libc/string_c_strchr.c:85: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:86. [eva] tests/libc/string_c_strchr.c:86: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:87. [eva] tests/libc/string_c_strchr.c:87: function strchr: precondition 'valid_string_s' got status valid. [eva] share/libc/string.c:229: Trace partitioning superposing up to 200 states [eva] Recording results for strchr [eva] Done for function strchr [eva] computing for function strchr <- main. Called from tests/libc/string_c_strchr.c:88. [eva] tests/libc/string_c_strchr.c:88: function strchr: precondition 'valid_string_s' got status valid. [eva] Recording results for strchr [eva] Done for function strchr [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function strchr: ch ∈ [--..--] i ∈ [0..255] __retres ∈ {{ NULL ; &s{[0], [1], [9], [10], [126], [127], [254], [255]} ; "" ; "a" ; "a" ; "a" + {1} ; "abb" + {1} ; "aabb" + {2} ; "aaabb" + {3} ; "aaaabb" + {4} ; "aaaaabb" + {5} ; "aaaaaabb" + {6} ; "abc abc" + {2} }} [eva:final-states] Values at end of function main: i ∈ {256} a[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} [10] ∈ {11} [11] ∈ {12} [12] ∈ {13} [13] ∈ {14} [14] ∈ {15} [15] ∈ {16} [16] ∈ {17} [17] ∈ {18} [18] ∈ {19} [19] ∈ {20} [20] ∈ {21} [21] ∈ {22} [22] ∈ {23} [23] ∈ {24} [24] ∈ {25} [25] ∈ {26} [26] ∈ {27} [27] ∈ {28} [28] ∈ {29} [29] ∈ {30} [30] ∈ {31} [31] ∈ {32} [32] ∈ {33} [33] ∈ {34} [34] ∈ {35} [35] ∈ {36} [36] ∈ {37} [37] ∈ {38} [38] ∈ {39} [39] ∈ {40} [40] ∈ {41} [41] ∈ {42} [42] ∈ {43} [43] ∈ {44} [44] ∈ {45} [45] ∈ {46} [46] ∈ {47} [47] ∈ {48} [48] ∈ {49} [49] ∈ {50} [50] ∈ {51} [51] ∈ {52} [52] ∈ {53} [53] ∈ {54} [54] ∈ {55} [55] ∈ {56} [56] ∈ {57} [57] ∈ {58} [58] ∈ {59} [59] ∈ {60} [60] ∈ {61} [61] ∈ {62} [62] ∈ {63} [63] ∈ {64} [64] ∈ {65} [65] ∈ {66} [66] ∈ {67} [67] ∈ {68} [68] ∈ {69} [69] ∈ {70} [70] ∈ {71} [71] ∈ {72} [72] ∈ {73} [73] ∈ {74} [74] ∈ {75} [75] ∈ {76} [76] ∈ {77} [77] ∈ {78} [78] ∈ {79} [79] ∈ {80} [80] ∈ {81} [81] ∈ {82} [82] ∈ {83} [83] ∈ {84} [84] ∈ {85} [85] ∈ {86} [86] ∈ {87} [87] ∈ {88} [88] ∈ {89} [89] ∈ {90} [90] ∈ {91} [91] ∈ {92} [92] ∈ {93} [93] ∈ {94} [94] ∈ {95} [95] ∈ {96} [96] ∈ {97} [97] ∈ {98} [98] ∈ {99} [99] ∈ {100} [100] ∈ {101} [101] ∈ {102} [102] ∈ {103} [103] ∈ {104} [104] ∈ {105} [105] ∈ {106} [106] ∈ {107} [107] ∈ {108} [108] ∈ {109} [109] ∈ {110} [110] ∈ {111} [111] ∈ {112} [112] ∈ {113} [113] ∈ {114} [114] ∈ {115} [115] ∈ {116} [116] ∈ {117} [117] ∈ {118} [118] ∈ {119} [119] ∈ {120} [120] ∈ {121} [121] ∈ {122} [122] ∈ {123} [123] ∈ {124} [124] ∈ {125} [125] ∈ {126} [126] ∈ {127} [127] ∈ {0} s[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} [10] ∈ {11} [11] ∈ {12} [12] ∈ {13} [13] ∈ {14} [14] ∈ {15} [15] ∈ {16} [16] ∈ {17} [17] ∈ {18} [18] ∈ {19} [19] ∈ {20} [20] ∈ {21} [21] ∈ {22} [22] ∈ {23} [23] ∈ {24} [24] ∈ {25} [25] ∈ {26} [26] ∈ {27} [27] ∈ {28} [28] ∈ {29} [29] ∈ {30} [30] ∈ {31} [31] ∈ {32} [32] ∈ {33} [33] ∈ {34} [34] ∈ {35} [35] ∈ {36} [36] ∈ {37} [37] ∈ {38} [38] ∈ {39} [39] ∈ {40} [40] ∈ {41} [41] ∈ {42} [42] ∈ {43} [43] ∈ {44} [44] ∈ {45} [45] ∈ {46} [46] ∈ {47} [47] ∈ {48} [48] ∈ {49} [49] ∈ {50} [50] ∈ {51} [51] ∈ {52} [52] ∈ {53} [53] ∈ {54} [54] ∈ {55} [55] ∈ {56} [56] ∈ {57} [57] ∈ {58} [58] ∈ {59} [59] ∈ {60} [60] ∈ {61} [61] ∈ {62} [62] ∈ {63} [63] ∈ {64} [64] ∈ {65} [65] ∈ {66} [66] ∈ {67} [67] ∈ {68} [68] ∈ {69} [69] ∈ {70} [70] ∈ {71} [71] ∈ {72} [72] ∈ {73} [73] ∈ {74} [74] ∈ {75} [75] ∈ {76} [76] ∈ {77} [77] ∈ {78} [78] ∈ {79} [79] ∈ {80} [80] ∈ {81} [81] ∈ {82} [82] ∈ {83} [83] ∈ {84} [84] ∈ {85} [85] ∈ {86} [86] ∈ {87} [87] ∈ {88} [88] ∈ {89} [89] ∈ {90} [90] ∈ {91} [91] ∈ {92} [92] ∈ {93} [93] ∈ {94} [94] ∈ {95} [95] ∈ {96} [96] ∈ {97} [97] ∈ {98} [98] ∈ {99} [99] ∈ {100} [100] ∈ {101} [101] ∈ {102} [102] ∈ {103} [103] ∈ {104} [104] ∈ {105} [105] ∈ {106} [106] ∈ {107} [107] ∈ {108} [108] ∈ {109} [109] ∈ {110} [110] ∈ {111} [111] ∈ {112} [112] ∈ {113} [113] ∈ {114} [114] ∈ {115} [115] ∈ {116} [116] ∈ {117} [117] ∈ {118} [118] ∈ {119} [119] ∈ {120} [120] ∈ {121} [121] ∈ {122} [122] ∈ {123} [123] ∈ {124} [124] ∈ {125} [125] ∈ {126} [126] ∈ {127} [127] ∈ {128} [128] ∈ {129} [129] ∈ {130} [130] ∈ {131} [131] ∈ {132} [132] ∈ {133} [133] ∈ {134} [134] ∈ {135} [135] ∈ {136} [136] ∈ {137} [137] ∈ {138} [138] ∈ {139} [139] ∈ {140} [140] ∈ {141} [141] ∈ {142} [142] ∈ {143} [143] ∈ {144} [144] ∈ {145} [145] ∈ {146} [146] ∈ {147} [147] ∈ {148} [148] ∈ {149} [149] ∈ {150} [150] ∈ {151} [151] ∈ {152} [152] ∈ {153} [153] ∈ {154} [154] ∈ {155} [155] ∈ {156} [156] ∈ {157} [157] ∈ {158} [158] ∈ {159} [159] ∈ {160} [160] ∈ {161} [161] ∈ {162} [162] ∈ {163} [163] ∈ {164} [164] ∈ {165} [165] ∈ {166} [166] ∈ {167} [167] ∈ {168} [168] ∈ {169} [169] ∈ {170} [170] ∈ {171} [171] ∈ {172} [172] ∈ {173} [173] ∈ {174} [174] ∈ {175} [175] ∈ {176} [176] ∈ {177} [177] ∈ {178} [178] ∈ {179} [179] ∈ {180} [180] ∈ {181} [181] ∈ {182} [182] ∈ {183} [183] ∈ {184} [184] ∈ {185} [185] ∈ {186} [186] ∈ {187} [187] ∈ {188} [188] ∈ {189} [189] ∈ {190} [190] ∈ {191} [191] ∈ {192} [192] ∈ {193} [193] ∈ {194} [194] ∈ {195} [195] ∈ {196} [196] ∈ {197} [197] ∈ {198} [198] ∈ {199} [199] ∈ {200} [200] ∈ {201} [201] ∈ {202} [202] ∈ {203} [203] ∈ {204} [204] ∈ {205} [205] ∈ {206} [206] ∈ {207} [207] ∈ {208} [208] ∈ {209} [209] ∈ {210} [210] ∈ {211} [211] ∈ {212} [212] ∈ {213} [213] ∈ {214} [214] ∈ {215} [215] ∈ {216} [216] ∈ {217} [217] ∈ {218} [218] ∈ {219} [219] ∈ {220} [220] ∈ {221} [221] ∈ {222} [222] ∈ {223} [223] ∈ {224} [224] ∈ {225} [225] ∈ {226} [226] ∈ {227} [227] ∈ {228} [228] ∈ {229} [229] ∈ {230} [230] ∈ {231} [231] ∈ {232} [232] ∈ {233} [233] ∈ {234} [234] ∈ {235} [235] ∈ {236} [236] ∈ {237} [237] ∈ {238} [238] ∈ {239} [239] ∈ {240} [240] ∈ {241} [241] ∈ {242} [242] ∈ {243} [243] ∈ {244} [244] ∈ {245} [245] ∈ {246} [246] ∈ {247} [247] ∈ {248} [248] ∈ {249} [249] ∈ {250} [250] ∈ {251} [251] ∈ {252} [252] ∈ {253} [253] ∈ {254} [254] ∈ {255} [255] ∈ {0} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/string_c_strstr.res.oracle0000666000000000000000000003335313571573400021752 0ustar [kernel] Parsing tests/libc/string_c_strstr.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:52. [eva] tests/libc/string_c_strstr.c:52: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:52: function strstr: precondition 'valid_string_needle' got status valid. [eva] share/libc/string.h:219: function strstr: postcondition 'result_null_or_in_haystack' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:53. [eva] tests/libc/string_c_strstr.c:53: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:53: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:54. [eva] tests/libc/string_c_strstr.c:54: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:54: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:55. [eva] tests/libc/string_c_strstr.c:55: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:55: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:56. [eva] tests/libc/string_c_strstr.c:56: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:56: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:57. [eva] tests/libc/string_c_strstr.c:57: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:57: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:58. [eva] tests/libc/string_c_strstr.c:58: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:58: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:59. [eva] tests/libc/string_c_strstr.c:59: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:59: function strstr: precondition 'valid_string_needle' got status valid. [eva] share/libc/string.c:266: starting to merge loop iterations [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:60. [eva] tests/libc/string_c_strstr.c:60: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:60: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:61. [eva] tests/libc/string_c_strstr.c:61: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:61: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:62. [eva] tests/libc/string_c_strstr.c:62: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:62: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:64. [eva] tests/libc/string_c_strstr.c:64: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:64: function strstr: precondition 'valid_string_needle' got status valid. [eva] share/libc/string.h:221: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva:alarm] share/libc/string.h:219: Warning: function strstr: postcondition 'result_null_or_in_haystack' got status unknown. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:65. [eva] tests/libc/string_c_strstr.c:65: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:65: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:66. [eva] tests/libc/string_c_strstr.c:66: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:66: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:67. [eva] tests/libc/string_c_strstr.c:67: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:67: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:68. [eva] tests/libc/string_c_strstr.c:68: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:68: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:69. [eva] tests/libc/string_c_strstr.c:69: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:69: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:70. [eva] tests/libc/string_c_strstr.c:70: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:70: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:71. [eva] tests/libc/string_c_strstr.c:71: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:71: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:72. [eva] tests/libc/string_c_strstr.c:72: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:72: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:73. [eva] tests/libc/string_c_strstr.c:73: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:73: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:74. [eva] tests/libc/string_c_strstr.c:74: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:74: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:75. [eva] tests/libc/string_c_strstr.c:75: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:75: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:76. [eva] tests/libc/string_c_strstr.c:76: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:76: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:77. [eva] tests/libc/string_c_strstr.c:77: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:77: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:78. [eva] tests/libc/string_c_strstr.c:78: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:78: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:79. [eva] tests/libc/string_c_strstr.c:79: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:79: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:80. [eva] tests/libc/string_c_strstr.c:80: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:80: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:81. [eva] tests/libc/string_c_strstr.c:81: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:81: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:82. [eva] tests/libc/string_c_strstr.c:82: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:82: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:83. [eva] tests/libc/string_c_strstr.c:83: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:83: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:84. [eva] tests/libc/string_c_strstr.c:84: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:84: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] computing for function strstr <- main. Called from tests/libc/string_c_strstr.c:85. [eva] tests/libc/string_c_strstr.c:85: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_c_strstr.c:85: function strstr: precondition 'valid_string_needle' got status valid. [eva] Recording results for strstr [eva] Done for function strstr [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function strstr: __retres ∈ {{ NULL ; "" ; "abcd" ; "abcd" ; "abcd" + {1} ; "abcd" + {2} ; "abcd" + {3} ; "abcd" ; "abcd" + {1} ; "abcd" + {2} ; "ababa" + {1} ; "ababab" + {1} ; "abababa" + {1} ; "abababab" + {1} ; "ababababa" + {1} ; "abbababab" + {2} ; "abbababab" + {3} ; "abacabcabcab" + {4} ; "nanabanabanana" + {3} ; "nanabanabanana" + {4} ; "nanabanabanana" + {1} ; "nanabanabanana" + {8} ; "_ _\255_ _" + {2} }} [eva:final-states] Values at end of function main: __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/string_h.res.oracle0000666000000000000000000004146613571573400020342 0ustar [kernel] Parsing tests/libc/string_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function test_strcmp <- main. Called from tests/libc/string_h.c:112. [eva] computing for function strcmp <- test_strcmp <- main. Called from tests/libc/string_h.c:5. [eva] using specification for function strcmp [eva] tests/libc/string_h.c:5: function strcmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/string_h.c:5: function strcmp: precondition 'valid_string_s2' got status valid. [eva] share/libc/string.h:140: cannot evaluate ACSL term, unsupported ACSL construct: logic function strcmp [eva] Done for function strcmp [eva:alarm] tests/libc/string_h.c:6: Warning: assertion got status unknown. [eva] Recording results for test_strcmp [eva] Done for function test_strcmp [eva] computing for function test_strcat <- main. Called from tests/libc/string_h.c:113. [eva] computing for function strcat <- test_strcat <- main. Called from tests/libc/string_h.c:13. [eva] using specification for function strcat [eva] tests/libc/string_h.c:13: function strcat: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_h.c:13: function strcat: precondition 'valid_string_dest' got status valid. [eva] tests/libc/string_h.c:13: function strcat: precondition 'room_string' got status valid. [eva] Done for function strcat [eva] computing for function strcat <- test_strcat <- main. Called from tests/libc/string_h.c:16. [eva] tests/libc/string_h.c:16: function strcat: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_h.c:16: function strcat: precondition 'valid_string_dest' got status valid. [eva] tests/libc/string_h.c:16: function strcat: precondition 'room_string' got status valid. [eva] Done for function strcat [eva] Recording results for test_strcat [eva] Done for function test_strcat [eva] computing for function test_strstr <- main. Called from tests/libc/string_h.c:114. [eva] computing for function strstr <- test_strstr <- main. Called from tests/libc/string_h.c:24. [eva] using specification for function strstr [eva] tests/libc/string_h.c:24: function strstr: precondition 'valid_string_haystack' got status valid. [eva] tests/libc/string_h.c:24: function strstr: precondition 'valid_string_needle' got status valid. [eva] share/libc/string.h:221: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] Done for function strstr [eva:alarm] tests/libc/string_h.c:25: Warning: assertion got status unknown. [eva] Recording results for test_strstr [eva] Done for function test_strstr [eva] computing for function test_strncat <- main. Called from tests/libc/string_h.c:115. [eva] tests/libc/string_h.c:34: Trace partitioning superposing up to 100 states [eva] computing for function strncat <- test_strncat <- main. Called from tests/libc/string_h.c:36. [eva] using specification for function strncat [eva] tests/libc/string_h.c:36: function strncat: precondition 'valid_nstring_src' got status valid. [eva] tests/libc/string_h.c:36: function strncat: precondition 'valid_string_dest' got status valid. [eva] tests/libc/string_h.c:36: function strncat, behavior complete: precondition 'room_string' got status valid. [eva] Done for function strncat [eva] Recording results for test_strncat [eva] Done for function test_strncat [eva] computing for function crashes_gcc <- main. Called from tests/libc/string_h.c:116. [eva] computing for function strcpy <- crashes_gcc <- main. Called from tests/libc/string_h.c:53. [eva] using specification for function strcpy [eva] tests/libc/string_h.c:53: function strcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_h.c:53: function strcpy: precondition 'room_string' got status valid. [eva:alarm] tests/libc/string_h.c:53: Warning: function strcpy: precondition 'separation' got status invalid. [eva] Done for function strcpy [eva] Recording results for crashes_gcc [eva] Done for function crashes_gcc [eva] computing for function test_strtok <- main. Called from tests/libc/string_h.c:117. [eva] computing for function strtok <- test_strtok <- main. Called from tests/libc/string_h.c:58. [eva] using specification for function strtok [eva] tests/libc/string_h.c:58: function strtok: precondition 'valid_string_delim' got status valid. [eva:alarm] tests/libc/string_h.c:58: Warning: function strtok, behavior resume_str: precondition 'not_first_call' got status invalid. [eva] Done for function strtok [eva] computing for function strtok <- test_strtok <- main. Called from tests/libc/string_h.c:62. [eva] tests/libc/string_h.c:62: function strtok: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:62: function strtok, behavior new_str: precondition 'valid_string_s_or_delim_not_found' got status valid. [eva] Done for function strtok [eva:alarm] tests/libc/string_h.c:63: Warning: assertion got status unknown. [eva] computing for function strtok <- test_strtok <- main. Called from tests/libc/string_h.c:64. [eva] tests/libc/string_h.c:64: function strtok: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:64: function strtok, behavior resume_str: precondition 'not_first_call' got status valid. [eva] Done for function strtok [eva:alarm] tests/libc/string_h.c:65: Warning: assertion got status unknown. [eva] computing for function strtok <- test_strtok <- main. Called from tests/libc/string_h.c:67. [eva] tests/libc/string_h.c:67: function strtok: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:67: function strtok, behavior new_str: precondition 'valid_string_s_or_delim_not_found' got status valid. [eva] Done for function strtok [eva:alarm] tests/libc/string_h.c:68: Warning: assertion got status unknown. [eva] computing for function strtok <- test_strtok <- main. Called from tests/libc/string_h.c:69. [eva] tests/libc/string_h.c:69: function strtok: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:69: function strtok, behavior resume_str: precondition 'not_first_call' got status valid. [eva] Done for function strtok [eva:alarm] tests/libc/string_h.c:70: Warning: assertion got status unknown. [eva] computing for function strtok <- test_strtok <- main. Called from tests/libc/string_h.c:72. [eva] tests/libc/string_h.c:72: function strtok: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:72: function strtok, behavior new_str: precondition 'valid_string_s_or_delim_not_found' got status valid. [eva:invalid-assigns] tests/libc/string_h.c:72: Completely invalid destination for assigns clause *(s + (0 ..)). Ignoring. [eva] Done for function strtok [eva:alarm] tests/libc/string_h.c:73: Warning: assertion got status unknown. [eva] computing for function strtok <- test_strtok <- main. Called from tests/libc/string_h.c:75. [eva] tests/libc/string_h.c:75: function strtok: precondition 'valid_string_delim' got status valid. [eva:alarm] tests/libc/string_h.c:75: Warning: function strtok, behavior new_str: precondition 'valid_string_s_or_delim_not_found' got status unknown. [eva:invalid-assigns] tests/libc/string_h.c:75: Completely invalid destination for assigns clause *(s + (0 ..)). Ignoring. [eva] Done for function strtok [eva:alarm] tests/libc/string_h.c:76: Warning: assertion 'unreachable_if_precise' got status invalid (stopping propagation). [eva] Recording results for test_strtok [eva] Done for function test_strtok [eva] computing for function test_strtok_r <- main. Called from tests/libc/string_h.c:118. [eva] computing for function strtok_r <- test_strtok_r <- main. Called from tests/libc/string_h.c:82. [eva] using specification for function strtok_r [eva] tests/libc/string_h.c:82: function strtok_r: precondition 'valid_string_delim' got status valid. [eva:alarm] tests/libc/string_h.c:82: Warning: function strtok_r: precondition 'valid_saveptr' got status invalid. [eva] Done for function strtok_r [eva] computing for function strtok_r <- test_strtok_r <- main. Called from tests/libc/string_h.c:87. [eva] tests/libc/string_h.c:87: function strtok_r: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:87: function strtok_r: precondition 'valid_saveptr' got status valid. [eva] tests/libc/string_h.c:87: function strtok_r, behavior new_str: precondition 'valid_string_s_or_delim_not_found' got status valid. [eva] Done for function strtok_r [eva] computing for function strtok_r <- test_strtok_r <- main. Called from tests/libc/string_h.c:89. [eva] tests/libc/string_h.c:89: function strtok_r: precondition 'valid_string_delim' got status valid. [eva:alarm] tests/libc/string_h.c:89: Warning: function strtok_r: precondition 'valid_saveptr' got status invalid. [eva] Done for function strtok_r [eva:alarm] tests/libc/string_h.c:92: Warning: assertion got status unknown. [eva] computing for function strtok_r <- test_strtok_r <- main. Called from tests/libc/string_h.c:93. [eva] tests/libc/string_h.c:93: function strtok_r: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:93: function strtok_r: precondition 'valid_saveptr' got status valid. [eva] tests/libc/string_h.c:93: function strtok_r, behavior resume_str: precondition 'not_first_call' got status valid. [eva] tests/libc/string_h.c:93: function strtok_r, behavior resume_str: precondition 'initialization,saveptr' got status valid. [eva] Done for function strtok_r [eva] tests/libc/string_h.c:94: Frama_C_show_each_saveptr: {{ &buf + [0..--] }} [eva:alarm] tests/libc/string_h.c:95: Warning: assertion got status unknown. [eva] computing for function strtok_r <- test_strtok_r <- main. Called from tests/libc/string_h.c:97. [eva] tests/libc/string_h.c:97: function strtok_r: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:97: function strtok_r: precondition 'valid_saveptr' got status valid. [eva] tests/libc/string_h.c:97: function strtok_r, behavior new_str: precondition 'valid_string_s_or_delim_not_found' got status valid. [eva] Done for function strtok_r [eva:alarm] tests/libc/string_h.c:98: Warning: assertion got status unknown. [eva] computing for function strtok_r <- test_strtok_r <- main. Called from tests/libc/string_h.c:99. [eva] tests/libc/string_h.c:99: function strtok_r: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:99: function strtok_r: precondition 'valid_saveptr' got status valid. [eva] tests/libc/string_h.c:99: function strtok_r, behavior resume_str: precondition 'not_first_call' got status valid. [eva] tests/libc/string_h.c:99: function strtok_r, behavior resume_str: precondition 'initialization,saveptr' got status valid. [eva] Done for function strtok_r [eva:alarm] tests/libc/string_h.c:100: Warning: assertion got status unknown. [eva] computing for function strtok_r <- test_strtok_r <- main. Called from tests/libc/string_h.c:102. [eva] tests/libc/string_h.c:102: function strtok_r: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:102: function strtok_r: precondition 'valid_saveptr' got status valid. [eva] tests/libc/string_h.c:102: function strtok_r, behavior new_str: precondition 'valid_string_s_or_delim_not_found' got status valid. [eva:invalid-assigns] tests/libc/string_h.c:102: Completely invalid destination for assigns clause *(s + (0 ..)). Ignoring. [eva] Done for function strtok_r [eva:alarm] tests/libc/string_h.c:103: Warning: assertion got status unknown. [eva] computing for function strtok_r <- test_strtok_r <- main. Called from tests/libc/string_h.c:105. [eva] tests/libc/string_h.c:105: function strtok_r: precondition 'valid_string_delim' got status valid. [eva] tests/libc/string_h.c:105: function strtok_r: precondition 'valid_saveptr' got status valid. [eva:alarm] tests/libc/string_h.c:105: Warning: function strtok_r, behavior new_str: precondition 'valid_string_s_or_delim_not_found' got status unknown. [eva:invalid-assigns] tests/libc/string_h.c:105: Completely invalid destination for assigns clause *(s + (0 ..)). Ignoring. [eva] Done for function strtok_r [eva:alarm] tests/libc/string_h.c:106: Warning: assertion 'unreachable_if_precise' got status invalid (stopping propagation). [eva] Recording results for test_strtok_r [eva] Done for function test_strtok_r [eva] computing for function strdup <- main. Called from tests/libc/string_h.c:119. [eva] using specification for function strdup [eva:libc:unsupported-spec] tests/libc/string_h.c:119: Warning: The specification of function 'strdup' is currently not supported by Eva. Consider adding ./share/libc/string.c to the analyzed source files. [eva] tests/libc/string_h.c:119: Warning: ignoring unsupported \allocates clause [eva] tests/libc/string_h.c:119: function strdup: precondition 'valid_string_s' got status valid. [eva] Done for function strdup [eva] computing for function strndup <- main. Called from tests/libc/string_h.c:120. [eva] using specification for function strndup [eva:libc:unsupported-spec] tests/libc/string_h.c:120: Warning: The specification of function 'strndup' is currently not supported by Eva. Consider adding ./share/libc/string.c to the analyzed source files. [eva] tests/libc/string_h.c:120: Warning: ignoring unsupported \allocates clause [eva] Done for function strndup [eva] computing for function strlcpy <- main. Called from tests/libc/string_h.c:123. [eva] using specification for function strlcpy [eva] tests/libc/string_h.c:123: function strlcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_h.c:123: function strlcpy: precondition 'room_nstring' got status valid. [eva] tests/libc/string_h.c:123: function strlcpy: precondition 'separation' got status valid. [eva] Done for function strlcpy [eva] computing for function strlcpy <- main. Called from tests/libc/string_h.c:124. [eva] tests/libc/string_h.c:124: function strlcpy: precondition 'valid_string_src' got status valid. [eva] tests/libc/string_h.c:124: function strlcpy: precondition 'room_nstring' got status valid. [eva] tests/libc/string_h.c:124: function strlcpy: precondition 'separation' got status valid. [eva] Done for function strlcpy [eva] computing for function strlcat <- main. Called from tests/libc/string_h.c:125. [eva] using specification for function strlcat [eva:alarm] tests/libc/string_h.c:125: Warning: function strlcat: precondition 'valid_string_src' got status unknown. [eva:alarm] tests/libc/string_h.c:125: Warning: function strlcat: precondition 'valid_string_dest' got status unknown. [eva] tests/libc/string_h.c:125: function strlcat: precondition 'room_nstring' got status valid. [eva] Done for function strlcat [eva] computing for function strsignal <- main. Called from tests/libc/string_h.c:126. [eva] using specification for function strsignal [eva] Done for function strsignal [eva] tests/libc/string_h.c:127: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function crashes_gcc: NON TERMINATING FUNCTION [eva:final-states] Values at end of function test_strcat: string[0..4] ∈ [--..--] [5] ∈ {0} [6..9] ∈ UNINITIALIZED string2[0] ∈ [--..--] [1..5] ∈ [--..--] or UNINITIALIZED [6..9] ∈ UNINITIALIZED [eva:final-states] Values at end of function test_strcmp: res ∈ {0} [eva:final-states] Values at end of function test_strncat: data[0] ∈ [--..--] [1..99] ∈ [--..--] or UNINITIALIZED source[0..98] ∈ {90} [99] ∈ {0} [eva:final-states] Values at end of function test_strstr: s ∈ {{ "aba" ; "bab" }} needle ∈ {{ "a" ; "b" }} res ∈ {{ "aba" + {0; 1; 2; 3} ; "bab" + {0; 1; 2; 3} }} [eva:final-states] Values at end of function test_strtok: __fc_strtok_ptr ∈ {{ "constant!" + [0..--] }} buf[0..1] ∈ [--..--] a ∈ {{ NULL ; &buf{[0], [1]} }} b ∈ {{ NULL ; &buf{[0], [1]} }} buf2[0..3] ∈ [--..--] p ∈ {{ NULL ; &buf2{[0], [1], [2], [3]} }} q ∈ {{ NULL ; &buf2 + [0..--] }} r ∈ {0} [eva:final-states] Values at end of function test_strtok_r: saveptr ∈ {{ "constant!" + [0..--] }} buf[0..1] ∈ [--..--] a ∈ {{ NULL ; &buf{[0], [1]} }} b ∈ {{ NULL ; &buf{[0], [1]} }} buf2[0..3] ∈ [--..--] p ∈ {{ NULL ; &buf2{[0], [1], [2], [3]} }} q ∈ {{ NULL ; &buf2 + [0..--] }} r ∈ {0} [eva:final-states] Values at end of function main: __fc_strtok_ptr ∈ {{ "constant!" + [0..--] }} a ∈ [--..--] b ∈ [--..--] buf[0..15] ∈ [--..--] buf2[0..5] ∈ [--..--] [6..31] ∈ [--..--] or UNINITIALIZED r1 ∈ {18} r2 ∈ {5} r3 ∈ [--..--] strsig ∈ {{ &__fc_strsignal[0] }} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/strings_h.res.oracle0000666000000000000000000000657113571573400020523 0ustar [kernel] Parsing tests/libc/strings_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function strcasecmp <- main. Called from tests/libc/strings_h.c:9. [eva] using specification for function strcasecmp [eva] tests/libc/strings_h.c:9: function strcasecmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/strings_h.c:9: function strcasecmp: precondition 'valid_string_s2' got status valid. [eva] Done for function strcasecmp [eva] computing for function strcasecmp <- main. Called from tests/libc/strings_h.c:10. [eva] tests/libc/strings_h.c:10: function strcasecmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/strings_h.c:10: function strcasecmp: precondition 'valid_string_s2' got status valid. [eva] Done for function strcasecmp [eva] computing for function strcasecmp <- main. Called from tests/libc/strings_h.c:11. [eva] tests/libc/strings_h.c:11: function strcasecmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/strings_h.c:11: function strcasecmp: precondition 'valid_string_s2' got status valid. [eva] Done for function strcasecmp [eva] computing for function strcasecmp <- main. Called from tests/libc/strings_h.c:12. [eva] tests/libc/strings_h.c:12: function strcasecmp: precondition 'valid_string_s1' got status valid. [eva:alarm] tests/libc/strings_h.c:12: Warning: function strcasecmp: precondition 'valid_string_s2' got status invalid. [eva] Done for function strcasecmp [eva] computing for function strncasecmp <- main. Called from tests/libc/strings_h.c:13. [eva] using specification for function strncasecmp [eva] tests/libc/strings_h.c:13: function strncasecmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/strings_h.c:13: function strncasecmp: precondition 'valid_string_s2' got status valid. [eva] Done for function strncasecmp [eva] computing for function strncasecmp <- main. Called from tests/libc/strings_h.c:14. [eva] tests/libc/strings_h.c:14: function strncasecmp: precondition 'valid_string_s1' got status valid. [eva:alarm] tests/libc/strings_h.c:14: Warning: function strncasecmp: precondition 'valid_string_s2' got status invalid. [eva] Done for function strncasecmp [eva] computing for function strncasecmp <- main. Called from tests/libc/strings_h.c:15. [eva] tests/libc/strings_h.c:15: function strncasecmp: precondition 'valid_string_s1' got status valid. [eva] tests/libc/strings_h.c:15: function strncasecmp: precondition 'valid_string_s2' got status valid. [eva] Done for function strncasecmp [eva] computing for function bzero <- main. Called from tests/libc/strings_h.c:18. [eva] using specification for function bzero [eva] tests/libc/strings_h.c:18: function bzero: precondition 'valid_memory_area' got status valid. [eva] Done for function bzero [eva] tests/libc/strings_h.c:19: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s1 ∈ {{ "AbC" }} s2 ∈ {{ "De" }} s3 ∈ {{ "ABc" }} s[0] ∈ {65} [1] ∈ {66} [2] ∈ {99} r1 ∈ [--..--] r2 ∈ [--..--] r3 ∈ [--..--] r4 ∈ [--..--] r5 ∈ [--..--] s4[0..9] ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/sys_file_h.res.oracle0000666000000000000000000000232113571573400020634 0ustar [kernel] Parsing tests/libc/sys_file_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function __va_open_void <- main. Called from tests/libc/sys_file_h.c:5. [eva] using specification for function __va_open_void [eva] tests/libc/sys_file_h.c:5: function __va_open_void: precondition 'valid_filename' got status valid. [eva] tests/libc/sys_file_h.c:5: function __va_open_void: precondition 'flag_not_CREAT' got status valid. [eva] Done for function __va_open_void [eva] computing for function flock <- main. Called from tests/libc/sys_file_h.c:6. [eva] using specification for function flock [eva] Done for function flock [eva] computing for function flock <- main. Called from tests/libc/sys_file_h.c:7. [eva] Done for function flock [eva] computing for function flock <- main. Called from tests/libc/sys_file_h.c:8. [eva] Done for function flock [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: fd ∈ [--..--] r ∈ {-1; 0} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/sys_select.res.oracle0000666000000000000000000001052313571573400020670 0ustar [kernel] Parsing tests/libc/sys_select.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function socket <- main. Called from tests/libc/sys_select.c:9. [eva] using specification for function socket [eva] Done for function socket [eva] computing for function exit <- main. Called from tests/libc/sys_select.c:10. [eva] using specification for function exit [eva] Done for function exit [eva] tests/libc/sys_select.c:16: Call to builtin memset [eva] tests/libc/sys_select.c:16: function memset: precondition 'valid_s' got status valid. [eva] share/libc/string.h:118: cannot evaluate ACSL term, unsupported ACSL construct: logic function memset [eva] computing for function htonl <- main. Called from tests/libc/sys_select.c:18. [eva] using specification for function htonl [eva] Done for function htonl [eva] computing for function htons <- main. Called from tests/libc/sys_select.c:19. [eva] using specification for function htons [eva] Done for function htons [eva] computing for function bind <- main. Called from tests/libc/sys_select.c:20. [eva] using specification for function bind [eva] tests/libc/sys_select.c:20: function bind: precondition 'valid_sockfd,sockfd' got status valid. [eva] tests/libc/sys_select.c:20: function bind: precondition 'valid_read_addr' got status valid. [eva] Done for function bind [eva] computing for function exit <- main. Called from tests/libc/sys_select.c:21. [eva] Done for function exit [eva] computing for function FD_ZERO <- main. Called from tests/libc/sys_select.c:22. [eva] using specification for function FD_ZERO [eva] tests/libc/sys_select.c:22: function FD_ZERO: precondition 'valid_fdset' got status valid. [eva] Done for function FD_ZERO [eva] computing for function FD_SET <- main. Called from tests/libc/sys_select.c:24. [eva] using specification for function FD_SET [eva] tests/libc/sys_select.c:24: function FD_SET: precondition 'valid_fdset' got status valid. [eva] tests/libc/sys_select.c:24: function FD_SET: precondition 'initialization' got status valid. [eva] Done for function FD_SET [eva] tests/libc/sys_select.c:30: Call to builtin memcpy [eva] tests/libc/sys_select.c:30: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/libc/sys_select.c:30: function memcpy: precondition 'valid_src' got status valid. [eva] tests/libc/sys_select.c:30: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] computing for function select <- main. Called from tests/libc/sys_select.c:31. [eva] using specification for function select [eva] tests/libc/sys_select.c:31: function select: precondition 'nfds' got status valid. [eva] tests/libc/sys_select.c:31: function select: precondition 'readfs' got status valid. [eva] tests/libc/sys_select.c:31: function select: precondition 'writefds' got status valid. [eva] tests/libc/sys_select.c:31: function select: precondition 'errorfds' got status valid. [eva] tests/libc/sys_select.c:31: function select: precondition 'timeout' got status valid. [eva:invalid-assigns] tests/libc/sys_select.c:31: Completely invalid destination for assigns clause *writefds. Ignoring. [eva:invalid-assigns] tests/libc/sys_select.c:31: Completely invalid destination for assigns clause *errorfds. Ignoring. [eva] Done for function select [eva] computing for function FD_ISSET <- main. Called from tests/libc/sys_select.c:32. [eva] using specification for function FD_ISSET [eva] tests/libc/sys_select.c:32: function FD_ISSET: precondition 'valid_fdset' got status valid. [eva] tests/libc/sys_select.c:32: function FD_ISSET: precondition 'initialization' got status valid. [eva] Done for function FD_ISSET [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_sockfds[0..1023] ∈ [--..--] __fc_socket_counter ∈ [--..--] __fc_fds_state ∈ [--..--] fd1 ∈ [0..1023] max_fd ∈ [0..1023] fds1 ∈ [--..--] fds2 ∈ [--..--] addr.sin_family ∈ {2} {.sin_port; .sin_addr} ∈ [--..--] res ∈ [--..--] timeout ∈ [--..--] __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/sys_stat_h.res.oracle0000666000000000000000000000455513571573400020703 0ustar [kernel] Parsing tests/libc/sys_stat_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function __va_open_mode_t <- main. Called from tests/libc/sys_stat_h.c:10. [eva] using specification for function __va_open_mode_t [eva] tests/libc/sys_stat_h.c:10: function __va_open_mode_t: precondition 'valid_filename' got status valid. [eva] Done for function __va_open_mode_t [eva] computing for function close <- main. Called from tests/libc/sys_stat_h.c:12. [eva] using specification for function close [eva:alarm] tests/libc/sys_stat_h.c:12: Warning: function close: precondition 'valid_fd' got status unknown. [eva] Done for function close [eva] computing for function stat <- main. Called from tests/libc/sys_stat_h.c:14. [eva] using specification for function stat [eva] tests/libc/sys_stat_h.c:14: function stat: precondition 'valid_pathname' got status valid. [eva] tests/libc/sys_stat_h.c:14: function stat: precondition 'valid_buf' got status valid. [eva] Done for function stat [eva] computing for function mkdir <- main. Called from tests/libc/sys_stat_h.c:17. [eva] using specification for function mkdir [eva] tests/libc/sys_stat_h.c:17: function mkdir: precondition 'valid_string_path' got status valid. [eva] Done for function mkdir [eva] computing for function mkdir <- main. Called from tests/libc/sys_stat_h.c:20. [eva:alarm] tests/libc/sys_stat_h.c:20: Warning: function mkdir: precondition 'valid_string_path' got status invalid. [eva] Done for function mkdir [eva] computing for function mkdir <- main. Called from tests/libc/sys_stat_h.c:20. [eva] Done for function mkdir [eva] computing for function umask <- main. Called from tests/libc/sys_stat_h.c:22. [eva] using specification for function umask [eva] Done for function umask [eva] computing for function umask <- main. Called from tests/libc/sys_stat_h.c:22. [eva] Done for function umask [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_fds[0..1023] ∈ [--..--] fd ∈ [-1..1023] st ∈ [--..--] or UNINITIALIZED r ∈ {-1; 0} r_mkdir ∈ {-1; 0} old_mask ∈ [--..--] __retres ∈ {-1; 0; 1; 2; 3} frama-c-20.0-Calcium/tests/libc/oracle/sys_time_h.res.oracle0000666000000000000000000000711413571573400020660 0ustar [kernel] Parsing tests/libc/sys_time_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function setitimer <- main. Called from tests/libc/sys_time_h.c:6. [eva] using specification for function setitimer [eva] tests/libc/sys_time_h.c:6: function setitimer: precondition 'valid_new_value' got status valid. [eva] tests/libc/sys_time_h.c:6: function setitimer: precondition 'old_value_null_or_valid' got status valid. [eva:invalid-assigns] tests/libc/sys_time_h.c:6: Completely invalid destination for assigns clause *old_value. Ignoring. [eva] Done for function setitimer [eva] tests/libc/sys_time_h.c:7: assertion got status valid. [eva] computing for function setitimer <- main. Called from tests/libc/sys_time_h.c:9. [eva] tests/libc/sys_time_h.c:9: function setitimer: precondition 'valid_new_value' got status valid. [eva] tests/libc/sys_time_h.c:9: function setitimer: precondition 'old_value_null_or_valid' got status valid. [eva] Done for function setitimer [eva] tests/libc/sys_time_h.c:10: assertion got status valid. [eva] tests/libc/sys_time_h.c:11: assertion got status valid. [eva] computing for function getitimer <- main. Called from tests/libc/sys_time_h.c:12. [eva] using specification for function getitimer [eva] tests/libc/sys_time_h.c:12: function getitimer: precondition 'valid_curr_value' got status valid. [eva] Done for function getitimer [eva] tests/libc/sys_time_h.c:13: assertion got status valid. [eva] tests/libc/sys_time_h.c:14: assertion got status valid. [eva] computing for function getitimer <- main. Called from tests/libc/sys_time_h.c:16. [eva] tests/libc/sys_time_h.c:16: function getitimer: precondition 'valid_curr_value' got status valid. [eva] Done for function getitimer [eva] tests/libc/sys_time_h.c:17: assertion got status valid. [eva] computing for function setitimer <- main. Called from tests/libc/sys_time_h.c:19. [eva] tests/libc/sys_time_h.c:19: function setitimer: precondition 'valid_new_value' got status valid. [eva] tests/libc/sys_time_h.c:19: function setitimer: precondition 'old_value_null_or_valid' got status valid. [eva] Done for function setitimer [eva] tests/libc/sys_time_h.c:20: assertion got status valid. [eva] computing for function utimes <- main. Called from tests/libc/sys_time_h.c:22. [eva] using specification for function utimes [eva] tests/libc/sys_time_h.c:22: function utimes: precondition 'valid_path' got status valid. [eva] tests/libc/sys_time_h.c:22: function utimes: precondition 'valid_times_or_null' got status valid. [eva] Done for function utimes [eva] computing for function utimes <- main. Called from tests/libc/sys_time_h.c:28. [eva] tests/libc/sys_time_h.c:28: function utimes: precondition 'valid_path' got status valid. [eva] tests/libc/sys_time_h.c:28: function utimes: precondition 'valid_times_or_null' got status valid. [eva] Done for function utimes [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i1.it_interval.tv_sec ∈ {1} .it_interval.tv_usec ∈ {100} .it_value.tv_sec ∈ {2} .it_value.tv_usec ∈ {200} res ∈ {-1} i2.it_interval.tv_sec ∈ [--..--] .it_interval.tv_usec ∈ {1000000} .it_value ∈ [--..--] INVALID_ITIMER ∈ {-1} r1 ∈ [--..--] tv[0].tv_sec ∈ {10000000} [0].tv_usec ∈ {999999} [1].tv_sec ∈ {-9000000} [1].tv_usec ∈ {1} r2 ∈ [--..--] __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/sys_times.res.oracle0000666000000000000000000000130713571573400020532 0ustar [kernel] Parsing tests/libc/sys_times.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function times <- main. Called from tests/libc/sys_times.c:6. [eva] using specification for function times [eva] tests/libc/sys_times.c:6: function times: precondition 'valid_buffer' got status valid. [eva] Done for function times [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t ∈ [--..--] or UNINITIALIZED ck ∈ [--..--] __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/sys_wait_h.res.oracle0000666000000000000000000000324413571573400020666 0ustar [kernel] Parsing tests/libc/sys_wait_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function wait <- main. Called from tests/libc/sys_wait_h.c:7. [eva] using specification for function wait [eva] Done for function wait [eva] computing for function wait <- main. Called from tests/libc/sys_wait_h.c:9. [eva] tests/libc/sys_wait_h.c:9: function wait, behavior stat_loc_non_null: precondition 'valid_stat_loc' got status valid. [eva] Done for function wait [eva] computing for function wait <- main. Called from tests/libc/sys_wait_h.c:9. [eva] Done for function wait [eva] tests/libc/sys_wait_h.c:11: assertion got status valid. [eva] computing for function waitpid <- main. Called from tests/libc/sys_wait_h.c:15. [eva] using specification for function waitpid [eva] Done for function waitpid [eva] computing for function waitpid <- main. Called from tests/libc/sys_wait_h.c:15. [eva] Done for function waitpid [eva] computing for function waitpid <- main. Called from tests/libc/sys_wait_h.c:15. [eva] Done for function waitpid [eva] computing for function waitpid <- main. Called from tests/libc/sys_wait_h.c:16. [eva] tests/libc/sys_wait_h.c:16: function waitpid, behavior stat_loc_non_null: precondition 'valid_stat_loc' got status valid. [eva] Done for function waitpid [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: r ∈ [-1..2147483647] stat_val ∈ [--..--] or UNINITIALIZED __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/termios.res.oracle0000666000000000000000000000224213571573400020174 0ustar [kernel] Parsing tests/libc/termios.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function __va_open_void <- main. Called from tests/libc/termios.c:10. [eva] using specification for function __va_open_void [eva] tests/libc/termios.c:10: function __va_open_void: precondition 'valid_filename' got status valid. [eva] tests/libc/termios.c:10: function __va_open_void: precondition 'flag_not_CREAT' got status valid. [eva] Done for function __va_open_void [eva] computing for function tcgetattr <- main. Called from tests/libc/termios.c:11. [eva] using specification for function tcgetattr [eva] tests/libc/termios.c:11: function tcgetattr: precondition 'valid_termios_p' got status valid. [eva] Done for function tcgetattr [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] fd ∈ [--..--] tio ∈ [--..--] or UNINITIALIZED res ∈ {-1; 0} __retres ∈ {1; 8} frama-c-20.0-Calcium/tests/libc/oracle/time_c.res.oracle0000666000000000000000000000254313571573400017756 0ustar [kernel] Parsing tests/libc/time_c.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function ctime <- main. Called from tests/libc/time_c.c:8. [eva] share/libc/time.c:30: assertion got status valid. [eva:alarm] share/libc/time.c:31: Warning: assertion got status unknown. [eva] computing for function Frama_C_make_unknown <- ctime <- main. Called from share/libc/time.c:32. [eva] using specification for function Frama_C_make_unknown [eva] share/libc/time.c:32: function Frama_C_make_unknown: precondition 'valid_p' got status valid. [eva] Done for function Frama_C_make_unknown [eva] Recording results for ctime [eva] Done for function ctime [eva] tests/libc/time_c.c:9: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function ctime: __fc_ctime[0..24] ∈ [--..--] [25] ∈ {0} Frama_C_entropy_source ∈ [--..--] __retres ∈ {{ &__fc_ctime[0] }} [eva:final-states] Values at end of function main: __fc_ctime[0..24] ∈ [--..--] [25] ∈ {0} Frama_C_entropy_source ∈ [--..--] t ∈ {42} s ∈ {{ &__fc_ctime[0] }} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/time_h.res.oracle0000666000000000000000000001464313571573400017767 0ustar [kernel] Parsing tests/libc/time_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function nanosleep <- main. Called from tests/libc/time_h.c:13. [eva] using specification for function nanosleep [eva] tests/libc/time_h.c:13: function nanosleep: precondition 'valid_request' got status valid. [eva] tests/libc/time_h.c:13: function nanosleep: precondition 'initialization,initialized_request' got status valid. [eva] tests/libc/time_h.c:13: function nanosleep: precondition 'valid_nanosecs' got status valid. [eva] tests/libc/time_h.c:13: function nanosleep: precondition 'valid_remaining_or_null' got status valid. [eva] Done for function nanosleep [eva] computing for function nanosleep <- main. Called from tests/libc/time_h.c:17. [eva] tests/libc/time_h.c:17: function nanosleep: precondition 'valid_request' got status valid. [eva] tests/libc/time_h.c:17: function nanosleep: precondition 'initialization,initialized_request' got status valid. [eva] tests/libc/time_h.c:17: function nanosleep: precondition 'valid_nanosecs' got status valid. [eva] tests/libc/time_h.c:17: function nanosleep: precondition 'valid_remaining_or_null' got status valid. [eva] Done for function nanosleep [eva] computing for function nanosleep <- main. Called from tests/libc/time_h.c:22. [eva] tests/libc/time_h.c:22: function nanosleep: precondition 'valid_request' got status valid. [eva] tests/libc/time_h.c:22: function nanosleep: precondition 'initialization,initialized_request' got status valid. [eva] tests/libc/time_h.c:22: function nanosleep: precondition 'valid_nanosecs' got status valid. [eva] tests/libc/time_h.c:22: function nanosleep: precondition 'valid_remaining_or_null' got status valid. [eva:invalid-assigns] tests/libc/time_h.c:22: Completely invalid destination for assigns clause *rmtp. Ignoring. [eva] Done for function nanosleep [eva] computing for function nanosleep <- main. Called from tests/libc/time_h.c:22. [eva:invalid-assigns] tests/libc/time_h.c:22: Completely invalid destination for assigns clause *rmtp. Ignoring. [eva] Done for function nanosleep [eva] computing for function clock_nanosleep <- main. Called from tests/libc/time_h.c:28. [eva] using specification for function clock_nanosleep [eva] tests/libc/time_h.c:28: function clock_nanosleep: precondition 'valid_request' got status valid. [eva] tests/libc/time_h.c:28: function clock_nanosleep: precondition 'initialization,initialized_request' got status valid. [eva] tests/libc/time_h.c:28: function clock_nanosleep: precondition 'valid_nanosecs' got status valid. [eva] tests/libc/time_h.c:28: function clock_nanosleep: precondition 'valid_remaining_or_null' got status valid. [eva] Done for function clock_nanosleep [eva] computing for function clock_nanosleep <- main. Called from tests/libc/time_h.c:28. [eva] Done for function clock_nanosleep [eva] tests/libc/time_h.c:29: assertion got status valid. [eva] computing for function clock_nanosleep <- main. Called from tests/libc/time_h.c:30. [eva] tests/libc/time_h.c:30: function clock_nanosleep: precondition 'valid_request' got status valid. [eva] tests/libc/time_h.c:30: function clock_nanosleep: precondition 'initialization,initialized_request' got status valid. [eva] tests/libc/time_h.c:30: function clock_nanosleep: precondition 'valid_nanosecs' got status valid. [eva] tests/libc/time_h.c:30: function clock_nanosleep: precondition 'valid_remaining_or_null' got status valid. [eva] Done for function clock_nanosleep [eva] computing for function clock_nanosleep <- main. Called from tests/libc/time_h.c:32. [eva] tests/libc/time_h.c:32: function clock_nanosleep: precondition 'valid_request' got status valid. [eva] tests/libc/time_h.c:32: function clock_nanosleep: precondition 'initialization,initialized_request' got status valid. [eva] tests/libc/time_h.c:32: function clock_nanosleep: precondition 'valid_nanosecs' got status valid. [eva] tests/libc/time_h.c:32: function clock_nanosleep: precondition 'valid_remaining_or_null' got status valid. [eva] Done for function clock_nanosleep [eva] computing for function clock_nanosleep <- main. Called from tests/libc/time_h.c:36. [eva] tests/libc/time_h.c:36: function clock_nanosleep: precondition 'valid_request' got status valid. [eva] tests/libc/time_h.c:36: function clock_nanosleep: precondition 'initialization,initialized_request' got status valid. [eva] tests/libc/time_h.c:36: function clock_nanosleep: precondition 'valid_nanosecs' got status valid. [eva] tests/libc/time_h.c:36: function clock_nanosleep: precondition 'valid_remaining_or_null' got status valid. [eva] Done for function clock_nanosleep [eva] computing for function clock_nanosleep <- main. Called from tests/libc/time_h.c:36. [eva:alarm] tests/libc/time_h.c:36: Warning: function clock_nanosleep: precondition 'initialization,initialized_request' got status invalid. [eva] tests/libc/time_h.c:36: function clock_nanosleep: no state left, precondition 'valid_nanosecs' got status valid. [eva] tests/libc/time_h.c:36: function clock_nanosleep: no state left, precondition 'valid_remaining_or_null' got status valid. [eva] Done for function clock_nanosleep [eva] computing for function clock_nanosleep <- main. Called from tests/libc/time_h.c:36. [eva] Done for function clock_nanosleep [eva] computing for function ctime <- main. Called from tests/libc/time_h.c:43. [eva] using specification for function ctime [eva] tests/libc/time_h.c:43: function ctime: precondition 'valid_timer' got status valid. [eva] tests/libc/time_h.c:43: function ctime: precondition 'initialization,init_timer' got status valid. [eva] Done for function ctime [eva] computing for function ctime <- main. Called from tests/libc/time_h.c:43. [eva] Done for function ctime [eva:alarm] tests/libc/time_h.c:44: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_ctime[0..25] ∈ [--..--] req.tv_sec ∈ [--..--] .tv_nsec ∈ [0..999999999] rem ∈ [--..--] or UNINITIALIZED r ∈ {-1; 0; 4; 22} creq.tv_sec ∈ [--..--] or UNINITIALIZED .tv_nsec ∈ [0..999999999] or UNINITIALIZED tt ∈ {42} time_str ∈ {{ &__fc_ctime[0] }} __retres ∈ {0; 1; 2} frama-c-20.0-Calcium/tests/libc/oracle/time_misc.res.oracle0000666000000000000000000000622613571573400020471 0ustar [kernel] Parsing tests/libc/time_misc.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function test_gettimeofday <- main. Called from tests/libc/time_misc.c:37. [eva] computing for function gettimeofday <- test_gettimeofday <- main. Called from tests/libc/time_misc.c:7. [eva] using specification for function gettimeofday [eva] Done for function gettimeofday [eva] tests/libc/time_misc.c:8: assertion got status valid. [eva] tests/libc/time_misc.c:9: assertion got status valid. [eva] Recording results for test_gettimeofday [eva] Done for function test_gettimeofday [eva] computing for function test_strftime <- main. Called from tests/libc/time_misc.c:38. [eva] computing for function time <- test_strftime <- main. Called from tests/libc/time_misc.c:18. [eva] using specification for function time [eva] Done for function time [eva] computing for function localtime <- test_strftime <- main. Called from tests/libc/time_misc.c:19. [eva] using specification for function localtime [eva] tests/libc/time_misc.c:19: function localtime: precondition 'valid_timer' got status valid. [eva] Done for function localtime [eva] computing for function strftime <- test_strftime <- main. Called from tests/libc/time_misc.c:21. [eva] using specification for function strftime [eva] tests/libc/time_misc.c:21: function strftime: precondition 'dst_has_room' got status valid. [eva] tests/libc/time_misc.c:21: function strftime: precondition 'valid_format' got status valid. [eva] tests/libc/time_misc.c:21: function strftime: precondition 'valid_tm' got status valid. [eva] Done for function strftime [eva] Recording results for test_strftime [eva] Done for function test_strftime [eva] computing for function test_ctime <- main. Called from tests/libc/time_misc.c:39. [eva] computing for function ctime <- test_ctime <- main. Called from tests/libc/time_misc.c:31. [eva] using specification for function ctime [eva] tests/libc/time_misc.c:31: function ctime: precondition 'valid_timer' got status valid. [eva:alarm] tests/libc/time_misc.c:31: Warning: function ctime: precondition 'initialization,init_timer' got status unknown. [eva] Done for function ctime [eva:alarm] tests/libc/time_misc.c:32: Warning: assertion got status unknown. [eva] Recording results for test_ctime [eva] Done for function test_ctime [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test_ctime: __fc_ctime[0..25] ∈ [--..--] t ∈ {42} s ∈ {{ &__fc_ctime[0] }} [eva:final-states] Values at end of function test_gettimeofday: tv.tv_sec ∈ [--..--] .tv_usec ∈ [0..999999] [eva:final-states] Values at end of function test_strftime: __fc_time_tm ∈ [--..--] outstr[0..199] ∈ [--..--] or UNINITIALIZED t ∈ [--..--] tmp ∈ {{ NULL ; &__fc_time_tm }} res ∈ [0..200] or UNINITIALIZED [eva:final-states] Values at end of function main: __fc_ctime[0..25] ∈ [--..--] __fc_time_tm ∈ [--..--] __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/unistd_h.0.res.oracle0000666000000000000000000005612713571573400020500 0ustar [kernel] Parsing tests/libc/unistd_h.c (with preprocessing) [eva] Splitting return states on: \return(access) == 0 (auto) \return(chdir) == 0 (auto) \return(chroot) == 0 (auto) \return(chown) == 0 (auto) \return(dup) == -1 (auto) \return(getcwd) == 0 (auto) \return(gethostname) == 0 (auto) \return(getpgrp) == 0 (auto) \return(isatty) == 0 (auto) \return(pipe) == 0 (auto) \return(setegid) == 0 (auto) \return(seteuid) == 0 (auto) \return(setgid) == 0 (auto) \return(setpgid) == 0 (auto) \return(setregid) == 0 (auto) \return(setreuid) == 0 (auto) \return(setsid) == 0 (auto) \return(setuid) == 0 (auto) \return(ttyname) == 0 (auto) \return(unlink) == 0 (auto) \return(usleep) == 0 (auto) \return(getresuid) == 0 (auto) \return(setresuid) == 0 (auto) \return(getresgid) == 0 (auto) \return(setresgid) == 0 (auto) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function usleep <- main. Called from tests/libc/unistd_h.c:12. [eva] using specification for function usleep [eva] Done for function usleep [eva] computing for function usleep <- main. Called from tests/libc/unistd_h.c:13. [eva] Done for function usleep [eva] computing for function usleep <- main. Called from tests/libc/unistd_h.c:13. [eva] Done for function usleep [eva] computing for function gethostname <- main. Called from tests/libc/unistd_h.c:15. [eva] using specification for function gethostname [eva] tests/libc/unistd_h.c:15: function gethostname: precondition 'name_has_room' got status valid. [eva] Done for function gethostname [eva] computing for function gethostname <- main. Called from tests/libc/unistd_h.c:15. [eva] Done for function gethostname [eva] computing for function execv <- main. Called from tests/libc/unistd_h.c:17. [eva] using specification for function execv [eva] tests/libc/unistd_h.c:17: function execv: precondition 'valid_string_path' got status valid. [eva] tests/libc/unistd_h.c:17: function execv: precondition 'valid_string_argv0' got status valid. [eva] Done for function execv [eva] computing for function execv <- main. Called from tests/libc/unistd_h.c:17. [eva] Done for function execv [eva] computing for function access <- main. Called from tests/libc/unistd_h.c:19. [eva] using specification for function access [eva] tests/libc/unistd_h.c:19: function access: precondition 'valid_string_path' got status valid. [eva] tests/libc/unistd_h.c:19: function access: precondition 'valid_amode' got status valid. [eva] Done for function access [eva] computing for function access <- main. Called from tests/libc/unistd_h.c:19. [eva] Done for function access [eva] tests/libc/unistd_h.c:20: assertion got status valid. [eva] computing for function dup <- main. Called from tests/libc/unistd_h.c:22. [eva] using specification for function dup [eva] tests/libc/unistd_h.c:22: function dup: precondition 'valid_fildes' got status valid. [eva] Done for function dup [eva] computing for function dup <- main. Called from tests/libc/unistd_h.c:22. [eva] Done for function dup [eva] tests/libc/unistd_h.c:23: assertion got status valid. [eva] computing for function lseek <- main. Called from tests/libc/unistd_h.c:27. [eva] using specification for function lseek [eva] tests/libc/unistd_h.c:27: function lseek: precondition 'valid_fd' got status valid. [eva] tests/libc/unistd_h.c:27: function lseek: precondition 'valid_whence' got status valid. [eva] Done for function lseek [eva] computing for function lseek <- main. Called from tests/libc/unistd_h.c:27. [eva] Done for function lseek [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:30. [eva] using specification for function dup2 [eva] tests/libc/unistd_h.c:30: function dup2: precondition 'valid_fildes' got status valid. [eva] tests/libc/unistd_h.c:30: function dup2: precondition 'valid_fildes2' got status valid. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:30. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:32. [eva] tests/libc/unistd_h.c:32: function dup2: precondition 'valid_fildes' got status valid. [eva:alarm] tests/libc/unistd_h.c:32: Warning: function dup2: precondition 'valid_fildes2' got status invalid. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:32. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:32. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:32. [eva] Done for function dup2 [eva] computing for function fork <- main. Called from tests/libc/unistd_h.c:36. [eva] using specification for function fork [eva] Done for function fork [eva] computing for function fork <- main. Called from tests/libc/unistd_h.c:36. [eva] Done for function fork [eva] computing for function fork <- main. Called from tests/libc/unistd_h.c:36. [eva] Done for function fork [eva] computing for function fork <- main. Called from tests/libc/unistd_h.c:36. [eva] Done for function fork [eva] tests/libc/unistd_h.c:37: assertion got status valid. [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] using specification for function setsid [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function sync <- main. Called from tests/libc/unistd_h.c:41. [eva] using specification for function sync [eva] Done for function sync [eva] computing for function sysconf <- main. Called from tests/libc/unistd_h.c:43. [eva] using specification for function sysconf [eva] Done for function sysconf [eva] computing for function getcwd <- main. Called from tests/libc/unistd_h.c:46. [eva] using specification for function getcwd [eva] tests/libc/unistd_h.c:46: function getcwd: precondition 'valid_buf' got status valid. [eva] Done for function getcwd [eva] tests/libc/unistd_h.c:48: assertion got status valid. [eva:alarm] tests/libc/unistd_h.c:49: Warning: assertion got status unknown. [eva] computing for function pathconf <- main. Called from tests/libc/unistd_h.c:52. [eva] using specification for function pathconf [eva] tests/libc/unistd_h.c:52: function pathconf: precondition 'valid_path' got status valid. [eva] Done for function pathconf [eva] computing for function pathconf <- main. Called from tests/libc/unistd_h.c:52. [eva] Done for function pathconf [eva] computing for function getresuid <- main. Called from tests/libc/unistd_h.c:55. [eva] using specification for function getresuid [eva] tests/libc/unistd_h.c:55: function getresuid: precondition 'valid_ruid' got status valid. [eva] tests/libc/unistd_h.c:55: function getresuid: precondition 'valid_euid' got status valid. [eva] tests/libc/unistd_h.c:55: function getresuid: precondition 'valid_suid' got status valid. [eva] Done for function getresuid [eva] computing for function getresuid <- main. Called from tests/libc/unistd_h.c:55. [eva] Done for function getresuid [eva] computing for function setresuid <- main. Called from tests/libc/unistd_h.c:57. [eva] using specification for function setresuid [eva] Done for function setresuid [eva] computing for function setresuid <- main. Called from tests/libc/unistd_h.c:57. [eva] Done for function setresuid [eva] tests/libc/unistd_h.c:58: assertion got status valid. [eva] computing for function getresgid <- main. Called from tests/libc/unistd_h.c:61. [eva] using specification for function getresgid [eva] tests/libc/unistd_h.c:61: function getresgid: precondition 'valid_rgid' got status valid. [eva] tests/libc/unistd_h.c:61: function getresgid: precondition 'valid_egid' got status valid. [eva] tests/libc/unistd_h.c:61: function getresgid: precondition 'valid_sgid' got status valid. [eva] Done for function getresgid [eva] computing for function getresgid <- main. Called from tests/libc/unistd_h.c:61. [eva] Done for function getresgid [eva] computing for function getresgid <- main. Called from tests/libc/unistd_h.c:61. [eva] Done for function getresgid [eva] computing for function getresgid <- main. Called from tests/libc/unistd_h.c:61. [eva] Done for function getresgid [eva] computing for function setresgid <- main. Called from tests/libc/unistd_h.c:63. [eva] using specification for function setresgid [eva] Done for function setresgid [eva] computing for function setresgid <- main. Called from tests/libc/unistd_h.c:63. [eva] Done for function setresgid [eva] tests/libc/unistd_h.c:64: assertion got status valid. [eva] computing for function getpid <- main. Called from tests/libc/unistd_h.c:66. [eva] using specification for function getpid [eva] Done for function getpid [eva] computing for function getpid <- main. Called from tests/libc/unistd_h.c:66. [eva] Done for function getpid [eva] computing for function getpid <- main. Called from tests/libc/unistd_h.c:66. [eva] Done for function getpid [eva] computing for function getpid <- main. Called from tests/libc/unistd_h.c:66. [eva] Done for function getpid [eva] computing for function getppid <- main. Called from tests/libc/unistd_h.c:67. [eva] using specification for function getppid [eva] Done for function getppid [eva] computing for function getppid <- main. Called from tests/libc/unistd_h.c:67. [eva] Done for function getppid [eva] computing for function getppid <- main. Called from tests/libc/unistd_h.c:67. [eva] Done for function getppid [eva] computing for function getppid <- main. Called from tests/libc/unistd_h.c:67. [eva] Done for function getppid [eva] computing for function getsid <- main. Called from tests/libc/unistd_h.c:68. [eva] using specification for function getsid [eva] Done for function getsid [eva] computing for function getsid <- main. Called from tests/libc/unistd_h.c:68. [eva] Done for function getsid [eva] computing for function getsid <- main. Called from tests/libc/unistd_h.c:68. [eva] Done for function getsid [eva] computing for function getsid <- main. Called from tests/libc/unistd_h.c:68. [eva] Done for function getsid [eva] computing for function getuid <- main. Called from tests/libc/unistd_h.c:69. [eva] using specification for function getuid [eva] Done for function getuid [eva] computing for function getuid <- main. Called from tests/libc/unistd_h.c:69. [eva] Done for function getuid [eva] computing for function getuid <- main. Called from tests/libc/unistd_h.c:69. [eva] Done for function getuid [eva] computing for function getuid <- main. Called from tests/libc/unistd_h.c:69. [eva] Done for function getuid [eva] computing for function getgid <- main. Called from tests/libc/unistd_h.c:70. [eva] using specification for function getgid [eva] Done for function getgid [eva] computing for function getgid <- main. Called from tests/libc/unistd_h.c:70. [eva] Done for function getgid [eva] computing for function getgid <- main. Called from tests/libc/unistd_h.c:70. [eva] Done for function getgid [eva] computing for function getgid <- main. Called from tests/libc/unistd_h.c:70. [eva] Done for function getgid [eva] computing for function geteuid <- main. Called from tests/libc/unistd_h.c:71. [eva] using specification for function geteuid [eva] Done for function geteuid [eva] computing for function geteuid <- main. Called from tests/libc/unistd_h.c:71. [eva] Done for function geteuid [eva] computing for function geteuid <- main. Called from tests/libc/unistd_h.c:71. [eva] Done for function geteuid [eva] computing for function geteuid <- main. Called from tests/libc/unistd_h.c:71. [eva] Done for function geteuid [eva] computing for function getegid <- main. Called from tests/libc/unistd_h.c:72. [eva] using specification for function getegid [eva] Done for function getegid [eva] computing for function getegid <- main. Called from tests/libc/unistd_h.c:72. [eva] Done for function getegid [eva] computing for function getegid <- main. Called from tests/libc/unistd_h.c:72. [eva] Done for function getegid [eva] computing for function getegid <- main. Called from tests/libc/unistd_h.c:72. [eva] Done for function getegid [eva] computing for function setegid <- main. Called from tests/libc/unistd_h.c:73. [eva] using specification for function setegid [eva] Done for function setegid [eva] computing for function setegid <- main. Called from tests/libc/unistd_h.c:73. [eva] Done for function setegid [eva] computing for function setegid <- main. Called from tests/libc/unistd_h.c:73. [eva] Done for function setegid [eva] computing for function setegid <- main. Called from tests/libc/unistd_h.c:73. [eva] Done for function setegid [eva] computing for function seteuid <- main. Called from tests/libc/unistd_h.c:74. [eva] using specification for function seteuid [eva] Done for function seteuid [eva] computing for function seteuid <- main. Called from tests/libc/unistd_h.c:74. [eva] Done for function seteuid [eva] computing for function seteuid <- main. Called from tests/libc/unistd_h.c:74. [eva] Done for function seteuid [eva] computing for function seteuid <- main. Called from tests/libc/unistd_h.c:74. [eva] Done for function seteuid [eva] computing for function setgid <- main. Called from tests/libc/unistd_h.c:75. [eva] using specification for function setgid [eva] Done for function setgid [eva] computing for function setgid <- main. Called from tests/libc/unistd_h.c:75. [eva] Done for function setgid [eva] computing for function setgid <- main. Called from tests/libc/unistd_h.c:75. [eva] Done for function setgid [eva] computing for function setgid <- main. Called from tests/libc/unistd_h.c:75. [eva] Done for function setgid [eva] computing for function setuid <- main. Called from tests/libc/unistd_h.c:76. [eva] using specification for function setuid [eva] Done for function setuid [eva] computing for function setuid <- main. Called from tests/libc/unistd_h.c:76. [eva] Done for function setuid [eva] computing for function setuid <- main. Called from tests/libc/unistd_h.c:76. [eva] Done for function setuid [eva] computing for function setuid <- main. Called from tests/libc/unistd_h.c:76. [eva] Done for function setuid [eva] computing for function setregid <- main. Called from tests/libc/unistd_h.c:77. [eva] using specification for function setregid [eva] Done for function setregid [eva] computing for function setregid <- main. Called from tests/libc/unistd_h.c:77. [eva] Done for function setregid [eva] computing for function setregid <- main. Called from tests/libc/unistd_h.c:77. [eva] Done for function setregid [eva] computing for function setregid <- main. Called from tests/libc/unistd_h.c:77. [eva] Done for function setregid [eva] computing for function setreuid <- main. Called from tests/libc/unistd_h.c:78. [eva] using specification for function setreuid [eva] Done for function setreuid [eva] computing for function setreuid <- main. Called from tests/libc/unistd_h.c:78. [eva] Done for function setreuid [eva] computing for function setreuid <- main. Called from tests/libc/unistd_h.c:78. [eva] Done for function setreuid [eva] computing for function setreuid <- main. Called from tests/libc/unistd_h.c:78. [eva] Done for function setreuid [eva] computing for function getpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] using specification for function getpgid [eva] Done for function getpgid [eva] computing for function getpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function getpgid [eva] computing for function getpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function getpgid [eva] computing for function getpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function getpgid [eva] computing for function setpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] using specification for function setpgid [eva] Done for function setpgid [eva] computing for function setpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function setpgid [eva] computing for function setpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function setpgid [eva] computing for function setpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function setpgid [eva] computing for function getpgrp <- main. Called from tests/libc/unistd_h.c:80. [eva] using specification for function getpgrp [eva] Done for function getpgrp [eva] computing for function getpgrp <- main. Called from tests/libc/unistd_h.c:80. [eva] Done for function getpgrp [eva] computing for function getpgrp <- main. Called from tests/libc/unistd_h.c:80. [eva] Done for function getpgrp [eva] computing for function getpgrp <- main. Called from tests/libc/unistd_h.c:80. [eva] Done for function getpgrp [eva] computing for function unlink <- main. Called from tests/libc/unistd_h.c:82. [eva] using specification for function unlink [eva] tests/libc/unistd_h.c:82: function unlink: precondition 'valid_string_path' got status valid. [eva] Done for function unlink [eva] computing for function unlink <- main. Called from tests/libc/unistd_h.c:82. [eva] Done for function unlink [eva] computing for function isatty <- main. Called from tests/libc/unistd_h.c:84. [eva] using specification for function isatty [eva] Done for function isatty [eva] computing for function isatty <- main. Called from tests/libc/unistd_h.c:84. [eva] Done for function isatty [eva] computing for function isatty <- main. Called from tests/libc/unistd_h.c:84. [eva] Done for function isatty [eva] computing for function isatty <- main. Called from tests/libc/unistd_h.c:84. [eva] Done for function isatty [eva] tests/libc/unistd_h.c:85: assertion got status valid. [eva] computing for function ttyname <- main. Called from tests/libc/unistd_h.c:86. [eva] using specification for function ttyname [eva] tests/libc/unistd_h.c:86: function ttyname: precondition 'valid_fildes' got status valid. [eva] Done for function ttyname [eva] computing for function ttyname <- main. Called from tests/libc/unistd_h.c:86. [eva] Done for function ttyname [eva] computing for function ttyname <- main. Called from tests/libc/unistd_h.c:86. [eva] Done for function ttyname [eva] computing for function ttyname <- main. Called from tests/libc/unistd_h.c:86. [eva] Done for function ttyname [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] using specification for function chown [eva] tests/libc/unistd_h.c:88: function chown: precondition 'valid_string_path' got status valid. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chdir <- main. Called from tests/libc/unistd_h.c:90. [eva] using specification for function chdir [eva] tests/libc/unistd_h.c:90: function chdir: precondition 'valid_string_path' got status valid. [eva] Done for function chdir [eva] computing for function chroot <- main. Called from tests/libc/unistd_h.c:92. [eva] using specification for function chroot [eva] tests/libc/unistd_h.c:92: function chroot: precondition 'valid_string_path' got status valid. [eva] Done for function chroot [eva] computing for function chroot <- main. Called from tests/libc/unistd_h.c:92. [eva] Done for function chroot [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:95. [eva] using specification for function pipe [eva:alarm] tests/libc/unistd_h.c:95: Warning: function pipe: precondition 'valid_pipefd' got status invalid. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:95. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:100. [eva:alarm] tests/libc/unistd_h.c:100: Warning: function pipe: precondition 'valid_pipefd' got status invalid. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:100. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:104. [eva] tests/libc/unistd_h.c:104: function pipe: precondition 'valid_pipefd' got status valid. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:104. [eva] Done for function pipe [eva] tests/libc/unistd_h.c:105: check 'ok' got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] __fc_fds[0] ∈ {0} [1..1023] ∈ [--..--] r ∈ {-1; 0} hostname[0..255] ∈ [--..--] or UNINITIALIZED fd ∈ [-1..1023] offset ∈ [-1..2147483647] fd2 ∈ [-1..1023] pid ∈ [-1..2147483647] l ∈ [--..--] cwd[0..63] ∈ [--..--] or UNINITIALIZED res_getcwd ∈ {{ NULL ; &cwd[0] }} pconf ∈ [--..--] ruid ∈ [--..--] or UNINITIALIZED euid ∈ [--..--] or UNINITIALIZED suid ∈ [--..--] or UNINITIALIZED rgid ∈ [--..--] or UNINITIALIZED egid ∈ [--..--] or UNINITIALIZED sgid ∈ [--..--] or UNINITIALIZED p ∈ [--..--] tty ∈ {{ NULL ; &__fc_ttyname[0] }} halfpipe ∈ UNINITIALIZED pipefd[0..1] ∈ [0..1023] or UNINITIALIZED __retres ∈ {0; 1} frama-c-20.0-Calcium/tests/libc/oracle/unistd_h.1.res.oracle0000666000000000000000000005612513571573400020477 0ustar [kernel] Parsing tests/libc/unistd_h.c (with preprocessing) [eva] Splitting return states on: \return(access) == 0 (auto) \return(chdir) == 0 (auto) \return(chroot) == 0 (auto) \return(chown) == 0 (auto) \return(dup) == -1 (auto) \return(getcwd) == 0 (auto) \return(gethostname) == 0 (auto) \return(getpgrp) == 0 (auto) \return(isatty) == 0 (auto) \return(pipe) == 0 (auto) \return(setegid) == 0 (auto) \return(seteuid) == 0 (auto) \return(setgid) == 0 (auto) \return(setpgid) == 0 (auto) \return(setregid) == 0 (auto) \return(setreuid) == 0 (auto) \return(setsid) == 0 (auto) \return(setuid) == 0 (auto) \return(ttyname) == 0 (auto) \return(unlink) == 0 (auto) \return(usleep) == 0 (auto) \return(getresuid) == 0 (auto) \return(setresuid) == 0 (auto) \return(getresgid) == 0 (auto) \return(setresgid) == 0 (auto) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function usleep <- main. Called from tests/libc/unistd_h.c:12. [eva] using specification for function usleep [eva] Done for function usleep [eva] computing for function usleep <- main. Called from tests/libc/unistd_h.c:13. [eva] Done for function usleep [eva] computing for function usleep <- main. Called from tests/libc/unistd_h.c:13. [eva] Done for function usleep [eva] computing for function gethostname <- main. Called from tests/libc/unistd_h.c:15. [eva] using specification for function gethostname [eva] tests/libc/unistd_h.c:15: function gethostname: precondition 'name_has_room' got status valid. [eva] Done for function gethostname [eva] computing for function gethostname <- main. Called from tests/libc/unistd_h.c:15. [eva] Done for function gethostname [eva] computing for function execl <- main. Called from tests/libc/unistd_h.c:17. [eva] using specification for function execl [eva] tests/libc/unistd_h.c:17: function execl: precondition 'valid_string_path' got status valid. [eva] tests/libc/unistd_h.c:17: function execl: precondition 'valid_string_arg' got status valid. [eva] Done for function execl [eva] computing for function execl <- main. Called from tests/libc/unistd_h.c:17. [eva] Done for function execl [eva] computing for function access <- main. Called from tests/libc/unistd_h.c:19. [eva] using specification for function access [eva] tests/libc/unistd_h.c:19: function access: precondition 'valid_string_path' got status valid. [eva] tests/libc/unistd_h.c:19: function access: precondition 'valid_amode' got status valid. [eva] Done for function access [eva] computing for function access <- main. Called from tests/libc/unistd_h.c:19. [eva] Done for function access [eva] tests/libc/unistd_h.c:20: assertion got status valid. [eva] computing for function dup <- main. Called from tests/libc/unistd_h.c:22. [eva] using specification for function dup [eva] tests/libc/unistd_h.c:22: function dup: precondition 'valid_fildes' got status valid. [eva] Done for function dup [eva] computing for function dup <- main. Called from tests/libc/unistd_h.c:22. [eva] Done for function dup [eva] tests/libc/unistd_h.c:23: assertion got status valid. [eva] computing for function lseek <- main. Called from tests/libc/unistd_h.c:27. [eva] using specification for function lseek [eva] tests/libc/unistd_h.c:27: function lseek: precondition 'valid_fd' got status valid. [eva] tests/libc/unistd_h.c:27: function lseek: precondition 'valid_whence' got status valid. [eva] Done for function lseek [eva] computing for function lseek <- main. Called from tests/libc/unistd_h.c:27. [eva] Done for function lseek [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:30. [eva] using specification for function dup2 [eva] tests/libc/unistd_h.c:30: function dup2: precondition 'valid_fildes' got status valid. [eva] tests/libc/unistd_h.c:30: function dup2: precondition 'valid_fildes2' got status valid. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:30. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:32. [eva] tests/libc/unistd_h.c:32: function dup2: precondition 'valid_fildes' got status valid. [eva:alarm] tests/libc/unistd_h.c:32: Warning: function dup2: precondition 'valid_fildes2' got status invalid. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:32. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:32. [eva] Done for function dup2 [eva] computing for function dup2 <- main. Called from tests/libc/unistd_h.c:32. [eva] Done for function dup2 [eva] computing for function fork <- main. Called from tests/libc/unistd_h.c:36. [eva] using specification for function fork [eva] Done for function fork [eva] computing for function fork <- main. Called from tests/libc/unistd_h.c:36. [eva] Done for function fork [eva] computing for function fork <- main. Called from tests/libc/unistd_h.c:36. [eva] Done for function fork [eva] computing for function fork <- main. Called from tests/libc/unistd_h.c:36. [eva] Done for function fork [eva] tests/libc/unistd_h.c:37: assertion got status valid. [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] using specification for function setsid [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function setsid <- main. Called from tests/libc/unistd_h.c:39. [eva] Done for function setsid [eva] computing for function sync <- main. Called from tests/libc/unistd_h.c:41. [eva] using specification for function sync [eva] Done for function sync [eva] computing for function sysconf <- main. Called from tests/libc/unistd_h.c:43. [eva] using specification for function sysconf [eva] Done for function sysconf [eva] computing for function getcwd <- main. Called from tests/libc/unistd_h.c:46. [eva] using specification for function getcwd [eva] tests/libc/unistd_h.c:46: function getcwd: precondition 'valid_buf' got status valid. [eva] Done for function getcwd [eva] tests/libc/unistd_h.c:48: assertion got status valid. [eva:alarm] tests/libc/unistd_h.c:49: Warning: assertion got status unknown. [eva] computing for function pathconf <- main. Called from tests/libc/unistd_h.c:52. [eva] using specification for function pathconf [eva] tests/libc/unistd_h.c:52: function pathconf: precondition 'valid_path' got status valid. [eva] Done for function pathconf [eva] computing for function pathconf <- main. Called from tests/libc/unistd_h.c:52. [eva] Done for function pathconf [eva] computing for function getresuid <- main. Called from tests/libc/unistd_h.c:55. [eva] using specification for function getresuid [eva] tests/libc/unistd_h.c:55: function getresuid: precondition 'valid_ruid' got status valid. [eva] tests/libc/unistd_h.c:55: function getresuid: precondition 'valid_euid' got status valid. [eva] tests/libc/unistd_h.c:55: function getresuid: precondition 'valid_suid' got status valid. [eva] Done for function getresuid [eva] computing for function getresuid <- main. Called from tests/libc/unistd_h.c:55. [eva] Done for function getresuid [eva] computing for function setresuid <- main. Called from tests/libc/unistd_h.c:57. [eva] using specification for function setresuid [eva] Done for function setresuid [eva] computing for function setresuid <- main. Called from tests/libc/unistd_h.c:57. [eva] Done for function setresuid [eva] tests/libc/unistd_h.c:58: assertion got status valid. [eva] computing for function getresgid <- main. Called from tests/libc/unistd_h.c:61. [eva] using specification for function getresgid [eva] tests/libc/unistd_h.c:61: function getresgid: precondition 'valid_rgid' got status valid. [eva] tests/libc/unistd_h.c:61: function getresgid: precondition 'valid_egid' got status valid. [eva] tests/libc/unistd_h.c:61: function getresgid: precondition 'valid_sgid' got status valid. [eva] Done for function getresgid [eva] computing for function getresgid <- main. Called from tests/libc/unistd_h.c:61. [eva] Done for function getresgid [eva] computing for function getresgid <- main. Called from tests/libc/unistd_h.c:61. [eva] Done for function getresgid [eva] computing for function getresgid <- main. Called from tests/libc/unistd_h.c:61. [eva] Done for function getresgid [eva] computing for function setresgid <- main. Called from tests/libc/unistd_h.c:63. [eva] using specification for function setresgid [eva] Done for function setresgid [eva] computing for function setresgid <- main. Called from tests/libc/unistd_h.c:63. [eva] Done for function setresgid [eva] tests/libc/unistd_h.c:64: assertion got status valid. [eva] computing for function getpid <- main. Called from tests/libc/unistd_h.c:66. [eva] using specification for function getpid [eva] Done for function getpid [eva] computing for function getpid <- main. Called from tests/libc/unistd_h.c:66. [eva] Done for function getpid [eva] computing for function getpid <- main. Called from tests/libc/unistd_h.c:66. [eva] Done for function getpid [eva] computing for function getpid <- main. Called from tests/libc/unistd_h.c:66. [eva] Done for function getpid [eva] computing for function getppid <- main. Called from tests/libc/unistd_h.c:67. [eva] using specification for function getppid [eva] Done for function getppid [eva] computing for function getppid <- main. Called from tests/libc/unistd_h.c:67. [eva] Done for function getppid [eva] computing for function getppid <- main. Called from tests/libc/unistd_h.c:67. [eva] Done for function getppid [eva] computing for function getppid <- main. Called from tests/libc/unistd_h.c:67. [eva] Done for function getppid [eva] computing for function getsid <- main. Called from tests/libc/unistd_h.c:68. [eva] using specification for function getsid [eva] Done for function getsid [eva] computing for function getsid <- main. Called from tests/libc/unistd_h.c:68. [eva] Done for function getsid [eva] computing for function getsid <- main. Called from tests/libc/unistd_h.c:68. [eva] Done for function getsid [eva] computing for function getsid <- main. Called from tests/libc/unistd_h.c:68. [eva] Done for function getsid [eva] computing for function getuid <- main. Called from tests/libc/unistd_h.c:69. [eva] using specification for function getuid [eva] Done for function getuid [eva] computing for function getuid <- main. Called from tests/libc/unistd_h.c:69. [eva] Done for function getuid [eva] computing for function getuid <- main. Called from tests/libc/unistd_h.c:69. [eva] Done for function getuid [eva] computing for function getuid <- main. Called from tests/libc/unistd_h.c:69. [eva] Done for function getuid [eva] computing for function getgid <- main. Called from tests/libc/unistd_h.c:70. [eva] using specification for function getgid [eva] Done for function getgid [eva] computing for function getgid <- main. Called from tests/libc/unistd_h.c:70. [eva] Done for function getgid [eva] computing for function getgid <- main. Called from tests/libc/unistd_h.c:70. [eva] Done for function getgid [eva] computing for function getgid <- main. Called from tests/libc/unistd_h.c:70. [eva] Done for function getgid [eva] computing for function geteuid <- main. Called from tests/libc/unistd_h.c:71. [eva] using specification for function geteuid [eva] Done for function geteuid [eva] computing for function geteuid <- main. Called from tests/libc/unistd_h.c:71. [eva] Done for function geteuid [eva] computing for function geteuid <- main. Called from tests/libc/unistd_h.c:71. [eva] Done for function geteuid [eva] computing for function geteuid <- main. Called from tests/libc/unistd_h.c:71. [eva] Done for function geteuid [eva] computing for function getegid <- main. Called from tests/libc/unistd_h.c:72. [eva] using specification for function getegid [eva] Done for function getegid [eva] computing for function getegid <- main. Called from tests/libc/unistd_h.c:72. [eva] Done for function getegid [eva] computing for function getegid <- main. Called from tests/libc/unistd_h.c:72. [eva] Done for function getegid [eva] computing for function getegid <- main. Called from tests/libc/unistd_h.c:72. [eva] Done for function getegid [eva] computing for function setegid <- main. Called from tests/libc/unistd_h.c:73. [eva] using specification for function setegid [eva] Done for function setegid [eva] computing for function setegid <- main. Called from tests/libc/unistd_h.c:73. [eva] Done for function setegid [eva] computing for function setegid <- main. Called from tests/libc/unistd_h.c:73. [eva] Done for function setegid [eva] computing for function setegid <- main. Called from tests/libc/unistd_h.c:73. [eva] Done for function setegid [eva] computing for function seteuid <- main. Called from tests/libc/unistd_h.c:74. [eva] using specification for function seteuid [eva] Done for function seteuid [eva] computing for function seteuid <- main. Called from tests/libc/unistd_h.c:74. [eva] Done for function seteuid [eva] computing for function seteuid <- main. Called from tests/libc/unistd_h.c:74. [eva] Done for function seteuid [eva] computing for function seteuid <- main. Called from tests/libc/unistd_h.c:74. [eva] Done for function seteuid [eva] computing for function setgid <- main. Called from tests/libc/unistd_h.c:75. [eva] using specification for function setgid [eva] Done for function setgid [eva] computing for function setgid <- main. Called from tests/libc/unistd_h.c:75. [eva] Done for function setgid [eva] computing for function setgid <- main. Called from tests/libc/unistd_h.c:75. [eva] Done for function setgid [eva] computing for function setgid <- main. Called from tests/libc/unistd_h.c:75. [eva] Done for function setgid [eva] computing for function setuid <- main. Called from tests/libc/unistd_h.c:76. [eva] using specification for function setuid [eva] Done for function setuid [eva] computing for function setuid <- main. Called from tests/libc/unistd_h.c:76. [eva] Done for function setuid [eva] computing for function setuid <- main. Called from tests/libc/unistd_h.c:76. [eva] Done for function setuid [eva] computing for function setuid <- main. Called from tests/libc/unistd_h.c:76. [eva] Done for function setuid [eva] computing for function setregid <- main. Called from tests/libc/unistd_h.c:77. [eva] using specification for function setregid [eva] Done for function setregid [eva] computing for function setregid <- main. Called from tests/libc/unistd_h.c:77. [eva] Done for function setregid [eva] computing for function setregid <- main. Called from tests/libc/unistd_h.c:77. [eva] Done for function setregid [eva] computing for function setregid <- main. Called from tests/libc/unistd_h.c:77. [eva] Done for function setregid [eva] computing for function setreuid <- main. Called from tests/libc/unistd_h.c:78. [eva] using specification for function setreuid [eva] Done for function setreuid [eva] computing for function setreuid <- main. Called from tests/libc/unistd_h.c:78. [eva] Done for function setreuid [eva] computing for function setreuid <- main. Called from tests/libc/unistd_h.c:78. [eva] Done for function setreuid [eva] computing for function setreuid <- main. Called from tests/libc/unistd_h.c:78. [eva] Done for function setreuid [eva] computing for function getpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] using specification for function getpgid [eva] Done for function getpgid [eva] computing for function getpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function getpgid [eva] computing for function getpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function getpgid [eva] computing for function getpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function getpgid [eva] computing for function setpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] using specification for function setpgid [eva] Done for function setpgid [eva] computing for function setpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function setpgid [eva] computing for function setpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function setpgid [eva] computing for function setpgid <- main. Called from tests/libc/unistd_h.c:79. [eva] Done for function setpgid [eva] computing for function getpgrp <- main. Called from tests/libc/unistd_h.c:80. [eva] using specification for function getpgrp [eva] Done for function getpgrp [eva] computing for function getpgrp <- main. Called from tests/libc/unistd_h.c:80. [eva] Done for function getpgrp [eva] computing for function getpgrp <- main. Called from tests/libc/unistd_h.c:80. [eva] Done for function getpgrp [eva] computing for function getpgrp <- main. Called from tests/libc/unistd_h.c:80. [eva] Done for function getpgrp [eva] computing for function unlink <- main. Called from tests/libc/unistd_h.c:82. [eva] using specification for function unlink [eva] tests/libc/unistd_h.c:82: function unlink: precondition 'valid_string_path' got status valid. [eva] Done for function unlink [eva] computing for function unlink <- main. Called from tests/libc/unistd_h.c:82. [eva] Done for function unlink [eva] computing for function isatty <- main. Called from tests/libc/unistd_h.c:84. [eva] using specification for function isatty [eva] Done for function isatty [eva] computing for function isatty <- main. Called from tests/libc/unistd_h.c:84. [eva] Done for function isatty [eva] computing for function isatty <- main. Called from tests/libc/unistd_h.c:84. [eva] Done for function isatty [eva] computing for function isatty <- main. Called from tests/libc/unistd_h.c:84. [eva] Done for function isatty [eva] tests/libc/unistd_h.c:85: assertion got status valid. [eva] computing for function ttyname <- main. Called from tests/libc/unistd_h.c:86. [eva] using specification for function ttyname [eva] tests/libc/unistd_h.c:86: function ttyname: precondition 'valid_fildes' got status valid. [eva] Done for function ttyname [eva] computing for function ttyname <- main. Called from tests/libc/unistd_h.c:86. [eva] Done for function ttyname [eva] computing for function ttyname <- main. Called from tests/libc/unistd_h.c:86. [eva] Done for function ttyname [eva] computing for function ttyname <- main. Called from tests/libc/unistd_h.c:86. [eva] Done for function ttyname [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] using specification for function chown [eva] tests/libc/unistd_h.c:88: function chown: precondition 'valid_string_path' got status valid. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chown <- main. Called from tests/libc/unistd_h.c:88. [eva] Done for function chown [eva] computing for function chdir <- main. Called from tests/libc/unistd_h.c:90. [eva] using specification for function chdir [eva] tests/libc/unistd_h.c:90: function chdir: precondition 'valid_string_path' got status valid. [eva] Done for function chdir [eva] computing for function chroot <- main. Called from tests/libc/unistd_h.c:92. [eva] using specification for function chroot [eva] tests/libc/unistd_h.c:92: function chroot: precondition 'valid_string_path' got status valid. [eva] Done for function chroot [eva] computing for function chroot <- main. Called from tests/libc/unistd_h.c:92. [eva] Done for function chroot [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:95. [eva] using specification for function pipe [eva:alarm] tests/libc/unistd_h.c:95: Warning: function pipe: precondition 'valid_pipefd' got status invalid. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:95. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:100. [eva:alarm] tests/libc/unistd_h.c:100: Warning: function pipe: precondition 'valid_pipefd' got status invalid. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:100. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:104. [eva] tests/libc/unistd_h.c:104: function pipe: precondition 'valid_pipefd' got status valid. [eva] Done for function pipe [eva] computing for function pipe <- main. Called from tests/libc/unistd_h.c:104. [eva] Done for function pipe [eva] tests/libc/unistd_h.c:105: check 'ok' got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] __fc_fds[0] ∈ {0} [1..1023] ∈ [--..--] r ∈ {-1; 0} hostname[0..255] ∈ [--..--] or UNINITIALIZED fd ∈ [-1..1023] offset ∈ [-1..2147483647] fd2 ∈ [-1..1023] pid ∈ [-1..2147483647] l ∈ [--..--] cwd[0..63] ∈ [--..--] or UNINITIALIZED res_getcwd ∈ {{ NULL ; &cwd[0] }} pconf ∈ [--..--] ruid ∈ [--..--] or UNINITIALIZED euid ∈ [--..--] or UNINITIALIZED suid ∈ [--..--] or UNINITIALIZED rgid ∈ [--..--] or UNINITIALIZED egid ∈ [--..--] or UNINITIALIZED sgid ∈ [--..--] or UNINITIALIZED p ∈ [--..--] tty ∈ {{ NULL ; &__fc_ttyname[0] }} halfpipe ∈ UNINITIALIZED pipefd[0..1] ∈ [0..1023] or UNINITIALIZED __retres ∈ {0; 1} frama-c-20.0-Calcium/tests/libc/oracle/wchar_c_h.0.res.oracle0000666000000000000000000002701213571573400020567 0ustar [kernel] Parsing tests/libc/wchar_c_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization wc ∈ {-1} wi ∈ {4294967295} t ∈ {0} nondet ∈ [--..--] [eva] tests/libc/wchar_c_h.c:31: Call to builtin wmemchr [eva] tests/libc/wchar_c_h.c:31: function wmemchr: precondition 'valid' got status valid. [eva] share/libc/wchar.h:58: Cannot evaluate range bound wmemchr_off(s, c, n) (unsupported ACSL construct: logic function wmemchr_off). Approximating [eva] tests/libc/wchar_c_h.c:31: function wmemchr: precondition 'initialization' got status valid. [eva] tests/libc/wchar_c_h.c:31: function wmemchr: precondition 'danglingness' got status valid. [eva] computing for function wmemcmp <- main. Called from tests/libc/wchar_c_h.c:32. [eva] using specification for function wmemcmp [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'valid_s1' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'valid_s2' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'initialization,s1' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'initialization,s2' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'danglingness,s1' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'danglingness,s2' got status valid. [eva] Done for function wmemcmp [eva] computing for function wmemcpy <- main. Called from tests/libc/wchar_c_h.c:33. [eva] Recording results for wmemcpy [eva] Done for function wmemcpy [eva] computing for function wmemmove <- main. Called from tests/libc/wchar_c_h.c:34. [eva] using specification for function wmemmove [eva] tests/libc/wchar_c_h.c:34: function wmemmove: precondition 'valid_src' got status valid. [eva] tests/libc/wchar_c_h.c:34: function wmemmove: precondition 'valid_dest' got status valid. [eva] Done for function wmemmove [eva] computing for function wmemset <- main. Called from tests/libc/wchar_c_h.c:35. [eva] Recording results for wmemset [eva] Done for function wmemset [eva] tests/libc/wchar_c_h.c:36: Call to builtin wcschr [eva] tests/libc/wchar_c_h.c:36: function wcschr: precondition 'valid_wstring_src' got status valid. [eva] computing for function wcscmp <- main. Called from tests/libc/wchar_c_h.c:37. [eva] using specification for function wcscmp [eva] tests/libc/wchar_c_h.c:37: function wcscmp: precondition 'valid_wstring_s1' got status valid. [eva] tests/libc/wchar_c_h.c:37: function wcscmp: precondition 'valid_wstring_s2' got status valid. [eva] Done for function wcscmp [eva] computing for function wcscpy <- main. Called from tests/libc/wchar_c_h.c:38. [eva] Recording results for wcscpy [eva] Done for function wcscpy [eva] computing for function wcscspn <- main. Called from tests/libc/wchar_c_h.c:39. [eva] using specification for function wcscspn [eva] tests/libc/wchar_c_h.c:39: function wcscspn: precondition 'valid_wstring_wcs' got status valid. [eva] tests/libc/wchar_c_h.c:39: function wcscspn: precondition 'valid_wstring_accept' got status valid. [eva] Done for function wcscspn [eva] computing for function wcslcat <- main. Called from tests/libc/wchar_c_h.c:40. [eva] using specification for function wcslcat [eva] tests/libc/wchar_c_h.c:40: function wcslcat: precondition 'valid_nwstring_src' got status valid. [eva:alarm] tests/libc/wchar_c_h.c:40: Warning: function wcslcat: precondition 'valid_wstring_dest' got status invalid. [eva] tests/libc/wchar_c_h.c:40: function wcslcat: no state left, precondition 'room_for_concatenation' got status valid. [eva] tests/libc/wchar_c_h.c:40: function wcslcat: no state left, precondition 'separation' got status valid. [eva] Done for function wcslcat [eva] computing for function wcslcpy <- main. Called from tests/libc/wchar_c_h.c:41. [eva] using specification for function wcslcpy [eva] tests/libc/wchar_c_h.c:41: function wcslcpy: precondition 'valid_wstring_src' got status valid. [eva] tests/libc/wchar_c_h.c:41: function wcslcpy: precondition 'room_nwstring' got status valid. [eva] tests/libc/wchar_c_h.c:41: function wcslcpy: precondition 'separation,dest,src' got status valid. [eva] Done for function wcslcpy [eva] tests/libc/wchar_c_h.c:42: Call to builtin wcslen [eva] tests/libc/wchar_c_h.c:42: function wcslen: precondition 'valid_string_s' got status valid. [eva] computing for function wcsncmp <- main. Called from tests/libc/wchar_c_h.c:43. [eva] using specification for function wcsncmp [eva] tests/libc/wchar_c_h.c:43: function wcsncmp: precondition 'valid_wstring_s1' got status valid. [eva] tests/libc/wchar_c_h.c:43: function wcsncmp: precondition 'valid_wstring_s2' got status valid. [eva] Done for function wcsncmp [eva] computing for function wcsncpy <- main. Called from tests/libc/wchar_c_h.c:44. [eva] Recording results for wcsncpy [eva] Done for function wcsncpy [eva] computing for function wcspbrk <- main. Called from tests/libc/wchar_c_h.c:45. [eva] using specification for function wcspbrk [eva] tests/libc/wchar_c_h.c:45: function wcspbrk: precondition 'valid_wstring_wcs' got status valid. [eva] tests/libc/wchar_c_h.c:45: function wcspbrk: precondition 'valid_wstring_accept' got status valid. [eva] Done for function wcspbrk [eva] computing for function wcsrchr <- main. Called from tests/libc/wchar_c_h.c:46. [eva] using specification for function wcsrchr [eva] tests/libc/wchar_c_h.c:46: function wcsrchr: precondition 'valid_wstring_wcs' got status valid. [eva] Done for function wcsrchr [eva] computing for function wcsspn <- main. Called from tests/libc/wchar_c_h.c:47. [eva] using specification for function wcsspn [eva] tests/libc/wchar_c_h.c:47: function wcsspn: precondition 'valid_wstring_wcs' got status valid. [eva] tests/libc/wchar_c_h.c:47: function wcsspn: precondition 'valid_wstring_accept' got status valid. [eva] Done for function wcsspn [eva] computing for function wcsstr <- main. Called from tests/libc/wchar_c_h.c:48. [eva] using specification for function wcsstr [eva] tests/libc/wchar_c_h.c:48: function wcsstr: precondition 'valid_wstring_haystack' got status valid. [eva] tests/libc/wchar_c_h.c:48: function wcsstr: precondition 'valid_wstring_needle' got status valid. [eva] Done for function wcsstr [eva] computing for function wcscat <- main. Called from tests/libc/wchar_c_h.c:52. [eva] share/libc/wchar.c:74: Call to builtin wcslen [eva] share/libc/wchar.c:74: function wcslen: precondition 'valid_string_s' got status valid. [eva] Recording results for wcscat [eva] Done for function wcscat [eva] computing for function wcsncat <- main. Called from tests/libc/wchar_c_h.c:54. [eva] share/libc/wchar.c:84: Call to builtin wcslen [eva] share/libc/wchar.c:84: function wcslen: precondition 'valid_string_s' got status valid. [eva] Recording results for wcsncat [eva] Done for function wcsncat [eva] tests/libc/wchar_c_h.c:57: Call to builtin wcslen [eva:alarm] tests/libc/wchar_c_h.c:57: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/libc/wchar_c_h.c:58: Call to builtin wcslen [eva:alarm] tests/libc/wchar_c_h.c:58: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/libc/wchar_c_h.c:59: Call to builtin wcslen [eva:alarm] tests/libc/wchar_c_h.c:59: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/libc/wchar_c_h.c:61: Call to builtin wcschr [eva:alarm] tests/libc/wchar_c_h.c:61: Warning: function wcschr: precondition 'valid_wstring_src' got status invalid. [eva] tests/libc/wchar_c_h.c:62: Call to builtin wcschr [eva:alarm] tests/libc/wchar_c_h.c:62: Warning: function wcschr: precondition 'valid_wstring_src' got status invalid. [eva] tests/libc/wchar_c_h.c:63: Call to builtin wcschr [eva:alarm] tests/libc/wchar_c_h.c:63: Warning: function wcschr: precondition 'valid_wstring_src' got status invalid. [eva] tests/libc/wchar_c_h.c:68: Call to builtin wcschr [eva] tests/libc/wchar_c_h.c:68: function wcschr: precondition 'valid_wstring_src' got status valid. [eva] tests/libc/wchar_c_h.c:69: Call to builtin wmemchr [eva] tests/libc/wchar_c_h.c:69: function wmemchr: precondition 'valid' got status valid. [eva] tests/libc/wchar_c_h.c:69: function wmemchr: precondition 'initialization' got status valid. [eva] tests/libc/wchar_c_h.c:69: function wmemchr: precondition 'danglingness' got status valid. [eva] tests/libc/wchar_c_h.c:70: Call to builtin wmemchr [eva] tests/libc/wchar_c_h.c:70: function wmemchr: precondition 'valid' got status valid. [eva] tests/libc/wchar_c_h.c:70: function wmemchr: precondition 'initialization' got status valid. [eva] tests/libc/wchar_c_h.c:70: function wmemchr: precondition 'danglingness' got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function wcscpy: i ∈ {8} buf[0] ∈ {72} [1] ∈ {97} [2] ∈ {121} [3] ∈ {115} [4] ∈ {116} [5] ∈ {97} [6] ∈ {99} [7] ∈ {107} [8] ∈ {0} [9..19] ∈ UNINITIALIZED [eva:final-states] Values at end of function wcscat: i ∈ {8} n ∈ {0; 1; 2; 3; 4; 5} buf[0..4] ∈ [--..--] [5] ∈ {0; 72; 97; 115; 116; 121} [6] ∈ {97; 99; 115; 116; 121} or UNINITIALIZED [7] ∈ {97; 99; 107; 115; 116; 121} or UNINITIALIZED [8] ∈ {0; 97; 99; 107; 115; 116} or UNINITIALIZED [9] ∈ {0; 97; 99; 107; 116} or UNINITIALIZED [10] ∈ {0; 97; 99; 107} or UNINITIALIZED [11] ∈ {0; 99; 107} or UNINITIALIZED [12] ∈ {0; 107} or UNINITIALIZED [13] ∈ {0} or UNINITIALIZED [14..19] ∈ UNINITIALIZED [eva:final-states] Values at end of function wcsncat: dest_len ∈ {0; 1; 2; 3; 4; 5} i ∈ {5} buf[0..4] ∈ [--..--] [5] ∈ {0; 72; 97; 115; 116; 121} [6] ∈ {0; 97; 115; 116; 121} or UNINITIALIZED [7] ∈ {0; 115; 116; 121} or UNINITIALIZED [8] ∈ {0; 115; 116} or UNINITIALIZED [9] ∈ {0; 116} or UNINITIALIZED [10] ∈ {0} or UNINITIALIZED [11..19] ∈ UNINITIALIZED [eva:final-states] Values at end of function wcsncpy: i ∈ {5} buf[0] ∈ {72} [1] ∈ {97} [2] ∈ {121} [3] ∈ {115} [4] ∈ {116} [5..19] ∈ UNINITIALIZED [eva:final-states] Values at end of function wmemcpy: buf[0] ∈ {72} [1] ∈ {97} [2] ∈ {121} [3] ∈ {115} [4] ∈ {116} [5..19] ∈ UNINITIALIZED [eva:final-states] Values at end of function wmemset: buf[0..4] ∈ [--..--] [5..19] ∈ UNINITIALIZED [eva:final-states] Values at end of function main: sc1 ∈ {{ L"Needle" }} sc2 ∈ {{ L"Haystack" }} buf[0..4] ∈ [--..--] or UNINITIALIZED [5] ∈ {0; 72; 97; 115; 116; 121} or UNINITIALIZED [6] ∈ {0; 97; 99; 115; 116; 121} or UNINITIALIZED [7] ∈ {0; 97; 99; 107; 115; 116; 121} or UNINITIALIZED [8] ∈ {0; 97; 99; 107; 115; 116} or UNINITIALIZED [9] ∈ {0; 97; 99; 107; 116} or UNINITIALIZED [10] ∈ {0; 97; 99; 107} or UNINITIALIZED [11] ∈ {0; 99; 107} or UNINITIALIZED [12] ∈ {0; 107} or UNINITIALIZED [13] ∈ {0} or UNINITIALIZED [14..19] ∈ UNINITIALIZED c ∈ [--..--] n ∈ {5} r ∈ [--..--] or UNINITIALIZED i ∈ [--..--] res ∈ {{ NULL ; &buf[0] ; L"Needle" + [0..--],0%4 }} wc_0 ∈ {{ L"ABC" }} p ∈ {{ L"ABC" + {4} }} wcr ∈ {{ L"ABC" + {8} }} wmr1 ∈ {0} wmr2 ∈ {{ L"ABC" + {8} }} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/wchar_c_h.1.res.oracle0000666000000000000000000002566013571573400020577 0ustar [kernel] Parsing tests/libc/wchar_c_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization wc ∈ {-1} wi ∈ {4294967295} t ∈ {0} nondet ∈ [--..--] [eva] tests/libc/wchar_c_h.c:31: Call to builtin wmemchr [eva] tests/libc/wchar_c_h.c:31: function wmemchr: precondition 'valid' got status valid. [eva] share/libc/wchar.h:58: Cannot evaluate range bound wmemchr_off(s, c, n) (unsupported ACSL construct: logic function wmemchr_off). Approximating [eva] tests/libc/wchar_c_h.c:31: function wmemchr: precondition 'initialization' got status valid. [eva] tests/libc/wchar_c_h.c:31: function wmemchr: precondition 'danglingness' got status valid. [eva] computing for function wmemcmp <- main. Called from tests/libc/wchar_c_h.c:32. [eva] using specification for function wmemcmp [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'valid_s1' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'valid_s2' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'initialization,s1' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'initialization,s2' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'danglingness,s1' got status valid. [eva] tests/libc/wchar_c_h.c:32: function wmemcmp: precondition 'danglingness,s2' got status valid. [eva] Done for function wmemcmp [eva] computing for function wmemcpy <- main. Called from tests/libc/wchar_c_h.c:33. [eva] using specification for function wmemcpy [eva] tests/libc/wchar_c_h.c:33: function wmemcpy: precondition 'valid_dest' got status valid. [eva] tests/libc/wchar_c_h.c:33: function wmemcpy: precondition 'valid_src' got status valid. [eva] tests/libc/wchar_c_h.c:33: function wmemcpy: precondition 'separation,dest,src' got status valid. [eva] Done for function wmemcpy [eva] computing for function wmemmove <- main. Called from tests/libc/wchar_c_h.c:34. [eva] using specification for function wmemmove [eva] tests/libc/wchar_c_h.c:34: function wmemmove: precondition 'valid_src' got status valid. [eva] tests/libc/wchar_c_h.c:34: function wmemmove: precondition 'valid_dest' got status valid. [eva] Done for function wmemmove [eva] computing for function wmemset <- main. Called from tests/libc/wchar_c_h.c:35. [eva] using specification for function wmemset [eva] tests/libc/wchar_c_h.c:35: function wmemset: precondition 'valid_wcs' got status valid. [eva] Done for function wmemset [eva] tests/libc/wchar_c_h.c:36: Call to builtin wcschr [eva] tests/libc/wchar_c_h.c:36: function wcschr: precondition 'valid_wstring_src' got status valid. [eva] computing for function wcscmp <- main. Called from tests/libc/wchar_c_h.c:37. [eva] using specification for function wcscmp [eva] tests/libc/wchar_c_h.c:37: function wcscmp: precondition 'valid_wstring_s1' got status valid. [eva] tests/libc/wchar_c_h.c:37: function wcscmp: precondition 'valid_wstring_s2' got status valid. [eva] Done for function wcscmp [eva] computing for function wcscpy <- main. Called from tests/libc/wchar_c_h.c:38. [eva] using specification for function wcscpy [eva] tests/libc/wchar_c_h.c:38: function wcscpy: precondition 'valid_wstring_src' got status valid. [eva] tests/libc/wchar_c_h.c:38: function wcscpy: precondition 'room_wstring' got status valid. [eva] tests/libc/wchar_c_h.c:38: function wcscpy: precondition 'separation' got status valid. [eva] Done for function wcscpy [eva] computing for function wcscspn <- main. Called from tests/libc/wchar_c_h.c:39. [eva] using specification for function wcscspn [eva] tests/libc/wchar_c_h.c:39: function wcscspn: precondition 'valid_wstring_wcs' got status valid. [eva] tests/libc/wchar_c_h.c:39: function wcscspn: precondition 'valid_wstring_accept' got status valid. [eva] Done for function wcscspn [eva] computing for function wcslcat <- main. Called from tests/libc/wchar_c_h.c:40. [eva] using specification for function wcslcat [eva] tests/libc/wchar_c_h.c:40: function wcslcat: precondition 'valid_nwstring_src' got status valid. [eva:alarm] tests/libc/wchar_c_h.c:40: Warning: function wcslcat: precondition 'valid_wstring_dest' got status invalid. [eva] tests/libc/wchar_c_h.c:40: function wcslcat: no state left, precondition 'room_for_concatenation' got status valid. [eva] tests/libc/wchar_c_h.c:40: function wcslcat: no state left, precondition 'separation' got status valid. [eva] Done for function wcslcat [eva] computing for function wcslcpy <- main. Called from tests/libc/wchar_c_h.c:41. [eva] using specification for function wcslcpy [eva] tests/libc/wchar_c_h.c:41: function wcslcpy: precondition 'valid_wstring_src' got status valid. [eva] tests/libc/wchar_c_h.c:41: function wcslcpy: precondition 'room_nwstring' got status valid. [eva] tests/libc/wchar_c_h.c:41: function wcslcpy: precondition 'separation,dest,src' got status valid. [eva] Done for function wcslcpy [eva] tests/libc/wchar_c_h.c:42: Call to builtin wcslen [eva] tests/libc/wchar_c_h.c:42: function wcslen: precondition 'valid_string_s' got status valid. [eva] computing for function wcsncmp <- main. Called from tests/libc/wchar_c_h.c:43. [eva] using specification for function wcsncmp [eva] tests/libc/wchar_c_h.c:43: function wcsncmp: precondition 'valid_wstring_s1' got status valid. [eva] tests/libc/wchar_c_h.c:43: function wcsncmp: precondition 'valid_wstring_s2' got status valid. [eva] Done for function wcsncmp [eva] computing for function wcsncpy <- main. Called from tests/libc/wchar_c_h.c:44. [eva] using specification for function wcsncpy [eva] tests/libc/wchar_c_h.c:44: function wcsncpy: precondition 'valid_wstring_src' got status valid. [eva] tests/libc/wchar_c_h.c:44: function wcsncpy: precondition 'room_nwstring' got status valid. [eva] tests/libc/wchar_c_h.c:44: function wcsncpy: precondition 'separation,dest,src' got status valid. [eva] Done for function wcsncpy [eva] computing for function wcspbrk <- main. Called from tests/libc/wchar_c_h.c:45. [eva] using specification for function wcspbrk [eva] tests/libc/wchar_c_h.c:45: function wcspbrk: precondition 'valid_wstring_wcs' got status valid. [eva] tests/libc/wchar_c_h.c:45: function wcspbrk: precondition 'valid_wstring_accept' got status valid. [eva] Done for function wcspbrk [eva] computing for function wcsrchr <- main. Called from tests/libc/wchar_c_h.c:46. [eva] using specification for function wcsrchr [eva] tests/libc/wchar_c_h.c:46: function wcsrchr: precondition 'valid_wstring_wcs' got status valid. [eva] Done for function wcsrchr [eva] computing for function wcsspn <- main. Called from tests/libc/wchar_c_h.c:47. [eva] using specification for function wcsspn [eva] tests/libc/wchar_c_h.c:47: function wcsspn: precondition 'valid_wstring_wcs' got status valid. [eva] tests/libc/wchar_c_h.c:47: function wcsspn: precondition 'valid_wstring_accept' got status valid. [eva] Done for function wcsspn [eva] computing for function wcsstr <- main. Called from tests/libc/wchar_c_h.c:48. [eva] using specification for function wcsstr [eva] tests/libc/wchar_c_h.c:48: function wcsstr: precondition 'valid_wstring_haystack' got status valid. [eva] tests/libc/wchar_c_h.c:48: function wcsstr: precondition 'valid_wstring_needle' got status valid. [eva] Done for function wcsstr [eva] computing for function wcscat <- main. Called from tests/libc/wchar_c_h.c:52. [eva] using specification for function wcscat [eva] tests/libc/wchar_c_h.c:52: function wcscat: precondition 'valid_wstring_src' got status valid. [eva] tests/libc/wchar_c_h.c:52: function wcscat: precondition 'valid_wstring_dest' got status valid. [eva] tests/libc/wchar_c_h.c:52: function wcscat: precondition 'room_for_concatenation' got status valid. [eva] tests/libc/wchar_c_h.c:52: function wcscat: precondition 'separation' got status valid. [eva] Done for function wcscat [eva] computing for function wcsncat <- main. Called from tests/libc/wchar_c_h.c:54. [eva] using specification for function wcsncat [eva] tests/libc/wchar_c_h.c:54: function wcsncat: precondition 'valid_nwstring_src' got status valid. [eva] tests/libc/wchar_c_h.c:54: function wcsncat: precondition 'valid_wstring_dest' got status valid. [eva] tests/libc/wchar_c_h.c:54: function wcsncat: precondition 'room_for_concatenation' got status valid. [eva] tests/libc/wchar_c_h.c:54: function wcsncat: precondition 'separation' got status valid. [eva] Done for function wcsncat [eva] tests/libc/wchar_c_h.c:57: Call to builtin wcslen [eva:alarm] tests/libc/wchar_c_h.c:57: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/libc/wchar_c_h.c:58: Call to builtin wcslen [eva:alarm] tests/libc/wchar_c_h.c:58: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/libc/wchar_c_h.c:59: Call to builtin wcslen [eva:alarm] tests/libc/wchar_c_h.c:59: Warning: function wcslen: precondition 'valid_string_s' got status invalid. [eva] tests/libc/wchar_c_h.c:61: Call to builtin wcschr [eva:alarm] tests/libc/wchar_c_h.c:61: Warning: function wcschr: precondition 'valid_wstring_src' got status invalid. [eva] tests/libc/wchar_c_h.c:62: Call to builtin wcschr [eva:alarm] tests/libc/wchar_c_h.c:62: Warning: function wcschr: precondition 'valid_wstring_src' got status invalid. [eva] tests/libc/wchar_c_h.c:63: Call to builtin wcschr [eva:alarm] tests/libc/wchar_c_h.c:63: Warning: function wcschr: precondition 'valid_wstring_src' got status invalid. [eva] tests/libc/wchar_c_h.c:68: Call to builtin wcschr [eva] tests/libc/wchar_c_h.c:68: function wcschr: precondition 'valid_wstring_src' got status valid. [eva] tests/libc/wchar_c_h.c:69: Call to builtin wmemchr [eva] tests/libc/wchar_c_h.c:69: function wmemchr: precondition 'valid' got status valid. [eva] tests/libc/wchar_c_h.c:69: function wmemchr: precondition 'initialization' got status valid. [eva] tests/libc/wchar_c_h.c:69: function wmemchr: precondition 'danglingness' got status valid. [eva] tests/libc/wchar_c_h.c:70: Call to builtin wmemchr [eva] tests/libc/wchar_c_h.c:70: function wmemchr: precondition 'valid' got status valid. [eva] tests/libc/wchar_c_h.c:70: function wmemchr: precondition 'initialization' got status valid. [eva] tests/libc/wchar_c_h.c:70: function wmemchr: precondition 'danglingness' got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: sc1 ∈ {{ L"Needle" }} sc2 ∈ {{ L"Haystack" }} buf[0..19] ∈ [--..--] or UNINITIALIZED c ∈ [--..--] n ∈ {5} r ∈ [--..--] or UNINITIALIZED i ∈ [--..--] res ∈ {{ NULL ; &buf[0] ; L"Needle" + [0..--],0%4 }} wc_0 ∈ {{ L"ABC" }} p ∈ {{ L"ABC" + {4} }} wcr ∈ {{ L"ABC" + {8} }} wmr1 ∈ {0} wmr2 ∈ {{ L"ABC" + {8} }} __retres ∈ {0} frama-c-20.0-Calcium/tests/libc/oracle/wchar_h.res.oracle0000666000000000000000000002417613571573400020137 0ustar [kernel] Parsing tests/libc/wchar_h.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function fopen <- main. Called from tests/libc/wchar_h.c:5. [eva] using specification for function fopen [eva] tests/libc/wchar_h.c:5: function fopen: precondition 'valid_filename' got status valid. [eva] tests/libc/wchar_h.c:5: function fopen: precondition 'valid_mode' got status valid. [eva] Done for function fopen [eva] computing for function fgetws <- main. Called from tests/libc/wchar_h.c:8. [eva] using specification for function fgetws [eva] tests/libc/wchar_h.c:8: function fgetws: precondition 'room_nwstring' got status valid. [eva] tests/libc/wchar_h.c:8: function fgetws: precondition 'valid_stream' got status valid. [eva] Done for function fgetws [eva] tests/libc/wchar_h.c:10: assertion got status valid. [eva] tests/libc/wchar_h.c:13: Call to builtin wmemchr [eva] tests/libc/wchar_h.c:13: function wmemchr: precondition 'valid' got status valid. [eva] share/libc/wchar.h:58: Cannot evaluate range bound wmemchr_off(s, c, n) (unsupported ACSL construct: logic function wmemchr_off). Approximating [eva:alarm] tests/libc/wchar_h.c:13: Warning: function wmemchr: precondition 'initialization' got status unknown. [eva] tests/libc/wchar_h.c:13: function wmemchr: precondition 'danglingness' got status valid. [eva] tests/libc/wchar_h.c:14: check 'ok' got status valid. [eva] tests/libc/wchar_h.c:15: Call to builtin wmemchr [eva] share/libc/wchar.h:55: Cannot evaluate range bound wmemchr_off(s, c, n) (unsupported ACSL construct: logic function wmemchr_off). Approximating [eva:alarm] tests/libc/wchar_h.c:15: Warning: function wmemchr: precondition 'valid' got status unknown. [eva] tests/libc/wchar_h.c:15: function wmemchr: precondition 'initialization' got status valid. [eva] tests/libc/wchar_h.c:15: function wmemchr: precondition 'danglingness' got status valid. [eva] tests/libc/wchar_h.c:16: check 'ok' got status valid. [eva] tests/libc/wchar_h.c:18: Call to builtin wmemchr [eva] tests/libc/wchar_h.c:18: function wmemchr: precondition 'valid' got status valid. [eva:alarm] tests/libc/wchar_h.c:18: Warning: function wmemchr: precondition 'initialization' got status unknown. [eva] tests/libc/wchar_h.c:18: function wmemchr: precondition 'danglingness' got status valid. [eva] tests/libc/wchar_h.c:21: Call to builtin wmemchr [eva:alarm] tests/libc/wchar_h.c:21: Warning: function wmemchr: precondition 'valid' got status unknown. [eva:alarm] tests/libc/wchar_h.c:21: Warning: function wmemchr: precondition 'initialization' got status unknown. [eva:alarm] tests/libc/wchar_h.c:21: Warning: function wmemchr: precondition 'danglingness' got status unknown. [eva] tests/libc/wchar_h.c:22: check 'ok' got status valid. [eva] tests/libc/wchar_h.c:24: Call to builtin wmemchr [eva:alarm] tests/libc/wchar_h.c:24: Warning: function wmemchr: precondition 'valid' got status unknown. [eva:alarm] tests/libc/wchar_h.c:24: Warning: function wmemchr: precondition 'initialization' got status unknown. [eva:alarm] tests/libc/wchar_h.c:24: Warning: function wmemchr: precondition 'danglingness' got status unknown. [eva] tests/libc/wchar_h.c:25: check 'ok' got status valid. [eva] tests/libc/wchar_h.c:26: Call to builtin wmemchr [eva:alarm] tests/libc/wchar_h.c:26: Warning: function wmemchr: precondition 'valid' got status unknown. [eva:alarm] tests/libc/wchar_h.c:26: Warning: function wmemchr: precondition 'initialization' got status unknown. [eva:alarm] tests/libc/wchar_h.c:26: Warning: function wmemchr: precondition 'danglingness' got status unknown. [eva] tests/libc/wchar_h.c:27: check 'ok' got status valid. [eva] tests/libc/wchar_h.c:29: Call to builtin wmemchr [eva:alarm] tests/libc/wchar_h.c:29: Warning: function wmemchr: precondition 'valid' got status unknown. [eva:alarm] tests/libc/wchar_h.c:29: Warning: function wmemchr: precondition 'initialization' got status unknown. [eva:alarm] tests/libc/wchar_h.c:29: Warning: function wmemchr: precondition 'danglingness' got status unknown. [eva] tests/libc/wchar_h.c:30: check 'ok' got status valid. [eva] computing for function wcsncpy <- main. Called from tests/libc/wchar_h.c:33. [eva] using specification for function wcsncpy [eva] tests/libc/wchar_h.c:33: function wcsncpy: precondition 'valid_wstring_src' got status valid. [eva] tests/libc/wchar_h.c:33: function wcsncpy: precondition 'room_nwstring' got status valid. [eva] tests/libc/wchar_h.c:33: function wcsncpy: precondition 'separation,dest,src' got status valid. [eva] Done for function wcsncpy [eva] tests/libc/wchar_h.c:34: check 'ok' got status valid. [eva] tests/libc/wchar_h.c:35: check 'ok' got status valid. [eva] tests/libc/wchar_h.c:37: Call to builtin wcslen [eva] tests/libc/wchar_h.c:37: function wcslen: precondition 'valid_string_s' got status valid. [eva] computing for function wcsncpy <- main. Called from tests/libc/wchar_h.c:37. [eva] tests/libc/wchar_h.c:37: function wcsncpy: precondition 'valid_wstring_src' got status valid. [eva:alarm] tests/libc/wchar_h.c:37: Warning: function wcsncpy: precondition 'room_nwstring' got status invalid. [eva] tests/libc/wchar_h.c:37: function wcsncpy: no state left, precondition 'separation,dest,src' got status valid. [eva] Done for function wcsncpy [eva] computing for function wcsncpy <- main. Called from tests/libc/wchar_h.c:41. [eva:alarm] tests/libc/wchar_h.c:41: Warning: function wcsncpy: precondition 'valid_wstring_src' got status unknown. [eva] tests/libc/wchar_h.c:41: function wcsncpy: precondition 'room_nwstring' got status valid. [eva:alarm] tests/libc/wchar_h.c:41: Warning: function wcsncpy: precondition 'separation,dest,src' got status invalid. [eva] Done for function wcsncpy [eva] computing for function wcsncpy <- main. Called from tests/libc/wchar_h.c:45. [eva] tests/libc/wchar_h.c:45: function wcsncpy: precondition 'valid_wstring_src' got status valid. [eva:alarm] tests/libc/wchar_h.c:45: Warning: function wcsncpy: precondition 'room_nwstring' got status invalid. [eva] tests/libc/wchar_h.c:45: function wcsncpy: no state left, precondition 'separation,dest,src' got status valid. [eva] Done for function wcsncpy [eva] computing for function wcsncpy <- main. Called from tests/libc/wchar_h.c:49. [eva:alarm] tests/libc/wchar_h.c:49: Warning: function wcsncpy: precondition 'valid_wstring_src' got status invalid. [eva] tests/libc/wchar_h.c:49: function wcsncpy: no state left, precondition 'room_nwstring' got status valid. [eva] tests/libc/wchar_h.c:49: function wcsncpy: no state left, precondition 'separation,dest,src' got status valid. [eva] Done for function wcsncpy [eva] computing for function wcsncpy <- main. Called from tests/libc/wchar_h.c:53. [eva:alarm] tests/libc/wchar_h.c:53: Warning: function wcsncpy: precondition 'valid_wstring_src' got status unknown. [eva:alarm] tests/libc/wchar_h.c:53: Warning: function wcsncpy: precondition 'room_nwstring' got status invalid. [eva] tests/libc/wchar_h.c:53: function wcsncpy: no state left, precondition 'separation,dest,src' got status valid. [eva] Done for function wcsncpy [eva] computing for function wcsncmp <- main. Called from tests/libc/wchar_h.c:56. [eva] using specification for function wcsncmp [eva] tests/libc/wchar_h.c:56: function wcsncmp: precondition 'valid_wstring_s1' got status valid. [eva] tests/libc/wchar_h.c:56: function wcsncmp: precondition 'valid_wstring_s2' got status valid. [eva] Done for function wcsncmp [eva] computing for function wcsncmp <- main. Called from tests/libc/wchar_h.c:57. [eva] tests/libc/wchar_h.c:57: function wcsncmp: precondition 'valid_wstring_s1' got status valid. [eva:alarm] tests/libc/wchar_h.c:57: Warning: function wcsncmp: precondition 'valid_wstring_s2' got status unknown. [eva] Done for function wcsncmp [eva] computing for function wcsncat <- main. Called from tests/libc/wchar_h.c:59. [eva] using specification for function wcsncat [eva] tests/libc/wchar_h.c:59: function wcsncat: precondition 'valid_nwstring_src' got status valid. [eva] tests/libc/wchar_h.c:59: function wcsncat: precondition 'valid_wstring_dest' got status valid. [eva] tests/libc/wchar_h.c:59: function wcsncat: precondition 'room_for_concatenation' got status valid. [eva] tests/libc/wchar_h.c:59: function wcsncat: precondition 'separation' got status valid. [eva] Done for function wcsncat [eva] computing for function wcsncat <- main. Called from tests/libc/wchar_h.c:60. [eva] tests/libc/wchar_h.c:60: function wcsncat: precondition 'valid_nwstring_src' got status valid. [eva:alarm] tests/libc/wchar_h.c:60: Warning: function wcsncat: precondition 'valid_wstring_dest' got status unknown. [eva:alarm] tests/libc/wchar_h.c:60: Warning: function wcsncat: precondition 'room_for_concatenation' got status unknown. [eva] tests/libc/wchar_h.c:60: function wcsncat: precondition 'separation' got status valid. [eva] Done for function wcsncat [eva] computing for function wcsncat <- main. Called from tests/libc/wchar_h.c:66. [eva] tests/libc/wchar_h.c:66: function wcsncat: precondition 'valid_nwstring_src' got status valid. [eva] tests/libc/wchar_h.c:66: function wcsncat: precondition 'valid_wstring_dest' got status valid. [eva:alarm] tests/libc/wchar_h.c:66: Warning: function wcsncat: precondition 'room_for_concatenation' got status invalid. [eva] tests/libc/wchar_h.c:66: function wcsncat: no state left, precondition 'separation' got status valid. [eva] Done for function wcsncat [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: fd ∈ {{ NULL ; &__fc_fopen + [0..120],0%8 }} buf[0..28] ∈ [--..--] or UNINITIALIZED [29] ∈ UNINITIALIZED res ∈ {{ NULL ; &buf[0] }} buf2[0] ∈ {97} or UNINITIALIZED [1] ∈ {98} or UNINITIALIZED r ∈ {{ &wdst[0] }} wsrc ∈ {{ L"wide thing" }} wdst[0..9] ∈ [--..--] or UNINITIALIZED wdst2[0..9] ∈ {65} [10] ∈ {0} [11..19] ∈ [--..--] __retres ∈ {0; 1} frama-c-20.0-Calcium/tests/libc/poll.c0000666000000000000000000000070113571573400014376 0ustar #include #include #define GOT_TIMEOUT 127 int main() { struct pollfd ufds; ufds.fd = 0; // stdin ufds.events = POLLIN | POLLPRI; int r = poll(&ufds, 1, 1000); if (r == -1) perror("poll"); if (r == 0) return GOT_TIMEOUT; int can_read = ufds.revents & POLLIN; int can_read_out_of_band = ufds.revents & POLLPRI; int invalid_fd = ufds.revents & POLLNVAL; return can_read | can_read_out_of_band | invalid_fd; } frama-c-20.0-Calcium/tests/libc/pwd_h.c0000666000000000000000000000127513571573400014540 0ustar /*run.config STDOPT: */ #include #include "__fc_string_axiomatic.h" extern uid_t uid; int main() { struct passwd *pw = getpwuid(uid); if (pw) { //Note: the assertions below are currently imprecise //@ assert valid_read_string(pw->pw_name); //@ assert valid_read_string(pw->pw_passwd); //@ assert valid_read_string(pw->pw_dir); //@ assert valid_read_string(pw->pw_shell); } pw = getpwnam("root"); if (pw) { //Note: the assertions below are currently imprecise //@ assert valid_read_string(pw->pw_name); //@ assert valid_read_string(pw->pw_passwd); //@ assert valid_read_string(pw->pw_dir); //@ assert valid_read_string(pw->pw_shell); } } frama-c-20.0-Calcium/tests/libc/runtime.c0000666000000000000000000000036713571573400015123 0ustar /* run.config* COMMENT: tests that the runtime can compile without errors (for PathCrawler, E-ACSL, ...) CMD: gcc -fsyntax-only -D__FC_MACHDEP_X86_64 share/libc/__fc_runtime.c -Wno-attributes -std=c99 OPT: */ int main() { return 0; } frama-c-20.0-Calcium/tests/libc/signal_h.c0000666000000000000000000000175613571573400015227 0ustar /* run.config STDOPT: #"-slevel 2" */ #include volatile int nondet; int main() { sigset_t s; if (sigemptyset(&s)) return 1; if (sigaddset(&s, SIGALRM)) { return -1; } if (sigdelset(&s, SIGUSR1)) { return -1; } if (!sigismember(&s, SIGALRM)) return 2; sigfillset(&s); if (!sigismember(&s, SIGPIPE)) return 3; sigset_t uninit; if (nondet) { if (sigaddset(&uninit, SIGKILL)) { return -1; } //@ assert unreachable_if_precise: \false; } sigset_t old; if (sigprocmask(SIG_SETMASK, 0, &old)) { return -1; } if (sigaddset(&old, SIGALRM)) { return -1; } if (sigprocmask(SIG_SETMASK, &old, 0)) { return -1; } if (sigprocmask(SIG_BLOCK, &s, &old)) { return -1; } int kill_res = kill(42, SIGTERM); struct sigaction sa1, sa2; if (sigaction(SIGCHLD, 0, &sa1)) { return -1; } if (sigaction(SIGCONT, &sa1, &sa2)) { return -1; } if (sigaction(SIGUSR1, &sa2, 0)) { return -1; } return 0; } frama-c-20.0-Calcium/tests/libc/socket.c0000666000000000000000000000666713571573400014741 0ustar /* run.config STDOPT: +"-eva-verbose 2 -eva-no-builtins-auto" STDOPT: +"-eva-verbose 2 -machdep x86_64 -eva-no-builtins-auto" */ #include #include #include #include #include #include #include #include #include const char* sent_msg = "World"; #define SIZEOF_SENT_MSG 6 // char send_buffer[SIZEOF_SEND_BUFFER]; /* Contiguous receive buffer. */ #define SIZEOF_RCV_BUFFER 10 char rcv_buffer[SIZEOF_RCV_BUFFER]; /* Scattered receive buffer. Initialized locally so that it is UNINITIALIZED. */ #define DECLARE_SCATTERED_RECEIVE_BUFFER \ char rcv_buffer_scattered1[2]; \ char rcv_buffer_scattered2[5]; \ char rcv_buffer_scattered3[3]; \ struct iovec rcv_buffer_scattered_iovec[3] = \ {{ &rcv_buffer_scattered1, sizeof(rcv_buffer_scattered1)}, \ { &rcv_buffer_scattered2, sizeof(rcv_buffer_scattered2)}, \ { &rcv_buffer_scattered3, sizeof(rcv_buffer_scattered3)}} int socket_fd[2]; /* In this test, we always send to the same socket and receive through the other. */ #define send_socket socket_fd[0] #define rcv_socket socket_fd[1] /* Clears rcv_buffers and writes data to send_socket. */ void init_reception(void) { bzero( rcv_buffer, SIZEOF_RCV_BUFFER); write( send_socket, sent_msg, SIZEOF_SENT_MSG); } void init_sockets(void) { /* Creates a pair of local sockets. */ if( socketpair(AF_LOCAL,SOCK_SEQPACKET,0,socket_fd) != 0) { fprintf( stderr, "Could not create a pair of sockets\n"); exit( EXIT_FAILURE); } //@ assert \initialized(&socket_fd[0..1]); } void test_read(void) { init_reception(); read( rcv_socket, rcv_buffer, SIZEOF_RCV_BUFFER); printf("Hello %s\n", rcv_buffer); } void test_readv(void) { DECLARE_SCATTERED_RECEIVE_BUFFER; init_reception(); readv( rcv_socket, rcv_buffer_scattered_iovec, 3); rcv_buffer_scattered1[0] == 0; /* Reduce to bottom if rcv_buffer_scattered1 is not initialized. */ /* @assert \true; */ printf( "Hello %.2s%.3s\n", rcv_buffer_scattered1, rcv_buffer_scattered2); } void test_recvmsg(void) { DECLARE_SCATTERED_RECEIVE_BUFFER; init_reception(); struct msghdr hdr; hdr.msg_name = NULL; hdr.msg_namelen = 0; hdr.msg_iov = rcv_buffer_scattered_iovec; hdr.msg_iovlen = 3; hdr.msg_control = NULL; hdr.msg_controllen = 0; recvmsg( rcv_socket, &hdr, 0); rcv_buffer_scattered1[0] == 0; /* Reduce to bottom if rcv_buffer_scattered1 is not initialized. */ /* @assert \true; */ printf( "Hello %.2s%.3s\n", rcv_buffer_scattered1, rcv_buffer_scattered2); } volatile int nondet; int test_server_echo() { int fd = socket(AF_INET, SOCK_STREAM, 0); if (fd == -1) return 1; struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_port = 0x2222; if (bind(fd, (struct sockaddr*)&addr, sizeof(addr))) return 5; if (listen(fd, 10)) return 20; socklen_t addrlen = sizeof(addr); int client_fd = nondet ? accept(fd, (struct sockaddr*)&addr, &addrlen) : accept(fd, NULL, NULL); if (client_fd == -1) return 100; char buf[64]; int r = read(client_fd, buf, 64); if (r == -1) return 200; if (write(client_fd, buf, r) < r) return 300; if (close(client_fd)) return 400; if (close(fd)) return 400; return 0; } int main(int argc, char **argv) { init_sockets(); test_read(); test_readv(); test_recvmsg(); int r = test_server_echo(); return 0; } frama-c-20.0-Calcium/tests/libc/socket_h.c0000666000000000000000000000104213571573400015226 0ustar #include #include #include #include int main() { int sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) exit(1); struct sockaddr_in addr; addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr("127.0.0.1"); addr.sin_port = htons(42); int rc = connect(sockfd, (struct sockaddr *)&addr, sizeof(addr)); if (rc < 0) exit(2); int optval; socklen_t optlen = sizeof(optval); rc = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&optval, &optlen); return rc; } frama-c-20.0-Calcium/tests/libc/stdint_h.c0000666000000000000000000000026113571573400015245 0ustar #include int main() { intmax_t min = INTMAX_MIN; intmax_t max = INTMAX_MAX; uintmax_t umax = UINTMAX_MAX; //@ assert min < max && max <= umax; return 0; } frama-c-20.0-Calcium/tests/libc/stdio_c.c0000666000000000000000000000077413571573400015066 0ustar #include #include #include "stdio.c" int main() { FILE *stream; char *line = NULL; size_t len = 0; size_t total_len = 0; ssize_t read; stream = fopen("/etc/motd", "r"); if (!stream) return 1; while ((read = getline(&line, &len, stream)) != -1) { //@ assert read_ok: line != \null; total_len += strlen(line); //@ assert read_bytes: strlen(line) == read; //@ assert allocated_enough: len >= strlen(line); } free(line); fclose(stream); return 0; } frama-c-20.0-Calcium/tests/libc/stdio_h.c0000666000000000000000000000217313571573400015066 0ustar #include #include "__fc_builtin.h" volatile int nondet; int main() { FILE *f = fopen("/dev/urandom", "r"); if (!f) return 1; int r = fseek(f, 0L, SEEK_SET); if (nondet) { fseek(NULL, 0L, SEEK_CUR); // must fail //@ assert \false; } if (nondet) { // to obtain an invalid value for whence, any interval containing at // least 4 elements must contain an invalid value int invalid_whence = Frama_C_interval(0, 3); if (invalid_whence != SEEK_SET && invalid_whence != SEEK_CUR && invalid_whence != SEEK_END) { fseek(f, 42, invalid_whence); // must fail //@ assert \false; } } FILE *tmp = tmpfile(); if (!tmp) return 2; fseek(tmp, 0L, SEEK_SET); fclose(tmp); FILE *redirected = freopen("/tmp/mytmp.txt", "w+", stdout); if (!redirected) return 3; printf("redirected to file"); fclose(redirected); char fgets_buf0[1]; char *fgets_res = fgets(fgets_buf0, 1, f); // ok if (!fgets_res) return 1; //@ check \initialized(&fgets_buf0[0]); if (nondet) { fgets(fgets_buf0, 2, f); // error: buf too small //@ assert unreachable: \false; } return 0; } frama-c-20.0-Calcium/tests/libc/stdlib_c.c0000666000000000000000000000230213571573400015212 0ustar /* run.config STDOPT: #"-eva-no-builtins-auto -slevel 10 -eva-builtin calloc:Frama_C_calloc_by_stack -eva-msg-key malloc" STDOPT: #"-eva-no-builtins-auto -slevel 10 -eva-builtin calloc:Frama_C_calloc_by_stack -eva-no-alloc-returns-null -eva-msg-key malloc" STDOPT: #"-eva-no-builtins-auto" */ // slevel is used to unroll loops #define malloc(n) Frama_C_malloc_by_stack(n) #include "stdlib.c" #include "__fc_builtin.h" #include int main() { // always succeeds if -eva-no-alloc-returns-null, otherwise may succeed int *p = calloc(1, sizeof(int)); if (p) { //@ assert \valid(p); } // partial overflow size_t nmemb = Frama_C_size_t_interval(1, SIZE_MAX); int *q = calloc(nmemb, sizeof(int)); if (q) { //@ assert \valid(q); } // never succeeds (always overflows) int *r = calloc(SIZE_MAX, sizeof(int)); //@ assert !r; int *s; // may succeed for some cases, but fail later for (size_t i = 1; i < SIZE_MAX; i++) { s = calloc(i, sizeof(int)); if (s) s[i-1] = 42; } char *p_al0, *p_al1; int p_memal_res = posix_memalign((void**)&p_al0, 32, 0); free(p_al0); int p_memal_res2 = posix_memalign((void**)&p_al1, 32, 42); free(p_al1); return 0; } frama-c-20.0-Calcium/tests/libc/stdlib_c_env.c0000666000000000000000000000116613571573400016071 0ustar #include #include #include #include "stdlib.c" int main() { char *env0 = "BLA=1"; int i1 = putenv(env0); char s[10] = "NAME=val"; int i2 = putenv(s); char *r1 = getenv("BLA"); if (r1) { //@ assert valid_read_string(r1); } strcpy(s, "BLE=val"); char *r2 = getenv("BLA"); int i3 = setenv("BLA", "val", 0); int i4 = setenv(r2, "val", 1); int i5 = setenv(r2, r2, 0); int i6 = unsetenv("BLE"); //@ assert i6 == 0; // does not contain '=' int i7 = unsetenv("BLE="); //@ assert i7 == -1; // contains '=' int i8 = unsetenv(r2); char *r3 = getenv(r2); return 0; } frama-c-20.0-Calcium/tests/libc/stdlib_h.c0000666000000000000000000000541313571573400015225 0ustar /* run.config STDOPT: #"-machdep msvc_x86_64" */ // Note: machdep MSVC is used to avoid warnings due to // "non implemented long double" when testing strtold. // In MSVC, "long double" is mapped to "double". #include //@ assigns \result \from *(int*)a, *(int*)b; int compare_int(const void *a, const void *b) { return (*(int*)a < *(int*)b) ? -1 : (*(int*)a > *(int*)b); } volatile int nondet; int main() { int base = nondet ? 0 : nondet ? 2 : 36; char *sl = "12 34 -56"; char *s = sl; char *pl, *q; long l = strtol(s, &pl, base); l = strtol(pl, &q, base); l = strtol(q, NULL, base); l = strtol(s+9, NULL, base); s = sl; char *pll; long long ll = strtoll(s, &pll, base); ll = strtoll(pll, &q, base); ll = strtoll(q, NULL, base); s = sl; char *pul; unsigned long ul = strtoul(s, &pul, base); ul = strtoul(pul, &q, base); ul = strtoul(q, NULL, base); s = sl; char *pull; unsigned long long ull = strtoull(s, &pull, base); ull = strtoull(pull, &q, base); ull = strtoull(q, NULL, base); char *sd = " 3.14 0x1.2p2"; s = sd; char *pd; double d = strtod(s, &pd); d = strtod(pd, &q); d = strtod(q, NULL); s = sd; char *pld; long double ld = strtold(s, &pld); ld = strtold(pld, &q); ld = strtold(q, NULL); s = sd; char *pf; float f = strtof(s, &pf); f = strtof(pf, &q); f = strtof(q, NULL); int ai[4] = {1, -1, 50000, 20}; int key = 4; int *p = bsearch(&key, ai, 4, sizeof(int), compare_int); //@ assert p == \null; key = -1; p = bsearch(&key, ai, 4, sizeof(int), compare_int); //@ assert p == &ai[1]; // tests for *env functions /*{ char mutable[12] = "MUTABLE=yes"; putenv(mutable); mutable[8] = 'n'; mutable[9] = 'o'; mutable[10] = 0; char *v = getenv("MUTABLE"); if (v[8] != 'n') return 1; // possible only if imprecise }*/ char tempFilename[] = "blaXXXXXX"; int r = mkstemp(tempFilename); if (nondet) { // should fail: seed not initialized drand48(); } if (nondet) { // should fail: seed not initialized lrand48(); } if (nondet) { // should fail: seed not initialized mrand48(); } unsigned short xsubi[3]; if (nondet) { // should fail: xsubi erand48(xsubi); } xsubi[0] = 42; xsubi[1] = 42; xsubi[2] = 42; d = erand48(xsubi); //@ assert 0.0 <= d < 1.0; l = jrand48(xsubi); //@ assert -2147483648 <= l < 2147483648; l = nrand48(xsubi); //@ assert 0 <= l < 2147483648; srand48(42); unsigned short seed48v[3] = {0, 4, 2}; unsigned short *res = seed48(seed48v); unsigned short param[7] = {0, 4, 2, 0, 4, 2, 0}; lcong48(param); d = drand48(); //@ assert 0.0 <= d < 1.0; l = mrand48(); //@ assert -2147483648 <= l < 2147483648; l = lrand48(); //@ assert 0 <= l < 2147483648; return 0; } frama-c-20.0-Calcium/tests/libc/string_c.c0000666000000000000000000001471713571573400015254 0ustar /* run.config STDOPT: #"-eva-no-builtins-auto -slevel 1000 -eva-no-skip-stdlib-specs" */ // slevel is used to unroll loops #include "string.c" volatile int v; void test_memcpy() { char dest[6], src[6] = "hello"; char *p = memcpy(dest, src, 6); //@assert p == dest; //@assert dest[0] == 'h'; //@assert dest[4] == 'o'; //@assert dest[5] == '\0'; char src2[5] = "a\0b\0"; memcpy(dest, src2, 5); //@assert dest[1] == '\0'; //@assert dest[2] == 'b'; if (v) memcpy(dest, NULL, 0); if (v) p = memcpy(NULL, NULL, 0); int x = 0x12093841; memcpy(dest, &x, 4); //@assert dest[0] == 0x41; //@assert dest[3] == 0x12; } void test_memmove() { char buf[6] = {1, 2, 3, 4, 5, 6}; char *s, *d; s = buf; d = buf + 2; Frama_C_show_each_s0(s[0]); Frama_C_show_each_s0(s[1]); Frama_C_show_each_s0(s[2]); Frama_C_show_each_s0(s[3]); Frama_C_show_each_s0(d[0]); Frama_C_show_each_s0(d[1]); Frama_C_show_each_s0(d[2]); Frama_C_show_each_s0(d[3]); char *p = memmove(d, s, 4); //@assert p == d; /*@assert buf[0] == 1 && buf[1] == 2 && buf[2] == 1 && buf[3] == 2 && buf[4] == 3 && buf[5] == 4; */ buf[2] = 3; buf[3] = 4; buf[4] = 5; buf[5] = 6; d = buf; s = buf + 2; memmove(d, s, 4); /*@assert buf[0] == 3 && buf[1] == 4 && buf[2] == 5 && buf[3] == 6 && buf[4] == 5 && buf[5] == 6; */ memmove(buf, buf, 4); //@assert buf[0] == 3 && buf[1] == 4 && buf[2] == 5 && buf[3] == 6; d = buf + 3; s = buf; memmove(d, s, 3); /*@assert buf[0] == 3 && buf[1] == 4 && buf[2] == 5 && buf[3] == 3 && buf[4] == 4 && buf[5] == 5; */ } void test_strlen() { char *s = "hello"; int n = strlen(s); //@assert n == 5; n = strlen("ab\0c"); //@assert n == 2; n = strlen(""); //@assert n == 0; } void test_strnlen() { char *s = "hello"; size_t n = strnlen(s, 5); //@assert n == 5; n = strnlen(s, 6); //@assert n == 5; n = strnlen(s, 4); //@assert n == 4; n = strnlen("ab\0c", 4); //@assert n == 2; n = strnlen("", 1); //@assert n == 0; n = strnlen("", 0); //@assert n == 0; } void test_memset() { char dest[4] = {0, 0, 0, 0}; char *p = memset(dest, 42, 3); //@assert p == dest; //@assert dest[2] == 42; //@assert dest[3] == 0; memset(dest, 9, 0); //@assert dest[0] == 42; } void test_strcmp(void) { char hello[6] = "hello"; hello[1] = 'a'; int res = strcmp("hallo", hello); //@ assert res == 0; int res2 = strcmp("hall", hello); //@ assert res2 < 0; int res3 = strcmp("halloo", hello); //@ assert res3 > 0; int res4 = strcmp("Hallo", hello); //@ assert res4 < 0; int res5 = strcmp("", hello); //@ assert res5 < 0; int res6 = strcmp("a\0b", "a"); //@ assert res6 == 0; int res7 = strcmp("", "\0"); //@ assert res7 == 0; } void test_strcat(void) { char s[10]; s[0] = 0; char *p = strcat(s, "hello"); //@assert p == s; //@assert s[0] == 'h' && s[4] == 'o' && s[5] == 0; s[4] = 0; s[5] = 'h'; s[6] = 'e'; s[7] = 'l'; s[8] = 0; strcat(s, s+5); //@assert s[3] == 'l' && s[4] == 'h' && s[6] == 'l' && s[7] == 0; strcat(s, ""); strcat(s, "x"); //@assert s[7] == 'x' && s[8] == 0; } void test_strcpy(void) { char s[7]; char *p = strcpy(s, "hello"); //@assert p == s; //@assert s[0] == 'h' && s[4] == 'o'; strcpy(s, "654321"); //@assert s[2] == '4' && s[6] == 0; strcpy(s, ""); //@assert s[0] == 0; } void test_strncpy(void) { char s[7]; char *p = strncpy(s, "hello", 7); //@assert p == s; //@assert s[5] == 0 && s[6] == 0; strncpy(s, "bye", 3); //@assert s[2] == 'e' && s[3] == 'l'; strncpy(s, "die", 0); //@assert s[0] == 'b'; strncpy(s, "ab\0c", 5); //@assert s[3] == 0; } void test_strncmp() { char hello[6] = "hello"; int res1 = strncmp("hallo", hello, 5); //@ assert res1 < 0; int res2 = strncmp("hallo", hello, 1); //@ assert res2 == 0; hello[1] = 'a'; int res3 = strncmp("hallo", hello, 5); //@ assert res3 == 0; int res4 = strncmp("halloo", hello, 6); //@ assert res4 > 0; int res5 = strncmp("halloo", hello, 5); //@ assert res5 == 0; int res6 = strncmp("", hello, 5); //@ assert res6 < 0; int res7 = strncmp("", hello, 0); //@ assert res7 == 0; int res8 = strncmp("a\0b", "a\0c", 3); //@ assert res8 == 0; } void test_memcmp() { char hello[6] = "hello"; int res1 = memcmp("hallo", hello, 5); //@ assert res1 < 0; int res2 = memcmp("hallo", hello, 1); //@ assert res2 == 0; int res3 = memcmp("a\0b", "a\0c", 2); //@ assert res3 == 0; int res4 = memcmp("a\0b", "a\0c", 3); //@ assert res4 < 0; } void test_strchr() { char *s = "hello"; char *p = strchr(s, 'h'); //@assert s == p; p = strchr(s, 'H'); //@assert p == \null; p = strchr(s, 'l'); //@assert p == s+2; p = strchr(s, 0); //@assert p == s+5; } void test_strrchr() { char *s = "hello"; char *p = strrchr(s, 'h'); //@assert s == p; p = strrchr(s, 'H'); //@assert p == \null; p = strrchr(s, 'l'); //@assert p == s+3; p = strrchr(s, 0); //@assert p == s+5; } void test_memchr() { char s[6] = {1, 2, 3, 1, 2, 4}; char *p = memchr(s, 1, 6); //@assert s == p; p = memchr(s, 5, 6); //@assert p == \null; p = memchr(s, 2, 6); //@assert p == s+1; p = memchr(s, 1, 0); //@assert p == \null; p = memchr(s, 5, 0); //@assert p == \null; p = memchr(s, 1, 1); //@assert p == s; } void test_memrchr() { char s[6] = {1, 2, 3, 1, 2, 4}; char *p = memrchr(s, 1, 6); //@assert s+3 == p; p = memrchr(s, 5, 6); //@assert p == \null; p = memrchr(s, 2, 6); //@assert p == s+4; p = memrchr(s, 1, 0); //@assert p == \null; p = memrchr(s, 5, 0); //@assert p == \null; p = memrchr(s, 1, 1); //@assert p == s; } void test_strstr() { char *s = "hello"; char *p = strstr(s, "h"); //@assert s == p; p = strstr(s, ""); //@assert s == p; p = strstr(s, "H"); //@assert p == \null; p = strstr(s, "ll"); //@assert p == s+2; p = strstr(s, "elo"); //@assert p == \null; p = strstr(s, "low"); //@assert p == \null; p = strstr(s, "lo"); //@assert p == s+3; p = strstr(s, "hell"); //@assert p == s; } int main(int argc, char **argv) { test_memcpy(); test_memmove(); test_strlen(); test_strnlen(); test_memset(); test_strcmp(); test_strncmp(); test_memcmp(); test_strcat(); // strncat is not tested (code from the man page) test_strcpy(); test_strncpy(); test_strchr(); test_strrchr(); test_memchr(); test_memrchr(); test_strstr(); // strerror not tested // strdup not tested (uses malloc) // strndup not tested (uses malloc) return 0; } frama-c-20.0-Calcium/tests/libc/string_c_generic.c0000666000000000000000000001016213571573400016736 0ustar /* run.config STDOPT: #"-eva-no-builtins-auto -cpp-extra-args=-includeshare/libc/string.c -slevel-function strcpy:20,strncpy:5,strcmp:6,strchr:20,strrchr:20,strncat:4,memset:32,strlen:20,memcmp:8 -eva-no-skip-stdlib-specs" */ /* This file has been adapted from libc-test, which is licensed under the following standard MIT license: Copyright © 2005-2013 libc-test AUTHORS (Rich Felker, Szabolcs Nagy, Kirill Ternovsky, John Spencer, Jens Gustedt, Alexander Monakov) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define T_LOC2(l) __FILE__ ":" #l #define T_LOC1(l) T_LOC2(l) #define t_error(...) t_printf(T_LOC1(__LINE__) ": " __VA_ARGS__) int t_printf(const char *s, ...); /* r = place to store result * f = function call to test (or any expression) * x = expected result * m = message to print on failure (with formats for r & x) **/ #define TEST(r, f, x, m) ( \ ((r) = (f)) == (x) || \ (t_error("%s failed (" m ")\n", #f, r, x), 0) ) #define TEST_S(s, x, m) ( \ !strcmp((s),(x)) || \ (t_error("[%s] != [%s] (%s)\n", s, x, m), 0) ) int main(void) { char b[32]; char *s; int i; b[16]='a'; b[17]='b'; b[18]='c'; b[19]=0; TEST(s, strcpy(b, b+16), b, "wrong return %p != %p"); TEST_S(s, "abc", "strcpy gave incorrect string"); TEST(s, strcpy(b+1, b+16), b+1, "wrong return %p != %p"); TEST_S(s, "abc", "strcpy gave incorrect string"); TEST(s, strcpy(b+2, b+16), b+2, "wrong return %p != %p"); TEST_S(s, "abc", "strcpy gave incorrect string"); TEST(s, strcpy(b+3, b+16), b+3, "wrong return %p != %p"); TEST_S(s, "abc", "strcpy gave incorrect string"); TEST(s, strcpy(b+1, b+17), b+1, "wrong return %p != %p"); TEST_S(s, "bc", "strcpy gave incorrect string"); TEST(s, strcpy(b+2, b+18), b+2, "wrong return %p != %p"); TEST_S(s, "c", "strcpy gave incorrect string"); TEST(s, strcpy(b+3, b+19), b+3, "wrong return %p != %p"); TEST_S(s, "", "strcpy gave incorrect string"); TEST(s, memset(b, 'x', sizeof b), b, "wrong return %p != %p"); TEST(s, strncpy(b, "abc", sizeof b - 1), b, "wrong return %p != %p"); TEST(i, memcmp(b, "abc\0\0\0\0", 8), 0, "strncpy fails to zero-pad dest"); TEST(i, b[sizeof b - 1], 'x', "strncpy overruns buffer when n > strlen(src)"); b[3] = 'x'; b[4] = 0; strncpy(b, "abc", 3); TEST(i, b[2], 'c', "strncpy fails to copy last byte: %hhu != %hhu"); TEST(i, b[3], 'x', "strncpy overruns buffer to null-terminate: %hhu != %hhu"); TEST(i, !strncmp("abcd", "abce", 3), 1, "strncmp compares past n"); TEST(i, !!strncmp("abc", "abd", 3), 1, "strncmp fails to compare n-1st byte"); strcpy(b, "abc"); TEST(s, strncat(b, "123456", 3), b, "%p != %p"); TEST(i, b[6], 0, "strncat failed to null-terminate (%d)"); TEST_S(s, "abc123", "strncat gave incorrect string"); strcpy(b, "aaababccdd0001122223"); TEST(s, strchr(b, 'b'), b+3, "%p != %p"); TEST(s, strchr(b, 'e'), 0, "%p != %p"); TEST(s, strrchr(b, 'b'), b+5, "%p != %p"); TEST(s, strrchr(b, 'e'), 0, "%p != %p"); return 0; } frama-c-20.0-Calcium/tests/libc/string_c_strchr.c0000666000000000000000000000613013571573400016627 0ustar /* run.config STDOPT: #"-cpp-extra-args=-includeshare/libc/string.c -slevel-function strchr:256,main:256 -eva-slevel-merge-after-loop main -eva-no-builtins-auto -eva-no-skip-stdlib-specs" */ /* This file has been adapted from libc-test, which is licensed under the following standard MIT license: Copyright © 2005-2013 libc-test AUTHORS (Rich Felker, Szabolcs Nagy, Kirill Ternovsky, John Spencer, Jens Gustedt, Alexander Monakov) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define T_LOC2(l) __FILE__ ":" #l #define T_LOC1(l) T_LOC2(l) #define t_error(...) t_printf(T_LOC1(__LINE__) ": " __VA_ARGS__) int t_printf(const char *s, ...); static char buf[512]; #define N(s, c) { \ char *q = strchr(s, c); \ if (q) \ t_error("strchr(%s,%s) returned str+%d, wanted 0\n", #s, #c, q-s); \ } #define T(s, c, n) { \ char *p = s; \ char *q = strchr(p, c); \ if (q == 0) \ t_error("strchr(%s,%s) returned 0, wanted str+%d\n", #s, #c, n); \ else if (q - p != n) \ t_error("strchr(%s,%s) returned str+%d, wanted str+%d\n", #s, #c, q-p, n); \ } int main(void) { int i; char a[128]; char s[256]; for (i = 0; i < 128; i++) a[i] = (i+1) & 127; for (i = 0; i < 256; i++) *((unsigned char*)s+i) = i+1; N("\0aaa", 'a'); N("a\0bb", 'b'); N("ab\0c", 'c'); N("abc\0d", 'd'); N("abc abc\0x", 'x'); N(a, 128); N(a, 255); T("", 0, 0); T("a", 'a', 0); T("a", 'a'+256, 0); T("a", 0, 1); T("abb", 'b', 1); T("aabb", 'b', 2); T("aaabb", 'b', 3); T("aaaabb", 'b', 4); T("aaaaabb", 'b', 5); T("aaaaaabb", 'b', 6); T("abc abc", 'c', 2); T(s, 1, 0); T(s, 2, 1); T(s, 10, 9); T(s, 11, 10); T(s, 127, 126); T(s, 128, 127); T(s, 255, 254); T(s, 0, 255); return 0; } frama-c-20.0-Calcium/tests/libc/string_c_strstr.c0000666000000000000000000000647113571573400016673 0ustar /* run.config STDOPT: #"-cpp-extra-args=-includeshare/libc/string.c -slevel-function strstr:30 -eva-no-skip-stdlib-specs" */ /* This file has been adapted from libc-test, which is licensed under the following standard MIT license: Copyright © 2005-2013 libc-test AUTHORS (Rich Felker, Szabolcs Nagy, Kirill Ternovsky, John Spencer, Jens Gustedt, Alexander Monakov) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define T_LOC2(l) __FILE__ ":" #l #define T_LOC1(l) T_LOC2(l) #define t_error(...) t_printf(T_LOC1(__LINE__) ": " __VA_ARGS__) int t_printf(const char *s, ...); #define N(s, sub) { \ char *p = s; \ char *q = strstr(p, sub); \ if (q) \ t_error("strstr(%s,%s) returned str+%d, wanted 0\n", #s, #sub, q-p); \ } #define T(s, sub, n) { \ char *p = s; \ char *q = strstr(p, sub); \ if (q == 0) \ t_error("strstr(%s,%s) returned 0, wanted str+%d\n", #s, #sub, n); \ else if (q - p != n) \ t_error("strstr(%s,%s) returned str+%d, wanted str+%d\n", #s, #sub, q-p, n); \ } int main(void) { N("", "a"); N("a", "aa"); N("a", "b"); N("aa", "ab"); N("aa", "aaa"); N("abba", "aba"); N("abc abc", "abcd"); N("0-1-2-3-4-5-6-7-8-9", "-3-4-56-7-8-"); N("0-1-2-3-4-5-6-7-8-9", "-3-4-5+6-7-8-"); N("_ _ _\xff_ _ _", "_\x7f_"); N("_ _ _\x7f_ _ _", "_\xff_"); T("", "", 0); T("abcd", "", 0); T("abcd", "a", 0); T("abcd", "b", 1); T("abcd", "c", 2); T("abcd", "d", 3); T("abcd", "ab", 0); T("abcd", "bc", 1); T("abcd", "cd", 2); T("ababa", "baba", 1); T("ababab", "babab", 1); T("abababa", "bababa", 1); T("abababab", "bababab", 1); T("ababababa", "babababa", 1); T("abbababab", "bababa", 2); T("abbababab", "ababab", 3); T("abacabcabcab", "abcabcab", 4); T("nanabanabanana", "aba", 3); T("nanabanabanana", "ban", 4); T("nanabanabanana", "anab", 1); T("nanabanabanana", "banana", 8); T("_ _\xff_ _", "_\xff_", 2); return 0; } frama-c-20.0-Calcium/tests/libc/string_h.c0000666000000000000000000000636613571573400015262 0ustar #include void test_strcmp(void) { int res = strcmp("hello", "world"); //@ assert res == 0; } void test_strcat(void) { char string[10]; string[0] = 0; strcat(string, "hello"); char string2[10]; string2[0] = 0; strcat(string2, string); } volatile int nondet; void test_strstr(void) { char *s = nondet ? "aba" : "bab"; char *needle = nondet ? "a" : "b"; char *res = strstr(s, needle); //@ assert res != 0; } void test_strncat(void) { char data[100]; data[0] = '\0'; char source[100]; //@ slevel 99; for (int i = 0; i < 99; i++) source[i] = 'Z'; source[99] = '\0'; strncat(data, source, 100); } struct s { char s1[30]; char s2[30]; }; // this test crashes GCC (tested with v7.1.1) due to the non-respect of // non-aliasing in strcpy void crashes_gcc() { struct s s; char *ss = "ABCDEFGHIJKLMNOPQRSTUVWXYZ012"; //@ slevel 30; for (int i = 0; i < 30; i++) s.s1[i] = ss[i]; char *dest = s.s1+29; char *src = s.s1; strcpy(dest, src); // must produce at least a warning } void test_strtok() { if (nondet) { strtok(NULL, " "); // must fail //@ assert unreachable: \false; } char buf[2] = {0}; char *a = strtok(buf, " "); //@ assert a == \null || \subset(a, buf+(0..)); char *b = strtok(NULL, " "); //@ assert b == \null || \subset(b, buf+(0..)); char buf2[4] = "abc"; char *p = strtok(buf2, "b"); //@ assert p == \null || \subset(p, buf2+(0..)); char *q = strtok(NULL, "c"); //@ assert q == \null || \subset(p, buf2+(0..)); // test with non-writable string, but delimiter not found char *r = strtok((char*)"constant!", "NONE_TO_BE_FOUND"); //@ assert r == \null; if (nondet) { strtok((char*)"constant!", "!"); //@ assert unreachable_if_precise: \false; } } void test_strtok_r() { if (nondet) { strtok_r(NULL, " ", NULL); // must fail //@ assert unreachable: \false; } char *saveptr; char buf[2] = {0}; char *a = strtok_r(buf, " ", &saveptr); if (nondet) { strtok_r(buf, " ", NULL); // must fail //@ assert unreachable: \false; } //@ assert a == \null || \subset(a, buf+(0..)); char *b = strtok_r(NULL, " ", &saveptr); Frama_C_show_each_saveptr(saveptr); //@ assert b == \null || \subset(b, buf+(0..)); char buf2[4] = "abc"; char *p = strtok_r(buf2, "b", &saveptr); //@ assert p == \null || \subset(p, buf2+(0..)); char *q = strtok_r(NULL, "c", &saveptr); //@ assert q == \null || \subset(p, buf2+(0..)); // test with non-writable string, but delimiter not found char *r = strtok_r((char*)"constant!", "NONE_TO_BE_FOUND", &saveptr); //@ assert r == \null; if (nondet) { strtok_r((char*)"constant!", "!", &saveptr); //@ assert unreachable_if_precise: \false; } } int main(int argc, char **argv) { test_strcmp(); test_strcat(); test_strstr(); test_strncat(); if (!nondet) crashes_gcc(); test_strtok(); test_strtok_r(); char *a = strdup("bla"); // unsound; specification currently unsupported char *b = strndup("bla", 2); // unsound; specification currently unsupported char buf[16]; char buf2[32]; size_t r1 = strlcpy(buf, "longer than buffer", 16); size_t r2 = strlcpy(buf2, "short", 16); size_t r3 = strlcat(buf2, buf, 32); char *strsig = strsignal(1); //@ assert valid_read_string(strsig); return 0; } frama-c-20.0-Calcium/tests/libc/strings_h.c0000666000000000000000000000071013571573400015430 0ustar #include volatile int nondet; void main() { const char *s1 = "AbC"; const char *s2 = "De"; const char *s3 = "ABc"; char s[3] = "ABc"; int r1 = strcasecmp(s1, s2); int r2 = strcasecmp(s1, s3); int r3 = strcasecmp(s2, s3); if (nondet) strcasecmp(s1, s); int r4 = strncasecmp(s1, s, 3); if (nondet) strncasecmp(s1, s, 4); int r5 = strncasecmp(s1, s2, 0); char s4[10]; bzero(s4, 10); //@ assert s4[9] == s4[8] == 0; } frama-c-20.0-Calcium/tests/libc/sys_file_h.c0000666000000000000000000000027613571573400015563 0ustar #include #include int main() { int fd = open("/tmp/bla", O_APPEND); int r = flock(fd, LOCK_SH); r = flock(fd, LOCK_UN); r = flock(fd, LOCK_EX); return 0; } frama-c-20.0-Calcium/tests/libc/sys_select.c0000666000000000000000000000147013571573400015611 0ustar #include #include #include #include #include #include int main() { int fd1 = socket(AF_INET, SOCK_DGRAM, 0); if (fd1 < 0) exit(1); int max_fd; fd_set fds1, fds2; struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons(8000); int res = bind(fd1, (struct sockaddr *)&addr, sizeof(addr)); if (res < 0) exit(2); FD_ZERO(&fds1); max_fd = fd1; FD_SET(fd1, &fds1); struct timeval timeout; timeout.tv_sec = 20; timeout.tv_usec = 0; memcpy(&fds2, &fds1, sizeof(fds1)); res = select(max_fd + 1, &fds2, NULL, NULL, &timeout); if (FD_ISSET(fd1, &fds2)) { // check that fds2 is initialized // ... } return 0; } frama-c-20.0-Calcium/tests/libc/sys_stat_h.c0000666000000000000000000000102013571573400015603 0ustar /*run.config STDOPT: #"-slevel 2" */ #include #include #include volatile int nondet; int main() { int fd = open("/tmp/bla", O_RDWR, S_IRWXU | S_IRWXG); if (fd == -1) return 1; if (close(fd)) return 2; struct stat st; int r = stat("/tmp/bla", &st); if (r) return r; if (st.st_size <= 0) return 3; int r_mkdir = mkdir("/tmp/tmp", 0755); if (nondet) { char non_terminated[7] = "invalid"; mkdir(non_terminated, 0422); } mode_t old_mask = umask(0644); return 0; } frama-c-20.0-Calcium/tests/libc/sys_time_h.c0000666000000000000000000000146613571573400015604 0ustar #define _XOPEN_SOURCE 600 #include int main() { struct itimerval i1 = {{1, 100}, {2, 200}}; int res = setitimer(ITIMER_REAL, &i1, 0); //@ assert res == 0; struct itimerval i2; res = setitimer(ITIMER_REAL, &i1, &i2); //@ assert res == 0; //@ assert \initialized(&i2); res = getitimer(ITIMER_REAL, &i2); //@ assert res == 0; //@ assert \initialized(&i2); int INVALID_ITIMER = -1; res = getitimer(INVALID_ITIMER, &i2); //@ assert res == -1; i2.it_interval.tv_usec = 1000000; // invalid tv_usec res = setitimer(ITIMER_VIRTUAL, &i2, &i1); //@ assert res == -1; int r1 = utimes("/tmp/utimes", 0); struct timeval tv[2] = { { .tv_sec = 10000000, .tv_usec = 999999 }, { .tv_sec = -9000000, .tv_usec = 1 }, }; int r2 = utimes("/tmp/utimes", tv); return 0; } frama-c-20.0-Calcium/tests/libc/sys_times.c0000666000000000000000000000015713571573400015454 0ustar #include #include int main() { struct tms t; clock_t ck = times(&t); return 0; } frama-c-20.0-Calcium/tests/libc/sys_wait_h.c0000666000000000000000000000052713571573400015607 0ustar /* run.config STDOPT: #"-slevel 4" */ #include int main() { pid_t r = wait(0); int stat_val; r = wait(&stat_val); if (r > 0) { //@ assert \initialized(&stat_val); if (WIFEXITED(stat_val)) return 0; } r = waitpid(r, 0, 0); r = waitpid(r, &stat_val, WCONTINUED | WNOHANG | WUNTRACED); return 0; } frama-c-20.0-Calcium/tests/libc/termios.c0000666000000000000000000000057713571573400015125 0ustar /* run.config* STDOPT: +"-slevel 2" */ #include #include int main() { int fd; struct termios tio; fd = open("/dev/ttyS1", O_RDWR); int res = tcgetattr(fd, &tio); if (res) return 1; if (tio.c_cflag | CS8) { return 8; } tio.c_lflag = (ECHO|ICANON|ISIG|ECHOE|ECHOK|ECHONL); tio.c_oflag = OPOST; return tcsetattr(fd, TCSADRAIN, &tio); } frama-c-20.0-Calcium/tests/libc/test_config0000666000000000000000000000010013571573400015504 0ustar OPT: -eva @EVA_CONFIG@ -cpp-extra-args='-nostdinc -Ishare/libc' frama-c-20.0-Calcium/tests/libc/test_config_gcc0000666000000000000000000000026013571573400016327 0ustar COMMENT: This test config is not run by default. It allows a simple test to the tests, COMMENT: by compiling the file and running it. CMD: ./tests/libc/compile_and_run.sh OPT: frama-c-20.0-Calcium/tests/libc/time_c.c0000666000000000000000000000026413571573400014674 0ustar #include "time.c" volatile int v; int main() { time_t t; if (v) t = 42; char *s = ctime(&t); // warn about initialization //@ assert valid_read_string(s); return 0; } frama-c-20.0-Calcium/tests/libc/time_h.c0000666000000000000000000000161113571573400014676 0ustar /* run.config STDOPT: #"-slevel 4" */ #include int main() { struct timespec req, rem; req.tv_sec = 42; req.tv_nsec = 9001; int r = nanosleep(&req, &rem); while (r) { if (errno == EINTR) { req = rem; r = nanosleep(&req, &rem); } else { return 1; } } r = nanosleep(&req, 0); if (r) return 2; struct timespec creq, crem; creq.tv_sec = 42; creq.tv_nsec = 9001; clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &creq, &crem); //@ assert !\initialized(&crem); clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &creq, 0); r = clock_nanosleep(CLOCK_MONOTONIC, 0, &creq, &crem); while (r) { if (errno == EINTR) { creq = crem; r = clock_nanosleep(CLOCK_MONOTONIC, 0, &creq, &crem); } else { return 1; } } time_t tt = 42; char *time_str = ctime(&tt); //@ assert valid_string(time_str); return 0; } frama-c-20.0-Calcium/tests/libc/time_misc.c0000666000000000000000000000146513571573400015411 0ustar #include #include void test_gettimeofday(void) { struct timeval tv; gettimeofday(&tv, (void *) 0); /*@ assert( \initialized( &tv.tv_sec)); */ /*@ assert( \initialized( &tv.tv_usec)); */ } void test_strftime(void) { char outstr[200]; time_t t; struct tm *tmp; size_t res; t = time(NULL); tmp = localtime(&t); if (tmp) { res = strftime(outstr, sizeof(outstr), "%a %H %j %m %+ %% %Z", tmp); } } volatile int v; void test_ctime(void) { time_t t; if (v) t = 42; char *s = ctime(&t); // warn about initialization //@ assert valid_read_string(s); } int main(int argc, char **argv) { test_gettimeofday(); test_strftime(); test_ctime(); return 0; } /* Local Variables: compile-command: "cd ../.. && ptests.byte -show -config gcc tests/libc/time.c" End: */ frama-c-20.0-Calcium/tests/libc/unistd_h.c0000666000000000000000000000442113571573400015250 0ustar /*run.config STDOPT: #"-slevel 12" #"-val-split-return auto" STDOPT: #"-variadic-no-translation" #"-slevel 12" #"-val-split-return auto" */ #define _GNU_SOURCE #define _XOPEN_SOURCE 600 #include volatile int nondet; int main() { int r = usleep(123); r = usleep(456); char hostname[256]; r = gethostname(hostname, 256); // Note: the value set by gethostname is NOT guaranteed to be null-terminated execl("/bin/sh", "sh", "-c", "ls", (char*)0); r = access("/tmp", R_OK | W_OK | X_OK); //@ assert r == -1 || r == 0; int fd = dup(1); //@ assert fd == -1 || fd >= 0; if (fd == -1) return 1; off_t offset = 42; offset = lseek(fd, offset, SEEK_SET); if (offset == -1) return 1; int fd2 = dup2(2, fd); if (nondet) { dup2(2, -2); //@ assert unreachable: \false; } int pid = fork(); // note: process creation not modeled by Eva //@ assert pid == -1 || pid >= 0; r = setsid(); sync(); long l = sysconf(ARG_MAX); char cwd[64]; char *res_getcwd = getcwd(cwd, 64); if (res_getcwd) { //@ assert res_getcwd == cwd; //@ assert valid_read_string((char*)cwd); // currently imprecise } long pconf = pathconf("/tmp/conf.cfg", _PC_NAME_MAX); uid_t ruid, euid, suid; r = getresuid(&ruid, &euid, &suid); if (!r) { r = setresuid(ruid, euid, suid); //@ assert r == 0 || r == -1; } gid_t rgid, egid, sgid; r = getresgid(&rgid, &egid, &sgid); if (!r) { r = setresgid(rgid, egid, sgid); //@ assert r == 0 || r == -1; } pid_t p = getpid(); p = getppid(); p = getsid(0); ruid = getuid(); rgid = getgid(); euid = geteuid(); egid = getegid(); r = setegid(egid); r = seteuid(euid); r = setgid(rgid); r = setuid(ruid); r = setregid(rgid, egid); r = setreuid(ruid, euid); r = setpgid(p, getpgid(0)); r = getpgrp(); r = unlink("/tmp/test_unlink"); r = isatty(1); //@ assert r == 0 || r == 1; char *tty = ttyname(1); r = chown("/tmp/a.txt", 01000, 01000); r = chdir("/tmp/"); r = chroot("/tmp"); if (nondet) { pipe(0); // invalid fildes //@ assert unreachable:\false; } int halfpipe; if (nondet) { pipe(&halfpipe); // invalid fildes //@ assert unreachable:\false; } int pipefd[2]; r = pipe(pipefd); //@ check ok: r == 0 || r == -1; return 0; } frama-c-20.0-Calcium/tests/libc/wchar_c_h.c0000666000000000000000000000502613571573400015352 0ustar /* run.config STDOPT: +"-cpp-extra-args=-DTEST_IMPLEMENTATION=1" +"-slevel 1000" STDOPT: +"-slevel 1000" COMMENT: slevel is used to ensure all loops are unrolled (including in the COMMENT: implementation). 'goto exit' avoids recomputing split branches. */ #include // check that the following types/macros are defined, as required by C11 §7.29.1 // (note that the variables themselves are not used) wchar_t wc = WCHAR_MIN | WCHAR_MAX; wint_t wi = WEOF | WINT_MIN | WINT_MAX; struct tm t; #ifdef TEST_IMPLEMENTATION #include "wchar.c" #endif volatile int nondet; int main() { wchar_t *sc1 = L"Needle"; wchar_t *sc2 = L"Haystack"; wchar_t buf[20]; wchar_t c = nondet; size_t n = 5, r; int i = -1; wchar_t *res = 0; if (nondet) { res = wmemchr(sc1, c, n); goto exit; } if (nondet) { i = wmemcmp(sc1, sc2, n); goto exit; } if (nondet) { res = wmemcpy(buf, sc2, n); goto exit; } if (nondet) { res = wmemmove(buf, sc2, n); goto exit; } if (nondet) { res = wmemset(buf, c, n); goto exit; } if (nondet) { res = wcschr(sc1, c); goto exit; } if (nondet) { i = wcscmp(sc1, sc2); goto exit; } if (nondet) { res = wcscpy(buf, sc2); goto exit; } if (nondet) { r = wcscspn(sc1, sc2); goto exit; } if (nondet) { r = wcslcat(buf, sc2, n); goto exit; } if (nondet) { r = wcslcpy(buf, sc2, n); goto exit; } if (nondet) { r = wcslen(sc1); goto exit; } if (nondet) { i = wcsncmp(sc1, sc2, n); goto exit; } if (nondet) { res = wcsncpy(buf, sc2, n); goto exit; } if (nondet) { res = wcspbrk(sc1, sc2); goto exit; } if (nondet) { res = wcsrchr(sc1, c); goto exit; } if (nondet) { r = wcsspn(sc1, sc2); goto exit; } if (nondet) { res = wcsstr(sc1, sc2); goto exit; } for (i = 0; i < 5; i++) buf[i] = nondet; buf[i] = L'\0'; if (nondet) { res = wcscat(buf, sc2); goto exit; } buf[i] = L'\0'; if (nondet) { res = wcsncat(buf, sc2, n); goto exit; } // invalid conversions char -> wchar_t, must be detected and not crash if (nondet) { r = wcslen((wchar_t*)""); goto exit; } if (nondet) { r = wcslen((wchar_t*)"A"); goto exit; } if (nondet) { r = wcslen((wchar_t*)"ABCD"); goto exit; } if (nondet) { res = wcschr((wchar_t*)"", L'A'); goto exit; } if (nondet) { res = wcschr((wchar_t*)"A", L'A'); goto exit; } if (nondet) { res = wcschr((wchar_t*)"ABCD", L'A'); goto exit; } // small sanity tests wchar_t *wc = L"ABC"; wchar_t *p = L"ABC" + 1; wchar_t *wcr = wcschr(p, L'C'); wchar_t *wmr1 = wmemchr(wc, L'C', 2); // not found wchar_t *wmr2 = wmemchr(p, L'C', 2); // found exit: return 0; } frama-c-20.0-Calcium/tests/libc/wchar_h.c0000666000000000000000000000376113571573400015054 0ustar #include #include volatile int v; int main() { FILE *fd = fopen("bla", "r"); if (!fd) return 1; wchar_t buf[30]; wchar_t *res = fgetws(buf, 29, fd); if (!res) return 1; //@ assert res == buf; wchar_t buf2[2]; buf2[0] = L'a'; wchar_t *r = wmemchr(buf2, L'a', 2); // no warning //@ check ok: r != \null; r = wmemchr(0, 0, 0); // should be ok //@ check ok: r == \null; if (v) { r = wmemchr(buf2, 0, 2); // red alarm (uninit) //@ assert unreachable:\false; } r = wmemchr(buf2, L'a', 3); // no warning //@ check ok: r != \null; if (v) buf2[1] = L'b'; r = wmemchr(buf2, L'a', 3); // no warning //@ check ok: r != \null; r = wmemchr(buf2, L'b', 3); // warning: buf2[1] maybe uninit //@ check ok: r != \null; buf2[1] = L'b'; r = wmemchr(buf2, L'b', 3); // no warning //@ check ok: r != \null; wchar_t *wsrc = L"wide thing"; wchar_t wdst[10]; r = wcsncpy(wdst, wsrc, 10); // no warning //@ check ok: r == wdst; //@ check ok: \initialized(&wdst[9]); if (v) { r = wcsncpy(wdst, wsrc, wcslen(wsrc)+1); // error: not enough room //@ assert unreachable:\false; } if (v) { wcsncpy(wdst, wdst, 10); // error: no separation //@ assert unreachable:\false; } if (v) { wcsncpy(0, wsrc, 10); // error: invalid dest //@ assert unreachable:\false; } if (v) { wcsncpy(wdst, 0, 10); // error: invalid src //@ assert unreachable:\false; } if (v) { wcsncpy(wsrc, wdst, 10); // error: non-writable dest //@ assert unreachable:\false; } wcsncmp(wsrc, wsrc, 11); // no warning wcsncmp(wsrc, wdst, 11); // warning: wdst possibly invalid wchar_t wdst2[20] = {0}; wcsncat(wdst2, wsrc, 11); // no warning wcsncat(wdst2, wsrc, 10); // no warning (if wdst2 is precise) //@ loop unroll 10; for (int i = 0; i < 10; i++) wdst2[i] = L'A'; wdst2[10] = L'\0'; // wdst2 now has length 10 if (v) { wcsncat(wdst2+10, wdst2, 10); // error: no separation //@ assert unreachable:\false; } return 0; } frama-c-20.0-Calcium/tests/make_run_script/0000777000000000000000000000000013571573400015542 5ustar frama-c-20.0-Calcium/tests/make_run_script/make_run_script.mll0000666000000000000000000001767413571573400021454 0ustar { let debug = true let string_if_not_zero nbr = if nbr = 0 then "" else "."^string_of_int nbr type state = CMD_STATE | ARG_STATE | SRC_STATE | OPT_STATE | PPC_STATE | GCC_STATE type token = TOP_TOKEN | CFG_TOKEN | CMD_TOKEN let head = "#!/bin/sh\n" ^ "if [ $# -lt 5 ] ; then\n" ^ " echo `basename $0`\": a subshell build by make_run_script.\"\n" ^ " exit 1\n" ^ "fi\n" ^ "#comparaison\n" ^ "Compare() {\n" ^ " if [ -e $1$2 ]; then\n" ^ " File=`basename $1$2 .log`.oracle\n" ^ " Dir=`dirname $1`\n" ^ " Dir=`dirname $Dir`\n" ^ " File=\"$Dir/oracle/$File\"\n" ^ " if [ -e ${File} ]; then\n" ^ " if ! diff -b -B --brief $1$2 ${File} >/dev/null\n" ^ " then\n" ^ " echo \". KO: diff -b -B $1$2 ${File}\"\n" ^ " fi\n" ^ " else\n" ^ " echo \". NO oracle ${File}\"\n" ^ " fi\n" ^ " fi\n" ^ "}\n" ^ "# input file\n" ^ "Src=$1\n" ^ "shift\n" ^ "# prefix for the out files\n" ^ "PreFix=$1\n" ^ "shift\n" ^ "# extension for out files issued from stdout\n" ^ "PostFix1=$1\n" ^ "shift\n" ^ "# extension for out files issued from stderr\n" ^ "PostFix2=$1\n" ^ "shift\n" ^ "# command running the test\n" ^ "Cmd=$1\n" ^ "shift\n" ^ "#\n" ^ "Result=0\n" let line_nbr, lex_token, cmd_state, cmd_head, cmd_nbr, cmd_str = ref 1, ref TOP_TOKEN, ref CMD_STATE, ref false, ref 0, ref "" (* GCC: check the compilation of the source file*) let flush_gcc_line cmd nbr = (* Printf.printf"# check the compilation of the source file.\n"; Printf.printf"#\n#echo \"- Test %d: compilation checking...\"\n" nbr; Printf.printf"echo \"gcc %s -c ${Src} -o ${PreFix}.o\"\n" cmd; Printf.printf"gcc %s -c ${Src} -o ${PreFix}.o 2> /dev/null\n" cmd; Printf.printf"Res=$?\n"; Printf.printf"rm -f ${PreFix}.o\n"; Printf.printf"if [ \"${Res}\" != 0 ] ; then\n"; Printf.printf" echo \"# compilation problem with: gcc %s -c ${Src} -o ${PreFix}.o\"\n" cmd; Printf.printf"fi\n" *) () let flush_redirection nbr_ = let nbr = string_if_not_zero nbr_ in Printf.printf" > ${PreFix}%s${PostFix1} 2> ${PreFix}%s${PostFix2}\n" nbr nbr; Printf.printf"Res=$?\n"; Printf.printf"if [ \"${Res}\" != 0 ] ; then\n"; Printf.printf" Result=${Res}\n"; Printf.printf" echo \"# abort(${Res}) on test No %d\"\n" nbr_; Printf.printf"else\n"; Printf.printf" Compare ${PreFix}%s${PostFix1}\n" nbr; Printf.printf" Compare ${PreFix}%s${PostFix2}\n" nbr; Printf.printf"fi\n" (* default binary, options and source file are still into the command. *) (* SRC: * * *) (* cmd= SRC *) (* cmd= * * *) let flush_src_line cmd nbr = Printf.printf"#\n#echo \"- Test %d: running...\"\n" nbr; Printf.printf"echo \"${Cmd} %s ${Src}\"\n" cmd; Printf.printf"${Cmd} $* %s ${Src}" cmd; flush_redirection nbr (* default binary and source file are still into the command. *) (* OPT: * * *) (* cmd= OPT *) (* cmd= * * *) let flush_opt_line cmd nbr = Printf.printf"#\n#echo \"- Test %d: running...\"\n" nbr; Printf.printf"echo \"${Cmd} %s ${Src}\"\n" cmd; Printf.printf"${Cmd} %s ${Src}" cmd; flush_redirection nbr (* default binary is still into the command. *) (* ARG: * * *) (* cmd= ARG *) (* cmd= * * *) let flush_arg_line cmd nbr = Printf.printf"#\n#echo \"- Test %d: running...\"\n" nbr; Printf.printf"echo \"${Cmd} %s\"\n" cmd; Printf.printf"${Cmd} %s" cmd; flush_redirection nbr (* CMD: * * *) (* cmd= CMD *) (* cmd= * *) let flush_cmd_line cmd nbr = Printf.printf"#\n#echo \"- Test %d: running...\"\n" nbr; Printf.printf"echo \"%s\"\n" cmd; Printf.printf"%s" cmd; flush_redirection nbr let flush_cmd state = if not !cmd_head then Printf.printf"%s" head; (match state with | PPC_STATE -> flush_gcc_line "" !cmd_nbr; Printf.printf"${Cmd} $* ${Src}" | GCC_STATE -> flush_gcc_line !cmd_str !cmd_nbr | OPT_STATE -> flush_opt_line !cmd_str !cmd_nbr; incr cmd_nbr | ARG_STATE -> flush_arg_line !cmd_str !cmd_nbr; incr cmd_nbr | SRC_STATE -> flush_src_line !cmd_str !cmd_nbr; incr cmd_nbr | CMD_STATE -> flush_cmd_line !cmd_str !cmd_nbr; incr cmd_nbr); cmd_head := true; cmd_str := "" let debug_cmd txt = if debug then Printf.printf"#%s\n" txt else () let state_cmd token info = lex_token := token; debug_cmd info let start_cmd state token info= cmd_state := state; state_cmd token info let start_cfg state token info = if state = !cmd_state then flush_cmd !cmd_state; start_cmd state token info let build_cmd s = cmd_str := !cmd_str ^ s exception Eof exception ConfigNotFound } rule token_top = parse '\n' { if (5 > !line_nbr) then line_nbr := 1 + !line_nbr else raise ConfigNotFound } | [^ '\n'] { } | eof { debug_cmd "end of file"; raise Eof } | "/*" ([' ' '\t']*) "run.config" ([' ' '\t' '\n']) { line_nbr := 1; start_cmd PPC_STATE CFG_TOKEN "parsing config"; } and token_cfg = parse | '\n' { } | [^ '*' '\n' ' ' '\t' ]+ { } | ['*' ' ' '\t'] { } | eof { debug_cmd "end of file"; raise Eof } | ('\n' | ['*' ' ' '\t'])* "GCC:" { start_cmd GCC_STATE CMD_TOKEN "* GCC:" } | ('\n' | ['*' ' ' '\t'])* "CMD:" { start_cmd CMD_STATE CMD_TOKEN "* CMD:"} | ('\n' | ['*' ' ' '\t'])* "OPT:" { start_cmd OPT_STATE CMD_TOKEN "* OPT:" } | ('\n' | ['*' ' ' '\t'])* "ARG:" { start_cmd ARG_STATE CMD_TOKEN "* ARG:"} | ('\n' | ['*' ' ' '\t'])* "SRC:" { start_cmd SRC_STATE CMD_TOKEN "* SRC:"} | "*/" { start_cfg PPC_STATE TOP_TOKEN "end of config" } and token_cmd = parse '\\' '\n' [' ' '\t']* { } | '\n' { flush_cmd !cmd_state; state_cmd CFG_TOKEN "* end of line"} | ('\\' as c) { build_cmd (String.make 1 c) } | ([^ '\n' '\\']+ as s) { build_cmd s } | eof { flush_cmd !cmd_state; raise Eof } | "*/" { flush_cmd !cmd_state; state_cmd TOP_TOKEN "end of parsing"} { let _ = ( try let std_channel = if Array.length Sys.argv = 1 then stdin else open_in Sys.argv.(1) in let lexbuffer = Lexing.from_channel std_channel in while true do let lexfun = (match !lex_token with | TOP_TOKEN -> token_top | CFG_TOKEN -> token_cfg | CMD_TOKEN -> token_cmd) in lexfun lexbuffer done with Eof -> debug_cmd "#end of file" | ConfigNotFound -> () | Failure(s) -> Printf.printf"#ERROR\n"); print_newline(); if not !cmd_head then exit 1; Printf.printf"#return last abort value.\n"; Printf.printf"exit ${Result}\n"; flush stdout; } frama-c-20.0-Calcium/tests/metrics/0000777000000000000000000000000013571573400014023 5ustar frama-c-20.0-Calcium/tests/metrics/cabs.i0000666000000000000000000000022713571573400015106 0ustar /* run.config STDOPT: +"-metrics-ast cabs" */ void main() { int j = 1; //@ loop pragma UNROLL 6; for (int i=0; i<6; i++) { j += 2; } } frama-c-20.0-Calcium/tests/metrics/cyclo_comp5.c0000666000000000000000000000066013571573400016405 0ustar /* run.config STDOPT: +"-metrics-ast cil" **/ void printf(const char *format); int complexity5(int n){ if (n > 0) { switch (n) { case 0 : case 1: printf("Zero or one\n"); break; case 2: printf("Two\n"); break; case 3: case 4: printf("Three or four\n"); break; default: break; }} else printf("Negative\n"); return(n); } int main() { return complexity5(1); } frama-c-20.0-Calcium/tests/metrics/func_ptr.c0000666000000000000000000000105513571573400016010 0ustar /* run.config STDOPT: +"-metrics-eva-cover -metrics-cover main -load-module scope" STDOPT: +"-metrics-eva-cover -main foobar -metrics-cover foobar -load-module scope" **/ void (*bar) (int); extern void (*bar_extern) (int); void baz (int j) { return; } int foobar () { bar = baz; bar (2); return 0; } void foo (int k) { int i = 0; return; } /* foo is unreachable since j is always 0 */ int main() { int j = 0; if (!j) { return 1; } else { if (bar == bar_extern) exit (1); bar = foo; bar (1); return 0; } } frama-c-20.0-Calcium/tests/metrics/libc.c0000666000000000000000000000123213571573400015076 0ustar /* run.config STDOPT: #"-metrics-no-libc -metrics-eva-cover" STDOPT: #"-metrics-libc -metrics-eva-cover" */ #include #include // defines external variables #include // getopt will have the fc_stdlib attribute, but foo and bar won't; // ensure they are not skipped during syntactic search int foo() { return 42; } int bar() { return 42; } int f() { // never called return getchar(); } int g() { // called via fp return isalpha(42); } int (*fp)() = g; int getopt(int argc, char * const argv[], const char *optstring) { return foo() + bar(); } int main() { fp(); getopt(0, 0, 0); return isblank(0); } frama-c-20.0-Calcium/tests/metrics/locals_size.i0000666000000000000000000000225413571573400016507 0ustar /* run.config OPT: -metrics-locals-size f,g,level3,level2,level1,main OPT: -metrics-locals-size recurse2 */ // locals size without temps: 0 int f() { static int count = 0; // not a local count++; return count; } // locals size without temps: sizeof(k) + sizeof(l2) + sizeof(__retres) int g() { char l1 = 3; int l2 = l1++; // force creation of a temporary return l1 + l2; } // locals size without temps: sizeof(p) + sizeof(k) + sizeof(__retres) int level3(int p) { char k = 13; return k + p; } // locals size without temps: sizeof(a) + sizeof(b) int level2(int a, int b) { return level3(a + b + a); } // locals size without temps: sizeof(f) + sizeof(t1) + sizeof(t2) int level1(int f) { int t1 = f; int t2 = f + 2; return level2(t1, t2); } typedef int incomplete[]; // locals size without temps: sizeof(i) + sizeof(k) + sizeof(j) + // sizeof(__retres) int main() { incomplete i = {0}; int k = f() + g(); // temporaries int j = level1(f()); return 0; } int recurse2(int); int recurse1(int k) { if (k < 2) return 1; else return recurse2(k-1); } int recurse2(int k) { if (k < 3) return 0; else return recurse1(k-1); } frama-c-20.0-Calcium/tests/metrics/oracle/0000777000000000000000000000000013571573400015270 5ustar frama-c-20.0-Calcium/tests/metrics/oracle/cabs.res.oracle0000666000000000000000000000120613571573400020156 0ustar [kernel] Parsing tests/metrics/cabs.i (no preprocessing) [metrics] Halstead metrics ================ Total operators: 15 Distinct operators: 10 Total_operands: 9 Distinct operands: 6 Program length: 24 Vocabulary size: 16 Program volume: 96 Effort: 720 Program level: 0.13 Difficulty level: 7.50 Time to implement: 40 Bugs delivered: 0.03 Global statistics (Halstead) ============================ Operators --------- for: 1 ): 1 {: 1 (: 1 }: 1 ;: 5 ++: 1 +=: 1 <: 1 int: 2 Operands -------- j: 2 i: 3 2: 1 1: 1 6: 1 0: 1 frama-c-20.0-Calcium/tests/metrics/oracle/cyclo_comp5.res.oracle0000666000000000000000000000117013571573400021462 0ustar [kernel] Parsing tests/metrics/cyclo_comp5.c (with preprocessing) [metrics] Defined functions (2) ===================== complexity5 (1 call); main (0 call); Undefined functions (1) ======================= printf (4 calls); 'Extern' global variables (0) ============================= Potential entry points (1) ========================== main; Global metrics ============== Sloc = 13 Decision point = 4 Global variables = 0 If = 1 Loop = 0 Goto = 0 Assignment = 1 Exit point = 2 Function = 3 Function call = 5 Pointer dereferencing = 0 Cyclomatic complexity = 6 frama-c-20.0-Calcium/tests/metrics/oracle/func_ptr.0.res.oracle0000666000000000000000000000541113571573400021226 0ustar [kernel] Parsing tests/metrics/func_ptr.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/metrics/func_ptr.c:28: Warning: Calling undeclared function exit. Old style K&R code? [metrics] Defined functions (4) ===================== baz (address taken) (0 call); foo (address taken) (0 call); foobar (0 call); main (0 call); Undefined functions (1) ======================= exit (1 call); 'Extern' global variables (1) ============================= bar_extern Potential entry points (2) ========================== foobar; main; Global metrics ============== Sloc = 20 Decision point = 2 Global variables = 2 If = 2 Loop = 0 Goto = 2 Assignment = 7 Exit point = 4 Function = 5 Function call = 3 Pointer dereferencing = 2 Cyclomatic complexity = 6 [metrics] Functions syntactically reachable from main: 3 ---------------------------------------------- : exit; foo; main; Functions syntactically unreachable from main: 2 ------------------------------------------------ : baz; foobar; [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization bar ∈ {0} bar_extern ∈ {0} [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 4): 25% coverage. In this function, 6 statements reached (out of 13): 46% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 0 warnings by the Frama-C kernel: 0 errors 1 warning ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [metrics] Eva coverage statistics ======================= Syntactically reachable functions = 3 (out of 5) Semantically reached functions = 1 Coverage estimation = 33.3% Unreached functions (2) = : exit; foo; [metrics] References to non-analyzed functions ------------------------------------ Function main calls exit (at tests/metrics/func_ptr.c:28) Function main references foo (at tests/metrics/func_ptr.c:29) [metrics] Statements analyzed by Eva -------------------------- 13 stmts in analyzed functions, 6 stmts analyzed (46.2%) main: 6 stmts out of 13 (46.2%) frama-c-20.0-Calcium/tests/metrics/oracle/func_ptr.1.res.oracle0000666000000000000000000000503713571573400021233 0ustar [kernel] Parsing tests/metrics/func_ptr.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/metrics/func_ptr.c:28: Warning: Calling undeclared function exit. Old style K&R code? [metrics] Defined functions (4) ===================== baz (address taken) (0 call); foo (address taken) (0 call); foobar (0 call); main (0 call); Undefined functions (1) ======================= exit (1 call); 'Extern' global variables (1) ============================= bar_extern Potential entry points (2) ========================== foobar; main; Global metrics ============== Sloc = 20 Decision point = 2 Global variables = 2 If = 2 Loop = 0 Goto = 2 Assignment = 7 Exit point = 4 Function = 5 Function call = 3 Pointer dereferencing = 2 Cyclomatic complexity = 6 [metrics] Functions syntactically reachable from foobar: 2 ------------------------------------------------ : baz; foobar; Functions syntactically unreachable from foobar: 3 -------------------------------------------------- : exit; foo; main; [eva] Analyzing a complete application starting at foobar [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization bar ∈ {0} bar_extern ∈ {0} [eva] done for function foobar [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 2 functions analyzed (out of 4): 50% coverage. In these functions, 5 statements reached (out of 5): 100% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 0 warnings by the Frama-C kernel: 0 errors 1 warning ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [metrics] Eva coverage statistics ======================= Syntactically reachable functions = 2 (out of 5) Semantically reached functions = 2 Coverage estimation = 100.0% [metrics] Statements analyzed by Eva -------------------------- 5 stmts in analyzed functions, 5 stmts analyzed (100.0%) baz: 1 stmts out of 1 (100.0%) foobar: 4 stmts out of 4 (100.0%) frama-c-20.0-Calcium/tests/metrics/oracle/libc.0.res.oracle0000666000000000000000000000456413571573400020327 0ustar [kernel] Parsing tests/metrics/libc.c (with preprocessing) [metrics] Defined functions (5) ===================== bar (0 call); f (0 call); foo (0 call); g (address taken) (0 call); main (0 call); Undefined functions (0) ======================= 'Extern' global variables (0) ============================= Potential entry points (4) ========================== bar; f; foo; main; Global metrics ============== Sloc = 12 Decision point = 0 Global variables = 1 If = 0 Loop = 0 Goto = 0 Assignment = 5 Exit point = 5 Function = 5 Function call = 5 Pointer dereferencing = 1 Cyclomatic complexity = 5 [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization fp ∈ {{ &g }} [eva] using specification for function isalpha [eva] using specification for function isblank [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 4 functions analyzed (out of 5): 80% coverage. In these functions, 10 statements reached (out of 10): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 0 valid 0 unknown 0 invalid 0 total Preconditions 2 valid 0 unknown 0 invalid 2 total 100% of the logical properties reached have been proven. ---------------------------------------------------------------------------- [metrics] Eva coverage statistics ======================= Syntactically reachable functions = 4 (out of 5) Semantically reached functions = 4 Coverage estimation = 100.0% [metrics] References to non-analyzed functions ------------------------------------ [metrics] Statements analyzed by Eva -------------------------- 10 stmts in analyzed functions, 10 stmts analyzed (100.0%) bar: 2 stmts out of 2 (100.0%) foo: 2 stmts out of 2 (100.0%) g: 2 stmts out of 2 (100.0%) main: 4 stmts out of 4 (100.0%) frama-c-20.0-Calcium/tests/metrics/oracle/libc.1.res.oracle0000666000000000000000000001140013571573400020313 0ustar [kernel] Parsing tests/metrics/libc.c (with preprocessing) [metrics] Defined functions (6) ===================== bar (1 call); f (0 call); foo (1 call); g (address taken) (0 call); getopt (1 call); main (0 call); Undefined functions (120) ========================= _exit (0 call); access (0 call); chdir (0 call); chown (0 call); chroot (0 call); clearerr (0 call); clearerr_unlocked (0 call); close (0 call); dup (0 call); dup2 (0 call); execl (0 call); execle (0 call); execlp (0 call); execv (0 call); execve (0 call); execvp (0 call); fclose (0 call); fdopen (0 call); feof (0 call); feof_unlocked (0 call); ferror (0 call); ferror_unlocked (0 call); fflush (0 call); fgetc (0 call); fgetpos (0 call); fgets (0 call); fileno (0 call); fileno_unlocked (0 call); flockfile (0 call); fopen (0 call); fork (0 call); fputc (0 call); fputs (0 call); fread (0 call); freopen (0 call); fseek (0 call); fsetpos (0 call); ftell (0 call); ftrylockfile (0 call); funlockfile (0 call); fwrite (0 call); getc (0 call); getc_unlocked (0 call); getchar (1 call); getchar_unlocked (0 call); getcwd (0 call); getegid (0 call); geteuid (0 call); getgid (0 call); gethostname (0 call); getopt_long (0 call); getopt_long_only (0 call); getpgid (0 call); getpgrp (0 call); getpid (0 call); getppid (0 call); getresgid (0 call); getresuid (0 call); gets (0 call); getsid (0 call); getuid (0 call); isalnum (0 call); isalpha (1 call); isascii (0 call); isatty (0 call); isblank (1 call); iscntrl (0 call); isdigit (0 call); isgraph (0 call); islower (0 call); isprint (0 call); ispunct (0 call); isspace (0 call); isupper (0 call); isxdigit (0 call); lseek (0 call); pathconf (0 call); pclose (0 call); perror (0 call); pipe (0 call); popen (0 call); putc (0 call); putc_unlocked (0 call); putchar (0 call); putchar_unlocked (0 call); puts (0 call); read (0 call); remove (0 call); rename (0 call); rewind (0 call); setbuf (0 call); setegid (0 call); seteuid (0 call); setgid (0 call); sethostname (0 call); setpgid (0 call); setregid (0 call); setresgid (0 call); setresuid (0 call); setreuid (0 call); setsid (0 call); setuid (0 call); setvbuf (0 call); sync (0 call); sysconf (0 call); tmpfile (0 call); tmpnam (0 call); tolower (0 call); toupper (0 call); ttyname (0 call); ungetc (0 call); unlink (0 call); usleep (0 call); vfprintf (0 call); vfscanf (0 call); vprintf (0 call); vscanf (0 call); vsnprintf (0 call); vsprintf (0 call); write (0 call); 'Extern' global variables (10) ============================== Frama_C_entropy_source; __fc_errno; __fc_hostname; __fc_stdin; __fc_stdout; __fc_ttyname; optarg; opterr; optind; optopt Potential entry points (2) ========================== f; main; Global metrics ============== Sloc = 17 Decision point = 0 Global variables = 17 If = 0 Loop = 0 Goto = 0 Assignment = 8 Exit point = 6 Function = 126 Function call = 7 Pointer dereferencing = 1 Cyclomatic complexity = 6 [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization fp ∈ {{ &g }} [eva] using specification for function isalpha [eva] using specification for function isblank [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 4 functions analyzed (out of 5): 80% coverage. In these functions, 10 statements reached (out of 10): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 0 valid 0 unknown 0 invalid 0 total Preconditions 2 valid 0 unknown 0 invalid 2 total 100% of the logical properties reached have been proven. ---------------------------------------------------------------------------- [metrics] Eva coverage statistics ======================= Syntactically reachable functions = 7 (out of 126) Semantically reached functions = 7 Coverage estimation = 100.0% [metrics] References to non-analyzed functions ------------------------------------ [metrics] Statements analyzed by Eva -------------------------- 15 stmts in analyzed functions, 15 stmts analyzed (100.0%) bar: 2 stmts out of 2 (100.0%) foo: 2 stmts out of 2 (100.0%) g: 2 stmts out of 2 (100.0%) getopt: 5 stmts out of 5 (100.0%) main: 4 stmts out of 4 (100.0%) frama-c-20.0-Calcium/tests/metrics/oracle/locals_size.0.res.oracle0000666000000000000000000000107713571573400021721 0ustar [kernel] Parsing tests/metrics/locals_size.i (no preprocessing) [metrics] function locals_size_no_temps locals_size_with_temps max_call_size_no_temps max_call_size_with_temps [metrics] f 0 0 0 0 [metrics] g 9 10 0 0 [metrics] level3 9 9 0 0 [metrics] level2 8 12 9 9 [metrics] level1 12 16 17 21 [metrics] User Error: in function main, cannot compute sizeof i (type incomplete) [metrics] main 12 28 29 37 [metrics] User Error: Deferred error message was emitted during execution. See above messages for more information. [kernel] Plug-in metrics aborted: invalid user input. frama-c-20.0-Calcium/tests/metrics/oracle/locals_size.1.res.oracle0000666000000000000000000000050113571573400021711 0ustar [kernel] Parsing tests/metrics/locals_size.i (no preprocessing) [metrics] function locals_size_no_temps locals_size_with_temps max_call_size_no_temps max_call_size_with_temps [metrics] User Error: unsupported recursive call detected: recurse2 <- recurse1 <- recurse2 [kernel] Plug-in metrics aborted: invalid user input. frama-c-20.0-Calcium/tests/metrics/oracle/reach.res.oracle0000666000000000000000000000615513571573400020340 0ustar [kernel] Parsing tests/metrics/reach.c (with preprocessing) [metrics] Cil AST Stats for function ============================================== Sloc = 1 Decision point = 0 Global variables = 0 If = 0 Loop = 0 Goto = 0 Assignment = 0 Exit point = 1 Function = 1 Function call = 0 Pointer dereferencing = 0 Cyclomatic complexity = 1 Stats for function ============================================== Sloc = 2 Decision point = 0 Global variables = 0 If = 0 Loop = 0 Goto = 0 Assignment = 1 Exit point = 1 Function = 1 Function call = 0 Pointer dereferencing = 0 Cyclomatic complexity = 1 Stats for function =============================================== Sloc = 12 Decision point = 1 Global variables = 0 If = 1 Loop = 0 Goto = 2 Assignment = 5 Exit point = 1 Function = 1 Function call = 1 Pointer dereferencing = 1 Cyclomatic complexity = 2 [metrics] Defined functions (3) ===================== baz (address taken) (0 call); foo (address taken) (0 call); main (0 call); Undefined functions (0) ======================= 'Extern' global variables (0) ============================= Potential entry points (1) ========================== main; Global metrics ============== Sloc = 15 Decision point = 1 Global variables = 2 If = 1 Loop = 0 Goto = 2 Assignment = 6 Exit point = 3 Function = 3 Function call = 1 Pointer dereferencing = 1 Cyclomatic complexity = 4 [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization bar ∈ {0} t[0] ∈ {{ &baz }} [1] ∈ {0} [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 3): 33% coverage. In this function, 7 statements reached (out of 12): 58% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [metrics] Eva coverage statistics ======================= Syntactically reachable functions = 3 (out of 3) Semantically reached functions = 1 Coverage estimation = 33.3% Unreached functions (2) = : baz; foo; [metrics] References to non-analyzed functions ------------------------------------ Function main references foo (at tests/metrics/reach.c:26) Initializer of t references baz (at tests/metrics/reach.c:10) [metrics] Statements analyzed by Eva -------------------------- 12 stmts in analyzed functions, 7 stmts analyzed (58.3%) main: 7 stmts out of 12 (58.3%) frama-c-20.0-Calcium/tests/metrics/oracle/unreachable.res.oracle0000666000000000000000000000636213571573400021527 0ustar [kernel] Parsing tests/metrics/unreachable.c (with preprocessing) [metrics] Defined functions (2) ===================== foo (1 call); main (0 call); Undefined functions (0) ======================= 'Extern' global variables (0) ============================= Potential entry points (1) ========================== main; Global metrics ============== Sloc = 12 Decision point = 1 Global variables = 0 If = 1 Loop = 0 Goto = 2 Assignment = 4 Exit point = 2 Function = 2 Function call = 1 Pointer dereferencing = 0 Cyclomatic complexity = 3 [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 2): 50% coverage. In this function, 6 statements reached (out of 10): 60% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [metrics] Eva coverage statistics ======================= Syntactically reachable functions = 2 (out of 2) Semantically reached functions = 1 Coverage estimation = 50.0% Unreached functions (1) = : foo; [metrics] References to non-analyzed functions ------------------------------------ Function main calls foo (at tests/metrics/unreachable.c:16) [metrics] Statements analyzed by Eva -------------------------- 10 stmts in analyzed functions, 6 stmts analyzed (60.0%) main: 6 stmts out of 10 (60.0%) [eva] Analyzing a complete application starting at foo [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] done for function foo [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 2): 50% coverage. In this function, 2 statements reached (out of 2): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [metrics] Eva coverage statistics ======================= Syntactically reachable functions = 1 (out of 2) Semantically reached functions = 1 Coverage estimation = 100.0% [metrics] Statements analyzed by Eva -------------------------- 2 stmts in analyzed functions, 2 stmts analyzed (100.0%) foo: 2 stmts out of 2 (100.0%) frama-c-20.0-Calcium/tests/metrics/oracle/used-files.0.res.oracle0000666000000000000000000000306013571573400021444 0ustar [kernel] Parsing tests/metrics/used-files.i (no preprocessing) [kernel] Parsing tests/metrics/used-files1.i (no preprocessing) [kernel] Parsing tests/metrics/used-files2.i (no preprocessing) [kernel] Parsing tests/metrics/used-files3.i (no preprocessing) [kernel] Parsing tests/metrics/used-files4.i (no preprocessing) [kernel] Parsing tests/metrics/used-files5.i (no preprocessing) [kernel] Parsing tests/metrics/used-files6.i (no preprocessing) [kernel] Parsing tests/metrics/used-files7.i (no preprocessing) [kernel] Parsing tests/metrics/used-files8.i (no preprocessing) [kernel] Parsing tests/metrics/used-files9.c (with preprocessing) [kernel] Parsing tests/metrics/used-files1.h (with preprocessing) [kernel] Parsing tests/metrics/used-files2.h (with preprocessing) [metrics] Used files starting at function 'main': - command line has 8 out of 12 file(s) being used - 1 used file(s) inside #include directives, of which 1 '.c' file(s). Used command-line files (8) =========================== tests/metrics/used-files.i \ tests/metrics/used-files1.h \ tests/metrics/used-files1.i \ tests/metrics/used-files2.i \ tests/metrics/used-files3.i \ tests/metrics/used-files6.i \ tests/metrics/used-files7.i \ tests/metrics/used-files8.i \ Unused command-line files (4) ============================= tests/metrics/used-files2.h \ tests/metrics/used-files4.i \ tests/metrics/used-files5.i \ tests/metrics/used-files9.c \ Used, but implicitly included C files (1) ========================================= tests/metrics/used-files10.c \ frama-c-20.0-Calcium/tests/metrics/oracle/used-files.1.res.oracle0000666000000000000000000000266113571573400021453 0ustar [kernel] Parsing tests/metrics/used-files.i (no preprocessing) [kernel] Parsing tests/metrics/used-files1.i (no preprocessing) [kernel] Parsing tests/metrics/used-files2.i (no preprocessing) [kernel] Parsing tests/metrics/used-files3.i (no preprocessing) [kernel] Parsing tests/metrics/used-files4.i (no preprocessing) [kernel] Parsing tests/metrics/used-files5.i (no preprocessing) [kernel] Parsing tests/metrics/used-files6.i (no preprocessing) [kernel] Parsing tests/metrics/used-files7.i (no preprocessing) [kernel] Parsing tests/metrics/used-files8.i (no preprocessing) [kernel] Parsing tests/metrics/used-files9.c (with preprocessing) [kernel] Parsing tests/metrics/used-files1.h (with preprocessing) [kernel] Parsing tests/metrics/used-files2.h (with preprocessing) [metrics] Used files starting at function 'g': - command line has 4 out of 12 file(s) being used - 0 used file(s) inside #include directives, of which 0 '.c' file(s). Used command-line files (4) =========================== tests/metrics/used-files1.h \ tests/metrics/used-files2.i \ tests/metrics/used-files3.i \ tests/metrics/used-files8.i \ Unused command-line files (8) ============================= tests/metrics/used-files.i \ tests/metrics/used-files1.i \ tests/metrics/used-files2.h \ tests/metrics/used-files4.i \ tests/metrics/used-files5.i \ tests/metrics/used-files6.i \ tests/metrics/used-files7.i \ tests/metrics/used-files9.c \ frama-c-20.0-Calcium/tests/metrics/oracle/variadic-stdlib-generated.res.oracle0000666000000000000000000000120013571573400024235 0ustar [kernel] Parsing tests/metrics/variadic-stdlib-generated.c (with preprocessing) [metrics] Defined functions (2) ===================== main (0 call); my_printf (1 call); Undefined functions (1) ======================= rand (1 call); 'Extern' global variables (0) ============================= Potential entry points (1) ========================== main; Global metrics ============== Sloc = 5 Decision point = 0 Global variables = 0 If = 0 Loop = 0 Goto = 0 Assignment = 0 Exit point = 2 Function = 3 Function call = 3 Pointer dereferencing = 0 Cyclomatic complexity = 2 frama-c-20.0-Calcium/tests/metrics/reach.c0000666000000000000000000000070013571573400015246 0ustar /* run.config STDOPT: +"-metrics-by-function -metrics-eva-cover -load-module scope" **/ void (*bar) (int); void (*t[2])(int); void baz (int j) { return; } void (*t[2])(int)= { baz, 0}; void foo (int k) { int i = 0; return; } /* foo is unreachable since j is always 0; baz is not called */ int main() { int j = 0; void (*(*pt)[2])(int) = &t; if (!j) { return 1; } else { bar = foo; bar (1); return 0; } } frama-c-20.0-Calcium/tests/metrics/test_config0000666000000000000000000000007613571573400016255 0ustar OPT: -no-autoload-plugins -load-module metrics,scope -metrics frama-c-20.0-Calcium/tests/metrics/unreachable.c0000666000000000000000000000041413571573400016437 0ustar /* run.config STDOPT: +"-load-module scope -metrics-eva-cover -then -main foo" **/ void foo () { int i = 0; return; } /* foo is unreachable since j is always 0 */ int main() { int j = 0; if (!j) { return 1; } else { foo (); return 0; } } frama-c-20.0-Calcium/tests/metrics/used-files.i0000666000000000000000000000154113571573400016236 0ustar /* run.config OPT: -metrics-used-files @PTEST_DIR@/@PTEST_NAME@1.i @PTEST_DIR@/@PTEST_NAME@2.i @PTEST_DIR@/@PTEST_NAME@3.i @PTEST_DIR@/@PTEST_NAME@4.i @PTEST_DIR@/@PTEST_NAME@5.i @PTEST_DIR@/@PTEST_NAME@6.i @PTEST_DIR@/@PTEST_NAME@7.i @PTEST_DIR@/@PTEST_NAME@8.i @PTEST_DIR@/@PTEST_NAME@9.c @PTEST_DIR@/@PTEST_NAME@1.h @PTEST_DIR@/@PTEST_NAME@2.h OPT: -metrics-used-files -main g @PTEST_DIR@/@PTEST_NAME@1.i @PTEST_DIR@/@PTEST_NAME@2.i @PTEST_DIR@/@PTEST_NAME@3.i @PTEST_DIR@/@PTEST_NAME@4.i @PTEST_DIR@/@PTEST_NAME@5.i @PTEST_DIR@/@PTEST_NAME@6.i @PTEST_DIR@/@PTEST_NAME@7.i @PTEST_DIR@/@PTEST_NAME@8.i @PTEST_DIR@/@PTEST_NAME@9.c @PTEST_DIR@/@PTEST_NAME@1.h @PTEST_DIR@/@PTEST_NAME@2.h */ int h(void); int glob; void indirect(void); void indirect_unused(void); int k(void); int main() { void (*fp)() = indirect; fp(); return h() + glob + k(); } frama-c-20.0-Calcium/tests/metrics/used-files1.h0000666000000000000000000000006713571573400016320 0ustar /*@ assigns \result \from \nothing; */ int leaf(void); frama-c-20.0-Calcium/tests/metrics/used-files1.i0000666000000000000000000000023513571573400016316 0ustar /* run.config DONTRUN: main test at used-files.i */ int g(void); int unused_g(void); int h() { return g(); } int unused_h() { return unused_g(); } frama-c-20.0-Calcium/tests/metrics/used-files10.c0000666000000000000000000000012013571573400016361 0ustar /* run.config DONTRUN: main test at used-files.i */ int k() { return 0; } frama-c-20.0-Calcium/tests/metrics/used-files2.h0000666000000000000000000000012113571573400016310 0ustar // this file is not used /*@ assigns \result \from \nothing; */ int unused_f(); frama-c-20.0-Calcium/tests/metrics/used-files2.i0000666000000000000000000000016013571573400016314 0ustar /* run.config DONTRUN: main test at used-files.i */ int leaf(void); int f(void); int g() { return f(); } frama-c-20.0-Calcium/tests/metrics/used-files3.i0000666000000000000000000000026513571573400016323 0ustar /* run.config DONTRUN: main test at used-files.i */ int leaf(void); void indirect_in_gvar_init(void); int f() { void (*ifp)(void) = indirect_in_gvar_init; return leaf(); } frama-c-20.0-Calcium/tests/metrics/used-files4.i0000666000000000000000000000014113571573400016315 0ustar /* run.config DONTRUN: main test at used-files.i */ // this file is not used int leaf(void); frama-c-20.0-Calcium/tests/metrics/used-files5.i0000666000000000000000000000021713571573400016322 0ustar /* run.config DONTRUN: main test at used-files.i */ // this file is not used int unused_f(void); int unused_g() { return unused_f(); } frama-c-20.0-Calcium/tests/metrics/used-files6.i0000666000000000000000000000014713571573400016325 0ustar /* run.config DONTRUN: main test at used-files.i */ int unused_f() { return 1; } int glob = 42; frama-c-20.0-Calcium/tests/metrics/used-files7.i0000666000000000000000000000011513571573400016321 0ustar /* run.config DONTRUN: main test at used-files.i */ void indirect() { } frama-c-20.0-Calcium/tests/metrics/used-files8.i0000666000000000000000000000013213571573400016321 0ustar /* run.config DONTRUN: main test at used-files.i */ void indirect_in_gvar_init() { } frama-c-20.0-Calcium/tests/metrics/used-files9.c0000666000000000000000000000012213571573400016313 0ustar /* run.config DONTRUN: main test at used-files.i */ #include "used-files10.c" frama-c-20.0-Calcium/tests/metrics/variadic-stdlib-generated.c0000666000000000000000000000055713571573400021173 0ustar /* run.config STDOPT: */ #include // contains this function, but we did not include it, so it should // not be reported as part of the stdlib. int rand(void); void my_printf(char const *s) {} void printf2(char *s); void main() { printf("this call is part of the stdlib"); my_printf("this call is not part of the stdlib"); rand(); } frama-c-20.0-Calcium/tests/misc/0000777000000000000000000000000013571573400013310 5ustar frama-c-20.0-Calcium/tests/misc/Debug_category.ml0000666000000000000000000000274313571573400016573 0ustar include Plugin.Register( struct let name = "test" let shortname = "test" let help = "test" end) let akey = register_category "a" let ckey = register_category "a:b:c" let bkey = register_category "a:b" let dkey = register_category "d" let wkey = register_warn_category "a" let wkey_vis_err = register_warn_category "test-vis-err" let wkey_inv_err = register_warn_category "test-inv-err" let wkey_failure = register_warn_category "test-failure" let () = set_warn_status wkey_vis_err Log.Winactive let () = set_warn_status wkey_inv_err Log.Winactive let () = set_warn_status wkey_failure Log.Winactive let wkey_active wkey = get_warn_status wkey <> Log.Winactive let run () = (* no backtraces in oracles. *) Printexc.record_backtrace false; warning "Uncategorized warning"; warning ~wkey "Warning A"; if wkey_active wkey_vis_err then error "Testing error function"; if wkey_active wkey_inv_err then error ""; if wkey_active wkey_failure then failure "Testing failure function"; debug ~dkey:akey "A is enabled"; debug ~dkey:bkey "B is enabled"; debug ~dkey:ckey "C is enabled"; debug ~dkey "D is enabled"; result ~dkey:akey "A is enabled"; result ~dkey:bkey "B is enabled"; result ~dkey:ckey "C is enabled"; result ~dkey "D is enabled"; feedback ~dkey:akey "A is enabled"; feedback ~dkey:bkey "B is enabled"; feedback ~dkey:ckey "C is enabled"; feedback ~dkey "D is enabled"; warning ~wkey "Another Warning A" let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/add_assigns.i0000666000000000000000000000036713571573400015747 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module report,@PTEST_DIR@/@PTEST_NAME@.cmxs -then -report -then -print */ /*@ assigns *x; */ int f(int* x, int* y) { *x++; *y++; return *x + *y; } frama-c-20.0-Calcium/tests/misc/add_assigns.ml0000666000000000000000000000170013571573400016117 0ustar open Cil_types let emitter = Emitter.( create "assigns" [ Property_status; Funspec ] ~correctness:[] ~tuning:[]) let computed = ref false let main () = if not !computed then begin computed := true; Ast.compute (); let kf = Globals.Functions.find_by_name "f" in let y = Globals.Vars.find_from_astinfo "y" (VFormal kf) in let mem = Logic_const.( new_identified_term (term (TLval (TMem (tvar (Cil.cvar_to_lvar y)), TNoOffset)) (Ctype Cil.intType))) in let assigns = Writes [mem, FromAny] in let bhv = Cil.mk_behavior ~assigns () in Annotations.add_behaviors emitter kf [bhv]; let bhv = List.find (fun b -> b.b_name = Cil.default_behavior_name) (Annotations.behaviors kf) in let ip = Extlib.the (Property.ip_assigns_of_behavior kf Kglobal [] bhv) in Property_status.(emit emitter ~hyps:[] ip True) end let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/behavior_names.i0000666000000000000000000000037213571573400016446 0ustar /* run.config MODULE: @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins */ /*@ behavior foo: ensures \true; */ void f () { int x = 0; /*@ behavior bar: ensures \true; */ x++; if (x) { /*@ behavior bli: ensures \true; */ x++; } } frama-c-20.0-Calcium/tests/misc/behavior_names.ml0000666000000000000000000000065113571573400016626 0ustar let run () = let _ = Ast.get () in let kf = Globals.Functions.find_by_name "f" in let pretty_list fmt l = Pretty_utils.pp_list ~sep:"@ " Format.pp_print_string fmt l in Format.printf "@[stmt: %a@\nnew1: %s@\nnew2: %s@]@." pretty_list (Annotations.behavior_names_of_stmt_in_kf kf) (Annotations.fresh_behavior_name kf "foo") (Annotations.fresh_behavior_name kf "bla") let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/booleans.i0000666000000000000000000000022013571573400015256 0ustar /*run.config OPT: -eva -print */ int main (void) { int x = 42; /*@ check (boolean)x == 17; */ /*@ check (integer)(boolean)x == 17; */ } frama-c-20.0-Calcium/tests/misc/bts0451.i0000666000000000000000000000070713571573400014570 0ustar /* run.config COMMENT: running this test fails on purpose OPT: -simplify-cfg -typecheck */ /* small test cases to verify that break is accepted in while and switch */ int f () { while (1) { if (0) { while (1) break; } switch (3) { case 0: return 5; default: if (1) break; else break; } break; } return 0; } /* should abort with an error at type-checking */ int main (void) { break; return 0; } frama-c-20.0-Calcium/tests/misc/bts0452.i0000666000000000000000000000252113571573400014565 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -typecheck -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ /* must emit falls-through warning. */ int f (int foo, char** args) { switch(foo) { case 1: return 0; break; default: if (foo) return 1; } } /* must emit falls-through warning. */ int h (int foo, char** args) { switch(foo) { case 1: return 0; break; default: { if (foo) goto L ; return 1; L: break; } } } /* must NOT emit falls-through warning. */ int g (int foo, char** args) { switch(foo) { case 1: return 0; break; default: if (foo) return 1; else return 2; } } /* must NOT emit falls-through warning. */ int k (int foo, char** args) { switch(foo) { case 1: return 0; break; default: { goto L ; break; L: return 0; } } } /* must NOT emit falls-through warning. */ int l (int foo, char** args) { switch(foo) { case 1: return 0; break; default: { L: goto L ; break; } } } /* must NOT emit falls-through warning */ int main (int foo, char** args) { switch(foo) { case 1: return 0; break; default: return 1; } } /* must NOT emit falls-through warning */ int m (int foo, char** args) { if (foo >= 0 && foo <=10) { return 0; } else { return 1; } } frama-c-20.0-Calcium/tests/misc/bts0452.ml0000666000000000000000000000020413571573400014741 0ustar (* Checks that even Jessie-specific normalization does not create spurious warnings. *) Cabs2cil.setDoAlternateConditional ();; frama-c-20.0-Calcium/tests/misc/bts0489.i0000666000000000000000000000741313571573400014604 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ typedef unsigned char uint8_t; typedef char int8_t; typedef unsigned short uint16_t; typedef short int16_t; typedef int int32_t; typedef unsigned int uint32_t; void foo1(uint8_t x) {}; int16_t t1(void) { uint8_t u8a, u8b, u8c; int8_t s8a, s8b; uint16_t u16a; int16_t s16a; int32_t s32a; float f32a; double f64a; foo1(u8a); /* compliant */ foo1(u8a + u8b); /* compliant */ foo1(s8a); /* not compliant */ foo1(u16a); /* not compliant */ foo1(2); /* not compliant */ foo1(2U); /* compliant */ foo1((uint8_t)2); /* compliant */ /*... s8a + u8a /* not compliant */ /*... s8a + (int8_t)u8a /* compliant */ s8b = u8a; /* not compliant */ /*... u8a + 5 /* not compliant */ /*... u8a + 5U /* compliant */ /*... u8a + (uint8_t)5 /* compliant */ u8a = u16a; /* not compliant */ u8a = (uint8_t)u16a; /* compliant */ u8a = 5UL; /* not compliant */ /*... u8a + 10UL /* compliant */ u8a = 5U; /* compliant */ /*... u8a + 3 /* not compliant */ /*... u8a >> 3 /* compliant */ /*... u8a >> 3U /* compliant */ /*... s32a + 80000 /* compliant */ /*... s32a + 80000L /* compliant */ f32a = f64a; /* not compliant */ f32a = 2.5; /* not compliant - unsuffixed floating constants are of type double */ u8a = u8b + u8c; /* compliant */ s16a = u8b + u8b; /* not compliant */ s32a = u8b + u8c; /* not compliant */ f32a = 2.5F; /* compliant */ u8a = f32a; /* not compliant */ s32a = 1.0; /* not compliant */ s32a = u8b + u8c; /* not compliant */ f32a = 2.5F; /* compliant */ u8a = f32a; /* not compliant */ s32a = 1.0; /* not compliant */ f32a = 1; /* not compliant */ f32a = s16a; /* not compliant */ /*... f32a + 1 /* not compliant */ /*... f64a * s32a /* not compliant */ /*...*/ return (s32a); /* not compliant */ /*...*/ return (s16a); /* compliant */ /*...*/ return (20000); /* compliant */ /*...*/ return (20000L); /* not compliant */ /*...*/ return (s8a); /* not compliant */ /*...*/ return (u16a); /* not compliant */ }; int16_t foo2(void) { uint8_t u8a, u8b; int8_t s8a; uint16_t u16a,u16b; int16_t s16a,s16b; int32_t s32a,s32b; uint32_t u32a; float f32a,f32b; double f64a,f64b ; /*... (u16a + u16b) + u32a /* not compliant */ /*... s32a + s8a + s8b /* compliant */ /*... s8a + s8b + s32a /* not compliant */ f64a = f32a + f32b; /* not compliant */ f64a = f64b + f32a; /* compliant */ f64a = s32a / s32b; /* not compliant */ u32a = u16a + u16a; /* not compliant */ s16a = s8a; /* compliant */ s16a = s16b + 20000; /* compliant */ s32a = s16a + 20000; /* not compliant */ s32a = s16a + (int32_t)20000; /* compliant */ u16a = u16b + u8a; /* compliant */ foo1(u16a); /* not compliant */ foo1(u8a + u8b); /* compliant */ /*...*/ return s16a; /* compliant */ /*...*/ return s8a; /* not compliant */ } frama-c-20.0-Calcium/tests/misc/bts0489.ml0000666000000000000000000000077713571573400014772 0ustar open Cil_types class visitor = object inherit Visitor.frama_c_inplace method! vexpr e = match e.enode with | Const(CInt64 (_,_,Some s)) -> Format.printf "Found representation %s@." s; Cil.SkipChildren | Const(CInt64(n,_,None)) -> Format.printf "No representation for %s@." (Integer.to_string n); Cil.SkipChildren | _ -> Cil.DoChildren end let run () = let file = Ast.get () in Visitor.visitFramacFile (new visitor) file let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/bts0525-2.i0000666000000000000000000000017413571573400014727 0ustar /* run.config OPT: -typecheck tests/misc/bts0525.i */ typedef enum {E1=2, E2} T_EN1 ; int f2(T_EN1 p2) { return 0; } frama-c-20.0-Calcium/tests/misc/bts0525.i0000666000000000000000000000025313571573400014566 0ustar /* run.config OPT: tests/misc/bts0525-2.i */ typedef enum {E3=2, E4} T_EN2 ; typedef enum {E1=2, E2} T_EN1 ; int f1(T_EN1 p1) { if (p1==E1) return 1; return 0; } frama-c-20.0-Calcium/tests/misc/bts0541.c0000666000000000000000000000040713571573400014557 0ustar /* run.config OPT: -pp-annot -cpp-extra-args="-I./share/libc" -pp-annot -eva @EVA_CONFIG@ */ #include #include #include #include int main() { _Bool x = true; /*@ assert x==false ==> \false; */ return 0; } frama-c-20.0-Calcium/tests/misc/bts0990_link.i0000666000000000000000000000034713571573400015615 0ustar /* run.config OPT: tests/misc/bts0990_link_1.i */ // NB: This test is meant to return an error, as s is declared as an array in // tests/misc/bts0990_link_1.i char *s; void perror(const char *); void f(void){ perror(s); } frama-c-20.0-Calcium/tests/misc/bts0990_link_1.i0000666000000000000000000000020513571573400016026 0ustar /* run.config DONTRUN: main test is at bts_0990_link.i */ char s[100]; void perror(const char *); void g(void){ perror(s); } frama-c-20.0-Calcium/tests/misc/bts1135_ulevel.i0000666000000000000000000000051013571573400016134 0ustar /* run.config OPT: -ulevel 2 -typecheck -print */ /* small test cases to verify C labels are correclty managed into annotations */ int X ; void main (int c) { for (int i = 0 ; i < 10 ;) { if (c) //@ ensures \false ; goto there ; X++; there: i++; //@ assert c==0 ==> \at(X,there)==i+1; } } frama-c-20.0-Calcium/tests/misc/bts1201.i0000666000000000000000000000030013571573400014547 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -eva-verbose 2 -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print */ void main() { //@ assert \true; } void main2() { } frama-c-20.0-Calcium/tests/misc/bts1201.ml0000666000000000000000000000021013571573400014727 0ustar let main () = !Db.Value.compute (); Globals.set_entry_point "main2" false; !Db.Value.compute (); ;; let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/bts1347.i0000666000000000000000000000032113571573400014565 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -then -report */ int f(int *x) { return *x; } int g(int *x) { return *(x++); } frama-c-20.0-Calcium/tests/misc/bts1347.ml0000666000000000000000000000147713571573400014762 0ustar let emitter = Emitter.create "emitter" ~correctness:[] ~tuning:[] [ Emitter.Code_annot; Emitter.Property_status ] let run () = Globals.Functions.iter (fun kf -> if not (Cil.is_builtin (Kernel_function.get_vi kf)) then begin Globals.set_entry_point (Kernel_function.get_name kf) true; !Db.Value.compute(); let hyps = Alarms.fold (fun _ kf' s ~rank:_ _ a l -> if Kernel_function.equal kf kf' then Property.ip_of_code_annot_single kf s a :: l else l) [] in let s = Kernel_function.find_return kf in let ca = !Db.Properties.Interp.code_annot kf s "assert 32.5>=10.;" in Annotations.add_code_annot emitter ~kf s ca; let ip = Property.ip_of_code_annot_single kf s ca in Property_status.emit emitter ~hyps ip Property_status.True end) let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/bug0277.i0000666000000000000000000000024713571573400014562 0ustar /* run.config OPT: -typecheck */ typedef enum { DGI_ID_NB = 56 } T_DGI_ID; const int T[DGI_ID_NB] = { 3 } ; /*@ requires P : T[0]==3 ; */ void main() ; frama-c-20.0-Calcium/tests/misc/bug_0209.c0000666000000000000000000000025613571573400014706 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ // Everything is done by the script frama-c-20.0-Calcium/tests/misc/bug_0209.ml0000666000000000000000000000124713571573400015075 0ustar let main () = (* File.create_project_from_visitor calls File.cil_init but never calls Logic_env.Builtins.apply *) ignore (File.create_project_from_visitor "foo" (fun p -> new Visitor.generic_frama_c_visitor (Visitor_behavior.copy p))); let p = Project.create "bar" in (* Computing the AST first calls File.cil_init, than calls Logic_env.Builtins.apply. This second call raises an exception because logic builtins were registered twice by File.cil_init (even if File.cil_init was called on two different projects: the hook Logic_env.Builtins is not projectified) *) Project.on p Ast.compute () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/callsite.i0000666000000000000000000000101613571573400015260 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ // Don't use -debug 1 option in the test command. void f(void); void g(void); void h(void); void k(void); void f(void) { g(); h(); g(); } void g(void) { h(); k(); h(); } void h(void) { k(); k(); } // Should have 8 call sites: // CallSites of f : - // CallSites of g : From f(2) // CallSites of h : From f(1) + From g (2) // CallSites of k : From g(1) + From h (2) frama-c-20.0-Calcium/tests/misc/callsite.ml0000666000000000000000000000073413571573400015446 0ustar open Cil_types let dump f = let kf = Globals.Functions.find_by_name f in let csites = Kernel_function.find_syntactic_callsites kf in Log.print_on_output (fun fmt -> Format.fprintf fmt "Call Sites for %s:@\n" f ; List.iter (fun (ckf,stmt) -> Format.fprintf fmt " - From %s at #%03d@\n" (Kernel_function.get_name ckf) stmt.sid) csites) let main () = Ast.compute () ; List.iter dump ["f";"g";"h";"k"] let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/change_main.i0000666000000000000000000000027413571573400015716 0ustar /* run.config* EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -eva -main f -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -then-on change_main -main g -eva */ int f(int x) { return x; } frama-c-20.0-Calcium/tests/misc/change_main.ml0000666000000000000000000000044213571573400016073 0ustar open Cil_types class visitor prj = object inherit Visitor.frama_c_copy prj method! vfunc f = f.svar.vname <- "g"; Cil.SkipChildren end let run () = ignore (File.create_project_from_visitor "change_main" (fun prj -> new visitor prj)) let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/char_ampamp.c0000666000000000000000000000020113571573400015715 0ustar char c=1; int y; void g(int y, int x) { Frama_C_show_each_x(x); } int main() { y = 42 && c; g(c, 42 && c); return 0; } frama-c-20.0-Calcium/tests/misc/cli_string_multiple_map.i0000666000000000000000000000024513571573400020370 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -multiple-map a:1,b:2,a:3 */ frama-c-20.0-Calcium/tests/misc/cli_string_multiple_map.ml0000666000000000000000000000145313571573400020552 0ustar include Plugin.Register (struct let name = "a" let shortname = "a" let help = "" end) module M = String_multiple_map (struct include Datatype.Integer type key = string let of_string ~key:_ ~prev:_ arg = try Extlib.opt_map Integer.of_string arg with Failure _ -> raise (Cannot_build "expecting an integer") let to_string ~key:_ = Extlib.opt_map Integer.to_string end) (struct let option_name = "-multiple-map" let help = "" let default = Datatype.String.Map.empty let arg_name = "s:i" end) let main () = let print k v = feedback "%s => %a" k (Pretty_utils.pp_list ~sep:";@," Integer.pretty) v in Datatype.String.Map.iter print (M.get ()) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/copy_kf.i0000666000000000000000000000050113571573400015110 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ /*@ requires \valid(p); assigns *p; ensures *p == x; */ void g(int* p, int x); /*@ requires 0 <= x <= 10; ensures \result == 2 * x; */ int f(int x) { int y; g(&y,x); return x + y; } frama-c-20.0-Calcium/tests/misc/copy_kf.ml0000666000000000000000000000330513571573400015275 0ustar open Cil open Cil_types let clone name = let kf = Globals.Functions.find_by_name name in let vi = Globals.Functions.get_vi kf in let kf' = Visitor.visitFramacKf (new Visitor.frama_c_refresh (Project.current())) kf in let vi' = Kernel_function.get_vi kf' in vi'.vname <- "new_" ^ name; let ast = Ast.get () in let loc = Kernel_function.get_location kf' in let new_glob = List.fold_right (fun g acc -> match g with | GFun(f,_) when f.svar == vi -> g :: GFun(Kernel_function.get_definition kf', loc) :: acc | GFunDecl(_,vi'',_) when vi'' == vi && Ast.is_def_or_last_decl g -> g :: GFunDecl(Cil.empty_funspec(), vi', loc) :: acc | _ -> g::acc) ast.globals [] in ast.globals <- new_glob; Ast.mark_as_grown (); kf' let replace_call def proto = let vi = Kernel_function.get_vi proto in let vis = object inherit Visitor.frama_c_inplace method! vinst = function | Call(rcv,{enode=Lval(Var _,NoOffset); eloc=loc}, args, l) -> ChangeTo [Call(rcv, Cil.new_exp ~loc (Lval (Var vi,NoOffset)), args, l)] | _ -> SkipChildren end in let body = Kernel_function.get_definition def in ignore (Visitor.visitFramacFunction vis body) let main () = let kff = clone "f" in Filecheck.check_ast "clone-f"; Kernel.feedback "After cloning f:@\n%t" (fun fmt -> File.pretty_ast ~fmt ()); let kfg = clone "g" in Filecheck.check_ast "clone-g"; Kernel.feedback "After cloning g:@\n%t" (fun fmt -> File.pretty_ast ~fmt ()); replace_call kff kfg; Filecheck.check_ast "stmt-replace"; Kernel.feedback "After replacement:@\n%t" (fun fmt -> File.pretty_ast ~fmt ()) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/copy_machdep.i0000666000000000000000000000030713571573400016115 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -machdep x86_64 -enums int -no-unicode */ int main () { return 0; } frama-c-20.0-Calcium/tests/misc/copy_machdep.ml0000666000000000000000000000110213571573400016267 0ustar let run () = let proj = File.create_project_from_visitor "machdep" (fun prj -> new Visitor.frama_c_copy prj) in Kernel.feedback "Machdep is %spreserved" (if Kernel.Machdep.get () = Project.on proj Kernel.Machdep.get () then "" else "not "); Kernel.feedback "Enums is %spreserved" (if Kernel.Enums.get () = Project.on proj Kernel.Enums.get () then "" else "not "); Kernel.feedback "Unicode is %spreserved" (if Kernel.Unicode.get () = Project.on proj Kernel.Unicode.get () then "" else "not ") let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/custom_machdep/0000777000000000000000000000000013571573400016303 5ustar frama-c-20.0-Calcium/tests/misc/custom_machdep/__fc_machdep_custom.h0000666000000000000000000001420013571573400022412 0ustar /* skeleton of a real custom machdep header. Note: the values provided here are merely for illustrative purposes and are not necessarily consistent between them. */ #ifndef __FC_MACHDEP #define __FC_MACHDEP #ifdef __FC_MACHDEP_CUSTOM /* Constants required by the C standard */ #undef __CHAR_UNSIGNED__ #define __WORDSIZE 32 #define __SIZEOF_SHORT 2 #define __SIZEOF_INT 3 #define __SIZEOF_LONG 4 #define __SIZEOF_LONGLONG 8 #define __CHAR_BIT 8 #define __PTRDIFF_T int #define __SIZE_T unsigned int #define __FC_SCHAR_MIN (-128) #define __FC_SCHAR_MAX 127 #define __FC_UCHAR_MAX 255 #define __FC_SHRT_MIN (-32768) #define __FC_SHRT_MAX 32767 #define __FC_USHRT_MAX 65535 #define __FC_INT_MIN (-2147483647 - 1) #define __FC_INT_MAX 2147483647 #define __FC_UINT_MAX 4294967295U #define __FC_LONG_MIN (-2147483647L -1L) #define __FC_LONG_MAX 2147483647L #define __FC_ULONG_MAX 4294967295UL #define __FC_LLONG_MIN (-9223372036854775807LL -1LL) #define __FC_LLONG_MAX 9223372036854775807LL #define __FC_ULLONG_MAX 18446744073709551615ULL #define __INT_MAX_T signed long long #define __UINT_MAX_T unsigned long long #define __FC_PATH_MAX 256 #define __FC_SIZE_MAX __FC_ULLONG_MAX /* Optional constants */ #define __INT8_T signed char #define __UINT8_T unsigned char #define __INT16_T signed short #define __UINT16_T unsigned short #define __INTPTR_T signed long #define __UINTPTR_T unsigned long #define __INT32_T signed long #define __UINT32_T unsigned long #define __INT64_T signed long long #define __UINT64_T unsigned long long /* Required constants */ #define __INT_LEAST8_T signed char #define __UINT_LEAST8_T unsigned char #define __INT_LEAST16_T signed short #define __UINT_LEAST16_T unsigned short #define __INT_LEAST32_T signed long #define __UINT_LEAST32_T unsigned long #define __INT_LEAST64_T signed long long #define __UINT_LEAST64_T unsigned long long #define __INT_FAST8_T signed char #define __UINT_FAST8_T unsigned char #define __INT_FAST16_T signed int #define __UINT_FAST16_T unsigned int #define __INT_FAST32_T signed long #define __UINT_FAST32_T unsigned long #define __INT_FAST64_T signed long long #define __UINT_FAST64_T unsigned long long /* POSIX */ #define __SSIZE_T int /* stdio.h */ #define __FC_L_tmpnam 1024 /* stdint.h */ #define __FC_PTRDIFF_MIN __FC_INT_MIN #define __FC_PTRDIFF_MAX __FC_INT_MAX #define __FC_INTMAX_MIN (-9223372036854775807LL -1LL) #define __FC_INTMAX_MAX 9223372036854775807LL #define __FC_UINTMAX_MAX 18446744073709551615ULL #define __FC_EOF (-1) #define __FC_FOPEN_MAX 20 #define __FC_RAND_MAX 32767 #define __WCHAR_T unsigned short /* for stdarg.h */ #define __FC_VA_LIST_T char* /* for time.h */ #define __FC_TIME_T long /* for wchar.h */ #define __WINT_T unsigned int #define __FC_WEOF (0xFFFFFFFFU) #define __FC_WINT_MIN 0 #define __FC_WINT_MAX __FC_UINT_MAX /* for errno.h */ #define __FC_EPERM 1 #define __FC_ENOENT 2 #define __FC_ESRCH 3 #define __FC_EINTR 4 #define __FC_EIO 5 #define __FC_ENXIO 6 #define __FC_E2BIG 7 #define __FC_ENOEXEC 8 #define __FC_EBADF 9 #define __FC_ECHILD 10 #define __FC_EAGAIN 11 #define __FC_ENOMEM 12 #define __FC_EACCES 13 #define __FC_EFAULT 14 #define __FC_ENOTBLK 15 #define __FC_EBUSY 16 #define __FC_EEXIST 17 #define __FC_EXDEV 18 #define __FC_ENODEV 19 #define __FC_ENOTDIR 20 #define __FC_EISDIR 21 #define __FC_EINVAL 22 #define __FC_ENFILE 23 #define __FC_EMFILE 24 #define __FC_ENOTTY 25 #define __FC_ETXTBSY 26 #define __FC_EFBIG 27 #define __FC_ENOSPC 28 #define __FC_ESPIPE 29 #define __FC_EROFS 30 #define __FC_EMLINK 31 #define __FC_EPIPE 32 #define __FC_EDOM 33 #define __FC_ERANGE 34 #define __FC_EDEADLK 35 #define __FC_ENAMETOOLONG 36 #define __FC_ENOLCK 37 #define __FC_ENOSYS 38 #define __FC_ENOTEMPTY 39 #define __FC_ELOOP 40 #define __FC_EWOULDBLOCK EAGAIN #define __FC_ENOMSG 42 #define __FC_EIDRM 43 #define __FC_ECHRNG 44 #define __FC_EL2NSYNC 45 #define __FC_EL3HLT 46 #define __FC_EL3RST 47 #define __FC_ELNRNG 48 #define __FC_EUNATCH 49 #define __FC_ENOCSI 50 #define __FC_EL2HLT 51 #define __FC_EBADE 52 #define __FC_EBADR 53 #define __FC_EXFULL 54 #define __FC_ENOANO 55 #define __FC_EBADRQC 56 #define __FC_EBADSLT 57 #define __FC_EDEADLOCK EDEADLK #define __FC_EBFONT 59 #define __FC_ENOSTR 60 #define __FC_ENODATA 61 #define __FC_ETIME 62 #define __FC_ENOSR 63 #define __FC_ENONET 64 #define __FC_ENOPKG 65 #define __FC_EREMOTE 66 #define __FC_ENOLINK 67 #define __FC_EADV 68 #define __FC_ESRMNT 69 #define __FC_ECOMM 70 #define __FC_EPROTO 71 #define __FC_EMULTIHOP 72 #define __FC_EDOTDOT 73 #define __FC_EBADMSG 74 #define __FC_EOVERFLOW 75 #define __FC_ENOTUNIQ 76 #define __FC_EBADFD 77 #define __FC_EREMCHG 78 #define __FC_ELIBACC 79 #define __FC_ELIBBAD 80 #define __FC_ELIBSCN 81 #define __FC_ELIBMAX 82 #define __FC_ELIBEXEC 83 #define __FC_EILSEQ 84 #define __FC_ERESTART 85 #define __FC_ESTRPIPE 86 #define __FC_EUSERS 87 #define __FC_ENOTSOCK 88 #define __FC_EDESTADDRREQ 89 #define __FC_EMSGSIZE 90 #define __FC_EPROTOTYPE 91 #define __FC_ENOPROTOOPT 92 #define __FC_EPROTONOSUPPORT 93 #define __FC_ESOCKTNOSUPPORT 94 #define __FC_ENOTSUP 95 #define __FC_EOPNOTSUPP 95 #define __FC_EPFNOSUPPORT 96 #define __FC_EAFNOSUPPORT 97 #define __FC_EADDRINUSE 98 #define __FC_EADDRNOTAVAIL 99 #define __FC_ENETDOWN 100 #define __FC_ENETUNREACH 101 #define __FC_ENETRESET 102 #define __FC_ECONNABORTED 103 #define __FC_ECONNRESET 104 #define __FC_ENOBUFS 105 #define __FC_EISCONN 106 #define __FC_ENOTCONN 107 #define __FC_ESHUTDOWN 108 #define __FC_ETOOMANYREFS 109 #define __FC_ETIMEDOUT 110 #define __FC_ECONNREFUSED 111 #define __FC_EHOSTDOWN 112 #define __FC_EHOSTUNREACH 113 #define __FC_EALREADY 114 #define __FC_EINPROGRESS 115 #define __FC_ESTALE 116 #define __FC_EUCLEAN 117 #define __FC_ENOTNAM 118 #define __FC_ENAVAIL 119 #define __FC_EISNAM 120 #define __FC_EREMOTEIO 121 #define __FC_EDQUOT 122 #define __FC_ENOMEDIUM 123 #define __FC_EMEDIUMTYPE 124 #define __FC_ECANCELED 125 #define __FC_ENOKEY 126 #define __FC_EKEYEXPIRED 127 #define __FC_EKEYREVOKED 128 #define __FC_EKEYREJECTED 129 #define __FC_EOWNERDEAD 130 #define __FC_ENOTRECOVERABLE 131 #define __FC_ERFKILL 132 #define __FC_EHWPOISON 133 #else error "I'm supposed to be called with __FC_MACHDEP_CUSTOM macro defined" #endif #endif frama-c-20.0-Calcium/tests/misc/custom_machdep/custom_machdep.ml0000666000000000000000000000265713571573400021642 0ustar open Cil_types let mach = { version = "foo"; compiler = "bar"; cpp_arch_flags = []; sizeof_short = 2; sizeof_int = 3; sizeof_long = 4; sizeof_longlong = 8; sizeof_ptr = 4; sizeof_float = 4; sizeof_double = 8; sizeof_longdouble = 12; sizeof_void = 1; sizeof_fun = 1; size_t = "unsigned long"; wchar_t = "int"; ptrdiff_t = "int"; alignof_short = 2; alignof_int = 3; alignof_long = 4; alignof_longlong = 4; alignof_ptr = 4; alignof_float = 4; alignof_double = 4; alignof_longdouble = 4; alignof_str = 1; alignof_fun = 1; alignof_aligned= 16; char_is_unsigned = false; const_string_literals = true; little_endian = true; underscore_name = false ; has__builtin_va_list = true; __thread_is_keyword = true; } let mach2 = { mach with compiler = "baz" } (* First run : register [mach] under name [custom]. Second run : - register [mach] under name [custom] again. This must work. - then register [mach2] under name [custom]. This must result in an error. *) let () = let ran = ref false in Cmdline.run_after_loading_stage (fun () -> Kernel.result "Registering machdep 'mach' as 'custom'"; File.new_machdep "custom" mach; if !ran then begin Kernel.result "Trying to register machdep 'mach2' as 'custom'"; File.new_machdep "custom" mach2 end else ran := true ) frama-c-20.0-Calcium/tests/misc/custom_machdep.c0000666000000000000000000000136313571573400016452 0ustar /* run.config* EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@/@PTEST_NAME@.cmxs OPT: -cpp-extra-args="-I@PTEST_DIR@/@PTEST_NAME@ -D__FC_MACHDEP_CUSTOM" -load-module @PTEST_DIR@/@PTEST_NAME@/@PTEST_NAME@ -machdep custom -print -then -print COMMENT: we need a -then to test double registering of a machdep */ #include "__fc_machdep_custom.h" // most of the following includes are not directly used, but they test if // the custom machdep has defined the necessary constants #include #include #include #include #include #include #include #include #include #include #include #include #include int main() { return INT_MAX; } frama-c-20.0-Calcium/tests/misc/debug_category.i0000666000000000000000000000145713571573400016454 0ustar /* run.config MODULE: tests/misc/Debug_category.cmxs OPT: -test-msg-key help -test-warn-key="a=inactive" OPT: -test-msg-key a -test-warn-key="a=inactive" OPT: -test-msg-key a -test-msg-key="-a:b" -test-warn-key="a=inactive" OPT: -test-msg-key a -test-msg-key="-a:b" -test-msg-key a:b:c -test-warn-key="a=inactive" OPT: -test-msg-key "a:b:c,d" -test-warn-key="a=inactive" OPT: -test-msg-key "*" -test-warn-key="a=inactive" OPT: OPT: -test-warn-key a=error OPT: -test-warn-key a=abort OPT: -test-warn-key a=feedback OPT: -test-warn-key="*=abort" OPT: -test-warn-key=a=once OPT: -test-warn-key a=feedback-once OPT: -test-warn-key a=err-once OPT: -test-warn-key test-vis-err OPT: -test-warn-key test-inv-err OPT: -test-warn-key test-failure FILTER: sed 's|Your Frama-C version is.*|Your Frama-C version is VERSION|' */ frama-c-20.0-Calcium/tests/misc/ensures.i0000666000000000000000000000024713571573400015151 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ //@ ensures *p==1; void main(int * p){ *p = 0; } frama-c-20.0-Calcium/tests/misc/ensures.ml0000666000000000000000000000135713571573400015334 0ustar open Cil_types let run () = Dynamic.Parameter.Bool.set "-eva-context-valid-pointers" true; !Db.Value.compute (); Globals.Functions.iter (fun kf -> let kf_name = Kernel_function.get_name kf in let spec = Annotations.funspec kf in let ip = Property.ip_of_spec kf Kglobal ~active:[] spec in List.iter (fun ip -> let bname = match Property.get_behavior ip with | None -> "?" | Some b -> b.b_name in let function_name = kf_name ^ ": behavior " ^ bname in let status = Property_status.get ip in Kernel.result "@[%s@ @[%a@]@]" function_name Property_status.pretty status) ip) let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/exception.i0000666000000000000000000000142213571573400015457 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -remove-exn -print */ struct my_exn { int e; }; struct my_exn2 { char c; }; struct my_exn foo; struct my_exn2 bar; int x = 42; int f (int c) { return c; } int g(int c) { return f(c); } int f1 (int c) { return c; } /*@ ensures \result == c+1; */ int f2 (int c) { return c+1; } int f3 (int c) { return c+2; } int f4 (int c) { return c+3; } /*@ ensures \result != 42; */ int h(int c) { if (c-1<=0) return f1(c); else if (c-100<=0) /*@ returns \result == c+1; */ return f2(c); else if (c>360) { int x = f3(c); return x; } else return f4(c); } frama-c-20.0-Calcium/tests/misc/exception.ml0000666000000000000000000001344713571573400015651 0ustar open Cabs open Cil_types let rec init_exn exn init acc = match init with | SingleInit init -> Cil.mkStmtOneInstr (Set(exn,init,Cil_datatype.Location.unknown)) :: acc | CompoundInit (ct,initl) -> Cil.foldLeftCompound ~implicit:false ~doinit:(fun off' i' _ acc -> init_exn (Cil.addOffsetLval off' exn) i' acc) ~ct ~initl ~acc let add_throw_test f exn_type test init = let throw_block = Cil.mkBlock [] in let exn = Cil.makeLocalVar f ~scope:throw_block "exn" exn_type in let valid_sid = true in let set_exn_stmts = init_exn (Var exn, NoOffset) init [] in let loc = Cil_datatype.Location.unknown in let throw_stmt = Cil.mkStmt ~valid_sid (Throw (Some (Cil.evar ~loc exn, exn_type), loc)) in throw_block.bstmts <- List.rev (throw_stmt :: set_exn_stmts); let new_body = Cil.mkStmt ~valid_sid (If(test, throw_block, f.sbody,loc)) in f.sbody <- Cil.mkBlock [ new_body ] let add_my_exn my_exn f = let c = Cil.evar (List.hd f.sformals) in let exn_type = TComp(my_exn,{ scache = Not_Computed},[]) in let loc = Cil_datatype.Location.unknown in let init = CompoundInit( exn_type, [Field(List.hd my_exn.cfields, NoOffset), SingleInit (Cil.zero ~loc)]) in add_throw_test f exn_type c init let add_int_exn f = let c = Cil.evar (List.hd f.sformals) in let loc = Cil_datatype.Location.unknown in let test = Cil.new_exp ~loc (BinOp (Lt,c,Cil.kinteger ~loc IInt 50,Cil.intType)) in add_throw_test f Cil.intType test (SingleInit (Cil.zero ~loc)) let add_int_ptr_exn glob f = let c = Cil.evar (List.hd f.sformals) in let loc = Cil_datatype.Location.unknown in let test = Cil.new_exp ~loc (BinOp (Gt,c,Cil.kinteger ~loc IInt 150, Cil.intType)) in let init = SingleInit (Cil.new_exp ~loc (AddrOf(Var glob,NoOffset))) in add_throw_test f Cil.intPtrType test init let add_catch my_exn my_exn2 f = let exn_type = TComp(my_exn, { scache = Not_Computed }, []) in let exn_type2 = TComp(my_exn2, {scache = Not_Computed }, []) in let exn_field = Field (List.hd my_exn.cfields, NoOffset) in let exn2_field = Field (List.hd my_exn2.cfields, NoOffset) in let loc = Cil_datatype.Location.unknown in let real_locals = f.sbody.blocals in let v1 = Cil.makeLocalVar f "exn" exn_type in let v2 = Cil.makeLocalVar f "y" Cil.intType in let v3 = Cil.makeLocalVar f "exn_aux" exn_type in let v4 = Cil.makeLocalVar f "exn2" exn_type2 in let v5 = Cil.makeLocalVar f "not_thrown" Cil.doubleType in f.sbody.blocals <- real_locals; let id_block = Cil.mkBlock [Cil.mkStmtOneInstr (Set (Cil.var v1, Cil.evar ~loc v3, loc))] in let convert_exn_block = Cil.mkBlock [ Cil.mkStmtOneInstr (Set ((Var v1, exn_field), Cil.new_exp ~loc (Lval (Var v4, exn2_field)), loc))] in let catch_stmt = Cil.mkStmt (TryCatch( f.sbody, [ Catch_exn (v1,[(v3,id_block); (v4, convert_exn_block)]), Cil.mkBlock [ Cil.mkStmt (Return (Some (Cil.new_exp ~loc (Lval (Var v1, exn_field))), loc))]; Catch_exn (v2,[]), Cil.mkBlock [ Cil.mkStmt (Return (Some (Cil.evar ~loc v2),loc))]; Catch_exn (v5,[]), Cil.mkBlock [ Cil.mkStmt (Return (Some (Cil.mone ~loc), loc))]; Catch_all, Cil.mkBlock [ Cil.mkStmt (Throw (None, loc)) ] ], loc)) in f.sbody <- Cil.mkBlock [ catch_stmt ] let change_body my_exn my_exn2 glob f = match f.svar.vname with | "f1" -> add_my_exn my_exn f; File.must_recompute_cfg f | "f2" -> add_int_exn f; File.must_recompute_cfg f | "f3" -> add_int_ptr_exn glob f; File.must_recompute_cfg f | "f4" -> add_my_exn my_exn2 f; File.must_recompute_cfg f | "h" -> add_catch my_exn my_exn2 f; File.must_recompute_cfg f | _ -> () let add_exn ast = let my_exn = ref None in let my_exn2 = ref None in let glob = ref None in let treat_glob = function | GCompTag(ci,_) -> (match !my_exn with | None -> my_exn := Some ci | Some _ -> my_exn2 := Some ci) | GVar(v,_,_) when v.vname = "x" -> glob := Some v | GFun(f,_) -> change_body (Extlib.the !my_exn) (Extlib.the !my_exn2) (Extlib.the !glob) f | _ -> () in List.iter treat_glob ast.globals let loc = Cil_datatype.Location.unknown let stmt stmt_node = { stmt_ghost = false; stmt_node } let var v = { expr_loc = loc; expr_node = VARIABLE v } let mk_exn_cabs b = { blabels = []; Cabs.battrs = []; Cabs.bstmts = [ stmt (IF (var "c", stmt (THROW (Some (var "x"),loc)), stmt (BLOCK (b,loc,loc)),loc))] } let mk_catch_cabs b = { blabels = []; Cabs.battrs = []; Cabs.bstmts = [ stmt (TRY_CATCH (stmt (BLOCK (b,loc,loc)), [Some ([SpecType Tint],("x",JUSTBASE,[],loc)), stmt ( RETURN ( { expr_loc = loc; expr_node = CONSTANT (CONST_INT "3")}, loc)); None, stmt ( RETURN ( { expr_loc = loc; expr_node = CONSTANT (CONST_INT "4")}, loc))], loc))]} let add_exn_cabs (f,l) = let treat_one_global (b,d) = let d = match d with | FUNDEF (s,(t,("f",dt,a,l)),b,l1,l2) -> FUNDEF (s,(t,("f",dt,a,l)), mk_exn_cabs b,l1,l2) | FUNDEF (s,(t,("g",dt,a,l)),b,l1,l2) -> FUNDEF (s,(t,("g",dt,a,l)), mk_catch_cabs b,l1,l2) | _ -> d in b,d in (f, List.map treat_one_global l) let () = Frontc.add_syntactic_transformation add_exn_cabs let add_exn_cat = File.register_code_transformation_category "add_exn" let () = File.add_code_transformation_before_cleanup add_exn_cat add_exn frama-c-20.0-Calcium/tests/misc/fam_with_init.i0000666000000000000000000000020513571573400016300 0ustar /* run.config STDOPT: +"-print" */ struct s { int a; char data[]; // FAM }; int main() { struct s s1 = {0}; return s1.a; } frama-c-20.0-Calcium/tests/misc/filepath.i0000666000000000000000000000021113571573400015250 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/filepath_test.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/filepath_test */ frama-c-20.0-Calcium/tests/misc/filepath_test.ml0000666000000000000000000000171313571573400016477 0ustar let () = Kernel.feedback "normalize(/): %s" (Filepath.normalize "/"); Kernel.feedback "normalize(/..): %s" (Filepath.normalize "/.."); Kernel.feedback "normalize(/../../.): %s" (Filepath.normalize "/../../."); (* when there are several '/', only the last one is removed *) Kernel.feedback "normalize(///): %s" (Filepath.normalize "///"); Kernel.feedback "normalize(//tmp//): %s" (Filepath.normalize "//tmp//"); Kernel.feedback "normalize(/../tmp/../..): %s" (Filepath.normalize "/../tmp/../.."); Kernel.feedback "normalize(/tmp/inexistent_directory/..): %s" (Filepath.normalize "/tmp/inexistent_directory/.."); Kernel.feedback "normalize(): %s" (Filepath.normalize ""); Kernel.feedback "relativize(.): %s" (Filepath.relativize "."); Kernel.feedback "relativize(./tests/..): %s" (Filepath.relativize "./tests/.."); Kernel.feedback "relativize(/a/bc/d,base_name:/a/b/): %s" (Filepath.relativize ~base_name:"/a/b/" "/a/bc/d") frama-c-20.0-Calcium/tests/misc/find_enclosing_loop.c0000666000000000000000000000040713571573400017467 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ void f () { int x = 0; int y = 0; while (x<15) { x++; while (y<15) { y++; } x++; y =0; } x=0; y=0; } frama-c-20.0-Calcium/tests/misc/find_enclosing_loop.ml0000666000000000000000000000146313571573400017660 0ustar open Cil open Cil_types class check = object(self) inherit Visitor.frama_c_inplace val current_loop = Stack.create () method! vstmt_aux s = let res = match s.skind with | Loop _ -> Stack.push s current_loop; ChangeDoChildrenPost (s, fun s -> ignore (Stack.pop current_loop); s) | _ -> DoChildren in let has_loop = try Some (Kernel_function.find_enclosing_loop (Extlib.the self#current_kf) s) with Not_found -> None in (match has_loop with | Some s -> assert (s == Stack.top current_loop) | None -> assert (Stack.is_empty current_loop)); res end let run () = Visitor.visitFramacFileSameGlobals (new check) (Ast.get()); Kernel.result "Script done" let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/function_ptr_alignof.i0000666000000000000000000000021213571573400017666 0ustar /* run.config */ void f(void) { } int main(void) { void (*p)(void) = &f ; int x = __alignof__(p) ; return __alignof__(*p) ; } frama-c-20.0-Calcium/tests/misc/function_ptr_lvalue_1.i0000666000000000000000000000013713571573400017765 0ustar void f(void) {} int main() { void (*p)(void) = &f ; p = 1 ; *p = 1 ; return 0 ; } frama-c-20.0-Calcium/tests/misc/function_ptr_lvalue_2.i0000666000000000000000000000014013571573400017760 0ustar void f(void) {} int main() { void (*p)(void) = &f ; p = &f ; *p = f ; return 0 ; } frama-c-20.0-Calcium/tests/misc/function_ptr_sizeof.i0000666000000000000000000000020013571573400017543 0ustar /* run.config */ void f(void) { } int main(void) { void (*p)(void) = &f ; int x = sizeof(p) ; return sizeof(*p) ; } frama-c-20.0-Calcium/tests/misc/global_decl_loc.i0000666000000000000000000000020013571573400016536 0ustar /* run.config OPT: @PTEST_DIR@/global_decl_loc2.i -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int g; frama-c-20.0-Calcium/tests/misc/global_decl_loc.ml0000666000000000000000000000034313571573400016726 0ustar open Cil_types let run () = Globals.Vars.iter (fun vi _ -> Kernel.result "global variable %a declared at %a" Printer.pp_varinfo vi Printer.pp_location vi.vdecl ) let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/global_decl_loc2.i0000666000000000000000000000024113571573400016625 0ustar /* run.config OPT: @PTEST_DIR@/global_decl_loc.i -load-module @PTEST_DIR@/global_decl_loc.cmxs */ extern int g; int main(void) { int a = g; return a; } frama-c-20.0-Calcium/tests/misc/init_from_cil.i0000666000000000000000000000027013571573400016276 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int f(int x); int main () { return f(0); } frama-c-20.0-Calcium/tests/misc/init_from_cil.ml0000666000000000000000000000033513571573400016460 0ustar let run () = let a = Ast.get () in let prj = Project.create "foo" in File.init_project_from_cil_file prj a; Project.set_current prj; Printer.pp_file Format.std_formatter (Ast.get()) let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/interpreted_automata_dataflow.i0000666000000000000000000000063413571573400021566 0ustar /* run.config OPT: -load-script tests/misc/interpreted_automata_dataflow.ml */ /* Tests the dataflow functor of interpreted automata via a caml script implementing a propagation of constants. */ void main(int x) { int y = 3; y = y * 2; int z = y + 1; int w = y + x; int a = 1; for (int i = 0 ; i < 10 ; i ++) { int b = 3; int c = i + 1; a = a + 1; } if (x != 3) x = 3; } frama-c-20.0-Calcium/tests/misc/interpreted_automata_dataflow.ml0000666000000000000000000000632513571573400021751 0ustar open Cil_types module Map = Cil_datatype.Varinfo.Map module ConstantsDomain = struct type t = int Map.t let top = Map.empty let pretty fmt v = let pp_entry vi x = Format.fprintf fmt "%s -> %d@." vi.vorig_name x in Map.iter pp_entry v let join v1 v2 = let merge_entry _vi o1 o2 = match o1, o2 with | None, _ | _, None -> None | Some x, Some x' -> if x = x' then Some x else None in Map.merge merge_entry v1 v2 let widen v1 v2 = let same_entry vi x = Map.find_opt vi v2 = Some x in if Map.for_all same_entry v1 then None (* Inclusion *) else Some v2 (* No widening necessary *) exception Not_constant let rec eval v exp = match exp.enode with | Const (CInt64 (i,_,_)) -> (try Integer.to_int i with _ -> raise Not_constant) | Lval (Var vi, NoOffset) -> (try Map.find vi v with Not_found -> raise Not_constant) | SizeOf typ -> Cil.bytesSizeOf typ | UnOp (Neg, e, _) -> -(eval v e) | BinOp (PlusA, e1, e2, _) -> (eval v e1) + (eval v e2) | BinOp (MinusA, e1, e2, _) -> (eval v e1) - (eval v e2) | BinOp (Mult, e1, e2, _) -> (eval v e1) * (eval v e2) | BinOp (Div, e1, e2, _) -> let x = eval v e2 in if x <> 0 then (eval v e1) / x else raise Not_constant | _ -> raise Not_constant let eval_opt v exp = try Some (eval v exp) with Not_constant -> None let assume v exp kind = match exp.enode, kind with | BinOp (Eq, e1, e2, _), Interpreted_automata.Then | BinOp (Ne, e1, e2, _), Interpreted_automata.Else -> begin match eval_opt v e1, eval_opt v e2 with | None, None -> Some v | Some x, None -> begin match e2.enode with | Lval (Var vi, NoOffset) -> Some (Map.add vi x v) | _ -> Some v end | None, Some x -> begin match e1.enode with | Lval (Var vi, NoOffset) -> Some (Map.add vi x v) | _ -> Some v end | Some x, Some y -> if x = y then Some v else None end | _ -> Some v let assign v vi exp = try Map.add vi (eval v exp) v with Not_constant -> Map.remove vi v let transfer t v = let open Interpreted_automata in match t with | Skip | Return _ | Prop _ | Enter _ | Leave _ -> Some v | Guard (exp, kind, _) -> assume v exp kind | Instr (Set ((Var vi, NoOffset), exp, _), _) -> Some (assign v vi exp) | Instr (Local_init (vi, AssignInit (SingleInit exp), _), _) -> Some (assign v vi exp) | Instr (Local_init (_vi, AssignInit (CompoundInit _), _), _) -> Some v | Instr ((Call _ | Local_init _ | Set _ | Asm _), _) -> Some top | Instr ((Cil_types.Skip _ | Code_annot _), _) -> Some v end module Dataflow = Interpreted_automata.Dataflow (ConstantsDomain) let run () = let main_kf, _ = Globals.entry_point () in let results = Dataflow.fixpoint main_kf ConstantsDomain.top in let result = Interpreted_automata.( Vertex.Hashtbl.find results (get_automaton main_kf).return_point) in Kernel.result "Results at the end of function %s:@.%a" (Kernel_function.get_name main_kf) ConstantsDomain.pretty result let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/issue109.i0000666000000000000000000000037413571573400015050 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -eva @EVA_CONFIG@ -slevel-function main:10 -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ void main() { int i, j = 0; for (i=0; i<10; i++) { j++; } //@ assert i == j; } frama-c-20.0-Calcium/tests/misc/issue109.ml0000666000000000000000000000033313571573400015223 0ustar let main () = !Db.Value.compute (); Dynamic.Parameter.String.set "" ""; Dynamic.Parameter.String.set "" "tests/misc/issue109.i"; File.init_from_cmdline (); !Db.Value.compute () let main = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/issue_191.c0000666000000000000000000000025613571573400015201 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ // Everything is done by the script frama-c-20.0-Calcium/tests/misc/issue_191.ml0000666000000000000000000000033713571573400015367 0ustar let norm1 = Filepath.normalize ~base_name:"/dir1/" "dir/file" in let norm2 = Filepath.normalize ~base_name:"/dir2/" "dir/file" in (* norm2 should be different than norm1 *) Printf.printf "norm1: %s\nnorm2: %s\n" norm1 norm2frama-c-20.0-Calcium/tests/misc/justcopy.i0000666000000000000000000000020713571573400015341 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ frama-c-20.0-Calcium/tests/misc/justcopy.ml0000666000000000000000000000034713571573400015526 0ustar let main () = Ast.compute (); let o prj = object(_) inherit Visitor.frama_c_copy prj method! vglob_aux _g = Cil.JustCopy end in ignore (File.create_project_from_visitor "justcopy" o) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/keep_entry_point.i0000666000000000000000000000040713571573400017041 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -main f -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print */ static int f(void); static int x; static int y; static int g() { return y++; } static int f() { return x++; } frama-c-20.0-Calcium/tests/misc/keep_entry_point.ml0000666000000000000000000000014713571573400017222 0ustar let () = Rmtmps.rmUnusedStatic := true let () = Kernel.feedback "Do not keep unused static functions" frama-c-20.0-Calcium/tests/misc/log-file.i0000666000000000000000000000207513571573400015164 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/plugin_log.cmxs LOG: log-file-kernel-warnings.txt LOG: log-file-kernel-results.txt LOG: log-file-feedback.txt LOG: log-file-value-all.txt LOG: log-file-value-default.txt LOG: plugin-log-all.txt FILTER: sed 's|Your Frama-C version is.*|Your Frama-C version is VERSION|' STDOPT: #"-kernel-log w:@PTEST_RESULT@/log-file-kernel-warnings.txt,r:@PTEST_RESULT@/log-file-kernel-results.txt -eva-log f:@PTEST_RESULT@/log-file-feedback.txt,afewr:@PTEST_RESULT@/log-file-value-all.txt -eva-log :@PTEST_RESULT@/log-file-value-default.txt -then -kernel-log f:@PTEST_RESULT@/log-file-feedback.txt" OPT: -load-module tests/misc/plugin_log -kernel-msg-key foo-category -kernel-log=a:@PTEST_RESULT@/plugin-log-all.txt DONTRUN: test disabled due to non-deterministic errors in CI */ int f(void); // generates kernel warning (missing spec) //@ assigns \result; int g(void); // generates value warning (missing \from) int main() { f(); int r = g(); for (int i = 0; i < 1; i++); // generates value feedback return 0; } frama-c-20.0-Calcium/tests/misc/log_twice.i0000666000000000000000000000032213571573400015433 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_CONFIG@ -load-module @PTEST_DIR@/@PTEST_NAME@ */ int* f() { int x; return &x; } void main(int x) { int *p = f(); *p = 1; } frama-c-20.0-Calcium/tests/misc/log_twice.ml0000666000000000000000000000044313571573400015617 0ustar (* Run the user commands *) let run () = let p_default = Project.create_by_copy ~src:(Project.from_unique_name "default") ~last:false "default" in !Db.Value.compute (); Project.set_current p_default; !Db.Value.compute (); () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/long_ident.c0000666000000000000000000000060113571573400015573 0ustar /* run.config OPT: -obfuscate -journal-disable */ /*@ ensures \valid(q); // <-- obfuscation error [bts#404] */ int f(int *q) ; #define LV X_9999999999999999999999999999999999999999999999999999 int LV; enum { OK = 1, NOT_OK = 0 } e ; /*@ ensures \valid(p); */ void main (int LV, int * p) { { int LV = 0; e = OK ; // <-- obfuscation error [bts#403] f(p); } } frama-c-20.0-Calcium/tests/misc/m12_2.i0000666000000000000000000000412113571573400014300 0ustar /* run.config OPT: -unspecified-access */ // Misra C Enforcement Testing // // Rule 12.2 Required // The value of an expression shall be the same under any order of // evaluation that the standard permits. // 1 exp arithmetique qui n'est pas un appel de fct, &&, |-, ?: ni "," // est evaluee dans un ordre indeterminé. On ne doit pas se baser sur l'ordre // d'evaluation des termes de ces expressions // 12.2.1: si un terme d'une exp est un operateur d'increment ou de decrement // d'une var alors les autres termes ne doivent ni lire ni ecrire cette variable // 12.2.2: l'ordre d'evaluation des args d'un appel de fct etant indefini, il // faut que pour toute paire d'args (a,b) wr(a) inter rd(b)=0 et // rd(a) inter wr(b)=0 // 12.2.3: // 12.2.4: // 12.2.5: // 12.2.6: /// typedef int SI_32; static void func46 ( SI_32 m, SI_32 n ) ; static SI_32 func46a ( SI_32 m, SI_32 n ) { return m + n; } static struct st { int st_m; int st_n; } local_st; SI_32 main ( void ) { SI_32 i = 3; SI_32 x = 3; SI_32 y = 3; SI_32 z = 3; struct st this_st; this_st.st_m = 1; this_st.st_n = 2; z = ( y=i,++y ) + i++; // RULE 12.2.1: is est lu dans l'autre terme z = ++i + ( y=x,++y ) ; // y n'est PAS lu dans un autre terme z = ++i + ( y=i,++y ) ; // RULE 12.2.1: i est lu dans un autre terme z = ++i + ( 1 || i++ ) ; y = func46a ( x, ( x=3,x++ ) ) ; // RULE 12.2.2: x est lu dans le terme de G y = func46a ( x, ( i=2,i+3 ) ) ; // pas de conflits entre arguments effectifs z = i + i++; // RULE 12.2.1 z = ( y=x,++y ) + i++; z = ( i = 3 ) + i + 8; // RULE 12.2.5 z = ( this_st.st_m = 3 ) + this_st.st_m + 8; // RULE 12.2.5 z = ( this_st.st_m = 3 ) + this_st.st_n + 8; z = ++i + ( ( y += 2,y ) ,y++ ) ; // pas de conflits z = ( ( ++i+i ) >0 ) ? ++i : --i;// RULE 12.2.1: conflits entre terme du + z = ( i>0 ) ? ++i : --i; z = ++i + ( 3*8*1 && i++ ) ; // RULE 12.2.1: conflits entre terme du + z = ++i + ( y, y++ ) ; z = ++i + ( 3*8*0 || i++ ) ; // RULE 12.2.1: idem z = ++i + ( i, y++ ) ; // le resultat de terme droit ne depend pas de i return z; } frama-c-20.0-Calcium/tests/misc/mergestruct1.i0000666000000000000000000000016313571573400016107 0ustar /* run.config DONTRUN: */ struct s { int a; } s1; void f(void); int main() { s1.a = 1; f(); return 0; } frama-c-20.0-Calcium/tests/misc/mergestruct2.i0000666000000000000000000000021513571573400016106 0ustar /* run.config OPT: -print -journal-disable tests/misc/mergestruct3.i tests/misc/mergestruct1.i */ struct s *p; void g(void) { p = 0; } frama-c-20.0-Calcium/tests/misc/mergestruct3.i0000666000000000000000000000036313571573400016113 0ustar /* run.config OPT: -print -journal-disable tests/misc/mergestruct1.i tests/misc/mergestruct2.i OPT: -print -journal-disable tests/misc/mergestruct2.i tests/misc/mergestruct1.i */ struct s { float a; } s2; void f(void) { s2.a = 1.0; } frama-c-20.0-Calcium/tests/misc/my_visitor.c0000666000000000000000000000076013571573400015663 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs EXECNOW: LOG my_visitor_sav.res LOG my_visitor_sav.err BIN my_visitor.sav FRAMAC_PLUGIN=./lib/plugins @frama-c@ @PTEST_FILE@ -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -main f -save @PTEST_DIR@/@PTEST_NAME@.sav > @PTEST_DIR@/result/@PTEST_NAME@_sav.res 2> @PTEST_DIR@/result/@PTEST_NAME@_sav.err OPT: -load @PTEST_DIR@/@PTEST_NAME@.sav -print */ int f() { int y = 0; y++; /*@ assert y == 1; */ return 0; } frama-c-20.0-Calcium/tests/misc/my_visitor.ml0000666000000000000000000000451513571573400016053 0ustar open Logic_const open Cil open Cil_types module P = Plugin.Register (struct let name = "My_visitor" let shortname = "my_vis" let help = "" end) module S = P.True(struct let option_name = "-s" let help = "" end) module S2 = P.False(struct let option_name = "-s2" let help = "" end) let emitter1 = Emitter.create "emitter1" [ Emitter.Code_annot ] ~correctness:[ S.parameter ] ~tuning:[] let emitter2 = Emitter.create "emitter2" [ Emitter.Code_annot ] ~correctness:[ S2.parameter ] ~tuning:[] let emitter = let even = ref true in fun () -> let e = !even in even := not e; if !even then emitter1 else emitter2 let add_assert loc kf stmt = let x = Cil_const.make_logic_var_quant "x" Linteger in let e = emitter () in Annotations.add_assert e ~kf stmt (pforall ([x],prel(Req, {term_name = []; term_node = TLval (TVar x,TNoOffset); term_type = Linteger; term_loc = loc}, {term_name = []; term_node = TLval (TVar x,TNoOffset); term_type = Linteger; term_loc = loc} )));; class foo = object (self) inherit Visitor.frama_c_inplace method! vstmt_aux stmt = let loc = Cil.CurrentLoc.get () in add_assert loc (Extlib.the self#current_kf) stmt; DoChildren method! vglob_aux _ = DoChildren end;; let print () = File.pretty_ast (); Kernel.log "================================" let main () = (* The initial AST *) print (); let file = Ast.get () in ignore (Cil.visitCilFileSameGlobals (new foo:>cilVisitor) file); (* The AST with all asserts *) print (); Kernel.SafeArrays.set false; Project.clear ~selection:(State_selection.Static.with_dependencies S.self) (); (* The AST with 1/2 asserts *) print () let () = Db.Main.extend main (* This other main is a simple test for deep copy. *) let main () = let p = File.create_project_from_visitor "param" (new Visitor.frama_c_copy) in let selection = State_selection.singleton Kernel.LibEntry.self in Project.copy ~selection p; Kernel.LibEntry.on (); assert (Kernel.LibEntry.get ()); assert (Project.on p ~selection (fun () -> not (Kernel.LibEntry.get ())) ()) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/obfuscate.c0000666000000000000000000000245013571573400015430 0ustar /* run.config OPT: -obfuscate */ int my_var = 0; /*@ global invariant I: my_var >= 0; */ enum my_enum { first, second, third = 4 }; /*@ requires my_var > 0; ensures my_var > \old(my_var); ensures \forall integer x; x == x; */ int my_func () { enum my_enum x = first; /*@ assert my_var >= first; */ my_var++; if (!my_var) goto end; return my_var + x; end: ; return -1; } /*@ requires \valid(p); ensures *p == 0; */ void f(int* p); /*@ behavior bhv: exits never: \false; complete behaviors bhv; disjoint behaviors bhv; */ int logic(int f1) { int V1; V1 = 0; if (f1) goto end; V1 ++; /*@ assert property: V1 ? 1: 0; */ ; end: ; return V1; } int main(int* p) { if ("ti\rti" == "ti\rti") f(p); } /* Obfuscate logic types and logic constructors. */ /*@ type t = T | F; */ #include "stdint.h" /* Do not obfuscate builtins and stdlib types and functions. */ int builtin_and_stdlib () { int32_t x = 42; Frama_C_show_each(x); /*@ assert \true; */ return 1; } /* obfuscate names of arguments of function pointers. */ typedef void (*fct_ptr)(int x, int y); struct S { fct_ptr my_func; }; void implem(int c, int d) { }; struct S example_struct = { .my_func = implem }; void test_func(struct S* s) { s->my_func(3,4); example_struct.my_func(5,6); } frama-c-20.0-Calcium/tests/misc/oracle/0000777000000000000000000000000013571573400014555 5ustar frama-c-20.0-Calcium/tests/misc/oracle/add_assigns.res.oracle0000666000000000000000000000170013571573400021011 0ustar [kernel] Parsing tests/misc/add_assigns.i (no preprocessing) [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Assigns (file tests/misc/add_assigns.i, line 6) by assigns. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Total -------------------------------------------------------------------------------- /* Generated by Frama-C */ /*@ assigns *x, *y; */ int f(int *x, int *y) { int __retres; int *tmp; int *tmp_0; tmp = x; x ++; ; tmp_0 = y; y ++; ; __retres = *x + *y; return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/behavior_names.res.oracle0000666000000000000000000000014413571573400021515 0ustar [kernel] Parsing tests/misc/behavior_names.i (no preprocessing) stmt: bli bar new1: foo_0 new2: bla frama-c-20.0-Calcium/tests/misc/oracle/booleans.res.oracle0000666000000000000000000000302713571573400020340 0ustar [kernel] Parsing tests/misc/booleans.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/misc/booleans.i:7: Warning: check got status invalid. [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {42} __retres ∈ {0} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 5 statements reached (out of 5): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 1 valid 0 unknown 1 invalid 2 total Preconditions 0 valid 0 unknown 0 invalid 0 total 50% of the logical properties reached have been proven. ---------------------------------------------------------------------------- /* Generated by Frama-C */ int main(void) { int __retres; int x = 42; /*@ check (x ≢ 0) ≡ (17 ≢ 0); */ ; /*@ check ((ℤ)x ≢ 0) ≡ 17; */ ; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/bts0451.res.oracle0000666000000000000000000000063413571573400017641 0ustar [kernel] Parsing tests/misc/bts0451.i (no preprocessing) [kernel] tests/misc/bts0451.i:26: User Error: break outside of a loop or switch 24 /* should abort with an error at type-checking */ 25 int main (void) { 26 break; ^^^^^^^^ 27 return 0; 28 } [kernel] User Error: stopping on file "tests/misc/bts0451.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/bts0452.res.oracle0000666000000000000000000000041513571573400017637 0ustar [kernel] Parsing tests/misc/bts0452.i (no preprocessing) [kernel] tests/misc/bts0452.i:13: Warning: Body of function f falls-through. Adding a return statement [kernel] tests/misc/bts0452.i:27: Warning: Body of function h falls-through. Adding a return statement frama-c-20.0-Calcium/tests/misc/oracle/bts0489.res.oracle0000666000000000000000000000051713571573400017654 0ustar [kernel] Parsing tests/misc/bts0489.i (no preprocessing) Found representation 2 Found representation 2U Found representation 2 Found representation 5UL Found representation 5U Found representation 1 Found representation 20000 Found representation 20000L Found representation 20000 Found representation 20000 Found representation 20000 frama-c-20.0-Calcium/tests/misc/oracle/bts0525-2.res.oracle0000666000000000000000000000016413571573400020000 0ustar [kernel] Parsing tests/misc/bts0525-2.i (no preprocessing) [kernel] Parsing tests/misc/bts0525.i (no preprocessing) frama-c-20.0-Calcium/tests/misc/oracle/bts0525.res.oracle0000666000000000000000000000016413571573400017641 0ustar [kernel] Parsing tests/misc/bts0525.i (no preprocessing) [kernel] Parsing tests/misc/bts0525-2.i (no preprocessing) frama-c-20.0-Calcium/tests/misc/oracle/bts0541.res.oracle0000666000000000000000000000073013571573400017636 0ustar [kernel] Parsing tests/misc/bts0541.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/misc/bts0541.c:13: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {1} __retres ∈ {0} frama-c-20.0-Calcium/tests/misc/oracle/bts0990_link.res.oracle0000666000000000000000000000060713571573400020666 0ustar [kernel] Parsing tests/misc/bts0990_link.i (no preprocessing) [kernel] Parsing tests/misc/bts0990_link_1.i (no preprocessing) [kernel] User Error: Incompatible declaration for s: different type constructors: char * vs. char [100] First declaration was at tests/misc/bts0990_link.i:8 Current declaration is at tests/misc/bts0990_link_1.i:4 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/bts1135_ulevel.res.oracle0000666000000000000000000000153213571573400021213 0ustar [kernel] Parsing tests/misc/bts1135_ulevel.i (no preprocessing) /* Generated by Frama-C */ int X; void main(int c) { int i = 0; if (! (i < 10)) goto unrolling_2_loop; if (c) /*@ ensures \false; */ goto there_unrolling_6_loop; X ++; there_unrolling_6_loop: i ++; /*@ assert c ≡ 0 ⇒ \at(X,there_unrolling_6_loop) ≡ i + 1; */ ; unrolling_5_loop: ; if (! (i < 10)) goto unrolling_2_loop; if (c) /*@ ensures \false; */ goto there_unrolling_4_loop; X ++; there_unrolling_4_loop: i ++; /*@ assert c ≡ 0 ⇒ \at(X,there_unrolling_4_loop) ≡ i + 1; */ ; unrolling_3_loop: ; /*@ loop pragma UNROLL "done", 2; */ while (i < 10) { if (c) /*@ ensures \false; */ goto there; X ++; there: i ++; /*@ assert c ≡ 0 ⇒ \at(X,there) ≡ i + 1; */ ; } unrolling_2_loop: ; return; } frama-c-20.0-Calcium/tests/misc/oracle/bts1201.res.oracle0000666000000000000000000000431713571573400017635 0ustar [kernel] Parsing tests/misc/bts1201.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/misc/bts1201.i:5: assertion got status valid. [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 2): 50% coverage. In this function, 2 statements reached (out of 2): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 1 valid 0 unknown 0 invalid 1 total Preconditions 0 valid 0 unknown 0 invalid 0 total 100% of the logical properties reached have been proven. ---------------------------------------------------------------------------- [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] done for function main2 [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 2): 50% coverage. In this function, 1 statements reached (out of 1): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- /* Generated by Frama-C */ void main(void) { /*@ assert \true; */ ; return; } void main2(void) { return; } frama-c-20.0-Calcium/tests/misc/oracle/bts1347.res.oracle0000666000000000000000000000557613571573400017660 0ustar [kernel] Parsing tests/misc/bts1347.i (no preprocessing) [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/misc/bts1347.i:5: Warning: out of bounds read. assert \valid_read(x); [eva] Recording results for f [eva] done for function f [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/misc/bts1347.i:6: Warning: out of bounds read. assert \valid_read(tmp); (tmp from x++) [eva] Recording results for g [eva] done for function g [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Dead ] Assertion 'emitter' (file tests/misc/bts1347.i, line 5) Locally valid, but unreachable. By Eva because: - Unreachable return (file tests/misc/bts1347.i, line 5) [Unreachable] Unreachable return (file tests/misc/bts1347.i, line 5) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,mem_access' (file tests/misc/bts1347.i, line 6) tried with Eva. [ Partial ] Assertion 'emitter' (file tests/misc/bts1347.i, line 6) By emitter, with pending: - Assertion 'Eva,mem_access' (file tests/misc/bts1347.i, line 6) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Locally validated 1 To be validated 1 Dead property 1 Unreachable 4 Total -------------------------------------------------------------------------------- [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/misc/bts1347.i:5: Warning: out of bounds read. assert \valid_read(x); [eva] tests/misc/bts1347.i:5: assertion 'emitter' got status valid. [eva] Recording results for f [eva] done for function f [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/misc/bts1347.i:6: Warning: out of bounds read. assert \valid_read(tmp); (tmp from x++) [eva] tests/misc/bts1347.i:6: assertion 'emitter' got status valid. [eva] Recording results for g [eva] done for function g frama-c-20.0-Calcium/tests/misc/oracle/bug0277.res.oracle0000666000000000000000000000007113571573400017627 0ustar [kernel] Parsing tests/misc/bug0277.i (no preprocessing) frama-c-20.0-Calcium/tests/misc/oracle/bug_0209.res.oracle0000666000000000000000000000013513571573400017762 0ustar [kernel] Parsing tests/misc/bug_0209.c (with preprocessing) [kernel] Warning: no input file. frama-c-20.0-Calcium/tests/misc/oracle/callsite.res.oracle0000666000000000000000000000043213571573400020333 0ustar [kernel] Parsing tests/misc/callsite.i (no preprocessing) Call Sites for f: Call Sites for g: - From f at #003 - From f at #001 Call Sites for h: - From g at #008 - From g at #006 - From f at #002 Call Sites for k: - From h at #012 - From h at #011 - From g at #007 frama-c-20.0-Calcium/tests/misc/oracle/change_main.res.oracle0000666000000000000000000000377113571573400020775 0ustar [kernel] Parsing tests/misc/change_main.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 1 statements reached (out of 1): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [eva] Analyzing a complete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] done for function g [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 1 statements reached (out of 1): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/misc/oracle/char_ampamp.res.oracle0000666000000000000000000000234613571573400021011 0ustar [kernel] Parsing tests/misc/char_ampamp.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ {1} y ∈ {0} [eva] computing for function g <- main. Called from tests/misc/char_ampamp.c:12. [eva] tests/misc/char_ampamp.c:6: Frama_C_show_each_x: {1} [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: [eva:final-states] Values at end of function main: y ∈ {1} __retres ∈ {0} [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: NO EFFECTS [from] Function main: y FROM c \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function g: \nothing [inout] Inputs for function g: \nothing [inout] Out (internal) for function main: y; __retres [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/misc/oracle/cli_string_multiple_map.res.oracle0000666000000000000000000000014113571573400023435 0ustar [kernel] Parsing tests/misc/cli_string_multiple_map.i (no preprocessing) [a] a => 3;1 [a] b => 2 frama-c-20.0-Calcium/tests/misc/oracle/copy_kf.res.oracle0000666000000000000000000000356013571573400020172 0ustar [kernel] Parsing tests/misc/copy_kf.i (no preprocessing) [kernel] After cloning f: /* Generated by Frama-C */ /*@ requires \valid(p); ensures *\old(p) ≡ \old(x); assigns *p; */ void g(int *p, int x); /*@ requires 0 ≤ x ≤ 10; ensures \result ≡ 2 * \old(x); */ int f(int x) { int __retres; int y; g(& y,x); __retres = x + y; return __retres; } /*@ requires 0 ≤ x ≤ 10; ensures \result ≡ 2 * \old(x); */ int new_f(int x) { int __retres; int y; g(& y,x); __retres = x + y; return __retres; } [kernel] After cloning g: /* Generated by Frama-C */ /*@ requires \valid(p); ensures *\old(p) ≡ \old(x); assigns *p; */ void g(int *p, int x); /*@ requires \valid(p); ensures *\old(p) ≡ \old(x); assigns *p; */ void new_g(int *p, int x); /*@ requires 0 ≤ x ≤ 10; ensures \result ≡ 2 * \old(x); */ int f(int x) { int __retres; int y; g(& y,x); __retres = x + y; return __retres; } /*@ requires 0 ≤ x ≤ 10; ensures \result ≡ 2 * \old(x); */ int new_f(int x) { int __retres; int y; g(& y,x); __retres = x + y; return __retres; } [kernel] After replacement: /* Generated by Frama-C */ /*@ requires \valid(p); ensures *\old(p) ≡ \old(x); assigns *p; */ void g(int *p, int x); /*@ requires \valid(p); ensures *\old(p) ≡ \old(x); assigns *p; */ void new_g(int *p, int x); /*@ requires 0 ≤ x ≤ 10; ensures \result ≡ 2 * \old(x); */ int f(int x) { int __retres; int y; g(& y,x); __retres = x + y; return __retres; } /*@ requires 0 ≤ x ≤ 10; ensures \result ≡ 2 * \old(x); */ int new_f(int x) { int __retres; int y; new_g(& y,x); __retres = x + y; return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/copy_machdep.res.oracle0000666000000000000000000000022613571573400021167 0ustar [kernel] Parsing tests/misc/copy_machdep.i (no preprocessing) [kernel] Machdep is preserved [kernel] Enums is preserved [kernel] Unicode is preserved frama-c-20.0-Calcium/tests/misc/oracle/custom_machdep.res.oracle0000666000000000000000000000136213571573400021531 0ustar [kernel] Registering machdep 'mach' as 'custom' [kernel] Parsing tests/misc/custom_machdep.c (with preprocessing) /* Generated by Frama-C */ #include "ctype.h" #include "errno.h" #include "inttypes.h" #include "locale.h" #include "math.h" #include "signal.h" #include "stdarg.h" #include "stddef.h" #include "stdint.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "strings.h" #include "time.h" #include "wchar.h" int main(void) { int __retres; __retres = (int)2147483647; return __retres; } [kernel] Registering machdep 'mach' as 'custom' [kernel] Trying to register machdep 'mach2' as 'custom' [kernel] User Error: trying to register incompatible machdeps under name `custom' [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/debug_category.0.res.oracle0000666000000000000000000000011513571573400021652 0ustar [test] Available message categories are: * a a:b a:b:c d frama-c-20.0-Calcium/tests/misc/oracle/debug_category.1.res.oracle0000666000000000000000000000047613571573400021665 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] A is enabled [test:a:b] B is enabled [test:a:b:c] C is enabled [test:a] A is enabled [test:a:b] B is enabled [test:a:b:c] C is enabled [test:a] A is enabled [test:a:b] B is enabled [test:a:b:c] C is enabled frama-c-20.0-Calcium/tests/misc/oracle/debug_category.10.res.oracle0000666000000000000000000000031513571573400021735 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test] User Error: warning treated as fatal error. [kernel] Plug-in test aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/debug_category.11.res.oracle0000666000000000000000000000031213571573400021733 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning: Warning A (warn-once: no further messages from category 'a' will be emitted) frama-c-20.0-Calcium/tests/misc/oracle/debug_category.12.res.oracle0000666000000000000000000000031213571573400021734 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning A (warn-feedback-once: no further messages from category 'a' will be emitted) frama-c-20.0-Calcium/tests/misc/oracle/debug_category.13.res.oracle0000666000000000000000000000054113571573400021741 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning: Warning A (warn-error-once: no further messages from category 'a' will be emitted) [test] Warning: warning a treated as deferred error. See above messages for more information. [kernel] Plug-in test aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/debug_category.14.res.oracle0000666000000000000000000000056413571573400021747 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning: Warning A [test] User Error: Testing error function [test:a] Warning: Another Warning A [test] User Error: Deferred error message was emitted during execution. See above messages for more information. [kernel] Plug-in test aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/debug_category.15.res.oracle0000666000000000000000000000043613571573400021746 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning: Warning A [test:a] Warning: Another Warning A [test] Failure: Deferred error message was emitted during execution. [kernel] Plug-in test aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/debug_category.16.res.oracle0000666000000000000000000000135413571573400021747 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning: Warning A [test] Failure: Testing failure function [test:a] Warning: Another Warning A [test] Failure: Deferred internal error message was emitted during execution. See above messages for more information. [kernel] Current source was: :0 The full backtrace is: Plug-in test aborted: internal error. Please report as 'crash' at http://bts.frama-c.com/. Your Frama-C version is VERSION Note that a version and a backtrace alone often do not contain enough information to understand the bug. Guidelines for reporting bugs are at: http://bts.frama-c.com/dokuwiki/doku.php?id=mantis:frama-c:bug_reporting_guidelines frama-c-20.0-Calcium/tests/misc/oracle/debug_category.2.res.oracle0000666000000000000000000000025013571573400021654 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] A is enabled [test:a] A is enabled [test:a] A is enabled frama-c-20.0-Calcium/tests/misc/oracle/debug_category.3.res.oracle0000666000000000000000000000036613571573400021665 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] A is enabled [test:a:b:c] C is enabled [test:a] A is enabled [test:a:b:c] C is enabled [test:a] A is enabled [test:a:b:c] C is enabled frama-c-20.0-Calcium/tests/misc/oracle/debug_category.4.res.oracle0000666000000000000000000000036613571573400021666 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a:b:c] C is enabled [test:d] D is enabled [test:a:b:c] C is enabled [test:d] D is enabled [test:a:b:c] C is enabled [test:d] D is enabled frama-c-20.0-Calcium/tests/misc/oracle/debug_category.5.res.oracle0000666000000000000000000000060013571573400021656 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] A is enabled [test:a:b] B is enabled [test:a:b:c] C is enabled [test:d] D is enabled [test:a] A is enabled [test:a:b] B is enabled [test:a:b:c] C is enabled [test:d] D is enabled [test:a] A is enabled [test:a:b] B is enabled [test:a:b:c] C is enabled [test:d] D is enabled frama-c-20.0-Calcium/tests/misc/oracle/debug_category.6.res.oracle0000666000000000000000000000024613571573400021665 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning: Warning A [test:a] Warning: Another Warning A frama-c-20.0-Calcium/tests/misc/oracle/debug_category.7.res.oracle0000666000000000000000000000046713571573400021673 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning: Warning A [test:a] Warning: Another Warning A [test] Warning: warning a treated as deferred error. See above messages for more information. [kernel] Plug-in test aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/debug_category.8.res.oracle0000666000000000000000000000035213571573400021665 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning: Warning A [test] User Error: warning a treated as fatal error. [kernel] Plug-in test aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/debug_category.9.res.oracle0000666000000000000000000000022413571573400021664 0ustar [kernel] Parsing tests/misc/debug_category.i (no preprocessing) [test] Warning: Uncategorized warning [test:a] Warning A [test:a] Another Warning A frama-c-20.0-Calcium/tests/misc/oracle/ensures.res.oracle0000666000000000000000000000233213571573400020220 0ustar [kernel] Parsing tests/misc/ensures.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/misc/ensures.i:5: Warning: function main: postcondition got status invalid. [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 2 statements reached (out of 2): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [kernel] main: behavior default! **NOT** VALID according to Frama-C kernel (under hypotheses) [kernel] main: behavior default! **NOT** VALID according to Eva (under hypotheses) frama-c-20.0-Calcium/tests/misc/oracle/exception.0.res.oracle0000666000000000000000000000467113571573400020700 0ustar [kernel] Parsing tests/misc/exception.i (no preprocessing) /* Generated by Frama-C */ struct my_exn { int e ; }; struct my_exn2 { char c ; }; struct my_exn foo; struct my_exn2 bar; int x = 42; int f(int c) { int __retres; if (c) throw (x); else { __retres = c; goto return_label; } return_label: return __retres; } int g(int c) { int __retres; try { int tmp; tmp = f(c); __retres = tmp; goto return_label; } catch ( int x_0 ) { __retres = 3; goto return_label; } catch ( ... ) { __retres = 4; goto return_label; } return_label: return __retres; } int f1(int c) { int __retres; if (c) { struct my_exn exn; exn.e = 0; throw (exn); } else { __retres = c; goto return_label; } return_label: return __retres; } /*@ ensures \result ≡ \old(c) + 1; */ int f2(int c) { int __retres; if (c < 50) { int exn; exn = 0; throw (exn); } else { __retres = c + 1; goto return_label; } return_label: return __retres; } int f3(int c) { int __retres; if (c > 150) { int *exn; exn = & x; throw (exn); } else { __retres = c + 2; goto return_label; } return_label: return __retres; } int f4(int c) { int __retres; if (c) { struct my_exn2 exn; exn.c = 0; throw (exn); } else { __retres = c + 3; goto return_label; } return_label: return __retres; } /*@ ensures \result ≢ 42; */ int h(int c) { int __retres; try if (c - 1 <= 0) { int tmp; tmp = f1(c); __retres = tmp; goto return_label; } else if (c - 100 <= 0) { int tmp_0; /*@ returns \result ≡ c + 1; */ { tmp_0 = f2(c); __retres = tmp_0; /*@ assert __retres ≡ c + 1; */ ; goto return_label; } } else if (c > 360) { int x_0 = f3(c); __retres = x_0; goto return_label; } else { int tmp_2; tmp_2 = f4(c); __retres = tmp_2; goto return_label; } catch ( struct my_exn exn struct my_exn exn_aux struct my_exn2 exn2 ) { __retres = exn.e; goto return_label; } catch ( int y ) { __retres = y; goto return_label; } catch ( double not_thrown ) { __retres = -1; goto return_label; } catch ( ... ) throw ; return_label: return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/exception.1.res.oracle0000666000000000000000000001147613571573400020702 0ustar [kernel] Parsing tests/misc/exception.i (no preprocessing) /* Generated by Frama-C */ struct my_exn { int e ; }; struct my_exn2 { char c ; }; enum __fc_exn_enum { __fc_exn_kind___fc_Smy_exn2 = 3, __fc_exn_kind___fc_Smy_exn = 2, __fc_exn_kind___fc_pi = 1, __fc_exn_kind___fc_i = 0 }; union __fc_exn_union { struct my_exn2 __fc_Smy_exn2 ; struct my_exn __fc_Smy_exn ; int *__fc_pi ; int __fc_i ; }; struct __fc_exn_struct { int exn_uncaught ; enum __fc_exn_enum exn_kind ; union __fc_exn_union exn_obj ; }; struct __fc_exn_struct __fc_exn = {.exn_uncaught = 0, .exn_kind = 0, .exn_obj = {.__fc_Smy_exn2 = {.c = (char)0}}}; struct my_exn foo; struct my_exn2 bar; int x = 42; int f(int c) { int __retres; if (c) { __fc_exn.exn_uncaught = 1; __fc_exn.exn_kind = __fc_exn_kind___fc_i; __fc_exn.exn_obj.__fc_i = x; __retres = 0; goto return_label; } else { __retres = c; goto return_label; } return_label: return __retres; } int g(int c) { int __retres; { int tmp; tmp = f(c); if (__fc_exn.exn_uncaught == 1) switch (__fc_exn.exn_kind) case __fc_exn_kind___fc_i: goto __fc_i; __retres = tmp; goto return_label; if (0) { int x_0; __fc_i: __fc_exn.exn_uncaught = 0; x_0 = __fc_exn.exn_obj.__fc_i; __retres = 3; goto return_label; } if (0) { catch_all: __fc_exn.exn_uncaught = 0; __retres = 4; goto return_label; } } return_label: return __retres; } int f1(int c) { int __retres; if (c) { struct my_exn exn; exn.e = 0; __fc_exn.exn_uncaught = 1; __fc_exn.exn_kind = __fc_exn_kind___fc_Smy_exn; __fc_exn.exn_obj.__fc_Smy_exn = exn; __retres = 0; goto return_label; } else { __retres = c; goto return_label; } return_label: return __retres; } /*@ ensures __fc_exn.exn_uncaught ≡ 0 ⇒ \result ≡ \old(c) + 1; */ int f2(int c) { int __retres; if (c < 50) { int exn; exn = 0; __fc_exn.exn_uncaught = 1; __fc_exn.exn_kind = __fc_exn_kind___fc_i; __fc_exn.exn_obj.__fc_i = exn; __retres = 0; goto return_label; } else { __retres = c + 1; goto return_label; } return_label: return __retres; } int f3(int c) { int __retres; if (c > 150) { int *exn; exn = & x; __fc_exn.exn_uncaught = 1; __fc_exn.exn_kind = __fc_exn_kind___fc_pi; __fc_exn.exn_obj.__fc_pi = exn; __retres = 0; goto return_label; } else { __retres = c + 2; goto return_label; } return_label: return __retres; } int f4(int c) { int __retres; if (c) { struct my_exn2 exn; exn.c = 0; __fc_exn.exn_uncaught = 1; __fc_exn.exn_kind = __fc_exn_kind___fc_Smy_exn2; __fc_exn.exn_obj.__fc_Smy_exn2 = exn; __retres = 0; goto return_label; } else { __retres = c + 3; goto return_label; } return_label: return __retres; } /*@ ensures __fc_exn.exn_uncaught ≡ 0 ⇒ \result ≢ 42; */ int h(int c) { int __retres; if (c - 1 <= 0) { int tmp; tmp = f1(c); if (__fc_exn.exn_uncaught == 1) switch (__fc_exn.exn_kind) case __fc_exn_kind___fc_Smy_exn: goto __fc_Smy_exn_1; __retres = tmp; goto return_label; } else if (c - 100 <= 0) { int tmp_0; /*@ returns __fc_exn.exn_uncaught ≡ 0 ⇒ \result ≡ c + 1; */ { tmp_0 = f2(c); if (__fc_exn.exn_uncaught == 1) switch (__fc_exn.exn_kind) case __fc_exn_kind___fc_i: goto __fc_i; __retres = tmp_0; /*@ assert __retres ≡ c + 1; */ ; goto return_label; } } else if (c > 360) { int x_0 = f3(c); if (__fc_exn.exn_uncaught == 1) switch (__fc_exn.exn_kind) default: goto catch_all; __retres = x_0; goto return_label; } else { int tmp_2; tmp_2 = f4(c); if (__fc_exn.exn_uncaught == 1) switch (__fc_exn.exn_kind) case __fc_exn_kind___fc_Smy_exn2: goto __fc_Smy_exn2_2; __retres = tmp_2; goto return_label; } if (0) { struct my_exn exn; if (0) { struct my_exn2 exn2; __fc_Smy_exn2_2: exn2 = __fc_exn.exn_obj.__fc_Smy_exn2; exn.e = exn2.c; goto __fc_Smy_exn; } if (0) { struct my_exn exn_aux; __fc_Smy_exn_1: exn_aux = __fc_exn.exn_obj.__fc_Smy_exn; exn = exn_aux; goto __fc_Smy_exn; } __fc_Smy_exn: __fc_exn.exn_uncaught = 0; __retres = exn.e; goto return_label; } if (0) { int y; __fc_i: __fc_exn.exn_uncaught = 0; y = __fc_exn.exn_obj.__fc_i; __retres = y; goto return_label; } if (0) { catch_all: __fc_exn.exn_uncaught = 0; __fc_exn.exn_uncaught = 1; __retres = 0; goto return_label; } return_label: return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/fam_with_init.res.oracle0000666000000000000000000000170513571573400021360 0ustar [kernel] Parsing tests/misc/fam_with_init.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s1 ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: s1; __retres [inout] Inputs for function main: \nothing /* Generated by Frama-C */ struct s { int a ; char data[] ; }; int main(void) { int __retres; struct s s1 = {.a = 0}; __retres = s1.a; return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/filepath.res.oracle0000666000000000000000000000066313571573400020335 0ustar [kernel] normalize(/): / [kernel] normalize(/..): / [kernel] normalize(/../../.): / [kernel] normalize(///): // [kernel] normalize(//tmp//): //tmp/ [kernel] normalize(/../tmp/../..): / [kernel] normalize(/tmp/inexistent_directory/..): /tmp [kernel] normalize(): [kernel] relativize(.): . [kernel] relativize(./tests/..): . [kernel] relativize(/a/bc/d,base_name:/a/b/): /a/bc/d [kernel] Parsing tests/misc/filepath.i (no preprocessing) frama-c-20.0-Calcium/tests/misc/oracle/find_enclosing_loop.res.oracle0000666000000000000000000000013413571573400022544 0ustar [kernel] Parsing tests/misc/find_enclosing_loop.c (with preprocessing) [kernel] Script done frama-c-20.0-Calcium/tests/misc/oracle/function_ptr_alignof.res.oracle0000666000000000000000000000045513571573400022751 0ustar [kernel] Parsing tests/misc/function_ptr_alignof.i (no preprocessing) [kernel] tests/misc/function_ptr_alignof.i:10: User Error: alignof() called on a function. [kernel] User Error: stopping on file "tests/misc/function_ptr_alignof.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/function_ptr_lvalue_1.res.oracle0000666000000000000000000000046713571573400023045 0ustar [kernel] Parsing tests/misc/function_ptr_lvalue_1.i (no preprocessing) [kernel] tests/misc/function_ptr_lvalue_1.i:7: User Error: Cannot assign to non-modifiable lval *p [kernel] User Error: stopping on file "tests/misc/function_ptr_lvalue_1.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/function_ptr_lvalue_2.res.oracle0000666000000000000000000000046713571573400023046 0ustar [kernel] Parsing tests/misc/function_ptr_lvalue_2.i (no preprocessing) [kernel] tests/misc/function_ptr_lvalue_2.i:7: User Error: Cannot assign to non-modifiable lval *p [kernel] User Error: stopping on file "tests/misc/function_ptr_lvalue_2.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/function_ptr_sizeof.res.oracle0000666000000000000000000000044613571573400022631 0ustar [kernel] Parsing tests/misc/function_ptr_sizeof.i (no preprocessing) [kernel] tests/misc/function_ptr_sizeof.i:10: User Error: sizeof() called on function [kernel] User Error: stopping on file "tests/misc/function_ptr_sizeof.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/global_decl_loc.res.oracle0000666000000000000000000000031113571573400021613 0ustar [kernel] Parsing tests/misc/global_decl_loc.i (no preprocessing) [kernel] Parsing tests/misc/global_decl_loc2.i (no preprocessing) [kernel] global variable g declared at tests/misc/global_decl_loc.i:4 frama-c-20.0-Calcium/tests/misc/oracle/global_decl_loc2.res.oracle0000666000000000000000000000031113571573400021675 0ustar [kernel] Parsing tests/misc/global_decl_loc2.i (no preprocessing) [kernel] Parsing tests/misc/global_decl_loc.i (no preprocessing) [kernel] global variable g declared at tests/misc/global_decl_loc.i:4 frama-c-20.0-Calcium/tests/misc/oracle/init_from_cil.res.oracle0000666000000000000000000000024513571573400021352 0ustar [kernel] Parsing tests/misc/init_from_cil.i (no preprocessing) /* Generated by Frama-C */ int f(int x); int main(void) { int tmp; tmp = f(0); return tmp; } frama-c-20.0-Calcium/tests/misc/oracle/interpreted_automata_dataflow.res.oracle0000666000000000000000000000023013571573400024630 0ustar [kernel] Parsing tests/misc/interpreted_automata_dataflow.i (no preprocessing) [kernel] Results at the end of function main: x -> 3 y -> 6 z -> 7 frama-c-20.0-Calcium/tests/misc/oracle/issue109.res.oracle0000666000000000000000000000164613571573400020125 0ustar [kernel] Parsing tests/misc/issue109.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/misc/issue109.i:10: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {10} j ∈ {10} [kernel] Parsing tests/misc/issue109.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/misc/issue109.i:10: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {10} j ∈ {10} frama-c-20.0-Calcium/tests/misc/oracle/issue_191.res.oracle0000666000000000000000000000015113571573400020253 0ustar norm1: /dir1/dir/file norm2: /dir2/dir/file [kernel] Parsing tests/misc/issue_191.c (with preprocessing) frama-c-20.0-Calcium/tests/misc/oracle/justcopy.res.oracle0000666000000000000000000000007213571573400020413 0ustar [kernel] Parsing tests/misc/justcopy.i (no preprocessing) frama-c-20.0-Calcium/tests/misc/oracle/keep_entry_point.res.oracle0000666000000000000000000000036613571573400022117 0ustar [kernel] Do not keep unused static functions [kernel] Parsing tests/misc/keep_entry_point.i (no preprocessing) /* Generated by Frama-C */ static int f(void); static int x; static int f(void) { int tmp; tmp = x; x ++; ; return tmp; } frama-c-20.0-Calcium/tests/misc/oracle/log-file-feedback.txt0000666000000000000000000000111613571573400020535 0ustar [kernel] Parsing tests/misc/log-file.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva] computing for function f <- main. Called from tests/misc/log-file.i:20. [eva] using specification for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/misc/log-file.i:21. [eva] using specification for function g [eva] Done for function g tests/misc/log-file.i:22:[eva] starting to merge loop iterations [eva] Recording results for main [eva] done for function main frama-c-20.0-Calcium/tests/misc/oracle/log-file-kernel-results.txt0000666000000000000000000000000013571573400021757 0ustar frama-c-20.0-Calcium/tests/misc/oracle/log-file-kernel-warnings.txt0000666000000000000000000000023313571573400022116 0ustar tests/misc/log-file.i:20:[kernel:annot:missing-spec] warning: Neither code nor specification for function f, generating default assigns from the prototype frama-c-20.0-Calcium/tests/misc/oracle/log-file-value-all.txt0000666000000000000000000000123713571573400020677 0ustar [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva] computing for function f <- main. Called from tests/misc/log-file.i:20. [eva] using specification for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/misc/log-file.i:21. [eva] using specification for function g tests/misc/log-file.i:17:[eva] warning: no 'assigns \result \from ...' clause specified for function g [eva] Done for function g tests/misc/log-file.i:22:[eva] starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== frama-c-20.0-Calcium/tests/misc/oracle/log-file-value-default.txt0000666000000000000000000000021313571573400021544 0ustar tests/misc/log-file.i:17:[eva] warning: no 'assigns \result \from ...' clause specified for function g [eva] ====== VALUES COMPUTED ====== frama-c-20.0-Calcium/tests/misc/oracle/log-file.0.res.oracle0000666000000000000000000000317013571573400020371 0ustar [kernel] Parsing tests/misc/log-file.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/misc/log-file.i:20. [kernel:annot:missing-spec] tests/misc/log-file.i:20: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/misc/log-file.i:21. [eva] using specification for function g [eva] tests/misc/log-file.i:17: Warning: no 'assigns \result \from ...' clause specified for function g [eva] Done for function g [eva] tests/misc/log-file.i:22: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: r ∈ [--..--] __retres ∈ {0} [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function g: \result FROM ANYTHING(origin:Unknown) [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: r; i; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/misc/oracle/log-file.1.res.oracle0000666000000000000000000000041713571573400020373 0ustar [kernel] Parsing tests/misc/log-file.i (no preprocessing) [kernel:foo-category] result with dkey [kernel] result [kernel:foo-category] feedback with dkey [kernel] feedback [kernel:foo-category] debug (level 0) with dkey [kernel] debug (level 0) [kernel] Warning: warning frama-c-20.0-Calcium/tests/misc/oracle/log_twice.res.oracle0000666000000000000000000000327113571573400020513 0ustar [kernel] Parsing tests/misc/log_twice.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/misc/log_twice.i:12. [eva] Recording results for f [eva] Done for function f [eva:locals-escaping] tests/misc/log_twice.i:12: Warning: locals {x} escaping the scope of f through \result [eva:alarm] tests/misc/log_twice.i:13: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [kernel] tests/misc/log_twice.i:13: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/misc/log_twice.i:13: assertion 'Eva,dangling_pointer' got final status invalid. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/misc/log_twice.i:12. [eva] Recording results for f [eva] Done for function f [eva:locals-escaping] tests/misc/log_twice.i:12: Warning: locals {x} escaping the scope of f through \result [eva:alarm] tests/misc/log_twice.i:13: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [kernel] tests/misc/log_twice.i:13: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/misc/log_twice.i:13: assertion 'Eva,dangling_pointer' got final status invalid. frama-c-20.0-Calcium/tests/misc/oracle/long_ident.res.oracle0000666000000000000000000000207513571573400020662 0ustar [kernel] Parsing tests/misc/long_ident.c (with preprocessing) /* *********************************** */ /* start of dictionary for obfuscation */ /* *********************************** */ // enums #define E1 OK #define E2 NOT_OK // functions #define F1 f // global variables #define G1 X_9999999999999999999999999999999999999999999999999999 #define G2 e // types #define T1 __anonenum_e_1 // local variables #define V1 X_9999999999999999999999999999999999999999999999999999_1 // formal variables #define f1 q #define f2 X_9999999999999999999999999999999999999999999999999999_0 #define f3 p // formal variable in fun types #define ft1 q #define ft2 X_9999999999999999999999999999999999999999999999999999_0 #define ft3 p /*********************************** */ /* end of dictionary for obfuscation */ /*********************************** */ /* Generated by Frama-C */ enum T1 { E1 = 1, E2 = 0 }; /*@ ensures \valid(\old(f1)); */ int F1(int *f1); int G1; enum T1 G2; /*@ ensures \valid(\old(f3)); */ void main(int f2, int *f3) { int V1 = 0; G2 = E1; F1(f3); return; } frama-c-20.0-Calcium/tests/misc/oracle/m12_2.res.oracle0000666000000000000000000000334213571573400017356 0ustar [kernel] Parsing tests/misc/m12_2.i (no preprocessing) [kernel] tests/misc/m12_2.i:51: Warning: Unspecified sequence with side effect: /* y <- i */ y = i; y ++; /* <- */ tmp = i; /* i <- */ i ++; /* z <- tmp */ z = y + tmp; [kernel] tests/misc/m12_2.i:55: Warning: Unspecified sequence with side effect: /* i <- */ i ++; /* y <- i */ y = i; y ++; /* z <- */ z = i + y; [kernel] tests/misc/m12_2.i:59: Warning: Unspecified sequence with side effect: /* x <- tmp_1 */ x = 3; tmp_1 = x; x ++; /* <- x */ [kernel] tests/misc/m12_2.i:63: Warning: Unspecified sequence with side effect: /* <- */ tmp_2 = i; /* i <- */ i ++; /* z <- i tmp_2 */ z = i + tmp_2; [kernel] tests/misc/m12_2.i:67: Warning: Unspecified sequence with side effect: /* i <- */ i = 3; /* z <- i */ z = (i + i) + 8; [kernel] tests/misc/m12_2.i:69: Warning: Unspecified sequence with side effect: /* this_st.st_m <- */ this_st.st_m = 3; /* z <- this_st.st_m */ z = (this_st.st_m + this_st.st_m) + 8; [kernel] tests/misc/m12_2.i:77: Warning: Unspecified sequence with side effect: /* i <- */ i ++; /* <- i */ [kernel] tests/misc/m12_2.i:81: Warning: Unspecified sequence with side effect: /* i <- */ i ++; /* i <- tmp_5 */ if ((3 * 8) * 1) { SI_32 tmp_5; tmp_5 = i; i ++; if (tmp_5) tmp_6 = 1; else tmp_6 = 0; } else tmp_6 = 0; /* z <- */ z = i + tmp_6; [kernel] tests/misc/m12_2.i:85: Warning: Unspecified sequence with side effect: /* i <- */ i ++; /* i <- tmp_8 */ if ((3 * 8) * 0) tmp_9 = 1; else { SI_32 tmp_8; tmp_8 = i; i ++; if (tmp_8) tmp_9 = 1; else tmp_9 = 0; } /* z <- */ z = i + tmp_9; frama-c-20.0-Calcium/tests/misc/oracle/mergestruct2.res.oracle0000666000000000000000000000077313571573400021171 0ustar [kernel] Parsing tests/misc/mergestruct2.i (no preprocessing) [kernel] Parsing tests/misc/mergestruct3.i (no preprocessing) [kernel] Parsing tests/misc/mergestruct1.i (no preprocessing) /* Generated by Frama-C */ struct s; struct s { float a ; }; struct s_0 { int a ; }; struct s *p; void g(void) { p = (struct s *)0; return; } struct s s2; void f(void) { s2.a = (float)1.0; return; } struct s_0 s1; int main(void) { int __retres; s1.a = 1; f(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/mergestruct3.0.res.oracle0000666000000000000000000000076113571573400021325 0ustar [kernel] Parsing tests/misc/mergestruct3.i (no preprocessing) [kernel] Parsing tests/misc/mergestruct1.i (no preprocessing) [kernel] Parsing tests/misc/mergestruct2.i (no preprocessing) /* Generated by Frama-C */ struct s { float a ; }; struct s_0 { int a ; }; struct s s2; void f(void) { s2.a = (float)1.0; return; } struct s_0 s1; int main(void) { int __retres; s1.a = 1; f(); __retres = 0; return __retres; } struct s *p; void g(void) { p = (struct s *)0; return; } frama-c-20.0-Calcium/tests/misc/oracle/mergestruct3.1.res.oracle0000666000000000000000000000076113571573400021326 0ustar [kernel] Parsing tests/misc/mergestruct3.i (no preprocessing) [kernel] Parsing tests/misc/mergestruct2.i (no preprocessing) [kernel] Parsing tests/misc/mergestruct1.i (no preprocessing) /* Generated by Frama-C */ struct s { float a ; }; struct s_0 { int a ; }; struct s s2; void f(void) { s2.a = (float)1.0; return; } struct s *p; void g(void) { p = (struct s *)0; return; } struct s_0 s1; int main(void) { int __retres; s1.a = 1; f(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/my_visitor.res.oracle0000666000000000000000000000171213571573400020741 0ustar [kernel] Warning: emitter emitter1: correctness parameter -s does not exist anymore. Ignored. [kernel] Warning: emitter emitter2: correctness parameter -s2 does not exist anymore. Ignored. [kernel] Warning: 13 states in saved file ignored. They are invalid in this Frama-C configuration. [kernel] Warning: emitter emitter1: correctness parameter -s does not exist anymore. Ignored. [kernel] Warning: emitter emitter2: correctness parameter -s2 does not exist anymore. Ignored. [kernel] Warning: 13 states in saved file ignored. They are invalid in this Frama-C configuration. [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. /* Generated by Frama-C */ int f(void) { int __retres; /*@ assert emitter2: ∀ ℤ x; x ≡ x; */ int y = 0; y ++; /*@ assert y ≡ 1; */ /*@ assert emitter2: ∀ ℤ x; x ≡ x; */ ; __retres = 0; /*@ assert emitter2: ∀ ℤ x; x ≡ x; */ return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/my_visitor_sav.err0000666000000000000000000000000013571573400020332 0ustar frama-c-20.0-Calcium/tests/misc/oracle/my_visitor_sav.res0000666000000000000000000000174013571573400020347 0ustar [kernel] Parsing tests/misc/my_visitor.c (with preprocessing) /* Generated by Frama-C */ int f(void) { int __retres; int y = 0; y ++; /*@ assert y ≡ 1; */ ; __retres = 0; return __retres; } [kernel] ================================ /* Generated by Frama-C */ int f(void) { int __retres; /*@ assert emitter2: ∀ ℤ x; x ≡ x; */ int y = 0; /*@ assert emitter1: ∀ ℤ x; x ≡ x; */ y ++; /*@ assert y ≡ 1; */ /*@ assert emitter2: ∀ ℤ x; x ≡ x; */ ; /*@ assert emitter1: ∀ ℤ x; x ≡ x; */ __retres = 0; /*@ assert emitter2: ∀ ℤ x; x ≡ x; */ return __retres; } [kernel] ================================ /* Generated by Frama-C */ int f(void) { int __retres; /*@ assert emitter2: ∀ ℤ x; x ≡ x; */ int y = 0; y ++; /*@ assert y ≡ 1; */ /*@ assert emitter2: ∀ ℤ x; x ≡ x; */ ; __retres = 0; /*@ assert emitter2: ∀ ℤ x; x ≡ x; */ return __retres; } [kernel] ================================ frama-c-20.0-Calcium/tests/misc/oracle/obfuscate.res.oracle0000666000000000000000000000604213571573400020511 0ustar [kernel] Parsing tests/misc/obfuscate.c (with preprocessing) [obfuscator] Warning: unobfuscated attribute name `fc_stdlib' [obfuscator] Warning: unobfuscated attribute parameter name `stdint.h' [obfuscator] Warning: unobfuscated attribute name `missingproto' /* *********************************** */ /* start of dictionary for obfuscation */ /* *********************************** */ // behaviors #define B1 bhv // enums #define E1 first #define E2 second #define E3 third // functions #define F1 my_func #define F2 f #define F3 logic #define F4 builtin_and_stdlib #define F5 implem #define F6 test_func // global variables #define G1 my_var #define G2 example_struct // labels #define L1 end #define L2 end // logic constructors #define LC1 T #define LC2 F // logic types #define LT1 t // logic variables #define LV1 I #define LV2 x // fields #define M1 my_func // predicates #define P1 never // types #define T1 my_enum #define T2 S // local variables #define V1 x #define V2 __retres #define V3 V1 #define V4 __retres #define V5 x #define V6 __retres // formal variables #define f1 p #define f2 f1 #define f3 p #define f4 c #define f5 d #define f6 s // formal variable in fun types #define ft1 x #define ft2 y #define ft3 p #define ft4 f1 #define ft5 p #define ft6 c #define ft7 d #define ft8 s /*********************************** */ /* end of dictionary for obfuscation */ /*********************************** */ /* *********************************************************** */ /* start of dictionary required to compile the obfuscated code */ /* *********************************************************** */ // literal strings #define LS1 "ti\rti" /* ********************************************************* */ /* end of dictionary required to compile the obfuscated code */ /* ********************************************************* */ /* Generated by Frama-C */ #include "stdint.h" enum T1 { E1 = 0, E2 = 1, E3 = 4 }; struct T2 { void (*M1)(int ft1, int ft2) ; }; int G1 = 0; /*@ global invariant LV1: G1 ≥ 0; */ /*@ requires G1 > 0; ensures G1 > \old(G1); ensures ∀ ℤ LV2; LV2 ≡ LV2; */ int F1(void) { int V2; enum T1 V1 = E1; /*@ assert G1 ≥ E1; */ ; G1 ++; if (! G1) goto L1; V2 = (int)((unsigned int)G1 + V1); goto return_label; L1: ; V2 = -1; return_label: return V2; } /*@ requires \valid(f1); ensures *\old(f1) ≡ 0; */ void F2(int *f1); /*@ behavior B1: exits P1: \false; complete behaviors B1; disjoint behaviors B1; */ int F3(int f2) { int V3; V3 = 0; if (f2) goto L2; V3 ++; /*@ assert property: V3 ≢ 0? 1 ≢ 0: 0 ≢ 0; */ ; L2: ; return V3; } int main(int *f3) { int V4; if (LS1 == LS1) F2(f3); V4 = 0; return V4; } /*@ type LT1 = LC1 | LC2; */ extern int ( /* missing proto */ Frama_C_show_each)(); int F4(void) { int V6; int32_t V5 = 42; Frama_C_show_each(V5); /*@ assert \true; */ ; V6 = 1; return V6; } void F5(int f4, int f5) { return; } struct T2 G2 = {.M1 = & F5}; void F6(struct T2 *f6) { (*(f6->M1))(3,4); (*(G2.M1))(5,6); return; } frama-c-20.0-Calcium/tests/misc/oracle/plugin-log-all.txt0000666000000000000000000000041713571573400020143 0ustar [kernel] Parsing tests/misc/log-file.i (no preprocessing) [kernel:foo-category] result with dkey [kernel] result [kernel:foo-category] feedback with dkey [kernel] feedback [kernel:foo-category] debug (level 0) with dkey [kernel] debug (level 0) [kernel] warning: warning frama-c-20.0-Calcium/tests/misc/oracle/pp_bin_hex.res.oracle0000666000000000000000000000413013571573400020645 0ustar -------------------------------------------------- Dec. 0 Hex. 0x0000 Bin. 0b0000_0000 -------------------------------------------------- Dec. 1 Hex. 0x0001 Bin. 0b0000_0001 -------------------------------------------------- Dec. -1 Hex. 1xFFFF Bin. 1b1111_1111 -------------------------------------------------- Dec. 2 Hex. 0x0002 Bin. 0b0000_0010 -------------------------------------------------- Dec. -2 Hex. 1xFFFE Bin. 1b1111_1110 -------------------------------------------------- Dec. 5 Hex. 0x0005 Bin. 0b0000_0101 -------------------------------------------------- Dec. -5 Hex. 1xFFFB Bin. 1b1111_1011 -------------------------------------------------- Dec. 9 Hex. 0x0009 Bin. 0b0000_1001 -------------------------------------------------- Dec. -9 Hex. 1xFFF7 Bin. 1b1111_0111 -------------------------------------------------- Dec. 16 Hex. 0x0010 Bin. 0b0001_0000 -------------------------------------------------- Dec. -16 Hex. 1xFFF0 Bin. 1b1111_0000 -------------------------------------------------- Dec. 127 Hex. 0x007F Bin. 0b0111_1111 -------------------------------------------------- Dec. -127 Hex. 1xFF81 Bin. 1b1000_0001 -------------------------------------------------- Dec. 128 Hex. 0x0080 Bin. 0b1000_0000 -------------------------------------------------- Dec. -128 Hex. 1xFF80 Bin. 1b1000_0000 -------------------------------------------------- Dec. 255 Hex. 0x00FF Bin. 0b1111_1111 -------------------------------------------------- Dec. -255 Hex. 1xFF01 Bin. 1b0000_0001 -------------------------------------------------- Dec. 4279173135 Hex. 0xFF0F_000F Bin. 0b1111_1111_0000_1111_0000_0000_0000_1111 -------------------------------------------------- Dec. -4279173135 Hex. 1x00F0_FFF1 Bin. 1b0000_0000_1111_0000_1111_1111_1111_0001 -------------------------------------------------- Dec. 386334727 Hex. 0x1707_0007 Bin. 0b0001_0111_0000_0111_0000_0000_0000_0111 -------------------------------------------------- Dec. -386334727 Hex. 1xE8F8_FFF9 Bin. 1b1110_1000_1111_1000_1111_1111_1111_1001 -------------------------------------------------- [kernel] Parsing tests/misc/pp_bin_hex.i (no preprocessing) frama-c-20.0-Calcium/tests/misc/oracle/pp_int.res.oracle0000666000000000000000000004675113571573400020042 0ustar ====================================================================== Nbits: 0 Sep: "," ---------------------------------------------------------------------- value '65537' '10001' refhex '0x0001,0001' pp_hex '0x0001,0001' refbin '0b0000,0000,0000,0001,0000,0000,0000,0001' pp_bin ' 0b0001,0000,0000,0000,0001' pp_neg ' 1b1110,1111,1111,1111,1110' ---------------------------------------------------------------------- value '65536' '10000' refhex '0x0001,0000' pp_hex '0x0001,0000' refbin '0b0000,0000,0000,0001,0000,0000,0000,0000' pp_bin ' 0b0001,0000,0000,0000,0000' pp_neg ' 1b1110,1111,1111,1111,1111' ---------------------------------------------------------------------- value '65335' 'ff37' refhex '0x0000,FF37' pp_hex ' 0xFF37' refbin '0b0000,0000,0000,0000,1111,1111,0011,0111' pp_bin ' 0b1111,1111,0011,0111' pp_neg ' 1b0000,0000,1100,1000' ---------------------------------------------------------------------- value '65534' 'fffe' refhex '0x0000,FFFE' pp_hex ' 0xFFFE' refbin '0b0000,0000,0000,0000,1111,1111,1111,1110' pp_bin ' 0b1111,1111,1111,1110' pp_neg ' 1b0000,0000,0000,0001' ---------------------------------------------------------------------- value '127' '7f' refhex '0x0000,007F' pp_hex ' 0x007F' refbin '0b0000,0000,0000,0000,0000,0000,0111,1111' pp_bin ' 0b0111,1111' pp_neg ' 1b1000,0000' ---------------------------------------------------------------------- value '128' '80' refhex '0x0000,0080' pp_hex ' 0x0080' refbin '0b0000,0000,0000,0000,0000,0000,1000,0000' pp_bin ' 0b1000,0000' pp_neg ' 1b0111,1111' ---------------------------------------------------------------------- value '129' '81' refhex '0x0000,0081' pp_hex ' 0x0081' refbin '0b0000,0000,0000,0000,0000,0000,1000,0001' pp_bin ' 0b1000,0001' pp_neg ' 1b0111,1110' ---------------------------------------------------------------------- value '2' '2' refhex '0x0000,0002' pp_hex ' 0x0002' refbin '0b0000,0000,0000,0000,0000,0000,0000,0010' pp_bin ' 0b0010' pp_neg ' 1b1101' ---------------------------------------------------------------------- value '1' '1' refhex '0x0000,0001' pp_hex ' 0x0001' refbin '0b0000,0000,0000,0000,0000,0000,0000,0001' pp_bin ' 0b0001' pp_neg ' 1b1110' ---------------------------------------------------------------------- value '0' '0' refhex '0x0000,0000' pp_hex ' 0x0000' refbin '0b0000,0000,0000,0000,0000,0000,0000,0000' pp_bin ' 0b0000' pp_neg ' 1b1111' ---------------------------------------------------------------------- value '-1' '7fffffffffffffff' refhex '1xFFFF,FFFF' pp_hex ' 1xFFFF' refbin '1b1111,1111,1111,1111,1111,1111,1111,1111' pp_bin ' 1b1111' pp_neg ' 0b0000' ---------------------------------------------------------------------- value '-2' '7ffffffffffffffe' refhex '1xFFFF,FFFE' pp_hex ' 1xFFFE' refbin '1b1111,1111,1111,1111,1111,1111,1111,1110' pp_bin ' 1b1110' pp_neg ' 0b0001' ---------------------------------------------------------------------- value '-3' '7ffffffffffffffd' refhex '1xFFFF,FFFD' pp_hex ' 1xFFFD' refbin '1b1111,1111,1111,1111,1111,1111,1111,1101' pp_bin ' 1b1101' pp_neg ' 0b0010' ---------------------------------------------------------------------- value '-126' '7fffffffffffff82' refhex '1xFFFF,FF82' pp_hex ' 1xFF82' refbin '1b1111,1111,1111,1111,1111,1111,1000,0010' pp_bin ' 1b1000,0010' pp_neg ' 0b0111,1101' ---------------------------------------------------------------------- value '-127' '7fffffffffffff81' refhex '1xFFFF,FF81' pp_hex ' 1xFF81' refbin '1b1111,1111,1111,1111,1111,1111,1000,0001' pp_bin ' 1b1000,0001' pp_neg ' 0b0111,1110' ---------------------------------------------------------------------- value '-128' '7fffffffffffff80' refhex '1xFFFF,FF80' pp_hex ' 1xFF80' refbin '1b1111,1111,1111,1111,1111,1111,1000,0000' pp_bin ' 1b1000,0000' pp_neg ' 0b0111,1111' ---------------------------------------------------------------------- value '-129' '7fffffffffffff7f' refhex '1xFFFF,FF7F' pp_hex ' 1xFF7F' refbin '1b1111,1111,1111,1111,1111,1111,0111,1111' pp_bin ' 1b0111,1111' pp_neg ' 0b1000,0000' ---------------------------------------------------------------------- value '-130' '7fffffffffffff7e' refhex '1xFFFF,FF7E' pp_hex ' 1xFF7E' refbin '1b1111,1111,1111,1111,1111,1111,0111,1110' pp_bin ' 1b0111,1110' pp_neg ' 0b1000,0001' ---------------------------------------------------------------------- value '-254' '7fffffffffffff02' refhex '1xFFFF,FF02' pp_hex ' 1xFF02' refbin '1b1111,1111,1111,1111,1111,1111,0000,0010' pp_bin ' 1b0000,0010' pp_neg ' 0b1111,1101' ---------------------------------------------------------------------- value '-255' '7fffffffffffff01' refhex '1xFFFF,FF01' pp_hex ' 1xFF01' refbin '1b1111,1111,1111,1111,1111,1111,0000,0001' pp_bin ' 1b0000,0001' pp_neg ' 0b1111,1110' ---------------------------------------------------------------------- value '-256' '7fffffffffffff00' refhex '1xFFFF,FF00' pp_hex ' 1xFF00' refbin '1b1111,1111,1111,1111,1111,1111,0000,0000' pp_bin ' 1b0000,0000' pp_neg ' 0b1111,1111' ---------------------------------------------------------------------- value '-257' '7ffffffffffffeff' refhex '1xFFFF,FEFF' pp_hex ' 1xFEFF' refbin '1b1111,1111,1111,1111,1111,1110,1111,1111' pp_bin ' 1b1110,1111,1111' pp_neg ' 0b0001,0000,0000' ---------------------------------------------------------------------- value '-258' '7ffffffffffffefe' refhex '1xFFFF,FEFE' pp_hex ' 1xFEFE' refbin '1b1111,1111,1111,1111,1111,1110,1111,1110' pp_bin ' 1b1110,1111,1110' pp_neg ' 0b0001,0000,0001' ---------------------------------------------------------------------- value '-65534' '7fffffffffff0002' refhex '1xFFFF,0002' pp_hex ' 1x0002' refbin '1b1111,1111,1111,1111,0000,0000,0000,0010' pp_bin ' 1b0000,0000,0000,0010' pp_neg ' 0b1111,1111,1111,1101' ---------------------------------------------------------------------- value '-65535' '7fffffffffff0001' refhex '1xFFFF,0001' pp_hex ' 1x0001' refbin '1b1111,1111,1111,1111,0000,0000,0000,0001' pp_bin ' 1b0000,0000,0000,0001' pp_neg ' 0b1111,1111,1111,1110' ---------------------------------------------------------------------- value '-65536' '7fffffffffff0000' refhex '1xFFFF,0000' pp_hex ' 1x0000' refbin '1b1111,1111,1111,1111,0000,0000,0000,0000' pp_bin ' 1b0000,0000,0000,0000' pp_neg ' 0b1111,1111,1111,1111' ---------------------------------------------------------------------- value '-65537' '7ffffffffffeffff' refhex '1xFFFE,FFFF' pp_hex '1xFFFE,FFFF' refbin '1b1111,1111,1111,1110,1111,1111,1111,1111' pp_bin ' 1b1110,1111,1111,1111,1111' pp_neg ' 0b0001,0000,0000,0000,0000' ---------------------------------------------------------------------- value '-65538' '7ffffffffffefffe' refhex '1xFFFE,FFFE' pp_hex '1xFFFE,FFFE' refbin '1b1111,1111,1111,1110,1111,1111,1111,1110' pp_bin ' 1b1110,1111,1111,1111,1110' pp_neg ' 0b0001,0000,0000,0000,0001' ====================================================================== Nbits: 8 Sep: "" ---------------------------------------------------------------------- value '65335' 'ff37' refhex '0x0000FF37' pp_hex ' 0xFF37' refbin '0b00000000000000001111111100110111' pp_bin ' 0b1111111100110111' pp_neg ' 1b0000000011001000' ---------------------------------------------------------------------- value '65534' 'fffe' refhex '0x0000FFFE' pp_hex ' 0xFFFE' refbin '0b00000000000000001111111111111110' pp_bin ' 0b1111111111111110' pp_neg ' 1b0000000000000001' ---------------------------------------------------------------------- value '2' '2' refhex '0x00000002' pp_hex ' 0x0002' refbin '0b00000000000000000000000000000010' pp_bin ' 0b00000010' pp_neg ' 1b11111101' ---------------------------------------------------------------------- value '1' '1' refhex '0x00000001' pp_hex ' 0x0001' refbin '0b00000000000000000000000000000001' pp_bin ' 0b00000001' pp_neg ' 1b11111110' ---------------------------------------------------------------------- value '0' '0' refhex '0x00000000' pp_hex ' 0x0000' refbin '0b00000000000000000000000000000000' pp_bin ' 0b00000000' pp_neg ' 1b11111111' ---------------------------------------------------------------------- value '-1' '7fffffffffffffff' refhex '1xFFFFFFFF' pp_hex ' 1xFFFF' refbin '1b11111111111111111111111111111111' pp_bin ' 1b11111111' pp_neg ' 0b00000000' ---------------------------------------------------------------------- value '-2' '7ffffffffffffffe' refhex '1xFFFFFFFE' pp_hex ' 1xFFFE' refbin '1b11111111111111111111111111111110' pp_bin ' 1b11111110' pp_neg ' 0b00000001' ---------------------------------------------------------------------- value '-254' '7fffffffffffff02' refhex '1xFFFFFF02' pp_hex ' 1xFF02' refbin '1b11111111111111111111111100000010' pp_bin ' 1b00000010' pp_neg ' 0b11111101' ---------------------------------------------------------------------- value '-255' '7fffffffffffff01' refhex '1xFFFFFF01' pp_hex ' 1xFF01' refbin '1b11111111111111111111111100000001' pp_bin ' 1b00000001' pp_neg ' 0b11111110' ---------------------------------------------------------------------- value '-256' '7fffffffffffff00' refhex '1xFFFFFF00' pp_hex ' 1xFF00' refbin '1b11111111111111111111111100000000' pp_bin ' 1b00000000' pp_neg ' 0b11111111' ---------------------------------------------------------------------- value '-65534' '7fffffffffff0002' refhex '1xFFFF0002' pp_hex ' 1x0002' refbin '1b11111111111111110000000000000010' pp_bin ' 1b0000000000000010' pp_neg ' 0b1111111111111101' ---------------------------------------------------------------------- value '-65535' '7fffffffffff0001' refhex '1xFFFF0001' pp_hex ' 1x0001' refbin '1b11111111111111110000000000000001' pp_bin ' 1b0000000000000001' pp_neg ' 0b1111111111111110' ---------------------------------------------------------------------- value '-65536' '7fffffffffff0000' refhex '1xFFFF0000' pp_hex ' 1x0000' refbin '1b11111111111111110000000000000000' pp_bin ' 1b0000000000000000' pp_neg ' 0b1111111111111111' ====================================================================== Nbits: 10 Sep: "" ---------------------------------------------------------------------- value '65335' 'ff37' refhex '0x0000FF37' pp_hex ' 0xFF37' refbin '0b00000000000000001111111100110111' pp_bin ' 0b1111111100110111' pp_neg ' 1b0000000011001000' ---------------------------------------------------------------------- value '65534' 'fffe' refhex '0x0000FFFE' pp_hex ' 0xFFFE' refbin '0b00000000000000001111111111111110' pp_bin ' 0b1111111111111110' pp_neg ' 1b0000000000000001' ---------------------------------------------------------------------- value '2' '2' refhex '0x00000002' pp_hex ' 0x0002' refbin '0b00000000000000000000000000000010' pp_bin ' 0b000000000010' pp_neg ' 1b111111111101' ---------------------------------------------------------------------- value '1' '1' refhex '0x00000001' pp_hex ' 0x0001' refbin '0b00000000000000000000000000000001' pp_bin ' 0b000000000001' pp_neg ' 1b111111111110' ---------------------------------------------------------------------- value '0' '0' refhex '0x00000000' pp_hex ' 0x0000' refbin '0b00000000000000000000000000000000' pp_bin ' 0b000000000000' pp_neg ' 1b111111111111' ---------------------------------------------------------------------- value '-1' '7fffffffffffffff' refhex '1xFFFFFFFF' pp_hex ' 1xFFFF' refbin '1b11111111111111111111111111111111' pp_bin ' 1b111111111111' pp_neg ' 0b000000000000' ---------------------------------------------------------------------- value '-2' '7ffffffffffffffe' refhex '1xFFFFFFFE' pp_hex ' 1xFFFE' refbin '1b11111111111111111111111111111110' pp_bin ' 1b111111111110' pp_neg ' 0b000000000001' ---------------------------------------------------------------------- value '-254' '7fffffffffffff02' refhex '1xFFFFFF02' pp_hex ' 1xFF02' refbin '1b11111111111111111111111100000010' pp_bin ' 1b111100000010' pp_neg ' 0b000011111101' ---------------------------------------------------------------------- value '-255' '7fffffffffffff01' refhex '1xFFFFFF01' pp_hex ' 1xFF01' refbin '1b11111111111111111111111100000001' pp_bin ' 1b111100000001' pp_neg ' 0b000011111110' ---------------------------------------------------------------------- value '-256' '7fffffffffffff00' refhex '1xFFFFFF00' pp_hex ' 1xFF00' refbin '1b11111111111111111111111100000000' pp_bin ' 1b111100000000' pp_neg ' 0b000011111111' ---------------------------------------------------------------------- value '-65534' '7fffffffffff0002' refhex '1xFFFF0002' pp_hex ' 1x0002' refbin '1b11111111111111110000000000000010' pp_bin ' 1b0000000000000010' pp_neg ' 0b1111111111111101' ---------------------------------------------------------------------- value '-65535' '7fffffffffff0001' refhex '1xFFFF0001' pp_hex ' 1x0001' refbin '1b11111111111111110000000000000001' pp_bin ' 1b0000000000000001' pp_neg ' 0b1111111111111110' ---------------------------------------------------------------------- value '-65536' '7fffffffffff0000' refhex '1xFFFF0000' pp_hex ' 1x0000' refbin '1b11111111111111110000000000000000' pp_bin ' 1b0000000000000000' pp_neg ' 0b1111111111111111' ====================================================================== Nbits: 10 Sep: "." ---------------------------------------------------------------------- value '65335' 'ff37' refhex '0x0000.FF37' pp_hex ' 0xFF37' refbin '0b0000.0000.0000.0000.1111.1111.0011.0111' pp_bin ' 0b1111.1111.0011.0111' pp_neg ' 1b0000.0000.1100.1000' ---------------------------------------------------------------------- value '65534' 'fffe' refhex '0x0000.FFFE' pp_hex ' 0xFFFE' refbin '0b0000.0000.0000.0000.1111.1111.1111.1110' pp_bin ' 0b1111.1111.1111.1110' pp_neg ' 1b0000.0000.0000.0001' ---------------------------------------------------------------------- value '2' '2' refhex '0x0000.0002' pp_hex ' 0x0002' refbin '0b0000.0000.0000.0000.0000.0000.0000.0010' pp_bin ' 0b0000.0000.0010' pp_neg ' 1b1111.1111.1101' ---------------------------------------------------------------------- value '1' '1' refhex '0x0000.0001' pp_hex ' 0x0001' refbin '0b0000.0000.0000.0000.0000.0000.0000.0001' pp_bin ' 0b0000.0000.0001' pp_neg ' 1b1111.1111.1110' ---------------------------------------------------------------------- value '0' '0' refhex '0x0000.0000' pp_hex ' 0x0000' refbin '0b0000.0000.0000.0000.0000.0000.0000.0000' pp_bin ' 0b0000.0000.0000' pp_neg ' 1b1111.1111.1111' ---------------------------------------------------------------------- value '-1' '7fffffffffffffff' refhex '1xFFFF.FFFF' pp_hex ' 1xFFFF' refbin '1b1111.1111.1111.1111.1111.1111.1111.1111' pp_bin ' 1b1111.1111.1111' pp_neg ' 0b0000.0000.0000' ---------------------------------------------------------------------- value '-2' '7ffffffffffffffe' refhex '1xFFFF.FFFE' pp_hex ' 1xFFFE' refbin '1b1111.1111.1111.1111.1111.1111.1111.1110' pp_bin ' 1b1111.1111.1110' pp_neg ' 0b0000.0000.0001' ---------------------------------------------------------------------- value '-254' '7fffffffffffff02' refhex '1xFFFF.FF02' pp_hex ' 1xFF02' refbin '1b1111.1111.1111.1111.1111.1111.0000.0010' pp_bin ' 1b1111.0000.0010' pp_neg ' 0b0000.1111.1101' ---------------------------------------------------------------------- value '-255' '7fffffffffffff01' refhex '1xFFFF.FF01' pp_hex ' 1xFF01' refbin '1b1111.1111.1111.1111.1111.1111.0000.0001' pp_bin ' 1b1111.0000.0001' pp_neg ' 0b0000.1111.1110' ---------------------------------------------------------------------- value '-256' '7fffffffffffff00' refhex '1xFFFF.FF00' pp_hex ' 1xFF00' refbin '1b1111.1111.1111.1111.1111.1111.0000.0000' pp_bin ' 1b1111.0000.0000' pp_neg ' 0b0000.1111.1111' ---------------------------------------------------------------------- value '-65534' '7fffffffffff0002' refhex '1xFFFF.0002' pp_hex ' 1x0002' refbin '1b1111.1111.1111.1111.0000.0000.0000.0010' pp_bin ' 1b0000.0000.0000.0010' pp_neg ' 0b1111.1111.1111.1101' ---------------------------------------------------------------------- value '-65535' '7fffffffffff0001' refhex '1xFFFF.0001' pp_hex ' 1x0001' refbin '1b1111.1111.1111.1111.0000.0000.0000.0001' pp_bin ' 1b0000.0000.0000.0001' pp_neg ' 0b1111.1111.1111.1110' ---------------------------------------------------------------------- value '-65536' '7fffffffffff0000' refhex '1xFFFF.0000' pp_hex ' 1x0000' refbin '1b1111.1111.1111.1111.0000.0000.0000.0000' pp_bin ' 1b0000.0000.0000.0000' pp_neg ' 0b1111.1111.1111.1111' ---------------------------------------------------------------------- [kernel] Parsing tests/misc/pp_int.i (no preprocessing) frama-c-20.0-Calcium/tests/misc/oracle/pragma-pack.0.res.oracle0000666000000000000000000004105013571573400021055 0ustar [kernel] Parsing tests/misc/pragma-pack.c (with preprocessing) [kernel:typing:pragma] Pushing fc_stdlib stdint.h [kernel:typing:pragma] Pushing fc_stdlib __fc_gcc_builtins.h [kernel:typing:pragma] Popping fc_stdlib __fc_gcc_builtins.h [kernel:typing:pragma] Pushing fc_stdlib __fc_define_intptr_t.h [kernel:typing:pragma] Popping fc_stdlib __fc_define_intptr_t.h [kernel:typing:pragma] Popping fc_stdlib stdint.h [kernel:typing:pragma] Pushing fc_stdlib stddef.h [kernel:typing:pragma] Pushing fc_stdlib __fc_define_size_t.h [kernel:typing:pragma] Popping fc_stdlib __fc_define_size_t.h [kernel:typing:pragma] Pushing fc_stdlib __fc_define_ssize_t.h [kernel:typing:pragma] Popping fc_stdlib __fc_define_ssize_t.h [kernel:typing:pragma] Pushing fc_stdlib __fc_define_wchar_t.h [kernel:typing:pragma] Popping fc_stdlib __fc_define_wchar_t.h [kernel:typing:pragma] Popping fc_stdlib stddef.h [kernel:typing:pragma] tests/misc/pragma-pack.c:52: packing pragma: setting alignment to 8 [kernel:typing:pragma] tests/misc/pragma-pack.c:53: adding aligned(1) attribute to field 'PACK8.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:53: adding aligned(8) attribute to field 'PACK8.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:53: adding aligned(8) attribute to comp 'PACK8' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:55: packing pragma: setting alignment to 1 [kernel:typing:pragma] tests/misc/pragma-pack.c:56: adding aligned(1) attribute to field 'PACK1.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:56: adding aligned(1) attribute to field 'PACK1.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:56: adding aligned(1) attribute to comp 'PACK1' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:58: packing pragma: pushing alignment 1, setting alignment to 4 [kernel:typing:pragma] tests/misc/pragma-pack.c:60: adding aligned(1) attribute to field 'PACKPUSH4.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:60: adding aligned(4) attribute to field 'PACKPUSH4.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:60: adding aligned(4) attribute to comp 'PACKPUSH4' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:62: packing pragma: setting alignment to 16 [kernel:typing:pragma] tests/misc/pragma-pack.c:63: adding aligned(1) attribute to field 'PACK16.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:63: adding aligned(16) attribute to field 'PACK16.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:63: adding aligned(16) attribute to comp 'PACK16' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:65: packing pragma: popped alignment 1 [kernel:typing:pragma] tests/misc/pragma-pack.c:67: adding aligned(1) attribute to field 'PACKPOP.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:67: adding aligned(1) attribute to field 'PACKPOP.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:67: adding aligned(1) attribute to comp 'PACKPOP' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:69: packing pragma: pushing alignment 1 [kernel:typing:pragma] tests/misc/pragma-pack.c:71: adding aligned(1) attribute to field 'PACKPUSH.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:71: adding aligned(1) attribute to field 'PACKPUSH.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:71: adding aligned(1) attribute to comp 'PACKPUSH' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:73: packing pragma: setting alignment to 2 [kernel:typing:pragma] tests/misc/pragma-pack.c:74: adding aligned(1) attribute to field 'PACK2.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:74: adding aligned(2) attribute to field 'PACK2.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:74: adding aligned(2) attribute to comp 'PACK2' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:76: packing pragma: restoring alignment to default (16) [kernel:typing:pragma] tests/misc/pragma-pack.c:82: packing pragma: popped alignment 1 [kernel:typing:pragma] tests/misc/pragma-pack.c:84: adding aligned(1) attribute to field 'PACKPOPAGAIN.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:84: adding aligned(1) attribute to field 'PACKPOPAGAIN.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:84: adding aligned(1) attribute to comp 'PACKPOPAGAIN' due to packing pragma [kernel] tests/misc/pragma-pack.c:87: Warning: ignoring #pragma pack(pop) with empty stack [kernel:typing:pragma] tests/misc/pragma-pack.c:88: adding aligned(1) attribute to field 'PACKOVERPOP.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:88: adding aligned(1) attribute to field 'PACKOVERPOP.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:88: adding aligned(1) attribute to comp 'PACKOVERPOP' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:133: packing pragma: restoring alignment to default (16) [kernel:typing:pragma] tests/misc/pragma-pack.c:135: packing pragma: pushing alignment 16, setting alignment to 4 [kernel:typing:pragma] tests/misc/pragma-pack.c:136: adding aligned(1) attribute to field '__anonstruct_test1_1.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:136: setting aligned(2) attribute to field '__anonstruct_test1_1.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:136: adding aligned(4) attribute to field '__anonstruct_test1_1.k' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:136: adding aligned(1) attribute to field '__anonstruct_test1_1.l' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:136: adding aligned(4) attribute to comp '__anonstruct_test1_1' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:142: packing pragma: popped alignment 16 [kernel:typing:pragma] tests/misc/pragma-pack.c:152: packing pragma: pushing alignment 16, setting alignment to 1 [kernel:typing:pragma] tests/misc/pragma-pack.c:153: adding aligned(1) attribute to field '__anonstruct_test2_3.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:153: setting aligned(1) attribute to field '__anonstruct_test2_3.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:153: adding aligned(1) attribute to field '__anonstruct_test2_3.k' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:153: adding aligned(1) attribute to field '__anonstruct_test2_3.l' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:153: adding aligned(1) attribute to comp '__anonstruct_test2_3' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:159: packing pragma: popped alignment 16 [kernel:typing:pragma] tests/misc/pragma-pack.c:169: packing pragma: pushing alignment 16, setting alignment to 4 [kernel:typing:pragma] tests/misc/pragma-pack.c:176: packing pragma: popped alignment 16 [kernel:typing:pragma] tests/misc/pragma-pack.c:186: packing pragma: pushing alignment 16, setting alignment to 2 [kernel:typing:pragma] tests/misc/pragma-pack.c:187: setting aligned(2) attribute to field '__anonstruct_test4_7.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:193: packing pragma: popped alignment 16 [kernel:typing:pragma] tests/misc/pragma-pack.c:203: packing pragma: pushing alignment 16, setting alignment to 2 [kernel:typing:pragma] tests/misc/pragma-pack.c:204: setting aligned(2) attribute to field '__anonstruct_test5_9.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:210: packing pragma: popped alignment 16 [kernel:typing:pragma] tests/misc/pragma-pack.c:220: packing pragma: pushing alignment 16, setting alignment to 2 [kernel:typing:pragma] tests/misc/pragma-pack.c:221: setting aligned(2) attribute to field '__anonstruct_test6_11.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:227: packing pragma: popped alignment 16 [kernel:typing:pragma] tests/misc/pragma-pack.c:237: packing pragma: pushing alignment 16, setting alignment to 2 [kernel:typing:pragma] tests/misc/pragma-pack.c:238: adding aligned(1) attribute to field '__anonstruct_test7_13.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:238: setting aligned(2) attribute to field '__anonstruct_test7_13.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:238: adding aligned(1) attribute to field '__anonstruct_test7_13.q' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:238: adding aligned(2) attribute to field '__anonstruct_test7_13.p' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:238: adding aligned(2) attribute to field '__anonstruct_test7_13.k' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:238: adding aligned(1) attribute to field '__anonstruct_test7_13.l' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:238: adding aligned(2) attribute to comp '__anonstruct_test7_13' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:246: adding aligned(2) attribute to field '__anonstruct_test7_2_14.i' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:246: adding aligned(1) attribute to field '__anonstruct_test7_2_14.j' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:246: adding aligned(2) attribute to field '__anonstruct_test7_2_14.k' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:246: adding aligned(2) attribute to field '__anonstruct_test7_2_14.l' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:246: adding aligned(2) attribute to comp '__anonstruct_test7_2_14' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:252: packing pragma: popped alignment 16 [kernel:typing:pragma] tests/misc/pragma-pack.c:336: packing pragma: pushing alignment 16, setting alignment to 1 [kernel:typing:pragma] tests/misc/pragma-pack.c:337: adding aligned(1) attribute to field '__anonstruct_barcode_bmp_t_18.len' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:337: adding aligned(1) attribute to field '__anonstruct_barcode_bmp_t_18.data' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:337: adding aligned(1) attribute to comp '__anonstruct_barcode_bmp_t_18' due to packing pragma [kernel:typing:pragma] tests/misc/pragma-pack.c:341: packing pragma: popped alignment 16 [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function tests1 <- main. Called from tests/misc/pragma-pack.c:38. [eva] Recording results for tests1 [eva] Done for function tests1 [eva] computing for function tests2 <- main. Called from tests/misc/pragma-pack.c:38. [eva] Recording results for tests2 [eva] Done for function tests2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function tests1: S_i ∈ {0} S_j ∈ {16} S_sizeof ∈ {32} PACK8_i ∈ {0} PACK8_j ∈ {8} PACK8_sizeof ∈ {24} PACK1_i ∈ {0} PACK1_j ∈ {1} PACK1_sizeof ∈ {17} PACKPUSH4_i ∈ {0} PACKPUSH4_j ∈ {4} PACKPUSH4_sizeof ∈ {20} PACK16_i ∈ {0} PACK16_j ∈ {16} PACK16_sizeof ∈ {32} PACKPOP_i ∈ {0} PACKPOP_j ∈ {1} PACKPOP_sizeof ∈ {17} PACKPUSH_i ∈ {0} PACKPUSH_j ∈ {1} PACKPUSH_sizeof ∈ {17} PACK2_i ∈ {0} PACK2_j ∈ {2} PACK2_sizeof ∈ {18} PACKDEF_i ∈ {0} PACKDEF_j ∈ {16} PACKDEF_sizeof ∈ {32} PACKPOPAGAIN_i ∈ {0} PACKPOPAGAIN_j ∈ {1} PACKPOPAGAIN_sizeof ∈ {17} PACKOVERPOP_i ∈ {0} PACKOVERPOP_j ∈ {1} PACKOVERPOP_sizeof ∈ {17} PACK8_ATTR_i ∈ {0} PACK8_ATTR_j ∈ {1} PACK8_ATTR_sizeof ∈ {24} PACK1_ATTR_i ∈ {0} PACK1_ATTR_j ∈ {1} PACK1_ATTR_sizeof ∈ {17} PACKPUSH4_ATTR_i ∈ {0} PACKPUSH4_ATTR_j ∈ {1} PACKPUSH4_ATTR_sizeof ∈ {20} PACK16_ATTR_i ∈ {0} PACK16_ATTR_j ∈ {1} PACK16_ATTR_sizeof ∈ {32} PACK2_ATTR_i ∈ {0} PACK2_ATTR_j ∈ {1} PACK2_ATTR_sizeof ∈ {18} [eva:final-states] Values at end of function tests2: test1_i ∈ {0} test1_j ∈ {2} test1_k ∈ {4} test1_l ∈ {20} test1_sizeof ∈ {24} emul1_i ∈ {0} emul1_j ∈ {2} emul1_k ∈ {4} emul1_l ∈ {20} emul1_sizeof ∈ {24} test2_i ∈ {0} test2_j ∈ {1} test2_k ∈ {2} test2_l ∈ {18} test2_sizeof ∈ {19} emul2_i ∈ {0} emul2_j ∈ {1} emul2_k ∈ {2} emul2_l ∈ {18} emul2_sizeof ∈ {19} test3_i ∈ {0} test3_j ∈ {1} test3_k ∈ {2} test3_l ∈ {18} test3_sizeof ∈ {19} emul3_i ∈ {0} emul3_j ∈ {1} emul3_k ∈ {2} emul3_l ∈ {18} emul3_sizeof ∈ {19} test4_i ∈ {0} test4_j ∈ {2} test4_k ∈ {3} test4_l ∈ {19} test4_sizeof ∈ {20} emul4_i ∈ {0} emul4_j ∈ {2} emul4_k ∈ {3} emul4_l ∈ {19} emul4_sizeof ∈ {20} test5_i ∈ {0} test5_j ∈ {2} test5_k ∈ {3} test5_l ∈ {19} test5_sizeof ∈ {20} emul5_i ∈ {0} emul5_j ∈ {2} emul5_k ∈ {3} emul5_l ∈ {19} emul5_sizeof ∈ {20} test6_i ∈ {0} test6_j ∈ {2} test6_k ∈ {3} test6_l ∈ {19} test6_sizeof ∈ {20} emul6_i ∈ {0} emul6_j ∈ {2} emul6_k ∈ {3} emul6_l ∈ {19} emul6_sizeof ∈ {20} test7_i ∈ {0} test7_j ∈ {2} test7_k ∈ {14} test7_l ∈ {30} test7_sizeof ∈ {32} emul7_i ∈ {0} emul7_j ∈ {2} emul7_k ∈ {14} emul7_l ∈ {30} emul7_sizeof ∈ {32} test7_2_i ∈ {0} test7_2_j ∈ {32} test7_2_k ∈ {34} test7_2_l ∈ {50} test7_2_sizeof ∈ {82} emul7_2_i ∈ {0} emul7_2_j ∈ {32} emul7_2_k ∈ {34} emul7_2_l ∈ {50} emul7_2_sizeof ∈ {82} test8_i ∈ {0} test8_j ∈ {8} test8_k ∈ {16} test8_l ∈ {18} test8_sizeof ∈ {32} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function tests1 [from] Done for function tests1 [from] Computing for function tests2 [from] Done for function tests2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function tests1: NO EFFECTS [from] Function tests2: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function tests1: S_i; S_j; S_sizeof; PACK8_i; PACK8_j; PACK8_sizeof; PACK1_i; PACK1_j; PACK1_sizeof; PACKPUSH4_i; PACKPUSH4_j; PACKPUSH4_sizeof; PACK16_i; PACK16_j; PACK16_sizeof; PACKPOP_i; PACKPOP_j; PACKPOP_sizeof; PACKPUSH_i; PACKPUSH_j; PACKPUSH_sizeof; PACK2_i; PACK2_j; PACK2_sizeof; PACKDEF_i; PACKDEF_j; PACKDEF_sizeof; PACKPOPAGAIN_i; PACKPOPAGAIN_j; PACKPOPAGAIN_sizeof; PACKOVERPOP_i; PACKOVERPOP_j; PACKOVERPOP_sizeof; PACK8_ATTR_i; PACK8_ATTR_j; PACK8_ATTR_sizeof; PACK1_ATTR_i; PACK1_ATTR_j; PACK1_ATTR_sizeof; PACKPUSH4_ATTR_i; PACKPUSH4_ATTR_j; PACKPUSH4_ATTR_sizeof; PACK16_ATTR_i; PACK16_ATTR_j; PACK16_ATTR_sizeof; PACK2_ATTR_i; PACK2_ATTR_j; PACK2_ATTR_sizeof [inout] Inputs for function tests1: \nothing [inout] Out (internal) for function tests2: test1_i; test1_j; test1_k; test1_l; test1_sizeof; emul1_i; emul1_j; emul1_k; emul1_l; emul1_sizeof; test2_i; test2_j; test2_k; test2_l; test2_sizeof; emul2_i; emul2_j; emul2_k; emul2_l; emul2_sizeof; test3_i; test3_j; test3_k; test3_l; test3_sizeof; emul3_i; emul3_j; emul3_k; emul3_l; emul3_sizeof; test4_i; test4_j; test4_k; test4_l; test4_sizeof; emul4_i; emul4_j; emul4_k; emul4_l; emul4_sizeof; test5_i; test5_j; test5_k; test5_l; test5_sizeof; emul5_i; emul5_j; emul5_k; emul5_l; emul5_sizeof; test6_i; test6_j; test6_k; test6_l; test6_sizeof; emul6_i; emul6_j; emul6_k; emul6_l; emul6_sizeof; test7_i; test7_j; test7_k; test7_l; test7_sizeof; emul7_i; emul7_j; emul7_k; emul7_l; emul7_sizeof; test7_2_i; test7_2_j; test7_2_k; test7_2_l; test7_2_sizeof; emul7_2_i; emul7_2_j; emul7_2_k; emul7_2_l; emul7_2_sizeof; test8_i; test8_j; test8_k; test8_l; test8_sizeof [inout] Inputs for function tests2: \nothing [inout] Out (internal) for function main: __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/misc/oracle/pragma-pack.1.res.oracle0000666000000000000000000001372213571573400021063 0ustar [kernel] Parsing tests/misc/pragma-pack.c (with preprocessing) [kernel] tests/misc/pragma-pack.c:87: Warning: ignoring #pragma pack(pop) with empty stack [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function tests1 <- main. Called from tests/misc/pragma-pack.c:38. [eva] Recording results for tests1 [eva] Done for function tests1 [eva] computing for function tests2 <- main. Called from tests/misc/pragma-pack.c:38. [eva] Recording results for tests2 [eva] Done for function tests2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function tests1: S_i ∈ {0} S_j ∈ {4} S_sizeof ∈ {16} PACK8_i ∈ {0} PACK8_j ∈ {8} PACK8_sizeof ∈ {24} PACK1_i ∈ {0} PACK1_j ∈ {1} PACK1_sizeof ∈ {13} PACKPUSH4_i ∈ {0} PACKPUSH4_j ∈ {4} PACKPUSH4_sizeof ∈ {16} PACK16_i ∈ {0} PACK16_j ∈ {4} PACK16_sizeof ∈ {16} PACKPOP_i ∈ {0} PACKPOP_j ∈ {1} PACKPOP_sizeof ∈ {13} PACKPUSH_i ∈ {0} PACKPUSH_j ∈ {1} PACKPUSH_sizeof ∈ {13} PACK2_i ∈ {0} PACK2_j ∈ {2} PACK2_sizeof ∈ {14} PACKDEF_i ∈ {0} PACKDEF_j ∈ {4} PACKDEF_sizeof ∈ {16} PACKPOPAGAIN_i ∈ {0} PACKPOPAGAIN_j ∈ {1} PACKPOPAGAIN_sizeof ∈ {13} PACKOVERPOP_i ∈ {0} PACKOVERPOP_j ∈ {1} PACKOVERPOP_sizeof ∈ {13} PACK8_ATTR_i ∈ {0} PACK8_ATTR_j ∈ {1} PACK8_ATTR_sizeof ∈ {16} PACK1_ATTR_i ∈ {0} PACK1_ATTR_j ∈ {1} PACK1_ATTR_sizeof ∈ {13} PACKPUSH4_ATTR_i ∈ {0} PACKPUSH4_ATTR_j ∈ {1} PACKPUSH4_ATTR_sizeof ∈ {16} PACK16_ATTR_i ∈ {0} PACK16_ATTR_j ∈ {1} PACK16_ATTR_sizeof ∈ {16} PACK2_ATTR_i ∈ {0} PACK2_ATTR_j ∈ {1} PACK2_ATTR_sizeof ∈ {14} [eva:final-states] Values at end of function tests2: test1_i ∈ {0} test1_j ∈ {2} test1_k ∈ {4} test1_l ∈ {16} test1_sizeof ∈ {20} emul1_i ∈ {0} emul1_j ∈ {2} emul1_k ∈ {4} emul1_l ∈ {16} emul1_sizeof ∈ {20} test2_i ∈ {0} test2_j ∈ {1} test2_k ∈ {2} test2_l ∈ {14} test2_sizeof ∈ {15} emul2_i ∈ {0} emul2_j ∈ {1} emul2_k ∈ {2} emul2_l ∈ {14} emul2_sizeof ∈ {15} test3_i ∈ {0} test3_j ∈ {1} test3_k ∈ {2} test3_l ∈ {14} test3_sizeof ∈ {15} emul3_i ∈ {0} emul3_j ∈ {1} emul3_k ∈ {2} emul3_l ∈ {14} emul3_sizeof ∈ {15} test4_i ∈ {0} test4_j ∈ {2} test4_k ∈ {3} test4_l ∈ {15} test4_sizeof ∈ {16} emul4_i ∈ {0} emul4_j ∈ {2} emul4_k ∈ {3} emul4_l ∈ {15} emul4_sizeof ∈ {16} test5_i ∈ {0} test5_j ∈ {2} test5_k ∈ {3} test5_l ∈ {15} test5_sizeof ∈ {16} emul5_i ∈ {0} emul5_j ∈ {2} emul5_k ∈ {3} emul5_l ∈ {15} emul5_sizeof ∈ {16} test6_i ∈ {0} test6_j ∈ {2} test6_k ∈ {3} test6_l ∈ {15} test6_sizeof ∈ {16} emul6_i ∈ {0} emul6_j ∈ {2} emul6_k ∈ {3} emul6_l ∈ {15} emul6_sizeof ∈ {16} test7_i ∈ {0} test7_j ∈ {2} test7_k ∈ {10} test7_l ∈ {22} test7_sizeof ∈ {24} emul7_i ∈ {0} emul7_j ∈ {2} emul7_k ∈ {10} emul7_l ∈ {22} emul7_sizeof ∈ {24} test7_2_i ∈ {0} test7_2_j ∈ {24} test7_2_k ∈ {26} test7_2_l ∈ {38} test7_2_sizeof ∈ {62} emul7_2_i ∈ {0} emul7_2_j ∈ {24} emul7_2_k ∈ {26} emul7_2_l ∈ {38} emul7_2_sizeof ∈ {62} test8_i ∈ {0} test8_j ∈ {4} test8_k ∈ {8} test8_l ∈ {10} test8_sizeof ∈ {16} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function tests1 [from] Done for function tests1 [from] Computing for function tests2 [from] Done for function tests2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function tests1: NO EFFECTS [from] Function tests2: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function tests1: S_i; S_j; S_sizeof; PACK8_i; PACK8_j; PACK8_sizeof; PACK1_i; PACK1_j; PACK1_sizeof; PACKPUSH4_i; PACKPUSH4_j; PACKPUSH4_sizeof; PACK16_i; PACK16_j; PACK16_sizeof; PACKPOP_i; PACKPOP_j; PACKPOP_sizeof; PACKPUSH_i; PACKPUSH_j; PACKPUSH_sizeof; PACK2_i; PACK2_j; PACK2_sizeof; PACKDEF_i; PACKDEF_j; PACKDEF_sizeof; PACKPOPAGAIN_i; PACKPOPAGAIN_j; PACKPOPAGAIN_sizeof; PACKOVERPOP_i; PACKOVERPOP_j; PACKOVERPOP_sizeof; PACK8_ATTR_i; PACK8_ATTR_j; PACK8_ATTR_sizeof; PACK1_ATTR_i; PACK1_ATTR_j; PACK1_ATTR_sizeof; PACKPUSH4_ATTR_i; PACKPUSH4_ATTR_j; PACKPUSH4_ATTR_sizeof; PACK16_ATTR_i; PACK16_ATTR_j; PACK16_ATTR_sizeof; PACK2_ATTR_i; PACK2_ATTR_j; PACK2_ATTR_sizeof [inout] Inputs for function tests1: \nothing [inout] Out (internal) for function tests2: test1_i; test1_j; test1_k; test1_l; test1_sizeof; emul1_i; emul1_j; emul1_k; emul1_l; emul1_sizeof; test2_i; test2_j; test2_k; test2_l; test2_sizeof; emul2_i; emul2_j; emul2_k; emul2_l; emul2_sizeof; test3_i; test3_j; test3_k; test3_l; test3_sizeof; emul3_i; emul3_j; emul3_k; emul3_l; emul3_sizeof; test4_i; test4_j; test4_k; test4_l; test4_sizeof; emul4_i; emul4_j; emul4_k; emul4_l; emul4_sizeof; test5_i; test5_j; test5_k; test5_l; test5_sizeof; emul5_i; emul5_j; emul5_k; emul5_l; emul5_sizeof; test6_i; test6_j; test6_k; test6_l; test6_sizeof; emul6_i; emul6_j; emul6_k; emul6_l; emul6_sizeof; test7_i; test7_j; test7_k; test7_l; test7_sizeof; emul7_i; emul7_j; emul7_k; emul7_l; emul7_sizeof; test7_2_i; test7_2_j; test7_2_k; test7_2_l; test7_2_sizeof; emul7_2_i; emul7_2_j; emul7_2_k; emul7_2_l; emul7_2_sizeof; test8_i; test8_j; test8_k; test8_l; test8_sizeof [inout] Inputs for function tests2: \nothing [inout] Out (internal) for function main: __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/misc/oracle/pragma-pack.2.res.oracle0000666000000000000000000001371513571573400021066 0ustar [kernel] Parsing tests/misc/pragma-pack.c (with preprocessing) [kernel] tests/misc/pragma-pack.c:87: Warning: ignoring #pragma pack(pop) with empty stack [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function tests1 <- main. Called from tests/misc/pragma-pack.c:38. [eva] Recording results for tests1 [eva] Done for function tests1 [eva] computing for function tests2 <- main. Called from tests/misc/pragma-pack.c:38. [eva] Recording results for tests2 [eva] Done for function tests2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function tests1: S_i ∈ {0} S_j ∈ {8} S_sizeof ∈ {16} PACK8_i ∈ {0} PACK8_j ∈ {8} PACK8_sizeof ∈ {16} PACK1_i ∈ {0} PACK1_j ∈ {1} PACK1_sizeof ∈ {9} PACKPUSH4_i ∈ {0} PACKPUSH4_j ∈ {4} PACKPUSH4_sizeof ∈ {12} PACK16_i ∈ {0} PACK16_j ∈ {8} PACK16_sizeof ∈ {16} PACKPOP_i ∈ {0} PACKPOP_j ∈ {1} PACKPOP_sizeof ∈ {9} PACKPUSH_i ∈ {0} PACKPUSH_j ∈ {1} PACKPUSH_sizeof ∈ {9} PACK2_i ∈ {0} PACK2_j ∈ {2} PACK2_sizeof ∈ {10} PACKDEF_i ∈ {0} PACKDEF_j ∈ {8} PACKDEF_sizeof ∈ {16} PACKPOPAGAIN_i ∈ {0} PACKPOPAGAIN_j ∈ {1} PACKPOPAGAIN_sizeof ∈ {9} PACKOVERPOP_i ∈ {0} PACKOVERPOP_j ∈ {1} PACKOVERPOP_sizeof ∈ {9} PACK8_ATTR_i ∈ {0} PACK8_ATTR_j ∈ {8} PACK8_ATTR_sizeof ∈ {16} PACK1_ATTR_i ∈ {0} PACK1_ATTR_j ∈ {8} PACK1_ATTR_sizeof ∈ {16} PACKPUSH4_ATTR_i ∈ {0} PACKPUSH4_ATTR_j ∈ {8} PACKPUSH4_ATTR_sizeof ∈ {16} PACK16_ATTR_i ∈ {0} PACK16_ATTR_j ∈ {8} PACK16_ATTR_sizeof ∈ {16} PACK2_ATTR_i ∈ {0} PACK2_ATTR_j ∈ {8} PACK2_ATTR_sizeof ∈ {16} [eva:final-states] Values at end of function tests2: test1_i ∈ {0} test1_j ∈ {1} test1_k ∈ {4} test1_l ∈ {12} test1_sizeof ∈ {16} emul1_i ∈ {0} emul1_j ∈ {1} emul1_k ∈ {8} emul1_l ∈ {16} emul1_sizeof ∈ {24} test2_i ∈ {0} test2_j ∈ {1} test2_k ∈ {2} test2_l ∈ {10} test2_sizeof ∈ {11} emul2_i ∈ {0} emul2_j ∈ {1} emul2_k ∈ {8} emul2_l ∈ {16} emul2_sizeof ∈ {24} test3_i ∈ {0} test3_j ∈ {1} test3_k ∈ {4} test3_l ∈ {12} test3_sizeof ∈ {16} emul3_i ∈ {0} emul3_j ∈ {1} emul3_k ∈ {8} emul3_l ∈ {16} emul3_sizeof ∈ {24} test4_i ∈ {0} test4_j ∈ {1} test4_k ∈ {2} test4_l ∈ {10} test4_sizeof ∈ {12} emul4_i ∈ {0} emul4_j ∈ {1} emul4_k ∈ {8} emul4_l ∈ {16} emul4_sizeof ∈ {24} test5_i ∈ {0} test5_j ∈ {1} test5_k ∈ {2} test5_l ∈ {10} test5_sizeof ∈ {12} emul5_i ∈ {0} emul5_j ∈ {1} emul5_k ∈ {8} emul5_l ∈ {16} emul5_sizeof ∈ {24} test6_i ∈ {0} test6_j ∈ {1} test6_k ∈ {2} test6_l ∈ {10} test6_sizeof ∈ {12} emul6_i ∈ {0} emul6_j ∈ {1} emul6_k ∈ {8} emul6_l ∈ {16} emul6_sizeof ∈ {24} test7_i ∈ {0} test7_j ∈ {2} test7_k ∈ {10} test7_l ∈ {18} test7_sizeof ∈ {20} emul7_i ∈ {0} emul7_j ∈ {4} emul7_k ∈ {16} emul7_l ∈ {24} emul7_sizeof ∈ {32} test7_2_i ∈ {0} test7_2_j ∈ {20} test7_2_k ∈ {22} test7_2_l ∈ {30} test7_2_sizeof ∈ {50} emul7_2_i ∈ {0} emul7_2_j ∈ {32} emul7_2_k ∈ {40} emul7_2_l ∈ {48} emul7_2_sizeof ∈ {80} test8_i ∈ {0} test8_j ∈ {4} test8_k ∈ {8} test8_l ∈ {12} test8_sizeof ∈ {16} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function tests1 [from] Done for function tests1 [from] Computing for function tests2 [from] Done for function tests2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function tests1: NO EFFECTS [from] Function tests2: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function tests1: S_i; S_j; S_sizeof; PACK8_i; PACK8_j; PACK8_sizeof; PACK1_i; PACK1_j; PACK1_sizeof; PACKPUSH4_i; PACKPUSH4_j; PACKPUSH4_sizeof; PACK16_i; PACK16_j; PACK16_sizeof; PACKPOP_i; PACKPOP_j; PACKPOP_sizeof; PACKPUSH_i; PACKPUSH_j; PACKPUSH_sizeof; PACK2_i; PACK2_j; PACK2_sizeof; PACKDEF_i; PACKDEF_j; PACKDEF_sizeof; PACKPOPAGAIN_i; PACKPOPAGAIN_j; PACKPOPAGAIN_sizeof; PACKOVERPOP_i; PACKOVERPOP_j; PACKOVERPOP_sizeof; PACK8_ATTR_i; PACK8_ATTR_j; PACK8_ATTR_sizeof; PACK1_ATTR_i; PACK1_ATTR_j; PACK1_ATTR_sizeof; PACKPUSH4_ATTR_i; PACKPUSH4_ATTR_j; PACKPUSH4_ATTR_sizeof; PACK16_ATTR_i; PACK16_ATTR_j; PACK16_ATTR_sizeof; PACK2_ATTR_i; PACK2_ATTR_j; PACK2_ATTR_sizeof [inout] Inputs for function tests1: \nothing [inout] Out (internal) for function tests2: test1_i; test1_j; test1_k; test1_l; test1_sizeof; emul1_i; emul1_j; emul1_k; emul1_l; emul1_sizeof; test2_i; test2_j; test2_k; test2_l; test2_sizeof; emul2_i; emul2_j; emul2_k; emul2_l; emul2_sizeof; test3_i; test3_j; test3_k; test3_l; test3_sizeof; emul3_i; emul3_j; emul3_k; emul3_l; emul3_sizeof; test4_i; test4_j; test4_k; test4_l; test4_sizeof; emul4_i; emul4_j; emul4_k; emul4_l; emul4_sizeof; test5_i; test5_j; test5_k; test5_l; test5_sizeof; emul5_i; emul5_j; emul5_k; emul5_l; emul5_sizeof; test6_i; test6_j; test6_k; test6_l; test6_sizeof; emul6_i; emul6_j; emul6_k; emul6_l; emul6_sizeof; test7_i; test7_j; test7_k; test7_l; test7_sizeof; emul7_i; emul7_j; emul7_k; emul7_l; emul7_sizeof; test7_2_i; test7_2_j; test7_2_k; test7_2_l; test7_2_sizeof; emul7_2_i; emul7_2_j; emul7_2_k; emul7_2_l; emul7_2_sizeof; test8_i; test8_j; test8_k; test8_l; test8_sizeof [inout] Inputs for function tests2: \nothing [inout] Out (internal) for function main: __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/misc/oracle/pragma_pack_zero.0.res.oracle0000666000000000000000000000205113571573400022174 0ustar [kernel] Parsing tests/misc/pragma_pack_zero.c (with preprocessing) [kernel] tests/misc/pragma_pack_zero.c:35: Warning: GCC accepts pack(0) but does not specify its behavior; considering it equivalent to pack() [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: z1 ∈ {8} o1 ∈ {4} z2 ∈ {5} o2 ∈ {1} z3 ∈ {6} o3 ∈ {2} z4 ∈ {8} o4 ∈ {4} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: z1; o1; z2; o2; z3; o3; z4; o4; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/misc/oracle/pragma_pack_zero.1.res.oracle0000666000000000000000000000176513571573400022210 0ustar [kernel] Parsing tests/misc/pragma_pack_zero.c (with preprocessing) [kernel] tests/misc/pragma_pack_zero.c:35: Warning: ignoring invalid packing alignment (0) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: z1 ∈ {8} o1 ∈ {4} z2 ∈ {5} o2 ∈ {1} z3 ∈ {6} o3 ∈ {2} z4 ∈ {6} o4 ∈ {2} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: z1; o1; z2; o2; z3; o3; z4; o4; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/misc/oracle/print_machdep.res.oracle0000666000000000000000000000154513571573400021356 0ustar Machine: gcc 4.0.3 - X86-32bits mode sizeof short = 2 (16 bits, aligned on 16 bits) sizeof int = 4 (32 bits, aligned on 32 bits) sizeof long = 4 (32 bits, aligned on 32 bits) sizeof long long = 8 (64 bits, aligned on 32 bits) sizeof float = 4 (32 bits, aligned on 32 bits) sizeof double = 8 (64 bits, aligned on 32 bits) sizeof long double = 12 (96 bits, aligned on 32 bits) sizeof pointer = 4 (32 bits, aligned on 32 bits) sizeof void = 1 (8 bits, aligned on 8 bits) sizeof function = error (alignof error) typeof sizeof(T) = unsigned int typeof wchar_t = int typeof ptrdiff_t = int char is signed machine is little endian strings are const chars assembly names have no leading '_' compiler has builtin __va_list compiler uses __head as a keyword frama-c-20.0-Calcium/tests/misc/oracle/remove_status_hyps.res.oracle0000666000000000000000000000134513571573400022502 0ustar [kernel] Parsing tests/misc/remove_status_hyps.i (no preprocessing) [rsh] initial statuses [rsh] assert P1: \true;: unknown (hyps: ) [rsh] assert P2: \true;: unknown (hyps: assert P1: \true;) [rsh] assert P3: \true;: unknown (hyps: ) [rsh] assert P4: \true;: unknown (hyps: assert P3: \true;assert P2: \true; assert P1: \true;) [rsh] P4 only depends on P2 [rsh] assert P1: \true;: unknown (hyps: ) [rsh] assert P2: \true;: unknown (hyps: assert P1: \true;) [rsh] assert P3: \true;: unknown (hyps: ) [rsh] assert P4: \true;: VALID (hyps: assert P2: \true;) [rsh] removing P1 [rsh] assert P2: \true;: no try [rsh] assert P3: \true;: unknown (hyps: ) [rsh] assert P4: \true;: VALID (hyps: assert P2: \true;) frama-c-20.0-Calcium/tests/misc/oracle/save_comments.res.oracle0000666000000000000000000000226713571573400021406 0ustar [kernel] Parsing tests/misc/save_comments.i (no preprocessing) Printing default project first time: /* Generated by Frama-C */ /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -keep-comments */ int f(void) { int x = 0; /* Hello, I'm the f function */ return x; } Printing default project second time: /* Generated by Frama-C */ /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -keep-comments */ int f(void) { int x = 0; /* Hello, I'm the f function */ return x; } In project default, searching for comments between tests/misc/save_comments.i:6 and tests/misc/save_comments.i:9: Hello, I'm the f function End of comments In project saved_project, searching for comments between tests/misc/save_comments.i:6 and tests/misc/save_comments.i:9: Hello, I'm the f function End of comments Printing saved project: /* Generated by Frama-C */ /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -keep-comments */ int f(void) { int x = 0; /* Hello, I'm the f function */ return x; } frama-c-20.0-Calcium/tests/misc/oracle/static.res.oracle0000666000000000000000000000040613571573400020023 0ustar [kernel] Parsing tests/misc/static.i (no preprocessing) /* Generated by Frama-C */ int x; int f(void); static int f_x = 0; int f(void) { f_x ++; return f_x; } int g(void) { int x_0 = 0; x_0 ++; return x_0; } int main(void) { x ++; return x; } frama-c-20.0-Calcium/tests/misc/oracle/stdint.0.res.oracle0000666000000000000000000000153113571573400020177 0ustar [kernel] Parsing tests/misc/stdint.i (no preprocessing) [kernel] tests/misc/stdint.i:10: Warning: bad type 'int' (16 bits) for typedef 'int8_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:11: Warning: bad type 'unsigned char' (8 bits) for typedef 'uint_least64_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:12: Warning: bad type 'short' (16 bits) for typedef 'int_fast32_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:13: Warning: bad type 'char' (8 bits) for typedef 'intptr_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:14: Warning: bad type 'unsigned short' (16 bits) for typedef 'uintmax_t'; check for mismatch between -machdep flag and headers used frama-c-20.0-Calcium/tests/misc/oracle/stdint.1.res.oracle0000666000000000000000000000153113571573400020200 0ustar [kernel] Parsing tests/misc/stdint.i (no preprocessing) [kernel] tests/misc/stdint.i:10: Warning: bad type 'int' (32 bits) for typedef 'int8_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:11: Warning: bad type 'unsigned char' (8 bits) for typedef 'uint_least64_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:12: Warning: bad type 'short' (16 bits) for typedef 'int_fast32_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:13: Warning: bad type 'char' (8 bits) for typedef 'intptr_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:14: Warning: bad type 'unsigned short' (16 bits) for typedef 'uintmax_t'; check for mismatch between -machdep flag and headers used frama-c-20.0-Calcium/tests/misc/oracle/stdint.2.res.oracle0000666000000000000000000000153113571573400020201 0ustar [kernel] Parsing tests/misc/stdint.i (no preprocessing) [kernel] tests/misc/stdint.i:10: Warning: bad type 'int' (32 bits) for typedef 'int8_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:11: Warning: bad type 'unsigned char' (8 bits) for typedef 'uint_least64_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:12: Warning: bad type 'short' (16 bits) for typedef 'int_fast32_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:13: Warning: bad type 'char' (8 bits) for typedef 'intptr_t'; check for mismatch between -machdep flag and headers used [kernel] tests/misc/stdint.i:14: Warning: bad type 'unsigned short' (16 bits) for typedef 'uintmax_t'; check for mismatch between -machdep flag and headers used frama-c-20.0-Calcium/tests/misc/oracle/test_datatype.res.oracle0000666000000000000000000000010413571573400021401 0ustar [kernel] Parsing tests/misc/test_datatype.i (no preprocessing) here frama-c-20.0-Calcium/tests/misc/oracle/version.res.oracle0000666000000000000000000000013013571573400020213 0ustar [kernel] Parsing tests/misc/version.i (no preprocessing) [kernel] version numbers match frama-c-20.0-Calcium/tests/misc/oracle/vis_queueInstr.res.oracle0000666000000000000000000000060313571573400021560 0ustar [kernel] Parsing tests/misc/vis_queueInstr.i (no preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; int i = 0; __retres = 0; return __retres; } /* Generated by Frama-C */ int main(void) { int __retres; __asm__ ("dummy statement!!"); int i = 0; __asm__ ("dummy statement!!"); __retres = 0; __asm__ ("dummy statement!!"); return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/vis_spec.res.oracle0000666000000000000000000000044313571573400020350 0ustar [kernel] Parsing tests/misc/vis_spec.i (no preprocessing) Starting visit Considering spec of function g Function prototype; Funspec is 'assigns \nothing;' Considering spec of function f Funspec of f is 'assigns \nothing;' through visitor It is 'assigns \nothing;' through get_spec End visit frama-c-20.0-Calcium/tests/misc/oracle/visitor_creates_func_bts_1349.res.oracle0000666000000000000000000000024413571573400024304 0ustar [kernel] Parsing tests/misc/visitor_creates_func_bts_1349.i (no preprocessing) /* Generated by Frama-C */ int a = 10; int f(int x); int f(int x) { return x; } frama-c-20.0-Calcium/tests/misc/oracle/well_typed_alarm.res.oracle0000666000000000000000000000254713571573400022070 0ustar [kernel] Parsing tests/misc/well_typed_alarm.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/misc/well_typed_alarm.i:11: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)q); [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 10 statements reached (out of 10): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 1 alarm generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- /* Generated by Frama-C */ int main(int c) { int __retres; int x = 0; int y = 0; int *p = & x; int *q = & y; if (c) q = & x; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)p, (void *)q); */ if (p <= q) x ++; __retres = *q; return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/widen_hints.0.res.oracle0000666000000000000000000000117713571573400021213 0ustar [kernel] Parsing tests/misc/widen_hints.c (with preprocessing) [kernel:annot-error] tests/misc/widen_hints.c:14: Warning: invalid widen_hints annotation: no hints. Ignoring code annotation [kernel:annot-error] tests/misc/widen_hints.c:19: Warning: invalid widen_hints annotation: no hints. Ignoring code annotation [kernel:annot-error] tests/misc/widen_hints.c:24: Warning: unbound logic variable b. Ignoring code annotation [eva] tests/misc/widen_hints.c:29: User Error: could not parse widening hint: not_const If it contains variables, they must be global const integers. [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/widen_hints.1.res.oracle0000666000000000000000000000041613571573400021207 0ustar [kernel] Parsing tests/misc/widen_hints.c (with preprocessing) [eva] tests/misc/widen_hints.c:65: User Error: could not parse widening hint: local_const If it contains variables, they must be global const integers. [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/misc/oracle/widen_hints.2.res.oracle0000666000000000000000000000742213571573400021214 0ustar [kernel] Parsing tests/misc/widen_hints.c (with preprocessing) [eva:widen-hints] computing global widen hints [eva:widen-hints] tests/misc/widen_hints.c:71: adding hint from annotation: a, {87} (for all statements) [eva:widen-hints] tests/misc/widen_hints.c:87: adding hint from annotation: ss, {87} (for all statements) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {9} not_const ∈ {42} [eva:widen-hints] tests/misc/widen_hints.c:72: computing dynamic hints for statement 16 [eva] tests/misc/widen_hints.c:73: starting to merge loop iterations [eva] tests/misc/widen_hints.c:72: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints.c:88: computing dynamic hints for statement 30 [eva] tests/misc/widen_hints.c:89: starting to merge loop iterations [eva] tests/misc/widen_hints.c:88: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints.c:97: computing dynamic hints for statement 48 [eva:widen-hints] tests/misc/widen_hints.c:97: adding new base due to dynamic widen hint: ip, {87} [eva] tests/misc/widen_hints.c:98: starting to merge loop iterations [eva] tests/misc/widen_hints.c:97: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints.c:107: computing dynamic hints for statement 67 [eva:widen-hints] tests/misc/widen_hints.c:107: adding new base due to dynamic widen hint: ip2, {87} [eva] tests/misc/widen_hints.c:108: starting to merge loop iterations [eva] tests/misc/widen_hints.c:107: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints.c:118: computing dynamic hints for statement 91 [eva:widen-hints] tests/misc/widen_hints.c:118: adding new base due to dynamic widen hint: iarray, {87} [eva] tests/misc/widen_hints.c:118: starting to merge loop iterations [eva] tests/misc/widen_hints.c:116: starting to merge loop iterations [eva] computing for function using_dynamic_global <- main. Called from tests/misc/widen_hints.c:124. [eva:widen-hints] tests/misc/widen_hints.c:58: computing dynamic hints for statement 2 [eva:widen-hints] tests/misc/widen_hints.c:58: adding new base due to dynamic widen hint: outer_i, {87} [eva] Recording results for using_dynamic_global [eva] Done for function using_dynamic_global [eva] computing for function using_dynamic_global <- main. Called from tests/misc/widen_hints.c:124. [eva] Recording results for using_dynamic_global [eva] Done for function using_dynamic_global [eva] tests/misc/widen_hints.c:123: starting to merge loop iterations [eva] computing for function using_dynamic_global <- main. Called from tests/misc/widen_hints.c:124. [eva] tests/misc/widen_hints.c:58: starting to merge loop iterations [eva] Recording results for using_dynamic_global [eva] Done for function using_dynamic_global [eva] computing for function using_dynamic_global <- main. Called from tests/misc/widen_hints.c:124. [eva] Recording results for using_dynamic_global [eva] Done for function using_dynamic_global [eva] computing for function using_dynamic_global <- main. Called from tests/misc/widen_hints.c:124. [eva] Recording results for using_dynamic_global [eva] Done for function using_dynamic_global [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function using_dynamic_global: b ∈ [0..2147483647] [eva:final-states] Values at end of function main: m ∈ {10} n ∈ {43} ss.i ∈ {87} .d ∈ UNINITIALIZED ip ∈ {87} p ∈ {{ &ip }} ip2 ∈ {87} p2 ∈ {{ &ip2 }} pp ∈ {{ &p2 }} iarray[0] ∈ {0} [1].i ∈ {87} piarray[0] ∈ {{ &iarray[0] }} [1] ∈ {{ &iarray[1] }} outer_i ∈ {87} __retres ∈ {0} frama-c-20.0-Calcium/tests/misc/oracle/widen_hints.3.res.oracle0000666000000000000000000001033113571573400021206 0ustar [kernel] Parsing tests/misc/widen_hints.c (with preprocessing) [eva:widen-hints] computing global widen hints [eva:widen-hints] tests/misc/widen_hints.c:79: adding global hint from annotation: for all variables, {88} (for all statements) [eva:widen-hints] tests/misc/widen_hints.c:71: adding hint from annotation: a, {87} (for all statements) [eva:widen-hints] tests/misc/widen_hints.c:87: adding hint from annotation: ss, {87} (for all statements) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {9} not_const ∈ {42} [eva:widen-hints] tests/misc/widen_hints.c:72: computing dynamic hints for statement 36 [eva] tests/misc/widen_hints.c:72: starting to merge loop iterations [eva] tests/misc/widen_hints.c:73: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints.c:80: computing dynamic hints for statement 50 [eva] computing for function f <- main. Called from tests/misc/widen_hints.c:80. [eva] tests/misc/widen_hints.c:41: starting to merge loop iterations [eva] tests/misc/widen_hints.c:42: starting to merge loop iterations [eva] Recording results for f [eva] Done for function f [eva:widen-hints] tests/misc/widen_hints.c:88: computing dynamic hints for statement 52 [eva] tests/misc/widen_hints.c:88: starting to merge loop iterations [eva] tests/misc/widen_hints.c:89: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints.c:97: computing dynamic hints for statement 70 [eva:widen-hints] tests/misc/widen_hints.c:97: adding new base due to dynamic widen hint: ip, {87} [eva] tests/misc/widen_hints.c:97: starting to merge loop iterations [eva] tests/misc/widen_hints.c:98: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints.c:107: computing dynamic hints for statement 89 [eva:widen-hints] tests/misc/widen_hints.c:107: adding new base due to dynamic widen hint: ip2, {87} [eva] tests/misc/widen_hints.c:107: starting to merge loop iterations [eva] tests/misc/widen_hints.c:108: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints.c:118: computing dynamic hints for statement 113 [eva:widen-hints] tests/misc/widen_hints.c:118: adding new base due to dynamic widen hint: iarray, {87} [eva] tests/misc/widen_hints.c:116: starting to merge loop iterations [eva] tests/misc/widen_hints.c:118: starting to merge loop iterations [eva] computing for function using_dynamic_global <- main. Called from tests/misc/widen_hints.c:124. [eva:widen-hints] tests/misc/widen_hints.c:58: computing dynamic hints for statement 22 [eva:widen-hints] tests/misc/widen_hints.c:58: adding new base due to dynamic widen hint: outer_i, {87} [eva] Recording results for using_dynamic_global [eva] Done for function using_dynamic_global [eva] tests/misc/widen_hints.c:123: starting to merge loop iterations [eva] computing for function using_dynamic_global <- main. Called from tests/misc/widen_hints.c:124. [eva] tests/misc/widen_hints.c:58: starting to merge loop iterations [eva] Recording results for using_dynamic_global [eva] Done for function using_dynamic_global [eva] computing for function using_dynamic_global <- main. Called from tests/misc/widen_hints.c:124. [eva] Recording results for using_dynamic_global [eva] Done for function using_dynamic_global [eva] computing for function using_dynamic_global <- main. Called from tests/misc/widen_hints.c:124. [eva] Recording results for using_dynamic_global [eva] Done for function using_dynamic_global [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: m ∈ {10} n ∈ {43} t[0..85] ∈ {1} or UNINITIALIZED [86..99] ∈ UNINITIALIZED __retres ∈ {0} [eva:final-states] Values at end of function using_dynamic_global: b ∈ [0..88] [eva:final-states] Values at end of function main: m ∈ {10} n ∈ {43} ss.i ∈ {87} .d ∈ UNINITIALIZED ip ∈ {87} p ∈ {{ &ip }} ip2 ∈ {87} p2 ∈ {{ &ip2 }} pp ∈ {{ &p2 }} iarray[0] ∈ {0} [1].i ∈ {87} piarray[0] ∈ {{ &iarray[0] }} [1] ∈ {{ &iarray[1] }} outer_i ∈ {87} __retres ∈ {0} frama-c-20.0-Calcium/tests/misc/oracle/widen_hints2.0.res.oracle0000666000000000000000000001120013571573400021261 0ustar [kernel] Parsing tests/misc/widen_hints2.c (with preprocessing) [eva:widen-hints] computing global widen hints [eva:widen-hints] tests/misc/widen_hints2.c:46: adding global hint from annotation: m, {2} (for all statements) [eva:widen-hints] tests/misc/widen_hints2.c:60: adding global hint from annotation: y_0, {2} (for all statements) [eva:widen-hints] tests/misc/widen_hints2.c:20: adding hint from annotation: for all variables, {88} (for all statements) [eva:widen-hints] tests/misc/widen_hints2.c:47: adding hint from annotation: y_0, {5} (for all statements) [eva:widen-hints] tests/misc/widen_hints2.c:49: adding hint from annotation: a, {2} (for all statements) [eva:widen-hints] tests/misc/widen_hints2.c:51: adding hint from annotation: a, {88} (for all statements) [eva:widen-hints] tests/misc/widen_hints2.c:57: adding hint from annotation: c, {88} (for all statements) [eva:widen-hints] tests/misc/widen_hints2.c:58: adding hint from annotation: y_0, {1} (for all statements) [eva:widen-hints] tests/misc/widen_hints2.c:70: adding hint from annotation: c_0, {88} (for all statements) [eva:widen-hints] tests/misc/widen_hints2.c:78: adding hint from annotation: glob, {88} (for all statements) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..99] ∈ {0} x ∈ {9} glob ∈ {0} y ∈ {0} [eva:widen-hints] tests/misc/widen_hints2.c:48: computing dynamic hints for statement 43 [eva:widen-hints] tests/misc/widen_hints2.c:48: computing dynamic hints for statement 45 [eva:widen-hints] tests/misc/widen_hints2.c:50: computing dynamic hints for statement 48 [eva:widen-hints] tests/misc/widen_hints2.c:52: computing dynamic hints for statement 54 [eva] tests/misc/widen_hints2.c:50: starting to merge loop iterations [eva] tests/misc/widen_hints2.c:52: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints2.c:63: computing dynamic hints for statement 66 [eva] tests/misc/widen_hints2.c:63: starting to merge loop iterations [eva] tests/misc/widen_hints2.c:64: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints2.c:72: computing dynamic hints for statement 82 [eva] tests/misc/widen_hints2.c:72: starting to merge loop iterations [eva] tests/misc/widen_hints2.c:73: starting to merge loop iterations [eva:widen-hints] tests/misc/widen_hints2.c:79: computing dynamic hints for statement 97 [eva] tests/misc/widen_hints2.c:79: starting to merge loop iterations [eva] tests/misc/widen_hints2.c:80: starting to merge loop iterations [eva] computing for function f <- main. Called from tests/misc/widen_hints2.c:85. [eva:widen-hints] tests/misc/widen_hints2.c:22: computing dynamic hints for statement 4 [eva] tests/misc/widen_hints2.c:22: starting to merge loop iterations [eva] tests/misc/widen_hints2.c:23: starting to merge loop iterations [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/misc/widen_hints2.c:86. [eva] tests/misc/widen_hints2.c:34: starting to merge loop iterations [eva] tests/misc/widen_hints2.c:35: starting to merge loop iterations [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: tf[0..85] ∈ {1} or UNINITIALIZED [86..99] ∈ UNINITIALIZED m ∈ {10} n ∈ {43} [eva:final-states] Values at end of function g: tg[0..85] ∈ {1} or UNINITIALIZED [86..99] ∈ UNINITIALIZED m ∈ {10} n ∈ {43} [eva:final-states] Values at end of function main: t[0..85] ∈ {0; 1} [86..99] ∈ {0} glob ∈ {87; 88} m ∈ {10} n ∈ {43} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NO EFFECTS [from] Function g: NO EFFECTS [from] Function main: t[0..85] FROM \nothing (and SELF) glob FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: tf[0..85]; m; n; a; b [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: tg[0..85]; m; n; ll; kk [inout] Inputs for function g: \nothing [inout] Out (internal) for function main: t[0..85]; glob; m; n; a; b; c; d; c_0; d_0; j; __retres [inout] Inputs for function main: glob frama-c-20.0-Calcium/tests/misc/oracle/widen_hints2.1.res.oracle0000666000000000000000000000352513571573400021275 0ustar [kernel] Parsing tests/misc/widen_hints2.c (with preprocessing) /* Generated by Frama-C */ #include "stdlib.h" int t[100]; int const x = 9; int glob; void f(void) { int tf[100]; int m = 10; int n = 33 + m; /*@ widen_hints "all", 88; */ { int a = 0; while (a < n * 2 + 1) { { int b = 0; while (b < a) { tf[b] = 1; b ++; } } a ++; } } return; } void g(void) { int tg[100]; int m = 10; int n = 33 + m; { int ll = 0; while (ll < n * 2 + 1) { { int kk = 0; while (kk < ll) { tg[kk] = 1; kk ++; } } ll ++; } } return; } int y; int main(void) { int __retres; int y_0; int m = 10; /*@ widen_hints global:m, 2; */ /*@ widen_hints y_0, 5; */ int n = 33 + m; { int a = 0; /*@ loop widen_hints a, 2; */ while (a < n * 2 + 1) { /*@ widen_hints a, 88; */ { int b = 0; while (b < a) { t[b] = 1; b ++; } } a ++; } } { int c = 0; /*@ loop widen_hints c, 88; loop widen_hints y_0, 1; loop widen_hints global:y_0, 2; */ while (c < n * 2 + 1) { { int d = 0; while (d < c) { t[d] = 1; d ++; } } c ++; } } { int c_0 = 0; /*@ loop widen_hints c_0, 88; */ while (c_0 < n * 2 + 1) { { int d_0 = 0; while (d_0 < c_0) { t[d_0] = 1; d_0 ++; } } c_0 ++; } } /*@ widen_hints glob, 88; */ { glob = 0; while (glob < n * 2 + 1) { { int j = 0; while (j < glob) { t[j] = 1; j ++; } } glob ++; } } f(); g(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/misc/oracle/widen_hints_float.res.oracle0000666000000000000000000002424313571573400022241 0ustar [kernel] Parsing tests/misc/widen_hints_float.c (with preprocessing) [kernel:parser:decimal-float] tests/misc/widen_hints_float.c:42: Warning: Floating-point constant 0.01 is not represented exactly. Will use 0x1.47ae147ae147bp-7. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function parabola <- main. Called from tests/misc/widen_hints_float.c:70. [eva] computing for function Frama_C_double_interval <- parabola <- main. Called from tests/misc/widen_hints_float.c:17. [eva] using specification for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:17: function Frama_C_double_interval: precondition 'finite' got status valid. [eva] tests/misc/widen_hints_float.c:17: function Frama_C_double_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:20: starting to merge loop iterations [eva] computing for function Frama_C_double_interval <- parabola <- main. Called from tests/misc/widen_hints_float.c:24. [eva] tests/misc/widen_hints_float.c:24: function Frama_C_double_interval: precondition 'finite' got status valid. [eva] tests/misc/widen_hints_float.c:24: function Frama_C_double_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:27: starting to merge loop iterations [eva] computing for function Frama_C_double_interval <- parabola <- main. Called from tests/misc/widen_hints_float.c:31. [eva] tests/misc/widen_hints_float.c:31: function Frama_C_double_interval: precondition 'finite' got status valid. [eva] tests/misc/widen_hints_float.c:31: function Frama_C_double_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:33: starting to merge loop iterations [eva:alarm] tests/misc/widen_hints_float.c:34: Warning: non-finite double value. assert \is_finite((double)((double)(f3 - (double)64) * (double)(f3 - (double)64))); [eva] Recording results for parabola [eva] Done for function parabola [eva] computing for function trigo <- main. Called from tests/misc/widen_hints_float.c:71. [eva] computing for function Frama_C_double_interval <- trigo <- main. Called from tests/misc/widen_hints_float.c:42. [eva] tests/misc/widen_hints_float.c:42: function Frama_C_double_interval: precondition 'finite' got status valid. [eva] tests/misc/widen_hints_float.c:42: function Frama_C_double_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:42: Call to builtin sin [eva] tests/misc/widen_hints_float.c:42: function sin: precondition 'finite_arg' got status valid. [eva] tests/misc/widen_hints_float.c:41: starting to merge loop iterations [eva] computing for function Frama_C_double_interval <- trigo <- main. Called from tests/misc/widen_hints_float.c:42. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:42: Call to builtin sin [eva] computing for function Frama_C_double_interval <- trigo <- main. Called from tests/misc/widen_hints_float.c:42. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:42: Call to builtin sin [eva] computing for function Frama_C_double_interval <- trigo <- main. Called from tests/misc/widen_hints_float.c:42. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:42: Call to builtin sin [eva] computing for function Frama_C_double_interval <- trigo <- main. Called from tests/misc/widen_hints_float.c:42. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:42: Call to builtin sin [eva] computing for function Frama_C_double_interval <- trigo <- main. Called from tests/misc/widen_hints_float.c:42. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:42: Call to builtin sin [eva] Recording results for trigo [eva] Done for function trigo [eva] computing for function first_order_filter <- main. Called from tests/misc/widen_hints_float.c:72. [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:49. [eva] tests/misc/widen_hints_float.c:49: function Frama_C_double_interval: precondition 'finite' got status valid. [eva] tests/misc/widen_hints_float.c:49: function Frama_C_double_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:48: starting to merge loop iterations [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:49. [eva] Done for function Frama_C_double_interval [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:49. [eva] Done for function Frama_C_double_interval [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:49. [eva] Done for function Frama_C_double_interval [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:49. [eva] Done for function Frama_C_double_interval [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:49. [eva] Done for function Frama_C_double_interval [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:54. [eva] tests/misc/widen_hints_float.c:54: function Frama_C_double_interval: precondition 'finite' got status valid. [eva] tests/misc/widen_hints_float.c:54: function Frama_C_double_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_double_interval [eva] tests/misc/widen_hints_float.c:53: starting to merge loop iterations [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:54. [eva] Done for function Frama_C_double_interval [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:54. [eva] Done for function Frama_C_double_interval [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:54. [eva] Done for function Frama_C_double_interval [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:54. [eva] Done for function Frama_C_double_interval [eva] computing for function Frama_C_double_interval <- first_order_filter <- main. Called from tests/misc/widen_hints_float.c:54. [eva] Done for function Frama_C_double_interval [eva] Recording results for first_order_filter [eva] Done for function first_order_filter [eva] computing for function newton_sqrt <- main. Called from tests/misc/widen_hints_float.c:73. [eva] tests/misc/widen_hints_float.c:59: starting to merge loop iterations [eva] tests/misc/widen_hints_float.c:64: starting to merge loop iterations [eva] Recording results for newton_sqrt [eva] Done for function newton_sqrt [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function first_order_filter: Frama_C_entropy_source ∈ [--..--] f1 ∈ [-10. .. 10.] f2 ∈ [-5. .. 5.] [eva:final-states] Values at end of function newton_sqrt: f1 ∈ [1. .. 2.] f2 ∈ [1.4 .. 2.] [eva:final-states] Values at end of function parabola: Frama_C_entropy_source ∈ [--..--] f1 ∈ [-0. .. 71.] f2 ∈ [-80. .. 0.] f3 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] [eva:final-states] Values at end of function trigo: Frama_C_entropy_source ∈ [--..--] f1 ∈ [-1. .. 1.] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] [from] Computing for function first_order_filter [from] Computing for function Frama_C_double_interval <-first_order_filter [from] Done for function Frama_C_double_interval [from] Done for function first_order_filter [from] Computing for function newton_sqrt [from] Done for function newton_sqrt [from] Computing for function parabola [from] Done for function parabola [from] Computing for function trigo [from] Computing for function sin <-trigo [from] Done for function sin [from] Done for function trigo [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_double_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function first_order_filter: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function newton_sqrt: NO EFFECTS [from] Function parabola: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function sin: \result FROM x [from] Function trigo: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function first_order_filter: Frama_C_entropy_source; f1; i; tmp; f2; i_0; tmp_0 [inout] Inputs for function first_order_filter: Frama_C_entropy_source [inout] Out (internal) for function newton_sqrt: f1; i; f2; i_0 [inout] Inputs for function newton_sqrt: \nothing [inout] Out (internal) for function parabola: Frama_C_entropy_source; f1; i; f2; i_0; f3; i_1 [inout] Inputs for function parabola: Frama_C_entropy_source [inout] Out (internal) for function trigo: Frama_C_entropy_source; f1; i; tmp [inout] Inputs for function trigo: Frama_C_entropy_source [inout] Out (internal) for function main: Frama_C_entropy_source [inout] Inputs for function main: Frama_C_entropy_source frama-c-20.0-Calcium/tests/misc/oracle/wstring_phase6.res.oracle0000666000000000000000000000246313571573400021504 0ustar [kernel] Parsing tests/misc/wstring_phase6.c (with preprocessing) [kernel] Constant "%s\n" location: Start line 9, char 8; End line 9, char 14 [kernel] Constant "123456" location: Start line 9, char 16; End line 9, char 27 [kernel] Constant "%ls\n" location: Start line 10, char 8; End line 10, char 15 [kernel] Constant L"1" "2" "3" "4" "5" "6" location: Start line 10, char 17; End line 10, char 30 [kernel] Constant "%ls\n" location: Start line 11, char 8; End line 11, char 15 [kernel] Constant L"1" "2" "3" "4" "5" "6" location: Start line 11, char 17; End line 11, char 29 [kernel] Constant "%ls\n" location: Start line 12, char 8; End line 12, char 15 [kernel] Constant L"1" "2" "3" "4" "5" "6" location: Start line 12, char 17; End line 12, char 29 [kernel] Constant "%ls\n" location: Start line 13, char 8; End line 13, char 15 [kernel] Constant L"1" "2" "3" "4" "5" "6" location: Start line 13, char 17; End line 13, char 30 /* Generated by Frama-C */ #include "errno.h" #include "stdarg.h" #include "stddef.h" #include "stdio.h" int main(void) { int __retres; printf("%s\n","123456"); printf("%ls\n",L"1" "2" "3" "4" "5" "6" ); printf("%ls\n",L"1" "2" "3" "4" "5" "6" ); printf("%ls\n",L"1" "2" "3" "4" "5" "6" ); printf("%ls\n",L"1" "2" "3" "4" "5" "6" ); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/misc/plugin_log.ml0000666000000000000000000000103113571573400015774 0ustar open Kernel let dkey = register_category "foo-category" let main () = (* oracle stability is not great with backtrace on. *) Printexc.record_backtrace false; result ~dkey "result with dkey"; result "result"; feedback ~dkey "feedback with dkey"; feedback "feedback"; debug ~level:0 ~dkey "debug (level 0) with dkey"; debug ~level:0 "debug (level 0)"; warning "warning"; (* temporarily disabled to avoid leaking version number in test oracle error "error"; failure "failure";*) () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/pp_bin_hex.i0000666000000000000000000000012413571573400015572 0ustar /* run.config OPT: -no-autoload-plugins -load-script tests/misc/pp_bin_hex.ml */ frama-c-20.0-Calcium/tests/misc/pp_bin_hex.ml0000666000000000000000000000175413571573400015764 0ustar let pp_dec fmt z = Integer.pretty ~hexa:false fmt z let pp_hex fmt z = Integer.pp_hex ~nbits:16 ~sep:"_" fmt z let pp_bin fmt z = Integer.pp_bin ~nbits:8 ~sep:"_" fmt z let hrule () = Format.printf "--------------------------------------------------@." let testcase z = begin hrule () ; Format.printf "Dec. %a@." pp_dec z ; Format.printf "Hex. %a@." pp_hex z ; Format.printf "Bin. %a@." pp_bin z ; end let () = begin List.iter (fun z -> testcase z ; if not (Integer.equal z Integer.zero) then testcase (Integer.neg z) ) [ Integer.of_string "0" ; Integer.of_string "1" ; Integer.of_string "2" ; Integer.of_string "5" ; Integer.of_string "9" ; Integer.of_string "16" ; Integer.of_string "127" ; Integer.of_string "128" ; Integer.of_string "0xFF" ; Integer.of_string "0xFF0F000F" ; Integer.of_string "0x17070007" ; ] ; hrule () ; end frama-c-20.0-Calcium/tests/misc/pp_int.i0000666000000000000000000000016213571573400014752 0ustar /* run.config COMMENT: test of Integer.pp_bin and Integer.pp_hex OPT: -load-script tests/misc/pp_int.ml */ frama-c-20.0-Calcium/tests/misc/pp_int.ml0000666000000000000000000000576213571573400015145 0ustar (* -------------------------------------------------------------------------- *) (* --- Test for Integer.pp_int and Integer.pp_hex --- *) (* -------------------------------------------------------------------------- *) let pp_bin_naive ~sep fmt x = Format.pp_print_string fmt (if 0 <= x then "0b" else "1b") ; for i = 31 downto 0 do let b = (x land (1 lsl i)) <> 0 in Format.pp_print_char fmt (if b then '1' else '0') ; if i > 0 && i mod 4 = 0 then Format.pp_print_string fmt sep ; done let pp_hex_naive ~sep fmt x = let m = Printf.sprintf "%08X" x in let n = String.length m in let m = if n < 8 then m else String.sub m (n-8) 8 in let n = String.length m in Format.pp_print_string fmt (if 0 <= x then "0x" else "1x") ; for i = n - 1 downto 0 do Format.pp_print_char fmt m.[n-1-i] ; if i > 0 && i mod 4 = 0 then Format.pp_print_string fmt sep ; done let pp_bar fmt c = Format.fprintf fmt "%s@\n" (String.make 70 c) let testvalue ~nbits ~sep ~tbin ~thex fmt x = begin let v = Integer.of_int x in let v2 = Integer.(lognot v) in pp_bar fmt '-' ; Format.fprintf fmt "value '%d' '%x'@\n" x x ; Format.fprintf fmt "refhex '%a'@\n" (pp_hex_naive ~sep) x ; Format.fprintf fmt "pp_hex '%s%a'@\n" thex (Integer.pp_hex ~nbits ~sep) v ; Format.fprintf fmt "refbin '%a'@\n" (pp_bin_naive ~sep) x ; Format.fprintf fmt "pp_bin '%s%a'@\n" tbin (Integer.pp_bin ~nbits ~sep) v ; Format.fprintf fmt "pp_neg '%s%a'@\n" tbin (Integer.pp_bin ~nbits ~sep) v2 ; end let testdata data fmt = begin List.iter (fun (nbits,sep,values) -> pp_bar fmt '=' ; Format.fprintf fmt "Nbits: %d Sep: %S@\n" nbits sep ; List.iter (fun (nhex,nbin,values) -> let tbin = String.make nbin ' ' in let thex = String.make nhex ' ' in List.iter (testvalue ~nbits ~sep ~tbin ~thex fmt) values ) values ; ) data ; pp_bar fmt '-' ; end let () = Format.printf "%t" begin testdata [ 0, "," , [ 0 , 15 , [ 65537;65536 ] ; 5 , 20 , [ 65335;65534 ] ; 5 , 30 , [ 127;128;129 ] ; 5 , 35 , [ 2;1;0;-1;-2;-3 ] ; 5 , 30 , [ -126;-127;-128;-129;-130 ] ; 5 , 30 , [ -254;-255;-256 ] ; 5 , 25 , [ -257;-258 ] ; 5 , 20 , [ -65534;-65535;-65536 ] ; 0 , 15 , [ -65537;-65538 ] ; ] ; 8, "" , [ 4 , 16 , [ 65335;65534 ] ; 4 , 24 , [ 2;1;0;-1;-2 ] ; 4 , 20 , [ -254;-255;-256 ] ; 4 , 16 , [ -65534;-65535;-65536 ] ; ] ; 10, "" , [ 4 , 16 , [ 65335;65534 ] ; 4 , 20 , [ 2;1;0;-1;-2 ] ; 4 , 20 , [ -254;-255;-256 ] ; 4 , 16 , [ -65534;-65535;-65536 ] ; ] ; 10, "." , [ 5 , 20 , [ 65335;65534 ] ; 5 , 25 , [ 2;1;0;-1;-2 ] ; 5 , 25 , [ -254;-255;-256 ] ; 5 , 20 , [ -65534;-65535;-65536 ] ; ] ; ] end frama-c-20.0-Calcium/tests/misc/pragma-pack-utils.h0000666000000000000000000000212613571573400017003 0ustar // This test should compile with GCC and obtain the same results. // The output format is similar to the one given by Value, so that a diff between // both files should output identical lines (besides lots of extra lines). // This test should also compile with MSVC, although due to the lack of // __attribute__, results will be different. #define _STR_(x) x #define STR(x) _STR_(#x) // Some versions of MSVC do not accept the '%z' modifier, but GCC emits warnings // without it, so use this macro to print it in both compilers. // Note that __GNUC__ is defined in our machdep MSVC, but not in the actual // MSVC compiler itself. #ifdef __GNUC__ // GCC uses %zu for size_t, and allows unicode # define ZU "%zu" # define IN "∈" #else // MSVC uses %u for size_t, and does not allow unicode # define ZU "%u" # define IN "IN" // this include is necessary when testing on Visual C++ # include "stdafx.h" #endif // To avoid polluting Value output with printfs, // add it conditionally (for testing with GCC/Clang/MSVC) #ifdef __FRAMAC__ #define PRINTF(...) #else #include #define PRINTF printf #endif frama-c-20.0-Calcium/tests/misc/pragma-pack.c0000666000000000000000000002201213571573400015634 0ustar /*run.config STDOPT: #"-machdep gcc_x86_64 -kernel-msg-key typing:pragma" STDOPT: #"-cpp-command=\"gcc -E -C -I. -m32\" -cpp-frama-c-compliant" STDOPT: #"-machdep msvc_x86_64" */ #include "pragma-pack-utils.h" #include #include #if defined(_MSC_VER) && _MSC_VER > 0 // __attribute__ is not allowed in MSVC, so we remove them. // this must be done after including some files from the Frama-C stdlib, // to ensure that _MSC_VER is defined. # define __attribute__(...) #endif #define DEF_STRUCT(NAME) \ struct NAME { \ signed char i; \ long double j; \ } #define DEF_STRUCT_WITH_ATTRS(NAME,...) \ struct NAME##_ATTR { \ signed char i; \ long double j; \ } __attribute__((__VA_ARGS__)) // test functions are declared here to minimize shifting oracles in case of changes void tests1(void); void tests2(void); #ifdef __GNUC__ // This main function is not used when testing MSVC on Visual C++; // instead, _tmain (defined at the end) is used int main() { tests1(); tests2(); return 0; } #endif // before any pragma pack DEF_STRUCT(S); DEF_STRUCT_WITH_ATTRS(PACK8,__packed__,__aligned__(8)); DEF_STRUCT_WITH_ATTRS(PACK1,__packed__,__aligned__(1)); DEF_STRUCT_WITH_ATTRS(PACKPUSH4,__packed__,__aligned__(4)); DEF_STRUCT_WITH_ATTRS(PACK16,__packed__,__aligned__(16)); DEF_STRUCT_WITH_ATTRS(PACK2,__packed__,__aligned__(2)); #pragma pack(8) DEF_STRUCT(PACK8); #pragma pack(1) DEF_STRUCT(PACK1); #pragma pack(push, 4) // push alignment 1 and set 4 as current DEF_STRUCT(PACKPUSH4); #pragma pack(16) DEF_STRUCT(PACK16); #pragma pack(pop) // popped alignment should be 1 DEF_STRUCT(PACKPOP); #pragma pack(push) // pushed and current alignment should be 1 DEF_STRUCT(PACKPUSH); #pragma pack(2) DEF_STRUCT(PACK2); #pragma pack() // reset to default DEF_STRUCT(PACKDEF); // note: pragma pack(pop, ) is unsupported by GCC #pragma pack(pop) // pop last stacked pragma (1) DEF_STRUCT(PACKPOPAGAIN); // this pragma should generate a warning #pragma pack(pop) DEF_STRUCT(PACKOVERPOP); // Macro used to test and print each offset. // Variables are kept in the function scope so that // Value will print their values at the end of the function #define TEST_STRUCT(ST) \ size_t ST##_i = offsetof(struct ST, i); \ size_t ST##_j = offsetof(struct ST, j); \ size_t ST##_sizeof = sizeof(struct ST); \ PRINTF(" %s_i %s {", STR(ST), IN); \ PRINTF(ZU "}\n", ST##_i); \ PRINTF(" %s_j %s {", STR(ST), IN); \ PRINTF(ZU "}\n", ST##_j); \ PRINTF(" %s_sizeof %s {" ZU "}\n", STR(ST), IN, ST##_sizeof) void tests1() { TEST_STRUCT(S); TEST_STRUCT(PACK8); TEST_STRUCT(PACK1); TEST_STRUCT(PACKPUSH4); TEST_STRUCT(PACK16); TEST_STRUCT(PACKPOP); TEST_STRUCT(PACKPUSH); TEST_STRUCT(PACK2); TEST_STRUCT(PACKDEF); TEST_STRUCT(PACKPOPAGAIN); TEST_STRUCT(PACKOVERPOP); TEST_STRUCT(PACK8_ATTR); TEST_STRUCT(PACK1_ATTR); TEST_STRUCT(PACKPUSH4_ATTR); TEST_STRUCT(PACK16_ATTR); TEST_STRUCT(PACK2_ATTR); } // END OF FIRST ROUND OF TESTS // SECOND ROUND OF TESTS: // each struct is defined inside a #pragma directive and // then, outside of it, the "equivalent" version that should // be produced by Frama-C. Both should output the same values // when compiled with GCC and MSVC. // restore alignment to default #pragma pack() #pragma pack(push,4) typedef struct { signed char i; signed char j __attribute__((__aligned__(2))); long double k; char l; } test1; #pragma pack(pop) typedef struct { signed char i __attribute__((__aligned__(4))); signed char j __attribute__((__aligned__(2<4?2:4))); long double k __attribute__((__aligned__(4))); char l __attribute__((__aligned__(4))); } __attribute__((__packed__)) emul1; #pragma pack(push,1) typedef struct { signed char i; signed char j __attribute__((__aligned__(2))); long double k; char l; } test2; #pragma pack(pop) typedef struct { signed char i __attribute__((__aligned__(1))); signed char j __attribute__((__aligned__(2<1?2:1))); long double k __attribute__((__aligned__(1))); char l __attribute__((__aligned__(1))); } __attribute__((__packed__)) emul2; #pragma pack(push,4) typedef struct { signed char i; signed char j; long double k; char l; } __attribute__((__packed__)) test3; #pragma pack(pop) typedef struct { signed char i; signed char j; long double k; char l; } __attribute__((__packed__)) emul3; #pragma pack(push,2) typedef struct { signed char i; signed char j __attribute__((__aligned__(4))); long double k; char l; } __attribute__((__packed__)) test4; #pragma pack(pop) typedef struct { signed char i; signed char j __attribute__((__aligned__(2<4?2:4))); long double k; char l; } __attribute__((__packed__)) emul4; #pragma pack(push,2) typedef struct { signed char i; signed char j __attribute__((__aligned__)); long double k; char l; } __attribute__((__packed__)) test5; #pragma pack(pop) typedef struct { signed char i; signed char j __attribute__((__aligned__(2))); // minimum between "max_align" and 2 long double k; char l; } __attribute__((__packed__)) emul5; #pragma pack(push,2) typedef struct { signed char i; signed char j __attribute__((__aligned__(1))) __attribute__((__aligned__(4))); long double k; char l; } __attribute__((__packed__)) test6; #pragma pack(pop) typedef struct { signed char i; signed char j __attribute__((__aligned__(2))); long double k; char l; } __attribute__((__packed__)) emul6; #pragma pack(push,2) typedef struct { signed char i; signed long j __attribute__((__aligned__(1))); signed char q; signed short p; long double k; char l; } test7; typedef struct { test7 i; char j; long double k; test7 l; } test7_2; #pragma pack(pop) #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) // N below must be synchronized with the pragma pack above #define N 2 typedef struct { signed char i __attribute__((__aligned__(MIN(sizeof(signed char),N)))); signed long j __attribute__((__aligned__(MIN(MAX(sizeof(signed long),1),N)))); signed char q __attribute__((__aligned__(MIN(sizeof(signed char),N)))); signed short p __attribute__((__aligned__(MIN(sizeof(signed short),N)))); long double k __attribute__((__aligned__(MIN(sizeof(long double),N)))); char l __attribute__((__aligned__(MIN(sizeof(char),N)))); } __attribute__((__packed__)) emul7; typedef struct { emul7 i __attribute__((__aligned__(2))) ; char j __attribute__((__aligned__(2))) ; long double k __attribute__((__aligned__(2))) ; emul7 l __attribute__((__aligned__(2))) ; } __attribute__((__packed__)) emul7_2; // This test does not test pragma pack, only aligned/packed attributes typedef struct { char i; long j __attribute__((__aligned__(2))); // smaller than min, not packed => ignored char k; long l __attribute__((__packed__,__aligned__(2))); // smaller than min, packed => ok } test8; #define TEST(ST) \ size_t ST##_i = offsetof(ST, i); \ size_t ST##_j = offsetof(ST, j); \ size_t ST##_k = offsetof(ST, k); \ size_t ST##_l = offsetof(ST, l); \ size_t ST##_sizeof = sizeof(ST); \ PRINTF(" %s_i %s {", STR(ST), IN); \ PRINTF(ZU "}\n", ST##_i); \ PRINTF(" %s_j %s {", STR(ST), IN); \ PRINTF(ZU "}\n", ST##_j); \ PRINTF(" %s_k %s {", STR(ST), IN); \ PRINTF(ZU "}\n", ST##_k); \ PRINTF(" %s_l %s {", STR(ST), IN); \ PRINTF(ZU "}\n", ST##_l); \ PRINTF(" %s_sizeof %s {" ZU "}\n", STR(ST), IN, ST##_sizeof) void tests2() { PRINTF("\n"); TEST(test1); PRINTF("\n"); TEST(emul1); PRINTF("\n"); TEST(test2); PRINTF("\n"); TEST(emul2); PRINTF("\n"); TEST(test3); PRINTF("\n"); TEST(emul3); PRINTF("\n"); TEST(test4); PRINTF("\n"); TEST(emul4); PRINTF("\n"); TEST(test5); PRINTF("\n"); TEST(emul5); PRINTF("\n"); TEST(test6); PRINTF("\n"); TEST(emul6); PRINTF("\n"); TEST(test7); PRINTF("\n"); TEST(emul7); PRINTF("\n"); TEST(test7_2); PRINTF("\n"); TEST(emul7_2); PRINTF("\n"); TEST(test8); } // Test resilience to crash due to align() attribute in flexible array member #pragma pack(push, 1) typedef struct { int len; unsigned char data[]; } barcode_bmp_t; #pragma pack(pop) #ifndef __GNUC__ // For MSVC testing on Visual C++ int _tmain(int argc, _TCHAR* argv[]) { tests1(); tests2(); getchar(); return 0; } #endif frama-c-20.0-Calcium/tests/misc/pragma_pack_zero.c0000666000000000000000000000216413571573400016763 0ustar /* run.config STDOPT: #"-machdep gcc_x86_64" STDOPT: #"-machdep msvc_x86_64" */ // #pragma pack(0) is not supported by MSVC, but allowed in GCC. // In MSVC mode, we ignore it. // In GCC, its current (undocumented) behavior is equivalent to #pragma pack(), // that is, disable packing (reset to default). We emulate this behavior, // but with a warning. #include "pragma-pack-utils.h" #include #include struct s1 { char a; int b; }; #pragma pack(1) struct s2 { char a; int b; }; #pragma pack(2) struct s3 { char a; int b; }; #pragma pack(0) struct s4 { char a; int b; }; #define PRINT_VAR(V) \ PRINTF(" %s %s {" ZU "}\n", STR(V), IN, V) int main() { size_t z1 = sizeof(struct s1); size_t o1 = offsetof(struct s1, b); size_t z2 = sizeof(struct s2); size_t o2 = offsetof(struct s2, b); size_t z3 = sizeof(struct s3); size_t o3 = offsetof(struct s3, b); size_t z4 = sizeof(struct s4); size_t o4 = offsetof(struct s4, b); PRINT_VAR(z1); PRINT_VAR(o1); PRINT_VAR(z2); PRINT_VAR(o2); PRINT_VAR(z3); PRINT_VAR(o3); PRINT_VAR(z4); PRINT_VAR(o4); return 0; } frama-c-20.0-Calcium/tests/misc/print_machdep.i0000666000000000000000000000007513571573400016301 0ustar /* run.config OPT: -no-autoload-plugins -print-machdep */ frama-c-20.0-Calcium/tests/misc/remove_status_hyps.i0000666000000000000000000000043313571573400017425 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int main(void) { /*@ assert P1: \true; */; /*@ assert P2: \true; */; /*@ assert P3: \true; */; /*@ assert P4: \true; */; return 0; } frama-c-20.0-Calcium/tests/misc/remove_status_hyps.ml0000666000000000000000000000365013571573400017611 0ustar module P = Plugin.Register(struct let name = "remove_status_hyps" let shortname = "rsh" let help = "" end) let emitter = Emitter.(create "test" [ Property_status ] ~correctness:[] ~tuning:[]) let pretty_status fmt = function | Property_status.Best(s, [ e ]) -> Format.fprintf fmt "%a (hyps: %t)" Property_status.Emitted_status.pretty s (fun fmt -> Pretty_utils.pp_list Property.pretty fmt e.Property_status.properties) | Property_status.Never_tried -> Format.fprintf fmt "no try" | Property_status.Inconsistent _ | Property_status.Best(_, ([] | _ :: _ :: _)) -> assert false let report msg l = P.feedback msg; List.iter (fun (_, _, p) -> P.feedback "%a: %a" Property.pretty p pretty_status (Property_status.get p)) l let main () = let kf = try Globals.Functions.find_by_name "main" with Not_found -> assert false in (* for any annotation, emits dont_know. The dependency depends on the parity of the annotations: either nothing, or all the previous ones *) let _, l = Annotations.fold_all_code_annot ~sorted:true (fun stmt _ ca (even, acc) -> let ppt = Property.ip_of_code_annot_single kf stmt ca in (if even then Property_status.(emit emitter ~hyps:[] ppt Dont_know) else let hyps = List.map (fun (_, _, ppt) -> ppt) acc in Property_status.(emit emitter ~hyps ppt Dont_know)); not even, (ca, stmt, ppt) :: acc) (true, []) in let l = List.rev l in report "initial statuses" l; (* exactly four annotations in the tested program *) match l with | (a1, s1, _p1) :: ([ _a2, _s2, p2; _a3, _s3, _p3; _a4, _s4, p4 ] as l') -> Property_status.(emit emitter ~hyps:[ p2 ] p4 True); report "P4 only depends on P2" l; Annotations.remove_code_annot Emitter.end_user ~kf s1 a1; report "removing P1" l' | _ -> assert false let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/save_comments.i0000666000000000000000000000031513571573400016324 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -keep-comments */ int f() { int x = 0; /* Hello, I'm the f function */ return x; } frama-c-20.0-Calcium/tests/misc/save_comments.ml0000666000000000000000000000253713571573400016514 0ustar open Cil_types open Cil let find_comment () = let kf = Globals.Functions.find_by_name "f" in let loc1 = Kernel_function.get_location kf in let loc2 = Cil_datatype.Stmt.loc (Kernel_function.find_return kf) in let zone = (fst loc1, snd loc2) in Format.printf "@[In project %s, searching for comments between %a and %a:@\n%a\ @\nEnd of comments@." (Project.get_name (Project.current())) Printer.pp_location loc1 Printer.pp_location loc2 (Pretty_utils.pp_list ~sep:"@\n" Format.pp_print_string) (Cabshelper.Comments.get zone) let run () = let ast = Ast.get () in let vis = object inherit Visitor.frama_c_inplace method! vglob_aux g = match g with GText s -> Format.printf "got global comment %s@." s; SkipChildren | _ -> DoChildren end in ignore (Visitor.visitFramacFile vis ast); let fmt = Format.std_formatter in Format.printf "Printing default project first time:@."; File.pretty_ast ~fmt (); Format.printf "Printing default project second time:@."; File.pretty_ast ~fmt (); let file = Extlib.temp_file_cleanup_at_exit "save_comments_test" ".sav" in let name = "saved_project" in find_comment (); Project.save file; let prj = Project.load ~name file in Project.on prj find_comment (); Format.printf "Printing saved project:@."; File.pretty_ast ~prj ~fmt () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/static.i0000666000000000000000000000042213571573400014747 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int x; int f() { static int x = 0; x++; return x; } int g() { int x = 0; x++; return x; } int main () { x++; return x; } frama-c-20.0-Calcium/tests/misc/static.ml0000666000000000000000000000161613571573400015135 0ustar open Cil_types let find_x f = let kf = Globals.Functions.find_by_name f in let stmt = Kernel_function.find_return kf in Extlib.the (Globals.Syntactic_search.find_in_scope "x" (Block_scope stmt)) let run () = Ast.compute (); let x_f = find_x "f" in let x_g = find_x "g" in let x_main = find_x "main" in let x_glob = Extlib.the (Globals.Syntactic_search.find_in_scope "x" Program) in if not (Cil_datatype.Varinfo.equal x_main x_glob) then Kernel.fatal "in main, global variable x should be in scope"; if Cil_datatype.Varinfo.equal x_glob x_f then Kernel.fatal "in f, global variable x should not be in scope"; if Cil_datatype.Varinfo.equal x_glob x_g then Kernel.fatal "in g, global variable x should not be in scope"; if Cil_datatype.Varinfo.equal x_g x_f then Kernel.fatal "mixing local variables from f and g"; File.pretty_ast () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/stdint.i0000666000000000000000000000061113571573400014765 0ustar /* run.config COMMENT: Check warning for bad typedefs of standard integer types. OPT: -machdep x86_16 OPT: -machdep ppc_32 OPT: -machdep msvc_x86_64 */ // These typedefs should cause warnings with every machdep supported by // Frama-C. typedef int int8_t; typedef unsigned char uint_least64_t; typedef short int_fast32_t; typedef char intptr_t; typedef unsigned short uintmax_t; frama-c-20.0-Calcium/tests/misc/test_config0000666000000000000000000000006213571573400015535 0ustar EXECNOW: make -s @PTEST_DIR@/global_decl_loc.cmxs frama-c-20.0-Calcium/tests/misc/test_datatype.i0000666000000000000000000000020513571573400016331 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ frama-c-20.0-Calcium/tests/misc/test_datatype.ml0000666000000000000000000000122413571573400016513 0ustar module D = struct include Datatype.Int let name = "D" let structural_descr = Structural_descr.t_int let rehash x = x let copy = Datatype.undefined end module Test = Datatype.Make_with_collections(D) module L = Datatype.List(D) module M = Test.Map.Make(D) module H = Test.Hashtbl.Make(D) let main () = Format.printf "here@."; assert (L.copy [] == []); assert (Test.Set.equal (Test.Set.copy Test.Set.empty) Test.Set.empty); assert (M.equal (M.copy Test.Map.empty) Test.Map.empty); let h = Test.Hashtbl.create 3 in (* no equality in Hashtbls. *) Test.Hashtbl.iter (fun _ _ -> assert false) (H.copy h) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/tests.sh0000777000000000000000000000224613571573400015015 0ustar #!/bin/sh if [ $# -lt 5 ] ; then echo "tests/tests.sh: a subshell invoked by default to perform testing run." exit 1 fi DIFF="diff -b -B" Compare() { if [ -e $1$2 ]; then File=`basename $1$2 .log`.oracle Dir=`dirname $1` Dir=`dirname $Dir` File="$Dir/oracle/$File" if [ -e ${File} ]; then if ! ${DIFF} --brief $1$2 ${File} >/dev/null then echo ". KO: ${DIFF} $1$2 ${File}" fi else echo ". NO oracle ${File}" fi fi } # input file Src=$1 shift # prefix for the out files PreFix=$1 shift # extension for out files issued from stdout PostFix1=$1 shift # extension for out files issued from stderr PostFix2=$1 shift # command running the test Cmd=$1 shift # check the compilation of the source code. gcc -c ${Src} -o ${PreFix}.o 2> /dev/null Res=$? rm -f ${PreFix}.o if [ "${Res}" != 0 ] ; then echo "# compilation problem with: gcc -c ${Src} -o ${PreFix}.o" fi # run the test on the input file echo "${Cmd} $* ${Src}" ${Cmd} $* ${Src} > ${PreFix}${PostFix1} 2> ${PreFix}${PostFix2} Res=$? if [ "${Res}" != 0 ] ; then exit ${Res} fi Compare ${PreFix} ${PostFix1} stdout Compare ${PreFix} ${PostFix2} stderrframa-c-20.0-Calcium/tests/misc/version.i0000666000000000000000000000021313571573400015143 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ frama-c-20.0-Calcium/tests/misc/version.ml0000666000000000000000000000124413571573400015330 0ustar let re_version = Str.regexp "^\\([0-9]+\\)\\.\\([0-9]+\\)" let run () = let version_str = Config.version in if Str.string_match re_version version_str 0 then let major = Str.matched_group 1 version_str in let minor = Str.matched_group 2 version_str in if major = string_of_int Config.major_version && minor = string_of_int Config.minor_version then Kernel.feedback "version numbers match" else Kernel.abort "error parsing major/minor version: expected %s.%s, got %d.%d" major minor Config.major_version Config.minor_version else Kernel.abort "could not parse Config.version" let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/vis_queueInstr.i0000666000000000000000000000027213571573400016510 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print -then-on A -print */ int main(){ int i = 0; } frama-c-20.0-Calcium/tests/misc/vis_queueInstr.ml0000666000000000000000000000036513571573400016673 0ustar class vis prj = object(this) inherit Visitor.frama_c_copy prj method! vstmt_aux _ = this#queueInstr [ Cil.dummyInstr ] ; Cil.DoChildren end let () = Db.Main.extend (fun () -> ignore (File.create_project_from_visitor "A" (new vis))) frama-c-20.0-Calcium/tests/misc/vis_spec.i0000666000000000000000000000033513571573400015276 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ //@ assigns \nothing; void g (void) ; //@ assigns \nothing; void f () { g(); } frama-c-20.0-Calcium/tests/misc/vis_spec.ml0000666000000000000000000000204013571573400015451 0ustar open Cil_types open Cil class pathcrawlerVisitor prj = object(self) inherit Visitor.frama_c_copy prj method! vspec sp = Format.printf "Considering spec of function %s@." (Kernel_function.get_name (Extlib.the self#current_kf)); (match self#current_func with | Some f -> if f.svar.vname ="f" then ( Format.printf "@[Funspec of f is@ @['%a'@]@ through visitor@]@." Printer.pp_funspec sp; Format.printf "@[It is@ @['%a'@]@ through get_spec@]@." Printer.pp_funspec (Annotations.funspec (Globals.Functions.get f.svar)); ) | None -> Format.printf "@[Function prototype;@ Funspec is@ @['%a'@]@]@." Printer.pp_funspec sp; ); DoChildren end let startup () = ignore(Ast.get ()); Format.printf "Starting visit@."; let prj = File.create_project_from_visitor "pcanalyzer" (fun prj -> new pathcrawlerVisitor prj) in Format.printf "End visit@."; Project.set_current prj; ;; let () = Db.Main.extend startup frama-c-20.0-Calcium/tests/misc/visitor_creates_func_bts_1349.i0000666000000000000000000000022313571573400021227 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-script @PTEST_DIR@/@PTEST_NAME@ -then-on test -print */ int a = 10; frama-c-20.0-Calcium/tests/misc/visitor_creates_func_bts_1349.ml0000666000000000000000000000266213571573400021420 0ustar open Cil_types class test prj = object(self) inherit Visitor.frama_c_copy prj method private create_f () = let f = Cil.emptyFunction "f" in f.svar.vdefined <- true; let x = Cil.makeFormalVar f "x" Cil.intType in Cil.setReturnType f Cil.intType; Queue.add (fun () -> Cil.setFormals f [x]) self#get_filling_actions; f.sbody <- Cil.mkBlock [Cil.mkStmt ~valid_sid:true (Return (Some (Cil.evar x),Cil_datatype.Location.unknown))]; Queue.add (fun () -> Globals.Functions.replace_by_definition (Cil.empty_funspec()) f Cil_datatype.Location.unknown) self#get_filling_actions ; [GFunDecl(Cil.empty_funspec(),f.svar,Cil_datatype.Location.unknown); GFun(f,Cil_datatype.Location.unknown)] method! vglob_aux = function | GVar (v,i,loc) -> let v'= Visitor.visitFramacVarDecl (self:>Visitor.frama_c_visitor) v in let i'= match i.init with | None -> { init = None } | Some i -> { init = Some (Visitor.visitFramacInit (self:>Visitor.frama_c_visitor) v' NoOffset i) } in let g = GVar(v',i',loc) in Cil.ChangeToPost (g::self#create_f(),fun x -> x) | _ -> Cil.DoChildren end let run () = let vis prj = new test prj in ignore (File.create_project_from_visitor "test" vis) let () = Db.Main.extend run frama-c-20.0-Calcium/tests/misc/well_typed_alarm.i0000666000000000000000000000035413571573400017010 0ustar /* run.config* EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int main(int c) { int x = 0; int y = 0; int *p = &x; int *q = &y; if (c) q = &x; if (p<=q) x++; return *q; } frama-c-20.0-Calcium/tests/misc/well_typed_alarm.ml0000666000000000000000000000017513571573400017171 0ustar let main () = !Db.Value.compute(); Filecheck.check_ast "Check alarm"; File.pretty_ast () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/misc/widen_hints.c0000666000000000000000000000505013571573400015767 0ustar /* run.config OPT: -eva @EVA_CONFIG@ -cpp-extra-args=-DSYNTAX_ERRORS -kernel-warn-key=annot-error=active OPT: -eva @EVA_CONFIG@ -cpp-extra-args=-DNONCONST OPT: -eva @EVA_CONFIG@ -slevel 1 -eva-msg-key widen-hints OPT: -eva @EVA_CONFIG@ -cpp-extra-args=-DALLGLOBAL -eva-msg-key widen-hints */ #define N 2 const int x = 9; int not_const = 42; // cannot be used as widen hint #ifdef SYNTAX_ERRORS int main1() { /*@ widen_hints x; */ // error: no hints return 0; } int main2() { /*@ widen_hints 1; */ // error: no variable return 0; } int main3() { /*@ widen_hints x, b, 1; */ // error: b must be a constant value return 0; } int main() { /*@ widen_hints x, not_const; */ // error: not_const not a global constant return 0; } #else #ifdef ALLGLOBAL int f() { int m = 10; int n = 33+m; int t[100]; // global:"all" hints should apply here for (int a = 0; a < n*2+1; a++) { for (int b = 0; b < a; b++) { t[b] = 1; } } return 0; } #endif #ifdef EXTGLOBAL // ext_i and external_f are defined in widen_hints_external.c void external_f(); #endif void using_dynamic_global(int *i) { int b; //@ widen_hints *i, 87; //note: b itself is NOT in the hint for (b = 0; b < *i; b++) { } } int main() { #ifdef NONCONST const int local_const = 17; // cannot be used as widen hint /*@ widen_hints x, local_const; */ // error: local_const not a global constant #endif int y; int m = 10; int n = 33+m; // without hints for a, there is a signed overflow //@ loop widen_hints a, (N+(6*x)+118)/2; for (int a = 0; a < n*2+1; a++) { for (int b = 0; b < a; b++) { } } #ifdef ALLGLOBAL /*@ widen_hints global:"all", 88; */ f(); #endif struct st { int i; double d; } ss; //@ widen_hints ss.i, 87; for (ss.i = 0; ss.i < n*2+1; ss.i++) { for (int b = 0; b < ss.i; b++) { } } int ip = 0; int *p = &ip; //@ widen_hints *p, 87; for (*p = 0; *p < n*2+1; (*p)++) { for (int b = 0; b < *p; b++) { } } int ip2 = 0; int *p2 = &ip2; int **pp = &p2; //@ widen_hints **pp, 87; for (**pp = 0; **pp < n*2+1; (**pp)++) { for (int b = 0; b < **pp; b++) { } } typedef struct { int i; } istruct; istruct iarray[2] = {{0}, {0}}; istruct *piarray[2] = {&iarray[0], &iarray[1]}; for (piarray[1]->i = 0; piarray[1]->i < n*2+1; (piarray[1]->i)++) { //@ widen_hints piarray[1]->i, 87; for (int b = 0; b < piarray[1]->i; b++) { } } int outer_i; for (outer_i = 0; outer_i < n*2+1; outer_i++) { using_dynamic_global(&outer_i); } return 0; } #endif frama-c-20.0-Calcium/tests/misc/widen_hints2.c0000666000000000000000000000356113571573400016056 0ustar /* run.config STDOPT: #"-eva-msg-key widen-hints" OPT: -print */ #include #define N 2 int t[100]; const int x = 9; int glob; void f() { int tf[100]; int m = 10; int n = 33+m; /*@ widen_hints "all", 88; // necessary, apply on all variables */ for (int a = 0; a < n*2+1; a++) { // uses @all hint for (int b = 0; b < a; b++) { tf[b] = 1; } } } void g() { int tg[100]; int m = 10; int n = 33+m; // no hints from other functions should apply to these variables for (int ll = 0; ll < n*2+1; ll++) { for (int kk = 0; kk < ll; kk++) { tg[kk] = 1; } } } int y; // used to force renaming of local variable int main() { int y; int m = 10; //@ widen_hints global:m, N; // useless, just syntactic test //@ widen_hints y, 5; // useless, just syntactic test int n = 33+m; /*@ loop widen_hints a, 2; // useless, just syntactic test */ for (int a = 0; a < n*2+1; a++) { // uses global hint /*@ widen_hints a, 88; */ // necessary for (int b = 0; b < a; b++) { t[b] = 1; } } /*@ loop widen_hints c, 88; // necessary loop widen_hints y, 1; // useless, just syntactic test: // should be renamed to y_0 loop widen_hints global:y, 2; // useless, just syntactic test: // should be renamed to y_0 */ for (int c = 0; c < n*2+1; c++) { // uses loop-local hint for (int d = 0; d < c; d++) { t[d] = 1; } } /*@ loop widen_hints c, 88; // necessary (tests renaming of local variables) */ for (int c = 0; c < n*2+1; c++) { // uses loop-local hint for (int d = 0; d < c; d++) { t[d] = 1; } } //@ widen_hints glob, 88; for (glob = 0; glob < n*2+1; glob++) { // uses hint based on global variable for (int j = 0; j < glob; j++) { t[j] = 1; } } f(); g(); return 0; } frama-c-20.0-Calcium/tests/misc/widen_hints_float.c0000666000000000000000000000276513571573400017166 0ustar /* run.config* STDOPT: #"-val-subdivide-non-linear 20" */ #include "__fc_builtin.h" #include void parabola(void) { /* The expression is a parabola p where p([0.;64.]) = [0.;64.] and p([64.;128.]) = [0.;64.]. For any value x<0, p(x) < x; For any value 128. // See http://stackoverflow.com/questions/18102502/mixing-wide-and-narrow-string-literals-in-c int main(){ printf( "%s\n", "123" "456" ); printf( "%ls\n", L"123" L"456" ); printf( "%ls\n", "123" L"456" ); printf( "%ls\n", L"123" "456" ); printf( "%ls\n", L"123" L"456" ); return 0; } frama-c-20.0-Calcium/tests/misc/wstring_phase6.ml0000666000000000000000000000114013571573400016601 0ustar open Cil_types let print_loc fmt (b,e) = let open Filepath in Format.fprintf fmt "Start line %d, char %d; End line %d, char %d" b.pos_lnum (b.pos_cnum - b.pos_bol) e.pos_lnum (e.pos_cnum - e.pos_bol) class vis = object inherit Visitor.frama_c_inplace method! vexpr e = (match e.enode with | Const (CStr _ | CWStr _ as c) -> Kernel.result "@[@[Constant %a@]@ location: %a@]" Printer.pp_constant c print_loc e.eloc | _ -> ()); Cil.DoChildren end let do_it () = Visitor.visitFramacFileSameGlobals (new vis) (Ast.get()) let () = Db.Main.extend do_it frama-c-20.0-Calcium/tests/more_wp/0000777000000000000000000000000013571573400014025 5ustar frama-c-20.0-Calcium/tests/more_wp/Makefile0000666000000000000000000001061313571573400015466 0ustar ########################################################################## # # # This file is part of Frama-C. # # # # Copyright (C) 2007-2009 # # CEA (Commissariat l'nergie Atomique) # # INRIA (Institut National de Recherche en Informatique et en # # Automatique) # # # # you can redistribute it and/or modify it under the terms of the GNU # # Lesser General Public License as published by the Free Software # # Foundation, version 2.1. # # # # It is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # See the GNU Lesser General Public License version v2.1 # # for more details (enclosed in the file licenses/LGPLv2.1). # # # ########################################################################## FD=../.. WD=$(FD)/tests/more_wp WHYDIR=$(FD)/why EXEC=$(FD)/bin/toplevel.opt CMD=FRAMAC_SHARE=$(FD)/share WHYLIB=$(WHYDIR)/lib WHYBIN=$(WHYDIR)/bin/why.opt WHYDP=$(WHYDIR)/bin/why-dp.opt $(EXEC) -journal-disable -wp-verbose 1 -wp-no-bot -wp-proof #CMD=FRAMAC_SHARE=$(FD)/share $(EXEC) -journal-disable -wp-verbose 1 all : res_0 res_2 .PHONY : all JD=$(FD)/tests/jessie JFILES=$(wildcard $(JD)/*.c) WP_FILES=$(JFILES:$(JD)/%.c=$(WD)/%.X) STATUS=valid invalid unknown timeout failure RES_FILES=$(STATUS:%=%.X) failed.X errors.X LOG_0=$(WP_FILES:%.X=%.0.log) ERR_0=$(WP_FILES:%.X=%.0.err) RES_0 = $(RES_FILES:%.X=%.0) .PRECIOUS : $(LOG_0) $(ERR_0) .PHONY : RES_0 LOG_0 : $(LOG_0) ERR_0 : $(ERR_0) RES_0 : $(RES_0) LOG_2=$(WP_FILES:%.X=%.2.log) ERR_2=$(WP_FILES:%.X=%.2.err) RES_2 = $(RES_FILES:%.X=%.2) .PRECIOUS : $(LOG_2) $(ERR_2) .PHONY : RES_2 LOG_2 : $(LOG_2) ERR_2 : $(ERR_2) RES_2 : $(RES_2) LOG_0 ERR_0 LOG_2 ERR_2 : # we need to have a way to store the timestamp touch $@ $(WD)/%.0.log $(WD)/%.0.err : $(JD)/%.c $(EXEC) -$(CMD) -wp-mm 0 $< > $(WD)/$*.0.log 2> $(WD)/$*.0.err $(WD)/%.2.log $(WD)/%.2.err : $(JD)/%.c $(EXEC) $(WD)/%.2.no @echo "Don't run test M2 for $<" touch $@ $(WD)/%.2.log $(WD)/%.2.err : $(JD)/%.c $(EXEC) -$(CMD) -wp-mm 2 $< > $(WD)/$*.2.log 2> $(WD)/$*.2.err errors.% : ERR_% -grep Fatal $($<) > $@ -grep Unbound $($<) >> $@ -grep "Could not run why" $($<) >> $@ -grep "Could not run why" $(LOG_$*) >> $@ echo "TOTAL errors = `wc -l $@`" >> $@ failed.% : LOG_% -grep Failed $($<) > $@ echo "TOTAL failed = `wc -l $@`" >> $@ %.0 : $(LOG_0) -grep $* $+ | grep "%" | grep -v " 0%" > $@ echo "TOTAL $* = \ `gawk 'BEGIN { cpt = 0; } { cpt += $$3; } END { print cpt; }' \ $@`" >> $@ %.2 : $(LOG_2) -grep $* $+ | grep "%" | grep -v " 0%" > $@ echo "TOTAL $* = \ `gawk 'BEGIN { cpt = 0; } { cpt += $$3; } END { print cpt; }' \ $@`" >> $@ res_% : RES_% @echo "=== Results for model $* :" grep "TOTAL" $($<) > $@ cat $@ failed.%.m : failed.% Makefile cat $< \ | grep -v " [cfg] switch handling" \ | grep -v " char constant expr" \ | grep -v " string constant expr" \ | grep -v " cast" \ | grep -v " logic function with labels" \ | grep -v " predicate with label" \ | grep -v " fol term range" \ | grep -v " unsupported C or logic type" \ > $@ # identification of "normal" (or known) failed cases f0 : failed.0.m -cat $< \ | grep -v ": indirect assign" \ | grep -v ": indirect access" \ | grep -v ": no assigns clause in called function" \ f2 : failed.2.m -cat $< \ | grep -v ": pointer to logic_type not implemented" \ clean : rm -f $(LOG_0) $(ERR_0) $(RES_0) LOG_0 ERR_0 RES_0 rm -f $(LOG_2) $(ERR_2) $(RES_2) LOG_2 ERR_2 RES_2 rm -f frama_c_journal.ml rm -f failed.*.m res_0 res_2 rm -f gwhy.cache # .SILENT : frama-c-20.0-Calcium/tests/more_wp/TODO0000666000000000000000000000167313571573400014524 0ustar - traiter les " global invariant". exemple : ../jessie/band.c ../../tests/jessie/init.c - gestion des variables globales const ? exemple : ../../tests/jessie/init2.c - 2 alloc donne des pointeurs diffrents exemple : ../../tests/jessie/alloc.c - ajouter les axiomes dans le fichiers why exemple : ../../tests/jessie/count_bits.c - intervale pour un enum (se ramener un invariant de type ?) exemple : ../../tests/jessie/enum.c - predicate avec label exemple : ../../tests/jessie/glob.c - dtection des labels non traits - tudier les tests : ../../tests/jessie/weber3.c tests/more_wp/bubblesort.c tests/more_wp/quicksort.c - pb traduction des dfinitions de prdicats en M2 (doit-on faire intervenir la memoire ou non ???) exemple : ../../tests/jessie/interval_arith.c avec M2 DONE : - simplification des let et forall - behaviors - some casts (integer -> integer and real -> real) - base_id for local variables frama-c-20.0-Calcium/tests/more_wp/bubblesort.c0000666000000000000000000000526613571573400016345 0ustar int a[100]; /*@ predicate my_sorted_array(int old_a[], integer start_index, integer end_index) = \forall integer k1, k2; start_index <= k1 <= k2 <= end_index ==> a[k1] <= a[k2]; */ /*@ predicate all_smaller_than_the_last (int old_a[], integer start_index, integer end_index) = \forall integer k1; start_index <= k1 < end_index ==> a[k1] <= a[end_index]; */ //use of swap funktion causes ERROR /*@ requires 0 < length; requires \valid_range(a, 0, length-1); ensures my_sorted_array(a, 0, length-1); */ void bubble_sort(int* old_a, int length) { int auf = 1; int ab; int fixed_auf = auf; /*@ loop invariant fixed_auf == auf; loop invariant 0 < auf <= length; loop invariant all_smaller_than_the_last(a, 0, auf-1); loop invariant my_sorted_array(a, 0, auf-1); loop invariant \forall integer k; auf < k < length ==> a[k] == \at(a[k], Pre); loop assigns auf, fixed_auf, ab, a[0..auf]; */ for (; auf < length; auf++, fixed_auf = auf) { //@ assert my_sorted_array(a, 0, auf-1); //IMPORTANT fixed_auf = auf; ab=auf; //@ assert my_sorted_array(a, ab, auf); /*@ loop invariant fixed_auf == auf; loop invariant 0 <= ab <= auf; loop invariant all_smaller_than_the_last(a, 0, auf-1); loop invariant my_sorted_array(a, 0, ab-1); loop invariant my_sorted_array(a, ab, auf); loop invariant \forall integer k; auf < k < length ==> a[k] == \at(a[k], Pre); loop assigns ab, a[0..auf]; */ while (0 < ab && a[ab] < a[ab-1]) { //@ assert my_sorted_array(a, 0, ab-1); //IMPORTANT //@ assert my_sorted_array(a, ab, auf); //IMPORTANT //@ assert a[ab] < a[ab-1]; //IMPORTANT //@ assert a[ab] <= a[auf]; int temp = a[ab]; a[ab] = a[ab-1]; a[ab-1] = temp; //@ assert a[ab-1] <= a[ab]; //IMPORTANT // not completely correct (actually <), because only swapped when a[ab] < a[ab-1], //@ assert my_sorted_array(a, ab+1, auf); // OK //@ assert a[ab] <= a[auf]; //Problem: should be correct but is not proven //Solved: is proven due to predicate "all_smaller_than_the_last" //@ assert my_sorted_array(a, 0, ab-2); //ok //IMPORTANT //@ assert ab < auf ==> all_smaller_than_the_last(a, ab, ab+1); // NEEDS TO BE PROVEN //@ assert a[ab] <= a[auf]; // NEEDS TO BE PROVEN //@ assert my_sorted_array(a, ab, auf); // FAILURE // ==> //@ assert my_sorted_array(a, ab-1, auf); //IMPORTANT ab = ab-1; //@ assert my_sorted_array(a, 0, ab-1); //IMPORTANT //@ assert my_sorted_array(a, ab, auf); //IMPORTANT } //@ assert my_sorted_array(a, 0, auf); //IMPORTANT } } frama-c-20.0-Calcium/tests/more_wp/quicksort.c0000666000000000000000000000524513571573400016223 0ustar /* FRAMAC_SHARE=share bin/viewer.opt -pp-annot tests/wp/quicksort.c */ /*external permut_ij : ptr -> ptr -> int -> int -> Prop : Quicksort ; external permut : ptr -> ptr -> Prop : Quicksort ; external high_bound : ptr -> int -> int -> int -> Prop : Quicksort ; external low_bound : ptr -> int -> int -> int -> Prop : Quicksort ; */ #define SIZE 100 int T[SIZE]; /*@ requires (0 <= i < SIZE) && (0 <= j < SIZE); ensures T[i] == \old(T[j]) && T[j] == \old(T[i]); assigns T[i], T[j]; */ void swap (int i, int j) { int v; v = T[i]; T[i] = T[j]; T[j] = v; } /*@ requires (0 <= l < i) && (i < SIZE) && (\forall int k; l+1 <= k <= i-1 ==> T[k] <= T[l]); ensures i-1 <= \result <= i && (\forall int k; l <= k <= \result ==> T[k] <= T[\result]) && (\forall int res; res == \result ==> T[l] == \old(T[res]) && T[res] == \old(T[l])) && T[\result] <= T[i]; */ int mv_pv (int l, int i) { int res; if (T[i] < T[l]) { swap(l, i); res = i; } else { swap(l, i - 1); res = i - 1; } return res; } /* Pre : (0 <= l < r) && r < length(T); Modifies : T; Post : (l <= result && result <= r) && high_bound (T, l, result, T[result]) && low_bound (T, result, r, T[result]) && permut (T, T@0) && (forall k:int. (k < l \/ k > r) => T[k] = T@0[k]); */ int partition (int l, int r) { int pv, i, j, res; pv = T[l]; i = l+1; j = r; while (i < j) /* Inv: (l+1 <= i <= r) && j <= r && i <= j+1 && permut (T, T@0) && high_bound (T, l+1, i-1, pv) && (low_bound (T, j+1, r, pv)) && (forall k:int. (k <= l \/ k > r) => T[k] = T@0[k]); Modifies : i, j, T; */ { while (T[i] <= pv && i < j) /* Inv: l+1 <= i <= r && high_bound (T, l+1, i-1, pv) && i <= j+1; Modifies : i; */ { i = i + 1; } while (T[j] >= pv && i < j) /* Inv: j <= r && low_bound (T, j+1, r, pv) && ~(T[i] <= pv && i < j) && i <= j+1; Modifies : j; */ { j = j - 1; } if (i < j) { swap( i, j); i = i + 1; j = j - 1; } } res = mv_pv (l, i); return res; } /* Pre: 0 <= l && r < length(T); Modifies: T; Post: (forall i j:int. l <= i <= j <= r => T[i] <= T[j]) && (forall k:int. (k < l \/ k > r) => T[k] = T@0[k]) && permut (T, T@0) ; */ void quick_rec (int l, int r) { int p; if (l < r) { p = partition(l, r); quick_rec(l, p-1); quick_rec(p+1, r); } } /* void sort (int n) Pre: n = length (T); Modifies: T; { quick_rec (0, n-1); } Post : (forall i j:int. (0 <= i <= j < n) => T[i] <= T[j]) && permut (T, T@0) ; */ frama-c-20.0-Calcium/tests/occurrence/0000777000000000000000000000000013571573400014505 5ustar frama-c-20.0-Calcium/tests/occurrence/decl_func.i0000666000000000000000000000036113571573400016601 0ustar /* run.config STDOPT: +"-occurrence" */ int x,y; /*@ predicate foo{L} = x == y; */ /*@ assigns \result \from \nothing; ensures \result == x + 1; */ int f(int x); int main () { int y = 0; int z = f(y); y = f(z); return f(y); } frama-c-20.0-Calcium/tests/occurrence/oracle/0000777000000000000000000000000013571573400015752 5ustar frama-c-20.0-Calcium/tests/occurrence/oracle/decl_func.res.oracle0000666000000000000000000000202413571573400021651 0ustar [kernel] Parsing tests/occurrence/decl_func.i (no preprocessing) [occurrence] beginning analysis [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] computing for function f <- main. Called from tests/occurrence/decl_func.i:16. [eva] using specification for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/occurrence/decl_func.i:17. [eva] Done for function f [eva] computing for function f <- main. Called from tests/occurrence/decl_func.i:18. [eva] Done for function f [eva] Recording results for main [eva] done for function main [occurrence] analysis done [occurrence] variable x (global): global: x variable y (global): global: y variable x (parameter of f): specification of f: x variable y_0 (local of main): sid 2: y_0 variable z (local of main): sid 3: z variable tmp_0 (local of main): sid 4: tmp_0 frama-c-20.0-Calcium/tests/occurrence/oracle/ptr_assert.res.oracle0000666000000000000000000000133713571573400022123 0ustar [kernel] Parsing tests/occurrence/ptr_assert.i (no preprocessing) [occurrence] beginning analysis [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] tests/occurrence/ptr_assert.i:11: assertion got status valid. [eva] tests/occurrence/ptr_assert.i:16: assertion got status valid. [eva] Recording results for main [eva] done for function main [occurrence] analysis done [occurrence] variable x (global): sid 1: x variable y (global): sid 4: y variable z (parameter of main): sid 10: z variable p (local of main): sid 2: p variable q (local of main): sid 4: q frama-c-20.0-Calcium/tests/occurrence/ptr_assert.i0000666000000000000000000000036713571573400017053 0ustar /* run.config GCC: STDOPT: +"-occurrence" */ int x, y; int main(int z) { int *p = &x, *q; *p = 0; /*@ assert (x == 0); */ q = &y; p = q; *q = 1; *p = 2; /*@ assert (y == 2 && *q == 2 && *p == 2 && x == 0); */ return z; } frama-c-20.0-Calcium/tests/occurrence/test_config0000666000000000000000000000014213571573400016731 0ustar STDOPT: +"-load-module" +"occurrence" -"-eva" -"-out" -"-input" -"-deps" +"-occurrence-verbose 1" frama-c-20.0-Calcium/tests/pdg/0000777000000000000000000000000013571573400013127 5ustar frama-c-20.0-Calcium/tests/pdg/README0000666000000000000000000000416013571573400014010 0ustar This file present the tests in ppc/test/pdg that deal with the Program Dependence Graph computation. ** tests/pdg/dpds_intra.c many small tests for the PDG. The function "test_ctrl_dpd_multiple" is a case where some PDG nodes should have more than one control dependencies, but it cannot be tested because the value analysis doesn't work on that case. ** tests/pdg/simple_call.c tests for the PDG of function calls. ** tests/pdg/calls_and_implicits.c test the PDG for dependencies between global variables in calls. Check if inputs and outputs are not mixed up. ** tests/pdg/calls_and_struct.c test the PDG for dependencies with structures. In the function 'asgn_struct' we see that the precision could be better. ** tests/pdg/decl_dpds.c test the PDG with pointers and global variables. ** tests/pdg/globals.c Some tests to have more information about value analysis results. Some of the results seem strange... ** tests/pdg/inter_alias2.c Test the PDG with pointers. Show that the alias analysis merge the contexts and the precison problem. ** tests/pdg/inter_alias.c Test the PDG with pointers. ** tests/pdg/multiple_calls.c Test the PDG for call through function pointer. ** tests/pdg/no_body.c Test the PDG for call to a function that has no body. It is strange that the result of the function doesn't depend on the inputs, but it is the behaviour of the whole tool. ** tests/pdg/pb_infinite_loop.c Infinite loop => no post-dominator computation (not defined in this case). Not-Implemented-Yet ! We should over-approximate the control dependencies in the loop so that every statement depend on every test. ** tests/pdg/variadic.c Test a call to a function with a variable number of arguments. The PDG of the variadic function is not computed -> TOP. ** tests/pdg/dyn_dpds.c + tests/pdg/dyn_dpds.ml Test for the dynamic dependencies. ** tests/pdg/call.c A very simple example to generate graph for the documentation. ** tests/pdg/doc_dot.c A very simple example to show the different kinds of nodes and link in a .dot file (also for the documentation). frama-c-20.0-Calcium/tests/pdg/annot.c0000666000000000000000000000066313571573400014417 0ustar /* run.config STDOPT: +"-fct-pdg f1 -main f1" STDOPT: +"-fct-pdg loop -main loop" */ int G; int f1 (int x) { int a = 10; if (x < 10) x = 10; L : x++; //@ assert x > G+a ; x = 3; // @ assert x < \at(x,L) ; TODO : \at not implemented yet return x; } int loop (int n) { int i, s = 0; /*@ loop invariant 0 <= i <= n ; @ loop variant n-i; */ for (i = 0; i < n; i++) s += 2; return s; } frama-c-20.0-Calcium/tests/pdg/array_struct.i0000666000000000000000000000026413571573400016025 0ustar /* run.config STDOPT: +"-pdg" */ typedef struct { int a; int b; } ts; ts t[100]; void f(int c) { t[c].a=t[c].a; t[c].b=t[c].b; } void main(int c) { f(c); f(c); } frama-c-20.0-Calcium/tests/pdg/assigns.i0000666000000000000000000000035413571573400014752 0ustar /* run.config STDOPT: +"-pdg -calldeps" */ unsigned int x, y; //@ assigns x \from x; void f(void); int main() { x = 1U; y = 2U; f(); y = y + 2; return x+y; // There must be a data dependency edge to x = 1, but not y=2; } frama-c-20.0-Calcium/tests/pdg/bts1194.c0000666000000000000000000000106113571573400014400 0ustar /* run.config STDOPT: +"-eva -inout -pdg -calldeps -deps -then -slice-return main -then-last -print @EVA_OPTIONS@" */ int Y, X; volatile v; //@ assigns \result \from \nothing; int input(void); void f (void) { int l = 0; Y = input (); if (l > 0) { Y ++; } //@ assert Y > 0; } //@ ensures \false; void g() { while(1); } void h() { if (v) g(); else X = X + 2; // X is a sure output, as the other branch does not return } int main (void) { Y = 3; // Dead when slicing on the value of Y at the end of main f (); h(); return Y; } frama-c-20.0-Calcium/tests/pdg/call.c0000666000000000000000000000052713571573400014212 0ustar /* run.config GCC: STDOPT: +"-lib-entry -main g -pdg -pdg-dot tests/pdg/call " */ /* Ne pas modifier : exemple utilisé dans le rapport. */ /*BDOC*/ struct {int a; int b; } G; int A, B; int f (int a, int b) { G.b = b; return a + G.a; } int g (int x, int y, int z) { int r = f (x+y, z); A = G.a; B = G.b; return r; } frama-c-20.0-Calcium/tests/pdg/calls_and_implicits.c0000666000000000000000000000113113571573400017264 0ustar /* run.config * GCC: * STDOPT: +"-fct-pdg main -inout" * */ #define SIZE 5 int t[SIZE]; int G, G2; int f (void) { G += 2; return 1; } int f2 (void) { G2 = G; return G+1; } void swap (void) { int tmp = G; G = G2; G2 = tmp; } #ifdef __FRAMAC__ # define print() #else int printf(const char * restrict format, ...); void print (void) { int i; for (i = 0; i < SIZE; i++) printf ("t[%d] = %d\n", i, t[i]); printf ("G = %d ; G2 = %d\n\n", G, G2); } #endif int main (void) { G = 0; G2 = 0; t[G] = f(); t[G] = f(); G = f2(); print(); swap(); print(); return 0; } frama-c-20.0-Calcium/tests/pdg/calls_and_struct.c0000666000000000000000000000060513571573400016620 0ustar /* run.config GCC: STDOPT: +"-deps -input -out -inout -pdg" */ struct Tstr { int a; int b; int c; }; struct Tstr S; int A, B, C; int f (struct Tstr s) { A += s.a; S.a = S.b; return s.b; } int asgn_struct (void) { struct Tstr s = S; return s.a; /* \result FROM S{.a; .b; .c; }; */ } int main () { int a = asgn_struct (); A = a; B = 2; C = 3; return f (S); } frama-c-20.0-Calcium/tests/pdg/const.i0000666000000000000000000000113213571573400014424 0ustar /* run.config STDOPT: #"-eva -pdg -out -input -deps -calldeps -pdg" */ struct T1 { int M1 ; int M2 ; }; struct T2 { struct T1 *M3 ; struct T1 *M4 ; }; typedef struct T2 T3; struct T4 { struct T1 *M5 ; }; typedef struct T4 T5; struct T1 G1; struct T1 G2; struct T1 G3; T5 const G4 = {.M5 = & G1}; void F1(T3 * const f1) { (f1->M4)->M2 = (f1->M3)->M2; return; } int F2(T5 * const f2) { int V1 = 1; (f2->M5)->M1 = 0; return V1; } T3 const G5 = {.M3 = & G2, .M4 = & G3}; int main(void) { int V2; F2((T5 *)(& G4)); G2 = G1; F1((T3 *)(& G5)); V2 = 0; return V2; } frama-c-20.0-Calcium/tests/pdg/decl_dpds.c0000666000000000000000000000056113571573400015216 0ustar /* run.config GCC: STDOPT: +"-fct-pdg main" */ extern int G; typedef struct { int a; int b; } Tstr; extern Tstr S; int main (int argc, char *argv[4]) { int argc0 = argc++; int argc1 = argc; char c = argv[argc-1][0]; argv[argc-1][0] = 'a'; argc = 0; if (argc0) { int * p = &argc0; *p = *p + 1; } return argc0 + argc1 + G + S.a; } frama-c-20.0-Calcium/tests/pdg/doc_dot.c0000666000000000000000000000050013571573400014701 0ustar /* run.config STDOPT: +"-lib-entry -main g -fct-pdg g -pdg-dot tests/pdg/doc" */ /* To build the svg file: * dot -Tsvg tests/pdg/doc.g.dot > tests/pdg/doc.g.svg */ int G1, G2, T[10]; int f (int a, int b, int c) { return a+c; } int g (void) { int x = f(G1, G2, 0); if (0 < x && x < 10) T[x] = 0; return x; } frama-c-20.0-Calcium/tests/pdg/dpds_intra.c0000666000000000000000000000442213571573400015424 0ustar /* run.config GCC: STDOPT: +"-fct-pdg test_struct" STDOPT: +"-fct-pdg test_if_simple" STDOPT: +"-fct-pdg test_goto_simple" STDOPT: +"-fct-pdg test_goto_arriere" STDOPT: +"-fct-pdg test_goto_else" STDOPT: +"-main test_ctrl_dpd_multiple " => ne passe pas STDOPT: +"-fct-pdg test_simple_loop" STDOPT: +"-fct-pdg main" STDOPT: +"-fct-pdg multiple_global_inputs" */ /* bin/toplevel.opt -deps -main g tests/slicing/dpds_intra.c */ /* bin/toplevel.opt -fct-pdg test_goto_simple tests/slicing/dpds_intra.c -pdg-dot */ extern int G; typedef struct { int a; int b; } Tstr; extern Tstr S; int test_struct (void) { Tstr s1, s2; s1.a = 1; /* s1.b = 2; */ s2 = s1; return s2.a; } int multiple_global_inputs (void) { return S.a + G; } int test_if_simple (void) { int x0 = 0, x1 = 1, x2 = 2, x3 = 10, x; if (G < x0) /* G < 0 */ x = x0; else /* G >= 0 */ if (G < x1) /* G < 1 */ x = x1; else /* G >= 1 */ if (G > x2) { /* G > 2 */ if (G < x3) x = x3; else x = -1; } // pas de else return x; } int test_goto_simple (void) { int r; if (G > 0) goto Lelse; r = -1; goto Lfin; Lelse : r = 1; Lfin : return r; } int test_goto_arriere (void) { int x = 1; L : x++; if (G-- > 0) goto L; return x; } int test_goto_else (void) { int x, a, b = 0; if (G) { x = 1; goto L; } else { a = 1; L : b = 1; } return b; } /* ne passe pas l'analyse de valeur (bouclage) ./bin/toplevel.opt -eva -main test_ctrl_dpd_multiple tests/slicing/dpds_intra.c * cf. mail Pascal Re: loop_pragma UNROLL_LOOP du 09.05.2006 15:03 */ int test_ctrl_dpd_multiple (void) { int x = 0; if (G > 3) x = 1; else L : x = x - 2; if (G < x) goto L; return x; } int test_simple_loop (int n) { int i, s = 0; for (i = 0; i < n; i++) { s++; } return s; } int main (void) { int a; int b = G; int res = 0; Tstr s = { 1, 2 }; int *p; a = b++ + s.a; b = 2*a; if (b > G) p = &a; else { int a = 1; p = &b; a++; } *p += 1; res += test_struct (); res += test_if_simple (); res += test_goto_simple (); res += test_goto_arriere (); res += test_goto_else (); res += test_simple_loop (G); res += multiple_global_inputs (); return *p + res; } frama-c-20.0-Calcium/tests/pdg/dyn_dpds.c0000666000000000000000000000077613571573400015111 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs STDOPT: +"-load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -deps" */ /* To have a look at the dot PDG : bin/toplevel.byte -deps -pdg-dot pdg -fct-pdg main @PTEST_DIR@/@PTEST_NAME@.c ; zgrviewer pdg.main.dot or use @PTEST_DIR@/@PTEST_NAME@.ml to test the dynamic dependencies. */ int G; int main (int a, int b, int c) { int x; int * p ; x = a + b; p = &x; if (c < 0) { x = -x; //@assert (*p > G); } return x; } frama-c-20.0-Calcium/tests/pdg/dyn_dpds.ml0000666000000000000000000000332713571573400015272 0ustar (* make -s tests/pdg/dyn_dpds.byte ; \ tests/pdg/dyn_dpds.byte -deps tests/pdg/dyn_dpds.c; \ zgrviewer tests/pdg/dyn_dpds_1.dot ; \ zgrviewer tests/pdg/dyn_dpds_2.dot ; *) let get_zones str_data (stmt, kf) = let lval_term = !Db.Properties.Interp.term_lval kf str_data in let lval = !Db.Properties.Interp.term_lval_to_lval ~result:None lval_term in let loc = !Db.From.find_deps_no_transitivity stmt (Cil.new_exp ~loc:Cil_datatype.Location.unknown (Cil_types.Lval lval)) in loc let main _ = let memo_debug = Kernel.Debug.get () in Kernel.Debug.set 1; File.pretty_ast (); Kernel.Debug.set memo_debug ; let kf = Globals.Functions.find_def_by_name "main" in let pdg = !Db.Pdg.get kf in Format.printf "%a@." (!Db.Pdg.pretty ~bw:false) pdg; !Db.Pdg.extract pdg "tests/pdg/dyn_dpds_0.dot"; let assert_sid = 5 in (* assert ( *p>G) *) let assert_stmt, kf = Kernel_function.find_from_sid assert_sid in let _assert_node = match !Db.Pdg.find_simple_stmt_nodes pdg assert_stmt with | n::[] -> n | _ -> assert false in let star_p = get_zones "*p" (assert_stmt, kf) in let data_nodes, undef = !Db.Pdg.find_location_nodes_at_stmt pdg assert_stmt ~before:true star_p in assert (undef = None); let g_zone = get_zones "G" (assert_stmt, kf) in let g_nodes, undef = !Db.Pdg.find_location_nodes_at_stmt pdg assert_stmt ~before:true g_zone in let _data_nodes = g_nodes @ data_nodes in let undef = match undef with None -> assert false | Some z -> z in Format.printf "Warning : cannot select %a in this function...@\n" Locations.Zone.pretty undef; Format.printf "%a@." (!Db.Pdg.pretty ~bw:false) pdg; !Db.Pdg.extract pdg "tests/pdg/dyn_dpds_1.dot" let () = Db.Main.extend main frama-c-20.0-Calcium/tests/pdg/globals.c0000666000000000000000000000103513571573400014715 0ustar /* run.config GCC: STDOPT: #"-load-module pdg -eva -out -input -deps -main g" STDOPT: #"-load-module pdg -eva -out -input -deps -main h" STDOPT: #"-load-module pdg -eva -out -input -deps -main f" */ struct Tstr; extern int X; extern struct Tstr S; int f (struct Tstr * p) { return p ? X : 0; } int g (void) { return f (&S); } struct Tstr { int a; int b;}; struct Tstr2 { int a2; int b2; struct { int c2; } s2; }; int X = 3; int *P = &X; int h (int x) { struct Tstr2 s2; s2.a2 = x; s2.b2 = *P; return s2.a2 + s2.b2; } frama-c-20.0-Calcium/tests/pdg/inter_alias.c0000666000000000000000000000033613571573400015567 0ustar /* run.config GCC: STDOPT: +"-eva -out -input -calldeps -pdg" */ int G; int f1 (int * p1, int x1) { *p1 += G + x1; return *p1; } int main (void) { int a = 0, b = 0; f1(&a, 3); f1(&b, 4); return a+b; } frama-c-20.0-Calcium/tests/pdg/inter_alias2.c0000666000000000000000000000071413571573400015651 0ustar /* run.config * GCC: * STDOPT: +"-eva" * STDOPT: +"-calldeps -fct-pdg incr_ptr" * STDOPT: +"-calldeps -fct-pdg f1" * STDOPT: +"-calldeps -fct-pdg f2" */ void incr_ptr (int *p) { *p += 1; } int f1 (int a) { int x1 = a; incr_ptr (&x1); return x1; } int f2 (int b) { int x2 = b; incr_ptr (&x2); return x2; } int main (int i1, int i2) { int v1 = f1 (i1); int v2 = f2 (i2); /*@ slice pragma expr v1; */ return v1 + v2; } frama-c-20.0-Calcium/tests/pdg/loops.c0000666000000000000000000000516513571573400014436 0ustar /* run.config GCC: STDOPT: +"-lib-entry -main simple -fct-pdg simple " STDOPT: +"-lib-entry -main simple_with_break -fct-pdg simple_with_break " STDOPT: +"-lib-entry -main infinite -fct-pdg infinite " STDOPT: +"-lib-entry -main infinite2 -fct-pdg infinite2 " STDOPT: +"-lib-entry -main maybe_infinite -fct-pdg maybe_infinite " STDOPT: +"-lib-entry -main two_infinite_loops -fct-pdg two_infinite_loops " STDOPT: +"-lib-entry -main loop_with_goto -fct-pdg loop_with_goto " STDOPT: +"-lib-entry -main non_natural_loop -fct-pdg non_natural_loop " STDOPT: +"-lib-entry -main dead_code -fct-pdg dead_code " */ /* Choix de la fonction sur laquelle on travaille : F=maybe_infinite Pour voir le CFG : bin/toplevel.opt -lib-entry -main $F -deps -verbose tests/pdg/loops.c zgrviewer ./$F_cfg.dot Pour voir les postdominateurs : bin/toplevel.opt -lib-entry -main $F -fct-pdg $F -dot-postdom p tests/pdg/loops.c ; zgrviewer ./p.$F.dot Pour voir le PDG : bin/toplevel.opt -lib-entry -main $F -fct-pdg $F -pdg-dot pdg tests/pdg/loops.c ; zgrviewer ./pdg.$F.dot */ int after; int simple (int n) { int s = 0; int i = 0; while (i < n) { s += 2; i++; } after = 0; return s; } int simple_with_break (int n) { int s = 0; int i = 0; while (1) { if (i < n) { s += 2; i++; } else break; } after = 0; return s; } int infinite (int n) { int s = 0; int i = 0; while (1) { s += 2; i++; } after = 0; return s; } int infinite2 (int n) { int s = 0; int i = 1; while (i) { s += 2; } after = 0; return s; } int maybe_infinite (int n) { int s = 0, i = 0; if (n > 0) { while (1) { i+=1; if (s < 10) s += 2; i+=2; } } else s = 1; after = 0; return s; } int two_infinite_loops (int n) { int s = 0, i1 = 0, i2 = 0; if (n > 0) { while (1) { i1 += 1; if (s < 10) s += 2; else { i2 = 0; while (1) { i2++; } i2+=2; } i1+=2; } } else s = 1; after = 0; return s; } int loop_with_goto (int n) { if (n > 0) { L : n--; if (1) goto L; } return n; } /* this function is similar to [test_ctrl_dpd_multiple] in * [tests/pdg/dpds_intra.c] but the value analysis converges, * so we can see that [x=x+2;] has a control dependency on both [n<0] and [x 0) goto W; L: x+=n; return x; } frama-c-20.0-Calcium/tests/pdg/multiple_calls.c0000666000000000000000000000120313571573400016300 0ustar /* run.config GCC: STDOPT: +"-inout -deps -main appel_ptr_fct -fct-pdg appel_ptr_fct " STDOPT: +"-inout -deps -main appel_ptr_fct_bis -fct-pdg appel_ptr_fct_bis " */ extern int G1, G2, G3, G4; int fct1 (int x, int y, int z) { G1 = z; G3 = y; G4 = z; return x; } int fct2 (int x, int y, int z) { G2 = z; G3 = x; return y; } int appel_ptr_fct (int c, int d) { int a = 1, b = 2; int (*pf) (int, int, int) = c ? &fct1 : &fct2; int x = (*pf)(a, b, d); return x + G1 + G2; } int appel_ptr_fct_bis (int c, int a, int b, int d) { int (*pf) (int, int, int) = c ? &fct1 : &fct2; G4 = (*pf)(a, b, d); return G4 ; } frama-c-20.0-Calcium/tests/pdg/no_body.c0000666000000000000000000000054013571573400014723 0ustar /* run.config * GCC: * STDOPT: +"-fct-pdg main -inout " */ /* * ledit bin/toplevel.top tests/slicing/no_body.c -fct-pdg main * #use "tests/slicing/select.ml";; * test "loop" (select_data "G");; */ int G; int f (int a); void loop (int x) { while (f(x)) { x++; G++; } } void main (void) { int x = 1; G = f(x); loop (x); } frama-c-20.0-Calcium/tests/pdg/oracle/0000777000000000000000000000000013571573400014374 5ustar frama-c-20.0-Calcium/tests/pdg/oracle/annot.0.res.oracle0000666000000000000000000000200013571573400017620 0ustar [kernel] Parsing tests/pdg/annot.c (with preprocessing) [eva] Analyzing a complete application starting at f1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva:alarm] tests/pdg/annot.c:12: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] tests/pdg/annot.c:13: assertion got status valid. [eva] Recording results for f1 [eva] done for function f1 [pdg] computing for function f1 [pdg] done for function f1 [pdg] PDG for f1 {n1}: InCtrl {n2}: VarDecl : x -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : a {n5}: int a = 10; -[-c-]-> 1 -[a--]-> 4 {n6}: x < 10 -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n7}: x = 10; -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 6 {n8}: L: -[-c-]-> 1 {n9}: L: x ++; -[-c-]-> 1 -[a-d]-> 2 -[--d]-> 3 -[--d]-> 7 {n10}: ; -[-c-]-> 1 {n11}: x = 3; -[-c-]-> 1 -[a--]-> 2 {n12}: return x; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 11 {n13}: OutRet -[--d]-> 12 frama-c-20.0-Calcium/tests/pdg/oracle/annot.1.res.oracle0000666000000000000000000000263213571573400017634 0ustar [kernel] Parsing tests/pdg/annot.c (with preprocessing) [eva] Analyzing a complete application starting at loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva:alarm] tests/pdg/annot.c:22: Warning: loop invariant got status unknown. [eva] tests/pdg/annot.c:25: starting to merge loop iterations [eva:alarm] tests/pdg/annot.c:26: Warning: signed overflow. assert s + 2 ≤ 2147483647; [eva] Recording results for loop [eva] done for function loop [pdg] computing for function loop [pdg] done for function loop [pdg] PDG for loop {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : i {n5}: VarDecl : s {n6}: int s = 0; -[-c-]-> 1 -[a--]-> 5 {n7}: i = 0; -[-c-]-> 1 -[a--]-> 4 {n8}: while(1) -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 12 {n9}: i < n -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 4 -[--d]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[--d]-> 11 -[-c-]-> 12 {n10}: s += 2; -[-c-]-> 1 -[a-d]-> 5 -[--d]-> 6 -[-c-]-> 8 -[-c-]-> 9 -[--d]-> 10 -[-c-]-> 12 {n11}: i ++; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[--d]-> 11 -[-c-]-> 12 {n12}: break; -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 12 {n13}: return s; -[-c-]-> 1 -[--d]-> 5 -[--d]-> 6 -[--d]-> 10 {n14}: OutRet -[--d]-> 13 frama-c-20.0-Calcium/tests/pdg/oracle/array_struct.res.oracle0000666000000000000000000002633513571573400021106 0ustar [kernel] Parsing tests/pdg/array_struct.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..99] ∈ {0} [eva] computing for function f <- main. Called from tests/pdg/array_struct.i:18. [eva:alarm] tests/pdg/array_struct.i:13: Warning: accessing out of bounds index. assert 0 ≤ c; [eva:alarm] tests/pdg/array_struct.i:13: Warning: accessing out of bounds index. assert c < 100; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/pdg/array_struct.i:19. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [pdg] computing for function f [pdg] done for function f [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for f {n1}: InCtrl {n2}: VarDecl : c -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: t[c].a = t[c].a; -[-c-]-> 1 -[a-d]-> 2 -[a-d]-> 3 -[--d]-> 8 {n5}: t[c].b = t[c].b; -[-c-]-> 1 -[a-d]-> 2 -[a-d]-> 3 -[--d]-> 7 {n6}: return; -[-c-]-> 1 {n7}: In(t{[0].b; [1].b; [2].b; [3].b; [4].b; [5].b; [6].b; [7].b; [8].b; [9].b; [10].b; [11].b; [12].b; [13].b; [14].b; [15].b; [16].b; [17].b; [18].b; [19].b; [20].b; [21].b; [22].b; [23].b; [24].b; [25].b; [26].b; [27].b; [28].b; [29].b; [30].b; [31].b; [32].b; [33].b; [34].b; [35].b; [36].b; [37].b; [38].b; [39].b; [40].b; [41].b; [42].b; [43].b; [44].b; [45].b; [46].b; [47].b; [48].b; [49].b; [50].b; [51].b; [52].b; [53].b; [54].b; [55].b; [56].b; [57].b; [58].b; [59].b; [60].b; [61].b; [62].b; [63].b; [64].b; [65].b; [66].b; [67].b; [68].b; [69].b; [70].b; [71].b; [72].b; [73].b; [74].b; [75].b; [76].b; [77].b; [78].b; [79].b; [80].b; [81].b; [82].b; [83].b; [84].b; [85].b; [86].b; [87].b; [88].b; [89].b; [90].b; [91].b; [92].b; [93].b; [94].b; [95].b; [96].b; [97].b; [98].b; [99].b}) {n8}: In(t{[0].a; [1].a; [2].a; [3].a; [4].a; [5].a; [6].a; [7].a; [8].a; [9].a; [10].a; [11].a; [12].a; [13].a; [14].a; [15].a; [16].a; [17].a; [18].a; [19].a; [20].a; [21].a; [22].a; [23].a; [24].a; [25].a; [26].a; [27].a; [28].a; [29].a; [30].a; [31].a; [32].a; [33].a; [34].a; [35].a; [36].a; [37].a; [38].a; [39].a; [40].a; [41].a; [42].a; [43].a; [44].a; [45].a; [46].a; [47].a; [48].a; [49].a; [50].a; [51].a; [52].a; [53].a; [54].a; [55].a; [56].a; [57].a; [58].a; [59].a; [60].a; [61].a; [62].a; [63].a; [64].a; [65].a; [66].a; [67].a; [68].a; [69].a; [70].a; [71].a; [72].a; [73].a; [74].a; [75].a; [76].a; [77].a; [78].a; [79].a; [80].a; [81].a; [82].a; [83].a; [84].a; [85].a; [86].a; [87].a; [88].a; [89].a; [90].a; [91].a; [92].a; [93].a; [94].a; [95].a; [96].a; [97].a; [98].a; [99].a}) [pdg] PDG for main {n9}: InCtrl {n10}: VarDecl : c -[a--]-> 11 {n11}: In1 -[a--]-> 10 {n12}: Call5-InCtrl : f(c); -[-c-]-> 9 {n13}: Call5-In1 : f(c); -[-c-]-> 9 -[--d]-> 10 -[--d]-> 11 -[-c-]-> 12 {n14}: Call5-Out(t{[0].a; [1].a; [2].a; [3].a; [4].a; [5].a; [6].a; [7].a; [8].a; [9].a; [10].a; [11].a; [12].a; [13].a; [14].a; [15].a; [16].a; [17].a; [18].a; [19].a; [20].a; [21].a; [22].a; [23].a; [24].a; [25].a; [26].a; [27].a; [28].a; [29].a; [30].a; [31].a; [32].a; [33].a; [34].a; [35].a; [36].a; [37].a; [38].a; [39].a; [40].a; [41].a; [42].a; [43].a; [44].a; [45].a; [46].a; [47].a; [48].a; [49].a; [50].a; [51].a; [52].a; [53].a; [54].a; [55].a; [56].a; [57].a; [58].a; [59].a; [60].a; [61].a; [62].a; [63].a; [64].a; [65].a; [66].a; [67].a; [68].a; [69].a; [70].a; [71].a; [72].a; [73].a; [74].a; [75].a; [76].a; [77].a; [78].a; [79].a; [80].a; [81].a; [82].a; [83].a; [84].a; [85].a; [86].a; [87].a; [88].a; [89].a; [90].a; [91].a; [92].a; [93].a; [94].a; [95].a; [96].a; [97].a; [98].a; [99].a}) : f(c); -[-c-]-> 9 -[-c-]-> 12 -[--d]-> 13 -[--d]-> 22 {n15}: Call5-Out(t{[0].b; [1].b; [2].b; [3].b; [4].b; [5].b; [6].b; [7].b; [8].b; [9].b; [10].b; [11].b; [12].b; [13].b; [14].b; [15].b; [16].b; [17].b; [18].b; [19].b; [20].b; [21].b; [22].b; [23].b; [24].b; [25].b; [26].b; [27].b; [28].b; [29].b; [30].b; [31].b; [32].b; [33].b; [34].b; [35].b; [36].b; [37].b; [38].b; [39].b; [40].b; [41].b; [42].b; [43].b; [44].b; [45].b; [46].b; [47].b; [48].b; [49].b; [50].b; [51].b; [52].b; [53].b; [54].b; [55].b; [56].b; [57].b; [58].b; [59].b; [60].b; [61].b; [62].b; [63].b; [64].b; [65].b; [66].b; [67].b; [68].b; [69].b; [70].b; [71].b; [72].b; [73].b; [74].b; [75].b; [76].b; [77].b; [78].b; [79].b; [80].b; [81].b; [82].b; [83].b; [84].b; [85].b; [86].b; [87].b; [88].b; [89].b; [90].b; [91].b; [92].b; [93].b; [94].b; [95].b; [96].b; [97].b; [98].b; [99].b}) : f(c); -[-c-]-> 9 -[-c-]-> 12 -[--d]-> 13 -[--d]-> 21 {n16}: Call6-InCtrl : f(c); -[-c-]-> 9 {n17}: Call6-In1 : f(c); -[-c-]-> 9 -[--d]-> 10 -[--d]-> 11 -[-c-]-> 16 {n18}: Call6-Out(t{[0].a; [1].a; [2].a; [3].a; [4].a; [5].a; [6].a; [7].a; [8].a; [9].a; [10].a; [11].a; [12].a; [13].a; [14].a; [15].a; [16].a; [17].a; [18].a; [19].a; [20].a; [21].a; [22].a; [23].a; [24].a; [25].a; [26].a; [27].a; [28].a; [29].a; [30].a; [31].a; [32].a; [33].a; [34].a; [35].a; [36].a; [37].a; [38].a; [39].a; [40].a; [41].a; [42].a; [43].a; [44].a; [45].a; [46].a; [47].a; [48].a; [49].a; [50].a; [51].a; [52].a; [53].a; [54].a; [55].a; [56].a; [57].a; [58].a; [59].a; [60].a; [61].a; [62].a; [63].a; [64].a; [65].a; [66].a; [67].a; [68].a; [69].a; [70].a; [71].a; [72].a; [73].a; [74].a; [75].a; [76].a; [77].a; [78].a; [79].a; [80].a; [81].a; [82].a; [83].a; [84].a; [85].a; [86].a; [87].a; [88].a; [89].a; [90].a; [91].a; [92].a; [93].a; [94].a; [95].a; [96].a; [97].a; [98].a; [99].a}) : f(c); -[-c-]-> 9 -[--d](t{[0].a; [1].a; [2].a; [3].a; [4].a; [5].a; [6].a; [7].a; [8].a; [9].a; [10].a; [11].a; [12].a; [13].a; [14].a; [15].a; [16].a; [17].a; [18].a; [19].a; [20].a; [21].a; [22].a; [23].a; [24].a; [25].a; [26].a; [27].a; [28].a; [29].a; [30].a; [31].a; [32].a; [33].a; [34].a; [35].a; [36].a; [37].a; [38].a; [39].a; [40].a; [41].a; [42].a; [43].a; [44].a; [45].a; [46].a; [47].a; [48].a; [49].a; [50].a; [51].a; [52].a; [53].a; [54].a; [55].a; [56].a; [57].a; [58].a; [59].a; [60].a; [61].a; [62].a; [63].a; [64].a; [65].a; [66].a; [67].a; [68].a; [69].a; [70].a; [71].a; [72].a; [73].a; [74].a; [75].a; [76].a; [77].a; [78].a; [79].a; [80].a; [81].a; [82].a; [83].a; [84].a; [85].a; [86].a; [87].a; [88].a; [89].a; [90].a; [91].a; [92].a; [93].a; [94].a; [95].a; [96].a; [97].a; [98].a; [99].a})-> 14 -[-c-]-> 16 -[--d]-> 17 -[--d]-> 22 {n19}: Call6-Out(t{[0].b; [1].b; [2].b; [3].b; [4].b; [5].b; [6].b; [7].b; [8].b; [9].b; [10].b; [11].b; [12].b; [13].b; [14].b; [15].b; [16].b; [17].b; [18].b; [19].b; [20].b; [21].b; [22].b; [23].b; [24].b; [25].b; [26].b; [27].b; [28].b; [29].b; [30].b; [31].b; [32].b; [33].b; [34].b; [35].b; [36].b; [37].b; [38].b; [39].b; [40].b; [41].b; [42].b; [43].b; [44].b; [45].b; [46].b; [47].b; [48].b; [49].b; [50].b; [51].b; [52].b; [53].b; [54].b; [55].b; [56].b; [57].b; [58].b; [59].b; [60].b; [61].b; [62].b; [63].b; [64].b; [65].b; [66].b; [67].b; [68].b; [69].b; [70].b; [71].b; [72].b; [73].b; [74].b; [75].b; [76].b; [77].b; [78].b; [79].b; [80].b; [81].b; [82].b; [83].b; [84].b; [85].b; [86].b; [87].b; [88].b; [89].b; [90].b; [91].b; [92].b; [93].b; [94].b; [95].b; [96].b; [97].b; [98].b; [99].b}) : f(c); -[-c-]-> 9 -[--d](t{[0].b; [1].b; [2].b; [3].b; [4].b; [5].b; [6].b; [7].b; [8].b; [9].b; [10].b; [11].b; [12].b; [13].b; [14].b; [15].b; [16].b; [17].b; [18].b; [19].b; [20].b; [21].b; [22].b; [23].b; [24].b; [25].b; [26].b; [27].b; [28].b; [29].b; [30].b; [31].b; [32].b; [33].b; [34].b; [35].b; [36].b; [37].b; [38].b; [39].b; [40].b; [41].b; [42].b; [43].b; [44].b; [45].b; [46].b; [47].b; [48].b; [49].b; [50].b; [51].b; [52].b; [53].b; [54].b; [55].b; [56].b; [57].b; [58].b; [59].b; [60].b; [61].b; [62].b; [63].b; [64].b; [65].b; [66].b; [67].b; [68].b; [69].b; [70].b; [71].b; [72].b; [73].b; [74].b; [75].b; [76].b; [77].b; [78].b; [79].b; [80].b; [81].b; [82].b; [83].b; [84].b; [85].b; [86].b; [87].b; [88].b; [89].b; [90].b; [91].b; [92].b; [93].b; [94].b; [95].b; [96].b; [97].b; [98].b; [99].b})-> 15 -[-c-]-> 16 -[--d]-> 17 -[--d]-> 21 {n20}: return; -[-c-]-> 9 {n21}: In(t{[0].b; [1].b; [2].b; [3].b; [4].b; [5].b; [6].b; [7].b; [8].b; [9].b; [10].b; [11].b; [12].b; [13].b; [14].b; [15].b; [16].b; [17].b; [18].b; [19].b; [20].b; [21].b; [22].b; [23].b; [24].b; [25].b; [26].b; [27].b; [28].b; [29].b; [30].b; [31].b; [32].b; [33].b; [34].b; [35].b; [36].b; [37].b; [38].b; [39].b; [40].b; [41].b; [42].b; [43].b; [44].b; [45].b; [46].b; [47].b; [48].b; [49].b; [50].b; [51].b; [52].b; [53].b; [54].b; [55].b; [56].b; [57].b; [58].b; [59].b; [60].b; [61].b; [62].b; [63].b; [64].b; [65].b; [66].b; [67].b; [68].b; [69].b; [70].b; [71].b; [72].b; [73].b; [74].b; [75].b; [76].b; [77].b; [78].b; [79].b; [80].b; [81].b; [82].b; [83].b; [84].b; [85].b; [86].b; [87].b; [88].b; [89].b; [90].b; [91].b; [92].b; [93].b; [94].b; [95].b; [96].b; [97].b; [98].b; [99].b}) {n22}: In(t{[0].a; [1].a; [2].a; [3].a; [4].a; [5].a; [6].a; [7].a; [8].a; [9].a; [10].a; [11].a; [12].a; [13].a; [14].a; [15].a; [16].a; [17].a; [18].a; [19].a; [20].a; [21].a; [22].a; [23].a; [24].a; [25].a; [26].a; [27].a; [28].a; [29].a; [30].a; [31].a; [32].a; [33].a; [34].a; [35].a; [36].a; [37].a; [38].a; [39].a; [40].a; [41].a; [42].a; [43].a; [44].a; [45].a; [46].a; [47].a; [48].a; [49].a; [50].a; [51].a; [52].a; [53].a; [54].a; [55].a; [56].a; [57].a; [58].a; [59].a; [60].a; [61].a; [62].a; [63].a; [64].a; [65].a; [66].a; [67].a; [68].a; [69].a; [70].a; [71].a; [72].a; [73].a; [74].a; [75].a; [76].a; [77].a; [78].a; [79].a; [80].a; [81].a; [82].a; [83].a; [84].a; [85].a; [86].a; [87].a; [88].a; [89].a; [90].a; [91].a; [92].a; [93].a; [94].a; [95].a; [96].a; [97].a; [98].a; [99].a}) frama-c-20.0-Calcium/tests/pdg/oracle/assigns.res.oracle0000666000000000000000000000303213571573400020020 0ustar [kernel] Parsing tests/pdg/assigns.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] computing for function f <- main. Called from tests/pdg/assigns.i:13. [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/pdg/assigns.i:13 (by main): x FROM x (and SELF) [from] entry point: x FROM \nothing y FROM \nothing \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [pdg] computing for function f [from] Computing for function f [from] Done for function f [pdg] done for function f [pdg] computing for function main [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for f {n1}: InCtrl {n2}: Out(x) -[--d]-> 3 {n3}: In(x) [pdg] PDG for main {n4}: InCtrl {n5}: VarDecl : __retres {n6}: x = 1U; -[-c-]-> 4 {n7}: y = 2U; -[-c-]-> 4 {n8}: Call3-InCtrl : f(); -[-c-]-> 4 {n9}: Call3-Out(x) : f(); -[-c-]-> 4 -[--d]-> 6 -[-c-]-> 8 {n10}: y += (unsigned int)2; -[-c-]-> 4 -[--d]-> 7 {n11}: __retres = (int)(x + y); -[-c-]-> 4 -[a--]-> 5 -[--d]-> 6 -[--d](x)-> 9 -[--d]-> 10 {n12}: return __retres; -[-c-]-> 4 -[--d]-> 5 -[--d]-> 11 {n13}: OutRet -[--d]-> 12 frama-c-20.0-Calcium/tests/pdg/oracle/bts1194.res.oracle0000666000000000000000000001575613571573400017500 0ustar [kernel] Parsing tests/pdg/bts1194.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Y ∈ {0} X ∈ {0} v ∈ [--..--] [eva] computing for function f <- main. Called from tests/pdg/bts1194.c:32. [eva] computing for function input <- f <- main. Called from tests/pdg/bts1194.c:13. [eva] using specification for function input [eva] Done for function input [eva:alarm] tests/pdg/bts1194.c:17: Warning: assertion got status unknown. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function h <- main. Called from tests/pdg/bts1194.c:33. [eva] computing for function g <- h <- main. Called from tests/pdg/bts1194.c:26. [eva] tests/pdg/bts1194.c:20: function g: no state left, postcondition got status valid. [eva] Recording results for g [from] Computing for function g [from] Non-terminating function g (no dependencies) [from] Done for function g [eva] Done for function g [eva] Recording results for h [from] Computing for function h [from] Done for function h [eva] Done for function h [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: NON TERMINATING FUNCTION [eva:final-states] Values at end of function h: X ∈ {2} [eva:final-states] Values at end of function f: Y ∈ [1..2147483647] l ∈ {0} [eva:final-states] Values at end of function main: Y ∈ [1..2147483647] X ∈ {2} [from] Computing for function g [from] Non-terminating function g (no dependencies) [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function f [from] Computing for function input <-f [from] Done for function input [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: NON TERMINATING - NO EFFECTS [from] Function h: X FROM X; v [from] Function input: \result FROM \nothing [from] Function f: Y FROM \nothing [from] Function main: Y FROM \nothing X FROM X; v \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to g at tests/pdg/bts1194.c:26 (by h): NON TERMINATING - NO EFFECTS [from] call to input at tests/pdg/bts1194.c:13 (by f): \result FROM \nothing [from] call to f at tests/pdg/bts1194.c:32 (by main): Y FROM \nothing [from] call to h at tests/pdg/bts1194.c:33 (by main): X FROM X; v [from] entry point: Y FROM \nothing X FROM X; v \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] InOut (internal) for function g: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: ANYTHING(origin:Unknown) [inout] InOut (internal) for function h: Operational inputs: X; v Operational inputs on termination: X; v Sure outputs: X [inout] InOut (internal) for function f: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: Y; l [inout] InOut (internal) for function main: Operational inputs: X; v Operational inputs on termination: X; v Sure outputs: Y; X [pdg] computing for function g [pdg] tests/pdg/bts1194.c:22: Warning: no final state. Probably unreachable... [pdg] done for function g [pdg] computing for function h [pdg] done for function h [pdg] computing for function input [pdg] done for function input [pdg] computing for function f [pdg] done for function f [pdg] computing for function main [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for g {n1}: InCtrl {n2}: while(1) -[-c-]-> 1 -[-c-]-> 2 {n3}: return; -[-c-]-> 1 [pdg] PDG for h {n4}: InCtrl {n5}: v -[-c-]-> 4 -[--d]-> 10 {n6}: Call15-InCtrl : g(); -[-c-]-> 4 -[-c-]-> 5 {n7}: X += 2; -[-c-]-> 4 -[-c-]-> 5 -[--d]-> 9 {n8}: return; -[-c-]-> 4 {n9}: In(X) {n10}: In(v) [pdg] PDG for input {n11}: InCtrl {n12}: OutRet [pdg] PDG for f {n13}: InCtrl {n14}: VarDecl : l {n15}: int l = 0; -[-c-]-> 13 -[a--]-> 14 {n16}: Call2-InCtrl : Y = input(); -[-c-]-> 13 {n17}: Call2-OutRet : Y = input(); -[-c-]-> 13 -[-c-]-> 16 {n18}: l > 0 -[-c-]-> 13 -[--d]-> 14 -[--d]-> 15 {n19}: ; -[-c-]-> 13 {n20}: return; -[-c-]-> 13 [pdg] PDG for main {n21}: InCtrl {n22}: Y = 3; -[-c-]-> 21 {n23}: Call20-InCtrl : f(); -[-c-]-> 21 {n24}: Call20-Out(Y) : f(); -[-c-]-> 21 -[-c-]-> 23 {n25}: Call21-InCtrl : h(); -[-c-]-> 21 {n26}: Call21-Out(X) : h(); -[-c-]-> 21 -[-c-]-> 25 -[--d]-> 29 -[--d]-> 30 {n27}: return Y; -[-c-]-> 21 -[--d](Y)-> 24 {n28}: OutRet -[--d]-> 27 {n29}: In(X) {n30}: In(v) [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Y ∈ {0} [eva] computing for function f_slice_1 <- main. Called from tests/pdg/bts1194.c:32. [eva] computing for function input <- f_slice_1 <- main. Called from tests/pdg/bts1194.c:13. [kernel:annot:missing-spec] tests/pdg/bts1194.c:13: Warning: Neither code nor specification for function input, generating default assigns from the prototype [eva] using specification for function input [eva] Done for function input [eva:alarm] tests/pdg/bts1194.c:17: Warning: assertion got status unknown. [eva] Recording results for f_slice_1 [eva] Done for function f_slice_1 [eva] Recording results for main [eva] done for function main [pdg] computing for function input [from] Computing for function input [from] Done for function input [pdg] done for function input [pdg] computing for function f_slice_1 [pdg] done for function f_slice_1 [pdg] computing for function main [from] Computing for function f_slice_1 [from] Done for function f_slice_1 [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== /* Generated by Frama-C */ int Y; /*@ assigns \result; assigns \result \from \nothing; */ int input(void); void f_slice_1(void) { Y = input(); /*@ assert Y > 0; */ ; return; } int main(void) { f_slice_1(); return Y; } frama-c-20.0-Calcium/tests/pdg/oracle/call.res.oracle0000666000000000000000000000473113571573400017273 0ustar [kernel] Parsing tests/pdg/call.c (with preprocessing) [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] A ∈ [--..--] B ∈ [--..--] [eva:alarm] tests/pdg/call.c:18: Warning: signed overflow. assert -2147483648 ≤ x + y; [eva:alarm] tests/pdg/call.c:18: Warning: signed overflow. assert x + y ≤ 2147483647; [eva] computing for function f <- g. Called from tests/pdg/call.c:18. [eva:alarm] tests/pdg/call.c:14: Warning: signed overflow. assert -2147483648 ≤ a + G.a; [eva:alarm] tests/pdg/call.c:14: Warning: signed overflow. assert a + G.a ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [pdg] computing for function f [pdg] done for function f [pdg] dot file generated in tests/pdg/call.f.dot [pdg] computing for function g [from] Computing for function f [from] Done for function f [pdg] done for function g [pdg] dot file generated in tests/pdg/call.g.dot [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for f {n1}: InCtrl {n2}: VarDecl : a -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : b -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: VarDecl : __retres {n7}: G.b = b; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 5 {n8}: __retres = a + G.a; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[a--]-> 6 -[--d]-> 11 {n9}: return __retres; -[-c-]-> 1 -[--d]-> 6 -[--d]-> 8 {n10}: OutRet -[--d]-> 9 {n11}: In(G.a) [pdg] PDG for g {n12}: InCtrl {n13}: VarDecl : x -[a--]-> 14 {n14}: In1 -[a--]-> 13 {n15}: VarDecl : y -[a--]-> 16 {n16}: In2 -[a--]-> 15 {n17}: VarDecl : z -[a--]-> 18 {n18}: In3 -[a--]-> 17 {n19}: VarDecl : r {n20}: Call5-InCtrl : int r = f(x + y,z); -[-c-]-> 12 {n21}: Call5-In1 : int r = f(x + y,z); -[-c-]-> 12 -[--d]-> 13 -[--d]-> 14 -[--d]-> 15 -[--d]-> 16 -[-c-]-> 20 {n22}: Call5-In2 : int r = f(x + y,z); -[-c-]-> 12 -[--d]-> 17 -[--d]-> 18 -[-c-]-> 20 {n23}: Call5-Out(G.b) : int r = f(x + y,z); -[-c-]-> 12 -[-c-]-> 20 -[--d]-> 22 {n24}: Call5-OutRet : int r = f(x + y,z); -[-c-]-> 12 -[a--]-> 19 -[-c-]-> 20 -[--d]-> 21 -[--d]-> 29 {n25}: A = G.a; -[-c-]-> 12 -[--d]-> 29 {n26}: B = G.b; -[-c-]-> 12 -[--d](G.b)-> 23 {n27}: return r; -[-c-]-> 12 -[--d]-> 19 -[--d]-> 24 {n28}: OutRet -[--d]-> 27 {n29}: In(G.a) frama-c-20.0-Calcium/tests/pdg/oracle/calls_and_implicits.res.oracle0000666000000000000000000000553013571573400022353 0ustar [kernel] Parsing tests/pdg/calls_and_implicits.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..4] ∈ {0} G ∈ {0} G2 ∈ {0} [eva] computing for function f <- main. Called from tests/pdg/calls_and_implicits.c:34. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/pdg/calls_and_implicits.c:35. [eva] Recording results for f [eva] Done for function f [eva] computing for function f2 <- main. Called from tests/pdg/calls_and_implicits.c:36. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function swap <- main. Called from tests/pdg/calls_and_implicits.c:38. [eva] Recording results for swap [eva] Done for function swap [eva] Recording results for main [eva] done for function main [inout] InOut (internal) for function f: Operational inputs: G Operational inputs on termination: G Sure outputs: G; __retres [inout] InOut (internal) for function f2: Operational inputs: G Operational inputs on termination: G Sure outputs: G2; __retres [inout] InOut (internal) for function swap: Operational inputs: G; G2 Operational inputs on termination: G; G2 Sure outputs: G; G2; tmp [inout] InOut (internal) for function main: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: t{[0]; [2]}; G; G2; __retres [pdg] computing for function main [from] Computing for function f [from] Done for function f [from] Computing for function f2 [from] Done for function f2 [from] Computing for function swap [from] Done for function swap [pdg] done for function main [pdg] PDG for main {n1}: InCtrl {n2}: VarDecl : __retres {n3}: G = 0; -[-c-]-> 1 {n4}: G2 = 0; -[-c-]-> 1 {n5}: Call15-InCtrl : t[G] = f(); -[-c-]-> 1 {n6}: Call15-Out(G) : t[G] = f(); -[-c-]-> 1 -[--d]-> 3 -[-c-]-> 5 {n7}: Call15-OutRet : t[G] = f(); -[-c-]-> 1 -[-c-]-> 5 -[a--](G)-> 6 {n8}: Call16-InCtrl : t[G] = f(); -[-c-]-> 1 {n9}: Call16-Out(G) : t[G] = f(); -[-c-]-> 1 -[--d](G)-> 6 -[-c-]-> 8 {n10}: Call16-OutRet : t[G] = f(); -[-c-]-> 1 -[-c-]-> 8 -[a--](G)-> 9 {n11}: Call17-InCtrl : G = f2(); -[-c-]-> 1 {n12}: Call17-Out(G2) : G = f2(); -[-c-]-> 1 -[--d](G)-> 9 -[-c-]-> 11 {n13}: Call17-OutRet : G = f2(); -[-c-]-> 1 -[--d](G)-> 9 -[-c-]-> 11 {n14}: Call19-InCtrl : swap(); -[-c-]-> 1 {n15}: Call19-Out(G) : swap(); -[-c-]-> 1 -[--d](G2)-> 12 -[-c-]-> 14 {n16}: Call19-Out(G2) : swap(); -[-c-]-> 1 -[--d]-> 13 -[-c-]-> 14 {n17}: __retres = 0; -[-c-]-> 1 -[a--]-> 2 {n18}: return __retres; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 17 {n19}: OutRet -[--d]-> 18 frama-c-20.0-Calcium/tests/pdg/oracle/calls_and_struct.res.oracle0000666000000000000000000000764113571573400021707 0ustar [kernel] Parsing tests/pdg/calls_and_struct.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ {0} A ∈ {0} B ∈ {0} C ∈ {0} [eva] computing for function asgn_struct <- main. Called from tests/pdg/calls_and_struct.c:23. [eva] Recording results for asgn_struct [eva] Done for function asgn_struct [eva] computing for function f <- main. Called from tests/pdg/calls_and_struct.c:27. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [from] Computing for function asgn_struct [from] Done for function asgn_struct [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function asgn_struct: \result FROM S [from] Function f: S.a FROM S.b A FROM A; s.a \result FROM s.b [from] Function main: S.a FROM S.b A FROM S B FROM \nothing C FROM \nothing \result FROM S [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function asgn_struct: s; __retres [inout] Inputs for function asgn_struct: S [inout] InOut (internal) for function asgn_struct: Operational inputs: S Operational inputs on termination: S Sure outputs: s; __retres [inout] Out (internal) for function f: S.a; A; __retres [inout] Inputs for function f: S.b; A [inout] InOut (internal) for function f: Operational inputs: S.b; A; s{.a; .b} Operational inputs on termination: S.b; A; s{.a; .b} Sure outputs: S.a; A; __retres [inout] Out (internal) for function main: S.a; A; B; C; a; tmp_0 [inout] Inputs for function main: S; A [inout] InOut (internal) for function main: Operational inputs: S Operational inputs on termination: S Sure outputs: S.a; A; B; C; a; tmp_0 [pdg] computing for function asgn_struct [pdg] done for function asgn_struct [pdg] computing for function f [pdg] done for function f [pdg] computing for function main [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for asgn_struct {n1}: InCtrl {n2}: VarDecl : s {n3}: VarDecl : __retres {n4}: struct Tstr s = S; -[-c-]-> 1 -[a--]-> 2 -[--d]-> 8 {n5}: __retres = s.a; -[-c-]-> 1 -[--d]-> 2 -[a--]-> 3 -[--d]-> 4 {n6}: return __retres; -[-c-]-> 1 -[--d]-> 3 -[--d]-> 5 {n7}: OutRet -[--d]-> 6 {n8}: In(S) [pdg] PDG for f {n9}: InCtrl {n10}: VarDecl : s -[a--]-> 11 {n11}: In1 -[a--]-> 10 {n12}: VarDecl : __retres {n13}: A += s.a; -[-c-]-> 9 -[--d]-> 10 -[--d]-> 11 -[--d]-> 19 {n14}: S.a = S.b; -[-c-]-> 9 -[--d]-> 18 {n15}: __retres = s.b; -[-c-]-> 9 -[--d]-> 10 -[--d]-> 11 -[a--]-> 12 {n16}: return __retres; -[-c-]-> 9 -[--d]-> 12 -[--d]-> 15 {n17}: OutRet -[--d]-> 16 {n18}: In(S.b) {n19}: In(A) [pdg] PDG for main {n20}: InCtrl {n21}: VarDecl : a {n22}: VarDecl : tmp_0 {n23}: Call10-InCtrl : int a = asgn_struct(); -[-c-]-> 20 {n24}: Call10-OutRet : int a = asgn_struct(); -[-c-]-> 20 -[a--]-> 21 -[-c-]-> 23 -[--d]-> 36 {n25}: A = a; -[-c-]-> 20 -[--d]-> 21 -[--d]-> 24 {n26}: B = 2; -[-c-]-> 20 {n27}: C = 3; -[-c-]-> 20 {n28}: Call14-InCtrl : tmp_0 = f(S); -[-c-]-> 20 {n29}: Call14-In1 : tmp_0 = f(S); -[-c-]-> 20 -[-c-]-> 28 -[--d]-> 36 {n30}: Call14-Out(S.a) : tmp_0 = f(S); -[-c-]-> 20 -[-c-]-> 28 -[--d]-> 35 {n31}: Call14-Out(A) : tmp_0 = f(S); -[-c-]-> 20 -[--d]-> 25 -[-c-]-> 28 -[--d]-> 29 {n32}: Call14-OutRet : tmp_0 = f(S); -[-c-]-> 20 -[a--]-> 22 -[-c-]-> 28 -[--d]-> 29 {n33}: return tmp_0; -[-c-]-> 20 -[--d]-> 22 -[--d]-> 32 {n34}: OutRet -[--d]-> 33 {n35}: In(S.b) {n36}: In(S) frama-c-20.0-Calcium/tests/pdg/oracle/const.res.oracle0000666000000000000000000000771713571573400017515 0ustar [kernel] Parsing tests/pdg/const.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} G2 ∈ {0} G3 ∈ {0} G4.M5 ∈ {{ &G1 }} G5.M3 ∈ {{ &G2 }} .M4 ∈ {{ &G3 }} [eva] computing for function F2 <- main. Called from tests/pdg/const.i:39. [eva] Recording results for F2 [from] Computing for function F2 [from] Done for function F2 [eva] Done for function F2 [eva] computing for function F1 <- main. Called from tests/pdg/const.i:41. [eva] Recording results for F1 [from] Computing for function F1 [from] Done for function F1 [eva] Done for function F1 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function F1: G3 ∈ {0} [eva:final-states] Values at end of function F2: G1 ∈ {0} V1 ∈ {1} [eva:final-states] Values at end of function main: G1 ∈ {0} G2 ∈ {0} G3 ∈ {0} V2 ∈ {0} [from] Computing for function F1 [from] Done for function F1 [from] Computing for function F2 [from] Done for function F2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function F1: G3.M2 FROM G2.M2; f1; G5 [from] Function F2: G1.M1 FROM G4; f2 \result FROM \nothing [from] Function main: G1.M1 FROM G4 G2 FROM G1.M2; G4 G3.M2 FROM G1.M2; G4; G5 \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to F2 at tests/pdg/const.i:39 (by main): G1.M1 FROM G4; f2 \result FROM \nothing [from] call to F1 at tests/pdg/const.i:41 (by main): G3.M2 FROM G2.M2; f1; G5 [from] entry point: G1.M1 FROM G4 G2 FROM G1.M2; G4 G3.M2 FROM G1.M2; G4; G5 \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function F1: G3.M2 [inout] Inputs for function F1: G2.M2; G5 [inout] Out (internal) for function F2: G1.M1; V1 [inout] Inputs for function F2: G4 [inout] Out (internal) for function main: G1.M1; G2; G3.M2; V2 [inout] Inputs for function main: G1; G2.M2; G4; G5 [pdg] computing for function F1 [pdg] done for function F1 [pdg] computing for function F2 [pdg] done for function F2 [pdg] computing for function main [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for F1 {n1}: InCtrl {n2}: VarDecl : f1 -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: (f1->M4)->M2 = (f1->M3)->M2; -[-c-]-> 1 -[a-d]-> 2 -[a-d]-> 3 -[--d]-> 6 -[--d]-> 7 -[a--]-> 8 {n5}: return; -[-c-]-> 1 {n6}: In(G2.M2) {n7}: In(G5.M3) {n8}: In(G5.M4) [pdg] PDG for F2 {n9}: InCtrl {n10}: VarDecl : f2 -[a--]-> 11 {n11}: In1 -[a--]-> 10 {n12}: VarDecl : V1 {n13}: int V1 = 1; -[-c-]-> 9 -[a--]-> 12 {n14}: (f2->M5)->M1 = 0; -[-c-]-> 9 -[a--]-> 10 -[a--]-> 11 -[a--]-> 17 {n15}: return V1; -[-c-]-> 9 -[--d]-> 12 -[--d]-> 13 {n16}: OutRet -[--d]-> 15 {n17}: In(G4) [pdg] PDG for main {n18}: InCtrl {n19}: VarDecl : V2 {n20}: Call9-InCtrl : F2((T5 *)(& G4)); -[-c-]-> 18 {n21}: Call9-In1 : F2((T5 *)(& G4)); -[-c-]-> 18 -[-c-]-> 20 {n22}: Call9-Out(G1.M1) : F2((T5 *)(& G4)); -[-c-]-> 18 -[-c-]-> 20 -[--d]-> 21 -[--d]-> 32 {n23}: G2 = G1; -[-c-]-> 18 -[--d](G1.M1)-> 22 -[--d]-> 31 {n24}: Call11-InCtrl : F1((T3 *)(& G5)); -[-c-]-> 18 {n25}: Call11-In1 : F1((T3 *)(& G5)); -[-c-]-> 18 -[-c-]-> 24 {n26}: Call11-Out(G3.M2) : F1((T3 *)(& G5)); -[-c-]-> 18 -[--d]-> 23 -[-c-]-> 24 -[--d]-> 25 -[--d]-> 30 {n27}: V2 = 0; -[-c-]-> 18 -[a--]-> 19 {n28}: return V2; -[-c-]-> 18 -[--d]-> 19 -[--d]-> 27 {n29}: OutRet -[--d]-> 28 {n30}: In(G5) {n31}: In(G1.M2) {n32}: In(G4) frama-c-20.0-Calcium/tests/pdg/oracle/decl_dpds.res.oracle0000666000000000000000000000654613571573400020307 0ustar [kernel] Parsing tests/pdg/decl_dpds.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] S ∈ [--..--] [eva:alarm] tests/pdg/decl_dpds.c:16: Warning: signed overflow. assert argc + 1 ≤ 2147483647; [eva:alarm] tests/pdg/decl_dpds.c:18: Warning: out of bounds read. assert \valid_read(argv + (int)(argc - 1)); [eva:alarm] tests/pdg/decl_dpds.c:18: Warning: out of bounds read. assert \valid_read(*(argv + (int)(argc - 1)) + 0); [eva:alarm] tests/pdg/decl_dpds.c:19: Warning: out of bounds read. assert \valid_read(argv + (int)(argc - 1)); [eva:alarm] tests/pdg/decl_dpds.c:19: Warning: out of bounds write. assert \valid(*(argv + (int)(argc - 1)) + 0); [eva:alarm] tests/pdg/decl_dpds.c:23: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva:alarm] tests/pdg/decl_dpds.c:25: Warning: signed overflow. assert -2147483648 ≤ argc0 + argc1; [eva:alarm] tests/pdg/decl_dpds.c:25: Warning: signed overflow. assert argc0 + argc1 ≤ 2147483647; [eva:alarm] tests/pdg/decl_dpds.c:25: Warning: signed overflow. assert -2147483648 ≤ (int)(argc0 + argc1) + G; [eva:alarm] tests/pdg/decl_dpds.c:25: Warning: signed overflow. assert (int)(argc0 + argc1) + G ≤ 2147483647; [eva:alarm] tests/pdg/decl_dpds.c:25: Warning: signed overflow. assert -2147483648 ≤ (int)((int)(argc0 + argc1) + G) + S.a; [eva:alarm] tests/pdg/decl_dpds.c:25: Warning: signed overflow. assert (int)((int)(argc0 + argc1) + G) + S.a ≤ 2147483647; [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 1 assertion(s) [pdg] computing for function main [pdg] done for function main [pdg] PDG for main {n1}: InCtrl {n2}: VarDecl : argc -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : argv -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: VarDecl : argc0 {n7}: VarDecl : tmp {n8}: VarDecl : argc1 {n9}: VarDecl : c {n10}: VarDecl : p {n11}: VarDecl : __retres {n12}: unspecified sequence -[-c-]-> 1 {n13}: tmp = argc; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[a--]-> 7 -[-c-]-> 12 {n14}: argc ++; -[-c-]-> 1 -[a-d]-> 2 -[--d]-> 3 -[-c-]-> 12 {n15}: int argc0 = tmp; -[-c-]-> 1 -[a--]-> 6 -[--d]-> 7 -[--d]-> 13 {n16}: int argc1 = argc; -[-c-]-> 1 -[--d]-> 2 -[a--]-> 8 -[--d]-> 14 {n17}: char c = *(*(argv + (argc - 1)) + 0); -[-c-]-> 1 -[--d]-> 2 -[--d]-> 4 -[--d]-> 5 -[a--]-> 9 -[--d]-> 14 -[--d]-> 28 -[--d]-> 29 -[--d]-> 30 {n18}: *(*(argv + (argc - 1)) + 0) = (char)'a'; -[-c-]-> 1 -[a--]-> 2 -[a--]-> 4 -[a--]-> 5 -[a--]-> 14 -[a--]-> 28 {n19}: argc = 0; -[-c-]-> 1 -[a--]-> 2 {n20}: argc0 -[-c-]-> 1 -[--d]-> 6 -[--d]-> 15 {n21}: int *p = & argc0; -[-c-]-> 1 -[--d]-> 6 -[a--]-> 10 -[-c-]-> 20 {n22}: (*p) ++; -[-c-]-> 1 -[a-d]-> 10 -[--d]-> 15 -[-c-]-> 20 -[a-d]-> 21 {n23}: __retres = ((argc0 + argc1) + G) + S.a; -[-c-]-> 1 -[--d]-> 6 -[--d]-> 8 -[a--]-> 11 -[--d]-> 15 -[--d]-> 16 -[--d]-> 22 -[--d]-> 26 -[--d]-> 27 {n24}: return __retres; -[-c-]-> 1 -[--d]-> 11 -[--d]-> 23 {n25}: OutRet -[--d]-> 24 {n26}: In(G) {n27}: In(S.a) {n28}: In(S_argv[0..3]) {n29}: In(S_0_S_argv[0]) {n30}: In(S_1_S_argv[0]) frama-c-20.0-Calcium/tests/pdg/oracle/doc_dot.res.oracle0000666000000000000000000000261413571573400017771 0ustar [kernel] Parsing tests/pdg/doc_dot.c (with preprocessing) [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ [--..--] G2 ∈ [--..--] T[0..9] ∈ [--..--] [eva] computing for function f <- g. Called from tests/pdg/doc_dot.c:14. [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [pdg] computing for function g [from] Computing for function f [from] Done for function f [pdg] done for function g [pdg] dot file generated in tests/pdg/doc.g.dot [pdg] PDG for g {n1}: InCtrl {n2}: VarDecl : x {n3}: Call4-InCtrl : int x = f(G1,G2,0); -[-c-]-> 1 {n4}: Call4-In1 : int x = f(G1,G2,0); -[-c-]-> 1 -[-c-]-> 3 -[--d]-> 14 {n5}: Call4-In2 : int x = f(G1,G2,0); -[-c-]-> 1 -[-c-]-> 3 -[--d]-> 13 {n6}: Call4-In3 : int x = f(G1,G2,0); -[-c-]-> 1 -[-c-]-> 3 {n7}: Call4-OutRet : int x = f(G1,G2,0); -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 3 -[--d]-> 4 -[--d]-> 6 {n8}: 0 < x -[-c-]-> 1 -[--d]-> 2 -[--d]-> 7 {n9}: x < 10 -[-c-]-> 1 -[--d]-> 2 -[--d]-> 7 -[-c-]-> 8 {n10}: T[x] = 0; -[-c-]-> 1 -[a--]-> 2 -[a--]-> 7 -[-c-]-> 8 -[-c-]-> 9 {n11}: return x; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 7 {n12}: OutRet -[--d]-> 11 {n13}: In(G2) {n14}: In(G1) frama-c-20.0-Calcium/tests/pdg/oracle/dpds_intra.0.res.oracle0000666000000000000000000000771713571573400020654 0ustar [kernel] Parsing tests/pdg/dpds_intra.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] S ∈ [--..--] [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert tmp + s.a ≤ 2147483647; (tmp from b++) [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert -2147483648 ≤ 2 * a; [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert 2 * a ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:124: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] computing for function test_struct <- main. Called from tests/pdg/dpds_intra.c:126. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_if_simple <- main. Called from tests/pdg/dpds_intra.c:127. [eva:alarm] tests/pdg/dpds_intra.c:51: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for test_if_simple [eva] Done for function test_if_simple [eva] computing for function test_goto_simple <- main. Called from tests/pdg/dpds_intra.c:128. [eva] Recording results for test_goto_simple [eva] Done for function test_goto_simple [eva] computing for function test_goto_arriere <- main. Called from tests/pdg/dpds_intra.c:129. [eva:alarm] tests/pdg/dpds_intra.c:66: Warning: signed overflow. assert -2147483648 ≤ G - 1; [eva:alarm] tests/pdg/dpds_intra.c:65: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for test_goto_arriere [eva] Done for function test_goto_arriere [eva:alarm] tests/pdg/dpds_intra.c:129: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from test_goto_arriere()) [eva] computing for function test_goto_else <- main. Called from tests/pdg/dpds_intra.c:130. [eva] Recording results for test_goto_else [eva] Done for function test_goto_else [eva:alarm] tests/pdg/dpds_intra.c:130: Warning: signed overflow. assert res + tmp_4 ≤ 2147483647; (tmp_4 from test_goto_else()) [eva] computing for function test_simple_loop <- main. Called from tests/pdg/dpds_intra.c:131. [eva] tests/pdg/dpds_intra.c:99: starting to merge loop iterations [eva:alarm] tests/pdg/dpds_intra.c:100: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for test_simple_loop [eva] Done for function test_simple_loop [eva:alarm] tests/pdg/dpds_intra.c:131: Warning: signed overflow. assert res + tmp_5 ≤ 2147483647; (tmp_5 from test_simple_loop(G)) [eva] computing for function multiple_global_inputs <- main. Called from tests/pdg/dpds_intra.c:132. [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert -2147483648 ≤ S.a + G; [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert S.a + G ≤ 2147483647; [eva] Recording results for multiple_global_inputs [eva] Done for function multiple_global_inputs [eva:alarm] tests/pdg/dpds_intra.c:132: Warning: signed overflow. assert res + tmp_6 ≤ 2147483647; (tmp_6 from multiple_global_inputs()) [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert -2147483648 ≤ *p + res; [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert *p + res ≤ 2147483647; [eva] Recording results for main [eva] done for function main [pdg] computing for function test_struct [pdg] done for function test_struct [pdg] PDG for test_struct {n1}: InCtrl {n2}: VarDecl : s1 {n3}: VarDecl : s2 {n4}: VarDecl : __retres {n5}: s1.a = 1; -[-c-]-> 1 -[a--]-> 2 {n6}: s2 = s1; -[-c-]-> 1 -[--d]-> 2 -[a--]-> 3 -[--d]-> 5 {n7}: __retres = s2.a; -[-c-]-> 1 -[--d]-> 3 -[a--]-> 4 -[--d]-> 6 {n8}: return __retres; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 7 {n9}: OutRet -[--d]-> 8 frama-c-20.0-Calcium/tests/pdg/oracle/dpds_intra.1.res.oracle0000666000000000000000000001151713571573400020646 0ustar [kernel] Parsing tests/pdg/dpds_intra.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] S ∈ [--..--] [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert tmp + s.a ≤ 2147483647; (tmp from b++) [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert -2147483648 ≤ 2 * a; [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert 2 * a ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:124: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] computing for function test_struct <- main. Called from tests/pdg/dpds_intra.c:126. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_if_simple <- main. Called from tests/pdg/dpds_intra.c:127. [eva:alarm] tests/pdg/dpds_intra.c:51: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for test_if_simple [eva] Done for function test_if_simple [eva] computing for function test_goto_simple <- main. Called from tests/pdg/dpds_intra.c:128. [eva] Recording results for test_goto_simple [eva] Done for function test_goto_simple [eva] computing for function test_goto_arriere <- main. Called from tests/pdg/dpds_intra.c:129. [eva:alarm] tests/pdg/dpds_intra.c:66: Warning: signed overflow. assert -2147483648 ≤ G - 1; [eva:alarm] tests/pdg/dpds_intra.c:65: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for test_goto_arriere [eva] Done for function test_goto_arriere [eva:alarm] tests/pdg/dpds_intra.c:129: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from test_goto_arriere()) [eva] computing for function test_goto_else <- main. Called from tests/pdg/dpds_intra.c:130. [eva] Recording results for test_goto_else [eva] Done for function test_goto_else [eva:alarm] tests/pdg/dpds_intra.c:130: Warning: signed overflow. assert res + tmp_4 ≤ 2147483647; (tmp_4 from test_goto_else()) [eva] computing for function test_simple_loop <- main. Called from tests/pdg/dpds_intra.c:131. [eva] tests/pdg/dpds_intra.c:99: starting to merge loop iterations [eva:alarm] tests/pdg/dpds_intra.c:100: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for test_simple_loop [eva] Done for function test_simple_loop [eva:alarm] tests/pdg/dpds_intra.c:131: Warning: signed overflow. assert res + tmp_5 ≤ 2147483647; (tmp_5 from test_simple_loop(G)) [eva] computing for function multiple_global_inputs <- main. Called from tests/pdg/dpds_intra.c:132. [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert -2147483648 ≤ S.a + G; [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert S.a + G ≤ 2147483647; [eva] Recording results for multiple_global_inputs [eva] Done for function multiple_global_inputs [eva:alarm] tests/pdg/dpds_intra.c:132: Warning: signed overflow. assert res + tmp_6 ≤ 2147483647; (tmp_6 from multiple_global_inputs()) [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert -2147483648 ≤ *p + res; [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert *p + res ≤ 2147483647; [eva] Recording results for main [eva] done for function main [pdg] computing for function test_if_simple [pdg] done for function test_if_simple [pdg] PDG for test_if_simple {n1}: InCtrl {n2}: VarDecl : x0 {n3}: VarDecl : x1 {n4}: VarDecl : x2 {n5}: VarDecl : x3 {n6}: VarDecl : x {n7}: int x0 = 0; -[-c-]-> 1 -[a--]-> 2 {n8}: int x1 = 1; -[-c-]-> 1 -[a--]-> 3 {n9}: int x2 = 2; -[-c-]-> 1 -[a--]-> 4 {n10}: int x3 = 10; -[-c-]-> 1 -[a--]-> 5 {n11}: G < x0 -[-c-]-> 1 -[--d]-> 2 -[--d]-> 7 -[--d]-> 21 {n12}: x = x0; -[-c-]-> 1 -[--d]-> 2 -[a--]-> 6 -[--d]-> 7 -[-c-]-> 11 {n13}: G < x1 -[-c-]-> 1 -[--d]-> 3 -[--d]-> 8 -[-c-]-> 11 -[--d]-> 21 {n14}: x = x1; -[-c-]-> 1 -[--d]-> 3 -[a--]-> 6 -[--d]-> 8 -[-c-]-> 11 -[-c-]-> 13 {n15}: G > x2 -[-c-]-> 1 -[--d]-> 4 -[--d]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[--d]-> 21 {n16}: G < x3 -[-c-]-> 1 -[--d]-> 5 -[--d]-> 10 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 15 -[--d]-> 21 {n17}: x = x3; -[-c-]-> 1 -[--d]-> 5 -[a--]-> 6 -[--d]-> 10 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 15 -[-c-]-> 16 {n18}: x = -1; -[-c-]-> 1 -[a--]-> 6 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 15 -[-c-]-> 16 {n19}: return x; -[-c-]-> 1 -[--d]-> 6 -[--d]-> 12 -[--d]-> 14 -[--d]-> 17 -[--d]-> 18 {n20}: OutRet -[--d]-> 19 {n21}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/dpds_intra.2.res.oracle0000666000000000000000000001032413571573400020642 0ustar [kernel] Parsing tests/pdg/dpds_intra.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] S ∈ [--..--] [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert tmp + s.a ≤ 2147483647; (tmp from b++) [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert -2147483648 ≤ 2 * a; [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert 2 * a ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:124: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] computing for function test_struct <- main. Called from tests/pdg/dpds_intra.c:126. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_if_simple <- main. Called from tests/pdg/dpds_intra.c:127. [eva:alarm] tests/pdg/dpds_intra.c:51: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for test_if_simple [eva] Done for function test_if_simple [eva] computing for function test_goto_simple <- main. Called from tests/pdg/dpds_intra.c:128. [eva] Recording results for test_goto_simple [eva] Done for function test_goto_simple [eva] computing for function test_goto_arriere <- main. Called from tests/pdg/dpds_intra.c:129. [eva:alarm] tests/pdg/dpds_intra.c:66: Warning: signed overflow. assert -2147483648 ≤ G - 1; [eva:alarm] tests/pdg/dpds_intra.c:65: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for test_goto_arriere [eva] Done for function test_goto_arriere [eva:alarm] tests/pdg/dpds_intra.c:129: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from test_goto_arriere()) [eva] computing for function test_goto_else <- main. Called from tests/pdg/dpds_intra.c:130. [eva] Recording results for test_goto_else [eva] Done for function test_goto_else [eva:alarm] tests/pdg/dpds_intra.c:130: Warning: signed overflow. assert res + tmp_4 ≤ 2147483647; (tmp_4 from test_goto_else()) [eva] computing for function test_simple_loop <- main. Called from tests/pdg/dpds_intra.c:131. [eva] tests/pdg/dpds_intra.c:99: starting to merge loop iterations [eva:alarm] tests/pdg/dpds_intra.c:100: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for test_simple_loop [eva] Done for function test_simple_loop [eva:alarm] tests/pdg/dpds_intra.c:131: Warning: signed overflow. assert res + tmp_5 ≤ 2147483647; (tmp_5 from test_simple_loop(G)) [eva] computing for function multiple_global_inputs <- main. Called from tests/pdg/dpds_intra.c:132. [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert -2147483648 ≤ S.a + G; [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert S.a + G ≤ 2147483647; [eva] Recording results for multiple_global_inputs [eva] Done for function multiple_global_inputs [eva:alarm] tests/pdg/dpds_intra.c:132: Warning: signed overflow. assert res + tmp_6 ≤ 2147483647; (tmp_6 from multiple_global_inputs()) [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert -2147483648 ≤ *p + res; [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert *p + res ≤ 2147483647; [eva] Recording results for main [eva] done for function main [pdg] computing for function test_goto_simple [pdg] done for function test_goto_simple [pdg] PDG for test_goto_simple {n1}: InCtrl {n2}: VarDecl : r {n3}: G > 0 -[-c-]-> 1 -[--d]-> 13 {n4}: goto Lelse; -[-c-]-> 1 -[-c-]-> 3 -[-c-]-> 5 {n5}: Lelse: -[-c-]-> 1 -[-c-]-> 3 -[-c-]-> 4 -[-c-]-> 8 {n6}: r = -1; -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 3 -[-c-]-> 4 {n7}: Lelse: r = 1; -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 3 -[-c-]-> 4 -[-c-]-> 8 {n8}: goto Lfin; -[-c-]-> 1 -[-c-]-> 3 -[-c-]-> 4 -[-c-]-> 9 {n9}: Lfin: -[-c-]-> 1 {n10}: Lfin: ; -[-c-]-> 1 {n11}: return r; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 6 -[--d]-> 7 {n12}: OutRet -[--d]-> 11 {n13}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/dpds_intra.3.res.oracle0000666000000000000000000001073513571573400020651 0ustar [kernel] Parsing tests/pdg/dpds_intra.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] S ∈ [--..--] [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert tmp + s.a ≤ 2147483647; (tmp from b++) [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert -2147483648 ≤ 2 * a; [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert 2 * a ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:124: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] computing for function test_struct <- main. Called from tests/pdg/dpds_intra.c:126. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_if_simple <- main. Called from tests/pdg/dpds_intra.c:127. [eva:alarm] tests/pdg/dpds_intra.c:51: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for test_if_simple [eva] Done for function test_if_simple [eva] computing for function test_goto_simple <- main. Called from tests/pdg/dpds_intra.c:128. [eva] Recording results for test_goto_simple [eva] Done for function test_goto_simple [eva] computing for function test_goto_arriere <- main. Called from tests/pdg/dpds_intra.c:129. [eva:alarm] tests/pdg/dpds_intra.c:66: Warning: signed overflow. assert -2147483648 ≤ G - 1; [eva:alarm] tests/pdg/dpds_intra.c:65: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for test_goto_arriere [eva] Done for function test_goto_arriere [eva:alarm] tests/pdg/dpds_intra.c:129: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from test_goto_arriere()) [eva] computing for function test_goto_else <- main. Called from tests/pdg/dpds_intra.c:130. [eva] Recording results for test_goto_else [eva] Done for function test_goto_else [eva:alarm] tests/pdg/dpds_intra.c:130: Warning: signed overflow. assert res + tmp_4 ≤ 2147483647; (tmp_4 from test_goto_else()) [eva] computing for function test_simple_loop <- main. Called from tests/pdg/dpds_intra.c:131. [eva] tests/pdg/dpds_intra.c:99: starting to merge loop iterations [eva:alarm] tests/pdg/dpds_intra.c:100: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for test_simple_loop [eva] Done for function test_simple_loop [eva:alarm] tests/pdg/dpds_intra.c:131: Warning: signed overflow. assert res + tmp_5 ≤ 2147483647; (tmp_5 from test_simple_loop(G)) [eva] computing for function multiple_global_inputs <- main. Called from tests/pdg/dpds_intra.c:132. [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert -2147483648 ≤ S.a + G; [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert S.a + G ≤ 2147483647; [eva] Recording results for multiple_global_inputs [eva] Done for function multiple_global_inputs [eva:alarm] tests/pdg/dpds_intra.c:132: Warning: signed overflow. assert res + tmp_6 ≤ 2147483647; (tmp_6 from multiple_global_inputs()) [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert -2147483648 ≤ *p + res; [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert *p + res ≤ 2147483647; [eva] Recording results for main [eva] done for function main [pdg] computing for function test_goto_arriere [pdg] done for function test_goto_arriere [pdg] PDG for test_goto_arriere {n1}: InCtrl {n2}: VarDecl : x {n3}: VarDecl : tmp {n4}: int x = 1; -[-c-]-> 1 -[a--]-> 2 {n5}: L: -[-c-]-> 1 -[-c-]-> 11 -[-c-]-> 12 {n6}: L: x ++; -[-c-]-> 1 -[a-d]-> 2 -[--d]-> 4 -[--d]-> 6 -[-c-]-> 11 -[-c-]-> 12 {n7}: unspecified sequence -[-c-]-> 1 -[-c-]-> 11 -[-c-]-> 12 {n8}: tmp = G; -[-c-]-> 1 -[a--]-> 3 -[-c-]-> 7 -[--d]-> 9 -[-c-]-> 11 -[-c-]-> 12 -[--d]-> 15 {n9}: G --; -[-c-]-> 1 -[-c-]-> 7 -[--d]-> 9 -[-c-]-> 11 -[-c-]-> 12 -[--d]-> 15 {n10}: ; -[-c-]-> 1 -[-c-]-> 7 -[-c-]-> 11 -[-c-]-> 12 {n11}: tmp > 0 -[-c-]-> 1 -[--d]-> 3 -[--d]-> 8 -[-c-]-> 11 -[-c-]-> 12 {n12}: goto L; -[-c-]-> 1 -[-c-]-> 5 -[-c-]-> 11 -[-c-]-> 12 {n13}: return x; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 6 {n14}: OutRet -[--d]-> 13 {n15}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/dpds_intra.4.res.oracle0000666000000000000000000001022213571573400020641 0ustar [kernel] Parsing tests/pdg/dpds_intra.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] S ∈ [--..--] [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert tmp + s.a ≤ 2147483647; (tmp from b++) [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert -2147483648 ≤ 2 * a; [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert 2 * a ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:124: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] computing for function test_struct <- main. Called from tests/pdg/dpds_intra.c:126. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_if_simple <- main. Called from tests/pdg/dpds_intra.c:127. [eva:alarm] tests/pdg/dpds_intra.c:51: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for test_if_simple [eva] Done for function test_if_simple [eva] computing for function test_goto_simple <- main. Called from tests/pdg/dpds_intra.c:128. [eva] Recording results for test_goto_simple [eva] Done for function test_goto_simple [eva] computing for function test_goto_arriere <- main. Called from tests/pdg/dpds_intra.c:129. [eva:alarm] tests/pdg/dpds_intra.c:66: Warning: signed overflow. assert -2147483648 ≤ G - 1; [eva:alarm] tests/pdg/dpds_intra.c:65: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for test_goto_arriere [eva] Done for function test_goto_arriere [eva:alarm] tests/pdg/dpds_intra.c:129: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from test_goto_arriere()) [eva] computing for function test_goto_else <- main. Called from tests/pdg/dpds_intra.c:130. [eva] Recording results for test_goto_else [eva] Done for function test_goto_else [eva:alarm] tests/pdg/dpds_intra.c:130: Warning: signed overflow. assert res + tmp_4 ≤ 2147483647; (tmp_4 from test_goto_else()) [eva] computing for function test_simple_loop <- main. Called from tests/pdg/dpds_intra.c:131. [eva] tests/pdg/dpds_intra.c:99: starting to merge loop iterations [eva:alarm] tests/pdg/dpds_intra.c:100: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for test_simple_loop [eva] Done for function test_simple_loop [eva:alarm] tests/pdg/dpds_intra.c:131: Warning: signed overflow. assert res + tmp_5 ≤ 2147483647; (tmp_5 from test_simple_loop(G)) [eva] computing for function multiple_global_inputs <- main. Called from tests/pdg/dpds_intra.c:132. [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert -2147483648 ≤ S.a + G; [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert S.a + G ≤ 2147483647; [eva] Recording results for multiple_global_inputs [eva] Done for function multiple_global_inputs [eva:alarm] tests/pdg/dpds_intra.c:132: Warning: signed overflow. assert res + tmp_6 ≤ 2147483647; (tmp_6 from multiple_global_inputs()) [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert -2147483648 ≤ *p + res; [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert *p + res ≤ 2147483647; [eva] Recording results for main [eva] done for function main [pdg] computing for function test_goto_else [pdg] done for function test_goto_else [pdg] PDG for test_goto_else {n1}: InCtrl {n2}: VarDecl : x {n3}: VarDecl : a {n4}: VarDecl : b {n5}: int b = 0; -[-c-]-> 1 -[a--]-> 4 {n6}: G -[-c-]-> 1 -[--d]-> 14 {n7}: x = 1; -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 6 {n8}: a = 1; -[-c-]-> 1 -[a--]-> 3 -[-c-]-> 6 {n9}: goto L; -[-c-]-> 1 -[-c-]-> 6 -[-c-]-> 10 {n10}: L: -[-c-]-> 1 -[-c-]-> 6 -[-c-]-> 9 {n11}: L: b = 1; -[-c-]-> 1 -[a--]-> 4 -[-c-]-> 6 -[-c-]-> 9 {n12}: return b; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 11 {n13}: OutRet -[--d]-> 12 {n14}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/dpds_intra.5.res.oracle0000666000000000000000000000007513571573400020647 0ustar [kernel] Parsing tests/pdg/dpds_intra.c (with preprocessing) frama-c-20.0-Calcium/tests/pdg/oracle/dpds_intra.6.res.oracle0000666000000000000000000001076213571573400020654 0ustar [kernel] Parsing tests/pdg/dpds_intra.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] S ∈ [--..--] [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert tmp + s.a ≤ 2147483647; (tmp from b++) [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert -2147483648 ≤ 2 * a; [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert 2 * a ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:124: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] computing for function test_struct <- main. Called from tests/pdg/dpds_intra.c:126. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_if_simple <- main. Called from tests/pdg/dpds_intra.c:127. [eva:alarm] tests/pdg/dpds_intra.c:51: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for test_if_simple [eva] Done for function test_if_simple [eva] computing for function test_goto_simple <- main. Called from tests/pdg/dpds_intra.c:128. [eva] Recording results for test_goto_simple [eva] Done for function test_goto_simple [eva] computing for function test_goto_arriere <- main. Called from tests/pdg/dpds_intra.c:129. [eva:alarm] tests/pdg/dpds_intra.c:66: Warning: signed overflow. assert -2147483648 ≤ G - 1; [eva:alarm] tests/pdg/dpds_intra.c:65: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for test_goto_arriere [eva] Done for function test_goto_arriere [eva:alarm] tests/pdg/dpds_intra.c:129: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from test_goto_arriere()) [eva] computing for function test_goto_else <- main. Called from tests/pdg/dpds_intra.c:130. [eva] Recording results for test_goto_else [eva] Done for function test_goto_else [eva:alarm] tests/pdg/dpds_intra.c:130: Warning: signed overflow. assert res + tmp_4 ≤ 2147483647; (tmp_4 from test_goto_else()) [eva] computing for function test_simple_loop <- main. Called from tests/pdg/dpds_intra.c:131. [eva] tests/pdg/dpds_intra.c:99: starting to merge loop iterations [eva:alarm] tests/pdg/dpds_intra.c:100: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for test_simple_loop [eva] Done for function test_simple_loop [eva:alarm] tests/pdg/dpds_intra.c:131: Warning: signed overflow. assert res + tmp_5 ≤ 2147483647; (tmp_5 from test_simple_loop(G)) [eva] computing for function multiple_global_inputs <- main. Called from tests/pdg/dpds_intra.c:132. [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert -2147483648 ≤ S.a + G; [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert S.a + G ≤ 2147483647; [eva] Recording results for multiple_global_inputs [eva] Done for function multiple_global_inputs [eva:alarm] tests/pdg/dpds_intra.c:132: Warning: signed overflow. assert res + tmp_6 ≤ 2147483647; (tmp_6 from multiple_global_inputs()) [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert -2147483648 ≤ *p + res; [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert *p + res ≤ 2147483647; [eva] Recording results for main [eva] done for function main [pdg] computing for function test_simple_loop [pdg] done for function test_simple_loop [pdg] PDG for test_simple_loop {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : i {n5}: VarDecl : s {n6}: int s = 0; -[-c-]-> 1 -[a--]-> 5 {n7}: i = 0; -[-c-]-> 1 -[a--]-> 4 {n8}: while(1) -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 13 {n9}: i < n -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 4 -[--d]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[--d]-> 12 -[-c-]-> 13 {n10}: block -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 13 {n11}: s ++; -[-c-]-> 1 -[a-d]-> 5 -[--d]-> 6 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 11 -[-c-]-> 13 {n12}: i ++; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[--d]-> 12 -[-c-]-> 13 {n13}: break; -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 13 {n14}: return s; -[-c-]-> 1 -[--d]-> 5 -[--d]-> 6 -[--d]-> 11 {n15}: OutRet -[--d]-> 14 frama-c-20.0-Calcium/tests/pdg/oracle/dpds_intra.7.res.oracle0000666000000000000000000002100713571573400020647 0ustar [kernel] Parsing tests/pdg/dpds_intra.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] S ∈ [--..--] [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert tmp + s.a ≤ 2147483647; (tmp from b++) [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert -2147483648 ≤ 2 * a; [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert 2 * a ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:124: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] computing for function test_struct <- main. Called from tests/pdg/dpds_intra.c:126. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_if_simple <- main. Called from tests/pdg/dpds_intra.c:127. [eva:alarm] tests/pdg/dpds_intra.c:51: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for test_if_simple [eva] Done for function test_if_simple [eva] computing for function test_goto_simple <- main. Called from tests/pdg/dpds_intra.c:128. [eva] Recording results for test_goto_simple [eva] Done for function test_goto_simple [eva] computing for function test_goto_arriere <- main. Called from tests/pdg/dpds_intra.c:129. [eva:alarm] tests/pdg/dpds_intra.c:66: Warning: signed overflow. assert -2147483648 ≤ G - 1; [eva:alarm] tests/pdg/dpds_intra.c:65: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for test_goto_arriere [eva] Done for function test_goto_arriere [eva:alarm] tests/pdg/dpds_intra.c:129: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from test_goto_arriere()) [eva] computing for function test_goto_else <- main. Called from tests/pdg/dpds_intra.c:130. [eva] Recording results for test_goto_else [eva] Done for function test_goto_else [eva:alarm] tests/pdg/dpds_intra.c:130: Warning: signed overflow. assert res + tmp_4 ≤ 2147483647; (tmp_4 from test_goto_else()) [eva] computing for function test_simple_loop <- main. Called from tests/pdg/dpds_intra.c:131. [eva] tests/pdg/dpds_intra.c:99: starting to merge loop iterations [eva:alarm] tests/pdg/dpds_intra.c:100: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for test_simple_loop [eva] Done for function test_simple_loop [eva:alarm] tests/pdg/dpds_intra.c:131: Warning: signed overflow. assert res + tmp_5 ≤ 2147483647; (tmp_5 from test_simple_loop(G)) [eva] computing for function multiple_global_inputs <- main. Called from tests/pdg/dpds_intra.c:132. [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert -2147483648 ≤ S.a + G; [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert S.a + G ≤ 2147483647; [eva] Recording results for multiple_global_inputs [eva] Done for function multiple_global_inputs [eva:alarm] tests/pdg/dpds_intra.c:132: Warning: signed overflow. assert res + tmp_6 ≤ 2147483647; (tmp_6 from multiple_global_inputs()) [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert -2147483648 ≤ *p + res; [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert *p + res ≤ 2147483647; [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function test_struct [from] Done for function test_struct [from] Computing for function test_if_simple [from] Done for function test_if_simple [from] Computing for function test_goto_simple [from] Done for function test_goto_simple [from] Computing for function test_goto_arriere [from] Done for function test_goto_arriere [from] Computing for function test_goto_else [from] Done for function test_goto_else [from] Computing for function test_simple_loop [from] Done for function test_simple_loop [from] Computing for function multiple_global_inputs [from] Done for function multiple_global_inputs [pdg] done for function main [pdg] PDG for main {n1}: InCtrl {n2}: VarDecl : a {n3}: VarDecl : b {n4}: VarDecl : res {n5}: VarDecl : s {n6}: VarDecl : p {n7}: VarDecl : tmp {n8}: VarDecl : a_0 {n9}: VarDecl : tmp_0 {n10}: VarDecl : tmp_1 {n11}: VarDecl : tmp_2 {n12}: VarDecl : tmp_3 {n13}: VarDecl : tmp_4 {n14}: VarDecl : tmp_5 {n15}: VarDecl : tmp_6 {n16}: VarDecl : __retres {n17}: int b = G; -[-c-]-> 1 -[a--]-> 3 -[--d]-> 65 {n18}: int res = 0; -[-c-]-> 1 -[a--]-> 4 {n19}: Tstr s = {.a = 1, .b = 2}; -[-c-]-> 1 -[a--]-> 5 {n20}: unspecified sequence -[-c-]-> 1 {n21}: tmp = b; -[-c-]-> 1 -[--d]-> 3 -[a--]-> 7 -[--d]-> 17 -[-c-]-> 20 {n22}: b ++; -[-c-]-> 1 -[a-d]-> 3 -[--d]-> 17 -[-c-]-> 20 {n23}: a = tmp + s.a; -[-c-]-> 1 -[a--]-> 2 -[--d]-> 5 -[--d]-> 7 -[--d]-> 19 -[-c-]-> 20 -[--d]-> 21 {n24}: b = 2 * a; -[-c-]-> 1 -[--d]-> 2 -[a--]-> 3 -[--d]-> 23 {n25}: b > G -[-c-]-> 1 -[--d]-> 3 -[--d]-> 24 -[--d]-> 65 {n26}: p = & a; -[-c-]-> 1 -[--d]-> 2 -[a--]-> 6 -[-c-]-> 25 {n27}: int a_0 = 1; -[-c-]-> 1 -[a--]-> 8 -[-c-]-> 25 {n28}: p = & b; -[-c-]-> 1 -[--d]-> 3 -[a--]-> 6 -[-c-]-> 25 {n29}: a_0 ++; -[-c-]-> 1 -[a-d]-> 8 -[-c-]-> 25 -[--d]-> 27 {n30}: (*p) ++; -[-c-]-> 1 -[a-d]-> 6 -[--d]-> 23 -[--d]-> 24 -[a-d]-> 26 -[a-d]-> 28 {n31}: unspecified sequence -[-c-]-> 1 {n32}: Call101-InCtrl : tmp_0 = test_struct(); -[-c-]-> 1 -[-c-]-> 31 {n33}: Call101-OutRet : tmp_0 = test_struct(); -[-c-]-> 1 -[a--]-> 9 -[-c-]-> 31 -[-c-]-> 32 {n34}: res += tmp_0; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 9 -[--d]-> 18 -[-c-]-> 31 -[--d]-> 33 {n35}: unspecified sequence -[-c-]-> 1 {n36}: Call104-InCtrl : tmp_1 = test_if_simple(); -[-c-]-> 1 -[-c-]-> 35 {n37}: Call104-OutRet : tmp_1 = test_if_simple(); -[-c-]-> 1 -[a--]-> 10 -[-c-]-> 35 -[-c-]-> 36 -[--d]-> 65 {n38}: res += tmp_1; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 10 -[--d]-> 34 -[-c-]-> 35 -[--d]-> 37 {n39}: unspecified sequence -[-c-]-> 1 {n40}: Call107-InCtrl : tmp_2 = test_goto_simple(); -[-c-]-> 1 -[-c-]-> 39 {n41}: Call107-OutRet : tmp_2 = test_goto_simple(); -[-c-]-> 1 -[a--]-> 11 -[-c-]-> 39 -[-c-]-> 40 -[--d]-> 65 {n42}: res += tmp_2; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 11 -[--d]-> 38 -[-c-]-> 39 -[--d]-> 41 {n43}: unspecified sequence -[-c-]-> 1 {n44}: Call110-InCtrl : tmp_3 = test_goto_arriere(); -[-c-]-> 1 -[-c-]-> 43 {n45}: Call110-Out(G) : tmp_3 = test_goto_arriere(); -[-c-]-> 1 -[-c-]-> 43 -[-c-]-> 44 -[--d]-> 65 {n46}: Call110-OutRet : tmp_3 = test_goto_arriere(); -[-c-]-> 1 -[a--]-> 12 -[-c-]-> 43 -[-c-]-> 44 -[--d]-> 65 {n47}: res += tmp_3; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 12 -[--d]-> 42 -[-c-]-> 43 -[--d]-> 46 {n48}: unspecified sequence -[-c-]-> 1 {n49}: Call113-InCtrl : tmp_4 = test_goto_else(); -[-c-]-> 1 -[-c-]-> 48 {n50}: Call113-OutRet : tmp_4 = test_goto_else(); -[-c-]-> 1 -[a--]-> 13 -[-c-]-> 48 -[-c-]-> 49 {n51}: res += tmp_4; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 13 -[--d]-> 47 -[-c-]-> 48 -[--d]-> 50 {n52}: unspecified sequence -[-c-]-> 1 {n53}: Call116-InCtrl : tmp_5 = test_simple_loop(G); -[-c-]-> 1 -[-c-]-> 52 {n54}: Call116-In1 : tmp_5 = test_simple_loop(G); -[-c-]-> 1 -[--d](G)-> 45 -[-c-]-> 52 -[-c-]-> 53 {n55}: Call116-OutRet : tmp_5 = test_simple_loop(G); -[-c-]-> 1 -[a--]-> 14 -[-c-]-> 52 -[-c-]-> 53 -[--d]-> 54 {n56}: res += tmp_5; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 14 -[--d]-> 51 -[-c-]-> 52 -[--d]-> 55 {n57}: unspecified sequence -[-c-]-> 1 {n58}: Call119-InCtrl : tmp_6 = multiple_global_inputs(); -[-c-]-> 1 -[-c-]-> 57 {n59}: Call119-OutRet : tmp_6 = multiple_global_inputs(); -[-c-]-> 1 -[a--]-> 15 -[--d](G)-> 45 -[-c-]-> 57 -[-c-]-> 58 -[--d]-> 64 {n60}: res += tmp_6; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 15 -[--d]-> 56 -[-c-]-> 57 -[--d]-> 59 {n61}: __retres = *p + res; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 6 -[a--]-> 16 -[--d]-> 23 -[--d]-> 24 -[--d]-> 26 -[--d]-> 28 -[--d]-> 30 -[--d]-> 60 {n62}: return __retres; -[-c-]-> 1 -[--d]-> 16 -[--d]-> 61 {n63}: OutRet -[--d]-> 62 {n64}: In(S.a) {n65}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/dpds_intra.8.res.oracle0000666000000000000000000000756213571573400020662 0ustar [kernel] Parsing tests/pdg/dpds_intra.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] S ∈ [--..--] [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:113: Warning: signed overflow. assert tmp + s.a ≤ 2147483647; (tmp from b++) [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert -2147483648 ≤ 2 * a; [eva:alarm] tests/pdg/dpds_intra.c:114: Warning: signed overflow. assert 2 * a ≤ 2147483647; [eva:alarm] tests/pdg/dpds_intra.c:124: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] computing for function test_struct <- main. Called from tests/pdg/dpds_intra.c:126. [eva] Recording results for test_struct [eva] Done for function test_struct [eva] computing for function test_if_simple <- main. Called from tests/pdg/dpds_intra.c:127. [eva:alarm] tests/pdg/dpds_intra.c:51: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for test_if_simple [eva] Done for function test_if_simple [eva] computing for function test_goto_simple <- main. Called from tests/pdg/dpds_intra.c:128. [eva] Recording results for test_goto_simple [eva] Done for function test_goto_simple [eva] computing for function test_goto_arriere <- main. Called from tests/pdg/dpds_intra.c:129. [eva:alarm] tests/pdg/dpds_intra.c:66: Warning: signed overflow. assert -2147483648 ≤ G - 1; [eva:alarm] tests/pdg/dpds_intra.c:65: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for test_goto_arriere [eva] Done for function test_goto_arriere [eva:alarm] tests/pdg/dpds_intra.c:129: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from test_goto_arriere()) [eva] computing for function test_goto_else <- main. Called from tests/pdg/dpds_intra.c:130. [eva] Recording results for test_goto_else [eva] Done for function test_goto_else [eva:alarm] tests/pdg/dpds_intra.c:130: Warning: signed overflow. assert res + tmp_4 ≤ 2147483647; (tmp_4 from test_goto_else()) [eva] computing for function test_simple_loop <- main. Called from tests/pdg/dpds_intra.c:131. [eva] tests/pdg/dpds_intra.c:99: starting to merge loop iterations [eva:alarm] tests/pdg/dpds_intra.c:100: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for test_simple_loop [eva] Done for function test_simple_loop [eva:alarm] tests/pdg/dpds_intra.c:131: Warning: signed overflow. assert res + tmp_5 ≤ 2147483647; (tmp_5 from test_simple_loop(G)) [eva] computing for function multiple_global_inputs <- main. Called from tests/pdg/dpds_intra.c:132. [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert -2147483648 ≤ S.a + G; [eva:alarm] tests/pdg/dpds_intra.c:35: Warning: signed overflow. assert S.a + G ≤ 2147483647; [eva] Recording results for multiple_global_inputs [eva] Done for function multiple_global_inputs [eva:alarm] tests/pdg/dpds_intra.c:132: Warning: signed overflow. assert res + tmp_6 ≤ 2147483647; (tmp_6 from multiple_global_inputs()) [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert -2147483648 ≤ *p + res; [eva:alarm] tests/pdg/dpds_intra.c:134: Warning: signed overflow. assert *p + res ≤ 2147483647; [eva] Recording results for main [eva] done for function main [pdg] computing for function multiple_global_inputs [pdg] done for function multiple_global_inputs [pdg] PDG for multiple_global_inputs {n1}: InCtrl {n2}: VarDecl : __retres {n3}: __retres = S.a + G; -[-c-]-> 1 -[a--]-> 2 -[--d]-> 6 -[--d]-> 7 {n4}: return __retres; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n5}: OutRet -[--d]-> 4 {n6}: In(G) {n7}: In(S.a) frama-c-20.0-Calcium/tests/pdg/oracle/dyn_dpds.res.oracle0000666000000000000000000000565013571573400020165 0ustar [kernel] Parsing tests/pdg/dyn_dpds.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva:alarm] tests/pdg/dyn_dpds.c:20: Warning: signed overflow. assert -2147483648 ≤ a + b; [eva:alarm] tests/pdg/dyn_dpds.c:20: Warning: signed overflow. assert a + b ≤ 2147483647; [eva:alarm] tests/pdg/dyn_dpds.c:23: Warning: signed overflow. assert -x ≤ 2147483647; [eva:alarm] tests/pdg/dyn_dpds.c:24: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM a; b; c [from] ====== END OF DEPENDENCIES ====== /* Generated by Frama-C */ int G; int main(int a, int b, int c) { /* Locals: x, p */ int x; int *p; /* sid:1 */ /*@ assert Eva: signed_overflow: -2147483648 ≤ a + b; */ /*@ assert Eva: signed_overflow: a + b ≤ 2147483647; */ x = a + b; /* sid:2 */ p = & x; /* sid:4 */ if (c < 0) { /* sid:5 */ /*@ assert Eva: signed_overflow: -x ≤ 2147483647; */ x = - x; /* sid:6 */ /*@ assert *p > G; */ ; } /* sid:9 */ return x; } [pdg] computing for function main [pdg] done for function main RESULT for main: {n1}: InCtrl {n2}: VarDecl : a -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : b -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: VarDecl : c -[a--]-> 7 {n7}: In3 -[a--]-> 6 {n8}: VarDecl : x {n9}: VarDecl : p {n10}: x = a + b; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 4 -[--d]-> 5 -[a--]-> 8 {n11}: p = & x; -[-c-]-> 1 -[--d]-> 8 -[a--]-> 9 {n12}: c < 0 -[-c-]-> 1 -[--d]-> 6 -[--d]-> 7 {n13}: x = - x; -[-c-]-> 1 -[a-d]-> 8 -[--d]-> 10 -[-c-]-> 12 {n14}: ; -[-c-]-> 1 -[-c-]-> 12 {n15}: return x; -[-c-]-> 1 -[--d]-> 8 -[--d]-> 10 -[--d]-> 13 {n16}: OutRet -[--d]-> 15 [pdg] dot file generated in tests/pdg/dyn_dpds_0.dot Warning : cannot select G in this function... RESULT for main: {n1}: InCtrl {n2}: VarDecl : a -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : b -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: VarDecl : c -[a--]-> 7 {n7}: In3 -[a--]-> 6 {n8}: VarDecl : x {n9}: VarDecl : p {n10}: x = a + b; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 4 -[--d]-> 5 -[a--]-> 8 {n11}: p = & x; -[-c-]-> 1 -[--d]-> 8 -[a--]-> 9 {n12}: c < 0 -[-c-]-> 1 -[--d]-> 6 -[--d]-> 7 {n13}: x = - x; -[-c-]-> 1 -[a-d]-> 8 -[--d]-> 10 -[-c-]-> 12 {n14}: ; -[-c-]-> 1 -[-c-]-> 12 {n15}: return x; -[-c-]-> 1 -[--d]-> 8 -[--d]-> 10 -[--d]-> 13 {n16}: OutRet -[--d]-> 15 [pdg] dot file generated in tests/pdg/dyn_dpds_1.dot frama-c-20.0-Calcium/tests/pdg/oracle/globals.0.res.oracle0000666000000000000000000000213613571573400020136 0ustar [kernel] Parsing tests/pdg/globals.c (with preprocessing) [eva] Analyzing a complete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {3} S ∈ [--..--] P ∈ {{ &X }} [eva] computing for function f <- g. Called from tests/pdg/globals.c:15. [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function g: [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM X; p [from] Function g: \result FROM X [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: tmp [inout] Inputs for function f: X [inout] Out (internal) for function g: tmp [inout] Inputs for function g: X frama-c-20.0-Calcium/tests/pdg/oracle/globals.1.res.oracle0000666000000000000000000000175213571573400020142 0ustar [kernel] Parsing tests/pdg/globals.c (with preprocessing) [eva] Analyzing a complete application starting at h [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {3} S ∈ [--..--] P ∈ {{ &X }} [eva:alarm] tests/pdg/globals.c:28: Warning: signed overflow. assert s2.a2 + s2.b2 ≤ 2147483647; [eva] Recording results for h [eva] done for function h [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function h: s2.a2 ∈ [-2147483648..2147483644] .b2 ∈ {3} .s2 ∈ UNINITIALIZED __retres ∈ [-2147483645..2147483647] [from] Computing for function h [from] Done for function h [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function h: \result FROM X; P; x [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function h: s2{.a2; .b2}; __retres [inout] Inputs for function h: X; P frama-c-20.0-Calcium/tests/pdg/oracle/globals.2.res.oracle0000666000000000000000000000136513571573400020143 0ustar [kernel] Parsing tests/pdg/globals.c (with preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {3} S ∈ [--..--] P ∈ {{ &X }} [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM X; p [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: tmp [inout] Inputs for function f: X frama-c-20.0-Calcium/tests/pdg/oracle/inter_alias.res.oracle0000666000000000000000000000643313571573400020653 0ustar [kernel] Parsing tests/pdg/inter_alias.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] computing for function f1 <- main. Called from tests/pdg/inter_alias.c:15. [eva] Recording results for f1 [from] Computing for function f1 [from] Done for function f1 [eva] Done for function f1 [eva] computing for function f1 <- main. Called from tests/pdg/inter_alias.c:16. [eva] Recording results for f1 [from] Computing for function f1 [from] Done for function f1 [eva] Done for function f1 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f1: a ∈ {3} b ∈ {0; 4} __retres ∈ {3; 4} [eva:final-states] Values at end of function main: a ∈ {3} b ∈ {4} __retres ∈ {7} [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f1 at tests/pdg/inter_alias.c:15 (by main): a FROM G; p1; x1; a \result FROM G; p1; x1; a [from] call to f1 at tests/pdg/inter_alias.c:16 (by main): b FROM G; p1; x1; b \result FROM G; p1; x1; b [from] entry point: \result FROM G [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function f1: a; b; __retres [inout] Inputs for function f1: G; a; b [inout] Out (internal) for function main: a; b; __retres [inout] Inputs for function main: G [pdg] computing for function f1 [pdg] done for function f1 [pdg] computing for function main [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for f1 {n1}: InCtrl {n2}: VarDecl : p1 -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : x1 -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: VarDecl : __retres {n7}: *p1 += G + x1; -[-c-]-> 1 -[a-d]-> 2 -[a-d]-> 3 -[--d]-> 4 -[--d]-> 5 -[--d]-> 11 -[--d]-> 12 -[--d]-> 13 {n8}: __retres = *p1; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[a--]-> 6 -[--d]-> 7 -[--d]-> 11 -[--d]-> 12 {n9}: return __retres; -[-c-]-> 1 -[--d]-> 6 -[--d]-> 8 {n10}: OutRet -[--d]-> 9 {n11}: In(a) {n12}: In(b) {n13}: In(G) [pdg] PDG for main {n14}: InCtrl {n15}: VarDecl : a {n16}: VarDecl : b {n17}: VarDecl : __retres {n18}: int a = 0; -[-c-]-> 14 -[a--]-> 15 {n19}: int b = 0; -[-c-]-> 14 -[a--]-> 16 {n20}: Call7-InCtrl : f1(& a,3); -[-c-]-> 14 {n21}: Call7-In1 : f1(& a,3); -[-c-]-> 14 -[--d]-> 15 -[-c-]-> 20 {n22}: Call7-In2 : f1(& a,3); -[-c-]-> 14 -[-c-]-> 20 {n23}: Call7-Out(a) : f1(& a,3); -[-c-]-> 14 -[--d]-> 18 -[-c-]-> 20 -[--d]-> 21 -[--d]-> 22 -[--d]-> 31 {n24}: Call8-InCtrl : f1(& b,4); -[-c-]-> 14 {n25}: Call8-In1 : f1(& b,4); -[-c-]-> 14 -[--d]-> 16 -[-c-]-> 24 {n26}: Call8-In2 : f1(& b,4); -[-c-]-> 14 -[-c-]-> 24 {n27}: Call8-Out(b) : f1(& b,4); -[-c-]-> 14 -[--d]-> 19 -[-c-]-> 24 -[--d]-> 25 -[--d]-> 26 -[--d]-> 31 {n28}: __retres = a + b; -[-c-]-> 14 -[--d]-> 15 -[--d]-> 16 -[a--]-> 17 -[--d](a)-> 23 -[--d](b)-> 27 {n29}: return __retres; -[-c-]-> 14 -[--d]-> 17 -[--d]-> 28 {n30}: OutRet -[--d]-> 29 {n31}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/inter_alias2.0.res.oracle0000666000000000000000000000323313571573400021066 0ustar [kernel] Parsing tests/pdg/inter_alias2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/inter_alias2.c:23. [eva] computing for function incr_ptr <- f1 <- main. Called from tests/pdg/inter_alias2.c:14. [eva:alarm] tests/pdg/inter_alias2.c:9: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] Recording results for incr_ptr [eva] Done for function incr_ptr [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/inter_alias2.c:24. [eva] computing for function incr_ptr <- f2 <- main. Called from tests/pdg/inter_alias2.c:19. [eva] Recording results for incr_ptr [eva] Done for function incr_ptr [eva] Recording results for f2 [eva] Done for function f2 [eva:alarm] tests/pdg/inter_alias2.c:26: Warning: signed overflow. assert -2147483648 ≤ v1 + v2; [eva:alarm] tests/pdg/inter_alias2.c:26: Warning: signed overflow. assert v1 + v2 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function incr_ptr: x1 ∈ [-2147483647..2147483647] x2 ∈ [-2147483647..2147483647] [eva:final-states] Values at end of function f1: x1 ∈ [-2147483647..2147483647] [eva:final-states] Values at end of function f2: x2 ∈ [-2147483647..2147483647] [eva:final-states] Values at end of function main: v1 ∈ [-2147483647..2147483647] v2 ∈ [-2147483647..2147483647] __retres ∈ [--..--] frama-c-20.0-Calcium/tests/pdg/oracle/inter_alias2.1.res.oracle0000666000000000000000000000441713571573400021074 0ustar [kernel] Parsing tests/pdg/inter_alias2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/inter_alias2.c:23. [eva] computing for function incr_ptr <- f1 <- main. Called from tests/pdg/inter_alias2.c:14. [eva:alarm] tests/pdg/inter_alias2.c:9: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] Recording results for incr_ptr [from] Computing for function incr_ptr [from] Done for function incr_ptr [eva] Done for function incr_ptr [eva] Recording results for f1 [from] Computing for function f1 [from] Done for function f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/inter_alias2.c:24. [eva] computing for function incr_ptr <- f2 <- main. Called from tests/pdg/inter_alias2.c:19. [eva] Recording results for incr_ptr [from] Computing for function incr_ptr [from] Done for function incr_ptr [eva] Done for function incr_ptr [eva] Recording results for f2 [from] Computing for function f2 [from] Done for function f2 [eva] Done for function f2 [eva:alarm] tests/pdg/inter_alias2.c:26: Warning: signed overflow. assert -2147483648 ≤ v1 + v2; [eva:alarm] tests/pdg/inter_alias2.c:26: Warning: signed overflow. assert v1 + v2 ≤ 2147483647; [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to incr_ptr at tests/pdg/inter_alias2.c:14 (by f1): x1 FROM p; x1 [from] call to incr_ptr at tests/pdg/inter_alias2.c:19 (by f2): x2 FROM p; x2 [from] call to f1 at tests/pdg/inter_alias2.c:23 (by main): \result FROM a [from] call to f2 at tests/pdg/inter_alias2.c:24 (by main): \result FROM b [from] entry point: \result FROM i1; i2 [from] ====== END OF CALLWISE DEPENDENCIES ====== [pdg] computing for function incr_ptr [pdg] done for function incr_ptr [pdg] PDG for incr_ptr {n1}: InCtrl {n2}: VarDecl : p -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: (*p) ++; -[-c-]-> 1 -[a-d]-> 2 -[a-d]-> 3 -[--d]-> 6 -[--d]-> 7 {n5}: return; -[-c-]-> 1 {n6}: In(x1) {n7}: In(x2) frama-c-20.0-Calcium/tests/pdg/oracle/inter_alias2.2.res.oracle0000666000000000000000000000501213571573400021065 0ustar [kernel] Parsing tests/pdg/inter_alias2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/inter_alias2.c:23. [eva] computing for function incr_ptr <- f1 <- main. Called from tests/pdg/inter_alias2.c:14. [eva:alarm] tests/pdg/inter_alias2.c:9: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] Recording results for incr_ptr [from] Computing for function incr_ptr [from] Done for function incr_ptr [eva] Done for function incr_ptr [eva] Recording results for f1 [from] Computing for function f1 [from] Done for function f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/inter_alias2.c:24. [eva] computing for function incr_ptr <- f2 <- main. Called from tests/pdg/inter_alias2.c:19. [eva] Recording results for incr_ptr [from] Computing for function incr_ptr [from] Done for function incr_ptr [eva] Done for function incr_ptr [eva] Recording results for f2 [from] Computing for function f2 [from] Done for function f2 [eva] Done for function f2 [eva:alarm] tests/pdg/inter_alias2.c:26: Warning: signed overflow. assert -2147483648 ≤ v1 + v2; [eva:alarm] tests/pdg/inter_alias2.c:26: Warning: signed overflow. assert v1 + v2 ≤ 2147483647; [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to incr_ptr at tests/pdg/inter_alias2.c:14 (by f1): x1 FROM p; x1 [from] call to incr_ptr at tests/pdg/inter_alias2.c:19 (by f2): x2 FROM p; x2 [from] call to f1 at tests/pdg/inter_alias2.c:23 (by main): \result FROM a [from] call to f2 at tests/pdg/inter_alias2.c:24 (by main): \result FROM b [from] entry point: \result FROM i1; i2 [from] ====== END OF CALLWISE DEPENDENCIES ====== [pdg] computing for function f1 [pdg] done for function f1 [pdg] PDG for f1 {n1}: InCtrl {n2}: VarDecl : a -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : x1 {n5}: int x1 = a; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[a--]-> 4 {n6}: Call5-InCtrl : incr_ptr(& x1); -[-c-]-> 1 {n7}: Call5-In1 : incr_ptr(& x1); -[-c-]-> 1 -[--d]-> 4 -[-c-]-> 6 {n8}: Call5-Out(x1) : incr_ptr(& x1); -[-c-]-> 1 -[--d]-> 5 -[-c-]-> 6 -[--d]-> 7 {n9}: return x1; -[-c-]-> 1 -[--d]-> 4 -[--d](x1)-> 8 {n10}: OutRet -[--d]-> 9 frama-c-20.0-Calcium/tests/pdg/oracle/inter_alias2.3.res.oracle0000666000000000000000000000501513571573400021071 0ustar [kernel] Parsing tests/pdg/inter_alias2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/inter_alias2.c:23. [eva] computing for function incr_ptr <- f1 <- main. Called from tests/pdg/inter_alias2.c:14. [eva:alarm] tests/pdg/inter_alias2.c:9: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] Recording results for incr_ptr [from] Computing for function incr_ptr [from] Done for function incr_ptr [eva] Done for function incr_ptr [eva] Recording results for f1 [from] Computing for function f1 [from] Done for function f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/inter_alias2.c:24. [eva] computing for function incr_ptr <- f2 <- main. Called from tests/pdg/inter_alias2.c:19. [eva] Recording results for incr_ptr [from] Computing for function incr_ptr [from] Done for function incr_ptr [eva] Done for function incr_ptr [eva] Recording results for f2 [from] Computing for function f2 [from] Done for function f2 [eva] Done for function f2 [eva:alarm] tests/pdg/inter_alias2.c:26: Warning: signed overflow. assert -2147483648 ≤ v1 + v2; [eva:alarm] tests/pdg/inter_alias2.c:26: Warning: signed overflow. assert v1 + v2 ≤ 2147483647; [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to incr_ptr at tests/pdg/inter_alias2.c:14 (by f1): x1 FROM p; x1 [from] call to incr_ptr at tests/pdg/inter_alias2.c:19 (by f2): x2 FROM p; x2 [from] call to f1 at tests/pdg/inter_alias2.c:23 (by main): \result FROM a [from] call to f2 at tests/pdg/inter_alias2.c:24 (by main): \result FROM b [from] entry point: \result FROM i1; i2 [from] ====== END OF CALLWISE DEPENDENCIES ====== [pdg] computing for function f2 [pdg] done for function f2 [pdg] PDG for f2 {n1}: InCtrl {n2}: VarDecl : b -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : x2 {n5}: int x2 = b; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[a--]-> 4 {n6}: Call10-InCtrl : incr_ptr(& x2); -[-c-]-> 1 {n7}: Call10-In1 : incr_ptr(& x2); -[-c-]-> 1 -[--d]-> 4 -[-c-]-> 6 {n8}: Call10-Out(x2) : incr_ptr(& x2); -[-c-]-> 1 -[--d]-> 5 -[-c-]-> 6 -[--d]-> 7 {n9}: return x2; -[-c-]-> 1 -[--d]-> 4 -[--d](x2)-> 8 {n10}: OutRet -[--d]-> 9 frama-c-20.0-Calcium/tests/pdg/oracle/loops.0.res.oracle0000666000000000000000000000275613571573400017657 0ustar [kernel] Parsing tests/pdg/loops.c (with preprocessing) [eva] Analyzing an incomplete application starting at simple [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization after ∈ [--..--] [eva] tests/pdg/loops.c:41: starting to merge loop iterations [eva:alarm] tests/pdg/loops.c:42: Warning: signed overflow. assert s + 2 ≤ 2147483647; [eva] Recording results for simple [eva] done for function simple [pdg] computing for function simple [pdg] done for function simple [pdg] PDG for simple {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : s {n5}: VarDecl : i {n6}: int s = 0; -[-c-]-> 1 -[a--]-> 4 {n7}: int i = 0; -[-c-]-> 1 -[a--]-> 5 {n8}: while(1) -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 13 {n9}: i < n -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 5 -[--d]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[--d]-> 12 -[-c-]-> 13 {n10}: block -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 13 {n11}: s += 2; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 6 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 11 -[-c-]-> 13 {n12}: i ++; -[-c-]-> 1 -[a-d]-> 5 -[--d]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 12 -[-c-]-> 13 {n13}: break; -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 13 {n14}: after = 0; -[-c-]-> 1 {n15}: return s; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 6 -[--d]-> 11 {n16}: OutRet -[--d]-> 15 frama-c-20.0-Calcium/tests/pdg/oracle/loops.1.res.oracle0000666000000000000000000000315413571573400017651 0ustar [kernel] Parsing tests/pdg/loops.c (with preprocessing) [eva] Analyzing an incomplete application starting at simple_with_break [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization after ∈ [--..--] [eva] tests/pdg/loops.c:51: starting to merge loop iterations [eva:alarm] tests/pdg/loops.c:53: Warning: signed overflow. assert s + 2 ≤ 2147483647; [eva] Recording results for simple_with_break [eva] done for function simple_with_break [pdg] computing for function simple_with_break [pdg] done for function simple_with_break [pdg] PDG for simple_with_break {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : s {n5}: VarDecl : i {n6}: int s = 0; -[-c-]-> 1 -[a--]-> 4 {n7}: int i = 0; -[-c-]-> 1 -[a--]-> 5 {n8}: while(1) -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 13 {n9}: block -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 13 {n10}: i < n -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 5 -[--d]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 12 -[-c-]-> 13 {n11}: s += 2; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 6 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 11 -[-c-]-> 13 {n12}: i ++; -[-c-]-> 1 -[a-d]-> 5 -[--d]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 12 -[-c-]-> 13 {n13}: break; -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 13 {n14}: after = 0; -[-c-]-> 1 {n15}: return s; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 6 -[--d]-> 11 {n16}: OutRet -[--d]-> 15 frama-c-20.0-Calcium/tests/pdg/oracle/loops.2.res.oracle0000666000000000000000000000242013571573400017645 0ustar [kernel] Parsing tests/pdg/loops.c (with preprocessing) [eva] Analyzing an incomplete application starting at infinite [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization after ∈ [--..--] [eva] tests/pdg/loops.c:65: starting to merge loop iterations [eva:alarm] tests/pdg/loops.c:66: Warning: signed overflow. assert s + 2 ≤ 2147483647; [eva:alarm] tests/pdg/loops.c:67: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva] Recording results for infinite [eva] done for function infinite [pdg] computing for function infinite [pdg] tests/pdg/loops.c:70: Warning: no final state. Probably unreachable... [pdg] done for function infinite [pdg] PDG for infinite {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : s {n5}: VarDecl : i {n6}: int s = 0; -[-c-]-> 1 -[a--]-> 4 {n7}: int i = 0; -[-c-]-> 1 -[a--]-> 5 {n8}: return s; -[-c-]-> 1 -[--d]-> 4 {n9}: OutRet {n10}: while(1) -[-c-]-> 1 -[-c-]-> 10 {n11}: block -[-c-]-> 1 -[-c-]-> 10 {n12}: s += 2; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 6 -[-c-]-> 10 -[-c-]-> 11 -[--d]-> 12 {n13}: i ++; -[-c-]-> 1 -[a-d]-> 5 -[--d]-> 7 -[-c-]-> 10 -[-c-]-> 11 -[--d]-> 13 frama-c-20.0-Calcium/tests/pdg/oracle/loops.3.res.oracle0000666000000000000000000000227713571573400017660 0ustar [kernel] Parsing tests/pdg/loops.c (with preprocessing) [eva] Analyzing an incomplete application starting at infinite2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization after ∈ [--..--] [eva] tests/pdg/loops.c:75: starting to merge loop iterations [eva:alarm] tests/pdg/loops.c:76: Warning: signed overflow. assert s + 2 ≤ 2147483647; [eva] Recording results for infinite2 [eva] done for function infinite2 [pdg] computing for function infinite2 [pdg] tests/pdg/loops.c:79: Warning: no final state. Probably unreachable... [pdg] done for function infinite2 [pdg] PDG for infinite2 {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : s {n5}: VarDecl : i {n6}: int s = 0; -[-c-]-> 1 -[a--]-> 4 {n7}: int i = 1; -[-c-]-> 1 -[a--]-> 5 {n8}: while(1) -[-c-]-> 1 -[-c-]-> 8 {n9}: i -[-c-]-> 1 -[--d]-> 5 -[--d]-> 7 -[-c-]-> 8 {n10}: block -[-c-]-> 1 -[-c-]-> 8 {n11}: s += 2; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 6 -[-c-]-> 8 -[-c-]-> 10 -[--d]-> 11 {n12}: break; -[-c-]-> 1 -[-c-]-> 8 {n13}: return s; -[-c-]-> 1 -[--d]-> 4 {n14}: OutRet frama-c-20.0-Calcium/tests/pdg/oracle/loops.4.res.oracle0000666000000000000000000000307313571573400017654 0ustar [kernel] Parsing tests/pdg/loops.c (with preprocessing) [eva] Analyzing an incomplete application starting at maybe_infinite [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization after ∈ [--..--] [eva] tests/pdg/loops.c:84: starting to merge loop iterations [eva:alarm] tests/pdg/loops.c:88: Warning: signed overflow. assert i + 2 ≤ 2147483647; [eva] Recording results for maybe_infinite [eva] done for function maybe_infinite [pdg] computing for function maybe_infinite [pdg] done for function maybe_infinite [pdg] PDG for maybe_infinite {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : s {n5}: VarDecl : i {n6}: int s = 0; -[-c-]-> 1 -[a--]-> 4 {n7}: int i = 0; -[-c-]-> 1 -[a--]-> 5 {n8}: n > 0 -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n9}: while(1) -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 {n10}: block -[-c-]-> 1 -[-c-]-> 8 -[-c-]-> 9 {n11}: i ++; -[-c-]-> 1 -[a-d]-> 5 -[--d]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 14 {n12}: s < 10 -[-c-]-> 1 -[--d]-> 4 -[--d]-> 6 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 13 {n13}: s += 2; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 6 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 12 -[--d]-> 13 {n14}: i += 2; -[-c-]-> 1 -[a-d]-> 5 -[-c-]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 11 {n15}: s = 1; -[a--]-> 4 {n16}: after = 0; -[-c-]-> 1 {n17}: return s; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 15 {n18}: OutRet -[--d]-> 17 frama-c-20.0-Calcium/tests/pdg/oracle/loops.5.res.oracle0000666000000000000000000000476513571573400017666 0ustar [kernel] Parsing tests/pdg/loops.c (with preprocessing) [eva] Analyzing an incomplete application starting at two_infinite_loops [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization after ∈ [--..--] [eva] tests/pdg/loops.c:99: starting to merge loop iterations [eva:alarm] tests/pdg/loops.c:110: Warning: signed overflow. assert i1 + 2 ≤ 2147483647; [eva] tests/pdg/loops.c:105: starting to merge loop iterations [eva:alarm] tests/pdg/loops.c:106: Warning: signed overflow. assert i2 + 1 ≤ 2147483647; [eva] Recording results for two_infinite_loops [eva] done for function two_infinite_loops [pdg] computing for function two_infinite_loops [pdg] done for function two_infinite_loops [pdg] PDG for two_infinite_loops {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : s {n5}: VarDecl : i1 {n6}: VarDecl : i2 {n7}: int s = 0; -[-c-]-> 1 -[a--]-> 4 {n8}: int i1 = 0; -[-c-]-> 1 -[a--]-> 5 {n9}: int i2 = 0; -[-c-]-> 1 -[a--]-> 6 {n10}: n > 0 -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n11}: while(1) -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 20 {n12}: block -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 20 {n13}: i1 ++; -[-c-]-> 1 -[a-d]-> 5 -[--d]-> 8 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 14 -[--d]-> 16 -[-c-]-> 20 {n14}: s < 10 -[-c-]-> 1 -[--d]-> 4 -[--d]-> 7 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 14 -[--d]-> 15 -[-c-]-> 20 {n15}: s += 2; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 7 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 14 -[--d]-> 15 -[-c-]-> 20 {n16}: i1 += 2; -[-c-]-> 1 -[a-d]-> 5 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[--d]-> 13 -[-c-]-> 14 -[-c-]-> 20 {n17}: s = 1; -[a--]-> 4 {n18}: i2 = 0; -[-c-]-> 1 -[a--]-> 6 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 20 {n19}: after = 0; -[-c-]-> 1 {n20}: while(1) -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 20 {n21}: block -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 20 {n22}: i2 ++; -[-c-]-> 1 -[a-d]-> 6 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 14 -[--d]-> 18 -[-c-]-> 20 -[-c-]-> 21 -[--d]-> 22 {n23}: return s; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 17 {n24}: OutRet -[--d]-> 23 frama-c-20.0-Calcium/tests/pdg/oracle/loops.6.res.oracle0000666000000000000000000000173213571573400017656 0ustar [kernel] Parsing tests/pdg/loops.c (with preprocessing) [eva] Analyzing an incomplete application starting at loop_with_goto [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization after ∈ [--..--] [eva:alarm] tests/pdg/loops.c:120: Warning: signed overflow. assert -2147483648 ≤ n - 1; [eva] Recording results for loop_with_goto [eva] done for function loop_with_goto [pdg] computing for function loop_with_goto [pdg] done for function loop_with_goto [pdg] PDG for loop_with_goto {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: n > 0 -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n5}: L: -[-c-]-> 1 -[-c-]-> 4 -[-c-]-> 7 {n6}: L: n --; -[-c-]-> 1 -[a-d]-> 2 -[--d]-> 3 -[-c-]-> 4 -[--d]-> 6 -[-c-]-> 7 {n7}: goto L; -[-c-]-> 1 -[-c-]-> 4 -[-c-]-> 5 -[-c-]-> 7 {n8}: return n; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n9}: OutRet -[--d]-> 8 frama-c-20.0-Calcium/tests/pdg/oracle/loops.7.res.oracle0000666000000000000000000000300013571573400017645 0ustar [kernel] Parsing tests/pdg/loops.c (with preprocessing) [eva] Analyzing an incomplete application starting at non_natural_loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization after ∈ [--..--] [eva:alarm] tests/pdg/loops.c:137: Warning: signed overflow. assert x + 2 ≤ 2147483647; [eva] Recording results for non_natural_loop [eva] done for function non_natural_loop [eva] tests/pdg/loops.c:137: assertion 'Eva,signed_overflow' got final status valid. [pdg] computing for function non_natural_loop [pdg] done for function non_natural_loop [pdg] PDG for non_natural_loop {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : x {n5}: int x = 1; -[-c-]-> 1 -[a--]-> 4 {n6}: n < 0 -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n7}: x = 0; -[-c-]-> 1 -[a--]-> 4 -[-c-]-> 6 {n8}: n = 20; -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 6 {n9}: n = 10; -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 6 {n10}: L: -[-c-]-> 1 -[-c-]-> 6 -[-c-]-> 12 -[-c-]-> 13 {n11}: L: x += 2; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 5 -[-c-]-> 6 -[--d]-> 7 -[--d]-> 11 -[-c-]-> 12 -[-c-]-> 13 {n12}: x < n -[-c-]-> 1 -[--d]-> 2 -[--d]-> 4 -[--d]-> 7 -[--d]-> 8 -[--d]-> 9 -[--d]-> 11 -[-c-]-> 12 -[-c-]-> 13 {n13}: goto L; -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 13 {n14}: return x; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 7 -[--d]-> 11 {n15}: OutRet -[--d]-> 14 frama-c-20.0-Calcium/tests/pdg/oracle/loops.8.res.oracle0000666000000000000000000000170113571573400017654 0ustar [kernel] Parsing tests/pdg/loops.c (with preprocessing) [eva] Analyzing an incomplete application starting at dead_code [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization after ∈ [--..--] [eva] Recording results for dead_code [eva] done for function dead_code [pdg] computing for function dead_code [pdg] done for function dead_code [pdg] PDG for dead_code {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : x {n5}: int x = 0; -[-c-]-> 1 -[a--]-> 4 {n6}: W: -[-c-]-> 1 -[-c-]-> 9 {n7}: n > 0 -[-c-]-> 1 -[--d]-> 2 -[-c-]-> 9 {n8}: goto W; -[-c-]-> 1 -[-c-]-> 6 -[-c-]-> 9 {n9}: goto L; -[-c-]-> 1 -[-c-]-> 10 {n10}: L: -[-c-]-> 1 {n11}: L: x += n; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[a-d]-> 4 -[--d]-> 5 {n12}: return x; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 11 {n13}: OutRet -[--d]-> 12 frama-c-20.0-Calcium/tests/pdg/oracle/multiple_calls.0.res.oracle0000666000000000000000000001032613571573400021524 0ustar [kernel] Parsing tests/pdg/multiple_calls.c (with preprocessing) [eva] Analyzing a complete application starting at appel_ptr_fct [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ [--..--] G2 ∈ [--..--] G3 ∈ [--..--] G4 ∈ [--..--] [eva] computing for function fct2 <- appel_ptr_fct. Called from tests/pdg/multiple_calls.c:23. [eva] Recording results for fct2 [eva] Done for function fct2 [eva] computing for function fct1 <- appel_ptr_fct. Called from tests/pdg/multiple_calls.c:23. [eva] Recording results for fct1 [eva] Done for function fct1 [eva:alarm] tests/pdg/multiple_calls.c:24: Warning: signed overflow. assert x + G1 ≤ 2147483647; [eva:alarm] tests/pdg/multiple_calls.c:24: Warning: signed overflow. assert -2147483648 ≤ (int)(x + G1) + G2; [eva:alarm] tests/pdg/multiple_calls.c:24: Warning: signed overflow. assert (int)(x + G1) + G2 ≤ 2147483647; [eva] Recording results for appel_ptr_fct [eva] done for function appel_ptr_fct [from] Computing for function fct1 [from] Done for function fct1 [from] Computing for function fct2 [from] Done for function fct2 [from] Computing for function appel_ptr_fct [from] Done for function appel_ptr_fct [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function fct1: G1 FROM z G3 FROM y G4 FROM z \result FROM x [from] Function fct2: G2 FROM z G3 FROM x \result FROM y [from] Function appel_ptr_fct: G1 FROM c; d (and SELF) G2 FROM c; d (and SELF) G3 FROM c G4 FROM c; d (and SELF) \result FROM G1; G2; c; d [from] ====== END OF DEPENDENCIES ====== [inout] InOut (internal) for function fct1: Operational inputs: x; y; z Operational inputs on termination: x; y; z Sure outputs: G1; G3; G4 [inout] InOut (internal) for function fct2: Operational inputs: x; y; z Operational inputs on termination: x; y; z Sure outputs: G2; G3 [inout] InOut (internal) for function appel_ptr_fct: Operational inputs: G1; G2; c; d Operational inputs on termination: G1; G2; c; d Sure outputs: G3; a; b; pf; tmp; x; tmp_0; __retres [pdg] computing for function appel_ptr_fct [pdg] done for function appel_ptr_fct [pdg] PDG for appel_ptr_fct {n1}: InCtrl {n2}: VarDecl : c -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : d -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: VarDecl : a {n7}: VarDecl : b {n8}: VarDecl : pf {n9}: VarDecl : tmp {n10}: VarDecl : x {n11}: VarDecl : tmp_0 {n12}: VarDecl : __retres {n13}: int a = 1; -[-c-]-> 1 -[a--]-> 6 {n14}: int b = 2; -[-c-]-> 1 -[a--]-> 7 {n15}: c -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n16}: tmp = & fct1; -[-c-]-> 1 -[a--]-> 9 -[-c-]-> 15 {n17}: tmp = & fct2; -[-c-]-> 1 -[a--]-> 9 -[-c-]-> 15 {n18}: int (*pf)(int , int , int ) = tmp; -[-c-]-> 1 -[a--]-> 8 -[--d]-> 9 -[--d]-> 16 -[--d]-> 17 {n19}: Call19-InCtrl : tmp_0 = (*pf)(a,b,d); -[-c-]-> 1 {n20}: Call19-In1 : tmp_0 = (*pf)(a,b,d); -[-c-]-> 1 -[--d]-> 6 -[--d]-> 13 -[-c-]-> 19 {n21}: Call19-In2 : tmp_0 = (*pf)(a,b,d); -[-c-]-> 1 -[--d]-> 7 -[--d]-> 14 -[-c-]-> 19 {n22}: Call19-In3 : tmp_0 = (*pf)(a,b,d); -[-c-]-> 1 -[--d]-> 4 -[--d]-> 5 -[-c-]-> 19 {n23}: Call19-Out(G1) : tmp_0 = (*pf)(a,b,d); -[-c-]-> 1 -[-c-]-> 18 -[-c-]-> 19 -[--d]-> 22 {n24}: Call19-Out(G3) : tmp_0 = (*pf)(a,b,d); -[-c-]-> 1 -[-c-]-> 18 -[-c-]-> 19 -[--d]-> 20 -[--d]-> 21 {n25}: Call19-Out(G4) : tmp_0 = (*pf)(a,b,d); -[-c-]-> 1 -[-c-]-> 18 -[-c-]-> 19 -[--d]-> 22 {n26}: Call19-OutRet : tmp_0 = (*pf)(a,b,d); -[-c-]-> 1 -[a--]-> 11 -[-c-]-> 18 -[-c-]-> 19 -[--d]-> 20 -[--d]-> 21 {n27}: Call19-Out(G2) : tmp_0 = (*pf)(a,b,d); -[-c-]-> 1 -[-c-]-> 18 -[-c-]-> 19 -[--d]-> 22 {n28}: int x = tmp_0; -[-c-]-> 1 -[a--]-> 10 -[--d]-> 11 -[--d]-> 26 {n29}: __retres = (x + G1) + G2; -[-c-]-> 1 -[--d]-> 10 -[a--]-> 12 -[--d](G1)-> 23 -[--d](G2)-> 27 -[--d]-> 28 -[--d]-> 32 -[--d]-> 33 {n30}: return __retres; -[-c-]-> 1 -[--d]-> 12 -[--d]-> 29 {n31}: OutRet -[--d]-> 30 {n32}: In(G1) {n33}: In(G2) frama-c-20.0-Calcium/tests/pdg/oracle/multiple_calls.1.res.oracle0000666000000000000000000000676713571573400021543 0ustar [kernel] Parsing tests/pdg/multiple_calls.c (with preprocessing) [eva] Analyzing a complete application starting at appel_ptr_fct_bis [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ [--..--] G2 ∈ [--..--] G3 ∈ [--..--] G4 ∈ [--..--] [eva] computing for function fct2 <- appel_ptr_fct_bis. Called from tests/pdg/multiple_calls.c:28. [eva] Recording results for fct2 [eva] Done for function fct2 [eva] computing for function fct1 <- appel_ptr_fct_bis. Called from tests/pdg/multiple_calls.c:28. [eva] Recording results for fct1 [eva] Done for function fct1 [eva] Recording results for appel_ptr_fct_bis [eva] done for function appel_ptr_fct_bis [from] Computing for function fct1 [from] Done for function fct1 [from] Computing for function fct2 [from] Done for function fct2 [from] Computing for function appel_ptr_fct_bis [from] Done for function appel_ptr_fct_bis [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function fct1: G1 FROM z G3 FROM y G4 FROM z \result FROM x [from] Function fct2: G2 FROM z G3 FROM x \result FROM y [from] Function appel_ptr_fct_bis: G1 FROM c; d (and SELF) G2 FROM c; d (and SELF) G3 FROM c; a; b G4 FROM c; a; b \result FROM c; a; b [from] ====== END OF DEPENDENCIES ====== [inout] InOut (internal) for function fct1: Operational inputs: x; y; z Operational inputs on termination: x; y; z Sure outputs: G1; G3; G4 [inout] InOut (internal) for function fct2: Operational inputs: x; y; z Operational inputs on termination: x; y; z Sure outputs: G2; G3 [inout] InOut (internal) for function appel_ptr_fct_bis: Operational inputs: c; a; b; d Operational inputs on termination: c; a; b; d Sure outputs: G3; G4; pf; tmp [pdg] computing for function appel_ptr_fct_bis [pdg] done for function appel_ptr_fct_bis [pdg] PDG for appel_ptr_fct_bis {n1}: InCtrl {n2}: VarDecl : c -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : a -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: VarDecl : b -[a--]-> 7 {n7}: In3 -[a--]-> 6 {n8}: VarDecl : d -[a--]-> 9 {n9}: In4 -[a--]-> 8 {n10}: VarDecl : pf {n11}: VarDecl : tmp {n12}: c -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n13}: tmp = & fct1; -[-c-]-> 1 -[a--]-> 11 -[-c-]-> 12 {n14}: tmp = & fct2; -[-c-]-> 1 -[a--]-> 11 -[-c-]-> 12 {n15}: int (*pf)(int , int , int ) = tmp; -[-c-]-> 1 -[a--]-> 10 -[--d]-> 11 -[--d]-> 13 -[--d]-> 14 {n16}: Call29-InCtrl : G4 = (*pf)(a,b,d); -[-c-]-> 1 {n17}: Call29-In1 : G4 = (*pf)(a,b,d); -[-c-]-> 1 -[--d]-> 4 -[--d]-> 5 -[-c-]-> 16 {n18}: Call29-In2 : G4 = (*pf)(a,b,d); -[-c-]-> 1 -[--d]-> 6 -[--d]-> 7 -[-c-]-> 16 {n19}: Call29-In3 : G4 = (*pf)(a,b,d); -[-c-]-> 1 -[--d]-> 8 -[--d]-> 9 -[-c-]-> 16 {n20}: Call29-Out(G1) : G4 = (*pf)(a,b,d); -[-c-]-> 1 -[-c-]-> 15 -[-c-]-> 16 -[--d]-> 19 {n21}: Call29-Out(G3) : G4 = (*pf)(a,b,d); -[-c-]-> 1 -[-c-]-> 15 -[-c-]-> 16 -[--d]-> 17 -[--d]-> 18 {n22}: Call29-Out(G4) : G4 = (*pf)(a,b,d); -[-c-]-> 1 -[-c-]-> 15 -[-c-]-> 16 -[--d]-> 19 {n23}: Call29-OutRet : G4 = (*pf)(a,b,d); -[-c-]-> 1 -[-c-]-> 15 -[-c-]-> 16 -[--d]-> 17 -[--d]-> 18 {n24}: Call29-Out(G2) : G4 = (*pf)(a,b,d); -[-c-]-> 1 -[-c-]-> 15 -[-c-]-> 16 -[--d]-> 19 {n25}: return G4; -[-c-]-> 1 -[--d]-> 23 {n26}: OutRet -[--d]-> 25 frama-c-20.0-Calcium/tests/pdg/oracle/no_body.res.oracle0000666000000000000000000000467113571573400020014 0ustar [kernel] Parsing tests/pdg/no_body.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] computing for function f <- main. Called from tests/pdg/no_body.c:24. [kernel:annot:missing-spec] tests/pdg/no_body.c:24: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] computing for function loop <- main. Called from tests/pdg/no_body.c:25. [eva] computing for function f <- loop <- main. Called from tests/pdg/no_body.c:16. [eva] Done for function f [eva:alarm] tests/pdg/no_body.c:18: Warning: signed overflow. assert G + 1 ≤ 2147483647; [eva] tests/pdg/no_body.c:16: starting to merge loop iterations [eva] computing for function f <- loop <- main. Called from tests/pdg/no_body.c:16. [eva] Done for function f [eva] computing for function f <- loop <- main. Called from tests/pdg/no_body.c:16. [eva] Done for function f [eva] computing for function f <- loop <- main. Called from tests/pdg/no_body.c:16. [eva] Done for function f [eva:alarm] tests/pdg/no_body.c:17: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [inout] InOut (internal) for function loop: Operational inputs: G; x Operational inputs on termination: G; x Sure outputs: tmp [inout] InOut (internal) for function main: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: G; x [pdg] computing for function main [from] Computing for function f [from] Done for function f [from] Computing for function loop [from] Done for function loop [pdg] done for function main [pdg] PDG for main {n1}: InCtrl {n2}: VarDecl : x {n3}: int x = 1; -[-c-]-> 1 -[a--]-> 2 {n4}: Call11-InCtrl : G = f(x); -[-c-]-> 1 {n5}: Call11-In1 : G = f(x); -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[-c-]-> 4 {n6}: Call11-OutRet : G = f(x); -[-c-]-> 1 -[-c-]-> 4 -[--d]-> 5 {n7}: Call12-InCtrl : loop(x); -[-c-]-> 1 {n8}: Call12-In1 : loop(x); -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[-c-]-> 7 {n9}: Call12-Out(G) : loop(x); -[-c-]-> 1 -[--d]-> 6 -[-c-]-> 7 -[--d]-> 8 {n10}: return; -[-c-]-> 1 frama-c-20.0-Calcium/tests/pdg/oracle/pb_infinite_loop.0.res.oracle0000666000000000000000000000263513571573400022036 0ustar [kernel] Parsing tests/pdg/pb_infinite_loop.c (with preprocessing) [eva] Analyzing a complete application starting at test_infinite_loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] [eva] tests/pdg/pb_infinite_loop.c:20: starting to merge loop iterations [eva:alarm] tests/pdg/pb_infinite_loop.c:23: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva:alarm] tests/pdg/pb_infinite_loop.c:22: Warning: signed overflow. assert G + 1 ≤ 2147483647; [eva] Recording results for test_infinite_loop [eva] done for function test_infinite_loop [pdg] computing for function test_infinite_loop [pdg] done for function test_infinite_loop [pdg] PDG for test_infinite_loop {n1}: InCtrl {n2}: VarDecl : i {n3}: G < 0 -[-c-]-> 1 -[--d]-> 12 {n4}: int i = 0; -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 3 {n5}: return G; -[-c-]-> 1 -[--d]-> 12 {n6}: OutRet -[--d]-> 5 {n7}: while(1) -[-c-]-> 1 -[-c-]-> 3 -[-c-]-> 7 {n8}: block -[-c-]-> 1 -[-c-]-> 3 -[-c-]-> 7 {n9}: i % 2 -[-c-]-> 1 -[--d]-> 2 -[-c-]-> 3 -[--d]-> 4 -[-c-]-> 7 -[-c-]-> 8 -[--d]-> 11 {n10}: G ++; -[-c-]-> 1 -[-c-]-> 3 -[-c-]-> 7 -[-c-]-> 8 -[-c-]-> 9 -[--d]-> 10 -[--d]-> 12 {n11}: i ++; -[-c-]-> 1 -[a-d]-> 2 -[-c-]-> 3 -[--d]-> 4 -[-c-]-> 7 -[-c-]-> 8 -[--d]-> 11 {n12}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/pb_infinite_loop.1.res.oracle0000666000000000000000000000254713571573400022041 0ustar [kernel] Parsing tests/pdg/pb_infinite_loop.c (with preprocessing) [eva] Analyzing a complete application starting at test_infinite_loop_2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] [eva] tests/pdg/pb_infinite_loop.c:32: starting to merge loop iterations [eva:alarm] tests/pdg/pb_infinite_loop.c:34: Warning: signed overflow. assert G + 1 ≤ 2147483647; [eva:alarm] tests/pdg/pb_infinite_loop.c:35: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva] Recording results for test_infinite_loop_2 [eva] done for function test_infinite_loop_2 [pdg] computing for function test_infinite_loop_2 [pdg] tests/pdg/pb_infinite_loop.c:37: Warning: no final state. Probably unreachable... [pdg] done for function test_infinite_loop_2 [pdg] PDG for test_infinite_loop_2 {n1}: InCtrl {n2}: VarDecl : i {n3}: int i = 0; -[-c-]-> 1 -[a--]-> 2 {n4}: return G; -[-c-]-> 1 {n5}: OutRet {n6}: while(1) -[-c-]-> 1 -[-c-]-> 6 {n7}: block -[-c-]-> 1 -[-c-]-> 6 {n8}: i % 2 -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[-c-]-> 6 -[-c-]-> 7 -[--d]-> 10 {n9}: G ++; -[-c-]-> 1 -[-c-]-> 6 -[-c-]-> 7 -[-c-]-> 8 -[--d]-> 9 -[--d]-> 11 {n10}: i ++; -[-c-]-> 1 -[a-d]-> 2 -[--d]-> 3 -[-c-]-> 6 -[-c-]-> 7 -[--d]-> 10 {n11}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/pb_infinite_loop.2.res.oracle0000666000000000000000000000322113571573400022030 0ustar [kernel] Parsing tests/pdg/pb_infinite_loop.c (with preprocessing) [eva] Analyzing a complete application starting at test_exit [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] [eva] computing for function exit <- test_exit. Called from tests/pdg/pb_infinite_loop.c:48. [kernel:annot:missing-spec] tests/pdg/pb_infinite_loop.c:48: Warning: Neither code nor specification for function exit, generating default assigns from the prototype [eva] using specification for function exit [eva] Done for function exit [eva] Recording results for test_exit [eva] done for function test_exit [pdg] computing for function test_exit [from] Computing for function exit [from] Done for function exit [pdg] done for function test_exit [pdg] PDG for test_exit {n1}: InCtrl {n2}: VarDecl : c -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : __retres {n5}: c -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n6}: block -[-c-]-> 1 -[-c-]-> 5 {n7}: Call30-InCtrl : exit(1); -[-c-]-> 1 -[-c-]-> 5 {n8}: Call30-In1 : exit(1); -[-c-]-> 1 -[-c-]-> 5 -[-c-]-> 7 {n9}: __retres = 1; -[-c-]-> 1 -[a--]-> 4 -[-c-]-> 5 -[-c-]-> 6 {n10}: block -[-c-]-> 1 -[-c-]-> 5 {n11}: goto return_label; -[-c-]-> 1 -[-c-]-> 5 -[-c-]-> 6 -[-c-]-> 12 {n12}: return_label: -[-c-]-> 1 {n13}: __retres = 0; -[-c-]-> 1 -[a--]-> 4 -[-c-]-> 5 -[-c-]-> 10 {n14}: goto return_label; -[-c-]-> 1 -[-c-]-> 5 -[-c-]-> 10 -[-c-]-> 12 {n15}: return_label: return __retres; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 9 -[--d]-> 13 {n16}: OutRet -[--d]-> 15 frama-c-20.0-Calcium/tests/pdg/oracle/postdom.res.oracle0000666000000000000000000000625513571573400020050 0ustar [kernel] Parsing tests/pdg/postdom.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function __VERIFIER_assert <- main. Called from tests/pdg/postdom.c:23. [eva] Recording results for __VERIFIER_assert [eva] Done for function __VERIFIER_assert [eva] tests/pdg/postdom.c:20: starting to merge loop iterations [eva] computing for function __VERIFIER_assert <- main. Called from tests/pdg/postdom.c:23. [eva] Recording results for __VERIFIER_assert [eva] Done for function __VERIFIER_assert [eva] tests/pdg/postdom.c:23: Reusing old results for call to __VERIFIER_assert [eva:alarm] tests/pdg/postdom.c:21: Warning: signed overflow. assert sn + 2 ≤ 2147483647; [eva] tests/pdg/postdom.c:23: Reusing old results for call to __VERIFIER_assert [eva] tests/pdg/postdom.c:23: Reusing old results for call to __VERIFIER_assert [eva] tests/pdg/postdom.c:23: Reusing old results for call to __VERIFIER_assert [eva] Recording results for main [eva] done for function main [pdg] computing for function __VERIFIER_assert [pdg] done for function __VERIFIER_assert [pdg] computing for function main [from] Computing for function __VERIFIER_assert [from] Done for function __VERIFIER_assert [pdg] tests/pdg/postdom.c:20: Warning: no final state. Probably unreachable... [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for __VERIFIER_assert {n1}: InCtrl {n2}: VarDecl : cond -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: ! cond -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n5}: ERROR: -[-c-]-> 1 -[-c-]-> 4 -[-c-]-> 6 {n6}: ERROR: goto ERROR; -[-c-]-> 1 -[-c-]-> 4 -[-c-]-> 5 -[-c-]-> 6 {n7}: return; -[-c-]-> 1 [pdg] PDG for main {n8}: InCtrl {n9}: VarDecl : loop1 -[a--]-> 10 {n10}: In1 -[a--]-> 9 {n11}: VarDecl : m1 -[a--]-> 12 {n12}: In2 -[a--]-> 11 {n13}: VarDecl : sn {n14}: VarDecl : x {n15}: VarDecl : tmp {n16}: VarDecl : __retres {n17}: int sn = 0; -[-c-]-> 8 -[a--]-> 13 {n18}: return __retres; -[-c-]-> 8 -[--d]-> 16 {n19}: OutRet {n20}: unsigned int x = (unsigned int)0; -[-c-]-> 8 -[a--]-> 14 {n21}: while(1) -[-c-]-> 8 -[-c-]-> 21 {n22}: block -[-c-]-> 8 -[-c-]-> 21 {n23}: sn += 2; -[-c-]-> 8 -[a-d]-> 13 -[--d]-> 17 -[-c-]-> 21 -[-c-]-> 22 -[--d]-> 23 {n24}: x ++; -[-c-]-> 8 -[a-d]-> 14 -[--d]-> 20 -[-c-]-> 21 -[-c-]-> 22 -[--d]-> 24 {n25}: (unsigned int)sn == x * (unsigned int)2 -[-c-]-> 8 -[--d]-> 13 -[--d]-> 14 -[-c-]-> 21 -[-c-]-> 22 -[--d]-> 23 -[--d]-> 24 {n26}: tmp = 1; -[-c-]-> 8 -[a--]-> 15 -[-c-]-> 21 -[-c-]-> 22 -[-c-]-> 25 {n27}: sn == 0 -[-c-]-> 8 -[--d]-> 13 -[-c-]-> 21 -[-c-]-> 22 -[--d]-> 23 -[-c-]-> 25 {n28}: tmp = 0; -[-c-]-> 8 -[a--]-> 15 -[-c-]-> 21 -[-c-]-> 22 -[-c-]-> 25 {n29}: Call19-InCtrl : __VERIFIER_assert(tmp); -[-c-]-> 8 -[-c-]-> 21 -[-c-]-> 22 {n30}: Call19-In1 : __VERIFIER_assert(tmp); -[-c-]-> 8 -[--d]-> 15 -[-c-]-> 21 -[-c-]-> 22 -[--d]-> 26 -[--d]-> 28 -[-c-]-> 29 frama-c-20.0-Calcium/tests/pdg/oracle/sets.res.oracle0000666000000000000000000000316213571573400017333 0ustar [kernel] Parsing tests/pdg/sets.c (with preprocessing) [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization b ∈ [--..--] c ∈ [--..--] x ∈ [--..--] y ∈ [--..--] z ∈ [--..--] t ∈ [--..--] [eva:alarm] tests/pdg/sets.c:15: Warning: signed overflow. assert b + y ≤ 2147483647; [eva] Recording results for f [eva] done for function f [inout] InOut (internal) for function f: Operational inputs: a Operational inputs on termination: a Sure outputs: b; c; x; y; z; t [pdg] computing for function f [pdg] done for function f [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for f {n1}: InCtrl {n2}: VarDecl : a -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: y = 0; -[-c-]-> 1 {n5}: a -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n6}: y = 1; -[-c-]-> 1 -[-c-]-> 5 {n7}: z = y; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 6 {n8}: y ++; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 6 {n9}: x = z; -[-c-]-> 1 -[--d]-> 7 {n10}: b = a; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 {n11}: t = b + y; -[-c-]-> 1 -[--d]-> 8 -[--d]-> 10 {n12}: y = 5; -[-c-]-> 1 {n13}: c = 8; -[-c-]-> 1 {n14}: return; -[-c-]-> 1 [kernel] Test [all_uses] stmt1 [kernel] {n9}: x = z; [kernel] {n7}: z = y; [kernel] {n11}: t = b + y; [kernel] {n8}: y ++; [kernel] Test [find_location_nodes_at_stmt] y@11 [kernel] {n12}: y = 5; [kernel] Test [all_dpds] y@11 [kernel] {n1}: InCtrl [kernel] Test [all_uses] y@11 [kernel] Test [all_related_nodes] y@11 [kernel] {n1}: InCtrl [kernel] {n12}: y = 5; frama-c-20.0-Calcium/tests/pdg/oracle/simple_call.0.res.oracle0000666000000000000000000000307213571573400020777 0ustar [kernel] Parsing tests/pdg/simple_call.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] G1 ∈ [--..--] G2 ∈ [--..--] S ∈ [--..--] [eva] computing for function call <- main. Called from tests/pdg/simple_call.c:58. [eva:alarm] tests/pdg/simple_call.c:45: Warning: signed overflow. assert G + y ≤ 2147483647; [eva] Recording results for call [eva] Done for function call [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function call [from] Done for function call [pdg] done for function main [pdg] PDG for main {n1}: InCtrl {n2}: VarDecl : a {n3}: VarDecl : b {n4}: VarDecl : c {n5}: int a = 0; -[-c-]-> 1 -[a--]-> 2 {n6}: int b = 1; -[-c-]-> 1 -[a--]-> 3 {n7}: int c = 3; -[-c-]-> 1 -[a--]-> 4 {n8}: Call39-InCtrl : a = call(a + b,b + c); -[-c-]-> 1 {n9}: Call39-In1 : a = call(a + b,b + c); -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 5 -[--d]-> 6 -[-c-]-> 8 {n10}: Call39-In2 : a = call(a + b,b + c); -[-c-]-> 1 -[--d]-> 3 -[--d]-> 4 -[--d]-> 6 -[--d]-> 7 -[-c-]-> 8 {n11}: Call39-Out(G) : a = call(a + b,b + c); -[-c-]-> 1 -[-c-]-> 8 -[--d]-> 10 -[--d]-> 15 {n12}: Call39-OutRet : a = call(a + b,b + c); -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 8 -[--d]-> 9 {n13}: return a; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 12 {n14}: OutRet -[--d]-> 13 {n15}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/simple_call.1.res.oracle0000666000000000000000000000640013571573400020776 0ustar [kernel] Parsing tests/pdg/simple_call.c (with preprocessing) [eva] Analyzing a complete application starting at call_in_loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] G1 ∈ [--..--] G2 ∈ [--..--] S ∈ [--..--] [eva] computing for function call <- call_in_loop. Called from tests/pdg/simple_call.c:52. [eva:alarm] tests/pdg/simple_call.c:45: Warning: signed overflow. assert G + y ≤ 2147483647; [eva] Recording results for call [eva] Done for function call [eva] tests/pdg/simple_call.c:51: starting to merge loop iterations [eva] computing for function call <- call_in_loop. Called from tests/pdg/simple_call.c:52. [eva] Recording results for call [eva] Done for function call [eva] computing for function call <- call_in_loop. Called from tests/pdg/simple_call.c:52. [eva] Recording results for call [eva] Done for function call [eva] computing for function call <- call_in_loop. Called from tests/pdg/simple_call.c:52. [eva] Recording results for call [eva] Done for function call [eva:alarm] tests/pdg/simple_call.c:52: Warning: signed overflow. assert a + tmp ≤ 2147483647; (tmp from call(i, c)) [eva] tests/pdg/simple_call.c:52: Reusing old results for call to call [eva] Recording results for call_in_loop [eva] done for function call_in_loop [pdg] computing for function call_in_loop [from] Computing for function call [from] Done for function call [pdg] done for function call_in_loop [pdg] PDG for call_in_loop {n1}: InCtrl {n2}: VarDecl : c -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : i {n5}: VarDecl : a {n6}: VarDecl : tmp {n7}: int a = 0; -[-c-]-> 1 -[a--]-> 5 {n8}: i = 0; -[-c-]-> 1 -[a--]-> 4 {n9}: while(1) -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 19 {n10}: i < G -[-c-]-> 1 -[--d]-> 4 -[--d]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d](G)-> 15 -[--d]-> 18 -[-c-]-> 19 -[--d]-> 22 {n11}: unspecified sequence -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 19 {n12}: Call30-InCtrl : tmp = call(i,c); -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 19 {n13}: Call30-In1 : tmp = call(i,c); -[-c-]-> 1 -[--d]-> 4 -[--d]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[--d]-> 18 -[-c-]-> 19 {n14}: Call30-In2 : tmp = call(i,c); -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[-c-]-> 19 {n15}: Call30-Out(G) : tmp = call(i,c); -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[--d]-> 14 -[--d](G)-> 15 -[-c-]-> 19 -[--d]-> 22 {n16}: Call30-OutRet : tmp = call(i,c); -[-c-]-> 1 -[a--]-> 6 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 11 -[-c-]-> 12 -[--d]-> 13 -[-c-]-> 19 {n17}: a += tmp; -[-c-]-> 1 -[a-d]-> 5 -[--d]-> 6 -[--d]-> 7 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 11 -[--d]-> 16 -[--d]-> 17 -[-c-]-> 19 {n18}: i ++; -[-c-]-> 1 -[a-d]-> 4 -[--d]-> 8 -[-c-]-> 9 -[-c-]-> 10 -[--d]-> 18 -[-c-]-> 19 {n19}: break; -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 19 {n20}: return a; -[-c-]-> 1 -[--d]-> 5 -[--d]-> 7 -[--d]-> 17 {n21}: OutRet -[--d]-> 20 {n22}: In(G) frama-c-20.0-Calcium/tests/pdg/oracle/simple_call.2.res.oracle0000666000000000000000000000310613571573400020777 0ustar [kernel] Parsing tests/pdg/simple_call.c (with preprocessing) [eva] Analyzing a complete application starting at call_mix_G1_G2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] G1 ∈ [--..--] G2 ∈ [--..--] S ∈ [--..--] [eva] computing for function mix_G1_G2 <- call_mix_G1_G2. Called from tests/pdg/simple_call.c:28. [eva] Recording results for mix_G1_G2 [eva] Done for function mix_G1_G2 [eva:alarm] tests/pdg/simple_call.c:31: Warning: signed overflow. assert -2147483648 ≤ x1 + x2; [eva:alarm] tests/pdg/simple_call.c:31: Warning: signed overflow. assert x1 + x2 ≤ 2147483647; [eva] Recording results for call_mix_G1_G2 [eva] done for function call_mix_G1_G2 [pdg] computing for function call_mix_G1_G2 [from] Computing for function mix_G1_G2 [from] Done for function mix_G1_G2 [pdg] done for function call_mix_G1_G2 [pdg] PDG for call_mix_G1_G2 {n1}: InCtrl {n2}: VarDecl : x1 {n3}: VarDecl : x2 {n4}: VarDecl : __retres {n5}: Call6-InCtrl : mix_G1_G2(); -[-c-]-> 1 {n6}: Call6-Out(G1) : mix_G1_G2(); -[-c-]-> 1 -[-c-]-> 5 -[--d]-> 14 {n7}: Call6-Out(G2) : mix_G1_G2(); -[-c-]-> 1 -[-c-]-> 5 -[--d]-> 13 {n8}: x1 = G1; -[-c-]-> 1 -[a--]-> 2 -[--d](G1)-> 6 {n9}: x2 = G2; -[-c-]-> 1 -[a--]-> 3 -[--d](G2)-> 7 {n10}: __retres = x1 + x2; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[a--]-> 4 -[--d]-> 8 -[--d]-> 9 {n11}: return __retres; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 10 {n12}: OutRet -[--d]-> 11 {n13}: In(G1) {n14}: In(G2) frama-c-20.0-Calcium/tests/pdg/oracle/simple_call.3.res.oracle0000666000000000000000000000305513571573400021003 0ustar [kernel] Parsing tests/pdg/simple_call.c (with preprocessing) [eva] Analyzing a complete application starting at call_multiple_global_outputs [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] G1 ∈ [--..--] G2 ∈ [--..--] S ∈ [--..--] [eva] computing for function multiple_global_outputs <- call_multiple_global_outputs. Called from tests/pdg/simple_call.c:39. [eva] Recording results for multiple_global_outputs [eva] Done for function multiple_global_outputs [eva] Recording results for call_multiple_global_outputs [eva] done for function call_multiple_global_outputs [pdg] computing for function call_multiple_global_outputs [from] Computing for function multiple_global_outputs [from] Done for function multiple_global_outputs [pdg] done for function call_multiple_global_outputs [pdg] PDG for call_multiple_global_outputs {n1}: InCtrl {n2}: VarDecl : x -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : y -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: Call16-InCtrl : multiple_global_outputs(x,y); -[-c-]-> 1 {n7}: Call16-In1 : multiple_global_outputs(x,y); -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[-c-]-> 6 {n8}: Call16-In2 : multiple_global_outputs(x,y); -[-c-]-> 1 -[--d]-> 4 -[--d]-> 5 -[-c-]-> 6 {n9}: Call16-Out(G) : multiple_global_outputs(x,y); -[-c-]-> 1 -[-c-]-> 6 -[--d]-> 8 {n10}: Call16-Out(S.a) : multiple_global_outputs(x,y); -[-c-]-> 1 -[-c-]-> 6 -[--d]-> 7 {n11}: return; -[-c-]-> 1 frama-c-20.0-Calcium/tests/pdg/oracle/simple_intra_slice.res.oracle0000666000000000000000000004363613571573400022234 0ustar [kernel] Parsing tests/pdg/simple_intra_slice.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Unknown ∈ {0} G ∈ {0} S ∈ {0} S1 ∈ {0} S2 ∈ {0} [eva:alarm] tests/pdg/simple_intra_slice.c:99: Warning: signed overflow. assert -2147483648 ≤ uninit - 1; [eva] tests/pdg/simple_intra_slice.c:98: starting to merge loop iterations [eva:alarm] tests/pdg/simple_intra_slice.c:99: Warning: signed overflow. assert Unknown + 1 ≤ 2147483647; [eva:alarm] tests/pdg/simple_intra_slice.c:99: Warning: signed overflow. assert -2147483648 ≤ Unknown - 1; [eva:alarm] tests/pdg/simple_intra_slice.c:101: Warning: signed overflow. assert -2147483648 ≤ uninit2 - 1; [eva] tests/pdg/simple_intra_slice.c:100: starting to merge loop iterations [eva:alarm] tests/pdg/simple_intra_slice.c:101: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva:alarm] tests/pdg/simple_intra_slice.c:101: Warning: signed overflow. assert -2147483648 ≤ S.a - 1; [eva] computing for function f2 <- main. Called from tests/pdg/simple_intra_slice.c:103. [eva] computing for function f1 <- f2 <- main. Called from tests/pdg/simple_intra_slice.c:23. [eva] Recording results for f1 [eva] Done for function f1 [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/pdg/simple_intra_slice.c:104. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/pdg/simple_intra_slice.c:105. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/pdg/simple_intra_slice.c:106. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/pdg/simple_intra_slice.c:107. [eva:alarm] tests/pdg/simple_intra_slice.c:71: Warning: signed overflow. assert -2147483648 ≤ 10 * n; [eva:alarm] tests/pdg/simple_intra_slice.c:71: Warning: signed overflow. assert 10 * n ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva:alarm] tests/pdg/simple_intra_slice.c:107: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from f6(Unknown)) [eva] computing for function f7 <- main. Called from tests/pdg/simple_intra_slice.c:108. [eva:alarm] tests/pdg/simple_intra_slice.c:79: Warning: signed overflow. assert S.a + 3 ≤ 2147483647; [eva:alarm] tests/pdg/simple_intra_slice.c:82: Warning: signed overflow. assert s0.a + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/pdg/simple_intra_slice.c:110. [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f8 <- main. Called from tests/pdg/simple_intra_slice.c:112. [eva] Recording results for f8 [eva] Done for function f8 [eva] Recording results for main [eva] done for function main [pdg] computing for function f1 [pdg] done for function f1 [pdg] computing for function f2 [from] Computing for function f1 [from] Done for function f1 [pdg] done for function f2 [pdg] computing for function f3 [pdg] done for function f3 [pdg] computing for function f4 [pdg] done for function f4 [pdg] computing for function f5 [pdg] done for function f5 [pdg] computing for function f6 [pdg] done for function f6 [pdg] computing for function f7 [pdg] done for function f7 [pdg] computing for function f8 [pdg] done for function f8 [pdg] computing for function main [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for f1 {n1}: InCtrl {n2}: VarDecl : x -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : y -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: VarDecl : a {n7}: VarDecl : b {n8}: VarDecl : __retres {n9}: int a = 1; -[-c-]-> 1 -[a--]-> 6 {n10}: int b = 2; -[-c-]-> 1 -[a--]-> 7 {n11}: G = x + a; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 6 -[--d]-> 9 {n12}: __retres = y + b; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 5 -[--d]-> 7 -[a--]-> 8 -[--d]-> 10 {n13}: return __retres; -[-c-]-> 1 -[--d]-> 8 -[--d]-> 12 {n14}: OutRet -[--d]-> 13 [pdg] PDG for f2 {n15}: InCtrl {n16}: VarDecl : a {n17}: VarDecl : b {n18}: VarDecl : c {n19}: VarDecl : tmp {n20}: int a = 1; -[-c-]-> 15 -[a--]-> 16 {n21}: int b = a + 1; -[-c-]-> 15 -[--d]-> 16 -[a--]-> 17 -[--d]-> 20 {n22}: int c = 3; -[-c-]-> 15 -[a--]-> 18 {n23}: Call10-InCtrl : tmp = f1(b,c); -[-c-]-> 15 {n24}: Call10-In1 : tmp = f1(b,c); -[-c-]-> 15 -[--d]-> 17 -[--d]-> 21 -[-c-]-> 23 {n25}: Call10-In2 : tmp = f1(b,c); -[-c-]-> 15 -[--d]-> 18 -[--d]-> 22 -[-c-]-> 23 {n26}: Call10-Out(G) : tmp = f1(b,c); -[-c-]-> 15 -[-c-]-> 23 -[--d]-> 24 {n27}: Call10-OutRet : tmp = f1(b,c); -[-c-]-> 15 -[a--]-> 19 -[-c-]-> 23 -[--d]-> 25 {n28}: return tmp; -[-c-]-> 15 -[--d]-> 19 -[--d]-> 27 {n29}: OutRet -[--d]-> 28 [pdg] PDG for f3 {n30}: InCtrl {n31}: VarDecl : c -[a--]-> 32 {n32}: In1 -[a--]-> 31 {n33}: VarDecl : a {n34}: VarDecl : b {n35}: VarDecl : x {n36}: int a = 1; -[-c-]-> 30 -[a--]-> 33 {n37}: int b = 2; -[-c-]-> 30 -[a--]-> 34 {n38}: int x = 0; -[-c-]-> 30 -[a--]-> 35 {n39}: c > Unknown -[-c-]-> 30 -[--d]-> 31 -[--d]-> 32 -[--d]-> 44 {n40}: x = b; -[-c-]-> 30 -[--d]-> 34 -[a--]-> 35 -[--d]-> 37 -[-c-]-> 39 {n41}: G = a; -[-c-]-> 30 -[--d]-> 33 -[--d]-> 36 -[-c-]-> 39 {n42}: return x; -[-c-]-> 30 -[--d]-> 35 -[--d]-> 38 -[--d]-> 40 {n43}: OutRet -[--d]-> 42 {n44}: In(Unknown) [pdg] PDG for f4 {n45}: InCtrl {n46}: VarDecl : c -[a--]-> 47 {n47}: In1 -[a--]-> 46 {n48}: VarDecl : a {n49}: VarDecl : b {n50}: VarDecl : x {n51}: int a = 1; -[-c-]-> 45 -[a--]-> 48 {n52}: int b = 2; -[-c-]-> 45 -[a--]-> 49 {n53}: int x = 0; -[-c-]-> 45 -[a--]-> 50 {n54}: c > Unknown -[-c-]-> 45 -[--d]-> 46 -[--d]-> 47 -[--d]-> 59 {n55}: G = a; -[-c-]-> 45 -[--d]-> 48 -[--d]-> 51 -[-c-]-> 54 {n56}: x = b; -[-c-]-> 45 -[--d]-> 49 -[a--]-> 50 -[--d]-> 52 -[-c-]-> 54 {n57}: return x; -[-c-]-> 45 -[--d]-> 50 -[--d]-> 53 -[--d]-> 56 {n58}: OutRet -[--d]-> 57 {n59}: In(Unknown) [pdg] PDG for f5 {n60}: InCtrl {n61}: VarDecl : c -[a--]-> 62 {n62}: In1 -[a--]-> 61 {n63}: VarDecl : x {n64}: int x = 0; -[-c-]-> 60 -[a--]-> 63 {n65}: c > Unknown -[-c-]-> 60 -[--d]-> 61 -[--d]-> 62 -[--d]-> 78 {n66}: goto Lsuite; -[-c-]-> 60 -[-c-]-> 65 -[-c-]-> 67 {n67}: Lsuite: -[-c-]-> 60 {n68}: x ++; -[-c-]-> 60 -[a-d]-> 63 -[--d]-> 64 -[-c-]-> 65 -[-c-]-> 66 {n69}: Lsuite: ; -[-c-]-> 60 {n70}: c < Unknown -[-c-]-> 60 -[--d]-> 61 -[--d]-> 62 -[--d]-> 78 {n71}: goto L2; -[-c-]-> 60 -[-c-]-> 70 -[-c-]-> 72 {n72}: L2: -[-c-]-> 60 {n73}: G ++; -[-c-]-> 60 -[-c-]-> 70 -[-c-]-> 71 -[--d]-> 77 {n74}: L2: x ++; -[-c-]-> 60 -[a-d]-> 63 -[--d]-> 64 -[--d]-> 68 {n75}: return x; -[-c-]-> 60 -[--d]-> 63 -[--d]-> 74 {n76}: OutRet -[--d]-> 75 {n77}: In(G) {n78}: In(Unknown) [pdg] PDG for f6 {n79}: InCtrl {n80}: VarDecl : n -[a--]-> 81 {n81}: In1 -[a--]-> 80 {n82}: VarDecl : i {n83}: VarDecl : __retres {n84}: int i = 0; -[-c-]-> 79 -[a--]-> 82 {n85}: while(1) -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n86}: n < 10 -[-c-]-> 79 -[--d]-> 80 -[--d]-> 81 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[--d]-> 91 -[-c-]-> 93 -[-c-]-> 94 {n87}: block -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n88}: Unknown > 3 -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 -[--d]-> 105 {n89}: n % 2 -[-c-]-> 79 -[--d]-> 80 -[--d]-> 81 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[--d]-> 91 -[-c-]-> 93 -[-c-]-> 94 {n90}: continue; -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 89 -[-c-]-> 93 -[-c-]-> 94 {n91}: n ++; -[-c-]-> 79 -[a-d]-> 80 -[--d]-> 81 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 89 -[-c-]-> 90 -[--d]-> 91 -[-c-]-> 93 -[-c-]-> 94 {n92}: i = 1; -[-c-]-> 79 -[a--]-> 82 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n93}: break; -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n94}: break; -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n95}: i -[-c-]-> 79 -[--d]-> 82 -[--d]-> 84 -[--d]-> 92 {n96}: block -[-c-]-> 79 -[-c-]-> 95 {n97}: block -[-c-]-> 79 -[-c-]-> 95 {n98}: __retres = 0; -[-c-]-> 79 -[a--]-> 83 -[-c-]-> 95 -[-c-]-> 96 {n99}: __retres = 10 * n; -[-c-]-> 79 -[--d]-> 80 -[--d]-> 81 -[a--]-> 83 -[--d]-> 91 -[-c-]-> 95 -[-c-]-> 97 {n100}: goto return_label; -[-c-]-> 79 -[-c-]-> 95 -[-c-]-> 96 -[-c-]-> 101 {n101}: return_label: -[-c-]-> 79 {n102}: goto return_label; -[-c-]-> 79 -[-c-]-> 95 -[-c-]-> 97 -[-c-]-> 101 {n103}: return_label: return __retres; -[-c-]-> 79 -[--d]-> 83 -[--d]-> 98 -[--d]-> 99 {n104}: OutRet -[--d]-> 103 {n105}: In(Unknown) [pdg] PDG for f7 {n106}: InCtrl {n107}: VarDecl : s0 -[a--]-> 108 {n108}: In1 -[a--]-> 107 {n109}: VarDecl : x {n110}: int x = S.a; -[-c-]-> 106 -[a--]-> 109 -[--d]-> 116 {n111}: x > 0 -[-c-]-> 106 -[--d]-> 109 -[--d]-> 110 {n112}: S.a += 3; -[-c-]-> 106 -[-c-]-> 111 -[--d]-> 116 {n113}: (s0.a) ++; -[-c-]-> 106 -[a-d]-> 107 -[--d]-> 108 -[-c-]-> 111 {n114}: S = s0; -[-c-]-> 106 -[--d]-> 107 -[--d]-> 108 -[-c-]-> 111 -[--d]-> 113 {n115}: return; -[-c-]-> 106 {n116}: In(S.a) [pdg] PDG for f8 {n117}: InCtrl {n118}: VarDecl : ps -[a--]-> 119 {n119}: In1 -[a--]-> 118 {n120}: (ps->a) ++; -[-c-]-> 117 -[a-d]-> 118 -[a-d]-> 119 -[--d]-> 125 -[--d]-> 126 {n121}: (ps->b) ++; -[-c-]-> 117 -[a-d]-> 118 -[a-d]-> 119 -[--d]-> 123 -[--d]-> 124 {n122}: return; -[-c-]-> 117 {n123}: In(S1.b) {n124}: In(S2.b) {n125}: In(S1.a) {n126}: In(S2.a) [pdg] PDG for main {n127}: InCtrl {n128}: VarDecl : res {n129}: VarDecl : uninit {n130}: VarDecl : uninit2 {n131}: VarDecl : tmp {n132}: VarDecl : tmp_0 {n133}: VarDecl : tmp_1 {n134}: VarDecl : tmp_2 {n135}: VarDecl : tmp_3 {n136}: int res = 0; -[-c-]-> 127 -[a--]-> 128 {n137}: int volatile uninit = 0; -[-c-]-> 127 -[a--]-> 129 {n138}: int volatile uninit2 = 0; -[-c-]-> 127 -[a--]-> 130 {n139}: while(1) -[-c-]-> 127 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 {n140}: uninit -[-c-]-> 127 -[--d]-> 129 -[--d]-> 137 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 {n141}: uninit - 1 -[-c-]-> 127 -[--d]-> 129 -[--d]-> 137 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 {n142}: Unknown ++; -[-c-]-> 127 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 141 -[--d]-> 142 -[--d]-> 143 -[-c-]-> 144 -[--d]-> 202 {n143}: Unknown --; -[-c-]-> 127 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 141 -[--d]-> 142 -[--d]-> 143 -[-c-]-> 144 -[--d]-> 202 {n144}: break; -[-c-]-> 127 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 {n145}: while(1) -[-c-]-> 127 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 -[-c-]-> 145 -[-c-]-> 146 -[-c-]-> 150 {n146}: uninit2 -[-c-]-> 127 -[--d]-> 130 -[--d]-> 138 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 -[-c-]-> 145 -[-c-]-> 146 -[-c-]-> 150 {n147}: uninit2 - 1 -[-c-]-> 127 -[--d]-> 130 -[--d]-> 138 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 -[-c-]-> 145 -[-c-]-> 146 -[-c-]-> 150 {n148}: (S.a) ++; -[-c-]-> 127 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 -[-c-]-> 145 -[-c-]-> 146 -[-c-]-> 147 -[--d]-> 148 -[--d]-> 149 -[-c-]-> 150 -[--d]-> 203 {n149}: (S.a) --; -[-c-]-> 127 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 -[-c-]-> 145 -[-c-]-> 146 -[-c-]-> 147 -[--d]-> 148 -[--d]-> 149 -[-c-]-> 150 -[--d]-> 203 {n150}: break; -[-c-]-> 127 -[-c-]-> 139 -[-c-]-> 140 -[-c-]-> 144 -[-c-]-> 145 -[-c-]-> 146 -[-c-]-> 150 {n151}: unspecified sequence -[-c-]-> 127 {n152}: Call102-InCtrl : tmp = f2(); -[-c-]-> 127 -[-c-]-> 151 {n153}: Call102-Out(G) : tmp = f2(); -[-c-]-> 127 -[-c-]-> 151 -[-c-]-> 152 {n154}: Call102-OutRet : tmp = f2(); -[-c-]-> 127 -[a--]-> 131 -[-c-]-> 151 -[-c-]-> 152 {n155}: res += tmp; -[-c-]-> 127 -[a-d]-> 128 -[--d]-> 131 -[--d]-> 136 -[-c-]-> 151 -[--d]-> 154 {n156}: unspecified sequence -[-c-]-> 127 {n157}: Call105-InCtrl : tmp_0 = f3(1); -[-c-]-> 127 -[-c-]-> 156 {n158}: Call105-In1 : tmp_0 = f3(1); -[-c-]-> 127 -[-c-]-> 156 -[-c-]-> 157 {n159}: Call105-Out(G) : tmp_0 = f3(1); -[-c-]-> 127 -[--d]-> 142 -[--d]-> 143 -[-c-]-> 156 -[-c-]-> 157 -[--d]-> 158 -[--d]-> 202 {n160}: Call105-OutRet : tmp_0 = f3(1); -[-c-]-> 127 -[a--]-> 132 -[--d]-> 142 -[--d]-> 143 -[-c-]-> 156 -[-c-]-> 157 -[--d]-> 158 -[--d]-> 202 {n161}: res += tmp_0; -[-c-]-> 127 -[a-d]-> 128 -[--d]-> 132 -[--d]-> 155 -[-c-]-> 156 -[--d]-> 160 {n162}: unspecified sequence -[-c-]-> 127 {n163}: Call108-InCtrl : tmp_1 = f4(1); -[-c-]-> 127 -[-c-]-> 162 {n164}: Call108-In1 : tmp_1 = f4(1); -[-c-]-> 127 -[-c-]-> 162 -[-c-]-> 163 {n165}: Call108-Out(G) : tmp_1 = f4(1); -[-c-]-> 127 -[--d]-> 142 -[--d]-> 143 -[-c-]-> 162 -[-c-]-> 163 -[--d]-> 164 -[--d]-> 202 {n166}: Call108-OutRet : tmp_1 = f4(1); -[-c-]-> 127 -[a--]-> 133 -[--d]-> 142 -[--d]-> 143 -[-c-]-> 162 -[-c-]-> 163 -[--d]-> 164 -[--d]-> 202 {n167}: res += tmp_1; -[-c-]-> 127 -[a-d]-> 128 -[--d]-> 133 -[--d]-> 161 -[-c-]-> 162 -[--d]-> 166 {n168}: unspecified sequence -[-c-]-> 127 {n169}: Call111-InCtrl : tmp_2 = f5(1); -[-c-]-> 127 -[-c-]-> 168 {n170}: Call111-In1 : tmp_2 = f5(1); -[-c-]-> 127 -[-c-]-> 168 -[-c-]-> 169 {n171}: Call111-Out(G) : tmp_2 = f5(1); -[-c-]-> 127 -[--d]-> 142 -[--d]-> 143 -[--d](G)-> 153 -[--d](G)-> 159 -[--d](G)-> 165 -[-c-]-> 168 -[-c-]-> 169 -[--d]-> 170 -[--d]-> 202 {n172}: Call111-OutRet : tmp_2 = f5(1); -[-c-]-> 127 -[a--]-> 134 -[--d]-> 142 -[--d]-> 143 -[-c-]-> 168 -[-c-]-> 169 -[--d]-> 170 -[--d]-> 202 {n173}: res += tmp_2; -[-c-]-> 127 -[a-d]-> 128 -[--d]-> 134 -[--d]-> 167 -[-c-]-> 168 -[--d]-> 172 {n174}: unspecified sequence -[-c-]-> 127 {n175}: Call114-InCtrl : tmp_3 = f6(Unknown); -[-c-]-> 127 -[-c-]-> 174 {n176}: Call114-In1 : tmp_3 = f6(Unknown); -[-c-]-> 127 -[--d]-> 142 -[--d]-> 143 -[-c-]-> 174 -[-c-]-> 175 -[--d]-> 202 {n177}: Call114-OutRet : tmp_3 = f6(Unknown); -[-c-]-> 127 -[a--]-> 135 -[--d]-> 142 -[--d]-> 143 -[-c-]-> 174 -[-c-]-> 175 -[--d]-> 176 -[--d]-> 202 {n178}: res += tmp_3; -[-c-]-> 127 -[a-d]-> 128 -[--d]-> 135 -[--d]-> 173 -[-c-]-> 174 -[--d]-> 177 {n179}: Call116-InCtrl : f7(S); -[-c-]-> 127 {n180}: Call116-In1 : f7(S); -[-c-]-> 127 -[--d]-> 148 -[--d]-> 149 -[-c-]-> 179 -[--d]-> 204 {n181}: Call116-Out(S.a) : f7(S); -[-c-]-> 127 -[--d]-> 148 -[--d]-> 149 -[-c-]-> 179 -[--d]-> 180 -[--d]-> 203 {n182}: Call116-Out(S{.b; .c}) : f7(S); -[-c-]-> 127 -[--d]-> 148 -[--d]-> 149 -[-c-]-> 179 -[--d]-> 180 -[--d]-> 203 {n183}: Unknown -[-c-]-> 127 -[--d]-> 142 -[--d]-> 143 -[--d]-> 202 {n184}: Call119-InCtrl : f8(& S1); -[-c-]-> 127 -[-c-]-> 183 {n185}: Call119-In1 : f8(& S1); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 184 {n186}: Call119-Out(S1.a) : f8(& S1); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 184 -[--d]-> 185 -[--d]-> 200 -[--d]-> 201 {n187}: Call119-Out(S1.b) : f8(& S1); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 184 -[--d]-> 185 -[--d]-> 198 -[--d]-> 199 {n188}: Call119-Out(S2.a) : f8(& S1); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 184 -[--d]-> 185 -[--d]-> 200 -[--d]-> 201 {n189}: Call119-Out(S2.b) : f8(& S1); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 184 -[--d]-> 185 -[--d]-> 198 -[--d]-> 199 {n190}: Call120-InCtrl : f8(& S2); -[-c-]-> 127 -[-c-]-> 183 {n191}: Call120-In1 : f8(& S2); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 190 {n192}: Call120-Out(S1.a) : f8(& S2); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 190 -[--d]-> 191 -[--d]-> 200 -[--d]-> 201 {n193}: Call120-Out(S1.b) : f8(& S2); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 190 -[--d]-> 191 -[--d]-> 198 -[--d]-> 199 {n194}: Call120-Out(S2.a) : f8(& S2); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 190 -[--d]-> 191 -[--d]-> 200 -[--d]-> 201 {n195}: Call120-Out(S2.b) : f8(& S2); -[-c-]-> 127 -[-c-]-> 183 -[-c-]-> 190 -[--d]-> 191 -[--d]-> 198 -[--d]-> 199 {n196}: return res; -[-c-]-> 127 -[--d]-> 128 -[--d]-> 178 {n197}: OutRet -[--d]-> 196 {n198}: In(S1.b) {n199}: In(S2.b) {n200}: In(S1.a) {n201}: In(S2.a) {n202}: In(Unknown) {n203}: In(S.a) {n204}: In(S) frama-c-20.0-Calcium/tests/pdg/oracle/top_pdg_input.res.oracle0000666000000000000000000002225613571573400021235 0ustar [kernel] Parsing tests/pdg/top_pdg_input.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] tab[0] ∈ {0} [1] ∈ {7} S ∈ {0} G ∈ {0} [eva] computing for function f1 <- main. Called from tests/pdg/top_pdg_input.c:38. [eva] computing for function no_results <- f1 <- main. Called from tests/pdg/top_pdg_input.c:13. [eva] Recording results for no_results [eva] Done for function no_results [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/top_pdg_input.c:39. [eva] computing for function no_results <- f2 <- main. Called from tests/pdg/top_pdg_input.c:20. [eva] Recording results for no_results [eva] Done for function no_results [eva] Recording results for f2 [eva] Done for function f2 [eva:alarm] tests/pdg/top_pdg_input.c:40: Warning: out of bounds read. assert \valid_read(p_str + i); [eva:alarm] tests/pdg/top_pdg_input.c:40: Warning: out of bounds read. assert \valid_read(p_str + 0); [eva] computing for function strlen <- main. Called from tests/pdg/top_pdg_input.c:40. [eva:alarm] tests/pdg/top_pdg_input.c:31: Warning: out of bounds read. assert \valid_read(q); [eva] tests/pdg/top_pdg_input.c:31: starting to merge loop iterations [eva:alarm] tests/pdg/top_pdg_input.c:31: Warning: signed overflow. assert k + 1 ≤ 2147483647; [eva] Recording results for strlen [eva] Done for function strlen [eva] Recording results for main [eva] done for function main [eva] tests/pdg/top_pdg_input.c:40: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f1: Cannot filter: dumping raw memory (including unchanged variables) nondet ∈ [--..--] tab[0] ∈ {0} [1] ∈ {7} S ∈ {0} G ∈ {1} i ∈ {1} v ∈ {1; 7} tmp_0 ∈ {1; 7} p_str ∈ {{ NULL ; &S_p_str[0] }} i ∈ UNINITIALIZED tmp_0 ∈ UNINITIALIZED tmp_1 ∈ UNINITIALIZED tmp_2 ∈ UNINITIALIZED S_p_str[0] ∈ {{ NULL ; &S_0_S_p_str[0] }} [1] ∈ {{ NULL ; &S_1_S_p_str[0] }} S_0_S_p_str[0..1] ∈ [--..--] S_1_S_p_str[0..1] ∈ [--..--] [eva:final-states] Values at end of function f2: Cannot filter: dumping raw memory (including unchanged variables) nondet ∈ [--..--] tab[0] ∈ {0} [1] ∈ {7} S.a ∈ {2} .t[0..4] ∈ {0} G ∈ {1} i ∈ {1} s.a ∈ {2} .t[0..4] ∈ {0} tmp_0 ∈ {0; 1} p_str ∈ {{ NULL ; &S_p_str[0] }} i ∈ {1; 7} tmp_0 ∈ UNINITIALIZED tmp_1 ∈ UNINITIALIZED tmp_2 ∈ UNINITIALIZED __retres ∈ {2; 3} S_p_str[0] ∈ {{ NULL ; &S_0_S_p_str[0] }} [1] ∈ {{ NULL ; &S_1_S_p_str[0] }} S_0_S_p_str[0..1] ∈ [--..--] S_1_S_p_str[0..1] ∈ [--..--] [eva:final-states] Values at end of function strlen: q ∈ {{ &S_0_S_p_str{[0], [1]} }} k ∈ [0..2147483647] [eva:final-states] Values at end of function main: Cannot filter: dumping raw memory (including unchanged variables) nondet ∈ [--..--] tab[0] ∈ {0} [1] ∈ {7} S.a ∈ {2} .t[0..4] ∈ {0} G ∈ {1} p_str ∈ {{ &S_p_str[0] }} i ∈ {3; 4; 9; 10} tmp_0 ∈ {2; 3} tmp_1 ∈ {{ NULL ; &S_0_S_p_str[0] }} tmp_2 ∈ [0..2147483647] S_p_str[0] ∈ {{ NULL ; &S_0_S_p_str[0] }} [1] ∈ {{ NULL ; &S_1_S_p_str[0] }} S_0_S_p_str[0..1] ∈ [--..--] S_1_S_p_str[0..1] ∈ [--..--] [from] Computing for function no_results [from] Done for function no_results [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function strlen [from] Done for function strlen [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function no_results: FROMTOP \result FROM ANYTHING(origin:Unknown) [from] Function f1: FROMTOP \result FROM ANYTHING(origin:Unknown) [from] Function f2: FROMTOP \result FROM ANYTHING(origin:Unknown) [from] Function strlen: \result FROM p; S_0_S_p_str[0..1] [from] Function main: FROMTOP \result FROM ANYTHING(origin:Unknown) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function no_results: __retres [inout] Inputs for function no_results: \nothing [inout] Out (internal) for function f1: ANYTHING(origin:Unknown) [inout] Inputs for function f1: nondet; tab[1]; G [inout] Out (internal) for function f2: ANYTHING(origin:Unknown) [inout] Inputs for function f2: nondet; S [inout] Out (internal) for function strlen: q; k [inout] Inputs for function strlen: S_0_S_p_str[0..1] [inout] Out (internal) for function main: ANYTHING(origin:Unknown) [inout] Inputs for function main: nondet; tab[1]; S; G; S_p_str[0]; S_0_S_p_str[0..1] [pdg] computing for function no_results [pdg] Top for function no_results [pdg] computing for function f1 [pdg] Warning: too imprecise value analysis : abort [pdg] Top for function f1 [pdg] computing for function f2 [pdg] Warning: too imprecise value analysis : abort [pdg] Top for function f2 [pdg] computing for function strlen [pdg] done for function strlen [pdg] computing for function main [pdg] Warning: too imprecise value analysis : abort [pdg] Top for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for no_results Top PDG [pdg] PDG for f1 Top PDG [pdg] PDG for f2 Top PDG [pdg] PDG for strlen {n19}: InCtrl {n20}: VarDecl : p -[a--]-> 21 {n21}: In1 -[a--]-> 20 {n22}: VarDecl : q {n23}: VarDecl : k {n24}: int k = 0; -[-c-]-> 19 -[a--]-> 23 {n25}: q = p; -[-c-]-> 19 -[--d]-> 20 -[--d]-> 21 -[a--]-> 22 {n26}: while(1) -[-c-]-> 19 -[-c-]-> 26 -[-c-]-> 27 -[-c-]-> 30 {n27}: *q -[-c-]-> 19 -[--d]-> 22 -[--d]-> 25 -[-c-]-> 26 -[-c-]-> 27 -[--d]-> 29 -[-c-]-> 30 -[--d]-> 33 {n28}: k ++; -[-c-]-> 19 -[a-d]-> 23 -[--d]-> 24 -[-c-]-> 26 -[-c-]-> 27 -[--d]-> 28 -[-c-]-> 30 {n29}: q ++; -[-c-]-> 19 -[a-d]-> 22 -[--d]-> 25 -[-c-]-> 26 -[-c-]-> 27 -[--d]-> 29 -[-c-]-> 30 {n30}: break; -[-c-]-> 19 -[-c-]-> 26 -[-c-]-> 27 -[-c-]-> 30 {n31}: return k; -[-c-]-> 19 -[--d]-> 23 -[--d]-> 24 -[--d]-> 28 {n32}: OutRet -[--d]-> 31 {n33}: In(S_0_S_p_str[0..1]) [pdg] PDG for main Top PDG [eva] Analyzing a complete application starting at main_asm [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] tab[0] ∈ {0} [1] ∈ {7} S ∈ {0} G ∈ {0} [eva] computing for function fun_asm <- main_asm. Called from tests/pdg/top_pdg_input.c:51. [eva] tests/pdg/top_pdg_input.c:45: Warning: assuming assembly code has no effects in function fun_asm [eva] Recording results for fun_asm [eva] Done for function fun_asm [eva] Recording results for main_asm [eva] done for function main_asm [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fun_asm: __retres ∈ {4} [eva:final-states] Values at end of function main_asm: j ∈ {3} [from] Computing for function fun_asm [from] Done for function fun_asm [from] Computing for function main_asm [from] Done for function main_asm [from] Computing for function no_results [from] Done for function no_results [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function fun_asm: \result FROM i [from] Function main_asm: \result FROM \nothing [from] Function no_results: FROMTOP \result FROM ANYTHING(origin:Unknown) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function fun_asm: __retres [inout] Inputs for function fun_asm: \nothing [inout] Out (internal) for function main_asm: j; tmp [inout] Inputs for function main_asm: \nothing [inout] Out (internal) for function no_results: __retres [inout] Inputs for function no_results: \nothing [pdg] computing for function fun_asm [pdg] tests/pdg/top_pdg_input.c:45: Warning: Ignoring inline assembly code [pdg] done for function fun_asm [pdg] computing for function main_asm [pdg] done for function main_asm [pdg] computing for function no_results [pdg] Top for function no_results [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for fun_asm {n47}: InCtrl {n48}: VarDecl : i -[a--]-> 49 {n49}: In1 -[a--]-> 48 {n50}: VarDecl : __retres {n51}: __asm__ ("BLA"); -[-c-]-> 47 {n52}: __retres = i + 1; -[-c-]-> 47 -[--d]-> 48 -[--d]-> 49 -[a--]-> 50 {n53}: return __retres; -[-c-]-> 47 -[--d]-> 50 -[--d]-> 52 {n54}: OutRet -[--d]-> 53 [pdg] PDG for main_asm {n55}: InCtrl {n56}: VarDecl : j {n57}: VarDecl : tmp {n58}: int j = 3; -[-c-]-> 55 -[a--]-> 56 {n59}: Call53-InCtrl : tmp = fun_asm(j); -[-c-]-> 55 {n60}: Call53-In1 : tmp = fun_asm(j); -[-c-]-> 55 -[--d]-> 56 -[--d]-> 58 -[-c-]-> 59 {n61}: Call53-OutRet : tmp = fun_asm(j); -[-c-]-> 55 -[a--]-> 57 -[-c-]-> 59 -[--d]-> 60 {n62}: return tmp; -[-c-]-> 55 -[--d]-> 57 -[--d]-> 61 {n63}: OutRet -[--d]-> 62 [pdg] PDG for no_results Top PDG frama-c-20.0-Calcium/tests/pdg/oracle/variadic.res.oracle0000666000000000000000000001727113571573400020145 0ustar [kernel] Parsing tests/pdg/variadic.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/variadic.c:37. [eva] computing for function lib_f <- f1 <- main. Called from tests/pdg/variadic.c:23. [kernel:annot:missing-spec] tests/pdg/variadic.c:23: Warning: Neither code nor specification for function lib_f, generating default assigns from the prototype [eva] using specification for function lib_f [eva] Done for function lib_f [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:38. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/pdg/variadic.c:39. [eva] computing for function lib_f <- f3 <- main. Called from tests/pdg/variadic.c:31. [eva] Done for function lib_f [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:40. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] Recording results for main [eva] done for function main [pdg] computing for function lib_f [from] Computing for function lib_f [from] Done for function lib_f [pdg] done for function lib_f [pdg] computing for function f1 [pdg] done for function f1 [pdg] computing for function f2 [pdg] done for function f2 [pdg] computing for function f3 [pdg] done for function f3 [pdg] computing for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [pdg] done for function main [pdg] ====== PDG GRAPH COMPUTED ====== [pdg] PDG for lib_f {n1}: InCtrl {n2}: VarDecl : n -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : __va_params -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: OutRet -[--d]-> 3 [pdg] PDG for f1 {n7}: InCtrl {n8}: VarDecl : a -[a--]-> 9 {n9}: In1 -[a--]-> 8 {n10}: VarDecl : tmp {n11}: VarDecl : __va_arg0 {n12}: VarDecl : __va_args {n13}: block -[-c-]-> 7 {n14}: int __va_arg0 = a; -[-c-]-> 7 -[--d]-> 8 -[--d]-> 9 -[a--]-> 11 -[-c-]-> 13 {n15}: void *__va_args[1] = {& __va_arg0}; -[-c-]-> 7 -[--d]-> 11 -[a--]-> 12 -[-c-]-> 13 {n16}: Call44-InCtrl : tmp = lib_f(1,(void * const *)(__va_args)); -[-c-]-> 7 -[-c-]-> 13 {n17}: Call44-In1 : tmp = lib_f(1,(void * const *)(__va_args)); -[-c-]-> 7 -[-c-]-> 13 -[-c-]-> 16 {n18}: Call44-In2 : tmp = lib_f(1,(void * const *)(__va_args)); -[-c-]-> 7 -[--d]-> 12 -[-c-]-> 13 -[-c-]-> 16 {n19}: Call44-OutRet : tmp = lib_f(1,(void * const *)(__va_args)); -[-c-]-> 7 -[a--]-> 10 -[-c-]-> 13 -[-c-]-> 16 -[--d]-> 17 {n20}: return tmp; -[-c-]-> 7 -[--d]-> 10 -[--d]-> 19 {n21}: OutRet -[--d]-> 20 [pdg] PDG for f2 {n22}: InCtrl {n23}: VarDecl : a -[a--]-> 24 {n24}: In1 -[a--]-> 23 {n25}: VarDecl : b -[a--]-> 26 {n26}: In2 -[a--]-> 25 {n27}: VarDecl : tmp {n28}: VarDecl : __va_arg0 {n29}: VarDecl : __va_arg1 {n30}: VarDecl : __va_args {n31}: block -[-c-]-> 22 {n32}: int __va_arg0 = a; -[-c-]-> 22 -[--d]-> 23 -[--d]-> 24 -[a--]-> 28 -[-c-]-> 31 {n33}: int __va_arg1 = b; -[-c-]-> 22 -[--d]-> 25 -[--d]-> 26 -[a--]-> 29 -[-c-]-> 31 {n34}: void *__va_args[2] = {& __va_arg0, & __va_arg1}; -[-c-]-> 22 -[--d]-> 28 -[--d]-> 29 -[a--]-> 30 -[-c-]-> 31 {n35}: Call49-InCtrl : tmp = lib_f(2,(void * const *)(__va_args)); -[-c-]-> 22 -[-c-]-> 31 {n36}: Call49-In1 : tmp = lib_f(2,(void * const *)(__va_args)); -[-c-]-> 22 -[-c-]-> 31 -[-c-]-> 35 {n37}: Call49-In2 : tmp = lib_f(2,(void * const *)(__va_args)); -[-c-]-> 22 -[--d]-> 30 -[-c-]-> 31 -[-c-]-> 35 {n38}: Call49-OutRet : tmp = lib_f(2,(void * const *)(__va_args)); -[-c-]-> 22 -[a--]-> 27 -[-c-]-> 31 -[-c-]-> 35 -[--d]-> 36 {n39}: return tmp; -[-c-]-> 22 -[--d]-> 27 -[--d]-> 38 {n40}: OutRet -[--d]-> 39 [pdg] PDG for f3 {n41}: InCtrl {n42}: VarDecl : a -[a--]-> 43 {n43}: In1 -[a--]-> 42 {n44}: VarDecl : b -[a--]-> 45 {n45}: In2 -[a--]-> 44 {n46}: VarDecl : c -[a--]-> 47 {n47}: In3 -[a--]-> 46 {n48}: VarDecl : tmp {n49}: VarDecl : __va_arg0 {n50}: VarDecl : __va_arg1 {n51}: VarDecl : __va_arg2 {n52}: VarDecl : __va_args {n53}: block -[-c-]-> 41 {n54}: int __va_arg0 = a; -[-c-]-> 41 -[--d]-> 42 -[--d]-> 43 -[a--]-> 49 -[-c-]-> 53 {n55}: int __va_arg1 = b; -[-c-]-> 41 -[--d]-> 44 -[--d]-> 45 -[a--]-> 50 -[-c-]-> 53 {n56}: int __va_arg2 = c; -[-c-]-> 41 -[--d]-> 46 -[--d]-> 47 -[a--]-> 51 -[-c-]-> 53 {n57}: void *__va_args[3] = {& __va_arg0, & __va_arg1, & __va_arg2}; -[-c-]-> 41 -[--d]-> 49 -[--d]-> 50 -[--d]-> 51 -[a--]-> 52 -[-c-]-> 53 {n58}: Call55-InCtrl : tmp = lib_f(3,(void * const *)(__va_args)); -[-c-]-> 41 -[-c-]-> 53 {n59}: Call55-In1 : tmp = lib_f(3,(void * const *)(__va_args)); -[-c-]-> 41 -[-c-]-> 53 -[-c-]-> 58 {n60}: Call55-In2 : tmp = lib_f(3,(void * const *)(__va_args)); -[-c-]-> 41 -[--d]-> 52 -[-c-]-> 53 -[-c-]-> 58 {n61}: Call55-OutRet : tmp = lib_f(3,(void * const *)(__va_args)); -[-c-]-> 41 -[a--]-> 48 -[-c-]-> 53 -[-c-]-> 58 -[--d]-> 59 {n62}: return tmp; -[-c-]-> 41 -[--d]-> 48 -[--d]-> 61 {n63}: OutRet -[--d]-> 62 [pdg] PDG for main {n64}: InCtrl {n65}: VarDecl : a1 {n66}: VarDecl : a2 {n67}: VarDecl : a3 {n68}: VarDecl : a4 {n69}: VarDecl : a5 {n70}: VarDecl : a6 {n71}: VarDecl : s {n72}: VarDecl : s1 {n73}: VarDecl : s2 {n74}: VarDecl : s3 {n75}: int a1 = 1; -[-c-]-> 64 -[a--]-> 65 {n76}: int a2 = 2; -[-c-]-> 64 -[a--]-> 66 {n77}: int a3 = 3; -[-c-]-> 64 -[a--]-> 67 {n78}: int a4 = 4; -[-c-]-> 64 -[a--]-> 68 {n79}: int a5 = 5; -[-c-]-> 64 -[a--]-> 69 {n80}: int a6 = 6; -[-c-]-> 64 -[a--]-> 70 {n81}: Call32-InCtrl : s1 = f1(a1); -[-c-]-> 64 {n82}: Call32-In1 : s1 = f1(a1); -[-c-]-> 64 -[--d]-> 65 -[--d]-> 75 -[-c-]-> 81 {n83}: Call32-OutRet : s1 = f1(a1); -[-c-]-> 64 -[a--]-> 72 -[-c-]-> 81 {n84}: Call33-InCtrl : s2 = f2(a2,a3); -[-c-]-> 64 {n85}: Call33-In1 : s2 = f2(a2,a3); -[-c-]-> 64 -[--d]-> 66 -[--d]-> 76 -[-c-]-> 84 {n86}: Call33-In2 : s2 = f2(a2,a3); -[-c-]-> 64 -[--d]-> 67 -[--d]-> 77 -[-c-]-> 84 {n87}: Call33-OutRet : s2 = f2(a2,a3); -[-c-]-> 64 -[a--]-> 73 -[-c-]-> 84 {n88}: Call34-InCtrl : s3 = f3(a4,a5,a6); -[-c-]-> 64 {n89}: Call34-In1 : s3 = f3(a4,a5,a6); -[-c-]-> 64 -[--d]-> 68 -[--d]-> 78 -[-c-]-> 88 {n90}: Call34-In2 : s3 = f3(a4,a5,a6); -[-c-]-> 64 -[--d]-> 69 -[--d]-> 79 -[-c-]-> 88 {n91}: Call34-In3 : s3 = f3(a4,a5,a6); -[-c-]-> 64 -[--d]-> 70 -[--d]-> 80 -[-c-]-> 88 {n92}: Call34-OutRet : s3 = f3(a4,a5,a6); -[-c-]-> 64 -[a--]-> 74 -[-c-]-> 88 {n93}: Call35-InCtrl : s = f2(s1,s2); -[-c-]-> 64 {n94}: Call35-In1 : s = f2(s1,s2); -[-c-]-> 64 -[--d]-> 72 -[--d]-> 83 -[-c-]-> 93 {n95}: Call35-In2 : s = f2(s1,s2); -[-c-]-> 64 -[--d]-> 73 -[--d]-> 87 -[-c-]-> 93 {n96}: Call35-OutRet : s = f2(s1,s2); -[-c-]-> 64 -[a--]-> 71 -[-c-]-> 93 {n97}: return s; -[-c-]-> 64 -[--d]-> 71 -[--d]-> 96 {n98}: OutRet -[--d]-> 97 frama-c-20.0-Calcium/tests/pdg/pb_infinite_loop.c0000666000000000000000000000176713571573400016625 0ustar /* run.config GCC: STDOPT: +"-main test_infinite_loop -fct-pdg test_infinite_loop " STDOPT: +"-main test_infinite_loop_2 -fct-pdg test_infinite_loop_2 " STDOPT: +"-main test_exit -fct-pdg test_exit " */ /* This test is a problem at the moment because the postdominators are Top for the points from which there is no path to the exit. It means that we cannot compute the control dependencies in the infinite loops... */ extern int G; int test_infinite_loop (void) { if (G < 0) { int i = 0; while (1) { if (i % 2) G++; i++; } G = G/2; /* dead code */ } return G; } int test_infinite_loop_2 (void) { int i = 0; while (1) { if (i % 2) G++; i++; } return G; /* dead code */ } /* At the moment, there is no special things done for exit, * As it is seen like a normal call to an external function : no problem... */ void exit (int x); int test_exit (int c) { if (c) return 1; else { exit (1); return 0; } } frama-c-20.0-Calcium/tests/pdg/postdom.c0000666000000000000000000000066713571573400014771 0ustar /* run.config STDOPT: +"-pdg" */ /* This example used to loop during the computation of control dependencies, more precisely "generalized postdominators". See bts 1436 */ void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: goto ERROR; } return; } int main(unsigned int loop1, unsigned int m1) { int sn=0; unsigned int x=0; while(1){ sn = sn + 2; x++; __VERIFIER_assert(sn==x*2 || sn == 0); } } frama-c-20.0-Calcium/tests/pdg/sets.c0000666000000000000000000000072513571573400014255 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs STDOPT: +"-load-module @PTEST_DIR@/@PTEST_NAME@ -lib-entry -main f -pdg -inout " */ int b, c, x, y, z, t; void f(int a) { y = 0; // 1, node 9 if (a) y = 1; // 2 puis 3, (y = 1: node 11) z = y; // 5 y++; // 6 (node 14) x = z; // 8 b = a; // 9 t = b + y; // 11 y = 5; // 12 c = 8; // shouldn't have any relation with node 14... } frama-c-20.0-Calcium/tests/pdg/sets.ml0000666000000000000000000000404513571573400014442 0ustar open Db;; open Cil_types;; let pp_nodes msg nodes = Kernel.result "%s" msg ; List.iter (fun n -> Kernel.result "%a" (!Pdg.pretty_node false) n) nodes;; exception Find of varinfo;; let main _ = let f = Globals.Functions.find_by_name "f" in let pdg = !Pdg.get f in (* Uncomment to retrieve sid *) (*Kernel.Debug.set 1;; Format.eprintf "@[%a@]@." Printer.pp_global (Kernel_function.get_global f);; *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let stmt_1 = fst (Kernel_function.find_from_sid 1) in (* y = 0 *) let node = !Pdg.find_stmt_node pdg stmt_1 in let nodes = !Pdg.all_uses pdg [node] in pp_nodes "Test [all_uses] stmt1" nodes; (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let y = try Globals.Vars.iter (fun v _ -> if v.vname = "y" then raise (Find v)); assert false with Find v -> v in let y_zone = Locations.(enumerate_valid_bits Read (loc_of_varinfo y)) in let y_at_11_nodes, undef = (* y=5 *) !Pdg.find_location_nodes_at_stmt pdg (fst (Kernel_function.find_from_sid 11)) ~before:false y_zone in assert (undef = None); let y_at_11_nodes = List.map (fun (n,_z) -> n) y_at_11_nodes in let () = pp_nodes "Test [find_location_nodes_at_stmt] y@11" y_at_11_nodes in (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let nodes = !Pdg.all_dpds pdg y_at_11_nodes in let () = pp_nodes "Test [all_dpds] y@11" nodes in (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let nodes = !Pdg.all_uses pdg y_at_11_nodes in let () = pp_nodes "Test [all_uses] y@11" nodes in (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let all_related_nodes pdg = let all n = (!Pdg.direct_uses pdg n) @ (!Pdg.direct_dpds pdg n) in !Pdg.custom_related_nodes all in let nodes = all_related_nodes pdg y_at_11_nodes in pp_nodes "Test [all_related_nodes] y@11" nodes (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/pdg/simple_call.c0000666000000000000000000000221413571573400015556 0ustar /* run.config GCC: STDOPT: +"-fct-pdg main " STDOPT: +"-main call_in_loop -fct-pdg call_in_loop " STDOPT: +"-main call_mix_G1_G2 -fct-pdg call_mix_G1_G2 " STDOPT: +"-main call_multiple_global_outputs -fct-pdg call_multiple_global_outputs " */ extern int G, G1, G2; typedef struct { int a; int b; } Tstr; extern Tstr S, S1, S2; /*----------------------------------------------*/ /* check if we don't mix up inputs and outputs */ void mix_G1_G2 (void) { int tmp = G1; G1 = G2; G2 = tmp; } int call_mix_G1_G2 (void) { int x1, x2; mix_G1_G2 (); x1 = G1; x2 = G2; return x1+x2; } /*----------------------------------------------*/ void multiple_global_outputs (int x, int y) { S.a = x; G = y; } void call_multiple_global_outputs (int x, int y) { multiple_global_outputs (x, y); } /*----------------------------------------------*/ int call (int x, int y) { G += y; return x; } int call_in_loop (int c) { int i, a = 0; for (i = 0; i < G; i++) a += call (i, c); return a; } int main (void) { int a = 0, b = 1, c = 3; a = call (a+b, b+c); return a; } /*----------------------------------------------*/ frama-c-20.0-Calcium/tests/pdg/simple_intra_slice.c0000666000000000000000000000331313571573400017140 0ustar /* run.config GCC: STDOPT: +"-pdg " */ /* test conçu initialement comme test pour le slicing */ int Unknown; int G; /* on sélectionne le return. on doit garder juste a (pas G et b) */ int f1 (int x, int y) { int a = 1, b = 2; G = x + a; return y + b; } /* on sélectionne le return. pas de réduction intreproc -> b doit être marqué Spare et recursivement a aussi. */ int f2 (void) { int a = 1, b = a+1, c = 3; return f1 (b, c); } /* avec un IF : sélection de la branche then */ int f3 (int c) { int a = 1, b = 2; int x = 0; if (c > Unknown) x = b; else G = a; return x; } /* avec un IF : sélection de la branche else */ int f4 (int c) { int a = 1, b = 2; int x = 0; if (c > Unknown) G = a; else x = b; return x; } int f5 (int c) { int x = 0; if (c > Unknown) goto Lsuite; x += 1; Lsuite : if (c < Unknown) goto L2; G++; L2 : x += 1; return x; } int f6 (int n) { int i = 0; while (n < 10) { if (Unknown > 3) { i = 1; break; } if (n%2) continue; n++; } if (i) return 0; else return 10*n; } typedef struct { int a; int b; int c; } Tstr; Tstr S, S1, S2; void f7 (Tstr s0) { int x = S.a; if (x > 0) { S.a += 3; } else { s0.a += 1; S = s0; } } void f8 (Tstr * ps) { ps->a ++; ps->b ++; } int main (void) { int res = 0; /* make Unknown really unknown */ volatile int uninit=0, uninit2=0 ; while(uninit) if (uninit-1) Unknown++; else Unknown--; while(uninit2) if (uninit2-1) S.a++; else S.a--; res += f2 (); res += f3 (1); res += f4 (1); res += f5 (1); res += f6 (Unknown); f7 (S); if (Unknown) f8 (&S1); else f8 (&S2); return res; } frama-c-20.0-Calcium/tests/pdg/test_config0000666000000000000000000000007613571573400015361 0ustar OPT: -journal-disable @EVA_OPTIONS@ -pdg-print -pdg-verbose 2 frama-c-20.0-Calcium/tests/pdg/top_pdg_input.c0000666000000000000000000000151713571573400016152 0ustar /* run.config STDOPT: +"-eva -pdg -out -input -deps -no-results-function no_results -eva-no-builtins-auto -load-module pdg -pdg -then -main main_asm" */ volatile int nondet; int no_results() {return 1;} int tab[2] = {0, 7}; typedef struct {int a; int t[5]; } Ts; Ts S; int G; int f1 (void) { int i = no_results(); /* InTop element of PDG */ int v = nondet ? tab[i] : i; G ++; return v; } int f2 (void) { int i = no_results(); /* InTop element of PDG */; Ts s; S.a = 2; s = S; return s.a + (nondet ? s.t[i] : i); } int strlen(char* p ) { char* q ; int k = 0; for (q = p; *q ; q++) k++ ; return k; } int main (char *p_str[]) { int i = f1 (); i += f2 (); return strlen (nondet ? p_str[i] : p_str[0]); } int fun_asm(i) { asm("BLA"); return i+1; } int main_asm () { int j = 3; return fun_asm(j); } frama-c-20.0-Calcium/tests/pdg/variadic.c0000666000000000000000000000137313571573400015061 0ustar /* run.config * STDOPT: +"-pdg " */ // __builtin_va_start and co do not appear in PDG output because Value forgets to register them in the table of called functions. This is a bug of Value #include int f (int n, ...) { va_list arg; int i, s = 0; va_start (arg, n); for (i = 0; i < n; i++) { int x = va_arg (arg, int); s += x; } va_end (arg); return s; } int lib_f (int n, ...); int f1 (int a) { return lib_f (1, a); } int f2 (int a, int b) { return lib_f (2, a, b); } int f3 (int a, int b, int c) { return lib_f (3, a, b, c); } int main (void) { int a1 = 1, a2 = 2, a3 = 3, a4 = 4, a5 = 5, a6 = 6; int s, s1, s2, s3; s1 = f1 (a1); s2 = f2 (a2, a3); s3 = f3 (a4, a5, a6); s = f2 (s1, s2); return s; } frama-c-20.0-Calcium/tests/pretty_printing/0000777000000000000000000000000013571573400015616 5ustar frama-c-20.0-Calcium/tests/pretty_printing/annotations.i0000666000000000000000000000324513571573400020331 0ustar /*@ axiomatic A { predicate P(integer x) reads \nothing ; } */ //@ ghost int global_decl ; //@ ghost int global_def = 42 ; /*@ requires P(x) && x > 0 ; ensures P(x) ; */ void function_no_ghost(int x) { int y = 0; /*@ loop invariant 0 <= y <= x ; loop assigns y ; loop variant x - y ; */ while (y < x) { /*@ assert y < x ; */ y++; /*@ assert y <= x ; */ } //@ assert y == x ; /*@ requires y == x ; assigns y ; ensures y != x ; */ { y -- ; y *= 2 ; } //@ requires y >= 0 ; y /= y ; } /*@ requires P(x) && x > 0 ; ensures P(x) ; */ void function_with_ghost(int x) { //@ ghost int y = 0; /*@ ghost /@ loop invariant 0 <= y <= x ; loop assigns y ; loop variant x - y ; @/ while (y < x) { /@ assert y < x ; @/ y++; /@ assert y <= x ; @/ } */ //@ assert y == x ; /*@ ghost /@ requires y == x ; assigns y ; ensures y != x ; @/ { y -- ; y *= 2 ; } */ /*@ ghost //@ requires y >= 0 ; y /= y ; */ } /*@ ghost /@ requires P(x) && x > 0 ; ensures P(x) ; @/ void ghost_function(int x) { int y = 0; /@ loop invariant 0 <= y <= x ; loop assigns y ; loop variant x - y ; @/ while (y < x) { /@ assert y < x ; @/ y++; /@ assert y <= x ; @/ } /@ assert y == x ; @/ /@ requires y == x ; assigns y ; ensures y != x ; @/ { y -- ; y *= 2 ; } //@ requires y >= 0 ; y /= y ; } */ /*@ ghost void function_declaration(int variable) ; */ void reference_function(void){ //@ ghost function_declaration(42) ; } frama-c-20.0-Calcium/tests/pretty_printing/binary_logic_op.c0000666000000000000000000000073713571573400021130 0ustar /*@ predicate foo (integer x) = x <= 0 && (x <= 1 && x<= 3) ==> x<=4 || ((x<=5 && x<=6) || x<=7) && x<=8; */ /*@ predicate bar(integer x, integer y, integer z, integer t) = x == 0 || (y == 0 || (z == 0 || t == 0)); */ /*@ predicate mixed(integer x, integer y, integer z, integer t) = x == 0 || ((y == 0 || z == 0) || t == 0); */ /*@ logic real pi = \pi; */ /*@ logic real pi_div_2 = π/2; */ /*@ logic real e = \e; */ /*@ logic real exp(real n) = \pow(\e, n); */ frama-c-20.0-Calcium/tests/pretty_printing/ghost_parameters.c0000666000000000000000000000321113571573400021326 0ustar void decl_function_void_no_ghost(void); void def_function_void_no_ghost(void) {} void decl_function_void_ghost(void) /*@ ghost (int y) */; void def_function_void_ghost(void) /*@ ghost (int y) */ {} void decl_function_x_no_ghost(int x); void def_function_x_no_ghost(int x) {} void decl_function_x_ghost(int x) /*@ ghost (int y) */; void def_function_x_ghost(int x) /*@ ghost (int y) */ {} void decl_with_fptr(void (*ptr)(int x) /*@ ghost (int y) */); void def_with_fptr(void (*ptr)(int x) /*@ ghost (int y) */) { void (*local)(int) /*@ ghost (int) */ = ptr; (*local)(4) /*@ ghost(2) */; //@ ghost (*local) (4, 2) ; } void decl_variadic(int x, ...) /*@ ghost(int y) */; void def_variadic(int x, ...) /*@ ghost(int y) */ {} int main(void) { decl_function_void_no_ghost(); def_function_void_no_ghost(); decl_function_void_ghost() /*@ ghost (4) */; def_function_void_ghost() /*@ ghost (4) */; decl_function_x_no_ghost(2); def_function_x_no_ghost(2); decl_function_x_ghost(2) /*@ ghost (4) */; def_function_x_ghost(2) /*@ ghost (4) */; decl_with_fptr(&decl_function_x_ghost); def_with_fptr(&decl_function_x_ghost); decl_variadic(2, 1, 2, 3, 4) /*@ ghost(4) */; def_variadic(2, 1, 2, 3, 4) /*@ ghost(4) */; /*@ ghost decl_function_void_no_ghost(); def_function_void_no_ghost(); decl_function_void_ghost(4); def_function_void_ghost(4); decl_function_x_no_ghost(2); def_function_x_no_ghost(2); decl_function_x_ghost(2,4); def_function_x_ghost(2,4); decl_with_fptr(&decl_function_x_ghost); def_with_fptr(&decl_function_x_ghost); decl_variadic(2, 1, 2, 3, 4, 4); def_variadic(2, 1, 2, 3, 4, 4); */ }frama-c-20.0-Calcium/tests/pretty_printing/oracle/0000777000000000000000000000000013571573400017063 5ustar frama-c-20.0-Calcium/tests/pretty_printing/oracle/annotations.res.oracle0000666000000000000000000001163513571573400023405 0ustar [kernel] Parsing tests/pretty_printing/annotations.i (no preprocessing) /* Generated by Frama-C */ /*@ axiomatic A { predicate P(ℤ x) reads \nothing; } */ /*@ ghost int global_decl; */ /*@ ghost int global_def = 42; */ /*@ requires P(x) ∧ x > 0; ensures P(\old(x)); */ void function_no_ghost(int x) { int y = 0; /*@ loop invariant 0 ≤ y ≤ x; loop assigns y; loop variant x - y; */ while (y < x) { /*@ assert y < x; */ ; y ++; /*@ assert y ≤ x; */ ; } /*@ assert y ≡ x; */ ; /*@ requires y ≡ x; ensures y ≢ x; assigns y; */ { y --; y *= 2; } /*@ requires y ≥ 0; */ y /= y; return; } /*@ requires P(x) ∧ x > 0; ensures P(\old(x)); */ void function_with_ghost(int x) { /*@ ghost int y = 0; */ /*@ ghost /@ loop invariant 0 ≤ y ≤ x; loop assigns y; loop variant x - y; @/ while (y < x) { /@ assert y < x; @/ ; y ++; /@ assert y ≤ x; @/ ; } */ /*@ assert y ≡ x; */ ; /*@ ghost /@ requires y ≡ x; ensures y ≢ x; assigns y; @/ { y --; y *= 2; } */ /*@ ghost /@ requires y ≥ 0; @/ y /= y; */ return; } /*@ ghost /@ requires P(x) ∧ x > 0; ensures P(\old(x)); @/ void ghost_function(int x) { int y = 0; /@ loop invariant 0 ≤ y ≤ x; loop assigns y; loop variant x - y; @/ while (y < x) { /@ assert y < x; @/ ; y ++; /@ assert y ≤ x; @/ ; } /@ assert y ≡ x; @/ ; /@ requires y ≡ x; ensures y ≢ x; assigns y; @/ { y --; y *= 2; } /@ requires y ≥ 0; @/ y /= y; return; } */ /*@ ghost void function_declaration(int variable); */ void reference_function(void) { /*@ ghost function_declaration(42); */ return; } [kernel] Parsing tests/pretty_printing/result/annotations.c (with preprocessing) [kernel] Parsing tests/pretty_printing/annotations.i (no preprocessing) [kernel] tests/pretty_printing/annotations.i:13: Warning: def'n of func function_no_ghost at tests/pretty_printing/annotations.i:13 (sum 9297192) conflicts with the one at tests/pretty_printing/result/annotations.c:12 (sum 14988159); keeping the one at tests/pretty_printing/result/annotations.c:12. [kernel] tests/pretty_printing/annotations.i:43: Warning: def'n of func function_with_ghost at tests/pretty_printing/annotations.i:43 (sum 9297192) conflicts with the one at tests/pretty_printing/result/annotations.c:38 (sum 14988159); keeping the one at tests/pretty_printing/result/annotations.c:38. [kernel] tests/pretty_printing/annotations.i:80: Warning: def'n of func ghost_function at tests/pretty_printing/annotations.i:80 (sum 9297192) conflicts with the one at tests/pretty_printing/result/annotations.c:71 (sum 14988159); keeping the one at tests/pretty_printing/result/annotations.c:71. [kernel] tests/pretty_printing/annotations.i:111: Warning: dropping duplicate def'n of func reference_function at tests/pretty_printing/annotations.i:111 in favor of that at tests/pretty_printing/result/annotations.c:102 /* Generated by Frama-C */ /*@ axiomatic A { predicate P(ℤ x) reads \nothing; } */ /*@ ghost int global_decl; */ /*@ ghost int global_def = 42; */ /*@ requires P(x) ∧ x > 0; ensures P(\old(x)); */ void function_no_ghost(int x) { int y = 0; /*@ loop invariant 0 ≤ y ≤ x; loop assigns y; loop variant x - y; */ while (y < x) { /*@ assert y < x; */ ; y ++; /*@ assert y ≤ x; */ ; } /*@ assert y ≡ x; */ ; /*@ requires y ≡ x; ensures y ≢ x; assigns y; */ { y --; y *= 2; } /*@ requires y ≥ 0; */ y /= y; return; } /*@ requires P(x) ∧ x > 0; ensures P(\old(x)); */ void function_with_ghost(int x) { /*@ ghost int y = 0; */ /*@ ghost /@ loop invariant 0 ≤ y ≤ x; loop assigns y; loop variant x - y; @/ while (y < x) { /@ assert y < x; @/ ; y ++; /@ assert y ≤ x; @/ ; } */ /*@ assert y ≡ x; */ ; /*@ ghost /@ requires y ≡ x; ensures y ≢ x; assigns y; @/ { y --; y *= 2; } */ /*@ ghost /@ requires y ≥ 0; @/ y /= y; */ return; } /*@ ghost /@ requires P(x) ∧ x > 0; ensures P(\old(x)); @/ void ghost_function(int x) { int y = 0; /@ loop invariant 0 ≤ y ≤ x; loop assigns y; loop variant x - y; @/ while (y < x) { /@ assert y < x; @/ ; y ++; /@ assert y ≤ x; @/ ; } /@ assert y ≡ x; @/ ; /@ requires y ≡ x; ensures y ≢ x; assigns y; @/ { y --; y *= 2; } /@ requires y ≥ 0; @/ y /= y; return; } */ /*@ ghost void function_declaration(int variable); */ void reference_function(void) { /*@ ghost function_declaration(42); */ return; } frama-c-20.0-Calcium/tests/pretty_printing/oracle/binary_logic_op.res.oracle0000666000000000000000000000231313571573400024200 0ustar [kernel] Parsing tests/pretty_printing/binary_logic_op.c (with preprocessing) /* Generated by Frama-C */ /*@ predicate foo(ℤ x) = x ≤ 0 ∧ x ≤ 1 ∧ x ≤ 3 ⇒ x ≤ 4 ∨ (((x ≤ 5 ∧ x ≤ 6) ∨ x ≤ 7) ∧ x ≤ 8); */ /*@ predicate bar(ℤ x, ℤ y, ℤ z, ℤ t) = x ≡ 0 ∨ y ≡ 0 ∨ z ≡ 0 ∨ t ≡ 0; */ /*@ predicate mixed(ℤ x, ℤ y, ℤ z, ℤ t) = x ≡ 0 ∨ y ≡ 0 ∨ z ≡ 0 ∨ t ≡ 0; */ /*@ logic ℝ pi= π; */ /*@ logic ℝ pi_div_2= π / 2; */ /*@ logic ℝ e= \e; */ /*@ logic ℝ exp(ℝ n) = \pow(\e, n); */ [kernel] Parsing tests/pretty_printing/result/binary_logic_op.c (with preprocessing) [kernel] Parsing tests/pretty_printing/binary_logic_op.c (with preprocessing) /* Generated by Frama-C */ /*@ predicate foo(ℤ x) = x ≤ 0 ∧ x ≤ 1 ∧ x ≤ 3 ⇒ x ≤ 4 ∨ (((x ≤ 5 ∧ x ≤ 6) ∨ x ≤ 7) ∧ x ≤ 8); */ /*@ predicate bar(ℤ x, ℤ y, ℤ z, ℤ t) = x ≡ 0 ∨ y ≡ 0 ∨ z ≡ 0 ∨ t ≡ 0; */ /*@ predicate mixed(ℤ x, ℤ y, ℤ z, ℤ t) = x ≡ 0 ∨ y ≡ 0 ∨ z ≡ 0 ∨ t ≡ 0; */ /*@ logic ℝ pi= π; */ /*@ logic ℝ pi_div_2= π / 2; */ /*@ logic ℝ e= \e; */ /*@ logic ℝ exp(ℝ n) = \pow(\e, n); */ frama-c-20.0-Calcium/tests/pretty_printing/oracle/ghost_parameters.res.oracle0000666000000000000000000001332113571573400024411 0ustar [kernel] Parsing tests/pretty_printing/ghost_parameters.c (with preprocessing) /* Generated by Frama-C */ void decl_function_void_no_ghost(void); void def_function_void_no_ghost(void) { return; } void decl_function_void_ghost(void) /*@ ghost (int y) */; void def_function_void_ghost(void) /*@ ghost (int y) */ { return; } void decl_function_x_no_ghost(int x); void def_function_x_no_ghost(int x) { return; } void decl_function_x_ghost(int x) /*@ ghost (int y) */; void def_function_x_ghost(int x) /*@ ghost (int y) */ { return; } void decl_with_fptr(void (*ptr)(int x) /*@ ghost (int y) */); void def_with_fptr(void (*ptr)(int x) /*@ ghost (int y) */) { void (*local)(int ) /*@ ghost (int ) */ = ptr; (*local)(4) /*@ ghost (2) */; /*@ ghost (*local)(4,2); */ return; } void decl_variadic(int x , ...) /*@ ghost (int y) */; void def_variadic(int x , ...) /*@ ghost (int y) */ { return; } int main(void) { int __retres; decl_function_void_no_ghost(); def_function_void_no_ghost(); decl_function_void_ghost() /*@ ghost (4) */; def_function_void_ghost() /*@ ghost (4) */; decl_function_x_no_ghost(2); def_function_x_no_ghost(2); decl_function_x_ghost(2) /*@ ghost (4) */; def_function_x_ghost(2) /*@ ghost (4) */; decl_with_fptr(& decl_function_x_ghost); def_with_fptr(& decl_function_x_ghost); decl_variadic(2,1,2,3,4) /*@ ghost (4) */; def_variadic(2,1,2,3,4) /*@ ghost (4) */; /*@ ghost decl_function_void_no_ghost(); */ /*@ ghost def_function_void_no_ghost(); */ /*@ ghost decl_function_void_ghost(4); */ /*@ ghost def_function_void_ghost(4); */ /*@ ghost decl_function_x_no_ghost(2); */ /*@ ghost def_function_x_no_ghost(2); */ /*@ ghost decl_function_x_ghost(2,4); */ /*@ ghost def_function_x_ghost(2,4); */ /*@ ghost decl_with_fptr(& decl_function_x_ghost); */ /*@ ghost def_with_fptr(& decl_function_x_ghost); */ /*@ ghost decl_variadic(2,1,2,3,4,4); */ /*@ ghost def_variadic(2,1,2,3,4,4); */ __retres = 0; return __retres; } [kernel] Parsing tests/pretty_printing/result/ghost_parameters.c (with preprocessing) [kernel] Parsing tests/pretty_printing/ghost_parameters.c (with preprocessing) [kernel] tests/pretty_printing/ghost_parameters.c:2: Warning: dropping duplicate def'n of func def_function_void_no_ghost at tests/pretty_printing/ghost_parameters.c:2 in favor of that at tests/pretty_printing/result/ghost_parameters.c:4 [kernel] tests/pretty_printing/ghost_parameters.c:4: Warning: dropping duplicate def'n of func def_function_void_ghost at tests/pretty_printing/ghost_parameters.c:4 in favor of that at tests/pretty_printing/result/ghost_parameters.c:11 [kernel] tests/pretty_printing/ghost_parameters.c:6: Warning: dropping duplicate def'n of func def_function_x_no_ghost at tests/pretty_printing/ghost_parameters.c:6 in favor of that at tests/pretty_printing/result/ghost_parameters.c:18 [kernel] tests/pretty_printing/ghost_parameters.c:8: Warning: dropping duplicate def'n of func def_function_x_ghost at tests/pretty_printing/ghost_parameters.c:8 in favor of that at tests/pretty_printing/result/ghost_parameters.c:25 [kernel] tests/pretty_printing/ghost_parameters.c:10: Warning: dropping duplicate def'n of func def_with_fptr at tests/pretty_printing/ghost_parameters.c:10 in favor of that at tests/pretty_printing/result/ghost_parameters.c:32 [kernel] tests/pretty_printing/ghost_parameters.c:17: Warning: dropping duplicate def'n of func def_variadic at tests/pretty_printing/ghost_parameters.c:17 in favor of that at tests/pretty_printing/result/ghost_parameters.c:42 [kernel] tests/pretty_printing/ghost_parameters.c:19: Warning: def'n of func main at tests/pretty_printing/ghost_parameters.c:19 (sum 21482) conflicts with the one at tests/pretty_printing/result/ghost_parameters.c:47 (sum 23256); keeping the one at tests/pretty_printing/result/ghost_parameters.c:47. /* Generated by Frama-C */ void decl_function_void_no_ghost(void); void def_function_void_no_ghost(void) { return; } void decl_function_void_ghost(void) /*@ ghost (int y) */; void def_function_void_ghost(void) /*@ ghost (int y) */ { return; } void decl_function_x_no_ghost(int x); void def_function_x_no_ghost(int x) { return; } void decl_function_x_ghost(int x) /*@ ghost (int y) */; void def_function_x_ghost(int x) /*@ ghost (int y) */ { return; } void decl_with_fptr(void (*ptr)(int x) /*@ ghost (int y) */); void def_with_fptr(void (*ptr)(int x) /*@ ghost (int y) */) { void (*local)(int ) /*@ ghost (int ) */ = ptr; (*local)(4) /*@ ghost (2) */; /*@ ghost (*local)(4,2); */ return; } void decl_variadic(int x , ...) /*@ ghost (int y) */; void def_variadic(int x , ...) /*@ ghost (int y) */ { return; } int main(void) { int __retres; decl_function_void_no_ghost(); def_function_void_no_ghost(); decl_function_void_ghost() /*@ ghost (4) */; def_function_void_ghost() /*@ ghost (4) */; decl_function_x_no_ghost(2); def_function_x_no_ghost(2); decl_function_x_ghost(2) /*@ ghost (4) */; def_function_x_ghost(2) /*@ ghost (4) */; decl_with_fptr(& decl_function_x_ghost); def_with_fptr(& decl_function_x_ghost); decl_variadic(2,1,2,3,4) /*@ ghost (4) */; def_variadic(2,1,2,3,4) /*@ ghost (4) */; /*@ ghost decl_function_void_no_ghost(); */ /*@ ghost def_function_void_no_ghost(); */ /*@ ghost decl_function_void_ghost(4); */ /*@ ghost def_function_void_ghost(4); */ /*@ ghost decl_function_x_no_ghost(2); */ /*@ ghost def_function_x_no_ghost(2); */ /*@ ghost decl_function_x_ghost(2,4); */ /*@ ghost def_function_x_ghost(2,4); */ /*@ ghost decl_with_fptr(& decl_function_x_ghost); */ /*@ ghost def_with_fptr(& decl_function_x_ghost); */ /*@ ghost decl_variadic(2,1,2,3,4,4); */ /*@ ghost def_variadic(2,1,2,3,4,4); */ __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/pretty_printing/oracle/parenthesis.res.oracle0000666000000000000000000000030113571573400023361 0ustar [kernel] Parsing tests/pretty_printing/parenthesis.c (with preprocessing) /* Generated by Frama-C */ /*@ predicate implies(ℤ x, ℤ y) = (x ≡ 0 ⇒ y ≡ 0) ⇒ x ≡ 1 ⇒ y ≡ 1; */ frama-c-20.0-Calcium/tests/pretty_printing/oracle/relations.res.oracle0000666000000000000000000000112713571573400023043 0ustar [kernel] Parsing tests/pretty_printing/relations.c (with preprocessing) /* Generated by Frama-C */ /*@ predicate rel1(ℤ x, ℤ y, ℤ z, ℤ t) = x ≤ y ≤ z ∧ z ≥ t; */ /*@ predicate rel2(ℤ x, ℤ y, ℤ z, ℤ t) = x ≤ y ≡ z ∧ z ≥ t; */ [kernel] Parsing tests/pretty_printing/result/relations.c (with preprocessing) [kernel] Parsing tests/pretty_printing/relations.c (with preprocessing) /* Generated by Frama-C */ /*@ predicate rel1(ℤ x, ℤ y, ℤ z, ℤ t) = x ≤ y ≤ z ∧ z ≥ t; */ /*@ predicate rel2(ℤ x, ℤ y, ℤ z, ℤ t) = x ≤ y ≡ z ∧ z ≥ t; */ frama-c-20.0-Calcium/tests/pretty_printing/parenthesis.c0000666000000000000000000000020613571573400020305 0ustar /* run.config OPT: -print */ /*@ predicate implies(integer x,integer y) = (x == 0 ==> y == 0) ==> (x == 1 ==> y == 1); @*/ frama-c-20.0-Calcium/tests/pretty_printing/relations.c0000666000000000000000000000027513571573400017766 0ustar /*@ predicate rel1(integer x, integer y, integer z, integer t) = x <= y <= z && z >= t; */ /*@ predicate rel2(integer x, integer y, integer z, integer t) = x <= y == z && z >= t; */ frama-c-20.0-Calcium/tests/pretty_printing/test_config0000666000000000000000000000060713571573400020050 0ustar COMMENT: this directory is meant to test the parser and pretty-printer COMMENT: the default option checks that pretty-printed code can be merged COMMENT: with the original one CMD: FRAMAC_PLUGIN=tests/.empty @frama-c@ OPT: @PTEST_FILE@ -print -journal-disable -check -then -ocode @PTEST_DIR@/result/@PTEST_NAME@.c -print -then @PTEST_DIR@/result/@PTEST_NAME@.c @PTEST_FILE@ -ocode="" -print frama-c-20.0-Calcium/tests/rte/0000777000000000000000000000000013571573400013147 5ustar frama-c-20.0-Calcium/tests/rte/addsub.c0000666000000000000000000000106513571573400014557 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 */ int main() { int x=0,y=0,z=0; z = (int) 0x7fffffff + (int) 0x7fffffff; /* false */ z = - 0x7fffffff - 0x7fffffff; /* false */ z = (- (int) (-0x7fffffff -1)) - 1; /* false */ z = (int) 0x7fffffff + 0; /* true */ z = - (int) 0x7fffffff - 1; /* true */ z = x + y; z = - (int) 0x7ffffffc - y; z = - x - (int) 0x7ffffffc; z = (int) 0x7ffffffc + y; z = x + (int) 0x7ffffffc; z = y + (-2); z = y - (-2); z = -1 - y; z = -2 - y; z = 0 - y; return 0; } frama-c-20.0-Calcium/tests/rte/addsub_typedef.c0000666000000000000000000000101113571573400016266 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 */ typedef int tint; int main() { tint x=0,y=0,z=0; z = (tint) 0x7fffffff + (tint) 0x7fffffff; /* false */ z = - 0x7fffffff - 0x7fffffff; /* false */ z = (- (tint) (-0x7fffffff -1)) - 1; /* false */ z = (tint) 0x7fffffff + 0; /* true */ z = - (tint) 0x7fffffff - 1; /* true */ z = x + y; z = - (tint) 0x7ffffffc - y; z = - x - (tint) 0x7ffffffc; z = (tint) 0x7ffffffc + y; z = x + (tint) 0x7ffffffc; return 0; } frama-c-20.0-Calcium/tests/rte/addsub_unsigned.c0000666000000000000000000000065413571573400016456 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 OPT: -rte -warn-signed-overflow -warn-unsigned-overflow -print -machdep x86_32 */ int main() { unsigned int ux,uy,uz; ux = 0x7FFFFFFFU * 2 ; /* no unsigned ov */ uy = 0x80000000U + 0x80000000U; /* unsigned ov */ uy = 2U * 0x80000000U; /* unsigned ov */ uz = ux + 2; /* unsigned ov but not detected by const folding */ return 0; } frama-c-20.0-Calcium/tests/rte/addsub_unsigned_typedef.c0000666000000000000000000000070013571573400020166 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 OPT: -rte -warn-signed-overflow -warn-unsigned-overflow -print -machdep x86_32 */ typedef unsigned int uint; int main() { uint ux,uy,uz; ux = 0x7FFFFFFFU * 2 ; /* no unsigned ov */ uy = 0x80000000U + 0x80000000U; /* unsigned ov */ uy = 2U * 0x80000000U; /* unsigned ov */ uz = ux + 2; /* unsigned ov but not detected by const folding */ return 0; } frama-c-20.0-Calcium/tests/rte/array_index.c0000666000000000000000000000126613571573400015625 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -then -rte-trivial-annotations OPT: -rte -warn-signed-overflow -print -unsafe-arrays */ int t[10]; int u[8+3]; int v[16][17]; struct s_arr { int t[15]; }; typedef struct _s { int t[15]; struct { int u[12]; } s; struct s_arr v[12]; } ts; ts s; unsigned int c[10]; void main(int i, int j, unsigned int k) { t[0] = 0; u[1] = 0; v[2][3] = 0; s.t[1] = 0; s.s.u[2] = 0; s.v[3].t[4] = 0; t[i] = 0; u[i] = 0; v[i][j] = 0; s.t[i] = 0; s.s.u[i] = 0; s.v[i].t[j] = 0; t[k] = 0; u[k] = 0; v[k][c[k]] = 0; s.t[k] = 0; s.s.u[k] = 0; s.v[k].t[c[k]] = 0; int x; int t[100 / sizeof(x)]; } frama-c-20.0-Calcium/tests/rte/assign.c0000666000000000000000000000130113571573400014572 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -journal-disable */ int global_x, global_y; //@ assigns \nothing; void g(void); //@ assigns \nothing; int fnd1(void); //@ assigns global_x ; int fnd2(void); //@ assigns global_x; assigns global_y; int fnd3(void); int fnd4(void); /*@ assigns global_x; @ behavior normal : assumes cond; assigns \nothing ; @ behavior other : assumes !cond; assigns global_x ; @*/ int fnd5(int cond); //@ assigns \nothing; int fnd6(void); //@ assigns *x \from *y ; int fnd7(int* x, int* y); int rte (int cond) { int a,b; g(); if (fnd1() && fnd2() && fnd3() && fnd4() && fnd5(cond) && fnd6() && fnd7(&a,&b)) return 1; else return 0; } frama-c-20.0-Calcium/tests/rte/assign2.c0000666000000000000000000000053213571573400014661 0ustar /* run.config OPT: -rte -warn-signed-overflow -rte-no-mem -print */ int i; int t[10]; //@ ensures 0 <= \result <= 0; int any(void); /*@ assigns i, t[\at(i,Post)]; @ ensures t[i] == \old(t[\at(i,Here)]) + 1; @ ensures \let j = i ; t[j] == \old(t[j]) + 1; @*/ void f() { i = any(); t[i]++; } int main() { f(); f(); return 0; } frama-c-20.0-Calcium/tests/rte/assign3.c0000666000000000000000000000035113571573400014661 0ustar /* run.config OPT: -rte -warn-signed-overflow -rte-no-mem -print -journal-disable */ // if f() assigns i there might be a problem //@ assigns \nothing; int f(void); int main() { int i; int t[10]; i = 0; t[i] = f(); } frama-c-20.0-Calcium/tests/rte/assign4.c0000666000000000000000000000054113571573400014663 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -journal-disable */ //@ assigns \result \from min, max; int choose1(int min, int max); /*@ assigns \result \from min, max, min, max; assigns \result \from min, max, min, max; */ int choose2(int min, int max); int main() { int c1 = choose1(5,10); int c2 = choose2(0,c1); return c1+c2; } frama-c-20.0-Calcium/tests/rte/assign5.c0000666000000000000000000000114513571573400014665 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -journal-disable */ /* the assigns of f shouldn't parse: in fact both assigns are taken into account */ /*@ assigns *p \from x; assigns *p \from \nothing; */ int f(int *p, int x); /* the assigns of g shouldn't parse: here only assigns \from \nothing is kept */ /*@ assigns *p \from \nothing; assigns *p \from x; */ int g(int *p, int x); int main() { int i,a; int t[10]; i = 0; a = 0; t[0] = f(&i,a); // rte warning: from \nothing + other froms t[1] = g(&i,a); // no rte warning since only assigns from \nothing is kept } frama-c-20.0-Calcium/tests/rte/assign6.c0000666000000000000000000000036213571573400014666 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -journal-disable */ int z; /*@ assigns z \from y; assigns \result \from x,y; */ int f(int x, int y); int main() { int a,b; a = f(0,0); a = f(0,b); a = f(b,0); return a; } frama-c-20.0-Calcium/tests/rte/assign7.c0000666000000000000000000000113013571573400014661 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -journal-disable */ //@ assigns *p \from \union(*(char*)p,*q); extern void f(int* p, int* q); //@ assigns *p \from \union(*p, \union(*r,*q)); extern void ff(int* p, int* q, int* r); //@ assigns *p \from \inter(*(char*)p,*q); extern void h(int* p, int* q); //@ assigns \union(*p,*q); extern void g(int* p, int* q); /*@ assigns \at(*p,Post), \at(*p,Pre), *p ; */ extern void gg(int* p); int X, Y ; //@ assigns \union(X, Y) ; void hh(void); int main() { int x,y,z; f(&x,&y); ff(&x,&y,&z); g(&x,&y); h(&x,&y); gg(&x); hh(); } frama-c-20.0-Calcium/tests/rte/bool.i0000666000000000000000000000176713571573400014267 0ustar /* run.config OPT: -warn-invalid-bool -rte -print -then -rte-trivial-annotations -rte -print */ /* The test asks for two executions of RTE plug-in: - a first one without trivial annotations (default behavior) - a second one with trivial annotations (-rte-trivial-annotations) */ struct s_bool { char c; _Bool b; } sb; _Bool ko1 () { char *p = &sb.c; *(p+1) = 17; return sb.b; } _Bool ko2 () { _Bool b; char *p = (char *)&b; *p = 17; return b; } extern _Bool f(void) ; /* There is no rte in 'ok1' statements (needs -rte-no-trivial-annotations). If there is some during its execution, that is into the statements of the called functions. */ _Bool ok1 (void) { _Bool x = f() ; _Bool y = ko2(); if (x) return y; return x; } /* There is no rte when converting to _Bool (needs -rte-no-trivial-annotations), nor for access to local variables or formal parameters when their address is not taken. */ extern int g(_Bool,_Bool) ; _Bool ok2 (int a,_Bool b) { return g(a>0, b); } frama-c-20.0-Calcium/tests/rte/bts0567.c0000666000000000000000000000022013571573400014417 0ustar /* run.config OPT: -rte -warn-signed-overflow -print */ int tab [2] ; //@ requires \valid(p+1) ; void f(int *p) ; void g(){ f(tab) ; } frama-c-20.0-Calcium/tests/rte/bts0576.c0000666000000000000000000000057213571573400014431 0ustar /* run.config OPT: -rte -warn-signed-overflow -warn-special-float none -print */ typedef double typetab[2]; /*@ requires \valid(t) && \valid_range(&*t,0,0) && \valid_range((double *)t,0,1); */ double g4(typetab *t) { double y; y = (*t)[0] + (*t)[1]; return y; } /*@ assigns \nothing; */ double f4() { double tab[2],r; tab[0]=1.0; tab[1]=2.0; r = g4( &tab ); return r; } frama-c-20.0-Calcium/tests/rte/bts0580.i0000666000000000000000000000024013571573400014422 0ustar /* run.config OPT: -rte -warn-signed-overflow -rte-mem -print */ struct ArrayStruct { int data[10]; } buff; int main (int i) { return buff.data[i] ; } frama-c-20.0-Calcium/tests/rte/bts0580_2.c0000666000000000000000000000072713571573400014647 0ustar /* run.config OPT: -rte -warn-signed-overflow -rte-mem -rte-no-pointer-call -print */ typedef int (*fptr)(int); struct S { int val; struct S* next; }; struct C { struct S cell[5]; fptr f; }; struct ArrayStruct { struct C data[10]; }; struct ArrayStruct buff ; int main(int i ) { int a, b,d; int c[3]; int* p; fptr f; a = buff.data[i].cell[*p].next->val; b = buff.data[c[2]].f(c[1]); d = f(buff.data[0].cell[0].val); return a > b; } frama-c-20.0-Calcium/tests/rte/bts1052.c0000666000000000000000000000033313571573400014412 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -journal-disable */ /*@ assigns \nothing; ensures \let count = d ; \result ==count; */ int op(int d) ; int x,y; void main () { x = op(33); y = op(31) ; } frama-c-20.0-Calcium/tests/rte/bts2314.i0000666000000000000000000000030013571573400014414 0ustar /* run.config OPT: -rte -warn-signed-downcast -print -machdep x86_32 */ struct STR { int num : 7; }; void foo(int a, long b) { struct STR s = { .num = 0 }; s.num = b; s.num += a; } frama-c-20.0-Calcium/tests/rte/bts621.c0000666000000000000000000000025713571573400014340 0ustar /* run.config OPT: -print -then -no-print -rte -warn-signed-overflow -then -print */ //@ assigns *p; float g(float* p); void f(float a) { /*@ ghost float x = g(&a); */ } frama-c-20.0-Calcium/tests/rte/castoncall.c0000666000000000000000000000103213571573400015432 0ustar /* run.config OPT: -rte -warn-signed-overflow -warn-signed-downcast -print OPT: -rte -warn-signed-overflow -warn-signed-downcast -no-collapse-call-cast -print */ /*@ ensures (\result == a) || (\result == b); assigns \result \from a,b; */ int nondet(int a, int b); /*@ ensures (\result == a) || (\result == b); assigns \result \from a,b; */ void *nondet_ptr(void *a, void *b) { return (void*) nondet((int)a, (int)b); } //@ ensures \result == 1; assigns \nothing; int f(void); void g() { char c = f(); return; } frama-c-20.0-Calcium/tests/rte/compute_annot/0000777000000000000000000000000013571573400016022 5ustar frama-c-20.0-Calcium/tests/rte/compute_annot/compute_annot.ml0000666000000000000000000000216713571573400021235 0ustar let print () = File.pretty_ast (); Kernel.log "================================" let print_status () = Kernel.log "printing status"; let _, _, get_signedOv_status = !Db.RteGen.get_signedOv_status () in Globals.Functions.iter (fun kf -> Kernel.log "kf = %s rte_gen_status = %b\n" (Kernel_function.get_name kf) (get_signedOv_status kf)) let main () = Dynamic.Parameter.Bool.set "-rte-mem" false; Dynamic.Parameter.Bool.set "-rte-pointer-call" false; Dynamic.Parameter.Bool.set "-rte-float-to-int" false; Dynamic.Parameter.Bool.set "-rte-div" false; Kernel.SignedOverflow.off (); Kernel.SignedDowncast.off (); print (); print_status (); Kernel.log "computing rte-div annotations" ; Dynamic.Parameter.Bool.set "-rte-div" true ; !Db.RteGen.compute () ; print (); print_status (); Kernel.log "removing rte-div alarms" ; let emitter = Dynamic.get ~plugin:"RteGen" "emitter" Emitter.ty in let filter = function | Alarms.Division_by_zero _ -> true | _ -> false in Alarms.remove ~filter emitter; !Db.RteGen.compute () ; print (); print_status () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/rte/divmod.c0000666000000000000000000000145413571573400014601 0ustar /* run.config OPT: -rte -warn-signed-overflow -warn-signed-downcast -print -machdep x86_32 -journal-disable */ #include "share/libc/limits.h" int main() { int x=0,y=0,z=0; unsigned int ux=0,uy=0,uz=0; z = INT_MIN / -1 ; z = INT_MIN % -1 ; uz = 1 / 0; uz = 1 / (0xffffffff + 1); ux = 0x80000000; uy = 0xffffffff; uz = ((int) ux) / ((int) uy); // floating point exception uz = ux / uy; // correct if uy != 0 uz = 0x80000000 / (0xffffffff + 1); uz = ((int) (-0x7fffffff -1)) / ((int) -1); uz = ((int) (-0x7fffffff -1)) / 0xffffffff; uz = 0x80000000 / (int) -1; uz = (int) (0x80000000 / 0xffffffff); z = 1 / (x + y) ; z = x / -1; z = (- 0x7ffffff - 1) / y; z = (-2147483648L) / (-1L) ; z = 0x80000000 / -1; z = 0x80000000 / 0xffffffff; return 0; } frama-c-20.0-Calcium/tests/rte/divmod_typedef.c0000666000000000000000000000153313571573400016317 0ustar /* run.config OPT: -rte -warn-signed-overflow -warn-signed-downcast -print -machdep x86_32 -journal-disable */ #include "share/libc/limits.h" typedef int tint; typedef unsigned int tuint; int main() { tint x=0,y=0,z=0; tuint ux=0,uy=0,uz=0; z = INT_MIN / -1 ; z = INT_MIN % -1 ; uz = 1 / 0; uz = 1 / (0xffffffff + 1); ux = 0x80000000; uy = 0xffffffff; uz = ((tint) ux) / ((tint) uy); // floating point exception uz = ux / uy; // correct if uy != 0 uz = 0x80000000 / (0xffffffff + 1); uz = ((tint) (-0x7fffffff -1)) / ((tint) -1); uz = ((tint) (-0x7fffffff -1)) / 0xffffffff; uz = 0x80000000 / (tint) -1; uz = (tint) (0x80000000 / 0xffffffff); z = 1 / (x + y) ; z = x / -1; z = (- 0x7ffffff - 1) / y; z = (-2147483648L) / (-1L) ; z = 0x80000000 / -1; z = 0x80000000 / 0xffffffff; return 0; } frama-c-20.0-Calcium/tests/rte/downcast.c0000666000000000000000000000077313571573400015144 0ustar /* run.config OPT: -rte -warn-signed-overflow -warn-signed-downcast -print -machdep x86_32 OPT: -rte -warn-signed-overflow -print -warn-signed-overflow -machdep x86_32 OPT: -rte -warn-signed-overflow -print -warn-signed-downcast -warn-unsigned-downcast -machdep x86_32 */ int main(void) { signed char sx,sy,sz; unsigned char uc; int x; unsigned int ux, uy,uz; unsigned short s; sz = sx + sy; uc = sx + sy; uc = x; x = uy + uz; ux = uy + uz; s = uy + uz; return 0; } frama-c-20.0-Calcium/tests/rte/finite_float.c0000666000000000000000000000033113571573400015753 0ustar /* run.config OPT: -rte -warn-special-float non-finite -print -machdep x86_32 -journal-disable */ #define _ISOC99_SOURCE #include void main() { double d = 0x1p10000; d = 0.; double e = (d/d) + d; } frama-c-20.0-Calcium/tests/rte/float_to_int.c0000666000000000000000000000047313571573400016000 0ustar /* run.config OPT: -rte -rte-float-to-int -warn-special-float none -print -machdep x86_32 -journal-disable */ void main() { float f = 0.; int i = f; long long l = f; unsigned short s = f; int ci1 = 1.5; int ci2 = 1.5e255; char ci3 = 258.; int ci4 = 2147483647.5; int ci5 = -2147483649.5; } frama-c-20.0-Calcium/tests/rte/fptr_assert.c0000666000000000000000000000047413571573400015654 0ustar /* run.config OPT: -rte -print */ typedef int (*fptr)(int); void g() { return; } int f(int x) { return x; } int h(int x) { return x; } int main (int i) { void (*fp1)(); fptr fp2; fptr ma[2] = { &f, &h }; fp1 = &g; fp2 = &f; (*fp1)(); (*fp2)(3); (*ma[1])(5); (*ma[i])(5); return 0; } frama-c-20.0-Calcium/tests/rte/gnu_zero_length.c0000666000000000000000000000055313571573400016507 0ustar /* run.config OPT: -rte -print -machdep gcc_x86_32 -journal-disable */ #include struct S { unsigned length; int fam[0]; }; int main () { unsigned l = 3; struct S* s = malloc(sizeof(*s) + sizeof(int) * l); if (s) { s->length = l; for (int i = 0; i < s->length; i++) s->fam[i] = i; return s->fam[s->length - 1]; } return 0; } frama-c-20.0-Calcium/tests/rte/initialized.c0000666000000000000000000000515013571573400015621 0ustar /* run.config OPT: -rte -rte-initialized -warn-signed-overflow -print */ struct R { int v; }; struct Q { int v; int id[12]; struct P* next; struct R tr[13]; }; struct P { int val; struct P* next; int id[5]; int oth[6][7]; struct P* nexts[8][9]; struct Q q; struct Q tq[10][11]; struct P*** znexts; }; /* Temporary variables */ int g() { int x = 3; return x; } /* Formals */ int f (struct P*** pppp, struct P** ppp, struct P* pp, struct P p, struct P p2, int v, struct Q q, int *i, int *j, int i0, int i1, int i2, int i3, int i4, double f_0) { i0 = 0; i1 = 1; i2 = 2; i3 = 3; i4 = 4; j=0 + g(); i = &j; pp = &p; ppp = &pp; pppp = &ppp; p.next = pp; p.znexts = pppp; p.nexts[i0][i1] = p.nexts[i2][i3] = pp; q.next = pp; q.id[i0] = 0; p.q = q; p.tq[i0][i1] = q; p.id[i1] = p.id[i2]; p.id[i1] = p.id[i3]; struct P np = *(p.next); struct P* npp = p.next; p.next = npp; v = p.id[3]; v = pp->id[3]; v = *i; v = pp->val; v = pp->id[3]; struct P* z = pp->nexts[i0][i1]; v = pp->nexts[i0][i1]->val; v = pp->next->val; v = pp->next->next->val; v = p.nexts[i0][i1]->val; v = pp->id[i2]; v = pp ->oth[i0][i1]; v = p.nexts[i1][i2]->nexts[i3][*i]->id[i4]; v = p.q.v; v = p.q.id[i4]; v = p.tq[i3][i1].v; v = p.tq[i1][i2].next->tq[i3][i4].v; v = pp->tq[i3][i1].v; v = p.znexts[i0][i1][i2].val; q = p.tq[i0][i1]; v = p.tq[i0][i1].tr[i2].v; v = pp->val; v = p.val; v = p.tq[i0][i1].v; return v; } struct P*** pppp; struct P** ppp; struct P* pp; struct P p, p2; int v; struct Q q; int *i,j; int i0 = 0; int i1 = 1; int i2 = 2; int i3 = 3; int i4 = 4; double f0 = 1.1234; int i5 = 1; int main() { unsigned char c1, c2; j=0; i = &j; pp = &p; ppp = &pp; pppp = &ppp; p.next = pp; p.znexts = pppp; p.nexts[i0][i1] = p.nexts[i2][i3] = pp; q.next = pp; q.id[i0] = 0; p.q = q; p.tq[i0][i1] = q; p.id[i1] = p.id[i2]; p.id[i1] = p.id[i3]; struct P np = *(p.next); struct P* npp = p.next; v = p.id[3]; v = pp->id[3]; v = *i; v = pp->val; v = pp->id[3]; struct P* z = pp->nexts[i0][i1]; v = pp->nexts[i0][i1]->val; v = pp->next->val; v = pp->next->next->val; v = p.nexts[i0][i1]->val; v = pp->id[i2]; v = pp ->oth[i0][i1]; v = p.nexts[i1][i2]->nexts[i3][*i]->id[i4]; v = p.q.v; v = p.q.id[i4]; v = p.tq[i3][i1].v; v = p.tq[i1][i2].next->tq[i3][i4].v; v = pp->tq[i3][i1].v; v = p.znexts[i0][i1][i2].val; q = p.tq[i0][i1]; v = p.tq[i0][i1].tr[i2].v; v = pp->val; v = p.val; v = p.tq[i0][i1].v; c1 = c2; unsigned char c3 = c2; return v; } frama-c-20.0-Calcium/tests/rte/initialized_union.c0000666000000000000000000000131613571573400017031 0ustar /* run.config OPT: -rte -rte-initialized -warn-signed-overflow -print */ union U { char c; int i; double f; }; union U2 { int i1; int i2; }; union U3 { union U u; union U2 u2; }; struct S { union U u; }; union U u_global; // supported by Frama-C union empty {}; int main(){ union U u_local1; union U u_local2; union U2 u2_local1; union U2 u2_local2; union U3 u3_local1; union U3 u3_local2; union empty e; u_local1.c = 1; u_local2 = u_local1; u2_local1.i2 = u_local1.i; u2_local2 = u2_local1; u3_local1.u = u_local1; u3_local2 = u3_local1; double f = u_global.f; struct S s1, s2; s1.u.c = 'a'; s2.u = s1.u; union empty e1 = e; return 0; } frama-c-20.0-Calcium/tests/rte/malloc.c0000666000000000000000000000042513571573400014563 0ustar /* run.config OPT: -rte -warn-signed-overflow -print */ /*@ allocates \result; @ ensures \result==\null || \fresh(\result,10); */ char* my_malloc (unsigned int n) ; int main() { //@ requires \true ; char * p = my_malloc (10) ; if (p) return 1; return 0; } frama-c-20.0-Calcium/tests/rte/memaccess.c0000666000000000000000000000043513571573400015255 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 */ int main(int x) { int *p,*q; int tab[10]; *p = 3; q = p; *q = *p + 5; tab[3] = *q; tab[x] = *q; p = &tab[2]; p = &tab[x]; *(p+1) = tab[0]; *(p+1) = tab[x]; *q=p[2]; return 0; } frama-c-20.0-Calcium/tests/rte/minus.c0000666000000000000000000000122613571573400014447 0ustar /* run.config OPT: -rte -warn-signed-overflow -warn-signed-downcast -print -machdep x86_32 OPT: -rte -rte-trivial-annotations -warn-signed-overflow -warn-signed-downcast -print -machdep x86_32 */ int main() { int x=0,y=0,z=0; unsigned int ux=0,uy=0,uz=0; short sz=0; z = -x; z = - (-0x7fffffff -1); z = -ux; sz = ((unsigned short) (65535 + 3)) + x; z = -0x80000000 -1; /* this is unsigned and equal to 0x7fffffff */ z = -2147483648 - 1; /* this is unsigned and equal to 0x7fffffff */ z = -2147483647 -1 -1; /* this is signed and overflows */ z = -((int)(-0x7fffffff -1)) -1; /* this is signed and overflows */ return 0; } frama-c-20.0-Calcium/tests/rte/mul.c0000666000000000000000000000070513571573400014112 0ustar /* run.config OPT: -rte -warn-signed-overflow -warn-signed-downcast -print -machdep x86_32 */ int main() { int x=0,y=0,z=0; unsigned int ux=0,uy=0,uz=0; uz = ux * uy; z = x * y; z = 0x1000 * y; z = x * 0x1000; z = (- 0x1000) * y; z = x * (- 0x1000); z = (int) (-1) * y; z = x * 1; z = 1 * y; z = x * 0xffffffff; z = 0xffff * 0xffff; z = 0xffff * 0x7fff; z = 0xffff * 0x8000; z = 0xffff * 0x8001; return 0; } frama-c-20.0-Calcium/tests/rte/my_annot_proxy/0000777000000000000000000000000013571573400016234 5ustar frama-c-20.0-Calcium/tests/rte/my_annot_proxy/my_annot_proxy.ml0000666000000000000000000000221413571573400021652 0ustar let print () = File.pretty_ast (); Kernel.log "================================" let print_status () = Kernel.log "printing status"; let rte_state_getter_list = !Db.RteGen.get_all_status () in Globals.Functions.iter (fun kf -> Kernel.log "kf = %s" (Kernel_function.get_name kf) ; List.iter (fun (s, _, getter) -> Kernel.log "- %s = %b" s (getter kf)) rte_state_getter_list); Kernel.log "================================" let main () = Dynamic.Parameter.Bool.set "-rte-mem" true; Dynamic.Parameter.Bool.set "-rte-pointer-call" true; Dynamic.Parameter.Bool.set "-rte-float-to-int" true; Dynamic.Parameter.Bool.set "-rte-div" true; Kernel.SignedDowncast.on (); Kernel.SignedOverflow.on (); if not(Ast.is_computed ()) then Ast.compute () ; print (); Globals.Functions.iter (fun kf -> !Db.RteGen.annotate_kf kf); print () ; print_status (); let emitter = Dynamic.get ~plugin:"RteGen" "emitter" Emitter.ty in let filter = function | Alarms.Overflow _ | Alarms.Division_by_zero _ -> true | _ -> false in Alarms.remove ~filter emitter; print (); print_status () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/rte/my_annotation/0000777000000000000000000000000013571573400016026 5ustar frama-c-20.0-Calcium/tests/rte/my_annotation/my_annotation.ml0000666000000000000000000000263113571573400021241 0ustar let print () = File.pretty_ast (); Kernel.log "================================" let print_status () = Kernel.log "printing status"; let _, _, get_signedOv_status = !Db.RteGen.get_signedOv_status () in Globals.Functions.iter (fun kf -> Kernel.log "kf = %s rte_gen_status = %b\n" (Kernel_function.get_name kf) (get_signedOv_status kf)) let main () = Dynamic.Parameter.Bool.set "-rte-mem" true; Dynamic.Parameter.Bool.set "-rte-pointer-call" true; Dynamic.Parameter.Bool.set "-rte-float-to-int" true; Dynamic.Parameter.Bool.set "-rte-div" true; Kernel.SignedDowncast.on (); Kernel.SignedOverflow.on (); if not(Ast.is_computed ()) then Ast.compute () ; print (); Globals.Functions.iter (fun kf -> !Db.RteGen.annotate_kf kf); print () ; print_status (); Kernel.log "Removing some rte annotations" ; let _, set_signed, _ = !Db.RteGen.get_signedOv_status () in let emitter = Dynamic.get ~plugin:"RteGen" "emitter" Emitter.ty in let filter = function | Alarms.Overflow _ -> true | _ -> false in Alarms.remove ~filter emitter; print (); print_status (); (* Dynamic.Parameter.Bool.set "-rte-all" true;*) let one_on_two = ref true in Globals.Functions.iter (fun kf -> if !one_on_two then begin set_signed kf false; !Db.RteGen.annotate_kf kf end; one_on_two := not !one_on_two); print () ; print_status () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/rte/noresult.c0000666000000000000000000000044713571573400015173 0ustar /* run.config OPT: -rte -warn-signed-overflow -print */ int x ; //@ ensures \result > 0 ; assigns x; int f(void); //@ ensures \result > 0 ; assigns \nothing; int g(void); //@ requires p > 0 ; ensures \result > 0 ; assigns \nothing; int h(int p); void job(void) { f(); g(); h(2); } frama-c-20.0-Calcium/tests/rte/oracle/0000777000000000000000000000000013571573400014414 5ustar frama-c-20.0-Calcium/tests/rte/oracle/addsub.res.oracle0000666000000000000000000000416513571573400017643 0ustar [kernel] Parsing tests/rte/addsub.c (with preprocessing) [rte] annotating function main [rte] tests/rte/addsub.c:9: Warning: guaranteed RTE: assert signed_overflow: 0x7fffffff + 0x7fffffff ≤ 2147483647; [rte] tests/rte/addsub.c:10: Warning: guaranteed RTE: assert signed_overflow: -2147483648 ≤ (int)(-0x7fffffff) - 0x7fffffff; [rte] tests/rte/addsub.c:11: Warning: guaranteed RTE: assert signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; [rte] tests/rte/addsub.c:11: Warning: guaranteed RTE: assert signed_overflow: -2147483648 ≤ (int)(-((int)((int)(-0x7fffffff) - 1))) - 1; /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; int z = 0; /*@ assert rte: signed_overflow: 0x7fffffff + 0x7fffffff ≤ 2147483647; */ z = 0x7fffffff + 0x7fffffff; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-0x7fffffff) - 0x7fffffff; */ z = -0x7fffffff - 0x7fffffff; /*@ assert rte: signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-((int)((int)(-0x7fffffff) - 1))) - 1; */ z = - (-0x7fffffff - 1) - 1; z = 0x7fffffff + 0; z = -0x7fffffff - 1; /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ z = x + y; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-0x7ffffffc) - y; */ z = -0x7ffffffc - y; /*@ assert rte: signed_overflow: -2147483647 ≤ x; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-x) - 0x7ffffffc; */ z = - x - 0x7ffffffc; /*@ assert rte: signed_overflow: 0x7ffffffc + y ≤ 2147483647; */ z = 0x7ffffffc + y; /*@ assert rte: signed_overflow: x + 0x7ffffffc ≤ 2147483647; */ z = x + 0x7ffffffc; /*@ assert rte: signed_overflow: -2147483648 ≤ y + (int)(-2); */ z = y + -2; /*@ assert rte: signed_overflow: y - (int)(-2) ≤ 2147483647; */ z = y - -2; z = -1 - y; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-2) - y; */ z = -2 - y; /*@ assert rte: signed_overflow: 0 - y ≤ 2147483647; */ z = 0 - y; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/addsub_typedef.res.oracle0000666000000000000000000000354413571573400021363 0ustar [kernel] Parsing tests/rte/addsub_typedef.c (with preprocessing) [rte] annotating function main [rte] tests/rte/addsub_typedef.c:11: Warning: guaranteed RTE: assert signed_overflow: 0x7fffffff + 0x7fffffff ≤ 2147483647; [rte] tests/rte/addsub_typedef.c:12: Warning: guaranteed RTE: assert signed_overflow: -2147483648 ≤ (int)(-0x7fffffff) - 0x7fffffff; [rte] tests/rte/addsub_typedef.c:13: Warning: guaranteed RTE: assert signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; [rte] tests/rte/addsub_typedef.c:13: Warning: guaranteed RTE: assert signed_overflow: -2147483648 ≤ (int)(-((int)((int)(-0x7fffffff) - 1))) - 1; /* Generated by Frama-C */ typedef int tint; int main(void) { int __retres; tint x = 0; tint y = 0; tint z = 0; /*@ assert rte: signed_overflow: 0x7fffffff + 0x7fffffff ≤ 2147483647; */ z = 0x7fffffff + 0x7fffffff; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-0x7fffffff) - 0x7fffffff; */ z = -0x7fffffff - 0x7fffffff; /*@ assert rte: signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-((int)((int)(-0x7fffffff) - 1))) - 1; */ z = - (-0x7fffffff - 1) - 1; z = 0x7fffffff + 0; z = -0x7fffffff - 1; /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ z = x + y; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-0x7ffffffc) - y; */ z = -0x7ffffffc - y; /*@ assert rte: signed_overflow: -2147483647 ≤ x; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-x) - 0x7ffffffc; */ z = - x - 0x7ffffffc; /*@ assert rte: signed_overflow: 0x7ffffffc + y ≤ 2147483647; */ z = 0x7ffffffc + y; /*@ assert rte: signed_overflow: x + 0x7ffffffc ≤ 2147483647; */ z = x + 0x7ffffffc; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/addsub_unsigned.0.res.oracle0000666000000000000000000000057313571573400021674 0ustar [kernel] Parsing tests/rte/addsub_unsigned.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; unsigned int ux; unsigned int uy; unsigned int uz; ux = 0x7FFFFFFFU * (unsigned int)2; uy = 0x80000000U + 0x80000000U; uy = 2U * 0x80000000U; uz = ux + (unsigned int)2; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/addsub_unsigned.1.res.oracle0000666000000000000000000000156013571573400021672 0ustar [kernel] Parsing tests/rte/addsub_unsigned.c (with preprocessing) [rte] annotating function main [rte] tests/rte/addsub_unsigned.c:12: Warning: guaranteed RTE: assert unsigned_overflow: 0x80000000U + 0x80000000U ≤ 4294967295; [rte] tests/rte/addsub_unsigned.c:14: Warning: guaranteed RTE: assert unsigned_overflow: 2U * 0x80000000U ≤ 4294967295; /* Generated by Frama-C */ int main(void) { int __retres; unsigned int ux; unsigned int uy; unsigned int uz; ux = 0x7FFFFFFFU * (unsigned int)2; /*@ assert rte: unsigned_overflow: 0x80000000U + 0x80000000U ≤ 4294967295; */ uy = 0x80000000U + 0x80000000U; /*@ assert rte: unsigned_overflow: 2U * 0x80000000U ≤ 4294967295; */ uy = 2U * 0x80000000U; /*@ assert rte: unsigned_overflow: ux + (unsigned int)2 ≤ 4294967295; */ uz = ux + (unsigned int)2; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/addsub_unsigned_typedef.0.res.oracle0000666000000000000000000000057613571573400023417 0ustar [kernel] Parsing tests/rte/addsub_unsigned_typedef.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ typedef unsigned int uint; int main(void) { int __retres; uint ux; uint uy; uint uz; ux = 0x7FFFFFFFU * (unsigned int)2; uy = 0x80000000U + 0x80000000U; uy = 2U * 0x80000000U; uz = ux + (uint)2; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/addsub_unsigned_typedef.1.res.oracle0000666000000000000000000000160313571573400023410 0ustar [kernel] Parsing tests/rte/addsub_unsigned_typedef.c (with preprocessing) [rte] annotating function main [rte] tests/rte/addsub_unsigned_typedef.c:14: Warning: guaranteed RTE: assert unsigned_overflow: 0x80000000U + 0x80000000U ≤ 4294967295; [rte] tests/rte/addsub_unsigned_typedef.c:16: Warning: guaranteed RTE: assert unsigned_overflow: 2U * 0x80000000U ≤ 4294967295; /* Generated by Frama-C */ typedef unsigned int uint; int main(void) { int __retres; uint ux; uint uy; uint uz; ux = 0x7FFFFFFFU * (unsigned int)2; /*@ assert rte: unsigned_overflow: 0x80000000U + 0x80000000U ≤ 4294967295; */ uy = 0x80000000U + 0x80000000U; /*@ assert rte: unsigned_overflow: 2U * 0x80000000U ≤ 4294967295; */ uy = 2U * 0x80000000U; /*@ assert rte: unsigned_overflow: ux + (unsigned int)2 ≤ 4294967295; */ uz = ux + (uint)2; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/array_index.0.res.oracle0000666000000000000000000001131213571573400021034 0ustar [kernel] Parsing tests/rte/array_index.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ struct s_arr { int t[15] ; }; struct __anonstruct_s_1 { int u[12] ; }; struct _s { int t[15] ; struct __anonstruct_s_1 s ; struct s_arr v[12] ; }; typedef struct _s ts; int t[10]; int u[8 + 3]; int v[16][17]; ts s; unsigned int c[10]; void main(int i, int j, unsigned int k) { int x; int t_0[(unsigned int)100 / sizeof(x)]; t[0] = 0; u[1] = 0; v[2][3] = 0; s.t[1] = 0; s.s.u[2] = 0; s.v[3].t[4] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 10; */ t[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < (int)(8 + 3); */ u[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 16; */ /*@ assert rte: index_bound: 0 ≤ j; */ /*@ assert rte: index_bound: j < 17; */ v[i][j] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 15; */ s.t[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 12; */ s.s.u[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 12; */ /*@ assert rte: index_bound: 0 ≤ j; */ /*@ assert rte: index_bound: j < 15; */ s.v[i].t[j] = 0; /*@ assert rte: index_bound: k < 10; */ t[k] = 0; /*@ assert rte: index_bound: k < (int)(8 + 3); */ u[k] = 0; /*@ assert rte: index_bound: k < 16; */ /*@ assert rte: index_bound: c[k] < 17; */ /*@ assert rte: index_bound: k < 10; */ v[k][c[k]] = 0; /*@ assert rte: index_bound: k < 15; */ s.t[k] = 0; /*@ assert rte: index_bound: k < 12; */ s.s.u[k] = 0; /*@ assert rte: index_bound: k < 12; */ /*@ assert rte: index_bound: c[k] < 15; */ /*@ assert rte: index_bound: k < 10; */ s.v[k].t[c[k]] = 0; return; } [rte] annotating function main /* Generated by Frama-C */ struct s_arr { int t[15] ; }; struct __anonstruct_s_1 { int u[12] ; }; struct _s { int t[15] ; struct __anonstruct_s_1 s ; struct s_arr v[12] ; }; typedef struct _s ts; int t[10]; int u[8 + 3]; int v[16][17]; ts s; unsigned int c[10]; void main(int i, int j, unsigned int k) { int x; int t_0[(unsigned int)100 / sizeof(x)]; /*@ assert rte: index_bound: 0 ≤ 0; */ /*@ assert rte: index_bound: 0 < 10; */ t[0] = 0; /*@ assert rte: index_bound: 0 ≤ 1; */ /*@ assert rte: index_bound: 1 < (int)(8 + 3); */ u[1] = 0; /*@ assert rte: index_bound: 0 ≤ 2; */ /*@ assert rte: index_bound: 2 < 16; */ /*@ assert rte: index_bound: 0 ≤ 3; */ /*@ assert rte: index_bound: 3 < 17; */ v[2][3] = 0; /*@ assert rte: index_bound: 0 ≤ 1; */ /*@ assert rte: index_bound: 1 < 15; */ s.t[1] = 0; /*@ assert rte: index_bound: 0 ≤ 2; */ /*@ assert rte: index_bound: 2 < 12; */ s.s.u[2] = 0; /*@ assert rte: index_bound: 0 ≤ 3; */ /*@ assert rte: index_bound: 3 < 12; */ /*@ assert rte: index_bound: 0 ≤ 4; */ /*@ assert rte: index_bound: 4 < 15; */ s.v[3].t[4] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 10; */ t[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < (int)(8 + 3); */ u[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 16; */ /*@ assert rte: index_bound: 0 ≤ j; */ /*@ assert rte: index_bound: j < 17; */ v[i][j] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 15; */ s.t[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 12; */ s.s.u[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 12; */ /*@ assert rte: index_bound: 0 ≤ j; */ /*@ assert rte: index_bound: j < 15; */ s.v[i].t[j] = 0; /*@ assert rte: index_bound: k < 10; */ /*@ assert rte: index_bound: 0 ≤ k; */ t[k] = 0; /*@ assert rte: index_bound: k < (int)(8 + 3); */ /*@ assert rte: index_bound: 0 ≤ k; */ u[k] = 0; /*@ assert rte: index_bound: k < 16; */ /*@ assert rte: index_bound: c[k] < 17; */ /*@ assert rte: index_bound: k < 10; */ /*@ assert rte: index_bound: 0 ≤ k; */ /*@ assert rte: index_bound: 0 ≤ c[k]; */ /*@ assert rte: index_bound: 0 ≤ k; */ v[k][c[k]] = 0; /*@ assert rte: index_bound: k < 15; */ /*@ assert rte: index_bound: 0 ≤ k; */ s.t[k] = 0; /*@ assert rte: index_bound: k < 12; */ /*@ assert rte: index_bound: 0 ≤ k; */ s.s.u[k] = 0; /*@ assert rte: index_bound: k < 12; */ /*@ assert rte: index_bound: c[k] < 15; */ /*@ assert rte: index_bound: k < 10; */ /*@ assert rte: index_bound: 0 ≤ k; */ /*@ assert rte: index_bound: 0 ≤ c[k]; */ /*@ assert rte: index_bound: 0 ≤ k; */ s.v[k].t[c[k]] = 0; return; } frama-c-20.0-Calcium/tests/rte/oracle/array_index.1.res.oracle0000666000000000000000000000345413571573400021045 0ustar [kernel] Parsing tests/rte/array_index.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ struct s_arr { int t[15] ; }; struct __anonstruct_s_1 { int u[12] ; }; struct _s { int t[15] ; struct __anonstruct_s_1 s ; struct s_arr v[12] ; }; typedef struct _s ts; int t[10]; int u[8 + 3]; int v[16][17]; ts s; unsigned int c[10]; void main(int i, int j, unsigned int k) { int x; int t_0[(unsigned int)100 / sizeof(x)]; t[0] = 0; u[1] = 0; v[2][3] = 0; /*@ assert rte: mem_access: \valid(&s.t[1]); */ s.t[1] = 0; /*@ assert rte: mem_access: \valid(&s.s.u[2]); */ s.s.u[2] = 0; /*@ assert rte: mem_access: \valid(&s.v[3].t[4]); */ s.v[3].t[4] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 10; */ t[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < (int)(8 + 3); */ u[i] = 0; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 16; */ /*@ assert rte: index_bound: 0 ≤ j; */ /*@ assert rte: index_bound: j < 17; */ v[i][j] = 0; /*@ assert rte: mem_access: \valid(&s.t[i]); */ s.t[i] = 0; /*@ assert rte: mem_access: \valid(&s.s.u[i]); */ s.s.u[i] = 0; /*@ assert rte: mem_access: \valid(&s.v[i].t[j]); */ s.v[i].t[j] = 0; /*@ assert rte: index_bound: k < 10; */ t[k] = 0; /*@ assert rte: index_bound: k < (int)(8 + 3); */ u[k] = 0; /*@ assert rte: index_bound: k < 16; */ /*@ assert rte: index_bound: c[k] < 17; */ /*@ assert rte: index_bound: k < 10; */ v[k][c[k]] = 0; /*@ assert rte: mem_access: \valid(&s.t[k]); */ s.t[k] = 0; /*@ assert rte: mem_access: \valid(&s.s.u[k]); */ s.s.u[k] = 0; /*@ assert rte: mem_access: \valid(&s.v[k].t[c[k]]); */ /*@ assert rte: index_bound: k < 10; */ s.v[k].t[c[k]] = 0; return; } frama-c-20.0-Calcium/tests/rte/oracle/assign.res.oracle0000666000000000000000000000352613571573400017665 0ustar [kernel] Parsing tests/rte/assign.c (with preprocessing) [rte] annotating function rte /* Generated by Frama-C */ int global_x; int global_y; /*@ assigns \nothing; */ void g(void); /*@ assigns \nothing; */ int fnd1(void); /*@ assigns global_x; */ int fnd2(void); /*@ assigns global_x, global_y; */ int fnd3(void); int fnd4(void); /*@ assigns global_x; behavior normal: assumes cond ≢ 0; assigns \nothing; behavior other: assumes cond ≡ 0; assigns global_x; */ int fnd5(int cond); /*@ assigns \nothing; */ int fnd6(void); /*@ assigns *x; assigns *x \from *y; */ int fnd7(int *x, int *y); int rte(int cond) { int __retres; int a; int b; int tmp; g(); tmp = fnd1(); if (tmp) { int tmp_0; tmp_0 = fnd2(); if (tmp_0) { int tmp_1; tmp_1 = fnd3(); if (tmp_1) { int tmp_2; tmp_2 = fnd4(); if (tmp_2) { int tmp_3; tmp_3 = fnd5(cond); if (tmp_3) { int tmp_4; tmp_4 = fnd6(); if (tmp_4) { int tmp_5; tmp_5 = fnd7(& a,& b); if (tmp_5) { __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } } else { __retres = 0; goto return_label; } } else { __retres = 0; goto return_label; } } else { __retres = 0; goto return_label; } } else { __retres = 0; goto return_label; } } else { __retres = 0; goto return_label; } } else { __retres = 0; goto return_label; } return_label: return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/assign2.res.oracle0000666000000000000000000000104413571573400017740 0ustar [kernel] Parsing tests/rte/assign2.c (with preprocessing) [rte] annotating function f [rte] annotating function main /* Generated by Frama-C */ int i; int t[10]; /*@ ensures 0 ≤ \result ≤ 0; */ int any(void); /*@ ensures t[i] ≡ \old(t[\at(i,Here)]) + 1; ensures \let j = i; t[j] ≡ \old(t[j]) + 1; assigns i, t[\at(i,Post)]; */ void f(void) { i = any(); /*@ assert rte: signed_overflow: t[i] + 1 ≤ 2147483647; */ (t[i]) ++; return; } int main(void) { int __retres; f(); f(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/assign3.res.oracle0000666000000000000000000000042013571573400017736 0ustar [kernel] Parsing tests/rte/assign3.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ /*@ assigns \nothing; */ int f(void); int main(void) { int __retres; int i; int t[10]; i = 0; t[i] = f(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/assign4.res.oracle0000666000000000000000000000115513571573400017745 0ustar [kernel] Parsing tests/rte/assign4.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ /*@ assigns \result; assigns \result \from min, max; */ int choose1(int min, int max); /*@ assigns \result, \result; assigns \result \from min, max, min, max; assigns \result \from min, max, min, max; */ int choose2(int min, int max); int main(void) { int __retres; int c1 = choose1(5,10); int c2 = choose2(0,c1); /*@ assert rte: signed_overflow: -2147483648 ≤ c1 + c2; */ /*@ assert rte: signed_overflow: c1 + c2 ≤ 2147483647; */ __retres = c1 + c2; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/assign5.res.oracle0000666000000000000000000000073513571573400017751 0ustar [kernel] Parsing tests/rte/assign5.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ /*@ assigns *p, *p; assigns *p \from x; assigns *p \from \nothing; */ int f(int *p, int x); /*@ assigns *p, *p; assigns *p \from \nothing; assigns *p \from x; */ int g(int *p, int x); int main(void) { int __retres; int i; int a; int t[10]; i = 0; a = 0; t[0] = f(& i,a); t[1] = g(& i,a); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/assign6.res.oracle0000666000000000000000000000050013571573400017740 0ustar [kernel] Parsing tests/rte/assign6.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ int z; /*@ assigns z, \result; assigns z \from y; assigns \result \from x, y; */ int f(int x, int y); int main(void) { int a; int b; a = f(0,0); a = f(0,b); a = f(b,0); return a; } frama-c-20.0-Calcium/tests/rte/oracle/assign7.res.oracle0000666000000000000000000000140713571573400017750 0ustar [kernel] Parsing tests/rte/assign7.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ /*@ assigns *p; assigns *p \from {*((char *)p), *q}; */ extern void f(int *p, int *q); /*@ assigns *p; assigns *p \from \union(*p, {*r, *q}); */ extern void ff(int *p, int *q, int *r); /*@ assigns *p; assigns *p \from \inter(*((char *)p), *q); */ extern void h(int *p, int *q); /*@ assigns {*p, *q}; */ extern void g(int *p, int *q); /*@ assigns \at(*\old(p),Post), \at(*p,Pre), *p; */ extern void gg(int *p); int X; int Y; /*@ assigns {X, Y}; */ void hh(void); int main(void) { int __retres; int x; int y; int z; f(& x,& y); ff(& x,& y,& z); g(& x,& y); h(& x,& y); gg(& x); hh(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/bool.res.oracle0000666000000000000000000000464513571573400017337 0ustar [kernel] Parsing tests/rte/bool.i (no preprocessing) [rte] annotating function ko1 [rte] annotating function ko2 [rte] annotating function ok1 [rte] annotating function ok2 /* Generated by Frama-C */ struct s_bool { char c ; _Bool b ; }; struct s_bool sb; _Bool ko1(void) { _Bool __retres; char *p = & sb.c; /*@ assert rte: mem_access: \valid(p + 1); */ *(p + 1) = (char)17; /*@ assert rte: bool_value: sb.b ≡ 0 ∨ sb.b ≡ 1; */ __retres = sb.b; return __retres; } _Bool ko2(void) { _Bool b; char *p = (char *)(& b); /*@ assert rte: mem_access: \valid(p); */ *p = (char)17; /*@ assert rte: bool_value: b ≡ 0 ∨ b ≡ 1; */ return b; } extern _Bool f(void); _Bool ok1(void) { _Bool __retres; _Bool x = f(); _Bool y = ko2(); if (x) { __retres = y; goto return_label; } __retres = x; return_label: return __retres; } extern int g(_Bool, _Bool); _Bool ok2(int a, _Bool b) { _Bool __retres; int tmp; tmp = g((_Bool)(a > 0),b); __retres = (_Bool)(tmp != 0); return __retres; } [rte] annotating function ko1 [rte] annotating function ko2 [rte] annotating function ok1 [rte] annotating function ok2 /* Generated by Frama-C */ struct s_bool { char c ; _Bool b ; }; struct s_bool sb; _Bool ko1(void) { _Bool __retres; char *p = & sb.c; /*@ assert rte: mem_access: \valid(p + 1); */ *(p + 1) = (char)17; /*@ assert rte: bool_value: sb.b ≡ 0 ∨ sb.b ≡ 1; */ __retres = sb.b; /*@ assert rte: bool_value: __retres ≡ 0 ∨ __retres ≡ 1; */ return __retres; } _Bool ko2(void) { _Bool b; char *p = (char *)(& b); /*@ assert rte: mem_access: \valid(p); */ *p = (char)17; /*@ assert rte: bool_value: b ≡ 0 ∨ b ≡ 1; */ return b; } extern _Bool f(void); _Bool ok1(void) { _Bool __retres; _Bool x = f(); _Bool y = ko2(); /*@ assert rte: bool_value: x ≡ 0 ∨ x ≡ 1; */ if (x) { /*@ assert rte: bool_value: y ≡ 0 ∨ y ≡ 1; */ __retres = y; goto return_label; } /*@ assert rte: bool_value: x ≡ 0 ∨ x ≡ 1; */ __retres = x; return_label: /*@ assert rte: bool_value: __retres ≡ 0 ∨ __retres ≡ 1; */ return __retres; } extern int g(_Bool, _Bool); _Bool ok2(int a, _Bool b) { _Bool __retres; int tmp; /*@ assert rte: bool_value: b ≡ 0 ∨ b ≡ 1; */ tmp = g((_Bool)(a > 0),b); __retres = (_Bool)(tmp != 0); /*@ assert rte: bool_value: __retres ≡ 0 ∨ __retres ≡ 1; */ return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/bts0567.res.oracle0000666000000000000000000000032413571573400017504 0ustar [kernel] Parsing tests/rte/bts0567.c (with preprocessing) [rte] annotating function g /* Generated by Frama-C */ int tab[2]; /*@ requires \valid(p + 1); */ void f(int *p); void g(void) { f(tab); return; } frama-c-20.0-Calcium/tests/rte/oracle/bts0576.res.oracle0000666000000000000000000000161113571573400017504 0ustar [kernel] Parsing tests/rte/bts0576.c (with preprocessing) [kernel] tests/rte/bts0576.c:6: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [kernel] tests/rte/bts0576.c:6: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [rte] annotating function f4 [rte] annotating function g4 /* Generated by Frama-C */ typedef double typetab[2]; /*@ requires \valid(t) ∧ \valid(t + (0 .. 0)) ∧ \valid((double *)t + (0 .. 1)); */ double g4(typetab *t) { double y; /*@ assert rte: mem_access: \valid_read((double *)*t); */ /*@ assert rte: mem_access: \valid_read(&(*t)[1]); */ y = (*t)[0] + (*t)[1]; return y; } /*@ assigns \nothing; */ double f4(void) { double tab[2]; double r; tab[0] = 1.0; tab[1] = 2.0; r = g4(& tab); return r; } frama-c-20.0-Calcium/tests/rte/oracle/bts0580.res.oracle0000666000000000000000000000053613571573400017504 0ustar [kernel] Parsing tests/rte/bts0580.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ struct ArrayStruct { int data[10] ; }; struct ArrayStruct buff; int main(int i) { int __retres; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 10; */ __retres = buff.data[i]; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/bts0580_2.res.oracle0000666000000000000000000000167113571573400017726 0ustar [kernel] Parsing tests/rte/bts0580_2.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ struct S { int val ; struct S *next ; }; struct C { struct S cell[5] ; int (*f)(int ) ; }; struct ArrayStruct { struct C data[10] ; }; struct ArrayStruct buff; int main(int i) { int __retres; int a; int b; int d; int c[3]; int *p; int (*f)(int ); /*@ assert rte: mem_access: \valid_read(p); */ /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 10; */ /*@ assert rte: index_bound: 0 ≤ *p; */ /*@ assert rte: index_bound: *p < 5; */ /*@ assert rte: mem_access: \valid_read(&(buff.data[i].cell[*p].next)->val); */ a = (buff.data[i].cell[*p].next)->val; /*@ assert rte: index_bound: 0 ≤ c[2]; */ /*@ assert rte: index_bound: c[2] < 10; */ b = (*(buff.data[c[2]].f))(c[1]); d = (*f)(buff.data[0].cell[0].val); __retres = a > b; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/bts1052.res.oracle0000666000000000000000000000043413571573400017474 0ustar [kernel] Parsing tests/rte/bts1052.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ /*@ ensures \let count = \old(d); \result ≡ count; assigns \nothing; */ int op(int d); int x; int y; void main(void) { x = op(33); y = op(31); return; } frama-c-20.0-Calcium/tests/rte/oracle/bts2314.res.oracle0000666000000000000000000000116613571573400017501 0ustar [kernel] Parsing tests/rte/bts2314.i (no preprocessing) [rte] annotating function foo /* Generated by Frama-C */ struct STR { int num : 7 ; }; void foo(int a, long b) { struct STR s = {.num = (int)0}; /*@ assert rte: signed_downcast: b ≤ 63; */ /*@ assert rte: signed_downcast: -64 ≤ b; */ s.num = (int)b; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)s.num + a; */ /*@ assert rte: signed_overflow: (int)s.num + a ≤ 2147483647; */ /*@ assert rte: signed_downcast: (int)s.num + a ≤ 63; */ /*@ assert rte: signed_downcast: -64 ≤ (int)s.num + a; */ s.num = (int)((int)s.num + a); return; } frama-c-20.0-Calcium/tests/rte/oracle/bts621.res.oracle0000666000000000000000000000053313571573400017415 0ustar [kernel] Parsing tests/rte/bts621.c (with preprocessing) /* Generated by Frama-C */ /*@ assigns *p; */ float g(float *p); void f(float a) { /*@ ghost float x = g(& a); */ return; } [rte] annotating function f /* Generated by Frama-C */ /*@ assigns *p; */ float g(float *p); void f(float a) { /*@ ghost float x = g(& a); */ return; } frama-c-20.0-Calcium/tests/rte/oracle/castoncall.0.res.oracle0000666000000000000000000000143513571573400020657 0ustar [kernel] Parsing tests/rte/castoncall.c (with preprocessing) [rte] annotating function g [rte] annotating function nondet_ptr /* Generated by Frama-C */ /*@ ensures \result ≡ \old(a) ∨ \result ≡ \old(b); assigns \result; assigns \result \from a, b; */ int nondet(int a, int b); /*@ ensures \result ≡ \old(a) ∨ \result ≡ \old(b); assigns \result; assigns \result \from a, b; */ void *nondet_ptr(void *a, void *b) { void *__retres; int tmp; tmp = nondet((int)a,(int)b); __retres = (void *)tmp; return __retres; } /*@ ensures \result ≡ 1; assigns \nothing; */ int f(void); void g(void) { int tmp; tmp = f(); /*@ assert rte: signed_downcast: tmp ≤ 127; */ /*@ assert rte: signed_downcast: -128 ≤ tmp; */ char c = (char)tmp; return; } frama-c-20.0-Calcium/tests/rte/oracle/castoncall.1.res.oracle0000666000000000000000000000143513571573400020660 0ustar [kernel] Parsing tests/rte/castoncall.c (with preprocessing) [rte] annotating function g [rte] annotating function nondet_ptr /* Generated by Frama-C */ /*@ ensures \result ≡ \old(a) ∨ \result ≡ \old(b); assigns \result; assigns \result \from a, b; */ int nondet(int a, int b); /*@ ensures \result ≡ \old(a) ∨ \result ≡ \old(b); assigns \result; assigns \result \from a, b; */ void *nondet_ptr(void *a, void *b) { void *__retres; int tmp; tmp = nondet((int)a,(int)b); __retres = (void *)tmp; return __retres; } /*@ ensures \result ≡ 1; assigns \nothing; */ int f(void); void g(void) { int tmp; tmp = f(); /*@ assert rte: signed_downcast: tmp ≤ 127; */ /*@ assert rte: signed_downcast: -128 ≤ tmp; */ char c = (char)tmp; return; } frama-c-20.0-Calcium/tests/rte/oracle/divmod.res.oracle0000666000000000000000000000556313571573400017666 0ustar [kernel] Parsing tests/rte/divmod.c (with preprocessing) [rte] annotating function main [rte] tests/rte/divmod.c:13: Warning: guaranteed RTE: assert signed_overflow: (int)((int)(-2147483647) - 1) / (int)(-1) ≤ 2147483647; [rte] tests/rte/divmod.c:16: Warning: guaranteed RTE: assert division_by_zero: 0 ≢ 0; [rte] tests/rte/divmod.c:17: Warning: guaranteed RTE: assert division_by_zero: (unsigned int)(0xffffffff + 1) ≢ 0; [rte] tests/rte/divmod.c:24: Warning: guaranteed RTE: assert division_by_zero: (unsigned int)(0xffffffff + 1) ≢ 0; [rte] tests/rte/divmod.c:25: Warning: guaranteed RTE: assert signed_overflow: (int)((int)(-0x7fffffff) - 1) / (int)(-1) ≤ 2147483647; [rte] tests/rte/divmod.c:36: Warning: guaranteed RTE: assert signed_downcast: (long long)(-2147483648L) / (long long)((long)(-1L)) ≤ 2147483647; /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; int z = 0; unsigned int ux = (unsigned int)0; unsigned int uy = (unsigned int)0; unsigned int uz = (unsigned int)0; /*@ assert rte: signed_overflow: (int)((int)(-2147483647) - 1) / (int)(-1) ≤ 2147483647; */ z = (-2147483647 - 1) / -1; z = (-2147483647 - 1) % -1; /*@ assert rte: division_by_zero: 0 ≢ 0; */ uz = (unsigned int)(1 / 0); /*@ assert rte: division_by_zero: (unsigned int)(0xffffffff + 1) ≢ 0; */ uz = (unsigned int)1 / (0xffffffff + (unsigned int)1); ux = 0x80000000; uy = 0xffffffff; /*@ assert rte: signed_downcast: ux ≤ 2147483647; */ /*@ assert rte: signed_downcast: uy ≤ 2147483647; */ /*@ assert rte: division_by_zero: (int)uy ≢ 0; */ /*@ assert rte: signed_overflow: (int)ux / (int)uy ≤ 2147483647; */ uz = (unsigned int)((int)ux / (int)uy); /*@ assert rte: division_by_zero: uy ≢ 0; */ uz = ux / uy; /*@ assert rte: division_by_zero: (unsigned int)(0xffffffff + 1) ≢ 0; */ uz = 0x80000000 / (0xffffffff + (unsigned int)1); /*@ assert rte: signed_overflow: (int)((int)(-0x7fffffff) - 1) / (int)(-1) ≤ 2147483647; */ uz = (unsigned int)((-0x7fffffff - 1) / -1); uz = (unsigned int)(-0x7fffffff - 1) / 0xffffffff; uz = 0x80000000 / (unsigned int)(-1); uz = (unsigned int)((int)(0x80000000 / 0xffffffff)); /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ /*@ assert rte: division_by_zero: (int)(x + y) ≢ 0; */ z = 1 / (x + y); /*@ assert rte: signed_overflow: x / (int)(-1) ≤ 2147483647; */ z = x / -1; /*@ assert rte: division_by_zero: y ≢ 0; */ z = (-0x7ffffff - 1) / y; /*@ assert rte: signed_downcast: (long long)(-2147483648L) / (long long)((long)(-1L)) ≤ 2147483647; */ z = (int)(-2147483648L / (long long)(-1L)); z = (int)(0x80000000 / (unsigned int)(-1)); z = (int)(0x80000000 / 0xffffffff); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/divmod_typedef.res.oracle0000666000000000000000000000570713571573400021406 0ustar [kernel] Parsing tests/rte/divmod_typedef.c (with preprocessing) [rte] annotating function main [rte] tests/rte/divmod_typedef.c:15: Warning: guaranteed RTE: assert signed_overflow: (int)((int)(-2147483647) - 1) / (int)(-1) ≤ 2147483647; [rte] tests/rte/divmod_typedef.c:18: Warning: guaranteed RTE: assert division_by_zero: 0 ≢ 0; [rte] tests/rte/divmod_typedef.c:19: Warning: guaranteed RTE: assert division_by_zero: (unsigned int)(0xffffffff + 1) ≢ 0; [rte] tests/rte/divmod_typedef.c:26: Warning: guaranteed RTE: assert division_by_zero: (unsigned int)(0xffffffff + 1) ≢ 0; [rte] tests/rte/divmod_typedef.c:27: Warning: guaranteed RTE: assert signed_overflow: (int)((int)(-0x7fffffff) - 1) / (int)(-1) ≤ 2147483647; [rte] tests/rte/divmod_typedef.c:38: Warning: guaranteed RTE: assert signed_downcast: (long long)(-2147483648L) / (long long)((long)(-1L)) ≤ 2147483647; /* Generated by Frama-C */ typedef int tint; typedef unsigned int tuint; int main(void) { int __retres; tint x = 0; tint y = 0; tint z = 0; tuint ux = (unsigned int)0; tuint uy = (unsigned int)0; tuint uz = (unsigned int)0; /*@ assert rte: signed_overflow: (int)((int)(-2147483647) - 1) / (int)(-1) ≤ 2147483647; */ z = (-2147483647 - 1) / -1; z = (-2147483647 - 1) % -1; /*@ assert rte: division_by_zero: 0 ≢ 0; */ uz = (unsigned int)(1 / 0); /*@ assert rte: division_by_zero: (unsigned int)(0xffffffff + 1) ≢ 0; */ uz = (unsigned int)1 / (0xffffffff + (unsigned int)1); ux = 0x80000000; uy = 0xffffffff; /*@ assert rte: signed_downcast: ux ≤ 2147483647; */ /*@ assert rte: signed_downcast: uy ≤ 2147483647; */ /*@ assert rte: division_by_zero: (int)uy ≢ 0; */ /*@ assert rte: signed_overflow: (int)ux / (int)uy ≤ 2147483647; */ uz = (unsigned int)((int)ux / (int)uy); /*@ assert rte: division_by_zero: uy ≢ 0; */ uz = ux / uy; /*@ assert rte: division_by_zero: (unsigned int)(0xffffffff + 1) ≢ 0; */ uz = 0x80000000 / (0xffffffff + (unsigned int)1); /*@ assert rte: signed_overflow: (int)((int)(-0x7fffffff) - 1) / (int)(-1) ≤ 2147483647; */ uz = (unsigned int)((-0x7fffffff - 1) / -1); uz = (unsigned int)(-0x7fffffff - 1) / 0xffffffff; uz = 0x80000000 / (unsigned int)(-1); uz = (unsigned int)((int)(0x80000000 / 0xffffffff)); /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ /*@ assert rte: division_by_zero: (int)(x + y) ≢ 0; */ z = 1 / (x + y); /*@ assert rte: signed_overflow: x / (int)(-1) ≤ 2147483647; */ z = x / -1; /*@ assert rte: division_by_zero: y ≢ 0; */ z = (-0x7ffffff - 1) / y; /*@ assert rte: signed_downcast: (long long)(-2147483648L) / (long long)((long)(-1L)) ≤ 2147483647; */ z = (int)(-2147483648L / (long long)(-1L)); z = (int)(0x80000000 / (unsigned int)(-1)); z = (int)(0x80000000 / 0xffffffff); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/downcast.0.res.oracle0000666000000000000000000000176413571573400020363 0ustar [kernel] Parsing tests/rte/downcast.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; signed char sx; signed char sy; signed char sz; unsigned char uc; int x; unsigned int ux; unsigned int uy; unsigned int uz; unsigned short s; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)sx + (int)sy; */ /*@ assert rte: signed_overflow: (int)sx + (int)sy ≤ 2147483647; */ /*@ assert rte: signed_downcast: (int)sx + (int)sy ≤ 127; */ /*@ assert rte: signed_downcast: -128 ≤ (int)sx + (int)sy; */ sz = (signed char)((int)sx + (int)sy); /*@ assert rte: signed_overflow: -2147483648 ≤ (int)sx + (int)sy; */ /*@ assert rte: signed_overflow: (int)sx + (int)sy ≤ 2147483647; */ uc = (unsigned char)((int)sx + (int)sy); uc = (unsigned char)x; /*@ assert rte: signed_downcast: uy + uz ≤ 2147483647; */ x = (int)(uy + uz); ux = uy + uz; s = (unsigned short)(uy + uz); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/downcast.1.res.oracle0000666000000000000000000000146313571573400020360 0ustar [kernel] Parsing tests/rte/downcast.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; signed char sx; signed char sy; signed char sz; unsigned char uc; int x; unsigned int ux; unsigned int uy; unsigned int uz; unsigned short s; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)sx + (int)sy; */ /*@ assert rte: signed_overflow: (int)sx + (int)sy ≤ 2147483647; */ sz = (signed char)((int)sx + (int)sy); /*@ assert rte: signed_overflow: -2147483648 ≤ (int)sx + (int)sy; */ /*@ assert rte: signed_overflow: (int)sx + (int)sy ≤ 2147483647; */ uc = (unsigned char)((int)sx + (int)sy); uc = (unsigned char)x; x = (int)(uy + uz); ux = uy + uz; s = (unsigned short)(uy + uz); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/downcast.2.res.oracle0000666000000000000000000000242713571573400020362 0ustar [kernel] Parsing tests/rte/downcast.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; signed char sx; signed char sy; signed char sz; unsigned char uc; int x; unsigned int ux; unsigned int uy; unsigned int uz; unsigned short s; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)sx + (int)sy; */ /*@ assert rte: signed_overflow: (int)sx + (int)sy ≤ 2147483647; */ /*@ assert rte: signed_downcast: (int)sx + (int)sy ≤ 127; */ /*@ assert rte: signed_downcast: -128 ≤ (int)sx + (int)sy; */ sz = (signed char)((int)sx + (int)sy); /*@ assert rte: signed_overflow: -2147483648 ≤ (int)sx + (int)sy; */ /*@ assert rte: signed_overflow: (int)sx + (int)sy ≤ 2147483647; */ /*@ assert rte: unsigned_downcast: (int)sx + (int)sy ≤ 255; */ /*@ assert rte: unsigned_downcast: 0 ≤ (int)sx + (int)sy; */ uc = (unsigned char)((int)sx + (int)sy); /*@ assert rte: unsigned_downcast: x ≤ 255; */ /*@ assert rte: unsigned_downcast: 0 ≤ x; */ uc = (unsigned char)x; /*@ assert rte: signed_downcast: uy + uz ≤ 2147483647; */ x = (int)(uy + uz); ux = uy + uz; /*@ assert rte: unsigned_downcast: uy + uz ≤ 65535; */ s = (unsigned short)(uy + uz); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/finite_float.res.oracle0000666000000000000000000000073213571573400021040 0ustar [kernel] Parsing tests/rte/finite_float.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ #include "errno.h" #include "math.h" void main(void) { /*@ assert rte: is_nan_or_infinite: \is_finite(0x1p10000); */ double d = 0x1p10000; d = 0.; /*@ assert rte: is_nan_or_infinite: \is_finite((double)(d / d)); */ /*@ assert rte: is_nan_or_infinite: \is_finite((double)((double)(d / d) + d)); */ double e = d / d + d; return; } frama-c-20.0-Calcium/tests/rte/oracle/float_to_int.res.oracle0000666000000000000000000000250013571573400021051 0ustar [kernel] Parsing tests/rte/float_to_int.c (with preprocessing) [kernel:parser:decimal-float] tests/rte/float_to_int.c:13: Warning: Floating-point constant 1.5e255 is not represented exactly. Will use 0x1.99309cc247f15p847. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [rte] annotating function main [rte] tests/rte/float_to_int.c:14: Warning: guaranteed RTE: assert float_to_int: 258. < 128; [rte] tests/rte/float_to_int.c:16: Warning: guaranteed RTE: assert float_to_int: -2147483649 < -2147483649.5; /* Generated by Frama-C */ void main(void) { float f = (float)0.; /*@ assert rte: float_to_int: f < 2147483648; */ /*@ assert rte: float_to_int: -2147483649 < f; */ int i = (int)f; /*@ assert rte: float_to_int: f < 9223372036854775808; */ /*@ assert rte: float_to_int: -9223372036854775809 < f; */ long long l = (long long)f; /*@ assert rte: float_to_int: f < 65536; */ /*@ assert rte: float_to_int: -1 < f; */ unsigned short s = (unsigned short)f; int ci1 = (int)1.5; /*@ assert rte: float_to_int: 1.5e255 < 2147483648; */ int ci2 = (int)1.5e255; /*@ assert rte: float_to_int: 258. < 128; */ char ci3 = (char)258.; int ci4 = (int)2147483647.5; /*@ assert rte: float_to_int: -2147483649 < -2147483649.5; */ int ci5 = (int)(- 2147483649.5); return; } frama-c-20.0-Calcium/tests/rte/oracle/fptr_assert.res.oracle0000666000000000000000000000160713571573400020733 0ustar [kernel] Parsing tests/rte/fptr_assert.c (with preprocessing) [rte] annotating function f [rte] annotating function g [rte] annotating function h [rte] annotating function main /* Generated by Frama-C */ typedef int (*fptr)(int ); void g(void) { return; } int f(int x) { return x; } int h(int x) { return x; } int main(int i) { int __retres; void (*fp1)(); int (*fp2)(int ); fptr ma[2] = {& f, & h}; fp1 = (void (*)())(& g); fp2 = & f; /*@ assert rte: function_pointer: \valid_function((void (*)(void))fp1); */ (*fp1)(); /*@ assert rte: function_pointer: \valid_function(fp2); */ (*fp2)(3); /*@ assert rte: function_pointer: \valid_function(ma[1]); */ (*(ma[1]))(5); /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 2; */ /*@ assert rte: function_pointer: \valid_function(ma[i]); */ (*(ma[i]))(5); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/gnu_zero_length.res.oracle0000666000000000000000000000212013571573400021557 0ustar [kernel] Parsing tests/rte/gnu_zero_length.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ #include "stdlib.h" struct S { unsigned int length ; int fam[0] ; }; int main(void) { int __retres; struct S *tmp_0; unsigned int l = (unsigned int)3; struct S *s = malloc(sizeof(*tmp_0) + sizeof(int) * l); if (s) { /*@ assert rte: mem_access: \valid(&s->length); */ s->length = l; { int i = 0; while (1) { /*@ assert rte: mem_access: \valid_read(&s->length); */ if (! ((unsigned int)i < s->length)) break; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: mem_access: \valid(&s->fam[i]); */ s->fam[i] = i; /*@ assert rte: signed_overflow: i + 1 ≤ 2147483647; */ i ++; } } /*@ assert rte: mem_access: \valid_read(&s->length); */ /*@ assert rte: mem_access: \valid_read(&s->fam[(unsigned int)(s->length - 1)]); */ __retres = s->fam[s->length - (unsigned int)1]; goto return_label; } __retres = 0; return_label: return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/initialized.res.oracle0000666000000000000000000004623513571573400020712 0ustar [kernel] Parsing tests/rte/initialized.c (with preprocessing) [kernel:parser:decimal-float] tests/rte/initialized.c:111: Warning: Floating-point constant 1.1234 is not represented exactly. Will use 0x1.1f972474538efp0. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [rte] annotating function f [rte] annotating function g [rte] annotating function main /* Generated by Frama-C */ struct R { int v ; }; struct P; struct Q { int v ; int id[12] ; struct P *next ; struct R tr[13] ; }; struct P { int val ; struct P *next ; int id[5] ; int oth[6][7] ; struct P *nexts[8][9] ; struct Q q ; struct Q tq[10][11] ; struct P ***znexts ; }; int g(void) { int x = 3; /*@ assert rte: initialization: \initialized(&x); */ return x; } int f(struct P ***pppp_0, struct P **ppp_0, struct P *pp_0, struct P p_0, struct P p2_0, int v_0, struct Q q_0, int *i_0, int *j_0, int i0_0, int i1_0, int i2_0, int i3_0, int i4_0, double f_0) { int tmp; struct P *tmp_0; i0_0 = 0; i1_0 = 1; i2_0 = 2; i3_0 = 3; i4_0 = 4; tmp = g(); j_0 = (int *)(0 + tmp); i_0 = (int *)(& j_0); pp_0 = & p_0; ppp_0 = & pp_0; pppp_0 = & ppp_0; p_0.next = pp_0; p_0.znexts = pppp_0; tmp_0 = pp_0; /*@ assert rte: index_bound: 0 ≤ i2_0; */ /*@ assert rte: index_bound: i2_0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i3_0; */ /*@ assert rte: index_bound: i3_0 < 9; */ p_0.nexts[i2_0][i3_0] = tmp_0; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 9; */ p_0.nexts[i0_0][i1_0] = tmp_0; q_0.next = pp_0; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 12; */ q_0.id[i0_0] = 0; p_0.q = q_0; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 11; */ p_0.tq[i0_0][i1_0] = q_0; /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 5; */ /*@ assert rte: index_bound: 0 ≤ i2_0; */ /*@ assert rte: index_bound: i2_0 < 5; */ /*@ assert rte: initialization: \initialized(&p_0.id[i2_0]); */ p_0.id[i1_0] = p_0.id[i2_0]; /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 5; */ /*@ assert rte: index_bound: 0 ≤ i3_0; */ /*@ assert rte: index_bound: i3_0 < 5; */ /*@ assert rte: initialization: \initialized(&p_0.id[i3_0]); */ p_0.id[i1_0] = p_0.id[i3_0]; /*@ assert rte: mem_access: \valid_read(p_0.next); */ /*@ assert rte: initialization: \initialized(p_0.next); */ struct P np = *(p_0.next); struct P *npp = p_0.next; /*@ assert rte: initialization: \initialized(&npp); */ p_0.next = npp; /*@ assert rte: initialization: \initialized(&p_0.id[3]); */ v_0 = p_0.id[3]; /*@ assert rte: mem_access: \valid_read(&pp_0->id[3]); */ /*@ assert rte: initialization: \initialized(&pp_0->id[3]); */ v_0 = pp_0->id[3]; /*@ assert rte: mem_access: \valid_read(i_0); */ /*@ assert rte: initialization: \initialized(i_0); */ v_0 = *i_0; /*@ assert rte: mem_access: \valid_read(&pp_0->val); */ /*@ assert rte: initialization: \initialized(&pp_0->val); */ v_0 = pp_0->val; /*@ assert rte: mem_access: \valid_read(&pp_0->id[3]); */ /*@ assert rte: initialization: \initialized(&pp_0->id[3]); */ v_0 = pp_0->id[3]; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 9; */ /*@ assert rte: mem_access: \valid_read(&pp_0->nexts[i0_0][i1_0]); */ /*@ assert rte: initialization: \initialized(&pp_0->nexts[i0_0][i1_0]); */ struct P *z = pp_0->nexts[i0_0][i1_0]; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 9; */ /*@ assert rte: mem_access: \valid_read(&pp_0->nexts[i0_0][i1_0]); */ /*@ assert rte: initialization: \initialized(&pp_0->nexts[i0_0][i1_0]); */ /*@ assert rte: mem_access: \valid_read(&(pp_0->nexts[i0_0][i1_0])->val); */ /*@ assert rte: initialization: \initialized(&(pp_0->nexts[i0_0][i1_0])->val); */ v_0 = (pp_0->nexts[i0_0][i1_0])->val; /*@ assert rte: mem_access: \valid_read(&pp_0->next); */ /*@ assert rte: initialization: \initialized(&pp_0->next); */ /*@ assert rte: mem_access: \valid_read(&(pp_0->next)->val); */ /*@ assert rte: initialization: \initialized(&(pp_0->next)->val); */ v_0 = (pp_0->next)->val; /*@ assert rte: mem_access: \valid_read(&pp_0->next); */ /*@ assert rte: initialization: \initialized(&pp_0->next); */ /*@ assert rte: mem_access: \valid_read(&(pp_0->next)->next); */ /*@ assert rte: initialization: \initialized(&(pp_0->next)->next); */ /*@ assert rte: mem_access: \valid_read(&((pp_0->next)->next)->val); */ /*@ assert rte: initialization: \initialized(&((pp_0->next)->next)->val); */ v_0 = ((pp_0->next)->next)->val; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 9; */ /*@ assert rte: initialization: \initialized(&p_0.nexts[i0_0][i1_0]); */ /*@ assert rte: mem_access: \valid_read(&(p_0.nexts[i0_0][i1_0])->val); */ /*@ assert rte: initialization: \initialized(&(p_0.nexts[i0_0][i1_0])->val); */ v_0 = (p_0.nexts[i0_0][i1_0])->val; /*@ assert rte: index_bound: 0 ≤ i2_0; */ /*@ assert rte: index_bound: i2_0 < 5; */ /*@ assert rte: mem_access: \valid_read(&pp_0->id[i2_0]); */ /*@ assert rte: initialization: \initialized(&pp_0->id[i2_0]); */ v_0 = pp_0->id[i2_0]; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 6; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 7; */ /*@ assert rte: mem_access: \valid_read(&pp_0->oth[i0_0][i1_0]); */ /*@ assert rte: initialization: \initialized(&pp_0->oth[i0_0][i1_0]); */ v_0 = pp_0->oth[i0_0][i1_0]; /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i2_0; */ /*@ assert rte: index_bound: i2_0 < 9; */ /*@ assert rte: initialization: \initialized(&p_0.nexts[i1_0][i2_0]); */ /*@ assert rte: mem_access: \valid_read(i_0); */ /*@ assert rte: initialization: \initialized(i_0); */ /*@ assert rte: index_bound: 0 ≤ i3_0; */ /*@ assert rte: index_bound: i3_0 < 8; */ /*@ assert rte: index_bound: 0 ≤ *i_0; */ /*@ assert rte: index_bound: *i_0 < 9; */ /*@ assert rte: mem_access: \valid_read(&(p_0.nexts[i1_0][i2_0])->nexts[i3_0][*i_0]); */ /*@ assert rte: initialization: \initialized(&(p_0.nexts[i1_0][i2_0])->nexts[i3_0][*i_0]); */ /*@ assert rte: index_bound: 0 ≤ i4_0; */ /*@ assert rte: index_bound: i4_0 < 5; */ /*@ assert rte: mem_access: \valid_read(&((p_0.nexts[i1_0][i2_0])->nexts[i3_0][*i_0])->id[i4_0]); */ /*@ assert rte: initialization: \initialized(&((p_0.nexts[i1_0][i2_0])->nexts[i3_0][*i_0])->id[i4_0]); */ v_0 = ((p_0.nexts[i1_0][i2_0])->nexts[i3_0][*i_0])->id[i4_0]; v_0 = p_0.q.v; /*@ assert rte: index_bound: 0 ≤ i4_0; */ /*@ assert rte: index_bound: i4_0 < 12; */ /*@ assert rte: initialization: \initialized(&p_0.q.id[i4_0]); */ v_0 = p_0.q.id[i4_0]; /*@ assert rte: index_bound: 0 ≤ i3_0; */ /*@ assert rte: index_bound: i3_0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 11; */ /*@ assert rte: initialization: \initialized(&p_0.tq[i3_0][i1_0].v); */ v_0 = p_0.tq[i3_0][i1_0].v; /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i2_0; */ /*@ assert rte: index_bound: i2_0 < 11; */ /*@ assert rte: initialization: \initialized(&p_0.tq[i1_0][i2_0].next); */ /*@ assert rte: index_bound: 0 ≤ i3_0; */ /*@ assert rte: index_bound: i3_0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i4_0; */ /*@ assert rte: index_bound: i4_0 < 11; */ /*@ assert rte: mem_access: \valid_read(&(p_0.tq[i1_0][i2_0].next)->tq[i3_0][i4_0].v); */ /*@ assert rte: initialization: \initialized(&(p_0.tq[i1_0][i2_0].next)->tq[i3_0][i4_0].v); */ v_0 = (p_0.tq[i1_0][i2_0].next)->tq[i3_0][i4_0].v; /*@ assert rte: index_bound: 0 ≤ i3_0; */ /*@ assert rte: index_bound: i3_0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 11; */ /*@ assert rte: mem_access: \valid_read(&pp_0->tq[i3_0][i1_0].v); */ /*@ assert rte: initialization: \initialized(&pp_0->tq[i3_0][i1_0].v); */ v_0 = pp_0->tq[i3_0][i1_0].v; /*@ assert rte: mem_access: \valid_read(p_0.znexts + i0_0); */ /*@ assert rte: initialization: \initialized(p_0.znexts + i0_0); */ /*@ assert rte: mem_access: \valid_read(*(p_0.znexts + i0_0) + i1_0); */ /*@ assert rte: initialization: \initialized(*(p_0.znexts + i0_0) + i1_0); */ /*@ assert rte: mem_access: \valid_read(&(*(*(p_0.znexts + i0_0) + i1_0) + i2_0)->val); */ /*@ assert rte: initialization: \initialized(&(*(*(p_0.znexts + i0_0) + i1_0) + i2_0)->val); */ v_0 = (*(*(p_0.znexts + i0_0) + i1_0) + i2_0)->val; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 11; */ /*@ assert rte: initialization: \initialized(&p_0.tq[i0_0][i1_0]); */ q_0 = p_0.tq[i0_0][i1_0]; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 11; */ /*@ assert rte: index_bound: 0 ≤ i2_0; */ /*@ assert rte: index_bound: i2_0 < 13; */ /*@ assert rte: initialization: \initialized(&p_0.tq[i0_0][i1_0].tr[i2_0].v); */ v_0 = p_0.tq[i0_0][i1_0].tr[i2_0].v; /*@ assert rte: mem_access: \valid_read(&pp_0->val); */ /*@ assert rte: initialization: \initialized(&pp_0->val); */ v_0 = pp_0->val; v_0 = p_0.val; /*@ assert rte: index_bound: 0 ≤ i0_0; */ /*@ assert rte: index_bound: i0_0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1_0; */ /*@ assert rte: index_bound: i1_0 < 11; */ /*@ assert rte: initialization: \initialized(&p_0.tq[i0_0][i1_0].v); */ v_0 = p_0.tq[i0_0][i1_0].v; return v_0; } struct P ***pppp; struct P **ppp; struct P *pp; struct P p; struct P p2; int v; struct Q q; int *i; int j; int i0 = 0; int i1 = 1; int i2 = 2; int i3 = 3; int i4 = 4; double f0 = 1.1234; int i5 = 1; int main(void) { unsigned char c1; unsigned char c2; struct P *tmp; j = 0; i = & j; pp = & p; ppp = & pp; pppp = & ppp; p.next = pp; p.znexts = pppp; tmp = pp; /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 8; */ /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 9; */ p.nexts[i2][i3] = tmp; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 9; */ p.nexts[i0][i1] = tmp; q.next = pp; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 12; */ q.id[i0] = 0; p.q = q; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ p.tq[i0][i1] = q; /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 5; */ /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 5; */ /*@ assert rte: initialization: \initialized(&p.id[i2]); */ p.id[i1] = p.id[i2]; /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 5; */ /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 5; */ /*@ assert rte: initialization: \initialized(&p.id[i3]); */ p.id[i1] = p.id[i3]; /*@ assert rte: mem_access: \valid_read(p.next); */ /*@ assert rte: initialization: \initialized(p.next); */ struct P np = *(p.next); struct P *npp = p.next; /*@ assert rte: initialization: \initialized(&p.id[3]); */ v = p.id[3]; /*@ assert rte: mem_access: \valid_read(&pp->id[3]); */ /*@ assert rte: initialization: \initialized(&pp->id[3]); */ v = pp->id[3]; /*@ assert rte: mem_access: \valid_read(i); */ /*@ assert rte: initialization: \initialized(i); */ v = *i; /*@ assert rte: mem_access: \valid_read(&pp->val); */ /*@ assert rte: initialization: \initialized(&pp->val); */ v = pp->val; /*@ assert rte: mem_access: \valid_read(&pp->id[3]); */ /*@ assert rte: initialization: \initialized(&pp->id[3]); */ v = pp->id[3]; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 9; */ /*@ assert rte: mem_access: \valid_read(&pp->nexts[i0][i1]); */ /*@ assert rte: initialization: \initialized(&pp->nexts[i0][i1]); */ struct P *z = pp->nexts[i0][i1]; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 9; */ /*@ assert rte: mem_access: \valid_read(&pp->nexts[i0][i1]); */ /*@ assert rte: initialization: \initialized(&pp->nexts[i0][i1]); */ /*@ assert rte: mem_access: \valid_read(&(pp->nexts[i0][i1])->val); */ /*@ assert rte: initialization: \initialized(&(pp->nexts[i0][i1])->val); */ v = (pp->nexts[i0][i1])->val; /*@ assert rte: mem_access: \valid_read(&pp->next); */ /*@ assert rte: initialization: \initialized(&pp->next); */ /*@ assert rte: mem_access: \valid_read(&(pp->next)->val); */ /*@ assert rte: initialization: \initialized(&(pp->next)->val); */ v = (pp->next)->val; /*@ assert rte: mem_access: \valid_read(&pp->next); */ /*@ assert rte: initialization: \initialized(&pp->next); */ /*@ assert rte: mem_access: \valid_read(&(pp->next)->next); */ /*@ assert rte: initialization: \initialized(&(pp->next)->next); */ /*@ assert rte: mem_access: \valid_read(&((pp->next)->next)->val); */ /*@ assert rte: initialization: \initialized(&((pp->next)->next)->val); */ v = ((pp->next)->next)->val; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 9; */ /*@ assert rte: initialization: \initialized(&p.nexts[i0][i1]); */ /*@ assert rte: mem_access: \valid_read(&(p.nexts[i0][i1])->val); */ /*@ assert rte: initialization: \initialized(&(p.nexts[i0][i1])->val); */ v = (p.nexts[i0][i1])->val; /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 5; */ /*@ assert rte: mem_access: \valid_read(&pp->id[i2]); */ /*@ assert rte: initialization: \initialized(&pp->id[i2]); */ v = pp->id[i2]; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 6; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 7; */ /*@ assert rte: mem_access: \valid_read(&pp->oth[i0][i1]); */ /*@ assert rte: initialization: \initialized(&pp->oth[i0][i1]); */ v = pp->oth[i0][i1]; /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 8; */ /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 9; */ /*@ assert rte: initialization: \initialized(&p.nexts[i1][i2]); */ /*@ assert rte: mem_access: \valid_read(i); */ /*@ assert rte: initialization: \initialized(i); */ /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 8; */ /*@ assert rte: index_bound: 0 ≤ *i; */ /*@ assert rte: index_bound: *i < 9; */ /*@ assert rte: mem_access: \valid_read(&(p.nexts[i1][i2])->nexts[i3][*i]); */ /*@ assert rte: initialization: \initialized(&(p.nexts[i1][i2])->nexts[i3][*i]); */ /*@ assert rte: index_bound: 0 ≤ i4; */ /*@ assert rte: index_bound: i4 < 5; */ /*@ assert rte: mem_access: \valid_read(&((p.nexts[i1][i2])->nexts[i3][*i])->id[i4]); */ /*@ assert rte: initialization: \initialized(&((p.nexts[i1][i2])->nexts[i3][*i])->id[i4]); */ v = ((p.nexts[i1][i2])->nexts[i3][*i])->id[i4]; v = p.q.v; /*@ assert rte: index_bound: 0 ≤ i4; */ /*@ assert rte: index_bound: i4 < 12; */ /*@ assert rte: initialization: \initialized(&p.q.id[i4]); */ v = p.q.id[i4]; /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ /*@ assert rte: initialization: \initialized(&p.tq[i3][i1].v); */ v = p.tq[i3][i1].v; /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 10; */ /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 11; */ /*@ assert rte: initialization: \initialized(&p.tq[i1][i2].next); */ /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 10; */ /*@ assert rte: index_bound: 0 ≤ i4; */ /*@ assert rte: index_bound: i4 < 11; */ /*@ assert rte: mem_access: \valid_read(&(p.tq[i1][i2].next)->tq[i3][i4].v); */ /*@ assert rte: initialization: \initialized(&(p.tq[i1][i2].next)->tq[i3][i4].v); */ v = (p.tq[i1][i2].next)->tq[i3][i4].v; /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ /*@ assert rte: mem_access: \valid_read(&pp->tq[i3][i1].v); */ /*@ assert rte: initialization: \initialized(&pp->tq[i3][i1].v); */ v = pp->tq[i3][i1].v; /*@ assert rte: mem_access: \valid_read(p.znexts + i0); */ /*@ assert rte: initialization: \initialized(p.znexts + i0); */ /*@ assert rte: mem_access: \valid_read(*(p.znexts + i0) + i1); */ /*@ assert rte: initialization: \initialized(*(p.znexts + i0) + i1); */ /*@ assert rte: mem_access: \valid_read(&(*(*(p.znexts + i0) + i1) + i2)->val); */ /*@ assert rte: initialization: \initialized(&(*(*(p.znexts + i0) + i1) + i2)->val); */ v = (*(*(p.znexts + i0) + i1) + i2)->val; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ /*@ assert rte: initialization: \initialized(&p.tq[i0][i1]); */ q = p.tq[i0][i1]; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 13; */ /*@ assert rte: initialization: \initialized(&p.tq[i0][i1].tr[i2].v); */ v = p.tq[i0][i1].tr[i2].v; /*@ assert rte: mem_access: \valid_read(&pp->val); */ /*@ assert rte: initialization: \initialized(&pp->val); */ v = pp->val; v = p.val; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ /*@ assert rte: initialization: \initialized(&p.tq[i0][i1].v); */ v = p.tq[i0][i1].v; c1 = c2; unsigned char c3 = c2; return v; } frama-c-20.0-Calcium/tests/rte/oracle/initialized_union.res.oracle0000666000000000000000000000315113571573400022110 0ustar [kernel] Parsing tests/rte/initialized_union.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ union U { char c ; int i ; double f ; }; union U2 { int i1 ; int i2 ; }; union U3 { union U u ; union U2 u2 ; }; struct S { union U u ; }; union empty { }; union U u_global; int main(void) { int __retres; union U u_local1; union U u_local2; union U2 u2_local1; union U2 u2_local2; union U3 u3_local1; union U3 u3_local2; union empty e; struct S s1; struct S s2; u_local1.c = (char)1; /*@ assert rte: initialization_of_union: \initialized(&u_local1.c) ∨ \initialized(&u_local1.i) ∨ \initialized(&u_local1.f); */ u_local2 = u_local1; /*@ assert rte: initialization: \initialized(&u_local1.i); */ u2_local1.i2 = u_local1.i; /*@ assert rte: initialization_of_union: \initialized(&u2_local1.i1) ∨ \initialized(&u2_local1.i2); */ u2_local2 = u2_local1; /*@ assert rte: initialization_of_union: \initialized(&u_local1.c) ∨ \initialized(&u_local1.i) ∨ \initialized(&u_local1.f); */ u3_local1.u = u_local1; /*@ assert rte: initialization_of_union: \initialized(&u3_local1.u) ∨ \initialized(&u3_local1.u2); */ u3_local2 = u3_local1; double f = u_global.f; s1.u.c = (char)'a'; /*@ assert rte: initialization_of_union: \initialized(&s1.u.c) ∨ \initialized(&s1.u.i) ∨ \initialized(&s1.u.f); */ s2.u = s1.u; union empty e1 = e; __retres = 0; /*@ assert rte: initialization: \initialized(&__retres); */ return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/malloc.res.oracle0000666000000000000000000000070113571573400017640 0ustar [kernel] Parsing tests/rte/malloc.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ /*@ ensures \result ≡ \null ∨ \fresh{Old, Here}(\result,10); allocates \result; */ char *my_malloc(unsigned int n); int main(void) { int __retres; /*@ requires \true; */ char *p = my_malloc((unsigned int)10); if (p) { __retres = 1; goto return_label; } __retres = 0; return_label: return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/memaccess.res.oracle0000666000000000000000000000202013571573400020325 0ustar [kernel] Parsing tests/rte/memaccess.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(int x) { int __retres; int *p; int *q; int tab[10]; /*@ assert rte: mem_access: \valid(p); */ *p = 3; q = p; /*@ assert rte: mem_access: \valid(q); */ /*@ assert rte: mem_access: \valid_read(p); */ /*@ assert rte: signed_overflow: *p + 5 ≤ 2147483647; */ *q = *p + 5; /*@ assert rte: mem_access: \valid_read(q); */ tab[3] = *q; /*@ assert rte: index_bound: 0 ≤ x; */ /*@ assert rte: index_bound: x < 10; */ /*@ assert rte: mem_access: \valid_read(q); */ tab[x] = *q; p = & tab[2]; p = & tab[x]; /*@ assert rte: mem_access: \valid(p + 1); */ *(p + 1) = tab[0]; /*@ assert rte: mem_access: \valid(p + 1); */ /*@ assert rte: index_bound: 0 ≤ x; */ /*@ assert rte: index_bound: x < 10; */ *(p + 1) = tab[x]; /*@ assert rte: mem_access: \valid(q); */ /*@ assert rte: mem_access: \valid_read(p + 2); */ *q = *(p + 2); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/minus.0.res.oracle0000666000000000000000000000365413571573400017674 0ustar [kernel] Parsing tests/rte/minus.c (with preprocessing) [rte] annotating function main [rte] tests/rte/minus.c:11: Warning: guaranteed RTE: assert signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; [rte] tests/rte/minus.c:18: Warning: guaranteed RTE: assert signed_overflow: -2147483648 ≤ (int)((int)(-2147483647) - 1) - 1; [rte] tests/rte/minus.c:19: Warning: guaranteed RTE: assert signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; [rte] tests/rte/minus.c:19: Warning: guaranteed RTE: assert signed_overflow: -2147483648 ≤ (int)(-((int)((int)(-0x7fffffff) - 1))) - 1; /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; int z = 0; unsigned int ux = (unsigned int)0; unsigned int uy = (unsigned int)0; unsigned int uz = (unsigned int)0; short sz = (short)0; /*@ assert rte: signed_overflow: -2147483647 ≤ x; */ z = - x; /*@ assert rte: signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; */ z = - (-0x7fffffff - 1); /*@ assert rte: signed_downcast: -ux ≤ 2147483647; */ z = (int)(- ux); /*@ assert rte: signed_overflow: (int)((unsigned short)((int)(65535 + 3))) + x ≤ 2147483647; */ /*@ assert rte: signed_downcast: (int)((unsigned short)((int)(65535 + 3))) + x ≤ 32767; */ /*@ assert rte: signed_downcast: -32768 ≤ (int)((unsigned short)((int)(65535 + 3))) + x; */ sz = (short)((int)((unsigned short)(65535 + 3)) + x); z = (int)(-0x80000000 - (unsigned int)1); z = (int)(-2147483648 - (unsigned int)1); /*@ assert rte: signed_overflow: -2147483648 ≤ (int)((int)(-2147483647) - 1) - 1; */ z = (-2147483647 - 1) - 1; /*@ assert rte: signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-((int)((int)(-0x7fffffff) - 1))) - 1; */ z = - (-0x7fffffff - 1) - 1; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/minus.1.res.oracle0000666000000000000000000000552013571573400017667 0ustar [kernel] Parsing tests/rte/minus.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; int z = 0; unsigned int ux = (unsigned int)0; unsigned int uy = (unsigned int)0; unsigned int uz = (unsigned int)0; /*@ assert rte: signed_downcast: 0 ≤ 32767; */ /*@ assert rte: signed_downcast: -32768 ≤ 0; */ short sz = (short)0; /*@ assert rte: signed_overflow: -2147483647 ≤ x; */ z = - x; /*@ assert rte: signed_overflow: -2147483647 ≤ 0x7fffffff; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-0x7fffffff) - 1; */ /*@ assert rte: signed_overflow: (int)(-0x7fffffff) - 1 ≤ 2147483647; */ /*@ assert rte: signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; */ z = - (-0x7fffffff - 1); /*@ assert rte: signed_downcast: -ux ≤ 2147483647; */ z = (int)(- ux); /*@ assert rte: signed_overflow: -2147483648 ≤ 65535 + 3; */ /*@ assert rte: signed_overflow: 65535 + 3 ≤ 2147483647; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)((unsigned short)((int)(65535 + 3))) + x; */ /*@ assert rte: signed_overflow: (int)((unsigned short)((int)(65535 + 3))) + x ≤ 2147483647; */ /*@ assert rte: signed_downcast: (int)((unsigned short)((int)(65535 + 3))) + x ≤ 32767; */ /*@ assert rte: signed_downcast: -32768 ≤ (int)((unsigned short)((int)(65535 + 3))) + x; */ sz = (short)((int)((unsigned short)(65535 + 3)) + x); /*@ assert rte: signed_downcast: (unsigned int)(-0x80000000) - (unsigned int)1 ≤ 2147483647; */ z = (int)(-0x80000000 - (unsigned int)1); /*@ assert rte: signed_downcast: (unsigned int)(-2147483648) - (unsigned int)1 ≤ 2147483647; */ z = (int)(-2147483648 - (unsigned int)1); /*@ assert rte: signed_overflow: -2147483647 ≤ 2147483647; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-2147483647) - 1; */ /*@ assert rte: signed_overflow: (int)(-2147483647) - 1 ≤ 2147483647; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)((int)(-2147483647) - 1) - 1; */ /*@ assert rte: signed_overflow: (int)((int)(-2147483647) - 1) - 1 ≤ 2147483647; */ z = (-2147483647 - 1) - 1; /*@ assert rte: signed_overflow: -2147483647 ≤ 0x7fffffff; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-0x7fffffff) - 1; */ /*@ assert rte: signed_overflow: (int)(-0x7fffffff) - 1 ≤ 2147483647; */ /*@ assert rte: signed_overflow: -2147483647 ≤ (int)(-0x7fffffff) - 1; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-((int)((int)(-0x7fffffff) - 1))) - 1; */ /*@ assert rte: signed_overflow: (int)(-((int)((int)(-0x7fffffff) - 1))) - 1 ≤ 2147483647; */ z = - (-0x7fffffff - 1) - 1; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/mul.res.oracle0000666000000000000000000000352513571573400017175 0ustar [kernel] Parsing tests/rte/mul.c (with preprocessing) [rte] annotating function main [rte] tests/rte/mul.c:22: Warning: guaranteed RTE: assert signed_overflow: 0xffff * 0xffff ≤ 2147483647; [rte] tests/rte/mul.c:25: Warning: guaranteed RTE: assert signed_overflow: 0xffff * 0x8001 ≤ 2147483647; /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; int z = 0; unsigned int ux = (unsigned int)0; unsigned int uy = (unsigned int)0; unsigned int uz = (unsigned int)0; uz = ux * uy; /*@ assert rte: signed_overflow: -2147483648 ≤ x * y; */ /*@ assert rte: signed_overflow: x * y ≤ 2147483647; */ z = x * y; /*@ assert rte: signed_overflow: -2147483648 ≤ 0x1000 * y; */ /*@ assert rte: signed_overflow: 0x1000 * y ≤ 2147483647; */ z = 0x1000 * y; /*@ assert rte: signed_overflow: -2147483648 ≤ x * 0x1000; */ /*@ assert rte: signed_overflow: x * 0x1000 ≤ 2147483647; */ z = x * 0x1000; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-0x1000) * y; */ /*@ assert rte: signed_overflow: (int)(-0x1000) * y ≤ 2147483647; */ z = -0x1000 * y; /*@ assert rte: signed_overflow: -2147483648 ≤ x * (int)(-0x1000); */ /*@ assert rte: signed_overflow: x * (int)(-0x1000) ≤ 2147483647; */ z = x * -0x1000; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(-1) * y; */ /*@ assert rte: signed_overflow: (int)(-1) * y ≤ 2147483647; */ z = -1 * y; z = x * 1; z = 1 * y; /*@ assert rte: signed_downcast: (unsigned int)x * 0xffffffff ≤ 2147483647; */ z = (int)((unsigned int)x * 0xffffffff); /*@ assert rte: signed_overflow: 0xffff * 0xffff ≤ 2147483647; */ z = 0xffff * 0xffff; z = 0xffff * 0x7fff; z = 0xffff * 0x8000; /*@ assert rte: signed_overflow: 0xffff * 0x8001 ≤ 2147483647; */ z = 0xffff * 0x8001; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/noresult.res.oracle0000666000000000000000000000057613571573400020256 0ustar [kernel] Parsing tests/rte/noresult.c (with preprocessing) [rte] annotating function job /* Generated by Frama-C */ int x; /*@ ensures \result > 0; assigns x; */ int f(void); /*@ ensures \result > 0; assigns \nothing; */ int g(void); /*@ requires p > 0; ensures \result > 0; assigns \nothing; */ int h(int p); void job(void) { f(); g(); h(2); return; } frama-c-20.0-Calcium/tests/rte/oracle/postcond.res.oracle0000666000000000000000000000172013571573400020224 0ustar [kernel] Parsing tests/rte/postcond.c (with preprocessing) [rte] annotating function f [rte] annotating function g [rte] annotating function main /* Generated by Frama-C */ /*@ ensures \result ≡ -\old(x); behavior pos: assumes first_bhv: x ≥ 0; ensures \result ≤ 0; assigns *y; behavior neg: assumes second_bhv: x < 0; ensures \result > 0; assigns \nothing; complete behaviors pos, neg; disjoint behaviors pos, neg; */ int f(int x, int *y) { int __retres; if (x >= 0) *y = x; /*@ assert rte: signed_overflow: -2147483647 ≤ x; */ __retres = - x; return __retres; } /*@ ensures *\old(x) ≡ \old(y); assigns *x; */ void g(int y, int *x) { *x = f(y,& y); return; } int main(void) { int c; int a = 5; int b = f(a,& c); g(b,& a); /*@ assert rte: signed_overflow: -2147483648 ≤ b + a; */ /*@ assert rte: signed_overflow: b + a ≤ 2147483647; */ b += a; return b; } frama-c-20.0-Calcium/tests/rte/oracle/postcond2.res.oracle0000666000000000000000000000142713571573400020312 0ustar [kernel] Parsing tests/rte/postcond2.c (with preprocessing) [kernel] tests/rte/postcond2.c:7: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [rte] annotating function f [rte] annotating function main /* Generated by Frama-C */ /*@ requires \valid(x); requires \valid(x + (0 .. 10)); assigns *x, \result; assigns *x \from y; assigns \result \from *x; */ int g(int *x, int y); /*@ requires \valid(tab + 0); assigns \nothing; */ int f(int *tab) { int __retres; __retres = 0; return __retres; } int main(void) { int tmp_0; int tab[2] = {3, 4}; int a = f(tab); /*@ assert rte: signed_overflow: 3 - tab[0] ≤ 2147483647; */ tmp_0 = g(& tab[3 - tab[0]] + a,a); return tmp_0; } frama-c-20.0-Calcium/tests/rte/oracle/precond.res.oracle0000666000000000000000000001177513571573400020040 0ustar [kernel] Parsing tests/rte/precond.c (with preprocessing) [kernel] tests/rte/precond.c:27: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [rte] annotating function f [rte] annotating function g [rte] annotating function h [rte] annotating function main [rte] annotating function next_val [rte] annotating function set [rte] annotating function tabtop_set [rte] annotating function top_next [rte] annotating function top_set /* Generated by Frama-C */ struct cell { int val ; struct cell *next ; }; typedef struct cell cell; struct other { cell c ; }; typedef struct other other; struct top { int topv ; cell *next ; cell *pred ; }; typedef struct top top; int global = 15; /*@ requires x > 0; requires (int)(x + y) ≢ 0; */ int f(int x, int y, float z) { int __retres; /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ /*@ assert rte: float_to_int: z < 2147483648; */ /*@ assert rte: float_to_int: -2147483649 < z; */ /*@ assert rte: signed_overflow: -2147483648 ≤ (int)(x + y) - (int)z; */ /*@ assert rte: signed_overflow: (int)(x + y) - (int)z ≤ 2147483647; */ __retres = (x + y) - (int)z; return __retres; } /*@ predicate is_valid_int_range{L}(int *p, int n) = \at(0 ≤ n ∧ \valid(p + (0 .. n - 1)),L); */ /*@ requires is_valid_int_range(p, i); */ int g(int *p, int i) { int __retres; if (i >= 1) { /*@ assert rte: signed_overflow: -2147483648 ≤ i - 1; */ /*@ assert rte: mem_access: \valid_read(p + (int)(i - 1)); */ __retres = *(p + (i - 1)); goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } /*@ requires \valid((p + 1) + 3); */ int h(int *p) { int __retres; /*@ assert rte: mem_access: \valid_read(p + 3); */ __retres = *(p + 3); return __retres; } /*@ requires \valid(p->next); requires \valid(p); */ cell *set(cell *p, int v) { cell *__retres; /*@ assert rte: mem_access: \valid(&p->val); */ p->val = v; /*@ assert rte: mem_access: \valid_read(&p->next); */ __retres = p->next; return __retres; } /*@ requires \valid(cIn.next); requires global > 0; */ int next_val(cell cIn) { int __retres; /*@ assert rte: mem_access: \valid_read(&(cIn.next)->val); */ __retres = (cIn.next)->val; return __retres; } /*@ requires \valid(ptop->next); */ cell *top_set(top *ptop, int v) { cell *tmp; /*@ assert rte: mem_access: \valid_read(&ptop->next); */ tmp = set(ptop->next,v); return tmp; } /*@ requires \valid(tIn.next); */ int top_next(top tIn) { int tmp; /*@ assert rte: mem_access: \valid_read(tIn.next); */ tmp = next_val(*(tIn.next)); return tmp; } /*@ requires \valid(tab_top); requires \valid(&tab_top); requires \valid((*(tab_top + i))->next); */ cell *tabtop_set(top **tab_top, int i, int v) { cell *tmp; /*@ assert rte: mem_access: \valid_read(tab_top + i); */ tmp = top_set(*(tab_top + i),v); return tmp; } int main(void) { cell *pc; top T; top tabT[2]; top **pptop; void *V; int w; int *r; int **rr; int a = 2; int b = 3; cell c = {.val = 20, .next = (struct cell *)0}; top *ptabT[3] = {& T, & T, & T}; other ot = {.c = c}; int k = 1; int l = 1; int z = f(2,3,(float)1.0); /*@ assert rte: signed_overflow: -2147483648 ≤ b - a; */ /*@ assert rte: signed_overflow: b - a ≤ 2147483647; */ int y = f(b - a,a,(float)2.0); int tab[4] = {1, 2, 3, 4}; /*@ assert rte: signed_overflow: -2147483648 ≤ a + b; */ /*@ assert rte: signed_overflow: a + b ≤ 2147483647; */ z = f(y,a + b,(float)(- 0.0)); w = g(& z,1); w = g(& tab[1],2); w = g(& tab[k],l); r = tab; rr = & r; w = g(r + 2,0); w = h(tab); w = h(r); /*@ assert rte: mem_access: \valid_read(rr); */ w = h(*rr); pc = & c; c.next = & c; set(pc,15); set(& c,10); set(& c,20); V = (void *)(& c); set((cell *)V,20); next_val(c); /*@ assert rte: mem_access: \valid_read(pc); */ next_val(*pc); /*@ assert rte: mem_access: \valid_read((cell *)V); */ next_val(*((cell *)V)); T.pred = & c; T.next = & c; tabT[0] = T; tabT[1] = T; set(T.pred,10); set(tabT[1].next,20); /*@ assert rte: mem_access: \valid_read(T.next); */ next_val(*(T.next)); /*@ assert rte: mem_access: \valid_read(tabT[0].pred); */ next_val(*(tabT[0].pred)); /*@ assert rte: mem_access: \valid_read(&(ptabT[2])->pred); */ set((ptabT[2])->pred,15); set(tabT[1].pred,10); /*@ assert rte: mem_access: \valid_read(&(ptabT[1])->next); */ /*@ assert rte: mem_access: \valid_read((ptabT[1])->next); */ next_val(*((ptabT[1])->next)); top_set(& T,3); top_set(& tabT[1],2); top_set(ptabT[1],4); top_set((top *)c.next,5); top_next(T); /*@ assert rte: mem_access: \valid_read(ptabT[0]); */ top_next(*(ptabT[0])); tabtop_set(ptabT,2,10); pptop = ptabT; tabtop_set(pptop,2,15); tabtop_set(ptabT,1,20); /*@ assert rte: mem_access: \valid_read(&pc->next); */ tabtop_set((top **)pc->next,1,10); return z; } frama-c-20.0-Calcium/tests/rte/oracle/precond2.res.oracle0000666000000000000000000000405513571573400020113 0ustar [kernel] Parsing tests/rte/precond2.c (with preprocessing) /* Generated by Frama-C */ int global = 15; /*@ requires x > 0; requires (int)(x + y) ≢ 0; */ int f(int x, int y, float z) { int __retres; __retres = (x + y) - (int)z; return __retres; } int g(int a, int b) { int __retres; __retres = a / b; return __retres; } int main(void) { int tmp_0; int tmp; int a = 2; int b = 3; tmp = g(a,b); ; tmp_0 = f(b - a,tmp,(float)1.0); return tmp_0; } [kernel] ================================ [kernel] printing status [kernel] kf = f rte_gen_status = false [kernel] kf = g rte_gen_status = false [kernel] kf = main rte_gen_status = false [kernel] computing rte-div annotations [rte] annotating function f [rte] annotating function g [rte] annotating function main /* Generated by Frama-C */ int global = 15; /*@ requires x > 0; requires (int)(x + y) ≢ 0; */ int f(int x, int y, float z) { int __retres; __retres = (x + y) - (int)z; return __retres; } int g(int a, int b) { int __retres; /*@ assert rte: division_by_zero: b ≢ 0; */ __retres = a / b; return __retres; } int main(void) { int tmp_0; int tmp; int a = 2; int b = 3; tmp = g(a,b); ; tmp_0 = f(b - a,tmp,(float)1.0); return tmp_0; } [kernel] ================================ [kernel] printing status [kernel] kf = f rte_gen_status = false [kernel] kf = g rte_gen_status = false [kernel] kf = main rte_gen_status = false [kernel] removing rte-div alarms /* Generated by Frama-C */ int global = 15; /*@ requires x > 0; requires (int)(x + y) ≢ 0; */ int f(int x, int y, float z) { int __retres; __retres = (x + y) - (int)z; return __retres; } int g(int a, int b) { int __retres; __retres = a / b; return __retres; } int main(void) { int tmp_0; int tmp; int a = 2; int b = 3; tmp = g(a,b); ; tmp_0 = f(b - a,tmp,(float)1.0); return tmp_0; } [kernel] ================================ [kernel] printing status [kernel] kf = f rte_gen_status = false [kernel] kf = g rte_gen_status = false [kernel] kf = main rte_gen_status = false frama-c-20.0-Calcium/tests/rte/oracle/reqlabl.res.oracle0000666000000000000000000000033013571573400020011 0ustar [kernel] Parsing tests/rte/reqlabl.c (with preprocessing) [rte] annotating function g /* Generated by Frama-C */ /*@ requires PROP_SUR_982: x > 0; */ int f(int x); void g(int a) { int c; c = f(a); return; } frama-c-20.0-Calcium/tests/rte/oracle/reqlabl2.res.oracle0000666000000000000000000000052213571573400020076 0ustar [kernel] Parsing tests/rte/reqlabl2.c (with preprocessing) [rte] annotating function g /* Generated by Frama-C */ /*@ requires PROP_SUR_982: x > 0; requires PROP_SUR_982: x + 1 > 1; ensures PROP_SUR_982: \old(x) > 0; ensures PROP_SUR_982: \old(x) + 1 > 1; */ int f(int x); void g(int a) { int c; c = f(a); return; } frama-c-20.0-Calcium/tests/rte/oracle/s64.res.oracle0000666000000000000000000000062113571573400017006 0ustar [kernel] Parsing tests/rte/s64.c (with preprocessing) [rte] annotating function main [rte] tests/rte/s64.c:9: Warning: guaranteed RTE: assert signed_overflow: 5LL << 63 ≤ 9223372036854775807; /* Generated by Frama-C */ int main(void) { int __retres; long long z; /*@ assert rte: signed_overflow: 5LL << 63 ≤ 9223372036854775807; */ z = 5LL << 63; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/shift.0.res.oracle0000666000000000000000000000556113571573400017655 0ustar [kernel] Parsing tests/rte/shift.c (with preprocessing) [rte] annotating function main [rte] tests/rte/shift.c:13: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; [rte] tests/rte/shift.c:14: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; [rte] tests/rte/shift.c:16: Warning: guaranteed RTE: assert shift: 0 ≤ (int)(-3); [rte] tests/rte/shift.c:18: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; [rte] tests/rte/shift.c:19: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; [rte] tests/rte/shift.c:20: Warning: guaranteed RTE: assert shift: 0 ≤ 60 < 32; [rte] tests/rte/shift.c:20: Warning: guaranteed RTE: assert signed_overflow: 5 << 60 ≤ 2147483647; [rte] tests/rte/shift.c:22: Warning: guaranteed RTE: assert signed_overflow: 5 << 29 ≤ 2147483647; [rte] tests/rte/shift.c:36: Warning: guaranteed RTE: assert shift: 0 ≤ (int)(-2) < 32; [rte] tests/rte/shift.c:38: Warning: guaranteed RTE: assert shift: 0 ≤ 32 < 32; /* Generated by Frama-C */ int main(void) { int __retres; int i = 0; int x = 0; int y = 0; int z = 0; unsigned int ux = (unsigned int)0; unsigned int uy = (unsigned int)0; unsigned int uz = (unsigned int)0; long lx = (long)0; long ly = (long)0; long lz = (long)0; z = (int)(5u << 30); /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ uz = (unsigned int)(5 << 30); /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ z = 5 << 30; /*@ assert rte: shift: 0 ≤ (int)(-3); */ z = -3 << 2; /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ z = 5 << 30; /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ lz = (long)(5 << 30); /*@ assert rte: shift: 0 ≤ 60 < 32; */ /*@ assert rte: signed_overflow: 5 << 60 ≤ 2147483647; */ lz = (long)(5 << 60); /*@ assert rte: signed_overflow: 5 << 29 ≤ 2147483647; */ z = 5 << 29; z = 5 << 28; z = 5 << 3; z = 5 << 1; i = 0; while (i < 10) { /*@ assert rte: shift: 0 ≤ i < 32; */ /*@ assert rte: signed_overflow: 1 << i ≤ 2147483647; */ z = 1 << i; /*@ assert rte: shift: 0 ≤ i; */ /*@ assert rte: signed_overflow: i << 1 ≤ 2147483647; */ z = i << 1; /*@ assert rte: shift: 0 ≤ i < 32; */ /*@ assert rte: shift: 0 ≤ i; */ /*@ assert rte: signed_overflow: i << i ≤ 2147483647; */ z = i << i; /*@ assert rte: signed_overflow: i + 1 ≤ 2147483647; */ i ++; } /*@ assert rte: shift: 0 ≤ (int)(-2) < 32; */ z = 3 >> -2; z = 3 >> 5; /*@ assert rte: shift: 0 ≤ 32 < 32; */ z = 3 >> 32; z = 3 >> 31; z = -5 >> 1; /*@ assert rte: shift: 0 ≤ y < 32; */ z = x >> y; /*@ assert rte: shift: 0 ≤ y < 32; */ uz = (unsigned int)x >> y; z = -2 >> 1; uz = (unsigned int)(-2) >> 1; z = 0 << 10; z = 0 >> 10; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/shift.1.res.oracle0000666000000000000000000000571413571573400017656 0ustar [kernel] Parsing tests/rte/shift.c (with preprocessing) [rte] annotating function main [rte] tests/rte/shift.c:13: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; [rte] tests/rte/shift.c:14: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; [rte] tests/rte/shift.c:18: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; [rte] tests/rte/shift.c:19: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; [rte] tests/rte/shift.c:20: Warning: guaranteed RTE: assert shift: 0 ≤ 60 < 32; [rte] tests/rte/shift.c:20: Warning: guaranteed RTE: assert signed_overflow: 5 << 60 ≤ 2147483647; [rte] tests/rte/shift.c:22: Warning: guaranteed RTE: assert signed_overflow: 5 << 29 ≤ 2147483647; [rte] tests/rte/shift.c:36: Warning: guaranteed RTE: assert shift: 0 ≤ (int)(-2) < 32; [rte] tests/rte/shift.c:38: Warning: guaranteed RTE: assert shift: 0 ≤ 32 < 32; [rte] tests/rte/shift.c:41: Warning: guaranteed RTE: assert shift: 0 ≤ (int)(-5); [rte] tests/rte/shift.c:46: Warning: guaranteed RTE: assert shift: 0 ≤ (int)(-2); /* Generated by Frama-C */ int main(void) { int __retres; int i = 0; int x = 0; int y = 0; int z = 0; unsigned int ux = (unsigned int)0; unsigned int uy = (unsigned int)0; unsigned int uz = (unsigned int)0; long lx = (long)0; long ly = (long)0; long lz = (long)0; z = (int)(5u << 30); /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ uz = (unsigned int)(5 << 30); /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ z = 5 << 30; z = -3 << 2; /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ z = 5 << 30; /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ lz = (long)(5 << 30); /*@ assert rte: shift: 0 ≤ 60 < 32; */ /*@ assert rte: signed_overflow: 5 << 60 ≤ 2147483647; */ lz = (long)(5 << 60); /*@ assert rte: signed_overflow: 5 << 29 ≤ 2147483647; */ z = 5 << 29; z = 5 << 28; z = 5 << 3; z = 5 << 1; i = 0; while (i < 10) { /*@ assert rte: shift: 0 ≤ i < 32; */ /*@ assert rte: signed_overflow: 1 << i ≤ 2147483647; */ z = 1 << i; /*@ assert rte: signed_overflow: i << 1 ≤ 2147483647; */ z = i << 1; /*@ assert rte: shift: 0 ≤ i < 32; */ /*@ assert rte: signed_overflow: i << i ≤ 2147483647; */ z = i << i; /*@ assert rte: signed_overflow: i + 1 ≤ 2147483647; */ i ++; } /*@ assert rte: shift: 0 ≤ (int)(-2) < 32; */ z = 3 >> -2; z = 3 >> 5; /*@ assert rte: shift: 0 ≤ 32 < 32; */ z = 3 >> 32; z = 3 >> 31; /*@ assert rte: shift: 0 ≤ (int)(-5); */ z = -5 >> 1; /*@ assert rte: shift: 0 ≤ y < 32; */ /*@ assert rte: shift: 0 ≤ x; */ z = x >> y; /*@ assert rte: shift: 0 ≤ y < 32; */ uz = (unsigned int)x >> y; /*@ assert rte: shift: 0 ≤ (int)(-2); */ z = -2 >> 1; uz = (unsigned int)(-2) >> 1; z = 0 << 10; z = 0 >> 10; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/shift_machdep.0.res.oracle0000666000000000000000000000112113571573400021322 0ustar [kernel] Parsing tests/rte/shift_machdep.c (with preprocessing) [rte] annotating function main [rte] tests/rte/shift_machdep.c:9: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; [rte] tests/rte/shift_machdep.c:10: Warning: guaranteed RTE: assert signed_overflow: 5L << 30 ≤ 2147483647; /* Generated by Frama-C */ int main(void) { int __retres; int x; long y; /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ x = 5 << 30; /*@ assert rte: signed_overflow: 5L << 30 ≤ 2147483647; */ y = 5L << 30; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/shift_machdep.1.res.oracle0000666000000000000000000000064113571573400021331 0ustar [kernel] Parsing tests/rte/shift_machdep.c (with preprocessing) [rte] annotating function main [rte] tests/rte/shift_machdep.c:9: Warning: guaranteed RTE: assert signed_overflow: 5 << 30 ≤ 2147483647; /* Generated by Frama-C */ int main(void) { int __retres; int x; long y; /*@ assert rte: signed_overflow: 5 << 30 ≤ 2147483647; */ x = 5 << 30; y = 5L << 30; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/shift_unsigned.0.res.oracle0000666000000000000000000000117013571573400021541 0ustar [kernel] Parsing tests/rte/shift_unsigned.c (with preprocessing) [rte] annotating function main [rte] tests/rte/shift_unsigned.c:11: Warning: guaranteed RTE: assert shift: 0 ≤ (int)(-3) < 32; [rte] tests/rte/shift_unsigned.c:12: Warning: guaranteed RTE: assert shift: 0 ≤ (int)(-4); /* Generated by Frama-C */ int main(void) { int __retres; unsigned int x; unsigned int y; x = 0x10000000U; y = x << 4; y = 0x10000000U << 4; /*@ assert rte: shift: 0 ≤ (int)(-3) < 32; */ y = 1U << -3; /*@ assert rte: shift: 0 ≤ (int)(-4); */ y = (unsigned int)(-4 << 2); __retres = (int)y; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/shift_unsigned.1.res.oracle0000666000000000000000000000157413571573400021552 0ustar [kernel] Parsing tests/rte/shift_unsigned.c (with preprocessing) [rte] annotating function main [rte] tests/rte/shift_unsigned.c:10: Warning: guaranteed RTE: assert unsigned_overflow: 0x10000000U << 4 ≤ 4294967295; [rte] tests/rte/shift_unsigned.c:11: Warning: guaranteed RTE: assert shift: 0 ≤ (int)(-3) < 32; [rte] tests/rte/shift_unsigned.c:12: Warning: guaranteed RTE: assert shift: 0 ≤ (int)(-4); /* Generated by Frama-C */ int main(void) { int __retres; unsigned int x; unsigned int y; x = 0x10000000U; /*@ assert rte: unsigned_overflow: x << 4 ≤ 4294967295; */ y = x << 4; /*@ assert rte: unsigned_overflow: 0x10000000U << 4 ≤ 4294967295; */ y = 0x10000000U << 4; /*@ assert rte: shift: 0 ≤ (int)(-3) < 32; */ y = 1U << -3; /*@ assert rte: shift: 0 ≤ (int)(-4); */ y = (unsigned int)(-4 << 2); __retres = (int)y; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/sizeof.res.oracle0000666000000000000000000000050013571573400017665 0ustar [kernel] Parsing tests/rte/sizeof.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; int x; int y; int z; int *p; int tab[10]; x = (int)sizeof(*p); y = (int)sizeof((double)*p); z = (int)sizeof(tab[3]); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/tab.res.oracle0000666000000000000000000000203513571573400017141 0ustar [kernel] Parsing tests/rte/tab.c (with preprocessing) [rte] annotating function f4 [rte] annotating function g4 [rte] annotating function h4 [rte] annotating function i4 /* Generated by Frama-C */ typedef double typetab[2]; double g4(typetab *t) { double y; /*@ assert rte: mem_access: \valid_read((double *)*t); */ /*@ assert rte: mem_access: \valid_read(&(*t)[1]); */ y = (*t)[0] + (*t)[1]; return y; } double h4(double * /*[2]*/ t) { double __retres; /*@ assert rte: mem_access: \valid_read(t + 0); */ /*@ assert rte: mem_access: \valid_read(t + 1); */ __retres = *(t + 0) + *(t + 1); return __retres; } double i4(double *t) { double __retres; /*@ assert rte: mem_access: \valid_read(t + 0); */ /*@ assert rte: mem_access: \valid_read(t + 1); */ __retres = *(t + 0) + *(t + 1); return __retres; } /*@ assigns \nothing; */ double f4(void) { double __retres; double tab[2]; double r; double tmp; tab[0] = 1.0; tab[1] = 2.0; r = g4(& tab); tmp = h4(tab); ; __retres = r + tmp; return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/threefunc.res.oracle0000666000000000000000000001404713571573400020364 0ustar [kernel] Parsing tests/rte/threefunc.c (with preprocessing) /* Generated by Frama-C */ int g(int x, int y) { int __retres; __retres = x / y; return __retres; } int f(int x, int y) { int __retres; if (x + y != 0) if (x == 2147483647) if (y == 1) { __retres = -1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 1; goto return_label; } return_label: return __retres; } int main(void) { int __retres; int i; int x = 1; int y = 2; i = 0; while (i < 20) { { int tmp = x + y; y = x - y; x = tmp; } i ++; } if (x > 0) if (y > 0) { int tmp_0; int tmp_1; tmp_0 = f(x,y); tmp_1 = g(x,y); __retres = tmp_0 + tmp_1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } [kernel] ================================ [rte] annotating function f [rte] annotating function g [rte] annotating function main /* Generated by Frama-C */ int g(int x, int y) { int __retres; /*@ assert rte: division_by_zero: y ≢ 0; */ /*@ assert rte: signed_overflow: x / y ≤ 2147483647; */ __retres = x / y; return __retres; } int f(int x, int y) { int __retres; /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ if (x + y != 0) if (x == 2147483647) if (y == 1) { __retres = -1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 1; goto return_label; } return_label: return __retres; } int main(void) { int __retres; int i; int x = 1; int y = 2; i = 0; while (i < 20) { { /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ int tmp = x + y; /*@ assert rte: signed_overflow: -2147483648 ≤ x - y; */ /*@ assert rte: signed_overflow: x - y ≤ 2147483647; */ y = x - y; x = tmp; } /*@ assert rte: signed_overflow: i + 1 ≤ 2147483647; */ i ++; } if (x > 0) if (y > 0) { int tmp_0; int tmp_1; tmp_0 = f(x,y); tmp_1 = g(x,y); /*@ assert rte: signed_overflow: -2147483648 ≤ tmp_0 + tmp_1; */ /*@ assert rte: signed_overflow: tmp_0 + tmp_1 ≤ 2147483647; */ __retres = tmp_0 + tmp_1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } [kernel] ================================ [kernel] printing status [kernel] kf = f rte_gen_status = true [kernel] kf = g rte_gen_status = true [kernel] kf = main rte_gen_status = true [kernel] Removing some rte annotations /* Generated by Frama-C */ int g(int x, int y) { int __retres; /*@ assert rte: division_by_zero: y ≢ 0; */ __retres = x / y; return __retres; } int f(int x, int y) { int __retres; if (x + y != 0) if (x == 2147483647) if (y == 1) { __retres = -1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 1; goto return_label; } return_label: return __retres; } int main(void) { int __retres; int i; int x = 1; int y = 2; i = 0; while (i < 20) { { int tmp = x + y; y = x - y; x = tmp; } i ++; } if (x > 0) if (y > 0) { int tmp_0; int tmp_1; tmp_0 = f(x,y); tmp_1 = g(x,y); __retres = tmp_0 + tmp_1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } [kernel] ================================ [kernel] printing status [kernel] kf = f rte_gen_status = true [kernel] kf = g rte_gen_status = true [kernel] kf = main rte_gen_status = true [rte] annotating function f [rte] annotating function main /* Generated by Frama-C */ int g(int x, int y) { int __retres; /*@ assert rte: division_by_zero: y ≢ 0; */ __retres = x / y; return __retres; } int f(int x, int y) { int __retres; /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ if (x + y != 0) if (x == 2147483647) if (y == 1) { __retres = -1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 1; goto return_label; } return_label: return __retres; } int main(void) { int __retres; int i; int x = 1; int y = 2; i = 0; while (i < 20) { { /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ int tmp = x + y; /*@ assert rte: signed_overflow: -2147483648 ≤ x - y; */ /*@ assert rte: signed_overflow: x - y ≤ 2147483647; */ y = x - y; x = tmp; } /*@ assert rte: signed_overflow: i + 1 ≤ 2147483647; */ i ++; } if (x > 0) if (y > 0) { int tmp_0; int tmp_1; tmp_0 = f(x,y); tmp_1 = g(x,y); /*@ assert rte: signed_overflow: -2147483648 ≤ tmp_0 + tmp_1; */ /*@ assert rte: signed_overflow: tmp_0 + tmp_1 ≤ 2147483647; */ __retres = tmp_0 + tmp_1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } [kernel] ================================ [kernel] printing status [kernel] kf = f rte_gen_status = true [kernel] kf = g rte_gen_status = true [kernel] kf = main rte_gen_status = true frama-c-20.0-Calcium/tests/rte/oracle/twofunc.res.oracle0000666000000000000000000001240313571573400020060 0ustar [kernel] Parsing tests/rte/twofunc.c (with preprocessing) /* Generated by Frama-C */ int f(int x, int y) { int __retres; if (x + y != 0) if (x == 2147483647) if (y == 1) { __retres = -1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 1; goto return_label; } return_label: return __retres; } int main(void) { int __retres; int i; int x = 1; int y = 2; i = 0; while (i < 20) { { int tmp = x + y; y = x - y; x = tmp; } i ++; } if (x > 0) if (y > 0) { int tmp_0; tmp_0 = f(x,y); __retres = tmp_0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } [kernel] ================================ [rte] annotating function f [rte] annotating function main /* Generated by Frama-C */ int f(int x, int y) { int __retres; /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ if (x + y != 0) if (x == 2147483647) if (y == 1) { __retres = -1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 1; goto return_label; } return_label: return __retres; } int main(void) { int __retres; int i; int x = 1; int y = 2; i = 0; while (i < 20) { { /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ int tmp = x + y; /*@ assert rte: signed_overflow: -2147483648 ≤ x - y; */ /*@ assert rte: signed_overflow: x - y ≤ 2147483647; */ y = x - y; x = tmp; } /*@ assert rte: signed_overflow: i + 1 ≤ 2147483647; */ i ++; } if (x > 0) if (y > 0) { int tmp_0; tmp_0 = f(x,y); __retres = tmp_0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } [kernel] ================================ [kernel] printing status [kernel] kf = f [kernel] - bool_value = true [kernel] - finite_float = true [kernel] - float_to_int = true [kernel] - unsigned_downcast = false [kernel] - unsigned_overflow = false [kernel] - downcast = true [kernel] - signed_overflow = true [kernel] - right_shift_negative = false [kernel] - left_shift_negative = true [kernel] - shift_value_out_of_bounds = true [kernel] - division_by_zero = true [kernel] - pointer_call = true [kernel] - mem_access = true [kernel] - initialized = false [kernel] kf = main [kernel] - bool_value = true [kernel] - finite_float = true [kernel] - float_to_int = true [kernel] - unsigned_downcast = false [kernel] - unsigned_overflow = false [kernel] - downcast = true [kernel] - signed_overflow = true [kernel] - right_shift_negative = false [kernel] - left_shift_negative = true [kernel] - shift_value_out_of_bounds = true [kernel] - division_by_zero = true [kernel] - pointer_call = true [kernel] - mem_access = true [kernel] - initialized = false [kernel] ================================ /* Generated by Frama-C */ int f(int x, int y) { int __retres; if (x + y != 0) if (x == 2147483647) if (y == 1) { __retres = -1; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 1; goto return_label; } return_label: return __retres; } int main(void) { int __retres; int i; int x = 1; int y = 2; i = 0; while (i < 20) { { int tmp = x + y; y = x - y; x = tmp; } i ++; } if (x > 0) if (y > 0) { int tmp_0; tmp_0 = f(x,y); __retres = tmp_0; goto return_label; } else { __retres = 0; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } [kernel] ================================ [kernel] printing status [kernel] kf = f [kernel] - bool_value = true [kernel] - finite_float = true [kernel] - float_to_int = true [kernel] - unsigned_downcast = false [kernel] - unsigned_overflow = false [kernel] - downcast = true [kernel] - signed_overflow = true [kernel] - right_shift_negative = false [kernel] - left_shift_negative = true [kernel] - shift_value_out_of_bounds = true [kernel] - division_by_zero = true [kernel] - pointer_call = true [kernel] - mem_access = true [kernel] - initialized = false [kernel] kf = main [kernel] - bool_value = true [kernel] - finite_float = true [kernel] - float_to_int = true [kernel] - unsigned_downcast = false [kernel] - unsigned_overflow = false [kernel] - downcast = true [kernel] - signed_overflow = true [kernel] - right_shift_negative = false [kernel] - left_shift_negative = true [kernel] - shift_value_out_of_bounds = true [kernel] - division_by_zero = true [kernel] - pointer_call = true [kernel] - mem_access = true [kernel] - initialized = false [kernel] ================================ frama-c-20.0-Calcium/tests/rte/oracle/twofunc3.res.oracle0000666000000000000000000001044613571573400020150 0ustar [kernel] Parsing tests/rte/twofunc3.c (with preprocessing) [rte] annotating function f [rte] annotating function main /* Generated by Frama-C */ int f(int x, int y) { int __retres; /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ if (x + y != 0) { if (x == 2147483647) if (y == 1) { __retres = -1; goto return_label; } __retres = 0; goto return_label; } __retres = 1; return_label: /*@ assert rte: initialization: \initialized(&__retres); */ return __retres; } int main(void) { int __retres; int i; int x = 1; int y = 2; /*@ assert y > x; */ ; i = 0; while (1) { /*@ assert rte: initialization: \initialized(&i); */ if (! (i < 20)) break; { /*@ assert rte: initialization: \initialized(&x); */ /*@ assert rte: initialization: \initialized(&y); */ /*@ assert rte: signed_overflow: -2147483648 ≤ x + y; */ /*@ assert rte: signed_overflow: x + y ≤ 2147483647; */ int tmp = x + y; /*@ assert rte: initialization: \initialized(&x); */ /*@ assert rte: initialization: \initialized(&y); */ /*@ assert rte: signed_overflow: -2147483648 ≤ x - y; */ /*@ assert rte: signed_overflow: x - y ≤ 2147483647; */ y = x - y; /*@ assert rte: initialization: \initialized(&tmp); */ x = tmp; } /*@ assert rte: initialization: \initialized(&i); */ /*@ assert rte: signed_overflow: i + 1 ≤ 2147483647; */ i ++; } /*@ assert i > 0; */ ; /*@ assert rte: initialization: \initialized(&x); */ if (x > 0) /*@ assert rte: initialization: \initialized(&y); */ if (y > 0) { int tmp_0; /*@ assert rte: initialization: \initialized(&x); */ /*@ assert rte: initialization: \initialized(&y); */ tmp_0 = f(x,y); __retres = tmp_0; goto return_label; } __retres = 0; return_label: /*@ assert rte: initialization: \initialized(&__retres); */ return __retres; } [kernel] ================================ [kernel] Rte-generated annotations for function f [kernel] For Statement if (x + y != 0) { if (x == 2147483647) if (y == 1) { __retres = -1; goto return_label; } __retres = 0; goto return_label; } [kernel] assert rte: signed_overflow: -2147483648 ≤ x + y; [kernel] assert rte: signed_overflow: x + y ≤ 2147483647; [kernel] For Statement return_label: return __retres; [kernel] assert rte: initialization: \initialized(&__retres); [kernel] Rte-generated annotations for function main [kernel] For Statement if (! (i < 20)) break; [kernel] assert rte: initialization: \initialized(&i); [kernel] For Statement int tmp = x + y; [kernel] assert rte: initialization: \initialized(&x); [kernel] assert rte: initialization: \initialized(&y); [kernel] assert rte: signed_overflow: -2147483648 ≤ x + y; [kernel] assert rte: signed_overflow: x + y ≤ 2147483647; [kernel] For Statement y = x - y; [kernel] assert rte: initialization: \initialized(&x); [kernel] assert rte: initialization: \initialized(&y); [kernel] assert rte: signed_overflow: -2147483648 ≤ x - y; [kernel] assert rte: signed_overflow: x - y ≤ 2147483647; [kernel] For Statement x = tmp; [kernel] assert rte: initialization: \initialized(&tmp); [kernel] For Statement i ++; [kernel] assert rte: initialization: \initialized(&i); [kernel] assert rte: signed_overflow: i + 1 ≤ 2147483647; [kernel] For Statement if (x > 0) if (y > 0) { int tmp_0; tmp_0 = f(x,y); __retres = tmp_0; goto return_label; } [kernel] assert rte: initialization: \initialized(&x); [kernel] For Statement if (y > 0) { int tmp_0; tmp_0 = f(x,y); __retres = tmp_0; goto return_label; } [kernel] assert rte: initialization: \initialized(&y); [kernel] For Statement tmp_0 = f(x,y); [kernel] assert rte: initialization: \initialized(&x); [kernel] assert rte: initialization: \initialized(&y); [kernel] For Statement return_label: return __retres; [kernel] assert rte: initialization: \initialized(&__retres); frama-c-20.0-Calcium/tests/rte/oracle/u64.0.res.oracle0000666000000000000000000000063213571573400017150 0ustar [kernel] Parsing tests/rte/u64.i (no preprocessing) [rte] annotating function f /* Generated by Frama-C */ unsigned long f(unsigned int n) { unsigned long __retres; /*@ assert rte: unsigned_overflow: 0 ≤ n * sizeof(unsigned long); */ /*@ assert rte: unsigned_overflow: n * sizeof(unsigned long) ≤ 4294967295; */ __retres = (unsigned long)(n * sizeof(unsigned long)); return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/u64.1.res.oracle0000666000000000000000000000072013571573400017147 0ustar [kernel] Parsing tests/rte/u64.i (no preprocessing) [rte] annotating function f /* Generated by Frama-C */ unsigned long f(unsigned int n) { unsigned long __retres; /*@ assert rte: unsigned_overflow: 0 ≤ (unsigned long)n * sizeof(unsigned long); */ /*@ assert rte: unsigned_overflow: (unsigned long)n * sizeof(unsigned long) ≤ 18446744073709551615; */ __retres = (unsigned long)n * sizeof(unsigned long); return __retres; } frama-c-20.0-Calcium/tests/rte/oracle/unspecified_sequence.res.oracle0000666000000000000000000000301413571573400022557 0ustar [kernel] Parsing tests/rte/unspecified_sequence.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ {0} [eva:alarm] tests/rte/unspecified_sequence.i:7: Warning: function main: precondition got status unknown. [eva] computing for function f <- main. Called from tests/rte/unspecified_sequence.i:10. [eva] Recording results for f [eva] Done for function f [eva] tests/rte/unspecified_sequence.i:11: Reusing old results for call to f [eva] computing for function f <- main. Called from tests/rte/unspecified_sequence.i:11. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {0} [eva:final-states] Values at end of function main: y ∈ {0} z ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: y; tmp; z; tmp_0; tmp_1 [inout] Inputs for function main: t[0] frama-c-20.0-Calcium/tests/rte/oracle/valid.res.oracle0000666000000000000000000002524713571573400017504 0ustar [kernel] Parsing tests/rte/valid.c (with preprocessing) [rte] annotating function main /* Generated by Frama-C */ struct R { int v ; }; struct P; struct Q { int v ; int id[12] ; struct P *next ; struct R tr[13] ; }; struct P { int val ; struct P *next ; int id[5] ; int oth[6][7] ; struct P *nexts[8][9] ; struct Q q ; struct Q tq[10][11] ; struct P ***znexts ; }; int main(void) { struct P ***pppp; struct P **ppp; struct P *pp; struct P p; struct P p2; int v; struct Q q; int *i; int j; struct P *tmp; int i0 = 0; int i1 = 1; int i2 = 2; int i3 = 3; int i4 = 4; j = 0; i = & j; pp = & p; ppp = & pp; pppp = & ppp; p.next = pp; p.znexts = pppp; tmp = pp; /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 8; */ /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 9; */ p.nexts[i2][i3] = tmp; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 9; */ p.nexts[i0][i1] = tmp; q.next = pp; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 12; */ q.id[i0] = 0; p.q = q; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ p.tq[i0][i1] = q; /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 5; */ /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 5; */ p2.id[i1] = p.id[i2]; /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 5; */ /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 5; */ p2.id[i1] = p.id[i3]; /*@ assert rte: mem_access: \valid_read(p.next); */ struct P np = *(p.next); struct P *npp = p.next; v = p.id[3]; /*@ assert rte: mem_access: \valid_read(&pp->id[3]); */ v = pp->id[3]; /*@ assert rte: mem_access: \valid_read(i); */ v = *i; /*@ assert rte: mem_access: \valid_read(&pp->val); */ v = pp->val; /*@ assert rte: mem_access: \valid_read(&pp->id[3]); */ v = pp->id[3]; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 9; */ /*@ assert rte: mem_access: \valid_read(&pp->nexts[i0][i1]); */ struct P *z = pp->nexts[i0][i1]; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 9; */ /*@ assert rte: mem_access: \valid_read(&pp->nexts[i0][i1]); */ /*@ assert rte: mem_access: \valid_read(&(pp->nexts[i0][i1])->val); */ v = (pp->nexts[i0][i1])->val; /*@ assert rte: mem_access: \valid_read(&pp->next); */ /*@ assert rte: mem_access: \valid_read(&(pp->next)->val); */ v = (pp->next)->val; /*@ assert rte: mem_access: \valid_read(&pp->next); */ /*@ assert rte: mem_access: \valid_read(&(pp->next)->next); */ /*@ assert rte: mem_access: \valid_read(&((pp->next)->next)->val); */ v = ((pp->next)->next)->val; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 8; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 9; */ /*@ assert rte: mem_access: \valid_read(&(p.nexts[i0][i1])->val); */ v = (p.nexts[i0][i1])->val; /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 5; */ /*@ assert rte: mem_access: \valid_read(&pp->id[i2]); */ v = pp->id[i2]; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 6; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 7; */ /*@ assert rte: mem_access: \valid_read(&pp->oth[i0][i1]); */ v = pp->oth[i0][i1]; /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 8; */ /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 9; */ /*@ assert rte: mem_access: \valid_read(i); */ /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 8; */ /*@ assert rte: index_bound: 0 ≤ *i; */ /*@ assert rte: index_bound: *i < 9; */ /*@ assert rte: mem_access: \valid_read(&(p.nexts[i1][i2])->nexts[i3][*i]); */ /*@ assert rte: index_bound: 0 ≤ i4; */ /*@ assert rte: index_bound: i4 < 5; */ /*@ assert rte: mem_access: \valid_read(&((p.nexts[i1][i2])->nexts[i3][*i])->id[i4]); */ v = ((p.nexts[i1][i2])->nexts[i3][*i])->id[i4]; v = p.q.v; /*@ assert rte: index_bound: 0 ≤ i4; */ /*@ assert rte: index_bound: i4 < 12; */ v = p.q.id[i4]; /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ v = p.tq[i3][i1].v; /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 10; */ /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 11; */ /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 10; */ /*@ assert rte: index_bound: 0 ≤ i4; */ /*@ assert rte: index_bound: i4 < 11; */ /*@ assert rte: mem_access: \valid_read(&(p.tq[i1][i2].next)->tq[i3][i4].v); */ v = (p.tq[i1][i2].next)->tq[i3][i4].v; /*@ assert rte: index_bound: 0 ≤ i3; */ /*@ assert rte: index_bound: i3 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ /*@ assert rte: mem_access: \valid_read(&pp->tq[i3][i1].v); */ v = pp->tq[i3][i1].v; /*@ assert rte: mem_access: \valid_read(p.znexts + i0); */ /*@ assert rte: mem_access: \valid_read(*(p.znexts + i0) + i1); */ /*@ assert rte: mem_access: \valid_read(&(*(*(p.znexts + i0) + i1) + i2)->val); */ v = (*(*(p.znexts + i0) + i1) + i2)->val; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ q = p.tq[i0][i1]; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ /*@ assert rte: index_bound: 0 ≤ i2; */ /*@ assert rte: index_bound: i2 < 13; */ v = p.tq[i0][i1].tr[i2].v; /*@ assert rte: mem_access: \valid_read(&pp->val); */ v = pp->val; v = p.val; /*@ assert rte: index_bound: 0 ≤ i0; */ /*@ assert rte: index_bound: i0 < 10; */ /*@ assert rte: index_bound: 0 ≤ i1; */ /*@ assert rte: index_bound: i1 < 11; */ v = p.tq[i0][i1].v; return v; } [rte] annotating function main /* Generated by Frama-C */ struct R { int v ; }; struct P; struct Q { int v ; int id[12] ; struct P *next ; struct R tr[13] ; }; struct P { int val ; struct P *next ; int id[5] ; int oth[6][7] ; struct P *nexts[8][9] ; struct Q q ; struct Q tq[10][11] ; struct P ***znexts ; }; int main(void) { struct P ***pppp; struct P **ppp; struct P *pp; struct P p; struct P p2; int v; struct Q q; int *i; int j; struct P *tmp; int i0 = 0; int i1 = 1; int i2 = 2; int i3 = 3; int i4 = 4; j = 0; i = & j; pp = & p; ppp = & pp; pppp = & ppp; p.next = pp; p.znexts = pppp; tmp = pp; /*@ assert rte: mem_access: \valid(&p.nexts[i2][i3]); */ p.nexts[i2][i3] = tmp; /*@ assert rte: mem_access: \valid(&p.nexts[i0][i1]); */ p.nexts[i0][i1] = tmp; q.next = pp; /*@ assert rte: mem_access: \valid(&q.id[i0]); */ q.id[i0] = 0; p.q = q; /*@ assert rte: mem_access: \valid(&p.tq[i0][i1]); */ p.tq[i0][i1] = q; /*@ assert rte: mem_access: \valid(&p2.id[i1]); */ /*@ assert rte: mem_access: \valid_read(&p.id[i2]); */ p2.id[i1] = p.id[i2]; /*@ assert rte: mem_access: \valid(&p2.id[i1]); */ /*@ assert rte: mem_access: \valid_read(&p.id[i3]); */ p2.id[i1] = p.id[i3]; /*@ assert rte: mem_access: \valid_read(p.next); */ struct P np = *(p.next); struct P *npp = p.next; /*@ assert rte: mem_access: \valid_read(&p.id[3]); */ v = p.id[3]; /*@ assert rte: mem_access: \valid_read(&pp->id[3]); */ v = pp->id[3]; /*@ assert rte: mem_access: \valid_read(i); */ v = *i; /*@ assert rte: mem_access: \valid_read(&pp->val); */ v = pp->val; /*@ assert rte: mem_access: \valid_read(&pp->id[3]); */ v = pp->id[3]; /*@ assert rte: mem_access: \valid_read(&pp->nexts[i0][i1]); */ struct P *z = pp->nexts[i0][i1]; /*@ assert rte: mem_access: \valid_read(&pp->nexts[i0][i1]); */ /*@ assert rte: mem_access: \valid_read(&(pp->nexts[i0][i1])->val); */ v = (pp->nexts[i0][i1])->val; /*@ assert rte: mem_access: \valid_read(&pp->next); */ /*@ assert rte: mem_access: \valid_read(&(pp->next)->val); */ v = (pp->next)->val; /*@ assert rte: mem_access: \valid_read(&pp->next); */ /*@ assert rte: mem_access: \valid_read(&(pp->next)->next); */ /*@ assert rte: mem_access: \valid_read(&((pp->next)->next)->val); */ v = ((pp->next)->next)->val; /*@ assert rte: mem_access: \valid_read(&p.nexts[i0][i1]); */ /*@ assert rte: mem_access: \valid_read(&(p.nexts[i0][i1])->val); */ v = (p.nexts[i0][i1])->val; /*@ assert rte: mem_access: \valid_read(&pp->id[i2]); */ v = pp->id[i2]; /*@ assert rte: mem_access: \valid_read(&pp->oth[i0][i1]); */ v = pp->oth[i0][i1]; /*@ assert rte: mem_access: \valid_read(&p.nexts[i1][i2]); */ /*@ assert rte: mem_access: \valid_read(i); */ /*@ assert rte: mem_access: \valid_read(&(p.nexts[i1][i2])->nexts[i3][*i]); */ /*@ assert rte: mem_access: \valid_read(&((p.nexts[i1][i2])->nexts[i3][*i])->id[i4]); */ v = ((p.nexts[i1][i2])->nexts[i3][*i])->id[i4]; v = p.q.v; /*@ assert rte: mem_access: \valid_read(&p.q.id[i4]); */ v = p.q.id[i4]; /*@ assert rte: mem_access: \valid_read(&p.tq[i3][i1].v); */ v = p.tq[i3][i1].v; /*@ assert rte: mem_access: \valid_read(&p.tq[i1][i2].next); */ /*@ assert rte: mem_access: \valid_read(&(p.tq[i1][i2].next)->tq[i3][i4].v); */ v = (p.tq[i1][i2].next)->tq[i3][i4].v; /*@ assert rte: mem_access: \valid_read(&pp->tq[i3][i1].v); */ v = pp->tq[i3][i1].v; /*@ assert rte: mem_access: \valid_read(p.znexts + i0); */ /*@ assert rte: mem_access: \valid_read(*(p.znexts + i0) + i1); */ /*@ assert rte: mem_access: \valid_read(&(*(*(p.znexts + i0) + i1) + i2)->val); */ v = (*(*(p.znexts + i0) + i1) + i2)->val; /*@ assert rte: mem_access: \valid_read(&p.tq[i0][i1]); */ q = p.tq[i0][i1]; /*@ assert rte: mem_access: \valid_read(&p.tq[i0][i1].tr[i2].v); */ v = p.tq[i0][i1].tr[i2].v; /*@ assert rte: mem_access: \valid_read(&pp->val); */ v = pp->val; v = p.val; /*@ assert rte: mem_access: \valid_read(&p.tq[i0][i1].v); */ v = p.tq[i0][i1].v; return v; } frama-c-20.0-Calcium/tests/rte/oracle/value_rte.res.oracle0000666000000000000000000010777513571573400020402 0ustar [kernel] Parsing tests/rte/value_rte.c (with preprocessing) [rte] annotating function main [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function getchar <- main. Called from tests/rte/value_rte.c:12. [eva] using specification for function getchar [eva] Done for function getchar [eva] tests/rte/value_rte.c:13: assertion 'rte,index_bound' got status valid. [eva] tests/rte/value_rte.c:15: assertion 'rte,signed_overflow' got status valid. [eva] tests/rte/value_rte.c:11: starting to merge loop iterations [eva] computing for function getchar <- main. Called from tests/rte/value_rte.c:12. [eva] Done for function getchar [eva] computing for function getchar <- main. Called from tests/rte/value_rte.c:12. [eva] Done for function getchar [eva] computing for function getchar <- main. Called from tests/rte/value_rte.c:12. [eva] Done for function getchar [eva] computing for function getchar <- main. Called from tests/rte/value_rte.c:12. [eva] Done for function getchar [eva:alarm] tests/rte/value_rte.c:13: Warning: assertion 'rte,index_bound' got status unknown. [eva] Recording results for main [eva] done for function main [eva] tests/rte/value_rte.c:13: assertion 'rte,index_bound' got final status valid. [eva] tests/rte/value_rte.c:15: assertion 'rte,signed_overflow' got final status valid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} cpt ∈ {0; 1; 2; 3; 4} tmp ∈ [-2147483648..4] __retres ∈ {1} S___fc_stdin[0..1] ∈ [--..--] [report] Computing properties status... -------------------------------------------------------------------------------- --- Global Properties -------------------------------------------------------------------------------- [ Extern ] Axiom 'memchr_def' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_left' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_right' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_shift_left' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_strlen_shift_right' Unverifiable but considered Valid. [ Extern ] Axiom 'memcmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'memset_def' Unverifiable but considered Valid. [ Extern ] Axiom 'strchr_def' Unverifiable but considered Valid. [ Extern ] Axiom 'strcmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_at_null' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_before_null' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_create' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_create_shift' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_neg' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_not_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_pos_or_null' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_shift' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_sup' Unverifiable but considered Valid. [ Extern ] Axiom 'strlen_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'strncmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wcschr_def' Unverifiable but considered Valid. [ Extern ] Axiom 'wcscmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_at_null' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_before_null' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_create' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_create_shift' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_neg' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_not_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_pos_or_null' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_shift' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_sup' Unverifiable but considered Valid. [ Extern ] Axiom 'wcslen_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wcsncmp_zero' Unverifiable but considered Valid. [ Extern ] Axiom 'wmemchr_def' Unverifiable but considered Valid. [ Valid ] Axiomatic 'GetsLength' by Frama-C kernel. [ Valid ] Axiomatic 'MemChr' by Frama-C kernel. [ Valid ] Axiomatic 'MemCmp' by Frama-C kernel. [ Valid ] Axiomatic 'MemSet' by Frama-C kernel. [ Valid ] Axiomatic 'StrChr' by Frama-C kernel. [ Valid ] Axiomatic 'StrCmp' by Frama-C kernel. [ Valid ] Axiomatic 'StrLen' by Frama-C kernel. [ Valid ] Axiomatic 'StrNCmp' by Frama-C kernel. [ Valid ] Axiomatic 'WMemChr' by Frama-C kernel. [ Valid ] Axiomatic 'WcsChr' by Frama-C kernel. [ Valid ] Axiomatic 'WcsCmp' by Frama-C kernel. [ Valid ] Axiomatic 'WcsLen' by Frama-C kernel. [ Valid ] Axiomatic 'WcsNCmp' by Frama-C kernel. [ Valid ] Axiomatic 'format_length' by Frama-C kernel. [ Valid ] Axiomatic 'pipe_streams' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'remove' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_ok_or_error' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 76) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'rename' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_ok_or_error' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 85) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'tmpfile' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_valid_fd' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 95) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'tmpnam' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_string_or_null' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 109) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 109) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 111) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 112) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fclose' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_zero_or_EOF' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 121) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fflush' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_zero_or_EOF' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 130) Unverifiable but considered Valid. [ Extern ] Assigns for 'flush_all' (file share/libc/stdio.h, line 137) Unverifiable but considered Valid. [ Extern ] Assigns for 'flush_stream' (file share/libc/stdio.h, line 142) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 130) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 132) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 132) Unverifiable but considered Valid. [ Extern ] Froms for 'flush_all' (file share/libc/stdio.h, line 137) Unverifiable but considered Valid. [ Extern ] Froms for 'flush_all' (file share/libc/stdio.h, line 139) Unverifiable but considered Valid. [ Extern ] Froms for 'flush_stream' (file share/libc/stdio.h, line 142) Unverifiable but considered Valid. [ Extern ] Froms for 'flush_stream' (file share/libc/stdio.h, line 143) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Behavior 'flush_all' by Frama-C kernel. [ Valid ] Behavior 'flush_stream' by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fopen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_valid_fd' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 152) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fdopen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_valid_fd' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 162) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 162) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 162) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'freopen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_valid_fd' Unverifiable but considered Valid. [ Extern ] Post-condition 'stream_opened' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 174) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 174) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 176) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'setbuf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 187) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 187) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'setvbuf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 191) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 191) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vfprintf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 220) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 220) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vfscanf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 225) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 225) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vprintf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 231) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 231) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vscanf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 235) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 235) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vsnprintf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 240) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 240) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'vsprintf' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 246) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 246) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fgetc' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_uchar_or_eof' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 259) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 259) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 260) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fgets' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_same' Unverifiable but considered Valid. [ Extern ] Post-condition 'initialization,at_least_one' Unverifiable but considered Valid. [ Extern ] Post-condition 'terminated_string_on_success' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 268) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 268) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 269) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fputc' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 282) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 282) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 283) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fputs' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 289) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 289) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 290) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'getc' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 297) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 297) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 297) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'getchar' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 302) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 302) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 302) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'gets' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_null_or_same' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 315) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 315) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 316) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 317) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'putc' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 324) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 324) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 325) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'putchar' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 330) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 330) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 331) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'puts' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 337) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 337) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 338) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ungetc' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_ok_or_error' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 344) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 344) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 345) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fread' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'size_read' Unverifiable but considered Valid. [ Extern ] Post-condition 'initialization' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 353) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 353) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 353) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 355) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fwrite' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'size_written' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 366) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 366) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 366) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fgetpos' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 377) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 377) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 378) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fseek' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 386) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 386) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 387) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 387) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fsetpos' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 396) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 396) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ftell' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'success_or_error' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 402) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 402) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 402) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'rewind' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 410) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 410) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'clearerr' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 416) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 416) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'feof' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 422) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fileno' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 428) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'flockfile' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 434) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 434) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'funlockfile' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 440) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 440) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ftrylockfile' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 446) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 446) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 446) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ferror' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 452) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'perror' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 458) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 458) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'getc_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 464) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 464) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 464) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'getchar_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 469) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'putc_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 475) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 475) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 476) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'putchar_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 481) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 481) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 482) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'clearerr_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns (file share/libc/stdio.h, line 488) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 488) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'feof_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 494) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'ferror_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 500) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'fileno_unlocked' -------------------------------------------------------------------------------- [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 506) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'popen' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'result_error_or_valid_open_pipe' Unverifiable but considered Valid. [ Extern ] Assigns (file share/libc/stdio.h, line 533) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 533) Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 535) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'pclose' -------------------------------------------------------------------------------- [ Extern ] Post-condition 'closed_stream' Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Extern ] Froms (file share/libc/stdio.h, line 547) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Assertion 'rte,index_bound' (file tests/rte/value_rte.c, line 13) by Eva. [ - ] Assertion 'rte,index_bound' (file tests/rte/value_rte.c, line 13) tried with Eva. [ Valid ] Assertion 'rte,signed_overflow' (file tests/rte/value_rte.c, line 15) by Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 72 Completely validated 198 Considered valid 1 To be validated 271 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/rte/postcond.c0000666000000000000000000000113513571573400015144 0ustar /* run.config OPT: -rte -warn-signed-overflow -rte-no-mem -print */ /*@ ensures \result == -x ; behavior pos: assumes first_bhv:(x >= 0) ; ensures \result <= 0; assigns *y; behavior neg: assumes second_bhv:(x < 0 ); ensures \result > 0; assigns \nothing; complete behaviors pos,neg; disjoint behaviors pos,neg; */ int f(int x, int *y) { if (x >= 0) *y = x; return -x; } /*@ assigns *x; ensures *x == y; */ void g(int y, int* x) { *x = f(y,&y); } int main() { int a = 5; int c; int b = f(a,&c); g(b,&a); b = b + a; return b; } frama-c-20.0-Calcium/tests/rte/postcond2.c0000666000000000000000000000057613571573400015236 0ustar /* run.config OPT: -rte -warn-signed-overflow -print */ /*@ requires \valid(x); requires \valid_range(x, 0, 10); assigns *x \from y; assigns \result \from *x; */ int g(int *x, int y); /*@ requires \valid(&tab[0]); assigns \nothing; */ int f(int* tab) { return 0; } int main() { int tab[2] = { 3, 4 }; int a = f(tab); return g(&tab[3 - tab[0]] + a, a); } frama-c-20.0-Calcium/tests/rte/precond.c0000666000000000000000000000505713571573400014754 0ustar /* run.config OPT: -rte -warn-signed-overflow -warn-special-float none -print -journal-disable */ int global = 15; typedef struct cell { int val; struct cell* next; } cell; typedef struct other { cell c; } other; /*@ requires x > 0 ; requires (int) (x + y) != 0 ; */ int f(int x, int y, float z) { return x + y - (int) z; } /*@ predicate is_valid_int_range(int* p, int n) = (0 <= n) && \valid_range(p,0,n-1) ; */ /*@ requires is_valid_int_range(p,i); */ int g(int* p, int i) { if (i >= 1) return p[i-1]; else return 0; } /*@ requires \valid(&p[1]+3) ; */ int h(int* p) { return *(p+3); } /*@ requires \valid(p->next); // requires \valid(&p->next); // requires \valid(&p->val); requires \valid(p); */ cell* set(cell* p, int v) { p->val=v; return p->next; } /*@ requires \valid(cIn.next); requires global > 0; */ int next_val(cell cIn) { return cIn.next->val; } typedef struct top { int topv; cell* next; cell* pred; } top; /*@ requires \valid(ptop->next); */ cell* top_set(top* ptop, int v) { return set(ptop->next, v); } /*@ requires \valid(tIn.next); */ int top_next(top tIn) { return next_val(*tIn.next); } /*@ requires \valid(tab_top); requires \valid(&tab_top); requires \valid(tab_top[i]->next); */ cell* tabtop_set(top* tab_top[], int i, int v) { return top_set(tab_top[i], v); } int main() { int a=2,b=3; cell c = { 20 , 0 }; cell* pc; top T; top tabT[2]; top* ptabT[3] = { &T, &T, &T }; top** pptop; other ot = { c }; void* V; int k = 1, l = 1; int z= f(2,3,1.0), y = f(b-a,a,2.0); int w; int tab[4] = { 1, 2, 3, 4 }; int* r; int** rr; z = f(y,a+b,-0.0); w = g(&z,1); w = g(&tab[1],2); w = g(&tab[k],l); r = tab; rr = &r; w = g(r+2,0); w = h(tab); w = h(r); w = h (*rr); // w = h(&tab[1]); // w = h(&tab[k]); pc = &c; c.next = &c; set(pc,15); set(&c,10); set((cell*)(void*)&c,20); V = &c; set((cell*) V, 20); next_val(c); next_val(*pc); next_val(*((cell*) V)); T.pred = &c; T.next = &c; tabT[0] = T; tabT[1] = T; set(T.pred,10); set(tabT[1].next,20); next_val(*T.next); next_val(*tabT[0].pred); set(ptabT[2]->pred,15); set(tabT[1].pred,10); next_val(*(ptabT[1]->next)); top_set(&T, 3); top_set(&tabT[1],2); top_set(ptabT[1],4); top_set((top*) (c.next), 5); top_next(T); top_next(*ptabT[0]); tabtop_set(ptabT, 2, 10); pptop = (void*) ptabT; tabtop_set(pptop,2,15); tabtop_set((top**) ptabT, 1, 20); tabtop_set((top**) pc->next, 1, 10); return z; } frama-c-20.0-Calcium/tests/rte/precond2.c0000666000000000000000000000102413571573400015024 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/compute_annot/compute_annot.cmxs OPT: -warn-special-float none -load-module @PTEST_DIR@/compute_annot/compute_annot -journal-disable */ int global = 15; typedef struct cell { int val; struct cell* next; } cell; typedef struct other { cell c; } other; /*@ requires x > 0 ; requires (int) (x + y) != 0 ; */ int f(int x, int y, float z) { return x + y - (int) z; } int g(int a, int b) { return a / b ; } int main() { int a=2,b=3; return f(b-a,g(a,b),1.0); } frama-c-20.0-Calcium/tests/rte/reqlabl.c0000666000000000000000000000024013571573400014731 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -journal-disable */ //@ requires PROP_SUR_982: x>0; int f(int x); void g(int a) { int c; c = f(a); } frama-c-20.0-Calcium/tests/rte/reqlabl2.c0000666000000000000000000000035313571573400015020 0ustar /* run.config OPT: -rte -warn-signed-overflow -print */ /*@ requires PROP_SUR_982: x>0; requires PROP_SUR_982: x+1>1; ensures PROP_SUR_982: x>0; ensures PROP_SUR_982: x+1>1; */ int f(int x); void g(int a) { int c; c = f(a); } frama-c-20.0-Calcium/tests/rte/rte_api/0000777000000000000000000000000013571573400014572 5ustar frama-c-20.0-Calcium/tests/rte/rte_api/rte_get_annot.ml0000666000000000000000000000270713571573400017762 0ustar open Cil open Cil_types let print () = File.pretty_ast (); Kernel.log "================================" let get_rte_annotations = Dynamic.get ~plugin:"RteGen" "get_rte_annotations" (Datatype.func Cil_datatype.Stmt.ty (let module L = Datatype.List(Cil_datatype.Code_annotation) in L.ty)) let fetch_stmts_visitor () = object inherit nopCilVisitor val mutable stmts : stmt list = [] method fetch_stmts () = List.rev stmts method! vstmt stmt = stmts <- stmt :: stmts ; DoChildren end let get_stmts kf = match kf.fundec with | Definition (f,_) -> let vis = fetch_stmts_visitor () in let _ = visitCilFunction (vis :> cilVisitor) f in vis#fetch_stmts () | _ -> [] let show_rte_of_kf kf = let is_annot = ref false in Kernel.log "Rte-generated annotations for function %a" Kernel_function.pretty kf ; List.iter (fun stmt -> let lannot = get_rte_annotations stmt in match lannot with | [] -> () | lannot -> is_annot := true; Kernel.log "For Statement %a" (Printer.without_annot Printer.pp_stmt) stmt; List.iter (fun a -> Kernel.log "%a" Printer.pp_code_annotation a) lannot) (get_stmts kf); if not !is_annot then Kernel.log "None" let main () = Ast.compute () ; Kernel.SignedOverflow.on (); let do_rte = !Db.RteGen.do_rte in Globals.Functions.iter (fun kf -> do_rte kf); print () ; Globals.Functions.iter show_rte_of_kf let () = Db.Main.extend main frama-c-20.0-Calcium/tests/rte/s64.c0000666000000000000000000000021413571573400013724 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 */ int main() { long long z; z = 5LL << 63; return 0; } frama-c-20.0-Calcium/tests/rte/shift.c0000666000000000000000000000135013571573400014427 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 OPT: -rte -warn-right-shift-negative -no-warn-left-shift-negative -print -machdep x86_32 */ int main() { int i=0; int x=0,y=0,z=0; unsigned int ux=0,uy=0,uz=0; long lx=0,ly=0,lz=0; z = 5u << 30; uz = 5 << 30; z = 5 << 30; z = -3 << 2; z = 5 << 30; lz = 5 << 30; lz = 5 << 60; z = 5 << 29; z = 5 << 28; z = 5 << 3; z = 5 << 1; for(i = 0 ; i < 10 ; ++i) { z = 1 << i ; z = i << 1 ; z = i << i ; } z = 3 >> -2; z = 3 >> 5; z = 3 >> 32; z= 3 >> 31; z = -5 >> 1; z = x >> y; uz = ((unsigned int) x) >> y; z = -2 >> 1; uz = ((unsigned int) -2) >> 1; z = 0 << 10; z = 0 >> 10; return 0; } frama-c-20.0-Calcium/tests/rte/shift_machdep.c0000666000000000000000000000032213571573400016106 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 OPT: -rte -warn-signed-overflow -print -machdep x86_64 */ int main() { int x; long y; x = 5 << 30; y = 5L << 30; return 0; } frama-c-20.0-Calcium/tests/rte/shift_unsigned.c0000666000000000000000000000044613571573400016330 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 OPT: -rte -warn-signed-overflow -warn-unsigned-overflow -print -machdep x86_32 */ int main () { unsigned int x, y; x= 0x10000000U; y = x << 4; y = 0x10000000U << 4; y = 1U << -3; y = -4 << 2; return y; } frama-c-20.0-Calcium/tests/rte/sizeof.c0000666000000000000000000000030613571573400014611 0ustar /* run.config OPT: -rte -warn-signed-overflow -print */ int main() { int x, y,z ; int *p; int tab[10]; x = sizeof(*p); y = sizeof((double) *p); z = sizeof(tab[3]); return 0; } frama-c-20.0-Calcium/tests/rte/tab.c0000666000000000000000000000062213571573400014061 0ustar /* run.config OPT: -rte -warn-signed-overflow -warn-special-float none -print */ typedef double typetab[2]; double g4(typetab *t) { double y; y = (*t)[0] + (*t)[1]; return y; } double h4(typetab t) { return t[0] + t[1]; } double i4(double* t) { return t[0] + t[1]; } /*@ assigns \nothing; */ double f4() { double tab[2],r; tab[0]=1.0; tab[1]=2.0; r = g4( &tab ) ; return r + h4(tab); } frama-c-20.0-Calcium/tests/rte/threefunc.c0000666000000000000000000000101213571573400015270 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/my_annotation/my_annotation.cmxs OPT: -load-module @PTEST_DIR@/my_annotation/my_annotation */ int g(int x, int y) { return x / y ; } int f(int x, int y) { if (x + y != 0) { if ((x == 2147483647) && (y == 1)) return -1; else return 0; } else return 1; } int main() { int x =1 , y =2; int i; for (i = 0 ; i < 20 ; ++i) { int tmp = x+y; y = x-y; x = tmp; } if ((x > 0) && (y > 0)) return f(x,y) + g(x,y); else return 0; } frama-c-20.0-Calcium/tests/rte/twofunc.c0000666000000000000000000000073313571573400015003 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/my_annot_proxy/my_annot_proxy.cmxs OPT: -load-module @PTEST_DIR@/my_annot_proxy/my_annot_proxy */ int f(int x, int y) { if (x + y != 0) { if ((x == 2147483647) && (y == 1)) return -1; else return 0; } else return 1; } int main() { int x =1 , y =2; int i; for (i = 0 ; i < 20 ; ++i) { int tmp = x+y; y = x-y; x = tmp; } if ((x > 0) && (y > 0)) return f(x,y); else return 0; } frama-c-20.0-Calcium/tests/rte/twofunc3.c0000666000000000000000000000101713571573400015062 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/rte_api/rte_get_annot.cmxs OPT: -rte-select @@all -load-module @PTEST_DIR@/rte_api/rte_get_annot -journal-disable */ int f(int x, int y) { if (x + y != 0) { if ((x == 2147483647) && (y == 1)) return -1; return 0; } return 1; } int main() { int x =1 , y =2; int i; //@ assert (y > x); for (i = 0 ; i < 20 ; ++i) { int tmp = x+y; y = x-y; x = tmp; } //@ assert (i > 0); if ((x > 0) && (y > 0)) return f(x,y); return 0; } frama-c-20.0-Calcium/tests/rte/u64.i0000666000000000000000000000034313571573400013737 0ustar /* run.config OPT: -rte -warn-unsigned-overflow -print -journal-disable OPT: -rte -warn-unsigned-overflow -print -journal-disable -machdep x86_64 */ unsigned long f(unsigned int n) { return n * sizeof(unsigned long); } frama-c-20.0-Calcium/tests/rte/unspecified_sequence.i0000666000000000000000000000027613571573400017514 0ustar unsigned long long f(int x) { return 0; } int t[10]; //@ requires x < 1 << 30; void main(int x) { unsigned long long v; int y = t[(int)f(x+1)]; int z = t[(int)f(x+1)+(int)f(x)]; } frama-c-20.0-Calcium/tests/rte/valid.c0000666000000000000000000000260713571573400014417 0ustar /* run.config OPT: -rte -warn-signed-overflow -print -machdep x86_32 -then -unsafe-arrays */ struct R { int v; }; struct Q { int v; int id[12]; struct P* next; struct R tr[13]; }; struct P { int val; struct P* next; int id[5]; int oth[6][7]; struct P* nexts[8][9]; struct Q q; struct Q tq[10][11]; struct P*** znexts; }; int main() { struct P*** pppp; struct P** ppp; struct P* pp; struct P p, p2; int v; struct Q q; int *i,j; int i0 = 0; int i1 = 1; int i2 = 2; int i3 = 3; int i4 = 4; j=0; i = &j; pp = &p; ppp = &pp; pppp = &ppp; p.next = pp; p.znexts = pppp; p.nexts[i0][i1] = p.nexts[i2][i3] = pp; q.next = pp; q.id[i0] = 0; p.q = q; p.tq[i0][i1] = q; p2.id[i1] = p.id[i2]; p2.id[i1] = p.id[i3]; struct P np = *(p.next); struct P* npp = p.next; v = p.id[3]; v = pp->id[3]; v = *i; v = pp->val; v = pp->id[3]; struct P* z = pp->nexts[i0][i1]; v = pp->nexts[i0][i1]->val; v = pp->next->val; v = pp->next->next->val; v = p.nexts[i0][i1]->val; v = pp->id[i2]; v = pp ->oth[i0][i1]; v = p.nexts[i1][i2]->nexts[i3][*i]->id[i4]; v = p.q.v; v = p.q.id[i4]; v = p.tq[i3][i1].v; v = p.tq[i1][i2].next->tq[i3][i4].v; v = pp->tq[i3][i1].v; v = p.znexts[i0][i1][i2].val; q = p.tq[i0][i1]; v = p.tq[i0][i1].tr[i2].v; v = pp->val; v = p.val; v = p.tq[i0][i1].v; return v; } frama-c-20.0-Calcium/tests/rte/value_rte.c0000666000000000000000000000041513571573400015301 0ustar /* run.config OPT: -rte -then -eva @EVA_OPTIONS@ -then -report */ #include "stdio.h" int main(){ int t[5] = {1,2,3,4,5}; int cpt =0 ; int tmp ; while (cpt<10){ tmp = getchar() ; if ( t[cpt] > tmp ) { return 1 ; } cpt++ ; } return 10 ; } frama-c-20.0-Calcium/tests/rte_manual/0000777000000000000000000000000013571573400014504 5ustar frama-c-20.0-Calcium/tests/rte_manual/bitwise.i0000666000000000000000000000016713571573400016330 0ustar /* run.config OPT: -rte -then -print */ int main(void) { int x,y,z; z = x << y; z = x >> y; return 0; } frama-c-20.0-Calcium/tests/rte_manual/contract.i0000666000000000000000000000070213571573400016472 0ustar /* run.config OPT: -rte -then -print */ /*@ ensures \result == -\at(x,Old); behavior pos: assumes x >= 0; ensures \result <= 0; assigns *y; behavior neg: assumes x < 0; ensures \result > 0; assigns \nothing; */ int f(int x , int *y ) { int __retres ; if (x >= 0) { *y = x; } __retres = - x; return (__retres); } int main(void) { int a, b ,c; a = 5; b = f(a,& c); return (b + c); } frama-c-20.0-Calcium/tests/rte_manual/div.i0000666000000000000000000000025413571573400015441 0ustar /* run.config OPT: -rte -then -print */ void f(void) { int x,y,z; // some code z = y / x; } int main(void) { unsigned int ux; // some code ux = 1 / ux; } frama-c-20.0-Calcium/tests/rte_manual/float.i0000666000000000000000000000022013571573400015755 0ustar /* run.config OPT: -rte -rte-float-to-int -warn-special-float none -then -print */ int f(float v) { int i = (int)(v+3.0f); return i; } frama-c-20.0-Calcium/tests/rte_manual/machdep.i0000666000000000000000000000024413571573400016257 0ustar /* run.config OPT: -rte -then -print OPT: -machdep x86_64 -rte -then -print */ int main(void) { signed long int lx, ly, lz; lz = lx * ly; return 0; } frama-c-20.0-Calcium/tests/rte_manual/memaccess.i0000666000000000000000000000030413571573400016613 0ustar /* run.config OPT: -rte -then -print */ extern void f(int* p); int i; unsigned int j; int main(void) { int *p; int tab[10]; *p = 3; tab[i] = *p; *(p + 1) = tab[j]; return 0; } frama-c-20.0-Calcium/tests/rte_manual/oracle/0000777000000000000000000000000013571573400015751 5ustar frama-c-20.0-Calcium/tests/rte_manual/oracle/bitwise.res.oracle0000666000000000000000000000065613571573400021405 0ustar [kernel] Parsing tests/rte_manual/bitwise.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; int x; int y; int z; /*@ assert rte: shift: 0 ≤ y < 32; */ /*@ assert rte: shift: 0 ≤ x; */ /*@ assert rte: signed_overflow: x << y ≤ 2147483647; */ z = x << y; /*@ assert rte: shift: 0 ≤ y < 32; */ z = x >> y; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/contract.res.oracle0000666000000000000000000000150213571573400021543 0ustar [kernel] Parsing tests/rte_manual/contract.i (no preprocessing) [rte] annotating function f [rte] annotating function main /* Generated by Frama-C */ /*@ ensures \result ≡ -\old(x); behavior pos: assumes x ≥ 0; ensures \result ≤ 0; assigns *y; behavior neg: assumes x < 0; ensures \result > 0; assigns \nothing; */ int f(int x, int *y) { int __retres; if (x >= 0) /*@ assert rte: mem_access: \valid(y); */ *y = x; /*@ assert rte: signed_overflow: -2147483647 ≤ x; */ __retres = - x; return __retres; } int main(void) { int __retres; int a; int b; int c; a = 5; b = f(a,& c); /*@ assert rte: signed_overflow: -2147483648 ≤ b + c; */ /*@ assert rte: signed_overflow: b + c ≤ 2147483647; */ __retres = b + c; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/div.res.oracle0000666000000000000000000000075213571573400020516 0ustar [kernel] Parsing tests/rte_manual/div.i (no preprocessing) [rte] annotating function f [rte] annotating function main /* Generated by Frama-C */ void f(void) { int x; int y; int z; /*@ assert rte: division_by_zero: x ≢ 0; */ /*@ assert rte: signed_overflow: y / x ≤ 2147483647; */ z = y / x; return; } int main(void) { int __retres; unsigned int ux; /*@ assert rte: division_by_zero: ux ≢ 0; */ ux = (unsigned int)1 / ux; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/float.res.oracle0000666000000000000000000000044513571573400021040 0ustar [kernel] Parsing tests/rte_manual/float.i (no preprocessing) [rte] annotating function f /* Generated by Frama-C */ int f(float v) { /*@ assert rte: float_to_int: v + 3.0f < 2147483648; */ /*@ assert rte: float_to_int: -2147483649 < v + 3.0f; */ int i = (int)(v + 3.0f); return i; } frama-c-20.0-Calcium/tests/rte_manual/oracle/machdep.0.res.oracle0000666000000000000000000000055713571573400021476 0ustar [kernel] Parsing tests/rte_manual/machdep.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; long lx; long ly; long lz; /*@ assert rte: signed_overflow: -2147483648 ≤ lx * ly; */ /*@ assert rte: signed_overflow: lx * ly ≤ 2147483647; */ lz = lx * ly; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/machdep.1.res.oracle0000666000000000000000000000060113571573400021465 0ustar [kernel] Parsing tests/rte_manual/machdep.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; long lx; long ly; long lz; /*@ assert rte: signed_overflow: -9223372036854775808 ≤ lx * ly; */ /*@ assert rte: signed_overflow: lx * ly ≤ 9223372036854775807; */ lz = lx * ly; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/memaccess.res.oracle0000666000000000000000000000105513571573400021671 0ustar [kernel] Parsing tests/rte_manual/memaccess.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ int i; unsigned int j; int main(void) { int __retres; int *p; int tab[10]; /*@ assert rte: mem_access: \valid(p); */ *p = 3; /*@ assert rte: index_bound: 0 ≤ i; */ /*@ assert rte: index_bound: i < 10; */ /*@ assert rte: mem_access: \valid_read(p); */ tab[i] = *p; /*@ assert rte: mem_access: \valid(p + 1); */ /*@ assert rte: index_bound: j < 10; */ *(p + 1) = tab[j]; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/safearrays.res.oracle0000666000000000000000000000137013571573400022071 0ustar [kernel] Parsing tests/rte_manual/safearrays.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ struct S { int val ; struct S *next ; }; struct C { struct S cell[5] ; int (*f)(int ) ; }; struct ArrayStruct { struct C data[10] ; }; unsigned int i; unsigned int j; int main(void) { int __retres; int a; struct ArrayStruct buff; /*@ assert rte: index_bound: i < 10; */ /*@ assert rte: index_bound: j < 5; */ /*@ assert rte: mem_access: \valid_read(&(buff.data[i].cell[j].next)->val); */ a = (buff.data[i].cell[j].next)->val; /*@ assert rte: index_bound: i < 10; */ /*@ assert rte: function_pointer: \valid_function(buff.data[i].f); */ (*(buff.data[i].f))(a); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/signed_downcast.0.res.oracle0000666000000000000000000000067113571573400023245 0ustar [kernel] Parsing tests/rte_manual/signed_downcast.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; signed char cx; signed char cy; signed char cz; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)cx + (int)cy; */ /*@ assert rte: signed_overflow: (int)cx + (int)cy ≤ 2147483647; */ cz = (signed char)((int)cx + (int)cy); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/signed_downcast.1.res.oracle0000666000000000000000000000107413571573400023244 0ustar [kernel] Parsing tests/rte_manual/signed_downcast.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; signed char cx; signed char cy; signed char cz; /*@ assert rte: signed_overflow: -2147483648 ≤ (int)cx + (int)cy; */ /*@ assert rte: signed_overflow: (int)cx + (int)cy ≤ 2147483647; */ /*@ assert rte: signed_downcast: (int)cx + (int)cy ≤ 127; */ /*@ assert rte: signed_downcast: -128 ≤ (int)cx + (int)cy; */ cz = (signed char)((int)cx + (int)cy); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/sizeof.res.oracle0000666000000000000000000000362213571573400021232 0ustar [kernel] Parsing tests/rte_manual/sizeof.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function fsize3 <- main. Called from tests/rte_manual/sizeof.c:9. [eva] tests/rte_manual/sizeof.c:4: assertion 'alloca_bounds' got status valid. [eva] tests/rte_manual/sizeof.c:4: Call to builtin __fc_vla_alloc [eva] tests/rte_manual/sizeof.c:4: allocating variable __malloc_fsize3_l4 [eva] tests/rte_manual/sizeof.c:4: Call to builtin __fc_vla_free [eva] Recording results for fsize3 [eva] Done for function fsize3 [eva] tests/rte_manual/sizeof.c:9: freeing automatic bases: {__malloc_fsize3_l4} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fsize3: b ∈ ESCAPINGADDR __lengthof_b ∈ {8} __retres ∈ {8} [eva:final-states] Values at end of function main: __retres ∈ {8} [from] Computing for function fsize3 [from] Computing for function __fc_vla_alloc <-fsize3 [from] Done for function __fc_vla_alloc [from] Computing for function __fc_vla_free <-fsize3 [from] Done for function __fc_vla_free [from] Done for function fsize3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function __fc_vla_alloc: \result FROM \nothing [from] Function __fc_vla_free: NO EFFECTS [from] Function fsize3: \result FROM n [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function fsize3: b; __lengthof_b; __retres [inout] Inputs for function fsize3: \nothing [inout] Out (internal) for function main: tmp; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/rte_manual/oracle/unary_minus.res.oracle0000666000000000000000000000042613571573400022303 0ustar [kernel] Parsing tests/rte_manual/unary_minus.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ int main(void) { int __retres; int ix; /*@ assert rte: signed_overflow: -2147483647 ≤ ix; */ ix = - ix; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/rte_manual/oracle/unsigned.0.res.oracle0000666000000000000000000000044413571573400021704 0ustar [kernel] Parsing tests/rte_manual/unsigned.i (no preprocessing) [rte] annotating function f /* Generated by Frama-C */ unsigned int f(unsigned int a, unsigned int b) { unsigned int x; unsigned int y; unsigned int z; x = a << 3; y = b * (unsigned int)2; z = x - y; return z; } frama-c-20.0-Calcium/tests/rte_manual/oracle/unsigned.1.res.oracle0000666000000000000000000000114513571573400021704 0ustar [kernel] Parsing tests/rte_manual/unsigned.i (no preprocessing) [rte] annotating function f /* Generated by Frama-C */ unsigned int f(unsigned int a, unsigned int b) { unsigned int x; unsigned int y; unsigned int z; /*@ assert rte: unsigned_overflow: a << 3 ≤ 4294967295; */ x = a << 3; /*@ assert rte: unsigned_overflow: 0 ≤ b * (unsigned int)2; */ /*@ assert rte: unsigned_overflow: b * (unsigned int)2 ≤ 4294967295; */ y = b * (unsigned int)2; /*@ assert rte: unsigned_overflow: 0 ≤ x - y; */ /*@ assert rte: unsigned_overflow: x - y ≤ 4294967295; */ z = x - y; return z; } frama-c-20.0-Calcium/tests/rte_manual/oracle/unsigned_downcast.res.oracle0000666000000000000000000000073313571573400023451 0ustar [kernel] Parsing tests/rte_manual/unsigned_downcast.i (no preprocessing) [rte] annotating function f /* Generated by Frama-C */ unsigned char f(int a, int b) { unsigned char __retres; /*@ assert rte: signed_overflow: -2147483648 ≤ a + b; */ /*@ assert rte: signed_overflow: a + b ≤ 2147483647; */ /*@ assert rte: unsigned_downcast: a + b ≤ 255; */ /*@ assert rte: unsigned_downcast: 0 ≤ a + b; */ __retres = (unsigned char)(a + b); return __retres; } frama-c-20.0-Calcium/tests/rte_manual/safearrays.i0000666000000000000000000000056413571573400017023 0ustar /* run.config OPT: -safe-arrays -rte -then -print */ struct S { int val; struct S *next; }; struct C { struct S cell[5]; int (*f)(int); }; struct ArrayStruct { struct C data[10]; }; unsigned int i, j; int main() { int a; struct ArrayStruct buff; // some code a = (buff.data[i].cell[j].next)->val; (*(buff.data[i].f))(a); return 0; } frama-c-20.0-Calcium/tests/rte_manual/signed_downcast.i0000666000000000000000000000024713571573400020034 0ustar /* run.config OPT: -rte -then -print OPT: -warn-signed-downcast -rte -then -print */ int main(void) { signed char cx, cy, cz; cz = cx + cy; return 0; } frama-c-20.0-Calcium/tests/rte_manual/sizeof.c0000666000000000000000000000025013571573400016144 0ustar #include size_t fsize3(int n) { char b[n + 3]; // variable length array return sizeof b; // execution time sizeof } int main() { return fsize3(5); } frama-c-20.0-Calcium/tests/rte_manual/unary_minus.i0000666000000000000000000000014613571573400017230 0ustar /* run.config OPT: -rte -then -print */ int main(void) { int ix; // some code ix = - ix; } frama-c-20.0-Calcium/tests/rte_manual/unsigned.i0000666000000000000000000000035713571573400016477 0ustar /* run.config OPT: -rte -then -print OPT: -warn-unsigned-overflow -rte -then -print */ unsigned int f(unsigned int a, unsigned int b) { unsigned int x, y, z; x = a << 3; y = b * (unsigned int )2; z = x - y; return (z); } frama-c-20.0-Calcium/tests/rte_manual/unsigned_downcast.i0000666000000000000000000000016513571573400020376 0ustar /* run.config OPT: -rte -warn-unsigned-downcast -then -print */ unsigned char f(int a, int b) { return a+b; } frama-c-20.0-Calcium/tests/saveload/0000777000000000000000000000000013571573400014153 5ustar frama-c-20.0-Calcium/tests/saveload/basic.i0000666000000000000000000000306513571573400015412 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs EXECNOW: LOG basic_sav.res LOG basic_sav.err BIN basic.sav @frama-c@ -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -eva @EVA_OPTIONS@ -out -input -deps ./@PTEST_DIR@/@PTEST_NAME@.i -save ./tests/saveload/result/basic.sav > ./tests/saveload/result/basic_sav.res 2> ./tests/saveload/result/basic_sav.err EXECNOW: LOG basic_sav.1.res LOG basic_sav.1.err BIN basic.1.sav ./bin/toplevel.opt -save ./tests/saveload/result/basic.1.sav @PTEST_DIR@/@PTEST_NAME@.i -eva @EVA_OPTIONS@ -out -input -deps > ./tests/saveload/result/basic_sav.1.res 2> ./tests/saveload/result/basic_sav.1.err STDOPT: +"-load ./tests/saveload/result/basic.sav -eva @EVA_OPTIONS@ -out -input -deps -journal-disable" CMD: @frama-c@ -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs STDOPT: +"-load ./tests/saveload/result/basic.1.sav -eva @EVA_OPTIONS@ -out -input -deps -journal-disable -print" STDOPT: +"-load ./tests/saveload/result/basic.1.sav -eva @EVA_OPTIONS@ -out -input -deps -journal-disable" EXECNOW: make -s @PTEST_DIR@/status.cmxs EXECNOW: LOG status_sav.res LOG status_sav.err BIN status.sav @frama-c@ -load-module @PTEST_DIR@/status -save ./tests/saveload/result/status.sav @PTEST_DIR@/@PTEST_NAME@.i > ./tests/saveload/result/status_sav.res 2> ./tests/saveload/result/status_sav.err STDOPT: +"-load-module @PTEST_DIR@/status -load ./tests/saveload/result/status.sav" STDOPT: +"-load ./tests/saveload/result/status.sav" */ int main() { int i, j; i = 10; /*@ assert (i == 10); */ while(i--); j = 5; return 0; } frama-c-20.0-Calcium/tests/saveload/basic.ml0000666000000000000000000000053313571573400015567 0ustar (* This datatype tests the bug fix of BTS #1277 *) module A = Datatype.Pair (Datatype.List(Datatype.String)) (Datatype.List(Datatype.String)) module StateA = State_builder.Ref (Datatype.Int) (struct let name = "Project.Test.StateA" let dependencies = [] let default () = 0 end) let () = StateA.set 10 frama-c-20.0-Calcium/tests/saveload/bool.c0000666000000000000000000000135413571573400015255 0ustar /* run.config EXECNOW: BIN bool.sav LOG bool_sav.res LOG bool_sav.err ./bin/toplevel.opt -save ./tests/saveload/result/bool.sav -eva @EVA_OPTIONS@ ./tests/saveload/bool.c > tests/saveload/result/bool_sav.res 2> tests/saveload/result/bool_sav.err STDOPT: +"-load ./tests/saveload/result/bool.sav -out -input -deps" STDOPT: +"-load ./tests/saveload/result/bool.sav -eva @EVA_OPTIONS@" */ #include "stdbool.h" #include "share/libc/stdio.h" bool x; int y; int f() { int i, j; i = 10; /*@ assert (i == 10); */ while(i--); j = 5; return 0; } int main() { f(); x=false; printf("%d\n",x); x=2; printf("%d\n",x); y=x+1; printf("%d,%d\n",x,y); x=x+1; printf("%d\n",x); x=x+1; printf("%d\n",x); return y; } frama-c-20.0-Calcium/tests/saveload/callbacks.i0000666000000000000000000000131713571573400016246 0ustar /* run.config EXECNOW: LOG callbacks_initial.res LOG callbacks_initial.err BIN callbacks.sav ./bin/toplevel.opt tests/saveload/callbacks.i -out -calldeps -eva-show-progress -main main1 -save ./tests/saveload/result/callbacks.sav > ./tests/saveload/result/callbacks_initial.res 2> ./tests/saveload/result/callbacks_initial.err STDOPT: +"-load ./tests/saveload/result/callbacks.sav -main main2 -then -main main3" */ /* This tests whether the callbacks for callwise inout and from survive after a saveload or a -then */ void f(int *p) { *p = 1; } int x, y; void g1() { f(&x); } void g2() { f(&y); } void main1() { g1(); g2(); } void main2() { g1(); g2(); } void main3() { g1(); g2(); } frama-c-20.0-Calcium/tests/saveload/deps.i0000666000000000000000000000213313571573400015257 0ustar /* run.config EXECNOW: make -s ./tests/saveload/deps_A.cmxs ./tests/saveload/deps_B.cmxs ./tests/saveload/deps_C.cmxs ./tests/saveload/deps_D.cmxs ./tests/saveload/deps_E.cmxs EXECNOW: LOG deps_sav.res LOG deps_sav.err BIN deps.sav @frama-c@ -load-module ./tests/saveload/deps_A.cmxs -eva @EVA_OPTIONS@ -out -input -deps ./tests/saveload/deps.i -save ./tests/saveload/result/deps.sav > ./tests/saveload/result/deps_sav.res 2> ./tests/saveload/result/deps_sav.err STDOPT: +"-load-module ./tests/saveload/deps_A -load ./tests/saveload/result/deps.sav -eva @EVA_OPTIONS@ -out -input -deps " STDOPT: +"-load-module ./tests/saveload/deps_B -load ./tests/saveload/result/deps.sav -out -input -deps " STDOPT: +"-load-module ./tests/saveload/deps_C -load ./tests/saveload/result/deps.sav -out -input -deps " STDOPT: +"-load-module ./tests/saveload/deps_D -load ./tests/saveload/result/deps.sav -out -input -deps " STDOPT: +"-load-module ./tests/saveload/deps_E -load ./tests/saveload/result/deps.sav -out -input -deps " */ int main() { int i, j; i = 10; while(i--); j = 5; return 0; } frama-c-20.0-Calcium/tests/saveload/deps_A.ml0000666000000000000000000000125313571573400015701 0ustar module StateA = State_builder.Ref (Datatype.Int) (struct let name = "Project.Test.StateA" let dependencies = [] let default () = 0 end) module StateB = State_builder.Option_ref (Datatype.Bool) (struct let name = "Project.Test.StateB" let dependencies = [ StateA.self ] end) module StateC = State_builder.Option_ref (Datatype.Int) (struct let name = "Project.Test.StateC" let dependencies = [ StateB.self ] end) let () = StateA.set 10 let () = StateB.set (if StateA.get () = 10 then true else false) let () = assert (StateB.get ()) let () = StateC.set (if StateB.get () then 10 else 5) frama-c-20.0-Calcium/tests/saveload/deps_B.ml0000666000000000000000000000064713571573400015710 0ustar module StateABis = State_builder.Option_ref (Datatype.Int) (struct let name = "Project.Test.StateABis" let dependencies = [] end) module StateB = State_builder.Option_ref (Datatype.Bool) (struct let name = "Project.Test.StateB" let dependencies = [ StateABis.self ] end) let () = StateABis.set 10 let () = StateB.set (if StateABis.get () = 10 then true else false) frama-c-20.0-Calcium/tests/saveload/deps_C.ml0000666000000000000000000000057013571573400015704 0ustar module StateA = State_builder.Ref (Datatype.Int) (struct let name = "Project.Test.StateA" let dependencies = [] let default () = 0 end) module StateABis = State_builder.Option_ref (Datatype.Int) (struct let name = "Project.Test.StateABis" let dependencies = [] end) let () = StateA.set 5 let () = StateABis.set 10 frama-c-20.0-Calcium/tests/saveload/deps_D.ml0000666000000000000000000000160413571573400015704 0ustar module StateA = State_builder.Ref (Datatype.Int) (struct let name = "Project.Test.StateA" let dependencies = [] let default () = 0 end) module StateB = State_builder.Option_ref (Datatype.Bool) (struct let name = "Project.Test.StateB" let dependencies = [ StateA.self ] end) module StateD = State_builder.Ref (Datatype.Int) (struct let name = "Project.Test.StateD" let dependencies = [ StateA.self ] let default () = 0 end) module StateC = State_builder.Option_ref (Datatype.Int) (struct let name = "Project.Test.StateC" let dependencies = [ StateB.self; StateD.self ] end) let () = StateA.set 10 let () = StateB.set (StateA.get () = 10) let () = StateD.set (if StateA.get () = 5 then 5 else 0) let () = StateC.set (if StateB.get () && StateD.get () = 5 then 10 else 5) frama-c-20.0-Calcium/tests/saveload/deps_E.ml0000666000000000000000000000166113571573400015710 0ustar (* test of incompatible state datatype *) (* the same than deps_A.ml *) module StateA = State_builder.Ref (Datatype.Int) (struct let name = "Project.Test.StateA" let dependencies = [] let default () = 0 end) (* same name but incompatible with deps_A.ml *) module StateB = State_builder.Option_ref (Datatype.Float) (struct let name = "Project.Test.StateB" let dependencies = [] end) (* the unchanged dependency of StateB *) module StateC = State_builder.Option_ref (Datatype.Int) (struct let name = "Project.Test.StateC" let dependencies = [ StateB.self ] end) let () = StateA.set 5 let () = StateB.set 10. let () = StateC.set 3 let main () = assert (StateA.get () = 10); assert (StateB.get_option () = None); (* reset to default *) assert (StateC.get_option () = None) (* reset because of dependency of B *) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/saveload/isset.c0000666000000000000000000000114113571573400015443 0ustar /* run.config EXECNOW: LOG isset_sav.res LOG isset_sav.err BIN isset.sav ./bin/toplevel.opt -quiet -eva @EVA_OPTIONS@ -save tests/saveload/result/isset.sav tests/saveload/isset.c > ./tests/saveload/result/isset_sav.res 2> ./tests/saveload/result/isset_sav.err STDOPT: +"-quiet -load ./tests/saveload/result/isset.sav" STDOPT: +"-load ./tests/saveload/result/isset.sav" STDOPT: +"-eva @EVA_OPTIONS@ -load ./tests/saveload/result/isset.sav" STDOPT: +"-quiet -eva @EVA_OPTIONS@ -load ./tests/saveload/result/isset.sav" */ int main() { int i, j; i = 10; while(i--); j = 5; return 0; } frama-c-20.0-Calcium/tests/saveload/load_one.i0000666000000000000000000000067613571573400016116 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs STDOPT: +"-load-module @PTEST_DIR@/@PTEST_NAME@.cmxs" */ int G; int f (int x, int y) { G = y; return x; } int main (void) { int a = 1; int b = 1; /*@ assert a == 1; */ f (0, 0); /* this call is useless : should be removed */ a = f (a, b); /* the result of this call is useless */ a = f (G + 1, b); G = 0; /* don't use the G computed by f */ return a; } frama-c-20.0-Calcium/tests/saveload/load_one.ml0000666000000000000000000000134713571573400016272 0ustar let () = at_exit (fun _ -> Sys.remove "tests/saveload/result/load_one.sav") let main () = let sparecode () = Sparecode.Register.get ~select_annot:false ~select_slice_pragma:false in let p = sparecode () in Project.save "tests/saveload/result/load_one.sav"; Project.remove ~project:p (); let p = Project.load "tests/saveload/result/load_one.sav" in Project.on p (fun () -> !Db.Value.compute (); ignore (sparecode ())) () let () = Db.Main.extend main (* testing Project.create_by_copy *) let main2 () = !Db.Value.compute (); let prj = Project.create_by_copy ~last:false "copy" in Format.printf "INIT AST@."; File.pretty_ast (); Format.printf "COPY AST@."; File.pretty_ast ~prj () let () = Db.Main.extend main2 frama-c-20.0-Calcium/tests/saveload/multi_project.i0000666000000000000000000000122713571573400017207 0ustar /* run.config EXECNOW: BIN multi_project.sav LOG multi_project_sav.res LOG multi_project_sav.err ./bin/toplevel.opt -save ./tests/saveload/result/multi_project.sav @EVA_OPTIONS@ -semantic-const-folding @PTEST_DIR@/@PTEST_NAME@.i > tests/saveload/result/multi_project_sav.res 2> tests/saveload/result/multi_project_sav.err EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs STDOPT: +"-load ./tests/saveload/result/multi_project.sav -journal-disable" CMD: @frama-c@ -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -eva @EVA_OPTIONS@ */ int f(int x) { return x + x; } int main() { int x = 2; int y = f(x); /*@ assert y == 4; */ return x * y; } frama-c-20.0-Calcium/tests/saveload/multi_project.ml0000666000000000000000000000130113571573400017360 0ustar let check name test = Kernel.log "Checking %S@." name; Project.on (Project.from_unique_name name) (fun () -> assert (test (Kernel.Files.get ()) [])) () let main () = ignore (Project.create_by_copy ~last:false "foo"); ignore (Project.create "foobar"); Project.save_all "foo.sav"; check "foo" (<>); check "foobar" (=); check "default" (<>); Kernel.Files.set []; Project.load_all "foo.sav"; Extlib.safe_remove "foo.sav"; ignore (Project.create_by_copy ~last:false "bar"); assert (Project.equal (Project.current ()) (Project.from_unique_name "default")); check "foo" (<>); check "foobar" (=); check "default" (<>); check "bar" (<>) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/saveload/oracle/0000777000000000000000000000000013571573400015420 5ustar frama-c-20.0-Calcium/tests/saveload/oracle/basic.0.res.oracle0000666000000000000000000000031413571573400020614 0ustar [kernel] Warning: 1 state in saved file ignored. It is invalid in this Frama-C configuration. [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/basic.1.res.oracle0000666000000000000000000000064313571573400020622 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. /* Generated by Frama-C */ int main(void) { int __retres; int i; int j; i = 10; /*@ assert i ≡ 10; */ ; while (1) { int tmp; tmp = i; /*@ assert Eva: signed_overflow: -2147483648 ≤ i - 1; */ i --; ; if (! tmp) break; } j = 5; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/saveload/oracle/basic.2.res.oracle0000666000000000000000000000015613571573400020622 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/basic.3.res.oracle0000666000000000000000000000020613571573400020617 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. unknown (tried by Test) frama-c-20.0-Calcium/tests/saveload/oracle/basic.4.res.oracle0000666000000000000000000000032113571573400020616 0ustar [kernel] Warning: 11 states in saved file ignored. They are invalid in this Frama-C configuration. [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/basic_sav.1.err0000666000000000000000000000000013571573400020211 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/basic_sav.1.res0000666000000000000000000000203013571573400020217 0ustar [kernel] Parsing tests/saveload/basic.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/saveload/basic.i:19: assertion got status valid. [eva] tests/saveload/basic.i:20: starting to merge loop iterations [eva:alarm] tests/saveload/basic.i:20: Warning: signed overflow. assert -2147483648 ≤ i - 1; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ [-2147483648..9] j ∈ {5} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; tmp; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/saveload/oracle/basic_sav.err0000666000000000000000000000000013571573400020052 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/basic_sav.res0000666000000000000000000000203013571573400020060 0ustar [kernel] Parsing tests/saveload/basic.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/saveload/basic.i:19: assertion got status valid. [eva] tests/saveload/basic.i:20: starting to merge loop iterations [eva:alarm] tests/saveload/basic.i:20: Warning: signed overflow. assert -2147483648 ≤ i - 1; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ [-2147483648..9] j ∈ {5} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; tmp; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/saveload/oracle/bool.0.res.oracle0000666000000000000000000000447613571573400020503 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Computing for function printf_va_1 <-main [from] Done for function printf_va_1 [from] Computing for function printf_va_2 <-main [from] Done for function printf_va_2 [from] Computing for function printf_va_3 <-main [from] Done for function printf_va_3 [from] Computing for function printf_va_4 <-main [from] Done for function printf_va_4 [from] Computing for function printf_va_5 <-main [from] Done for function printf_va_5 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function printf_va_1: S___fc_stdout[0].__fc_FILE_data FROM param0; S___fc_stdout[0]; "%d\n" (and SELF) \result FROM param0; S___fc_stdout[0]; "%d\n" [from] Function printf_va_2: S___fc_stdout[0].__fc_FILE_data FROM param0; S___fc_stdout[0]; "%d\n" (and SELF) \result FROM param0; S___fc_stdout[0]; "%d\n" [from] Function printf_va_3: S___fc_stdout[0].__fc_FILE_data FROM param0; param1; S___fc_stdout[0]; "%d,%d\n"[bits 0 to 55] (and SELF) \result FROM param0; param1; S___fc_stdout[0]; "%d,%d\n"[bits 0 to 55] [from] Function printf_va_4: S___fc_stdout[0].__fc_FILE_data FROM param0; S___fc_stdout[0]; "%d\n" (and SELF) \result FROM param0; S___fc_stdout[0]; "%d\n" [from] Function printf_va_5: S___fc_stdout[0].__fc_FILE_data FROM param0; S___fc_stdout[0]; "%d\n" (and SELF) \result FROM param0; S___fc_stdout[0]; "%d\n" [from] Function main: x FROM \nothing y FROM \nothing S___fc_stdout[0].__fc_FILE_data FROM S___fc_stdout[0]; "%d\n"; "%d\n"; "%d,%d\n"[bits 0 to 55]; "%d\n"; "%d\n" (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: i; j; tmp; __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: x; y; S___fc_stdout[0].__fc_FILE_data [inout] Inputs for function main: x; y; S___fc_stdout[0]; "%d\n"; "%d\n"; "%d,%d\n"[bits 0 to 55]; "%d\n"; "%d\n" frama-c-20.0-Calcium/tests/saveload/oracle/bool.1.res.oracle0000666000000000000000000000015613571573400020473 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/bool_sav.err0000666000000000000000000000000013571573400017724 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/bool_sav.res0000666000000000000000000000431313571573400017740 0ustar [kernel] Parsing tests/saveload/bool.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] computing for function f <- main. Called from tests/saveload/bool.c:25. [eva] tests/saveload/bool.c:17: assertion got status valid. [eva] tests/saveload/bool.c:18: starting to merge loop iterations [eva:alarm] tests/saveload/bool.c:18: Warning: signed overflow. assert -2147483648 ≤ i - 1; [eva] Recording results for f [eva] Done for function f [eva] computing for function printf_va_1 <- main. Called from tests/saveload/bool.c:27. [eva] using specification for function printf_va_1 [eva] tests/saveload/bool.c:27: function printf_va_1: precondition got status valid. [eva] Done for function printf_va_1 [eva] computing for function printf_va_2 <- main. Called from tests/saveload/bool.c:29. [eva] using specification for function printf_va_2 [eva] tests/saveload/bool.c:29: function printf_va_2: precondition got status valid. [eva] Done for function printf_va_2 [eva] computing for function printf_va_3 <- main. Called from tests/saveload/bool.c:31. [eva] using specification for function printf_va_3 [eva] tests/saveload/bool.c:31: function printf_va_3: precondition got status valid. [eva] Done for function printf_va_3 [eva] computing for function printf_va_4 <- main. Called from tests/saveload/bool.c:33. [eva] using specification for function printf_va_4 [eva] tests/saveload/bool.c:33: function printf_va_4: precondition got status valid. [eva] Done for function printf_va_4 [eva] computing for function printf_va_5 <- main. Called from tests/saveload/bool.c:35. [eva] using specification for function printf_va_5 [eva] tests/saveload/bool.c:35: function printf_va_5: precondition got status valid. [eva] Done for function printf_va_5 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: i ∈ [-2147483648..9] j ∈ {5} __retres ∈ {0} [eva:final-states] Values at end of function main: x ∈ {1} y ∈ {2} S___fc_stdout[0..1] ∈ [--..--] frama-c-20.0-Calcium/tests/saveload/oracle/callbacks.res.oracle0000666000000000000000000000721413571573400021322 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] computing for function g1 <- main2. Called from tests/saveload/callbacks.i:30. [eva] computing for function f <- g1 <- main2. Called from tests/saveload/callbacks.i:16. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for g1 [from] Computing for function g1 [from] Done for function g1 [eva] Done for function g1 [eva] computing for function g2 <- main2. Called from tests/saveload/callbacks.i:31. [eva] computing for function f <- g2 <- main2. Called from tests/saveload/callbacks.i:21. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for g2 [from] Computing for function g2 [from] Done for function g2 [eva] Done for function g2 [eva] Recording results for main2 [from] Computing for function main2 [from] Done for function main2 [eva] done for function main2 [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/saveload/callbacks.i:16 (by g1): x FROM p [from] call to f at tests/saveload/callbacks.i:21 (by g2): y FROM p [from] call to g1 at tests/saveload/callbacks.i:30 (by main2): x FROM \nothing [from] call to g2 at tests/saveload/callbacks.i:31 (by main2): y FROM \nothing [from] entry point: x FROM \nothing y FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function f: x; y [inout] Out (internal) for function g1: x [inout] Out (internal) for function g2: y [inout] Out (internal) for function main2: x; y [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] computing for function g1 <- main3. Called from tests/saveload/callbacks.i:35. [eva] computing for function f <- g1 <- main3. Called from tests/saveload/callbacks.i:16. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for g1 [from] Computing for function g1 [from] Done for function g1 [eva] Done for function g1 [eva] computing for function g2 <- main3. Called from tests/saveload/callbacks.i:36. [eva] computing for function f <- g2 <- main3. Called from tests/saveload/callbacks.i:21. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for g2 [from] Computing for function g2 [from] Done for function g2 [eva] Done for function g2 [eva] Recording results for main3 [from] Computing for function main3 [from] Done for function main3 [eva] done for function main3 [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/saveload/callbacks.i:16 (by g1): x FROM p [from] call to f at tests/saveload/callbacks.i:21 (by g2): y FROM p [from] call to g1 at tests/saveload/callbacks.i:35 (by main3): x FROM \nothing [from] call to g2 at tests/saveload/callbacks.i:36 (by main3): y FROM \nothing [from] entry point: x FROM \nothing y FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function f: x; y [inout] Out (internal) for function g1: x [inout] Out (internal) for function g2: y [inout] Out (internal) for function main3: x; y frama-c-20.0-Calcium/tests/saveload/oracle/callbacks_initial.err0000666000000000000000000000000013571573400021550 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/callbacks_initial.res0000666000000000000000000000502213571573400021562 0ustar [kernel] Parsing tests/saveload/callbacks.i (no preprocessing) [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] computing for function g1 <- main1. Called from tests/saveload/callbacks.i:25. [eva] computing for function f <- g1 <- main1. Called from tests/saveload/callbacks.i:16. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for g1 [from] Computing for function g1 [from] Done for function g1 [eva] Done for function g1 [eva] computing for function g2 <- main1. Called from tests/saveload/callbacks.i:26. [eva] computing for function f <- g2 <- main1. Called from tests/saveload/callbacks.i:21. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for g2 [from] Computing for function g2 [from] Done for function g2 [eva] Done for function g2 [eva] Recording results for main1 [from] Computing for function main1 [from] Done for function main1 [eva] done for function main1 [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 4 functions analyzed (out of 6): 66% coverage. In these functions, 9 statements reached (out of 9): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/saveload/callbacks.i:16 (by g1): x FROM p [from] call to f at tests/saveload/callbacks.i:21 (by g2): y FROM p [from] call to g1 at tests/saveload/callbacks.i:25 (by main1): x FROM \nothing [from] call to g2 at tests/saveload/callbacks.i:26 (by main1): y FROM \nothing [from] entry point: x FROM \nothing y FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function f: x; y [inout] Out (internal) for function g1: x [inout] Out (internal) for function g2: y [inout] Out (internal) for function main1: x; y frama-c-20.0-Calcium/tests/saveload/oracle/deps.0.res.oracle0000666000000000000000000000015613571573400020472 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/deps.1.res.oracle0000666000000000000000000000032013571573400020464 0ustar [kernel] Warning: 2 states in saved file ignored. They are invalid in this Frama-C configuration. [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/deps.2.res.oracle0000666000000000000000000000032013571573400020465 0ustar [kernel] Warning: 2 states in saved file ignored. They are invalid in this Frama-C configuration. [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/deps.3.res.oracle0000666000000000000000000000015613571573400020475 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/deps.4.res.oracle0000666000000000000000000000050013571573400020467 0ustar [kernel] Warning: 1 state in saved file ignored. It is invalid in this Frama-C configuration. [kernel] Warning: 1 state in memory reset to their default value. It is inconsistent in this Frama_C configuration. [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/deps_sav.err0000666000000000000000000000000013571573400017724 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/deps_sav.res0000666000000000000000000000173013571573400017740 0ustar [kernel] Parsing tests/saveload/deps.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/saveload/deps.i:15: starting to merge loop iterations [eva:alarm] tests/saveload/deps.i:15: Warning: signed overflow. assert -2147483648 ≤ i - 1; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ [-2147483648..9] j ∈ {5} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; tmp; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/saveload/oracle/isset.0.res.oracle0000666000000000000000000000015613571573400020666 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/isset.1.res.oracle0000666000000000000000000000015613571573400020667 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/isset.2.res.oracle0000666000000000000000000000015613571573400020670 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/isset.3.res.oracle0000666000000000000000000000015613571573400020671 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/isset_sav.err0000666000000000000000000000000013571573400020120 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/isset_sav.res0000666000000000000000000000014213571573400020130 0ustar [eva:alarm] tests/saveload/isset.c:13: Warning: signed overflow. assert -2147483648 ≤ i - 1; frama-c-20.0-Calcium/tests/saveload/oracle/load_one.res.oracle0000666000000000000000000000351013571573400021156 0ustar [kernel] Parsing tests/saveload/load_one.i (no preprocessing) [sparecode] remove unused code... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] tests/saveload/load_one.i:16: assertion got status valid. [eva] computing for function f <- main. Called from tests/saveload/load_one.i:18. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/saveload/load_one.i:19. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/saveload/load_one.i:20. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [pdg] computing for function f [pdg] done for function f [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. [kernel] Warning: clearing dangling project pointers in project "default" [kernel] Warning: clearing dangling project pointers in project "default 2" [sparecode] remove unused code... [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. INIT AST /* Generated by Frama-C */ int G; int f(int x, int y) { G = y; return x; } int main(void) { int a = 1; int b = 1; /*@ assert a ≡ 1; */ ; f(0,0); a = f(a,b); a = f(G + 1,b); G = 0; return a; } COPY AST /* Generated by Frama-C */ int G; int f(int x, int y) { G = y; return x; } int main(void) { int a = 1; int b = 1; /*@ assert a ≡ 1; */ ; f(0,0); a = f(a,b); a = f(G + 1,b); G = 0; return a; } frama-c-20.0-Calcium/tests/saveload/oracle/multi_project.0.res.oracle0000666000000000000000000000015613571573400022417 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/multi_project.1.res.oracle0000666000000000000000000000160013571573400022413 0ustar [kernel] Parsing tests/saveload/multi_project.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/saveload/multi_project.i:14. [eva] Recording results for f [eva] Done for function f [eva] tests/saveload/multi_project.i:15: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {4} [eva:final-states] Values at end of function main: x ∈ {2} y ∈ {4} __retres ∈ {8} [kernel] Checking "foo" [kernel] Checking "foobar" [kernel] Checking "default" [kernel] Checking "foo" [kernel] Checking "foobar" [kernel] Checking "default" [kernel] Checking "bar" frama-c-20.0-Calcium/tests/saveload/oracle/multi_project_sav.err0000666000000000000000000000000013571573400021651 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/multi_project_sav.res0000666000000000000000000000145213571573400021666 0ustar [kernel] Parsing tests/saveload/multi_project.i (no preprocessing) [scf] beginning constant propagation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/saveload/multi_project.i:14. [eva] Recording results for f [eva] Done for function f [eva] tests/saveload/multi_project.i:15: assertion got status valid. [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ int f(int x) { int __retres; __retres = 4; return __retres; } int main(void) { int __retres; int x = 2; int y = f(2); /*@ assert y ≡ 4; */ ; __retres = 8; return __retres; } [scf] constant propagation done frama-c-20.0-Calcium/tests/saveload/oracle/segfault_datatypes.res.oracle0000666000000000000000000000031413571573400023265 0ustar [kernel] Warning: 1 state in saved file ignored. It is invalid in this Frama-C configuration. [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/segfault_datatypes_sav.err0000666000000000000000000000000013571573400022661 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/segfault_datatypes_sav.res0000666000000000000000000000200213571573400022666 0ustar [kernel] Parsing tests/saveload/segfault_datatypes.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/saveload/segfault_datatypes.i:13: starting to merge loop iterations [eva:alarm] tests/saveload/segfault_datatypes.i:13: Warning: signed overflow. assert -2147483648 ≤ i - 1; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ [-2147483648..9] j ∈ {5} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; tmp; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/saveload/oracle/serialized_queue.res.oracle0000666000000000000000000000034413571573400022737 0ustar [kernel] Content of queue: [kernel] 1 [kernel] 2 [kernel] Content of queue: [kernel] 1 [kernel] 2 [kernel] Content of queue: [kernel] 1 [kernel] 2 [kernel] 3 [kernel] Parsing tests/saveload/serialized_queue.i (no preprocessing) frama-c-20.0-Calcium/tests/saveload/oracle/sparecode.res.oracle0000666000000000000000000000015613571573400021346 0ustar [kernel] Warning: ignoring source files specified on the command line while loading a global initial context. frama-c-20.0-Calcium/tests/saveload/oracle/sparecode_sav.err0000666000000000000000000000000013571573400020736 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/sparecode_sav.res0000666000000000000000000000456613571573400020764 0ustar [kernel] Parsing tests/saveload/sparecode.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] computing for function f <- main. Called from tests/saveload/sparecode.i:16. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/saveload/sparecode.i:17. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/saveload/sparecode.i:18. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 2 functions analyzed (out of 2): 100% coverage. In these functions, 9 statements reached (out of 9): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int f_slice_1(int x, int y) { G = y; return x; } int main(void) { int a = 1; int b = 1; f_slice_1(a,b); a = f_slice_1(G + 1,b); return a; } frama-c-20.0-Calcium/tests/saveload/oracle/status_sav.err0000666000000000000000000000000013571573400020314 0ustar frama-c-20.0-Calcium/tests/saveload/oracle/status_sav.res0000666000000000000000000000012313571573400020323 0ustar [kernel] Parsing tests/saveload/basic.i (no preprocessing) unknown (tried by Test) frama-c-20.0-Calcium/tests/saveload/segfault_datatypes.i0000666000000000000000000000142213571573400020214 0ustar /* run.config EXECNOW: make -s ./tests/saveload/segfault_datatypes_A.cmxs ./tests/saveload/segfault_datatypes_B.cmxs EXECNOW: LOG segfault_datatypes_sav.res LOG segfault_datatypes_sav.err BIN segfault_datatypes.sav @frama-c@ -load-module ./tests/saveload/segfault_datatypes_A -eva @EVA_OPTIONS@ -out -input -deps ./tests/saveload/segfault_datatypes.i -save ./tests/saveload/result/segfault_datatypes.sav > ./tests/saveload/result/segfault_datatypes_sav.res 2> ./tests/saveload/result/segfault_datatypes_sav.err CMD: @frama-c@ -load-module ./tests/saveload/segfault_datatypes_B STDOPT: +"-load ./tests/saveload/result/segfault_datatypes.sav -eva @EVA_OPTIONS@ -out -input -deps -journal-disable" */ int main() { int i, j; i = 10; while(i--); j = 5; return 0; } frama-c-20.0-Calcium/tests/saveload/segfault_datatypes_A.ml0000666000000000000000000000030113571573400020627 0ustar module StateA = State_builder.Ref (Datatype.Int) (struct let name = "Project.Test.StateA" let dependencies = [] let default () = 0 end) let () = StateA.set 10 frama-c-20.0-Calcium/tests/saveload/segfault_datatypes_B.ml0000666000000000000000000000025613571573400020641 0ustar module StateA = State_builder.Option_ref (Datatype.Int) (struct let name = "Project.Test.StateA" let dependencies = [] end) let () = StateA.set 3 frama-c-20.0-Calcium/tests/saveload/serialized_queue.i0000666000000000000000000000030213571573400017657 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ // empty C file, we're only interested in the script itself frama-c-20.0-Calcium/tests/saveload/serialized_queue.ml0000666000000000000000000000105713571573400020047 0ustar module Q = State_builder.Queue (Datatype.Int) (struct let name = "Queue.Q" let dependencies = [] end) let pretty () = Kernel.feedback "Content of queue:"; Q.iter (fun x -> Kernel.feedback "%d" x) let run () = Q.add 1; Q.add 2; pretty(); let prj = Project.create "new project" in let queue_ops = State.private_ops Q.self in let obj = queue_ops.State.serialize (Project.current()) in let () = queue_ops.State.unserialize prj obj in Project.on prj pretty (); Project.on prj Q.add 3; Project.on prj pretty () let () = run () frama-c-20.0-Calcium/tests/saveload/sparecode.i0000666000000000000000000000130513571573400016271 0ustar /* run.config EXECNOW: BIN sparecode.sav LOG sparecode_sav.res LOG sparecode_sav.err ./bin/toplevel.opt -slicing-level 2 -slice-return main -eva-show-progress -save ./tests/saveload/result/sparecode.sav tests/saveload/sparecode.i -then-on 'Slicing export' -print > tests/saveload/result/sparecode_sav.res 2> tests/saveload/result/sparecode_sav.err STDOPT: +"-load ./tests/saveload/result/sparecode.sav" */ int G; int f (int x, int y) { G = y; return x; } int main (void) { int a = 1; int b = 1; f (0, 0); /* this call is useless : should be removed */ a = f (a, b); /* the result of this call is useless */ a = f (G + 1, b); G = 0; /* don't use the G computed by f */ return a; } frama-c-20.0-Calcium/tests/saveload/status.ml0000666000000000000000000000214113571573400016026 0ustar module P = Plugin.Register(struct let name = "test" let shortname = "test" let help = "" end) module T = P.False(struct let option_name = "-t" let help = "" end) let emitter = Emitter.create "Test" [ Emitter.Property_status ] ~correctness:[] ~tuning:[ T.parameter ] let main () = Ast.compute (); let o = object inherit Visitor.frama_c_inplace method !vstmt_aux stmt = Annotations.iter_code_annot (fun _ ca -> let kf = Kernel_function.find_englobing_kf stmt in let ps = Property.ip_of_code_annot kf stmt ca in List.iter (fun p -> Property_status.emit emitter p ~hyps:[ Property.( ip_other "Blob" (OLGlob Cil_datatype.Location.unknown))] Property_status.Dont_know; Format.printf "%a@." Property_status.pretty (Property_status.get p)) ps) stmt; Cil.DoChildren end in Visitor.visitFramacFileSameGlobals o (Ast.get ()) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/saveload/test_config0000666000000000000000000000002313571573400016375 0ustar OPT: @EVA_OPTIONS@ frama-c-20.0-Calcium/tests/scope/0000777000000000000000000000000013571573400013466 5ustar frama-c-20.0-Calcium/tests/scope/bts383.c0000666000000000000000000000210313571573400014654 0ustar /* run.config OPT: -eva @EVA_CONFIG@ -print -journal-disable -scope-verbose 1 -remove-redundant-alarms -context-width 3 */ /* echo '!Db.Scope.check_asserts();;' \ | bin/toplevel.top -eva tests/scope/bts383.c */ int v; void if1 (int * p) { if (*p > 0) v = *p; } int if2 (int c, int * p) { if (c) v = *p; return *p; } void loop1 (int * p) { int i; int n = *p; for (i = 0; i < n; i++) { v = *p; } } int loop2 (int n, int * p) { int i; for (i = 0; i < n; i++) { v = *p; } return *p; } void out_char (char c); void out_string (const char *value) { for(; *value; value++) out_char(*value); } typedef struct { int a; int b; } Tstruct; int fstruct (Tstruct * ps) { int x; ps->a = 3; ps->b = 5; ps->a = ps->b; ps->b = ps->a; x = ps->a + ps->b; ps++; ps->a = 3; ps->b = 5; ps->a = ps->b; ps->b = ps->a; x += ps->a + ps->b; return x; } int main (int * p, Tstruct * ps) { int x; x = *(p+1); v = *(p+1); if1(p+1); if2(x,p+1); loop1(p+1); loop2(x,p+1); out_string(p+1); x += fstruct (ps+1); return x; } frama-c-20.0-Calcium/tests/scope/bts971.c0000666000000000000000000000104713571573400014665 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -journal-disable -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -then -main main2 */ /* bug 971: */ volatile foo; int v; void f1 () { v += 1; } void f () { f1 (); } void g1 () { v += 2; v += 3; } void g () { g1 (); } void main (int c) { v += 0; while (c) { if (foo) {f ();}; if (foo) {g ();}; } } /* bug 972 */ typedef struct { int a; int b; } ts; ts t[10]; void init() { t[1].a = 1; t[1].b = 2; } int main2 () { init(); return t[1].a; } frama-c-20.0-Calcium/tests/scope/bts971.ml0000666000000000000000000000455313571573400015060 0ustar let find_pp kf_name = let kf = Globals.Functions.find_by_name kf_name in let stmt = Kernel_function.find_first_stmt kf in Format.printf "Current program point = first one in function '%s'@\n" kf_name; stmt, kf let compute_and_print pp str_data = let stmt, kf = pp in let lval_term = !Db.Properties.Interp.term_lval kf str_data in let lval = !Db.Properties.Interp.term_lval_to_lval ~result:None lval_term in let defs = Scope.Defs.get_defs kf stmt lval in Format.printf "* @[Defs for (%s) at current program point=@[@." str_data; let _ = match defs with | None -> Format.printf "computation problem.@." | Some (defs, _undef) when Cil_datatype.Stmt.Hptset.is_empty defs -> Format.printf "no Defs found@." | Some (defs, _undef) -> Cil_datatype.Stmt.Hptset.iter (fun s -> Format.printf "%a: %a@\n" Printer.pp_location (Cil_datatype.Stmt.loc s) (Printer.without_annot Printer.pp_stmt) s) defs in Format.printf "@]@]@." open Cil_types let tests () = let main = fst (Globals.entry_point ()) in if Kernel_function.get_name main = "main" then let pp = find_pp "f1" in compute_and_print pp "v"; let stmt, kf as pp = find_pp "g1" in compute_and_print pp "v"; let stmt = match stmt.succs with s::_ -> s | _ -> assert false in Format.printf "Current program point = 2d one in function '%s'@\n" "g1"; compute_and_print (stmt, kf) "v"; let pp = find_pp "f" in compute_and_print pp "v" else if Kernel_function.get_name main = "main2" then let s = Kernel_function.find_return main in let s = List.hd s.preds in compute_and_print (s, main) "t[1].a" else Kernel.result "Unknown main %a@." Kernel_function.pretty main let main _ = Format.printf "=== Tests for Scope.Defs@."; Ast.compute (); Dynamic.Parameter.Bool.set "-eva-show-progress" false ; Dynamic.Parameter.Int.set "-eva-verbose" 0 ; Dynamic.Parameter.Int.set "-from-verbose" 0 ; Dynamic.Parameter.Int.set "-pdg-verbose" 0 ; Format.printf "--- Intraprocedural mode (-scope-no-defs-interproc)@."; Dynamic.Parameter.Bool.set "-scope-defs-interproc" false ; tests (); Format.printf "--- Interprocedural mode (-scope-defs-interproc)@."; Dynamic.Parameter.Bool.set "-scope-defs-interproc" true ; tests () ;; let _ = Db.Main.extend main frama-c-20.0-Calcium/tests/scope/no-effect.i0000666000000000000000000000043213571573400015505 0ustar /* run.config OPT: @EVA_CONFIG@ -eva -print -journal-disable -scope-verbose 1 -remove-redundant-alarms */ typedef struct { int v; } tt; void main (const tt *p1) { while(1) { switch ((p1+1)->v) { case 1: case 2: case 3: case 4: (p1+1)->v; break; } } } frama-c-20.0-Calcium/tests/scope/oracle/0000777000000000000000000000000013571573400014733 5ustar frama-c-20.0-Calcium/tests/scope/oracle/bts383.res.oracle0000666000000000000000000002066013571573400017744 0ustar [kernel] Parsing tests/scope/bts383.c (with preprocessing) [kernel:typing:incompatible-types-call] tests/scope/bts383.c:62: Warning: expected 'char const *' but got argument of type 'int *': p + 1 [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ {0} [eva:alarm] tests/scope/bts383.c:56: Warning: out of bounds read. assert \valid_read(p + 1); [eva:alarm] tests/scope/bts383.c:57: Warning: out of bounds read. assert \valid_read(p + 1); [eva] computing for function if1 <- main. Called from tests/scope/bts383.c:58. [eva:alarm] tests/scope/bts383.c:10: Warning: out of bounds read. assert \valid_read(p); [eva:alarm] tests/scope/bts383.c:11: Warning: out of bounds read. assert \valid_read(p); [eva] Recording results for if1 [eva] Done for function if1 [eva] computing for function if2 <- main. Called from tests/scope/bts383.c:59. [eva:alarm] tests/scope/bts383.c:15: Warning: out of bounds read. assert \valid_read(p); [eva:alarm] tests/scope/bts383.c:16: Warning: out of bounds read. assert \valid_read(p); [eva] Recording results for if2 [eva] Done for function if2 [eva] computing for function loop1 <- main. Called from tests/scope/bts383.c:60. [eva:alarm] tests/scope/bts383.c:20: Warning: out of bounds read. assert \valid_read(p); [eva:alarm] tests/scope/bts383.c:22: Warning: out of bounds read. assert \valid_read(p); [eva] tests/scope/bts383.c:21: starting to merge loop iterations [eva] Recording results for loop1 [eva] Done for function loop1 [eva] computing for function loop2 <- main. Called from tests/scope/bts383.c:61. [eva:alarm] tests/scope/bts383.c:28: Warning: out of bounds read. assert \valid_read(p); [eva] tests/scope/bts383.c:27: starting to merge loop iterations [eva:alarm] tests/scope/bts383.c:30: Warning: out of bounds read. assert \valid_read(p); [eva] Recording results for loop2 [eva] Done for function loop2 [eva] computing for function out_string <- main. Called from tests/scope/bts383.c:62. [eva:alarm] tests/scope/bts383.c:35: Warning: out of bounds read. assert \valid_read(value); [eva:alarm] tests/scope/bts383.c:36: Warning: out of bounds read. assert \valid_read(value); [eva] computing for function out_char <- out_string <- main. Called from tests/scope/bts383.c:36. [kernel:annot:missing-spec] tests/scope/bts383.c:36: Warning: Neither code nor specification for function out_char, generating default assigns from the prototype [eva] using specification for function out_char [eva] Done for function out_char [eva] tests/scope/bts383.c:35: starting to merge loop iterations [eva] computing for function out_char <- out_string <- main. Called from tests/scope/bts383.c:36. [eva] Done for function out_char [eva] computing for function out_char <- out_string <- main. Called from tests/scope/bts383.c:36. [eva] Done for function out_char [eva] computing for function out_char <- out_string <- main. Called from tests/scope/bts383.c:36. [eva] Done for function out_char [eva] Recording results for out_string [eva] Done for function out_string [eva] computing for function fstruct <- main. Called from tests/scope/bts383.c:63. [eva:alarm] tests/scope/bts383.c:41: Warning: out of bounds write. assert \valid(&ps->a); [eva:alarm] tests/scope/bts383.c:42: Warning: out of bounds write. assert \valid(&ps->b); [eva:alarm] tests/scope/bts383.c:43: Warning: out of bounds write. assert \valid(&ps->a); [eva:alarm] tests/scope/bts383.c:43: Warning: out of bounds read. assert \valid_read(&ps->b); [eva:alarm] tests/scope/bts383.c:44: Warning: out of bounds write. assert \valid(&ps->b); [eva:alarm] tests/scope/bts383.c:44: Warning: out of bounds read. assert \valid_read(&ps->a); [eva:alarm] tests/scope/bts383.c:45: Warning: out of bounds read. assert \valid_read(&ps->a); [eva:alarm] tests/scope/bts383.c:45: Warning: out of bounds read. assert \valid_read(&ps->b); [eva:alarm] tests/scope/bts383.c:47: Warning: out of bounds write. assert \valid(&ps->a); [eva:alarm] tests/scope/bts383.c:48: Warning: out of bounds write. assert \valid(&ps->b); [eva:alarm] tests/scope/bts383.c:49: Warning: out of bounds write. assert \valid(&ps->a); [eva:alarm] tests/scope/bts383.c:49: Warning: out of bounds read. assert \valid_read(&ps->b); [eva:alarm] tests/scope/bts383.c:50: Warning: out of bounds write. assert \valid(&ps->b); [eva:alarm] tests/scope/bts383.c:50: Warning: out of bounds read. assert \valid_read(&ps->a); [eva:alarm] tests/scope/bts383.c:51: Warning: out of bounds read. assert \valid_read(&ps->a); [eva:alarm] tests/scope/bts383.c:51: Warning: out of bounds read. assert \valid_read(&ps->b); [eva] Recording results for fstruct [eva] Done for function fstruct [eva:alarm] tests/scope/bts383.c:63: Warning: signed overflow. assert x + tmp ≤ 2147483647; (tmp from fstruct(ps + 1)) [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 12 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fstruct: ps ∈ {{ &S_ps[2] }} x ∈ {20} S_ps[0] ∈ [--..--] [1..2]{.a; .b} ∈ {5} [eva:final-states] Values at end of function if1: v ∈ [--..--] [eva:final-states] Values at end of function if2: v ∈ [--..--] __retres ∈ [--..--] [eva:final-states] Values at end of function loop1: v ∈ [--..--] i ∈ [0..2147483647] n ∈ [--..--] [eva:final-states] Values at end of function loop2: v ∈ [--..--] i ∈ [0..2147483647] __retres ∈ [--..--] [eva:final-states] Values at end of function out_string: value ∈ {{ &S_p + {4; 5; 6; 7; 8; 9; 10; 11} }} [eva:final-states] Values at end of function main: v ∈ [--..--] x ∈ [-2147483628..2147483647] S_ps[0] ∈ [--..--] [1..2]{.a; .b} ∈ {5} /* Generated by Frama-C */ struct __anonstruct_Tstruct_1 { int a ; int b ; }; typedef struct __anonstruct_Tstruct_1 Tstruct; int v; void if1(int *p) { /*@ assert Eva: mem_access: \valid_read(p); */ if (*p > 0) /*@ assert Eva: mem_access: \valid_read(p); */ v = *p; return; } int if2(int c, int *p) { int __retres; if (c) /*@ assert Eva: mem_access: \valid_read(p); */ v = *p; /*@ assert Eva: mem_access: \valid_read(p); */ __retres = *p; return __retres; } void loop1(int *p) { int i; /*@ assert Eva: mem_access: \valid_read(p); */ int n = *p; i = 0; while (i < n) { /*@ assert Eva: mem_access: \valid_read(p); */ v = *p; i ++; } return; } int loop2(int n, int *p) { int __retres; int i; i = 0; while (i < n) { /*@ assert Eva: mem_access: \valid_read(p); */ v = *p; i ++; } /*@ assert Eva: mem_access: \valid_read(p); */ __retres = *p; return __retres; } /*@ assigns \nothing; */ void out_char(char c); void out_string(char const *value) { while (1) { /*@ assert Eva: mem_access: \valid_read(value); */ if (! *value) break; /*@ assert Eva: mem_access: \valid_read(value); */ out_char(*value); value ++; } return; } int fstruct(Tstruct *ps) { int x; /*@ assert Eva: mem_access: \valid(&ps->a); */ ps->a = 3; /*@ assert Eva: mem_access: \valid(&ps->b); */ ps->b = 5; /*@ assert Eva: mem_access: \valid(&ps->a); */ /*@ assert Eva: mem_access: \valid_read(&ps->b); */ ps->a = ps->b; /*@ assert Eva: mem_access: \valid(&ps->b); */ /*@ assert Eva: mem_access: \valid_read(&ps->a); */ ps->b = ps->a; /*@ assert Eva: mem_access: \valid_read(&ps->a); */ /*@ assert Eva: mem_access: \valid_read(&ps->b); */ x = ps->a + ps->b; ps ++; /*@ assert Eva: mem_access: \valid(&ps->a); */ ps->a = 3; /*@ assert Eva: mem_access: \valid(&ps->b); */ ps->b = 5; /*@ assert Eva: mem_access: \valid(&ps->a); */ /*@ assert Eva: mem_access: \valid_read(&ps->b); */ ps->a = ps->b; /*@ assert Eva: mem_access: \valid(&ps->b); */ /*@ assert Eva: mem_access: \valid_read(&ps->a); */ ps->b = ps->a; /*@ assert Eva: mem_access: \valid_read(&ps->a); */ /*@ assert Eva: mem_access: \valid_read(&ps->b); */ x += ps->a + ps->b; return x; } int main(int *p, Tstruct *ps) { int x; int tmp; /*@ assert Eva: mem_access: \valid_read(p + 1); */ x = *(p + 1); /*@ assert Eva: mem_access: \valid_read(p + 1); */ v = *(p + 1); if1(p + 1); if2(x,p + 1); loop1(p + 1); loop2(x,p + 1); out_string((char const *)(p + 1)); tmp = fstruct(ps + 1); /*@ assert Eva: signed_overflow: x + tmp ≤ 2147483647; */ x += tmp; return x; } frama-c-20.0-Calcium/tests/scope/oracle/bts971.res.oracle0000666000000000000000000000436613571573400017754 0ustar [kernel] Parsing tests/scope/bts971.c (with preprocessing) === Tests for Scope.Defs --- Intraprocedural mode (-scope-no-defs-interproc) [eva:alarm] tests/scope/bts971.c:10: Warning: signed overflow. assert v + 1 ≤ 2147483647; [eva:alarm] tests/scope/bts971.c:18: Warning: signed overflow. assert v + 2 ≤ 2147483647; [eva:alarm] tests/scope/bts971.c:19: Warning: signed overflow. assert v + 3 ≤ 2147483647; Current program point = first one in function 'f1' * Defs for (v) at current program point= no Defs found Current program point = first one in function 'g1' * Defs for (v) at current program point= no Defs found Current program point = 2d one in function 'g1' * Defs for (v) at current program point= tests/scope/bts971.c:18: v += 2; Current program point = first one in function 'f' * Defs for (v) at current program point= no Defs found --- Interprocedural mode (-scope-defs-interproc) Current program point = first one in function 'f1' * Defs for (v) at current program point= tests/scope/bts971.c:10: v ++; tests/scope/bts971.c:14: f1(); tests/scope/bts971.c:19: v += 3; tests/scope/bts971.c:23: g1(); tests/scope/bts971.c:27: v += 0; tests/scope/bts971.c:29: f(); tests/scope/bts971.c:30: g(); Current program point = first one in function 'g1' * Defs for (v) at current program point= tests/scope/bts971.c:10: v ++; tests/scope/bts971.c:14: f1(); tests/scope/bts971.c:19: v += 3; tests/scope/bts971.c:23: g1(); tests/scope/bts971.c:27: v += 0; tests/scope/bts971.c:29: f(); tests/scope/bts971.c:30: g(); Current program point = 2d one in function 'g1' * Defs for (v) at current program point= tests/scope/bts971.c:18: v += 2; Current program point = first one in function 'f' * Defs for (v) at current program point= tests/scope/bts971.c:10: v ++; tests/scope/bts971.c:14: f1(); tests/scope/bts971.c:19: v += 3; tests/scope/bts971.c:23: g1(); tests/scope/bts971.c:27: v += 0; tests/scope/bts971.c:29: f(); tests/scope/bts971.c:30: g(); === Tests for Scope.Defs --- Intraprocedural mode (-scope-no-defs-interproc) * Defs for (t[1].a) at current program point= tests/scope/bts971.c:48: init(); --- Interprocedural mode (-scope-defs-interproc) * Defs for (t[1].a) at current program point= tests/scope/bts971.c:43: t[1].a = 1; tests/scope/bts971.c:48: init(); frama-c-20.0-Calcium/tests/scope/oracle/no-effect.res.oracle0000666000000000000000000000205013571573400020555 0ustar [kernel] Parsing tests/scope/no-effect.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/scope/no-effect.i:11: Warning: out of bounds read. assert \valid_read(&(p1 + 1)->v); [eva:alarm] tests/scope/no-effect.i:16: Warning: out of bounds read. assert \valid_read(&(p1 + 1)->v); [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION /* Generated by Frama-C */ struct __anonstruct_tt_1 { int v ; }; typedef struct __anonstruct_tt_1 tt; void main(tt const *p1) { while (1) /*@ assert Eva: mem_access: \valid_read(&(p1 + 1)->v); */ switch ((p1 + 1)->v) { case 1: case 2: case 3: case 4: ; /*@ assert Eva: mem_access: \valid_read(&(p1 + 1)->v); */ int tmp = (p1 + 1)->v; break; } return; } frama-c-20.0-Calcium/tests/scope/oracle/scope.0.res.oracle0000666000000000000000000000232413571573400020162 0ustar [kernel] Parsing tests/scope/scope.c (with preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S1 ∈ {0} S2 ∈ {0} T[0..99] ∈ {0} [eva] computing for function Frama_C_interval <- f. Called from tests/scope/scope.c:26. [eva] using specification for function Frama_C_interval [eva] tests/scope/scope.c:26: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- f. Called from tests/scope/scope.c:32. [eva] tests/scope/scope.c:32: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: Frama_C_entropy_source ∈ [--..--] T[0..4] ∈ {0} [5..9] ∈ {0; 1} [10..15] ∈ {0; 1; 2} [16..20] ∈ {0; 2} [21..99] ∈ {0} x ∈ {4} y ∈ {0; 10} s ∈ [--..--] a ∈ {0} or UNINITIALIZED b ∈ {0} or UNINITIALIZED p ∈ {{ &x ; &y }} i ∈ {0} __retres ∈ {0; 4; 10} frama-c-20.0-Calcium/tests/scope/oracle/scope.1.res.oracle0000666000000000000000000000067513571573400020172 0ustar [kernel] Parsing tests/scope/scope.c (with preprocessing) [eva] Analyzing a complete application starting at f2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S1 ∈ {0} S2 ∈ {0} T[0..99] ∈ {0} [eva] Recording results for f2 [eva] done for function f2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f2: x ∈ {1; 2} y ∈ {3; 4} frama-c-20.0-Calcium/tests/scope/oracle/scope.2.res.oracle0000666000000000000000000000217313571573400020166 0ustar [kernel] Parsing tests/scope/scope.c (with preprocessing) [eva] Analyzing a complete application starting at loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S1 ∈ {0} S2 ∈ {0} T[0..99] ∈ {0} [eva] tests/scope/scope.c:67: starting to merge loop iterations [eva:alarm] tests/scope/scope.c:68: Warning: signed overflow. assert a + 1 ≤ 2147483647; [eva:alarm] tests/scope/scope.c:69: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/scope/scope.c:70: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva:alarm] tests/scope/scope.c:75: Warning: signed overflow. assert a + 1 ≤ 2147483647; [eva:alarm] tests/scope/scope.c:76: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva:alarm] tests/scope/scope.c:77: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva] Recording results for loop [eva] done for function loop [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function loop: a ∈ [1..2147483647] b ∈ [1..2147483647] i ∈ [1..2147483647] s ∈ [0..2147483647] frama-c-20.0-Calcium/tests/scope/oracle/zones.res.oracle0000666000000000000000000001311013571573400020044 0ustar [kernel] Parsing tests/scope/zones.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} S ∈ {0} X ∈ {0} Y ∈ {0} Z ∈ {0} Xf ∈ {0} Xg ∈ {0} Yf ∈ {0} Yg ∈ {0} [eva] computing for function simple <- main. Called from tests/scope/zones.c:73. [eva:alarm] tests/scope/zones.c:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva:alarm] tests/scope/zones.c:16: Warning: signed overflow. assert y + z ≤ 2147483647; [eva] Recording results for simple [eva] Done for function simple [eva] computing for function array1 <- main. Called from tests/scope/zones.c:74. [eva:alarm] tests/scope/zones.c:21: Warning: accessing out of bounds index. assert 0 ≤ x; [eva:alarm] tests/scope/zones.c:21: Warning: accessing out of bounds index. assert x < 10; [eva:alarm] tests/scope/zones.c:22: Warning: signed overflow. assert T[0] + y ≤ 2147483647; [eva] Recording results for array1 [eva] Done for function array1 [eva] computing for function struct1 <- main. Called from tests/scope/zones.c:75. [eva] Recording results for struct1 [eva] Done for function struct1 [eva] computing for function ctrl1 <- main. Called from tests/scope/zones.c:76. [eva] Recording results for ctrl1 [eva] Done for function ctrl1 [eva] computing for function caller <- main. Called from tests/scope/zones.c:78. [eva] computing for function f <- caller <- main. Called from tests/scope/zones.c:66. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- caller <- main. Called from tests/scope/zones.c:67. [eva] Recording results for g [eva] Done for function g [eva] computing for function g <- caller <- main. Called from tests/scope/zones.c:68. [eva:alarm] tests/scope/zones.c:60: Warning: signed overflow. assert a + b ≤ 2147483647; [eva] Recording results for g [eva] Done for function g [eva] computing for function f <- caller <- main. Called from tests/scope/zones.c:68. [eva:alarm] tests/scope/zones.c:54: Warning: signed overflow. assert x + y ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] Recording results for caller [eva] Done for function caller [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function array1: T[0] ∈ [--..--] [1..9] ∈ {0; 3} __retres ∈ [--..--] [eva:final-states] Values at end of function ctrl1: a ∈ [--..--] [eva:final-states] Values at end of function f: Xf ∈ [0..9] Yf ∈ [-2147483648..2147483644] __retres ∈ [--..--] [eva:final-states] Values at end of function g: Xg ∈ [--..--] Yg ∈ [-2147483648..2147483644] __retres ∈ [--..--] [eva:final-states] Values at end of function caller: Xf ∈ [0..9] Xg ∈ [--..--] Yf ∈ [-2147483648..2147483644] Yg ∈ [-2147483648..2147483644] x1 ∈ {0} y1 ∈ {0} z1 ∈ {0} a1 ∈ {0} b1 ∈ {0} c1 ∈ {0} pf ∈ {{ &f ; &g }} [eva:final-states] Values at end of function simple: x ∈ [-2147483645..2147483647] y ∈ {3} [eva:final-states] Values at end of function struct1: s.a ∈ [0..9] .b ∈ [--..--] __retres ∈ [0..9] [eva:final-states] Values at end of function main: T[0] ∈ [--..--] [1..9] ∈ {0; 3} Xf ∈ [0..9] Xg ∈ [--..--] Yf ∈ [-2147483648..2147483644] Yg ∈ [-2147483648..2147483644] __retres ∈ {0} [pdg] computing for function simple [pdg] done for function simple Current program point = return in function simple Zones for x at current program point = Stmt:1 -> z Stmt:2 -> y; z Stmt:3 -> y; z Stmt:5 -> x [pdg] computing for function array1 [pdg] done for function array1 Current program point = return in function array1 Zones for T[0] at current program point = Stmt:7 -> T[0]; x; y Stmt:8 -> T[0]; y Stmt:10 -> T[0] Stmt:61 -> T[0] Zones for T[1] at current program point = Stmt:7 -> T[1]; x Stmt:8 -> T[1] Stmt:10 -> T[1] Stmt:61 -> T[1] Zones for T[x] at current program point = Stmt:7 -> T[0..9]; x; y Stmt:8 -> T[0..9]; x; y Stmt:10 -> T[0..9]; x Stmt:61 -> T[0..9]; x [pdg] computing for function struct1 [pdg] done for function struct1 Current program point = return in function struct1 Zones for s.a at current program point = Stmt:12 -> x Stmt:13 -> x Stmt:14 -> s.a Stmt:16 -> s.a Stmt:63 -> s.a Zones for s.b at current program point = Stmt:12 -> S; y Stmt:13 -> y; s.b Stmt:14 -> y; s.b Stmt:16 -> s.b Stmt:63 -> s.b Zones for s at current program point = Stmt:12 -> S; x; y Stmt:13 -> x; y; s.b Stmt:14 -> y; s Stmt:16 -> s Stmt:63 -> s [pdg] computing for function ctrl1 [pdg] done for function ctrl1 Current program point = return in function ctrl1 Zones for a at current program point = Stmt:19 -> x; y; z Stmt:20 -> y Stmt:21 -> a Stmt:22 -> a Stmt:23 -> z Stmt:25 -> a Current program point = label Lt2 in function ctrl1 Zones for a at current program point = Stmt:19 -> x; y Stmt:20 -> y Stmt:21 -> a Stmt:22 -> a Stmt:23 -> \nothing Stmt:25 -> \nothing [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [pdg] computing for function caller [pdg] done for function caller Current program point = return in function caller Zones for Yf at current program point = Stmt:37 -> cond; v Stmt:38 -> cond; v Stmt:39 -> cond; v Stmt:40 -> cond; v; z1 Stmt:41 -> cond; v; z1 Stmt:42 -> cond; v; z1 Stmt:44 -> cond; v; z1 Stmt:45 -> v; z1 Stmt:46 -> v; z1 Stmt:47 -> v; z1; tmp Stmt:48 -> v; z1; pf Stmt:49 -> Yf; v; pf Stmt:50 -> Yf; v; pf Stmt:51 -> Yf frama-c-20.0-Calcium/tests/scope/scope.c0000666000000000000000000000237713571573400014754 0ustar /* run.config OPT: -eva @EVA_CONFIG@ -main f -journal-disable OPT: -eva @EVA_CONFIG@ -main f2 -journal-disable OPT: -eva @EVA_CONFIG@ -main loop -journal-disable */ /* * bin/viewer.byte -main f tests/scope/scope.c -eva * bin/viewer.byte -main f2 tests/scope/scope.c -eva * bin/viewer.byte -main loop tests/scope/scope.c -eva */ #include "__fc_builtin.h" typedef struct {int a; int b; } Tstr; Tstr S1, S2; int T[100]; int f (int x, int y, Tstr s) { int a, b; int * p; int i; if (x > 0) { p = &x; a = 0; s.a = 3; i = Frama_C_interval (5, 15); T[i] = 1; } else { p = &y; b = 0; i = Frama_C_interval (10, 20); T[i] = 2; } i = 0; x = 5; y = 10; /* It can be interesting to see that selecting T[i] * is not the same than selecting T[0] even if i=0 */ *p = i; x = 4; return *p; } void f2 (int c) { int x, y; y = 0; x = 1; y++; if (c) { y++; } else { y++; x = 2; y++; } y++; } int loop (int n) { int a, b, i, s; i = 0; s = 0; a = 0; b = 0; while (i < n) { a++; b++; s++; /* selecting i here select also stmts before the loop */ /* selecting s here select also stmts after the loop */ i++; } a++; b++; i++; return s; } frama-c-20.0-Calcium/tests/scope/zones.c0000666000000000000000000000257413571573400015000 0ustar /* run.config # EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@ -eva @EVA_OPTIONS@ -journal-disable */ /* bin/viewer.opt -eva @PTEST_DIR@/@PTEST_NAME@.c */ int T [10]; struct Tstr { int a; int b; } S; int X,Y,Z; int simple (int x, int y, int z) { y = 3; //no need for y before x ++; //not used x = y + z; return x; } int array1 (int x, int y) { T[x] = 3; T[0] += y; return T[0]; } int struct1 (int x, int y) { struct Tstr s; s = S; // lose precision : even if we need s.b after, we need S before s.a = x; s.b += y; return s.a; } int ctrl1 (int x, int y, int z) { int a; if (x) { a = y; goto Lt2; // to keep Lt2 Lt2 : ; } else { a = z; } return a; } //================================================================ int Xf, Xg, Yf, Yg; int f (int x, int y, int z) { Xf += x; Yf = z; return x + y; } int g (int a, int b, int c) { Xg += b; Yg = c; return a + b; } int caller (int cond, int t, int u, int v) { int x1 = 0, y1 = 0, z1 = 0, a1 = 0, b1 = 0, c1 = 0; int (*pf)(int, int, int) = cond ? &f : &g; f(x1, y1, z1); g(a1, b1, c1); return (*pf)(t, u, v); } //================================================================ int main (int x, int y, int z) { simple (x, y, z); array1 (x, y); struct1 (x, y); ctrl1 (x, y, z); caller (x, x, y, z); return 0; } frama-c-20.0-Calcium/tests/scope/zones.ml0000666000000000000000000000356713571573400015171 0ustar (* when using toplevel.top : bin/topleval.top -eva tests/scope/zones.c #directory "cil/src";; *) let fmt = Format.std_formatter;; (* let old_debug = Kernel.Debug.get ();; Kernel.Debug.set 1;; (* to see sid *) Format.fprintf fmt "@[%a@]" Printer.pp_file ( Ast.get ());; Kernel.Debug.set old_debug;; *) let find_ret kf_name = let kf = Globals.Functions.find_by_name kf_name in let stmt = Kernel_function.find_return kf in Format.printf "Current program point = return in function %s@\n" kf_name; stmt, kf ;; let find_sid sid = let stmt, kf = Kernel_function.find_from_sid sid in Format.printf "Current program point = before stmt %d in function %a@\n" sid Kernel_function.pretty kf; stmt, kf ;; let find_label kf_name lab_name = let kf = Globals.Functions.find_by_name kf_name in let stmt = !(Kernel_function.find_label kf lab_name) in Format.printf "Current program point = label %s in function %s@\n" lab_name kf_name; stmt, kf let compute_and_print pp str_data = let stmt, kf = pp in let lval_term = !Db.Properties.Interp.term_lval kf str_data in let lval = !Db.Properties.Interp.term_lval_to_lval ~result:None lval_term in let (_used_stmts, zones) = Scope.Zones.build_zones kf stmt lval in Format.printf "Zones for %s at current program point =@.%a\n@\n" str_data Scope.Zones.pretty_zones zones ;; let main _ = let pp = find_ret "simple" in compute_and_print pp "x"; let pp = find_ret "array1" in compute_and_print pp "T[0]"; compute_and_print pp "T[1]"; compute_and_print pp "T[x]"; let pp = find_ret "struct1" in compute_and_print pp "s.a"; compute_and_print pp "s.b"; compute_and_print pp "s"; let pp = find_ret "ctrl1" in compute_and_print pp "a"; let pp = find_label "ctrl1" "Lt2" in compute_and_print pp "a"; let pp = find_ret "caller" in compute_and_print pp "Yf" let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/0000777000000000000000000000000013571573400014005 5ustar frama-c-20.0-Calcium/tests/slicing/README0000666000000000000000000000747613571573400014703 0ustar This file present the tests in ppc/tests/slicing. For the Program Dependence Graph tests, see ppc/tests/pdg. ** tests/slicing/simple_intra_slice.c & tests/slicing/simple_intra_slice.ml First slicing test. Still use internal functions of the Slicing module to test internal features (select with a statement number for instance). Many small tests for intra-procedural slicing. ** tests/slicing/select_by_annot.c & tests/slicing/select_by_annot.ml At first, there were no internal means to build a location for a data at a given program point, so test the slicing on a data using annotation in the source code. ** tests/slicing/libSelect.ml Library used in other tests to have higher level functions. Also includes a try to have a 'load_source_file' function in order to be able to change the project without exiting the tool, but it doesn't work at the moment because of CIL problems. ** tests/slicing/select_simple.c & tests/slicing/select_simple.ml Same source code than simple_intra_slice.c but test it with a user point of view using Select module (above) functions. ** tests/slicing/switch.c & tests/slicing/switch.ml One very small test on a switch. Should do more... ** tests/slicing/ex_spec_interproc.c & tests/slicing/ex_spec_interproc.ml Example given by Patrick for the specification of the inter-procedural slicing. Test the example using different slicing modes. See the documentation for more information. ** tests/slicing/horwitz.c & tests/slicing/horwitz.ml Example from a paper of Horwitz about inter-procedural slicing. Check if we have the same result than her with her System Dependence Graph. ** tests/slicing/adpcm.c & tests/slicing/adpcm.ml source code from tests/test/adpcm.c. To have a bigger example... ** tests/slicing/ptr_fct.c Example given by Patrick for the specification/documentation of Db.Slicing.Project.is_directly_called_internal. ** tests/slicing/sizeof.c Example given by Patrick. Tests the slicing different slicing modes with and without propagation to the callers. This is done using options of the command line: -slice-print, -slicing-return. ** tests/slicing/select_return.c ** tests/slicing/select_return_bis.c Example given by Patrick for the specification of the inter-procedural slicing including the propagation to the callers. Tests the example using different slicing modes with and without propagation to the callers. This is done using options of the command line: -slice-print, -slicing-level, -slicing-return and -slice-calls, with/without -slice-callers. Some tests for -slice-value have been added. ** tests/slicing/select_call.c Example given by Julien for the specification of property analysis about data confidentiality. Test -slice-calls option. ** tests/slicing/mark_all_slices.c tests for the newly created (04/2007) persistant selection. ** tests/slicing/min_call.c the source code is included from tests/slicing/select_return.c, but le .ml command file is to test the propagation to the callers. It use the new (04/2007) [select_min_call] function that can be used to select a call to be visible without choosing the version of the function to call. ** tests/slicing/libAnim.ml Useful functions to view graphically the building process of a slicing project. ** tests/slicing/anim.ml Small example to see how to use tests/slicing/libAnim.ml (see the header lines to launch it) ** tests/slicing/merge.c Basic test for merging slices (to be enhance...) ** tests/slicing/variadic.c Same source file than tests/pdg/variadic.c (#include). Slicing variadic functions and calls to variadic functions. ** tests/slicing/unravel-flavors.c ** tests/slicing/unravel-point.c ** tests/slicing/unravel-variance.c Small example derived from examples given for UNRAVEL slicing tool. frama-c-20.0-Calcium/tests/slicing/adpcm.c0000666000000000000000000000037213571573400015237 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs STDOPT: +"-load-module ./tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -ulevel -1 -deps -slicing-level 2 -journal-disable" */ #include "tests/test/adpcm.c" frama-c-20.0-Calcium/tests/slicing/adpcm.ml0000666000000000000000000000065313571573400015427 0ustar (* ledit bin/toplevel.top -no-annot -deps -slicing_level 2 tests/slicing/adpcm.c #use "tests/slicing/select.ml";; *) include LibSelect;; (* Kernel.slicing_level := 2;; = MinimizeNbCalls *) (* let resname = "tests/slicing/adpcm.sliced" in ignore (test "uppol2" ~do_prop_to_callers:true ~resname (select_retres));; *) let () = Db.Main.extend (fun _ -> ignore (test "uppol2" ~do_prop_to_callers:true (select_retres))) frama-c-20.0-Calcium/tests/slicing/anim.ml0000666000000000000000000000311713571573400015265 0ustar (* * Small example to view graphically the building process of a slicing project. * To try it, use the following commands : make tests/slicing/anim.byte; \ tests/slicing/anim.byte -deps -lib-entry -main g -slicing-level 3 -slice-callers \ tests/slicing/select_return_bis.c *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let add_select_fun_calls kf = let selections = Db.Slicing.Select.empty_selects in let selections = Slicing.Api.Select.select_func_calls_into selections ~spare:false kf in Slicing.Api.Select.iter_selects_internal (fun s -> !Db.Slicing.Request.add_selection_internal s) selections (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let main _ = let proj_name = "slicing_project" in let n = 0 in let title = "Before start" in let n = LibAnim.print_proj proj_name title n in let kf_send = Globals.Functions.find_by_name "send" in add_select_fun_calls kf_send; let title = "Select 'send' calls" in let n = LibAnim.print_proj proj_name title n in let title = "Apply : " ^ title in let n = LibAnim.build_all_graphs proj_name title n in let kf_send_bis = Globals.Functions.find_by_name "send_bis" in add_select_fun_calls kf_send_bis; let title = "Select 'send_bis' calls" in let n = LibAnim.print_proj proj_name title n in let title = ("Apply : "^title) in let _n = LibAnim.build_all_graphs proj_name title n in LibAnim.print_help proj_name;; (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/annot.i0000666000000000000000000000135513571573400015302 0ustar /* run.config STDOPT: +"-main f1 -slice-assert f1 -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-main f2 -slice-assert f2 -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " */ extern int x, z; int t[10]; void f1() { int v = 3; x = x + x - x; int y = z; x = 3; int r = x; //@ assert x == \at(x, Pre); } void f2() { t[1] = 5; t[6] = 4; x = 2; x = 3; //@ assert \initialized(&t[x..9]); } frama-c-20.0-Calcium/tests/slicing/bts0184.i0000666000000000000000000000067213571573400015271 0ustar /* run.config STDOPT: +"-slice-pragma x -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " **/ int x(int y, int z) { /*@ slice pragma expr y == 1; */ //@ assert y == 1; //@ assert y + z == 3; return y; } int main() { return 0; } int z1() { return x(2,2); } frama-c-20.0-Calcium/tests/slicing/bts0190.i0000666000000000000000000000074113571573400015263 0ustar /* run.config STDOPT: +"-slicing-warn-key cmdline=active -check -slice-rd y -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " */ int z1(void); int x(int y, int z){ /*@ slice pragma expr y == 1; */ //@ assert y == 1; //@ assert y + z == 3; return 2*y*z1(); } int main() { x(1,2); return 0; } int z1() { return 1; } frama-c-20.0-Calcium/tests/slicing/bts0950_annot.i0000666000000000000000000000065413571573400016471 0ustar /* run.config STDOPT: +"-eva -slice-value a -then-on 'Slicing export' -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" */ /*@ requires \valid(dest); */ extern void cpy(int *dest, const int *src); void cpy(int* region1, const int* region2) { *(region1) = *region2; } int a=1, b=2; void main() { cpy(&a,&b); } frama-c-20.0-Calcium/tests/slicing/bts1248.i0000666000000000000000000000051313571573400015265 0ustar /* run.config STDOPT: +"-slice-rd x -main f -slicing-project-name p -then-on 'p export' -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" */ int f(void) { int x = 0; return x; // <- cannot be selected since x is a local variable } frama-c-20.0-Calcium/tests/slicing/bts1445.i0000666000000000000000000000102513571573400015263 0ustar /* run.config STDOPT: +"-slice-calls main -then-on 'Slicing export' -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" STDOPT: +"-slice-calls f -main f -then-on 'Slicing export' -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" */ int x = 0; int main() { while(1) x=0; return x + 1; } int f() { while(1) x=0; return x + 1; } frama-c-20.0-Calcium/tests/slicing/bts1684.i0000666000000000000000000000074313571573400015276 0ustar /* run.config STDOPT: +"-slice-calls main -journal-enable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" */ // one bug about JOURNALIZATION and another one about slicing CALLS TO MAIN function. double d1, d2, d3; int x1, x2, x3; int main2 (void) { d1 = d2 * d3; x1 = x2 * x3; return 1; } int main (void) { return main2(); } frama-c-20.0-Calcium/tests/slicing/bts1768.i0000666000000000000000000000173513571573400015303 0ustar /* run.config STDOPT: +"-main main -slice-pragma main -ulevel 10 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" */ int choix ; int state = 1; int cumul =0 ; int step =0; //initialisation /*@ ensures \result==0 || \result==1 || \result==2 ; */ int choisir(void) ; void lecture() { choix = choisir() ; } void fsm_transition() { switch (state) { case 1: if (choix == 2) { cumul = cumul +2 ; state = 2 ; } else cumul++; break ; case 2: if ((step==50) && (choix==1)) state = 3 ; else cumul++ ; break ; case 3: if ((choix==0) && (cumul==10)) state = 1; default: break ; } } int main() { while (step>=0){ lecture() ; fsm_transition() ; if (state == 3) { /*@ slice pragma ctrl ;*/ break ; } step ++ ; } return 0 ; } frama-c-20.0-Calcium/tests/slicing/bts179.i0000666000000000000000000000147313571573400015215 0ustar /* run.config STDOPT: +"-slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" STDOPT: +"-slice-pragma main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" STDOPT: +"-sparecode-analysis -journal-disable" */ struct {int a; int ab; int b; int c ; int d;} S; int X, Y; void g (void) { S.a = 1; S.ab = 0; S.b = 2; /* here, better can be done ! */ S.d = 4; } int main (void) { g(); //@ slice pragma expr S.b; S.ab = 1; /* so that S.ab is sparecode in g() */ return S.a ; } frama-c-20.0-Calcium/tests/slicing/bts283.i0000666000000000000000000000132013571573400015200 0ustar /* run.config STDOPT: +"-slice-return main -slice-undef-functions -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" */ int x,y,z; int X, Y ; /*@ requires a > 0; ensures y == a; */ int f(int a) { y = x; return x; } /*@ requires a: a > 0; requires b: b > 0; assigns \result \from a; assigns Y \from b; */ int g (int a, int b); /*@ requires x > 0; ensures X > \old(X); ensures Y == \old(Y) + 1; */ void k(int x) { X += x ; Y ++ ; } int main() { x = 1; y = 2; z = f(x); z += g(1, 2); k(3); return X + z; } frama-c-20.0-Calcium/tests/slicing/bts326.i0000666000000000000000000000073713571573400015211 0ustar /* run.config STDOPT: +"-calldeps -slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" */ /* Problem : f(1) should be sliced out. See BTS#326 */ int t[2] ; int r; void f (int i) { t[i] = i; } void g (void) { f(0) ; f(1) ; } int main (void) { g () ; r = t[0] ; return r; } frama-c-20.0-Calcium/tests/slicing/bts335.i0000666000000000000000000000116613571573400015206 0ustar /* run.config STDOPT: +"-slice-pragma g -calldeps -slicing-level 3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" */ /* bin/toplevel.opt -slice-pragma g -calldeps -slicing-level 3 tests/slicing/bts335.c -debug 2 bin/toplevel.opt -pdg-debug -pdg -pdg-debug "-pdg-pot bts335" tests/slicing/bts335.c */ int T[2] = {0, 0}; void f (int i) { T[i]++; } void g (void) { f(0); /*@ slice pragma expr T[0]; */ } void main (int c) { if (c) g(); else f(1); } frama-c-20.0-Calcium/tests/slicing/bts335b.i0000666000000000000000000000120013571573400015335 0ustar /* run.config STDOPT: +"-slice-return main -calldeps -slicing-level 3 -slicing-verbose 2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" */ int X, Y; int g(int c, int x, int y, int z) { X = z ; if (c == 1) X = x; if (c == 2) X = y; Y = X ; return X; } int f(int c, int x, int y, int z) { z++; return g(c,x,y,z); } int main(int v, int w, int a, int b, int i, int j) { int r = f(1, v, a, i) ; j++; r += g(2, w, b, j) ; return r ; } frama-c-20.0-Calcium/tests/slicing/bts336.i0000666000000000000000000001006113571573400015201 0ustar /* run.config STDOPT: +"-slice-return main -calldeps -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-main main2 -slice-return main2 -calldeps -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-main main3 -slice-return main3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-journal-disable -main main3 -inout -calldeps -slice-return main3 -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps -no-inout" STDOPT: +"-journal-disable -main main -calldeps -slice-return main -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-journal-disable -main main4 -calldeps -slice-return main4 -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-journal-disable -main main4 -calldeps -slice-return main4 -slicing-level 3 -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-journal-disable -main main5 -calldeps -slice-return main5 -then-on 'Slicing export' -set-project-as-default -print @EVA_OPTIONS@ -calldeps -slice-return main5 -then-on 'Slicing export 2' -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" */ // something to do to have better results... int T[10]; int f (int i) { T[i] ++; return T[i]; } int main (void) { int x1 = f(1); int x2 = f(2); return x2; } //-------------------------------------- // Notice that the example below is very similar to the one above : // f2 also modifies T[1..2], but in this one, the slicing is ok // because T[1..2] is not in the right part of the assignment. void f2 (int i) { T[i] = i; } int main2 (void) { f2 (1); f2 (2); return T[2]; } //-------------------------------------- // This is a similar problem, but without any array. // Option -calldeps gives a better result because we can then slice f3 (&c); // but we cannot slice f3(&a) because it seems to have b as an output, // and f3 (&b); needs b as an input. void f3 (int * p) { *p += 1; } int main3 (void) { int a = 1; int b = 2; int c = 3; f3 (&a); f3 (&b); f3 (&c); return b; } //-------------------------------------- // more complicated variant of 'main3'. This has been resolved in the same way as the first 'main' of this file void f4 (int * p, int* q) { *p += 1; *q += 1; } int main4 (volatile int c) { int a1 = 1; int b1 = 2; int a2 = 3; int b2 = 4; int a3 = 5; int b3 = 6; int a4 = 7; int b4 = 8; int a5 = 9; int b5 = 10; while(c) { f4 (&a1, &b1); f4 (&a2, &b2); f4 (&a3, &b3); f4 (&a4, &b4); f4 (&a5, &b5); } return a2+b4; } //-------------------------------------- // Non-optimal example if only one phase of slicing is done. Would need a notion of "operational functional dependencies", or a callwise pdg int x5; void f5(int *p, int *q) { (*p)++; x5 = *q; } int main5() { int a1=1, a2=2, b1=3, b2=4; f5(&a1, &b1); // This call should be sliced away f5(&a2, &a1); return a2; } frama-c-20.0-Calcium/tests/slicing/bts341.i0000666000000000000000000000054513571573400015203 0ustar /* run.config STDOPT: +"-slice-assert main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" */ int main (int c) { if (c) while (1) { ; } //@ assert c == 0; return c; } frama-c-20.0-Calcium/tests/slicing/bts344.i0000666000000000000000000000157513571573400015212 0ustar /* run.config STDOPT: +"-slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-slice-return main_bis -main main_bis -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" */ int X, Y ; void h(int x); /*@ ensures X == \old(X) + x; */ void k(int x) { X += x ; Y ++ ; } void h(int x) { X += x ; Y ++ ; } void f(int x, ...) { void (*q) (int) = &h; void (*p) (int) = &k; h(x); } int main (int x) { f (1) ; h(2) ; k(3); return X ; } int main_bis (void) { void (*p) (int) = &k; (*p)(1) ; return Y; } frama-c-20.0-Calcium/tests/slicing/bts345.i0000666000000000000000000000324413571573400015206 0ustar /* run.config STDOPT: +"-slice-return call_top -main call_top -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-return top -main top -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-return top -main call_top -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-return called_by_top -main top -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-return called_by_top -main call_top -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " */ int called_indirectly_by_top (int x) { x++ ; return x ; } int called_by_top (int x) { x++ ; int z = called_indirectly_by_top (x) ; return z ; } int top (int x, ...) { x++ ; int z = called_by_top (x) ; return z; } int call_top (int y) { y++; int z = top (y) ; return z ; } frama-c-20.0-Calcium/tests/slicing/bts679.i0000666000000000000000000000051213571573400015213 0ustar /* run.config STDOPT: +"-slice-return main -then-on 'Slicing export' -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" */ void f(void) { return; } int X = 1 ; int main(void) { call: f(); //@ assert X == \at(X,call); return X; } frama-c-20.0-Calcium/tests/slicing/bts679b.i0000666000000000000000000000050513571573400015357 0ustar /* run.config STDOPT: +"-slice-assert main -then-on 'Slicing export' -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" */ int X = 1 ; int main(void) { int y; L: y = 0; X++; //@ assert X > \at(X,L); return X; } frama-c-20.0-Calcium/tests/slicing/bts709.c0000666000000000000000000000210613571573400015200 0ustar /* run.config STDOPT: +"-slice-pragma func -no-unicode -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" */ #include int inputsOf_testcase_func (void); int inp1, var1,var2; void func( void ) { if ( 1 == inp1 ) { // Block-1 var1 = 1 ; var2 = 1 ; } else { if ( 2== inp1 ) { // Block-2 var1 = 2 ; var2 = 2 ; } else { // Block-3 if ( 3== inp1 ) { var1 = 3; var2 = 3 ; } } } //@slice pragma stmt; 65 != var2 ? assert ( 5 != var1):1; } int main( ) { int _noOfIter_ = 0; for (_noOfIter_=0; _noOfIter_ < 1; _noOfIter_++ ) { inputsOf_testcase_func ( ); func (); } } int inputsOf_testcase_func () { int nondet_int ( void); inp1 = nondet_int ( ); var1 = nondet_int ( ); // This required line is getting knocked off var2 = nondet_int ( ); // This required line is getting knocked off return 0; } frama-c-20.0-Calcium/tests/slicing/bts808.i0000666000000000000000000000101513571573400015204 0ustar /* run.config * STDOPT: +"-slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " */ int f0 (void) { int i = 0; int x; if (i) { x = 1; L: x++; } else { x = 0; goto L; } return x; } int f1 (void) { int i = 1; int x; if (i) { x = 1; goto L; } else { x = 0; L: x++; } return x; } int main (int n) { return f0 () + f1 (); } frama-c-20.0-Calcium/tests/slicing/bts827.i0000666000000000000000000000067013571573400015213 0ustar /* run.config STDOPT: +"-slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" */ /* The problem was a mix-up between f outputs and retrun value. */ int G; int f (void) { G = 3; return 5; } int main (void) { G = 1; G += f (); return G; } frama-c-20.0-Calcium/tests/slicing/call_accuracy.i0000666000000000000000000000317713571573400016754 0ustar /* run.config STDOPT: +"-calldeps -slice-return main -slicing-level 3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" */ int f_cond (int c, int a, int b) { ++a; ++b; return c ? a : b; } int test_cond (int x, int y, int z) { ++x ; ++y ; // <- best can be done. ++z ; z = f_cond(1, x, y); // <- best can be done. ++y ; // <- best can be done. ++x ; ++z; return f_cond(0, y, z); // <- best can be done. } void f_set (int *p, int v) { *p = v ; } struct st {int a, b ;} S1, S2, S3, S4; int test_set (int x, int y, int z) { int a, b ; struct st s1, s2, s3 = {1, 2} ; int tab [5] ; f_set(&a,x); f_set(&b,y); f_set(&s1.a,x); // <- best++ can be done. f_set(&s1.b,y); f_set(&s2.a,x); f_set(&s2.b,z); f_set(&s3.a,x); f_set(&tab[0],x); // <- best++ can be done. f_set(&tab[1],y); f_set(&tab[2],z); // <- best++ can be done. f_set(&S1.a,x); // <- best++ can be done. f_set(&S1.b,y); f_set(&S2.a,x); // <- best++ can be done. f_set(&S2.b,y); S3.a = 1 ; // <- best++ can be done. S3.b = 2 ; S4.a = 3 ; return b + s1.b + s3.b + tab[1] + S1.b + S2.b; } int test_struct (void) { S1.a = 1 ; // <- best can be done. S1.b = 2 ; S2.a = 3 ; S2 = S1 ; S2.a = 4 ; // <- best can be done. return S2.b ; } int main (int x, int y, int z) { int r1 = test_struct () ; int r2 = test_cond(x, y, z) ; int r3 = test_set (x, y, z) ; return r1 + r2 + r3 + S3.b + S4.b ; } frama-c-20.0-Calcium/tests/slicing/call_demo.i0000666000000000000000000000152313571573400016077 0ustar /* run.config STDOPT: +"-slice-calls call1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-slice-calls call2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" */ //@ assigns \result \from v; int call1 (int v); //@ assigns \result \from v; int call2 (int v); void oper (int * s, int * p, int i) { *s = *s + i; *p = *p * i; } void main (int n) { int i; int sum = 0; int product = 1; for(i = 0; i < n; ++i) oper (& sum, & product, i); call1(sum); call2(product); } frama-c-20.0-Calcium/tests/slicing/callwise.i0000666000000000000000000000153613571573400015767 0ustar /* run.config STDOPT: +"-calldeps -slice-return main -slicing-level 2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" */ int a = 1, b = 1, c = 1, d = 1, *p; void f(int *p, int *q) { *p += *q; } int choose (int cond, int x, int y) { return cond ? x : y; } void fs163_f (int *p,int n) { *p = n; } int fs163_main (int n) { int A,B,C; int T[5]; fs163_f (&A, 1); fs163_f (&B, n); fs163_f (&C, 2); fs163_f (&T[0], 0); fs163_f (&T[1], 1); for (int i=0; i<5; i++) fs163_f (&T[i],i); return T[3]; } int main(void) { int n = 2, m = 3; f(&a, &b); f(&c, &d); b = choose (0, n, m); a += choose (1, n, m); a += fs163_main (10); return a; } frama-c-20.0-Calcium/tests/slicing/combine.i0000666000000000000000000000074513571573400015601 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -journal-disable */ //@ assigns \result \from x; int g (int x); int f (int c, int x) { int y = c ? 1 : -1; int r; if (y < 0) r = x+y; else r = 0; r = g (r); return r; } int main (int x) { int r; if (x > 0) r = f (0, x); else r = f (1, x); return r; } frama-c-20.0-Calcium/tests/slicing/combine.ml0000666000000000000000000000464013571573400015757 0ustar open LibSelect;; let f_slice_names kf src_called fnum = let fname = Kernel_function.get_name kf in if (fname = "main") || (fnum = 1 && not src_called) then fname else (fname ^ "_s_" ^ (string_of_int (fnum))) (* To be able to build framac-journal.ml *) let f_slice_names = Journal.register "Combine.f_slice_names" (Datatype.func Kernel_function.ty (Datatype.func Datatype.bool (Datatype.func Datatype.int Datatype.string))) f_slice_names let main _ = Slicing.Api.Project.reset_slicing (); let kf_main = Globals.Functions.find_def_by_name "main" in let kf_f = Globals.Functions.find_def_by_name "f" in Slicing.Api.Project.change_slicing_level kf_f 2; let ff_main = Slicing.Api.Slice.create kf_main in let select = select_retres kf_main in Slicing.Api.Request.add_slice_selection_internal ff_main select; Slicing.Api.Request.apply_all_internal (); extract_and_print (); Format.printf "Let's split 'f':@."; let ff_f = match Slicing.Api.Slice.get_all kf_f with | f :: [] -> f | _ -> assert false in ignore (Slicing.Api.Request.split_slice ff_f); Slicing.Api.Request.apply_all_internal (); let proj2 = Slicing.Api.Project.extract ~f_slice_names "slicing_result" in Project.set_current proj2; Format.printf "After Slicing :@." ; File.pretty_ast (); (* let infos = object inherit Cil.nopCilVisitor method vfunc { svar = v } = Cil.log "function definition of %s (id %d at address %x)@." v.vname v.vid (Obj.magic v); Cil.DoChildren method vvdec v = Cil.log "variable definition of %s (id %d at address %x)@." v.vname v.vid (Obj.magic v); Cil.SkipChildren method vvrbl v = Cil.log "use of %s (id %d at address %x)@." v.vname v.vid (Obj.magic v); Cil.SkipChildren end;; let new_cil_file = Ast.get () in Cil.visitCilFile infos new_cil_file (* the cil file after slicing *);; *) Dynamic.Parameter.Bool.set "-eva-show-progress" true; !Db.Value.compute (); let all = Cil_datatype.Fundec.Set.empty in let proj3 = Constant_Propagation.Api.get all ~cast_intro:true in Project.set_current proj3; Dynamic.Parameter.Bool.set "-eva-show-progress" true; Format.printf "After Constant propagation :@."; File.pretty_ast ~prj:proj3 (); let proj4 = Sparecode.Register.get ~select_annot:true ~select_slice_pragma:true in Format.printf "After Sparecode :@."; File.pretty_ast ~prj:proj4 ();; let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/csmith.i0000666000000000000000000000734013571573400015452 0ustar /* run.config STDOPT: +"-slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " COMMENT: STDOPT: +"-main bts906b -fct-pdg bts906b -pdg-print -pdg-verbose 2" STDOPT: +"-main bts906c -fct-pdg bts906c -pdg-print -pdg-verbose 2" COMMENT: The two PDG tests above test interesting case where the slicing may COMMENT: slice away a goto because of an incorrect analyze of some dead code, COMMENT: which make the slicer think that the destination of the goto is the COMMENT: syntactic successor of the goto instruction... **/ int G1; void f1 (int c) { for (int x = 0; x < 10; x++) { G1 = 3; if (G1) break; return; } } int G1b; void f1b (void) { W: { { G1b = 3; if (G1b) goto B; return; } goto W; } B: ; } int G2; void f2(void) { while (1) { G2 = 3; if (G2) break; } } int bts181 (int c) { int x = 0, y = 0; if (c) { x = 1; if (x>0) y = 3; } return y; } int bts181b (int c) { int x = 0, y = 0; if (c) { x = 1; if (x>0) y = 3; else y = 4; } return y; } int bts807 (void) { int g = 0; int b = 7; int a = 2; if ((( a || 42) && b)) { while (1) { g = 21; return g; } } return g; } int bts809 (void) { int x; while (1) { x = 10; goto L; while (x) { L: return x; } } } // TODO: see COMMENT above. int bts879 (int c) { int g = 0; int p = c ? 0 : 10; if (p || (g && G1) ) { return 1; } return 0; } // This one looks similar to the previous one, but without the block, // Cil doesn't generate a goto from the then branch to the else branch... int bts879b (int c) { int g = 0; int p = c ? 0 : 10; if (p || (g && G1) ) return 1; return 0; } int one_time_loop_with_break () { int x; while (1) { x = 3; if (x > 0) break; x++; } return x; } /* TODO: find an example... I didn't manage to build one. int one_time_loop_with_continue () { int x = 0; while (1) { x++; if (x == 2) break; if (x == 1) continue; } return x; } */ int bts899 (void ) { int vrai = 1; int x = 254; for (int i = 17; (i != (-9)); i--) { if (! i) { if (vrai) continue; continue; // unreachable but disturb ctrl dependencies... } x ++; } return x; } int bts906 (void) { int x = 0; int i = 2; while (i >= 0) { while (1) { if (i) goto B; else { x ++; return x; if (x) goto B; } } B : i --; } return 0; } int bts906b (void) { int x = 0; int i = 2; while (i >= 0) { while (1) { if (i) goto B; else { x ++; return x; x++; if (x) goto B; } } B : i --; } return 0; } int bts906c (void) { int x = 0; int i = 2; while (i >= 0) { while (1) { if (i) goto B; else { x ++; return x; W: x++; goto W; } } B : i --; } return 0; } int bts963 (void) { int x = 0; int i; L: i = 0; while (i < 10) { x++; if (x < 3) goto L; else return x; } return x; } int bts963b (void) { int x = 0; int i; L: i = 0; while (i < 10) { x++; if (x < 3) goto L; else return x; i++; } return x; } int main (int n) { int x = 0; f1 (n); x += G1; f1b (); x += G1b; f2 (); x += G2; x += bts181 (n); x += bts181b (n); x += bts807 (); x += bts809 (); x += bts879 (n); x += bts879b (n); x += bts899 (); x += bts906 (); x += bts906b (); // x += bts906c (); x += bts963 (); x += bts963b (); return x; } frama-c-20.0-Calcium/tests/slicing/ex_spec_interproc.i0000666000000000000000000000111313571573400017666 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -journal-disable */ int X, Y; int g (int u, int v, int w) { u++; v++; w++; X = u; Y = u+v; return w; } int Z; int f (int a, int b, int c, int d, int e) { int r; a++; b++; c++; d++; e++; r = g (a, b, c); Z = g (r, d, e); return X; } int I, J, K, L, M; int main (void) { int res; I = 0; J = 0; K = 0; L = 0; M = 0; res = f (I, J, K, L, M); return res; } frama-c-20.0-Calcium/tests/slicing/ex_spec_interproc.ml0000666000000000000000000000723313571573400020057 0ustar (* ledit bin/toplevel.top -deps tests/slicing/ex_spec_interproc.c #use "tests/slicing/select.ml";; ou #use "tests/slicing/ex_spec_interproc.ml";; *) include LibSelect;; let main _ = (*--------------------------*) (* find the kernel functions *) let _kf_g = Globals.Functions.find_def_by_name "g" in let kf_f = Globals.Functions.find_def_by_name "f" in let kf_main = Globals.Functions.find_def_by_name "main" in (* add a request to select f result (output 0) in the project *) let select_f_out0 () = let ff_f = Slicing.Api.Slice.create kf_f in let select = select_retres kf_f in Slicing.Api.Request.add_slice_selection_internal ff_f select; print_requests (); ff_f in (*=========================================================================*) (* DEBUT DU TEST *) (*=========================================================================*) (* mode DontSliceCalls *) Slicing.Api.set_modes ~calls:0 () ; Slicing.Api.Project.reset_slicing (); let _ff_f = select_f_out0 () in Slicing.Api.Request.apply_all_internal (); print_project (); extract_and_print (); (*=========================================================================*) (* mode PropagateMarksOnly *) Slicing.Api.set_modes ~calls:1 () ; Slicing.Api.Project.reset_slicing (); let _ff_f = select_f_out0 () in Slicing.Api.Request.apply_all_internal (); print_project (); extract_and_print (); (*=========================================================================*) (* mode MinimizeNbCalls *) Slicing.Api.set_modes ~calls:2 () ; Slicing.Api.Project.reset_slicing (); (* slice 'f' to compute its result (output 0) and propagate to 'g' *) let ff_f = select_f_out0 () in Slicing.Api.Request.apply_all_internal (); print_project (); (* call 'f' slice in 'main' *) let ff_main = Slicing.Api.Slice.create kf_main in Slicing.Api.Request.add_call_slice ~caller:ff_main ~to_call:ff_f; Slicing.Api.Request.apply_all_internal (); print_project (); extract_and_print (); (*---------------------------------------------- *) (* test remove_slice and select_stmt_computation *) (* we remove ff_main : ff_f should not be called anymore *) Slicing.Api.Slice.remove ff_main; print_project (); (* try to change ff_f to check that ff_main is not in its called_by anymore *) (* select "a" before inst 14 (d++) *) (* VP: initial value of 34 does not refer to d++ (was 30) 9 corresponds to d++. old ki 34 corresponds to return(X), new ki 13 *) print_stmt kf_f; let ki = get_stmt 10(*34*) in (* d++ *) let select = select_data_before_stmt "a" ki kf_f in Slicing.Api.Request.add_slice_selection_internal ff_f select; print_requests (); Slicing.Api.Request.apply_all_internal (); print_project (); (*=========================================================================*) (* Test 'extract' when there are 2 slices for the same function *) Slicing.Api.set_modes ~calls:2 () ; Slicing.Api.Project.reset_slicing (); let ff_f_1 = Slicing.Api.Slice.create kf_f in let select = select_retres kf_f in Slicing.Api.Request.add_slice_selection_internal ff_f_1 select; let ff_f_2 = Slicing.Api.Slice.create kf_f in let select = select_data "Z" kf_f in Slicing.Api.Request.add_slice_selection_internal ff_f_2 select; Slicing.Api.Request.apply_all_internal (); print_ff ff_f_2; extract_and_print (); (*=========================================================================*) (* mode PreciseSlices *) Slicing.Api.set_modes ~calls:3 () ; test_select_retres ~do_prop_to_callers:true "f"; print_project ();; (*=========================================================================*) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/filter.i0000666000000000000000000000155613571573400015453 0ustar /* run.config STDOPT: +"-slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " **/ /* TESTS: this is about [filter] optimisations since sometimes, * slicing results are ok, but the generated new project is not correct. */ int f(int); int T[10]; /* When removing branches, one should take care about local variables. */ int bts806 () { int c = 0; int x = 0; if (c) { int y; { y = x+1; x = y; } } else { int z; { z = x+1; x = z; } } return x; } int unspec () { int c = 0; if (c) T[1] += f (T[1]); else T[2] += f (T[2]); return T[1] + T[2]; } int main (int c) { int r = 0; r += bts806 (); r += unspec (); return r; } frama-c-20.0-Calcium/tests/slicing/forall_loop_invariant.i0000666000000000000000000000123113571573400020537 0ustar /* run.config STDOPT: +"-slice-assert main -then-on 'Slicing export' -print -then-on default -slice-value t -then-on 'Slicing export 2' -print -check -set-project-as-default -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps" **/ /* cf discussion on bts 690 */ int t[10], u[10]; int main(void) { /*@ loop invariant 0 <= i <= 10; @ loop invariant \forall int k; 0 <= k < i ==> t[k] == 1; @ loop invariant \forall int k; 0 <= k < i ==> u[k] == 2; @ */ for(int i = 0; i < 10; i++) { t[i] = 1; u[i] = 2; } /*@ assert t[2] == 1; */ } frama-c-20.0-Calcium/tests/slicing/horwitz.i0000666000000000000000000000127713571573400015674 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -slicing-level 0 -journal-disable */ /* bin/toplevel.opt -deps -eva @PTEST_DIR@/@PTEST_NAME@.c */ /* bin/toplevel.opt -deps -pdg-debug -pdg @PTEST_DIR@/@PTEST_NAME@.c */ /* cf aussi @PTEST_DIR@/@PTEST_NAME@.ml */ int add (int a, int b) { return a+b; } void incr (char * pi) { *pi = add (*pi, 1); } int A (int x, char * py) { x = add (x, *py); incr (py); /*@ slice pragma expr x;*/ return x; } int main (void) { int s = 0; char i = 1; while (i < 11) { s = A (s, &i); } return s; } frama-c-20.0-Calcium/tests/slicing/horwitz.ml0000666000000000000000000000044413571573400016047 0ustar (* ledit bin/toplevel.top -deps tests/slicing/horwitz.c #use "tests/slicing/select.ml";; tests/slicing/horwitz.byte -deps tests/slicing/horwitz.c * *) include LibSelect;; let () = Db.Main.extend (fun _ -> ignore (test_select_data ~do_prop_to_callers:true "incr" "*pi"));; frama-c-20.0-Calcium/tests/slicing/if_many_values.i0000666000000000000000000000064113571573400017161 0ustar /* run.config STDOPT: +"-slice-value r -journal-disable -slevel 101 -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps" **/ int r=1; int main() { for (int i = -100; i < 100; i++) { if (i != 0) if (i) r += 1; } return r; } frama-c-20.0-Calcium/tests/slicing/initialized.i0000666000000000000000000000060513571573400016465 0ustar /* run.config STDOPT: +"-slice-assert main -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " **/ void main() { int x = 1; int y; L: x = 3; y = 2; //@ assert \initialized(&x); // assert !\initialized{L}(&y); } frama-c-20.0-Calcium/tests/slicing/keep_annot.i0000666000000000000000000000453013571573400016304 0ustar /* run.config STDOPT: +"-context-valid-pointers -lib-entry -main f -slice-assert f -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-context-valid-pointers -lib-entry -main f -slice-assert f -slicing-keep-annotations -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-context-valid-pointers -lib-entry -main L -slice-pragma L -slicing-keep-annotations -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-context-valid-pointers -lib-entry -main L -slice-pragma L -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-slice-return bts1110 -main bts1110 -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" */ typedef struct { int a; double b; } las; void g (las * p) { int i=0; while (i<5) { p->b = (double)i / (double)(i+1); p->a = 1 + i; i++; } //@ assert 1<=p->a<=6; //@ assert 0.0<=p->b<=1.0; } //@assigns *p; void f (las * p, int n, int m) { g(p); //@ assert 0.0<=p->b<=1.0; //@ assert (\forall integer k; k < n ==> k < m); } /* from BTS#448 from Dillon : the loop invariant is not in the slice. * After bug fix, it is kept when using option -slicing-keep-annotations * TODO: maybe it should also be kept without the option. */ void L (float u,int nn, float dabs[], float *y) { int ii; /*@ loop invariant (\forall integer k; u<=dabs[k]); */ for (ii = nn-2; ii >= 0; ii--) { *y = u - dabs[ii+1] * 2.0; //@ assert (\forall integer k; u<=dabs[k]); } //@slice pragma expr *y; } int bts1110(int x) { int y = 3; int z; //@ assert y == 3; y = 2; //@ assert x == 5; z = 5; x = x+1; return x; } frama-c-20.0-Calcium/tests/slicing/libAnim.ml0000666000000000000000000000454513571573400015722 0ustar (* Some useful function to use the graphical representation of a slicing * project. (see tests/slicing/anim.ml for a test) *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let use_dot = Sys.os_type <> "Win32" && (Unix.WEXITED 0) = Unix.system ("which dot > /dev/null 2>&1") (* function to append [string_of_int n] on 3 char to basename. *) let nth_name basename n = assert (n < 1000); let str_n = string_of_int n in let str_n = if n < 100 then ("0"^str_n) else str_n in let str_n = if n < 10 then ("0"^str_n) else str_n in basename^"."^str_n ;; (* generate the nth .jpg file (generate to .dot file and then remove it) *) let print_proj basename title n = let name = nth_name basename n in let dot_name = (name^".dot") in let jpg_name = (name^".jpg") in Slicing.Api.Project.print_dot ~filename:dot_name ~title:title; if use_dot then ignore (Sys.command ("dot -Tjpg -o "^jpg_name^" "^dot_name^" 2>/dev/null")); Sys.remove dot_name; n+1 ;; (* apply all requests of the project and generate a .jpg file for each step. * (begin at number [n]) *) let build_all_graphs basename title first_n = Format.printf "Processing %s : " basename; let rec next n = Format.printf ".@?"; try Slicing.Api.Request.apply_next_internal (); let title = title^" ("^(string_of_int (n - first_n))^")" in let n = print_proj basename title n in next n with Not_found -> n in let next_num = next first_n in Format.printf "@."; next_num ;; let all_files basename = basename^".*.jpg ";; let display_cmd basename = "display -resize 1000x500 "^(all_files basename);; let clean_cmd basename = "rm -f "^(all_files basename);; let build_anim_cmd basename= "convert -delay 10 -loop 1 "^(all_files basename)^" "^basename^".gif";; let print_help basename = let display_cmd = display_cmd basename in let clean_cmd = clean_cmd basename in Format.printf "To display '%s' use :@\n\t%s@\n" basename display_cmd; Format.printf "\t- use : Space/Backspace to see next/previous step@\n"; Format.printf "\t- use : 'q' to quit@\n@@\n"; Format.printf "After that, you can clear the generated files with:@\n\t%s@." clean_cmd let remove_all_files basename = Format.printf "removing generated .jpg files@."; ignore (Sys.command (clean_cmd basename)) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) frama-c-20.0-Calcium/tests/slicing/libSelect.ml0000666000000000000000000001375413571573400016257 0ustar (* To use this in interactive mode : #use "tests/slicing/select.ml";; *) exception Break exception No_return exception Unknown_data of string exception Unknown_stmt of int (*--------------------------*) (* Useful functions to find and print thinks *) let find_kf fct_name = Globals.Functions.find_by_name fct_name (* let f kf res = match res with Some kf -> res | None -> if Db.get_name kf = fct_name then Some kf else None in match Db.fold_on_functions f None with | None -> raise Not_found | Some kf -> kf *) let fmt = Format.std_formatter;; (* print instruction number (used as input by other functions) *) let print_stmt kf = Slicing.PrintSlice.print_fct_stmts fmt kf (* print PDG (for debugging purposes) *) let print_pdg kf = !Db.Pdg.pretty fmt (!Db.Pdg.get kf) ;; let print_ff ff = Slicing.Api.Slice.pretty fmt ff (* print the project (functions with their marks + pending actions) *) let print_project () = Slicing.Api.Project.pretty fmt ;; (* print pending actions *) let print_requests () = Slicing.Api.Request.pretty fmt ;; (* build the application and print the result *) let extract_and_print () = let prj = Slicing.Api.Project.extract "Sliced code" in File.pretty_ast ~prj () (*--------------------------*) let apply () = Slicing.Api.Request.apply_next_internal (); print_project () (*--------------------------*) (** clear a previously computed project and load a new source file, * starting at [entry_point] to be specified iif it is different from [main]. * DOESN'T WORK at the moment because CIL datas are not cleared...*) (* [Julien 25/06/2007:] Should be possible to do now (?) *) (* let load_source_file ?entry_point filename = Db.Files.clear (); Db.Files.add [ Cil_types.NeedCPP (filename, Db.get_preprocessor_command()) ]; let entry_point, library = match entry_point with | None | Some "main" -> "main", false | Some f -> f, true in ignore (Db.get_cil_file ()); let kf = Db.find_function_def_by_name entry_point in ignore (!Db.Value.compute_entry_point kf ~library); Db.iter_on_functions (fun kf -> if Db.is_definition kf && Db.Value.is_called kf then !Db.From.compute kf) *) let get_stmt sid = fst (Kernel_function.find_from_sid sid) (** build the [zone] which represents [data] before [kinst] *) let get_zones str_data (kinst, kf) = let lval_term = !Db.Properties.Interp.term_lval kf str_data in let lval = !Db.Properties.Interp.term_lval_to_lval ~result:None lval_term in let loc = !Db.Value.lval_to_loc (Cil_types.Kstmt kinst) lval in Locations.(enumerate_valid_bits Read loc) ;; let select_data_before_stmt str_data kinst kf = let mark = Slicing.Api.Mark.make ~data:true ~addr:false ~ctrl:false in let zone = get_zones str_data (kinst, kf) in Slicing.Api.Select.select_stmt_zone_internal kf kinst true zone mark (** build the selection for returned value of the function *) let select_retres kf = let ki = Kernel_function.find_return kf in try let loc = Db.Value.find_return_loc kf in let zone = Locations.(enumerate_valid_bits Read loc) in let mark = Slicing.Api.Mark.make ~data:true ~addr:false ~ctrl:false in let before = false in Slicing.Api.Select.select_stmt_zone_internal kf ki before zone mark with Db.Value.Void_Function -> raise No_return ;; (** build the selection for the [data] at the end of the function *) let select_data data kf = try let ki = Kernel_function.find_return kf in let mark = Slicing.Api.Mark.make ~data:true ~addr:false ~ctrl:false in let zone = get_zones data (ki, kf) in Slicing.Api.Select.select_stmt_zone_internal kf ki true zone mark (* with Logic_interp.Error (_, str) -> raise (Unknown_data data) *) with _ -> raise (Unknown_data data) ;; (** build the selection ONLY for the control dependencies of the statement * [numstmt]*) let select_ctrl numstmt kf = try let s = get_stmt numstmt in (* let mark = Slicing.Api.Mark.make ~data:false ~addr:false ~ctrl:true in Slicing.Api.Select.select_stmt_internal kf ki mark *) Slicing.Api.Select.select_stmt_ctrl_internal kf s with _ -> raise (Unknown_stmt numstmt) ;; (** build recursively all the change_call for all the callers to kf in * order to call ff instead. *) let prop_to_callers (kf, ff) = let rec prop kf ff = let callers = !Db.Value.callers kf in let process_caller (kf_caller,_) = let ff_caller = Slicing.Api.Slice.create kf_caller in Slicing.Api.Request.add_call_slice ~caller:ff_caller ~to_call:ff; prop kf_caller ff_caller in List.iter process_caller callers in prop kf ff (** compute and print a slice of [fname] where the selection is given by * [select_fct] (which could be [select_retres] or [(select_data str_data)]. * If [do_prop_to_callers] if also recursively computes new functions for * [fname] callers in order to call the new slices. *) let test ?(keep_project=false) fname ?(do_prop_to_callers=false) select_fct = if not keep_project then Slicing.Api.Project.reset_slicing (); try let kf = Globals.Functions.find_def_by_name fname in let ff = Slicing.Api.Slice.create kf in let select = select_fct kf in Slicing.Api.Request.add_slice_selection_internal ff select; if do_prop_to_callers then begin Slicing.Api.Request.apply_all_internal (); prop_to_callers (kf, ff) end; let fmt = Format.std_formatter in Slicing.Api.Request.pretty fmt; (* Slicing.Api.Request.apply_next_internal *) (* Slicing.Api.Project.pretty fmt *) extract_and_print () with | No_return -> Format.printf "Impossible to select 'retres' for a void function (%s)\n" fname | Unknown_data str -> Format.printf "Impossible to select this data : %s in %s\n" str fname ;; let test_select_retres ?(do_prop_to_callers=false) fname = test fname ~do_prop_to_callers select_retres let test_select_data ?(do_prop_to_callers=false) fname data = test fname ~do_prop_to_callers (select_data data) frama-c-20.0-Calcium/tests/slicing/loop_infinite.i0000666000000000000000000000061113571573400017013 0ustar /* run.config STDOPT: +"-deps -slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps" */ int main() { volatile int a=0,b,c; if (a) {a = 1; while (1) { a++; }; return 0;} } frama-c-20.0-Calcium/tests/slicing/loop_simple.i0000666000000000000000000000110113571573400016472 0ustar /* run.config STDOPT: +"-deps -slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" */ int main() { int a,c; volatile int b = 0; a = 1; while (1) break ; for (c=0; c <= 5; c++) ; /*@ loop assigns c, a ; */ for (c=0; c <= 5; c++) { a = 2; } if (b) goto L; for (c=0; c <= 5; ) { a+=2 ; L: a+=3; goto H; c++; } a++; H: if (a) c++; return a; } frama-c-20.0-Calcium/tests/slicing/loops.i0000666000000000000000000002562613571573400015326 0ustar /* run.config STDOPT: +"-deps -lib-entry -main f1 -slice-pragma f1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -lib-entry -main f1 -slice-assert f1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -lib-entry -main f2 -slice-pragma f2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -lib-entry -main f2 -slice-assert f2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -main test_infinite_loop_3 -slice-value G -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -main test_infinite_loop_4 -slice-value G -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -main test_infinite_loop_5 -slice-value G -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -main loop -slice-value Z -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -slice-calls loop -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -slice-pragma loop -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -slice-assert loop -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -main loop -slice-rd Y -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -main loop -slice-rd Z -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -main loop -slice-wr Y -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -main loop -slice-wr Z -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -lib-entry -main stop_f1 -slice-pragma stop_f1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -lib-entry -main stop_f1 -slice-assert stop_f1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -lib-entry -main stop_f2 -slice-pragma stop_f2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -lib-entry -main stop_f2 -slice-assert stop_f2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -slice-value Z -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -slice-rd Y -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -slice-rd Z -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -slice-wr Y -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -slice-wr Z -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" STDOPT: +"-deps -lib-entry -main alarm -slice-threat alarm -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-deps" */ int f1 (int c) { int x = 0, s = 0; if (c) { while(1) { /* infinite loop */ s++; //@ assert s > 0 ; } //@ assert \false ; } else x = 1; //@ slice pragma stmt; x ++; return x; } void f2 (int c) { int x1 = 0, x2 = 0; while (1) { if (c) x1++; else x2++; //@slice pragma expr x1; //@ assert x2 > 0 ; } } /*-------------------------------------------*/ void stop(void) __attribute__ ((noreturn)) ; int stop_f1 (int c) { int x = 0, s = 0; if (c) { while(s < c) { s++; //@ assert s > 0 ; } stop () ; /* never returns */ } else x = 1; //@ slice pragma stmt; x ++; return x; } void stop_f2 (int c) { int x1 = 0, x2 = 0; while (x1+x2 < c + 10) { if (c) x1++; else x2++; //@slice pragma expr x1; //@ assert x2 > 0 ; stop () ; /* never loops nor returns */ x1++; /* dead code */ //@ assert \false ; } } /*-------------------------------------------*/ int G ; void test_infinite_loop_3 (int ctrl1, int ctrl2, int no_ctrl, int data1, int data2, int no_data) { G = 0 ; if (ctrl1) { G = data1 ; if (no_ctrl) { /* Don't control an assignment of G * which leads to the return */ G = no_data ; /* Don't affect the final value of G * because the assignment * does not lead to the return */ while (1) G = no_data ; /* Don't affect the final value of G * because the assignment * does not lead to the return */ G = no_data ; /* Don't affect the final value of G * because the assignment * is dead code */ } if (ctrl2) G = data2 ; } return; } void test_infinite_loop_4 (int ctrl1, int ctrl2, int no_ctrl, int data1, int data2, int no_data) { G = 0 ; while (ctrl1) { G += data1 ; if (no_ctrl) { /* Don't control an assignment of G * which leads to the return */ G += no_data ; /* Don't affect the final value of G * because the assignment * does not lead to the return */ while (1) G += no_data ; /* Don't affect the final value of G * because the assignment * does not lead to the return */ G += no_data ; /* Don't affect the final value of G * because the assignment * is dead code */ } if (ctrl2) G += data2 ; } return; } void test_infinite_loop_5 (int ctrl1, int ctrl2, int no_ctrl, int data1, int data2, int no_data) { G = 0 ; while (ctrl1) { G += data1 ; if (no_ctrl) { /* Don't control the final value of G. * It only controls the terminaison of the function. */ G += no_data ; /* Don't affect ... */ while (1) G += no_data ; /* Don't affect ... */ G += no_data ; /* Don't affect ... dead code */ } else /* <-- This is the difference with test_infinite_loop_4. * It is only a syntactical difference, * and not a semantical difference * since the previous statement "G += no_data" is dead. */ if (ctrl2) G += data2 ; } return; } /*-------------------------------------------*/ int C1 = 1, C2 = 1 ; int X, Y, Z ; void loop (int cond) { if (cond) { int c = 0 ; /*@ loop pragma WIDEN_HINTS X, 10, 100 ; */ while (1) { //@ slice pragma ctrl ; if (c) { X++; Y = Z ; } c=1; //@ assert c==1 ; } } Z = Y ; // dead code with -main main } /*---------------------*/ /*@ assigns *p \from p, y, Z ; */ void may_write_Y_from_Z (int * p, int y) ; void test_assigns (int * p, int y) { if (y < Z) *p = y + Z; } /*---------------------*/ void main (int y) { int no_ctrl = 1 ; Z = 0; if (no_ctrl) Z = X ; may_write_Y_from_Z (&Y, y) ; if (C1) { int cond = C2 ; loop (cond) ; } } /*-------------------------------------------*/ void alarm() { int i = 1; volatile int j = 3; //@ assert i == 1; j++; } frama-c-20.0-Calcium/tests/slicing/mark_all_slices.i0000666000000000000000000000112513571573400017302 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -slicing-level 3 -no-slice-callers -journal-disable */ int A, B, C, D; int A2, B2, C2, D2; int all (int x) { A = x; B = x; C = x; D = x; return x+1; } int fA (void) { all (1); return A; } int fB (void) { all (1); return B; } int fC (void) { all (1); return C; } int fD (void) { all (1); return D; } int main (void) { A2 = fA(); B2 = fB(); C2 = fC(); D2 = fD(); return all (0); } frama-c-20.0-Calcium/tests/slicing/mark_all_slices.ml0000666000000000000000000000470213571573400017466 0ustar (* ledit bin/toplevel.top -deps tests/slicing/mark_all_slices.c #use "tests/slicing/select.ml";; ou #use "tests/slicing/mark_all_slices.ml";; *) include LibSelect;; let main _ = (* we are interesting in having several slices, * so use mode PreciseSlices *) (* SlicingKernel.Mode.Calls.set 3; *) (*~~~~~~~~~~~~ Project 1 : *) Slicing.Api.Project.reset_slicing (); let kf_main = Globals.Functions.find_def_by_name "main" in let kf_all = Globals.Functions.find_def_by_name "all" in (* create main_1 and select A2 in it *) let ff_main = Slicing.Api.Slice.create kf_main in let select = select_data "A2" kf_main in Slicing.Api.Request.add_slice_selection_internal ff_main select; Slicing.Api.Request.apply_all_internal (); extract_and_print (); (* add a global selection in 'all' to always compute its result. * This should modify the existing slice (all_1) * *) let select = select_retres kf_all in Slicing.Api.Request.add_selection_internal select; Slicing.Api.Request.apply_next_internal (); print_requests (); Slicing.Api.Request.apply_all_internal (); extract_and_print (); (* select B2 in main_1 : this should create a second slice all_2 * and its result should be computed even if it is not needed by this request *) let select = select_data "B2" kf_main in Slicing.Api.Request.add_slice_selection_internal ff_main select; Slicing.Api.Request.apply_next_internal (); print_requests (); Slicing.Api.Request.apply_all_internal (); extract_and_print (); (*~~~~~~~~~~~~ Project 2 : *) Slicing.Api.Project.reset_slicing (); let kf_main = Globals.Functions.find_def_by_name "main" in let kf_all = Globals.Functions.find_def_by_name "all" in (* first all the global selection in 'all' to always compute its result. * This creates a first all_1 slice : I am not sure that this should be done. * *) let select = select_retres kf_all in Slicing.Api.Request.add_selection_internal select; Slicing.Api.Request.apply_next_internal (); print_requests (); Slicing.Api.Request.apply_all_internal (); extract_and_print (); (* create main_1 and select A2 in it : this will create a new slice for all * that computes A and the result. *) let ff_main = Slicing.Api.Slice.create kf_main in let select = select_data "A2" kf_main in Slicing.Api.Request.add_slice_selection_internal ff_main select; Slicing.Api.Request.apply_all_internal (); extract_and_print () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/merge.i0000666000000000000000000000122713571573400015260 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module tests/slicing/libAnim.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -slicing-level 3 -journal-disable */ int G1, G2, G3; void init (int a1, int a2, int a3); void add (int a1, int a2, int a3); void g (int a1, int a2, int a3); void init (int a1, int a2, int a3) { G1 = a1; G2 = a2; G3 = a3; } void add (int a1, int a2, int a3) { G1 += a1; G2 += a2; G3 += a3; } void g (int a1, int a2, int a3) { init (a1, a2, a3); add (a1, a2, a3); } void main (int x, int y, int z) { g (x, y, z); } frama-c-20.0-Calcium/tests/slicing/merge.ml0000666000000000000000000000611513571573400015441 0ustar (* * Small example to test function merge_slices. * To try it, use the following commands : make tests/slicing/merge.byte; \ tests/slicing/merge.byte -deps -lib-entry g -slicing-level 3 \ tests/slicing/merge.c *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) include LibSelect;; let main _ = let proj_name = "slicing_merge" in Slicing.Api.Project.reset_slicing (); let kf_init = Globals.Functions.find_def_by_name "init" in let _kf_add = Globals.Functions.find_def_by_name "add" in let kf_g = Globals.Functions.find_def_by_name "g" in let n = 0 in (* build graphs representation if there is something in [anim_title] *) let build_slice kf data n anim_title apply = let ff = Slicing.Api.Slice.create kf in let select = select_data data kf in Slicing.Api.Request.add_slice_selection_internal ff select; let n = if anim_title = "" then (if apply then Slicing.Api.Request.apply_all_internal (); n) else LibAnim.build_all_graphs proj_name anim_title n in n, ff in ignore (LibAnim.print_proj proj_name "Beginning" n); let n = n+1 in let title = "Select G1 in init" in let n, ff_init1 = build_slice kf_init "G1" n title true in let title = "Select G1 in g" in let n, _ff_g1 = build_slice kf_g "G1" n title true in (* Format.printf "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";; Format.printf "=== Function g_1 computes G1 and should call init_1 :\n"; Slicing.Api.Project.extract "merge_1";; Format.printf "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";; *) let n, ff_init2 = build_slice kf_init "G2" n "" true in let n, _ff_init3 = build_slice kf_init "G3" n "" true in let n, _ff_g2 = build_slice kf_g "G2" n "" false in let n, ff_g3 = build_slice kf_g "G3" n "" true in (* Format.printf "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";; Format.printf "=== g_2 should call init_2 and g_3, init_3 :\n"; Slicing.Api.Project.extract "merge_2";; Format.printf "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";; *) ignore (LibAnim.print_proj proj_name "After selections" n); let n = n+1 in ignore (Slicing.Api.Request.merge_slices ff_init1 ff_init2 ~replace:true); let title = "merging init_1 and init_2" in ignore (LibAnim.print_proj proj_name title n); let n = n+1 in let title = "merging init_1 and init_2" in let n = LibAnim.build_all_graphs proj_name title n in Slicing.Api.Slice.remove ff_init1; Slicing.Api.Slice.remove ff_init2; let title = "After removing init_1 and init_2" in ignore (LibAnim.print_proj proj_name title n); let _n = n+1 in let _ = Slicing.Api.Request.copy_slice ff_g3 in extract_and_print (); (* in automatic tests, we remove the generated files. * Change [view_graphs] below to be able to display the graphs *) let view_graphs = false in if view_graphs then LibAnim.print_help proj_name else LibAnim.remove_all_files proj_name ;; (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/min_call.i0000666000000000000000000000057413571573400015743 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -lib-entry -main g -journal-disable -slicing-level 3 */ /* dummy source file in order to test minimal calls feature * on select_return.c */ #include "tests/slicing/select_return.c" frama-c-20.0-Calcium/tests/slicing/min_call.ml0000666000000000000000000001120313571573400016112 0ustar (* ledit -h jnl bin/toplevel.top -deps -lib-entry g -slice-callers \ tests/slicing/min_call.c *) include LibSelect;; let main _ = (* SlicingKernel.Mode.Calls.set 3; *) let _kf_get = Globals.Functions.find_by_name "get" in let _kf_send = Globals.Functions.find_by_name "send" in let kf_send_bis = Globals.Functions.find_by_name "send_bis" in let kf_k = Globals.Functions.find_def_by_name "k" in let _kf_f = Globals.Functions.find_def_by_name "f" in let _kf_g = Globals.Functions.find_def_by_name "g" in let _top_mark = Slicing.Api.Mark.make ~addr:true ~ctrl:true ~data:true in let add_select_fun_calls to_call = let selections = Slicing.Api.Select.empty_selects in let selections = Slicing.Api.Select.select_func_calls_into selections ~spare:false to_call in Slicing.Api.Request.add_persistent_selection selections in (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (* Project1 : * Select the call to [send_bis] in [k] as a persistent selection : * this will create a fist slice for [k]. * Then create manually a second slice for [k] : * the call to [send_bis] is visible as wished. *) Slicing.Api.Project.reset_slicing (); (*let pdg_k = !Db.Pdg.get kf_k;;*) let calls = !Db.Pdg.find_call_stmts ~caller:kf_k(*pdg_k*) kf_send_bis in let sb_call = match calls with c::[] -> c | _ -> assert false in let mark = Slicing.Api.Mark.make ~data:true ~addr:false ~ctrl:false in let select = Slicing.Api.Select.select_stmt_internal kf_k sb_call mark in Slicing.Api.Request.add_selection_internal select ; Slicing.Api.Request.apply_all_internal (); Log.print_on_output (fun fmt -> Format.fprintf fmt "@[Project1 - result1 :@\n@]") ; extract_and_print (); let _ff2_k = Slicing.Api.Slice.create kf_k in Log.print_on_output (fun fmt -> Format.fprintf fmt "@[Project1 - result2 :@\n@]") ; Slicing.Api.Project.pretty fmt; extract_and_print (); (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (* Project2 : * same than project1, except that we use [select_min_call_internal]. * But as [send_bis] is an undefined function, this makes no difference. *) Slicing.Api.Project.reset_slicing (); (*let pdg_k = !Db.Pdg.get kf_k;;*) let calls = !Db.Pdg.find_call_stmts (*pdg_k*)~caller:kf_k kf_send_bis in let sb_call = match calls with c::[] -> c | _ -> assert false in let mark = Slicing.Api.Mark.make ~data:true ~addr:false ~ctrl:false in let select = Slicing.Api.Select.select_min_call_internal kf_k sb_call mark in Slicing.Api.Request.add_selection_internal select ; print_requests (); Slicing.Api.Request.apply_all_internal (); Log.print_on_output (fun fmt -> Format.fprintf fmt "@[Project3 - result :@\n@]") ; Slicing.Api.Project.pretty fmt; extract_and_print (); (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (* Project3 : * Select the calls to [k] to be visible in a minimal version. * This builds an empty slice [k_1] for [k] and call it in [f] and [g]. * [f_1] is also called in [g_1] because it calls [k_1]. *) Slicing.Api.Project.reset_slicing (); add_select_fun_calls kf_k; print_requests (); Slicing.Api.Request.apply_next_internal (); print_requests (); Slicing.Api.Request.apply_all_internal (); Log.print_on_output (fun fmt -> Format.fprintf fmt "@[Project3 - result :@\n@]") ; Slicing.Api.Project.pretty fmt; extract_and_print () (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (* Project4 is CAS_1 from Patrick's 19th April 2007 mail. * step 1 - select calls to send and apply : OK * step 2 - (automatically done in step1) * step 3 - select calls to send_bis and apply : TODO * step 4 - (automatically done in step3) *) (* let project = mk_project();; add_select_fun_calls project kf_send;; print_requests project;; Slicing.Api.Request.apply_next_internal project;; print_requests project;; Slicing.Api.Request.apply_all_internal project;; Format.printf "@[CAS 1 - step 1+2 - result :@\n@]";; extract_and_print project;; add_select_fun_calls project kf_send_bis;; print_requests project;; Slicing.Api.Request.apply_all_internal project;; Format.printf "@[CAS 1 - step 3+4 - result :@\n@]";; Slicing.Api.Project.pretty fmt project;; extract_and_print project;; *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) (* Project5 : same than the previous one, * except that we create the two requests before applying. * *) (* let project = mk_project();; add_select_fun_calls project kf_send;; add_select_fun_calls project kf_send_bis;; print_requests project;; Format.printf "@[Project 5 - result :@\n@]";; Slicing.Api.Project.pretty fmt project;; extract_and_print project;; *) (*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/oracle/0000777000000000000000000000000013571573400015252 5ustar frama-c-20.0-Calcium/tests/slicing/oracle/adpcm.res.oracle0000666000000000000000000022772313571573400020332 0ustar [kernel] Parsing tests/slicing/adpcm.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization tqmf[0..23] ∈ {0} h[0] ∈ {12} [1..2] ∈ {-44} [3] ∈ {212} [4] ∈ {48} [5] ∈ {-624} [6] ∈ {128} [7] ∈ {1448} [8] ∈ {-840} [9] ∈ {-3220} [10] ∈ {3804} [11..12] ∈ {15504} [13] ∈ {3804} [14] ∈ {-3220} [15] ∈ {-840} [16] ∈ {1448} [17] ∈ {128} [18] ∈ {-624} [19] ∈ {48} [20] ∈ {212} [21..22] ∈ {-44} [23] ∈ {12} xl ∈ {0} xh ∈ {0} accumc[0..10] ∈ {0} accumd[0..10] ∈ {0} xout1 ∈ {0} xout2 ∈ {0} xs ∈ {0} xd ∈ {0} il ∈ {0} szl ∈ {0} spl ∈ {0} sl ∈ {0} el ∈ {0} qq4_code4_table[0] ∈ {0} [1] ∈ {-20456} [2] ∈ {-12896} [3] ∈ {-8968} [4] ∈ {-6288} [5] ∈ {-4240} [6] ∈ {-2584} [7] ∈ {-1200} [8] ∈ {20456} [9] ∈ {12896} [10] ∈ {8968} [11] ∈ {6288} [12] ∈ {4240} [13] ∈ {2584} [14] ∈ {1200} [15] ∈ {0} qq5_code5_table[0..1] ∈ {-280} [2] ∈ {-23352} [3] ∈ {-17560} [4] ∈ {-14120} [5] ∈ {-11664} [6] ∈ {-9752} [7] ∈ {-8184} [8] ∈ {-6864} [9] ∈ {-5712} [10] ∈ {-4696} [11] ∈ {-3784} [12] ∈ {-2960} [13] ∈ {-2208} [14] ∈ {-1520} [15] ∈ {-880} [16] ∈ {23352} [17] ∈ {17560} [18] ∈ {14120} [19] ∈ {11664} [20] ∈ {9752} [21] ∈ {8184} [22] ∈ {6864} [23] ∈ {5712} [24] ∈ {4696} [25] ∈ {3784} [26] ∈ {2960} [27] ∈ {2208} [28] ∈ {1520} [29] ∈ {880} [30] ∈ {280} [31] ∈ {-280} qq6_code6_table[0..3] ∈ {-136} [4] ∈ {-24808} [5] ∈ {-21904} [6] ∈ {-19008} [7] ∈ {-16704} [8] ∈ {-14984} [9] ∈ {-13512} [10] ∈ {-12280} [11] ∈ {-11192} [12] ∈ {-10232} [13] ∈ {-9360} [14] ∈ {-8576} [15] ∈ {-7856} [16] ∈ {-7192} [17] ∈ {-6576} [18] ∈ {-6000} [19] ∈ {-5456} [20] ∈ {-4944} [21] ∈ {-4464} [22] ∈ {-4008} [23] ∈ {-3576} [24] ∈ {-3168} [25] ∈ {-2776} [26] ∈ {-2400} [27] ∈ {-2032} [28] ∈ {-1688} [29] ∈ {-1360} [30] ∈ {-1040} [31] ∈ {-728} [32] ∈ {24808} [33] ∈ {21904} [34] ∈ {19008} [35] ∈ {16704} [36] ∈ {14984} [37] ∈ {13512} [38] ∈ {12280} [39] ∈ {11192} [40] ∈ {10232} [41] ∈ {9360} [42] ∈ {8576} [43] ∈ {7856} [44] ∈ {7192} [45] ∈ {6576} [46] ∈ {6000} [47] ∈ {5456} [48] ∈ {4944} [49] ∈ {4464} [50] ∈ {4008} [51] ∈ {3576} [52] ∈ {3168} [53] ∈ {2776} [54] ∈ {2400} [55] ∈ {2032} [56] ∈ {1688} [57] ∈ {1360} [58] ∈ {1040} [59] ∈ {728} [60] ∈ {432} [61] ∈ {136} [62] ∈ {-432} [63] ∈ {-136} delay_bpl[0..5] ∈ {0} delay_dltx[0..5] ∈ {0} wl_code_table[0] ∈ {-60} [1] ∈ {3042} [2] ∈ {1198} [3] ∈ {538} [4] ∈ {334} [5] ∈ {172} [6] ∈ {58} [7] ∈ {-30} [8] ∈ {3042} [9] ∈ {1198} [10] ∈ {538} [11] ∈ {334} [12] ∈ {172} [13] ∈ {58} [14] ∈ {-30} [15] ∈ {-60} wl_table[0] ∈ {-60} [1] ∈ {-30} [2] ∈ {58} [3] ∈ {172} [4] ∈ {334} [5] ∈ {538} [6] ∈ {1198} [7] ∈ {3042} ilb_table[0] ∈ {2048} [1] ∈ {2093} [2] ∈ {2139} [3] ∈ {2186} [4] ∈ {2233} [5] ∈ {2282} [6] ∈ {2332} [7] ∈ {2383} [8] ∈ {2435} [9] ∈ {2489} [10] ∈ {2543} [11] ∈ {2599} [12] ∈ {2656} [13] ∈ {2714} [14] ∈ {2774} [15] ∈ {2834} [16] ∈ {2896} [17] ∈ {2960} [18] ∈ {3025} [19] ∈ {3091} [20] ∈ {3158} [21] ∈ {3228} [22] ∈ {3298} [23] ∈ {3371} [24] ∈ {3444} [25] ∈ {3520} [26] ∈ {3597} [27] ∈ {3676} [28] ∈ {3756} [29] ∈ {3838} [30] ∈ {3922} [31] ∈ {4008} nbl ∈ {0} al1 ∈ {0} al2 ∈ {0} plt ∈ {0} plt1 ∈ {0} plt2 ∈ {0} rs ∈ {0} dlt ∈ {0} rlt ∈ {0} rlt1 ∈ {0} rlt2 ∈ {0} decis_levl[0] ∈ {280} [1] ∈ {576} [2] ∈ {880} [3] ∈ {1200} [4] ∈ {1520} [5] ∈ {1864} [6] ∈ {2208} [7] ∈ {2584} [8] ∈ {2960} [9] ∈ {3376} [10] ∈ {3784} [11] ∈ {4240} [12] ∈ {4696} [13] ∈ {5200} [14] ∈ {5712} [15] ∈ {6288} [16] ∈ {6864} [17] ∈ {7520} [18] ∈ {8184} [19] ∈ {8968} [20] ∈ {9752} [21] ∈ {10712} [22] ∈ {11664} [23] ∈ {12896} [24] ∈ {14120} [25] ∈ {15840} [26] ∈ {17560} [27] ∈ {20456} [28] ∈ {23352} [29] ∈ {32767} detl ∈ {0} quant26bt_pos[0] ∈ {61} [1] ∈ {60} [2] ∈ {59} [3] ∈ {58} [4] ∈ {57} [5] ∈ {56} [6] ∈ {55} [7] ∈ {54} [8] ∈ {53} [9] ∈ {52} [10] ∈ {51} [11] ∈ {50} [12] ∈ {49} [13] ∈ {48} [14] ∈ {47} [15] ∈ {46} [16] ∈ {45} [17] ∈ {44} [18] ∈ {43} [19] ∈ {42} [20] ∈ {41} [21] ∈ {40} [22] ∈ {39} [23] ∈ {38} [24] ∈ {37} [25] ∈ {36} [26] ∈ {35} [27] ∈ {34} [28] ∈ {33} [29..30] ∈ {32} quant26bt_neg[0] ∈ {63} [1] ∈ {62} [2] ∈ {31} [3] ∈ {30} [4] ∈ {29} [5] ∈ {28} [6] ∈ {27} [7] ∈ {26} [8] ∈ {25} [9] ∈ {24} [10] ∈ {23} [11] ∈ {22} [12] ∈ {21} [13] ∈ {20} [14] ∈ {19} [15] ∈ {18} [16] ∈ {17} [17] ∈ {16} [18] ∈ {15} [19] ∈ {14} [20] ∈ {13} [21] ∈ {12} [22] ∈ {11} [23] ∈ {10} [24] ∈ {9} [25] ∈ {8} [26] ∈ {7} [27] ∈ {6} [28] ∈ {5} [29..30] ∈ {4} deth ∈ {0} sh ∈ {0} eh ∈ {0} qq2_code2_table[0] ∈ {-7408} [1] ∈ {-1616} [2] ∈ {7408} [3] ∈ {1616} wh_code_table[0] ∈ {798} [1] ∈ {-214} [2] ∈ {798} [3] ∈ {-214} dh ∈ {0} ih ∈ {0} nbh ∈ {0} szh ∈ {0} sph ∈ {0} ph ∈ {0} yh ∈ {0} rh ∈ {0} delay_dhx[0..5] ∈ {0} delay_bph[0..5] ∈ {0} ah1 ∈ {0} ah2 ∈ {0} ph1 ∈ {0} ph2 ∈ {0} rh1 ∈ {0} rh2 ∈ {0} ilr ∈ {0} yl ∈ {0} rl ∈ {0} dec_deth ∈ {0} dec_detl ∈ {0} dec_dlt ∈ {0} dec_del_bpl[0..5] ∈ {0} dec_del_dltx[0..5] ∈ {0} dec_plt ∈ {0} dec_plt1 ∈ {0} dec_plt2 ∈ {0} dec_szl ∈ {0} dec_spl ∈ {0} dec_sl ∈ {0} dec_rlt1 ∈ {0} dec_rlt2 ∈ {0} dec_rlt ∈ {0} dec_al1 ∈ {0} dec_al2 ∈ {0} dl ∈ {0} dec_nbl ∈ {0} dec_yh ∈ {0} dec_dh ∈ {0} dec_nbh ∈ {0} dec_del_bph[0..5] ∈ {0} dec_del_dhx[0..5] ∈ {0} dec_szh ∈ {0} dec_rh1 ∈ {0} dec_rh2 ∈ {0} dec_ah1 ∈ {0} dec_ah2 ∈ {0} dec_ph ∈ {0} dec_sph ∈ {0} dec_sh ∈ {0} dec_rh ∈ {0} dec_ph1 ∈ {0} dec_ph2 ∈ {0} test_data[0] ∈ {1} [1] ∈ {0} [2] ∈ {1} [3] ∈ {0} [4..9] ∈ {1} compressed[0..9] ∈ {0} [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] tests/test/adpcm.c:277: starting to merge loop iterations [eva:alarm] tests/test/adpcm.c:278: Warning: out of bounds read. assert \valid_read(tmp_3); (tmp_3 from tqmf_ptr++) [eva:alarm] tests/test/adpcm.c:278: Warning: out of bounds read. assert \valid_read(tmp_4); (tmp_4 from h_ptr++) [eva:alarm] tests/test/adpcm.c:279: Warning: out of bounds read. assert \valid_read(tmp_5); (tmp_5 from tqmf_ptr++) [eva:alarm] tests/test/adpcm.c:279: Warning: out of bounds read. assert \valid_read(tmp_6); (tmp_6 from h_ptr++) [eva:alarm] tests/test/adpcm.c:282: Warning: out of bounds read. assert \valid_read(tmp_7); (tmp_7 from tqmf_ptr++) [eva:alarm] tests/test/adpcm.c:282: Warning: out of bounds read. assert \valid_read(tmp_8); (tmp_8 from h_ptr++) [eva:alarm] tests/test/adpcm.c:283: Warning: out of bounds read. assert \valid_read(tqmf_ptr); [eva:alarm] tests/test/adpcm.c:283: Warning: out of bounds read. assert \valid_read(tmp_9); (tmp_9 from h_ptr++) [eva] tests/test/adpcm.c:288: starting to merge loop iterations [eva:alarm] tests/test/adpcm.c:288: Warning: out of bounds read. assert \valid_read(tmp_11); (tmp_11 from tqmf_ptr1--) [eva:alarm] tests/test/adpcm.c:288: Warning: out of bounds write. assert \valid(tmp_10); (tmp_10 from tqmf_ptr--) [eva:alarm] tests/test/adpcm.c:289: Warning: out of bounds write. assert \valid(tmp_12); (tmp_12 from tqmf_ptr--) [eva:alarm] tests/test/adpcm.c:290: Warning: out of bounds write. assert \valid(tqmf_ptr); [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:301. [eva] tests/test/adpcm.c:418: starting to merge loop iterations [eva:alarm] tests/test/adpcm.c:419: Warning: out of bounds read. assert \valid_read(tmp_1); (tmp_1 from bpl++) [eva:alarm] tests/test/adpcm.c:419: Warning: out of bounds read. assert \valid_read(tmp_2); (tmp_2 from dlt_0++) [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] computing for function abs <- quantl <- encode <- main. Called from tests/test/adpcm.c:444. [eva] Recording results for abs [eva] Done for function abs [eva] tests/test/adpcm.c:453: starting to merge loop iterations [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva] tests/test/adpcm.c:506: starting to merge loop iterations [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:352. [eva] Recording results for filtez [eva] Done for function filtez [eva] tests/test/adpcm.c:354: Reusing old results for call to filtep [eva] tests/test/adpcm.c:370: Reusing old results for call to abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:379. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] tests/test/adpcm.c:391: Reusing old results for call to uppol2 [eva] tests/test/adpcm.c:394: Reusing old results for call to uppol1 [eva] tests/test/adpcm.c:262: function encode: postcondition got status valid. [eva] Recording results for encode [eva] Done for function encode [eva] tests/test/adpcm.c:607: starting to merge loop iterations [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva:alarm] tests/test/adpcm.c:278: Warning: signed overflow. assert -2147483648 ≤ xa + (long)((long)*tmp_3 * (long)*tmp_4); (tmp_3 from tqmf_ptr++, tmp_4 from h_ptr++) [eva:alarm] tests/test/adpcm.c:278: Warning: signed overflow. assert xa + (long)((long)*tmp_3 * (long)*tmp_4) ≤ 2147483647; (tmp_3 from tqmf_ptr++, tmp_4 from h_ptr++) [eva:alarm] tests/test/adpcm.c:279: Warning: signed overflow. assert -2147483648 ≤ xb + (long)((long)*tmp_5 * (long)*tmp_6); (tmp_5 from tqmf_ptr++, tmp_6 from h_ptr++) [eva:alarm] tests/test/adpcm.c:279: Warning: signed overflow. assert xb + (long)((long)*tmp_5 * (long)*tmp_6) ≤ 2147483647; (tmp_5 from tqmf_ptr++, tmp_6 from h_ptr++) [eva:alarm] tests/test/adpcm.c:282: Warning: signed overflow. assert -2147483648 ≤ xa + (long)((long)*tmp_7 * (long)*tmp_8); (tmp_7 from tqmf_ptr++, tmp_8 from h_ptr++) [eva:alarm] tests/test/adpcm.c:282: Warning: signed overflow. assert xa + (long)((long)*tmp_7 * (long)*tmp_8) ≤ 2147483647; (tmp_7 from tqmf_ptr++, tmp_8 from h_ptr++) [eva:alarm] tests/test/adpcm.c:283: Warning: signed overflow. assert -2147483648 ≤ xb + (long)((long)*tqmf_ptr * (long)*tmp_9); (tmp_9 from h_ptr++) [eva:alarm] tests/test/adpcm.c:283: Warning: signed overflow. assert xb + (long)((long)*tqmf_ptr * (long)*tmp_9) ≤ 2147483647; (tmp_9 from h_ptr++) [eva:alarm] tests/test/adpcm.c:293: Warning: signed overflow. assert -2147483648 ≤ xa + xb; [eva:alarm] tests/test/adpcm.c:293: Warning: signed overflow. assert xa + xb ≤ 2147483647; [eva:alarm] tests/test/adpcm.c:294: Warning: signed overflow. assert -2147483648 ≤ xa - xb; [eva:alarm] tests/test/adpcm.c:294: Warning: signed overflow. assert xa - xb ≤ 2147483647; [eva] tests/test/adpcm.c:301: Reusing old results for call to filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] computing for function abs <- quantl <- encode <- main. Called from tests/test/adpcm.c:444. [eva] Recording results for abs [eva] Done for function abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva] tests/test/adpcm.c:512: starting to merge loop iterations [eva:alarm] tests/test/adpcm.c:514: Warning: signed overflow. assert 255L * (long)*(bli + i) ≤ 2147483647; [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] tests/test/adpcm.c:352: Reusing old results for call to filtez [eva] tests/test/adpcm.c:354: Reusing old results for call to filtep [eva] tests/test/adpcm.c:370: Reusing old results for call to abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:379. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:391. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:394. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] Recording results for encode [eva] Done for function encode [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:301. [eva:alarm] tests/test/adpcm.c:416: Warning: signed overflow. assert -2147483648 ≤ (long)*tmp * (long)*tmp_0; (tmp from bpl++, tmp_0 from dlt_0++) [eva:alarm] tests/test/adpcm.c:416: Warning: signed overflow. assert (long)*tmp * (long)*tmp_0 ≤ 2147483647; (tmp from bpl++, tmp_0 from dlt_0++) [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] computing for function abs <- quantl <- encode <- main. Called from tests/test/adpcm.c:444. [eva] Recording results for abs [eva] Done for function abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva:alarm] tests/test/adpcm.c:507: Warning: signed overflow. assert 255L * (long)*(bli + i) ≤ 2147483647; [eva:alarm] tests/test/adpcm.c:514: Warning: signed overflow. assert -2147483648 ≤ 255L * (long)*(bli + i); [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:352. [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:354. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function abs <- encode <- main. Called from tests/test/adpcm.c:370. [eva] Recording results for abs [eva] Done for function abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:379. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:391. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:394. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva:alarm] tests/test/adpcm.c:262: Warning: function encode: postcondition got status unknown. [eva] Recording results for encode [eva] Done for function encode [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:301. [eva:alarm] tests/test/adpcm.c:419: Warning: signed overflow. assert -2147483648 ≤ (long)*tmp_1 * (long)*tmp_2; (tmp_1 from bpl++, tmp_2 from dlt_0++) [eva:alarm] tests/test/adpcm.c:419: Warning: signed overflow. assert (long)*tmp_1 * (long)*tmp_2 ≤ 2147483647; (tmp_1 from bpl++, tmp_2 from dlt_0++) [eva:alarm] tests/test/adpcm.c:419: Warning: signed overflow. assert -2147483648 ≤ zl + (long)((long)*tmp_1 * (long)*tmp_2); (tmp_1 from bpl++, tmp_2 from dlt_0++) [eva:alarm] tests/test/adpcm.c:419: Warning: signed overflow. assert zl + (long)((long)*tmp_1 * (long)*tmp_2) ≤ 2147483647; (tmp_1 from bpl++, tmp_2 from dlt_0++) [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] computing for function abs <- quantl <- encode <- main. Called from tests/test/adpcm.c:444. [eva] Recording results for abs [eva] Done for function abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva:alarm] tests/test/adpcm.c:507: Warning: signed overflow. assert -2147483648 ≤ 255L * (long)*(bli + i); [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva:alarm] tests/test/adpcm.c:534: Warning: signed overflow. assert -2147483648 ≤ (long)plt_0 * (long)plt1_0; [eva:alarm] tests/test/adpcm.c:534: Warning: signed overflow. assert (long)plt_0 * (long)plt1_0 ≤ 2147483647; [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva:alarm] tests/test/adpcm.c:558: Warning: signed overflow. assert -2147483648 ≤ (long)plt_0 * (long)plt1_0; [eva:alarm] tests/test/adpcm.c:558: Warning: signed overflow. assert (long)plt_0 * (long)plt1_0 ≤ 2147483647; [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:352. [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:354. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function abs <- encode <- main. Called from tests/test/adpcm.c:370. [eva] Recording results for abs [eva] Done for function abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:379. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:391. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:394. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] Recording results for encode [eva] Done for function encode [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:301. [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] computing for function abs <- quantl <- encode <- main. Called from tests/test/adpcm.c:444. [eva] Recording results for abs [eva] Done for function abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva:alarm] tests/test/adpcm.c:536: Warning: signed overflow. assert -2147483648 ≤ (long)plt_0 * (long)plt2_0; [eva:alarm] tests/test/adpcm.c:536: Warning: signed overflow. assert (long)plt_0 * (long)plt2_0 ≤ 2147483647; [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] tests/test/adpcm.c:352: Reusing old results for call to filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:354. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function abs <- encode <- main. Called from tests/test/adpcm.c:370. [eva] Recording results for abs [eva] Done for function abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:379. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:391. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:394. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] Recording results for encode [eva] Done for function encode [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:301. [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva:alarm] tests/test/adpcm.c:430: Warning: signed overflow. assert -2147483648 ≤ 2 * rlt1_0; [eva:alarm] tests/test/adpcm.c:430: Warning: signed overflow. assert 2 * rlt1_0 ≤ 2147483647; [eva:alarm] tests/test/adpcm.c:431: Warning: signed overflow. assert -2147483648 ≤ (long)al1_0 * pl; [eva:alarm] tests/test/adpcm.c:431: Warning: signed overflow. assert (long)al1_0 * pl ≤ 2147483647; [eva:alarm] tests/test/adpcm.c:432: Warning: signed overflow. assert -2147483648 ≤ 2 * rlt2_0; [eva:alarm] tests/test/adpcm.c:432: Warning: signed overflow. assert 2 * rlt2_0 ≤ 2147483647; [eva:alarm] tests/test/adpcm.c:433: Warning: signed overflow. assert -2147483648 ≤ (long)al2_0 * pl2; [eva:alarm] tests/test/adpcm.c:433: Warning: signed overflow. assert (long)al2_0 * pl2 ≤ 2147483647; [eva:alarm] tests/test/adpcm.c:433: Warning: signed overflow. assert -2147483648 ≤ pl + (long)((long)al2_0 * pl2); [eva:alarm] tests/test/adpcm.c:433: Warning: signed overflow. assert pl + (long)((long)al2_0 * pl2) ≤ 2147483647; [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] computing for function abs <- quantl <- encode <- main. Called from tests/test/adpcm.c:444. [eva] Recording results for abs [eva] Done for function abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva:alarm] tests/test/adpcm.c:513: Warning: signed overflow. assert -2147483648 ≤ (long)dlt_0 * (long)*(dlti + i); [eva:alarm] tests/test/adpcm.c:513: Warning: signed overflow. assert (long)dlt_0 * (long)*(dlti + i) ≤ 2147483647; [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva:alarm] tests/test/adpcm.c:533: Warning: signed overflow. assert -2147483648 ≤ 4L * (long)al1_0; [eva:alarm] tests/test/adpcm.c:534: Warning: signed overflow. assert -wd2 ≤ 2147483647; [eva:alarm] tests/test/adpcm.c:542: Warning: signed overflow. assert -2147483648 ≤ 127L * (long)al2_0; [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva:alarm] tests/test/adpcm.c:557: Warning: signed overflow. assert -2147483648 ≤ (long)al1_0 * 255L; [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:352. [eva] Recording results for filtez [eva] Done for function filtez [eva] tests/test/adpcm.c:354: Reusing old results for call to filtep [eva] tests/test/adpcm.c:370: Reusing old results for call to abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:379. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:391. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:394. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] Recording results for encode [eva] Done for function encode [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] tests/test/adpcm.c:301: Reusing old results for call to filtez [eva] tests/test/adpcm.c:304: Reusing old results for call to filtep [eva] tests/test/adpcm.c:311: Reusing old results for call to quantl [eva] tests/test/adpcm.c:318: Reusing old results for call to logscl [eva] tests/test/adpcm.c:322: Reusing old results for call to scalel [eva] tests/test/adpcm.c:331: Reusing old results for call to upzero [eva] tests/test/adpcm.c:335: Reusing old results for call to uppol2 [eva] tests/test/adpcm.c:339: Reusing old results for call to uppol1 [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:352. [eva] Recording results for filtez [eva] Done for function filtez [eva] tests/test/adpcm.c:354: Reusing old results for call to filtep [eva] tests/test/adpcm.c:370: Reusing old results for call to abs [eva] tests/test/adpcm.c:376: Reusing old results for call to logsch [eva] tests/test/adpcm.c:379: Reusing old results for call to scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:391. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:394. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] Recording results for encode [eva] Done for function encode [eva] Recording results for main [eva] done for function main [from] Computing for function abs [from] Done for function abs [from] Computing for function filtep [from] Done for function filtep [from] Computing for function filtez [from] Done for function filtez [from] Computing for function logsch [from] Done for function logsch [from] Computing for function logscl [from] Done for function logscl [from] Computing for function quantl [from] Done for function quantl [from] Computing for function scalel [from] Done for function scalel [from] Computing for function uppol1 [from] Done for function uppol1 [from] Computing for function uppol2 [from] Done for function uppol2 [from] Computing for function upzero [from] Done for function upzero [from] Computing for function encode [from] Done for function encode [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function abs: \result FROM x [from] Function filtep: \result FROM rlt1_0; al1_0; rlt2_0; al2_0 [from] Function filtez: \result FROM delay_bpl[0..5]; delay_dltx[0..5]; delay_dhx[0..5]; delay_bph[0..5]; bpl; dlt_0 [from] Function logsch: \result FROM wh_code_table[0..3]; ih_0; nbh_0 [from] Function logscl: \result FROM wl_code_table[1..15]; il_0; nbl_0 [from] Function quantl: \result FROM decis_levl[0..29]; quant26bt_pos[0..29]; quant26bt_neg[0..29]; el_0; detl_0 [from] Function scalel: \result FROM ilb_table[0..31]; nbl_0; shift_constant [from] Function uppol1: \result FROM al1_0; apl2; plt_0; plt1_0 [from] Function uppol2: \result FROM al1_0; al2_0; plt_0; plt1_0; plt2_0 [from] Function upzero: delay_bpl[0..5] FROM delay_bpl[0..5]; delay_dltx[0..5]; delay_dhx[0..5]; delay_bph[0..5]; dlt_0; dlti; bli (and SELF) delay_dltx[0] FROM dlt_0; dlti (and SELF) [1] FROM delay_dltx[0]; delay_dhx[0]; dlti (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2]; dlti (and SELF) [4] FROM delay_dltx[3]; delay_dhx[3]; dlti (and SELF) [5] FROM delay_dltx[4]; delay_dhx[4]; dlti (and SELF) delay_dhx[0] FROM dlt_0; dlti (and SELF) [1] FROM delay_dltx[0]; delay_dhx[0]; dlti (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2]; dlti (and SELF) [4] FROM delay_dltx[3]; delay_dhx[3]; dlti (and SELF) [5] FROM delay_dltx[4]; delay_dhx[4]; dlti (and SELF) delay_bph[0..5] FROM delay_bpl[0..5]; delay_dltx[0..5]; delay_dhx[0..5]; delay_bph[0..5]; dlt_0; dlti; bli (and SELF) [from] Function encode: tqmf[0..22] FROM tqmf[0..21]; xin1; xin2 (and SELF) [23] FROM tqmf[0..21]; xin1 (and SELF) xl FROM tqmf[0..23]; h[0..23] xh FROM tqmf[0..23]; h[0..23] il FROM tqmf[0..23]; h[0..23]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] szl FROM delay_bpl[0..5]; delay_dltx[0..5]; delay_dhx[0..5]; delay_bph[0..5] spl FROM al1; al2; rlt1; rlt2 sl FROM delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; delay_dhx[0..5]; delay_bph[0..5] el FROM tqmf[0..23]; h[0..23]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; delay_dhx[0..5]; delay_bph[0..5] delay_bpl[0..5] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) delay_dltx[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2] (and SELF) [4] FROM delay_dltx[2..3]; delay_dhx[2..3] (and SELF) [5] FROM delay_dltx[3..4]; delay_dhx[3..4] (and SELF) nbl FROM tqmf[0..23]; h[0..23]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; nbl; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] al1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] al2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] plt FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] plt1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] plt2 FROM plt1 dlt FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] rlt FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] rlt1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] rlt2 FROM rlt1 detl FROM tqmf[0..23]; h[0..23]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] deth FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; ilb_table[0..31]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 sh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 eh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 dh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 ih FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 nbh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 szh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] sph FROM ah1; ah2; rh1; rh2 ph FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 yh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 delay_dhx[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; delay_dhx[0..5]; delay_bph[0..5] (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2] (and SELF) [4] FROM delay_dltx[2..3]; delay_dhx[2..3] (and SELF) [5] FROM delay_dltx[3..4]; delay_dhx[3..4] (and SELF) delay_bph[0..5] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) ah1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2 ah2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2 ph1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 ph2 FROM ph1 rh1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 rh2 FROM rh1 \result FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 [from] Function main: tqmf[0..23] FROM tqmf[0..21]; test_data[0..9] (and SELF) xl FROM tqmf[0..23]; h[0..23]; test_data[0..9] (and SELF) xh FROM tqmf[0..23]; h[0..23]; test_data[0..9] (and SELF) il FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) szl FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) spl FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) sl FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) el FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) delay_bpl[0..5] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) delay_dltx[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2] (and SELF) [4] FROM delay_dltx[2..3]; delay_dhx[2..3] (and SELF) [5] FROM delay_dltx[2..4]; delay_dhx[2..4] (and SELF) nbl FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) al1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) al2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) plt FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) plt1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) plt2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) dlt FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) rlt FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) rlt1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) rlt2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) detl FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) deth FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) sh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) eh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) dh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) ih FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) nbh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) szh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) sph FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) ph FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) yh FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) delay_dhx[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2] (and SELF) [4] FROM delay_dltx[2..3]; delay_dhx[2..3] (and SELF) [5] FROM delay_dltx[2..4]; delay_dhx[2..4] (and SELF) delay_bph[0..5] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) ah1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) ah2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) ph1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) ph2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) rh1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) rh2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) compressed[0..4] FROM tqmf[0..23]; h[0..23]; qq4_code4_table[1..15]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table[1..15]; ilb_table[0..31]; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[0..29]; quant26bt_neg[0..29]; deth; qq2_code2_table[0..3]; wh_code_table[0..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] (and SELF) [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function uppol2 [pdg] done for function uppol2 [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function encode [pdg] done for function encode [pdg] computing for function main [pdg] done for function main Slicing project worklist [default] = [main_slice_1 = change_call for call 280 -> encode_slice_1][encode_slice_1 = change_call for call 108 -> uppol2_slice_1][encode_slice_1 = change_call for call 81 -> uppol2_slice_1] [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 3 actions... [slicing] applying actions: 1/3... [slicing] applying actions: 2/3... [pdg] computing for function abs [pdg] done for function abs [pdg] computing for function filtep [pdg] done for function filtep [pdg] computing for function filtez [pdg] done for function filtez [pdg] computing for function upzero [pdg] done for function upzero [pdg] computing for function quantl [pdg] done for function quantl [pdg] computing for function uppol1 [pdg] done for function uppol1 [pdg] computing for function scalel [pdg] done for function scalel [pdg] computing for function logsch [pdg] done for function logsch [pdg] computing for function logscl [pdg] done for function logscl [slicing] applying actions: 3/3... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ void encode_slice_1(int xin1, int xin2); int filtez_slice_1(int *bpl, int *dlt_0); void upzero_slice_1(int dlt_0, int *dlti, int *bli); int filtep_slice_1(int rlt1_0, int al1_0, int rlt2_0, int al2_0); int quantl_slice_1(int el_0, int detl_0); int logscl_slice_1(int il_0, int nbl_0); int scalel_slice_1(int nbl_0, int shift_constant); int uppol2_slice_1(int al1_0, int al2_0, int plt_0, int plt1_0, int plt2_0); int uppol1_slice_1(int al1_0, int apl2, int plt_0, int plt1_0); int logsch_slice_1(int ih_0, int nbh_0); int tqmf[24]; int h[24] = {12, -44, -44, 212, 48, -624, 128, 1448, -840, -3220, 3804, 15504, 15504, 3804, -3220, -840, 1448, 128, -624, 48, 212, -44, -44, 12}; int xl; int xh; int il; int szl; int spl; int sl; int el; int qq4_code4_table[16] = {0, -20456, -12896, -8968, -6288, -4240, -2584, -1200, 20456, 12896, 8968, 6288, 4240, 2584, 1200, 0}; int delay_bpl[6]; int delay_dltx[6]; int wl_code_table[16] = {-60, 3042, 1198, 538, 334, 172, 58, -30, 3042, 1198, 538, 334, 172, 58, -30, -60}; int ilb_table[32] = {2048, 2093, 2139, 2186, 2233, 2282, 2332, 2383, 2435, 2489, 2543, 2599, 2656, 2714, 2774, 2834, 2896, 2960, 3025, 3091, 3158, 3228, 3298, 3371, 3444, 3520, 3597, 3676, 3756, 3838, 3922, 4008}; int nbl; int al1; int al2; int plt; int plt1; int plt2; int dlt; int rlt; int rlt1; int rlt2; int decis_levl[30] = {280, 576, 880, 1200, 1520, 1864, 2208, 2584, 2960, 3376, 3784, 4240, 4696, 5200, 5712, 6288, 6864, 7520, 8184, 8968, 9752, 10712, 11664, 12896, 14120, 15840, 17560, 20456, 23352, 32767}; int detl; int quant26bt_pos[31] = {61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 32}; int quant26bt_neg[31] = {63, 62, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 4}; int deth; int sh; int eh; int qq2_code2_table[4] = {-7408, -1616, 7408, 1616}; int wh_code_table[4] = {798, -214, 798, -214}; int dh; int ih; int nbh; int szh; int sph; int ph; int yh; int delay_dhx[6]; int delay_bph[6]; int ah1; int ah2; int ph1; int ph2; int rh1; int rh2; int abs_slice_1(int x) { int m; if (x >= 0) m = x; else m = - x; return m; } /*@ ensures sh ≡ 0 ∨ sh ≡ -2; */ void encode_slice_1(int xin1, int xin2) { int i; int *h_ptr; int *tqmf_ptr; int *tqmf_ptr1; long xa; long xb; int decis; int *tmp; int *tmp_0; int *tmp_1; int *tmp_2; int *tmp_7; int *tmp_8; int *tmp_9; int *tmp_12; int tmp_13; h_ptr = h; tqmf_ptr = tqmf; tmp = tqmf_ptr; tqmf_ptr ++; tmp_0 = h_ptr; h_ptr ++; xa = (long)*tmp * (long)*tmp_0; tmp_1 = tqmf_ptr; tqmf_ptr ++; tmp_2 = h_ptr; h_ptr ++; xb = (long)*tmp_1 * (long)*tmp_2; i = 0; /*@ loop pragma UNROLL 11; */ while (i < 10) { { int *tmp_3; int *tmp_4; int *tmp_5; int *tmp_6; tmp_3 = tqmf_ptr; tqmf_ptr ++; tmp_4 = h_ptr; h_ptr ++; xa += (long)*tmp_3 * (long)*tmp_4; tmp_5 = tqmf_ptr; tqmf_ptr ++; tmp_6 = h_ptr; h_ptr ++; xb += (long)*tmp_5 * (long)*tmp_6; } i ++; } tmp_7 = tqmf_ptr; tqmf_ptr ++; tmp_8 = h_ptr; h_ptr ++; xa += (long)*tmp_7 * (long)*tmp_8; tmp_9 = h_ptr; xb += (long)*tqmf_ptr * (long)*tmp_9; tqmf_ptr1 = tqmf_ptr - 2; i = 0; /*@ loop pragma UNROLL 23; */ while (i < 22) { int *tmp_10; int *tmp_11; tmp_10 = tqmf_ptr; tqmf_ptr --; tmp_11 = tqmf_ptr1; tqmf_ptr1 --; *tmp_10 = *tmp_11; i ++; } tmp_12 = tqmf_ptr; tqmf_ptr --; *tmp_12 = xin1; *tqmf_ptr = xin2; xl = (int)((xa + xb) >> 15); xh = (int)((xa - xb) >> 15); szl = filtez_slice_1(delay_bpl,delay_dltx); spl = filtep_slice_1(rlt1,al1,rlt2,al2); sl = szl + spl; el = xl - sl; il = quantl_slice_1(el,detl); dlt = (int)((long)detl * (long)qq4_code4_table[il >> 2] >> 15); nbl = logscl_slice_1(il,nbl); detl = scalel_slice_1(nbl,8); plt = dlt + szl; upzero_slice_1(dlt,delay_dltx,delay_bpl); al2 = uppol2_slice_1(al1,al2,plt,plt1,plt2); al1 = uppol1_slice_1(al1,al2,plt,plt1); rlt = sl + dlt; rlt2 = rlt1; rlt1 = rlt; plt2 = plt1; plt1 = plt; szh = filtez_slice_1(delay_bph,delay_dhx); sph = filtep_slice_1(rh1,ah1,rh2,ah2); sh = sph + szh; eh = xh - sh; if (eh >= 0) ih = 3; else ih = 1; decis = (int)(564L * (long)deth >> 12L); tmp_13 = abs_slice_1(eh); if (tmp_13 > decis) ih --; dh = (int)((long)deth * (long)qq2_code2_table[ih] >> 15L); nbh = logsch_slice_1(ih,nbh); deth = scalel_slice_1(nbh,10); ph = dh + szh; upzero_slice_1(dh,delay_dhx,delay_bph); ah2 = uppol2_slice_1(ah1,ah2,ph,ph1,ph2); ah1 = uppol1_slice_1(ah1,ah2,ph,ph1); yh = sh + dh; rh2 = rh1; rh1 = yh; ph2 = ph1; ph1 = ph; return; } int filtez_slice_1(int *bpl, int *dlt_0) { int __retres; int i; long zl; int *tmp; int *tmp_0; tmp = bpl; bpl ++; tmp_0 = dlt_0; dlt_0 ++; zl = (long)*tmp * (long)*tmp_0; i = 1; /*@ loop pragma UNROLL 7; */ while (i < 6) { int *tmp_1; int *tmp_2; tmp_1 = bpl; bpl ++; tmp_2 = dlt_0; dlt_0 ++; zl += (long)*tmp_1 * (long)*tmp_2; i ++; } __retres = (int)(zl >> 14); return __retres; } int filtep_slice_1(int rlt1_0, int al1_0, int rlt2_0, int al2_0) { int __retres; long pl; long pl2; pl = (long)(2 * rlt1_0); pl = (long)al1_0 * pl; pl2 = (long)(2 * rlt2_0); pl += (long)al2_0 * pl2; __retres = (int)(pl >> 15); return __retres; } int quantl_slice_1(int el_0, int detl_0) { int ril; int mil; long wd; long decis; wd = (long)abs_slice_1(el_0); mil = 0; decis = (long)decis_levl[mil] * (long)detl_0 >> 15L; /*@ loop pragma UNROLL 30; */ while (1) { if (wd <= decis) { if (! (mil < 29)) break; } else break; mil ++; decis = (long)decis_levl[mil] * (long)detl_0 >> 15L; } if (el_0 >= 0) ril = quant26bt_pos[mil]; else ril = quant26bt_neg[mil]; return ril; } int logscl_slice_1(int il_0, int nbl_0) { long wd; wd = (long)nbl_0 * 127L >> 7L; nbl_0 = (int)wd + wl_code_table[il_0 >> 2]; if (nbl_0 < 0) nbl_0 = 0; if (nbl_0 > 18432) nbl_0 = 18432; return nbl_0; } int scalel_slice_1(int nbl_0, int shift_constant) { int __retres; int wd1; int wd2; int wd3; wd1 = (nbl_0 >> 6) & 31; wd2 = nbl_0 >> 11; wd3 = ilb_table[wd1] >> ((shift_constant + 1) - wd2); __retres = wd3 << 3; return __retres; } void upzero_slice_1(int dlt_0, int *dlti, int *bli) { int i; int wd2; int wd3; if (dlt_0 == 0) { i = 0; /*@ loop pragma UNROLL 7; */ while (i < 6) { *(bli + i) = (int)(255L * (long)*(bli + i) >> 8L); i ++; } } else { i = 0; /*@ loop pragma UNROLL 7; */ while (i < 6) { if ((long)dlt_0 * (long)*(dlti + i) >= (long)0) wd2 = 128; else wd2 = -128; wd3 = (int)(255L * (long)*(bli + i) >> 8L); *(bli + i) = wd2 + wd3; i ++; } } *(dlti + 5) = *(dlti + 4); *(dlti + 4) = *(dlti + 3); *(dlti + 3) = *(dlti + 2); *(dlti + 1) = *(dlti + 0); *(dlti + 0) = dlt_0; return; } int uppol2_slice_1(int al1_0, int al2_0, int plt_0, int plt1_0, int plt2_0) { long wd2; long wd4; int apl2; wd2 = 4L * (long)al1_0; if ((long)plt_0 * (long)plt1_0 >= 0L) wd2 = - wd2; wd2 >>= 7; if ((long)plt_0 * (long)plt2_0 >= 0L) wd4 = wd2 + (long)128; else wd4 = wd2 - (long)128; apl2 = (int)(wd4 + (127L * (long)al2_0 >> 7L)); if (apl2 > 12288) apl2 = 12288; if (apl2 < -12288) apl2 = -12288; return apl2; } int uppol1_slice_1(int al1_0, int apl2, int plt_0, int plt1_0) { long wd2; int wd3; int apl1; wd2 = (long)al1_0 * 255L >> 8L; if ((long)plt_0 * (long)plt1_0 >= 0L) apl1 = (int)wd2 + 192; else apl1 = (int)wd2 - 192; wd3 = 15360 - apl2; if (apl1 > wd3) apl1 = wd3; if (apl1 < - wd3) apl1 = - wd3; return apl1; } int logsch_slice_1(int ih_0, int nbh_0) { int wd; wd = (int)((long)nbh_0 * 127L >> 7L); nbh_0 = wd + wh_code_table[ih_0]; if (nbh_0 < 0) nbh_0 = 0; if (nbh_0 > 22528) nbh_0 = 22528; return nbh_0; } int test_data[10] = {1, 0, 1, 0, 1, 1, 1, 1, 1, 1}; void main(void) { int i; i = 0; /*@ loop pragma UNROLL 11; loop pragma WIDEN_HINTS 32767; */ while (i < 10) { encode_slice_1(test_data[i],test_data[i + 1]); i += 2; } return; } frama-c-20.0-Calcium/tests/slicing/oracle/annot.0.res.oracle0000666000000000000000000000324013571573400020505 0ustar [kernel] Parsing tests/slicing/annot.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at f1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ [--..--] z ∈ [--..--] t[0..9] ∈ {0} [eva:alarm] tests/slicing/annot.i:11: Warning: signed overflow. assert -2147483648 ≤ x + x; [eva:alarm] tests/slicing/annot.i:11: Warning: signed overflow. assert x + x ≤ 2147483647; [eva:alarm] tests/slicing/annot.i:11: Warning: signed overflow. assert -2147483648 ≤ (int)(x + x) - x; [eva:alarm] tests/slicing/annot.i:11: Warning: signed overflow. assert (int)(x + x) - x ≤ 2147483647; [eva:alarm] tests/slicing/annot.i:15: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] done for function f1 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f1 [pdg] done for function f1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ extern int x; void f1(void) { int v = 3; x = 3; /*@ assert x ≡ \at(x,Pre); */ ; return; } [kernel] Parsing tests/slicing/result/ocode_0_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/annot.1.res.oracle0000666000000000000000000000241113571573400020505 0ustar [kernel] Parsing tests/slicing/annot.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at f2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ [--..--] z ∈ [--..--] t[0..9] ∈ {0} [eva] tests/slicing/annot.i:23: assertion got status valid. [eva] Recording results for f2 [eva] done for function f2 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f2 [pdg] done for function f2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ extern int x; int t[10]; void f2(void) { t[6] = 4; x = 3; /*@ assert \initialized(&t[x .. 9]); */ ; return; } [kernel] Parsing tests/slicing/result/ocode_1_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts0184.res.oracle0000666000000000000000000000233213571573400020336 0ustar [kernel] Parsing tests/slicing/bts0184.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing] Nothing to select for an unreachable stmt of x [pdg] computing for function x [pdg] Warning: unreachable entry point (sid:1, function x) [pdg] Bottom for function x [slicing] bottom PDG for function 'x': ignore selection [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ [kernel] Parsing tests/slicing/result/ocode_0_bts0184.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts0190.res.oracle0000666000000000000000000000354013571573400020335 0ustar [kernel] Parsing tests/slicing/bts0190.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function x <- main. Called from tests/slicing/bts0190.i:15. [eva] tests/slicing/bts0190.i:8: assertion got status valid. [eva] tests/slicing/bts0190.i:9: assertion got status valid. [eva] computing for function z1 <- x <- main. Called from tests/slicing/bts0190.i:10. [eva] Recording results for z1 [eva] Done for function z1 [eva] Recording results for x [eva] Done for function x [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing:cmdline] Warning: Unbound variable y. Slicing requests from the command line are ignored. [slicing] Warning: No internal slicing request from the command line. [slicing] Warning: Adding an extra request on the entry point of function: main. [pdg] computing for function main [from] Computing for function x [from] Computing for function z1 <-x [from] Done for function z1 [from] Done for function x [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void main(void) { return; } [kernel] Parsing tests/slicing/result/ocode_0_bts0190.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts0950_annot.res.oracle0000666000000000000000000000502713571573400021542 0ustar [kernel] Parsing tests/slicing/bts0950_annot.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {1} b ∈ {2} [eva] computing for function cpy <- main. Called from tests/slicing/bts0950_annot.i:14. [eva] tests/slicing/bts0950_annot.i:14: function cpy: precondition got status valid. [eva] Recording results for cpy [eva] Done for function cpy [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function cpy: a ∈ {2} [eva:final-states] Values at end of function main: a ∈ {2} [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function cpy [from] Done for function cpy [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function cpy [pdg] done for function cpy [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void cpy_slice_1(int *region1, int const *region2); /*@ requires \valid(region1); */ void cpy_slice_1(int *region1, int const *region2) { *region1 = *region2; return; } int a = 1; int b = 2; void main(void) { cpy_slice_1(& a,(int const *)(& b)); return; } [kernel] Parsing tests/slicing/result/ocode_0_bts0950_annot.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {1} b ∈ {2} [eva] computing for function cpy <- main. Called from tests/slicing/result/ocode_0_bts0950_annot.i:15. [eva] tests/slicing/result/ocode_0_bts0950_annot.i:15: function cpy: precondition got status valid. [eva] Recording results for cpy [eva] Done for function cpy [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function cpy: a ∈ {2} [eva:final-states] Values at end of function main: a ∈ {2} frama-c-20.0-Calcium/tests/slicing/oracle/bts1248.res.oracle0000666000000000000000000000230113571573400020334 0ustar [kernel] Parsing tests/slicing/bts1248.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for f [eva] done for function f [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing] Warning: No internal slicing request from the command line. [slicing] Warning: Adding an extra request on the entry point of function: f. [pdg] computing for function f [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'p export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'p export tmp' [sparecode] removed unused global declarations in new project 'p export' /* Generated by Frama-C */ void f(void) { return; } [kernel] Parsing tests/slicing/result/ocode_0_bts1248.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts1445.0.res.oracle0000666000000000000000000000236013571573400020476 0ustar [kernel] Parsing tests/slicing/bts1445.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] tests/slicing/bts1445.i:10: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] Nothing to select for unreachable return stmt of main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void main(void) { return; } [kernel] Parsing tests/slicing/result/ocode_0_bts1445.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts1445.1.res.oracle0000666000000000000000000000233313571573400020477 0ustar [kernel] Parsing tests/slicing/bts1445.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] Recording results for f [eva] done for function f [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [pdg] tests/slicing/bts1445.i:16: Warning: no final state. Probably unreachable... [pdg] done for function f [slicing] Nothing to select for unreachable return stmt of f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f(void) { return; } [kernel] Parsing tests/slicing/result/ocode_1_bts1445.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts1684.res.oracle0000666000000000000000000000327713571573400020355 0ustar [kernel] Parsing tests/slicing/bts1684.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization d1 ∈ {0} d2 ∈ {0} d3 ∈ {0} x1 ∈ {0} x2 ∈ {0} x3 ∈ {0} [eva] computing for function main2 <- main. Called from tests/slicing/bts1684.i:14. [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function main2 [from] Done for function main2 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main2 [pdg] done for function main2 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ double d1; double d2; double d3; int x1; int x2; int x3; int main2_slice_1(void) { int __retres; d1 = d2 * d3; x1 = x2 * x3; __retres = 1; return __retres; } int main(void) { int tmp; tmp = main2_slice_1(); return tmp; } [kernel] Parsing tests/slicing/result/ocode_0_bts1684.i (no preprocessing) [kernel] writing journal in file `./frama_c_journal.ml'. frama-c-20.0-Calcium/tests/slicing/oracle/bts1768.res.oracle0000666000000000000000000002030013571573400020342 0ustar [kernel] Parsing tests/slicing/bts1768.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization choix ∈ {0} state ∈ {1} cumul ∈ {0} step ∈ {0} [eva] computing for function lecture <- main. Called from tests/slicing/bts1768.i:45. [eva] computing for function choisir <- lecture <- main. Called from tests/slicing/bts1768.i:18. [kernel] tests/slicing/bts1768.i:18: Warning: No code nor implicit assigns clause for function choisir, generating default assigns from the prototype [eva] using specification for function choisir [eva] Done for function choisir [eva] Recording results for lecture [eva] Done for function lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:44: starting to merge loop iterations [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva:alarm] tests/slicing/bts1768.i:51: Warning: signed overflow. assert step + 1 ≤ 2147483647; [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] tests/slicing/bts1768.i:45: Reusing old results for call to lecture [eva] computing for function fsm_transition <- main. Called from tests/slicing/bts1768.i:46. [eva:alarm] tests/slicing/bts1768.i:25: Warning: signed overflow. assert cumul + 2 ≤ 2147483647; [eva:alarm] tests/slicing/bts1768.i:29: Warning: signed overflow. assert cumul + 1 ≤ 2147483647; [eva:alarm] tests/slicing/bts1768.i:35: Warning: signed overflow. assert cumul + 1 ≤ 2147483647; [eva:alarm] tests/slicing/bts1768.i:35: Warning: signed overflow. assert cumul + 1 ≤ 2147483647; [eva] Recording results for fsm_transition [eva] Done for function fsm_transition [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function lecture [from] Computing for function choisir <-lecture [from] Done for function choisir [from] Done for function lecture [from] Computing for function fsm_transition [from] Done for function fsm_transition [pdg] done for function main [slicing] Nothing to select for an unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function fsm_transition [pdg] done for function fsm_transition [pdg] computing for function lecture [pdg] done for function lecture [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int choix; int state = 1; int step = 0; /*@ ensures \result ≡ 0 ∨ \result ≡ 1 ∨ \result ≡ 2; */ int choisir(void); void lecture_slice_1(void) { choix = choisir(); return; } void fsm_transition_slice_1(void) { switch (state) { case 1: ; if (choix == 2) state = 2; break; case 2: ; if (step == 50) if (choix == 1) state = 3; break; case 3: ; default: ; } return; } void main(void) { lecture_slice_1(); fsm_transition_slice_1(); step ++; lecture_slice_1(); fsm_transition_slice_1(); step ++; lecture_slice_1(); fsm_transition_slice_1(); step ++; lecture_slice_1(); fsm_transition_slice_1(); step ++; lecture_slice_1(); fsm_transition_slice_1(); step ++; lecture_slice_1(); fsm_transition_slice_1(); step ++; lecture_slice_1(); fsm_transition_slice_1(); step ++; lecture_slice_1(); fsm_transition_slice_1(); step ++; lecture_slice_1(); fsm_transition_slice_1(); step ++; lecture_slice_1(); fsm_transition_slice_1(); step ++; /*@ loop pragma UNROLL "done", 10; */ while (1) { lecture_slice_1(); fsm_transition_slice_1(); if (state == 3) { /*@ slice pragma ctrl; */ ; break; } step ++; } return; } [kernel] Parsing tests/slicing/result/ocode_0_bts1768.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts179.0.res.oracle0000666000000000000000000000310513571573400020417 0ustar [kernel] Parsing tests/slicing/bts179.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ {0} X ∈ {0} Y ∈ {0} [eva] computing for function g <- main. Called from tests/slicing/bts179.i:16. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function g [from] Done for function g [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function g [pdg] done for function g [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct __anonstruct_S_1 { int a ; int ab ; int b ; int c ; int d ; }; struct __anonstruct_S_1 S; void g_slice_1(void) { S.a = 1; return; } int main(void) { int __retres; g_slice_1(); __retres = S.a; return __retres; } [kernel] Parsing tests/slicing/result/ocode_0_bts179.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts179.1.res.oracle0000666000000000000000000000307513571573400020426 0ustar [kernel] Parsing tests/slicing/bts179.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ {0} X ∈ {0} Y ∈ {0} [eva] computing for function g <- main. Called from tests/slicing/bts179.i:16. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function g [from] Done for function g [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function g [pdg] done for function g [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct __anonstruct_S_1 { int a ; int ab ; int b ; int c ; int d ; }; struct __anonstruct_S_1 S; void g_slice_1(void) { S.b = 2; return; } void main(void) { g_slice_1(); /*@ slice pragma expr S.b; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_1_bts179.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts179.2.res.oracle0000666000000000000000000000213513571573400020423 0ustar [kernel] Parsing tests/slicing/bts179.i (no preprocessing) [sparecode] remove unused code... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ {0} X ∈ {0} Y ∈ {0} [eva] computing for function g <- main. Called from tests/slicing/bts179.i:16. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function g [from] Done for function g [pdg] done for function main [pdg] computing for function g [pdg] done for function g [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ struct __anonstruct_S_1 { int a ; int ab ; int b ; int c ; int d ; }; struct __anonstruct_S_1 S; void g(void) { S.a = 1; S.b = 2; S.d = 4; return; } int main(void) { int __retres; g(); /*@ slice pragma expr S.b; */ ; S.ab = 1; __retres = S.a; return __retres; } frama-c-20.0-Calcium/tests/slicing/oracle/bts283.res.oracle0000666000000000000000000000620313571573400020257 0ustar [kernel] Parsing tests/slicing/bts283.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} X ∈ {0} Y ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/bts283.i:33. [eva] tests/slicing/bts283.i:33: function f: precondition got status valid. [eva] tests/slicing/bts283.i:10: function f: postcondition got status valid. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/slicing/bts283.i:34. [eva] using specification for function g [eva] tests/slicing/bts283.i:34: function g: precondition 'a' got status valid. [eva] tests/slicing/bts283.i:34: function g: precondition 'b' got status valid. [eva] Done for function g [eva:alarm] tests/slicing/bts283.i:34: Warning: signed overflow. assert z + tmp ≤ 2147483647; (tmp from g(1, 2)) [eva] computing for function k <- main. Called from tests/slicing/bts283.i:35. [eva] tests/slicing/bts283.i:35: function k: precondition got status valid. [eva:alarm] tests/slicing/bts283.i:27: Warning: signed overflow. assert Y + 1 ≤ 2147483647; [eva] tests/slicing/bts283.i:22: function k: postcondition got status valid. [eva:alarm] tests/slicing/bts283.i:23: Warning: function k: postcondition got status unknown. [eva] Recording results for k [eva] Done for function k [eva:alarm] tests/slicing/bts283.i:36: Warning: signed overflow. assert X + z ≤ 2147483647; [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function k [from] Done for function k [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [pdg] computing for function g [pdg] done for function g [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; int z; int X; int Y; int f_slice_1(void) { return x; } /*@ requires a: a > 0; */ int g_slice_1(int a); /*@ requires x_0 > 0; ensures X > \old(X); ensures Y ≡ \old(Y) + 1; */ void k_slice_1(int x_0) { X += x_0; return; } int main(void) { int __retres; int tmp; x = 1; z = f_slice_1(); tmp = g_slice_1(1); z += tmp; k_slice_1(3); __retres = X + z; return __retres; } [kernel] Parsing tests/slicing/result/ocode_0_bts283.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts326.res.oracle0000666000000000000000000000463413571573400020263 0ustar [kernel] Parsing tests/slicing/bts326.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..1] ∈ {0} r ∈ {0} [eva] computing for function g <- main. Called from tests/slicing/bts326.i:17. [eva] computing for function f <- g <- main. Called from tests/slicing/bts326.i:12. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- g <- main. Called from tests/slicing/bts326.i:13. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/slicing/bts326.i:12 (by g): t[0] FROM i [from] call to f at tests/slicing/bts326.i:13 (by g): t[1] FROM i [from] call to g at tests/slicing/bts326.i:17 (by main): t[0..1] FROM \nothing [from] entry point: t[0..1] FROM \nothing r FROM \nothing \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function g [pdg] done for function g [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int t[2]; int r; void f_slice_1(int i) { t[i] = i; return; } void g_slice_1(void) { f_slice_1(0); return; } int main(void) { g_slice_1(); r = t[0]; return r; } [kernel] Parsing tests/slicing/result/ocode_0_bts326.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts335.res.oracle0000666000000000000000000000466013571573400020262 0ustar [kernel] Parsing tests/slicing/bts335.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..1] ∈ {0} [eva] computing for function g <- main. Called from tests/slicing/bts335.i:12. [eva] computing for function f <- g <- main. Called from tests/slicing/bts335.i:11. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] computing for function f <- main. Called from tests/slicing/bts335.i:12. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/slicing/bts335.i:11 (by g): T[0] FROM T[0]; i [from] call to g at tests/slicing/bts335.i:12 (by main): T[0] FROM T[0] [from] call to f at tests/slicing/bts335.i:12 (by main): T[1] FROM T[1]; i [from] entry point: T[0] FROM T[0]; c (and SELF) [1] FROM T[1]; c (and SELF) [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function g [pdg] done for function g [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] done for function main [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int T[2] = {0, 0}; void f_slice_1(int i) { (T[i]) ++; return; } void g_slice_1(void) { f_slice_1(0); /*@ slice pragma expr T[0]; */ ; return; } void main(int c) { if (c) g_slice_1(); return; } [kernel] Parsing tests/slicing/result/ocode_0_bts335.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts335b.res.oracle0000666000000000000000000001002713571573400020416 0ustar [kernel] Parsing tests/slicing/bts335b.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} Y ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/bts335b.i:20. [eva:alarm] tests/slicing/bts335b.i:16: Warning: signed overflow. assert z + 1 ≤ 2147483647; [eva] computing for function g <- f <- main. Called from tests/slicing/bts335b.i:17. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva:alarm] tests/slicing/bts335b.i:21: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] computing for function g <- main. Called from tests/slicing/bts335b.i:22. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva:alarm] tests/slicing/bts335b.i:22: Warning: signed overflow. assert -2147483648 ≤ r + tmp_0; (tmp_0 from g(2, w, b, j)) [eva:alarm] tests/slicing/bts335b.i:22: Warning: signed overflow. assert r + tmp_0 ≤ 2147483647; (tmp_0 from g(2, w, b, j)) [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to g at tests/slicing/bts335b.i:17 (by f): X FROM c; x Y FROM c; x \result FROM c; x [from] call to f at tests/slicing/bts335b.i:20 (by main): X FROM c; x Y FROM c; x \result FROM c; x [from] call to g at tests/slicing/bts335b.i:22 (by main): X FROM c; y Y FROM c; y \result FROM c; y [from] entry point: X FROM b Y FROM b \result FROM v; b [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] done (initializing slicing). [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] done (applying all slicing requests). [slicing] done (interpreting slicing requests from the command line). [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] applying sub action... [pdg] computing for function g [pdg] done for function g [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [pdg] computing for function f [pdg] done for function f [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [slicing] applying sub action... [slicing] done (applying 1 actions. [slicing] done (applying all slicing requests). [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] done (applying all slicing requests). [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' [slicing] done (exporting project to 'Slicing export'). [slicing] done (slicing requests in progress). /* Generated by Frama-C */ int X; int g_slice_1(int c, int x, int y, int z) { X = z; if (c == 1) X = x; if (c == 2) X = y; return X; } int f_slice_1(int c, int x, int y, int z) { int tmp; z ++; tmp = g_slice_1(c,x,y,z); return tmp; } int main(int v, int w, int a, int b, int i, int j) { int tmp_0; int r = f_slice_1(1,v,a,i); j ++; tmp_0 = g_slice_1(2,w,b,j); r += tmp_0; return r; } [kernel] Parsing tests/slicing/result/ocode_0_bts335b.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts336.0.res.oracle0000666000000000000000000000415213571573400020415 0ustar [kernel] Parsing tests/slicing/bts336.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} x5 ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/bts336.i:20. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/slicing/bts336.i:21. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/slicing/bts336.i:20 (by main): T[1] FROM T[1]; i \result FROM T[1]; i [from] call to f at tests/slicing/bts336.i:21 (by main): T[2] FROM T[2]; i \result FROM T[2]; i [from] entry point: T[1] FROM T[1] [2] FROM T[2] \result FROM T[2] [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int T[10]; int f_slice_1(int i) { int __retres; (T[i]) ++; __retres = T[i]; return __retres; } int main(void) { int x2 = f_slice_1(2); return x2; } [kernel] Parsing tests/slicing/result/ocode_0_bts336.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts336.1.res.oracle0000666000000000000000000000407213571573400020417 0ustar [kernel] Parsing tests/slicing/bts336.i (no preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} x5 ∈ {0} [eva] computing for function f2 <- main2. Called from tests/slicing/bts336.i:35. [eva] Recording results for f2 [from] Computing for function f2 [from] Done for function f2 [eva] Done for function f2 [eva] computing for function f2 <- main2. Called from tests/slicing/bts336.i:36. [eva] Recording results for f2 [from] Computing for function f2 [from] Done for function f2 [eva] Done for function f2 [eva] Recording results for main2 [from] Computing for function main2 [from] Done for function main2 [eva] done for function main2 [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f2 at tests/slicing/bts336.i:35 (by main2): T[1] FROM i [from] call to f2 at tests/slicing/bts336.i:36 (by main2): T[2] FROM i [from] entry point: T[1..2] FROM \nothing \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main2 [pdg] done for function main2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f2 [pdg] done for function f2 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int T[10]; void f2_slice_1(int i) { T[i] = i; return; } int main2(void) { int __retres; f2_slice_1(2); __retres = T[2]; return __retres; } [kernel] Parsing tests/slicing/result/ocode_1_bts336.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts336.2.res.oracle0000666000000000000000000000344313571573400020421 0ustar [kernel] Parsing tests/slicing/bts336.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} x5 ∈ {0} [eva] computing for function f3 <- main3. Called from tests/slicing/bts336.i:53. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f3 <- main3. Called from tests/slicing/bts336.i:54. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f3 <- main3. Called from tests/slicing/bts336.i:55. [eva] Recording results for f3 [eva] Done for function f3 [eva] Recording results for main3 [eva] done for function main3 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main3 [from] Computing for function f3 [from] Done for function f3 [pdg] done for function main3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f3 [pdg] done for function f3 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f3_slice_1(int *p) { (*p) ++; return; } int main3(void) { int a = 1; int b = 2; int c = 3; f3_slice_1(& a); f3_slice_1(& b); f3_slice_1(& c); return b; } [kernel] Parsing tests/slicing/result/ocode_2_bts336.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts336.3.res.oracle0000666000000000000000000000511513571573400020420 0ustar [kernel] Parsing tests/slicing/bts336.i (no preprocessing) [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} x5 ∈ {0} [eva] computing for function f3 <- main3. Called from tests/slicing/bts336.i:53. [eva] Recording results for f3 [from] Computing for function f3 [from] Done for function f3 [eva] Done for function f3 [eva] computing for function f3 <- main3. Called from tests/slicing/bts336.i:54. [eva] Recording results for f3 [from] Computing for function f3 [from] Done for function f3 [eva] Done for function f3 [eva] computing for function f3 <- main3. Called from tests/slicing/bts336.i:55. [eva] Recording results for f3 [from] Computing for function f3 [from] Done for function f3 [eva] Done for function f3 [eva] Recording results for main3 [from] Computing for function main3 [from] Done for function main3 [eva] done for function main3 [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f3 at tests/slicing/bts336.i:53 (by main3): a FROM p; a [from] call to f3 at tests/slicing/bts336.i:54 (by main3): b FROM p; b [from] call to f3 at tests/slicing/bts336.i:55 (by main3): c FROM p; c [from] entry point: \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] InOut (internal) for function f3: Operational inputs: p; a; b; c Operational inputs on termination: p; a; b; c Sure outputs: \nothing [inout] InOut (internal) for function main3: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: a; b; c [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main3 [pdg] done for function main3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f3 [pdg] done for function f3 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f3_slice_1(int *p) { (*p) ++; return; } int main3(void) { int b = 2; f3_slice_1(& b); return b; } [kernel] Parsing tests/slicing/result/ocode_3_bts336.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts336.4.res.oracle0000666000000000000000000000415213571573400020421 0ustar [kernel] Parsing tests/slicing/bts336.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} x5 ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/bts336.i:20. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/slicing/bts336.i:21. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/slicing/bts336.i:20 (by main): T[1] FROM T[1]; i \result FROM T[1]; i [from] call to f at tests/slicing/bts336.i:21 (by main): T[2] FROM T[2]; i \result FROM T[2]; i [from] entry point: T[1] FROM T[1] [2] FROM T[2] \result FROM T[2] [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int T[10]; int f_slice_1(int i) { int __retres; (T[i]) ++; __retres = T[i]; return __retres; } int main(void) { int x2 = f_slice_1(2); return x2; } [kernel] Parsing tests/slicing/result/ocode_4_bts336.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts336.5.res.oracle0000666000000000000000000001456213571573400020430 0ustar [kernel] Parsing tests/slicing/bts336.i (no preprocessing) [eva] Analyzing a complete application starting at main4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} x5 ∈ {0} [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:78. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:79. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:80. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:81. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:82. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] tests/slicing/bts336.i:77: starting to merge loop iterations [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:78. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:79. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:80. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:81. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:82. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:78. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:79. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:80. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:81. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:82. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:78. [eva:alarm] tests/slicing/bts336.i:62: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva:alarm] tests/slicing/bts336.i:63: Warning: signed overflow. assert *q + 1 ≤ 2147483647; [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:79. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:80. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:81. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:82. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva:alarm] tests/slicing/bts336.i:84: Warning: signed overflow. assert a2 + b4 ≤ 2147483647; [eva] Recording results for main4 [from] Computing for function main4 [from] Done for function main4 [eva] done for function main4 [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f4 at tests/slicing/bts336.i:78 (by main4): a1 FROM p; a1 b1 FROM q; b1 [from] call to f4 at tests/slicing/bts336.i:79 (by main4): a2 FROM p; a2 b2 FROM q; b2 [from] call to f4 at tests/slicing/bts336.i:80 (by main4): a3 FROM p; a3 b3 FROM q; b3 [from] call to f4 at tests/slicing/bts336.i:81 (by main4): a4 FROM p; a4 b4 FROM q; b4 [from] call to f4 at tests/slicing/bts336.i:82 (by main4): a5 FROM p; a5 b5 FROM q; b5 [from] entry point: \result FROM c [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main4 [pdg] done for function main4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f4 [pdg] done for function f4 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f4_slice_1(int *p, int *q) { (*p) ++; (*q) ++; return; } int main4(int volatile c) { int __retres; int a2 = 3; int b2 = 4; int a4 = 7; int b4 = 8; while (c) { f4_slice_1(& a2,& b2); f4_slice_1(& a4,& b4); } __retres = a2 + b4; return __retres; } [kernel] Parsing tests/slicing/result/ocode_5_bts336.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts336.6.res.oracle0000666000000000000000000001455313571573400020431 0ustar [kernel] Parsing tests/slicing/bts336.i (no preprocessing) [eva] Analyzing a complete application starting at main4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} x5 ∈ {0} [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:78. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:79. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:80. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:81. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:82. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] tests/slicing/bts336.i:77: starting to merge loop iterations [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:78. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:79. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:80. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:81. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:82. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:78. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:79. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:80. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:81. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:82. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:78. [eva:alarm] tests/slicing/bts336.i:62: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva:alarm] tests/slicing/bts336.i:63: Warning: signed overflow. assert *q + 1 ≤ 2147483647; [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:79. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:80. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:81. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main4. Called from tests/slicing/bts336.i:82. [eva] Recording results for f4 [from] Computing for function f4 [from] Done for function f4 [eva] Done for function f4 [eva:alarm] tests/slicing/bts336.i:84: Warning: signed overflow. assert a2 + b4 ≤ 2147483647; [eva] Recording results for main4 [from] Computing for function main4 [from] Done for function main4 [eva] done for function main4 [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f4 at tests/slicing/bts336.i:78 (by main4): a1 FROM p; a1 b1 FROM q; b1 [from] call to f4 at tests/slicing/bts336.i:79 (by main4): a2 FROM p; a2 b2 FROM q; b2 [from] call to f4 at tests/slicing/bts336.i:80 (by main4): a3 FROM p; a3 b3 FROM q; b3 [from] call to f4 at tests/slicing/bts336.i:81 (by main4): a4 FROM p; a4 b4 FROM q; b4 [from] call to f4 at tests/slicing/bts336.i:82 (by main4): a5 FROM p; a5 b5 FROM q; b5 [from] entry point: \result FROM c [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main4 [pdg] done for function main4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f4 [pdg] done for function f4 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f4_slice_2(int *p) { (*p) ++; return; } void f4_slice_1(int *q) { (*q) ++; return; } int main4(int volatile c) { int __retres; int a2 = 3; int b4 = 8; while (c) { f4_slice_2(& a2); f4_slice_1(& b4); } __retres = a2 + b4; return __retres; } [kernel] Parsing tests/slicing/result/ocode_6_bts336.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts336.7.res.oracle0000666000000000000000000001007213571573400020422 0ustar [kernel] Parsing tests/slicing/bts336.i (no preprocessing) [eva] Analyzing a complete application starting at main5 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} x5 ∈ {0} [eva] computing for function f5 <- main5. Called from tests/slicing/bts336.i:98. [eva] Recording results for f5 [from] Computing for function f5 [from] Done for function f5 [eva] Done for function f5 [eva] computing for function f5 <- main5. Called from tests/slicing/bts336.i:99. [eva] Recording results for f5 [from] Computing for function f5 [from] Done for function f5 [eva] Done for function f5 [eva] Recording results for main5 [from] Computing for function main5 [from] Done for function main5 [eva] done for function main5 [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f5 at tests/slicing/bts336.i:98 (by main5): x5 FROM q; b1 a1 FROM p; a1 [from] call to f5 at tests/slicing/bts336.i:99 (by main5): x5 FROM q; a1 a2 FROM p; a2 [from] entry point: x5 FROM \nothing \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main5 [pdg] done for function main5 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f5 [pdg] done for function f5 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' [eva] Analyzing a complete application starting at main5 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f5_slice_1 <- main5. Called from tests/slicing/bts336.i:98. [eva] Recording results for f5_slice_1 [from] Computing for function f5_slice_1 [from] Done for function f5_slice_1 [eva] Done for function f5_slice_1 [eva] computing for function f5_slice_1 <- main5. Called from tests/slicing/bts336.i:99. [eva] Recording results for f5_slice_1 [from] Computing for function f5_slice_1 [from] Done for function f5_slice_1 [eva] Done for function f5_slice_1 [eva] Recording results for main5 [from] Computing for function main5 [from] Done for function main5 [eva] done for function main5 [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f5_slice_1 at tests/slicing/bts336.i:98 (by main5): a1 FROM p; a1 [from] call to f5_slice_1 at tests/slicing/bts336.i:99 (by main5): a2 FROM p; a2 [from] entry point: \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main5 [pdg] done for function main5 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f5_slice_1 [pdg] done for function f5_slice_1 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f5_slice_1(int *p) { (*p) ++; return; } int main5(void) { int a1 = 1; int a2 = 2; f5_slice_1(& a1); f5_slice_1(& a2); return a2; } /* Generated by Frama-C */ void f5_slice_1_slice_1(int *p) { (*p) ++; return; } int main5(void) { int a2 = 2; f5_slice_1_slice_1(& a2); return a2; } [kernel] Parsing tests/slicing/result/ocode_7_bts336.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts341.res.oracle0000666000000000000000000000224713571573400020256 0ustar [kernel] Parsing tests/slicing/bts341.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/slicing/bts341.i:7: assertion got status valid. [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void main(int c) { /*@ assert c ≡ 0; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_0_bts341.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts344.0.res.oracle0000666000000000000000000000450413571573400020415 0ustar [kernel] Parsing tests/slicing/bts344.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} Y ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/bts344.i:24. [eva] computing for function h <- f <- main. Called from tests/slicing/bts344.i:21. [eva] Recording results for h [eva] Done for function h [eva] Recording results for f [eva] Done for function f [eva] computing for function h <- main. Called from tests/slicing/bts344.i:25. [eva] Recording results for h [eva] Done for function h [eva] computing for function k <- main. Called from tests/slicing/bts344.i:26. [eva] tests/slicing/bts344.i:9: function k: postcondition got status valid. [eva] Recording results for k [eva] Done for function k [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f [from] Computing for function h <-f [from] Done for function h [from] Done for function f [from] Computing for function k [from] Done for function k [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [pdg] computing for function h [pdg] done for function h [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X; void h_slice_1(int x); /*@ ensures X ≡ \old(X) + \old(x); */ void k_slice_1(int x) { X += x; return; } void h_slice_1(int x) { X += x; return; } void f_slice_1(int x) { h_slice_1(x); return; } int main(void) { f_slice_1(1); h_slice_1(2); k_slice_1(3); return X; } [kernel] Parsing tests/slicing/result/ocode_0_bts344.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts344.1.res.oracle0000666000000000000000000000314413571573400020415 0ustar [kernel] Parsing tests/slicing/bts344.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main_bis [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} Y ∈ {0} [eva] computing for function k <- main_bis. Called from tests/slicing/bts344.i:32. [eva] tests/slicing/bts344.i:9: function k: postcondition got status valid. [eva] Recording results for k [eva] Done for function k [eva] Recording results for main_bis [eva] done for function main_bis [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main_bis [from] Computing for function k [from] Done for function k [pdg] done for function main_bis [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X; int Y; /*@ ensures X ≡ \old(X) + \old(x); */ void k(int x); void k_slice_1(void) { Y ++; return; } int main_bis(void) { void (*p)(int ) = & k; k_slice_1(); return Y; } [kernel] Parsing tests/slicing/result/ocode_1_bts344.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts345.0.res.oracle0000666000000000000000000000555513571573400020425 0ustar [kernel] Parsing tests/slicing/bts345.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at call_top [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/slicing/bts345.i:27: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva] computing for function top <- call_top. Called from tests/slicing/bts345.i:28. [eva:alarm] tests/slicing/bts345.i:21: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_by_top <- top <- call_top. Called from tests/slicing/bts345.i:22. [eva:alarm] tests/slicing/bts345.i:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_indirectly_by_top <- called_by_top <- top <- call_top. Called from tests/slicing/bts345.i:16. [eva:alarm] tests/slicing/bts345.i:10: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for called_indirectly_by_top [eva] Done for function called_indirectly_by_top [eva] Recording results for called_by_top [eva] Done for function called_by_top [eva] Recording results for top [eva] Done for function top [eva] Recording results for call_top [eva] done for function call_top [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function call_top [from] Computing for function top [from] Computing for function called_by_top <-top [from] Computing for function called_indirectly_by_top <-called_by_top <-top [from] Done for function called_indirectly_by_top [from] Done for function called_by_top [from] Done for function top [pdg] done for function call_top [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function top [pdg] done for function top [pdg] computing for function called_by_top [pdg] done for function called_by_top [pdg] computing for function called_indirectly_by_top [pdg] done for function called_indirectly_by_top [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int called_indirectly_by_top_slice_1(int x) { x ++; return x; } int called_by_top_slice_1(int x) { x ++; int z = called_indirectly_by_top_slice_1(x); return z; } int top_slice_1(int x) { x ++; int z = called_by_top_slice_1(x); return z; } int call_top(int y) { y ++; int z = top_slice_1(y); return z; } [kernel] Parsing tests/slicing/result/ocode_0_bts345.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts345.1.res.oracle0000666000000000000000000000501413571573400020414 0ustar [kernel] Parsing tests/slicing/bts345.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at top [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:initial-state] creating variable S_0_S___va_params with imprecise size (type void) [eva:initial-state] creating variable S_1_S___va_params with imprecise size (type void) [eva:alarm] tests/slicing/bts345.i:21: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_by_top <- top. Called from tests/slicing/bts345.i:22. [eva:alarm] tests/slicing/bts345.i:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_indirectly_by_top <- called_by_top <- top. Called from tests/slicing/bts345.i:16. [eva:alarm] tests/slicing/bts345.i:10: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for called_indirectly_by_top [eva] Done for function called_indirectly_by_top [eva] Recording results for called_by_top [eva] Done for function called_by_top [eva] Recording results for top [eva] done for function top [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function top [from] Computing for function called_by_top [from] Computing for function called_indirectly_by_top <-called_by_top [from] Done for function called_indirectly_by_top [from] Done for function called_by_top [pdg] done for function top [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function called_by_top [pdg] done for function called_by_top [pdg] computing for function called_indirectly_by_top [pdg] done for function called_indirectly_by_top [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int called_indirectly_by_top_slice_1(int x) { x ++; return x; } int called_by_top_slice_1(int x) { x ++; int z = called_indirectly_by_top_slice_1(x); return z; } int top(int x) { x ++; int z = called_by_top_slice_1(x); return z; } [kernel] Parsing tests/slicing/result/ocode_1_bts345.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts345.2.res.oracle0000666000000000000000000000553013571573400020420 0ustar [kernel] Parsing tests/slicing/bts345.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at call_top [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/slicing/bts345.i:27: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva] computing for function top <- call_top. Called from tests/slicing/bts345.i:28. [eva:alarm] tests/slicing/bts345.i:21: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_by_top <- top <- call_top. Called from tests/slicing/bts345.i:22. [eva:alarm] tests/slicing/bts345.i:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_indirectly_by_top <- called_by_top <- top <- call_top. Called from tests/slicing/bts345.i:16. [eva:alarm] tests/slicing/bts345.i:10: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for called_indirectly_by_top [eva] Done for function called_indirectly_by_top [eva] Recording results for called_by_top [eva] Done for function called_by_top [eva] Recording results for top [eva] Done for function top [eva] Recording results for call_top [eva] done for function call_top [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function top [from] Computing for function called_by_top [from] Computing for function called_indirectly_by_top <-called_by_top [from] Done for function called_indirectly_by_top [from] Done for function called_by_top [pdg] done for function top [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function call_top [from] Computing for function top [from] Done for function top [pdg] done for function call_top [pdg] computing for function called_by_top [pdg] done for function called_by_top [pdg] computing for function called_indirectly_by_top [pdg] done for function called_indirectly_by_top [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int called_indirectly_by_top_slice_1(int x) { x ++; return x; } int called_by_top_slice_1(int x) { x ++; int z = called_indirectly_by_top_slice_1(x); return z; } int top_slice_1(int x) { x ++; int z = called_by_top_slice_1(x); return z; } void call_top(int y) { y ++; top_slice_1(y); return; } [kernel] Parsing tests/slicing/result/ocode_2_bts345.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts345.3.res.oracle0000666000000000000000000000476313571573400020430 0ustar [kernel] Parsing tests/slicing/bts345.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at top [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:initial-state] creating variable S_0_S___va_params with imprecise size (type void) [eva:initial-state] creating variable S_1_S___va_params with imprecise size (type void) [eva:alarm] tests/slicing/bts345.i:21: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_by_top <- top. Called from tests/slicing/bts345.i:22. [eva:alarm] tests/slicing/bts345.i:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_indirectly_by_top <- called_by_top <- top. Called from tests/slicing/bts345.i:16. [eva:alarm] tests/slicing/bts345.i:10: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for called_indirectly_by_top [eva] Done for function called_indirectly_by_top [eva] Recording results for called_by_top [eva] Done for function called_by_top [eva] Recording results for top [eva] done for function top [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function called_by_top [from] Computing for function called_indirectly_by_top [from] Done for function called_indirectly_by_top [pdg] done for function called_by_top [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function top [from] Computing for function called_by_top [from] Done for function called_by_top [pdg] done for function top [pdg] computing for function called_indirectly_by_top [pdg] done for function called_indirectly_by_top [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int called_indirectly_by_top_slice_1(int x) { x ++; return x; } int called_by_top_slice_1(int x) { x ++; int z = called_indirectly_by_top_slice_1(x); return z; } void top(int x) { x ++; called_by_top_slice_1(x); return; } [kernel] Parsing tests/slicing/result/ocode_3_bts345.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts345.4.res.oracle0000666000000000000000000000547713571573400020434 0ustar [kernel] Parsing tests/slicing/bts345.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at call_top [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/slicing/bts345.i:27: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva] computing for function top <- call_top. Called from tests/slicing/bts345.i:28. [eva:alarm] tests/slicing/bts345.i:21: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_by_top <- top <- call_top. Called from tests/slicing/bts345.i:22. [eva:alarm] tests/slicing/bts345.i:15: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] computing for function called_indirectly_by_top <- called_by_top <- top <- call_top. Called from tests/slicing/bts345.i:16. [eva:alarm] tests/slicing/bts345.i:10: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for called_indirectly_by_top [eva] Done for function called_indirectly_by_top [eva] Recording results for called_by_top [eva] Done for function called_by_top [eva] Recording results for top [eva] Done for function top [eva] Recording results for call_top [eva] done for function call_top [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function called_by_top [from] Computing for function called_indirectly_by_top [from] Done for function called_indirectly_by_top [pdg] done for function called_by_top [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function top [from] Computing for function called_by_top [from] Done for function called_by_top [pdg] done for function top [pdg] computing for function called_indirectly_by_top [pdg] done for function called_indirectly_by_top [pdg] computing for function call_top [from] Computing for function top [from] Done for function top [pdg] done for function call_top [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int called_indirectly_by_top_slice_1(int x) { x ++; return x; } int called_by_top_slice_1(int x) { x ++; int z = called_indirectly_by_top_slice_1(x); return z; } void top_slice_1(int x) { x ++; called_by_top_slice_1(x); return; } void call_top(int y) { y ++; top_slice_1(y); return; } [kernel] Parsing tests/slicing/result/ocode_4_bts345.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts679.res.oracle0000666000000000000000000000302613571573400020270 0ustar [kernel] Parsing tests/slicing/bts679.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {1} [eva] computing for function f <- main. Called from tests/slicing/bts679.i:7. [eva] Recording results for f [eva] Done for function f [eva] tests/slicing/bts679.i:8: cannot evaluate ACSL term, \at() on a C label is unsupported [eva:alarm] tests/slicing/bts679.i:8: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [eva] tests/slicing/bts679.i:8: assertion got final status valid. [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X = 1; int main(void) { return X; } [kernel] Parsing tests/slicing/result/ocode_0_bts679.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts679b.res.oracle0000666000000000000000000000262713571573400020440 0ustar [kernel] Parsing tests/slicing/bts679b.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {1} [eva] tests/slicing/bts679b.i:11: cannot evaluate ACSL term, \at() on a C label is unsupported [eva:alarm] tests/slicing/bts679b.i:11: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [eva] tests/slicing/bts679b.i:11: assertion got final status valid. [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X = 1; void main(void) { int y; L: y = 0; X ++; /*@ assert X > \at(X,L); */ ; return; } [kernel] Parsing tests/slicing/result/ocode_0_bts679b.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts709.res.oracle0000666000000000000000000000773713571573400020277 0ustar [kernel] Parsing tests/slicing/bts709.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization inp1 IN {0} var1 IN {0} var2 IN {0} [eva] computing for function inputsOf_testcase_func <- main. Called from tests/slicing/bts709.c:47. [eva] computing for function nondet_int <- inputsOf_testcase_func <- main. Called from tests/slicing/bts709.c:55. [kernel:annot:missing-spec] tests/slicing/bts709.c:55: Warning: Neither code nor specification for function nondet_int, generating default assigns from the prototype [eva] using specification for function nondet_int [eva] Done for function nondet_int [eva] computing for function nondet_int <- inputsOf_testcase_func <- main. Called from tests/slicing/bts709.c:56. [eva] Done for function nondet_int [eva] computing for function nondet_int <- inputsOf_testcase_func <- main. Called from tests/slicing/bts709.c:57. [eva] Done for function nondet_int [eva] Recording results for inputsOf_testcase_func [eva] Done for function inputsOf_testcase_func [eva] computing for function func <- main. Called from tests/slicing/bts709.c:48. [eva] computing for function __FC_assert <- func <- main. Called from tests/slicing/bts709.c:38. [eva] using specification for function __FC_assert [eva:alarm] tests/slicing/bts709.c:38: Warning: function __FC_assert: precondition 'nonnull_c' got status unknown. [eva] Done for function __FC_assert [eva] Recording results for func [eva] Done for function func [eva] tests/slicing/bts709.c:46: starting to merge loop iterations [eva] tests/slicing/bts709.c:47: Reusing old results for call to inputsOf_testcase_func [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function func [from] Computing for function __FC_assert [from] Done for function __FC_assert [pdg] done for function func [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function inputsOf_testcase_func [from] Computing for function nondet_int <-inputsOf_testcase_func [from] Done for function nondet_int [from] Done for function inputsOf_testcase_func [from] Computing for function func [from] Done for function func [pdg] done for function main [pdg] computing for function inputsOf_testcase_func [pdg] done for function inputsOf_testcase_func [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ #include "assert.h" void inputsOf_testcase_func_slice_1(void); int inp1; int var1; int var2; void func_slice_1(void) { if (1 == inp1) { var1 = 1; var2 = 1; } else if (2 == inp1) { var1 = 2; var2 = 2; } else if (3 == inp1) { var1 = 3; var2 = 3; } /*@ slice pragma stmt; */ if (65 != var2) __FC_assert((5 != var1) != 0,"tests/slicing/bts709.c",38, "5 != var1"); return; } void main(void) { int _noOfIter_; _noOfIter_ = 0; while (_noOfIter_ < 1) { inputsOf_testcase_func_slice_1(); func_slice_1(); _noOfIter_ ++; } return; } int nondet_int(void); void inputsOf_testcase_func_slice_1(void) { inp1 = nondet_int(); var1 = nondet_int(); var2 = nondet_int(); return; } [kernel] Parsing tests/slicing/result/ocode_0_bts709.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/result/ocode_0_bts709.i:25: Warning: Calling undeclared function __FC_assert. Old style K&R code? frama-c-20.0-Calcium/tests/slicing/oracle/bts808.res.oracle0000666000000000000000000000363113571573400020264 0ustar [kernel] Parsing tests/slicing/bts808.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f0 <- main. Called from tests/slicing/bts808.i:21. [eva] Recording results for f0 [eva] Done for function f0 [eva] computing for function f1 <- main. Called from tests/slicing/bts808.i:21. [eva] Recording results for f1 [eva] Done for function f1 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f0 [from] Done for function f0 [from] Computing for function f1 [from] Done for function f1 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f1 [pdg] done for function f1 [pdg] computing for function f0 [pdg] done for function f0 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int f0_slice_1(void) { int x; if (0) L: x ++; else { x = 0; goto L; } return x; } int f1_slice_1(void) { int x; if (1) { x = 1; goto L; } else L: x ++; return x; } int main(void) { int __retres; int tmp; int tmp_0; tmp = f0_slice_1(); tmp_0 = f1_slice_1(); __retres = tmp + tmp_0; return __retres; } [kernel] Parsing tests/slicing/result/ocode_0_bts808.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/bts827.res.oracle0000666000000000000000000000273613571573400020272 0ustar [kernel] Parsing tests/slicing/bts827.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/bts827.i:16. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int f_slice_1(void) { int __retres; G = 3; __retres = 5; return __retres; } int main(void) { int tmp; tmp = f_slice_1(); G += tmp; return G; } [kernel] Parsing tests/slicing/result/ocode_0_bts827.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/call_accuracy.res.oracle0000666000000000000000000002710613571573400022024 0ustar [kernel] Parsing tests/slicing/call_accuracy.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S1 ∈ {0} S2 ∈ {0} S3 ∈ {0} S4 ∈ {0} [eva] computing for function test_struct <- main. Called from tests/slicing/call_accuracy.i:62. [eva] Recording results for test_struct [from] Computing for function test_struct [from] Done for function test_struct [eva] Done for function test_struct [eva] computing for function test_cond <- main. Called from tests/slicing/call_accuracy.i:63. [eva:alarm] tests/slicing/call_accuracy.i:11: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:12: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:13: Warning: signed overflow. assert z + 1 ≤ 2147483647; [eva] computing for function f_cond <- test_cond <- main. Called from tests/slicing/call_accuracy.i:14. [eva:alarm] tests/slicing/call_accuracy.i:5: Warning: signed overflow. assert a + 1 ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:6: Warning: signed overflow. assert b + 1 ≤ 2147483647; [eva] Recording results for f_cond [from] Computing for function f_cond [from] Done for function f_cond [eva] Done for function f_cond [eva:alarm] tests/slicing/call_accuracy.i:15: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:16: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:17: Warning: signed overflow. assert z + 1 ≤ 2147483647; [eva] computing for function f_cond <- test_cond <- main. Called from tests/slicing/call_accuracy.i:18. [eva] Recording results for f_cond [from] Computing for function f_cond [from] Done for function f_cond [eva] Done for function f_cond [eva] Recording results for test_cond [from] Computing for function test_cond [from] Done for function test_cond [eva] Done for function test_cond [eva] computing for function test_set <- main. Called from tests/slicing/call_accuracy.i:64. [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:32. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:33. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:34. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:35. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:36. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:37. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:38. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:39. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:40. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:41. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:42. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:43. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:44. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva] computing for function f_set <- test_set <- main. Called from tests/slicing/call_accuracy.i:45. [eva] Recording results for f_set [from] Computing for function f_set [from] Done for function f_set [eva] Done for function f_set [eva:alarm] tests/slicing/call_accuracy.i:49: Warning: signed overflow. assert -2147483648 ≤ b + s1.b; [eva:alarm] tests/slicing/call_accuracy.i:49: Warning: signed overflow. assert b + s1.b ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:49: Warning: signed overflow. assert (int)(b + s1.b) + s3.b ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:49: Warning: signed overflow. assert -2147483648 ≤ (int)((int)(b + s1.b) + s3.b) + tab[1]; [eva:alarm] tests/slicing/call_accuracy.i:49: Warning: signed overflow. assert (int)((int)(b + s1.b) + s3.b) + tab[1] ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:49: Warning: signed overflow. assert -2147483648 ≤ (int)((int)((int)(b + s1.b) + s3.b) + tab[1]) + S1.b; [eva:alarm] tests/slicing/call_accuracy.i:49: Warning: signed overflow. assert (int)((int)((int)(b + s1.b) + s3.b) + tab[1]) + S1.b ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:49: Warning: signed overflow. assert -2147483648 ≤ (int)((int)((int)((int)(b + s1.b) + s3.b) + tab[1]) + S1.b) + S2.b; [eva:alarm] tests/slicing/call_accuracy.i:49: Warning: signed overflow. assert (int)((int)((int)((int)(b + s1.b) + s3.b) + tab[1]) + S1.b) + S2.b ≤ 2147483647; [eva] Recording results for test_set [from] Computing for function test_set [from] Done for function test_set [eva] Done for function test_set [eva:alarm] tests/slicing/call_accuracy.i:65: Warning: signed overflow. assert r1 + r2 ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:65: Warning: signed overflow. assert -2147483648 ≤ (int)(r1 + r2) + r3; [eva:alarm] tests/slicing/call_accuracy.i:65: Warning: signed overflow. assert (int)(r1 + r2) + r3 ≤ 2147483647; [eva:alarm] tests/slicing/call_accuracy.i:65: Warning: signed overflow. assert (int)((int)(r1 + r2) + r3) + S3.b ≤ 2147483647; [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f_cond at tests/slicing/call_accuracy.i:14 (by test_cond): \result FROM c; a [from] call to f_cond at tests/slicing/call_accuracy.i:18 (by test_cond): \result FROM c; b [from] call to f_set at tests/slicing/call_accuracy.i:32 (by test_set): a FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:33 (by test_set): b FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:34 (by test_set): s1.a FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:35 (by test_set): s1.b FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:36 (by test_set): s2.a FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:37 (by test_set): s2.b FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:38 (by test_set): s3.a FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:39 (by test_set): tab[0] FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:40 (by test_set): tab[1] FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:41 (by test_set): tab[2] FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:42 (by test_set): S1.a FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:43 (by test_set): S1.b FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:44 (by test_set): S2.a FROM p; v [from] call to f_set at tests/slicing/call_accuracy.i:45 (by test_set): S2.b FROM p; v [from] call to test_struct at tests/slicing/call_accuracy.i:62 (by main): S1 FROM \nothing S2 FROM \nothing \result FROM \nothing [from] call to test_cond at tests/slicing/call_accuracy.i:63 (by main): \result FROM x [from] call to test_set at tests/slicing/call_accuracy.i:64 (by main): S1.a FROM x .b FROM y S2.a FROM x .b FROM y S3 FROM \nothing S4.a FROM \nothing \result FROM y [from] entry point: S1.a FROM x .b FROM y S2.a FROM x .b FROM y S3 FROM \nothing S4.a FROM \nothing \result FROM S4.b; x; y [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function test_set [pdg] done for function test_set [pdg] computing for function f_set [pdg] done for function f_set [pdg] computing for function test_cond [pdg] done for function test_cond [pdg] computing for function f_cond [pdg] done for function f_cond [pdg] computing for function test_struct [pdg] done for function test_struct [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct st { int a ; int b ; }; int f_cond_slice_1(int c, int a, int b) { int tmp; a ++; b ++; if (c) tmp = a; else tmp = b; return tmp; } int test_cond_slice_1(int x, int y, int z) { int tmp; x ++; y ++; z = f_cond_slice_1(1,x,y); y ++; z ++; tmp = f_cond_slice_1(0,y,z); return tmp; } void f_set_slice_1(int *p, int v) { *p = v; return; } struct st S1; struct st S2; struct st S3; struct st S4; int test_set_slice_1(int y) { int __retres; int b; struct st s1; int tab[5]; struct st s3 = {.a = 1, .b = 2}; f_set_slice_1(& b,y); f_set_slice_1(& s1.b,y); f_set_slice_1(& tab[1],y); f_set_slice_1(& S1.b,y); f_set_slice_1(& S2.b,y); S3.b = 2; __retres = ((((b + s1.b) + s3.b) + tab[1]) + S1.b) + S2.b; return __retres; } int test_struct_slice_1(void) { int __retres; S1.a = 1; S1.b = 2; S2 = S1; __retres = S2.b; return __retres; } int main(int x, int y, int z) { int __retres; int r1 = test_struct_slice_1(); int r2 = test_cond_slice_1(x,y,z); int r3 = test_set_slice_1(y); __retres = (((r1 + r2) + r3) + S3.b) + S4.b; return __retres; } [kernel] Parsing tests/slicing/result/ocode_0_call_accuracy.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/call_demo.0.res.oracle0000666000000000000000000000552313571573400021313 0ustar [kernel] Parsing tests/slicing/call_demo.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva] Recording results for oper [eva] Done for function oper [eva] tests/slicing/call_demo.i:22: starting to merge loop iterations [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva] Recording results for oper [eva] Done for function oper [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva] Recording results for oper [eva] Done for function oper [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva:alarm] tests/slicing/call_demo.i:13: Warning: signed overflow. assert *s + i ≤ 2147483647; [eva:alarm] tests/slicing/call_demo.i:14: Warning: signed overflow. assert *p * i ≤ 2147483647; [eva] Recording results for oper [eva] Done for function oper [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva] Recording results for oper [eva] Done for function oper [eva] computing for function call1 <- main. Called from tests/slicing/call_demo.i:25. [eva] using specification for function call1 [eva] Done for function call1 [eva] computing for function call2 <- main. Called from tests/slicing/call_demo.i:26. [eva] using specification for function call2 [eva] Done for function call2 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function oper [from] Done for function oper [from] Computing for function call1 [from] Done for function call1 [from] Computing for function call2 [from] Done for function call2 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function oper [pdg] done for function oper [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int call1(int v); void oper_slice_1(int *s, int i) { *s += i; return; } void main(int n) { int i; int sum = 0; i = 0; while (i < n) { oper_slice_1(& sum,i); i ++; } call1(sum); return; } [kernel] Parsing tests/slicing/result/ocode_0_call_demo.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/call_demo.1.res.oracle0000666000000000000000000000553713571573400021321 0ustar [kernel] Parsing tests/slicing/call_demo.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva] Recording results for oper [eva] Done for function oper [eva] tests/slicing/call_demo.i:22: starting to merge loop iterations [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva] Recording results for oper [eva] Done for function oper [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva] Recording results for oper [eva] Done for function oper [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva:alarm] tests/slicing/call_demo.i:13: Warning: signed overflow. assert *s + i ≤ 2147483647; [eva:alarm] tests/slicing/call_demo.i:14: Warning: signed overflow. assert *p * i ≤ 2147483647; [eva] Recording results for oper [eva] Done for function oper [eva] computing for function oper <- main. Called from tests/slicing/call_demo.i:23. [eva] Recording results for oper [eva] Done for function oper [eva] computing for function call1 <- main. Called from tests/slicing/call_demo.i:25. [eva] using specification for function call1 [eva] Done for function call1 [eva] computing for function call2 <- main. Called from tests/slicing/call_demo.i:26. [eva] using specification for function call2 [eva] Done for function call2 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function oper [from] Done for function oper [from] Computing for function call1 [from] Done for function call1 [from] Computing for function call2 [from] Done for function call2 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function oper [pdg] done for function oper [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int call2(int v); void oper_slice_1(int *p, int i) { *p *= i; return; } void main(int n) { int i; int product = 1; i = 0; while (i < n) { oper_slice_1(& product,i); i ++; } call2(product); return; } [kernel] Parsing tests/slicing/result/ocode_1_call_demo.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/callwise.res.oracle0000666000000000000000000001546413571573400021046 0ustar [kernel] Parsing tests/slicing/callwise.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {1} b ∈ {1} c ∈ {1} d ∈ {1} p ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/callwise.i:39. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/slicing/callwise.i:40. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function choose <- main. Called from tests/slicing/callwise.i:42. [eva] Recording results for choose [from] Computing for function choose [from] Done for function choose [eva] Done for function choose [eva] computing for function choose <- main. Called from tests/slicing/callwise.i:43. [eva] Recording results for choose [from] Computing for function choose [from] Done for function choose [eva] Done for function choose [eva] computing for function fs163_main <- main. Called from tests/slicing/callwise.i:45. [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:24. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:25. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:26. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:27. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:28. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:30. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva] tests/slicing/callwise.i:29: starting to merge loop iterations [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:30. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:30. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:30. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva] computing for function fs163_f <- fs163_main <- main. Called from tests/slicing/callwise.i:30. [eva] Recording results for fs163_f [from] Computing for function fs163_f [from] Done for function fs163_f [eva] Done for function fs163_f [eva:alarm] tests/slicing/callwise.i:32: Warning: accessing uninitialized left-value. assert \initialized(&T[3]); [eva] Recording results for fs163_main [from] Computing for function fs163_main [from] Done for function fs163_main [eva] Done for function fs163_main [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to fs163_f at tests/slicing/callwise.i:24 (by fs163_main): A FROM p_0; n [from] call to fs163_f at tests/slicing/callwise.i:25 (by fs163_main): B FROM p_0; n [from] call to fs163_f at tests/slicing/callwise.i:26 (by fs163_main): C FROM p_0; n [from] call to fs163_f at tests/slicing/callwise.i:27 (by fs163_main): T[0] FROM p_0; n [from] call to fs163_f at tests/slicing/callwise.i:28 (by fs163_main): T[1] FROM p_0; n [from] call to fs163_f at tests/slicing/callwise.i:30 (by fs163_main): T[0..4] FROM p_0; n (and SELF) [from] call to f at tests/slicing/callwise.i:39 (by main): a FROM a; b; p_0; q [from] call to f at tests/slicing/callwise.i:40 (by main): c FROM c; d; p_0; q [from] call to choose at tests/slicing/callwise.i:42 (by main): \result FROM cond; y [from] call to choose at tests/slicing/callwise.i:43 (by main): \result FROM cond; x [from] call to fs163_main at tests/slicing/callwise.i:45 (by main): \result FROM \nothing [from] entry point: a FROM a; b b FROM \nothing c FROM c; d \result FROM a; b [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function fs163_main [pdg] done for function fs163_main [pdg] computing for function fs163_f [pdg] done for function fs163_f [pdg] computing for function choose [pdg] done for function choose [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int a = 1; int b = 1; void f_slice_1(int *p_0, int *q) { *p_0 += *q; return; } int choose_slice_1(int cond, int x, int y) { int tmp; if (cond) tmp = x; else tmp = y; return tmp; } void fs163_f_slice_1(int *p_0, int n) { *p_0 = n; return; } int fs163_main_slice_1(void) { int __retres; int T[5]; { int i = 0; while (i < 5) { fs163_f_slice_1(& T[i],i); i ++; } } __retres = T[3]; return __retres; } int main(void) { int tmp; int tmp_0; int n = 2; int m = 3; f_slice_1(& a,& b); tmp = choose_slice_1(1,n,m); a += tmp; tmp_0 = fs163_main_slice_1(); a += tmp_0; return a; } [kernel] Parsing tests/slicing/result/ocode_0_callwise.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/combine.res.oracle0000666000000000000000000001403613571573400020651 0ustar [kernel] Parsing tests/slicing/combine.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/slicing/combine.i:24. [eva] computing for function g <- f <- main. Called from tests/slicing/combine.i:17. [eva] using specification for function g [eva] Done for function g [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/slicing/combine.i:26. [eva] computing for function g <- f <- main. Called from tests/slicing/combine.i:17. [eva] Done for function g [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [from] Computing for function f [from] Computing for function g <-f [from] Done for function g [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: \result FROM x [from] Function f: \result FROM c; x [from] Function main: \result FROM x [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int g(int x); int f_slice_1(int c, int x) { int tmp; int r; if (c) tmp = 1; else tmp = -1; int y = tmp; if (y < 0) r = x + y; else r = 0; r = g(r); return r; } int main(int x) { int r; if (x > 0) r = f_slice_1(0,x); else r = f_slice_1(1,x); return r; } Let's split 'f': [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'slicing_result'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'slicing_result tmp' [sparecode] removed unused global declarations in new project 'slicing_result' After Slicing : /* Generated by Frama-C */ int g(int x); int f_s_2(int c, int x) { int tmp; int r; if (c) tmp = 1; else tmp = -1; int y = tmp; if (y < 0) r = x + y; else r = 0; r = g(r); return r; } int f(int c, int x) { int tmp; int r; if (c) tmp = 1; else tmp = -1; int y = tmp; if (y < 0) r = x + y; else r = 0; r = g(r); return r; } int main(int x) { int r; if (x > 0) r = f(0,x); else r = f_s_2(1,x); return r; } [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/slicing/combine.i:24. [eva] computing for function g <- f <- main. Called from tests/slicing/combine.i:17. [kernel:annot:missing-spec] tests/slicing/combine.i:17: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] Recording results for f [eva] Done for function f [eva] computing for function f_s_2 <- main. Called from tests/slicing/combine.i:26. [eva] computing for function g <- f_s_2 <- main. Called from tests/slicing/combine.i:17. [eva] Done for function g [eva] Recording results for f_s_2 [eva] Done for function f_s_2 [eva] Recording results for main [eva] done for function main After Constant propagation : /* Generated by Frama-C */ /*@ assigns \result; assigns \result \from x; */ int g(int x); int f_s_2(int c, int x) { int tmp; int r; if (1) tmp = 1; else tmp = -1; int y = 1; if (0) r = x + y; else r = 0; r = g(0); return r; } int f(int c, int x) { int tmp; int r; if (0) tmp = 1; else tmp = -1; int y = -1; if (1) r = x + -1; else r = 0; r = g(r); return r; } int main(int x) { int r; if (x > 0) r = f(0,x); else r = f_s_2(1,x); return r; } [sparecode] remove unused code... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/slicing/combine.i:24. [eva] computing for function g <- f <- main. Called from tests/slicing/combine.i:17. [eva] using specification for function g [eva] Done for function g [eva] Recording results for f [eva] Done for function f [eva] computing for function f_s_2 <- main. Called from tests/slicing/combine.i:26. [eva] computing for function g <- f_s_2 <- main. Called from tests/slicing/combine.i:17. [eva] Done for function g [eva] Recording results for f_s_2 [eva] Done for function f_s_2 [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function f [from] Computing for function g <-f [from] Done for function g [from] Done for function f [from] Computing for function f_s_2 [from] Done for function f_s_2 [pdg] done for function main [pdg] computing for function f_s_2 [pdg] done for function f_s_2 [pdg] computing for function f [pdg] done for function f [pdg] computing for function g [pdg] done for function g [sparecode] remove unused global declarations... [sparecode] result in new project 'propagated without sparecode'. After Sparecode : /* Generated by Frama-C */ /*@ assigns \result; assigns \result \from x; */ int g(int x); int f_s_2(void) { int r; r = g(0); return r; } int f(int x) { int r; r = x + -1; r = g(r); return r; } int main(int x) { int r; if (x > 0) r = f(x); else r = f_s_2(); return r; } frama-c-20.0-Calcium/tests/slicing/oracle/csmith.0.res.oracle0000666000000000000000000002216513571573400020664 0ustar [kernel] Parsing tests/slicing/csmith.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} G1b ∈ {0} G2 ∈ {0} [eva] computing for function f1 <- main. Called from tests/slicing/csmith.i:234. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f1b <- main. Called from tests/slicing/csmith.i:235. [eva] Recording results for f1b [eva] Done for function f1b [eva] computing for function f2 <- main. Called from tests/slicing/csmith.i:236. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function bts181 <- main. Called from tests/slicing/csmith.i:237. [eva] Recording results for bts181 [eva] Done for function bts181 [eva] computing for function bts181b <- main. Called from tests/slicing/csmith.i:238. [eva] Recording results for bts181b [eva] Done for function bts181b [eva] computing for function bts807 <- main. Called from tests/slicing/csmith.i:239. [eva] Recording results for bts807 [eva] Done for function bts807 [eva] computing for function bts809 <- main. Called from tests/slicing/csmith.i:240. [eva] Recording results for bts809 [eva] Done for function bts809 [eva] computing for function bts879 <- main. Called from tests/slicing/csmith.i:241. [eva] Recording results for bts879 [eva] Done for function bts879 [eva] computing for function bts879b <- main. Called from tests/slicing/csmith.i:242. [eva] Recording results for bts879b [eva] Done for function bts879b [eva] computing for function bts899 <- main. Called from tests/slicing/csmith.i:243. [eva] tests/slicing/csmith.i:135: starting to merge loop iterations [eva:alarm] tests/slicing/csmith.i:141: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for bts899 [eva] Done for function bts899 [eva:alarm] tests/slicing/csmith.i:243: Warning: signed overflow. assert x + tmp_5 ≤ 2147483647; (tmp_5 from bts899()) [eva] computing for function bts906 <- main. Called from tests/slicing/csmith.i:244. [eva] tests/slicing/csmith.i:149: starting to merge loop iterations [eva] tests/slicing/csmith.i:150: starting to merge loop iterations [eva] Recording results for bts906 [eva] Done for function bts906 [eva:alarm] tests/slicing/csmith.i:244: Warning: signed overflow. assert x + tmp_6 ≤ 2147483647; (tmp_6 from bts906()) [eva] computing for function bts906b <- main. Called from tests/slicing/csmith.i:245. [eva] tests/slicing/csmith.i:168: starting to merge loop iterations [eva] tests/slicing/csmith.i:169: starting to merge loop iterations [eva] Recording results for bts906b [eva] Done for function bts906b [eva:alarm] tests/slicing/csmith.i:245: Warning: signed overflow. assert x + tmp_7 ≤ 2147483647; (tmp_7 from bts906b()) [eva] computing for function bts963 <- main. Called from tests/slicing/csmith.i:247. [eva] tests/slicing/csmith.i:211: starting to merge loop iterations [eva] Recording results for bts963 [eva] Done for function bts963 [eva:alarm] tests/slicing/csmith.i:247: Warning: signed overflow. assert x + tmp_8 ≤ 2147483647; (tmp_8 from bts963()) [eva] computing for function bts963b <- main. Called from tests/slicing/csmith.i:248. [eva] tests/slicing/csmith.i:223: starting to merge loop iterations [eva] Recording results for bts963b [eva] Done for function bts963b [eva:alarm] tests/slicing/csmith.i:248: Warning: signed overflow. assert x + tmp_9 ≤ 2147483647; (tmp_9 from bts963b()) [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f1b [from] Done for function f1b [from] Computing for function f2 [from] Done for function f2 [from] Computing for function bts181 [from] Done for function bts181 [from] Computing for function bts181b [from] Done for function bts181b [from] Computing for function bts807 [from] Done for function bts807 [from] Computing for function bts809 [from] Done for function bts809 [from] Computing for function bts879 [from] Done for function bts879 [from] Computing for function bts879b [from] Done for function bts879b [from] Computing for function bts899 [from] Done for function bts899 [from] Computing for function bts906 [from] Done for function bts906 [from] Computing for function bts906b [from] Done for function bts906b [from] Computing for function bts963 [from] Done for function bts963 [from] Computing for function bts963b [from] Done for function bts963b [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function bts963b [pdg] done for function bts963b [pdg] computing for function bts963 [pdg] done for function bts963 [pdg] computing for function bts906b [pdg] done for function bts906b [pdg] computing for function bts906 [pdg] done for function bts906 [pdg] computing for function bts899 [pdg] done for function bts899 [pdg] computing for function bts879b [pdg] done for function bts879b [pdg] computing for function bts879 [pdg] done for function bts879 [pdg] computing for function bts809 [pdg] done for function bts809 [pdg] computing for function bts807 [pdg] done for function bts807 [pdg] computing for function bts181b [pdg] done for function bts181b [pdg] computing for function bts181 [pdg] done for function bts181 [pdg] computing for function f2 [pdg] done for function f2 [pdg] computing for function f1b [pdg] done for function f1b [pdg] computing for function f1 [pdg] done for function f1 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G1; void f1_slice_1(void) { G1 = 3; goto break_cont_1; break_cont_1: return; } int G1b; void f1b_slice_1(void) { G1b = 3; goto B; B: ; return; } int G2; void f2_slice_1(void) { while (1) { G2 = 3; break; } return; } int bts181_slice_1(int c) { int y = 0; if (c) y = 3; return y; } int bts181b_slice_1(int c) { int y = 0; if (c) y = 3; return y; } int bts807_slice_1(void) { int __retres; int g; if (1) goto _LOR; else { _LOR: ; g = 21; __retres = g; goto return_label; } return_label: return __retres; } int bts809_slice_1(void) { int __retres; int x; x = 10; goto L; L: ; __retres = x; goto return_label; return_label: return __retres; } int bts879_slice_1(int c) { int __retres; int tmp; if (c) tmp = 0; else tmp = 10; int p = tmp; if (p) goto _LOR; else if (0) { _LOR: { __retres = 1; goto return_label; } } __retres = 0; return_label: return __retres; } int bts879b_slice_1(int c) { int __retres; int tmp; if (c) tmp = 0; else tmp = 10; int p = tmp; if (p) { __retres = 1; goto return_label; } __retres = 0; return_label: return __retres; } int bts899_slice_1(void) { int x = 254; { int i = 17; while (i != -9) { if (! i) goto __Cont; x ++; __Cont: i --; } } return x; } int bts906_slice_1(void) { int __retres; int x = 0; int i = 2; while (1) { if (! i) { x ++; __retres = x; goto return_label; } B: i --; } return_label: return __retres; } int bts906b_slice_1(void) { int __retres; int x = 0; int i = 2; while (1) { if (! i) { x ++; __retres = x; goto return_label; } B: i --; } return_label: return __retres; } int bts963_slice_1(void) { int __retres; int x = 0; L: ; x ++; if (x < 3) goto L; else { __retres = x; goto return_label; } return_label: return __retres; } int bts963b_slice_1(void) { int __retres; int x = 0; L: ; x ++; if (x < 3) goto L; else { __retres = x; goto return_label; } return_label: return __retres; } int main(int n) { int tmp; int tmp_0; int tmp_1; int tmp_2; int tmp_3; int tmp_4; int tmp_5; int tmp_6; int tmp_7; int tmp_8; int tmp_9; int x = 0; f1_slice_1(); x += G1; f1b_slice_1(); x += G1b; f2_slice_1(); x += G2; tmp = bts181_slice_1(n); x += tmp; tmp_0 = bts181b_slice_1(n); x += tmp_0; tmp_1 = bts807_slice_1(); x += tmp_1; tmp_2 = bts809_slice_1(); x += tmp_2; tmp_3 = bts879_slice_1(n); x += tmp_3; tmp_4 = bts879b_slice_1(n); x += tmp_4; tmp_5 = bts899_slice_1(); x += tmp_5; tmp_6 = bts906_slice_1(); x += tmp_6; tmp_7 = bts906b_slice_1(); x += tmp_7; tmp_8 = bts963_slice_1(); x += tmp_8; tmp_9 = bts963b_slice_1(); x += tmp_9; return x; } [kernel] Parsing tests/slicing/result/ocode_0_csmith.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/csmith.1.res.oracle0000666000000000000000000000633513571573400020666 0ustar [kernel] Parsing tests/slicing/csmith.i (no preprocessing) [eva] Analyzing a complete application starting at bts906b [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} G1b ∈ {0} G2 ∈ {0} [eva] tests/slicing/csmith.i:168: starting to merge loop iterations [eva] tests/slicing/csmith.i:169: starting to merge loop iterations [eva] Recording results for bts906b [eva] done for function bts906b [pdg] computing for function bts906b [pdg] done for function bts906b [pdg] PDG for bts906b {n1}: InCtrl {n2}: VarDecl : x {n3}: VarDecl : i {n4}: VarDecl : __retres {n5}: int x = 0; -[-c-]-> 1 -[a--]-> 2 {n6}: int i = 2; -[-c-]-> 1 -[a--]-> 3 {n7}: x -[-c-]-> 1 -[--d]-> 2 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n8}: goto B; -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n9}: B: -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n10}: while(1) -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n11}: i >= 0 -[-c-]-> 1 -[--d]-> 3 -[--d]-> 6 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[--d]-> 17 -[-c-]-> 20 -[-c-]-> 22 {n12}: block -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n13}: while(1) -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n14}: block -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n15}: i -[-c-]-> 1 -[--d]-> 3 -[--d]-> 6 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[--d]-> 17 -[-c-]-> 20 -[-c-]-> 22 {n16}: goto B; -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n17}: B: i --; -[-c-]-> 1 -[a-d]-> 3 -[--d]-> 6 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[--d]-> 17 -[-c-]-> 20 -[-c-]-> 22 {n18}: x ++; -[-c-]-> 1 -[a-d]-> 2 -[--d]-> 5 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n19}: break; -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n20}: block -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 {n21}: __retres = x; -[-c-]-> 1 -[--d]-> 2 -[a--]-> 4 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[--d]-> 18 -[-c-]-> 20 -[-c-]-> 22 {n22}: goto return_label; -[-c-]-> 1 -[-c-]-> 10 -[-c-]-> 12 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 -[-c-]-> 20 -[-c-]-> 22 -[-c-]-> 23 {n23}: return_label: -[-c-]-> 1 {n24}: return_label: return __retres; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 21 {n25}: OutRet -[--d]-> 24 frama-c-20.0-Calcium/tests/slicing/oracle/csmith.2.res.oracle0000666000000000000000000000547313571573400020671 0ustar [kernel] Parsing tests/slicing/csmith.i (no preprocessing) [eva] Analyzing a complete application starting at bts906c [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} G1b ∈ {0} G2 ∈ {0} [eva] tests/slicing/csmith.i:189: starting to merge loop iterations [eva] tests/slicing/csmith.i:190: starting to merge loop iterations [eva] Recording results for bts906c [eva] done for function bts906c [pdg] computing for function bts906c [pdg] done for function bts906c [pdg] PDG for bts906c {n1}: InCtrl {n2}: VarDecl : x {n3}: VarDecl : i {n4}: VarDecl : __retres {n5}: int x = 0; -[-c-]-> 1 -[a--]-> 2 {n6}: W: -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 20 -[-c-]-> 22 {n7}: goto W; -[-c-]-> 1 -[-c-]-> 6 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 20 -[-c-]-> 22 {n8}: int i = 2; -[-c-]-> 1 -[a--]-> 3 {n9}: while(1) -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 {n10}: i >= 0 -[-c-]-> 1 -[--d]-> 3 -[--d]-> 8 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 -[--d]-> 17 {n11}: block -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 {n12}: while(1) -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 {n13}: block -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 {n14}: i -[-c-]-> 1 -[--d]-> 3 -[--d]-> 8 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 -[--d]-> 17 {n15}: goto B; -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 16 {n16}: B: -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 {n17}: B: i --; -[-c-]-> 1 -[a-d]-> 3 -[--d]-> 8 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 -[--d]-> 17 {n18}: x ++; -[-c-]-> 1 -[a-d]-> 2 -[--d]-> 5 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 {n19}: break; -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 {n20}: block -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 {n21}: __retres = x; -[-c-]-> 1 -[--d]-> 2 -[a--]-> 4 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 -[--d]-> 18 -[-c-]-> 20 {n22}: goto return_label; -[-c-]-> 1 -[-c-]-> 9 -[-c-]-> 11 -[-c-]-> 13 -[-c-]-> 14 -[-c-]-> 15 -[-c-]-> 20 -[-c-]-> 23 {n23}: return_label: -[-c-]-> 1 {n24}: return_label: return __retres; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 21 {n25}: OutRet -[--d]-> 24 frama-c-20.0-Calcium/tests/slicing/oracle/ex_spec_interproc.res.oracle0000666000000000000000000004745713571573400022765 0ustar [kernel] Parsing tests/slicing/ex_spec_interproc.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} Y ∈ {0} Z ∈ {0} I ∈ {0} J ∈ {0} K ∈ {0} L ∈ {0} M ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/ex_spec_interproc.i:35. [eva] computing for function g <- f <- main. Called from tests/slicing/ex_spec_interproc.i:21. [eva] Recording results for g [eva] Done for function g [eva] computing for function g <- f <- main. Called from tests/slicing/ex_spec_interproc.i:22. [eva] Recording results for g [eva] Done for function g [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [from] Computing for function g [from] Done for function g [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: X FROM u Y FROM u; v \result FROM w [from] Function f: X FROM c Y FROM c; d Z FROM e \result FROM c [from] Function main: X FROM \nothing Y FROM \nothing Z FROM \nothing I FROM \nothing J FROM \nothing K FROM \nothing L FROM \nothing M FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function f [pdg] done for function f Slicing project worklist [default] = [f_slice_1 = (n:32(restrict to X) ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... int X; int Y; int Z; Print slice = f_slice_1: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In2: <[---], [ S ]>) (In3: <[--d], [ S ]>) (In4: <[---], [ S ]>) (In5: <[---], [ S ]>) (OutRet: <[--d], [---]>) /**/int f(/* <[---], [ S ]> */ int a, /* <[---], [ S ]> */ int b, /* <[--d], [ S ]> */ int c, /* <[---], [ S ]> */ int d, /* <[---], [ S ]> */ int e) { /* <[--d], [ S ]> */ int r; /* <[---], [ S ]> */ a ++; /* <[---], [ S ]> */ b ++; /* <[--d], [ S ]> */ c ++; /* <[---], [ S ]> */ d ++; /* <[---], [ S ]> */ e ++; /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In2: <[---], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [ S ]>) (Out(Y): <[---], [ S ]>) (Out(X): <[---], [ S ]>) */ /* call to source function */ /* <[--d], [ S ]> */ r = g(a,b,c); /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[--d], [ S ]>) (In2: <[---], [ S ]>) (In3: <[---], [ S ]>) (OutRet: <[---], [ S ]>) (Out(X): <[--d], [ S ]>) (Out(Y): <[---], [ S ]>) */ /* call to source function */ /* <[--d], [ S ]> */ Z = g(r,d,e); /* <[--d], [---]> */ return X; } int I; int J; int K; int L; int M; Slicing project worklist [default] = [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int X; int Y; int g(int u, int v, int w) { u ++; v ++; w ++; X = u; Y = u + v; return w; } int Z; int f_slice_1(int a, int b, int c, int d, int e) { int r; a ++; b ++; c ++; d ++; e ++; r = g(a,b,c); Z = g(r,d,e); return X; } [slicing] reinitializing slicing ... Slicing project worklist [default] = [f_slice_1 = (n:32(restrict to X) ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function g [pdg] done for function g int X; int Y; Print slice = g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In2: <[---], [ S ]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) /**/int g(/* <[---], [--d]> */ int u, /* <[---], [ S ]> */ int v, /* <[---], [--d]> */ int w) { /* <[---], [--d]> */ u ++; /* <[---], [ S ]> */ v ++; /* <[---], [--d]> */ w ++; /* <[---], [--d]> */ X = u; /* <[---], [ S ]> */ Y = u + v; /* <[---], [--d]> */ return w; } int Z; Print slice = f_slice_1: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In2: <[---], [ S ]>) (In3: <[--d], [ S ]>) (In4: <[---], [ S ]>) (In5: <[---], [ S ]>) (OutRet: <[--d], [---]>) /**/int f(/* <[---], [ S ]> */ int a, /* <[---], [ S ]> */ int b, /* <[--d], [ S ]> */ int c, /* <[---], [ S ]> */ int d, /* <[---], [ S ]> */ int e) { /* <[--d], [ S ]> */ int r; /* <[---], [ S ]> */ a ++; /* <[---], [ S ]> */ b ++; /* <[--d], [ S ]> */ c ++; /* <[---], [ S ]> */ d ++; /* <[---], [ S ]> */ e ++; /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In2: <[---], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [ S ]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In2: <[---], [ S ]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ r = g(a,b,c); /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[--d], [ S ]>) (In2: <[---], [ S ]>) (In3: <[---], [ S ]>) (Out(X): <[--d], [---]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In2: <[---], [ S ]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ Z = g(r,d,e); /* <[--d], [---]> */ return X; } int I; int J; int K; int L; int M; Slicing project worklist [default] = [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int X; int Y; int g_slice_1(int u, int v, int w) { u ++; v ++; w ++; X = u; Y = u + v; return w; } int f_slice_1(int a, int b, int c, int d, int e) { int r; a ++; b ++; c ++; d ++; e ++; r = g_slice_1(a,b,c); g_slice_1(r,d,e); return X; } [slicing] reinitializing slicing ... Slicing project worklist [default] = [f_slice_1 = (n:32(restrict to X) ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... int X; int Y; Print slice = g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) /**/int g(/* <[---], [--d]> */ int u, /* <[---], [---]> */ int v, /* <[---], [--d]> */ int w) { /* <[---], [--d]> */ u ++; /* <[---], [---]> */ v ++; /* <[---], [--d]> */ w ++; /* <[---], [--d]> */ X = u; /* <[---], [---]> */ Y = u + v; /* <[---], [--d]> */ return w; } int Z; Print slice = f_slice_1: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (In5: <[---], [ S ]>) (OutRet: <[--d], [---]>) /**/int f(/* <[---], [ S ]> */ int a, /* <[---], [---]> */ int b, /* <[--d], [ S ]> */ int c, /* <[---], [---]> */ int d, /* <[---], [ S ]> */ int e) { /* <[--d], [ S ]> */ int r; /* <[---], [ S ]> */ a ++; /* <[---], [---]> */ b ++; /* <[--d], [ S ]> */ c ++; /* <[---], [---]> */ d ++; /* <[---], [ S ]> */ e ++; /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [ S ]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ r = g(a,b,c); /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[--d], [ S ]>) (In3: <[---], [ S ]>) (Out(X): <[--d], [---]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ Z = g(r,d,e); /* <[--d], [---]> */ return X; } int I; int J; int K; int L; int M; Slicing project worklist [default] = [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... int X; int Y; Print slice = g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) /**/int g(/* <[---], [--d]> */ int u, /* <[---], [---]> */ int v, /* <[---], [--d]> */ int w) { /* <[---], [--d]> */ u ++; /* <[---], [---]> */ v ++; /* <[---], [--d]> */ w ++; /* <[---], [--d]> */ X = u; /* <[---], [---]> */ Y = u + v; /* <[---], [--d]> */ return w; } int Z; Print slice = f_slice_1: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (In5: <[---], [ S ]>) (OutRet: <[--d], [---]>) /**/int f(/* <[---], [ S ]> */ int a, /* <[---], [---]> */ int b, /* <[--d], [ S ]> */ int c, /* <[---], [---]> */ int d, /* <[---], [ S ]> */ int e) { /* <[--d], [ S ]> */ int r; /* <[---], [ S ]> */ a ++; /* <[---], [---]> */ b ++; /* <[--d], [ S ]> */ c ++; /* <[---], [---]> */ d ++; /* <[---], [ S ]> */ e ++; /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [ S ]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ r = g(a,b,c); /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[--d], [ S ]>) (In3: <[---], [ S ]>) (Out(X): <[--d], [---]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ Z = g(r,d,e); /* <[--d], [---]> */ return X; } int I; int J; int K; int L; int M; Print slice = main_slice_1: (InCtrl: <[--d], [ S ]>) /**/int main(void) { /* <[---], [---]> */ int res; /* <[---], [ S ]> */ I = 0; /* <[---], [---]> */ J = 0; /* <[--d], [ S ]> */ K = 0; /* <[---], [---]> */ L = 0; /* <[---], [ S ]> */ M = 0; /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (In5: <[---], [ S ]>) */ /* call to f_slice_1: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (In5: <[---], [ S ]>) (OutRet: <[--d], [---]>) */ /* <[--d], [ S ]> */ res = f(I,J,K,L,M); /* <[---], [---]> */ return res; } Slicing project worklist [default] = [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int X; int g_slice_1(int u, int w) { u ++; w ++; X = u; return w; } int f_slice_1(int a, int c, int e) { int r; a ++; c ++; e ++; r = g_slice_1(a,c); g_slice_1(r,e); return X; } int I; int K; int M; void main(void) { I = 0; K = 0; M = 0; f_slice_1(I,K,M); return; } int X; int Y; Print slice = g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) /**/int g(/* <[---], [--d]> */ int u, /* <[---], [---]> */ int v, /* <[---], [--d]> */ int w) { /* <[---], [--d]> */ u ++; /* <[---], [---]> */ v ++; /* <[---], [--d]> */ w ++; /* <[---], [--d]> */ X = u; /* <[---], [---]> */ Y = u + v; /* <[---], [--d]> */ return w; } int Z; Print slice = f_slice_1: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (In5: <[---], [ S ]>) (OutRet: <[--d], [---]>) /**/int f(/* <[---], [ S ]> */ int a, /* <[---], [---]> */ int b, /* <[--d], [ S ]> */ int c, /* <[---], [---]> */ int d, /* <[---], [ S ]> */ int e) { /* <[--d], [ S ]> */ int r; /* <[---], [ S ]> */ a ++; /* <[---], [---]> */ b ++; /* <[--d], [ S ]> */ c ++; /* <[---], [---]> */ d ++; /* <[---], [ S ]> */ e ++; /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [ S ]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ r = g(a,b,c); /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[--d], [ S ]>) (In3: <[---], [ S ]>) (Out(X): <[--d], [---]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ Z = g(r,d,e); /* <[--d], [---]> */ return X; } int I; int J; int K; int L; int M; Slicing project worklist [default] = int f(int a, int b, int c, int d, int e) { int r; /* 9 */ a ++; /* 10 */ b ++; /* 11 */ c ++; /* 12 */ d ++; /* 13 */ e ++; /* 14 */ r = g(a,b,c); /* 15 */ Z = g(r,d,e); /* 17 */ return X; } Slicing project worklist [default] = [f_slice_1 = (n:13(restrict to a) ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... int X; int Y; Print slice = g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) /**/int g(/* <[---], [--d]> */ int u, /* <[---], [---]> */ int v, /* <[---], [--d]> */ int w) { /* <[---], [--d]> */ u ++; /* <[---], [---]> */ v ++; /* <[---], [--d]> */ w ++; /* <[---], [--d]> */ X = u; /* <[---], [---]> */ Y = u + v; /* <[---], [--d]> */ return w; } int Z; Print slice = f_slice_1: (InCtrl: <[--d], [ S ]>) (In1: <[--d], [ S ]>) (In3: <[--d], [ S ]>) (In5: <[---], [ S ]>) (OutRet: <[--d], [---]>) /**/int f(/* <[--d], [ S ]> */ int a, /* <[---], [---]> */ int b, /* <[--d], [ S ]> */ int c, /* <[---], [---]> */ int d, /* <[---], [ S ]> */ int e) { /* <[--d], [ S ]> */ int r; /* <[--d], [ S ]> */ a ++; /* <[---], [---]> */ b ++; /* <[--d], [ S ]> */ c ++; /* <[---], [---]> */ d ++; /* <[---], [ S ]> */ e ++; /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [ S ]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ r = g(a,b,c); /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[--d], [ S ]>) (In3: <[---], [ S ]>) (Out(X): <[--d], [---]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ Z = g(r,d,e); /* <[--d], [---]> */ return X; } int I; int J; int K; int L; int M; Slicing project worklist [default] = [slicing] reinitializing slicing ... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [slicing] applying actions: 2/2... Print slice = f_slice_2: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[---], [ S ]>) (In5: <[--d], [ S ]>) /**/int f(/* <[---], [ S ]> */ int a, /* <[---], [---]> */ int b, /* <[---], [ S ]> */ int c, /* <[---], [---]> */ int d, /* <[--d], [ S ]> */ int e) { /* <[---], [ S ]> */ int r; /* <[---], [ S ]> */ a ++; /* <[---], [---]> */ b ++; /* <[---], [ S ]> */ c ++; /* <[---], [---]> */ d ++; /* <[--d], [ S ]> */ e ++; /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (In3: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[---], [ S ]> */ r = g(a,b,c); /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[---], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [---]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ Z = g(r,d,e); /* <[---], [---]> */ return X; } [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int X; int g_slice_1(int u, int w) { u ++; w ++; X = u; return w; } int Z; void f_slice_2(int a, int c, int e) { int r; a ++; c ++; e ++; r = g_slice_1(a,c); Z = g_slice_1(r,e); return; } int f_slice_1(int a, int c, int e) { int r; a ++; c ++; e ++; r = g_slice_1(a,c); g_slice_1(r,e); return X; } [slicing] reinitializing slicing ... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Slicing project worklist [default] = [main_slice_1 = change_call for call 24 -> f_slice_1] [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int X; int g_slice_2(int w) { w ++; return w; } void g_slice_1(int u) { u ++; X = u; return; } int f_slice_1(int c) { int r; c ++; r = g_slice_2(c); g_slice_1(r); return X; } int K; void main(void) { K = 0; f_slice_1(K); return; } int X; int Y; Print slice = g_slice_2: (InCtrl: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) /**/int g(/* <[---], [---]> */ int u, /* <[---], [---]> */ int v, /* <[---], [--d]> */ int w) { /* <[---], [---]> */ u ++; /* <[---], [---]> */ v ++; /* <[---], [--d]> */ w ++; /* <[---], [---]> */ X = u; /* <[---], [---]> */ Y = u + v; /* <[---], [--d]> */ return w; } Print slice = g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) /**/int g(/* <[---], [--d]> */ int u, /* <[---], [---]> */ int v, /* <[---], [---]> */ int w) { /* <[---], [--d]> */ u ++; /* <[---], [---]> */ v ++; /* <[---], [---]> */ w ++; /* <[---], [--d]> */ X = u; /* <[---], [---]> */ Y = u + v; /* <[---], [---]> */ return w; } int Z; Print slice = f_slice_1: (InCtrl: <[--d], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [---]>) /**/int f(/* <[---], [---]> */ int a, /* <[---], [---]> */ int b, /* <[--d], [ S ]> */ int c, /* <[---], [---]> */ int d, /* <[---], [---]> */ int e) { /* <[--d], [ S ]> */ int r; /* <[---], [---]> */ a ++; /* <[---], [---]> */ b ++; /* <[--d], [ S ]> */ c ++; /* <[---], [---]> */ d ++; /* <[---], [---]> */ e ++; /* sig call: (InCtrl: <[--d], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [ S ]>) */ /* call to g_slice_2: (InCtrl: <[---], [--d]>) (In3: <[---], [--d]>) (OutRet: <[---], [--d]>) */ /* <[--d], [ S ]> */ r = g(a,b,c); /* sig call: (InCtrl: <[--d], [ S ]>) (In1: <[--d], [ S ]>) (Out(X): <[--d], [---]>) */ /* call to g_slice_1: (InCtrl: <[---], [--d]>) (In1: <[---], [--d]>) */ /* <[--d], [ S ]> */ Z = g(r,d,e); /* <[--d], [---]> */ return X; } int I; int J; int K; int L; int M; Print slice = main_slice_1: (InCtrl: <[--d], [ S ]>) /**/int main(void) { /* <[---], [---]> */ int res; /* <[---], [---]> */ I = 0; /* <[---], [---]> */ J = 0; /* <[--d], [ S ]> */ K = 0; /* <[---], [---]> */ L = 0; /* <[---], [---]> */ M = 0; /* sig call: (InCtrl: <[--d], [ S ]>) (In3: <[--d], [ S ]>) */ /* call to f_slice_1: (InCtrl: <[--d], [ S ]>) (In3: <[--d], [ S ]>) (OutRet: <[--d], [---]>) */ /* <[--d], [ S ]> */ res = f(I,J,K,L,M); /* <[---], [---]> */ return res; } Slicing project worklist [default] = frama-c-20.0-Calcium/tests/slicing/oracle/filter.res.oracle0000666000000000000000000000507213571573400020522 0ustar [kernel] Parsing tests/slicing/filter.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} [eva] computing for function bts806 <- main. Called from tests/slicing/filter.i:42. [eva] Recording results for bts806 [eva] Done for function bts806 [eva] computing for function unspec <- main. Called from tests/slicing/filter.i:43. [eva] computing for function f <- unspec <- main. Called from tests/slicing/filter.i:36. [kernel:annot:missing-spec] tests/slicing/filter.i:36: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for unspec [eva] Done for function unspec [eva:alarm] tests/slicing/filter.i:43: Warning: signed overflow. assert r + tmp_0 ≤ 2147483647; (tmp_0 from unspec()) [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function bts806 [from] Done for function bts806 [from] Computing for function unspec [from] Computing for function f <-unspec [from] Done for function f [from] Done for function unspec [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function unspec [pdg] done for function unspec [pdg] computing for function bts806 [pdg] done for function bts806 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int f(int); int T[10]; int bts806_slice_1(void) { int x = 0; { int z; z = x + 1; x = z; } return x; } int unspec_slice_1(void) { int __retres; { int tmp_0; tmp_0 = f(T[2]); T[2] += tmp_0; } __retres = T[1] + T[2]; return __retres; } int main(void) { int tmp; int tmp_0; int r = 0; tmp = bts806_slice_1(); r += tmp; tmp_0 = unspec_slice_1(); r += tmp_0; return r; } [kernel] Parsing tests/slicing/result/ocode_0_filter.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/forall_loop_invariant.res.oracle0000666000000000000000000000604113571573400023615 0ustar [kernel] Parsing tests/slicing/forall_loop_invariant.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ {0} u[0..9] ∈ {0} [eva] tests/slicing/forall_loop_invariant.i:10: loop invariant got status valid. [eva] tests/slicing/forall_loop_invariant.i:11: loop invariant got status valid. [eva] tests/slicing/forall_loop_invariant.i:12: loop invariant got status valid. [eva] tests/slicing/forall_loop_invariant.i:14: starting to merge loop iterations [eva:alarm] tests/slicing/forall_loop_invariant.i:11: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/forall_loop_invariant.i:12: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/forall_loop_invariant.i:18: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int t[10]; int u[10]; void main(void) { { int i = 0; /*@ loop invariant 0 ≤ i ≤ 10; loop invariant ∀ int k; 0 ≤ k < i ⇒ t[k] ≡ 1; loop invariant ∀ int k; 0 ≤ k < i ⇒ u[k] ≡ 2; */ while (i < 10) { t[i] = 1; i ++; } } /*@ assert t[2] ≡ 1; */ ; return; } [slicing] slicing requests in progress... [slicing] reinitializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int t[10]; int u[10]; int main(void) { int __retres; { int i = 0; /*@ loop invariant 0 ≤ i ≤ 10; loop invariant ∀ int k; 0 ≤ k < i ⇒ t[k] ≡ 1; loop invariant ∀ int k; 0 ≤ k < i ⇒ u[k] ≡ 2; */ while (i < 10) { t[i] = 1; i ++; } } /*@ assert t[2] ≡ 1; */ ; __retres = 0; return __retres; } [kernel] Parsing tests/slicing/result/ocode_0_forall_loop_invariant.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/horwitz.res.oracle0000666000000000000000000001232413571573400020741 0ustar [kernel] Parsing tests/slicing/horwitz.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function A <- main. Called from tests/slicing/horwitz.i:27. [eva] computing for function add <- A <- main. Called from tests/slicing/horwitz.i:18. [eva] Recording results for add [eva] Done for function add [eva] computing for function incr <- A <- main. Called from tests/slicing/horwitz.i:19. [eva] computing for function add <- incr <- A <- main. Called from tests/slicing/horwitz.i:15. [eva] Recording results for add [eva] Done for function add [eva] Recording results for incr [eva] Done for function incr [eva] Recording results for A [eva] Done for function A [eva] tests/slicing/horwitz.i:26: starting to merge loop iterations [eva] computing for function A <- main. Called from tests/slicing/horwitz.i:27. [eva] computing for function add <- A <- main. Called from tests/slicing/horwitz.i:18. [eva] Recording results for add [eva] Done for function add [eva] computing for function incr <- A <- main. Called from tests/slicing/horwitz.i:19. [eva] computing for function add <- incr <- A <- main. Called from tests/slicing/horwitz.i:15. [eva] Recording results for add [eva] Done for function add [eva] Recording results for incr [eva] Done for function incr [eva] Recording results for A [eva] Done for function A [eva] computing for function A <- main. Called from tests/slicing/horwitz.i:27. [eva] computing for function add <- A <- main. Called from tests/slicing/horwitz.i:18. [eva] Recording results for add [eva] Done for function add [eva] computing for function incr <- A <- main. Called from tests/slicing/horwitz.i:19. [eva] computing for function add <- incr <- A <- main. Called from tests/slicing/horwitz.i:15. [eva] Recording results for add [eva] Done for function add [eva] Recording results for incr [eva] Done for function incr [eva] Recording results for A [eva] Done for function A [eva] computing for function A <- main. Called from tests/slicing/horwitz.i:27. [eva] computing for function add <- A <- main. Called from tests/slicing/horwitz.i:18. [eva] Recording results for add [eva] Done for function add [eva] computing for function incr <- A <- main. Called from tests/slicing/horwitz.i:19. [eva] computing for function add <- incr <- A <- main. Called from tests/slicing/horwitz.i:15. [eva] Recording results for add [eva] Done for function add [eva] Recording results for incr [eva] Done for function incr [eva] Recording results for A [eva] Done for function A [eva] computing for function A <- main. Called from tests/slicing/horwitz.i:27. [eva] computing for function add <- A <- main. Called from tests/slicing/horwitz.i:18. [eva] Recording results for add [eva] Done for function add [eva] tests/slicing/horwitz.i:19: Reusing old results for call to incr [eva] Recording results for A [eva] Done for function A [eva] computing for function A <- main. Called from tests/slicing/horwitz.i:27. [eva] computing for function add <- A <- main. Called from tests/slicing/horwitz.i:18. [eva:alarm] tests/slicing/horwitz.i:12: Warning: signed overflow. assert a + b ≤ 2147483647; [eva] Recording results for add [eva] Done for function add [eva] tests/slicing/horwitz.i:19: Reusing old results for call to incr [eva] Recording results for A [eva] Done for function A [eva] Recording results for main [eva] done for function main [from] Computing for function add [from] Done for function add [from] Computing for function incr [from] Done for function incr [from] Computing for function A [from] Done for function A [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function add: \result FROM a; b [from] Function incr: i FROM pi; i [from] Function A: i FROM py; i \result FROM x; py; i [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function incr [pdg] done for function incr [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function A [pdg] done for function A [pdg] computing for function main [pdg] done for function main Slicing project worklist [default] = [main_slice_1 = change_call for call 23 -> A_slice_1][A_slice_1 = change_call for call 10 -> incr_slice_1] [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [slicing] applying actions: 2/2... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int add(int a, int b) { int __retres; __retres = a + b; return __retres; } void incr_slice_1(char *pi) { int tmp; tmp = add((int)*pi,1); *pi = (char)tmp; return; } void A_slice_1(char *py) { incr_slice_1(py); return; } void main(void) { char i = (char)1; while ((int)i < 11) A_slice_1(& i); return; } frama-c-20.0-Calcium/tests/slicing/oracle/if_many_values.res.oracle0000666000000000000000000000273413571573400022240 0ustar [kernel] Parsing tests/slicing/if_many_values.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization r ∈ {1} [eva] tests/slicing/if_many_values.i:8: Trace partitioning superposing up to 100 states [eva] tests/slicing/if_many_values.i:8: starting to merge loop iterations [eva:alarm] tests/slicing/if_many_values.i:11: Warning: signed overflow. assert r + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int r = 1; int main(void) { { int i = -100; while (i < 100) { if (i != 0) r ++; i ++; } } return r; } [kernel] Parsing tests/slicing/result/ocode_0_if_many_values.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/initialized.res.oracle0000666000000000000000000000232113571573400021534 0ustar [kernel] Parsing tests/slicing/initialized.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/slicing/initialized.i:12: assertion got status valid. [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void main(void) { int x; x = 3; /*@ assert \initialized(&x); */ ; return; } [kernel] Parsing tests/slicing/result/ocode_0_initialized.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/keep_annot.0.res.oracle0000666000000000000000000000403513571573400021514 0ustar [kernel] Parsing tests/slicing/keep_annot.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function g <- f. Called from tests/slicing/keep_annot.i:26. [eva] tests/slicing/keep_annot.i:15: starting to merge loop iterations [eva:alarm] tests/slicing/keep_annot.i:20: Warning: assertion got status unknown. [eva:alarm] tests/slicing/keep_annot.i:21: Warning: assertion got status unknown. [eva] Recording results for g [eva] Done for function g [eva] tests/slicing/keep_annot.i:27: assertion got status valid. [eva:alarm] tests/slicing/keep_annot.i:28: Warning: assertion got status unknown. [eva] Recording results for f [eva] done for function f [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function g [from] Done for function g [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function g [pdg] done for function g [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct __anonstruct_las_1 { int a ; double b ; }; typedef struct __anonstruct_las_1 las; void g_slice_1(las *p) { int i = 0; while (i < 5) { p->b = (double)i / (double)(i + 1); i ++; } return; } void f(las *p, int n, int m) { g_slice_1(p); /*@ assert 0.0 ≤ p->b ≤ 1.0; */ ; /*@ assert ∀ ℤ k; k < n ⇒ k < m; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_0_keep_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/keep_annot.1.res.oracle0000666000000000000000000000417413571573400021521 0ustar [kernel] Parsing tests/slicing/keep_annot.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function g <- f. Called from tests/slicing/keep_annot.i:26. [eva] tests/slicing/keep_annot.i:15: starting to merge loop iterations [eva:alarm] tests/slicing/keep_annot.i:20: Warning: assertion got status unknown. [eva:alarm] tests/slicing/keep_annot.i:21: Warning: assertion got status unknown. [eva] Recording results for g [eva] Done for function g [eva] tests/slicing/keep_annot.i:27: assertion got status valid. [eva:alarm] tests/slicing/keep_annot.i:28: Warning: assertion got status unknown. [eva] Recording results for f [eva] done for function f [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function g [from] Done for function g [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function g [pdg] done for function g [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct __anonstruct_las_1 { int a ; double b ; }; typedef struct __anonstruct_las_1 las; void g_slice_1(las *p) { int i = 0; while (i < 5) { p->b = (double)i / (double)(i + 1); i ++; } /*@ assert 1 ≤ p->a ≤ 6; */ ; /*@ assert 0.0 ≤ p->b ≤ 1.0; */ ; return; } /*@ assigns *p; */ void f(las *p, int n, int m) { g_slice_1(p); /*@ assert 0.0 ≤ p->b ≤ 1.0; */ ; /*@ assert ∀ ℤ k; k < n ⇒ k < m; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_1_keep_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/keep_annot.2.res.oracle0000666000000000000000000000371613571573400021523 0ustar [kernel] Parsing tests/slicing/keep_annot.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at L [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/slicing/keep_annot.i:40: Warning: signed overflow. assert -2147483648 ≤ nn - 2; [eva:alarm] tests/slicing/keep_annot.i:39: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/keep_annot.i:41: Warning: out of bounds read. assert \valid_read(dabs + (int)(ii + 1)); [eva:alarm] tests/slicing/keep_annot.i:41: Warning: non-finite float value. assert \is_finite((float)((double)((double)u - (double)((double)*(dabs + (int)(ii + 1)) * 2.0)))); [eva:alarm] tests/slicing/keep_annot.i:42: Warning: assertion got status unknown. [eva] Recording results for L [eva] done for function L [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function L [pdg] done for function L [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void L(float u, int nn, float *dabs, float *y) { int ii; ii = nn - 2; /*@ loop invariant ∀ ℤ k; u ≤ *(dabs + k); */ while (ii >= 0) { *y = (float)((double)u - (double)*(dabs + (ii + 1)) * 2.0); /*@ assert ∀ ℤ k; u ≤ *(dabs + k); */ ; ii --; } /*@ slice pragma expr *y; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_2_keep_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/keep_annot.3.res.oracle0000666000000000000000000000354613571573400021525 0ustar [kernel] Parsing tests/slicing/keep_annot.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at L [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/slicing/keep_annot.i:40: Warning: signed overflow. assert -2147483648 ≤ nn - 2; [eva:alarm] tests/slicing/keep_annot.i:39: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/keep_annot.i:41: Warning: out of bounds read. assert \valid_read(dabs + (int)(ii + 1)); [eva:alarm] tests/slicing/keep_annot.i:41: Warning: non-finite float value. assert \is_finite((float)((double)((double)u - (double)((double)*(dabs + (int)(ii + 1)) * 2.0)))); [eva:alarm] tests/slicing/keep_annot.i:42: Warning: assertion got status unknown. [eva] Recording results for L [eva] done for function L [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function L [pdg] done for function L [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void L(float u, int nn, float *dabs, float *y) { int ii; ii = nn - 2; while (ii >= 0) { *y = (float)((double)u - (double)*(dabs + (ii + 1)) * 2.0); ii --; } /*@ slice pragma expr *y; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_3_keep_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/keep_annot.4.res.oracle0000666000000000000000000000244413571573400021522 0ustar [kernel] Parsing tests/slicing/keep_annot.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at bts1110 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/slicing/keep_annot.i:50: assertion got status valid. [eva:alarm] tests/slicing/keep_annot.i:52: Warning: assertion got status unknown. [eva] Recording results for bts1110 [eva] done for function bts1110 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function bts1110 [pdg] done for function bts1110 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int bts1110(int x) { /*@ assert x ≡ 5; */ ; x ++; return x; } [kernel] Parsing tests/slicing/result/ocode_4_keep_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loop_infinite.res.oracle0000666000000000000000000000277413571573400022101 0ustar [kernel] Parsing tests/slicing/loop_infinite.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/slicing/loop_infinite.i:10: Warning: signed overflow. assert a + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int main(void) { int __retres; __retres = 0; return __retres; } [kernel] Parsing tests/slicing/result/ocode_0_loop_infinite.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loop_simple.res.oracle0000666000000000000000000000326413571573400021560 0ustar [kernel] Parsing tests/slicing/loop_simple.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/slicing/loop_simple.i:10: starting to merge loop iterations [eva] tests/slicing/loop_simple.i:12: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int main(void) { int a; int c; int volatile b = 0; a = 1; c = 0; /*@ loop assigns c, a; */ while (c <= 5) { a = 2; c ++; } if (b) goto L; a += 2; L: a += 3; goto H; H: ; return a; } [kernel] Parsing tests/slicing/result/ocode_0_loop_simple.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.0.res.oracle0000666000000000000000000000330613571573400020525 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing an incomplete application starting at f1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] C1 ∈ [--..--] C2 ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] Z ∈ [--..--] [eva] tests/slicing/loops.i:36: assertion got status valid. [eva] tests/slicing/loops.i:34: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:35: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for f1 [eva] done for function f1 [from] Computing for function f1 [from] Done for function f1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f1 [pdg] done for function f1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f1(void) { int x; x = 1; /*@ slice pragma stmt; */ x ++; return; } [kernel] Parsing tests/slicing/result/ocode_0_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.1.res.oracle0000666000000000000000000000334713571573400020533 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing an incomplete application starting at f1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] C1 ∈ [--..--] C2 ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] Z ∈ [--..--] [eva] tests/slicing/loops.i:36: assertion got status valid. [eva] tests/slicing/loops.i:34: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:35: Warning: signed overflow. assert s + 1 ≤ 2147483647; [eva] Recording results for f1 [eva] done for function f1 [from] Computing for function f1 [from] Done for function f1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f1 [pdg] done for function f1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f1(int c) { int s = 0; if (c) while (1) { s ++; /*@ assert s > 0; */ ; } return; } [kernel] Parsing tests/slicing/result/ocode_1_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.10.res.oracle0000666000000000000000000000546113571573400020612 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] computing for function may_write_Y_from_Z <- main. Called from tests/slicing/loops.i:199. [eva] using specification for function may_write_Y_from_Z [eva] Done for function may_write_Y_from_Z [eva] computing for function loop <- main. Called from tests/slicing/loops.i:202. [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [from] Computing for function loop [from] Non-terminating function loop (no dependencies) [from] Done for function loop [from] Computing for function main [from] Computing for function may_write_Y_from_Z <-main [from] Done for function may_write_Y_from_Z [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: NON TERMINATING - NO EFFECTS [from] Function may_write_Y_from_Z: Y FROM Z; p; y [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop [pdg] tests/slicing/loops.i:187: Warning: no final state. Probably unreachable... [pdg] done for function loop [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] tests/slicing/loops.i:204: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X; void loop_slice_1(void) { { int c; /*@ loop pragma WIDEN_HINTS X, 10, 100; */ while (1) { /*@ slice pragma ctrl; */ ; c = 1; /*@ assert c ≡ 1; */ ; } } return; } void main(void) { loop_slice_1(); return; } [kernel] Parsing tests/slicing/result/ocode_10_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.11.res.oracle0000666000000000000000000000321713571573400020610 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] done for function loop [from] Computing for function loop [from] Done for function loop [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: Z FROM Y [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop [pdg] done for function loop [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int Y; int Z; void loop(void) { Z = Y; return; } [kernel] Parsing tests/slicing/result/ocode_11_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.12.res.oracle0000666000000000000000000000353113571573400020610 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] done for function loop [from] Computing for function loop [from] Done for function loop [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: Z FROM Y [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop [pdg] done for function loop [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X; int Y; int Z; void loop(int cond) { if (cond) { int c = 0; /*@ loop pragma WIDEN_HINTS X, 10, 100; */ while (1) { /*@ slice pragma ctrl; */ ; if (c) Y = Z; c = 1; /*@ assert c ≡ 1; */ ; } } return; } [kernel] Parsing tests/slicing/result/ocode_12_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.13.res.oracle0000666000000000000000000000353113571573400020611 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] done for function loop [from] Computing for function loop [from] Done for function loop [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: Z FROM Y [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop [pdg] done for function loop [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X; int Y; int Z; void loop(int cond) { if (cond) { int c = 0; /*@ loop pragma WIDEN_HINTS X, 10, 100; */ while (1) { /*@ slice pragma ctrl; */ ; if (c) Y = Z; c = 1; /*@ assert c ≡ 1; */ ; } } return; } [kernel] Parsing tests/slicing/result/ocode_13_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.14.res.oracle0000666000000000000000000000321713571573400020613 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] done for function loop [from] Computing for function loop [from] Done for function loop [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: Z FROM Y [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop [pdg] done for function loop [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int Y; int Z; void loop(void) { Z = Y; return; } [kernel] Parsing tests/slicing/result/ocode_14_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.15.res.oracle0000666000000000000000000000410313571573400020607 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing an incomplete application starting at stop_f1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] C1 ∈ [--..--] C2 ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] Z ∈ [--..--] [eva] tests/slicing/loops.i:68: assertion got status valid. [eva] tests/slicing/loops.i:66: starting to merge loop iterations [eva] computing for function stop <- stop_f1. Called from tests/slicing/loops.i:70. [kernel:annot:missing-spec] tests/slicing/loops.i:70: Warning: Neither code nor specification for function stop, generating default assigns from the prototype [eva] using specification for function stop [eva] Done for function stop [eva] Recording results for stop_f1 [eva] done for function stop_f1 [from] Computing for function stop_f1 [from] Computing for function stop <-stop_f1 [from] Done for function stop [from] Done for function stop_f1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function stop: NO EFFECTS [from] Function stop_f1: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function stop_f1 [pdg] done for function stop_f1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void stop_f1(void) { int x; x = 1; /*@ slice pragma stmt; */ x ++; return; } [kernel] Parsing tests/slicing/result/ocode_15_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.16.res.oracle0000666000000000000000000000415013571573400020612 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing an incomplete application starting at stop_f1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] C1 ∈ [--..--] C2 ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] Z ∈ [--..--] [eva] tests/slicing/loops.i:68: assertion got status valid. [eva] tests/slicing/loops.i:66: starting to merge loop iterations [eva] computing for function stop <- stop_f1. Called from tests/slicing/loops.i:70. [kernel:annot:missing-spec] tests/slicing/loops.i:70: Warning: Neither code nor specification for function stop, generating default assigns from the prototype [eva] using specification for function stop [eva] Done for function stop [eva] Recording results for stop_f1 [eva] done for function stop_f1 [from] Computing for function stop_f1 [from] Computing for function stop <-stop_f1 [from] Done for function stop [from] Done for function stop_f1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function stop: NO EFFECTS [from] Function stop_f1: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function stop_f1 [pdg] done for function stop_f1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void stop_f1(int c) { int s = 0; if (c) while (s < c) { s ++; /*@ assert s > 0; */ ; } return; } [kernel] Parsing tests/slicing/result/ocode_16_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.17.res.oracle0000666000000000000000000000427513571573400020623 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing an incomplete application starting at stop_f2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] C1 ∈ [--..--] C2 ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] Z ∈ [--..--] [eva:alarm] tests/slicing/loops.i:82: Warning: signed overflow. assert c + 10 ≤ 2147483647; [eva:alarm] tests/slicing/loops.i:88: Warning: assertion got status unknown. [eva] computing for function stop <- stop_f2. Called from tests/slicing/loops.i:89. [kernel:annot:missing-spec] tests/slicing/loops.i:89: Warning: Neither code nor specification for function stop, generating default assigns from the prototype [eva] using specification for function stop [eva] Done for function stop [eva] Recording results for stop_f2 [eva] done for function stop_f2 [from] Computing for function stop_f2 [from] Computing for function stop <-stop_f2 [from] Done for function stop [from] Done for function stop_f2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function stop: NO EFFECTS [from] Function stop_f2: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function stop_f2 [pdg] done for function stop_f2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void stop_f2(int c) { int x1 = 0; int x2 = 0; if (! (x1 + x2 < c + 10)) goto break_cont_1; if (c) x1 ++; /*@ slice pragma expr x1; */ ; break_cont_1: return; } [kernel] Parsing tests/slicing/result/ocode_17_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.18.res.oracle0000666000000000000000000000427013571573400020617 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing an incomplete application starting at stop_f2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] C1 ∈ [--..--] C2 ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] Z ∈ [--..--] [eva:alarm] tests/slicing/loops.i:82: Warning: signed overflow. assert c + 10 ≤ 2147483647; [eva:alarm] tests/slicing/loops.i:88: Warning: assertion got status unknown. [eva] computing for function stop <- stop_f2. Called from tests/slicing/loops.i:89. [kernel:annot:missing-spec] tests/slicing/loops.i:89: Warning: Neither code nor specification for function stop, generating default assigns from the prototype [eva] using specification for function stop [eva] Done for function stop [eva] Recording results for stop_f2 [eva] done for function stop_f2 [from] Computing for function stop_f2 [from] Computing for function stop <-stop_f2 [from] Done for function stop [from] Done for function stop_f2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function stop: NO EFFECTS [from] Function stop_f2: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function stop_f2 [pdg] done for function stop_f2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void stop_f2(int c) { int x1 = 0; int x2 = 0; if (! (x1 + x2 < c + 10)) goto break_cont_1; if (! c) x2 ++; /*@ assert x2 > 0; */ ; break_cont_1: return; } [kernel] Parsing tests/slicing/result/ocode_18_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.19.res.oracle0000666000000000000000000000506413571573400020622 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] computing for function may_write_Y_from_Z <- main. Called from tests/slicing/loops.i:199. [eva] using specification for function may_write_Y_from_Z [eva] Done for function may_write_Y_from_Z [eva] computing for function loop <- main. Called from tests/slicing/loops.i:202. [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [from] Computing for function loop [from] Non-terminating function loop (no dependencies) [from] Done for function loop [from] Computing for function main [from] Computing for function may_write_Y_from_Z <-main [from] Done for function may_write_Y_from_Z [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: NON TERMINATING - NO EFFECTS [from] Function may_write_Y_from_Z: Y FROM Z; p; y [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing] Nothing to select for Z after unreachable stmt of main [slicing] Nothing to select for an unreachable stmt of main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] tests/slicing/loops.i:204: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void main(void) { return; } [kernel] Parsing tests/slicing/result/ocode_19_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.2.res.oracle0000666000000000000000000000374613571573400020537 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing an incomplete application starting at f2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] C1 ∈ [--..--] C2 ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] Z ∈ [--..--] [eva:alarm] tests/slicing/loops.i:56: Warning: assertion got status unknown. [eva] tests/slicing/loops.i:50: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:52: Warning: signed overflow. assert x1 + 1 ≤ 2147483647; [eva:alarm] tests/slicing/loops.i:54: Warning: signed overflow. assert x2 + 1 ≤ 2147483647; [eva] Recording results for f2 [eva] done for function f2 [from] Computing for function f2 [from] Non-terminating function f2 (no dependencies) [from] Done for function f2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f2: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f2 [pdg] tests/slicing/loops.i:50: Warning: no final state. Probably unreachable... [pdg] done for function f2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f2(int c) { int x1 = 0; while (1) { if (c) x1 ++; /*@ slice pragma expr x1; */ ; } return; } [kernel] Parsing tests/slicing/result/ocode_2_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.20.res.oracle0000666000000000000000000000511613571573400020610 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] computing for function may_write_Y_from_Z <- main. Called from tests/slicing/loops.i:199. [eva] using specification for function may_write_Y_from_Z [eva] Done for function may_write_Y_from_Z [eva] computing for function loop <- main. Called from tests/slicing/loops.i:202. [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [from] Computing for function loop [from] Non-terminating function loop (no dependencies) [from] Done for function loop [from] Computing for function main [from] Computing for function may_write_Y_from_Z <-main [from] Done for function may_write_Y_from_Z [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: NON TERMINATING - NO EFFECTS [from] Function may_write_Y_from_Z: Y FROM Z; p; y [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing] Warning: No internal slicing request from the command line. [slicing] Warning: Adding an extra request on the entry point of function: main. [pdg] computing for function main [pdg] tests/slicing/loops.i:204: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void main(void) { return; } [kernel] Parsing tests/slicing/result/ocode_20_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.21.res.oracle0000666000000000000000000000605713571573400020616 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] computing for function may_write_Y_from_Z <- main. Called from tests/slicing/loops.i:199. [eva] using specification for function may_write_Y_from_Z [eva] Done for function may_write_Y_from_Z [eva] computing for function loop <- main. Called from tests/slicing/loops.i:202. [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [from] Computing for function loop [from] Non-terminating function loop (no dependencies) [from] Done for function loop [from] Computing for function main [from] Computing for function may_write_Y_from_Z <-main [from] Done for function may_write_Y_from_Z [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: NON TERMINATING - NO EFFECTS [from] Function may_write_Y_from_Z: Y FROM Z; p; y [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop [pdg] tests/slicing/loops.i:187: Warning: no final state. Probably unreachable... [pdg] done for function loop [pdg] computing for function may_write_Y_from_Z [pdg] done for function may_write_Y_from_Z [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function main [pdg] tests/slicing/loops.i:204: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X; int Y; int Z; void loop_slice_1(void) { { int c = 0; /*@ loop pragma WIDEN_HINTS X, 10, 100; */ while (1) { /*@ slice pragma ctrl; */ ; if (c) Y = Z; c = 1; /*@ assert c ≡ 1; */ ; } } return; } void may_write_Y_from_Z_slice_1(void); void main(void) { Z = 0; Z = X; may_write_Y_from_Z_slice_1(); loop_slice_1(); return; } [kernel] Parsing tests/slicing/result/ocode_21_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.22.res.oracle0000666000000000000000000000607613571573400020620 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] computing for function may_write_Y_from_Z <- main. Called from tests/slicing/loops.i:199. [eva] using specification for function may_write_Y_from_Z [eva] Done for function may_write_Y_from_Z [eva] computing for function loop <- main. Called from tests/slicing/loops.i:202. [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [from] Computing for function loop [from] Non-terminating function loop (no dependencies) [from] Done for function loop [from] Computing for function main [from] Computing for function may_write_Y_from_Z <-main [from] Done for function may_write_Y_from_Z [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: NON TERMINATING - NO EFFECTS [from] Function may_write_Y_from_Z: Y FROM Z; p; y [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop [pdg] tests/slicing/loops.i:187: Warning: no final state. Probably unreachable... [pdg] done for function loop [pdg] computing for function may_write_Y_from_Z [pdg] done for function may_write_Y_from_Z [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function main [pdg] tests/slicing/loops.i:204: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X; int Y; int Z; void loop_slice_1(void) { { int c = 0; /*@ loop pragma WIDEN_HINTS X, 10, 100; */ while (1) { /*@ slice pragma ctrl; */ ; if (c) Y = Z; c = 1; /*@ assert c ≡ 1; */ ; } } return; } void may_write_Y_from_Z_slice_1(int *p, int y); void main(int y) { Z = 0; Z = X; may_write_Y_from_Z_slice_1(& Y,y); loop_slice_1(); return; } [kernel] Parsing tests/slicing/result/ocode_22_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.23.res.oracle0000666000000000000000000000472713571573400020622 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] computing for function may_write_Y_from_Z <- main. Called from tests/slicing/loops.i:199. [eva] using specification for function may_write_Y_from_Z [eva] Done for function may_write_Y_from_Z [eva] computing for function loop <- main. Called from tests/slicing/loops.i:202. [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [from] Computing for function loop [from] Non-terminating function loop (no dependencies) [from] Done for function loop [from] Computing for function main [from] Computing for function may_write_Y_from_Z <-main [from] Done for function may_write_Y_from_Z [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: NON TERMINATING - NO EFFECTS [from] Function may_write_Y_from_Z: Y FROM Z; p; y [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] tests/slicing/loops.i:204: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X; int Z; void main(void) { Z = 0; Z = X; return; } [kernel] Parsing tests/slicing/result/ocode_23_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.24.res.oracle0000666000000000000000000000317713571573400020621 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing an incomplete application starting at alarm [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] C1 ∈ [--..--] C2 ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] Z ∈ [--..--] [eva] tests/slicing/loops.i:210: assertion got status valid. [eva:alarm] tests/slicing/loops.i:211: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] Recording results for alarm [eva] done for function alarm [from] Computing for function alarm [from] Done for function alarm [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function alarm: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function alarm [pdg] done for function alarm [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void alarm(void) { int volatile j = 3; j ++; return; } [kernel] Parsing tests/slicing/result/ocode_24_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.3.res.oracle0000666000000000000000000000374113571573400020533 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing an incomplete application starting at f2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] C1 ∈ [--..--] C2 ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] Z ∈ [--..--] [eva:alarm] tests/slicing/loops.i:56: Warning: assertion got status unknown. [eva] tests/slicing/loops.i:50: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:52: Warning: signed overflow. assert x1 + 1 ≤ 2147483647; [eva:alarm] tests/slicing/loops.i:54: Warning: signed overflow. assert x2 + 1 ≤ 2147483647; [eva] Recording results for f2 [eva] done for function f2 [from] Computing for function f2 [from] Non-terminating function f2 (no dependencies) [from] Done for function f2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f2: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f2 [pdg] tests/slicing/loops.i:50: Warning: no final state. Probably unreachable... [pdg] done for function f2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f2(int c) { int x2 = 0; while (1) { if (! c) x2 ++; /*@ assert x2 > 0; */ ; } return; } [kernel] Parsing tests/slicing/result/ocode_3_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.4.res.oracle0000666000000000000000000000326113571573400020531 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at test_infinite_loop_3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] Recording results for test_infinite_loop_3 [eva] done for function test_infinite_loop_3 [from] Computing for function test_infinite_loop_3 [from] Done for function test_infinite_loop_3 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function test_infinite_loop_3: G FROM ctrl1; ctrl2; data1; data2 [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test_infinite_loop_3 [pdg] done for function test_infinite_loop_3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; void test_infinite_loop_3(int ctrl1, int ctrl2, int data1, int data2) { G = 0; if (ctrl1) { G = data1; if (ctrl2) G = data2; } return; } [kernel] Parsing tests/slicing/result/ocode_4_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.5.res.oracle0000666000000000000000000000505513571573400020535 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at test_infinite_loop_4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva:alarm] tests/slicing/loops.i:141: Warning: signed overflow. assert -2147483648 ≤ G + data2; [eva:alarm] tests/slicing/loops.i:141: Warning: signed overflow. assert G + data2 ≤ 2147483647; [eva] tests/slicing/loops.i:125: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:126: Warning: signed overflow. assert -2147483648 ≤ G + data1; [eva:alarm] tests/slicing/loops.i:126: Warning: signed overflow. assert G + data1 ≤ 2147483647; [eva:alarm] tests/slicing/loops.i:129: Warning: signed overflow. assert -2147483648 ≤ G + no_data; [eva:alarm] tests/slicing/loops.i:129: Warning: signed overflow. assert G + no_data ≤ 2147483647; [eva:alarm] tests/slicing/loops.i:133: Warning: signed overflow. assert -2147483648 ≤ G + no_data; [eva:alarm] tests/slicing/loops.i:133: Warning: signed overflow. assert G + no_data ≤ 2147483647; [eva] Recording results for test_infinite_loop_4 [eva] done for function test_infinite_loop_4 [from] Computing for function test_infinite_loop_4 [from] Done for function test_infinite_loop_4 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function test_infinite_loop_4: G FROM ctrl1; ctrl2; data1; data2 [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test_infinite_loop_4 [pdg] done for function test_infinite_loop_4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; void test_infinite_loop_4(int ctrl1, int ctrl2, int data1, int data2) { G = 0; while (ctrl1) { G += data1; if (ctrl2) G += data2; } return; } [kernel] Parsing tests/slicing/result/ocode_5_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.6.res.oracle0000666000000000000000000000505513571573400020536 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at test_infinite_loop_5 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva:alarm] tests/slicing/loops.i:165: Warning: signed overflow. assert -2147483648 ≤ G + data2; [eva:alarm] tests/slicing/loops.i:165: Warning: signed overflow. assert G + data2 ≤ 2147483647; [eva] tests/slicing/loops.i:149: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:150: Warning: signed overflow. assert -2147483648 ≤ G + data1; [eva:alarm] tests/slicing/loops.i:150: Warning: signed overflow. assert G + data1 ≤ 2147483647; [eva:alarm] tests/slicing/loops.i:154: Warning: signed overflow. assert -2147483648 ≤ G + no_data; [eva:alarm] tests/slicing/loops.i:154: Warning: signed overflow. assert G + no_data ≤ 2147483647; [eva:alarm] tests/slicing/loops.i:156: Warning: signed overflow. assert -2147483648 ≤ G + no_data; [eva:alarm] tests/slicing/loops.i:156: Warning: signed overflow. assert G + no_data ≤ 2147483647; [eva] Recording results for test_infinite_loop_5 [eva] done for function test_infinite_loop_5 [from] Computing for function test_infinite_loop_5 [from] Done for function test_infinite_loop_5 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function test_infinite_loop_5: G FROM ctrl1; ctrl2; data1; data2 [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test_infinite_loop_5 [pdg] done for function test_infinite_loop_5 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; void test_infinite_loop_5(int ctrl1, int ctrl2, int data1, int data2) { G = 0; while (ctrl1) { G += data1; if (ctrl2) G += data2; } return; } [kernel] Parsing tests/slicing/result/ocode_6_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.7.res.oracle0000666000000000000000000000321613571573400020534 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] done for function loop [from] Computing for function loop [from] Done for function loop [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: Z FROM Y [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop [pdg] done for function loop [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int Y; int Z; void loop(void) { Z = Y; return; } [kernel] Parsing tests/slicing/result/ocode_7_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.8.res.oracle0000666000000000000000000000525413571573400020541 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] computing for function may_write_Y_from_Z <- main. Called from tests/slicing/loops.i:199. [eva] using specification for function may_write_Y_from_Z [eva] Done for function may_write_Y_from_Z [eva] computing for function loop <- main. Called from tests/slicing/loops.i:202. [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [from] Computing for function loop [from] Non-terminating function loop (no dependencies) [from] Done for function loop [from] Computing for function main [from] Computing for function may_write_Y_from_Z <-main [from] Done for function may_write_Y_from_Z [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: NON TERMINATING - NO EFFECTS [from] Function may_write_Y_from_Z: Y FROM Z; p; y [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] tests/slicing/loops.i:204: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function loop [pdg] tests/slicing/loops.i:187: Warning: no final state. Probably unreachable... [pdg] done for function loop [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int C2 = 1; void loop_slice_1(void) { return; } void main(void) { { int cond = C2; loop_slice_1(); } return; } [kernel] Parsing tests/slicing/result/ocode_8_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/loops.9.res.oracle0000666000000000000000000000534413571573400020542 0ustar [kernel] Parsing tests/slicing/loops.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} C1 ∈ {1} C2 ∈ {1} X ∈ {0} Y ∈ {0} Z ∈ {0} [eva] computing for function may_write_Y_from_Z <- main. Called from tests/slicing/loops.i:199. [eva] using specification for function may_write_Y_from_Z [eva] Done for function may_write_Y_from_Z [eva] computing for function loop <- main. Called from tests/slicing/loops.i:202. [eva] tests/slicing/loops.i:183: assertion got status valid. [eva] tests/slicing/loops.i:176: starting to merge loop iterations [eva:alarm] tests/slicing/loops.i:179: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [from] Computing for function loop [from] Non-terminating function loop (no dependencies) [from] Done for function loop [from] Computing for function main [from] Computing for function may_write_Y_from_Z <-main [from] Done for function may_write_Y_from_Z [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: NON TERMINATING - NO EFFECTS [from] Function may_write_Y_from_Z: Y FROM Z; p; y [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop [pdg] tests/slicing/loops.i:187: Warning: no final state. Probably unreachable... [pdg] done for function loop [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] tests/slicing/loops.i:204: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X; void loop_slice_1(void) { /*@ loop pragma WIDEN_HINTS X, 10, 100; */ while (1) /*@ slice pragma ctrl; */ ; return; } void main(void) { loop_slice_1(); return; } [kernel] Parsing tests/slicing/result/ocode_9_loops.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/mark_all_slices.res.oracle0000666000000000000000000001460713571573400022365 0ustar [kernel] Parsing tests/slicing/mark_all_slices.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} A2 ∈ {0} B2 ∈ {0} C2 ∈ {0} D2 ∈ {0} [eva] computing for function fA <- main. Called from tests/slicing/mark_all_slices.i:23. [eva] computing for function all <- fA <- main. Called from tests/slicing/mark_all_slices.i:17. [eva] Recording results for all [eva] Done for function all [eva] Recording results for fA [eva] Done for function fA [eva] computing for function fB <- main. Called from tests/slicing/mark_all_slices.i:24. [eva] tests/slicing/mark_all_slices.i:18: Reusing old results for call to all [eva] Recording results for fB [eva] Done for function fB [eva] computing for function fC <- main. Called from tests/slicing/mark_all_slices.i:25. [eva] tests/slicing/mark_all_slices.i:19: Reusing old results for call to all [eva] Recording results for fC [eva] Done for function fC [eva] computing for function fD <- main. Called from tests/slicing/mark_all_slices.i:26. [eva] tests/slicing/mark_all_slices.i:20: Reusing old results for call to all [eva] Recording results for fD [eva] Done for function fD [eva] computing for function all <- main. Called from tests/slicing/mark_all_slices.i:27. [eva] Recording results for all [eva] Done for function all [eva] Recording results for main [eva] done for function main [from] Computing for function all [from] Done for function all [from] Computing for function fA [from] Done for function fA [from] Computing for function fB [from] Done for function fB [from] Computing for function fC [from] Done for function fC [from] Computing for function fD [from] Done for function fD [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function all: A FROM x B FROM x C FROM x D FROM x \result FROM x [from] Function fA: A FROM \nothing B FROM \nothing C FROM \nothing D FROM \nothing \result FROM \nothing [from] Function fB: A FROM \nothing B FROM \nothing C FROM \nothing D FROM \nothing \result FROM \nothing [from] Function fC: A FROM \nothing B FROM \nothing C FROM \nothing D FROM \nothing \result FROM \nothing [from] Function fD: A FROM \nothing B FROM \nothing C FROM \nothing D FROM \nothing \result FROM \nothing [from] Function main: A FROM \nothing B FROM \nothing C FROM \nothing D FROM \nothing A2 FROM \nothing B2 FROM \nothing C2 FROM \nothing D2 FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function fA [pdg] done for function fA [pdg] computing for function all [pdg] done for function all [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int A; int A2; void all_slice_1(int x) { A = x; return; } int fA_slice_1(void) { all_slice_1(1); return A; } void main(void) { A2 = fA_slice_1(); return; } Slicing project worklist [default] = [all_slice_1 = (n:54(restrict to __retres) ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int A; int A2; int all_slice_1(int x) { int __retres; A = x; __retres = x + 1; return __retres; } int fA_slice_1(void) { all_slice_1(1); return A; } void main(void) { A2 = fA_slice_1(); return; } Slicing project worklist [default] = [main_slice_1 = examine_calls] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function fB [pdg] done for function fB [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int A; int B; int A2; int B2; int all_slice_2(int x) { int __retres; B = x; __retres = x + 1; return __retres; } int all_slice_1(int x) { int __retres; A = x; __retres = x + 1; return __retres; } int fA_slice_1(void) { all_slice_1(1); return A; } int fB_slice_1(void) { all_slice_2(1); return B; } void main(void) { A2 = fA_slice_1(); B2 = fB_slice_1(); return; } [slicing] reinitializing slicing ... Slicing project worklist [default] = [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int all_slice_1(int x) { int __retres; __retres = x + 1; return __retres; } [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int A; int A2; int all_slice_2(int x) { int __retres; A = x; __retres = x + 1; return __retres; } int all_slice_1(int x) { int __retres; __retres = x + 1; return __retres; } int fA_slice_1(void) { all_slice_2(1); return A; } void main(void) { A2 = fA_slice_1(); return; } frama-c-20.0-Calcium/tests/slicing/oracle/merge.res.oracle0000666000000000000000000000753113571573400020336 0ustar [kernel] Parsing tests/slicing/merge.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} G2 ∈ {0} G3 ∈ {0} [eva] computing for function g <- main. Called from tests/slicing/merge.i:26. [eva] computing for function init <- g <- main. Called from tests/slicing/merge.i:21. [eva] Recording results for init [eva] Done for function init [eva] computing for function add <- g <- main. Called from tests/slicing/merge.i:22. [eva:alarm] tests/slicing/merge.i:17: Warning: signed overflow. assert -2147483648 ≤ G1 + a1; [eva:alarm] tests/slicing/merge.i:17: Warning: signed overflow. assert G1 + a1 ≤ 2147483647; [eva:alarm] tests/slicing/merge.i:17: Warning: signed overflow. assert -2147483648 ≤ G2 + a2; [eva:alarm] tests/slicing/merge.i:17: Warning: signed overflow. assert G2 + a2 ≤ 2147483647; [eva:alarm] tests/slicing/merge.i:17: Warning: signed overflow. assert -2147483648 ≤ G3 + a3; [eva:alarm] tests/slicing/merge.i:17: Warning: signed overflow. assert G3 + a3 ≤ 2147483647; [eva] Recording results for add [eva] Done for function add [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [from] Computing for function add [from] Done for function add [from] Computing for function init [from] Done for function init [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function add: G1 FROM G1; a1 G2 FROM G2; a2 G3 FROM G3; a3 [from] Function init: G1 FROM a1 G2 FROM a2 G3 FROM a3 [from] Function g: G1 FROM a1 G2 FROM a2 G3 FROM a3 [from] Function main: G1 FROM x G2 FROM y G3 FROM z [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function init [pdg] done for function init Processing slicing_merge : ... [pdg] computing for function g [pdg] done for function g Processing slicing_merge : ...[pdg] computing for function add [pdg] done for function add ......... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [slicing] applying actions: 2/2... Processing slicing_merge : ...... [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int G1; int G2; int G3; void init_slice_4(int a1, int a2); void init_slice_3(int a3); void add_slice_3(int a2); void add_slice_2(int a3); void add_slice_1(int a1); void g_slice_4(int a3); void g_slice_3(int a3); void g_slice_2(int a1, int a2); void g_slice_1(int a1, int a2); void init_slice_4(int a1, int a2) { G1 = a1; G2 = a2; return; } void init_slice_3(int a3) { G3 = a3; return; } void add_slice_3(int a2) { G2 += a2; return; } void add_slice_2(int a3) { G3 += a3; return; } void add_slice_1(int a1) { G1 += a1; return; } void g_slice_4(int a3) { init_slice_3(a3); add_slice_2(a3); return; } void g_slice_3(int a3) { init_slice_3(a3); add_slice_2(a3); return; } void g_slice_2(int a1, int a2) { init_slice_4(a1,a2); add_slice_3(a2); return; } void g_slice_1(int a1, int a2) { init_slice_4(a1,a2); add_slice_1(a1); return; } removing generated .jpg files frama-c-20.0-Calcium/tests/slicing/oracle/min_call.res.oracle0000666000000000000000000000033513571573400021010 0ustar [kernel] Parsing tests/slicing/min_call.i (no preprocessing) [kernel] User Error: cannot find entry point `g'. Please use option `-main' for specifying a valid entry point. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/slicing/oracle/ptr_fct.res.oracle0000666000000000000000000000434713571573400020702 0ustar [kernel] Parsing tests/slicing/ptr_fct.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at h [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} ptf ∈ {0} [eva] computing for function g <- h. Called from tests/slicing/ptr_fct.i:23. [eva] computing for function f2 <- g <- h. Called from tests/slicing/ptr_fct.i:17. [kernel:annot:missing-spec] tests/slicing/ptr_fct.i:17: Warning: Neither code nor specification for function f2, generating default assigns from the prototype [eva] using specification for function f2 [eva] Done for function f2 [eva] computing for function f1 <- g <- h. Called from tests/slicing/ptr_fct.i:17. [eva] Recording results for f1 [eva] Done for function f1 [eva] Recording results for g [eva] Done for function g [eva] Recording results for h [eva] done for function h [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function h [from] Computing for function g [from] Computing for function f1 <-g [from] Done for function f1 [from] Computing for function f2 <-g [from] Done for function f2 [from] Done for function g [pdg] done for function h [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function g [pdg] done for function g [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ typedef void (*PTF)(int ); int X; void f1(int x) { X = x; return; } /*@ assigns \nothing; */ void f2(int y); void (*ptf)(int ) = (void (*)(int ))0; void g(int arg); void g_slice_1(int arg) { if (arg > 0) ptf = & f1; else ptf = & f2; (*ptf)(arg); return; } PTF h(int a, int b) { if (b) { ptf = & g; g_slice_1(a); } return ptf; } [kernel] Parsing tests/slicing/result/ocode_0_ptr_fct.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/same_sliced_name_bts1422.res.oracle0000666000000000000000000000243513571573400023666 0ustar [kernel] Parsing tests/slicing/same_sliced_name_bts1422.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at foo [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization y ∈ {0} ptr ∈ {{ &foo }} [eva:alarm] tests/slicing/same_sliced_name_bts1422.i:9: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for foo [eva] done for function foo [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function foo [pdg] done for function foo [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int y; void foo(void); void foo(void) { y ++; return; } [kernel] Parsing tests/slicing/result/ocode_0_same_sliced_name_bts1422.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.0.res.oracle0000666000000000000000000003617713571573400022555 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... RESULT for main: {n1}: InCtrl {n2}: VarDecl : a {n3}: VarDecl : b {n4}: VarDecl : c {n5}: VarDecl : x {n6}: int a = 0; -[-c-]-> 1 -[a--]-> 2 {n7}: int b = 0; -[-c-]-> 1 -[a--]-> 3 {n8}: int c = 0; -[-c-]-> 1 -[a--]-> 4 {n9}: d > 0 -[-c-]-> 1 -[--d]-> 57 {n10}: ; -[-c-]-> 1 -[-c-]-> 9 {n11}: a = 1; -[-c-]-> 1 -[a--]-> 2 -[-c-]-> 9 {n12}: ; -[-c-]-> 1 {n13}: int x = ((a + b) + c) + d; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 4 -[a--]-> 5 -[--d]-> 6 -[--d]-> 7 -[--d]-> 8 -[--d]-> 11 -[--d]-> 57 {n14}: Call113-InCtrl : modifS(a,b); -[-c-]-> 1 {n15}: Call113-In1 : modifS(a,b); -[-c-]-> 1 -[--d]-> 2 -[--d]-> 6 -[--d]-> 11 -[-c-]-> 14 {n16}: Call113-In2 : modifS(a,b); -[-c-]-> 1 -[--d]-> 3 -[--d]-> 7 -[-c-]-> 14 {n17}: Call113-Out(S.a) : modifS(a,b); -[-c-]-> 1 -[-c-]-> 14 -[--d]-> 15 -[--d]-> 56 {n18}: Call113-Out(S.b) : modifS(a,b); -[-c-]-> 1 -[-c-]-> 14 -[--d]-> 16 -[--d]-> 55 {n19}: Call114-InCtrl : d = new_int(); -[-c-]-> 1 {n20}: Call114-OutRet : d = new_int(); -[-c-]-> 1 -[-c-]-> 19 {n21}: Call115-InCtrl : f1(d); -[-c-]-> 1 {n22}: Call115-In1 : f1(d); -[-c-]-> 1 -[--d]-> 20 -[-c-]-> 21 {n23}: Call115-Out(Sa) : f1(d); -[-c-]-> 1 -[--d](S.a)-> 17 -[-c-]-> 21 -[--d]-> 22 {n24}: Call116-InCtrl : f2(d); -[-c-]-> 1 {n25}: Call116-In1 : f2(d); -[-c-]-> 1 -[--d]-> 20 -[-c-]-> 24 {n26}: Call116-Out(Sa) : f2(d); -[-c-]-> 1 -[--d](S.a)-> 17 -[-c-]-> 24 -[--d]-> 25 {n27}: Call117-InCtrl : f3(d); -[-c-]-> 1 {n28}: Call117-In1 : f3(d); -[-c-]-> 1 -[--d]-> 20 -[-c-]-> 27 {n29}: Call117-Out(Sa) : f3(d); -[-c-]-> 1 -[--d](S.a)-> 17 -[-c-]-> 27 -[--d]-> 28 {n30}: Call118-InCtrl : f4(d); -[-c-]-> 1 {n31}: Call118-In1 : f4(d); -[-c-]-> 1 -[--d]-> 20 -[-c-]-> 30 {n32}: Call118-Out(Sa) : f4(d); -[-c-]-> 1 -[--d](S.a)-> 17 -[-c-]-> 30 -[--d]-> 31 {n33}: Call119-InCtrl : f5(d); -[-c-]-> 1 {n34}: Call119-In1 : f5(d); -[-c-]-> 1 -[--d]-> 20 -[-c-]-> 33 {n35}: Call119-Out(Sa) : f5(d); -[-c-]-> 1 -[--d](S.a)-> 17 -[-c-]-> 33 -[--d]-> 34 {n36}: Call120-InCtrl : f6(d); -[-c-]-> 1 {n37}: Call120-In1 : f6(d); -[-c-]-> 1 -[--d]-> 20 -[-c-]-> 36 {n38}: Call120-Out(Sa) : f6(d); -[-c-]-> 1 -[--d](S.a)-> 17 -[-c-]-> 36 -[--d]-> 37 {n39}: Call121-InCtrl : f7(d); -[-c-]-> 1 {n40}: Call121-In1 : f7(d); -[-c-]-> 1 -[--d]-> 20 -[-c-]-> 39 {n41}: Call121-Out(Sa) : f7(d); -[-c-]-> 1 -[--d](S.a)-> 17 -[-c-]-> 39 -[--d]-> 40 {n42}: Call122-InCtrl : f8(d); -[-c-]-> 1 {n43}: Call122-In1 : f8(d); -[-c-]-> 1 -[--d]-> 20 -[-c-]-> 42 {n44}: Call122-Out(S.a) : f8(d); -[-c-]-> 1 -[--d](S.a)-> 17 -[-c-]-> 42 -[--d]-> 43 {n45}: Call122-Out(Sa) : f8(d); -[-c-]-> 1 -[--d](S.a)-> 17 -[-c-]-> 42 -[--d]-> 43 {n46}: Call123-InCtrl : f9(d,a); -[-c-]-> 1 {n47}: Call123-In1 : f9(d,a); -[-c-]-> 1 -[--d]-> 20 -[-c-]-> 46 {n48}: Call123-In2 : f9(d,a); -[-c-]-> 1 -[--d]-> 2 -[--d]-> 6 -[--d]-> 11 -[-c-]-> 46 {n49}: Call123-Out(X9) : f9(d,a); -[-c-]-> 1 -[-c-]-> 46 -[--d]-> 47 -[--d]-> 48 {n50}: Call123-Out(Y9) : f9(d,a); -[-c-]-> 1 -[-c-]-> 46 -[--d]-> 54 {n51}: Call123-Out(Z9) : f9(d,a); -[-c-]-> 1 -[-c-]-> 46 -[--d]-> 48 {n52}: return x; -[-c-]-> 1 -[--d]-> 5 -[--d]-> 13 {n53}: OutRet -[--d]-> 52 {n54}: In(Z9) {n55}: In(S.b) {n56}: In(S.a) {n57}: In(d) [pdg] computing for function modifS [pdg] done for function modifS [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... RESULT for modifS: {n58}: InCtrl {n59}: VarDecl : a -[a--]-> 60 {n60}: In1 -[a--]-> 59 {n61}: VarDecl : b -[a--]-> 62 {n62}: In2 -[a--]-> 61 {n63}: S.a += a; -[-c-]-> 58 -[--d]-> 59 -[--d]-> 60 -[--d]-> 68 {n64}: S.b -= b; -[-c-]-> 58 -[--d]-> 61 -[--d]-> 62 -[--d]-> 67 {n65}: ; -[-c-]-> 58 {n66}: return; -[-c-]-> 58 {n67}: In(S.b) {n68}: In(S.a) Slicing project worklist [default] = [modifS = (n:65 ,<[ S ], [---]>)(n:63(restrict to S.a) ,<[--d], [---]>)(n:65 , <[ S ], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... struct Tstr { int a ; int b ; }; struct Tstr S; int Sa; int X9; int Y9; int Z9; Print slice = modifS_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(S.a): <[--d], [---]>) /**/void modifS(/* <[--d], [---]> */ int a, /* <[---], [---]> */ int b) { /*@ assert Eva: signed_overflow: S.a + a ≤ 2147483647; */ /* <[--d], [---]> */ S.a += a; /* <[---], [---]> */ S.b -= b; /*@ slice pragma expr S.a; */ /* <[ S ], [---]> */ ; /* <[---], [---]> */ return; } /*@ assigns \result; assigns \result \from \nothing; */ int new_int(void); int d; Print slice = main_slice_1: (InCtrl: <[--d], [---]>) (In(d): <[--d], [---]>) (In(S.a): <[--d], [---]>) /**/int main(void) { /* <[--d], [---]> */ /* <[--d], [---]> */ int a = 0; /* <[--d], [---]> */ /* <[--d], [---]> */ int b = 0; /* <[---], [---]> */ /* <[---], [---]> */ int c = 0; /* <[--d], [---]> */ if (d > 0) { /*@ assert b ≡ 0; */ /* <[---], [---]> */ ; /* <[--d], [---]> */ a = 1; } /*@ slice pragma expr a + b; */ /* <[ S ], [---]> */ ; /*@ assert Eva: signed_overflow: (int)((int)(a + b) + c) + d ≤ 2147483647; */ /* <[---], [---]> */ /* <[---], [---]> */ int x = ((a + b) + c) + d; /* sig call: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) */ /* call to modifS_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(S.a): <[--d], [---]>) */ /* <[--d], [---]> */ modifS(a,b); /* invisible call */ /* <[---], [---]> */ d = new_int(); /* invisible call */ /* <[---], [---]> */ f1(d); /* invisible call */ /* <[---], [---]> */ f2(d); /* invisible call */ /* <[---], [---]> */ f3(d); /* invisible call */ /* <[---], [---]> */ f4(d); /* invisible call */ /* <[---], [---]> */ f5(d); /* invisible call */ /* <[---], [---]> */ f6(d); /* invisible call */ /* <[---], [---]> */ f7(d); /* invisible call */ /* <[---], [---]> */ f8(d); /* invisible call */ /* <[---], [---]> */ f9(d,a); /* <[---], [---]> */ return x; } Slicing project worklist [default] = [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; void modifS_slice_1(int a) { S.a += a; /*@ slice pragma expr S.a; */ ; return; } int d; void main(void) { int a = 0; int b = 0; if (d > 0) { /*@ assert b ≡ 0; */ ; a = 1; } /*@ slice pragma expr a + b; */ ; modifS_slice_1(a); return; } [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... struct Tstr { int a ; int b ; }; struct Tstr S; int Sa; int X9; int Y9; int Z9; Print slice = modifS_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(S.a): <[--d], [---]>) /**/void modifS(/* <[--d], [---]> */ int a, /* <[---], [---]> */ int b) { /*@ assert Eva: signed_overflow: S.a + a ≤ 2147483647; */ /* <[--d], [---]> */ S.a += a; /* <[---], [---]> */ S.b -= b; /*@ slice pragma expr S.a; */ /* <[ S ], [---]> */ ; /* <[---], [---]> */ return; } /*@ assigns \result; assigns \result \from \nothing; */ int new_int(void); int d; Print slice = main_slice_1: (InCtrl: <[--d], [---]>) (In(d): <[--d], [---]>) (In(S.a): <[--d], [---]>) /**/int main(void) { /* <[--d], [---]> */ /* <[--d], [---]> */ int a = 0; /* <[--d], [---]> */ /* <[--d], [---]> */ int b = 0; /* <[---], [---]> */ /* <[---], [---]> */ int c = 0; /* <[--d], [---]> */ if (d > 0) { /*@ assert b ≡ 0; */ /* <[---], [---]> */ ; /* <[--d], [---]> */ a = 1; } /*@ slice pragma expr a + b; */ /* <[ S ], [---]> */ ; /*@ assert Eva: signed_overflow: (int)((int)(a + b) + c) + d ≤ 2147483647; */ /* <[---], [---]> */ /* <[---], [---]> */ int x = ((a + b) + c) + d; /* sig call: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) */ /* call to modifS_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(S.a): <[--d], [---]>) */ /* <[--d], [---]> */ modifS(a,b); /* invisible call */ /* <[---], [---]> */ d = new_int(); /* invisible call */ /* <[---], [---]> */ f1(d); /* invisible call */ /* <[---], [---]> */ f2(d); /* invisible call */ /* <[---], [---]> */ f3(d); /* invisible call */ /* <[---], [---]> */ f4(d); /* invisible call */ /* <[---], [---]> */ f5(d); /* invisible call */ /* <[---], [---]> */ f6(d); /* invisible call */ /* <[---], [---]> */ f7(d); /* invisible call */ /* <[---], [---]> */ f8(d); /* invisible call */ /* <[---], [---]> */ f9(d,a); /* <[---], [---]> */ return x; } Slicing project worklist [default] = [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; void modifS_slice_1(int a) { S.a += a; /*@ slice pragma expr S.a; */ ; return; } int d; void main(void) { int a = 0; int b = 0; if (d > 0) { /*@ assert b ≡ 0; */ ; a = 1; } /*@ slice pragma expr a + b; */ ; modifS_slice_1(a); return; } frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.1.res.oracle0000666000000000000000000001377113571573400022551 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int d; void main(void) { int a = 0; int b = 0; if (d > 0) { /*@ assert b ≡ 0; */ ; a = 1; } /*@ slice pragma expr a + b; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_1_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.10.res.oracle0000666000000000000000000001405013571573400022620 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f7 [pdg] done for function f7 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; int Sa; void f7_slice_1(int cond) { int *p = & S.a; if (cond) { /*@ slice pragma stmt; */ { Sa = *p; Sa ++; } } return; } [kernel] Parsing tests/slicing/result/ocode_10_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.11.res.oracle0000666000000000000000000001401313571573400022620 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f8 [pdg] done for function f8 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f8_slice_1(int cond) { /*@ loop invariant cond ≥ 0; loop variant cond; */ while (cond) { /*@ assert cond ≤ \at(cond,Pre); */ ; cond --; } return; } [kernel] Parsing tests/slicing/result/ocode_11_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.12.res.oracle0000666000000000000000000001415513571573400022630 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f8 [pdg] done for function f8 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; void f8_slice_1(int cond) { /*@ loop invariant cond ≥ 0; loop variant cond; */ while (cond) { /*@ assert cond ≤ \at(cond,Pre); */ ; /*@ slice pragma stmt; */ (S.a) ++; cond --; } return; } [kernel] Parsing tests/slicing/result/ocode_12_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.13.res.oracle0000666000000000000000000001412313571573400022624 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f8 [pdg] done for function f8 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; void f8_slice_1(int cond) { int *p = & S.a; /*@ loop invariant cond ≥ 0; loop variant cond; */ while (cond) { /*@ assert cond ≤ \at(cond,Pre); */ ; cond --; } return; } [kernel] Parsing tests/slicing/result/ocode_13_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.14.res.oracle0000666000000000000000000001373213571573400022632 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f9 [pdg] done for function f9 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int X9; void f9_slice_1(int c1, int c2) { if (c1 > c2) goto L; c1 = c2; /*@ slice pragma stmt; */ L: X9 = c1; return; } [kernel] Parsing tests/slicing/result/ocode_14_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.2.res.oracle0000666000000000000000000001367013571573400022550 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int d; void main(void) { int b = 0; if (d > 0) /*@ assert b ≡ 0; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_2_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.3.res.oracle0000666000000000000000000001375413571573400022554 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function modifS [pdg] done for function modifS [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; void modifS_slice_1(int a) { S.a += a; /*@ slice pragma expr S.a; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_3_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.4.res.oracle0000666000000000000000000001374413571573400022554 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f1 [pdg] done for function f1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; void f1_slice_1(void) { int *p = & S.a; /*@ slice pragma expr *p; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_4_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.5.res.oracle0000666000000000000000000001372313571573400022552 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f2 [pdg] done for function f2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; void f2_slice_1(void) { /*@ slice pragma expr S.a; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_5_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.6.res.oracle0000666000000000000000000001365413571573400022556 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f3 [pdg] done for function f3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f3_slice_1(int cond) { if (cond) /*@ slice pragma ctrl; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_6_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.7.res.oracle0000666000000000000000000001400713571573400022550 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f4 [pdg] done for function f4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; int Sa; void f4_slice_1(int cond) { int *p = & S.a; if (cond) /*@ slice pragma stmt; */ Sa = *p; return; } [kernel] Parsing tests/slicing/result/ocode_7_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.8.res.oracle0000666000000000000000000001365613571573400022562 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f5 [pdg] done for function f5 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void f5_slice_1(int cond) { if (cond) /*@ slice pragma expr 1; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_8_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_by_annot.9.res.oracle0000666000000000000000000001402513571573400022552 0ustar [kernel] Parsing tests/slicing/select_by_annot.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ [--..--] Sa ∈ [--..--] X9 ∈ [--..--] Y9 ∈ [--..--] Z9 ∈ [--..--] d ∈ [--..--] [eva] tests/slicing/select_by_annot.i:133: assertion got status valid. [eva:alarm] tests/slicing/select_by_annot.i:137: Warning: signed overflow. assert (int)((int)(a + b) + c) + d ≤ 2147483647; [eva] computing for function modifS <- main. Called from tests/slicing/select_by_annot.i:138. [eva:alarm] tests/slicing/select_by_annot.i:122: Warning: signed overflow. assert S.a + a ≤ 2147483647; [eva] Recording results for modifS [eva] Done for function modifS [eva] computing for function new_int <- main. Called from tests/slicing/select_by_annot.i:140. [kernel:annot:missing-spec] tests/slicing/select_by_annot.i:140: Warning: Neither code nor specification for function new_int, generating default assigns from the prototype [eva] using specification for function new_int [eva] Done for function new_int [eva] computing for function f1 <- main. Called from tests/slicing/select_by_annot.i:141. [eva:alarm] tests/slicing/select_by_annot.i:29: Warning: assertion got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/select_by_annot.i:142. [eva:alarm] tests/slicing/select_by_annot.i:39: Warning: assertion got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/select_by_annot.i:143. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/select_by_annot.i:144. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/select_by_annot.i:145. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/select_by_annot.i:146. [eva:alarm] tests/slicing/select_by_annot.i:77: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/slicing/select_by_annot.i:147. [eva:alarm] tests/slicing/select_by_annot.i:88: Warning: signed overflow. assert Sa + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/select_by_annot.i:148. [eva:alarm] tests/slicing/select_by_annot.i:97: Warning: loop invariant got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:100: Warning: assertion got status unknown. [eva:alarm] tests/slicing/select_by_annot.i:104: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/slicing/select_by_annot.i:149. [eva] Recording results for f9 [eva] Done for function f9 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function modifS [from] Done for function modifS [from] Computing for function main [from] Computing for function new_int <-main [from] Done for function new_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f2: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f3: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f4: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f5: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f6: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f7: Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f8: S.a FROM S.a; cond (and SELF) Sa FROM S.a; cond (and SELF) \result FROM S.a; Sa; cond [from] Function f9: X9 FROM c1; c2 Y9 FROM Z9 Z9 FROM c2 [from] Function modifS: S.a FROM S.a; a .b FROM S.b; b [from] Function new_int: \result FROM \nothing [from] Function main: S.a FROM S.a; d .b FROM S.b Sa FROM S.a; d (and SELF) X9 FROM d Y9 FROM Z9 Z9 FROM d d FROM \nothing \result FROM d [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f6 [pdg] done for function f6 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct Tstr { int a ; int b ; }; struct Tstr S; int Sa; void f6_slice_1(int cond) { int *p = & S.a; /*@ slice pragma stmt; */ if (cond) { Sa = *p; Sa ++; } return; } [kernel] Parsing tests/slicing/result/ocode_9_select_by_annot.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_calls.0.res.oracle0000666000000000000000000000636413571573400022035 0ustar [kernel] Parsing tests/slicing/select_calls.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] d ∈ [--..--] [eva] computing for function send <- f. Called from tests/slicing/select_calls.i:22. [kernel:annot:missing-spec] tests/slicing/select_calls.i:22: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] computing for function send <- f. Called from tests/slicing/select_calls.i:23. [eva] Done for function send [eva] computing for function crypt <- f. Called from tests/slicing/select_calls.i:24. [kernel:annot:missing-spec] tests/slicing/select_calls.i:24: Warning: Neither code nor specification for function crypt, generating default assigns from the prototype [eva] using specification for function crypt [eva] Done for function crypt [eva] computing for function send <- f. Called from tests/slicing/select_calls.i:25. [eva] Done for function send [eva] computing for function send <- f. Called from tests/slicing/select_calls.i:28. [eva] Done for function send [eva] computing for function uncrypt <- f. Called from tests/slicing/select_calls.i:30. [kernel:annot:missing-spec] tests/slicing/select_calls.i:30: Warning: Neither code nor specification for function uncrypt, generating default assigns from the prototype [eva] using specification for function uncrypt [eva] Done for function uncrypt [eva] computing for function send <- f. Called from tests/slicing/select_calls.i:31. [eva] Done for function send [eva] computing for function crypt <- f. Called from tests/slicing/select_calls.i:33. [eva] Done for function crypt [eva] computing for function send <- f. Called from tests/slicing/select_calls.i:35. [eva] Done for function send [eva] Recording results for f [eva] done for function f [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function send [from] Done for function send [from] Computing for function crypt [from] Done for function crypt [from] Computing for function uncrypt [from] Done for function uncrypt [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ /*@ assigns \nothing; */ void send(int x); void crypt(int *x); void uncrypt(int *x); int c; int d; void f(void) { int x = 0; int y = 1; int z = x; send(y); send(z); crypt(& y); send(y); if (y) send(y); if (d) uncrypt(& y); send(y); crypt(& y); if (c) y = z; send(y); return; } [kernel] Parsing tests/slicing/result/ocode_0_select_calls.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_calls.1.res.oracle0000666000000000000000000000310213571573400022021 0ustar [kernel] Parsing tests/slicing/select_calls.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] d ∈ [--..--] [eva] computing for function nothing <- g. Called from tests/slicing/select_calls.i:42. [kernel:annot:missing-spec] tests/slicing/select_calls.i:42: Warning: Neither code nor specification for function nothing, generating default assigns from the prototype [eva] using specification for function nothing [eva] Done for function nothing [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function g [from] Computing for function nothing [from] Done for function nothing [pdg] done for function g [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ /*@ assigns \nothing; */ void nothing(void); void g(void) { nothing(); return; } [kernel] Parsing tests/slicing/result/ocode_1_select_calls.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.0.res.oracle0000666000000000000000000001052713571573400022252 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); int k(int a, int b, int c, int d) { int cond = get(d); G = b; H = c; if (cond) send_bis(d); return a; } void f_slice_1(int y); void f_slice_1(int y) { int r = k(0,y,0,0); int z = k(G,0,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_0_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.1.res.oracle0000666000000000000000000001044613571573400022253 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; /*@ assigns \nothing; */ void send(int x); int k_slice_1(int a, int b, int c) { G = b; H = c; return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_1_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.10.res.oracle0000666000000000000000000001127513571573400022334 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function g [from] Computing for function f [from] Done for function f [pdg] done for function g [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_slice_2(int b, int d) { int cond = get(d); G = b; if (cond) send_bis(d); return; } int k_slice_1(int a, int d) { int cond = get(d); if (cond) send_bis(d); return a; } void f_slice_1(int y); void g(int b) { k_slice_2(0,0); f_slice_1(b); return; } void f_slice_1(int y) { k_slice_2(0,0); k_slice_2(y,0); int z = k_slice_1(G,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_10_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.11.res.oracle0000666000000000000000000001044113571573400022327 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int get(int y); /*@ assigns \nothing; */ void send_bis(int x); int k(int a, int b, int c, int d) { int cond = get(d); G = b; H = c; if (cond) send_bis(d); return a; } int f_slice_1(int y); int f_slice_1(int y) { int r = k(0,y,0,0); int z = k(G,0,0,0); /*@ slice pragma expr z; */ ; return z; } [kernel] Parsing tests/slicing/result/ocode_11_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.12.res.oracle0000666000000000000000000001036013571573400022330 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int k_slice_1(int a, int b, int c) { G = b; H = c; return a; } int f_slice_1(int y); int f_slice_1(int y) { k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; return z; } [kernel] Parsing tests/slicing/result/ocode_12_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.13.res.oracle0000666000000000000000000001032513571573400022332 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int k_slice_1(int a, int b) { G = b; return a; } int f_slice_1(int y); int f_slice_1(int y) { k_slice_1(0,y); int z = k_slice_1(G,0); /*@ slice pragma expr z; */ ; return z; } [kernel] Parsing tests/slicing/result/ocode_13_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.14.res.oracle0000666000000000000000000001035713571573400022340 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; void k_slice_2(int b) { G = b; return; } int k_slice_1(int a) { return a; } int f_slice_1(int y); int f_slice_1(int y) { k_slice_2(y); int z = k_slice_1(G); /*@ slice pragma expr z; */ ; return z; } [kernel] Parsing tests/slicing/result/ocode_14_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.15.res.oracle0000666000000000000000000001044113571573400022333 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int get(int y); /*@ assigns \nothing; */ void send_bis(int x); int k(int a, int b, int c, int d) { int cond = get(d); G = b; H = c; if (cond) send_bis(d); return a; } void f_slice_1(int y); void f_slice_1(int y) { int r = k(0,y,0,0); int z = k(G,0,0,0); /*@ slice pragma expr z; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_15_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.16.res.oracle0000666000000000000000000001036013571573400022334 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int k_slice_1(int a, int b, int c) { G = b; H = c; return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_16_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.17.res.oracle0000666000000000000000000001032513571573400022336 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int k_slice_1(int a, int b) { G = b; return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y); int z = k_slice_1(G,0); /*@ slice pragma expr z; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_17_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.18.res.oracle0000666000000000000000000001035713571573400022344 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; void k_slice_2(int b) { G = b; return; } int k_slice_1(int a) { return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_2(y); int z = k_slice_1(G); /*@ slice pragma expr z; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_18_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.19.res.oracle0000666000000000000000000001055513571573400022345 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function g [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function f [from] Computing for function send <-f [from] Done for function send [from] Done for function f [pdg] done for function g [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int k_slice_1(int a, int b, int c) { G = b; H = c; return a; } void f_slice_1(int y); void g(int b) { f_slice_1(b); return; } void f_slice_1(int y) { k_slice_1(0,y,0); k_slice_1(G,0,0); return; } [kernel] Parsing tests/slicing/result/ocode_19_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.2.res.oracle0000666000000000000000000001041313571573400022246 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; /*@ assigns \nothing; */ void send(int x); int k_slice_1(int a, int b) { G = b; return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y); int z = k_slice_1(G,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_2_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.20.res.oracle0000666000000000000000000001046213571573400022332 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function g [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function f [from] Computing for function send <-f [from] Done for function send [from] Done for function f [pdg] done for function g [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int H; void k_slice_1(int c) { H = c; return; } void f_slice_1(void); void g(void) { f_slice_1(); return; } void f_slice_1(void) { k_slice_1(0); return; } [kernel] Parsing tests/slicing/result/ocode_20_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.21.res.oracle0000666000000000000000000001046213571573400022333 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function g [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function f [from] Computing for function send <-f [from] Done for function send [from] Done for function f [pdg] done for function g [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int H; void k_slice_1(int c) { H = c; return; } void f_slice_1(void); void g(void) { f_slice_1(); return; } void f_slice_1(void) { k_slice_1(0); return; } [kernel] Parsing tests/slicing/result/ocode_21_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.3.res.oracle0000666000000000000000000001044513571573400022254 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; /*@ assigns \nothing; */ void send(int x); void k_slice_2(int b) { G = b; return; } int k_slice_1(int a) { return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_2(y); int z = k_slice_1(G); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_3_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.4.res.oracle0000666000000000000000000001065013571573400022253 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); int k_slice_1(int a, int b, int d) { int cond = get(d); G = b; if (cond) send_bis(d); return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_4_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.5.res.oracle0000666000000000000000000001065013571573400022254 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); int k_slice_1(int a, int b, int d) { int cond = get(d); G = b; if (cond) send_bis(d); return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_5_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.6.res.oracle0000666000000000000000000001065013571573400022255 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); int k_slice_1(int a, int b, int d) { int cond = get(d); G = b; if (cond) send_bis(d); return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_6_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.7.res.oracle0000666000000000000000000001076713571573400022267 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_slice_2(int b, int d) { int cond = get(d); G = b; if (cond) send_bis(d); return; } int k_slice_1(int a, int d) { int cond = get(d); if (cond) send_bis(d); return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_2(y,0); int z = k_slice_1(G,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_7_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.8.res.oracle0000666000000000000000000001116113571573400022255 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function g [from] Computing for function f [from] Done for function f [pdg] done for function g [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); int k_slice_1(int a, int b, int d) { int cond = get(d); G = b; if (cond) send_bis(d); return a; } void f_slice_1(int y); void g(int b) { k_slice_1(0,0,0); f_slice_1(b); return; } void f_slice_1(int y) { k_slice_1(0,0,0); k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_8_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return.9.res.oracle0000666000000000000000000001116113571573400022256 0ustar [kernel] Parsing tests/slicing/select_return.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return.i:45: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return.i:44. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return.i:35. [kernel:annot:missing-spec] tests/slicing/select_return.i:35: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function send_bis <- k <- g. Called from tests/slicing/select_return.i:39. [kernel:annot:missing-spec] tests/slicing/select_return.i:39: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return.i:45. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:49. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:50. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return.i:51. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return.i:35. [eva] Done for function get [eva] computing for function send_bis <- k <- f <- g. Called from tests/slicing/select_return.i:39. [eva] Done for function send_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return.i:53. [kernel:annot:missing-spec] tests/slicing/select_return.i:53: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function send_bis <-k [from] Done for function send_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k [pdg] done for function k [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function g [from] Computing for function f [from] Done for function f [pdg] done for function g [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); int k_slice_1(int a, int b, int d) { int cond = get(d); G = b; if (cond) send_bis(d); return a; } void f_slice_1(int y); void g(int b) { k_slice_1(0,0,0); f_slice_1(b); return; } void f_slice_1(int y) { k_slice_1(0,0,0); k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_9_select_return.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.0.res.oracle0000666000000000000000000001144613571573400023110 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_bis(int ab, int c, int d) { H = c; if (ab) send_bis(d); return; } int k(int a, int b, int c, int d) { int cond = get(d); G = b; k_bis(cond,c,d); return a; } void f_slice_1(int y); void f_slice_1(int y) { int r = k(0,y,0,0); int z = k(G,0,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_0_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.1.res.oracle0000666000000000000000000001146213571573400023107 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [pdg] computing for function k_bis [pdg] done for function k_bis [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; /*@ assigns \nothing; */ void send(int x); void k_bis_slice_1(int c) { H = c; return; } int k_slice_1(int a, int b, int c) { G = b; k_bis_slice_1(c); return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_1_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.10.res.oracle0000666000000000000000000001232413571573400023165 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k_bis [pdg] done for function k_bis [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function g [from] Computing for function f [from] Done for function f [pdg] done for function g [pdg] computing for function k [pdg] done for function k [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_bis_slice_1(int ab, int d) { if (ab) send_bis(d); return; } void k_slice_2(int b, int d) { int cond = get(d); G = b; k_bis_slice_1(cond,d); return; } int k_slice_1(int a, int d) { int cond = get(d); k_bis_slice_1(cond,d); return a; } void f_slice_1(int y); void g(int b) { k_slice_2(0,0); f_slice_1(b); return; } void f_slice_1(int y) { k_slice_2(0,0); k_slice_2(y,0); int z = k_slice_1(G,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_10_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.2.res.oracle0000666000000000000000000001123113571573400023102 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; /*@ assigns \nothing; */ void send(int x); int k_slice_1(int a, int b) { G = b; return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y); int z = k_slice_1(G,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_2_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.3.res.oracle0000666000000000000000000001126313571573400023110 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function k [pdg] done for function k [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; /*@ assigns \nothing; */ void send(int x); void k_slice_2(int b) { G = b; return; } int k_slice_1(int a) { return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_2(y); int z = k_slice_1(G); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_3_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.4.res.oracle0000666000000000000000000001172213571573400023111 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k_bis [pdg] done for function k_bis [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_bis(int ab, int c, int d) { H = c; if (ab) send_bis(d); return; } void k_bis_slice_1(int ab, int d) { if (ab) send_bis(d); return; } int k(int a, int b, int c, int d) { int cond = get(d); G = b; k_bis(cond,c,d); return a; } void f_slice_1(int y); void f_slice_1(int y) { int r = k(0,y,0,0); int z = k(G,0,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_4_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.5.res.oracle0000666000000000000000000001174313571573400023115 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k_bis [pdg] done for function k_bis [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function k [pdg] done for function k [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_bis_slice_1(int ab, int c, int d) { H = c; if (ab) send_bis(d); return; } int k_slice_1(int a, int b, int c, int d) { int cond = get(d); G = b; k_bis_slice_1(cond,c,d); return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y,0,0); int z = k_slice_1(G,0,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_5_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.6.res.oracle0000666000000000000000000001156513571573400023120 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k_bis [pdg] done for function k_bis [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function k [pdg] done for function k [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_bis_slice_1(int ab, int d) { if (ab) send_bis(d); return; } int k_slice_1(int a, int b) { G = b; return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_1(0,y); int z = k_slice_1(G,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_6_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.7.res.oracle0000666000000000000000000001161713571573400023117 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k_bis [pdg] done for function k_bis [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function k [pdg] done for function k [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_bis_slice_1(int ab, int d) { if (ab) send_bis(d); return; } void k_slice_2(int b) { G = b; return; } int k_slice_1(int a) { return a; } void f_slice_1(int y); void f_slice_1(int y) { k_slice_2(y); int z = k_slice_1(G); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_7_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.8.res.oracle0000666000000000000000000001226713571573400023122 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k_bis [pdg] done for function k_bis [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function g [from] Computing for function f [from] Done for function f [pdg] done for function g [pdg] computing for function k [pdg] done for function k [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int H; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_bis_slice_1(int ab, int c, int d) { H = c; if (ab) send_bis(d); return; } int k_slice_1(int a, int b, int c, int d) { int cond = get(d); G = b; k_bis_slice_1(cond,c,d); return a; } void f_slice_1(int y); void g(int b, int c) { k_slice_1(0,0,c,0); f_slice_1(b); return; } void f_slice_1(int y) { k_slice_1(0,0,0,0); k_slice_1(0,y,0,0); int z = k_slice_1(G,0,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_8_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_return_bis.9.res.oracle0000666000000000000000000001221013571573400023107 0ustar [kernel] Parsing tests/slicing/select_return_bis.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/slicing/select_return_bis.i:36: Warning: Calling undeclared function f. Old style K&R code? [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] H ∈ [--..--] I ∈ [--..--] [eva] computing for function k <- g. Called from tests/slicing/select_return_bis.i:35. [eva] computing for function get <- k <- g. Called from tests/slicing/select_return_bis.i:28. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:28: Warning: Neither code nor specification for function get, generating default assigns from the prototype [eva] using specification for function get [eva] Done for function get [eva] computing for function k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- g. Called from tests/slicing/select_return_bis.i:24. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:24: Warning: Neither code nor specification for function send_bis, generating default assigns from the prototype [eva] using specification for function send_bis [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function f <- g. Called from tests/slicing/select_return_bis.i:36. [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:40. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] computing for function k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:30. [eva] computing for function send_bis <- k_bis <- k <- f <- g. Called from tests/slicing/select_return_bis.i:24. [eva] Done for function send_bis [eva] Recording results for k_bis [eva] Done for function k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:41. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- f <- g. Called from tests/slicing/select_return_bis.i:42. [eva] computing for function get <- k <- f <- g. Called from tests/slicing/select_return_bis.i:28. [eva] Done for function get [eva] tests/slicing/select_return_bis.i:30: Reusing old results for call to k_bis [eva] Recording results for k [eva] Done for function k [eva] computing for function send <- f <- g. Called from tests/slicing/select_return_bis.i:44. [kernel:annot:missing-spec] tests/slicing/select_return_bis.i:44: Warning: Neither code nor specification for function send, generating default assigns from the prototype [eva] using specification for function send [eva] Done for function send [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function k [from] Computing for function get <-k [from] Done for function get [from] Computing for function k_bis <-k [from] Computing for function send_bis <-k_bis <-k [from] Done for function send_bis [from] Done for function k_bis [from] Done for function k [from] Computing for function send [from] Done for function send [pdg] done for function f [pdg] computing for function k_bis [pdg] done for function k_bis [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function g [from] Computing for function f [from] Done for function f [pdg] done for function g [pdg] computing for function k [pdg] done for function k [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int get(int y); /*@ assigns \nothing; */ void send(int x); /*@ assigns \nothing; */ void send_bis(int x); void k_bis_slice_1(int ab, int d) { if (ab) send_bis(d); return; } int k_slice_1(int a, int b, int d) { int cond = get(d); G = b; k_bis_slice_1(cond,d); return a; } void f_slice_1(int y); void g(int b) { k_slice_1(0,0,0); f_slice_1(b); return; } void f_slice_1(int y) { k_slice_1(0,0,0); k_slice_1(0,y,0); int z = k_slice_1(G,0,0); /*@ slice pragma expr z; */ ; send(z); return; } [kernel] Parsing tests/slicing/result/ocode_9_select_return_bis.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/select_simple.res.oracle0000666000000000000000000000034513571573400022063 0ustar [kernel] Parsing tests/slicing/select_simple.i (no preprocessing) [kernel] User Error: cannot find entry point `main'. Please use option `-main' for specifying a valid entry point. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/slicing/oracle/simple_intra_slice.res.oracle0000666000000000000000000006335113571573400023106 0ustar [kernel] Parsing tests/slicing/simple_intra_slice.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Unknown ∈ {0} G ∈ {0} S ∈ {0} S1 ∈ {0} S2 ∈ {0} [eva:alarm] tests/slicing/simple_intra_slice.i:99: Warning: signed overflow. assert -2147483648 ≤ uninit - 1; [eva] tests/slicing/simple_intra_slice.i:98: starting to merge loop iterations [eva:alarm] tests/slicing/simple_intra_slice.i:99: Warning: signed overflow. assert Unknown + 1 ≤ 2147483647; [eva:alarm] tests/slicing/simple_intra_slice.i:99: Warning: signed overflow. assert -2147483648 ≤ Unknown - 1; [eva:alarm] tests/slicing/simple_intra_slice.i:101: Warning: signed overflow. assert -2147483648 ≤ uninit2 - 1; [eva] tests/slicing/simple_intra_slice.i:100: starting to merge loop iterations [eva:alarm] tests/slicing/simple_intra_slice.i:101: Warning: signed overflow. assert S.a + 1 ≤ 2147483647; [eva:alarm] tests/slicing/simple_intra_slice.i:101: Warning: signed overflow. assert -2147483648 ≤ S.a - 1; [eva] computing for function f2 <- main. Called from tests/slicing/simple_intra_slice.i:103. [eva] computing for function f1 <- f2 <- main. Called from tests/slicing/simple_intra_slice.i:23. [eva] Recording results for f1 [eva] Done for function f1 [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/slicing/simple_intra_slice.i:104. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/slicing/simple_intra_slice.i:105. [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/slicing/simple_intra_slice.i:106. [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/slicing/simple_intra_slice.i:107. [eva:alarm] tests/slicing/simple_intra_slice.i:71: Warning: signed overflow. assert -2147483648 ≤ 10 * n; [eva:alarm] tests/slicing/simple_intra_slice.i:71: Warning: signed overflow. assert 10 * n ≤ 2147483647; [eva] Recording results for f6 [eva] Done for function f6 [eva:alarm] tests/slicing/simple_intra_slice.i:107: Warning: signed overflow. assert res + tmp_3 ≤ 2147483647; (tmp_3 from f6(Unknown)) [eva] computing for function f7 <- main. Called from tests/slicing/simple_intra_slice.i:108. [eva:alarm] tests/slicing/simple_intra_slice.i:79: Warning: signed overflow. assert S.a + 3 ≤ 2147483647; [eva:alarm] tests/slicing/simple_intra_slice.i:82: Warning: signed overflow. assert s0.a + 1 ≤ 2147483647; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/slicing/simple_intra_slice.i:110. [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f8 <- main. Called from tests/slicing/simple_intra_slice.i:112. [eva] Recording results for f8 [eva] Done for function f8 [eva] Recording results for main [eva] done for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: G FROM x \result FROM y [from] Function f2: G FROM \nothing \result FROM \nothing [from] Function f3: G FROM Unknown; c (and SELF) \result FROM Unknown; c [from] Function f4: G FROM Unknown; c (and SELF) \result FROM Unknown; c [from] Function f5: G FROM Unknown; G; c (and SELF) \result FROM Unknown; c [from] Function f6: \result FROM Unknown; n [from] Function f7: S.a FROM S.a; s0 {.b; .c} FROM S.a; s0 (and SELF) [from] Function f8: S1.a FROM S1.a; S2.a; ps (and SELF) .b FROM S1.b; S2.b; ps (and SELF) S2.a FROM S1.a; S2.a; ps (and SELF) .b FROM S1.b; S2.b; ps (and SELF) [from] Function main: Unknown FROM Unknown (and SELF) G FROM Unknown S.a FROM S {.b; .c} FROM S (and SELF) S1.a FROM Unknown; S1.a; S2.a (and SELF) .b FROM Unknown; S1.b; S2.b (and SELF) S2.a FROM Unknown; S1.a; S2.a (and SELF) .b FROM Unknown; S1.b; S2.b (and SELF) \result FROM Unknown [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function f1 [pdg] done for function f1 RESULT for f1: {n1}: InCtrl {n2}: VarDecl : x -[a--]-> 3 {n3}: In1 -[a--]-> 2 {n4}: VarDecl : y -[a--]-> 5 {n5}: In2 -[a--]-> 4 {n6}: VarDecl : a {n7}: VarDecl : b {n8}: VarDecl : __retres {n9}: int a = 1; -[-c-]-> 1 -[a--]-> 6 {n10}: int b = 2; -[-c-]-> 1 -[a--]-> 7 {n11}: G = x + a; -[-c-]-> 1 -[--d]-> 2 -[--d]-> 3 -[--d]-> 6 -[--d]-> 9 {n12}: __retres = y + b; -[-c-]-> 1 -[--d]-> 4 -[--d]-> 5 -[--d]-> 7 -[a--]-> 8 -[--d]-> 10 {n13}: return __retres; -[-c-]-> 1 -[--d]-> 8 -[--d]-> 12 {n14}: OutRet -[--d]-> 13 int f1(int x, int y) { int __retres; /* 1 */ int a = 1; /* 2 */ int b = 2; /* 3 */ G = x + a; /* 5 */ __retres = y + b; /* 124 */ return __retres; } Slicing project worklist [default] = [f1_slice_1 = (n:11 ,<[ S ], [---]>)(n:1 ,<[-c-], [---]>)(n:2 ,<[--d], [---]>)(n:3 , <[--d], [---]>)(n:6 ,<[--d], [---]>)(n:9 ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Print slice = f1_slice_1: (InCtrl: <[-cd], [---]>) (In1: <[--d], [---]>) /**/int f1(/* <[--d], [---]> */ int x, /* <[---], [---]> */ int y) { /* <[---], [---]> */ int __retres; /* <[--d], [---]> */ /* <[--d], [---]> */ int a = 1; /* <[---], [---]> */ /* <[---], [---]> */ int b = 2; /* <[ S ], [---]> */ G = x + a; /* <[---], [---]> */ __retres = y + b; /* <[---], [---]> */ return __retres; } [pdg] computing for function f2 [pdg] done for function f2 RESULT for f2: {n15}: InCtrl {n16}: VarDecl : a {n17}: VarDecl : b {n18}: VarDecl : c {n19}: VarDecl : tmp {n20}: int a = 1; -[-c-]-> 15 -[a--]-> 16 {n21}: int b = a + 1; -[-c-]-> 15 -[--d]-> 16 -[a--]-> 17 -[--d]-> 20 {n22}: int c = 3; -[-c-]-> 15 -[a--]-> 18 {n23}: Call10-InCtrl : tmp = f1(b,c); -[-c-]-> 15 {n24}: Call10-In1 : tmp = f1(b,c); -[-c-]-> 15 -[--d]-> 17 -[--d]-> 21 -[-c-]-> 23 {n25}: Call10-In2 : tmp = f1(b,c); -[-c-]-> 15 -[--d]-> 18 -[--d]-> 22 -[-c-]-> 23 {n26}: Call10-Out(G) : tmp = f1(b,c); -[-c-]-> 15 -[-c-]-> 23 -[--d]-> 24 {n27}: Call10-OutRet : tmp = f1(b,c); -[-c-]-> 15 -[a--]-> 19 -[-c-]-> 23 -[--d]-> 25 {n28}: return tmp; -[-c-]-> 15 -[--d]-> 19 -[--d]-> 27 {n29}: OutRet -[--d]-> 28 int f2(void) { int tmp; /* 7 */ int a = 1; /* 8 */ int b = a + 1; /* 9 */ int c = 3; /* 10 */ tmp = f1(b,c); /* 11 */ return tmp; } Slicing project worklist [default] = [f2_slice_1 = (n:22 ,<[ S ], [---]>)(n:15 ,<[-c-], [---]>)(n:18 ,<[a--], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Print slice = f2_slice_1: (InCtrl: <[-c-], [---]>) /**/int f2(void) { /* <[---], [---]> */ int tmp; /* <[---], [---]> */ /* <[---], [---]> */ int a = 1; /* <[---], [---]> */ /* <[---], [---]> */ int b = a + 1; /* <[ S ], [---]> */ /* <[a--], [---]> */ int c = 3; /* invisible call */ /* <[---], [---]> */ tmp = f1(b,c); /* <[---], [---]> */ return tmp; } [pdg] computing for function f3 [pdg] done for function f3 RESULT for f3: {n30}: InCtrl {n31}: VarDecl : c -[a--]-> 32 {n32}: In1 -[a--]-> 31 {n33}: VarDecl : a {n34}: VarDecl : b {n35}: VarDecl : x {n36}: int a = 1; -[-c-]-> 30 -[a--]-> 33 {n37}: int b = 2; -[-c-]-> 30 -[a--]-> 34 {n38}: int x = 0; -[-c-]-> 30 -[a--]-> 35 {n39}: c > Unknown -[-c-]-> 30 -[--d]-> 31 -[--d]-> 32 -[--d]-> 44 {n40}: x = b; -[-c-]-> 30 -[--d]-> 34 -[a--]-> 35 -[--d]-> 37 -[-c-]-> 39 {n41}: G = a; -[-c-]-> 30 -[--d]-> 33 -[--d]-> 36 -[-c-]-> 39 {n42}: return x; -[-c-]-> 30 -[--d]-> 35 -[--d]-> 38 -[--d]-> 40 {n43}: OutRet -[--d]-> 42 {n44}: In(Unknown) int f3(int c) { /* 13 */ int a = 1; /* 14 */ int b = 2; /* 15 */ int x = 0; /* 17 */ if (c > Unknown) { /* 18 */ x = b; } else { /* 19 */ G = a; } /* 21 */ return x; } Slicing project worklist [default] = [f3_slice_1 = (n:42(restrict to x) ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Print slice = f3_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(Unknown): <[--d], [---]>) (OutRet: <[--d], [---]>) /**/int f3(/* <[--d], [---]> */ int c) { /* <[---], [---]> */ /* <[---], [---]> */ int a = 1; /* <[--d], [---]> */ /* <[--d], [---]> */ int b = 2; /* <[--d], [---]> */ /* <[--d], [---]> */ int x = 0; /* <[--d], [---]> */ if (c > Unknown) { /* <[--d], [---]> */ x = b; } else { /* <[---], [---]> */ G = a; } /* <[--d], [---]> */ return x; } [pdg] computing for function f4 [pdg] done for function f4 RESULT for f4: {n45}: InCtrl {n46}: VarDecl : c -[a--]-> 47 {n47}: In1 -[a--]-> 46 {n48}: VarDecl : a {n49}: VarDecl : b {n50}: VarDecl : x {n51}: int a = 1; -[-c-]-> 45 -[a--]-> 48 {n52}: int b = 2; -[-c-]-> 45 -[a--]-> 49 {n53}: int x = 0; -[-c-]-> 45 -[a--]-> 50 {n54}: c > Unknown -[-c-]-> 45 -[--d]-> 46 -[--d]-> 47 -[--d]-> 59 {n55}: G = a; -[-c-]-> 45 -[--d]-> 48 -[--d]-> 51 -[-c-]-> 54 {n56}: x = b; -[-c-]-> 45 -[--d]-> 49 -[a--]-> 50 -[--d]-> 52 -[-c-]-> 54 {n57}: return x; -[-c-]-> 45 -[--d]-> 50 -[--d]-> 53 -[--d]-> 56 {n58}: OutRet -[--d]-> 57 {n59}: In(Unknown) int f4(int c) { /* 23 */ int a = 1; /* 24 */ int b = 2; /* 25 */ int x = 0; /* 27 */ if (c > Unknown) { /* 28 */ G = a; } else { /* 29 */ x = b; } /* 31 */ return x; } Slicing project worklist [default] = [f4_slice_1 = (n:57(restrict to x) ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Print slice = f4_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(Unknown): <[--d], [---]>) (OutRet: <[--d], [---]>) /**/int f4(/* <[--d], [---]> */ int c) { /* <[---], [---]> */ /* <[---], [---]> */ int a = 1; /* <[--d], [---]> */ /* <[--d], [---]> */ int b = 2; /* <[--d], [---]> */ /* <[--d], [---]> */ int x = 0; /* <[--d], [---]> */ if (c > Unknown) { /* <[---], [---]> */ G = a; } else { /* <[--d], [---]> */ x = b; } /* <[--d], [---]> */ return x; } Slicing project worklist [default] = [f4_slice_2 = (n:55 ,<[ S ], [---]>)(n:45 ,<[-c-], [---]>)(n:54 ,<[-c-], [---]>)(n:48 , <[--d], [---]>)(n:51 ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Print slice = f4_slice_2: (InCtrl: <[-cd], [---]>) (In1: <[-c-], [---]>) (In(Unknown): <[-c-], [---]>) /**/int f4(/* <[-c-], [---]> */ int c) { /* <[--d], [---]> */ /* <[--d], [---]> */ int a = 1; /* <[---], [---]> */ /* <[---], [---]> */ int b = 2; /* <[---], [---]> */ /* <[---], [---]> */ int x = 0; /* <[-c-], [---]> */ if (c > Unknown) { /* <[ S ], [---]> */ G = a; } else { /* <[---], [---]> */ x = b; } /* <[---], [---]> */ return x; } [pdg] computing for function f5 [pdg] done for function f5 Sorties de la fonction f5 = G Slicing project worklist [default] = [f5_slice_1 = (n:73(restrict to G) ,<[--d], [---]>)(n:77(restrict to G) ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Print slice = f5_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(G): <[--d], [---]>) (In(Unknown): <[--d], [---]>) /**/int f5(/* <[--d], [---]> */ int c) { /* <[---], [---]> */ /* <[---], [---]> */ int x = 0; /* <[---], [---]> */ if (c > Unknown) { /* <[---], [---]> */ goto Lsuite; } /* <[---], [---]> */ x ++; /* <[---], [---]> */ Lsuite: /* <[---], [---]> */ ; /* <[--d], [---]> */ if (c < Unknown) { /* <[--d], [---]> */ goto L2; } /* <[--d], [---]> */ G ++; /* <[--d], [---]> */ L2: /* <[---], [---]> */ x ++; /* <[---], [---]> */ return x; } RESULT for f5: {n60}: InCtrl {n61}: VarDecl : c -[a--]-> 62 {n62}: In1 -[a--]-> 61 {n63}: VarDecl : x {n64}: int x = 0; -[-c-]-> 60 -[a--]-> 63 {n65}: c > Unknown -[-c-]-> 60 -[--d]-> 61 -[--d]-> 62 -[--d]-> 78 {n66}: goto Lsuite; -[-c-]-> 60 -[-c-]-> 65 -[-c-]-> 67 {n67}: Lsuite: -[-c-]-> 60 {n68}: x ++; -[-c-]-> 60 -[a-d]-> 63 -[--d]-> 64 -[-c-]-> 65 -[-c-]-> 66 {n69}: Lsuite: ; -[-c-]-> 60 {n70}: c < Unknown -[-c-]-> 60 -[--d]-> 61 -[--d]-> 62 -[--d]-> 78 {n71}: goto L2; -[-c-]-> 60 -[-c-]-> 70 -[-c-]-> 72 {n72}: L2: -[-c-]-> 60 {n73}: G ++; -[-c-]-> 60 -[-c-]-> 70 -[-c-]-> 71 -[--d]-> 77 {n74}: L2: x ++; -[-c-]-> 60 -[a-d]-> 63 -[--d]-> 64 -[--d]-> 68 {n75}: return x; -[-c-]-> 60 -[--d]-> 63 -[--d]-> 74 {n76}: OutRet -[--d]-> 75 {n77}: In(G) {n78}: In(Unknown) int f5(int c) { /* 33 */ int x = 0; /* 35 */ if (c > Unknown) { /* 36 */ goto Lsuite; } /* 38 */ x ++; /* label */ Lsuite: /* 39 */ ; /* 40 */ if (c < Unknown) { /* 41 */ goto L2; } /* 43 */ G ++; /* label */ L2: /* 44 */ x ++; /* 46 */ return x; } Slicing project worklist [default] = [f5_slice_2 = (n:75(restrict to x) ,<[--d], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Print slice = f5_slice_2: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(Unknown): <[--d], [---]>) (OutRet: <[--d], [---]>) /**/int f5(/* <[--d], [---]> */ int c) { /* <[--d], [---]> */ /* <[--d], [---]> */ int x = 0; /* <[--d], [---]> */ if (c > Unknown) { /* <[--d], [---]> */ goto Lsuite; } /* <[--d], [---]> */ x ++; /* <[--d], [---]> */ Lsuite: /* <[---], [---]> */ ; /* <[---], [---]> */ if (c < Unknown) { /* <[---], [---]> */ goto L2; } /* <[---], [---]> */ G ++; /* <[---], [---]> */ L2: /* <[--d], [---]> */ x ++; /* <[--d], [---]> */ return x; } Slicing project worklist [default] = [f5_slice_3 = (n:60 ,<[-c-], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Print slice = f5_slice_3: (InCtrl: <[-c-], [---]>) /**/int f5(/* <[---], [---]> */ int c) { /* <[---], [---]> */ /* <[---], [---]> */ int x = 0; /* <[---], [---]> */ if (c > Unknown) { /* <[---], [---]> */ goto Lsuite; } /* <[---], [---]> */ x ++; /* <[---], [---]> */ Lsuite: /* <[---], [---]> */ ; /* <[---], [---]> */ if (c < Unknown) { /* <[---], [---]> */ goto L2; } /* <[---], [---]> */ G ++; /* <[---], [---]> */ L2: /* <[---], [---]> */ x ++; /* <[---], [---]> */ return x; } [pdg] computing for function f6 [pdg] done for function f6 RESULT for f6: {n79}: InCtrl {n80}: VarDecl : n -[a--]-> 81 {n81}: In1 -[a--]-> 80 {n82}: VarDecl : i {n83}: VarDecl : __retres {n84}: int i = 0; -[-c-]-> 79 -[a--]-> 82 {n85}: while(1) -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n86}: n < 10 -[-c-]-> 79 -[--d]-> 80 -[--d]-> 81 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[--d]-> 91 -[-c-]-> 93 -[-c-]-> 94 {n87}: block -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n88}: Unknown > 3 -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 -[--d]-> 105 {n89}: n % 2 -[-c-]-> 79 -[--d]-> 80 -[--d]-> 81 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[--d]-> 91 -[-c-]-> 93 -[-c-]-> 94 {n90}: continue; -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 89 -[-c-]-> 93 -[-c-]-> 94 {n91}: n ++; -[-c-]-> 79 -[a-d]-> 80 -[--d]-> 81 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 89 -[-c-]-> 90 -[--d]-> 91 -[-c-]-> 93 -[-c-]-> 94 {n92}: i = 1; -[-c-]-> 79 -[a--]-> 82 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n93}: break; -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n94}: break; -[-c-]-> 79 -[-c-]-> 85 -[-c-]-> 86 -[-c-]-> 87 -[-c-]-> 88 -[-c-]-> 93 -[-c-]-> 94 {n95}: i -[-c-]-> 79 -[--d]-> 82 -[--d]-> 84 -[--d]-> 92 {n96}: block -[-c-]-> 79 -[-c-]-> 95 {n97}: block -[-c-]-> 79 -[-c-]-> 95 {n98}: __retres = 0; -[-c-]-> 79 -[a--]-> 83 -[-c-]-> 95 -[-c-]-> 96 {n99}: __retres = 10 * n; -[-c-]-> 79 -[--d]-> 80 -[--d]-> 81 -[a--]-> 83 -[--d]-> 91 -[-c-]-> 95 -[-c-]-> 97 {n100}: goto return_label; -[-c-]-> 79 -[-c-]-> 95 -[-c-]-> 96 -[-c-]-> 101 {n101}: return_label: -[-c-]-> 79 {n102}: goto return_label; -[-c-]-> 79 -[-c-]-> 95 -[-c-]-> 97 -[-c-]-> 101 {n103}: return_label: return __retres; -[-c-]-> 79 -[--d]-> 83 -[--d]-> 98 -[--d]-> 99 {n104}: OutRet -[--d]-> 103 {n105}: In(Unknown) int f6(int n) { int __retres; /* 48 */ int i = 0; /* 49 */ while (n < 10) { /* 55 */ if (Unknown > 3) { /* 56 */ i = 1; /* 57 */ break; } /* 60 */ if (n % 2) { /* 61 */ continue; } /* 63 */ n ++; } /* 65 */ if (i) { /* 130 */ { /* 66 */ __retres = 0; /* 131 */ goto return_label; } } else { /* 132 */ { /*@ assert Eva: signed_overflow: -2147483648 ≤ 10 * n; */ /*@ assert Eva: signed_overflow: 10 * n ≤ 2147483647; */ /* 68 */ __retres = 10 * n; /* 133 */ goto return_label; } } /* label */ return_label: /* 134 */ return __retres; } Slicing project worklist [default] = [f6_slice_1 = (n:79 ,<[-c-], [---]>)(n:95 ,<[-c-], [---]>)(n:97 ,<[-c-], [---]>)] [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... Print slice = f6_slice_1: (InCtrl: <[-c-], [---]>) (In1: <[-c-], [---]>) (In(Unknown): <[-c-], [---]>) /**/int f6(/* <[-c-], [---]> */ int n) { /* <[---], [---]> */ int __retres; /* <[-c-], [---]> */ /* <[-c-], [---]> */ int i = 0; /* <[-c-], [---]> */ while (n < 10) { /* <[-c-], [---]> */ if (Unknown > 3) { /* <[-c-], [---]> */ i = 1; /* <[-c-], [---]> */ break; } /* <[-c-], [---]> */ if (n % 2) { /* <[-c-], [---]> */ continue; } /* <[-c-], [---]> */ n ++; } /* <[-c-], [---]> */ if (i) { /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = 0; /* <[---], [---]> */ goto return_label; } } else { /* <[-c-], [---]> */ { /*@ assert Eva: signed_overflow: -2147483648 ≤ 10 * n; */ /*@ assert Eva: signed_overflow: 10 * n ≤ 2147483647; */ /* <[---], [---]> */ __retres = 10 * n; /* <[---], [---]> */ goto return_label; } } /* <[---], [---]> */ return_label: /* <[---], [---]> */ return __retres; } struct __anonstruct_Tstr_1 { int a ; int b ; int c ; }; typedef struct __anonstruct_Tstr_1 Tstr; int Unknown; int G; Print slice = f1_slice_1: (InCtrl: <[-cd], [---]>) (In1: <[--d], [---]>) /**/int f1(/* <[--d], [---]> */ int x, /* <[---], [---]> */ int y) { /* <[---], [---]> */ int __retres; /* <[--d], [---]> */ /* <[--d], [---]> */ int a = 1; /* <[---], [---]> */ /* <[---], [---]> */ int b = 2; /* <[ S ], [---]> */ G = x + a; /* <[---], [---]> */ __retres = y + b; /* <[---], [---]> */ return __retres; } Print slice = f2_slice_1: (InCtrl: <[-c-], [---]>) /**/int f2(void) { /* <[---], [---]> */ int tmp; /* <[---], [---]> */ /* <[---], [---]> */ int a = 1; /* <[---], [---]> */ /* <[---], [---]> */ int b = a + 1; /* <[ S ], [---]> */ /* <[a--], [---]> */ int c = 3; /* invisible call */ /* <[---], [---]> */ tmp = f1(b,c); /* <[---], [---]> */ return tmp; } Print slice = f3_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(Unknown): <[--d], [---]>) (OutRet: <[--d], [---]>) /**/int f3(/* <[--d], [---]> */ int c) { /* <[---], [---]> */ /* <[---], [---]> */ int a = 1; /* <[--d], [---]> */ /* <[--d], [---]> */ int b = 2; /* <[--d], [---]> */ /* <[--d], [---]> */ int x = 0; /* <[--d], [---]> */ if (c > Unknown) { /* <[--d], [---]> */ x = b; } else { /* <[---], [---]> */ G = a; } /* <[--d], [---]> */ return x; } Print slice = f4_slice_2: (InCtrl: <[-cd], [---]>) (In1: <[-c-], [---]>) (In(Unknown): <[-c-], [---]>) /**/int f4(/* <[-c-], [---]> */ int c) { /* <[--d], [---]> */ /* <[--d], [---]> */ int a = 1; /* <[---], [---]> */ /* <[---], [---]> */ int b = 2; /* <[---], [---]> */ /* <[---], [---]> */ int x = 0; /* <[-c-], [---]> */ if (c > Unknown) { /* <[ S ], [---]> */ G = a; } else { /* <[---], [---]> */ x = b; } /* <[---], [---]> */ return x; } Print slice = f4_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(Unknown): <[--d], [---]>) (OutRet: <[--d], [---]>) /**/int f4(/* <[--d], [---]> */ int c) { /* <[---], [---]> */ /* <[---], [---]> */ int a = 1; /* <[--d], [---]> */ /* <[--d], [---]> */ int b = 2; /* <[--d], [---]> */ /* <[--d], [---]> */ int x = 0; /* <[--d], [---]> */ if (c > Unknown) { /* <[---], [---]> */ G = a; } else { /* <[--d], [---]> */ x = b; } /* <[--d], [---]> */ return x; } Print slice = f5_slice_3: (InCtrl: <[-c-], [---]>) /**/int f5(/* <[---], [---]> */ int c) { /* <[---], [---]> */ /* <[---], [---]> */ int x = 0; /* <[---], [---]> */ if (c > Unknown) { /* <[---], [---]> */ goto Lsuite; } /* <[---], [---]> */ x ++; /* <[---], [---]> */ Lsuite: /* <[---], [---]> */ ; /* <[---], [---]> */ if (c < Unknown) { /* <[---], [---]> */ goto L2; } /* <[---], [---]> */ G ++; /* <[---], [---]> */ L2: /* <[---], [---]> */ x ++; /* <[---], [---]> */ return x; } Print slice = f5_slice_2: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(Unknown): <[--d], [---]>) (OutRet: <[--d], [---]>) /**/int f5(/* <[--d], [---]> */ int c) { /* <[--d], [---]> */ /* <[--d], [---]> */ int x = 0; /* <[--d], [---]> */ if (c > Unknown) { /* <[--d], [---]> */ goto Lsuite; } /* <[--d], [---]> */ x ++; /* <[--d], [---]> */ Lsuite: /* <[---], [---]> */ ; /* <[---], [---]> */ if (c < Unknown) { /* <[---], [---]> */ goto L2; } /* <[---], [---]> */ G ++; /* <[---], [---]> */ L2: /* <[--d], [---]> */ x ++; /* <[--d], [---]> */ return x; } Print slice = f5_slice_1: (InCtrl: <[--d], [---]>) (In1: <[--d], [---]>) (In(G): <[--d], [---]>) (In(Unknown): <[--d], [---]>) /**/int f5(/* <[--d], [---]> */ int c) { /* <[---], [---]> */ /* <[---], [---]> */ int x = 0; /* <[---], [---]> */ if (c > Unknown) { /* <[---], [---]> */ goto Lsuite; } /* <[---], [---]> */ x ++; /* <[---], [---]> */ Lsuite: /* <[---], [---]> */ ; /* <[--d], [---]> */ if (c < Unknown) { /* <[--d], [---]> */ goto L2; } /* <[--d], [---]> */ G ++; /* <[--d], [---]> */ L2: /* <[---], [---]> */ x ++; /* <[---], [---]> */ return x; } Print slice = f6_slice_1: (InCtrl: <[-c-], [---]>) (In1: <[-c-], [---]>) (In(Unknown): <[-c-], [---]>) /**/int f6(/* <[-c-], [---]> */ int n) { /* <[---], [---]> */ int __retres; /* <[-c-], [---]> */ /* <[-c-], [---]> */ int i = 0; /* <[-c-], [---]> */ while (n < 10) { /* <[-c-], [---]> */ if (Unknown > 3) { /* <[-c-], [---]> */ i = 1; /* <[-c-], [---]> */ break; } /* <[-c-], [---]> */ if (n % 2) { /* <[-c-], [---]> */ continue; } /* <[-c-], [---]> */ n ++; } /* <[-c-], [---]> */ if (i) { /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = 0; /* <[---], [---]> */ goto return_label; } } else { /* <[-c-], [---]> */ { /*@ assert Eva: signed_overflow: -2147483648 ≤ 10 * n; */ /*@ assert Eva: signed_overflow: 10 * n ≤ 2147483647; */ /* <[---], [---]> */ __retres = 10 * n; /* <[---], [---]> */ goto return_label; } } /* <[---], [---]> */ return_label: /* <[---], [---]> */ return __retres; } Tstr S; Tstr S1; Tstr S2; Slicing project worklist [default] = frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.0.res.oracle0000666000000000000000000001722213571573400020672 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function SizeOfE_tab_acces_1 [pdg] done for function SizeOfE_tab_acces_1 [pdg] computing for function SizeOfE_pt_tab_2 [pdg] done for function SizeOfE_pt_tab_2 [pdg] computing for function SizeOfE_pt_tab_1 [pdg] done for function SizeOfE_pt_tab_1 [pdg] computing for function SizeOfE_tab_1 [pdg] done for function SizeOfE_tab_1 [pdg] computing for function SizeOfE_pt_deref_1 [pdg] done for function SizeOfE_pt_deref_1 [pdg] computing for function SizeOfE_pt3 [pdg] done for function SizeOfE_pt3 [pdg] computing for function SizeOfE_pt2 [pdg] done for function SizeOfE_pt2 [pdg] computing for function SizeOfE_pt1 [pdg] done for function SizeOfE_pt1 [pdg] computing for function SizeOf_2 [pdg] done for function SizeOf_2 [pdg] computing for function SizeOf_1 [pdg] done for function SizeOf_1 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct St { int i ; int *p ; int tab[5] ; }; unsigned int SizeOf_1_slice_1(void) { unsigned int __retres; __retres = sizeof(int *); return __retres; } unsigned int SizeOf_2_slice_1(void) { unsigned int __retres; __retres = sizeof(struct St); return __retres; } unsigned int SizeOfE_pt1_slice_1(void) { unsigned int __retres; int x; __retres = sizeof(& x); return __retres; } unsigned int SizeOfE_pt2_slice_1(void) { unsigned int __retres; int *p; __retres = sizeof(p); return __retres; } unsigned int SizeOfE_pt3_slice_1(void) { unsigned int __retres; int i; int *p; __retres = sizeof(p + i); return __retres; } unsigned int SizeOfE_pt_deref_1_slice_1(void) { unsigned int __retres; int i; int *p; __retres = sizeof(*(p + i)); return __retres; } unsigned int SizeOfE_tab_1_slice_1(void) { unsigned int __retres; int tab[5]; __retres = sizeof(tab); return __retres; } unsigned int SizeOfE_pt_tab_1_slice_1(void) { unsigned int __retres; int i; int tab[5]; __retres = sizeof(& tab[i]); return __retres; } unsigned int SizeOfE_pt_tab_2_slice_1(void) { unsigned int __retres; int i; int tab[5]; __retres = sizeof(& tab[i]); return __retres; } unsigned int SizeOfE_tab_acces_1_slice_1(void) { unsigned int __retres; int i; int tab[5]; __retres = sizeof(tab[i]); return __retres; } int main(void) { unsigned int tmp; unsigned int tmp_0; unsigned int tmp_1; unsigned int tmp_2; unsigned int tmp_3; unsigned int tmp_4; unsigned int tmp_5; unsigned int tmp_6; unsigned int tmp_7; unsigned int tmp_8; int r = 0; r = (int)((unsigned int)r + sizeof(struct St)); /*@ assert r ≢ 0; */ ; tmp = SizeOf_1_slice_1(); r = (int)((unsigned int)r + tmp); tmp_0 = SizeOf_2_slice_1(); r = (int)((unsigned int)r + tmp_0); tmp_1 = SizeOfE_pt1_slice_1(); r = (int)((unsigned int)r + tmp_1); tmp_2 = SizeOfE_pt2_slice_1(); r = (int)((unsigned int)r + tmp_2); tmp_3 = SizeOfE_pt3_slice_1(); r = (int)((unsigned int)r + tmp_3); tmp_4 = SizeOfE_pt_deref_1_slice_1(); r = (int)((unsigned int)r + tmp_4); tmp_5 = SizeOfE_tab_1_slice_1(); r = (int)((unsigned int)r + tmp_5); tmp_6 = SizeOfE_pt_tab_1_slice_1(); r = (int)((unsigned int)r + tmp_6); tmp_7 = SizeOfE_pt_tab_2_slice_1(); r = (int)((unsigned int)r + tmp_7); tmp_8 = SizeOfE_tab_acces_1_slice_1(); r = (int)((unsigned int)r + tmp_8); /*@ slice pragma expr r; */ ; return r; } [kernel] Parsing tests/slicing/result/ocode_0_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.1.res.oracle0000666000000000000000000001105713571573400020673 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOf_1 [pdg] done for function SizeOf_1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ unsigned int SizeOf_1_slice_1(void) { unsigned int __retres; __retres = sizeof(int *); return __retres; } [kernel] Parsing tests/slicing/result/ocode_1_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.10.res.oracle0000666000000000000000000001115113571573400020746 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOfE_tab_acces_1 [pdg] done for function SizeOfE_tab_acces_1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ unsigned int SizeOfE_tab_acces_1_slice_1(void) { unsigned int __retres; int i; int tab[5]; __retres = sizeof(tab[i]); return __retres; } [kernel] Parsing tests/slicing/result/ocode_10_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.11.res.oracle0000666000000000000000000001722213571573400020754 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function SizeOfE_tab_acces_1 [pdg] done for function SizeOfE_tab_acces_1 [pdg] computing for function SizeOfE_pt_tab_2 [pdg] done for function SizeOfE_pt_tab_2 [pdg] computing for function SizeOfE_pt_tab_1 [pdg] done for function SizeOfE_pt_tab_1 [pdg] computing for function SizeOfE_tab_1 [pdg] done for function SizeOfE_tab_1 [pdg] computing for function SizeOfE_pt_deref_1 [pdg] done for function SizeOfE_pt_deref_1 [pdg] computing for function SizeOfE_pt3 [pdg] done for function SizeOfE_pt3 [pdg] computing for function SizeOfE_pt2 [pdg] done for function SizeOfE_pt2 [pdg] computing for function SizeOfE_pt1 [pdg] done for function SizeOfE_pt1 [pdg] computing for function SizeOf_2 [pdg] done for function SizeOf_2 [pdg] computing for function SizeOf_1 [pdg] done for function SizeOf_1 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct St { int i ; int *p ; int tab[5] ; }; unsigned int SizeOf_1_slice_1(void) { unsigned int __retres; __retres = sizeof(int *); return __retres; } unsigned int SizeOf_2_slice_1(void) { unsigned int __retres; __retres = sizeof(struct St); return __retres; } unsigned int SizeOfE_pt1_slice_1(void) { unsigned int __retres; int x; __retres = sizeof(& x); return __retres; } unsigned int SizeOfE_pt2_slice_1(void) { unsigned int __retres; int *p; __retres = sizeof(p); return __retres; } unsigned int SizeOfE_pt3_slice_1(void) { unsigned int __retres; int i; int *p; __retres = sizeof(p + i); return __retres; } unsigned int SizeOfE_pt_deref_1_slice_1(void) { unsigned int __retres; int i; int *p; __retres = sizeof(*(p + i)); return __retres; } unsigned int SizeOfE_tab_1_slice_1(void) { unsigned int __retres; int tab[5]; __retres = sizeof(tab); return __retres; } unsigned int SizeOfE_pt_tab_1_slice_1(void) { unsigned int __retres; int i; int tab[5]; __retres = sizeof(& tab[i]); return __retres; } unsigned int SizeOfE_pt_tab_2_slice_1(void) { unsigned int __retres; int i; int tab[5]; __retres = sizeof(& tab[i]); return __retres; } unsigned int SizeOfE_tab_acces_1_slice_1(void) { unsigned int __retres; int i; int tab[5]; __retres = sizeof(tab[i]); return __retres; } void main(void) { unsigned int tmp; unsigned int tmp_0; unsigned int tmp_1; unsigned int tmp_2; unsigned int tmp_3; unsigned int tmp_4; unsigned int tmp_5; unsigned int tmp_6; unsigned int tmp_7; unsigned int tmp_8; int r = 0; r = (int)((unsigned int)r + sizeof(struct St)); /*@ assert r ≢ 0; */ ; tmp = SizeOf_1_slice_1(); r = (int)((unsigned int)r + tmp); tmp_0 = SizeOf_2_slice_1(); r = (int)((unsigned int)r + tmp_0); tmp_1 = SizeOfE_pt1_slice_1(); r = (int)((unsigned int)r + tmp_1); tmp_2 = SizeOfE_pt2_slice_1(); r = (int)((unsigned int)r + tmp_2); tmp_3 = SizeOfE_pt3_slice_1(); r = (int)((unsigned int)r + tmp_3); tmp_4 = SizeOfE_pt_deref_1_slice_1(); r = (int)((unsigned int)r + tmp_4); tmp_5 = SizeOfE_tab_1_slice_1(); r = (int)((unsigned int)r + tmp_5); tmp_6 = SizeOfE_pt_tab_1_slice_1(); r = (int)((unsigned int)r + tmp_6); tmp_7 = SizeOfE_pt_tab_2_slice_1(); r = (int)((unsigned int)r + tmp_7); tmp_8 = SizeOfE_tab_acces_1_slice_1(); r = (int)((unsigned int)r + tmp_8); /*@ slice pragma expr r; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_11_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.12.res.oracle0000666000000000000000000001114613571573400020754 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct St { int i ; int *p ; int tab[5] ; }; void main(void) { int r = 0; r = (int)((unsigned int)r + sizeof(struct St)); /*@ assert r ≢ 0; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_12_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.2.res.oracle0000666000000000000000000001115113571573400020667 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOf_2 [pdg] done for function SizeOf_2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct St { int i ; int *p ; int tab[5] ; }; unsigned int SizeOf_2_slice_1(void) { unsigned int __retres; __retres = sizeof(struct St); return __retres; } [kernel] Parsing tests/slicing/result/ocode_2_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.3.res.oracle0000666000000000000000000001107713571573400020677 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOfE_pt1 [pdg] done for function SizeOfE_pt1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ unsigned int SizeOfE_pt1_slice_1(void) { unsigned int __retres; int x; __retres = sizeof(& x); return __retres; } [kernel] Parsing tests/slicing/result/ocode_3_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.4.res.oracle0000666000000000000000000001107613571573400020677 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOfE_pt2 [pdg] done for function SizeOfE_pt2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ unsigned int SizeOfE_pt2_slice_1(void) { unsigned int __retres; int *p; __retres = sizeof(p); return __retres; } [kernel] Parsing tests/slicing/result/ocode_4_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.5.res.oracle0000666000000000000000000001111313571573400020670 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOfE_pt3 [pdg] done for function SizeOfE_pt3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ unsigned int SizeOfE_pt3_slice_1(void) { unsigned int __retres; int i; int *p; __retres = sizeof(p + i); return __retres; } [kernel] Parsing tests/slicing/result/ocode_5_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.6.res.oracle0000666000000000000000000001114313571573400020674 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOfE_pt_deref_1 [pdg] done for function SizeOfE_pt_deref_1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ unsigned int SizeOfE_pt_deref_1_slice_1(void) { unsigned int __retres; int i; int *p; __retres = sizeof(*(p + i)); return __retres; } [kernel] Parsing tests/slicing/result/ocode_6_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.7.res.oracle0000666000000000000000000001111213571573400020671 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOfE_tab_1 [pdg] done for function SizeOfE_tab_1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ unsigned int SizeOfE_tab_1_slice_1(void) { unsigned int __retres; int tab[5]; __retres = sizeof(tab); return __retres; } [kernel] Parsing tests/slicing/result/ocode_7_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.8.res.oracle0000666000000000000000000001114113571573400020674 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOfE_pt_tab_1 [pdg] done for function SizeOfE_pt_tab_1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ unsigned int SizeOfE_pt_tab_1_slice_1(void) { unsigned int __retres; int i; int tab[5]; __retres = sizeof(& tab[i]); return __retres; } [kernel] Parsing tests/slicing/result/ocode_8_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/sizeof.9.res.oracle0000666000000000000000000001114113571573400020675 0ustar [kernel] Parsing tests/slicing/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization st ∈ {0} [eva] tests/slicing/sizeof.i:93: assertion got status valid. [eva] computing for function SizeOf_1 <- main. Called from tests/slicing/sizeof.i:94. [eva] Recording results for SizeOf_1 [eva] Done for function SizeOf_1 [eva] computing for function SizeOf_2 <- main. Called from tests/slicing/sizeof.i:95. [eva] Recording results for SizeOf_2 [eva] Done for function SizeOf_2 [eva] computing for function SizeOfE_pt1 <- main. Called from tests/slicing/sizeof.i:96. [eva] Recording results for SizeOfE_pt1 [eva] Done for function SizeOfE_pt1 [eva] computing for function SizeOfE_pt2 <- main. Called from tests/slicing/sizeof.i:97. [eva] Recording results for SizeOfE_pt2 [eva] Done for function SizeOfE_pt2 [eva] computing for function SizeOfE_pt3 <- main. Called from tests/slicing/sizeof.i:98. [eva] Recording results for SizeOfE_pt3 [eva] Done for function SizeOfE_pt3 [eva] computing for function SizeOfE_pt_deref_1 <- main. Called from tests/slicing/sizeof.i:99. [eva] Recording results for SizeOfE_pt_deref_1 [eva] Done for function SizeOfE_pt_deref_1 [eva] computing for function SizeOfE_tab_1 <- main. Called from tests/slicing/sizeof.i:100. [eva] Recording results for SizeOfE_tab_1 [eva] Done for function SizeOfE_tab_1 [eva] computing for function SizeOfE_pt_tab_1 <- main. Called from tests/slicing/sizeof.i:101. [eva] Recording results for SizeOfE_pt_tab_1 [eva] Done for function SizeOfE_pt_tab_1 [eva] computing for function SizeOfE_pt_tab_2 <- main. Called from tests/slicing/sizeof.i:102. [eva] Recording results for SizeOfE_pt_tab_2 [eva] Done for function SizeOfE_pt_tab_2 [eva] computing for function SizeOfE_tab_acces_1 <- main. Called from tests/slicing/sizeof.i:103. [eva] Recording results for SizeOfE_tab_acces_1 [eva] Done for function SizeOfE_tab_acces_1 [eva] Recording results for main [eva] done for function main [from] Computing for function SizeOfE_pt1 [from] Done for function SizeOfE_pt1 [from] Computing for function SizeOfE_pt2 [from] Done for function SizeOfE_pt2 [from] Computing for function SizeOfE_pt3 [from] Done for function SizeOfE_pt3 [from] Computing for function SizeOfE_pt_deref_1 [from] Done for function SizeOfE_pt_deref_1 [from] Computing for function SizeOfE_pt_tab_1 [from] Done for function SizeOfE_pt_tab_1 [from] Computing for function SizeOfE_pt_tab_2 [from] Done for function SizeOfE_pt_tab_2 [from] Computing for function SizeOfE_tab_1 [from] Done for function SizeOfE_tab_1 [from] Computing for function SizeOfE_tab_acces_1 [from] Done for function SizeOfE_tab_acces_1 [from] Computing for function SizeOf_1 [from] Done for function SizeOf_1 [from] Computing for function SizeOf_2 [from] Done for function SizeOf_2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function SizeOfE_pt1: \result FROM \nothing [from] Function SizeOfE_pt2: \result FROM \nothing [from] Function SizeOfE_pt3: \result FROM \nothing [from] Function SizeOfE_pt_deref_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_1: \result FROM \nothing [from] Function SizeOfE_pt_tab_2: \result FROM \nothing [from] Function SizeOfE_tab_1: \result FROM \nothing [from] Function SizeOfE_tab_acces_1: \result FROM \nothing [from] Function SizeOf_1: \result FROM \nothing [from] Function SizeOf_2: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function SizeOfE_pt_tab_2 [pdg] done for function SizeOfE_pt_tab_2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ unsigned int SizeOfE_pt_tab_2_slice_1(void) { unsigned int __retres; int i; int tab[5]; __retres = sizeof(& tab[i]); return __retres; } [kernel] Parsing tests/slicing/result/ocode_9_sizeof.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_behavior.res.oracle0000666000000000000000000000346113571573400022213 0ustar [kernel] Parsing tests/slicing/slice_behavior.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/slicing/slice_behavior.i:12. [eva] tests/slicing/slice_behavior.i:12: function f: precondition got status valid. [eva] tests/slicing/slice_behavior.i:7: assertion got status valid. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: b ∈ {20} __retres ∈ {42} [eva:final-states] Values at end of function main: __retres ∈ {0} [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ /*@ requires a > 0; */ void f_slice_1(int a) { int b = 2 * a; /*@ assert a < b; */ ; return; } void main(void) { f_slice_1(10); return; } [kernel] Parsing tests/slicing/result/ocode_0_slice_behavior.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_no_body.res.oracle0000666000000000000000000001775713571573400022062 0ustar [kernel] Parsing tests/slicing/slice_no_body.i (no preprocessing) [eva] Analyzing an incomplete application starting at h [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] [eva] computing for function f <- h. Called from tests/slicing/slice_no_body.i:21. [kernel:annot:missing-spec] tests/slicing/slice_no_body.i:21: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] computing for function f <- h. Called from tests/slicing/slice_no_body.i:22. [eva] Done for function f [eva] computing for function f <- h. Called from tests/slicing/slice_no_body.i:23. [eva] Done for function f [eva] computing for function f <- h. Called from tests/slicing/slice_no_body.i:24. [eva] Done for function f [eva] computing for function g <- h. Called from tests/slicing/slice_no_body.i:26. [eva:alarm] tests/slicing/slice_no_body.i:12: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva:alarm] tests/slicing/slice_no_body.i:13: Warning: signed overflow. assert -2147483648 ≤ c * 2; [eva:alarm] tests/slicing/slice_no_body.i:13: Warning: signed overflow. assert c * 2 ≤ 2147483647; [eva] computing for function f <- g <- h. Called from tests/slicing/slice_no_body.i:15. [eva] Done for function f [eva] Recording results for g [eva] Done for function g [eva] Recording results for h [eva] done for function h [from] Computing for function g [from] Computing for function f <-g [from] Done for function f [from] Done for function g [from] Computing for function h [from] Done for function h [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM a [from] Function g: \result FROM c [from] Function h: G FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function h [pdg] done for function h [pdg] computing for function g [pdg] done for function g int G; /*@ assigns \result; assigns \result \from a; */ int f(int a); Print slice = g_slice_1: /**/int g(/* <[---], [---]> */ int c) { /* <[---], [---]> */ int __retres; /*@ assert Eva: signed_overflow: c + 1 ≤ 2147483647; */ /* <[---], [---]> */ /* <[---], [---]> */ int x = c + 1; /*@ assert Eva: signed_overflow: -2147483648 ≤ c * 2; */ /*@ assert Eva: signed_overflow: c * 2 ≤ 2147483647; */ /* <[---], [---]> */ /* <[---], [---]> */ int y = c * 2; /* <[---], [---]> */ if (c == 0) { /* <[---], [---]> */ int tmp; /* invisible call */ /* <[---], [---]> */ tmp = f(x); /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = tmp; /* <[---], [---]> */ goto return_label; } } else { /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = y; /* <[---], [---]> */ goto return_label; } } /* <[---], [---]> */ return_label: /* <[---], [---]> */ return __retres; } Print slice = h_slice_1: /**/int h(void) { /* <[---], [---]> */ int __retres; /* invisible call */ /* <[---], [---]> */ /* <[---], [---]> */ int a = f(1); /* invisible call */ /* <[---], [---]> */ /* <[---], [---]> */ int b = f(2); /* invisible call */ /* <[---], [---]> */ /* <[---], [---]> */ int c = f(3); /* invisible call */ /* <[---], [---]> */ G = f(4); /* <[---], [---]> */ if (G > 0) { /* invisible call */ /* <[---], [---]> */ G = g(c); } /* <[---], [---]> */ __retres = (int)(& g); /* <[---], [---]> */ return __retres; } Slicing project worklist [default] = [h_slice_1 = change_call for call 16 -> g_slice_1][g_slice_1 = change_call for call 5 -> (src:f)][h_slice_1 = change_call for call 13 -> (src:f)][h_slice_1 = change_call for call 12 -> (src:f)][h_slice_1 = change_call for call 11 -> (src:f)][h_slice_1 = change_call for call 10 -> (src:f)] [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 6 actions... [slicing] applying actions: 1/6... [slicing] applying actions: 2/6... [slicing] applying actions: 3/6... [slicing] applying actions: 4/6... [slicing] applying actions: 5/6... [slicing] applying actions: 6/6... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int G; int f(int a); void g_slice_1(int c) { int x = c + 1; if (c == 0) { int tmp; tmp = f(x); } return; } void h(void) { int a = f(1); int b = f(2); int c = f(3); G = f(4); if (G > 0) g_slice_1(c); return; } [slicing] reinitializing slicing ... [slicing] applying all slicing requests... [slicing] applying 6 actions... [slicing] applying actions: 1/6... [slicing] applying actions: 2/6... [slicing] applying actions: 3/6... [slicing] applying actions: 4/6... [slicing] applying actions: 5/6... [slicing] applying actions: 6/6... int G; /*@ assigns \result; assigns \result \from a; */ int f(int a); Print slice = g_slice_1: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) /**/int g(/* <[---], [ S ]> */ int c) { /* <[---], [---]> */ int __retres; /*@ assert Eva: signed_overflow: c + 1 ≤ 2147483647; */ /* <[---], [ S ]> */ /* <[---], [ S ]> */ int x = c + 1; /*@ assert Eva: signed_overflow: -2147483648 ≤ c * 2; */ /*@ assert Eva: signed_overflow: c * 2 ≤ 2147483647; */ /* <[---], [---]> */ /* <[---], [---]> */ int y = c * 2; /* <[---], [ S ]> */ if (c == 0) { /* <[---], [ S ]> */ int tmp; /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ tmp = f(x); /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = tmp; /* <[---], [---]> */ goto return_label; } } else { /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = y; /* <[---], [---]> */ goto return_label; } } /* <[---], [---]> */ return_label: /* <[---], [---]> */ return __retres; } Print slice = h_slice_1: (InCtrl: <[---], [ S ]>) /**/int h(void) { /* <[---], [---]> */ int __retres; /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ /* <[---], [ S ]> */ int a = f(1); /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ /* <[---], [ S ]> */ int b = f(2); /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ /* <[---], [ S ]> */ int c = f(3); /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ G = f(4); /* <[---], [ S ]> */ if (G > 0) { /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) */ /* call to g_slice_1: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) */ /* <[---], [ S ]> */ G = g(c); } /* <[---], [---]> */ __retres = (int)(& g); /* <[---], [---]> */ return __retres; } Slicing project worklist [default] = [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int G; int f(int a); void g_slice_1(int c) { int x = c + 1; if (c == 0) { int tmp; tmp = f(x); } return; } void h(void) { int a = f(1); int b = f(2); int c = f(3); G = f(4); if (G > 0) g_slice_1(c); return; } frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.0.res.oracle0000666000000000000000000000572213571573400023072 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) /* Generated by Frama-C */ int x; int y; void nop1(int c1, int c2) { /*@ slice pragma stmt; */ ; x = 1; return; } void nop2(int c1, int c2) { /*@ slice pragma stmt; */ ; x = 1; return; } void nop3(int c1, int c2) { /*@ slice pragma stmt; */ ; x = 1; return; } void nop4(int c1, int c2) { /*@ slice pragma stmt; */ if (c1) ; x = 1; return; } void nop5(int c1, int c2) { if (c2) goto L; /*@ slice pragma stmt; */ L: ; x = 1; return; } void nop6(int c1, int c2) { /*@ slice pragma stmt; */ L: ; x = 1; return; } void nop7(int c1, int c2) { /*@ slice pragma stmt; */ L: ; x = 1; return; } void nop8(int c1, int c2) { /*@ slice pragma stmt; */ L: ; x = 1; return; } void double_effect1(int c1, int c2) { int tmp; /*@ slice pragma stmt; */ { /* sequence */ tmp = y; y ++; x += tmp; } return; } void double_effect2(int c1, int c2) { /*@ slice pragma stmt; */ { int tmp; tmp = y; y ++; x += tmp; } return; } void double_effect3(int c1, int c2) { int tmp; if (c2) goto L; /*@ slice pragma stmt; */ { L: { /* sequence */ tmp = y; y ++; x += tmp; } } return; } void double_effect4(int c1, int c2) { if (c2) goto L; /*@ slice pragma stmt; */ L: { int tmp; tmp = y; y ++; x += tmp; } return; } void double_effect5(int c1, int c2) { if (c2) { /*@ slice pragma stmt; */ { int tmp; tmp = y; y ++; x += tmp; } } return; } void test1(int c1, int c2) { if (c1 < c2) c1 = c2; /*@ slice pragma stmt; */ x = c1; return; } void test2(int c1, int c2) { if (c1 < c2) c1 = c2; /*@ slice pragma stmt; */ x = c1; y = c2; return; } void test3(int c1, int c2) { if (c1 < c2) c1 = c2; /*@ slice pragma stmt; */ x = c1; y = c2; return; } void test4(int c1, int c2) { if (c1 < c2) c1 = c2; /*@ slice pragma stmt; */ { x = c1; c2 ++; } y = c2; return; } void test5(int c1, int c2) { if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ L: x = c1; y = c2; return; } void test6(int c1, int c2) { int tmp; if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ { L: { /* sequence */ tmp = c1; c1 ++; x = tmp; } } y = c2; return; } void test7(int c1, int c2) { if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ L: { int tmp; tmp = c1; c1 ++; x = tmp; c2 ++; } y = c2; return; } void test8(int c1, int c2) { if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ { int tmp; L: { /* sequence */ tmp = c1; c1 ++; x = tmp; } c2 ++; } y = c2; return; } void test9(int c1, int c2) { if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ { x = c1; L: c2 ++; } y = c2; return; } frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.1.res.oracle0000666000000000000000000000223013571573400023062 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at nop1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for nop1 [eva] done for function nop1 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function nop1 [pdg] done for function nop1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void nop1(void) { /*@ slice pragma stmt; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_1_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.10.res.oracle0000666000000000000000000000243313571573400023147 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at double_effect2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for double_effect2 [eva] done for function double_effect2 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function double_effect2 [pdg] done for function double_effect2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; int y; void double_effect2(void) { /*@ slice pragma stmt; */ { int tmp; tmp = y; y ++; x += tmp; } return; } [kernel] Parsing tests/slicing/result/ocode_10_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.11.res.oracle0000666000000000000000000000253513571573400023153 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at double_effect3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for double_effect3 [eva] done for function double_effect3 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function double_effect3 [pdg] done for function double_effect3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; int y; void double_effect3(int c2) { int tmp; if (c2) goto L; /*@ slice pragma stmt; */ { L: { /* sequence */ tmp = y; y ++; x += tmp; } } return; } [kernel] Parsing tests/slicing/result/ocode_11_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.12.res.oracle0000666000000000000000000000250113571573400023145 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at double_effect4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for double_effect4 [eva] done for function double_effect4 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function double_effect4 [pdg] done for function double_effect4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; int y; void double_effect4(int c2) { if (c2) goto L; /*@ slice pragma stmt; */ L: { int tmp; tmp = y; y ++; x += tmp; } return; } [kernel] Parsing tests/slicing/result/ocode_12_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.13.res.oracle0000666000000000000000000000247313571573400023156 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at double_effect5 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for double_effect5 [eva] done for function double_effect5 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function double_effect5 [pdg] done for function double_effect5 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; int y; void double_effect5(int c2) { if (c2) { /*@ slice pragma stmt; */ { int tmp; tmp = y; y ++; x += tmp; } } return; } [kernel] Parsing tests/slicing/result/ocode_13_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.14.res.oracle0000666000000000000000000000232013571573400023146 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at test1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for test1 [eva] done for function test1 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test1 [pdg] done for function test1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; void test1(int c1, int c2) { if (c1 < c2) c1 = c2; /*@ slice pragma stmt; */ x = c1; return; } [kernel] Parsing tests/slicing/result/ocode_14_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.15.res.oracle0000666000000000000000000000232013571573400023147 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at test2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for test2 [eva] done for function test2 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test2 [pdg] done for function test2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; void test2(int c1, int c2) { if (c1 < c2) c1 = c2; /*@ slice pragma stmt; */ x = c1; return; } [kernel] Parsing tests/slicing/result/ocode_15_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.16.res.oracle0000666000000000000000000000232013571573400023150 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at test3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for test3 [eva] done for function test3 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test3 [pdg] done for function test3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; void test3(int c1, int c2) { if (c1 < c2) c1 = c2; /*@ slice pragma stmt; */ x = c1; return; } [kernel] Parsing tests/slicing/result/ocode_16_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.17.res.oracle0000666000000000000000000000252313571573400023156 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at test4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva:alarm] tests/slicing/slice_pragma_stmt.i:120: Warning: signed overflow. assert c2 + 1 ≤ 2147483647; [eva] Recording results for test4 [eva] done for function test4 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test4 [pdg] done for function test4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; void test4(int c1, int c2) { if (c1 < c2) c1 = c2; /*@ slice pragma stmt; */ { x = c1; c2 ++; } return; } [kernel] Parsing tests/slicing/result/ocode_17_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.18.res.oracle0000666000000000000000000000233513571573400023160 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at test5 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for test5 [eva] done for function test5 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test5 [pdg] done for function test5 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; void test5(int c1, int c2) { if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ L: x = c1; return; } [kernel] Parsing tests/slicing/result/ocode_18_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.19.res.oracle0000666000000000000000000000264713571573400023167 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at test6 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva:alarm] tests/slicing/slice_pragma_stmt.i:136: Warning: signed overflow. assert c1 + 1 ≤ 2147483647; [eva] Recording results for test6 [eva] done for function test6 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test6 [pdg] done for function test6 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; void test6(int c1, int c2) { int tmp; if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ { L: { /* sequence */ tmp = c1; c1 ++; x = tmp; } } return; } [kernel] Parsing tests/slicing/result/ocode_19_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.2.res.oracle0000666000000000000000000000223013571573400023063 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at nop2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for nop2 [eva] done for function nop2 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function nop2 [pdg] done for function nop2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void nop2(void) { /*@ slice pragma stmt; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_2_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.20.res.oracle0000666000000000000000000000300713571573400023146 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at test7 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva:alarm] tests/slicing/slice_pragma_stmt.i:144: Warning: signed overflow. assert c1 + 1 ≤ 2147483647; [eva:alarm] tests/slicing/slice_pragma_stmt.i:144: Warning: signed overflow. assert c2 + 1 ≤ 2147483647; [eva] Recording results for test7 [eva] done for function test7 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test7 [pdg] done for function test7 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; void test7(int c1, int c2) { if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ L: { int tmp; tmp = c1; c1 ++; x = tmp; c2 ++; } return; } [kernel] Parsing tests/slicing/result/ocode_20_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.21.res.oracle0000666000000000000000000000304213571573400023146 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at test8 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva:alarm] tests/slicing/slice_pragma_stmt.i:152: Warning: signed overflow. assert c1 + 1 ≤ 2147483647; [eva:alarm] tests/slicing/slice_pragma_stmt.i:152: Warning: signed overflow. assert c2 + 1 ≤ 2147483647; [eva] Recording results for test8 [eva] done for function test8 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test8 [pdg] done for function test8 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; void test8(int c1, int c2) { if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ { int tmp; L: { /* sequence */ tmp = c1; c1 ++; x = tmp; } c2 ++; } return; } [kernel] Parsing tests/slicing/result/ocode_21_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.22.res.oracle0000666000000000000000000000254013571573400023151 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at test9 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva:alarm] tests/slicing/slice_pragma_stmt.i:160: Warning: signed overflow. assert c2 + 1 ≤ 2147483647; [eva] Recording results for test9 [eva] done for function test9 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function test9 [pdg] done for function test9 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; void test9(int c1, int c2) { if (c1 < c2) goto L; c1 = c2; /*@ slice pragma stmt; */ { x = c1; L: c2 ++; } return; } [kernel] Parsing tests/slicing/result/ocode_22_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.3.res.oracle0000666000000000000000000000223013571573400023064 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at nop3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for nop3 [eva] done for function nop3 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function nop3 [pdg] done for function nop3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void nop3(void) { /*@ slice pragma stmt; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_3_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.4.res.oracle0000666000000000000000000000223213571573400023067 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at nop4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for nop4 [eva] done for function nop4 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function nop4 [pdg] done for function nop4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void nop4(int c1) { /*@ slice pragma stmt; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_4_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.5.res.oracle0000666000000000000000000000226113571573400023072 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at nop5 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for nop5 [eva] done for function nop5 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function nop5 [pdg] done for function nop5 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void nop5(int c2) { if (c2) goto L; /*@ slice pragma stmt; */ L: ; return; } [kernel] Parsing tests/slicing/result/ocode_5_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.6.res.oracle0000666000000000000000000000223013571573400023067 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at nop6 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for nop6 [eva] done for function nop6 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function nop6 [pdg] done for function nop6 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void nop6(void) { /*@ slice pragma stmt; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_6_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.7.res.oracle0000666000000000000000000000223013571573400023070 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at nop7 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for nop7 [eva] done for function nop7 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function nop7 [pdg] done for function nop7 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void nop7(void) { /*@ slice pragma stmt; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_7_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.8.res.oracle0000666000000000000000000000223013571573400023071 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at nop8 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for nop8 [eva] done for function nop8 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function nop8 [pdg] done for function nop8 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void nop8(void) { /*@ slice pragma stmt; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_8_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/slice_pragma_stmt.9.res.oracle0000666000000000000000000000244713571573400023104 0ustar [kernel] Parsing tests/slicing/slice_pragma_stmt.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at double_effect1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] Recording results for double_effect1 [eva] done for function double_effect1 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function double_effect1 [pdg] done for function double_effect1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; int y; void double_effect1(void) { int tmp; /*@ slice pragma stmt; */ { /* sequence */ tmp = y; y ++; x += tmp; } return; } [kernel] Parsing tests/slicing/result/ocode_9_slice_pragma_stmt.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/switch.res.oracle0000666000000000000000000000501513571573400020533 0ustar [kernel] Parsing tests/slicing/switch.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM choix [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function main [pdg] done for function main Slicing project worklist [default] = [main_slice_1 = (n:7(restrict to x) ,<[--d], [---]>)(n:14(restrict to x) ,<[--d], [---]>)(n:15(restrict to x) ,<[--d], [---]>)] [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ void main(char choix) { int x = 0; switch ((int)choix) { case 'a': x = 1; break; case 'b': x = 2; break; case 'c': case 'd': ; } return; } [slicing] reinitializing slicing ... Slicing project worklist [default] = [main_slice_1 = (n:8(restrict to y) ,<[--d], [---]>)(n:16(restrict to y) ,<[--d], [---]>)(n:18(restrict to y) ,<[--d], [---]>)] [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ void main(char choix) { int y = 0; switch ((int)choix) { case 'a': ; break; case 'b': ; y = 1; break; case 'c': case 'd': y = 2; } return; } [slicing] reinitializing slicing ... Slicing project worklist [default] = [main_slice_1 = (n:21(restrict to z) ,<[--d], [---]>)] [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ void main(void) { int z = 0; z ++; return; } frama-c-20.0-Calcium/tests/slicing/oracle/top.0.res.oracle0000666000000000000000000000324713571573400020177 0ustar [kernel] Parsing tests/slicing/top.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/slicing/top.i:27: Warning: out of bounds read. assert \valid_read(p_str + i); [eva] computing for function strlen <- main. Called from tests/slicing/top.i:27. [eva:alarm] tests/slicing/top.i:21: Warning: out of bounds read. assert \valid_read(q); [eva] tests/slicing/top.i:21: starting to merge loop iterations [eva:alarm] tests/slicing/top.i:21: Warning: signed overflow. assert k + 1 ≤ 2147483647; [eva] Recording results for strlen [eva] Done for function strlen [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing] Nothing to select for an unreachable stmt of uncalled [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function uncalled [pdg] Warning: unreachable entry point (sid:2, function uncalled) [pdg] Bottom for function uncalled [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ [kernel] Parsing tests/slicing/result/ocode_0_top.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/top.1.res.oracle0000666000000000000000000000357213571573400020201 0ustar [kernel] Parsing tests/slicing/top.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/slicing/top.i:27: Warning: out of bounds read. assert \valid_read(p_str + i); [eva] computing for function strlen <- main. Called from tests/slicing/top.i:27. [eva:alarm] tests/slicing/top.i:21: Warning: out of bounds read. assert \valid_read(q); [eva] tests/slicing/top.i:21: starting to merge loop iterations [eva:alarm] tests/slicing/top.i:21: Warning: signed overflow. assert k + 1 ≤ 2147483647; [eva] Recording results for strlen [eva] Done for function strlen [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function strlen [from] Done for function strlen [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function strlen [pdg] done for function strlen [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int strlen_slice_1(char *p) { char *q; int k = 0; q = p; while (*q) { k ++; q ++; } return k; } int main(char **p_str, int i) { int tmp; tmp = strlen_slice_1(*(p_str + i)); return tmp; } [kernel] Parsing tests/slicing/result/ocode_1_top.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/top.2.res.oracle0000666000000000000000000000354613571573400020203 0ustar [kernel] Parsing tests/slicing/top.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/slicing/top.i:27: Warning: out of bounds read. assert \valid_read(p_str + i); [eva] computing for function strlen <- main. Called from tests/slicing/top.i:27. [eva:alarm] tests/slicing/top.i:21: Warning: out of bounds read. assert \valid_read(q); [eva] tests/slicing/top.i:21: starting to merge loop iterations [eva:alarm] tests/slicing/top.i:21: Warning: signed overflow. assert k + 1 ≤ 2147483647; [eva] Recording results for strlen [eva] Done for function strlen [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function strlen [pdg] done for function strlen [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function strlen [from] Done for function strlen [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int strlen_slice_1(char *p) { char *q; int k = 0; q = p; while (*q) { k ++; q ++; } return k; } void main(char **p_str, int i) { strlen_slice_1(*(p_str + i)); return; } [kernel] Parsing tests/slicing/result/ocode_2_top.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/top2.0.res.oracle0000666000000000000000000000327113571573400020256 0ustar [kernel] Parsing tests/slicing/top2.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization tab[0] ∈ {0} [1] ∈ {7} G ∈ {0} X ∈ {0} S ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/top2.i:24. [eva:alarm] tests/slicing/top2.i:16: Warning: accessing out of bounds index. assert 0 ≤ i; [eva:alarm] tests/slicing/top2.i:16: Warning: accessing out of bounds index. assert i < 2; [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int X; void f_slice_1(void) { G = X; return; } void main(void) { f_slice_1(); G ++; /*@ slice pragma expr G; */ ; return; } [kernel] Parsing tests/slicing/result/ocode_0_top2.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/top2.1.res.oracle0000666000000000000000000000330613571573400020256 0ustar [kernel] Parsing tests/slicing/top2.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization tab[0] ∈ {0} [1] ∈ {7} G ∈ {0} X ∈ {0} S ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/top2.i:24. [eva:alarm] tests/slicing/top2.i:16: Warning: accessing out of bounds index. assert 0 ≤ i; [eva:alarm] tests/slicing/top2.i:16: Warning: accessing out of bounds index. assert i < 2; [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int tab[2] = {0, 7}; int f_slice_1(void) { int v; int volatile i = 0; v = tab[i]; return v; } int main(void) { int x = f_slice_1(); return x; } [kernel] Parsing tests/slicing/result/ocode_1_top2.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/undef-fun.res.oracle0000666000000000000000000000314113571573400021117 0ustar [kernel] Parsing tests/slicing/undef-fun.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva:alarm] tests/slicing/undef-fun.i:16: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva:alarm] tests/slicing/undef-fun.i:17: Warning: signed overflow. assert y + 2 ≤ 2147483647; [eva] computing for function f <- main. Called from tests/slicing/undef-fun.i:18. [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f [from] Computing for function f [from] Done for function f [pdg] done for function f [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int f_slice_1(int a); void main(int x) { x ++; f_slice_1(x); return; } [kernel] Parsing tests/slicing/result/ocode_0_undef-fun.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unitialized.0.res.oracle0000666000000000000000000000461113571573400021712 0ustar [kernel] Parsing tests/slicing/unitialized.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X1 ∈ {0} X2 ∈ {0} [eva] computing for function f1 <- main. Called from tests/slicing/unitialized.c:38. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/unitialized.c:39. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function g <- main. Called from tests/slicing/unitialized.c:40. [eva:alarm] tests/slicing/unitialized.c:30: Warning: accessing uninitialized left-value. assert \initialized(&y); [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] tests/slicing/unitialized.c:30: assertion 'Eva,initialization' got final status invalid. [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing] Nothing to select for an unreachable stmt of g [pdg] computing for function g [from] Computing for function printf [from] Done for function printf [pdg] tests/slicing/unitialized.c:33: Warning: no final state. Probably unreachable... [pdg] done for function g [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function g [from] Non-terminating function g (no dependencies) [from] Done for function g [pdg] tests/slicing/unitialized.c:43: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void g_slice_1(void) { int y; return; } void main(void) { g_slice_1(); return; } [kernel] Parsing tests/slicing/result/ocode_0_unitialized.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unitialized.1.res.oracle0000666000000000000000000000452013571573400021712 0ustar [kernel] Parsing tests/slicing/unitialized.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X1 ∈ {0} X2 ∈ {0} [eva] computing for function f1 <- main. Called from tests/slicing/unitialized.c:38. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/unitialized.c:39. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function g <- main. Called from tests/slicing/unitialized.c:40. [eva:alarm] tests/slicing/unitialized.c:30: Warning: accessing uninitialized left-value. assert \initialized(&y); [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] tests/slicing/unitialized.c:30: assertion 'Eva,initialization' got final status invalid. [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function g [from] Computing for function printf [from] Done for function printf [pdg] tests/slicing/unitialized.c:33: Warning: no final state. Probably unreachable... [pdg] done for function g [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function g [from] Non-terminating function g (no dependencies) [from] Done for function g [pdg] tests/slicing/unitialized.c:43: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void g_slice_1(void) { int y; return; } void main(void) { g_slice_1(); return; } [kernel] Parsing tests/slicing/result/ocode_1_unitialized.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unitialized.2.res.oracle0000666000000000000000000000421613571573400021715 0ustar [kernel] Parsing tests/slicing/unitialized.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X1 ∈ {0} X2 ∈ {0} [eva] computing for function f1 <- main. Called from tests/slicing/unitialized.c:38. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/unitialized.c:39. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function g <- main. Called from tests/slicing/unitialized.c:40. [eva:alarm] tests/slicing/unitialized.c:30: Warning: accessing uninitialized left-value. assert \initialized(&y); [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] tests/slicing/unitialized.c:30: assertion 'Eva,initialization' got final status invalid. [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function g [from] Computing for function printf <-g [from] Done for function printf [from] Non-terminating function g (no dependencies) [from] Done for function g [pdg] tests/slicing/unitialized.c:43: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void main(void) { int r; return; } [kernel] Parsing tests/slicing/result/ocode_2_unitialized.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unitialized.3.res.oracle0000666000000000000000000000460013571573400021713 0ustar [kernel] Parsing tests/slicing/unitialized.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X1 ∈ {0} X2 ∈ {0} [eva] computing for function f1 <- main. Called from tests/slicing/unitialized.c:38. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/slicing/unitialized.c:39. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function g <- main. Called from tests/slicing/unitialized.c:40. [eva:alarm] tests/slicing/unitialized.c:30: Warning: accessing uninitialized left-value. assert \initialized(&y); [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] tests/slicing/unitialized.c:30: assertion 'Eva,initialization' got final status invalid. [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [slicing] Nothing to select for an unreachable stmt of g [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function g [from] Computing for function printf [from] Done for function printf [pdg] tests/slicing/unitialized.c:33: Warning: no final state. Probably unreachable... [pdg] done for function g [pdg] computing for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function g [from] Non-terminating function g (no dependencies) [from] Done for function g [pdg] tests/slicing/unitialized.c:43: Warning: no final state. Probably unreachable... [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void g_slice_1(void) { return; } void main(void) { g_slice_1(); return; } [kernel] Parsing tests/slicing/result/ocode_3_unitialized.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-flavors.0.res.oracle0000666000000000000000000001400713571573400022517 0ustar [kernel] Parsing tests/slicing/unravel-flavors.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nb_fetch ∈ {0} [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:46. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-flavors.i:38: Warning: accessing uninitialized left-value. assert \initialized(&value); [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:47. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:48. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:49. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva:alarm] tests/slicing/unravel-flavors.i:51: Warning: signed overflow. assert -2147483648 ≤ 2 * red; [eva:alarm] tests/slicing/unravel-flavors.i:51: Warning: signed overflow. assert 2 * red ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:52: Warning: signed overflow. assert -2147483648 ≤ red * green; [eva:alarm] tests/slicing/unravel-flavors.i:52: Warning: signed overflow. assert red * green ≤ 2147483647; [eva] tests/slicing/unravel-flavors.i:54: starting to merge loop iterations [eva:alarm] tests/slicing/unravel-flavors.i:55: Warning: signed overflow. assert -2147483648 ≤ sour + green; [eva:alarm] tests/slicing/unravel-flavors.i:55: Warning: signed overflow. assert sour + green ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:56: Warning: signed overflow. assert -2147483648 ≤ blue + yellow; [eva:alarm] tests/slicing/unravel-flavors.i:56: Warning: signed overflow. assert blue + yellow ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:57: Warning: signed overflow. assert green + 1 ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:58: Warning: signed overflow. assert -2147483648 ≤ yellow + green; [eva:alarm] tests/slicing/unravel-flavors.i:58: Warning: signed overflow. assert yellow + green ≤ 2147483647; [eva] computing for function send1 <- main. Called from tests/slicing/unravel-flavors.i:60. [eva] computing for function printf <- send1 <- main. Called from tests/slicing/unravel-flavors.i:19. [kernel:annot:missing-spec] tests/slicing/unravel-flavors.i:19: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [eva] using specification for function printf [eva] Done for function printf [eva] Recording results for send1 [eva] Done for function send1 [eva] computing for function send2 <- main. Called from tests/slicing/unravel-flavors.i:61. [eva] computing for function printf <- send2 <- main. Called from tests/slicing/unravel-flavors.i:23. [eva] Done for function printf [eva] Recording results for send2 [eva] Done for function send2 [eva] computing for function send3 <- main. Called from tests/slicing/unravel-flavors.i:62. [eva] computing for function printf <- send3 <- main. Called from tests/slicing/unravel-flavors.i:27. [eva] Done for function printf [eva] Recording results for send3 [eva] Done for function send3 [eva] computing for function send4 <- main. Called from tests/slicing/unravel-flavors.i:63. [eva] computing for function printf <- send4 <- main. Called from tests/slicing/unravel-flavors.i:31. [eva] Done for function printf [eva] Recording results for send4 [eva] Done for function send4 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send1 [from] Computing for function printf [from] Done for function printf [pdg] done for function send1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function fetch [from] Computing for function scanf <-fetch [from] Done for function scanf [from] Done for function fetch [from] Computing for function send1 [from] Done for function send1 [from] Computing for function send2 [from] Done for function send2 [from] Computing for function send3 [from] Done for function send3 [from] Computing for function send4 [from] Done for function send4 [pdg] done for function main [pdg] computing for function fetch [pdg] done for function fetch [pdg] computing for function scanf [pdg] done for function scanf [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void scanf_slice_1(void); int send1_slice_1(int x) { return x; } int fetch_slice_1(void) { int value; scanf_slice_1(); return value; } void main(void) { int red; int green; int sweet; red = fetch_slice_1(); green = fetch_slice_1(); red = 2 * red; sweet = red * green; send1_slice_1(sweet); return; } [kernel] Parsing tests/slicing/result/ocode_0_unravel-flavors.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-flavors.1.res.oracle0000666000000000000000000001410113571573400022513 0ustar [kernel] Parsing tests/slicing/unravel-flavors.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nb_fetch ∈ {0} [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:46. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-flavors.i:38: Warning: accessing uninitialized left-value. assert \initialized(&value); [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:47. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:48. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:49. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva:alarm] tests/slicing/unravel-flavors.i:51: Warning: signed overflow. assert -2147483648 ≤ 2 * red; [eva:alarm] tests/slicing/unravel-flavors.i:51: Warning: signed overflow. assert 2 * red ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:52: Warning: signed overflow. assert -2147483648 ≤ red * green; [eva:alarm] tests/slicing/unravel-flavors.i:52: Warning: signed overflow. assert red * green ≤ 2147483647; [eva] tests/slicing/unravel-flavors.i:54: starting to merge loop iterations [eva:alarm] tests/slicing/unravel-flavors.i:55: Warning: signed overflow. assert -2147483648 ≤ sour + green; [eva:alarm] tests/slicing/unravel-flavors.i:55: Warning: signed overflow. assert sour + green ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:56: Warning: signed overflow. assert -2147483648 ≤ blue + yellow; [eva:alarm] tests/slicing/unravel-flavors.i:56: Warning: signed overflow. assert blue + yellow ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:57: Warning: signed overflow. assert green + 1 ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:58: Warning: signed overflow. assert -2147483648 ≤ yellow + green; [eva:alarm] tests/slicing/unravel-flavors.i:58: Warning: signed overflow. assert yellow + green ≤ 2147483647; [eva] computing for function send1 <- main. Called from tests/slicing/unravel-flavors.i:60. [eva] computing for function printf <- send1 <- main. Called from tests/slicing/unravel-flavors.i:19. [kernel:annot:missing-spec] tests/slicing/unravel-flavors.i:19: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [eva] using specification for function printf [eva] Done for function printf [eva] Recording results for send1 [eva] Done for function send1 [eva] computing for function send2 <- main. Called from tests/slicing/unravel-flavors.i:61. [eva] computing for function printf <- send2 <- main. Called from tests/slicing/unravel-flavors.i:23. [eva] Done for function printf [eva] Recording results for send2 [eva] Done for function send2 [eva] computing for function send3 <- main. Called from tests/slicing/unravel-flavors.i:62. [eva] computing for function printf <- send3 <- main. Called from tests/slicing/unravel-flavors.i:27. [eva] Done for function printf [eva] Recording results for send3 [eva] Done for function send3 [eva] computing for function send4 <- main. Called from tests/slicing/unravel-flavors.i:63. [eva] computing for function printf <- send4 <- main. Called from tests/slicing/unravel-flavors.i:31. [eva] Done for function printf [eva] Recording results for send4 [eva] Done for function send4 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send2 [from] Computing for function printf [from] Done for function printf [pdg] done for function send2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function fetch [from] Computing for function scanf <-fetch [from] Done for function scanf [from] Done for function fetch [from] Computing for function send1 [from] Done for function send1 [from] Computing for function send2 [from] Done for function send2 [from] Computing for function send3 [from] Done for function send3 [from] Computing for function send4 [from] Done for function send4 [pdg] done for function main [pdg] computing for function fetch [pdg] done for function fetch [pdg] computing for function scanf [pdg] done for function scanf [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void scanf_slice_1(void); int send2_slice_1(int x) { return x; } int fetch_slice_1(void) { int value; scanf_slice_1(); return value; } void main(void) { int red; int green; int sour; int i; red = fetch_slice_1(); green = fetch_slice_1(); red = 2 * red; sour = 0; i = 0; while (i < red) { sour += green; i ++; } send2_slice_1(sour); return; } [kernel] Parsing tests/slicing/result/ocode_1_unravel-flavors.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-flavors.2.res.oracle0000666000000000000000000001377413571573400022533 0ustar [kernel] Parsing tests/slicing/unravel-flavors.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nb_fetch ∈ {0} [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:46. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-flavors.i:38: Warning: accessing uninitialized left-value. assert \initialized(&value); [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:47. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:48. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:49. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva:alarm] tests/slicing/unravel-flavors.i:51: Warning: signed overflow. assert -2147483648 ≤ 2 * red; [eva:alarm] tests/slicing/unravel-flavors.i:51: Warning: signed overflow. assert 2 * red ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:52: Warning: signed overflow. assert -2147483648 ≤ red * green; [eva:alarm] tests/slicing/unravel-flavors.i:52: Warning: signed overflow. assert red * green ≤ 2147483647; [eva] tests/slicing/unravel-flavors.i:54: starting to merge loop iterations [eva:alarm] tests/slicing/unravel-flavors.i:55: Warning: signed overflow. assert -2147483648 ≤ sour + green; [eva:alarm] tests/slicing/unravel-flavors.i:55: Warning: signed overflow. assert sour + green ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:56: Warning: signed overflow. assert -2147483648 ≤ blue + yellow; [eva:alarm] tests/slicing/unravel-flavors.i:56: Warning: signed overflow. assert blue + yellow ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:57: Warning: signed overflow. assert green + 1 ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:58: Warning: signed overflow. assert -2147483648 ≤ yellow + green; [eva:alarm] tests/slicing/unravel-flavors.i:58: Warning: signed overflow. assert yellow + green ≤ 2147483647; [eva] computing for function send1 <- main. Called from tests/slicing/unravel-flavors.i:60. [eva] computing for function printf <- send1 <- main. Called from tests/slicing/unravel-flavors.i:19. [kernel:annot:missing-spec] tests/slicing/unravel-flavors.i:19: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [eva] using specification for function printf [eva] Done for function printf [eva] Recording results for send1 [eva] Done for function send1 [eva] computing for function send2 <- main. Called from tests/slicing/unravel-flavors.i:61. [eva] computing for function printf <- send2 <- main. Called from tests/slicing/unravel-flavors.i:23. [eva] Done for function printf [eva] Recording results for send2 [eva] Done for function send2 [eva] computing for function send3 <- main. Called from tests/slicing/unravel-flavors.i:62. [eva] computing for function printf <- send3 <- main. Called from tests/slicing/unravel-flavors.i:27. [eva] Done for function printf [eva] Recording results for send3 [eva] Done for function send3 [eva] computing for function send4 <- main. Called from tests/slicing/unravel-flavors.i:63. [eva] computing for function printf <- send4 <- main. Called from tests/slicing/unravel-flavors.i:31. [eva] Done for function printf [eva] Recording results for send4 [eva] Done for function send4 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send3 [from] Computing for function printf [from] Done for function printf [pdg] done for function send3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function fetch [from] Computing for function scanf <-fetch [from] Done for function scanf [from] Done for function fetch [from] Computing for function send1 [from] Done for function send1 [from] Computing for function send2 [from] Done for function send2 [from] Computing for function send3 [from] Done for function send3 [from] Computing for function send4 [from] Done for function send4 [pdg] done for function main [pdg] computing for function fetch [pdg] done for function fetch [pdg] computing for function scanf [pdg] done for function scanf [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void scanf_slice_1(void); int send3_slice_1(int x) { return x; } int fetch_slice_1(void) { int value; scanf_slice_1(); return value; } void main(void) { int blue; int yellow; int salty; blue = fetch_slice_1(); yellow = fetch_slice_1(); salty = blue + yellow; send3_slice_1(salty); return; } [kernel] Parsing tests/slicing/result/ocode_2_unravel-flavors.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-flavors.3.res.oracle0000666000000000000000000001401613571573400022522 0ustar [kernel] Parsing tests/slicing/unravel-flavors.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nb_fetch ∈ {0} [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:46. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-flavors.i:38: Warning: accessing uninitialized left-value. assert \initialized(&value); [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:47. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:48. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva] computing for function fetch <- main. Called from tests/slicing/unravel-flavors.i:49. [eva] computing for function scanf <- fetch <- main. Called from tests/slicing/unravel-flavors.i:37. [eva] Done for function scanf [eva] Recording results for fetch [eva] Done for function fetch [eva:alarm] tests/slicing/unravel-flavors.i:51: Warning: signed overflow. assert -2147483648 ≤ 2 * red; [eva:alarm] tests/slicing/unravel-flavors.i:51: Warning: signed overflow. assert 2 * red ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:52: Warning: signed overflow. assert -2147483648 ≤ red * green; [eva:alarm] tests/slicing/unravel-flavors.i:52: Warning: signed overflow. assert red * green ≤ 2147483647; [eva] tests/slicing/unravel-flavors.i:54: starting to merge loop iterations [eva:alarm] tests/slicing/unravel-flavors.i:55: Warning: signed overflow. assert -2147483648 ≤ sour + green; [eva:alarm] tests/slicing/unravel-flavors.i:55: Warning: signed overflow. assert sour + green ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:56: Warning: signed overflow. assert -2147483648 ≤ blue + yellow; [eva:alarm] tests/slicing/unravel-flavors.i:56: Warning: signed overflow. assert blue + yellow ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:57: Warning: signed overflow. assert green + 1 ≤ 2147483647; [eva:alarm] tests/slicing/unravel-flavors.i:58: Warning: signed overflow. assert -2147483648 ≤ yellow + green; [eva:alarm] tests/slicing/unravel-flavors.i:58: Warning: signed overflow. assert yellow + green ≤ 2147483647; [eva] computing for function send1 <- main. Called from tests/slicing/unravel-flavors.i:60. [eva] computing for function printf <- send1 <- main. Called from tests/slicing/unravel-flavors.i:19. [kernel:annot:missing-spec] tests/slicing/unravel-flavors.i:19: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [eva] using specification for function printf [eva] Done for function printf [eva] Recording results for send1 [eva] Done for function send1 [eva] computing for function send2 <- main. Called from tests/slicing/unravel-flavors.i:61. [eva] computing for function printf <- send2 <- main. Called from tests/slicing/unravel-flavors.i:23. [eva] Done for function printf [eva] Recording results for send2 [eva] Done for function send2 [eva] computing for function send3 <- main. Called from tests/slicing/unravel-flavors.i:62. [eva] computing for function printf <- send3 <- main. Called from tests/slicing/unravel-flavors.i:27. [eva] Done for function printf [eva] Recording results for send3 [eva] Done for function send3 [eva] computing for function send4 <- main. Called from tests/slicing/unravel-flavors.i:63. [eva] computing for function printf <- send4 <- main. Called from tests/slicing/unravel-flavors.i:31. [eva] Done for function printf [eva] Recording results for send4 [eva] Done for function send4 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send4 [from] Computing for function printf [from] Done for function printf [pdg] done for function send4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function fetch [from] Computing for function scanf <-fetch [from] Done for function scanf [from] Done for function fetch [from] Computing for function send1 [from] Done for function send1 [from] Computing for function send2 [from] Done for function send2 [from] Computing for function send3 [from] Done for function send3 [from] Computing for function send4 [from] Done for function send4 [pdg] done for function main [pdg] computing for function fetch [pdg] done for function fetch [pdg] computing for function scanf [pdg] done for function scanf [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ void scanf_slice_1(void); int send4_slice_1(int x) { return x; } int fetch_slice_1(void) { int value; scanf_slice_1(); return value; } void main(void) { int green; int yellow; int bitter; green = fetch_slice_1(); yellow = fetch_slice_1(); green ++; bitter = yellow + green; send4_slice_1(bitter); return; } [kernel] Parsing tests/slicing/result/ocode_3_unravel-flavors.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-point.0.res.oracle0000666000000000000000000001446213571573400022201 0ustar [kernel] Parsing tests/slicing/unravel-point.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:59. [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:60: Warning: accessing uninitialized left-value. assert \initialized(&input1); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:61. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:62: Warning: accessing uninitialized left-value. assert \initialized(&input2); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:63. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:64: Warning: accessing uninitialized left-value. assert \initialized(&input3); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:65. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:66. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:68: Warning: accessing uninitialized left-value. assert \initialized(&cond1); [eva:alarm] tests/slicing/unravel-point.i:71: Warning: signed overflow. assert *z + 1 ≤ 2147483647; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert -2147483648 ≤ *y + *x; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert *y + *x ≤ 2147483647; [eva] computing for function send1 <- main. Called from tests/slicing/unravel-point.i:75. [eva] computing for function printf <- send1 <- main. Called from tests/slicing/unravel-point.i:36. [kernel:annot:missing-spec] tests/slicing/unravel-point.i:36: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [eva] using specification for function printf [eva] Done for function printf [eva] Recording results for send1 [from] Computing for function send1 [from] Done for function send1 [eva] Done for function send1 [eva] computing for function send2 <- main. Called from tests/slicing/unravel-point.i:76. [eva] computing for function printf <- send2 <- main. Called from tests/slicing/unravel-point.i:40. [eva] Done for function printf [eva] Recording results for send2 [from] Computing for function send2 [from] Done for function send2 [eva] Done for function send2 [eva] computing for function send3 <- main. Called from tests/slicing/unravel-point.i:77. [eva] computing for function printf <- send3 <- main. Called from tests/slicing/unravel-point.i:44. [eva] Done for function printf [eva] Recording results for send3 [from] Computing for function send3 [from] Done for function send3 [eva] Done for function send3 [eva:alarm] tests/slicing/unravel-point.i:78: Warning: accessing uninitialized left-value. assert \initialized(&cond2); [eva] computing for function send4 <- main. Called from tests/slicing/unravel-point.i:78. [eva] computing for function printf <- send4 <- main. Called from tests/slicing/unravel-point.i:48. [eva] Done for function printf [eva] Recording results for send4 [from] Computing for function send4 [from] Done for function send4 [eva] Done for function send4 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to printf at tests/slicing/unravel-point.i:36 (by send1): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:40 (by send2): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:44 (by send3): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:48 (by send4): \result FROM \nothing [from] call to scanf at tests/slicing/unravel-point.i:59 (by main): input1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:61 (by main): input2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:63 (by main): input3 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:65 (by main): cond1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:66 (by main): cond2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to send1 at tests/slicing/unravel-point.i:75 (by main): \result FROM x [from] call to send2 at tests/slicing/unravel-point.i:76 (by main): \result FROM x [from] call to send3 at tests/slicing/unravel-point.i:77 (by main): \result FROM x [from] call to send4 at tests/slicing/unravel-point.i:78 (by main): \result FROM x [from] entry point: \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send1 [pdg] done for function send1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int scanf(char const *, int *p); int send1_slice_1(int x) { return x; } void main(void) { int input1; int input2; int input3; int cond1; int a; int b; int c; int *x; int *y; int *z; int output1; scanf("%d",& input1); a = input1; scanf("%d",& input2); b = input2; scanf("%d",& input3); c = input3; scanf("%d",& cond1); x = & a; if (cond1) x = & b; y = & c; z = & b; *z = *y + *x; output1 = *z; send1_slice_1(output1); return; } [kernel] Parsing tests/slicing/result/ocode_0_unravel-point.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-point.1.res.oracle0000666000000000000000000001411013571573400022170 0ustar [kernel] Parsing tests/slicing/unravel-point.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:59. [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:60: Warning: accessing uninitialized left-value. assert \initialized(&input1); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:61. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:62: Warning: accessing uninitialized left-value. assert \initialized(&input2); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:63. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:64: Warning: accessing uninitialized left-value. assert \initialized(&input3); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:65. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:66. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:68: Warning: accessing uninitialized left-value. assert \initialized(&cond1); [eva:alarm] tests/slicing/unravel-point.i:71: Warning: signed overflow. assert *z + 1 ≤ 2147483647; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert -2147483648 ≤ *y + *x; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert *y + *x ≤ 2147483647; [eva] computing for function send1 <- main. Called from tests/slicing/unravel-point.i:75. [eva] computing for function printf <- send1 <- main. Called from tests/slicing/unravel-point.i:36. [kernel:annot:missing-spec] tests/slicing/unravel-point.i:36: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [eva] using specification for function printf [eva] Done for function printf [eva] Recording results for send1 [from] Computing for function send1 [from] Done for function send1 [eva] Done for function send1 [eva] computing for function send2 <- main. Called from tests/slicing/unravel-point.i:76. [eva] computing for function printf <- send2 <- main. Called from tests/slicing/unravel-point.i:40. [eva] Done for function printf [eva] Recording results for send2 [from] Computing for function send2 [from] Done for function send2 [eva] Done for function send2 [eva] computing for function send3 <- main. Called from tests/slicing/unravel-point.i:77. [eva] computing for function printf <- send3 <- main. Called from tests/slicing/unravel-point.i:44. [eva] Done for function printf [eva] Recording results for send3 [from] Computing for function send3 [from] Done for function send3 [eva] Done for function send3 [eva:alarm] tests/slicing/unravel-point.i:78: Warning: accessing uninitialized left-value. assert \initialized(&cond2); [eva] computing for function send4 <- main. Called from tests/slicing/unravel-point.i:78. [eva] computing for function printf <- send4 <- main. Called from tests/slicing/unravel-point.i:48. [eva] Done for function printf [eva] Recording results for send4 [from] Computing for function send4 [from] Done for function send4 [eva] Done for function send4 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to printf at tests/slicing/unravel-point.i:36 (by send1): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:40 (by send2): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:44 (by send3): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:48 (by send4): \result FROM \nothing [from] call to scanf at tests/slicing/unravel-point.i:59 (by main): input1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:61 (by main): input2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:63 (by main): input3 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:65 (by main): cond1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:66 (by main): cond2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to send1 at tests/slicing/unravel-point.i:75 (by main): \result FROM x [from] call to send2 at tests/slicing/unravel-point.i:76 (by main): \result FROM x [from] call to send3 at tests/slicing/unravel-point.i:77 (by main): \result FROM x [from] call to send4 at tests/slicing/unravel-point.i:78 (by main): \result FROM x [from] entry point: \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send2 [pdg] done for function send2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int scanf(char const *, int *p); int send2_slice_1(int x) { return x; } void main(void) { int input2; int b; int *z; int output2; scanf("%d",& input2); b = input2; z = & b; output2 = *z + 1; send2_slice_1(output2); return; } [kernel] Parsing tests/slicing/result/ocode_1_unravel-point.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-point.2.res.oracle0000666000000000000000000001446213571573400022203 0ustar [kernel] Parsing tests/slicing/unravel-point.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:59. [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:60: Warning: accessing uninitialized left-value. assert \initialized(&input1); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:61. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:62: Warning: accessing uninitialized left-value. assert \initialized(&input2); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:63. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:64: Warning: accessing uninitialized left-value. assert \initialized(&input3); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:65. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:66. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:68: Warning: accessing uninitialized left-value. assert \initialized(&cond1); [eva:alarm] tests/slicing/unravel-point.i:71: Warning: signed overflow. assert *z + 1 ≤ 2147483647; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert -2147483648 ≤ *y + *x; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert *y + *x ≤ 2147483647; [eva] computing for function send1 <- main. Called from tests/slicing/unravel-point.i:75. [eva] computing for function printf <- send1 <- main. Called from tests/slicing/unravel-point.i:36. [kernel:annot:missing-spec] tests/slicing/unravel-point.i:36: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [eva] using specification for function printf [eva] Done for function printf [eva] Recording results for send1 [from] Computing for function send1 [from] Done for function send1 [eva] Done for function send1 [eva] computing for function send2 <- main. Called from tests/slicing/unravel-point.i:76. [eva] computing for function printf <- send2 <- main. Called from tests/slicing/unravel-point.i:40. [eva] Done for function printf [eva] Recording results for send2 [from] Computing for function send2 [from] Done for function send2 [eva] Done for function send2 [eva] computing for function send3 <- main. Called from tests/slicing/unravel-point.i:77. [eva] computing for function printf <- send3 <- main. Called from tests/slicing/unravel-point.i:44. [eva] Done for function printf [eva] Recording results for send3 [from] Computing for function send3 [from] Done for function send3 [eva] Done for function send3 [eva:alarm] tests/slicing/unravel-point.i:78: Warning: accessing uninitialized left-value. assert \initialized(&cond2); [eva] computing for function send4 <- main. Called from tests/slicing/unravel-point.i:78. [eva] computing for function printf <- send4 <- main. Called from tests/slicing/unravel-point.i:48. [eva] Done for function printf [eva] Recording results for send4 [from] Computing for function send4 [from] Done for function send4 [eva] Done for function send4 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to printf at tests/slicing/unravel-point.i:36 (by send1): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:40 (by send2): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:44 (by send3): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:48 (by send4): \result FROM \nothing [from] call to scanf at tests/slicing/unravel-point.i:59 (by main): input1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:61 (by main): input2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:63 (by main): input3 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:65 (by main): cond1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:66 (by main): cond2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to send1 at tests/slicing/unravel-point.i:75 (by main): \result FROM x [from] call to send2 at tests/slicing/unravel-point.i:76 (by main): \result FROM x [from] call to send3 at tests/slicing/unravel-point.i:77 (by main): \result FROM x [from] call to send4 at tests/slicing/unravel-point.i:78 (by main): \result FROM x [from] entry point: \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send3 [pdg] done for function send3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int scanf(char const *, int *p); int send3_slice_1(int x) { return x; } void main(void) { int input1; int input2; int input3; int cond1; int a; int b; int c; int *x; int *y; int *z; int output3; scanf("%d",& input1); a = input1; scanf("%d",& input2); b = input2; scanf("%d",& input3); c = input3; scanf("%d",& cond1); x = & a; if (cond1) x = & b; y = & c; z = & b; *z = *y + *x; output3 = *x; send3_slice_1(output3); return; } [kernel] Parsing tests/slicing/result/ocode_2_unravel-point.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-point.3.res.oracle0000666000000000000000000001376513571573400022211 0ustar [kernel] Parsing tests/slicing/unravel-point.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:59. [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:60: Warning: accessing uninitialized left-value. assert \initialized(&input1); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:61. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:62: Warning: accessing uninitialized left-value. assert \initialized(&input2); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:63. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:64: Warning: accessing uninitialized left-value. assert \initialized(&input3); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:65. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:66. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:68: Warning: accessing uninitialized left-value. assert \initialized(&cond1); [eva:alarm] tests/slicing/unravel-point.i:71: Warning: signed overflow. assert *z + 1 ≤ 2147483647; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert -2147483648 ≤ *y + *x; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert *y + *x ≤ 2147483647; [eva] computing for function send1 <- main. Called from tests/slicing/unravel-point.i:75. [eva] computing for function printf <- send1 <- main. Called from tests/slicing/unravel-point.i:36. [kernel:annot:missing-spec] tests/slicing/unravel-point.i:36: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [eva] using specification for function printf [eva] Done for function printf [eva] Recording results for send1 [from] Computing for function send1 [from] Done for function send1 [eva] Done for function send1 [eva] computing for function send2 <- main. Called from tests/slicing/unravel-point.i:76. [eva] computing for function printf <- send2 <- main. Called from tests/slicing/unravel-point.i:40. [eva] Done for function printf [eva] Recording results for send2 [from] Computing for function send2 [from] Done for function send2 [eva] Done for function send2 [eva] computing for function send3 <- main. Called from tests/slicing/unravel-point.i:77. [eva] computing for function printf <- send3 <- main. Called from tests/slicing/unravel-point.i:44. [eva] Done for function printf [eva] Recording results for send3 [from] Computing for function send3 [from] Done for function send3 [eva] Done for function send3 [eva:alarm] tests/slicing/unravel-point.i:78: Warning: accessing uninitialized left-value. assert \initialized(&cond2); [eva] computing for function send4 <- main. Called from tests/slicing/unravel-point.i:78. [eva] computing for function printf <- send4 <- main. Called from tests/slicing/unravel-point.i:48. [eva] Done for function printf [eva] Recording results for send4 [from] Computing for function send4 [from] Done for function send4 [eva] Done for function send4 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to printf at tests/slicing/unravel-point.i:36 (by send1): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:40 (by send2): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:44 (by send3): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:48 (by send4): \result FROM \nothing [from] call to scanf at tests/slicing/unravel-point.i:59 (by main): input1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:61 (by main): input2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:63 (by main): input3 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:65 (by main): cond1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:66 (by main): cond2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to send1 at tests/slicing/unravel-point.i:75 (by main): \result FROM x [from] call to send2 at tests/slicing/unravel-point.i:76 (by main): \result FROM x [from] call to send3 at tests/slicing/unravel-point.i:77 (by main): \result FROM x [from] call to send4 at tests/slicing/unravel-point.i:78 (by main): \result FROM x [from] entry point: \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send4 [pdg] done for function send4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int scanf(char const *, int *p); int send4_slice_1(int x) { return x; } void main(void) { int cond2; scanf("%d",& cond2); send4_slice_1(cond2); return; } [kernel] Parsing tests/slicing/result/ocode_3_unravel-point.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-point.4.res.oracle0000666000000000000000000002711513571573400022204 0ustar [kernel] Parsing tests/slicing/unravel-point.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:59. [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:60: Warning: accessing uninitialized left-value. assert \initialized(&input1); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:61. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:62: Warning: accessing uninitialized left-value. assert \initialized(&input2); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:63. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:64: Warning: accessing uninitialized left-value. assert \initialized(&input3); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:65. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:66. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:68: Warning: accessing uninitialized left-value. assert \initialized(&cond1); [eva:alarm] tests/slicing/unravel-point.i:71: Warning: signed overflow. assert *z + 1 ≤ 2147483647; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert -2147483648 ≤ *y + *x; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert *y + *x ≤ 2147483647; [eva] computing for function send1 <- main. Called from tests/slicing/unravel-point.i:75. [eva] computing for function printf <- send1 <- main. Called from tests/slicing/unravel-point.i:36. [kernel:annot:missing-spec] tests/slicing/unravel-point.i:36: Warning: Neither code nor specification for function printf, generating default assigns from the prototype [eva] using specification for function printf [eva] Done for function printf [eva] Recording results for send1 [from] Computing for function send1 [from] Done for function send1 [eva] Done for function send1 [eva] computing for function send2 <- main. Called from tests/slicing/unravel-point.i:76. [eva] computing for function printf <- send2 <- main. Called from tests/slicing/unravel-point.i:40. [eva] Done for function printf [eva] Recording results for send2 [from] Computing for function send2 [from] Done for function send2 [eva] Done for function send2 [eva] computing for function send3 <- main. Called from tests/slicing/unravel-point.i:77. [eva] computing for function printf <- send3 <- main. Called from tests/slicing/unravel-point.i:44. [eva] Done for function printf [eva] Recording results for send3 [from] Computing for function send3 [from] Done for function send3 [eva] Done for function send3 [eva:alarm] tests/slicing/unravel-point.i:78: Warning: accessing uninitialized left-value. assert \initialized(&cond2); [eva] computing for function send4 <- main. Called from tests/slicing/unravel-point.i:78. [eva] computing for function printf <- send4 <- main. Called from tests/slicing/unravel-point.i:48. [eva] Done for function printf [eva] Recording results for send4 [from] Computing for function send4 [from] Done for function send4 [eva] Done for function send4 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to printf at tests/slicing/unravel-point.i:36 (by send1): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:40 (by send2): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:44 (by send3): \result FROM \nothing [from] call to printf at tests/slicing/unravel-point.i:48 (by send4): \result FROM \nothing [from] call to scanf at tests/slicing/unravel-point.i:59 (by main): input1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:61 (by main): input2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:63 (by main): input3 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:65 (by main): cond1 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to scanf at tests/slicing/unravel-point.i:66 (by main): cond2 FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to send1 at tests/slicing/unravel-point.i:75 (by main): \result FROM x [from] call to send2 at tests/slicing/unravel-point.i:76 (by main): \result FROM x [from] call to send3 at tests/slicing/unravel-point.i:77 (by main): \result FROM x [from] call to send4 at tests/slicing/unravel-point.i:78 (by main): \result FROM x [from] entry point: \result FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send1 [pdg] done for function send1 [pdg] computing for function send4 [pdg] done for function send4 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [pdg] computing for function main [pdg] done for function main [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:59. [kernel:annot:missing-spec] tests/slicing/unravel-point.i:59: Warning: Neither code nor specification for function scanf, generating default assigns from the prototype [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:60: Warning: accessing uninitialized left-value. assert \initialized(&input1); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:61. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:62: Warning: accessing uninitialized left-value. assert \initialized(&input2); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:63. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:64: Warning: accessing uninitialized left-value. assert \initialized(&input3); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:65. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-point.i:66. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-point.i:68: Warning: accessing uninitialized left-value. assert \initialized(&cond1); [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert -2147483648 ≤ *y + *x; [eva:alarm] tests/slicing/unravel-point.i:72: Warning: signed overflow. assert *y + *x ≤ 2147483647; [eva] computing for function send1_slice_1 <- main. Called from tests/slicing/unravel-point.i:75. [eva] Recording results for send1_slice_1 [from] Computing for function send1_slice_1 [from] Done for function send1_slice_1 [eva] Done for function send1_slice_1 [eva:alarm] tests/slicing/unravel-point.i:78: Warning: accessing uninitialized left-value. assert \initialized(&cond2); [eva] computing for function send4_slice_1 <- main. Called from tests/slicing/unravel-point.i:78. [eva] Recording results for send4_slice_1 [from] Computing for function send4_slice_1 [from] Done for function send4_slice_1 [eva] Done for function send4_slice_1 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to scanf at tests/slicing/unravel-point.i:59 (by main): input1 FROM input1 (and SELF) \result FROM input1 [from] call to scanf at tests/slicing/unravel-point.i:61 (by main): input2 FROM input2 (and SELF) \result FROM input2 [from] call to scanf at tests/slicing/unravel-point.i:63 (by main): input3 FROM input3 (and SELF) \result FROM input3 [from] call to scanf at tests/slicing/unravel-point.i:65 (by main): cond1 FROM cond1 (and SELF) \result FROM cond1 [from] call to scanf at tests/slicing/unravel-point.i:66 (by main): cond2 FROM cond2 (and SELF) \result FROM cond2 [from] call to send1_slice_1 at tests/slicing/unravel-point.i:75 (by main): \result FROM x [from] call to send4_slice_1 at tests/slicing/unravel-point.i:78 (by main): \result FROM x [from] entry point: NO EFFECTS [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function send1_slice_1 [pdg] done for function send1_slice_1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ /*@ assigns \result, *p; assigns \result \from *p; assigns *p \from *p; */ int scanf(char const *, int *p); int send1_slice_1(int x) { return x; } int send4_slice_1(int x) { return x; } void main(void) { int input1; int input2; int input3; int cond1; int cond2; int a; int b; int c; int *x; int *y; int *z; int output1; scanf("%d",& input1); /*@ assert Eva: initialization: \initialized(&input1); */ a = input1; scanf("%d",& input2); /*@ assert Eva: initialization: \initialized(&input2); */ b = input2; scanf("%d",& input3); /*@ assert Eva: initialization: \initialized(&input3); */ c = input3; scanf("%d",& cond1); scanf("%d",& cond2); x = & a; /*@ assert Eva: initialization: \initialized(&cond1); */ if (cond1) x = & b; y = & c; z = & b; /*@ assert Eva: signed_overflow: -2147483648 ≤ *y + *x; */ /*@ assert Eva: signed_overflow: *y + *x ≤ 2147483647; */ *z = *y + *x; output1 = *z; send1_slice_1(output1); /*@ assert Eva: initialization: \initialized(&cond2); */ send4_slice_1(cond2); return; } /* Generated by Frama-C */ int scanf(char const *, int *p); int send1_slice_1_slice_1(int x) { return x; } void main(void) { int input1; int input2; int input3; int cond1; int a; int b; int c; int *x; int *y; int *z; int output1; scanf("%d",& input1); a = input1; scanf("%d",& input2); b = input2; scanf("%d",& input3); c = input3; scanf("%d",& cond1); x = & a; if (cond1) x = & b; y = & c; z = & b; *z = *y + *x; output1 = *z; send1_slice_1_slice_1(output1); return; } [kernel] Parsing tests/slicing/result/ocode_4_unravel-point.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-variance.0.res.oracle0000666000000000000000000002515013571573400022634 0ustar [kernel] Parsing tests/slicing/unravel-variance.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:31. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:31: Warning: Neither code nor specification for function scanf, generating default assigns from the prototype [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:32: Warning: accessing uninitialized left-value. assert \initialized(&n); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(x[i] * x[i])); [eva] tests/slicing/unravel-variance.i:32: starting to merge loop iterations [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite((float)(t1 + x[i])); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(ssq + (float)(x[i] * x[i]))); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing out of bounds index. assert i < 1024; [eva:alarm] tests/slicing/unravel-variance.i:38: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)n * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: signed overflow. assert -2147483648 ≤ n - 1; [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)((float)n * avg) * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)((float)((float)n * avg) * avg))); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)((float)((float)n * avg) * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(t1 * avg)); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)(t1 * avg))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)(t1 * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)(t1 * t1)); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)((float)(t1 * t1) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)(ssq - t1)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - t1) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite((float)(x[i] - avg)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(dev * dev)); [eva] tests/slicing/unravel-variance.i:44: starting to merge loop iterations [eva:alarm] tests/slicing/unravel-variance.i:47: Warning: non-finite float value. assert \is_finite((float)(t2 + dev)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(t1 + (float)(dev * dev))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t2 * t2)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t2 * t2) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t1 - (float)((float)(t2 * t2) / (float)n))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t1 - (float)((float)(t2 * t2) / (float)n)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:51: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var2; [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert var2 < 2147483648; [eva] computing for function printf1 <- main. Called from tests/slicing/unravel-variance.i:52. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:52: Warning: Neither code nor specification for function printf1, generating default assigns from the prototype [eva] using specification for function printf1 [eva] Done for function printf1 [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var3; [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert var3 < 2147483648; [eva] computing for function printf2 <- main. Called from tests/slicing/unravel-variance.i:53. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:53: Warning: Neither code nor specification for function printf2, generating default assigns from the prototype [eva] using specification for function printf2 [eva] Done for function printf2 [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var4; [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert var4 < 2147483648; [eva] computing for function printf3 <- main. Called from tests/slicing/unravel-variance.i:54. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:54: Warning: Neither code nor specification for function printf3, generating default assigns from the prototype [eva] using specification for function printf3 [eva] Done for function printf3 [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var5; [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert var5 < 2147483648; [eva] computing for function printf4 <- main. Called from tests/slicing/unravel-variance.i:55. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:55: Warning: Neither code nor specification for function printf4, generating default assigns from the prototype [eva] using specification for function printf4 [eva] Done for function printf4 [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var1; [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert var1 < 2147483648; [eva] computing for function printf5 <- main. Called from tests/slicing/unravel-variance.i:56. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:56: Warning: Neither code nor specification for function printf5, generating default assigns from the prototype [eva] using specification for function printf5 [eva] Done for function printf5 [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 2 assertion(s) [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function scanf [from] Done for function scanf [from] Computing for function printf1 [from] Done for function printf1 [from] Computing for function printf2 [from] Done for function printf2 [from] Computing for function printf3 [from] Done for function printf3 [from] Computing for function printf4 [from] Done for function printf4 [from] Computing for function printf5 [from] Done for function printf5 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int scanf(char const *, int *p); int printf1(char const *, int); void main(void) { float x[1024]; float var2; float t1; float ssq; int i; int n; t1 = (float)0; ssq = (float)0; scanf("%d",& n); i = 0; while (i < n) { scanf("%f",(int *)(& x[i])); t1 += x[i]; ssq += x[i] * x[i]; i ++; } t1 = (t1 * t1) / (float)n; var2 = (ssq - t1) / (float)(n - 1); printf1("variance (one pass, using square of sum): %f \n",(int)var2); return; } [kernel] Parsing tests/slicing/result/ocode_0_unravel-variance.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-variance.1.res.oracle0000666000000000000000000002517513571573400022644 0ustar [kernel] Parsing tests/slicing/unravel-variance.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:31. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:31: Warning: Neither code nor specification for function scanf, generating default assigns from the prototype [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:32: Warning: accessing uninitialized left-value. assert \initialized(&n); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(x[i] * x[i])); [eva] tests/slicing/unravel-variance.i:32: starting to merge loop iterations [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite((float)(t1 + x[i])); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(ssq + (float)(x[i] * x[i]))); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing out of bounds index. assert i < 1024; [eva:alarm] tests/slicing/unravel-variance.i:38: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)n * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: signed overflow. assert -2147483648 ≤ n - 1; [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)((float)n * avg) * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)((float)((float)n * avg) * avg))); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)((float)((float)n * avg) * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(t1 * avg)); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)(t1 * avg))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)(t1 * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)(t1 * t1)); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)((float)(t1 * t1) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)(ssq - t1)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - t1) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite((float)(x[i] - avg)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(dev * dev)); [eva] tests/slicing/unravel-variance.i:44: starting to merge loop iterations [eva:alarm] tests/slicing/unravel-variance.i:47: Warning: non-finite float value. assert \is_finite((float)(t2 + dev)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(t1 + (float)(dev * dev))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t2 * t2)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t2 * t2) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t1 - (float)((float)(t2 * t2) / (float)n))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t1 - (float)((float)(t2 * t2) / (float)n)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:51: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var2; [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert var2 < 2147483648; [eva] computing for function printf1 <- main. Called from tests/slicing/unravel-variance.i:52. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:52: Warning: Neither code nor specification for function printf1, generating default assigns from the prototype [eva] using specification for function printf1 [eva] Done for function printf1 [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var3; [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert var3 < 2147483648; [eva] computing for function printf2 <- main. Called from tests/slicing/unravel-variance.i:53. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:53: Warning: Neither code nor specification for function printf2, generating default assigns from the prototype [eva] using specification for function printf2 [eva] Done for function printf2 [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var4; [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert var4 < 2147483648; [eva] computing for function printf3 <- main. Called from tests/slicing/unravel-variance.i:54. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:54: Warning: Neither code nor specification for function printf3, generating default assigns from the prototype [eva] using specification for function printf3 [eva] Done for function printf3 [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var5; [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert var5 < 2147483648; [eva] computing for function printf4 <- main. Called from tests/slicing/unravel-variance.i:55. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:55: Warning: Neither code nor specification for function printf4, generating default assigns from the prototype [eva] using specification for function printf4 [eva] Done for function printf4 [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var1; [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert var1 < 2147483648; [eva] computing for function printf5 <- main. Called from tests/slicing/unravel-variance.i:56. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:56: Warning: Neither code nor specification for function printf5, generating default assigns from the prototype [eva] using specification for function printf5 [eva] Done for function printf5 [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 2 assertion(s) [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function scanf [from] Done for function scanf [from] Computing for function printf1 [from] Done for function printf1 [from] Computing for function printf2 [from] Done for function printf2 [from] Computing for function printf3 [from] Done for function printf3 [from] Computing for function printf4 [from] Done for function printf4 [from] Computing for function printf5 [from] Done for function printf5 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int scanf(char const *, int *p); int printf2(char const *, int); void main(void) { float x[1024]; float var3; float t1; float ssq; float avg; int i; int n; t1 = (float)0; ssq = (float)0; scanf("%d",& n); i = 0; while (i < n) { scanf("%f",(int *)(& x[i])); t1 += x[i]; ssq += x[i] * x[i]; i ++; } avg = t1 / (float)n; var3 = (ssq - ((float)n * avg) * avg) / (float)(n - 1); printf2("variance (one pass, using average): %f \n",(int)var3); return; } [kernel] Parsing tests/slicing/result/ocode_1_unravel-variance.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-variance.2.res.oracle0000666000000000000000000002516413571573400022643 0ustar [kernel] Parsing tests/slicing/unravel-variance.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:31. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:31: Warning: Neither code nor specification for function scanf, generating default assigns from the prototype [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:32: Warning: accessing uninitialized left-value. assert \initialized(&n); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(x[i] * x[i])); [eva] tests/slicing/unravel-variance.i:32: starting to merge loop iterations [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite((float)(t1 + x[i])); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(ssq + (float)(x[i] * x[i]))); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing out of bounds index. assert i < 1024; [eva:alarm] tests/slicing/unravel-variance.i:38: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)n * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: signed overflow. assert -2147483648 ≤ n - 1; [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)((float)n * avg) * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)((float)((float)n * avg) * avg))); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)((float)((float)n * avg) * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(t1 * avg)); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)(t1 * avg))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)(t1 * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)(t1 * t1)); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)((float)(t1 * t1) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)(ssq - t1)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - t1) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite((float)(x[i] - avg)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(dev * dev)); [eva] tests/slicing/unravel-variance.i:44: starting to merge loop iterations [eva:alarm] tests/slicing/unravel-variance.i:47: Warning: non-finite float value. assert \is_finite((float)(t2 + dev)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(t1 + (float)(dev * dev))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t2 * t2)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t2 * t2) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t1 - (float)((float)(t2 * t2) / (float)n))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t1 - (float)((float)(t2 * t2) / (float)n)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:51: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var2; [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert var2 < 2147483648; [eva] computing for function printf1 <- main. Called from tests/slicing/unravel-variance.i:52. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:52: Warning: Neither code nor specification for function printf1, generating default assigns from the prototype [eva] using specification for function printf1 [eva] Done for function printf1 [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var3; [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert var3 < 2147483648; [eva] computing for function printf2 <- main. Called from tests/slicing/unravel-variance.i:53. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:53: Warning: Neither code nor specification for function printf2, generating default assigns from the prototype [eva] using specification for function printf2 [eva] Done for function printf2 [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var4; [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert var4 < 2147483648; [eva] computing for function printf3 <- main. Called from tests/slicing/unravel-variance.i:54. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:54: Warning: Neither code nor specification for function printf3, generating default assigns from the prototype [eva] using specification for function printf3 [eva] Done for function printf3 [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var5; [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert var5 < 2147483648; [eva] computing for function printf4 <- main. Called from tests/slicing/unravel-variance.i:55. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:55: Warning: Neither code nor specification for function printf4, generating default assigns from the prototype [eva] using specification for function printf4 [eva] Done for function printf4 [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var1; [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert var1 < 2147483648; [eva] computing for function printf5 <- main. Called from tests/slicing/unravel-variance.i:56. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:56: Warning: Neither code nor specification for function printf5, generating default assigns from the prototype [eva] using specification for function printf5 [eva] Done for function printf5 [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 2 assertion(s) [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function scanf [from] Done for function scanf [from] Computing for function printf1 [from] Done for function printf1 [from] Computing for function printf2 [from] Done for function printf2 [from] Computing for function printf3 [from] Done for function printf3 [from] Computing for function printf4 [from] Done for function printf4 [from] Computing for function printf5 [from] Done for function printf5 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int scanf(char const *, int *p); int printf3(char const *, int); void main(void) { float x[1024]; float var4; float t1; float ssq; float avg; int i; int n; t1 = (float)0; ssq = (float)0; scanf("%d",& n); i = 0; while (i < n) { scanf("%f",(int *)(& x[i])); t1 += x[i]; ssq += x[i] * x[i]; i ++; } avg = t1 / (float)n; var4 = (ssq - t1 * avg) / (float)(n - 1); printf3("variance (one pass, using average, sum): %f \n",(int)var4); return; } [kernel] Parsing tests/slicing/result/ocode_2_unravel-variance.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-variance.3.res.oracle0000666000000000000000000002533513571573400022644 0ustar [kernel] Parsing tests/slicing/unravel-variance.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:31. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:31: Warning: Neither code nor specification for function scanf, generating default assigns from the prototype [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:32: Warning: accessing uninitialized left-value. assert \initialized(&n); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(x[i] * x[i])); [eva] tests/slicing/unravel-variance.i:32: starting to merge loop iterations [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite((float)(t1 + x[i])); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(ssq + (float)(x[i] * x[i]))); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing out of bounds index. assert i < 1024; [eva:alarm] tests/slicing/unravel-variance.i:38: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)n * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: signed overflow. assert -2147483648 ≤ n - 1; [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)((float)n * avg) * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)((float)((float)n * avg) * avg))); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)((float)((float)n * avg) * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(t1 * avg)); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)(t1 * avg))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)(t1 * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)(t1 * t1)); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)((float)(t1 * t1) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)(ssq - t1)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - t1) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite((float)(x[i] - avg)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(dev * dev)); [eva] tests/slicing/unravel-variance.i:44: starting to merge loop iterations [eva:alarm] tests/slicing/unravel-variance.i:47: Warning: non-finite float value. assert \is_finite((float)(t2 + dev)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(t1 + (float)(dev * dev))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t2 * t2)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t2 * t2) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t1 - (float)((float)(t2 * t2) / (float)n))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t1 - (float)((float)(t2 * t2) / (float)n)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:51: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var2; [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert var2 < 2147483648; [eva] computing for function printf1 <- main. Called from tests/slicing/unravel-variance.i:52. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:52: Warning: Neither code nor specification for function printf1, generating default assigns from the prototype [eva] using specification for function printf1 [eva] Done for function printf1 [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var3; [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert var3 < 2147483648; [eva] computing for function printf2 <- main. Called from tests/slicing/unravel-variance.i:53. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:53: Warning: Neither code nor specification for function printf2, generating default assigns from the prototype [eva] using specification for function printf2 [eva] Done for function printf2 [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var4; [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert var4 < 2147483648; [eva] computing for function printf3 <- main. Called from tests/slicing/unravel-variance.i:54. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:54: Warning: Neither code nor specification for function printf3, generating default assigns from the prototype [eva] using specification for function printf3 [eva] Done for function printf3 [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var5; [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert var5 < 2147483648; [eva] computing for function printf4 <- main. Called from tests/slicing/unravel-variance.i:55. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:55: Warning: Neither code nor specification for function printf4, generating default assigns from the prototype [eva] using specification for function printf4 [eva] Done for function printf4 [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var1; [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert var1 < 2147483648; [eva] computing for function printf5 <- main. Called from tests/slicing/unravel-variance.i:56. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:56: Warning: Neither code nor specification for function printf5, generating default assigns from the prototype [eva] using specification for function printf5 [eva] Done for function printf5 [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 2 assertion(s) [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function scanf [from] Done for function scanf [from] Computing for function printf1 [from] Done for function printf1 [from] Computing for function printf2 [from] Done for function printf2 [from] Computing for function printf3 [from] Done for function printf3 [from] Computing for function printf4 [from] Done for function printf4 [from] Computing for function printf5 [from] Done for function printf5 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int scanf(char const *, int *p); int printf4(char const *, int); void main(void) { float x[1024]; float var5; float t1; float t2; float avg; float dev; int i; int n; t2 = (float)0; t1 = (float)0; scanf("%d",& n); i = 0; while (i < n) { scanf("%f",(int *)(& x[i])); t1 += x[i]; i ++; } avg = t1 / (float)n; t1 = (float)0; i = 0; while (i < n) { dev = x[i] - avg; t2 += dev; t1 += dev * dev; i ++; } var5 = (t1 - (t2 * t2) / (float)n) / (float)(n - 1); printf4("variance (two pass, corrected): %f \n",(int)var5); return; } [kernel] Parsing tests/slicing/result/ocode_3_unravel-variance.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unravel-variance.4.res.oracle0000666000000000000000000002521513571573400022642 0ustar [kernel] Parsing tests/slicing/unravel-variance.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:31. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:31: Warning: Neither code nor specification for function scanf, generating default assigns from the prototype [eva] using specification for function scanf [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:32: Warning: accessing uninitialized left-value. assert \initialized(&n); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(x[i] * x[i])); [eva] tests/slicing/unravel-variance.i:32: starting to merge loop iterations [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: non-finite float value. assert \is_finite((float)(t1 + x[i])); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:36: Warning: non-finite float value. assert \is_finite((float)(ssq + (float)(x[i] * x[i]))); [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva] computing for function scanf <- main. Called from tests/slicing/unravel-variance.i:34. [eva] Done for function scanf [eva:alarm] tests/slicing/unravel-variance.i:35: Warning: accessing out of bounds index. assert i < 1024; [eva:alarm] tests/slicing/unravel-variance.i:38: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)n * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: signed overflow. assert -2147483648 ≤ n - 1; [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)((float)n * avg) * avg)); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)((float)((float)n * avg) * avg))); [eva:alarm] tests/slicing/unravel-variance.i:39: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)((float)((float)n * avg) * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(t1 * avg)); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)(ssq - (float)(t1 * avg))); [eva:alarm] tests/slicing/unravel-variance.i:40: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - (float)(t1 * avg)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)(t1 * t1)); [eva:alarm] tests/slicing/unravel-variance.i:41: Warning: non-finite float value. assert \is_finite((float)((float)(t1 * t1) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)(ssq - t1)); [eva:alarm] tests/slicing/unravel-variance.i:42: Warning: non-finite float value. assert \is_finite((float)((float)(ssq - t1) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: accessing uninitialized left-value. assert \initialized(&x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite(x[i]); [eva:alarm] tests/slicing/unravel-variance.i:46: Warning: non-finite float value. assert \is_finite((float)(x[i] - avg)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(dev * dev)); [eva] tests/slicing/unravel-variance.i:44: starting to merge loop iterations [eva:alarm] tests/slicing/unravel-variance.i:47: Warning: non-finite float value. assert \is_finite((float)(t2 + dev)); [eva:alarm] tests/slicing/unravel-variance.i:48: Warning: non-finite float value. assert \is_finite((float)(t1 + (float)(dev * dev))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t2 * t2)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t2 * t2) / (float)n)); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)(t1 - (float)((float)(t2 * t2) / (float)n))); [eva:alarm] tests/slicing/unravel-variance.i:50: Warning: non-finite float value. assert \is_finite((float)((float)(t1 - (float)((float)(t2 * t2) / (float)n)) / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:51: Warning: non-finite float value. assert \is_finite((float)(t1 / (float)((int)(n - 1)))); [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var2; [eva:alarm] tests/slicing/unravel-variance.i:52: Warning: overflow in conversion from floating-point to integer. assert var2 < 2147483648; [eva] computing for function printf1 <- main. Called from tests/slicing/unravel-variance.i:52. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:52: Warning: Neither code nor specification for function printf1, generating default assigns from the prototype [eva] using specification for function printf1 [eva] Done for function printf1 [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var3; [eva:alarm] tests/slicing/unravel-variance.i:53: Warning: overflow in conversion from floating-point to integer. assert var3 < 2147483648; [eva] computing for function printf2 <- main. Called from tests/slicing/unravel-variance.i:53. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:53: Warning: Neither code nor specification for function printf2, generating default assigns from the prototype [eva] using specification for function printf2 [eva] Done for function printf2 [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var4; [eva:alarm] tests/slicing/unravel-variance.i:54: Warning: overflow in conversion from floating-point to integer. assert var4 < 2147483648; [eva] computing for function printf3 <- main. Called from tests/slicing/unravel-variance.i:54. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:54: Warning: Neither code nor specification for function printf3, generating default assigns from the prototype [eva] using specification for function printf3 [eva] Done for function printf3 [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var5; [eva:alarm] tests/slicing/unravel-variance.i:55: Warning: overflow in conversion from floating-point to integer. assert var5 < 2147483648; [eva] computing for function printf4 <- main. Called from tests/slicing/unravel-variance.i:55. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:55: Warning: Neither code nor specification for function printf4, generating default assigns from the prototype [eva] using specification for function printf4 [eva] Done for function printf4 [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < var1; [eva:alarm] tests/slicing/unravel-variance.i:56: Warning: overflow in conversion from floating-point to integer. assert var1 < 2147483648; [eva] computing for function printf5 <- main. Called from tests/slicing/unravel-variance.i:56. [kernel:annot:missing-spec] tests/slicing/unravel-variance.i:56: Warning: Neither code nor specification for function printf5, generating default assigns from the prototype [eva] using specification for function printf5 [eva] Done for function printf5 [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 2 assertion(s) [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function scanf [from] Done for function scanf [from] Computing for function printf1 [from] Done for function printf1 [from] Computing for function printf2 [from] Done for function printf2 [from] Computing for function printf3 [from] Done for function printf3 [from] Computing for function printf4 [from] Done for function printf4 [from] Computing for function printf5 [from] Done for function printf5 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int scanf(char const *, int *p); int printf5(char const *, int); void main(void) { float x[1024]; float var1; float t1; float avg; float dev; int i; int n; t1 = (float)0; scanf("%d",& n); i = 0; while (i < n) { scanf("%f",(int *)(& x[i])); t1 += x[i]; i ++; } avg = t1 / (float)n; t1 = (float)0; i = 0; while (i < n) { dev = x[i] - avg; t1 += dev * dev; i ++; } var1 = t1 / (float)(n - 1); printf5("variance (two pass): %f \n",(int)var1); return; } [kernel] Parsing tests/slicing/result/ocode_4_unravel-variance.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unsupported.0.res.oracle0000666000000000000000000000237713571573400021770 0ustar [kernel] Parsing tests/slicing/unsupported.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] tests/slicing/unsupported.i:11: Warning: Dropping unsupported ACSL annotation [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int main(void) { int __retres; int t[10] = {0, 1, 2}; __retres = t[5] + t[2]; return __retres; } [kernel] Parsing tests/slicing/result/ocode_0_unsupported.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/unsupported.1.res.oracle0000666000000000000000000000132613571573400021762 0ustar [kernel] Parsing tests/slicing/unsupported.i (no preprocessing) [sparecode] remove unused code... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [pdg] computing for function main [pdg] done for function main [sparecode] tests/slicing/unsupported.i:11: Warning: Dropping annotation [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int main(void) { int __retres; int t[10] = {0, 1, 2}; /*@ */ __retres = t[5] + t[2]; return __retres; } frama-c-20.0-Calcium/tests/slicing/oracle/use_spec.0.res.oracle0000666000000000000000000000276613571573400021210 0ustar [kernel] Parsing tests/slicing/use_spec.i (no preprocessing) [kernel] tests/slicing/use_spec.i:18: Warning: Body of function f falls-through. Adding a return statement [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} t ∈ {0} G1 ∈ {0} G2 ∈ {0} [eva] computing for function f <- main. Called from tests/slicing/use_spec.i:25. [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int x; int f(void); int main(void) { f(); return x; } [kernel] Parsing tests/slicing/result/ocode_0_use_spec.i (no preprocessing) frama-c-20.0-Calcium/tests/slicing/oracle/use_spec.1.res.oracle0000666000000000000000000000630313571573400021200 0ustar [kernel] Parsing tests/slicing/use_spec.i (no preprocessing) [kernel] tests/slicing/use_spec.i:18: Warning: Body of function f falls-through. Adding a return statement [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} t ∈ {0} G1 ∈ {0} G2 ∈ {0} [eva] computing for function h <- main2. Called from tests/slicing/use_spec.i:38. [eva] using specification for function h [eva] Done for function h [eva] computing for function h <- main2. Called from tests/slicing/use_spec.i:40. [eva] Done for function h [eva:alarm] tests/slicing/use_spec.i:41: Warning: signed overflow. assert -2147483648 ≤ tmp + G2; [eva:alarm] tests/slicing/use_spec.i:41: Warning: signed overflow. assert tmp + G2 ≤ 2147483647; [eva] Recording results for main2 [eva] done for function main2 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main2 [from] Computing for function h [from] Done for function h [pdg] done for function main2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function h [pdg] done for function h [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} G2 ∈ {0} [eva] computing for function h_slice_2 <- main2. Called from tests/slicing/use_spec.i:38. [eva] using specification for function h_slice_2 [eva] Done for function h_slice_2 [eva] computing for function h_slice_1 <- main2. Called from tests/slicing/use_spec.i:40. [eva] using specification for function h_slice_1 [eva] Done for function h_slice_1 [eva:alarm] tests/slicing/use_spec.i:41: Warning: signed overflow. assert -2147483648 ≤ tmp + G2; [eva:alarm] tests/slicing/use_spec.i:41: Warning: signed overflow. assert tmp + G2 ≤ 2147483647; [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: G1 ∈ [--..--] G2 ∈ [--..--] tmp ∈ [--..--] __retres ∈ [--..--] /* Generated by Frama-C */ int G1; int G2; /*@ ensures G1 ≡ \old(a); assigns G1, G2; assigns G1 \from a; assigns G2 \from \nothing; */ void h_slice_2(int a); /*@ assigns G1, G2; assigns G1 \from \nothing; assigns G2 \from b; */ void h_slice_1(int b); int main2(int v1, int v4) { int __retres; h_slice_2(v1); int tmp = G1; h_slice_1(v4); /*@ assert Eva: signed_overflow: -2147483648 ≤ tmp + G2; */ /*@ assert Eva: signed_overflow: tmp + G2 ≤ 2147483647; */ __retres = tmp + G2; return __retres; } frama-c-20.0-Calcium/tests/slicing/oracle/variadic.0.res.oracle0000666000000000000000000000465513571573400021163 0ustar [kernel] Parsing tests/slicing/variadic.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/variadic.c:37. [eva] computing for function lib_f <- f1 <- main. Called from tests/pdg/variadic.c:23. [kernel:annot:missing-spec] tests/pdg/variadic.c:23: Warning: Neither code nor specification for function lib_f, generating default assigns from the prototype [eva] using specification for function lib_f [eva] Done for function lib_f [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:38. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/pdg/variadic.c:39. [eva] computing for function lib_f <- f3 <- main. Called from tests/pdg/variadic.c:31. [eva] Done for function lib_f [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:40. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f3 [from] Computing for function lib_f [from] Done for function lib_f [pdg] done for function f3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int lib_f(int n, void * const *__va_params); int f3_slice_1(void) { int tmp; { void *__va_args[3]; tmp = lib_f(3,(void * const *)(__va_args)); } return tmp; } frama-c-20.0-Calcium/tests/slicing/oracle/variadic.1.res.oracle0000666000000000000000000000455713571573400021165 0ustar [kernel] Parsing tests/slicing/variadic.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/variadic.c:37. [eva] computing for function lib_f <- f1 <- main. Called from tests/pdg/variadic.c:23. [kernel:annot:missing-spec] tests/pdg/variadic.c:23: Warning: Neither code nor specification for function lib_f, generating default assigns from the prototype [eva] using specification for function lib_f [eva] Done for function lib_f [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:38. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/pdg/variadic.c:39. [eva] computing for function lib_f <- f3 <- main. Called from tests/pdg/variadic.c:31. [eva] Done for function lib_f [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:40. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f3 [from] Computing for function lib_f [from] Done for function lib_f [pdg] done for function f3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int lib_f(int n , ...); int f3_slice_1(int a, int b, int c) { int tmp; tmp = lib_f(3,a,b,c); return tmp; } frama-c-20.0-Calcium/tests/slicing/oracle/variadic.2.res.oracle0000666000000000000000000000532213571573400021155 0ustar [kernel] Parsing tests/slicing/variadic.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/variadic.c:37. [eva] computing for function lib_f <- f1 <- main. Called from tests/pdg/variadic.c:23. [kernel:annot:missing-spec] tests/pdg/variadic.c:23: Warning: Neither code nor specification for function lib_f, generating default assigns from the prototype [eva] using specification for function lib_f [eva] Done for function lib_f [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:38. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/pdg/variadic.c:39. [eva] computing for function lib_f <- f3 <- main. Called from tests/pdg/variadic.c:31. [eva] Done for function lib_f [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:40. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f3 [from] Computing for function lib_f [from] Done for function lib_f [pdg] done for function f3 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int lib_f(int n, void * const *__va_params); int f3_slice_1(void) { int tmp; { void *__va_args[3]; tmp = lib_f(3,(void * const *)(__va_args)); } return tmp; } void main(void) { f3_slice_1(); return; } frama-c-20.0-Calcium/tests/slicing/oracle/variadic.3.res.oracle0000666000000000000000000000534513571573400021163 0ustar [kernel] Parsing tests/slicing/variadic.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/variadic.c:37. [eva] computing for function lib_f <- f1 <- main. Called from tests/pdg/variadic.c:23. [kernel:annot:missing-spec] tests/pdg/variadic.c:23: Warning: Neither code nor specification for function lib_f, generating default assigns from the prototype [eva] using specification for function lib_f [eva] Done for function lib_f [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:38. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/pdg/variadic.c:39. [eva] computing for function lib_f <- f3 <- main. Called from tests/pdg/variadic.c:31. [eva] Done for function lib_f [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:40. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f1 [from] Computing for function lib_f <-f1 [from] Done for function lib_f [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f2 [pdg] done for function f2 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int lib_f(int n, void * const *__va_params); int f2_slice_1(void) { int tmp; { void *__va_args[2]; tmp = lib_f(2,(void * const *)(__va_args)); } return tmp; } int main(void) { int s; s = f2_slice_1(); return s; } frama-c-20.0-Calcium/tests/slicing/oracle/variadic.4.res.oracle0000666000000000000000000000534513571573400021164 0ustar [kernel] Parsing tests/slicing/variadic.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/pdg/variadic.c:37. [eva] computing for function lib_f <- f1 <- main. Called from tests/pdg/variadic.c:23. [kernel:annot:missing-spec] tests/pdg/variadic.c:23: Warning: Neither code nor specification for function lib_f, generating default assigns from the prototype [eva] using specification for function lib_f [eva] Done for function lib_f [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:38. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/pdg/variadic.c:39. [eva] computing for function lib_f <- f3 <- main. Called from tests/pdg/variadic.c:31. [eva] Done for function lib_f [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f2 <- main. Called from tests/pdg/variadic.c:40. [eva] computing for function lib_f <- f2 <- main. Called from tests/pdg/variadic.c:27. [eva] Done for function lib_f [eva] Recording results for f2 [eva] Done for function f2 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f1 [from] Computing for function lib_f <-f1 [from] Done for function lib_f [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f2 [pdg] done for function f2 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int lib_f(int n, void * const *__va_params); int f2_slice_1(void) { int tmp; { void *__va_args[2]; tmp = lib_f(2,(void * const *)(__va_args)); } return tmp; } int main(void) { int s; s = f2_slice_1(); return s; } frama-c-20.0-Calcium/tests/slicing/ptr_fct.i0000666000000000000000000000105113571573400015615 0ustar /* run.config STDOPT: +"-main h -slice-return h -slicing-level 1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " */ int X ; typedef void (*PTF)(int); void f1(int x) { X = x ; } void f2 (int y) ; /* no source */ PTF ptf = 0 ; void g(int arg) { ptf = (arg > 0 ? &f1 : &f2) ; (*ptf)(arg) ; } PTF h (int a, int b) { if (b) { ptf = &g; (*ptf)(a); } return ptf; } frama-c-20.0-Calcium/tests/slicing/same_sliced_name_bts1422.i0000666000000000000000000000053213571573400020610 0ustar /* run.config STDOPT: +"-main foo -slice-value y -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " */ int y; void foo(int x); void foo(int x) { x++; y++; } void (*ptr)(int x) = &foo; frama-c-20.0-Calcium/tests/slicing/select_by_annot.i0000666000000000000000000001477013571573400017340 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -lib-entry -main main -journal-disable CMD: bin/toplevel.opt OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-assert main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma modifS -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma f1 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma f2 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma f3 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma f4 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma f5 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma f6 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma f7 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-loop-inv f8 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma f8 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-assert f8 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps OPT: @EVA_OPTIONS@ -check -deps -lib-entry -main main -slice-pragma f9 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check -no-deps */ struct Tstr { int a; int b; } S; int Sa ; int f1(int cond) { int * p = &S.a ; if (cond) { //@ assert (cond != 0); Sa = *p ; } //@slice pragma expr *p; return Sa ; } int f2(int cond) { int * p = &S.a ; if (cond) //@ assert (cond != 0); Sa = *p ; //@slice pragma expr S.a; return Sa ; } int f3(int cond) { int * p = &S.a ; if (cond) { //@ slice pragma ctrl; Sa = *p ; } return Sa ; } int f4(int cond) { int * p = &S.a ; if (cond) { //@ slice pragma stmt; Sa = *p ; } return Sa ; } int f5(int cond) { int * p = &S.a ; if (cond) { //@ slice pragma expr 1; Sa = *p ; } return Sa ; } int f6(int cond) { int * p = &S.a ; //@ slice pragma stmt; if (cond) { Sa = *p ; Sa ++ ; } return Sa ; } int f7(int cond) { int * p = &S.a ; if (cond) //@ slice pragma stmt; { Sa = *p ; Sa ++ ; } return Sa ; } int f8(int cond) { int * p = &S.a ; // /*@ loop invariant cond >= 0 ; loop variant cond ; */ while (cond) { //@ assert cond <= \at(cond,Pre) ; // assert S.a + cond == \at(S.a + cond,Pre) ; Sa = *p ; //@ slice pragma stmt; S.a ++ ; cond--; } return Sa ; } int X9, Y9, Z9 ; void f9(int c1, int c2) { if (c1 > c2) goto L; c1 = c2 ; //@ slice pragma stmt; {L: X9 = c1 ;} Y9 = Z9 ; Z9 = c2 ; } void modifS (int a, int b) { S.a += a; S.b -= b; //@slice pragma expr S.a; } int new_int (void); int d; int main (void) { int a = 0; int b = 0; int c = 0; if (d > 0) { //@ assert (b == 0); a = 1; } //@ slice pragma expr a+b; int x = a+b+c+d; modifS (a, b); // assert (d>0 => a == 1) && (!(d>0) => a==0); d = new_int (); f1(d) ; f2(d) ; f3(d) ; f4(d) ; f5(d) ; f6(d) ; f7(d) ; f8(d) ; f9(d,a) ; return x; } frama-c-20.0-Calcium/tests/slicing/select_by_annot.ml0000666000000000000000000000313313571573400017507 0ustar (* ledit bin/toplevel.top -deps tests/slicing/select_by_annot.c \ < tests/slicing/select_by_annot.ml *) open LibSelect;; let main _ = Slicing.Api.Project.reset_slicing (); let pretty_pdg fmt kf = !Db.Pdg.pretty fmt (!Db.Pdg.get kf) in let add_annot kf = let mark = Slicing.Api.Mark.make ~data:true ~addr:false ~ctrl:false in let select = Slicing.Api.Select.empty_selects in let select = Slicing.Api.Select.select_func_annots select mark ~spare:true ~threat:false ~user_assert:false ~slicing_pragma:true ~loop_inv:true ~loop_var:true kf in Slicing.Api.Request.add_persistent_selection select (*Slicing.Api.Request.read_annotations project kf_main ;;*) in let kf_main = Globals.Functions.find_def_by_name "main" in add_annot kf_main; Format.printf "@[%a@]@\n" pretty_pdg kf_main; let kf_modifS = Globals.Functions.find_def_by_name "modifS" in (*Slicing.ApiRequest.read_annotations project kf_modifS ;;*) add_annot kf_modifS; Format.printf "@[%a@]@\n" pretty_pdg kf_modifS; Slicing.Api.Request.pretty Format.std_formatter; Slicing.Api.Request.apply_all_internal (); Slicing.Api.Project.pretty Format.std_formatter; extract_and_print (); (** create another slice for "main" to check if it also contains the previous * selection. *) let ff = Slicing.Api.Slice.create kf_main in let select = LibSelect.select_data "b" kf_main in Slicing.Api.Request.add_slice_selection_internal ff select; Slicing.Api.Request.apply_all_internal (); Slicing.Api.Project.pretty Format.std_formatter; extract_and_print () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/select_calls.i0000666000000000000000000000210113571573400016606 0ustar /* run.config STDOPT: +"-lib-entry -main f -slice-calls send -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-lib-entry -main g -slice-calls nothing -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " */ void nothing (void); void send(int x); void crypt(int* x); void uncrypt(int* x); int c; int d; int f() { int x = 0; int y = 1; int z = x; send(y); /* faille averee */ send(z); crypt(&y); /* y devient public */ send(y); if (x) uncrypt(&y); /* code mort */ if (y) send(y); if (d) uncrypt(&y); send(y); /* faille potentielle */ crypt(&y); /* y devient public */ if (c) y = z; send(y); /* faille potentielle si dep. de contrôle */ return 0; } void g (void) { c = 1; nothing (); d = 3; } frama-c-20.0-Calcium/tests/slicing/select_return.i0000666000000000000000000001607013571573400017041 0ustar /* run.config STDOPT: +"-slice-calls send -lib-entry -main g -slicing-level 0 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send -lib-entry -main g -slicing-level 1 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send -lib-entry -main g -slicing-level 2 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send -lib-entry -main g -slicing-level 3 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 0 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 1 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 2 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 3 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-return f -lib-entry -main g -slicing-level 0 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-return f -lib-entry -main g -slicing-level 1 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-return f -lib-entry -main g -slicing-level 2 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-return f -lib-entry -main g -slicing-level 3 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-pragma f -lib-entry -main g -slicing-level 0 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-pragma f -lib-entry -main g -slicing-level 1 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-pragma f -lib-entry -main g -slicing-level 2 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-pragma f -lib-entry -main g -slicing-level 3 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-value H -lib-entry -main g -slicing-level 1 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-value H -lib-entry -main g -slicing-level 2 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " STDOPT: +"-slice-value H -lib-entry -main g -slicing-level 3 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " */ int G,H,I; int get (int y) ; void send(int x); void send_bis(int x); int k(int a, int b, int c, int d) { int cond = get (d) ; G = b; H = c; if (cond) send_bis (d); return a; } void g(int b, int c) { int r = k(0,0,c,0); f(b); } int f(int y) { k(0,0,0,0); int r = k(0,y,0,0); int z = k(G,0,0,0); //@ slice pragma expr z; send (z); return z; } frama-c-20.0-Calcium/tests/slicing/select_return_bis.i0000666000000000000000000000742313571573400017700 0ustar /* run.config STDOPT: +"-slice-calls send -lib-entry -main g -slicing-level 0 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send -lib-entry -main g -slicing-level 1 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send -lib-entry -main g -slicing-level 2 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send -lib-entry -main g -slicing-level 3 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 0 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 1 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 2 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 3 -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" STDOPT: +"-slice-calls send,send_bis -lib-entry -main g -slicing-level 3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" */ int G,H,I; int get (int y) ; void send(int x); void send_bis(int x); void k_bis(int ab, int c, int d) { H = c; if (ab) send_bis (d); } int k(int a, int b, int c, int d) { int cond = get (d) ; G = b; k_bis (cond, c, d); return a; } void g(int b, int c) { int r = k(0,0,c,0); f(b); } int f(int y) { k(0,0,0,0); int r = k(0,y,0,0); int z = k(G,0,0,0); //@ slice pragma expr z; send (z); return z; } frama-c-20.0-Calcium/tests/slicing/select_simple.i0000666000000000000000000000050113571573400017003 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -journal-disable */ /* dummy source file in order to test select_simple.ml */ #include "tests/slicing/simple_intra_slice.c" frama-c-20.0-Calcium/tests/slicing/select_simple.ml0000666000000000000000000000125413571573400017171 0ustar (* ledit bin/toplevel.top -deps tests/slicing/simple_intra_slice.c * *) include LibSelect ;; let main _ = ignore (test_select_data "f1" "G"); ignore (test_select_retres "f1"); Slicing.Api.set_modes ~calls:2 (); ignore (test_select_retres "f2"); ignore (test_select_data "f6" "n"); ignore (test_select_retres "f7"); ignore (test_select_data "f7" "S.a"); ignore (test_select_data "f7" "S.b"); ignore (test_select_data "f7" "S"); ignore (test_select_data "f7" "XXX"); ignore (test_select_data "f8" "ps->a"); ignore (test_select_data "f8" "ps->b"); ignore (test_select_data "f8" "ps->c"); ignore (test_select_data "f8" "*ps") let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/simple_intra_slice.i0000666000000000000000000000351513571573400020030 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -no-slice-callers -journal-disable */ int Unknown; int G; /* on sélectionne le return. on doit garder juste a (pas G et b) */ int f1 (int x, int y) { int a = 1, b = 2; G = x + a; return y + b; } /* on sélectionne le return. pas de réduction intreproc -> b doit être marqué Spare et recursivement a aussi. */ int f2 (void) { int a = 1, b = a+1, c = 3; return f1 (b, c); } /* avec un IF : sélection de la branche then */ int f3 (int c) { int a = 1, b = 2; int x = 0; if (c > Unknown) x = b; else G = a; return x; } /* avec un IF : sélection de la branche else */ int f4 (int c) { int a = 1, b = 2; int x = 0; if (c > Unknown) G = a; else x = b; return x; } int f5 (int c) { int x = 0; if (c > Unknown) goto Lsuite; x += 1; Lsuite : if (c < Unknown) goto L2; G++; L2 : x += 1; return x; } int f6 (int n) { int i = 0; while (n < 10) { if (Unknown > 3) { i = 1; break; } if (n%2) continue; n++; } if (i) return 0; else return 10*n; } typedef struct { int a; int b; int c; } Tstr; Tstr S, S1, S2; void f7 (Tstr s0) { int x = S.a; if (x > 0) { S.a += 3; } else { s0.a += 1; S = s0; } } void f8 (Tstr * ps) { ps->a ++; ps->b ++; } int main (void) { int res = 0; /* make Unknown really unknown */ volatile int uninit=0, uninit2=0 ; while(uninit) if (uninit-1) Unknown++; else Unknown--; while(uninit2) if (uninit2-1) S.a++; else S.a--; res += f2 (); res += f3 (1); res += f4 (1); res += f5 (1); res += f6 (Unknown); f7 (S); if (Unknown) f8 (&S1); else f8 (&S2); return res; } frama-c-20.0-Calcium/tests/slicing/simple_intra_slice.ml0000666000000000000000000000702113571573400020204 0ustar (* ledit bin/toplevel.top -deps tests/slicing/simple_intra_slice.c \ < tests/slicing/simple_intra_slice.ml *) include LibSelect;; let main _ = Slicing.Api.Project.reset_slicing (); let pretty_pdg fmt kf = !Db.Pdg.pretty fmt (!Db.Pdg.get kf) in let apply_all_actions = Slicing.Api.Request.apply_all_internal in let print_slice = Slicing.Api.Slice.pretty in let print_fct_stmts kf = Slicing.PrintSlice.print_fct_stmts fmt kf in let get_fct name = let kf = Globals.Functions.find_def_by_name name in kf in let select_stmt_and_print kf num_stmt = let stmt = get_stmt num_stmt in let mark = Slicing.Api.Mark.make ~data:true ~addr:true ~ctrl:true in let select = Slicing.Api.Select.select_stmt_internal kf stmt mark in let ff = Slicing.Api.Slice.create kf in Slicing.Api.Request.add_slice_selection_internal ff select; Slicing.Api.Request.pretty fmt; apply_all_actions (); print_slice fmt ff in let select_and_print kf select = let ff = Slicing.Api.Slice.create kf in Slicing.Api.Request.add_slice_selection_internal ff select; Slicing.Api.Request.pretty fmt ; apply_all_actions (); print_slice fmt ff in let select_out_data_and_print kf data = let select = select_data data kf in select_and_print kf select in let select_out0_and_print kf = let select = select_retres kf in select_and_print kf select in let select_ctrl_and_print kf numstmt = let select = select_ctrl numstmt kf in select_and_print kf select in let print_outputs fct_name = let fct = Globals.Functions.find_by_name fct_name in let outs = !Db.Outputs.get_external fct in Format.printf "Sorties de la fonction %s = %a\n" fct_name Locations.Zone.pretty outs in let kf = get_fct "f1" in Format.printf "@[%a@]@\n" pretty_pdg kf; print_fct_stmts kf; select_stmt_and_print kf 3; (* G=x+a; *) let kf = get_fct "f2" in Format.printf "@[%a@]@\n" pretty_pdg kf; print_fct_stmts kf; select_stmt_and_print kf 9; (* c=3; *) let kf = get_fct "f3" in Format.printf "@[%a@]@\n" pretty_pdg kf; print_fct_stmts kf; select_out0_and_print kf; let kf = get_fct "f4" in Format.printf "@[%a@]@\n" pretty_pdg kf; print_fct_stmts kf; select_out0_and_print kf; select_stmt_and_print kf 28; (* G=a; in then branch of if (c>Unknown) *) let kf = get_fct "f5" in print_outputs "f5"; select_out_data_and_print kf "G"; Format.printf "@[%a@]@\n" pretty_pdg kf; print_fct_stmts kf; select_out0_and_print kf; select_ctrl_and_print kf 40; (* G++. VP 2008-02-04: Was ki 113, and corresponded to if(c 0; */ int f(int a) { int b = 2 * a; /*@ assert a < b; */ return 42; } int main () { f(10); return 0; } frama-c-20.0-Calcium/tests/slicing/slice_no_body.i0000666000000000000000000000074713571573400016777 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -lib-entry -main h -journal-disable */ int G; int f (int a); int g (int c) { int x = c+1; int y = c*2; if (c == 0) return f (x); else return y; } int h (void) { int a = f (1); int b = f (2); int c = f (3); G = f (4); if (G > 0) G = g (c); return (int)g; } frama-c-20.0-Calcium/tests/slicing/slice_no_body.ml0000666000000000000000000000366613571573400017162 0ustar (* ledit bin/toplevel.top -deps tests/slicing/slice_no_body.c #use "tests/slicing/select.ml";; *) include LibSelect;; let callers kf = !Db.Value.callers kf (** simple implementation to select every calls to [kf] source function. * The problem of this implementation is that it can generate several slice * for one function during propagation to the callers. * See [Slicing.Api.Request.select_fun_calls] for a better implementation. * *) let call_f kf = let callers = callers kf in let process_caller (kf_caller,_) = let ff_caller = Slicing.Api.Slice.create kf_caller in Slicing.Api.Request.add_call_fun ~caller:ff_caller ~to_call:kf; prop_to_callers (kf_caller, ff_caller); in List.iter process_caller callers let slice_on_fun_calls kf = let table = Cil_datatype.Varinfo.Hashtbl.create 17 in let get_slice kf = let vf = Kernel_function.get_vi kf in try Cil_datatype.Varinfo.Hashtbl.find table vf with Not_found -> let ff = Slicing.Api.Slice.create kf in Cil_datatype.Varinfo.Hashtbl.add table vf ff; ff in let rec process_ff_caller ff (kf_caller,_) = let ff_caller = get_slice kf_caller in Slicing.Api.Request.add_call_slice ~caller:ff_caller ~to_call:ff; process_ff_callers (kf_caller, ff_caller) and process_ff_callers (kf, ff) = List.iter (process_ff_caller ff) (callers kf) in let process_src_caller kf_to_call (kf_caller,_) = let ff_caller = get_slice kf_caller in Slicing.Api.Request.add_call_fun ~caller:ff_caller ~to_call:kf_to_call; process_ff_callers (kf_caller, ff_caller) in List.iter (process_src_caller kf) (callers kf) let main _ = let kf_f = find_kf "f" in Slicing.Api.Project.reset_slicing (); call_f kf_f; print_project (); extract_and_print (); Slicing.Api.Project.reset_slicing (); slice_on_fun_calls kf_f; Slicing.Api.Request.apply_all_internal (); print_project (); extract_and_print () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/slice_pragma_stmt.i0000666000000000000000000002244213571573400017660 0ustar /* run.config STDOPT: +"-print -journal-disable" STDOPT: +"-main nop1 -slice-pragma nop1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main nop2 -slice-pragma nop2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main nop3 -slice-pragma nop3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main nop4 -slice-pragma nop4 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main nop5 -slice-pragma nop5 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main nop6 -slice-pragma nop6 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main nop7 -slice-pragma nop7 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main nop8 -slice-pragma nop8 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main double_effect1 -slice-pragma double_effect1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main double_effect2 -slice-pragma double_effect2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main double_effect3 -slice-pragma double_effect3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main double_effect4 -slice-pragma double_effect4 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main double_effect5 -slice-pragma double_effect5 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main test1 -slice-pragma test1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main test2 -slice-pragma test2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main test3 -slice-pragma test3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main test4 -slice-pragma test4 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main test5 -slice-pragma test5 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main test6 -slice-pragma test6 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main test7 -slice-pragma test7 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main test8 -slice-pragma test8 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-main test9 -slice-pragma test9 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " */ typedef int stmt, expr, slice; int x, y ; //------------------- void nop1(int c1, int c2) { //@ slice pragma stmt; // <----- slicing isn't correct since the effect... ; // <----- ...is missing with -print option x = 1 ; } void nop2(int c1, int c2) { //@ slice pragma stmt; // <----- slicing isn't correct since the effect... {;} // <----- ...is missing with -print option x = 1 ; } void nop3(int c1, int c2) { //@ slice pragma stmt; // <----- slicing isn't correct since the effect... {;{;;};} // <----- ...is missing with -print option x = 1 ; } void nop4(int c1, int c2) { //@ slice pragma stmt; if (c1) {;{;;};} x = 1 ; } void nop5(int c1, int c2) { if (c2) goto L ; //@ slice pragma stmt; // <----- slicing is correct, but not the output L:; x = 1 ; } void nop6(int c1, int c2) { //@ slice pragma stmt; // <----- slicing is correct, but not the output L:; x = 1 ; } void nop7(int c1, int c2) { //@ slice pragma stmt; // <----- slicing is correct, but not the output L:{;} x = 1 ; } void nop8(int c1, int c2) { //@ slice pragma stmt; // <----- slicing is correct, but not the output {L:{;}} x = 1 ; } //------------------- void double_effect1(int c1, int c2) { //@ slice pragma stmt; // <----- slicing isn't correct since the... x += y++ ; // <----- ...effect is lost with -print option } void double_effect2(int c1, int c2) { //@ slice pragma stmt; // <----- slicing isn't correct since the... { x += y++ ; } // <----- ...effect is lost with -print option } void double_effect3(int c1, int c2) { if (c2) goto L ; //@ slice pragma stmt; // <----- slicing isn't correct since the... L: x += y++ ; // <----- ...effect is lost with -print option } void double_effect4(int c1, int c2) { if (c2) goto L ; //@ slice pragma stmt; // <----- slicing isn't correct since the... L: {x += y++ ; } // <----- ...effect is lost with -print option } void double_effect5(int c1, int c2) { if (c2) //@ slice pragma stmt; {x += y++ ; } } //------------------- void test1(int c1, int c2) { if (c1 < c2) c1 = c2 ; //@ slice pragma stmt; x = c1 ; } void test2(int c1, int c2) { if (c1 < c2) c1 = c2 ; //@ slice pragma stmt; x = c1 ; y = c2 ; } void test3(int c1, int c2) { if (c1 < c2) c1 = c2 ; //@ slice pragma stmt; {x = c1 ;} y = c2 ; } void test4(int c1, int c2) { if (c1 < c2) c1 = c2 ; //@ slice pragma stmt; // <----- slicing isn't correct since the... {x = c1 ; c2 ++ ;} // <----- ...effect is lost with -print option y = c2 ; } void test5(int c1, int c2) { if (c1 < c2) goto L; c1 = c2 ; //@ slice pragma stmt; // <----- slicing isn't correct since the... L: x = c1 ; // <----- ...effect is lost with -print option y = c2 ; } void test6(int c1, int c2) { if (c1 < c2) goto L; c1 = c2 ; //@ slice pragma stmt; // <----- slicing isn't correct since the... L: x = c1++ ; // <----- ...effect is lost with -print option y = c2 ; } void test7(int c1, int c2) { if (c1 < c2) goto L; c1 = c2 ; //@ slice pragma stmt; // <----- slicing isn't correct since the... L: {x = c1++ ; c2 ++ ;} // <----- ...effect is lost with -print option y = c2 ; } void test8(int c1, int c2) { if (c1 < c2) goto L; c1 = c2 ; //@ slice pragma stmt; // <----- slicing isn't correct since the... { L: x = c1++ ; c2 ++ ;} // <----- ...effect is lost with -print option y = c2 ; } void test9(int c1, int c2) { if (c1 < c2) goto L; c1 = c2 ; //@ slice pragma stmt; // <----- slicing isn't correct since the... { x = c1 ; L: c2 = c2 + 1 ;} // <----- ...effect is lost with -print option y = c2 ; } frama-c-20.0-Calcium/tests/slicing/switch.i0000666000000000000000000000064413571573400015464 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs CMD: @frama-c@ -load-module tests/slicing/libSelect.cmxs -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: @EVA_OPTIONS@ -deps -journal-disable */ int main (char choix) { int x = 0, y = 0, z = 0; switch (choix) { case 'a' : x = 1; break; case 'b' : x = 2; y = 1; break; case 'c' : case 'd' : y = 2; break; } z++; return x; } frama-c-20.0-Calcium/tests/slicing/switch.ml0000666000000000000000000000033213571573400015636 0ustar (* ledit bin/toplevel.top -deps tests/slicing/switch.c * *) include LibSelect ;; let main _ = test_select_data "main" "x"; test_select_data "main" "y"; test_select_data "main" "z" let () = Db.Main.extend main frama-c-20.0-Calcium/tests/slicing/test_config0000666000000000000000000000013413571573400016232 0ustar EXECNOW: make -s tests/slicing/libSelect.cmxs tests/slicing/libAnim.cmxs OPT: @EVA_OPTIONS@ frama-c-20.0-Calcium/tests/slicing/tests.ex_spec_interproc.sh0000777000000000000000000000006413571573400021220 0ustar #!/bin/sh `dirname $0`/tests.sh ex_spec_interproc frama-c-20.0-Calcium/tests/slicing/tests.horwitz.sh0000777000000000000000000000005213571573400017210 0ustar #!/bin/sh `dirname $0`/tests.sh horwitz frama-c-20.0-Calcium/tests/slicing/tests.select_by_annot.sh0000777000000000000000000000006113571573400020652 0ustar #!/bin/sh `dirname $0`/tests.sh select_by_annot frama-c-20.0-Calcium/tests/slicing/tests.select_simple.sh0000777000000000000000000000005713571573400020337 0ustar #!/bin/sh `dirname $0`/tests.sh select_simple frama-c-20.0-Calcium/tests/slicing/tests.sh0000777000000000000000000000045213571573400015507 0ustar #!/bin/sh BASE=$1 EXE_FILE=tests/slicing/$BASE.byte RES_FILE=tests/slicing/result/$BASE.res.log ERR_FILE=tests/slicing/result/$BASE.err.log make -s $EXE_FILE CMD="$EXE_FILE -deps tests/slicing/$BASE.c" echo "$CMD" #echo "RES = $RES_FILE" #echo "ERR = $ERR_FILE" $CMD > $RES_FILE 2> $ERR_FILE frama-c-20.0-Calcium/tests/slicing/tests.simple_intra_slice.sh0000777000000000000000000000006413571573400021352 0ustar #!/bin/sh `dirname $0`/tests.sh simple_intra_slice frama-c-20.0-Calcium/tests/slicing/top.i0000666000000000000000000000221113571573400014755 0ustar /* run.config * STDOPT: +"-eva-no-builtins-auto -check -slicing-level 0 -slice-return uncalled -no-slice-callers -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" * STDOPT: +"-eva-no-builtins-auto -check -slicing-level 2 -slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" * STDOPT: +"-eva-no-builtins-auto -check -slicing-level 2 -slice-return strlen -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check" * * * * * * */ int uncalled (int x) { return x+1; } int strlen(char* p ) { char* q ; int k = 0; for (q = p; *q ; q++) k++ ; return k; } int main (char *p_str[], int i ) { return strlen (p_str[i]); } frama-c-20.0-Calcium/tests/slicing/top2.i0000666000000000000000000000144113571573400015043 0ustar /* run.config * STDOPT: +"-slicing-level 2 -slice-pragma main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " * STDOPT: +"-slicing-level 2 -slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -check -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -check " */ int tab[2]={0, 7 }; int G, X ; typedef struct {int a; int b; } Ts; Ts S; int f(void) { volatile int i=0; int v; v = tab[i]; G = X; return v; } int main(void) { int x = f(); G += 1 ; //@ slice pragma expr G ; return x; } frama-c-20.0-Calcium/tests/slicing/undef-fun.i0000666000000000000000000000070013571573400016043 0ustar /* run.config STDOPT: +"-slice-undef-functions -slice-return f -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " */ int G; /*@ assigns \result \from a; assigns G \from b; */ int f (int a, int b); int main (int x, int y) { x += 1; y += 2; x = f (x, y); return x; } frama-c-20.0-Calcium/tests/slicing/unitialized.c0000666000000000000000000000300513571573400016470 0ustar /* run.config STDOPT: +"-slice-pragma g -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-assert g -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-assert main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-return g -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " */ #ifdef __FRAMAC__ //@ assigns \result \from \nothing; int printf(const char*, int y); #endif int X1, X2 ; void f1() { int x1; x1 = 123; X1 = x1 ; } void f2() { int x2; x2 = 12345; X2 = x2 ; } int g() { int y ; /* Note: y is not initialised by g. */ /* Note: GCC without optimization gives X1 == y. */ printf ("%d\n", y); //@slice pragma expr y ; //@assert X1 == y ; return y; } int main() { int r; f1(); f2(); r = g(); /* Note: GCC without optimization gives X2 != y. */ //@assert X2 != r ; return 0; } frama-c-20.0-Calcium/tests/slicing/unravel-flavors.i0000666000000000000000000000431413571573400017307 0ustar /* run.config STDOPT: +"-slice-undef-functions -slice-return send1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-undef-functions -slice-return send2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-undef-functions -slice-return send3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-undef-functions -slice-return send4 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " */ /* Small example derived from examples given for UNRAVEL tool : */ /* Slicing and Dicing example */ /* Notice that scanf result is from TOP : have to use -slice-undef-functions * if we don't want to propagate this imprecision... */ /*@ assigns *p \from \empty; assigns \result ; */ int scanf (char const *, int * p); int printf (char const *, int); int send1 (int x) { printf ("%d\n", x) ; return x; } int send2 (int x) { printf ("%d\n", x) ; return x; } int send3 (int x) { printf ("%d\n", x) ; return x; } int send4 (int x) { printf ("%d\n", x) ; return x; } int nb_fetch = 0; int fetch(void) { int value; nb_fetch++; scanf ("%d",&value); return value; } int main(void) { int red, green, blue, yellow; int sweet,sour,salty,bitter; int i; red = fetch(); blue = fetch(); green = fetch(); yellow = fetch(); red = 2*red; sweet = red*green; sour = 0; for (i = 0; i < red; i++) sour += green; salty = blue + yellow; green = green + 1; bitter = yellow + green; send1 (sweet); send2 (sour); send3 (salty); send4 (bitter); return 1; } frama-c-20.0-Calcium/tests/slicing/unravel-point.i0000666000000000000000000000445613571573400016773 0ustar /* run.config STDOPT: +"-calldeps -slice-return send1 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-calldeps -slice-return send2 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-calldeps -slice-return send3 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-calldeps -slice-return send4 -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" STDOPT: +"-calldeps -slice-return send1 -slice-return send4 -journal-disable -then-on 'Slicing export' @EVA_OPTIONS@ -calldeps -slice-return send1_slice_1 -print -then-on 'Slicing export 2' -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -no-calldeps" */ /* Small example devired from examples given for UNRAVEL tool : */ /*@ assigns *p \from \empty; assigns \result ; */ int scanf (char const *, int * p); int printf (char const *, int); int send1 (int x) { printf ("%d\n", x) ; return x; } int send2 (int x) { printf ("%d\n", x) ; return x; } int send3 (int x) { printf ("%d\n", x) ; return x; } int send4 (int x) { printf ("%d\n", x) ; return x; } int main() { int input1,input2,input3,cond1,cond2; int a,b,c; int *x,*y,*z; int output1,output2,output3; scanf("%d",&input1); a = input1; scanf("%d",&input2); b = input2; scanf("%d",&input3); c = input3; scanf("%d",&cond1); scanf("%d",&cond2); x = &a; if (cond1) x = &b; y = &c; z = &b; output2 = *z + 1; *z = *y + *x; output1 = *z; output3 = *x; send1 (output1); send2 (output2); send3 (output3); send4 (cond2); return 0; } frama-c-20.0-Calcium/tests/slicing/unravel-variance.i0000666000000000000000000000561213571573400017425 0ustar /* run.config STDOPT: +"-slice-calls printf1 -journal-disable -float-normal -remove-redundant-alarms -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-calls printf2 -journal-disable -float-normal -remove-redundant-alarms -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-calls printf3 -journal-disable -float-normal -remove-redundant-alarms -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-calls printf4 -journal-disable -float-normal -remove-redundant-alarms -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-slice-calls printf5 -journal-disable -float-normal -remove-redundant-alarms -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " */ /* Small example devired from examples given for UNRAVEL tool : */ int scanf (char const *, int * p); int printf1 (char const *, int); int printf2 (char const *, int); int printf3 (char const *, int); int printf4 (char const *, int); int printf5 (char const *, int); int main() { float x[1024]; float var2, var3, var4 ; float var5, var1; float t1, t2; float ssq; float avg; float dev; int i, n; t2 = 0 ; t1 = 0 ; ssq = 0 ; dev = 0; scanf ("%d", &n); for ( i = 0 ; i < n ; i = i + 1) { scanf ("%f", (int*)&x[i]); t1 = t1 + x[i]; ssq = ssq + x[i] * x[i]; } avg = t1 / n; var3 = (ssq - n * avg * avg) / (n - 1); var4 = (ssq - t1 * avg) / (n - 1); t1 = t1 * t1 / n; var2 = (ssq - t1 ) / (n - 1); t1 = 0 ; for ( i = 0 ; i < n ; i = i + 1) { dev = x[i] - avg ; t2 = t2 + dev ; t1 = t1 + dev * dev ; } var5 = (t1 - t2 * t2 / n ) / (n -1); var1 = t1 / (n - 1); printf1("variance (one pass, using square of sum): %f \n",var2); printf2("variance (one pass, using average): %f \n",var3); printf3("variance (one pass, using average, sum): %f \n",var4); printf4("variance (two pass, corrected): %f \n",var5); printf5("variance (two pass): %f \n",var1); return 0; } frama-c-20.0-Calcium/tests/slicing/unsupported.i0000666000000000000000000000071213571573400016547 0ustar /* run.config STDOPT: +"-slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i " STDOPT: +"-sparecode" */ int main() { int t[10] = {0, 1, 2}; /*@ requires \valid(t + (0 .. 10 - 1)); ensures ∀ ℤ i; 0 ≤ i < \old(10) ⇒ *(t + i) ≡ 0; */ return t[5]+t[2]; } frama-c-20.0-Calcium/tests/slicing/use_spec.i0000666000000000000000000000231513571573400015766 0ustar /* run.config STDOPT: +" -eva-use-spec f -slice-return main -journal-disable -then-on 'Slicing export' -set-project-as-default -print -then -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.i" STDOPT: +"-main main2 -slicing-level 3 -slice-undef-functions -eva-use-spec h -slice-return main2 -journal-disable -slicing-keep-annotations -then-on 'Slicing export' -set-project-as-default -print -eva @EVA_OPTIONS@ -eva-use-spec='-@all'" */ int x, y, z, t; int G1, G2; //@ assigns x \from \nothing; void g(void); //@ assigns x \from \nothing; int f() { x = 1; g(); } /* When -eva-use-spec f is used, the body of f must not be kept (as it references the body of g, which is not kept since the body of f is not analyzed. */ int main() { f(); return x; } //@ assigns G1 \from a; assigns G2 \from b; ensures G1 == a; void h(int a, int b) { G1 = a; G2 = b; } /* Check that function specialization works well with -eva-use-spec. The result of -slicing-keep-annotations is a bit surprising, but in fact quite good. */ int main2(int v1, int v2, int v3, int v4) { h(v1, v2); int tmp = G1; h(v3, v4); return tmp + G2; } frama-c-20.0-Calcium/tests/slicing/variadic.c0000666000000000000000000000101513571573400015730 0ustar /* run.config STDOPT: +"-slice-return f3 -no-slice-callers -journal-disable -then-on 'Slicing export' -print" STDOPT: +"-slice-return f3 -no-slice-callers -journal-disable -variadic-no-translation -then-last -print" STDOPT: +"-slice-return f3 -journal-disable -then-on 'Slicing export' -print" STDOPT: +"-slice-return main -journal-disable -then-on 'Slicing export' -print" STDOPT: +"-slice-return main -slicing-level 3 -journal-disable -then-on 'Slicing export' -print" */ #include "../pdg/variadic.c" frama-c-20.0-Calcium/tests/sparecode/0000777000000000000000000000000013571573400014322 5ustar frama-c-20.0-Calcium/tests/sparecode/bts324.i0000666000000000000000000000116313571573400015516 0ustar /* run.config STDOPT: +"-sparecode-analysis" STDOPT: +"-sparecode-analysis -main main_bis" STDOPT: +"-sparecode-analysis -main main_ter" */ int i0, o0; /*@ assigns i0, o0 ; */ void loop_body (void) ; /*@ assigns *p_res; */ void init (int * p_res) ; int is_ko = -1; void main () { init (&is_ko); if (is_ko) while (1) loop_body () ; } void main_bis (void) { init (&is_ko); if (is_ko) while (1) { loop_body () ; /*@ slice pragma expr o0 ;*/ } } void main_ter () { init (&is_ko); if (is_ko) while (1) { /*@ slice pragma stmt ;*/ loop_body () ; } } frama-c-20.0-Calcium/tests/sparecode/bts324_bis.i0000666000000000000000000000175613571573400016363 0ustar /* run.config STDOPT: +"-sparecode-analysis" STDOPT: +"-sparecode-analysis -main main_bis" STDOPT: +"-sparecode-analysis -sparecode-no-annot" */ int ki[2], k ; int f (int vi, int i) { static int si[2] = 0, so[2] = 0; int vo = so[i]/k + ki[i]*(vi - si[i]) ; so[i] = vo ; si[i] = vi ; return vo ; } int volatile e0,e1; int s0, s1 ; void loop_body (void) { int acq0 = e0 ; int acq1 = e1; int val0 = f (acq0, 0) ; int val1 = f (acq1, 1) ; s0 = val0 ; s1 = val1 ; } int is_ok ; void init (int *pres) { ki[0] = 2 ; ki[1] = 4 ; k = 8 ; *pres = 1 ; } void main (int c) { init (& is_ok); if (is_ok) while (1) { loop_body () ; // note: sparecode conserve les pragmas de slicing et par conséquent ce // qui calcule "s0", l'option -sparecode-no-annot ni change rien //@ impact pragma expr s0; //@ slice pragma expr s1; } } void main_bis (int c) { init (& is_ok); if (is_ok) while (1) { loop_body () ; } } frama-c-20.0-Calcium/tests/sparecode/bts334.i0000666000000000000000000000224613571573400015522 0ustar /*run.config STDOPT: +"-sparecode-debug 0 -main main_init -sparecode-analysis -sparecode-no-annot " STDOPT: +"-sparecode-debug 0 -main main_init -slice-pragma loop_body -then-on 'Slicing export' -print" STDOPT: +"-sparecode-debug 0 -main main_init -slice-pragma loop_body -calldeps -then-on 'Slicing export' -print" */ int kf ; int k[2] ; int f(int vi , int i ) ; static int si[2] = {0, 0}; static int so[2] = {0, 0}; int f(int vi , int i ) { int vo ; {vo = so[i] / kf + k[i] * (vi - si[i]); so[i] = vo; si[i] = vi; return (vo);} } int volatile e0 ; int volatile e1 ; int s0 ; int s1 ; void loop_body(void) { int acq0 ; int acq1 ; int val0 ; int val1 ; {/*@ slice pragma expr s0; */ ; ; acq0 = (int )e0; acq1 = (int )e1; val0 = f(acq0, 0); val1 = f(acq1, 1); s0 = val0; s1 = val1; return;} } int kf ; int k[2] ; void process(int conf ) { {kf = conf; k[0] = 3; k[1] = 14; while (1) {loop_body();} return;} } /*@ behavior default: assigns *p \from \nothing; */ extern int init(int *p ) ; void main_init(void) { int is_ok ; int config ; {config = init(& is_ok); if (is_ok) {process(config);} return;} } frama-c-20.0-Calcium/tests/sparecode/bts927.i0000666000000000000000000000076113571573400015532 0ustar /* run.config STDOPT: +"-sparecode-debug 0 -no-warn-signed-overflow -sparecode" STDOPT: +"-sparecode-debug 0 -warn-signed-overflow -sparecode" */ /* The purpose of these tests is to check if the conditions are removed * when the branch is statically known. */ int f (int a) { int c = a+1; return (c > 0) ? 1 : 0; } int main (int x) { //@ assert x>5; if (x > 5) { int y = f(x); if (y < 2) // always true return f(x); else return -1; } else { return 4; } } frama-c-20.0-Calcium/tests/sparecode/calls.i0000666000000000000000000000065713571573400015602 0ustar /* run.config STDOPT: +"-sparecode-analysis" STDOPT: +"-slicing-level 2 -slice-return main -then-on 'Slicing export' -print" */ int G; int f (int x, int y) { G = y; return x; } int main (void) { int a = 1; int b = 1; f (0, 0); /* this call is useless : should be removed */ a = f (a, b); /* the result of this call is useless */ a = f (G + 1, b); G = 0; /* don't use the G computed by f */ return a; } frama-c-20.0-Calcium/tests/sparecode/dead_code.i0000666000000000000000000000033513571573400016364 0ustar /* run.config STDOPT: +"-sparecode" STDOPT: +"-slicing-level 2 -slice-return main -then-on 'Slicing export' -print" */ int main (void) { int c = 1, x; x = 0; if (c) x = 1; else x = 2; return x; } frama-c-20.0-Calcium/tests/sparecode/glob_decls.i0000666000000000000000000000157013571573400016574 0ustar /* run.config STDOPT: +"-lib-entry -sparecode-analysis " STDOPT: +"-lib-entry -slice-pragma main -slice-return main -then-on 'Slicing export' -print" STDOPT: +"-sparecode-rm-unused-globals" */ // can be removed int G1, G2; int * PG1 = &G1; // can be removed typedef struct { int a; } Ts; Ts Gts; typedef Ts * Ps; Ps GPs; // Cannot be removed : used in spec typedef struct { int a; int b; } Ts2; Ts2 S2; typedef char Ts2bis; Ts2bis C = 'a'; // Can be removed : used in an unused function typedef struct { int a; int b; int c; } Ts3; Ts3 S3; int f (void) { return S3.a + S3.b + S3.c; } typedef int Int; typedef Int Tx; char Size; Tx X = sizeof (Size); int Y; int use_in_PX_init; int * PX; /*@ requires S2.a > S2.b ; */ int main (int x, Ts s) { //@ slice pragma expr S2 ; int y = 3; y += Y; y += *PX; //@ assert X > 0; return X + x; } int * PX = &use_in_PX_init; frama-c-20.0-Calcium/tests/sparecode/intra.i0000666000000000000000000000510513571573400015612 0ustar /* run.config STDOPT: +"-sparecode-analysis" STDOPT: +"-sparecode-debug 0 -slicing-level 2 -slice-return main -then-last -print" STDOPT: +"-sparecode-debug 0 -main main2 -sparecode-analysis" STDOPT: +"-sparecode-debug 0 -main main2 -slice-return main2 -then-last -print" STDOPT: +"-sparecode-debug 0 -main main2 -slice-return main2 -slice-assert f10 -then-last -print" */ /* Waiting for results such as: * spare code analysis removes statements having variables with * prefix "spare_" * * slicing analysis removes statement having variables with * prefix "spare_" and "any_" */ int G; int tmp (int a) { int x = a; //@ assert x == a ; int w = 1; //@ assert w == 1 ; // w is not spare or else // the assertion should be removed ! int spare_z = 1; int spare_y = a+spare_z; return x; } int param (int a, int spare_b) { return a; } int spare_called_fct (int a) { return a; } int two_outputs (int a, int b) { G += b; return a; } int call_two_outputs (void) { int x, spare_y; int any_b = 1; int any_a = 2; int a = 1; int b = any_b; x = two_outputs (a, b); G = 1; /* don't use b = any_b; */ b = 2; a = any_a; spare_y = two_outputs (a, b); /* don't use spare_y so don't use a = any_a */ return x; } void assign (int *p, int *q) { *p = *q ; } int loop (int x, int y, int z) { int i = 0; //@ assert i < z ; //@ loop invariant i < y ; /* should keep y in sparecode analysis even if it is not used in the function */ while (i < x) { i ++; } return i; } void stop(void) __attribute__ ((noreturn)) ; int main (int noreturn, int halt) { int res = 0; int spare_tmp = 3; int spare_param = 2 + spare_tmp; int spare_ref = 3; int x = 1; int y = 2; res += param (2, spare_param); res += tmp (4); spare_called_fct (5); res += call_two_outputs (); res += loop (10, 15, 20); assign (&x, &spare_ref) ; /* <- Here, best can be done for spare analysis */ assign (&x, &y) ; if (noreturn) { if (halt) stop () ; else while (1); //@ assert \false ; // What should be done with // assertions related to dead code? } return res + G + x; } /*-------------------------------------*/ struct { struct { int x; int y; } a; int b; } X10; int Y10; int f10 (int x) { //@ slice pragma expr X10; //@ slice pragma expr X10.a; //@ slice pragma expr X10.a.x; //@ slice pragma expr Y10; //@ assert X10.a.x >= 0; return x; } int main2 () { Y10 = 0; X10.b = 0; X10.a.y += f10 (3); return X10.a.x + X10.a.y; } /*-------------------------------------*/ frama-c-20.0-Calcium/tests/sparecode/issue_157.i0000666000000000000000000000024313571573400016217 0ustar /* run.config STDOPT: +"-sparecode-analysis" */ int f() { return 0; } int X; void g() { f(); } int main(void) { int x; g(); x = f(); return x; } frama-c-20.0-Calcium/tests/sparecode/oracle/0000777000000000000000000000000013571573400015567 5ustar frama-c-20.0-Calcium/tests/sparecode/oracle/bts324.0.res.oracle0000666000000000000000000000502413571573400020726 0ustar [kernel] Parsing tests/sparecode/bts324.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main outputs and entry point [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i0 ∈ {0} o0 ∈ {0} is_ko ∈ {-1} [eva] computing for function init <- main. Called from tests/sparecode/bts324.i:19. [eva] using specification for function init [eva] tests/sparecode/bts324.i:14: Warning: no \from part for clause 'assigns *p_res;' [eva] Done for function init [eva] computing for function loop_body <- main. Called from tests/sparecode/bts324.i:22. [eva] using specification for function loop_body [eva] tests/sparecode/bts324.i:11: Warning: no \from part for clause 'assigns i0, o0;' [eva] Done for function loop_body [eva] tests/sparecode/bts324.i:21: starting to merge loop iterations [eva] computing for function loop_body <- main. Called from tests/sparecode/bts324.i:22. [eva] Done for function loop_body [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function init [from] Done for function init [from] Computing for function loop_body [from] Done for function loop_body [pdg] done for function main [sparecode] add selection in function 'main' [sparecode] selecting output zones i0; o0; is_ko [sparecode] add selection in function 'main' [pdg] computing for function init [pdg] done for function init [sparecode] look for annotations in function init [sparecode] look for annotations in function loop_body [pdg] computing for function loop_body [pdg] done for function loop_body [sparecode] look for annotations in function main [sparecode] look for annotations in function main_bis [pdg] computing for function main_bis [pdg] Warning: unreachable entry point (sid:9, function main_bis) [pdg] Bottom for function main_bis [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function main_ter [pdg] computing for function main_ter [pdg] Warning: unreachable entry point (sid:19, function main_ter) [pdg] Bottom for function main_ter [sparecode] pdg bottom: skip annotations [sparecode] finalize call input propagation [sparecode] add selection in function 'main' [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ /*@ assigns *p_res; */ void init(int *p_res); int is_ko = -1; void main(void) { init(& is_ko); return; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts324.1.res.oracle0000666000000000000000000000550013571573400020726 0ustar [kernel] Parsing tests/sparecode/bts324.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main_bis outputs and entry point [eva] Analyzing a complete application starting at main_bis [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i0 ∈ {0} o0 ∈ {0} is_ko ∈ {-1} [eva] computing for function init <- main_bis. Called from tests/sparecode/bts324.i:26. [eva] using specification for function init [eva] tests/sparecode/bts324.i:14: Warning: no \from part for clause 'assigns *p_res;' [eva] Done for function init [eva] computing for function loop_body <- main_bis. Called from tests/sparecode/bts324.i:29. [eva] using specification for function loop_body [eva] tests/sparecode/bts324.i:11: Warning: no \from part for clause 'assigns i0, o0;' [eva] Done for function loop_body [eva] tests/sparecode/bts324.i:28: starting to merge loop iterations [eva] computing for function loop_body <- main_bis. Called from tests/sparecode/bts324.i:29. [eva] Done for function loop_body [eva] Recording results for main_bis [eva] done for function main_bis [pdg] computing for function main_bis [from] Computing for function init [from] Done for function init [from] Computing for function loop_body [from] Done for function loop_body [pdg] done for function main_bis [sparecode] add selection in function 'main_bis' [sparecode] selecting output zones i0; o0; is_ko [sparecode] add selection in function 'main_bis' [pdg] computing for function init [pdg] done for function init [sparecode] look for annotations in function init [sparecode] look for annotations in function loop_body [pdg] computing for function loop_body [pdg] done for function loop_body [sparecode] look for annotations in function main [pdg] computing for function main [pdg] Warning: unreachable entry point (sid:1, function main) [pdg] Bottom for function main [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function main_bis [sparecode] selecting annotation : slice pragma expr o0; [sparecode] add selection in function 'main_bis' [sparecode] look for annotations in function main_ter [pdg] computing for function main_ter [pdg] Warning: unreachable entry point (sid:19, function main_ter) [pdg] Bottom for function main_ter [sparecode] pdg bottom: skip annotations [sparecode] finalize call input propagation [sparecode] add selection in function 'main_bis' [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int i0; int o0; /*@ assigns i0, o0; */ void loop_body(void); /*@ assigns *p_res; */ void init(int *p_res); int is_ko = -1; void main_bis(void) { init(& is_ko); if (is_ko) while (1) { loop_body(); /*@ slice pragma expr o0; */ ; } return; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts324.2.res.oracle0000666000000000000000000000546013571573400020734 0ustar [kernel] Parsing tests/sparecode/bts324.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main_ter outputs and entry point [eva] Analyzing a complete application starting at main_ter [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i0 ∈ {0} o0 ∈ {0} is_ko ∈ {-1} [eva] computing for function init <- main_ter. Called from tests/sparecode/bts324.i:35. [eva] using specification for function init [eva] tests/sparecode/bts324.i:14: Warning: no \from part for clause 'assigns *p_res;' [eva] Done for function init [eva] computing for function loop_body <- main_ter. Called from tests/sparecode/bts324.i:39. [eva] using specification for function loop_body [eva] tests/sparecode/bts324.i:11: Warning: no \from part for clause 'assigns i0, o0;' [eva] Done for function loop_body [eva] tests/sparecode/bts324.i:37: starting to merge loop iterations [eva] computing for function loop_body <- main_ter. Called from tests/sparecode/bts324.i:39. [eva] Done for function loop_body [eva] Recording results for main_ter [eva] done for function main_ter [pdg] computing for function main_ter [from] Computing for function init [from] Done for function init [from] Computing for function loop_body [from] Done for function loop_body [pdg] done for function main_ter [sparecode] add selection in function 'main_ter' [sparecode] selecting output zones i0; o0; is_ko [sparecode] add selection in function 'main_ter' [pdg] computing for function init [pdg] done for function init [sparecode] look for annotations in function init [sparecode] look for annotations in function loop_body [pdg] computing for function loop_body [pdg] done for function loop_body [sparecode] look for annotations in function main [pdg] computing for function main [pdg] Warning: unreachable entry point (sid:1, function main) [pdg] Bottom for function main [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function main_bis [pdg] computing for function main_bis [pdg] Warning: unreachable entry point (sid:9, function main_bis) [pdg] Bottom for function main_bis [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function main_ter [sparecode] selecting annotation : slice pragma stmt; [sparecode] add selection in function 'main_ter' [sparecode] finalize call input propagation [sparecode] add selection in function 'main_ter' [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int i0; int o0; /*@ assigns i0, o0; */ void loop_body(void); /*@ assigns *p_res; */ void init(int *p_res); int is_ko = -1; void main_ter(void) { init(& is_ko); if (is_ko) while (1) /*@ slice pragma stmt; */ loop_body(); return; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts324_bis.0.res.oracle0000666000000000000000000001207113571573400021563 0ustar [kernel] Parsing tests/sparecode/bts324_bis.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main outputs and entry point [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization ki[0..1] ∈ {0} k ∈ {0} e0 ∈ [--..--] e1 ∈ [--..--] s0 ∈ {0} s1 ∈ {0} is_ok ∈ {0} f_si[0..1] ∈ {0} f_so[0..1] ∈ {0} [eva] computing for function init <- main. Called from tests/sparecode/bts324_bis.i:37. [eva] Recording results for init [eva] Done for function init [eva] computing for function loop_body <- main. Called from tests/sparecode/bts324_bis.i:40. [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:22. [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert -2147483648 ≤ ki[i] * (int)(vi - f_si[i]); [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert ki[i] * (int)(vi - f_si[i]) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:23. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] tests/sparecode/bts324_bis.i:39: starting to merge loop iterations [eva] computing for function loop_body <- main. Called from tests/sparecode/bts324_bis.i:40. [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:22. [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert -2147483648 ≤ vi - f_si[i]; [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert vi - f_si[i] ≤ 2147483647; [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert -2147483648 ≤ (int)(f_so[i] / k) + (int)(ki[i] * (int)(vi - f_si[i])); [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert (int)(f_so[i] / k) + (int)(ki[i] * (int)(vi - f_si[i])) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:23. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] computing for function loop_body <- main. Called from tests/sparecode/bts324_bis.i:40. [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:22. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:23. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function init [from] Done for function init [from] Computing for function loop_body [from] Computing for function f <-loop_body [from] Done for function f [from] Done for function loop_body [pdg] tests/sparecode/bts324_bis.i:47: Warning: no final state. Probably unreachable... [pdg] done for function main [sparecode] add selection in function 'main' [sparecode] selecting output zones ki[0..1]; k; s0; s1; is_ok; f_si[0..1]; f_so[0..1] [sparecode] look for annotations in function f [pdg] computing for function f [pdg] done for function f [sparecode] look for annotations in function init [pdg] computing for function init [pdg] done for function init [sparecode] look for annotations in function loop_body [pdg] computing for function loop_body [pdg] done for function loop_body [sparecode] look for annotations in function main [sparecode] selecting annotation : impact pragma expr s0; [sparecode] selecting annotation : slice pragma expr s1; [sparecode] add selection in function 'main' [sparecode] look for annotations in function main_bis [pdg] computing for function main_bis [pdg] Warning: unreachable entry point (sid:32, function main_bis) [pdg] Bottom for function main_bis [sparecode] pdg bottom: skip annotations [sparecode] finalize call input propagation [sparecode] add selection in function 'loop_body' [sparecode] add selection in function 'main' [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int ki[2]; int k; int f(int vi, int i); static int f_si[2] = {0}; static int f_so[2] = {0}; int f(int vi, int i) { int vo = f_so[i] / k + ki[i] * (vi - f_si[i]); f_so[i] = vo; f_si[i] = vi; return vo; } int volatile e0; int volatile e1; int s0; int s1; void loop_body(void) { int acq0 = e0; int acq1 = e1; int val0 = f(acq0,0); int val1 = f(acq1,1); s0 = val0; s1 = val1; return; } void init(void) { ki[0] = 2; ki[1] = 4; k = 8; return; } void main(void) { init(); while (1) { loop_body(); /*@ impact pragma expr s0; */ ; /*@ slice pragma expr s1; */ ; } return; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts324_bis.1.res.oracle0000666000000000000000000001045113571573400021564 0ustar [kernel] Parsing tests/sparecode/bts324_bis.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main_bis outputs and entry point [eva] Analyzing a complete application starting at main_bis [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization ki[0..1] ∈ {0} k ∈ {0} e0 ∈ [--..--] e1 ∈ [--..--] s0 ∈ {0} s1 ∈ {0} is_ok ∈ {0} f_si[0..1] ∈ {0} f_so[0..1] ∈ {0} [eva] computing for function init <- main_bis. Called from tests/sparecode/bts324_bis.i:51. [eva] Recording results for init [eva] Done for function init [eva] computing for function loop_body <- main_bis. Called from tests/sparecode/bts324_bis.i:54. [eva] computing for function f <- loop_body <- main_bis. Called from tests/sparecode/bts324_bis.i:22. [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert -2147483648 ≤ ki[i] * (int)(vi - f_si[i]); [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert ki[i] * (int)(vi - f_si[i]) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- main_bis. Called from tests/sparecode/bts324_bis.i:23. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] tests/sparecode/bts324_bis.i:53: starting to merge loop iterations [eva] computing for function loop_body <- main_bis. Called from tests/sparecode/bts324_bis.i:54. [eva] computing for function f <- loop_body <- main_bis. Called from tests/sparecode/bts324_bis.i:22. [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert -2147483648 ≤ vi - f_si[i]; [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert vi - f_si[i] ≤ 2147483647; [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert -2147483648 ≤ (int)(f_so[i] / k) + (int)(ki[i] * (int)(vi - f_si[i])); [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert (int)(f_so[i] / k) + (int)(ki[i] * (int)(vi - f_si[i])) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- main_bis. Called from tests/sparecode/bts324_bis.i:23. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] computing for function loop_body <- main_bis. Called from tests/sparecode/bts324_bis.i:54. [eva] computing for function f <- loop_body <- main_bis. Called from tests/sparecode/bts324_bis.i:22. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- main_bis. Called from tests/sparecode/bts324_bis.i:23. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] Recording results for main_bis [eva] done for function main_bis [pdg] computing for function main_bis [from] Computing for function init [from] Done for function init [from] Computing for function loop_body [from] Computing for function f <-loop_body [from] Done for function f [from] Done for function loop_body [pdg] tests/sparecode/bts324_bis.i:57: Warning: no final state. Probably unreachable... [pdg] done for function main_bis [sparecode] add selection in function 'main_bis' [sparecode] selecting output zones ki[0..1]; k; s0; s1; is_ok; f_si[0..1]; f_so[0..1] [sparecode] look for annotations in function f [pdg] computing for function f [pdg] done for function f [sparecode] look for annotations in function init [pdg] computing for function init [pdg] done for function init [sparecode] look for annotations in function loop_body [pdg] computing for function loop_body [pdg] done for function loop_body [sparecode] look for annotations in function main [pdg] computing for function main [pdg] Warning: unreachable entry point (sid:21, function main) [pdg] Bottom for function main [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function main_bis [sparecode] finalize call input propagation [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ void main_bis(void) { return; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts324_bis.2.res.oracle0000666000000000000000000001174713571573400021576 0ustar [kernel] Parsing tests/sparecode/bts324_bis.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main outputs and entry point [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization ki[0..1] ∈ {0} k ∈ {0} e0 ∈ [--..--] e1 ∈ [--..--] s0 ∈ {0} s1 ∈ {0} is_ok ∈ {0} f_si[0..1] ∈ {0} f_so[0..1] ∈ {0} [eva] computing for function init <- main. Called from tests/sparecode/bts324_bis.i:37. [eva] Recording results for init [eva] Done for function init [eva] computing for function loop_body <- main. Called from tests/sparecode/bts324_bis.i:40. [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:22. [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert -2147483648 ≤ ki[i] * (int)(vi - f_si[i]); [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert ki[i] * (int)(vi - f_si[i]) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:23. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] tests/sparecode/bts324_bis.i:39: starting to merge loop iterations [eva] computing for function loop_body <- main. Called from tests/sparecode/bts324_bis.i:40. [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:22. [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert -2147483648 ≤ vi - f_si[i]; [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert vi - f_si[i] ≤ 2147483647; [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert -2147483648 ≤ (int)(f_so[i] / k) + (int)(ki[i] * (int)(vi - f_si[i])); [eva:alarm] tests/sparecode/bts324_bis.i:10: Warning: signed overflow. assert (int)(f_so[i] / k) + (int)(ki[i] * (int)(vi - f_si[i])) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:23. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] computing for function loop_body <- main. Called from tests/sparecode/bts324_bis.i:40. [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:22. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- main. Called from tests/sparecode/bts324_bis.i:23. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function init [from] Done for function init [from] Computing for function loop_body [from] Computing for function f <-loop_body [from] Done for function f [from] Done for function loop_body [pdg] tests/sparecode/bts324_bis.i:47: Warning: no final state. Probably unreachable... [pdg] done for function main [sparecode] add selection in function 'main' [sparecode] selecting output zones ki[0..1]; k; s0; s1; is_ok; f_si[0..1]; f_so[0..1] [sparecode] look for annotations in function f [pdg] computing for function f [pdg] done for function f [sparecode] look for annotations in function init [pdg] computing for function init [pdg] done for function init [sparecode] look for annotations in function loop_body [pdg] computing for function loop_body [pdg] done for function loop_body [sparecode] look for annotations in function main [sparecode] selecting annotation : slice pragma expr s1; [sparecode] add selection in function 'main' [sparecode] look for annotations in function main_bis [pdg] computing for function main_bis [pdg] Warning: unreachable entry point (sid:32, function main_bis) [pdg] Bottom for function main_bis [sparecode] pdg bottom: skip annotations [sparecode] finalize call input propagation [sparecode] add selection in function 'loop_body' [sparecode] add selection in function 'main' [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int ki[2]; int k; int f(int vi, int i); static int f_si[2] = {0}; static int f_so[2] = {0}; int f(int vi, int i) { int vo = f_so[i] / k + ki[i] * (vi - f_si[i]); f_so[i] = vo; f_si[i] = vi; return vo; } int volatile e0; int volatile e1; int s0; int s1; void loop_body(void) { int acq0 = e0; int acq1 = e1; f(acq0,0); int val1 = f(acq1,1); s1 = val1; return; } void init(void) { ki[0] = 2; ki[1] = 4; k = 8; return; } void main(void) { init(); while (1) { loop_body(); /*@ impact pragma expr s0; */ ; /*@ slice pragma expr s1; */ ; } return; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts334.0.res.oracle0000666000000000000000000001252613571573400020734 0ustar [kernel] Parsing tests/sparecode/bts334.i (no preprocessing) [sparecode] remove unused code... [eva] Analyzing a complete application starting at main_init [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization kf ∈ {0} k[0..1] ∈ {0} e0 ∈ [--..--] e1 ∈ [--..--] s0 ∈ {0} s1 ∈ {0} si[0..1] ∈ {0} so[0..1] ∈ {0} [eva] computing for function init <- main_init. Called from tests/sparecode/bts334.i:66. [kernel] tests/sparecode/bts334.i:66: Warning: No code nor explicit assigns clause for function init, generating default assigns from the specification [eva] using specification for function init [eva] tests/sparecode/bts334.i:61: Warning: no 'assigns \result \from ...' clause specified for function init [eva] Done for function init [eva:alarm] tests/sparecode/bts334.i:67: Warning: accessing uninitialized left-value. assert \initialized(&is_ok); [eva] computing for function process <- main_init. Called from tests/sparecode/bts334.i:67. [eva] computing for function loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:53. [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:38. [eva:alarm] tests/sparecode/bts334.i:14: Warning: division by zero. assert kf ≢ 0; [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert -2147483648 ≤ k[i] * (int)(vi - si[i]); [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert k[i] * (int)(vi - si[i]) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:39. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] tests/sparecode/bts334.i:53: starting to merge loop iterations [eva] computing for function loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:53. [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:38. [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert -2147483648 ≤ vi - si[i]; [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert vi - si[i] ≤ 2147483647; [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert -2147483648 ≤ (int)(so[i] / kf) + (int)(k[i] * (int)(vi - si[i])); [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert (int)(so[i] / kf) + (int)(k[i] * (int)(vi - si[i])) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:39. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] computing for function loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:53. [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:38. [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert so[i] / kf ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:39. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] Recording results for process [eva] Done for function process [eva] Recording results for main_init [eva] done for function main_init [pdg] computing for function main_init [from] Computing for function init [from] Done for function init [from] Computing for function process [from] Computing for function loop_body <-process [from] Computing for function f <-loop_body <-process [from] Done for function f [from] Done for function loop_body [from] Non-terminating function process (no dependencies) [from] Done for function process [pdg] done for function main_init [pdg] computing for function f [pdg] done for function f [pdg] computing for function init [pdg] done for function init [pdg] computing for function loop_body [pdg] done for function loop_body [pdg] computing for function process [pdg] tests/sparecode/bts334.i:55: Warning: no final state. Probably unreachable... [pdg] done for function process [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int kf; int k[2]; int f(int vi, int i); static int si[2] = {0, 0}; static int so[2] = {0, 0}; int f(int vi, int i) { int vo; vo = so[i] / kf + k[i] * (vi - si[i]); so[i] = vo; si[i] = vi; return vo; } int volatile e0; int volatile e1; int s0; void loop_body(void) { int acq0; int acq1; int val0; /*@ slice pragma expr s0; */ ; acq0 = e0; acq1 = e1; val0 = f(acq0,0); f(acq1,1); s0 = val0; return; } void process(int conf) { kf = conf; k[0] = 3; k[1] = 14; while (1) loop_body(); return; } /*@ assigns *p; assigns *p \from \nothing; behavior default: assigns *p; assigns *p \from \nothing; */ extern int init(int *p); void main_init(void) { int is_ok; int config; config = init(& is_ok); if (is_ok) process(config); return; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts334.1.res.oracle0000666000000000000000000001321013571573400020724 0ustar [kernel] Parsing tests/sparecode/bts334.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main_init [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization kf ∈ {0} k[0..1] ∈ {0} e0 ∈ [--..--] e1 ∈ [--..--] s0 ∈ {0} s1 ∈ {0} si[0..1] ∈ {0} so[0..1] ∈ {0} [eva] computing for function init <- main_init. Called from tests/sparecode/bts334.i:66. [kernel] tests/sparecode/bts334.i:66: Warning: No code nor explicit assigns clause for function init, generating default assigns from the specification [eva] using specification for function init [eva] tests/sparecode/bts334.i:61: Warning: no 'assigns \result \from ...' clause specified for function init [eva] Done for function init [eva:alarm] tests/sparecode/bts334.i:67: Warning: accessing uninitialized left-value. assert \initialized(&is_ok); [eva] computing for function process <- main_init. Called from tests/sparecode/bts334.i:67. [eva] computing for function loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:53. [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:38. [eva:alarm] tests/sparecode/bts334.i:14: Warning: division by zero. assert kf ≢ 0; [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert -2147483648 ≤ k[i] * (int)(vi - si[i]); [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert k[i] * (int)(vi - si[i]) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:39. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] tests/sparecode/bts334.i:53: starting to merge loop iterations [eva] computing for function loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:53. [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:38. [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert -2147483648 ≤ vi - si[i]; [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert vi - si[i] ≤ 2147483647; [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert -2147483648 ≤ (int)(so[i] / kf) + (int)(k[i] * (int)(vi - si[i])); [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert (int)(so[i] / kf) + (int)(k[i] * (int)(vi - si[i])) ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:39. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] computing for function loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:53. [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:38. [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert so[i] / kf ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:39. [eva] Recording results for f [eva] Done for function f [eva] Recording results for loop_body [eva] Done for function loop_body [eva] Recording results for process [eva] Done for function process [eva] Recording results for main_init [eva] done for function main_init [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop_body [from] Computing for function f [from] Done for function f [pdg] done for function loop_body [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function process [from] Computing for function loop_body [from] Done for function loop_body [pdg] tests/sparecode/bts334.i:55: Warning: no final state. Probably unreachable... [pdg] done for function process [pdg] computing for function main_init [from] Computing for function init [from] Done for function init [from] Computing for function process [from] Non-terminating function process (no dependencies) [from] Done for function process [pdg] done for function main_init [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int kf; int k[2]; int f_slice_1(int vi, int i); static int si[2] = {0, 0}; static int so[2] = {0, 0}; int f_slice_1(int vi, int i) { int vo; vo = so[i] / kf + k[i] * (vi - si[i]); so[i] = vo; si[i] = vi; return vo; } int volatile e0; int volatile e1; int s0; void loop_body_slice_1(void) { int acq0; int acq1; int val0; /*@ slice pragma expr s0; */ ; acq0 = e0; acq1 = e1; val0 = f_slice_1(acq0,0); f_slice_1(acq1,1); s0 = val0; return; } void process_slice_1(int conf) { kf = conf; k[0] = 3; k[1] = 14; while (1) loop_body_slice_1(); return; } extern int init(int *p); void main_init(void) { int is_ok; int config; config = init(& is_ok); if (is_ok) process_slice_1(config); return; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts334.2.res.oracle0000666000000000000000000001571013571573400020734 0ustar [kernel] Parsing tests/sparecode/bts334.i (no preprocessing) [eva] Analyzing a complete application starting at main_init [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization kf ∈ {0} k[0..1] ∈ {0} e0 ∈ [--..--] e1 ∈ [--..--] s0 ∈ {0} s1 ∈ {0} si[0..1] ∈ {0} so[0..1] ∈ {0} [eva] computing for function init <- main_init. Called from tests/sparecode/bts334.i:66. [kernel] tests/sparecode/bts334.i:66: Warning: No code nor explicit assigns clause for function init, generating default assigns from the specification [eva] using specification for function init [eva] tests/sparecode/bts334.i:61: Warning: no 'assigns \result \from ...' clause specified for function init [eva] Done for function init [eva:alarm] tests/sparecode/bts334.i:67: Warning: accessing uninitialized left-value. assert \initialized(&is_ok); [eva] computing for function process <- main_init. Called from tests/sparecode/bts334.i:67. [eva] computing for function loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:53. [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:38. [eva:alarm] tests/sparecode/bts334.i:14: Warning: division by zero. assert kf ≢ 0; [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert -2147483648 ≤ k[i] * (int)(vi - si[i]); [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert k[i] * (int)(vi - si[i]) ≤ 2147483647; [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:39. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for loop_body [from] Computing for function loop_body [from] Done for function loop_body [eva] Done for function loop_body [eva] tests/sparecode/bts334.i:53: starting to merge loop iterations [eva] computing for function loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:53. [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:38. [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert -2147483648 ≤ vi - si[i]; [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert vi - si[i] ≤ 2147483647; [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert -2147483648 ≤ (int)(so[i] / kf) + (int)(k[i] * (int)(vi - si[i])); [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert (int)(so[i] / kf) + (int)(k[i] * (int)(vi - si[i])) ≤ 2147483647; [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:39. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for loop_body [from] Computing for function loop_body [from] Done for function loop_body [eva] Done for function loop_body [eva] computing for function loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:53. [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:38. [eva:alarm] tests/sparecode/bts334.i:14: Warning: signed overflow. assert so[i] / kf ≤ 2147483647; [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- loop_body <- process <- main_init. Called from tests/sparecode/bts334.i:39. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for loop_body [from] Computing for function loop_body [from] Done for function loop_body [eva] Done for function loop_body [eva] Recording results for process [from] Computing for function process [from] Non-terminating function process (no dependencies) [from] Done for function process [eva] Done for function process [eva] Recording results for main_init [from] Computing for function main_init [from] Done for function main_init [eva] done for function main_init [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/sparecode/bts334.i:38 (by loop_body): si[0] FROM vi; i so[0] FROM kf; k[0]; vi; i; si[0]; so[0] \result FROM kf; k[0]; vi; i; si[0]; so[0] [from] call to f at tests/sparecode/bts334.i:39 (by loop_body): si[1] FROM vi; i so[1] FROM kf; k[1]; vi; i; si[1]; so[1] \result FROM kf; k[1]; vi; i; si[1]; so[1] [from] call to loop_body at tests/sparecode/bts334.i:53 (by process): s0 FROM kf; k[0]; e0; si[0]; so[0] s1 FROM kf; k[1]; e1; si[1]; so[1] si[0] FROM e0 [1] FROM e1 so[0] FROM kf; k[0]; e0; si[0]; so[0] [1] FROM kf; k[1]; e1; si[1]; so[1] [from] call to init at tests/sparecode/bts334.i:66 (by main_init): is_ok FROM \nothing \result FROM ANYTHING(origin:Unknown) [from] call to process at tests/sparecode/bts334.i:67 (by main_init): NON TERMINATING - NO EFFECTS [from] entry point: NO EFFECTS [from] ====== END OF CALLWISE DEPENDENCIES ====== [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function loop_body [pdg] done for function loop_body [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function process [pdg] tests/sparecode/bts334.i:55: Warning: no final state. Probably unreachable... [pdg] done for function process [pdg] computing for function main_init [pdg] done for function main_init [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int kf; int k[2]; int f_slice_1(int vi, int i); static int si[2] = {0, 0}; static int so[2] = {0, 0}; int f_slice_1(int vi, int i) { int vo; vo = so[i] / kf + k[i] * (vi - si[i]); so[i] = vo; si[i] = vi; return vo; } int volatile e0; int s0; void loop_body_slice_1(void) { int acq0; int val0; /*@ slice pragma expr s0; */ ; acq0 = e0; val0 = f_slice_1(acq0,0); s0 = val0; return; } void process_slice_1(int conf) { kf = conf; k[0] = 3; while (1) loop_body_slice_1(); return; } extern int init(int *p); void main_init(void) { int is_ok; int config; config = init(& is_ok); if (is_ok) process_slice_1(config); return; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts927.0.res.oracle0000666000000000000000000000237513571573400020745 0ustar [kernel] Parsing tests/sparecode/bts927.i (no preprocessing) [sparecode] remove unused code... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/sparecode/bts927.i:15: Warning: assertion got status unknown. [eva] computing for function f <- main. Called from tests/sparecode/bts927.i:17. [eva:signed-overflow] tests/sparecode/bts927.i:10: Warning: 2's complement assumed for overflow [eva] Recording results for f [eva] Done for function f [eva] tests/sparecode/bts927.i:19: Reusing old results for call to f [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [pdg] computing for function f [pdg] done for function f [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int f(int a) { int tmp; int c = a + 1; if (c > 0) tmp = 1; else tmp = 0; return tmp; } int main(int x) { int __retres; /*@ assert x > 5; */ ; { int tmp_0; tmp_0 = f(x); __retres = tmp_0; } return __retres; } frama-c-20.0-Calcium/tests/sparecode/oracle/bts927.1.res.oracle0000666000000000000000000000242713571573400020744 0ustar [kernel] Parsing tests/sparecode/bts927.i (no preprocessing) [sparecode] remove unused code... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/sparecode/bts927.i:15: Warning: assertion got status unknown. [eva] computing for function f <- main. Called from tests/sparecode/bts927.i:17. [eva:alarm] tests/sparecode/bts927.i:10: Warning: signed overflow. assert a + 1 ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/sparecode/bts927.i:19. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [pdg] computing for function f [pdg] done for function f [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int f(void) { int tmp; tmp = 1; return tmp; } int main(int x) { int __retres; /*@ assert x > 5; */ ; { int tmp_0; tmp_0 = f(); __retres = tmp_0; } return __retres; } frama-c-20.0-Calcium/tests/sparecode/oracle/calls.0.res.oracle0000666000000000000000000000307113571573400021003 0ustar [kernel] Parsing tests/sparecode/calls.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main outputs and entry point [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] computing for function f <- main. Called from tests/sparecode/calls.i:16. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/sparecode/calls.i:17. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/sparecode/calls.i:18. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [sparecode] add selection in function 'main' [sparecode] selecting output zones G [sparecode] add selection in function 'main' [pdg] computing for function f [pdg] done for function f [sparecode] look for annotations in function f [sparecode] look for annotations in function main [sparecode] finalize call input propagation [sparecode] add selection in function 'main' [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int G; int f(int x, int y) { G = y; return x; } int main(void) { int a = 1; int b = 1; f(a,b); a = f(G + 1,b); G = 0; return a; } frama-c-20.0-Calcium/tests/sparecode/oracle/calls.1.res.oracle0000666000000000000000000000324513571573400021007 0ustar [kernel] Parsing tests/sparecode/calls.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] computing for function f <- main. Called from tests/sparecode/calls.i:16. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/sparecode/calls.i:17. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/sparecode/calls.i:18. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function f [from] Done for function f [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f [pdg] done for function f [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int f_slice_1(int x, int y) { G = y; return x; } int main(void) { int a = 1; int b = 1; f_slice_1(a,b); a = f_slice_1(G + 1,b); return a; } frama-c-20.0-Calcium/tests/sparecode/oracle/dead_code.0.res.oracle0000666000000000000000000000155313571573400021577 0ustar [kernel] Parsing tests/sparecode/dead_code.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main outputs and entry point [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [pdg] computing for function main [pdg] done for function main [sparecode] add selection in function 'main' [sparecode] selecting output zones \nothing [sparecode] add selection in function 'main' [sparecode] look for annotations in function main [sparecode] finalize call input propagation [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int main(void) { int x; x = 1; return x; } frama-c-20.0-Calcium/tests/sparecode/oracle/dead_code.1.res.oracle0000666000000000000000000000203513571573400021574 0ustar [kernel] Parsing tests/sparecode/dead_code.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int main(void) { int x; x = 1; return x; } frama-c-20.0-Calcium/tests/sparecode/oracle/glob_decls.0.res.oracle0000666000000000000000000000500613571573400022002 0ustar [kernel] Parsing tests/sparecode/glob_decls.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main outputs and entry point [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ [--..--] G2 ∈ [--..--] PG1 ∈ {{ NULL ; &S_PG1[0] }} Gts ∈ [--..--] GPs ∈ {{ NULL ; &S_GPs[0] }} S2 ∈ [--..--] C ∈ [--..--] S3 ∈ [--..--] Size ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] use_in_PX_init ∈ [--..--] PX ∈ {{ NULL ; &S_PX[0] }} S_PG1[0..1] ∈ [--..--] S_GPs[0..1] ∈ [--..--] S_PX[0..1] ∈ [--..--] [eva:alarm] tests/sparecode/glob_decls.i:42: Warning: function main: precondition got status unknown. [eva:alarm] tests/sparecode/glob_decls.i:46: Warning: signed overflow. assert y + Y ≤ 2147483647; [eva:alarm] tests/sparecode/glob_decls.i:47: Warning: out of bounds read. assert \valid_read(PX); [eva:alarm] tests/sparecode/glob_decls.i:47: Warning: signed overflow. assert -2147483648 ≤ y + *PX; [eva:alarm] tests/sparecode/glob_decls.i:47: Warning: signed overflow. assert y + *PX ≤ 2147483647; [eva:alarm] tests/sparecode/glob_decls.i:48: Warning: assertion got status unknown. [eva:alarm] tests/sparecode/glob_decls.i:49: Warning: signed overflow. assert X + x ≤ 2147483647; [eva] Recording results for main [eva] done for function main [pdg] computing for function main [pdg] done for function main [sparecode] add selection in function 'main' [sparecode] selecting output zones \nothing [sparecode] add selection in function 'main' [sparecode] look for annotations in function f [pdg] computing for function f [pdg] Warning: unreachable entry point (sid:2, function f) [pdg] Bottom for function f [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function main [sparecode] selecting annotation : slice pragma expr S2; [sparecode] selecting annotation : assert X > 0; [sparecode] add selection in function 'main' [sparecode] finalize call input propagation [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ struct __anonstruct_Ts2_2 { int a ; int b ; }; typedef struct __anonstruct_Ts2_2 Ts2; typedef int Int; typedef Int Tx; Ts2 S2; char Size; Tx X = (int)sizeof(Size); int main(int x) { int __retres; /*@ slice pragma expr S2; */ ; /*@ assert X > 0; */ ; __retres = X + x; return __retres; } frama-c-20.0-Calcium/tests/sparecode/oracle/glob_decls.1.res.oracle0000666000000000000000000000456013571573400022007 0ustar [kernel] Parsing tests/sparecode/glob_decls.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ [--..--] G2 ∈ [--..--] PG1 ∈ {{ NULL ; &S_PG1[0] }} Gts ∈ [--..--] GPs ∈ {{ NULL ; &S_GPs[0] }} S2 ∈ [--..--] C ∈ [--..--] S3 ∈ [--..--] Size ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] use_in_PX_init ∈ [--..--] PX ∈ {{ NULL ; &S_PX[0] }} S_PG1[0..1] ∈ [--..--] S_GPs[0..1] ∈ [--..--] S_PX[0..1] ∈ [--..--] [eva:alarm] tests/sparecode/glob_decls.i:42: Warning: function main: precondition got status unknown. [eva:alarm] tests/sparecode/glob_decls.i:46: Warning: signed overflow. assert y + Y ≤ 2147483647; [eva:alarm] tests/sparecode/glob_decls.i:47: Warning: out of bounds read. assert \valid_read(PX); [eva:alarm] tests/sparecode/glob_decls.i:47: Warning: signed overflow. assert -2147483648 ≤ y + *PX; [eva:alarm] tests/sparecode/glob_decls.i:47: Warning: signed overflow. assert y + *PX ≤ 2147483647; [eva:alarm] tests/sparecode/glob_decls.i:48: Warning: assertion got status unknown. [eva:alarm] tests/sparecode/glob_decls.i:49: Warning: signed overflow. assert X + x ≤ 2147483647; [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct __anonstruct_Ts2_2 { int a ; int b ; }; typedef struct __anonstruct_Ts2_2 Ts2; typedef int Int; typedef Int Tx; Ts2 S2; char Size; Tx X = (int)sizeof(Size); /*@ requires S2.a > S2.b; */ int main(int x) { int __retres; /*@ slice pragma expr S2; */ ; /*@ assert X > 0; */ ; __retres = X + x; return __retres; } frama-c-20.0-Calcium/tests/sparecode/oracle/glob_decls.2.res.oracle0000666000000000000000000000171613571573400022010 0ustar [kernel] Parsing tests/sparecode/glob_decls.i (no preprocessing) [sparecode] remove unused global declarations from project 'default' [sparecode] removed unused global declarations in new project 'default (without unused globals)' /* Generated by Frama-C */ struct __anonstruct_Ts_1 { int a ; }; typedef struct __anonstruct_Ts_1 Ts; struct __anonstruct_Ts2_2 { int a ; int b ; }; typedef struct __anonstruct_Ts2_2 Ts2; struct __anonstruct_Ts3_3 { int a ; int b ; int c ; }; typedef struct __anonstruct_Ts3_3 Ts3; typedef int Int; typedef Int Tx; Ts2 S2; Ts3 S3; int f(void) { int __retres; __retres = (S3.a + S3.b) + S3.c; return __retres; } char Size; Tx X = (int)sizeof(Size); int Y; int use_in_PX_init; int *PX; /*@ requires S2.a > S2.b; */ int main(int x, Ts s) { int __retres; /*@ slice pragma expr S2; */ ; int y = 3; y += Y; y += *PX; /*@ assert X > 0; */ ; __retres = X + x; return __retres; } int *PX = & use_in_PX_init; frama-c-20.0-Calcium/tests/sparecode/oracle/intra.0.res.oracle0000666000000000000000000001452713571573400021032 0ustar [kernel] Parsing tests/sparecode/intra.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main outputs and entry point [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} X10 ∈ {0} Y10 ∈ {0} [eva] computing for function param <- main. Called from tests/sparecode/intra.i:82. [eva] Recording results for param [eva] Done for function param [eva] computing for function tmp <- main. Called from tests/sparecode/intra.i:83. [eva] tests/sparecode/intra.i:21: assertion got status valid. [eva] tests/sparecode/intra.i:23: assertion got status valid. [eva] Recording results for tmp [eva] Done for function tmp [eva] computing for function spare_called_fct <- main. Called from tests/sparecode/intra.i:84. [eva] Recording results for spare_called_fct [eva] Done for function spare_called_fct [eva] computing for function call_two_outputs <- main. Called from tests/sparecode/intra.i:85. [eva] computing for function two_outputs <- call_two_outputs <- main. Called from tests/sparecode/intra.i:49. [eva] Recording results for two_outputs [eva] Done for function two_outputs [eva] computing for function two_outputs <- call_two_outputs <- main. Called from tests/sparecode/intra.i:53. [eva] Recording results for two_outputs [eva] Done for function two_outputs [eva] Recording results for call_two_outputs [eva] Done for function call_two_outputs [eva] computing for function loop <- main. Called from tests/sparecode/intra.i:86. [eva] tests/sparecode/intra.i:64: assertion got status valid. [eva] tests/sparecode/intra.i:65: loop invariant got status valid. [eva] tests/sparecode/intra.i:67: starting to merge loop iterations [eva] Recording results for loop [eva] Done for function loop [eva] computing for function assign <- main. Called from tests/sparecode/intra.i:87. [eva] Recording results for assign [eva] Done for function assign [eva] computing for function assign <- main. Called from tests/sparecode/intra.i:88. [eva] Recording results for assign [eva] Done for function assign [eva] computing for function stop <- main. Called from tests/sparecode/intra.i:91. [kernel:annot:missing-spec] tests/sparecode/intra.i:91: Warning: Neither code nor specification for function stop, generating default assigns from the prototype [eva] using specification for function stop [eva] Done for function stop [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function param [from] Done for function param [from] Computing for function tmp [from] Done for function tmp [from] Computing for function spare_called_fct [from] Done for function spare_called_fct [from] Computing for function call_two_outputs [from] Computing for function two_outputs <-call_two_outputs [from] Done for function two_outputs [from] Done for function call_two_outputs [from] Computing for function loop [from] Done for function loop [from] Computing for function assign [from] Done for function assign [from] Computing for function stop [from] Done for function stop [pdg] done for function main [sparecode] add selection in function 'main' [sparecode] selecting output zones G [sparecode] add selection in function 'main' [pdg] computing for function call_two_outputs [pdg] done for function call_two_outputs [pdg] computing for function assign [pdg] done for function assign [pdg] computing for function loop [pdg] done for function loop [pdg] computing for function tmp [pdg] done for function tmp [pdg] computing for function param [pdg] done for function param [pdg] computing for function two_outputs [pdg] done for function two_outputs [sparecode] look for annotations in function assign [sparecode] look for annotations in function call_two_outputs [sparecode] look for annotations in function f10 [pdg] computing for function f10 [pdg] Warning: unreachable entry point (sid:79, function f10) [pdg] Bottom for function f10 [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function loop [sparecode] selecting annotation : assert i < z; [sparecode] selecting annotation : loop invariant i < y; [sparecode] add selection in function 'loop' [sparecode] look for annotations in function main [sparecode] selecting annotation : assert \false; [sparecode] look for annotations in function main2 [pdg] computing for function main2 [pdg] Warning: unreachable entry point (sid:87, function main2) [pdg] Bottom for function main2 [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function param [sparecode] look for annotations in function spare_called_fct [pdg] computing for function spare_called_fct [pdg] done for function spare_called_fct [sparecode] look for annotations in function stop [pdg] computing for function stop [pdg] done for function stop [sparecode] look for annotations in function tmp [sparecode] selecting annotation : assert x ≡ a; [sparecode] selecting annotation : assert w ≡ 1; [sparecode] add selection in function 'tmp' [sparecode] look for annotations in function two_outputs [sparecode] finalize call input propagation [sparecode] add selection in function 'call_two_outputs' [sparecode] add selection in function 'main' [sparecode] add selection in function 'main' [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int G; int tmp(int a) { int x = a; /*@ assert x ≡ a; */ ; int w = 1; /*@ assert w ≡ 1; */ ; return x; } int param(int a) { return a; } int two_outputs(int a, int b) { G += b; return a; } int call_two_outputs(void) { int x; int any_b = 1; int any_a = 2; int a = 1; int b = any_b; x = two_outputs(a,b); G = 1; b = 2; a = any_a; two_outputs(a,b); return x; } void assign(int *p, int *q) { *p = *q; return; } int loop(int x, int y, int z) { int i = 0; /*@ assert i < z; */ ; /*@ loop invariant i < y; */ while (i < x) i ++; return i; } int main(void) { int __retres; int x; int tmp_0; int tmp_1; int tmp_2; int tmp_3; int res = 0; int spare_ref = 3; int y = 2; tmp_0 = param(2); res += tmp_0; tmp_1 = tmp(4); res += tmp_1; tmp_2 = call_two_outputs(); res += tmp_2; tmp_3 = loop(10,15,20); res += tmp_3; assign(& x,& y); __retres = (res + G) + x; return __retres; } frama-c-20.0-Calcium/tests/sparecode/oracle/intra.1.res.oracle0000666000000000000000000001203113571573400021017 0ustar [kernel] Parsing tests/sparecode/intra.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} X10 ∈ {0} Y10 ∈ {0} [eva] computing for function param <- main. Called from tests/sparecode/intra.i:82. [eva] Recording results for param [eva] Done for function param [eva] computing for function tmp <- main. Called from tests/sparecode/intra.i:83. [eva] tests/sparecode/intra.i:21: assertion got status valid. [eva] tests/sparecode/intra.i:23: assertion got status valid. [eva] Recording results for tmp [eva] Done for function tmp [eva] computing for function spare_called_fct <- main. Called from tests/sparecode/intra.i:84. [eva] Recording results for spare_called_fct [eva] Done for function spare_called_fct [eva] computing for function call_two_outputs <- main. Called from tests/sparecode/intra.i:85. [eva] computing for function two_outputs <- call_two_outputs <- main. Called from tests/sparecode/intra.i:49. [eva] Recording results for two_outputs [eva] Done for function two_outputs [eva] computing for function two_outputs <- call_two_outputs <- main. Called from tests/sparecode/intra.i:53. [eva] Recording results for two_outputs [eva] Done for function two_outputs [eva] Recording results for call_two_outputs [eva] Done for function call_two_outputs [eva] computing for function loop <- main. Called from tests/sparecode/intra.i:86. [eva] tests/sparecode/intra.i:64: assertion got status valid. [eva] tests/sparecode/intra.i:65: loop invariant got status valid. [eva] tests/sparecode/intra.i:67: starting to merge loop iterations [eva] Recording results for loop [eva] Done for function loop [eva] computing for function assign <- main. Called from tests/sparecode/intra.i:87. [eva] Recording results for assign [eva] Done for function assign [eva] computing for function assign <- main. Called from tests/sparecode/intra.i:88. [eva] Recording results for assign [eva] Done for function assign [eva] computing for function stop <- main. Called from tests/sparecode/intra.i:91. [kernel:annot:missing-spec] tests/sparecode/intra.i:91: Warning: Neither code nor specification for function stop, generating default assigns from the prototype [eva] using specification for function stop [eva] Done for function stop [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function param [from] Done for function param [from] Computing for function tmp [from] Done for function tmp [from] Computing for function spare_called_fct [from] Done for function spare_called_fct [from] Computing for function call_two_outputs [from] Computing for function two_outputs <-call_two_outputs [from] Done for function two_outputs [from] Done for function call_two_outputs [from] Computing for function loop [from] Done for function loop [from] Computing for function assign [from] Done for function assign [from] Computing for function stop [from] Done for function stop [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function assign [pdg] done for function assign [pdg] computing for function loop [pdg] done for function loop [pdg] computing for function call_two_outputs [pdg] done for function call_two_outputs [pdg] computing for function two_outputs [pdg] done for function two_outputs [pdg] computing for function tmp [pdg] done for function tmp [pdg] computing for function param [pdg] done for function param [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int G; int tmp_slice_1(int a) { int x = a; /*@ assert x ≡ a; */ ; return x; } int param_slice_1(int a) { return a; } int two_outputs_slice_1(int a, int b) { G += b; return a; } int call_two_outputs_slice_1(void) { int x; int any_b = 1; int any_a = 2; int a = 1; int b = any_b; x = two_outputs_slice_1(a,b); G = 1; b = 2; a = any_a; two_outputs_slice_1(a,b); return x; } void assign_slice_1(int *p, int *q) { *p = *q; return; } int loop_slice_1(int x) { int i = 0; while (i < x) i ++; return i; } int main(void) { int __retres; int x; int tmp_0; int tmp_1; int tmp_2; int tmp_3; int res = 0; int spare_ref = 3; int y = 2; tmp_0 = param_slice_1(2); res += tmp_0; tmp_1 = tmp_slice_1(4); res += tmp_1; tmp_2 = call_two_outputs_slice_1(); res += tmp_2; tmp_3 = loop_slice_1(10); res += tmp_3; assign_slice_1(& x,& y); __retres = (res + G) + x; return __retres; } frama-c-20.0-Calcium/tests/sparecode/oracle/intra.2.res.oracle0000666000000000000000000000545113571573400021030 0ustar [kernel] Parsing tests/sparecode/intra.i (no preprocessing) [sparecode] remove unused code... [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} X10 ∈ {0} Y10 ∈ {0} [eva] computing for function f10 <- main2. Called from tests/sparecode/intra.i:115. [eva] tests/sparecode/intra.i:109: assertion got status valid. [eva] Recording results for f10 [eva] Done for function f10 [eva] Recording results for main2 [eva] done for function main2 [pdg] computing for function main2 [from] Computing for function f10 [from] Done for function f10 [pdg] done for function main2 [pdg] computing for function f10 [pdg] done for function f10 [pdg] computing for function assign [pdg] Warning: unreachable entry point (sid:32, function assign) [pdg] Bottom for function assign [pdg] computing for function call_two_outputs [pdg] Warning: unreachable entry point (sid:20, function call_two_outputs) [pdg] Bottom for function call_two_outputs [pdg] computing for function loop [pdg] Warning: unreachable entry point (sid:35, function loop) [pdg] Bottom for function loop [pdg] computing for function main [pdg] Warning: unreachable entry point (sid:46, function main) [pdg] Bottom for function main [pdg] computing for function param [pdg] Warning: unreachable entry point (sid:11, function param) [pdg] Bottom for function param [pdg] computing for function spare_called_fct [pdg] Warning: unreachable entry point (sid:14, function spare_called_fct) [pdg] Bottom for function spare_called_fct [pdg] computing for function stop [from] Computing for function stop [kernel:annot:missing-spec] tests/sparecode/intra.i:110: Warning: Neither code nor specification for function stop, generating default assigns from the prototype [from] Done for function stop [pdg] done for function stop [pdg] computing for function tmp [pdg] Warning: unreachable entry point (sid:1, function tmp) [pdg] Bottom for function tmp [pdg] computing for function two_outputs [pdg] Warning: unreachable entry point (sid:16, function two_outputs) [pdg] Bottom for function two_outputs [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ struct __anonstruct_a_2 { int x ; int y ; }; struct __anonstruct_X10_1 { struct __anonstruct_a_2 a ; int b ; }; struct __anonstruct_X10_1 X10; int Y10; int f10(int x) { /*@ slice pragma expr X10; */ ; /*@ slice pragma expr X10.a; */ ; /*@ slice pragma expr X10.a.x; */ ; /*@ slice pragma expr Y10; */ ; /*@ assert X10.a.x ≥ 0; */ ; return x; } int main2(void) { int __retres; int tmp_0; Y10 = 0; X10.b = 0; tmp_0 = f10(3); X10.a.y += tmp_0; __retres = X10.a.x + X10.a.y; return __retres; } frama-c-20.0-Calcium/tests/sparecode/oracle/intra.3.res.oracle0000666000000000000000000000326413571573400021031 0ustar [kernel] Parsing tests/sparecode/intra.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} X10 ∈ {0} Y10 ∈ {0} [eva] computing for function f10 <- main2. Called from tests/sparecode/intra.i:115. [eva] tests/sparecode/intra.i:109: assertion got status valid. [eva] Recording results for f10 [eva] Done for function f10 [eva] Recording results for main2 [eva] done for function main2 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main2 [from] Computing for function f10 [from] Done for function f10 [pdg] done for function main2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function f10 [pdg] done for function f10 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct __anonstruct_a_2 { int x ; int y ; }; struct __anonstruct_X10_1 { struct __anonstruct_a_2 a ; int b ; }; struct __anonstruct_X10_1 X10; int f10_slice_1(int x) { return x; } int main2(void) { int __retres; int tmp_0; tmp_0 = f10_slice_1(3); X10.a.y += tmp_0; __retres = X10.a.x + X10.a.y; return __retres; } frama-c-20.0-Calcium/tests/sparecode/oracle/intra.4.res.oracle0000666000000000000000000000343613571573400021033 0ustar [kernel] Parsing tests/sparecode/intra.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} X10 ∈ {0} Y10 ∈ {0} [eva] computing for function f10 <- main2. Called from tests/sparecode/intra.i:115. [eva] tests/sparecode/intra.i:109: assertion got status valid. [eva] Recording results for f10 [eva] Done for function f10 [eva] Recording results for main2 [eva] done for function main2 [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function f10 [pdg] done for function f10 [pdg] computing for function main2 [from] Computing for function f10 [from] Done for function f10 [pdg] done for function main2 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 2 actions... [slicing] applying actions: 1/2... [slicing] applying actions: 2/2... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ struct __anonstruct_a_2 { int x ; int y ; }; struct __anonstruct_X10_1 { struct __anonstruct_a_2 a ; int b ; }; struct __anonstruct_X10_1 X10; int f10_slice_1(int x) { /*@ slice pragma expr X10.a.x; */ ; /*@ assert X10.a.x ≥ 0; */ ; return x; } int main2(void) { int __retres; int tmp_0; tmp_0 = f10_slice_1(3); X10.a.y += tmp_0; __retres = X10.a.x + X10.a.y; return __retres; } frama-c-20.0-Calcium/tests/sparecode/oracle/issue_157.res.oracle0000666000000000000000000000337013571573400021275 0ustar [kernel] Parsing tests/sparecode/issue_157.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main outputs and entry point [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} [eva] computing for function g <- main. Called from tests/sparecode/issue_157.i:16. [eva] computing for function f <- g <- main. Called from tests/sparecode/issue_157.i:11. [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] Done for function g [eva] tests/sparecode/issue_157.i:17: Reusing old results for call to f [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function g [from] Computing for function f <-g [from] Done for function f [from] Done for function g [pdg] done for function main [sparecode] add selection in function 'main' [sparecode] selecting output zones \nothing [sparecode] add selection in function 'main' [pdg] computing for function f [pdg] done for function f [pdg] computing for function g [pdg] done for function g [sparecode] look for annotations in function f [sparecode] look for annotations in function g [sparecode] look for annotations in function main [sparecode] finalize call input propagation [sparecode] the caller 'g' is a spare function [sparecode] add selection in function 'main' [sparecode] the caller 'g' is a spare function [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int f(void) { int __retres; __retres = 0; return __retres; } int main(void) { int x; x = f(); return x; } frama-c-20.0-Calcium/tests/sparecode/oracle/params.0.res.oracle0000666000000000000000000000245013571573400021170 0ustar [kernel] Parsing tests/sparecode/params.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main outputs and entry point [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main1 <- main. Called from tests/sparecode/params.i:17. [eva] Recording results for main1 [eva] Done for function main1 [eva] Recording results for main [eva] done for function main [pdg] computing for function main [from] Computing for function main1 [from] Done for function main1 [pdg] done for function main [sparecode] add selection in function 'main' [sparecode] selecting output zones \nothing [sparecode] add selection in function 'main' [pdg] computing for function main1 [pdg] done for function main1 [sparecode] look for annotations in function main [sparecode] look for annotations in function main1 [sparecode] finalize call input propagation [sparecode] add selection in function 'main' [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int main1(int y) { y = 3; return y; } int main(void) { int tmp; int b = 1; tmp = main1(b); return tmp; } frama-c-20.0-Calcium/tests/sparecode/oracle/params.1.res.oracle0000666000000000000000000000261213571573400021171 0ustar [kernel] Parsing tests/sparecode/params.i (no preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main1 <- main. Called from tests/sparecode/params.i:17. [eva] Recording results for main1 [eva] Done for function main1 [eva] Recording results for main [eva] done for function main [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function main1 [from] Done for function main1 [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main1 [pdg] done for function main1 [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int main1_slice_1(int y) { y = 3; return y; } int main(void) { int tmp; int b = 1; tmp = main1_slice_1(b); return tmp; } frama-c-20.0-Calcium/tests/sparecode/oracle/se.res.oracle0000666000000000000000000000240713571573400020160 0ustar [kernel] Parsing tests/sparecode/se.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function Se outputs and entry point [eva] Analyzing an incomplete application starting at Se [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization glob ∈ [--..--] [eva:alarm] tests/sparecode/se.i:8: Warning: out of bounds write. assert \valid(s1); [eva:alarm] tests/sparecode/se.i:12: Warning: out of bounds write. assert \valid(tab + e1); [eva:alarm] tests/sparecode/se.i:14: Warning: out of bounds read. assert \valid_read(es); [eva] Recording results for Se [eva] done for function Se [pdg] computing for function Se [pdg] done for function Se [sparecode] add selection in function 'Se' [sparecode] selecting output zones glob; S_tab[0..1]; S_s1[0]; S_es[0] [sparecode] add selection in function 'Se' [sparecode] look for annotations in function Se [sparecode] finalize call input propagation [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int glob; void Se(int e1, int *es, int *s1, int *tab) { *s1 = 0; glob = 10; if (e1 == 0) *s1 = 1; else *(tab + e1) = 5; if (*es == 1) *es = 0; return; } frama-c-20.0-Calcium/tests/sparecode/oracle/top.0.res.oracle0000666000000000000000000000475713571573400020523 0ustar [kernel] Parsing tests/sparecode/top.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main_top outputs and entry point [eva] Analyzing a complete application starting at main_top [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:initial-state] creating variable S_0_S___va_params with imprecise size (type void) [eva:initial-state] creating variable S_1_S___va_params with imprecise size (type void) [eva] computing for function f <- main_top. Called from tests/sparecode/top.i:21. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main_top [eva] done for function main_top [pdg] computing for function main_top [from] Computing for function f [from] Done for function f [pdg] done for function main_top [sparecode] add selection in function 'main_top' [sparecode] selecting output zones \nothing [sparecode] add selection in function 'main_top' [sparecode] look for annotations in function f [pdg] computing for function f [pdg] done for function f [sparecode] look for annotations in function main_call_top [pdg] computing for function main_call_top [pdg] Warning: unreachable entry point (sid:23, function main_call_top) [pdg] Bottom for function main_call_top [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function main_top [sparecode] look for annotations in function main_top_not_used [pdg] computing for function main_top_not_used [pdg] Warning: unreachable entry point (sid:28, function main_top_not_used) [pdg] Bottom for function main_top_not_used [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function not_used_in_main_top [pdg] computing for function not_used_in_main_top [pdg] Warning: unreachable entry point (sid:1, function not_used_in_main_top) [pdg] Bottom for function not_used_in_main_top [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function print [pdg] computing for function print [from] Computing for function print [kernel:annot:missing-spec] tests/sparecode/top.i:16: Warning: Neither code nor specification for function print, generating default assigns from the prototype [from] Done for function print [pdg] done for function print [sparecode] finalize call input propagation [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int main_top(void) { int x = 3; return x; } frama-c-20.0-Calcium/tests/sparecode/oracle/top.1.res.oracle0000666000000000000000000000615013571573400020511 0ustar [kernel] Parsing tests/sparecode/top.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main_call_top outputs and entry point [eva] Analyzing a complete application starting at main_call_top [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main_top <- main_call_top. Called from tests/sparecode/top.i:26. [eva] computing for function f <- main_top <- main_call_top. Called from tests/sparecode/top.i:21. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main_top [eva] Done for function main_top [eva] computing for function not_used_in_main_top <- main_call_top. Called from tests/sparecode/top.i:27. [eva] computing for function print <- not_used_in_main_top <- main_call_top. Called from tests/sparecode/top.i:10. [kernel:annot:missing-spec] tests/sparecode/top.i:10: Warning: Neither code nor specification for function print, generating default assigns from the prototype [eva] using specification for function print [eva] Done for function print [eva] Recording results for not_used_in_main_top [eva] Done for function not_used_in_main_top [eva] Recording results for main_call_top [eva] done for function main_call_top [pdg] computing for function main_call_top [from] Computing for function main_top [from] Computing for function f <-main_top [from] Done for function f [from] Done for function main_top [from] Computing for function not_used_in_main_top [from] Computing for function print <-not_used_in_main_top [from] Done for function print [from] Done for function not_used_in_main_top [pdg] done for function main_call_top [sparecode] add selection in function 'main_call_top' [sparecode] selecting output zones \nothing [sparecode] add selection in function 'main_call_top' [pdg] computing for function not_used_in_main_top [pdg] done for function not_used_in_main_top [pdg] computing for function main_top [pdg] done for function main_top [sparecode] look for annotations in function f [pdg] computing for function f [pdg] done for function f [sparecode] look for annotations in function main_call_top [sparecode] look for annotations in function main_top [sparecode] look for annotations in function main_top_not_used [pdg] computing for function main_top_not_used [pdg] Warning: unreachable entry point (sid:28, function main_top_not_used) [pdg] Bottom for function main_top_not_used [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function not_used_in_main_top [sparecode] look for annotations in function print [pdg] computing for function print [pdg] done for function print [sparecode] finalize call input propagation [sparecode] add selection in function 'main_call_top' [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int not_used_in_main_top(int x) { int __retres; __retres = x + 2; return __retres; } int main_top(void) { int x = 3; return x; } int main_call_top(void) { int x = main_top(); x = not_used_in_main_top(x); return x; } frama-c-20.0-Calcium/tests/sparecode/oracle/top.2.res.oracle0000666000000000000000000000566413571573400020523 0ustar [kernel] Parsing tests/sparecode/top.i (no preprocessing) [sparecode] remove unused code... [sparecode] selecting function main_top_not_used outputs and entry point [eva] Analyzing a complete application starting at main_top_not_used [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main_top <- main_top_not_used. Called from tests/sparecode/top.i:32. [eva] computing for function f <- main_top <- main_top_not_used. Called from tests/sparecode/top.i:21. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main_top [eva] Done for function main_top [eva] tests/sparecode/top.i:33: Reusing old results for call to f [eva] Recording results for main_top_not_used [eva] done for function main_top_not_used [pdg] computing for function main_top_not_used [from] Computing for function main_top [from] Computing for function f <-main_top [from] Done for function f [from] Done for function main_top [pdg] done for function main_top_not_used [sparecode] add selection in function 'main_top_not_used' [sparecode] selecting output zones \nothing [sparecode] add selection in function 'main_top_not_used' [pdg] computing for function f [pdg] done for function f [pdg] computing for function main_top [pdg] done for function main_top [sparecode] look for annotations in function f [sparecode] look for annotations in function main_call_top [pdg] computing for function main_call_top [pdg] Warning: unreachable entry point (sid:23, function main_call_top) [pdg] Bottom for function main_call_top [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function main_top [sparecode] look for annotations in function main_top_not_used [sparecode] look for annotations in function not_used_in_main_top [pdg] computing for function not_used_in_main_top [pdg] Warning: unreachable entry point (sid:1, function not_used_in_main_top) [pdg] Bottom for function not_used_in_main_top [sparecode] pdg bottom: skip annotations [sparecode] look for annotations in function print [pdg] computing for function print [from] Computing for function print [kernel:annot:missing-spec] tests/sparecode/top.i:22: Warning: Neither code nor specification for function print, generating default assigns from the prototype [from] Done for function print [pdg] done for function print [sparecode] finalize call input propagation [sparecode] the caller 'main_top' is a spare function [sparecode] the caller 'main_top' is a spare function [sparecode] add selection in function 'main_top_not_used' [sparecode] the caller 'main_top' is a spare function [sparecode] the caller 'main_top' is a spare function [sparecode] remove unused global declarations... [sparecode] result in new project 'default without sparecode'. /* Generated by Frama-C */ int f(int a) { int __retres; __retres = a + 1; return __retres; } int main_top_not_used(void) { int x = f(2); return x; } frama-c-20.0-Calcium/tests/sparecode/params.i0000666000000000000000000000067313571573400015765 0ustar /* run.config STDOPT: +"-sparecode-analysis" STDOPT: +"-slicing-level 2 -slice-return main -then-last -print" */ /* This is an example from #529. 'y' in [main1] should be visible to get a * compilable result. But unfortunatly, this leads to also select [b=1] in * [main]. This should be enhanced... */ int main1 (int x, int y, int z){ y = 3; return y; } int main (void) { int a = 0, b = 1, c = 3; return main1 (a, b, c); } frama-c-20.0-Calcium/tests/sparecode/se.i0000666000000000000000000000034613571573400015106 0ustar /* run.config STDOPT: +"-sparecode-analysis -lib-entry -main Se" */ int glob; void Se(int e1, int e2, int *es, int *s1, int tab[]) { *s1=0; glob=10; if (e1==0) *s1=1; else tab[e1]=5; if (*es==1) *es=0; } frama-c-20.0-Calcium/tests/sparecode/test_config0000666000000000000000000000006713571573400016554 0ustar OPT: -journal-disable @EVA_OPTIONS@ -sparecode-debug 1 frama-c-20.0-Calcium/tests/sparecode/top.i0000666000000000000000000000107313571573400015277 0ustar /* run.config STDOPT: +"-sparecode-analysis -main main_top" STDOPT: +"-sparecode-analysis -main main_call_top" STDOPT: +"-sparecode-analysis -main main_top_not_used" */ void print (int x); int not_used_in_main_top (int x) { print (x); return x+2; } int f (int a) { return a+1; } int main_top (int nb, ...) { int x = 3; int y = f (2); return x; } int main_call_top (void) { int x = main_top (2, 0, 1); x = not_used_in_main_top (x); return x; } int main_top_not_used (void) { int a = main_top (2, 0, 1); int x = f (2); return x; } frama-c-20.0-Calcium/tests/spec/0000777000000000000000000000000013571573400013307 5ustar frama-c-20.0-Calcium/tests/spec/Extend.i0000666000000000000000000000165213571573400014714 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -copy -kernel-warn-key=annot-error=active */ /*@ foo x == 0; bar \result == 0; bla \trace(x<10) || \trace(x>40); */ int f(int x); /*@ behavior test: foo y == 1; bar y + \result == 0; bla \trace(y<42) && \trace(y>12); */ int g(int y); int f(int x) { int s = 0; /*@ loop lfoo i<=x; loop baz \at(i,LoopEntry), 0; */ for (int i = 0; i < x; i++) s+=g(i); /*@ ca_foo s == 0; */ return s; } /*@ behavior ko: baz \true; */ int h(int z); int k(int z) { int x = z; int y = 0; /*@ ns_foo \at(x, Post) == z + 1; */ y = x++; return y; } /*@ global_foo \forall integer x; x < x + 1 ; */ //@ behavior ca_foo: ensures ca_foo: \true; void loop (void) { //@ for ca_foo: ca_foo \true; //@ ns_foo \true; //@ baz \true; /*@ loop invariant \true; */ while (0) { } } frama-c-20.0-Calcium/tests/spec/Extend.ml0000666000000000000000000001014613571573400015072 0ustar open Logic_ptree open Cil_types open Logic_typing let type_foo ~typing_context ~loc l = let _loc = loc in let preds = List.map (typing_context.type_predicate typing_context typing_context.pre_state) l in Ext_preds preds module Count = State_builder.Counter(struct let name = "Count" end) module Bar_table = State_builder.Hashtbl (Datatype.Int.Hashtbl) (Datatype.List(Cil_datatype.Predicate)) (struct let name = "Bar_table" let dependencies = [ Count.self ] let size = 3 end) let type_bar ~typing_context ~loc l = let _loc = loc in let i = Count.next() in let p = List.map (typing_context.type_predicate typing_context (typing_context.post_state [Normal])) l in Bar_table.add i p; Ext_id i let print_bar prt fmt ext = match ext with | Ext_id idx -> let l = Bar_table.find idx in Pretty_utils.pp_list ~pre:"@[" ~sep:",@ " ~suf:"@]" prt#predicate fmt l | Ext_preds _ | Ext_terms _ -> Kernel.fatal "bar extension should have ids as arguments" let visit_bar vis ext = match ext with | Ext_id idx -> let l = Bar_table.find idx in let l' = Cil.mapNoCopy (Cil.visitCilPredicate vis) l in if Visitor_behavior.is_copy vis#behavior then begin let idx' = Count.next () in Queue.add (fun () -> Bar_table.add idx' l') vis#get_filling_actions; Cil.ChangeTo(Ext_id idx') end else begin Bar_table.replace idx l'; Cil.SkipChildren end | Ext_terms _ | Ext_preds _ -> Kernel.fatal "bar extension should have ids as arguments" let type_baz ~typing_context ~loc:_loc l = let t = List.map (typing_context.type_term typing_context typing_context.pre_state) l in Ext_terms t module Count_bla = State_builder.Counter(struct let name = "Count_bla" end) module Bla_table = State_builder.Hashtbl(Datatype.Int.Hashtbl)(Cil_datatype.Predicate) (struct let name = "Bla_table" let dependencies = [ Ast.self; Count_bla.self ] let size = 3 end) let add_builtin () = let trace = { bl_name = "\\trace"; bl_labels = []; bl_params = []; bl_type = None; bl_profile = [ "x", Linteger ] } in Logic_builtin.add trace let () = add_builtin () let type_bla ~typing_context ~loc:_loc l = let type_predicate ctxt env p = match p.lexpr_node with | PLapp("\\trace", [], [pred]) -> let pred = typing_context.type_predicate typing_context env pred in let li = List.hd (ctxt.find_all_logic_functions "\\trace") in let i = Count.next () in let ti = Logic_const.tinteger ~loc:pred.pred_loc i in Bla_table.add i pred; Logic_const.papp ~loc:p.lexpr_loc (li,[],[ti]) | _ -> typing_context.type_predicate ctxt env p in let ctxt = { typing_context with type_predicate } in let l = List.map (type_predicate ctxt ctxt.pre_state) l in Ext_preds l let () = Logic_typing.register_behavior_extension "foo" false type_foo; Logic_typing.register_behavior_extension "bar" false type_bar; Logic_typing.register_behavior_extension "bla" false type_bla; Cil_printer.register_behavior_extension "bar" print_bar; Cil.register_behavior_extension "bar" visit_bar; Logic_typing.register_code_annot_next_both_extension "baz" false type_baz; Logic_typing.register_code_annot_next_loop_extension "lfoo" false type_foo; Logic_typing.register_code_annot_extension "ca_foo" false type_foo; Logic_typing.register_code_annot_next_stmt_extension "ns_foo" false type_foo; Logic_typing.register_global_extension "global_foo" false type_foo let run () = Ast.compute (); let debug = Kernel.debug_atleast 1 in let my_file = Extlib.temp_file_cleanup_at_exit ~debug "Extend" ".i" in let out = open_out my_file in let fmt = Format.formatter_of_out_channel out in File.pretty_ast ~fmt (); let prj = Project.create "reparsing" in Project.on prj add_builtin (); Project.on prj Kernel.Files.add my_file; Kernel.feedback "Reparsing file"; (* Avoid having a temporary name in the oracle. *) Kernel.Verbose.set 0; Project.on prj Ast.compute (); File.pretty_ast ~prj () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/spec/Type_of_term.ml0000666000000000000000000000204013571573400016271 0ustar open Cil_types include Plugin.Register (struct let name = "type_of_term" let shortname = "type_of_term" let help = "checks typeOfTermLval over sets" end) class visitor = object inherit Visitor.frama_c_inplace method! vterm t = result "Term: %a, type is %a" Printer.pp_term t Printer.pp_logic_type t.Cil_types.term_type; Cil.DoChildren method! vterm_lval (host,off as lv) = let ty = Cil.typeOfTermLval lv in let plain_lval = (host,TNoOffset) in let tyh = Cil.typeOfTermLval plain_lval in let tyoff = Cil.typeTermOffset tyh off in result "Host: %a, type is %a" Printer.pp_term_lval plain_lval Printer.pp_logic_type tyh; result "Offset: %a, type is %a" Printer.pp_term_offset off Printer.pp_logic_type tyoff; result "Lval: %a, type is %a" Printer.pp_term_lval lv Printer.pp_logic_type ty; Cil.DoChildren end let run () = let ast = Ast.get () in Visitor.visitFramacFileSameGlobals (new visitor) ast ;; Db.Main.extend run frama-c-20.0-Calcium/tests/spec/_Bool.i0000666000000000000000000000100613571573400014510 0ustar /* Generated by Frama-C */ struct _Z6Point2 { int x ; int y ; }; /*@ logic _Bool _ZN6Point2Eeq{L}(struct _Z6Point2 *this, struct _Z6Point2 b) = \at((_Bool)(this->x==b.x && this->y == b.y),L); */ void _ZN6Point2EC1(struct _Z6Point2 *this) { this->x = 0; this->y = 0; return; } /*@ ensures _ZN6Point2Eeq(\old(this), *\old(p)) != 0; assigns this->x, this->y; */ void _ZN6Point2EC1RK6Point2(struct _Z6Point2 *this, struct _Z6Point2 const *p) { this->x = p->x; this->y = p->y; return; } frama-c-20.0-Calcium/tests/spec/abrupt.i0000666000000000000000000000146013571573400014757 0ustar /* run.config STDOPT: +"-simplify-cfg" */ int f (int c) { int x = 0; switch (c) { /*@ breaks x == 1; */ { case 0: x = 1; break; case 1: x = 3; case 2: x++; default: x++; }} while (1) { /*@ breaks x == \old(x); continues x == \old(x) + 1; */ { if (x < c) { x++; continue; } break; } } return x; } /*@ ensures x==1 ==> \result==1; */ int f5 (int x){ int y = 0; switch (x) { case 1 : while (x>0) /*@ breaks x > 0; */ break ; y = 1; } return y; } int job_inline(int a) { if (a > 10) return 10; if (a > 20) return 20; /*@ returns \result == 0; ensures \false; */ return 0; } int job_block(int a) { if (a > 10) return 10; if (a > 20) return 20; /*@ returns \result == 0; ensures \false; */ { return 0; } } frama-c-20.0-Calcium/tests/spec/acsl_allocator.c0000666000000000000000000003165013571573400016442 0ustar /* run.config DONTRUN: annotations grammar needs update. */ /*****************************************************************************/ /* Attempt to define a running example for ACSL (Ansi C Specification */ /* Language), much as the Purse example in JML description papers. */ /* It is a memory allocator, whose main functions are [memory_alloc] and */ /* [memory_free], to respectively allocate and deallocate memory. */ /* The goal is to exercise as much as possible of ACSL. */ /* This file presents the more complex version of the allocator. */ /*****************************************************************************/ #include #define DEFAULT_BLOCK_SIZE 1000 typedef enum _bool { false = 0, true = 1 } bool; /*@ predicate finite_list((a* -> a*) next_elem, a* ptr) { @ ptr == \null || (\valid(ptr) && finite_list(next_elem(ptr))) @ } @ @ logic int list_length((a* -> a*) next_elem, a* ptr) { @ (ptr == \null) ? 0 : 1 + list_length(next_elem(ptr)) @ } @ @ predicate lower_length((a* -> a*) next_elem, a* ptr1, a* ptr2) { @ finite_list(next_elem, ptr1) && finite_list(next_elem, ptr2) @ && list_length(next_elem, ptr1) < list_length(next_elem, ptr2) @ } */ // forward reference struct _memory_slice; /* A memory block holds a pointer to a raw block of memory allocated by * calling [malloc]. It is sliced into chunks, which are maintained by * the [slice] structure. It maintains additional information such as * the [size] of the memory block, the number of bytes [used] and the [next] * index at which to put a chunk. */ typedef struct _memory_block { //@ ghost bool packed; // ghost field [packed] is meant to be used as a guard that tells when // the invariant of a structure of type [memory_block] holds unsigned int size; // size of the array [data] unsigned int next; // next index in [data] at which to put a chunk unsigned int used; // how many bytes are used in [data], not necessarily contiguous ones char* data; // raw memory block allocated by [malloc] struct _memory_slice* slice; // structure that describes the slicing of a block into chunks } memory_block; /*@ type invariant inv_memory_block(memory_block mb) { @ mb.packed ==> @ (0 < mb.size && mb.used <= mb.next <= mb.size @ && \offset(mb.data) == 0 @ && \block_length(mb.data) == mb.size) @ } @ @ predicate valid_memory_block(memory_block* mb) { @ \valid(mb) && mb->packed @ } */ /* A memory chunk holds a pointer [data] to some part of a memory block * [block]. It maintains the [offset] at which it points in the block, as well * as the [size] of the block it is allowed to access. A field [free] tells * whether the chunk is used or not. */ typedef struct _memory_chunk { //@ ghost bool packed; // ghost field [packed] is meant to be used as a guard that tells when // the invariant of a structure of type [memory_chunk] holds unsigned int offset; // offset at which [data] points into [block->data] unsigned int size; // size of the chunk bool free; // true if the chunk is not used, false otherwise memory_block* block; // block of memory into which the chunk points char* data; // shortcut for [block->data + offset] } memory_chunk; /*@ type invariant inv_memory_chunk(memory_chunk mc) { @ mc.packed ==> @ (0 < mc.size && valid_memory_block(mc.block) @ && mc.offset + mc.size <= mc.block->next) @ } @ @ predicate valid_memory_chunk(memory_chunk* mc, int s) { @ \valid(mc) && mc->packed && mc->size == s @ } @ @ predicate used_memory_chunk(memory_chunk mc) { @ mc.free == false @ } @ @ predicate freed_memory_chunk(memory_chunk mc) { @ mc.free == true @ } */ /* A memory chunk list links memory chunks in the same memory block. * Newly allocated chunks are put first, so that the offset of chunks * decreases when following the [next] pointer. Allocated chunks should * fill the memory block up to its own [next] index. */ typedef struct _memory_chunk_list { memory_chunk* chunk; // current list element struct _memory_chunk_list* next; // tail of the list } memory_chunk_list; /*@ \let next_chunk = \lambda memory_chunk_list* ptr; ptr->next ; @ @ predicate valid_memory_chunk_list @ (memory_chunk_list* mcl, memory_block* mb) { @ \valid(mcl) && valid_memory_chunk(mcl->chunk,mcl->chunk->size) @ && mcl->chunk->block == mb @ && (mcl->next == \null || valid_memory_chunk_list(mcl->next, mb)) @ && mcl->offset == mcl->chunk->offset @ && ( @ // it is the last chunk in the list @ (mcl->next == \null && mcl->chunk->offset == 0) @ || @ // it is a chunk in the middle of the list @ (mcl->next != \null @ && mcl->next->chunk->offset + mcl->next->chunk->size @ == mcl->chunk->offset) @ ) @ && finite_list(next_chunk, mcl) @ } @ @ predicate valid_complete_chunk_list @ (memory_chunk_list* mcl, memory_block* mb) { @ valid_memory_chunk_list(mcl,mb) @ && mcl->next->chunk->offset + mcl->next->chunk->size == mb->next @ } @ @ predicate chunk_lower_length(memory_chunk_list* ptr1, @ memory_chunk_list* ptr2) { @ lower_length(next_chunk, ptr1, ptr2) @ } */ /* A memory slice holds together a memory block [block] and a list of chunks * [chunks] on this memory block. */ typedef struct _memory_slice { //@ ghost bool packed; // ghost field [packed] is meant to be used as a guard that tells when // the invariant of a structure of type [memory_slice] holds memory_block* block; memory_chunk_list* chunks; } memory_slice; /*@ type invariant inv_memory_slice(memory_slice* ms) { @ ms.packed ==> @ (valid_memory_block(ms->block) && ms->block->slice == ms @ && (ms->chunks == \null @ || valid_complete_chunk_list(ms->chunks, ms->block))) @ } @ @ predicate valid_memory_slice(memory_slice* ms) { @ \valid(ms) && ms->packed @ } */ /* A memory slice list links memory slices, to form a memory pool. */ typedef struct _memory_slice_list { //@ ghost bool packed; // ghost field [packed] is meant to be used as a guard that tells when // the invariant of a structure of type [memory_slice_list] holds memory_slice* slice; // current list element struct _memory_slice_list* next; // tail of the list } memory_slice_list; /*@ \let next_slice = \lambda memory_slice_list* ptr; ptr->next ; @ @ type invariant inv_memory_slice_list(memory_slice_list* msl) { @ msl.packed ==> @ (valid_memory_slice(msl->slice) @ && (msl->next == \null || valid_memory_slice_list(msl->next)) @ && finite_list(next_slice, msl)) @ } @ @ predicate valid_memory_slice_list(memory_slice_list* msl) { @ \valid(msl) && msl->packed @ } @ @ predicate slice_lower_length(memory_slice_list* ptr1, @ memory_slice_list* ptr2) { @ \let next_slice = \lambda memory_slice_list* ptr; ptr->next ; @ lower_length(next_slice, ptr1, ptr2) @ } */ typedef memory_slice_list* memory_pool; /*@ type invariant valid_memory_pool(memory_pool *mp) { @ \valid(mp) && valid_memory_slice_list(*mp) @ } */ /*@ behavior zero_size: @ assumes s == 0; @ assigns \empty; @ ensures \result == 0; @ @ behavior positive_size: @ assumes s > 0; @ requires valid_memory_pool(arena); @ ensures \result == 0 @ || (valid_memory_chunk(\result,s) && used_memory_chunk(*\result)); @ */ memory_chunk* memory_alloc(memory_pool* arena, unsigned int s) { memory_slice_list *msl = *arena; memory_chunk_list *mcl; memory_slice *ms; memory_block *mb; memory_chunk *mc; unsigned int mb_size; //@ ghost unsigned int mcl_offset; char *mb_data; // guard condition if (s == 0) return 0; // iterate through memory blocks (or slices) /*@ @ loop invariant valid_memory_slice_list(msl); @ loop variant msl for slice_lower_length; @ */ while (msl != 0) { ms = msl->slice; mb = ms->block; mcl = ms->chunks; // does [mb] contain enough free space? if (s <= mb->size - mb->next) { //@ ghost ms->ghost = false; // unpack the slice // allocate a new chunk mc = (memory_chunk*)malloc(sizeof(memory_chunk)); if (mc == 0) return 0; mc->offset = mb->next; mc->size = s; mc->free = false; mc->block = mb; //@ ghost mc->ghost = true; // pack the chunk // update block accordingly //@ ghost mb->ghost = false; // unpack the block mb->next += s; mb->used += s; //@ ghost mb->ghost = true; // pack the block // add the new chunk to the list mcl = (memory_chunk_list*)malloc(sizeof(memory_chunk_list)); if (mcl == 0) return 0; mcl->chunk = mc; mcl->next = ms->chunks; ms->chunks = mcl; //@ ghost ms->ghost = true; // pack the slice return mc; } // iterate through memory chunks /*@ @ loop invariant valid_memory_chunk_list(mcl,mb); @ loop variant mcl for chunk_lower_length; @ */ while (mcl != 0) { mc = mcl->chunk; // is [mc] free and large enough? if (mc->free && s <= mc->size) { mc->free = false; mb->used += mc->size; return mc; } // try next chunk mcl = mcl->next; } msl = msl->next; } // allocate a new block mb_size = (DEFAULT_BLOCK_SIZE < s) ? s : DEFAULT_BLOCK_SIZE; mb_data = (char*)malloc(mb_size); if (mb_data == 0) return 0; mb = (memory_block*)malloc(sizeof(memory_block)); if (mb == 0) return 0; mb->size = mb_size; mb->next = s; mb->used = s; mb->data = mb_data; //@ ghost mb->ghost = true; // pack the block // allocate a new chunk mc = (memory_chunk*)malloc(sizeof(memory_chunk)); if (mc == 0) return 0; mc->offset = 0; mc->size = s; mc->free = false; mc->block = mb; //@ ghost mc->ghost = true; // pack the chunk // allocate a new chunk list mcl = (memory_chunk_list*)malloc(sizeof(memory_chunk_list)); if (mcl == 0) return 0; //@ ghost mcl->offset = 0; mcl->chunk = mc; mcl->next = 0; // allocate a new slice ms = (memory_slice*)malloc(sizeof(memory_slice)); if (ms == 0) return 0; ms->block = mb; ms->chunks = mcl; //@ ghost ms->ghost = true; // pack the slice // update the block accordingly mb->slice = ms; // add the new slice to the list msl = (memory_slice_list*)malloc(sizeof(memory_slice_list)); if (msl == 0) return 0; msl->slice = ms; msl->next = *arena; //@ ghost msl->ghost = true; // pack the slice list *arena = msl; return mc; } /*@ behavior null_chunk: @ assumes chunk == \null; @ assigns \empty; @ @ behavior valid_chunk: @ assumes chunk != \null; @ requires valid_memory_pool(arena); @ requires valid_memory_chunk(chunk,chunk->size); @ requires used_memory_chunk(chunk); @ ensures @ // if it is not the last chunk in the block, mark it as free @ (valid_memory_chunk(chunk,chunk->size) @ && freed_memory_chunk(chunk)) @ || @ // if it is the last chunk in the block, deallocate the block @ ! \valid(chunk); @ */ void memory_free(memory_pool* arena, memory_chunk* chunk) { memory_slice_list *msl = *arena; memory_block *mb = chunk->block; memory_slice *ms = mb->slice; memory_chunk_list *mcl; memory_chunk *mc; // is it the last chunk in use in the block? if (mb->used == chunk->size) { // remove the corresponding slice from the memory pool // case it is the first slice if (msl->slice == ms) { *arena = msl->next; //@ ghost msl->ghost = false; // unpack the slice list free(msl); } // case it is not the first slice while (msl != 0) { if (msl->next != 0 && msl->next->slice == ms) { memory_slice_list* msl_next = msl->next; msl->next = msl->next->next; // unpack the slice list //@ ghost msl_next->ghost = false; free(msl_next); break; } msl = msl->next; } //@ ghost ms->ghost = false; // unpack the slice // deallocate all chunks in the block mcl = ms->chunks; // iterate through memory chunks /*@ @ loop invariant valid_memory_chunk_list(mcl,mb); @ loop variant mcl for chunk_lower_length; @ */ while (mcl != 0) { memory_chunk_list *mcl_next = mcl->next; mc = mcl->chunk; //@ ghost mc->ghost = false; // unpack the chunk free(mc); free(mcl); mcl = mcl_next; } mb->next = 0; mb->used = 0; // deallocate the memory block and its data //@ ghost mb->ghost = false; // unpack the block free(mb->data); free(mb); // deallocate the corresponding slice free(ms); return; } // mark the chunk as freed chunk->free = true; // update the block accordingly mb->used -= chunk->size; return; } frama-c-20.0-Calcium/tests/spec/acsl_basic_allocator.c0000666000000000000000000000613413571573400017602 0ustar /*****************************************************************************/ /* Attempt to define a running example for ACSL (Ansi C Specification */ /* Language), much as the Purse example in JML description papers. */ /* It is a memory allocator, whose main functions are [memory_alloc] and */ /* [memory_free], to respectively allocate and deallocate memory. */ /* The goal is to exercise as much as possible of ACSL. */ /* This file presents the basic version of the allocator. */ /*****************************************************************************/ #include "share/libc/stdlib.h" #define DEFAULT_BLOCK_SIZE 1000 typedef enum _bool { false = 0, true = 1 } bool; typedef struct _memory_block { size_t size; bool free; char* data; } memory_block; /*@ type invariant inv_memory_block(memory_block mb) = @ 0 < mb.size && \offset(mb.data) == 0 && \block_length{Here}(mb.data) == mb.size ; @*/ /*@ predicate used_memory_block{L}(memory_block mb) = @ mb.free == false && inv_memory_block(mb) ; @*/ /*@ predicate freed_memory_block{L}(memory_block mb) = @ mb.free == true && inv_memory_block(mb) ; @*/ /*@ predicate valid_memory_block{L}(memory_block* mb) = @ \valid(mb) && inv_memory_block(*mb) ; @*/ /*@ predicate valid_used_memory_block{L}(memory_block* mb) = @ \valid(mb) && used_memory_block(*mb) ; @*/ /*@ predicate valid_freed_memory_block{L}(memory_block* mb) = @ \valid(mb) && freed_memory_block(*mb) ; @*/ typedef struct _memory_block_list { memory_block* block; struct _memory_block_list* next; } memory_block_list; /*@ predicate valid_memory_block_list{L}(memory_block_list* mbl) = @ \valid(mbl) && valid_memory_block(mbl->block) @ && (mbl->next == \null || valid_memory_block_list(mbl->next)) ; @*/ typedef memory_block_list* memory_pool; /*@ predicate valid_memory_pool{L}(memory_pool *mp) = @ \valid(mp) && valid_memory_block_list(*mp) ; @*/ /*@ requires valid_memory_pool(arena) && 0 < s; @ ensures valid_used_memory_block(\result); @ */ memory_block* memory_alloc(memory_pool* arena, size_t s) { memory_block_list *mbl = *arena; memory_block *mb; size_t mb_size; char *mb_data; // iterate through memory blocks while (mbl != 0) { mb = mbl->block; // is [mb] free and large enough? if (mb->free && s <= mb->size) { mb->free = false; return mb; } // try next block mbl = mbl->next; } // allocate a new block mb_size = (DEFAULT_BLOCK_SIZE < s) ? s : DEFAULT_BLOCK_SIZE; mb_data = (char*)malloc(mb_size); mb = (memory_block*)malloc(sizeof(memory_block)); mb->size = mb_size; mb->free = false; mb->data = mb_data; // add the new block to the arena mbl = (memory_block_list*)malloc(sizeof(memory_block_list)); mbl->block = mb; mbl->next = *arena; *arena = mbl; return mb; } /*@ requires valid_memory_pool(arena) && valid_used_memory_block(block); @ ensures valid_freed_memory_block(block); @ */ void memory_free(memory_pool* arena, memory_block* block) { block->free = true; } frama-c-20.0-Calcium/tests/spec/acsl_by_example.c0000666000000000000000000002452213571573400016607 0ustar /*@ predicate is_valid_int_range(int* p, int n) = (0 <= n) && \valid_range(p,0,n-1); lemma foo: \forall int* p,n; is_valid_int_range(p,n) <==> \valid_range(p,0,n-1); */ /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); assigns \nothing; behavior all_equal: assumes \forall int i; 0 <= i < n ==> a[i] == b[i]; ensures \result == 1; behavior some_not_equal: assumes \exists int i; 0 <= i < n && a[i] != b[i]; ensures \result == 0; complete behaviors all_equal, some_not_equal; disjoint behaviors all_equal, some_not_equal; */ int equal(const int* a, int n, const int* b) { /*@ loop invariant 0 <= i <= n; loop invariant \forall int k; 0 <= k < i ==> a[k] == b[k]; loop variant n-i; */ for (int i = 0; i < n; i++) if (a[i] != b[i]) return 0; return 1; } /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior some: assumes \exists int i; 0 <= i < n && a[i] == val; ensures 0 <= \result < n; ensures a[\result] == val; ensures \forall int i; 0 <= i < \result ==> a[i] != val; behavior none: assumes \forall int i; 0 <= i < n ==> a[i] != val; ensures \result == n; complete behaviors some, none; disjoint behaviors some, none; */ int find(const int* a, int n, int val) { /*@ loop invariant 0 <= i <= n; loop invariant \forall int k; 0 <= k < i ==> a[k] != val; loop variant n-i; */ for (int i = 0; i < n; i++) if (a[i] == val) return i; return n; } /*@ predicate found{A}(int* a, int n, int val) = \exists int i; 0 <= i < n && a[i] == val; */ /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior some: assumes found(a, n, val); ensures 0 <= \result < n; ensures a[\result] == val; ensures !found(a, \result, val); behavior none: assumes !found(a, n, val); ensures \result == n; complete behaviors some, none; disjoint behaviors some, none; */ int find2(const int* a, int n, int val) { /*@ loop invariant 0 <= i <= n; loop invariant !found(a, i, val); loop variant n-i; */ for (int i = 0; i < n; i++) if (a[i] == val) return i; return n; } /*@ predicate found_first_of{A}(int* a, int m, int* b, int n) = \exists int i; 0 <= i < m && found{A}(b, n, \at(a[i],A)); */ /*@ requires is_valid_int_range(a, m); requires is_valid_int_range(b, n); assigns \nothing; behavior found: assumes found_first_of(a, m, b, n); ensures 0 <= \result < m; ensures found(b, n, a[\result]); ensures !found_first_of(a, \result, b, n); behavior not_found: assumes !found_first_of(a, m, b, n); ensures \result == m; complete behaviors found, not_found; disjoint behaviors found, not_found; */ int find_first_of(const int* a, int m, const int* b, int n) { /*@ loop invariant 0 <= i <= m; loop invariant !found_first_of(a, i, b, n); loop variant m-i; */ for(int i = 0; i < m; i++) if (find(b, n, a[i]) < n) return i; return m; } /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior empty: assumes n == 0; ensures \result == 0; behavior not_empty: assumes 0 < n; ensures 0 <= \result < n; ensures \forall int i; 0 <= i < n ==> a[i] <= a[\result]; ensures \forall int i; 0 <= i < \result ==> a[i] < a[\result]; complete behaviors empty, not_empty; disjoint behaviors empty, not_empty; */ int max_element(const int* a, int n) { if (n == 0) return 0; int max = 0; /*@ loop invariant 0 <= i <= n; loop invariant 0 <= max < n; loop invariant \forall int k; 0 <= k < i ==> a[k] <= a[max]; loop invariant \forall int k; 0 <= k < max ==> a[k] < a[max]; loop variant n-i; */ for (int i = 0; i < n; i++) if (a[max] < a[i]) max = i; return max; } /*@ requires n > 0; requires \valid(p+ (0..n-1)); assigns \nothing; ensures \forall int i; 0 <= i <= n-1 ==> \result >= p[i]; ensures \exists int e; 0 <= e <= n-1 && \result == p[e]; */ int max_seq(const int* p, int n) { return p[max_element(p, n)]; } /*@ axiomatic counting_axioms { logic integer counting{L}(int* a, integer n, int val) reads a[0..n-1]; axiom counting_empty{L}: \forall int* a, integer n, int val; n <= 0 ==> counting(a, n, val) == 0; axiom counting_hit{L}: \forall int* a, integer n, int val; n >= 0 && a[n] == val ==> counting(a, n+1, val) == counting(a, n, val) + 1; axiom counting_miss{L}: \forall int* a, integer n, int val; n >= 0 && a[n] != val ==> counting(a, n+1, val) == counting(a, n, val); } */ /*@ requires is_valid_int_range(a, n); assigns \nothing; ensures \result == counting(a, n, val); */ int count(const int* a, int n, int val) { int cnt = 0; /*@ loop invariant 0 <= i <= n; loop invariant 0 <= cnt <= i; loop invariant cnt == counting(a, i, val); loop variant n-i; */ for (int i = 0; i < n; i++) if (a[i] == val) cnt++; return cnt; } /*@ requires \valid(p); requires \valid(q); assigns *p; assigns *q; ensures *p == \old(*q); ensures *q == \old(*p); */ void swap(int* p, int* q) { int const save = *p; *p = *q; *q = save; } /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); //requires \separated(a, b); assigns a[0..n-1]; assigns b[0..n-1]; ensures \forall int k; 0 <= k < n ==> a[k] == \old(b[k]); ensures \forall int k; 0 <= k < n ==> b[k] == \old(a[k]); */ void swap_ranges(int* a, int n, int* b) { /*@ loop assigns a[0..i-1]; loop assigns b[0..i-1]; loop invariant 0 <= i <= n; loop invariant \forall int k; 0 <= k < i ==> a[k] == \at(b[k],Pre); loop invariant \forall int k; 0 <= k < i ==> b[k] == \at(a[k],Pre); loop variant n-i; */ for (int i = 0; i < n; i++) swap(&a[i], &b[i]); } /*@ requires is_valid_int_range(a, n); assigns a[0..n-1]; ensures \forall int i; 0 <= i < n ==> a[i] == val; */ void fill(int* a, int n, int val) { /*@ loop invariant 0 <= i <= n; loop invariant \forall int k; 0 <= k < i ==> a[k] == val; loop variant n-i; */ for (int i = 0; i < n; i++) a[i] = val; } /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); assigns b[0..n-1]; ensures \forall int i; 0 <= i < n ==> b[i] == a[i]; */ void copy(const int* a, int n, int* b) { /*@ loop assigns b[0..i-1]; loop invariant 0 <= i <= n; loop invariant \forall int k; 0 <= k < i ==> a[k] == b[k]; loop variant n-i; */ for (int i = 0; i < n; ++i) b[i] = a[i]; } /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); assigns b[0 .. n-1]; ensures \forall int j; 0 <= j < n ==> a[j] == old_val && b[j] == new_val || a[j] != old_val && b[j] == a[j]; ensures \result == n; */ int replace_copy(const int* a, int n, int* b, int old_val, int new_val) { /*@ loop assigns b[0..i-1]; loop invariant 0 <= i <= n; loop invariant \forall int j; 0 <= j < i ==> a[j] == old_val && b[j] == new_val || a[j] != old_val && b[j] == a[j]; loop variant n-i; */ for (int i = 0; i < n; ++i) b[i] = (a[i] == old_val ? new_val : a[i]); return n; } /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); assigns b[0 .. n-1]; ensures \forall int k; \result <= k < n ==> b[k] == \old(b[k]); ensures \forall int k; 0 <= k < \result ==> b[k] != val; ensures \forall int x; x != val ==> counting(a, n, x) == counting(b, \result, x); ensures \result == n - counting(a, n, val); ensures 0 <= \result <= n; */ int remove_copy(const int* a, int n, int* b, int val) { int j = 0; /*@ loop assigns b[0..j-1]; loop invariant 0 <= j <= i <= n; loop invariant \forall int k; j <= k < n ==> b[k] == \at(b[k],Pre); loop invariant \forall int k; 0 <= k < j ==> b[k] != val; loop invariant \forall int x; x != val ==> counting(a,i,x) == counting(b,j,x); loop invariant j == i - counting(a,i,val); loop variant n-i; */ for (int i = 0; i < n; ++i) if (a[i] != val) b[j++] = a[i]; return j; } /*@ requires is_valid_int_range(a, n); requires val + n < ((1<<31)-1); // INT_MAX; assigns a[0..n-1]; ensures \forall int k; 0 <= k < n ==> a[k] == val + k; */ void iota(int* a, int n, int val) { /*@ loop assigns a[0..i-1]; loop invariant 0 <= i <= n; loop invariant \forall int k; 0 <= k < i ==> a[k] == val+k; loop variant n-i; */ for(int i = 0; i < n; ++i) a[i] = val + i; } /*@ predicate adjacent_found{Label}(int* a, int n) = \exists int i; 0 <= i < n-1 && a[i] == a[i+1]; */ /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior some: assumes adjacent_found(a, n); ensures 0 <= \result < n-1; ensures a[\result] == a[\result+1]; ensures !adjacent_found(a, \result); behavior none: assumes !adjacent_found(a, n); ensures \result == n; complete behaviors some, none; disjoint behaviors some, none; */ int adjacent_find(int* a, int n) { if (0 == n) return n; /*@ loop invariant 0 <= i < n; loop invariant !adjacent_found(a, i); loop invariant 0 < i ==> a[i-1] != a[i]; loop variant n-i; */ for (int i = 0; i < n-1; i++) if (a[i] == a[i+1]) return i; return n; } /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior empty: assumes n == 0; ensures \result == 0; behavior not_empty: assumes 0 < n; ensures 0 <= \result < n; ensures \forall int i; 0 <= i < n ==> a[\result] <= a[i]; ensures \forall int i; 0 <= i < \result ==> a[\result] < a[i]; */ int min_element(int* a, int n) { if (0 == n) return n; int min = 0; /*@ loop invariant 0 <= i <= n; loop invariant 0 <= min < n; loop invariant \forall int k; 0 <= k < i ==> a[min] <= a[k]; loop invariant \forall int k; 0 <= k < min ==> a[min] < a[k]; loop variant n-i; */ for (int i = 0; i < n; i++) if (a[i] < a[min]) min = i; return min; } frama-c-20.0-Calcium/tests/spec/add_global.i0000666000000000000000000000024713571573400015534 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print */ int main () { return 0; } frama-c-20.0-Calcium/tests/spec/add_global.ml0000666000000000000000000000170413571573400015713 0ustar open Cil_types let emitter = Emitter.create "Fancy" [ Emitter.Global_annot ] ~correctness:[] ~tuning:[] class vis prj = object(self) inherit Visitor.frama_c_copy prj method! vglob_aux g = match g with | GFun ({ svar = { vname = "main" }},_) -> let ax = Daxiomatic ("MyAxiomatic", [ Dlemma( "myaxiom", true, [], [], Logic_const.ptrue, [], Cil_datatype.Location.unknown)], [], Cil_datatype.Location.unknown) in Queue.add (fun () -> Annotations.add_global emitter ax) self#get_filling_actions; Cil.ChangeDoChildrenPost ([ GAnnot(ax, Cil_datatype.Location.unknown); g ], fun x -> x) | _ -> Cil.DoChildren end let transform () = Ast.compute (); let prj = File.create_project_from_visitor "prj" (fun prj -> new vis prj) in Project.on prj Filecheck.check_ast "prj"; File.pretty_ast ~prj () let () = Db.Main.extend transform frama-c-20.0-Calcium/tests/spec/all.c0000666000000000000000000000655413571573400014235 0ustar /* Terms */ /*@ lemma z: \forall int x ; (x & x) == x ; */ // OK /*@ lemma a: \forall int x ; (x --> x) == -1 ; */ // OK /*@ lemma b: \forall int x ; (x <--> x) == -1 ; */ // OK /*@ lemma c: (\let x = 0 ; x+1) == 1 ; */ // OK /*@ lemma d: (name:77) == 76+1 ; */ // OK /* Predicates */ /*@ axiomatic Test { predicate P ; // OK predicate Q ; // OK axiom e: P ^^ Q ; // OK axiom f: 0?P:Q; // OK axiom g: P?P:Q; // OK axiom h: \let x = 0 ; x+1 == 1 ; // OK axiom i: name:77 == 76+1 ; // OK } */ /*@ predicate R(integer i, integer j) = (1?i+j:j:j)==i+j;*/ // OK /*@ predicate S(integer i, integer j) = (1?(i:j):j)==j; */ // OK /*@ predicate T(integer i, integer j) = (1?i:j)==i; */ // OK /*@ lemma tauto: 0?T(0,0):R(1,2); */ // OK /*@ lemma tauto2: R(0,1)?S(3,4):T(5,6); */ // OK /*@ lemma reject_1 : 0 != 1 != 2 ; */ // OK /*@ lemma hex_oct : 0xFFFFUl != 06666uL ; */ // OK /*@ requires \offset(p) == 0; // OK behavior b : assumes \true; requires \valid(p); ensures 0 == 1 ; assigns *p \from G ; */ // OK void h(int G,int*p) ; /*@ behavior b : assumes \true; requires \valid(p); ensures 0 == 1 ; assigns *p \from G = G + 77; */ // KO (functional update void f(int G,int*p) { //@ for ZZZ_INEXISTENT_BEHAVIOR : assert \false ; // OK //@ assert \false ; // OK /*@ assert \base_addr(&G) == \base_addr(&G) ; */ // OK /*@ assert \block_length(&G) == 4 ; */ // OK /*@ assert \block_length(&G) == sizeof(G) ; */ // OK /*@ assert \base_addr(&G)+\offset(&G+4) == (char*)(&G+4); */ // OK /*@ assert \null != &G ; */ // OK /*@ loop invariant &G != \null; */ // OK do G++; while (0) ; *p = G + 76; } struct st { int a, b ; } ; /*@ axiomatic St { logic struct st fl(struct st s) ; } */ //OK /*@ ensures fl(s).a == \result.a ; */ // OK struct st fc (struct st s) {return s;} void fd(char *x) { /*@ assert (const char*)x == (char * const) x; */ x="abcdef"; //@ assert !\valid(x) && \valid_read(x); // OK return; } /*@ ensures \result==0; */ // should be rejected: not a function int x = 0; /*@ logic integer x = 1 ; */ // OK /*@ axiomatic Test2 {logic integer y ;} */ // OK /*@ logic integer z = \let f = \lambda integer a ; a + 1; f(12) ; */ // OK /*@ logic a id(a x) = x; */ // OK /*@ logic integer z1 = \max(5,10,id) ; */ // OK /*@ logic integer z2 = \min(5,10,id) ; */ // OK /*@ logic integer z3 = \sum(5,10,id) ; */ // OK /*@ logic integer z4 = \product(5,10,id) ; */ // OK /*@ logic integer z5 = \numof(0,10,\lambda integer i; 3<=i<=5) ; */ // OK /* ALL CONCRETE LOGIC TYPES */ frama-c-20.0-Calcium/tests/spec/alloc_string_marshall.c0000666000000000000000000000546613571573400020031 0ustar /* run.config DONTRUN: no annotation here! */ /*****************************************************************************/ /* Attempt to define a running example for ACSL (Ansi C Specification */ /* Language), much as the Purse example in JML description papers. */ /* The goal is to exercise as much as possible of ACSL. */ /*****************************************************************************/ #define N 10000 enum error_tag { MARSHALL_ERROR = 1, ALLOC_ERROR = 2, MESSAGE_ERROR = 3, }; /* Allocation */ static char heap[N]; static char *pos = heap; static char *end = heap + N; char* alloc(unsigned int n) { char *cur = pos; char *next = pos + n; if (next > end) return 0; pos = next; return cur; } /* Strings */ unsigned int strlen(char *s) { unsigned int size = 0; while (*s++ != '\0') { size++; } return size; } char* strcpy(char* dest, char* src) { char *cur = dest; while (*src != '\0') { *cur++ = *src++; } return dest; } /* Marshalling */ enum marshall_tag { MARSHALL_INT = 1, MARSHALL_STRING = 2, }; char *marshall_int(char* p, int i) { char *dest = p; char *src = (char*)&i; char *end; *dest++ = MARSHALL_INT; end = dest + sizeof(int); while (dest < end) { *dest++ = *src++; } return dest; } char *marshall_string(char* p, char* s) { char *dest = p; char *src = s; *dest++ = MARSHALL_STRING; strcpy(dest,src); return dest; } char* unmarshall_int(char* p, int* i) { char *src = p; char *dest = (char*)i; char *end; if (*src != MARSHALL_INT) return 0; src++; end = dest + sizeof(int); while (dest < end) { *dest++ = *src++; } return src; } char* unmarshall_string(char* p, char** s) { char *src = p; char *dest; int size; if (*src != MARSHALL_STRING) return 0; src++; size = strlen(src); *s = alloc(size + 1); if (s == 0) return 0; dest = *s; strcpy(dest,src); src += size + 1; return src; } /* Messages */ struct Msg { int level; char* text; }; char* msg_create(struct Msg* s) { char *msg = alloc(2 + sizeof(int) + strlen(s->text) + 1); char *p = msg; if (p == 0) return 0; p = marshall_int(p,s->level); if (p == 0) return 0; p = marshall_string(p,s->text); if (p == 0) return 0; return msg; } int msg_receive(char* p, struct Msg* s) { p = unmarshall_int(p,&s->level); if (p == 0) return MESSAGE_ERROR; p = unmarshall_string(p,&s->text); if (p == 0) return MESSAGE_ERROR; return 0; } /* Test */ int main(int argc, char** argv) { struct Msg m1; struct Msg m2; char *msg; int iter, status; for (iter = 0; iter < argc; iter++) { m1.level = iter; m1.text = argv[iter]; msg = msg_create(&m1); if (msg == 0) return MESSAGE_ERROR; status = msg_receive(msg,&m2); if (status != 0) return MESSAGE_ERROR; } return 0; } frama-c-20.0-Calcium/tests/spec/allocates.i0000666000000000000000000000114513571573400015431 0ustar int *p,*q,*r; /*@ //idem allocates \nothing @ behavior a: requires *p==0 ; //idem allocates \everything; */ void f1 (void) { return ; } /*@ requires !q ; //idem allocates \nothing @ behavior a: requires p; frees p ; */ void f2 (void) { return ; } /*@ requires i<0 ; //idem allocates \nothing @ behavior a: requires p; frees r ; allocates q, \old(r); frees p ; */ void f3 (int i) { /*@ //idem loop allocates \nothing @ for a: loop invariant i <0; //idem loop allocates \everything; */ while (i) { i--; p++; } } frama-c-20.0-Calcium/tests/spec/annot_decl_bts1009.i0000666000000000000000000000015313571573400016750 0ustar void f() { //@ assert 0==0; int x; //@ ensures x==3; int y = x = 3; x = 0; y = 1; return; } frama-c-20.0-Calcium/tests/spec/annot_main.c0000666000000000000000000000014613571573400015577 0ustar /*@ requires \valid(p); ensures *p == 0; */ void main(int*p) { *p = 0; Frama_C_dump_each(); } frama-c-20.0-Calcium/tests/spec/array_conversion.c0000666000000000000000000000156413571573400017044 0ustar typedef int foo[4]; foo X = {0,1,2,3}; /*@ predicate p1(int* a) = \valid_range(a,0,3); */ /*@ predicate q1(int* a) = \valid(a + (0..3)); */ // [VP] Incompatible with the idea that foo denotes a logic array which can // not be seen as a pointer. /* @ lemma tauto: \forall foo a; p1(a) <==> q1(a); */ // There's a slight difference between the two following lemmas: the first // one speaks of the address of X, while the second speaks of the address of the // first element of X (the type is different in particular) /*@ lemma vaddrof: \valid(&X); */ /*@ lemma vaddrof2: \valid(&X[0]); */ /*@ lemma tauto1{L}: q1(X); */ /*@ requires p1(x); */ int f1(foo x) { return x[3]; } int g1() { return f1(X); } //@ axiomatic ax { logic boolean p{L}(int *b); } int a[10]; void ftest(void) { //@ assert p(&a[0]); //@ assert p( a ); } //@ lemma array_not_null: a != \null; frama-c-20.0-Calcium/tests/spec/array_prm.c0000666000000000000000000000021013571573400015440 0ustar /* see bug 131 */ void g(int a[]); /*@ predicate p(int *a) = \valid_index(a,0); */ /*@ requires p(a); */ void f(int a[]) { g(a); } frama-c-20.0-Calcium/tests/spec/array_typedef.c0000666000000000000000000000156513571573400016320 0ustar /*run.config OPT: -print -eva @EVA_CONFIG@ -journal-disable */ #define IP_FIELD 4 typedef int ip_address[IP_FIELD]; typedef struct { ip_address src; int dst[IP_FIELD]; } msg; /*@ assigns \empty; */ void send_addr(const ip_address addr); void send_msg(const msg *msg) { send_addr(msg->src); } void host_address(ip_address ip) { unsigned int i = sizeof (int [4]) / sizeof (int); ip[0] = 192; ip[1] = 100; ip[2] = 200; ip[i - 1] = 101; // @ assert ip[(sizeof (int [4]) / sizeof (int)) - 1] == 101; } void create_msg(msg *msg) { host_address(msg->src); host_address(msg->dst); //@ assert msg->dst[0] == 192; //@ assert msg->src[0] == 192; //@ assert msg->dst[(sizeof (ip_address) / sizeof (int)) - 1] == 101; // @ assert msg->src[(sizeof (int [4]) / sizeof (int)) - 1] == 101; } int main() { msg msg1; create_msg(&msg1); send_msg(&msg1); return 0; } frama-c-20.0-Calcium/tests/spec/assert_label.i0000666000000000000000000000057013571573400016123 0ustar /* run.config STDOPT: +"-copy" */ void bar () { //@ assert bli: \true; } void f() { L: //@ assert lab: \true; ; } void foo (int n) { switch (n) { case 4: /*@ assert "foo + bar" "=" @ "foobar": \true; */ break; case 5: //@ assert foo: \true; break; case 6: //@ assert bar: \true; case 7: //@ assert bla: \true; ; } } frama-c-20.0-Calcium/tests/spec/assign_in_spec.c0000666000000000000000000000004513571573400016436 0ustar //@ ensures \result = 1; int f(); frama-c-20.0-Calcium/tests/spec/assignable_location.i0000666000000000000000000000204713571573400017464 0ustar /* run.config OPT: -kernel-warn-key=annot-error=active */ typedef double typetab[2]; double f(typetab *t); int x; //@ assigns \result \from x; double annotations_to_accept(typetab *t) { //@ requires r0: \valid( t ) ; //@ requires r1: \valid( &*t ) ; //@ requires r2: \valid( (&*t) + (0..0) ) ; //@ requires r3: \valid( ((double *)t) + (0..1) ) ; //@ behavior b3: assigns ((double *)t)[0..1]; return f(t); } int g(void); //@ logic int lx = (int)0; extern typetab *t; //@ ensures to_reject: \fresh{Pre,Here}(&\result,sizeof(\result)); int annotations_to_reject(void) { //@ behavior to_reject_b0: assigns *t; //@ behavior to_reject_b1: assigns t[0]; //@ behavior to_reject_b2: assigns (&*t)[0..0]; //@ behavior to_reject_0: assigns (int)x; //@ behavior to_reject_1: assigns (char)x; //@ behavior to_reject_2: assigns *(int *)(&(char)x); //@ behavior to_reject_3: assigns; //@ behavior to_reject_4: requires \valid(&\empty); //@ behavior to_reject_5: assigns lx; //@ behavior to_reject_6: assigns x \from lx; return g(); } frama-c-20.0-Calcium/tests/spec/assigns.c0000666000000000000000000000147013571573400015124 0ustar struct list { int hd; struct list *next; }; /*@ predicate reachable{L}(struct list *root, struct list *to) = @ root == to || root != \null && reachable(root->next,to) ; @*/ int * q; //@ assigns *p; assigns *p,q; void reset(int *p) { *p = 0; } // three equivalent assigns clauses //@ assigns t[0..n-1]; void reset_array1(int t[],int n) { int i; for (i=0; i < n; i++) t[i] = 0; } //@ assigns *(t+(0..n-1)); void reset_array2(int t[],int n) { int i; for (i=0; i < n; i++) t[i] = 0; } //@ assigns *(t+{ i | int i ; 0 <= i < n }); void reset_array3(int t[],int n) { int i; for (i=0; i < n; i++) t[i] = 0; } //@ assigns { q->hd | struct list *q ; reachable(p,q) }; void incr_list(struct list *p) { while (p) { p->hd++ ; p = p->next; } } /*@ predicate is_empty (set s) = s == \empty; @*/ frama-c-20.0-Calcium/tests/spec/assigns_array.c0000666000000000000000000000167413571573400016330 0ustar /*@ ghost int ghost_loctable[100] ;*/ // The specification below should be rejected /*@ requires \valid(ghost_loctable + m); requires !ghost_loctable[m]; ensures ghost_loctable[m]; assigns ghost_loctable; */ void acquire_lock(int m) { /*@ ghost ghost_loctable[m]++; */ } // The specification above should be accepted /*@ requires \valid(ghost_loctable + m); requires ghost_loctable[m]==1; ensures !ghost_loctable[m]; assigns ghost_loctable[..]; */ void release_lock(int m) { /*@ ghost ghost_loctable[m]--; */ } int Tab[10]; /*@ requires n < 10 ; behavior foo: assumes reset; assigns Tab[0..n-1]; behavior bar: assumes !reset; assigns \nothing; */ int h(int reset, int n) { int i, r = 0 ; /*@ for foo: loop assigns Tab[0..i]; for bar: loop assigns \nothing; */ for (i = 0 ; i < n ; i++) { r += Tab[i] ; if (reset) Tab[i] = 0 ; } return r ; } frama-c-20.0-Calcium/tests/spec/assigns_from_kf.i0000666000000000000000000000204113571573400016630 0ustar /* run.config MODULE: @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -print */ void nothing(void); int nothing_r(void); void something_non_ghost(int *p); void something_ghost(void) /*@ ghost (int* p) */; int something_non_ghost_r(int *p); int something_ghost_r(void) /*@ ghost (int* p) */; void both(int *p, int x) /*@ ghost (int* gp, int gx) */; int both_r(int *p, int x) /*@ ghost (int* gp, int gx) */; /*@ ghost void g_nothing(void); int g_nothing_r(void); void g_something_non_ghost(int *p); int g_something_non_ghost_r(int *p); void g_both(int *p, int x, int *gp, int gx); int g_both_r(int *p, int x, int *gp, int gx); */ void reference(void) { nothing(); nothing_r(); something_non_ghost(0); something_ghost() /*@ ghost (0) */; something_non_ghost_r(0); something_ghost_r() /*@ ghost (0) */; both(0, 1) /*@ ghost (0, 2) */; both_r(0, 1) /*@ ghost (0, 2) */; /*@ ghost g_nothing(); g_nothing_r(); g_something_non_ghost(0); g_something_non_ghost_r(0); g_both(0, 1, 0, 2); g_both_r(0, 1, 0, 2); */ }frama-c-20.0-Calcium/tests/spec/assigns_from_kf.ml0000666000000000000000000000016013571573400017010 0ustar let run () = Globals.Functions.iter (fun kf -> ignore (Annotations.funspec kf)) let () = Db.Main.extend runframa-c-20.0-Calcium/tests/spec/assigns_result.i0000666000000000000000000000035313571573400016527 0ustar /* run.config STDOPT: +"-deps @EVA_OPTIONS@" */ int X,Y; /*@ assigns \result; assigns \exit_status; */ int f(void); /*@ assigns \result \from X; assigns \exit_status \from Y; */ int g(void); void main(void) { f(); g(); } frama-c-20.0-Calcium/tests/spec/assigns_void.c0000666000000000000000000000034513571573400016145 0ustar /* run.config OPT: -print -journal-disable -kernel-warn-key=annot-error=active OPT: -eva @EVA_CONFIG@ -main g -print -no-annot -journal-disable */ //@ assigns *x; void f(void *x); void g() { int y; int* x = &y; f(x); } frama-c-20.0-Calcium/tests/spec/assume.c0000666000000000000000000000045213571573400014751 0ustar //@ behavior b1: assumes x>=0; behavior b2: assumes x<=0; void f(int x); //@ disjoint behaviors b1, b2; void f(int x) { int * p,*q; //@ for b1,b2: behavior default: assumes \valid(p); // je ne veux pas vérifier cette assert q = p ; //@ assert \valid(q); // je veux vérifier cette assert } frama-c-20.0-Calcium/tests/spec/at.c0000666000000000000000000000234213571573400014060 0ustar int x; /*@ axiomatic A { predicate E(integer v) = x == v; predicate P{L1,L2}(integer i) = \at(x,L1) == \at(x,L2)+ i; predicate Q{L1,L2}(integer i) = \at(x == \at(x,L2)+ i,L1); axiom idem{L1,L2}: \forall integer i ; P{L1,L2}(i) <==> Q{L1,L2}(i); } */ /*@ ensures x == 2+\old(x)+y; ensures \at(E(\at(x-2-y,Here)),Pre); */ int f(int y) { x += y; L1: x++; //@ ghost L2: ; x++; //@ assert \at(x,L1) == \at(x,Pre)+y; //@ assert \at(x,L2) == 1+\at(x,Pre)+y; //@ assert P{Here,Pre}(2+y); return x; } void test () { int x = 0; L1: { int x = 1; L2: // assert below speaks about two distinct x. /*@ assert \at(&x, L1) != \at(&x,L2); */ x = 2; } } void ko (int z) { L: { int y = 0; // assert below should not typecheck: y is not in scope at L (nor at Pre) //@ assert KO: \at(y,L) == 0; //@ assert KO: \at(y,Pre) == 0; //@ assert KO: \at(z,Init) == 0; // at Init, only globals are in scope //@ assert OK: \at (x,Init) == 0; //@ assert OK: \at(z,Pre) == 0; } while (x>0) { int i = 1; x--; //@ assert KO: \at(i,LoopCurrent) == 1; //@ assert OK: \at(z,LoopCurrent) == \at(z,Pre); } } /* Local Variables: compile-command: "PPCHOME=../.. LC_ALL=C make at" End: */ frama-c-20.0-Calcium/tests/spec/at_exit.c0000666000000000000000000000134113571573400015107 0ustar /* run.config DONTRUN: support for discussion on atexit specification */ /* Asked question: * How to specify this code with ACSL ? */ #ifndef PTEST #include #else extern int printf (__const char *__restrict __format, ...); #endif #ifndef PTEST #include #else extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); #endif char *glob; int res; void test(void) { printf("%s (%d);\n", glob, res); } int main(int argc, char *argv[]) { atexit(test); res = argc - 2 ; if (res > 1) { glob = "exit"; exit (res); } glob = "return"; return res; } frama-c-20.0-Calcium/tests/spec/axiom_ignored_bts1116.i0000666000000000000000000000027113571573400017466 0ustar /*@ axiom l: // must be rejected as axiom outside an axiomatic \forall int i; i < 0; */ struct _str { int x; }; //@ ensures \result < 0; int ftest(int i) { return i; } frama-c-20.0-Calcium/tests/spec/axiom_included.c0000666000000000000000000000014513571573400016437 0ustar /* run.config STDOPT: +"tests/spec/axiom_included_1.c" */ #include "tests/spec/axiom_included.h" frama-c-20.0-Calcium/tests/spec/axiom_included.h0000666000000000000000000000005313571573400016442 0ustar /*@ axiomatic foo { axiom foo: \true; } */ frama-c-20.0-Calcium/tests/spec/axiom_included_1.c0000666000000000000000000000014613571573400016660 0ustar /* run.config DONTRUN: main test is in axiom_included.c */ #include "tests/spec/axiom_included.h" frama-c-20.0-Calcium/tests/spec/axiom_redef_bts1005.i0000666000000000000000000000016613571573400017124 0ustar /* must terminate with a type-checking error */ /*@ axiomatic Inj { axiom inj1: \true; axiom inj1: \true; } */ frama-c-20.0-Calcium/tests/spec/behavior_assert.c0000666000000000000000000000235713571573400016642 0ustar /* run.config OPT: -eva @EVA_CONFIG@ -deps -out -input -journal-disable -lib-entry OPT: -eva @EVA_CONFIG@ -deps -out -input -journal-disable */ int e; /*@ behavior b: assumes e==0; */ void f(void) { int x = 1; //@ for b: assert \false; x = 2; //@ for b: assert 1==1; x = 3; } int G; /*@ behavior be: assumes e==0; ensures G==3; */ void g(void) { int i=0 ; while (i < 3) //@ for be: invariant 0<=i<3; //@ for be: assert 0<=i<3; i++; G = i; } int abs(short x) { if (x <= 0) return -x; else return x; } /*@ behavior not_null: assumes a != 0; ensures \result > 0; behavior null: assumes a == 0; ensures \result == 0; complete behaviors not_null, null; */ int h1(short a) { int r = abs((a-a)+a); int r2 = r; /*@ for not_null: assert r != 0; */ return r; } extern int c; void h2 () { int a, b; if (c) if (c+1) if (c+2) a = -2; else a = 3; else a = -4; else a = -1; b = h1 (a); //@ assert b > 0; } /*@ behavior b: assumes e==0; behavior c: assumes e != 0; complete behaviors; */ void k(void) { //@ for c: assert \true; //@ for b: assert \false; } void main(int v) { if (v) f(); g(); h2(); k(); } frama-c-20.0-Calcium/tests/spec/behavior_names.c0000666000000000000000000000250313571573400016435 0ustar /*@ behavior foo: ensures \true; behavior bar: complete behaviors foo, bar, UNEXISTENT_BEHAVIOR; */ void f() { } /*@ predicate should_be_rejected = \true; */ /*@ predicate should_be_kept = \true; */ /*@ behavior foo: ensures \true; behavior bar: disjoint behaviors foo, bar, UNEXISTENT_BEHAVIOR; */ void g() { /*@ behavior foo: ensures \true; */ { /*@ for foo: assert should_be_kept; */ f(); /*@ for foo: assert should_be_kept; */ f(); } /*@ for foo: assert should_be_rejected; */ return; } /*@ behavior foo: ensures \true; behavior foo: ensures should_be_rejected; */ void h () { } /*@ behavior foo: ensures \true; */ void i () { //@ behavior foo: ensures should_be_rejected; ; } void j () { int x = 0; //@ behavior foo: ensures \true; { x++; //@ behavior foo: ensures should_be_rejected; if (x) { //@ behavior bar: ensures \true; x++; } else { //@ behavior bar: ensures should_be_kept; x++; } } } /*@ behavior boolean: ensures boolean:\true; behavior char: ensures char:\true; behavior for: ensures for:\true; behavior while: ensures while:\true; behavior ensures: ensures ensures: \true; behavior logic: ensures logic: \true; */ void keyword_as_behavior_and_term_names () { ; } frama-c-20.0-Calcium/tests/spec/behaviors_decl_def.c0000666000000000000000000000106313571573400017242 0ustar int G; /*@ behavior b2: assumes c < 1 ; */ void f (int c); /*@ behavior b1: assumes c > 0 ; complete behaviors b1, b2; */ void f (int c) { /*@ for b1: assert \true; */ } /*@ requires \true; assigns G ; ensures \result == 0 || \result == 1; @ behavior no : assumes c < 1 ; assigns \nothing ; ensures \result == 0 ; @ behavior at_least_one : assumes c > 0 ; assigns G ; ensures \result == 1 ; @ complete behaviors ; @ disjoint behaviors ; @*/ int main(int c) { f(c) ; return c> 0; } frama-c-20.0-Calcium/tests/spec/bool.c0000666000000000000000000000023013571573400014401 0ustar //@ logic boolean f(int x) = x == 0 ; //@ predicate f_pred(int x,int y) = f(x) && f(y) ; //@ predicate foo(boolean x, boolean y) = x == \false || y ; frama-c-20.0-Calcium/tests/spec/boolean_ops.c0000666000000000000000000000024413571573400015753 0ustar /*@ ensures (x==0||y==1)?\result==0:\result == 1; */ int f(int x, int y) { return (x==0||y==1); } int main() { int x = f(42,1); int y = f(0,36); return 0; } frama-c-20.0-Calcium/tests/spec/breaks_continues_unroll.i0000666000000000000000000000074513571573400020420 0ustar /* run.config */ // Semantics of unrolling int unroll (int c) { int x = 0; //@ loop pragma UNROLL 1; while (1) { /*@ breaks \false; continues x == \old(x) + 1; */ switch (x) { /*@ breaks x == 13; */ { case 11: x++; continue; case 12: x++; case 13: break; default:; }} /*@ breaks x == \old(x); continues x == \old(x) + 1; */ { if (x < c) { x++; continue; } break; } } return x; } frama-c-20.0-Calcium/tests/spec/bsearch.c0000666000000000000000000000220713571573400015063 0ustar /*@ lemma mean_1 : \forall integer x, y; x <= y ==> x <= (x+y)/2 <= y; */ /*@ predicate sorted{L}(int t[],integer n) = @ \forall integer i, j; @ 0 <= i <= j <= n ==> t[i] <= t[j] ; @*/ /* bsearch(t,n,v) search for element v in array t between index 0 and n-1 array t is assumed sorted in increasing order returns an index i between 0 and n-1 where t[i] equals v, or -1 if no element of t is equal to v */ /*@ requires @ n >= 0 && \valid_range(t,0,n-1) && sorted((int[])t,n-1); @ behavior search_success: @ ensures \result >= 0 ==> t[\result] == v; @ behavior search_failure: @ ensures \result < 0 ==> @ \forall integer k; 0 <= k < n ==> t[k] != v; @*/ int bsearch(int* t, int n, int v) { int l = 0, u = n-1; /*@ loop invariant @ 0 <= l && u <= n-1 && @ \forall int k; 0 <= k && k < n ==> t[k] == v ==> l <= k && k <= u; @ loop variant u-l; @*/ while (l <= u ) { int m = (l + u) / 2; if (t[m] < v) l = m + 1; else if (t[m] > v) u = m - 1; else return m; } return -1; } /* Local Variables: compile-command: "../../bin/toplevel.opt -jessie bsearch.c" End: */ frama-c-20.0-Calcium/tests/spec/bts0254.i0000666000000000000000000000120213571573400014557 0ustar /*@ behavior d: assumes \true; assumes \false; requires \true; ensures \true && x && \true && x && \true && x && \true && x && \true && x && \true; */ int f(int x) { return 0; }; /*@ requires \true; ensures \false; assigns \nothing; */ int g(void) { return 0; }; /*@ requires \true; terminates \false; decreases x; ensures \false; assigns \nothing; behavior b1: assumes \true; behavior b2: assumes \false; disjoint behaviors b1, b2; */ int h(int x) { return 0; }; /*@ requires \true; */ int a(void) { return 0; }; /*@ behavior d: ensures \true; */ int bts(void) { return 0; }; frama-c-20.0-Calcium/tests/spec/bts0283.c0000666000000000000000000000027213571573400014561 0ustar int b, *p; /*@ requires p != 0 ; // accepted (null pointer constant) */ int main() { /*@ assert p !=4 ; */ // forbidden p = b?4:7 ; /*@ assert p !=b; */ // forbidden return 1; } frama-c-20.0-Calcium/tests/spec/bts0440.i0000666000000000000000000000023713571573400014563 0ustar int fact(int n) { int r = 1 ; while ( n > 0 ) { //@ ensures n >= 0 ; before: r *= n-- ; //@ assert r == \at(r*n,before) ; } return r ; } frama-c-20.0-Calcium/tests/spec/bts0549.i0000666000000000000000000000140513571573400014573 0ustar int t1[10], t2[10] ; //@ logic int * a1 = t1 + 0; //@ logic int * a2 = &t1[0]; //@ logic int * a3 = &*t1 ; //@ logic int * a4 = t1 ; // should not be accepted //@ logic int * a5 = (int *)t1; //@ logic int * b1 = \let x = t1 + 0; x ; //@ logic int * b2 = \let x = &t1[0]; x ; //@ logic int * b3 = \let x = &*t1 ; x ; //@ logic int * b4 = \let x = t1 ; x ; // should not be accepted int main () { int i ; for (i=0 ; i < 10 ; i++) { t1[i] = 0 ; t2[i] = 0 ; } if (t1 == t2) { /* C tests the address of the first elements, * so the then-branch is dead. */ //@ assert \false; } else { /* ACSL tests the contents of the arrays, * here they are the same. */ //@ assert (t1==t2) ; // even with the previous C } } frama-c-20.0-Calcium/tests/spec/bts0570.i0000666000000000000000000000013113571573400014560 0ustar int main(char *data ) { //@ assert \pointer_comparable(data, (void *)0); return 0; } frama-c-20.0-Calcium/tests/spec/bts0578.i0000666000000000000000000000055113571573400014576 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -print -load-module ./@PTEST_DIR@/@PTEST_NAME@ */ /*@ behavior foo: ensures \true; */ void main(void) { int i, t[10]; /*@ loop assigns t[0..i]; for foo: loop assigns t[0..i]; */ for (i = 0; i < 10; i++) { t[i] = 0; } L1: t[4] = 42; L2: t[3] = 36; L3: t[2] = 12; } frama-c-20.0-Calcium/tests/spec/bts0578.ml0000666000000000000000000000353513571573400014763 0ustar open Cil_types open Logic_const let main () = let s, kf = Kernel_function.find_from_sid 2 in let s1 = Kernel_function.find_label kf "L1" in let s2 = Kernel_function.find_label kf "L2" in let s3 = Kernel_function.find_label kf "L3" in let add s a = Annotations.add_code_annot Emitter.end_user ~kf s (new_code_annotation a) in let add_behavior s spec_behavior = let contract = { spec_behavior; spec_variant = None; spec_terminates = None; spec_complete_behaviors = []; spec_disjoint_behaviors = [] } in add s (AStmtSpec ([],contract)) in add s (AInvariant(["foo"], true, ptrue)); add s (AVariant(tinteger 0, None)); add s (AInvariant([], true, ptrue)); add s (AInvariant(["foo"], true, ptrue)); Filecheck.check_ast "after adding invariants"; let requires = [Logic_const.new_predicate Logic_const.ptrue] in let bhv = [Cil.mk_behavior ~requires ()] in add_behavior !s1 bhv; Filecheck.check_ast "after adding contract"; let post_cond = [Normal, Logic_const.new_predicate Logic_const.ptrue] in let bhv = [Cil.mk_behavior ~post_cond ()] in add_behavior !s1 bhv; Filecheck.check_ast "after merging contract"; let requires = [Logic_const.new_predicate Logic_const.ptrue] in Annotations.add_requires Emitter.end_user kf ~stmt:!s2 requires; let post_cond = [Normal, Logic_const.new_predicate Logic_const.ptrue] in let bhv = [Cil.mk_behavior ~post_cond ()] in add_behavior !s2 bhv; Filecheck.check_ast "after merging requires and code_annot"; let requires = [Logic_const.new_predicate Logic_const.ptrue] in let bhv = [Cil.mk_behavior ~requires ()] in add_behavior !s3 bhv; let post_cond = [Normal, Logic_const.new_predicate Logic_const.ptrue] in Annotations.add_ensures Emitter.end_user kf ~stmt:!s3 post_cond; Filecheck.check_ast "after merging code_annot and ensures" let () = Db.Main.extend main frama-c-20.0-Calcium/tests/spec/bts0589.i0000666000000000000000000000011413571573400014573 0ustar int x; int g(void) { int a; //@ assigns a,x ; a = x++ ; return a; } frama-c-20.0-Calcium/tests/spec/bts0655.i0000666000000000000000000000066513571573400014600 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ /*@ @ ensures \result == \max( a, b ); @ ensures \result != \min( a, b ); @ ensures \max(a,b) != \min(a+1,b); @ ensures a == \abs( a ); @*/ unsigned int max( unsigned int a, unsigned int b ) { int i = a > b ? a : b; //@ assert i == \max( \at(a,Pre), \at(b,Pre) ); return i; } frama-c-20.0-Calcium/tests/spec/bts0655.ml0000666000000000000000000000076213571573400014756 0ustar include Plugin.Register (struct let name = "bts0655" let shortname = "bts0655" let help = "inspects relevant AST parts of bts0655.i" end) class check_float = object inherit Visitor.frama_c_inplace method! vterm t = result "term %a has type %a" Printer.pp_term t Printer.pp_logic_type t.Cil_types.term_type; Cil.DoChildren end let run () = let f = Ast.get () in Visitor.visitFramacFileSameGlobals (new check_float) f let () = Db.Main.extend run frama-c-20.0-Calcium/tests/spec/bts0698.i0000666000000000000000000000125113571573400014577 0ustar /* -------------------------------------------------------------------------- */ /* --- Testing logic casts on array types --- */ /* -------------------------------------------------------------------------- */ //@ predicate P(int x[2]) = x[0] < x[1] ; //@ predicate Q{L}(int *x) = x[0] < x[1] ; //@ predicate Correct{L}(int *x) = P((int[2]) x) ; //@ predicate Incorrect{L}(int x[2]) = Q{L}((int *) x) ; int t[2] ; int * a ; void f(void) { t[0] = 10 ; t[1] = 20 ; //@ assert P(t) ; //@ assert Q((int *)t) ; } //@ requires \valid(a+(0..1)) ; void g(void) { a[0] = 10 ; a[1] = 20 ; //@ assert P((int[2])a) ; //@ assert Q(a) ; } frama-c-20.0-Calcium/tests/spec/bts0812.c0000666000000000000000000000020113571573400014547 0ustar /*@ lemma fib_3: \true; // proved automatically */ /*@ lemma fib_46: \true; */ /*@ assigns \nothing; // Bla */ void main() { } frama-c-20.0-Calcium/tests/spec/bts1068.i0000666000000000000000000001115513571573400014573 0ustar /* run.config OPT: -print -journal-disable -kernel-warn-key=annot-error=active */ // test of label inference into typedef struct { int a; unsigned char *b; } S ; typedef struct { int a; unsigned char b[10]; } T ; int * P ; int V, Tab[10] ; /*@ axiomatic A { logic T t reads \nothing; logic integer ft (T x) = x.b[1] ; logic integer ft2 (T x) reads x.b[1] ; predicate PT(T x) = x.b[1] > 1; predicate PT2(T x) reads x.b[1]; axiom T1: t.a == 0; axiom T2: t.b[0] == 0; axiom T3: PT(t) ==> PT2(t); logic S s reads \nothing; logic integer fs (S x) = x.b[1] ; // <- label to infer logic integer fs2 (S x) reads x.b[1] ; // <- label to infer predicate PS(S x) = x.b[1] > 1; // <- label to infer predicate PS2(S x) reads x.b[1]; // <- label to infer axiom S1: s.a == 0; axiom S2: s.b[0] == 0; // <- label to infer axiom S3: PS(s) ==> PS2(s); // <- label to infer logic integer p reads *P; // <- label to infer logic int * va reads &V; // <- label to infer logic integer v reads V; // <- label to infer logic int *fa(int *q) = q; logic int fa2(int *q) = *q; // <- label to infer logic char *fa3(integer i) = i + (char *)&P; // <- label to infer logic integer fa4(T *q) reads q->a ; // <- label to infer predicate Initialized(int *q) = \initialized(q); // <- label to infer predicate Valid(int *q) = \valid(q); // <- label to infer predicate ValidIndex(int *q) = \valid_index(q,1); // <- label to infer predicate ValidRange(int *q) = \valid_range(q,0,2); // <- label to infer predicate Separated(int *a,int *b) = \separated(a,b); logic integer BlockLength(int *q) = \block_length(q); // <- label to infer logic char * Base_addr(int *q) = \base_addr(q); // <- label to infer // logic integer Offset(int *q) = \offset(q); // <- BUG parsing logic integer fi(T* t) = t->a + (*t).a; } */ typedef struct _list { int element; struct _list* next; } list; /*@ type List = Nil | Cons(A,List); */ /*@ inductive model_0{L1,L2}(list* root, Listlogic_list) { case nil{L1,L2}: model_0{L1,L2}(\null,Nil); case cons{L1,L2}: \forall list* l1,Listll1; \at(\valid(l1),L1) ==> model_0{L1,L2}(\at(l1->next,L1),ll1) ==> model_0{L1,L2}(l1,Cons(\at(l1->element,L1),ll1)); } */ /*@ inductive model_1{L}(list* root, Listlogic_list) { case nil{L}: model_1{L}(\null,Nil); case cons{L}: \forall list* l1,Listll1; \valid(l1) ==> model_1{L}(\at(l1->next,L),ll1) ==> model_1{L}(l1,Cons(\at(l1->element,L),ll1)); } */ /*@ inductive model_2(list* root, Listlogic_list) { case nil: model_2(\null,Nil); case cons: \forall list* l1,Listll1; \valid(l1) ==> model_2(l1->next,ll1) ==> model_2(l1,Cons(l1->element,ll1)); } */ /*@ inductive model_3{L}(list* root, Listlogic_list) { case nil: model_3(\null,Nil); case cons{L}: \forall list* l1,Listll1; \valid(l1) ==> model_3(l1->next,ll1) ==> model_3(l1,Cons(l1->element,ll1)); } */ /*@ inductive model_4{L1}(list* root, Listlogic_list) { case nil: model_4(\null,Nil); case cons{L1}: \forall list* l1,Listll1; \valid(l1) ==> model_4(l1->next,ll1) ==> model_4(l1,Cons(l1->element,ll1)); } */ /*@ inductive model_5{L}(list* root, Listlogic_list) { case nil: model_5(\null,Nil); case cons{L1}: \forall list* l1,Listll1; \valid(l1) ==> model_5(l1->next,ll1) ==> model_5(l1,Cons(l1->element,ll1)); } */ /*@ inductive model_6(list* root, Listlogic_list) { case nil{L1}: model_6(\null,Nil); case cons: \forall list* l1,Listll1; \valid(l1) ==> model_6(l1->next,ll1) ==> model_6(l1,Cons(l1->element,ll1)); } */ /*@ inductive model_7{L1}(list* root, Listlogic_list) { case nil{L1}: model_7(\null,Nil); case cons: \forall list* l1,Listll1; \valid(l1) ==> model_7(l1->next,ll1) ==> model_7(l1,Cons(l1->element,ll1)); } */ /*@ inductive model_8{L1}(list* root, Listlogic_list) { case nil{L}: model_8(\null,Nil); case cons: \forall list* l1,Listll1; \valid(l1) ==> model_8(l1->next,ll1) ==> model_8(l1,Cons(l1->element,ll1)); } */ /*@ inductive model_9{L1,L2}(list* root, Listlogic_list) { case nil: \valid(P); } */ /* inductive model_10{L}(list* root, Listlogic_list) { case nil: model_10(\null,Nil); case cons{L}: \forall list* l1,Listll1; \valid{L}(l1) ==> model_10(l1->next,ll1) ==> model_10(l1,Cons(l1->element,ll1)); } */ /* Checks that the given name 'px' into the profile definition of the inductive predicate 'Pind' does not impact the definition given for 'case P0'. */ void* px; //@ inductive Pind(void* root, integer px) { case p0: Pind(px,0); } frama-c-20.0-Calcium/tests/spec/bts1262.c0000666000000000000000000000012013571573400014547 0ustar int main() { char *s = "\\\\.\\"; //@ assert s[0] == '\\'; s[2] = '\\'; } frama-c-20.0-Calcium/tests/spec/bts2187-no-empty-contract.i0000666000000000000000000000012613571573400020153 0ustar /*@ behavior x: assumes c; */ void no_empty_stmt_contract(int c) { //@ for x: ; } frama-c-20.0-Calcium/tests/spec/bts_1789.i0000666000000000000000000000021713571573400014741 0ustar /* run.config_qualif DONTRUN: */ int *var_ptr; //@ logic int *the_var = var_ptr; //@ assigns the_var; void function(){ var_ptr = 0L; } frama-c-20.0-Calcium/tests/spec/bug96.c0000666000000000000000000000021013571573400014400 0ustar typedef struct node { int hd; struct list * next; } list; /*@ logic set tata(struct node * p) = \empty; @*/ frama-c-20.0-Calcium/tests/spec/builtins.c0000666000000000000000000000032113571573400015300 0ustar //@ lemma cos_pi: \cos(\pi) == -1.0; //@ lemma truncate: \truncate(1.0) == (integer) 1.0 == 1; //@ lemma coerce_and_truncate: \forall double x; (integer) x == \truncate(x); //@ lemma nop: (integer) 1 == 1; frama-c-20.0-Calcium/tests/spec/cast_enum_bts1546.i0000666000000000000000000001225513571573400016634 0ustar /* run.config STDOPT: +"-enums int" STDOPT: +"" */ enum e { E0 = 0, E1 } X; //@ ensures P: X == E0 && x == E1 && X < x && E0 <= E1 ==> \result == E0; enum e f(enum e x) { X = E0; return E0; } //@ ensures P: \result == ((unsigned) E0); enum e g(enum e x) { return (unsigned) E0 ; } signed int s; unsigned int u; signed long long hs; unsigned long long hu; enum e_v1 { V1=0 } v1, vv1; // underlying type = unsigned int enum e_v2 { V2=0 } v2; enum e_u1 { U1=0xFFFFFFFFU } u1, uu1; // underlying type = unsigned int enum e_u2 { U2=0xFFFFFFFFU } u2; enum e_s1 { S1=-1 } s1, ss1; // underlying type = signed int enum e_s2 { S2=-1 } s2; enum e_h1 { H1=0xFFFFFFFFFFFFFFFFULL } h1; // underlying = unsigned long long void us() {// Oracles without -enums option -> have to be confirmed u = s; // u = (unsigned int)s; s = u; // s = (int) u; u = U1; //- u = U1; s = U1; // s = (int) U1; u = S1; // u = (unsigned int)S1; s = S1; // s = S1; u = V1; //- u = V1; s = V1; // s = (int) V1; u = H1; // u = (unsigned int)H1; s = H1; // u = (int)H1; } void uu(){// Oracles without -enums option -> have to be confirmed uu1 = u; // uu1 = (enum e_u1) u; uu1 = u1; // uu1 = u1; uu1 = U1; //- uu1 = U1; uu1 = u2; // uu1 = (enum e_u1) u2; uu1 = U2; // uu1 = (enum e_u1) U2; uu1 = s; //- uu1 = (enum e_u1) s; uu1 = s1; // uu1 = (enum e_u1) s1; uu1 = S1; //- uu1 = (enum e_u1) S1; uu1 = v1; // uu1 = (enum e_u1) v1; uu1 = V1; //- uu1 = (enum e_u1) V1; uu1 = H1; //- uu1 = (enum e_u1) H1; } void ss(){// Oracles without -enums option -> have to be confirmed ss1 = u ; // ss1 = (enum e_s1) u; ss1 = u1; // ss1 = (enum e_s1) u1; ss1 = U1; // ss1 = (enum e_s1) U1; ss1 = s ; //- ss1 = (enum e_s1) s; ss1 = s1; // ss1 = s1; ss1 = S1; // ss1 = S1; ss1 = s2; // ss1 = (enum e_s1) s2; ss1 = S2; //- ss1 = (enum e_s1) S2; ss1 = v1; // ss1 = (enum e_s1) v1; ss1 = V1; //- ss1 = (enum e_s1) V1; } void u_signed(){// Oracles without -enums option -> have to be confirmed u1 = (signed int) u ; //- u1 = (enum e_u1) ((int) u); u1 = (signed int) u1 ; //- u1 = (enum e_u1) ((int) u1); u1 = (signed int) U1 ; //- u1 = (enum e_u1) ((int) U1); u1 = (signed int) u2 ; //- u1 = (enum e_u1) ((int) u2); u1 = (signed int) U2 ; //- u1 = (enum e_u1) ((int) U2); u1 = (signed int) s ; //- u1 = (enum e_u1) s; u1 = (signed int) s1 ; //- u1 = (enum e_u1) ((int)) s1); u1 = (signed int) S1 ; //- u1 = (enum e_u1) S1; u1 = (signed int) s2 ; //- u1 = (enum e_u1) ((int)) s2) u1 = (signed int) S2 ; //- u1 = (enum e_u1) S2; u1 = (signed int) v1 ; //- u1 = (enum e_u1) ((int)) v1) u1 = (signed int) V1 ; //- u1 = (enum e_u1) ((int) V1); } void u_unsigned(){// Oracles without -enums option -> have to be confirmed u1 = (unsigned int) u ; // u1 = (enum e_u1) u; u1 = (unsigned int) u1 ; // u1 = (enum e_u1) ((unsigned int) u1); u1 = (unsigned int) U1 ; //- u1 = U1; u1 = (unsigned int) u2 ; // u1 = (enum e_u1) ((unsigned int) u2); u1 = (unsigned int) U2 ; //- u1 = (enum e_u1) U2; u1 = (unsigned int) s ; // u1 = (enum e_u1) ((unsigned int) s); u1 = (unsigned int) s1 ; // u1 = (enum e_u1) ((unsigned int) s1); u1 = (unsigned int) S1 ; // u1 = (enum e_u1) ((unsigned int) S1); u1 = (unsigned int) s2 ; // u1 = (enum e_u1) ((unsigned int) s2); u1 = (unsigned int) S2 ; // u1 = (enum e_u1) ((unsigned int) S2); u1 = (unsigned int) v1 ; // u1 = (enum e_u1) ((unsigned int) v1); u1 = (unsigned int) V1 ; // u1 = (enum e_u1) V1; u1 = (unsigned int) H1 ; // u1 = (enum e_u1) ((unsigned int) H1); } void s_signed(){// Oracles without -enums option -> have to be confirmed s1 = (signed int) u ; //- s1 = (enum e_s1) ((int) u); s1 = (signed int) u1 ; //- s1 = (enum e_s1) ((int) u1); s1 = (signed int) U1 ; //- s1 = (enum e_s1) ((int) U1); s1 = (signed int) u2 ; //- s1 = (enum e_s1) ((int) u2); s1 = (signed int) U2 ; //- s1 = (enum e_s1) ((int) U2); s1 = (signed int) s ; //- s1 = (enum e_s1) s; s1 = (signed int) s1 ; //- s1 = (enum e_s1) ((int) s1); s1 = (signed int) S1 ; // s1 = S1; s1 = (signed int) s2 ; //- s1 = (enum e_s1) ((int)s2); s1 = (signed int) S2 ; //- s1 = (enum e_s1) S2; s1 = (signed int) v1 ; //- s1 = (enum e_s1) ((int)v1); s1 = (signed int) V1 ; //- s1 = (enum e_s1) ((int) V1); s1 = (signed int) H1 ; //- s1 = (enum e_s1) ((int) H1); } void s_unsigned(){// Oracles without -enums option -> have to be confirmed s1 = (unsigned int) u ; // s1 = (enum e_s1) u; s1 = (unsigned int) u1 ; // s1 = (enum e_s1) ((unsigned int) u1); s1 = (unsigned int) U1 ; //- s1 = (enum e_s1) U1; s1 = (unsigned int) u2 ; // s1 = (enum e_s1) ((unsigned int) u2); s1 = (unsigned int) U2 ; //- s1 = (enum e_s1) U2; s1 = (unsigned int) s ; // s1 = (enum e_s1) ((unsigned int) s); s1 = (unsigned int) s1 ; // s1 = (enum e_s1) ((unsigned int) s1); s1 = (unsigned int) S1 ; // s1 = (enum e_s1) ((unsigned int) S1); s1 = (unsigned int) s2 ; // s1 = (enum e_s1) ((unsigned int) s2); s1 = (unsigned int) S2 ; // s1 = (enum e_s1) ((unsigned int) S2); s1 = (unsigned int) v1 ; // s1 = (enum e_s1) ((unsigned int) v1); s1 = (unsigned int) V1 ; // s1 = (enum e_s1) V1; s1 = (unsigned int) H1 ; // s1 = (enum e_s1) ((unsigned int) H1); } frama-c-20.0-Calcium/tests/spec/char_cst.c0000666000000000000000000000070313571573400015241 0ustar /*@ requires c != '0'; behavior quote: assumes c=='\'' ; behavior default: assumes c!='\'' && c!='a'; behavior slash: assumes c=='\\' ; behavior other: assumes c!='\\' && c!='a'; behavior hexa: assumes c!='\xAB'; behavior oct: assumes c!='\123'; behavior string: assumes ""!="\"" && ""=="" ; behavior esc: assumes c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v'; */ void f(char c) { } frama-c-20.0-Calcium/tests/spec/clash_double_file_bts1598.c0000666000000000000000000000153613571573400020302 0ustar /* run.config COMMENT: checks that linking string.h and its FC-pretty-printed version COMMENT: does not get rejected by name clash in the logic. See bts 1598 OPT: @PTEST_FILE@ -cpp-extra-args " -Ishare/libc -nostdinc" -print -then -ocode @PTEST_DIR@/result/foo.c -print -then @PTEST_FILE@ @PTEST_DIR@/result/foo.c -ocode="" -print */ #include "__fc_builtin.h" #include "assert.h" //#include "complex.h" #include "ctype.h" #include "errno.h" //#include "fenv.h" #include "float.h" //#include "getopt.h" #include "inttypes.h" #include "iso646.h" #include "limits.h" #include "locale.h" #include "math.h" #include "setjmp.h" #include "stdbool.h" #include "stddef.h" #include "signal.h" #include "stdarg.h" #include "stdint.h" #include "stdio.h" #include "stdlib.h" #include "string.h" //#include "tgmath.h" #include "time.h" #include "wchar.h" #include "wctype.h" frama-c-20.0-Calcium/tests/spec/comparison.i0000666000000000000000000000062013571573400015631 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ /*@ predicate foo(boolean a, boolean b) = a == b; */ void main(void) { int x = 0, y = 0; long z = 0L; /*@ assert x == y; */ /*@ assert x == z; */ /*@ assert (long)x == z; */ /*@ assert foo(x==y,x==z); */ /*@ assert foo(z==(long)y, y == x); */ } frama-c-20.0-Calcium/tests/spec/comparison.ml0000666000000000000000000000200713571573400016012 0ustar open Cil_types open Cil let run () = let vis = object inherit Visitor.frama_c_inplace method! vterm t = match t.term_node with | TBinOp ((Lt | Gt | Le | Ge | Eq | Ne), t1, t2) -> Kernel.result "Term comparison between %a of type %a and %a of type %a" Printer.pp_term t1 Printer.pp_logic_type t1.term_type Printer.pp_term t2 Printer.pp_logic_type t2.term_type; DoChildren | _ -> DoChildren method! vpredicate p = match p.pred_content with | Prel ((Rlt | Rgt | Rle | Rge | Req | Rneq), t1, t2) -> Kernel.result "Predicate comparison between %a of type %a and %a of type %a" Printer.pp_term t1 Printer.pp_logic_type t1.term_type Printer.pp_term t2 Printer.pp_logic_type t2.term_type; DoChildren | _ -> DoChildren end in Visitor.visitFramacFileSameGlobals vis (Ast.get()) ;; let () = Db.Main.extend run frama-c-20.0-Calcium/tests/spec/complete_behaviors.c0000666000000000000000000000106113571573400017323 0ustar typedef enum { Max, Min } kind; int extremum (kind k, int x, int y) { return ((k == Max ? x > y : x < y) ? x: y); } /*@ requires k == Max || k == Min; assigns \nothing; ensures \result == x || \result == y; behavior is_max: assumes k == Max; ensures \result >= x && \result >= y; behavior is_min: assumes k == Min; ensures \result <= x && \result <= y; complete behaviors is_max, is_min; disjoint behaviors is_max, is_min; complete behaviors; disjoint behaviors; */ int extremum (kind k, int x, int y); frama-c-20.0-Calcium/tests/spec/concrete_type.c0000666000000000000000000000104113571573400016312 0ustar /*@ type list = Nil | Cons(A,list); axiomatic length { logic integer length (list l); axiom length_empty: length(Nil) == 0; axiom length_cons: \forall D a, list l; length(Cons(a,l)) == length(l)+1; } */ /*@ type my_list = list; logic my_list foo = Cons(1,Nil); */ /*@ type other_list = list; logic other_list bar = Cons((int)42, Nil); */ /*@ lemma foo: length(bar) == length(foo); */ /*@ type my_int = int; logic my_int x = (int) 42; lemma baz: x + 1== 43; */ frama-c-20.0-Calcium/tests/spec/conf1.h0000666000000000000000000000133013571573400014463 0ustar #ifndef _INCLUDE_conf1 #define _INCLUDE_conf1 /* spécification de l'opérateur CONF1 _E1 : BOOLEAN _S1 : BOOLEAN Calcul : _S1 = TRUE si la durée de l'état TRUE sur _E1 est >= Time et tant que _E1 = TRUE _S1 = FALSE si la durée de l'état TRUE sur _E1 est < Time ou si _E1 = FALSE Initialisation : _S1 = FALSE */ #define CONF1(NNN, _E1, _Time, _S1) {\ static INTEGER CONF1_Timeout;\ INTEGER Horl_BR;\ Horl_BR = M_Horloge_BR;\ if (_E1)\ {\ if ((CONF1_Timeout)==0)\ {\ (CONF1_Timeout)=(Horl_BR)+(_Time);\ }\ (_S1)=(BOOLEAN)((Horl_BR)>=(CONF1_Timeout));\ }\ else\ {\ (CONF1_Timeout)=0;\ (_S1)=FALSE;\ }\ } #endif frama-c-20.0-Calcium/tests/spec/const.c0000666000000000000000000000021313571573400014575 0ustar //@ logic integer strlen(char* c); //@ requires strlen(c) < n; ensures strlen(a) <=n; void f(const char* c, char* restrict a, int n) { } frama-c-20.0-Calcium/tests/spec/const_ptr_bts1729.i0000666000000000000000000000012713571573400016667 0ustar static void elem_size(void) { //@ assert \valid_read((char const * const *)0); } frama-c-20.0-Calcium/tests/spec/constant_predicate.i0000666000000000000000000000027113571573400017332 0ustar int x; /*@ predicate P{A} = x == 42; */ /*@ logic integer f{B} = x + 42; */ /*@ lemma foo{C}: P ==> f == 84; */ /*@ ensures f == 84; */ void g () { x = 42; /*@ assert P; */ } frama-c-20.0-Calcium/tests/spec/contract_assert_bts1470.i0000666000000000000000000000025613571573400020046 0ustar int x; void main(){ /*@ ensures \false; */ /*@ assert \true; */ x = 1; /*@ ensures \false; */ { /*@ assert \true; */ x = 1; } } frama-c-20.0-Calcium/tests/spec/conversion.c0000666000000000000000000000117613571573400015645 0ustar /* bts 60: 1 should be lifted to a real number implicitely. */ /*@ ensures 1.0 == 1; */ void f(); /*@ lemma foo: 1.0 == (float)1; */ /*@ axiomatic toto { @ logic integer g; @ predicate foo(real x); @ } */ void f() { double B; /*@ assert B==g; */ } /*@ ensures foo(\result); */ int g() { return 0; } typedef int T, T4[4], *T_PTR; const T X, Tab[4]; typedef T_PTR T_PTR_T4[4]; const T_PTR_T4 Tab_Ptr = { &X, &X, &X, &X}; /*@ axiomatic useless_logic_cast { @ logic integer v2 = (int)1 + (T)1; @ logic int vX = (int) X; @ logic int[4] vTab = (T4) Tab; @ logic T_PTR_T4 * vTab_Ptr = (T_PTR_T4 *)(&Tab_Ptr); @ } */ frama-c-20.0-Calcium/tests/spec/dec.h0000666000000000000000000000016413571573400014214 0ustar #ifndef __DEC #define __DEC /*@ axiomatic S { logic integer F(integer x) ; } */ //@ logic integer X = 42; #endif frama-c-20.0-Calcium/tests/spec/declspec.c0000666000000000000000000000020613571573400015233 0ustar //@ axiomatic Foo { predicate p(char *s); } void f(const char *__declspec(whatever) a, char* __declspec(p) b) { //@ assert p(b); } frama-c-20.0-Calcium/tests/spec/default_assigns_bts0966.i0000666000000000000000000000120513571573400020027 0ustar /* run.config OPT: -eva -print */ int auto_states[4] ; // = { 1 , 0 , 0, 0 }; enum states { Init = 0, Copy = 1, Set=2, Final = 3 }; // contract with missing "complete behaviors" /*@ ensures \true; behavior from_init: assumes auto_states[Init] == 1; ensures (auto_states[Copy] == 1) && (auto_states[Init] == 0); assigns auto_states[Init], auto_states[Copy]; behavior from_other: assumes (auto_states[Init] == 0); assigns \nothing; */ void copy(int x); int main() { auto_states[Init] = 1; auto_states[Copy] = 0; auto_states[Set] = 0; auto_states[Final] = 0; copy(0); } frama-c-20.0-Calcium/tests/spec/doxygen.c0000666000000000000000000000026313571573400015131 0ustar /* run.config OPT: -keep-comments -print -then -pp-annot */ /*@{*/ /*@{ Bla */ //@{ //@{ Blu void doxygen_group () { } /*@} Bli */ /*@} */ //@} //@} Bly void main(); frama-c-20.0-Calcium/tests/spec/enum.c0000666000000000000000000000046113571573400014420 0ustar typedef enum{ VRAI=1, FALSE=0 }T_BOOLEEN; /*@logic T_BOOLEEN test (integer b)= @ @ ((b==1)? @ (T_BOOLEEN)VRAI @ : (T_BOOLEEN)FALSE); @*/ /*@ensures \result == test(boo); @*/ T_BOOLEEN test(int boo) { T_BOOLEEN b; if (boo==1) b = VRAI; else b= FALSE; return b; } frama-c-20.0-Calcium/tests/spec/error_msg.i0000666000000000000000000000035413571573400015462 0ustar // All annotations below present an error that should be expressed by a // friendlier msg than the usual unexpected 'bla' token /*@ requires x >= 0 ensures \result == 0; */ int f(int x); /*@ ensures \result >= 0 */ int g(int x); frama-c-20.0-Calcium/tests/spec/exit_clause.c0000666000000000000000000000120313571573400015754 0ustar //@ exits never_exits: \false; int main() { return 0; } /*@ assigns \nothing ; ensures never_returns: \false; exits \exit_status==status; */ extern void exit(int status); /*@ behavior never_exits: assumes x>=0; exits \false; behavior never_returns: assumes x<0; assigns \nothing ; ensures never_returns: \false; exits \exit_status==x; */ int may_exit(int x) { if (x) exit(0); return 0; } // Following spec must be rejected //@ exits \result == 0; int f () { return 0; } //@ requires \exit_status == 0; ensures \exit_status == 0; void g () { //@ assert \exit_status == 0; exit(0); } frama-c-20.0-Calcium/tests/spec/expr_to_term.i0000666000000000000000000000107413571573400016172 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print */ int x[10]; struct S { int y; int z; } s; int t; /*@ predicate int_eq(int logical, int from_c) = logical == from_c; */ /*@ ensures int_eq(*(int*)((unsigned)0x1 + 0x2),(int)0); */ int f() { *(int *)((unsigned)0x1 + 0x2) = 0; return 0; } /*@ ensures int_eq(x[0], (int)1); ensures int_eq(s.y, (int)2); ensures int_eq(s.z, (int)3); ensures int_eq(t,(int)4); */ int main() { x[0] = 1; s.y = 2; s.z = 3; t = 4; } frama-c-20.0-Calcium/tests/spec/expr_to_term.ml0000666000000000000000000000372013571573400016352 0ustar open Cil_types let emitter = Emitter.(create "Test" [Funspec] ~correctness:[] ~tuning:[]) let check_expr_term check fct s e = let exp = match s.skind with | Instr (Set (lv,_,loc)) -> Cil.new_exp ~loc (Lval lv) | _ -> Kernel.fatal "Unexpected statement %a" Printer.pp_stmt s in let term = match e with | (_, { ip_content = { pred_content = Papp(_,_,[l;_]) } }) -> l | _ -> Kernel.fatal "Unexpected ensures %a" Printer.pp_post_cond e in let term' = Logic_utils.expr_to_term ~cast:false exp in if check && not (Cil_datatype.Term.equal term term') then Kernel.fatal "translation of C expression %a inconsistent with logic term %a" Printer.pp_exp exp Printer.pp_term term; let p = List.hd (Logic_env.find_all_logic_functions "int_eq") in let app = Logic_const.papp (p,[],[term;term']) in let post = Logic_const.new_predicate app in Annotations.add_ensures emitter fct [Normal,post] let treat_fct check fct = let stmts = (Kernel_function.get_definition fct).sbody.bstmts in let stmts = List.filter (function { skind = Instr (Set (lv,_,_)) } -> (match lv with (Var v,_) -> v.vglob | _ -> true) | _ -> false) stmts in let ensures = (List.hd (Annotations.funspec fct).spec_behavior).b_post_cond in (* A bit fragile, but should do the trick as long as the test itself does not get too complicated (regarding the C code at least). *) if not (List.length stmts = List.length ensures) then Kernel.fatal "Stmts:@\n%a@\nPreds:@\n%a@\n" (Pretty_utils.pp_list ~sep:"@\n@\n" Printer.pp_stmt) stmts (Pretty_utils.pp_list ~sep:"@\n@\n" Printer.pp_post_cond) ensures; List.iter2 (check_expr_term check fct) stmts ensures; Filecheck.check_ast "check_expr_to_term" let compute () = let main = Globals.Functions.find_by_name "main" in let f = Globals.Functions.find_by_name "f" in treat_fct true main; treat_fct false f let () = Db.Main.extend compute frama-c-20.0-Calcium/tests/spec/fct_ptr.c0000666000000000000000000000026513571573400015117 0ustar typedef void(*proc)(void); int x; void inc() { x++; } void dec() { x--; } proc f = dec; proc g = inc; void call(proc x) { x(); } /*@ predicate foo = f == dec || f == &inc; */ frama-c-20.0-Calcium/tests/spec/first.c0000666000000000000000000000032413571573400014601 0ustar /* run.config OPT: -print tests/spec/third.c tests/spec/second.c -journal-disable */ /*@ behavior b: requires \valid(first); ensures \result == 0;*/ int bar(int *first); void main (int * c) { bar(c); } frama-c-20.0-Calcium/tests/spec/float-acsl.i0000666000000000000000000000170613571573400015512 0ustar /* run.config* STDOPT: +"-kernel-msg-key printer:logic-coercions" +"-kernel-warn-key acsl-float-compare=active" */ /*@ assigns \result \from \nothing; ensures \le_double(\result, (double)0.0); ensures \ge_double(\result, (double)-1.0); ensures \lt_double(\result, (double)1.0); ensures \gt_double(\result, (double)-2.0); ensures \ne_double(\result, (double)-0.5); ensures \eq_double(\result, (double)-1.0); */ double minus_one(void); /*@ assigns \result \from \nothing; ensures \le_float(\result, (float)0.0); ensures \ge_float(\result, (float)-1.0); ensures \lt_float(\result, (float)1.0); ensures \gt_float(\result, (float)-2.0); ensures \ne_float(\result, (float)-0.5); ensures \eq_float(\result, (float)-1.0); */ float minus_onef(void); /*@ requires x <= y; assigns \result \from x,y; ensures x <= \result <= y; */ float test(float x, float y); void main() { double mone = minus_one(); float monef = minus_onef(); } frama-c-20.0-Calcium/tests/spec/footprint.c0000666000000000000000000000117613571573400015504 0ustar struct S { char *x; int *y; }; /*@ logic set footprint(struct S s) = \union(s.x, (char*)s.y + (0 .. sizeof(int) - 1)) ; */ /*@ requires \valid(\union(s,footprint(*s))); assigns *footprint(*s); */ int f(struct S* s) { return *s->x + *s->y; } struct V { char x; char t[10]; }; /* This version should NOT be accepted in an assigns clause: footprint2 returns a set of char with no link to the original locations. */ /*@ logic set footprint2{L}(struct V *s) = \union(s->x, s->t[0..5]) ; */ /*@ requires \valid(s); assigns footprint2(s); */ void g(struct V* s) { s->x = 1; s->t[4] = 1; } frama-c-20.0-Calcium/tests/spec/for_scope.c0000666000000000000000000000011313571573400015425 0ustar void f() { //@ loop invariant i >= 0; for (int i = 0; i < 10; ++i) ; } frama-c-20.0-Calcium/tests/spec/fptr.i0000666000000000000000000000143713571573400014441 0ustar /*@ axiomatic A { predicate P{L}(void (*galois_fp)()); predicate Q{L, L2}(void (*galois_fp_old)()); } */ /*@ requires P{Pre}(\at(fp,Pre)); ensures Q{Pre, Post}(\at(fp, Pre)); */ long f0(void (*fp)(void)) { return 0; } /*@ requires P{Pre}(\at(fp,Pre)); ensures Q{Pre, Post}(\at(fp, Pre)); */ long f1(void (*fp)(int)) { return 0; } /*@ axiomatic A1 { predicate P1{L}(void (*galois_fp)(void)); predicate Q1{L, L2}(void (*galois_fp_old)(void)); } */ /*@ requires P1{Pre}(\at(fp,Pre)); ensures Q1{Pre, Post}(\at(fp, Pre)); */ long f2(void (*fp)(void)) { return 0; } /*@ requires ill_typed: P1{Pre}(\at(fp,Pre)); ensures ill_typed: Q1{Pre, Post}(\at(fp, Pre)); */ long f3(void (*fp)(int)) { return 0; } void my_f() { return; } /*@ lemma OK{L}: P(my_f) && P1(my_f); */ frama-c-20.0-Calcium/tests/spec/ghost.c0000666000000000000000000000036413571573400014602 0ustar struct A { int x; }; /*@ ghost struct B { int y; }; // ghost_type */ /*@ ghost struct B b1; // ghost_data */ /*@ requires b1.y == 0 ; */ int main() { /*@ ghost struct B b; */ struct A a; /*@ ghost b.y = 0; a.x = b.y; */ return 0; } frama-c-20.0-Calcium/tests/spec/global_invariant.c0000666000000000000000000000067113571573400016772 0ustar /* run.config DONTRUN: ghost code is not supported */ int G= 1, H = 2; /*@ ghost char toggle = 0, y[10] = {1,2} ; */ //@ global invariant sum_G_H : toggle ==> G + H <= 3; void main () { /*@ ghost int LOCAL2 = 0; */ if (H) /*@ ghost int local = 0; goto HH; local += G; */ /*@ ghost int local = 0; goto HH; HH:local += G; */ //@ assert \false; LL:G++; /*@ghost LOCAL2++ ; */ } frama-c-20.0-Calcium/tests/spec/heterogeneous_set_bts1146.i0000666000000000000000000000127313571573400020377 0ustar /* run.config DONTRUN: bugfix in progress EXECNOW: make -s tests/spec/Type_of_term.cmxs OPT: -load-module ./tests/spec/Type_of_term.cmxs -print */ /*@ lemma foo: \union(1) == \union(1.0); */ /*@ lemma foo2: \union(1.0) == \union(1); */ /*@ lemma foo3: \union(1.0,2) == \union(1,2.0); */ /*@ lemma foo4: 1.0 == 1; */ /*@ lemma bar: \union() != \union(1); */ /*@ lemma bla: \union(1) != \union(); */ /*@ predicate P{L1,L2}(sets) = \forall char* p; \subset(p,s) ==> \at(*p,L1) == \at(*p,L2); */ /*@ ensures P{Pre,Post}(x); */ void f(int *x, double *y); /*@ ensures P{Pre,Post}(\union(x,y)); */ void h(int *x, int *y); int x; /*@ ensures P{Pre,Post}(&x); */ void g(); frama-c-20.0-Calcium/tests/spec/homax.c0000666000000000000000000000041713571573400014571 0ustar /*@ requires n > 0 &&\valid(p + (0..n-1)); ensures \result == \max(0,n-1,\lambda integer i; p[i]); */ int max_seq(int* p, int n); int max_seq(int* p, int n) { int res = *p; for(int i = 0; i < n; i++) { if (res < *p) { res = *p; } p++; } return res; } frama-c-20.0-Calcium/tests/spec/hosum.c0000666000000000000000000000065313571573400014612 0ustar /*@ requires n >= 0; requires \valid(p+ (0..n-1)); assigns \nothing; ensures \result == \sum(0,n-1,\lambda integer i; p[i]*p[i]); */ int sqsum(int* p, int n); #define INT_MAX (1<<30-1) int sqsum(int* p, int n) { int S=0, tmp; for(int i = 0; i < n; i++) { //@ assert p[i] * p[i] <= INT_MAX; tmp = p[i] * p[i]; //@ assert tmp >= 0; //@ assert S + tmp <= INT_MAX; S += tmp; } return S; } frama-c-20.0-Calcium/tests/spec/if.c0000666000000000000000000000026713571573400014056 0ustar int a,b; /*@ requires MyPre : (a= 0; assigns behavior \from behavior; ensures behavior >= 0; */ int main () { //@ slevel 4; behavior++; struct custom { int reads, behaviors, label ; } writes; //@ assert custom: writes.reads + writes.behaviors <= \let global = writes.label; global; struct at { int module, function, global ; } include; //@ assert at: include.function + include.module <= \let behaviors = include.global ; behaviors; struct loop { int requires, ensures, checks ; } assert; //@ assert loop: assert.ensures + assert.ensures <= \let reads = assert.checks; reads ; return 0; } /*@ type List = Nil | Cons(A,List); */ /*@ inductive model{L}(List root, Listlogic_list) { case nil{L}: model(Nil,Nil); case cons{L}: \forall List l1,Listll1; model{L}(l1,ll1) ==> model(Cons(0,l1),Cons(0,ll1)); } */ /*@ axiomatic foo { logic integer func(integer i) reads behavior; } */ volatile int assigns; int ensures(volatile int* a) { return *a; } int requires(volatile int*a, int v) { *a = v; return v; } /*@ volatile assigns reads ensures writes requires; */ int slevel = 1000000; //@ lemma bar: slevel >= 0; frama-c-20.0-Calcium/tests/spec/label_scope_bts1536.i0000666000000000000000000000064313571573400017123 0ustar void f() { int i; LInit: { LLoop: i = 0; //@ assert \at(1,LInit) == 1; } } int x; void g(void) { L1: L2: //@ assert \at(x,L1) == \at(x,L2); L3: L4: ; //@ assert \at(x,L1) == \at(x,L2); //@ assert \at(x,L3) == \at(x,L4); return ; } void h(void) { L1: L2: //@ ensures \at(x,L1) == \at(x,L2); L3: L4: ; //@ assert \at(x,L1) == \at(x,L2); //@ assert \at(x,L3) == \at(x,L4); return ; } frama-c-20.0-Calcium/tests/spec/lib.c0000666000000000000000000000026013571573400014217 0ustar /* run.config OPT: -cpp-extra-args="-Itests/spec" -cpp-extra-args="-include lib.h" -print -journal-disable */ /*@ ensures f((int)0) == (int)0; */ int main () { return 0; } frama-c-20.0-Calcium/tests/spec/lib.h0000666000000000000000000000003413571573400014223 0ustar /*@ logic int f (int i); */ frama-c-20.0-Calcium/tests/spec/liens.c0000666000000000000000000000022213571573400014561 0ustar int e; /*@ assigns e; @ ensures e == 2; @*/ void f() { e=2; } /*@ assigns e; @ ensures e == 6; @*/ int main() { e=1; f(); return 0; } frama-c-20.0-Calcium/tests/spec/list.i0000666000000000000000000000417713571573400014445 0ustar /*@ type List = \list; */ //@ logic List \empty_integer_list = [| |] ; /*@ predicate is_empty_list_1(\list l1) = l1 == \Nil; */ /*@ predicate is_empty_list_2(\list l1) = l1 == [| |]; */ /*@ predicate is_empty_list_3(\list l1) = l1 == \empty_integer_list; */ /*@ logic \list empty_1 = [| |] ; */ /*@ logic \list empty_2 = \Nil ; */ /*@ logic \list empty_3 = \empty_integer_list ; */ /*@ logic \list<\list > list_of_list_1 = [| [| |] |] ; */ /*@ logic \list call_to_1(integer id) = [| id |]; */ /*@ logic \list call_to_2(integer id) = \Cons(id, \Nil) ; */ /*@ logic \list call_to_3(integer id) = \Cons(id, \empty_integer_list) ; */ /*@ logic \list list_1(int e1, integer e2) = [| e1, e2 |]; */ /*@ logic \list list_2(integer e1, integer e2) = \Cons(e1, \Cons(e2, \Nil)); */ /*@ logic \list list_3(integer e1, integer e2) = \Cons(e1, \Cons(e2, \empty_integer_list)); */ /*@ logic \list concat_1(\list seq1, \list seq2) = seq1 ^ seq2 ;*/ /*@ logic \list concat_2(\list seq1, \list seq2) = \concat(seq1 ,seq2) ; */ /*@ logic \list repeat_1(\list seq, integer n) = \repeat(seq, n) ; */ /*@ logic \list repeat_2(\list seq, integer n) = seq *^ n ; */ /*@ logic \list add_call_to_1(integer id, \list seq) = seq ^ [| id |] ; */ /*@ logic \list add_call_to_2(integer id, \list seq) = seq ^ \Cons(id, \Nil); */ /*@ logic \list add_call_to_3(integer id, \list seq) = seq ^ call_to_1(id) ; */ /*@ predicate Padd_id{L1,L2}(integer id, \list seq) = \at(seq,L1) == (\at(seq,L2) ^ [| id |]); */ /*@ predicate Prepeat{L1,L2}(integer times, \list seq) = \at(seq,L1) == (\at(seq,L2) *^ times ); */ //@ ghost int seq; //@ axiomatic Ghost { logic \list ghost_seq reads seq ; } /*@ assigns seq ; @ ensures Padd_id{Here,Pre}(id, ghost_seq); @*/ void add_id(int id); //@ lemma length: \length(ghost_seq) >=0; //@ lemma nth: \nth(\Cons(1,ghost_seq),0) == 1; frama-c-20.0-Calcium/tests/spec/local.c0000666000000000000000000000077113571573400014552 0ustar /*@ ensures \let i = x + 1; i == \result; ensures \result == \let i = x; i+1; */ int f(int x) { return x+1; } /*@ requires (int)(x+y+1) == x+y+1; ensures \let f = \lambda integer x; \let x1 = x + 1; \lambda integer y; x1 + y; \let P = \lambda integer x,y; x == y; P(f(x,y),\result); */ int g(int x, int y) { return (x+y+1); } //@ axiomatic a { predicate P(integer v); } //@ lemma l1: \let p=\lambda integer x; P(x); p(1); //@ lemma l2: \let p=P(1); p ; frama-c-20.0-Calcium/tests/spec/localization.c0000666000000000000000000000103113571573400016136 0ustar /* This file contains various annotations errors to test the localization of error messages. */ /*@ logic integer f(integer i) = 1; @ logic integer g(integer i) = j; @ logic integer h(integer i) = k; @ logic integer i(integer i) = l; @*/ void ComposerPage(void) { int x = 0; x++; /*@ assert bar; */ //@ assert foo; return ; } void f() { //@ ghost int index = 0; // comment int x = 0; //@ assert wrong; return; } void g() { } typedef struct _S S; /*@ axiomatic S { logic S S00; logic S1 S0; } */ frama-c-20.0-Calcium/tests/spec/location_char.c0000666000000000000000000000133213571573400016257 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ /*@ requires x <= 0; ensures \result == x; */ int f(int x) { //@ assert x<=0; int y = x; /*@ assert y <= 0 && x == y; */ return y; } struct inner { int a, b; char c; void *p; }; struct outer { struct inner *pinner; struct inner inner; int a; struct inner ainner[5]; int b; char c; long long l; }; int main (void) { struct inner inner; struct outer outer; outer.inner.a = 0; /*@ assert outer.inner.a == 0; */ /*@ assert outer.b == outer.inner.a && 0 != 1; */ return 0; } frama-c-20.0-Calcium/tests/spec/location_char.ml0000666000000000000000000000202113571573400016441 0ustar open Cil_types open Filepath let print_pos fmt pos = Format.fprintf fmt "line %d, char %d" pos.pos_lnum (pos.pos_cnum - pos.pos_bol) class print_term = object(self) inherit Visitor.frama_c_inplace method private should_print = let n = Kernel_function.get_name (Extlib.the self#current_kf) in n = "f" || n = "main" method! vterm v = if not self#should_print then Cil.SkipChildren else begin Kernel.feedback "Term %a:@\nstart %a@\nend %a" Printer.pp_term v print_pos (fst v.term_loc) print_pos (snd v.term_loc); Cil.DoChildren end method! vpredicate p = if not self#should_print then Cil.SkipChildren else begin Kernel.feedback "Predicate %a:@\nstart %a@\nend %a" Printer.pp_predicate p print_pos (fst p.pred_loc) print_pos (snd p.pred_loc); Cil.DoChildren end end let main () = Visitor.visitFramacFileSameGlobals (new print_term) (Ast.get()) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/spec/logic_array.i0000666000000000000000000000127513571573400015761 0ustar /*@ axiomatic Array_unsigned { logic integer size10 = 10; type T_array10_unsigned = unsigned [size10]; logic T_array10_unsigned C_tab10 reads \nothing; predicate check(T_array10_unsigned tab, integer idx, unsigned v) = (tab[idx] == v) ; logic T_array10_unsigned modified(T_array10_unsigned tab, integer idx, unsigned v) = { tab \with [idx] = v }; lemma check_modified: \forall T_array10_unsigned tab, integer idx, unsigned v; check(modified(tab,idx,v),idx,v); } */ int A[]; int B[2] = { 42, 43 }; /*@ logic int f(int x[], integer idx) = x[idx]; */ /*@ lemma foo{L}: f(B,0) == 42; */ /*@ lemma bar{L}: f(A,0) == 44; */ /*@ lemma bli{L}: A != B; */ int A[] = { 44, 45, 46 }; frama-c-20.0-Calcium/tests/spec/logic_coerce.i0000666000000000000000000000120413571573400016073 0ustar /* run.config DONTRUN: fixing lack of coercions in function/data constructors applications STDOPT: +"-kernel-msg-key printer:logic-coercions" */ /*@ logic integer f(integer x) = x + 1; */ /*@ logic integer g(int x) = x + 2; */ /*@ logic int h(int x) = x; */ /*@ lemma trivial: \forall int x; f(x) == g(x) - 1; */ /*@ lemma trivial2: \forall int x; f(x) == h(x) + 1; */ /*@ logic int o(int x) = (int) (x + 2); */ /*@ logic integer o(integer x) = x + 1; */ /*@ lemma overload1: \forall int x; o(x) <= g(x); */ /*@ lemma overload2: \forall integer x; o(x) == f(x); */ /*@ type foo_t = Foo(integer); */ /*@ logic foo_t foo(int x) = Foo(x); */ frama-c-20.0-Calcium/tests/spec/logic_compare.c0000666000000000000000000000026013571573400016254 0ustar /*@ axiomatic Foo { @ type foo; @ predicate test(foo x); @ axiom foo_eq_refl: \forall foo x; x == x; @ axiom foo_test: \forall foo x; test(x); @ } @*/ frama-c-20.0-Calcium/tests/spec/logic_def.c0000666000000000000000000000024013571573400015362 0ustar /* run.config STDOPT: +"-eva -eva-verbose 2" */ //@ logic integer foo(int x) = x + 2 ; int main() { int x = 42; //@ assert foo(x) >= x; return 0; } frama-c-20.0-Calcium/tests/spec/logic_label.c0000666000000000000000000000154213571573400015711 0ustar void f () { int x = 0; L: x++; /*@ ensures \at(\true,Pre); */ x++; /*@ assert \at(x,L) == 0; */ /*@ assert \at(x==0,L); */ } int g(int i) { lab: //@ assert i == \at(i,lab); return i; } //@ predicate modified{L1,L2}(int x) = \at(x,L1)!=\at(x,L2); //@ logic integer diff{L1,L2}(integer x) = \at(x,L1) - \at(x,L2); int h() { int x = 0; l: x++; //@ assert modified{Here,l}(x) && diff{Here,l}(x) == 1; return 0; } //@ logic integer foo{L}(integer x) = x+1; //@ assigns x[0..foo(0)]; int u(int *x) { *(x++)=0; *x = 1; /*@ assert \at(\true,Pre); */ return *x; } int X; void labels_in_stmt_annot (void) { X ++; /*@ requires X > \at(X, Pre); ensures X == \old(X) + 1; ensures X == \at(X,Pre) + 2; ensures X == \at(X,Post); */ X++; //@ ensures X == \at(X,Here); X++; //@ assert X == \at(X,Pre) + 3; } frama-c-20.0-Calcium/tests/spec/logic_labels_wrong.c0000666000000000000000000000141213571573400017304 0ustar int x; // wrong: multiply defined label //@ predicate p{L,L}(integer n) = n > 0 ; // label missing, but automatically inferred //@ predicate p(int t[]) = t[0]; /*@ axiomatic Q { @ predicate q(int t[]); @ //label missing, but automatically inferred @ axiom q_ax: \forall int t[]; t[0] == 0 ==> q(t); @ } @*/ void f() { // wrong: \old forbidden in loop invariants //@ loop invariant x == \old(x); for (;;) ; // wrong: label undefined //@ assert \at(x,L0) == 0; // wrong: label defined later //@ assert \at(x,L1) == 0; for(;;) { L2: x = 0; } // wrong: label defined in inner block //@ assert \at(x,L2) == 0; L1: x = 0; } /* Local Variables: compile-command: "../../bin/toplevel.opt -pp-annot -print logic_labels_wrong.c" End: */ frama-c-20.0-Calcium/tests/spec/logic_type.c0000666000000000000000000000153113571573400015611 0ustar /*@ type t; */ /*@ logic t create(int x); */ /*@ logic t1 create(int y); // error: type does not exist */ /*@ type t2 = t2; */ //@ logic t2 foo; //@ predicate p(t2 x) = foo == x; typedef struct { int x ; int y ; } Point ; /*@ axiomatic A { type point = Point; predicate Q(point * tt) reads tt[0..1], tt[2].x, tt[2].y; type triangle = point[3]; predicate P(triangle tt) = tt[1].x == tt[2].y; } */ /*@ ensures Q(q); @ ensures P((triangle) q); */ void f(Point *q); Point tab[3]; /*@ ensures Q(&tab[0]); @ ensures P(tab); */ void h(void) { f(tab) ; } //@ logic t t_from_t(t x) = (t) x; //@ logic _Bool _Bool_from_boolean(boolean b) = (_Bool) b; //@ logic boolean boolean_from_integer(integer b) = (boolean) b; //@ logic boolean boolean_from_int(int b) = (boolean) b; //@ logic boolean boolean_from_Bool(_Bool b) = (boolean) b; frama-c-20.0-Calcium/tests/spec/loop_labels.i0000666000000000000000000000040413571573400015752 0ustar int main () { int x = 0; /*@ loop invariant \at(x,LoopEntry) == 0; loop invariant \at(x,LoopCurrent) <= 15; */ while (x<15) { x++; /*@ assert x == \at(x,LoopCurrent) + 1; */ } // Rejected. /*@ assert \at(x,LoopEntry) == 0; */ } frama-c-20.0-Calcium/tests/spec/loop_labels_unroll.i0000666000000000000000000000060413571573400017347 0ustar int main () { int x = 0; /*@ loop pragma UNROLL 4; loop invariant \at(x,LoopEntry) == 0; loop invariant \at(x,LoopCurrent) <= 15; */ while (x<15) { x++; /*@ assert x == \at(x,LoopCurrent) + 1; */ int i = 0; /*@ loop invariant \at(i,LoopEntry) == 0; */ while (i<4) { i++; /*@ assert \at(i,LoopCurrent) == i-1; */ } /*@ assert i > 0; */ } } frama-c-20.0-Calcium/tests/spec/max.c0000666000000000000000000000237613571573400014250 0ustar /* various specification of max function */ /*@ axiomatic IsMax { @ predicate is_max{L}(integer max, int t[], integer length); @ // reads t[..]; @ axiom max_gt{L}: @ \forall int t[], integer max, length, i; @ is_max(max,t,length) ==> 0 <= i < length ==> t[i] <= max; @ axiom max_eq{L}: @ \forall int t[], integer max, length; @ is_max(max, t, length) ==> \exists integer i; t[i] == max; @ } @*/ /*@ requires \valid_range(t,0,n-1); @ behavior nonempty: @ assumes n > 0; @ ensures 0<= \result < n && @ (\forall int i; 0 <= i < n ==> t[\result] >= t[i]) && @ is_max(t[\result],(int[])t,n); @ behavior empty: @ assumes n <= 0; @ ensures \result == -1; @*/ int max(int t[], int n) { int imax = 0, i; /*@ ghost int max; */ if (n<=0) return -1; /*@ ghost max = t[0]; */ /*@ loop invariant (\forall int j; 0<= j < i ==> t[imax] >= t[j]) && is_max(max,(int[])t,i-1); */ for(i = 1; i < n; i++) { if (t[i] > t[imax]) { imax = i; /*@ ghost max = t[i]; */ } } return imax; } int main() { int test [] = { 1, 2, 3, 4, 9, 8, 7, 6, 5, 10}; /*@ assert \valid_range(test,0,9); */ int x = max(test,10); /*@ assert test[x] >= 10; */ return 0; } frama-c-20.0-Calcium/tests/spec/merge_1.i0000666000000000000000000000033413571573400015000 0ustar /* run.config STDOPT: +"tests/spec/merge_2.i" */ /*@ requires \valid(s); @ assigns \nothing; @ ensures \result == 0 && \valid(s); @*/ extern int slen(const char* s); /*@ requires x>=0; */ extern int f(int x); frama-c-20.0-Calcium/tests/spec/merge_2.i0000666000000000000000000000055713571573400015010 0ustar /* run.config * DONTRUN: part of merge_1.i */ /*@ requires \valid(str2); @ assigns \nothing; @ @*/ int slen(const char* str2); /*@ @ assigns \nothing; @ ensures \result == 0 && \valid(str); @*/ int slen(const char* str) { const char *s; for (s = str; *s; ++s); return(s - str); } //@ requires y>=0; int f(int y); int f(int z) { return z-1; } frama-c-20.0-Calcium/tests/spec/merge_assigns_bts1253.i0000666000000000000000000000036613571573400017477 0ustar /*@ assigns \result \from nptr[..] ; */ double atof(const char *nptr); /*@ assigns \result \from *(nptr+(..)); */ double atof(const char *nptr); /*@ assigns nptr[..] ; */ void f(char *nptr); /*@ assigns *(nptr+(..)); */ void f(char *nptr); frama-c-20.0-Calcium/tests/spec/merge_bts938.c0000666000000000000000000000021513571573400015664 0ustar /* run.config STDOPT: +"tests/spec/merge_bts938_1.c" */ #include "tests/spec/merge_bts938.h" //@ ensures test:\true; int main(void) { } frama-c-20.0-Calcium/tests/spec/merge_bts938.h0000666000000000000000000000012213571573400015666 0ustar extern int tab[10]; //@ ensures tab == {tab \with [0]= (int)0} ; int main(void) ; frama-c-20.0-Calcium/tests/spec/merge_bts938_1.c0000666000000000000000000000021213571573400016101 0ustar /* run.config DONTRUN: main test is merge_bts938.c */ #include "tests/spec/merge_bts938.h" //@ ensures test1: \true; int main(void); frama-c-20.0-Calcium/tests/spec/merge_different_assigns.i0000666000000000000000000000034013571573400020332 0ustar /* run.config STDOPT: +"tests/spec/merge_different_assigns_bis.i" */ int x, z, t, u, v, w; /*@ assigns x; assigns z \from x; assigns u; assigns t \from \nothing; assigns w; assigns x \from x; */ int f(int y); frama-c-20.0-Calcium/tests/spec/merge_different_assigns_bis.i0000666000000000000000000000035113571573400021171 0ustar /* run.config DONTRUN: main test is merge_different_assigns.i */ int x, t, u, v, w, x; /*@ assigns x; assigns t \from t; assigns u; assigns v; assigns \result \from y; assigns w \from w; assigns x; */ int f(int y); frama-c-20.0-Calcium/tests/spec/merge_logic_globals.h0000666000000000000000000000065713571573400017447 0ustar /* a.h */ typedef struct s_t { int n; } t; /*@ type invariant inv_t(t x) = x.n > 0; */ /* @ predicate p(int x) reads x; */ int i = 42; /*@ predicate p{Here}(int x) = x >= i; */ /*@ axiomatic Bar { logic integer li; } */ /*@ ensures i == li; */ void test() { } /*@ axiomatic Foo { type foo; logic foo ff(foo x,char * y); predicate fp(foo x, foo y); axiom fffp: \forall foo x, char* y; fp(x,ff(x,y)) && *y == 0; } */ frama-c-20.0-Calcium/tests/spec/merge_logic_globals_1.c0000666000000000000000000000026413571573400017654 0ustar /* run.config OPT: -print @PTEST_DIR@/merge_logic_globals_2.c -cpp-extra-args="-I@PTEST_DIR@" */ #include "merge_logic_globals.h" int main() { test(); /*@ assert p((int)li); */ } frama-c-20.0-Calcium/tests/spec/merge_logic_globals_2.c0000666000000000000000000000024313571573400017652 0ustar /* run.config DONTRUN: main test is merge_logic_globals_1.c */ #include "merge_logic_globals.h" int f() { t x; x.n = i; i--; /*@ assert p(x.n); */ return x.n; } frama-c-20.0-Calcium/tests/spec/model.i0000666000000000000000000000216213571573400014562 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs STDOPT: +"-no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs" */ struct S { int x; int y; }; typedef struct S T; /*@ model struct S { integer z }; */ /*@ model struct S { integer x }; */ // KO field exists in the struct /*@ model T { integer t; }; */ /*@ model T { integer z }; */ //KO field exists in parent type /*@ model T { integer x }; */ //KO field exists in parent type /*@ type invariant t_invariant(T t) = t.t == t.z * 2; */ /*@ assigns *s; ensures s->z == \result; */ int f(struct S* s); /*@ type invariant sum(struct S s) = s.z == s.x + s.y; */ void main() { struct S s = { 0, 0 }; T t = {1,2}; /*@ assert t.t == 6 && t.z == 3; */ int a = f(&s); if (a && !s.x) { /*@ assert s.y != 0; */ } else { s.x == 1; } /*@ assert s.z != 0; */ } /*@ model double { real exact }; */ /*@ model double { real round }; */ /*@ ensures \result == (double)(x+y); ensures \result.exact == x.exact + y.exact; ensures \result == \result.exact + \result.round; */ double add(double x, double y); double foo(double x) { return add(x,x); } frama-c-20.0-Calcium/tests/spec/model.ml0000666000000000000000000000241613571573400014744 0ustar open Cil_types let find () = let module M = struct exception Found of typeinfo end in try List.iter (function | GType (ty,_) -> if ty.tname = "T" then raise (M.Found ty) | _ -> ()) (Ast.get ()).globals; Kernel.fatal "No typedef for T: test is broken" with M.Found ty -> ty let print_models typ = let models = Annotations.model_fields typ in Format.printf "Model fields for type %a:@\n" Printer.pp_typ typ; List.iter (fun m -> Format.printf "%s, " m.mi_name) models; Format.printf "@\n" let e = Emitter.create "test" [Emitter.Global_annot] ~correctness:[] ~tuning:[] let add_model ty = let m = { mi_name = "test_field"; mi_attr = []; mi_field_type = Linteger; mi_base_type = ty; mi_decl = Cil_datatype.Location.unknown } in let annot = Dmodel_annot (m,Cil_datatype.Location.unknown) in Annotations.add_global e annot; annot let remove_model annot = Annotations.remove_global e annot let main () = let t = find () in let typ = TNamed(t,[]) in print_models typ; let m = add_model typ in Format.printf "After adding field@."; print_models typ; remove_model m; Format.printf "After removing field@."; print_models typ; Format.print_flush () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/spec/model1.c0000666000000000000000000000040013571573400014626 0ustar /* run.config STDOPT: +"tests/spec/model2.c" */ #include "tests/spec/model1.h" void main () { struct S s; reset(&s); inc(&s); /*@ assert s.foo > 0; */ /*@ loop variant s.foo; */ while (is_pos(&s)) dec(&s); /*@ assert s.foo <= 0; */ } frama-c-20.0-Calcium/tests/spec/model1.h0000666000000000000000000000106413571573400014642 0ustar struct S; /*@ model struct S { integer foo; }; */ /*@ requires \valid(s); assigns *s; ensures s->foo == 0; */ void reset (struct S* s); /*@ requires \valid(s); assigns *s; ensures s->foo > \at(s->foo,Pre); */ void inc(struct S* s); /*@ requires \valid(s); assigns *s; ensures s->foo < \at(s->foo,Pre); */ void dec(struct S* s); /*@ requires \valid(s); assigns \nothing; behavior is_true: assumes s->foo > 0; ensures \result == 1; behavior is_false: assumes s->foo <= 0; ensures \result == 0; */ int is_pos(struct S* s); frama-c-20.0-Calcium/tests/spec/model2.c0000666000000000000000000000054513571573400014641 0ustar /* run.config DONTRUN: main test is in tests/spec/model1.c */ #include "tests/spec/model1.h" struct S { int bar; }; /*@ type invariant foobar(struct S s) = s.bar == s.foo; */ void reset (struct S* s) { s->bar == 0; } void inc(struct S* s) { s->bar += 5; } void dec(struct S* s) { s->bar--; } int is_pos (struct S* s) { return (s->bar > 0) ? 1 : 0; } frama-c-20.0-Calcium/tests/spec/multi_axiomatic_1.i0000666000000000000000000000023613571573400017072 0ustar /* run.config OPT: @PTEST_DIR@/multi_axiomatic_2.i -print */ /*@ axiomatic ax { logic int Acc(int m); } predicate Bnd(integer n,int m) = Acc(m)<=9; */ frama-c-20.0-Calcium/tests/spec/multi_axiomatic_2.i0000666000000000000000000000042613571573400017074 0ustar /* run.config DONTRUN: main configuration in @PTEST_DIR@/multi_axiomatic_1.i */ /*@ axiomatic ax { logic int Acc(int m); } predicate Bnd(integer n,int m) = Acc(m)<=9; predicate Bnd(integer n) = Bnd(n, (int) 0); */ /*@ requires Bnd(1); ensures \true; */ void foo(void) {} frama-c-20.0-Calcium/tests/spec/multi_behavior.c0000666000000000000000000000027513571573400016470 0ustar int a,b; /*@ behavior b: ensures a!=0; ensures a==0; assigns a; behavior c: ensures a==0; ensures a==0; assigns a; behavior d: assumes a==0; */ void f(void) { a=0; } frama-c-20.0-Calcium/tests/spec/multi_labels.i0000666000000000000000000000013713571573400016136 0ustar int labels (void) { int x = 0 ; L1: L2: //@ assert \at(x,L1) == \at(x,L2) ; return x ; } frama-c-20.0-Calcium/tests/spec/multidecl.c0000666000000000000000000000050713571573400015437 0ustar /*@ predicate p0(integer x) = x == 0; @ predicate p1(integer x) = x == 1; @ lemma excl: \forall integer x; ! (p0(x) && p1(x)); @*/ // not well-typed (testing localization of error messages) /*@ predicate p2(int x) = x == 0; @ predicate p3(int x) = x == 1; @ lemma excl2: \forall integer x; ! (p2(x) && p3(x)); @*/ frama-c-20.0-Calcium/tests/spec/multidim.c0000666000000000000000000000054013571573400015276 0ustar typedef int TT[3][4] ; TT ttt[5] ; int (*pt)[3][4] = ttt ; // int (*)[3][4] and TT* are identical /*@ axiomatic A { @ predicate P(TT * pt) ; @ predicate Q(int (*pt)[3][4] ) ; @ } @*/ //KO: implicit conversion from array to pointer /*@ requires P(ttt) ; */ void g(); //OK: explicit conversion. /*@ requires Q(&ttt[0]) ; @*/ void f() { } frama-c-20.0-Calcium/tests/spec/multiple_decl_def_1.c0000666000000000000000000000035513571573400017336 0ustar /* run.config OPT: -print tests/spec/multiple_decl_def_2.c -journal-disable */ /* see bug #43 && #128 */ /*@ requires x >= 0; */ extern int f(int x); /*@ requires x >= 0; */ extern int g(int x); int main () { g(0); return f(0); } frama-c-20.0-Calcium/tests/spec/multiple_decl_def_2.c0000666000000000000000000000021213571573400017327 0ustar /* run.config DONTRUN: linked with multiple_decl_def_1.c which is the real test. */ /*@ requires y <= 0; */ int f(int y) { return y; } frama-c-20.0-Calcium/tests/spec/multiple_file_1.c0000666000000000000000000000034113571573400016523 0ustar /* run.config OPT: -print tests/spec/multiple_file_2.c -journal-disable */ /* see bug #43 */ /*@ requires x >= 0; */ extern int f(int x); /*@ requires x >= 0; */ extern int g(int x); int main () { g(0); return f(0); } frama-c-20.0-Calcium/tests/spec/multiple_file_2.c0000666000000000000000000000017113571573400016525 0ustar /* run.config DONTRUN: linked with multiple_file_1.c which is the real test. */ /*@ requires y <= 0; */ int g(int y); frama-c-20.0-Calcium/tests/spec/multiple_include.h0000666000000000000000000000035113571573400017015 0ustar /* a.h */ typedef struct s_t { int n; } t; /*@ type invariant inv_t(t x) = x.n > 0; */ /* @ predicate p(int x) reads x; */ /* if uncommented, should lead to an error */ static int i = 42; /*@ predicate p{Here}(int x) = x >= i; */ frama-c-20.0-Calcium/tests/spec/multiple_include_1.c0000666000000000000000000000027213571573400017232 0ustar /* run.config DONTRUN: whole test is done in multiple_include_2.c */ #include "multiple_include.h" /* @ logic integer li = 42; */ /*@ ensures p(\result); */ int foo() { return i; } frama-c-20.0-Calcium/tests/spec/multiple_include_2.c0000666000000000000000000000031413571573400017230 0ustar /* run.config OPT: -kernel-warn-key=annot-error=active -print tests/spec/multiple_include_1.c -journal-disable */ #include "multiple_include.h" /*@ requires p(x); */ void bar(int x) { i+=x; return; } frama-c-20.0-Calcium/tests/spec/multiple_spec.c0000666000000000000000000000020713571573400016317 0ustar /* see bug #43 */ /*@ requires x >=0; */ int f (int x); /*@ requires y <= 0; */ int f (int y); int main () { f (0); return 0; } frama-c-20.0-Calcium/tests/spec/nested.c0000666000000000000000000000010313571573400014727 0ustar /* void f() { int i = 0; //@ assert i == 0; } */ void g() { } frama-c-20.0-Calcium/tests/spec/null_ptr.c0000666000000000000000000000127313571573400015315 0ustar //@ predicate null(char *x) = x == 0; //@ predicate eq(char *x, char *y) = x == y; //@ predicate my_null(char *x) = x == (void*)0; void f(char *x) { x = 0; //@ assert x == (void*)0; //@ assert my_null(x); //@ assert null(x); //@ assert eq(x,0); } //@ ensures \result == \true; int g() { return 1; } /*@ predicate foo (integer x) = x != 0; */ //@ predicate totology_1{L} = !\valid{L}((char*)\null); //@ predicate totology_2{L1,L2} = !\fresh{L1,L2}(\null,1); //@ predicate error_1 = foo(\true); // -> Ignored global annotation //@ predicate error_2{L} = \valid{L}(\null); // -> Ignored global annotation //@ predicate error_3{L} = \valid_read{L}(\null); // -> Ignored global annotation frama-c-20.0-Calcium/tests/spec/old_prm.i0000666000000000000000000000022113571573400015110 0ustar struct st { int t[10]; } S; int i,j ; //@ ensures S.t[i] == s.t[j] + y[x]; void main (struct st s, int x, int *y) { S.t[i] = s.t[j] + y[x]; } frama-c-20.0-Calcium/tests/spec/onelineghost.c0000666000000000000000000000012613571573400016150 0ustar int main () { //@ ghost int x = 0; //@ ghost x++; return 0; } //@ ghost int G; frama-c-20.0-Calcium/tests/spec/oracle/0000777000000000000000000000000013571573400014554 5ustar frama-c-20.0-Calcium/tests/spec/oracle/Extend.res.oracle0000666000000000000000000000203713571573400017764 0ustar [kernel] Parsing tests/spec/Extend.i (no preprocessing) [kernel:annot-error] tests/spec/Extend.i:31: Warning: unexpected token 'baz' [kernel] Reparsing file /* Generated by Frama-C */ int f(int x); /*@ behavior test: foo y ≡ 1; bar \old(y) + \result ≡ 0; bla \trace(3) ∧ \trace(2); */ int g(int y); /*@ foo x ≡ 0; bar \result ≡ 0; bla \trace(6) ∨ \trace(5); */ int f(int x) { int s = 0; { int i = 0; /*@ loop lfoo i ≤ x; loop baz \at(i,LoopEntry), 0; */ while (i < x) { int tmp; tmp = g(i); s += tmp; i ++; } } /*@ ca_foo s ≡ 0; */ ; return s; } int k(int z) { int tmp; int x = z; int y = 0; /*@ ns_foo \at(x,Post) ≡ z + 1; */ { tmp = x; x ++; y = tmp; } return y; } /*@ global_foo ∀ ℤ x; x < x + 1; */ /*@ behavior ca_foo: ensures ca_foo: \true; */ void loop(void) { /*@ for ca_foo: ca_foo \true; */ ; /*@ ns_foo \true; */ /*@ baz \true; */ /*@ loop invariant \true; */ while (1) break; return; } frama-c-20.0-Calcium/tests/spec/oracle/_Bool.res.oracle0000666000000000000000000000107413571573400017567 0ustar [kernel] Parsing tests/spec/_Bool.i (no preprocessing) /* Generated by Frama-C */ struct _Z6Point2 { int x ; int y ; }; /*@ logic _Bool _ZN6Point2Eeq{L}(struct _Z6Point2 *this, struct _Z6Point2 b) = \at((_Bool)(this->x ≡ b.x ∧ this->y ≡ b.y),L); */ void _ZN6Point2EC1(struct _Z6Point2 *this) { this->x = 0; this->y = 0; return; } /*@ ensures _ZN6Point2Eeq(\old(this), *\old(p)) ≢ 0; assigns this->x, this->y; */ void _ZN6Point2EC1RK6Point2(struct _Z6Point2 *this, struct _Z6Point2 const *p) { this->x = p->x; this->y = p->y; return; } frama-c-20.0-Calcium/tests/spec/oracle/abrupt.res.oracle0000666000000000000000000000345313571573400020035 0ustar [kernel] Parsing tests/spec/abrupt.i (no preprocessing) /* Generated by Frama-C */ int f(int c) { int x = 0; /*@ breaks x ≡ 1; */ if (! c) goto switch_0_0; else if (c == 1) goto switch_0_1; else if (c == 2) goto switch_0_2; else { goto switch_0_default; goto switch_0_break; } switch_0_0: x = 1; /*@ assert x ≡ 1; */ ; goto switch_0_break; switch_0_1: x = 3; switch_0_2: x ++; switch_0_default: x ++; switch_0_break: ; while (1) { while_1_continue: ; __sid_13_label: /*@ breaks x ≡ \old(x); continues x ≡ \old(x) + 1; */ { if (x < c) { x ++; /*@ assert x ≡ \at(x,__sid_13_label) + 1; */ ; goto while_1_continue; } /*@ assert x ≡ \at(x,__sid_13_label); */ ; goto while_1_break; } } while_1_break: ; return x; } /*@ ensures \old(x) ≡ 1 ⇒ \result ≡ 1; */ int f5(int x) { int y = 0; if (! (x == 1)) goto switch_0_break; switch_0_1: while (x > 0) /*@ breaks x > 0; */ /*@ assert x > 0; */ goto while_1_break; while_1_break: ; y = 1; switch_0_break: ; return y; } int job_inline(int a) { int __retres; if (a > 10) { __retres = 10; goto return_label; } if (a > 20) { __retres = 20; goto return_label; } /*@ returns \result ≡ 0; ensures \false; */ { __retres = 0; /*@ assert __retres ≡ 0; */ ; goto return_label; } return_label: return __retres; } int job_block(int a) { int __retres; if (a > 10) { __retres = 10; goto return_label; } if (a > 20) { __retres = 20; goto return_label; } /*@ returns \result ≡ 0; ensures \false; */ { __retres = 0; /*@ assert __retres ≡ 0; */ ; goto return_label; } return_label: return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/acsl_basic_allocator.res.oracle0000666000000000000000000000500513571573400022656 0ustar [kernel] Parsing tests/spec/acsl_basic_allocator.c (with preprocessing) /* Generated by Frama-C */ #include "stdlib.h" enum _bool { false = 0, true = 1 }; typedef enum _bool bool; struct _memory_block { size_t size ; bool free ; char *data ; }; typedef struct _memory_block memory_block; struct _memory_block_list { memory_block *block ; struct _memory_block_list *next ; }; typedef struct _memory_block_list memory_block_list; typedef memory_block_list *memory_pool; /*@ type invariant inv_memory_block(memory_block mb) = 0 < mb.size ∧ \offset(mb.data) ≡ 0 ∧ \block_length(mb.data) ≡ mb.size; */ /*@ predicate used_memory_block{L}(memory_block mb) = mb.free ≡ false ∧ inv_memory_block(mb); */ /*@ predicate freed_memory_block{L}(memory_block mb) = mb.free ≡ true ∧ inv_memory_block(mb); */ /*@ predicate valid_memory_block{L}(memory_block *mb) = \valid(mb) ∧ inv_memory_block(*mb); */ /*@ predicate valid_used_memory_block{L}(memory_block *mb) = \valid(mb) ∧ used_memory_block(*mb); */ /*@ predicate valid_freed_memory_block{L}(memory_block *mb) = \valid(mb) ∧ freed_memory_block(*mb); */ /*@ predicate valid_memory_block_list{L}(memory_block_list *mbl) = \valid(mbl) ∧ valid_memory_block(mbl->block) ∧ (mbl->next ≡ \null ∨ valid_memory_block_list(mbl->next)); */ /*@ predicate valid_memory_pool{L}(memory_pool *mp) = \valid(mp) ∧ valid_memory_block_list(*mp); */ /*@ requires valid_memory_pool(arena) ∧ 0 < s; ensures valid_used_memory_block(\result); */ memory_block *memory_alloc(memory_pool *arena, size_t s) { memory_block *__retres; memory_block *mb; size_t mb_size; char *mb_data; memory_block_list *mbl = *arena; while (mbl != (memory_block_list *)0) { mb = mbl->block; if (mb->free) if (s <= mb->size) { mb->free = false; __retres = mb; goto return_label; } mbl = mbl->next; } if ((size_t)1000 < s) mb_size = s; else mb_size = (unsigned int)1000; mb_data = (char *)malloc(mb_size); mb = (memory_block *)malloc(sizeof(memory_block)); mb->size = mb_size; mb->free = false; mb->data = mb_data; mbl = (memory_block_list *)malloc(sizeof(memory_block_list)); mbl->block = mb; mbl->next = *arena; *arena = mbl; __retres = mb; return_label: return __retres; } /*@ requires valid_memory_pool(arena) ∧ valid_used_memory_block(block); ensures valid_freed_memory_block(\old(block)); */ void memory_free(memory_pool *arena, memory_block *block) { block->free = true; return; } frama-c-20.0-Calcium/tests/spec/oracle/acsl_by_example.res.oracle0000666000000000000000000003223713571573400021671 0ustar [kernel] Parsing tests/spec/acsl_by_example.c (with preprocessing) [kernel] tests/spec/acsl_by_example.c:3: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [kernel] tests/spec/acsl_by_example.c:5: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. /* Generated by Frama-C */ /*@ predicate is_valid_int_range{L}(int *p, int n) = \at(0 ≤ n ∧ \valid(p + (0 .. n - 1)),L); */ /*@ lemma foo{L}: ∀ int *p, int n; is_valid_int_range(p, n) ⇔ \valid(p + (0 .. n - 1)); */ /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); assigns \nothing; behavior all_equal: assumes ∀ int i; 0 ≤ i < n ⇒ *(a + i) ≡ *(b + i); ensures \result ≡ 1; behavior some_not_equal: assumes ∃ int i; 0 ≤ i < n ∧ *(a + i) ≢ *(b + i); ensures \result ≡ 0; complete behaviors all_equal, some_not_equal; disjoint behaviors all_equal, some_not_equal; */ int equal(int const *a, int n, int const *b) { int __retres; { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant ∀ int k; 0 ≤ k < i ⇒ *(a + k) ≡ *(b + k); loop variant n - i; */ while (i < n) { if (*(a + i) != *(b + i)) { __retres = 0; goto return_label; } i ++; } } __retres = 1; return_label: return __retres; } /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior some: assumes ∃ int i; 0 ≤ i < n ∧ *(a + i) ≡ val; ensures 0 ≤ \result < \old(n); ensures *(\old(a) + \result) ≡ \old(val); ensures ∀ int i; 0 ≤ i < \result ⇒ *(\old(a) + i) ≢ \old(val); behavior none: assumes ∀ int i; 0 ≤ i < n ⇒ *(a + i) ≢ val; ensures \result ≡ \old(n); complete behaviors some, none; disjoint behaviors some, none; */ int find(int const *a, int n, int val) { int __retres; { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant ∀ int k; 0 ≤ k < i ⇒ *(a + k) ≢ val; loop variant n - i; */ while (i < n) { if (*(a + i) == val) { __retres = i; goto return_label; } i ++; } } __retres = n; return_label: return __retres; } /*@ predicate found{A}(int *a, int n, int val) = ∃ int i; 0 ≤ i < n ∧ *(a + i) ≡ val; */ /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior some: assumes found(a, n, val); ensures 0 ≤ \result < \old(n); ensures *(\old(a) + \result) ≡ \old(val); ensures ¬found(\old(a), \result, \old(val)); behavior none: assumes ¬found(a, n, val); ensures \result ≡ \old(n); complete behaviors some, none; disjoint behaviors some, none; */ int find2(int const *a, int n, int val) { int __retres; { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant ¬found(a, i, val); loop variant n - i; */ while (i < n) { if (*(a + i) == val) { __retres = i; goto return_label; } i ++; } } __retres = n; return_label: return __retres; } /*@ predicate found_first_of{A}(int *a, int m, int *b, int n) = ∃ int i; 0 ≤ i < m ∧ found(b, n, \at(*(a + i),A)); */ /*@ requires is_valid_int_range(a, m); requires is_valid_int_range(b, n); assigns \nothing; behavior found: assumes found_first_of(a, m, b, n); ensures 0 ≤ \result < \old(m); ensures found(\old(b), \old(n), *(\old(a) + \result)); ensures ¬found_first_of(\old(a), \result, \old(b), \old(n)); behavior not_found: assumes ¬found_first_of(a, m, b, n); ensures \result ≡ \old(m); complete behaviors found, not_found; disjoint behaviors found, not_found; */ int find_first_of(int const *a, int m, int const *b, int n) { int __retres; { int i = 0; /*@ loop invariant 0 ≤ i ≤ m; loop invariant ¬found_first_of(a, i, b, n); loop variant m - i; */ while (i < m) { int tmp; tmp = find(b,n,*(a + i)); ; if (tmp < n) { __retres = i; goto return_label; } i ++; } } __retres = m; return_label: return __retres; } /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior empty: assumes n ≡ 0; ensures \result ≡ 0; behavior not_empty: assumes 0 < n; ensures 0 ≤ \result < \old(n); ensures ∀ int i; 0 ≤ i < \old(n) ⇒ *(\old(a) + i) ≤ *(\old(a) + \result); ensures ∀ int i; 0 ≤ i < \result ⇒ *(\old(a) + i) < *(\old(a) + \result); complete behaviors empty, not_empty; disjoint behaviors empty, not_empty; */ int max_element(int const *a, int n) { int __retres; if (n == 0) { __retres = 0; goto return_label; } int max = 0; { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant 0 ≤ max < n; loop invariant ∀ int k; 0 ≤ k < i ⇒ *(a + k) ≤ *(a + max); loop invariant ∀ int k; 0 ≤ k < max ⇒ *(a + k) < *(a + max); loop variant n - i; */ while (i < n) { if (*(a + max) < *(a + i)) max = i; i ++; } } __retres = max; return_label: return __retres; } /*@ requires n > 0; requires \valid(p + (0 .. n - 1)); ensures ∀ int i; 0 ≤ i ≤ \old(n) - 1 ⇒ \result ≥ *(\old(p) + i); ensures ∃ int e; 0 ≤ e ≤ \old(n) - 1 ∧ \result ≡ *(\old(p) + e); assigns \nothing; */ int max_seq(int const *p, int n) { int __retres; int tmp; tmp = max_element(p,n); ; __retres = *(p + tmp); return __retres; } /*@ axiomatic counting_axioms { logic ℤ counting{L}(int *a, ℤ n, int val) reads *(a + (0 .. n - 1)); axiom counting_empty{L}: ∀ int *a, ℤ n, int val; n ≤ 0 ⇒ counting(a, n, val) ≡ 0; axiom counting_hit{L}: ∀ int *a, ℤ n, int val; n ≥ 0 ∧ *(a + n) ≡ val ⇒ counting(a, n + 1, val) ≡ counting(a, n, val) + 1; axiom counting_miss{L}: ∀ int *a, ℤ n, int val; n ≥ 0 ∧ *(a + n) ≢ val ⇒ counting(a, n + 1, val) ≡ counting(a, n, val); } */ /*@ requires is_valid_int_range(a, n); ensures \result ≡ counting(\old(a), \old(n), \old(val)); assigns \nothing; */ int count(int const *a, int n, int val) { int cnt = 0; { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant 0 ≤ cnt ≤ i; loop invariant cnt ≡ counting(a, i, val); loop variant n - i; */ while (i < n) { if (*(a + i) == val) cnt ++; i ++; } } return cnt; } /*@ requires \valid(p); requires \valid(q); ensures *\old(p) ≡ \old(*q); ensures *\old(q) ≡ \old(*p); assigns *p, *q; */ void swap(int *p, int *q) { int const save = *p; *p = *q; *q = save; return; } /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); ensures ∀ int k; 0 ≤ k < \old(n) ⇒ *(\old(a) + k) ≡ \old(*(b + k)); ensures ∀ int k; 0 ≤ k < \old(n) ⇒ *(\old(b) + k) ≡ \old(*(a + k)); assigns *(a + (0 .. n - 1)), *(b + (0 .. n - 1)); */ void swap_ranges(int *a, int n, int *b) { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant ∀ int k; 0 ≤ k < i ⇒ *(a + k) ≡ \at(*(b + k),Pre); loop invariant ∀ int k; 0 ≤ k < i ⇒ *(b + k) ≡ \at(*(a + k),Pre); loop assigns *(a + (0 .. i - 1)), *(b + (0 .. i - 1)); loop variant n - i; */ while (i < n) { swap(a + i,b + i); i ++; } return; } /*@ requires is_valid_int_range(a, n); ensures ∀ int i; 0 ≤ i < \old(n) ⇒ *(\old(a) + i) ≡ \old(val); assigns *(a + (0 .. n - 1)); */ void fill(int *a, int n, int val) { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant ∀ int k; 0 ≤ k < i ⇒ *(a + k) ≡ val; loop variant n - i; */ while (i < n) { *(a + i) = val; i ++; } return; } /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); ensures ∀ int i; 0 ≤ i < \old(n) ⇒ *(\old(b) + i) ≡ *(\old(a) + i); assigns *(b + (0 .. n - 1)); */ void copy(int const *a, int n, int *b) { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant ∀ int k; 0 ≤ k < i ⇒ *(a + k) ≡ *(b + k); loop assigns *(b + (0 .. i - 1)); loop variant n - i; */ while (i < n) { *(b + i) = *(a + i); i ++; } return; } /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); ensures ∀ int j; 0 ≤ j < \old(n) ⇒ (*(\old(a) + j) ≡ \old(old_val) ∧ *(\old(b) + j) ≡ \old(new_val)) ∨ (*(\old(a) + j) ≢ \old(old_val) ∧ *(\old(b) + j) ≡ *(\old(a) + j)); ensures \result ≡ \old(n); assigns *(b + (0 .. n - 1)); */ int replace_copy(int const *a, int n, int *b, int old_val, int new_val) { { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant ∀ int j; 0 ≤ j < i ⇒ (*(a + j) ≡ old_val ∧ *(b + j) ≡ new_val) ∨ (*(a + j) ≢ old_val ∧ *(b + j) ≡ *(a + j)); loop assigns *(b + (0 .. i - 1)); loop variant n - i; */ while (i < n) { if (*(a + i) == old_val) *(b + i) = new_val; else *(b + i) = *(a + i); i ++; } } return n; } /*@ requires is_valid_int_range(a, n); requires is_valid_int_range(b, n); ensures ∀ int k; \result ≤ k < \old(n) ⇒ *(\old(b) + k) ≡ \old(*(b + k)); ensures ∀ int k; 0 ≤ k < \result ⇒ *(\old(b) + k) ≢ \old(val); ensures ∀ int x; x ≢ \old(val) ⇒ counting(\old(a), \old(n), x) ≡ counting(\old(b), \result, x); ensures \result ≡ \old(n) - counting(\old(a), \old(n), \old(val)); ensures 0 ≤ \result ≤ \old(n); assigns *(b + (0 .. n - 1)); */ int remove_copy(int const *a, int n, int *b, int val) { int j = 0; { int i = 0; /*@ loop invariant 0 ≤ j ≤ i ≤ n; loop invariant ∀ int k; j ≤ k < n ⇒ *(b + k) ≡ \at(*(b + k),Pre); loop invariant ∀ int k; 0 ≤ k < j ⇒ *(b + k) ≢ val; loop invariant ∀ int x; x ≢ val ⇒ counting(a, i, x) ≡ counting(b, j, x); loop invariant j ≡ i - counting(a, i, val); loop assigns *(b + (0 .. j - 1)); loop variant n - i; */ while (i < n) { if (*(a + i) != val) { int tmp; tmp = j; j ++; *(b + tmp) = *(a + i); } i ++; } } return j; } /*@ requires is_valid_int_range(a, n); requires val + n < (1 << 31) - 1; ensures ∀ int k; 0 ≤ k < \old(n) ⇒ *(\old(a) + k) ≡ \old(val) + k; assigns *(a + (0 .. n - 1)); */ void iota(int *a, int n, int val) { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant ∀ int k; 0 ≤ k < i ⇒ *(a + k) ≡ val + k; loop assigns *(a + (0 .. i - 1)); loop variant n - i; */ while (i < n) { *(a + i) = val + i; i ++; } return; } /*@ predicate adjacent_found{Label}(int *a, int n) = ∃ int i; 0 ≤ i < n - 1 ∧ *(a + i) ≡ *(a + (i + 1)); */ /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior some: assumes adjacent_found(a, n); ensures 0 ≤ \result < \old(n) - 1; ensures *(\old(a) + \result) ≡ *(\old(a) + (\result + 1)); ensures ¬adjacent_found(\old(a), \result); behavior none: assumes ¬adjacent_found(a, n); ensures \result ≡ \old(n); complete behaviors some, none; disjoint behaviors some, none; */ int adjacent_find(int *a, int n) { int __retres; if (0 == n) { __retres = n; goto return_label; } { int i = 0; /*@ loop invariant 0 ≤ i < n; loop invariant ¬adjacent_found(a, i); loop invariant 0 < i ⇒ *(a + (i - 1)) ≢ *(a + i); loop variant n - i; */ while (i < n - 1) { if (*(a + i) == *(a + (i + 1))) { __retres = i; goto return_label; } i ++; } } __retres = n; return_label: return __retres; } /*@ requires is_valid_int_range(a, n); assigns \nothing; behavior empty: assumes n ≡ 0; ensures \result ≡ 0; behavior not_empty: assumes 0 < n; ensures 0 ≤ \result < \old(n); ensures ∀ int i; 0 ≤ i < \old(n) ⇒ *(\old(a) + \result) ≤ *(\old(a) + i); ensures ∀ int i; 0 ≤ i < \result ⇒ *(\old(a) + \result) < *(\old(a) + i); */ int min_element(int *a, int n) { int __retres; if (0 == n) { __retres = n; goto return_label; } int min = 0; { int i = 0; /*@ loop invariant 0 ≤ i ≤ n; loop invariant 0 ≤ min < n; loop invariant ∀ int k; 0 ≤ k < i ⇒ *(a + min) ≤ *(a + k); loop invariant ∀ int k; 0 ≤ k < min ⇒ *(a + min) < *(a + k); loop variant n - i; */ while (i < n) { if (*(a + i) < *(a + min)) min = i; i ++; } } __retres = min; return_label: return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/add_global.res.oracle0000666000000000000000000000051513571573400020604 0ustar [kernel] Parsing tests/spec/add_global.i (no preprocessing) /* Generated by Frama-C */ /*@ axiomatic MyAxiomatic { axiom myaxiom: \true; } */ int main(void) { int __retres; __retres = 0; return __retres; } /* Generated by Frama-C */ int main(void) { int __retres; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/all.res.oracle0000666000000000000000000000525113571573400017306 0ustar [kernel] Parsing tests/spec/all.c (with preprocessing) [kernel:annot-error] tests/spec/all.c:32: Warning: Inconsistent relation chain. [kernel:annot-error] tests/spec/all.c:50: Warning: Assignment operators not allowed in annotations. [kernel:annot-error] tests/spec/all.c:54: Warning: reference to unknown behavior ZZZ_INEXISTENT_BEHAVIOR. Ignoring code annotation [kernel:annot-error] tests/spec/all.c:83: Warning: Global variable x is not a function. It cannot have a contract. /* Generated by Frama-C */ struct st { int a ; int b ; }; /*@ lemma z: ∀ int x; (x & x) ≡ x; */ /*@ lemma a: ∀ int x; (~x | x) ≡ -1; */ /*@ lemma b: ∀ int x; (~x ^ x) ≡ -1; */ /*@ lemma c: (\let x = 0; x + 1) ≡ 1; */ /*@ lemma d: (name: 77) ≡ 76 + 1; */ /*@ axiomatic Test { predicate P; predicate Q; axiom e: P ⊻ Q; axiom f: 0 ≢ 0? P: Q; axiom g: (P ⇒ P) ∧ (¬P ⇒ Q); axiom h: \let x = 0; x + 1 ≡ 1; axiom i: name: 77 ≡ 76 + 1; } */ /*@ predicate R(ℤ i, ℤ j) = (1 ≢ 0? i + j: (j: j)) ≡ i + j; */ /*@ predicate S(ℤ i, ℤ j) = (1 ≢ 0? (i: j): j) ≡ j; */ /*@ predicate T(ℤ i, ℤ j) = (1 ≢ 0? i: j) ≡ i; */ /*@ lemma tauto: 0 ≢ 0? T(0, 0): R(1, 2); */ /*@ lemma tauto2: (R(0, 1) ⇒ S(3, 4)) ∧ (¬R(0, 1) ⇒ T(5, 6)); */ /*@ lemma hex_oct: 0xFFFFUl ≢ 06666uL; */ /*@ requires \offset(p) ≡ 0; behavior b: assumes \true; requires \valid(p); ensures 0 ≡ 1; assigns *p; assigns *p \from G; */ void h(int G, int *p); void f(int G, int *p) { /*@ assert \false; */ ; /*@ assert \base_addr(&G) ≡ \base_addr(&G); */ ; /*@ assert \block_length(&G) ≡ 4; */ ; /*@ assert \block_length(&G) ≡ sizeof(G); */ ; /*@ assert \base_addr(&G) + \offset(&G + 4) ≡ (char *)(&G + 4); */ ; /*@ assert \null ≢ &G; */ ; /*@ loop invariant &G ≢ \null; */ while (1) { G ++; break; } *p = G + 76; return; } /*@ axiomatic St { logic struct st fl(struct st s) ; } */ /*@ ensures (\let tmp = fl(\old(s)); tmp.a) ≡ \result.a; */ struct st fc(struct st s) { return s; } void fd(char *x_0) { /*@ assert (char const *)x_0 ≡ (char *)x_0; */ ; x_0 = (char *)"abcdef"; /*@ assert ¬\valid(x_0) ∧ \valid_read(x_0); */ ; return; } int x = 0; /*@ logic ℤ x= 1; */ /*@ axiomatic Test2 { logic ℤ y; } */ /*@ logic ℤ z= \let f = \lambda ℤ a; a + 1; f(12); */ /*@ logic a id(a x) = x; */ /*@ logic ℤ z1= \max(5, 10, id); */ /*@ logic ℤ z2= \min(5, 10, id); */ /*@ logic ℤ z3= \sum(5, 10, id); */ /*@ logic ℤ z4= \product(5, 10, id); */ /*@ logic ℤ z5= \numof(0, 10, \lambda ℤ i; 3 ≤ i ≤ 5); */ frama-c-20.0-Calcium/tests/spec/oracle/allocates.res.oracle0000666000000000000000000000102713571573400020502 0ustar [kernel] Parsing tests/spec/allocates.i (no preprocessing) /* Generated by Frama-C */ int *p; int *q; int *r; /*@ behavior a: requires *p ≡ 0; */ void f1(void) { return; } /*@ requires ¬(q ≢ \null); behavior a: requires p ≢ \null; frees p; */ void f2(void) { return; } /*@ requires i < 0; behavior a: requires p ≢ \null; frees r, p; allocates q, \old(r); */ void f3(int i) { /*@ for a: loop invariant i < 0; */ while (i) { i --; p ++; } return; } frama-c-20.0-Calcium/tests/spec/oracle/annot_decl_bts1009.res.oracle0000666000000000000000000000051613571573400022025 0ustar [kernel] Parsing tests/spec/annot_decl_bts1009.i (no preprocessing) [kernel:annot-error] Warning: Statement contract and ACSL pragmas over a local definition are not implemented. Ignoring annotation /* Generated by Frama-C */ void f(void) { int x; /*@ assert 0 ≡ 0; */ ; x = 3; int y = x; x = 0; y = 1; return; } frama-c-20.0-Calcium/tests/spec/oracle/annot_main.res.oracle0000666000000000000000000000041313571573400020654 0ustar [kernel] Parsing tests/spec/annot_main.c (with preprocessing) /* Generated by Frama-C */ extern int ( /* missing proto */ Frama_C_dump_each)(); /*@ requires \valid(p); ensures *\old(p) ≡ 0; */ void main(int *p) { *p = 0; Frama_C_dump_each(); return; } frama-c-20.0-Calcium/tests/spec/oracle/array_conversion.res.oracle0000666000000000000000000000255013571573400022120 0ustar [kernel] Parsing tests/spec/array_conversion.c (with preprocessing) [kernel] tests/spec/array_conversion.c:5: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [kernel:annot-error] tests/spec/array_conversion.c:21: Warning: In ACSL, there is no implicit conversion between a C array and a pointer. Either introduce an explicit cast or take the address of the first element of X. Ignoring global annotation [kernel:annot-error] tests/spec/array_conversion.c:34: Warning: In ACSL, there is no implicit conversion between a C array and a pointer. Either introduce an explicit cast or take the address of the first element of a. Ignoring code annotation /* Generated by Frama-C */ typedef int foo[4]; foo X = {0, 1, 2, 3}; /*@ predicate p1{L}(int *a) = \at(\valid(a + (0 .. 3)),L); */ /*@ predicate q1{L}(int *a) = \at(\valid(a + (0 .. 3)),L); */ /*@ lemma vaddrof{L}: \valid(&X); */ /*@ lemma vaddrof2{L}: \valid((int *)X); */ /*@ requires p1(x); */ int f1(int * /*[4]*/ x) { int __retres; __retres = *(x + 3); return __retres; } int g1(void) { int tmp; tmp = f1(X); return tmp; } /*@ axiomatic ax { logic 𝔹 p{L}(int *b) ; } */ int a[10]; void ftest(void) { /*@ assert p((int *)a) ≡ \true; */ ; return; } /*@ lemma array_not_null{L}: (int *)a ≢ \null; */ frama-c-20.0-Calcium/tests/spec/oracle/array_prm.res.oracle0000666000000000000000000000056113571573400020531 0ustar [kernel] Parsing tests/spec/array_prm.c (with preprocessing) [kernel] tests/spec/array_prm.c:5: Warning: parsing obsolete ACSL construct '\valid_index(addr,idx)'. '\valid(addr+idx)' should be used instead. /* Generated by Frama-C */ void g(int *a); /*@ predicate p{L}(int *a) = \at(\valid(a + 0),L); */ /*@ requires p(a); */ void f(int *a) { g(a); return; } frama-c-20.0-Calcium/tests/spec/oracle/array_typedef.res.oracle0000666000000000000000000000633713571573400021402 0ustar [kernel] Parsing tests/spec/array_typedef.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function create_msg <- main. Called from tests/spec/array_typedef.c:35. [eva] computing for function host_address <- create_msg <- main. Called from tests/spec/array_typedef.c:25. [eva] Recording results for host_address [eva] Done for function host_address [eva] computing for function host_address <- create_msg <- main. Called from tests/spec/array_typedef.c:26. [eva] Recording results for host_address [eva] Done for function host_address [eva] tests/spec/array_typedef.c:27: assertion got status valid. [eva] tests/spec/array_typedef.c:28: assertion got status valid. [eva] tests/spec/array_typedef.c:29: assertion got status valid. [eva] Recording results for create_msg [eva] Done for function create_msg [eva] computing for function send_msg <- main. Called from tests/spec/array_typedef.c:36. [eva] computing for function send_addr <- send_msg <- main. Called from tests/spec/array_typedef.c:15. [eva] using specification for function send_addr [eva] tests/spec/array_typedef.c:12: Warning: no \from part for clause 'assigns \empty;' [eva] Done for function send_addr [eva] Recording results for send_msg [eva] Done for function send_msg [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function host_address: i ∈ {4} msg1.src[0] ∈ {192} .src[1] ∈ {100} .src[2] ∈ {200} .src[3] ∈ {101} .dst[0] ∈ {192} or UNINITIALIZED .dst[1] ∈ {100} or UNINITIALIZED .dst[2] ∈ {200} or UNINITIALIZED .dst[3] ∈ {101} or UNINITIALIZED [eva:final-states] Values at end of function create_msg: msg1.src[0] ∈ {192} .src[1] ∈ {100} .src[2] ∈ {200} .src[3] ∈ {101} .dst[0] ∈ {192} .dst[1] ∈ {100} .dst[2] ∈ {200} .dst[3] ∈ {101} [eva:final-states] Values at end of function send_msg: [eva:final-states] Values at end of function main: msg1.src[0] ∈ {192} .src[1] ∈ {100} .src[2] ∈ {200} .src[3] ∈ {101} .dst[0] ∈ {192} .dst[1] ∈ {100} .dst[2] ∈ {200} .dst[3] ∈ {101} __retres ∈ {0} /* Generated by Frama-C */ typedef int ip_address[4]; struct __anonstruct_msg_1 { ip_address src ; int dst[4] ; }; typedef struct __anonstruct_msg_1 msg; /*@ assigns \empty; */ void send_addr(int const * /*[4]*/ addr); void send_msg(msg const *msg) { send_addr(msg->src); return; } void host_address(int * /*[4]*/ ip) { unsigned int i = sizeof(int [4]) / sizeof(int); *(ip + 0) = 192; *(ip + 1) = 100; *(ip + 2) = 200; *(ip + (i - (unsigned int)1)) = 101; return; } void create_msg(msg *msg) { host_address(msg->src); host_address(msg->dst); /*@ assert msg->dst[0] ≡ 192; */ ; /*@ assert msg->src[0] ≡ 192; */ ; /*@ assert msg->dst[sizeof(ip_address) / sizeof(int) - 1] ≡ 101; */ ; return; } int main(void) { int __retres; msg msg1; create_msg(& msg1); send_msg((msg const *)(& msg1)); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/assert_label.res.oracle0000666000000000000000000000105613571573400021175 0ustar [kernel] Parsing tests/spec/assert_label.i (no preprocessing) /* Generated by Frama-C */ void bar(void) { /*@ assert bli: \true; */ ; return; } void f(void) { L: /*@ assert lab: \true; */ ; return; } void foo(int n) { switch (n) { case 4: { /*@ assert "foo + bar=foobar": \true; */ ; break; } case 5: { /*@ assert foo: \true; */ ; break; } case 6: { /*@ assert bar: \true; */ ; case 7: /*@ assert bla: \true; */ ; } } return; } frama-c-20.0-Calcium/tests/spec/oracle/assign_in_spec.res.oracle0000666000000000000000000000031713571573400021520 0ustar [kernel] Parsing tests/spec/assign_in_spec.c (with preprocessing) [kernel:annot-error] tests/spec/assign_in_spec.c:3: Warning: Assignment operators not allowed in annotations. /* Generated by Frama-C */ frama-c-20.0-Calcium/tests/spec/oracle/assignable_location.res.oracle0000666000000000000000000000277513571573400022546 0ustar [kernel] Parsing tests/spec/assignable_location.i (no preprocessing) [kernel:annot-error] tests/spec/assignable_location.i:36: Warning: unexpected token ';' [kernel:annot-error] tests/spec/assignable_location.i:28: Warning: not an addressable left value: \result. Ignoring logic specification of function annotations_to_reject [kernel:annot-error] tests/spec/assignable_location.i:30: Warning: not an assignable left value: *t. Ignoring code annotation [kernel:annot-error] tests/spec/assignable_location.i:31: Warning: not an assignable left value: *(t + 0). Ignoring code annotation [kernel:annot-error] tests/spec/assignable_location.i:32: Warning: not an assignable left value: *(t + (0 .. 0)). Ignoring code annotation [kernel:annot-error] tests/spec/assignable_location.i:33: Warning: not an assignable left value: (int)x. Ignoring code annotation [kernel:annot-error] tests/spec/assignable_location.i:34: Warning: not an assignable left value: (char)x. Ignoring code annotation [kernel:annot-error] tests/spec/assignable_location.i:35: Warning: not an addressable left value: (char)x. Ignoring code annotation [kernel:annot-error] tests/spec/assignable_location.i:37: Warning: not an addressable left value: \empty. Ignoring code annotation [kernel:annot-error] tests/spec/assignable_location.i:38: Warning: not an assignable left value: lx. Ignoring code annotation [kernel:annot-error] tests/spec/assignable_location.i:39: Warning: not an assignable left value: lx. Ignoring code annotation frama-c-20.0-Calcium/tests/spec/oracle/assigns.res.oracle0000666000000000000000000000201213571573400020175 0ustar [kernel] Parsing tests/spec/assigns.c (with preprocessing) /* Generated by Frama-C */ struct list { int hd ; struct list *next ; }; /*@ predicate reachable{L}(struct list *root, struct list *to) = root ≡ to ∨ (root ≢ \null ∧ reachable(root->next, to)); */ int *q; /*@ assigns *p, q; */ void reset(int *p) { *p = 0; return; } /*@ assigns *(t + (0 .. n - 1)); */ void reset_array1(int *t, int n) { int i; i = 0; while (i < n) { *(t + i) = 0; i ++; } return; } /*@ assigns *(t + (0 .. n - 1)); */ void reset_array2(int *t, int n) { int i; i = 0; while (i < n) { *(t + i) = 0; i ++; } return; } /*@ assigns *(t + {i | int i; 0 ≤ i < n}); */ void reset_array3(int *t, int n) { int i; i = 0; while (i < n) { *(t + i) = 0; i ++; } return; } /*@ assigns {q->hd | struct list *q; reachable{Old}(p, q)}; */ void incr_list(struct list *p) { while (p) { (p->hd) ++; p = p->next; } return; } /*@ predicate is_empty(set s) = s ≡ \empty; */ frama-c-20.0-Calcium/tests/spec/oracle/assigns_array.res.oracle0000666000000000000000000000201113571573400021372 0ustar [kernel] Parsing tests/spec/assigns_array.c (with preprocessing) [kernel:annot-error] tests/spec/assigns_array.c:9: Warning: not an assignable left value: ghost_loctable. Ignoring logic specification of function acquire_lock /* Generated by Frama-C */ /*@ ghost int ghost_loctable[100]; */ void acquire_lock(int m) { /*@ ghost (ghost_loctable[m]) ++; */ return; } /*@ requires \valid(&ghost_loctable[m]); requires ghost_loctable[m] ≡ 1; ensures ghost_loctable[\old(m)] ≡ 0; assigns ghost_loctable[..]; */ void release_lock(int m) { /*@ ghost (ghost_loctable[m]) --; */ return; } int Tab[10]; /*@ requires n < 10; behavior foo: assumes reset ≢ 0; assigns Tab[0 .. n - 1]; behavior bar: assumes reset ≡ 0; assigns \nothing; */ int h(int reset, int n) { int i; int r = 0; i = 0; /*@ for foo: loop assigns Tab[0 .. i]; for bar: loop assigns \nothing; */ while (i < n) { r += Tab[i]; if (reset) Tab[i] = 0; i ++; } return r; } frama-c-20.0-Calcium/tests/spec/oracle/assigns_from_kf.res.oracle0000666000000000000000000001127013571573400021706 0ustar [kernel] Parsing tests/spec/assigns_from_kf.i (no preprocessing) [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function both, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function both_r, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function g_both, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function g_both_r, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function g_nothing, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function g_nothing_r, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function g_something_non_ghost, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function g_something_non_ghost_r, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function nothing, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function nothing_r, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function something_ghost, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function something_ghost_r, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function something_non_ghost, generating default assigns from the prototype [kernel:annot:missing-spec] tests/spec/assigns_from_kf.i:27: Warning: Neither code nor specification for function something_non_ghost_r, generating default assigns from the prototype /* Generated by Frama-C */ /*@ assigns \nothing; */ void nothing(void); /*@ assigns \result; assigns \result \from \nothing; */ int nothing_r(void); /*@ assigns *p; assigns *p \from *p; */ void something_non_ghost(int *p); /*@ assigns *p; assigns *p \from *p; */ void something_ghost(void) /*@ ghost (int *p) */; /*@ assigns \result, *p; assigns \result \from *p; assigns *p \from *p; */ int something_non_ghost_r(int *p); /*@ assigns \result, *p; assigns \result \from \nothing; assigns *p \from *p; */ int something_ghost_r(void) /*@ ghost (int *p) */; /*@ assigns *p, *gp; assigns *p \from *p, x; assigns *gp \from *p, *gp, x, gx; */ void both(int *p, int x) /*@ ghost (int *gp, int gx) */; /*@ assigns \result, *p, *gp; assigns \result \from *p, x; assigns *p \from *p, x; assigns *gp \from *p, *gp, x, gx; */ int both_r(int *p, int x) /*@ ghost (int *gp, int gx) */; /*@ ghost /@ assigns \nothing; @/ void g_nothing(void); */ /*@ ghost /@ assigns \result; assigns \result \from \nothing; @/ int g_nothing_r(void); */ /*@ ghost /@ assigns *p; assigns *p \from *p; @/ void g_something_non_ghost(int *p); */ /*@ ghost /@ assigns \result, *p; assigns \result \from *p; assigns *p \from *p; @/ int g_something_non_ghost_r(int *p); */ /*@ ghost /@ assigns *p, *gp; assigns *p \from *p, *gp, x, gx; assigns *gp \from *p, *gp, x, gx; @/ void g_both(int *p, int x, int *gp, int gx); */ /*@ ghost /@ assigns \result, *p, *gp; assigns \result \from *p, *gp, x, gx; assigns *p \from *p, *gp, x, gx; assigns *gp \from *p, *gp, x, gx; @/ int g_both_r(int *p, int x, int *gp, int gx); */ void reference(void) { nothing(); nothing_r(); something_non_ghost((int *)0); something_ghost() /*@ ghost ((int *)0) */; something_non_ghost_r((int *)0); something_ghost_r() /*@ ghost ((int *)0) */; both((int *)0,1) /*@ ghost ((int *)0,2) */; both_r((int *)0,1) /*@ ghost ((int *)0,2) */; /*@ ghost g_nothing(); */ /*@ ghost g_nothing_r(); */ /*@ ghost g_something_non_ghost((int *)0); */ /*@ ghost g_something_non_ghost_r((int *)0); */ /*@ ghost g_both((int *)0,1,(int *)0,2); */ /*@ ghost g_both_r((int *)0,1,(int *)0,2); */ return; } frama-c-20.0-Calcium/tests/spec/oracle/assigns_result.res.oracle0000666000000000000000000000304213571573400021577 0ustar [kernel] Parsing tests/spec/assigns_result.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} Y ∈ {0} [eva] computing for function f <- main. Called from tests/spec/assigns_result.i:16. [eva] using specification for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/spec/assigns_result.i:16. [eva] using specification for function g [eva] tests/spec/assigns_result.i:16: Warning: cannot interpret assigns clause \exit_status (unsupported logic var \exit_status); effects will be ignored [eva] Done for function g [eva] Recording results for main [eva] done for function main [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Computing for function g <-main [from] tests/spec/assigns_result.i:16: Unable to extract assigns in g [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM ANYTHING(origin:Unknown) [from] Function g: \result FROM X [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== /* Generated by Frama-C */ int X; int Y; /*@ assigns \nothing; */ int f(void); /*@ assigns \result; assigns \result \from X; assigns \exit_status \from Y; */ int g(void); void main(void) { f(); g(); return; } frama-c-20.0-Calcium/tests/spec/oracle/assigns_void.0.res.oracle0000666000000000000000000000047113571573400021363 0ustar [kernel] Parsing tests/spec/assigns_void.c (with preprocessing) [kernel:annot-error] tests/spec/assigns_void.c:5: Warning: Cannot use a pointer to void here. Ignoring specification of function f /* Generated by Frama-C */ void f(void *x); void g(void) { int y; int *x = & y; f((void *)x); return; } frama-c-20.0-Calcium/tests/spec/oracle/assigns_void.1.res.oracle0000666000000000000000000000167213571573400021370 0ustar [kernel] Parsing tests/spec/assigns_void.c (with preprocessing) [eva] Analyzing a complete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- g. Called from tests/spec/assigns_void.c:11. [kernel:annot:missing-spec] tests/spec/assigns_void.c:11: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for g [eva] done for function g [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: y ∈ [--..--] or UNINITIALIZED x ∈ {{ &y }} /* Generated by Frama-C */ /*@ assigns *((char *)x + (0 ..)); assigns *((char *)x + (0 ..)) \from *((char *)x + (0 ..)); */ void f(void *x); void g(void) { int y; int *x = & y; f((void *)x); return; } frama-c-20.0-Calcium/tests/spec/oracle/assume.res.oracle0000666000000000000000000000061013571573400020025 0ustar [kernel] Parsing tests/spec/assume.c (with preprocessing) /* Generated by Frama-C */ void f(int x); /*@ behavior b1: assumes x ≥ 0; behavior b2: assumes x ≤ 0; disjoint behaviors b1, b2; */ void f(int x) { int *p; int *q; /*@ for b1, b2: behavior default: assumes \valid(p); */ q = p; /*@ assert \valid(q); */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/at.res.oracle0000666000000000000000000000270713571573400017145 0ustar [kernel] Parsing tests/spec/at.c (with preprocessing) [kernel:annot-error] tests/spec/at.c:40: Warning: unbound logic variable y. Ignoring code annotation [kernel:annot-error] tests/spec/at.c:41: Warning: unbound logic variable y. Ignoring code annotation [kernel:annot-error] tests/spec/at.c:42: Warning: unbound logic variable z. Ignoring code annotation [kernel:annot-error] tests/spec/at.c:49: Warning: unbound logic variable i. Ignoring code annotation /* Generated by Frama-C */ int x; /*@ axiomatic A { predicate E{L}(ℤ v) = \at(x ≡ v,L); predicate P{L1, L2}(ℤ i) = \at(x,L1) ≡ \at(x,L2) + i; predicate Q{L1, L2}(ℤ i) = \at(x ≡ \at(x,L2) + i,L1); axiom idem{L1, L2}: ∀ ℤ i; P{L1, L2}(i) ⇔ Q{L1, L2}(i); } */ /*@ ensures x ≡ (2 + \old(x)) + \old(y); ensures \at(E(\at((x - 2) - y,Here)),Pre); */ int f(int y) { x += y; L1: x ++; L2: /*@ ghost ; */ x ++; /*@ assert \at(x,L1) ≡ \at(x,Pre) + y; */ ; /*@ assert \at(x,L2) ≡ (1 + \at(x,Pre)) + y; */ ; /*@ assert P{Here, Pre}(2 + y); */ ; return x; } void test(void) { int x_0 = 0; L1: { int x_1 = 1; L2: /*@ assert \at(&x_0,L1) ≢ \at(&x_1,L2); */ ; x_1 = 2; } return; } void ko(int z) { L: { int y = 0; /*@ assert OK: \at(x,Init) ≡ 0; */ ; /*@ assert OK: \at(z,Pre) ≡ 0; */ ; } while (x > 0) { int i = 1; x --; /*@ assert OK: \at(z,LoopCurrent) ≡ \at(z,Pre); */ ; } return; } frama-c-20.0-Calcium/tests/spec/oracle/axiom_ignored_bts1116.res.oracle0000666000000000000000000000042513571573400022541 0ustar [kernel] Parsing tests/spec/axiom_ignored_bts1116.i (no preprocessing) [kernel:annot-error] tests/spec/axiom_ignored_bts1116.i:2: Warning: Axiom l is declared outside of an axiomatic. /* Generated by Frama-C */ /*@ ensures \result < 0; */ int ftest(int i) { return i; } frama-c-20.0-Calcium/tests/spec/oracle/axiom_included.res.oracle0000666000000000000000000000034113571573400021515 0ustar [kernel] Parsing tests/spec/axiom_included.c (with preprocessing) [kernel] Parsing tests/spec/axiom_included_1.c (with preprocessing) /* Generated by Frama-C */ /*@ axiomatic foo { axiom foo: \true; } */ frama-c-20.0-Calcium/tests/spec/oracle/axiom_redef_bts1005.res.oracle0000666000000000000000000000041313571573400022171 0ustar [kernel] Parsing tests/spec/axiom_redef_bts1005.i (no preprocessing) [kernel:annot-error] tests/spec/axiom_redef_bts1005.i:5: Warning: inj1 is already registered as axiom (tests/spec/axiom_redef_bts1005.i:4). Ignoring global annotation /* Generated by Frama-C */ frama-c-20.0-Calcium/tests/spec/oracle/behavior_assert.0.res.oracle0000666000000000000000000001033413571573400022052 0ustar [kernel] Parsing tests/spec/behavior_assert.c (with preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization e ∈ [--..--] G ∈ [--..--] c ∈ [--..--] [eva] computing for function f <- main. Called from tests/spec/behavior_assert.c:90. [eva:alarm] tests/spec/behavior_assert.c:14: Warning: assertion got status invalid. [eva] tests/spec/behavior_assert.c:16: assertion got status valid. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/spec/behavior_assert.c:91. [eva] tests/spec/behavior_assert.c:30: assertion got status valid. [eva] tests/spec/behavior_assert.c:28: starting to merge loop iterations [eva] tests/spec/behavior_assert.c:24: function g, behavior be: postcondition got status valid. (Behavior may be inactive, no reduction performed.) [eva] Recording results for g [eva] Done for function g [eva] computing for function h2 <- main. Called from tests/spec/behavior_assert.c:92. [eva:alarm] tests/spec/behavior_assert.c:64: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva:alarm] tests/spec/behavior_assert.c:65: Warning: signed overflow. assert c + 2 ≤ 2147483647; [eva] computing for function h1 <- h2 <- main. Called from tests/spec/behavior_assert.c:73. [eva] computing for function abs <- h1 <- h2 <- main. Called from tests/spec/behavior_assert.c:52. [eva] Recording results for abs [eva] Done for function abs [eva:alarm] tests/spec/behavior_assert.c:55: Warning: assertion got status unknown. [eva] tests/spec/behavior_assert.c:45: function h1, behavior not_null: postcondition got status valid. [eva] Recording results for h1 [eva] Done for function h1 [eva] tests/spec/behavior_assert.c:74: assertion got status valid. [eva] Recording results for h2 [eva] Done for function h2 [eva] computing for function k <- main. Called from tests/spec/behavior_assert.c:93. [eva] tests/spec/behavior_assert.c:85: assertion got status valid. [eva:alarm] tests/spec/behavior_assert.c:86: Warning: assertion got status invalid. [eva] Recording results for k [eva] Done for function k [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function abs: __retres ∈ [0..11] [eva:final-states] Values at end of function f: x ∈ {3} [eva:final-states] Values at end of function g: G ∈ {3} i ∈ {3} [eva:final-states] Values at end of function h1: r ∈ [1..11] r2 ∈ [0..11] [eva:final-states] Values at end of function h2: a ∈ {-4; -2; -1; 3} b ∈ [1..11] [eva:final-states] Values at end of function k: [eva:final-states] Values at end of function main: G ∈ {3} [from] Computing for function abs [from] Done for function abs [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function h1 [from] Done for function h1 [from] Computing for function h2 [from] Done for function h2 [from] Computing for function k [from] Done for function k [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function abs: \result FROM x [from] Function f: NO EFFECTS [from] Function g: G FROM \nothing [from] Function h1: \result FROM a [from] Function h2: NO EFFECTS [from] Function k: NO EFFECTS [from] Function main: G FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function abs: __retres [inout] Inputs for function abs: \nothing [inout] Out (internal) for function f: x [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: G; i [inout] Inputs for function g: \nothing [inout] Out (internal) for function h1: r; r2 [inout] Inputs for function h1: \nothing [inout] Out (internal) for function h2: a; b [inout] Inputs for function h2: c [inout] Out (internal) for function k: \nothing [inout] Inputs for function k: \nothing [inout] Out (internal) for function main: G [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/spec/oracle/behavior_assert.1.res.oracle0000666000000000000000000001051113571573400022050 0ustar [kernel] Parsing tests/spec/behavior_assert.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization e ∈ {0} G ∈ {0} c ∈ [--..--] [eva] computing for function f <- main. Called from tests/spec/behavior_assert.c:90. [eva:alarm] tests/spec/behavior_assert.c:14: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/spec/behavior_assert.c:91. [eva] tests/spec/behavior_assert.c:30: assertion got status valid. [eva] tests/spec/behavior_assert.c:28: starting to merge loop iterations [eva] tests/spec/behavior_assert.c:24: function g, behavior be: postcondition got status valid. [eva] Recording results for g [eva] Done for function g [eva] computing for function h2 <- main. Called from tests/spec/behavior_assert.c:92. [eva:alarm] tests/spec/behavior_assert.c:64: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva:alarm] tests/spec/behavior_assert.c:65: Warning: signed overflow. assert c + 2 ≤ 2147483647; [eva] computing for function h1 <- h2 <- main. Called from tests/spec/behavior_assert.c:73. [eva] computing for function abs <- h1 <- h2 <- main. Called from tests/spec/behavior_assert.c:52. [eva] Recording results for abs [eva] Done for function abs [eva:alarm] tests/spec/behavior_assert.c:55: Warning: assertion got status unknown. [eva] tests/spec/behavior_assert.c:45: function h1, behavior not_null: postcondition got status valid. [eva] Recording results for h1 [eva] Done for function h1 [eva] tests/spec/behavior_assert.c:74: assertion got status valid. [eva] Recording results for h2 [eva] Done for function h2 [eva] computing for function k <- main. Called from tests/spec/behavior_assert.c:93. [eva:alarm] tests/spec/behavior_assert.c:86: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for k [eva] Done for function k [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function abs: __retres ∈ [0..11] [eva:final-states] Values at end of function f: NON TERMINATING FUNCTION [eva:final-states] Values at end of function g: G ∈ {3} i ∈ {3} [eva:final-states] Values at end of function h1: r ∈ [1..11] r2 ∈ [0..11] [eva:final-states] Values at end of function h2: a ∈ {-4; -2; -1; 3} b ∈ [1..11] [eva:final-states] Values at end of function k: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function abs [from] Done for function abs [from] Computing for function f [from] Non-terminating function f (no dependencies) [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function h1 [from] Done for function h1 [from] Computing for function h2 [from] Done for function h2 [from] Computing for function k [from] Non-terminating function k (no dependencies) [from] Done for function k [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function abs: \result FROM x [from] Function f: NON TERMINATING - NO EFFECTS [from] Function g: G FROM \nothing [from] Function h1: \result FROM a [from] Function h2: NO EFFECTS [from] Function k: NON TERMINATING - NO EFFECTS [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function abs: __retres [inout] Inputs for function abs: \nothing [inout] Out (internal) for function f: x [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: G; i [inout] Inputs for function g: \nothing [inout] Out (internal) for function h1: r; r2 [inout] Inputs for function h1: \nothing [inout] Out (internal) for function h2: a; b [inout] Inputs for function h2: c [inout] Out (internal) for function k: \nothing [inout] Inputs for function k: \nothing [inout] Out (internal) for function main: G [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/spec/oracle/behavior_names.res.oracle0000666000000000000000000000365413571573400021525 0ustar [kernel] Parsing tests/spec/behavior_names.c (with preprocessing) [kernel:annot-error] tests/spec/behavior_names.c:7: Warning: reference to unknown behavior UNEXISTENT_BEHAVIOR. Ignoring logic specification of function f [kernel:annot-error] tests/spec/behavior_names.c:19: Warning: reference to unknown behavior UNEXISTENT_BEHAVIOR. Ignoring logic specification of function g [kernel:annot-error] tests/spec/behavior_names.c:27: Warning: reference to unknown behavior foo. Ignoring code annotation [kernel:annot-error] tests/spec/behavior_names.c:34: Warning: behavior foo already defined. Ignoring logic specification of function h [kernel:annot-error] tests/spec/behavior_names.c:38: Warning: behavior foo already defined. Ignoring code annotation [kernel:annot-error] tests/spec/behavior_names.c:47: Warning: behavior foo already defined. Ignoring code annotation /* Generated by Frama-C */ void f(void) { return; } /*@ predicate should_be_rejected= \true; */ /*@ predicate should_be_kept= \true; */ void g(void) { /*@ behavior foo: ensures \true; */ { /*@ for foo: assert should_be_kept; */ ; f(); /*@ for foo: assert should_be_kept; */ ; f(); } return; } void h(void) { return; } /*@ behavior foo: ensures \true; */ void i(void) { return; } void j(void) { int x = 0; /*@ behavior foo: ensures \true; */ { x ++; if (x) /*@ behavior bar: ensures \true; */ x ++; else /*@ behavior bar: ensures should_be_kept; */ x ++; } return; } /*@ behavior boolean: ensures boolean: \true; behavior char: ensures char: \true; behavior for: ensures for: \true; behavior while: ensures while: \true; behavior ensures: ensures ensures: \true; behavior logic: ensures logic: \true; */ void keyword_as_behavior_and_term_names(void) { return; } frama-c-20.0-Calcium/tests/spec/oracle/behaviors_decl_def.res.oracle0000666000000000000000000000136213571573400022324 0ustar [kernel] Parsing tests/spec/behaviors_decl_def.c (with preprocessing) /* Generated by Frama-C */ int G; void f(int c); /*@ behavior b1: assumes c > 0; behavior b2: assumes c < 1; complete behaviors b1, b2; */ void f(int c) { /*@ for b1: assert \true; */ ; return; } /*@ requires \true; ensures \result ≡ 0 ∨ \result ≡ 1; assigns G; behavior no: assumes c < 1; ensures \result ≡ 0; assigns \nothing; behavior at_least_one: assumes c > 0; ensures \result ≡ 1; assigns G; complete behaviors at_least_one, no; disjoint behaviors at_least_one, no; */ int main(int c) { int __retres; f(c); __retres = c > 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/bool.res.oracle0000666000000000000000000000041513571573400017466 0ustar [kernel] Parsing tests/spec/bool.c (with preprocessing) /* Generated by Frama-C */ /*@ logic 𝔹 f(int x) = x ≡ 0; */ /*@ predicate f_pred(int x, int y) = f(x) ≡ \true ∧ f(y) ≡ \true; */ /*@ predicate foo(𝔹 x, 𝔹 y) = x ≡ \false ∨ y ≡ \true; */ frama-c-20.0-Calcium/tests/spec/oracle/boolean_ops.res.oracle0000666000000000000000000000061613571573400021036 0ustar [kernel] Parsing tests/spec/boolean_ops.c (with preprocessing) /* Generated by Frama-C */ /*@ ensures \old(x) ≡ 0 ∨ \old(y) ≡ 1? \result ≡ 0: \result ≡ 1; */ int f(int x, int y) { int tmp; if (x == 0) tmp = 1; else if (y == 1) tmp = 1; else tmp = 0; return tmp; } int main(void) { int __retres; int x = f(42,1); int y = f(0,36); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/breaks_continues_unroll.res.oracle0000666000000000000000000000163113571573400023465 0ustar [kernel] Parsing tests/spec/breaks_continues_unroll.i (no preprocessing) /* Generated by Frama-C */ int unroll(int c) { int x = 0; switch (x) { /*@ breaks x ≡ 13; */ { case 11: x ++; goto unrolling_3_loop; case 12: x ++; case 13: break; default: ; } } if (x < c) { x ++; goto unrolling_3_loop; } goto unrolling_2_loop; unrolling_3_loop: ; /*@ loop pragma UNROLL 1; loop pragma UNROLL "done", 1; */ while (1) { /*@ breaks \false; continues x ≡ \old(x) + 1; */ switch (x) { /*@ breaks x ≡ 13; */ { case 11: x ++; continue; case 12: x ++; case 13: break; default: ; } } /*@ breaks x ≡ \old(x); continues x ≡ \old(x) + 1; */ { if (x < c) { x ++; continue; } break; } } unrolling_2_loop: ; return x; } frama-c-20.0-Calcium/tests/spec/oracle/bsearch.res.oracle0000666000000000000000000000234213571573400020143 0ustar [kernel] Parsing tests/spec/bsearch.c (with preprocessing) [kernel] tests/spec/bsearch.c:17: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. /* Generated by Frama-C */ /*@ lemma mean_1: ∀ ℤ x, ℤ y; x ≤ y ⇒ x ≤ (x + y) / 2 ≤ y; */ /*@ predicate sorted{L}(int t[], ℤ n) = ∀ ℤ i, ℤ j; 0 ≤ i ≤ j ≤ n ⇒ t[i] ≤ t[j]; */ /*@ requires n ≥ 0 ∧ \valid(t + (0 .. n - 1)) ∧ sorted((int [])t, n - 1); behavior search_success: ensures \result ≥ 0 ⇒ *(\old(t) + \result) ≡ \old(v); behavior search_failure: ensures \result < 0 ⇒ (∀ ℤ k; 0 ≤ k < \old(n) ⇒ *(\old(t) + k) ≢ \old(v)); */ int bsearch(int *t, int n, int v) { int __retres; int l = 0; int u = n - 1; /*@ loop invariant 0 ≤ l ∧ u ≤ n - 1 ∧ (∀ int k; 0 ≤ k < n ⇒ *(t + k) ≡ v ⇒ l ≤ k ≤ u); loop variant u - l; */ while (l <= u) { int m = (l + u) / 2; if (*(t + m) < v) l = m + 1; else if (*(t + m) > v) u = m - 1; else { __retres = m; goto return_label; } } __retres = -1; return_label: return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/bts0254.res.oracle0000666000000000000000000000173413571573400017643 0ustar [kernel] Parsing tests/spec/bts0254.i (no preprocessing) /* Generated by Frama-C */ /*@ behavior d: assumes \true; assumes \false; requires \true; ensures \old(x) ≢ 0 ∧ \old(x) ≢ 0 ∧ \old(x) ≢ 0 ∧ \old(x) ≢ 0 ∧ \old(x) ≢ 0; */ int f(int x) { int __retres; __retres = 0; return __retres; } /*@ requires \true; ensures \false; assigns \nothing; */ int g(void) { int __retres; __retres = 0; return __retres; } /*@ requires \true; terminates \false; decreases x; ensures \false; assigns \nothing; behavior b1: assumes \true; behavior b2: assumes \false; disjoint behaviors b1, b2; */ int h(int x) { int __retres; __retres = 0; return __retres; } /*@ requires \true; */ int a(void) { int __retres; __retres = 0; return __retres; } /*@ behavior d: ensures \true; */ int bts(void) { int __retres; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/bts0283.res.oracle0000666000000000000000000000074213571573400017643 0ustar [kernel] Parsing tests/spec/bts0283.c (with preprocessing) [kernel:annot-error] tests/spec/bts0283.c:5: Warning: incompatible types ℤ and int *. Ignoring code annotation [kernel:annot-error] tests/spec/bts0283.c:7: Warning: incompatible types int and int * . Ignoring code annotation /* Generated by Frama-C */ int b; int *p; /*@ requires p ≢ (int *)0; */ int main(void) { int __retres; if (b) p = (int *)4; else p = (int *)7; __retres = 1; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/bts0440.res.oracle0000666000000000000000000000056313571573400017637 0ustar [kernel] Parsing tests/spec/bts0440.i (no preprocessing) /* Generated by Frama-C */ int fact(int n) { int r = 1; while (n > 0) { int tmp; /*@ ensures n ≥ 0; */ { before: { /* sequence */ tmp = n; n --; r *= tmp; } } /*@ assert r ≡ \at(r * n,before); */ ; } return r; } frama-c-20.0-Calcium/tests/spec/oracle/bts0549.res.oracle0000666000000000000000000000223213571573400017644 0ustar [kernel] Parsing tests/spec/bts0549.i (no preprocessing) [kernel:annot-error] tests/spec/bts0549.i:6: Warning: In ACSL, there is no implicit conversion between a C array and a pointer. Either introduce an explicit cast or take the address of the first element of t1. Ignoring global annotation [kernel:annot-error] tests/spec/bts0549.i:11: Warning: \let x = t1; x is a logic array. Only C arrays can be converted to pointers, and this conversion must be explicit (cast or take the address of the first element). Ignoring global annotation /* Generated by Frama-C */ int t1[10]; int t2[10]; /*@ logic int * a1{L}= \at(&t1[0],L); */ /*@ logic int * a2{L}= \at((int *)t1,L); */ /*@ logic int * a3{L}= \at((int *)t1,L); */ /*@ logic int * a5{L}= \at((int *)t1,L); */ /*@ logic int * b1{L}= \at(\let x = &t1[0]; x,L); */ /*@ logic int * b2{L}= \at(\let x = (int *)t1; x,L); */ /*@ logic int * b3{L}= \at(\let x = (int *)t1; x,L); */ int main(void) { int __retres; int i; i = 0; while (i < 10) { t1[i] = 0; t2[i] = 0; i ++; } if (t1 == t2) /*@ assert \false; */ ; else /*@ assert t1 ≡ t2; */ ; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/bts0570.res.oracle0000666000000000000000000000034213571573400017636 0ustar [kernel] Parsing tests/spec/bts0570.i (no preprocessing) /* Generated by Frama-C */ int main(char *data) { int __retres; /*@ assert \pointer_comparable((void *)data, (void *)0); */ ; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/bts0578.res.oracle0000666000000000000000000000117313571573400017651 0ustar [kernel] Parsing tests/spec/bts0578.i (no preprocessing) /* Generated by Frama-C */ /*@ behavior foo: ensures \true; */ void main(void) { int i; int t[10]; i = 0; /*@ loop assigns t[0 .. i]; loop invariant \true; for foo: loop assigns t[0 .. i]; for foo: loop invariant \true; for foo: loop invariant \true; loop variant 0; */ while (i < 10) { t[i] = 0; i ++; } L1: /*@ requires \true; ensures \true; */ t[4] = 42; L2: /*@ requires \true; ensures \true; */ t[3] = 36; L3: /*@ requires \true; ensures \true; */ t[2] = 12; return; } frama-c-20.0-Calcium/tests/spec/oracle/bts0589.res.oracle0000666000000000000000000000033713571573400017654 0ustar [kernel] Parsing tests/spec/bts0589.i (no preprocessing) /* Generated by Frama-C */ int x; int g(void) { int a; int tmp; /*@ assigns a, x; */ { /* sequence */ tmp = x; x ++; a = tmp; } return a; } frama-c-20.0-Calcium/tests/spec/oracle/bts0655.res.oracle0000666000000000000000000000407413571573400017650 0ustar [kernel] Parsing tests/spec/bts0655.i (no preprocessing) [bts0655] term i has type ℤ [bts0655] term i has type int [bts0655] term \max(\at(a,Pre), \at(b,Pre)) has type ℤ [bts0655] term \at(a,Pre) has type ℤ [bts0655] term \at(a,Pre) has type unsigned int [bts0655] term a has type unsigned int [bts0655] term \at(b,Pre) has type ℤ [bts0655] term \at(b,Pre) has type unsigned int [bts0655] term b has type unsigned int [bts0655] term \result has type ℤ [bts0655] term \result has type unsigned int [bts0655] term \max(\old(a), \old(b)) has type ℤ [bts0655] term \old(a) has type ℤ [bts0655] term \old(a) has type unsigned int [bts0655] term a has type unsigned int [bts0655] term \old(b) has type ℤ [bts0655] term \old(b) has type unsigned int [bts0655] term b has type unsigned int [bts0655] term \result has type ℤ [bts0655] term \result has type unsigned int [bts0655] term \min(\old(a), \old(b)) has type ℤ [bts0655] term \old(a) has type ℤ [bts0655] term \old(a) has type unsigned int [bts0655] term a has type unsigned int [bts0655] term \old(b) has type ℤ [bts0655] term \old(b) has type unsigned int [bts0655] term b has type unsigned int [bts0655] term \max(\old(a), \old(b)) has type ℤ [bts0655] term \old(a) has type ℤ [bts0655] term \old(a) has type unsigned int [bts0655] term a has type unsigned int [bts0655] term \old(b) has type ℤ [bts0655] term \old(b) has type unsigned int [bts0655] term b has type unsigned int [bts0655] term \min(\old(a) + 1, \old(b)) has type ℤ [bts0655] term \old(a) + 1 has type ℤ [bts0655] term \old(a) has type ℤ [bts0655] term \old(a) has type unsigned int [bts0655] term a has type unsigned int [bts0655] term 1 has type ℤ [bts0655] term \old(b) has type ℤ [bts0655] term \old(b) has type unsigned int [bts0655] term b has type unsigned int [bts0655] term \old(a) has type ℤ [bts0655] term \old(a) has type unsigned int [bts0655] term a has type unsigned int [bts0655] term \abs(\old(a)) has type ℤ [bts0655] term \old(a) has type ℤ [bts0655] term \old(a) has type unsigned int [bts0655] term a has type unsigned int frama-c-20.0-Calcium/tests/spec/oracle/bts0698.res.oracle0000666000000000000000000000121013571573400017644 0ustar [kernel] Parsing tests/spec/bts0698.i (no preprocessing) [kernel:annot-error] tests/spec/bts0698.i:11: Warning: cannot cast logic array to pointer type. Ignoring global annotation /* Generated by Frama-C */ /*@ predicate P(int x[2]) = x[0] < x[1]; */ /*@ predicate Q{L}(int *x) = *(x + 0) < *(x + 1); */ /*@ predicate Correct{L}(int *x) = P((int [2])x); */ int t[2]; int *a; void f(void) { t[0] = 10; t[1] = 20; /*@ assert P(t); */ ; /*@ assert Q((int *)t); */ ; return; } /*@ requires \valid(a + (0 .. 1)); */ void g(void) { *(a + 0) = 10; *(a + 1) = 20; /*@ assert P((int [2])a); */ ; /*@ assert Q(a); */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/bts0812.res.oracle0000666000000000000000000000031013571573400017630 0ustar [kernel] Parsing tests/spec/bts0812.c (with preprocessing) /* Generated by Frama-C */ /*@ lemma fib_3: \true; */ /*@ lemma fib_46: \true; */ /*@ assigns \nothing; */ void main(void) { return; } frama-c-20.0-Calcium/tests/spec/oracle/bts1068.res.oracle0000666000000000000000000001220313571573400017640 0ustar [kernel] Parsing tests/spec/bts1068.i (no preprocessing) [kernel] tests/spec/bts1068.i:53: Warning: parsing obsolete ACSL construct '\valid_index(addr,idx)'. '\valid(addr+idx)' should be used instead. [kernel] tests/spec/bts1068.i:54: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. /* Generated by Frama-C */ struct __anonstruct_S_1 { int a ; unsigned char *b ; }; typedef struct __anonstruct_S_1 S; struct __anonstruct_T_2 { int a ; unsigned char b[10] ; }; typedef struct __anonstruct_T_2 T; struct _list { int element ; struct _list *next ; }; typedef struct _list list; int *P; int V; int Tab[10]; /*@ axiomatic A { logic T t reads \nothing; logic ℤ ft(T x) = x.b[1]; logic ℤ ft2(T x) reads x.b[1]; predicate PT(T x) = x.b[1] > 1; predicate PT2(T x) reads x.b[1]; axiom T1: t.a ≡ 0; axiom T2: t.b[0] ≡ 0; axiom T3: PT(t) ⇒ PT2(t); logic S s reads \nothing; logic ℤ fs{L}(S x) = \at(*(x.b + 1),L); logic ℤ fs2{L}(S x) reads \at(*(x.b + 1),L); predicate PS{L}(S x) = \at(*(x.b + 1) > 1,L); predicate PS2{L}(S x) reads \at(*(x.b + 1),L); axiom S1: s.a ≡ 0; axiom S2{L}: *(s.b + 0) ≡ 0; axiom S3{L}: PS(s) ⇒ PS2(s); logic ℤ p{L} reads \at(*P,L); logic int * va{L} reads \at(&V,L); logic ℤ v{L} reads V; logic int * fa(int *q) = q; logic int fa2{L}(int *q) = \at(*q,L); logic char * fa3{L}(ℤ i) = \at((char *)(&P) + i,L); logic ℤ fa4{L}(T *q) reads \at(q->a,L); predicate Initialized{L}(int *q) = \at(\initialized(q),L); predicate Valid{L}(int *q) = \at(\valid(q),L); predicate ValidIndex{L}(int *q) = \at(\valid(q + 1),L); predicate ValidRange{L}(int *q) = \at(\valid(q + (0 .. 2)),L); predicate Separated(int *a, int *b) = \separated(a, b); logic ℤ BlockLength{L}(int *q) = \at(\block_length(q),L); logic char * Base_addr{L}(int *q) = \at(\base_addr(q),L); logic ℤ fi{L}(T *t) = \at(t->a + t->a,L); } */ /*@ type List = Nil | Cons(A, List ); */ /*@ inductive model_0{L1, L2}(list *root, List logic_list) { case nil{L1, L2}: model_0{L1, L2}(\null, Nil); case cons{L1, L2}: ∀ list *l1, List ll1; \at(\valid(l1),L1) ⇒ model_0{L1, L2}(\at(l1->next,L1), ll1) ⇒ model_0{L1, L2}(l1, Cons(\at(l1->element,L1), ll1)); } */ /*@ inductive model_1{L}(list *root, List logic_list) { case nil{L}: model_1(\null, Nil); case cons{L}: ∀ list *l1, List ll1; \valid(l1) ⇒ model_1(\at(l1->next,L), ll1) ⇒ model_1(l1, Cons(\at(l1->element,L), ll1)); } */ /*@ inductive model_2{L}(list *root, List logic_list) { case nil{L}: \at(model_2(\null, Nil),L); case cons{L}: \at(∀ list *l1, List ll1; \valid(l1) ⇒ model_2(l1->next, ll1) ⇒ model_2(l1, Cons(l1->element, ll1)), L); } */ /*@ inductive model_3{L}(list *root, List logic_list) { case nil{L}: \at(model_3(\null, Nil),L); case cons{L}: ∀ list *l1, List ll1; \valid(l1) ⇒ model_3(l1->next, ll1) ⇒ model_3(l1, Cons(l1->element, ll1)); } */ /*@ inductive model_4{L1}(list *root, List logic_list) { case nil{L}: \at(model_4(\null, Nil),L); case cons{L1}: ∀ list *l1, List ll1; \valid(l1) ⇒ model_4(l1->next, ll1) ⇒ model_4(l1, Cons(l1->element, ll1)); } */ /*@ inductive model_5{L}(list *root, List logic_list) { case nil{L}: \at(model_5(\null, Nil),L); case cons{L1}: ∀ list *l1, List ll1; \valid(l1) ⇒ model_5(l1->next, ll1) ⇒ model_5(l1, Cons(l1->element, ll1)); } */ /*@ inductive model_6{L}(list *root, List logic_list) { case nil{L1}: model_6(\null, Nil); case cons{L}: \at(∀ list *l1, List ll1; \valid(l1) ⇒ model_6(l1->next, ll1) ⇒ model_6(l1, Cons(l1->element, ll1)), L); } */ /*@ inductive model_7{L1}(list *root, List logic_list) { case nil{L1}: model_7(\null, Nil); case cons{L}: \at(∀ list *l1, List ll1; \valid(l1) ⇒ model_7(l1->next, ll1) ⇒ model_7(l1, Cons(l1->element, ll1)), L); } */ /*@ inductive model_8{L1}(list *root, List logic_list) { case nil{L}: model_8(\null, Nil); case cons{L}: \at(∀ list *l1, List ll1; \valid(l1) ⇒ model_8(l1->next, ll1) ⇒ model_8(l1, Cons(l1->element, ll1)), L); } */ /*@ inductive model_9{L1, L2}(list *root, List logic_list) { case nil{L}: \at(\valid(P),L); } */ void *px; /*@ inductive Pind{L}(void *root, ℤ px) { case p0{L}: \at(Pind(px, 0),L); } */ frama-c-20.0-Calcium/tests/spec/oracle/bts1262.res.oracle0000666000000000000000000000037313571573400017641 0ustar [kernel] Parsing tests/spec/bts1262.c (with preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; char *s = (char *)"\\\\.\\"; /*@ assert *(s + 0) ≡ '\\'; */ ; *(s + 2) = (char)'\\'; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/bts2187-no-empty-contract.res.oracle0000666000000000000000000000045613571573400023233 0ustar [kernel] Parsing tests/spec/bts2187-no-empty-contract.i (no preprocessing) [kernel:annot-error] tests/spec/bts2187-no-empty-contract.i:3: Warning: Empty annotation is not allowed /* Generated by Frama-C */ /*@ behavior x: assumes c ≢ 0; */ void no_empty_stmt_contract(int c) { return; } frama-c-20.0-Calcium/tests/spec/oracle/bts_1789.res.oracle0000666000000000000000000000053713571573400020020 0ustar [kernel] Parsing tests/spec/bts_1789.i (no preprocessing) [kernel:annot-error] tests/spec/bts_1789.i:8: Warning: not an assignable left value: the_var{Old}. Ignoring logic specification of function function /* Generated by Frama-C */ int *var_ptr; /*@ logic int * the_var{L}= var_ptr; */ void function(void) { var_ptr = (int *)0L; return; } frama-c-20.0-Calcium/tests/spec/oracle/bug96.res.oracle0000666000000000000000000000032713571573400017471 0ustar [kernel] Parsing tests/spec/bug96.c (with preprocessing) /* Generated by Frama-C */ struct list; struct node { int hd ; struct list *next ; }; /*@ logic set tata(struct node *p) = \empty; */ frama-c-20.0-Calcium/tests/spec/oracle/builtins.res.oracle0000666000000000000000000000045613571573400020371 0ustar [kernel] Parsing tests/spec/builtins.c (with preprocessing) /* Generated by Frama-C */ /*@ lemma cos_pi: \cos(π) ≡ -1.0; */ /*@ lemma truncate: \truncate(1.0) ≡ \truncate(1.0) ≡ 1; */ /*@ lemma coerce_and_truncate: ∀ double x; \truncate(x) ≡ \truncate(x); */ /*@ lemma nop: 1 ≡ 1; */ frama-c-20.0-Calcium/tests/spec/oracle/cast_enum_bts1546.0.res.oracle0000666000000000000000000000556013571573400022045 0ustar [kernel] Parsing tests/spec/cast_enum_bts1546.i (no preprocessing) /* Generated by Frama-C */ enum e { E0 = 0, E1 = 1 }; enum e_v1 { V1 = 0 }; enum e_v2 { V2 = 0 }; enum e_u1 { U1 = 0xFFFFFFFFU }; enum e_u2 { U2 = 0xFFFFFFFFU }; enum e_s1 { S1 = -1 }; enum e_s2 { S2 = -1 }; enum e_h1 { H1 = 0xFFFFFFFFFFFFFFFFULL }; enum e X; /*@ ensures P: X ≡ E0 ∧ \old(x) ≡ E1 ∧ X < \old(x) ∧ E0 ≤ E1 ⇒ \result ≡ E0; */ enum e f(enum e x) { enum e __retres; X = E0; __retres = E0; return __retres; } /*@ ensures P: \result ≡ (unsigned int)E0; */ enum e g(enum e x) { enum e __retres; __retres = (enum e)((unsigned int)E0); return __retres; } int s; unsigned int u; long long hs; unsigned long long hu; enum e_v1 v1; enum e_v1 vv1; enum e_v2 v2; enum e_u1 u1; enum e_u1 uu1; enum e_u2 u2; enum e_s1 s1; enum e_s1 ss1; enum e_s2 s2; enum e_h1 h1; void us(void) { u = (unsigned int)s; s = (int)u; u = U1; s = (int)U1; u = (unsigned int)S1; s = S1; u = (unsigned int)V1; s = V1; u = (unsigned int)H1; s = (int)H1; return; } void uu(void) { uu1 = (enum e_u1)u; uu1 = u1; uu1 = U1; uu1 = (enum e_u1)u2; uu1 = (enum e_u1)U2; uu1 = s; uu1 = (enum e_u1)s1; uu1 = S1; uu1 = (enum e_u1)v1; uu1 = V1; uu1 = (enum e_u1)H1; return; } void ss(void) { ss1 = (enum e_s1)u; ss1 = (enum e_s1)u1; ss1 = (enum e_s1)U1; ss1 = s; ss1 = s1; ss1 = S1; ss1 = (enum e_s1)s2; ss1 = S2; ss1 = (enum e_s1)v1; ss1 = V1; return; } void u_signed(void) { u1 = (int)u; u1 = (int)u1; u1 = (int)U1; u1 = (int)u2; u1 = (int)U2; u1 = s; u1 = (int)s1; u1 = S1; u1 = (int)s2; u1 = S2; u1 = (int)v1; u1 = V1; return; } void u_unsigned(void) { u1 = (enum e_u1)u; u1 = (enum e_u1)((unsigned int)u1); u1 = U1; u1 = (enum e_u1)((unsigned int)u2); u1 = (enum e_u1)U2; u1 = (enum e_u1)((unsigned int)s); u1 = (enum e_u1)((unsigned int)s1); u1 = (enum e_u1)((unsigned int)S1); u1 = (enum e_u1)((unsigned int)s2); u1 = (enum e_u1)((unsigned int)S2); u1 = (enum e_u1)((unsigned int)v1); u1 = (enum e_u1)((unsigned int)V1); u1 = (enum e_u1)((unsigned int)H1); return; } void s_signed(void) { s1 = (int)u; s1 = (int)u1; s1 = (int)U1; s1 = (int)u2; s1 = (int)U2; s1 = s; s1 = (int)s1; s1 = S1; s1 = (int)s2; s1 = S2; s1 = (int)v1; s1 = V1; s1 = (int)H1; return; } void s_unsigned(void) { s1 = (enum e_s1)u; s1 = (enum e_s1)((unsigned int)u1); s1 = (enum e_s1)U1; s1 = (enum e_s1)((unsigned int)u2); s1 = (enum e_s1)U2; s1 = (enum e_s1)((unsigned int)s); s1 = (enum e_s1)((unsigned int)s1); s1 = (enum e_s1)((unsigned int)S1); s1 = (enum e_s1)((unsigned int)s2); s1 = (enum e_s1)((unsigned int)S2); s1 = (enum e_s1)((unsigned int)v1); s1 = (enum e_s1)((unsigned int)V1); s1 = (enum e_s1)((unsigned int)H1); return; } frama-c-20.0-Calcium/tests/spec/oracle/cast_enum_bts1546.1.res.oracle0000666000000000000000000000557313571573400022052 0ustar [kernel] Parsing tests/spec/cast_enum_bts1546.i (no preprocessing) /* Generated by Frama-C */ enum e { E0 = 0, E1 = 1 }; enum e_v1 { V1 = 0 }; enum e_v2 { V2 = 0 }; enum e_u1 { U1 = 0xFFFFFFFFU }; enum e_u2 { U2 = 0xFFFFFFFFU }; enum e_s1 { S1 = -1 }; enum e_s2 { S2 = -1 }; enum e_h1 { H1 = 0xFFFFFFFFFFFFFFFFULL }; enum e X; /*@ ensures P: X ≡ E0 ∧ \old(x) ≡ E1 ∧ X < \old(x) ∧ E0 ≤ E1 ⇒ \result ≡ E0; */ enum e f(enum e x) { enum e __retres; X = E0; __retres = E0; return __retres; } /*@ ensures P: (unsigned int)\result ≡ (unsigned int)E0; */ enum e g(enum e x) { enum e __retres; __retres = (unsigned int)E0; return __retres; } int s; unsigned int u; long long hs; unsigned long long hu; enum e_v1 v1; enum e_v1 vv1; enum e_v2 v2; enum e_u1 u1; enum e_u1 uu1; enum e_u2 u2; enum e_s1 s1; enum e_s1 ss1; enum e_s2 s2; enum e_h1 h1; void us(void) { u = (unsigned int)s; s = (int)u; u = U1; s = (int)U1; u = (unsigned int)S1; s = S1; u = (unsigned int)V1; s = V1; u = (unsigned int)H1; s = (int)H1; return; } void uu(void) { uu1 = u; uu1 = u1; uu1 = U1; uu1 = (enum e_u1)u2; uu1 = U2; uu1 = (enum e_u1)s; uu1 = (enum e_u1)s1; uu1 = (enum e_u1)S1; uu1 = (enum e_u1)v1; uu1 = (enum e_u1)V1; uu1 = (enum e_u1)H1; return; } void ss(void) { ss1 = (enum e_s1)u; ss1 = (enum e_s1)u1; ss1 = (enum e_s1)U1; ss1 = s; ss1 = s1; ss1 = S1; ss1 = (enum e_s1)s2; ss1 = S2; ss1 = (enum e_s1)v1; ss1 = V1; return; } void u_signed(void) { u1 = (enum e_u1)((int)u); u1 = (enum e_u1)((int)u1); u1 = (enum e_u1)((int)U1); u1 = (enum e_u1)((int)u2); u1 = (enum e_u1)((int)U2); u1 = (enum e_u1)s; u1 = (enum e_u1)((int)s1); u1 = (enum e_u1)S1; u1 = (enum e_u1)((int)s2); u1 = (enum e_u1)S2; u1 = (enum e_u1)((int)v1); u1 = (enum e_u1)V1; return; } void u_unsigned(void) { u1 = u; u1 = (unsigned int)u1; u1 = U1; u1 = (unsigned int)u2; u1 = U2; u1 = (unsigned int)s; u1 = (unsigned int)s1; u1 = (unsigned int)S1; u1 = (unsigned int)s2; u1 = (unsigned int)S2; u1 = (unsigned int)v1; u1 = (unsigned int)V1; u1 = (unsigned int)H1; return; } void s_signed(void) { s1 = (int)u; s1 = (int)u1; s1 = (int)U1; s1 = (int)u2; s1 = (int)U2; s1 = s; s1 = (int)s1; s1 = S1; s1 = (int)s2; s1 = S2; s1 = (int)v1; s1 = V1; s1 = (int)H1; return; } void s_unsigned(void) { s1 = (enum e_s1)u; s1 = (enum e_s1)((unsigned int)u1); s1 = (enum e_s1)U1; s1 = (enum e_s1)((unsigned int)u2); s1 = (enum e_s1)U2; s1 = (enum e_s1)((unsigned int)s); s1 = (enum e_s1)((unsigned int)s1); s1 = (enum e_s1)((unsigned int)S1); s1 = (enum e_s1)((unsigned int)s2); s1 = (enum e_s1)((unsigned int)S2); s1 = (enum e_s1)((unsigned int)v1); s1 = (enum e_s1)((unsigned int)V1); s1 = (enum e_s1)((unsigned int)H1); return; } frama-c-20.0-Calcium/tests/spec/oracle/char_cst.res.oracle0000666000000000000000000000125613571573400020325 0ustar [kernel] Parsing tests/spec/char_cst.c (with preprocessing) /* Generated by Frama-C */ /*@ requires c ≢ '0'; behavior quote: assumes c ≡ '\''; behavior default: assumes c ≢ '\'' ∧ c ≢ 'a'; behavior slash: assumes c ≡ '\\'; behavior other: assumes c ≢ '\\' ∧ c ≢ 'a'; behavior hexa: assumes c ≢ '\253'; behavior oct: assumes c ≢ 'S'; behavior string: assumes "" ≢ "\"" ∧ "" ≡ ""; behavior esc: assumes c ≡ ' ' ∨ c ≡ '\f' ∨ c ≡ '\n' ∨ c ≡ '\r' ∨ c ≡ '\t' ∨ c ≡ '\v'; */ void f(char c) { return; } frama-c-20.0-Calcium/tests/spec/oracle/clash_double_file_bts1598.res.oracle0000666000000000000000000000167213571573400023363 0ustar [kernel] Parsing tests/spec/clash_double_file_bts1598.c (with preprocessing) /* Generated by Frama-C */ #include "__fc_builtin.h" #include "assert.h" #include "ctype.h" #include "errno.h" #include "inttypes.h" #include "locale.h" #include "math.h" #include "setjmp.h" #include "signal.h" #include "stdarg.h" #include "stdint.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "strings.h" #include "time.h" #include "wchar.h" [kernel] Parsing tests/spec/clash_double_file_bts1598.c (with preprocessing) [kernel] Parsing tests/spec/result/foo.c (with preprocessing) /* Generated by Frama-C */ #include "__fc_builtin.h" #include "assert.h" #include "ctype.h" #include "errno.h" #include "inttypes.h" #include "locale.h" #include "math.h" #include "setjmp.h" #include "signal.h" #include "stdarg.h" #include "stdint.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "strings.h" #include "time.h" #include "wchar.h" frama-c-20.0-Calcium/tests/spec/oracle/comparison.res.oracle0000666000000000000000000000117213571573400020706 0ustar [kernel] Parsing tests/spec/comparison.i (no preprocessing) [kernel] Predicate comparison between a of type 𝔹 and b of type 𝔹 [kernel] Predicate comparison between x of type int and y of type int [kernel] Predicate comparison between (long)x of type long and z of type long [kernel] Predicate comparison between (long)x of type long and z of type long [kernel] Term comparison between x of type int and y of type int [kernel] Term comparison between (long)x of type long and z of type long [kernel] Term comparison between z of type long and (long)y of type long [kernel] Term comparison between y of type int and x of type int frama-c-20.0-Calcium/tests/spec/oracle/complete_behaviors.res.oracle0000666000000000000000000000142713571573400022411 0ustar [kernel] Parsing tests/spec/complete_behaviors.c (with preprocessing) /* Generated by Frama-C */ enum __anonenum_kind_1 { Max = 0, Min = 1 }; typedef enum __anonenum_kind_1 kind; /*@ requires k ≡ Max ∨ k ≡ Min; ensures \result ≡ \old(x) ∨ \result ≡ \old(y); assigns \nothing; behavior is_max: assumes k ≡ Max; ensures \result ≥ \old(x) ∧ \result ≥ \old(y); behavior is_min: assumes k ≡ Min; ensures \result ≤ \old(x) ∧ \result ≤ \old(y); complete behaviors is_max, is_min; disjoint behaviors is_max, is_min; */ int extremum(kind k, int x, int y) { int tmp_0; int tmp; if (k == (unsigned int)Max) tmp = x > y; else tmp = x < y; if (tmp) tmp_0 = x; else tmp_0 = y; return tmp_0; } frama-c-20.0-Calcium/tests/spec/oracle/concrete_type.res.oracle0000666000000000000000000000122413571573400021375 0ustar [kernel] Parsing tests/spec/concrete_type.c (with preprocessing) /* Generated by Frama-C */ /*@ type list = Nil | Cons(A, list ); */ /*@ axiomatic length { logic ℤ length(list l) ; axiom length_empty: length(Nil) ≡ 0; axiom length_cons: ∀ D a, list l; length(Cons(a, l)) ≡ length(l) + 1; } */ /*@ type my_list = list<ℤ> ; */ /*@ logic my_list foo= Cons(1, Nil); */ /*@ type other_list = list ; */ /*@ logic other_list bar= Cons((int)42, Nil); */ /*@ lemma foo: length(bar) ≡ length(foo); */ /*@ type my_int = int; */ /*@ logic my_int x= (int)42; */ /*@ lemma baz: x + 1 ≡ 43; */ frama-c-20.0-Calcium/tests/spec/oracle/const.res.oracle0000666000000000000000000000061713571573400017665 0ustar [kernel] Parsing tests/spec/const.c (with preprocessing) [kernel] tests/spec/const.c:1: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. /* Generated by Frama-C */ /*@ logic ℤ strlen(char *c) ; */ /*@ requires strlen(c) < n; ensures strlen(\old(a)) ≤ \old(n); */ void f(char const *c, char * __restrict a, int n) { return; } frama-c-20.0-Calcium/tests/spec/oracle/const_ptr_bts1729.res.oracle0000666000000000000000000000030213571573400021734 0ustar [kernel] Parsing tests/spec/const_ptr_bts1729.i (no preprocessing) /* Generated by Frama-C */ static void elem_size(void) { /*@ assert \valid_read((char const * const *)0); */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/constant_predicate.res.oracle0000666000000000000000000000044313571573400022405 0ustar [kernel] Parsing tests/spec/constant_predicate.i (no preprocessing) /* Generated by Frama-C */ int x; /*@ predicate P{A}= x ≡ 42; */ /*@ logic ℤ f{B}= x + 42; */ /*@ lemma foo{C}: P ⇒ f ≡ 84; */ /*@ ensures f ≡ 84; */ void g(void) { x = 42; /*@ assert P; */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/contract_assert_bts1470.res.oracle0000666000000000000000000000041313571573400023113 0ustar [kernel] Parsing tests/spec/contract_assert_bts1470.i (no preprocessing) /* Generated by Frama-C */ int x; void main(void) { /*@ ensures \false; */ /*@ assert \true; */ x = 1; /*@ ensures \false; */ { /*@ assert \true; */ ; x = 1; } return; } frama-c-20.0-Calcium/tests/spec/oracle/conversion.res.oracle0000666000000000000000000000150413571573400020720 0ustar [kernel] Parsing tests/spec/conversion.c (with preprocessing) /* Generated by Frama-C */ typedef int T; typedef int T4[4]; typedef int *T_PTR; typedef T_PTR T_PTR_T4[4]; void f(void); /*@ lemma foo: 1.0 ≡ (float)1; */ /*@ axiomatic toto { logic ℤ g; predicate foo(ℝ x) ; } */ /*@ ensures 1.0 ≡ 1; */ void f(void) { double B; /*@ assert B ≡ g; */ ; return; } /*@ ensures foo(\result); */ int g(void) { int __retres; __retres = 0; return __retres; } T const X; T const Tab[4]; T_PTR_T4 const Tab_Ptr = {(int *)(& X), (int *)(& X), (int *)(& X), (int *)(& X)}; /*@ axiomatic useless_logic_cast { logic ℤ v2= 1 + 1; logic int vX{L}= \at((int)X,L); logic int [4] vTab{L}= \at((T4)Tab,L); logic T_PTR_T4 * vTab_Ptr{L}= \at((T_PTR_T4 *)(&Tab_Ptr),L); } */ frama-c-20.0-Calcium/tests/spec/oracle/declspec.res.oracle0000666000000000000000000000047613571573400020324 0ustar [kernel] Parsing tests/spec/declspec.c (with preprocessing) /* Generated by Frama-C */ /*@ axiomatic Foo { predicate p(char *s) ; } */ /*@ requires p(b); */ void f(char const * __attribute__((__whatever__)) a, char * __attribute__((__p__)) b) { /*@ assert p((char *)b); */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/default_assigns_bts0966.res.oracle0000666000000000000000000000442513571573400023110 0ustar [kernel] Parsing tests/spec/default_assigns_bts0966.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization auto_states[0..3] ∈ {0} [kernel] tests/spec/default_assigns_bts0966.i:34: Warning: No code nor implicit assigns clause for function copy, generating default assigns from the specification [eva] using specification for function copy [eva] tests/spec/default_assigns_bts0966.i:20: Warning: no \from part for clause 'assigns auto_states[Init], auto_states[Copy];' [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: auto_states[0] ∈ {0} [1] ∈ {1} [2..3] ∈ {0} __retres ∈ {0} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 7 statements reached (out of 7): 100% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 1 warning by the Frama-C kernel: 0 errors 1 warning ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- /* Generated by Frama-C */ enum states { Init = 0, Copy = 1, Set = 2, Final = 3 }; int auto_states[4]; /*@ ensures \true; assigns auto_states[Init], auto_states[Copy]; behavior from_init: assumes auto_states[Init] ≡ 1; ensures auto_states[Copy] ≡ 1 ∧ auto_states[Init] ≡ 0; assigns auto_states[Init], auto_states[Copy]; behavior from_other: assumes auto_states[Init] ≡ 0; assigns \nothing; */ void copy(int x); int main(void) { int __retres; auto_states[Init] = 1; auto_states[Copy] = 0; auto_states[Set] = 0; auto_states[Final] = 0; copy(0); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/doxygen.res.oracle0000666000000000000000000000112013571573400020202 0ustar [kernel] Parsing tests/spec/doxygen.c (with preprocessing) /* Generated by Frama-C */ /* run.config OPT: -keep-comments -print -then -pp-annot */ /* @{ */ /* @{ Bla */ /* @{ */ /* @{ Blu */ void doxygen_group(void) { return; } /* @} Bli */ /* @} */ /* @} */ /* @} Bly */ void main(); [kernel] Parsing tests/spec/doxygen.c (with preprocessing) /* Generated by Frama-C */ /* run.config OPT: -keep-comments -print -then -pp-annot */ /* @{ */ /* @{ Bla */ /* @{ */ /* @{ Blu */ void doxygen_group(void) { return; } /* @} Bli */ /* @} */ /* @} */ /* @} Bly */ void main(); frama-c-20.0-Calcium/tests/spec/oracle/enum.res.oracle0000666000000000000000000000061213571573400017476 0ustar [kernel] Parsing tests/spec/enum.c (with preprocessing) /* Generated by Frama-C */ enum __anonenum_T_BOOLEEN_1 { VRAI = 1, FALSE = 0 }; typedef enum __anonenum_T_BOOLEEN_1 T_BOOLEEN; /*@ logic T_BOOLEEN test(ℤ b) = b ≡ 1? VRAI: FALSE; */ /*@ ensures \result ≡ test(\old(boo)); */ T_BOOLEEN test(int boo) { T_BOOLEEN b; if (boo == 1) b = VRAI; else b = FALSE; return b; } frama-c-20.0-Calcium/tests/spec/oracle/error_msg.res.oracle0000666000000000000000000000042113571573400020527 0ustar [kernel] Parsing tests/spec/error_msg.i (no preprocessing) [kernel:annot-error] tests/spec/error_msg.i:4: Warning: expecting ';' before ensures [kernel:annot-error] tests/spec/error_msg.i:8: Warning: expecting ';' before end of annotation /* Generated by Frama-C */ frama-c-20.0-Calcium/tests/spec/oracle/exit_clause.res.oracle0000666000000000000000000000217413571573400021044 0ustar [kernel] Parsing tests/spec/exit_clause.c (with preprocessing) [kernel:annot-error] tests/spec/exit_clause.c:23: Warning: \result meaningless. Ignoring logic specification of function f [kernel:annot-error] tests/spec/exit_clause.c:26: Warning: unbound logic variable \exit_status. Ignoring logic specification of function g [kernel:annot-error] tests/spec/exit_clause.c:28: Warning: unbound logic variable \exit_status. Ignoring code annotation /* Generated by Frama-C */ /*@ exits never_exits: \false; */ int main(void) { int __retres; __retres = 0; return __retres; } /*@ ensures never_returns: \false; exits \exit_status ≡ \old(status); assigns \nothing; */ extern void exit(int status); /*@ behavior never_exits: assumes x ≥ 0; exits \false; behavior never_returns: assumes x < 0; ensures never_returns: \false; exits \exit_status ≡ \old(x); assigns \nothing; */ int may_exit(int x) { int __retres; if (x) exit(0); __retres = 0; return __retres; } int f(void) { int __retres; __retres = 0; return __retres; } void g(void) { exit(0); return; } frama-c-20.0-Calcium/tests/spec/oracle/expr_to_term.res.oracle0000666000000000000000000000151113571573400021240 0ustar [kernel] Parsing tests/spec/expr_to_term.i (no preprocessing) /* Generated by Frama-C */ struct S { int y ; int z ; }; int x[10]; struct S s; int t; /*@ predicate int_eq(int logical, int from_c) = logical ≡ from_c; */ /*@ ensures int_eq(*((int *)(0x1 + 0x2)), *((int *)(0x1 + 0x2))); ensures int_eq(*((int *)(0x1 + 0x2)), (int)0); */ int f(void) { int __retres; *((int *)((unsigned int)0x1 + (unsigned int)0x2)) = 0; __retres = 0; return __retres; } /*@ ensures int_eq(t, t); ensures int_eq(s.z, s.z); ensures int_eq(s.y, s.y); ensures int_eq(x[0], x[0]); ensures int_eq(x[0], (int)1); ensures int_eq(s.y, (int)2); ensures int_eq(s.z, (int)3); ensures int_eq(t, (int)4); */ int main(void) { int __retres; x[0] = 1; s.y = 2; s.z = 3; t = 4; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/fct_ptr.res.oracle0000666000000000000000000000052013571573400020171 0ustar [kernel] Parsing tests/spec/fct_ptr.c (with preprocessing) /* Generated by Frama-C */ int x; void inc(void) { x ++; return; } void dec(void) { x --; return; } void (*f)(void) = & dec; void (*g)(void) = & inc; void call(void (*x_0)(void)) { (*x_0)(); return; } /*@ predicate foo{L}= \at(f ≡ &dec ∨ f ≡ &inc,L); */ frama-c-20.0-Calcium/tests/spec/oracle/first.res.oracle0000666000000000000000000000075613571573400017672 0ustar [kernel] Parsing tests/spec/first.c (with preprocessing) [kernel] Parsing tests/spec/third.c (with preprocessing) [kernel] Parsing tests/spec/second.c (with preprocessing) /* Generated by Frama-C */ int bar(int *third); void main(int *c) { bar(c); return; } /*@ behavior b: requires \valid(third); ensures \result ≡ 0; */ int bar(int *third) { int __retres; third = (int *)*third; __retres = 0; return __retres; } void sub(char *c) { bar((int *)c); return; } frama-c-20.0-Calcium/tests/spec/oracle/float-acsl.res.oracle0000666000000000000000000000301313571573400020555 0ustar [kernel] Parsing tests/spec/float-acsl.i (no preprocessing) [kernel:acsl-float-compare] tests/spec/float-acsl.i:28: Warning: comparing two float values as real values. You might want to use \le_float instead [kernel:acsl-float-compare] tests/spec/float-acsl.i:30: Warning: comparing two float values as real values. You might want to use \le_float instead [kernel:acsl-float-compare] tests/spec/float-acsl.i:30: Warning: comparing two float values as real values. You might want to use \le_float instead /* Generated by Frama-C */ /*@ ensures \le_double(\result, (double)0.0); ensures \ge_double(\result, (double)(-1.0)); ensures \lt_double(\result, (double)1.0); ensures \gt_double(\result, (double)(-2.0)); ensures \ne_double(\result, (double)(-0.5)); ensures \eq_double(\result, (double)(-1.0)); assigns \result; assigns \result \from \nothing; */ double minus_one(void); /*@ ensures \le_float(\result, (float)0.0); ensures \ge_float(\result, (float)(-1.0)); ensures \lt_float(\result, (float)1.0); ensures \gt_float(\result, (float)(-2.0)); ensures \ne_float(\result, (float)(-0.5)); ensures \eq_float(\result, (float)(-1.0)); assigns \result; assigns \result \from \nothing; */ float minus_onef(void); /*@ requires (ℝ)x ≤ (ℝ)y; ensures (ℝ)\old(x) ≤ (ℝ)\result ≤ (ℝ)\old(y); assigns \result; assigns \result \from x, y; */ float test(float x, float y); void main(void) { double mone = minus_one(); float monef = minus_onef(); return; } frama-c-20.0-Calcium/tests/spec/oracle/footprint.res.oracle0000666000000000000000000000143613571573400020563 0ustar [kernel] Parsing tests/spec/footprint.c (with preprocessing) [kernel:annot-error] tests/spec/footprint.c:34: Warning: not an assignable left value: footprint2{Old}(s). Ignoring logic specification of function g /* Generated by Frama-C */ struct S { char *x ; int *y ; }; struct V { char x ; char t[10] ; }; /*@ logic set footprint(struct S s) = \union(s.x, (char *)s.y + (0 .. sizeof(int) - 1)); */ /*@ requires \valid(\union((char *)s + (0 .. sizeof(struct S)), footprint(*s))); assigns *footprint(*s); */ int f(struct S *s) { int __retres; __retres = (int)*(s->x) + *(s->y); return __retres; } /*@ logic set footprint2{L}(struct V *s) = \union(s->x, s->t[0 .. 5]); */ void g(struct V *s) { s->x = (char)1; s->t[4] = (char)1; return; } frama-c-20.0-Calcium/tests/spec/oracle/for_scope.res.oracle0000666000000000000000000000027213571573400020513 0ustar [kernel] Parsing tests/spec/for_scope.c (with preprocessing) /* Generated by Frama-C */ void f(void) { int i = 0; /*@ loop invariant i ≥ 0; */ while (i < 10) i ++; return; } frama-c-20.0-Calcium/tests/spec/oracle/fptr.res.oracle0000666000000000000000000000231513571573400017507 0ustar [kernel] Parsing tests/spec/fptr.i (no preprocessing) [kernel:annot-error] tests/spec/fptr.i:39: Warning: invalid implicit conversion from 'void (*)(int )' to 'void (*)(void)'. Ignoring logic specification of function f3 /* Generated by Frama-C */ /*@ axiomatic A { predicate P{L}(void (*galois_fp)()) ; predicate Q{L, L2}(void (*galois_fp_old)()) ; } */ /*@ requires P{Pre}((void (*)())\at(fp,Pre)); ensures Q{Pre, Post}((void (*)())\at(fp,Pre)); */ long f0(void (*fp)(void)) { long __retres; __retres = (long)0; return __retres; } /*@ requires P{Pre}((void (*)())\at(fp,Pre)); ensures Q{Pre, Post}((void (*)())\at(fp,Pre)); */ long f1(void (*fp)(int )) { long __retres; __retres = (long)0; return __retres; } /*@ axiomatic A1 { predicate P1{L}(void (*galois_fp)(void)) ; predicate Q1{L, L2}(void (*galois_fp_old)(void)) ; } */ /*@ requires P1{Pre}(\at(fp,Pre)); ensures Q1{Pre, Post}(\at(fp,Pre)); */ long f2(void (*fp)(void)) { long __retres; __retres = (long)0; return __retres; } long f3(void (*fp)(int )) { long __retres; __retres = (long)0; return __retres; } void my_f(void) { return; } /*@ lemma OK{L}: P((void (*)())(&my_f)) ∧ P1(&my_f); */ frama-c-20.0-Calcium/tests/spec/oracle/ghost.res.oracle0000666000000000000000000000053713571573400017664 0ustar [kernel] Parsing tests/spec/ghost.c (with preprocessing) /* Generated by Frama-C */ struct A { int x ; }; struct B { int y ; }; /*@ ghost struct B b1; */ /*@ requires b1.y ≡ 0; */ int main(void) { int __retres; /*@ ghost struct B b; */ struct A a; /*@ ghost b.y = 0; */ /*@ ghost a.x = b.y; */ __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/homax.res.oracle0000666000000000000000000000063113571573400017647 0ustar [kernel] Parsing tests/spec/homax.c (with preprocessing) /* Generated by Frama-C */ int max_seq(int *p, int n); /*@ requires n > 0 ∧ \valid(p + (0 .. n - 1)); ensures \result ≡ \max(0, \old(n) - 1, \lambda ℤ i; *(\old(p) + i)); */ int max_seq(int *p, int n) { int res = *p; { int i = 0; while (i < n) { if (res < *p) res = *p; p ++; i ++; } } return res; } frama-c-20.0-Calcium/tests/spec/oracle/hosum.res.oracle0000666000000000000000000000116013571573400017664 0ustar [kernel] Parsing tests/spec/hosum.c (with preprocessing) /* Generated by Frama-C */ int sqsum(int *p, int n); /*@ requires n ≥ 0; requires \valid(p + (0 .. n - 1)); ensures \result ≡ \sum(0, \old(n) - 1, \lambda ℤ i; *(\old(p) + i) * *(\old(p) + i)); assigns \nothing; */ int sqsum(int *p, int n) { int tmp; int S = 0; { int i = 0; while (i < n) { /*@ assert *(p + i) * *(p + i) ≤ 1 << (30 - 1); */ ; tmp = *(p + i) * *(p + i); /*@ assert tmp ≥ 0; */ ; /*@ assert S + tmp ≤ 1 << (30 - 1); */ ; S += tmp; i ++; } } return S; } frama-c-20.0-Calcium/tests/spec/oracle/if.res.oracle0000666000000000000000000000104213571573400017126 0ustar [kernel] Parsing tests/spec/if.c (with preprocessing) [kernel] tests/spec/if.c:7: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel:annot-error] tests/spec/if.c:12: Warning: invalid implicit conversion from 'int' to 'char *'. Ignoring code annotation /* Generated by Frama-C */ int a; int b; /*@ requires MyPre: a < b? \true: \false; */ void main(void) { return; } /*@ predicate P(char *s) ; */ void g(char *s); void f(void) { int x = 0; g((char *)x); return; } frama-c-20.0-Calcium/tests/spec/oracle/kw.res.oracle0000666000000000000000000000317113571573400017156 0ustar [kernel] Parsing tests/spec/kw.c (with preprocessing) /* Generated by Frama-C */ typedef int assert; struct custom { int reads ; int behaviors ; int label ; }; struct at { int module ; int function ; int global ; }; struct loop { int requires ; int ensures ; int checks ; }; assert behavior = 0; /*@ logic assert foo(assert x) = x; */ /*@ requires behavior ≥ 0; ensures behavior ≥ 0; assigns behavior; assigns behavior \from behavior; */ int main(void) { int __retres; struct custom writes; struct at include; struct loop assert; /*@ slevel 4; */ behavior ++; /*@ assert custom: writes.reads + writes.behaviors ≤ (\let global = writes.label; global); */ ; /*@ assert at: include.function + include.module ≤ (\let behaviors = include.global; behaviors); */ ; /*@ assert loop: assert.ensures + assert.ensures ≤ (\let reads = assert.checks; reads); */ ; __retres = 0; return __retres; } /*@ type List = Nil | Cons(A, List ); */ /*@ inductive model{L}(List<ℤ> root, List<ℤ> logic_list) { case nil{L}: model(Nil, Nil); case cons{L}: ∀ List<ℤ> l1, List<ℤ> ll1; model(l1, ll1) ⇒ model(Cons(0, l1), Cons(0, ll1)); } */ /*@ axiomatic foo { logic ℤ func{L}(ℤ i) reads behavior; } */ int volatile assigns; int ensures(int volatile *a) { int __retres; __retres = *a; return __retres; } int requires(int volatile *a, int v) { *a = v; return v; } /*@ volatile assigns reads ensures writes requires; */ int slevel = 1000000; /*@ lemma bar{L}: slevel ≥ 0; */ frama-c-20.0-Calcium/tests/spec/oracle/label_scope_bts1536.res.oracle0000666000000000000000000000107413571573400022174 0ustar [kernel] Parsing tests/spec/label_scope_bts1536.i (no preprocessing) /* Generated by Frama-C */ void f(void) { int i; LInit: { LLoop: i = 0; /*@ assert \at(1,LInit) ≡ 1; */ ; } return; } int x; void g(void) { L1: /*@ assert \at(x,L1) ≡ \at(x,L1); */ ; L3: ; /*@ assert \at(x,L1) ≡ \at(x,L1); */ ; /*@ assert \at(x,L3) ≡ \at(x,L3); */ ; return; } void h(void) { L1: /*@ ensures \at(x,L1) ≡ \at(x,L1); */ L3: ; /*@ assert \at(x,L1) ≡ \at(x,L1); */ ; /*@ assert \at(x,L3) ≡ \at(x,L3); */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/lib.res.oracle0000666000000000000000000000054713571573400017307 0ustar [kernel] Parsing tests/spec/lib.c (with preprocessing) [kernel] tests/spec/lib.h:1: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. /* Generated by Frama-C */ /*@ logic int f(int i) ; */ /*@ ensures f((int)0) ≡ (int)0; */ int main(void) { int __retres; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/liens.res.oracle0000666000000000000000000000044613571573400017651 0ustar [kernel] Parsing tests/spec/liens.c (with preprocessing) /* Generated by Frama-C */ int e; /*@ ensures e ≡ 2; assigns e; */ void f(void) { e = 2; return; } /*@ ensures e ≡ 6; assigns e; */ int main(void) { int __retres; e = 1; f(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/list.res.oracle0000666000000000000000000000407013571573400017507 0ustar [kernel] Parsing tests/spec/list.i (no preprocessing) /* Generated by Frama-C */ /*@ type List = \list ; */ /*@ logic List<ℤ> \empty_integer_list= [| |]; */ /*@ predicate is_empty_list_1(\list<ℤ> l1) = l1 ≡ [| |]; */ /*@ predicate is_empty_list_2(\list<ℤ> l1) = l1 ≡ [| |]; */ /*@ predicate is_empty_list_3(\list<ℤ> l1) = l1 ≡ \empty_integer_list; */ /*@ logic \list<ℤ> empty_1= [| |]; */ /*@ logic \list<ℤ> empty_2= [| |]; */ /*@ logic \list<ℤ> empty_3= \empty_integer_list; */ /*@ logic \list<\list<ℤ> > list_of_list_1= [| [| |] |]; */ /*@ logic \list<ℤ> call_to_1(ℤ id) = [| id |]; */ /*@ logic \list<ℤ> call_to_2(ℤ id) = [| id |]; */ /*@ logic \list<ℤ> call_to_3(ℤ id) = \Cons(id, \empty_integer_list); */ /*@ logic \list<ℤ> list_1(int e1, ℤ e2) = [| e1, e2 |]; */ /*@ logic \list<ℤ> list_2(ℤ e1, ℤ e2) = [| e1, e2 |]; */ /*@ logic \list<ℤ> list_3(ℤ e1, ℤ e2) = \Cons(e1, \Cons(e2, \empty_integer_list)); */ /*@ logic \list<ℤ> concat_1(\list<ℤ> seq1, \list<ℤ> seq2) = seq1 ^ seq2; */ /*@ logic \list<ℤ> concat_2(\list<ℤ> seq1, \list<ℤ> seq2) = seq1 ^ seq2; */ /*@ logic \list<ℤ> repeat_1(\list<ℤ> seq, ℤ n) = seq *^ n; */ /*@ logic \list<ℤ> repeat_2(\list<ℤ> seq, ℤ n) = seq *^ n; */ /*@ logic \list<ℤ> add_call_to_1(ℤ id, \list<ℤ> seq) = seq ^ [| id |]; */ /*@ logic \list<ℤ> add_call_to_2(ℤ id, \list<ℤ> seq) = seq ^ [| id |]; */ /*@ logic \list<ℤ> add_call_to_3(ℤ id, \list<ℤ> seq) = seq ^ call_to_1(id); */ /*@ predicate Padd_id{L1, L2}(ℤ id, \list<ℤ> seq) = \at(seq,L1) ≡ (\at(seq,L2) ^ [| id |]); */ /*@ predicate Prepeat{L1, L2}(ℤ times, \list<ℤ> seq) = \at(seq,L1) ≡ (\at(seq,L2) *^ times); */ /*@ ghost int seq; */ /*@ axiomatic Ghost { logic \list<ℤ> ghost_seq{L} reads seq; } */ /*@ ensures Padd_id{Here, Pre}(\old(id), ghost_seq); assigns seq; */ void add_id(int id); /*@ lemma length{L}: \length(ghost_seq) ≥ 0; */ /*@ lemma nth{L}: \nth(\Cons(1, ghost_seq), 0) ≡ 1; */ frama-c-20.0-Calcium/tests/spec/oracle/local.res.oracle0000666000000000000000000000132013571573400017621 0ustar [kernel] Parsing tests/spec/local.c (with preprocessing) /* Generated by Frama-C */ /*@ ensures \let i = \old(x) + 1; i ≡ \result; ensures \result ≡ (\let i = \old(x); i + 1); */ int f(int x) { int __retres; __retres = x + 1; return __retres; } /*@ requires (int)((x + y) + 1) ≡ (x + y) + 1; ensures \let f = \lambda ℤ x, ℤ y; \let x1 = x + 1; x1 + y; \let P = \lambda ℤ x, ℤ y; x ≡ y; P(f(\old(x), \old(y)), \result) ≡ \true; */ int g(int x, int y) { int __retres; __retres = (x + y) + 1; return __retres; } /*@ axiomatic a { predicate P(ℤ v) ; } */ /*@ lemma l1: \let p = \lambda ℤ x; P(x); p(1); */ /*@ lemma l2: \let p = P(1); p; */ frama-c-20.0-Calcium/tests/spec/oracle/localization.res.oracle0000666000000000000000000000207613571573400021230 0ustar [kernel] Parsing tests/spec/localization.c (with preprocessing) [kernel:annot-error] tests/spec/localization.c:6: Warning: unbound logic variable j. Ignoring global annotation [kernel:annot-error] tests/spec/localization.c:8: Warning: unbound logic variable k. Ignoring global annotation [kernel:annot-error] tests/spec/localization.c:10: Warning: unbound logic variable l. Ignoring global annotation [kernel:annot-error] tests/spec/localization.c:15: Warning: unbound logic variable bar. Ignoring code annotation [kernel:annot-error] tests/spec/localization.c:16: Warning: unbound logic variable foo. Ignoring code annotation [kernel:annot-error] tests/spec/localization.c:23: Warning: unbound logic variable wrong. Ignoring code annotation [kernel:annot-error] tests/spec/localization.c:33: Warning: no such type S1. Ignoring global annotation /* Generated by Frama-C */ /*@ logic ℤ f(ℤ i) = 1; */ void ComposerPage(void) { int x = 0; x ++; return; } void f(void) { /*@ ghost int index = 0; */ int x = 0; return; } void g(void) { return; } frama-c-20.0-Calcium/tests/spec/oracle/location_char.res.oracle0000666000000000000000000000437713571573400021353 0ustar [kernel] Parsing tests/spec/location_char.c (with preprocessing) [kernel] Predicate x ≤ 0: start line 9, char 26 end line 9, char 30 [kernel] Term x: start line 9, char 26 end line 9, char 27 [kernel] Term x: start line 9, char 26 end line 9, char 27 [kernel] Term 0: start line 9, char 29 end line 9, char 30 [kernel] Predicate y ≤ 0 ∧ x ≡ y: start line 11, char 13 end line 12, char 19 [kernel] Predicate y ≤ 0: start line 11, char 13 end line 11, char 19 [kernel] Term y: start line 11, char 13 end line 11, char 14 [kernel] Term y: start line 11, char 13 end line 11, char 14 [kernel] Term 0: start line 11, char 18 end line 11, char 19 [kernel] Predicate x ≡ y: start line 12, char 13 end line 12, char 19 [kernel] Term x: start line 12, char 13 end line 12, char 14 [kernel] Term y: start line 12, char 18 end line 12, char 19 [kernel] Predicate x ≤ 0: start line 6, char 13 end line 6, char 19 [kernel] Term x: start line 6, char 13 end line 6, char 14 [kernel] Term x: start line 6, char 13 end line 6, char 14 [kernel] Term 0: start line 6, char 18 end line 6, char 19 [kernel] Predicate \result ≡ \old(x): start line 7, char 12 end line 7, char 24 [kernel] Term \result: start line 7, char 12 end line 7, char 19 [kernel] Term \old(x): start line 7, char 23 end line 7, char 24 [kernel] Term x: start line 7, char 23 end line 7, char 24 [kernel] Predicate outer.inner.a ≡ 0: start line 37, char 36 end line 37, char 54 [kernel] Term outer.inner.a: start line 37, char 36 end line 37, char 49 [kernel] Term outer.inner.a: start line 37, char 36 end line 37, char 49 [kernel] Term 0: start line 37, char 53 end line 37, char 54 [kernel] Predicate outer.b ≡ outer.inner.a ∧ 0 ≢ 1: start line 38, char 29 end line 40, char 23 [kernel] Predicate outer.b ≡ outer.inner.a: start line 38, char 29 end line 39, char 21 [kernel] Term outer.b: start line 38, char 29 end line 38, char 36 [kernel] Term outer.inner.a: start line 39, char 8 end line 39, char 21 [kernel] Predicate 0 ≢ 1: start line 40, char 17 end line 40, char 23 [kernel] Term 0: start line 40, char 17 end line 40, char 18 [kernel] Term 1: start line 40, char 22 end line 40, char 23 frama-c-20.0-Calcium/tests/spec/oracle/logic_array.res.oracle0000666000000000000000000000147113571573400021031 0ustar [kernel] Parsing tests/spec/logic_array.i (no preprocessing) /* Generated by Frama-C */ /*@ axiomatic Array_unsigned { logic ℤ size10= 10; type T_array10_unsigned = unsigned int [10]; logic T_array10_unsigned C_tab10 reads \nothing; predicate check(T_array10_unsigned tab, ℤ idx, unsigned int v) = tab[idx] ≡ v; logic T_array10_unsigned modified (T_array10_unsigned tab, ℤ idx, unsigned int v) = {tab \with [idx] = v}; lemma check_modified: ∀ unsigned int tab[10], ℤ idx, unsigned int v; check(modified(tab, idx, v), idx, v); } */ int A[3]; int B[2] = {42, 43}; /*@ logic int f(int x[], ℤ idx) = x[idx]; */ /*@ lemma foo{L}: f((int [])B, 0) ≡ 42; */ /*@ lemma bar{L}: f((int [])A, 0) ≡ 44; */ /*@ lemma bli{L}: A ≢ B; */ int A[3] = {44, 45, 46}; frama-c-20.0-Calcium/tests/spec/oracle/logic_compare.res.oracle0000666000000000000000000000037213571573400021340 0ustar [kernel] Parsing tests/spec/logic_compare.c (with preprocessing) /* Generated by Frama-C */ /*@ axiomatic Foo { type foo; predicate test(foo x) ; axiom foo_eq_refl: ∀ foo x; x ≡ x; axiom foo_test: ∀ foo x; test(x); } */ frama-c-20.0-Calcium/tests/spec/oracle/logic_def.res.oracle0000666000000000000000000000300213571573400020441 0ustar [kernel] Parsing tests/spec/logic_def.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/spec/logic_def.c:9: assertion got status valid. [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {42} __retres ∈ {0} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 4 statements reached (out of 4): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 1 valid 0 unknown 0 invalid 1 total Preconditions 0 valid 0 unknown 0 invalid 0 total 100% of the logical properties reached have been proven. ---------------------------------------------------------------------------- /* Generated by Frama-C */ /*@ logic ℤ foo(int x) = x + 2; */ int main(void) { int __retres; int x = 42; /*@ assert foo(x) ≥ x; */ ; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/logic_label.res.oracle0000666000000000000000000000217313571573400020772 0ustar [kernel] Parsing tests/spec/logic_label.c (with preprocessing) /* Generated by Frama-C */ void f(void) { int x = 0; L: x ++; /*@ ensures \at(\true,Pre); */ x ++; /*@ assert \at(x,L) ≡ 0; */ ; /*@ assert \at(x ≡ 0,L); */ ; return; } int g(int i) { lab: /*@ assert i ≡ \at(i,lab); */ ; return i; } /*@ predicate modified{L1, L2}(int x) = \at(x,L1) ≢ \at(x,L2); */ /*@ logic ℤ diff{L1, L2}(ℤ x) = \at(x,L1) - \at(x,L2); */ int h(void) { int __retres; int x = 0; l: x ++; /*@ assert modified{Here, l}(x) ∧ diff{Here, l}(x) ≡ 1; */ ; __retres = 0; return __retres; } /*@ logic ℤ foo{L}(ℤ x) = x + 1; */ /*@ assigns *(x + (0 .. foo{Old}(0))); */ int u(int *x) { int __retres; int *tmp; tmp = x; x ++; *tmp = 0; *x = 1; /*@ assert \at(\true,Pre); */ ; __retres = *x; return __retres; } int X; void labels_in_stmt_annot(void) { X ++; /*@ requires X > \at(X,Pre); ensures X ≡ \old(X) + 1; ensures X ≡ \at(X,Pre) + 2; ensures X ≡ \at(X,Post); */ X ++; /*@ ensures X ≡ \at(X,Here); */ X ++; /*@ assert X ≡ \at(X,Pre) + 3; */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/logic_labels_wrong.res.oracle0000666000000000000000000000166213571573400022373 0ustar [kernel] Parsing tests/spec/logic_labels_wrong.c (with preprocessing) [kernel:annot-error] tests/spec/logic_labels_wrong.c:4: Warning: multiple defined label `L'. Ignoring global annotation [kernel:annot-error] tests/spec/logic_labels_wrong.c:19: Warning: \old undefined in this context. Ignoring loop annotation [kernel:annot-error] tests/spec/logic_labels_wrong.c:23: Warning: logic label `L0' not found. Ignoring code annotation [kernel:annot-error] tests/spec/logic_labels_wrong.c:26: Warning: logic label `L1' not found. Ignoring code annotation [kernel:annot-error] tests/spec/logic_labels_wrong.c:31: Warning: logic label `L2' not found. Ignoring code annotation /* Generated by Frama-C */ int x; /*@ predicate p(int t[]) = t[0] ≢ 0; */ /*@ axiomatic Q { predicate q(int t[]) ; axiom q_ax: ∀ int t[]; t[0] ≡ 0 ⇒ q(t); } */ void f(void) { while (1) ; while (1) L2: x = 0; L1: x = 0; return; } frama-c-20.0-Calcium/tests/spec/oracle/logic_type.res.oracle0000666000000000000000000000362713571573400020701 0ustar [kernel] Parsing tests/spec/logic_type.c (with preprocessing) [kernel] tests/spec/logic_type.c:1: Warning: parsing obsolete ACSL construct 'logic type declaration'. 'an axiomatic block' should be used instead. [kernel] tests/spec/logic_type.c:2: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel] tests/spec/logic_type.c:3: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel] tests/spec/logic_type.c:7: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel:annot-error] tests/spec/logic_type.c:3: Warning: no such type t1. Ignoring global annotation [kernel:annot-error] tests/spec/logic_type.c:6: Warning: Definition of t2 is cyclic. Ignoring global annotation [kernel:annot-error] tests/spec/logic_type.c:7: Warning: no such type t2. Ignoring global annotation [kernel:annot-error] tests/spec/logic_type.c:8: Warning: no such type t2. Ignoring global annotation /* Generated by Frama-C */ struct __anonstruct_Point_1 { int x ; int y ; }; typedef struct __anonstruct_Point_1 Point; /*@ type t; */ /*@ logic t create(int x) ; */ /*@ axiomatic A { type point = Point; predicate Q{L}(Point *tt) reads \at(*(tt + (0 .. 1)),L), \at((tt + 2)->x,L), \at((tt + 2)->y,L); type triangle = Point [3]; predicate P(triangle tt) = tt[1].x ≡ tt[2].y; } */ /*@ ensures Q(\old(q)); ensures P((Point [3])\old(q)); */ void f(Point *q); Point tab[3]; /*@ ensures Q((Point *)tab); ensures P(tab); */ void h(void) { f(tab); return; } /*@ logic t t_from_t(t x) = x; */ /*@ logic _Bool _Bool_from_boolean(𝔹 b) = (_Bool)b; */ /*@ logic 𝔹 boolean_from_integer(ℤ b) = b ≢ 0; */ /*@ logic 𝔹 boolean_from_int(int b) = b ≢ 0; */ /*@ logic 𝔹 boolean_from_Bool(_Bool b) = b ≢ 0; */ frama-c-20.0-Calcium/tests/spec/oracle/loop_labels.res.oracle0000666000000000000000000000073413571573400021032 0ustar [kernel] Parsing tests/spec/loop_labels.i (no preprocessing) [kernel:annot-error] tests/spec/loop_labels.i:14: Warning: logic label `LoopEntry' not found. Ignoring code annotation /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; /*@ loop invariant \at(x,LoopEntry) ≡ 0; loop invariant \at(x,LoopCurrent) ≤ 15; */ while (x < 15) { x ++; /*@ assert x ≡ \at(x,LoopCurrent) + 1; */ ; } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/loop_labels_unroll.res.oracle0000666000000000000000000000422413571573400022423 0ustar [kernel] Parsing tests/spec/loop_labels_unroll.i (no preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; unrolling_7_loop: ; if (! (x < 15)) goto unrolling_2_loop; { x ++; /*@ assert x ≡ \at(x,unrolling_7_loop) + 1; */ ; int i_unroll_32 = 0; /*@ loop invariant \at(i_unroll_32,LoopEntry) ≡ 0; */ while (i_unroll_32 < 4) { i_unroll_32 ++; /*@ assert \at(i_unroll_32,LoopCurrent) ≡ i_unroll_32 - 1; */ ; } /*@ assert i_unroll_32 > 0; */ ; } unrolling_6_loop: ; if (! (x < 15)) goto unrolling_2_loop; { x ++; /*@ assert x ≡ \at(x,unrolling_6_loop) + 1; */ ; int i_unroll_24 = 0; /*@ loop invariant \at(i_unroll_24,LoopEntry) ≡ 0; */ while (i_unroll_24 < 4) { i_unroll_24 ++; /*@ assert \at(i_unroll_24,LoopCurrent) ≡ i_unroll_24 - 1; */ ; } /*@ assert i_unroll_24 > 0; */ ; } unrolling_5_loop: ; if (! (x < 15)) goto unrolling_2_loop; { x ++; /*@ assert x ≡ \at(x,unrolling_5_loop) + 1; */ ; int i_unroll_16 = 0; /*@ loop invariant \at(i_unroll_16,LoopEntry) ≡ 0; */ while (i_unroll_16 < 4) { i_unroll_16 ++; /*@ assert \at(i_unroll_16,LoopCurrent) ≡ i_unroll_16 - 1; */ ; } /*@ assert i_unroll_16 > 0; */ ; } unrolling_4_loop: ; if (! (x < 15)) goto unrolling_2_loop; { x ++; /*@ assert x ≡ \at(x,unrolling_4_loop) + 1; */ ; int i_unroll_8 = 0; /*@ loop invariant \at(i_unroll_8,LoopEntry) ≡ 0; */ while (i_unroll_8 < 4) { i_unroll_8 ++; /*@ assert \at(i_unroll_8,LoopCurrent) ≡ i_unroll_8 - 1; */ ; } /*@ assert i_unroll_8 > 0; */ ; } unrolling_3_loop: ; /*@ loop invariant \at(x,LoopEntry) ≡ 0; loop invariant \at(x,LoopCurrent) ≤ 15; loop pragma UNROLL 4; loop pragma UNROLL "done", 4; */ while (x < 15) { x ++; /*@ assert x ≡ \at(x,LoopCurrent) + 1; */ ; int i = 0; /*@ loop invariant \at(i,LoopEntry) ≡ 0; */ while (i < 4) { i ++; /*@ assert \at(i,LoopCurrent) ≡ i - 1; */ ; } /*@ assert i > 0; */ ; } unrolling_2_loop: ; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/max.res.oracle0000666000000000000000000000346413571573400017327 0ustar [kernel] Parsing tests/spec/max.c (with preprocessing) [kernel] tests/spec/max.c:16: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [kernel] tests/spec/max.c:46: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. /* Generated by Frama-C */ /*@ axiomatic IsMax { predicate is_max{L}(ℤ max, int t[], ℤ length) ; axiom max_gt{L}: ∀ int t[], ℤ max, ℤ length, ℤ i; is_max(max, t, length) ⇒ 0 ≤ i < length ⇒ t[i] ≤ max; axiom max_eq{L}: ∀ int t[], ℤ max, ℤ length; is_max(max, t, length) ⇒ (∃ ℤ i; t[i] ≡ max); } */ /*@ requires \valid(t + (0 .. n - 1)); behavior nonempty: assumes n > 0; ensures 0 ≤ \result < \old(n) ∧ (∀ int i; 0 ≤ i < \old(n) ⇒ *(\old(t) + \result) ≥ *(\old(t) + i)) ∧ is_max(*(\old(t) + \result), (int [])\old(t), \old(n)); behavior empty: assumes n ≤ 0; ensures \result ≡ -1; */ int max(int *t, int n) { int __retres; int i; /*@ ghost int max_0; */ int imax = 0; if (n <= 0) { __retres = -1; goto return_label; } /*@ ghost max_0 = *(t + 0); */ i = 1; /*@ loop invariant (∀ int j; 0 ≤ j < i ⇒ *(t + imax) ≥ *(t + j)) ∧ is_max(max_0, (int [])t, i - 1); */ while (i < n) { if (*(t + i) > *(t + imax)) { imax = i; /*@ ghost max_0 = *(t + i); */ } i ++; } __retres = imax; return_label: return __retres; } int main(void) { int __retres; int test[10] = {1, 2, 3, 4, 9, 8, 7, 6, 5, 10}; /*@ assert \valid(&test[0 .. 9]); */ ; int x = max(test,10); /*@ assert test[x] ≥ 10; */ ; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/merge_1.res.oracle0000666000000000000000000000117613571573400020057 0ustar [kernel] Parsing tests/spec/merge_1.i (no preprocessing) [kernel] Parsing tests/spec/merge_2.i (no preprocessing) [kernel] tests/spec/merge_2.i:10: Warning: found two contracts (old location: tests/spec/merge_2.i:4). Merging them /* Generated by Frama-C */ int slen(char const *str); int f(int z); /*@ requires \valid(str); ensures \result ≡ 0 ∧ \valid(\old(str)); assigns \nothing; */ int slen(char const *str) { int __retres; char const *s; s = str; while (*s) s ++; __retres = s - str; return __retres; } /*@ requires z ≥ 0; */ int f(int z) { int __retres; __retres = z - 1; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/merge_assigns_bts1253.res.oracle0000666000000000000000000000037113571573400022545 0ustar [kernel] Parsing tests/spec/merge_assigns_bts1253.i (no preprocessing) /* Generated by Frama-C */ /*@ assigns \result; assigns \result \from *(nptr + (..)); */ double atof(char const *nptr); /*@ assigns *(nptr + (..)); */ void f(char *nptr); frama-c-20.0-Calcium/tests/spec/oracle/merge_bts938.res.oracle0000666000000000000000000000150313571573400020745 0ustar [kernel] Parsing tests/spec/merge_bts938.c (with preprocessing) [kernel] tests/spec/merge_bts938.c:7: Warning: found two contracts (old location: tests/spec/merge_bts938.h:2). Merging them [kernel] Parsing tests/spec/merge_bts938_1.c (with preprocessing) [kernel] tests/spec/merge_bts938_1.c:7: Warning: found two contracts (old location: tests/spec/merge_bts938.h:2). Merging them [kernel] tests/spec/merge_bts938.c:8: Warning: found two contracts. Merging them [kernel] tests/spec/merge_bts938.c:8: Warning: found two contracts (old location: tests/spec/merge_bts938.h:2). Merging them /* Generated by Frama-C */ extern int tab[10]; int main(void); /*@ ensures test: \true; ensures tab ≡ {tab \with [0] = (int)0}; ensures test1: \true; */ int main(void) { int __retres; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/merge_different_assigns.res.oracle0000666000000000000000000000173313571573400023413 0ustar [kernel] Parsing tests/spec/merge_different_assigns.i (no preprocessing) [kernel] Parsing tests/spec/merge_different_assigns_bis.i (no preprocessing) [kernel] tests/spec/merge_different_assigns.i:7: Warning: found two contracts. Merging them [kernel] tests/spec/merge_different_assigns.i:8: Warning: location z is not present in all assigns clauses [kernel] tests/spec/merge_different_assigns.i:10: Warning: incompatible from clauses (tests/spec/merge_different_assigns.i:10:'assigns t \from \nothing;' and tests/spec/merge_different_assigns_bis.i:8:'assigns t \from t;'). Keeping only the first one. [kernel] tests/spec/merge_different_assigns_bis.i:10: Warning: location v is not present in all assigns clauses /* Generated by Frama-C */ int x; int z; int t; int u; int v; int w; /*@ assigns x, z, u, t, w, v, \result; assigns x \from x; assigns z \from x; assigns t \from \nothing; assigns w \from w; assigns \result \from y; */ int f(int y); frama-c-20.0-Calcium/tests/spec/oracle/merge_logic_globals_1.res.oracle0000666000000000000000000000202613571573400022732 0ustar [kernel] Parsing tests/spec/merge_logic_globals_1.c (with preprocessing) [kernel] Parsing tests/spec/merge_logic_globals_2.c (with preprocessing) [kernel] tests/spec/merge_logic_globals.h:14: Warning: dropping duplicate def'n of func test at tests/spec/merge_logic_globals.h:14 in favor of that at tests/spec/merge_logic_globals.h:14 /* Generated by Frama-C */ struct s_t { int n ; }; typedef struct s_t t; /*@ type invariant inv_t(t x) = x.n > 0; */ int i = 42; /*@ predicate p{Here}(int x) = x ≥ i; */ /*@ axiomatic Bar { logic ℤ li; } */ /*@ ensures i ≡ li; */ void test(void) { return; } /*@ axiomatic Foo { type foo; logic foo ff(foo x, char *y) ; predicate fp(foo x, foo y) ; axiom fffp{L}: ∀ foo x, char *y; fp(x, ff(x, y)) ∧ *y ≡ 0; } */ int main(void) { int __retres; test(); /*@ assert p((int)li); */ ; __retres = 0; return __retres; } int f(void) { int __retres; t x; x.n = i; i --; /*@ assert p(x.n); */ ; __retres = x.n; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/model.res.oracle0000666000000000000000000000316313571573400017636 0ustar [kernel] Parsing tests/spec/model.i (no preprocessing) [kernel:annot-error] tests/spec/model.i:9: Warning: Cannot add model field x for type struct S: it already exists. Ignoring global annotation [kernel:annot-error] tests/spec/model.i:13: Warning: Cannot add model field z for type T: it already exists. Ignoring global annotation [kernel:annot-error] tests/spec/model.i:14: Warning: Cannot add model field x for type T: it already exists. Ignoring global annotation Model fields for type T: z, t, After adding field Model fields for type T: z, test_field, t, After removing field Model fields for type T: z, t, /* Generated by Frama-C */ struct S { int x ; int y ; }; typedef struct S T; /*@ model struct S { ℤ z }; */ /*@ model T { ℤ t }; */ /*@ type invariant t_invariant(T t) = t.t ≡ t.z * 2; */ /*@ ensures \old(s)->z ≡ \result; assigns *s; */ int f(struct S *s); /*@ type invariant sum(struct S s) = s.z ≡ s.x + s.y; */ void main(void) { struct S s = {.x = 0, .y = 0}; T t = {.x = 1, .y = 2}; /*@ assert t.t ≡ 6 ∧ t.z ≡ 3; */ ; int a = f(& s); if (a) { if (! s.x) /*@ assert s.y ≢ 0; */ ; else goto _LAND; } else { _LAND: { int tmp_2 = s.x == 1; } } /*@ assert s.z ≢ 0; */ ; return; } /*@ model double { ℝ exact }; */ /*@ model double { ℝ round }; */ /*@ ensures \result ≡ (double)(\old(x) + \old(y)); ensures \result.exact ≡ \old(x.exact) + \old(y.exact); ensures \result ≡ \result.exact + \result.round; */ double add(double x, double y); double foo(double x) { double tmp; tmp = add(x,x); return tmp; } frama-c-20.0-Calcium/tests/spec/oracle/model1.res.oracle0000666000000000000000000000250213571573400017713 0ustar [kernel] Parsing tests/spec/model1.c (with preprocessing) [kernel] Parsing tests/spec/model2.c (with preprocessing) /* Generated by Frama-C */ struct S { int bar ; }; /*@ model struct S { ℤ foo }; */ void reset(struct S *s); void inc(struct S *s); void dec(struct S *s); int is_pos(struct S *s); void main(void) { struct S s; reset(& s); inc(& s); /*@ assert s.foo > 0; */ ; /*@ loop variant s.foo; */ while (1) { int tmp; tmp = is_pos(& s); if (! tmp) break; dec(& s); } /*@ assert s.foo ≤ 0; */ ; return; } /*@ type invariant foobar(struct S s) = s.bar ≡ s.foo; */ /*@ requires \valid(s); ensures \old(s)->foo ≡ 0; assigns *s; */ void reset(struct S *s) { int tmp = s->bar == 0; return; } /*@ requires \valid(s); ensures \old(s)->foo > \at(s->foo,Pre); assigns *s; */ void inc(struct S *s) { s->bar += 5; return; } /*@ requires \valid(s); ensures \old(s)->foo < \at(s->foo,Pre); assigns *s; */ void dec(struct S *s) { (s->bar) --; return; } /*@ requires \valid(s); assigns \nothing; behavior is_true: assumes s->foo > 0; ensures \result ≡ 1; behavior is_false: assumes s->foo ≤ 0; ensures \result ≡ 0; */ int is_pos(struct S *s) { int tmp; if (s->bar > 0) tmp = 1; else tmp = 0; return tmp; } frama-c-20.0-Calcium/tests/spec/oracle/multi_axiomatic_1.res.oracle0000666000000000000000000000062113571573400022142 0ustar [kernel] Parsing tests/spec/multi_axiomatic_1.i (no preprocessing) [kernel] Parsing tests/spec/multi_axiomatic_2.i (no preprocessing) /* Generated by Frama-C */ /*@ axiomatic ax { logic int Acc(int m) ; } */ /*@ predicate Bnd(ℤ n, int m) = Acc(m) ≤ 9; */ /*@ predicate Bnd(ℤ n) = Bnd(n, (int)0); */ /*@ requires Bnd(1); ensures \true; */ void foo(void) { return; } frama-c-20.0-Calcium/tests/spec/oracle/multi_behavior.res.oracle0000666000000000000000000000054413571573400021547 0ustar [kernel] Parsing tests/spec/multi_behavior.c (with preprocessing) /* Generated by Frama-C */ int a; int b; /*@ behavior b: ensures a ≢ 0; ensures a ≡ 0; assigns a; behavior c: ensures a ≡ 0; ensures a ≡ 0; assigns a; behavior d: assumes a ≡ 0; */ void f(void) { a = 0; return; } frama-c-20.0-Calcium/tests/spec/oracle/multi_labels.res.oracle0000666000000000000000000000027013571573400021206 0ustar [kernel] Parsing tests/spec/multi_labels.i (no preprocessing) /* Generated by Frama-C */ int labels(void) { int x = 0; L1: /*@ assert \at(x,L1) ≡ \at(x,L1); */ ; return x; } frama-c-20.0-Calcium/tests/spec/oracle/multidecl.res.oracle0000666000000000000000000000065213571573400020520 0ustar [kernel] Parsing tests/spec/multidecl.c (with preprocessing) [kernel:annot-error] tests/spec/multidecl.c:9: Warning: term x has type ℤ, but int is expected.. Ignoring global annotation /* Generated by Frama-C */ /*@ predicate p0(ℤ x) = x ≡ 0; */ /*@ predicate p1(ℤ x) = x ≡ 1; */ /*@ lemma excl: ∀ ℤ x; ¬(p0(x) ∧ p1(x)); */ /*@ predicate p2(int x) = x ≡ 0; */ /*@ predicate p3(int x) = x ≡ 1; */ frama-c-20.0-Calcium/tests/spec/oracle/multidim.res.oracle0000666000000000000000000000106413571573400020360 0ustar [kernel] Parsing tests/spec/multidim.c (with preprocessing) [kernel:annot-error] tests/spec/multidim.c:14: Warning: In ACSL, there is no implicit conversion between a C array and a pointer. Either introduce an explicit cast or take the address of the first element of ttt. Ignoring specification of function g /* Generated by Frama-C */ typedef int TT[3][4]; TT ttt[5]; int (*pt)[3][4] = ttt; /*@ axiomatic A { predicate P(TT *pt) ; predicate Q(int (*pt)[3][4]) ; } */ /*@ requires Q((TT *)ttt); */ void f(void) { return; } frama-c-20.0-Calcium/tests/spec/oracle/multiple_decl_def_1.res.oracle0000666000000000000000000000100613571573400022410 0ustar [kernel] Parsing tests/spec/multiple_decl_def_1.c (with preprocessing) [kernel] Parsing tests/spec/multiple_decl_def_2.c (with preprocessing) [kernel] tests/spec/multiple_decl_def_2.c:5: Warning: found two contracts (old location: tests/spec/multiple_decl_def_1.c:7). Merging them /* Generated by Frama-C */ int f(int y); /*@ requires x ≥ 0; */ extern int g(int x); int main(void) { int tmp; g(0); tmp = f(0); return tmp; } /*@ requires y ≥ 0; requires y ≤ 0; */ int f(int y) { return y; } frama-c-20.0-Calcium/tests/spec/oracle/multiple_file_1.res.oracle0000666000000000000000000000066113571573400021610 0ustar [kernel] Parsing tests/spec/multiple_file_1.c (with preprocessing) [kernel] Parsing tests/spec/multiple_file_2.c (with preprocessing) [kernel] tests/spec/multiple_file_1.c:10: Warning: found two contracts. Merging them /* Generated by Frama-C */ /*@ requires x ≥ 0; */ extern int f(int x); /*@ requires x ≥ 0; requires x ≤ 0; */ extern int g(int x); int main(void) { int tmp; g(0); tmp = f(0); return tmp; } frama-c-20.0-Calcium/tests/spec/oracle/multiple_include_2.res.oracle0000666000000000000000000000042513571573400022313 0ustar [kernel] Parsing tests/spec/multiple_include_2.c (with preprocessing) [kernel] Parsing tests/spec/multiple_include_1.c (with preprocessing) [kernel] User Error: multiple inclusion of logic function p referring to a static variable [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/spec/oracle/multiple_spec.res.oracle0000666000000000000000000000055413571573400021404 0ustar [kernel] Parsing tests/spec/multiple_spec.c (with preprocessing) [kernel] tests/spec/multiple_spec.c:6: Warning: found two contracts (old location: tests/spec/multiple_spec.c:3). Merging them /* Generated by Frama-C */ /*@ requires y ≥ 0; requires y ≤ 0; */ int f(int y); int main(void) { int __retres; f(0); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/nested.res.oracle0000666000000000000000000000016213571573400020014 0ustar [kernel] Parsing tests/spec/nested.c (with preprocessing) /* Generated by Frama-C */ void g(void) { return; } frama-c-20.0-Calcium/tests/spec/oracle/null_ptr.res.oracle0000666000000000000000000000207613571573400020377 0ustar [kernel] Parsing tests/spec/null_ptr.c (with preprocessing) [kernel:annot-error] tests/spec/null_ptr.c:21: Warning: invalid implicit conversion from 𝔹 to ℤ. Ignoring global annotation [kernel:annot-error] tests/spec/null_ptr.c:22: Warning: Cannot use a pointer to void here. Ignoring global annotation [kernel:annot-error] tests/spec/null_ptr.c:23: Warning: Cannot use a pointer to void here. Ignoring global annotation /* Generated by Frama-C */ /*@ predicate null(char *x) = x ≡ (char *)0; */ /*@ predicate eq(char *x, char *y) = x ≡ y; */ /*@ predicate my_null(char *x) = x ≡ (char *)((void *)0); */ void f(char *x) { x = (char *)0; /*@ assert x ≡ (char *)((void *)0); */ ; /*@ assert my_null(x); */ ; /*@ assert null(x); */ ; /*@ assert eq(x, (char *)0); */ ; return; } /*@ ensures (\result ≢ 0) ≡ \true; */ int g(void) { int __retres; __retres = 1; return __retres; } /*@ predicate foo(ℤ x) = x ≢ 0; */ /*@ predicate totology_1{L}= ¬\valid((char *)\null); */ /*@ predicate totology_2{L1, L2}= ¬\fresh{L1, L2}(\null,1); */ frama-c-20.0-Calcium/tests/spec/oracle/old_prm.res.oracle0000666000000000000000000000046313571573400020172 0ustar [kernel] Parsing tests/spec/old_prm.i (no preprocessing) /* Generated by Frama-C */ struct st { int t[10] ; }; struct st S; int i; int j; /*@ ensures S.t[i] ≡ (\let tmp = \old(s.t); tmp[j]) + *(\old(y) + \old(x)); */ void main(struct st s, int x, int *y) { S.t[i] = s.t[j] + *(y + x); return; } frama-c-20.0-Calcium/tests/spec/oracle/onelineghost.res.oracle0000666000000000000000000000034613571573400021234 0ustar [kernel] Parsing tests/spec/onelineghost.c (with preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; /*@ ghost int x = 0; */ /*@ ghost x ++; */ __retres = 0; return __retres; } /*@ ghost int G; */ frama-c-20.0-Calcium/tests/spec/oracle/overload_resolution.res.oracle0000666000000000000000000000060313571573400022630 0ustar [kernel] Parsing tests/spec/overload_resolution.i (no preprocessing) /* Generated by Frama-C */ /*@ predicate rel(unsigned long long x, unsigned long long y) = x ≡ y; */ /*@ predicate rel(char x, char y, ℤ foo) = x ≡ y; */ /*@ ensures rel((unsigned long long)\result, (unsigned long long)\old(x)); */ char f(int x) { char __retres; __retres = (char)x; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/parsing.res.oracle0000666000000000000000000000135613571573400020203 0ustar [kernel] Parsing tests/spec/parsing.c (with preprocessing) [kernel:annot-error] tests/spec/parsing.c:27: Warning: unexpected token 'bla' [kernel:annot-error] tests/spec/parsing.c:15: Warning: comparison of incompatible types: 𝔹 and ℤ. Ignoring global annotation [kernel:annot-error] tests/spec/parsing.c:19: Warning: comparison of incompatible types: 𝔹 and ℤ. Ignoring global annotation /* Generated by Frama-C */ /*@ lemma bidon{Here}: ∀ int *t; ¬(*(t + 0) > 0); */ /*@ lemma bidon1{Here}: ∀ int *t; !(*(t + 0) ≢ 0) ≡ (0 ≢ 0); */ /*@ lemma bidon2{Here}: ∀ int *t; !(*(t + 0) ≢ 0) ≡ (0 ≢ 0); */ /*@ predicate foo{L}(int *a, int *b, int length) = ¬(∀ ℤ k; 0 ≤ k < length ⇒ *(a + k) ≡ *(b + k)); */ frama-c-20.0-Calcium/tests/spec/oracle/permut.res.oracle0000666000000000000000000000157713571573400020061 0ustar [kernel] Parsing tests/spec/permut.c (with preprocessing) /* Generated by Frama-C */ /*@ axiomatic Permut { predicate permut{L1, L2}(double t1[], double t2[], ℤ n) ; axiom permut_refl{L}: ∀ double t[], ℤ n; permut{L, L}(t, t, n); axiom permut_sym{L1, L2}: ∀ double t1[], double t2[], ℤ n; permut{L1, L2}(t1, t2, n) ⇒ permut{L2, L1}(t2, t1, n); axiom permut_trans{L1, L2, L3}: ∀ double t1[], double t2[], double t3[], ℤ n; permut{L1, L2}(t1, t2, n) ∧ permut{L2, L3}(t2, t3, n) ⇒ permut{L1, L3}(t1, t3, n); axiom permut_exchange{L1, L2}: ∀ double t1[], double t2[], ℤ i, ℤ j, ℤ n; \at(t1[i],L1) ≡ \at(t2[j],L2) ∧ \at(t1[j],L1) ≡ \at(t2[i],L2) ∧ (∀ ℤ k; 0 ≤ k < n ∧ k ≢ i ∧ k ≢ j ⇒ \at(t1[k],L1) ≡ \at(t2[k],L2)) ⇒ permut{L1, L2}(t1, t2, n); } */ frama-c-20.0-Calcium/tests/spec/oracle/pi.res.oracle0000666000000000000000000000220313571573400017140 0ustar [kernel] Parsing tests/spec/pi.c (with preprocessing) /* Generated by Frama-C */ /*@ lemma simplify_dumb_1: 2800 % 14 ≡ 0; */ /*@ lemma simplify_dumb_2: ∀ ℤ c; c * 2 > 0 ⇒ c * 2 > 1; */ /*@ lemma simplify_dumb_3: ∀ ℤ c; c % 14 ≡ 0 ⇒ (c - 14) % 14 ≡ 0; */ /*@ lemma simplify_dumb_4: ∀ ℤ c; c % 14 ≡ 0 ⇒ c > 0 ⇒ c ≥ 14; */ void print4(int); int a = 10000; int b; int c = 2800; int d; int e; int f[2801]; int g; /*@ requires b ≡ 0 ∧ c ≡ 2800 ∧ a ≡ 10000; */ void main(void) { /*@ loop invariant 0 ≤ b ≤ 2800; loop variant c - b; */ while (b - c) { f[b] = a / 5; b ++; } /*@ loop invariant 0 ≤ c ≤ 2800 ∧ c % 14 ≡ 0; loop variant c; */ while (1) { d = 0; g = c * 2; if (! g) break; b = c; /*@ loop invariant 1 ≤ b ≤ c ∧ g ≡ b * 2; loop variant b; */ while (1) { { int tmp; d += f[b] * a; g --; f[b] = d % g; tmp = g; g --; d /= tmp; b --; if (! b) break; d *= b; } } c -= 14; print4(e + d / a); e = d % a; } return; } frama-c-20.0-Calcium/tests/spec/oracle/pointer_cast.res.oracle0000666000000000000000000000051113571573400021222 0ustar [kernel] Parsing tests/spec/pointer_cast.c (with preprocessing) [kernel:annot-error] tests/spec/pointer_cast.c:3: Warning: incompatible types int * and int ** . Ignoring code annotation /* Generated by Frama-C */ void f(int **a) { int *b; /*@ assert (int *)a ≡ b; */ ; /*@ assert a ≡ (int **)b; */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/pointer_comparable.res.oracle0000666000000000000000000000033713571573400022403 0ustar [kernel] Parsing tests/spec/pointer_comparable.c (with preprocessing) /* Generated by Frama-C */ /*@ requires \pointer_comparable((void *)p, (void *)q) ∧ \is_finite(*p); */ void f(float *p, char const *q) { return; } frama-c-20.0-Calcium/tests/spec/oracle/polymorph.res.oracle0000666000000000000000000000355613571573400020575 0ustar [kernel] Parsing tests/spec/polymorph.c (with preprocessing) [kernel] tests/spec/polymorph.c:1: Warning: parsing obsolete ACSL construct 'logic type declaration'. 'an axiomatic block' should be used instead. [kernel:annot-error] tests/spec/polymorph.c:4: Warning: unexpected token 'a' [kernel] tests/spec/polymorph.c:6: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel] tests/spec/polymorph.c:8: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel] tests/spec/polymorph.c:10: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel] tests/spec/polymorph.c:13: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel:annot-error] tests/spec/polymorph.c:13: Warning: some type variable appears only in the return type. All type variables need to occur also in the parameters types.. Ignoring global annotation [kernel:annot-error] tests/spec/polymorph.c:22: Warning: implicit unification of type variables b and a. Ignoring global annotation [kernel:annot-error] tests/spec/polymorph.c:29: Warning: implicit unification of type variables b and a. Ignoring global annotation [kernel:annot-error] tests/spec/polymorph.c:32: Warning: implicit unification of type variables b and a. Ignoring global annotation /* Generated by Frama-C */ /*@ type foo; */ /*@ logic ℤ f(foo x) ; */ /*@ logic ℤ g(foo x, foo y) ; */ /*@ logic foo h(foo x) ; */ /*@ predicate bla(foo x) = f(x) ≡ 0; */ /*@ predicate bli(foo<ℝ> x) = g(x, x) ≡ 42; */ /*@ predicate blu2(foo x, foo y) = g(x, x) ≡ 36 ∧ g(y, y) ≡ 72; */ /*@ predicate bar(foo<ℝ> x) = bli(x) ∧ blu2(x, x); */ frama-c-20.0-Calcium/tests/spec/oracle/pp_empty_spec.res.oracle0000666000000000000000000000367413571573400021414 0ustar [kernel] Parsing tests/spec/pp_empty_spec.i (no preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; /*@ loop invariant invmerger: chekofv_invariant_1_1: x ≡ y; */ while (y < 10) { x ++; if (x != 9) y ++; } __retres = 0; return __retres; } [kernel] Warning: Trying to add an assumes clause to default behavior /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; /*@ loop invariant invmerger: chekofv_invariant_1_1: x ≡ y; */ while (y < 10) { x ++; if (x != 9) y ++; } __retres = 0; return __retres; } /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; /*@ loop invariant invmerger: chekofv_invariant_1_1: x ≡ y; */ while (y < 10) { x ++; if (x != 9) y ++; } __retres = 0; return __retres; } /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; /*@ loop invariant invmerger: chekofv_invariant_1_1: x ≡ y; */ while (y < 10) { x ++; if (x != 9) y ++; } __retres = 0; return __retres; } [kernel] Failure: Trying to add a non-existing behavior foo in a complete or disjoint clause [kernel] Warning: Caught fatal error: kernel [kernel] Failure: Trying to add a non-existing behavior foo in a complete or disjoint clause [kernel] Warning: Caught fatal error: kernel /* Generated by Frama-C */ int main(void) { int __retres; int x = 0; int y = 0; /*@ loop invariant invmerger: chekofv_invariant_1_1: x ≡ y; */ while (y < 10) { x ++; if (x != 9) y ++; } __retres = 0; return __retres; } /* Generated by Frama-C */ /*@ behavior foo: complete behaviors foo; disjoint behaviors foo; */ int main(void) { int __retres; int x = 0; int y = 0; /*@ loop invariant invmerger: chekofv_invariant_1_1: x ≡ y; */ while (y < 10) { x ++; if (x != 9) y ++; } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/pragma.res.oracle0000666000000000000000000000104513571573400020002 0ustar [kernel] Parsing tests/spec/pragma.i (no preprocessing) [kernel] tests/spec/pragma.i:12: Warning: Unexpected attribute in #pragma [kernel] tests/spec/pragma.i:14: Warning: Unexpected attribute in #pragma [kernel] tests/spec/pragma.i:15: Warning: Unexpected attribute in #pragma /* Generated by Frama-C */ #pragma #pragma A #pragma A() #pragma A("AA",A,B,2:4) #pragma B #pragma B() #pragma B("AA",A,B,2:4) #pragma 1:3 #pragma default:1 #pragma 1 ? A : B #pragma "A" #pragma 1 #pragma A 0 #pragma A B "C" #pragma B A "C" 4 "E" #pragma 0 A B "C" D 5 frama-c-20.0-Calcium/tests/spec/oracle/precedence.res.oracle0000666000000000000000000000076713571573400020642 0ustar [kernel] Parsing tests/spec/precedence.i (no preprocessing) /* Generated by Frama-C */ int x[10]; /*@ lemma prio_unary_plus: (3 - 2) + 2 ≡ 3; */ /*@ lemma prio_unary_minus: (3 - -2) - 2 ≡ 3; */ /*@ lemma prio_unary_amp{L}: ((&x[1] - (int *)x) & (&x[2] - &x[2])) ≡ 0; */ /*@ lemma prio_unary_star{L}: (0 * x[2]) * x[2] ≡ 0; */ /*@ lemma prio_ternary_let: \let i = 0; i ≡ 0? i ≢ 0: i - 1 ≢ 0; */ /*@ lemma prio_ternary_let_2: \let i = 0; (\let i = 0; i ≡ 3)? i ≢ 0: i ≡ 0; */ frama-c-20.0-Calcium/tests/spec/oracle/pred_def.res.oracle0000666000000000000000000000020013571573400020273 0ustar [kernel] Parsing tests/spec/pred_def.i (no preprocessing) /* Generated by Frama-C */ /*@ predicate f(ℤ x) = x + 1 ≢ 0; */ frama-c-20.0-Calcium/tests/spec/oracle/predicates.res.oracle0000666000000000000000000000134613571573400020662 0ustar [kernel] Parsing tests/spec/predicates.c (with preprocessing) [kernel] tests/spec/predicates.c:3: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. /* Generated by Frama-C */ /*@ predicate is_valid_int_range{L}(int *p, int n) = \at((pred1: 0 ≤ n) ∧ (pred2: \valid(p + (0 .. n - 1))),L); */ /*@ predicate P{L}(int *p) = \at(*p ≡ 0,L); */ /*@ predicate R{L}(int *p) = \at(\valid(p),L); */ /*@ predicate S{L}(int *p) = \at(\let z = 0; *p ≡ (\let x = 0; ((\let y = z; x < y)? 1 + 2: (\let y = x; y)) + 2), L); */ /*@ axiomatic a { predicate P(ℤ v) ; } */ /*@ lemma l: (P(1) ⇒ P(2)) ∧ (¬P(1) ⇒ P(3)); */ frama-c-20.0-Calcium/tests/spec/oracle/preprocess.res.oracle0000666000000000000000000000300013571573400020711 0ustar [kernel] Parsing tests/spec/preprocess.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {1} y ∈ {1} [eva] computing for function f <- main. Called from tests/spec/preprocess.c:24. [eva] tests/spec/preprocess.c:24: function f: precondition got status valid. [eva] tests/spec/preprocess.c:18: function f, behavior default: postcondition got status valid. [eva] Recording results for f [eva] Done for function f [eva] tests/spec/preprocess.c:25: assertion got status valid. [eva] tests/spec/preprocess.c:28: cannot evaluate ACSL term, unsupported ACSL construct: constant strings [eva:alarm] tests/spec/preprocess.c:28: Warning: assertion 'backslash_string' got status unknown. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {84} [eva:final-states] Values at end of function main: y_0 ∈ {84} __retres ∈ {0} /* Generated by Frama-C */ int x = 1; /*@ predicate test(int x) = x ≥ 42; */ int y = 1; /*@ requires x_0 ≥ 42; behavior default: ensures test(\result) ∧ 2 ≡ 2; */ int f(int x_0) { int __retres; __retres = x_0 + 42; return __retres; } int main(void) { int __retres; int y_0 = f(42); /*@ assert x ≡ 1; */ ; /*@ assert backslash_string: *("\\" + 0) ≡ '\\'; */ ; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/preprocess_string.res.oracle0000666000000000000000000000075613571573400022316 0ustar [kernel] Warning: your preprocessor is not known to handle option `-nostdinc'. If pre-processing fails because of it, please add -no-cpp-frama-c-compliant option to Frama-C's command-line. If you do not want to see this warning again, explicitly use option -cpp-frama-c-compliant. [kernel] Parsing tests/spec/preprocess_string.c (with preprocessing) /* Generated by Frama-C */ /*@ ensures *("/*" + 0) ≡ '/'; */ char f(void) { char __retres; __retres = *("/*" + 1); return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/property_test.res.oracle0000666000000000000000000000153013571573400021455 0ustar [kernel] Parsing tests/spec/property_test.i (no preprocessing) In project project "default": Status of assert X ≥ \at(X,Pre);: no verification attempted Status of default behavior for statement 7: no verification attempted Status of default behavior: no verification attempted Status of ensures X ≥ 0: no verification attempted Status of ensures \false: no verification attempted Status of requires X ≥ 0: no verification attempted Status of requires \true: no verification attempted In project project "property_test": Status of assert X ≥ \at(X,Pre);: no verification attempted Status of assigns X \from X, c;: no verification attempted Status of assigns X;: no verification attempted Status of default behavior: no verification attempted Status of ensures X ≥ 0: no verification attempted Status of requires X ≥ 0: no verification attempted frama-c-20.0-Calcium/tests/spec/oracle/prototype_assigns.res.oracle0000666000000000000000000000031213571573400022323 0ustar [kernel] Parsing tests/spec/prototype_assigns.c (with preprocessing) /* Generated by Frama-C */ /*@ assigns *p; */ extern int f(char *p); int main(char *x) { int tmp; tmp = f(x); return tmp; } frama-c-20.0-Calcium/tests/spec/oracle/ptr_cast.res.oracle0000666000000000000000000000034413571573400020353 0ustar [kernel] Parsing tests/spec/ptr_cast.c (with preprocessing) /* Generated by Frama-C */ int f(void) { int __retres; __retres = 0; return __retres; } /*@ predicate is_f{L}(void (*g)()) = \at(g ≡ (void (*)())(&f),L); */ frama-c-20.0-Calcium/tests/spec/oracle/purse.res.oracle0000666000000000000000000000321213571573400017667 0ustar [kernel] Parsing tests/spec/purse.c (with preprocessing) /* Generated by Frama-C */ #include "stdlib.h" struct purse { int balance ; }; typedef struct purse purse; /*@ predicate purse_inv{L}(purse *p) = \valid(p) ∧ p->balance ≥ 0; */ /*@ requires purse_inv(p) ∧ s ≥ 0; ensures purse_inv(\old(p)) ∧ \old(p)->balance ≡ \old(p->balance) + \old(s); assigns p->balance; */ void credit(purse *p, int s) { p->balance += s; return; } /*@ requires purse_inv(p) ∧ s ≥ 0; ensures purse_inv(\old(p)) ∧ \old(p)->balance ≡ \old(p->balance) + \old(s); assigns p->balance; */ void f(purse *p, int s) { p->balance += s; return; } /*@ requires purse_inv(p) ∧ 0 ≤ s ≤ p->balance; ensures purse_inv(\old(p)) ∧ \old(p)->balance ≡ \old(p->balance) - \old(s); assigns p->balance; */ void withdraw(purse *p, int s) { p->balance -= s; return; } /*@ requires purse_inv(p1) ∧ purse_inv(p2); ensures \result ≡ 0; assigns p1->balance, p2->balance; */ int test1(purse *p1, purse *p2) { int __retres; p1->balance = 0; credit(p2,100); __retres = p1->balance; return __retres; } /*@ ensures \fresh{Old, Here}(\result,sizeof(purse)) ∧ purse_inv(\result) ∧ \result->balance ≡ 0; assigns \empty; */ purse *new_purse(void) { purse *p = malloc((unsigned int)1 * sizeof(purse)); p->balance = 0; return p; } /*@ ensures \result ≡ 150; */ int test2(void) { int __retres; purse *p1 = new_purse(); purse *p2 = new_purse(); credit(p1,100); credit(p2,200); withdraw(p1,50); withdraw(p2,100); __retres = p1->balance + p2->balance; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/range.res.oracle0000666000000000000000000000061213571573400017626 0ustar [kernel] Parsing tests/spec/range.c (with preprocessing) /* Generated by Frama-C */ struct foo { char bar[4] ; }; typedef char baz[4]; struct bli { baz bli ; }; /*@ assigns x->bar[0 .. 3]; assigns x->bar[0 .. 3] \from x->bar[0 .. 3]; */ int f(struct foo *x); /*@ assigns *(x + (0 .. 3)); assigns *(x + (0 .. 3)) \from y->bli[0 .. 3]; */ int g(char * /*[4]*/ x, struct bli *y); frama-c-20.0-Calcium/tests/spec/oracle/real_typing_bts1309.res.oracle0000666000000000000000000000030513571573400022233 0ustar [kernel] Parsing tests/spec/real_typing_bts1309.i (no preprocessing) /* Generated by Frama-C */ void foo(int c) { float f = (float)1.0; /*@ assert 0.0 ≤ (c ≢ 0? f: 2.0); */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/recursive_with_label.res.oracle0000666000000000000000000000153313571573400022736 0ustar [kernel] Parsing tests/spec/recursive_with_label.i (no preprocessing) /* Generated by Frama-C */ /*@ logic ℤ size_rec{L}(int *busybits, ℤ capa) = \at(capa ≤ 0? 0: (*(busybits + (capa - 1)) ≢ 0? 1 + size_rec(busybits, capa - 1): size_rec(busybits, capa - 1)), L); */ /*@ ensures \result ≡ size_rec(\old(busybits), 0); */ int size(int *busybits) { int __retres; __retres = 0; return __retres; } /*@ logic ℤ f{L}(int *p, ℤ l) = \at(l > 0? 1 + f(p + 1, l - 1): *p,L); */ /*@ predicate p{L}(int *p, ℤ l) = \at(l > 0? p(p + 1, l - 1): \valid(p),L); */ /*@ inductive foo{L}(int *p, ℤ l) { case nil{L}: \at(∀ int *p; foo(p, 0),L); case other{L}: \at(∀ int *p, ℤ l; l > 0 ⇒ \valid(p + l) ⇒ foo(p, l - 1) ⇒ foo(p, l), L); } */ frama-c-20.0-Calcium/tests/spec/oracle/regions.res.oracle0000666000000000000000000000130213571573400020175 0ustar [kernel] Parsing tests/spec/regions.c (with preprocessing) /* Generated by Frama-C */ struct S { int t1[2] ; int t2[2] ; }; /*@ requires \valid(p); ensures *\old(p) ≡ \old(n); */ void g(int *p, int n) { *p = n; return; } /*@ requires \valid(x) ∧ \valid(y); ensures *\old(x) ≡ 1 ∧ *\old(y) ≡ 2; */ void f(int *x, int *y) { g(x,1); g(y,2); return; } /*@ ensures (\let tmp = \old(s.t1); tmp[0]) ≡ 1 ∧ (\let tmp = \old(s.t2); tmp[0]) ≡ 2 ∧ (\let tmp = \old(s.t1); tmp[1]) ≡ 2 ∧ (\let tmp = \old(s.t2); tmp[1]) ≡ 1; */ void main(struct S s) { f(& s.t1[0],& s.t2[1]); f(& s.t2[0],& s.t1[1]); f(& s.t1[0],& s.t1[0]); return; } frama-c-20.0-Calcium/tests/spec/oracle/regions2.res.oracle0000666000000000000000000000060313571573400020262 0ustar [kernel] Parsing tests/spec/regions2.c (with preprocessing) /* Generated by Frama-C */ struct S { int t1[2] ; int t2[2] ; }; struct T { struct S *t[2] ; }; /*@ requires \valid(s) ∧ \valid(s->t[0]); */ void f(struct T *s) { (s->t[0])->t1[0] = 1; return; } int main(struct T s, struct S a) { int __retres; s.t[0] = & a; f(& s); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/reset_env.res.oracle0000666000000000000000000000051513571573400020526 0ustar [kernel] Parsing tests/spec/reset_env.i (no preprocessing) [kernel:annot-error] tests/spec/reset_env.i:5: Warning: unbound logic variable INEXISTENT_SYMBOL. Ignoring global annotation [kernel:annot-error] tests/spec/reset_env.i:9: Warning: unbound function bla. Ignoring specification of function f /* Generated by Frama-C */ frama-c-20.0-Calcium/tests/spec/oracle/returns.res.oracle0000666000000000000000000000155613571573400020244 0ustar [kernel] Parsing tests/spec/returns.i (no preprocessing) /* Generated by Frama-C */ /*@ ensures \result ≢ \old(c); */ int f(int c) { int __retres; /*@ returns \result ≡ 0; */ if (c) { __retres = 0; /*@ assert __retres ≡ 0; */ ; goto return_label; } __retres = 42; return_label: return __retres; } /*@ requires \valid(a); ensures *\old(a) > 0; */ int g(int *a) { int __retres; int *tmp; tmp = a; a ++; ; __sid_13_label: /*@ behavior neg: assumes *a < 0; returns \old(*a) ≡ -*a; */ if (*a < 0) { *a = - *a; __retres = -1; /*@ assert \at(*a < 0,__sid_13_label) ⇒ \at(*a,__sid_13_label) ≡ -*a; */ ; goto return_label; } if (*a != 0) { int *tmp_0; tmp_0 = a; a ++; ; __retres = 0; goto return_label; } __retres = 1; return_label: return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/rm_qualifiers.res.oracle0000666000000000000000000000060713571573400021400 0ustar [kernel] Parsing tests/spec/rm_qualifiers.i (no preprocessing) [kernel] Parsing tests/spec/result/rm_qualifiers_res.i (no preprocessing) /* Generated by Frama-C */ extern void G(void const *p); void *ptr; /*@ ensures ptr ≡ (void *)((int const volatile *)*(\old(ftab) + 1)); */ void F(int const volatile (*ftab)[3], unsigned int const id) { G((void const *)(*(ftab + 1))); return; } frama-c-20.0-Calcium/tests/spec/oracle/separated.res.oracle0000666000000000000000000000102013571573400020474 0ustar [kernel] Parsing tests/spec/separated.c (with preprocessing) /* Generated by Frama-C */ /*@ requires \base_addr(q) ≢ p; requires \separated(p, q); requires \valid(p + (0 .. n - 1)); requires \valid(q + (0 .. n - 1)); assigns *(p + (0 .. n - 1)); */ void put(char *p, char *q, int n) { int i = 0; while (i < n) { { char *tmp; char *tmp_0; /*@ assert \separated(p, q); */ ; tmp = p; p ++; tmp_0 = q; q ++; *tmp = *tmp_0; } i ++; } return; } frama-c-20.0-Calcium/tests/spec/oracle/shifts.res.oracle0000666000000000000000000000235613571573400020041 0ustar [kernel] Parsing tests/spec/shifts.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization e ∈ {0} [eva] computing for function f <- main. Called from tests/spec/shifts.c:19. [eva] tests/spec/shifts.c:13: assertion got status valid. [eva] tests/spec/shifts.c:8: function f, behavior a: postcondition got status valid. [eva] tests/spec/shifts.c:9: function f, behavior b: postcondition got status valid. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: e ∈ {168} y ∈ {168} [eva:final-states] Values at end of function main: e ∈ {168} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: e FROM x \result FROM x [from] Function main: e FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== frama-c-20.0-Calcium/tests/spec/oracle/sizeof.res.oracle0000666000000000000000000000027413571573400020035 0ustar [kernel] Parsing tests/spec/sizeof.c (with preprocessing) /* Generated by Frama-C */ /*@ requires i > sizeof(int); ensures \result > sizeof(\old(i)); */ int f(int i) { return i; } frama-c-20.0-Calcium/tests/spec/oracle/sizeof_incomplete_bts1538.res.oracle0000666000000000000000000000076713571573400023454 0ustar [kernel] Parsing tests/spec/sizeof_incomplete_bts1538.i (no preprocessing) /* Generated by Frama-C */ int t[10]; void main(void) { int v = (int)sizeof(t); /*@ assert /*(type:ℤ *//*(type:int */v/*)*//*)*/ ≡ /*(type:ℤ */sizeof(int [10])/*)*/; */ ; /*@ assert /*(type:ℤ */sizeof(/*(type:int [10] */t/*)*/)/*)*/ ≡ /*(type:ℤ */0/*)*/; */ ; /*@ assert /*(type:ℤ */sizeof(/*(type:int [10] */t/*)*/)/*)*/ ≡ /*(type:ℤ */sizeof(int [10])/*)*/; */ ; return; } frama-c-20.0-Calcium/tests/spec/oracle/sizeof_logic.res.oracle0000666000000000000000000000107113571573400021206 0ustar [kernel] Parsing tests/spec/sizeof_logic.i (no preprocessing) [kernel:annot-error] tests/spec/sizeof_logic.i:1: Warning: sizeof can only handle C types. Ignoring global annotation [kernel:annot-error] tests/spec/sizeof_logic.i:3: Warning: sizeof can only handle C types. Ignoring global annotation /* Generated by Frama-C */ struct S { int f ; }; /*@ lemma good: ∀ short x; sizeof(x) ≤ sizeof(int); */ /*@ ensures \result ≡ sizeof(struct S volatile); */ int f(int a) { int __retres; __retres = (int)sizeof(struct S volatile); return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/spec_zero_arg.res.oracle0000666000000000000000000000045613571573400021362 0ustar [kernel] Parsing tests/spec/spec_zero_arg.c (with preprocessing) /* Generated by Frama-C */ int e; /*@ requires e > 0; */ void f(void); /*@ requires e > 0; */ void g(void); int x; void i(int b); /*@ requires b > 0; */ void i(int b) { x = b; return; } void h(void) { f(); g(); return; } frama-c-20.0-Calcium/tests/spec/oracle/statement_behavior.res.oracle0000666000000000000000000000262513571573400022423 0ustar [kernel] Parsing tests/spec/statement_behavior.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function pfsqopfc <- main. Called from tests/spec/statement_behavior.c:23. [eva] tests/spec/statement_behavior.c:10: Warning: no \from part for clause 'assigns five_times;' [eva:alarm] tests/spec/statement_behavior.c:17: Warning: assertion got status unknown. [eva:alarm] tests/spec/statement_behavior.c:4: Warning: function pfsqopfc: postcondition got status unknown. [eva:alarm] tests/spec/statement_behavior.c:18: Warning: accessing uninitialized left-value. assert \initialized(&five_times); [eva] Recording results for pfsqopfc [eva] Done for function pfsqopfc [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function pfsqopfc: [eva:final-states] Values at end of function main: x ∈ {1} y ∈ [--..--] __retres ∈ {0} [inout] InOut (internal) for function pfsqopfc: Operational inputs: five_times Operational inputs on termination: five_times Sure outputs: \nothing [inout] InOut (internal) for function main: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: x; y; __retres frama-c-20.0-Calcium/tests/spec/oracle/stmt_contract.res.oracle0000666000000000000000000000176713571573400021432 0ustar [kernel] Parsing tests/spec/stmt_contract.i (no preprocessing) [kernel:annot-error] tests/spec/stmt_contract.i:18: Warning: \result meaningless. Ignoring loop annotation /* Generated by Frama-C */ int main(int c) { int __retres; int x = 5; int y = 2; /*@ requires x ≡ 5; */ /*@ requires y ≡ 2; */ x += y; /*@ assigns __retres, \result; assigns __retres \from x, y; assigns \result \from x, y; */ if (c) { /*@ assigns __retres, \result; assigns __retres \from x; assigns \result \from x; */ { __retres = x; goto return_label; } } else while (1) { __retres = y; goto return_label; } /*@ assigns __retres, x; */ if (c) { x ++; __retres = x; goto return_label; } /*@ requires before_label: \true; */ label: /*@ requires after_label: \true; */ y = 8; /*@ requires x ≡ 7; */ /*@ ensures x ≡ 7; */ { __retres = 0; goto return_label; } return_label: return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/string.res.oracle0000666000000000000000000000046313571573400020044 0ustar [kernel] Parsing tests/spec/string.c (with preprocessing) /* Generated by Frama-C */ /*@ logic char * foo= "Styfoo"; */ /*@ logic unsigned long * bar= (unsigned long *)L"\xABCD" "t" "5" "a" "b" ; */ /*@ logic char * split= "abcdef"; */ unsigned long *test = (unsigned long *)L"\xABCD" "t" "5" "a" "b" ; frama-c-20.0-Calcium/tests/spec/oracle/struct_invariant.res.oracle0000666000000000000000000000112013571573400022124 0ustar [kernel] Parsing tests/spec/struct_invariant.c (with preprocessing) [kernel:annot-error] tests/spec/struct_invariant.c:18: Warning: predicate u_inv is already declared with the same profile. Ignoring global annotation /* Generated by Frama-C */ struct T { int ok ; int *pt ; int tab[10] ; }; struct T u; /*@ type invariant pt_validity(struct T t) = t.ok ≢ 0 ⇒ \valid(t.pt); */ /*@ type invariant tab_nonnegative(struct T t) = ∀ int i; 0 ≤ i < 10 ⇒ t.tab[i] ≥ 0; */ /*@ type invariant strange(struct T t) = t ≡ u; */ /*@ global invariant u_inv: u.ok ≡ 1; */ frama-c-20.0-Calcium/tests/spec/oracle/tableau_zones.res.oracle0000666000000000000000000000130513571573400021365 0ustar [kernel] Parsing tests/spec/tableau_zones.c (with preprocessing) /* Generated by Frama-C */ /*@ requires \valid(p); ensures *\old(p) ≡ \old(n); assigns *p; */ int f(int *p, int n) { int __retres; *p = n; __retres = 0; return __retres; } int t[10]; /*@ ensures t[0] ≡ 0; */ int main(void) { int __retres; int i; i = 0; /*@ loop invariant 0 ≤ i ≤ 5 ∧ (∀ int j; 0 ≤ j < i ⇒ t[j] ≡ 0); */ while (i < 5) { f(& t[i],0); i ++; } i = 5; /*@ loop invariant 5 ≤ i ≤ 10 ∧ (∀ int j; 5 ≤ j < i ⇒ t[j] ≡ 1); loop assigns t[5 .. 9]; */ while (i < 10) { f(& t[i],1); i ++; } __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/temporal.res.oracle0000666000000000000000000003316513571573400020366 0ustar [kernel] Parsing tests/spec/temporal.i (no preprocessing) /* Generated by Frama-C */ enum aorai_States { S5 = 4, S4 = 6, S3 = 5, S2 = 3, S1 = 0, OK = 2, S0 = 1 }; enum aorai_ListOper { op_g = 2, op_f = 1, op_h = 0 }; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 }; extern int g_calls; int g(int x); void h(void); extern int random(void); extern int NB; extern int G_i; int aorai_CurStates[7] = {1, 0, 0, 0, 0, 0, 0}; int aorai_CurTrans[9] = {1, 0, 0, 0, 0, 0, 0, 0, 0}; int aorai_CurStates_old[7] = {0, 1, 0, 0, 0, 0, 0}; enum aorai_ListOper aorai_CurOperation = op_f; enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; int aorai_Loop_Init_38 = 0; /*@ axiomatic aorai_Trans_Start { logic ℤ aorai_Trans_Start(ℤ tr) ; axiom aorai_Trans_Start0: aorai_Trans_Start(0) ≡ 1; axiom aorai_Trans_Start1: aorai_Trans_Start(1) ≡ 0; axiom aorai_Trans_Start2: aorai_Trans_Start(2) ≡ 0; axiom aorai_Trans_Start3: aorai_Trans_Start(3) ≡ 3; axiom aorai_Trans_Start4: aorai_Trans_Start(4) ≡ 3; axiom aorai_Trans_Start5: aorai_Trans_Start(5) ≡ 3; axiom aorai_Trans_Start6: aorai_Trans_Start(6) ≡ 5; axiom aorai_Trans_Start7: aorai_Trans_Start(7) ≡ 6; axiom aorai_Trans_Start8: aorai_Trans_Start(8) ≡ 4; } */ /*@ axiomatic aorai_Trans_Stop { logic ℤ aorai_Trans_Stop(ℤ tr) ; axiom aorai_Trans_Stop0: aorai_Trans_Stop(0) ≡ 0; axiom aorai_Trans_Stop1: aorai_Trans_Stop(1) ≡ 2; axiom aorai_Trans_Stop2: aorai_Trans_Stop(2) ≡ 3; axiom aorai_Trans_Stop3: aorai_Trans_Stop(3) ≡ 0; axiom aorai_Trans_Stop4: aorai_Trans_Stop(4) ≡ 4; axiom aorai_Trans_Stop5: aorai_Trans_Stop(5) ≡ 5; axiom aorai_Trans_Stop6: aorai_Trans_Stop(6) ≡ 6; axiom aorai_Trans_Stop7: aorai_Trans_Stop(7) ≡ 4; axiom aorai_Trans_Stop8: aorai_Trans_Stop(8) ≡ 2; } */ /*@ predicate aorai_Trans_Cond_param{L} (ℤ _aorai_numTrans, ℤ _aorai_op, ℤ _aorai_status) = (_aorai_numTrans ≡ 0 ⇒ _aorai_op ≡ op_f ∧ _aorai_status ≡ aorai_Called) ∧ (_aorai_numTrans ≡ 1 ⇒ _aorai_op ≡ op_f ∧ _aorai_status ≡ aorai_Terminated ∧ NB ≤ 0) ∧ (_aorai_numTrans ≡ 2 ⇒ _aorai_op ≡ op_g ∧ _aorai_status ≡ aorai_Called ∧ NB > 0 ∧ g_calls < NB ∧ 0 ≤ g_calls) ∧ (_aorai_numTrans ≡ 3 ⇒ G_i ≡ 0 ∧ g_calls < NB ∧ _aorai_op ≡ op_g ∧ _aorai_status ≡ aorai_Terminated) ∧ (_aorai_numTrans ≡ 4 ⇒ G_i ≡ 0 ∧ g_calls ≡ NB ∧ _aorai_op ≡ op_g ∧ _aorai_status ≡ aorai_Terminated) ∧ (_aorai_numTrans ≡ 5 ⇒ G_i ≢ 0 ∧ _aorai_op ≡ op_g ∧ _aorai_status ≡ aorai_Terminated) ∧ (_aorai_numTrans ≡ 6 ⇒ _aorai_op ≡ op_h ∧ _aorai_status ≡ aorai_Called) ∧ (_aorai_numTrans ≡ 7 ⇒ _aorai_op ≡ op_h ∧ _aorai_status ≡ aorai_Terminated) ∧ (_aorai_numTrans ≡ 8 ⇒ _aorai_op ≡ op_f ∧ _aorai_status ≡ aorai_Terminated); */ /*@ predicate aorai_Trans_Cond{L}(ℤ _aorai_numTrans) = aorai_Trans_Cond_param(_aorai_numTrans, aorai_CurOperation, aorai_CurOpStatus); */ /*@ global invariant _Buch_not_crossable_cond: ∀ ℤ _buch_tr; 0 ≤ _buch_tr < 9 ∧ ¬aorai_Trans_Cond(_buch_tr) ⇒ aorai_CurTrans[_buch_tr] ≡ 0; */ /*@ global invariant _Buch_not_crossable_start: ∀ ℤ _buch_tr; 0 ≤ _buch_tr < 9 ∧ aorai_CurStates_old[aorai_Trans_Start(_buch_tr)] ≡ 0 ⇒ aorai_CurTrans[_buch_tr] ≡ 0; */ /*@ global invariant _Buch_not_reachable: ∀ ℤ _buch_st; 0 ≤ _buch_st < 7 ∧ (∀ ℤ _buch_tr; 0 ≤ _buch_tr < 9 ⇒ aorai_CurTrans[_buch_tr] ≡ 0 ∨ aorai_Trans_Stop(_buch_tr) ≢ _buch_st) ⇒ aorai_CurStates[_buch_st] ≡ 0; */ /*@ requires 0 ≡ aorai_CurTrans[0] ∧ 0 ≡ aorai_CurTrans[1] ∧ 0 ≡ aorai_CurTrans[3] ∧ 0 ≡ aorai_CurTrans[4] ∧ 0 ≡ aorai_CurTrans[5] ∧ 0 ≡ aorai_CurTrans[6] ∧ 0 ≡ aorai_CurTrans[7] ∧ 0 ≡ aorai_CurTrans[8]; requires 0 ≢ aorai_CurTrans[2]; requires 0 ≡ aorai_CurStates[S1] ∧ 0 ≡ aorai_CurStates[S0] ∧ 0 ≡ aorai_CurStates[OK] ∧ 0 ≡ aorai_CurStates[S5] ∧ 0 ≡ aorai_CurStates[S3] ∧ 0 ≡ aorai_CurStates[S4]; requires 0 ≢ aorai_CurStates[S2]; requires aorai_CurTrans[2] ≢ 0 ⇒ NB > 0 ∧ g_calls < NB ∧ 0 ≤ g_calls; behavior Buchi_property_behavior_3: ensures (aorai_CurTrans[5] ≢ 0 ⇒ G_i ≢ 0) ∧ (aorai_CurTrans[4] ≢ 0 ⇒ G_i ≡ 0 ∧ g_calls ≡ NB) ∧ (aorai_CurTrans[3] ≢ 0 ⇒ G_i ≡ 0 ∧ g_calls < NB); ensures 0 ≡ aorai_CurTrans[0] ∧ 0 ≡ aorai_CurTrans[1] ∧ 0 ≡ aorai_CurTrans[2] ∧ 0 ≡ aorai_CurTrans[6] ∧ 0 ≡ aorai_CurTrans[7] ∧ 0 ≡ aorai_CurTrans[8]; ensures 0 ≢ aorai_CurTrans[3] ∨ 0 ≢ aorai_CurTrans[4] ∨ 0 ≢ aorai_CurTrans[5]; ensures 0 ≡ aorai_CurStates[S0] ∧ 0 ≡ aorai_CurStates[OK] ∧ 0 ≡ aorai_CurStates[S2] ∧ 0 ≡ aorai_CurStates[S4]; ensures 0 ≢ aorai_CurStates[S1] ∨ 0 ≢ aorai_CurStates[S5] ∨ 0 ≢ aorai_CurStates[S3]; behavior default: ensures g_calls ≡ \old(g_calls) + 1; assigns g_calls; */ int g(int x) { int tmp; int tmp_0; int tmp_1; int tmp_2; g_calls ++; tmp = random(); aorai_CurOperation = op_g; aorai_CurOpStatus = aorai_Terminated; aorai_CurStates_old[S5] = 0; aorai_CurStates_old[S4] = 0; aorai_CurStates_old[S3] = 0; aorai_CurStates_old[S2] = aorai_CurStates[3]; aorai_CurStates_old[S1] = 0; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; aorai_CurTrans[1] = 0; aorai_CurTrans[2] = 0; if (G_i == 0) if (g_calls < NB) if (aorai_CurStates_old[3]) tmp_0 = 1; else tmp_0 = 0; else tmp_0 = 0; else tmp_0 = 0; aorai_CurTrans[3] = tmp_0; if (G_i == 0) if (g_calls == NB) if (aorai_CurStates_old[3]) tmp_1 = 1; else tmp_1 = 0; else tmp_1 = 0; else tmp_1 = 0; aorai_CurTrans[4] = tmp_1; if (G_i != 0) if (aorai_CurStates_old[3]) tmp_2 = 1; else tmp_2 = 0; else tmp_2 = 0; aorai_CurTrans[5] = tmp_2; aorai_CurTrans[6] = 0; aorai_CurTrans[7] = 0; aorai_CurTrans[8] = 0; aorai_CurStates[S5] = aorai_CurTrans[4]; aorai_CurStates[S4] = 0; aorai_CurStates[S3] = aorai_CurTrans[5]; aorai_CurStates[S2] = 0; aorai_CurStates[S1] = aorai_CurTrans[3]; aorai_CurStates[OK] = 0; aorai_CurStates[S0] = 0; return tmp; } /*@ requires 0 ≡ aorai_CurTrans[0] ∧ 0 ≡ aorai_CurTrans[1] ∧ 0 ≡ aorai_CurTrans[2] ∧ 0 ≡ aorai_CurTrans[3] ∧ 0 ≡ aorai_CurTrans[4] ∧ 0 ≡ aorai_CurTrans[5] ∧ 0 ≡ aorai_CurTrans[7] ∧ 0 ≡ aorai_CurTrans[8]; requires 0 ≢ aorai_CurTrans[6]; requires 0 ≡ aorai_CurStates[S1] ∧ 0 ≡ aorai_CurStates[S0] ∧ 0 ≡ aorai_CurStates[OK] ∧ 0 ≡ aorai_CurStates[S2] ∧ 0 ≡ aorai_CurStates[S5] ∧ 0 ≡ aorai_CurStates[S3]; requires 0 ≢ aorai_CurStates[S4]; behavior Buchi_property_behavior_6: ensures 0 ≡ aorai_CurTrans[0] ∧ 0 ≡ aorai_CurTrans[1] ∧ 0 ≡ aorai_CurTrans[2] ∧ 0 ≡ aorai_CurTrans[3] ∧ 0 ≡ aorai_CurTrans[4] ∧ 0 ≡ aorai_CurTrans[5] ∧ 0 ≡ aorai_CurTrans[6] ∧ 0 ≡ aorai_CurTrans[8]; ensures 0 ≢ aorai_CurTrans[7]; ensures 0 ≡ aorai_CurStates[S1] ∧ 0 ≡ aorai_CurStates[S0] ∧ 0 ≡ aorai_CurStates[OK] ∧ 0 ≡ aorai_CurStates[S2] ∧ 0 ≡ aorai_CurStates[S3] ∧ 0 ≡ aorai_CurStates[S4]; ensures 0 ≢ aorai_CurStates[S5]; behavior default: assigns \nothing; */ void h(void) { aorai_CurOperation = op_h; aorai_CurOpStatus = aorai_Terminated; aorai_CurStates_old[S5] = 0; aorai_CurStates_old[S4] = aorai_CurStates[6]; aorai_CurStates_old[S3] = 0; aorai_CurStates_old[S2] = 0; aorai_CurStates_old[S1] = 0; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; aorai_CurTrans[1] = 0; aorai_CurTrans[2] = 0; aorai_CurTrans[3] = 0; aorai_CurTrans[4] = 0; aorai_CurTrans[5] = 0; aorai_CurTrans[6] = 0; aorai_CurTrans[7] = aorai_CurStates_old[6]; aorai_CurTrans[8] = 0; aorai_CurStates[S5] = aorai_CurTrans[7]; aorai_CurStates[S4] = 0; aorai_CurStates[S3] = 0; aorai_CurStates[S2] = 0; aorai_CurStates[S1] = 0; aorai_CurStates[OK] = 0; aorai_CurStates[S0] = 0; return; } /*@ requires 0 ≡ aorai_CurTrans[1] ∧ 0 ≡ aorai_CurTrans[2] ∧ 0 ≡ aorai_CurTrans[3] ∧ 0 ≡ aorai_CurTrans[4] ∧ 0 ≡ aorai_CurTrans[5] ∧ 0 ≡ aorai_CurTrans[6] ∧ 0 ≡ aorai_CurTrans[7] ∧ 0 ≡ aorai_CurTrans[8]; requires 0 ≢ aorai_CurTrans[0]; requires 0 ≡ aorai_CurStates[S0] ∧ 0 ≡ aorai_CurStates[OK] ∧ 0 ≡ aorai_CurStates[S2] ∧ 0 ≡ aorai_CurStates[S5] ∧ 0 ≡ aorai_CurStates[S3] ∧ 0 ≡ aorai_CurStates[S4]; requires 0 ≢ aorai_CurStates[S1]; behavior Buchi_property_behavior_0: ensures aorai_CurTrans[1] ≢ 0 ⇒ NB ≤ 0; ensures 0 ≡ aorai_CurTrans[0] ∧ 0 ≡ aorai_CurTrans[2] ∧ 0 ≡ aorai_CurTrans[3] ∧ 0 ≡ aorai_CurTrans[4] ∧ 0 ≡ aorai_CurTrans[5] ∧ 0 ≡ aorai_CurTrans[6] ∧ 0 ≡ aorai_CurTrans[7]; ensures 0 ≢ aorai_CurTrans[1] ∨ 0 ≢ aorai_CurTrans[8]; ensures 0 ≡ aorai_CurStates[S1] ∧ 0 ≡ aorai_CurStates[S0] ∧ 0 ≡ aorai_CurStates[S2] ∧ 0 ≡ aorai_CurStates[S5] ∧ 0 ≡ aorai_CurStates[S3] ∧ 0 ≡ aorai_CurStates[S4]; ensures 0 ≢ aorai_CurStates[OK]; */ void f(int N) { int i; int t; int tmp_0; int tmp_1; i = 0; t = 0; G_i = 0; g_calls = G_i; NB = N; aorai_Loop_Init_38 = 1; /*@ loop invariant (0 ≢ aorai_CurStates[S1] ∨ 0 ≢ aorai_CurStates[S5] ∨ 0 ≢ aorai_CurStates[S3]) ∧ 0 ≡ aorai_CurStates[S0] ∧ 0 ≡ aorai_CurStates[OK] ∧ 0 ≡ aorai_CurStates[S2] ∧ 0 ≡ aorai_CurStates[S4] ∧ (0 ≢ aorai_CurTrans[0] ∨ 0 ≢ aorai_CurTrans[3] ∨ 0 ≢ aorai_CurTrans[4] ∨ 0 ≢ aorai_CurTrans[5]) ∧ 0 ≡ aorai_CurTrans[1] ∧ 0 ≡ aorai_CurTrans[2] ∧ 0 ≡ aorai_CurTrans[6] ∧ 0 ≡ aorai_CurTrans[7] ∧ 0 ≡ aorai_CurTrans[8]; loop invariant aorai_Loop_Init_38 ≢ 0 ⇒ aorai_CurStates[4] ≡ 0 ∧ aorai_CurStates[5] ≡ 0 ∧ aorai_CurTrans[3] ≡ 0 ∧ aorai_CurTrans[4] ≡ 0 ∧ aorai_CurTrans[5] ≡ 0; loop invariant aorai_Loop_Init_38 ≡ 0 ⇒ aorai_CurTrans[0] ≡ 0; */ while (1) { { int tmp; if (i < N) { if (! (! t)) goto while_0_break; } else goto while_0_break; aorai_Loop_Init_38 = 0; aorai_CurOperation = op_g; aorai_CurOpStatus = aorai_Called; aorai_CurStates_old[S5] = 0; aorai_CurStates_old[S4] = 0; aorai_CurStates_old[S3] = 0; aorai_CurStates_old[S2] = 0; aorai_CurStates_old[S1] = aorai_CurStates[0]; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; aorai_CurTrans[1] = 0; if (NB > 0) if (g_calls < NB) if (0 <= g_calls) if (aorai_CurStates_old[0]) tmp = 1; else tmp = 0; else tmp = 0; else tmp = 0; else tmp = 0; aorai_CurTrans[2] = tmp; aorai_CurTrans[3] = 0; aorai_CurTrans[4] = 0; aorai_CurTrans[5] = 0; aorai_CurTrans[6] = 0; aorai_CurTrans[7] = 0; aorai_CurTrans[8] = 0; aorai_CurStates[S5] = 0; aorai_CurStates[S4] = 0; aorai_CurStates[S3] = 0; aorai_CurStates[S2] = aorai_CurTrans[2]; aorai_CurStates[S1] = 0; aorai_CurStates[OK] = 0; aorai_CurStates[S0] = 0; t = g(i); G_i = t; i ++; g_calls = i; } } while_0_break: ; if (t) { aorai_CurOperation = op_h; aorai_CurOpStatus = aorai_Called; aorai_CurStates_old[S5] = 0; aorai_CurStates_old[S4] = 0; aorai_CurStates_old[S3] = aorai_CurStates[5]; aorai_CurStates_old[S2] = 0; aorai_CurStates_old[S1] = 0; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; aorai_CurTrans[1] = 0; aorai_CurTrans[2] = 0; aorai_CurTrans[3] = 0; aorai_CurTrans[4] = 0; aorai_CurTrans[5] = 0; aorai_CurTrans[6] = aorai_CurStates_old[5]; aorai_CurTrans[7] = 0; aorai_CurTrans[8] = 0; aorai_CurStates[S5] = 0; aorai_CurStates[S4] = aorai_CurTrans[6]; aorai_CurStates[S3] = 0; aorai_CurStates[S2] = 0; aorai_CurStates[S1] = 0; aorai_CurStates[OK] = 0; aorai_CurStates[S0] = 0; h(); } aorai_CurOperation = op_f; aorai_CurOpStatus = aorai_Terminated; aorai_CurStates_old[S5] = aorai_CurStates[4]; aorai_CurStates_old[S4] = 0; aorai_CurStates_old[S3] = 0; aorai_CurStates_old[S2] = 0; aorai_CurStates_old[S1] = aorai_CurStates[0]; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; if (NB <= 0) if (aorai_CurStates_old[0]) tmp_0 = 1; else tmp_0 = 0; else tmp_0 = 0; aorai_CurTrans[1] = tmp_0; aorai_CurTrans[2] = 0; aorai_CurTrans[3] = 0; aorai_CurTrans[4] = 0; aorai_CurTrans[5] = 0; aorai_CurTrans[6] = 0; aorai_CurTrans[7] = 0; aorai_CurTrans[8] = aorai_CurStates_old[4]; aorai_CurStates[S5] = 0; aorai_CurStates[S4] = 0; aorai_CurStates[S3] = 0; aorai_CurStates[S2] = 0; aorai_CurStates[S1] = 0; if (aorai_CurTrans[8]) tmp_1 = 1; else if (aorai_CurTrans[1]) tmp_1 = 1; else tmp_1 = 0; aorai_CurStates[OK] = tmp_1; aorai_CurStates[S0] = 0; return; } frama-c-20.0-Calcium/tests/spec/oracle/terminates.res.oracle0000666000000000000000000000026613571573400020712 0ustar [kernel] Parsing tests/spec/terminates.c (with preprocessing) /* Generated by Frama-C */ /*@ terminates c > 0; assigns \nothing; */ void f(int c) { while (! c) ; return; } frama-c-20.0-Calcium/tests/spec/oracle/transitive_rel.res.oracle0000666000000000000000000000060713571573400021570 0ustar [kernel] Parsing tests/spec/transitive_rel.c (with preprocessing) [kernel:annot-error] tests/spec/transitive_rel.c:16: Warning: Inconsistent relation chain. /* Generated by Frama-C */ /*@ predicate bound(int x, int y, int z) = x ≤ y < z ∧ z ≥ y > x; */ /*@ predicate bound2(int x, int y, int z) = x ≤ y ≡ z; */ /*@ predicate test(int x, int y, 𝔹 z) = (x ≤ y) ≡ z; */ frama-c-20.0-Calcium/tests/spec/oracle/tsets.res.oracle0000666000000000000000000000707113571573400017702 0ustar [kernel] Parsing tests/spec/tsets.c (with preprocessing) [kernel:annot-error] tests/spec/tsets.c:36: Warning: sets of sets are not supported yet. Ignoring global annotation [kernel:annot-error] tests/spec/tsets.c:46: Warning: comparison of incompatible types: set and ℤ. Ignoring global annotation [kernel:annot-error] tests/spec/tsets.c:47: Warning: comparison of incompatible types: set and ℤ. Ignoring global annotation [kernel:annot-error] tests/spec/tsets.c:48: Warning: comparison of incompatible types: ℤ and set . Ignoring global annotation [kernel:annot-error] tests/spec/tsets.c:49: Warning: comparison of incompatible types: ℤ and set . Ignoring global annotation [kernel:annot-error] tests/spec/tsets.c:56: Warning: set of sets is not yet implemented. Ignoring global annotation [kernel:annot-error] tests/spec/tsets.c:57: Warning: set of sets is not yet implemented. Ignoring global annotation [kernel:annot-error] tests/spec/tsets.c:71: Warning: symbol \subset is a predicate, not a function. Ignoring global annotation [kernel:annot-error] tests/spec/tsets.c:72: Warning: symbol \subset is a predicate, not a function. Ignoring global annotation [kernel:annot-error] tests/spec/tsets.c:73: Warning: symbol \subset is a predicate, not a function. Ignoring global annotation /* Generated by Frama-C */ struct foo { char bar[4] ; }; typedef char baz[4]; struct bli { baz bli ; }; /*@ assigns x->bar[0 .. 3]; assigns x->bar[0 .. 3] \from x->bar[0 .. 3]; */ int f(struct foo *x); /*@ assigns *(x + (0 .. 3)); assigns *(x + (0 .. 3)) \from y->bli[0 .. 3]; */ int g(char * /*[4]*/ x, struct bli *y); int main(void) { int __retres; struct foo x; baz y; struct bli z; f(& x); g(y,& z); /*@ assert \separated(&x, &y[2]); */ ; __retres = 0; return __retres; } /*@ predicate test1(set s1, set s2) = \subset(s1, \union(s2, {k + 1 | int k; constraint: 0 ≤ k < 10})); */ /*@ predicate test2(set s1, set s2) = \subset(\union({k + 1 | int k; constraint: 0 ≤ k < 10}, s2), s1); */ /*@ ensures \subset(\result, {\old(x), \old(x) + 1, \old(x) - 1}); ensures \result ∈ {\old(x), \old(x) + 1, \old(x) - 1}; */ int h(int x, int c) { int tmp_0; if (c > 0) tmp_0 = x + 1; else { int tmp; if (c < 0) tmp = x - 1; else tmp = x; tmp_0 = tmp; } return tmp_0; } /*@ requires \valid(\union(*(a + (0 .. 1)), *(b + (0 .. 1)))); */ int foo(int **a, int **b) { int __retres; __retres = 0; return __retres; } /*@ predicate test_singleton_1{L}(int *a, int x) = \at(x ≡ *(a + (0 .. 1)),L); */ /*@ predicate test_singleton_2{L}(int *a) = \at(*(a + (0 .. 1)) ≡ 1,L); */ /*@ predicate test_singleton_3{L}(int *a) = \at(*(a + (0 .. 1)) ≡ {1},L); */ /*@ predicate test_set_of_elem{L}(int *a) = \at(*(a + (0 .. 1)) ≡ {1, 2},L); */ int A[100]; /*@ ensures \subset(\result, &A[0 ..]); ensures \result ∈ &A[0 ..]; */ int *AA(void); /*@ logic set<ℤ> Sempty_1= \empty; */ /*@ logic set<ℤ> Sempty_2= \empty; */ /*@ logic set<ℤ> Selems_1= {1, 2, (int)'3'}; */ /*@ logic set<ℤ> Sadd_elem_1(set<ℤ> s, ℤ e) = \union(s, e); */ /*@ logic set<ℤ> Sadd_elem_2(set<ℤ> s, ℤ e) = \union(s, {e}); */ /*@ predicate Smember_and(set<ℤ> s, ℤ v1, ℤ v2) = (v1 & v2) ∈ s; */ /*@ predicate Smember_or(set<ℤ> s, ℤ v1, ℤ v2) = (v1 | v2) ∈ s; */ /*@ predicate Smember_and_or(set<ℤ> s, ℤ v1, ℤ v2) = (v1 & v2) ∈ s ∧ (v1 | v2) ∈ s; */ /*@ logic set<ℤ> Scomprehension(set<ℤ> s, ℤ mask) = {(k | 1) | int k; (k | mask) ∈ s}; */ frama-c-20.0-Calcium/tests/spec/oracle/type_constructors_in_env.res.oracle0000666000000000000000000000025413571573400023703 0ustar [kernel] Parsing tests/spec/type_constructors_in_env.i (no preprocessing) /* Generated by Frama-C */ /*@ type foo = A | B; */ /*@ logic foo f(ℤ x) = x ≥ 0? A: B; */ frama-c-20.0-Calcium/tests/spec/oracle/type_of_term.res.oracle0000666000000000000000000000371613571573400021236 0ustar [kernel] Parsing tests/spec/type_of_term.i (no preprocessing) [type_of_term] Term: *(p + (..)), type is set [type_of_term] Host: *(p + (..)), type is set [type_of_term] Offset: , type is set [type_of_term] Lval: *(p + (..)), type is set [type_of_term] Term: p + (..), type is set [type_of_term] Term: p, type is int * [type_of_term] Host: p, type is int * [type_of_term] Offset: , type is int * [type_of_term] Lval: p, type is int * [type_of_term] Term: .., type is set<ℤ> [type_of_term] Term: t[..], type is set [type_of_term] Host: t, type is int [42] [type_of_term] Offset: [..], type is set [type_of_term] Lval: t[..], type is set [type_of_term] Term: .., type is set<ℤ> [type_of_term] Term: (s + (..))->x, type is set [type_of_term] Host: *(s + (..)), type is set [type_of_term] Offset: .x, type is set [type_of_term] Lval: (s + (..))->x, type is set [type_of_term] Term: s + (..), type is set [type_of_term] Term: s, type is struct S * [type_of_term] Host: s, type is struct S * [type_of_term] Offset: , type is struct S * [type_of_term] Lval: s, type is struct S * [type_of_term] Term: .., type is set<ℤ> [type_of_term] Term: (s + (..))->y[..], type is set [type_of_term] Host: *(s + (..)), type is set [type_of_term] Offset: .y[..], type is set [type_of_term] Lval: (s + (..))->y[..], type is set [type_of_term] Term: s + (..), type is set [type_of_term] Term: s, type is struct S * [type_of_term] Host: s, type is struct S * [type_of_term] Offset: , type is struct S * [type_of_term] Lval: s, type is struct S * [type_of_term] Term: .., type is set<ℤ> [type_of_term] Term: .., type is set<ℤ> /* Generated by Frama-C */ struct S { int x ; int y[] ; }; int t[42]; struct S s; /*@ assigns *(p + (..)), t[..], (s + (..))->x, (s + (..))->y[..]; */ void f(int *p, struct S *s); int main(void) { int __retres; f(t,& s); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/typedef.res.oracle0000666000000000000000000000041313571573400020171 0ustar [kernel] Parsing tests/spec/typedef.c (with preprocessing) /* Generated by Frama-C */ struct _list { int i ; }; typedef struct _list *list; /*@ requires \valid(p); */ void f(list p) { return; } /*@ requires \valid(p); */ void g(struct _list *p) { return; } frama-c-20.0-Calcium/tests/spec/oracle/unification.res.oracle0000666000000000000000000000101613571573400021041 0ustar [kernel] Parsing tests/spec/unification.c (with preprocessing) /* Generated by Frama-C */ struct _list { int element ; struct _list *next ; }; typedef struct _list list; /*@ type List = Nil | Cons(A, List ); */ /*@ inductive logic_model{L}(list *root, List logic_list) { case nil{L}: logic_model(\null, Nil); case cons{L}: ∀ list *l1, List ll1; \valid(l1) ⇒ logic_model(l1->next, ll1) ⇒ logic_model(l1, Cons(l1->element, ll1)); } */ frama-c-20.0-Calcium/tests/spec/oracle/unused.res.oracle0000666000000000000000000000061213571573400020035 0ustar [kernel] Parsing tests/spec/unused.c (with preprocessing) /* Generated by Frama-C */ struct __anonstruct_T_1 { int i ; }; /*@ lemma toto{L}: ∀ struct __anonstruct_T_1 t; t.i ≡ 0; */ extern int G; /*@ global invariant G_const: G ≡ 0; */ static int i; /*@ global invariant invi: i ≥ 0; */ extern int c; /*@ requires c ≡ 0; */ __attribute__((__FC_BUILTIN__)) void foo(int *); frama-c-20.0-Calcium/tests/spec/oracle/updater.res.oracle0000666000000000000000000000267213571573400020206 0ustar [kernel] Parsing tests/spec/updater.c (with preprocessing) /* Generated by Frama-C */ struct S { int v ; int a[5] ; int b ; }; struct SS { struct S a[5] ; struct S b ; }; struct S x = {.v = 1, .a = {0, 0, 0, 0, 0}, .b = 2}; struct SS y; /*@ logic struct S foo(struct S x) = {{x \with .b = (int)(x.b + 1)} \with .v = (int)3}; */ /*@ lemma foo2{L}: x ≡ {foo(x) \with .b = (int)(x.a[0] + 1)}; */ /*@ lemma bar{L}: (\let tmp = foo(x); {tmp \with .a = {{tmp.a \with [..] = (int)0} \with [3] = (int)3}}) ≡ (\let tmp = \let tmp = foo(x); {tmp \with .a = {tmp.a \with [..] = (int)0}}; {tmp \with .a = {tmp.a \with [3] = (int)3}}); */ /*@ lemma bar2{L}: x ≡ {x \with .a = {x.a \with [4] = (int)0}}; */ /*@ lemma bar3{L}: y ≡ {y \with .a = \let idx = 3 + 1; {y.a \with [idx] = {y.a[idx] \with .b = (int)(x.b + 1)}}}; */ /*@ lemma bar4{L}: y ≡ {y \with .a = {y.a \with [4] = {y.a[4] \with .a = {y.a[4].a \with [ ..] = (int)(x.b + 1)}}}}; */ /*@ lemma bar5{L}: y ≡ (\let tmp = {y \with .a = {y.a \with [4] = {{y.a[4] \with .a = {y.a[4].a \with [ ..] = (int)(x.b + 1)}} \with .v = (int)3}}}; {tmp \with .b = {tmp.b \with .v = (int)4}}); */ /*@ lemma cast{L}: y.a[0].v ≡ (\let tmp = (struct S)y; tmp.v); */ int *f(void) { int *__retres; if (y.a[0].v == y.b.v) { __retres = (int *)y.a[0].v; goto return_label; } __retres = (int *)x.b; return_label: return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/use.res.oracle0000666000000000000000000000056413571573400017334 0ustar [kernel] Parsing tests/spec/use.c (with preprocessing) [kernel] Parsing tests/spec/use2.c (with preprocessing) /* Generated by Frama-C */ /*@ axiomatic S { logic ℤ F(ℤ x) ; } */ /*@ logic ℤ X= 42; */ /*@ ensures X > 0; ensures F(1) > 0; */ void f(void) { return; } /*@ ensures X > 0; ensures F(1) > 0; */ void g(void) { return; } frama-c-20.0-Calcium/tests/spec/oracle/used_before_decl_bts0109.res.oracle0000666000000000000000000000132213571573400023164 0ustar [kernel] Parsing tests/spec/used_before_decl_bts0109.i (no preprocessing) [kernel:typing:no-proto] tests/spec/used_before_decl_bts0109.i:3: Warning: Calling function f that is declared without prototype. Its formals will be inferred from actual arguments [kernel:typing:implicit-function-declaration] tests/spec/used_before_decl_bts0109.i:3: Warning: Calling undeclared function h. Old style K&R code? /* Generated by Frama-C */ /*@ requires a ≥ 0; assigns \result; assigns \result \from a; */ int f(int a); /*@ ensures \result ≡ \old(b) + 1; */ extern int h(int b); int g(void) { int __retres; int tmp; int tmp_0; tmp = f(0); tmp_0 = h(1); __retres = tmp + tmp_0; return __retres; } frama-c-20.0-Calcium/tests/spec/oracle/volatile.res.oracle0000666000000000000000000000434613571573400020361 0ustar [kernel] Parsing tests/spec/volatile.c (with preprocessing) [kernel] Parsing tests/spec/volatile_aux.c (with preprocessing) [kernel] tests/spec/volatile.c:8: Warning: Overlapping volatile specification: volatile location y already associated to a writes function in annotation at loc tests/spec/volatile.c:7. Ignoring new binding. [kernel] tests/spec/volatile.c:9: Warning: Overlapping volatile specification: volatile location x already associated to a writes function in annotation at loc tests/spec/volatile.c:7. Ignoring new binding. [kernel] tests/spec/volatile.c:10: Warning: Overlapping volatile specification: volatile location y already associated to a reads function in annotation at loc tests/spec/volatile.c:8. Ignoring new binding. /* Generated by Frama-C */ typedef int volatile VINT; struct st { int a ; int volatile v ; }; typedef struct st ST; struct vst { int b ; ST v ; }; int f(int x_0); __inline static int r__fc_inline(VINT *v_0) { int __retres; __retres = *v_0; return __retres; } __inline static int w__fc_inline(int volatile *v_0, int new) { *v_0 = new; return new; } int volatile v; int volatile tab[10]; VINT *pt; struct st s; /*@ volatile v, tab[..] reads r__fc_inline writes w__fc_inline; */ /*@ volatile *pt writes w__fc_inline; */ /*@ volatile s.v reads r__fc_inline; */ struct vst vs; struct vst rs(struct vst *p); struct vst ws(struct vst *p, struct vst v); /*@ volatile vs reads rs writes ws; */ int volatile x; int volatile y; int volatile z; /*@ volatile x, y writes w__fc_inline; */ /*@ volatile y, z reads r__fc_inline writes w__fc_inline; */ /*@ volatile x writes w__fc_inline; */ /*@ volatile y reads r__fc_inline; */ int const c = 1; int *p; /*@ lemma comp_const_addr{L}: p ≡ &c; */ /*@ lemma comp_volatile_addr{L}: p ≡ &v; */ /*@ lemma volatile_in_annot_is_illegal{L}: v ≡ 1 ⇒ v ≡ 1; */ int main(void) { int __retres; int x_0 = v; v = f(x_0); __retres = 0; return __retres; } __inline static int r__fc_inline_0(VINT *v_0) { int __retres; __retres = *v_0; return __retres; } __inline static int w__fc_inline_0(int volatile *v_0, int new) { *v_0 = new; return new; } int f(int x_0) { int __retres; x_0 ++; v = x_0; __retres = v + x_0; return __retres; } frama-c-20.0-Calcium/tests/spec/overload_resolution.i0000666000000000000000000000030513571573400017555 0ustar /*@ predicate rel(unsigned long long x, unsigned long long y) = x == y; */ /*@ predicate rel(char x, char y, integer foo) = x == y; */ /*@ ensures rel(\result, x); */ char f(int x) { return x; } frama-c-20.0-Calcium/tests/spec/parsing.c0000666000000000000000000000102013571573400015107 0ustar /* cf bug 298 */ /*@ lemma bidon{Here} : @ \forall int *t; ! (t[0] > 0); @*/ /*@ lemma bidon1{Here} : @ \forall int *t; ! t[0] == 0; @*/ /*@ lemma bidon2{Here} : @ \forall int *t; (! t[0]) == 0; @*/ /*@ lemma bidon3{Here} : @ \forall int *t; ! t[0] >= 0; @*/ /*@ lemma bidon4{Here}: @ \forall int *t; (! t[0]) < 0; @*/ /*@ predicate foo{L}(int* a,int* b, int length) = ! \forall integer k; 0 <= k < length ==> a[k] == b[k]; */ /* Cf bug 1358 */ struct foo { /*@ private bla */ int x; }; frama-c-20.0-Calcium/tests/spec/permut.c0000666000000000000000000000205113571573400014765 0ustar /*@ axiomatic Permut { @ // permut{L1,L2}(t1,t2,n) is true whenever t1[0..n-1] in state L1 @ // is a permutation of t2[0..n-1] in state L2 @ predicate permut{L1,L2}(double t1[], double t2[], integer n); @ // reads \at(t1[..],L1), \at(t2[..],L2); @ axiom permut_refl{L} : @ \forall double t[], integer n; permut{L,L}(t,t,n); @ axiom permut_sym{L1,L2} : @ \forall double t1[], double t2[], integer n; @ permut{L1,L2}(t1,t2,n) ==> permut{L2,L1}(t2,t1,n) ; @ axiom permut_trans{L1,L2,L3} : @ \forall double t1[], double t2[], double t3[], integer n; @ permut{L1,L2}(t1,t2,n) && permut{L2,L3}(t2,t3,n) @ ==> permut{L1,L3}(t1,t3,n) ; @ axiom permut_exchange{L1,L2} : @ \forall double t1[], double t2[], integer i, integer j, integer n; @ \at(t1[i],L1) == \at(t2[j],L2) && @ \at(t1[j],L1) == \at(t2[i],L2) && @ (\forall integer k; 0 <= k < n && k != i && k != j ==> @ \at(t1[k],L1) == \at(t2[k],L2)) @ ==> permut{L1,L2}(t1,t2,n); @ } @*/ frama-c-20.0-Calcium/tests/spec/pi.c0000666000000000000000000000175613571573400014074 0ustar /****** int a=10000,b,c=2800,d,e,f[2801],g;main(){for(;b-c;)f[b++]=a/5; for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)for(b=c;d+=f[b]*a, f[b]=d%--g,d/=g--,--b;d*=b);} ******/ /*@ lemma simplify_dumb_1 : 2800 % 14 == 0; */ /*@ lemma simplify_dumb_2 : \forall integer c; c*2>0 ==> c*2>1; */ /*@ lemma simplify_dumb_3 : \forall integer c; c%14==0 ==> (c-14)%14==0; */ /*@ lemma simplify_dumb_4 : \forall integer c; c%14==0 ==> c>0 ==> c>=14; */ void print4(int); int a=10000,b,c=2800,d,e,f[2801],g; /*@ requires b == 0 && c == 2800 && a == 10000; */ void main(){ /*@ loop invariant 0 <= b <= 2800 ; loop variant c-b; */ for(; b-c; b++) f[b] = a/5; /*@ loop invariant 0 <= c <= 2800 && c%14==0; loop variant c; */ for(; d=0, g=c*2; ) { /*@ loop invariant 1 <= b <= c && g == b*2; loop variant b; */ for(b=c; 1; ) { d+=f[b]*a; f[b]=d%--g; d/=g--; --b; if (!b) break; d*=b; } c-=14; print4(e+d/a); e=d%a; } } frama-c-20.0-Calcium/tests/spec/pointer_cast.c0000666000000000000000000000015213571573400016143 0ustar void f(int **a) { int *b; //@ assert a == b; //@ assert (int*)a == b; //@ assert a == (int**)b; } frama-c-20.0-Calcium/tests/spec/pointer_comparable.c0000666000000000000000000000017113571573400017317 0ustar /*@ requires \pointer_comparable((void*)p,(void*)q) && \is_finite(*p) ; */ void f(float*p, char const * q) { return; } frama-c-20.0-Calcium/tests/spec/polymorph.c0000666000000000000000000000161113571573400015503 0ustar /*@ type foo; */ /* should be rejected (free type variable) */ /*@ logic integer bad(foo x); */ /*@ logic integer f(foo x); */ /*@ logic integer g(foo x, foo y); */ /*@ logic foo h(foo x); */ /* definition of i should be rejected (free variable in return type) */ /*@ logic foo i(foo x); */ //@ predicate bla(foo x) = f(x) == 0 ; //@ predicate bli(foo x) = g(x,x) == 42 ; /* blu should be rejected (force unification between two user-introduced type variables) */ //@ predicate blu(foo x, foo y) = g(x,y) == 36 ; //@ predicate blu2(foo x, foo y) = g(x,x) == 36 && g(y,y) == 72 ; //@ predicate bar(foo x) = bli(x) && blu2(x,x) ; // should be rejected //@ predicate unif1(foo x,fooy) = h(x) == h(y); // should be rejected //@ logic foo unif2(foo x, fooy) = h(y); frama-c-20.0-Calcium/tests/spec/pp_empty_spec.i0000666000000000000000000000051413571573400016330 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int main(void) { int x = 0; int y = 0; /*@ loop invariant invmerger: chekofv_invariant_1_1: x==y; */ while (y < 10) { x++; if (x!=9) y++; } return 0; } frama-c-20.0-Calcium/tests/spec/pp_empty_spec.ml0000666000000000000000000000230713571573400016512 0ustar let e = Emitter.create "foo" [ Emitter.Funspec ] ~correctness:[] ~tuning:[] let emitter = e let populate = false let run () = let () = Ast.compute () in let main = Globals.Functions.find_by_name "main" in Annotations.add_requires e main []; File.pretty_ast (); Annotations.add_assumes e main [ Logic_const.new_predicate Logic_const.ptrue]; File.pretty_ast(); Annotations.remove_behavior e main (List.hd (Annotations.behaviors ~populate ~emitter main)); File.pretty_ast(); Annotations.add_ensures e main []; File.pretty_ast(); (try Annotations.add_complete e main ["foo"; "bar"]; with Log.AbortFatal s -> Kernel.warning "Caught fatal error: %s" s); (try Annotations.add_disjoint e main ["foo"; "bar"]; with Log.AbortFatal s -> Kernel.warning "Caught fatal error: %s" s); File.pretty_ast(); let behavior = "foo" in Annotations.add_assumes e main ~behavior [ Logic_const.new_predicate Logic_const.ptrue ]; Annotations.add_complete e main [behavior]; Annotations.add_disjoint e main [behavior]; Annotations.remove_behavior_components e main (List.hd (Annotations.behaviors ~populate ~emitter main)); File.pretty_ast() let () = Db.Main.extend run frama-c-20.0-Calcium/tests/spec/pragma.i0000666000000000000000000000042513571573400014731 0ustar #typedef int B #pragma #pragma A #pragma A() #pragma A("A" "A", A, B, 2:4) #pragma B #pragma B() #pragma B("A" "A", A, B, 2:4) #pragma 1:3 #pragma default:1 #pragma (1 ? A : B) #pragma "A" #pragma 1 #pragma A 0 #pragma A B "C" #pragma B A "C" 4 "E" #pragma 0 A B "C" D 5 frama-c-20.0-Calcium/tests/spec/prec_i.h0000666000000000000000000000052313571573400014721 0ustar /* This code is AIRBUS property */ #ifndef _INCLUDE_prec_i #define _INCLUDE_prec_i /* spécification de l'opérateur PREC_I _E1 : INTEGER _S1 : INTEGER Calcul : _S1[k] = _E1[k-1] Initialisation : _E1[k-1] = FALSE */ #define PREC_I(NNN, _E1, _S1) {\ static INTEGER PREC_I_RE1;\ (_S1)=PREC_I_RE1;\ PREC_I_RE1=(_E1);\ } #endif frama-c-20.0-Calcium/tests/spec/precedence.i0000666000000000000000000000056413571573400015563 0ustar int x[10] ; //@lemma prio_unary_plus: 3 - +2 +2 == 3; //@lemma prio_unary_minus: 3 - -2 -2 == 3; //@lemma prio_unary_amp: (&x[1] - &x[0] & &x[2] - &x[2]) == 0; //@lemma prio_unary_star: 0 * *&x[2] * *&x[2] == 0; //@ lemma prio_ternary_let: \let i = 0; i == 0 ? i : i - 1; //@ lemma prio_ternary_let_2: \let i = 0; (\let i = 0; i==3) ? i!=0: i==0; frama-c-20.0-Calcium/tests/spec/pred_def.i0000666000000000000000000000004213571573400015225 0ustar //@ predicate f(integer x) = x+1; frama-c-20.0-Calcium/tests/spec/predicates.c0000666000000000000000000000067313571573400015604 0ustar /*@ predicate is_valid_int_range(int* p, int n) = (pred1:0 <= n) && pred2:\valid_range(p, 0, n-1); */ /*@ predicate P(int *p) = *p ==0 ; */ /* predicate Q(int p) = *(((char*)&p)+2) ==0 ; */ /*@ predicate R(int *p) = \valid(p) ; */ /*@ predicate S(int *p) = \let z = 0 ; *p == \let x = 0 ; ((\let y = z ; x < y) ? 1 + 2 : (\let y = x ; y)) + 2 ; */ //@ axiomatic a { predicate P(integer v); } //@ lemma l: P(1)?P(2):P(3) ; frama-c-20.0-Calcium/tests/spec/preprocess.c0000666000000000000000000000071613571573400015644 0ustar /* run.config OPT: -eva @EVA_CONFIG@ -journal-disable -print */ // see bts 1357 #define assert(x) (x)?1:0 int x = 1; #define FOO 1 #undef FOO #define FOO 2 #include "preprocess.h" int y = 1; /*@ requires x >= MIN_X; behavior default: ensures test(\result) && FOO == FOO; */ int f(int x) { return (x + MIN_X); } int main() { int y = f(MIN_X); //@ assert (x) == 1; // BTS 2307 /*@ assert backslash_string: "\\"[0] == '\\'; */ return 0; } frama-c-20.0-Calcium/tests/spec/preprocess.h0000666000000000000000000000007313571573400015645 0ustar #define MIN_X 42 //@ predicate test(int x) = x >= MIN_X ; frama-c-20.0-Calcium/tests/spec/preprocess_string.c0000666000000000000000000000021513571573400017224 0ustar /* run.config STDOPT: +"-cpp-command \"gcc -C -E -I. -Wno-comment\"" */ /*@ ensures "/*"[0] == '/'; */ char f(void) { return "/*"[1]; } frama-c-20.0-Calcium/tests/spec/printf_assigns.c0000666000000000000000000000061713571573400016510 0ustar /* run.config DONTRUN: support for discussion on printf specification */ /* How to specify this code ? */ #ifndef PTEST #include #else extern int printf (__const char *__restrict __format, ...); #endif int main(int argc, char* argv[]) { char * str = (argc < 2 ? "" : argv [1]) ; int pos; printf("%2$2s%1$n.\n", &pos, str); printf("dot position=%d\n", 1+pos); return 0; } frama-c-20.0-Calcium/tests/spec/property_test.i0000666000000000000000000000042013571573400016400 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int X; /*@ requires X >= 0; ensures X >= 0; */ int main (int c) { if (c) X++; /*@ assert X >= \at(X,Pre); */ return X; } frama-c-20.0-Calcium/tests/spec/property_test.ml0000666000000000000000000000517713571573400016576 0ustar open Cil open Cil_types let emitter = Emitter.create "Property_test" [ Emitter.Funspec ] ~correctness:[] ~tuning:[] class visit prj = object(self) inherit Visitor.frama_c_copy prj method! vbehavior b = let kf = Extlib.the self#current_kf in if Kernel_function.get_name kf = "main" then begin let x = Globals.Vars.find_from_astinfo "X" VGlobal in let x = Cil.cvar_to_lvar x in let c = Globals.Vars.find_from_astinfo "c" (VFormal kf) in let c = Cil.cvar_to_lvar c in b.b_assigns <- Writes [ Logic_const.new_identified_term (Logic_const.tvar x), From [ Logic_const.new_identified_term (Logic_const.tvar x); Logic_const.new_identified_term (Logic_const.tvar c)] ]; let nkf = Visitor_behavior.Get.kernel_function self#behavior kf in let keep_empty = true in let post b = Queue.add (fun () -> Annotations.add_assigns ~keep_empty emitter nkf b.b_assigns) self#get_filling_actions; b in ChangeDoChildrenPost(b, post) end else DoChildren method! vstmt_aux stmt = match stmt.skind with | Return _ -> let kf = Extlib.the self#current_kf in let requires = [ Logic_const.new_predicate (Logic_const.ptrue) ] in let post_cond = [ Normal, Logic_const.new_predicate (Logic_const.pfalse) ] in let s1 = Cil.empty_funspec () in let b1 = Cil.mk_behavior ~requires () in s1.spec_behavior <- [ b1 ]; let ca1 = Logic_const.new_code_annotation (AStmtSpec ([], s1)) in Annotations.add_code_annot emitter ~kf stmt ca1; let s2 = Cil.empty_funspec () in let b2 = Cil.mk_behavior ~post_cond () in s2.spec_behavior <- [ b2 ]; let ca2 = Logic_const.new_code_annotation (AStmtSpec ([], s2)) in Annotations.add_code_annot emitter ~kf stmt ca2; Cil.DoChildren | _ -> Cil.DoChildren end let show_properties () = Format.printf "In project %a:@." Project.pretty (Project.current()); let strs = Property_status.fold (fun p acc -> let s = Format.asprintf "Status of %a: %a@." Property.pretty p Property_status.pretty (Property_status.get p) in Datatype.String.Set.add s acc ) Datatype.String.Set.empty in Datatype.String.Set.iter (Format.pp_print_string Format.std_formatter) strs let run () = let prj = File.create_project_from_visitor "property_test" (fun p -> new visit p) in show_properties (); Project.on prj show_properties () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/spec/prototype_assigns.c0000666000000000000000000000020513571573400017244 0ustar /*@ assigns *p; */ extern int f(char * p); // fonction de mise à jour qui "écrit" dans *p int main(char *x) { return f(x); } frama-c-20.0-Calcium/tests/spec/ptr_cast.c0000666000000000000000000000012013571573400015263 0ustar int f() { return 0; } /*@ predicate is_f( void (*g)()) = g == (void(*)())f; */ frama-c-20.0-Calcium/tests/spec/purse.c0000666000000000000000000000625113571573400014615 0ustar /**************************************************************************/ /* */ /* The Why/Caduceus/Krakatoa tool suite for program certification */ /* Copyright (C) 2002-2006 */ /* Jean-François COUCHOT */ /* Mehdi DOGGUY */ /* Jean-Christophe FILLIÂTRE */ /* Thierry HUBERT */ /* Claude MARCHÉ */ /* Yannick MOY */ /* */ /* This software is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU General Public */ /* License version 2, as published by the Free Software Foundation. */ /* */ /* This software is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /* */ /* See the GNU General Public License version 2 for more details */ /* (enclosed in the file GPL). */ /* */ /**************************************************************************/ #include "share/libc/stdlib.h" typedef struct purse { int balance; } purse; //@ predicate purse_inv{L}(purse *p) = \valid(p) && p->balance >= 0 ; /*@ requires purse_inv(p) && s >= 0; @ assigns p->balance; @ ensures purse_inv(p) && p->balance == \old(p->balance) + s ; @*/ void credit(purse *p,int s) { p->balance = p->balance + s; } /*@ requires purse_inv(p) && s >= 0 ; @ assigns p->balance; @ ensures purse_inv(p) && p->balance == \old(p->balance) + s ; @*/ void f(purse *p,int s) { p->balance = p->balance + s; } /*@ requires purse_inv(p) && 0 <= s <= p->balance; @ assigns p->balance; @ ensures purse_inv(p) && p->balance == \old(p->balance) - s; @*/ void withdraw(purse *p,int s) { p->balance = p->balance - s; } /*@ requires purse_inv(p1) && purse_inv(p2) ; @ assigns p1->balance, p2->balance; @ ensures \result == 0; @*/ int test1(purse *p1, purse *p2) { p1->balance = 0; credit(p2,100); return p1->balance; } /*@ assigns \empty; @ ensures \fresh(\result,sizeof(purse)) && purse_inv(\result) && \result->balance == 0; @*/ purse *new_purse() { purse* p = (purse*) malloc(1 * sizeof(purse)); p->balance = 0; return p; } /*@ ensures \result == 150; @*/ int test2() { purse *p1 = new_purse(); purse *p2 = new_purse(); credit(p1,100); credit(p2,200); withdraw(p1,50); withdraw(p2,100); return p1->balance + p2->balance; } /* void main() { purse *p = new_purse(); test1(p,p); } */ frama-c-20.0-Calcium/tests/spec/range.c0000666000000000000000000000033413571573400014547 0ustar struct foo { char bar[4]; }; /*@ assigns x->bar[0..3] \from x->bar[0..3]; */ int f(struct foo* x); typedef char baz[4]; struct bli { baz bli; }; /*@ assigns x[0..3] \from y->bli[0..3]; */ int g(baz x,struct bli* y); frama-c-20.0-Calcium/tests/spec/real_typing_bts1309.i0000666000000000000000000000011313571573400017156 0ustar void foo(int c) { float f = 1.0; /*@ assert 0.0 <= (c ? f : 2.0); */ } frama-c-20.0-Calcium/tests/spec/recursive_with_label.i0000666000000000000000000000113413571573400017661 0ustar /*@ logic integer size_rec(int* busybits, integer capa) = @ (capa <= 0) ? 0 : @ (busybits[capa-1] != 0) ? 1 + size_rec(busybits, capa - 1) : @ size_rec(busybits, capa - 1); */ /*@ ensures \result == size_rec(busybits, 0); */ int size(int *busybits) { return 0; } /*@ logic integer f(int* p, integer l) = (l > 0)? 1 + f(p+1,l-1) : *p; */ /*@ predicate p(int *p, integer l) = (l > 0) ? p(p+1, l-1) : \valid(p); */ /*@ inductive foo(int* p, integer l) { case nil: \forall int* p; foo(p,0); case other: \forall int* p, integer l; l>0 ==> \valid(p+l) ==> foo(p,l-1) ==> foo(p,l); } */ frama-c-20.0-Calcium/tests/spec/regions.c0000666000000000000000000000152413571573400015123 0ustar /*@ requires \valid(p); @ ensures *p == n; @*/ void g(int *p, int n) { *p = n; } /*@ requires \valid(x) && \valid(y); @ ensures *x == 1 && *y==2; @*/ void f(int *x, int *y) { g(x,1); g(y,2); } struct S { int t1[2]; int t2[2]; }; //@ ensures s.t1[0]==1 && s.t2[0]==2 && s.t1[1]==2 && s.t2[1]==1; void main(struct S s) { f(&s.t1[0],&s.t2[1]); f(&s.t2[0],&s.t1[1]); f(&s.t1[0],&s.t1[0]); } /* on veut : zones globales : Zone 0: {s.t1[0]; }; Zone 1: {s.t1[1]; }; Zone 2: {s.t2[0]; }; Zone 3: {s.t2[1]; }; zones locales : f: Zone 4: { *x; } Zone 5: { *y; } g: Zone 6; { *p; } Appels: g(..) ligne 13: zone 6 -> zone 4 g(..) ligne 14: zone 6 -> zone 5 f(..) ligne 24: zone 4 -> zone 0, zone 5 -> zone 2 f(..) ligne 25: zone 4 -> zone 3, zone 5 -> zone 1 f(..) ligne 26: zone 4 -> zone 0, zone 5 -> zone 0 */ frama-c-20.0-Calcium/tests/spec/regions2.c0000666000000000000000000000067713571573400015215 0ustar struct S { int t1[2]; int t2[2]; }; struct T { struct S *t[2]; }; /*@ requires \valid(s) && \valid(s->t[0]); @*/ void f(struct T *s) { s->t[0]->t1[0] = 1; } int main(struct T s, struct S a) { s.t[0] = &a; f(&s); return 0; } /* on veut : zones globales : Zone 0: {s.t[0]; }; Zone 1: {a.t1[0]; }; zones locales : f: Zone 4: { *s; } Zone 5: { s->t[0]; } Appels: f(..) ligne 25: zone 4 -> zone 0, zone 5 -> zone 1 */ frama-c-20.0-Calcium/tests/spec/reset_env.i0000666000000000000000000000026613571573400015457 0ustar /* Test case for gitlab issue #326 */ /*@ axiomatic buggy { predicate bla(integer n); axiom will_fail: INEXISTENT_SYMBOL == 1; } */ /*@ requires bla(n);*/ void f(int n); frama-c-20.0-Calcium/tests/spec/returns.i0000666000000000000000000000054113571573400015163 0ustar /*@ ensures \result != c; */ int f (int c) { /*@ returns \result == 0; */ if (c) return 0; return 42; } /*@ requires \valid(a); ensures *a > 0; */ int g(int *a) { *a++; /*@ behavior neg: assumes *a < 0; returns \old(*a) == -*a; */ if (*a < 0) { *a = -*a; return -1; } if (*a != 0) { *a++; return 0; } return 1; } frama-c-20.0-Calcium/tests/spec/rm_qualifiers.i0000666000000000000000000000050713571573400016325 0ustar /* run.config OPT: @PTEST_FILE@ -ocode @PTEST_DIR@/result/@PTEST_NAME@_res.i -print -then @PTEST_DIR@/result/@PTEST_NAME@_res.i -ocode="" -print */ extern void G(const void* p); typedef volatile int ARR[42][3]; void* ptr; //@ ensures ptr == (void *)ftab[1]; void F(const ARR ftab, const unsigned id) { G((void *)ftab[1]); } frama-c-20.0-Calcium/tests/spec/second.c0000666000000000000000000000031713571573400014727 0ustar /* run.config DONTRUN: linked with first which is the real test. */ /*@ behavior b: requires \valid(second); ensures \result == 0;*/ int bar(int *second); void sub (char * c) { bar((int*)c); } frama-c-20.0-Calcium/tests/spec/separated.c0000666000000000000000000000040213571573400015417 0ustar /*@ requires \base_addr(q) != p; requires \separated(p,q); requires \valid(p+(0..(n-1))); requires \valid(q+(0..(n-1))); assigns p[0..n-1]; */ void put(char* p, char* q, int n) { for(int i = 0; i> 2 == x; behavior b: ensures e >> 2 == x; */ int f(int x) { int y = 4 * x; /*@ assert y == x << 2; */ e = y; return y; } int main() { f(42); return 0; } frama-c-20.0-Calcium/tests/spec/sizeof.c0000666000000000000000000000014213571573400014747 0ustar /*@ requires i > sizeof(int); @ ensures \result > sizeof(i); @*/ int f(int i) { return i; } frama-c-20.0-Calcium/tests/spec/sizeof_incomplete_bts1538.i0000666000000000000000000000043313571573400020370 0ustar /* run.config STDOPT: +"-kernel-msg-key printer:logic-types" */ int t[]; void main() { int v = sizeof(t); //@ assert v == sizeof(int [10]); // OK //@ assert sizeof(t) == 0; // VALID (Value/WP) but incorrect //@ assert sizeof(t) == sizeof(int [10]); // INVALID } int t[10]; frama-c-20.0-Calcium/tests/spec/sizeof_logic.i0000666000000000000000000000051513571573400016136 0ustar /*@ lemma bad: \forall integer x; sizeof(x) == sizeof(int); */ /*@ lemma bad2: sizeof(integer) == sizeof(int); */ /*@ lemma good: \forall short x; sizeof(x) <= sizeof(int); */ struct S { int f; }; typedef struct S volatile a; /*@ ensures \result == sizeof(struct S volatile); */ int f(int a) { return sizeof(struct S volatile); } frama-c-20.0-Calcium/tests/spec/source_annot.c0000666000000000000000000000325313571573400016155 0ustar /* run.config DONTRUN: static local variables & specifications */ typedef int INTEGER; typedef enum {TRUE=1, FALSE=0} BOOLEAN; #include "prec_i.h" extern INTEGER E1[], S1[]; /* @ // proposition avec requires dans les behaviors requires k >= 0; ensures PREC_I_RE1==E1[k]; behavior COND_prec_C0 : assumes k==0 ; requires PREC_I_RE1 == 0; ensures S1[0] == 0; behavior COND_prec_CN : assumes k >= 1; requires PREC_I_RE1 == E1[k-1]; ensures S1[k]==E1[k-1]; */ /* @ // qui se desucre en: requires k >= 0 && (k==0 ==> PREC_I_RE1 == 0) && (k >= 1 ==> PREC_I_RE1 == E1[k-1]); ensures PREC_I_RE1==E1[k]; behavior COND_prec_C0 : assumes k==0 ; ensures S1[0] == 0; behavior COND_prec_CN : assumes k >= 1; ensures S1[k]==E1[k-1]; */ /*@ // proposition actuelle requires k >= 0; behavior default : ensures PREC_I_RE1==E1[k]; behavior COND_prec_C0 : assumes k==0 && PREC_I_RE1 == 0; ensures S1[0] == 0; behavior COND_prec_CN : assumes k >= 1 && PREC_I_RE1 == E1[k-1]; ensures S1[k]==E1[k-1]; */ void prec(INTEGER k) { PREC_I(0, E1[k], S1[k]); } /*@ requires HYPOTHESE_RAM_0_iter_prec : PREC_I_RE1 == 0 ; */ void iter_prec() { INTEGER k=0; /*@ loop invariant I1_1 : k>=0; loop invariant I1_2 : k==0 ==> PREC_I_RE1==0; loop invariant I1_3 : k>=1 ==> PREC_I_RE1==E1[k-1]; */ while (1) { prec(k); k++; } } #include "conf1.h" extern volatile INTEGER M_Horloge_BR; extern BOOLEAN EB[]; extern BOOLEAN S[]; INTEGER Time_CONF1; void conf1(INTEGER k) { CONF1(0, EB[k], Time_CONF1, S[k]); } void iter_conf1() { INTEGER N=0; while (1) { conf1(N); N++; } } frama-c-20.0-Calcium/tests/spec/spec_zero_arg.c0000666000000000000000000000037013571573400016275 0ustar /* see bug #128 */ int e; /*@ requires e > 0; */ void f(void); // this spec is already lost after type-checking /*@ requires e > 0; */ void g(void); int x; /*@ requires a > 0; */ void i(int a); void i(int b) { x = b; } void h() { f(); g();} frama-c-20.0-Calcium/tests/spec/statement_behavior.c0000666000000000000000000000070013571573400017333 0ustar /* run.config OPT: -eva @EVA_CONFIG@ -inout -journal-disable */ /*@ ensures \result == (int)(5 * x); */ int pfsqopfc(int x) { int five_times; /*@ assigns five_times; ensures five_times == (int)(5 * x); */ asm ("leal (%1,%1,4), %0" : "=r" (five_times) : "r" (x) ); /*@ assert five_times == (int) (5 * x);*/ // valid return five_times; } int main () { int x = 1; int y = pfsqopfc(x); return 0; } frama-c-20.0-Calcium/tests/spec/stmt_contract.i0000666000000000000000000000150213571573400016343 0ustar int main(int c) { int x = 5, y = 2; /*@ requires x == 5; */ /*@ requires y == 2; */ x = x + y; // BTS 1320: \result must be modified to __ret_res, as // assigns also account for abrupt termination //@ assigns \result \from x, y; if (c) { //@ assigns \result \from x; return x; } else { // this loop assigns should be rejected though, as loop assigns // only speak about successful loop steps. //@ loop assigns \result \from y; while (1) { return y; } } // we should also add an assigns __ret_res here, to match the implicit \result //@ assigns x; if (c) { x++; return x; } // END BTS 1320 //@ requires before_label: \true; label: //@ requires after_label: \true; y=8; /*@ requires x == 7; */ /*@ ensures x == 7; */ return 0; } frama-c-20.0-Calcium/tests/spec/string.c0000666000000000000000000000031213571573400014755 0ustar /*@ logic char* foo = "\123tyfoo"; logic unsigned long* bar = (unsigned long*) L"\xabcdt\65ab"; logic char* split = "abc" "def"; */ unsigned long* test = (unsigned long*) L"\xabcdt\65ab"; frama-c-20.0-Calcium/tests/spec/struct_invariant.c0000666000000000000000000000061713571573400017056 0ustar struct T { int ok; int* pt; int tab[10]; } u ; //@ type invariant pt_validity(struct T t) = t.ok ==> \valid(t.pt) ; /*@ type invariant tab_nonnegative(struct T t) = @ \forall int i; 0 <= i && i < 10 ==> t.tab[i] >=0 ; @*/ //@ type invariant strange(struct T t) = t == u ; //@ global invariant u_inv: u.ok == 1; // error: redefined invariant. //@ global invariant u_inv: u.ok <= 1; frama-c-20.0-Calcium/tests/spec/tableau_zones.c0000666000000000000000000000136713571573400016315 0ustar /*@ requires \valid(p); @ assigns *p; @ ensures *p==n; @*/ int f(int *p,int n) { *p = n; return 0; //NdV not sure it is correct, but the return statelent was // missing anyway } int t[10]; /* post-condition should be trivially established * if a separation analysis is able to separate * t[0..4] and t[5..9] */ /*@ ensures t[0]==0; */ int main() { int i; /*@ loop invariant 0 <= i && i <= 5 && @ \forall int j; 0 <= j && j < i ==> t[j]==0; @*/ for(i=0; i<5; i++) { f(t+i,0); } /*@ loop invariant 5 <= i && i <= 10 && @ \forall int j; 5 <= j && j < i ==> t[j]==1; @ loop assigns t[5..9]; // needed when separation analysis too weak @*/ for(i=5; i<10; i++) { f(t+i,1); } return 0; } frama-c-20.0-Calcium/tests/spec/temporal.i0000666000000000000000000003632313571573400015313 0ustar /* Generated by Frama-C */ extern int g_calls ; int g(int x ) ; void h(void) ; extern int random(void) ; extern int NB ; extern int G_i ; enum aorai_States { S5 = 4, S4 = 6, S3 = 5, S2 = 3, S1 = 0, OK = 2, S0 = 1 } ; //**************** //* BEGIN Primitives generated for LTL verification //* //* States and Trans Variables int aorai_CurStates[7] = {1, 0, 0, 0, 0, 0, 0}; int aorai_CurTrans[9] = {1, 0, 0, 0, 0, 0, 0, 0, 0}; int aorai_CurStates_old[7] = {0, 1, 0, 0, 0, 0, 0}; //* //* //* Some constants enum aorai_ListOper { op_g = 2, op_f = 1, op_h = 0 } ; enum aorai_ListOper aorai_CurOperation = op_f; enum aorai_OpStatusList { aorai_Terminated = 1, aorai_Called = 0 } ; enum aorai_OpStatusList aorai_CurOpStatus = aorai_Called; //* //* Loops management int aorai_Loop_Init_38 = 0; //* //**************** //* Axiomatized transitions automata /*@ axiomatic aorai_Trans_Start { logic integer aorai_Trans_Start(integer tr) ; axiom aorai_Trans_Start0: (aorai_Trans_Start(0) == 1); axiom aorai_Trans_Start1: (aorai_Trans_Start(1) == 0); axiom aorai_Trans_Start2: (aorai_Trans_Start(2) == 0); axiom aorai_Trans_Start3: (aorai_Trans_Start(3) == 3); axiom aorai_Trans_Start4: (aorai_Trans_Start(4) == 3); axiom aorai_Trans_Start5: (aorai_Trans_Start(5) == 3); axiom aorai_Trans_Start6: (aorai_Trans_Start(6) == 5); axiom aorai_Trans_Start7: (aorai_Trans_Start(7) == 6); axiom aorai_Trans_Start8: (aorai_Trans_Start(8) == 4); } */ /*@ axiomatic aorai_Trans_Stop { logic integer aorai_Trans_Stop(integer tr) ; axiom aorai_Trans_Stop0: (aorai_Trans_Stop(0) == 0); axiom aorai_Trans_Stop1: (aorai_Trans_Stop(1) == 2); axiom aorai_Trans_Stop2: (aorai_Trans_Stop(2) == 3); axiom aorai_Trans_Stop3: (aorai_Trans_Stop(3) == 0); axiom aorai_Trans_Stop4: (aorai_Trans_Stop(4) == 4); axiom aorai_Trans_Stop5: (aorai_Trans_Stop(5) == 5); axiom aorai_Trans_Stop6: (aorai_Trans_Stop(6) == 6); axiom aorai_Trans_Stop7: (aorai_Trans_Stop(7) == 4); axiom aorai_Trans_Stop8: (aorai_Trans_Stop(8) == 2); } */ /*@ predicate aorai_Trans_Cond_param{L}(integer _aorai_numTrans, integer _aorai_op, integer _aorai_status) = (((_aorai_numTrans == 0) ==> ((_aorai_op == op_f) && (_aorai_status == aorai_Called))) && (((_aorai_numTrans == 1) ==> (((_aorai_op == op_f) && (_aorai_status == aorai_Terminated)) && (NB <= 0))) && (((_aorai_numTrans == 2) ==> (((((_aorai_op == op_g) && (_aorai_status == aorai_Called)) && (NB > 0)) && (g_calls < NB)) && (0 <= g_calls))) && (((_aorai_numTrans == 3) ==> (((G_i == 0) && (g_calls < NB)) && ((_aorai_op == op_g) && (_aorai_status == aorai_Terminated)))) && (((_aorai_numTrans == 4) ==> (((G_i == 0) && (g_calls == NB)) && ((_aorai_op == op_g) && (_aorai_status == aorai_Terminated)))) && (((_aorai_numTrans == 5) ==> ((G_i != 0) && ((_aorai_op == op_g) && (_aorai_status == aorai_Terminated)))) && (((_aorai_numTrans == 6) ==> ((_aorai_op == op_h) && (_aorai_status == aorai_Called))) && (((_aorai_numTrans == 7) ==> ((_aorai_op == op_h) && (_aorai_status == aorai_Terminated))) && ((_aorai_numTrans == 8) ==> ((_aorai_op == op_f) && (_aorai_status == aorai_Terminated))))))))))); */ /*@ predicate aorai_Trans_Cond{L}(integer _aorai_numTrans) = aorai_Trans_Cond_param{L}(_aorai_numTrans, aorai_CurOperation, aorai_CurOpStatus); */ //* //**************** //* Safety invariants //* //* Inv 2.1 : Not crossable transitions (cond = false) are not crossed over /*@ global invariant _Buch_not_crossable_cond: (\forall integer _buch_tr; ((((0 <= _buch_tr) && (_buch_tr < 9)) && !(aorai_Trans_Cond(_buch_tr))) ==> (aorai_CurTrans[_buch_tr] == 0))); */ //* Inv 2.2 : Not crossable transitions (start state not active) are not crossed over /*@ global invariant _Buch_not_crossable_start: (\forall integer _buch_tr; ((((0 <= _buch_tr) && (_buch_tr < 9)) && (aorai_CurStates_old[aorai_Trans_Start (_buch_tr)] == 0)) ==> (aorai_CurTrans[_buch_tr] == 0))); */ //* Inv 4 : Each not reachable state is not reached /*@ global invariant _Buch_not_reachable: (\forall integer _buch_st; ((((0 <= _buch_st) && (_buch_st < 7)) && (\forall integer _buch_tr; (((0 <= _buch_tr) && (_buch_tr < 9)) ==> ((aorai_CurTrans[_buch_tr] == 0) || (aorai_Trans_Stop(_buch_tr) != _buch_st))))) ==> (aorai_CurStates[_buch_st] == 0))); */ //* //* END Primitives generated for LTL verification //**************** /*@ requires ((((((((0 == aorai_CurTrans[0]) && (0 == aorai_CurTrans[1])) && (0 == aorai_CurTrans[3])) && (0 == aorai_CurTrans[4])) && (0 == aorai_CurTrans[5])) && (0 == aorai_CurTrans[6])) && (0 == aorai_CurTrans[7])) && (0 == aorai_CurTrans[8])); requires (0 != aorai_CurTrans[2]); requires ((((((0 == aorai_CurStates[S1]) && (0 == aorai_CurStates[S0])) && (0 == aorai_CurStates[OK])) && (0 == aorai_CurStates[S5])) && (0 == aorai_CurStates[S3])) && (0 == aorai_CurStates[S4])); requires (0 != aorai_CurStates[S2]); requires ((aorai_CurTrans[2] != 0) ==> (((NB > 0) && (g_calls < NB)) && (0 <= g_calls))); behavior Buchi_property_behavior_3: ensures (((aorai_CurTrans[5] != 0) ==> (G_i != 0)) && (((aorai_CurTrans[4] != 0) ==> ((G_i == 0) && (g_calls == NB))) && ((aorai_CurTrans[3] != 0) ==> ((G_i == 0) && (g_calls < NB))))); ensures ((((((0 == aorai_CurTrans[0]) && (0 == aorai_CurTrans[1])) && (0 == aorai_CurTrans[2])) && (0 == aorai_CurTrans[6])) && (0 == aorai_CurTrans[7])) && (0 == aorai_CurTrans[8])); ensures (((0 != aorai_CurTrans[3]) || (0 != aorai_CurTrans[4])) || (0 != aorai_CurTrans[5])); ensures ((((0 == aorai_CurStates[S0]) && (0 == aorai_CurStates[OK])) && (0 == aorai_CurStates[S2])) && (0 == aorai_CurStates[S4])); ensures (((0 != aorai_CurStates[S1]) || (0 != aorai_CurStates[S5])) || (0 != aorai_CurStates[S3])); behavior default: ensures (g_calls == \old(g_calls)+1); assigns g_calls; */ int g(int x ) { int tmp ; g_calls ++; tmp = random(); aorai_CurOperation = op_g; aorai_CurOpStatus = aorai_Terminated; aorai_CurStates_old[S5] = 0; aorai_CurStates_old[S4] = 0; aorai_CurStates_old[S3] = 0; aorai_CurStates_old[S2] = aorai_CurStates[3]; aorai_CurStates_old[S1] = 0; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; aorai_CurTrans[1] = 0; aorai_CurTrans[2] = 0; aorai_CurTrans[3] = (G_i == 0 && g_calls < NB) && aorai_CurStates_old[3]; aorai_CurTrans[4] = (G_i == 0 && g_calls == NB) && aorai_CurStates_old[3]; aorai_CurTrans[5] = G_i != 0 && aorai_CurStates_old[3]; aorai_CurTrans[6] = 0; aorai_CurTrans[7] = 0; aorai_CurTrans[8] = 0; aorai_CurStates[S5] = aorai_CurTrans[4]; aorai_CurStates[S4] = 0; aorai_CurStates[S3] = aorai_CurTrans[5]; aorai_CurStates[S2] = 0; aorai_CurStates[S1] = aorai_CurTrans[3]; aorai_CurStates[OK] = 0; aorai_CurStates[S0] = 0; return (tmp); } /*@ requires ((((((((0 == aorai_CurTrans[0]) && (0 == aorai_CurTrans[1])) && (0 == aorai_CurTrans[2])) && (0 == aorai_CurTrans[3])) && (0 == aorai_CurTrans[4])) && (0 == aorai_CurTrans[5])) && (0 == aorai_CurTrans[7])) && (0 == aorai_CurTrans[8])); requires (0 != aorai_CurTrans[6]); requires ((((((0 == aorai_CurStates[S1]) && (0 == aorai_CurStates[S0])) && (0 == aorai_CurStates[OK])) && (0 == aorai_CurStates[S2])) && (0 == aorai_CurStates[S5])) && (0 == aorai_CurStates[S3])); requires (0 != aorai_CurStates[S4]); behavior Buchi_property_behavior_6: ensures ((((((((0 == aorai_CurTrans[0]) && (0 == aorai_CurTrans[1])) && (0 == aorai_CurTrans[2])) && (0 == aorai_CurTrans[3])) && (0 == aorai_CurTrans[4])) && (0 == aorai_CurTrans[5])) && (0 == aorai_CurTrans[6])) && (0 == aorai_CurTrans[8])); ensures (0 != aorai_CurTrans[7]); ensures ((((((0 == aorai_CurStates[S1]) && (0 == aorai_CurStates[S0])) && (0 == aorai_CurStates[OK])) && (0 == aorai_CurStates[S2])) && (0 == aorai_CurStates[S3])) && (0 == aorai_CurStates[S4])); ensures (0 != aorai_CurStates[S5]); behavior default: assigns \nothing; */ void h(void) { aorai_CurOperation = op_h; aorai_CurOpStatus = aorai_Terminated; aorai_CurStates_old[S5] = 0; aorai_CurStates_old[S4] = aorai_CurStates[6]; aorai_CurStates_old[S3] = 0; aorai_CurStates_old[S2] = 0; aorai_CurStates_old[S1] = 0; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; aorai_CurTrans[1] = 0; aorai_CurTrans[2] = 0; aorai_CurTrans[3] = 0; aorai_CurTrans[4] = 0; aorai_CurTrans[5] = 0; aorai_CurTrans[6] = 0; aorai_CurTrans[7] = aorai_CurStates_old[6]; aorai_CurTrans[8] = 0; aorai_CurStates[S5] = aorai_CurTrans[7]; aorai_CurStates[S4] = 0; aorai_CurStates[S3] = 0; aorai_CurStates[S2] = 0; aorai_CurStates[S1] = 0; aorai_CurStates[OK] = 0; aorai_CurStates[S0] = 0; return; } /*@ requires ((((((((0 == aorai_CurTrans[1]) && (0 == aorai_CurTrans[2])) && (0 == aorai_CurTrans[3])) && (0 == aorai_CurTrans[4])) && (0 == aorai_CurTrans[5])) && (0 == aorai_CurTrans[6])) && (0 == aorai_CurTrans[7])) && (0 == aorai_CurTrans[8])); requires (0 != aorai_CurTrans[0]); requires ((((((0 == aorai_CurStates[S0]) && (0 == aorai_CurStates[OK])) && (0 == aorai_CurStates[S2])) && (0 == aorai_CurStates[S5])) && (0 == aorai_CurStates[S3])) && (0 == aorai_CurStates[S4])); requires (0 != aorai_CurStates[S1]); behavior Buchi_property_behavior_0: ensures ((aorai_CurTrans[1] != 0) ==> (NB <= 0)); ensures (((((((0 == aorai_CurTrans[0]) && (0 == aorai_CurTrans[2])) && (0 == aorai_CurTrans[3])) && (0 == aorai_CurTrans[4])) && (0 == aorai_CurTrans[5])) && (0 == aorai_CurTrans[6])) && (0 == aorai_CurTrans[7])); ensures ((0 != aorai_CurTrans[1]) || (0 != aorai_CurTrans[8])); ensures ((((((0 == aorai_CurStates[S1]) && (0 == aorai_CurStates[S0])) && (0 == aorai_CurStates[S2])) && (0 == aorai_CurStates[S5])) && (0 == aorai_CurStates[S3])) && (0 == aorai_CurStates[S4])); ensures (0 != aorai_CurStates[OK]); */ void f(int N ) { int i ; int t ; i = 0; t = 0; { /*undefined sequence*/ G_i = 0; g_calls = G_i; } NB = N; aorai_Loop_Init_38 = 1; /*@ loop invariant ((((0 != aorai_CurStates[S1]) || (0 != aorai_CurStates[S5])) || (0 != aorai_CurStates[S3])) && (((((0 == aorai_CurStates[S0]) && (0 == aorai_CurStates[OK])) && (0 == aorai_CurStates[S2])) && (0 == aorai_CurStates[S4])) && (((((0 != aorai_CurTrans[0]) || (0 != aorai_CurTrans[3])) || (0 != aorai_CurTrans[4])) || (0 != aorai_CurTrans[5])) && (((((0 == aorai_CurTrans[1]) && (0 == aorai_CurTrans[2])) && (0 == aorai_CurTrans[6])) && (0 == aorai_CurTrans[7])) && (0 == aorai_CurTrans[8]))))); loop invariant ((aorai_Loop_Init_38 != 0) ==> ((aorai_CurStates[4] == 0) && ((aorai_CurStates[5] == 0) && ((aorai_CurTrans[3] == 0) && ((aorai_CurTrans[4] == 0) && (aorai_CurTrans[5] == 0)))))); loop invariant ((aorai_Loop_Init_38 == 0) ==> (aorai_CurTrans[0] == 0)); */ while (1) { if (i < N) { if (! (! t)) { goto while_0_break; } } else { goto while_0_break; } aorai_Loop_Init_38 = 0; aorai_CurOperation = op_g; aorai_CurOpStatus = aorai_Called; aorai_CurStates_old[S5] = 0; aorai_CurStates_old[S4] = 0; aorai_CurStates_old[S3] = 0; aorai_CurStates_old[S2] = 0; aorai_CurStates_old[S1] = aorai_CurStates[0]; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; aorai_CurTrans[1] = 0; aorai_CurTrans[2] = ((NB > 0 && g_calls < NB) && 0 <= g_calls) && aorai_CurStates_old[0]; aorai_CurTrans[3] = 0; aorai_CurTrans[4] = 0; aorai_CurTrans[5] = 0; aorai_CurTrans[6] = 0; aorai_CurTrans[7] = 0; aorai_CurTrans[8] = 0; aorai_CurStates[S5] = 0; aorai_CurStates[S4] = 0; aorai_CurStates[S3] = 0; aorai_CurStates[S2] = aorai_CurTrans[2]; aorai_CurStates[S1] = 0; aorai_CurStates[OK] = 0; aorai_CurStates[S0] = 0; t = g(i); G_i = t; i ++; g_calls = i; } while_0_break: /* internal */ ; if (t) { aorai_CurOperation = op_h; aorai_CurOpStatus = aorai_Called; aorai_CurStates_old[S5] = 0; aorai_CurStates_old[S4] = 0; aorai_CurStates_old[S3] = aorai_CurStates[5]; aorai_CurStates_old[S2] = 0; aorai_CurStates_old[S1] = 0; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; aorai_CurTrans[1] = 0; aorai_CurTrans[2] = 0; aorai_CurTrans[3] = 0; aorai_CurTrans[4] = 0; aorai_CurTrans[5] = 0; aorai_CurTrans[6] = aorai_CurStates_old[5]; aorai_CurTrans[7] = 0; aorai_CurTrans[8] = 0; aorai_CurStates[S5] = 0; aorai_CurStates[S4] = aorai_CurTrans[6]; aorai_CurStates[S3] = 0; aorai_CurStates[S2] = 0; aorai_CurStates[S1] = 0; aorai_CurStates[OK] = 0; aorai_CurStates[S0] = 0; h(); } aorai_CurOperation = op_f; aorai_CurOpStatus = aorai_Terminated; aorai_CurStates_old[S5] = aorai_CurStates[4]; aorai_CurStates_old[S4] = 0; aorai_CurStates_old[S3] = 0; aorai_CurStates_old[S2] = 0; aorai_CurStates_old[S1] = aorai_CurStates[0]; aorai_CurStates_old[OK] = 0; aorai_CurStates_old[S0] = 0; aorai_CurTrans[0] = 0; aorai_CurTrans[1] = NB <= 0 && aorai_CurStates_old[0]; aorai_CurTrans[2] = 0; aorai_CurTrans[3] = 0; aorai_CurTrans[4] = 0; aorai_CurTrans[5] = 0; aorai_CurTrans[6] = 0; aorai_CurTrans[7] = 0; aorai_CurTrans[8] = aorai_CurStates_old[4]; aorai_CurStates[S5] = 0; aorai_CurStates[S4] = 0; aorai_CurStates[S3] = 0; aorai_CurStates[S2] = 0; aorai_CurStates[S1] = 0; aorai_CurStates[OK] = aorai_CurTrans[8] || aorai_CurTrans[1]; aorai_CurStates[S0] = 0; return; } frama-c-20.0-Calcium/tests/spec/terminates.c0000666000000000000000000000011613571573400015624 0ustar /*@ terminates c>0; assigns \nothing; */ void f (int c) { while(!c); return;} frama-c-20.0-Calcium/tests/spec/test_config0000666000000000000000000000046613571573400015544 0ustar COMMENT: for now, this directory mainly tests the annotations syntax, COMMENT: no analysis is performed. COMMENT: we continue on annotation errors, as this allows to put COMMENT: various variations of the same test in one file. OPT: -pp-annot -print -journal-disable -kernel-warn-key=annot-error=active -check frama-c-20.0-Calcium/tests/spec/third.c0000666000000000000000000000030513571573400014563 0ustar /* run.config DONTRUN: linked with first which is the real test. */ /*@ behavior b: requires \valid(third); ensures \result == 0;*/ int bar(int *third) { third=(int*)*third; return 0; } frama-c-20.0-Calcium/tests/spec/transitive_rel.c0000666000000000000000000000056213571573400016510 0ustar /*@ predicate bound(int x, int y, int z) = @ x<=y=y>x ; @*/ /*@ predicate bound2 (int x, int y, int z) = @ x <= y == z ; @*/ // not the same as above, see pr#16 /*@ predicate test(int x, int y, boolean z) = @ (x<=y) == z ; @*/ // sense of inequalities matters /*@ predicate reject(int x, int y, int z, int t) = @ x <= y == z >= t; @*/ frama-c-20.0-Calcium/tests/spec/tsets.c0000666000000000000000000000517413571573400014624 0ustar struct foo { char bar[4]; }; /*@ assigns x->bar[0..3] \from x->bar[0..3]; */ int f(struct foo* x); typedef char baz[4]; struct bli { baz bli; }; /*@ assigns x[0..3] \from y->bli[0..3]; */ int g(baz x,struct bli* y); int main() { struct foo x; baz y; struct bli z; f(&x); g(y,&z); /*@ assert \separated(&x,&y[2]); */ return 0; } /*@ predicate test1(set s1,set s2) = \subset(s1,\union(s2,{k + 1 | int k ; constraint: 0 <= k < 10})); @*/ /*@ predicate test2(set s1,set s2) = \subset(\union({k + 1 | int k ; constraint: 0 <= k < 10},s2),s1); @*/ // should be rejected as set of sets /*@ predicate test3(set s1,set s2) = \subset(\union({\union (k + 1) | int k ; constraint: 0 <= k < 10},s2),s1); @*/ /*@ ensures \subset(\result, \union(x,x+1,x-1)); ensures \result \in \union(x,x+1,x-1); */ int h(int x, int c) { return c>0 ? x+1 : c<0 ? x-1: x; } /*@ requires \valid((\union(a,b))[0..1]);*/ int foo(int **a, int **b) { return 0; } /*@ predicate reject1{L}(char *a) = a[0..1] < 10; */ /*@ predicate reject2{L}(char *a) = a[0..1] > 10; */ /*@ predicate reject3{L}(char *a) = 10 < a[0..1]; */ /*@ predicate reject4{L}(char *a) = 10 > a[0..1]; */ /*@ predicate test_singleton_1(int* a, int x) = x == a[0..1]; */ /*@ predicate test_singleton_2(int *a) = a[0..1] == 1; */ /*@ predicate test_singleton_3(int *a) = a[0..1] == {1}; */ /*@ predicate test_set_of_elem(int *a) = a[0..1] == {1,2}; */ /*@ predicate reject_set_of_sets_1(int *a) = {a[0..1]} == {1}; */ /*@ predicate reject_set_of_sets_2(int *a) = a[0..1] == {\empty}; */ int A[100]; /*@ ensures \subset(\result, &A[0..]) ; ensures \result \in &A[0..] ; */ int *AA(void); //@ logic set Sempty_1 = \empty ; //@ logic set Sempty_2 = { } ; //@ logic set Selems_1 = { 1, (int)2, (int)'3' } ; //@ logic set Sadd_elem_1(set s, integer e) = \union(s,e) ; //@ logic set Sadd_elem_2(set s, integer e) = \union(s,{e}) ; //@ predicate rejected_Smember_and(set s, integer v1, integer v2) = v1 & v2 \in s ; //@ predicate rejected_Smember_or (set s, integer v1, integer v2) = v1 | v2 \in s ; //@ predicate rejected_Smember_and_or (set s, integer v1, integer v2) = v1 & v2 \in s && v1 | v2 \in s ; //@ predicate Smember_and(set s, integer v1, integer v2) = (v1 & v2) \in s ; //@ predicate Smember_or (set s, integer v1, integer v2) = (v1 | v2) \in s ; //@ predicate Smember_and_or (set s, integer v1, integer v2) = (v1 & v2) \in s && (v1 | v2) \in s ; //@ logic set Scomprehension(set s, integer mask ) = { (k | 1) | int k ; (k | mask) \in s }; frama-c-20.0-Calcium/tests/spec/type_constructors_in_env.i0000666000000000000000000000031613571573400020630 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ /*@ type foo = A | B; */ /*@ logic foo f(integer x) = x>=0 ? A : B; */ frama-c-20.0-Calcium/tests/spec/type_constructors_in_env.ml0000666000000000000000000000050413571573400021007 0ustar let run () = Ast.compute (); (match Logic_env.find_all_logic_functions "f" with | [] -> Kernel.fatal "f should be in the environment" | _ -> ()); (try ignore (Logic_env.find_logic_ctor "A") with Not_found -> Kernel.fatal "A should be in the environment"); File.pretty_ast () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/spec/type_of_term.i0000666000000000000000000000044613571573400016161 0ustar /* run.config EXECNOW: make -s tests/spec/Type_of_term.cmxs OPT: -load-module tests/spec/Type_of_term.cmxs -print */ int t [42]; struct S { int x; int y[]; } s; /*@ assigns *(p+(..)), t[..], s[..].x, s[..].y[..]; */ void f(int *p, struct S* s); int main() { f(t,&s); return 0; } frama-c-20.0-Calcium/tests/spec/typedef.c0000666000000000000000000000021613571573400015112 0ustar typedef struct _list { int i; } *list; /*@ requires \valid(p); */ void f(list p) {} /*@ requires \valid(p); */ void g(struct _list* p) {} frama-c-20.0-Calcium/tests/spec/unification.c0000666000000000000000000000054313571573400015765 0ustar typedef struct _list { int element; struct _list* next; } list; /*@ type List = Nil | Cons(A,List); */ /*@ inductive logic_model{L}(list* root, Listlogic_list) { case nil{L}: logic_model(\null,Nil); case cons{L}: \forall list* l1,Listll1; \valid(l1) ==> logic_model(l1->next,ll1) ==> logic_model(l1,Cons(l1->element,ll1)); } */ frama-c-20.0-Calcium/tests/spec/unused.c0000666000000000000000000000057013571573400014760 0ustar /* run.config STDOPT: +"-remove-unused-specified-functions" +"-kernel-msg-key printer:builtins" */ typedef struct { int i; } T; /*@ lemma toto{L}: @ \forall T t; t.i == 0; @*/ extern int G; /*@ global invariant G_const: G == 0; */ static int i; /*@ global invariant invi: i >= 0; */ extern int c; /*@ requires c==0; */ void __attribute__((FC_BUILTIN)) foo(int*); frama-c-20.0-Calcium/tests/spec/updater.c0000666000000000000000000000151213571573400015116 0ustar typedef int a; struct S {int v ; int a[5]; int b;} x = { 1,.b=2 } ; struct SS {struct S a[5]; struct S b;} y; /*@ logic struct S foo(struct S x) = {x \with .b = (int)(x.b+1), .v = (int)3 } ; */ /*@ lemma foo2 : x == {foo(x) \with .b = (int)(x.a[0]+1) } ; */ /*@ lemma bar : {foo(x) \with .a = { \with [..] = (int)0, [3] = (int)3 }} == {foo(x) \with .a[..] = (int)0, .a[3]= (int)3 } ; */ /*@ lemma bar2 : x == {x \with .a = {x.a \with [4] = (int)0 }} ; */ /*@ lemma bar3 : y == {y \with .a[3+1].b = (int)(x.b+1)} ; */ /*@ lemma bar4 : y == {y \with .a[4].a[..] = (int)(x.b+1)} ; */ /*@ lemma bar5 : y == {y \with .a[4] = {\with .a[..] = (int)(x.b+1), .v = (int)3}, .b.v = (int) 4} ; */ /*@ lemma cast : y.a[0].v == ((struct S) y).v ; */ int * f(void) { if (y.a[0].v == ((struct SS) y).b.v) return y.a[0].v ; return x.b ; } frama-c-20.0-Calcium/tests/spec/use.c0000666000000000000000000000022313571573400014244 0ustar /* run.config STDOPT: +"tests/spec/use2.c" */ // BTS 0887 #include "tests/spec/dec.h" //@ ensures X > 0 ; ensures F(1) > 0 ; void f(void) {} frama-c-20.0-Calcium/tests/spec/use2.c0000666000000000000000000000020613571573400014327 0ustar /* run.config DONTRUN: main test is in use.c */ #include "tests/spec/dec.h" //@ ensures X > 0 ; ensures F(1)>0 ; void g(void) {} frama-c-20.0-Calcium/tests/spec/used_before_decl_bts0109.i0000666000000000000000000000023313571573400020112 0ustar int f(); int g () { return f(0) + h(1); } /*@ requires a>=0; assigns \result \from a; */ int f(int a); /*@ ensures \result == b + 1; */ int h(int b); frama-c-20.0-Calcium/tests/spec/volatile.c0000666000000000000000000000104513571573400015272 0ustar /* run.config OPT: tests/spec/volatile_aux.c -print -copy */ #include "tests/spec/volatile.h" //@volatile x,y writes w ; //@volatile y,z reads r writes w; // partially KO: y already has a writes //@volatile x writes w; //KO: already a write function for x //@ volatile y reads r; //KO: already a reads function for x const int c = 1 ; volatile int v ; int * p; //@lemma comp_const_addr: p==&c; //@lemma comp_volatile_addr: p==&v; //@lemma volatile_in_annot_is_illegal: v == 1 ==> v==1; int main () { int x = v; v = f(x); return 0; } frama-c-20.0-Calcium/tests/spec/volatile.h0000666000000000000000000000113013571573400015272 0ustar typedef volatile int VINT; extern int f(int); inline int r(VINT* v) { return *v; } inline int w(volatile int* v, int new) { *v = new; return new; } volatile int v, tab[10]; VINT *pt; struct st { int a ; volatile int v ; } s ; //@ volatile v, tab[..] reads r writes w; //@ volatile *pt writes w; //@ volatile s.v reads r; typedef struct st ST ; struct vst { int b ; ST v ; } vs ; // some parts of vs have volatile qualifier struct vst rs (struct vst * p) ; struct vst ws (struct vst * p, struct vst v) ; //@volatile vs reads rs writes ws ; volatile int x ; volatile int y ; volatile int z; frama-c-20.0-Calcium/tests/spec/volatile_aux.c0000666000000000000000000000021513571573400016145 0ustar /* run.config DONTRUN: main test file is volatile.c */ #include "tests/spec/volatile.h" int f (int x) { x++; v = x; return v+x; } frama-c-20.0-Calcium/tests/syntax/0000777000000000000000000000000013571573400013703 5ustar frama-c-20.0-Calcium/tests/syntax/Enum_repr.ml0000666000000000000000000000110513571573400016166 0ustar open Cil_types let warn_cast = let typeForInsertedCast = !Cabs2cil.typeForInsertedCast in fun e t1 t2 -> Kernel.feedback ~source:(fst e.eloc) "Inserted implicit cast from %a to %a" Printer.pp_typ t1 Printer.pp_typ t2; typeForInsertedCast e t1 t2 let () = Cabs2cil.typeForInsertedCast := warn_cast let run () = let f = Ast.get () in let output = function | GEnumTag(e,_) -> Kernel.feedback "Enum %s is represented by %a@." e.ename Printer.pp_ikind e.ekind | _ -> () in List.iter output f.globals let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/Refresh_visitor.i0000666000000000000000000000156313571573400017237 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs @EVA_OPTIONS@ */ struct S { int i; }; /*@ lemma foo: \forall struct S x; x.i >= 0 || x.i < 0; */ struct matrix { int m[100]; }; /*@ ensures \result >= x.i; */ int main(struct S x, struct matrix m) { int y = x.i; /*@ assert y == x.i; */ int i = 0; int j = 0; struct matrix m_t; /*@ loop assigns i,j; @ loop assigns m_t; @ loop invariant 0 <= i <= 2; @ loop invariant 0 <= j <= 2; */ for(i = 0; i < 2; i++){ /*@ loop assigns j; @ loop assigns m_t; @ loop invariant 0 <= j <= 2; @ loop invariant 0 <= i < 2; */ for(j = 0; j < 2; j++){ m_t.m[i*2+j] = m.m[j*2+i]; } } return y; } frama-c-20.0-Calcium/tests/syntax/Refresh_visitor.ml0000666000000000000000000000456513571573400017424 0ustar open Cil_types open Visitor_behavior let category = Kernel.register_category "refresh-test" module Check(M: Datatype.S_with_collections) = struct let check cat fold bhv = let f o c (orig, copy) = M.Set.add o orig, M.Set.add c copy in let (orig,copy) = fold bhv f (M.Set.empty, M.Set.empty) in let common = M.Set.inter orig copy in if not (M.Set.is_empty common) then begin Format.printf "ids for %s are not properly refreshed.@." cat; end; orig, copy, common end module CheckVarinfo = Check(Cil_datatype.Varinfo) module CheckCompinfo = Check(Cil_datatype.Compinfo) module CheckStmt = Check (Cil_datatype.Stmt) module CheckLogic_var = Check(Cil_datatype.Logic_var) let main () = Ast.compute (); let p = Project.create "p" in let vis = new Visitor.frama_c_refresh p in Format.printf "Start@."; File.init_project_from_visitor p vis; Cil_datatype.( let orig_id, copy_id, shared_id = CheckVarinfo.check "varinfo" Fold.varinfo vis#behavior in if Kernel.is_debug_key_enabled category then begin Varinfo.Set.iter (fun x -> Format.printf "variable id %d (%s) is in orig@." x.vid x.vname) orig_id; Varinfo.Set.iter (fun x -> Format.printf "variable id %d (%s) is in copy@." x.vid x.vname) copy_id; Varinfo.Set.iter (fun x -> Format.printf "variable id %d (%s) is reused@." x.vid x.vname) shared_id; end; let _ = CheckCompinfo.check "compinfo" Fold.compinfo vis#behavior in let _ = CheckStmt.check "stmt" Fold.stmt vis#behavior; in let orig_id, copy_id, shared_id = CheckLogic_var.check "logic var" Fold.logic_var vis#behavior in if Kernel.is_debug_key_enabled category then begin Logic_var.Set.iter (fun x -> Format.printf "logic variable id %d (%s) is in orig@." x.lv_id x.lv_name) orig_id; Logic_var.Set.iter (fun x -> Format.printf "logic variable id %d (%s) is in copy@." x.lv_id x.lv_name) copy_id; Logic_var.Set.iter (fun x -> Format.printf "logic variable id %d (%s) is reused@." x.lv_id x.lv_name) shared_id; end ); Project.on p (fun () -> Dynamic.Parameter.Bool.set "-eva-show-progress" true; !Db.Value.compute () ) (); File.pretty_ast ~prj:p () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/syntax/access_volatile_bts1589.i0000666000000000000000000000025013571573400020411 0ustar volatile int x; int z; typedef volatile int vi; vi y; struct volatile_struct { volatile int a; vi b; int c; } vs; int main(){ x; y; z; vs.a; vs.b; vs.c; } frama-c-20.0-Calcium/tests/syntax/add_allocates.i0000666000000000000000000000064113571573400016635 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print */ int* x; void f(void); //@ allocates x; void g(void); //@ behavior b: requires \false; allocates x; void main(int c) { f(); while (c) { //@ loop allocates x; while (1) { while (!c); } //@ for b: loop allocates x; while (1) { } } } frama-c-20.0-Calcium/tests/syntax/add_allocates.ml0000666000000000000000000000007213571573400017013 0ustar let () = Db.Main.extend Allocates.add_allocates_nothing frama-c-20.0-Calcium/tests/syntax/aggressive_merging_1.i0000666000000000000000000000023413571573400020143 0ustar /* run.config STDOPT: +"@PTEST_DIR@/aggressive_merging_2.i -aggressive-merging" */ static inline void f(void) { return; } void foo (void) { f(); } frama-c-20.0-Calcium/tests/syntax/aggressive_merging_2.i0000666000000000000000000000021213571573400020140 0ustar /* run.config DONTRUN: main test is in aggressive_merging_1.i */ static inline void f(void) { return; } void bar () { f(); } frama-c-20.0-Calcium/tests/syntax/alloc_order.i0000666000000000000000000000007513571573400016344 0ustar /*@ allocates \result; requires i > 0; */ int *f(int i); frama-c-20.0-Calcium/tests/syntax/anon_enum_libc.c0000666000000000000000000000060613571573400017021 0ustar /* run.config FILTER: sed -e 's|#include *"\([^/]*[/]\)*\([^/]*\)"|#include "PTESTS_DIR/\2"|' OPT: -cpp-extra-args="-I @PTEST_DIR@" -ocode @PTEST_DIR@/result/@PTEST_NAME@.c -print -then -ocode="" @PTEST_DIR@/result/@PTEST_NAME@.c -print */ struct { int x; float y; } s1; enum { BLA=4, BLI=12 }; #include "anon_enum_libc.h" int f() { return BLA + s1.x; } int g() { return FOO + s2.t; } frama-c-20.0-Calcium/tests/syntax/anon_enum_libc.h0000666000000000000000000000016413571573400017025 0ustar #include "features.h" __PUSH_FC_STDLIB struct { char z; unsigned long t; } s2; enum { FOO, BAR=3 }; __POP_FC_STDLIB frama-c-20.0-Calcium/tests/syntax/anonymous_comp_init.i0000666000000000000000000000160313571573400020146 0ustar /*run.config STDOPT: #"-c11" */ typedef struct { int f1; struct { int f2; }; int f3; } s1; typedef struct { union { struct { unsigned f1: 1; unsigned f2: 1; unsigned f3: 1; unsigned : 10; unsigned f5: 1; unsigned : 6; }; unsigned i; }; unsigned j; } s2; typedef struct { union { int a; long b; }; } s3; s1 g1 = { .f1 = 1, .f3 = 3 }; s2 g2 = { .f1 = 1, .f2 = 1, .f3 = 0, .f5 = 1, .j = 0 }; s2 g3 = { .f3 = 1, 2, .f1 = 3, 4 }; s2 g4 = { { { .f1 = 0 } } }; s2 g5 = { 1, 2, 3, 4, 5 }; s2 g6 = { { 1, 2, 3, 4}, 5 }; /* According to the braces, the 5 correspond to i instead of j, which cause the 5 to be ignored (too many elements in union) while j has no special value (initialized to 0) */ s2 g7 = { { { {1}, 2, 3, 4}, 5} }; s3 g8 = { { .a = 0 } }; int main() { return g2.f5; } frama-c-20.0-Calcium/tests/syntax/arg_type.i0000666000000000000000000000026513571573400015672 0ustar /* run.config STDOPT: +"-machdep gcc_x86_32" */ // GCC allows such things int f(int); int f(x) short x; { return x; } // but not that int g(int); int g(short x) { return x; } frama-c-20.0-Calcium/tests/syntax/array_cast_bts1099.i0000666000000000000000000000014713571573400017402 0ustar typedef int t[10]; typedef int u[4]; void main () { int tab1[4]; u* p = &tab1; t* p2 = (t) p; } frama-c-20.0-Calcium/tests/syntax/array_size_float.i0000666000000000000000000000006113571573400017407 0ustar int t1[(int)50.1]; int t2[(int)6000000000000.1]; frama-c-20.0-Calcium/tests/syntax/array_static_arg.i0000666000000000000000000000024513571573400017374 0ustar /* run.config DONTRUN: does not work yet. OPT: -print */ //@ requires i > 0 && \valid(a+(i-1)); int f(int i, int t[static i], int a[i]) { return t[i-1] + a[i-1]; } frama-c-20.0-Calcium/tests/syntax/asm_goto.i0000666000000000000000000000057713571573400015676 0ustar /* run.config STDOPT:+"-copy" */ void basic(void) { __asm__ ("xor %eax, %eax\n\t"); } void pretty(void) { __asm__ volatile ("pxor %%""mm7"", %%""mm7""\n\tpcmpeqd %%""mm6"", %%""mm6" : ); } int main(unsigned short bit) { asm goto ("1: jmp %l[t_no]\n" /* skipping size check since replacement size = 0 */ : : "i" (bit) : : t_no); return 1; t_no: return 0; } frama-c-20.0-Calcium/tests/syntax/asm_with_contracts.i0000666000000000000000000000113713571573400017752 0ustar /*@ behavior b: assumes z>=0; ensures \true; */ int f(int z) { int x = z; int y = 2; /*@ assigns y; */ asm ("mov %1, %0\n\t" : "=r" (y) : "r" (x)); /*@ for b: assigns x,y; */ asm ("mov %1, %0\n\t" : "=r" (x) : "r" (y)); /*@ assigns x,y; behavior c: assumes x>=0; ensures y>=0; */ asm ("mov %1, %0\n\t" : "=r" (y) : "r" (x)); return x; } static __inline void insw (unsigned short int __port, void *__addr, unsigned long int __count) { __asm__ __volatile__ ("cld ; rep ; insw":"=D" (__addr), "=c" (__count) :"d" (__port), "0" (__addr), "1" (__count)); } frama-c-20.0-Calcium/tests/syntax/assembly_gmp.c0000666000000000000000000001213113571573400016527 0ustar /* run.config STDOPT: +"-machdep gcc_x86_32" STDOPT: +"-machdep gcc_x86_64" STDOPT: +"-machdep ppc_32" */ /* mpn_mod_1_1p (ap, n, b, cps) Divide (ap,,n) by b. Return the single-limb remainder. Contributed to the GNU project by Torbjorn Granlund and Niels Möller. Based on a suggestion by Peter L. Montgomery. THE FUNCTIONS IN THIS FILE ARE INTERNAL WITH MUTABLE INTERFACES. IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE. Copyright 2008-2011, 2013 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. or both in parallel, as here. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not, see https://www.gnu.org/licenses/. File modified by CEA LIST for inclusion in Frama-C test suite */ /* Define some longlong.h-style macros, but for wider operations. * add_mssaaaa is like longlong.h's add_ssaaaa, but also generates * carry out, in the form of a mask. */ #include "stddef.h" #ifdef __FC_MACHDEP_GCC_X86_32 #define GMP_LIMB_BITS 32 #define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \ __asm__ ( "add %6, %k2\n\t" \ "adc %4, %k1\n\t" \ "sbb %k0, %k0" \ : "=r" (m), "=r" (s1), "=&r" (s0) \ : "1" ((USItype)(a1)), "g" ((USItype)(b1)), \ "%2" ((USItype)(a0)), "g" ((USItype)(b0))) #endif #ifdef __FC_MACHDEP_GCC_X86_64 #define GMP_LIMB_BITS 64 #define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \ __asm__ ( "add %6, %q2\n\t" \ "adc %4, %q1\n\t" \ "sbb %q0, %q0" \ : "=r" (m), "=r" (s1), "=&r" (s0) \ : "1" ((UDItype)(a1)), "rme" ((UDItype)(b1)), \ "%2" ((UDItype)(a0)), "rme" ((UDItype)(b0))) #endif #ifdef __FC_MACHDEP_PPC_32 #define GMP_LIMB_BITS 32 #define add_mssaaaa(m, s1, s0, a1, a0, b1, b0) \ __asm__ ( "add%I6c %2, %5, %6\n\t" \ "adde %1, %3, %4\n\t" \ "subfe %0, %0, %0\n\t" \ "nor %0, %0, %0" \ : "=r" (m), "=r" (s1), "=&r" (s0) \ : "r" (a1), "r" (b1), "%r" (a0), "rI" (b0)) #endif #ifndef add_mssaaaa #error "This test must run with machdep equals to x86_32, x86_64 or ppc_32" #endif #define umul_ppmm(ph, pl, m0, m1) \ do { \ UDItype __m0 = (m0), __m1 = (m1); \ __asm__ ("umulh %r1,%2,%0" \ : "=r" (ph) \ : "%rJ" (m0), "rI" (m1)); \ (pl) = __m0 * __m1; \ } while (0) // CEA: we do not attempt to carry any meaning with those stubs, we're // just interested in checking the generation of assigns contracts. typedef long mp_limb_t; typedef unsigned long UDItype; typedef long* mp_srcptr; typedef size_t mp_size_t; void mpn_mod_1_1p_cps (mp_limb_t cps[4], mp_limb_t b); void ADDC_LIMB(mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t); void udiv_rnnd_preinv (mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t); #define LIKELY(x) x mp_limb_t mpn_mod_1_1p (mp_srcptr ap, mp_size_t n, mp_limb_t b, const mp_limb_t bmodb[4]) { int cnt; mp_limb_t bi; mp_limb_t r0, r1; mp_limb_t r; r0 = ap[n-2]; r1 = ap[n-1]; if (n > 2) { mp_limb_t B2modb, B2mb; mp_limb_t p0, p1; mp_limb_t r2; mp_size_t j; B2modb = bmodb[3]; B2mb = B2modb - b; umul_ppmm (p1, p0, r1, B2modb); add_mssaaaa (r2, r1, r0, r0, ap[n-3], p1, p0); for (j = n-4; j >= 0; j--) { mp_limb_t cy; /* mp_limb_t t = r0 + B2mb; */ umul_ppmm (p1, p0, r1, B2modb); ADDC_LIMB (cy, r0, r0, r2 & B2modb); /* Alternative, for cmov: if (cy) r0 = t; */ r0 -= (-cy) & b; add_mssaaaa (r2, r1, r0, r0, ap[j], p1, p0); } r1 -= (r2 & b); } cnt = bmodb[1]; if (LIKELY (cnt != 0)) { mp_limb_t t; mp_limb_t B1modb = bmodb[2]; umul_ppmm (r1, t, r1, B1modb); r0 += t; r1 += (r0 < t); /* Normalize */ r1 = (r1 << cnt) | (r0 >> (GMP_LIMB_BITS - cnt)); r0 <<= cnt; /* NOTE: Might get r1 == b here, but udiv_rnnd_preinv allows that. */ } else { mp_limb_t mask = -(mp_limb_t) (r1 >= b); r1 -= mask & b; } bi = bmodb[0]; udiv_rnnd_preinv (r, r1, r0, b, bi); return r >> cnt; } int loc[10]; void f(void) { unsigned long ulValue; unsigned long* pulValue = &ulValue; asm("sidt %0\n" : :"m"(loc)); asm ("movq $36, (%0)": : "r"(pulValue)); int a = 2, b = 3; __asm__("mov %1, %0" : "=r"(a) :"r"(b): "%""eax"); } frama-c-20.0-Calcium/tests/syntax/ast_init.i0000666000000000000000000000027513571573400015673 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int f(int x) { return x; } int g(int x) { return x; } frama-c-20.0-Calcium/tests/syntax/ast_init.ml0000666000000000000000000000067613571573400016060 0ustar open Cil_types let apply _ = let f = Globals.Functions.find_by_name "f" in let s = Kernel_function.find_first_stmt f in let l = Kernel_function.find_all_enclosing_blocks s in List.iter (fun b -> b.bstmts <- Cil.mkStmtOneInstr (Skip (Cil_datatype.Stmt.loc s)) :: b.bstmts) l; Ast.mark_as_grown () let () = Ast.apply_after_computed apply let run () = Ast.compute (); File.pretty_ast () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/attributes-declarations-definitions.c0000666000000000000000000000232213571573400023213 0ustar //@ requires p1 >= 1; int __attribute__((tret1)) f(int __attribute__((arg1)) p1) __attribute__((f1)); //@ requires p2 >= 1; // identical to previous contract int __attribute__((tret2)) f(int __attribute__((arg2)) const volatile p2) __attribute__((f2)); //@ requires p3 >= 3; int __attribute__((tret3)) f(int __attribute__((arg3)) const p3) // note: GCC forbids declaring function attributes in function definitions, // so we cannot add '__attribute__((f3))' here { return p3; } //@ requires p4 >= 4; int __attribute__((tret4)) f(int __attribute__((arg4)) volatile p4) __attribute__((f4)); int __attribute__((tret5)) f() __attribute__((f5)); typedef int __attribute__((a1)) aint; aint g(); aint g(const aint i1); volatile aint g(volatile aint i2); aint g(int __attribute__((a2)) i3) { return i3; } typedef int __attribute__((p1))* __attribute__((p2)) iptr; iptr volatile h(const iptr ip1); iptr const h(); iptr h(volatile iptr ip2) { return 0; } iptr volatile h(const iptr ip3); void test(void) { int a, __attribute__((unused)) b; } int __attribute__((o)) one_letter_attribute; int __attribute__((_n)) one_letter_attribute_with_underscore; int __attribute__((e_)) one_letter_attribute_with_underscore_after; frama-c-20.0-Calcium/tests/syntax/axiomatic_nested.i0000666000000000000000000000020313571573400017370 0ustar /*@ axiomatic bla1 { // nested axiomatics are not allowed axiomatic bla2 { predicate bla3{L}(int n); } } */ frama-c-20.0-Calcium/tests/syntax/bad_return_bts_599.i0000666000000000000000000000025313571573400017460 0ustar int BadReturn1(int* p) { *p++; return; } int BadReturn2(int* p) { *p++; return; } int main() { int i = 3; BadReturn2(&i); BadReturn1(&i); return 0; } frama-c-20.0-Calcium/tests/syntax/basic_asm.i0000666000000000000000000000035413571573400016000 0ustar int main(unsigned short bit) { // Extended asm, should have its assigns clause generated asm ("1: jmp %l[t_no]\n":); // Basic asm, should not have any assigns clause generated asm ("2: nop\n"); return 1; t_no: return 0; } frama-c-20.0-Calcium/tests/syntax/bts0323-2.c0000666000000000000000000000015113571573400015303 0ustar /* run.config DONTRUN: main test is in bts0323.c */ #include "bts0323.h" int x = 1; void g() { x =2;} frama-c-20.0-Calcium/tests/syntax/bts0323.c0000666000000000000000000000014113571573400015143 0ustar /* run.config STDOPT: +"tests/syntax/bts0323-2.c" */ #include "bts0323.h" void f() { x = 0; } frama-c-20.0-Calcium/tests/syntax/bts0323.h0000666000000000000000000000006613571573400015156 0ustar extern int x; /*@ ensures x!=0; */ extern void g(); frama-c-20.0-Calcium/tests/syntax/bts0442-2.i0000666000000000000000000000015413571573400015316 0ustar /* run.config STDOPT: +"tests/syntax/bts0442.i" */ enum E { E0=0, E1=1} ve1=E1; void f (void) { ve1=E0; } frama-c-20.0-Calcium/tests/syntax/bts0442.i0000666000000000000000000000012213571573400015152 0ustar /* run.config STDOPT: +"tests/syntax/bts0442-2.i" */ enum E { E1=1, E2=2} ve2=E2; frama-c-20.0-Calcium/tests/syntax/bts0519.c0000666000000000000000000000043713571573400015162 0ustar /* run.config STDOPT: +"-cpp-command='gcc -C -E -I.'" +"-cpp-frama-c-compliant" STDOPT: +"-cpp-command='gcc -C -E -I. -DERR'" +"-cpp-frama-c-compliant" */ int t[4]; #ifdef ERR int q[static 3]; #endif void f(int a[static 3]) { a[2] = 3; } int main () { f(t); return 0; } frama-c-20.0-Calcium/tests/syntax/bts0577.i0000666000000000000000000000015013571573400015164 0ustar typedef enum { E1_a, E1_b, E1_c } E1; typedef enum { E2_a = E1_a, E2_b } E2; int f (E2 e) { return e; } frama-c-20.0-Calcium/tests/syntax/bts0588.i0000666000000000000000000000016513571573400015174 0ustar //@ requires x>=0; void g(int x); void g(int a) { return; } void f(int a){ a=1;} //@ ensures x>0; void f(int x); frama-c-20.0-Calcium/tests/syntax/bts0672_link.c0000666000000000000000000000060013571573400016167 0ustar /* run.config STDOPT: +"tests/syntax/bts0672_link_2.c" STDOPT: +"tests/syntax/bts0672_link_2.c" +"-cpp-extra-args='-DPROTO'" */ int Frama_C_entropy_source; //@ predicate foo(integer x) = \true; /*@ ensures foo(\result); assigns \result \from a,b,Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ int Frama_C_nondet(int a, int b); frama-c-20.0-Calcium/tests/syntax/bts0672_link_2.c0000666000000000000000000000024713571573400016417 0ustar /* run.config DONTRUN: main test is in bts0672_link.c */ #ifdef PROTO int Frama_C_nondet(int a, int b); #endif void main () { int x = Frama_C_nondet(0,59); } frama-c-20.0-Calcium/tests/syntax/bts0769.i0000666000000000000000000000021113571573400015165 0ustar /*run.config STDOPT: #"-c11" */ struct s { struct {int ui;} _; union foo { int ii; }; } S; int main(){ return S._.ui + S.ii; } frama-c-20.0-Calcium/tests/syntax/bts0916.i0000666000000000000000000000055313571573400015170 0ustar /* run.config STDOPT: +"-keep-comments" */ /* Use frama-c with option -keep-comments */ void main() { int port=10; while (port-->0) // ( port & 0x80 ) == 0 ) { ; /* wait for pin1 - Compliant*/ /* wait for pin2 */ ; /* Not compliant/*, comment before ; */ ;/* wait for pin3 - Not compliant, no white-space char after ; */ } } frama-c-20.0-Calcium/tests/syntax/bts1553.i0000666000000000000000000000033113571573400015160 0ustar /* This file is also parse together with bts1553_2.i */ struct a { int b; }; struct a *d[] = {&(struct a){1}}; struct a *tmp[] = {&(struct a){5}}; int wibble(void) { return 1; } struct a *e[] = {&(struct a){2}}; frama-c-20.0-Calcium/tests/syntax/bts1553_2.i0000666000000000000000000000051313571573400015403 0ustar /* run.config STDOPT: +"tests/syntax/bts1553.i -kernel-msg-key file -kernel-msg-key=-file:transformation" COMMENT: this file is also parsed together with bts1553.i */ struct a { int b; }; extern struct a *d[] = {&(struct a){1}}; extern struct a *e[] = {&(struct a){2}}; void foo(int c) { struct a* *p = c ? d :e; } frama-c-20.0-Calcium/tests/syntax/bts59.i0000666000000000000000000000015213571573400015021 0ustar float g() { double __retres=2; int first = 6; { int first = 5 ; return __retres; } } frama-c-20.0-Calcium/tests/syntax/built.i0000666000000000000000000000506113571573400015176 0ustar /* run.config STDOPT: +"-machdep gcc_x86_32" */ extern __attribute__((const, noreturn)) int ____ilog2_NaN(void); static inline __attribute__((no_instrument_function)) __attribute__((const)) int __ilog2_u32(int n); static inline __attribute__((no_instrument_function)) __attribute__((const)) int __ilog2_u64(long n); char ___assert_task_state[1 - 2*!!( sizeof("RSDTtZXxKWP")-1 != ( __builtin_constant_p(1024) ? ( (1024) < 1 ? ____ilog2_NaN() : (1024) & (1ULL << 63) ? 63 : (1024) & (1ULL << 62) ? 62 : (1024) & (1ULL << 61) ? 61 : (1024) & (1ULL << 60) ? 60 : (1024) & (1ULL << 59) ? 59 : (1024) & (1ULL << 58) ? 58 : (1024) & (1ULL << 57) ? 57 : (1024) & (1ULL << 56) ? 56 : (1024) & (1ULL << 55) ? 55 : (1024) & (1ULL << 54) ? 54 : (1024) & (1ULL << 53) ? 53 : (1024) & (1ULL << 52) ? 52 : (1024) & (1ULL << 51) ? 51 : (1024) & (1ULL << 50) ? 50 : (1024) & (1ULL << 49) ? 49 : (1024) & (1ULL << 48) ? 48 : (1024) & (1ULL << 47) ? 47 : (1024) & (1ULL << 46) ? 46 : (1024) & (1ULL << 45) ? 45 : (1024) & (1ULL << 44) ? 44 : (1024) & (1ULL << 43) ? 43 : (1024) & (1ULL << 42) ? 42 : (1024) & (1ULL << 41) ? 41 : (1024) & (1ULL << 40) ? 40 : (1024) & (1ULL << 39) ? 39 : (1024) & (1ULL << 38) ? 38 : (1024) & (1ULL << 37) ? 37 : (1024) & (1ULL << 36) ? 36 : (1024) & (1ULL << 35) ? 35 : (1024) & (1ULL << 34) ? 34 : (1024) & (1ULL << 33) ? 33 : (1024) & (1ULL << 32) ? 32 : (1024) & (1ULL << 31) ? 31 : (1024) & (1ULL << 30) ? 30 : (1024) & (1ULL << 29) ? 29 : (1024) & (1ULL << 28) ? 28 : (1024) & (1ULL << 27) ? 27 : (1024) & (1ULL << 26) ? 26 : (1024) & (1ULL << 25) ? 25 : (1024) & (1ULL << 24) ? 24 : (1024) & (1ULL << 23) ? 23 : (1024) & (1ULL << 22) ? 22 : (1024) & (1ULL << 21) ? 21 : (1024) & (1ULL << 20) ? 20 : (1024) & (1ULL << 19) ? 19 : (1024) & (1ULL << 18) ? 18 : (1024) & (1ULL << 17) ? 17 : (1024) & (1ULL << 16) ? 16 : (1024) & (1ULL << 15) ? 15 : (1024) & (1ULL << 14) ? 14 : (1024) & (1ULL << 13) ? 13 : (1024) & (1ULL << 12) ? 12 : (1024) & (1ULL << 11) ? 11 : (1024) & (1ULL << 10) ? 10 : (1024) & (1ULL << 9) ? 9 : (1024) & (1ULL << 8) ? 8 : (1024) & (1ULL << 7) ? 7 : (1024) & (1ULL << 6) ? 6 : (1024) & (1ULL << 5) ? 5 : (1024) & (1ULL << 4) ? 4 : (1024) & (1ULL << 3) ? 3 : (1024) & (1ULL << 2) ? 2 : (1024) & (1ULL << 1) ? 1 : (1024) & (1ULL << 0) ? 0 : ____ilog2_NaN() ) : (sizeof(1024) <= 4) ? __ilog2_u32(1024) : __ilog2_u64(1024) )+1)]; int X; void main(int z) { switch(sizeof(z)) { case 1: X++; break; case 2: ___assert_task_state[0]=1;break; case -1: ++X;break; } } int T[__builtin_types_compatible_p(int,int)+__builtin_types_compatible_p(int,float)]; frama-c-20.0-Calcium/tests/syntax/builtin_constant_p.i0000666000000000000000000000015513571573400017754 0ustar int __builtin_constant_p(int a) { return a; } void main() { __builtin_constant_p(1==1 && 1 || (1 & 1)); } frama-c-20.0-Calcium/tests/syntax/cert-dcl-36.c0000666000000000000000000000107713571573400015777 0ustar int i1 = 10; /* Definition, external linkage */ static int i2 = 20; /* Definition, internal linkage */ extern int i3 = 30; /* Definition, external linkage */ int i4; /* Tentative definition, external linkage */ static int i5; /* Tentative definition, internal linkage */ int i1; /* Valid tentative definition */ int i2; /* Undefined, linkage disagreement with previous */ int i3; /* Valid tentative definition */ int i4; /* Valid tentative definition */ int i5; /* Undefined, linkage disagreement with previous */ int main(void) { /* ... */ return i1 + i2 + i3 + i4 + i5; } frama-c-20.0-Calcium/tests/syntax/cert_exp10.c0000666000000000000000000000036313571573400016023 0ustar /* run.config COMMENT: unspecified sequences STDOPT: +"-kernel-warn-key=CERT:EXP:10" */ extern int f(int); int main(void) { int i = 3 ; int z = 3 ; int m1 = f(1); int m2 = f(2) + f(3); z = ( i > 0 ) ? ++i : i; return 0; } frama-c-20.0-Calcium/tests/syntax/cert_exp46.i0000666000000000000000000000142413571573400016041 0ustar extern int f(void); extern int g(void); int non_compliant_1() { if (!f() & g() == 0) return 1; else return 0; } int non_compliant_2() { int x = f(); int y = g(); if ((x++ == 0)| (y-- == 0)) return 1; else return 0; } int non_compliant_3() { _Bool b = f(); _Bool c = g(); if (b ^ c) return 1; else return 0; } int compliant_1() { if (!f() && g() == 0) return 1; else return 0; } int compliant_2() { int x = f(); int y = g(); if (x++ == 0 || y-- == 0) return 1; else return 0; } int compliant_3 () { _Bool b = f(); _Bool c = g(); if ((b || c) && !(b && c)) return 1; else return 0; } int compliant_4() { _Bool b = f(); _Bool c = g(); // Parenthesized expression indicates that bitwise operand is intended. if ((b ^ c)) return 1; else return 0; } frama-c-20.0-Calcium/tests/syntax/cert_msc_38.c0000666000000000000000000000230313571573400016156 0ustar /* run.config STDOPT: +"-cpp-extra-args='-DTEST_ASSERT'" STDOPT: +"-cpp-extra-args='-DTEST_ERRNO'" STDOPT: +"-cpp-extra-args='-DTEST_MATHERRHANDLING'" STDOPT: +"-cpp-extra-args='-DTEST_VASTART'" STDOPT: +"-cpp-extra-args='-DTEST_VACOPY'" STDOPT: +"-cpp-extra-args='-DTEST_VAARG'" STDOPT: +"-cpp-extra-args='-DTEST_VAEND'" STDOPT: +"-cpp-extra-args='-DTEST_SETJMP'" */ #include #include #include #ifdef TEST_ASSERT typedef void (*handler_type)(int); void execute_handler(handler_type handler, int value) { handler(value); } void func(int e) { // error: assert must be a macro, not a function execute_handler(&(assert), e < 0); } #endif #ifdef TEST_ERRNO // error: errno must be a macro extern int errno; #endif #ifdef TEST_MATHERRHANDLING // error math_errhandling must be a macro extern int math_errhandling; #endif // error: can't suppress va_* macros #ifdef TEST_VASTART void *(*test1)() = &(va_start); #endif #ifdef TEST_VACOPY void (*test2)() = &(va_copy); #endif #ifdef TEST_VAARG void* (*test3)() = &(va_arg); #endif #ifdef TEST_VAEND void (*test4)() = &(va_end); #endif // error can't suppress setjmp macro #ifdef TEST_SETJMP int (*test5)() = &(setjmp); #endif frama-c-20.0-Calcium/tests/syntax/char_is_unsigned.i0000666000000000000000000000037413571573400017365 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/machdep_char_unsigned.cmxs OPT:-print -load-module @PTEST_DIR@/machdep_char_unsigned -machdep unsigned_char -then -constfold -rte */ char t[10]; void main() { int r = (t[0] == 'a'); char c = 455; } frama-c-20.0-Calcium/tests/syntax/check_builtin_bts1440.i0000666000000000000000000000042213571573400020037 0ustar /* run.config STDOPT: +"-machdep gcc_x86_32 -kernel-debug 1 -kernel-msg-key file -kernel-msg-key=-file:transformation" */ /*@ ensures \result >= i; @ ensures \result >= j; @ ensures \result == i || \result == j; @*/ int max(int i, int j) { return (i>=j) ? i : j; } frama-c-20.0-Calcium/tests/syntax/clone_test.i0000666000000000000000000000040713571573400016215 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ /*@ requires -3 <= c <= 4; ensures \result >= c; */ int f(int c) { if (c>0) return c; //@ assert c <= 0; return 0; } frama-c-20.0-Calcium/tests/syntax/clone_test.ml0000666000000000000000000000032213571573400016371 0ustar let run () = Ast.compute (); let f = Globals.Functions.find_by_name "f" in let _ = Clone.clone_defined_kernel_function f in File.pretty_ast(); Filecheck.check_ast "clone" let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/composite-tags.i0000666000000000000000000000024313571573400017012 0ustar struct s1 { int a; }; struct s2 { int a; }; int f (struct s1); int f (struct s2); union u1 { int a; }; union u2 { int a; }; int g (union u1); int g (union u2); frama-c-20.0-Calcium/tests/syntax/compound-literal.i0000666000000000000000000000021713571573400017333 0ustar typedef struct { unsigned foo; } Foo; extern void process(int, Foo); void foo(int dummy) { process(dummy++, (Foo) {.foo = 0}); } frama-c-20.0-Calcium/tests/syntax/const-assignments.c0000666000000000000000000000254713571573400017536 0ustar /* run.config STDOPT: STDOPT: +" -cpp-extra-args=-DT0" STDOPT: +" -cpp-extra-args=-DT1" STDOPT: +" -cpp-extra-args=-DT2" STDOPT: +" -cpp-extra-args=-DT3" STDOPT: +" -cpp-extra-args=-DT4" STDOPT: +" -cpp-extra-args=-DT5" STDOPT: +" -cpp-extra-args=-DT6" STDOPT: +" -cpp-extra-args=-DT7" STDOPT: +" -cpp-extra-args=-DT8" */ /* The first run is correct. The others should fail, as they include invalid assignments to const lvalues. */ const int x = 1; #ifdef T0 void f() { x = 42; } #endif #ifdef T1 void f() { x++; } #endif #ifdef T2 void f() { --x; } #endif #ifdef T3 void f() { x += 3; } #endif #ifdef T4 void f() { const int x = 2; x *= 2; } #endif #ifdef T5 void f(const int* x) { *x = 1; } #endif extern void g(int *p); #ifdef T6 void f() { g(&x); } #endif #ifdef T7 void f(const int* x) { g(x); } #endif void h(const int* x) { int* y = (int *)x; *y = 1; g(y); } typedef struct { __attribute__((__fc_mutable)) int x; const int y; } S; void build_S( __attribute__((__fc_initialized_object)) const S* s, int x, int y) { s->x = x; s->y=y; } void mutable_test(const S* s) { s->x = 42; s->x++; s->x += 2; } #ifdef T8 typedef struct { __attribute__((__fc_mutable)) S s; } T; void mutable_test_ko(const T* t) { t->s.y = 32; // KO: although t->s could be modified, t->s.y is still const } #endif frama-c-20.0-Calcium/tests/syntax/constfold.i0000666000000000000000000000033413571573400016050 0ustar typedef struct { int a; } st; enum { PAD = 2 }; int main() { char a[sizeof(st) >= PAD ? 1 : PAD] = {0}; int i = (signed char)256 ? 42 : 36; // UB prior simplification. int j = (unsigned char)256 ? 42 : 36; } frama-c-20.0-Calcium/tests/syntax/copy_logic.i0000666000000000000000000000051213571573400016202 0ustar /* run.config STDOPT: +"-copy" +"-eva" */ /*@ predicate p(int x); */ /*@ predicate q(int x) = x == 42; */ /*@ logic int f (int y); */ /*@ logic integer g (int x) = x + 42; */ /*@ frees x; */ void f(int *x); int main (int x) { int y = 42; /*@ assert q(y) && p(x); */ y+=x; /*@ assert g(x) == f(y); */ return 0; } frama-c-20.0-Calcium/tests/syntax/copy_visitor.i0000666000000000000000000000053413571573400016610 0ustar /* run.config STDOPT: +"-copy -eva @EVA_CONFIG@" */ struct S { int a; int b; }; struct S s = {.a = 1, .b=2}; /*@ requires \valid(s); assigns s->a; */ int f(struct S* s){ s->a=2; return s->b; } /*@ assigns s.a; */ int main () { s.a = 2; /*@ assert s.a == 2; */ f(&s); return 0; } int g(int x); int g(int x) { return 0; } frama-c-20.0-Calcium/tests/syntax/copy_visitor_bts_1073.c0000666000000000000000000000103313571573400020117 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@_bis.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@_bis -test -then-on filtered -print */ #include "stdio.h" int f(int x); int f(int x) { return x; } int g(int y) { return f(2*y); } int main (int argc, char * argv[]) { int i; printf ("Hello !\n"); for (i = 0; i < argc; i++) printf ("arg %d : %s\n", i, argv[i]); printf ("Found %d arguments\n", i - 1); return 0; } frama-c-20.0-Calcium/tests/syntax/copy_visitor_bts_1073.ml0000666000000000000000000000202613571573400020310 0ustar open Cil_types open Cil class vis prj = object(self) inherit Visitor.frama_c_refresh prj method! vglob_aux g = match g with | GFun (f,loc) -> let my_kf = Extlib.the self#current_kf in let f1 = Visitor.visitFramacFunction (self:>Visitor.frama_c_visitor) f in let v2 = Cil.copyVarinfo f.svar (f.svar.vname ^ "1") in let orig = Visitor_behavior.Get_orig.varinfo self#behavior f.svar in Visitor_behavior.Set.varinfo self#behavior orig v2; Visitor_behavior.Set_orig.varinfo self#behavior v2 orig; Visitor_behavior.Reset.fundec self#behavior; Visitor_behavior.Reset.stmt self#behavior; let f2 = Visitor.visitFramacFunction (self:>Visitor.frama_c_visitor) f in f2.svar <- v2; self#set_current_kf my_kf; ChangeTo ([GFun(f1,loc); GFun(f2,loc)]) | _ -> DoChildren end let run () = let prj = File.create_project_from_visitor "prj" (fun prj -> new vis prj) in File.pretty_ast ~prj () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/copy_visitor_bts_1073_bis.ml0000666000000000000000000000361313571573400021150 0ustar (*============================================================================*) module P = Plugin.Register (struct let name = "Testing plugin" let shortname = "test" let help = "Just to test Filter..." end) module Opt = P.False (struct let option_name = "-test" let help = "switch the plug-in on" end) (*============================================================================*) module Visi = struct exception EraseAssigns exception EraseAllocation type fct = unit type proj = unit let fct_name vf _fi = vf.Cil_types.vname let fct_info () _ = [ () ] let param_visible _ _ = true let body_visible _fi = true let loc_var_visible _ _ = true let inst_visible _ _ = true let label_visible _ _ _ = true let annotation_visible _ _ _ = true let fun_precond_visible _ _ = true let fun_postcond_visible _ _ = true let fun_variant_visible _ _ = true let fun_frees_visible _ _ = true let fun_allocates_visible _ _ = true let fun_assign_visible _ _ = true let fun_deps_visible _ _ = true let called_info _ _ = None let res_call_visible _ _ = true let result_visible _ _ = true let cond_edge_visible _ _ = true, true end (*============================================================================*) let main () = if Opt.get () then begin let _ast = Ast.get () in P.feedback "start compute"; let new_proj_name = "filtered" in let module Transform = Filter.F (Visi) in let new_prj = Transform.build_cil_file new_proj_name () in Project.on new_prj Opt.clear (); P.feedback "exported in new project : %s" new_proj_name end let () = Db.Main.extend main (*============================================================================*) frama-c-20.0-Calcium/tests/syntax/cpp-command.c0000666000000000000000000000103313571573400016242 0ustar /* run.config* FILTER: sed 's|/tmp/[^ ]*\.i|/tmp/FILE.i|g' OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo ['%1' '%1' '%i' '%input'] ['%2' '%2' '%o' '%output'] ['%args']" OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo %%1 = '%1' %%2 = '%2' %%args = '%args'" OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "printf "%s" 'using \\% has no effect : \%input'" OPT: -no-autoload-plugins -cpp-frama-c-compliant -cpp-command "echo %var is not an interpreted placeholder" */frama-c-20.0-Calcium/tests/syntax/dangerous_expressions.i0000666000000000000000000000041613571573400020507 0ustar struct s { int *a; }; struct { struct s s1[3]; struct s s2; } ss; int f (int t[10] , int n, int *ptr) { if (t[n]); if (*ptr); return 65 ; } int main (void) { int *p=0; if (*p); ss.s2.a; // not dangerous, remove ss.s1[2].a; // maybe dangerous, keep return 0 ; } frama-c-20.0-Calcium/tests/syntax/dangling_else.i0000666000000000000000000000066513571573400016657 0ustar /*@ requires x >= 0; */ int g(int x); void main() { int c, x; if (c) { { if (c) { x = 1; };} } else { if (c) { if (c) x = 1; } else x = 2; } } int f(int a, int b, int c, int d) { int ret; ret=0; if (a) { if (b) {ret=1;} else if (c) {ret=2;} } else {if (d) {ret=4;}} if (a) {{{{/*@ assert ret >= 0; */ ret = 5; }}}} else ret = 6; if (a) g(a); else g(a); // double GUI-bullets return ret; } frama-c-20.0-Calcium/tests/syntax/dangling_reference_bts1475.i0000666000000000000000000000013513571573400021046 0ustar /*@ requires \valid(f5); */ static char F4(int *f5); int foo() { int x; F4(&x); return 0; } frama-c-20.0-Calcium/tests/syntax/decay.i0000666000000000000000000000107713571573400015147 0ustar struct P { int val[2][2]; }; void multi_dim_array_decay() { // BTS 1142 struct P* pp; struct P p; pp = &p; *(pp->val); *(p.val); } char t[8]; struct { int A[sizeof(t)]; int i; } A = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; //Size of the array is 8 struct { int A[sizeof(0, t)]; int i; } S = {1, 2, 3, 4, 5}; // Size of the array is sizeof(char *), not sizeof(t), because in this case there is a decay; BTS 1774 struct { int A[sizeof(&t[0])]; int i; } V = {1, 2, 3, 4, 5}; // Size of the array is again sizeof(char*), not sizeof(t). Note 5077 in bts 1774 frama-c-20.0-Calcium/tests/syntax/decl-function.i0000666000000000000000000000073513571573400016614 0ustar /* run.config COMMENT: test the use of (==) in Ast.is_def_or_last_decl OPT: -then -print -no-unicode */ int x; void (*pf)(void); extern void f_undefined (void) ; void g (void) { f_undefined() ; //@ assert fcs_limitation: pf==&f_undefined; } //@ logic integer foo (integer y) = y; /*@ requires fcs_limitation: pf==&f_undefined; @ ensures x == foo (x); */ extern void f_undefined (void) ; void main (void) { pf=&f_undefined; f_undefined() ; f_undefined() ; } frama-c-20.0-Calcium/tests/syntax/define_string_logic_pp_bts2101.c0000666000000000000000000000052013571573400021714 0ustar #define STR "to/*to" #define FOO "to\ to" #define BAR 'to\ toblublihyu' /*@ predicate p(char * x) = x[0] == 't'; */ int main(void) { const char c[] = STR; const char d[] = FOO; const char e = BAR; /*@ assert p(STR) && p(FOO); */ /*@ assert (char)BAR == 'u'; */ return c[sizeof(c)-1]; } frama-c-20.0-Calcium/tests/syntax/designated_init_pretty_print_bts1457.i0000666000000000000000000000016513571573400023225 0ustar int t[10] = { [4 ... 6] = 5}; int u[10] = { [4] = 3}; int v[10] = { 0, [5] = 42, [6]=36, 7, [9]=9 }; void main() { } frama-c-20.0-Calcium/tests/syntax/dowhilezero.c0000666000000000000000000000133113571573400016400 0ustar /* Simplification do {...} while(0) into {...}. */ void f1() { //@ loop invariant \true; do { int x = 1; int y = 2; } while(0); } void f2() { do { int x = 1; int y = 2; break; } while(0); } void f3() { do { int x = 1; int y = 2; continue; } while(0); } void f4(int c) { do { int x = 1; int y = 2; } while(c); } /* Functions below are simplified */ void f5() { do { int x = 1; int y = 2; } while(0); } void f6() { do { int x = 1; int y = 2; while (1) { continue; break; } } while(0); } void f7() { do { int x = 1; int y = 2; } while((int *)0); } void f8(int v) { if (v == 0) { do {} while (0); } } frama-c-20.0-Calcium/tests/syntax/duplicate_field.i0000666000000000000000000000011513571573400017167 0ustar struct test{ int x; int x; }; int f(struct test s){ return s.x; }; frama-c-20.0-Calcium/tests/syntax/duplicated_global_bts1129.i0000666000000000000000000000013313571573400020675 0ustar void f(int* x); void f(int* x) { *x++; } int X; //@ ensures X==1; void f(int* x); frama-c-20.0-Calcium/tests/syntax/empty_initializer.i0000666000000000000000000000047613571573400017625 0ustar /* run.config STDOPT:+"-machdep gcc_x86_32" */ typedef struct __S { int i; } STR; STR A[] = { { }, { }, { } }; STR D[] = { { }, { 1 }, { } }; int E[][3] = { { }, { } }; int f () { STR B[] = { { }, { }, { } }; STR C[] = { { }, { 3 }, { } }; int F[][4] = { { }, { 23, 45 }, { } }; return B[1].i; } frama-c-20.0-Calcium/tests/syntax/enum.h0000666000000000000000000000035713571573400015025 0ustar enum e {E1, E2}; #ifndef V enum f {F11, F12}; enum {K11, K12}; enum {U1,U2}; // unused, but changes the anonymous enum counter between the two files involved in the test #else enum f {F21, F22}; enum {K21, K22}; #endif enum { I1, I2}; frama-c-20.0-Calcium/tests/syntax/enum1.c0000666000000000000000000000042213571573400015072 0ustar /* run.config STDOPT: +"tests/syntax/enum2.c" */ #include "enum.h" int e1() { return E1; } int f1() { return F11; } int k1() { return K11; } int i1() { return I1; } // Bug 2090 enum Foo { EN1, EN2, EN3 }; int f() { return !EN1; } int g() { return EN1; } frama-c-20.0-Calcium/tests/syntax/enum2.c0000666000000000000000000000030013571573400015066 0ustar /* run.config DONTRUN: main test is in enum1. */ #define V #include "enum.h" int e2() { return E2; } int f2() { return F22; } int k2() { return K22; } int i2() { return I2; } frama-c-20.0-Calcium/tests/syntax/enum_call.i0000666000000000000000000000022313571573400016011 0ustar typedef enum E { C0, C1, C2 }; void f(enum E const); void f1(enum E); void g() { f((enum E) C0); f1((enum E)C2); } void h() { f(C1); f1(C0); } frama-c-20.0-Calcium/tests/syntax/enum_repr.i0000666000000000000000000000417513571573400016060 0ustar /* run.config EXECNOW: make -s tests/syntax/Enum_repr.cmxs OPT: -load-module tests/syntax/Enum_repr.cmxs -enums int -print OPT: -load-module tests/syntax/Enum_repr.cmxs -enums gcc-short-enums -print OPT: -load-module tests/syntax/Enum_repr.cmxs -enums gcc-enums -print */ // is represented by | int | gcc-enums | gcc-short-enums // foo | int | unsigned int | unsigned char // bar | int | unsigned char | unsigned char // bu1 | int | unsigned int | unsigned int // bu2 | int | unsigned int | unsigned int // bu3 | int | unsigned long long | unsigned long long // bs1 | int | unsigned int | int // bs2 | int!| long long | long long // bs3 | int!| long long | long long // bc1 | int | unsigned int | unsigned char // bc2 | int | unsigned int | unsigned char // bd1 | int | int | signed char // bd2 | int | int | signed char typedef enum { A = 3 } foo; typedef enum __attribute__((packed)) { B = 6 } bar; typedef enum { Bu1 = 0x7FFFFFFF } bu1; typedef enum { Bu2 = 0xFFFFFFFF } bu2; typedef enum { Bu3 =0x1FFFFFFFF } bu3; typedef enum { Bs1 = 0x7FFFFFFF, Ms1=-1 } bs1; typedef enum { Bs2 = 0xFFFFFFFF, Ms2=-1 } bs2; typedef enum { Bs3 =0x1FFFFFFFF, Ms3=-1 } bs3; typedef enum { Bc1 =(signed char)'c' } bc1; typedef enum { Bc2 =(unsigned char)'c' } bc2; typedef enum { Bd1 =(signed char)'c', Md1=-1 } bd1; typedef enum { Bd2 =(unsigned char)'c', Md2=-1 } bd2; int main () { foo x = A; bar y = B; bu1 u1 = Bu1; bu2 u2 = Bu2; bu3 u3 = Bu3; bs1 s1 = Bs1; bs2 s2 = Bs2; bs3 s3 = Bs3; bc1 c1 = Bc1; bc2 c2 = Bc2; bd1 d1 = Bd1; bd2 d2 = Bd2; if (x==A && y == B) { return 0; } return 1; } typedef unsigned int bla; int f1(bla x); int f2(bla x); int f3(bla x); int h1(foo x); int h2(foo x); int h3(foo x); int g() { foo x = A; int res = f1((bla) x); res+= f2((unsigned int) x); res+= f3(x); res+= h1((bla) x); res+= h2((unsigned int) x); res+= h3(x); return res; } frama-c-20.0-Calcium/tests/syntax/enum_size_array.i0000666000000000000000000000016713571573400017255 0ustar typedef enum { ONE, TWO, EN_NB} T_E; typedef int T_TAB[EN_NB]; int f_return_last(T_TAB tab) { return tab[EN_NB-1]; } frama-c-20.0-Calcium/tests/syntax/erased_label_bts1502.i0000666000000000000000000000006013571573400017633 0ustar void f(int a) { goto _LOR_0; if (a) _LOR_0: ; } frama-c-20.0-Calcium/tests/syntax/exit.c0000666000000000000000000000041713571573400015022 0ustar #include volatile c; int f() { if (c) { return 0; } else { quick_exit (1); // no_return attribute in libc } } void unknown_exit(int i); int g() { if (c) { return 0; } else { unknown_exit (1); } } void main() { f(); g(); } frama-c-20.0-Calcium/tests/syntax/extern_init.i0000666000000000000000000000036313571573400016407 0ustar /* run.config OPT: @PTEST_DIR@/@PTEST_NAME@_1.i @PTEST_DIR@/@PTEST_NAME@_2.i -eva @EVA_CONFIG@ OPT: @PTEST_DIR@/@PTEST_NAME@_2.i @PTEST_DIR@/@PTEST_NAME@_1.i -eva @EVA_CONFIG@ */ extern int a[] ; /*@ assigns a[3] \from \nothing; */ void g(); frama-c-20.0-Calcium/tests/syntax/extern_init_1.i0000666000000000000000000000015713571573400016630 0ustar /* run.config DONTRUN: main test is in extern_init.i */ int a[5] = {1, 2, 3, 4, 5}; void f() { a[2] = 12; } frama-c-20.0-Calcium/tests/syntax/extern_init_2.i0000666000000000000000000000021213571573400016621 0ustar /* run.config DONTRUN: main test is in extern_init.i */ extern int a[]; void f(); void g(); int main() { f(); g(); return a[1]; } frama-c-20.0-Calcium/tests/syntax/extinline.i0000666000000000000000000000007713571573400016060 0ustar void f (int, int); extern __inline__ void f (int a, int b) {} frama-c-20.0-Calcium/tests/syntax/fam.i0000666000000000000000000000277413571573400014632 0ustar // Tests related to flexible array members // FAM declaration OK struct { int len; char a[]; } fam; // static FAM initialization not allowed (unsupported GCC extension) struct { int len; char a[]; } fam2 = {1, {1, 2, 3, 4, 5, 6}}; // initialization OK - not a FAM int t[] = {5, 6, 7, 8}; // initialization OK - not a FAM int m[][3] = {{30, 31, 32},{33, 34, 35},{36, 37, 38}}; // invalid FAM declaration: b is not the last element in the struct struct { char b[]; int d; } not_fam = {{1, 2, 3}, 4}; // OK (no FAMs) struct _nested { int level1; struct _s1 { int level2; struct _s2 { int level3; struct _s3 { int level4; int another4; } s3; } s2; } s1; } nested = {1, {2, {3, {4, 5}}}}; // static FAM initialization not allowed (unsupported GCC extension) struct { int len; struct { int len2; char d[3]; } not_a_fam; char a[]; } fam3 = {1, {2, {3, 4, 5}}, {6, 7, 8, 9, 10}}; typedef struct { int len; int a[]; } td_fam; // static FAM initialization (via a typedef) not allowed // (unsupported GCC extension) td_fam tfam = {1, {1, 2, 3, 4, 5, 6}}; // OK - not a FAM struct { int len; struct { int len2; char d[3]; } not_a_fam; } not_fam2 = {1, {2, {3, 4, 5}}}; int main() { // invalid: cannot initialize a FAM in a non-static context // (not even GCC allows this) struct { int len3; struct { int len4; char e[3]; } not_a_fam2; char a[]; } fam4 = {10, {11, {12, 13, 14}}, {15, 16, 17, 18, 19}}; return 0; } frama-c-20.0-Calcium/tests/syntax/fct_ptr.i0000666000000000000000000000047713571573400015526 0ustar int f(int); void *p = f; int (*pf) (int x) = f; int g() { return ((int (*)(int))(*pf))(4); } int main () { int (*q)(int) = (void *)0xfff45; q(2); q = p; q(3); } typedef int (*Function_ptr)(); char *f_va(int a, ...) { return a; } Function_ptr fp_table[1] = {(Function_ptr) f_va}; // warning, but no error frama-c-20.0-Calcium/tests/syntax/flexible_array_member.i0000666000000000000000000000031013571573400020366 0ustar // valid flexible array member declarations struct s1 { int size; char data[]; } ss1; struct s2 { char len, data[]; } ss2; union u { struct s { char len; char data[]; } fam; } u1; frama-c-20.0-Calcium/tests/syntax/flexible_array_member_invalid1.i0000666000000000000000000000013413571573400022161 0ustar // invalid flexible array member (empty struct otherwise) struct s1 { char data[]; } ss1; frama-c-20.0-Calcium/tests/syntax/flexible_array_member_invalid2.i0000666000000000000000000000017013571573400022162 0ustar // invalid flexible array member (two incomplete fields) struct s { int len; char data[]; char more_data[]; } ss; frama-c-20.0-Calcium/tests/syntax/flexible_array_member_invalid3.i0000666000000000000000000000020513571573400022162 0ustar // invalid flexible array member (two incomplete fields in same field group) struct s { int len; char data[], more_data[]; } ss; frama-c-20.0-Calcium/tests/syntax/flexible_array_member_invalid4.i0000666000000000000000000000016513571573400022170 0ustar // invalid flexible array member (incomplete field is not last) struct s { int len; char data[]; char b; } ss; frama-c-20.0-Calcium/tests/syntax/flexible_array_member_invalid5.i0000666000000000000000000000024013571573400022163 0ustar // In C99, flexible array members cannot be nested inside other structs typedef struct { int a; char data[]; } fam; struct st { int len; fam f; } sst; frama-c-20.0-Calcium/tests/syntax/float.i0000666000000000000000000000016713571573400015166 0ustar /*@ requires f == 0.1f ;*/ void main(float f) { /*@ assert 0xfffffffffffffffff == 0xfffffffffffffffff; */ return; } frama-c-20.0-Calcium/tests/syntax/forloophook.i0000666000000000000000000000026513571573400016421 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ void f() { for (int i=0; i< 10; i++); } frama-c-20.0-Calcium/tests/syntax/forloophook.ml0000666000000000000000000000155413571573400016603 0ustar open Cabs let () = Cabs2cil.register_for_loop_all_hook (fun _ _ _ _ -> Format.printf "Found a for loop@.") let () = Cabs2cil.register_for_loop_init_hook (fun fc -> match fc with | FC_EXP _ -> Format.printf "No declaration@." | FC_DECL _ -> Format.printf "Local declaration@.") let () = Cabs2cil.register_for_loop_test_hook (fun e -> match e.expr_node with | NOTHING -> Format.printf "No test@." | _ -> Format.printf "Has a test@.") let () = Cabs2cil.register_for_loop_incr_hook (fun e -> match e.expr_node with | NOTHING -> Format.printf "No increment@." | _ -> Format.printf "Has an increment@.") let () = Cabs2cil.register_for_loop_body_hook (fun s -> match s.stmt_node with | NOP _ -> Format.printf "No body@." | _ -> Format.printf "Has a body@.") frama-c-20.0-Calcium/tests/syntax/formals_decl_leak.i0000666000000000000000000000031513571573400017502 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -print -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs @PTEST_DIR@/@PTEST_NAME@_1.i */ void f(int x); void g() { f(3); } frama-c-20.0-Calcium/tests/syntax/formals_decl_leak.ml0000666000000000000000000000050013571573400017656 0ustar open Cil_types let check_vi_exists vi _ = try ignore (Globals.Functions.get vi) with Not_found -> Kernel.fatal "%s(%d) has an entry in FormalsDecl, but does not exist in AST" vi.vname vi.vid let run () = let _ = Ast.get () in Cil.iterFormalsDecl check_vi_exists let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/formals_decl_leak_1.i0000666000000000000000000000017013571573400017721 0ustar /* run.config DONTRUN: main test is located in tests/syntax/formals_decl_leak.i */ void f(int y); void h () { f(4); } frama-c-20.0-Calcium/tests/syntax/func_spec_merge.i0000666000000000000000000000020013571573400017171 0ustar int f() { return 3; } int g () { return 4; } /*@ requires p == &f || p == &g; */ int main (int (*p)(void)) { return (*p)(); } frama-c-20.0-Calcium/tests/syntax/function-types-compatible.i0000666000000000000000000000020013571573400021151 0ustar void (*p)(int, ...); void f(); void main() { p = f; p(1, 2); // warning, but no parsing error; will fail during execution } frama-c-20.0-Calcium/tests/syntax/gcc_builtins.c0000666000000000000000000001123613571573400016517 0ustar /* run.config STDOPT: +"-machdep gcc_x86_32" */ #include "share/libc/stdint.h" #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),0) int16_t __sync_fetch_and_add_int16_t (int16_t volatile *ptr, int16_t value,...) { int16_t tmp = *ptr; *ptr += value; return tmp; } int16_t __sync_fetch_and_sub_int16_t (int16_t volatile *ptr, int16_t value,...) { int16_t tmp = *ptr; *ptr -= value; return tmp; } int32_t __sync_fetch_and_add_int32_t (int32_t volatile *ptr, int32_t value,...) { int32_t tmp = *ptr; *ptr += value; return tmp; } int32_t __sync_fetch_and_sub_int32_t (int32_t volatile *ptr, int32_t value,...) { int32_t tmp = *ptr; *ptr -= value; return tmp; } int64_t __sync_fetch_and_add_int64_t (int64_t volatile *ptr, int64_t value,...) { int64_t tmp = *ptr; *ptr += value; return tmp; } int64_t __sync_fetch_and_sub_int64_t (int64_t volatile *ptr, int64_t value,...) { int64_t tmp = *ptr; *ptr -= value; return tmp; } int16_t __sync_add_and_fetch_int16_t (int16_t volatile *ptr, int16_t value,...) { *ptr += value; return *ptr; } int16_t __sync_sub_and_fetch_int16_t (int16_t volatile *ptr, int16_t value,...) { *ptr -= value; return *ptr; } int32_t __sync_add_and_fetch_int32_t (int32_t volatile *ptr, int32_t value,...) { *ptr += value; return *ptr; } int32_t __sync_sub_and_fetch_int32_t (int32_t volatile *ptr, int32_t value,...) { *ptr -= value; return *ptr; } int64_t __sync_add_and_fetch_int64_t (int64_t volatile *ptr, int64_t value,...) { *ptr += value; return *ptr; } int64_t __sync_sub_and_fetch_int64_t (int64_t volatile *ptr, int64_t value,...) { *ptr -= value; return *ptr; } int __sync_bool_compare_and_swap_uint16_t (uint16_t volatile *ptr, uint16_t oldval, uint16_t newval,...) { if (*ptr == oldval) { *ptr = newval; return 1; } else { return 0; } } int __sync_bool_compare_and_swap_uint32_t (uint32_t volatile *ptr, uint32_t oldval, uint32_t newval,...) { if (*ptr == oldval) { *ptr = newval; return 1; } else { return 0; } } int __sync_bool_compare_and_swap_uint64_t (uint64_t volatile *ptr, uint64_t oldval, uint64_t newval,...) { if (*ptr == oldval) { *ptr = newval; return 1; } else { return 0; } } void main(void) { { int16_t content = 100; int16_t volatile *ptr = &content; int16_t value = 33; int16_t result; result = __sync_fetch_and_add(ptr, value); /*@ assert result == 100 && content == 133; */ result = __sync_fetch_and_add(ptr, -11); /*@ assert result == 133 && content == 122; */ result = __sync_fetch_and_sub(ptr, value); /*@ assert result == 122 && content == 89; */ result = __sync_fetch_and_sub(ptr, -11); /*@ assert result == 89 && content == 100; */ } { int32_t content = 100; int32_t volatile *ptr = &content; int32_t value = 33; int32_t result; result = __sync_fetch_and_add(ptr, value); /*@ assert result == 100 && content == 133; */ result = __sync_fetch_and_add(ptr, -11); /*@ assert result == 133 && content == 122; */ result = __sync_fetch_and_sub(ptr, value); /*@ assert result == 122 && content == 89; */ result = __sync_fetch_and_sub(ptr, -11); /*@ assert result == 89 && content == 100; */ } { int64_t content = 100; int64_t volatile *ptr = &content; int64_t value = 33; int64_t result; result = __sync_fetch_and_add(ptr, value); /*@ assert result == 100 && content == 133; */ result = __sync_fetch_and_add(ptr, -11); /*@ assert result == 133 && content == 122; */ result = __sync_fetch_and_sub(ptr, value); /*@ assert result == 122 && content == 89; */ result = __sync_fetch_and_sub(ptr, -11); /*@ assert result == 89 && content == 100; */ } { uint16_t content = 100; uint16_t volatile *ptr = &content; uint16_t oldval = 100; uint16_t newval = 133; int result; result = __sync_bool_compare_and_swap(ptr, oldval, newval); /*@ assert result == 1 && *ptr == newval; */ } { uint32_t content = 100; uint32_t volatile *ptr = &content; uint32_t oldval = 100; uint32_t newval = 133; int result; result = __sync_bool_compare_and_swap(ptr, oldval, newval); /*@ assert result == 1 && *ptr == newval; */ } { uint64_t content = 100; uint64_t volatile *ptr = &content; uint64_t oldval = 100; uint64_t newval = 133; int result; result = __sync_bool_compare_and_swap(ptr, oldval, newval); /*@ assert result == 1 && *ptr == newval; */ } if (likely(4 == 4)) { int x = 1; } if (unlikely(3 == 4)) { int x = 0; } int x = 2; if (__builtin_expect(x++, x)) { int y = x; } } frama-c-20.0-Calcium/tests/syntax/get_astinfo_bts1136.i0000666000000000000000000000047513571573400017550 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int f (int x) { return x; } int g (int x) { return x; } int h (int x) { return x; } int i() { int y = 0; return y; } int j() { int y = 0; return y; } int k() { int y = 0; return y; } frama-c-20.0-Calcium/tests/syntax/get_astinfo_bts1136.ml0000666000000000000000000000260613571573400017726 0ustar let get_formal_variables name = let add_kf_vars kf vars = try let v = Globals.Vars.find_from_astinfo name (Cil_types.VFormal kf) in Format.printf "found variable vid:%d formal in %a@." v.Cil_types.vid Cil_datatype.Kf.pretty kf; v::vars with Not_found -> vars in let vars = Globals.Functions.fold add_kf_vars [] in vars let get_local_variables name = let add_kf_vars kf vars = try let v = Globals.Vars.find_from_astinfo name (Cil_types.VLocal kf) in Format.printf "found variable vid:%d formal in %a@." v.Cil_types.vid Cil_datatype.Kf.pretty kf; v::vars with Not_found -> vars in let vars = Globals.Functions.fold add_kf_vars [] in vars let main () = Ast.compute (); let vars = get_formal_variables "x" in let vars' = get_local_variables "y" in let do_v v = let pp_kind fmt kind = match kind with | Cil_types.VGlobal -> Format.fprintf fmt "global" | Cil_types.VFormal kf -> Format.fprintf fmt "formal in %a" Cil_datatype.Kf.pretty kf | Cil_types.VLocal kf -> Format.fprintf fmt "local in %a" Cil_datatype.Kf.pretty kf in let _, kind = Globals.Vars.get_astinfo v in Format.printf "[do_v] vid:%d %a@." v.Cil_types.vid (* Cil_datatype.Localisation.pretty *) pp_kind kind in List.iter do_v vars; List.iter do_v vars' let () = Db.Main.extend main frama-c-20.0-Calcium/tests/syntax/ghost_func_ptr.i0000666000000000000000000000012313571573400017075 0ustar //@ ghost void (*g)(int *) = 0 ; int main(){ //@ ghost void (*l)(int *) = 0 ; } frama-c-20.0-Calcium/tests/syntax/ghost_lexing.i0000666000000000000000000000026513571573400016552 0ustar int G = 0; const char* foo = "foo"; void test(const char */*name*/); void test2(int x) { /*@ ghost int y = 0; if (x>0) { y = x * x; }; */ G = x * x; test(foo); } frama-c-20.0-Calcium/tests/syntax/ghost_local_capture.i0000666000000000000000000000073113571573400020077 0ustar void titi() { int c = 0; { L0: ; /*@ ghost int c = 1; */ L1: ; c = 2; /*@ assert c == 1; */ /*@ assert \at(c,L0) == 0; */ /*@ assert \at(c,L1) == 1; */ } /*@ assert c == 2; */ } void toto() { /*@ ghost int c = 1; */ { L0: ; int c = 0; L1: ; c = 2; /*@ assert c == 2; */ /*@ assert \at(c,L0) == 1; */ /*@ assert \at(c,L1) == 0; */ } /*@ assert c == 1; */ } /*@ ghost int x; */ /*@ ghost void f() { x++; } */ frama-c-20.0-Calcium/tests/syntax/ghost_local_ill_formed.i0000666000000000000000000000060313571573400020546 0ustar void titi() { int c = 0; L0: ; /* ill-formed: in ghost mode, we have two local c in the same scope. */ /*@ ghost int c = 1; */ L1: ; c = 2; /*@ assert c == 1; */ /*@ assert \at(c,L0) == 0; */ /*@ assert \at(c,L1) == 1; */ /*@ assert c == 2; */ } void toto () { //@ ghost int c = 0; // ill-formed: the instruction should be ghost as well c++; } frama-c-20.0-Calcium/tests/syntax/ghost_multiline_annot.c0000666000000000000000000000363213571573400020460 0ustar /* run.config STDOPT: +" -cpp-extra-args=-DP0" STDOPT: +" -cpp-extra-args=-DP1" STDOPT: +" -cpp-extra-args=-DP2" STDOPT: +" -cpp-extra-args=-DP3" STDOPT: +" -cpp-extra-args=-DP4" STDOPT: +" -cpp-extra-args=-DP5" STDOPT: +" -cpp-extra-args=-DP6" STDOPT: +" -cpp-extra-args=-DP7" STDOPT: +" -cpp-extra-args=-DP8" */ #ifdef P0 int main(int c) { /*@ ghost //@ requires c >= 0; int x = c; /@ loop invariant x >= 0; loop assigns x; loop variant x; @/ while (x > 0) { x--; } */ return 0; } #endif #ifdef P1 int main() { /*@ ghost int x = 10; /@ loop invariant x >= 0; loop assigns x; loop variant x; while (x > 0) { x--; } */ return 0; } #endif #ifdef P2 int main() { /@ assert 2 == 2; @/ return 0; } #endif #ifdef P3 int main() { assert (2 == 2); @/ return 0; } #endif #ifdef P4 int main() { //@ assert (2 == 2); @/ return 0; } #endif #ifdef P5 int main() { /*@ ghost int x = 10; /@ loop invariant x >= 0; /@ loop assigns x; @/ loop variant x; @/ while (x > 0) { x--; } */ return 0; } #endif #ifdef P6 int main() { /*@ ghost int x = 10; /@ loop invariant x >= 0; //@ loop assigns x; // ignored loop variant x; @/ while (x > 0) { x--; } */ return 0; } #endif #ifdef P7 int main(int c) { /*@ ghost //@ requires c >= 0; int x = c; /@ loop invariant x >= 0; @ loop invariant x@==@x; @ loop variant x; @/ while (x > 0) { x--; } */ return 0; } #endif #ifdef P8 int main(int c) { /*@ ghost //@ requires c >= 0; @ int x = c; @ /@ loop invariant x >= 0; @ @ loop invariant x == x; @ @ loop variant x; @ @/ @ while (x > 0) { @ x--; @ } @*/ return 0; } #endif frama-c-20.0-Calcium/tests/syntax/ghost_parameters.c0000666000000000000000000000764513571573400017432 0ustar /* run.config STDOPT: +" -cpp-extra-args=-DARGS_NOT_VOID" STDOPT: +" -cpp-extra-args=-DARGS_VOID" STDOPT: +" -cpp-extra-args=-DCOHERENT_DECL" STDOPT: +" -cpp-extra-args=-DINCOHERENT_LOCAL_DECL_NON_GHOST" STDOPT: +" -cpp-extra-args=-DINCOHERENT_GLOBAL_DECL_NON_GHOST" STDOPT: +" -cpp-extra-args=-DINCOHERENT_LOCAL_DECL_GHOST" STDOPT: +" -cpp-extra-args=-DINCOHERENT_GLOBAL_DECL_GHOST" STDOPT: +" -cpp-extra-args=-DINCOHERENT_LOCAL_DECL_MORE_GHOSTS" STDOPT: +" -cpp-extra-args=-DINCOHERENT_GLOBAL_DECL_MORE_GHOSTS" STDOPT: +" -cpp-extra-args=-DINCOHERENT_LOCAL_DECL_MORE_NON_GHOSTS" STDOPT: +" -cpp-extra-args=-DINCOHERENT_GLOBAL_DECL_MORE_NON_GHOSTS" STDOPT: +" -cpp-extra-args=-DVOID_EMPTY_GHOST_PARAMETER_LIST" STDOPT: +" -cpp-extra-args=-DVOID_GHOST_PARAMETER" */ #ifdef ARGS_NOT_VOID void function(int a, int b) /*@ ghost (int c, int d) */{ } void caller(void){ // VALID function(1, 2) /*@ ghost (3, 4)*/ ; /*@ ghost function(1, 2, 3, 4) ; */ // INVALID function(1, 2) ; function(1, 2) /*@ ghost (3) */ ; function(1) /*@ ghost (2, 3) */ ; function(1, 2, 3, 4) ; function() /*@ ghost (1, 2, 3, 4) */ ; /*@ ghost function(1, 2) ; */ /*@ ghost function(1) ; */ /*@ ghost function(1, 2, 3) ; */ } #endif #ifdef ARGS_VOID void function(void) /*@ ghost (int c, int d) */{ } void caller(void){ // VALID function() /*@ ghost (3, 4)*/ ; /*@ ghost function(3, 4) ; */ // INVALID function() ; function() /*@ ghost (3) */ ; function(1) /*@ ghost (2, 3) */ ; function(1, 2) ; function() /*@ ghost (1, 2, 3) */ ; /*@ ghost function() ; */ /*@ ghost function(1) ; */ /*@ ghost function(1, 2, 3) ; */ } #endif #ifdef COHERENT_DECL void caller(void){ void function(int a, int b) /*@ ghost(int c, int d) */ ; function(1, 2) /*@ ghost (3, 4) */ ; } void function(int a, int b) /*@ ghost(int c, int d) */ ; void function(int a, int b) /*@ ghost(int c, int d) */ { } #endif #ifdef INCOHERENT_LOCAL_DECL_NON_GHOST void caller(void){ void function(int b) /*@ ghost(int c, int d) */ ; function(2) /*@ ghost (3, 4) */ ; } void function(int a, int b) /*@ ghost(int c, int d) */ { } #endif #ifdef INCOHERENT_GLOBAL_DECL_NON_GHOST void function(int b) /*@ ghost(int c, int d) */ ; void caller(void){ function(2) /*@ ghost (3, 4) */ ; } void function(int a, int b) /*@ ghost(int c, int d) */ { } #endif #ifdef INCOHERENT_LOCAL_DECL_GHOST void caller(void){ void function(int a, int b) /*@ ghost(int d) */ ; function(1, 2) /*@ ghost (4) */ ; } void function(int a, int b) /*@ ghost(int c, int d) */ { } #endif #ifdef INCOHERENT_GLOBAL_DECL_GHOST void function(int a, int b) /*@ ghost(int d) */ ; void caller(void){ function(1, 2) /*@ ghost (3) */ ; } void function(int a, int b) /*@ ghost(int c, int d) */ { } #endif #ifdef INCOHERENT_LOCAL_DECL_MORE_GHOSTS void caller(void){ void function(int a, int b, int c) /*@ ghost(int d) */ ; function(1, 2, 3) /*@ ghost (4) */ ; } void function(int a, int b) /*@ ghost(int c, int d) */ { } #endif #ifdef INCOHERENT_GLOBAL_DECL_MORE_GHOSTS void function(int a, int b, int c) /*@ ghost(int d) */ ; void caller(void){ function(1, 2, 3) /*@ ghost (4) */ ; } void function(int a, int b) /*@ ghost(int c, int d) */ { } #endif #ifdef INCOHERENT_LOCAL_DECL_MORE_NON_GHOSTS void caller(void){ void function(int a) /*@ ghost(int b, int c, int d) */ ; function(1) /*@ ghost (2, 3, 4) */ ; } void function(int a, int b) /*@ ghost(int c, int d) */ { } #endif #ifdef INCOHERENT_GLOBAL_DECL_MORE_NON_GHOSTS void function(int a) /*@ ghost(int b, int c, int d) */ ; void caller(void){ function(1) /*@ ghost (2, 3, 4) */ ; } void function(int a, int b) /*@ ghost(int c, int d) */ { } #endif #ifdef VOID_EMPTY_GHOST_PARAMETER_LIST void function_void(void) /*@ ghost () */ { } #endif #ifdef VOID_GHOST_PARAMETER void function_void(void) /*@ ghost (void) */ { } void function_non_void(int x) /*@ ghost (void) */ { } #endifframa-c-20.0-Calcium/tests/syntax/ghost_parameters_formals_status.i0000666000000000000000000000110513571573400022547 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ void declaration_void(void) /*@ ghost (int x, int y) */ ; void declaration_not_void(int a, int b) /*@ ghost (int x, int y) */ ; void definition_void(void) /*@ ghost(int x, int y) */ { } void definition_not_void(int a, int b) /*@ ghost(int x, int y) */ { } void caller(){ declaration_void() /*@ ghost (1, 2) */ ; declaration_not_void(1, 2) /*@ ghost (3, 4) */ ; definition_void() /*@ ghost (1, 2) */ ; definition_not_void(1, 2) /*@ ghost (3, 4) */ ; } frama-c-20.0-Calcium/tests/syntax/ghost_parameters_formals_status.ml0000666000000000000000000000143713571573400022737 0ustar open Cil_types let run () = let print_info kf = let pretty_formal fmt vi = assert(vi.vformal) ; Format.fprintf fmt "@\n- %a which is %s" Cil_datatype.Varinfo.pretty vi (if vi.vghost then "ghost" else "non-ghost") in let pretty_formal_list fmt l = match l with | [] -> Format.fprintf fmt "No Formals" | _ -> Format.fprintf fmt "Formals are %a" (Pretty_utils.pp_flowlist ~left:"" ~sep:"" ~right:"" pretty_formal) l in let vi = Kernel_function.get_vi kf in let formals = Cil.getFormalsDecl vi in Kernel.feedback "Type of %s is %a.@ %a" vi.vname Cil_datatype.Typ.pretty vi.vtype pretty_formal_list formals in Globals.Functions.iter print_info let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/ghost_parameters_side_effect_arg.i0000666000000000000000000000105513571573400022576 0ustar void function(int x) /*@ ghost(int y) */ ; int other(int x) /*@ ghost(int y) */ ; void caller(){ int x = 0 ; //@ ghost int g = 0 ; int t[] = { 0, 0, 0 } ; function(x++) /*@ ghost(g++) */ ; function(x = 2) /*@ ghost(g = 42) */ ; function(x += 2) /*@ ghost(g += 42) */ ; function(-x) /*@ ghost(-g) */ ; function( (x == 0) ? x : 42 ) /*@ ghost( (g == 0) ? g : 42 ) */ ; function(t[x++]) /*@ ghost(t[g++]) */ ; function( other(x) /*@ ghost(g) */ ) /*@ ghost( other(x, g) ) */ ; /*@ ghost int i = 1 ; function(g++, i++) ; */ } frama-c-20.0-Calcium/tests/syntax/gnu-asm-aesni.c0000666000000000000000000001563213571573400016522 0ustar /* run.config COMMENT: FILE_TITLE: AES-NI - Instructions en assembleur inline COMMENT: FILE_DESCRIPTION: Certains microprocesseurs sont dotés de fonctions cryptographiques directement accessibles à l'aide d'un jeu d'instructions étendu. C'est le cas par exemple de microprocesseurs Intel et AMD qui reconnaissent l'extension AES-NI. COMMENT: FILE_DESCRIPTION: L'exemple ci-dessous appelle une fonction extraite de la bibliothèque open source libgcrypt qui implémente des opérations cryptographiques faisant appel aux instructions AES-NI via de l'assembleur inline. COMMENT: FILE_DESCRIPTION: La syntaxe Extended Asm de GCC, utilisée ici, permet au programmeur de spécifier les variables C d'entrée et de sortie de son code assembleur. Bien que l'analyse du code assembleur ne soit pas dans le cadre de Frama-C ne gère, il peut se révéler intéressant de prendre en compte la spécification des entrées/sorties donnée par le programmeur. ------------------------- COMMENT: TEST_TITLE: Chiffrement via AES-NI COMMENT: TEST_MAIN: encrypt_aesni COMMENT: TEST_DESCRIPTION: Un message de 64 octets est initialisé à une valeur précise. Le nombre de tours est fixé à 12 et la clé de chiffrement étendue est initialisée à une valeur abstraite. L'appel à la fonction do_aesni_enc effectue le chiffrement et place le résultat à l'adresse mémoire pointée par le paramètre b. On vérifie ensuite que les cases du tableau b ont bien été initialisées et que le tableau a n'a pas été modifié. OPT: -cpp-extra-args='-DUSE_AESNI' -print ------------------------- */ #ifdef __FRAMAC__ #include <__fc_builtin.h> #else volatile int nondet; #define Frama_C_make_unknown(a, n) do { \ for (int __i = 0; i < n; i++) a[i] = nondet; \ } while (0) #define Frama_C_dump_each() #endif #include typedef unsigned short int byte; /* The following code is extracted from the LGPL project libgcrypt. */ #define MAXROUNDS 14 /* Helper macro to force alignment to 16 bytes. */ #ifdef HAVE_GCC_ATTRIBUTE_ALIGNED # define ATTR_ALIGNED_16 __attribute__ ((aligned (16))) #else # define ATTR_ALIGNED_16 #endif typedef union { int a; short b; char c[1]; long d; #ifdef HAVE_U64_TYPEDEF u64 e; #endif float f; double g; } PROPERLY_ALIGNED_TYPE; /* Our context object. */ typedef struct { /* The first fields are the keyschedule arrays. This is so that they are aligned on a 16 byte boundary if using gcc. This alignment is required for the AES-NI code and a good idea in any case. The alignment is guaranteed due to the way cipher.c allocates the space for the context. The PROPERLY_ALIGNED_TYPE hack is used to force a minimal alignment if not using gcc of if the alignment requirement is higher that 16 bytes. */ union { PROPERLY_ALIGNED_TYPE dummy; byte keyschedule[MAXROUNDS+1][4][4]; } u1; union { PROPERLY_ALIGNED_TYPE dummy; byte keyschedule[MAXROUNDS+1][4][4]; } u2; int rounds; /* Key-length-dependent number of rounds. */ unsigned int decryption_prepared:1; /* The decryption key schedule is available. */ #ifdef USE_AESNI unsigned int use_aesni:1; /* AES-NI shall be used. */ #endif /*USE_AESNI*/ } RIJNDAEL_context ATTR_ALIGNED_16; /* Macros defining alias for the keyschedules. */ #define keyschenc u1.keyschedule #define keyschdec u2.keyschedule static inline void do_aesni_enc (const RIJNDAEL_context *ctx, unsigned char *b, const unsigned char *a) { #define aesenc_xmm1_xmm0 ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" #define aesenclast_xmm1_xmm0 ".byte 0x66, 0x0f, 0x38, 0xdd, 0xc1\n\t" /* Note: For now we relax the alignment requirement for A and B: It does not make much difference because in many case we would need to memcpy them to an extra buffer; using the movdqu is much faster that memcpy and movdqa. For CFB we know that the IV is properly aligned but that is a special case. We should better implement CFB direct in asm. */ asm volatile ("movdqu %[src], %%xmm0\n\t" /* xmm0 := *a */ "movdqa (%[key]), %%xmm1\n\t" /* xmm1 := key[0] */ "pxor %%xmm1, %%xmm0\n\t" /* xmm0 ^= key[0] */ "movdqa 0x10(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0x20(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0x30(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0x40(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0x50(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0x60(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0x70(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0x80(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0x90(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0xa0(%[key]), %%xmm1\n\t" "cmpl $10, %[rounds]\n\t" "jz .Lenclast%=\n\t" aesenc_xmm1_xmm0 "movdqa 0xb0(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0xc0(%[key]), %%xmm1\n\t" "cmpl $12, %[rounds]\n\t" "jz .Lenclast%=\n\t" aesenc_xmm1_xmm0 "movdqa 0xd0(%[key]), %%xmm1\n\t" aesenc_xmm1_xmm0 "movdqa 0xe0(%[key]), %%xmm1\n" ".Lenclast%=:\n\t" aesenclast_xmm1_xmm0 "movdqu %%xmm0, %[dst]\n" : [dst] "=m" (*b) : [src] "m" (*a), [key] "r" (ctx->keyschenc), [rounds] "r" (ctx->rounds) : "cc", "memory"); #undef aesenc_xmm1_xmm0 #undef aesenclast_xmm1_xmm0 } //-----main: encrypt_aesni void encrypt_aesni(void) { RIJNDAEL_context ctx; unsigned char b[64]; unsigned char a_init[64] = {0x85,0x50,0x43,0xda, 0x06,0x99,0xd8,0x3b, 0x65,0xf7,0x1d,0xf7, 0x95,0xd4,0x34,0x5d, 0x6e,0x21,0x01,0xba, 0x2a,0xbd,0x7f,0xab, 0xa7,0x6d,0xe7,0xcd, 0x72,0xcf,0xce,0xa1, 0xa7,0x4a,0xb8,0x12, 0xef,0x2d,0x6b,0xd5, 0xdc,0x09,0xb9,0xdd, 0x09,0x27,0x7c,0x86, 0x35,0x60,0x99,0xea, 0x72,0xbb,0x93,0x9e, 0x9e,0x16,0x7b,0xd4, 0x8c,0x81,0x8a,0x53}; unsigned char a[64]; unsigned char test; int i,j,k; memcpy(a, a_init, 64 * sizeof(unsigned char)); for(i=0; i stack overflow /*@ assert s.v[1].i == 42; */ }; frama-c-20.0-Calcium/tests/syntax/inconsistent_decl.c0000666000000000000000000000033213571573400017554 0ustar /* run.config STDOPT: +"tests/syntax/inconsistent_decl_2.i" STDOPT: +"tests/syntax/inconsistent_decl_2.i"+"-cpp-extra-args='-DWITH_PROTO'" */ #ifdef WITH_PROTO int f(); #endif int g() { int x = f(2); return x; } frama-c-20.0-Calcium/tests/syntax/inconsistent_decl_2.i0000666000000000000000000000021013571573400017776 0ustar /* run.config DONTRUN: main test is at tests/syntax/inconsistent_decl.c */ int f(double x); int h() { int x = f(2.0); return x; } frama-c-20.0-Calcium/tests/syntax/inconsistent_global_ghost_spec.c0000666000000000000000000000136113571573400022326 0ustar /* run.config OPT: -cpp-extra-args="-DNON_GHOST_DECL_GHOST_DEF" OPT: -cpp-extra-args="-DGHOST_DECL_NON_GHOST_DEF" OPT: -cpp-extra-args="-DGHOST_DEF_NON_GHOST_DECL" OPT: -cpp-extra-args="-DNON_GHOST_DEF_GHOST_DECL" */ #ifdef NON_GHOST_DECL_GHOST_DEF void function(void) ; /*@ ghost void function(void){ } */ void user(void){ function(); } #endif #ifdef GHOST_DECL_NON_GHOST_DEF /*@ ghost void function(void) ; */ void function(void){ } void user(void){ function(); } #endif #ifdef GHOST_DEF_NON_GHOST_DECL /*@ ghost void function(void){ } */ void function(void) ; void user(void){ function(); } #endif #ifdef NON_GHOST_DEF_GHOST_DECL void function(void){ } /*@ ghost void function(void) ; */ void user(void){ function(); } #endif frama-c-20.0-Calcium/tests/syntax/init_bts1352.i0000666000000000000000000000010213571573400016174 0ustar int main(void) { int t /* [5] missing */ = { 1, 2, 3, 4, 5 }; } frama-c-20.0-Calcium/tests/syntax/initializer.i0000666000000000000000000000110513571573400016375 0ustar const char STRS [2][7] = { {"ABCDEF"}, {"IJKLML"} }; enum bool { INVALID, VALID}; struct signal { float val; enum bool status; }; struct signals { struct signal f1; struct signal f2; struct signal f3; struct signal f4; struct signal f5; struct signal f6; struct signal f7; }; const struct signals signals = { { 0.0, VALID }, { 0.0, VALID }, { 0.0, VALID }, { 0.0, VALID }, { 0.0, INVALID }, { 0.0, VALID }, }; struct signal tsig [3] = { 0.1, INVALID, 3, VALID }; void main() { static unsigned char STR [] = { "123456" }; int i = STR[2]; } frama-c-20.0-Calcium/tests/syntax/initializers.i0000666000000000000000000000031513571573400016562 0ustar struct e { int i1; }; void f() { struct e e1 = {1, 2}; // accepted by GCC (with warning) } struct ee { int i2; }; void g() { struct ee e2 = 1; // not accepted by GCC; should at least emit warning } frama-c-20.0-Calcium/tests/syntax/inline_calls.i0000666000000000000000000000224113571573400016510 0ustar /* run.config STDOPT: +"-inline-calls @all" STDOPT: +"-inline-calls @inline" STDOPT: +"-inline-calls @inline -remove-inlined @inline" */ int f() { return 2; } inline int in_f() { return 3; } volatile int v; int g() { if (v) return f(); else return in_f(); } int h() { return g(); } int i() { /*@ assert i:\true; */ return 0; } int rec(int x) { if (x < 0) return x; return rec(x-1); } int f1(int); int g1(int); volatile int nondet; int f1(int a) { if (nondet) g1(1); else if (nondet) f1(2); } int g1(int a) { if (nondet) g1(4); return a; } int main() { int local_init = i(); int t = rec(local_init); f1(2); return h(); } int with_static() { static int count = 0; count++; return count; } int call_with_static () { return with_static(); } void builtin_acsl() { float g = 0.f; /*@ assert ¬\is_NaN(g); */ } void call_builtin_acsl () { builtin_acsl(); } void f_slevel() { //@ slevel 0; return; } void call_f_slevel () { f_slevel(); } void pre_decl(void); void middle_decl() { pre_decl(); } void post_decl(void); extern int x; void pre_decl() { extern int y = 23; x++; y++; post_decl(); } frama-c-20.0-Calcium/tests/syntax/inline_def_1.i0000666000000000000000000000057713571573400016402 0ustar /* run.config STDOPT: +"@PTEST_DIR@/inline_def_2.i" */ // inline definition can be used in this translation unit, but does not // preclude an external definition to exist in another one. inline int f(int x) { return x; } inline int f1() { return 1; } // this time, f2 is a normal external definition. extern inline f2() { return 3; } int g(int x) { return f(x) + f1() + f2 (); } frama-c-20.0-Calcium/tests/syntax/inline_def_2.i0000666000000000000000000000026413571573400016374 0ustar /* run.config DONTRUN: main test is in inline_def_1.i */ int f(int x) { return x + 1; } inline f1 () { return 2; } extern f2(void); int h(int x) { return f(x) + f1() + f2(); } frama-c-20.0-Calcium/tests/syntax/inline_def_bad_1.i0000666000000000000000000000016513571573400017201 0ustar /* run.config STDOPT: +"@PTEST_DIR@/inline_def_bad_2.i" */ extern inline f() { return 1; } int g() { return f(); } frama-c-20.0-Calcium/tests/syntax/inline_def_bad_2.i0000666000000000000000000000027213571573400017201 0ustar /* run.config DONTRUN: main test is inline_def_bad_1.i */ // should be an error: we have two definitions for the same function extern inline f() { return 42; } int h() { return f(); } frama-c-20.0-Calcium/tests/syntax/inserted_casts.c0000666000000000000000000000067613571573400017072 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs STDOPT: +"-no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs" STDOPT: +"-no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs" +"-machdep x86_64" */ #include "stddef.h" int f(int b) { int r; if (b*b != 0) r=0; else r=-1; return r; } int g(int a) { unsigned int r; ptrdiff_t x = &r - &r; r = a + 3; a *= r; return (a - r); } frama-c-20.0-Calcium/tests/syntax/inserted_casts.ml0000666000000000000000000000054113571573400017247 0ustar include Plugin.Register (struct let name = "test" let shortname = "test" let help = "unitary test of inserted cast hook" end) let print_warning e ot nt = result "Inserting cast for expression %a of type %a to type %a@." Printer.pp_exp e Printer.pp_typ ot Printer.pp_typ nt; nt ;; Cabs2cil.typeForInsertedCast := print_warning frama-c-20.0-Calcium/tests/syntax/invalid_constant.i0000666000000000000000000000006113571573400017411 0ustar /* Invalid octal constant */ int i = 0123456789; frama-c-20.0-Calcium/tests/syntax/keep.i0000666000000000000000000000031413571573400014777 0ustar typedef __attribute__((FC_BUILTIN)) int foo; enum __attribute__ ((FC_BUILTIN)) bar { bla, bli }; struct __attribute__ ((FC_BUILTIN)) baz { int x; }; enum discard { a,b,c }; struct discard { int y; }; frama-c-20.0-Calcium/tests/syntax/keep_logical_operators.i0000666000000000000000000000022113571573400020564 0ustar /* run.config OPT:-print -keep-logical-operators */ int test(int a, int b, int c) { if (a && (b || c)) { return 1; } return 2; } frama-c-20.0-Calcium/tests/syntax/label_decl.i0000666000000000000000000000050413571573400016122 0ustar /* run.config MACRO: TMP @PTEST_DIR@/result/@PTEST_NAME@.i OPT: -print -then -print -ocode @TMP@ -then @TMP@ -print -ocode="" */ struct s { int i; }; void s_cp (struct s *p, struct s v) { *p = v; } void main(void) { int i = 0; label: if (i); struct s y; if ((i < 0) || (i >= 256)) s_cp(&y, (struct s){1}); } frama-c-20.0-Calcium/tests/syntax/libc_defs.c0000666000000000000000000000004613571573400015761 0ustar #include #include frama-c-20.0-Calcium/tests/syntax/line_number.c0000666000000000000000000000006213571573400016344 0ustar //@ assert \result == 0; extern int p(void void); frama-c-20.0-Calcium/tests/syntax/literal-question-no-trigraph.c0000666000000000000000000000051413571573400021600 0ustar /* run.config STDOPT: #"-cpp-extra-args=-Wno-trigraphs" STDOPT: #"-cpp-extra-args='-trigraphs -Wno-trigraphs'" */ int main() { char *s1 = "??"; char *s2 = "??="; char *s3 = "???"; char *s4 = "????"; char *s5 = "?\?\?="; char *s6 = "??\?="; char *s7 = "?\??\???=?\?=\\??=?"; char *s8 = "??\\??="; return 0; } frama-c-20.0-Calcium/tests/syntax/local-variable.i0000666000000000000000000000034313571573400016732 0ustar int main(){ { int a ; } ; // < NOP inserted } void f() { if (0) { int b; } } void h (int i) { int x = 1; int t[100 / sizeof(x)]; int u[100 / sizeof(i)]; } int c; int g() { return 1 || (-1L || g(), c); } frama-c-20.0-Calcium/tests/syntax/local_uninitialized_bts_1081.i0000666000000000000000000000031013571573400021412 0ustar int X,Y,FOO; int main(){ int foo, x, y; foo ? x : y; // should be kept foo ? X : y; // should be kept foo ? X : Y; // only foo should be kept FOO ? X : Y; // should disappear return 0; } frama-c-20.0-Calcium/tests/syntax/logic_env.i0000666000000000000000000000030313571573400016016 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/logic_env_script.cmxs OPT: -load-module @PTEST_DIR@/logic_env_script */ //@ predicate foo(integer x) = x == 0; int X; //@ predicate bar{L} = X == 0; frama-c-20.0-Calcium/tests/syntax/logic_env_script.ml0000666000000000000000000000163113571573400017567 0ustar open Cil_types let emitter = Emitter.create "test" [ Emitter.Global_annot ] ~correctness:[] ~tuning:[] let add () = let li = Cil_const.make_logic_info "bla" in li.l_body <- LBpred Logic_const.ptrue; let glob = Dfun_or_pred (li,Cil_datatype.Location.unknown) in Logic_utils.add_logic_function li; Annotations.add_global emitter glob let check () = assert (Logic_env.find_all_logic_functions "foo" <> []); assert (Logic_env.find_all_logic_functions "bar" <> []); assert (Logic_env.find_all_logic_functions "bla" <> []); let x = List.hd (Logic_env.find_all_logic_functions "bar") in let lv = x.l_var_info in assert (x == Logic_env.find_logic_cons lv); Format.printf "Check OK@." let run () = let _ = Ast.get () in add (); check (); let prj = File.create_project_from_visitor "foo" (fun p -> new Visitor.frama_c_copy p) in Project.on prj check () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/loop-case-switch-for-unroll.c0000666000000000000000000000356513571573400021336 0ustar /* run.config STDOPT: +"-slevel 100 -eva" STDOPT: +"-ulevel 1 -slevel 100 -eva" STDOPT: +"-ulevel 2 -slevel 100 -eva" COMMENT: compile and run with GCC, save output to a file, and compare it to the result of Frama-C piped to: "| grep Frama_C_show_each | sed 's/^.*Frama_C_show_each_//'" */ #ifdef __FRAMAC__ #define print(line, s, a) Frama_C_show_each_ ## s ## _(a) #else #include #define STR(a) _STR(a) #define _STR(a) #a #define print(line, s, a) printf("%s_: {%d}\n", STR(s), a) #endif int gen_nondet(int line) { static int vals[] = { 1, // goto L1 42, // j 5, // >10? 1, // goto L 43, // j 11, // >10? 0, // no jump 1, // goto L0 0, // no jump 44, // j 12, // >10? 0, // no jump 0, // no jump 1, // goto L3 1, // goto L1 45, // j 11, // >10? 0, 0, 0, // no jump 0, // no jump 46, // j 13, // >10? 0, 0, 0, // no jump 0, // no jump 47, // j 12, // >10? 0, 0, 0, // no jump 48, // j 15, // >10? 0, 0, 0, // no jump }; static int i = -1; i = (i+1)%(sizeof(vals)/sizeof(int)); print(line, nondet, vals[i]); return vals[i]; } #define nondet() gen_nondet(__LINE__) void main() { int y = 32; int x; int n = 3; L0: switch(1) { case 0: L3: print(__LINE__, n, n); if (nondet()) goto L; if (nondet()) goto L1; do { case 1: if (nondet()) goto L1; L: x = y; case 2: for (int i = 0, j; i < 4; i++) { L1: j = nondet(); if (nondet() > 10) i = 10; else i = 0; print(__LINE__, i, i); if (nondet()) goto L; if (nondet()) goto L0; if (nondet()) goto L3; } } while(--n > 0); print(__LINE__, y, y); print(__LINE__, x, x); } } frama-c-20.0-Calcium/tests/syntax/loop_annot.i0000666000000000000000000000036013571573400016224 0ustar /* run.config STDOPT: +"-simplify-cfg" +"-keep-switch" STDOPT: +"-simplify-cfg" */ void f() { int i = 0; //@ loop invariant 0 <= i <= 10; while (i < 10) { // @ invariant 0 <= i < 10; ++i; //@ assert 0 <= i <= 10; } } frama-c-20.0-Calcium/tests/syntax/lvalvoid.i0000666000000000000000000000043113571573400015673 0ustar void* memcpy1(void* dst, const void *src,long n) { char* d=dst; char* s=src; for (int i=0;i #include #endif int f1() { char c = s1.a; #ifndef __FRAMAC__ printf("f1: offsetof b = %lu\n", offsetof(s, b)); #endif return 0; } frama-c-20.0-Calcium/tests/syntax/merge_attrs_align2.c0000666000000000000000000000053113571573400017616 0ustar /* run.config DONTRUN: main test is in merge_attrs_align.c */ typedef struct { char a; short b; // offset: 2 } s; s s1; // for testing with GCC/Clang #ifndef __FRAMAC__ #include #include #endif int f2() { char c = s1.a; #ifndef __FRAMAC__ printf("f2: offsetof b = %lu\n", offsetof(s, b)); #endif return 0; } frama-c-20.0-Calcium/tests/syntax/merge_attrs_align3.c0000666000000000000000000000061413571573400017621 0ustar /* run.config DONTRUN: main test is in merge_attrs_align.c */ typedef struct __attribute__((packed)){ char a; short b __attribute__((aligned(2))); // offset: 2 } s; s s1; // for testing with GCC/Clang #ifndef __FRAMAC__ #include #include #endif int f3() { char c = s1.a; #ifndef __FRAMAC__ printf("f3: offsetof b = %lu\n", offsetof(s, b)); #endif return 0; } frama-c-20.0-Calcium/tests/syntax/merge_attrs_align4.c0000666000000000000000000000056313571573400017625 0ustar /* run.config DONTRUN: main test is in merge_attrs_align.c */ #pragma pack(1) typedef struct { char a; short b; // offset: 1 (packed) } s; s s1; // for testing with GCC/Clang #ifndef __FRAMAC__ #include #include #endif int f4() { char c = s1.a; #ifndef __FRAMAC__ printf("f4: offsetof b = %lu\n", offsetof(s, b)); #endif return 0; } frama-c-20.0-Calcium/tests/syntax/merge_bts0948.i0000666000000000000000000000033113571573400016346 0ustar /* run.config STDOPT: +"tests/syntax/merge_bts0948_1.i" +"tests/syntax/merge_bts0948_2.i" */ /*@ requires \valid((char*)dest); */ extern void *memcpy(void * dest); void* memcpy(void* region1) { return region1; } frama-c-20.0-Calcium/tests/syntax/merge_bts0948_1.i0000666000000000000000000000020613571573400016567 0ustar /* run.config DONTRUN: main test is merge_bts0948.i */ /*@ requires \valid((char*)dest_1); */ extern void *memcpy(void * dest_1); frama-c-20.0-Calcium/tests/syntax/merge_bts0948_2.i0000666000000000000000000000020613571573400016570 0ustar /* run.config DONTRUN: main test is merge_bts0948.i */ /*@ requires \valid((char*)dest_2); */ extern void *memcpy(void * dest_2); frama-c-20.0-Calcium/tests/syntax/merge_inline_1.c0000666000000000000000000000057113571573400016727 0ustar /* run.config OPT: @PTEST_DIR@/merge_inline_2.c -aggressive-merging -print */ /* Test that we rename properly inlines even if they have prototypes and if they are used before they are defined */ int foo(int x); /* Declare it here. */ inline int foo(int x) { return x; } extern getfoo2(void); int main() { if(getfoo2() != (int)foo) { return 1; } return 0; } frama-c-20.0-Calcium/tests/syntax/merge_inline_2.c0000666000000000000000000000035313571573400016726 0ustar /* run.config DONTRUN: main test is in merge_inline_1.c */ int bar(int x); /* Declare it here. Name does not matter. */ int getfoo2() { /* Use bar before definition */ return (int)bar; } inline int bar(int x) { return x; } frama-c-20.0-Calcium/tests/syntax/merge_loc.i0000666000000000000000000000060713571573400016014 0ustar /* run.config EXECNOW: make -s tests/syntax/pp_lines.cmxs STDOPT: #"-load-module tests/syntax/pp_lines.cmxs" */ // Test locations when cabs2cil merges declarations and tentative definitions // together. We should always favor the tentative definition. extern int foo; int foo; // Better int bar; // Better extern int bar; extern int baz; extern int baz; int z = (int) &baz; frama-c-20.0-Calcium/tests/syntax/merge_union.c0000666000000000000000000000050213571573400016353 0ustar /* run.config OPT: -cpp-extra-args="-I @PTEST_DIR@" @PTEST_DIR@/@PTEST_NAME@_2.c @PTEST_DIR@/@PTEST_NAME@_3.c -print OPT: -cpp-extra-args="-I @PTEST_DIR@" @PTEST_DIR@/@PTEST_NAME@_2.c @PTEST_DIR@/@PTEST_NAME@_3.c -print -kernel-warn-key="linker:drop-conflicting-unused=inactive" */ #include "merge_union.h" int f(un* u); frama-c-20.0-Calcium/tests/syntax/merge_union.h0000666000000000000000000000014413571573400016362 0ustar typedef union { char t; short s; } un; typedef struct { char c; un u; } st; extern st G1; frama-c-20.0-Calcium/tests/syntax/merge_union_2.c0000666000000000000000000000023313571573400016575 0ustar /* run.config DONTRUN: main test is at merge_union.c */ #pragma noalign #include "merge_union.h" int f(un* u); int g(un* u) { f(&G1.u); return 0; } frama-c-20.0-Calcium/tests/syntax/merge_union_3.c0000666000000000000000000000023213571573400016575 0ustar /* run.config DONTRUN: main test at merge_union.c */ #pragma noalign #include "merge_union.h" int g(un* u); int main(un* u) { g(&G1.u); return 0; } frama-c-20.0-Calcium/tests/syntax/merge_unused.c0000666000000000000000000000036613571573400016536 0ustar /* run.config OPT: -cpp-extra-args="-I@PTEST_DIR@" @PTEST_DIR@/@PTEST_NAME@_2.c -print */ #pragma pack(1) #include "merge_unused.h" extern void f(void); struct s G1; struct s G3 = { 1 }; int main() { int i = G1.i; f(); return G3.i; } frama-c-20.0-Calcium/tests/syntax/merge_unused.h0000666000000000000000000000014513571573400016536 0ustar // decl.h struct s { char c; int i; }; extern struct s G1; extern struct s G3; extern int G2; frama-c-20.0-Calcium/tests/syntax/merge_unused_2.c0000666000000000000000000000021113571573400016744 0ustar /* run.config DONTRUN: main test is run through merge_unused.c */ #include "merge_unused.h" void f() { int j = G2; int k = G3.i; } frama-c-20.0-Calcium/tests/syntax/merge_variadic.i0000666000000000000000000000026713571573400017023 0ustar /* run.config OPT: @PTEST_DIR@/@PTEST_NAME@_aux.i -print */ int open (const char* file, int flags, int mode) { return -1; } /*@ assigns \result \from x; */ int foo (int x, int y); frama-c-20.0-Calcium/tests/syntax/merge_variadic_aux.i0000666000000000000000000000035513571573400017676 0ustar /* run.config DONTRUN: auxiliary test file for merge_variadic.i */ /*@ assigns \result \from filename[0..], flags ; */ extern int open(const char *filename, int flags, ...); extern int foo(int x, ...); int bar () { return foo(3,4); } frama-c-20.0-Calcium/tests/syntax/multiline_macro.c0000666000000000000000000000040013571573400017224 0ustar /* run.config OPT: -cpp-extra-args="-CC" -print */ #define X 1 /* multi-line comment */ + 2 + /* bla */ 3 #define Y 5 + \ 6 + \ 7 /*@ ensures \result == X+Y; */ int main(void) { return X+Y; } frama-c-20.0-Calcium/tests/syntax/multiple_decls_contracts.c0000666000000000000000000000101613571573400021132 0ustar /* run.config OPT: share/libc/string.h @PTEST_FILE@ @PTEST_FILE@ -cpp-extra-args="-Ishare/libc" -print OPT: @PTEST_FILE@ share/libc/string.h @PTEST_FILE@ -cpp-extra-args="-Ishare/libc" -print OPT: @PTEST_FILE@ @PTEST_FILE@ share/libc/string.h -cpp-extra-args="-Ishare/libc" -print */ #include "string.h" #include "stdlib.h" char * strdup(const char *str) { if (str != NULL) { register char *copy = malloc(strlen(str) + 1); if (copy != NULL) return strcpy(copy, str); } return NULL; } frama-c-20.0-Calcium/tests/syntax/mutable_test.i0000666000000000000000000000066313571573400016552 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print */ struct R_1 { int r ; }; struct S_1 { struct R_1 __attribute__((____fc_mutable__)) s; }; struct T_1 { struct S_1 t ; }; struct U_1 { struct T_1 u ; }; struct V_1 { struct U_1 const v ; }; struct W_1 { struct V_1 w ; }; struct W_1 x; int y; void f() { x.w.v.u.t.s.r = y; } frama-c-20.0-Calcium/tests/syntax/mutable_test.ml0000666000000000000000000000076113571573400016731 0ustar open Cil_types let main () = Ast.compute (); let def = Kernel_function.get_definition (Globals.Functions.find_def_by_name "f") in let s = List.hd (def.sbody.bstmts) in match s.skind with | Instr (Set ((Var x,offset),_,_)) -> Format.printf "Type of variable: %a@\nOffset: %a@." Printer.pp_typ x.vtype Printer.pp_offset offset; assert (not (Cil.typeHasAttribute "const" (Cil.typeOffset x.vtype offset))) | _ -> assert false let () = Db.Main.extend main frama-c-20.0-Calcium/tests/syntax/mutually_recursive_struct.i0000666000000000000000000000031113571573400021417 0ustar struct S1; struct S2; struct S1 { struct S2 s2[2]; int x; }; struct S2 { struct S1 s1[2]; int y; }; int main () { struct S1 s1; /*@ assert s1.s2[0].s1[1].x != 0; */ return s1.s2[0].s1[1].x; } frama-c-20.0-Calcium/tests/syntax/no-print-libc-reparse.c0000666000000000000000000000056713571573400020173 0ustar /*run.config STDOPT: #"-no-print-libc -print -ocode @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.c -then @PTEST_DIR@/result/ocode_@PTEST_NUMBER@_@PTEST_NAME@.c" */ // tests that using -no-print-libc on a file with an enum produces output that // is reparsable by Frama-C #include int main() { return IPPROTO_ICMP; // force the enum to be used } frama-c-20.0-Calcium/tests/syntax/no_prototype.i0000666000000000000000000000011513571573400016613 0ustar void foo(); int main(void) { foo(); } void foo(int a) { int i = a ; } frama-c-20.0-Calcium/tests/syntax/noret.i0000666000000000000000000000005413571573400015203 0ustar struct s { int i; }; struct s foo() {} frama-c-20.0-Calcium/tests/syntax/offset.c0000666000000000000000000000017213571573400015335 0ustar /* run.config OPT: -cpp-extra-args="-Ishare/libc" -print */ #include "__fc_define_off_t.h" off_t x = 0; off64_t y = 0; frama-c-20.0-Calcium/tests/syntax/offsetof.c0000666000000000000000000000017713571573400015667 0ustar #include "share/libc/stddef.h" struct c {char ca;}; void main(void) { size_t S;; S = offsetof(struct c, ca); return; } frama-c-20.0-Calcium/tests/syntax/one_ret_assert.i0000666000000000000000000000024313571573400017070 0ustar int X; void f(void) { X++; } int g(void) { X++; } int h(void) { if (X) { return 3; } else { return 4; } } int main() { X = h(); f(); return g(); } frama-c-20.0-Calcium/tests/syntax/oracle/0000777000000000000000000000000013571573400015150 5ustar frama-c-20.0-Calcium/tests/syntax/oracle/Refresh_visitor.res.oracle0000666000000000000000000000313613571573400022307 0ustar [kernel] Parsing tests/syntax/Refresh_visitor.i (no preprocessing) Start [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/syntax/Refresh_visitor.i:17: Warning: assertion got status unknown. [eva] tests/syntax/Refresh_visitor.i:23: loop invariant got status valid. [eva] tests/syntax/Refresh_visitor.i:24: loop invariant got status valid. [eva] tests/syntax/Refresh_visitor.i:29: loop invariant got status valid. [eva] tests/syntax/Refresh_visitor.i:30: loop invariant got status valid. [eva] tests/syntax/Refresh_visitor.i:32: starting to merge loop iterations [eva] tests/syntax/Refresh_visitor.i:26: starting to merge loop iterations [eva:alarm] tests/syntax/Refresh_visitor.i:14: Warning: function main: postcondition got status unknown. [eva] Recording results for main [eva] done for function main /* Generated by Frama-C */ struct S { int i ; }; struct matrix { int m[100] ; }; /*@ lemma foo: ∀ struct S x; x.i ≥ 0 ∨ x.i < 0; */ /*@ ensures \result ≥ \old(x.i); */ int main(struct S x, struct matrix m) { struct matrix m_t; int y = x.i; /*@ assert y ≡ x.i; */ ; int i = 0; int j = 0; i = 0; /*@ loop invariant 0 ≤ i ≤ 2; loop invariant 0 ≤ j ≤ 2; loop assigns i, j, m_t; */ while (i < 2) { j = 0; /*@ loop invariant 0 ≤ j ≤ 2; loop invariant 0 ≤ i < 2; loop assigns j, m_t; */ while (j < 2) { m_t.m[i * 2 + j] = m.m[j * 2 + i]; j ++; } i ++; } return y; } frama-c-20.0-Calcium/tests/syntax/oracle/access_volatile_bts1589.res.oracle0000666000000000000000000000061413571573400023467 0ustar [kernel] Parsing tests/syntax/access_volatile_bts1589.i (no preprocessing) /* Generated by Frama-C */ typedef int volatile vi; struct volatile_struct { int volatile a ; vi b ; int c ; }; int volatile x; int z; vi y; struct volatile_struct vs; int main(void) { int __retres; int tmp = x; int tmp_3 = y; int tmp_5 = vs.a; int tmp_7 = vs.b; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/add_allocates.res.oracle0000666000000000000000000000104213571573400021703 0ustar [kernel] Parsing tests/syntax/add_allocates.i (no preprocessing) /* Generated by Frama-C */ int *x; /*@ allocates \nothing; */ void f(void); /*@ allocates x; */ void g(void); /*@ allocates \nothing; behavior b: requires \false; allocates x; */ void main(int c) { f(); /*@ loop allocates \nothing; */ while (c) { /*@ loop allocates x; */ while (1) /*@ loop allocates \nothing; */ while (! c) ; /*@ loop allocates \nothing; for b: loop allocates x; */ while (1) ; } return; } frama-c-20.0-Calcium/tests/syntax/oracle/aggressive_merging_1.res.oracle0000666000000000000000000000044213571573400023216 0ustar [kernel] Parsing tests/syntax/aggressive_merging_1.i (no preprocessing) [kernel] Parsing tests/syntax/aggressive_merging_2.i (no preprocessing) /* Generated by Frama-C */ __inline static void f(void) { return; } void foo(void) { f(); return; } void bar(void) { f(); return; } frama-c-20.0-Calcium/tests/syntax/oracle/alloc_order.res.oracle0000666000000000000000000000063113571573400021414 0ustar [kernel] Parsing tests/syntax/alloc_order.i (no preprocessing) [kernel:annot-error] tests/syntax/alloc_order.i:3: Warning: wrong order of clause in contract: requires after post-condition, assigns or allocates. [kernel] User Error: warning annot-error treated as fatal error. [kernel] User Error: stopping on file "tests/syntax/alloc_order.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/anon_enum_libc.res.oracle0000666000000000000000000000100613571573400022074 0ustar [kernel] Parsing tests/syntax/anon_enum_libc.c (with preprocessing) [kernel] Parsing tests/syntax/result/anon_enum_libc.c (with preprocessing) /* Generated by Frama-C */ #include "PTESTS_DIR/anon_enum_libc.h" struct __anonstruct_s1_1 { int x ; float y ; }; enum __anonenum_2 { BLA = 4, BLI = 12 }; struct __anonstruct_s1_1 s1; int f(void) { int __retres; __retres = BLA + s1.x; return __retres; } int g(void) { int __retres; __retres = (int)((unsigned long)FOO + s2.t); return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/anonymous_comp_init.res.oracle0000666000000000000000000000552513571573400023227 0ustar [kernel] Parsing tests/syntax/anonymous_comp_init.i (no preprocessing) [kernel] tests/syntax/anonymous_comp_init.i:62: Warning: Too many initializers for structure /* Generated by Frama-C */ struct __anonstruct_2 { int f2 ; }; struct __anonstruct_s1_1 { int f1 ; struct __anonstruct_2 __anonCompField1 ; int f3 ; }; typedef struct __anonstruct_s1_1 s1; struct __anonstruct_5 { unsigned int f1 : 1 ; unsigned int f2 : 1 ; unsigned int f3 : 1 ; unsigned int : 10 ; unsigned int f5 : 1 ; unsigned int : 6 ; }; union __anonunion_4 { struct __anonstruct_5 __anonCompField2 ; unsigned int i ; }; struct __anonstruct_s2_3 { union __anonunion_4 __anonCompField3 ; unsigned int j ; }; typedef struct __anonstruct_s2_3 s2; union __anonunion_7 { int a ; long b ; }; struct __anonstruct_s3_6 { union __anonunion_7 __anonCompField4 ; }; typedef struct __anonstruct_s3_6 s3; s1 g1 = {.f1 = 1, .__anonCompField1 = {.f2 = 0}, .f3 = 3}; s2 g2 = {.__anonCompField3 = {.__anonCompField2 = {.f1 = (unsigned int)1, .f2 = (unsigned int)1, .f3 = (unsigned int)0, .f5 = (unsigned int)1}}, .j = (unsigned int)0}; s2 g3 = {.__anonCompField3 = {.__anonCompField2 = {.f1 = (unsigned int)3, .f2 = (unsigned int)4, .f3 = (unsigned int)1, .f5 = (unsigned int)2}}, .j = 0U}; s2 g4 = {.__anonCompField3 = {.__anonCompField2 = {.f1 = (unsigned int)0, .f2 = 0U, .f3 = 0U, .f5 = 0U}}, .j = 0U}; s2 g5 = {.__anonCompField3 = {.__anonCompField2 = {.f1 = (unsigned int)1, .f2 = (unsigned int)2, .f3 = (unsigned int)3, .f5 = (unsigned int)4}}, .j = (unsigned int)5}; s2 g6 = {.__anonCompField3 = {.__anonCompField2 = {.f1 = (unsigned int)1, .f2 = (unsigned int)2, .f3 = (unsigned int)3, .f5 = (unsigned int)4}}, .j = (unsigned int)5}; s2 g7 = {.__anonCompField3 = {.__anonCompField2 = {.f1 = (unsigned int)1, .f2 = (unsigned int)2, .f3 = (unsigned int)3, .f5 = (unsigned int)4}}, .j = 0U}; s3 g8 = {.__anonCompField4 = {.a = 0}}; int main(void) { int __retres; __retres = (int)g2.__anonCompField3.__anonCompField2.f5; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/arg_type.res.oracle0000666000000000000000000000067713571573400020753 0ustar [kernel] Parsing tests/syntax/arg_type.i (no preprocessing) [kernel] tests/syntax/arg_type.i:15: User Error: Declaration of g does not match previous declaration from tests/syntax/arg_type.i:13 (different integer types: 'int' and 'short'). [kernel] tests/syntax/arg_type.i:15: User Error: Cannot resolve variable x [kernel] User Error: stopping on file "tests/syntax/arg_type.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/array_cast_bts1099.res.oracle0000666000000000000000000000063413571573400022455 0ustar [kernel] Parsing tests/syntax/array_cast_bts1099.i (no preprocessing) [kernel] tests/syntax/array_cast_bts1099.i:7: User Error: Cast over a non-scalar type int [10] 5 int tab1[4]; 6 u* p = &tab1; 7 t* p2 = (t) p; ^^^^^^^^^^^^^^^^ 8 } [kernel] User Error: stopping on file "tests/syntax/array_cast_bts1099.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/array_size_float.res.oracle0000666000000000000000000000106513571573400022466 0ustar [kernel] Parsing tests/syntax/array_size_float.i (no preprocessing) [kernel:parser:decimal-float] tests/syntax/array_size_float.i:1: Warning: Floating-point constant 50.1 is not represented exactly. Will use 0x1.90ccccccccccdp5. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [kernel] tests/syntax/array_size_float.i:2: Warning: Unable to do constant-folding on array length (int)6000000000000.1. Some CIL operations on this array may fail. /* Generated by Frama-C */ int t1[(int)50.1]; int t2[(int)6000000000000.1]; frama-c-20.0-Calcium/tests/syntax/oracle/asm_goto.res.oracle0000666000000000000000000000103113571573400020732 0ustar [kernel] Parsing tests/syntax/asm_goto.i (no preprocessing) /* Generated by Frama-C */ void basic(void) { __asm__ ("xor %eax, %eax\n\t"); return; } void pretty(void) { /*@ assigns \nothing; */ __asm__ volatile ("pxor %%mm7, %%mm7\n\t" "pcmpeqd %%mm6, %%mm6" : ); return; } int main(unsigned short bit) { int __retres; /*@ assigns \nothing; */ __asm__ goto ("1: jmp %l[t_no]\n" : : "i" (bit) : :t_no); __retres = 1; goto return_label; t_no: __retres = 0; return_label: return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/asm_with_contracts.res.oracle0000666000000000000000000000234013571573400023021 0ustar [kernel] Parsing tests/syntax/asm_with_contracts.i (no preprocessing) /* Generated by Frama-C */ /*@ behavior b: assumes z ≥ 0; ensures \true; */ int f(int z) { int x = z; int y = 2; /*@ assigns y; */ __asm__ ("mov %1, %0\n\t" : "=r" (y) : "r" (x)); /*@ assigns x; assigns x \from y; */ /*@ for b: assigns x, y; */ __asm__ ("mov %1, %0\n\t" : "=r" (x) : "r" (y)); /*@ assigns x, y; behavior c: assumes x ≥ 0; ensures y ≥ 0; assigns y; assigns y \from x; */ __asm__ ("mov %1, %0\n\t" : "=r" (y) : "r" (x)); return x; } __inline static void insw(unsigned short __port, void *__addr, unsigned long __count) { /*@ assigns __addr, __count, *((char *)__addr + (..)); assigns __addr \from __port, (indirect: __addr), __count, *((char *)__addr + (..)); assigns __count \from __port, (indirect: __addr), __count, *((char *)__addr + (..)); assigns *((char *)__addr + (..)) \from __port, (indirect: __addr), __count, *((char *)__addr + (..)); */ __asm__ volatile ( "cld ; rep ; insw" : "=D" (__addr), "=c" (__count) : "d" (__port), "0" (__addr), "1" (__count) ); return; } frama-c-20.0-Calcium/tests/syntax/oracle/assembly_gmp.0.res.oracle0000666000000000000000000001015513571573400021751 0ustar [kernel] Parsing tests/syntax/assembly_gmp.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/syntax/assembly_gmp.c:137: Warning: Calling undeclared function USItype. Old style K&R code? /* Generated by Frama-C */ #include "stddef.h" typedef long mp_limb_t; typedef unsigned long UDItype; typedef long *mp_srcptr; typedef size_t mp_size_t; void ADDC_LIMB(mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t); void udiv_rnnd_preinv(mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t); extern int ( /* missing proto */ USItype)(long x_0); mp_limb_t mpn_mod_1_1p(mp_srcptr ap, mp_size_t n, mp_limb_t b, mp_limb_t const * /*[4]*/ bmodb) { mp_limb_t __retres; int cnt; mp_limb_t bi; mp_limb_t r0; mp_limb_t r1; mp_limb_t r; r0 = *(ap + (n - (mp_size_t)2)); r1 = *(ap + (n - (mp_size_t)1)); if (n > (mp_size_t)2) { mp_limb_t B2modb; mp_limb_t B2mb; mp_limb_t p0; mp_limb_t p1; mp_limb_t r2; mp_size_t j; int tmp; int tmp_0; int tmp_1; int tmp_2; B2modb = *(bmodb + 3); B2mb = B2modb - b; { UDItype __m0 = (unsigned long)r1; UDItype __m1 = (unsigned long)B2modb; /*@ assigns p1; assigns p1 \from r1, B2modb; */ __asm__ ("umulh %r1,%2,%0" : "=r" (p1) : "%rJ" (r1), "rI" (B2modb)); p0 = (long)(__m0 * __m1); } tmp = USItype(r0); tmp_0 = USItype(p1); tmp_1 = USItype(*(ap + (n - (mp_size_t)3))); tmp_2 = USItype(p0); /*@ assigns r2, r1, r0; assigns r2 \from tmp, tmp_0, tmp_1, tmp_2; assigns r1 \from tmp, tmp_0, tmp_1, tmp_2; assigns r0 \from tmp, tmp_0, tmp_1, tmp_2; */ __asm__ ( "add\t%6, %k2\n\t" "adc\t%4, %k1\n\t" "sbb\t%k0, %k0" : "=r" (r2), "=r" (r1), "=&r" (r0) : "1" (tmp), "g" (tmp_0), "%2" (tmp_1), "g" (tmp_2) ); j = n - (mp_size_t)4; while (j >= (mp_size_t)0) { { mp_limb_t cy; int tmp_3; int tmp_4; int tmp_5; int tmp_6; { UDItype __m0_0 = (unsigned long)r1; UDItype __m1_0 = (unsigned long)B2modb; /*@ assigns p1; assigns p1 \from r1, B2modb; */ __asm__ ("umulh %r1,%2,%0" : "=r" (p1) : "%rJ" (r1), "rI" (B2modb)); p0 = (long)(__m0_0 * __m1_0); } ADDC_LIMB(cy,r0,r0,r2 & B2modb); r0 -= - cy & b; tmp_3 = USItype(r0); tmp_4 = USItype(p1); tmp_5 = USItype(*(ap + j)); tmp_6 = USItype(p0); /*@ assigns r2, r1, r0; assigns r2 \from tmp_3, tmp_4, tmp_5, tmp_6; assigns r1 \from tmp_3, tmp_4, tmp_5, tmp_6; assigns r0 \from tmp_3, tmp_4, tmp_5, tmp_6; */ __asm__ ( "add\t%6, %k2\n\t" "adc\t%4, %k1\n\t" "sbb\t%k0, %k0" : "=r" (r2), "=r" (r1), "=&r" (r0) : "1" (tmp_3), "g" (tmp_4), "%2" (tmp_5), "g" (tmp_6) ); } j -= (mp_size_t)1; } r1 -= r2 & b; } cnt = (int)*(bmodb + 1); if (cnt != 0) { mp_limb_t t; mp_limb_t B1modb = *(bmodb + 2); { UDItype __m0_1 = (unsigned long)r1; UDItype __m1_1 = (unsigned long)B1modb; /*@ assigns r1; assigns r1 \from r1, B1modb; */ __asm__ ("umulh %r1,%2,%0" : "=r" (r1) : "%rJ" (r1), "rI" (B1modb)); t = (long)(__m0_1 * __m1_1); } r0 += t; r1 += (mp_limb_t)(r0 < t); r1 = (r1 << cnt) | (r0 >> (32 - cnt)); r0 <<= cnt; } else { mp_limb_t mask = - ((long)(r1 >= b)); r1 -= mask & b; } bi = *(bmodb + 0); udiv_rnnd_preinv(r,r1,r0,b,bi); __retres = r >> cnt; return __retres; } int loc[10]; void f(void) { unsigned long ulValue; unsigned long *pulValue = & ulValue; /*@ assigns loc[0 .. 9]; assigns loc[0 .. 9] \from loc[0 .. 9]; */ __asm__ ("sidt %0\n" : : "m" (loc)); /*@ assigns *(pulValue + (..)); assigns *(pulValue + (..)) \from (indirect: pulValue), *(pulValue + (..)); */ __asm__ ("movq $36, (%0)" : : "r" (pulValue)); int a = 2; int b = 3; /*@ assigns a; assigns a \from b; */ __asm__ ("mov %1, %0" : "=r" (a) : "r" (b) : "%eax"); return; } frama-c-20.0-Calcium/tests/syntax/oracle/assembly_gmp.1.res.oracle0000666000000000000000000000730713571573400021757 0ustar [kernel] Parsing tests/syntax/assembly_gmp.c (with preprocessing) /* Generated by Frama-C */ #include "stddef.h" typedef long mp_limb_t; typedef unsigned long UDItype; typedef long *mp_srcptr; typedef size_t mp_size_t; void ADDC_LIMB(mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t); void udiv_rnnd_preinv(mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t); mp_limb_t mpn_mod_1_1p(mp_srcptr ap, mp_size_t n, mp_limb_t b, mp_limb_t const * /*[4]*/ bmodb) { mp_limb_t __retres; int cnt; mp_limb_t bi; mp_limb_t r0; mp_limb_t r1; mp_limb_t r; r0 = *(ap + (n - (mp_size_t)2)); r1 = *(ap + (n - (mp_size_t)1)); if (n > (mp_size_t)2) { mp_limb_t B2modb; mp_limb_t B2mb; mp_limb_t p0; mp_limb_t p1; mp_limb_t r2; mp_size_t j; B2modb = *(bmodb + 3); B2mb = B2modb - b; { UDItype __m0 = (unsigned long)r1; UDItype __m1 = (unsigned long)B2modb; /*@ assigns p1; assigns p1 \from r1, B2modb; */ __asm__ ("umulh %r1,%2,%0" : "=r" (p1) : "%rJ" (r1), "rI" (B2modb)); p0 = (long)(__m0 * __m1); } /*@ assigns r2, r1, r0; assigns r2 \from r0, p1, *(ap + (n - 3)), p0; assigns r1 \from r0, p1, *(ap + (n - 3)), p0; assigns r0 \from r0, p1, *(ap + (n - 3)), p0; */ __asm__ ( "add\t%6, %q2\n\t" "adc\t%4, %q1\n\t" "sbb\t%q0, %q0" : "=r" (r2), "=r" (r1), "=&r" (r0) : "1" ((unsigned long)r0), "rme" ((unsigned long)p1), "%2" ((unsigned long)*(ap + (n - (mp_size_t)3))), "rme" ((unsigned long)p0) ); j = n - (mp_size_t)4; while (j >= (mp_size_t)0) { { mp_limb_t cy; { UDItype __m0_0 = (unsigned long)r1; UDItype __m1_0 = (unsigned long)B2modb; /*@ assigns p1; assigns p1 \from r1, B2modb; */ __asm__ ("umulh %r1,%2,%0" : "=r" (p1) : "%rJ" (r1), "rI" (B2modb)); p0 = (long)(__m0_0 * __m1_0); } ADDC_LIMB(cy,r0,r0,r2 & B2modb); r0 -= - cy & b; /*@ assigns r2, r1, r0; assigns r2 \from r0, p1, *(ap + j), p0; assigns r1 \from r0, p1, *(ap + j), p0; assigns r0 \from r0, p1, *(ap + j), p0; */ __asm__ ( "add\t%6, %q2\n\t" "adc\t%4, %q1\n\t" "sbb\t%q0, %q0" : "=r" (r2), "=r" (r1), "=&r" (r0) : "1" ((unsigned long)r0), "rme" ((unsigned long)p1), "%2" ((unsigned long)*(ap + j)), "rme" ((unsigned long)p0) ); } j -= (mp_size_t)1; } r1 -= r2 & b; } cnt = (int)*(bmodb + 1); if (cnt != 0) { mp_limb_t t; mp_limb_t B1modb = *(bmodb + 2); { UDItype __m0_1 = (unsigned long)r1; UDItype __m1_1 = (unsigned long)B1modb; /*@ assigns r1; assigns r1 \from r1, B1modb; */ __asm__ ("umulh %r1,%2,%0" : "=r" (r1) : "%rJ" (r1), "rI" (B1modb)); t = (long)(__m0_1 * __m1_1); } r0 += t; r1 += (mp_limb_t)(r0 < t); r1 = (r1 << cnt) | (r0 >> (64 - cnt)); r0 <<= cnt; } else { mp_limb_t mask = - ((long)(r1 >= b)); r1 -= mask & b; } bi = *(bmodb + 0); udiv_rnnd_preinv(r,r1,r0,b,bi); __retres = r >> cnt; return __retres; } int loc[10]; void f(void) { unsigned long ulValue; unsigned long *pulValue = & ulValue; /*@ assigns loc[0 .. 9]; assigns loc[0 .. 9] \from loc[0 .. 9]; */ __asm__ ("sidt %0\n" : : "m" (loc)); /*@ assigns *(pulValue + (..)); assigns *(pulValue + (..)) \from (indirect: pulValue), *(pulValue + (..)); */ __asm__ ("movq $36, (%0)" : : "r" (pulValue)); int a = 2; int b = 3; /*@ assigns a; assigns a \from b; */ __asm__ ("mov %1, %0" : "=r" (a) : "r" (b) : "%eax"); return; } frama-c-20.0-Calcium/tests/syntax/oracle/assembly_gmp.2.res.oracle0000666000000000000000000000720713571573400021757 0ustar [kernel] Parsing tests/syntax/assembly_gmp.c (with preprocessing) /* Generated by Frama-C */ #include "stddef.h" typedef long mp_limb_t; typedef unsigned long UDItype; typedef long *mp_srcptr; typedef size_t mp_size_t; void ADDC_LIMB(mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t); void udiv_rnnd_preinv(mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t); mp_limb_t mpn_mod_1_1p(mp_srcptr ap, mp_size_t n, mp_limb_t b, mp_limb_t const * /*[4]*/ bmodb) { mp_limb_t __retres; int cnt; mp_limb_t bi; mp_limb_t r0; mp_limb_t r1; mp_limb_t r; r0 = *(ap + (n - (mp_size_t)2)); r1 = *(ap + (n - (mp_size_t)1)); if (n > (mp_size_t)2) { mp_limb_t B2modb; mp_limb_t B2mb; mp_limb_t p0; mp_limb_t p1; mp_limb_t r2; mp_size_t j; B2modb = *(bmodb + 3); B2mb = B2modb - b; { UDItype __m0 = (unsigned long)r1; UDItype __m1 = (unsigned long)B2modb; /*@ assigns p1; assigns p1 \from r1, B2modb; */ __asm__ ("umulh %r1,%2,%0" : "=r" (p1) : "%rJ" (r1), "rI" (B2modb)); p0 = (long)(__m0 * __m1); } /*@ assigns r2, r1, r0; assigns r2 \from r0, p1, *(ap + (n - 3)), p0; assigns r1 \from r0, p1, *(ap + (n - 3)), p0; assigns r0 \from r0, p1, *(ap + (n - 3)), p0; */ __asm__ ( "add%I6c\t%2, %5, %6\n\t" "adde\t%1, %3, %4\n\t" "subfe\t%0, %0, %0\n\t" "nor\t%0, %0, %0" : "=r" (r2), "=r" (r1), "=&r" (r0) : "r" (r0), "r" (p1), "%r" (*(ap + (n - (mp_size_t)3))), "rI" (p0) ); j = n - (mp_size_t)4; while (j >= (mp_size_t)0) { { mp_limb_t cy; { UDItype __m0_0 = (unsigned long)r1; UDItype __m1_0 = (unsigned long)B2modb; /*@ assigns p1; assigns p1 \from r1, B2modb; */ __asm__ ("umulh %r1,%2,%0" : "=r" (p1) : "%rJ" (r1), "rI" (B2modb)); p0 = (long)(__m0_0 * __m1_0); } ADDC_LIMB(cy,r0,r0,r2 & B2modb); r0 -= - cy & b; /*@ assigns r2, r1, r0; assigns r2 \from r0, p1, *(ap + j), p0; assigns r1 \from r0, p1, *(ap + j), p0; assigns r0 \from r0, p1, *(ap + j), p0; */ __asm__ ( "add%I6c\t%2, %5, %6\n\t" "adde\t%1, %3, %4\n\t" "subfe\t%0, %0, %0\n\t" "nor\t%0, %0, %0" : "=r" (r2), "=r" (r1), "=&r" (r0) : "r" (r0), "r" (p1), "%r" (*(ap + j)), "rI" (p0) ); } j -= (mp_size_t)1; } r1 -= r2 & b; } cnt = (int)*(bmodb + 1); if (cnt != 0) { mp_limb_t t; mp_limb_t B1modb = *(bmodb + 2); { UDItype __m0_1 = (unsigned long)r1; UDItype __m1_1 = (unsigned long)B1modb; /*@ assigns r1; assigns r1 \from r1, B1modb; */ __asm__ ("umulh %r1,%2,%0" : "=r" (r1) : "%rJ" (r1), "rI" (B1modb)); t = (long)(__m0_1 * __m1_1); } r0 += t; r1 += (mp_limb_t)(r0 < t); r1 = (r1 << cnt) | (r0 >> (32 - cnt)); r0 <<= cnt; } else { mp_limb_t mask = - ((long)(r1 >= b)); r1 -= mask & b; } bi = *(bmodb + 0); udiv_rnnd_preinv(r,r1,r0,b,bi); __retres = r >> cnt; return __retres; } int loc[10]; void f(void) { unsigned long ulValue; unsigned long *pulValue = & ulValue; /*@ assigns loc[0 .. 9]; assigns loc[0 .. 9] \from loc[0 .. 9]; */ __asm__ ("sidt %0\n" : : "m" (loc)); /*@ assigns *(pulValue + (..)); assigns *(pulValue + (..)) \from (indirect: pulValue), *(pulValue + (..)); */ __asm__ ("movq $36, (%0)" : : "r" (pulValue)); int a = 2; int b = 3; /*@ assigns a; assigns a \from b; */ __asm__ ("mov %1, %0" : "=r" (a) : "r" (b) : "%eax"); return; } frama-c-20.0-Calcium/tests/syntax/oracle/ast_init.res.oracle0000666000000000000000000000023013571573400020734 0ustar [kernel] Parsing tests/syntax/ast_init.i (no preprocessing) /* Generated by Frama-C */ int f(int x) { ; return x; } int g(int x) { return x; } frama-c-20.0-Calcium/tests/syntax/oracle/attributes-declarations-definitions.res.oracle0000666000000000000000000000366613571573400026307 0ustar [kernel] Parsing tests/syntax/attributes-declarations-definitions.c (with preprocessing) [kernel] tests/syntax/attributes-declarations-definitions.c:7: Warning: found two contracts (old location: tests/syntax/attributes-declarations-definitions.c:1). Merging them [kernel] tests/syntax/attributes-declarations-definitions.c:16: Warning: found two contracts (old location: tests/syntax/attributes-declarations-definitions.c:8). Merging them /* Generated by Frama-C */ typedef int __attribute__((__a1__)) aint; typedef int __attribute__((__p1__)) * __attribute__((__p2__)) iptr; int __attribute__((__tret5__, __tret4__, __tret3__, __tret2__, __tret1__)) f (int const __attribute__((__arg3__)) p3) __attribute__((__f5__, __f4__, __f2__, __f1__)); /*@ requires p3 ≥ 3; requires p3 ≥ 1; requires p3 ≥ 4; */ int __attribute__((__tret5__, __tret4__, __tret3__, __tret2__, __tret1__)) f (int const __attribute__((__arg3__)) p3) __attribute__((__f5__, __f4__, __f2__, __f1__)); int __attribute__((__tret5__, __tret4__, __tret3__, __tret2__, __tret1__)) f (int const __attribute__((__arg3__)) p3) { int __attribute__((__tret5__, __tret4__, __tret3__, __tret2__, __tret1__)) __retres; __retres = (int __attribute__((__tret3__, __tret2__, __tret1__)))p3; return __retres; } aint g(int __attribute__((__a2__)) i3); aint g(int __attribute__((__a2__)) i3) { aint __retres; __retres = (int __attribute__((__a1__)))i3; return __retres; } iptr h(iptr volatile ip2); iptr h(iptr volatile ip2) { iptr __retres; __retres = (int __attribute__((__p1__)) *)0; return __retres; } void test(void) { int a; int b __attribute__((__unused__)); return; } int __attribute__((__o__)) one_letter_attribute; int __attribute__((__n__)) one_letter_attribute_with_underscore; int __attribute__((__e__)) one_letter_attribute_with_underscore_after; frama-c-20.0-Calcium/tests/syntax/oracle/axiomatic_nested.res.oracle0000666000000000000000000000062413571573400022451 0ustar [kernel] Parsing tests/syntax/axiomatic_nested.i (no preprocessing) [kernel:annot-error] tests/syntax/axiomatic_nested.i:4: Warning: Nested axiomatic. Ignoring body of bla2. Ignoring global annotation [kernel] User Error: warning annot-error treated as fatal error. [kernel] User Error: stopping on file "tests/syntax/axiomatic_nested.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/bad_return_bts_599.res.oracle0000666000000000000000000000067713571573400022544 0ustar [kernel] Parsing tests/syntax/bad_return_bts_599.i (no preprocessing) [kernel] tests/syntax/bad_return_bts_599.i:4: User Error: Return statement without a value in function returning int [kernel] tests/syntax/bad_return_bts_599.i:9: User Error: Return statement without a value in function returning int [kernel] User Error: stopping on file "tests/syntax/bad_return_bts_599.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/basic_asm.res.oracle0000666000000000000000000000047613571573400021057 0ustar [kernel] Parsing tests/syntax/basic_asm.i (no preprocessing) /* Generated by Frama-C */ int main(unsigned short bit) { int __retres; /*@ assigns \nothing; */ __asm__ ("1: jmp %l[t_no]\n" : ); __asm__ ("2: nop\n"); __retres = 1; goto return_label; t_no: __retres = 0; return_label: return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/bts0323.res.oracle0000666000000000000000000000043413571573400020230 0ustar [kernel] Parsing tests/syntax/bts0323.c (with preprocessing) [kernel] Parsing tests/syntax/bts0323-2.c (with preprocessing) /* Generated by Frama-C */ int x; void g(void); void f(void) { x = 0; return; } int x = 1; /*@ ensures x ≢ 0; */ void g(void) { x = 2; return; } frama-c-20.0-Calcium/tests/syntax/oracle/bts0442-2.res.oracle0000666000000000000000000000054313571573400020372 0ustar [kernel] Parsing tests/syntax/bts0442-2.i (no preprocessing) [kernel] Parsing tests/syntax/bts0442.i (no preprocessing) [kernel] Warning: merging definitions of enum E using int type (different names for enumeration items); items {E1=1, E2=2} and {E0=0, E1=1} /* Generated by Frama-C */ int ve1 = 1; void f(void) { ve1 = 0; return; } int ve2 = 2; frama-c-20.0-Calcium/tests/syntax/oracle/bts0442.res.oracle0000666000000000000000000000054313571573400020233 0ustar [kernel] Parsing tests/syntax/bts0442.i (no preprocessing) [kernel] Parsing tests/syntax/bts0442-2.i (no preprocessing) [kernel] Warning: merging definitions of enum E using int type (different names for enumeration items); items {E0=0, E1=1} and {E1=1, E2=2} /* Generated by Frama-C */ int ve2 = 2; int ve1 = 1; void f(void) { ve1 = 0; return; } frama-c-20.0-Calcium/tests/syntax/oracle/bts0519.0.res.oracle0000666000000000000000000000037713571573400020403 0ustar [kernel] Parsing tests/syntax/bts0519.c (with preprocessing) /* Generated by Frama-C */ int t[4]; void f(int * /*[3]*/ /* static */ a) { *(a + 2) = 3; return; } int main(void) { int __retres; f((int *)(t)); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/bts0519.1.res.oracle0000666000000000000000000000055713571573400020404 0ustar [kernel] Parsing tests/syntax/bts0519.c (with preprocessing) [kernel] tests/syntax/bts0519.c:9: User Error: static specifier inside array argument is allowed only in function argument [kernel] User Error: stopping on file "tests/syntax/bts0519.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/bts0577.res.oracle0000666000000000000000000000047413571573400020247 0ustar [kernel] Parsing tests/syntax/bts0577.i (no preprocessing) /* Generated by Frama-C */ enum __anonenum_E1_1 { E1_a = 0, E1_b = 1, E1_c = 2 }; enum __anonenum_E2_2 { E2_a = E1_a, E2_b = 1 }; typedef enum __anonenum_E2_2 E2; int f(E2 e) { int __retres; __retres = (int)e; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/bts0588.res.oracle0000666000000000000000000000033713571573400020247 0ustar [kernel] Parsing tests/syntax/bts0588.i (no preprocessing) /* Generated by Frama-C */ void g(int a); /*@ requires a ≥ 0; */ void g(int a) { return; } /*@ ensures \old(a) > 0; */ void f(int a) { a = 1; return; } frama-c-20.0-Calcium/tests/syntax/oracle/bts0672_link.0.res.oracle0000666000000000000000000000125513571573400021414 0ustar [kernel] Parsing tests/syntax/bts0672_link.c (with preprocessing) [kernel] Parsing tests/syntax/bts0672_link_2.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/syntax/bts0672_link_2.c:10: Warning: Calling undeclared function Frama_C_nondet. Old style K&R code? /* Generated by Frama-C */ int Frama_C_entropy_source; /*@ predicate foo(ℤ x) = \true; */ /*@ ensures foo(\result); assigns \result, Frama_C_entropy_source; assigns \result \from a, b, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ extern int Frama_C_nondet(int a, int b); void main(void) { int x = Frama_C_nondet(0,59); return; } frama-c-20.0-Calcium/tests/syntax/oracle/bts0672_link.1.res.oracle0000666000000000000000000000101213571573400021404 0ustar [kernel] Parsing tests/syntax/bts0672_link.c (with preprocessing) [kernel] Parsing tests/syntax/bts0672_link_2.c (with preprocessing) /* Generated by Frama-C */ int Frama_C_entropy_source; /*@ predicate foo(ℤ x) = \true; */ /*@ ensures foo(\result); assigns \result, Frama_C_entropy_source; assigns \result \from a, b, Frama_C_entropy_source; assigns Frama_C_entropy_source \from Frama_C_entropy_source; */ int Frama_C_nondet(int a, int b); void main(void) { int x = Frama_C_nondet(0,59); return; } frama-c-20.0-Calcium/tests/syntax/oracle/bts0769.res.oracle0000666000000000000000000000053013571573400020243 0ustar [kernel] Parsing tests/syntax/bts0769.i (no preprocessing) /* Generated by Frama-C */ struct __anonstruct___1 { int ui ; }; union foo { int ii ; }; struct s { struct __anonstruct___1 _ ; union foo __anonCompField1 ; }; struct s S; int main(void) { int __retres; __retres = S._.ui + S.__anonCompField1.ii; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/bts0916.res.oracle0000666000000000000000000000147513571573400020246 0ustar [kernel] Parsing tests/syntax/bts0916.i (no preprocessing) /* Generated by Frama-C */ /* run.config STDOPT: +"-keep-comments" */ /* Use frama-c with option -keep-comments */ void main(void) { int port = 10; /* ( port & 0x80 ) == 0 ) */ /* wait for pin1 - Compliant */ /* wait for pin2 */ /* Not compliant/*, comment before ; */ /* wait for pin3 - Not compliant, no white-space char after ; */ while (1) { int tmp; tmp = port; port --; ; if (! (tmp > 0)) /* ( port & 0x80 ) == 0 ) */ /* wait for pin1 - Compliant */ /* wait for pin2 */ /* Not compliant/*, comment before ; */ /* wait for pin3 - Not compliant, no white-space char after ; */ break; } return; } frama-c-20.0-Calcium/tests/syntax/oracle/bts1553.res.oracle0000666000000000000000000000066113571573400020240 0ustar [kernel] Parsing tests/syntax/bts1553.i (no preprocessing) /* Generated by Frama-C */ struct a { int b ; }; static struct a __constr_expr_0 = {.b = 1}; struct a *d[1] = {& __constr_expr_0}; static struct a __constr_expr_1 = {.b = 5}; struct a *tmp[1] = {& __constr_expr_1}; int wibble(void) { int __retres; __retres = 1; return __retres; } static struct a __constr_expr_2 = {.b = 2}; struct a *e[1] = {& __constr_expr_2}; frama-c-20.0-Calcium/tests/syntax/oracle/bts1553_2.res.oracle0000666000000000000000000000520013571573400020453 0ustar [kernel] Parsing tests/syntax/bts1553_2.i (no preprocessing) [kernel:file:print-one] result of parsing tests/syntax/bts1553_2.i: /* Generated by Frama-C */ struct a { int b ; }; /* compiler builtin: __builtin_va_list __builtin_next_arg(void); */ /* compiler builtin: void __builtin_stdarg_start(__builtin_va_list); */ /* compiler builtin: void __builtin_va_arg(__builtin_va_list, unsigned int, void *); */ /* compiler builtin: void __builtin_va_copy(__builtin_va_list, __builtin_va_list); */ /* compiler builtin: void __builtin_va_end(__builtin_va_list); */ /* compiler builtin: void __builtin_va_start(__builtin_va_list); */ /* compiler builtin: void __builtin_varargs_start(__builtin_va_list); */ static struct a __constr_expr_0 = {.b = 1}; struct a *d[1] = {& __constr_expr_0}; static struct a __constr_expr_1 = {.b = 2}; struct a *e[1] = {& __constr_expr_1}; void foo(int c) { struct a **tmp; if (c) tmp = d; else tmp = e; struct a **p = tmp; return; } [kernel] Parsing tests/syntax/bts1553.i (no preprocessing) [kernel:file:print-one] result of parsing tests/syntax/bts1553.i: /* Generated by Frama-C */ struct a { int b ; }; /* compiler builtin: __builtin_va_list __builtin_next_arg(void); */ /* compiler builtin: void __builtin_stdarg_start(__builtin_va_list); */ /* compiler builtin: void __builtin_va_arg(__builtin_va_list, unsigned int, void *); */ /* compiler builtin: void __builtin_va_copy(__builtin_va_list, __builtin_va_list); */ /* compiler builtin: void __builtin_va_end(__builtin_va_list); */ /* compiler builtin: void __builtin_va_start(__builtin_va_list); */ /* compiler builtin: void __builtin_varargs_start(__builtin_va_list); */ static struct a __constr_expr_0 = {.b = 1}; struct a *d[1] = {& __constr_expr_0}; static struct a __constr_expr_1 = {.b = 5}; struct a *tmp[1] = {& __constr_expr_1}; int wibble(void) { return 1; } static struct a __constr_expr_2 = {.b = 2}; struct a *e[1] = {& __constr_expr_2}; [kernel:file:annotation] Marking properties /* Generated by Frama-C */ struct a { int b ; }; static struct a __constr_expr_0 = {.b = 1}; struct a *d[1] = {& __constr_expr_0}; static struct a __constr_expr_1 = {.b = 2}; struct a *e[1] = {& __constr_expr_1}; void foo(int c) { struct a **tmp_0; if (c) tmp_0 = d; else tmp_0 = e; struct a **p = tmp_0; return; } static struct a __constr_expr_3 = {.b = 5}; struct a *tmp[1] = {& __constr_expr_3}; int wibble(void) { int __retres; __retres = 1; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/bts59.res.oracle0000666000000000000000000000040213571573400020071 0ustar [kernel] Parsing tests/syntax/bts59.i (no preprocessing) /* Generated by Frama-C */ float g(void) { float __retres_5; double __retres = (double)2; int first = 6; { int first_0 = 5; __retres_5 = (float)__retres; return __retres_5; } } frama-c-20.0-Calcium/tests/syntax/oracle/built.res.oracle0000666000000000000000000000075413571573400020254 0ustar [kernel] Parsing tests/syntax/built.i (no preprocessing) [kernel] tests/syntax/built.i:21: Case label -1 exceeds range of unsigned int for switch expression. Nothing to worry. /* Generated by Frama-C */ char ___assert_task_state[1 - 2 * ! (! 0)]; int X; void main(int z) { switch (sizeof(z)) { case (unsigned int)1: X ++; break; case (unsigned int)2: ___assert_task_state[0] = (char)1; break; case (unsigned int)(-1): X ++; break; } return; } int T[1 + 0]; frama-c-20.0-Calcium/tests/syntax/oracle/builtin_constant_p.res.oracle0000666000000000000000000000026213571573400023025 0ustar [kernel] Parsing tests/syntax/builtin_constant_p.i (no preprocessing) /* Generated by Frama-C */ int __builtin_constant_p(int a) { return a; } void main(void) { return; } frama-c-20.0-Calcium/tests/syntax/oracle/cert-dcl-36.res.oracle0000666000000000000000000000104213571573400021047 0ustar [kernel] Parsing tests/syntax/cert-dcl-36.c (with preprocessing) [kernel] tests/syntax/cert-dcl-36.c:7: User Error: Inconsistent storage specification for i2. Previous declaration: tests/syntax/cert-dcl-36.c:2 [kernel] tests/syntax/cert-dcl-36.c:10: User Error: Inconsistent storage specification for i5. Previous declaration: tests/syntax/cert-dcl-36.c:5 [kernel] User Error: stopping on file "tests/syntax/cert-dcl-36.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/cert_exp10.res.oracle0000666000000000000000000000106013571573400021076 0ustar [kernel] Parsing tests/syntax/cert_exp10.c (with preprocessing) [kernel:CERT:EXP:10] tests/syntax/cert_exp10.c:11: Warning: Potential unsequenced side-effects [kernel:CERT:EXP:10] tests/syntax/cert_exp10.c:13: Warning: Potential unsequenced side-effects /* Generated by Frama-C */ extern int f(int); int main(void) { int __retres; int tmp_0; int tmp_1; int i = 3; int z = 3; int m1 = f(1); tmp_0 = f(2); tmp_1 = f(3); int m2 = tmp_0 + tmp_1; if (i > 0) { i ++; z = i; } else z = i; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/cert_exp46.res.oracle0000666000000000000000000000626213571573400021120 0ustar [kernel] Parsing tests/syntax/cert_exp46.i (no preprocessing) [kernel:CERT:EXP:46] tests/syntax/cert_exp46.i:5: Warning: operand of bitwise operator is a logical relation [kernel:CERT:EXP:46] tests/syntax/cert_exp46.i:11: Warning: operand of bitwise operator is a logical relation [kernel:CERT:EXP:46] tests/syntax/cert_exp46.i:11: Warning: operand of bitwise operator is a logical relation [kernel:CERT:EXP:46] tests/syntax/cert_exp46.i:17: Warning: operand of bitwise operator has boolean type [kernel:CERT:EXP:46] tests/syntax/cert_exp46.i:17: Warning: operand of bitwise operator has boolean type /* Generated by Frama-C */ extern int f(void); extern int g(void); int non_compliant_1(void) { int __retres; int tmp_0; int tmp; int tmp_1; tmp = f(); if (tmp) tmp_0 = 0; else tmp_0 = 1; tmp_1 = g(); if (tmp_0 & (tmp_1 == 0)) { __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } int non_compliant_2(void) { int __retres; int tmp_1; int tmp_2; int x = f(); int y = g(); tmp_1 = x; x ++; tmp_2 = y; y --; ; if ((tmp_1 == 0) | (tmp_2 == 0)) { __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } int non_compliant_3(void) { int __retres; int tmp; int tmp_0; tmp = f(); _Bool b = (_Bool)(tmp != 0); tmp_0 = g(); _Bool c = (_Bool)(tmp_0 != 0); if ((int)b ^ (int)c) { __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } int compliant_1(void) { int __retres; int tmp; tmp = f(); if (tmp) { __retres = 0; goto return_label; } else { int tmp_0; tmp_0 = g(); if (tmp_0 == 0) { __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } } return_label: return __retres; } int compliant_2(void) { int __retres; int tmp_1; int x = f(); int y = g(); tmp_1 = x; x ++; ; if (tmp_1 == 0) { __retres = 1; goto return_label; } else { int tmp_2; tmp_2 = y; y --; ; if (tmp_2 == 0) { __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } } return_label: return __retres; } int compliant_3(void) { int __retres; int tmp; int tmp_0; tmp = f(); _Bool b = (_Bool)(tmp != 0); tmp_0 = g(); _Bool c = (_Bool)(tmp_0 != 0); if (b) goto _LOR; else if (c) { _LOR: ; if (b) if (c) { __retres = 0; goto return_label; } else { __retres = 1; goto return_label; } else { __retres = 1; goto return_label; } } else { __retres = 0; goto return_label; } return_label: return __retres; } int compliant_4(void) { int __retres; int tmp; int tmp_0; tmp = f(); _Bool b = (_Bool)(tmp != 0); tmp_0 = g(); _Bool c = (_Bool)(tmp_0 != 0); if ((int)b ^ (int)c) { __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/cert_msc_38.0.res.oracle0000666000000000000000000000072113571573400021376 0ustar [kernel] Parsing tests/syntax/cert_msc_38.c (with preprocessing) [kernel:CERT:MSC:38] Warning: assert is a standard macro. Its definition cannot be suppressed, see CERT C coding rules MSC38-C [kernel] tests/syntax/cert_msc_38.c:25: User Error: Cannot resolve variable assert [kernel] User Error: stopping on file "tests/syntax/cert_msc_38.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/cert_msc_38.1.res.oracle0000666000000000000000000000063213571573400021400 0ustar [kernel] Parsing tests/syntax/cert_msc_38.c (with preprocessing) [kernel:CERT:MSC:38] Warning: Attempt to declare errno as external identifier outside of the stdlib. It is supposed to be a macro name and cannot be declared. See CERT C coding rule MSC38-C [kernel] Warning: warning CERT:MSC:38 treated as deferred error. See above messages for more information. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/cert_msc_38.2.res.oracle0000666000000000000000000000064513571573400021405 0ustar [kernel] Parsing tests/syntax/cert_msc_38.c (with preprocessing) [kernel:CERT:MSC:38] Warning: Attempt to declare math_errhandling as external identifier outside of the stdlib. It is supposed to be a macro name and cannot be declared. See CERT C coding rule MSC38-C [kernel] Warning: warning CERT:MSC:38 treated as deferred error. See above messages for more information. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/cert_msc_38.3.res.oracle0000666000000000000000000000072513571573400021405 0ustar [kernel] Parsing tests/syntax/cert_msc_38.c (with preprocessing) [kernel:CERT:MSC:38] Warning: va_start is a standard macro. Its definition cannot be suppressed, see CERT C coding rules MSC38-C [kernel] tests/syntax/cert_msc_38.c:42: User Error: Cannot resolve variable va_start [kernel] User Error: stopping on file "tests/syntax/cert_msc_38.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/cert_msc_38.4.res.oracle0000666000000000000000000000072313571573400021404 0ustar [kernel] Parsing tests/syntax/cert_msc_38.c (with preprocessing) [kernel:CERT:MSC:38] Warning: va_copy is a standard macro. Its definition cannot be suppressed, see CERT C coding rules MSC38-C [kernel] tests/syntax/cert_msc_38.c:46: User Error: Cannot resolve variable va_copy [kernel] User Error: stopping on file "tests/syntax/cert_msc_38.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/cert_msc_38.5.res.oracle0000666000000000000000000000072113571573400021403 0ustar [kernel] Parsing tests/syntax/cert_msc_38.c (with preprocessing) [kernel:CERT:MSC:38] Warning: va_arg is a standard macro. Its definition cannot be suppressed, see CERT C coding rules MSC38-C [kernel] tests/syntax/cert_msc_38.c:50: User Error: Cannot resolve variable va_arg [kernel] User Error: stopping on file "tests/syntax/cert_msc_38.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/cert_msc_38.6.res.oracle0000666000000000000000000000072113571573400021404 0ustar [kernel] Parsing tests/syntax/cert_msc_38.c (with preprocessing) [kernel:CERT:MSC:38] Warning: va_end is a standard macro. Its definition cannot be suppressed, see CERT C coding rules MSC38-C [kernel] tests/syntax/cert_msc_38.c:54: User Error: Cannot resolve variable va_end [kernel] User Error: stopping on file "tests/syntax/cert_msc_38.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/cert_msc_38.7.res.oracle0000666000000000000000000000053313571573400021406 0ustar [kernel] Parsing tests/syntax/cert_msc_38.c (with preprocessing) [kernel:CERT:MSC:38] Warning: setjmp is a standard macro. Its definition cannot be suppressed, see CERT C coding rules MSC38-C [kernel] Warning: warning CERT:MSC:38 treated as deferred error. See above messages for more information. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/char_is_unsigned.res.oracle0000666000000000000000000000063013571573400022432 0ustar [kernel] Parsing tests/syntax/char_is_unsigned.i (no preprocessing) /* Generated by Frama-C */ char t[10]; void main(void) { int r = (int)t[0] == 'a'; char c = (char)455; return; } [kernel] Parsing tests/syntax/char_is_unsigned.i (no preprocessing) [rte] annotating function main /* Generated by Frama-C */ char t[10]; void main(void) { int r = (int)t[0] == 97; char c = (char)199; return; } frama-c-20.0-Calcium/tests/syntax/oracle/check_builtin_bts1440.res.oracle0000666000000000000000000005610713571573400023124 0ustar [kernel] Parsing tests/syntax/check_builtin_bts1440.i (no preprocessing) [kernel:file:print-one] result of parsing tests/syntax/check_builtin_bts1440.i: /* Generated by Frama-C */ int __builtin___fprintf_chk(void *, int, char const * , ...); void *__builtin___memcpy_chk(void *, void const *, unsigned int, unsigned int); void *__builtin___memmove_chk(void *, void const *, unsigned int, unsigned int); void *__builtin___mempcpy_chk(void *, void const *, unsigned int, unsigned int); void *__builtin___memset_chk(void *, int, unsigned int, unsigned int); int __builtin___printf_chk(int, char const * , ...); int __builtin___snprintf_chk(char *, unsigned int, int, unsigned int, char const * , ...); int __builtin___sprintf_chk(char *, int, unsigned int, char const * , ...); char *__builtin___stpcpy_chk(char *, char const *, unsigned int); char *__builtin___strcat_chk(char *, char const *, unsigned int); char *__builtin___strcpy_chk(char *, char const *, unsigned int); char *__builtin___strncat_chk(char *, char const *, unsigned int, unsigned int); char *__builtin___strncpy_chk(char *, char const *, unsigned int, unsigned int); int __builtin___vfprintf_chk(void *, int, char const *, __builtin_va_list); int __builtin___vprintf_chk(int, char const *, __builtin_va_list); int __builtin___vsnprintf_chk(char *, unsigned int, int, unsigned int, char const *, __builtin_va_list); int __builtin___vsprintf_chk(char *, int, unsigned int, char const *, __builtin_va_list); double __builtin_acos(double); float __builtin_acosf(float); long double __builtin_acosl(long double); void *__builtin_alloca(unsigned int); double __builtin_asin(double); float __builtin_asinf(float); long double __builtin_asinl(long double); double __builtin_atan(double); double __builtin_atan2(double, double); float __builtin_atan2f(float, float); long double __builtin_atan2l(long double, long double); float __builtin_atanf(float); long double __builtin_atanl(long double); unsigned short __builtin_bswap16(unsigned short); unsigned int __builtin_bswap32(unsigned int); unsigned long long __builtin_bswap64(unsigned long long); double __builtin_ceil(double); float __builtin_ceilf(float); long double __builtin_ceill(long double); int __builtin_clz(unsigned int); int __builtin_clzl(unsigned long); int __builtin_clzll(unsigned long long); int __builtin_constant_p(int); double __builtin_cos(double); float __builtin_cosf(float); double __builtin_cosh(double); float __builtin_coshf(float); long double __builtin_coshl(long double); long double __builtin_cosl(long double); int __builtin_ctz(unsigned int); int __builtin_ctzl(unsigned long); int __builtin_ctzll(unsigned long long); double __builtin_exp(double); long __builtin_expect(long, long); float __builtin_expf(float); long double __builtin_expl(long double); double __builtin_fabs(double); float __builtin_fabsf(float); long double __builtin_fabsl(long double); int __builtin_ffs(unsigned int); int __builtin_ffsl(unsigned long); int __builtin_ffsll(unsigned long long); double __builtin_floor(double); float __builtin_floorf(float); long double __builtin_floorl(long double); double __builtin_fmod(double); float __builtin_fmodf(float); long double __builtin_fmodl(long double); void *__builtin_frame_address(unsigned int); double __builtin_frexp(double, int *); float __builtin_frexpf(float, int *); long double __builtin_frexpl(long double, int *); double __builtin_huge_val(void); float __builtin_huge_valf(void); long double __builtin_huge_vall(void); void __builtin_ia32_lfence(void); void __builtin_ia32_mfence(void); void __builtin_ia32_sfence(void); double __builtin_inf(void); float __builtin_inff(void); long double __builtin_infl(void); double __builtin_ldexp(double, int); float __builtin_ldexpf(float, int); long double __builtin_ldexpl(long double, int); double __builtin_log(double); double __builtin_log10(double); float __builtin_log10f(float); long double __builtin_log10l(long double); float __builtin_logf(float); long double __builtin_logl(long double); void *__builtin_memcpy(void *, void const *, unsigned int); void *__builtin_mempcpy(void *, void const *, unsigned int); void *__builtin_memset(void *, int, int); float __builtin_modff(float, float *); long double __builtin_modfl(long double, long double *); double __builtin_nan(char const *); float __builtin_nanf(char const *); long double __builtin_nanl(char const *); double __builtin_nans(char const *); float __builtin_nansf(char const *); long double __builtin_nansl(char const *); __builtin_va_list __builtin_next_arg(void); unsigned int __builtin_object_size(void *, int); int __builtin_parity(unsigned int); int __builtin_parityl(unsigned long); int __builtin_parityll(unsigned long long); int __builtin_popcount(unsigned int); int __builtin_popcountl(unsigned long); int __builtin_popcountll(unsigned long long); double __builtin_powi(double, int); float __builtin_powif(float, int); long double __builtin_powil(long double, int); void __builtin_prefetch(void const * , ...); void __builtin_return(void const *); void *__builtin_return_address(unsigned int); double __builtin_sin(double); float __builtin_sinf(float); double __builtin_sinh(double); float __builtin_sinhf(float); long double __builtin_sinhl(long double); long double __builtin_sinl(long double); double __builtin_sqrt(double); float __builtin_sqrtf(float); long double __builtin_sqrtl(long double); void __builtin_stdarg_start(__builtin_va_list); char *__builtin_stpcpy(char *, char const *); char *__builtin_strchr(char *, int); int __builtin_strcmp(char const *, char const *); char *__builtin_strcpy(char *, char const *); unsigned int __builtin_strcspn(char const *, char const *); char *__builtin_strncat(char *, char const *, unsigned int); int __builtin_strncmp(char const *, char const *, unsigned int); char *__builtin_strncpy(char *, char const *, unsigned int); char *__builtin_strpbrk(char const *, char const *); unsigned int __builtin_strspn(char const *, char const *); double __builtin_tan(double); float __builtin_tanf(float); double __builtin_tanh(double); float __builtin_tanhf(float); long double __builtin_tanhl(long double); long double __builtin_tanl(long double); int __builtin_types_compatible_p(unsigned int, unsigned int); void __builtin_unreachable(void); void __builtin_va_arg(__builtin_va_list, unsigned int, void *); void __builtin_va_copy(__builtin_va_list, __builtin_va_list); void __builtin_va_end(__builtin_va_list); void __builtin_va_start(__builtin_va_list); void __builtin_varargs_start(__builtin_va_list); short __sync_add_and_fetch_int16_t(short volatile *, short , ...); int __sync_add_and_fetch_int32_t(int volatile *, int , ...); long long __sync_add_and_fetch_int64_t(long long volatile *, long long , ...); signed char __sync_add_and_fetch_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_add_and_fetch_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_add_and_fetch_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_add_and_fetch_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_add_and_fetch_uint8_t(unsigned char volatile *, unsigned char , ...); short __sync_and_and_fetch_int16_t(short volatile *, short , ...); int __sync_and_and_fetch_int32_t(int volatile *, int , ...); long long __sync_and_and_fetch_int64_t(long long volatile *, long long , ...); signed char __sync_and_and_fetch_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_and_and_fetch_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_and_and_fetch_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_and_and_fetch_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_and_and_fetch_uint8_t(unsigned char volatile *, unsigned char , ...); int __sync_bool_compare_and_swap_int16_t(short volatile *, short, short , ...); int __sync_bool_compare_and_swap_int32_t(int volatile *, int, int , ...); int __sync_bool_compare_and_swap_int64_t(long long volatile *, long long, long long , ...); int __sync_bool_compare_and_swap_int8_t(signed char volatile *, signed char, signed char , ...); int __sync_bool_compare_and_swap_uint16_t(unsigned short volatile *, unsigned short, unsigned short , ...); int __sync_bool_compare_and_swap_uint32_t(unsigned int volatile *, unsigned int, unsigned int , ...); int __sync_bool_compare_and_swap_uint64_t(unsigned long long volatile *, unsigned long long, unsigned long long , ...); int __sync_bool_compare_and_swap_uint8_t(unsigned char volatile *, unsigned char, unsigned char , ...); short __sync_fetch_and_add_int16_t(short volatile *, short , ...); int __sync_fetch_and_add_int32_t(int volatile *, int , ...); long long __sync_fetch_and_add_int64_t(long long volatile *, long long , ...); signed char __sync_fetch_and_add_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_fetch_and_add_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_fetch_and_add_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_fetch_and_add_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_fetch_and_add_uint8_t(unsigned char volatile *, unsigned char , ...); short __sync_fetch_and_and_int16_t(short volatile *, short , ...); int __sync_fetch_and_and_int32_t(int volatile *, int , ...); long long __sync_fetch_and_and_int64_t(long long volatile *, long long , ...); signed char __sync_fetch_and_and_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_fetch_and_and_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_fetch_and_and_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_fetch_and_and_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_fetch_and_and_uint8_t(unsigned char volatile *, unsigned char , ...); short __sync_fetch_and_nand_int16_t(short volatile *, short , ...); int __sync_fetch_and_nand_int32_t(int volatile *, int , ...); long long __sync_fetch_and_nand_int64_t(long long volatile *, long long , ...); signed char __sync_fetch_and_nand_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_fetch_and_nand_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_fetch_and_nand_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_fetch_and_nand_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_fetch_and_nand_uint8_t(unsigned char volatile *, unsigned char , ...); short __sync_fetch_and_or_int16_t(short volatile *, short , ...); int __sync_fetch_and_or_int32_t(int volatile *, int , ...); long long __sync_fetch_and_or_int64_t(long long volatile *, long long , ...); signed char __sync_fetch_and_or_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_fetch_and_or_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_fetch_and_or_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_fetch_and_or_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_fetch_and_or_uint8_t(unsigned char volatile *, unsigned char , ...); short __sync_fetch_and_sub_int16_t(short volatile *, short , ...); int __sync_fetch_and_sub_int32_t(int volatile *, int , ...); long long __sync_fetch_and_sub_int64_t(long long volatile *, long long , ...); signed char __sync_fetch_and_sub_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_fetch_and_sub_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_fetch_and_sub_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_fetch_and_sub_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_fetch_and_sub_uint8_t(unsigned char volatile *, unsigned char , ...); short __sync_fetch_and_xor_int16_t(short volatile *, short , ...); int __sync_fetch_and_xor_int32_t(int volatile *, int , ...); long long __sync_fetch_and_xor_int64_t(long long volatile *, long long , ...); signed char __sync_fetch_and_xor_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_fetch_and_xor_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_fetch_and_xor_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_fetch_and_xor_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_fetch_and_xor_uint8_t(unsigned char volatile *, unsigned char , ...); void __sync_lock_release_int16_t(short volatile * , ...); void __sync_lock_release_int32_t(int volatile * , ...); void __sync_lock_release_int64_t(long long volatile * , ...); void __sync_lock_release_int8_t(signed char volatile * , ...); void __sync_lock_release_uint16_t(unsigned short volatile * , ...); void __sync_lock_release_uint32_t(unsigned int volatile * , ...); void __sync_lock_release_uint64_t(unsigned long long volatile * , ...); void __sync_lock_release_uint8_t(unsigned char volatile * , ...); short __sync_lock_test_and_set_int16_t(short volatile *, short , ...); int __sync_lock_test_and_set_int32_t(int volatile *, int , ...); long long __sync_lock_test_and_set_int64_t(long long volatile *, long long , ...); signed char __sync_lock_test_and_set_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_lock_test_and_set_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_lock_test_and_set_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_lock_test_and_set_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_lock_test_and_set_uint8_t(unsigned char volatile *, unsigned char , ...); short __sync_nand_and_fetch_int16_t(short volatile *, short , ...); int __sync_nand_and_fetch_int32_t(int volatile *, int , ...); long long __sync_nand_and_fetch_int64_t(long long volatile *, long long , ...); signed char __sync_nand_and_fetch_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_nand_and_fetch_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_nand_and_fetch_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_nand_and_fetch_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_nand_and_fetch_uint8_t(unsigned char volatile *, unsigned char , ...); short __sync_or_and_fetch_int16_t(short volatile *, short , ...); int __sync_or_and_fetch_int32_t(int volatile *, int , ...); long long __sync_or_and_fetch_int64_t(long long volatile *, long long , ...); signed char __sync_or_and_fetch_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_or_and_fetch_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_or_and_fetch_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_or_and_fetch_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_or_and_fetch_uint8_t(unsigned char volatile *, unsigned char , ...); short __sync_sub_and_fetch_int16_t(short volatile *, short , ...); int __sync_sub_and_fetch_int32_t(int volatile *, int , ...); long long __sync_sub_and_fetch_int64_t(long long volatile *, long long , ...); signed char __sync_sub_and_fetch_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_sub_and_fetch_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_sub_and_fetch_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_sub_and_fetch_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_sub_and_fetch_uint8_t(unsigned char volatile *, unsigned char , ...); void __sync_synchronize(...); short __sync_val_compare_and_swap_int16_t(short volatile *, short, short , ...); int __sync_val_compare_and_swap_int32_t(int volatile *, int, int , ...); long long __sync_val_compare_and_swap_int64_t(long long volatile *, long long, long long , ...); signed char __sync_val_compare_and_swap_int8_t(signed char volatile *, signed char, signed char , ...); unsigned short __sync_val_compare_and_swap_uint16_t(unsigned short volatile *, unsigned short, unsigned short , ...); unsigned int __sync_val_compare_and_swap_uint32_t(unsigned int volatile *, unsigned int, unsigned int , ...); unsigned long long __sync_val_compare_and_swap_uint64_t(unsigned long long volatile *, unsigned long long, unsigned long long , ...); unsigned char __sync_val_compare_and_swap_uint8_t(unsigned char volatile *, unsigned char, unsigned char , ...); short __sync_xor_and_fetch_int16_t(short volatile *, short , ...); int __sync_xor_and_fetch_int32_t(int volatile *, int , ...); long long __sync_xor_and_fetch_int64_t(long long volatile *, long long , ...); signed char __sync_xor_and_fetch_int8_t(signed char volatile *, signed char , ...); unsigned short __sync_xor_and_fetch_uint16_t(unsigned short volatile *, unsigned short , ...); unsigned int __sync_xor_and_fetch_uint32_t(unsigned int volatile *, unsigned int , ...); unsigned long long __sync_xor_and_fetch_uint64_t(unsigned long long volatile *, unsigned long long , ...); unsigned char __sync_xor_and_fetch_uint8_t(unsigned char volatile *, unsigned char , ...); int max(int i, int j) { int tmp; if (i >= j) tmp = i; else tmp = j; return tmp; } [kernel:file:annotation] Marking properties /* Generated by Frama-C */ /*@ ensures /* ip:1 */\result ≥ \old(i); ensures /* ip:2 */\result ≥ \old(j); ensures /* ip:3 */\result ≡ \old(i) ∨ \result ≡ \old(j); */ int max(int i, int j) { /* Locals: tmp */ int tmp; /* sid:2 */ if (i >= j) { /* sid:3 */ tmp = i; } else { /* sid:4 */ tmp = j; } /* sid:5 */ return tmp; } frama-c-20.0-Calcium/tests/syntax/oracle/clone_test.res.oracle0000666000000000000000000000107513571573400021271 0ustar [kernel] Parsing tests/syntax/clone_test.i (no preprocessing) /* Generated by Frama-C */ /*@ requires -3 ≤ c ≤ 4; ensures \result ≥ \old(c); */ int f(int c) { int __retres; if (c > 0) { __retres = c; goto return_label; } /*@ assert c ≤ 0; */ ; __retres = 0; return_label: return __retres; } /*@ requires -3 ≤ c ≤ 4; ensures \result ≥ \old(c); */ int __fc_clone_1_f(int c) { int __retres; if (c > 0) { __retres = c; goto return_label; } /*@ assert c ≤ 0; */ ; __retres = 0; return_label: return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/composite-tags.res.oracle0000666000000000000000000000105413571573400022065 0ustar [kernel] Parsing tests/syntax/composite-tags.i (no preprocessing) [kernel] tests/syntax/composite-tags.i:5: User Error: Declaration of f does not match previous declaration from tests/syntax/composite-tags.i:4 (structs with different tags). [kernel] tests/syntax/composite-tags.i:11: User Error: Declaration of g does not match previous declaration from tests/syntax/composite-tags.i:10 (unions with different tags). [kernel] User Error: stopping on file "tests/syntax/composite-tags.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/compound-literal.res.oracle0000666000000000000000000000057313571573400022412 0ustar [kernel] Parsing tests/syntax/compound-literal.i (no preprocessing) /* Generated by Frama-C */ struct __anonstruct_Foo_1 { unsigned int foo ; }; typedef struct __anonstruct_Foo_1 Foo; extern void process(int, Foo); void foo(int dummy) { int tmp; Foo __constr_expr_0 = {.foo = (unsigned int)0}; tmp = dummy; dummy ++; ; process(tmp,__constr_expr_0); return; } frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.0.res.oracle0000666000000000000000000000073513571573400022751 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) /* Generated by Frama-C */ struct __anonstruct_S_1 { int x ; int const y ; }; typedef struct __anonstruct_S_1 S; int const x = 1; extern void g(int *p); void h(int const *x_0) { int *y = (int *)x_0; *y = 1; g(y); return; } void build_S(S const *s, int x_0, int y) { s->x = x_0; s->y = y; return; } void mutable_test(S const *s) { s->x = 42; (s->x) ++; s->x += 2; return; } frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.1.res.oracle0000666000000000000000000000055113571573400022746 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) [kernel] tests/syntax/const-assignments.c:21: User Error: Cannot assign to non-modifiable lval x [kernel] User Error: stopping on file "tests/syntax/const-assignments.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.2.res.oracle0000666000000000000000000000055113571573400022747 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) [kernel] tests/syntax/const-assignments.c:27: User Error: Cannot assign to non-modifiable lval x [kernel] User Error: stopping on file "tests/syntax/const-assignments.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.3.res.oracle0000666000000000000000000000055113571573400022750 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) [kernel] tests/syntax/const-assignments.c:33: User Error: Cannot assign to non-modifiable lval x [kernel] User Error: stopping on file "tests/syntax/const-assignments.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.4.res.oracle0000666000000000000000000000055113571573400022751 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) [kernel] tests/syntax/const-assignments.c:39: User Error: Cannot assign to non-modifiable lval x [kernel] User Error: stopping on file "tests/syntax/const-assignments.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.5.res.oracle0000666000000000000000000000055313571573400022754 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) [kernel] tests/syntax/const-assignments.c:46: User Error: Cannot assign to non-modifiable lval x_0 [kernel] User Error: stopping on file "tests/syntax/const-assignments.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.6.res.oracle0000666000000000000000000000055413571573400022756 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) [kernel] tests/syntax/const-assignments.c:52: User Error: Cannot assign to non-modifiable lval *x_0 [kernel] User Error: stopping on file "tests/syntax/const-assignments.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.7.res.oracle0000666000000000000000000000124213571573400022752 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) [kernel:typing:incompatible-types-call] tests/syntax/const-assignments.c:60: Warning: expected 'int *' but got argument of type 'int const *': & x /* Generated by Frama-C */ struct __anonstruct_S_1 { int x ; int const y ; }; typedef struct __anonstruct_S_1 S; int const x = 1; extern void g(int *p); void f(void) { g((int *)(& x)); return; } void h(int const *x_0) { int *y = (int *)x_0; *y = 1; g(y); return; } void build_S(S const *s, int x_0, int y) { s->x = x_0; s->y = y; return; } void mutable_test(S const *s) { s->x = 42; (s->x) ++; s->x += 2; return; } frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.8.res.oracle0000666000000000000000000000125213571573400022754 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) [kernel:typing:incompatible-types-call] tests/syntax/const-assignments.c:66: Warning: expected 'int *' but got argument of type 'int const *': x_0 /* Generated by Frama-C */ struct __anonstruct_S_1 { int x ; int const y ; }; typedef struct __anonstruct_S_1 S; int const x = 1; extern void g(int *p); void f(int const *x_0) { g((int *)x_0); return; } void h(int const *x_0) { int *y = (int *)x_0; *y = 1; g(y); return; } void build_S(S const *s, int x_0, int y) { s->x = x_0; s->y = y; return; } void mutable_test(S const *s) { s->x = 42; (s->x) ++; s->x += 2; return; } frama-c-20.0-Calcium/tests/syntax/oracle/const-assignments.9.res.oracle0000666000000000000000000000055713571573400022764 0ustar [kernel] Parsing tests/syntax/const-assignments.c (with preprocessing) [kernel] tests/syntax/const-assignments.c:101: User Error: Cannot assign to non-modifiable lval t->s.y [kernel] User Error: stopping on file "tests/syntax/const-assignments.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/constfold.res.oracle0000666000000000000000000000032513571573400021122 0ustar [kernel] Parsing tests/syntax/constfold.i (no preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; char a[1] = {(char)0}; int i = 36; int j = 36; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/copy_logic.res.oracle0000666000000000000000000000457213571573400021266 0ustar [kernel] Parsing tests/syntax/copy_logic.i (no preprocessing) [kernel] tests/syntax/copy_logic.i:5: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [kernel] tests/syntax/copy_logic.i:7: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/syntax/copy_logic.i:16: Warning: assertion got status unknown. [eva:alarm] tests/syntax/copy_logic.i:17: Warning: signed overflow. assert y + x ≤ 2147483647; [eva] tests/syntax/copy_logic.i:18: cannot evaluate ACSL term, unsupported ACSL construct: logic function f [eva:alarm] tests/syntax/copy_logic.i:18: Warning: assertion got status unknown. [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: y ∈ [-2147483606..2147483647] __retres ∈ {0} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 1): 100% coverage. In this function, 6 statements reached (out of 6): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 1 alarm generated by the analysis: 1 integer overflow ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 0 valid 2 unknown 0 invalid 2 total Preconditions 0 valid 0 unknown 0 invalid 0 total 0% of the logical properties reached have been proven. ---------------------------------------------------------------------------- /* Generated by Frama-C */ /*@ predicate p(int x) ; */ /*@ predicate q(int x) = x ≡ 42; */ /*@ logic int f(int y) ; */ /*@ logic ℤ g(int x) = x + 42; */ /*@ frees x; */ void f(int *x); int main(int x) { int __retres; int y = 42; /*@ assert q(y) ∧ p(x); */ ; /*@ assert Eva: signed_overflow: y + x ≤ 2147483647; */ y += x; /*@ assert g(x) ≡ f(y); */ ; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/copy_visitor.res.oracle0000666000000000000000000000241413571573400021661 0ustar [kernel] Parsing tests/syntax/copy_visitor.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s.a ∈ {1} .b ∈ {2} [eva] tests/syntax/copy_visitor.i:22: assertion got status valid. [eva] computing for function f <- main. Called from tests/syntax/copy_visitor.i:23. [eva] tests/syntax/copy_visitor.i:23: function f: precondition got status valid. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: s{.a; .b} ∈ {2} __retres ∈ {2} [eva:final-states] Values at end of function main: s{.a; .b} ∈ {2} __retres ∈ {0} /* Generated by Frama-C */ struct S { int a ; int b ; }; struct S s = {.a = 1, .b = 2}; /*@ requires \valid(s_0); assigns s_0->a; */ int f(struct S *s_0) { int __retres; s_0->a = 2; __retres = s_0->b; return __retres; } /*@ assigns s.a; */ int main(void) { int __retres; s.a = 2; /*@ assert s.a ≡ 2; */ ; f(& s); __retres = 0; return __retres; } int g(int x); int g(int x) { int __retres; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/copy_visitor_bts_1073.0.res.oracle0000666000000000000000000000477513571573400023355 0ustar [kernel] Parsing tests/syntax/copy_visitor_bts_1073.c (with preprocessing) /* Generated by Frama-C */ #include "errno.h" #include "stdarg.h" #include "stddef.h" #include "stdio.h" int f(int x); int f(int x) { return x; } int f1(int x) { return x; } int g(int y) { int tmp; tmp = f1(2 * y); return tmp; } int g1(int y) { int tmp; tmp = f1(2 * y); return tmp; } /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int printf_va_1(char const * __restrict format); /*@ requires valid_read_string(format); requires valid_read_string(param1); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: *(param1 + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), *(param1 + (0 ..)), param0; */ int printf_va_2(char const * __restrict format, int param0, char *param1); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); int main(int argc, char **argv) { int __retres; int i; printf_va_1("Hello !\n"); i = 0; while (i < argc) { printf_va_2("arg %d : %s\n",i,*(argv + i)); i ++; } printf_va_3("Found %d arguments\n",i - 1); __retres = 0; return __retres; } int main1(int argc, char **argv) { int __retres; int i; printf_va_1("Hello !\n"); i = 0; while (i < argc) { printf_va_2("arg %d : %s\n",i,*(argv + i)); i ++; } printf_va_3("Found %d arguments\n",i - 1); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/copy_visitor_bts_1073.1.res.oracle0000666000000000000000000000432613571573400023346 0ustar [kernel] Parsing tests/syntax/copy_visitor_bts_1073.c (with preprocessing) [test] start compute [test] exported in new project : filtered /* Generated by Frama-C */ #include "errno.h" #include "stdarg.h" #include "stddef.h" #include "stdio.h" int f(int x); int f(int x) { return x; } int g(int y) { int tmp; tmp = f(2 * y); return tmp; } /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))); */ int printf_va_1(char const * __restrict format); /*@ requires valid_read_string(format); requires valid_read_string(param1); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: *(param1 + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), *(param1 + (0 ..)), param0; */ int printf_va_2(char const * __restrict format, int param0, char *param1); /*@ requires valid_read_string(format); assigns \result, __fc_stdout->__fc_FILE_data; assigns \result \from (indirect: __fc_stdout->__fc_FILE_id), (indirect: __fc_stdout->__fc_FILE_data), (indirect: *(format + (0 ..))), (indirect: param0); assigns __fc_stdout->__fc_FILE_data \from (indirect: __fc_stdout->__fc_FILE_id), __fc_stdout->__fc_FILE_data, (indirect: *(format + (0 ..))), param0; */ int printf_va_3(char const * __restrict format, int param0); int main(int argc, char **argv) { int __retres; int i; printf_va_1("Hello !\n"); i = 0; while (i < argc) { printf_va_2("arg %d : %s\n",i,*(argv + i)); i ++; } printf_va_3("Found %d arguments\n",i - 1); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/cpp-command.0.res.oracle0000666000000000000000000000045113571573400021463 0ustar [kernel] Parsing tests/syntax/cpp-command.c (with preprocessing) [tests/syntax/cpp-command.c tests/syntax/cpp-command.c tests/syntax/cpp-command.c tests/syntax/cpp-command.c] [/tmp/FILE.i /tmp/FILE.i /tmp/FILE.i /tmp/FILE.i] [ -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32] frama-c-20.0-Calcium/tests/syntax/oracle/cpp-command.1.res.oracle0000666000000000000000000000030013571573400021455 0ustar [kernel] Parsing tests/syntax/cpp-command.c (with preprocessing) %1 = tests/syntax/cpp-command.c %2 = /tmp/FILE.i %args = -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32 frama-c-20.0-Calcium/tests/syntax/oracle/cpp-command.2.res.oracle0000666000000000000000000000016513571573400021467 0ustar [kernel] Parsing tests/syntax/cpp-command.c (with preprocessing) using \% has no effect : \tests/syntax/cpp-command.cframa-c-20.0-Calcium/tests/syntax/oracle/cpp-command.3.res.oracle0000666000000000000000000000015013571573400021462 0ustar [kernel] Parsing tests/syntax/cpp-command.c (with preprocessing) %var is not an interpreted placeholder frama-c-20.0-Calcium/tests/syntax/oracle/dangerous_expressions.res.oracle0000666000000000000000000000076213571573400023565 0ustar [kernel] Parsing tests/syntax/dangerous_expressions.i (no preprocessing) /* Generated by Frama-C */ struct s { int *a ; }; struct __anonstruct_ss_1 { struct s s1[3] ; struct s s2 ; }; struct __anonstruct_ss_1 ss; int f(int * /*[10]*/ t, int n, int *ptr) { int __retres; int tmp = *(t + n); int tmp_3 = *ptr; __retres = 65; return __retres; } int main(void) { int __retres; int *p = (int *)0; int tmp = *p; int *tmp_3 = ss.s1[2].a; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/dangling_else.res.oracle0000666000000000000000000000104513571573400021722 0ustar [kernel] Parsing tests/syntax/dangling_else.i (no preprocessing) /* Generated by Frama-C */ /*@ requires x ≥ 0; */ int g(int x); void main(void) { int c; int x; if (c) { if (c) x = 1; } else if (c) { if (c) x = 1; } else x = 2; return; } int f(int a, int b, int c, int d) { int ret; ret = 0; if (a) { if (b) ret = 1; else if (c) ret = 2; } else if (d) ret = 4; if (a) { /*@ assert ret ≥ 0; */ ; ret = 5; } else ret = 6; if (a) g(a); else g(a); return ret; } frama-c-20.0-Calcium/tests/syntax/oracle/dangling_reference_bts1475.res.oracle0000666000000000000000000000037213571573400024123 0ustar [kernel] Parsing tests/syntax/dangling_reference_bts1475.i (no preprocessing) /* Generated by Frama-C */ /*@ requires \valid(f5); */ static char F4(int *f5); int foo(void) { int __retres; int x; F4(& x); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/decay.res.oracle0000666000000000000000000000122613571573400020215 0ustar [kernel] Parsing tests/syntax/decay.i (no preprocessing) /* Generated by Frama-C */ struct P { int val[2][2] ; }; char t[8]; struct __anonstruct_A_1 { int A[sizeof(t)] ; int i ; }; struct __anonstruct_S_2 { int A[sizeof(&(t[0]))] ; int i ; }; struct __anonstruct_V_3 { int A[sizeof(&(t[0]))] ; int i ; }; char t[8]; void multi_dim_array_decay(void) { struct P *pp; struct P p; pp = & p; int *tmp = pp->val[0]; int *tmp_3 = p.val[0]; return; } struct __anonstruct_A_1 A = {.A = {1, 2, 3, 4, 5, 6, 7, 8}, .i = 9}; struct __anonstruct_S_2 S = {.A = {1, 2, 3, 4}, .i = 5}; struct __anonstruct_V_3 V = {.A = {1, 2, 3, 4}, .i = 5}; frama-c-20.0-Calcium/tests/syntax/oracle/decl-function.res.oracle0000666000000000000000000000074713571573400021671 0ustar [kernel] Parsing tests/syntax/decl-function.i (no preprocessing) /* Generated by Frama-C */ int x; void (*pf)(void); extern void f_undefined(void); void g(void) { f_undefined(); /*@ assert fcs_limitation: pf == &f_undefined; */ ; return; } /*@ logic integer foo(integer y) = y; */ /*@ requires fcs_limitation: pf == &f_undefined; ensures x == foo(x); */ extern void f_undefined(void); void main(void) { pf = & f_undefined; f_undefined(); f_undefined(); return; } frama-c-20.0-Calcium/tests/syntax/oracle/define_string_logic_pp_bts2101.res.oracle0000666000000000000000000000120113571573400024771 0ustar [kernel] Parsing tests/syntax/define_string_logic_pp_bts2101.c (with preprocessing) /* Generated by Frama-C */ /*@ predicate p{L}(char *x) = \at(*(x + 0) ≡ 't',L); */ int main(void) { int __retres; char const c[7] = {(char)'t', (char)'o', (char)'/', (char)'*', (char)'t', (char)'o', (char)'\000'}; char const d[5] = {(char)'t', (char)'o', (char)'t', (char)'o', (char)'\000'}; char const e = (char)7815260946135808373ULL; /*@ assert p("to/*to") ∧ p("toto"); */ ; /*@ assert (char)7815260946135808373 ≡ 'u'; */ ; __retres = (int)c[sizeof(c) - (unsigned int)1]; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/designated_init_pretty_print_bts1457.res.oracle0000666000000000000000000000036213571573400026276 0ustar [kernel] Parsing tests/syntax/designated_init_pretty_print_bts1457.i (no preprocessing) /* Generated by Frama-C */ int t[10] = {[4] = 5, 5, 5}; int u[10] = {[4] = 3}; int v[10] = {0, [5] = 42, 36, 7, [9] = 9}; void main(void) { return; } frama-c-20.0-Calcium/tests/syntax/oracle/dowhilezero.res.oracle0000666000000000000000000000151413571573400021463 0ustar [kernel] Parsing tests/syntax/dowhilezero.c (with preprocessing) /* Generated by Frama-C */ void f1(void) { /*@ loop invariant \true; */ while (1) { { int x = 1; int y = 2; } break; } return; } void f2(void) { while (1) { { int x = 1; int y = 2; break; } break; } return; } void f3(void) { while (1) { { int x = 1; int y = 2; goto __Cont; } __Cont: break; } return; } void f4(int c) { while (1) { { int x = 1; int y = 2; } if (! c) break; } return; } void f5(void) { int x = 1; int y = 2; return; } void f6(void) { int x = 1; int y = 2; while (1) { continue; break; } return; } void f7(void) { int x = 1; int y = 2; return; } void f8(int v) { if (v == 0) ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/duplicate_field.res.oracle0000666000000000000000000000053513571573400022247 0ustar [kernel] Parsing tests/syntax/duplicate_field.i (no preprocessing) [kernel] tests/syntax/duplicate_field.i:3: User Error: field x occurs multiple times in aggregate struct test. Previous occurrence is at line 2. [kernel] User Error: stopping on file "tests/syntax/duplicate_field.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/duplicated_global_bts1129.res.oracle0000666000000000000000000000033213571573400023750 0ustar [kernel] Parsing tests/syntax/duplicated_global_bts1129.i (no preprocessing) /* Generated by Frama-C */ void f(int *x); int X; /*@ ensures X ≡ 1; */ void f(int *x) { int *tmp; tmp = x; x ++; ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/empty_initializer.res.oracle0000666000000000000000000000071113571573400022667 0ustar [kernel] Parsing tests/syntax/empty_initializer.i (no preprocessing) /* Generated by Frama-C */ struct __S { int i ; }; typedef struct __S STR; STR A[3] = {{.i = 0}, {.i = 0}, {.i = 0}}; STR D[3] = {{.i = 0}, {.i = 1}, {.i = 0}}; int E[2][3] = {{}, {}}; int f(void) { int __retres; STR B[3] = {{.i = 0}, {.i = 0}, {.i = 0}}; STR C[3] = {{.i = 0}, {.i = 3}, {.i = 0}}; int F[3][4] = {{}, {23, 45}, {}}; __retres = B[1].i; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/enum1.res.oracle0000666000000000000000000000231113571573400020151 0ustar [kernel] Parsing tests/syntax/enum1.c (with preprocessing) [kernel] Parsing tests/syntax/enum2.c (with preprocessing) [kernel] Warning: merging definitions of enum f using int type (different names for enumeration items); items {F21=0, F22=1} and {F11=0, F12=1} /* Generated by Frama-C */ enum e { E1 = 0, E2 = 1 }; enum __anonenum_1 { K11 = 0, K12 = 1 }; enum __anonenum_3 { I1 = 0, I2 = 1 }; enum Foo { EN1 = 0, EN2 = 1, EN3 = 2 }; enum __anonenum_0 { K21 = 0, K22 = 1 }; int e1(void) { int __retres; __retres = E1; return __retres; } int f1(void) { int __retres; __retres = 0; return __retres; } int k1(void) { int __retres; __retres = K11; return __retres; } int i1(void) { int __retres; __retres = I1; return __retres; } int f(void) { int __retres; __retres = ! EN1; return __retres; } int g(void) { int __retres; __retres = EN1; return __retres; } int e2(void) { int __retres; __retres = E2; return __retres; } int f2(void) { int __retres; __retres = 1; return __retres; } int k2(void) { int __retres; __retres = K22; return __retres; } int i2(void) { int __retres; __retres = I2; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/enum_call.res.oracle0000666000000000000000000000043713571573400021072 0ustar [kernel] Parsing tests/syntax/enum_call.i (no preprocessing) /* Generated by Frama-C */ enum E { C0 = 0, C1 = 1, C2 = 2 }; void f(enum E const); void f1(enum E); void g(void) { f((enum E)C0); f1((enum E)C2); return; } void h(void) { f(C1); f1(C0); return; } frama-c-20.0-Calcium/tests/syntax/oracle/enum_repr.0.res.oracle0000666000000000000000000000771113571573400021267 0ustar [kernel] Parsing tests/syntax/enum_repr.i (no preprocessing) [kernel] tests/syntax/enum_repr.i:40: Inserted implicit cast from unsigned int to enum __anonenum_bu2_4 [kernel] tests/syntax/enum_repr.i:41: Inserted implicit cast from long long to enum __anonenum_bu3_5 [kernel] tests/syntax/enum_repr.i:43: Inserted implicit cast from unsigned int to enum __anonenum_bs2_7 [kernel] tests/syntax/enum_repr.i:44: Inserted implicit cast from long long to enum __anonenum_bs3_8 [kernel] tests/syntax/enum_repr.i:45: Inserted implicit cast from signed char to enum __anonenum_bc1_9 [kernel] tests/syntax/enum_repr.i:46: Inserted implicit cast from unsigned char to enum __anonenum_bc2_10 [kernel] tests/syntax/enum_repr.i:47: Inserted implicit cast from signed char to enum __anonenum_bd1_11 [kernel] tests/syntax/enum_repr.i:48: Inserted implicit cast from unsigned char to enum __anonenum_bd2_12 [kernel] tests/syntax/enum_repr.i:66: Inserted implicit cast from enum __anonenum_foo_1 to unsigned int [kernel] tests/syntax/enum_repr.i:67: Inserted implicit cast from unsigned int to enum __anonenum_foo_1 [kernel] tests/syntax/enum_repr.i:68: Inserted implicit cast from unsigned int to enum __anonenum_foo_1 [kernel] Enum __anonenum_foo_1 is represented by int [kernel] Enum __anonenum_bar_2 is represented by int [kernel] Enum __anonenum_bu1_3 is represented by int [kernel] Enum __anonenum_bu2_4 is represented by int [kernel] Enum __anonenum_bu3_5 is represented by int [kernel] Enum __anonenum_bs1_6 is represented by int [kernel] Enum __anonenum_bs2_7 is represented by int [kernel] Enum __anonenum_bs3_8 is represented by int [kernel] Enum __anonenum_bc1_9 is represented by int [kernel] Enum __anonenum_bc2_10 is represented by int [kernel] Enum __anonenum_bd1_11 is represented by int [kernel] Enum __anonenum_bd2_12 is represented by int /* Generated by Frama-C */ enum __anonenum_foo_1 { A = 3 }; typedef enum __anonenum_foo_1 foo; enum __anonenum_bar_2 { B = 6 } __attribute__((__packed__)); typedef enum __anonenum_bar_2 bar; enum __anonenum_bu1_3 { Bu1 = 0x7FFFFFFF }; typedef enum __anonenum_bu1_3 bu1; enum __anonenum_bu2_4 { Bu2 = 0xFFFFFFFF }; typedef enum __anonenum_bu2_4 bu2; enum __anonenum_bu3_5 { Bu3 = 0x1FFFFFFFF }; typedef enum __anonenum_bu3_5 bu3; enum __anonenum_bs1_6 { Bs1 = 0x7FFFFFFF, Ms1 = -1 }; typedef enum __anonenum_bs1_6 bs1; enum __anonenum_bs2_7 { Bs2 = 0xFFFFFFFF, Ms2 = -1 }; typedef enum __anonenum_bs2_7 bs2; enum __anonenum_bs3_8 { Bs3 = 0x1FFFFFFFF, Ms3 = -1 }; typedef enum __anonenum_bs3_8 bs3; enum __anonenum_bc1_9 { Bc1 = (signed char)'c' }; typedef enum __anonenum_bc1_9 bc1; enum __anonenum_bc2_10 { Bc2 = (unsigned char)'c' }; typedef enum __anonenum_bc2_10 bc2; enum __anonenum_bd1_11 { Bd1 = (signed char)'c', Md1 = -1 }; typedef enum __anonenum_bd1_11 bd1; enum __anonenum_bd2_12 { Bd2 = (unsigned char)'c', Md2 = -1 }; typedef enum __anonenum_bd2_12 bd2; typedef unsigned int bla; int main(void) { int __retres; foo x = A; bar y = B; bu1 u1 = Bu1; bu2 u2 = Bu2; bu3 u3 = (enum __anonenum_bu3_5)Bu3; bs1 s1 = Bs1; bs2 s2 = Bs2; bs3 s3 = (enum __anonenum_bs3_8)Bs3; bc1 c1 = (enum __anonenum_bc1_9)Bc1; bc2 c2 = (enum __anonenum_bc2_10)Bc2; bd1 d1 = (enum __anonenum_bd1_11)Bd1; bd2 d2 = (enum __anonenum_bd2_12)Bd2; if (x == A) if (y == B) { __retres = 0; goto return_label; } __retres = 1; return_label: return __retres; } int f1(bla x); int f2(bla x); int f3(bla x); int h1(foo x); int h2(foo x); int h3(foo x); int g(void) { int tmp_0; int tmp_1; int tmp_2; int tmp_3; int tmp_4; foo x = A; int res = f1((unsigned int)x); tmp_0 = f2((unsigned int)x); res += tmp_0; tmp_1 = f3((unsigned int)x); res += tmp_1; tmp_2 = h1((enum __anonenum_foo_1)((unsigned int)x)); res += tmp_2; tmp_3 = h2((enum __anonenum_foo_1)((unsigned int)x)); res += tmp_3; tmp_4 = h3(x); res += tmp_4; return res; } frama-c-20.0-Calcium/tests/syntax/oracle/enum_repr.1.res.oracle0000666000000000000000000001017613571573400021267 0ustar [kernel] Parsing tests/syntax/enum_repr.i (no preprocessing) [kernel] tests/syntax/enum_repr.i:37: Inserted implicit cast from int to enum __anonenum_foo_1 [kernel] tests/syntax/enum_repr.i:38: Inserted implicit cast from int to enum __anonenum_bar_2 [kernel] tests/syntax/enum_repr.i:39: Inserted implicit cast from int to enum __anonenum_bu1_3 [kernel] tests/syntax/enum_repr.i:41: Inserted implicit cast from long long to enum __anonenum_bu3_5 [kernel] tests/syntax/enum_repr.i:43: Inserted implicit cast from unsigned int to enum __anonenum_bs2_7 [kernel] tests/syntax/enum_repr.i:45: Inserted implicit cast from signed char to enum __anonenum_bc1_9 [kernel] tests/syntax/enum_repr.i:48: Inserted implicit cast from unsigned char to enum __anonenum_bd2_12 [kernel] tests/syntax/enum_repr.i:49: Inserted implicit cast from foo to int [kernel] tests/syntax/enum_repr.i:49: Inserted implicit cast from bar to int [kernel] tests/syntax/enum_repr.i:63: Inserted implicit cast from int to enum __anonenum_foo_1 [kernel] tests/syntax/enum_repr.i:66: Inserted implicit cast from enum __anonenum_foo_1 to unsigned int [kernel] tests/syntax/enum_repr.i:67: Inserted implicit cast from unsigned int to enum __anonenum_foo_1 [kernel] tests/syntax/enum_repr.i:68: Inserted implicit cast from unsigned int to enum __anonenum_foo_1 [kernel] Enum __anonenum_foo_1 is represented by unsigned char [kernel] Enum __anonenum_bar_2 is represented by unsigned char [kernel] Enum __anonenum_bu1_3 is represented by unsigned int [kernel] Enum __anonenum_bu2_4 is represented by unsigned int [kernel] Enum __anonenum_bu3_5 is represented by unsigned long long [kernel] Enum __anonenum_bs1_6 is represented by int [kernel] Enum __anonenum_bs2_7 is represented by long long [kernel] Enum __anonenum_bs3_8 is represented by long long [kernel] Enum __anonenum_bc1_9 is represented by unsigned char [kernel] Enum __anonenum_bc2_10 is represented by unsigned char [kernel] Enum __anonenum_bd1_11 is represented by signed char [kernel] Enum __anonenum_bd2_12 is represented by signed char /* Generated by Frama-C */ enum __anonenum_foo_1 { A = 3 }; typedef enum __anonenum_foo_1 foo; enum __anonenum_bar_2 { B = 6 } __attribute__((__packed__)); typedef enum __anonenum_bar_2 bar; enum __anonenum_bu1_3 { Bu1 = 0x7FFFFFFF }; typedef enum __anonenum_bu1_3 bu1; enum __anonenum_bu2_4 { Bu2 = 0xFFFFFFFF }; typedef enum __anonenum_bu2_4 bu2; enum __anonenum_bu3_5 { Bu3 = 0x1FFFFFFFF }; typedef enum __anonenum_bu3_5 bu3; enum __anonenum_bs1_6 { Bs1 = 0x7FFFFFFF, Ms1 = -1 }; typedef enum __anonenum_bs1_6 bs1; enum __anonenum_bs2_7 { Bs2 = 0xFFFFFFFF, Ms2 = -1 }; typedef enum __anonenum_bs2_7 bs2; enum __anonenum_bs3_8 { Bs3 = 0x1FFFFFFFF, Ms3 = -1 }; typedef enum __anonenum_bs3_8 bs3; enum __anonenum_bc1_9 { Bc1 = (signed char)'c' }; typedef enum __anonenum_bc1_9 bc1; enum __anonenum_bc2_10 { Bc2 = (unsigned char)'c' }; typedef enum __anonenum_bc2_10 bc2; enum __anonenum_bd1_11 { Bd1 = (signed char)'c', Md1 = -1 }; typedef enum __anonenum_bd1_11 bd1; enum __anonenum_bd2_12 { Bd2 = (unsigned char)'c', Md2 = -1 }; typedef enum __anonenum_bd2_12 bd2; typedef unsigned int bla; int main(void) { int __retres; foo x = (enum __anonenum_foo_1)A; bar y = (enum __anonenum_bar_2)B; bu1 u1 = Bu1; bu2 u2 = Bu2; bu3 u3 = Bu3; bs1 s1 = Bs1; bs2 s2 = (enum __anonenum_bs2_7)Bs2; bs3 s3 = Bs3; bc1 c1 = Bc1; bc2 c2 = Bc2; bd1 d1 = Bd1; bd2 d2 = Bd2; if ((int)x == A) if ((int)y == B) { __retres = 0; goto return_label; } __retres = 1; return_label: return __retres; } int f1(bla x); int f2(bla x); int f3(bla x); int h1(foo x); int h2(foo x); int h3(foo x); int g(void) { int tmp_0; int tmp_1; int tmp_2; int tmp_3; int tmp_4; foo x = (enum __anonenum_foo_1)A; int res = f1((unsigned int)x); tmp_0 = f2((unsigned int)x); res += tmp_0; tmp_1 = f3((unsigned int)x); res += tmp_1; tmp_2 = h1((enum __anonenum_foo_1)((unsigned int)x)); res += tmp_2; tmp_3 = h2((enum __anonenum_foo_1)((unsigned int)x)); res += tmp_3; tmp_4 = h3(x); res += tmp_4; return res; } frama-c-20.0-Calcium/tests/syntax/oracle/enum_repr.2.res.oracle0000666000000000000000000001001013571573400021253 0ustar [kernel] Parsing tests/syntax/enum_repr.i (no preprocessing) [kernel] tests/syntax/enum_repr.i:37: Inserted implicit cast from int to enum __anonenum_foo_1 [kernel] tests/syntax/enum_repr.i:38: Inserted implicit cast from int to enum __anonenum_bar_2 [kernel] tests/syntax/enum_repr.i:39: Inserted implicit cast from int to enum __anonenum_bu1_3 [kernel] tests/syntax/enum_repr.i:41: Inserted implicit cast from long long to enum __anonenum_bu3_5 [kernel] tests/syntax/enum_repr.i:43: Inserted implicit cast from unsigned int to enum __anonenum_bs2_7 [kernel] tests/syntax/enum_repr.i:45: Inserted implicit cast from signed char to enum __anonenum_bc1_9 [kernel] tests/syntax/enum_repr.i:46: Inserted implicit cast from unsigned char to enum __anonenum_bc2_10 [kernel] tests/syntax/enum_repr.i:47: Inserted implicit cast from signed char to enum __anonenum_bd1_11 [kernel] tests/syntax/enum_repr.i:48: Inserted implicit cast from unsigned char to enum __anonenum_bd2_12 [kernel] tests/syntax/enum_repr.i:49: Inserted implicit cast from int to unsigned int [kernel] tests/syntax/enum_repr.i:49: Inserted implicit cast from bar to int [kernel] tests/syntax/enum_repr.i:63: Inserted implicit cast from int to enum __anonenum_foo_1 [kernel] Enum __anonenum_foo_1 is represented by unsigned int [kernel] Enum __anonenum_bar_2 is represented by unsigned char [kernel] Enum __anonenum_bu1_3 is represented by unsigned int [kernel] Enum __anonenum_bu2_4 is represented by unsigned int [kernel] Enum __anonenum_bu3_5 is represented by unsigned long long [kernel] Enum __anonenum_bs1_6 is represented by int [kernel] Enum __anonenum_bs2_7 is represented by long long [kernel] Enum __anonenum_bs3_8 is represented by long long [kernel] Enum __anonenum_bc1_9 is represented by unsigned int [kernel] Enum __anonenum_bc2_10 is represented by unsigned int [kernel] Enum __anonenum_bd1_11 is represented by int [kernel] Enum __anonenum_bd2_12 is represented by int /* Generated by Frama-C */ enum __anonenum_foo_1 { A = 3 }; typedef enum __anonenum_foo_1 foo; enum __anonenum_bar_2 { B = 6 } __attribute__((__packed__)); typedef enum __anonenum_bar_2 bar; enum __anonenum_bu1_3 { Bu1 = 0x7FFFFFFF }; typedef enum __anonenum_bu1_3 bu1; enum __anonenum_bu2_4 { Bu2 = 0xFFFFFFFF }; typedef enum __anonenum_bu2_4 bu2; enum __anonenum_bu3_5 { Bu3 = 0x1FFFFFFFF }; typedef enum __anonenum_bu3_5 bu3; enum __anonenum_bs1_6 { Bs1 = 0x7FFFFFFF, Ms1 = -1 }; typedef enum __anonenum_bs1_6 bs1; enum __anonenum_bs2_7 { Bs2 = 0xFFFFFFFF, Ms2 = -1 }; typedef enum __anonenum_bs2_7 bs2; enum __anonenum_bs3_8 { Bs3 = 0x1FFFFFFFF, Ms3 = -1 }; typedef enum __anonenum_bs3_8 bs3; enum __anonenum_bc1_9 { Bc1 = (signed char)'c' }; typedef enum __anonenum_bc1_9 bc1; enum __anonenum_bc2_10 { Bc2 = (unsigned char)'c' }; typedef enum __anonenum_bc2_10 bc2; enum __anonenum_bd1_11 { Bd1 = (signed char)'c', Md1 = -1 }; typedef enum __anonenum_bd1_11 bd1; enum __anonenum_bd2_12 { Bd2 = (unsigned char)'c', Md2 = -1 }; typedef enum __anonenum_bd2_12 bd2; typedef unsigned int bla; int main(void) { int __retres; foo x = A; bar y = (enum __anonenum_bar_2)B; bu1 u1 = Bu1; bu2 u2 = Bu2; bu3 u3 = Bu3; bs1 s1 = Bs1; bs2 s2 = (enum __anonenum_bs2_7)Bs2; bs3 s3 = Bs3; bc1 c1 = (enum __anonenum_bc1_9)Bc1; bc2 c2 = (enum __anonenum_bc2_10)Bc2; bd1 d1 = (enum __anonenum_bd1_11)Bd1; bd2 d2 = (enum __anonenum_bd2_12)Bd2; if (x == (unsigned int)A) if ((int)y == B) { __retres = 0; goto return_label; } __retres = 1; return_label: return __retres; } int f1(bla x); int f2(bla x); int f3(bla x); int h1(foo x); int h2(foo x); int h3(foo x); int g(void) { int tmp_0; int tmp_1; int tmp_2; int tmp_3; int tmp_4; foo x = A; int res = f1((unsigned int)x); tmp_0 = f2((unsigned int)x); res += tmp_0; tmp_1 = f3(x); res += tmp_1; tmp_2 = h1((unsigned int)x); res += tmp_2; tmp_3 = h2((unsigned int)x); res += tmp_3; tmp_4 = h3(x); res += tmp_4; return res; } frama-c-20.0-Calcium/tests/syntax/oracle/enum_size_array.res.oracle0000666000000000000000000000042213571573400022321 0ustar [kernel] Parsing tests/syntax/enum_size_array.i (no preprocessing) /* Generated by Frama-C */ enum __anonenum_T_E_1 { ONE = 0, TWO = 1, EN_NB = 2 }; int f_return_last(int * /*[2]*/ tab) { int __retres; __retres = *(tab + (EN_NB - 1)); return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/erased_label_bts1502.res.oracle0000666000000000000000000000024313571573400022710 0ustar [kernel] Parsing tests/syntax/erased_label_bts1502.i (no preprocessing) /* Generated by Frama-C */ void f(int a) { goto _LOR_0; if (a) _LOR_0: ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/exit.res.oracle0000666000000000000000000000120713571573400020100 0ustar [kernel] Parsing tests/syntax/exit.c (with preprocessing) [kernel] tests/syntax/exit.c:16: Warning: Body of function g falls-through. Adding a return statement /* Generated by Frama-C */ #include "stdlib.h" int volatile c; int f(void) { int __retres; if (c) { __retres = 0; goto return_label; } else quick_exit(1); return_label: return __retres; } void unknown_exit(int i); int g(void) { int __retres; if (c) { __retres = 0; goto return_label; } else unknown_exit(1); /*@ assert missing_return: \false; */ ; __retres = 0; return_label: return __retres; } void main(void) { f(); g(); return; } frama-c-20.0-Calcium/tests/syntax/oracle/extern_init.0.res.oracle0000666000000000000000000000267113571573400021623 0ustar [kernel] Parsing tests/syntax/extern_init.i (no preprocessing) [kernel] Parsing tests/syntax/extern_init_1.i (no preprocessing) [kernel] Parsing tests/syntax/extern_init_2.i (no preprocessing) [kernel:typing:no-proto] tests/syntax/extern_init_2.i:10: Warning: Calling function f that is declared without prototype. Its formals will be inferred from actual arguments [kernel:typing:no-proto] tests/syntax/extern_init_2.i:11: Warning: Calling function g that is declared without prototype. Its formals will be inferred from actual arguments [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [eva] computing for function f <- main. Called from tests/syntax/extern_init_2.i:10. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/syntax/extern_init_2.i:11. [eva] using specification for function g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: a[0] ∈ {1} [1] ∈ {2} [2] ∈ {12} [3] ∈ {4} [4] ∈ {5} [eva:final-states] Values at end of function main: a[0] ∈ {1} [1] ∈ {2} [2] ∈ {12} [3] ∈ [--..--] [4] ∈ {5} __retres ∈ {2} frama-c-20.0-Calcium/tests/syntax/oracle/extern_init.1.res.oracle0000666000000000000000000000267113571573400021624 0ustar [kernel] Parsing tests/syntax/extern_init.i (no preprocessing) [kernel] Parsing tests/syntax/extern_init_2.i (no preprocessing) [kernel:typing:no-proto] tests/syntax/extern_init_2.i:10: Warning: Calling function f that is declared without prototype. Its formals will be inferred from actual arguments [kernel:typing:no-proto] tests/syntax/extern_init_2.i:11: Warning: Calling function g that is declared without prototype. Its formals will be inferred from actual arguments [kernel] Parsing tests/syntax/extern_init_1.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [eva] computing for function f <- main. Called from tests/syntax/extern_init_2.i:10. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/syntax/extern_init_2.i:11. [eva] using specification for function g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: a[0] ∈ {1} [1] ∈ {2} [2] ∈ {12} [3] ∈ {4} [4] ∈ {5} [eva:final-states] Values at end of function main: a[0] ∈ {1} [1] ∈ {2} [2] ∈ {12} [3] ∈ [--..--] [4] ∈ {5} __retres ∈ {2} frama-c-20.0-Calcium/tests/syntax/oracle/extinline.res.oracle0000666000000000000000000000024213571573400021124 0ustar [kernel] Parsing tests/syntax/extinline.i (no preprocessing) /* Generated by Frama-C */ extern void f(int a, int b); extern void f(int a, int b) { return; } frama-c-20.0-Calcium/tests/syntax/oracle/fam.res.oracle0000666000000000000000000000161613571573400017676 0ustar [kernel] Parsing tests/syntax/fam.i (no preprocessing) [kernel] tests/syntax/fam.i:10: User Error: static initialization of flexible array members is an unsupported GNU extension [kernel] tests/syntax/fam.i:22: User Error: field `b' is declared with incomplete type char [] [kernel] tests/syntax/fam.i:22: User Error: static initialization of flexible array members is an unsupported GNU extension [kernel] tests/syntax/fam.i:43: User Error: static initialization of flexible array members is an unsupported GNU extension [kernel] tests/syntax/fam.i:57: User Error: static initialization of flexible array members is an unsupported GNU extension [kernel] tests/syntax/fam.i:71: User Error: static initialization of flexible array members is an unsupported GNU extension [kernel] User Error: stopping on file "tests/syntax/fam.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/fct_ptr.res.oracle0000666000000000000000000000135613571573400020575 0ustar [kernel] Parsing tests/syntax/fct_ptr.i (no preprocessing) [kernel:typing:incompatible-types-call] tests/syntax/fct_ptr.i:20: Warning: implicit conversion between incompatible function types: char *(*)(int a , ...) and int (*)() /* Generated by Frama-C */ typedef int (*Function_ptr)(); int f(int); void *p = (void *)(& f); int (*pf)(int x) = & f; int g(void) { int tmp; tmp = (*pf)(4); return tmp; } int main(void) { int __retres; int (*q)(int ) = (int (*)(int ))((void *)0xfff45); (*q)(2); q = (int (*)(int ))p; (*q)(3); __retres = 0; return __retres; } char *f_va(int a, void * const *__va_params) { char *__retres; __retres = (char *)a; return __retres; } Function_ptr fp_table[1] = {(int (*)())(& f_va)}; frama-c-20.0-Calcium/tests/syntax/oracle/flexible_array_member.res.oracle0000666000000000000000000000046713571573400023455 0ustar [kernel] Parsing tests/syntax/flexible_array_member.i (no preprocessing) /* Generated by Frama-C */ struct s1 { int size ; char data[] ; }; struct s2 { char len ; char data[] ; }; struct s { char len ; char data[] ; }; union u { struct s fam ; }; struct s1 ss1; struct s2 ss2; union u u1; frama-c-20.0-Calcium/tests/syntax/oracle/flexible_array_member_invalid1.res.oracle0000666000000000000000000000060413571573400025235 0ustar [kernel] Parsing tests/syntax/flexible_array_member_invalid1.i (no preprocessing) [kernel] tests/syntax/flexible_array_member_invalid1.i:2: User Error: flexible array member 'data' (type char []) not allowed in otherwise empty struct [kernel] User Error: stopping on file "tests/syntax/flexible_array_member_invalid1.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/flexible_array_member_invalid2.res.oracle0000666000000000000000000000055013571573400025236 0ustar [kernel] Parsing tests/syntax/flexible_array_member_invalid2.i (no preprocessing) [kernel] tests/syntax/flexible_array_member_invalid2.i:2: User Error: field `data' is declared with incomplete type char [] [kernel] User Error: stopping on file "tests/syntax/flexible_array_member_invalid2.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/flexible_array_member_invalid3.res.oracle0000666000000000000000000000055013571573400025237 0ustar [kernel] Parsing tests/syntax/flexible_array_member_invalid3.i (no preprocessing) [kernel] tests/syntax/flexible_array_member_invalid3.i:2: User Error: field `data' is declared with incomplete type char [] [kernel] User Error: stopping on file "tests/syntax/flexible_array_member_invalid3.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/flexible_array_member_invalid4.res.oracle0000666000000000000000000000055013571573400025240 0ustar [kernel] Parsing tests/syntax/flexible_array_member_invalid4.i (no preprocessing) [kernel] tests/syntax/flexible_array_member_invalid4.i:2: User Error: field `data' is declared with incomplete type char [] [kernel] User Error: stopping on file "tests/syntax/flexible_array_member_invalid4.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/flexible_array_member_invalid5.res.oracle0000666000000000000000000000056513571573400025247 0ustar [kernel] Parsing tests/syntax/flexible_array_member_invalid5.i (no preprocessing) [kernel] tests/syntax/flexible_array_member_invalid5.i:7: User Error: field `f' declared with a type containing a flexible array member. [kernel] User Error: stopping on file "tests/syntax/flexible_array_member_invalid5.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/float.res.oracle0000666000000000000000000000032213571573400020231 0ustar [kernel] Parsing tests/syntax/float.i (no preprocessing) /* Generated by Frama-C */ /*@ requires f ≡ 0.1f; */ void main(float f) { /*@ assert 0xfffffffffffffffff ≡ 0xfffffffffffffffff; */ ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/forloophook.res.oracle0000666000000000000000000000020613571573400021466 0ustar [kernel] Parsing tests/syntax/forloophook.i (no preprocessing) Found a for loop Local declaration Has a test Has an increment No body frama-c-20.0-Calcium/tests/syntax/oracle/formals_decl_leak.res.oracle0000666000000000000000000000040013571573400022547 0ustar [kernel] Parsing tests/syntax/formals_decl_leak.i (no preprocessing) [kernel] Parsing tests/syntax/formals_decl_leak_1.i (no preprocessing) /* Generated by Frama-C */ void f(int x); void g(void) { f(3); return; } void h(void) { f(4); return; } frama-c-20.0-Calcium/tests/syntax/oracle/func_spec_merge.res.oracle0000666000000000000000000000052513571573400022255 0ustar [kernel] Parsing tests/syntax/func_spec_merge.i (no preprocessing) /* Generated by Frama-C */ int f(void) { int __retres; __retres = 3; return __retres; } int g(void) { int __retres; __retres = 4; return __retres; } /*@ requires p ≡ &f ∨ p ≡ &g; */ int main(int (*p)(void)) { int tmp; tmp = (*p)(); return tmp; } frama-c-20.0-Calcium/tests/syntax/oracle/function-types-compatible.res.oracle0000666000000000000000000000105213571573400024231 0ustar [kernel] Parsing tests/syntax/function-types-compatible.i (no preprocessing) [kernel:typing:incompatible-types-call] tests/syntax/function-types-compatible.i:4: Warning: implicit conversion between incompatible function types: void (*)() and void (*)(int , ...) /* Generated by Frama-C */ void (*p)(int , void * const *__va_params); void f(); void main(void) { p = (void (*)(int , void * const *__va_params))(& f); { int __va_arg0 = 2; void *__va_args[1] = {& __va_arg0}; (*p)(1,(void * const *)(__va_args)); } return; } frama-c-20.0-Calcium/tests/syntax/oracle/gcc_builtins.res.oracle0000666000000000000000000003062213571573400021577 0ustar [kernel] Parsing tests/syntax/gcc_builtins.c (with preprocessing) /* Generated by Frama-C */ #include "stdint.h" /* compiler builtin: short __sync_add_and_fetch_int16_t(short volatile *ptr, short value, void * const *__va_params); */ /* compiler builtin: int __sync_add_and_fetch_int32_t(int volatile *ptr, int value, void * const *__va_params); */ /* compiler builtin: long long __sync_add_and_fetch_int64_t(long long volatile *ptr, long long value, void * const *__va_params); */ /* compiler builtin: int __sync_bool_compare_and_swap_uint16_t(unsigned short volatile *ptr, unsigned short oldval, unsigned short newval, void * const *__va_params); */ /* compiler builtin: int __sync_bool_compare_and_swap_uint32_t(unsigned int volatile *ptr, unsigned int oldval, unsigned int newval, void * const *__va_params); */ /* compiler builtin: int __sync_bool_compare_and_swap_uint64_t(unsigned long long volatile *ptr, unsigned long long oldval, unsigned long long newval, void * const *__va_params); */ /* compiler builtin: short __sync_fetch_and_add_int16_t(short volatile *ptr, short value, void * const *__va_params); */ /* compiler builtin: int __sync_fetch_and_add_int32_t(int volatile *ptr, int value, void * const *__va_params); */ /* compiler builtin: long long __sync_fetch_and_add_int64_t(long long volatile *ptr, long long value, void * const *__va_params); */ /* compiler builtin: short __sync_fetch_and_sub_int16_t(short volatile *ptr, short value, void * const *__va_params); */ /* compiler builtin: int __sync_fetch_and_sub_int32_t(int volatile *ptr, int value, void * const *__va_params); */ /* compiler builtin: long long __sync_fetch_and_sub_int64_t(long long volatile *ptr, long long value, void * const *__va_params); */ /* compiler builtin: short __sync_sub_and_fetch_int16_t(short volatile *ptr, short value, void * const *__va_params); */ /* compiler builtin: int __sync_sub_and_fetch_int32_t(int volatile *ptr, int value, void * const *__va_params); */ /* compiler builtin: long long __sync_sub_and_fetch_int64_t(long long volatile *ptr, long long value, void * const *__va_params); */ short __sync_fetch_and_add_int16_t(short volatile *ptr, short value, void * const *__va_params) { int16_t tmp = *ptr; *ptr = (short)((int)*ptr + (int)value); return tmp; } short __sync_fetch_and_sub_int16_t(short volatile *ptr, short value, void * const *__va_params) { int16_t tmp = *ptr; *ptr = (short)((int)*ptr - (int)value); return tmp; } int __sync_fetch_and_add_int32_t(int volatile *ptr, int value, void * const *__va_params) { int32_t tmp = *ptr; *ptr += value; return tmp; } int __sync_fetch_and_sub_int32_t(int volatile *ptr, int value, void * const *__va_params) { int32_t tmp = *ptr; *ptr -= value; return tmp; } long long __sync_fetch_and_add_int64_t(long long volatile *ptr, long long value, void * const *__va_params) { int64_t tmp = *ptr; *ptr += value; return tmp; } long long __sync_fetch_and_sub_int64_t(long long volatile *ptr, long long value, void * const *__va_params) { int64_t tmp = *ptr; *ptr -= value; return tmp; } short __sync_add_and_fetch_int16_t(short volatile *ptr, short value, void * const *__va_params) { short __retres; *ptr = (short)((int)*ptr + (int)value); __retres = *ptr; return __retres; } short __sync_sub_and_fetch_int16_t(short volatile *ptr, short value, void * const *__va_params) { short __retres; *ptr = (short)((int)*ptr - (int)value); __retres = *ptr; return __retres; } int __sync_add_and_fetch_int32_t(int volatile *ptr, int value, void * const *__va_params) { int __retres; *ptr += value; __retres = *ptr; return __retres; } int __sync_sub_and_fetch_int32_t(int volatile *ptr, int value, void * const *__va_params) { int __retres; *ptr -= value; __retres = *ptr; return __retres; } long long __sync_add_and_fetch_int64_t(long long volatile *ptr, long long value, void * const *__va_params) { long long __retres; *ptr += value; __retres = *ptr; return __retres; } long long __sync_sub_and_fetch_int64_t(long long volatile *ptr, long long value, void * const *__va_params) { long long __retres; *ptr -= value; __retres = *ptr; return __retres; } int __sync_bool_compare_and_swap_uint16_t(unsigned short volatile *ptr, unsigned short oldval, unsigned short newval, void * const *__va_params) { int __retres; if ((int)*ptr == (int)oldval) { *ptr = newval; __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } int __sync_bool_compare_and_swap_uint32_t(unsigned int volatile *ptr, unsigned int oldval, unsigned int newval, void * const *__va_params) { int __retres; if (*ptr == oldval) { *ptr = newval; __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } int __sync_bool_compare_and_swap_uint64_t(unsigned long long volatile *ptr, unsigned long long oldval, unsigned long long newval, void * const *__va_params) { int __retres; if (*ptr == oldval) { *ptr = newval; __retres = 1; goto return_label; } else { __retres = 0; goto return_label; } return_label: return __retres; } void main(void) { int tmp; { int16_t result; int16_t content = (short)100; int16_t volatile *ptr = (int16_t volatile *)(& content); int16_t value = (short)33; { void *__va_args[1] = {(void *)0}; result = __sync_fetch_and_add_int16_t(ptr,value, (void * const *)(__va_args)); } /*@ assert result ≡ 100 ∧ content ≡ 133; */ ; { void *__va_args_35[1] = {(void *)0}; result = __sync_fetch_and_add_int16_t(ptr,(short)(-11), (void * const *)(__va_args_35)); } /*@ assert result ≡ 133 ∧ content ≡ 122; */ ; { void *__va_args_37[1] = {(void *)0}; result = __sync_fetch_and_sub_int16_t(ptr,value, (void * const *)(__va_args_37)); } /*@ assert result ≡ 122 ∧ content ≡ 89; */ ; { void *__va_args_39[1] = {(void *)0}; result = __sync_fetch_and_sub_int16_t(ptr,(short)(-11), (void * const *)(__va_args_39)); } /*@ assert result ≡ 89 ∧ content ≡ 100; */ ; } { int32_t result_0; int32_t content_0 = 100; int32_t volatile *ptr_0 = (int32_t volatile *)(& content_0); int32_t value_0 = 33; { void *__va_args_41[1] = {(void *)0}; result_0 = __sync_fetch_and_add_int32_t(ptr_0,value_0, (void * const *)(__va_args_41)); } /*@ assert result_0 ≡ 100 ∧ content_0 ≡ 133; */ ; { void *__va_args_43[1] = {(void *)0}; result_0 = __sync_fetch_and_add_int32_t(ptr_0,-11, (void * const *)(__va_args_43)); } /*@ assert result_0 ≡ 133 ∧ content_0 ≡ 122; */ ; { void *__va_args_45[1] = {(void *)0}; result_0 = __sync_fetch_and_sub_int32_t(ptr_0,value_0, (void * const *)(__va_args_45)); } /*@ assert result_0 ≡ 122 ∧ content_0 ≡ 89; */ ; { void *__va_args_47[1] = {(void *)0}; result_0 = __sync_fetch_and_sub_int32_t(ptr_0,-11, (void * const *)(__va_args_47)); } /*@ assert result_0 ≡ 89 ∧ content_0 ≡ 100; */ ; } { int64_t result_1; int64_t content_1 = (long long)100; int64_t volatile *ptr_1 = (int64_t volatile *)(& content_1); int64_t value_1 = (long long)33; { void *__va_args_49[1] = {(void *)0}; result_1 = __sync_fetch_and_add_int64_t(ptr_1,value_1, (void * const *)(__va_args_49)); } /*@ assert result_1 ≡ 100 ∧ content_1 ≡ 133; */ ; { void *__va_args_51[1] = {(void *)0}; result_1 = __sync_fetch_and_add_int64_t(ptr_1,(long long)(-11), (void * const *)(__va_args_51)); } /*@ assert result_1 ≡ 133 ∧ content_1 ≡ 122; */ ; { void *__va_args_53[1] = {(void *)0}; result_1 = __sync_fetch_and_sub_int64_t(ptr_1,value_1, (void * const *)(__va_args_53)); } /*@ assert result_1 ≡ 122 ∧ content_1 ≡ 89; */ ; { void *__va_args_55[1] = {(void *)0}; result_1 = __sync_fetch_and_sub_int64_t(ptr_1,(long long)(-11), (void * const *)(__va_args_55)); } /*@ assert result_1 ≡ 89 ∧ content_1 ≡ 100; */ ; } { int result_2; uint16_t content_2 = (unsigned short)100; uint16_t volatile *ptr_2 = (uint16_t volatile *)(& content_2); uint16_t oldval = (unsigned short)100; uint16_t newval = (unsigned short)133; { void *__va_args_57[1] = {(void *)0}; result_2 = __sync_bool_compare_and_swap_uint16_t(ptr_2,oldval,newval, (void * const *)(__va_args_57)); } /*@ assert result_2 ≡ 1 ∧ *ptr_2 ≡ newval; */ ; } { int result_3; uint32_t content_3 = (unsigned int)100; uint32_t volatile *ptr_3 = (uint32_t volatile *)(& content_3); uint32_t oldval_0 = (unsigned int)100; uint32_t newval_0 = (unsigned int)133; { void *__va_args_59[1] = {(void *)0}; result_3 = __sync_bool_compare_and_swap_uint32_t(ptr_3,oldval_0, newval_0, (void * const *)(__va_args_59)); } /*@ assert result_3 ≡ 1 ∧ *ptr_3 ≡ newval_0; */ ; } { int result_4; uint64_t content_4 = (unsigned long long)100; uint64_t volatile *ptr_4 = (uint64_t volatile *)(& content_4); uint64_t oldval_1 = (unsigned long long)100; uint64_t newval_1 = (unsigned long long)133; { void *__va_args_61[1] = {(void *)0}; result_4 = __sync_bool_compare_and_swap_uint64_t(ptr_4,oldval_1, newval_1, (void * const *)(__va_args_61)); } /*@ assert result_4 ≡ 1 ∧ *ptr_4 ≡ newval_1; */ ; } if ((long)(4 == 4)) { int x = 1; } if ((long)(3 == 4)) { int x_0 = 0; } int x_1 = 2; ; tmp = x_1; x_1 ++; ; if ((long)tmp) { int y = x_1; } return; } frama-c-20.0-Calcium/tests/syntax/oracle/get_astinfo_bts1136.res.oracle0000666000000000000000000000065413571573400022621 0ustar [kernel] Parsing tests/syntax/get_astinfo_bts1136.i (no preprocessing) found variable vid:20 formal in f found variable vid:23 formal in g found variable vid:26 formal in h found variable vid:28 formal in i found variable vid:30 formal in j found variable vid:32 formal in k [do_v] vid:26 formal in h [do_v] vid:23 formal in g [do_v] vid:20 formal in f [do_v] vid:32 local in k [do_v] vid:30 local in j [do_v] vid:28 local in i frama-c-20.0-Calcium/tests/syntax/oracle/ghost_func_ptr.res.oracle0000666000000000000000000000041713571573400022155 0ustar [kernel] Parsing tests/syntax/ghost_func_ptr.i (no preprocessing) /* Generated by Frama-C */ /*@ ghost void (*g)(int *) = (void (*)(int *))0; */ int main(void) { int __retres; /*@ ghost void (*l)(int *) = (void (*)(int *))0; */ __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/ghost_lexing.res.oracle0000666000000000000000000000042413571573400021621 0ustar [kernel] Parsing tests/syntax/ghost_lexing.i (no preprocessing) /* Generated by Frama-C */ int G = 0; char const *foo = "foo"; void test(char const *); void test2(int x) { /*@ ghost int y = 0; */ /*@ ghost if (x > 0) y = x * x; */ G = x * x; test(foo); return; } frama-c-20.0-Calcium/tests/syntax/oracle/ghost_local_capture.res.oracle0000666000000000000000000000127713571573400023157 0ustar [kernel] Parsing tests/syntax/ghost_local_capture.i (no preprocessing) /* Generated by Frama-C */ void titi(void) { int c = 0; { L0: ; /*@ ghost int c_0 = 1; */ L1: ; c = 2; /*@ assert c_0 ≡ 1; */ ; /*@ assert \at(c,L0) ≡ 0; */ ; /*@ assert \at(c_0,L1) ≡ 1; */ ; } /*@ assert c ≡ 2; */ ; return; } void toto(void) { /*@ ghost int c_0 = 1; */ { L0: ; int c = 0; L1: ; c = 2; /*@ assert c ≡ 2; */ ; /*@ assert \at(c_0,L0) ≡ 1; */ ; /*@ assert \at(c,L1) ≡ 0; */ ; } /*@ assert c_0 ≡ 1; */ ; return; } /*@ ghost int x; */ /*@ ghost void f(void) { x ++; return; } */ frama-c-20.0-Calcium/tests/syntax/oracle/ghost_local_ill_formed.res.oracle0000666000000000000000000000105713571573400023624 0ustar [kernel] Parsing tests/syntax/ghost_local_ill_formed.i (no preprocessing) [kernel] tests/syntax/ghost_local_ill_formed.i:5: User Error: redefinition of 'c' in the same scope. Previous declaration was at tests/syntax/ghost_local_ill_formed.i:2 [kernel] tests/syntax/ghost_local_ill_formed.i:17: User Error: Variable c is a ghost symbol. It cannot be used in non-ghost context. Did you forget a /*@ ghost ... /? [kernel] User Error: stopping on file "tests/syntax/ghost_local_ill_formed.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_multiline_annot.0.res.oracle0000666000000000000000000000053613571573400023676 0ustar [kernel] Parsing tests/syntax/ghost_multiline_annot.c (with preprocessing) /* Generated by Frama-C */ int main(int c) { int __retres; /*@ ghost /@ requires c ≥ 0; @/ int x = c; */ /*@ ghost /@ loop invariant x ≥ 0; loop assigns x; loop variant x; @/ while (x > 0) x --; */ __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/ghost_multiline_annot.1.res.oracle0000666000000000000000000000102413571573400023670 0ustar [kernel] Parsing tests/syntax/ghost_multiline_annot.c (with preprocessing) [kernel] tests/syntax/ghost_multiline_annot.c:34: Ghost multi-line annotation not terminated: Location: between lines 34 and 41 32 { 33 /*@ ghost 34 int x = 10; 35 /@ loop invariant x >= 0; 36 loop assigns x; 37 loop variant x; 38 while (x > 0) { 39 x--; 40 } 41 */ 42 return 0; 43 } [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_multiline_annot.2.res.oracle0000666000000000000000000000062513571573400023677 0ustar [kernel] Parsing tests/syntax/ghost_multiline_annot.c (with preprocessing) [kernel] tests/syntax/ghost_multiline_annot.c:48: This kind of annotation is valid only inside ghost code: Location: between lines 48 and 49, before or at token: /@ 46 #ifdef P2 47 int main() 48 { 49 /@ assert 2 == 2; @/ 50 return 0; 51 } [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_multiline_annot.3.res.oracle0000666000000000000000000000057213571573400023701 0ustar [kernel] Parsing tests/syntax/ghost_multiline_annot.c (with preprocessing) [kernel] tests/syntax/ghost_multiline_annot.c:57: Invalid symbol: Location: line 57, between columns 2 and 19, before or at token: @ 55 int main() 56 { 57 assert (2 == 2); @/ ^^^^^^^^^^^^^^^^^^^^^ 58 return 0; 59 } [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_multiline_annot.4.res.oracle0000666000000000000000000000065513571573400023704 0ustar [kernel] Parsing tests/syntax/ghost_multiline_annot.c (with preprocessing) [kernel:annot-error] tests/syntax/ghost_multiline_annot.c:65: Warning: unexpected token '/' [kernel] User Error: warning annot-error treated as fatal error. [kernel] User Error: stopping on file "tests/syntax/ghost_multiline_annot.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_multiline_annot.5.res.oracle0000666000000000000000000000065513571573400023705 0ustar [kernel] Parsing tests/syntax/ghost_multiline_annot.c (with preprocessing) [kernel:annot-error] tests/syntax/ghost_multiline_annot.c:76: Warning: unexpected token '/' [kernel] User Error: warning annot-error treated as fatal error. [kernel] User Error: stopping on file "tests/syntax/ghost_multiline_annot.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_multiline_annot.6.res.oracle0000666000000000000000000000046713571573400023707 0ustar [kernel] Parsing tests/syntax/ghost_multiline_annot.c (with preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; /*@ ghost int x = 10; */ /*@ ghost /@ loop invariant x ≥ 0; loop variant x; @/ while (x > 0) x --; */ __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/ghost_multiline_annot.7.res.oracle0000666000000000000000000000054613571573400023706 0ustar [kernel] Parsing tests/syntax/ghost_multiline_annot.c (with preprocessing) /* Generated by Frama-C */ int main(int c) { int __retres; /*@ ghost /@ requires c ≥ 0; @/ int x = c; */ /*@ ghost /@ loop invariant x ≥ 0; loop invariant x ≡ x; loop variant x; @/ while (x > 0) x --; */ __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/ghost_multiline_annot.8.res.oracle0000666000000000000000000000054613571573400023707 0ustar [kernel] Parsing tests/syntax/ghost_multiline_annot.c (with preprocessing) /* Generated by Frama-C */ int main(int c) { int __retres; /*@ ghost /@ requires c ≥ 0; @/ int x = c; */ /*@ ghost /@ loop invariant x ≥ 0; loop invariant x ≡ x; loop variant x; @/ while (x > 0) x --; */ __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.0.res.oracle0000666000000000000000000000237113571573400022637 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:29: User Error: Too few ghost arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:30: User Error: Too few ghost arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:31: User Error: Too few arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:32: User Error: Too few ghost arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:32: User Error: Too many arguments in call to function [kernel] tests/syntax/ghost_parameters.c:33: User Error: Too many ghost arguments in call to function [kernel] tests/syntax/ghost_parameters.c:33: User Error: Too few arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:35: User Error: Too few arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:36: User Error: Too few arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:37: User Error: Too few arguments in call to function. [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.1.res.oracle0000666000000000000000000000222613571573400022637 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:54: User Error: Too few ghost arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:55: User Error: Too few ghost arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:56: User Error: Too many arguments in call to function [kernel] tests/syntax/ghost_parameters.c:57: User Error: Too few ghost arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:57: User Error: Too many arguments in call to function [kernel] tests/syntax/ghost_parameters.c:58: User Error: Too many ghost arguments in call to function [kernel] tests/syntax/ghost_parameters.c:60: User Error: Too few arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:61: User Error: Too few arguments in call to function. [kernel] tests/syntax/ghost_parameters.c:62: User Error: Too many arguments in call to function [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.10.res.oracle0000666000000000000000000000130013571573400022707 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:184: User Error: Declaration of function does not match previous declaration from tests/syntax/ghost_parameters.c:178 (different number of arguments). [kernel] tests/syntax/ghost_parameters.c:184: User Error: Inconsistent formals 182 } 183 184 void function(int a, int b) /*@ ghost(int c, int d) */ { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 185 186 } [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.11.res.oracle0000666000000000000000000000065313571573400022722 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:192: syntax error: Location: line 192, between columns 35 and 36, before or at token: ) 190 #ifdef VOID_EMPTY_GHOST_PARAMETER_LIST 191 192 void function_void(void) /*@ ghost () */ { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 193 194 } [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.12.res.oracle0000666000000000000000000000070713571573400022723 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:200: User Error: ghost parameters list cannot be void [kernel] tests/syntax/ghost_parameters.c:204: User Error: ghost parameters list cannot be void [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.2.res.oracle0000666000000000000000000000045013571573400022635 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) /* Generated by Frama-C */ void function(int a, int b) /*@ ghost (int c, int d) */; void caller(void) { function(1,2) /*@ ghost (3,4) */; return; } void function(int a, int b) /*@ ghost (int c, int d) */ { return; } frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.3.res.oracle0000666000000000000000000000127513571573400022644 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:89: User Error: Declaration of function does not match previous declaration from tests/syntax/ghost_parameters.c:85 (different number of arguments). [kernel] tests/syntax/ghost_parameters.c:89: User Error: Inconsistent formals 87 } 88 89 void function(int a, int b) /*@ ghost(int c, int d) */ { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 90 91 } [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.4.res.oracle0000666000000000000000000000127713571573400022647 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:103: User Error: Declaration of function does not match previous declaration from tests/syntax/ghost_parameters.c:97 (different number of arguments). [kernel] tests/syntax/ghost_parameters.c:103: User Error: Inconsistent formals 101 } 102 103 void function(int a, int b) /*@ ghost(int c, int d) */ { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 104 105 } [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.5.res.oracle0000666000000000000000000000130613571573400022641 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:116: User Error: Declaration of function does not match previous declaration from tests/syntax/ghost_parameters.c:112 (different number of ghost arguments). [kernel] tests/syntax/ghost_parameters.c:116: User Error: Inconsistent formals 114 } 115 116 void function(int a, int b) /*@ ghost(int c, int d) */ { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 117 118 } [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.6.res.oracle0000666000000000000000000000130613571573400022642 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:130: User Error: Declaration of function does not match previous declaration from tests/syntax/ghost_parameters.c:124 (different number of ghost arguments). [kernel] tests/syntax/ghost_parameters.c:130: User Error: Inconsistent formals 128 } 129 130 void function(int a, int b) /*@ ghost(int c, int d) */ { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 131 132 } [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.7.res.oracle0000666000000000000000000000130013571573400022635 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:143: User Error: Declaration of function does not match previous declaration from tests/syntax/ghost_parameters.c:139 (different number of arguments). [kernel] tests/syntax/ghost_parameters.c:143: User Error: Inconsistent formals 141 } 142 143 void function(int a, int b) /*@ ghost(int c, int d) */ { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 144 145 } [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.8.res.oracle0000666000000000000000000000130013571573400022636 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:157: User Error: Declaration of function does not match previous declaration from tests/syntax/ghost_parameters.c:151 (different number of arguments). [kernel] tests/syntax/ghost_parameters.c:157: User Error: Inconsistent formals 155 } 156 157 void function(int a, int b) /*@ ghost(int c, int d) */ { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 158 159 } [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters.9.res.oracle0000666000000000000000000000130013571573400022637 0ustar [kernel] Parsing tests/syntax/ghost_parameters.c (with preprocessing) [kernel] tests/syntax/ghost_parameters.c:170: User Error: Declaration of function does not match previous declaration from tests/syntax/ghost_parameters.c:166 (different number of arguments). [kernel] tests/syntax/ghost_parameters.c:170: User Error: Inconsistent formals 168 } 169 170 void function(int a, int b) /*@ ghost(int c, int d) */ { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 171 172 } [kernel] User Error: stopping on file "tests/syntax/ghost_parameters.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters_formals_status.res.oracle0000666000000000000000000000200713571573400025623 0ustar [kernel] Parsing tests/syntax/ghost_parameters_formals_status.i (no preprocessing) [kernel] Type of caller is void (void). No Formals [kernel] Type of declaration_not_void is void (int a, int b) /*@ ghost (int x, int y) */. Formals are - a which is non-ghost - b which is non-ghost - x which is ghost - y which is ghost [kernel] Type of declaration_void is void (void) /*@ ghost (int x, int y) */. Formals are - x which is ghost - y which is ghost [kernel] Type of definition_not_void is void (int a, int b) /*@ ghost (int x, int y) */. Formals are - a which is non-ghost - b which is non-ghost - x which is ghost - y which is ghost [kernel] Type of definition_void is void (void) /*@ ghost (int x, int y) */. Formals are - x which is ghost - y which is ghost frama-c-20.0-Calcium/tests/syntax/oracle/ghost_parameters_side_effect_arg.res.oracle0000666000000000000000000000254613571573400025656 0ustar [kernel] Parsing tests/syntax/ghost_parameters_side_effect_arg.i (no preprocessing) /* Generated by Frama-C */ void function(int x) /*@ ghost (int y) */; int other(int x) /*@ ghost (int y) */; void caller(void) { /*@ ghost int g_tmp; */ int tmp; /*@ ghost int g_tmp_0; */ int tmp_0; /*@ ghost int g_tmp_1; */ int tmp_1; /*@ ghost int g_tmp_2; */ int tmp_2; /*@ ghost int g_tmp_3; */ /*@ ghost int g_tmp_4; */ int x = 0; /*@ ghost int g = 0; */ int t[3] = {0, 0, 0}; /*@ ghost g_tmp = g; */ /*@ ghost g ++; */ /*@ ghost ; */ tmp = x; x ++; ; function(tmp) /*@ ghost (g_tmp) */; /*@ ghost g = 42; */ x = 2; function(x) /*@ ghost (g) */; /*@ ghost g += 42; */ x += 2; function(x) /*@ ghost (g) */; function(- x) /*@ ghost (- g) */; /*@ ghost if (g == 0) g_tmp_0 = g; else g_tmp_0 = 42; */ if (x == 0) tmp_0 = x; else tmp_0 = 42; function(tmp_0) /*@ ghost (g_tmp_0) */; /*@ ghost g_tmp_1 = g; */ /*@ ghost g ++; */ /*@ ghost ; */ tmp_1 = x; x ++; ; function(t[tmp_1]) /*@ ghost (t[g_tmp_1]) */; /*@ ghost g_tmp_2 = other(x,g); */ tmp_2 = other(x) /*@ ghost (g) */; function(tmp_2) /*@ ghost (g_tmp_2) */; /*@ ghost int i = 1; */ /*@ ghost g_tmp_3 = i; i ++; ; g_tmp_4 = g; g ++; ; */ /*@ ghost function(g_tmp_4,g_tmp_3); */ return; } frama-c-20.0-Calcium/tests/syntax/oracle/gnu-asm-aesni.res.oracle0000666000000000000000000001252613571573400021601 0ustar [kernel] Parsing tests/syntax/gnu-asm-aesni.c (with preprocessing) [kernel] tests/syntax/gnu-asm-aesni.c:93: Warning: Clobber list contains "memory" argument. Assuming no side effects beyond those mentioned in operands. /* Generated by Frama-C */ #include "__fc_builtin.h" #include "string.h" #include "strings.h" typedef unsigned short byte; union __anonunion_PROPERLY_ALIGNED_TYPE_1 { int a ; short b ; char c[1] ; long d ; float f ; double g ; }; typedef union __anonunion_PROPERLY_ALIGNED_TYPE_1 PROPERLY_ALIGNED_TYPE; union __anonunion_u1_3 { PROPERLY_ALIGNED_TYPE dummy ; byte keyschedule[14 + 1][4][4] ; }; union __anonunion_u2_4 { PROPERLY_ALIGNED_TYPE dummy ; byte keyschedule[14 + 1][4][4] ; }; struct __anonstruct_RIJNDAEL_context_2 { union __anonunion_u1_3 u1 ; union __anonunion_u2_4 u2 ; int rounds ; unsigned int decryption_prepared : 1 ; unsigned int use_aesni : 1 ; }; typedef struct __anonstruct_RIJNDAEL_context_2 RIJNDAEL_context; __inline static void do_aesni_enc(RIJNDAEL_context const *ctx, unsigned char *b, unsigned char const *a) { /*@ assigns *b, ctx->u1.keyschedule[0 .. 14]; assigns *b \from *a, ctx->rounds; assigns ctx->u1.keyschedule[0 .. 14] \from *a, ctx->rounds; */ __asm__ volatile ( "movdqu %[src], %%xmm0\n\t" "movdqa (%[key]), %%xmm1\n\t" "pxor %%xmm1, %%xmm0\n\t" "movdqa 0x10(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0x20(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0x30(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0x40(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0x50(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0x60(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0x70(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0x80(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0x90(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0xa0(%[key]), %%xmm1\n\t" "cmpl $10, %[rounds]\n\t" "jz .Lenclast%=\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0xb0(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0xc0(%[key]), %%xmm1\n\t" "cmpl $12, %[rounds]\n\t" "jz .Lenclast%=\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0xd0(%[key]), %%xmm1\n\t" ".byte 0x66, 0x0f, 0x38, 0xdc, 0xc1\n\t" "movdqa 0xe0(%[key]), %%xmm1\n" ".Lenclast%=:\n\t" ".byte 0x66, 0x0f, 0x38, 0xdd, 0xc1\n\t" "movdqu %%xmm0, %[dst]\n" : [dst] "=m" (*b) : [src] "m" (*a), [key] "r" (ctx->u1.keyschedule), [rounds] "r" (ctx->rounds) : "cc", "memory" ); return; } extern int ( /* missing proto */ Frama_C_dump_each)(); void encrypt_aesni(void) { RIJNDAEL_context ctx; unsigned char b[64]; unsigned char a[64]; unsigned char test; int i; int j; int k; unsigned char a_init[64] = {(unsigned char)0x85, (unsigned char)0x50, (unsigned char)0x43, (unsigned char)0xda, (unsigned char)0x06, (unsigned char)0x99, (unsigned char)0xd8, (unsigned char)0x3b, (unsigned char)0x65, (unsigned char)0xf7, (unsigned char)0x1d, (unsigned char)0xf7, (unsigned char)0x95, (unsigned char)0xd4, (unsigned char)0x34, (unsigned char)0x5d, (unsigned char)0x6e, (unsigned char)0x21, (unsigned char)0x01, (unsigned char)0xba, (unsigned char)0x2a, (unsigned char)0xbd, (unsigned char)0x7f, (unsigned char)0xab, (unsigned char)0xa7, (unsigned char)0x6d, (unsigned char)0xe7, (unsigned char)0xcd, (unsigned char)0x72, (unsigned char)0xcf, (unsigned char)0xce, (unsigned char)0xa1, (unsigned char)0xa7, (unsigned char)0x4a, (unsigned char)0xb8, (unsigned char)0x12, (unsigned char)0xef, (unsigned char)0x2d, (unsigned char)0x6b, (unsigned char)0xd5, (unsigned char)0xdc, (unsigned char)0x09, (unsigned char)0xb9, (unsigned char)0xdd, (unsigned char)0x09, (unsigned char)0x27, (unsigned char)0x7c, (unsigned char)0x86, (unsigned char)0x35, (unsigned char)0x60, (unsigned char)0x99, (unsigned char)0xea, (unsigned char)0x72, (unsigned char)0xbb, (unsigned char)0x93, (unsigned char)0x9e, (unsigned char)0x9e, (unsigned char)0x16, (unsigned char)0x7b, (unsigned char)0xd4, (unsigned char)0x8c, (unsigned char)0x81, (unsigned char)0x8a, (unsigned char)0x53}; memcpy((void *)(a),(void const *)(a_init), (unsigned int)64 * sizeof(unsigned char)); i = 0; while (i < 14 + 1) { j = 0; while (j < 4) { k = 0; while (k < 4) { Frama_C_make_unknown((char *)(& ctx.u1.keyschedule[i][j][k]), sizeof(byte)); k ++; } j ++; } i ++; } ctx.rounds = 12; ctx.use_aesni = (unsigned int)1; do_aesni_enc((RIJNDAEL_context const *)(& ctx),b, (unsigned char const *)(a)); test = (unsigned char)0x00U; i = 0; while (i < 64) { test = (unsigned char)((int)test ^ (int)b[i]); i ++; } Frama_C_dump_each(); return; } frama-c-20.0-Calcium/tests/syntax/oracle/implicit_args_bts1267.res.oracle0000666000000000000000000000064513571573400023152 0ustar [kernel] Parsing tests/syntax/implicit_args_bts1267.i (no preprocessing) [kernel:typing:no-proto] tests/syntax/implicit_args_bts1267.i:7: Warning: Calling function f that is declared without prototype. Its formals will be inferred from actual arguments /* Generated by Frama-C */ extern unsigned short t[100000]; int f(int x_0); void main(int i) { unsigned short *p = & t[i]; int s = f((int)*p); return; } frama-c-20.0-Calcium/tests/syntax/oracle/incompatible_qualifiers.0.res.oracle0000666000000000000000000000407313571573400024163 0ustar [kernel] Parsing tests/syntax/incompatible_qualifiers.c (with preprocessing) [kernel] tests/syntax/incompatible_qualifiers.c:11: User Error: Declaration of f does not match previous declaration from tests/syntax/incompatible_qualifiers.c:9 (different qualifiers). [kernel] tests/syntax/incompatible_qualifiers.c:19: User Error: Declaration of h does not match previous declaration from tests/syntax/incompatible_qualifiers.c:17 (different qualifiers). [kernel] tests/syntax/incompatible_qualifiers.c:27: User Error: Declaration of j does not match previous declaration from tests/syntax/incompatible_qualifiers.c:25 (different qualifiers). [kernel] tests/syntax/incompatible_qualifiers.c:38: User Error: Declaration of l does not match previous declaration from tests/syntax/incompatible_qualifiers.c:36 (different qualifiers). [kernel] tests/syntax/incompatible_qualifiers.c:46: User Error: Declaration of n does not match previous declaration from tests/syntax/incompatible_qualifiers.c:44 (different qualifiers). [kernel] tests/syntax/incompatible_qualifiers.c:51: User Error: invalid usage of 'restrict' qualifier [kernel] tests/syntax/incompatible_qualifiers.c:65: User Error: function pointer type does not allow 'restrict' qualifier [kernel] tests/syntax/incompatible_qualifiers.c:72: User Error: invalid usage of 'restrict' qualifier [kernel] tests/syntax/incompatible_qualifiers.c:73: User Error: invalid usage of 'restrict' qualifier [kernel] tests/syntax/incompatible_qualifiers.c:74: User Error: invalid usage of 'restrict' qualifier [kernel] tests/syntax/incompatible_qualifiers.c:75: User Error: invalid usage of 'restrict' qualifier [kernel] tests/syntax/incompatible_qualifiers.c:76: User Error: invalid usage of 'restrict' qualifier [kernel] tests/syntax/incompatible_qualifiers.c:77: User Error: function pointer type does not allow 'restrict' qualifier [kernel] User Error: stopping on file "tests/syntax/incompatible_qualifiers.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/incompatible_qualifiers.1.res.oracle0000666000000000000000000000214113571573400024156 0ustar [kernel] Parsing tests/syntax/incompatible_qualifiers.c (with preprocessing) /* Generated by Frama-C */ typedef int (*fp1)(char ); typedef int *iptr; typedef int * __restrict irptr; int f(int a, char volatile *b); int g(int a, char b); void h(char const *); void i(int *(*f)(int volatile )); void j(int *(*f)(int *)); void k(int *(*f)(int volatile )); fp1 *l(int *(*f)(int )); int (***m(int *(*f)(int volatile )))(char const ); fp1 * const *n(int *(*f)(int , fp1 **)); void o(char r1, char r2); void p(int volatile a); void q(iptr volatile p); void r(int (*f)(char ), int (*g)(char )); void s(irptr p1, irptr p2); int * __restrict * __restrict iprpr; int * __restrict matrix[1]; int main(void) { int __retres; f(0,(char volatile *)0); g(0,(char)0); h((char const *)0); i((int *(*)(int volatile ))0); j((int *(*)(int *))0); k((int *(*)(int volatile ))0); l((int *(*)(int ))0); m((int *(*)(int volatile ))0); n((int *(*)(int , fp1 **))0); o((char)0,(char)0); p(0); q((int *)0); r((int (*)(char ))0,(int (*)(char ))0); s((int *)0,(int *)0); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/incomplete_array.res.oracle0000666000000000000000000000047113571573400022466 0ustar [kernel] Parsing tests/syntax/incomplete_array.i (no preprocessing) [kernel] tests/syntax/incomplete_array.i:7: User Error: declaration of array of incomplete type 'struct S` [kernel] User Error: stopping on file "tests/syntax/incomplete_array.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/incomplete_struct_field.res.oracle0000666000000000000000000000077313571573400024044 0ustar [kernel] Parsing tests/syntax/incomplete_struct_field.i (no preprocessing) [kernel] tests/syntax/incomplete_struct_field.i:1: User Error: declaration of array of incomplete type 'struct _s` [kernel] tests/syntax/incomplete_struct_field.i:1: User Error: field `v' is declared with incomplete type struct _s [12] [kernel] User Error: type struct _s is circular [kernel] User Error: stopping on file "tests/syntax/incomplete_struct_field.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/inconsistent_decl.0.res.oracle0000666000000000000000000000106113571573400022772 0ustar [kernel] Parsing tests/syntax/inconsistent_decl.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/syntax/inconsistent_decl.c:11: Warning: Calling undeclared function f. Old style K&R code? [kernel] Parsing tests/syntax/inconsistent_decl_2.i (no preprocessing) [kernel] User Error: Incompatible declaration for f: different type constructors: int vs. double First declaration was at tests/syntax/inconsistent_decl.c:11 Current declaration is at tests/syntax/inconsistent_decl_2.i:5 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/inconsistent_decl.1.res.oracle0000666000000000000000000000112413571573400022773 0ustar [kernel] Parsing tests/syntax/inconsistent_decl.c (with preprocessing) [kernel:typing:no-proto] tests/syntax/inconsistent_decl.c:11: Warning: Calling function f that is declared without prototype. Its formals will be inferred from actual arguments [kernel] Parsing tests/syntax/inconsistent_decl_2.i (no preprocessing) [kernel] User Error: Incompatible declaration for f: different type constructors: int vs. double First declaration was at tests/syntax/inconsistent_decl.c:7 Current declaration is at tests/syntax/inconsistent_decl_2.i:5 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/inconsistent_global_ghost_spec.0.res.oracle0000666000000000000000000000121113571573400025536 0ustar [kernel] Parsing tests/syntax/inconsistent_global_ghost_spec.c (with preprocessing) [kernel] tests/syntax/inconsistent_global_ghost_spec.c:11: User Error: Inconsistent ghost specification for function. Previous declaration was at: tests/syntax/inconsistent_global_ghost_spec.c:10 9 10 void function(void) ; 11 /*@ ghost void function(void){ } */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 13 void user(void){ [kernel] User Error: stopping on file "tests/syntax/inconsistent_global_ghost_spec.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/inconsistent_global_ghost_spec.1.res.oracle0000666000000000000000000000117413571573400025547 0ustar [kernel] Parsing tests/syntax/inconsistent_global_ghost_spec.c (with preprocessing) [kernel] tests/syntax/inconsistent_global_ghost_spec.c:22: User Error: Inconsistent ghost specification for function. Previous declaration was at: tests/syntax/inconsistent_global_ghost_spec.c:21 20 21 /*@ ghost void function(void) ; */ 22 void function(void){ } ^^^^^^^^^^^^^^^^^^^^^^ 23 24 void user(void){ [kernel] User Error: stopping on file "tests/syntax/inconsistent_global_ghost_spec.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/inconsistent_global_ghost_spec.2.res.oracle0000666000000000000000000000117313571573400025547 0ustar [kernel] Parsing tests/syntax/inconsistent_global_ghost_spec.c (with preprocessing) [kernel] tests/syntax/inconsistent_global_ghost_spec.c:33: User Error: Inconsistent ghost specification for function. Previous declaration was at: tests/syntax/inconsistent_global_ghost_spec.c:32 31 32 /*@ ghost void function(void){ } */ 33 void function(void) ; ^^^^^^^^^^^^^^^^^^^^^ 34 35 void user(void){ [kernel] User Error: stopping on file "tests/syntax/inconsistent_global_ghost_spec.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/inconsistent_global_ghost_spec.3.res.oracle0000666000000000000000000000121013571573400025540 0ustar [kernel] Parsing tests/syntax/inconsistent_global_ghost_spec.c (with preprocessing) [kernel] tests/syntax/inconsistent_global_ghost_spec.c:44: User Error: Inconsistent ghost specification for function. Previous declaration was at: tests/syntax/inconsistent_global_ghost_spec.c:43 42 43 void function(void){ } 44 /*@ ghost void function(void) ; */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 45 46 void user(void){ [kernel] User Error: stopping on file "tests/syntax/inconsistent_global_ghost_spec.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/init_bts1352.res.oracle0000666000000000000000000000071213571573400021255 0ustar [kernel] Parsing tests/syntax/init_bts1352.i (no preprocessing) [kernel] tests/syntax/init_bts1352.i:2: User Error: scalar value (of type int) initialized by compound initializer 1 int main(void) { 2 int t /* [5] missing */ = { 1, 2, 3, 4, 5 }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 } [kernel] User Error: stopping on file "tests/syntax/init_bts1352.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/initializer.res.oracle0000666000000000000000000000306713571573400021460 0ustar [kernel] Parsing tests/syntax/initializer.i (no preprocessing) [kernel:parser:decimal-float] tests/syntax/initializer.i:29: Warning: Floating-point constant 0.1 is not represented exactly. Will use 0x1.999999999999ap-4. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) /* Generated by Frama-C */ enum bool { INVALID = 0, VALID = 1 }; struct signal { float val ; enum bool status ; }; struct signals { struct signal f1 ; struct signal f2 ; struct signal f3 ; struct signal f4 ; struct signal f5 ; struct signal f6 ; struct signal f7 ; }; char const STRS[2][7] = {{(char)'A', (char)'B', (char)'C', (char)'D', (char)'E', (char)'F', (char)'\000'}, {(char)'I', (char)'J', (char)'K', (char)'L', (char)'M', (char)'L', (char)'\000'}}; struct signals const signals = {.f1 = {.val = (float)0.0, .status = VALID}, .f2 = {.val = (float)0.0, .status = VALID}, .f3 = {.val = (float)0.0, .status = VALID}, .f4 = {.val = (float)0.0, .status = VALID}, .f5 = {.val = (float)0.0, .status = INVALID}, .f6 = {.val = (float)0.0, .status = VALID}, .f7 = {.val = 0.f, .status = 0}}; struct signal tsig[3] = {{.val = (float)0.1, .status = INVALID}, {.val = (float)3, .status = VALID}}; void main(void); static unsigned char main_STR[7] = {(unsigned char)'1', (unsigned char)'2', (unsigned char)'3', (unsigned char)'4', (unsigned char)'5', (unsigned char)'6', (unsigned char)'\000'}; void main(void) { int i = (int)main_STR[2]; return; } frama-c-20.0-Calcium/tests/syntax/oracle/initializers.res.oracle0000666000000000000000000000053013571573400021633 0ustar [kernel] Parsing tests/syntax/initializers.i (no preprocessing) [kernel] tests/syntax/initializers.i:4: Warning: Too many initializers for structure /* Generated by Frama-C */ struct e { int i1 ; }; struct ee { int i2 ; }; void f(void) { struct e e1 = {.i1 = 1}; return; } void g(void) { struct ee e2 = {.i2 = 1}; return; } frama-c-20.0-Calcium/tests/syntax/oracle/inline_calls.0.res.oracle0000666000000000000000000001304013571573400021717 0ustar [kernel] Parsing tests/syntax/inline_calls.i (no preprocessing) [kernel] tests/syntax/inline_calls.i:40: Warning: Body of function f1 falls-through. Adding a return statement /* Generated by Frama-C */ int f(void) { int __retres; __retres = 2; return __retres; } __inline static int in_f__fc_inline(void) { int __retres; __retres = 3; return __retres; } int volatile v; int g(void) { int __retres; if (v) { int tmp; { int __retres_5; __retres_5 = 2; tmp = __retres_5; } __retres = tmp; goto return_label; } else { int tmp_0; { int __retres_6; __retres_6 = 3; tmp_0 = __retres_6; } __retres = tmp_0; goto return_label; } return_label: return __retres; } int h(void) { int tmp; { int __retres; if (v) { int tmp_3; { int __retres_5; __retres_5 = 2; tmp_3 = __retres_5; } __retres = tmp_3; goto return_label; } else { int tmp_0; { int __retres_6; __retres_6 = 3; tmp_0 = __retres_6; } __retres = tmp_0; goto return_label; } return_label: tmp = __retres; } return tmp; } int i(void) { int __retres; /*@ assert i: \true; */ ; __retres = 0; return __retres; } int rec(int x_0) { int __retres; int tmp; if (x_0 < 0) { __retres = x_0; goto return_label; } { int __retres_7; int tmp_6; int x_0_5 = x_0 - 1; if (x_0_5 < 0) { __retres_7 = x_0_5; goto return_label_0; } tmp_6 = rec(x_0_5 - 1); __retres_7 = tmp_6; return_label_0: tmp = __retres_7; } __retres = tmp; return_label: return __retres; } int f1(int a); int g1(int a); int volatile nondet; int f1(int a) { int __retres; if (nondet) { int __inline_tmp; { int a_5 = 1; if (nondet) g1(4); __inline_tmp = a_5; } } else if (nondet) { int __inline_tmp_6; { int __retres_9; int a_8 = 2; if (nondet) { int __inline_tmp_10; { int a_5_11 = 1; if (nondet) g1(4); __inline_tmp_10 = a_5_11; } } else if (nondet) { int __inline_tmp_6_12; f1(2); } /*@ assert missing_return: \false; */ ; __retres_9 = 0; __inline_tmp_6 = __retres_9; } } /*@ assert missing_return: \false; */ ; __retres = 0; return __retres; } int g1(int a) { if (nondet) { int __inline_tmp; { int a_4 = 4; if (nondet) { int __inline_tmp_5; g1(4); } __inline_tmp = a_4; } } return a; } int main(void) { int __inline_tmp_11; int __inline_tmp_8; int __inline_tmp; int tmp_1; { int __retres; /*@ assert i: \true; */ ; __retres = 0; __inline_tmp = __retres; } int local_init = __inline_tmp; { int __retres_10; int tmp; int x_0 = local_init; if (x_0 < 0) { __retres_10 = x_0; goto return_label; } { int __retres_7; int tmp_6; int x_0_5 = x_0 - 1; if (x_0_5 < 0) { __retres_7 = x_0_5; goto return_label_0; } tmp_6 = rec(x_0_5 - 1); __retres_7 = tmp_6; return_label_0: tmp = __retres_7; } __retres_10 = tmp; return_label: __inline_tmp_8 = __retres_10; } int t = __inline_tmp_8; { int __retres_13; int a = 2; if (nondet) { int __inline_tmp_14; { int a_5 = 1; if (nondet) g1(4); __inline_tmp_14 = a_5; } } else if (nondet) { int __inline_tmp_6; { int __retres_9; int a_8 = 2; if (nondet) { int __inline_tmp_10; { int a_5_11 = 1; if (nondet) g1(4); __inline_tmp_10 = a_5_11; } } else if (nondet) { int __inline_tmp_6_12; f1(2); } /*@ assert missing_return: \false; */ ; __retres_9 = 0; __inline_tmp_6 = __retres_9; } } /*@ assert missing_return: \false; */ ; __retres_13 = 0; __inline_tmp_11 = __retres_13; } { int tmp_15; { int __retres_16; if (v) { int tmp_3; { int __retres_5; __retres_5 = 2; tmp_3 = __retres_5; } __retres_16 = tmp_3; goto return_label_1; } else { int tmp_0; { int __retres_6; __retres_6 = 3; tmp_0 = __retres_6; } __retres_16 = tmp_0; goto return_label_1; } return_label_1: tmp_15 = __retres_16; } tmp_1 = tmp_15; } return tmp_1; } int with_static(void); static int with_static_count = 0; int with_static(void) { with_static_count ++; return with_static_count; } int call_with_static(void) { int tmp; with_static_count ++; tmp = with_static_count; return tmp; } void builtin_acsl(void) { float g_0 = 0.f; /*@ assert ¬\is_NaN(g_0); */ ; return; } void call_builtin_acsl(void) { { float g_0 = 0.f; /*@ assert ¬\is_NaN(g_0); */ ; ; } return; } void f_slevel(void) { /*@ slevel 0; */ ; return; } void call_f_slevel(void) { /*@ slevel 0; */ ; ; return; } void pre_decl(void); extern int x; int y; void post_decl(void); void middle_decl(void) { x ++; y ++; post_decl(); ; return; } void post_decl(void); int y = 23; void pre_decl(void) { x ++; y ++; post_decl(); return; } frama-c-20.0-Calcium/tests/syntax/oracle/inline_calls.1.res.oracle0000666000000000000000000000406013571573400021722 0ustar [kernel] Parsing tests/syntax/inline_calls.i (no preprocessing) [kernel] tests/syntax/inline_calls.i:40: Warning: Body of function f1 falls-through. Adding a return statement /* Generated by Frama-C */ int f(void) { int __retres; __retres = 2; return __retres; } __inline static int in_f__fc_inline(void) { int __retres; __retres = 3; return __retres; } int volatile v; int g(void) { int __retres; if (v) { int tmp; tmp = f(); __retres = tmp; goto return_label; } else { int tmp_0; { int __retres_5; __retres_5 = 3; tmp_0 = __retres_5; } __retres = tmp_0; goto return_label; } return_label: return __retres; } int h(void) { int tmp; tmp = g(); return tmp; } int i(void) { int __retres; /*@ assert i: \true; */ ; __retres = 0; return __retres; } int rec(int x_0) { int __retres; int tmp; if (x_0 < 0) { __retres = x_0; goto return_label; } tmp = rec(x_0 - 1); __retres = tmp; return_label: return __retres; } int f1(int a); int g1(int a); int volatile nondet; int f1(int a) { int __retres; if (nondet) g1(1); else if (nondet) f1(2); /*@ assert missing_return: \false; */ ; __retres = 0; return __retres; } int g1(int a) { if (nondet) g1(4); return a; } int main(void) { int tmp_1; int local_init = i(); int t = rec(local_init); f1(2); tmp_1 = h(); return tmp_1; } int with_static(void); static int with_static_count = 0; int with_static(void) { with_static_count ++; return with_static_count; } int call_with_static(void) { int tmp; tmp = with_static(); return tmp; } void builtin_acsl(void) { float g_0 = 0.f; /*@ assert ¬\is_NaN(g_0); */ ; return; } void call_builtin_acsl(void) { builtin_acsl(); return; } void f_slevel(void) { /*@ slevel 0; */ ; return; } void call_f_slevel(void) { f_slevel(); return; } void pre_decl(void); void middle_decl(void) { pre_decl(); return; } void post_decl(void); extern int x; int y = 23; void pre_decl(void) { x ++; y ++; post_decl(); return; } frama-c-20.0-Calcium/tests/syntax/oracle/inline_calls.2.res.oracle0000666000000000000000000000371613571573400021732 0ustar [kernel] Parsing tests/syntax/inline_calls.i (no preprocessing) [kernel] tests/syntax/inline_calls.i:40: Warning: Body of function f1 falls-through. Adding a return statement /* Generated by Frama-C */ int f(void) { int __retres; __retres = 2; return __retres; } int volatile v; int g(void) { int __retres; if (v) { int tmp; tmp = f(); __retres = tmp; goto return_label; } else { int tmp_0; { int __retres_5; __retres_5 = 3; tmp_0 = __retres_5; } __retres = tmp_0; goto return_label; } return_label: return __retres; } int h(void) { int tmp; tmp = g(); return tmp; } int i(void) { int __retres; /*@ assert i: \true; */ ; __retres = 0; return __retres; } int rec(int x_0) { int __retres; int tmp; if (x_0 < 0) { __retres = x_0; goto return_label; } tmp = rec(x_0 - 1); __retres = tmp; return_label: return __retres; } int f1(int a); int g1(int a); int volatile nondet; int f1(int a) { int __retres; if (nondet) g1(1); else if (nondet) f1(2); /*@ assert missing_return: \false; */ ; __retres = 0; return __retres; } int g1(int a) { if (nondet) g1(4); return a; } int main(void) { int tmp_1; int local_init = i(); int t = rec(local_init); f1(2); tmp_1 = h(); return tmp_1; } int with_static(void); static int with_static_count = 0; int with_static(void) { with_static_count ++; return with_static_count; } int call_with_static(void) { int tmp; tmp = with_static(); return tmp; } void builtin_acsl(void) { float g_0 = 0.f; /*@ assert ¬\is_NaN(g_0); */ ; return; } void call_builtin_acsl(void) { builtin_acsl(); return; } void f_slevel(void) { /*@ slevel 0; */ ; return; } void call_f_slevel(void) { f_slevel(); return; } void pre_decl(void); void middle_decl(void) { pre_decl(); return; } void post_decl(void); extern int x; int y = 23; void pre_decl(void) { x ++; y ++; post_decl(); return; } frama-c-20.0-Calcium/tests/syntax/oracle/inline_def_1.res.oracle0000666000000000000000000000171013571573400021442 0ustar [kernel] Parsing tests/syntax/inline_def_1.i (no preprocessing) [kernel] Parsing tests/syntax/inline_def_2.i (no preprocessing) /* Generated by Frama-C */ __inline static int f__fc_inline(int x) { return x; } __inline int f(int x); __inline static int f1__fc_inline(void) { int __retres; __retres = 1; return __retres; } extern int f2(void) { int __retres; __retres = 3; return __retres; } int g(int x) { int __retres; int tmp; int tmp_0; int tmp_1; tmp = f__fc_inline(x); tmp_0 = f1__fc_inline(); tmp_1 = f2(); __retres = (tmp + tmp_0) + tmp_1; return __retres; } __inline int f(int x) { int __retres; __retres = x + 1; return __retres; } __inline static int f1__fc_inline_0(void) { int __retres; __retres = 2; return __retres; } int h(int x) { int __retres; int tmp; int tmp_0; int tmp_1; tmp = f(x); tmp_0 = f1__fc_inline_0(); tmp_1 = f2(); __retres = (tmp + tmp_0) + tmp_1; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/inline_def_bad_1.res.oracle0000666000000000000000000000102313571573400022245 0ustar [kernel] Parsing tests/syntax/inline_def_bad_1.i (no preprocessing) [kernel] Parsing tests/syntax/inline_def_bad_2.i (no preprocessing) [kernel] tests/syntax/inline_def_bad_2.i:6: Warning: dropping duplicate def'n of func f at tests/syntax/inline_def_bad_2.i:6 in favor of that at tests/syntax/inline_def_bad_1.i:5 /* Generated by Frama-C */ extern int f(void) { int __retres; __retres = 1; return __retres; } int g(void) { int tmp; tmp = f(); return tmp; } int h(void) { int tmp; tmp = f(); return tmp; } frama-c-20.0-Calcium/tests/syntax/oracle/inserted_casts.0.res.oracle0000666000000000000000000000143313571573400022300 0ustar [kernel] Parsing tests/syntax/inserted_casts.c (with preprocessing) [test] Inserting cast for expression a + 3 of type int to type unsigned int [test] Inserting cast for expression a of type int to type unsigned int [test] Inserting cast for expression (unsigned int)a * r of type unsigned int to type int [test] Inserting cast for expression a of type int to type unsigned int [test] Inserting cast for expression (unsigned int)a - r of type unsigned int to type int /* Generated by Frama-C */ #include "stddef.h" int f(int b) { int r; if (b * b != 0) r = 0; else r = -1; return r; } int g(int a) { int __retres; unsigned int r; ptrdiff_t x = & r - & r; r = (unsigned int)(a + 3); a = (int)((unsigned int)a * r); __retres = (int)((unsigned int)a - r); return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/inserted_casts.1.res.oracle0000666000000000000000000000143313571573400022301 0ustar [kernel] Parsing tests/syntax/inserted_casts.c (with preprocessing) [test] Inserting cast for expression a + 3 of type int to type unsigned int [test] Inserting cast for expression a of type int to type unsigned int [test] Inserting cast for expression (unsigned int)a * r of type unsigned int to type int [test] Inserting cast for expression a of type int to type unsigned int [test] Inserting cast for expression (unsigned int)a - r of type unsigned int to type int /* Generated by Frama-C */ #include "stddef.h" int f(int b) { int r; if (b * b != 0) r = 0; else r = -1; return r; } int g(int a) { int __retres; unsigned int r; ptrdiff_t x = & r - & r; r = (unsigned int)(a + 3); a = (int)((unsigned int)a * r); __retres = (int)((unsigned int)a - r); return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/invalid_constant.res.oracle0000666000000000000000000000047713571573400022476 0ustar [kernel] Parsing tests/syntax/invalid_constant.i (no preprocessing) [kernel] tests/syntax/invalid_constant.i:2: Failure: Invalid digit 8 in integer constant '0123456789' in base 8. [kernel] User Error: stopping on file "tests/syntax/invalid_constant.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/keep.res.oracle0000666000000000000000000000040713571573400020054 0ustar [kernel] Parsing tests/syntax/keep.i (no preprocessing) /* Generated by Frama-C */ typedef int __attribute__((__FC_BUILTIN__)) foo; enum bar { bla = 0, bli = 1 } __attribute__((__FC_BUILTIN__)); struct __attribute__((__FC_BUILTIN__)) baz { int x ; }; frama-c-20.0-Calcium/tests/syntax/oracle/keep_logical_operators.res.oracle0000666000000000000000000000041613571573400023644 0ustar [kernel] Parsing tests/syntax/keep_logical_operators.i (no preprocessing) /* Generated by Frama-C */ int test(int a, int b, int c) { int __retres; if (a && (b || c)) { __retres = 1; goto return_label; } __retres = 2; return_label: return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/label_decl.res.oracle0000666000000000000000000000145313571573400021200 0ustar [kernel] Parsing tests/syntax/label_decl.i (no preprocessing) /* Generated by Frama-C */ struct s { int i ; }; void s_cp(struct s *p, struct s v) { *p = v; return; } void main(void) { struct s y; int i = 0; label:; int tmp = i; if (i < 0) goto _LOR; else if (i >= 256) { _LOR:; struct s __constr_expr_0 = {.i = 1}; s_cp(& y,__constr_expr_0); } return; } [kernel] Parsing tests/syntax/result/label_decl.i (no preprocessing) /* Generated by Frama-C */ struct s { int i ; }; void s_cp(struct s *p, struct s v) { *p = v; return; } void main(void) { struct s y; int i = 0; label: ; int tmp = i; if (i < 0) goto _LOR; else if (i >= 256) { _LOR: ; struct s __constr_expr_0 = {.i = 1}; s_cp(& y,__constr_expr_0); } return; } frama-c-20.0-Calcium/tests/syntax/oracle/libc_defs.res.oracle0000666000000000000000000000020113571573400021032 0ustar [kernel] Parsing tests/syntax/libc_defs.c (with preprocessing) /* Generated by Frama-C */ #include "errno.c" #include "errno.h" frama-c-20.0-Calcium/tests/syntax/oracle/line_number.res.oracle0000666000000000000000000000041513571573400021426 0ustar [kernel] Parsing tests/syntax/line_number.c (with preprocessing) [kernel] tests/syntax/line_number.c:1: syntax error: 1 //@ assert \result == 0; ^^^^^^^^^^^^^^^^^^^^^^^^ 2 extern int p(void void); [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/literal-question-no-trigraph.0.res.oracle0000666000000000000000000000067413571573400025025 0ustar [kernel] Parsing tests/syntax/literal-question-no-trigraph.c (with preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; char *s1 = (char *)"?\?"; char *s2 = (char *)"?\?="; char *s3 = (char *)"?\?\?"; char *s4 = (char *)"?\?\?\?"; char *s5 = (char *)"?\?\?="; char *s6 = (char *)"?\?\?="; char *s7 = (char *)"?\?\?\?\?\?=?\?=\\?\?=?"; char *s8 = (char *)"?\?\\?\?="; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/literal-question-no-trigraph.1.res.oracle0000666000000000000000000000065713571573400025027 0ustar [kernel] Parsing tests/syntax/literal-question-no-trigraph.c (with preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; char *s1 = (char *)"?\?"; char *s2 = (char *)"#"; char *s3 = (char *)"?\?\?"; char *s4 = (char *)"?\?\?\?"; char *s5 = (char *)"?\?\?="; char *s6 = (char *)"?\?\?="; char *s7 = (char *)"?\?\?\?#?\?=\\#?"; char *s8 = (char *)"?\?\\#"; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/local-variable.res.oracle0000666000000000000000000000065713571573400022014 0ustar [kernel] Parsing tests/syntax/local-variable.i (no preprocessing) /* Generated by Frama-C */ int main(void) { int __retres; { int a; } __retres = 0; return __retres; } void f(void) { return; } void h(int i) { int tmp_0; int t[(unsigned int)100 / sizeof(tmp_0)]; int u[(unsigned int)100 / sizeof(i)]; int x = 1; return; } int c; int g(void) { int __retres; __retres = 1; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/local_uninitialized_bts_1081.res.oracle0000666000000000000000000000054613571573400024477 0ustar [kernel] Parsing tests/syntax/local_uninitialized_bts_1081.i (no preprocessing) /* Generated by Frama-C */ int X; int Y; int FOO; int main(void) { int __retres; int foo; int x; int y; if (foo) { int tmp = x; } else { int tmp_3 = y; } if (! foo) { int tmp_5 = y; } int tmp_7 = foo; ; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/logic_env.res.oracle0000666000000000000000000000011713571573400021073 0ustar [kernel] Parsing tests/syntax/logic_env.i (no preprocessing) Check OK Check OK frama-c-20.0-Calcium/tests/syntax/oracle/loop-case-switch-for-unroll.0.res.oracle0000666000000000000000000001736313571573400024555 0ustar [kernel] Parsing tests/syntax/loop-case-switch-for-unroll.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization gen_nondet_vals[0] ∈ {1} [1] ∈ {42} [2] ∈ {5} [3] ∈ {1} [4] ∈ {43} [5] ∈ {11} [6] ∈ {0} [7] ∈ {1} [8] ∈ {0} [9] ∈ {44} [10] ∈ {12} [11..12] ∈ {0} [13..14] ∈ {1} [15] ∈ {45} [16] ∈ {11} [17..20] ∈ {0} [21] ∈ {46} [22] ∈ {13} [23..26] ∈ {0} [27] ∈ {47} [28] ∈ {12} [29..31] ∈ {0} [32] ∈ {48} [33] ∈ {15} [34..36] ∈ {0} gen_nondet_i ∈ {-1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {42} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {5} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {43} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {11} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {44} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {12} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:66: Frama_C_show_each_n_: {3} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {45} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {11} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {46} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {13} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {47} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {12} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:84: Frama_C_show_each_y_: {32} [eva] tests/syntax/loop-case-switch-for-unroll.c:85: Frama_C_show_each_x_: {32} [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function gen_nondet: gen_nondet_i ∈ [0..31] __retres ∈ [0..47] [eva:final-states] Values at end of function main: y ∈ {32} x ∈ {32} n ∈ {0} gen_nondet_i ∈ {31} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 2 functions analyzed (out of 2): 100% coverage. In these functions, 45 statements reached (out of 48): 93% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- /* Generated by Frama-C */ int gen_nondet(int line); static int gen_nondet_vals[37] = {1, 42, 5, 1, 43, 11, 0, 1, 0, 44, 12, 0, 0, 1, 1, 45, 11, 0, 0, 0, 0, 46, 13, 0, 0, 0, 0, 47, 12, 0, 0, 0, 48, 15, 0, 0, 0}; static int gen_nondet_i = -1; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_nondet_)(); int gen_nondet(int line) { int __retres; gen_nondet_i = (int)((unsigned int)(gen_nondet_i + 1) % (sizeof(gen_nondet_vals) / sizeof(int))); Frama_C_show_each_nondet_(gen_nondet_vals[gen_nondet_i]); __retres = gen_nondet_vals[gen_nondet_i]; return __retres; } /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_n_)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_i_)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_y_)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_x_)(); void main(void) { int x; int y = 32; int n = 3; L0: switch (1) { int tmp; int tmp_0; L3: case 0: Frama_C_show_each_n_(n); tmp = gen_nondet(67); if (tmp) goto L; tmp_0 = gen_nondet(68); if (tmp_0) goto L1; while (1) { { int tmp_1; case 1: tmp_1 = gen_nondet(71); if (tmp_1) goto L1; L: x = y; case 2: { int j; int i = 0; while (i < 4) { { int tmp_2; int tmp_3; int tmp_4; int tmp_5; L1: j = gen_nondet(76); tmp_2 = gen_nondet(77); if (tmp_2 > 10) i = 10; else i = 0; Frama_C_show_each_i_(i); tmp_3 = gen_nondet(79); if (tmp_3) goto L; tmp_4 = gen_nondet(80); if (tmp_4) goto L0; tmp_5 = gen_nondet(81); if (tmp_5) goto L3; } i ++; } } } n --; if (! (n > 0)) break; } Frama_C_show_each_y_(y); Frama_C_show_each_x_(x); } return; } frama-c-20.0-Calcium/tests/syntax/oracle/loop-case-switch-for-unroll.1.res.oracle0000666000000000000000000002513413571573400024551 0ustar [kernel] Parsing tests/syntax/loop-case-switch-for-unroll.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization gen_nondet_vals[0] ∈ {1} [1] ∈ {42} [2] ∈ {5} [3] ∈ {1} [4] ∈ {43} [5] ∈ {11} [6] ∈ {0} [7] ∈ {1} [8] ∈ {0} [9] ∈ {44} [10] ∈ {12} [11..12] ∈ {0} [13..14] ∈ {1} [15] ∈ {45} [16] ∈ {11} [17..20] ∈ {0} [21] ∈ {46} [22] ∈ {13} [23..26] ∈ {0} [27] ∈ {47} [28] ∈ {12} [29..31] ∈ {0} [32] ∈ {48} [33] ∈ {15} [34..36] ∈ {0} gen_nondet_i ∈ {-1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {42} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {5} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {43} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {11} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {44} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {12} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:66: Frama_C_show_each_n_: {3} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {45} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {11} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {46} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {13} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {47} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {12} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:84: Frama_C_show_each_y_: {32} [eva] tests/syntax/loop-case-switch-for-unroll.c:85: Frama_C_show_each_x_: {32} [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function gen_nondet: gen_nondet_i ∈ [0..31] __retres ∈ [0..47] [eva:final-states] Values at end of function main: y ∈ {32} x ∈ {32} n ∈ {0} gen_nondet_i ∈ {31} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 2 functions analyzed (out of 2): 100% coverage. In these functions, 75 statements reached (out of 125): 60% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- /* Generated by Frama-C */ int gen_nondet(int line); static int gen_nondet_vals[37] = {1, 42, 5, 1, 43, 11, 0, 1, 0, 44, 12, 0, 0, 1, 1, 45, 11, 0, 0, 0, 0, 46, 13, 0, 0, 0, 0, 47, 12, 0, 0, 0, 48, 15, 0, 0, 0}; static int gen_nondet_i = -1; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_nondet_)(); int gen_nondet(int line) { int __retres; gen_nondet_i = (int)((unsigned int)(gen_nondet_i + 1) % (sizeof(gen_nondet_vals) / sizeof(int))); Frama_C_show_each_nondet_(gen_nondet_vals[gen_nondet_i]); __retres = gen_nondet_vals[gen_nondet_i]; return __retres; } /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_n_)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_i_)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_y_)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_x_)(); void main(void) { int x; int y = 32; int n = 3; L0: switch (1) { int tmp; int tmp_0; L3: case 0: Frama_C_show_each_n_(n); tmp = gen_nondet(67); if (tmp) goto L; tmp_0 = gen_nondet(68); if (tmp_0) goto L1; { int tmp_1_unroll_41; case 1: tmp_1_unroll_41 = gen_nondet(71); if (tmp_1_unroll_41) goto L1_unrolling_11_loop; L_unrolling_8_loop: x = y; case 2: { int j_unroll_40; int i_unroll_40 = 0; if (! (i_unroll_40 < 4)) goto unrolling_2_loop_unrolling_12_loop; { int tmp_2_unroll_12_unroll_26; int tmp_3_unroll_12_unroll_26; int tmp_4_unroll_12_unroll_26; int tmp_5_unroll_12_unroll_26; L1_unrolling_4_loop_unrolling_9_loop: j_unroll_40 = gen_nondet(76); tmp_2_unroll_12_unroll_26 = gen_nondet(77); if (tmp_2_unroll_12_unroll_26 > 10) i_unroll_40 = 10; else i_unroll_40 = 0; Frama_C_show_each_i_(i_unroll_40); tmp_3_unroll_12_unroll_26 = gen_nondet(79); if (tmp_3_unroll_12_unroll_26) goto L_unrolling_8_loop; tmp_4_unroll_12_unroll_26 = gen_nondet(80); if (tmp_4_unroll_12_unroll_26) goto L0; tmp_5_unroll_12_unroll_26 = gen_nondet(81); if (tmp_5_unroll_12_unroll_26) goto L3; } i_unroll_40 ++; unrolling_3_loop_unrolling_10_loop: ; /*@ loop pragma UNROLL "done", 1; */ while (i_unroll_40 < 4) { { int tmp_2_unroll_37; int tmp_3_unroll_37; int tmp_4_unroll_37; int tmp_5_unroll_37; L1_unrolling_11_loop: j_unroll_40 = gen_nondet(76); tmp_2_unroll_37 = gen_nondet(77); if (tmp_2_unroll_37 > 10) i_unroll_40 = 10; else i_unroll_40 = 0; Frama_C_show_each_i_(i_unroll_40); tmp_3_unroll_37 = gen_nondet(79); if (tmp_3_unroll_37) goto L_unrolling_8_loop; tmp_4_unroll_37 = gen_nondet(80); if (tmp_4_unroll_37) goto L0; tmp_5_unroll_37 = gen_nondet(81); if (tmp_5_unroll_37) goto L3; } i_unroll_40 ++; } unrolling_2_loop_unrolling_12_loop: ; } } n --; if (! (n > 0)) goto unrolling_6_loop; unrolling_7_loop: ; /*@ loop pragma UNROLL "done", 1; */ while (1) { { int tmp_1; tmp_1 = gen_nondet(71); if (tmp_1) goto L1; L: x = y; { int j; int i = 0; if (! (i < 4)) goto unrolling_2_loop; { int tmp_2_unroll_12; int tmp_3_unroll_12; int tmp_4_unroll_12; int tmp_5_unroll_12; L1_unrolling_4_loop: j = gen_nondet(76); tmp_2_unroll_12 = gen_nondet(77); if (tmp_2_unroll_12 > 10) i = 10; else i = 0; Frama_C_show_each_i_(i); tmp_3_unroll_12 = gen_nondet(79); if (tmp_3_unroll_12) goto L; tmp_4_unroll_12 = gen_nondet(80); if (tmp_4_unroll_12) goto L0; tmp_5_unroll_12 = gen_nondet(81); if (tmp_5_unroll_12) goto L3; } i ++; unrolling_3_loop: ; /*@ loop pragma UNROLL "done", 1; */ while (i < 4) { { int tmp_2; int tmp_3; int tmp_4; int tmp_5; L1: j = gen_nondet(76); tmp_2 = gen_nondet(77); if (tmp_2 > 10) i = 10; else i = 0; Frama_C_show_each_i_(i); tmp_3 = gen_nondet(79); if (tmp_3) goto L; tmp_4 = gen_nondet(80); if (tmp_4) goto L0; tmp_5 = gen_nondet(81); if (tmp_5) goto L3; } i ++; } unrolling_2_loop: ; } } n --; if (! (n > 0)) break; } unrolling_6_loop: ; Frama_C_show_each_y_(y); Frama_C_show_each_x_(x); } return; } frama-c-20.0-Calcium/tests/syntax/oracle/loop-case-switch-for-unroll.2.res.oracle0000666000000000000000000003633613571573400024560 0ustar [kernel] Parsing tests/syntax/loop-case-switch-for-unroll.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization gen_nondet_vals[0] ∈ {1} [1] ∈ {42} [2] ∈ {5} [3] ∈ {1} [4] ∈ {43} [5] ∈ {11} [6] ∈ {0} [7] ∈ {1} [8] ∈ {0} [9] ∈ {44} [10] ∈ {12} [11..12] ∈ {0} [13..14] ∈ {1} [15] ∈ {45} [16] ∈ {11} [17..20] ∈ {0} [21] ∈ {46} [22] ∈ {13} [23..26] ∈ {0} [27] ∈ {47} [28] ∈ {12} [29..31] ∈ {0} [32] ∈ {48} [33] ∈ {15} [34..36] ∈ {0} gen_nondet_i ∈ {-1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {42} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {5} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {43} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {11} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {44} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {12} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:66: Frama_C_show_each_n_: {3} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {1} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {45} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {11} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {46} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {13} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {47} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {12} [eva] tests/syntax/loop-case-switch-for-unroll.c:78: Frama_C_show_each_i_: {10} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:53: Frama_C_show_each_nondet_: {0} [eva] tests/syntax/loop-case-switch-for-unroll.c:84: Frama_C_show_each_y_: {32} [eva] tests/syntax/loop-case-switch-for-unroll.c:85: Frama_C_show_each_x_: {32} [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function gen_nondet: gen_nondet_i ∈ [0..31] __retres ∈ [0..47] [eva:final-states] Values at end of function main: y ∈ {32} x ∈ {32} n ∈ {0} gen_nondet_i ∈ {31} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 2 functions analyzed (out of 2): 100% coverage. In these functions, 74 statements reached (out of 238): 31% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- /* Generated by Frama-C */ int gen_nondet(int line); static int gen_nondet_vals[37] = {1, 42, 5, 1, 43, 11, 0, 1, 0, 44, 12, 0, 0, 1, 1, 45, 11, 0, 0, 0, 0, 46, 13, 0, 0, 0, 0, 47, 12, 0, 0, 0, 48, 15, 0, 0, 0}; static int gen_nondet_i = -1; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_nondet_)(); int gen_nondet(int line) { int __retres; gen_nondet_i = (int)((unsigned int)(gen_nondet_i + 1) % (sizeof(gen_nondet_vals) / sizeof(int))); Frama_C_show_each_nondet_(gen_nondet_vals[gen_nondet_i]); __retres = gen_nondet_vals[gen_nondet_i]; return __retres; } /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_n_)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_i_)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_y_)(); /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each_x_)(); void main(void) { int x; int y = 32; int n = 3; L0: switch (1) { int tmp; int tmp_0; L3: case 0: Frama_C_show_each_n_(n); tmp = gen_nondet(67); if (tmp) goto L; tmp_0 = gen_nondet(68); if (tmp_0) goto L1; { int tmp_1_unroll_106; case 1: tmp_1_unroll_106 = gen_nondet(71); if (tmp_1_unroll_106) goto L1_unrolling_23_loop; L_unrolling_18_loop: x = y; case 2: { int j_unroll_105; int i_unroll_105 = 0; if (! (i_unroll_105 < 4)) goto unrolling_2_loop_unrolling_24_loop; { int tmp_2_unroll_24_unroll_80; int tmp_3_unroll_24_unroll_80; int tmp_4_unroll_24_unroll_80; int tmp_5_unroll_24_unroll_80; L1_unrolling_6_loop_unrolling_19_loop: j_unroll_105 = gen_nondet(76); tmp_2_unroll_24_unroll_80 = gen_nondet(77); if (tmp_2_unroll_24_unroll_80 > 10) i_unroll_105 = 10; else i_unroll_105 = 0; Frama_C_show_each_i_(i_unroll_105); tmp_3_unroll_24_unroll_80 = gen_nondet(79); if (tmp_3_unroll_24_unroll_80) goto L_unrolling_18_loop; tmp_4_unroll_24_unroll_80 = gen_nondet(80); if (tmp_4_unroll_24_unroll_80) goto L0; tmp_5_unroll_24_unroll_80 = gen_nondet(81); if (tmp_5_unroll_24_unroll_80) goto L3; } i_unroll_105 ++; unrolling_5_loop_unrolling_20_loop: ; if (! (i_unroll_105 < 4)) goto unrolling_2_loop_unrolling_24_loop; { int tmp_2_unroll_12_unroll_91; int tmp_3_unroll_12_unroll_91; int tmp_4_unroll_12_unroll_91; int tmp_5_unroll_12_unroll_91; L1_unrolling_4_loop_unrolling_21_loop: j_unroll_105 = gen_nondet(76); tmp_2_unroll_12_unroll_91 = gen_nondet(77); if (tmp_2_unroll_12_unroll_91 > 10) i_unroll_105 = 10; else i_unroll_105 = 0; Frama_C_show_each_i_(i_unroll_105); tmp_3_unroll_12_unroll_91 = gen_nondet(79); if (tmp_3_unroll_12_unroll_91) goto L_unrolling_18_loop; tmp_4_unroll_12_unroll_91 = gen_nondet(80); if (tmp_4_unroll_12_unroll_91) goto L0; tmp_5_unroll_12_unroll_91 = gen_nondet(81); if (tmp_5_unroll_12_unroll_91) goto L3; } i_unroll_105 ++; unrolling_3_loop_unrolling_22_loop: ; /*@ loop pragma UNROLL "done", 2; */ while (i_unroll_105 < 4) { { int tmp_2_unroll_102; int tmp_3_unroll_102; int tmp_4_unroll_102; int tmp_5_unroll_102; L1_unrolling_23_loop: j_unroll_105 = gen_nondet(76); tmp_2_unroll_102 = gen_nondet(77); if (tmp_2_unroll_102 > 10) i_unroll_105 = 10; else i_unroll_105 = 0; Frama_C_show_each_i_(i_unroll_105); tmp_3_unroll_102 = gen_nondet(79); if (tmp_3_unroll_102) goto L_unrolling_18_loop; tmp_4_unroll_102 = gen_nondet(80); if (tmp_4_unroll_102) goto L0; tmp_5_unroll_102 = gen_nondet(81); if (tmp_5_unroll_102) goto L3; } i_unroll_105 ++; } unrolling_2_loop_unrolling_24_loop: ; } } n --; if (! (n > 0)) goto unrolling_8_loop; unrolling_17_loop: ; { int tmp_1_unroll_64; tmp_1_unroll_64 = gen_nondet(71); if (tmp_1_unroll_64) goto L1_unrolling_15_loop; L_unrolling_10_loop: x = y; { int j_unroll_63; int i_unroll_63 = 0; if (! (i_unroll_63 < 4)) goto unrolling_2_loop_unrolling_16_loop; { int tmp_2_unroll_24_unroll_38; int tmp_3_unroll_24_unroll_38; int tmp_4_unroll_24_unroll_38; int tmp_5_unroll_24_unroll_38; L1_unrolling_6_loop_unrolling_11_loop: j_unroll_63 = gen_nondet(76); tmp_2_unroll_24_unroll_38 = gen_nondet(77); if (tmp_2_unroll_24_unroll_38 > 10) i_unroll_63 = 10; else i_unroll_63 = 0; Frama_C_show_each_i_(i_unroll_63); tmp_3_unroll_24_unroll_38 = gen_nondet(79); if (tmp_3_unroll_24_unroll_38) goto L_unrolling_10_loop; tmp_4_unroll_24_unroll_38 = gen_nondet(80); if (tmp_4_unroll_24_unroll_38) goto L0; tmp_5_unroll_24_unroll_38 = gen_nondet(81); if (tmp_5_unroll_24_unroll_38) goto L3; } i_unroll_63 ++; unrolling_5_loop_unrolling_12_loop: ; if (! (i_unroll_63 < 4)) goto unrolling_2_loop_unrolling_16_loop; { int tmp_2_unroll_12_unroll_49; int tmp_3_unroll_12_unroll_49; int tmp_4_unroll_12_unroll_49; int tmp_5_unroll_12_unroll_49; L1_unrolling_4_loop_unrolling_13_loop: j_unroll_63 = gen_nondet(76); tmp_2_unroll_12_unroll_49 = gen_nondet(77); if (tmp_2_unroll_12_unroll_49 > 10) i_unroll_63 = 10; else i_unroll_63 = 0; Frama_C_show_each_i_(i_unroll_63); tmp_3_unroll_12_unroll_49 = gen_nondet(79); if (tmp_3_unroll_12_unroll_49) goto L_unrolling_10_loop; tmp_4_unroll_12_unroll_49 = gen_nondet(80); if (tmp_4_unroll_12_unroll_49) goto L0; tmp_5_unroll_12_unroll_49 = gen_nondet(81); if (tmp_5_unroll_12_unroll_49) goto L3; } i_unroll_63 ++; unrolling_3_loop_unrolling_14_loop: ; /*@ loop pragma UNROLL "done", 2; */ while (i_unroll_63 < 4) { { int tmp_2_unroll_60; int tmp_3_unroll_60; int tmp_4_unroll_60; int tmp_5_unroll_60; L1_unrolling_15_loop: j_unroll_63 = gen_nondet(76); tmp_2_unroll_60 = gen_nondet(77); if (tmp_2_unroll_60 > 10) i_unroll_63 = 10; else i_unroll_63 = 0; Frama_C_show_each_i_(i_unroll_63); tmp_3_unroll_60 = gen_nondet(79); if (tmp_3_unroll_60) goto L_unrolling_10_loop; tmp_4_unroll_60 = gen_nondet(80); if (tmp_4_unroll_60) goto L0; tmp_5_unroll_60 = gen_nondet(81); if (tmp_5_unroll_60) goto L3; } i_unroll_63 ++; } unrolling_2_loop_unrolling_16_loop: ; } } n --; if (! (n > 0)) goto unrolling_8_loop; unrolling_9_loop: ; /*@ loop pragma UNROLL "done", 2; */ while (1) { { int tmp_1; tmp_1 = gen_nondet(71); if (tmp_1) goto L1; L: x = y; { int j; int i = 0; if (! (i < 4)) goto unrolling_2_loop; { int tmp_2_unroll_24; int tmp_3_unroll_24; int tmp_4_unroll_24; int tmp_5_unroll_24; L1_unrolling_6_loop: j = gen_nondet(76); tmp_2_unroll_24 = gen_nondet(77); if (tmp_2_unroll_24 > 10) i = 10; else i = 0; Frama_C_show_each_i_(i); tmp_3_unroll_24 = gen_nondet(79); if (tmp_3_unroll_24) goto L; tmp_4_unroll_24 = gen_nondet(80); if (tmp_4_unroll_24) goto L0; tmp_5_unroll_24 = gen_nondet(81); if (tmp_5_unroll_24) goto L3; } i ++; unrolling_5_loop: ; if (! (i < 4)) goto unrolling_2_loop; { int tmp_2_unroll_12; int tmp_3_unroll_12; int tmp_4_unroll_12; int tmp_5_unroll_12; L1_unrolling_4_loop: j = gen_nondet(76); tmp_2_unroll_12 = gen_nondet(77); if (tmp_2_unroll_12 > 10) i = 10; else i = 0; Frama_C_show_each_i_(i); tmp_3_unroll_12 = gen_nondet(79); if (tmp_3_unroll_12) goto L; tmp_4_unroll_12 = gen_nondet(80); if (tmp_4_unroll_12) goto L0; tmp_5_unroll_12 = gen_nondet(81); if (tmp_5_unroll_12) goto L3; } i ++; unrolling_3_loop: ; /*@ loop pragma UNROLL "done", 2; */ while (i < 4) { { int tmp_2; int tmp_3; int tmp_4; int tmp_5; L1: j = gen_nondet(76); tmp_2 = gen_nondet(77); if (tmp_2 > 10) i = 10; else i = 0; Frama_C_show_each_i_(i); tmp_3 = gen_nondet(79); if (tmp_3) goto L; tmp_4 = gen_nondet(80); if (tmp_4) goto L0; tmp_5 = gen_nondet(81); if (tmp_5) goto L3; } i ++; } unrolling_2_loop: ; } } n --; if (! (n > 0)) break; } unrolling_8_loop: ; Frama_C_show_each_y_(y); Frama_C_show_each_x_(x); } return; } frama-c-20.0-Calcium/tests/syntax/oracle/loop_annot.0.res.oracle0000666000000000000000000000040313571573400021432 0ustar [kernel] Parsing tests/syntax/loop_annot.i (no preprocessing) /* Generated by Frama-C */ void f(void) { int i = 0; /*@ loop invariant 0 ≤ i ≤ 10; */ while (i < 10) { i ++; /*@ assert 0 ≤ i ≤ 10; */ ; } while_0_break: ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/loop_annot.1.res.oracle0000666000000000000000000000040313571573400021433 0ustar [kernel] Parsing tests/syntax/loop_annot.i (no preprocessing) /* Generated by Frama-C */ void f(void) { int i = 0; /*@ loop invariant 0 ≤ i ≤ 10; */ while (i < 10) { i ++; /*@ assert 0 ≤ i ≤ 10; */ ; } while_0_break: ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/lvalvoid.res.oracle0000666000000000000000000000041013571573400020742 0ustar [kernel] Parsing tests/syntax/lvalvoid.i (no preprocessing) [kernel] tests/syntax/lvalvoid.i:4: Failure: lvalue of type void: *(src + i) [kernel] User Error: stopping on file "tests/syntax/lvalvoid.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/macro_escape_chars.res.oracle0000666000000000000000000000107613571573400022734 0ustar [kernel] Parsing tests/syntax/macro_escape_chars.c (with preprocessing) /* Generated by Frama-C */ struct file; typedef struct file FILE; extern FILE *fopen(char const *, char const *); extern int fclose(FILE *); extern int putc(int, FILE *); extern int fputs(char const *, FILE *); /*@ predicate foo(char *s) = \true; */ /*@ lemma test1: foo("\\"); */ /*@ lemma test2: '\\' ≡ '\\'; */ int main(int argc, char **argv) { int __retres; FILE *f = fopen("/tmp/testfile.out","w"); putc('\\',f); fputs("\\",f); fclose(f); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/merge_attrs_align.0.res.oracle0000666000000000000000000000143413571573400022755 0ustar [kernel] Parsing tests/syntax/merge_attrs_align.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align1.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align2.c (with preprocessing) [kernel] User Error: Incompatible declaration for s1: Definitions of type s are not isomorphic. Reason follows: Definitions of struct __anonstruct_s_1 are not isomorphic. Reason follows: incompatible attributes in composite types and/or field b struct __anonstruct_s_1 { char a ; short b ; } __attribute__((__packed__)); struct __anonstruct_s_1 { char a ; short b ; }; First declaration was at tests/syntax/merge_attrs_align1.c:10 Current declaration is at tests/syntax/merge_attrs_align2.c:10 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/merge_attrs_align.1.res.oracle0000666000000000000000000000150213571573400022752 0ustar [kernel] Parsing tests/syntax/merge_attrs_align.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align1.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align3.c (with preprocessing) [kernel] User Error: Incompatible declaration for s1: Definitions of type s are not isomorphic. Reason follows: Definitions of struct __anonstruct_s_1 are not isomorphic. Reason follows: incompatible attributes for field b struct __anonstruct_s_1 { char a ; short b ; } __attribute__((__packed__)); struct __anonstruct_s_1 { char a ; short b __attribute__((__aligned__(2))); } __attribute__((__packed__)); First declaration was at tests/syntax/merge_attrs_align1.c:10 Current declaration is at tests/syntax/merge_attrs_align3.c:10 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/merge_attrs_align.2.res.oracle0000666000000000000000000000105213571573400022753 0ustar [kernel] Parsing tests/syntax/merge_attrs_align.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align1.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align4.c (with preprocessing) /* Generated by Frama-C */ struct __anonstruct_s_1 { char a ; short b ; } __attribute__((__packed__, __aligned__(1))); typedef struct __anonstruct_s_1 s; s s1; int f1(void) { int __retres; char c = s1.a; __retres = 0; return __retres; } int f4(void) { int __retres; char c = s1.a; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/merge_attrs_align.3.res.oracle0000666000000000000000000000103213571573400022752 0ustar [kernel] Parsing tests/syntax/merge_attrs_align.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align2.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align3.c (with preprocessing) /* Generated by Frama-C */ struct __anonstruct_s_1 { char a ; short b ; } __attribute__((__packed__)); typedef struct __anonstruct_s_1 s; s s1; int f2(void) { int __retres; char c = s1.a; __retres = 0; return __retres; } int f3(void) { int __retres; char c = s1.a; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/merge_attrs_align.4.res.oracle0000666000000000000000000000155413571573400022764 0ustar [kernel] Parsing tests/syntax/merge_attrs_align.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align2.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align4.c (with preprocessing) [kernel] User Error: Incompatible declaration for s1: Definitions of type s are not isomorphic. Reason follows: Definitions of struct __anonstruct_s_1 are not isomorphic. Reason follows: incompatible attributes in composite types and/or field b struct __anonstruct_s_1 { char a ; short b ; }; struct __anonstruct_s_1 { char a __attribute__((__aligned__(1))); short b __attribute__((__aligned__(1))); } __attribute__((__packed__, __aligned__(1))); First declaration was at tests/syntax/merge_attrs_align2.c:10 Current declaration is at tests/syntax/merge_attrs_align4.c:12 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/merge_attrs_align.5.res.oracle0000666000000000000000000000165013571573400022762 0ustar [kernel] Parsing tests/syntax/merge_attrs_align.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align3.c (with preprocessing) [kernel] Parsing tests/syntax/merge_attrs_align4.c (with preprocessing) [kernel] User Error: Incompatible declaration for s1: Definitions of type s are not isomorphic. Reason follows: Definitions of struct __anonstruct_s_1 are not isomorphic. Reason follows: incompatible attributes in composite types and/or field b struct __anonstruct_s_1 { char a ; short b __attribute__((__aligned__(2))); } __attribute__((__packed__)); struct __anonstruct_s_1 { char a __attribute__((__aligned__(1))); short b __attribute__((__aligned__(1))); } __attribute__((__packed__, __aligned__(1))); First declaration was at tests/syntax/merge_attrs_align3.c:10 Current declaration is at tests/syntax/merge_attrs_align4.c:12 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/merge_bts0948.res.oracle0000666000000000000000000000053513571573400021426 0ustar [kernel] Parsing tests/syntax/merge_bts0948.i (no preprocessing) [kernel] Parsing tests/syntax/merge_bts0948_1.i (no preprocessing) [kernel] Parsing tests/syntax/merge_bts0948_2.i (no preprocessing) /* Generated by Frama-C */ void *memcpy(void *region1); /*@ requires \valid((char *)region1); */ void *memcpy(void *region1) { return region1; } frama-c-20.0-Calcium/tests/syntax/oracle/merge_inline_1.res.oracle0000666000000000000000000000105413571573400022004 0ustar [kernel] Parsing tests/syntax/merge_inline_1.c (with preprocessing) [kernel] Parsing tests/syntax/merge_inline_2.c (with preprocessing) /* Generated by Frama-C */ int foo(int x); int foo(int x) { return x; } int getfoo2(void); int main(void) { int __retres; int tmp; tmp = getfoo2(); if (tmp != (int)(& foo)) { __retres = 1; goto return_label; } __retres = 0; return_label: return __retres; } int bar(int x); int getfoo2(void) { int __retres; __retres = (int)(& bar); return __retres; } int bar(int x) { return x; } frama-c-20.0-Calcium/tests/syntax/oracle/merge_loc.res.oracle0000666000000000000000000000042713571573400021066 0ustar [kernel] Parsing tests/syntax/merge_loc.i (no preprocessing) /* Generated by Frama-C */ //#line 11 "tests/syntax/merge_loc.i" int foo; //#line 14 "tests/syntax/merge_loc.i" int bar; //#line 19 extern int baz; //#line 23 "tests/syntax/merge_loc.i" int z = (int)(& baz); frama-c-20.0-Calcium/tests/syntax/oracle/merge_union.0.res.oracle0000666000000000000000000000267513571573400021606 0ustar [kernel] Parsing tests/syntax/merge_union.c (with preprocessing) [kernel] Parsing tests/syntax/merge_union_2.c (with preprocessing) [kernel] Parsing tests/syntax/merge_union_3.c (with preprocessing) [kernel:linker:drop-conflicting-unused] Warning: Incompatible declaration for G1: Definitions of type st are not isomorphic. Reason follows: Definitions of struct __anonstruct_st_2 are not isomorphic. Reason follows: incompatible attributes in composite types and/or field u struct __anonstruct_st_2 { char c ; un u ; }; struct __anonstruct_st_2 { char c __attribute__((__aligned__(1))); un u __attribute__((__aligned__(1))); } __attribute__((__packed__, __aligned__(1))); First declaration was at tests/syntax/merge_union.h:11 Current declaration is at tests/syntax/merge_union.h:11 Old declaration is unused, silently removing it /* Generated by Frama-C */ union __anonunion_un_1 { char t ; short s ; } __attribute__((__packed__, __aligned__(1))); typedef union __anonunion_un_1 un; struct __anonstruct_st_3 { char c __attribute__((__aligned__(1))); un u __attribute__((__aligned__(1))); } __attribute__((__packed__, __aligned__(1))); typedef struct __anonstruct_st_3 st_2; int f(un *u); #pragma noalign extern st_2 G1; int g(un *u) { int __retres; f(& G1.u); __retres = 0; return __retres; } #pragma noalign int main(un *u) { int __retres; g(& G1.u); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/merge_union.1.res.oracle0000666000000000000000000000142513571573400021577 0ustar [kernel] Parsing tests/syntax/merge_union.c (with preprocessing) [kernel] Parsing tests/syntax/merge_union_2.c (with preprocessing) [kernel] Parsing tests/syntax/merge_union_3.c (with preprocessing) /* Generated by Frama-C */ union __anonunion_un_1 { char t ; short s ; } __attribute__((__packed__, __aligned__(1))); typedef union __anonunion_un_1 un; struct __anonstruct_st_3 { char c __attribute__((__aligned__(1))); un u __attribute__((__aligned__(1))); } __attribute__((__packed__, __aligned__(1))); typedef struct __anonstruct_st_3 st_2; int f(un *u); #pragma noalign extern st_2 G1; int g(un *u) { int __retres; f(& G1.u); __retres = 0; return __retres; } #pragma noalign int main(un *u) { int __retres; g(& G1.u); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/merge_unused.res.oracle0000666000000000000000000000234213571573400021612 0ustar [kernel] Parsing tests/syntax/merge_unused.c (with preprocessing) [kernel] Parsing tests/syntax/merge_unused_2.c (with preprocessing) [kernel:linker:drop-conflicting-unused] Warning: Incompatible declaration for G1: Definitions of struct s are not isomorphic. Reason follows: incompatible attributes in composite types and/or field i struct s { char c __attribute__((__aligned__(1))); int i __attribute__((__aligned__(1))); } __attribute__((__packed__, __aligned__(1))); struct s { char c ; int i ; }; First declaration was at tests/syntax/merge_unused.c:11 Current declaration is at tests/syntax/merge_unused.h:7 Current declaration is unused, silently removing it [kernel] User Error: Incompatible declaration for G3: Definitions of struct s are not isomorphic. Reason follows: incompatible attributes in composite types and/or field i struct s { char c __attribute__((__aligned__(1))); int i __attribute__((__aligned__(1))); } __attribute__((__packed__, __aligned__(1))); struct s { char c ; int i ; }; First declaration was at tests/syntax/merge_unused.h:9 Current declaration is at tests/syntax/merge_unused.h:9 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/merge_variadic.res.oracle0000666000000000000000000000205013571573400022065 0ustar [kernel] Parsing tests/syntax/merge_variadic.i (no preprocessing) [kernel] Parsing tests/syntax/merge_variadic_aux.i (no preprocessing) [kernel:linker:drop-conflicting-unused] Warning: Incompatible declaration for open: different vararg specifiers First declaration was at tests/syntax/merge_variadic.i:4 Current declaration is at tests/syntax/merge_variadic_aux.i:5 Current declaration is unused, silently removing it [kernel:linker:drop-conflicting-unused] Warning: Incompatible declaration for foo: different vararg specifiers First declaration was at tests/syntax/merge_variadic.i:8 Current declaration is at tests/syntax/merge_variadic_aux.i:8 Old declaration is unused, silently removing it /* Generated by Frama-C */ int open(char const *file, int flags, int mode) { int __retres; __retres = -1; return __retres; } extern int foo(int x, void * const *__va_params); int bar(void) { int tmp; { int __va_arg0 = 4; void *__va_args[1] = {& __va_arg0}; tmp = foo(3,(void * const *)(__va_args)); } return tmp; } frama-c-20.0-Calcium/tests/syntax/oracle/multiline_macro.res.oracle0000666000000000000000000000037613571573400022320 0ustar [kernel] Parsing tests/syntax/multiline_macro.c (with preprocessing) /* Generated by Frama-C */ /*@ ensures \result ≡ ((((1 + 2) + 3) + 5) + 6) + 7; */ int main(void) { int __retres; __retres = ((((1 + 2) + 3) + 5) + 6) + 7; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/multiple_decls_contracts.0.res.oracle0000666000000000000000000000103113571573400024345 0ustar [kernel] Parsing share/libc/string.h (with preprocessing) [kernel] Parsing tests/syntax/multiple_decls_contracts.c (with preprocessing) [kernel] Parsing tests/syntax/multiple_decls_contracts.c (with preprocessing) [kernel] tests/syntax/multiple_decls_contracts.c:10: Warning: dropping duplicate def'n of func strdup at tests/syntax/multiple_decls_contracts.c:10 in favor of that at tests/syntax/multiple_decls_contracts.c:10 /* Generated by Frama-C */ #include "stddef.h" #include "stdlib.h" #include "string.h" #include "strings.h" frama-c-20.0-Calcium/tests/syntax/oracle/multiple_decls_contracts.1.res.oracle0000666000000000000000000000103113571573400024346 0ustar [kernel] Parsing tests/syntax/multiple_decls_contracts.c (with preprocessing) [kernel] Parsing share/libc/string.h (with preprocessing) [kernel] Parsing tests/syntax/multiple_decls_contracts.c (with preprocessing) [kernel] tests/syntax/multiple_decls_contracts.c:10: Warning: dropping duplicate def'n of func strdup at tests/syntax/multiple_decls_contracts.c:10 in favor of that at tests/syntax/multiple_decls_contracts.c:10 /* Generated by Frama-C */ #include "stddef.h" #include "stdlib.h" #include "string.h" #include "strings.h" frama-c-20.0-Calcium/tests/syntax/oracle/multiple_decls_contracts.2.res.oracle0000666000000000000000000000103113571573400024347 0ustar [kernel] Parsing tests/syntax/multiple_decls_contracts.c (with preprocessing) [kernel] Parsing tests/syntax/multiple_decls_contracts.c (with preprocessing) [kernel] Parsing share/libc/string.h (with preprocessing) [kernel] tests/syntax/multiple_decls_contracts.c:10: Warning: dropping duplicate def'n of func strdup at tests/syntax/multiple_decls_contracts.c:10 in favor of that at tests/syntax/multiple_decls_contracts.c:10 /* Generated by Frama-C */ #include "stddef.h" #include "stdlib.h" #include "string.h" #include "strings.h" frama-c-20.0-Calcium/tests/syntax/oracle/mutable_test.res.oracle0000666000000000000000000000063713571573400021625 0ustar [kernel] Parsing tests/syntax/mutable_test.i (no preprocessing) Type of variable: struct W_1 Offset: .w.v.u.t.s.r /* Generated by Frama-C */ struct R_1 { int r ; }; struct S_1 { struct R_1 s ; }; struct T_1 { struct S_1 t ; }; struct U_1 { struct T_1 u ; }; struct V_1 { struct U_1 const v ; }; struct W_1 { struct V_1 w ; }; struct W_1 x; int y; void f(void) { x.w.v.u.t.s.r = y; return; } frama-c-20.0-Calcium/tests/syntax/oracle/mutually_recursive_struct.res.oracle0000666000000000000000000000137113571573400024500 0ustar [kernel] Parsing tests/syntax/mutually_recursive_struct.i (no preprocessing) [kernel] tests/syntax/mutually_recursive_struct.i:4: User Error: declaration of array of incomplete type 'struct S2` [kernel] tests/syntax/mutually_recursive_struct.i:4: User Error: field `s2' is declared with incomplete type struct S2 [2] [kernel] tests/syntax/mutually_recursive_struct.i:6: User Error: declaration of array of incomplete type 'struct S1` [kernel] tests/syntax/mutually_recursive_struct.i:6: User Error: field `s1' is declared with incomplete type struct S1 [2] [kernel] User Error: type struct S2 is circular [kernel] User Error: stopping on file "tests/syntax/mutually_recursive_struct.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/no-print-libc-reparse.res.oracle0000666000000000000000000000024513571573400023244 0ustar [kernel] Parsing tests/syntax/no-print-libc-reparse.c (with preprocessing) [kernel] Parsing tests/syntax/result/ocode_0_no-print-libc-reparse.c (with preprocessing) frama-c-20.0-Calcium/tests/syntax/oracle/no_prototype.res.oracle0000666000000000000000000000104713571573400021672 0ustar [kernel] Parsing tests/syntax/no_prototype.i (no preprocessing) [kernel:typing:no-proto] tests/syntax/no_prototype.i:4: Warning: Calling function foo that is declared without prototype. Its formals will be inferred from actual arguments [kernel] tests/syntax/no_prototype.i:6: User Error: Declaration of foo does not match previous declaration from tests/syntax/no_prototype.i:1 (different number of arguments). [kernel] User Error: stopping on file "tests/syntax/no_prototype.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/noret.res.oracle0000666000000000000000000000054213571573400020257 0ustar [kernel] Parsing tests/syntax/noret.i (no preprocessing) [kernel] tests/syntax/noret.i:5: Warning: Body of function foo falls-through. Adding a return statement /* Generated by Frama-C */ struct s { int i ; }; struct s foo(void) { struct s __retres; /*@ assert missing_return: \false; */ ; __retres = *((struct s *)0); return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/offset.res.oracle0000666000000000000000000000024413571573400020415 0ustar [kernel] Parsing tests/syntax/offset.c (with preprocessing) /* Generated by Frama-C */ #include "__fc_define_off_t.h" off_t x = (long)0; off64_t y = (long long)0; frama-c-20.0-Calcium/tests/syntax/oracle/offsetof.res.oracle0000666000000000000000000000034113571573400020740 0ustar [kernel] Parsing tests/syntax/offsetof.c (with preprocessing) /* Generated by Frama-C */ #include "stddef.h" struct c { char ca ; }; void main(void) { size_t S; S = (unsigned int)(& ((struct c *)0)->ca); return; } frama-c-20.0-Calcium/tests/syntax/oracle/one_ret_assert.res.oracle0000666000000000000000000000115513571573400022145 0ustar [kernel] Parsing tests/syntax/one_ret_assert.i (no preprocessing) [kernel] tests/syntax/one_ret_assert.i:8: Warning: Body of function g falls-through. Adding a return statement /* Generated by Frama-C */ int X; void f(void) { X ++; return; } int g(void) { int __retres; X ++; /*@ assert missing_return: \false; */ ; __retres = 0; return __retres; } int h(void) { int __retres; if (X) { __retres = 3; goto return_label; } else { __retres = 4; goto return_label; } return_label: return __retres; } int main(void) { int tmp; X = h(); f(); tmp = g(); return tmp; } frama-c-20.0-Calcium/tests/syntax/oracle/orig_name.res.oracle0000666000000000000000000000061213571573400021066 0ustar [kernel] Parsing tests/syntax/orig_name.i (no preprocessing) [kernel] tests/syntax/orig_name.i:7: Variable x has been renamed to x_0 [kernel] tests/syntax/orig_name.i:10: Variable x has been renamed to x_1 /* Generated by Frama-C */ int x = 1; int f(int x_0) { int y = 0; if (x_0 == 0) { int tmp; int x_1 = 3; tmp = x_1; x_1 ++; y = tmp; } y += x_0; return y; } frama-c-20.0-Calcium/tests/syntax/oracle/osx_attribute.res.oracle0000666000000000000000000000042213571573400022021 0ustar [kernel] Parsing tests/syntax/osx_attribute.i (no preprocessing) /* Generated by Frama-C */ void f(void) __attribute__((__availability__(macos,introduced=10.4,deprecated=10.6,obsoleted=10.7))); int main(void) { int __retres; f(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/preprocessed.res.oracle0000666000000000000000000000025713571573400021631 0ustar [kernel] Parsing tests/syntax/preprocessed.ci (external front-end) /* Generated by Frama-C */ /*@ ensures \result ≡ 42; */ int foo(void) { int FOO = 42; return FOO; } frama-c-20.0-Calcium/tests/syntax/oracle/ptr_null_cmp_bts1027.res.oracle0000666000000000000000000000101113571573400023000 0ustar [kernel] Parsing tests/syntax/ptr_null_cmp_bts1027.i (no preprocessing) /* Generated by Frama-C */ /*@ behavior normal: assumes r ≢ \null ∧ ¬(x ≢ 0.); ensures \result ≡ 0; behavior f: assumes ¬(r ≢ \null) ∨ x ≢ 0.; ensures \result ≡ -1; */ int max(int *r, double x) { int __retres; if (! r) { __retres = -1; goto return_label; } else if (x) { __retres = -1; goto return_label; } __retres = 0; return_label: return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/reject_use_decl_mismatch_bts728.0.res.oracle0000666000000000000000000000177313571573400025412 0ustar [kernel] Parsing tests/syntax/reject_use_decl_mismatch_bts728.c (with preprocessing) [kernel:typing:no-proto] tests/syntax/reject_use_decl_mismatch_bts728.c:15: Warning: Calling function f that is declared without prototype. Its formals will be inferred from actual arguments [kernel] tests/syntax/reject_use_decl_mismatch_bts728.c:19: User Error: Declaration of f does not match previous declaration from tests/syntax/reject_use_decl_mismatch_bts728.c:7 (different number of arguments). [kernel] tests/syntax/reject_use_decl_mismatch_bts728.c:19: User Error: Inconsistent formals 17 } 18 19 int f(int x,int y, int z, int t,int t1,int t2,int t3,int t4,int t5,int t6) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 20 x = 17; 21 y=18; [kernel] User Error: stopping on file "tests/syntax/reject_use_decl_mismatch_bts728.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/reject_use_decl_mismatch_bts728.1.res.oracle0000666000000000000000000000173013571573400025404 0ustar [kernel] Parsing tests/syntax/reject_use_decl_mismatch_bts728.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/syntax/reject_use_decl_mismatch_bts728.c:15: Warning: Calling undeclared function f. Old style K&R code? [kernel] tests/syntax/reject_use_decl_mismatch_bts728.c:19: User Error: Declaration of f does not match previous declaration from tests/syntax/reject_use_decl_mismatch_bts728.c:15 (different number of arguments). [kernel] tests/syntax/reject_use_decl_mismatch_bts728.c:19: User Error: Inconsistent formals 17 } 18 19 int f(int x,int y, int z, int t,int t1,int t2,int t3,int t4,int t5,int t6) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 20 x = 17; 21 y=18; [kernel] User Error: stopping on file "tests/syntax/reject_use_decl_mismatch_bts728.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/rename.res.oracle0000666000000000000000000000251613571573400020402 0ustar [kernel] Parsing tests/syntax/rename.i (no preprocessing) [kernel] tests/syntax/rename.i:69: Warning: unnamed fields are a C11 extension (use -c11 to avoid this warning) /* Generated by Frama-C */ struct not_anon { int __anonCompField1 ; }; struct __anonstruct_1 { int inner_i ; }; struct anon { struct __anonstruct_1 __anonCompField1 ; }; int f(void) { int x = 0; { int x_0 = 1; { int x_1 = 2; return x_1; } } } int g(void) { int x_0 = 0; { int x_0_0 = 1; return x_0_0; } } void f1(void); static int f1_i_0 = 0; static int f1_i_67 = 1; static int f1_i_68 = 2; void f1(void) { f1_i_67 += f1_i_68 + f1_i_0; return; } void f2(void); static int f2_i_0 = 0; static int f2_i_67 = 3; static int f2_i_68 = 4; void f2(void) { f2_i_67 += f2_i_68 + f2_i_0; return; } void f3(void); static int f3_j_0 = 2; void f3(void) { f3_j_0 ++; return; } void f4(int *j_0_1) { int j_0 = *j_0_1; { int j_0_1_0 = j_0; j_0_1_0 += j_0; } return; } void f5(void) { int y_0_1; int y_0_0; return; } int y_0; void f6(void) { int y_2_0; int y_2; return; } int y_1; void f7(void) { { int __constr_expr_1 = 0; } int __constr_expr_2 = 0; return; } int __constr_expr_0 = 0; struct not_anon s = {.__anonCompField1 = 0}; struct anon a = {.__anonCompField1 = {.inner_i = 0}}; frama-c-20.0-Calcium/tests/syntax/oracle/reorder.res.oracle0000666000000000000000000000130713571573400020572 0ustar [kernel] Parsing tests/syntax/reorder.i (no preprocessing) /* Generated by Frama-C */ /*@ logic ℤ l= 1; */ int x; /*@ ensures i ≡ i; */ void f(void) { x ++; return; } /*@ axiomatic Ax { predicate Q(ℤ v) ; } */ /*@ requires Q: \let v = Q(255); ¬(¬v ∨ v); */ void g(void); /*@ logic ℤ i= j + k; */ /*@ logic ℤ j= l; */ /*@ logic ℤ k= l; */ /* Generated by Frama-C */ /*@ logic ℤ l= 1; */ int x; /*@ logic ℤ k= l; */ /*@ logic ℤ j= l; */ /*@ logic ℤ i= j + k; */ /*@ ensures i ≡ i; */ void f(void) { x ++; return; } /*@ axiomatic Ax { predicate Q(ℤ v) ; } */ /*@ requires Q: \let v = Q(255); ¬(¬v ∨ v); */ void g(void); frama-c-20.0-Calcium/tests/syntax/oracle/rettype.res.oracle0000666000000000000000000000076313571573400020631 0ustar [kernel] Parsing tests/syntax/rettype.i (no preprocessing) [kernel] tests/syntax/rettype.i:8: User Error: Declaration of foo does not match previous declaration from tests/syntax/rettype.i:5 (different integer types: 'int' and 'unsigned short'). [kernel] tests/syntax/rettype.i:7: Warning: found two contracts (old location: tests/syntax/rettype.i:4). Merging them [kernel] User Error: stopping on file "tests/syntax/rettype.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/rmtmps_static.res.oracle0000666000000000000000000000025713571573400022024 0ustar [kernel] Parsing tests/syntax/rmtmps_static.i (no preprocessing) /* Generated by Frama-C */ int f(void); int f(void) { int __retres; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/simp_switch.res.oracle0000666000000000000000000000032513571573400021460 0ustar [kernel] Parsing tests/syntax/simp_switch.i (no preprocessing) /* Generated by Frama-C */ void main(void) { if (! (! 0)) goto switch_0_break; switch_0_0: goto switch_0_break; switch_0_break: ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/sizeof_bts1414.res.oracle0000666000000000000000000000137213571573400021613 0ustar [kernel] Parsing tests/syntax/sizeof_bts1414.i (no preprocessing) [kernel] tests/syntax/sizeof_bts1414.i:5: Dropping side-effect in sizeof. [kernel] tests/syntax/sizeof_bts1414.i:7: Dropping side-effect in sizeof. [kernel] tests/syntax/sizeof_bts1414.i:20: Dropping side-effect in sizeof. /* Generated by Frama-C */ int g(int *a) { int __retres; int x; int tmp; x = (int)sizeof(tmp); switch (x) { int tmp_0; case (int)sizeof(tmp_0): __retres = 1; goto return_label; default: __retres = 0; goto return_label; } __retres = x; return_label: return __retres; } int h1(int x) { return x; } int h2(int x) { return x; } int h3(int x) { return x; } void main(void) { int tmp_2; int s = (int)sizeof(tmp_2); return; } frama-c-20.0-Calcium/tests/syntax/oracle/sizeof_incomplete_type.res.oracle0000666000000000000000000000055313571573400023711 0ustar [kernel] Parsing tests/syntax/sizeof_incomplete_type.c (with preprocessing) [kernel] tests/syntax/sizeof_incomplete_type.c:21: User Error: sizeof on incomplete type [kernel] User Error: stopping on file "tests/syntax/sizeof_incomplete_type.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/slash_end.res.oracle0000666000000000000000000000037113571573400021070 0ustar [kernel] Parsing tests/syntax/slash_end.i (no preprocessing) /* Generated by Frama-C */ int f(int x, int y) { int __retres; __retres = x / y; return __retres; } int g(int x, int y) { int __retres; __retres = x / y; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/spurious_brace_bts_1273.res.oracle0000666000000000000000000000050513571573400023500 0ustar [kernel] Parsing tests/syntax/spurious_brace_bts_1273.i (no preprocessing) [kernel] tests/syntax/spurious_brace_bts_1273.i:1: syntax error: Location: between lines 1 and 3, before or at token: } 1 void foo() { 2 } 3 } 4 5 void main () { [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/static_formals_1.res.oracle0000666000000000000000000000113413571573400022360 0ustar [kernel] Parsing tests/syntax/static_formals_1.c (with preprocessing) [kernel] Parsing tests/syntax/static_formals_2.c (with preprocessing) /* Generated by Frama-C */ /*@ requires /* vid:23, lvid:23 */x < 10; */ static int /* vid:54 */f(int /* vid:23, lvid:23 */x); int /* vid:28 */g(void) { int /* vid:29 */tmp; /* vid:29 */tmp = /* vid:54 */f(4); return /* vid:29 */tmp; } /*@ requires /* vid:49, lvid:49 */x < 10; */ static int /* vid:55 */f_0(int /* vid:49, lvid:49 */x); int /* vid:52 */h(void) { int /* vid:53 */tmp; /* vid:53 */tmp = /* vid:55 */f_0(6); return /* vid:53 */tmp; } frama-c-20.0-Calcium/tests/syntax/oracle/struct_copy.res.oracle0000666000000000000000000000066713571573400021516 0ustar [kernel] Parsing tests/syntax/struct_copy.i (no preprocessing) /* Generated by Frama-C */ struct inner { int a ; int b ; char c ; void *p ; }; struct outer { struct inner *pinner ; struct inner inner ; int a ; struct inner ainner[5] ; int b ; char c ; long long l ; }; int main(void) { int __retres; struct inner inner; struct outer outer; outer.inner.a = 0; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/struct_with_function_field_invalid.res.oracle0000666000000000000000000000053713571573400026271 0ustar [kernel] Parsing tests/syntax/struct_with_function_field_invalid.i (no preprocessing) [kernel] tests/syntax/struct_with_function_field_invalid.i:2: User Error: field `f' declared as a function [kernel] User Error: stopping on file "tests/syntax/struct_with_function_field_invalid.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/switch-default.res.oracle0000666000000000000000000000110213571573400022044 0ustar [kernel] Parsing tests/syntax/switch-default.i (no preprocessing) /* Generated by Frama-C */ extern int ( /* missing proto */ Frama_C_show_each_i)(); int main(void) { int __retres; int x = 42; { int i = 0; while (i < 4) { switch (x) { default: { Frama_C_show_each_i(i); break; } } i ++; } } __retres = 0; return __retres; } void f(void) { int i; switch (0) { case 0: { i = 1; break; } default: i = 9; } return; } frama-c-20.0-Calcium/tests/syntax/oracle/syntactic_hook.res.oracle0000666000000000000000000000541013571573400022150 0ustar [kernel] Parsing tests/syntax/syntactic_hook.i (no preprocessing) [kernel] tests/syntax/syntactic_hook.i:5: New global node introducing identifier f(20) [kernel] First occurrence of f [kernel] tests/syntax/syntactic_hook.i:7: New global node introducing identifier k(23) [kernel] First occurrence of k [kernel] tests/syntax/syntactic_hook.i:9: New global node introducing identifier k(23) [kernel] New occurrence of existing identifier k [kernel] tests/syntax/syntactic_hook.i:11: New global node introducing identifier main(29) [kernel] First occurrence of main [kernel] tests/syntax/syntactic_hook.i:13: New global node introducing identifier t(33) [kernel] First occurrence of t [kernel] tests/syntax/syntactic_hook.i:13: Warning: [SH]: definition of local function t [kernel] :0: New global node introducing identifier g(35) [kernel] First occurrence of g [kernel:typing:implicit-function-declaration] tests/syntax/syntactic_hook.i:17: Warning: Calling undeclared function g. Old style K&R code? [kernel] tests/syntax/syntactic_hook.i:17: Warning: [SH]: implicit declaration for prototype g [kernel] tests/syntax/syntactic_hook.i:18: Dropping side-effect in sizeof. [kernel] tests/syntax/syntactic_hook.i:18: Warning: [SH]: dropping side effect in sizeof: (x++) is converted to tmp [kernel] tests/syntax/syntactic_hook.i:20: Warning: [SH]: side effect of expression x++ occurs in conditional part of expression x && x++. It is not always executed. [kernel] tests/syntax/syntactic_hook.i:21: Warning: [SH]: side effect of expression x++ occurs in conditional part of expression x && (x++ || x). It is not always executed. [kernel] tests/syntax/syntactic_hook.i:22: Warning: [SH]: side effect of expression x++ occurs in conditional part of expression x || x++. It is not always executed. [kernel] tests/syntax/syntactic_hook.i:23: Warning: [SH]: side effect of expression x++ occurs in conditional part of expression x ? x++ : x++. It is not always executed. [kernel] tests/syntax/syntactic_hook.i:23: Warning: [SH]: side effect of expression x++ occurs in conditional part of expression x ? x++ : x++. It is not always executed. [kernel] tests/syntax/syntactic_hook.i:27: User Error: Declaration of f does not match previous declaration from tests/syntax/syntactic_hook.i:5 (different number of arguments). [kernel] tests/syntax/syntactic_hook.i:27: Warning: [SH]: conflict with declaration of f at line 5: different number of arguments [kernel] tests/syntax/syntactic_hook.i:27: User Error: Inconsistent formals 25 } 26 27 int f(int); //error: conflicting decls ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [kernel] User Error: stopping on file "tests/syntax/syntactic_hook.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/temporary_location.res.oracle0000666000000000000000000000271113571573400023042 0ustar [kernel] Parsing tests/syntax/temporary_location.c (with preprocessing) [kernel] __retres -> tests/syntax/temporary_location.c:7 [kernel] __retres -> tests/syntax/temporary_location.c:7 [kernel] __retres -> tests/syntax/temporary_location.c:7 [kernel] __retres -> tests/syntax/temporary_location.c:17 [kernel] tmp_0 -> tests/syntax/temporary_location.c:11 [kernel] f -> tests/syntax/temporary_location.c:6 [kernel] tmp_0 -> tests/syntax/temporary_location.c:11 [kernel] __retres -> tests/syntax/temporary_location.c:17 [kernel] x -> tests/syntax/temporary_location.c:15 [kernel] tmp -> tests/syntax/temporary_location.c:16 [kernel] x -> tests/syntax/temporary_location.c:15 [kernel] x -> tests/syntax/temporary_location.c:15 [kernel] x -> tests/syntax/temporary_location.c:15 [kernel] x -> tests/syntax/temporary_location.c:15 [kernel] y -> tests/syntax/temporary_location.c:16 [kernel] tmp -> tests/syntax/temporary_location.c:16 [kernel] __retres -> tests/syntax/temporary_location.c:17 [kernel] y -> tests/syntax/temporary_location.c:16 [kernel] __retres -> tests/syntax/temporary_location.c:17 /* Generated by Frama-C */ int f(void) { int __retres; __retres = 1; return __retres; } int main(void) { int __retres; int tmp_0; tmp_0 = f(); if (tmp_0) { __retres = 0; goto return_label; } else { int tmp; int x = 0; tmp = x; x ++; int y = tmp + 1; __retres = y + 3; goto return_label; } return_label: return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/ternary_brace.res.oracle0000666000000000000000000000052113571573400021745 0ustar [kernel] Parsing tests/syntax/ternary_brace.i (no preprocessing) /* Generated by Frama-C */ int main(void) { int i = 1; if (i < 2) { i ++; i = i; } else { int tmp; tmp = i; i ++; i = tmp; } if (i < 2) { i ++; i = i; } else { int tmp_0 = i; i ++; i = tmp_0; } return i; } frama-c-20.0-Calcium/tests/syntax/oracle/ternary_bts1503.res.oracle0000666000000000000000000000024313571573400021773 0ustar [kernel] Parsing tests/syntax/ternary_bts1503.i (no preprocessing) /* Generated by Frama-C */ void f(void) { char x; x = (char)6; x = (char)6; return; } frama-c-20.0-Calcium/tests/syntax/oracle/transient_block.res.oracle0000666000000000000000000000105513571573400022311 0ustar [kernel] Parsing tests/syntax/transient_block.i (no preprocessing) [kernel] Failure: Attempting to mark as transient a block that declares local variables [kernel] transient_block fatal error on int x = 1; as expected [kernel:transient-block] Warning: ignoring request to mark transient a block with local variables: { int y; int y = 0; x = 2; } /* Generated by Frama-C */ void f(void) { return; } int main(void) { int __retres; int x = 1; { int y; int y = 0; x = 2; } f(); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/type_branch_bts_1081.res.oracle0000666000000000000000000000050413571573400022745 0ustar [kernel] Parsing tests/syntax/type_branch_bts_1081.i (no preprocessing) [kernel] tests/syntax/type_branch_bts_1081.i:5: Failure: invalid implicit conversion from void to signed char [kernel] User Error: stopping on file "tests/syntax/type_branch_bts_1081.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/type_compat_call.res.oracle0000666000000000000000000000205713571573400022452 0ustar [kernel] Parsing tests/syntax/type_compat_call.c (with preprocessing) [kernel:typing:incompatible-types-call] tests/syntax/type_compat_call.c:14: Warning: expected 'int32_t *' but got argument of type 'int const *': & i [kernel:typing:incompatible-types-call] tests/syntax/type_compat_call.c:18: Warning: expected 'uint8_t const *' but got argument of type 'char const *': & c [kernel:typing:incompatible-types-call] tests/syntax/type_compat_call.c:20: Warning: expected 'int8_t const *' but got argument of type 'char const *': & c /* Generated by Frama-C */ #include "stdint.h" void f(int32_t const *p); void g(int32_t * const p); void h(uint8_t const *p); void m(int8_t const *p); int main(void) { int __retres; int const i = 42; f((int32_t const *)(& i)); g((int32_t *)(& i)); char const c = (char)'c'; signed char const s = (signed char)'s'; unsigned char const u = (unsigned char)'u'; h((uint8_t const *)(& c)); h((uint8_t const *)(& u)); m((int8_t const *)(& c)); m((int8_t const *)(& s)); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/type_redef.0.res.oracle0000666000000000000000000000662213571573400021421 0ustar [kernel] Parsing tests/syntax/type_redef.i (no preprocessing) [kernel] tests/syntax/type_redef.i:7: User Error: redefinition of type 'myint' in the same scope is only allowed in C11 (option -c11). Previous declaration was at tests/syntax/type_redef.i:6 [kernel] tests/syntax/type_redef.i:10: User Error: redefinition of type 'list' in the same scope is only allowed in C11 (option -c11). Previous declaration was at tests/syntax/type_redef.i:9 [kernel] tests/syntax/type_redef.i:13: User Error: redefinition of type 'st' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:12 [kernel] tests/syntax/type_redef.i:18: User Error: redefinition of type 'u' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:17 [kernel] tests/syntax/type_redef.i:21: User Error: redefinition of 'A' in the same scope. Previous declaration was at tests/syntax/type_redef.i:20 [kernel] tests/syntax/type_redef.i:21: User Error: redefinition of type 'e' in the same scope with conflicting type. Previous declaration was at tests/syntax/type_redef.i:20 [kernel] tests/syntax/type_redef.i:24: User Error: redefinition of 'B' in the same scope. Previous declaration was at tests/syntax/type_redef.i:23 [kernel] tests/syntax/type_redef.i:26: User Error: redefinition of type 'st1' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:15 [kernel] tests/syntax/type_redef.i:30: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:31: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:35: User Error: redefinition of type 'vi' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:34 [kernel] tests/syntax/type_redef.i:38: User Error: redefinition of type 'ci' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:37 [kernel] tests/syntax/type_redef.i:41: User Error: redefinition of type 'ai' in the same scope is only allowed in C11 (option -c11). Previous declaration was at tests/syntax/type_redef.i:40 [kernel] tests/syntax/type_redef.i:44: User Error: redefinition of type 'ftest_t' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:43 [kernel] tests/syntax/type_redef.i:48: User Error: redefinition of type 'stt' in the same scope is only allowed in C11 (option -c11). Previous declaration was at tests/syntax/type_redef.i:47 [kernel] tests/syntax/type_redef.i:49: User Error: redefinition of type 'stt' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:47 [kernel] tests/syntax/type_redef.i:53: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:57: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:62: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:63: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] User Error: stopping on file "tests/syntax/type_redef.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/type_redef.1.res.oracle0000666000000000000000000000520313571573400021414 0ustar [kernel] Parsing tests/syntax/type_redef.i (no preprocessing) [kernel] tests/syntax/type_redef.i:13: User Error: redefinition of type 'st' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:12 [kernel] tests/syntax/type_redef.i:18: User Error: redefinition of type 'u' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:17 [kernel] tests/syntax/type_redef.i:21: User Error: redefinition of 'A' in the same scope. Previous declaration was at tests/syntax/type_redef.i:20 [kernel] tests/syntax/type_redef.i:21: User Error: redefinition of type 'e' in the same scope with conflicting type. Previous declaration was at tests/syntax/type_redef.i:20 [kernel] tests/syntax/type_redef.i:24: User Error: redefinition of 'B' in the same scope. Previous declaration was at tests/syntax/type_redef.i:23 [kernel] tests/syntax/type_redef.i:26: User Error: redefinition of type 'st1' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:15 [kernel] tests/syntax/type_redef.i:30: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:31: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:35: User Error: redefinition of type 'vi' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:34 [kernel] tests/syntax/type_redef.i:38: User Error: redefinition of type 'ci' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:37 [kernel] tests/syntax/type_redef.i:44: User Error: redefinition of type 'ftest_t' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:43 [kernel] tests/syntax/type_redef.i:49: User Error: redefinition of type 'stt' in the same scope with incompatible type. Previous declaration was at tests/syntax/type_redef.i:47 [kernel] tests/syntax/type_redef.i:53: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:57: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:62: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] tests/syntax/type_redef.i:63: Failure: redefinition of a typedef in a non-global scope is currently unsupported [kernel] User Error: stopping on file "tests/syntax/type_redef.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/typedef_multi_1.res.oracle0000666000000000000000000000054113571573400022221 0ustar [kernel] Parsing tests/syntax/typedef_multi_1.c (with preprocessing) [kernel] Parsing tests/syntax/typedef_multi_2.c (with preprocessing) /* Generated by Frama-C */ typedef int WORD; extern WORD x; extern WORD y; void f(void) { while (x < y) x ++; return; } void g(void) { /*@ loop invariant x ≤ 3 + 2; */ while (x < y) x ++; return; } frama-c-20.0-Calcium/tests/syntax/oracle/typedef_namespace_bts1500.0.res.oracle0000666000000000000000000000046213571573400024121 0ustar [kernel] Parsing tests/syntax/typedef_namespace_bts1500.c (with preprocessing) /* Generated by Frama-C */ typedef int digit; digit const D = 10; long const L = 10L; digit A; int main(void) { int __retres; digit x = 4; int digit = 3; __retres = (x + digit) + A; return __retres; } digit A = 8; frama-c-20.0-Calcium/tests/syntax/oracle/typedef_namespace_bts1500.1.res.oracle0000666000000000000000000000073113571573400024121 0ustar [kernel] Parsing tests/syntax/typedef_namespace_bts1500.c (with preprocessing) [kernel] tests/syntax/typedef_namespace_bts1500.c:20: syntax error: Location: between lines 20 and 23, before or at token: y 18 int main () { 19 digit x = 4; 20 int digit = 3; 21 // error: digit is now a variable 22 #ifdef HIDING_TYPEDEF 23 digit y = 5; 24 #endif 25 return x + digit+A; [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/typedef_namespace_bts1500.2.res.oracle0000666000000000000000000000074213571573400024124 0ustar [kernel] Parsing tests/syntax/typedef_namespace_bts1500.c (with preprocessing) [kernel] tests/syntax/typedef_namespace_bts1500.c:31: User Error: redefinition of 'digit' with different kind in the same scope. Previous declaration was at tests/syntax/typedef_namespace_bts1500.c:6 [kernel] User Error: stopping on file "tests/syntax/typedef_namespace_bts1500.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/typeof.res.oracle0000666000000000000000000000036513571573400020441 0ustar [kernel] Parsing tests/syntax/typeof.i (no preprocessing) /* Generated by Frama-C */ int f(int x) { return x; } int g(int x); int A; int T[5][6]; int U; int (*V)[6]; int V1; char const S[sizeof("FOO")]; void h(int x) { g(3); return; } frama-c-20.0-Calcium/tests/syntax/oracle/undeclared_local_bts1113.res.oracle0000666000000000000000000000266313571573400023574 0ustar [kernel] Parsing tests/syntax/undeclared_local_bts1113.c (with preprocessing) /* Generated by Frama-C */ /*@ assigns \nothing; frees p; */ __attribute__((__FC_BUILTIN__)) void __fc_vla_free(void *p); /*@ assigns \result; assigns \result \from \nothing; allocates \result; */ __attribute__((__FC_BUILTIN__)) void *__fc_vla_alloc(unsigned int size); void funk(int rounds) { unsigned int __lengthof_k; unsigned int __lengthof_kk; int i; unsigned int __lengthof_k_long_long_size; int k_positive_size[4 - 2]; /*@ assert alloca_bounds: 0 < sizeof(int) * (2 * rounds) ≤ 4294967295; */ ; __lengthof_k = (unsigned int)(2 * rounds); int *k = __fc_vla_alloc(sizeof(int) * __lengthof_k); /*@ assert alloca_bounds: 0 < sizeof(int) * (unsigned int)(2 * rounds) ≤ 4294967295; */ ; __lengthof_kk = (unsigned int)(2 * rounds); int *kk = __fc_vla_alloc(sizeof(int) * __lengthof_kk); long long j = (long long)(rounds * rounds); /*@ assert alloca_bounds: 0 < sizeof(int) * (j * 2) ≤ 4294967295; */ ; __lengthof_k_long_long_size = (unsigned int)(j * (long long)2); int *k_long_long_size = __fc_vla_alloc(sizeof(int) * __lengthof_k_long_long_size); i = 0; while (i < 2 * rounds) { *(k + i) = i; i ++; } __fc_vla_free((void *)k_long_long_size); __fc_vla_free((void *)kk); __fc_vla_free((void *)k); return; } int main(void) { int __retres; funk(17); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/undeclared_local_bts1126.res.oracle0000666000000000000000000000664513571573400023604 0ustar [kernel] Parsing tests/syntax/undeclared_local_bts1126.c (with preprocessing) [kernel:typing:implicit-function-declaration] tests/syntax/undeclared_local_bts1126.c:35: Warning: Calling undeclared function _gnutls_epoch_get. Old style K&R code? [kernel:typing:implicit-function-declaration] tests/syntax/undeclared_local_bts1126.c:37: Warning: Calling undeclared function gnutls_assert_val. Old style K&R code? [kernel:typing:implicit-function-declaration] tests/syntax/undeclared_local_bts1126.c:44: Warning: Calling undeclared function _gnutls_cipher_suite_get_cipher_algo. Old style K&R code? [kernel:typing:implicit-function-declaration] tests/syntax/undeclared_local_bts1126.c:45: Warning: Calling undeclared function _gnutls_cipher_suite_get_mac_algo. Old style K&R code? [kernel:typing:implicit-function-declaration] tests/syntax/undeclared_local_bts1126.c:47: Warning: Calling undeclared function _gnutls_cipher_is_ok. Old style K&R code? [kernel:typing:implicit-function-declaration] tests/syntax/undeclared_local_bts1126.c:48: Warning: Calling undeclared function _gnutls_mac_is_ok. Old style K&R code? /* Generated by Frama-C */ struct gnutls_session_t { int f ; }; typedef struct gnutls_session_t gnutls_session_t; struct record_parameters_st { int initialized ; void (*cipher_algorithm)(int ) ; void (*mac_algorithm)(int ) ; }; typedef struct record_parameters_st record_parameters_st; struct cipher_suite_st { int a ; }; typedef struct cipher_suite_st cipher_suite_st; extern int ( /* missing proto */ _gnutls_epoch_get)(struct gnutls_session_t x_0, int x_1, record_parameters_st **x_2); extern int ( /* missing proto */ gnutls_assert_val)(int x_0); extern int ( /* missing proto */ _gnutls_cipher_suite_get_cipher_algo) (cipher_suite_st *x_0); extern int ( /* missing proto */ _gnutls_cipher_suite_get_mac_algo)(cipher_suite_st *x_0); extern int ( /* missing proto */ _gnutls_cipher_is_ok)(void (*x_0)(int )); extern int ( /* missing proto */ _gnutls_mac_is_ok)(void (*x_0)(int )); int _gnutls_epoch_set_cipher_suite(gnutls_session_t session, int epoch_rel, cipher_suite_st *suite) { int __retres; void (*cipher_algo)(int ); void (*mac_algo)(int ); record_parameters_st *params; int ret; int tmp_1; int tmp_2; int tmp_4; ret = _gnutls_epoch_get(session,epoch_rel,& params); if (ret < 0) { int tmp; tmp = gnutls_assert_val(ret); __retres = tmp; goto return_label; } if (params->initialized) goto _LOR; else if (params->cipher_algorithm != (void (*)(int ))0) goto _LOR; else if (params->mac_algorithm != (void (*)(int ))0) { int tmp_0; _LOR: tmp_0 = gnutls_assert_val(0); __retres = tmp_0; goto return_label; } tmp_1 = _gnutls_cipher_suite_get_cipher_algo(suite); cipher_algo = (void (*)(int ))tmp_1; tmp_2 = _gnutls_cipher_suite_get_mac_algo(suite); mac_algo = (void (*)(int ))tmp_2; tmp_4 = _gnutls_cipher_is_ok(cipher_algo); if (tmp_4 != 0) goto _LOR_0; else { int tmp_5; tmp_5 = _gnutls_mac_is_ok(mac_algo); if (tmp_5 != 0) { int tmp_3; _LOR_0: tmp_3 = gnutls_assert_val(0); __retres = tmp_3; goto return_label; } } params->cipher_algorithm = cipher_algo; params->mac_algorithm = mac_algo; __retres = 0; return_label: return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/unnamed_bitfields.res.oracle0000666000000000000000000000056613571573400022612 0ustar [kernel] Parsing tests/syntax/unnamed_bitfields.i (no preprocessing) /* Generated by Frama-C */ struct foo { unsigned int bar : 16 ; unsigned int : 0 ; unsigned int bla : 11 ; unsigned int : 1 ; unsigned int bli : 4 ; unsigned int : 0 ; }; unsigned int f(struct foo s) { unsigned int __retres; __retres = (unsigned int)s.bla; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/unroll_const.res.oracle0000666000000000000000000000763313571573400021661 0ustar [kernel] Parsing tests/syntax/unroll_const.i (no preprocessing) /* Generated by Frama-C */ struct __anonstruct_u_1 { int i1 ; int i2 ; }; struct v { int k ; int l ; }; struct s { int i ; int j ; struct v v ; }; int const t[4] = {4, 2}; struct __anonstruct_u_1 const u[3] = {{.i1 = 2, .i2 = 5}, {.i1 = 3, .i2 = 7}}; struct s const s = {.i = 5, .j = 8, .v = {.k = 3, .l = 0}}; int volatile c; void main(void) { unsigned int i = (unsigned int)0; if (! c) goto unrolling_2_loop; i ++; unrolling_6_loop: ; if (! c) goto unrolling_2_loop; i ++; unrolling_5_loop: ; if (! c) goto unrolling_2_loop; i ++; unrolling_4_loop: ; if (! c) goto unrolling_2_loop; i ++; unrolling_3_loop: ; /*@ loop pragma UNROLL sizeof(t) / sizeof(t[0]); loop pragma UNROLL "done", 4; */ while (c) i ++; unrolling_2_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_20_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_19_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_18_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_17_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_16_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_15_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_14_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_13_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_12_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_11_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_10_loop: ; if (! c) goto unrolling_8_loop; i ++; unrolling_9_loop: ; /*@ loop pragma UNROLL \offset(&s.v.l); loop pragma UNROLL "done", 12; */ while (c) i ++; unrolling_8_loop: ; if (! c) goto unrolling_22_loop; i ++; unrolling_27_loop: ; if (! c) goto unrolling_22_loop; i ++; unrolling_26_loop: ; if (! c) goto unrolling_22_loop; i ++; unrolling_25_loop: ; if (! c) goto unrolling_22_loop; i ++; unrolling_24_loop: ; if (! c) goto unrolling_22_loop; i ++; unrolling_23_loop: ; /*@ loop pragma UNROLL s.i + s.v.l; loop pragma UNROLL "done", 5; */ while (c) i ++; unrolling_22_loop: ; if (! c) goto unrolling_29_loop; i ++; unrolling_33_loop: ; if (! c) goto unrolling_29_loop; i ++; unrolling_32_loop: ; if (! c) goto unrolling_29_loop; i ++; unrolling_31_loop: ; if (! c) goto unrolling_29_loop; i ++; unrolling_30_loop: ; /*@ loop pragma UNROLL \max(t[..]); loop pragma UNROLL "done", 4; */ while (c) i ++; unrolling_29_loop: ; /*@ loop pragma UNROLL \min(t[..]); */ while (c) i ++; if (! c) goto unrolling_35_loop; i ++; unrolling_41_loop: ; if (! c) goto unrolling_35_loop; i ++; unrolling_40_loop: ; if (! c) goto unrolling_35_loop; i ++; unrolling_39_loop: ; if (! c) goto unrolling_35_loop; i ++; unrolling_38_loop: ; if (! c) goto unrolling_35_loop; i ++; unrolling_37_loop: ; if (! c) goto unrolling_35_loop; i ++; unrolling_36_loop: ; /*@ loop pragma UNROLL \max({1, 1 + s.i}); loop pragma UNROLL "done", 6; */ while (c) i ++; unrolling_35_loop: ; if (! c) goto unrolling_43_loop; i ++; unrolling_45_loop: ; if (! c) goto unrolling_43_loop; i ++; unrolling_44_loop: ; /*@ loop pragma UNROLL \min(t[{1, 3}]) + \max(t[{1, 3}]); loop pragma UNROLL "done", 2; */ while (c) i ++; unrolling_43_loop: ; if (! c) goto unrolling_47_loop; i ++; unrolling_53_loop: ; if (! c) goto unrolling_47_loop; i ++; unrolling_52_loop: ; if (! c) goto unrolling_47_loop; i ++; unrolling_51_loop: ; if (! c) goto unrolling_47_loop; i ++; unrolling_50_loop: ; if (! c) goto unrolling_47_loop; i ++; unrolling_49_loop: ; if (! c) goto unrolling_47_loop; i ++; unrolling_48_loop: ; /*@ loop pragma UNROLL \min(u[.. 1].i1) * \max(u[.. 1].i1); loop pragma UNROLL "done", 6; */ while (c) i ++; unrolling_47_loop: ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/unroll_labels.0.res.oracle0000666000000000000000000002716413571573400022134 0ustar [kernel] Parsing tests/syntax/unroll_labels.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization foo ∈ [--..--] [eva] tests/syntax/unroll_labels.i:25: starting to merge loop iterations [eva] tests/syntax/unroll_labels.i:39: starting to merge loop iterations [eva] tests/syntax/unroll_labels.i:33: starting to merge loop iterations [eva] tests/syntax/unroll_labels.i:53: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: j ∈ {-1; 5} /* Generated by Frama-C */ enum __anonenum_1 { SIX = 6 }; int volatile foo; void main(void) { int j = 0; { int i = 1; if (! (i < 4)) goto unrolling_2_loop; switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; unrolling_6_loop: ; if (! (i < 4)) goto unrolling_2_loop; switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; unrolling_5_loop: ; if (! (i < 4)) goto unrolling_2_loop; switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; unrolling_4_loop: ; if (! (i < 4)) goto unrolling_2_loop; switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; unrolling_3_loop: ; /*@ loop invariant \false; loop pragma UNROLL "completely", 4; loop pragma UNROLL "done", 4; */ while (i < 4) { switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; } unrolling_2_loop: ; } { int x = 0; L: { if (! (x < 5)) goto unrolling_8_loop; { int y_unroll_32 = 0; x ++; y_unroll_32 ++; } unrolling_11_loop: ; if (! (x < 5)) goto unrolling_8_loop; { int y_unroll_28 = 0; x ++; y_unroll_28 ++; } unrolling_10_loop: ; if (! (x < 5)) goto unrolling_8_loop; { int y_unroll_24 = 0; x ++; y_unroll_24 ++; } unrolling_9_loop: ; /*@ loop pragma UNROLL 3; loop pragma UNROLL "done", 3; */ while (x < 5) { int y = 0; x ++; y ++; } unrolling_8_loop: ; } } j = 0; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_48_loop; j ++; unrolling_16_loop_unrolling_45_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_48_loop; j ++; unrolling_15_loop_unrolling_46_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_48_loop; j ++; unrolling_14_loop_unrolling_47_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_48_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_44_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_43_loop; j ++; unrolling_16_loop_unrolling_40_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_43_loop; j ++; unrolling_15_loop_unrolling_41_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_43_loop; j ++; unrolling_14_loop_unrolling_42_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_43_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_39_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_38_loop; j ++; unrolling_16_loop_unrolling_35_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_38_loop; j ++; unrolling_15_loop_unrolling_36_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_38_loop; j ++; unrolling_14_loop_unrolling_37_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_38_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_34_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_33_loop; j ++; unrolling_16_loop_unrolling_30_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_33_loop; j ++; unrolling_15_loop_unrolling_31_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_33_loop; j ++; unrolling_14_loop_unrolling_32_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_33_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_29_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_28_loop; j ++; unrolling_16_loop_unrolling_25_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_28_loop; j ++; unrolling_15_loop_unrolling_26_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_28_loop; j ++; unrolling_14_loop_unrolling_27_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_28_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_24_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_23_loop; j ++; unrolling_16_loop_unrolling_20_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_23_loop; j ++; unrolling_15_loop_unrolling_21_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_23_loop; j ++; unrolling_14_loop_unrolling_22_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_23_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_19_loop: ; /*@ loop pragma UNROLL SIX; loop pragma UNROLL "done", 6; */ while (foo) switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop; j ++; unrolling_16_loop: ; if (! (j < 5)) goto unrolling_13_loop; j ++; unrolling_15_loop: ; if (! (j < 5)) goto unrolling_13_loop; j ++; unrolling_14_loop: ; /*@ loop pragma UNROLL 3; loop pragma UNROLL "done", 3; */ while (j < 5) j ++; unrolling_13_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_18_loop: ; if (j == 0) goto zero; if (j == 1) goto un; goto return_label; zero: { if (! (j < 5)) goto unrolling_50_loop; un_unrolling_56_loop: j ++; unrolling_55_loop: ; if (! (j < 5)) goto unrolling_50_loop; un_unrolling_54_loop: j ++; unrolling_53_loop: ; if (! (j < 5)) goto unrolling_50_loop; un_unrolling_52_loop: j ++; unrolling_51_loop: ; /*@ loop pragma UNROLL 3; loop pragma UNROLL "done", 3; */ while (j < 5) un: j ++; unrolling_50_loop: ; } return_label: return; } void main2(void) { int i = 0; if (! (i < 2)) goto unrolling_58_loop; { int j_unroll_192 = 0; while (j_unroll_192 < 2) { i ++; goto foo_unrolling_62_loop; i ++; foo_unrolling_62_loop: ; j_unroll_192 ++; } } i ++; unrolling_61_loop: ; if (! (i < 2)) goto unrolling_58_loop; { int j_unroll_184 = 0; while (j_unroll_184 < 2) { i ++; goto foo_unrolling_60_loop; i ++; foo_unrolling_60_loop: ; j_unroll_184 ++; } } i ++; unrolling_59_loop: ; /*@ loop pragma UNROLL 2; loop pragma UNROLL "done", 2; */ while (i < 2) { { int j = 0; while (j < 2) { i ++; goto foo; i ++; foo: ; j ++; } } i ++; } unrolling_58_loop: ; return; } void main2_done(void) { int i = 0; /*@ loop pragma UNROLL 2; loop pragma UNROLL "done", 2; */ while (i < 2) { { int j = 0; if (! (j < 2)) goto unrolling_64_loop; i ++; goto foo_unrolling_68_loop; i ++; foo_unrolling_68_loop: ; j ++; unrolling_67_loop: ; if (! (j < 2)) goto unrolling_64_loop; i ++; goto foo_unrolling_66_loop; i ++; foo_unrolling_66_loop: ; j ++; unrolling_65_loop: ; /*@ loop pragma UNROLL 2; loop pragma UNROLL "done", 2; */ while (j < 2) { i ++; goto foo; i ++; foo: ; j ++; } unrolling_64_loop: ; } i ++; } return; } void main3(int c) { int i = 0; if (c == 0) goto foo; if (! (i < 5)) goto unrolling_70_loop; { int j_unroll_244 = 0; if (i == j_unroll_244) goto foo_unrolling_77_loop; if (i == 1) goto unrolling_70_loop; if (i == 2) goto __Cont_unrolling_80_loop; while (j_unroll_244 < 5) { if (i == j_unroll_244) break; if (i < j_unroll_244) goto foo_unrolling_77_loop; if (i == j_unroll_244 + 1) goto __Cont_0_unrolling_78_loop; if (i == j_unroll_244 + 2) goto up_unrolling_79_loop; i ++; foo_unrolling_77_loop: i ++; __Cont_0_unrolling_78_loop: j_unroll_244 ++; } up_unrolling_79_loop: ; } __Cont_unrolling_80_loop: i ++; unrolling_76_loop: ; if (! (i < 5)) goto unrolling_70_loop; { int j_unroll_222 = 0; if (i == j_unroll_222) goto foo_unrolling_72_loop; if (i == 1) goto unrolling_70_loop; if (i == 2) goto __Cont_unrolling_75_loop; while (j_unroll_222 < 5) { if (i == j_unroll_222) break; if (i < j_unroll_222) goto foo_unrolling_72_loop; if (i == j_unroll_222 + 1) goto __Cont_0_unrolling_73_loop; if (i == j_unroll_222 + 2) goto up_unrolling_74_loop; i ++; foo_unrolling_72_loop: i ++; __Cont_0_unrolling_73_loop: j_unroll_222 ++; } up_unrolling_74_loop: ; } __Cont_unrolling_75_loop: i ++; unrolling_71_loop: ; /*@ loop pragma UNROLL 2; loop pragma UNROLL "done", 2; */ while (i < 5) { { int j = 0; if (i == j) goto foo; if (i == 1) break; if (i == 2) goto __Cont; while (j < 5) { if (i == j) break; if (i < j) goto foo; if (i == j + 1) goto __Cont_0; if (i == j + 2) goto up; i ++; foo: i ++; __Cont_0: j ++; } up: ; } __Cont: i ++; } unrolling_70_loop: ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/unroll_labels.1.res.oracle0000666000000000000000000002652013571573400022130 0ustar [kernel] Parsing tests/syntax/unroll_labels.i (no preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization foo ∈ [--..--] [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: i ∈ {3} /* Generated by Frama-C */ enum __anonenum_1 { SIX = 6 }; int volatile foo; void main(void) { int j = 0; { int i = 1; if (! (i < 4)) goto unrolling_2_loop; switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; unrolling_6_loop: ; if (! (i < 4)) goto unrolling_2_loop; switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; unrolling_5_loop: ; if (! (i < 4)) goto unrolling_2_loop; switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; unrolling_4_loop: ; if (! (i < 4)) goto unrolling_2_loop; switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; unrolling_3_loop: ; /*@ loop invariant \false; loop pragma UNROLL "completely", 4; loop pragma UNROLL "done", 4; */ while (i < 4) { switch (i) { case 1: j ++; break; case 2: j += 3; break; case 3: j += 5; break; case 4: j += 7; break; default: j = 0; } i ++; } unrolling_2_loop: ; } { int x = 0; L: { if (! (x < 5)) goto unrolling_8_loop; { int y_unroll_32 = 0; x ++; y_unroll_32 ++; } unrolling_11_loop: ; if (! (x < 5)) goto unrolling_8_loop; { int y_unroll_28 = 0; x ++; y_unroll_28 ++; } unrolling_10_loop: ; if (! (x < 5)) goto unrolling_8_loop; { int y_unroll_24 = 0; x ++; y_unroll_24 ++; } unrolling_9_loop: ; /*@ loop pragma UNROLL 3; loop pragma UNROLL "done", 3; */ while (x < 5) { int y = 0; x ++; y ++; } unrolling_8_loop: ; } } j = 0; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_48_loop; j ++; unrolling_16_loop_unrolling_45_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_48_loop; j ++; unrolling_15_loop_unrolling_46_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_48_loop; j ++; unrolling_14_loop_unrolling_47_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_48_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_44_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_43_loop; j ++; unrolling_16_loop_unrolling_40_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_43_loop; j ++; unrolling_15_loop_unrolling_41_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_43_loop; j ++; unrolling_14_loop_unrolling_42_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_43_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_39_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_38_loop; j ++; unrolling_16_loop_unrolling_35_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_38_loop; j ++; unrolling_15_loop_unrolling_36_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_38_loop; j ++; unrolling_14_loop_unrolling_37_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_38_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_34_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_33_loop; j ++; unrolling_16_loop_unrolling_30_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_33_loop; j ++; unrolling_15_loop_unrolling_31_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_33_loop; j ++; unrolling_14_loop_unrolling_32_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_33_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_29_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_28_loop; j ++; unrolling_16_loop_unrolling_25_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_28_loop; j ++; unrolling_15_loop_unrolling_26_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_28_loop; j ++; unrolling_14_loop_unrolling_27_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_28_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_24_loop: ; if (! foo) goto unrolling_18_loop; switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop_unrolling_23_loop; j ++; unrolling_16_loop_unrolling_20_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_23_loop; j ++; unrolling_15_loop_unrolling_21_loop: ; if (! (j < 5)) goto unrolling_13_loop_unrolling_23_loop; j ++; unrolling_14_loop_unrolling_22_loop: ; /*@ loop pragma UNROLL "done", 3; loop pragma UNROLL 3; */ while (j < 5) j ++; unrolling_13_loop_unrolling_23_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_19_loop: ; /*@ loop pragma UNROLL SIX; loop pragma UNROLL "done", 6; */ while (foo) switch (j) { case -1: j ++; break; case 0: { if (! (j < 5)) goto unrolling_13_loop; j ++; unrolling_16_loop: ; if (! (j < 5)) goto unrolling_13_loop; j ++; unrolling_15_loop: ; if (! (j < 5)) goto unrolling_13_loop; j ++; unrolling_14_loop: ; /*@ loop pragma UNROLL 3; loop pragma UNROLL "done", 3; */ while (j < 5) j ++; unrolling_13_loop: ; } break; case 5: j = -1; break; default: ; goto return_label; } unrolling_18_loop: ; if (j == 0) goto zero; if (j == 1) goto un; goto return_label; zero: { if (! (j < 5)) goto unrolling_50_loop; un_unrolling_56_loop: j ++; unrolling_55_loop: ; if (! (j < 5)) goto unrolling_50_loop; un_unrolling_54_loop: j ++; unrolling_53_loop: ; if (! (j < 5)) goto unrolling_50_loop; un_unrolling_52_loop: j ++; unrolling_51_loop: ; /*@ loop pragma UNROLL 3; loop pragma UNROLL "done", 3; */ while (j < 5) un: j ++; unrolling_50_loop: ; } return_label: return; } void main2(void) { int i = 0; if (! (i < 2)) goto unrolling_58_loop; { int j_unroll_192 = 0; while (j_unroll_192 < 2) { i ++; goto foo_unrolling_62_loop; i ++; foo_unrolling_62_loop: ; j_unroll_192 ++; } } i ++; unrolling_61_loop: ; if (! (i < 2)) goto unrolling_58_loop; { int j_unroll_184 = 0; while (j_unroll_184 < 2) { i ++; goto foo_unrolling_60_loop; i ++; foo_unrolling_60_loop: ; j_unroll_184 ++; } } i ++; unrolling_59_loop: ; /*@ loop pragma UNROLL 2; loop pragma UNROLL "done", 2; */ while (i < 2) { { int j = 0; while (j < 2) { i ++; goto foo; i ++; foo: ; j ++; } } i ++; } unrolling_58_loop: ; return; } void main2_done(void) { int i = 0; /*@ loop pragma UNROLL 2; loop pragma UNROLL "done", 2; */ while (i < 2) { { int j = 0; if (! (j < 2)) goto unrolling_64_loop; i ++; goto foo_unrolling_68_loop; i ++; foo_unrolling_68_loop: ; j ++; unrolling_67_loop: ; if (! (j < 2)) goto unrolling_64_loop; i ++; goto foo_unrolling_66_loop; i ++; foo_unrolling_66_loop: ; j ++; unrolling_65_loop: ; /*@ loop pragma UNROLL 2; loop pragma UNROLL "done", 2; */ while (j < 2) { i ++; goto foo; i ++; foo: ; j ++; } unrolling_64_loop: ; } i ++; } return; } void main3(int c) { int i = 0; if (c == 0) goto foo; if (! (i < 5)) goto unrolling_70_loop; { int j_unroll_244 = 0; if (i == j_unroll_244) goto foo_unrolling_77_loop; if (i == 1) goto unrolling_70_loop; if (i == 2) goto __Cont_unrolling_80_loop; while (j_unroll_244 < 5) { if (i == j_unroll_244) break; if (i < j_unroll_244) goto foo_unrolling_77_loop; if (i == j_unroll_244 + 1) goto __Cont_0_unrolling_78_loop; if (i == j_unroll_244 + 2) goto up_unrolling_79_loop; i ++; foo_unrolling_77_loop: i ++; __Cont_0_unrolling_78_loop: j_unroll_244 ++; } up_unrolling_79_loop: ; } __Cont_unrolling_80_loop: i ++; unrolling_76_loop: ; if (! (i < 5)) goto unrolling_70_loop; { int j_unroll_222 = 0; if (i == j_unroll_222) goto foo_unrolling_72_loop; if (i == 1) goto unrolling_70_loop; if (i == 2) goto __Cont_unrolling_75_loop; while (j_unroll_222 < 5) { if (i == j_unroll_222) break; if (i < j_unroll_222) goto foo_unrolling_72_loop; if (i == j_unroll_222 + 1) goto __Cont_0_unrolling_73_loop; if (i == j_unroll_222 + 2) goto up_unrolling_74_loop; i ++; foo_unrolling_72_loop: i ++; __Cont_0_unrolling_73_loop: j_unroll_222 ++; } up_unrolling_74_loop: ; } __Cont_unrolling_75_loop: i ++; unrolling_71_loop: ; /*@ loop pragma UNROLL 2; loop pragma UNROLL "done", 2; */ while (i < 5) { { int j = 0; if (i == j) goto foo; if (i == 1) break; if (i == 2) goto __Cont; while (j < 5) { if (i == j) break; if (i < j) goto foo; if (i == j + 1) goto __Cont_0; if (i == j + 2) goto up; i ++; foo: i ++; __Cont_0: j ++; } up: ; } __Cont: i ++; } unrolling_70_loop: ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/unroll_property_status_bts1442.0.res.oracle0000666000000000000000000000046413571573400025336 0ustar [kernel] Parsing tests/syntax/unroll_property_status_bts1442.i (no preprocessing) [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/syntax/oracle/unroll_property_status_bts1442.1.res.oracle0000666000000000000000000000046413571573400025337 0ustar [kernel] Parsing tests/syntax/unroll_property_status_bts1442.i (no preprocessing) [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/syntax/oracle/unroll_visit.res.oracle0000666000000000000000000000252613571573400021665 0ustar [kernel] Parsing tests/syntax/unroll_visit.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/syntax/unroll_visit.i:8: assertion got status valid. [eva] tests/syntax/unroll_visit.i:6: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {100} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i [inout] Inputs for function main: \nothing /* Generated by Frama-C */ void main(void) { int i = 0; if (! (i < 100)) goto unrolling_2_loop; i --; /*@ assert i < 100; */ ; i ++; i ++; unrolling_4_loop: ; if (! (i < 100)) goto unrolling_2_loop; i --; /*@ assert i < 100; */ ; i ++; i ++; unrolling_3_loop: ; /*@ loop pragma UNROLL 2; loop pragma UNROLL "done", 2; */ while (i < 100) { i --; /*@ assert i < 100; */ ; i ++; i ++; } unrolling_2_loop: ; return; } frama-c-20.0-Calcium/tests/syntax/oracle/unspecified_access_address.res.oracle0000666000000000000000000000117413571573400024456 0ustar [kernel] Parsing tests/syntax/unspecified_access_address.i (no preprocessing) /* Generated by Frama-C */ int f(int *p, int x) { *p = x + 1; return x; } int g(void) { int tmp; int tmp_1; int tmp_3; int *tmp_2; int x = 3; x ++; tmp = f(& x,x); int y = tmp; int a[10] = {0}; int *b = a; int z = f(b + x,*(b + 2)); x ++; /*effects: () x <- */ ; /*effects: () <- b, x*/ tmp_1 = f(b + x,x); int t = tmp_1; tmp_2 = b; /*effects: () <- */ b ++; /*effects: () b <- */ ; /*effects: () <- *tmp_2, tmp_2*/ ; /*effects: () <- b*/ tmp_3 = f(b + 2,*tmp_2); int u = tmp_3; return y; } frama-c-20.0-Calcium/tests/syntax/oracle/unspecified_access_call_bts0888.res.oracle0000666000000000000000000000164613571573400025150 0ustar [kernel] Parsing tests/syntax/unspecified_access_call_bts0888.i (no preprocessing) [kernel] tests/syntax/unspecified_access_call_bts0888.i:9: Warning: Unspecified sequence with side effect: /* y x <- */ y = 2; x = f(y); /* z <- */ z = 3; /* y <- */ y = x + z; [kernel] tests/syntax/unspecified_access_call_bts0888.i:10: Warning: Unspecified sequence with side effect: /* y x <- */ y = 2; x = f(y); /* z <- y */ z = x + y; [kernel] tests/syntax/unspecified_access_call_bts0888.i:11: Warning: Unspecified sequence with side effect: /* y x <- */ y = 2; x = f(y); /* y <- */ y = 3; /* y <- */ y = x + y; /* Generated by Frama-C */ int f(int); int main(void) { int __retres; int x; int y; int z; x = 2; x = f(x); y = 2; x = f(y); z = 3; y = x + z; y = 2; x = f(y); z = x + y; y = 2; x = f(y); y = 3; y = x + y; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/unspecified_access_if_bts01114.res.oracle0000666000000000000000000000042713571573400024666 0ustar [kernel] Parsing tests/syntax/unspecified_access_if_bts01114.i (no preprocessing) /* Generated by Frama-C */ int x; int *p; int main(void) { int __retres; int tmp; p = & x; *p = *p < 3; tmp = *p < 3; *p = tmp; if (tmp) x = 4; __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/unspecified_access_ptr_bts1519.res.oracle0000666000000000000000000000107313571573400025024 0ustar [kernel] Parsing tests/syntax/unspecified_access_ptr_bts1519.i (no preprocessing) /* Generated by Frama-C */ int t[10]; int u[10]; int v[10]; int i = 4; int j = 0; void main(void) { int tmp; int tmp_0; int *p1 = & v[i]; int *p2 = & v[j]; tmp = *p1; /*effects: (t[i]) <- */ (*p1) ++; /*effects: (t[i]) *p1 <- p1*/ t[i] += tmp + *p2; /*effects: (t[i]) t[i] <- i, tmp, *p2, p2*/ tmp_0 = v[i]; /*effects: (t[i]) <- */ (v[i]) ++; /*effects: (t[i]) v[i] <- i*/ t[i] += tmp_0 + v[j]; /*effects: (t[i]) t[i] <- i, tmp_0, v[j], j*/ return; } frama-c-20.0-Calcium/tests/syntax/oracle/unspecified_access_struct.res.oracle0000666000000000000000000000053613571573400024356 0ustar [kernel] Parsing tests/syntax/unspecified_access_struct.i (no preprocessing) /* Generated by Frama-C */ struct S { int f ; }; int main(void) { int __retres; struct S s2; struct S s3; struct S s4; struct S s5; struct S s1 = {.f = 0}; s5.f = s1.f; s4.f = s5.f; s3.f = s4.f; s2.f = s3.f; __retres = s2.f; return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/va.res.oracle0000666000000000000000000000117313571573400017537 0ustar [kernel] Parsing tests/syntax/va.c (with preprocessing) [kernel] tests/syntax/va.c:7: User Error: redefinition of 'x' in the same scope. Previous declaration was at tests/syntax/va.c:6 [kernel] tests/syntax/va.c:13: User Error: redefinition of 'x' in the same scope. Previous declaration was at tests/syntax/va.c:12 [kernel] tests/syntax/va.c:21: User Error: The last argument in call to __builtin_va_start should be the last formal argument of f [kernel] User Error: stopping on file "tests/syntax/va.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/variadic.res.oracle0000666000000000000000000000251713571573400020716 0ustar [kernel] Parsing tests/syntax/variadic.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/syntax/variadic.i:20: Warning: Calling undeclared function f. Old style K&R code? [kernel:typing:no-proto] tests/syntax/variadic.i:21: Warning: Calling function h that is declared without prototype. Its formals will be inferred from actual arguments /* Generated by Frama-C */ typedef char tt; struct T { int a ; }; int normal(int n); int vf(int x, void * const *__va_params); struct T st; tt abstract; unsigned char uchar; signed char chr; unsigned short ushort; unsigned long long ll; long double ld; double d; void h(int x_0, int x_1); extern int ( /* missing proto */ f)(int x_0, int x_1); void g(void) { { unsigned int __va_arg0 = 1u; int __va_arg1 = (int)uchar; double __va_arg2 = (double)3.0f; int __va_arg3 = (int)ushort; unsigned long long __va_arg4 = ll; int __va_arg5 = (int)abstract; struct T __va_arg6 = st; long double __va_arg7 = ld; double __va_arg8 = d; void *__va_args[9] = {& __va_arg0, & __va_arg1, & __va_arg2, & __va_arg3, & __va_arg4, & __va_arg5, & __va_arg6, & __va_arg7, & __va_arg8}; vf(1,(void * const *)(__va_args)); } f(1,(int)uchar); h(1,(int)uchar); normal((int)uchar); return; } frama-c-20.0-Calcium/tests/syntax/oracle/vdefined_bts1241.res.oracle0000666000000000000000000000144413571573400022076 0ustar [kernel] Parsing tests/syntax/vdefined_bts1241.i (no preprocessing) [kernel:typing:no-proto] tests/syntax/vdefined_bts1241.i:15: Warning: Calling function h that is declared without prototype. Its formals will be inferred from actual arguments [kernel] Parsing tests/syntax/vdefined_bts1241_1.i (no preprocessing) [kernel:typing:no-proto] tests/syntax/vdefined_bts1241_1.i:7: Warning: Calling function f that is declared without prototype. Its formals will be inferred from actual arguments /* Generated by Frama-C */ int f(void); int g(void) { int __retres; __retres = 0; return __retres; } int f(void) { int __retres; __retres = 1; return __retres; } int h(void); int h1(void) { int tmp; tmp = h(); return tmp; } int h(void) { int tmp; tmp = f(); return tmp; } frama-c-20.0-Calcium/tests/syntax/oracle/vdescr_bts1387.res.oracle0000666000000000000000000000150513571573400021611 0ustar [kernel] Parsing tests/syntax/vdescr_bts1387.i (no preprocessing) [kernel] Variable f has vdescr '' [kernel] Variable has vdescr '' [kernel] Variable g has vdescr '' [kernel] Variable has vdescr '' [kernel] Variable fptr has vdescr '' [kernel] Variable main has vdescr '' [kernel] Variable j has vdescr '' [kernel] Variable k has vdescr '' [kernel] Variable a has vdescr '' [kernel] Variable b has vdescr '' [kernel] Variable c has vdescr '' [kernel] Variable d has vdescr '' [kernel] Variable p has vdescr '' [kernel] Variable t has vdescr '' [kernel] Variable tmp has vdescr 'j++' [kernel] Variable tmp_0 has vdescr 'p++' [kernel] Variable tmp_1 has vdescr 'p++' [kernel] Variable tmp_2 has vdescr 'f(j)' [kernel] Variable tmp_3 has vdescr 'g(j)' [kernel] Variable tmp_4 has vdescr 'k?& j:(int *)0' [kernel] Variable l has vdescr '' frama-c-20.0-Calcium/tests/syntax/oracle/visit_create_local.res.oracle0000666000000000000000000000027413571573400022765 0ustar [kernel] Parsing tests/syntax/visit_create_local.i (no preprocessing) /* Generated by Frama-C */ void main(void) { int varbidon; int x; int y; varbidon = x; x = y; return; } frama-c-20.0-Calcium/tests/syntax/oracle/vla_goto.res.oracle0000666000000000000000000000041113571573400020735 0ustar [kernel] Parsing tests/syntax/vla_goto.i (no preprocessing) [kernel] User Error: tests/syntax/vla_goto.i:5, cannot jump from goto statement bypassing initialization of variable b2, declared at tests/syntax/vla_goto.i:9 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/vla_goto2.res.oracle0000666000000000000000000000262413571573400021027 0ustar [kernel] Parsing tests/syntax/vla_goto2.i (no preprocessing) /* Generated by Frama-C */ /*@ assigns \nothing; frees p; */ __attribute__((__FC_BUILTIN__)) void __fc_vla_free(void *p); /*@ assigns \result; assigns \result \from \nothing; allocates \result; */ __attribute__((__FC_BUILTIN__)) void *__fc_vla_alloc(unsigned int size); int case2(int arg) { int __retres; { unsigned int __lengthof_a2; /*@ assert alloca_bounds: 0 < sizeof(int) * arg ≤ 4294967295; */ ; __lengthof_a2 = (unsigned int)arg; int *a2 = __fc_vla_alloc(sizeof(int) * __lengthof_a2); if (arg) { __fc_vla_free((void *)a2); goto L; } __fc_vla_free((void *)a2); } { unsigned int __lengthof_b2; L: ; /*@ assert alloca_bounds: 0 < sizeof(int) * arg ≤ 4294967295; */ ; __lengthof_b2 = (unsigned int)arg; int *b2 = __fc_vla_alloc(sizeof(int) * __lengthof_b2); __fc_vla_free((void *)b2); } __retres = 0; return __retres; } int case3(int arg) { int __retres; { unsigned int __lengthof_vla; /*@ assert alloca_bounds: 0 < sizeof(int) * arg ≤ 4294967295; */ ; __lengthof_vla = (unsigned int)arg; int *vla = __fc_vla_alloc(sizeof(int) * __lengthof_vla); if (arg >= 10) { __retres = 1; __fc_vla_free((void *)vla); goto return_label; } __retres = 0; __fc_vla_free((void *)vla); } return_label: return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/vla_goto3.res.oracle0000666000000000000000000000041513571573400021024 0ustar [kernel] Parsing tests/syntax/vla_goto3.i (no preprocessing) [kernel] User Error: tests/syntax/vla_goto3.i:5, cannot jump from goto statement bypassing initialization of variable vla, declared at tests/syntax/vla_goto3.i:6 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/vla_goto_same_block_above.res.oracle0000666000000000000000000000277313571573400024305 0ustar [kernel] Parsing tests/syntax/vla_goto_same_block_above.i (no preprocessing) /* Generated by Frama-C */ int volatile nondet; /*@ assigns \nothing; frees p; */ __attribute__((__FC_BUILTIN__)) void __fc_vla_free(void *p); /*@ assigns \result; assigns \result \from \nothing; allocates \result; */ __attribute__((__FC_BUILTIN__)) void *__fc_vla_alloc(unsigned int size); int main(void) { int __retres; unsigned int __lengthof_vla; int i = 42; toto: ; /*@ assert alloca_bounds: 0 < sizeof(char) * i ≤ 4294967295; */ ; __lengthof_vla = (unsigned int)i; char *vla = __fc_vla_alloc(sizeof(char) * __lengthof_vla); if (nondet) { __fc_vla_free((void *)vla); goto toto; } __retres = 0; __fc_vla_free((void *)vla); return __retres; } int f(void) { int __retres; unsigned int __lengthof_vla; int i = 42; if (nondet) toto: ; /*@ assert alloca_bounds: 0 < sizeof(char) * i ≤ 4294967295; */ ; __lengthof_vla = (unsigned int)i; char *vla = __fc_vla_alloc(sizeof(char) * __lengthof_vla); if (nondet) { __fc_vla_free((void *)vla); goto toto; } __retres = 0; __fc_vla_free((void *)vla); return __retres; } int g(void) { int __retres; unsigned int __lengthof_vla; int i = 42; /*@ assert alloca_bounds: 0 < sizeof(char) * i ≤ 4294967295; */ ; __lengthof_vla = (unsigned int)i; char *vla = __fc_vla_alloc(sizeof(char) * __lengthof_vla); if (nondet) toto: ; if (nondet) goto toto; __retres = 0; __fc_vla_free((void *)vla); return __retres; } frama-c-20.0-Calcium/tests/syntax/oracle/vla_goto_same_block_below.res.oracle0000666000000000000000000000047513571573400024316 0ustar [kernel] Parsing tests/syntax/vla_goto_same_block_below.i (no preprocessing) [kernel] User Error: tests/syntax/vla_goto_same_block_below.i:6, cannot jump from goto statement bypassing initialization of variable vla, declared at tests/syntax/vla_goto_same_block_below.i:9 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/vla_loop.res.oracle0000666000000000000000000000571413571573400020751 0ustar [kernel] Parsing tests/syntax/vla_loop.i (no preprocessing) /* Generated by Frama-C */ /*@ assigns \nothing; frees p; */ __attribute__((__FC_BUILTIN__)) void __fc_vla_free(void *p); /*@ assigns \result; assigns \result \from \nothing; allocates \result; */ __attribute__((__FC_BUILTIN__)) void *__fc_vla_alloc(unsigned int size); void awhile(int x) { int *p; while (1) { { unsigned int __lengthof_a1; /*@ assert alloca_bounds: 0 < sizeof(int) * x ≤ 4294967295; */ ; __lengthof_a1 = (unsigned int)x; int *a1 = __fc_vla_alloc(sizeof(int) * __lengthof_a1); p = (int *)(& a1); if (x) { __fc_vla_free((void *)a1); break; } else { __fc_vla_free((void *)a1); continue; } } } return; } int f(int i) { int __retres; { unsigned int __lengthof_vla; if (i > 1) { __retres = 1; goto return_label; } /*@ assert alloca_bounds: 0 < sizeof(int) * i ≤ 4294967295; */ ; __lengthof_vla = (unsigned int)i; int *vla = __fc_vla_alloc(sizeof(int) * __lengthof_vla); __retres = 0; __fc_vla_free((void *)vla); } return_label: return __retres; } int g(int c) { int __retres; { int ret; unsigned int __lengthof_a; if (c <= 0) { __retres = 4; goto return_label; } /*@ assert alloca_bounds: 0 < sizeof(int) * c ≤ 4294967295; */ ; __lengthof_a = (unsigned int)c; int *a = __fc_vla_alloc(sizeof(int) * __lengthof_a); *(a + (c - 1)) = 3; ret = *(a + (c - 1)); __retres = ret; __fc_vla_free((void *)a); } return_label: return __retres; } int main(int argc, char **argv) { int *p; switch (argc) { default: { unsigned int __lengthof_a; /*@ assert alloca_bounds: 0 < sizeof(int) * argc ≤ 4294967295; */ ; __lengthof_a = (unsigned int)argc; int *a = __fc_vla_alloc(sizeof(int) * __lengthof_a); while (1) { p = (int *)(& a); break; } ; __fc_vla_free((void *)a); } } { unsigned int __lengthof_b; /*@ assert alloca_bounds: 0 < sizeof(int) * argc ≤ 4294967295; */ ; __lengthof_b = (unsigned int)argc; int *b = __fc_vla_alloc(sizeof(int) * __lengthof_b); while (1) { p = (int *)(& b); break; } ; __fc_vla_free((void *)b); } { unsigned int __lengthof_c; /*@ assert alloca_bounds: 0 < sizeof(int) * argc ≤ 4294967295; */ ; __lengthof_c = (unsigned int)argc; int *c = __fc_vla_alloc(sizeof(int) * __lengthof_c); switch (argc) { case 1: { p = (int *)(& c); break; } } ; __fc_vla_free((void *)c); } { unsigned int __lengthof_d; /*@ assert alloca_bounds: 0 < sizeof(int) * argc ≤ 4294967295; */ ; __lengthof_d = (unsigned int)argc; int *d = __fc_vla_alloc(sizeof(int) * __lengthof_d); switch (argc) case 1: p = (int *)(& d); __fc_vla_free((void *)d); } return argc; } frama-c-20.0-Calcium/tests/syntax/oracle/vla_strlen.res.oracle0000666000000000000000000000154713571573400021307 0ustar [kernel] Parsing tests/syntax/vla_strlen.c (with preprocessing) /* Generated by Frama-C */ #include "stddef.h" #include "string.h" #include "strings.h" /*@ assigns \nothing; frees p; */ __attribute__((__FC_BUILTIN__)) void __fc_vla_free(void *p); /*@ assigns \result; assigns \result \from \nothing; allocates \result; */ __attribute__((__FC_BUILTIN__)) void *__fc_vla_alloc(unsigned int size); void f(char *s) { unsigned int __lengthof_t; size_t tmp; tmp = strlen((char const *)s); /*@ assert alloca_bounds: 0 < sizeof(char) * (tmp + 1) ≤ 4294967295; */ ; __lengthof_t = tmp + (size_t)1; char *t = __fc_vla_alloc(sizeof(char) * __lengthof_t); char *p = t; while (*s) { char *tmp_0; char *tmp_1; tmp_0 = p; p ++; tmp_1 = s; s ++; *tmp_0 = *tmp_1; } *p = (char)0; __fc_vla_free((void *)t); return; } frama-c-20.0-Calcium/tests/syntax/oracle/vla_switch.res.oracle0000666000000000000000000000060313571573400021271 0ustar [kernel] Parsing tests/syntax/vla_switch.i (no preprocessing) [kernel] tests/syntax/vla_switch.i:11: Warning: Body of function case3 falls-through. Adding a return statement [kernel] User Error: tests/syntax/vla_switch.i:2, cannot jump from switch statement bypassing initialization of variable b, declared at tests/syntax/vla_switch.i:4 [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/void_parameter.res.oracle0000666000000000000000000000176713571573400022143 0ustar [kernel] Parsing tests/syntax/void_parameter.i (no preprocessing) [kernel] tests/syntax/void_parameter.i:7: User Error: named parameter 'parameter' has void type [kernel] tests/syntax/void_parameter.i:8: User Error: 'void' must be the only parameter if specified [kernel] tests/syntax/void_parameter.i:9: User Error: 'void' must be the only parameter if specified [kernel] tests/syntax/void_parameter.i:9: User Error: named parameter 'parameter' has void type [kernel] tests/syntax/void_parameter.i:13: User Error: named parameter 'parameter' has void type [kernel] tests/syntax/void_parameter.i:14: User Error: 'void' must be the only parameter if specified [kernel] tests/syntax/void_parameter.i:15: User Error: 'void' must be the only parameter if specified [kernel] tests/syntax/void_parameter.i:15: User Error: named parameter 'parameter' has void type [kernel] User Error: stopping on file "tests/syntax/void_parameter.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/syntax/oracle/volatile_clause.res.oracle0000666000000000000000000000561313571573400022307 0ustar [kernel] Parsing tests/syntax/volatile_clause.i (no preprocessing) [kernel] tests/syntax/volatile_clause.i:26: Warning: Access function 'rd_ci1' writes to volatile const locations [kernel] tests/syntax/volatile_clause.i:27: Warning: Access function 'rd_ci2' writes to volatile const locations [kernel] tests/syntax/volatile_clause.i:28: Warning: Access function 'rd_ci3' writes to volatile const locations [kernel] tests/syntax/volatile_clause.i:29: Warning: Access function 'rd_ci4' writes to volatile const locations /* Generated by Frama-C */ typedef unsigned int volatile Vunsigned; typedef int const Cint; enum __anonenum_Enum_1 { e = -1 }; typedef enum __anonenum_Enum_1 Enum; typedef Enum const CEnum; unsigned int g(Vunsigned *q); unsigned int f(unsigned int volatile *q); unsigned int volatile *p = (unsigned int volatile *)0x4; /*@ volatile *p reads g; */ /*@ volatile *((Vunsigned *)0x4) reads f; */ /*@ volatile *((unsigned int volatile *)0x6) reads f; */ unsigned int f1(Vunsigned *q); unsigned int g1(unsigned int volatile *q); unsigned int volatile *pf1; unsigned int volatile *pg1; unsigned int volatile *pg; /*@ volatile *pg reads g; */ /*@ volatile *pf1 reads f1; */ /*@ volatile *pg1 reads g1; */ Cint volatile ci1; Cint volatile ci2; Cint volatile ci3; Cint volatile ci4; int rd_ci1(Cint volatile *p); int rd_ci2(int const volatile *p); int rd_ci3(Cint volatile *p); int rd_ci4(int const volatile *p); /*@ volatile ci1 reads rd_ci1; */ /*@ volatile ci2 reads rd_ci2; */ /*@ volatile ci3 reads rd_ci3; */ /*@ volatile ci4 reads rd_ci4; */ int wr_ci1(Cint volatile *p, Cint v); int wr_ci2(int const volatile *p, Cint v); int wr_ci3(Cint volatile *p, Cint v); int wr_ci4(int const volatile *p, Cint v); /*@ volatile ci1 writes wr_ci1; */ /*@ volatile ci2 writes wr_ci2; */ /*@ volatile ci3 writes wr_ci3; */ /*@ volatile ci4 writes wr_ci4; */ Cint volatile ci10; Cint volatile ci20; Cint volatile ci30; Cint volatile ci40; int wr_ci10(Cint volatile *p, int v); int wr_ci20(int const volatile *p, int v); int wr_ci30(Cint volatile *p, int v); int wr_ci40(int const volatile *p, int v); /*@ volatile ci10 writes wr_ci10; */ /*@ volatile ci20 writes wr_ci20; */ /*@ volatile ci30 writes wr_ci30; */ /*@ volatile ci40 writes wr_ci40; */ Cint volatile ci100; Cint volatile ci200; Cint volatile ci300; Cint volatile ci400; int wr_ci100(Cint volatile *p, int const v); int wr_ci200(int const volatile *p, int const v); int wr_ci300(Cint volatile *p, int const v); int wr_ci400(int const volatile *p, int const v); /*@ volatile ci100 writes wr_ci100; */ /*@ volatile ci200 writes wr_ci200; */ /*@ volatile ci300 writes wr_ci300; */ /*@ volatile ci400 writes wr_ci400; */ Enum volatile e3; Enum wr_e3(Enum volatile *p, Enum const v); /*@ volatile e3 writes wr_e3; */ Enum fe(Enum a); void ge(void) { e3 = fe(e3); return; } CEnum volatile ce1; CEnum volatile ce2; CEnum volatile ce3; CEnum volatile ce4; frama-c-20.0-Calcium/tests/syntax/orig_name.i0000666000000000000000000000023013571573400016010 0ustar /* run.config STDOPT: +"-orig-name" */ int x = 1; int f(int x) { int y = 0; if (x == 0) { int x = 3; y = x++; } y += x; return y; } frama-c-20.0-Calcium/tests/syntax/osx_attribute.i0000666000000000000000000000017013571573400016747 0ustar void f(void) __attribute__((availability(macos,introduced=10.4,deprecated=10.6,obsoleted=10.7))); int main () { f(); } frama-c-20.0-Calcium/tests/syntax/pp_lines.ml0000666000000000000000000000050613571573400016047 0ustar (* This module can be used to force the printing of #lines inside oracles. If you want to use it inside another test, please move the EXECNOW that forces its compilation inside test_config, to avoid race conditions. *) open Printer_api let () = Cil_printer.state.line_directive_style <- Some Line_comment_sparse; frama-c-20.0-Calcium/tests/syntax/preprocessed.ci0000666000000000000000000000025313571573400016716 0ustar /* run.config OPT: -cpp-command="gcc -C -E -DFOO=42" -print */ /*@ ensures \result == FOO; */ int foo() { int FOO = 42; return FOO; } /* Local Variables: mode: C End: */frama-c-20.0-Calcium/tests/syntax/ptr_null_cmp_bts1027.i0000666000000000000000000000030113571573400017727 0ustar /*@ behavior normal: assumes r && !x; ensures \result == 0; behavior f: assumes !r || x; ensures \result == -1; */ int max(int *r, double x) { if (!r || x) return -1; return 0; } frama-c-20.0-Calcium/tests/syntax/reject_use_decl_mismatch_bts728.c0000666000000000000000000000065013571573400022165 0ustar /* run.config STDOPT: +"-cpp-extra-args='-DHAS_PROTO'" STDOPT: +"-cpp-extra-args='-DNO_PROTO'" */ #ifdef HAS_PROTO int f(); #endif int G; int H; int main () { int T=99; H= f(2); return T; /* gcc -O0 -> 26; gcc -O3 -> 99 */ } int f(int x,int y, int z, int t,int t1,int t2,int t3,int t4,int t5,int t6) { x = 17; y=18; z=19; t=20; t1= 21; t2 = 22; t3 = 23; t4= 24; t5 = 25; t6 = 26; return x; } frama-c-20.0-Calcium/tests/syntax/rename.i0000666000000000000000000000153113571573400015324 0ustar int f() { int x = 0; { int x_0 = 1; { int x = 2; return x; } } } int g() { int x_0 = 0; { int x_0 = 1; return x_0; } } void f1() { static int i_0 = 0; static int i_67 = 1; static int i_68 = 2; i_67 += i_68+i_0; } void f2() { static int i_0 = 0; static int i_67 = 3; static int i_68 = 4; i_67 += i_68+i_0; } void f3() { static int j_0 = 2; j_0 ++; } void f4(int *j_0_1) { int j_0 = *j_0_1; { int j_0_1 = j_0; j_0_1+=j_0; } } void f5() { { int y_0; } int y_0; } int y_0; void f6() { { int y_2; } int y_2; } int y_1; void f7() { { int __constr_expr_1 = 0; } int __constr_expr_1 = 0; } int __constr_expr_0 = 0; struct not_anon { int __anonCompField1; }; struct not_anon s = {.__anonCompField1 = 0}; struct anon { struct { int inner_i; }; }; struct anon a = { .inner_i = 0 }; frama-c-20.0-Calcium/tests/syntax/reorder.i0000666000000000000000000000043613571573400015522 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int x; void f() { x++; } /*@ axiomatic Ax { @ predicate Q (integer v); @ } @*/ //@ requires Q: \let v = Q(255); !(!v||v) ; void g (void); frama-c-20.0-Calcium/tests/syntax/reorder.ml0000666000000000000000000000360113571573400015677 0ustar open Cil_types let run () = ignore(Ast.get ()); let kf = Globals.Functions.find_by_name "f" in let li = Cil_const.make_logic_info "i" in let lj = Cil_const.make_logic_info "j" in let lk = Cil_const.make_logic_info "k" in let ll = Cil_const.make_logic_info "l" in li.l_var_info.lv_type <- Linteger; lj.l_var_info.lv_type <- Linteger; lk.l_var_info.lv_type <- Linteger; ll.l_var_info.lv_type <- Linteger; li.l_type <- Some Linteger; lj.l_type <- Some Linteger; lk.l_type <- Some Linteger; ll.l_type <- Some Linteger; li.l_body <- LBterm (Logic_const.term (TBinOp (PlusA, Logic_const.term (Tapp(lj,[],[])) Linteger, Logic_const.term (Tapp(lk,[],[])) Linteger)) Linteger); lj.l_body <- LBterm (Logic_const.term (Tapp(ll,[],[])) Linteger); lk.l_body <- LBterm (Logic_const.term (Tapp(ll,[],[])) Linteger); ll.l_body <- LBterm (Logic_const.tinteger 1); let post_cond = [Normal, Logic_const.new_predicate (Logic_const.prel (Req, Logic_const.term (Tapp(li,[],[])) Linteger, Logic_const.term (Tapp(li,[],[])) Linteger))] in let bhv = Cil.mk_behavior ~post_cond () in Annotations.add_behaviors Emitter.end_user kf [ bhv ]; let loc = Cil_datatype.Location.unknown in let dli = Dfun_or_pred (li,loc) in let dlj = Dfun_or_pred (lj,loc) in let dlk = Dfun_or_pred (lk,loc) in let dll = Dfun_or_pred (ll,loc) in Annotations.add_global Emitter.end_user dli; Annotations.add_global Emitter.end_user dlj; Annotations.add_global Emitter.end_user dlk; Annotations.add_global Emitter.end_user dll; Logic_utils.add_logic_function li; Logic_utils.add_logic_function lj; Logic_utils.add_logic_function lk; Logic_utils.add_logic_function ll; File.pretty_ast (); File.reorder_ast (); File.pretty_ast (); Filecheck.check_ast "reordered" let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/rettype.i0000666000000000000000000000031313571573400015546 0ustar // This test must be rejected: return type of foo is not // compatible between decl and def. //@ assigns \nothing; int foo(int* p); //@ ensures 0 <= \result < 25; unsigned short foo() { return 0; } frama-c-20.0-Calcium/tests/syntax/rmtmps_static.i0000666000000000000000000000005413571573400016745 0ustar int f() { static int x = 0; return 0; } frama-c-20.0-Calcium/tests/syntax/simp_switch.i0000666000000000000000000000014513571573400016406 0ustar /* run.config STDOPT: +"-simplify-cfg" */ void main() { switch(0) { case 0: break; } } frama-c-20.0-Calcium/tests/syntax/sizeof_bts1414.i0000666000000000000000000000051313571573400016535 0ustar int f(int b); int g(int *a) { int x ; x = sizeof(f(*a)); switch (x) { case (sizeof(x++)): return 1; default: return 0; } return x; } int h1(int x) {return x;} int h2(int x) {return x;} int h3(int x){return x;} /* Issue gitlab #430. */ void main (void) { int s = sizeof( ((h1(1) && 1) || h2(1)) && h3(1) ); } frama-c-20.0-Calcium/tests/syntax/sizeof_incomplete_type.c0000666000000000000000000000070313571573400020626 0ustar #include typedef char *sds; struct sdshdr8 { char len; /* used */ char alloc; /* excluding the header and null terminator */ unsigned char flags; /* 3 lsb of type, 5 unused bits */ char buf[]; }; void sdslen(const sds s) { ((struct sdshdr8 *)((s)-(sizeof(struct sdshdr8))))->len; // should be OK } typedef struct { int i; } st; void main() { st *res = malloc(sizeof(struct inexistent)); // should be an error } frama-c-20.0-Calcium/tests/syntax/slash_end.i0000666000000000000000000000014513571573400016015 0ustar int f(int x, int y) { return x / y; } int g(int x, int y) { return x / \ y; } frama-c-20.0-Calcium/tests/syntax/spurious_brace_bts_1273.i0000666000000000000000000000004313571573400020423 0ustar void foo() { } } void main () { } frama-c-20.0-Calcium/tests/syntax/static_formals.h0000666000000000000000000000004613571573400017066 0ustar //@ requires x < 10; static f(int x); frama-c-20.0-Calcium/tests/syntax/static_formals_1.c0000666000000000000000000000026713571573400017306 0ustar /* run.config STDOPT: +"@PTEST_DIR@/static_formals_2.c" +"-cpp-extra-args=\"-I @PTEST_DIR@\"" +"-kernel-msg-key printer:vid" */ #include "static_formals.h" int g() { return f(4); } frama-c-20.0-Calcium/tests/syntax/static_formals_2.c0000666000000000000000000000016113571573400017300 0ustar /* run.config DONTRUN: main test in static_formals_1.c */ #include "static_formals.h" int h() { return f(6); } frama-c-20.0-Calcium/tests/syntax/struct_copy.i0000666000000000000000000000047613571573400016442 0ustar /* run.config OPT: -copy -print */ struct inner { int a, b; char c; void *p; }; struct outer { struct inner *pinner; struct inner inner; int a; struct inner ainner[5]; int b; char c; long long l; }; int main (void) { struct inner inner; struct outer outer; outer.inner.a = 0; return 0; } frama-c-20.0-Calcium/tests/syntax/struct_with_function_field_invalid.i0000666000000000000000000000012613571573400023211 0ustar // invalid field with function type, parsing should fail struct { void f(int); } s; frama-c-20.0-Calcium/tests/syntax/switch-default.i0000666000000000000000000000037713571573400017007 0ustar int main() { int x = 42; for (int i = 0; i < 4; i++) { switch (x) default: { Frama_C_show_each_i(i); break; } } return 0; } void f () { int i; switch (0) { case 0: { i=1; break; } default: i=9; } return; } frama-c-20.0-Calcium/tests/syntax/syntactic_hook.i0000666000000000000000000000122713571573400017100 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs STDOPT: +"-no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs" */ int f(void); int k(int *); int k(int * x) { return (*x)++; } int main () { int x = 0; int y = 0; int t(void); x=t(); x++; x; // warn ignore pure exp g(3); // warn implicit proto x = sizeof(x++); // warn drop side-effect x = x++ && x; y = x && x++; // warn conditional side-effect y = x && (x++ || x); // warn conditional side-effect y = x && (x || x++); // warn conditional side-effect y = x ? x++ : x++; // warn conditional side-effect return x; } int f(int); //error: conflicting decls frama-c-20.0-Calcium/tests/syntax/syntactic_hook.ml0000666000000000000000000000706113571573400017262 0ustar open Cabsvisit open Cabshelper open Cil_types open Cil open Cabs class visit = object inherit nopCabsVisitor method! vstmt s = let open Logic_ptree in let loc = get_statementloc s in ChangeTo [{ stmt_ghost = false; stmt_node = CODE_ANNOT( AAssert([], Assert, { lexpr_node = PLat ({ lexpr_node = PLtrue; lexpr_loc = loc},"Pre"); lexpr_loc = loc}), loc)}; s] end let visitor = new visit;; Frontc.add_syntactic_transformation (Cabsvisit.visitCabsFile visitor);; let warn_pure_exp f e = let loc = e.eloc in Kernel.warning ~source:(fst loc) "[SH]: function %s, pure expression %a is dropped" f (Printer.pp_exp) e ;; Cabs2cil.register_ignore_pure_exp_hook warn_pure_exp;; let warn_proto vi = Kernel.warning ~source:(fst vi.vdecl) "[SH]: implicit declaration for prototype %a" (Format.pp_print_string) vi.vname ;; Cabs2cil.register_implicit_prototype_hook warn_proto ;; let warn_conflict oldvi vi reason = Kernel.warning ~source:(fst vi.vdecl) "[SH]: conflict with declaration of %a at line %d: %s" Format.pp_print_string vi.vname (fst oldvi.vdecl).Filepath.pos_lnum reason ;; Cabs2cil.register_incompatible_decl_hook warn_conflict;; let warn_distinct oldvi vi = Kernel.warning ~source:(fst vi.vdecl) "[SH]: definition of %a does not use exactly the same prototype as \ declared on line %d" Format.pp_print_string vi.vname (fst oldvi.vdecl).Filepath.pos_lnum ;; Cabs2cil.register_different_decl_hook warn_distinct;; let warn_local_func vi = Kernel.warning ~source:(fst vi.vdecl) "[SH]: definition of local function %a" Format.pp_print_string vi.vname ;; Cabs2cil.register_local_func_hook warn_local_func;; let warn_drop_effect olde e = Kernel.warning ~source:(fst e.eloc) "[SH]: dropping side effect in sizeof: %a is converted to %a" Cprint.print_expression olde Printer.pp_exp e ;; Cabs2cil.register_ignore_side_effect_hook warn_drop_effect let warn_cond_effect orig e = let source = fst e.expr_loc in Kernel.warning ~source "@[[SH]: side effect of@ @[expression %a@]@ \ occurs in conditional part of@ @[expression %a@].@ \ It is not always executed.@]" Cprint.print_expression e Cprint.print_expression orig ;; Cabs2cil.register_conditional_side_effect_hook warn_cond_effect let process_new_global = let seen_vi = Cil_datatype.Varinfo.Hashtbl.create 10 in fun vi exists -> let source = fst vi.vdecl in Kernel.feedback ~source "New global node introducing identifier %s(%d)" vi.vname vi.vid; if exists then begin Kernel.feedback "New occurrence of existing identifier %s" vi.vname; if not (Cil_datatype.Varinfo.Hashtbl.mem seen_vi vi) then Kernel.fatal "identifier %s is supposed to have been already seen, but it has \ not been processed through this hook." vi.vname; let vi' = Cil_datatype.Varinfo.Hashtbl.find seen_vi vi in if vi != vi' then Kernel.fatal "identifier %s(%d) is not shared with its previous occurrence %s(%d)" vi.vname vi.vid vi'.vname vi'.vid end else begin Kernel.feedback "First occurrence of %s" vi.vname; if Cil_datatype.Varinfo.Hashtbl.mem seen_vi vi then Kernel.fatal "This is supposed to be the first occurrence of %s, \ but it is already present in the table." vi.vname; Cil_datatype.Varinfo.Hashtbl.add seen_vi vi vi end ;; Cabs2cil.register_new_global_hook process_new_global frama-c-20.0-Calcium/tests/syntax/temporary_location.c0000666000000000000000000000045013571573400017760 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -print */ int f(void) { return 1; } int main(void) { if(f()){ return 0; } else { int x = 0; int y = x++ + 1; return y + 3; } } frama-c-20.0-Calcium/tests/syntax/temporary_location.ml0000666000000000000000000000047413571573400020154 0ustar open Cil_types class vis = object(_) inherit Visitor.frama_c_inplace method! vvrbl vi = Kernel.result "%s -> %a" vi.vname Printer.pp_location vi.vdecl; Cil.DoChildren end let main () = Ast.compute (); Cil.visitCilFile (new vis :> Cil.cilVisitor) (Ast.get ()) let () = Db.Main.extend main frama-c-20.0-Calcium/tests/syntax/ternary_brace.i0000666000000000000000000000020313571573400016670 0ustar int main() { int i = 1; i = (i < 2 ? ++i : i++); if (i < 2) { ++i; i = i; } else { int tmp = i; i++; i=tmp; } return i; } frama-c-20.0-Calcium/tests/syntax/ternary_bts1503.i0000666000000000000000000000021313571573400016716 0ustar void f() { // Bts 1503 0 ? 0 * 0 ? 0 : 0 : 0; // Bts 2117 char x; (char)(1?(((x)=6),1):0); (void)((char)(1?(((x)=6),1):0)); } frama-c-20.0-Calcium/tests/syntax/test_config0000666000000000000000000000030413571573400016127 0ustar COMMENT: this directory is meant to test exclusively the front-end COMMENT: (parser, type-checker, linker, syntactic transformations) OPT: -print -journal-disable -check FILEREG:.*\.\(c\|i\|ci\)$ frama-c-20.0-Calcium/tests/syntax/transient_block.i0000666000000000000000000000034013571573400017233 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -kernel-warn-key transient-block=active */ void f(void) { } int main () { int x = 1; x = 2; f(); } frama-c-20.0-Calcium/tests/syntax/transient_block.ml0000666000000000000000000000325313571573400017421 0ustar open Cil_types class vis prj = object(self) inherit Visitor.frama_c_copy prj val mutable my_var = None method private create_block create s instr = let s1 = Cil.mkStmtOneInstr ~valid_sid:true instr in let b = Cil.mkBlock [s1] in if create then begin let f = Visitor_behavior.Get.fundec self#behavior (Extlib.the self#current_func) in let y = Cil.makeLocalVar f ~scope:b "y" (TInt(IInt,[])) in my_var <- Some y; let loc = Cil_datatype.Location.unknown in let s2 = Cil.mkStmtOneInstr ~valid_sid:true (Local_init(y,AssignInit(SingleInit(Cil.zero ~loc)),loc)) in b.bstmts <- s2 :: b.bstmts; let b = Cil.transient_block b in s.skind <- Block b; end; Cil.JustCopy method! vstmt_aux s = match s.skind with | Instr (Local_init _ as instr) -> (try self#create_block true s instr with Log.AbortFatal _ -> Kernel.feedback "transient_block fatal error on %a as expected" Printer.pp_instr instr; let f = Visitor_behavior.Get.fundec self#behavior (Extlib.the self#current_func) in let y = Extlib.the my_var in f.slocals <- List.filter (fun v -> not (Cil_datatype.Varinfo.equal v y)) f.slocals; Cil.DoChildren) | Instr (Set ((Var { vorig_name = "x" }, NoOffset),_,_) as instr) -> self#create_block true s instr | Instr (Call _ as instr) -> self#create_block false s instr | _ -> Cil.DoChildren end let main () = Ast.compute (); let prj = File.create_project_from_visitor "test" (fun prj -> new vis prj) in File.pretty_ast ~prj () let () = Db.Main.extend main frama-c-20.0-Calcium/tests/syntax/type_branch_bts_1081.i0000666000000000000000000000031113571573400017667 0ustar int main(){ int foo, x, y; foo ? (void)x : (signed char)y; // accepted (we drop the expressions, don't care about their types) int z = foo ? (void)x: (signed char)y; // rejected return 0; } frama-c-20.0-Calcium/tests/syntax/type_compat_call.c0000666000000000000000000000067413571573400017375 0ustar /*run.config STDOPT: #"-machdep x86_32" */ #include void f(int32_t const *p); void g(int32_t *const p); void h(uint8_t const *p); void m(int8_t const *p); int main() { int const i = 42; f(&i); // compatible g(&i); // incompatible char const c = 'c'; signed char const s = 's'; unsigned char const u = 'u'; h(&c); // incompatible h(&u); // compatible m(&c); // compatible m(&s); // incompatible return 0; } frama-c-20.0-Calcium/tests/syntax/type_redef.i0000666000000000000000000000271113571573400016204 0ustar /* run.config STDOPT: STDOPT: #"-c11" */ // Note: redefinition of local typedefs is currently unsupported typedef int myint; typedef int myint; //valid in C11 only typedef int list[2]; typedef int list[2]; //valid in C11 only typedef struct { int a; } st; typedef struct { int a; } st; //invalid typedef st st1; //valid typedef union { int a; } u; typedef union { int a; } u; //invalid typedef enum {A} e; typedef enum {A} e; // invalid typedef enum {B} e1; typedef enum {B} e2; // invalid (B redefined) typedef struct {int a;} st1; //invalid typedef int I; void f() { typedef int I; //valid (not same scope) { typedef int I; }//valid (not same scope) } typedef int vi; typedef volatile int vi; //invalid typedef int ci; typedef const int ci; //invalid typedef __attribute__((aligned(8))) int ai; typedef int ai; //valid in C11 only typedef int *ftest_t; typedef double ftest_t; //invalid // tests of valid composite type redefinitions typedef struct _stt { int a; } stt; typedef struct _stt stt; //valid in C11 only typedef struct _stt2 stt; //invalid typedef struct _stt stt2; //valid void g() { typedef struct _stt { int a; } stt; //valid } void h() { typedef struct _stt stt; //valid } typedef int magic; void i() { typedef void (*magic)(void); //valid { typedef struct {int obj;} magic; } //valid magic m = (magic) g; //valid (test scoping of local typedef) } magic m = 2; //valid (test scoping of local typedef) void main(ftest_t i) { } frama-c-20.0-Calcium/tests/syntax/typedef_incorrect_pretty_print_bts1518.i0000666000000000000000000000100413571573400023572 0ustar /* run.config DONTRUN: bug fix in progress MACRO: OUT @PTEST_NAME@_res.i EXECNOW: LOG @OUT@ @frama-c@ @PTEST_FILE@ -ocode @PTEST_DIR@/result/@OUT@ -print -then @PTEST_DIR@/result/@OUT@ -print */ /* Generated by Frama-C */ /* Generated by Frama-C */ struct rr; typedef struct rr rr; struct apf; struct rr { struct apf *of ; }; typedef struct apf apf; struct apf { apf *next ; rr *r ; }; /*@ requires r->of == ((void *)0); */ static apf *f(rr *r) { apf *__retres; __retres = r->of; return __retres; } frama-c-20.0-Calcium/tests/syntax/typedef_multi.h0000666000000000000000000000004413571573400016724 0ustar typedef int WORD; extern WORD x,y; frama-c-20.0-Calcium/tests/syntax/typedef_multi.ml0000666000000000000000000000012713571573400017107 0ustar let run () = File.reorder_ast (); File.pretty_ast () let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/typedef_multi_1.c0000666000000000000000000000033313571573400017140 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/typedef_multi.cmxs OPT: -load-module @PTEST_DIR@/typedef_multi tests/syntax/typedef_multi_2.c */ #include "tests/syntax/typedef_multi.h" void f () { while(x [kernel] user error: Length of array is negative for (i = 0; i < 2*rounds; i++) { k[i] = i; } } int main () { funk(17); return 0; } frama-c-20.0-Calcium/tests/syntax/undeclared_local_bts1126.c0000666000000000000000000000264713571573400020522 0ustar typedef struct gnutls_session_t { int f; } gnutls_session_t; typedef void(*gnutls_cipher_algorithm_t)(int); typedef void(*gnutls_mac_algorithm_t)(int); #define GNUTLS_CIPHER_UNKNOWN 0 #define GNUTLS_MAC_UNKNOWN 0 #define GNUTLS_E_INTERNAL_ERROR 0 #define GNUTLS_E_UNWANTED_ALGORITHM 0 typedef struct record_parameters_st { int initialized; gnutls_cipher_algorithm_t cipher_algorithm; gnutls_mac_algorithm_t mac_algorithm; } record_parameters_st; typedef struct cipher_suite_st { int a; } cipher_suite_st; int _gnutls_epoch_set_cipher_suite (gnutls_session_t session, int epoch_rel, cipher_suite_st * suite) { gnutls_cipher_algorithm_t cipher_algo; gnutls_mac_algorithm_t mac_algo; record_parameters_st *params; int ret; ret = _gnutls_epoch_get (session, epoch_rel, ¶ms); if (ret < 0) return gnutls_assert_val (ret); if (params->initialized || params->cipher_algorithm != GNUTLS_CIPHER_UNKNOWN || params->mac_algorithm != GNUTLS_MAC_UNKNOWN) return gnutls_assert_val (GNUTLS_E_INTERNAL_ERROR); cipher_algo = _gnutls_cipher_suite_get_cipher_algo (suite); mac_algo = _gnutls_cipher_suite_get_mac_algo (suite); if (_gnutls_cipher_is_ok (cipher_algo) != 0 || _gnutls_mac_is_ok (mac_algo) != 0) return gnutls_assert_val (GNUTLS_E_UNWANTED_ALGORITHM); params->cipher_algorithm = cipher_algo; params->mac_algorithm = mac_algo; return 0; } frama-c-20.0-Calcium/tests/syntax/unnamed_bitfields.i0000666000000000000000000000026413571573400017533 0ustar struct foo { unsigned bar : 16, : 0; unsigned bla : 11, : 1; unsigned bli : 4, : 0; }; unsigned f(struct foo s) { return s.bla; } frama-c-20.0-Calcium/tests/syntax/unroll_const.i0000666000000000000000000000165613571573400016606 0ustar const int t[4] = { 4, 2 }; const struct { int i1; int i2;} u[3] = { 2, 5, 3, 7}; struct s { int i; int j ; struct v { int k; int l;} v; }; const struct s s = { 5, 8, 3 }; struct T; volatile int c; void main() { unsigned int i = 0; //@ loop pragma UNROLL sizeof(t)/sizeof(t[0]); // 4 while (c) { i++; } //@ loop pragma UNROLL \offset(&s.v.l); // 12 while (c) { i++; } //@ loop pragma UNROLL s.i + s.v.l; // 5+0 while (c) { i++; } //@ loop pragma UNROLL \max(t[..]); // 4 while (c) { i++; } //@ loop pragma UNROLL \min(t[..]); // 0 because of missing initializer while (c) { i++; } //@ loop pragma UNROLL \max(\union(1, 1+s.i)); // 6 while (c) { i++; } //@ loop pragma UNROLL \min(t[\union(1, 3)]) + \max(t[\union(1, 3)]); // 2+0 while (c) { i++; } //@ loop pragma UNROLL \min(u[..1].i1) * \max(u[..1].i1); // 2*3 while (c) { i++; } } frama-c-20.0-Calcium/tests/syntax/unroll_labels.i0000666000000000000000000000321013571573400016706 0ustar /* run.config STDOPT: +"-eva @EVA_CONFIG@" STDOPT: +"-eva @EVA_CONFIG@ -main main2 -slevel 3" */ enum { SIX = 6 } ; volatile foo; void main () { int j = 0; /*@ loop pragma UNROLL "completely", 4; */ for (int i=1;i<4;i++) { switch (i) { case 1: j+=1; break; case 2: j+=3; break; case 3: j+=5; break; case 4: j+=7; break; default: j=0; } } { int x = 0; L: //@ loop pragma UNROLL 3; while(x<5) { int y=0; x++; y++; }; } j = 0; //@ loop pragma UNROLL SIX; while(foo) { switch(j) { case -1: j++; break; case 0: //@ loop pragma UNROLL 3; while (j<5) {j++;} break; case 5: j = -1; break; default: return; } } { if (j==0) goto zero; if (j==1) goto un; return; zero: //@ loop pragma UNROLL 3; while (j<5) { un: j++;} } } void main2 () { /*@ loop pragma UNROLL 2; */ for (int i=0;i<2;i++) { for (int j=0;j<2;j++){ i += 1; goto foo; i += 1; foo: } } } void main2_done () { /*@ loop pragma UNROLL 2; @ loop pragma UNROLL "done", 2; */ for (int i=0;i<2;i++) { /*@ loop pragma UNROLL 2; */ for (int j=0;j<2;j++){ i += 1; goto foo; i += 1; foo: } } } void main3 (int c) { int i=0; if (c == 0) goto foo; /*@ loop pragma UNROLL 2; */ for (;i<5;i++) { int j = 0 ; if (i == j) goto foo; if (i == 1) break; if (i == 2) continue; for (;j<5;j++){ if (i == j) break; if (i < j) goto foo; if (i == j+1) continue; if (i == j+2) goto up; i += 1; foo: i += 1; } up: } } frama-c-20.0-Calcium/tests/syntax/unroll_property_status_bts1442.i0000666000000000000000000000047413571573400022127 0ustar /* run.config OPT: -report OPT: -ulevel -1 -report */ int u(void); char *strcpy(char*dst, char*src) { char* ldst=dst; /*@ loop pragma UNROLL 20; */ while (*ldst++ = *src++) ; return dst; } void main1(void) { char *p; { char a[10] = "Not ok"; char b [5]; if (u()) strcpy(b,a); } } frama-c-20.0-Calcium/tests/syntax/unroll_visit.i0000666000000000000000000000030313571573400016602 0ustar /* run.config STDOPT: +"-eva @EVA_CONFIG@ -deps -out -input -deps" */ void main() { /*@ loop pragma UNROLL 2; */ for(int i=0; i<100; i++) { i--; //@ assert i<100; i++; } } frama-c-20.0-Calcium/tests/syntax/unspecified_access_address.i0000666000000000000000000000063613571573400021406 0ustar /* run.config STDOPT: +"-kernel-msg-key printer:unspecified" */ int f(int *p, int x) { *p = x + 1; return x; } int g() { int x = 3; int y = f(&x, ++x); // correct: we're not reading x, but &x int a[10] = { 0 }; int *b = a; int z = f(&b[x], b[2]); int t = f(&b[x], ++x); // incorrect: write and read access to x; int u = f(&b[2], *(b++)); // incorrect: write and read access to b; return y; } frama-c-20.0-Calcium/tests/syntax/unspecified_access_call_bts0888.i0000666000000000000000000000037313571573400022072 0ustar /* run.config STDOPT: +"-unspecified-access" */ int f(int); int main(){ int x,y,z; x = f(x=2); // not unspecified y = (x=f(y=2))+(z=3); // not unspecified z = (x=f(y=2))+y; // unspecified y = (x=f(y=2))+(y=3); // unspecified return 0; } frama-c-20.0-Calcium/tests/syntax/unspecified_access_if_bts01114.i0000666000000000000000000000022113571573400021604 0ustar /* run.config STDOPT: +"-unspecified-access" */ int x, *p; int main(){ p = &x; *p = (*p < 3); if (*p = (*p < 3)) x = 4; return 0; } frama-c-20.0-Calcium/tests/syntax/unspecified_access_ptr_bts1519.i0000666000000000000000000000034213571573400021750 0ustar /* run.config STDOPT: +"-kernel-msg-key printer:unspecified" */ int t[10]; int u[10]; int v[10]; int i = 4; int j = 0; void main() { int *p1 = &v[i]; int *p2 = &v[j]; t[i] += (*p1)++ + *p2; t[i] += v[i]++ + v[j]; } frama-c-20.0-Calcium/tests/syntax/unspecified_access_struct.i0000666000000000000000000000021213571573400021273 0ustar struct S { int f; }; int main () { struct S s1 = { 0 }; struct S s2, s3, s4,s5; s2.f = s3.f = s4.f = s5.f = s1.f; return s2.f; } frama-c-20.0-Calcium/tests/syntax/va.c0000666000000000000000000000063113571573400014455 0ustar #include "stdarg.h" #include "stdio.h" // error locals have same scope void h () { int x = 1; int x = 2; } // error: formal x and local x have the same scope, hence can't have the // same name. void g(int x) { int x = 1; } // error: formal x is shadowed by local x, hence can't be seen by va_start void f(int x, ...) { { int x,y; va_list p; va_start(p,x); vscanf("FOO %d %d",p); } } frama-c-20.0-Calcium/tests/syntax/variadic.i0000666000000000000000000000105313571573400015636 0ustar int normal(int n); int vf(int x, ...); typedef char tt; struct T {int a;} st; tt abstract; unsigned char uchar; signed char chr; unsigned short ushort; unsigned long long ll; long double ld; double d; void h(); void g() { vf(1,1u,uchar,3.0f, ushort, ll, abstract, st, ld,d); // vf() is variadic: the default argument promotions apply after the initial // arguments. C99 6.5.2.2:7 f(1,uchar); // f undeclared, default argument promotions apply C99 6.5.2.2:6 h(1,uchar); // h declared but without a prototype: C99 6.5.2.2:6 normal(uchar); } frama-c-20.0-Calcium/tests/syntax/vdefined_bts1241.i0000666000000000000000000000024513571573400017022 0ustar /* run.config STDOPT: +"tests/syntax/vdefined_bts1241_1.i" */ int f(); int g() { return 0; } int f() { return 1; } int g(); int h(); int h1() { return h(); } frama-c-20.0-Calcium/tests/syntax/vdefined_bts1241_1.i0000666000000000000000000000015213571573400017237 0ustar /* run.config DONTRUN: main test at tests/syntax/vdefined_bts1241.i */ int f(); int h() { return f(); } frama-c-20.0-Calcium/tests/syntax/vdescr_bts1387.i0000666000000000000000000000112413571573400016534 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs */ int f(int); int g(int); int (*fptr)(int); int main(int j, int k) { int a, b, c, d, *p, t[2]; a = 1 + j++; p = j ? &j : &k; a = (*p) + 1; a = (*p) + 1; a = (*p++) + 1; p--; a = (*p++) + 1; p--; b = ++j + 1; c = f(j) + g(j); d = 3 + *(k?&j:(int*)0); d = 100 / j; fptr = f; if (d & 1) (*fptr)(1); if (d & 2) t[0] = t[1] + 1; t[d & 4] = j; j = t[d & 8]; { int l; p = &l; } if (d & 16) *p = 1; return j; } frama-c-20.0-Calcium/tests/syntax/vdescr_bts1387.ml0000666000000000000000000000060513571573400016717 0ustar open Cil_types class print_vdescr = object inherit Visitor.frama_c_inplace method! vvdec vi = Kernel.feedback "Variable %a has vdescr '%a'" Printer.pp_varinfo vi (Pretty_utils.pp_opt Format.pp_print_string) vi.vdescr; Cil.SkipChildren end let run () = Visitor.visitFramacFileSameGlobals (new print_vdescr) (Ast.get()) let () = Db.Main.extend run frama-c-20.0-Calcium/tests/syntax/visit_create_local.i0000666000000000000000000000027513571573400017714 0ustar /* run.config EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs OPT: -no-autoload-plugins -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -then-on bidon -print */ void main() { int x,y; x = y; } frama-c-20.0-Calcium/tests/syntax/visit_create_local.ml0000666000000000000000000000172613571573400020076 0ustar open Cil_types open Cil class cF = object(self) inherit Visitor.frama_c_inplace method! vstmt s = let fd = (Extlib.the self#current_func) in match s.skind with | Instr (Set (lv,e,loc)) -> let vi = makeLocalVar fd "varbidon" (typeOf e) in let sk = Instr (Set (var vi,new_exp ~loc (Lval lv),loc)) in let s0 = mkStmt ~valid_sid:true sk in ChangeTo (Cil.mkStmtCfgBlock [s0; s]) | _ -> SkipChildren end let run () = Visitor.visitFramacFileSameGlobals (new cF) (Ast.get()); Cfg.clearFileCFG ~clear_id:false (Ast.get()); Cfg.computeFileCFG (Ast.get()) module Computed = State_builder.False_ref (struct let name = "Bidon" let dependencies = [] end) let main () = if not (Computed.get ()) then begin Computed.set true; if not (Ast.is_computed()) then Ast.compute(); let prj = File.create_project_from_visitor "bidon" (fun prj -> new Visitor.frama_c_copy prj) in Project.on prj run (); end let () = Db.Main.extend main frama-c-20.0-Calcium/tests/syntax/vla_goto.i0000666000000000000000000000042613571573400015671 0ustar int case2(int arg) { { int a2[arg]; if (arg) goto L; // goto L is invalid, see 6.8.6.1§1 } { int b2[arg]; L: ; /* When execution lands to this point it executes __fc_vla_free(b2) * without executing __fc_vla_alloc first. */ } return 0; } frama-c-20.0-Calcium/tests/syntax/vla_goto2.i0000666000000000000000000000125613571573400015755 0ustar int case2(int arg) { { int a2[arg]; if (arg) goto L; // goto L is valid. } { L: ; // although we are jumping in a block where a vla is defined, // the target of the jump dominates the declaration of the vla // so that it is outside of the scope of the vla and the // program is correctly defined int b2[arg]; } return 0; } int case3(int arg) { int vla[arg]; /* The return under the if is transformed into a goto to a unique return statement. The destructor for vla is inserted before this unique return statement. The goto must be changed to target this destructor. */ if (arg >= 10) return 1; return 0; } frama-c-20.0-Calcium/tests/syntax/vla_goto3.i0000666000000000000000000000027513571573400015756 0ustar volatile int nondet; int main () { int i = 42; if (nondet) goto end; // Invalid goto, as it skips the initialization of vla. char vla[i]; if (nondet) return 1; end: return 0; } frama-c-20.0-Calcium/tests/syntax/vla_goto_same_block_above.i0000666000000000000000000000052213571573400021221 0ustar volatile int nondet ; int main() { int i = 42 ; toto : ; char vla[i] ; if (nondet) goto toto ; return 0 ; } int f() { int i = 42 ; if (nondet) { toto : ; } char vla[i] ; if (nondet) goto toto ; return 0 ; } int g() { int i = 42 ; char vla[i] ; if (nondet) { toto : ; } if (nondet) goto toto ; return 0 ; } frama-c-20.0-Calcium/tests/syntax/vla_goto_same_block_below.i0000666000000000000000000000030613571573400021235 0ustar volatile int nondet ; int main() { int i = 42; if (nondet) goto toto; // KO: we are jumping over // a constructor/destructor definition char vla[i]; toto: ; return 0; } frama-c-20.0-Calcium/tests/syntax/vla_loop.i0000666000000000000000000000135213571573400015671 0ustar void awhile(int x) { int *p; while(1) { int a1[x]; p = &a1; if (x) break; else continue; } } int f(int i) { if (i > 1) return 1; int vla[i]; return 0; } int g(int c) { int ret; if (c<=0) return 4; int a[c]; a[c-1] = 3; ret = a[c-1]; return ret; } int main(int argc, char **argv) { int *p; switch(argc) { default: { int a[argc]; { while(1) { p = &a; break; } } } } { int b[argc]; while(1) { p = &b; break; } } { int c[argc]; { switch(argc) { case 1: { p = &c; break; } } } } { int d[argc]; { switch(argc) { case 1: { p = &d; } } } } return argc; } frama-c-20.0-Calcium/tests/syntax/vla_strlen.c0000666000000000000000000000016413571573400016221 0ustar #include "string.h" void f(char* s) { char t[strlen(s) + 1]; char* p = t; while(*s) *p++ = *s++; *p = 0; } frama-c-20.0-Calcium/tests/syntax/vla_switch.i0000666000000000000000000000032413571573400016217 0ustar int case3(int arg) { switch(arg) { // Illegal according to 6.8.4.2§2 int b[arg]; case 1: { int *p; p = &b; } case 2: { int a[arg]; if (arg) break; } } } frama-c-20.0-Calcium/tests/syntax/void_parameter.i0000666000000000000000000000042613571573400017060 0ustar /* run.config */ // GCC warning, Clang/CompCert error void f1(void); void f2(void parameter); void f3(void, int x); void f4(void parameter, int x); // GCC/Clang/CompCert error void f1(void){} void f2(void parameter){} void f3(void, int x){} void f4(void parameter, int x){} frama-c-20.0-Calcium/tests/syntax/volatile_clause.i0000666000000000000000000000434313571573400017234 0ustar typedef volatile unsigned Vunsigned; unsigned g(Vunsigned * q); unsigned f(volatile unsigned * q); volatile unsigned *p = (volatile unsigned *)(0x4); //@ volatile *p reads g; //@ volatile *((Vunsigned *)(0x4)) reads f; //@ volatile *((unsigned volatile *)(0x6)) reads f; Vunsigned f1(Vunsigned * q); Vunsigned g1(volatile unsigned * q); volatile unsigned *pf1, *pg1, *pg; //@ volatile *pg reads g; //@ volatile *pf1 reads f1; //@ volatile *pg1 reads g1; typedef const int Cint ; volatile Cint ci1, ci2, ci3, ci4; Cint rd_ci1 (Cint volatile *p) ; Cint rd_ci2 (const int volatile *p) ; int rd_ci3 (Cint volatile *p) ; int rd_ci4 (const int volatile *p) ; //@ volatile ci1 reads rd_ci1; //@ volatile ci2 reads rd_ci2; //@ volatile ci3 reads rd_ci3; //@ volatile ci4 reads rd_ci4; Cint wr_ci1 (Cint volatile *p, Cint v) ; Cint wr_ci2 (const int volatile *p, Cint v) ; int wr_ci3 (Cint volatile *p, Cint v) ; int wr_ci4 (const int volatile *p, Cint v) ; //@ volatile ci1 writes wr_ci1; //@ volatile ci2 writes wr_ci2; //@ volatile ci3 writes wr_ci3; //@ volatile ci4 writes wr_ci4; volatile Cint ci10, ci20, ci30, ci40; Cint wr_ci10 (Cint volatile *p, int v) ; Cint wr_ci20 (const int volatile *p, int v) ; int wr_ci30 (Cint volatile *p, int v) ; int wr_ci40 (const int volatile *p, int v) ; //@ volatile ci10 writes wr_ci10; //@ volatile ci20 writes wr_ci20; //@ volatile ci30 writes wr_ci30; //@ volatile ci40 writes wr_ci40; volatile Cint ci100, ci200, ci300, ci400; Cint wr_ci100 (Cint volatile *p, const int v) ; Cint wr_ci200 (const int volatile *p, const int v) ; int wr_ci300 (Cint volatile *p, const int v) ; int wr_ci400 (const int volatile *p, const int v) ; //@ volatile ci100 writes wr_ci100; //@ volatile ci200 writes wr_ci200; //@ volatile ci300 writes wr_ci300; //@ volatile ci400 writes wr_ci400; typedef enum { e=-1} Enum; volatile Enum e3; Enum wr_e3 (Enum volatile *p, const Enum v) ; //@ volatile e3 writes wr_e3; Enum fe(Enum a); void ge(void) { e3 = fe(e3); } typedef const Enum CEnum ; volatile CEnum ce1, ce2, ce3, ce4; CEnum wr_ce1 (CEnum volatile *p, const Enum v) ; CEnum wr_ce2 (const Enum volatile *p, const Enum v) ; Enum wr_ce3 (CEnum volatile *p, const Enum v) ; Enum wr_ce4 (const Enum volatile *p, const Enum v) ; frama-c-20.0-Calcium/tests/test/0000777000000000000000000000000013571573400013334 5ustar frama-c-20.0-Calcium/tests/test/adpcm.c0000666000000000000000000004707113571573400014575 0ustar /*************************************************************************/ /* */ /* SNU-RT Benchmark Suite for Worst Case Timing Analysis */ /* ===================================================== */ /* Collected and Modified by S.-S. Lim */ /* sslim@archi.snu.ac.kr */ /* Real-Time Research Group */ /* Seoul National University */ /* */ /* */ /* < Features > - restrictions for our experimental environment */ /* */ /* 1. Completely structured. */ /* - There are no unconditional jumps. */ /* - There are no exit from loop bodies. */ /* (There are no 'break' or 'return' in loop bodies) */ /* 2. No 'switch' statements. */ /* 3. No 'do..while' statements. */ /* 4. Expressions are restricted. */ /* - There are no multiple expressions joined by 'or', */ /* 'and' operations. */ /* 5. No library calls. */ /* - All the functions needed are implemented in the */ /* source file. */ /* */ /* */ /*************************************************************************/ /* */ /* FILE: adpcm.c */ /* SOURCE : C Algorithms for Real-Time DSP by P. M. Embree */ /* */ /* DESCRIPTION : */ /* */ /* CCITT G.722 ADPCM (Adaptive Differential Pulse Code Modulation) */ /* algorithm. */ /* 16khz sample rate data is stored in the array test_data[SIZE]. */ /* Results are stored in the array compressed[SIZE] and result[SIZE].*/ /* Execution time is determined by the constant SIZE (default value */ /* is 2000). */ /* */ /* REMARK : */ /* */ /* EXECUTION TIME : */ /* */ /* */ /*************************************************************************/ /* common sampling rate for sound cards on IBM/PC */ /* PATHCRAWLER ##define SAMPLE_RATE 11025 */ /* PATHCRAWLER #define PI 3.14159265358979323846 */ /* COMPLEX STRUCTURE */ /* PATHCRAWLER typedef struct { float real, imag; } COMPLEX; */ /* function prototypes for fft and filter functions */ /* PATHCRAWLER void fft(COMPLEX *,int); float fir_filter(float input,float *coef,int n,float *history); float iir_filter(float input,float *coef,int n,float *history); float gaussian(void); void setup_codec(int),key_down(),int_enable(),int_disable(); int flags(int); float getinput(void); void sendout(float),flush(); */ int encode(int,int); int filtez(int *bpl,int *dlt); void upzero(int dlt,int *dlti,int *bli); int filtep(int rlt1,int al1,int rlt2,int al2); int quantl(int el,int detl); int invqxl(int il,int detl,int *code_table,int mode); int logscl(int il,int nbl); int scalel(int nbl,int shift_constant); int uppol2(int al1,int al2,int plt,int plt1,int plt2); int uppol1(int al1,int apl2,int plt,int plt1); int invqah(int ih,int deth); int logsch(int ih,int nbh); /* G722 C code */ /* variables for transimit quadrature mirror filter here */ int tqmf[24]; /* QMF filter coefficients: scaled by a factor of 4 compared to G722 CCITT recomendation */ int h[24] = { 12, -44, -44, 212, 48, -624, 128, 1448, -840, -3220, 3804, 15504, 15504, 3804, -3220, -840, 1448, 128, -624, 48, 212, -44, -44, 12 }; int xl,xh; /* variables for receive quadrature mirror filter here */ int accumc[11],accumd[11]; /* outputs of decode() */ int xout1,xout2; int xs,xd; /* variables for encoder (hi and lo) here */ int il,szl,spl,sl,el; int qq4_code4_table[16] = { 0, -20456, -12896, -8968, -6288, -4240, -2584, -1200, 20456, 12896, 8968, 6288, 4240, 2584, 1200, 0 }; int qq5_code5_table[32] = { -280, -280, -23352, -17560, -14120, -11664, -9752, -8184, -6864, -5712, -4696, -3784, -2960, -2208, -1520, -880, 23352, 17560, 14120, 11664, 9752, 8184, 6864, 5712, 4696, 3784, 2960, 2208, 1520, 880, 280, -280 }; int qq6_code6_table[64] = { -136, -136, -136, -136, -24808, -21904, -19008, -16704, -14984, -13512, -12280, -11192, -10232, -9360, -8576, -7856, -7192, -6576, -6000, -5456, -4944, -4464, -4008, -3576, -3168, -2776, -2400, -2032, -1688, -1360, -1040, -728, 24808, 21904, 19008, 16704, 14984, 13512, 12280, 11192, 10232, 9360, 8576, 7856, 7192, 6576, 6000, 5456, 4944, 4464, 4008, 3576, 3168, 2776, 2400, 2032, 1688, 1360, 1040, 728, 432, 136, -432, -136 }; int delay_bpl[6]; int delay_dltx[6]; int wl_code_table[16] = { -60, 3042, 1198, 538, 334, 172, 58, -30, 3042, 1198, 538, 334, 172, 58, -30, -60 }; int wl_table[8] = { -60, -30, 58, 172, 334, 538, 1198, 3042 }; int ilb_table[32] = { 2048, 2093, 2139, 2186, 2233, 2282, 2332, 2383, 2435, 2489, 2543, 2599, 2656, 2714, 2774, 2834, 2896, 2960, 3025, 3091, 3158, 3228, 3298, 3371, 3444, 3520, 3597, 3676, 3756, 3838, 3922, 4008 }; int nbl; /* delay line */ int al1,al2; int plt,plt1,plt2; int rs; int dlt; int rlt,rlt1,rlt2; /* decision levels - pre-multiplied by 8, 0 to indicate end */ int decis_levl[30] = { 280, 576, 880, 1200, 1520, 1864, 2208, 2584, 2960, 3376, 3784, 4240, 4696, 5200, 5712, 6288, 6864, 7520, 8184, 8968, 9752, 10712, 11664, 12896, 14120, 15840, 17560, 20456, 23352, 32767 }; int detl; /* quantization table 31 long to make quantl look-up easier, last entry is for mil=30 case when wd is max */ int quant26bt_pos[31] = { 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 32 }; /* quantization table 31 long to make quantl look-up easier, last entry is for mil=30 case when wd is max */ int quant26bt_neg[31] = { 63, 62, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 4 }; int deth; int sh; /* this comes from adaptive predictor */ int eh; int qq2_code2_table[4] = { -7408, -1616, 7408, 1616 }; int wh_code_table[4] = { 798, -214, 798, -214 }; int dh,ih; int nbh,szh; int sph,ph,yh,rh; int delay_dhx[6]; int delay_bph[6]; int ah1,ah2; int ph1,ph2; int rh1,rh2; /* variables for decoder here */ int ilr,yl,rl; int dec_deth,dec_detl,dec_dlt; int dec_del_bpl[6]; int dec_del_dltx[6]; int dec_plt,dec_plt1,dec_plt2; int dec_szl,dec_spl,dec_sl; int dec_rlt1,dec_rlt2,dec_rlt; int dec_al1,dec_al2; int dl; int dec_nbl,dec_yh,dec_dh,dec_nbh; /* variables used in filtez */ int dec_del_bph[6]; int dec_del_dhx[6]; int dec_szh; /* variables used in filtep */ int dec_rh1,dec_rh2; int dec_ah1,dec_ah2; int dec_ph,dec_sph; int dec_sh,dec_rh; int dec_ph1,dec_ph2; /* G722 encode function two ints in, one 8 bit output */ /* put input samples in xin1 = first value, xin2 = second value */ /* returns il and ih stored together */ int abs(int x ) { int m ; if (x >= 0) { m = x; } else { m = - x; } return (m); } /*@ ensures sh == 0 || sh == -2; */ int encode(int xin1,int xin2) { int i; int *h_ptr,*tqmf_ptr,*tqmf_ptr1; long int xa,xb; int decis; /* transmit quadrature mirror filters implemented here */ h_ptr = h; tqmf_ptr = tqmf; xa = (long)(*tqmf_ptr++) * (*h_ptr++); xb = (long)(*tqmf_ptr++) * (*h_ptr++); /*@ loop pragma UNROLL 11; */ /* main multiply accumulate loop for samples and coefficients */ for(i = 0 ; i < 10 ; i++) { xa += (long)(*tqmf_ptr++) * (*h_ptr++); xb += (long)(*tqmf_ptr++) * (*h_ptr++); } /* final mult/accumulate */ xa += (long)(*tqmf_ptr++) * (*h_ptr++); xb += (long)(*tqmf_ptr) * (*h_ptr++); /* update delay line tqmf */ tqmf_ptr1 = tqmf_ptr - 2; /*@ loop pragma UNROLL 23; */ for(i = 0 ; i < 22 ; i++) *tqmf_ptr-- = *tqmf_ptr1--; *tqmf_ptr-- = xin1; *tqmf_ptr = xin2; /* scale outputs */ xl = (xa + xb) >> 15; xh = (xa - xb) >> 15; /* end of quadrature mirror filter code */ /* starting with lower sub band encoder */ /* filtez - compute predictor output section - zero section */ szl = filtez(delay_bpl,delay_dltx); /* filtep - compute predictor output signal (pole section) */ spl = filtep(rlt1,al1,rlt2,al2); /* compute the predictor output value in the lower sub_band encoder */ sl = szl + spl; el = xl - sl; /* quantl: quantize the difference signal */ il = quantl(el,detl); /* CONDITIONS: 30 x 4 possibilities */ /* invqxl: computes quantized difference signal */ /* for invqbl, truncate by 2 lsbs, so mode = 3 */ dlt = ((long)detl*qq4_code4_table[il >> 2]) >> 15; /* logscl: updates logarithmic quant. scale factor in low sub band */ nbl = logscl(il,nbl); /* CONDITIONS: 2 possibs */ /* scalel: compute the quantizer scale factor in the lower sub band */ /* calling parameters nbl and 8 (constant such that scalel can be scaleh) */ detl = scalel(nbl,8); /* parrec - simple addition to compute recontructed signal for adaptive pred */ plt = dlt + szl; /* upzero: update zero section predictor coefficients (sixth order)*/ /* calling parameters: dlt, dlt1, dlt2, ..., dlt6 from dlt */ /* bpli (linear_buffer in which all six values are delayed */ /* return params: updated bpli, delayed dltx */ upzero(dlt,delay_dltx,delay_bpl); /* CONDITIONS: 2exp6 possibs */ /* uppol2- update second predictor coefficient apl2 and delay it as al2 */ /* calling parameters: al1, al2, plt, plt1, plt2 */ al2 = uppol2(al1,al2,plt,plt1,plt2); /* CONDITION: 2 possibs */ /* uppol1 :update first predictor coefficient apl1 and delay it as al1 */ /* calling parameters: al1, apl2, plt, plt1 */ al1 = uppol1(al1,al2,plt,plt1); /* CONDITIONS: 8 possibs */ /* recons : compute recontructed signal for adaptive predictor */ rlt = sl + dlt; /* done with lower sub_band encoder; now implement delays for next time*/ rlt2 = rlt1; rlt1 = rlt; plt2 = plt1; plt1 = plt; /* high band encode */ szh = filtez(delay_bph,delay_dhx); sph = filtep(rh1,ah1,rh2,ah2); /* predic: sh = sph + szh */ sh = sph + szh; /* subtra: eh = xh - sh */ eh = xh - sh; /* quanth - quantization of difference signal for higher sub-band */ /* quanth: in-place for speed params: eh, deth (has init. value) */ if(eh >= 0) { /* CONDITION */ ih = 3; /* 2,3 are pos codes */ } else { ih = 1; /* 0,1 are neg codes */ } decis = (564L*(long)deth) >> 12L; if(abs(eh) > decis) ih--; /* mih = 2 case */ /* CONDITIONS: 2 possibs */ /* invqah: compute the quantized difference signal, higher sub-band*/ dh = ((long)deth*qq2_code2_table[ih]) >> 15L ; /* logsch: update logarithmic quantizer scale factor in hi sub-band*/ nbh = logsch(ih,nbh); /* note : scalel and scaleh use same code, different parameters */ deth = scalel(nbh,10); /* parrec - add pole predictor output to quantized diff. signal */ ph = dh + szh; /* upzero: update zero section predictor coefficients (sixth order) */ /* calling parameters: dh, dhi, bphi */ /* return params: updated bphi, delayed dhx */ upzero(dh,delay_dhx,delay_bph); /* CONDITIONS: 2exp6 possibs */ /* uppol2: update second predictor coef aph2 and delay as ah2 */ /* calling params: ah1, ah2, ph, ph1, ph2 */ ah2 = uppol2(ah1,ah2,ph,ph1,ph2); /* CONDITION: 2 possibs */ /* uppol1: update first predictor coef. aph2 and delay it as ah1 */ ah1 = uppol1(ah1,ah2,ph,ph1); /* CONDITIONS: 8 possibs */ /* recons for higher sub-band */ yh = sh + dh; /* done with higher sub-band encoder, now Delay for next time */ rh2 = rh1; rh1 = yh; ph2 = ph1; ph1 = ph; /* multiplex ih and il to get signals together */ return(il | (ih << 6)); } /* filtez - compute predictor output signal (zero section) */ /* input: bpl1-6 and dlt1-6, output: szl */ int filtez(int *bpl,int *dlt) { int i; long int zl; zl = (long)(*bpl++) * (*dlt++); /*@ loop pragma UNROLL 7; */ for(i = 1 ; i < 6 ; i++) zl += (long)(*bpl++) * (*dlt++); return((int)(zl >> 14)); /* x2 here */ } /* filtep - compute predictor output signal (pole section) */ /* input rlt1-2 and al1-2, output spl */ int filtep(int rlt1,int al1,int rlt2,int al2) { long int pl,pl2; pl = 2*rlt1; pl = (long)al1*pl; pl2 = 2*rlt2; pl += (long)al2*pl2; return((int)(pl >> 15)); } /* quantl - quantize the difference signal in the lower sub-band */ int quantl(int el,int detl) { int ril,mil; long int wd,decis; /* abs of difference signal */ wd = abs(el); /* determine mil based on decision levels and detl gain */ /* for(mil = 0 ; mil < 30 ; mil++) { decis = (decis_levl[mil]*(long)detl) >> 15L; if(wd <= decis) break; }*/ mil = 0; decis = (decis_levl[mil]*(long)detl) >> 15L; /*@ loop pragma UNROLL 30; */ while(wd <= decis && mil < 29) { /* FOR/BREAK 662 : 30 possibilities */ mil++; decis = (decis_levl[mil]*(long)detl) >> 15L; } /* if mil=30 then wd is less than all decision levels */ if(el >= 0) ril = quant26bt_pos[mil]; /* CONDITION 665 */ else ril = quant26bt_neg[mil]; return(ril); } /* invqxl is either invqbl or invqal depending on parameters passed */ /* returns dlt, code table is pre-multiplied by 8 */ int invqxl(int il,int detl,int *code_table,int mode) { long int dlt; dlt = (long)detl*code_table[il >> (mode-1)]; return((int)(dlt >> 15)); } /* logscl - update log quantizer scale factor in lower sub-band */ /* note that nbl is passed and returned */ int logscl(int il,int nbl) { long int wd; wd = ((long)nbl * 127L) >> 7L; /* leak factor 127/128 */ nbl = (int)wd + wl_code_table[il >> 2]; if(nbl < 0) nbl = 0; /* CONDITION */ if(nbl > 18432) nbl = 18432; /* CONDITION */ return(nbl); } /* scalel: compute quantizer scale factor in lower or upper sub-band*/ int scalel(int nbl,int shift_constant) { int wd1,wd2,wd3; wd1 = (nbl >> 6) & 31; wd2 = nbl >> 11; wd3 = ilb_table[wd1] >> (shift_constant + 1 - wd2); return(wd3 << 3); } /* upzero - inputs: dlt, dlti[0-5], bli[0-5], outputs: updated bli[0-5] */ /* also implements delay of bli and update of dlti from dlt */ void upzero(int dlt,int *dlti,int *bli) { int i,wd2,wd3; /*if dlt is zero, then no sum into bli */ if(dlt == 0) { /* CONDITION 711 */ /*@ loop pragma UNROLL 7; */ for(i = 0 ; i < 6 ; i++) { bli[i] = (int)((255L*bli[i]) >> 8L); /* leak factor of 255/256 */ } } else { /*@ loop pragma UNROLL 7; */ for(i = 0 ; i < 6 ; i++) { if((long)dlt*dlti[i] >= 0) wd2 = 128; else wd2 = -128; /* CONDITION 718 : 2exp6 possibs */ wd3 = (int)((255L*bli[i]) >> 8L); /* leak factor of 255/256 */ bli[i] = wd2 + wd3; } } /* implement delay line for dlt */ dlti[5] = dlti[4]; dlti[4] = dlti[3]; dlti[3] = dlti[2]; dlti[1] = dlti[0]; dlti[0] = dlt; } /* uppol2 - update second predictor coefficient (pole section) */ /* inputs: al1, al2, plt, plt1, plt2. outputs: apl2 */ int uppol2(int al1,int al2,int plt,int plt1,int plt2) { long int wd2,wd4; int apl2; wd2 = 4L*(long)al1; if((long)plt*plt1 >= 0L) wd2 = -wd2; /* check same sign */ /* CONDITION */ wd2 = wd2 >> 7; /* gain of 1/128 */ if((long)plt*plt2 >= 0L) { /* CONDITION */ wd4 = wd2 + 128; /* same sign case */ } else { wd4 = wd2 - 128; } apl2 = wd4 + (127L*(long)al2 >> 7L); /* leak factor of 127/128 */ /* apl2 is limited to +-.75 */ if(apl2 > 12288) apl2 = 12288; /* CONDITION */ if(apl2 < -12288) apl2 = -12288; /* CONDITION */ return(apl2); } /* uppol1 - update first predictor coefficient (pole section) */ /* inputs: al1, apl2, plt, plt1. outputs: apl1 */ int uppol1(int al1,int apl2,int plt,int plt1) { long int wd2; int wd3,apl1; wd2 = ((long)al1*255L) >> 8L; /* leak factor of 255/256 */ if((long)plt*plt1 >= 0L) { /* CONDITION */ apl1 = (int)wd2 + 192; /* same sign case */ } else { apl1 = (int)wd2 - 192; } /* note: wd3= .9375-.75 is always positive */ wd3 = 15360 - apl2; /* limit value */ if(apl1 > wd3) apl1 = wd3; /* CONDITION */ if(apl1 < -wd3) apl1 = -wd3; /* CONDITION */ return(apl1); } /* INVQAH: inverse adaptive quantizer for the higher sub-band */ /* returns dh, code table is pre-multiplied by 8 */ int invqah(int ih,int deth) { long int rdh; rdh = ((long)deth*qq2_code2_table[ih]) >> 15L ; return((int)(rdh )); } /* logsch - update log quantizer scale factor in higher sub-band */ /* note that nbh is passed and returned */ int logsch(int ih,int nbh) { int wd; wd = ((long)nbh * 127L) >> 7L; /* leak factor 127/128 */ nbh = wd + wh_code_table[ih]; if(nbh < 0) nbh = 0; /* CONDITION */ if(nbh > 22528) nbh = 22528; /* CONDITION */ return(nbh); } /* PATHCRAWLER #define SIZE 2000 #define IN_END 2000 */ /* PATHCRAWLER #define PI 3.14159265358979323846 */ /* PATHCRAWLER void main() */ int test_data[10]={1,0,1,0,1,1,1,1,1,1}; int compressed[10]={0}; void main () //(int test_data[10], int compressed[10]) { int i; /*@ loop pragma UNROLL 11; loop pragma WIDEN_HINTS 32767; */ /* Better bounds: loop invariant detl <= 32064; loop invariant nbh <= 22528; loop invariant nbl <= 18432; */ for(i = 0 ; i < 10 ; i += 2) compressed[i/2] = encode(test_data[i],test_data[i+1]); } frama-c-20.0-Calcium/tests/test/oracle/0000777000000000000000000000000013571573400014601 5ustar frama-c-20.0-Calcium/tests/test/oracle/adpcm.res.oracle0000666000000000000000000023430613571573400017654 0ustar [kernel] Parsing tests/test/adpcm.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization tqmf[0..23] ∈ {0} h[0] ∈ {12} [1..2] ∈ {-44} [3] ∈ {212} [4] ∈ {48} [5] ∈ {-624} [6] ∈ {128} [7] ∈ {1448} [8] ∈ {-840} [9] ∈ {-3220} [10] ∈ {3804} [11..12] ∈ {15504} [13] ∈ {3804} [14] ∈ {-3220} [15] ∈ {-840} [16] ∈ {1448} [17] ∈ {128} [18] ∈ {-624} [19] ∈ {48} [20] ∈ {212} [21..22] ∈ {-44} [23] ∈ {12} xl ∈ {0} xh ∈ {0} accumc[0..10] ∈ {0} accumd[0..10] ∈ {0} xout1 ∈ {0} xout2 ∈ {0} xs ∈ {0} xd ∈ {0} il ∈ {0} szl ∈ {0} spl ∈ {0} sl ∈ {0} el ∈ {0} qq4_code4_table[0] ∈ {0} [1] ∈ {-20456} [2] ∈ {-12896} [3] ∈ {-8968} [4] ∈ {-6288} [5] ∈ {-4240} [6] ∈ {-2584} [7] ∈ {-1200} [8] ∈ {20456} [9] ∈ {12896} [10] ∈ {8968} [11] ∈ {6288} [12] ∈ {4240} [13] ∈ {2584} [14] ∈ {1200} [15] ∈ {0} qq5_code5_table[0..1] ∈ {-280} [2] ∈ {-23352} [3] ∈ {-17560} [4] ∈ {-14120} [5] ∈ {-11664} [6] ∈ {-9752} [7] ∈ {-8184} [8] ∈ {-6864} [9] ∈ {-5712} [10] ∈ {-4696} [11] ∈ {-3784} [12] ∈ {-2960} [13] ∈ {-2208} [14] ∈ {-1520} [15] ∈ {-880} [16] ∈ {23352} [17] ∈ {17560} [18] ∈ {14120} [19] ∈ {11664} [20] ∈ {9752} [21] ∈ {8184} [22] ∈ {6864} [23] ∈ {5712} [24] ∈ {4696} [25] ∈ {3784} [26] ∈ {2960} [27] ∈ {2208} [28] ∈ {1520} [29] ∈ {880} [30] ∈ {280} [31] ∈ {-280} qq6_code6_table[0..3] ∈ {-136} [4] ∈ {-24808} [5] ∈ {-21904} [6] ∈ {-19008} [7] ∈ {-16704} [8] ∈ {-14984} [9] ∈ {-13512} [10] ∈ {-12280} [11] ∈ {-11192} [12] ∈ {-10232} [13] ∈ {-9360} [14] ∈ {-8576} [15] ∈ {-7856} [16] ∈ {-7192} [17] ∈ {-6576} [18] ∈ {-6000} [19] ∈ {-5456} [20] ∈ {-4944} [21] ∈ {-4464} [22] ∈ {-4008} [23] ∈ {-3576} [24] ∈ {-3168} [25] ∈ {-2776} [26] ∈ {-2400} [27] ∈ {-2032} [28] ∈ {-1688} [29] ∈ {-1360} [30] ∈ {-1040} [31] ∈ {-728} [32] ∈ {24808} [33] ∈ {21904} [34] ∈ {19008} [35] ∈ {16704} [36] ∈ {14984} [37] ∈ {13512} [38] ∈ {12280} [39] ∈ {11192} [40] ∈ {10232} [41] ∈ {9360} [42] ∈ {8576} [43] ∈ {7856} [44] ∈ {7192} [45] ∈ {6576} [46] ∈ {6000} [47] ∈ {5456} [48] ∈ {4944} [49] ∈ {4464} [50] ∈ {4008} [51] ∈ {3576} [52] ∈ {3168} [53] ∈ {2776} [54] ∈ {2400} [55] ∈ {2032} [56] ∈ {1688} [57] ∈ {1360} [58] ∈ {1040} [59] ∈ {728} [60] ∈ {432} [61] ∈ {136} [62] ∈ {-432} [63] ∈ {-136} delay_bpl[0..5] ∈ {0} delay_dltx[0..5] ∈ {0} wl_code_table[0] ∈ {-60} [1] ∈ {3042} [2] ∈ {1198} [3] ∈ {538} [4] ∈ {334} [5] ∈ {172} [6] ∈ {58} [7] ∈ {-30} [8] ∈ {3042} [9] ∈ {1198} [10] ∈ {538} [11] ∈ {334} [12] ∈ {172} [13] ∈ {58} [14] ∈ {-30} [15] ∈ {-60} wl_table[0] ∈ {-60} [1] ∈ {-30} [2] ∈ {58} [3] ∈ {172} [4] ∈ {334} [5] ∈ {538} [6] ∈ {1198} [7] ∈ {3042} ilb_table[0] ∈ {2048} [1] ∈ {2093} [2] ∈ {2139} [3] ∈ {2186} [4] ∈ {2233} [5] ∈ {2282} [6] ∈ {2332} [7] ∈ {2383} [8] ∈ {2435} [9] ∈ {2489} [10] ∈ {2543} [11] ∈ {2599} [12] ∈ {2656} [13] ∈ {2714} [14] ∈ {2774} [15] ∈ {2834} [16] ∈ {2896} [17] ∈ {2960} [18] ∈ {3025} [19] ∈ {3091} [20] ∈ {3158} [21] ∈ {3228} [22] ∈ {3298} [23] ∈ {3371} [24] ∈ {3444} [25] ∈ {3520} [26] ∈ {3597} [27] ∈ {3676} [28] ∈ {3756} [29] ∈ {3838} [30] ∈ {3922} [31] ∈ {4008} nbl ∈ {0} al1 ∈ {0} al2 ∈ {0} plt ∈ {0} plt1 ∈ {0} plt2 ∈ {0} rs ∈ {0} dlt ∈ {0} rlt ∈ {0} rlt1 ∈ {0} rlt2 ∈ {0} decis_levl[0] ∈ {280} [1] ∈ {576} [2] ∈ {880} [3] ∈ {1200} [4] ∈ {1520} [5] ∈ {1864} [6] ∈ {2208} [7] ∈ {2584} [8] ∈ {2960} [9] ∈ {3376} [10] ∈ {3784} [11] ∈ {4240} [12] ∈ {4696} [13] ∈ {5200} [14] ∈ {5712} [15] ∈ {6288} [16] ∈ {6864} [17] ∈ {7520} [18] ∈ {8184} [19] ∈ {8968} [20] ∈ {9752} [21] ∈ {10712} [22] ∈ {11664} [23] ∈ {12896} [24] ∈ {14120} [25] ∈ {15840} [26] ∈ {17560} [27] ∈ {20456} [28] ∈ {23352} [29] ∈ {32767} detl ∈ {0} quant26bt_pos[0] ∈ {61} [1] ∈ {60} [2] ∈ {59} [3] ∈ {58} [4] ∈ {57} [5] ∈ {56} [6] ∈ {55} [7] ∈ {54} [8] ∈ {53} [9] ∈ {52} [10] ∈ {51} [11] ∈ {50} [12] ∈ {49} [13] ∈ {48} [14] ∈ {47} [15] ∈ {46} [16] ∈ {45} [17] ∈ {44} [18] ∈ {43} [19] ∈ {42} [20] ∈ {41} [21] ∈ {40} [22] ∈ {39} [23] ∈ {38} [24] ∈ {37} [25] ∈ {36} [26] ∈ {35} [27] ∈ {34} [28] ∈ {33} [29..30] ∈ {32} quant26bt_neg[0] ∈ {63} [1] ∈ {62} [2] ∈ {31} [3] ∈ {30} [4] ∈ {29} [5] ∈ {28} [6] ∈ {27} [7] ∈ {26} [8] ∈ {25} [9] ∈ {24} [10] ∈ {23} [11] ∈ {22} [12] ∈ {21} [13] ∈ {20} [14] ∈ {19} [15] ∈ {18} [16] ∈ {17} [17] ∈ {16} [18] ∈ {15} [19] ∈ {14} [20] ∈ {13} [21] ∈ {12} [22] ∈ {11} [23] ∈ {10} [24] ∈ {9} [25] ∈ {8} [26] ∈ {7} [27] ∈ {6} [28] ∈ {5} [29..30] ∈ {4} deth ∈ {0} sh ∈ {0} eh ∈ {0} qq2_code2_table[0] ∈ {-7408} [1] ∈ {-1616} [2] ∈ {7408} [3] ∈ {1616} wh_code_table[0] ∈ {798} [1] ∈ {-214} [2] ∈ {798} [3] ∈ {-214} dh ∈ {0} ih ∈ {0} nbh ∈ {0} szh ∈ {0} sph ∈ {0} ph ∈ {0} yh ∈ {0} rh ∈ {0} delay_dhx[0..5] ∈ {0} delay_bph[0..5] ∈ {0} ah1 ∈ {0} ah2 ∈ {0} ph1 ∈ {0} ph2 ∈ {0} rh1 ∈ {0} rh2 ∈ {0} ilr ∈ {0} yl ∈ {0} rl ∈ {0} dec_deth ∈ {0} dec_detl ∈ {0} dec_dlt ∈ {0} dec_del_bpl[0..5] ∈ {0} dec_del_dltx[0..5] ∈ {0} dec_plt ∈ {0} dec_plt1 ∈ {0} dec_plt2 ∈ {0} dec_szl ∈ {0} dec_spl ∈ {0} dec_sl ∈ {0} dec_rlt1 ∈ {0} dec_rlt2 ∈ {0} dec_rlt ∈ {0} dec_al1 ∈ {0} dec_al2 ∈ {0} dl ∈ {0} dec_nbl ∈ {0} dec_yh ∈ {0} dec_dh ∈ {0} dec_nbh ∈ {0} dec_del_bph[0..5] ∈ {0} dec_del_dhx[0..5] ∈ {0} dec_szh ∈ {0} dec_rh1 ∈ {0} dec_rh2 ∈ {0} dec_ah1 ∈ {0} dec_ah2 ∈ {0} dec_ph ∈ {0} dec_sph ∈ {0} dec_sh ∈ {0} dec_rh ∈ {0} dec_ph1 ∈ {0} dec_ph2 ∈ {0} test_data[0] ∈ {1} [1] ∈ {0} [2] ∈ {1} [3] ∈ {0} [4..9] ∈ {1} compressed[0..9] ∈ {0} [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:301. [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] computing for function abs <- quantl <- encode <- main. Called from tests/test/adpcm.c:444. [eva] Recording results for abs [eva] Done for function abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:352. [eva] Recording results for filtez [eva] Done for function filtez [eva] tests/test/adpcm.c:354: Reusing old results for call to filtep [eva] tests/test/adpcm.c:370: Reusing old results for call to abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:379. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] tests/test/adpcm.c:391: Reusing old results for call to uppol2 [eva] tests/test/adpcm.c:394: Reusing old results for call to uppol1 [eva] tests/test/adpcm.c:262: function encode: postcondition got status valid. [eva] Recording results for encode [eva] Done for function encode [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] tests/test/adpcm.c:301: Reusing old results for call to filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] computing for function abs <- quantl <- encode <- main. Called from tests/test/adpcm.c:444. [eva] Recording results for abs [eva] Done for function abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] tests/test/adpcm.c:331: Reusing old results for call to upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] tests/test/adpcm.c:352: Reusing old results for call to filtez [eva] tests/test/adpcm.c:354: Reusing old results for call to filtep [eva] tests/test/adpcm.c:370: Reusing old results for call to abs [eva] tests/test/adpcm.c:376: Reusing old results for call to logsch [eva] tests/test/adpcm.c:379: Reusing old results for call to scalel [eva] tests/test/adpcm.c:387: Reusing old results for call to upzero [eva] tests/test/adpcm.c:391: Reusing old results for call to uppol2 [eva] tests/test/adpcm.c:394: Reusing old results for call to uppol1 [eva] Recording results for encode [eva] Done for function encode [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] tests/test/adpcm.c:301: Reusing old results for call to filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] tests/test/adpcm.c:444: Reusing old results for call to abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] tests/test/adpcm.c:352: Reusing old results for call to filtez [eva] tests/test/adpcm.c:354: Reusing old results for call to filtep [eva] tests/test/adpcm.c:370: Reusing old results for call to abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] tests/test/adpcm.c:379: Reusing old results for call to scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:391. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:394. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] Recording results for encode [eva] Done for function encode [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:301. [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] computing for function abs <- quantl <- encode <- main. Called from tests/test/adpcm.c:444. [eva] Recording results for abs [eva] Done for function abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:352. [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:354. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function abs <- encode <- main. Called from tests/test/adpcm.c:370. [eva] Recording results for abs [eva] Done for function abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:379. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:391. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:394. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] Recording results for encode [eva] Done for function encode [eva] computing for function encode <- main. Called from tests/test/adpcm.c:608. [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:301. [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:304. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function quantl <- encode <- main. Called from tests/test/adpcm.c:311. [eva] tests/test/adpcm.c:444: Reusing old results for call to abs [eva] Recording results for quantl [eva] Done for function quantl [eva] computing for function logscl <- encode <- main. Called from tests/test/adpcm.c:318. [eva] Recording results for logscl [eva] Done for function logscl [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:322. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:331. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:335. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:339. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] computing for function filtez <- encode <- main. Called from tests/test/adpcm.c:352. [eva] Recording results for filtez [eva] Done for function filtez [eva] computing for function filtep <- encode <- main. Called from tests/test/adpcm.c:354. [eva] Recording results for filtep [eva] Done for function filtep [eva] computing for function abs <- encode <- main. Called from tests/test/adpcm.c:370. [eva] Recording results for abs [eva] Done for function abs [eva] computing for function logsch <- encode <- main. Called from tests/test/adpcm.c:376. [eva] Recording results for logsch [eva] Done for function logsch [eva] computing for function scalel <- encode <- main. Called from tests/test/adpcm.c:379. [eva] Recording results for scalel [eva] Done for function scalel [eva] computing for function upzero <- encode <- main. Called from tests/test/adpcm.c:387. [eva] Recording results for upzero [eva] Done for function upzero [eva] computing for function uppol2 <- encode <- main. Called from tests/test/adpcm.c:391. [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol1 <- encode <- main. Called from tests/test/adpcm.c:394. [eva] Recording results for uppol1 [eva] Done for function uppol1 [eva] Recording results for encode [eva] Done for function encode [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function abs: m ∈ {0; 1; 2} [eva:final-states] Values at end of function filtep: pl ∈ {-2464; -1146; 0; 47584; 56154} pl2 ∈ {-2; 0; 98} __retres ∈ {-1; 0; 1} [eva:final-states] Values at end of function filtez: bpl ∈ {{ &delay_bpl[6] ; &delay_bph[6] }} dlt_0 ∈ {{ &delay_dltx[6] ; &delay_dhx[6] }} i ∈ {6} zl ∈ {-256; -128; 0; 6223; 6272} __retres ∈ {-1; 0} [eva:final-states] Values at end of function logsch: nbh_0 ∈ {0; 577; 798} wd ∈ {0; 791} [eva:final-states] Values at end of function logscl: nbl_0 ∈ {2958; 3042; 5869; 5976; 8865} wd ∈ {0; 2934; 3018; 5823; 5929} [eva:final-states] Values at end of function quantl: ril ∈ {4; 32; 63} mil ∈ {0; 29} wd ∈ {0; 1; 2} decis ∈ {0; 1; 79; 223} [eva:final-states] Values at end of function scalel: wd1 ∈ {0; 9; 10; 12; 14; 15; 27; 29} wd2 ∈ {0; 1; 2; 4} wd3 ∈ {1; 10; 11; 28; 29; 79} __retres ∈ {8; 80; 88; 224; 232; 632} [eva:final-states] Values at end of function uppol1: wd2 ∈ {0; 191; 381; 570; 759} wd3 ∈ {14790; 14890; 14997; 15046; 15111; 15232} apl1 ∈ {192; 383; 573; 762; 951} [eva:final-states] Values at end of function uppol2: wd2 ∈ {-24; -18; -12; -6; 0} wd4 ∈ {-152; 104; 110; 116; 122; 128} apl2 ∈ {128; 249; 314; 363; 470; 570} [eva:final-states] Values at end of function upzero: delay_bpl[0] ∈ {0; 127; 128; 254} [1] ∈ {-2; 0; 127; 128} [2..5] ∈ {0; 127; 128; 254} delay_dltx[0] ∈ {-140; 0; 49} [1] ∈ {0; 49} [2..5] ∈ {0} delay_dhx[0..1] ∈ {-1; 0; 1} [2..5] ∈ {0} delay_bph[0] ∈ {-1; 0; 128} [1..5] ∈ {0; 128; 254; 255} i ∈ {6} wd2 ∈ {128} or UNINITIALIZED wd3 ∈ {0; 126; 127} or UNINITIALIZED [eva:final-states] Values at end of function encode: tqmf[0] ∈ {0; 1} [1] ∈ {1} [2..5] ∈ {0; 1} [6] ∈ {0} [7] ∈ {0; 1} [8] ∈ {0} [9] ∈ {0; 1} [10..23] ∈ {0} xl ∈ {-1; 0} xh ∈ {-1; 0} il ∈ {4; 32; 63} szl ∈ {0} spl ∈ {0; 1} sl ∈ {0; 1} el ∈ {-2; -1; 0} delay_bpl[0] ∈ {0; 127; 128; 254} [1] ∈ {-2; 0; 127; 128} [2..5] ∈ {0; 127; 128; 254} delay_dltx[0] ∈ {-140; 0; 49} [1] ∈ {0; 49} [2..5] ∈ {0} nbl ∈ {2958; 3042; 5869; 5976; 8865} al1 ∈ {192; 383; 573; 762; 951} al2 ∈ {128; 249; 314; 363; 470} plt ∈ {-140; 0; 49} plt1 ∈ {-140; 0; 49} plt2 ∈ {0; 49} dlt ∈ {-140; 0; 49} rlt ∈ {-139; 0; 1; 49} rlt1 ∈ {-139; 0; 1; 49} rlt2 ∈ {0; 1; 49} detl ∈ {80; 88; 224; 232; 632} deth ∈ {8} sh ∈ {-2; 0} eh ∈ {-1; 0; 1; 2} dh ∈ {-1; 0; 1} ih ∈ {1; 2; 3} nbh ∈ {0; 577; 798} szh ∈ {-1; 0} sph ∈ {-1; 0} ph ∈ {-1; 0} yh ∈ {-2; -1; 0} delay_dhx[0..1] ∈ {-1; 0; 1} [2..5] ∈ {0} delay_bph[0] ∈ {-1; 0; 128} [1..5] ∈ {0; 128; 254; 255} ah1 ∈ {192; 383; 573; 762; 951} ah2 ∈ {128; 249; 363; 470; 570} ph1 ∈ {-1; 0} ph2 ∈ {-1; 0} rh1 ∈ {-2; -1; 0} rh2 ∈ {-1; 0} i ∈ {22} h_ptr ∈ {{ &h[24] }} tqmf_ptr ∈ {{ &tqmf[0] }} tqmf_ptr1 ∈ {{ &tqmf[-1] }} xa ∈ {-32; 0; 12} xb ∈ {-456; -44; 0; 168; 992} decis ∈ {0; 1} __retres ∈ {96; 191; 196; 224; 255} [eva:final-states] Values at end of function main: tqmf[0..5] ∈ {1} [6] ∈ {0} [7] ∈ {1} [8] ∈ {0} [9] ∈ {1} [10..23] ∈ {0} xl ∈ {0} xh ∈ {-1} il ∈ {4} szl ∈ {0} spl ∈ {1} sl ∈ {1} el ∈ {-1} delay_bpl[0] ∈ {254} [1] ∈ {-2} [2..5] ∈ {254} delay_dltx[0] ∈ {-140} [1..5] ∈ {0} nbl ∈ {8865} al1 ∈ {951} al2 ∈ {314} plt ∈ {-140} plt1 ∈ {-140} plt2 ∈ {0} dlt ∈ {-140} rlt ∈ {-139} rlt1 ∈ {-139} rlt2 ∈ {1} detl ∈ {632} deth ∈ {8} sh ∈ {-2} eh ∈ {1} dh ∈ {0} ih ∈ {3} nbh ∈ {577} szh ∈ {-1} sph ∈ {-1} ph ∈ {-1} yh ∈ {-2} delay_dhx[0] ∈ {0} [1] ∈ {1} [2..5] ∈ {0} delay_bph[0] ∈ {-1} [1..5] ∈ {254} ah1 ∈ {951} ah2 ∈ {570} ph1 ∈ {-1} ph2 ∈ {0} rh1 ∈ {-2} rh2 ∈ {-1} compressed[0] ∈ {224} [1] ∈ {255} [2] ∈ {96} [3] ∈ {191} [4] ∈ {196} [5..9] ∈ {0} i ∈ {10} [from] Computing for function abs [from] Done for function abs [from] Computing for function filtep [from] Done for function filtep [from] Computing for function filtez [from] Done for function filtez [from] Computing for function logsch [from] Done for function logsch [from] Computing for function logscl [from] Done for function logscl [from] Computing for function quantl [from] Done for function quantl [from] Computing for function scalel [from] Done for function scalel [from] Computing for function uppol1 [from] Done for function uppol1 [from] Computing for function uppol2 [from] Done for function uppol2 [from] Computing for function upzero [from] Done for function upzero [from] Computing for function encode [from] Done for function encode [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function abs: \result FROM x [from] Function filtep: \result FROM rlt1_0; al1_0; rlt2_0; al2_0 [from] Function filtez: \result FROM delay_bpl[0..5]; delay_dltx[0..5]; delay_dhx[0..5]; delay_bph[0..5]; bpl; dlt_0 [from] Function logsch: \result FROM wh_code_table[1..3]; ih_0; nbh_0 [from] Function logscl: \result FROM wl_code_table{[1]; [8]; [15]}; il_0; nbl_0 [from] Function quantl: \result FROM decis_levl[0..28]; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; el_0; detl_0 [from] Function scalel: \result FROM ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl_0; shift_constant [from] Function uppol1: \result FROM al1_0; plt_0; plt1_0 [from] Function uppol2: \result FROM al1_0; al2_0; plt_0; plt1_0; plt2_0 [from] Function upzero: delay_bpl[0] FROM delay_bpl[0]; delay_dltx[0]; delay_dhx[0]; delay_bph[0]; dlt_0; dlti; bli (and SELF) [1] FROM delay_bpl[1]; delay_dltx[1]; delay_dhx[1]; delay_bph[1]; dlt_0; dlti; bli (and SELF) [2] FROM delay_bpl[2]; delay_dltx[2]; delay_dhx[2]; delay_bph[2]; dlt_0; dlti; bli (and SELF) [3] FROM delay_bpl[3]; delay_dltx[3]; delay_dhx[3]; delay_bph[3]; dlt_0; dlti; bli (and SELF) [4] FROM delay_bpl[4]; delay_dltx[4]; delay_dhx[4]; delay_bph[4]; dlt_0; dlti; bli (and SELF) [5] FROM delay_bpl[5]; delay_dltx[5]; delay_dhx[5]; delay_bph[5]; dlt_0; dlti; bli (and SELF) delay_dltx[0] FROM dlt_0; dlti (and SELF) [1] FROM delay_dltx[0]; delay_dhx[0]; dlti (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2]; dlti (and SELF) [4] FROM delay_dltx[3]; delay_dhx[3]; dlti (and SELF) [5] FROM delay_dltx[4]; delay_dhx[4]; dlti (and SELF) delay_dhx[0] FROM dlt_0; dlti (and SELF) [1] FROM delay_dltx[0]; delay_dhx[0]; dlti (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2]; dlti (and SELF) [4] FROM delay_dltx[3]; delay_dhx[3]; dlti (and SELF) [5] FROM delay_dltx[4]; delay_dhx[4]; dlti (and SELF) delay_bph[0] FROM delay_bpl[0]; delay_dltx[0]; delay_dhx[0]; delay_bph[0]; dlt_0; dlti; bli (and SELF) [1] FROM delay_bpl[1]; delay_dltx[1]; delay_dhx[1]; delay_bph[1]; dlt_0; dlti; bli (and SELF) [2] FROM delay_bpl[2]; delay_dltx[2]; delay_dhx[2]; delay_bph[2]; dlt_0; dlti; bli (and SELF) [3] FROM delay_bpl[3]; delay_dltx[3]; delay_dhx[3]; delay_bph[3]; dlt_0; dlti; bli (and SELF) [4] FROM delay_bpl[4]; delay_dltx[4]; delay_dhx[4]; delay_bph[4]; dlt_0; dlti; bli (and SELF) [5] FROM delay_bpl[5]; delay_dltx[5]; delay_dhx[5]; delay_bph[5]; dlt_0; dlti; bli (and SELF) [from] Function encode: tqmf[0] FROM xin2 [1] FROM xin1 [2] FROM tqmf[0] [3] FROM tqmf[1] [4] FROM tqmf[2] [5] FROM tqmf[3] [6] FROM tqmf[4] [7] FROM tqmf[5] [8] FROM tqmf[6] [9] FROM tqmf[7] [10] FROM tqmf[8] [11] FROM tqmf[9] [12] FROM tqmf[10] [13] FROM tqmf[11] [14] FROM tqmf[12] [15] FROM tqmf[13] [16] FROM tqmf[14] [17] FROM tqmf[15] [18] FROM tqmf[16] [19] FROM tqmf[17] [20] FROM tqmf[18] [21] FROM tqmf[19] [22] FROM tqmf[20] [23] FROM tqmf[21] xl FROM tqmf[0..23]; h[0..23] xh FROM tqmf[0..23]; h[0..23] il FROM tqmf[0..23]; h[0..23]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] szl FROM delay_bpl[0..5]; delay_dltx[0..5]; delay_dhx[0..5]; delay_bph[0..5] spl FROM al1; al2; rlt1; rlt2 sl FROM delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; delay_dhx[0..5]; delay_bph[0..5] el FROM tqmf[0..23]; h[0..23]; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; delay_dhx[0..5]; delay_bph[0..5] delay_bpl[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [2] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [3] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [4] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [5] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) delay_dltx[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2] (and SELF) [4] FROM delay_dltx[2..3]; delay_dhx[2..3] (and SELF) [5] FROM delay_dltx[3..4]; delay_dhx[3..4] (and SELF) nbl FROM tqmf[0..23]; h[0..23]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; nbl; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] al1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; plt1; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] al2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] plt FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] plt1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] plt2 FROM plt1 dlt FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] rlt FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] rlt1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] rlt2 FROM rlt1 detl FROM tqmf[0..23]; h[0..23]; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] deth FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 sh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 eh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 dh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 ih FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 nbh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 szh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] sph FROM ah1; ah2; rh1; rh2 ph FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 yh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 delay_dhx[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; delay_dhx[0..5]; delay_bph[0..5] (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2] (and SELF) [4] FROM delay_dltx[2..3]; delay_dhx[2..3] (and SELF) [5] FROM delay_dltx[3..4]; delay_dhx[3..4] (and SELF) delay_bph[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [2] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [3] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [4] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) [5] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 (and SELF) ah1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; rh1; rh2 ah2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2 ph1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 ph2 FROM ph1 rh1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 rh2 FROM rh1 \result FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 [from] Function main: tqmf[0] FROM test_data[9] [1] FROM test_data[8] [2] FROM test_data[7] [3] FROM test_data[6] [4] FROM test_data[5] [5] FROM test_data[4] [6] FROM test_data[3] [7] FROM test_data[2] [8] FROM test_data[1] [9] FROM test_data[0] [10] FROM tqmf[0] [11] FROM tqmf[1] [12] FROM tqmf[2] [13] FROM tqmf[3] [14] FROM tqmf[4] [15] FROM tqmf[5] [16] FROM tqmf[6] [17] FROM tqmf[7] [18] FROM tqmf[8] [19] FROM tqmf[9] [20] FROM tqmf[10] [21] FROM tqmf[11] [22] FROM tqmf[12] [23] FROM tqmf[13] xl FROM tqmf[0..15]; h[0..23]; test_data[0..7] xh FROM tqmf[0..15]; h[0..23]; test_data[0..7] il FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] szl FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..5] spl FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..5] sl FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..5] el FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] delay_bpl[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [2] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [3] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [4] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [5] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) delay_dltx[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2] (and SELF) [4] FROM delay_dltx[2..3]; delay_dhx[2..3] (and SELF) [5] FROM delay_dltx[2..4]; delay_dhx[2..4] (and SELF) nbl FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] al1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] al2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] plt FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] plt1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] plt2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..5] dlt FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] rlt FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] rlt1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] rlt2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..5] detl FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] deth FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] sh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] eh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] dh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] ih FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] nbh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] szh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] sph FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..5] ph FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] yh FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] delay_dhx[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [3] FROM delay_dltx[2]; delay_dhx[2] (and SELF) [4] FROM delay_dltx[2..3]; delay_dhx[2..3] (and SELF) [5] FROM delay_dltx[2..4]; delay_dhx[2..4] (and SELF) delay_bph[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [2] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [3] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [4] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) [5] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] (and SELF) ah1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] ah2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] ph1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] ph2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..5] rh1 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] rh2 FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..5] compressed[0] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; al1; al2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; rh1; rh2 [1] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..1] [2] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..3] [3] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..5] [4] FROM tqmf[0..23]; h[0..23]; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt1; plt2; rlt1; rlt2; decis_levl[0..28]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; qq2_code2_table[1..3]; wh_code_table[1..3]; nbh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..7] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function abs: m [inout] Inputs for function abs: \nothing [inout] Out (internal) for function filtep: pl; pl2; __retres [inout] Inputs for function filtep: \nothing [inout] Out (internal) for function filtez: bpl; dlt_0; i; zl; tmp; tmp_0; __retres; tmp_1_unroll_123; tmp_2_unroll_123; tmp_1_unroll_126; tmp_2_unroll_126; tmp_1_unroll_129; tmp_2_unroll_129; tmp_1_unroll_132; tmp_2_unroll_132; tmp_1_unroll_135; tmp_2_unroll_135 [inout] Inputs for function filtez: delay_bpl[0..5]; delay_dltx[0..5]; delay_dhx[0..5]; delay_bph[0..5] [inout] Out (internal) for function logsch: nbh_0; wd [inout] Inputs for function logsch: wh_code_table[1..3] [inout] Out (internal) for function logscl: nbl_0; wd [inout] Inputs for function logscl: wl_code_table{[1]; [8]; [15]} [inout] Out (internal) for function quantl: ril; mil; wd; decis [inout] Inputs for function quantl: decis_levl[0..29]; quant26bt_pos[29]; quant26bt_neg{[0]; [29]} [inout] Out (internal) for function scalel: wd1; wd2; wd3; __retres [inout] Inputs for function scalel: ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]} [inout] Out (internal) for function uppol1: wd2; wd3; apl1 [inout] Inputs for function uppol1: \nothing [inout] Out (internal) for function uppol2: wd2; wd4; apl2 [inout] Inputs for function uppol2: \nothing [inout] Out (internal) for function upzero: delay_bpl[0..5]; delay_dltx{[0..1]; [3..5]}; delay_dhx{[0..1]; [3..5]}; delay_bph[0..5]; i; wd2; wd3 [inout] Inputs for function upzero: delay_bpl[0..5]; delay_dltx[0..5]; delay_dhx[0..5]; delay_bph[0..5] [inout] Out (internal) for function encode: tqmf[0..23]; xl; xh; il; szl; spl; sl; el; delay_bpl[0..5]; delay_dltx{[0..1]; [3..5]}; nbl; al1; al2; plt; plt1; plt2; dlt; rlt; rlt1; rlt2; detl; deth; sh; eh; dh; ih; nbh; szh; sph; ph; yh; delay_dhx{[0..1]; [3..5]}; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; i; h_ptr; tqmf_ptr; tqmf_ptr1; xa; xb; decis; tmp; tmp_0; tmp_1; tmp_2; tmp_7; tmp_8; tmp_9; tmp_12; tmp_13; __retres; tmp_3_unroll_8; tmp_4_unroll_8; tmp_5_unroll_8; tmp_6_unroll_8; tmp_3_unroll_12; tmp_4_unroll_12; tmp_5_unroll_12; tmp_6_unroll_12; tmp_3_unroll_16; tmp_4_unroll_16; tmp_5_unroll_16; tmp_6_unroll_16; tmp_3_unroll_20; tmp_4_unroll_20; tmp_5_unroll_20; tmp_6_unroll_20; tmp_3_unroll_24; tmp_4_unroll_24; tmp_5_unroll_24; tmp_6_unroll_24; tmp_3_unroll_28; tmp_4_unroll_28; tmp_5_unroll_28; tmp_6_unroll_28; tmp_3_unroll_32; tmp_4_unroll_32; tmp_5_unroll_32; tmp_6_unroll_32; tmp_3_unroll_36; tmp_4_unroll_36; tmp_5_unroll_36; tmp_6_unroll_36; tmp_3_unroll_40; tmp_4_unroll_40; tmp_5_unroll_40; tmp_6_unroll_40; tmp_3_unroll_44; tmp_4_unroll_44; tmp_5_unroll_44; tmp_6_unroll_44; tmp_10_unroll_51; tmp_11_unroll_51; tmp_10_unroll_54; tmp_11_unroll_54; tmp_10_unroll_57; tmp_11_unroll_57; tmp_10_unroll_60; tmp_11_unroll_60; tmp_10_unroll_63; tmp_11_unroll_63; tmp_10_unroll_66; tmp_11_unroll_66; tmp_10_unroll_69; tmp_11_unroll_69; tmp_10_unroll_72; tmp_11_unroll_72; tmp_10_unroll_75; tmp_11_unroll_75; tmp_10_unroll_78; tmp_11_unroll_78; tmp_10_unroll_81; tmp_11_unroll_81; tmp_10_unroll_84; tmp_11_unroll_84; tmp_10_unroll_87; tmp_11_unroll_87; tmp_10_unroll_90; tmp_11_unroll_90; tmp_10_unroll_93; tmp_11_unroll_93; tmp_10_unroll_96; tmp_11_unroll_96; tmp_10_unroll_99; tmp_11_unroll_99; tmp_10_unroll_102; tmp_11_unroll_102; tmp_10_unroll_105; tmp_11_unroll_105; tmp_10_unroll_108; tmp_11_unroll_108; tmp_10_unroll_111; tmp_11_unroll_111; tmp_10_unroll_114; tmp_11_unroll_114 [inout] Inputs for function encode: tqmf[0..23]; h[0..23]; xl; xh; il; szl; spl; sl; el; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt; plt1; plt2; dlt; rlt; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; sh; eh; qq2_code2_table[1..3]; wh_code_table[1..3]; dh; ih; nbh; szh; sph; ph; yh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2 [inout] Out (internal) for function main: tqmf[0..23]; xl; xh; il; szl; spl; sl; el; delay_bpl[0..5]; delay_dltx{[0..1]; [3..5]}; nbl; al1; al2; plt; plt1; plt2; dlt; rlt; rlt1; rlt2; detl; deth; sh; eh; dh; ih; nbh; szh; sph; ph; yh; delay_dhx{[0..1]; [3..5]}; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; compressed[0..4]; i [inout] Inputs for function main: tqmf[0..23]; h[0..23]; xl; xh; il; szl; spl; sl; el; qq4_code4_table{[1]; [8]; [15]}; delay_bpl[0..5]; delay_dltx[0..5]; wl_code_table{[1]; [8]; [15]}; ilb_table{[0]; [9..10]; [12]; [14..15]; [27]; [29]}; nbl; al1; al2; plt; plt1; plt2; dlt; rlt; rlt1; rlt2; decis_levl[0..29]; detl; quant26bt_pos[29]; quant26bt_neg{[0]; [29]}; deth; sh; eh; qq2_code2_table[1..3]; wh_code_table[1..3]; dh; ih; nbh; szh; sph; ph; yh; delay_dhx[0..5]; delay_bph[0..5]; ah1; ah2; ph1; ph2; rh1; rh2; test_data[0..9] frama-c-20.0-Calcium/tests/test_config0000666000000000000000000000035613571573400014610 0ustar MACRO: EVA_OPTIONS -eva-show-progress -eva-msg-key=-summary -eva-auto-loop-unroll 0 MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps frama-c-20.0-Calcium/tests/test_config_apron0000666000000000000000000000043213571573400016002 0ustar MACRO: EVA_OPTIONS -eva-show-progress -eva-msg-key=-summary -eva-auto-loop-unroll 0 -eva-apron-oct -eva-msg-key experimental-ok MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps frama-c-20.0-Calcium/tests/test_config_bitwise0000666000000000000000000000040213571573400016326 0ustar MACRO: EVA_OPTIONS -eva-show-progress -eva-msg-key=-summary -eva-auto-loop-unroll 0 -eva-bitwise-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps frama-c-20.0-Calcium/tests/test_config_equalities0000666000000000000000000000040313571573400017026 0ustar MACRO: EVA_OPTIONS -eva-show-progress -eva-msg-key=-summary -eva-auto-loop-unroll 0 -eva-equality-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps frama-c-20.0-Calcium/tests/test_config_gauges0000666000000000000000000000040113571573400016132 0ustar MACRO: EVA_OPTIONS -eva-show-progress -eva-msg-key=-summary -eva-auto-loop-unroll 0 -eva-gauges-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps frama-c-20.0-Calcium/tests/test_config_octagons0000666000000000000000000000035213571573400016501 0ustar MACRO: EVA_OPTIONS -eva-show-progress -eva-msg-key=-summary -eva-octagon-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps frama-c-20.0-Calcium/tests/test_config_symblocs0000666000000000000000000000041513571573400016517 0ustar MACRO: EVA_OPTIONS -eva-show-progress -eva-msg-key=-summary -eva-auto-loop-unroll 0 -eva-symbolic-locations-domain MACRO: EVA_CONFIG @EVA_OPTIONS@ -no-autoload-plugins -load-module from,inout,eva,scope,variadic OPT: -eva @EVA_CONFIG@ -journal-disable -out -input -deps frama-c-20.0-Calcium/tests/value/0000777000000000000000000000000013571573400013471 5ustar frama-c-20.0-Calcium/tests/value/.gitignore0000666000000000000000000000001113571573400015451 0ustar /oracle_*frama-c-20.0-Calcium/tests/value/CruiseControl.c0000666000000000000000000005141013571573400016431 0ustar /* run.config* GCC: STDOPT: #"-float-normal tests/value/CruiseControl_const.c -lib-entry -main CruiseControl -context-depth 10 -context-valid-pointers" */ /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** Command : ** l2C CruiseControl.lus -node CruiseControl ** -noexp @ALL@ ** -keep_named_var ** -const ** -bitwise ** -loc_ctx ** -no_copy_mem ** -debug ** date of generation (MM/DD/YYYY): 07/06/2007 13:30:09 ** last modification date for CruiseControl.lus (MM/DD/YYYY): 07/06/2007 ********************************************************************$*/ #include "CruiseControl.h" #include "CruiseControl_extern.h" /* ============== */ /* INITIALISATION */ /* ============== */ void CruiseSpeedMgt_init(_C_CruiseSpeedMgt * _C_) { (_C_->_M_init_0_CruiseControl) = true; } void SaturateThrottle_init(_C_SaturateThrottle * _C_) { } void ThrottleRegulation_init(_C_ThrottleRegulation * _C_) { (_C_->_M_init_0_CruiseControl) = true; SaturateThrottle_init(&(_C_->_C0_SaturateThrottle)); } void ThrottleCmd_init(_C_ThrottleCmd * _C_) { (_C_->_M_init_0_CruiseControl) = true; ThrottleRegulation_init(&(_C_->_C0_ThrottleRegulation)); (_C_->_M_condact_2_CruiseControl) = true; } void CruiseStateMgt_init(_C_CruiseStateMgt * _C_) { (_C_->_M_init_0_CruiseControl) = true; } void DetectPedalsPressed_init(_C_DetectPedalsPressed * _C_) { } void DetectSpeedLimits_init(_C_DetectSpeedLimits * _C_) { } void CruiseControl_init(_C_CruiseControl * _C_) { CruiseSpeedMgt_init(&(_C_->_C0_CruiseSpeedMgt)); DetectPedalsPressed_init(&(_C_->_C1_DetectPedalsPressed)); DetectSpeedLimits_init(&(_C_->_C2_DetectSpeedLimits)); CruiseStateMgt_init(&(_C_->_C3_CruiseStateMgt)); (_C_->_M_condact_0_CruiseControl) = true; ThrottleCmd_init(&(_C_->_C4_ThrottleCmd)); (_C_->_M_init_CruiseControl) = true; } /* ================================*/ /* MAIN NODE (AND UNEXPANDED NODES) */ /* ================================ */ bool CruiseSpeedMgt(_C_CruiseSpeedMgt * _C_) { /*#code for node CruiseSpeedMgt */ (_C_->_L1_CruiseControl) = (_C_->_I4_Speed); (_C_->_L2_CruiseControl) = (_C_->_I1_Set); (_C_->_L3_CruiseControl) = (_C_->_I0_On); (_C_->_L6_CruiseControl) = ((_C_->_L2_CruiseControl) | (_C_->_L3_CruiseControl)); (_C_->_L21_CruiseControl) = ZeroSpeed; if ((_C_->_M_init_0_CruiseControl)) { (_C_->_L10_CruiseControl) = (_C_->_L21_CruiseControl); } else { (_C_->_L10_CruiseControl) = (_C_->_L7_CruiseControl); } (_C_->_L12_CruiseControl) = SpeedInc; (_C_->_L13_CruiseControl) = ((_C_->_L10_CruiseControl) + (_C_->_L12_CruiseControl)); (_C_->_L15_CruiseControl) = SpeedMax; (_C_->_L16_CruiseControl) = ((_C_->_L13_CruiseControl) <= (_C_->_L15_CruiseControl)); (_C_->_L4_CruiseControl) = (_C_->_I2_QuickAccel); (_C_->_L17_CruiseControl) = ((_C_->_L16_CruiseControl) & (_C_->_L4_CruiseControl)); (_C_->_L11_CruiseControl) = SpeedInc; (_C_->_L14_CruiseControl) = ((_C_->_L10_CruiseControl) - (_C_->_L11_CruiseControl)); (_C_->_L19_CruiseControl) = SpeedMin; (_C_->_L18_CruiseControl) = ((_C_->_L14_CruiseControl) >= (_C_->_L19_CruiseControl)); (_C_->_L5_CruiseControl) = (_C_->_I3_QuickDecel); (_C_->_L20_CruiseControl) = ((_C_->_L18_CruiseControl) & (_C_->_L5_CruiseControl)); if ((_C_->_L20_CruiseControl)) { (_C_->_L9_CruiseControl) = (_C_->_L14_CruiseControl); } else { (_C_->_L9_CruiseControl) = (_C_->_L10_CruiseControl); } if ((_C_->_L17_CruiseControl)) { (_C_->_L8_CruiseControl) = (_C_->_L13_CruiseControl); } else { (_C_->_L8_CruiseControl) = (_C_->_L9_CruiseControl); } if ((_C_->_L6_CruiseControl)) { (_C_->_L7_CruiseControl) = (_C_->_L1_CruiseControl); } else { (_C_->_L7_CruiseControl) = (_C_->_L8_CruiseControl); } (_C_->_O0_CruiseSpeed) = (_C_->_L7_CruiseControl); (_C_->_M_init_0_CruiseControl) = false; /*#end code for node CruiseSpeedMgt */ return (true); } bool SaturateThrottle(_C_SaturateThrottle * _C_) { /*#code for node SaturateThrottle */ (_C_->_L18_CruiseControl) = RegThrottleMax; (_C_->_L12_CruiseControl) = (_C_->_I0_ThrottleIn); (_C_->_L7_CruiseControl) = ((_C_->_L12_CruiseControl) > (_C_->_L18_CruiseControl)); (_C_->_L17_CruiseControl) = ZeroPercent; (_C_->_L9_CruiseControl) = ((_C_->_L12_CruiseControl) < (_C_->_L17_CruiseControl)); if ((_C_->_L9_CruiseControl)) { (_C_->_L6_CruiseControl) = (_C_->_L17_CruiseControl); } else { (_C_->_L6_CruiseControl) = (_C_->_L12_CruiseControl); } if ((_C_->_L7_CruiseControl)) { (_C_->_L8_CruiseControl) = (_C_->_L18_CruiseControl); } else { (_C_->_L8_CruiseControl) = (_C_->_L6_CruiseControl); } (_C_->_O0_ThrottleOut) = (_C_->_L8_CruiseControl); (_C_->_L13_CruiseControl) = ((_C_->_L9_CruiseControl) | (_C_->_L7_CruiseControl)); (_C_->_O1_Saturate) = (_C_->_L13_CruiseControl); /*#end code for node SaturateThrottle */ //@ assert (_C_->_O1_Saturate == 1) ==> (_C_->_O0_ThrottleOut == ZeroPercent || _C_->_O0_ThrottleOut == RegThrottleMax ); return (true); } bool ThrottleRegulation(_C_ThrottleRegulation * _C_) { /*#code for node ThrottleRegulation */ (_C_->_L1_CruiseControl) = (_C_->_I1_CruiseSpeed); (_C_->_L2_CruiseControl) = (_C_->_I2_VehiculeSpeed); (_C_->_L3_CruiseControl) = ((_C_->_L1_CruiseControl) - (_C_->_L2_CruiseControl)); (_C_->_L6_CruiseControl) = Kp; (_C_->ProportionnalAction) = ((_C_->_L3_CruiseControl) * (_C_->_L6_CruiseControl)); (_C_->_L22_CruiseControl) = ZeroSpeed; if ((_C_->_M_init_0_CruiseControl)) { (_C_->HoldIntegralAction) = true; } else { (_C_->HoldIntegralAction) = (_C_->_L14_CruiseControl); } if ((_C_->HoldIntegralAction)) { (_C_->_L16_CruiseControl) = (_C_->_L22_CruiseControl); } else { (_C_->_L16_CruiseControl) = (_C_->_L3_CruiseControl); } (_C_->_L23_CruiseControl) = ZeroSpeed; if ((_C_->_M_init_0_CruiseControl)) { (_C_->_L18_CruiseControl) = (_C_->_L23_CruiseControl); } else { (_C_->_L18_CruiseControl) = (_C_->_L21_CruiseControl); } (_C_->_L10_CruiseControl) = ((_C_->_L16_CruiseControl) + (_C_->_L18_CruiseControl)); (_C_->_L8_CruiseControl) = Ki; (_C_->IntegralAction) = ((_C_->_L10_CruiseControl) * (_C_->_L8_CruiseControl)); (_C_->_L4_CruiseControl) = ((_C_->ProportionnalAction) + (_C_->IntegralAction)); /* call to node not expanded SaturateThrottle */ (_C_->_C0_SaturateThrottle._I0_ThrottleIn) = (_C_->_L4_CruiseControl); if (!SaturateThrottle(&(_C_->_C0_SaturateThrottle))) return (false); (_C_->_L13_CruiseControl) = (_C_->_C0_SaturateThrottle._O0_ThrottleOut); (_C_->_L14_CruiseControl) = (_C_->_C0_SaturateThrottle._O1_Saturate); (_C_->_O0_Throttle) = (_C_->_L13_CruiseControl); (_C_->_L19_CruiseControl) = (_C_->_I0_Reset); if ((_C_->_L19_CruiseControl)) { (_C_->_L21_CruiseControl) = (_C_->_L22_CruiseControl); } else { (_C_->_L21_CruiseControl) = (_C_->_L10_CruiseControl); } (_C_->_M_init_0_CruiseControl) = false; /*#end code for node ThrottleRegulation */ return (true); } bool ThrottleCmd(_C_ThrottleCmd * _C_) { /*#code for node ThrottleCmd */ if ((_C_->_M_init_0_CruiseControl)) { (_C_->_L21_CruiseControl) = false; } else { (_C_->_L21_CruiseControl) = (_C_->_L20_CruiseControl); } (_C_->_L20_CruiseControl) = (_C_->_I0_Regul_ON); (_C_->_L22_CruiseControl) = ((_C_->_L21_CruiseControl) ^ true); (_C_->ONRisingEdge) = ((_C_->_L20_CruiseControl) & (_C_->_L22_CruiseControl)); (_C_->_L26_CruiseControl) = ZeroPercent; (_C_->_L1_CruiseControl) = (_C_->_I1_CruiseSpeed); (_C_->_L2_CruiseControl) = (_C_->_I2_VehiculeSpeed); /* begin condact */ if ((_C_->_L20_CruiseControl)) { /* call to node not expanded ThrottleRegulation */ (_C_->_C0_ThrottleRegulation._I0_Reset) = (_C_->ONRisingEdge); (_C_->_C0_ThrottleRegulation._I1_CruiseSpeed) = (_C_->_L1_CruiseControl); (_C_->_C0_ThrottleRegulation._I2_VehiculeSpeed) = (_C_->_L2_CruiseControl); if (!ThrottleRegulation(&(_C_->_C0_ThrottleRegulation))) return (false); (_C_->_L19_CruiseControl) = (_C_->_C0_ThrottleRegulation._O0_Throttle); (_C_->_M_condact_2_CruiseControl) = false; } else { if (_C_->_M_init_0_CruiseControl) { (_C_->_L19_CruiseControl) = (_C_->_L26_CruiseControl); } } /* end condact */ (_C_->_L25_CruiseControl) = (_C_->_I3_Accelerator); if ((_C_->_L20_CruiseControl)) { (_C_->_L24_CruiseControl) = (_C_->_L19_CruiseControl); } else { (_C_->_L24_CruiseControl) = (_C_->_L25_CruiseControl); } (_C_->_O0_Throttle) = (_C_->_L24_CruiseControl); (_C_->_M_init_0_CruiseControl) = false; /*#end code for node ThrottleCmd */ return (true); } bool CruiseStateMgt(_C_CruiseStateMgt * _C_) { /*#code for node CruiseStateMgt */ if ((_C_->_M_init_0_CruiseControl)) { (_C_->_LE24_CruiseControl) = false; } else { (_C_->_LE24_CruiseControl) = (_C_->_LE23_CruiseControl); } (_C_->_LE0_CruiseControl) = (_C_->_I0_BrakePressed); (_C_->_LE4_CruiseControl) = (_C_->_I4_Off); if ((_C_->_M_init_0_CruiseControl)) { (_C_->_LE40_CruiseControl) = false; (_C_->_LE26_CruiseControl) = false; (_C_->_LE28_CruiseControl) = false; } else { (_C_->_LE40_CruiseControl) = (_C_->_LE39_CruiseControl); (_C_->_LE26_CruiseControl) = (_C_->_LE25_CruiseControl); (_C_->_LE28_CruiseControl) = (_C_->_LE27_CruiseControl); } (_C_->_LE9_CruiseControl) = ((_C_->_LE26_CruiseControl) | (_C_->_LE28_CruiseControl)); (_C_->_LE10_CruiseControl) = ((_C_->_LE24_CruiseControl) | (_C_->_LE9_CruiseControl)); (_C_->_LE11_CruiseControl) = ((_C_->_LE40_CruiseControl) | (_C_->_LE10_CruiseControl)); if ((_C_->_M_init_0_CruiseControl)) { (_C_->_LE33_CruiseControl) = false; (_C_->_LE35_CruiseControl) = false; (_C_->_LE38_CruiseControl) = false; } else { (_C_->_LE33_CruiseControl) = (_C_->_LE32_CruiseControl); (_C_->_LE35_CruiseControl) = (_C_->_LE34_CruiseControl); (_C_->_LE38_CruiseControl) = (_C_->_LE37_CruiseControl); } (_C_->_LE12_CruiseControl) = ((_C_->_LE35_CruiseControl) | (_C_->_LE38_CruiseControl)); (_C_->_LE13_CruiseControl) = ((_C_->_LE33_CruiseControl) | (_C_->_LE12_CruiseControl)); (_C_->_LE14_CruiseControl) = ((_C_->_LE11_CruiseControl) | (_C_->_LE13_CruiseControl)); (_C_->_LE17_CruiseControl) = (((_C_->_LE4_CruiseControl) ^ true) & (_C_->_LE14_CruiseControl)); (_C_->_LE18_CruiseControl) = ((((_C_->_LE0_CruiseControl) ^ true) & (_C_-> _LE17_CruiseControl)) & (_C_->_LE10_CruiseControl)); (_C_->_LE3_CruiseControl) = (_C_->_I3_On); if ((_C_->_M_init_0_CruiseControl)) { (_C_->_LE16_CruiseControl) = false; (_C_->_LE41_CruiseControl) = true; } else { (_C_->_LE16_CruiseControl) = (_C_->_LE15_CruiseControl); (_C_->_LE41_CruiseControl) = (_C_->_LE19_CruiseControl); } (_C_->_LE19_CruiseControl) = ((_C_->_LE41_CruiseControl) & ((_C_->_LE3_CruiseControl) ^ true)); (_C_->_LE20_CruiseControl) = (((_C_->_LE3_CruiseControl) & (_C_-> _LE16_CruiseControl)) | (((_C_-> _LE19_CruiseControl) ^ true) & (_C_-> _LE41_CruiseControl))); (_C_->_LE21_CruiseControl) = (((_C_->_LE24_CruiseControl) & (_C_-> _LE18_CruiseControl)) | (((_C_-> _LE0_CruiseControl) ^ true) & (_C_-> _LE20_CruiseControl))); (_C_->_LE1_CruiseControl) = (_C_->_I1_AcceleratorPressed); (_C_->_LE5_CruiseControl) = (_C_->_I5_SpeedOutOffLimits); (_C_->_LE22_CruiseControl) = (((_C_->_LE1_CruiseControl) ^ true) & ((_C_-> _LE5_CruiseControl) ^ true)); (_C_->_LE23_CruiseControl) = ((_C_->_LE21_CruiseControl) & (_C_->_LE22_CruiseControl)); (_C_->_LE25_CruiseControl) = (((_C_->_LE18_CruiseControl) & (_C_->_LE9_CruiseControl)) & (_C_-> _LE22_CruiseControl)); (_C_->_LE29_CruiseControl) = ((_C_->_LE17_CruiseControl) & (_C_->_LE13_CruiseControl)); (_C_->_LE2_CruiseControl) = (_C_->_I2_Resume); (_C_->_LE30_CruiseControl) = ((_C_->_LE40_CruiseControl) & (_C_->_LE17_CruiseControl)); (_C_->_LE31_CruiseControl) = (((_C_->_LE33_CruiseControl) & (_C_-> _LE29_CruiseControl)) | ((_C_-> _LE2_CruiseControl) & (_C_-> _LE30_CruiseControl))); (_C_->_LE32_CruiseControl) = ((((_C_->_LE0_CruiseControl) ^ true) & (_C_-> _LE22_CruiseControl)) & (_C_->_LE31_CruiseControl)); (_C_->_LE34_CruiseControl) = (((((_C_->_LE0_CruiseControl) ^ true) & (_C_-> _LE29_CruiseControl)) & (_C_->_LE12_CruiseControl)) & (_C_->_LE22_CruiseControl)); (_C_->_LE42_CruiseControl) = ((((_C_->_LE23_CruiseControl) | (_C_-> _LE25_CruiseControl)) | (_C_-> _LE32_CruiseControl)) | (_C_->_LE34_CruiseControl)); (_C_->_LE6_CruiseControl) = (_C_->_LE42_CruiseControl); (_C_->_O0_Regul_ON) = (_C_->_LE6_CruiseControl); (_C_->_LE15_CruiseControl) = ((((_C_->_LE3_CruiseControl) ^ true) & (_C_-> _LE16_CruiseControl)) | ((_C_->_LE4_CruiseControl) & (_C_->_LE14_CruiseControl))); (_C_->_LE39_CruiseControl) = (((((_C_->_LE0_CruiseControl) & (_C_-> _LE29_CruiseControl)) | ((_C_-> _LE0_CruiseControl) & (_C_-> _LE20_CruiseControl))) | (((_C_->_LE2_CruiseControl) ^ true) & (_C_->_LE30_CruiseControl))) | (((_C_-> _LE0_CruiseControl) & (_C_-> _LE17_CruiseControl)) & (_C_-> _LE11_CruiseControl))); (_C_->_LE43_CruiseControl) = (((_C_->_LE19_CruiseControl) | (_C_->_LE15_CruiseControl)) | (_C_-> _LE39_CruiseControl)); (_C_->_LE7_CruiseControl) = (_C_->_LE43_CruiseControl); (_C_->_O1_Regul_OFF) = (_C_->_LE7_CruiseControl); (_C_->_LE27_CruiseControl) = ((((_C_->_LE23_CruiseControl) ^ true) & (_C_-> _LE21_CruiseControl)) | ((((_C_->_LE25_CruiseControl) ^ true) & (_C_-> _LE18_CruiseControl)) & (_C_->_LE9_CruiseControl))); (_C_->_LE36_CruiseControl) = ((((_C_->_LE34_CruiseControl) ^ true) & (_C_-> _LE29_CruiseControl)) | ((_C_->_LE2_CruiseControl) & (_C_->_LE30_CruiseControl))); (_C_->_LE37_CruiseControl) = ((((_C_->_LE0_CruiseControl) ^ true) & ((_C_-> _LE32_CruiseControl) ^ true)) & (_C_-> _LE36_CruiseControl)); (_C_->_LE44_CruiseControl) = (((_C_->_LE27_CruiseControl) | (_C_->_LE37_CruiseControl)) | (_C_-> _LE39_CruiseControl)); (_C_->_LE8_CruiseControl) = (_C_->_LE44_CruiseControl); (_C_->_O2_Regul_STDBY) = (_C_->_LE8_CruiseControl); (_C_->_M_init_0_CruiseControl) = false; /*#end code for node CruiseStateMgt */ return (true); } bool DetectPedalsPressed(_C_DetectPedalsPressed * _C_) { /*#code for node DetectPedalsPressed */ (_C_->_L2_CruiseControl) = (_C_->_I0_Brake); (_C_->_L8_CruiseControl) = ZeroPercent; (_C_->_L4_CruiseControl) = ((_C_->_L2_CruiseControl) > (_C_->_L8_CruiseControl)); (_C_->_O0_BrakePressed) = (_C_->_L4_CruiseControl); (_C_->_L1_CruiseControl) = (_C_->_I1_Accelerator); (_C_->_L7_CruiseControl) = ZeroPercent; (_C_->_L3_CruiseControl) = ((_C_->_L1_CruiseControl) > (_C_->_L7_CruiseControl)); (_C_->_O1_AcceleratorPressed) = (_C_->_L3_CruiseControl); /*#end code for node DetectPedalsPressed */ return (true); } bool DetectSpeedLimits(_C_DetectSpeedLimits * _C_) { /*#code for node DetectSpeedLimits */ (_C_->_L7_CruiseControl) = (_C_->_I0_speed); (_C_->_L13_CruiseControl) = SpeedMin; (_C_->_L8_CruiseControl) = ((_C_->_L7_CruiseControl) < (_C_->_L13_CruiseControl)); (_C_->_L14_CruiseControl) = SpeedMax; (_C_->_L9_CruiseControl) = ((_C_->_L7_CruiseControl) > (_C_->_L14_CruiseControl)); (_C_->_L17_CruiseControl) = ((_C_->_L8_CruiseControl) | (_C_->_L9_CruiseControl)); (_C_->_O0_SpeedOutOffLimits) = (_C_->_L17_CruiseControl); /*#end code for node DetectSpeedLimits */ return (true); } bool CruiseControl(_C_CruiseControl * _C_) { /*#code for node CruiseControl */ (_C_->_L73_CruiseControl) = (_C_->_I0_On); (_C_->_L59_CruiseControl) = (_C_->_I7_Brake); (_C_->_L62_CruiseControl) = (_C_->_I6_Accel); /* call to node not expanded DetectPedalsPressed */ (_C_->_C1_DetectPedalsPressed._I0_Brake) = (_C_->_L59_CruiseControl); (_C_->_C1_DetectPedalsPressed._I1_Accelerator) = (_C_->_L62_CruiseControl); if (!DetectPedalsPressed(&(_C_->_C1_DetectPedalsPressed))) return (false); (_C_->BrakePressed) = (_C_->_C1_DetectPedalsPressed._O0_BrakePressed); (_C_->AcceleratorPressed) = (_C_->_C1_DetectPedalsPressed._O1_AcceleratorPressed); (_C_->_L61_CruiseControl) = (_C_->_I2_Resume); (_C_->_L60_CruiseControl) = (_C_->_I0_On); (_C_->_L58_CruiseControl) = (_C_->_I1_Off); (_C_->_L95_CruiseControl) = (_C_->_I8_Speed); /* call to node not expanded DetectSpeedLimits */ (_C_->_C2_DetectSpeedLimits._I0_speed) = (_C_->_L95_CruiseControl); if (!DetectSpeedLimits(&(_C_->_C2_DetectSpeedLimits))) return (false); (_C_->SpeedOutOffLimits) = (_C_->_C2_DetectSpeedLimits._O0_SpeedOutOffLimits); /* call to node not expanded CruiseStateMgt */ (_C_->_C3_CruiseStateMgt._I0_BrakePressed) = (_C_->BrakePressed); (_C_->_C3_CruiseStateMgt._I1_AcceleratorPressed) = (_C_->AcceleratorPressed); (_C_->_C3_CruiseStateMgt._I2_Resume) = (_C_->_L61_CruiseControl); (_C_->_C3_CruiseStateMgt._I3_On) = (_C_->_L60_CruiseControl); (_C_->_C3_CruiseStateMgt._I4_Off) = (_C_->_L58_CruiseControl); (_C_->_C3_CruiseStateMgt._I5_SpeedOutOffLimits) = (_C_->SpeedOutOffLimits); if (!CruiseStateMgt(&(_C_->_C3_CruiseStateMgt))) return (false); (_C_->_L82_CruiseControl) = (_C_->_C3_CruiseStateMgt._O0_Regul_ON); (_C_->_L83_CruiseControl) = (_C_->_C3_CruiseStateMgt._O1_Regul_OFF); (_C_->_L84_CruiseControl) = (_C_->_C3_CruiseStateMgt._O2_Regul_STDBY); (_C_->_L19_CruiseControl) = ((_C_->_L82_CruiseControl) | (_C_->_L84_CruiseControl)); (_C_->_L96_CruiseControl) = ZeroSpeed; (_C_->_L38_CruiseControl) = (_C_->_I3_Set); (_C_->_L39_CruiseControl) = (_C_->_I4_QuickAccel); (_C_->_L40_CruiseControl) = (_C_->_I5_QuickDecel); (_C_->_L23_CruiseControl) = (_C_->_I8_Speed); /* begin condact */ if ((_C_->_L19_CruiseControl)) { /* call to node not expanded CruiseSpeedMgt */ (_C_->_C0_CruiseSpeedMgt._I0_On) = (_C_->_L73_CruiseControl); (_C_->_C0_CruiseSpeedMgt._I1_Set) = (_C_->_L38_CruiseControl); (_C_->_C0_CruiseSpeedMgt._I2_QuickAccel) = (_C_->_L39_CruiseControl); (_C_->_C0_CruiseSpeedMgt._I3_QuickDecel) = (_C_->_L40_CruiseControl); (_C_->_C0_CruiseSpeedMgt._I4_Speed) = (_C_->_L23_CruiseControl); if (!CruiseSpeedMgt(&(_C_->_C0_CruiseSpeedMgt))) return (false); (_C_->CruiseSpeed) = (_C_->_C0_CruiseSpeedMgt._O0_CruiseSpeed); (_C_->_M_condact_0_CruiseControl) = false; } else { if (_C_->_M_init_CruiseControl) { (_C_->CruiseSpeed) = (_C_->_L96_CruiseControl); } } /* end condact */ (_C_->_O0_Cruise_speed) = (_C_->CruiseSpeed); (_C_->_L26_CruiseControl) = (_C_->_I6_Accel); /* call to node not expanded ThrottleCmd */ (_C_->_C4_ThrottleCmd._I0_Regul_ON) = (_C_->_L82_CruiseControl); (_C_->_C4_ThrottleCmd._I1_CruiseSpeed) = (_C_->CruiseSpeed); (_C_->_C4_ThrottleCmd._I2_VehiculeSpeed) = (_C_->_L23_CruiseControl); (_C_->_C4_ThrottleCmd._I3_Accelerator) = (_C_->_L26_CruiseControl); if (!ThrottleCmd(&(_C_->_C4_ThrottleCmd))) return (false); (_C_->_L22_CruiseControl) = (_C_->_C4_ThrottleCmd._O0_Throttle); (_C_->_O1_Throttle_cmd) = (_C_->_L22_CruiseControl); (_C_->_O2_Regul_ON) = (_C_->_L82_CruiseControl); (_C_->_O3_Regul_OFF) = (_C_->_L83_CruiseControl); (_C_->_O4_Regul_STDBY) = (_C_->_L84_CruiseControl); (_C_->_M_init_CruiseControl) = false; /*#end code for node CruiseControl */ return (true); } /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** End of file CruiseControl.c ** End of generation (MM/DD/YYYY) : 07/06/2007 13:30:09 ********************************************************************$*/ bool main(_C_CruiseControl * _C_){ CruiseControl_init(_C_); while (CruiseControl(_C_)); return false; } /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** Command : ** l2C CruiseControl.lus -node CruiseControl ** -noexp @ALL@ ** -keep_named_var ** -const ** -bitwise ** -loc_ctx ** -no_copy_mem ** -debug ** date of generation (MM/DD/YYYY): 07/06/2007 13:30:09 ** last modification date for CruiseControl.lus (MM/DD/YYYY): 07/06/2007 ********************************************************************$*/ const Speed ZeroSpeed = (real) 0.0; const Speed SpeedInc = (real) 2.0; const Speed SpeedMax = (real) 150.0; const Speed SpeedMin = (real) 30.0; const Percent ZeroPercent = (real) 0.0; const real Kp = (real) 8.113; const real Ki = (real) 0.5; const Percent RegThrottleMax = (real) 45.0; /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** End of file CruiseControl_const.c ** End of generation (MM/DD/YYYY) : 07/06/2007 13:30:09 ********************************************************************$*/ frama-c-20.0-Calcium/tests/value/CruiseControl.h0000666000000000000000000002167013571573400016443 0ustar /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** Command : ** l2C CruiseControl.lus -node CruiseControl ** -noexp @ALL@ ** -keep_named_var ** -const ** -bitwise ** -loc_ctx ** -no_copy_mem ** -debug ** date of generation (MM/DD/YYYY): 07/06/2007 13:30:09 ** last modification date for CruiseControl.lus (MM/DD/YYYY): 07/06/2007 ********************************************************************$*/ #ifndef _INCLUDE_SCADE_TYPES # include "scade_types.h" #endif #include "definitions.h" /* ======================== */ /* CONTEXT for node CruiseSpeedMgt */ /* ======================== */ /* Type for context */ typedef struct { bool _I0_On; bool _I1_Set; bool _I2_QuickAccel; bool _I3_QuickDecel; Speed _I4_Speed; Speed _O0_CruiseSpeed; Speed _L1_CruiseControl; bool _L2_CruiseControl; bool _L3_CruiseControl; bool _L6_CruiseControl; Speed _L21_CruiseControl; Speed _L10_CruiseControl; Speed _L12_CruiseControl; real _L13_CruiseControl; Speed _L15_CruiseControl; bool _L16_CruiseControl; bool _L4_CruiseControl; bool _L17_CruiseControl; Speed _L11_CruiseControl; real _L14_CruiseControl; Speed _L19_CruiseControl; bool _L18_CruiseControl; bool _L5_CruiseControl; bool _L20_CruiseControl; real _L9_CruiseControl; real _L8_CruiseControl; Speed _L7_CruiseControl; bool _M_init_0_CruiseControl; } _C_CruiseSpeedMgt; /* ======================== */ /* CONTEXT for node SaturateThrottle */ /* ======================== */ /* Type for context */ typedef struct { Percent _I0_ThrottleIn; Percent _O0_ThrottleOut; bool _O1_Saturate; Percent _L18_CruiseControl; Percent _L12_CruiseControl; bool _L7_CruiseControl; Percent _L17_CruiseControl; bool _L9_CruiseControl; Percent _L6_CruiseControl; Percent _L8_CruiseControl; bool _L13_CruiseControl; } _C_SaturateThrottle; /* ======================== */ /* CONTEXT for node ThrottleRegulation */ /* ======================== */ /* Type for context */ typedef struct { bool _I0_Reset; Speed _I1_CruiseSpeed; Speed _I2_VehiculeSpeed; Percent _O0_Throttle; Speed _L1_CruiseControl; Speed _L2_CruiseControl; real _L3_CruiseControl; real _L6_CruiseControl; real ProportionnalAction; Speed _L22_CruiseControl; bool HoldIntegralAction; Speed _L16_CruiseControl; Speed _L23_CruiseControl; Speed _L18_CruiseControl; real _L10_CruiseControl; real _L8_CruiseControl; real IntegralAction; real _L4_CruiseControl; Percent _L13_CruiseControl; bool _L14_CruiseControl; bool _L19_CruiseControl; Speed _L21_CruiseControl; bool _M_init_0_CruiseControl; _C_SaturateThrottle _C0_SaturateThrottle; } _C_ThrottleRegulation; /* ======================== */ /* CONTEXT for node ThrottleCmd */ /* ======================== */ /* Type for context */ typedef struct { bool _I0_Regul_ON; Speed _I1_CruiseSpeed; Speed _I2_VehiculeSpeed; Percent _I3_Accelerator; Percent _O0_Throttle; bool _L21_CruiseControl; bool _L20_CruiseControl; bool _L22_CruiseControl; bool ONRisingEdge; Percent _L26_CruiseControl; Speed _L1_CruiseControl; Speed _L2_CruiseControl; Percent _L19_CruiseControl; Percent _L25_CruiseControl; Percent _L24_CruiseControl; bool _M_init_0_CruiseControl; _C_ThrottleRegulation _C0_ThrottleRegulation; bool _M_condact_2_CruiseControl; } _C_ThrottleCmd; /* ======================== */ /* CONTEXT for node CruiseStateMgt */ /* ======================== */ /* Type for context */ typedef struct { bool _I0_BrakePressed; bool _I1_AcceleratorPressed; bool _I2_Resume; bool _I3_On; bool _I4_Off; bool _I5_SpeedOutOffLimits; bool _O0_Regul_ON; bool _O1_Regul_OFF; bool _O2_Regul_STDBY; bool _LE24_CruiseControl; bool _LE0_CruiseControl; bool _LE4_CruiseControl; bool _LE40_CruiseControl; bool _LE26_CruiseControl; bool _LE28_CruiseControl; bool _LE9_CruiseControl; bool _LE10_CruiseControl; bool _LE11_CruiseControl; bool _LE33_CruiseControl; bool _LE35_CruiseControl; bool _LE38_CruiseControl; bool _LE12_CruiseControl; bool _LE13_CruiseControl; bool _LE14_CruiseControl; bool _LE17_CruiseControl; bool _LE18_CruiseControl; bool _LE3_CruiseControl; bool _LE16_CruiseControl; bool _LE41_CruiseControl; bool _LE19_CruiseControl; bool _LE20_CruiseControl; bool _LE21_CruiseControl; bool _LE1_CruiseControl; bool _LE5_CruiseControl; bool _LE22_CruiseControl; bool _LE23_CruiseControl; bool _LE25_CruiseControl; bool _LE29_CruiseControl; bool _LE2_CruiseControl; bool _LE30_CruiseControl; bool _LE31_CruiseControl; bool _LE32_CruiseControl; bool _LE34_CruiseControl; bool _LE42_CruiseControl; bool _LE6_CruiseControl; bool _LE15_CruiseControl; bool _LE39_CruiseControl; bool _LE43_CruiseControl; bool _LE7_CruiseControl; bool _LE27_CruiseControl; bool _LE36_CruiseControl; bool _LE37_CruiseControl; bool _LE44_CruiseControl; bool _LE8_CruiseControl; bool _M_init_0_CruiseControl; } _C_CruiseStateMgt; /* ======================== */ /* CONTEXT for node DetectPedalsPressed */ /* ======================== */ /* Type for context */ typedef struct { Percent _I0_Brake; Percent _I1_Accelerator; bool _O0_BrakePressed; bool _O1_AcceleratorPressed; Percent _L2_CruiseControl; Percent _L8_CruiseControl; bool _L4_CruiseControl; Percent _L1_CruiseControl; Percent _L7_CruiseControl; bool _L3_CruiseControl; } _C_DetectPedalsPressed; /* ======================== */ /* CONTEXT for node DetectSpeedLimits */ /* ======================== */ /* Type for context */ typedef struct { Speed _I0_speed; bool _O0_SpeedOutOffLimits; Speed _L7_CruiseControl; Speed _L13_CruiseControl; bool _L8_CruiseControl; Speed _L14_CruiseControl; bool _L9_CruiseControl; bool _L17_CruiseControl; } _C_DetectSpeedLimits; /* ======================== */ /* CONTEXT for node CruiseControl */ /* ======================== */ /* Type for context */ typedef struct { bool _I0_On; bool _I1_Off; bool _I2_Resume; bool _I3_Set; bool _I4_QuickAccel; bool _I5_QuickDecel; Percent _I6_Accel; Percent _I7_Brake; Speed _I8_Speed; Speed _O0_Cruise_speed; Percent _O1_Throttle_cmd; bool _O2_Regul_ON; bool _O3_Regul_OFF; bool _O4_Regul_STDBY; bool _L73_CruiseControl; Percent _L59_CruiseControl; Percent _L62_CruiseControl; bool BrakePressed; bool AcceleratorPressed; bool _L61_CruiseControl; bool _L60_CruiseControl; bool _L58_CruiseControl; Speed _L95_CruiseControl; bool SpeedOutOffLimits; bool _L82_CruiseControl; bool _L83_CruiseControl; bool _L84_CruiseControl; bool _L19_CruiseControl; Speed _L96_CruiseControl; bool _L38_CruiseControl; bool _L39_CruiseControl; bool _L40_CruiseControl; Speed _L23_CruiseControl; Speed CruiseSpeed; Percent _L26_CruiseControl; Percent _L22_CruiseControl; bool _M_init_CruiseControl; _C_CruiseSpeedMgt _C0_CruiseSpeedMgt; _C_DetectPedalsPressed _C1_DetectPedalsPressed; _C_DetectSpeedLimits _C2_DetectSpeedLimits; _C_CruiseStateMgt _C3_CruiseStateMgt; bool _M_condact_0_CruiseControl; _C_ThrottleCmd _C4_ThrottleCmd; } _C_CruiseControl; /* ============== */ /* INITIALISATION */ /* ============== */ extern void CruiseSpeedMgt_init(_C_CruiseSpeedMgt *); extern void SaturateThrottle_init(_C_SaturateThrottle *); extern void ThrottleRegulation_init(_C_ThrottleRegulation *); extern void ThrottleCmd_init(_C_ThrottleCmd *); extern void CruiseStateMgt_init(_C_CruiseStateMgt *); extern void DetectPedalsPressed_init(_C_DetectPedalsPressed *); extern void DetectSpeedLimits_init(_C_DetectSpeedLimits *); extern void CruiseControl_init(_C_CruiseControl *); /* ================ */ /* CYCLIC FUNCTIONS */ /* ================ */ extern bool CruiseSpeedMgt(_C_CruiseSpeedMgt *); extern bool SaturateThrottle(_C_SaturateThrottle *); extern bool ThrottleRegulation(_C_ThrottleRegulation *); extern bool ThrottleCmd(_C_ThrottleCmd *); extern bool CruiseStateMgt(_C_CruiseStateMgt *); extern bool DetectPedalsPressed(_C_DetectPedalsPressed *); extern bool DetectSpeedLimits(_C_DetectSpeedLimits *); extern bool CruiseControl(_C_CruiseControl *); /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** End of file CruiseControl.h ** End of generation (MM/DD/YYYY) : 07/06/2007 13:30:09 ********************************************************************$*/ frama-c-20.0-Calcium/tests/value/CruiseControl_const.c0000666000000000000000000000204513571573400017637 0ustar /* run.config* GCC: DONTRUN: */ /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** Command : ** l2C CruiseControl.lus -node CruiseControl ** -noexp @ALL@ ** -keep_named_var ** -const ** -bitwise ** -loc_ctx ** -no_copy_mem ** -debug ** date of generation (MM/DD/YYYY): 07/06/2007 13:30:09 ** last modification date for CruiseControl.lus (MM/DD/YYYY): 07/06/2007 ********************************************************************$*/ #include "CruiseControl.h" const Speed ZeroSpeed = (real) 0.0; const Speed SpeedInc = (real) 2.0; const Speed SpeedMax = (real) 150.0; const Speed SpeedMin = (real) 30.0; const Percent ZeroPercent = (real) 0.0; const real Kp = (real) 8.113; const real Ki = (real) 0.5; const Percent RegThrottleMax = (real) 45.0; /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** End of file CruiseControl_const.c ** End of generation (MM/DD/YYYY) : 07/06/2007 13:30:09 ********************************************************************$*/ frama-c-20.0-Calcium/tests/value/CruiseControl_extern.h0000666000000000000000000000177013571573400020027 0ustar /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** Command : ** l2C CruiseControl.lus -node CruiseControl ** -noexp @ALL@ ** -keep_named_var ** -const ** -bitwise ** -loc_ctx ** -no_copy_mem ** -debug ** date of generation (MM/DD/YYYY): 07/06/2007 13:30:09 ** last modification date for CruiseControl.lus (MM/DD/YYYY): 07/06/2007 ********************************************************************$*/ /* ========= */ /* CONSTANTS */ /* ========= */ extern const Speed ZeroSpeed; extern const Speed SpeedInc; extern const Speed SpeedMax; extern const Speed SpeedMin; extern const Percent ZeroPercent; extern const real Kp; extern const real Ki; extern const Percent RegThrottleMax; /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** End of file CruiseControl_extern.h ** End of generation (MM/DD/YYYY) : 07/06/2007 13:30:09 ********************************************************************$*/ frama-c-20.0-Calcium/tests/value/FP5.i0000666000000000000000000000065013571573400014236 0ustar /*@ requires \valid(b); @ requires \valid(c); @ requires \valid(&a); @ assigns *b; @ assigns *c; @*/ void main(int a, int *b, int *c) { int i=0; if (a==1) { *b=1; *c=1; } else if (a==-1) { *b=-1; *c=-1; } else { while (i= -10)) s = u3; else s = 0; if ((u2 <= 100) && (u2 >= -150)) t = u2; else t = 0; mm1 = (16+32*t) * (2+3*s); mm2 = (4+32*t) * (16+96*s); mm3 = (1+15*t) * (1+35*s); quo6 = (2007+15*s) / (-5); qu1 = (2007+15*s) / (20 + s); qu2 = (7+15*s) / (20 + s); ll1 = (long long)(5*s+3) + 0xFFFFFFFFL; ll2 = (long long)(5*s+1) + 0x100000003L; c1 = (int)ll1; c2 = (int)ll2; Frama_C_show_each_1(s); //@ assert (s >= 0) || (s < 0) ; square = s * s; } u2 = 34; u1 = u2 >> 2 ; 2[t]=3; p17 = -0x80000000; if (u4 & 1) p17 %= -1; return (*(2+t)) + t[2]; } frama-c-20.0-Calcium/tests/value/addr.i0000666000000000000000000000031113571573400014550 0ustar /* run.config* GCC: STDOPT: #"-main main" STDOPT: #"-main f" */ int t[5]; int x; int *p,*q; void f(int i) { // x = t[i]; p = t+i; // q = &t[i]; } void main () { t[2] = 77; f(2); } frama-c-20.0-Calcium/tests/value/addr2.i0000666000000000000000000000042413571573400014637 0ustar int x ; int t[13] ; extern void Frama_C_show_each_F(int ) ; void main(void) { int i ; { i = 0; // (&x+i)-&x; { { { while (1) { if (i <= 12) { } else { goto L; } Frama_C_show_each_F(i); i += 1; } } } L: ; } return; } } frama-c-20.0-Calcium/tests/value/addrofstring.c0000666000000000000000000000033613571573400016325 0ustar /* run.config* */ int main() { // String literals are lvalues char (*p)[4] = &("bar"); //wchar_t (*q)[4] = &(L"foO"); // Does not work yet if((*p)[1] != 'a') return -1; //if((*q)[1] != 'o') {}; return 0; } frama-c-20.0-Calcium/tests/value/affect_corrupt.i0000666000000000000000000000020513571573400016646 0ustar /* run.config* GCC: STDOPT: #"-main main" STDOPT: #"-absolute-valid-range 0-0x3" */ int *p,r=77; void main () { r = *p; } frama-c-20.0-Calcium/tests/value/ai_annot.i0000666000000000000000000000042013571573400015427 0ustar /* run.config* STDOPT: #"-load-module scope -scope-verbose 2 -remove-redundant-alarms -context-width 3" */ int u,v,w; int main(int x,int *p) { /*@ assert x >=0; */ /*@ assert \valid(p+1); */ /*@ assert \valid_read(p+2); */ *(p+1)=x; return x+*(p+2); } frama-c-20.0-Calcium/tests/value/alias.i0000666000000000000000000001037713571573400014744 0ustar /* run.config* STDOPT: #"-no-results-function f" STDOPT: #"-main main3" STDOPT: #"-main main4 -absolute-valid-range 0-0xFF" STDOPT: #"-main main5" STDOPT: #"-main main6 -absolute-valid-range 0-0xFF" STDOPT: #"-main main11 -absolute-valid-range 0-0xFF" STDOPT: #"-main main8 -absolute-valid-range 0-0xFF" */ void f(char*x,int*y) { (*x)++; *x++; (*x)++; (*y)++; } void f2(char*x) { char *q; (*x)++; q = x+1; (*q)++; Frama_C_dump_each(); } int A,B,C,D,E,F,G; int p[5] = {0,0}; int q[5] = {1,2,3,4,5}; int p2[5] = {0,0}; int q2[5] = {1,2,3,4,5}; int p3[5]; int t,u,v,w,x,y,z,t2,v2,*PTR1,*PTR2,*PTR3,*PTR4,*PTR5, *PTR6; volatile int c,c1,c2,c3,c4; void main (void) { volatile vol=0; /* SECTION 1 */ A=1; B=2; f((char*)&A,&B); f((char*)&A,&A); f((char*)&p,&B); /* SECTION 2 */ x = 1; y = 2; z = 3; PTR1 = c1? &y : &x; PTR2 = c2? &y : &z; PTR3 = PTR1; *PTR1 = 4; t = *PTR1; *PTR2 = 5; v = *PTR1; u = *PTR2; w = *PTR3; /* x in {1,4} && y in {2,4,5} && t = 4 && v in {4,5} && u = 5 && z in {3,5} */ /* SECTION 3 */ PTR4 = c3? &(p2[1]) : &(q2[2]); *PTR4 = 6; t2 = *PTR4; PTR4 [-1] = 7; v2 = *(PTR4+(v2-v2-1)); /* t2 = 6 && v2 = 7 */ p3[1] = vol; Frama_C_show_each_d0(p3[1]-vol); p3[0] = 0; Frama_C_show_each_d2(p3[1]-vol); } struct S { int a; int b; int c; } e,g; void main3() { struct S *p,*q,s1={2,4,6},s2={1,3,5}; p = c?&s1:&s2; p-> a = 7; t = p->b; z = 2; u = (c+1)?0:1; v = u; if (w==v) { z = u; } PTR1 = & ( p2 [(c+1)?0:((c+2)?1:2)] ); PTR2 = PTR1+1; *PTR1 = (c+10) ? 96 : (c+11) ? 97 : 98; PTR3 = p2 + ((c+3)?1:((c+4)?2:4)); *PTR3 = 99; PTR4 = PTR3; x = *PTR1; if (PTR4==PTR2) { t2 = *PTR1; v2 = PTR3 - PTR1; } else{ L: goto L; } } struct T { struct S s1; struct S s2; struct S s3; struct S s4;} h,i; void main4() { struct S *p,s,ss,sss; struct T *pt, t1= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12}, t2 ={21,22,23,24,25,26,27,28,29,30,31,32}; p = c?&(t1.s2):&(t2.s3); pt = c?(struct T*)(&(t1.s2)):(struct T*)(&(t2.s3)); p->a = 777; s = *p; pt -> s1.b = 888; sss = pt-> s1; pt = (struct S*)0; ss = pt->s1; z = 1000; u = (c+1)?0:((c+2)?1:2); v = u+1; x = (c+3)?1:((c+4)?2:5); y = x; if (y==v) { z = u - x; } } void main5() { struct S *p,s,ss,sss; struct T *pt, t1= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12}, t2 ={21,22,23,24,25,26,27,28,29,30,31,32}; if(c) { pt = (struct T*)(&(t1.s2)); pt -> s1.b = 888; } else { pt = (struct T*)(&(t2.s3)); pt -> s1.b = 999; } sss = pt-> s1; z = 2; u = (c+1)?0:1; v = u; if (v==w) { z = u; } } void main6(void) { int i = 0; if (c) PTR1 = &p[1]; else PTR1 = &q[2]; *PTR1 = 77; for (; i<100; i++) { x = i; } y = *PTR1; PTR2 = (int*) *PTR2; if (PTR2 == (char*)PTR1) z = *PTR2; else z = -33; u = c?0:1; v = u; w = v; u = (c+1)?0:1; } int tz1,tz2,tz3,tx,ty,tz; void main8(void) { tx = c?2:3; ty = tx+1; tz = ty+2; tz1 = tz==ty+2; tz2 = tz==tx+3; tz3 = tx==ty-1; A = c1 ? 3 : 4; B = A + 1; y = B == (A+1); t = (B + 3) - (A - 1); PTR1 = c2 ? &p[2] : &q[3]; PTR2 = (int*)((unsigned int)PTR1 + 4); PTR3 = PTR2 - 1; u = *PTR2; PTR1[1] = 44; v = *PTR2; w = *PTR1; *PTR1 = 33; x = *PTR1; z = *PTR3; if (c3) { PTR4 = &q2[1]; *PTR4 = 33; PTR5 = PTR1; } else { PTR4 = &q2[2]; *PTR4 = 44; PTR5 = PTR1 + 1; } C = *PTR4; D = *PTR5; } union u { long long ll ; int i ; char c ; }; union u U; char char1; long long ll1; void main11(void) { int i = 0; PTR3 = &p2[1]; *PTR3 = 33; while (c) { int * tm = &p2[2]; *tm = *tm; PTR3 = tm-1; } D = *PTR3; f2((char*)p2); t = c2?0:1; ll1 = (c2+1)?15:16; U.ll = ll1 + 1; if (c2+2) U.i = t + 2; else { L: goto L; } if (c) PTR1 = &p[1]; else PTR1 = &q[2]; *PTR1 = 77; for (; i<100; i++) { x = i; } y = *PTR1; PTR2 = (int*) *PTR2; if (PTR2 == (char*)PTR1) z = *PTR2; else z = -33; PTR4 = &q2[1]; *PTR4 = 33; while (c1++) { PTR4 = &q2[1]; *(PTR4-1) = 33; } A = *(PTR4 - 1); B = A - q2[0]; } frama-c-20.0-Calcium/tests/value/align.i0000666000000000000000000000051513571573400014736 0ustar int c[5][10]; void main() { char * d; d = (char*)c; d[2] = 'z'; ((char*)c[2])[1] = (char)'y'; ((char*)c)[1] = (char)'y'; // ((long long*)c[2])[2] = (char)'y'; // ((char**)c)[1][0] = (char)'y'; // seg fault ! *c[0] = (int)'x'; int l; int *pl = &l; *pl = 0; *((char*)pl)= 2; // l = l & 0b11111111000000000; } frama-c-20.0-Calcium/tests/value/align_char_array.c0000666000000000000000000000136513571573400017127 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -cpp-extra-args="-DPTEST" -journal-disable */ #ifndef PTEST #include #endif struct s { char c; char a[2]; }; struct s S; char t[10][10]={0,0,1,1,1,1,1}; int d1,s1,d2,s2,overlapread1, overlapread2, overlapread3, overlapread4; int main(void) { d1 = (int)&S.a - (int)&S.c; s1 = (int)sizeof(struct s); d2 = (int)&t[2][2] - (int)&t[0][0]; s2 = (int)sizeof(t); overlapread1 = *(int*)((int)t + 3); overlapread3 = 1 + *(int*)((int)t + 3); overlapread2 = *(int*)((int)t + 2); overlapread4 = 1 + *(int*)((int)t + 2); #ifndef PTEST printf("a-c: %d\nsize: %d\n", d1, s1); printf("t[2][2]-t[0][0]: %d\nsize: %d\n", d2, s2); #endif return 0; } frama-c-20.0-Calcium/tests/value/annot.i0000666000000000000000000000173713571573400014772 0ustar int A, B, C; int u, v, w; /*@ requires u == argf && v == 0; assigns u, v, w \from u; ensures u != \result; */ int main(int argf, int en1, int en2, int en3, int en4, unsigned int uc, int m, int n) { int x,y,z,t; x = 1; /*@ assert x == 1+u; */ Frama_C_show_each_diff(x - u); /*@ requires y != 2; @ ensures y == 2; */ y = 2; /*@ assert y == 2; */ z = 3; A = en1 ? 0 : 1; B = en2 ? 0 : 2; if (en3) { //@ assert A == 0 <==> A != 0 ; Frama_C_show_each_then_A_B(A,B); } else if (en4) { //@ assert ! (A == 0 <==> B == A) ; Frama_C_show_each_elseif_A_B(A,B); } else { //@ assert A == 0 <==> B == A ; Frama_C_show_each_else_A_B(A,B); } //@ assert 0 <= m <= n <= 9; Frama_C_show_each_mn(m, n); int a = 0, b = 1; /*@ assert (a || b) == b; */ /*@ assert (a && a) == a; */ int tt[3]; tt[0] = 1; //@ assert (uc > 0 || tt[uc] == 1) == \true; /*@ assert y == z; */ return z; } frama-c-20.0-Calcium/tests/value/annot_valid.i0000666000000000000000000000210113571573400016133 0ustar int G; int main (int u) { int *p; L: p = &G; char *c = &G; switch (u) { case 0: //@ assert \valid(p); break; case 1: //@ assert \valid(p+1); break; case 2: //@ assert \valid((char*)p+1); break; case 3: //@ assert \valid(c+1); break; case 4: //@ assert \valid(c+3); break; case 5: //@ assert \valid(c+4); break; case 6: //@ assert (char *)p < c; break; case 7: //@ assert p <= (int*)1; break; case 8: //@ assert (int)p == 3; break; case 9: //@ assert (int)p != 3; break; case 10: //@ assert \exists int x ; x != 0 ==> *p == x; break; case 11: //@ assert \forall int x ; \true; break; case 12: //@ assert \valid((long long *)5); break; case 13: //@ assert \valid(p); break; case 14: //@ assert (\valid((char*)5)); break; case 15: //@ assert p != \null; break; case 16: //@ assert \valid{L}(p); //@ assert !\at(\valid(p), L); break; case 17: { int x; p = &x; //@ assert !\valid{L}(p); // Incorrect break; } } return 0; } frama-c-20.0-Calcium/tests/value/anonymous_field.i0000666000000000000000000000044513571573400017041 0ustar struct { int a ; struct { int gcc_a ; int gcc_b ; } ; int b ; } Sa ; //@ ensures Sa.gcc_a == Sa.a && Sa.gcc_b == Sa.b; void set_anonymous_struct (void) { Sa.gcc_a = Sa.a ; Sa.gcc_b = Sa.b ; } int main () { Sa.a = 42; Sa.b = 3; set_anonymous_struct(); return 0; } frama-c-20.0-Calcium/tests/value/any_int.c0000666000000000000000000000046013571573400015276 0ustar // This very strange code was used to generate any possible integer a long // time ago. It is kept only to test relational domains that may erroneously // learn information about volatile l-values. int main() { volatile int y=0; int x=0; while(y) {y++;y++; if (y-1) x++; else x--;} return x; } frama-c-20.0-Calcium/tests/value/arch.i0000666000000000000000000000021713571573400014560 0ustar int a,b,c; unsigned long l; int t[10]; void main(void) { l = (unsigned long)t; a = sizeof(int); b = sizeof(long); c = sizeof(int*); } frama-c-20.0-Calcium/tests/value/arg_array.i0000666000000000000000000000014013571573400015605 0ustar void main(int *ptr, int T[4]) { *T=0; ptr = T; ptr[1]=1; 2[ptr] = 2; T=T; return; } frama-c-20.0-Calcium/tests/value/arith_pointer.c0000666000000000000000000000200113571573400016475 0ustar /* run.config* STDOPT: +"-ulevel 22" +"-then -eva-no-warn-pointer-subtraction" */ // #include int a; int t[25]; void main1() { int i,j; for (i=-10; i< 10; i++) { t[i+10] = (int*)(i+10)-(int*)10; // printf("%d\n",(int*)(i+10)-(int*)10); } j = -i; // printf("%d %d\n",(int)&a,(int)(&a-(int*)0)); } volatile int vol; void main2() { int x, y; int d; int *p1 = &x; int *p2 = &y; if (vol) { d = p1 - p2; Frama_C_show_each(d); } p2 = (char*)&x + 3; d = p1 - p2; Frama_C_show_each(d); p2 = (char*)&x - 3; d = p1 - p2; Frama_C_show_each(d); if (vol) { p1 = &x+1; p2 = &x+7; } else { p1 = &y+8; p2 = &y+19; } d = p2 - p1; Frama_C_show_each(d); d = p2 - p2; Frama_C_show_each(d); p1 = &x + (int)&x; p2 = &x; d = p2 - p1; Frama_C_show_each(d); int i = vol; //@ assert 0 <= i <= 4; p1 = &x + i; p2 = p1 + 1; d = p2 - p1; Frama_C_show_each(d); //@ assert d == 1; } void main() { main1(); main2(); } frama-c-20.0-Calcium/tests/value/array_access.c0000666000000000000000000000114313571573400016273 0ustar int t1[] = {1,2,3,4,5,6,7,8,9}; int t2[] = {11,12,13,14,15,16,17,18,19}; char ch[] = { 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,1, 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1, 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,3,4 }; int R; //@ assigns \result \from \nothing; int any_int(void); void main () { int i,j=10,k=88,c,*p,LT[10]={1}; i = any_int(); c= any_int(); if (i>=0 && i<=8 ) {Frama_C_show_each_I(i);p=(c?t1:t2)+i;j = *p+1-1; k = LT[-i-1] + 1 -1 ; } R = ((int*)ch)[any_int()]; } frama-c-20.0-Calcium/tests/value/array_array.c0000666000000000000000000000250213571573400016150 0ustar /* run.config* GCC: STDOPT: #"-main main" STDOPT: #"-main main2" STDOPT: #"-main main3" */ char StaticAllocHEAP[10000]={2,2,2,2}; void *LIB_MEM_StaticAlloc(int size, int hint) { static int next_free=0; Frama_C_show_each_ALLOCATION_WITH_STATIC_ALLOC(size); void * new = &(StaticAllocHEAP[next_free]); /* Enforce a 4 byte boundary for allocation */ next_free += (size%4==0)?size:size+4-size%4; return new; } struct S {int fst; char snd;}; #define MAX 3 void main() { struct S (*v)[MAX]; v = (struct S(*)[MAX]) LIB_MEM_StaticAlloc(sizeof(struct S) * MAX, 0); int i = 29; do { Frama_C_show_each_I(i); v[0][i].snd=1;} while (i-- > -1); v[0][i].fst = 0; } void main2(void) { struct S (*v)[3] ; int i ; int tmp___0 = 0; { v = (struct S (*)[3])LIB_MEM_StaticAlloc((int )(sizeof(struct S ) * 3U), 0); i = 29; { while (1) { Frama_C_show_each_TMP(tmp___0); Frama_C_show_each_I(i); (*(v + 0))[i].snd = (char)1; tmp___0 = i; i --; if (! (tmp___0 > -1)) { goto while_0_break; } } while_0_break: /* CIL Label */ ; } (*(v + 0))[i].fst = 0; return; } } void main3() { struct S (*v)[MAX]; v = (struct S(*)[MAX]) LIB_MEM_StaticAlloc(sizeof(struct S) * MAX, 0); int i = 29; do { v[0][i].snd=1; i--;} while (i > 0); v[0][i].fst = 0; } frama-c-20.0-Calcium/tests/value/array_bounds.i0000666000000000000000000000070413571573400016334 0ustar /* run.config* STDOPT: #"-main main" STDOPT: #"-unsafe-arrays" */ volatile int c; struct { int a; int T[12]; int b; } s = {1,0,1,2,3,4,5,6,7,8,9,10,11,20}; struct { int a; int T[12]; int b; } u = {1,0,1,2,3,4,5,6,7,8,9,10,11,20}; void main() { s.a = 9; s.b = 9; for(int i=0; i+5<17; i++) { Frama_C_show_each(i); u.T[i] = c; } if (c) { for(int j=0; j+5<=17; j++) { s.T[j] = c; // Invalid } u.a = -1; } } frama-c-20.0-Calcium/tests/value/array_degenerating_loop.i0000666000000000000000000000020513571573400020523 0ustar int t[100]={1,1}; void main(int arg) { int G=55; int i; for (i=0; i<=arg; i++) G += t[i]; Frama_C_show_each(G,arg); } frama-c-20.0-Calcium/tests/value/array_initializer.i0000666000000000000000000000042113571573400017361 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -then -eva-initialization-padding-globals maybe */ int t[5] = { [2] = 3 }; struct { char a; int t[5]; } s = { 'a' , { [2] = 3 } }; int u[6] = { [4] = 4, [2] = 2 }; void main(void) { } frama-c-20.0-Calcium/tests/value/array_loop.i0000666000000000000000000000030113571573400016004 0ustar int t[20]={17,18,19,20,21,22,23,24,1,1,1,1,1,1,1,1,1,1}; int tt[20]={17,18,19,20,21,22,23,24,1,1,1,1,1,1,1,1,1,1}; void main(void) { int i; for (i=0; i<=15; i++) t[i/2] = -i+tt[i]; } frama-c-20.0-Calcium/tests/value/array_overlap.i0000666000000000000000000000044413571573400016513 0ustar char T[10]={1,1,1,2,2,3,0}; char U[10]={1,1,1,2,2,3,0}; struct S { char t[6]; }; volatile int rand; void main () { struct S* ptr; ptr = &T[1]; if (rand) *ptr = *(struct S*)(&T[0]); {int i; if (rand) i = 0; else i = 1; ptr = &U[i]; *ptr = *(struct S*)(&U[0]); } } frama-c-20.0-Calcium/tests/value/array_ptr.i0000666000000000000000000000030013571573400015637 0ustar int G = 1; typedef int param_check[20]; int f(param_check **x) { G=(**x)[0]; (**x)[0] = 2; return 2; } param_check l={1}; int main() { int g = (int) &l; f((param_check **)&g); } frama-c-20.0-Calcium/tests/value/array_zero_length.i0000666000000000000000000000212013571573400017354 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -journal-disable -machdep gcc_x86_32 OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -lib-entry -journal-disable -machdep gcc_x86_32 OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -lib-entry -journal-disable */ char T[]; char U[0]; char V[][2]; char W[][0]; char T1[] = {}; char U1[0] = {}; char V1[][2] = {}; char W1[][0] = {}; char W2[2][1]; char *pW; void main(int c, char **v) { unsigned sT = sizeof(T); // error unsigned sU = sizeof(U); //@assert sU == 0; unsigned sV = sizeof(V); // error unsigned sW = sizeof(W); // error unsigned sT1 = sizeof(T1); //@assert sT1 == 0; unsigned sU1 = sizeof(U1); //@assert sU1 == 0; unsigned sV1 = sizeof(V1); //@assert sV1 == 0; unsigned sW1 = sizeof(W1); //@assert sW1 == 0; unsigned sW2 = sizeof(W2); T[2]= 3; if (c&1) T[1] = T[3] +3; if (c&8) V[2][1] = 3; if (c&16) V[1][1] = V[3][1] +3; if (c&32) W[2][1] = 3; if (c&64) W[1][1] = W[3][1] +3; if (c&128) pW = &W[0][1]; } frama-c-20.0-Calcium/tests/value/asm_contracts.c0000666000000000000000000000115613571573400016500 0ustar #include void f1() { int src = 1; int dst = 0; asm ("mov %1, %0\n\t" "add $1, %0" : "=r" (dst) : "r" (src)); //@ assert OK: src == 1; //@ assert UNKNOWN1: dst != 0; //@ assert UNKNOWN2: dst == 2; } void f2() { uint32_t dwRes; uint32_t dwSomeValue = 42; asm ("bsfl %1,%0" : "=r" (dwRes) : "r" (dwSomeValue) : "cc"); // FLAGS register is clobbered //@ assert OK: dwSomeValue == 42; //@ assert UNKNOWN1: dwRes != 0; } void f3() { int x = 1; asm ("bla"); //@ assert UNKNOWN: x == 1; } int main() { f1(); f2(); f3(); return 0; } frama-c-20.0-Calcium/tests/value/assert_ptr.i0000666000000000000000000000044613571573400016035 0ustar int *ptr, **q, s_q, a, r; int main(int c, int d, int e) { q = &s_q; if (c) ptr = &a; if (d) *q = (&a + e) ; /*@ assert ptr == 0 || ptr != 0 ; */ Frama_C_show_each_ptr(ptr); if (ptr != 0) (*ptr)++; /*@ assert \valid(*q) && *q != 0 ; */ Frama_C_show_each_q(s_q); return 0; } frama-c-20.0-Calcium/tests/value/assign-leaf-indirect.i0000666000000000000000000000022113571573400017626 0ustar int x,y,z; /*@ assigns y \from *p, p; */ void f(int*p); /*@ assigns z \from *p, indirect:p; */ void g(int*p); void main() { f(&x); g(&x); } frama-c-20.0-Calcium/tests/value/assigns.i0000666000000000000000000000355213571573400015317 0ustar /* run.config* STDOPT: +"-print -inout" */ volatile int v; int G; //@ assigns s[..] \from s[..]; void F1(char *s); char T[100]; char Tpost[100]; typedef struct { int f1; int f2; } ts; ts t[10]; int t2[100000]; int t3[100000]; //@ assigns *(p+(0..3)) \from *(p+(4..7)); void f (char *p); //@ assigns t2[((unsigned char)len)+1 .. ((unsigned char)len)+1] \from \nothing; void g(int len); //@ assigns p[..] \from \nothing; void h(int *p); /*@ type Lint = int; */ /*@ logic Lint foo(Lint p) ; */ //@ assigns p[0..foo(*p)] \from \nothing; void j(int *p); int x; int k = 53; /*@ assigns x \from \at(x, Post); assigns Tpost[\at(i, Post)]; assigns Tpost[\at(k, Post)]; */ void assigns_post(int i); void main1(void) { F1(T); for (int i=0;i<=5;i++) f((char*)&t[i].f2); g(2 * (int)(&T) ); h((int*)(2 * (int)(&t3))); j((int*)(T+9)); assigns_post(18); } //@ assigns \result; int ff1(void); int* ff2(void); //@ assigns \nothing; int* ff2_bis(void); int y1, y2, y3; /*@ assigns y1, y2, y3; assigns y2 \from y2;*/ void ff3(void); void ff4(void); int ff5(void); int main2() { int l = ff1(); ff3(); // warn for absence of \from for y1 and y3 ff4(); // No warning, result has type void ff5(); // No warning, result is unused int *p = ff2(); // warn on missing assigns \result int *q = ff2_bis(); // make sure to return NULL in the result if (p != &x) return 1; return 0; } int t_main3_1[7][8]; int t_main3_2[3][4][5]; int main3(int a[][8], int b[3][4][5]); ts t_main4[1000]; ts u_main4[100]; //@ assigns t_main4[i].f1 \from \nothing; assigns u_main4[i].f1 \from \nothing; void f_main4_1(int i); //@ assigns t_main4[0..999].f1 \from \nothing; assigns u_main4[0..99].f1 \from \nothing; void f_main4_2(void); void main4() { f_main4_1(v); f_main4_2(); } void main() { main1(); main2(); main3(t_main3_1, t_main3_2); main4(); } frama-c-20.0-Calcium/tests/value/assigns_from.i0000666000000000000000000000767413571573400016353 0ustar /* run.config* STDOPT: #"-from-verify-assigns" */ int u; int v; int k; void f(void) { k = u; } /*@ assigns u,k; behavior true: assumes u <= 3; assigns u \from v; assigns k \from \nothing; behavior ok_too_large: assumes u <= 3; assigns u \from v,k; assigns k \from u; behavior wrong: assumes \true; assigns k \from \nothing; assigns u \from u; */ void main1(void) { f(); u = v; k = 3; } int a[10]; /*@ assigns a[3], a[4], a[5] \from \nothing; */ void main15(void){ a[3] = 2; a[4] = 3; a[5] = 4; } /*@ assigns a[3..5] \from \nothing; behavior true: assumes \true; assigns a[2..5] \from a[..]; behavior wrongassigns: assumes \true; assigns a[3..4] \from \nothing; behavior true2: assumes \true; assigns a[..] \from a[..]; behavior wrongfrom: assumes \true; assigns a[1..] \from \nothing; */ void main2(void){ a[3] = 2; a[4] = 3; a[5] = 4; } /*@ assigns a[i] \from (indirect:i),a[..]; */ void main3(int i){ a[i] = 3; } int constante = 2; /*@ behavior true: assigns a[constante] \from \nothing; behavior wrong: assumes \true; assigns a[..] \from a[i]; */ /* This is correct: actually, only a[2] is assigned from \nothing. */ void main4(int i){ a[2] = 3; } /*@ behavior wrong: assumes \true; assigns a[..] \from a[i]; behavior true: assigns a[2] \from a[sizeof(int)]; */ void main5(int i){ a[2] = a[4]; } /*@ assigns a[i..j]; */ void main6_wrong(int i, int j){ a[2] = 0; a[3] = 0; a[4] = 0; a[5] = 0; a[6] = 0; } /*@ assigns a[i..j]; */ void main6_right(int i, int j){ a[3] = 0; a[4] = 0; a[5] = 0; } /*@ behavior right: assigns a[\union(2,7,8)]; behavior wrong: assigns a[\union(2,7)]; */ void main7(void){ a[2] = 0; a[7] = 0; a[8] = 0; } /*@ assigns *p \from (indirect:p); */ void main8(int *p){ *p = 4; } /*@ assigns *(char *)\null; assigns \empty; assigns a[\union(1,\empty)]; assigns a[1+2]; assigns a[(int)1+2]; */ void main9(void) {} /*@ assigns \result \from a,b; ensures a <= \result <= b; */ extern int Frama_C_interval(int a,int b); void main10(void){ int t10[50]; extern int c(void); int i; for( i = 0; i < 50; i++) { if(c()) t10[i] = 3; } /*@ assert \initialized( &t10[11..25] + (3..12)); */ } /*@ assigns a[i == 4? 1 : 2] \from \nothing; */ void main11(int i){ a[2] = 3; } int t[100]; int* p_t = t; /*@ behavior ok: assigns \result \from \nothing; */ int * main12 (void) { return t; } /*@ behavior ok: assigns \result \from p_t; behavior bad: assigns \result \from \nothing; */ int * main13 (void) { return p_t; } /*@ assigns t[\union((2 .. 17) , (18 .. 38))] \from \nothing; */ void main14(void){ for(int i = 2; i <= 38; i++) {t[i] = i; } } /*@ assigns t[\union((2..17),\union(1,19,18))] \from \nothing; */ void main16(void){ for(int i = 1; i <= 19; i++) {t[i] = i; } } int t17[10]; //@ assigns *(char*)(&p[0..i-1]) \from p, i; void main17(int *p, int i) { for (int j = 0; j unsigned int S; unsigned int A,B; #define SIZE 4 #define TESTa(c, s, a) S=s, A=a #define TESTb(c, s, a, b) S=s,A=a,B=b //-------------------------------------------------------------------- struct c { char ca; }; static void ct(void) { TESTa("c", sizeof(struct c), offsetof(struct c, ca)); // : size : 01 // gcc : 1 : |a| } //-------------------------------------------------------------------- struct d { char da; } __attribute__((__aligned__(SIZE))); static void dt(void) { TESTa("d", sizeof(struct d), offsetof(struct d, da)); // : size : 01234 // gcc : 4 : |a---| } //-------------------------------------------------------------------- struct p { char pa __attribute__((__aligned__(SIZE))); }; static void pt(void) { TESTa("p", sizeof(struct p), offsetof(struct p, pa)); // : size : 01234 // gcc : 4 : |a---| } //-------------------------------------------------------------------- struct q { char qa __attribute__((__aligned__(SIZE))); char qb; }; static void qt(void) { TESTb("q", sizeof(struct q), offsetof(struct q, qa), offsetof(struct q, qb)); // : size : 01234 // gcc : 4 : |ab--| } //-------------------------------------------------------------------- struct r { char ra; char rb __attribute__((__aligned__(SIZE))); }; static void rt(void) { TESTb("r", sizeof(struct r), offsetof(struct r, ra), offsetof(struct r, rb)); // : size : 012345678 // gcc : 8 : |a---b---| } //-------------------------------------------------------------------- struct s { char sa __attribute__((__aligned__(SIZE))); char sb __attribute__((__aligned__(SIZE))); }; static void st(void) { TESTb("s", sizeof(struct s), offsetof(struct s, sa), offsetof(struct s, sb)); // : size : 012345678 // gcc : 8 : |a---b---| } //-------------------------------------------------------------------- struct t { char ta; char tb[0] __attribute__((__aligned__(SIZE))); }; static void tt(void) { TESTb("t", sizeof(struct t), offsetof(struct t, ta), offsetof(struct t, tb)); // : size : 012345678 : comment // gcc : 4 : |a---| : b at offset 4, outside the struct // frama-c : 8 : |a---b---| : b of size 1 instead of 0 } //-------------------------------------------------------------------- int main(void) { ct(); dt(); pt(); qt(); rt(); st(); tt(); return 0; } frama-c-20.0-Calcium/tests/value/auto_loop_unroll.c0000666000000000000000000000741613571573400017241 0ustar /* run.config* STDOPT: +"-eva-auto-loop-unroll 10" STDOPT: +"-eva-auto-loop-unroll 128" */ /* Tests the automatic loop unrolling heuristic. */ #include <__fc_builtin.h> volatile int undet; int g = 0; void incr_g () { g++; } int incr (int i) { return i+1; } void simple_loops () { int res = 0; /* This loop should be automatically unrolled on the second run. */ for (int i = 0; i < 100; i++) { res++; } Frama_C_show_each_auto(res); res = 0; /* This loop should not be automatically unrolled. */ for (int i = 0; i < 1000; i++) { res++; } Frama_C_show_each_imprecise(res); res = 0; /* The annotation has priority over the automatic loop unrolling: this loop should never be unrolled. */ /*@ loop unroll 0; */ for (int i = 0; i < 100; i++) { res++; } Frama_C_show_each_imprecise(res); res = 0; /* The annnotation has priority over the automatic loop unrolling: this loop should always be unrolled. */ /*@ loop unroll 100; */ for (int i = 0; i < 100; i++) { res++; } Frama_C_show_each_singleton(res); } /* Examples of various loops that should be automatically unrolled on the second run, but not on the first. */ void various_loops () { int res = 0; /* Decreasing loop counter. */ for (int i = 64; i > 0; i--) res++; Frama_C_show_each_64(res); res = 0; /* Decrements the loop counter by 3. */ for (int i = 120; i > 0; i -= 3) res++; Frama_C_show_each_40(res); res = 0; /* Several increments of the loop counter. */ for (int i = 0; i < 160; i++) { i += 2; res++; i--; } Frama_C_show_each_80(res); res = 0; /* Random increments of the loop counter. */ for (int i = 0; i < 160;) { res++; if (undet) i += 2; else i += 5; } Frama_C_show_each_32_80(res); res = 0; /* Other loop breaking condition. */ for (int i = 0; i < 111; i++) { res++; if (undet && res > 10) break; } Frama_C_show_each_11_111(res); res = 0; /* More complex loop condition. */ int x = 24; int k = Frama_C_interval(0, 10); for (int i = 75; i + x > 2 * k; i -= 2) res++; Frama_C_show_each_40_50(res); res = 0; /* Loop calling some functions that do not modify the loop counter. */ for (int i = 0; i < 25; i++) { incr_g(); int t = incr(i); res = incr(res); } Frama_C_show_each_25(res); res = 0; /* Nested loops. */ res = 0; for (int i = 0; i < 16; i++) { for (int j = 0; j < i; j++) { res++; } } Frama_C_show_each_120(res); res = 0; } /* Loops that cannot be unrolled. */ void complex_loops () { /* Loop counter modified through a pointer. */ int res = 0; int i = 0; int *p = &i; while (i < 64) { (*p)++; res++; } Frama_C_show_each_imprecise(res); /* Loop counter modified within a nested loop. */ res = 0; i = 0; while (i < 64) { for (int j = 0; j < i; j++) { i++; } res++; i++; } Frama_C_show_each_imprecise(res); /* Loop counter incremented under a condition. */ res = 0; i = 0; while (i < 10) { if (undet) i++; res++; } Frama_C_show_each_imprecise(res); res = 0; i = 0; while (i < 10) { if (undet) i++; else i++; res++; } Frama_C_show_each_imprecise(res); /* Loop counter modified by a function. */ res = 0; g = 0; while (g < 64) { incr_g(); g++; res++; } Frama_C_show_each_imprecise(res); res = 0; /* Too complex loop condition. */ int t[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; i = 0; while (t[i] < 6) { i++; res++; } Frama_C_show_each_imprecise(res); res = 0; /* Random loop condition. */ i = 0; while (i < 64 && undet) { i++; res++; } Frama_C_show_each_imprecise(res); } void main () { simple_loops (); various_loops (); complex_loops (); } frama-c-20.0-Calcium/tests/value/automalloc.i0000666000000000000000000000063013571573400016002 0ustar /* run.config* STDOPT: #"-eva-no-builtins-auto" */ typedef unsigned int size_t; void*malloc(size_t s); void*realloc(void*ptr,size_t s); void*alloca(size_t s); void free (void * ptr); void*calloc (size_t nmemb, size_t size); void main(int test) { char * buf=0; if (test) buf = (char*)malloc(sizeof(char)*5); else buf = (char*)realloc(&test,sizeof(char)*6); if (test) buf[1] = 16; return; } frama-c-20.0-Calcium/tests/value/backward_add_ptr.c0000666000000000000000000001230013571573400017104 0ustar /* run.config* STDOPT: #"-eva-warn-key garbled-mix" */ /* Test the soundness and the precision of backward reductions for the addition and subtraction of pointers and integers (binop PlusPI and MinusPI of Cil). */ #include volatile uintptr_t rand; /* Use as undeterminism. */ /* Reduction by the valid part of the location (p + q), where p and q are precise pointers or integers. tests the backward propagation of this reduction into p and q. */ void main1 () { int a = 0, b = 1; int *p = rand ? &a : (int*)rand; int *q = rand ? &b : (int*)rand; int v; char w; if (rand) { /* According to the C semantics, computes (p + sizeof(*p) q), so the b address from q is lost in the operation. */ v = *((p + (uintptr_t)q)); Frama_C_show_each_only_a(v, p, q); } if (rand) { /* Here, sizeof(*p) = 1, so &a+[0..3] and &b+[0..3] are both valid pointers resulting from the operation, and no address can be lost. */ w = *(((char *)p + (uintptr_t)q)); Frama_C_show_each_reduced_offset(w, p, q); } if (rand) { /* (q / 4) is a garbled mix, so no reduction is feasible. */ v = *((p + ((uintptr_t)q / 4))); Frama_C_show_each_no_reduction(v, p, q); } } /* Reduction of the resulting location according to the pointed value of (p + q), where p and q are both precise pointers or integers. tests the backward propagation of this reduction into p and q. */ void main2 () { int a = 0, b = 1; int *p = rand ? &a : (int*)rand; int *q = rand ? &b : (int*)rand; if (rand) if (*( (int *) ((char*)p + (uintptr_t)q)) == 0) Frama_C_show_each_int_if(p, q); else Frama_C_show_each_int_else(p, q); if (rand) if (*( (char *) ((char*)p + (uintptr_t)q)) == 0) Frama_C_show_each_char_if(p, q); else Frama_C_show_each_char_else(p, q); } /* Garbled Mix creator since 1987. */ int* gm(int *p) { return (int *) ((uintptr_t) p * 2 / 2); } /* Backward propagation of a reduction on (p + q), where p is a garbled mix, and q a precise pointer or an integer. */ void main3 () { int a = 0, b = 1, c = 2; int *p = gm (&a); int *q = rand ? &b : (int*)rand; int v; char w; if (rand) { /* According to the C semantics, computes (p + sizeof(*p) q), so the b address from q is lost in the operation. */ v = *((p + (uintptr_t)q)); Frama_C_show_each_GM_only_a(p, q); } if (rand) { /* Here, size = 0, so &b+[0..3] is valid, and p is reduced accordingly. */ w = *(((char*)p + (uintptr_t)q)); Frama_C_show_each_GM_reduce_p_offset(p, q); } p = gm (&a); q = &b; if (rand) { /* The same but q is only a pointer, so &a is impossible too. */ v = *((p + (uintptr_t)q)); Frama_C_show_each_GM_BOTTOM(p, q); } p = gm (rand ? &a : &b); q = rand ? &b : (int*)rand; if (rand) { /* Here, &b appear in the garbled mix of p, and may interfere with the (4 * &b) from q: no reduction is feasible. */ v = *((p + (uintptr_t)q)); Frama_C_show_each_GM_no_reduction(p, q); } p = gm (rand ? &a : &b); q = rand ? &c : (int*)rand; if (rand) { /* &c is the only valid location after the condition, so q = &c and p = 0. */ if ( *(((char*)p + (uintptr_t)q)) == 2) Frama_C_show_each_GM_only_c(p, q); } if (rand) { /* &b is the only valid location after the condition, so p = &b+[..] and q is an integer. */ if ( *((p + (uintptr_t)q)) == 1) Frama_C_show_each_GM_only_b(p, q); } p = gm (rand ? &a : &b); q = rand ? &b : (int*)rand; if (rand) { /* No pointer on c, so bottom after the condition. */ if ( *(((char*)p + (uintptr_t)q)) == 2) Frama_C_show_each_GM_BOTTOM(p, q); } if (rand) { /* &b is the only valid location after the condition, but it may be builds by any combination of a garbled mix of &b for p. */ if ( *(((char*)p + (uintptr_t)q)) == 1) Frama_C_show_each_GM_only_b_and_gm(p, q); } } /* Backward propagation of a reduction on (p + q) when p and q are garbled mix. */ void main4() { int a = 0, b = 1, c = 2; int *p = gm (rand ? &a : &b); int *q = gm (&c); int v; char w; if (rand) { /* Garbled mixs on both sides, no reduction. */ v = *((p + (uintptr_t)q)); Frama_C_show_each_2GM_no_reduction(p, q); } if (rand) { /* &b is the only valid location after the condition. */ if ( *(((char*)p + (uintptr_t)q)) == 1) Frama_C_show_each_2GM_only_b(p, q); } p = gm (rand ? &a : &b); q = gm (rand ? &b : &c); if (rand) { /* &b is the only valid location after the condition. */ if ( *(((char*)p + (uintptr_t)q)) == 1) Frama_C_show_each_2GM_TEST(p, q); } if (rand) { /* &a is the only valid location after the condition, but it may be obtained by a combination between GM(&a, &b) and GM(&b). */ if ( *((p + (uintptr_t)q)) == 0) Frama_C_show_each_2GM_gm_of_a_b(p, q); } if (rand) { /* &c is the only valid location after the condition, but it may be obtained by a combination between GM(&b) and GM(&b,&c). */ if ( *(((char*)p + (uintptr_t)q)) == 2) Frama_C_show_each_2GM_gm_of_b_c(p, q); } } int main() { main1(); main2(); main3(); main4(); /* a = 0; */ /* b = 1; */ /* c = 2; */ return 0; } frama-c-20.0-Calcium/tests/value/backward_arith.i0000666000000000000000000000146213571573400016613 0ustar /* run.config* */ /* Test the soundness of arithmetic backward propagators. */ volatile int nondet; void unsigned_neg () { unsigned int x = nondet; unsigned int minus_ten = -10; /* minus_ten = 4294967286. */ if (-x == minus_ten) Frama_C_show_each_ten(x); else Frama_C_show_each_not_ten(x); if (-x < minus_ten) Frama_C_show_each_greater_than_ten_or_zero(x); else Frama_C_show_each_smaller_than_ten_but_zero(x); if (-x == 10) Frama_C_show_each_minus_ten(x); /* 4294967286 */ else Frama_C_show_each_not_minus_ten(x); /* not 4294967286 */ if (-x < 10) Frama_C_show_each_greater_than_minus_ten_or_zero(x); /* > 4294967286 or 0 */ else Frama_C_show_each_smaller_than_minus_ten_but_zero(x); /* <= 4294967286 but 0 */ } int main () { unsigned_neg (); return 0; } frama-c-20.0-Calcium/tests/value/bad_loop.i0000666000000000000000000000033013571573400015416 0ustar volatile int c; void main () { int x; volatile int d=0,e=0; x = 2; while(1) { L1: if (c) goto FIN; if (d) goto L2; x = 0; } while (1) { L2: if (c) break; if (e) goto L1; x=1; } FIN: ; } frama-c-20.0-Calcium/tests/value/base_addr_offset_block_length.i0000666000000000000000000000155513571573400021636 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -context-width 3 -then -slevel 3 */ int x, y; short z; //@ requires formal != 0; void main(int c, int *formal) { int* px = &x + 1; int* px2 = &x + 3; int* py = &y + 2; short* pz = &z + 2; int *p = c ? &x + 1 : &y; int *q = p + 1; //@ assert \offset(px) == sizeof(int); //@ assert \offset(px) != \offset(py); //@ assert \offset(px) == \offset(pz); //@ assert \offset(q) == \offset(p)+sizeof(int); //@ assert \base_addr(px) != \base_addr(py); //@ assert \base_addr(px) == \base_addr(px2); //@ assert \base_addr(p) == \base_addr(q); //@ assert \block_length(p) == \block_length(&x); //@ assert \block_length(p) == sizeof(x); //@ assert \block_length(&x) > \block_length(&z); //@ assert \block_length(formal) >= 4; //@ assert \block_length(formal) <= 12; } frama-c-20.0-Calcium/tests/value/behavior_statuses.i0000666000000000000000000000114513571573400017376 0ustar /* run.config* STDOPT: +"-kernel-msg-key prop-status,-prop-status:register" STDOPT: +"-kernel-msg-key prop-status,-prop-status:register -eva-use-spec f" */ struct s { int t; }; volatile int nondet; /*@ requires \valid_read(filename); assigns \result \from nondet; behavior t_null: assumes t == \null; behavior t_not_null: assumes t != \null; requires \valid_read(t); disjoint behaviors; complete behaviors; */ int f(const char *filename, const struct s *t) { return 1; } int main() { struct s t = {1}; int r1 = f("/tmp/foo", 0); int r2 = f("/tmp/foo", &t); return 0; } frama-c-20.0-Calcium/tests/value/behaviors1.i0000666000000000000000000003241313571573400015711 0ustar /* run.config* STDOPT: +"-eva-verbose 2" */ /*@ assigns \result \from a, b; ensures \result > 0; behavior b1: assumes a == 0; assigns \result \from a; ensures \result == 4 || \result == 5; behavior b2: assumes a != 0 && b == 0; assigns \result \from a, b; ensures \result == 2; behavior b3: assumes a != 0 && b != 0; assigns \result \from a, b; ensures \result == 3; behavior b4: assumes a == 0 && b == 0; assigns \result \from a, b; ensures \result == 4; behavior b5: assumes a == 0 && b != 0; assigns \result \from a, b; ensures \result == 5; */ int f_none(unsigned int a, unsigned int b) ; /*@ assigns \result \from a, b; ensures \result > 0; behavior b1: assumes a == 0; assigns \result \from a; ensures \result == 4 || \result == 5; behavior b2: assumes a != 0 && b == 0; assigns \result \from a, b; ensures \result == 2; behavior b3: assumes a != 0 && b != 0; assigns \result \from a, b; ensures \result == 3; behavior b4: assumes a == 0 && b == 0; assigns \result \from a, b; ensures \result == 4; behavior b5: assumes a == 0 && b != 0; assigns \result \from a, b; ensures \result == 5; complete behaviors b1, b2, b3; complete behaviors b2, b3, b4, b5; disjoint behaviors b1, b2, b3; disjoint behaviors b2, b3, b4, b5; */ int f_comp_disj(unsigned int a, unsigned int b) ; /*@ assigns \result \from a, b; ensures \result > 0; behavior b1: assumes a == 0; assigns \result \from a; ensures \result == 4 || \result == 5; behavior b2: assumes a != 0 && b == 0; assigns \result \from a, b; ensures \result == 2; behavior b3: assumes a != 0 && b != 0; assigns \result \from a, b; ensures \result == 3; behavior b4: assumes a == 0 && b == 0; assigns \result \from a, b; ensures \result == 4; behavior b5: assumes a == 0 && b != 0; assigns \result \from a, b; ensures \result == 5; disjoint behaviors b1, b2, b3; disjoint behaviors b2, b3, b4, b5; */ int f_disj(unsigned int a, unsigned int b) ; /*@ assigns \result \from a, b; ensures \result > 0; behavior b1: assumes a == 0; assigns \result \from a; ensures \result == 4 || \result == 5; behavior b2: assumes a != 0 && b == 0; assigns \result \from a, b; ensures \result == 2; behavior b3: assumes a != 0 && b != 0; assigns \result \from a, b; ensures \result == 3; behavior b4: assumes a == 0 && b == 0; assigns \result \from a, b; ensures \result == 4; behavior b5: assumes a == 0 && b != 0; assigns \result \from a, b; ensures \result == 5; complete behaviors b1, b2, b3; complete behaviors b2, b3, b4, b5; */ int f_comp(unsigned int a, unsigned int b) ; /*@ assigns \result \from a, b; ensures \result > 0; behavior b1: assumes a == 0; assigns \result \from a; ensures \result == 4 || \result == 5; behavior b2: assumes a != 0 && b == 0; assigns \result \from a, b; ensures \result == 2; behavior b3: assumes a != 0 && b != 0; assigns \result \from a, b; ensures \result == 3; behavior b4: assumes a == 0 && b == 0; assigns \result \from a, b; ensures \result == 4; behavior b5: assumes a == 0 && b != 0; assigns \result \from a, b; ensures \result == 5; complete behaviors b1, b2, b3; disjoint behaviors b1, b2, b3; */ int f_123_comp_disj(unsigned int a, unsigned int b) ; /*@ assigns \result \from a, b; ensures \result > 0; behavior b1: assumes a == 0; assigns \result \from a; ensures \result == 4 || \result == 5; behavior b2: assumes a != 0 && b == 0; assigns \result \from a, b; ensures \result == 2; behavior b3: assumes a != 0 && b != 0; assigns \result \from a, b; ensures \result == 3; behavior b4: assumes a == 0 && b == 0; assigns \result \from a, b; ensures \result == 4; behavior b5: assumes a == 0 && b != 0; assigns \result \from a, b; ensures \result == 5; complete behaviors b1, b2, b3; disjoint behaviors b1, b2, b3; disjoint behaviors b2, b3, b4, b5; */ int f_123_comp_disj_2345_disj(unsigned int a, unsigned int b) ; /*@ assigns \result \from a, b; ensures \result > 0; behavior b1: assumes a == 0; assigns \result \from a; ensures \result == 4 || \result == 5; behavior b2: assumes a != 0 && b == 0; assigns \result \from a, b; ensures \result == 2; behavior b3: assumes a != 0 && b != 0; assigns \result \from a, b; ensures \result == 3; behavior b4: assumes a == 0 && b == 0; assigns \result \from a, b; ensures \result == 4; behavior b5: assumes a == 0 && b != 0; assigns \result \from a, b; ensures \result == 5; complete behaviors b1, b2, b3; complete behaviors b2, b3, b4, b5; disjoint behaviors b1, b2, b3; */ int f_123_comp_disj_2345_comp(unsigned int a, unsigned int b) ; /*@ assigns \result \from a, b; ensures \result > 0; behavior b1: assumes a == 0; assigns \result \from a; ensures \result == 4 || \result == 5; behavior b2: assumes a != 0 && b == 0; assigns \result \from a, b; ensures \result == 2; behavior b3: assumes a != 0 && b != 0; assigns \result \from a, b; ensures \result == 3; behavior b4: assumes a == 0 && b == 0; assigns \result \from a, b; ensures \result == 4; behavior b5: assumes a == 0 && b != 0; assigns \result \from a, b; ensures \result == 5; complete behaviors b2, b3, b4, b5; disjoint behaviors b1, b2, b3; disjoint behaviors b2, b3, b4, b5; */ int f_123_disj_2345_comp_disj(unsigned int a, unsigned int b) ; /*@ assigns \result \from a, b; ensures \result > 0; behavior b1: assumes a == 0; assigns \result \from a; ensures \result == 4 || \result == 5; behavior b2: assumes a != 0 && b == 0; assigns \result \from a, b; ensures \result == 2; behavior b3: assumes a != 0 && b != 0; assigns \result \from a, b; ensures \result == 3; behavior b4: assumes a == 0 && b == 0; assigns \result \from a, b; ensures \result == 4; behavior b5: assumes a == 0 && b != 0; assigns \result \from a, b; ensures \result == 5; complete behaviors b1, b2, b3; complete behaviors b2, b3, b4, b5; disjoint behaviors b2, b3, b4, b5; */ int f_123_comp_2345_comp_disj(unsigned int a, unsigned int b) ; volatile int nondet; void test_none() { int a, b, c1, c2, c3, c4; a = nondet; // volatile b = nondet; // volatile if (!a && !b) c1 = f_none(a, b); if (!a && b) c2 = f_none(a, b); if (a && !b) c3 = f_none(a, b); if (a && b) c4 = f_none(a, b); } void test_comp_disj() { int a, b, c1, c2, c3, c4; a = nondet; // volatile b = nondet; // volatile if (!a && !b) { // True behaviors in this call: , b1, b4 // Unknown behaviors in this call: none c1 = f_comp_disj(a, b); // at runtime: {4} // best approximation: {4} } if (!a && b) { // True behaviors in this call: , b1 // Unknown behaviors in this call: b4, b5 c2 = f_comp_disj(a, b); // at runtime: {4} // best approximation: {4; 5} } if (a && !b) { // True behaviors in this call: // Unknown behaviors in this call: b1, b2, b4 c3 = f_comp_disj(a, b); // at runtime: {2} // best approximation: {2; 4} } if (a && b) { // True behaviors in this call: // Unknown behaviors in this call: b1, b2, b3, b4, b5 c4 = f_comp_disj(a, b); // at runtime: {3} // best approximation: {2; 3; 4; 5} } } void test_disj() { int a, b, c1, c2, c3, c4; a = nondet; // volatile b = nondet; // volatile if (!a && !b) c1 = f_disj(a, b); if (!a && b) c2 = f_disj(a, b); if (a && !b) c3 = f_disj(a, b); if (a && b) c4 = f_disj(a, b); } void test_comp() { int a, b, c1, c2, c3, c4; a = nondet; // volatile b = nondet; // volatile if (!a && !b) c1 = f_comp(a, b); if (!a && b) c2 = f_comp(a, b); if (a && !b) c3 = f_comp(a, b); if (a && b) c4 = f_comp(a, b); } void test_123_comp_disj() { int a, b, c1, c2, c3, c4; a = nondet; // volatile b = nondet; // volatile if (!a && !b) c1 = f_123_comp_disj(a, b); if (!a && b) c2 = f_123_comp_disj(a, b); if (a && !b) c3 = f_123_comp_disj(a, b); if (a && b) c4 = f_123_comp_disj(a, b); } void test_123_comp_disj_2345_disj() { int a, b, c1, c2, c3, c4; a = nondet; // volatile b = nondet; // volatile if (!a && !b) c1 = f_123_comp_disj_2345_disj(a, b); if (!a && b) c2 = f_123_comp_disj_2345_disj(a, b); if (a && !b) c3 = f_123_comp_disj_2345_disj(a, b); if (a && b) c4 = f_123_comp_disj_2345_disj(a, b); } void test_123_comp_disj_2345_comp() { int a, b, c1, c2, c3, c4; a = nondet; // volatile b = nondet; // volatile if (!a && !b) c1 = f_123_comp_disj_2345_comp(a, b); if (!a && b) c2 = f_123_comp_disj_2345_comp(a, b); if (a && !b) c3 = f_123_comp_disj_2345_comp(a, b); if (a && b) c4 = f_123_comp_disj_2345_comp(a, b); } void test_123_disj_2345_comp_disj() { int a, b, c1, c2, c3, c4; a = nondet; // volatile b = nondet; // volatile if (!a && !b) c1 = f_123_disj_2345_comp_disj(a, b); if (!a && b) c2 = f_123_disj_2345_comp_disj(a, b); if (a && !b) c3 = f_123_disj_2345_comp_disj(a, b); if (a && b) c4 = f_123_disj_2345_comp_disj(a, b); } void test_123_comp_2345_comp_disj() { int a, b, c1, c2, c3, c4; a = nondet; // volatile b = nondet; // volatile if (!a && !b) c1 = f_123_comp_2345_comp_disj(a, b); if (!a && b) c2 = f_123_comp_2345_comp_disj(a, b); if (a && !b) c3 = f_123_comp_2345_comp_disj(a, b); if (a && b) c4 = f_123_comp_2345_comp_disj(a, b); } /*@ assigns \result \from p, q; behavior b1: assumes p != \null; assigns \result \from p; behavior b2: assumes p == \null && q != \null; assigns \result \from q; behavior b3: assumes p == \null && q == \null; assigns \result \from \nothing; complete behaviors; disjoint behaviors; */ int f(int *p, int *q) ; void test_assigns() { int a, b; int *p1, *p2, *p3; p1 = (int*)f(&a, &b); // garbled_mix of &{a} p2 = (int*)f(0, &b); // garbled_mix of &{b} p3 = (int*)f(0, 0); // [0..+oo] } char T[10]; /*@ requires \valid(out+(0 .. l-1)) ; assigns out[0 .. l-1] \from \nothing ; behavior b: // no assigns clause (reverts to the default behavior's) */ void f2(char * out, unsigned int l) ; void test_assigns2 () { char *p = T; f2(p, 5); } /*@ requires x == 2 || x == 4; behavior b1: assumes x == 2; requires x == 0; behavior b2: assumes x == 4; complete behaviors; */ int f3(int x); void test_small1() { int x = nondet; f3(x); } /*@ requires x == 2 || x == 4; behavior b1: assumes x == 2; requires x == 0; requires x != 1; ensures \false; behavior b2: assumes x == 4; */ int f4(int x); void test_small2() { int x = nondet; f4(x); } /*@ ensures \result >= 0 && \result <= 1000; behavior b1: assumes x == 0; behavior b2: assumes x != 0; */ int f5(int x); void test_small3() { int r = f5(nondet); } /*@ ensures \result >= 0 && \result <= 1000; behavior b1: assumes x == 0; behavior b2: assumes x != 0; complete behaviors; */ int f6(int x); void test_small4() { int r = f6(nondet); } /*@ requires x >= 0 && x <= 50; behavior b1: assumes x > 0 && x != 50; behavior b2: assumes x == 0 || x >= 50; */ int f7(int x); void test_small5() { int r = f7(nondet); } /*@ requires \valid(p); assigns \result \from p; assigns *p \from \nothing; ensures \initialized(\result); behavior b: ensures \result == p; */ int *f8(int *p); void test_small6() { int a; int *p = f8(&a); } /*@ requires \valid(p); assigns \result \from p; assigns *p \from \nothing; ensures \result == p; behavior b: ensures \initialized(\result); */ int *f8_bis(int *p); void test_small6_bis() { int a; int *p = f8_bis(&a); } /*@ axiomatic MyLen { type Lstr = char *; logic ℤ length{L}(Lstr s); } */ /*@ assigns \result \from *s, n; behavior b1: assumes !\valid_read(s); ensures \result == -1; behavior b2: assumes \valid_read(s) && length(s) > 0; ensures \result == 1; complete behaviors; */ int f9(char const* s, int n); void test_promote() { int x = nondet; int r = f9("a", 1); } /*@ axiomatic MyF { type Lint = int; logic ℤ fl{L}(Lint x); } */ /*@ assigns \result \from x; behavior b1: assumes fl(x) > 0; ensures \result == 300 || \result == 500; behavior b2: assumes fl(x) <= 0; ensures \result == 100 || \result == 200; behavior b3: assumes fl(x) < 0; ensures \result == 100 || \result == 400; behavior b4: assumes fl(x) >= 0; ensures \result == 200 || \result == 300; complete behaviors b1, b2; complete behaviors b3, b4; */ int f10(int x); void test_narrow() { int r = f10(nondet); } int main() { test_none(); test_comp_disj(); test_comp(); test_disj(); test_123_comp_disj(); test_123_comp_disj_2345_disj(); test_123_comp_disj_2345_comp(); test_123_disj_2345_comp_disj(); test_123_comp_2345_comp_disj(); test_assigns(); test_assigns2(); test_small1(); test_small2(); test_small3(); test_small4(); test_small5(); test_small6(); test_small6_bis(); test_promote(); test_narrow(); } frama-c-20.0-Calcium/tests/value/behaviors2.c0000666000000000000000000002201613571573400015702 0ustar /* run.config* STDOPT: +"-eva-verbose 2" */ #include // Tests behaviors with disjunctions. typedef enum { OK = 0, DIVBYZERO = 1, INVALID_PARAMETER = 2} res_t; #define MAX_ERRMSG_LEN 20 /* Divides [dividend] by [divisor], storing the results in [quotient], [remainder], [sign] (the sign of the resulting quotient). [sign] is redundant, only used to make more complex specifications. [magic_code] is a useless parameter, used to add a requires clause. It should be different from 42. [errmsg] is a somewhat redundant output parameter related to the error message (if necessary). It is only assigned in case of error. Returns 0 if the division has been successful (e.g. divisor != 0, quotient != NULL, remainder != NULL, sign != NULL), a positive error code otherwise. */ /*@ requires magic_code > 42 || magic_code <= 41; assigns *quotient, *remainder, *sign \from dividend, divisor; assigns \result, *(errmsg + (0 .. MAX_ERRMSG_LEN-1)) \from dividend, divisor, *quotient, *remainder, *sign; behavior division_by_zero: assumes divisor == 0; requires \valid(errmsg + (0 .. MAX_ERRMSG_LEN-1)); assigns *(errmsg + (0 .. MAX_ERRMSG_LEN-1)) \from \nothing; assigns \result \from \nothing; ensures \result == DIVBYZERO; behavior invalid_parameter: assumes !\valid(quotient) || !\valid(remainder) || !\valid(sign); requires \valid(errmsg + (0 .. MAX_ERRMSG_LEN-1)); assigns *(errmsg + (0 .. MAX_ERRMSG_LEN-1)) \from \nothing; assigns \result \from \nothing; ensures \result == INVALID_PARAMETER; behavior error: assumes divisor == 0 || !\valid(quotient) || !\valid(remainder) || !\valid(sign); requires \valid(errmsg + (0 .. MAX_ERRMSG_LEN-1)); assigns *(errmsg + (0 .. MAX_ERRMSG_LEN-1)) \from \nothing; assigns \result \from \nothing; ensures \result == DIVBYZERO || \result == INVALID_PARAMETER; behavior ok: assumes \valid(quotient) && \valid(remainder) && \valid(sign); assumes divisor < 0 || divisor > 0; assigns *quotient, *remainder, *sign \from dividend, divisor; assigns \result \from \nothing; ensures \result == OK; ensures \initialized(sign); ensures -1 <= *sign <= 1; behavior ok_res_sign_nonnegative: assumes \valid(quotient) && \valid(remainder) && \valid(sign); assumes dividend >= 0 && divisor > 0 || dividend <= 0 && divisor < 0; assigns *quotient, *remainder, *sign \from dividend, divisor; assigns \result \from \nothing; ensures \result == OK; ensures \initialized(quotient); ensures *quotient == dividend / divisor; ensures \initialized(remainder); ensures *remainder == dividend % divisor; ensures \initialized(sign); ensures *sign == 1 || *sign == 0; behavior ok_res_sign_nonpositive: assumes \valid(quotient) && \valid(remainder) && \valid(sign); assumes dividend >= 0 && divisor < 0 || dividend <= 0 && divisor > 0; assigns *quotient, *remainder, *sign \from dividend, divisor; assigns \result \from \nothing; ensures \result == OK; ensures \initialized(quotient); ensures *quotient == dividend / divisor; ensures \initialized(remainder); ensures *remainder == dividend % divisor; ensures \initialized(sign); ensures *sign == -1 || *sign == 0; behavior ok_quotient_zero: assumes \valid(quotient) && \valid(remainder) && \valid(sign); assumes divisor < 0 || divisor > 0; // redundant assumes dividend >= 0 && dividend < divisor || dividend < 0 && dividend > divisor; assigns *quotient, *remainder, *sign \from dividend, divisor; assigns \result \from \nothing; ensures \result == OK; ensures \initialized(quotient); ensures *quotient == 0; ensures \initialized(remainder); ensures *remainder == dividend % divisor; ensures \initialized(sign); ensures *sign == 0; behavior ok_quotient_non_zero: assumes \valid(quotient) && \valid(remainder) && \valid(sign); assumes divisor < 0 || divisor > 0; assumes dividend > 0 && dividend >= divisor || dividend < 0 && dividend < divisor; assigns *quotient, *remainder, *sign \from dividend, divisor; assigns \result \from \nothing; ensures \result == OK; ensures \initialized(quotient); ensures *quotient == dividend / divisor; ensures \initialized(remainder); ensures *remainder == dividend % divisor; ensures \initialized(sign); ensures *sign >= -1 && *sign <= 1; complete behaviors error, ok; disjoint behaviors error, ok; complete behaviors division_by_zero, invalid_parameter, ok; complete behaviors division_by_zero, invalid_parameter, ok_res_sign_nonnegative, ok_res_sign_nonpositive; complete behaviors division_by_zero, invalid_parameter, ok_quotient_zero, ok_quotient_non_zero; complete behaviors; disjoint behaviors ok_quotient_zero, ok_quotient_non_zero; disjoint behaviors ok_res_sign_nonpositive, error; disjoint behaviors ok_res_sign_nonnegative, error; */ res_t divi(int dividend, int divisor, int *quotient, int *remainder, int *sign, unsigned int magic_code, char *errmsg); /* void mystrcpy(char *dst, char *src) { while (*src) { *dst = *src; dst++; src++; } } res_t divi(int dividend, int divisor, int *quotient, int *remainder, int *sign, unsigned int magic_code, char *errmsg) { if (divisor == 0) { mystrcpy(errmsg, "division by zero"); return DIVBYZERO; } if (!quotient) { mystrcpy(errmsg, "invalid quotient"); return INVALID_PARAMETER; } if (!remainder) { mystrcpy(errmsg, "invalid remainder"); return INVALID_PARAMETER; } if (!sign) { mystrcpy(errmsg, "invalid sign"); return INVALID_PARAMETER; } *quotient = dividend / divisor; *remainder = dividend % divisor; *sign = *quotient > 0 ? 1 : (*quotient < 0 ? -1 : 0); return OK; } */ volatile int nondet; void test1() { int quotient, remainder, sign; char errmsg[MAX_ERRMSG_LEN]; res_t r1, r2, r3, r4, r5, r6, r7, r8; r1 = divi(60, 3, "ient, &remainder, &sign, 41, errmsg); r2 = divi(1, 3, "ient, &remainder, &sign, 43, errmsg); r3 = divi(-2, -5, "ient, &remainder, &sign, 41, errmsg); r4 = divi(1, 0, "ient, &remainder, &sign, 43, errmsg); r5 = divi(1, 1, NULL, &remainder, &sign, 0, errmsg); r6 = divi(1, 1, "ient, NULL, &sign, 0, errmsg); r7 = divi(1, 1, "ient, &remainder, NULL, 0, errmsg); r8 = divi(nondet, nondet, "ient, &remainder, &sign, 0, errmsg); } /*@ requires x == 2 || x == 4; assigns \result \from p1, p2; assigns *y \from x; ensures \initialized(\result); behavior b1: assumes x == 2; requires \initialized(p1); requires \valid(y); assigns \result \from p1; assigns *y \from \nothing; ensures *y == x; ensures \result == p1; behavior b2: assumes x == 4; requires \initialized(p2); requires \valid(y); assigns \result \from p2; assigns *y \from \nothing; ensures *y == -x; ensures \result == p2; complete behaviors; */ int *f1(int x, int *y, int *p1, int *p2); void test2() { int a = 1, b = 2; int *p; int y = 42; int x = nondet; p = f1(x, &y, &a, &b); } /*@ requires x == 2 || x == 4; assigns \result \from p1, p2; assigns *y \from x; ensures \initialized(\result); behavior b1: assumes x == 2; requires \initialized(p1); requires \valid(y); assigns \result \from p1; assigns *y \from \nothing; ensures *y == x; ensures \result == p1; behavior b2: assumes x == 4; requires \initialized(p2); requires \valid(y); assigns \result \from p2; assigns *y \from \nothing; ensures *y == -x; ensures \result == p2; complete behaviors; */ int *f2(int x, int *y, int *p1, int *p2); void test3() { int a = 1, b = 2; int *p; int y = 42; int x = nondet; p = f2(x, &y, &a, &b); } /*@ requires x == 2 || x == 4; assigns \result \from x; behavior b1: assumes x == 2; ensures \false; behavior b2: assumes x == 4; ensures \result == 1; behavior b3: assumes x == 6; ensures \result == 1; */ int f3(int x); void test4() { int x = nondet; f3(x); } /*@ requires x == 2 || x == 4; assigns \result \from x; behavior b1: assumes x == 2; ensures \false; behavior b2: assumes x == 4; ensures \result == 1; behavior b3: assumes x == 6; ensures \result == 1; complete behaviors; */ int f4(int x); void test5() { int x = nondet; f4(x); } // test below not directly related to behaviors; tests the precision of // logic reductions /*@ assigns p == \null ? \empty : *p \from indirect:p; ensures p == \null || *p == 1; // if p non-null, then *p must equal 1; */ void opt_ptr(int *p); void test_red() { int a = 2; opt_ptr(&a); //@ assert a == 1; } int main() { int quotient, remainder, sign; char errmsg[MAX_ERRMSG_LEN]; int r; test1(); test2(); test3(); test4(); test5(); test_red(); return 0; } frama-c-20.0-Calcium/tests/value/big_lib_entry.i0000666000000000000000000000105513571573400016454 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -lib-entry -context-width 4 -eva-initialization-padding-globals no */ typedef struct { int f1; float f2; char f3; // padding char* f4; char f5; // trailing padding } ts; struct { char c1; ts tcs[10]; char c2; } s; typedef struct { int f1; const int f2; } ss; typedef struct { double f1; double f2; } ds; int* t1[5000000]; int t2[5000000]; ts t3[1000]; char t4[5000000]; int* t5[3]; // test big context-width ds t6[5000000]; void main () { } frama-c-20.0-Calcium/tests/value/bigarray.c0000666000000000000000000000031513571573400015434 0ustar #define SIZE (1<<23) const int T[SIZE]={2,3}; const char*S = "uututututututu"; int main(int c) { int i; if (c) *(char*)S = 'E'; if (c) for(i=0; i < SIZE/4; i++) *(int*)&T[i] = 1; return 0; } frama-c-20.0-Calcium/tests/value/bitfield.i0000666000000000000000000000506013571573400015426 0ustar /* run.config* STDOPT: +"-print -kernel-msg-key printer:bitfields" */ struct t1 { unsigned int a:2; int b:4; int c:22;int d:32;} h; struct t2 { unsigned int a:2; int b:4; int c:22; int d;} k,k8,kr8; struct t3 { int b:16; } ll; struct t1 ini = { 14, -55, 99999 } ; unsigned int VV=55; unsigned short q4 = 40000; int X; void f(int x) { X=x; Frama_C_dump_each(); } int return_8(void) { return 8; } struct S { unsigned f:32; signed sf:32; } x = { 28349, 28349}; unsigned short us = 0xDC23L; int G,H; int g(void) { int r = (x.f ^ ((short)-87)) >= us; H = (x.sf ^ ((short)-87)) >= us ; return r; } union U1 { int f0 ; int f1 : 15 ; }; struct impr { int i1: 5; int i2:1; int i3:6; }; // Bug 1671 struct B { struct foo *next; struct foo **prev; }; struct A { struct B next; int bitf:1; } *b, *c, ee; void leaf (struct A *p1); volatile foo; void imprecise_bts_1671 () { ee.next.prev = &b; c = ⅇ while (foo) { leaf (c); Frama_C_show_each(ee); c->bitf = 0; Frama_C_show_each(ee); c = c->next.next; } } struct bitf { unsigned v0_3: 3; unsigned v4: 1; unsigned v5_31: 28; }; extern struct bitf y; void logic() { if (y.v4) { y.v4 = 0; Frama_C_show_each(y); } else Frama_C_show_each(y); Frama_C_show_each(y.v4); //@ assert y.v4 == 0; Frama_C_show_each(*((unsigned *) &y)); struct bitf w; w.v0_3 = 1; //@ assert \initialized(&w.v0_3); //@ assert ! \initialized(&w.v4); if (foo) { int wc = w.v4 + 1; } //@ assert \separated(&w.v0_3, &w.v4); // The status on this property will be invalid if the analysis evaluates the addresses using bytes } void main_old (){ struct t1 v; union U1 l_161; l_161.f0 = (int)-1L; Frama_C_show_each(1); if ((!l_161.f0) <= l_161.f1) Frama_C_show_each(2); else Frama_C_show_each(3); VV = h.a; h.a = VV; v.c = (int) &v; v.d = (int) (&v + 1); v.d = v.d + 1; v.a = 4; v.b = 7; f(v.b); h.b = foo + foo + h.a + h.b; h.c = (int) (&v +1); k8.b = 8; kr8.b = return_8(); ll.b = q4; G=g(); } void eq_bitfields() { int i = foo; if (i >= 16 && i <= 17) { struct t1 s; s.a =i; s.c =i; Frama_C_dump_each(); if (s.a == s.c) // False, because of bitfield downcasts Frama_C_show_each_unreachable(); } } struct char_short { unsigned char c: 1; unsigned short s: 2; }; void char_short () { struct char_short S = { 1, 2}; int x = S.c + 0; int y = S.s + 0; } void main() { main_old(); imprecise_bts_1671(); logic(); eq_bitfields(); char_short(); } frama-c-20.0-Calcium/tests/value/bitfield_assign.i0000666000000000000000000000101013571573400016761 0ustar int g_18; typedef unsigned int uint32_t; typedef int int32_t; typedef short int16_t; typedef long long int64_t; struct S0 { uint32_t f0; int16_t f1; signed f2 : 26; int64_t f3; }; union U3 { signed f0 : 7; int32_t f1; int32_t f2; struct S0 f3; }; static union U3 g_7[1] = {{0x00868BB4L}}; int g_5; int g_2; void Frama_C_show_each(unsigned); int main(){ unsigned short l_8 = 1UL; unsigned int l_16 = 0xBD4AA41AL; g_2 |= (g_7[g_5].f3.f2 = l_16); Frama_C_show_each(g_2); return 0; } frama-c-20.0-Calcium/tests/value/bitfield_longlong.c0000666000000000000000000000113213571573400017313 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -cpp-extra-args="-Dprintf=Frama_C_show_each" -journal-disable */ struct X50 { long long int z:50; } s50 = { 2 }; struct X10 { long long int z:10; } s10 = { 2 }; struct U32 { unsigned long z:32; } u32 = { -1 }; struct S32 { signed long z:32; } s32 = { -1 }; int main() { int x = u32.z >=0; int y = s32.z >=0; printf("%zu %zu %zu %zu\n", sizeof(long long int), sizeof(s10.z+0), sizeof(s50.z+0), sizeof(u32.z+0) ); printf("%d %d\n", x, y); return 0; } frama-c-20.0-Calcium/tests/value/bitfield_receives_result.i0000666000000000000000000000016713571573400020714 0ustar struct S { int b:31; } s; int f(void) { return -1; } int main(){ s.b = f(); Frama_C_dump_each(); return 0; } frama-c-20.0-Calcium/tests/value/bitwise.i0000666000000000000000000000625513571573400015321 0ustar /* run.config* STDOPT: +"-big-ints-hex 256" */ /*@ assigns \result \from min, max; ensures min <= \result <= max ; */ int Frama_C_interval(int min, int max); volatile long v; volatile unsigned char input[3]; extern unsigned short s; void test1(void) { int or1, or2, or3, or4, or5; int and1, and2, and3, and4, xor1, xor2; unsigned int uand1, uand2, uand3, uand4, uand5; int a,b,c,d,e; a = Frama_C_interval(3,17); b = Frama_C_interval(-3,17); c = Frama_C_interval(13,27); or1 = a | b; or2 = a | c; or3 = b | c; and1 = a & b; and2 = a & c; and3 = b & c; uand4 = 0xFFFFFFF8U & (unsigned int) c; xor1 = a ^ a; xor2 = a ^ b; unsigned i1 = s * 2; unsigned i2 = s * 4; unsigned v1 = i1 & i2; unsigned v2 = i1 | i2; unsigned mask07 = (16 * s + 13) & 0x7; unsigned mask0f = (16 * s + 13) & 0xF; unsigned mask1f = (16 * s + 13) & 0x1F; } void test2(void) { int x = Frama_C_interval(62,110) & ~(7); } void test3(void) { int x = (input[0] & 0x10 ? -1^255 : 0) | input[1]; int y = (input[0] & 0x20 ? -1^255 : 0) | input[2]; } int test4(void) { unsigned something = v; //@ slevel 2; //@ assert something >= 0x80000000 || something < 0x80000000; unsigned topBitOnly = something & 0x80000000; Frama_C_show_each_1(something,topBitOnly); something ^= topBitOnly; Frama_C_show_each_2(something,something & 0x80000000,topBitOnly); if (something & 0x80000000) { Frama_C_show_each_true(something); return 0; } else { Frama_C_show_each_false(something); return 1; } } void and_or_rel(void) { long x, r1, r2, r3; x = v; if (((17 <= x) & (x < 64))) { r1 = x; } x = v; //@ assert x >= 20 && x <= 40; if (((x <= 23) | (x >= 38))) { r2 = x; //Could be improved, but this goes beyond basic backward propagation } else { r3 = x; } } void double_neg() { unsigned int i = 5; unsigned int j = ~i; int k = ~(int)i; } void bug1() { unsigned char msb = 3 << 1; unsigned char lsb = 3; unsigned char par = msb ^ lsb; int p1 = (par & 0x0F); int p2 = ((int)par >> 4); par = (unsigned char)(((int)par & 0x0F) ^ ((int)par >> 4)); } void bug2() { int t = v ? 1 : 2; if ((t & 7) == 1) { Frama_C_show_each_then(); } else { Frama_C_show_each_else(); } } /* See issue Value/Value#82 on the bitwise domain. */ void bug3 () { unsigned long l_1180 = 10022045811482781039u; unsigned long foo = ~ (l_1180 ^ (unsigned long)(l_1180 != 0UL)); Frama_C_show_each(l_1180, foo); foo ^= 0; } /* Due to signedness mismatches, the bitwise domain incorrectly returned Bottom on one of the branches. */ void bug4() { int g_2 = v ? -1 : 0; short tmp = -0x1578; if ((g_2 | (int)tmp) & 1) { Frama_C_show_each_then(); } else { Frama_C_show_each_else(); } } /* See issue #639 and merge request #2230 on the bitwise domain. */ void bug5() { int x = v; x = x | 2; if (x == 8) { x = x & 2; /* This branch is dead, but the bitwise domain leads to bottom only after the operation x&2 and not before. */ Frama_C_show_each_dead(x); } } void main(void) { test1(); test2(); test3(); test4(); and_or_rel(); double_neg(); bug1(); bug2(); bug3(); bug4(); bug5(); } frama-c-20.0-Calcium/tests/value/bitwise_float.c0000666000000000000000000000031613571573400016470 0ustar //@ requires 0.05 <= a <= 5.0; unsigned long main(float a) { unsigned long x; x = (unsigned long)*((unsigned long *)(& a)); Frama_C_show_each_x(x); x = (*(unsigned long *)(&x)) & 2UL; return x; } frama-c-20.0-Calcium/tests/value/bitwise_pointer.i0000666000000000000000000000047413571573400017056 0ustar /* run.config* GCC: STDOPT: #"-inout" */ char t[100]={0,1,2,3,4,5,6,7,8,9}; char *p; int x; char t1[100]={0,1,2,3,4,5,6,7,8,9}; char *p1; int x1; void main(void) { int mask = 7; p = (char*)(((int)(t + 7)) & ~7); *p = 5; x = *p; p1 = (char*)(((int)(t1 + mask)) & ~mask); *p1 = 5; x1 = *p1; } frama-c-20.0-Calcium/tests/value/bitwise_reduction.i0000666000000000000000000000140613571573400017366 0ustar /* run.config* STDOPT: +"-big-ints-hex 255" */ volatile v; void main1() { int t[2]; t[0] = t[1] = v; //@ assert t[0] == 0xFF00 || t[0] == 0xF000; //@ assert t[1] == 0 || t[1] == 1 || t[1] == 0x3000 || t[1] == 0x3001 || t[1] == 0x3200 || t[1] == 0x3201 || t[1] == 0xF000; int i = v; if ((t[i] & 0xFF00) == 0x0) { Frama_C_show_each_then1(i, t[i]); } else { Frama_C_show_each_else1(i, t[i]); if ((t[i] & 0x3000) == 0x3000) Frama_C_show_each_else_then1(i, t[i]); // imprecise } int *p = &t[v]; if ((*p & 0xFF00) == 0x0) { Frama_C_show_each_then2(p, *p); } else { Frama_C_show_each_else2(p, *p); if ((t[i] & 0x3000) == 0x3000) Frama_C_show_each_else_then2(i, t[i]); // imprecise } } void main() { main1(); } frama-c-20.0-Calcium/tests/value/biz.i0000666000000000000000000000026413571573400014431 0ustar /* run.config* GCC: STDOPT: #"-main f2" */ int *p, *q, G = 0; void f2() { p = &G; *(((char*)p)++) = 3; // specific test for biz.c:5: error: invalid lvalue in increment } frama-c-20.0-Calcium/tests/value/bool.i0000666000000000000000000000223313571573400014576 0ustar /* run.config* */ volatile int rand; /* Tests valid operations on _Bool values. */ int valid_bool () { _Bool x = 0; int y; Frama_C_show_each(x); x=2; Frama_C_show_each(x); y=x+1; Frama_C_show_each(x, y); x=x+1; Frama_C_show_each(x); x=x+1; Frama_C_show_each(x); return y; } union u_bool { _Bool b; unsigned char c; unsigned short s; }; /* Tests trap representations of _Bool variables. */ void invalid_bool () { union u_bool ub; _Bool b; /* Precise _Bool values. */ ub.c = 42; if (rand) b = ub.b; // red alarm ub.s = 256; b = ub.b; Frama_C_show_each_zero(b); ub.s = 257; b = ub.b; Frama_C_show_each_one(b); ub.s = 258; if (rand) b = ub.b; // red alarm /* Reduction of imprecise _Bool values. */ ub.s = rand; b = ub.b; Frama_C_show_each_zero_or_one(b); // unknown alarm /* Write through a pointer. */ b = 17; Frama_C_show_each_one(b); *((char *)&b) = 17; if (rand) b = b; // red alarm /* Read through a pointer. */ char c = rand; _Bool *p = (_Bool*)&c; b = *p; // unknown alarm, reduction of c Frama_C_show_each_zero_or_one(c); } void main () { valid_bool (); invalid_bool (); } frama-c-20.0-Calcium/tests/value/branch.i0000666000000000000000000000021713571573400015100 0ustar int a, b,c,d,e; void main() { L: a=0; if (c) goto L2; L3: b=0; goto L; L2: d=0; if (d) goto L; if (e) goto L4; goto L3; L4: return; } frama-c-20.0-Calcium/tests/value/branch2.i0000666000000000000000000000043513571573400015164 0ustar unsigned short i; unsigned short etat_to; signed short changepage; int plein,NumFonct,NumSsPage; void main(void) { plein = 1; /* 0 */ if(changepage != 0) { NumFonct = 0 ; } else {} while ( NumSsPage <= 0 ) { NumSsPage = NumSsPage + (unsigned short)9; } } frama-c-20.0-Calcium/tests/value/broken_loop.i0000666000000000000000000000023013571573400016147 0ustar /* run.config* GCC: STDOPT: #"-main loop" */ int X; void loop(int d) { if(d) ; else ; goto L; X=0; if(d) X=1; else L:; X=2; return; } frama-c-20.0-Calcium/tests/value/bts0506.i0000666000000000000000000000127413571573400014752 0ustar /*run.config* STDOPT: #"-no-collapse-call-cast" +"-print" STDOPT: #"-collapse-call-cast" +"-print" */ int f1(void); long f2(void); unsigned int f3(void); float f4(void); double f5(void); int *f6(void); void *f7(void); void main2() { long r1 = f1(); short r2 = f1(); int r3 = f1(); unsigned int r4 = f1(); long r5 = f2(); int r6 = f2(); unsigned long r7 = f2(); unsigned int r8 = f3(); int r8bis = f3(); float r9 = f4(); double r10 = f4(); float r11 = f5(); double r12 = f5(); void* r13 = f6(); int* r14 = f6(); char* r15 = f6(); void* r16 = f7(); int* r17 = f7(); } int f(int x) { return x+1; } void main () { short x = 4; x = f(42); main2(); } frama-c-20.0-Calcium/tests/value/bts0775.i0000666000000000000000000000007713571573400014762 0ustar int main(){ int r = 0xE2DB80EBBD4856CDLL >= 1; return r; } frama-c-20.0-Calcium/tests/value/bts0858.i0000666000000000000000000000024613571573400014762 0ustar typedef long int32_t; typedef unsigned long uint32_t; int main() { uint32_t tmp = 18446744073709551615UL ; if (0xffffffffUL == tmp) return 1; return 0; } frama-c-20.0-Calcium/tests/value/bts1306.i0000666000000000000000000000035613571573400014751 0ustar /* run.config* OPT: -no-autoload-plugins -load-module from,inout,eva -constfold -slevel 0 -eva @EVA_CONFIG@ -print -then -slevel 10 -eva -print */ void g(double x) { double y= x*x; } int main(double x) { g(x); return 0; } frama-c-20.0-Calcium/tests/value/buffer_overflow.i0000666000000000000000000000051013571573400017033 0ustar /* run.config* GCC: STDOPT: STDOPT: #"-ulevel 15" */ int main(int argc, char *argv[]) { int test_value; int loop_counter; char buf[10]; test_value = 17; loop_counter = 0; while(++loop_counter) { /* BAD */ buf[loop_counter] = 'A'; if (loop_counter >= test_value) break; } return 0; } frama-c-20.0-Calcium/tests/value/bug.i0000666000000000000000000000034113571573400014416 0ustar /* run.config* GCC: STDOPT: #"-main f" */ void f(unsigned short typemess) { unsigned short i; unsigned short nbpompe; unsigned short bitx; if (typemess == (unsigned short)0 ) { goto L; goto L; } L:; } frama-c-20.0-Calcium/tests/value/bug0196.c0000666000000000000000000000036613571573400014737 0ustar /*run.config* STDOPT: #"-simplify-cfg" +"-print" */ int fact(int n) { int r = 1 ; while ( n > 0 ) { //@ assert n > 0 ; before: r *= n-- ; //@ assert r == \at(r*n,before) ; } return r ; } int main () { return fact(3); } frama-c-20.0-Calcium/tests/value/bug0223.i0000666000000000000000000000131113571573400014723 0ustar /* run.config* STDOPT: #"-unspecified-access" STDOPT: #"-no-unspecified-access" */ // No warning should be raised: we can syntactically ensure that // the order of evaluation of expressions does not matter here. extern int F(int, int); extern int my_strcnmp(const char * const s1, const char * const s2, int n); extern char *ch1, *ch2; void h2(void) { int test; test = (my_strcnmp(&ch1[3],&ch2[3],12) == 0) ; } extern unsigned char get(unsigned int); extern void set(unsigned int *); void ptr_deref(unsigned int * const ui) { unsigned int s=0; set(&s); *ui+=get(s) ; } void main() { int i=0, j=0, k=0, l; int *p = &j; l = (F(i,j) == k); *p = (F(*p,j) == k); h2(); } frama-c-20.0-Calcium/tests/value/bug0245.i0000666000000000000000000000045713571573400014741 0ustar /* run.config* STDOPT: #"-slevel 4" */ int R,*p,S,*q; void main(int c, int d) { int a,i; a=2; p = q = &a; for(i=0; i<2; i++) { int u=a; p = &u; toto: { int v; v = 3; v++; q = &v; } } if (c) R = *p; if (d) S = *q; //if (a-a) goto toto; } frama-c-20.0-Calcium/tests/value/bug_023.i0000666000000000000000000000013013571573400014776 0ustar int i; int x; int f(void); int main() { if (i == 0 || i == 1) { i += f(); } } frama-c-20.0-Calcium/tests/value/bug_0244.i0000666000000000000000000000016113571573400015067 0ustar int R,*p; void main(void) { int a,i; a=2; for(i=0; i<2; i++) { int u=a; p = &u; } R = *p; } frama-c-20.0-Calcium/tests/value/builtins_split.c0000666000000000000000000000532613571573400016707 0ustar /* run.config* STDOPT: +"-eva-show-progress -slevel 100" */ int *p; int x, y, t[10]; volatile v; //@ assigns \result \from i; long long Frama_C_abstract_cardinal(long long i); //@ assigns \result \from i; long long Frama_C_abstract_max(long long i); void setup1() { p = v ? &x : &y; } void test1() { setup1(); Frama_C_builtin_split(*p, 15); Frama_C_show_each_split(p); Frama_C_builtin_split_pointer(*p, 15); Frama_C_show_each_split_pointer(p); } void setup2() { if (v) t[1] = 4; if (v) t[2] = 8; if (v) t[2] = 12; } void test2() { setup2(); int i = v; //@ assert 0 <= i < 10; Frama_C_show_each_t_i_1(i,t[i]); Frama_C_builtin_split_all(t[i], 15); if (t[i] == 8) { Frama_C_show_each_t_i_2(i,t[i]); } } struct s { int v; struct s *p; }; struct s s0, s1, s2, s3, s4, s5, s6, s7; struct s * ps; void setup3() { s0.v = 0; s1.v = v ? -1 : 1; s2.v = 2; s3.v = 3; s4.v = 4; s5.v = 5; s6.v = 6; s6.p = &s4; s5.p = v ? &s4 : &s3; s4.p = v ? &s2 : &s0; s3.p = v ? &s1 : &s0; ps = v ? &s5 : (v ? &s6 : &s7); } void test3() { setup3(); if (v) { if (s5.p->p->v == 1) { /* Fonctionne déjà (avec un if, pas avec un assert). */ Frama_C_show_each_s_1(&s5.p->p, s5.p->p->v); } } if (v) { if (ps->p->p->v == 1) { // Fonctionne actuellement (avec un if, pas un assert Frama_C_show_each_s_2(&ps->p, &ps->p->p, &ps->p->p->v, ps->p->p->v); } } if (v) { Frama_C_builtin_split_all(ps->p->p->v, 15); // Maintenant, on peut utiliser un if if (ps->p->p->v == 1) { Frama_C_show_each_s_3(&ps->p, &ps->p->p, &ps->p->p->v, ps->p->p->v); } } if (v) { Frama_C_builtin_split_all(ps->p->p->v, 15); // Maintenant, on peut utiliser un assert //@ assert ps->p->p->v == 1; Frama_C_show_each_s_4(&ps->p, &ps->p->p, &ps->p->p->v, ps->p->p->v); } if (v) { s2.v = v; Frama_C_builtin_split_all(ps->p->p->v, 15); // Remarque: beaucoup d'états Frama_C_show_each_s_5(&ps->p, &ps->p->p, &ps->p->p->v, ps->p->p->v); } } void test4() { int x = v; //@ assert -3 <= x <= 25; long long nb = Frama_C_abstract_cardinal(x); Frama_C_show_each_nb(nb); Frama_C_builtin_split(x, 15); // Not enough Frama_C_show_each_test4_1(x); Frama_C_builtin_split(x, 30); // Enough Frama_C_show_each_test4_2(x); } void test5() { int x = v; long long y = (long long)x * x / 5; long long r = Frama_C_abstract_max(y); Frama_C_show_each_max(y,r); } void test6() { int z; if (v) { z = v; //@ assert 0 <= z <= 5; } //@ slevel merge; Frama_C_builtin_split(z, 10); Frama_C_domain_show_each_test6(z); } void main() { test1(); test2(); test3(); test4(); test5(); test6(); } frama-c-20.0-Calcium/tests/value/call.i0000666000000000000000000000151413571573400014557 0ustar int p[10],q[10]; int *r; int res; void f(int*t) { res = *(t+5); } void leaf_fun_int(int x); void leaf_fun_charp(char* x); /* @ @ assigns \result , p[c] \from p[c..(c+3)], p[*], p[2]; @ assigns q[5] \from p[1], c ; @*/ void main(int c, char **v) { if (c&1) leaf_fun_int((int)v[1]); if (c&2) leaf_fun_charp(v[1]); int lcount= 0; res= 1111; for (lcount=0; lcount<=6; lcount++) { p[lcount]=lcount; q[lcount]=lcount+10;}; p[5] = 177; q[5] = 188; int *tmp ; { if (c&4) { tmp = p; } else { tmp = q; } f(tmp); // t --> deps(tmp) } } struct A {int a; int b;} x; void f_struct(struct A y) { res = y.b; } void caller_struct() { struct A z = res?x:x; f_struct(z); } void f_ptr(int*X) { res = *X; } void caller_ptr() { int * e = res?&x.a:&x.b; f_ptr(e); } frama-c-20.0-Calcium/tests/value/call_2.i0000666000000000000000000000041713571573400015001 0ustar /* run.config* STDOPT: +"-warn-signed-overflow" */ void ff(float f, int i, int j){ Frama_C_show_each(i, f, j); } void main(int i, int j, int c) { float f; int z; int *p = (int*)&f; *p = i; if (c) z = 1; ff(f, i+j, z); // Arguments with potential RTE } frama-c-20.0-Calcium/tests/value/call_3.i0000666000000000000000000000022013571573400014772 0ustar int GG; int f (void) { int G; G = 2; GG = 3; return 1; } int main (void) { int lm = 77; int res_f = f(); GG = lm; return 0; } frama-c-20.0-Calcium/tests/value/call_alias.i0000666000000000000000000000057413571573400015735 0ustar /* run.config* GCC: STDOPT: #"-main main0" STDOPT: #"-main main1" STDOPT: #"-main main2" */ int X,c,u,v,w,G; int incr(int* a,int* b) { (*a)++; (*b)++; return *a+*b; } int sum(int a,int b) { return a+b; } int G=0,H=0,I=0; int main0 () { I=incr(&G,&H); return I; } int main1 () { I=incr(&G,&G); return I; } int main2() { I = sum(G,H); return I; } frama-c-20.0-Calcium/tests/value/call_deep.i0000666000000000000000000000054113571573400015553 0ustar int R=77; int G; int* pG; int F0; int f0(int *p0) { F0 = R; *p0 = R; return R; } int F1; int f1(int**pp1) { F1 = R; **pp1 = R; *pp1 = pG; f0(pG); return **pp1; } int H,XX; int Fmain; #pragma no_return ("Pre a : H==0;") int main() { int *ph; int **pph; pG = &G; ph = &H; pph = &ph; Fmain = f1(pph); XX=0; return 0; } frama-c-20.0-Calcium/tests/value/call_multi.i0000666000000000000000000000144113571573400015770 0ustar /* run.config* STDOPT: #"-unspecified-access" */ int uppol2(int al1,int al2,int plt,int plt1,int plt2) { long int wd2,wd4; int apl2; wd2 = 4L*(long)al1; if((long)plt*plt1 >= 0L) wd2 = -wd2; /* check same sign */ /* CONDITION */ wd2 = wd2 >> 7; /* gain of 1/128 */ // Frama_C_show_each_TEST(plt,plt2,(long)plt*plt2>= 0L); if((long)plt*plt2 >= 0L) { /* CONDITION */ wd4 = wd2 + 128; /* same sign case */ } else { wd4 = wd2 - 128; } apl2 = wd4 + (127L*(long)al2 >> 7L); /* leak factor of 127/128 */ Frama_C_show_each_GOT(wd4); return(apl2); } int G; void main() { G += uppol2(0,0,0,0,0); G += uppol2(0,0,-1,1,0); G += uppol2(0,0,-1,2,2); G += uppol2(0,0,0,3,0); } frama-c-20.0-Calcium/tests/value/call_simple.i0000666000000000000000000000027513571573400016133 0ustar int X,c,u,v,w,G; void f(int* a,int b,int c) { int *i=a; *i = 0; a = 0; X = (int) (a+b+c); } int main (int ll) { u = 3; v = G; w = 17; f(&u,v,w); c = ll++; return 0; } frama-c-20.0-Calcium/tests/value/case_analysis.i0000666000000000000000000000050513571573400016461 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -slevel 30 -journal-disable -float-normal */ int sq,s; float rq,r; void main(int c) { s = (c >= -10) ? ((c <= 10) ? c : 0) : 0; r = s; //@ assert s >= 0 || s < 0 ; sq = s * s; //@ assert r >= 0.0 || r < 0.0 ; rq = r * r; } frama-c-20.0-Calcium/tests/value/cast.i0000666000000000000000000000304513571573400014577 0ustar /* run.config* STDOPT: */ /* These declarations are useful for the plugin 'variadic' */ //@ axiomatic String { predicate valid_read_string{L}(char *s); } // Beware that this predicate is not recognized by Eva as coming from the libc, and is thus not evaluated. The proper solution would be to enclose it inside __PUSH_FC_STDLIB pragmas. struct __fc_FILE { unsigned int __fc_FILE_id; unsigned int __fc_FILE_data; }; typedef struct __fc_FILE FILE; extern FILE * __fc_stdout; //@ assigns \result, __fc_stdout->__fc_FILE_data; int printf(const char * restrict format, ...); int G,H,K,L,i,b; unsigned int I; signed char c,d,e; unsigned char uc,ud; long long ll,gg; unsigned long long ull, ugg; int any_int_4(void) { volatile int i = 0; return (i/4); }; void main1() { G=258; H=any_int_4(); if (H>=258) {if (H<=268) {G = H;};}; G = G&128?0xFFFFFF00|(G&255):(G&255); G = (signed char)G; // 2..12 K=-10; if (H>=-10) {if (H<=20) {K = H;};}; c = (signed char)(K); // -10..20 uc = c ; // (signed char)(K); // 0..255 K = c; I = (unsigned int)(signed char)(int)(-1); printf("%ud\n",I); L=-19; if (H>=-2000) {if (H<=-10) {L = H;}} d = L; // top ull=1; L=0; if (H>=-2000) {if (H<=1) {L = 2*H;}} e = L; // top } void main2(void) { int min = 130; int max = 135; int i; int G; for (i=min; i<=max; i++) { G = i&128?0xFFFFFF00|(i&255):(i&255); printf("cast:%d formule:%d\n",(int)(signed char) i,G); } printf("usc: %ud",(unsigned int)(signed char)(int)(-1)); } void main() { main1(); main2(); } frama-c-20.0-Calcium/tests/value/cast1.i0000666000000000000000000000050713571573400014660 0ustar short si=0; int i=0; int S[5]={1}; int I[5]={1}; void main(void) { for (si=0;si<2;si++) S[i]=2; for (i=0;i<2;i++) I[i]=2; } void with_if () { long x; short si=x?0:2; if ((unsigned short)si < 2) x=si; else x=3; } void with_if2 () { long x; short si=x?0:4; if ((signed short)si < 2) x=si; else x=3; } frama-c-20.0-Calcium/tests/value/cast2.i0000666000000000000000000000056513571573400014665 0ustar //@ assigns \result \from \nothing; extern int any_int(void); void g() { int t; unsigned int G; t = any_int(); G = t; t = t+1; } unsigned char G = (unsigned char)(-1); void h() { G = -255; } void passcast() { int i = (char)(any_int()); if ((char) i <= 100) { Frama_C_show_each(i); } else while(1); } void main() { g(); h(); passcast(); } frama-c-20.0-Calcium/tests/value/cast_axalto.c0000666000000000000000000000061313571573400016137 0ustar #define STATE_FREE 1 #define STATE_USE 0 struct struct_my { char state; int data[]; } /* __attribute__((__packed__)) */; typedef struct struct_my my_structure; int * my_tab; void f(void) { my_structure * p; p = (my_structure *)my_tab; p->state = STATE_FREE; p->data [2] = 99; } int G[10] = {77,88,99,100}; int main(void){ my_tab = &G[1]; f(); return 1;} frama-c-20.0-Calcium/tests/value/cast_fun.i0000666000000000000000000000305013571573400015443 0ustar /* run.config* STDOPT: #"-calldeps" */ //@ assigns \nothing; int f1(); //@ assigns \nothing; int f2(void); //@ assigns \nothing; int f3(int); //@ assigns \nothing; void f4(int); //@ assigns \nothing; int f5(int, int); struct s1 { int f1; int f2; }; struct s2 { int f1; int f2; }; struct s3 { int f1; int f2; int f3; }; //@ assigns \nothing; void f6(struct s1); //@ assigns \nothing; void f7(struct s2); //@ assigns \nothing; void f8(struct s3); //@ assigns \nothing; void f9(int, ...); //@ assigns \nothing; void f10(); void main(volatile int c) { int (*p1)(int); void (*p2)(struct s1); void (*p3)(int, ...); void (*p4)(); void (*p5) (int); int* y; int x; struct s1 s = {0}; if (c){ p1 = f1; x = (*p1)(c); } if (c){ p1 = f2; x = (*p1)(c); } if (c){ p1 = f3; x = (*p1)(c); } if (c) { p5 = f3; (*p5)(c); } if (c){ p1 = f4; x = (*p1)(c); } if (c){ p4 = f5; (*p4)(c); } if (c){ p2 = f6; (*p2)(s); } if (c){ p2 = f7; (*p2)(s); } if (c){ p2 = f8; (*p2)(s); } if (c) { p3 = f9; (*p3)(c,c); } if (c) { p4 = f10; (*p4)(c,c); } // Not allowed any more: you can't mix function without prototype and variadic. // if (c) { // p4 = f9; // (*p4)(c,c); // } if (c) { p4 = f10; (*p4)(c,c); } if (c) { p1 = f10; x = (*p1)(c); } if (c) { p1 = f10; (*p1)(c); } if (c) { p4 = f1; (*p4)(c); } if (c) { y = f1; p4 = y; (*p4)(c); } } frama-c-20.0-Calcium/tests/value/cast_hetero.i0000666000000000000000000000021113571573400016135 0ustar int X; int*pt; void f(int c) { pt = &X; *pt = c; } int T[10]={0}; void g(int c){ pt = &X; T[X] = c; } void main() { g(1); } frama-c-20.0-Calcium/tests/value/cast_return.c0000666000000000000000000000153213571573400016167 0ustar /* run.config* STDOPT: +"-eva-warn-copy-indeterminate=-@all -print -then -eva-warn-copy-indeterminate @all -no-print" STDOPT: #"-eva-warn-copy-indeterminate=-g,-fl1,-fl2 -print -no-collapse-call-cast" */ extern int i; int f () { return i; } volatile int c; int g() { int x; if (c) x = 1; return x; } char h() { return 1; } void main1 () { if(c) {float f_ = f();} if(c) {long long v = g();} if(c) { int* x = 0;; int **p = &x; **p = h(); } } float fl1 () { float v; *(char*)&v = 1; return v; } float fl2 () { float v; if (c) v = 1; return v; } void main2() { double d1; double d2; if (c) { d1 = fl1(); } d2 = fl2(); } //@ assigns \result \from \nothing; float ret_float(void); void main3() { float f1 = ret_float (); float f2 = f1 + 1; } void main() { main1(); main2(); main3(); } frama-c-20.0-Calcium/tests/value/cert_exp35_c.i0000666000000000000000000000334213571573400016130 0ustar /* run.config* STDOPT: */ /* These declarations are useful for the plugin 'variadic' */ //@ axiomatic String { predicate valid_read_string{L}(char *s); } struct __fc_FILE { unsigned int __fc_FILE_id; unsigned int __fc_FILE_data; }; typedef struct __fc_FILE FILE; extern FILE * __fc_stdout; //@ assigns \result, __fc_stdout->__fc_FILE_data; int printf(const char * restrict format, ...); struct X { char a[6]; }; struct X addressee(void) { struct X result = { "world" }; return result; } int main(void) { printf("Hello, %s!\n", addressee().a); return 0; } /* From https://www.securecoding.cert.org/confluence/display/seccode/EXP35-C.+Do+not+access+or+modify+an+array+in+the+result+of+a+function+call+after+a+subsequent+sequence+point This solution is problematic because of three inherent properties of C: In C, the lifetime of a return value ends at the next sequence point. Consequently by the time printf() is called, the struct returned by the addressee() call is no longer considered valid, and may have been overwritten. C function arguments are passed by value. As a result, copies are made of all objects generated by the arguments. For example, a copy is made of the pointer to "Hello, %s!\n". Under most circumstances, these copies protect you from the effects of sequence points described earlier. Finally, C implicitly converts arrays to pointers when passing them as function arguments. This means that a copy is made of the pointer to the addresee().a array, and that pointer copy is passed to printf(). But the array data itself is not copied, and may no longer exist when printf() is called. Consequently when printf() tries to dereference the pointer passed as its 2nd argument, it is likely to find garbage. */ frama-c-20.0-Calcium/tests/value/changeret.i0000666000000000000000000000060713571573400015606 0ustar // Test a change in [lv] during a call [lv = f()]. Currently inactive int x, y; int *p; volatile int v; int f() { p = &y; return 1; } void main1() { p = &x; *p = f(); // Warn } int g() { int z = *p; return 1; } void main2() { p = &y; if (v) p++; *p = g(); //Do not warn (even though p is {&y, &y+1} before and {&y} after) } void main() { main1(); main2(); } frama-c-20.0-Calcium/tests/value/cmp.i0000666000000000000000000000030113571573400014414 0ustar int cmp(const char *s1, const char *s2) { if (*s1 == *s2) {;} ; return 1; } int main (unsigned int c,int d,int e) { char T[10]; if(c) T[d]=e; int r = cmp(T+c,"V1.2"); return r; } frama-c-20.0-Calcium/tests/value/cmp_ptr.i0000666000000000000000000000111013571573400015300 0ustar /* run.config* STDOPT: #"-main main -eva-msg-key pointer-comparison" STDOPT: #"-undefined-pointer-comparison-propagate-all -eva-msg-key pointer-comparison" */ int *p,T[10]={0,1,2,3,4,5,6,7,8,9}; char C[10]={0,1,2,3,4,5,6,7,8,9}; char *q; extern int top_p, top_q; int f(void); int g(void); int x,y,z,t,r; float ff; int main (int u) { p = &T[1] + top_p; q = &C[1] + top_q; if (p >= &(T[5])) {*p=88;*q=77;} x = !(&y+2); *(int*)&ff = (int) (&y + 2); y = !ff; z = (u?&f:&g) == 0; t = (1 + (int)(u?&f:&g)) == 0; r = (T-1) == 0; if(&f+3) {} } frama-c-20.0-Calcium/tests/value/cmp_ptr_follow_all_branches.i0000666000000000000000000000062013571573400021364 0ustar /* run.config* STDOPT: #"-eva-msg-key pointer-comparison" STDOPT: #"-undefined-pointer-comparison-propagate-all -eva-msg-key pointer-comparison" */ int a; char *p = &a; int *q = &a; typedef unsigned int size_t; int main() { if ( (p + (size_t) -5) < p ) Frama_C_show_each_1(); else Frama_C_show_each_2(); if ( (q + (size_t) -5) < q ) Frama_C_show_each_3(); else Frama_C_show_each_4(); } frama-c-20.0-Calcium/tests/value/cond.i0000666000000000000000000000211213571573400014562 0ustar int G; int x,y; int f() { return G?0:(-51); } int i,t[]={ 1, 2, 3, 4, 5, 6, 7, 8 },(*p)[8],z, R, U[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0 }; int main(int argc, char**argv) { int r; int inRet = (0); char c = **argv; short s = argc; if(c < 0) x = c; if(s >= -10) y = s; r = f() ; if (r != (0)) { inRet = (-51); } p = t; i = argc>=1?argc<=3?argc:1:1; if ((*p)[i]==3) z = i; i = argc>=1?argc<=7?argc:1:1; if (t[i]==4) R = i; unsigned u = unknf(); if (u>=8) u = 8; if (u!=3) Frama_C_show_each_2(u); Frama_C_show_each_3(u); unsigned v = 2 * u; if (v!=3) Frama_C_show_each_4(v); Frama_C_show_each_5(v); if (v!=10) Frama_C_show_each_6(v); Frama_C_show_each_7(v); unsigned w = unknf(); if (U[w] != 0) {// The alarm guarantees that 0 <= w <= 12, and then backward // propagation tries the values 0 and 12 separately // (because 0-terminated arrays are frequent in embedded code) Frama_C_show_each_w(w); //@ assert w != 0 && w != 12; } return inRet; } frama-c-20.0-Calcium/tests/value/cond2.i0000666000000000000000000000214613571573400014653 0ustar /* run.config* GCC: STDOPT: #"-main zero_ou_un_0 -out-external" STDOPT: #"-main un_1 -out-external" */ volatile int Gx; volatile int Gy; int *px,*py,x,y; int T[100]={0}; int r = 0; int s = 0; int t = 0; int u = 0; void zero_ou_un_0 (void) { int i ; x = Gx ? 0 : 2 ; ; if (x != 0) r = 1; x = 1; y = 0; for (i = 0 ; i < Gx ; i++) x += 2; for (i = 0 ; i < Gy ; i++) y += 5; if (x != y) s = 1; x = Gx ? 0 : 2 ; ; y = Gy ? 1 : 2 ; ; if (x != y) t = 1; x = Gx ? 0 : 2 ; ; if (x != 1) u = 1; } int un_1 (void) { int r = 0; int i ; x = Gx ? 0 : 2 ; ; y = Gy ? 1 : 3 ; ; if (x != y) r = 1; x = 1; y = 0; for (i = 0 ; i < Gx ; i++) x += 2; for (i = 0 ; i < Gy ; i++) y += 2; if (x != y) s = 1; x = Gx ? 0 : 2; y = Gy ? 1 : 3; for (i = 0 ; i < Gx ; i++) x += 4; for (i = 0 ; i < Gy ; i++) y += 4; if (x != y) t = 1; px = Gx ? &(T[0]) : &(T[0]); py = Gy ? &(T[1]) : &(T[1]); for (i = 0 ; i < Gx ; i++) {px += 4; *px=1; } for (i = 0 ; i < Gy ; i++) {py += 4; *py=2; } if (px != py) u = 1; return u; } frama-c-20.0-Calcium/tests/value/cond_integer_cast_of_float.i0000666000000000000000000000462713571573400021177 0ustar /* run.config* OPT: -no-autoload-plugins -load-module eva -eva @EVA_CONFIG@ -no-results -then -float-hex -main mainbis */ typedef double D; typedef float F; int b; extern F f1, f2, f3, f4; extern D d1, d2, d3; extern int i; volatile unsigned int c; /*@ requires 0. <= f1 <= 8. && 0. <= d1 <= 8. ; */ void main1() { if ((int)f1 >= 2) Frama_C_show_each_float_(f1); if ((int)f1 <= 4) Frama_C_show_each_float_(f1); if ((int)f1 != 0) Frama_C_show_each_float_(f1); if ((int)f1 == 3) Frama_C_show_each_float_(f1); if ((int)d1 >= 2) Frama_C_show_each_double(d1); if ((int)d1 <= 4) Frama_C_show_each_double(d1); if ((int)d1 != 0) Frama_C_show_each_double(d1); if ((int)d1 == 3) Frama_C_show_each_double(d1); switch ((char)d1) { case 0: b = 0; break; case 1: b = 1; break; case 2: b = 2; break; case 3: b = 3; break; case 4: b = 4; break; case 5: b = 5; break; case 6: b = 6; break; case 7: b = 7; break; case 8: b = 8; break; default : b = 999; break; } Frama_C_show_each(d1, b); } void main2() { if ((double)f1 > 1.17) { // f1 should be a float afterwards Frama_C_dump_each(); // dump_each because show_each cast to float itself... if (! ((double)f1 > 1.17)) Frama_C_show_each_not_ok_f1(f1); } else { Frama_C_dump_each(); } if (d1 > (float)1.17) { Frama_C_show_each_double(d1); if (! ((double)d1 > (float)1.17)) Frama_C_show_each_not_ok_d1(f1); } if (d2 > 1.17) { Frama_C_show_each_double(d2); if (! ((double)d2 > 1.17)) Frama_C_show_each_not_ok_d2(f1); } } /* Reduction by numeric predicates in the logic, with arguments of different type */ /*@ requires f4: -1000. <= f4 <= 1000; // Must fit in an int requires d2: -1000. <= d2 <= 1000; */ void main3() { // Float/real, cast to bigger float //@ assert f1 > 10.; // Ok //@ assert (double)f2 > 10.; // Ok //@ assert d1 > 10.; // Ok // Float/integer //@ assert f3 > 10; // Ok // Integer/real //@ assert i > 50.; // TODO //@ assert (int)f4 > 10; //@ assert (int)d2 > 10; Frama_C_dump_each(); } void main() { switch(c) { case 1: main1 (); break; case 2: main2 (); break; case 3: main3 (); break; case 4: main3 (); break; } } void mainbis() { // Only to get hex floating-point display main(); } frama-c-20.0-Calcium/tests/value/conditional_initializer.i0000666000000000000000000000005213571573400020546 0ustar int T[1] = {0?(char)1:2}; void main () {} frama-c-20.0-Calcium/tests/value/config.h0000666000000000000000000000066313571573400015114 0ustar /* config.h. Generated from config.h.in by configure. */ /* #undef HAVE_WCHAR_T */ #define HAVE_STDLIB_H 1 #define HAVE_STRINGS_H 1 /* #undef HAVE_SYS_TIME_H */ #define HAVE_UNISTD_H 1 /* #undef HAVE_CONST */ /* #undef HAVE_INLINE */ /* #undef HAVE_TIME_H */ /* #undef HAVE_MEMCP */ /* #undef HAVE_MKDIR */ /* #undef HAVE_SELECT */ /* #undef HAVE_SOCKET */ #define TYPE_SIZE_T "unsigned long" #define TYPE_WCHAR_T "int" frama-c-20.0-Calcium/tests/value/config_types.h0000666000000000000000000000013513571573400016332 0ustar #define false 0 #define true 1 #define bool int #define _int int #define real float frama-c-20.0-Calcium/tests/value/const.i0000666000000000000000000000443613571573400015000 0ustar /* run.config* STDOPT: */ extern const int G; extern const int I=2; int J = 8; volatile v; int X; const struct { int i1; int i2; } s = { 3, 4}; const int t[10] = {1, 2, 3, 4, 5, 6}; void const_formal(int const i) { Frama_C_show_each(i); if (v) *((int *)&i) = 0; } void pointer_to_const(const int *p) { Frama_C_show_each(*p); *((int *)p) = 0; // Invalid access through the formal itself Frama_C_show_each_dead(); } void const_destination(int *p) { Frama_C_show_each(*p); *p = 0; // Invalid access through the variable pointed Frama_C_show_each(p); } void modify_I (){ Frama_C_show_each(I); if (v) pointer_to_const(&I); if (v) const_destination((int *)&I); } void modify_J (){ Frama_C_show_each(J); if (v) J++; if (v) pointer_to_const(&J); if (v) const_destination(&J); } void modify_s (){ Frama_C_show_each(s.i1); if (v) pointer_to_const(&s.i2); if (v) const_destination((int *)&s.i2); } void modify_t(){ Frama_C_show_each(t[5]); if (v) pointer_to_const(&t[3]); if (v) const_destination((int *)&t[2]); } // we can reduce G, even though it is constant void constrain_G () { int r; if (G == 1) { r = G + 2; } else { //@ assert G == 4; r = G + 1; } Frama_C_show_each(G); } // Validity in the logic must correspond to the C part: check that the l-value // is not const void pointer_to_const_logic(const int *p) { if (v) *((int *)p) = 12; } int f() { return 7; } void local_const () { const int x = 5; const int y = f(); } const int aux_ret_const() { return 1; } // the 'const' qualifier of aux_ret_const must not influence the assignments // performed in the engine for the return value. Nothing should be const here int ret_const() { return aux_ret_const(); } typedef struct { __attribute__((__fc_mutable)) int x; const int y; } S; void build_S( __attribute__((__fc_initialized_object)) const S* s, int x, int y) { s->x = x; s->y=y; } void mutable_test(const S* s) { s->x = 42; s->x++; s->x += 2; } void main () { const_formal(G); const_formal(42); modify_I(); modify_J(); modify_s(); modify_t(); constrain_G (); pointer_to_const_logic (&J); local_const (); ret_const(); const S ls; build_S(&ls, 1, 2); Frama_C_show_each_S1(ls.x, ls.y); mutable_test(&ls); Frama_C_show_each_S2(ls.x, ls.y); } frama-c-20.0-Calcium/tests/value/const2.i0000666000000000000000000000021113571573400015045 0ustar struct S {unsigned char a; int b;}; const struct S T[2] = {{.a=1,.b=2},{.a=3,.b=4}}; unsigned short int main () { return (T[0].b); } frama-c-20.0-Calcium/tests/value/const_syntax.i0000666000000000000000000000031713571573400016400 0ustar const unsigned char INSTRU_N_00_01_001_CRC___1525983317999999999994352352523523993424999 = 0; void main () { const unsigned char INSTRU_N_00_01_001_CRC___1525983317999999999994352352523523993424999 = 0; } frama-c-20.0-Calcium/tests/value/const_typedef.i0000666000000000000000000000125413571573400016513 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -print -then -eva @EVA_CONFIG@ -lib-entry -no-print */ typedef int INT[3][3]; typedef int INT2[][3]; typedef int INT3[2][7]; const __attribute__((BLA)) INT x1 = {1, 2, 3, 4, 5, 6, 7}; const __attribute__((BLA)) INT x1bis; const __attribute__((BLA)) INT2 x2 = {1, 2, 3, 4, 5, 6, 7 }; const __attribute__((BLA)) INT3 x3 = {1, 2, 3, 4, 5, 6, 7}; typedef struct { int s1; int s2; } ts; const __attribute__((BLA)) ts s[3] ={ 1, 2, 3, 4, 5}; typedef int INT4[7]; typedef int INT5[]; const INT4 y1 = {0, 1, 2, 3, 4}; const INT5 y2 = {1, 2, 3, 4, 5}; extern const INT4 y3; const int y4[7] = {1, 2}; int main() { } frama-c-20.0-Calcium/tests/value/constarraystructlibentry.i0000666000000000000000000000161013571573400021044 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -lib-entry -eva-initialization-padding-globals yes -then -eva-initialization-padding-globals no */ const int t[] = { 1, 2, 3, 4, 5 } ; const int t2[3][3] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } ; typedef const int tt3[3]; tt3 t3[3] = { 10, 20, 30, 40, 50, 60, 70, 80, 90 } ; typedef struct { int f1; const int f2; } ss; typedef struct { int f0; const char f2; } ss2; const int t4[12] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; ss t5[7] = {{1, 2}, {3}, 5, 6, 7, 8, 9, 10}; ss2 t6[6] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; extern const t7[5]; // Do not initialize to 0 extern const t8[5] = {1, 2}; // Ignore extern (done by Cil) struct ts1 {int b; char c;}; struct ts2 {struct ts1 a; char c;}; struct ts3 {const struct ts1 a; char c;}; const struct ts1 s1; const struct ts2 s2; struct ts3 s3; void main(){ int *x = t7; } frama-c-20.0-Calcium/tests/value/context_free.i0000666000000000000000000000227013571573400016331 0ustar /* run.config* GCC: OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -lib-entry -main f -absolute-valid-range 0x200-0x199 -eva-msg-key initial-state -journal-disable */ int a,b,c; volatile int vol; int star_p, star_w___500; struct str { int s1; int s2; int *sp ; int (*sg)(char *) ; } s; struct str t; struct strstr { struct str ss1; int ss2; } tt; int u[12]; int v[12][3]; int *(w[12]); struct str ts[10]; union uni { int u1 ; struct str u2 ; } uu ; struct str_arith { int s1; int s2; float s3; } ; union uni_arith { int u1 ; struct str_arith u2 ; float u3 ; } uuu ; int c_int = 34; extern struct { int f1; void *p; // void* field: valid, size unknown } svoid; extern void *qvoid; // void* pointer: valid, size unknown void f(int x, float y, int **p, int (*g)(char const*), void *vv, void **vvv, int ta[5]) { if (x >= 0) a = x; b = s.s1 ; t.s2 = 3; tt.ss2 = c; p = p; *p = *p; u[1]=2; v[0][0]=5; w[4]=&a; (ts[3]).s1 = (ts[3]).s1 ; vv = vv; *vvv = *vvv; c_int = c_int; uu.u1 = uu.u1; uuu.u1 = uuu.u1; ta[1]=3; ta=ta; char* pvoid = svoid.p; *pvoid = 1; pvoid = qvoid; *pvoid = (char) &pvoid; if (vol) { g("toto"); } } frama-c-20.0-Calcium/tests/value/context_free_simple.i0000666000000000000000000000013213571573400017675 0ustar int z=1; int f(int x,int y) { z = x+y; return y+1; } void main(void) { f(2,3); } frama-c-20.0-Calcium/tests/value/context_width.i0000666000000000000000000000044713571573400016533 0ustar /* run.config* STDOPT: +"-context-width 3 -then -print -then -context-width 1" */ int a; void main(int *p) { if (! (p == 0)) { if (! (p+1 == 0)) { if (! (p+2 == 0)) {} } if (p+1 == &a) {} *p = 1; *(p+1) = 2; *(p+2) = 3; } else { /*@ assert \false; */ } } frama-c-20.0-Calcium/tests/value/control.i0000666000000000000000000000026213571573400015323 0ustar /* run.config* GCC: STDOPT: #"-main f" */ int x,y,c,d; void f() { int i; for(i=0; i<4 ; i++) { if (c) { if (d) {y++;} else {x++;}} else {}; x=x+1; } } frama-c-20.0-Calcium/tests/value/conversion.i0000666000000000000000000000225013571573400016027 0ustar /* run.config* STDOPT: +"-eva-warn-copy-indeterminate=-@all -then -eva-warn-copy-indeterminate=@all" */ // Comments are given for cases where -eva-warn-copy-indeterminate is not set volatile v; void main() { int x; unsigned int y; float f; x = 1; f = *(float *)&x; // cast Frama_C_dump_each(); // Use Frama_C_dump_each because it does not cast the values, unlike Frama_C_show_each x = v; //@ assert ASSUME : 0 <= x <= 1120000000; f = *(float *)&x; // cast Frama_C_dump_each(); x = v; //@ assert ASSUME : -10 <= x <= 10; f = *(float *)&x; // cast, infinite-nan Frama_C_dump_each(); x = v; //@ assert ASSUME : -10 <= x <= 10; y = *(unsigned int *)&x; // no cast; Frama_C_dump_each(); f = v; //@ assert ASSUME: 3 <= f <= 5; x = *(int *)&f; // cast Frama_C_dump_each(); x = (int)&x; f = *(float *)&x; // no cast, pointers. We produce a GM anyway; Frama_C_dump_each(); *(short *)&x = 1; *((short *)&x+1) = 2; f = *(float *)&x; // no cast, multiple ranges; Frama_C_dump_each(); int l; if (v) { l = v; //@ assert ASSUME: 5 <= l <= 15; } f = *(float *)&l; // cast + uninitialized alarm Frama_C_dump_each(); } frama-c-20.0-Calcium/tests/value/copy_paste.i0000666000000000000000000000021613571573400016010 0ustar int t[12],G; void main(int c) { volatile int l=0; int i=c?3:4; int j=c?(-3):4; t[i] = i; t[j] = j; if (l) l = *(int*)l; G=l; } frama-c-20.0-Calcium/tests/value/copy_paste_hidden_by_dummy_cast.i0000666000000000000000000000051713571573400022246 0ustar typedef unsigned short T_WORD16; typedef unsigned int T_WORD32; typedef short T_INT16; typedef float T_FLOAT; struct S { T_INT16 a ; T_WORD32 b ; }; typedef struct S T_ERREUR_ANO; T_ERREUR_ANO const A4O1_Ci_sNO_ERREUR_ANO = {0, 0}; void main () { struct S Rl_sErreurAno ; Rl_sErreurAno = A4O1_Ci_sNO_ERREUR_ANO; } frama-c-20.0-Calcium/tests/value/copy_stdin.i0000666000000000000000000000013313571573400016013 0ustar int * leaf(void); void main () { int * stdin, *toto; stdin = leaf(); toto = stdin; } frama-c-20.0-Calcium/tests/value/dangling.i0000666000000000000000000000063613571573400015433 0ustar volatile int v; void main() { int* x, y; y = 1; if (v) { int v; x = &v; } else { x = &y; } if (v) { //@ assert !\dangling(&x); //@ assert !\dangling(&x); } if (v) { int i = *x + 1; int j = *x + 2; } if (v) { //@ assert \dangling(&x); int j = *x + 1; } int *p[2]; { int z; p[0] = &z; p[1] = 42; } //@ assert !\dangling(&p[0..1]); } frama-c-20.0-Calcium/tests/value/dataflow_order.i0000666000000000000000000000066513571573400016646 0ustar volatile c; unsigned int j, k; void f() { j++; } void g() { k++; } // Strategy on 'if' at the end of the loop. Do not do one branch of the if // entirely before doing the other one. void main() { int i = 0; while(i < 65000) { Frama_C_show_each_1(i, j); i++; if (c) { Frama_C_show_each_then(i, j); f(); } else { Frama_C_show_each_else(i, j); g(); } } Frama_C_show_each_end(); } frama-c-20.0-Calcium/tests/value/dead_code.i0000666000000000000000000000026613571573400015536 0ustar void main(int in) { int i,j=6,k,l; i=10; //@ impact pragma stmt; i=1; L: if (i) {l= 17 ; goto OUT;} // i--; // j+=i; // goto L; // while (1); OUT: j = l; l=17; } frama-c-20.0-Calcium/tests/value/dead_code2.i0000666000000000000000000000020513571573400015611 0ustar int G; void main(void) { int i,j,k,l; i=10; G=0; L: if (i=1) goto OUT; i = i - 1 - G; j+=i; goto L; OUT: l=17; } frama-c-20.0-Calcium/tests/value/dead_inout.i0000666000000000000000000000115613571573400015761 0ustar /* run.config* OPT: -no-autoload-plugins -load-module from,inout @EVA_CONFIG@ -out -input -inout -inout -main main_all */ // This tests a potential imprecision with the computation of input and outputs if one forgets to test that a statement is dead int a, b; void f() { a = b; } void g () { int x = 0; if (x) f (); } void main(){ f (); g (); } // This tests the computation of inout with non-conditional ifs void f2(int v, int *p, int *q) { if (v) *q = 1; if (v) *p = 2; } void main2() { int x, y; f2(0, &x, &x); f2(1, &x, &y); } // Main void main_all() { main(); main2(); } frama-c-20.0-Calcium/tests/value/dead_statuses.i0000666000000000000000000000064713571573400016502 0ustar /* run.config* STDOPT: +"-load-module report -then -report" */ //@ requires \true; assigns \nothing; void f(void); void main(int c) { f(); if (c >= 0) { f(); if (c < 0) { f (); int t[3] = {1}; // Test statuses of behaviors, that are logical consequences //@ assert \false; //@ loop invariant \false; while (1) { //@ requires \false; c = 0; } } } } frama-c-20.0-Calcium/tests/value/deep_conditionals.i0000666000000000000000000000023513571573400017326 0ustar void main(void) { char X,Y ; Y = ((X=66, ((0 == 1) || (X=22,X=33,2==3)) && (4==5)))? (((X=66, ((0 == 1) || (X=22,X=33,2==3)) && (4==5))) ? 99:77):77 ; } frama-c-20.0-Calcium/tests/value/definitions.h0000666000000000000000000000200613571573400016153 0ustar /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** Command : ** l2C CruiseControl.lus -node CruiseControl ** -noexp @ALL@ ** -keep_named_var ** -const ** -bitwise ** -loc_ctx ** -no_copy_mem ** -debug ** date of generation (MM/DD/YYYY): 07/06/2007 13:30:09 ** last modification date for CruiseControl.lus (MM/DD/YYYY): 07/06/2007 ********************************************************************$*/ #define _copy_mem(t,d,s) Copy_mem(t,d,s) extern int _copy_mem(int, void *, const void *); #define _comp_mem(t,x,y) Comp_mem(t,x,y) extern int _comp_mem(int, const void *, const void *); extern int printf(const char *, ...); #define __assert(x) printf ("Violation of the assertion %s\n", x); return (false) /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** End of file definitions.h ** End of generation (MM/DD/YYYY) : 07/06/2007 13:30:09 ********************************************************************$*/ frama-c-20.0-Calcium/tests/value/degeneration2.i0000666000000000000000000000070113571573400016367 0ustar /* The name of this file is probably historical, as Value no longer degenerates on anything in it */ volatile v; void main (int c,int d) { void *A,*B,*C,*D, *E; if (c) {A = (void*)&B; B= (void*)&C; C= (void*)&D; D= (void*)&E; }; A = (void*)(-(int)A); while (c) { A = (void*)*((int*)A); } int offset_uninit; char T[10][10]; int x = (d<=10)?((d>=0)?d:0):0; if (v) { int vv = T[x][offset_uninit]; } } frama-c-20.0-Calcium/tests/value/deps.i0000666000000000000000000000141013571573400014572 0ustar /* run.config* GCC: STDOPT: #"-main f" STDOPT: #"-main fonc1" STDOPT: #"-main fonc2" */ int f (int a, int b,int c){ int w,d; if (c) b = 0; return w; } int fonc1 (int a, int b){ int w; struct t1 { int x; int y;} v1; v1.x = a+b; w = v1.x; if (a) { struct t1 { int x; int y;} v2; struct t2 { int x; int y;} v3; v2.x = a; v3.x = b; w = w + v2.x + v3.x; } return w; } int fonc2 (int a, int b){ int w; struct t1 { int x; int y;} v1; v1.x = a+b; w = v1.x; return w; } struct Tstr { int a; int b; }; int h (struct Tstr * ps) { return ps->a; } int ptr (int*pt) { return *pt; } int i (int x, int y) { struct Tstr s;// = {x, y}; int g; g=0; return (*(&g)); return ptr(&g); s.a = 0; return h(&s); } frama-c-20.0-Calcium/tests/value/deps_addr.i0000666000000000000000000000011113571573400015561 0ustar int *t; int a; int tt[5][5]; int main () { return *(&(t[(int)&a])); } frama-c-20.0-Calcium/tests/value/deps_compose.i0000666000000000000000000000103113571573400016316 0ustar int c, z, x1, y1, x2, y2, x3, y3, z, x4, y4, x5, y5, x6, y6; int c = 1; void f() { if (c) { x1 = y1; x2 = y2; x3 = y3; x4 = y4; x5 = y5; x6 = y6; } } void main() { if (c) { f(); } y1 = z; y2 = z; y3 = z; y4 = z; y5 = z; y6 = z; f(); // Previous versions of Frama-C recognized that the 'from' for x1..x6 // before and after the call were identical, and merged them. This is // incorrect, as those of the call must be substituted (here, changed // into 'From z') } frama-c-20.0-Calcium/tests/value/deps_local.i0000666000000000000000000000027713571573400015756 0ustar int G,H; int h(int *argh) { // G = *argh; *argh = H; return H; } int g() { int ga; h(&ga); return 0; } int f() { int fa; h(&fa); return 0; } int main() { f(); g(); } frama-c-20.0-Calcium/tests/value/deps_mixed.i0000666000000000000000000000054713571573400015772 0ustar int *p,*q; int a,b; int r=2, s; volatile int v; int f(int x, int y, int z) { return x; } int g(int x, int y, int z) { return y; } int (*t[2])(int, int, int) = { f, g}; int main (int c, int d, int i0, int i1, int i2, int i3) { p=c?&a:(int*)3; q=d?&b:(int*)2; if (v) r = *((p+ (int)q)); s = (t[i0])(i1, i2, i3); return ((int)(p+ (int)q)); } frama-c-20.0-Calcium/tests/value/deps_unitialized_locals.i0000666000000000000000000000065013571573400020535 0ustar /* run.config* STDOPT: #"-calldeps" */ volatile maybe; typedef struct { short ts; int ti; } typ; typ v1, v2; int v; void f() { typ ty = {1, 2}; v1 = ty; // Dependency for the padding between ts and ti } void g() { int i; if (maybe) i = 1; v = i; } void h(int i) { if (maybe) i = 1; v = i; } void main() { f(); v2 = v1; // Dependency must not leak there g(); int x = 1; h(x); } frama-c-20.0-Calcium/tests/value/deref.i0000666000000000000000000000026113571573400014727 0ustar /* run.config* GCC: STDOPT: +"-no-input -no-out -deref" */ int a,b,c,d,e,*p, t[10]; int main (void) { int i = 0; p = &a; return *p + b + *(&c) + (&d)[i] + t[i]; } frama-c-20.0-Calcium/tests/value/descending.i0000666000000000000000000000051113571573400015743 0ustar int f(int A[], int n) { int i = 0; while (i < n) A[i++] = 0; return i; } int test1() { int A[10]; int i = f(A, 10); return A[i-1]; } void test2() { int A[33]; int i; int n = 31; for (i = 0 ; i < n ; i++) { A[i] = 0; } int j = i + 1; A[j] = 1; } void main(void) { test1(); test2(); } frama-c-20.0-Calcium/tests/value/diff_apron0000666000000000000000000011153613571573400015532 0ustar diff tests/value/oracle/alias.1.res.oracle tests/value/oracle_apron/alias.1.res.oracle 85c85 < z ∈ {0; 1; 2} --- > z ∈ {0; 2} diff tests/value/oracle/alias.2.res.oracle tests/value/oracle_apron/alias.2.res.oracle 76c76 < z ∈ {-5; -4; -3; -2; -1; 0; 1; 1000} --- > z ∈ {-1; 1000} diff tests/value/oracle/alias.3.res.oracle tests/value/oracle_apron/alias.3.res.oracle 67c67 < z ∈ {0; 1; 2} --- > z ∈ {0; 2} diff tests/value/oracle/alias.6.res.oracle tests/value/oracle_apron/alias.6.res.oracle 82c82 < t ∈ {4; 5; 6} --- > t ∈ {5} diff tests/value/oracle/array_degenerating_loop.res.oracle tests/value/oracle_apron/array_degenerating_loop.res.oracle 11,12d10 < [eva:alarm] tests/value/array_degenerating_loop.i:9: Warning: < signed overflow. assert G + t[i] ≤ 2147483647; 14c12 < Frama_C_show_each: [55..2147483647], [-2147483648..99] --- > Frama_C_show_each: [55..155], [-2147483648..99] diff tests/value/oracle/backward_add_ptr.res.oracle tests/value/oracle_apron/backward_add_ptr.res.oracle 71c71,74 < [eva] tests/value/backward_add_ptr.c:91: Reusing old results for call to gm --- > [eva] computing for function gm <- main3 <- main. > Called from tests/value/backward_add_ptr.c:91. > [eva] Recording results for gm > [eva] Done for function gm 93c96,99 < [eva] tests/value/backward_add_ptr.c:110: Reusing old results for call to gm --- > [eva] computing for function gm <- main3 <- main. > Called from tests/value/backward_add_ptr.c:110. > [eva] Recording results for gm > [eva] Done for function gm 107c113,116 < [eva] tests/value/backward_add_ptr.c:125: Reusing old results for call to gm --- > [eva] computing for function gm <- main3 <- main. > Called from tests/value/backward_add_ptr.c:125. > [eva] Recording results for gm > [eva] Done for function gm 160c169,172 < [eva] tests/value/backward_add_ptr.c:160: Reusing old results for call to gm --- > [eva] computing for function gm <- main4 <- main. > Called from tests/value/backward_add_ptr.c:160. > [eva] Recording results for gm > [eva] Done for function gm diff tests/value/oracle/call_simple.res.oracle tests/value/oracle_apron/call_simple.res.oracle 28c28 < c ∈ [--..--] --- > c ∈ [-2147483648..2147483646] diff tests/value/oracle/deps_compose.res.oracle tests/value/oracle_apron/deps_compose.res.oracle 24c24,27 < [eva] tests/value/deps_compose.i:26: Reusing old results for call to f --- > [eva] computing for function f <- main. > Called from tests/value/deps_compose.i:26. > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/divneg.res.oracle tests/value/oracle_apron/divneg.res.oracle 57c57 < vic ∈ {4294967295} --- > vic ∈ {-1} diff tests/value/oracle/downcast.res.oracle tests/value/oracle_apron/downcast.res.oracle 61c61 < [100000..2147483647], [100145..2147483647], [100145..2147483647] --- > [100000..2147483502], [100145..2147483647], [100145..2147483647] diff tests/value/oracle/dur.res.oracle tests/value/oracle_apron/dur.res.oracle 310c310 < V6 ∈ [--..--] or UNINITIALIZED --- > V6 ∈ [0..32767] or UNINITIALIZED diff tests/value/oracle/find_ivaltop.res.oracle tests/value/oracle_apron/find_ivaltop.res.oracle 32,33c32,33 < j ∈ {0; 1; 2; 3; 4; 5; 6; 7} < X ∈ {1; 2; 3; 4; 5; 6; 7; 8} --- > j ∈ {7} > X ∈ {8} 39c39 < \result FROM t[0..7] --- > \result FROM t[7] 44c44 < t[0..7] --- > t[7] diff tests/value/oracle/for_loops.1.res.oracle tests/value/oracle_apron/for_loops.1.res.oracle 39,41c39 < [eva:alarm] tests/value/for_loops.c:16: Warning: < signed overflow. assert w + 1 ≤ 2147483647; < [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: [0..2147483647] --- > [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: [0..100] 47c45 < j ∈ [0..2147483647] --- > j ∈ [0..100] diff tests/value/oracle/for_loops.2.res.oracle tests/value/oracle_apron/for_loops.2.res.oracle 37,39c37 < [eva:alarm] tests/value/for_loops.c:42: Warning: < signed overflow. assert w + T[j] ≤ 2147483647; < [eva] tests/value/for_loops.c:43: Frama_C_show_each: [0..2147483647] --- > [eva] tests/value/for_loops.c:43: Frama_C_show_each: [0..1000] diff tests/value/oracle/fptr.0.res.oracle tests/value/oracle_apron/fptr.0.res.oracle 57c57,60 < [eva] tests/value/fptr.i:9: Reusing old results for call to h --- > [eva] computing for function h <- f <- main. > Called from tests/value/fptr.i:9. > [eva] Recording results for h > [eva] Done for function h 66,67c69,76 < [eva] tests/value/fptr.i:9: Reusing old results for call to hh < [eva] tests/value/fptr.i:9: Reusing old results for call to h --- > [eva] computing for function hh <- f <- main. > Called from tests/value/fptr.i:9. > [eva] Recording results for hh > [eva] Done for function hh > [eva] computing for function h <- f <- main. > Called from tests/value/fptr.i:9. > [eva] Recording results for h > [eva] Done for function h 72c81,92 < [eva] tests/value/fptr.i:52: Reusing old results for call to f --- > [eva] computing for function f <- main. > Called from tests/value/fptr.i:52. > [eva] computing for function hh <- f <- main. > Called from tests/value/fptr.i:9. > [eva] Recording results for hh > [eva] Done for function hh > [eva] computing for function h <- f <- main. > Called from tests/value/fptr.i:9. > [eva] Recording results for h > [eva] Done for function h > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/fptr.1.res.oracle tests/value/oracle_apron/fptr.1.res.oracle 42c42,45 < [eva] tests/value/fptr.i:9: Reusing old results for call to h --- > [eva] computing for function h <- f <- main_uninit. > Called from tests/value/fptr.i:9. > [eva] Recording results for h > [eva] Done for function h 51,52c54,61 < [eva] tests/value/fptr.i:9: Reusing old results for call to hh < [eva] tests/value/fptr.i:9: Reusing old results for call to h --- > [eva] computing for function hh <- f <- main_uninit. > Called from tests/value/fptr.i:9. > [eva] Recording results for hh > [eva] Done for function hh > [eva] computing for function h <- f <- main_uninit. > Called from tests/value/fptr.i:9. > [eva] Recording results for h > [eva] Done for function h 57c66,77 < [eva] tests/value/fptr.i:68: Reusing old results for call to f --- > [eva] computing for function f <- main_uninit. > Called from tests/value/fptr.i:68. > [eva] computing for function hh <- f <- main_uninit. > Called from tests/value/fptr.i:9. > [eva] Recording results for hh > [eva] Done for function hh > [eva] computing for function h <- f <- main_uninit. > Called from tests/value/fptr.i:9. > [eva] Recording results for h > [eva] Done for function h > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/from_call.0.res.oracle tests/value/oracle_apron/from_call.0.res.oracle 64c64,69 < [eva] tests/value/from_call.i:20: Reusing old results for call to g --- > [eva] computing for function g <- f <- main. > Called from tests/value/from_call.i:20. > [eva] Recording results for g > [from] Computing for function g > [from] Done for function g > [eva] Done for function g 74c79,84 < [eva] tests/value/from_call.i:20: Reusing old results for call to g --- > [eva] computing for function g <- f <- main. > Called from tests/value/from_call.i:20. > [eva] Recording results for g > [from] Computing for function g > [from] Done for function g > [eva] Done for function g 145,146c155,166 < [eva] tests/value/from_call.i:44: Reusing old results for call to return_A1 < [eva] tests/value/from_call.i:44: Reusing old results for call to return_A2 --- > [eva] computing for function return_A1 <- dispatcher2 <- call_dispatcher2 <- main. > Called from tests/value/from_call.i:44. > [eva] Recording results for return_A1 > [from] Computing for function return_A1 > [from] Done for function return_A1 > [eva] Done for function return_A1 > [eva] computing for function return_A2 <- dispatcher2 <- call_dispatcher2 <- main. > Called from tests/value/from_call.i:44. > [eva] Recording results for return_A2 > [from] Computing for function return_A2 > [from] Done for function return_A2 > [eva] Done for function return_A2 diff tests/value/oracle/from_call.1.res.oracle tests/value/oracle_apron/from_call.1.res.oracle 60c60,63 < [eva] tests/value/from_call.i:20: Reusing old results for call to g --- > [eva] computing for function g <- f <- main. > Called from tests/value/from_call.i:20. > [eva] Recording results for g > [eva] Done for function g 68c71,74 < [eva] tests/value/from_call.i:20: Reusing old results for call to g --- > [eva] computing for function g <- f <- main. > Called from tests/value/from_call.i:20. > [eva] Recording results for g > [eva] Done for function g 119,120c125,132 < [eva] tests/value/from_call.i:44: Reusing old results for call to return_A1 < [eva] tests/value/from_call.i:44: Reusing old results for call to return_A2 --- > [eva] computing for function return_A1 <- dispatcher2 <- call_dispatcher2 <- main. > Called from tests/value/from_call.i:44. > [eva] Recording results for return_A1 > [eva] Done for function return_A1 > [eva] computing for function return_A2 <- dispatcher2 <- call_dispatcher2 <- main. > Called from tests/value/from_call.i:44. > [eva] Recording results for return_A2 > [eva] Done for function return_A2 diff tests/value/oracle/fun_ptr.0.res.oracle tests/value/oracle_apron/fun_ptr.0.res.oracle 39c39,42 < [eva] tests/value/fun_ptr.i:33: Reusing old results for call to f --- > [eva] computing for function f <- test2 <- main. > Called from tests/value/fun_ptr.i:33. > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/fun_ptr.1.res.oracle tests/value/oracle_apron/fun_ptr.1.res.oracle 39c39,42 < [eva] tests/value/fun_ptr.i:33: Reusing old results for call to f --- > [eva] computing for function f <- test2 <- main. > Called from tests/value/fun_ptr.i:33. > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/gauges.res.oracle tests/value/oracle_apron/gauges.res.oracle 38,39d37 < [eva:alarm] tests/value/gauges.c:26: Warning: < signed overflow. assert l + 1 ≤ 2147483647; 70,71d67 < [eva:alarm] tests/value/gauges.c:48: Warning: < signed overflow. assert l + 1 ≤ 2147483647; 113,114d108 < [eva:alarm] tests/value/gauges.c:81: Warning: < signed overflow. assert k + 1 ≤ 2147483647; 116,117d109 < [eva:alarm] tests/value/gauges.c:84: Warning: < signed overflow. assert k + 1 ≤ 2147483647; 123a116,117 > [eva:alarm] tests/value/gauges.c:81: Warning: > signed overflow. assert k + 1 ≤ 2147483647; 125c119,121 < [eva] tests/value/gauges.c:86: Frama_C_show_each: [0..2147483647] --- > [eva:alarm] tests/value/gauges.c:84: Warning: > signed overflow. assert k + 1 ≤ 2147483647; > [eva] tests/value/gauges.c:86: Frama_C_show_each: [15..2147483647] 139,140d134 < [eva:alarm] tests/value/gauges.c:99: Warning: < signed overflow. assert c + 1 ≤ 2147483647; 187,188d180 < [eva:alarm] tests/value/gauges.c:140: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 299,300d290 < [eva:alarm] tests/value/gauges.c:220: Warning: < signed overflow. assert -2147483648 ≤ n - 1; 315,316d304 < [eva:alarm] tests/value/gauges.c:240: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 318c306 < Frama_C_show_each: {45; 46; 47; 48; 49; 50; 51}, [0..2147483647] --- > Frama_C_show_each: {45; 46; 47; 48; 49; 50; 51}, [0..46] 324,325d311 < [eva:alarm] tests/value/gauges.c:251: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 327c313 < Frama_C_show_each: {48; 49; 50; 51; 52; 53; 54}, [0..2147483647] --- > Frama_C_show_each: {48; 49; 50; 51; 52; 53; 54}, [0..49] 333,334d318 < [eva:alarm] tests/value/gauges.c:263: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 336c320 < Frama_C_show_each: {-59; -58; -57; -56; -55; -54; -53}, [0..2147483647] --- > Frama_C_show_each: {-59; -58; -57; -56; -55; -54; -53}, [0..65] 342,343d325 < [eva:alarm] tests/value/gauges.c:274: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 345c327 < Frama_C_show_each: {-64; -63; -62; -61; -60; -59; -58}, [0..2147483647] --- > Frama_C_show_each: {-64; -63; -62; -61; -60; -59; -58}, [0..70] 353,354d334 < [eva:alarm] tests/value/gauges.c:293: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 356c336 < Frama_C_show_each: {-593; -592; -591; -590; -589; -588}, [0..2147483647] --- > Frama_C_show_each: {-593; -592; -591; -590; -589; -588}, [0..598] 798c778 < n ∈ [-2147483648..99] --- > n ∈ [-2147483547..99] 801c781 < i ∈ [0..2147483647] --- > i ∈ [10..2147483647] 837c817 < i ∈ [0..2147483647] --- > i ∈ [0..21] diff tests/value/oracle/ghost.res.oracle tests/value/oracle_apron/ghost.res.oracle 10,11d9 < [eva:alarm] tests/value/ghost.i:17: Warning: < signed overflow. assert G + 1 ≤ 2147483647; diff tests/value/oracle/hierarchical_convergence.res.oracle tests/value/oracle_apron/hierarchical_convergence.res.oracle 40c40 < j ∈ [0..2147483647] --- > j ∈ [0..99] diff tests/value/oracle/initialized_copy.1.res.oracle tests/value/oracle_apron/initialized_copy.1.res.oracle 24,27c24 < c_0[bits 0 to 7] ∈ {1} or UNINITIALIZED < [bits 8 to 15] ∈ {2} < [bits 16 to 23] ∈ {3} < [bits 24 to 31] ∈ {4} --- > c_0 ∈ {67305985} or UNINITIALIZED 29,32c26 < a_2[bits 0 to 7] ∈ {1} or UNINITIALIZED < [bits 8 to 15] ∈ {2} < [bits 16 to 23] ∈ {3} < [bits 24 to 31] ∈ {4} --- > a_2 ∈ {67305985} or UNINITIALIZED diff tests/value/oracle/invalid_loc_return.res.oracle tests/value/oracle_apron/invalid_loc_return.res.oracle 70c70,73 < [eva] tests/value/invalid_loc_return.i:17: Reusing old results for call to foo --- > [eva] computing for function foo <- main <- main2. > Called from tests/value/invalid_loc_return.i:17. > [eva] Recording results for foo > [eva] Done for function foo diff tests/value/oracle/local.res.oracle tests/value/oracle_apron/local.res.oracle 22c22,25 < [eva] tests/value/local.i:13: Reusing old results for call to f --- > [eva] computing for function f <- g <- main. > Called from tests/value/local.i:13. > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/local_slevel.res.oracle tests/value/oracle_apron/local_slevel.res.oracle 13,15c13,15 < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1} < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0; 1} < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1; 2} --- > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {1} > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0} > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {1} 18c18 < Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3} --- > Frama_C_show_each: {1}, [1..79],1%2, {1; 2; 3} 22c22 < Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3; 4} --- > Frama_C_show_each: {1}, [1..79],1%2, {1; 2; 3; 4} 26,34c26 < Frama_C_show_each: {1}, [1..79],1%2, [0..2147483647] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483647] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {1}, [1..79],1%2, [0..2147483648] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483648] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {1}, [1..79],1%2, [0..4294967295] --- > Frama_C_show_each: {1}, [1..79],1%2, [1..79] 36c28 < Frama_C_show_each: {-1}, [0..78],0%2, [0..4294967295] --- > Frama_C_show_each: {-1}, [0..78],0%2, [0..78] 152c144 < r ∈ [--..--] --- > r ∈ [0..2147483647] 393,395c385,387 < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1} < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0; 1} < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1; 2} --- > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {1} > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0} > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {1} 398c390 < Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3} --- > Frama_C_show_each: {1}, [1..79],1%2, {1; 2; 3} 402c394 < Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3; 4} --- > Frama_C_show_each: {1}, [1..79],1%2, {1; 2; 3; 4} 406,414c398 < Frama_C_show_each: {1}, [1..79],1%2, [0..2147483647] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483647] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {1}, [1..79],1%2, [0..2147483648] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483648] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {1}, [1..79],1%2, [0..4294967295] --- > Frama_C_show_each: {1}, [1..79],1%2, [1..79] 416c400 < Frama_C_show_each: {-1}, [0..78],0%2, [0..4294967295] --- > Frama_C_show_each: {-1}, [0..78],0%2, [0..78] 532c516 < r ∈ [--..--] --- > r ∈ [0..2147483647] diff tests/value/oracle/logicdeps.res.oracle tests/value/oracle_apron/logicdeps.res.oracle 31c31,39 < [eva] tests/value/logicdeps.i:25: Reusing old results for call to g --- > [eva] computing for function g <- main. > Called from tests/value/logicdeps.i:25. > [eva] computing for function f <- g <- main. > Called from tests/value/logicdeps.i:13. > [eva] Done for function f > [eva] Recording results for g > [from] Computing for function g > [from] Done for function g > [eva] Done for function g 51c59,67 < [eva] tests/value/logicdeps.i:32: Reusing old results for call to g --- > [eva] computing for function g <- main. > Called from tests/value/logicdeps.i:32. > [eva] computing for function f <- g <- main. > Called from tests/value/logicdeps.i:13. > [eva] Done for function f > [eva] Recording results for g > [from] Computing for function g > [from] Done for function g > [eva] Done for function g diff tests/value/oracle/long.res.oracle tests/value/oracle_apron/long.res.oracle 15,17c15,26 < [eva] tests/value/long.i:12: Reusing old results for call to f < [eva] tests/value/long.i:12: Reusing old results for call to f < [eva] tests/value/long.i:12: Reusing old results for call to f --- > [eva] computing for function f <- main. > Called from tests/value/long.i:12. > [eva] Recording results for f > [eva] Done for function f > [eva] computing for function f <- main. > Called from tests/value/long.i:12. > [eva] Recording results for f > [eva] Done for function f > [eva] computing for function f <- main. > Called from tests/value/long.i:12. > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/long_const.0.res.oracle tests/value/oracle_apron/long_const.0.res.oracle 19c19,22 < [eva] tests/value/long_const.i:25: Reusing old results for call to LL_ABS --- > [eva] computing for function LL_ABS <- div64 <- main. > Called from tests/value/long_const.i:25. > [eva] Recording results for LL_ABS > [eva] Done for function LL_ABS diff tests/value/oracle/long_const.1.res.oracle tests/value/oracle_apron/long_const.1.res.oracle 19c19,22 < [eva] tests/value/long_const.i:25: Reusing old results for call to LL_ABS --- > [eva] computing for function LL_ABS <- div64 <- main. > Called from tests/value/long_const.i:25. > [eva] Recording results for LL_ABS > [eva] Done for function LL_ABS diff tests/value/oracle/loop_wvar.1.res.oracle tests/value/oracle_apron/loop_wvar.1.res.oracle 12,13d11 < [eva:alarm] tests/value/loop_wvar.i:57: Warning: < signed overflow. assert next + 1 ≤ 2147483647; 27,28c25 < [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], [0..17], [0..11] < [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], [0..18], [0..12] --- > [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], [0..9], [0..9] 37,38c34,35 < j ∈ [0..18] < k ∈ [0..12] --- > j ∈ [0..17] > k ∈ [0..11] 41c38 < next ∈ [0..2147483647] --- > next ∈ [0..25] diff tests/value/oracle/loopinv.res.oracle tests/value/oracle_apron/loopinv.res.oracle 51,53c51 < [eva:alarm] tests/value/loopinv.c:45: Warning: < signed overflow. assert j + 1 ≤ 2147483647; < [eva] tests/value/loopinv.c:46: Frama_C_show_each: [0..99], [0..2147483647] --- > [eva] tests/value/loopinv.c:46: Frama_C_show_each: [0..99], [0..100] 134,135d131 < [ - ] Assertion 'Eva,signed_overflow' (file tests/value/loopinv.c, line 45) < tried with Eva. 148,149c144,145 < 4 To be validated < 13 Total --- > 3 To be validated > 12 Total diff tests/value/oracle/memexec.res.oracle tests/value/oracle_apron/memexec.res.oracle 25,30c25,48 < [eva] tests/value/memexec.c:13: Reusing old results for call to f11 < [eva] tests/value/memexec.c:14: Reusing old results for call to f11 < [eva] tests/value/memexec.c:16: Reusing old results for call to f11 < [eva] tests/value/memexec.c:18: Reusing old results for call to f11 < [eva] tests/value/memexec.c:20: Reusing old results for call to f11 < [eva] tests/value/memexec.c:21: Reusing old results for call to f11 --- > [eva] computing for function f11 <- f1 <- main. > Called from tests/value/memexec.c:13. > [eva] Recording results for f11 > [eva] Done for function f11 > [eva] computing for function f11 <- f1 <- main. > Called from tests/value/memexec.c:14. > [eva] Recording results for f11 > [eva] Done for function f11 > [eva] computing for function f11 <- f1 <- main. > Called from tests/value/memexec.c:16. > [eva] Recording results for f11 > [eva] Done for function f11 > [eva] computing for function f11 <- f1 <- main. > Called from tests/value/memexec.c:18. > [eva] Recording results for f11 > [eva] Done for function f11 > [eva] computing for function f11 <- f1 <- main. > Called from tests/value/memexec.c:20. > [eva] Recording results for f11 > [eva] Done for function f11 > [eva] computing for function f11 <- f1 <- main. > Called from tests/value/memexec.c:21. > [eva] Recording results for f11 > [eva] Done for function f11 104c122,125 < [eva] tests/value/memexec.c:113: Reusing old results for call to f5_aux --- > [eva] computing for function f5_aux <- f5 <- main. > Called from tests/value/memexec.c:113. > [eva] Recording results for f5_aux > [eva] Done for function f5_aux 106,107c127 < Frama_C_show_each_f5: < [9..2147483647], [-2147483648..2147483647], [-2147483648..7] --- > Frama_C_show_each_f5: [9..2147483647], [-2147483648..6], [-2147483648..7] 128c148,151 < [eva] tests/value/memexec.c:137: Reusing old results for call to f7_1 --- > [eva] computing for function f7_1 <- f7 <- main. > Called from tests/value/memexec.c:137. > [eva] Recording results for f7_1 > [eva] Done for function f7_1 143c166,169 < [eva] tests/value/memexec.c:150: Reusing old results for call to f8_1 --- > [eva] computing for function f8_1 <- f8 <- main. > Called from tests/value/memexec.c:150. > [eva] Recording results for f8_1 > [eva] Done for function f8_1 195c221 < g_f5_1 ∈ [--..--] --- > g_f5_1 ∈ [-2147483648..6] 231c257 < g_f5_1 ∈ [--..--] --- > g_f5_1 ∈ [-2147483648..6] diff tests/value/oracle/modulo.res.oracle tests/value/oracle_apron/modulo.res.oracle 40a41,64 > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [-9..-1], [-8..0] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [1..9], [-8..0] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [-9..-1], [0..8] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [1..9], [0..8] > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [1..9], {1; 2; 3; 4; 5; 6; 7; 8}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [-9..-1], {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [1..9], {-8; -7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [-9..-1], {-8; -7; -6; -5; -4; -3; -2; -1}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {1; 2; 3; 4; 5; 6; 7}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6} 50a75,98 > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..-1], [1..9], [-8..0] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..-1], [-9..-1], [-8..0] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [1..10], [1..9], [0..8] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [1..10], [-9..-1], [0..8] > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [-9..-1], {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [1..9], {1; 2; 3; 4; 5; 6; 7; 8}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [-9..-1], {-8; -7; -6; -5; -4; -3; -2; -1}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [1..9], {-8; -7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {1; 2; 3; 4; 5; 6; 7}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6} 60a109,110 > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-10..10], [-9..9], [-8..8] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-9..9], [-8..8], [-7..7] diff tests/value/oracle/octagons.res.oracle tests/value/oracle_apron/octagons.res.oracle 270,273c270,273 < a ∈ [-1024..2147483647] < b ∈ [-1023..2147483647] < c ∈ [-1023..2147483647] < d ∈ [-1032..2147483647] --- > a ∈ [-603..2147483646] > b ∈ [-602..2147483647] > c ∈ [-602..1446] > d ∈ [-611..2147483647] diff tests/value/oracle/offsetmap.0.res.oracle tests/value/oracle_apron/offsetmap.0.res.oracle 62,63c62 < a[bits 0 to 7] ∈ {1; 6} < [bits 8 to 31]# ∈ {6}%32, bits 8 to 31 --- > a ∈ {1; 6} 65,66c64 < a7[bits 0 to 7] ∈ {1} < [bits 8 to 31]# ∈ {97}%32, bits 8 to 31 --- > a7 ∈ {1} 106,107c104 < a[bits 0 to 7] ∈ {1; 6} < [bits 8 to 31]# ∈ {6}%32, bits 8 to 31 --- > a ∈ {1; 6} 109,110c106 < a7[bits 0 to 7] ∈ {1} < [bits 8 to 31]# ∈ {97}%32, bits 8 to 31 --- > a7 ∈ {1} diff tests/value/oracle/offsetmap.1.res.oracle tests/value/oracle_apron/offsetmap.1.res.oracle 62,67c62,64 < a[bits 0 to 7] ∈ {1; 6} < [bits 8 to 31]# ∈ {6}%32, bits 8 to 31 < b[bits 0 to 7] ∈ {0; 1} < [bits 8 to 31]# ∈ {0; 6}%32, bits 8 to 31 < a7[bits 0 to 7] ∈ {1} < [bits 8 to 31]# ∈ {97}%32, bits 8 to 31 --- > a ∈ {1; 6} > b ∈ {0; 1} > a7 ∈ {1} 107,112c104,106 < a[bits 0 to 7] ∈ {1; 6} < [bits 8 to 31]# ∈ {6}%32, bits 8 to 31 < b[bits 0 to 7] ∈ {0; 1} < [bits 8 to 31]# ∈ {0; 6}%32, bits 8 to 31 < a7[bits 0 to 7] ∈ {1} < [bits 8 to 31]# ∈ {97}%32, bits 8 to 31 --- > a ∈ {1; 6} > b ∈ {0; 1} > a7 ∈ {1} diff tests/value/oracle/partitioning-annots.4.res.oracle tests/value/oracle_apron/partitioning-annots.4.res.oracle 14,15d13 < [eva:alarm] tests/value/partitioning-annots.c:134: Warning: < division by zero. assert j ≢ 0; diff tests/value/oracle/precise_locations.res.oracle tests/value/oracle_apron/precise_locations.res.oracle 32,35c32,47 < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct --- > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct 37,42c49,72 < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct --- > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct 520,529c550,589 < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct < [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct --- > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct > [eva] computing for function ct <- main. > Called from tests/value/precise_locations.i:39. > [eva] Recording results for ct > [eva] Done for function ct diff tests/value/oracle/precond.res.oracle tests/value/oracle_apron/precond.res.oracle 49a50,51 > [eva] computing for function f <- main. > Called from tests/value/precond.c:39. 53c55,56 < [eva] tests/value/precond.c:39: Reusing old results for call to f --- > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/ptr_relation.1.res.oracle tests/value/oracle_apron/ptr_relation.1.res.oracle 24c24 < j ∈ {-1; 0; 1} --- > j ∈ {0} diff tests/value/oracle/raz.res.oracle tests/value/oracle_apron/raz.res.oracle 14c14 < i ∈ [0..2147483647] --- > i ∈ [0..10] diff tests/value/oracle/reevaluate_alarms.res.oracle tests/value/oracle_apron/reevaluate_alarms.res.oracle 61c61 < S ∈ [0..2147483647] --- > S ∈ [4..2147483647] diff tests/value/oracle/relation_reduction.res.oracle tests/value/oracle_apron/relation_reduction.res.oracle 24,27d23 < [eva:alarm] tests/value/relation_reduction.i:20: Warning: < accessing out of bounds index. assert 0 ≤ y; < [eva:alarm] tests/value/relation_reduction.i:20: Warning: < accessing out of bounds index. assert y < 9; 34,37c30,33 < R1 ∈ [-2147483648..2147483637] < R2 ∈ [-2147483638..2147483647] < R3 ∈ [--..--] < R4 ∈ {0; 1; 2; 3; 4; 5} --- > R1 ∈ {0; 2} > R2 ∈ {0; 12} > R3 ∈ {0; 7} > R4 ∈ {0; 2} diff tests/value/oracle/relation_shift.res.oracle tests/value/oracle_apron/relation_shift.res.oracle 31,32c31,32 < r1 ∈ [--..--] < r2 ∈ [--..--] --- > r1 ∈ {2} > r2 ∈ {7} 35,37c35,37 < x ∈ [-2147483647..2147483647] < y ∈ [-2147483648..2147483646] < z ∈ [-2147483642..2147483647] --- > x ∈ [-2147483646..2147483642] > y ∈ [-2147483648..2147483640] > z ∈ [-2147483641..2147483647] 49,50c49,50 < r1 ∈ [--..--] < r2 ∈ [--..--] --- > r1 ∈ {2} > r2 ∈ {7} 53,55c53,55 < x ∈ [-2147483647..2147483647] < y ∈ [-2147483648..2147483646] < z ∈ [-2147483642..2147483647] --- > x ∈ [-2147483646..2147483642] > y ∈ [-2147483648..2147483640] > z ∈ [-2147483641..2147483647] diff tests/value/oracle/relations.res.oracle tests/value/oracle_apron/relations.res.oracle 80,81c80,82 < e ∈ [--..--] < f ∈ [--..--] --- > e ∈ {1} > f[bits 0 to 7] ∈ {1; 4} > [bits 8 to 31] ∈ [--..--] diff tests/value/oracle/relations2.res.oracle tests/value/oracle_apron/relations2.res.oracle 25c25 < len ∈ [--..--] --- > len ∈ [0..1023] 36,37c36 < [eva] tests/value/relations2.i:17: < Frama_C_show_each_end: [0..4294967295], [0..64] --- > [eva] tests/value/relations2.i:17: Frama_C_show_each_end: [0..1023], [0..64] 69,71d67 < [eva:alarm] tests/value/relations2.i:34: Warning: < accessing out of bounds index. < assert (unsigned int)(i - (unsigned int)(t + 1)) < 514; 124,125d119 < [eva:alarm] tests/value/relations2.i:35: Warning: < signed overflow. assert s + b3 ≤ 2147483647; 140c134 < len ∈ [--..--] --- > len ∈ [0..1023] diff tests/value/oracle/return.res.oracle tests/value/oracle_apron/return.res.oracle 12c12,15 < [eva] tests/value/return.i:19: Reusing old results for call to f --- > [eva] computing for function f <- main. > Called from tests/value/return.i:19. > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/static.res.oracle tests/value/oracle_apron/static.res.oracle 22c22,25 < [eva] tests/value/static.i:20: Reusing old results for call to f --- > [eva] computing for function f <- main. > Called from tests/value/static.i:20. > [eva] Recording results for f > [eva] Done for function f diff tests/value/oracle/struct2.res.oracle tests/value/oracle_apron/struct2.res.oracle 81,84d80 < accessing out of bounds index. assert 0 ≤ (int)(i + j); < [eva:alarm] tests/value/struct2.i:185: Warning: < accessing out of bounds index. assert (int)(i + j) < 2; < [eva:alarm] tests/value/struct2.i:185: Warning: 106d101 < [scope:rm_asserts] removing 2 assertion(s) diff tests/value/oracle/test.0.res.oracle tests/value/oracle_apron/test.0.res.oracle 29c29 < j ∈ [-1073741822..1] --- > j ∈ {-1; 0; 1} diff tests/value/oracle/undefined_sequence.1.res.oracle tests/value/oracle_apron/undefined_sequence.1.res.oracle 33c33,36 < [eva] tests/value/undefined_sequence.i:54: Reusing old results for call to g --- > [eva] computing for function g <- main. > Called from tests/value/undefined_sequence.i:54. > [eva] Recording results for g > [eva] Done for function g diff tests/value/oracle/unroll.res.oracle tests/value/oracle_apron/unroll.res.oracle 13,14d12 < [eva:alarm] tests/value/unroll.i:34: Warning: < signed overflow. assert -2147483648 ≤ j - 1; 26c24 < j ∈ [-2147483648..-123] --- > j ∈ {-238} diff tests/value/oracle/unroll_simple.res.oracle tests/value/oracle_apron/unroll_simple.res.oracle 8,9d7 < [eva:alarm] tests/value/unroll_simple.i:11: Warning: < signed overflow. assert -2147483648 ≤ j - 1; 21c19 < j ∈ [-2147483648..-126] --- > j ∈ {-250} diff tests/value/oracle/widen_on_non_monotonic.res.oracle tests/value/oracle_apron/widen_on_non_monotonic.res.oracle 25a26 > [eva] tests/value/widen_on_non_monotonic.i:21: starting to merge loop iterations diff tests/value/oracle/with_comment.res.oracle tests/value/oracle_apron/with_comment.res.oracle 9,10d8 < [eva:alarm] tests/value/with_comment.i:21: Warning: < signed overflow. assert G + 1 ≤ 2147483647; frama-c-20.0-Calcium/tests/value/diff_bitwise0000666000000000000000000000422613571573400016056 0ustar diff tests/value/oracle/addition.res.oracle tests/value/oracle_bitwise/addition.res.oracle 90,92c90 < [eva] tests/value/addition.i:52: < Assigning imprecise value to p10. < The imprecision originates from Arithmetic {tests/value/addition.i:52} --- > [eva] tests/value/addition.i:52: Assigning imprecise value to p10. 128a127 > {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:52}) }} 130a130 > {{ garbled mix of &{p2} (origin: Misaligned {tests/value/addition.i:56}) }} 166,168c166 < p10 ∈ < {{ garbled mix of &{p1} < (origin: Arithmetic {tests/value/addition.i:52}) }} --- > p10 ∈ {{ garbled mix of &{p1} }} 358a357 > {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:52}) }} 397,399c396 < p10 ∈ < {{ garbled mix of &{p1} < (origin: Arithmetic {tests/value/addition.i:52}) }} --- > p10 ∈ {{ garbled mix of &{p1} }} diff tests/value/oracle/bitwise.res.oracle tests/value/oracle_bitwise/bitwise.res.oracle 79c79,82 < [eva] tests/value/bitwise.i:144: Frama_C_show_each_dead: {0} --- > [eva] tests/value/bitwise.i:142: > The evaluation of the expression x & 2 > led to bottom without alarms: > at this point the product of states has no possible concretization. diff tests/value/oracle/bitwise_pointer.res.oracle tests/value/oracle_bitwise/bitwise_pointer.res.oracle 32,34c32 < [eva] tests/value/bitwise_pointer.i:18: < Assigning imprecise value to p. < The imprecision originates from Arithmetic {tests/value/bitwise_pointer.i:18} --- > [eva] tests/value/bitwise_pointer.i:18: Assigning imprecise value to p. 37,39c35 < [eva] tests/value/bitwise_pointer.i:22: < Assigning imprecise value to p1. < The imprecision originates from Arithmetic {tests/value/bitwise_pointer.i:22} --- > [eva] tests/value/bitwise_pointer.i:22: Assigning imprecise value to p1. diff tests/value/oracle/logic_ptr_cast.res.oracle tests/value/oracle_bitwise/logic_ptr_cast.res.oracle 8,10c8 < [eva] tests/value/logic_ptr_cast.i:8: < Assigning imprecise value to p. < The imprecision originates from Arithmetic {tests/value/logic_ptr_cast.i:8} --- > [eva] tests/value/logic_ptr_cast.i:8: Assigning imprecise value to p. frama-c-20.0-Calcium/tests/value/diff_equalities0000666000000000000000000007467113571573400016570 0ustar diff tests/value/oracle/CruiseControl.res.oracle tests/value/oracle_equalities/CruiseControl.res.oracle 978c978 < [0]._C4_ThrottleCmd._I0_Regul_ON ∈ {0; 1} --- > [0]._C4_ThrottleCmd._I0_Regul_ON ∈ {1} 1016c1016 < [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ --- > [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn ∈ 1017a1018,1019 > [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O0_ThrottleOut ∈ > [-0.0000000000000000 .. 1.9999998807907104*2^127] 1031c1033 < [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] --- > [-0.0000000000000000 .. 1.9999998807907104*2^127] 1216c1218 < [0]._C4_ThrottleCmd._I0_Regul_ON ∈ {0; 1} --- > [0]._C4_ThrottleCmd._I0_Regul_ON ∈ {1} 1228c1230,1234 < [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl} ∈ --- > [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed} ∈ > [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] > [0]._C4_ThrottleCmd._C0_ThrottleRegulation._O0_Throttle ∈ > [-0.0000000000000000 .. 1.9999998807907104*2^127] > [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl} ∈ 1246c1252 < [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L4_CruiseControl; ._L13_CruiseControl} ∈ --- > [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L4_CruiseControl ∈ 1247a1254,1255 > [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L13_CruiseControl ∈ > [-0.0000000000000000 .. 1.9999998807907104*2^127] 1254c1262 < [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ --- > [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn ∈ 1255a1264,1265 > [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O0_ThrottleOut ∈ > [-0.0000000000000000 .. 1.9999998807907104*2^127] 1269c1279 < [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] --- > [-0.0000000000000000 .. 1.9999998807907104*2^127] diff tests/value/oracle/addition.res.oracle tests/value/oracle_equalities/addition.res.oracle 103,106d102 < [eva:alarm] tests/value/addition.i:61: Warning: < signed overflow. assert -2147483648 ≤ (int)*((char *)(&q1)) + 2; < [eva:alarm] tests/value/addition.i:61: Warning: < signed overflow. assert (int)*((char *)(&q1)) + 2 ≤ 2147483647; 133d128 < [scope:rm_asserts] removing 2 assertion(s) 337,340d331 < [eva:alarm] tests/value/addition.i:61: Warning: < signed overflow. assert -2147483648 ≤ (int)*((char *)(&q1)) + 2; < [eva:alarm] tests/value/addition.i:61: Warning: < signed overflow. assert (int)*((char *)(&q1)) + 2 ≤ 2147483647; 363d353 < [scope:rm_asserts] removing 2 assertion(s) diff tests/value/oracle/alias.0.res.oracle tests/value/oracle_equalities/alias.0.res.oracle 103,104c103,104 < t ∈ {1; 2; 4} < u ∈ {2; 3; 4; 5} --- > t ∈ {4} > u ∈ {5} 110c110 < t2 ∈ {0; 3; 6} --- > t2 ∈ {6} diff tests/value/oracle/alias.1.res.oracle tests/value/oracle_equalities/alias.1.res.oracle 85c85 < z ∈ {0; 1; 2} --- > z ∈ {0; 2} 87,88c87,88 < v2 ∈ {-1; 0; 1; 2; 3; 4} < PTR1 ∈ {{ &p2{[0], [1], [2]} }} --- > v2 ∈ {0; 1; 2} > PTR1 ∈ {{ &p2{[0], [1]} }} 90c90 < PTR3 ∈ {{ &p2{[1], [2], [4]} }} --- > PTR3 ∈ {{ &p2{[1], [2]} }} 110c110 < t2 FROM p2[0..2]; c --- > t2 FROM p2[0..1]; c diff tests/value/oracle/alias.2.res.oracle tests/value/oracle_equalities/alias.2.res.oracle 76c76 < z ∈ {-5; -4; -3; -2; -1; 0; 1; 1000} --- > z ∈ {-2; -1; 0; 1000} diff tests/value/oracle/alias.3.res.oracle tests/value/oracle_equalities/alias.3.res.oracle 67c67 < z ∈ {0; 1; 2} --- > z ∈ {0; 2} diff tests/value/oracle/alias.4.res.oracle tests/value/oracle_equalities/alias.4.res.oracle 81c81 < y ∈ {0; 3; 77} --- > y ∈ {77} diff tests/value/oracle/alias.5.res.oracle tests/value/oracle_equalities/alias.5.res.oracle 59a60 > [eva] tests/value/alias.i:260: starting to merge loop iterations 170c171 < y ∈ {0; 3; 77} --- > y ∈ {77} diff tests/value/oracle/alias.6.res.oracle tests/value/oracle_equalities/alias.6.res.oracle 86c86 < x ∈ {0; 4; 33} --- > x ∈ {33} diff tests/value/oracle/backward_add_ptr.res.oracle tests/value/oracle_equalities/backward_add_ptr.res.oracle 12c12 < Frama_C_show_each_only_a: {0; 1}, {{ &a }}, {0} --- > Frama_C_show_each_only_a: {0}, {{ &a }}, {0} 93c93,96 < [eva] tests/value/backward_add_ptr.c:110: Reusing old results for call to gm --- > [eva] computing for function gm <- main3 <- main. > Called from tests/value/backward_add_ptr.c:110. > [eva] Recording results for gm > [eva] Done for function gm 107c110,113 < [eva] tests/value/backward_add_ptr.c:125: Reusing old results for call to gm --- > [eva] computing for function gm <- main3 <- main. > Called from tests/value/backward_add_ptr.c:125. > [eva] Recording results for gm > [eva] Done for function gm 119c125 < (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, --- > (origin: Arithmetic Bottom) }}, 157,160c163,167 < {{ garbled mix of &{b} < (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, < [0..4294967295] < [eva] tests/value/backward_add_ptr.c:160: Reusing old results for call to gm --- > {{ garbled mix of &{b} (origin: Arithmetic Bottom) }}, [0..4294967295] > [eva] computing for function gm <- main4 <- main. > Called from tests/value/backward_add_ptr.c:160. > [eva] Recording results for gm > [eva] Done for function gm 178c185 < (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, --- > (origin: Arithmetic Bottom) }}, 180c187 < (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} --- > (origin: Arithmetic Bottom) }} 188c195 < (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} --- > (origin: Arithmetic Bottom) }} 194c201 < (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, --- > (origin: Arithmetic Bottom) }}, 211a219,222 > (origin: Arithmetic {tests/value/backward_add_ptr.c:33}) }} > {{ garbled mix of &{a} > (origin: Arithmetic {tests/value/backward_add_ptr.c:33}) }} > {{ garbled mix of &{b} 232a244,245 > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:106}) }} 234a248,251 > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:107}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:115}) }} 238c255,257 < (origin: Arithmetic {tests/value/backward_add_ptr.c:115}) }} --- > (origin: Arithmetic {tests/value/backward_add_ptr.c:116}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:121}) }} 240a260,263 > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:122}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:130}) }} 242a266,267 > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:136}) }} 245a271,272 > (origin: Arithmetic {tests/value/backward_add_ptr.c:137}) }} > {{ garbled mix of &{a; b} 246a274,275 > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:145}) }} 248a278,285 > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:150}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:151}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:156}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:157}) }} 250a288,311 > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:165}) }} > {{ garbled mix of &{b; c} > (origin: Arithmetic {tests/value/backward_add_ptr.c:165}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:166}) }} > {{ garbled mix of &{b; c} > (origin: Arithmetic {tests/value/backward_add_ptr.c:166}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:171}) }} > {{ garbled mix of &{b; c} > (origin: Arithmetic {tests/value/backward_add_ptr.c:171}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:172}) }} > {{ garbled mix of &{b; c} > (origin: Arithmetic {tests/value/backward_add_ptr.c:172}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:177}) }} > {{ garbled mix of &{b; c} > (origin: Arithmetic {tests/value/backward_add_ptr.c:177}) }} > {{ garbled mix of &{a; b} > (origin: Arithmetic {tests/value/backward_add_ptr.c:178}) }} > {{ garbled mix of &{b; c} > (origin: Arithmetic {tests/value/backward_add_ptr.c:178}) }} diff tests/value/oracle/bitfield.res.oracle tests/value/oracle_equalities/bitfield.res.oracle 132a133,135 > [eva] tests/value/bitfield.i:71: > Frama_C_show_each: > {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} diff tests/value/oracle/bitwise_pointer.res.oracle tests/value/oracle_equalities/bitwise_pointer.res.oracle 58c58 < x ∈ [0..9] --- > x ∈ {5} 71c71 < x1 ∈ [0..9] --- > x1 ∈ {5} diff tests/value/oracle/call_simple.res.oracle tests/value/oracle_equalities/call_simple.res.oracle 28c28 < c ∈ [--..--] --- > c ∈ [-2147483648..2147483646] diff tests/value/oracle/case_analysis.res.oracle tests/value/oracle_equalities/case_analysis.res.oracle 11a12,15 > [eva] tests/value/case_analysis.i:18: > The evaluation of the expression r * r > led to bottom without alarms: > at this point the product of states has no possible concretization. 18c22 < rq ∈ [-0.0000000000000000 .. 100.0000000000000000] --- > rq ∈ [0.0000000000000000 .. 100.0000000000000000] diff tests/value/oracle/descending.res.oracle tests/value/oracle_equalities/descending.res.oracle 42c42 < i ∈ {31; 32} --- > i ∈ {31} diff tests/value/oracle/downcast.res.oracle tests/value/oracle_equalities/downcast.res.oracle 735c735 < ux ∈ [--..--] --- > ux ∈ [0..65535] 778c778 < ux ∈ [--..--] --- > ux ∈ [0..65535] diff tests/value/oracle/fptr.1.res.oracle tests/value/oracle_equalities/fptr.1.res.oracle 55,57d54 < [eva] tests/value/fptr.i:67: < Frama_C_show_each_F: {{ NULL + [0..4294967295] ; &h ; &hh }} < [eva] tests/value/fptr.i:68: Reusing old results for call to f 69c66 < n ∈ {0; 1; 2} --- > n ∈ {0; 1} diff tests/value/oracle/from_call.0.res.oracle tests/value/oracle_equalities/from_call.0.res.oracle 64c64,69 < [eva] tests/value/from_call.i:20: Reusing old results for call to g --- > [eva] computing for function g <- f <- main. > Called from tests/value/from_call.i:20. > [eva] Recording results for g > [from] Computing for function g > [from] Done for function g > [eva] Done for function g 74c79,84 < [eva] tests/value/from_call.i:20: Reusing old results for call to g --- > [eva] computing for function g <- f <- main. > Called from tests/value/from_call.i:20. > [eva] Recording results for g > [from] Computing for function g > [from] Done for function g > [eva] Done for function g diff tests/value/oracle/from_call.1.res.oracle tests/value/oracle_equalities/from_call.1.res.oracle 60c60,63 < [eva] tests/value/from_call.i:20: Reusing old results for call to g --- > [eva] computing for function g <- f <- main. > Called from tests/value/from_call.i:20. > [eva] Recording results for g > [eva] Done for function g 68c71,74 < [eva] tests/value/from_call.i:20: Reusing old results for call to g --- > [eva] computing for function g <- f <- main. > Called from tests/value/from_call.i:20. > [eva] Recording results for g > [eva] Done for function g diff tests/value/oracle/from_termin.res.oracle tests/value/oracle_equalities/from_termin.res.oracle 9a10 > [eva] tests/value/from_termin.i:8: starting to merge loop iterations diff tests/value/oracle/imprecise_invalid_write.res.oracle tests/value/oracle_equalities/imprecise_invalid_write.res.oracle 27a28,29 > [kernel] tests/value/imprecise_invalid_write.i:9: > imprecise size for variable main1 (Undefined sizeof on a function.) diff tests/value/oracle/incompatible_states.res.oracle tests/value/oracle_equalities/incompatible_states.res.oracle 14a15,18 > [eva] tests/value/incompatible_states.c:24: > The evaluation of the expression x * x > led to bottom without alarms: > at this point the product of states has no possible concretization. 26,27c30,33 < [eva:alarm] tests/value/incompatible_states.c:41: Warning: < accessing uninitialized left-value. assert \initialized(&t[(2 * i) / 2]); --- > [eva] tests/value/incompatible_states.c:41: > The evaluation of the expression t[(2 * i) / 2] > led to bottom without alarms: > at this point the product of states has no possible concretization. 39,40d44 < [eva:alarm] tests/value/incompatible_states.c:53: Warning: < division by zero. assert t[i] ≢ 0; 45,47d48 < [eva] tests/value/incompatible_states.c:41: < assertion 'Eva,initialization' got final status invalid. < [scope:rm_asserts] removing 2 assertion(s) 53c54 < z ∈ [-3..100] --- > z ∈ {-3; -2} 56c57 < t[0] ∈ {0; 1} --- > t[0] ∈ {0} diff tests/value/oracle/library.res.oracle tests/value/oracle_equalities/library.res.oracle 129,132d128 < [eva:alarm] tests/value/library.i:44: Warning: < non-finite float value. assert \is_finite(*pf); < [eva:alarm] tests/value/library.i:44: Warning: < non-finite float value. assert \is_finite((float)(*pf + *pf)); diff tests/value/oracle/long_const.0.res.oracle tests/value/oracle_equalities/long_const.0.res.oracle 19c19,22 < [eva] tests/value/long_const.i:25: Reusing old results for call to LL_ABS --- > [eva] computing for function LL_ABS <- div64 <- main. > Called from tests/value/long_const.i:25. > [eva] Recording results for LL_ABS > [eva] Done for function LL_ABS diff tests/value/oracle/long_const.1.res.oracle tests/value/oracle_equalities/long_const.1.res.oracle 19c19,22 < [eva] tests/value/long_const.i:25: Reusing old results for call to LL_ABS --- > [eva] computing for function LL_ABS <- div64 <- main. > Called from tests/value/long_const.i:25. > [eva] Recording results for LL_ABS > [eva] Done for function LL_ABS diff tests/value/oracle/modulo.res.oracle tests/value/oracle_equalities/modulo.res.oracle 40a41,119 > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [-9..-1], [-8..0] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [1..9], [-8..0] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [-9..-1], [0..8] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [1..9], [0..8] > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [1..9], {1; 2; 3; 4; 5; 6; 7; 8}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [-9..-1], {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [1..9], {-8; -7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [-9..-1], {-8; -7; -6; -5; -4; -3; -2; -1}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {-7; -6; -5; -4; -3; -2; -1}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {1; 2; 3; 4; 5; 6; 7}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6; 7; 8}, {1; 2; 3; 4; 5; 6; 7}, {0; 1; 2; 3; 4; 5; 6} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6; 7}, {1; 2; 3; 4; 5; 6}, {0; 1; 2; 3; 4; 5} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-7; -6; -5; -4; -3; -2; -1}, {1; 2; 3; 4; 5; 6}, {-5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6; 7}, {-6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-7; -6; -5; -4; -3; -2; -1}, > {-6; -5; -4; -3; -2; -1}, > {-5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-6; -5; -4; -3; -2; -1}, {-5; -4; -3; -2; -1}, {-4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-6; -5; -4; -3; -2; -1}, {1; 2; 3; 4; 5}, {-4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6}, {-5; -4; -3; -2; -1}, {0; 1; 2; 3; 4} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4; 5; 6}, {1; 2; 3; 4; 5}, {0; 1; 2; 3; 4} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4; 5}, {1; 2; 3; 4}, {0; 1; 2; 3} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-5; -4; -3; -2; -1}, {1; 2; 3; 4}, {-3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4; 5}, {-4; -3; -2; -1}, {0; 1; 2; 3} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-5; -4; -3; -2; -1}, {-4; -3; -2; -1}, {-3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-4; -3; -2; -1}, {-3; -2; -1}, {-2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-4; -3; -2; -1}, {1; 2; 3}, {-2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4}, {-3; -2; -1}, {0; 1; 2} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4}, {1; 2; 3}, {0; 1; 2} > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {1; 2; 3}, {1; 2}, {0; 1} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-3; -2; -1}, {1; 2}, {-1; 0} > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {1; 2; 3}, {-2; -1}, {0; 1} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-3; -2; -1}, {-2; -1}, {-1; 0} 50a130,208 > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..-1], [1..9], [-8..0] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..-1], [-9..-1], [-8..0] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [1..10], [1..9], [0..8] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [1..10], [-9..-1], [0..8] > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [-9..-1], {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [1..9], {1; 2; 3; 4; 5; 6; 7; 8}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [-9..-1], {-8; -7; -6; -5; -4; -3; -2; -1}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [1..9], {-8; -7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {1; 2; 3; 4; 5; 6; 7}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {-7; -6; -5; -4; -3; -2; -1}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6; 7; 8}, {1; 2; 3; 4; 5; 6; 7}, {0; 1; 2; 3; 4; 5; 6} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-7; -6; -5; -4; -3; -2; -1}, {1; 2; 3; 4; 5; 6}, {-5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6; 7}, {1; 2; 3; 4; 5; 6}, {0; 1; 2; 3; 4; 5} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-7; -6; -5; -4; -3; -2; -1}, > {-6; -5; -4; -3; -2; -1}, > {-5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6; 7}, {-6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-6; -5; -4; -3; -2; -1}, {1; 2; 3; 4; 5}, {-4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-6; -5; -4; -3; -2; -1}, {-5; -4; -3; -2; -1}, {-4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4; 5; 6}, {1; 2; 3; 4; 5}, {0; 1; 2; 3; 4} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6}, {-5; -4; -3; -2; -1}, {0; 1; 2; 3; 4} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-5; -4; -3; -2; -1}, {1; 2; 3; 4}, {-3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4; 5}, {1; 2; 3; 4}, {0; 1; 2; 3} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-5; -4; -3; -2; -1}, {-4; -3; -2; -1}, {-3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4; 5}, {-4; -3; -2; -1}, {0; 1; 2; 3} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-4; -3; -2; -1}, {1; 2; 3}, {-2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-4; -3; -2; -1}, {-3; -2; -1}, {-2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4}, {1; 2; 3}, {0; 1; 2} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4}, {-3; -2; -1}, {0; 1; 2} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-3; -2; -1}, {1; 2}, {-1; 0} > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: {1; 2; 3}, {1; 2}, {0; 1} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-3; -2; -1}, {-2; -1}, {-1; 0} > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: {1; 2; 3}, {-2; -1}, {0; 1} 60a219,231 > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-10..10], [-9..9], [-8..8] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-9..9], [-8..8], [-7..7] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-8..8], [-7..7], [-6..6] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-7..7], [-6..6], [-5..5] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-6..6], [-5..5], [-4..4] > [eva] tests/value/modulo.i:64: > Frama_C_show_each_3: > [-5..5], {-4; -3; -2; -1; 1; 2; 3; 4}, {-3; -2; -1; 0; 1; 2; 3} > [eva] tests/value/modulo.i:64: > Frama_C_show_each_3: > {-4; -3; -2; -1; 1; 2; 3; 4}, {-3; -2; -1; 1; 2; 3}, {-2; -1; 0; 1; 2} > [eva] tests/value/modulo.i:64: > Frama_C_show_each_3: {-3; -2; -1; 1; 2; 3}, {-2; -1; 1; 2}, {-1; 0; 1} diff tests/value/oracle/non_natural.res.oracle tests/value/oracle_equalities/non_natural.res.oracle 58a59,60 > [kernel] tests/value/non_natural.i:30: > more than 200(12500) elements to enumerate. Approximating. 65a68,71 > [kernel] tests/value/non_natural.i:23: > more than 200(12500) elements to enumerate. Approximating. > [kernel] tests/value/non_natural.i:23: > more than 200(12501) elements to enumerate. Approximating. 70a77,80 > [kernel] tests/value/non_natural.i:24: > more than 200(12500) elements to enumerate. Approximating. > [kernel] tests/value/non_natural.i:24: > more than 200(12501) elements to enumerate. Approximating. 78a89,90 > [kernel] tests/value/non_natural.i:25: > more than 200(12500) elements to enumerate. Approximating. 86a99,100 > [kernel] tests/value/non_natural.i:26: > more than 200(12500) elements to enumerate. Approximating. 94a109,110 > [kernel] tests/value/non_natural.i:27: > more than 200(12500) elements to enumerate. Approximating. 102a119,120 > [kernel] tests/value/non_natural.i:28: > more than 200(12500) elements to enumerate. Approximating. 110a129,130 > [kernel] tests/value/non_natural.i:29: > more than 200(12500) elements to enumerate. Approximating. 127,146d146 < [kernel] tests/value/non_natural.i:23: < more than 200(12501) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:23: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:24: < more than 200(12501) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:24: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:25: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:26: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:27: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:28: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:29: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:30: < more than 200(12500) elements to enumerate. Approximating. 199a200,201 > [kernel] tests/value/non_natural.i:39: > more than 200(12500) elements to enumerate. Approximating. diff tests/value/oracle/nonlin.res.oracle tests/value/oracle_equalities/nonlin.res.oracle 159c159 < q ∈ {{ &x + [-400..400],0%4 }} --- > q ∈ {{ &x }} diff tests/value/oracle/octagons.res.oracle tests/value/oracle_equalities/octagons.res.oracle 29c29 < Frama_C_show_each_unreduced_unsigned: [0..4294967295], [0..4294967295] --- > Frama_C_show_each_unreduced_unsigned: [0..4294967295], [6..4294967295] 255c255 < t ∈ [--..--] or UNINITIALIZED --- > t ∈ [6..4294967295] or UNINITIALIZED diff tests/value/oracle/offsetmap.0.res.oracle tests/value/oracle_equalities/offsetmap.0.res.oracle 38d37 < [eva] Recording results for g 40a40 > [eva] Recording results for g diff tests/value/oracle/offsetmap.1.res.oracle tests/value/oracle_equalities/offsetmap.1.res.oracle 38d37 < [eva] Recording results for g 40a40 > [eva] Recording results for g diff tests/value/oracle/origin.0.res.oracle tests/value/oracle_equalities/origin.0.res.oracle 226,227c226 < pm2[bits 0 to 15]# ∈ {{ (? *)&a }}%32, bits 16 to 31 < [bits 16 to 31]# ∈ {{ (? *)&b }}%32, bits 0 to 15 --- > pm2 ∈ {{ &a + {-4} ; &b + {-4} }} 266,267c265 < pm2[bits 0 to 15]# ∈ {{ (? *)&a }}%32, bits 16 to 31 < [bits 16 to 31]# ∈ {{ (? *)&b }}%32, bits 0 to 15 --- > pm2 ∈ {{ &a + {-4} ; &b + {-4} }} diff tests/value/oracle/period.res.oracle tests/value/oracle_equalities/period.res.oracle 86,90d85 < [eva] tests/value/period.c:53: < Assigning imprecise value to p. < The imprecision originates from Arithmetic {tests/value/period.c:53} < [eva:alarm] tests/value/period.c:54: Warning: < out of bounds read. assert \valid_read(p); diff tests/value/oracle/plevel.res.oracle tests/value/oracle_equalities/plevel.res.oracle 12d11 < [eva] Recording results for main 14a14 > [eva] Recording results for main diff tests/value/oracle/pointer_comp.res.oracle tests/value/oracle_equalities/pointer_comp.res.oracle 30a31,34 > [kernel] tests/value/pointer_comp.c:43: > imprecise size for variable g (Undefined sizeof on a function.) > [kernel] tests/value/pointer_comp.c:43: > imprecise size for variable f (Undefined sizeof on a function.) diff tests/value/oracle/ptr_relation.0.res.oracle tests/value/oracle_equalities/ptr_relation.0.res.oracle 23c23 < i ∈ {0; 77; 333} --- > i ∈ {77} diff tests/value/oracle/redundant_alarms.res.oracle tests/value/oracle_equalities/redundant_alarms.res.oracle 10,13d9 < [eva:alarm] tests/value/redundant_alarms.c:11: Warning: < accessing uninitialized left-value. assert \initialized(p); < [eva:alarm] tests/value/redundant_alarms.c:12: Warning: < accessing uninitialized left-value. assert \initialized(p); 24,25d19 < [eva:alarm] tests/value/redundant_alarms.c:21: Warning: < accessing uninitialized left-value. assert \initialized(&t[i]); 63,65c57 < [scope:rm_asserts] removing 3 assertion(s) < [scope:rm_asserts] tests/value/redundant_alarms.c:12: < removing redundant assert Eva: initialization: \initialized(p); --- > [scope:rm_asserts] removing 2 assertion(s) 108d99 < /*@ assert Eva: initialization: \initialized(p); */ 110d100 < /*@ assert Eva: initialization: \initialized(p); */ 127d116 < /*@ assert Eva: initialization: \initialized(&t[i]); */ 196a186 > int z; 199,201d188 < *p = 1; < int z = *p + 1; < int w = *p + 2; diff tests/value/oracle/relation_reduction.res.oracle tests/value/oracle_equalities/relation_reduction.res.oracle 24,27d23 < [eva:alarm] tests/value/relation_reduction.i:20: Warning: < accessing out of bounds index. assert 0 ≤ y; < [eva:alarm] tests/value/relation_reduction.i:20: Warning: < accessing out of bounds index. assert y < 9; 34,37c30,33 < R1 ∈ [-2147483648..2147483637] < R2 ∈ [-2147483638..2147483647] < R3 ∈ [--..--] < R4 ∈ {0; 1; 2; 3; 4; 5} --- > R1 ∈ {0; 2} > R2 ∈ {0; 12} > R3 ∈ {0; 7} > R4 ∈ {0; 2} 48c44 < R4 FROM tab[0..8]; x (and SELF) --- > R4 FROM tab[0..5]; x (and SELF) 53c49 < y; t; tab[0..8] --- > y; t; tab[0..5] diff tests/value/oracle/relation_shift.res.oracle tests/value/oracle_equalities/relation_shift.res.oracle 35,36c35,36 < x ∈ [-2147483647..2147483647] < y ∈ [-2147483648..2147483646] --- > x ∈ [-2147483647..2147483642] > y ∈ [-2147483648..2147483645] 53,54c53,54 < x ∈ [-2147483647..2147483647] < y ∈ [-2147483648..2147483646] --- > x ∈ [-2147483647..2147483642] > y ∈ [-2147483648..2147483645] diff tests/value/oracle/relations.res.oracle tests/value/oracle_equalities/relations.res.oracle 60,61c60 < u[0] ∈ [-2147483648..2147483646] < [1] ∈ [--..--] --- > u[0..1] ∈ [-2147483648..2147483646] 67,70c66,69 < R1 ∈ [--..--] < R2 ∈ [--..--] < R3 ∈ [-2147483648..2147483646] < R4 ∈ [--..--] --- > R1 ∈ {0; 3} > R2 ∈ {0; 3} > R3 ∈ {0; 2} > R4 ∈ {0; 2} diff tests/value/oracle/relations2.res.oracle tests/value/oracle_equalities/relations2.res.oracle 59c59 < n ∈ [0..512] --- > n ∈ [1..512] 133d132 < [eva] tests/value/relations2.i:57: Frama_C_show_each_NO2: diff tests/value/oracle/struct2.res.oracle tests/value/oracle_equalities/struct2.res.oracle 55a56,57 > [kernel] tests/value/struct2.i:78: Warning: > all target addresses were invalid. This path is assumed to be dead. 59,60d60 < accessing out of bounds index. assert 0 ≤ (int)(tab2[i] + j); < [eva:alarm] tests/value/struct2.i:82: Warning: 83,84d82 < accessing out of bounds index. assert (int)(i + j) < 2; < [eva:alarm] tests/value/struct2.i:185: Warning: 106c104 < [scope:rm_asserts] removing 2 assertion(s) --- > [scope:rm_asserts] removing 1 assertion(s) 143,145c141,143 < tab3[0..1] ∈ [--..--] < tab4[0] ∈ {0; 2} < [1] ∈ {0} --- > tab3[0] ∈ {0; 1} > [1] ∈ [--..--] > tab4[0..1] ∈ {0} 148c146,147 < tab6[0..1] ∈ {0; 2} --- > tab6[0] ∈ {0} > [1] ∈ {2} 219c218 < [9].a}; s1; s2; s5.e[0].b; s6.b; s8; tabl[0..1]; tab1[0..1]; --- > [9].a}; s1; s2; s5.e[0].b; s6.b; s8; tabl[0..1]; tab1[0]; frama-c-20.0-Calcium/tests/value/diff_gauges0000666000000000000000000011762313571573400015671 0ustar diff tests/value/oracle/alias.5.res.oracle tests/value/oracle_gauges/alias.5.res.oracle 59a60 > [eva] tests/value/alias.i:260: starting to merge loop iterations diff tests/value/oracle/bad_loop.res.oracle tests/value/oracle_gauges/bad_loop.res.oracle 6a7 > [eva] tests/value/bad_loop.i:12: starting to merge loop iterations diff tests/value/oracle/bitfield.res.oracle tests/value/oracle_gauges/bitfield.res.oracle 132a133,147 > [eva] tests/value/bitfield.i:71: > Frama_C_show_each: > {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} > [eva] tests/value/bitfield.i:73: > Frama_C_show_each: > {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} > [eva] computing for function leaf <- imprecise_bts_1671 <- main. > Called from tests/value/bitfield.i:70. > [eva] Done for function leaf > [eva] tests/value/bitfield.i:71: > Frama_C_show_each: > {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} > [eva] tests/value/bitfield.i:73: > Frama_C_show_each: > {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} diff tests/value/oracle/cast2.res.oracle tests/value/oracle_gauges/cast2.res.oracle 26a27 > [eva] tests/value/cast2.i:24: starting to merge loop iterations diff tests/value/oracle/for_loops.1.res.oracle tests/value/oracle_gauges/for_loops.1.res.oracle 39,41c39 < [eva:alarm] tests/value/for_loops.c:16: Warning: < signed overflow. assert w + 1 ≤ 2147483647; < [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: [0..2147483647] --- > [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: [0..100] diff tests/value/oracle/for_loops.2.res.oracle tests/value/oracle_gauges/for_loops.2.res.oracle 37,39c37 < [eva:alarm] tests/value/for_loops.c:42: Warning: < signed overflow. assert w + T[j] ≤ 2147483647; < [eva] tests/value/for_loops.c:43: Frama_C_show_each: [0..2147483647] --- > [eva] tests/value/for_loops.c:43: Frama_C_show_each: [0..1000] diff tests/value/oracle/from_termin.res.oracle tests/value/oracle_gauges/from_termin.res.oracle 9a10 > [eva] tests/value/from_termin.i:8: starting to merge loop iterations diff tests/value/oracle/gauges.res.oracle tests/value/oracle_gauges/gauges.res.oracle 25,26d24 < [eva:alarm] tests/value/gauges.c:23: Warning: < signed overflow. assert -2147483648 ≤ j - 4; 38,39d35 < [eva:alarm] tests/value/gauges.c:26: Warning: < signed overflow. assert l + 1 ≤ 2147483647; 57,58d52 < [eva:alarm] tests/value/gauges.c:45: Warning: < signed overflow. assert -2147483648 ≤ j - 4; 61a56,57 > [eva:alarm] tests/value/gauges.c:45: Warning: > signed overflow. assert -2147483648 ≤ j - 4; 70,71d65 < [eva:alarm] tests/value/gauges.c:48: Warning: < signed overflow. assert l + 1 ≤ 2147483647; 83,84d76 < [eva:alarm] tests/value/gauges.c:58: Warning: < accessing out of bounds index. assert j < 38; 97,101d88 < [eva:alarm] tests/value/gauges.c:71: Warning: < out of bounds write. assert \valid(tmp); < (tmp from p++) < [eva] tests/value/gauges.c:72: Frama_C_show_each: < [eva] tests/value/gauges.c:72: Frama_C_show_each: 113,114d99 < [eva:alarm] tests/value/gauges.c:81: Warning: < signed overflow. assert k + 1 ≤ 2147483647; 116,117d100 < [eva:alarm] tests/value/gauges.c:84: Warning: < signed overflow. assert k + 1 ≤ 2147483647; 125c108 < [eva] tests/value/gauges.c:86: Frama_C_show_each: [0..2147483647] --- > [eva] tests/value/gauges.c:86: Frama_C_show_each: {390} 139,140d121 < [eva:alarm] tests/value/gauges.c:99: Warning: < signed overflow. assert c + 1 ≤ 2147483647; 178,181c159,162 < [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y + [4..36],0%4 }} < [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y + [4..40],0%4 }} < [eva:alarm] tests/value/gauges.c:130: Warning: < out of bounds write. assert \valid(p); --- > [eva] tests/value/gauges.c:129: > Frama_C_show_each: {{ &y + {4; 8; 12; 16; 20; 24} }} > [eva] tests/value/gauges.c:129: > Frama_C_show_each: {{ &y + {4; 8; 12; 16; 20; 24} }} 187,188d167 < [eva:alarm] tests/value/gauges.c:140: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 206,208d184 < [eva:alarm] tests/value/gauges.c:158: Warning: < out of bounds write. assert \valid(tmp); < (tmp from p--) 227,231c203,205 < [eva] tests/value/gauges.c:172: Frama_C_show_each: [2147483646..4294967294] < [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] < [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] < [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] < [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] --- > [eva] tests/value/gauges.c:172: Frama_C_show_each: [2147483647..4294967294] > [eva] tests/value/gauges.c:172: Frama_C_show_each: [2147483647..4294967294] > [eva] tests/value/gauges.c:172: Frama_C_show_each: [2147483647..4294967294] 235c209,210 < [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] --- > [eva] tests/value/gauges.c:172: Frama_C_show_each: [2147483647..4294967294] > [eva] tests/value/gauges.c:172: Frama_C_show_each: [2147483647..4294967294] 255,258d229 < [eva:alarm] tests/value/gauges.c:192: Warning: < out of bounds write. assert \valid(p); < [eva:alarm] tests/value/gauges.c:193: Warning: < out of bounds write. assert \valid(q); 266,271d236 < [eva:alarm] tests/value/gauges.c:202: Warning: < out of bounds read. assert \valid_read(tmp); < (tmp from A++) < [eva:alarm] tests/value/gauges.c:202: Warning: < out of bounds read. assert \valid_read(tmp_0); < (tmp_0 from B++) 299,300d263 < [eva:alarm] tests/value/gauges.c:220: Warning: < signed overflow. assert -2147483648 ≤ n - 1; 315,318c278 < [eva:alarm] tests/value/gauges.c:240: Warning: < signed overflow. assert j + 1 ≤ 2147483647; < [eva] tests/value/gauges.c:242: < Frama_C_show_each: {45; 46; 47; 48; 49; 50; 51}, [0..2147483647] --- > [eva] tests/value/gauges.c:242: Frama_C_show_each: {47; 48}, {6} 324,325d283 < [eva:alarm] tests/value/gauges.c:251: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 327c285 < Frama_C_show_each: {48; 49; 50; 51; 52; 53; 54}, [0..2147483647] --- > Frama_C_show_each: {48; 49; 50; 51; 52; 53; 54}, {6; 7} 333,336c291 < [eva:alarm] tests/value/gauges.c:263: Warning: < signed overflow. assert j + 1 ≤ 2147483647; < [eva] tests/value/gauges.c:265: < Frama_C_show_each: {-59; -58; -57; -56; -55; -54; -53}, [0..2147483647] --- > [eva] tests/value/gauges.c:265: Frama_C_show_each: {-58; -57}, {9} 342,343d296 < [eva:alarm] tests/value/gauges.c:274: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 345c298 < Frama_C_show_each: {-64; -63; -62; -61; -60; -59; -58}, [0..2147483647] --- > Frama_C_show_each: {-64; -63; -62; -61; -60; -59; -58}, {9; 10} 353,354d305 < [eva:alarm] tests/value/gauges.c:293: Warning: < signed overflow. assert j + 1 ≤ 2147483647; 356c307 < Frama_C_show_each: {-593; -592; -591; -590; -589; -588}, [0..2147483647] --- > Frama_C_show_each: {-593; -592; -591; -590; -589; -588}, [99..119] 418a370,373 > # Gauges domain: > V: [{[ p -> {{ &x }} > i -> {1} ]}] > s398: λ(0) 478a434,437 > # Gauges domain: > V: [{[ i -> {1} ]}] > s398: λ([0 .. 1]) > {[ i -> {1} ]} 537a497,500 > # Gauges domain: > V: [{[ i -> {1} ]}] > s398: λ([0 .. 2]) > {[ i -> {1} ]} 596a560,563 > # Gauges domain: > V: [{[ i -> {1} ]}] > s398: λ([0 .. 10]) > {[ i -> {1} ]} 661a629,633 > # Gauges domain: > V: [{[ p -> {{ &a }} > i -> {2} ]}] > s412: λ(0) > s411: λ(0) 722a695,699 > # Gauges domain: > V: [{[ i -> {2} ]}] > s412: λ(0) > s411: λ([0 .. 1]) > {[ i -> {0} ]} 724a702,829 > [eva] tests/value/gauges.c:325: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > v ∈ [--..--] > t[0..4] ∈ {0} > [5] ∈ [0..48],0%3 > [6] ∈ {0} > [7] ∈ [0..48],0%3 > [8] ∈ {0} > [9] ∈ [0..48],0%3 > [10] ∈ {0} > [11] ∈ [0..48],0%3 > [12] ∈ {0} > [13] ∈ [0..48],0%3 > [14] ∈ {0} > [15] ∈ [0..48],0%3 > [16] ∈ {0} > [17] ∈ [0..48],0%3 > [18] ∈ {0} > [19] ∈ [0..48],0%3 > [20] ∈ {0} > [21] ∈ [0..48],0%3 > [22] ∈ {0} > [23] ∈ [0..48],0%3 > [24] ∈ {0} > [25] ∈ [0..48],0%3 > [26] ∈ {0} > [27] ∈ [0..48],0%3 > [28] ∈ {0} > [29] ∈ [0..48],0%3 > [30] ∈ {0} > [31] ∈ [0..48],0%3 > [32] ∈ {0} > [33] ∈ [0..48],0%3 > [34] ∈ {0} > [35] ∈ [0..48],0%3 > [36] ∈ {0} > [37] ∈ [0..48],0%3 > u[0..99] ∈ [0..100] > T[0..99] ∈ [--..--] > a ∈ {1} > b ∈ {0} > p ∈ {{ &a ; &b }} > i ∈ {2} > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > # Gauges domain: > V: [{[ i -> {2} ]}] > s412: λ(0) > s411: λ([0 .. 2]) > {[ i -> {0} ]} > ==END OF DUMP== > [eva] tests/value/gauges.c:325: > Frama_C_dump_each: > # Cvalue domain: > __fc_heap_status ∈ [--..--] > __fc_random_counter ∈ [--..--] > __fc_rand_max ∈ {32767} > __fc_random48_init ∈ {0} > __fc_random48_counter[0..2] ∈ [--..--] > __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} > __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} > [1] ∈ {{ NULL ; &S_1___fc_env[0] }} > [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} > __fc_mblen_state ∈ [--..--] > __fc_mbtowc_state ∈ [--..--] > __fc_wctomb_state ∈ [--..--] > v ∈ [--..--] > t[0..4] ∈ {0} > [5] ∈ [0..48],0%3 > [6] ∈ {0} > [7] ∈ [0..48],0%3 > [8] ∈ {0} > [9] ∈ [0..48],0%3 > [10] ∈ {0} > [11] ∈ [0..48],0%3 > [12] ∈ {0} > [13] ∈ [0..48],0%3 > [14] ∈ {0} > [15] ∈ [0..48],0%3 > [16] ∈ {0} > [17] ∈ [0..48],0%3 > [18] ∈ {0} > [19] ∈ [0..48],0%3 > [20] ∈ {0} > [21] ∈ [0..48],0%3 > [22] ∈ {0} > [23] ∈ [0..48],0%3 > [24] ∈ {0} > [25] ∈ [0..48],0%3 > [26] ∈ {0} > [27] ∈ [0..48],0%3 > [28] ∈ {0} > [29] ∈ [0..48],0%3 > [30] ∈ {0} > [31] ∈ [0..48],0%3 > [32] ∈ {0} > [33] ∈ [0..48],0%3 > [34] ∈ {0} > [35] ∈ [0..48],0%3 > [36] ∈ {0} > [37] ∈ [0..48],0%3 > u[0..99] ∈ [0..100] > T[0..99] ∈ [--..--] > a ∈ {1} > b ∈ {0} > p ∈ {{ &a ; &b }} > i ∈ {2} > S_0___fc_env[0..1] ∈ [--..--] > S_1___fc_env[0..1] ∈ [--..--] > # Gauges domain: > V: [{[ i -> {2} ]}] > s412: λ(0) > s411: λ([0 .. +oo]) > {[ i -> {0} ]} > ==END OF DUMP== 732a838,839 > [eva] tests/value/gauges.c:343: Call to builtin malloc > [eva] tests/value/gauges.c:343: Call to builtin malloc 785,786c892,893 < A ∈ {{ &A + [0..--],0%4 }} < B ∈ {{ &B + [0..--],0%4 }} --- > A ∈ {{ &A + [0..36],0%4 }} > B ∈ {{ &B + [0..36],0%4 }} 798c905 < n ∈ [-2147483648..99] --- > n ∈ [-2147483547..99] 804c911 < i ∈ {45; 46; 47; 48; 49; 50; 51} --- > i ∈ {45; 46; 47; 48} 810c917 < i ∈ {-59; -58; -57; -56; -55; -54; -53} --- > i ∈ {-58; -57; -56; -55; -54; -53} 830c937 < p ∈ {{ &u + [0..--],0%4 }} --- > p ∈ {{ &u + [0..400],0%4 }} 832c939 < k ∈ [0..2147483647] --- > k ∈ [0..390] 837c944 < i ∈ [0..2147483647] --- > i ∈ [0..21] 848,849c955,957 < [1..9] ∈ {4; 5; 6; 7; 8; 9} or UNINITIALIZED < p ∈ {{ &y + [4..40],0%4 }} --- > [1..6] ∈ {4; 5; 6; 7; 8; 9} or UNINITIALIZED > [7..9] ∈ UNINITIALIZED > p ∈ {{ &y[7] }} 860c968 < p ∈ {{ &T + [--..396],0%4 }} --- > p ∈ {{ &T + [-4..396],0%4 }} 865,869c973 < n ∈ {0} < arr[0] ∈ {0} < [1] ∈ {-1} < [2..65535] ∈ [--..--] or UNINITIALIZED < p ∈ {{ &arr + [12..--],0%4 }} --- > NON TERMINATING FUNCTION 972a1077 > [from] Non-terminating function main8_aux (no dependencies) 995,996c1100,1101 < p FROM p; A; B; n; p; A[0..9]; B[0..9] (and SELF) < \result FROM p; A; B; n; p; A[0..9]; B[0..9] --- > p FROM p; A; B; n; p; A[0..8]; B[0..8] (and SELF) > \result FROM p; A; B; n; p; A[0..8]; B[0..8] 1040c1145 < NO EFFECTS --- > NON TERMINATING - NO EFFECTS 1074c1179 < p; A[0..9]; B[0..9] --- > p; A[0..8]; B[0..8] diff tests/value/oracle/hierarchical_convergence.res.oracle tests/value/oracle_gauges/hierarchical_convergence.res.oracle 15a16 > [eva] tests/value/hierarchical_convergence.c:10: Frama_C_show_each: {1}, {0} diff tests/value/oracle/infinite.res.oracle tests/value/oracle_gauges/infinite.res.oracle 12a13,22 > [eva] tests/value/infinite.i:6: starting to merge loop iterations > [eva] computing for function pause <- main. > Called from tests/value/infinite.i:9. > [eva] Done for function pause > [eva] computing for function pause <- main. > Called from tests/value/infinite.i:9. > [eva] Done for function pause > [eva] computing for function pause <- main. > Called from tests/value/infinite.i:9. > [eva] Done for function pause diff tests/value/oracle/inout.2.res.oracle tests/value/oracle_gauges/inout.2.res.oracle 22a23 > [eva] tests/value/inout.i:50: starting to merge loop iterations diff tests/value/oracle/inout.3.res.oracle tests/value/oracle_gauges/inout.3.res.oracle 22a23 > [eva] tests/value/inout.i:60: starting to merge loop iterations diff tests/value/oracle/inout.4.res.oracle tests/value/oracle_gauges/inout.4.res.oracle 24a25 > [eva] tests/value/inout.i:60: starting to merge loop iterations diff tests/value/oracle/local_slevel.res.oracle tests/value/oracle_gauges/local_slevel.res.oracle 13,15c13,15 < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1} < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0; 1} < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1; 2} --- > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {1} > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0} > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {1} 18c18 < Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3} --- > Frama_C_show_each: {1}, [1..79],1%2, {1; 2; 3} 22c22 < Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3; 4} --- > Frama_C_show_each: {1}, [1..79],1%2, {1; 2; 3; 4} 26,34c26 < Frama_C_show_each: {1}, [1..79],1%2, [0..2147483647] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483647] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {1}, [1..79],1%2, [0..2147483648] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483648] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {1}, [1..79],1%2, [0..4294967295] --- > Frama_C_show_each: {1}, [1..79],1%2, [1..79] 36c28 < Frama_C_show_each: {-1}, [0..78],0%2, [0..4294967295] --- > Frama_C_show_each: {-1}, [0..78],0%2, [0..78] 152c144 < r ∈ [--..--] --- > r ∈ [0..2147483647] 393,395c385,387 < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1} < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0; 1} < [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1; 2} --- > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {1} > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0} > [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {1} 398c390 < Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3} --- > Frama_C_show_each: {1}, [1..79],1%2, {1; 2; 3} 402c394 < Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3; 4} --- > Frama_C_show_each: {1}, [1..79],1%2, {1; 2; 3; 4} 406,414c398 < Frama_C_show_each: {1}, [1..79],1%2, [0..2147483647] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483647] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {1}, [1..79],1%2, [0..2147483648] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483648] < [eva] tests/value/local_slevel.i:18: < Frama_C_show_each: {1}, [1..79],1%2, [0..4294967295] --- > Frama_C_show_each: {1}, [1..79],1%2, [1..79] 416c400 < Frama_C_show_each: {-1}, [0..78],0%2, [0..4294967295] --- > Frama_C_show_each: {-1}, [0..78],0%2, [0..78] 532c516 < r ∈ [--..--] --- > r ∈ [0..2147483647] diff tests/value/oracle/loop_no_var.res.oracle tests/value/oracle_gauges/loop_no_var.res.oracle 6a7 > [eva] tests/value/loop_no_var.i:3: starting to merge loop iterations diff tests/value/oracle/loop_wvar.1.res.oracle tests/value/oracle_gauges/loop_wvar.1.res.oracle 27,28c27 < [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], [0..17], [0..11] < [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], [0..18], [0..12] --- > [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], [0..9], [0..9] 37,38c36,37 < j ∈ [0..18] < k ∈ [0..12] --- > j ∈ [0..17] > k ∈ [0..11] diff tests/value/oracle/loopfun.1.res.oracle tests/value/oracle_gauges/loopfun.1.res.oracle 9a10,12 > [eva] tests/value/loopfun.i:23: starting to merge loop iterations > [eva:loop-unroll] tests/value/loopfun.i:25: loop not completely unrolled > [eva] tests/value/loopfun.i:25: starting to merge loop iterations 11a15 > [eva] tests/value/loopfun.i:26: starting to merge loop iterations 13a18 > [eva] tests/value/loopfun.i:27: starting to merge loop iterations diff tests/value/oracle/memexec.res.oracle tests/value/oracle_gauges/memexec.res.oracle 99a100 > [eva] tests/value/memexec.c:98: starting to merge loop iterations diff tests/value/oracle/modulo.res.oracle tests/value/oracle_gauges/modulo.res.oracle 40a41,123 > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [-9..-1], [-8..0] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [1..9], [-8..0] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [-9..-1], [0..8] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [1..9], [0..8] > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [1..9], {1; 2; 3; 4; 5; 6; 7; 8}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [-9..-1], {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [1..9], {-8; -7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [-9..-1], {-8; -7; -6; -5; -4; -3; -2; -1}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {-7; -6; -5; -4; -3; -2; -1}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {1; 2; 3; 4; 5; 6; 7}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6; 7; 8}, {1; 2; 3; 4; 5; 6; 7}, {0; 1; 2; 3; 4; 5; 6} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6; 7}, {1; 2; 3; 4; 5; 6}, {0; 1; 2; 3; 4; 5} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-7; -6; -5; -4; -3; -2; -1}, {1; 2; 3; 4; 5; 6}, {-5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6; 7}, {-6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-7; -6; -5; -4; -3; -2; -1}, > {-6; -5; -4; -3; -2; -1}, > {-5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-6; -5; -4; -3; -2; -1}, {-5; -4; -3; -2; -1}, {-4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {-6; -5; -4; -3; -2; -1}, {1; 2; 3; 4; 5}, {-4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > {1; 2; 3; 4; 5; 6}, {-5; -4; -3; -2; -1}, {0; 1; 2; 3; 4} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4; 5; 6}, {1; 2; 3; 4; 5}, {0; 1; 2; 3; 4} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4; 5}, {1; 2; 3; 4}, {0; 1; 2; 3} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-5; -4; -3; -2; -1}, {1; 2; 3; 4}, {-3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4; 5}, {-4; -3; -2; -1}, {0; 1; 2; 3} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-5; -4; -3; -2; -1}, {-4; -3; -2; -1}, {-3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-4; -3; -2; -1}, {-3; -2; -1}, {-2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-4; -3; -2; -1}, {1; 2; 3}, {-2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4}, {-3; -2; -1}, {0; 1; 2} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {1; 2; 3; 4}, {1; 2; 3}, {0; 1; 2} > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {1; 2; 3}, {1; 2}, {0; 1} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-3; -2; -1}, {1; 2}, {-1; 0} > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {1; 2; 3}, {-2; -1}, {0; 1} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: {-3; -2; -1}, {-2; -1}, {-1; 0} > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {-2; -1}, {-1}, {0} > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {-2; -1}, {1}, {0} > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {1; 2}, {-1}, {0} > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {1; 2}, {1}, {0} 50a134,216 > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..-1], [1..9], [-8..0] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..-1], [-9..-1], [-8..0] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [1..10], [1..9], [0..8] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [1..10], [-9..-1], [0..8] > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [-9..-1], {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [1..9], {1; 2; 3; 4; 5; 6; 7; 8}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [-9..-1], {-8; -7; -6; -5; -4; -3; -2; -1}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [1..9], {-8; -7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {1; 2; 3; 4; 5; 6; 7}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-8; -7; -6; -5; -4; -3; -2; -1}, > {-7; -6; -5; -4; -3; -2; -1}, > {-6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6; 7; 8}, {1; 2; 3; 4; 5; 6; 7}, {0; 1; 2; 3; 4; 5; 6} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-7; -6; -5; -4; -3; -2; -1}, {1; 2; 3; 4; 5; 6}, {-5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6; 7}, {1; 2; 3; 4; 5; 6}, {0; 1; 2; 3; 4; 5} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-7; -6; -5; -4; -3; -2; -1}, > {-6; -5; -4; -3; -2; -1}, > {-5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6; 7}, {-6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-6; -5; -4; -3; -2; -1}, {1; 2; 3; 4; 5}, {-4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {-6; -5; -4; -3; -2; -1}, {-5; -4; -3; -2; -1}, {-4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4; 5; 6}, {1; 2; 3; 4; 5}, {0; 1; 2; 3; 4} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > {1; 2; 3; 4; 5; 6}, {-5; -4; -3; -2; -1}, {0; 1; 2; 3; 4} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-5; -4; -3; -2; -1}, {1; 2; 3; 4}, {-3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4; 5}, {1; 2; 3; 4}, {0; 1; 2; 3} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-5; -4; -3; -2; -1}, {-4; -3; -2; -1}, {-3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4; 5}, {-4; -3; -2; -1}, {0; 1; 2; 3} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-4; -3; -2; -1}, {1; 2; 3}, {-2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-4; -3; -2; -1}, {-3; -2; -1}, {-2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4}, {1; 2; 3}, {0; 1; 2} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {1; 2; 3; 4}, {-3; -2; -1}, {0; 1; 2} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-3; -2; -1}, {1; 2}, {-1; 0} > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: {1; 2; 3}, {1; 2}, {0; 1} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: {-3; -2; -1}, {-2; -1}, {-1; 0} > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: {1; 2; 3}, {-2; -1}, {0; 1} > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: {-2; -1}, {1}, {0} > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: {-2; -1}, {-1}, {0} > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: {1; 2}, {1}, {0} > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: {1; 2}, {-1}, {0} 60a227,240 > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-10..10], [-9..9], [-8..8] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-9..9], [-8..8], [-7..7] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-8..8], [-7..7], [-6..6] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-7..7], [-6..6], [-5..5] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-6..6], [-5..5], [-4..4] > [eva] tests/value/modulo.i:64: > Frama_C_show_each_3: > [-5..5], {-4; -3; -2; -1; 1; 2; 3; 4}, {-3; -2; -1; 0; 1; 2; 3} > [eva] tests/value/modulo.i:64: > Frama_C_show_each_3: > {-4; -3; -2; -1; 1; 2; 3; 4}, {-3; -2; -1; 1; 2; 3}, {-2; -1; 0; 1; 2} > [eva] tests/value/modulo.i:64: > Frama_C_show_each_3: {-3; -2; -1; 1; 2; 3}, {-2; -1; 1; 2}, {-1; 0; 1} > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: {-2; -1; 1; 2}, {-1; 1}, {0} 81a262,263 > [eva] tests/value/modulo.i:95: starting to merge loop iterations > [eva] tests/value/modulo.i:82: starting to merge loop iterations diff tests/value/oracle/non_natural.res.oracle tests/value/oracle_gauges/non_natural.res.oracle 60,63c60 < Frama_C_show_each: {{ &p2 + [0..400000],0%32 }} < [eva:alarm] tests/value/non_natural.i:23: Warning: < out of bounds write. assert \valid(tmp); < (tmp from to++) --- > Frama_C_show_each: {{ &p2 + [0..399968],0%32 }} 66,68d62 < [eva:alarm] tests/value/non_natural.i:24: Warning: < out of bounds write. assert \valid(tmp_1); < (tmp_1 from to++) 71,76d64 < [eva:alarm] tests/value/non_natural.i:25: Warning: < out of bounds write. assert \valid(tmp_3); < (tmp_3 from to++) < [eva:alarm] tests/value/non_natural.i:25: Warning: < out of bounds read. assert \valid_read(tmp_4); < (tmp_4 from from++) 79,84d66 < [eva:alarm] tests/value/non_natural.i:26: Warning: < out of bounds write. assert \valid(tmp_5); < (tmp_5 from to++) < [eva:alarm] tests/value/non_natural.i:26: Warning: < out of bounds read. assert \valid_read(tmp_6); < (tmp_6 from from++) 87,92d68 < [eva:alarm] tests/value/non_natural.i:27: Warning: < out of bounds write. assert \valid(tmp_7); < (tmp_7 from to++) < [eva:alarm] tests/value/non_natural.i:27: Warning: < out of bounds read. assert \valid_read(tmp_8); < (tmp_8 from from++) 95,100d70 < [eva:alarm] tests/value/non_natural.i:28: Warning: < out of bounds write. assert \valid(tmp_9); < (tmp_9 from to++) < [eva:alarm] tests/value/non_natural.i:28: Warning: < out of bounds read. assert \valid_read(tmp_10); < (tmp_10 from from++) 103,108d72 < [eva:alarm] tests/value/non_natural.i:29: Warning: < out of bounds write. assert \valid(tmp_11); < (tmp_11 from to++) < [eva:alarm] tests/value/non_natural.i:29: Warning: < out of bounds read. assert \valid_read(tmp_12); < (tmp_12 from from++) 111,125d74 < [eva:alarm] tests/value/non_natural.i:30: Warning: < out of bounds write. assert \valid(tmp_13); < (tmp_13 from to++) < [eva:alarm] tests/value/non_natural.i:30: Warning: < out of bounds read. assert \valid_read(tmp_14); < (tmp_14 from from++) < [eva] tests/value/non_natural.i:22: < Frama_C_show_each: {{ &p2 + [0..400032],0%32 }} < [eva:alarm] tests/value/non_natural.i:23: Warning: < out of bounds read. assert \valid_read(tmp_0); < (tmp_0 from from++) < [eva:alarm] tests/value/non_natural.i:24: Warning: < out of bounds read. assert \valid_read(tmp_2); < (tmp_2 from from++) < [eva] tests/value/non_natural.i:22: Frama_C_show_each: {{ &p2 + [0..--],0%32 }} 128,129d76 < more than 200(12501) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:23: 132,133d78 < more than 200(12501) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:24: 194,197c139 < Frama_C_show_each: {{ &p2 + [0..400000],0%32 }} < [eva:alarm] tests/value/non_natural.i:39: Warning: < out of bounds write. assert \valid(tmp); < (tmp from to++) --- > Frama_C_show_each: {{ &p2 + [0..399968],0%32 }} 200,202d141 < [eva:alarm] tests/value/non_natural.i:40: Warning: < out of bounds write. assert \valid(tmp_1); < (tmp_1 from to++) 205,210d143 < [eva:alarm] tests/value/non_natural.i:41: Warning: < out of bounds write. assert \valid(tmp_3); < (tmp_3 from to++) < [eva:alarm] tests/value/non_natural.i:41: Warning: < out of bounds read. assert \valid_read(tmp_4); < (tmp_4 from from++) 213,218d145 < [eva:alarm] tests/value/non_natural.i:42: Warning: < out of bounds write. assert \valid(tmp_5); < (tmp_5 from to++) < [eva:alarm] tests/value/non_natural.i:42: Warning: < out of bounds read. assert \valid_read(tmp_6); < (tmp_6 from from++) 221,226d147 < [eva:alarm] tests/value/non_natural.i:43: Warning: < out of bounds write. assert \valid(tmp_7); < (tmp_7 from to++) < [eva:alarm] tests/value/non_natural.i:43: Warning: < out of bounds read. assert \valid_read(tmp_8); < (tmp_8 from from++) 229,234d149 < [eva:alarm] tests/value/non_natural.i:44: Warning: < out of bounds write. assert \valid(tmp_9); < (tmp_9 from to++) < [eva:alarm] tests/value/non_natural.i:44: Warning: < out of bounds read. assert \valid_read(tmp_10); < (tmp_10 from from++) 237,242d151 < [eva:alarm] tests/value/non_natural.i:45: Warning: < out of bounds write. assert \valid(tmp_11); < (tmp_11 from to++) < [eva:alarm] tests/value/non_natural.i:45: Warning: < out of bounds read. assert \valid_read(tmp_12); < (tmp_12 from from++) 245,259d153 < [eva:alarm] tests/value/non_natural.i:46: Warning: < out of bounds write. assert \valid(tmp_13); < (tmp_13 from to++) < [eva:alarm] tests/value/non_natural.i:46: Warning: < out of bounds read. assert \valid_read(tmp_14); < (tmp_14 from from++) < [eva] tests/value/non_natural.i:38: < Frama_C_show_each: {{ &p2 + [0..400032],0%32 }} < [eva:alarm] tests/value/non_natural.i:39: Warning: < out of bounds read. assert \valid_read(tmp_0); < (tmp_0 from from++) < [eva:alarm] tests/value/non_natural.i:40: Warning: < out of bounds read. assert \valid_read(tmp_2); < (tmp_2 from from++) < [eva] tests/value/non_natural.i:38: Frama_C_show_each: {{ &p2 + [0..--],0%32 }} 268,269c162,163 < to ∈ {{ &p2 + [32..--],0%32 }} < from ∈ {{ &p1 + [32..--],0%32 }} --- > to ∈ {{ &p2 + [32..400000],0%32 }} > from ∈ {{ &p1 + [32..400000],0%32 }} 273,274c167,168 < to ∈ {{ &p2 + [32..--],0%32 }} < from ∈ {{ &p1 + [32..--],0%32 }} --- > to ∈ {{ &p2 + [32..400000],0%32 }} > from ∈ {{ &p1 + [32..400000],0%32 }} 330,332c224,232 < p2[0] FROM to; from; count; p1[0..100000] (and SELF) < [1..99992] FROM to; from; count; p1[0..100001] (and SELF) < [99993] FROM to; from; count; p1[1..100001] (and SELF) --- > p2[0] FROM to; from; count; p1[0..99992] (and SELF) > [1] FROM to; from; count; p1[0..99993] (and SELF) > [2] FROM to; from; count; p1[0..99994] (and SELF) > [3] FROM to; from; count; p1[0..99995] (and SELF) > [4] FROM to; from; count; p1[0..99996] (and SELF) > [5] FROM to; from; count; p1[0..99997] (and SELF) > [6] FROM to; from; count; p1[0..99998] (and SELF) > [7..99992] FROM to; from; count; p1[0..99999] (and SELF) > [99993] FROM to; from; count; p1[1..99999] (and SELF) 340,342c240,248 < p2[0] FROM to; from; count; p1[0..100000] (and SELF) < [1..99992] FROM to; from; count; p1[0..100001] (and SELF) < [99993] FROM to; from; count; p1[1..100001] (and SELF) --- > p2[0] FROM to; from; count; p1[0..99992] (and SELF) > [1] FROM to; from; count; p1[0..99993] (and SELF) > [2] FROM to; from; count; p1[0..99994] (and SELF) > [3] FROM to; from; count; p1[0..99995] (and SELF) > [4] FROM to; from; count; p1[0..99996] (and SELF) > [5] FROM to; from; count; p1[0..99997] (and SELF) > [6] FROM to; from; count; p1[0..99998] (and SELF) > [7..99992] FROM to; from; count; p1[0..99999] (and SELF) > [99993] FROM to; from; count; p1[1..99999] (and SELF) 360c266 < p1[0..100001] --- > p1[0..99999] 365c271 < p1[0..100001] --- > p1[0..99999] diff tests/value/oracle/noreturn.res.oracle tests/value/oracle_gauges/noreturn.res.oracle 8a9 > [eva] tests/value/noreturn.i:20: starting to merge loop iterations 16a18 > [eva] tests/value/noreturn.i:16: starting to merge loop iterations 32a35 > [eva] tests/value/noreturn.i:7: starting to merge loop iterations 36a40 > [eva] tests/value/noreturn.i:13: starting to merge loop iterations diff tests/value/oracle/octagons.res.oracle tests/value/oracle_gauges/octagons.res.oracle 121,128d120 < [eva:alarm] tests/value/octagons.c:107: Warning: < signed overflow. assert a + 2 ≤ 2147483647; < [eva:alarm] tests/value/octagons.c:108: Warning: < signed overflow. assert b + 2 ≤ 2147483647; < [eva:alarm] tests/value/octagons.c:110: Warning: < signed overflow. assert a + k ≤ 2147483647; < [eva:alarm] tests/value/octagons.c:113: Warning: < signed overflow. assert -2147483648 ≤ c - a; 130c122 < [eva] tests/value/octagons.c:116: Frama_C_show_each_imprecise: [-2147483648..1] --- > [eva] tests/value/octagons.c:116: Frama_C_show_each_imprecise: [-2468..1] 270,273c262,265 < a ∈ [-1024..2147483647] < b ∈ [-1023..2147483647] < c ∈ [-1023..2147483647] < d ∈ [-1032..2147483647] --- > a ∈ [-182..1866] > b ∈ [-181..1867] > c ∈ [-602..1446] > d ∈ [-190..1874] 275c267 < d2 ∈ [-2147483648..1] --- > d2 ∈ [-2468..1] diff tests/value/oracle/reduce_formals.res.oracle tests/value/oracle_gauges/reduce_formals.res.oracle 10a11 > [eva] tests/value/reduce_formals.i:5: starting to merge loop iterations diff tests/value/oracle/redundant_alarms.res.oracle tests/value/oracle_gauges/redundant_alarms.res.oracle 47a48 > [eva] tests/value/redundant_alarms.c:39: starting to merge loop iterations diff tests/value/oracle/reevaluate_alarms.res.oracle tests/value/oracle_gauges/reevaluate_alarms.res.oracle 14,16d13 < [eva:alarm] tests/value/reevaluate_alarms.i:14: Warning: < out of bounds write. assert \valid(tmp); < (tmp from p++) 59c56 < p ∈ {{ &T + [0..--],0%4 }} --- > p ∈ {{ &T{[0], [1], [2], [3], [4], [5]} }} 124,125d120 < [ - ] Assertion 'Eva,mem_access' (file tests/value/reevaluate_alarms.i, line 14) < tried with Eva. 144,145c139,140 < 4 To be validated < 4 Total --- > 3 To be validated > 3 Total 182,183d176 < [eva] tests/value/reevaluate_alarms.i:14: < assertion 'Eva,mem_access' got final status valid. 274,275d266 < [ Valid ] Assertion 'Eva,mem_access' (file tests/value/reevaluate_alarms.i, line 14) < by Eva (v2). 294,295c285,286 < 4 Completely validated < 4 Total --- > 3 Completely validated > 3 Total diff tests/value/oracle/semaphore.res.oracle tests/value/oracle_gauges/semaphore.res.oracle 24a25,33 > [eva] computing for function V <- g. > Called from tests/value/semaphore.i:31. > [eva] Done for function V > [eva] computing for function V <- g. > Called from tests/value/semaphore.i:31. > [eva] Done for function V > [eva] computing for function V <- g. > Called from tests/value/semaphore.i:31. > [eva] Done for function V diff tests/value/oracle/symbolic_locs.res.oracle tests/value/oracle_gauges/symbolic_locs.res.oracle 133a134 > [eva] tests/value/symbolic_locs.i:93: starting to merge loop iterations diff tests/value/oracle/undefined_sequence.0.res.oracle tests/value/oracle_gauges/undefined_sequence.0.res.oracle 97a98 > [eva] tests/value/undefined_sequence.i:43: starting to merge loop iterations 101a103 > [eva] tests/value/undefined_sequence.i:49: starting to merge loop iterations diff tests/value/oracle/unroll.res.oracle tests/value/oracle_gauges/unroll.res.oracle 13,14d12 < [eva:alarm] tests/value/unroll.i:34: Warning: < signed overflow. assert -2147483648 ≤ j - 1; 16a15 > [eva] tests/value/unroll.i:39: starting to merge loop iterations 26c25 < j ∈ [-2147483648..-123] --- > j ∈ {-238} diff tests/value/oracle/unroll_simple.res.oracle tests/value/oracle_gauges/unroll_simple.res.oracle 8,9d7 < [eva:alarm] tests/value/unroll_simple.i:11: Warning: < signed overflow. assert -2147483648 ≤ j - 1; 11a10 > [eva] tests/value/unroll_simple.i:16: starting to merge loop iterations 21c20 < j ∈ [-2147483648..-126] --- > j ∈ {-250} diff tests/value/oracle/va_list2.0.res.oracle tests/value/oracle_gauges/va_list2.0.res.oracle 50a51,62 > [eva] tests/value/va_list2.c:16: > Frama_C_show_each_i: > {{ garbled mix of &{S_0_S___va_params; S_1_S___va_params} (origin: Well) }} > [eva] tests/value/va_list2.c:21: > Frama_C_show_each_f: > {{ garbled mix of &{S_0_S___va_params; S_1_S___va_params} (origin: Well) }} > [eva] tests/value/va_list2.c:16: > Frama_C_show_each_i: > {{ garbled mix of &{S_0_S___va_params; S_1_S___va_params} (origin: Well) }} > [eva] tests/value/va_list2.c:21: > Frama_C_show_each_f: > {{ garbled mix of &{S_0_S___va_params; S_1_S___va_params} (origin: Well) }} diff tests/value/oracle/va_list2.1.res.oracle tests/value/oracle_gauges/va_list2.1.res.oracle 40a41,52 > [eva] computing for function __builtin_va_arg <- main. > Called from tests/value/va_list2.c:15. > [eva] Done for function __builtin_va_arg > [eva] computing for function __builtin_va_arg <- main. > Called from tests/value/va_list2.c:20. > [eva] Done for function __builtin_va_arg > [eva] computing for function __builtin_va_arg <- main. > Called from tests/value/va_list2.c:15. > [eva] Done for function __builtin_va_arg > [eva] computing for function __builtin_va_arg <- main. > Called from tests/value/va_list2.c:20. > [eva] Done for function __builtin_va_arg diff tests/value/oracle/widen_on_non_monotonic.res.oracle tests/value/oracle_gauges/widen_on_non_monotonic.res.oracle 25a26,27 > [eva] tests/value/widen_on_non_monotonic.i:21: starting to merge loop iterations > [eva] tests/value/widen_on_non_monotonic.i:18: starting to merge loop iterations diff tests/value/oracle/widen_overflow.res.oracle tests/value/oracle_gauges/widen_overflow.res.oracle 31a32,34 > [eva] computing for function u <- main. > Called from tests/value/widen_overflow.i:9. > [eva] Done for function u frama-c-20.0-Calcium/tests/value/diff_octagons0000666000000000000000000003316113571573400016225 0ustar diff tests/value/oracle/alias.1.res.oracle tests/value/oracle_octagons/alias.1.res.oracle 85c85 < z ∈ {0; 1; 2} --- > z ∈ {0; 2} diff tests/value/oracle/alias.2.res.oracle tests/value/oracle_octagons/alias.2.res.oracle 76c76 < z ∈ {-5; -4; -3; -2; -1; 0; 1; 1000} --- > z ∈ {-2; -1; 0; 1000} diff tests/value/oracle/alias.3.res.oracle tests/value/oracle_octagons/alias.3.res.oracle 67c67 < z ∈ {0; 1; 2} --- > z ∈ {0; 2} diff tests/value/oracle/alias.5.res.oracle tests/value/oracle_octagons/alias.5.res.oracle 59a60 > [eva] tests/value/alias.i:260: starting to merge loop iterations diff tests/value/oracle/alias.6.res.oracle tests/value/oracle_octagons/alias.6.res.oracle 82c82 < t ∈ {4; 5; 6} --- > t ∈ {5} 87c87 < y ∈ {0; 1} --- > y ∈ {1} 94,96c94,96 < tz1 ∈ {0; 1} < tz2 ∈ {0; 1} < tz3 ∈ {0; 1} --- > tz1 ∈ {1} > tz2 ∈ {1} > tz3 ∈ {1} diff tests/value/oracle/bitfield.res.oracle tests/value/oracle_octagons/bitfield.res.oracle 132a133,135 > [eva] tests/value/bitfield.i:71: > Frama_C_show_each: > {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} diff tests/value/oracle/builtins_split.res.oracle tests/value/oracle_octagons/builtins_split.res.oracle 70a71,84 > [eva] tests/value/builtins_split.c:104: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:104: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:104: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:104: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:104: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:104: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:104: > Call to builtin Frama_C_builtin_split_all 81a96,109 > [eva] tests/value/builtins_split.c:112: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:112: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:112: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:112: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:112: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:112: > Call to builtin Frama_C_builtin_split_all > [eva] tests/value/builtins_split.c:112: > Call to builtin Frama_C_builtin_split_all diff tests/value/oracle/call_simple.res.oracle tests/value/oracle_octagons/call_simple.res.oracle 28c28 < c ∈ [--..--] --- > c ∈ [-2147483648..2147483646] diff tests/value/oracle/descending.res.oracle tests/value/oracle_octagons/descending.res.oracle 42c42 < i ∈ {31; 32} --- > i ∈ {31} diff tests/value/oracle/downcast.res.oracle tests/value/oracle_octagons/downcast.res.oracle 61c61 < [100000..2147483647], [100145..2147483647], [100145..2147483647] --- > [100000..2147483502], [100145..2147483647], [100145..2147483647] 167c167 < x_0 ∈ [100000..2147483647] --- > x_0 ∈ [100000..2147483502] diff tests/value/oracle/equality.res.oracle tests/value/oracle_octagons/equality.res.oracle 29,30c29,30 < y ∈ [0..42] or UNINITIALIZED < w ∈ [0..42] or UNINITIALIZED --- > y ∈ [0..42] > w ∈ [0..42] diff tests/value/oracle/find_ivaltop.res.oracle tests/value/oracle_octagons/find_ivaltop.res.oracle 32,33c32,33 < j ∈ {0; 1; 2; 3; 4; 5; 6; 7} < X ∈ {1; 2; 3; 4; 5; 6; 7; 8} --- > j ∈ {7} > X ∈ {8} 39c39 < \result FROM t[0..7] --- > \result FROM t[7] 44c44 < t[0..7] --- > t[7] diff tests/value/oracle/for_loops.3.res.oracle tests/value/oracle_octagons/for_loops.3.res.oracle 20c20 < v ∈ [0..2147483647] --- > v ∈ [5..2147483647] diff tests/value/oracle/gauges.res.oracle tests/value/oracle_octagons/gauges.res.oracle 209,210d208 < [eva:alarm] tests/value/gauges.c:156: Warning: < signed overflow. assert -2147483648 ≤ toCopy - 1; 272,273d269 < [eva:alarm] tests/value/gauges.c:201: Warning: < signed overflow. assert -2147483648 ≤ numNonZero - 1; 296,300d291 < [eva] tests/value/gauges.c:218: Frama_C_show_each: < [eva] tests/value/gauges.c:218: Frama_C_show_each: < [eva] tests/value/gauges.c:218: Frama_C_show_each: < [eva:alarm] tests/value/gauges.c:220: Warning: < signed overflow. assert -2147483648 ≤ n - 1; 787c778 < numNonZero ∈ [-2147483648..8] --- > numNonZero ∈ {-1} 798c789 < n ∈ [-2147483648..99] --- > n ∈ {-1} 859c850 < toCopy ∈ [-2147483648..99] --- > toCopy ∈ {-1} diff tests/value/oracle/loop.res.oracle tests/value/oracle_octagons/loop.res.oracle 26c26 < r ∈ [0..2147483646],0%2 --- > r ∈ [46..2147483646],0%2 diff tests/value/oracle/loop_wvar.1.res.oracle tests/value/oracle_octagons/loop_wvar.1.res.oracle 12,13d11 < [eva:alarm] tests/value/loop_wvar.i:57: Warning: < signed overflow. assert next + 1 ≤ 2147483647; 41c39 < next ∈ [0..2147483647] --- > next ∈ [0..25] diff tests/value/oracle/modulo.res.oracle tests/value/oracle_octagons/modulo.res.oracle 40a41,56 > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [-9..-1], [-8..0] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [1..9], [-8..0] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [-9..-1], [0..8] > [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [1..9], [0..8] > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [1..9], {1; 2; 3; 4; 5; 6; 7; 8}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [-9..-1], {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [1..9], {-8; -7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:41: > Frama_C_show_each_1: > [-9..-1], {-8; -7; -6; -5; -4; -3; -2; -1}, {-7; -6; -5; -4; -3; -2; -1; 0} 50a67,82 > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..-1], [1..9], [-8..0] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..-1], [-9..-1], [-8..0] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [1..10], [1..9], [0..8] > [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [1..10], [-9..-1], [0..8] > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [-9..-1], {1; 2; 3; 4; 5; 6; 7; 8}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [1..9], {1; 2; 3; 4; 5; 6; 7; 8}, {0; 1; 2; 3; 4; 5; 6; 7} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [-9..-1], {-8; -7; -6; -5; -4; -3; -2; -1}, {-7; -6; -5; -4; -3; -2; -1; 0} > [eva] tests/value/modulo.i:53: > Frama_C_show_each_2: > [1..9], {-8; -7; -6; -5; -4; -3; -2; -1}, {0; 1; 2; 3; 4; 5; 6; 7} 60a93,94 > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-10..10], [-9..9], [-8..8] > [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-9..9], [-8..8], [-7..7] diff tests/value/oracle/non_natural.res.oracle tests/value/oracle_octagons/non_natural.res.oracle 58a59,60 > [kernel] tests/value/non_natural.i:30: > more than 200(12500) elements to enumerate. Approximating. 65a68,69 > [kernel] tests/value/non_natural.i:23: > more than 200(12500) elements to enumerate. Approximating. 70a75,76 > [kernel] tests/value/non_natural.i:24: > more than 200(12500) elements to enumerate. Approximating. 78a85,86 > [kernel] tests/value/non_natural.i:25: > more than 200(12500) elements to enumerate. Approximating. 86a95,96 > [kernel] tests/value/non_natural.i:26: > more than 200(12500) elements to enumerate. Approximating. 94a105,106 > [kernel] tests/value/non_natural.i:27: > more than 200(12500) elements to enumerate. Approximating. 102a115,116 > [kernel] tests/value/non_natural.i:28: > more than 200(12500) elements to enumerate. Approximating. 110a125,126 > [kernel] tests/value/non_natural.i:29: > more than 200(12500) elements to enumerate. Approximating. 129,130d144 < [kernel] tests/value/non_natural.i:23: < more than 200(12500) elements to enumerate. Approximating. 133,146d146 < [kernel] tests/value/non_natural.i:24: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:25: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:26: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:27: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:28: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:29: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:30: < more than 200(12500) elements to enumerate. Approximating. 199a200,201 > [kernel] tests/value/non_natural.i:39: > more than 200(12500) elements to enumerate. Approximating. diff tests/value/oracle/nonlin.res.oracle tests/value/oracle_octagons/nonlin.res.oracle 105a106,107 > [eva:nonlin] tests/value/nonlin.c:67: non-linear 'x * x', lv 'x' > [eva:nonlin] tests/value/nonlin.c:67: subdividing on x 108a111,113 > [eva:nonlin] tests/value/nonlin.c:68: subdividing on x > [eva:nonlin] tests/value/nonlin.c:68: non-linear 'y * y', lv 'y' > [eva:nonlin] tests/value/nonlin.c:68: subdividing on y 111a117,118 > [eva:nonlin] tests/value/nonlin.c:70: non-linear 'z * x + x * y', lv 'x' > [eva:nonlin] tests/value/nonlin.c:70: subdividing on x 176,178c183,185 < square ∈ [-48..400] < square2 ∈ [-48..400] < res ∈ [-144..400] --- > square ∈ [-200..400] > square2 ∈ [-200..400] > res ∈ [-200..400] diff tests/value/oracle/plevel.res.oracle tests/value/oracle_octagons/plevel.res.oracle 12d11 < [eva] Recording results for main 14a14 > [eva] Recording results for main diff tests/value/oracle/ptr_relation.1.res.oracle tests/value/oracle_octagons/ptr_relation.1.res.oracle 24c24 < j ∈ {-1; 0; 1} --- > j ∈ {0} diff tests/value/oracle/relation_reduction.res.oracle tests/value/oracle_octagons/relation_reduction.res.oracle 24,27d23 < [eva:alarm] tests/value/relation_reduction.i:20: Warning: < accessing out of bounds index. assert 0 ≤ y; < [eva:alarm] tests/value/relation_reduction.i:20: Warning: < accessing out of bounds index. assert y < 9; 34,37c30,33 < R1 ∈ [-2147483648..2147483637] < R2 ∈ [-2147483638..2147483647] < R3 ∈ [--..--] < R4 ∈ {0; 1; 2; 3; 4; 5} --- > R1 ∈ {0; 2} > R2 ∈ {0; 12} > R3 ∈ {0; 7} > R4 ∈ {0; 2} 48c44 < R4 FROM tab[0..8]; x (and SELF) --- > R4 FROM tab[0..5]; x (and SELF) 53c49 < y; t; tab[0..8] --- > y; t; tab[0..5] diff tests/value/oracle/relation_shift.res.oracle tests/value/oracle_octagons/relation_shift.res.oracle 18,25d17 < [eva:alarm] tests/value/relation_shift.i:15: Warning: < signed overflow. assert -2147483648 ≤ x - y; < [eva:alarm] tests/value/relation_shift.i:15: Warning: < signed overflow. assert x - y ≤ 2147483647; < [eva:alarm] tests/value/relation_shift.i:16: Warning: < signed overflow. assert -2147483648 ≤ z - y; < [eva:alarm] tests/value/relation_shift.i:16: Warning: < signed overflow. assert z - y ≤ 2147483647; 31,32c23,24 < r1 ∈ [--..--] < r2 ∈ [--..--] --- > r1 ∈ {2} > r2 ∈ {7} 35,37c27,29 < x ∈ [-2147483647..2147483647] < y ∈ [-2147483648..2147483646] < z ∈ [-2147483642..2147483647] --- > x ∈ [-2147483646..2147483642] > y ∈ [-2147483648..2147483640] > z ∈ [-2147483641..2147483647] 49,50c41,42 < r1 ∈ [--..--] < r2 ∈ [--..--] --- > r1 ∈ {2} > r2 ∈ {7} 53,55c45,47 < x ∈ [-2147483647..2147483647] < y ∈ [-2147483648..2147483646] < z ∈ [-2147483642..2147483647] --- > x ∈ [-2147483646..2147483642] > y ∈ [-2147483648..2147483640] > z ∈ [-2147483641..2147483647] diff tests/value/oracle/relations.res.oracle tests/value/oracle_octagons/relations.res.oracle 80,81c80,82 < e ∈ [--..--] < f ∈ [--..--] --- > e ∈ {1} > f[bits 0 to 7] ∈ {1; 4} > [bits 8 to 31] ∈ [--..--] diff tests/value/oracle/relations2.res.oracle tests/value/oracle_octagons/relations2.res.oracle 25c25 < len ∈ [--..--] --- > len ∈ [0..1023] 36,37c36 < [eva] tests/value/relations2.i:17: < Frama_C_show_each_end: [0..4294967295], [0..64] --- > [eva] tests/value/relations2.i:17: Frama_C_show_each_end: [0..1023], [0..64] 59c58 < n ∈ [0..512] --- > n ∈ [1..512] 69,71d67 < [eva:alarm] tests/value/relations2.i:34: Warning: < accessing out of bounds index. < assert (unsigned int)(i - (unsigned int)(t + 1)) < 514; 80c76 < n ∈ [0..512] --- > n ∈ [1..512] 97c93 < n ∈ [0..512] --- > n ∈ [1..512] 140c136 < len ∈ [--..--] --- > len ∈ [0..1023] diff tests/value/oracle/semaphore.res.oracle tests/value/oracle_octagons/semaphore.res.oracle 65c65 < c ∈ {-26; -1} --- > c ∈ {-1} diff tests/value/oracle/struct2.res.oracle tests/value/oracle_octagons/struct2.res.oracle 81,84d80 < accessing out of bounds index. assert 0 ≤ (int)(i + j); < [eva:alarm] tests/value/struct2.i:185: Warning: < accessing out of bounds index. assert (int)(i + j) < 2; < [eva:alarm] tests/value/struct2.i:185: Warning: 106d101 < [scope:rm_asserts] removing 2 assertion(s) diff tests/value/oracle/test.0.res.oracle tests/value/oracle_octagons/test.0.res.oracle 17,18d16 < [eva:alarm] tests/value/test.i:11: Warning: < signed overflow. assert j + ecart ≤ 2147483647; 29c27 < j ∈ [-1073741822..1] --- > j ∈ {-1; 0; 1} diff tests/value/oracle/unroll.res.oracle tests/value/oracle_octagons/unroll.res.oracle 22c22 < G ∈ [17739..2147483647] --- > G ∈ [17854..2147483647] diff tests/value/oracle/unroll_simple.res.oracle tests/value/oracle_octagons/unroll_simple.res.oracle 17c17 < G ∈ [8772..2147483647] --- > G ∈ [8896..2147483647] frama-c-20.0-Calcium/tests/value/diff_symblocs0000666000000000000000000002340413571573400016242 0ustar diff tests/value/oracle/alias.0.res.oracle tests/value/oracle_symblocs/alias.0.res.oracle 103,104c103,104 < t ∈ {1; 2; 4} < u ∈ {2; 3; 4; 5} --- > t ∈ {4} > u ∈ {5} 110c110 < t2 ∈ {0; 3; 6} --- > t2 ∈ {6} diff tests/value/oracle/alias.4.res.oracle tests/value/oracle_symblocs/alias.4.res.oracle 81c81 < y ∈ {0; 3; 77} --- > y ∈ {77} diff tests/value/oracle/alias.5.res.oracle tests/value/oracle_symblocs/alias.5.res.oracle 170c170 < y ∈ {0; 3; 77} --- > y ∈ {77} diff tests/value/oracle/alias.6.res.oracle tests/value/oracle_symblocs/alias.6.res.oracle 86c86 < x ∈ {0; 4; 33} --- > x ∈ {33} diff tests/value/oracle/bitwise_pointer.res.oracle tests/value/oracle_symblocs/bitwise_pointer.res.oracle 58c58 < x ∈ [0..9] --- > x ∈ {5} 71c71 < x1 ∈ [0..9] --- > x1 ∈ {5} diff tests/value/oracle/bitwise_reduction.res.oracle tests/value/oracle_symblocs/bitwise_reduction.res.oracle 20c20 < {0; 1}, {0; 1; 0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} --- > {0; 1}, {0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} 23c23 < {0; 1}, {0; 1; 0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} --- > {0; 1}, {0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} 30c30 < {{ &t + {0; 4} }}, {0; 1; 0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} --- > {{ &t + {0; 4} }}, {0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} 33c33 < {0; 1}, {0; 1; 0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} --- > {0; 1}, {0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} diff tests/value/oracle/incompatible_states.res.oracle tests/value/oracle_symblocs/incompatible_states.res.oracle 39,40d38 < [eva:alarm] tests/value/incompatible_states.c:53: Warning: < division by zero. assert t[i] ≢ 0; 47c45 < [scope:rm_asserts] removing 2 assertion(s) --- > [scope:rm_asserts] removing 1 assertion(s) diff tests/value/oracle/library.res.oracle tests/value/oracle_symblocs/library.res.oracle 129,132d128 < [eva:alarm] tests/value/library.i:44: Warning: < non-finite float value. assert \is_finite(*pf); < [eva:alarm] tests/value/library.i:44: Warning: < non-finite float value. assert \is_finite((float)(*pf + *pf)); diff tests/value/oracle/non_natural.res.oracle tests/value/oracle_symblocs/non_natural.res.oracle 58a59,60 > [kernel] tests/value/non_natural.i:30: > more than 200(12500) elements to enumerate. Approximating. 65a68,71 > [kernel] tests/value/non_natural.i:23: > more than 200(12501) elements to enumerate. Approximating. > [kernel] tests/value/non_natural.i:23: > more than 200(12500) elements to enumerate. Approximating. 70a77,80 > [kernel] tests/value/non_natural.i:24: > more than 200(12501) elements to enumerate. Approximating. > [kernel] tests/value/non_natural.i:24: > more than 200(12500) elements to enumerate. Approximating. 78a89,90 > [kernel] tests/value/non_natural.i:25: > more than 200(12500) elements to enumerate. Approximating. 86a99,100 > [kernel] tests/value/non_natural.i:26: > more than 200(12500) elements to enumerate. Approximating. 94a109,110 > [kernel] tests/value/non_natural.i:27: > more than 200(12500) elements to enumerate. Approximating. 102a119,120 > [kernel] tests/value/non_natural.i:28: > more than 200(12500) elements to enumerate. Approximating. 110a129,130 > [kernel] tests/value/non_natural.i:29: > more than 200(12500) elements to enumerate. Approximating. 127,146d146 < [kernel] tests/value/non_natural.i:23: < more than 200(12501) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:23: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:24: < more than 200(12501) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:24: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:25: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:26: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:27: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:28: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:29: < more than 200(12500) elements to enumerate. Approximating. < [kernel] tests/value/non_natural.i:30: < more than 200(12500) elements to enumerate. Approximating. 199a200,201 > [kernel] tests/value/non_natural.i:39: > more than 200(12500) elements to enumerate. Approximating. diff tests/value/oracle/offsetmap.0.res.oracle tests/value/oracle_symblocs/offsetmap.0.res.oracle 38d37 < [eva] Recording results for g 40a40 > [eva] Recording results for g diff tests/value/oracle/offsetmap.1.res.oracle tests/value/oracle_symblocs/offsetmap.1.res.oracle 38d37 < [eva] Recording results for g 40a40 > [eva] Recording results for g diff tests/value/oracle/plevel.res.oracle tests/value/oracle_symblocs/plevel.res.oracle 12d11 < [eva] Recording results for main 14a14 > [eva] Recording results for main diff tests/value/oracle/ptr_relation.0.res.oracle tests/value/oracle_symblocs/ptr_relation.0.res.oracle 23c23 < i ∈ {0; 77; 333} --- > i ∈ {77} diff tests/value/oracle/redundant_alarms.res.oracle tests/value/oracle_symblocs/redundant_alarms.res.oracle 10,13d9 < [eva:alarm] tests/value/redundant_alarms.c:11: Warning: < accessing uninitialized left-value. assert \initialized(p); < [eva:alarm] tests/value/redundant_alarms.c:12: Warning: < accessing uninitialized left-value. assert \initialized(p); 24,27d19 < [eva:alarm] tests/value/redundant_alarms.c:21: Warning: < accessing uninitialized left-value. assert \initialized(&t[i]); < [eva:alarm] tests/value/redundant_alarms.c:22: Warning: < accessing uninitialized left-value. assert \initialized(&t[i]); 38,41d29 < [eva:alarm] tests/value/redundant_alarms.c:32: Warning: < accessing uninitialized left-value. assert \initialized(&t[j]); < [eva:alarm] tests/value/redundant_alarms.c:33: Warning: < accessing uninitialized left-value. assert \initialized(&t[i]); 63,69d50 < [scope:rm_asserts] removing 3 assertion(s) < [scope:rm_asserts] tests/value/redundant_alarms.c:12: < removing redundant assert Eva: initialization: \initialized(p); < [scope:rm_asserts] tests/value/redundant_alarms.c:32: < removing redundant assert Eva: initialization: \initialized(&t[j]); < [scope:rm_asserts] tests/value/redundant_alarms.c:33: < removing redundant assert Eva: initialization: \initialized(&t[i]); 108d88 < /*@ assert Eva: initialization: \initialized(p); */ 110d89 < /*@ assert Eva: initialization: \initialized(p); */ 127d105 < /*@ assert Eva: initialization: \initialized(&t[i]); */ 129d106 < /*@ assert Eva: initialization: \initialized(&t[i]); */ 142d118 < /*@ assert Eva: initialization: \initialized(&t[j]); */ 144d119 < /*@ assert Eva: initialization: \initialized(&t[i]); */ 196a172 > int z; 199,201d174 < *p = 1; < int z = *p + 1; < int w = *p + 2; diff tests/value/oracle/relations2.res.oracle tests/value/oracle_symblocs/relations2.res.oracle 133d132 < [eva] tests/value/relations2.i:57: Frama_C_show_each_NO2: diff tests/value/oracle/struct2.res.oracle tests/value/oracle_symblocs/struct2.res.oracle 55a56,57 > [kernel] tests/value/struct2.i:78: Warning: > all target addresses were invalid. This path is assumed to be dead. 59,60d60 < accessing out of bounds index. assert 0 ≤ (int)(tab2[i] + j); < [eva:alarm] tests/value/struct2.i:82: Warning: 83,84d82 < accessing out of bounds index. assert (int)(i + j) < 2; < [eva:alarm] tests/value/struct2.i:185: Warning: 106c104 < [scope:rm_asserts] removing 2 assertion(s) --- > [scope:rm_asserts] removing 1 assertion(s) 144,145c142 < tab4[0] ∈ {0; 2} < [1] ∈ {0} --- > tab4[0..1] ∈ {0} 148c145,146 < tab6[0..1] ∈ {0; 2} --- > tab6[0] ∈ {0} > [1] ∈ {2} 219c217 < [9].a}; s1; s2; s5.e[0].b; s6.b; s8; tabl[0..1]; tab1[0..1]; --- > [9].a}; s1; s2; s5.e[0].b; s6.b; s8; tabl[0..1]; tab1[0]; diff tests/value/oracle/symbolic_locs.res.oracle tests/value/oracle_symblocs/symbolic_locs.res.oracle 20a21,26 > # Symbolic locations domain: > V: {[ t[i] -> {4} ]} > Z: {[ t[i] -> t[0..8]; i ]} > I: {[ t -> {t[i]} > i -> {t[i]} ]} > S: {[ i -> {t[i]} ]} 31a38,42 > # Symbolic locations domain: > V: {[ ]} > Z: {[ ]} > I: {[ ]} > S: {[ ]} 48a60,65 > # Symbolic locations domain: > V: {[ t[i] -> {4} ]} > Z: {[ t[i] -> t[0..8]; i ]} > I: {[ t -> {t[i]} > i -> {t[i]} ]} > S: {[ i -> {t[i]} ]} 59a77,81 > # Symbolic locations domain: > V: {[ ]} > Z: {[ ]} > I: {[ ]} > S: {[ ]} 77a100,106 > # Symbolic locations domain: > V: {[ t[i] -> {{ &x }} ]} > Z: {[ t[i] -> t[0..8]; i ]} > I: {[ t -> {t[i]} > i -> {t[i]} ]} > S: {[ i -> {t[i]} > x -> {t[i]} ]} 90a120,124 > # Symbolic locations domain: > V: {[ ]} > Z: {[ ]} > I: {[ ]} > S: {[ ]} 106a141,146 > # Symbolic locations domain: > V: {[ t[i] -> {1} ]} > Z: {[ t[i] -> t[0..8]; i ]} > I: {[ t -> {t[i]} > i -> {t[i]} ]} > S: {[ i -> {t[i]} ]} 115a156,160 > # Symbolic locations domain: > V: {[ ]} > Z: {[ ]} > I: {[ ]} > S: {[ ]} 132a178,182 > # Symbolic locations domain: > V: {[ ]} > Z: {[ ]} > I: {[ ]} > S: {[ ]} 139,141c189 < [eva:alarm] tests/value/symbolic_locs.i:111: Warning: < signed overflow. assert *p + 1 ≤ 2147483647; < [eva] tests/value/symbolic_locs.i:113: Frama_C_show_each: [0..2147483647] --- > [eva] tests/value/symbolic_locs.i:113: Frama_C_show_each: [10001..2147483647] 150a199,203 > # Symbolic locations domain: > V: {[ ]} > Z: {[ ]} > I: {[ ]} > S: {[ ]} diff tests/value/oracle/test.0.res.oracle tests/value/oracle_symblocs/test.0.res.oracle 31c31 < tmp ∈ [--..--] or UNINITIALIZED --- > tmp ∈ [-2147483647..2147483647] or UNINITIALIZED frama-c-20.0-Calcium/tests/value/disjoint_status.i0000666000000000000000000000075013571573400017073 0ustar /* run.config* STDOPT: +"-then -load-module report -report" */ int x; //@ requires ReqTrue: \true; ensures PostTrue: \true; // Test printing of ACSL names void f(unsigned int c, unsigned int d) { //@ assert A1: c != 1 || d != 2; //@ assert A2: d/2-c !=0; x = 1/(d/2-c); } /*@ requires c + 1 == 2; @ requires c+d==3; */ //implied: requires c==1 && d==2; void main(unsigned int c, unsigned int d) { if (c == 1 && d==2) f(c, d); /*@ assert c==1 && d==2; */ f(d,c); } frama-c-20.0-Calcium/tests/value/div.i0000666000000000000000000000124513571573400014427 0ustar /* run.config* STDOPT: #"-load-module scope -remove-redundant-alarms" OPT: -no-autoload-plugins -load-module eva,inout -rte -then -eva @EVA_CONFIG@ */ int X,Y,Z1,Z2,T,U1,U2,V,W1,W2; int a,b,d1,d2,d0,e; int t[5]={1,2,3}; int *p; void main (void) { int i; volatile int c=0; while (c+1) { if (c) X++; if (c+2) X--; } Y = -5; if ((X>=Y) && (X<=12) ) Y = X; Y = 27 * Y + 9; Z1 = Y / 3; Z2 = Y / 5; V = Y + 1; W1 = V / 3; W2 = V / 5; T = Y + 160; U1 = T / 3; U2 = T / 5; p = &(t[3]); a = 40000/Z2; b = ((int)&Z2)/Z2; d2 = 100 / (int)(&X + 2); d1 = 100 / (int)(&X + 1); d0 = 100 / (int)(&X); e = - (int) &X; } frama-c-20.0-Calcium/tests/value/div_strange.i0000666000000000000000000000013113571573400016143 0ustar int main() { int x = -1; x /= sizeof(unsigned int); Frama_C_show_each_F(x); } frama-c-20.0-Calcium/tests/value/divneg.i0000666000000000000000000000165513571573400015126 0ustar extern int i; int r0, r1 = 6, r2 = -8, r6, r7, r8, r9, rn1 = 5, rn2, rn3, rn4=-3, rn5; int vic; int main (int c) { int rc; if (c<0) c=0; if (c>20) c=0; c = - 5 - 9 * c; Frama_C_show_each(c, c / (-3)); if (i >= -100 && i <= 100) { if (i % 5 == 0) r0 = i; if (i % 5 == 1) r1 = i; if (i % 5 == -3) r2 = i; if (i % 5 == 6) r6 = 1; if (!(i % 5 == 7)) r7 = i; if (i % 5 != 8) r8 = i; if (!(i % 5 != 9)) r9 = 1; if (i % 2 != 0) rn1 = i; if (!(i % 2 != 0)) rn2 = i; if (i % 2 == 0) rn3 = i; if (!(i % 2 == 0)) rn4 = i; if (i % 3 != 1) rn5 = i; if (c % 18 == -14) rc = c; Frama_C_dump_each(); } rc = 104; c = -c; if (c % 18 == 14) rc = c; *(unsigned int *)&vic = -1U; if (vic % 5 == -1) Frama_C_show_each_should(vic); else Frama_C_show_each_shouldnt(vic); return 0; } frama-c-20.0-Calcium/tests/value/domains.i0000666000000000000000000000143413571573400015277 0ustar /* run.config* STDOPT: #"-eva-sign-domain -eva-equality-domain -eva-bitwise-domain -eva-symbolic-locations-domain -eva-gauges-domain -slevel 2" */ /* Tests five domains together. */ void main (int a) { int b, i, k, r; /* Tests the equality domain: b is reduced after the condition, no overflow. */ b = a; if (a < 10) r = b + 1; /* Tests the symbolic locations domain: t[i] is smaller than 10, no overflow. */ int t[2] = {a, a}; i = a > 0; if (t[i] < 10) r = t[i] + 1; /* Tests the gauges domain: k==i during the loop, no overflow. */ k = 0; while (k < 12) { k++; i++; } /* Tests the sign domain: no division by zero. */ if (a != 0) r = 100 / a; /* Tests the bitwise domain: a == 8, no division by zero. */ a = (a | 8) & 8; r = 10 / a; } frama-c-20.0-Calcium/tests/value/downcast.i0000666000000000000000000000717313571573400015475 0ustar /* run.config* STDOPT: +"-load-module report -report -warn-signed-downcast -lib-entry -print -then -no-warn-signed-downcast -warn-unsigned-downcast -then -no-warn-unsigned-downcast -eva-warn-signed-converted-downcast -then -main main5_wrap_signed -slevel 2 -no-print" */ signed char sx,sy,sz; unsigned char uc; int x; unsigned int ux, uy,uz; unsigned short s; struct s { int i: 5; unsigned j: 5; }; volatile v; void main1(void) { sz = sx + sy; uc = sx + sy; uc = x; x = uy + uz; ux = uy + uz; s = uy + uz; } void main2_bitfield() { int i = 117; unsigned j = 254; struct s ss; if (v) ss.i = i; if (v) ss.j = j; } void main3_reduction() { int x = v; char c = x; unsigned int y = v; unsigned char d = y; } /* The cvalue abstraction does not represent how an address is represented in a C type. Thus alarms should always be emitted on a downcast of pointer values, as we don't known if they fit in the destination type. */ void main4_pointer() { int x; long long int p = (long long int)(&x); p += 100; unsigned int q = p; signed int r = p; } // Perform a computation that overflows on signed integers without alarm. The assertions can be proven with enough slevel void main5_wrap_signed() { int x = v; //@ assert ASSUME: x >= 100000; //@ assert x > 0x7FFFFFFF-145 || x <= 0x7FFFFFFF-145; unsigned int y = x; y += 145; int z = y; Frama_C_show_each(x, y, z); //@ assert z >= 100000 + 145 || z <= (int)(0x7FFFFFFF+145); } /* Tests for the relaxed downcast semantics -eva-warn-signed-converted-downcast */ void main6_val_warn_converted_signed() { if (v) { short s = 65300u; // warning (overflow) } if (v) { unsigned short u = 65300u; // No warning } if (v) { unsigned long e = 17; short b = (short)e; // No warning, as 17 fits in short } if (v) { unsigned long e = -12; // No warning on unsigned casts short b = (short)e; // No warning, as -12 fits in short // (but warning in -warn-signed-downcast mode) } if (v) { unsigned int e = -64000; // No warning on unsigned casts short b = (short)e; // Warning, as -64000 does not fit in short } if (v) { int *p = &v; int x = (int) p; // No warning as an address fits in an integer. short y = (short) p; // Warnings, as an address may not fit in short. unsigned short z = (unsigned short) p; // No warninng on unsigned casts. } } void main7_signed_upcast() { unsigned char c= 240; // NEVER convert c to signed char int i = (int)c; } struct bitf { unsigned int i1: 18; signed int i2: 6; }; /* Tests for the relaxed downcast semantics -eva-warn-signed-converted-downcast with bitfields */ void main8_bitfields() { struct bitf S; signed char c; S.i1 = 0x3FFFF; // -1; if (v) S.i2 = S.i1; if (v) c = S.i1; S.i1 = 257u; if (v) S.i2 = S.i1; // Red if (v) c = S.i1; // Red S.i1 = 65u; if (v) S.i2 = S.i1; // Red if (v) c = S.i1; } void main9_bitfield () { struct { unsigned int a:11; } bf; bf.a = 1648; // -400 as a signed value of 11 bits if (v) { int signed_a = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(11))))bf.a; //@ assert signed_a == -400; } signed char c; if (v) c = bf.a; } // Check that we create only one alarm, even if we invent new expressions void main10_loop () { signed char c; struct { unsigned int b:10; } bf; for (int k=0; k <10; k++) { bf.b = v; if (v) c = bf.b; } } void main() { main1(); main2_bitfield(); main3_reduction(); main4_pointer(); main5_wrap_signed(); main6_val_warn_converted_signed(); main7_signed_upcast(); main8_bitfields(); main9_bitfield(); main10_loop(); } frama-c-20.0-Calcium/tests/value/duff.i0000666000000000000000000000105713571573400014572 0ustar /* run.config* DONTRUN: */ int Ato[100]; int Afrom[100]; void main(int count) { int*to = &Ato; int*from = &Afrom; //@ assert count > 0 ; switch (count % 8) /* count > 0 assumed */ { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while ((count -= 8) > 0); } } frama-c-20.0-Calcium/tests/value/dur.i0000666000000000000000000000761113571573400014442 0ustar /* run.config* GCC: STDOPT: #"-float-normal -main F2" */ struct T1 { float M1 ; unsigned short M2 ; unsigned short M3 ; }; typedef struct T1 T2; struct T3 { unsigned short M4 ; unsigned short M5 ; }; typedef struct T3 T4; struct T5 { float M6 ; float M7 ; float M8 ; float M9 ; float M10 ; float M11 ; float M12 ; float M13 ; float M14 ; float M15 ; float M16 ; float M17 ; float M18 ; float M19 ; float M20 ; float M21 ; float M22 ; float M23 ; float M24 ; float M25 ; float M26[(unsigned short)26] ; float M27[(unsigned short)13] ; float M28[(unsigned short)3] ; float M29 ; float M30 ; float M31 ; float M32 ; float M33 ; float M34 ; float M35 ; float M36 ; float M37 ; float M38 ; float M39 ; float M40 ; float M41 ; float M42 ; float M43 ; float M44 ; float M45 ; float M46 ; float M47 ; float M48 ; float M49 ; float M50 ; float M51 ; float M52 ; float M53 ; float M54 ; float M55 ; float M56 ; float M57 ; float M58 ; float M59 ; float M60 ; float M61 ; float M62 ; float M63 ; float M64[27] ; float M65[27] ; float M66[(unsigned short)48] ; float M67[(unsigned short)48] ; float M68[(unsigned short)48] ; float M69[(unsigned short)48] ; float M70[48] ; float M71[48] ; float M72[48] ; float M73[48] ; float M74[(unsigned short)10] ; }; typedef struct T5 T6; struct T7 { unsigned short M75 ; T2 M76[(unsigned short)53] ; T2 M77 ; T2 M78 ; T2 M79 ; T2 M80 ; T2 M81 ; T2 M82 ; T2 M83 ; T2 M84 ; T2 M85 ; T2 M86 ; T2 M87 ; T2 M88 ; T2 M89 ; T4 M90[(unsigned short)4] ; T4 M91 ; T2 M92[(unsigned short)6] ; T4 M93[(unsigned short)5] ; }; typedef struct T7 T8; struct T9 { unsigned short M94[(unsigned short)1][16] ; unsigned short M95[(unsigned short)1] ; unsigned short M96[(unsigned short)1] ; unsigned short M97[(unsigned short)1] ; unsigned short M98 ; }; typedef struct T9 T10; int G1 ; int G2 ; extern unsigned char G3 ; extern T6 const G4 ; extern T8 G5 ; extern T10 G6 ; extern unsigned char G7[(unsigned short)161] ; void F1(T2 *V1 , T2 *V2 , unsigned short const V3 , unsigned short const V4 ) { {if ((int )V1->M2 != 0) {if ((int )V1->M2 == 2) {G7[V3] = (unsigned char)1;} else {G7[V3] = (unsigned char)0;} V1->M2 = (unsigned short)1; if ((int )V2->M2 == 0) {G7[V4] = (unsigned char)0; if (V2->M1 <= G4.M16) {G7[V3] = (unsigned char)1; if (V2->M1 <= G4.M17) {G7[V4] = (unsigned char)1; V2->M2 = (unsigned short)1;} } } else {G7[V4] = (unsigned char)1; V2->M2 = (unsigned short)1;} } else {G7[V3] = (unsigned char)0; V2->M2 = (unsigned short )((int )V2->M2 != 0); G7[V4] = (unsigned char )V2->M2;} return;} } void F2(unsigned short V8 ) { unsigned short V5 ; unsigned short V6 ; unsigned short V7 ; {G5.M75 = (unsigned short )G3; if ((int )V8 == 0) {if ((((int )G6.M97[0] & 1) == 1) == 1) {G5.M91.M4 = (unsigned short)0; G5.M91.M5 = (unsigned short)1;} else {G5.M91.M4 = (unsigned short )(((int )G6.M96[0] & 1) == 1); G5.M91.M5 = (unsigned short)0;} V6 = (unsigned short)0; V7 = (unsigned short)2; V5 = (unsigned short)0; while ((int )V5 < 4) {if (G2) {G5.M90[V5].M4 = (unsigned short)0; G5.M90[V5].M5 = (unsigned short)1;} else {G5.M90[V5].M4 = (unsigned short )G1; if ((int )G5.M90[V5].M4 == 1) {V6 = (unsigned short )( (int )V6 + 1);} G5.M90[V5].M5 = (unsigned short)0;} V7 = (unsigned short )(2 * (int )V7); V5 = (unsigned short )((int )V5 + 1);} } return;} } frama-c-20.0-Calcium/tests/value/empty_base.c0000666000000000000000000000514113571573400015766 0ustar /* run.config* STDOPT: #"-machdep gcc_x86_32" STDOPT: */ // the tests above must be done separately because both fail: // - in gcc mode, the initialization of empty structs leads to parsing errors // - outside of gcc mode, empty initializers ({}) lead to parsing errors #include volatile int nondet; struct empty {}; struct empty global_empty; typedef struct { int a; struct empty e; int b; } comp; typedef struct { struct empty s; int i; } comp_begin; typedef struct { char ch; struct empty ss; } comp_end; comp f(comp s, comp *p) { comp res; res.a = s.b + 10; res.b = s.a - 3; res.e = nondet ? s.e : p->e; return res; } /*@ assigns *p1 \from *p2; ensures *(((char*)p1)+(0..\block_length(p1)-1)) == *(((char*)p2)+(0..\block_length(p2)-1)); */ void copy_empty(struct empty *p1, struct empty *p2) { *p1 = *p2; } struct empty empty_array_of_empty[0]; struct empty array_of_empty[1]; struct empty many_empty[3] = {{}}; comp array_of_comp[1] = {{.a = 17, .b = 45, .e = {}}}; int empty_int_array[0]; char empty_init_array[] = {}; int empty_initialized_array[0] = {}; // examples from https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html struct foo { int x; int y[]; }; //struct foo a = { 1, { 2, 3, 4, 5 } }; // sizeof(a) does not include y //struct bar { struct foo z; }; struct bar c = { { 1, { } } }; // error expected here struct f1 { int x; int y[]; } f1;// = { 1, { 2, 3, 4 } }; struct f2 { //struct f1 f1; int data[3]; } f2 = { { 1 }, { 2, 3, 4 } }; // error expected here void gcc_zero_length_examples() { struct foo { int x; int y[]; }; //struct foo a = { 1, { 2, 3, 4, 5 } }; struct bar { struct foo z; }; // error expected here struct bar c = { { 1, { } } }; struct f1 { int x; int y[]; } f1;// = { 1, { 2, 3, 4 } }; struct f2 { struct f1 f1; int data[3]; } f2 = { { 1 }, { 2, 3, 4 } }; // error expected here } int main() { int k; struct empty e1, e2; //@ assert sizeof(e1) == 0; //@ assert \block_length(&e1) == 0; e1 = global_empty; Frama_C_show_each_global_empty(global_empty); Frama_C_show_each_e1(e1); memcpy(&e2, &e1, sizeof(e1)); comp c1, c2; c1.a = 42; c1.b = 77; c1.e = e1; memcpy(&c2, &c1, sizeof(c1)); Frama_C_show_each_c2(c2); Frama_C_show_each_c2_e(c2.e); comp res = f(c1, &c1); copy_empty(&e2, &e1); res.e = c1.e; Frama_C_show_each_res(res); comp_begin cb = {.i = 91}; comp_end ce = {.ch = 'Z'}; struct empty *p = &cb.s; ce.ss = *p; e1 = array_of_empty[0]; e2 = many_empty[2]; e1 = array_of_comp[0].e; char *pc = empty_init_array; gcc_zero_length_examples(); return 0; } frama-c-20.0-Calcium/tests/value/empty_struct.c0000666000000000000000000000420313571573400016376 0ustar /* run.config* STDOPT: +" -machdep gcc_x86_32 -cpp-extra-args=-DP1 -then -lib-entry" STDOPT: +" -machdep gcc_x86_32 -cpp-extra-args=-DP2 -lib-entry" STDOPT: +" -machdep gcc_x86_32 -cpp-extra-args=-DP3 -lib-entry" STDOPT: +" -cpp-extra-args=-DP1 -lib-entry" STDOPT: +" -cpp-extra-args=-DP1 -absolute-valid-range 0-1 -main main2" STDOPT: +" -cpp-extra-args=\"-DP1 -DP5\" -machdep gcc_x86_32 -absolute-valid-range 0-1 -main main3" STDOPT: +" -machdep gcc_x86_32 -cpp-extra-args=-DP1 -main main4" */ // BTS 1416 and 1874 struct s {}; // empty structs only allowed in GCC/MSVC mode struct s2 { int i1; struct s s; int i2; }; #define S struct s s; #define S2 struct s2 s2; #define T struct s t[10]; // Reorder the variables so that we get an error for each one #ifdef P1 S // direct empty struct S2 T #endif #ifdef P2 S2 // empty struct inside a struct S T #endif #ifdef P3 T // array of empty struct S2 S #endif void main() { void *p = &s; s2.s = s; t[0] = t[1]; } #ifdef P4 // Original example of bts 1874. Not explicitly tested, as the core functionality is checked by the tests above struct lock_class_key {}; /* pas de struct-declaration-list */ struct dentry { struct super_block *d_sb; }; void task_pgrp_nr_ns(struct dentry x); extern struct dentry a; struct super_block { struct lock_class_key s_writers_key[4]; } task_pgrp_nr(void) { task_pgrp_nr_ns(a); /* pas de return */ } #endif // tests that dereferencing a (invalid) pointer to an empty struct does not // crash when -valid-absolute-range is set struct empty {}; void main2(int n) { struct empty * ptr_ret = (struct empty *)0x2; if (n) *ptr_ret; // invalid access, but should not crash } #ifdef P5 #include struct empty empties[100]; volatile int nondet; void main3(int n) { struct empty *q = malloc(0); struct empty *r = realloc(q, 0); struct empty *p = empties; for (int i = 0; i < 100; i++) { empties[i] = *r; } *p = empties[99]; *p = *r; free(r); } #endif struct st { int a; }; struct s gs, *pgs = &gs; //@ assigns \result \from pgs; struct s *f(int); void g(struct s *array); void main4() { struct s *r; r = f(42); g(r); } frama-c-20.0-Calcium/tests/value/empty_struct2.c0000666000000000000000000000243413571573400016464 0ustar #include volatile int nondet; struct empty {}; struct empty global_empty; struct empty *pg = &global_empty; typedef struct { int a; struct empty e; int b; } comp; typedef struct { struct empty s; int i; } comp_begin; typedef struct { char ch; struct empty ss; } comp_end; comp f(comp s, comp *p) { comp res; res.a = s.b + 10; res.b = s.a - 3; res.e = nondet ? s.e : p->e; return res; } //@ assigns \result \from \nothing; struct empty ret_empty(void); /*@ assigns \result \from pg; ensures \result == pg; */ struct empty * ret_ptr_empty(void); int main() { struct empty e1, e2; //@ assert sizeof(e1) == 0; e1 = global_empty; Frama_C_show_each_global_empty(global_empty); Frama_C_show_each_e1(e1); memcpy(&e2, &e1, sizeof(e1)); // imprecise, no builtin comp c1, c2; c1.a = 42; c1.b = 77; c1.e = e1; memcpy(&c2, &c1, sizeof(c1)); // imprecise, no builtin Frama_C_show_each_c2(c2); Frama_C_show_each_c2_e(c2.e); comp res = f(c2, &c1); res.e = c1.e; Frama_C_show_each_res(res); comp_begin cb = {.i = 91}; comp_end ce = {.ch = 'Z'}; struct empty *p = &cb.s; //@ assert \valid(p); ce.ss = *p; struct empty ret = ret_empty(); struct empty * ptr_ret = ret_ptr_empty(); struct empty copy_ptr_ret = *ptr_ret; return 0; } frama-c-20.0-Calcium/tests/value/empty_union.c0000666000000000000000000000363013571573400016205 0ustar /* run.config* STDOPT: +"-machdep gcc_x86_32" */ #include volatile int nondet; union empty {}; union empty global_empty; typedef union { int a; union empty e; int b; } comp; typedef union { union empty s; int i; } comp_begin; typedef union { char ch; union empty ss; } comp_end; comp f(comp s, comp *p) { comp res; res.a = s.b + 10; res.b = s.a - 3; res.e = nondet ? s.e : p->e; return res; } /*@ assigns *p1 \from *p2; ensures *(((char*)p1)+(0..\block_length(p1)-1)) == *(((char*)p2)+(0..\block_length(p2)-1)); */ void copy_empty(union empty *p1, union empty *p2) { *p1 = *p2; } union empty empty_array_of_empty[0]; union empty array_of_empty[1]; //union empty many_empty[3] = {{}}; // error: cannot create init of empty union comp array_of_comp[1] = {{.a = 17}}; int empty_int_array[0]; char empty_init_array[] = {}; int empty_initialized_array[0] = {}; // some examples from https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html union foo { int x; int y[]; }; //union bar c = { { 1, { } } }; // error: cannot create init of empty union union f1 { int x; int y[]; } f1; union f2 { int data[3]; } f2 = { { 1 } }; int main() { int k; union empty e1, e2; //@ assert sizeof(e1) == 0; //@ assert \block_length(&e1) == 0; e1 = global_empty; Frama_C_show_each_global_empty(global_empty); Frama_C_show_each_e1(e1); memcpy(&e2, &e1, sizeof(e1)); // imprecise, no builtin comp c1, c2; c1.a = 42; c1.b = 77; c1.e = e1; memcpy(&c2, &c1, sizeof(c1)); // imprecise, no builtin Frama_C_show_each_c2(c2); Frama_C_show_each_c2_e(c2.e); comp res = f(c1, &c1); copy_empty(&e2, &e1); res.e = c1.e; Frama_C_show_each_res(res.a); comp_begin cb = {.i = 91}; comp_end ce = {.ch = 'Z'}; union empty *p = &cb.s; ce.ss = *p; e1 = array_of_empty[0]; //e2 = many_empty[2]; e1 = array_of_comp[0].e; char *pc = empty_init_array; return 0; } frama-c-20.0-Calcium/tests/value/endian.i0000666000000000000000000000452013571573400015102 0ustar /* run.config* STDOPT: +"-machdep x86_32" STDOPT: +"-machdep ppc_32" */ struct S {unsigned char a; unsigned char b; char c; unsigned char d;} v1; union U {unsigned int full; struct S part;} UU; union U0 { unsigned short f0 ; int f1 ; int f2 : 5 ; unsigned char const f3 ; }; void main0 (void) { unsigned char b0,b1,b2,b3; unsigned int f; union U data0; data0.full = 0xFF030201; b0 = data0.part.a + 1 - 1; b1 = data0.part.b + 1 - 1; b2 = data0.part.c + 1 - 1; b3 = data0.part.d + 1 - 1; data0.part.a = 0; f = data0.full + 1 -1; unsigned short G0 ; int G1 ; int G2; unsigned char G3 ; union U0 G= {(unsigned short)65532U}; G0=G.f0; G1=G.f1; G2=G.f2; G3=G.f3; } /* A structure with bitfields to access each bit. */ struct bitfield { unsigned char bit0: 1; unsigned char bit1: 1; unsigned char bit2: 1; unsigned char bit3: 1; unsigned char bit4: 1; unsigned char bit5: 1; unsigned char bit6: 1; unsigned char bit7: 1; }; /* An unsigned char with direct access to each bit. */ union bitint { unsigned char integer; struct bitfield bits; }; volatile int undet; /* Tests the bitwise interpretation of integers, according to the endianness of the machdep : we modify the bits of a bitint union, and then compute the value of the corresponding unsigned integer. */ void interpret_bits () { union bitint x; x.integer = 0; x.bits.bit3 = 1; /* {8} in little-endian, {16} in big-endian. */ unsigned char a = x.integer; x.integer = (unsigned char) -1; x.bits.bit4 = 0; /* {239} in little-endian, {247} in big-endian. */ unsigned char b = x.integer; x.integer = 0; if (undet) x.bits.bit7 = 1; /* {0; 128} in little-endian, {0; 1} in big-endian. */ unsigned char c = x.integer; x.integer = 0; if (undet) x.bits.bit0 = 1; /* {0; 1} in little-endian, {0; 128} in big-endian. */ unsigned char d = x.integer; x.integer = (unsigned char) -1; if (undet) x.bits.bit2 = 0; /* {251; 255} in little-endian, {223; 255} in big-endian. */ unsigned char e = x.integer; x.integer = 0; x.bits.bit1 = 1; if (undet) x.bits.bit3 = 1; if (undet) x.bits.bit4 = 1; if (undet) x.bits.bit5 = 1; if (undet) x.bits.bit6 = 1; /* [2..122]2%8 in little-endian, [64..94]0%2 in big-endian. */ unsigned char f = x.integer; } void main () { main0 (); interpret_bits (); } frama-c-20.0-Calcium/tests/value/enum.i0000666000000000000000000000046513571573400014614 0ustar /* run.config* GCC: STDOPT: #"-main f" */ typedef enum counter {ZERO,ONE,TWO,LAST=TWO}; int t [LAST + 1] = { 1 }; int u [TWO + 1] = { 2 }; void f(void) { int i[3]={0}; t[2] = 42; u[TWO] = 36; enum counter j=0; for(j=0;j<2;j++) i[j] = 1; enum counter k = ZERO; //@ assert k == ZERO; } frama-c-20.0-Calcium/tests/value/enum2.c0000666000000000000000000000167513571573400014674 0ustar /* run.config* GCC: STDOPT: #"-cpp-frama-c-compliant -cpp-command \"gcc -C -E -I. %1 -o %2\"" */ /* This test of enums doubles with a test of the % syntax in -cpp-command */ #define BIT_DE_SIGNE_1 (0x98765432) #define BIT_DE_SIGNE_0 (0x12345678) typedef enum { E1_MOINS1 = -1, E1_SGN1 = BIT_DE_SIGNE_1, E1_SGN0 = BIT_DE_SIGNE_0 } E1 ; E1 f(E1 x) { E1 y = x; return x; } unsigned char enum1_sgn1_positif (void) { unsigned char res = (f((E1)E1_SGN1)) > 0; Frama_C_show_each_enum1_sgn1_positif(res); return res; /* WARN : ppc->0 ; gcc->1 */ } unsigned char enum1_sgn1_inf_sgn0 (void) { unsigned char res = E1_SGN1 < E1_SGN0; Frama_C_show_each_enum1_sgn1_inf_sgn0(res); return res; /* WARN : ppc->1 ; gcc->0 */ } unsigned char must_be_one, must_be_zero; int main (void) { int res = sizeof (E1); must_be_zero = enum1_sgn1_inf_sgn0(); must_be_one = enum1_sgn1_positif(); Frama_C_show_each_sizeof_enum1(res); return res; } frama-c-20.0-Calcium/tests/value/equality.c0000666000000000000000000000304113571573400015470 0ustar /* run.config* STDOPT: +"-eva-equality-domain -eva-warn-copy-indeterminate=-assign_by_copy" */ /* Tests for the equality domain. */ #include <__fc_builtin.h> volatile int rand; /* Tests the replacement of an lvalue x by an equal term when x also appears in another term t equal to x. The precision gain is useless in these cases, but the domain nust not crash or be unsound: x cannot be replaced by t. */ void replace_lvalue () { int x = rand; int y = x; int z = 0; /* Tests if x is even in a way that the backward propagation fails to reduce x. */ if (x == x/2 + x/2) { /* Replaces x by y (and not by x/2 + x/2) in the equality domain. */ x = 0; /* After the test, the equality could further reduce y to [-8..8]. */ if (-10 < y && y < 10) { /* A temporary variable is needed to avoid a cycle in the evaluations: when evaluating y, the oracle for y/2+y/2 is top (as y has not been evaluated yet). */ int tmp = y; z = tmp; } } } /* Tests the equality domain on assignments by copy of indeterminate values. These indeterminate values must not be reduced when using the equalities. */ void assign_by_copy () { int x; if (rand) x = Frama_C_interval(0, 42); int y = x; // x may be not initialized but is copied, so no alarm int w = y; /* the equality {y = x} could be used, but x must not be reduced x and y may be not initialized. */ int z = x + 1; // x may still be not initialized: alarm } void main () { replace_lvalue (); assign_by_copy (); } frama-c-20.0-Calcium/tests/value/eval_separated.c0000666000000000000000000000242413571573400016616 0ustar int x, y, t1[6], t2[6]; void main (int c1, int c2) { int *p, *q, *r; //@ assert !\separated(&x, &x); //@ assert \separated(&x, &y); //@ assert !\separated(&x+2, &x+2); //@ assert \separated(&x+2, &x+3); q = (int)&q+ (int)&q; r = (int)&r+ (int)&r; //@ assert !\separated(q, q); //@ assert \separated(q, q+2); //@ assert \separated(q, r); //@ assert !\separated(&t1[1-1],&t1[0]); //@ assert !\separated(&t1, &t1); //@ assert !\separated(&t1[0]+(0..0), &t1[0]); //@ assert \separated(&t1[0]+(0.. -1), &t1[0]); //@ assert !\separated(&t1[0]+2, &t1[0]+2); //@ assert \separated(&t1[0]+2, &t1[0]+3); //@ assert \separated(&t1[0], &t2[0]); // first cells are separated //@ assert \separated(&t1, &t2); // all arrays are separated //@ assert \separated(&t1[0], &t1[1]); //@ assert \separated(&t1[0]+(0..3), &t1[0]+(4..5)); //@ assert !\separated(&t1[0]+(0..3), &t1[0]+(3..5)); //@ assert \separated(&t1[c1], &t2[c1]); p= &x; //@ assert !\separated(&x, p); p = &t1[c1]; //@ assert \separated(p, &t2[c2]); if (c1 >= 0 && c1 <= 3 && c2 >= 3 && c2 <= 4) { //@ assert \separated(&t1[c1], &t1[c2+1]); //@ assert \separated(&t1[c1], &t1[c2]); // Really unknown //@ assert \separated(&t1[c1], &t1[c1+1]); // Unknown by imprecision } } frama-c-20.0-Calcium/tests/value/exit_paths.i0000666000000000000000000000252313571573400016015 0ustar /* run.config* STDOPT: +"-wlevel 1" */ #include "__fc_builtin.h" int test1(int n) { int i = 0; while (1) { Frama_C_show_each_1("On exit path", i); if (i >= n) { Frama_C_show_each_2("On exit path", i); return i; } Frama_C_show_each_3("Not on exit path", i); i++; } } int test2(int n) { int i = 0; while (1) { Frama_C_show_each_4("On exit path", i); int j = 0; while (1) { Frama_C_show_each_5("On exit path", i, j); if (j >= n) { Frama_C_show_each_6("Not on exit path", i, j); break; } if (i + j >= 2 * n) { Frama_C_show_each_7("On exit path", i, j); return i; } Frama_C_show_each_8("Not on exit path", i, j); j++; } Frama_C_show_each_9("Not on exit path", i); i++; } } int test3(int n) { int i = 0; while (1) { Frama_C_show_each_10("On exit path", i); int j = 0; while (1) { Frama_C_show_each_11("On exit path", i, j); if (j >= n) { Frama_C_show_each_12("On exit path", i, j); break; } Frama_C_show_each_13("On exit path", i, j); j++; } if (i >= n) { Frama_C_show_each_14("On exit path", i); return i; } Frama_C_show_each_15("Not on exit path", i); i++; } } void main(void) { test1(10); test2(10); test3(10); } frama-c-20.0-Calcium/tests/value/extern.i0000666000000000000000000000046513571573400015155 0ustar extern int T1; extern const int T2; int* pT2 = (int *) &T2; extern int T3[]; extern const int T4[]; extern int T5[3]; extern const int T6[3]; volatile int c; extern struct fma { char nb; int t[]; } s; void main () { if (c) T1= T3[3]; if (c) *pT2= T4[3]; T1= T5[1]; *pT2= T6[1]; s.nb = 1; } frama-c-20.0-Calcium/tests/value/f1.i0000666000000000000000000000007113571573400014147 0ustar extern int f(int x); void main() { f(5); return; } frama-c-20.0-Calcium/tests/value/f2.i0000666000000000000000000000022413571573400014150 0ustar /* run.config* GCC: STDOPT: #"-main f" */ int f(int x) { /* Here we are */ /*@ loop pragma UNROLL 10; */ while(1) { return 0 ;} return 2; } frama-c-20.0-Calcium/tests/value/false.i0000666000000000000000000000044113571573400014734 0ustar /* run.config* STDOPT: +"-eva-verbose 2" */ /*@ requires i == 1; requires i == 1; requires i == 1; */ void f (int i); /*@ ensures \result == 1; ensures \result == 1; */ int g (int i) { return i; } void main (int bla, int bli) { int i=0; if (bla) f(i); if (bli) g(i); } frama-c-20.0-Calcium/tests/value/fam_sizeof.i0000666000000000000000000000151413571573400015766 0ustar // Tests related to flexible array members struct { int len; char a[]; } fam; struct _nested { int level1; struct _s1 { int level2; struct _s2 { int level3; struct _s3 { int level4; int another4; } s3; } s2; } s1; } nested; typedef struct { int len; struct { int len2; char d[3]; } not_a_fam; } not_fam2; struct { int len; not_fam2 n; not_fam2 n2[]; } fam2; // GCC-style FAMs allow operator sizeof, which must return 0 struct { int len; char fam[0]; } gcc_fam; int main() { unsigned long z1 = sizeof(fam); //@assert z1 == sizeof(int); unsigned long z2 = sizeof(nested); unsigned long z3 = sizeof(not_fam2); unsigned long z4 = sizeof(fam2); //@assert z4 == sizeof(int) + sizeof(not_fam2); unsigned z5 = sizeof(gcc_fam.fam); //@assert z5 == 0; return 0; } frama-c-20.0-Calcium/tests/value/find_ivaltop.i0000666000000000000000000000024113571573400016316 0ustar int t[20]={1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0}; int main(void) { int i,j=0,X=0; for (i=0;i<8;i++) j=i; if (j<=7) X=j; X=t[X]; return X; } frama-c-20.0-Calcium/tests/value/folding.i0000666000000000000000000000067613571573400015276 0ustar int f(int x) {return x;}; int g() { int (*pfct)(int) = &f; int un = 1; int *p =&un; int deux = 1+un; int trois ; p = &deux; trois = *p+*p+un; return (*pfct)(trois); } int foo(int x, int y) { volatile int unknown=0; if (unknown) return y+2; return x+3; } int main () { int a,b,c; g(); a = foo(5,7) + foo(6,777); b = 4; c = b * b +a; if (b > c) return b-c; else return b+c; } frama-c-20.0-Calcium/tests/value/for_loops.c0000666000000000000000000000225613571573400015644 0ustar /* run.config* STDOPT: STDOPT: +"-main main_2" STDOPT: +"-main main_3" STDOPT: +"-main main_4" */ #include "__fc_builtin.h" int x; void main_2 () { int i,j; int nSelectors = Frama_C_interval(0,100); int w=0,v = 0; for (j = 0; j < nSelectors; j++) { if (Frama_C_interval(0,1)) w += 1; Frama_C_show_each_F(w);} // w widens to top_int } void main () { int i,j; int nSelectors = Frama_C_interval(0,0x7FFFFFFF); int w=0,v = 0; for (j = 0; j <= nSelectors; j++) { v = j ; while (v>0) v--; Frama_C_show_each_F(j);} } void main_3 () { int j; int T[1000]; int nSelectors = Frama_C_interval(0,1000); int w=0; Frama_C_dump_each(); for (j = 0; j < nSelectors; j++) T[j] = 1; Frama_C_dump_each(); for (j = 0; j < nSelectors; j++) w += T[j]; Frama_C_show_each(w); } void main_4 () { int j = 0; int v = 0; while(j <= 5) { v = j; while (v < j+10 && v > 0) { v++; } Frama_C_show_each_F(j,v); // Check that the propagation strategy is "not too bad": if possible, without slevel, propagate the result of the loop plus the case where the loop condition never hold together. j ++; } } frama-c-20.0-Calcium/tests/value/forall.i0000666000000000000000000000062413571573400015124 0ustar /* run.config* STDOPT: +"-inout" */ int t[10]; extern int j; //@ requires 0 <= j < 10; void main() { //@ assert \forall int i; 0 <= i <= 9 ==> t[i] == 0; //@ assert \forall integer i; 0 <= i <= 9 ==> t[i] == 0; //@ assert !(\exists int i; 0 <= i <= 9 && t[i] == 1); t[1] = 2; //@ assert !(\forall int i; 0 <= i <= 9 ==> t[i] == 0); //@ assert \exists int i; 0 <= i <= 9 && t[i] == 2; } frama-c-20.0-Calcium/tests/value/fptr.i0000666000000000000000000000243513571573400014622 0ustar /* run.config* GCC: OPT: -no-autoload-plugins -load-module from,inout,eva -eva @EVA_CONFIG@ -journal-disable -then -deps -out OPT: -no-autoload-plugins -load-module from,inout,eva -eva @EVA_CONFIG@ -main main_uninit -journal-disable -then -deps -out */ int R=77; volatile int v; int n; int f(int (ptr(int x)), int i) { n=i; R = ptr(1); return R; } int X=77,XH=0,XHH=0; int h (int y) {X = y; XH= y; return X;} ; int hh (int y) {X = y+y; XHH = y; return X;} ; extern int hhh(int y); typedef int (* PTR_FCT)(int); typedef PTR_FCT TYPE[10]; TYPE GLOBAL; int G; short retshort(void) { return 12; } int retint(void) { return 42; } int TA; void main (int c) { int in, pin; short sh, psh; if (c&1) in = retshort(); if (c&2) sh = retint(); if (c&4) pin = (*((int (*)())retshort))(); if (c&8) psh = (*((short (*)())retint))(); int i=0; GLOBAL[0] = h; GLOBAL[1] = hh; for(i=0;i<3;i++) { Frama_C_show_each_F(GLOBAL[i]); if (v) { G=f(GLOBAL[i], i+1); Frama_C_show_each(i); /* i==2 is impossible */} } PTR_FCT p = (c&16) ? &h : &hh; if (c&32) TA=(*p)(1/(c&64)); } void main_uninit (int c) { int i=0; volatile int j=0; GLOBAL[2]=j; GLOBAL[0] = h; GLOBAL[1] = hh; for(i=0;i<3;i++) { Frama_C_show_each_F(GLOBAL[i]); G=f(GLOBAL[i],i); } } frama-c-20.0-Calcium/tests/value/from1.i0000666000000000000000000000037313571573400014672 0ustar int G; int cx,cy,cz,sx,sy,s; struct Tstr { int a; int b; }; void f(void) { cy = cx; } int sf (struct Tstr * ps) { return ps->a; } int main(int x,int y) { struct Tstr s = {sx, sy}; if (x) G=y; cx = cz; f(); return sf(&s); } frama-c-20.0-Calcium/tests/value/from_call.i0000666000000000000000000000267713571573400015615 0ustar /* run.config* OPT: -no-autoload-plugins -load-module from,inout,users,eva -calldeps -eva @EVA_CONFIG@ -journal-disable -users -then -input OPT: -no-autoload-plugins -load-module from,eva @EVA_CONFIG@ -deps -show-indirect-deps -journal-disable */ int a,b,c,d; int x,y,z,t; int g(int w) { return w + t; } int h(int); int f(int *p) { static int * previous = &a; *p = *previous; previous = p; return g(h(x)+*p); } int A1,A2,A3,A4,A5,A6,A7,A8; int R1,R2,R3,S1,S2,S3; int T0,T1,T2; int dispatcher(int c, int y, int z, int x) { return c ? y : z; } int return_A1(void) { return A1; } int return_A2(void) { return A2; } int dispatcher2(int c) { return c ? return_A1() : return_A2(); } int call_dispatcher2_1(void) { return dispatcher2(1); } int call_dispatcher2_0(void) { return dispatcher2(0); } int call_dispatcher2(int r) { return dispatcher2(r); } int tab[5]; int access_tab(int ind) { return tab[ind]; } int AA,AR,AS; int At[2]={(int)&AA}; int Ar[2]={(int)&AA}; int *Ap=At; /*@ assigns AR \from Ap[..] ; assigns AS \from Ar[..] ; */ void unavailable_f(void); void main(int r) { y = f(&b); z = f(&c) + f(&d); R1 = dispatcher(1,A1,A2,A3); R2 = dispatcher(0,A3,A4,A6); R3 = dispatcher(r,A4,A5,A7); S1 = call_dispatcher2_1(); S2 = call_dispatcher2_0(); S3 = call_dispatcher2(r); tab[0]=A1; tab[1]=A2+A3; tab[2]=A4; T0 = access_tab(0); T1 = access_tab(1); T2 = access_tab(2); unavailable_f(); } frama-c-20.0-Calcium/tests/value/from_global.i0000666000000000000000000000016013571573400016123 0ustar int A,B,C,D,E; int f(int x) { B = A; C = x; return C; } int main(void) { A = D; f(E); return 0; } frama-c-20.0-Calcium/tests/value/from_ind.i0000666000000000000000000000016613571573400015443 0ustar /* run.config* STDOPT: +"-show-indirect-deps" */ int a[4]; int *p = a; int r; int main(void) { r = *(p + 1); } frama-c-20.0-Calcium/tests/value/from_pb.i0000666000000000000000000000174013571573400015271 0ustar /* run.config* GCC: STDOPT: #"-main main0" STDOPT: #"-main main1" STDOPT: #"-main main2" STDOPT: #"-main main3" STDOPT: #"-main main4" STDOPT: #"-main main4bis" STDOPT: #"-main main5" STDOPT: #"-main main5bis" */ int k,i,j,x,c,d,T[10]; void main0(){ if (j) {if (c) x=i; else x=d;} else x=k; } void main1(){ if (j) {if (c) T[0]=i; else T[1]=d;} else x=k; } void main2(){ if (j) {if (c) ((int*)((char*)T+1))[0]=i; else T[1]=d;} else x=k; } void main3(){ int* p = ((int*)((char*)T+1)); if (c) { p[0]=i; p[1]=d;} else T[1] = x; } void main4() { if (c) { T[0]=i; T[2]=j; } else { T[0]=k; } } void main4bis() { if (c) { T[0]=k; } else { T[0]=i; T[2]=j; } } void main5() { if (c) { T[0]=i; T[1]=j; } else { T[0]=k; } } void main5bis() { if (c) { T[0]=k; } else { T[0]=i; T[1]=j; } } frama-c-20.0-Calcium/tests/value/from_ptr.i0000666000000000000000000000100713571573400015471 0ustar /* run.config* GCC: STDOPT: #"-main main" STDOPT: #"-main main1" */ long i,j,x,k,l,m,n,d,a,b; int p[10][10][10]={0}; long *q; void main(int c) { i = (long) &p[11]; i = (long) &p[10]; if (c) // This branch is assumed to be dead since "i" is an invalid pointer. *((int*)i) = a; q = c ? &a : &b ; // So, "q" points only on "b". d = *q; // "d" is only from "a" and "c". } void main1(int c) { i = (long) &p[1]; i = (long) &p[0]; if (c) *((int*)i) = a; q = c ? &a : &b ; d = *q; } frama-c-20.0-Calcium/tests/value/from_ptr2.i0000666000000000000000000000027613571573400015562 0ustar struct Tstr { int a; int b; }; int f (struct Tstr * ps) { return ps->a; } int main (int x, int y) { struct Tstr s = {x, y}; return f(&s); } /* Function main: \result FROM s.a; */ frama-c-20.0-Calcium/tests/value/from_res_2.i0000666000000000000000000000070613571573400015703 0ustar typedef unsigned char T; // typedef int T; int G; T f (int left, int right ) { return left + right; } int A, B, C; struct S { int a; int b; int c;} x1, x2, x3, y1, y2, y3; struct S g1(void){ return x1; } struct S g2(void){ return x2; } struct S g3(void){ return x3; } void main (void) { int * p = &G; *p = f (G, 3); x1.a = A; x1.c = C; y1 = g1(); x2.a = A; x2.b = B; y2 = g2(); x3.b = B; x3.c = C; y3 = g3(); } frama-c-20.0-Calcium/tests/value/from_termin.i0000666000000000000000000000012313571573400016160 0ustar int b,c,d,e; void main(int a) { if (a) b = c; else while (1) d = e; } frama-c-20.0-Calcium/tests/value/fun_ptr.i0000666000000000000000000000257613571573400015332 0ustar /* run.config* STDOPT: STDOPT: +"-machdep msvc_x86_64" */ int f(int x) { return x+1; } int g(int x, int y) { return x+y; } typedef int (*fptr1)(int); typedef int (*fptr2)(int, int); typedef double (*fptr3)(int); long long t[2] = { (long long)&f, (long long)&g }; int R1, R2; double R3; void test1(int nd) { R1 = ((fptr1)(t[nd]))(3); } void test2(int nd) { R2 = ((fptr2)(t[nd]))(3, 4); } void test3(int nd) { R3 = ((fptr3)(t[nd]))(5); } double h(short a, short b) { return a + b; } volatile int v; void benign(int j, void *p) { int *q = p; *q = j; // q is a void*, which is actually an int, but at the call site it is a short *. We accept this for now. int k = j+0; } void test_benign () { int x; void (*p) (long, short *) = &benign; // We accept this cast, because the arguments are "compatible enough". An (unprovable) alarm is still emitted (*p)(1U << 31U, &x); } void too_much(int i) { int j = i; } void too_much2(int i, int j, int k) { int l = i+j+k; } void test_too_much_benign () { int x; void (*p) () = &too_much; (*p)(1, 2); // Accepted (with an alarm) if (v) { p = &too_much2; (*p)(1, 2); // Failure } } int main(){ test1(!v); test2(!v); if (v) test3(!v); double (*ph)() = h; if (v) ph(1., 2.); if (v) ph(); if (v) ph((short)1, (short)2); test_benign(); test_too_much_benign(); return 0; } frama-c-20.0-Calcium/tests/value/function_return_serial_casts.i0000666000000000000000000000034413571573400021624 0ustar short x = -10; int y, z, t; unsigned short f(void) { return x; } unsigned short g(void) { unsigned short l = *(unsigned short*)&x; return l; } int main(){ y = *(unsigned short*)&x; z = f(); t = g(); return 0; } frama-c-20.0-Calcium/tests/value/g1.i0000666000000000000000000000004113571573400014145 0ustar extern int G = 1; void main (){} frama-c-20.0-Calcium/tests/value/garbled_init.c0000666000000000000000000000021413571573400016255 0ustar #define BAR ((unsigned long)0xFFFFF000000) int PTR; unsigned long G = (unsigned long)&PTR - BAR; void main () { *((int*)(G+BAR)) = 1; } frama-c-20.0-Calcium/tests/value/gauges.c0000666000000000000000000001455313571573400015120 0ustar /* run.config* STDOPT: +" -slevel-function main8_aux:2,main5_bis:4 -eva-msg-key d-gauges" */ #include volatile v; void main0() { int i = 1; int j = 2; int k = 3; int l = 4; while (k <= 100) { i = 0; while (i <= 160) { Frama_C_show_each_0("in"); if (! (i <= 160)) break; // exit condition depends only on one loop Frama_C_show_each_1("in"); i += 3; j -= 4; } k += 2; l += 1; } } void main0_bis() { int i = 1; int j = 2; int k = 3; int l = 4; while (k <= 100) { // i = 0; while (i <= 160) { Frama_C_show_each_0("in"); if (! (i <= 160)) break; // exit condition depens on two loops Frama_C_show_each_1("in"); i += 3; j -= 4; } k += 2; l += 1; } } int t[38]; void main1() { int j = 5; for (int i = 0; i<50; i+=3) { t[j] = i; Frama_C_show_each("in"); j+= 2; } Frama_C_show_each("out"); } int u[100]; void main2() { int *p = u; for (int i = 100; i>0; i--) { *(p++) = i; Frama_C_show_each(); } } void main3() { int k = 0; for (int i = 0; i <15; i++) { for (int j = 0; j < 25; j++) { Frama_C_show_each("inner"); k++; } Frama_C_show_each("outer"); k ++; } Frama_C_show_each(k); } extern int T[100]; long main4_search() { long c; long i; c = ( long)0; i = ( long)0; while (i < ( long)21) { Frama_C_show_each(); if (T[i] == ( int)0x3000) { c ++; } i ++; } return c; } void main4 () { long i = main4_search(); } void main5() { // This test checks what happens when a pointer changes base int x[10], y[10]; int *p = x; for (int i = 0; i<10; i++) { if (i == 3) p = y; Frama_C_show_each(p); *p = i; p++; } p = p; } void main5_bis() { // identical to main5, but partly unrolled. In this case, we can infer something on the last iterations, and remain precise int x[10], y[10]; int *p = x; for (int i = 0; i<10; i++) { if (i == 3) p = y; Frama_C_show_each(p); *p = i; p++; } p = p; } void main6() { int i = 0, j = 0; while (i <= 12) { i++; j++; } } void main7_aux (unsigned int toCopy) { Frama_C_show_each(); int *p = &T[99]; while( toCopy-- > (0u) ) { *p-- = 1; // Currently, alarm, because we lose information on toCopy because of the underflow on the last iteration, and then on toCopy } } void main7_aux2 (signed int toCopy) { Frama_C_show_each(); int *p = &T[99]; while( toCopy-- > 0 ) { *p-- = 1; // No pointer alarm, but underflow on toCopy above } } void main7() { unsigned int toCopy = 100U; main7_aux(toCopy); main7_aux2(toCopy); } void main8_aux (unsigned int n) { int arr[65536]; int *p = arr; do { Frama_C_show_each(n); *p++ = n; // Invalid access memory if more than 65536 iterations. } while (--n); } void main8() { if (v) main8_aux(0); // This call can legitimately lead to bottom. } void main9() { int x[10], y[10]; int *p = x; int *q = y; int z; for (int i=0; i<10; i++) { if (i >= 3) { z = (int)p + (int)q; // Do not build gauges with multiple variables int *r = z; *r = 1; } *p = i; *q = -i; p++; q++; } } float main10_aux(float* p, const float* A, const float* B, int n) { int numNonZero = n - 1; while (numNonZero-- > 0) { // Works only with '> 0', the orinal code was 'numNonZero--' only. Also, underflow on numNonZero. In both cases, we need to stop at 0 *p *= (*A++) * (*B++); // Requires very powerful relations no to overflo on floating-point values here... } return *p; } int main10() { float p = 1; float A[10] = {1}; float B[10] = {2}; return (int)main10_aux(&p, A, B, 10); } void main11 () { int n = 100; int i = 0; do { Frama_C_show_each(); i++; } while(n-- > 0); } void main12() { int i, j; for (i=0, j=0; j<10 ; i++) { // Exit condition depends on j, which is incremented randomly. Nothing can be derived for the lower bound of i; if (v) j++; } i = i; j = j; } /* functions main13_* test the backward propagation when the exit condition does not correspond to an integral number of iterations */ void main13_1() { int i = (v ? 5 : 6); int j = 0; while (i <= 44) { // 6 iterations, regardless of the initial value of i i += 7; j += 1; } Frama_C_show_each(i, j); } void main13_2() { int i = (v ? 5 : 6); int j = 0; while (i <= 47) { // 6 or 7 iterations, depending on i i += 7; j += 1; } // We obtain an interval for i, but only two values are really possible Frama_C_show_each(i, j); } void main13_3() { int i = (v ? 5 : 6); int j = 0; while (i >= -52) { i -= 7; j += 1; } Frama_C_show_each(i, j); } void main13_4() { int i = (v ? 5 : 6); int j = 0; while (i >= -57) { i -= 7; j += 1; } Frama_C_show_each(i, j); } void main13 () { main13_1(); main13_2(); main13_3(); main13_4(); } void main14() { int i = 5; int s = v ? 5:6; int j = 0; while (i >= -587) { i -= s; j += 1; //@ slevel merge; ; } Frama_C_show_each(i, j); } void main15 () { int x, y; int *p = &x; int i = 0; while(i <= 10) { i++; Frama_C_dump_each(); // After the first iteration, nothing should be known on p p = &y; } } void main16() { /* Bug found by Csmith. Widening was incorrectly implemented, and returned false results when a pointer points to multiple bases in multiple iterations. Nested loops were probably needed for the bug to manifest itself. */ int a = 1; int b = 1; int *p = &a; L1: // This is a loop head b = 0; while (b < 1) { int i; for (i = 0; i < 3; i++); for (i = 0; i < 2; i++); Frama_C_dump_each(); for (i = 0; i < 1; i++); while (i < 3) { if (*p) { p = &b; goto L1; } else return; } } } /* Tests the gauges domain when a base becomes weak, possibly breaking the invariant that the domain only uses pointers on a single base address. */ void main17 () { int x, *q; int *p = &x; while (1) { q = malloc(sizeof(int)); if (!q) return; p = q; } } void main() { main0(); main0_bis(); main1(); main2(); main3(); main4(); main5(); main5_bis(); main6(); main7(); main8(); main9(); main10(); main11(); main12(); main13(); main14(); main15(); main16(); main17(); } frama-c-20.0-Calcium/tests/value/ghost.i0000666000000000000000000000072113571573400014767 0ustar /* Commentaire avant G */ /* Commentaire avant G2 */ int G; /* Commentaire apres G avant main */ /*@ ghost int GHOST ; */ int main () { /* Commentaire apres main */ int i; /* Commentaire apres int i */ G = 0; /*@ghost GHOST=G+G ; */ /* Commentaire avant loop */ /*@ loop pragma UNROLL 0; */ for(i=0; i<=10; i++) G++; // AVANT j {int /* milieu j*/ j; j = /* milieu j 2*/ 0; } // APRES j return i; } /* ICI avant H */ int H; /* ICI après H */ frama-c-20.0-Calcium/tests/value/global_bug.i0000666000000000000000000000024313571573400015737 0ustar /* run.config* STDOPT: +"-load-module report -then -report" */ int i = 1; int G[2] = {99<<63, 1}; int j = 2; int main () { G[1] ++; return (i == j); } frama-c-20.0-Calcium/tests/value/goto.i0000666000000000000000000000014213571573400014610 0ustar int stop () { L: goto L; } int main() { volatile int c=0; c = c?1:0; if (c) stop (); } frama-c-20.0-Calcium/tests/value/hierarchical_convergence.c0000666000000000000000000000043613571573400020634 0ustar /* run.config* STDOPT: +" -eva-hierarchical-convergence" */ int f(int n) { int i, j; for (i = 0 ; i < n ; i++) { Frama_C_show_each(i); for (j = 0 ; j < i ; j++) { Frama_C_show_each(i,j); // Nothing } } return i * j; } void main(void) { f(100); } frama-c-20.0-Calcium/tests/value/if.i0000666000000000000000000000177613571573400014254 0ustar /* run.config* GCC: STDOPT: #"-main main" STDOPT: +"-no-input -no-out -main main6" */ int G,H,J; int *p, *q; int t[100]; int main0(void) { G=0; int c = 0; if (c) G=1; else G=2; return c; } int main1(void) { if (G) ; return 1; } int main2(void) { int c = c?0:(c?1:2); int d = c?1:(c?2:3); G = -20; H = -30; if (c) {G=c; H=d;}; // if (d>c) G=3; else G=4; // if (!(d<=c)) G=3; else G=4; return c; } int main3(void){ G=0; H=1; p = &G; q = &H; // if (p==q) *p=2; return *q; } int main4(void) { int e1,e2; int c = e1?0:((e2)?1:2); int d = e1?1:((e2)?2:3); G = 20; H = 30; if (d= &t[10]) && (p <= &t[99])) q = p; } void def(void) { if (J) G = H; } int main5(void) { G = 0; if (G) H=J; return 1; } int main6(int c, int d) { G = 0; if (G) if (d) G=2; else G = 1; // G isn't modified return 1; } frama-c-20.0-Calcium/tests/value/if2.i0000666000000000000000000000142013571573400014320 0ustar /* run.config* STDOPT: #"-print " */ typedef enum { E1 = 0, E2 = 0x0001, E3 = 0x0002, E4 = 0x0004, E5 = 0x0008, E6 = 0x0010, E7 = 0x0020 } T1_t; static T1_t G1; T1_t G2 = E1; int G3 = 75, G4; int R; volatile v; enum Bool { FALSE = 0, TRUE = 2 }; void main(void) { if (E6 == G1) { G2 = G1; } if (0 == G4) { G3 = G4; } if (v) if (E1) { R = 5; } else { R = 6; } if (v) if (!E1) { R = 6; } else { R = 5; } if (v) if (E5) { R = 7; } else { R = 5; } if (v) if (!E5) { R = 5; } else { R = 7; } enum Bool b; b = FALSE; if (!b) R += !b; b = TRUE; if (b) R += b; b = 1; if (b) R += b; return; } frama-c-20.0-Calcium/tests/value/ilevel.i0000666000000000000000000000125713571573400015130 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,slicing,sparecode,eva -eva @EVA_CONFIG@ -slice-return main -then-on "Slicing export" -eva -eva-ilevel 16 -eva-show-progress -then-on "default" -eva-ilevel 17 -then -eva-ilevel 48 */ // Test in particular that ilevel is by-project, even though it is an ocaml ref volatile int v; int i, j, k, l; int main () { do { i = v; } while (! (0 <= i && i < 8)); do { j = v; } while (! (0 <= j && j < 17)); k = j; if (k == 16) k = 15; l = v; if (v) { //@ assert 0 <= l <= 4; } else { //@ assert 6 <= l <= 9; } Frama_C_show_each(l); // Possible problem with cache on offsetmap join return i+j+k+l; } frama-c-20.0-Calcium/tests/value/implies.i0000666000000000000000000000021413571573400015302 0ustar int A,B; int main(int c, int d) { A = !!d; /*@ assert ((A ==> \false) ==> \false); */ /*@ assert c ==> \false; */ return 1 + c; }frama-c-20.0-Calcium/tests/value/imprecise_invalid_write.i0000666000000000000000000000045613571573400020550 0ustar int x; int main1(int c) { *(int*)c = x; } int main2() { void *p = &main1 + (int)&main1; *((int *)p) = 1; } int *s = "abc"; int main3() { int *p = s+(int)s; *p = 1; } void main(int c) { if (c & 17) { main1(c); } if (c & 19) { main2(); } if (c & 21) { main3(); } } frama-c-20.0-Calcium/tests/value/incompatible_states.c0000666000000000000000000000416613571573400017675 0ustar /* run.config* STDOPT: #"-eva-subdivide-non-linear 10" */ /* This file gathers some examples where a product of states may have no concretization (if the domains have inferred incompatible properties) without being bottom (if the inter-reduction between domains are insufficient to prove the incompatibility). The bottom could come from a bottom value, or from inconsistent statuses emitted for the same alarm. In both cases, an evaluation can lead to bottom without any alarm. The analysis should not crash on such cases, but they should be reported to the user, as they could also reveal a bug in some domains. */ #include "__fc_builtin.h" /* Exhibits incompatible states between the cvalue and the equality domains. Based on the absence of precise backward propagation for x*x. */ void main1 () { int x = Frama_C_interval(0, 10); int y = x * x; int z = -1; if (y < 9) { if (x > 2) z = x * x; /* Incompatible states, revealed by the evaluation of x*x. */ else z = -2; } else z = -3; } /* Exhibits incompatible states between the cvalue and the equality domain. Relies on the absence of precise backward propagation for 2*i. */ int main2 () { int t[2]; int i = Frama_C_interval(0, 1); t[0] = i; int x = t[(2*i)/2]; int y = -1; if (i > 0) y = t[(2*i)/2]; /* Incompatible states, revealed by inconsistent statuses on the alarm for index bounds. */ return y; } /* Exhibits incompatible states between the cvalue and the symbolic location domains during a subdivided evaluation: some subdivisions are indeed unreachable. This tests deeply relies on the strategy chosen to subdivide. */ void main3() { int t[10] = {1, 2, 3, 4, 5, 0, 6, 7, 8, 9}; int i = Frama_C_interval(0, 9); int x = i / t[i]; int y = i / t[i]; /* Due to the previous line, i=5 is impossible; the alarm will get inconsistent statuses during the subdivision, and should no longer appear for the complete evaluation with the symbolic locations domain. */ } void main () { main1(); main2(); main3(); } frama-c-20.0-Calcium/tests/value/incorrect_reduce_expr.i0000666000000000000000000000034513571573400020222 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -absolute-valid-range 32-36 */ char t[5]; int *p; int x; void main(int c) { x = 13; p = (int*)32; if (c) p+=1; *(char*)p = 13; } frama-c-20.0-Calcium/tests/value/ineq.c0000666000000000000000000000075613571573400014601 0ustar int any_int(void); int G[10] ={0}; int g=0,h=0,i=0,j=0,k=1,l=1,m=-1,n=-1; void main () { int x; x = any_int(); if (0 <= x) { g = x; } if (0 >= x) { h =x; } if (x >= 0) { i =x; } if (x <= 0) { j =x; } if (0 < x) { k =x; } if (0 > x) { m =x; } if (x > 0) { l =x; } if (x < 0) { n =x; } G[0] = 0; if ((0 <= x) && (5 >= x)) G[0] = 7; } frama-c-20.0-Calcium/tests/value/infinite.i0000666000000000000000000000025613571573400015453 0ustar int G; void pause(int); void main () { int count; G++; if (G==1) while(1) { G++; if(G==5) break; pause(3); G--; }; G=0; return; } frama-c-20.0-Calcium/tests/value/init.i0000666000000000000000000000072513571573400014612 0ustar /* run.config* STDOPT: #"-eva-initialization-padding-globals yes" STDOPT: #"-eva-initialization-padding-globals no" */ const char S[5] = "12345"; struct t1 { int x; int y; int name[10];} v1; struct t1 TS[29] = {1,3,01234570110}; struct t2 { int x2; short int y2; char *ptr;} v2; char C; char PC[]= "lkjlj"; struct t2 T2[50] = {{1,2,&PC[0]},{1,2,0}}; int T[10] = {1,0}; int U[] = {3,4}; int x = sizeof(U); int y = sizeof(T); int main (void) { return sizeof(U); } frama-c-20.0-Calcium/tests/value/init_const_guard.i0000666000000000000000000000113713571573400017200 0ustar /*run.config* STDOPT: +"-load-module report -main f -report -then -main g -then -lib-entry -main f -then -main g" */ /** Same test exists in WP tests. Please keep synchronized */ int x ; int * const q = &x ; const int * p = &x ; /*@ ensures Const: q == &x ; ensures Pointed_Valid: \valid(q); ensures Q_ReadOnly: \valid_read(&q); ensures Q_NotWrite: !\valid(&q); */ int f(void) { return 0; } volatile v; /*@ ensures P_not_Const: \valid(&p); */ void g(void) { p = &x ; //@ assert Read: \valid_read(p); //@ assert Guard_against_Const: !\valid(p); if (v) *((int *)p) = 2 ; } frama-c-20.0-Calcium/tests/value/initialized.c0000666000000000000000000001005213571573400016140 0ustar /* run.config* STDOPT: #"-big-ints-hex 257 -eva-warn-copy-indeterminate=-g6" */ #include "__fc_builtin.h" extern int b1, b2, b3, b4, b5, b6; //@ ensures \initialized(&t[1..n-2]); void f(int m, int* t, int n) { if (m) for (int i=1;ia, p->b \from \nothing; ensures \initialized(p); */ // Wrong because of padding void wrong_assigns(struct s *p); struct v { char a; char b; }; struct v v1; void g5() { struct s v; if (rand) wrong_assigns(&v); struct v v2; //@ assert \initialized(&v1); //@ assert !\initialized(&v2); struct v *p = rand ? &v1 : &v2; //@ assert \initialized(p); } extern int i6; void g6() { int i; if (rand) i6 = i; // warn-copy-indeterminate is not set //@ assert !\initialized(&i6) || i6 >= 3; // Does not work //@ assert !\initialized(&i6) || i6 >= 3; //@ assert !\initialized(&i6) || (\initialized(&i6) && i6 >= 3); //@ assert !\initialized(&i6) || (\initialized(&i6) && i6 >= 3); //@ assert !\initialized(&i6); //@ assert !\initialized(&i6); } void g7() { unsigned char key[128]; Frama_C_make_unknown((char*)key, 64); //@ assert !\initialized(&key[0..127]); } /* Tests the reduction by the negation of the \initialized predicate. */ void reduce_by_negation () { int x, y; int *p = rand ? &x : &y; if (rand) x = 0; if (rand) y = 0; if (rand) { //@ assert !\initialized(&x); //@ check invalid: \initialized(&x); } if (rand) { //@ assert !\initialized(p); //@ check unknown: \initialized(&x) && \initialized(&y); } if (rand) { //@ assert !\initialized({&x, &y}); //@ check unknown: \initialized(&x) && \initialized(&y); } if (rand) { y = 0; //@ assert !\initialized(p); //@ check unknown: \initialized(&x); } if (rand) { y = 0; //@ assert !\initialized({&x, &y}); //@ check invalid: \initialized(&x); } char t[10]; for (int i = 0; i < 10; i++) t[i] = i; //@ assert !\initialized(&t[0..9]); //@ check unknown: \initialized(&t[0..9]); } int main () { g1(); g2(); g3(); if (rand) g4(); g5(); g6(); g7(); reduce_by_negation(); return 0; } frama-c-20.0-Calcium/tests/value/initialized_copy.i0000666000000000000000000000527213571573400017210 0ustar /* run.config* STDOPT: +" -then -main main2 -then -eva-warn-copy-indeterminate=-main2" STDOPT: +" -eva-warn-copy-indeterminate=-@all" */ int w[10]; volatile int v; struct s { char c; int i; }; struct v { int i1; int i2; }; void f(int i) { } void g(int i); int main() { if (v) { int b; int a = b; // completely indeterminate Frama_C_show_each_unreached(); } if (v) { int b; if (v) b = 1; int a = b; // possibly determinate Frama_C_dump_each(); } if (v) { int c; if (v) { char* p = &c; *p = 1; } int a = c; // completely indeterminate on some bits Frama_C_show_each_unreached(); } if (v) { int c; char* p; if (v) { p = &c; *p = 1; } p = (char*)&c+1; *p = 2; p = (char*)&c+2; *p = 3; p = (char*)&c+3; *p = 4; int a = c; // possibly determinate Frama_C_dump_each(); } if (v) { struct s s1, s2; s1.c = 1; s1.i = 5; s2 = s1; // Never warn, this is a struct Frama_C_show_each(s2); } if (v) { struct v sv1, sv2; sv1 = sv2; // Never warn, even though we probably should Frama_C_show_each(sv1); } if (v) { struct v sv1, sv2; sv2.i1 = 1; sv1 = sv2; // Never warn, even though we probably should Frama_C_show_each(sv1); } if (v) { int i = v; //@ assert 0 <= i < 10; int t[10], v[10]; t[i] = v[i]; Frama_C_show_each_unreached(); // completely indeterminate } if (v) { int i = v; //@ assert 0 <= i < 10; int t[10], v[10]; v[1] = 1; t[i] = v[i]; Frama_C_dump_each();// possibly determinate. t is only partially // initialized as it was not initialized before the copy } if (v) { int i = v; //@ assert 0 <= i < 10; int v[10]; v[1] = 12; w[i] = v[i]; Frama_C_dump_each();// possibly determinate; w is completely initialized after } if (v) { int a; return a; // completely indeterminate } if (v) { int a; if (v) a = 8; return a; // possibly determinate } if (v) { int a; f(a); // completely indeterminate. Frama_C_show_each_unreached(); } if (v) { int a; g(a); // completely indeterminate. We also warn when the option is not active, as g has no body Frama_C_show_each_unreached(); } if (v) { int a; if (v) a = 1; f(a); // possibly determinate Frama_C_dump_each(); } if (v) { int a; if (v) a = 1; g(a); // possibly determinate. We also warn when the option is not active, as g has no body Frama_C_dump_each(); } return 0; } int main2() { int x; return x; // Test that option can be deactivated } frama-c-20.0-Calcium/tests/value/inline.c0000666000000000000000000000016713571573400015117 0ustar /* run.config* DONTRUN: test for the gui only */ #include "inline.h" int main () { int x = f(42); return 0; } frama-c-20.0-Calcium/tests/value/inline.h0000666000000000000000000000003313571573400015114 0ustar int f(int x) { return x; } frama-c-20.0-Calcium/tests/value/inout.i0000666000000000000000000000312113571573400014776 0ustar /* run.config* GCC: OPT: -no-autoload-plugins -load-module from,inout @EVA_CONFIG@ -inout -deps -main inout_11_0 -journal-disable OPT: -no-autoload-plugins -load-module from,inout @EVA_CONFIG@ -inout -deps -main inout_11_3 -journal-disable OPT: -no-autoload-plugins -load-module from,inout @EVA_CONFIG@ -inout -deps -main never_terminate -journal-disable OPT: -no-autoload-plugins -load-module from,inout @EVA_CONFIG@ -inout -deps -main may_not_terminate -journal-disable OPT: -no-autoload-plugins -load-module from,inout @EVA_CONFIG@ -inout -deps -main call_may_not_terminate -journal-disable */ int Xt, Xs, Xs_I, Ys, Ys_I, Z, I; void inout_11_0 (int i1, int i2, int *i) { Xs_I = Xs_I + 1; Xt = I ; Xs = i1 ; Ys = i1 + i2 ; *i = 0; Z = *i; } const int I_size=8; const int Itab[8]={-40,-25,-15,-5,5,15,25,40}; int inout_11_3 (int i1, int es, int i2) { int r; es = i1 ; Xs = es ; if (i2 < Itab[0]) r=-2; else if (i2>=Itab[I_size-1]) r=-1; else for(Z=0;Z=Itab[Z])&&(i2i] = 1; } void g() { t[i] = 2; t[i-3] = 3; } void h(int *q) { if (*q == 1) q = 0; } volatile int c; void main(int *v) { p = &S[8]; p->i = 12; i = 12; if (c) { f(); } if (c) { g(); } if (c) { int z; h(&z); } } frama-c-20.0-Calcium/tests/value/inout_proto.i0000666000000000000000000000167113571573400016231 0ustar /*run.config* OPT: -no-autoload-plugins -load-module from,inout @EVA_CONFIG@ -inout -input-with-formals -inout-with-formals -main main_main */ typedef unsigned char BYTE; typedef BYTE * MESSAGE_ADDR_TYPE; //@ assigns *RETURN_CODE \from MESSAGE_ADDR[0..length], length; extern void SendBuffer (const MESSAGE_ADDR_TYPE /* Array */ /* in */ MESSAGE_ADDR, const int /* in */ length, int * const /* out */ RETURN_CODE); void main(const MESSAGE_ADDR_TYPE msg) { int ret; SendBuffer((MESSAGE_ADDR_TYPE) &msg, 4, &ret); } int a, b, c; //@ assigns a, b, c \from b; void f(void); //@ assigns p[0..3] \from p[3..4]; void g(int *p); int t[10], u[20]; void g1() { g(&t[3]); } void g2() { g(&t[0]); } void g3(int *p) { g(p); } void main2(int i) { f(); g1(); g2(); if (i >= 5 && i <= 6) g3(&u[i]); } void main_main(const MESSAGE_ADDR_TYPE msg, int i) { main(msg); main2(i); } frama-c-20.0-Calcium/tests/value/input.i0000666000000000000000000000010513571573400014776 0ustar int f(int x, ...); int a,b; int main () { return f(a,b); } frama-c-20.0-Calcium/tests/value/integers.i0000666000000000000000000000025313571573400015463 0ustar int bin,hex,oct,dec; void main() { bin=0b101010 + 0B101010; hex=0x2A + 0X2a; oct=052 + 0052; dec=42; /*@ assert bin == hex == oct == dec * 2 == 0b1010100 ; */ } frama-c-20.0-Calcium/tests/value/interpol.c0000666000000000000000000000052213571573400015470 0ustar /* run.config* GCC: STDOPT: #"-eva-subdivide-non-linear 15" */ int t[8] = {1, 2, 4, 8, 16, 32, 64, 128}; void main() { int d; for (int i=0; i<7; i++) { if (t[i] - t[i+1] >= 0) { d = t[i] - t[i+1]; Frama_C_show_each_bug(i, d); } else { d = t[i] - t[i+1]; Frama_C_show_each_ok(i, d); } } } frama-c-20.0-Calcium/tests/value/interpreter-mode-syracuse.i0000666000000000000000000000041113571573400020760 0ustar /* run.config* STDOPT: +" -eva-interpreter-mode" */ int main() { int x = 127; int n = 1; Frama_C_show_each(n, x); while (x != 1) { if (x % 2 == 0) x = x/2; else x = 3*x + 1; n++; Frama_C_show_each(n, x); } return n; } frama-c-20.0-Calcium/tests/value/invalid_loc_return.i0000666000000000000000000000040313571573400017522 0ustar /* run.config* STDOPT: +"-main main1 -then -slevel 3 -main main2" */ int foo() { return 1; } volatile int c; void main() { int x; int **p; int *q = &x; if (c) p = &q; *(*p) = foo(); } void main1() { main(); } void main2() { main(); } frama-c-20.0-Calcium/tests/value/invalid_lval_arg.i0000666000000000000000000000032513571573400017140 0ustar void f(int); int X; void g(int x) { X = x + 1; } void (*p)(int); int main(int c){ p = c&1? f : g; if (c&2) f(**(int**)0); else if (c&4) g(**(int**)0); else p(**(int**)0); return X; } frama-c-20.0-Calcium/tests/value/inversion.i0000666000000000000000000000113413571573400015656 0ustar int x = 0; int y = 0; int z = 0; int *pz = &z ; int *px = &x ; int *py = &y ; int X = 0; int *pX; struct s { int ok; int **p; } t[5]={ {0,0}, {1,&pz}, {1,&py} , {0,0} }; struct s t2[5]={ {0,0}, {0,0}, {1,&px}, {0,0} }; int ii[2]; void main(void) { int i; volatile int k=0; pX = k ? 0 : &X; for (i=0 ; i < 5; i++) { if (t[i].ok) **(t[i].p) = i; X = i; } for (ii[1]=0 ; ii[1] < 5; ii[1]++) { if (t2[ii[1]].ok) **(t2[ii[1]].p) = ii[1]; X = ii[1]; } } void g (void) { int c = -25; while (c) { c++; } } frama-c-20.0-Calcium/tests/value/inversion2.i0000666000000000000000000000043613571573400015744 0ustar /* run.config* STDOPT: +"-then -eva-widening-delay 4 -eva-widening-period 3" */ int T[3] = {3,1,2}; int TT[3][5] = {{3,3,3,0,0}, {1,0,0,0,0}, {2,2,0,0,0}}; int G = 99; void main() { int i,j=77; for (i=0 ; i < 3 ; i++) { for (j=0; j < T[i]; j++) G = 15/(TT[i][j]);}; } frama-c-20.0-Calcium/tests/value/jacques.i0000666000000000000000000000054013571573400015275 0ustar /* run.config* GCC: STDOPT: */ int t[4]; int *p; int *q; void f(void) { *p = 4; *q = 5; } int A,B,C; void main(int a, int b, int *pp) { Frama_C_show_each_f(pp); //@ assert \valid(pp); Frama_C_show_each_f(pp); *pp = 5; //@ assert *pp + 1 == 6; A = 10; B = 11; p = &A; q = &B; f(); p = &A; q = &A; f(); } frama-c-20.0-Calcium/tests/value/join_misaligned.i0000666000000000000000000000162313571573400017000 0ustar /* run.config* STDOPT: #"-eva-warn-key garbled-mix -big-ints-hex 257" */ int t[5]={0}; int u[5]={1,1,1,1,1}; int v[7]={0x22222222,0x22222222,0x22222222,1,1,1,1}; int w[7]={0}; char x[5]={0}; int y[7]={0x22222222,0x22222222,0x22222222,1,1,1,1}; unsigned char z[5] = {0xFF,0xFF,0xFF,0xFF,0xFF}; unsigned int a; volatile unsigned short va; void main(int c) { if (c) { ((char*)t)[6]='a'; ((char*)u)[6]='c'; *((short*)((char*)v+6))=0x44444444; *((short*)((char*)w+6))=57; *((int*)((char*)y+6))= (int) &t; *((short*)(&z[3])) = 0x1111; *((short*) &a) = 0xFFFF; *((short*) &a+1) = 0xFFFF; } else { ((char*)t)[6]='b'; ((char*)u)[6]='d'; *((short*)((char*)v+7))=0x55555555; *((short*)((char*)w+7))=59; x[0]=1; x[1]=0; x[2]=1; *((int*)((char*)y+7))= (int) &u; a = va; a <<= 12; a--; } } frama-c-20.0-Calcium/tests/value/label.i0000666000000000000000000000074513571573400014730 0ustar /* run.config* COMMENT: this line preserves locations... */ int a,b,d,e,i,*p,*q; void f(int, int*); void main(int c) { b = 1; if (c) p = &a; else p = &b; *p = 2; a = (int)(&d + 1); q = &a; L: *((char*)&p+i) = *((char*)&q+i); i++; if (i<4) goto L; /* *p = (int) &e; f(0, &i); f(1, &a); f(0, &a); */ return; } void f(int x, int *r) { a = x; (*r)++; if (x - a != 0) *p = a; q = x ? &a : (int*)0; //@ assert \valid(q); *q = b; } frama-c-20.0-Calcium/tests/value/lazy.i0000666000000000000000000000061113571573400014620 0ustar /* run.config* STDOPT: #"-eva-msg-key pointer-comparison" STDOPT: #"-undefined-pointer-comparison-propagate-all -eva-msg-key pointer-comparison" */ int a=-1; int b, d; int *q, *r, *s, *t; void main (int *p, int c, int d) { q = &a - !c; if (q) r=q; s = &a - !d; if (!s) t=s; if (p && *p ) *p = 0 ; if (&a) { a=0; b=1; } if (&a+1) a+=2; if (&a+2) a+=4; return; } frama-c-20.0-Calcium/tests/value/leaf.i0000666000000000000000000000435313571573400014557 0ustar int T[30] = {1}; int f_int_int(int x); extern int g; int *pg = &g; /*@ assigns \result \from pg; */ int * f_int_star_int(int x); int **ppg = &pg; /*@ assigns \result \from ppg; */ int **f_int_star_int_star_int(int x); int f_star_int_cint(const int *x); /* 3 identicals prototypes */ int f_star_int_int(int *x); int f_tab_int_int(int x[]); int f_tab3_int_int(int x[3]); int cv1=10, cv2=20, cv3=30 ; struct _st_star_cint { const int * p ; } st_star_cint_1={&cv1}, st_star_cint_2={&cv2}, st_star_cint_3={&cv3} ; int v1=10, v2=20, v3=30 ; struct _st_star_int { int * p ; } st_star_int_1={&v1}, st_star_int_2={&v2}, st_star_int_3={&v3} ; struct _st_tab3_int { int t[3] ; } st_tab3_int_1={10, 11, 12}, st_tab3_int_2={20, 21, 22}, st_tab3_int_3={30, 31, 32} ; struct _st_star_cint f_st_star_cint_st_star_cint(struct _st_star_cint s) ; struct _st_star_int f_st_star_int_st_star_int (struct _st_star_int s) ; struct _st_tab3_int f_st_tab3_int_st_tab3_int (struct _st_tab3_int s) ; int f_star_st_star_cint_int (struct _st_star_cint * s) ; int f_star_st_star_int_int (struct _st_star_int * s) ; int f_star_st_tab3_int_int (struct _st_tab3_int * s) ; void main() { int c,d; T[0]=f_int_int(0); /* T[0] modified */ int *p = f_int_star_int(0); Frama_C_show_each_F(*p); *p = 5; Frama_C_show_each_F(*p); int **pp =f_int_star_int_star_int(0); Frama_C_show_each_G(*pp); Frama_C_show_each_F(**pp); // if (*pp==&d) **pp = 6; Frama_C_show_each_G(*pp); Frama_C_show_each_F(**pp); T[2]=f_star_int_cint(&T[3]); /* T[2] modified */ f_star_int_int(&(T[4])); /* only T[4] modified */ f_tab3_int_int(&T[6]); /* only T[6..8] modified */ f_tab_int_int(&T[10]); /* only T[10] modified */ st_star_cint_1 = f_st_star_cint_st_star_cint(st_star_cint_2); /* only st_star_cint_1 modified */ st_star_int_1 = f_st_star_int_st_star_int (st_star_int_2) ; /* st_star_int_1 modifed, v2 SHOULD BE modified */ st_tab3_int_1 = f_st_tab3_int_st_tab3_int (st_tab3_int_2) ; /* only st_tab3_int_1 modified */ f_star_st_star_cint_int(&st_star_cint_3); /* st_star_cint_3.p modified */ f_star_st_star_int_int (&st_star_int_3) ; /* v3 SHOULD BE modified */ f_star_st_tab3_int_int (&st_tab3_int_3) ; /* st_tab3_int_3 SHOULD BE modified */ } frama-c-20.0-Calcium/tests/value/leaf2.i0000666000000000000000000000020513571573400014631 0ustar typedef int T; extern T f(char* p,int q, int i); T G,H,I; void main (void) { G = f((char*)&H,(int)&I,17); if (G == -1) G++; } frama-c-20.0-Calcium/tests/value/leaf_spec.i0000666000000000000000000000046213571573400015566 0ustar /* run.config* STDOPT: #"-main main" STDOPT: #"-main main1" */ void f(int * x, int * y, int **z, int a, char b); void f1(int y); int g(int x); int *h(int y); int *k( int *l); int *k0( int const *l); void main () { f1(0); g(2); h(0); k(0);k0(0); } void main1(void) { f(0,0,0,0,0); } frama-c-20.0-Calcium/tests/value/library.i0000666000000000000000000000314213571573400015307 0ustar /* run.config* GCC: STDOPT: +"-eva-msg-key initial-state -eva-initialization-padding-globals no -lib-entry -main main -context-depth 3 -then -main main2 -then -context-width 4" */ int f_int(int x); int *gpi; /*@ assigns \result \from indirect:x, gpi; */ int *f_star_int(int x); int ****G; volatile v; int G0,*G1; typedef int (*pfun)(int *p1, const int *p2); pfun gen(void); extern pfun f; float *gpf; /*@ assigns \result \from gpf; */ float *i(void); double *gpd; /*@ assigns \result \from gpd; */ double *k(void); void main(pfun g) { G0 = f_int(2); G1 = f_star_int(5); *G1 = 5; ****G=1; int x = 3; int y = 4; pfun h = gen(); if (v) { int z1 = f(&x, &y); } if (v) { int z2 = g(&x, &y); } if (v) { int z3 = h(&x, &y); } float *pf = i(); float vf = *pf; *pf = 1.; *pf += *pf; double *pd = k(); *pd = 2.; } struct { void (*f[2])(); } s; struct { struct ss *p[8]; struct ss *(*q)[8]; } ss; void (*ff)(); struct { short bf1: 5; short bf : 0; // 0-sized bitfield: do not attemp to initialize it unsigned int control: 14, : 0; } s_bitfield; void main2(){ if (v) { //@ assert Unknown: G1 != 0; //@ assert \block_length(G1) >= 4; //@ assert \block_length(G1) <= 16; if (v) { //@ assert Unknown: \block_length(G1) == 4; Frama_C_show_each_reached_1(); } if (v) { //@ assert Unknown: \block_length(G1) == 8; // True with context-width 2 and 4 Frama_C_show_each_reached_2(); } if (v) { //@ assert Unknown_Invalid: \block_length(G1) == 16; // True with context-width 4 Frama_C_show_each_reached_3(); } } } frama-c-20.0-Calcium/tests/value/library_precond.i0000666000000000000000000000016613571573400017024 0ustar /*@ requires t > 0; assigns \result; */ int mxml(int t); int main() { int p = -3; int a = mxml(p); return a; } frama-c-20.0-Calcium/tests/value/limits.c0000666000000000000000000000075113571573400015141 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -warn-signed-overflow */ #include int cl, cu, ucu; int il, iu, uiu; long ll, lu; unsigned long ulu; long long lll, llu; unsigned long long ullu; int main() { cl = CHAR_MIN; cu = CHAR_MAX; ucu = UCHAR_MAX; il = INT_MIN; iu = INT_MAX; uiu = UINT_MAX; ll = LONG_MIN; lu = LONG_MAX; ulu = ULONG_MAX; lll = LLONG_MIN; llu = LLONG_MAX; ullu = ULLONG_MAX; return 0; } frama-c-20.0-Calcium/tests/value/local.i0000666000000000000000000000063113571573400014735 0ustar int *X, *Y, *Z, *T, *U, *V; int * f(void) { int a,b,c; X = &a; return &b; } int *g(void) { volatile int d=0; T = f(); U = d ? T : &d; return U; } int *h(int *x) { return x+1; } void i(int *x) { int local; x = &local; return; // must NOT emit warning about escaping address of 'local' } void main(void) { int e; Y = f(); Z = g(); Frama_C_dump_each(); V = h(&e); i(&e); } frama-c-20.0-Calcium/tests/value/local_cleanup.c0000666000000000000000000000044413571573400016440 0ustar int h() { int x = 1; { int y = 2; return y; // y must leave scope, even though the 'return' is not in the outermost scope } } void f(int *p){ p[1]=12; } void g(int x){ int t[2]; f(t); } void main(){ int lmain[2]; f(lmain); g(2); h(); Frama_C_dump_each(); } frama-c-20.0-Calcium/tests/value/local_slevel.i0000666000000000000000000000170713571573400016314 0ustar /* run.config* STDOPT: +" -load-module frama-c-constant_propagation -slevel-function main2:100000 -print -then -scf -then-on propagated -eva -eva-show-progress -no-scf" */ int *p; void main1() { int v; unsigned int r = 0; for (int i=0; i<80; i++) { //@ assigns v; ensures \true; // Also test the pretty-printer //@ slevel 50; if (i%2) { v = 1; } else { v = -1; } Frama_C_show_each(v, i, r); v = v * v; r = r + 2 / (v+1); //@ slevel default; ; } } void g() {// Do not crash when loop unrolling clears the dependencies of the AST //@ loop pragma UNROLL 1; for (int i=0; i<5; i++) { } } int t[100]; volatile vol; void main2() { for (int i = 0; i < 100; i++) { Frama_C_show_each(i); int n = vol; if (n>=3) { t[i] = n; } else t[i] = n+(1 << 30)+1; //@ slevel merge; // same effect as merge-after-loop; uses 200 slevel ; } } void main() { main1(); main2(); } frama-c-20.0-Calcium/tests/value/local_variables.i0000666000000000000000000000101113571573400016756 0ustar /* run.config* STDOPT: +"-inout" */ int w(int *, int*); int unkn(void); int A,B,C,D,R,S; int u() { int ru, wu; ru = C; return w(&ru, &wu); } int v() { int rv, wv; rv = D; return w(&rv, &wv); } int w(int *pr, int *pw) { *pw = A; if (unkn()) B = *pr; return *pr; } int main (int c, int * p) { R=u(); S=v(); if (c) { int x = 1; p = &x; } { int y = 0; { int z = 1; int t = y + z; } } for (int i = 0; i<5; i++) { int a = 0; a += i; } return *p; } frama-c-20.0-Calcium/tests/value/lock.i0000666000000000000000000000177013571573400014600 0ustar /* run.config* STDOPT: #"-main locks0_good" */ /*@ ghost int ghost_loctable[100] ;*/ /*@ axiomatic Locked { @ predicate locked{L}(struct mutex *m); @ // reads m, ghost_loctable[..] ; @ @ axiom locked_dummy_axiom_for_reads{L} : @ \forall struct mutex *m; @ locked(m) && ghost_loctable[0] == 0 ==> @ locked(m) && ghost_loctable[0] == 0 ; @ } @*/ /*@ requires !(locked(m)); ensures locked(m); assigns ghost_loctable[0..99]; */ void acquire_lock(struct mutex *m); /*@ requires locked(m); ensures !(locked(m)); assigns ghost_loctable[..]; */ void release_lock(struct mutex *m); /*@ requires !(locked(m)); assigns ghost_loctable[..]; behavior success: ensures (\result != 0) ==> locked(m); behavior failure: ensures (\result == 0) ==> !(locked(m)); */ int try_acquire_lock(struct mutex *m); struct mutex *pmutex; /*@ requires !(locked(pmutex)); */ void locks0_good(int flag) { acquire_lock(pmutex); release_lock(pmutex); } frama-c-20.0-Calcium/tests/value/logic.c0000666000000000000000000002005513571573400014734 0ustar #include <__fc_builtin.h> int t[10], u[11]; struct ts { int f1; int f2; } s1, s2, s3[10]; unsigned int x; volatile v; struct s1{ int x; }; struct s2{ struct s1 str; }; struct S { int x; int y; }; struct T { int z; int t; }; struct T t_T; /*@ axiomatic axio_1 { @ logic integer f_acsl (integer x) = x + 1; @ logic integer h_acsl (integer x) = 1 + h_acsl(x-1); @ logic integer mutual1{L1, L2}(int* x, int *y) = \at(*x*2, L1) + \at(*y+3, L2); @ logic integer mutual2{L1, L2}(int *v, int *w) = mutual1{L2, L1}(w, v); @ logic integer mute{L}(int x) = \at(x,L); // The label is actually unused @} */ /*@ predicate pred_1 (integer x) = 0 <= x < 100;*/ /*@ predicate pred_2{L1,L2}(integer x) = \at(x,L1) == \at(x,L2);*/ /*@ predicate pred_3{L1}(integer x) = \at(x,L1) == \at(x,L1);*/ /*@ predicate pred_4(struct s1 s) = s.x ==0;*/ /*@ predicate pred_5(integer a, integer b) = a + 1 == b;*/ /*@ predicate pred_6{L1,L2}(integer a, integer b) = \at(a,L1) + 1 == \at(b,L2);*/ /*@ predicate pred_7(integer a, integer b) = a == b && pred_7(a,b);*/ /*@ predicate pred_8(int x) = x == 5;*/ /*@ predicate pred_9(struct S s) = s.x + s.y == 42; */ void f (){ struct s1 temp_1; struct s2 temp_2; temp_1.x = 0; temp_2.str.x = 0; /*@ assert pred_4(temp_1);*/ /*@ assert pred_4(temp_2.str);*/ return; } void g (){ int x = 0; L:; int y = 1; /*@ assert pred_5(x,y);*/ /*@ assert pred_5(x,x+1);*/ /*@ assert pred_6{Here,Here}(x,y);*/ /*@ assert pred_6{L,Here}(x,y);*/ return; } void h (){ int x = 0; int y = 0; int k = 5; int j = 6; int *p = &k; int *q = &j; /*@ assert x == h_acsl(x);*/ /*@ assert pred_7(x,y);*/ /*@ assert pred_8(*p);*/ if (v) { /*@ assert pred_8(*q);*/ /* False */ } //@ assert mutual2{Here, Here}(p, q) == 5+3 + 2*6; // Make sure that k and s1.f1 are evaluated in Here despite the label! //@ assert mute{Pre}(k) == 5; s1.f1 = 1; //@ assert ! (mute{Pre}(s1.f1) == 0); } void unsup (){ t_T.z = 21; t_T.t = 21; /*@ assert pred_9((struct S)t_T);*/ return; } void pred(){ int x = 10; int y = 0; L:; y = x + 1; /*@ assert y == f_acsl(x);*/ /*@ assert pred_1(y);*/ /*@ assert pred_2{L,Here}(x);*/ /*@ assert pred_3{Here}(x);*/ f(); g(); unsup(); h(); return; } void eq_tsets () { //@ assert \union() == \union(); //@ assert \union(1) == \union(1); //@ assert \union(1, 2) == \union(1, 2); //@ assert \union(2, 1) == \union(1, 2); //@ assert ! (\union(1, 2) == \union(1, 3)); //@ assert ! (\union(1, 2) == \union(1)); //@ assert ! (\union(1 ,2) == \union(3, 4)); //@ assert \union(1, 2) != \union(1, 3); //@ assert \union(1, 2) != \union(1); //@ assert \union(1 ,2) != \union(3, 4); //@ assert \union(x, x+1) != \union(-1, -3); //@ assert \union(1.0) == \union(1.0); //@ assert \union(&t) == \union(&t); //@ assert ! (\union(&t[0..1]) == \union(&t[0..2])); //@ assert ! (\union(&t[0..1]) == \union(&t[2..3])); //@ assert (\union(&t[0..1]) == \union(&t[0..1])); // Seems to be OK according to the typing given by the kernel. The WP is also happy //@ assert \union(\union(1,2)) == \union(\union(1), \union(2)); //@ assert \union(\union(1,2)) == \union(\union(1), 2); //@ assert \union(\union(1,2)) == \union(1, 2); //@ assert \union(\union(1,1)) == \union(\union(1), 1); //@ assert &s3[0..1].f2 != 0; //@ assert &s3[0 .. -1].f1 != &s3[0..1].f2; //@ assert &s3[0 .. 1].f1 == &s3[0..1].f1; //@ assert s1 == s2; // True at link-time //@ assert t != u; // false //@ assert \union(0) == \union(0.0); //@ assert \union(1.0) == \union(1); //@ assert \union(1, 1.0) == \union(1.0, 1); //@ assert \union() != \union(x); //@ assert \inter(&t, &u) == \empty; } void eq_char() { char c = '\x82'; // equal to 130. Very different from \130 which is in octal Frama_C_show_each(c); //@ assert c == '\x82'; //@ assert c == 130-256; } void casts() { //@ assert (float)5 == 5.; //@ assert (double)5 == 5.; } /*@ requires r1: \valid (input + (0..l-1)); requires r2: \valid (&input[0..l-1]); assigns input[0..l-1] \from \nothing; */ void f_empty_tset (unsigned char * input, int l); void empty_tset () { unsigned char T[1] = {2}; f_empty_tset (T, 0); //@ assert T[0] == 2; } void reduce_by_equal() { int a[10]; a[v] = v; //@ assert \initialized(&a[0..9]); //@ assert a[0..8] == 1; // This syntax is not recommended (use \subset instead), but works for == and !=; } // Check that "partial" arithmetic operators check their arguments. // We cannot reduce either void alarms () { //@ slevel 0; int x = v; //@ assert ASSUME: x == -1 || x == 1; //@ assert UNK: 1 << x == 2; // Does not hold because of -1. Cannot reduce, because 1 << -1 may be equal to 2 Frama_C_show_each(x); //@ assert UNK: 2 >> x == 1; Frama_C_show_each(x); //@ assert ASSUME: x == 1; //@ assert OK: 1 << x == 2; Frama_C_show_each(x); //@ assert OK: 2 >> x == 1; Frama_C_show_each(x); x = v; //@ assert ASSUME: x == 0 || x == 1; //@ assert UNK: 1 / x == 1; // Does not hold because of 0 Frama_C_show_each(x); //@ assert UNK: 1 % x == 0; // Does not hold because of 0 Frama_C_show_each(x); //@ assert ASSUME: x == 1; //@ assert OK: 1 / x == 1; Frama_C_show_each(x); //@ assert OK: 1 % x == 0; Frama_C_show_each(x); } struct pair { int i1; int i2; }; /*@ assigns p == \null ? \empty : *p, q == \null ? \empty : *q, *out \from indirect:p, *p, indirect:q, *q; ensures p == \null ? (q == \null ? *out == 10 : *out == 20) : (q == \null ? *out == 30 : *out == 40); behavior p_nonnull: assumes p != \null; ensures *p == \at(*p,Pre) + 1; behavior q_nonnull: assumes q != \null; ensures q->i1 == \at(q->i1,Pre) + 2; ensures q->i2 == \at(q->i2,Pre) + 3; */ void select_like(int *p, struct pair *q, int *out); void cond_in_lval() { int a = 3, out = 0; struct pair b = {4, 5}; select_like(0, 0, &out); //@ assert out == 10; select_like(0, &b, &out); //@ assert b.i1 == 6; //@ assert b.i2 == 8; //@ assert out == 20; select_like(&a, 0, &out); //@ assert a == 4; //@ assert out == 30; a = 3; b.i1 = 4; b.i2 = 5; select_like(&a, &b, &out); //@ assert a == 4 && b.i1 == 6 && b.i2 == 8; //@ assert out == 40; int x = v; /*@ assert x >= 0 ? x >= 0 : x < 0; */ x = x; //@ assert x > 2 ? x > 2 : \true; if (x) //@ assert 1 ? x <= 0 : x > 0; // must evaluate to unknown ; } void float_sign() { //@ assert \sign((float)0.0) == \Positive; //@ assert \sign((double)-0.0) == \Negative; //@ assert \sign((long double)0.0) != \Negative; //@ assert \Positive == \sign((float)0.0); double d = v ? 0.0 : -0.0; //@ assert \sign(d) == \Positive && \sign(d) == \Negative; // must be unknown } int *arr_ptr[3], arr_ptr_arr[6]; //@ assigns *(arr_ptr[0..2]) \from \nothing; void assign_tsets_aux (void); void assign_tsets () { arr_ptr [0] = &arr_ptr_arr[1]; arr_ptr [1] = &arr_ptr_arr[4]; arr_ptr [2] = &arr_ptr_arr[5]; assign_tsets_aux (); // Make sure the under-approximation is precise: no "(and SELF)" information in froms } void min_max () { int x = Frama_C_interval(3, 17); int y = Frama_C_interval(1, 5); int z = Frama_C_interval(1, 100); int r1 = v; int r2 = v; int r3 = v; int r4 = v; //@ assert r1 == \max(x, y); //@ assert r2 == \max(x, z); //@ assert r3 == \min(x, y); //@ assert r4 == \min(x, z); double a = 0.; double b = - 0.; double d = v; //@ assert d == \min(a, b); } /* Tests assert and check assertions. */ void check_and_assert () { int x; x = v; /*@ assert x == 42; */ Frama_C_show_each_42(x); /*@ check x == 42; */ x = v; /*@ check x == 42; */ Frama_C_show_each_imprecise(x); /*@ assert x == 42; */ if (v) { /*@ assert x == 0; */ Frama_C_show_each_unreachable(x); /* The assert led to bottom. */ } else { /*@ check x == 0; */ Frama_C_show_each_reachable(x); /* A check should never lead to bottom. */ } } void main () { eq_tsets(); eq_char(); casts(); empty_tset(); reduce_by_equal(); alarms (); cond_in_lval(); pred(); float_sign(); min_max(); assign_tsets(); check_and_assert (); } frama-c-20.0-Calcium/tests/value/logic_ptr_cast.i0000666000000000000000000000072413571573400016642 0ustar /* run.config* OPT: -no-autoload-plugins -load-module eva -eva @EVA_CONFIG@ -print -journal-disable -no-results */ int *p; int t[90]; int main(){ p = (int*) (((unsigned long)t + 7) & ~7UL); /*@ assert p == (int*)t || p == (int*)((char*)t+1) || p == (int*)((char*)t+2) || p == (int*)((char*)t+3) || p == (int*)((char*)t+4) || p == (int*)((char*)t+5) || p == (int*)((char*)t+6) || p == (int*)((char*)t+7) ; */ Frama_C_show_each(p); return 0; } frama-c-20.0-Calcium/tests/value/logicdeps.i0000666000000000000000000000066413571573400015622 0ustar /* run.config* STDOPT: +"-eva-memexec -calldeps -no-deps -no-input -no-out -then -inout" */ int t[50]; int *p; //@ assigns t[20..*p+20] \from t[0..*p]; void f(void); void g() { f(); } extern int y, z; void main() { //@ assert 0 <= y <= 10; //@ assert 15 <= z <= 20; p = &y; g(); // t[20..(20-30)] \from t[0..10] g(); g(); //@ assert \true; p = &z; // t[20..(35-40)] \from t[0..20] g(); g(); g(); } frama-c-20.0-Calcium/tests/value/long.i0000666000000000000000000000015313571573400014601 0ustar int i,j,k; void f(void) { for (i=0;i<1000;i++); } void main(void) { for (j=0;j<1000;j++) f(); } frama-c-20.0-Calcium/tests/value/long_const.i0000666000000000000000000000173413571573400016015 0ustar /* run.config* STDOPT: #"-no-warn-signed-overflow" STDOPT: #"-warn-signed-overflow" */ long long int LL_ABS(long long int a) { return ((a) >= 0LL ? (a) : -(a)); } /*@ requires num: -9223372036854775807LL <= numerateur <= 9223372036854775807LL; requires denom: -9223372036854775807LL <= denominateur <= 9223372036854775807LL; */ long long int div64 (long long int numerateur, long long int denominateur) { long long int loc_num; long long int loc_den; long long int signe_negatif; signe_negatif = (numerateur ^ denominateur) & 0x8000000000000000; loc_num = LL_ABS(numerateur); loc_den = LL_ABS(denominateur); Frama_C_show_each(numerateur, loc_num, denominateur, loc_den); return 0LL; } void main(long long int v1, long long int v2) { unsigned long long i; i = 0xFFFF804000000000UL; unsigned long j= ((((((256ULL) >> 8) * 0xffff000000000000UL) | (256ULL << 39) )) + (1ULL << 39)/2ULL); Frama_C_show_each_f(sizeof(long),i,j); div64(v1, v2); } frama-c-20.0-Calcium/tests/value/loop.i0000666000000000000000000000225413571573400014617 0ustar int i,j,k,n,r; void main() { int i; r=0; n=50; for (i=0; i= \at(i,LoopCurrent); */ /*@ assert i >= \at(i,LoopEntry); */ U[i]=7; } } void main2 () { int i; for(i=0;i<=100; i++) { U[i]=7; } } int main () { main1(); main2(); } frama-c-20.0-Calcium/tests/value/loop2.i0000666000000000000000000000153113571573400014676 0ustar int i,j,k,l,n,r; struct T {int a,b;} G[5]={0}; void g(const int b) ; void main() { n=5; for (i=0; i= 12 ; onze--) ; return onze ; } int onze_1 (void) { int onze; for (onze=1000; onze > 11 ; onze--) ; return onze ; } int onze_2 (void) { int onze; for (onze=0; onze < 11 ; onze++) ; return onze ; } int onze_3 (void) { int onze; for (onze=0; onze <= 10 ; onze++) ; return onze ; } int onze_4 (void) { int onze; for (onze=0; onze != 11 ; onze++) ; return onze ; } /***************** cste CMP var **********************/ int onze_5 (void) { int onze; for (onze=1000; 12 <= onze ; onze--) ; return onze ; } int onze_6 (void) { int onze; for (onze=1000; 11 < onze; onze--) ; return onze ; } int onze_7 (void) { int onze; for (onze=0; 11 > onze; onze++) ; return onze ; } int onze_8 (void) { int onze; for (onze=0; 10 >= onze; onze++) ; return onze ; } int onze_9 (void) { int onze; for (onze=0; 11 != onze; onze++) ; return onze ; } int r0,r1,r2,r3,r4,r5,r6,r7,r8,r9; void test_onzes(void) { r0 = onze_0(); r1 = onze_1(); r2 = onze_2(); r3 = onze_3(); r4 = onze_4(); r5 = onze_5(); r6 = onze_6(); r7 = onze_7(); r8 = onze_8(); r9 = onze_9(); } /***************** !(var CMP cste) **********************/ int cent_onze_0 (void) { int cent_onze; for (cent_onze=1000; !(cent_onze < 112) ; cent_onze--) ; return cent_onze ; } int cent_onze_1 (void) { int cent_onze; for (cent_onze=1000; !(cent_onze <= 111) ; cent_onze--) ; return cent_onze ; } int cent_onze_2 (void) { int cent_onze; for (cent_onze=0; !(cent_onze >= 111) ; cent_onze++) ; return cent_onze ; } int cent_onze_3 (void) { int cent_onze; for (cent_onze=0; !(cent_onze > 110) ; cent_onze++) ; return cent_onze ; } int cent_onze_4 (void) { int cent_onze; for (cent_onze=0; !(cent_onze == 111) ; cent_onze++) ; return cent_onze ; } /***************** !(cste CMP var) **********************/ int cent_onze_5 (void) { int cent_onze; for (cent_onze=1000; !(112 > cent_onze) ; cent_onze--) ; return cent_onze ; } int cent_onze_6 (void) { int cent_onze; for (cent_onze=1000; !(111 >= cent_onze) ; cent_onze--) ; return cent_onze ; } int cent_onze_7 (void) { int cent_onze; for (cent_onze=0; !(111 <= cent_onze) ; cent_onze++) ; return cent_onze ; } int cent_onze_8 (void) { int cent_onze; for (cent_onze=0; !(110 < cent_onze) ; cent_onze++) ; return cent_onze ; } int cent_onze_9 (void) { int cent_onze; for (cent_onze=0; !(111 == cent_onze) ; cent_onze++) ; return cent_onze ; } /***************** **********************/ int c0,c1,c2,c3,c4,c5,c6,c7,c8,c9; void test_cent_onzes(void) { c0 = cent_onze_0(); c1 = cent_onze_1(); c2 = cent_onze_2(); c3 = cent_onze_3(); c4 = cent_onze_4(); c5 = cent_onze_5(); c6 = cent_onze_6(); c7 = cent_onze_7(); c8 = cent_onze_8(); c9 = cent_onze_9(); } frama-c-20.0-Calcium/tests/value/loop_wvar.i0000666000000000000000000000347013571573400015657 0ustar /* run.config* OPT: -no-autoload-plugins -load-module eva,inout -no-annot -eva @EVA_CONFIG@ -then -kernel-warn-key=annot-error=active -annot -eva -journal-disable OPT: -no-autoload-plugins -load-module from,inout,eva -kernel-warn-key=annot-error=active -eva @EVA_CONFIG@ -main main3 -journal-disable OPT: -no-autoload-plugins -load-module eva,inout -kernel-warn-key=annot-error=active -eva @EVA_CONFIG@ -main main_err1 -journal-disable OPT: -no-autoload-plugins -load-module eva,inout -kernel-warn-key=annot-error=active -eva @EVA_CONFIG@ -main main_err2 -journal-disable */ void main(void) { int n = 13; int i,j; // ceci était une annotation, mais on ne fait pas moins bien sans // maintenant: // loop pragma WIDEN_VARIABLES i; /*@ loop widen_hints i, 12, 13; */ for (i=0; i vnext) next++; } } void main_multiple_hints () { int maxj = 17; int maxk = 11; int j = 0; int k = 0; //@ loop widen_hints j, 17; loop widen_hints k, 11; // 18 and 12 are actually better bounds in this case (one less iteration) for (int i=0; i<10; i++) { Frama_C_show_each(i, j, k); if (j <= maxj) { j++; } if (k <= maxk) { k++; } } } void main3() { main_unhelpful (); main_multiple_hints (); } frama-c-20.0-Calcium/tests/value/loopfun.i0000666000000000000000000000065213571573400015330 0ustar /* run.config* STDOPT: +"-slevel 50 -no-results" STDOPT: +"-eva-warn-key=missing-loop-unroll=feedback -eva-warn-key=missing-loop-unroll:for=active -main main2" */ static int a = 7; int test() { return a--; } int main() { for(test();test();test()) { Frama_C_show_each_t(test()); } return 0; } volatile int v; void main2() { while (v) {} //@ loop unroll 1; for(;v;); for(;v;); do {} while(v); } frama-c-20.0-Calcium/tests/value/loopinv.c0000666000000000000000000000256713571573400015335 0ustar /* run.config* OPT: @EVA_CONFIG@ -no-autoload-plugins -load-module from,inout,eva,report -slevel-function main2:20 -pp-annot -eva -then -report */ /*@ requires valid: \valid(&t[0..s-1]); requires c: 1 <= c < s; */ void init (int *t, int c, int s) { int* p = t; /*@ loop invariant \valid(p) && p < &t[s-1]; */ while(1) { *(++p) = 1; if(p >= t+c) break; } } void main1 (int c) { int t1[72]; int t2[11]; if (c >= 1 && c < 72) { init(t1, c, 72); if (c < 8) init(t2, c, 11); } } void main2() { int i = 0; int j = 0; /*@ loop invariant i < 10; loop invariant i == j; */ while (1) { i++; j++; } } void main3() { // Widening is completely inactivated on this example int j = 0; //@ loop invariant i == 2*j || i == 2*j+1; for (int i=0; i<100; i++) { if (i%2==1) j++; Frama_C_show_each(i,j); } } /* The result of the widening should be reduced by the loop invariant, but the loop invariant must have an unknown status if it still does not hold in the reduced state —here due to the missing backward propagation on the multiplication. Change the invariant for a more complicated one when this propagator is implemented. */ void main4 () { int a = 9; int x = 0; /*@ loop invariant x<10 && x*x<10; */ while(x < a) x++; } void main(int c) { main1(c); if (c) main2(); main3(); main4(); } frama-c-20.0-Calcium/tests/value/machdep.c0000666000000000000000000000105013571573400015232 0ustar /* run.config* OPT: -no-autoload-plugins -load-module from,inout,eva -eva @EVA_CONFIG@ -cpp-extra-args="-DPTEST" -journal-disable -then -machdep x86_64 -then -machdep x86_16 */ #ifndef PTEST #include #endif int test1 () { unsigned long long u, w, *q ; u = (unsigned long long) -1LL ; q = (unsigned long long *) u; w = (unsigned long long) q; int c1 = (sizeof (q) == sizeof (u)) ; int c2 = (w == u) ; #ifndef PTEST printf("%d==1 => %d==1\n", c1, c2); #endif return c1!=1||c2==1 ; } int main() { return test1() ; } frama-c-20.0-Calcium/tests/value/max_pointed.c0000666000000000000000000000045213571573400016145 0ustar volatile int rand; void main () { double a = 42.; double b = 11.; double min, max; double *p = rand ? &a : &b; double *q = rand ? &a : &b; if (*p < *q) { max = *q; min = *p; } else if (*q < *p) { max = *p; min = *q; } else { max = a; min = b; } } frama-c-20.0-Calcium/tests/value/memexec.c0000666000000000000000000000357713571573400015274 0ustar /* run.config* STDOPT: #" -no-eva -rte-select fbug -rte -then -eva" */ int x1, y1, z1; volatile int c; void f11() { x1 = 1; } void f1 () { f11(); f11(); f11(); x1 = 0; f11(); x1 = 1; f11(); x1 = 2; f11(); f11(); } void f2 () { } void f3 () { } int *p; int fbug() { return *p; } void bug() { p = 0; int x = 1; if (c) fbug(); p = &x; fbug(); } int i; int t[10]; struct s { int i; }; struct s* ps; struct s S[10]; void f4_11() { // Evaluation fails the first time, but we need ps as a dependency for the subsequent evaluations. t[ps->i] = 1; } void f4_12() { t[i] = 2; // Same here t[i-3] = 3; } volatile int c; void f4_2(int *v) { ps = &S[8]; ps->i = *v; i = *v-1; if (c) { f4_11(); } else { f4_12(); } } void f4() { int n; n = 12; if (c) f4_2(&n); if (c) { n = 6; f4_2(&n); // This call must not be cached } } int g_f5_1, g_f5_2; void f5_aux (int x) { //@ assert g_f5_1 <= 6; int v = g_f5_2; //@ assert g_f5_2 <= 7; while (x <= 8); } void f5() { int arg; g_f5_1 = c; g_f5_2 = c; arg = c; f5_aux(arg); Frama_C_show_each_f5(arg, g_f5_1, g_f5_2); g_f5_1 = c; g_f5_2 = c; arg = c; f5_aux(arg); Frama_C_show_each_f5(arg, g_f5_1, g_f5_2); // Cache, but reduce g_f5_* and arg after the call. Currently does not work for g_f5_1, because dependencies are not taken into account } struct two_fields { int x; int y; } two_fields; void f6_1() { two_fields.x = 1; } void f6() { two_fields.y = 2; f6_1(); two_fields.y = 3; f6_1(); } void f7_1(struct two_fields *p) { p->x = 1; p->y = 1; } void f7() { struct two_fields x; f7_1(&x); f7_1(&x); } void f8_1(int *q) { if (*q == 1) q = 0; } void f8() { int x; if (c) f8_1(&x); x = 1; f8_1(&x); f8_1(&x); } void main () { f1 (); f2 (); f3 (); bug(); f4(); f5(); f6(); f7(); f8(); } frama-c-20.0-Calcium/tests/value/merge_bits.i0000666000000000000000000000136213571573400015765 0ustar char T[] = { 1,0,0,0,1,2,3,4,5,0,1,1,1 } ; volatile int nondet; union u { int i; short s[2]; }; /* This function tests the join of two offsetmaps with the same bitwise representation, but different structured values. Ideally, the resulting offsetmap should be a singleton. */ void join_offsetmap () { union u u; if (nondet) u.i = -2; else { u.s[0] = -2; u.s[1] = -1; } int r = u.i; } int merge_bits () { Frama_C_show_each_F(*((int*)(T))); Frama_C_show_each_F(*((int*)(T+1))); Frama_C_show_each_F(*((int*)(T+4))); Frama_C_show_each_F(*((int*)(T+9))); *((int*)(T+2))=2U<<31 | 2U << 30 | 2U << 27 | 2U << 3; Frama_C_show_each_F(*((int*)(T))); return 0; } int main () { join_offsetmap (); merge_bits (); } frama-c-20.0-Calcium/tests/value/mini_pointrer.i0000666000000000000000000000027713571573400016527 0ustar int T[2]; int**ppp; int pp[2]; int p; void main(int c1, int c2, int c3) { pp [c1] = (int) &T[c1]; if (c2) ppp = &pp; else ppp = &T[-1]; **ppp=9; if (c2>=0 && c2<=5) T[c2] = 4; } frama-c-20.0-Calcium/tests/value/misaligned_tabs.i0000666000000000000000000000400113571573400016763 0ustar char T[300]; struct st { short i1,i2; char c1,c2; short i3,i4 ;}; struct st S1 = { 0x1111, 0x1111, 0x11,0x11, 0x1111, 0x1111} ; struct st S2 = { 0x1111, 0x1111, 0x11,0x11, 0x1111, 0x1111} ; struct st S3 = { 0x1111, 0x1111, 0x11,0x11, 0x1111, 0x1111} ; struct st S4 = { 0x1111, 0x1111, 0x11,0x11, 0x1111, 0x1111} ; void misaligned_struct() { Frama_C_show_each_1 (S1.i1 == *(short*)&S1.c1); // ok *( (char *)&S1.i1)= 0x11; Frama_C_show_each_2 (S1.i1 == 0x1111); // To do Frama_C_show_each_3 (S1.i1 == S1.i2); // To do Frama_C_show_each_4 (*(char *)&S1.i1 == S1.c2); // OK *( (char *)&S2.i1)= 0x11; *(1+(char *)&S2.i1)= 0x11; Frama_C_show_each_5 (S2.i1 == 0x1111); // ok Frama_C_show_each_6 (S2.i1 == S2.i2); // ok Frama_C_show_each_7 (*(char *)&S2.i2 == S2.c2); // OK Frama_C_show_each_8 (*(char *)&S2.i2 == *(char *)&S4.i2); // OK *(1+(char *)&S3.i1)= 0x11; *( (char *)&S3.i2)= 0x11; *(1+(char *)&S3.i2)= 0x11; *( (char *)&S3.i3)= 0x11; *(1+(char *)&S3.i3)= 0x11; *( (char *)&S3.i4)= 0x11; *( (char *)&S4.i1)= 0x11; *(1+(char *)&S4.i1)= 0x11; *( (char *)&S4.i2)= 0x11; *(1+(char *)&S4.i2)= 0x11; *( (int *)&S4.c1)= 0x1111; *( (char *)&S4.i3)= 0x11; *(1+(char *)&S4.i3)= 0x11; *( (char *)&S4.i4)= 0x11; *(1+(char *)&S4.i4)= 0x11; Frama_C_show_each_9 (S3.i1 == S4.i1); // To do Frama_C_show_each_a (S3.i2 == S4.i2); // ok Frama_C_show_each_b (S3.i3 == S4.i3); // ok Frama_C_show_each_c (*((char *)&S3.i2) == *((char *)&S4.i2)); // OK Frama_C_show_each_d (S3.c1 == S4.c2); // OK Frama_C_show_each_e (*((char *)&S3.i2) == S4.c1); // Ok Frama_C_show_each_f (*((char *)&S3.i1) == S4.c1); // Ok } void main(int c1, int c2) { *(int*)(&T[0])=c1?1:2; *(int*)(&T[4])=c2?1:2; T[1]=T[5]; *(int*)(&T[8])=*(int*)(&T[4]); misaligned_struct (); /* for(i = 0; i < 36800; i++) { T[i] = 33; } */ if (c1) Frama_C_show_each_g (S1.i1 == *(short*)&S1.c1); // to do } frama-c-20.0-Calcium/tests/value/mixed_val.i0000666000000000000000000000021513571573400015611 0ustar short T[10] = {'a'}; int a,b,c,d,e; int main(){ a=c?57:128073; d=e?57:128073; T[0] = *(short*)(&a); // T[1] = *((short*)(&a)+1); } frama-c-20.0-Calcium/tests/value/modifies.i0000666000000000000000000000026113571573400015441 0ustar /* run.config* STDOPT: #"-lib-entry" */ int TAB[10]; int G,H,J; void main () { if (H) {H= 3; J++;TAB[4]--;}; if (J) G=6; if (G) H=1; if (H) {TAB[1]++; TAB[6]++;}; } frama-c-20.0-Calcium/tests/value/modulo.i0000666000000000000000000000752013571573400015146 0ustar /* run.config* STDOPT: #"-slevel-function pgcd1:100,pgcd2:100,pgcd3:100" */ int A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R; volatile v; void main2 () { int i = v; A = (4 * i) % 4; B = (4 * i + 1) % 4; i = v; //@ assert ((i>=-100) && (i<=100)) ; E = (3*i + 1) % 12; i = v; //@ assert ((i>=0) && (i<=100)) ; C = (4 * i + 1) % 4; D = (3*i + 1) % 12; F = (24*i + 5) % 12; G = (24*i + 5) % 13; H = i % 1000; I = (2 * i+1101) % 1000; J = (5 * i - 201) % 1000; K = (5 * i - 201) % 10; L = K % J; M = K % D; N = J % I; O = I % G; P = A % J; Q = J % L; } extern int a, b; /*@ requires -10<=x<=10 && -10<=y<=10; */ int pgcd1(int x, int y) { int a = x, b = y; /*@ loop invariant -10<=b<0||b==0||0>24; int q = ((i * 12 + 5) << 25)>>25; int t = ((i * 13 + 7) << 25)>>25; } void extract_bits_modulo(void) { int i = v; /*@ assert 0 <= i <= 10; */ int aa1 = (i * 12 + 5) * 256 + 11; unsigned char *ptr1 = (unsigned char *)&aa1; int m1 = ptr1[0]; /* Ideally: congruent to 11 modulo 256; equal to 11. */ int n1 = ptr1[1]; /* Ideally: congruent to 5 modulo 12. */ int aa2 = (i * 12 + 5) * 256 + (i * 11 + 14); unsigned char *ptr2 = (unsigned char *)&aa2; int m2 = ptr2[0]; /* Ideally: congruent to 3 modulo 11. */ int n2 = ptr2[1]; /* Ideally: congruent to 5 modulo 12. */ int aa3 = (i * 12 + 5) * 256 + (i * 11 + 16); unsigned char *ptr3 = (unsigned char *)&aa3; int m3 = ptr3[0]; /* Ideally: congruent to 5 modulo 11. */ int n3 = ptr3[1]; /* Ideally: congruent to 5 modulo 12. */ int aa4 = (i * 11 + 16); unsigned char *ptr4 = (unsigned char *)&aa4; int m4 = ptr4[0]; /* Ideally: congruent to 5 modulo 11. */ int n4 = ptr4[1]; /* Ideally: equal to zero. */ } //volatile int v; // Test extraction of modulo with 'positive' semantics (ie. not nearest // to zero in absolute value, which is the one '%' would have used). void pos_rem(void) { int n = v; //@ assert -1 <= n <= 255; int j = (int)*(signed char*)&n; n = v; //@ assert 0 <= n <= 135; int k = (int)*(unsigned char*)&n; n = v; //@ assert -1 <= n <= 72; int l = (int)*(signed char*)&n; // Best rem is ([0..72] \cup {255})%255, we approximate by [-128..127] } void main() { if (v) { pgcd1(a, b); } if (v) { pgcd2(a, b); } if (v) { pgcd3(a, b); } main2(); simultaneous_congruences(); shift_modulo(); extract_bits_modulo(); pos_rem(); } frama-c-20.0-Calcium/tests/value/multi_access.i0000666000000000000000000000023713571573400016320 0ustar /* run.config* STDOPT: #"-unspecified-access" */ struct S { int a; int b; }; int main () { struct S s; s.a = 0; s.b = 1; s.a = s.b = 2; return 0; } frama-c-20.0-Calcium/tests/value/narrow_behaviors.i0000666000000000000000000000250313571573400017215 0ustar /* run.config* STDOPT: +"-slevel 10 -eva-verbose 2" */ extern int nondet; typedef struct { int x, y; } pair; /*@ assigns \result \from nondet; behavior a: assumes nondet == 0; ensures \result.x == 1; ensures \result.y == 1; behavior b: assumes nondet != 0; ensures \result.x >= 2; ensures \result.y <= 2; behavior c: assumes nondet == 1; ensures \result.x == 2; ensures \result.y == 2; behavior d: assumes nondet != 1; ensures \result.x <= 2; ensures \result.y >= 1; complete behaviors a, b; complete behaviors c, d; */ pair f1(void); /*@ assigns \result \from nondet; behavior a: assumes nondet == 0; ensures \result.x >= 1; ensures \result.y <= 1; behavior b: assumes nondet != 0; ensures \result.x >= 2; ensures \result.y <= 2; behavior c: assumes nondet == 1; ensures \result.x <= 1; ensures \result.y >= 2; behavior d: assumes nondet != 1; ensures \result.x <= 2; ensures \result.y >= 1; complete behaviors a, b; complete behaviors c, d; */ pair f2(void); int main() { { pair p = f1(); Frama_C_dump_each (); pair q = f2(); Frama_C_dump_each (); } { //@ assert nondet == 0 || nondet == 1; pair r = f1(); Frama_C_dump_each (); pair s = f2(); Frama_C_dump_each (); } return 0; } frama-c-20.0-Calcium/tests/value/nested_struct_init.i0000666000000000000000000000256313571573400017562 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ -then -eva-initialization-padding-globals no -then -eva-initialization-padding-globals maybe -then -lib-entry -then -eva-initialization-padding-globals no -then -eva-initialization-padding-globals yes */ typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; typedef long long int64_t; typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; struct S0 { int8_t f0; int16_t f1; int64_t f2; uint16_t f3; int8_t f4; int32_t f5; int16_t f6; int32_t f7; int16_t f8; }; struct S2 { int8_t f0; const int16_t f1; int16_t f2; int32_t f3; uint8_t f4; struct S0 f5; int64_t f6; int8_t f7; int16_t f8; }; struct S1 { int32_t f0; uint8_t f1; }; struct S3 { struct S2 f0; const uint32_t f1; const uint32_t f2; int64_t f3; struct S0 f4; const struct S1 f5; int8_t f6; const int8_t f7; }; struct S0 g_3 = {-1L,0x4B54L,6L,7L,0xFFL,1L,-10L,0x67457993L,0x3C7DL}; struct S3 g_8 = {{0xD5L,-10L,0L,0x900B0881L,0xDAL,{0xDBL,0x846BL,1L,-7L,0xF3L,0xFC0336AEL,6L,0x52E4A6B2L,0x4EB0L},0x117216709E149CFFLL,0x9CL,-1L},0x1636717BL,-4L,4L,{0xE3L,0xECDCL,0xF1FA6F63EEDA781BLL,0xF7A0L,0x7CL,0L,0xA77DL,0x7FC7DF39L,0x3C5AL},{0xA104ACD6L,0xA8L},0xADL,8L}; int main(){ return 0; } frama-c-20.0-Calcium/tests/value/no_results.c0000666000000000000000000000035113571573400016031 0ustar /* run.config* STDOPT: #"-no-results-function init -calldeps -slevel 10000" +"-inout" */ #define N 3000 int t[N]; void init() { for(int i=0; i>1; int G2 = G0 ^ G1 ; int G3 = -1; void main (void) { G3=G0+G2; } frama-c-20.0-Calcium/tests/value/non_natural.i0000666000000000000000000000236013571573400016164 0ustar volatile v; void main1() { int c = 0; if (v) goto L2; L1: if (c >= 1000000) return; Frama_C_show_each(c); L2: c++; goto L1; } void duff1(int *to, int *from, int count) { register n = (count + 7) / 8; switch(count % 8) { case 0: do { Frama_C_show_each(to); *to++ = *from++; case 7: *to++ = *from++; case 6: *to++ = *from++; case 5: *to++ = *from++; case 4: *to++ = *from++; case 3: *to++ = *from++; case 2: *to++ = *from++; case 1: *to++ = *from++; } while(--n > 0); } } void duff2(int *to, int *from, int count) { register n = (count + 7) / 8; switch(count % 8) { case 0: L: { Frama_C_show_each(to); *to++ = *from++; case 7: *to++ = *from++; case 6: *to++ = *from++; case 5: *to++ = *from++; case 4: *to++ = *from++; case 3: *to++ = *from++; case 2: *to++ = *from++; case 1: *to++ = *from++; } if (--n > 0) goto L; } } void main2() { int p1[100002]; int p2[100000]; int o = v; if (0 <= o && o < 100002) *(p1+o) = 1; duff1(p2, p1, 100000); *(p1+o) = 2; duff2(p2, p1, 100000); } void main() { main1(); main2(); } frama-c-20.0-Calcium/tests/value/nonlin.c0000666000000000000000000000663013571573400015137 0ustar /* run.config* STDOPT: +"-eva-subdivide-non-linear 14 -eva-msg-key nonlin" */ #include "__fc_builtin.h" volatile int v; volatile short vs; /* Checks that the subdivision does not fail when pointer values get involved. */ void subdivide_pointer () { int y = 17; int x = Frama_C_interval(-10, 10); int *p = &x; int i = Frama_C_interval(0,100); /* The complete expression is a pointer: no subdivision. */ int *q = p + i - i; /* The complete expression is a singleton: no subdivision. */ y = *(&y + i - i); /* The complete expression is an imprecise integer: subdivision (but not reduction, as it cannot improve the bounds of the result). */ y = *(p + i - i); /* The splitted lvalue contains a pointer value: no subdivision. */ i = v ? i : (int) &x; y = *(p + i - i); } void subdivide_integer () { int y; short z = v; int k = (z+675) * (z+675); int l = (z+17817) * (z+17817); int x = sizeof(y)+sizeof(y); // do not optimize y int *p = &x + x; // do not optmize x; long long i1 = vs; long long i2 = vs; long long r = i1 * i1 + (i2+3) * (i2+3); // (i2+3) not fully precise with 14 subdivisions int t[102]; short idx = vs; //@ assert 0 <= idx <= 10; t[idx*idx] = 1; } /* Exemples where a subdivision on several variables simultaneously is necessary to get more precision. */ void subdivide_several_variables () { int w = Frama_C_interval(-10, 10); int x = Frama_C_interval(-10, 10); int y = Frama_C_interval(-10, 10); int z = Frama_C_interval(-10, 10); /* A subdivision on each variable separately is more efficient here. */ int norm = x * x + y * y; /* Subdivide on x, then on y. This evaluation is currently imprecise as the subdivision is stopped when it seems not to improve the bounds of the result. Here however, the subdivision on x would improve the value of x*x, and the subdivision on y would then improve the value of the expression. */ int mult = ((x*x)*y)*y; /* A subdivision on both variables is more efficient here. */ int zero = x * y - y * x; /* Both square and square2 should be subdivided in the same way, even if [x] only appears in [x*x - 2xy] in the first expression. */ int square = x*x - 2*x*y + y*y; int square2 = x*x + y*y - 2*x*y; /* Subdivision on the three variables x, y, z, and on w. */ int res = (z*x + x*y + y*z) + w * w; } int table[] = { 0x42, 0x42, 0x42, 0x42, 1, 8, 7, 2, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 9, 3, 4, 5, 0x00, 0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 2, 3, 7, 5, 0x00, 0x00, 0x00, 0x00 }; /* This example illustrates the need to evaluate the complete expression (and not some subexpression) to be able to reduce it. */ void subdivide_table () { int x = 0; /*@ loop invariant x < 10; */ while (1) x = table[4 + (((x>>2)*3)<<2) + (x%4)]; } /* When subdividing on a lvalue that has been reduced by the forward evaluation, beware to not forget the alarms that led to its reduction. */ void subdivide_reduced_value () { int t1[2] = {0, 1}; int t2[2] = {0, 1}; int i = v; /* Subdivision on i, that has been reduced to {0; 1}. Alarms about array index must be emitted. Ideally, the value computed for the result would be zero, even with few subdivisions. */ int r = t1[i] - t2[i]; } void main () { subdivide_integer (); subdivide_pointer (); subdivide_several_variables (); if (v) subdivide_table (); subdivide_reduced_value (); } frama-c-20.0-Calcium/tests/value/noreturn.i0000666000000000000000000000122313571573400015515 0ustar void stop(void) __attribute__ ((noreturn)) ; int haltme(void) __attribute__ ((noreturn)) ; void never_ends(void) __attribute__ ((noreturn)) { while(1) ; return; }; void should_never_end(int c) __attribute__ ((noreturn)) { if (c) while(1) ;} ; void warn_never_ends(void) { while(1) ;} ; void warn_may_never_end(int c) { if (c) while(1) ;} ; static volatile int v=55,w=66; int main(int c) { int x=0; if (v) warn_may_never_end (v); if (v) warn_may_never_end (1); if (v) warn_never_ends (); if (v) stop(); if (v) x = haltme (); if (v) never_ends (); if (v) should_never_end (v); if (v) should_never_end (1); return x; } frama-c-20.0-Calcium/tests/value/not.i0000666000000000000000000000010513571573400014437 0ustar int x; void main() { volatile int loc=0; x = loc?!(0):0; } frama-c-20.0-Calcium/tests/value/not_ct_array_arg.i0000666000000000000000000000042513571573400017161 0ustar /* run.config* STDOPT: #"-eva-msg-key initial-state" */ // Cf. Bts 856 volatile int v; void main(int a, int tb[10][a], int tc[a][10]) { *(int*)tb = 1; Frama_C_dump_each(); tb[9][100] = (int) &tb; Frama_C_dump_each(); tc[1][1] = 3; if (v) tc[1][16] = 0; } frama-c-20.0-Calcium/tests/value/null_lt_valid.i0000666000000000000000000000070113571573400016471 0ustar int t[23]; int *p, *q, *r; void f(void){ if (p < t) *p = 1; } void g(void){ int *q1, *q2; if (q < t+22) q1 = q; else q2 = q; } void h(void){ int *r1, *r2; if (r < t+22) r1 = r; else r2 = r; } int main(int c){ if (c&32) f(); q = (c&64) ? t+(c&15) : p; if (c&128) g(); r = (c&256) ? t+(c&31) : p; if (c&512) h(); t[0] = (p < t); t[1] = (q < t + 22); t[2] = (r < t + 22); return 0; } frama-c-20.0-Calcium/tests/value/numerors/0000777000000000000000000000000013571573400015343 5ustar frama-c-20.0-Calcium/tests/value/numerors/numerors.c0000666000000000000000000002506613571573400017372 0ustar /* run.config OPT: -eva -eva-numerors-domain -eva-msg-key=d-numerors */ /* Tests for the numerors domain, that computes absolute and relative errors of floating-point computations. */ #include <__fc_builtin.h> #include #define TRUE 1 #define FALSE 0 double ex0(double x) { int n = 0 ; x = x * x ; //@ loop unroll 14 ; while (x >= 1) { x /= 2.0 ; n += 1 ; } double y = (1.0 - x); double lx = (y * (1.0 + (y * ((1.0 / 2.0) + (y * ((1.0 / 3.0) + (y * ((1.0 / 4.0) + (y * (1.0 / 5.0)))))))))); return (lx * (n / 0.69314718056)); } double ex1(double i) { double x = i * i ; double temp ; if (x < 2.0) temp = x ; else temp = 2.0 ; return temp ; } double ex2(double cst, double i) { double x = (i * i); double temp; if ((x < cst)) { temp = ((7.0 * x) - 5.0); } else { temp = cst; } return temp; } double ex3(double x) { return (sqrt(2.0 * x + 3.0)) / (2.0 * sqrt(x) + 3.0) ; } double ex3b(double re, double im) { return 0.5 * sqrt(2.0 * sqrt(re * re + im * im) + re) ; } double ex6(double x3, double x4, double x5, double x2, double x6, double x1) { return (((((x2 * x5) + (x3 * x6)) - (x2 * x3)) - (x5 * x6)) + (x1 * (((((-x1 + x2) + x3) - x4) + x5) + x6))); } double ex7(double t) { return (t / (t + 1.0)); } double ex8(double x, double y) { double t = (x * y); return ((t - 1.0) / ((t * t) - 1.0)); } double ex9(double x0, double x2, double x1) { double p0 = ((x0 + x1) - x2); double p1 = ((x1 + x2) - x0); double p2 = ((x2 + x0) - x1); return ((p0 + p1) + p2); } double ex10(double x3, double x4, double x0, double x5, double x2, double x7, double x6, double x1) { return (((((((x0 + x1) + x2) + x3) + x4) + x5) + x6) + x7); } double ex11(double x, double y) { return ((x + y) / (x - y)); } double ex12(double w1, double a1, double a0, double w0, double w2, double a2, double m0, double m2, double m1) { double v2 = ((w2 * (0.0 - m2)) * (-3.0 * ((1.0 * (a2 / w2)) * (a2 / w2)))); double v1 = ((w1 * (0.0 - m1)) * (-3.0 * ((1.0 * (a1 / w1)) * (a1 / w1)))); double v0 = ((w0 * (0.0 - m0)) * (-3.0 * ((1.0 * (a0 / w0)) * (a0 / w0)))); return (0.0 + ((v0 * 1.0) + ((v1 * 1.0) + ((v2 * 1.0) + 0.0)))); } double ex13(double x) { double r1 = (x - 1.0); double r2 = (x * x); return (r1 / (r2 - 1.0)); } double ex14(double x) { return (1.0 / (x + 1.0)); } double ex15(double v, double u, double T) { double t1 = (331.4 + (0.6 * T)); return ((-t1 * v) / ((t1 + u) * (t1 + u))); } double ex16(double v, double u, double T) { double t1 = (331.4 + (0.6 * T)); return ((-t1 * v) / ((t1 + u) * (t1 + u))); } double ex17(double v, double u, double T) { double t1 = (331.4 + (0.6 * T)); return ((-t1 * v) / ((t1 + u) * (t1 + u))); } double ex18(double x3, double x2, double x1) { return (((-(x1 * x2) - ((2.0 * x2) * x3)) - x1) - x3); } double ex19(double x3, double x2, double x1) { return (((((((2.0 * x1) * x2) * x3) + ((3.0 * x3) * x3)) - (((x2 * x1) * x2) * x3)) + ((3.0 * x3) * x3)) - x2); } double ex20(double v, double w, double r) { return (((3.0 + (2.0 / (r * r))) - (((0.125 * (3.0 - (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 4.5); } double ex21(double v, double w, double r) { return (((6.0 * v) - (((0.5 * v) * (((w * w) * r) * r)) / (1.0 - v))) - 2.5); } double ex22(double v, double w, double r) { return (((3.0 - (2.0 / (r * r))) - (((0.125 * (1.0 + (2.0 * v))) * (((w * w) * r) * r)) / (1.0 - v))) - 0.5); } double ex23(double x) { double r = 4.0; double K = 1.11; return ((r * x) / (1.0 + (x / K))); } double ex24(double x) { double r = 4.0; double K = 1.11; return (((r * x) * x) / (1.0 + ((x / K) * (x / K)))); } double ex25(double v) { double p = 35000000.0; double a = 0.401; double b = 4.27e-05; double t = 300.0; double n = 1000.0; double k = 1.3806503e-23; return (((p + ((a * (n / v)) * (n / v))) * (v - (n * b))) - ((k * n) * t)); } double ex26(double x) { return (((x - (((x * x) * x) / 6.0)) + (((((x * x) * x) * x) * x) / 120.0)) - (((((((x * x) * x) * x) * x) * x) * x) / 5040.0)); } double ex27(double x) { return ((((1.0 + (0.5 * x)) - ((0.125 * x) * x)) + (((0.0625 * x) * x) * x)) - ((((0.0390625 * x) * x) * x) * x)); } double ex28(double x) { return ((0.954929658551372 * x) - (0.12900613773279798 * ((x * x) * x))); } int main() { //log_approx { double x = Frama_C_double_interval(1.0, 100.0) ; double res = ex0(x) ; Frama_C_domain_show_each_ex0(res) ; } //conditional_ex { double i = Frama_C_double_interval(1.0, 100.0) ; double res = ex1(i) ; Frama_C_domain_show_each_ex1(res) ; } //conditional_1 { double cst = 500.0 ; double i = Frama_C_double_interval(1.0, 100.0) ; double res = ex2(cst, i) ; Frama_C_domain_show_each_ex2(res) ; } //sqrt_1 { double x = Frama_C_double_interval(1.0, 1000.0) ; double res = ex3(x) ; Frama_C_domain_show_each_ex3(res) ; } //complex_sqrt { double re = Frama_C_double_interval(1.0, 10.0) ; double im = Frama_C_double_interval(1.0, 10.0) ; double res = ex3b(re, im) ; Frama_C_domain_show_each_ex3b(res) ; } //kepler0 { double x1 = Frama_C_double_interval(4.0, 6.36) ; double x2 = Frama_C_double_interval(0.0001, 0.00011) ; double x3 = Frama_C_double_interval(40.0, 63.6) ; double x4 = Frama_C_double_interval(-6.36, -4.0) ; double x5 = Frama_C_double_interval(4.0, 6.36) ; double x6 = Frama_C_double_interval(4.0, 6.36) ; double res = ex6(x3, x4, x5, x2, x6, x1) ; Frama_C_domain_show_each_ex6(res) ; } //intro-example { double t = Frama_C_double_interval(0.0, 999.0) ; double res = ex7(t) ; Frama_C_domain_show_each_ex7(res) ; } //sec4-example { double x = Frama_C_double_interval(1.001, 2.0) ; double y = Frama_C_double_interval(1.001, 2.0) ; double res = ex8(x, y) ; Frama_C_domain_show_each_ex8(res) ; } //test01_sum3 { double x0 = Frama_C_double_interval(1.0, 2.0) ; double x1 = Frama_C_double_interval(1.0, 2.0) ; double x2 = Frama_C_double_interval(1.0, 2.0) ; double res = ex9(x0, x2, x1) ; Frama_C_domain_show_each_ex9(res) ; } //test02_sum8 { double x0 = Frama_C_double_interval(1.0, 2.0) ; double x1 = Frama_C_double_interval(1.0, 2.0) ; double x2 = Frama_C_double_interval(1.0, 2.0) ; double x3 = Frama_C_double_interval(1.0, 2.0) ; double x4 = Frama_C_double_interval(1.0, 2.0) ; double x5 = Frama_C_double_interval(1.0, 2.0) ; double x6 = Frama_C_double_interval(1.0, 2.0) ; double x7 = Frama_C_double_interval(1.0, 2.0) ; double res = ex10(x3, x4, x0, x5, x2, x7, x6, x1) ; DPRINTFrama_C_domain_show_each_ex10(res) ; } //test03_nonlin2 { double x = Frama_C_double_interval(0.0, 1.0) ; double y = Frama_C_double_interval(-1.0, -0.1) ; double res = ex11(x, y) ; Frama_C_domain_show_each_ex11(res) ; } //test04_dqmom9 { double m0 = Frama_C_double_interval(-1.0, 1.0) ; double m1 = Frama_C_double_interval(-1.0, 1.0) ; double m2 = Frama_C_double_interval(-1.0, 1.0) ; double w0 = Frama_C_double_interval(1e-05, 1.0) ; double w1 = Frama_C_double_interval(1e-05, 1.0) ; double w2 = Frama_C_double_interval(1e-05, 1.0) ; double a0 = Frama_C_double_interval(1e-05, 1.0) ; double a1 = Frama_C_double_interval(1e-05, 1.0) ; double a2 = Frama_C_double_interval(1e-05, 1.0) ; double res = ex12(w1, a1, a0, w0, w2, a2, m0, m2, m1) ; Frama_C_domain_show_each_ex12(res) ; } //test05_nonlin1_r4 { double x = Frama_C_double_interval(1.00001, 2.0) ; double res = ex13(x) ; Frama_C_domain_show_each_ex13(res) ; } //test05_nonlin1_test2 { double x = Frama_C_double_interval(1.00001, 2.0) ; double res = ex14(x) ; Frama_C_domain_show_each_ex14(res) ; } //doppler1 { double u = Frama_C_double_interval(-100.0, 100.0) ; double v = Frama_C_double_interval(20.0, 20000.0) ; double T = Frama_C_double_interval(-30.0, 50.0) ; double res = ex15(v, u, T) ; Frama_C_domain_show_each_ex15(res) ; } //doppler2 { double u = Frama_C_double_interval(-125.0, 125.0) ; double v = Frama_C_double_interval(15.0, 25000.0) ; double T = Frama_C_double_interval(-40.0, 60.0) ; double res = ex16(v, u, T) ; Frama_C_domain_show_each_ex16(res) ; } //doppler3 { double u = Frama_C_double_interval(-30.0, 120.0) ; double v = Frama_C_double_interval(320.0, 20300.0) ; double T = Frama_C_double_interval(-50.0, 30.0) ; double res = ex17(v, u, T) ; Frama_C_domain_show_each_ex17(res) ; } //rigidBody1 { double x1 = Frama_C_double_interval(-15.0, -0.1) ; double x2 = Frama_C_double_interval(0.1, 15.0) ; double x3 = Frama_C_double_interval(-15.0, -0.1) ; double res = ex18(x3, x2, x1) ; Frama_C_domain_show_each_ex18(res) ; } //rigidBody2 { double x1 = Frama_C_double_interval(-15.0, -11.25) ; double x2 = Frama_C_double_interval(-15.0, -11.25) ; double x3 = Frama_C_double_interval(-15.0, -11.25) ; double res = ex19(x3, x2, x1) ; Frama_C_domain_show_each_ex19(res) ; } //turbine1 { double v = Frama_C_double_interval(-4.5, -0.3) ; double w = Frama_C_double_interval(0.4, 0.9) ; double r = Frama_C_double_interval(3.8, 7.8) ; double res = ex20(v, w, r) ; Frama_C_domain_show_each_ex20(res) ; } //turbine2 { double v = Frama_C_double_interval(-4.5, -3.3) ; double w = Frama_C_double_interval(-0.4, -0.1) ; double r = Frama_C_double_interval(3.8, 7.8) ; double res = ex21(v, w, r) ; Frama_C_domain_show_each_ex21(res) ; } //turbine3 { double v = Frama_C_double_interval(-4.5, -0.3) ; double w = Frama_C_double_interval(0.4, 0.9) ; double r = Frama_C_double_interval(3.8, 7.8) ; double res = ex22(v, w, r) ; Frama_C_domain_show_each_ex22(res) ; } //verhulst { double x = Frama_C_double_interval(0.1, 0.3) ; double res = ex23(x) ; Frama_C_domain_show_each_ex23(res) ; } //predatorPrey { double x = Frama_C_double_interval(0.1, 0.3) ; double res = ex24(x) ; Frama_C_domain_show_each_ex24(res) ; } //carbonGas { double v = Frama_C_double_interval(0.1, 0.5) ; double res = ex25(v) ; Frama_C_domain_show_each_ex25(res) ; } //sine { double x = Frama_C_double_interval(0.875, 1.57079632679) ; double res = ex26(x) ; Frama_C_domain_show_each_ex26(res) ; } //sqroot { double x = Frama_C_double_interval(0.0, 1.0) ; double res = ex27(x) ; Frama_C_domain_show_each_ex27(res) ; } //sineOrder3 { double x = Frama_C_double_interval(-2.0, -1.125) ; double res = ex28(x) ; Frama_C_domain_show_each_ex28(res) ; } return 0 ; } frama-c-20.0-Calcium/tests/value/numerors/oracle/0000777000000000000000000000000013571573400016610 5ustar frama-c-20.0-Calcium/tests/value/numerors/oracle/numerors.res.oracle0000666000000000000000000005256213571573400022453 0ustar [eva] Warning: The numerors domain is experimental. [kernel] Parsing tests/value/numerors/numerors.c (with preprocessing) [kernel:parser:decimal-float] tests/value/numerors/numerors.c:24: Warning: Floating-point constant 0.69314718056 is not represented exactly. Will use 0x1.62e42fefa3bdcp-1. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [kernel:typing:implicit-function-declaration] tests/value/numerors/numerors.c:246: Warning: Calling undeclared function DPRINTFrama_C_domain_show_each_ex10. Old style K&R code? [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] using specification for function Frama_C_double_interval [eva] tests/value/numerors/numerors.c:175: Frama_C_domain_show_each_ex0: res : # Cvalue domain: [1.60171325191e-16 .. 13.9069790712] # numerors: Exact : [0.0000000000000000000000000000000000000000E0 ; 0.1390697907123480622606275603218668502037E2] Approx : [0.16017132519073324E-15 ; 0.13906979071234806E2] :: Double Abs Err : [-0.6872322967884114849286679416803461995281E-13 ; 0.6814624853785664269739340909405869167913E-13] Rel Err : {NaN}[-@Inf@ ; @Inf@] [eva] tests/value/numerors/numerors.c:181: Frama_C_domain_show_each_ex1: res_0 : # Cvalue domain: [1. .. 2.] # numerors: Exact : [0.1000000000000000000000000000000000000000E1 ; 0.2000000000000000000000000000000000000000E1] Approx : [0.10000000000000000E1 ; 0.20000000000000000E1] :: Double Abs Err : [-0.2220446049250313080847263336181640625000E-15 ; 0.2220446049250313080847263336181640625000E-15] Rel Err : [-0.1110223024625156540423631668090820312500E-15 ; 0.1110223024625156540423631668090820312500E-15] [eva] tests/value/numerors/numerors.c:188: Frama_C_domain_show_each_ex2: res_1 : # Cvalue domain: [2. .. 3495.] # numerors: Exact : [0.2000000000000000000000000000000000000000E1 ; 0.3495000000000000000000000000000000000000E4] Approx : [0.20000000000000000E1 ; 0.34949999999999995E4] :: Double Abs Err : [-0.8433254095052689081057906150817871093750E-12 ; 0.8433254095052689081057906150817871093750E-12] Rel Err : [-0.8881784197001252754797360887467345688648E-15 ; 0.8881784197001253617613975972949103649613E-15] [eva] tests/value/numerors/numerors.c:194: Frama_C_domain_show_each_ex3: res_2 : # Cvalue domain: [0.0337542351052 .. 8.95097760024] # numerors: Exact : [0.3375423510518920966949169416556651945629E-1 ; 0.8950977600240098913885247155101311206002E1] Approx : [0.33754235105189205E-1 ; 0.89509776002400994E1] :: Double Abs Err : [-0.5483002744215625940572962640894922696096E-14 ; 0.5483002744215625619742990194211273224505E-14] Rel Err : [-0.6559951477854231429232012065810737101423E-15 ; 0.6559951477854236047867747502423701377016E-15] [eva] tests/value/numerors/numerors.c:201: Frama_C_domain_show_each_ex3b: res_3 : # Cvalue domain: [0.978318343479 .. 3.09371424212] # numerors: Exact : [0.9783183434785159564221044363850222152518E0 ; 0.3093714242115046288104330996683226579188E1] Approx : [0.97831834347851587E0 ; 0.30937142421150465E1] :: Double Abs Err : [-0.1277667385507086358965123148387792119576E-14 ; 0.1277667385507086244854347066867404524747E-14] Rel Err : [-0.4914871294831948016034334832375710273403E-15 ; 0.4914871294831949090271396563319978405399E-15] [eva] tests/value/numerors/numerors.c:212: Frama_C_domain_show_each_ex6: res_4 : # Cvalue domain: [302.104204 .. 888.8981992] # numerors: Exact : [0.3021042039999999946535094077354476426274E3 ; 0.8888981992000000696700647968145915176558E3] Approx : [0.30210420399999998E3 ; 0.88889819920000014E3] :: Double Abs Err : [-0.3634963879374508791577285881076208118731E-12 ; 0.3634963879374508791577285881076208118731E-12] Rel Err : [-0.1203215258591538453369909571455158421791E-14 ; 0.1203215258591538453369909571455158421791E-14] [eva] tests/value/numerors/numerors.c:218: Frama_C_domain_show_each_ex7: res_5 : # Cvalue domain: [-0. .. 999.] # numerors: Exact : [0.0000000000000000000000000000000000000000E0 ; 0.9990000000000000000000000000000000000000E3] Approx : [0.00000000000000000E0 ; 0.99900000000000000E3] :: Double Abs Err : [-0.1677546990208611532580107450485229492188E-12 ; 0.1677546990208611532580107450485229492188E-12] Rel Err : [-0.1000000000000000000000000000000000000000E1 ; 0.1000000000000000222044604925031332736641E1] [eva] tests/value/numerors/numerors.c:225: Frama_C_domain_show_each_ex8: res_6 : # Cvalue domain: [0.0001334 .. 748.875937031] # numerors: Exact : [0.1333999999999853007655777522215634571138E-3 ; 0.7488759370313796393766912581415073207576E3] Approx : [0.13339999999997982E-3 ; 0.74887593703139316E3] :: Double Abs Err : [-0.6281868632904980036355881586033195687787E-10 ; 0.6281868632904978648301330246081703393322E-10] Rel Err : [-0.1394024964317243270152811996722122989506E-12 ; 0.1394024964317476250489121282425932120066E-12] [eva] tests/value/numerors/numerors.c:233: Frama_C_domain_show_each_ex9: res_7 : # Cvalue domain: [0. .. 9.] # numerors: Exact : [0.0000000000000000000000000000000000000000E0 ; 0.9000000000000000000000000000000000000000E1] Approx : [0.00000000000000000E0 ; 0.90000000000000000E1] :: Double Abs Err : [-0.3330669073875469621270895004272460937500E-14 ; 0.3330669073875469621270895004272460937500E-14] Rel Err : {NaN}[-@Inf@ ; @Inf@] [kernel:annot:missing-spec] tests/value/numerors/numerors.c:246: Warning: Neither code nor specification for function DPRINTFrama_C_domain_show_each_ex10, generating default assigns from the prototype [eva] using specification for function DPRINTFrama_C_domain_show_each_ex10 [eva] tests/value/numerors/numerors.c:253: Frama_C_domain_show_each_ex11: res_9 : # Cvalue domain: [-10. .. 9.] # numerors: Exact : [-0.9999999999999999444888487687421760603063E1 ; 0.8999999999999999444888487687421760603063E1] Approx : [-0.10000000000000000E2 ; 0.90000000000000000E1] :: Double Abs Err : [-0.3108624468950438189926652229871209121695E-14 ; 0.3108624468950438189926652229871209121695E-14] Rel Err : {NaN}[-@Inf@ ; @Inf@] [eva] tests/value/numerors/numerors.c:267: Frama_C_domain_show_each_ex12: res_10 : # Cvalue domain: [-90000000000. .. 90000000000.] # numerors: Exact : [-0.8999999999999998527545029547436608851484E11 ; 0.8999999999999998527545029547436608851484E11] Approx : [-0.89999999999999969E11 ; 0.89999999999999969E11] :: Double Abs Err : [-0.8635914150545432128142627823909072074997E-4 ; 0.8635914150545432128142627823909072074997E-4] Rel Err : {NaN}[-@Inf@ ; @Inf@] [eva] tests/value/numerors/numerors.c:273: Frama_C_domain_show_each_ex13: res_11 : # Cvalue domain: [3.33333333336e-06 .. 49999.7500009] # numerors: Exact : [0.3333333333355170680079027079045772552490E-5 ; 0.4999975000092243354885617849491239040532E5] Approx : [0.33333333333551707E-5 ; 0.49999750000901753E5] :: Double Abs Err : [-0.2775732718567027525067161305837110287050E-6 ; 0.2775732718567027525067161305837110287050E-6] Rel Err : [-0.5551531456831610179749247367088410229787E-11 ; 0.5551531456893246717431747290382925386036E-11] [eva] tests/value/numerors/numerors.c:279: Frama_C_domain_show_each_ex14: res_12 : # Cvalue domain: [0.333333333333 .. 0.499997500012] # numerors: Exact : [0.3333333333333333333333333333333333333324E0 ; 0.4999975000124999211224662180394492022040E0] Approx : [0.33333333333333331E0 ; 0.49999750001249993E0] :: Double Abs Err : [-0.8326617173953773290385013211266127132753E-16 ; 0.8326617173953773290385013211266127132753E-16] Rel Err : [-0.1942884742006656004728570708900745304743E-15 ; 0.1942884742006656436133616254818044541448E-15] [eva] tests/value/numerors/numerors.c:287: Frama_C_domain_show_each_ex15: res_13 : # Cvalue domain: [-158.71914441 .. -0.0294424405923] # numerors: Exact : [-0.1587191444098274115955446209844803067978E3 ; -0.2944244059231351257710791058441647506465E-1] Approx : [-0.15871914440982744E3 ; -0.29442440592313514E-1] :: Double Abs Err : [-0.1612638843178377622324642063347794130201E-12 ; 0.1131249523134862193732856437881723057227E-12] Rel Err : [-0.8037262132110641500497794485461413919033E-15 ; 0.1087562440079161300103746120138817306955E-14] [eva] tests/value/numerors/numerors.c:295: Frama_C_domain_show_each_ex16: res_14 : # Cvalue domain: [-276.076533164 .. -0.0190177456065] # numerors: Exact : [-0.2760765331640504770698676515851031086582E3 ; -0.1901774560649244635436704521232894339985E-1] Approx : [-0.27607653316405055E3 ; -0.19017745606492449E-1] :: Double Abs Err : [-0.3256292179541437208740488266853534070327E-12 ; 0.2211307468314929517580310302380396746946E-12] Rel Err : [-0.8484502047655877231613027117059095969693E-15 ; 0.1202567997077699441659111747996405715480E-14] [eva] tests/value/numerors/numerors.c:303: Frama_C_domain_show_each_ex17: res_15 : # Cvalue domain: [-96.2940054272 .. -0.437730749478] # numerors: Exact : [-0.9629400542724778150250156262812600294936E2 ; -0.4377307494777530136197221375536929084148E0] Approx : [-0.96294005427247797E2 ; -0.43773074947775303E0] :: Double Abs Err : [-0.8468477552955525820717069386585896489452E-13 ; 0.6514096687868988734638545330938000772540E-13] Rel Err : [-0.7835148480723063129830501593306965288073E-15 ; 0.9659496077498560340092621058073705763325E-15] [eva] tests/value/numerors/numerors.c:311: Frama_C_domain_show_each_ex18: res_16 : # Cvalue domain: [0.23 .. 705.] # numerors: Exact : [0.2300000000000000144328993201270351179518E0 ; 0.7050000000000000000000000000000000000000E3] Approx : [0.23000000000000001E0 ; 0.70500000000000000E3] :: Double Abs Err : [-0.2398081733190338127315044403076171875000E-12 ; 0.2398081733190338127315044403076171875000E-12] Rel Err : [-0.7769699762951025096944871633634846936580E-15 ; 0.7769699762951025343386195185366972103319E-15] [eva] tests/value/numerors/numerors.c:319: Frama_C_domain_show_each_ex19: res_17 : # Cvalue domain: [-56604.375 .. -17500.7226562] # numerors: Exact : [-0.5660437500000000000000000000000000000000E5 ; -0.1750072265625000000000000000000000000000E5] Approx : [-0.56604375000000000E5 ; -0.17500722656250000E5] :: Double Abs Err : [-0.2311573155111545929685235023498535156250E-10 ; 0.2311573155111545929685235023498535156250E-10] Rel Err : [-0.9599726972336419077172240991279643575220E-15 ; 0.9599726972336419828137219509953929714914E-15] [eva] tests/value/numerors/numerors.c:327: Frama_C_domain_show_each_ex20: res_18 : # Cvalue domain: [-58.3291268902 .. -1.55052857215] # numerors: Exact : [-0.5832912689020381398067797299148505129648E2 ; -0.1550528572148073522313766360019326035054E1] Approx : [-0.58329126890203817E2 ; -0.15505285721480737E1] :: Double Abs Err : [-0.4730697503829382129027399925956529859776E-13 ; 0.4730697503829382129027399925956529859776E-13] Rel Err : [-0.3051022463440039392068299689909525546473E-13 ; 0.3051022463440039392068299689909525546473E-13] [eva] tests/value/numerors/numerors.c:335: Frama_C_domain_show_each_ex21: res_19 : # Cvalue domain: [-29.45668 .. -17.2064186047] # numerors: Exact : [-0.2945668000000000000157247952033272198063E2 ; -0.1720641860465116118096387512384970406998E2] Approx : [-0.29456679999999999E2 ; -0.17206418604651159E2] :: Double Abs Err : [-0.8574649403470366002128123689729074042771E-14 ; 0.8574649403470366002128123689729074042771E-14] Rel Err : [-0.4983401601744424370920185165421154732898E-15 ; 0.4983401601744424370920185165421154732898E-15] [eva] tests/value/numerors/numerors.c:343: Frama_C_domain_show_each_ex22: res_20 : # Cvalue domain: [0.466095844875 .. 40.3751268902] # numerors: Exact : [0.4660958448753461188415837845944154629506E0 ; 0.4037512689020381374686500400542710311727E2] Approx : [0.46609584487534628E0 ; 0.40375126890203816E2] :: Double Abs Err : [-0.3847214473505710097066292589685237582544E-13 ; 0.3847214473505710097066292589685237582544E-13] Rel Err : [-0.7503001469467220611440194097877310286712E-13 ; 0.7503001469467220611440194097877310286712E-13] [eva] tests/value/numerors/numerors.c:349: Frama_C_domain_show_each_ex23: res_21 : # Cvalue domain: [0.314893617021 .. 1.10082644628] # numerors: Exact : [0.3148936170212766157042358765415951814629E0 ; 0.1100826446280991689748168076657706284150E1] Approx : [0.31489361702127666E0 ; 0.11008264462809918E1] :: Double Abs Err : [-0.3303730805571862333870711656253103896878E-15 ; 0.3716038002337877906151465102741893473761E-15] Rel Err : [-0.3287861107517272234931398743194668081979E-15 ; 0.3662404431906822043894328428967861666413E-15] [eva] tests/value/numerors/numerors.c:355: Frama_C_domain_show_each_ex24: res_22 : # Cvalue domain: [0.037277059224 .. 0.357101682634] # numerors: Exact : [0.3727705922396188315553910536810374136040E-1 ; 0.3571016826342484234552761955006389263168E0] Approx : [0.37277059223961892E-1 ; 0.35710168263424841E0] :: Double Abs Err : [-0.1313017243835630183159929396718348939639E-15 ; 0.1399805988350607027320916630544501911918E-15] Rel Err : [-0.4534121467923005490925282815272109351436E-15 ; 0.4777157971909094354555439318653432884464E-15] [eva] tests/value/numerors/numerors.c:361: Frama_C_domain_show_each_ex25: res_23 : # Cvalue domain: [2097409.2 .. 34343230.] # numerors: Exact : [0.2097409200000000203193013824945250028307E7 ; 0.3434322999999999796410298932210208492067E8] Approx : [0.20974092000000002E7 ; 0.34343230000000000E8] :: Double Abs Err : [-0.1894834534752476505050509244649967340148E-7 ; 0.1993876287329499120388584774975653479550E-7] Rel Err : [-0.6826270855317666580438337875158337973839E-15 ; 0.7079318169668344451021328448332520415253E-15] [eva] tests/value/numerors/numerors.c:367: Frama_C_domain_show_each_ex26: res_24 : # Cvalue domain: [0.228628389494 .. 1.53875739135] # numerors: Exact : [0.2286283894941354341682482558349743716163E0 ; 0.1538757391347667405409134113796570280684E1] Approx : [0.22862838949413544E0 ; 0.15387573913476675E1] :: Double Abs Err : [-0.5181361907845419705744219345541902609430E-15 ; 0.5181361907845419705744219345541902609430E-15] Rel Err : [-0.1735051065540738928615478866398739207711E-14 ; 0.1735051065540738825042934451768543295544E-14] [eva] tests/value/numerors/numerors.c:373: Frama_C_domain_show_each_ex27: res_25 : # Cvalue domain: [0.8359375 .. 1.5625] # numerors: Exact : [0.8359375000000000000000000000000000000000E0 ; 0.1562500000000000000000000000000000000000E1] Approx : [0.83593750000000000E0 ; 0.15625000000000000E1] :: Double Abs Err : [-0.5620504062164854985894635319709777832031E-15 ; 0.5620504062164854985894635319709777832031E-15] Rel Err : [-0.6723593644458891945743115148811696845812E-15 ; 0.6723593644458891945743115148811696845812E-15] [eva] tests/value/numerors/numerors.c:379: Frama_C_domain_show_each_ex28: res_26 : # Cvalue domain: [-1.7261767499 .. -0.0422467640079] # numerors: Exact : [-0.1726176749901162501132812500000000000004E1 ; -0.4224676400790965999999999999999999998971E-1] Approx : [-0.17261767499011627E1 ; -0.42246764007909610E-1] :: Double Abs Err : [-0.5867853536391490212420248588143346856126E-15 ; 0.5570994050918043816793619293944153365339E-15] Rel Err : [-0.1075409232850577199876876365727845835922E-13 ; 0.1099687719037347795339717936867396431953E-13] [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function ex0: x ∈ [0.5 .. 1.] n ∈ [1..14] y ∈ [1.11022302463e-16 .. 0.5] lx ∈ [1.11022302463e-16 .. 0.688541666667] __retres ∈ [1.60171325191e-16 .. 13.9069790712] [eva:final-states] Values at end of function ex1: x ∈ [1. .. 10000.] temp ∈ [1. .. 2.] [eva:final-states] Values at end of function ex10: __retres ∈ [8. .. 16.] [eva:final-states] Values at end of function ex11: __retres ∈ [-10. .. 9.] [eva:final-states] Values at end of function ex12: v2 ∈ [-30000000000. .. 30000000000.] v1 ∈ [-30000000000. .. 30000000000.] v0 ∈ [-30000000000. .. 30000000000.] __retres ∈ [-90000000000. .. 90000000000.] [eva:final-states] Values at end of function ex13: r1 ∈ [1.00000000001e-05 .. 1.] r2 ∈ [1.0000200001 .. 4.] __retres ∈ [3.33333333336e-06 .. 49999.7500009] [eva:final-states] Values at end of function ex14: __retres ∈ [0.333333333333 .. 0.499997500012] [eva:final-states] Values at end of function ex15: t1 ∈ [313.4 .. 361.4] __retres ∈ [-158.71914441 .. -0.0294424405923] [eva:final-states] Values at end of function ex16: t1 ∈ [307.4 .. 367.4] __retres ∈ [-276.076533164 .. -0.0190177456065] [eva:final-states] Values at end of function ex17: t1 ∈ [301.4 .. 349.4] __retres ∈ [-96.2940054272 .. -0.437730749478] [eva:final-states] Values at end of function ex18: __retres ∈ [0.23 .. 705.] [eva:final-states] Values at end of function ex19: __retres ∈ [-56604.375 .. -17500.7226562] [eva:final-states] Values at end of function ex2: x ∈ [1. .. 10000.] temp ∈ [2. .. 3495.] [eva:final-states] Values at end of function ex20: __retres ∈ [-58.3291268902 .. -1.55052857215] [eva:final-states] Values at end of function ex21: __retres ∈ [-29.45668 .. -17.2064186047] [eva:final-states] Values at end of function ex22: __retres ∈ [0.466095844875 .. 40.3751268902] [eva:final-states] Values at end of function ex23: r ∈ {4.} K ∈ {1.11} __retres ∈ [0.314893617021 .. 1.10082644628] [eva:final-states] Values at end of function ex24: r ∈ {4.} K ∈ {1.11} __retres ∈ [0.037277059224 .. 0.357101682634] [eva:final-states] Values at end of function ex25: p ∈ {35000000.} a ∈ {0.401} b ∈ {4.27e-05} t ∈ {300.} n ∈ {1000.} k ∈ {1.3806503e-23} __retres ∈ [2097409.2 .. 34343230.] [eva:final-states] Values at end of function ex26: __retres ∈ [0.228628389494 .. 1.53875739135] [eva:final-states] Values at end of function ex27: __retres ∈ [0.8359375 .. 1.5625] [eva:final-states] Values at end of function ex28: __retres ∈ [-1.7261767499 .. -0.0422467640079] [eva:final-states] Values at end of function ex6: __retres ∈ [302.104204 .. 888.8981992] [eva:final-states] Values at end of function ex7: __retres ∈ [-0. .. 999.] [eva:final-states] Values at end of function ex8: t ∈ [1.002001 .. 4.] __retres ∈ [0.0001334 .. 748.875937031] [eva:final-states] Values at end of function ex9: p0 ∈ [0. .. 3.] p1 ∈ [0. .. 3.] p2 ∈ [0. .. 3.] __retres ∈ [0. .. 9.] [eva:final-states] Values at end of function ex3: __retres ∈ [0.0337542351052 .. 8.95097760024] [eva:final-states] Values at end of function ex3b: __retres ∈ [0.978318343479 .. 3.09371424212] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] __retres ∈ {0} [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 29 functions analyzed (out of 29): 100% coverage. In these functions, 257 statements reached (out of 257): 100% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 0 warnings by the Frama-C kernel: 0 errors 3 warnings ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 0 valid 0 unknown 0 invalid 0 total Preconditions 146 valid 0 unknown 0 invalid 146 total 100% of the logical properties reached have been proven. ---------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/octagons.c0000666000000000000000000001275313571573400015462 0ustar /* run.config* STDOPT: +" -eva-octagon-domain -eva-octagon-through-calls -eva-msg-key=d-octagon,-d-cvalue" */ #include <__fc_builtin.h> volatile int undet; /* Minimal example from the Eva user manual. */ void demo () { int y = undet; int k = Frama_C_interval(0, 10); int x = y - k; int r = x + 3 - y; // r \in [-7..3] int t; if (y > 15) t = x; // t \in [6..] } /* Same example as [demo] but with other integer types. */ void integer_types () { unsigned int k, x, y, r, t; y = undet; k = Frama_C_interval(0, 10); x = y - k; // No octagon inferred as [y - k] may overflow. r = x + 3 - y; if (y > 15) t = x; Frama_C_show_each_unreduced_unsigned(r, t); char ck, cx, cy, cr, ct; cy = undet; ck = Frama_C_interval(0, 10); cx = cy - ck; // An octagon should be inferred despite the casts to int. cr = cx + 3 - cy; if (cy > 15) ct = cx; Frama_C_show_each_reduced_char(cr, ct); } /* A test with multiple mathematical operations to complicate the inference and use of octagons. */ void arith () { int k = Frama_C_interval(0, 4); int a, b, x, y, r; /* 1. Infer octagons from assignments. */ a = Frama_C_interval(5, 25); b = Frama_C_interval(-12, 12); x = 1 - (a + 2*k - 4); // x + a ∈ [-3..5] y = 4*4 - k + (1 + b); // y - b ∈ [13..17] /* 1.1 Use octagons in the evaluation of expressions. */ r = 2 * (10 - (b - 1 - y) - (x - 2 + a)); // r ∈ [42..66] Frama_C_show_each_precise(r); r = 2 * (10 - (b + x - 3 - y + a)); // r ∈ [42..66] Frama_C_show_each_imprecise(r); k = Frama_C_interval(0, 4); /* 1.1 Use octagons to propagate variable reductions. */ if (12 - x < (k+1)*3) { // x > -3 r = 10 * a; // so a < 8 Frama_C_show_each(r); // {50; 60; 70} } /* 2. Infer octagons from conditions. */ a = Frama_C_interval(-1024, 1024); b = Frama_C_interval(-1024, 1024); if (20*k - a - 17 < 5 - b + (1 << 3) // a - b > -30 && a + (k+6)/2 - b <= 32) { // a - b <= 29 r = b - a; Frama_C_show_each(r); // [-29..29] } if (a < b && b <= a) Frama_C_show_each_BOTTOM(a, b); } /* Tests the join of the octagon domain. */ void join () { int a, b, r; int k = Frama_C_interval(-1, 4); if (undet) { a = undet; b = a + k; } else { a = Frama_C_interval(-32, -10); b = k * 5; } // In both cases, we have b - a >= -1. The "else" branch was more precise. r = b - a + 1; Frama_C_show_each_join_positive(r); if (undet) { a = undet; b = - (a + k); } else { a = Frama_C_interval(-32, -10); b = k * 5; } // In both cases, we have b + a <= 10. The "then" branch was more precise. r = b + a - 10; Frama_C_show_each_join_negative(r); } /* Tests the octagon domain within loops. */ void loop () { int k = Frama_C_interval(-8, 8); int a = Frama_C_interval(-1024, 1024); int b = a + 1; int c = a + 1; int d = a + k; for (int i = 0; i < 421; i++) { a = a + 2; b = b + 2; // The relation between a and b should be maintained in the loop. c = c + 1; // The relation between a and c should be lost in the loop. d = a + k; // This relation should be maintained. } int d1 = b - a; int d2 = c - a; int d3 = d - a; Frama_C_show_each_singleton_1(d1); Frama_C_show_each_imprecise(d2); Frama_C_show_each_precise(d3); } /* Tests the soundness of the octagon domain in presence of pointers. */ void pointers () { int x, y, r; int *px = &x, *pr = &r; x = Frama_C_interval(-1024, 1024); y = x + 1; r = y - x; Frama_C_show_each_singleton_1(r); *px = Frama_C_interval(-1024, 1024); Frama_C_show_each_singleton_1(r); *pr = Frama_C_interval(-1024, 1024); Frama_C_show_each_unknown(r); r = y - x; Frama_C_show_each_unknown(r); y = x + 2; r = y - x; Frama_C_show_each_singleton_2(r); } /* Tests the saturation of octagons: inference of a relation between (x, z) from relations between (x, y) and between (y, z). */ void saturate () { int k = Frama_C_interval(-6, 4); int x = Frama_C_interval(-1024, 1024); int y = k - x; int z = y + 1; int result = - z - x; // result == k + 1 Frama_C_show_each_saturate(result); // ∈ [-5..5] } int diff (int x, int y) { return x - y; } int neg (int x) { return -x; } /* Tests the propagation of octagons through function calls. */ void interprocedural () { int a = Frama_C_interval(-4, 12); int b = Frama_C_interval(-4, 12); int neg_a = neg(a); int neg_b = neg(b); /* [r1] is the direct difference [a-b], [r2] uses the result of the function [neg] (and thus need the octagon inferred in [neg]), and [r3] calls the function [diff] (and the analysis of [diff] needs the octagons inferred here about a and b). */ int r1, r2, r3; if (a > b) { r1 = a - b; r2 = a + neg_b; r3 = diff (a, b); } else { r1 = b - a; r2 = b + neg_a; r3 = diff (b, a); } /* With the interprocedural octagons, r1, r2 and r3 must be equally precise. */ Frama_C_show_each_equal(r1, r2, r3); } /* Prints the octagons state. */ void dump () { char k = Frama_C_interval(0, 8); char a = undet; char b = a + k; char c = b - k; Frama_C_dump_each(); } void main () { demo (); integer_types (); arith (); join (); loop (); pointers (); saturate (); interprocedural (); dump (); } frama-c-20.0-Calcium/tests/value/offset_misaligned.i0000666000000000000000000000014613571573400017326 0ustar char t[300]; int main(unsigned char u){ t[0] = 1; *(int*)(t+1) = 2; t[u+10] = 3; return 0; } frama-c-20.0-Calcium/tests/value/offset_neg.i0000666000000000000000000000033113571573400015757 0ustar char mem[1]; char *addr = mem; unsigned long long off = -1; int G[5]; int main () { addr = addr + off + 1; Frama_C_dump_each(); // the offset of addr overflow 64 bits. Beware in the pretty-printer G[-1] = 0; } frama-c-20.0-Calcium/tests/value/offset_top.i0000666000000000000000000000021513571573400016011 0ustar /* run.config* STDOPT: #"-absolute-valid-range 0-0xFF" */ int* T = (int*)0; int TAB[10]; void main() { int i; i = (int) &TAB[*T]; } frama-c-20.0-Calcium/tests/value/offsetmap.i0000666000000000000000000000241113571573400015625 0ustar /* run.config* GCC: STDOPT: #"" STDOPT: #"-eva-warn-copy-indeterminate=-f,-g" */ int TT[10]={1,2,3}; int T[10]={1,2,3}; int i,a,b; int a7, b7; int O1[20]; int O2[20]; int *p; int x2,*b2,a2; void f() { for (i = 0; i <= 8; i++) { TT[i] = i; *((int*)((char*)&(TT[i]) + 1)) = 0; } a = 1; if (b) i=5; else i=6; a=3; if (i>=2) { a = i ; T[i] = 7 ; } for (i = 0; i <= 8; i++) { *(char *) &a = 1; b = a; *((int*)(((char*)&(T[i])) + 1)) = 0; } a7 = 'a'; *(char *) &a7 = 1; b7 = (char)a7; ((int*)O1)[1]=17; ((char*)O1)[1]=18; ((int*)O2)[0]=10; ((char*)O2)[1]=11; O1[6]=0; p=O1+9; *p=1; x2 = 777; a2 = (int)&x2; b2 = (int*) a2; *((int*)a2) = 0; *b2=*b2+1; } int s[10000000]; /* Performance test on reading a value in an offsetmap. Here the offsetmap for s contains one value of 4 bytes repeated 10000000 times, and we read 1 byte at an unknown position in this offsetmap. 4 consecutive reads of 1 byte each are required to be sound. Doing 40000000 reads would be harshly inefficient (leading the analysis to not terminate on this function). */ void g(int i) { s[i] = 0x1030807; char *p = &s[i]; char c1 = *p; char *q = (char*)&s+i; char c2 = *q; } void main (int i) { f(); g(i); } frama-c-20.0-Calcium/tests/value/oracle/0000777000000000000000000000000013571573400014736 5ustar frama-c-20.0-Calcium/tests/value/oracle/CruiseControl.res.oracle0000666000000000000000000070144013571573400021516 0ustar [kernel] Parsing tests/value/CruiseControl.c (with preprocessing) [kernel:parser:decimal-float] tests/value/CruiseControl.c:577: Warning: Floating-point constant 8.113 is not represented exactly. Will use 0x1.039db22d0e560p3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [kernel] Parsing tests/value/CruiseControl_const.c (with preprocessing) [eva] Analyzing an incomplete application starting at CruiseControl [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization ZeroSpeed ∈ {0} SpeedInc ∈ {2.0000000000000000} SpeedMax ∈ {150.0000000000000000} SpeedMin ∈ {30.0000000000000000} ZeroPercent ∈ {0} Kp ∈ {8.1129999160766601} Ki ∈ {1.0000000000000000*2^-1} RegThrottleMax ∈ {45.0000000000000000} [eva] computing for function DetectPedalsPressed <- CruiseControl. Called from tests/value/CruiseControl.c:462. [eva] Recording results for DetectPedalsPressed [eva] Done for function DetectPedalsPressed [eva] computing for function DetectSpeedLimits <- CruiseControl. Called from tests/value/CruiseControl.c:473. [eva] Recording results for DetectSpeedLimits [eva] Done for function DetectSpeedLimits [eva] computing for function CruiseStateMgt <- CruiseControl. Called from tests/value/CruiseControl.c:486. [eva] Recording results for CruiseStateMgt [eva] Done for function CruiseStateMgt [eva] computing for function CruiseSpeedMgt <- CruiseControl. Called from tests/value/CruiseControl.c:508. [eva] Recording results for CruiseSpeedMgt [eva] Done for function CruiseSpeedMgt [eva] computing for function ThrottleCmd <- CruiseControl. Called from tests/value/CruiseControl.c:525. [eva] computing for function ThrottleRegulation <- ThrottleCmd <- CruiseControl. Called from tests/value/CruiseControl.c:242. [eva:alarm] tests/value/CruiseControl.c:172: Warning: non-finite float value. assert \is_finite((float)(_C_->_L1_CruiseControl - _C_->_L2_CruiseControl)); [eva:alarm] tests/value/CruiseControl.c:175: Warning: non-finite float value. assert \is_finite((float)(_C_->_L3_CruiseControl * _C_->_L6_CruiseControl)); [eva:alarm] tests/value/CruiseControl.c:194: Warning: non-finite float value. assert \is_finite((float)(_C_->_L16_CruiseControl + _C_->_L18_CruiseControl)); [eva:alarm] tests/value/CruiseControl.c:199: Warning: non-finite float value. assert \is_finite((float)(_C_->ProportionnalAction + _C_->IntegralAction)); [eva] computing for function SaturateThrottle <- ThrottleRegulation <- ThrottleCmd <- CruiseControl. Called from tests/value/CruiseControl.c:202. [eva:alarm] tests/value/CruiseControl.c:162: Warning: assertion got status unknown. [eva] Recording results for SaturateThrottle [eva] Done for function SaturateThrottle [eva] Recording results for ThrottleRegulation [eva] Done for function ThrottleRegulation [eva] Recording results for ThrottleCmd [eva] Done for function ThrottleCmd [eva] Recording results for CruiseControl [eva] done for function CruiseControl [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function CruiseSpeedMgt: __retres ∈ {1} S__C_[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel} ∈ [--..--] [0]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [0]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.BrakePressed; .AcceleratorPressed} ∈ {0; 1} [0]{._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [0]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.SpeedOutOffLimits; ._L82_CruiseControl} ∈ {0; 1} [0]{._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._L96_CruiseControl ∈ {0} [0]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [0]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt._L21_CruiseControl ∈ {0} [0]._C0_CruiseSpeedMgt._L10_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._L12_CruiseControl ∈ {2.0000000000000000} [0]._C0_CruiseSpeedMgt._L13_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._L15_CruiseControl ∈ {150.0000000000000000} [0]._C0_CruiseSpeedMgt._L16_CruiseControl ∈ {0; 1} [0]._C0_CruiseSpeedMgt._L4_CruiseControl ∈ [--..--] [0]._C0_CruiseSpeedMgt._L17_CruiseControl ∈ {0; 1} [0]._C0_CruiseSpeedMgt._L11_CruiseControl ∈ {2.0000000000000000} [0]._C0_CruiseSpeedMgt._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._L19_CruiseControl ∈ {30.0000000000000000} [0]._C0_CruiseSpeedMgt._L18_CruiseControl ∈ {0; 1} [0]._C0_CruiseSpeedMgt._L5_CruiseControl ∈ [--..--] [0]._C0_CruiseSpeedMgt._L20_CruiseControl ∈ {0; 1} [0]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ {0; 1} [0]._C1_DetectPedalsPressed._L2_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L8_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L4_CruiseControl ∈ {0; 1} [0]._C1_DetectPedalsPressed._L1_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L7_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L3_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ {0; 1} [0]._C2_DetectSpeedLimits._L7_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._L13_CruiseControl ∈ {30.0000000000000000} [0]._C2_DetectSpeedLimits._L8_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._L14_CruiseControl ∈ {150.0000000000000000} [0]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed}} ∈ {0; 1} [0]._C3_CruiseStateMgt{._I2_Resume; ._I3_On; ._I4_Off} ∈ [--..--] [0]._C3_CruiseStateMgt{._I5_SpeedOutOffLimits; ._O0_Regul_ON} ∈ {0; 1} [0]._C3_CruiseStateMgt{._O1_Regul_OFF; ._O2_Regul_STDBY; ._LE24_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE0_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE4_CruiseControl; ._LE40_CruiseControl; ._LE26_CruiseControl; ._LE28_CruiseControl; ._LE9_CruiseControl; ._LE10_CruiseControl; ._LE11_CruiseControl; ._LE33_CruiseControl; ._LE35_CruiseControl; ._LE38_CruiseControl; ._LE12_CruiseControl; ._LE13_CruiseControl; ._LE14_CruiseControl; ._LE17_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE18_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE3_CruiseControl; ._LE16_CruiseControl; ._LE41_CruiseControl; ._LE19_CruiseControl; ._LE20_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE21_CruiseControl; ._LE1_CruiseControl; ._LE5_CruiseControl; ._LE22_CruiseControl; ._LE23_CruiseControl; ._LE25_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE29_CruiseControl; ._LE2_CruiseControl; ._LE30_CruiseControl; ._LE31_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl; ._LE42_CruiseControl; ._LE6_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE27_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt._LE36_CruiseControl ∈ [--..--] [0]._C3_CruiseStateMgt._LE37_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE44_CruiseControl; ._LE8_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._M_init_0_CruiseControl ∈ {0} [0]{._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [0]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [0]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {[0]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl}; [1]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel}} ∈ [--..--] [1]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [1]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [1]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [1]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ [--..--] [1]._C1_DetectPedalsPressed{._L2_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L4_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._L1_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L3_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ [--..--] [1]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._L8_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [1]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [1]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl} ∈ [--..--] [eva:final-states] Values at end of function CruiseStateMgt: __retres ∈ {1} S__C_[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel} ∈ [--..--] [0]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [0]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.BrakePressed; .AcceleratorPressed} ∈ {0; 1} [0]{._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [0]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0].SpeedOutOffLimits ∈ {0; 1} [0]{._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [0]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [0]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ {0; 1} [0]._C1_DetectPedalsPressed._L2_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L8_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L4_CruiseControl ∈ {0; 1} [0]._C1_DetectPedalsPressed._L1_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L7_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L3_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ {0; 1} [0]._C2_DetectSpeedLimits._L7_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._L13_CruiseControl ∈ {30.0000000000000000} [0]._C2_DetectSpeedLimits._L8_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._L14_CruiseControl ∈ {150.0000000000000000} [0]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed}} ∈ {0; 1} [0]._C3_CruiseStateMgt{._I2_Resume; ._I3_On; ._I4_Off} ∈ [--..--] [0]._C3_CruiseStateMgt{._I5_SpeedOutOffLimits; ._O0_Regul_ON} ∈ {0; 1} [0]._C3_CruiseStateMgt{._O1_Regul_OFF; ._O2_Regul_STDBY; ._LE24_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE0_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE4_CruiseControl; ._LE40_CruiseControl; ._LE26_CruiseControl; ._LE28_CruiseControl; ._LE9_CruiseControl; ._LE10_CruiseControl; ._LE11_CruiseControl; ._LE33_CruiseControl; ._LE35_CruiseControl; ._LE38_CruiseControl; ._LE12_CruiseControl; ._LE13_CruiseControl; ._LE14_CruiseControl; ._LE17_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE18_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE3_CruiseControl; ._LE16_CruiseControl; ._LE41_CruiseControl; ._LE19_CruiseControl; ._LE20_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE21_CruiseControl; ._LE1_CruiseControl; ._LE5_CruiseControl; ._LE22_CruiseControl; ._LE23_CruiseControl; ._LE25_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE29_CruiseControl; ._LE2_CruiseControl; ._LE30_CruiseControl; ._LE31_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl; ._LE42_CruiseControl; ._LE6_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE27_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt._LE36_CruiseControl ∈ [--..--] [0]._C3_CruiseStateMgt._LE37_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE44_CruiseControl; ._LE8_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._M_init_0_CruiseControl ∈ {0} [0]{._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [0]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [0]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {[0]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl}; [1]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel}} ∈ [--..--] [1]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [1]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [1]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [1]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ [--..--] [1]._C1_DetectPedalsPressed{._L2_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L4_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._L1_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L3_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ [--..--] [1]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._L8_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [1]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [1]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl} ∈ [--..--] [eva:final-states] Values at end of function DetectPedalsPressed: __retres ∈ {1} S__C_[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel} ∈ [--..--] [0]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [0]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [0]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [0]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [0]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ {0; 1} [0]._C1_DetectPedalsPressed._L2_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L8_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L4_CruiseControl ∈ {0; 1} [0]._C1_DetectPedalsPressed._L1_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L7_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L3_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ [--..--] [0]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._L8_CruiseControl ∈ [--..--] [0]._C2_DetectSpeedLimits._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [0]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [0]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {[0]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl}; [1]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel}} ∈ [--..--] [1]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [1]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [1]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [1]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ [--..--] [1]._C1_DetectPedalsPressed{._L2_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L4_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._L1_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L3_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ [--..--] [1]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._L8_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [1]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [1]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl} ∈ [--..--] [eva:final-states] Values at end of function DetectSpeedLimits: __retres ∈ {1} S__C_[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel} ∈ [--..--] [0]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [0]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.BrakePressed; .AcceleratorPressed} ∈ {0; 1} [0]{._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [0]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [0]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [0]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ {0; 1} [0]._C1_DetectPedalsPressed._L2_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L8_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L4_CruiseControl ∈ {0; 1} [0]._C1_DetectPedalsPressed._L1_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L7_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L3_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ {0; 1} [0]._C2_DetectSpeedLimits._L7_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._L13_CruiseControl ∈ {30.0000000000000000} [0]._C2_DetectSpeedLimits._L8_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._L14_CruiseControl ∈ {150.0000000000000000} [0]._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl} ∈ {0; 1} [0]{._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [0]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [0]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {[0]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl}; [1]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel}} ∈ [--..--] [1]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [1]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [1]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [1]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ [--..--] [1]._C1_DetectPedalsPressed{._L2_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L4_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._L1_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L3_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ [--..--] [1]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._L8_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [1]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [1]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl} ∈ [--..--] [eva:final-states] Values at end of function SaturateThrottle: __retres ∈ {1} S__C_[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel} ∈ [--..--] [0]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [0]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.BrakePressed; .AcceleratorPressed} ∈ {0; 1} [0]{._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [0]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.SpeedOutOffLimits; ._L82_CruiseControl} ∈ {0; 1} [0]{._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._L96_CruiseControl ∈ {0} [0]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [0]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [0]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ {0; 1} [0]._C1_DetectPedalsPressed._L2_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L8_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L4_CruiseControl ∈ {0; 1} [0]._C1_DetectPedalsPressed._L1_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L7_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L3_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ {0; 1} [0]._C2_DetectSpeedLimits._L7_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._L13_CruiseControl ∈ {30.0000000000000000} [0]._C2_DetectSpeedLimits._L8_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._L14_CruiseControl ∈ {150.0000000000000000} [0]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed}} ∈ {0; 1} [0]._C3_CruiseStateMgt{._I2_Resume; ._I3_On; ._I4_Off} ∈ [--..--] [0]._C3_CruiseStateMgt{._I5_SpeedOutOffLimits; ._O0_Regul_ON} ∈ {0; 1} [0]._C3_CruiseStateMgt{._O1_Regul_OFF; ._O2_Regul_STDBY; ._LE24_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE0_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE4_CruiseControl; ._LE40_CruiseControl; ._LE26_CruiseControl; ._LE28_CruiseControl; ._LE9_CruiseControl; ._LE10_CruiseControl; ._LE11_CruiseControl; ._LE33_CruiseControl; ._LE35_CruiseControl; ._LE38_CruiseControl; ._LE12_CruiseControl; ._LE13_CruiseControl; ._LE14_CruiseControl; ._LE17_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE18_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE3_CruiseControl; ._LE16_CruiseControl; ._LE41_CruiseControl; ._LE19_CruiseControl; ._LE20_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE21_CruiseControl; ._LE1_CruiseControl; ._LE5_CruiseControl; ._LE22_CruiseControl; ._LE23_CruiseControl; ._LE25_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE29_CruiseControl; ._LE2_CruiseControl; ._LE30_CruiseControl; ._LE31_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl; ._LE42_CruiseControl; ._LE6_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE27_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt._LE36_CruiseControl ∈ [--..--] [0]._C3_CruiseStateMgt._LE37_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE44_CruiseControl; ._LE8_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._M_init_0_CruiseControl ∈ {0} [0]._M_condact_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._I0_Regul_ON ∈ {0; 1} [0]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._L21_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._L20_CruiseControl ∈ {1} [0]._C4_ThrottleCmd._L22_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd.ONRisingEdge ∈ {0; 1} [0]._C4_ThrottleCmd._L26_CruiseControl ∈ {0} [0]._C4_ThrottleCmd{._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._M_init_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._I0_Reset ∈ {0; 1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L6_CruiseControl ∈ {8.1129999160766601} [0]._C4_ThrottleCmd._C0_ThrottleRegulation.ProportionnalAction ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L22_CruiseControl ∈ {0} [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L16_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L23_CruiseControl ∈ {0} [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L18_CruiseControl; ._L10_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L8_CruiseControl ∈ {1.0000000000000000*2^-1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation.IntegralAction ∈ [-1.9999998807907104*2^126 .. 1.9999998807907104*2^126] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ {0; 1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L18_CruiseControl ∈ {45.0000000000000000} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L12_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ {0; 1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ {0} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ {0; 1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl ∈ {0; 1} {[0]._C4_ThrottleCmd._M_condact_2_CruiseControl; [1]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel}} ∈ [--..--] [1]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [1]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [1]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [1]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ [--..--] [1]._C1_DetectPedalsPressed{._L2_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L4_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._L1_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L3_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ [--..--] [1]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._L8_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [1]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [1]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl} ∈ [--..--] [eva:final-states] Values at end of function ThrottleRegulation: __retres ∈ {1} S__C_[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel} ∈ [--..--] [0]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [0]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.BrakePressed; .AcceleratorPressed} ∈ {0; 1} [0]{._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [0]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.SpeedOutOffLimits; ._L82_CruiseControl} ∈ {0; 1} [0]{._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._L96_CruiseControl ∈ {0} [0]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [0]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [0]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ {0; 1} [0]._C1_DetectPedalsPressed._L2_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L8_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L4_CruiseControl ∈ {0; 1} [0]._C1_DetectPedalsPressed._L1_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L7_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L3_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ {0; 1} [0]._C2_DetectSpeedLimits._L7_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._L13_CruiseControl ∈ {30.0000000000000000} [0]._C2_DetectSpeedLimits._L8_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._L14_CruiseControl ∈ {150.0000000000000000} [0]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed}} ∈ {0; 1} [0]._C3_CruiseStateMgt{._I2_Resume; ._I3_On; ._I4_Off} ∈ [--..--] [0]._C3_CruiseStateMgt{._I5_SpeedOutOffLimits; ._O0_Regul_ON} ∈ {0; 1} [0]._C3_CruiseStateMgt{._O1_Regul_OFF; ._O2_Regul_STDBY; ._LE24_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE0_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE4_CruiseControl; ._LE40_CruiseControl; ._LE26_CruiseControl; ._LE28_CruiseControl; ._LE9_CruiseControl; ._LE10_CruiseControl; ._LE11_CruiseControl; ._LE33_CruiseControl; ._LE35_CruiseControl; ._LE38_CruiseControl; ._LE12_CruiseControl; ._LE13_CruiseControl; ._LE14_CruiseControl; ._LE17_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE18_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE3_CruiseControl; ._LE16_CruiseControl; ._LE41_CruiseControl; ._LE19_CruiseControl; ._LE20_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE21_CruiseControl; ._LE1_CruiseControl; ._LE5_CruiseControl; ._LE22_CruiseControl; ._LE23_CruiseControl; ._LE25_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE29_CruiseControl; ._LE2_CruiseControl; ._LE30_CruiseControl; ._LE31_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl; ._LE42_CruiseControl; ._LE6_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE27_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt._LE36_CruiseControl ∈ [--..--] [0]._C3_CruiseStateMgt._LE37_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE44_CruiseControl; ._LE8_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._M_init_0_CruiseControl ∈ {0} [0]._M_condact_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._I0_Regul_ON ∈ {0; 1} [0]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._L21_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._L20_CruiseControl ∈ {1} [0]._C4_ThrottleCmd._L22_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd.ONRisingEdge ∈ {0; 1} [0]._C4_ThrottleCmd._L26_CruiseControl ∈ {0} [0]._C4_ThrottleCmd{._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._M_init_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._I0_Reset ∈ {0; 1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L6_CruiseControl ∈ {8.1129999160766601} [0]._C4_ThrottleCmd._C0_ThrottleRegulation.ProportionnalAction ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L22_CruiseControl ∈ {0} [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L16_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L23_CruiseControl ∈ {0} [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L18_CruiseControl; ._L10_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L8_CruiseControl ∈ {1.0000000000000000*2^-1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation.IntegralAction ∈ [-1.9999998807907104*2^126 .. 1.9999998807907104*2^126] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ {0; 1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ {0} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ {0; 1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L18_CruiseControl ∈ {45.0000000000000000} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L12_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ {0; 1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ {0} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ {0; 1} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl ∈ {0; 1} {[0]._C4_ThrottleCmd._M_condact_2_CruiseControl; [1]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel}} ∈ [--..--] [1]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [1]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [1]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [1]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ [--..--] [1]._C1_DetectPedalsPressed{._L2_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L4_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._L1_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L3_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ [--..--] [1]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._L8_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [1]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [1]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl} ∈ [--..--] [eva:final-states] Values at end of function ThrottleCmd: __retres ∈ {1} S__C_[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel} ∈ [--..--] [0]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [0]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.BrakePressed; .AcceleratorPressed} ∈ {0; 1} [0]{._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [0]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.SpeedOutOffLimits; ._L82_CruiseControl} ∈ {0; 1} [0]{._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._L96_CruiseControl ∈ {0} [0]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [0]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [0]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ {0; 1} [0]._C1_DetectPedalsPressed._L2_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L8_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L4_CruiseControl ∈ {0; 1} [0]._C1_DetectPedalsPressed._L1_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L7_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L3_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ {0; 1} [0]._C2_DetectSpeedLimits._L7_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._L13_CruiseControl ∈ {30.0000000000000000} [0]._C2_DetectSpeedLimits._L8_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._L14_CruiseControl ∈ {150.0000000000000000} [0]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed}} ∈ {0; 1} [0]._C3_CruiseStateMgt{._I2_Resume; ._I3_On; ._I4_Off} ∈ [--..--] [0]._C3_CruiseStateMgt{._I5_SpeedOutOffLimits; ._O0_Regul_ON} ∈ {0; 1} [0]._C3_CruiseStateMgt{._O1_Regul_OFF; ._O2_Regul_STDBY; ._LE24_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE0_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE4_CruiseControl; ._LE40_CruiseControl; ._LE26_CruiseControl; ._LE28_CruiseControl; ._LE9_CruiseControl; ._LE10_CruiseControl; ._LE11_CruiseControl; ._LE33_CruiseControl; ._LE35_CruiseControl; ._LE38_CruiseControl; ._LE12_CruiseControl; ._LE13_CruiseControl; ._LE14_CruiseControl; ._LE17_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE18_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE3_CruiseControl; ._LE16_CruiseControl; ._LE41_CruiseControl; ._LE19_CruiseControl; ._LE20_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE21_CruiseControl; ._LE1_CruiseControl; ._LE5_CruiseControl; ._LE22_CruiseControl; ._LE23_CruiseControl; ._LE25_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE29_CruiseControl; ._LE2_CruiseControl; ._LE30_CruiseControl; ._LE31_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl; ._LE42_CruiseControl; ._LE6_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE27_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt._LE36_CruiseControl ∈ [--..--] [0]._C3_CruiseStateMgt._LE37_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE44_CruiseControl; ._LE8_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._M_init_0_CruiseControl ∈ {0} [0]._M_condact_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._I0_Regul_ON ∈ {0; 1} [0]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._L21_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._L20_CruiseControl ∈ {0; 1} [0]._C4_ThrottleCmd._L22_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd.ONRisingEdge ∈ {0; 1} [0]._C4_ThrottleCmd._L26_CruiseControl ∈ {0} [0]._C4_ThrottleCmd{._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._M_init_0_CruiseControl ∈ {0} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._I0_Reset ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {[0]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl}; [1]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel}} ∈ [--..--] [1]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [1]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [1]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [1]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ [--..--] [1]._C1_DetectPedalsPressed{._L2_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L4_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._L1_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L3_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ [--..--] [1]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._L8_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [1]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [1]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl} ∈ [--..--] [eva:final-states] Values at end of function CruiseControl: __retres ∈ {1} S__C_[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel} ∈ [--..--] [0]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._O2_Regul_ON ∈ {0; 1} [0]{._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [0]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.BrakePressed; .AcceleratorPressed} ∈ {0; 1} [0]{._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [0]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]{.SpeedOutOffLimits; ._L82_CruiseControl} ∈ {0; 1} [0]{._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._L96_CruiseControl ∈ {0} [0]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [0]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._M_init_CruiseControl ∈ {0} [0]._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [0]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [0]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ {0; 1} [0]._C1_DetectPedalsPressed._L2_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L8_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L4_CruiseControl ∈ {0; 1} [0]._C1_DetectPedalsPressed._L1_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C1_DetectPedalsPressed._L7_CruiseControl ∈ {0} [0]._C1_DetectPedalsPressed._L3_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ {0; 1} [0]._C2_DetectSpeedLimits._L7_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C2_DetectSpeedLimits._L13_CruiseControl ∈ {30.0000000000000000} [0]._C2_DetectSpeedLimits._L8_CruiseControl ∈ {0; 1} [0]._C2_DetectSpeedLimits._L14_CruiseControl ∈ {150.0000000000000000} [0]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed}} ∈ {0; 1} [0]._C3_CruiseStateMgt{._I2_Resume; ._I3_On; ._I4_Off} ∈ [--..--] [0]._C3_CruiseStateMgt{._I5_SpeedOutOffLimits; ._O0_Regul_ON} ∈ {0; 1} [0]._C3_CruiseStateMgt{._O1_Regul_OFF; ._O2_Regul_STDBY; ._LE24_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE0_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE4_CruiseControl; ._LE40_CruiseControl; ._LE26_CruiseControl; ._LE28_CruiseControl; ._LE9_CruiseControl; ._LE10_CruiseControl; ._LE11_CruiseControl; ._LE33_CruiseControl; ._LE35_CruiseControl; ._LE38_CruiseControl; ._LE12_CruiseControl; ._LE13_CruiseControl; ._LE14_CruiseControl; ._LE17_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE18_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE3_CruiseControl; ._LE16_CruiseControl; ._LE41_CruiseControl; ._LE19_CruiseControl; ._LE20_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE21_CruiseControl; ._LE1_CruiseControl; ._LE5_CruiseControl; ._LE22_CruiseControl; ._LE23_CruiseControl; ._LE25_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE29_CruiseControl; ._LE2_CruiseControl; ._LE30_CruiseControl; ._LE31_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl; ._LE42_CruiseControl; ._LE6_CruiseControl} ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._LE27_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt._LE36_CruiseControl ∈ [--..--] [0]._C3_CruiseStateMgt._LE37_CruiseControl ∈ {0; 1} [0]._C3_CruiseStateMgt{._LE44_CruiseControl; ._LE8_CruiseControl} ∈ [--..--] [0]._C3_CruiseStateMgt._M_init_0_CruiseControl ∈ {0} [0]._M_condact_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._I0_Regul_ON ∈ {0; 1} [0]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._L21_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._L20_CruiseControl ∈ {0; 1} [0]._C4_ThrottleCmd._L22_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd.ONRisingEdge ∈ {0; 1} [0]._C4_ThrottleCmd._L26_CruiseControl ∈ {0} [0]._C4_ThrottleCmd{._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._M_init_0_CruiseControl ∈ {0} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._I0_Reset ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {[0]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl}; [1]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel}} ∈ [--..--] [1]{._I6_Accel; ._I7_Brake; ._I8_Speed; ._O0_Cruise_speed; ._O1_Throttle_cmd} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl} ∈ [--..--] [1]{._L59_CruiseControl; ._L62_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl} ∈ [--..--] [1]._L95_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{.SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._L96_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl} ∈ [--..--] [1]{._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._M_init_CruiseControl; ._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel}} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._I4_Speed; ._O0_CruiseSpeed; ._L1_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt{._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl} ∈ [--..--] [1]._C0_CruiseSpeedMgt{._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C0_CruiseSpeedMgt._M_init_0_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed} ∈ [--..--] [1]._C1_DetectPedalsPressed{._L2_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L4_CruiseControl ∈ [--..--] [1]._C1_DetectPedalsPressed{._L1_CruiseControl; ._L7_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C1_DetectPedalsPressed._L3_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._I0_speed ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits ∈ [--..--] [1]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C2_DetectSpeedLimits._L8_CruiseControl ∈ [--..--] [1]._C2_DetectSpeedLimits._L14_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]{._C2_DetectSpeedLimits{._L9_CruiseControl; ._L17_CruiseControl}; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd._I0_Regul_ON} ∈ [--..--] [1]._C4_ThrottleCmd{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge} ∈ [--..--] [1]._C4_ThrottleCmd{._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._M_init_0_CruiseControl; ._C0_ThrottleRegulation._I0_Reset} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation{._L14_CruiseControl; ._L19_CruiseControl} ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._I0_ThrottleIn; ._O0_ThrottleOut} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl ∈ [--..--] [1]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L6_CruiseControl; ._L8_CruiseControl} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] [1]._C4_ThrottleCmd{._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl; ._M_condact_2_CruiseControl} ∈ [--..--] [from] Computing for function CruiseSpeedMgt [from] Done for function CruiseSpeedMgt [from] Computing for function CruiseStateMgt [from] Done for function CruiseStateMgt [from] Computing for function DetectPedalsPressed [from] Done for function DetectPedalsPressed [from] Computing for function DetectSpeedLimits [from] Done for function DetectSpeedLimits [from] Computing for function SaturateThrottle [from] Done for function SaturateThrottle [from] Computing for function ThrottleRegulation [from] Done for function ThrottleRegulation [from] Computing for function ThrottleCmd [from] Done for function ThrottleCmd [from] Computing for function CruiseControl [from] Done for function CruiseControl [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function CruiseSpeedMgt: S__C_{[0]._C0_CruiseSpeedMgt._O0_CruiseSpeed; [0]._C0_CruiseSpeedMgt._L7_CruiseControl} FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; _C_; S__C_{[0]._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel; ._I4_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}} [0]._C0_CruiseSpeedMgt._L1_CruiseControl FROM _C_; S__C_[0]._C0_CruiseSpeedMgt._I4_Speed [0]._C0_CruiseSpeedMgt._L2_CruiseControl FROM _C_; S__C_[0]._C0_CruiseSpeedMgt._I1_Set [0]._C0_CruiseSpeedMgt._L3_CruiseControl FROM _C_; S__C_[0]._C0_CruiseSpeedMgt._I0_On [0]._C0_CruiseSpeedMgt._L6_CruiseControl FROM _C_; S__C_[0]._C0_CruiseSpeedMgt{._I0_On; ._I1_Set} [0]._C0_CruiseSpeedMgt._L21_CruiseControl FROM ZeroSpeed; _C_ [0]._C0_CruiseSpeedMgt._L10_CruiseControl FROM ZeroSpeed; _C_; S__C_[0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl} {[0]._C0_CruiseSpeedMgt._L12_CruiseControl; [0]._C0_CruiseSpeedMgt._L11_CruiseControl} FROM SpeedInc; _C_ {[0]._C0_CruiseSpeedMgt._L13_CruiseControl; [0]._C0_CruiseSpeedMgt._L14_CruiseControl} FROM ZeroSpeed; SpeedInc; _C_; S__C_[0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl} [0]._C0_CruiseSpeedMgt._L15_CruiseControl FROM SpeedMax; _C_ [0]._C0_CruiseSpeedMgt._L16_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; _C_; S__C_[0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl} [0]._C0_CruiseSpeedMgt._L4_CruiseControl FROM _C_; S__C_[0]._C0_CruiseSpeedMgt._I2_QuickAccel [0]._C0_CruiseSpeedMgt._L17_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; _C_; S__C_{[0]._C0_CruiseSpeedMgt._I2_QuickAccel; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}} [0]._C0_CruiseSpeedMgt._L19_CruiseControl FROM SpeedMin; _C_ [0]._C0_CruiseSpeedMgt._L18_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMin; _C_; S__C_[0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl} [0]._C0_CruiseSpeedMgt._L5_CruiseControl FROM _C_; S__C_[0]._C0_CruiseSpeedMgt._I3_QuickDecel [0]._C0_CruiseSpeedMgt._L20_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMin; _C_; S__C_{[0]._C0_CruiseSpeedMgt._I3_QuickDecel; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}} [0]._C0_CruiseSpeedMgt._L9_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMin; _C_; S__C_{[0]._C0_CruiseSpeedMgt._I3_QuickDecel; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}} [0]._C0_CruiseSpeedMgt._L8_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; _C_; S__C_{[0]._C0_CruiseSpeedMgt{._I2_QuickAccel; ._I3_QuickDecel}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}} [0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl FROM _C_ \result FROM \nothing [from] Function CruiseStateMgt: S__C_{[0]._C3_CruiseStateMgt._O0_Regul_ON; [0]._C3_CruiseStateMgt._O2_Regul_STDBY; [0]._C3_CruiseStateMgt{._LE42_CruiseControl; ._LE6_CruiseControl}; [0]._C3_CruiseStateMgt{._LE44_CruiseControl; ._LE8_CruiseControl}} FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed; ._I2_Resume; ._I3_On; ._I4_Off; ._I5_SpeedOutOffLimits}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._C3_CruiseStateMgt._O1_Regul_OFF; [0]._C3_CruiseStateMgt{._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl}} FROM _C_; S__C_{[0]._C3_CruiseStateMgt._I0_BrakePressed; [0]._C3_CruiseStateMgt{._I2_Resume; ._I3_On; ._I4_Off}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE24_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE23_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE0_CruiseControl FROM _C_; S__C_[0]._C3_CruiseStateMgt._I0_BrakePressed [0]._C3_CruiseStateMgt._LE4_CruiseControl FROM _C_; S__C_[0]._C3_CruiseStateMgt._I4_Off [0]._C3_CruiseStateMgt._LE40_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE26_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE25_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE28_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE9_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE25_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE10_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE11_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE33_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE32_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE35_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE34_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE38_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE12_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE34_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE13_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE14_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._C3_CruiseStateMgt._LE17_CruiseControl; [0]._C3_CruiseStateMgt._LE29_CruiseControl; [0]._C3_CruiseStateMgt._LE30_CruiseControl} FROM _C_; S__C_{[0]._C3_CruiseStateMgt._I4_Off; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE18_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._I0_BrakePressed; [0]._C3_CruiseStateMgt._I4_Off; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE3_CruiseControl FROM _C_; S__C_[0]._C3_CruiseStateMgt._I3_On [0]._C3_CruiseStateMgt._LE16_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE15_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE41_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE19_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._I3_On; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE20_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._I3_On; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt._LE15_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE21_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._I0_BrakePressed; [0]._C3_CruiseStateMgt{._I3_On; ._I4_Off}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE1_CruiseControl FROM _C_; S__C_[0]._C3_CruiseStateMgt._I1_AcceleratorPressed [0]._C3_CruiseStateMgt._LE5_CruiseControl FROM _C_; S__C_[0]._C3_CruiseStateMgt._I5_SpeedOutOffLimits [0]._C3_CruiseStateMgt._LE22_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._I1_AcceleratorPressed; [0]._C3_CruiseStateMgt._I5_SpeedOutOffLimits} {[0]._C3_CruiseStateMgt._LE23_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl} FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed}; [0]._C3_CruiseStateMgt{._I3_On; ._I4_Off; ._I5_SpeedOutOffLimits}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._C3_CruiseStateMgt._LE25_CruiseControl; [0]._C3_CruiseStateMgt._LE34_CruiseControl} FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed}; [0]._C3_CruiseStateMgt{._I4_Off; ._I5_SpeedOutOffLimits}; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE2_CruiseControl FROM _C_; S__C_[0]._C3_CruiseStateMgt._I2_Resume [0]._C3_CruiseStateMgt._LE31_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._I2_Resume; [0]._C3_CruiseStateMgt._I4_Off; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._C3_CruiseStateMgt._LE32_CruiseControl; [0]._C3_CruiseStateMgt{._LE36_CruiseControl; ._LE37_CruiseControl}} FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed; ._I2_Resume}; [0]._C3_CruiseStateMgt{._I4_Off; ._I5_SpeedOutOffLimits}; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE15_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._I3_On; ._I4_Off}; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._M_init_0_CruiseControl FROM _C_ \result FROM \nothing [from] Function DetectPedalsPressed: S__C_{[0]._C1_DetectPedalsPressed._O0_BrakePressed; [0]._C1_DetectPedalsPressed._L4_CruiseControl} FROM ZeroPercent; _C_; S__C_[0]._C1_DetectPedalsPressed._I0_Brake {[0]._C1_DetectPedalsPressed._O1_AcceleratorPressed; [0]._C1_DetectPedalsPressed._L3_CruiseControl} FROM ZeroPercent; _C_; S__C_[0]._C1_DetectPedalsPressed._I1_Accelerator [0]._C1_DetectPedalsPressed._L2_CruiseControl FROM _C_; S__C_[0]._C1_DetectPedalsPressed._I0_Brake {[0]._C1_DetectPedalsPressed._L8_CruiseControl; [0]._C1_DetectPedalsPressed._L7_CruiseControl} FROM ZeroPercent; _C_ [0]._C1_DetectPedalsPressed._L1_CruiseControl FROM _C_; S__C_[0]._C1_DetectPedalsPressed._I1_Accelerator \result FROM \nothing [from] Function DetectSpeedLimits: S__C_{[0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits; [0]._C2_DetectSpeedLimits._L17_CruiseControl} FROM SpeedMax; SpeedMin; _C_; S__C_[0]._C2_DetectSpeedLimits._I0_speed [0]._C2_DetectSpeedLimits._L7_CruiseControl FROM _C_; S__C_[0]._C2_DetectSpeedLimits._I0_speed [0]._C2_DetectSpeedLimits._L13_CruiseControl FROM SpeedMin; _C_ [0]._C2_DetectSpeedLimits._L8_CruiseControl FROM SpeedMin; _C_; S__C_[0]._C2_DetectSpeedLimits._I0_speed [0]._C2_DetectSpeedLimits._L14_CruiseControl FROM SpeedMax; _C_ [0]._C2_DetectSpeedLimits._L9_CruiseControl FROM SpeedMax; _C_; S__C_[0]._C2_DetectSpeedLimits._I0_speed \result FROM \nothing [from] Function SaturateThrottle: S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O0_ThrottleOut; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L8_CruiseControl} FROM ZeroPercent; RegThrottleMax; _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl} FROM ZeroPercent; RegThrottleMax; _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L18_CruiseControl FROM RegThrottleMax; _C_ [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L12_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl FROM RegThrottleMax; _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl FROM ZeroPercent; _C_ [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl FROM ZeroPercent; _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L6_CruiseControl FROM ZeroPercent; _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn \result FROM \nothing [from] Function ThrottleRegulation: S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation._O0_Throttle; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L13_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O0_ThrottleOut; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L8_CruiseControl} FROM ZeroSpeed; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L1_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._I1_CruiseSpeed [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L2_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._I2_VehiculeSpeed [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L3_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L6_CruiseControl FROM Kp; _C_ [0]._C4_ThrottleCmd._C0_ThrottleRegulation.ProportionnalAction FROM Kp; _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed} {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._L22_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L23_CruiseControl} FROM ZeroSpeed; _C_ [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction FROM _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L16_CruiseControl FROM ZeroSpeed; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L18_CruiseControl FROM ZeroSpeed; _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L10_CruiseControl FROM ZeroSpeed; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L8_CruiseControl FROM Ki; _C_ [0]._C4_ThrottleCmd._C0_ThrottleRegulation.IntegralAction FROM ZeroSpeed; Ki; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._L4_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L12_CruiseControl} FROM ZeroSpeed; Kp; Ki; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl} FROM ZeroSpeed; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L19_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._I0_Reset [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl FROM ZeroSpeed; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I0_Reset; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl FROM _C_ [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L18_CruiseControl FROM RegThrottleMax; _C_ [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl FROM ZeroSpeed; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl FROM ZeroPercent; _C_ [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl FROM ZeroSpeed; ZeroPercent; Kp; Ki; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L6_CruiseControl FROM ZeroSpeed; ZeroPercent; Kp; Ki; _C_; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} \result FROM \nothing [from] Function ThrottleCmd: S__C_{[0]._C4_ThrottleCmd._O0_Throttle; [0]._C4_ThrottleCmd._L24_CruiseControl} FROM ZeroSpeed; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator}; [0]._C4_ThrottleCmd._L19_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} {[0]._C4_ThrottleCmd._L21_CruiseControl; [0]._C4_ThrottleCmd._L22_CruiseControl} FROM _C_; S__C_{[0]._C4_ThrottleCmd._L20_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl} [0]._C4_ThrottleCmd._L20_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd._I0_Regul_ON [0]._C4_ThrottleCmd.ONRisingEdge FROM _C_; S__C_{[0]._C4_ThrottleCmd._I0_Regul_ON; [0]._C4_ThrottleCmd._L20_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl} [0]._C4_ThrottleCmd._L26_CruiseControl FROM ZeroPercent; _C_ [0]._C4_ThrottleCmd._L1_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd._I1_CruiseSpeed [0]._C4_ThrottleCmd._L2_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd._I2_VehiculeSpeed [0]._C4_ThrottleCmd._L19_CruiseControl FROM ZeroSpeed; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._L25_CruiseControl FROM _C_; S__C_{[0]._C4_ThrottleCmd._I0_Regul_ON; [0]._C4_ThrottleCmd._I3_Accelerator} [0]._C4_ThrottleCmd._M_init_0_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd._I0_Regul_ON {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._I0_Reset; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L19_CruiseControl} FROM _C_; S__C_{[0]._C4_ThrottleCmd._I0_Regul_ON; [0]._C4_ThrottleCmd._L20_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._I1_CruiseSpeed; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L1_CruiseControl} FROM _C_; S__C_[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._I2_VehiculeSpeed; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L2_CruiseControl} FROM _C_; S__C_{[0]._C4_ThrottleCmd._I0_Regul_ON; [0]._C4_ThrottleCmd._I2_VehiculeSpeed} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._O0_Throttle; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L13_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O0_ThrottleOut; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L8_CruiseControl} FROM ZeroSpeed; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L3_CruiseControl FROM _C_; S__C_[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L6_CruiseControl FROM Kp; _C_; S__C_[0]._C4_ThrottleCmd._I0_Regul_ON (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation.ProportionnalAction FROM Kp; _C_; S__C_[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._L22_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L23_CruiseControl} FROM ZeroSpeed; _C_; S__C_[0]._C4_ThrottleCmd._I0_Regul_ON (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction FROM _C_; S__C_{[0]._C4_ThrottleCmd._I0_Regul_ON; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L16_CruiseControl FROM ZeroSpeed; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L18_CruiseControl FROM ZeroSpeed; _C_; S__C_{[0]._C4_ThrottleCmd._I0_Regul_ON; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L10_CruiseControl FROM ZeroSpeed; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L8_CruiseControl FROM Ki; _C_; S__C_[0]._C4_ThrottleCmd._I0_Regul_ON (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation.IntegralAction FROM ZeroSpeed; Ki; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._L4_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L12_CruiseControl} FROM ZeroSpeed; Kp; Ki; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl} FROM ZeroSpeed; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl FROM ZeroSpeed; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._L20_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._M_condact_2_CruiseControl} FROM _C_; S__C_[0]._C4_ThrottleCmd._I0_Regul_ON (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L18_CruiseControl FROM RegThrottleMax; _C_; S__C_[0]._C4_ThrottleCmd._I0_Regul_ON (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl FROM ZeroSpeed; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl FROM ZeroPercent; _C_; S__C_[0]._C4_ThrottleCmd._I0_Regul_ON (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl FROM ZeroSpeed; ZeroPercent; Kp; Ki; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L6_CruiseControl FROM ZeroSpeed; ZeroPercent; Kp; Ki; _C_; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) \result FROM _C_; S__C_[0]._C4_ThrottleCmd._I0_Regul_ON [from] Function CruiseControl: S__C_{[0]._O0_Cruise_speed; [0]._C4_ThrottleCmd._I1_CruiseSpeed; [0]._C4_ThrottleCmd._L1_CruiseControl} FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._O1_Throttle_cmd; [0]._L22_CruiseControl; [0]._C4_ThrottleCmd._O0_Throttle; [0]._C4_ThrottleCmd._L24_CruiseControl} FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._L19_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} {[0]._O2_Regul_ON; [0]._O4_Regul_STDBY; [0]._C4_ThrottleCmd._I0_Regul_ON; [0]._C4_ThrottleCmd._L20_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._O3_Regul_OFF FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._L73_CruiseControl; [0]._L60_CruiseControl; [0]._C3_CruiseStateMgt._I3_On; [0]._C3_CruiseStateMgt._LE3_CruiseControl} FROM _C_; S__C_[0]._I0_On {[0]._L59_CruiseControl; [0]._C1_DetectPedalsPressed._I0_Brake; [0]._C1_DetectPedalsPressed._L2_CruiseControl} FROM _C_; S__C_[0]._I7_Brake {[0]._L62_CruiseControl; [0]._C1_DetectPedalsPressed._I1_Accelerator; [0]._C1_DetectPedalsPressed._L1_CruiseControl} FROM _C_; S__C_[0]._I6_Accel {[0].BrakePressed; [0]._C1_DetectPedalsPressed._O0_BrakePressed; [0]._C1_DetectPedalsPressed._L4_CruiseControl; [0]._C3_CruiseStateMgt._I0_BrakePressed; [0]._C3_CruiseStateMgt._LE0_CruiseControl} FROM ZeroPercent; _C_; S__C_[0]._I7_Brake {[0].AcceleratorPressed; [0]._C1_DetectPedalsPressed._O1_AcceleratorPressed; [0]._C1_DetectPedalsPressed._L3_CruiseControl; [0]._C3_CruiseStateMgt._I1_AcceleratorPressed; [0]._C3_CruiseStateMgt._LE1_CruiseControl} FROM ZeroPercent; _C_; S__C_[0]._I6_Accel {[0]._L61_CruiseControl; [0]._C3_CruiseStateMgt._I2_Resume; [0]._C3_CruiseStateMgt._LE2_CruiseControl} FROM _C_; S__C_[0]._I2_Resume {[0]._L58_CruiseControl; [0]._C3_CruiseStateMgt._I4_Off; [0]._C3_CruiseStateMgt._LE4_CruiseControl} FROM _C_; S__C_[0]._I1_Off {[0]._L95_CruiseControl; [0]._L23_CruiseControl; [0]._C2_DetectSpeedLimits._I0_speed; [0]._C2_DetectSpeedLimits._L7_CruiseControl} FROM _C_; S__C_[0]._I8_Speed {[0].SpeedOutOffLimits; [0]._C2_DetectSpeedLimits._O0_SpeedOutOffLimits; [0]._C2_DetectSpeedLimits._L17_CruiseControl; [0]._C3_CruiseStateMgt._I5_SpeedOutOffLimits; [0]._C3_CruiseStateMgt._LE5_CruiseControl} FROM SpeedMax; SpeedMin; _C_; S__C_[0]._I8_Speed {[0]._L82_CruiseControl; [0]{._L84_CruiseControl; ._L19_CruiseControl}; [0]._C3_CruiseStateMgt._O0_Regul_ON; [0]._C3_CruiseStateMgt._O2_Regul_STDBY; [0]._C3_CruiseStateMgt{._LE42_CruiseControl; ._LE6_CruiseControl}; [0]._C3_CruiseStateMgt{._LE44_CruiseControl; ._LE8_CruiseControl}} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._L83_CruiseControl; [0]._C3_CruiseStateMgt._O1_Regul_OFF; [0]._C3_CruiseStateMgt{._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl}} FROM ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]._I7_Brake; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._L96_CruiseControl FROM ZeroSpeed; _C_ [0]._L38_CruiseControl FROM _C_; S__C_[0]._I3_Set [0]._L39_CruiseControl FROM _C_; S__C_[0]._I4_QuickAccel [0]._L40_CruiseControl FROM _C_; S__C_[0]._I5_QuickDecel [0].CruiseSpeed FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._L26_CruiseControl; [0]._C4_ThrottleCmd._I3_Accelerator; [0]._C4_ThrottleCmd._L25_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._M_init_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._C0_CruiseSpeedMgt._I0_On; [0]._C0_CruiseSpeedMgt._L3_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C0_CruiseSpeedMgt._I1_Set; [0]._C0_CruiseSpeedMgt._L2_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C0_CruiseSpeedMgt._I2_QuickAccel; [0]._C0_CruiseSpeedMgt._L4_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]._I4_QuickAccel; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C0_CruiseSpeedMgt._I3_QuickDecel; [0]._C0_CruiseSpeedMgt._L5_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C0_CruiseSpeedMgt._I4_Speed; [0]._C0_CruiseSpeedMgt._L1_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._I2_VehiculeSpeed; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L2_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C0_CruiseSpeedMgt._O0_CruiseSpeed; [0]._C0_CruiseSpeedMgt._L7_CruiseControl} FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L6_CruiseControl FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C0_CruiseSpeedMgt._L21_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L22_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L23_CruiseControl} FROM ZeroSpeed; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L10_CruiseControl FROM ZeroSpeed; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C0_CruiseSpeedMgt._L12_CruiseControl; [0]._C0_CruiseSpeedMgt._L11_CruiseControl} FROM SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C0_CruiseSpeedMgt._L13_CruiseControl; [0]._C0_CruiseSpeedMgt._L14_CruiseControl} FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L15_CruiseControl FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L16_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L17_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]._I4_QuickAccel; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L19_CruiseControl FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L18_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L20_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L9_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C0_CruiseSpeedMgt._L8_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C0_CruiseSpeedMgt._M_init_0_CruiseControl; [0]._M_condact_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._M_condact_2_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C1_DetectPedalsPressed._L8_CruiseControl; [0]._C1_DetectPedalsPressed._L7_CruiseControl} FROM ZeroPercent; _C_ [0]._C2_DetectSpeedLimits._L13_CruiseControl FROM SpeedMin; _C_ [0]._C2_DetectSpeedLimits._L8_CruiseControl FROM SpeedMin; _C_; S__C_[0]._I8_Speed [0]._C2_DetectSpeedLimits._L14_CruiseControl FROM SpeedMax; _C_ [0]._C2_DetectSpeedLimits._L9_CruiseControl FROM SpeedMax; _C_; S__C_[0]._I8_Speed [0]._C3_CruiseStateMgt._LE24_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE23_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE40_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE26_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE25_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE28_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE9_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE25_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE10_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE11_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE33_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE32_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE35_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE34_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE38_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE12_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE34_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE13_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE14_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._C3_CruiseStateMgt._LE17_CruiseControl; [0]._C3_CruiseStateMgt._LE29_CruiseControl; [0]._C3_CruiseStateMgt._LE30_CruiseControl} FROM _C_; S__C_{[0]._I1_Off; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE18_CruiseControl FROM ZeroPercent; _C_; S__C_{[0]._I1_Off; [0]._I7_Brake; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE16_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE15_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE41_CruiseControl FROM _C_; S__C_{[0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE19_CruiseControl FROM _C_; S__C_{[0]._I0_On; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE20_CruiseControl FROM _C_; S__C_{[0]._I0_On; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt._LE15_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE21_CruiseControl FROM ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off}; [0]._I7_Brake; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE22_CruiseControl FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]._I6_Accel; [0]._I8_Speed} {[0]._C3_CruiseStateMgt._LE23_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._C3_CruiseStateMgt._LE25_CruiseControl; [0]._C3_CruiseStateMgt._LE34_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]._I1_Off; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE31_CruiseControl FROM _C_; S__C_{[0]{._I1_Off; ._I2_Resume}; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._C3_CruiseStateMgt._LE32_CruiseControl; [0]._C3_CruiseStateMgt{._LE36_CruiseControl; ._LE37_CruiseControl}} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt._LE39_CruiseControl; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._LE15_CruiseControl FROM _C_; S__C_{[0]{._I0_On; ._I1_Off}; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C3_CruiseStateMgt._M_init_0_CruiseControl FROM _C_ {[0]._C4_ThrottleCmd._I2_VehiculeSpeed; [0]._C4_ThrottleCmd._L2_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} {[0]._C4_ThrottleCmd._L21_CruiseControl; [0]._C4_ThrottleCmd._L22_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._L20_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl} [0]._C4_ThrottleCmd.ONRisingEdge FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._L20_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl} [0]._C4_ThrottleCmd._L26_CruiseControl FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [0]._C4_ThrottleCmd._L19_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._I0_Reset; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L19_CruiseControl} FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._L20_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._I1_CruiseSpeed; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L1_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L3_CruiseControl} FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._O0_Throttle; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L13_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O0_ThrottleOut; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L8_CruiseControl} FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L6_CruiseControl FROM SpeedMax; SpeedMin; ZeroPercent; Kp; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation.ProportionnalAction FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation.HoldIntegralAction FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L16_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._M_init_0_CruiseControl} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L18_CruiseControl FROM ZeroSpeed; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L10_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L8_CruiseControl FROM SpeedMax; SpeedMin; ZeroPercent; Ki; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation.IntegralAction FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Ki; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._L4_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L12_CruiseControl} FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; Ki; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) {[0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._O1_Saturate; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L13_CruiseControl} FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L21_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._L20_CruiseControl; [0]._C4_ThrottleCmd._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L18_CruiseControl FROM SpeedMax; SpeedMin; ZeroPercent; RegThrottleMax; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L7_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; Ki; RegThrottleMax; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L17_CruiseControl FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L9_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; Ki; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._L6_CruiseControl FROM ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; Ki; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0].CruiseSpeed; [0]._M_init_CruiseControl; [0]._C0_CruiseSpeedMgt{._L7_CruiseControl; ._M_init_0_CruiseControl}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._L14_CruiseControl; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L21_CruiseControl; ._M_init_0_CruiseControl}} (and SELF) \result FROM SpeedMax; SpeedMin; ZeroPercent; _C_; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume}; [0]{._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]._C3_CruiseStateMgt._LE19_CruiseControl; [0]._C3_CruiseStateMgt{._LE23_CruiseControl; ._LE25_CruiseControl}; [0]._C3_CruiseStateMgt{._LE32_CruiseControl; ._LE34_CruiseControl}; [0]._C3_CruiseStateMgt{._LE15_CruiseControl; ._LE39_CruiseControl}; [0]._C3_CruiseStateMgt._LE27_CruiseControl; [0]._C3_CruiseStateMgt._LE37_CruiseControl; [0]._C3_CruiseStateMgt._M_init_0_CruiseControl} [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function CruiseSpeedMgt: __retres; S__C_[0]._C0_CruiseSpeedMgt{._O0_CruiseSpeed; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; ._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl; ._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl; ._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl; ._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl; ._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl; ._M_init_0_CruiseControl} [inout] Inputs for function CruiseSpeedMgt: ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; S__C_{[0]._C0_CruiseSpeedMgt{._I0_On; ._I1_Set; ._I2_QuickAccel; ._I3_QuickDecel; ._I4_Speed}; [0]._C0_CruiseSpeedMgt{._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; ._L21_CruiseControl; ._L10_CruiseControl; ._L12_CruiseControl; ._L13_CruiseControl; ._L15_CruiseControl; ._L16_CruiseControl; ._L4_CruiseControl; ._L17_CruiseControl; ._L11_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl; ._L18_CruiseControl; ._L5_CruiseControl; ._L20_CruiseControl; ._L9_CruiseControl; ._L8_CruiseControl; ._L7_CruiseControl; ._M_init_0_CruiseControl}} [inout] Out (internal) for function CruiseStateMgt: __retres; S__C_[0]._C3_CruiseStateMgt{._O0_Regul_ON; ._O1_Regul_OFF; ._O2_Regul_STDBY; ._LE24_CruiseControl; ._LE0_CruiseControl; ._LE4_CruiseControl; ._LE40_CruiseControl; ._LE26_CruiseControl; ._LE28_CruiseControl; ._LE9_CruiseControl; ._LE10_CruiseControl; ._LE11_CruiseControl; ._LE33_CruiseControl; ._LE35_CruiseControl; ._LE38_CruiseControl; ._LE12_CruiseControl; ._LE13_CruiseControl; ._LE14_CruiseControl; ._LE17_CruiseControl; ._LE18_CruiseControl; ._LE3_CruiseControl; ._LE16_CruiseControl; ._LE41_CruiseControl; ._LE19_CruiseControl; ._LE20_CruiseControl; ._LE21_CruiseControl; ._LE1_CruiseControl; ._LE5_CruiseControl; ._LE22_CruiseControl; ._LE23_CruiseControl; ._LE25_CruiseControl; ._LE29_CruiseControl; ._LE2_CruiseControl; ._LE30_CruiseControl; ._LE31_CruiseControl; ._LE32_CruiseControl; ._LE34_CruiseControl; ._LE42_CruiseControl; ._LE6_CruiseControl; ._LE15_CruiseControl; ._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl; ._LE27_CruiseControl; ._LE36_CruiseControl; ._LE37_CruiseControl; ._LE44_CruiseControl; ._LE8_CruiseControl; ._M_init_0_CruiseControl} [inout] Inputs for function CruiseStateMgt: S__C_{[0]._C3_CruiseStateMgt{._I0_BrakePressed; ._I1_AcceleratorPressed; ._I2_Resume; ._I3_On; ._I4_Off; ._I5_SpeedOutOffLimits}; [0]._C3_CruiseStateMgt{._LE24_CruiseControl; ._LE0_CruiseControl; ._LE4_CruiseControl; ._LE40_CruiseControl; ._LE26_CruiseControl; ._LE28_CruiseControl; ._LE9_CruiseControl; ._LE10_CruiseControl; ._LE11_CruiseControl; ._LE33_CruiseControl; ._LE35_CruiseControl; ._LE38_CruiseControl; ._LE12_CruiseControl; ._LE13_CruiseControl; ._LE14_CruiseControl; ._LE17_CruiseControl; ._LE18_CruiseControl; ._LE3_CruiseControl; ._LE16_CruiseControl; ._LE41_CruiseControl; ._LE19_CruiseControl; ._LE20_CruiseControl; ._LE21_CruiseControl; ._LE1_CruiseControl; ._LE5_CruiseControl; ._LE22_CruiseControl; ._LE23_CruiseControl; ._LE25_CruiseControl; ._LE29_CruiseControl; ._LE2_CruiseControl; ._LE30_CruiseControl; ._LE31_CruiseControl; ._LE32_CruiseControl; ._LE34_CruiseControl; ._LE42_CruiseControl; ._LE6_CruiseControl; ._LE15_CruiseControl; ._LE39_CruiseControl; ._LE43_CruiseControl; ._LE7_CruiseControl; ._LE27_CruiseControl; ._LE36_CruiseControl; ._LE37_CruiseControl; ._LE44_CruiseControl; ._LE8_CruiseControl; ._M_init_0_CruiseControl}} [inout] Out (internal) for function DetectPedalsPressed: __retres; S__C_[0]._C1_DetectPedalsPressed{._O0_BrakePressed; ._O1_AcceleratorPressed; ._L2_CruiseControl; ._L8_CruiseControl; ._L4_CruiseControl; ._L1_CruiseControl; ._L7_CruiseControl; ._L3_CruiseControl} [inout] Inputs for function DetectPedalsPressed: ZeroPercent; S__C_{[0]._C1_DetectPedalsPressed{._I0_Brake; ._I1_Accelerator}; [0]._C1_DetectPedalsPressed{._L2_CruiseControl; ._L8_CruiseControl; ._L4_CruiseControl; ._L1_CruiseControl; ._L7_CruiseControl; ._L3_CruiseControl}} [inout] Out (internal) for function DetectSpeedLimits: __retres; S__C_[0]._C2_DetectSpeedLimits{._O0_SpeedOutOffLimits; ._L7_CruiseControl; ._L13_CruiseControl; ._L8_CruiseControl; ._L14_CruiseControl; ._L9_CruiseControl; ._L17_CruiseControl} [inout] Inputs for function DetectSpeedLimits: SpeedMax; SpeedMin; S__C_{[0]._C2_DetectSpeedLimits._I0_speed; [0]._C2_DetectSpeedLimits{._L7_CruiseControl; ._L13_CruiseControl; ._L8_CruiseControl; ._L14_CruiseControl; ._L9_CruiseControl; ._L17_CruiseControl}} [inout] Out (internal) for function SaturateThrottle: __retres; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._O0_ThrottleOut; ._O1_Saturate; ._L18_CruiseControl; ._L12_CruiseControl; ._L7_CruiseControl; ._L17_CruiseControl; ._L9_CruiseControl; ._L6_CruiseControl; ._L8_CruiseControl; ._L13_CruiseControl} [inout] Inputs for function SaturateThrottle: ZeroPercent; RegThrottleMax; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle._I0_ThrottleIn; [0]._C4_ThrottleCmd._C0_ThrottleRegulation._C0_SaturateThrottle{._L18_CruiseControl; ._L12_CruiseControl; ._L7_CruiseControl; ._L17_CruiseControl; ._L9_CruiseControl; ._L6_CruiseControl; ._L8_CruiseControl; ._L13_CruiseControl}} [inout] Out (internal) for function ThrottleRegulation: tmp; __retres; S__C_[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._O0_Throttle; ._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl; .HoldIntegralAction; ._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl; ._L21_CruiseControl; ._M_init_0_CruiseControl; ._C0_SaturateThrottle} [inout] Inputs for function ThrottleRegulation: ZeroSpeed; ZeroPercent; Kp; Ki; RegThrottleMax; S__C_{[0]._C4_ThrottleCmd._C0_ThrottleRegulation{._I0_Reset; ._I1_CruiseSpeed; ._I2_VehiculeSpeed}; [0]._C4_ThrottleCmd._C0_ThrottleRegulation{._L1_CruiseControl; ._L2_CruiseControl; ._L3_CruiseControl; ._L6_CruiseControl; .ProportionnalAction; ._L22_CruiseControl; .HoldIntegralAction; ._L16_CruiseControl; ._L23_CruiseControl; ._L18_CruiseControl; ._L10_CruiseControl; ._L8_CruiseControl; .IntegralAction; ._L4_CruiseControl; ._L13_CruiseControl; ._L14_CruiseControl; ._L19_CruiseControl; ._L21_CruiseControl; ._M_init_0_CruiseControl; ._C0_SaturateThrottle}} [inout] Out (internal) for function ThrottleCmd: tmp; __retres; S__C_[0]._C4_ThrottleCmd{._O0_Throttle; ._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge; ._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl; ._M_init_0_CruiseControl; ._C0_ThrottleRegulation; ._M_condact_2_CruiseControl} [inout] Inputs for function ThrottleCmd: ZeroSpeed; ZeroPercent; Kp; Ki; RegThrottleMax; S__C_{[0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator}; [0]._C4_ThrottleCmd{._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge; ._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl; ._M_init_0_CruiseControl; ._C0_ThrottleRegulation}} [inout] Out (internal) for function CruiseControl: tmp; tmp_0; tmp_1; tmp_2; tmp_3; __retres; S__C_[0]{._O0_Cruise_speed; ._O1_Throttle_cmd; ._O2_Regul_ON; ._O3_Regul_OFF; ._O4_Regul_STDBY; ._L73_CruiseControl; ._L59_CruiseControl; ._L62_CruiseControl; .BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl; ._L95_CruiseControl; .SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl; ._L96_CruiseControl; ._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl; ._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl; ._M_init_CruiseControl; ._C0_CruiseSpeedMgt; ._C1_DetectPedalsPressed; ._C2_DetectSpeedLimits; ._C3_CruiseStateMgt; ._M_condact_0_CruiseControl; ._C4_ThrottleCmd} [inout] Inputs for function CruiseControl: ZeroSpeed; SpeedInc; SpeedMax; SpeedMin; ZeroPercent; Kp; Ki; RegThrottleMax; S__C_{[0]{._I0_On; ._I1_Off; ._I2_Resume; ._I3_Set; ._I4_QuickAccel; ._I5_QuickDecel; ._I6_Accel; ._I7_Brake; ._I8_Speed}; [0]{._L73_CruiseControl; ._L59_CruiseControl; ._L62_CruiseControl; .BrakePressed; .AcceleratorPressed; ._L61_CruiseControl; ._L60_CruiseControl; ._L58_CruiseControl; ._L95_CruiseControl; .SpeedOutOffLimits; ._L82_CruiseControl; ._L83_CruiseControl; ._L84_CruiseControl; ._L19_CruiseControl; ._L96_CruiseControl; ._L38_CruiseControl; ._L39_CruiseControl; ._L40_CruiseControl; ._L23_CruiseControl; .CruiseSpeed; ._L26_CruiseControl; ._L22_CruiseControl; ._M_init_CruiseControl; ._C0_CruiseSpeedMgt; ._C1_DetectPedalsPressed; ._C2_DetectSpeedLimits; ._C3_CruiseStateMgt}; [0]._C4_ThrottleCmd{._I0_Regul_ON; ._I1_CruiseSpeed; ._I2_VehiculeSpeed; ._I3_Accelerator; ._O0_Throttle; ._L21_CruiseControl; ._L20_CruiseControl; ._L22_CruiseControl; .ONRisingEdge; ._L26_CruiseControl; ._L1_CruiseControl; ._L2_CruiseControl; ._L19_CruiseControl; ._L25_CruiseControl; ._L24_CruiseControl; ._M_init_0_CruiseControl; ._C0_ThrottleRegulation}} frama-c-20.0-Calcium/tests/value/oracle/FP5.res.oracle0000666000000000000000000000232213571573400017306 0ustar [kernel] Parsing tests/value/FP5.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/FP5.i:1: Warning: function main: precondition \valid(b) got status unknown. [eva:alarm] tests/value/FP5.i:2: Warning: function main: precondition \valid(c) got status unknown. [eva] tests/value/FP5.i:3: function main: precondition \valid(&a) got status valid. [eva] tests/value/FP5.i:23: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ [0..2147483647] S_c[0] ∈ {-1; 0; 1} [1] ∈ [--..--] S_b[0..1] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: S_c[0] FROM a; c S_b[0] FROM a; b (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; S_c[0]; S_b[0] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/abs.res.oracle0000666000000000000000000000173613571573400017471 0ustar [kernel] Parsing tests/value/abs.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/abs.i:6: Warning: function main: precondition got status unknown. [eva:alarm] tests/value/abs.i:9: Warning: signed overflow. assert -*p ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: S_p[0] ∈ [0..2147483647] [1] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: S_p[0] FROM p; S_p[0] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: S_p[0] [inout] Inputs for function main: S_p[0] frama-c-20.0-Calcium/tests/value/oracle/abs_addr.res.oracle0000666000000000000000000000353013571573400020455 0ustar [kernel] Parsing tests/value/abs_addr.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 1048576 to 2097151] ∈ [--..--] AutoTest[0..999] ∈ {0} [eva] computing for function TstRomUcmm <- main. Called from tests/value/abs_addr.i:46. [eva] tests/value/abs_addr.i:18: starting to merge loop iterations [eva] tests/value/abs_addr.i:32: starting to merge loop iterations [eva] Recording results for TstRomUcmm [eva] Done for function TstRomUcmm [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function TstRomUcmm: AutoTest[0..72] ∈ {0} [73] ∈ {0; 1} [74..999] ∈ {0} rom ∈ [--..--] or UNINITIALIZED chkrom ∈ [--..--] ptrom ∈ {262142} __retres ∈ {0; 1} [eva:final-states] Values at end of function main: AutoTest[0..72] ∈ {0} [73] ∈ {0; 1} [74..999] ∈ {0} [from] Computing for function TstRomUcmm [from] Done for function TstRomUcmm [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function TstRomUcmm: AutoTest[73] FROM NULL[131072..262143] (and SELF) \result FROM NULL[131072..262143]; AutoTest[73] [from] Function main: AutoTest[73] FROM NULL[131072..262143] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function TstRomUcmm: AutoTest[73]; rom; chkrom; ptrom; __retres [inout] Inputs for function TstRomUcmm: NULL[131072..262143]; AutoTest[73] [inout] Out (internal) for function main: AutoTest[73] [inout] Inputs for function main: NULL[131072..262143]; AutoTest[73] frama-c-20.0-Calcium/tests/value/oracle/absolute_pointer.res.oracle0000666000000000000000000000436113571573400022277 0ustar [kernel] Parsing tests/value/absolute_pointer.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 31] ∈ [--..--] R ∈ {0} [eva] computing for function crash <- main. Called from tests/value/absolute_pointer.i:18. [eva] computing for function f <- crash <- main. Called from tests/value/absolute_pointer.i:12. [eva] Recording results for f [eva] Done for function f [eva:alarm] tests/value/absolute_pointer.i:12: Warning: out of bounds write. assert \valid(tmp); (tmp from f()) [kernel] tests/value/absolute_pointer.i:12: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for crash [eva] Done for function crash [eva] Recording results for main [eva] done for function main [eva] tests/value/absolute_pointer.i:12: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {100} [eva:final-states] Values at end of function crash: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: NULL[rbits 0 to 7] ∈ {2} [rbits 8 to 15] ∈ [--..--] [rbits 16 to 23] ∈ {2} [rbits 24 to 31] ∈ [--..--] R ∈ [--..--] [from] Computing for function f [from] Done for function f [from] Computing for function crash [from] Non-terminating function crash (no dependencies) [from] Done for function crash [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function crash: NON TERMINATING - NO EFFECTS [from] Function main: NULL{[0]; [2]} FROM \nothing R FROM NULL[3] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function crash: v; tmp [inout] Inputs for function crash: \nothing [inout] Out (internal) for function main: NULL{[0]; [2]}; R [inout] Inputs for function main: NULL{[1]; [3]} frama-c-20.0-Calcium/tests/value/oracle/abstract_struct_1.res.oracle0000666000000000000000000000423413571573400022347 0ustar [kernel] Parsing tests/value/abstract_struct_1.c (with preprocessing) [kernel] Parsing tests/value/abstract_struct_2.c (with preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva:initial-state] creating variable S_data_0_S_repositories with imprecise size (type struct abstracttype [2]) [eva] tests/value/abstract_struct_1.c:10: Warning: during initialization of variable 'repositories', size of type 'struct abstracttype' cannot be computed (abstract type 'struct abstracttype') [eva:initial-state] creating variable S_data_1_S_repositories with imprecise size (type struct abstracttype [2]) [eva] Initial state computed [eva:initial-state] Values of globals at initialization repositories ∈ {{ NULL ; &S_repositories[0] }} S_repositories[0].data ∈ {{ NULL ; (struct abstracttype *)&S_data_0_S_repositories }} [1].data ∈ {{ NULL ; (struct abstracttype *)&S_data_1_S_repositories }} S_data_0_S_repositories[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_data_1_S_repositories[bits 0 to ..] ∈ [--..--] or UNINITIALIZED [eva] tests/value/abstract_struct_1.c:13: Call to builtin calloc [eva] tests/value/abstract_struct_1.c:13: allocating variable __calloc_main_l13 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] repositories ∈ {{ NULL ; &__calloc_main_l13 }} [from] Computing for function main [from] Computing for function calloc <-main [from] Done for function calloc [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function calloc: __fc_heap_status FROM __fc_heap_status; nmemb; size (and SELF) \result FROM __fc_heap_status; nmemb; size [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) repositories FROM __fc_heap_status [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __fc_heap_status; repositories [inout] Inputs for function main: __fc_heap_status frama-c-20.0-Calcium/tests/value/oracle/access_path.res.oracle0000666000000000000000000000226013571573400021172 0ustar [kernel] Parsing tests/value/access_path.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/access_path.i:2: Warning: out of bounds read. assert \valid_read(p); [eva:alarm] tests/value/access_path.i:2: Warning: out of bounds write. assert \valid(*p); [eva:alarm] tests/value/access_path.i:2: Warning: signed overflow. assert *(*p) + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} S_0_S_p[0] ∈ [-2147483647..2147483647] [1] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: S_0_S_p[0] FROM p; S_p[0]; S_0_S_p[0] \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres; S_0_S_p[0] [inout] Inputs for function main: S_p[0]; S_0_S_p[0] frama-c-20.0-Calcium/tests/value/oracle/add_approx.res.oracle0000666000000000000000000000164513571573400021044 0ustar [kernel] Parsing tests/value/add_approx.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ {0} x ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0] ∈ {0; 2} [1] ∈ {1; 2} [2] ∈ {0} [3] ∈ {77} [4..9] ∈ {0} x ∈ {0; 1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[0] FROM c (and SELF) [1] FROM c [3] FROM \nothing x FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t{[0..1]; [3]}; x [inout] Inputs for function main: x frama-c-20.0-Calcium/tests/value/oracle/addition.res.oracle0000666000000000000000000003731013571573400020514 0ustar [kernel] Parsing tests/value/addition.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 360 to 391] ∈ [--..--] t[0..9] ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} zz ∈ {0} p1 ∈ {0} p2 ∈ {0} p3 ∈ {0} p4 ∈ {0} p5 ∈ {0} p6 ∈ {0} p7 ∈ {0} p8 ∈ {0} p9 ∈ {0} p10 ∈ {0} p11 ∈ {0} p12 ∈ {0} p13 ∈ {0} p14 ∈ {0} p15 ∈ {0} p16 ∈ {0} p17 ∈ {0} u1 ∈ {0} u3 ∈ {0} q1 ∈ {0} quo1 ∈ {0} rem1 ∈ {0} quo2 ∈ {0} rem2 ∈ {0} quo3 ∈ {0} rem3 ∈ {0} quo4 ∈ {0} rem4 ∈ {0} quo5 ∈ {0} rem5 ∈ {0} mm1 ∈ {0} mm2 ∈ {0} mm3 ∈ {0} quo6 ∈ {0} c1 ∈ {0} c2 ∈ {0} qu1 ∈ {0} qu2 ∈ {0} ll1 ∈ {0} ll2 ∈ {0} tt[0..4] ∈ {0} ttt[0..4][0..5] ∈ {0} square ∈ {0} [eva:alarm] tests/value/addition.i:34: Warning: signed overflow. assert -2147483648 ≤ &p2 - &p3; [eva:alarm] tests/value/addition.i:34: Warning: signed overflow. assert &p2 - &p3 ≤ 2147483647; [eva] tests/value/addition.i:34: Assigning imprecise value to p1. The imprecision originates from Arithmetic {tests/value/addition.i:34} [eva] tests/value/addition.i:36: Assigning imprecise value to p2. The imprecision originates from Arithmetic {tests/value/addition.i:36} [eva] tests/value/addition.i:38: Assigning imprecise value to p3. The imprecision originates from Arithmetic {tests/value/addition.i:38} [eva] tests/value/addition.i:40: Assigning imprecise value to p4. The imprecision originates from Arithmetic {tests/value/addition.i:40} [eva] tests/value/addition.i:42: Assigning imprecise value to p5. The imprecision originates from Arithmetic {tests/value/addition.i:42} [eva] tests/value/addition.i:44: Assigning imprecise value to p6. The imprecision originates from Arithmetic {tests/value/addition.i:44} [eva] tests/value/addition.i:46: Assigning imprecise value to p7. The imprecision originates from Arithmetic {tests/value/addition.i:46} [eva:alarm] tests/value/addition.i:48: Warning: pointer comparison. assert \pointer_comparable((void *)(&p1 + 1), (void *)(&p2)); [eva:alarm] tests/value/addition.i:50: Warning: signed overflow. assert -2147483648 ≤ (int)(&p1) / 2; [eva:alarm] tests/value/addition.i:50: Warning: signed overflow. assert (int)(&p1) / 2 ≤ 2147483647; [eva] tests/value/addition.i:50: Assigning imprecise value to p9. The imprecision originates from Arithmetic {tests/value/addition.i:50} [eva] tests/value/addition.i:52: Assigning imprecise value to p10. The imprecision originates from Arithmetic {tests/value/addition.i:52} [eva] tests/value/addition.i:56: Assigning imprecise value to p12. The imprecision originates from Arithmetic {tests/value/addition.i:56} [eva:alarm] tests/value/addition.i:59: Warning: signed overflow. assert -2147483648 ≤ (int)*((char *)(&q1)) + 2; [eva:alarm] tests/value/addition.i:59: Warning: signed overflow. assert (int)*((char *)(&q1)) + 2 ≤ 2147483647; [eva] tests/value/addition.i:59: Assigning imprecise value to p13. The imprecision originates from Misaligned {tests/value/addition.i:59} [eva:alarm] tests/value/addition.i:61: Warning: signed overflow. assert -2147483648 ≤ (int)*((char *)(&q1)) + 2; [eva:alarm] tests/value/addition.i:61: Warning: signed overflow. assert (int)*((char *)(&q1)) + 2 ≤ 2147483647; [eva] tests/value/addition.i:61: Assigning imprecise value to p14. The imprecision originates from Misaligned {tests/value/addition.i:61} [eva:alarm] tests/value/addition.i:66: Warning: out of bounds read. assert \valid_read(*((int **)45)); [eva] tests/value/addition.i:87: Frama_C_show_each_1: [-10..15] [eva] tests/value/addition.i:88: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva:garbled-mix] Warning: Garbled mix generated during analysis: {{ garbled mix of &{p3} (origin: Arithmetic {tests/value/addition.i:34}) }} {{ garbled mix of &{p2} (origin: Arithmetic {tests/value/addition.i:34}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:36}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:38}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:40}) }} {{ garbled mix of &{p2} (origin: Arithmetic {tests/value/addition.i:42}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:42}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:44}) }} {{ garbled mix of &{p2} (origin: Arithmetic {tests/value/addition.i:46}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:50}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:52}) }} {{ garbled mix of &{p2} (origin: Arithmetic {tests/value/addition.i:56}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:56}) }} {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:59}) }} {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:61}) }} [scope:rm_asserts] removing 2 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0] ∈ {0} [1] ∈ {45} [2] ∈ {3} [3..9] ∈ {0} z ∈ {37} p1 ∈ {{ garbled mix of &{p2; p3} (origin: Arithmetic {tests/value/addition.i:34}) }} p2 ∈ {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:36}) }} p3 ∈ {{ garbled mix of &{t; p1} (origin: Arithmetic {tests/value/addition.i:38}) }} p4 ∈ {{ garbled mix of &{p1; tt} (origin: Arithmetic {tests/value/addition.i:40}) }} p5 ∈ {{ garbled mix of &{p1; p2; ttt} (origin: Arithmetic {tests/value/addition.i:42}) }} p6 ∈ {{ garbled mix of &{p1; ttt} (origin: Arithmetic {tests/value/addition.i:44}) }} p7 ∈ {{ garbled mix of &{p2; ttt} (origin: Arithmetic {tests/value/addition.i:46}) }} p8 ∈ {0; 1} p9 ∈ {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:50}) }} p10 ∈ {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:52}) }} p11 ∈ [-2147483648..0],0%4 p12 ∈ {{ garbled mix of &{p1; p2} (origin: Arithmetic {tests/value/addition.i:56}) }} p13 ∈ {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:59}) }} p14 ∈ {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:61}) }} p15 ∈ {-1} p16 ∈ {2949122} p17 ∈ {-2147483648; 0} u1 ∈ {8} q1 ∈ {{ &p1 }} quo1 ∈ {3} rem1 ∈ {1} quo2 ∈ {-3} rem2 ∈ {-1} quo3 ∈ {3} rem3 ∈ {-1} quo4 ∈ {-3} rem4 ∈ {1} quo5 ∈ {-3} rem5 ∈ {0} mm1 ∈ [-224848..151152],0%16 mm2 ∈ [-6982976..4665024],64%128 mm3 ∈ [-1182974..789526],1%5 quo6 ∈ [-446..-371],1%3 c1 ∈ [-48..77],2%5 c2 ∈ [-46..79],4%5 qu1 ∈ [53..223] qu2 ∈ [-14..23] ll1 ∈ [4294967248..4294967373],3%5 ll2 ∈ [4294967250..4294967375],0%5 tt[0].a ∈ {0} [0].b ∈ {-1} {[0].[bits 34 to 63]; [1..4]} ∈ {0} square ∈ [-150..225] u2 ∈ {34} __retres ∈ {6} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[1] FROM NULL[45..48] [2] FROM \nothing z FROM \nothing p1 FROM \nothing p2 FROM \nothing p3 FROM \nothing p4 FROM \nothing p5 FROM \nothing p6 FROM u2 p7 FROM u2 p8 FROM \nothing p9 FROM \nothing p10 FROM \nothing p11 FROM u2 (and SELF) p12 FROM \nothing p13 FROM \nothing p14 FROM \nothing p15 FROM \nothing p16 FROM NULL[45..48]; t[0][bits 16 to 31] p17 FROM u4 u1 FROM \nothing q1 FROM \nothing quo1 FROM \nothing rem1 FROM \nothing quo2 FROM \nothing rem2 FROM \nothing quo3 FROM \nothing rem3 FROM \nothing quo4 FROM \nothing rem4 FROM \nothing quo5 FROM \nothing rem5 FROM \nothing mm1 FROM u2; u3_0 mm2 FROM u2; u3_0 mm3 FROM u2; u3_0 quo6 FROM u3_0 c1 FROM u3_0 c2 FROM u3_0 qu1 FROM u3_0 qu2 FROM u3_0 ll1 FROM u3_0 ll2 FROM u3_0 tt[0].b FROM \nothing square FROM u3_0 \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[1..2]; z; p1; p2; p3; p4; p5; p6; p7; p8; p9; p10; p11; p12; p13; p14; p15; p16; p17; u1; q1; quo1; rem1; quo2; rem2; quo3; rem3; quo4; rem4; quo5; rem5; mm1; mm2; mm3; quo6; c1; c2; qu1; qu2; ll1; ll2; tt[0].b; square; u2; s; t_0; __retres [inout] Inputs for function main: NULL[45..48]; t{{[0][bits 16 to 31]; [1][bits 0 to 15]}; [2]}; z; p17; q1[bits 0 to 7]; ll1; ll2; tt[0].b [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 360 to 399] ∈ [--..--] t[0..9] ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} zz ∈ {0} p1 ∈ {0} p2 ∈ {0} p3 ∈ {0} p4 ∈ {0} p5 ∈ {0} p6 ∈ {0} p7 ∈ {0} p8 ∈ {0} p9 ∈ {0} p10 ∈ {0} p11 ∈ {0} p12 ∈ {0} p13 ∈ {0} p14 ∈ {0} p15 ∈ {0} p16 ∈ {0} p17 ∈ {0} u1 ∈ {0} u3 ∈ {0} q1 ∈ {0} quo1 ∈ {0} rem1 ∈ {0} quo2 ∈ {0} rem2 ∈ {0} quo3 ∈ {0} rem3 ∈ {0} quo4 ∈ {0} rem4 ∈ {0} quo5 ∈ {0} rem5 ∈ {0} mm1 ∈ {0} mm2 ∈ {0} mm3 ∈ {0} quo6 ∈ {0} c1 ∈ {0} c2 ∈ {0} qu1 ∈ {0} qu2 ∈ {0} ll1 ∈ {0} ll2 ∈ {0} tt[0..4] ∈ {0} ttt[0..4][0..5] ∈ {0} square ∈ {0} [eva:alarm] tests/value/addition.i:34: Warning: signed overflow. assert -2147483648 ≤ &p2 - &p3; [eva:alarm] tests/value/addition.i:34: Warning: signed overflow. assert &p2 - &p3 ≤ 2147483647; [eva:alarm] tests/value/addition.i:48: Warning: pointer comparison. assert \pointer_comparable((void *)(&p1 + 1), (void *)(&p2)); [eva:alarm] tests/value/addition.i:50: Warning: signed overflow. assert -2147483648 ≤ (int)(&p1) / 2; [eva:alarm] tests/value/addition.i:50: Warning: signed overflow. assert (int)(&p1) / 2 ≤ 2147483647; [eva:alarm] tests/value/addition.i:59: Warning: signed overflow. assert -2147483648 ≤ (int)*((char *)(&q1)) + 2; [eva:alarm] tests/value/addition.i:59: Warning: signed overflow. assert (int)*((char *)(&q1)) + 2 ≤ 2147483647; [eva:alarm] tests/value/addition.i:61: Warning: signed overflow. assert -2147483648 ≤ (int)*((char *)(&q1)) + 2; [eva:alarm] tests/value/addition.i:61: Warning: signed overflow. assert (int)*((char *)(&q1)) + 2 ≤ 2147483647; [eva:alarm] tests/value/addition.i:66: Warning: out of bounds read. assert \valid_read(*((int **)45)); [eva] tests/value/addition.i:87: Frama_C_show_each_1: [-10..15] [eva] Recording results for main [eva] done for function main [eva:garbled-mix] Warning: Garbled mix generated during analysis: {{ garbled mix of &{p3} (origin: Arithmetic {tests/value/addition.i:34}) }} {{ garbled mix of &{p2} (origin: Arithmetic {tests/value/addition.i:34}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:36}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:38}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:40}) }} {{ garbled mix of &{p2} (origin: Arithmetic {tests/value/addition.i:42}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:42}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:44}) }} {{ garbled mix of &{p2} (origin: Arithmetic {tests/value/addition.i:46}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:50}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:52}) }} {{ garbled mix of &{p2} (origin: Arithmetic {tests/value/addition.i:56}) }} {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:56}) }} {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:59}) }} {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:61}) }} [scope:rm_asserts] removing 2 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0] ∈ {0} [1][bits 0 to 23] ∈ {0; 45; 46} [1][bits 24 to 31] ∈ [--..--] [2] ∈ {3} [3..9] ∈ {0} z ∈ {37} p1 ∈ {{ garbled mix of &{p2; p3} (origin: Arithmetic {tests/value/addition.i:34}) }} p2 ∈ {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:36}) }} p3 ∈ {{ garbled mix of &{t; p1} (origin: Arithmetic {tests/value/addition.i:38}) }} p4 ∈ {{ garbled mix of &{p1; tt} (origin: Arithmetic {tests/value/addition.i:40}) }} p5 ∈ {{ garbled mix of &{p1; p2; ttt} (origin: Arithmetic {tests/value/addition.i:42}) }} p6 ∈ {{ garbled mix of &{p1; ttt} (origin: Arithmetic {tests/value/addition.i:44}) }} p7 ∈ {{ garbled mix of &{p2; ttt} (origin: Arithmetic {tests/value/addition.i:46}) }} p8 ∈ {0; 1} p9 ∈ {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:50}) }} p10 ∈ {{ garbled mix of &{p1} (origin: Arithmetic {tests/value/addition.i:52}) }} p11 ∈ [-2147483648..0],0%4 p12 ∈ {{ garbled mix of &{p1; p2} (origin: Arithmetic {tests/value/addition.i:56}) }} p13 ∈ {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:59}) }} p14 ∈ {{ garbled mix of &{p1} (origin: Misaligned {tests/value/addition.i:61}) }} p15 ∈ {-1} p16 ∈ {2; 2949122; 3014658} p17 ∈ {-2147483648; 0} u1 ∈ {8} q1 ∈ {{ &p1 }} quo1 ∈ {3} rem1 ∈ {1} quo2 ∈ {-3} rem2 ∈ {-1} quo3 ∈ {3} rem3 ∈ {-1} quo4 ∈ {-3} rem4 ∈ {1} quo5 ∈ {-3} rem5 ∈ {0} mm1 ∈ [-224848..151152],0%16 mm2 ∈ [-6982976..4665024],64%128 mm3 ∈ [-1182974..789526],1%5 quo6 ∈ [-446..-371],1%3 c1 ∈ [-48..77],2%5 c2 ∈ [-46..79],4%5 qu1 ∈ [53..223] qu2 ∈ [-14..23] ll1 ∈ [4294967248..4294967373],3%5 ll2 ∈ [4294967250..4294967375],0%5 tt[0].a ∈ {0} [0].b ∈ {-1} {[0].[bits 34 to 63]; [1..4]} ∈ {0} square ∈ [-150..225] u2 ∈ {34} __retres ∈ {6} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[1] FROM NULL[45..49] [2] FROM \nothing z FROM \nothing p1 FROM \nothing p2 FROM \nothing p3 FROM \nothing p4 FROM \nothing p5 FROM \nothing p6 FROM u2 p7 FROM u2 p8 FROM \nothing p9 FROM \nothing p10 FROM \nothing p11 FROM u2 (and SELF) p12 FROM \nothing p13 FROM \nothing p14 FROM \nothing p15 FROM \nothing p16 FROM NULL[45..49]; t[0][bits 16 to 31] p17 FROM u4 u1 FROM \nothing q1 FROM \nothing quo1 FROM \nothing rem1 FROM \nothing quo2 FROM \nothing rem2 FROM \nothing quo3 FROM \nothing rem3 FROM \nothing quo4 FROM \nothing rem4 FROM \nothing quo5 FROM \nothing rem5 FROM \nothing mm1 FROM u2; u3_0 mm2 FROM u2; u3_0 mm3 FROM u2; u3_0 quo6 FROM u3_0 c1 FROM u3_0 c2 FROM u3_0 qu1 FROM u3_0 qu2 FROM u3_0 ll1 FROM u3_0 ll2 FROM u3_0 tt[0].b FROM \nothing square FROM u3_0 \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[1..2]; z; p1; p2; p3; p4; p5; p6; p7; p8; p9; p10; p11; p12; p13; p14; p15; p16; p17; u1; q1; quo1; rem1; quo2; rem2; quo3; rem3; quo4; rem4; quo5; rem5; mm1; mm2; mm3; quo6; c1; c2; qu1; qu2; ll1; ll2; tt[0].b; square; u2; s; t_0; __retres [inout] Inputs for function main: NULL[45..49]; t{{[0][bits 16 to 31]; [1][bits 0 to 15]}; [2]}; z; p17; q1[bits 0 to 7]; ll1; ll2; tt[0].b frama-c-20.0-Calcium/tests/value/oracle/addr.0.res.oracle0000666000000000000000000000236313571573400017771 0ustar [kernel] Parsing tests/value/addr.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..4] ∈ {0} x ∈ {0} p ∈ {0} q ∈ {0} [eva] computing for function f <- main. Called from tests/value/addr.i:20. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: p ∈ {{ &t[2] }} [eva:final-states] Values at end of function main: t[0..1] ∈ {0} [2] ∈ {77} [3..4] ∈ {0} p ∈ {{ &t[2] }} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: p FROM i [from] Function main: t[2] FROM \nothing p FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: p [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: t[2]; p [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/addr.1.res.oracle0000666000000000000000000000144413571573400017771 0ustar [kernel] Parsing tests/value/addr.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..4] ∈ {0} x ∈ {0} p ∈ {0} q ∈ {0} [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: p ∈ {{ &t + [-8589934592..8589934588],0%4 }} [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: p FROM i [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: p [inout] Inputs for function f: \nothing frama-c-20.0-Calcium/tests/value/oracle/addr2.res.oracle0000666000000000000000000000206013571573400017707 0ustar [kernel] Parsing tests/value/addr2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} t[0..12] ∈ {0} [eva] tests/value/addr2.i:19: Frama_C_show_each_F: {0} [eva] tests/value/addr2.i:13: starting to merge loop iterations [eva] tests/value/addr2.i:19: Frama_C_show_each_F: {0; 1} [eva] tests/value/addr2.i:19: Frama_C_show_each_F: {0; 1; 2} [eva] tests/value/addr2.i:19: Frama_C_show_each_F: [0..12] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {13} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/addrofstring.res.oracle0000666000000000000000000000147113571573400021406 0ustar [kernel] Parsing tests/value/addrofstring.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ "bar" }} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM "bar"[bits 8 to 15] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; __retres [inout] Inputs for function main: "bar"[bits 8 to 15] frama-c-20.0-Calcium/tests/value/oracle/affect_corrupt.0.res.oracle0000666000000000000000000000203313571573400022057 0ustar [kernel] Parsing tests/value/affect_corrupt.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} r ∈ {77} [eva:alarm] tests/value/affect_corrupt.i:8: Warning: out of bounds read. assert \valid_read(p); [eva] Recording results for main [eva] done for function main [eva] tests/value/affect_corrupt.i:8: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: r [inout] Inputs for function main: p frama-c-20.0-Calcium/tests/value/oracle/affect_corrupt.1.res.oracle0000666000000000000000000000150013571573400022056 0ustar [kernel] Parsing tests/value/affect_corrupt.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 31] ∈ [--..--] p ∈ {0} r ∈ {77} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: r ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: r FROM NULL[0..3]; p [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: r [inout] Inputs for function main: NULL[0..3]; p frama-c-20.0-Calcium/tests/value/oracle/ai_annot.res.oracle0000666000000000000000000000325113571573400020506 0ustar [kernel] Parsing tests/value/ai_annot.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization u ∈ {0} v ∈ {0} w ∈ {0} [eva:alarm] tests/value/ai_annot.i:9: Warning: assertion got status unknown. [eva:alarm] tests/value/ai_annot.i:10: Warning: assertion got status unknown. [eva:alarm] tests/value/ai_annot.i:11: Warning: assertion got status unknown. [eva:alarm] tests/value/ai_annot.i:12: Warning: out of bounds write. assert \valid(p + 1); [eva:alarm] tests/value/ai_annot.i:14: Warning: out of bounds read. assert \valid_read(p + 2); [eva:alarm] tests/value/ai_annot.i:14: Warning: signed overflow. assert x + *(p + 2) ≤ 2147483647; [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 2 assertion(s) [scope:rm_asserts] tests/value/ai_annot.i:12: removing redundant assert Eva: mem_access: \valid(p + 1); [scope:rm_asserts] tests/value/ai_annot.i:14: removing redundant assert Eva: mem_access: \valid_read(p + 2); [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ [--..--] S_p[0] ∈ [--..--] [1] ∈ [0..2147483647] [2] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: S_p[1] FROM x; p \result FROM x; p; S_p[2] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres; S_p[1] [inout] Inputs for function main: S_p[2] frama-c-20.0-Calcium/tests/value/oracle/alias.0.res.oracle0000666000000000000000000000647513571573400020160 0ustar [kernel] Parsing tests/value/alias.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} p[0..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p2[0..4] ∈ {0} q2[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p3[0..4] ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t2 ∈ {0} v2 ∈ {0} PTR1 ∈ {0} PTR2 ∈ {0} PTR3 ∈ {0} PTR4 ∈ {0} PTR5 ∈ {0} PTR6 ∈ {0} c ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] e ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} tz1 ∈ {0} tz2 ∈ {0} tz3 ∈ {0} tx ∈ {0} ty ∈ {0} tz ∈ {0} U ∈ {0} char1 ∈ {0} ll1 ∈ {0} [eva] computing for function f <- main. Called from tests/value/alias.i:45. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/alias.i:46. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/alias.i:47. [eva] Recording results for f [eva] Done for function f [eva] tests/value/alias.i:82: Frama_C_show_each_d0: [-2147483648..2147483647] [eva] tests/value/alias.i:84: Frama_C_show_each_d2: [-2147483648..2147483647] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Cannot filter: dumping raw memory (including unchanged variables) A ∈ {516} B ∈ {4} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} p[0][bits 0 to 15]# ∈ {1} repeated %8 {[0][bits 16 to 31]; [1..4]} ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p2[0] ∈ {0; 7} [1] ∈ {0; 6} [2..4] ∈ {0} q2[0] ∈ {1} [1] ∈ {2; 7} [2] ∈ {3; 6} [3] ∈ {4} [4] ∈ {5} p3[0] ∈ {0} [1] ∈ [--..--] [2..4] ∈ {0} t ∈ {1; 2; 4} u ∈ {2; 3; 4; 5} v ∈ {1; 2; 4; 5} w ∈ {1; 2; 4; 5} x ∈ {1; 4} y ∈ {2; 4; 5} z ∈ {3; 5} t2 ∈ {0; 3; 6} v2 ∈ {0; 2; 7} PTR1 ∈ {{ &x ; &y }} PTR2 ∈ {{ &y ; &z }} PTR3 ∈ {{ &x ; &y }} PTR4 ∈ {{ &p2[1] ; &q2[2] }} PTR5 ∈ {0} PTR6 ∈ {0} c ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] vol ∈ [--..--] e ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} tz1 ∈ {0} tz2 ∈ {0} tz3 ∈ {0} tx ∈ {0} ty ∈ {0} tz ∈ {0} U ∈ {0} char1 ∈ {0} ll1 ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: FROMTOP [from] Function main: FROMTOP [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: ANYTHING(origin:Unknown) [inout] Inputs for function f: ANYTHING(origin:Unknown) [inout] Out (internal) for function main: ANYTHING(origin:Unknown) [inout] Inputs for function main: ANYTHING(origin:Unknown) frama-c-20.0-Calcium/tests/value/oracle/alias.1.res.oracle0000666000000000000000000000566213571573400020156 0ustar [kernel] Parsing tests/value/alias.i (no preprocessing) [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} p[0..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p2[0..4] ∈ {0} q2[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p3[0..4] ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t2 ∈ {0} v2 ∈ {0} PTR1 ∈ {0} PTR2 ∈ {0} PTR3 ∈ {0} PTR4 ∈ {0} PTR5 ∈ {0} PTR6 ∈ {0} c ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] e ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} tz1 ∈ {0} tz2 ∈ {0} tz3 ∈ {0} tx ∈ {0} ty ∈ {0} tz ∈ {0} U ∈ {0} char1 ∈ {0} ll1 ∈ {0} [eva:alarm] tests/value/alias.i:97: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva:alarm] tests/value/alias.i:105: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva:alarm] tests/value/alias.i:105: Warning: signed overflow. assert c + 2 ≤ 2147483647; [eva:alarm] tests/value/alias.i:107: Warning: signed overflow. assert c + 10 ≤ 2147483647; [eva:alarm] tests/value/alias.i:107: Warning: signed overflow. assert c + 11 ≤ 2147483647; [eva:alarm] tests/value/alias.i:108: Warning: signed overflow. assert c + 3 ≤ 2147483647; [eva:alarm] tests/value/alias.i:108: Warning: signed overflow. assert c + 4 ≤ 2147483647; [eva] Recording results for main3 [eva] done for function main3 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main3: p2[0] ∈ {0; 96; 97; 98} [1..2] ∈ {0; 96; 97; 98; 99} [3] ∈ {0} [4] ∈ {0; 99} t ∈ {3; 4} u ∈ {0; 1} v ∈ {0; 1} x ∈ {0; 96; 97; 98; 99} z ∈ {0; 1; 2} t2 ∈ {0; 96; 97; 98; 99} v2 ∈ {-1; 0; 1; 2; 3; 4} PTR1 ∈ {{ &p2{[0], [1], [2]} }} PTR2 ∈ {{ &p2{[1], [2]} }} PTR3 ∈ {{ &p2{[1], [2], [4]} }} PTR4 ∈ {{ &p2{[1], [2]} }} p_0 ∈ {{ &s1 ; &s2 }} s1.a ∈ {2; 7} .b ∈ {4} .c ∈ {6} s2.a ∈ {1; 7} .b ∈ {3} .c ∈ {5} [from] Computing for function main3 [from] Done for function main3 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main3: p2{[0..2]; [4]} FROM c (and SELF) t FROM c u FROM c v FROM c x FROM p2[0..2]; c z FROM w; c t2 FROM p2[0..2]; c v2 FROM c PTR1 FROM c PTR2 FROM c PTR3 FROM c PTR4 FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main3: p2{[0..2]; [4]}; t; u; v; x; z; t2; v2; PTR1; PTR2; PTR3; PTR4; p_0; s1; s2; tmp; tmp_0; tmp_1; tmp_2; tmp_3 [inout] Inputs for function main3: p2[0..2]; u; v; w; PTR1; PTR2; PTR3; PTR4; c frama-c-20.0-Calcium/tests/value/oracle/alias.2.res.oracle0000666000000000000000000000541113571573400020147 0ustar [kernel] Parsing tests/value/alias.i (no preprocessing) [eva] Analyzing a complete application starting at main4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 2047] ∈ [--..--] A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} p[0..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p2[0..4] ∈ {0} q2[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p3[0..4] ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t2 ∈ {0} v2 ∈ {0} PTR1 ∈ {0} PTR2 ∈ {0} PTR3 ∈ {0} PTR4 ∈ {0} PTR5 ∈ {0} PTR6 ∈ {0} c ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] e ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} tz1 ∈ {0} tz2 ∈ {0} tz3 ∈ {0} tx ∈ {0} ty ∈ {0} tz ∈ {0} U ∈ {0} char1 ∈ {0} ll1 ∈ {0} [eva:alarm] tests/value/alias.i:142: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva:alarm] tests/value/alias.i:142: Warning: signed overflow. assert c + 2 ≤ 2147483647; [eva:alarm] tests/value/alias.i:144: Warning: signed overflow. assert c + 3 ≤ 2147483647; [eva:alarm] tests/value/alias.i:144: Warning: signed overflow. assert c + 4 ≤ 2147483647; [eva] Recording results for main4 [eva] done for function main4 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main4: u ∈ {0; 1; 2} v ∈ {1; 2; 3} x ∈ {1; 2; 5} y ∈ {1; 2; 5} z ∈ {-5; -4; -3; -2; -1; 0; 1; 1000} p_0 ∈ {{ &t1.s2 ; &t2_0.s3 }} s.a ∈ {4; 27; 777} .b ∈ {5; 28} .c ∈ {6; 29} ss ∈ [--..--] sss.a ∈ {4; 27; 777} .b ∈ {5; 28; 888} .c ∈ {6; 29} pt ∈ {0} t1.s1.a ∈ {1} .s1.b ∈ {2} .s1.c ∈ {3} .s2.a ∈ {4; 777} .s2.b ∈ {5; 888} .s2.c ∈ {6} .s3.a ∈ {7} .s3.b ∈ {8} .s3.c ∈ {9} .s4.a ∈ {10} .s4.b ∈ {11} .s4.c ∈ {12} t2_0.s1.a ∈ {21} .s1.b ∈ {22} .s1.c ∈ {23} .s2.a ∈ {24} .s2.b ∈ {25} .s2.c ∈ {26} .s3.a ∈ {27; 777} .s3.b ∈ {28; 888} .s3.c ∈ {29} .s4.a ∈ {30} .s4.b ∈ {31} .s4.c ∈ {32} [from] Computing for function main4 [from] Done for function main4 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main4: u FROM c v FROM c x FROM c y FROM c z FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main4: u; v; x; y; z; p_0; s; ss; sss; pt; t1; t2_0; tmp; tmp_0 [inout] Inputs for function main4: NULL[0..11]; u; v; x; y; c frama-c-20.0-Calcium/tests/value/oracle/alias.3.res.oracle0000666000000000000000000000437013571573400020153 0ustar [kernel] Parsing tests/value/alias.i (no preprocessing) [eva] Analyzing a complete application starting at main5 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} p[0..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p2[0..4] ∈ {0} q2[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p3[0..4] ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t2 ∈ {0} v2 ∈ {0} PTR1 ∈ {0} PTR2 ∈ {0} PTR3 ∈ {0} PTR4 ∈ {0} PTR5 ∈ {0} PTR6 ∈ {0} c ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] e ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} tz1 ∈ {0} tz2 ∈ {0} tz3 ∈ {0} tx ∈ {0} ty ∈ {0} tz ∈ {0} U ∈ {0} char1 ∈ {0} ll1 ∈ {0} [eva:alarm] tests/value/alias.i:171: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva] Recording results for main5 [eva] done for function main5 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main5: u ∈ {0; 1} v ∈ {0; 1} z ∈ {0; 1; 2} sss.a ∈ {4; 27} .b ∈ {5; 28; 888; 999} .c ∈ {6; 29} pt ∈ {{ (struct T *)&t1.s2 ; (struct T *)&t2_0.s3 }} t1.s1.a ∈ {1} .s1.b ∈ {2} .s1.c ∈ {3} .s2.a ∈ {4} .s2.b ∈ {5; 888} .s2.c ∈ {6} .s3.a ∈ {7} .s3.b ∈ {8} .s3.c ∈ {9} .s4.a ∈ {10} .s4.b ∈ {11} .s4.c ∈ {12} t2_0.s1.a ∈ {21} .s1.b ∈ {22} .s1.c ∈ {23} .s2.a ∈ {24} .s2.b ∈ {25} .s2.c ∈ {26} .s3.a ∈ {27} .s3.b ∈ {28; 999} .s3.c ∈ {29} .s4.a ∈ {30} .s4.b ∈ {31} .s4.c ∈ {32} [from] Computing for function main5 [from] Done for function main5 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main5: u FROM c v FROM c z FROM w; c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main5: u; v; z; sss; pt; t1; t2_0 [inout] Inputs for function main5: u; v; w; c frama-c-20.0-Calcium/tests/value/oracle/alias.4.res.oracle0000666000000000000000000000451613571573400020156 0ustar [kernel] Parsing tests/value/alias.i (no preprocessing) [eva] Analyzing a complete application starting at main6 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 2047] ∈ [--..--] A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} p[0..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p2[0..4] ∈ {0} q2[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p3[0..4] ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t2 ∈ {0} v2 ∈ {0} PTR1 ∈ {0} PTR2 ∈ {0} PTR3 ∈ {0} PTR4 ∈ {0} PTR5 ∈ {0} PTR6 ∈ {0} c ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] e ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} tz1 ∈ {0} tz2 ∈ {0} tz3 ∈ {0} tx ∈ {0} ty ∈ {0} tz ∈ {0} U ∈ {0} char1 ∈ {0} ll1 ∈ {0} [eva] tests/value/alias.i:185: starting to merge loop iterations [eva:alarm] tests/value/alias.i:191: Warning: pointer comparison. assert \pointer_comparable((void *)PTR2, (void *)PTR1); [eva:alarm] tests/value/alias.i:199: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva] Recording results for main6 [eva] done for function main6 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main6: p[0] ∈ {0} [1] ∈ {0; 77} [2..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3; 77} [3] ∈ {4} [4] ∈ {5} u ∈ {0; 1} v ∈ {0; 1} w ∈ {0; 1} x ∈ [0..99] y ∈ {0; 3; 77} z ∈ {-33} PTR1 ∈ {{ &p[1] ; &q[2] }} PTR2 ∈ [--..--] i_0 ∈ {100} [from] Computing for function main6 [from] Done for function main6 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main6: p[1] FROM c (and SELF) q[2] FROM c (and SELF) u FROM c v FROM c w FROM c x FROM \nothing (and SELF) y FROM p[1]; q[2]; c z FROM NULL[0..3]; PTR2; c PTR1 FROM c PTR2 FROM NULL[0..3]; PTR2 [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main6: p[1]; q[2]; u; v; w; x; y; z; PTR1; PTR2; i_0 [inout] Inputs for function main6: NULL[0..3]; p[1]; q[2]; u; v; PTR1; PTR2; c frama-c-20.0-Calcium/tests/value/oracle/alias.5.res.oracle0000666000000000000000000001216113571573400020152 0ustar [kernel] Parsing tests/value/alias.i (no preprocessing) [eva] Analyzing a complete application starting at main11 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 2047] ∈ [--..--] A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} p[0..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p2[0..4] ∈ {0} q2[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p3[0..4] ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t2 ∈ {0} v2 ∈ {0} PTR1 ∈ {0} PTR2 ∈ {0} PTR3 ∈ {0} PTR4 ∈ {0} PTR5 ∈ {0} PTR6 ∈ {0} c ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] e ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} tz1 ∈ {0} tz2 ∈ {0} tz3 ∈ {0} tx ∈ {0} ty ∈ {0} tz ∈ {0} U ∈ {0} char1 ∈ {0} ll1 ∈ {0} [eva] computing for function f2 <- main11. Called from tests/value/alias.i:268. [eva] tests/value/alias.i:23: Frama_C_dump_each: # Cvalue domain: NULL[rbits 0 to 2047] ∈ [--..--] x_0 ∈ {{ (char *)&p2 }} q_0 ∈ {{ &p2 + {1} }} A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {33} E ∈ {0} F ∈ {0} G ∈ {0} p[0..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p2[0][bits 0 to 15]# ∈ {1} repeated %8 [0][bits 16 to 31] ∈ {0} [1] ∈ {33} [2..4] ∈ {0} q2[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p3[0..4] ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t2 ∈ {0} v2 ∈ {0} PTR1 ∈ {0} PTR2 ∈ {0} PTR3 ∈ {{ &p2[1] }} PTR4 ∈ {0} PTR5 ∈ {0} PTR6 ∈ {0} c ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] e ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} tz1 ∈ {0} tz2 ∈ {0} tz3 ∈ {0} tx ∈ {0} ty ∈ {0} tz ∈ {0} U ∈ {0} char1 ∈ {0} ll1 ∈ {0} i_0 ∈ {0} ==END OF DUMP== [eva] Recording results for f2 [eva] Done for function f2 [eva:alarm] tests/value/alias.i:271: Warning: signed overflow. assert c2 + 1 ≤ 2147483647; [eva:alarm] tests/value/alias.i:273: Warning: signed overflow. assert c2 + 2 ≤ 2147483647; [eva] tests/value/alias.i:279: starting to merge loop iterations [eva:alarm] tests/value/alias.i:285: Warning: pointer comparison. assert \pointer_comparable((void *)PTR2, (void *)PTR1); [eva:alarm] tests/value/alias.i:292: Warning: signed overflow. assert c1 + 1 ≤ 2147483647; [eva] tests/value/alias.i:292: starting to merge loop iterations [eva] Recording results for main11 [eva] done for function main11 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f2: q_0 ∈ {{ &p2 + {1} }} p2[0][bits 0 to 15]# ∈ {1} repeated %8 [0][bits 16 to 31] ∈ {0} [1] ∈ {33} [2..4] ∈ {0} [eva:final-states] Values at end of function main11: A ∈ {1; 33} B ∈ {-32; 0; 32} D ∈ {33} p[0] ∈ {0} [1] ∈ {0; 77} [2..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3; 77} [3] ∈ {4} [4] ∈ {5} p2[0][bits 0 to 15]# ∈ {1} repeated %8 [0][bits 16 to 31] ∈ {0} [1] ∈ {33} [2..4] ∈ {0} q2[0] ∈ {1; 33} [1] ∈ {33} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} t ∈ {0; 1} x ∈ [0..99] y ∈ {0; 3; 77} z ∈ {-33} PTR1 ∈ {{ &p[1] ; &q[2] }} PTR2 ∈ [--..--] PTR3 ∈ {{ &p2[1] }} PTR4 ∈ {{ &q2[1] }} c1 ∈ [--..--] U{.ll[bits 0 to 31]; .i; .c[bits 0 to 31]} ∈ {2; 3} {.ll[bits 32 to 63]#; .i[bits 32 to 63]#; .c[bits 32 to 63]#} ∈ {16; 17}%64, bits 32 to 63 ll1 ∈ {15; 16} i_0 ∈ {100} [from] Computing for function f2 [from] Done for function f2 [from] Computing for function main11 [from] Done for function main11 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f2: p2[0][bits 0 to 7] FROM x_0; p2[0][bits 0 to 7] [0][bits 8 to 15] FROM x_0; p2[0][bits 8 to 15] [from] Function main11: A FROM q2[0]; c1 B FROM q2[0]; c1 D FROM c p[1] FROM c (and SELF) q[2] FROM c (and SELF) p2[0][bits 0 to 7] FROM p2[0][bits 0 to 7] [0][bits 8 to 15] FROM p2[0][bits 8 to 15] [1] FROM \nothing [2] FROM p2[2]; c (and SELF) q2[0] FROM c1 (and SELF) [1] FROM \nothing t FROM c2 x FROM \nothing (and SELF) y FROM p[1]; q[2]; c z FROM NULL[0..3]; PTR2; c PTR1 FROM c PTR2 FROM NULL[0..3]; PTR2 PTR3 FROM c PTR4 FROM c1 c1 FROM c1 U FROM c2 ll1 FROM c2 [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f2: q_0; p2[0][bits 0 to 15] [inout] Inputs for function f2: p2[0][bits 0 to 15] [inout] Out (internal) for function main11: A; B; D; p[1]; q[2]; p2{[0][bits 0 to 15]; [1..2]}; q2[0..1]; t; x; y; z; PTR1; PTR2; PTR3; PTR4; c1; U; ll1; i_0; tm; tmp [inout] Inputs for function main11: NULL[0..3]; A; p[1]; q[2]; p2{[0][bits 0 to 15]; [1..2]}; q2[0]; t; PTR1; PTR2; PTR3; PTR4; c; c1; c2; ll1 frama-c-20.0-Calcium/tests/value/oracle/alias.6.res.oracle0000666000000000000000000000552413571573400020160 0ustar [kernel] Parsing tests/value/alias.i (no preprocessing) [eva] Analyzing a complete application starting at main8 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 2047] ∈ [--..--] A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} p[0..4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p2[0..4] ∈ {0} q2[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} p3[0..4] ∈ {0} t ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t2 ∈ {0} v2 ∈ {0} PTR1 ∈ {0} PTR2 ∈ {0} PTR3 ∈ {0} PTR4 ∈ {0} PTR5 ∈ {0} PTR6 ∈ {0} c ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] e ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} tz1 ∈ {0} tz2 ∈ {0} tz3 ∈ {0} tx ∈ {0} ty ∈ {0} tz ∈ {0} U ∈ {0} char1 ∈ {0} ll1 ∈ {0} [eva] Recording results for main8 [eva] done for function main8 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main8: A ∈ {3; 4} B ∈ {4; 5} C ∈ {2; 3; 33; 44} D ∈ {0; 4; 5; 33; 44} p[0..1] ∈ {0} [2] ∈ {0; 33} [3] ∈ {0; 44} [4] ∈ {0} q[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4; 33} [4] ∈ {5; 44} q2[0] ∈ {1} [1] ∈ {2; 33} [2] ∈ {3; 44} [3] ∈ {4} [4] ∈ {5} t ∈ {4; 5; 6} u ∈ {0; 5} v ∈ {0; 5; 44} w ∈ {0; 4} x ∈ {0; 4; 33} y ∈ {0; 1} z ∈ {0; 4; 33} PTR1 ∈ {{ &p[2] ; &q[3] }} PTR2 ∈ {{ &p[3] ; &q[4] }} PTR3 ∈ {{ &p[2] ; &q[3] }} PTR4 ∈ {{ &q2{[1], [2]} }} PTR5 ∈ {{ &p{[2], [3]} ; &q{[3], [4]} }} tz1 ∈ {0; 1} tz2 ∈ {0; 1} tz3 ∈ {0; 1} tx ∈ {2; 3} ty ∈ {3; 4} tz ∈ {5; 6} [from] Computing for function main8 [from] Done for function main8 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main8: A FROM c1 B FROM c1 C FROM q2[1..2]; c3 D FROM p[2..3]; q[3..4]; c2; c3 p[2..3] FROM c2 (and SELF) q[3..4] FROM c2 (and SELF) q2[1..2] FROM c3 (and SELF) t FROM c1 u FROM p[3]; q[4]; c2 v FROM p[3]; q[4]; c2 w FROM p[2]; q[3]; c2 x FROM p[2]; q[3]; c2 y FROM c1 z FROM p[2]; q[3]; c2 PTR1 FROM c2 PTR2 FROM c2 PTR3 FROM c2 PTR4 FROM c3 PTR5 FROM c2; c3 tz1 FROM c tz2 FROM c tz3 FROM c tx FROM c ty FROM c tz FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main8: A; B; C; D; p[2..3]; q[3..4]; q2[1..2]; t; u; v; w; x; y; z; PTR1; PTR2; PTR3; PTR4; PTR5; tz1; tz2; tz3; tx; ty; tz [inout] Inputs for function main8: A; B; p[2..3]; q[3..4]; q2[1..2]; PTR1; PTR2; PTR3; PTR4; PTR5; c; c1; c2; c3; tx; ty; tz frama-c-20.0-Calcium/tests/value/oracle/align.res.oracle0000666000000000000000000000210413571573400020004 0ustar [kernel] Parsing tests/value/align.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c[0..4][0..9] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: c[0][0] ∈ {120} {[0][1..9]; [1][0..9]; [2][0][bits 0 to 7]} ∈ {0} [2][0][bits 8 to 15] ∈ {121} {[2]{[0][bits 16 to 31]; [1..9]}; [3..4][0..9]} ∈ {0} d ∈ {{ (char *)&c }} l[bits 0 to 7] ∈ {2} [bits 8 to 31] ∈ {0} pl ∈ {{ &l }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: c{[0][0]; [2][0][bits 8 to 15]} FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: c{[0][0]; [2][0][bits 8 to 15]}; d; l; pl [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/align_char_array.res.oracle0000666000000000000000000000352113571573400022203 0ustar [kernel] Parsing tests/value/align_char_array.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ {0} t[0][0..1] ∈ {0} [0][2..6] ∈ {1} {[0][7..9]; [1..9][0..9]} ∈ {0} d1 ∈ {0} s1 ∈ {0} d2 ∈ {0} s2 ∈ {0} overlapread1 ∈ {0} overlapread2 ∈ {0} overlapread3 ∈ {0} overlapread4 ∈ {0} [eva:alarm] tests/value/align_char_array.c:25: Warning: signed overflow. assert -2147483648 ≤ (int)((char (*)[10])t) + 3; [eva:alarm] tests/value/align_char_array.c:25: Warning: signed overflow. assert (int)((char (*)[10])t) + 3 ≤ 2147483647; [eva:alarm] tests/value/align_char_array.c:26: Warning: signed overflow. assert -2147483648 ≤ (int)((char (*)[10])t) + 3; [eva:alarm] tests/value/align_char_array.c:26: Warning: signed overflow. assert (int)((char (*)[10])t) + 3 ≤ 2147483647; [eva:alarm] tests/value/align_char_array.c:27: Warning: signed overflow. assert -2147483648 ≤ (int)((char (*)[10])t) + 2; [eva:alarm] tests/value/align_char_array.c:27: Warning: signed overflow. assert (int)((char (*)[10])t) + 2 ≤ 2147483647; [eva:alarm] tests/value/align_char_array.c:28: Warning: signed overflow. assert -2147483648 ≤ (int)((char (*)[10])t) + 2; [eva:alarm] tests/value/align_char_array.c:28: Warning: signed overflow. assert (int)((char (*)[10])t) + 2 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 4 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: d1 ∈ {1} s1 ∈ {3} d2 ∈ {22} s2 ∈ {100} overlapread1 ∈ {16843009} overlapread2 ∈ {16843009} overlapread3 ∈ {16843010} overlapread4 ∈ {16843010} __retres ∈ {0} frama-c-20.0-Calcium/tests/value/oracle/annot.res.oracle0000666000000000000000000000405313571573400020036 0ustar [kernel] Parsing tests/value/annot.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} B ∈ {0} C ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} [eva:alarm] tests/value/annot.i:5: Warning: function main: precondition got status unknown. [eva] tests/value/annot.i:15: assertion got status valid. [eva] tests/value/annot.i:16: Frama_C_show_each_diff: {1} [eva] tests/value/annot.i:21: assertion got status valid. [eva:alarm] tests/value/annot.i:28: Warning: assertion got status unknown. [eva:alarm] tests/value/annot.i:33: Warning: assertion got status unknown. [eva] tests/value/annot.i:34: Frama_C_show_each_elseif_A_B: {0}, {2} [eva:alarm] tests/value/annot.i:38: Warning: assertion got status unknown. [eva] tests/value/annot.i:39: Frama_C_show_each_else_A_B: {0; 1}, {0; 2} [eva:alarm] tests/value/annot.i:42: Warning: assertion got status unknown. [eva] tests/value/annot.i:43: Frama_C_show_each_mn: [0..9], [0..9] [eva] tests/value/annot.i:46: assertion got status valid. [eva] tests/value/annot.i:47: assertion got status valid. [eva:alarm] tests/value/annot.i:51: Warning: assertion got status unknown. [eva:alarm] tests/value/annot.i:53: Warning: assertion got status invalid (stopping propagation). [eva] tests/value/annot.i:7: function main: no state left, postcondition got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: A; B; x; y; z; a; b; tt[0] [inout] Inputs for function main: A; B; u frama-c-20.0-Calcium/tests/value/oracle/annot_valid.res.oracle0000666000000000000000000000467413571573400021226 0ustar [kernel] Parsing tests/value/annot_valid.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] tests/value/annot_valid.i:8: assertion got status valid. [eva:alarm] tests/value/annot_valid.i:11: Warning: assertion got status invalid (stopping propagation). [eva] tests/value/annot_valid.i:14: assertion got status valid. [eva] tests/value/annot_valid.i:17: assertion got status valid. [eva] tests/value/annot_valid.i:20: assertion got status valid. [eva:alarm] tests/value/annot_valid.i:23: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/value/annot_valid.i:26: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/value/annot_valid.i:29: Warning: assertion got status unknown. [eva:alarm] tests/value/annot_valid.i:32: Warning: assertion got status unknown. [eva:alarm] tests/value/annot_valid.i:35: Warning: assertion got status unknown. [eva:alarm] tests/value/annot_valid.i:38: Warning: assertion got status unknown. [eva] tests/value/annot_valid.i:41: assertion got status valid. [eva:alarm] tests/value/annot_valid.i:44: Warning: assertion got status invalid (stopping propagation). [eva] tests/value/annot_valid.i:47: assertion got status valid. [eva:alarm] tests/value/annot_valid.i:50: Warning: assertion got status invalid (stopping propagation). [eva] tests/value/annot_valid.i:53: assertion got status valid. [eva] tests/value/annot_valid.i:56: assertion got status valid. [eva] tests/value/annot_valid.i:57: cannot evaluate ACSL term, \at() on a C label is unsupported [eva:alarm] tests/value/annot_valid.i:57: Warning: assertion got status unknown. [eva:alarm] tests/value/annot_valid.i:62: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &G }} c ∈ {{ (char *)&G }} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; c; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/anonymous_field.res.oracle0000666000000000000000000000346013571573400022113 0ustar [kernel] Parsing tests/value/anonymous_field.i (no preprocessing) [kernel] tests/value/anonymous_field.i:1: Warning: unnamed fields are a C11 extension (use -c11 to avoid this warning) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Sa ∈ {0} [eva] computing for function set_anonymous_struct <- main. Called from tests/value/anonymous_field.i:19. [eva] tests/value/anonymous_field.i:10: function set_anonymous_struct: postcondition got status valid. [eva] Recording results for set_anonymous_struct [eva] Done for function set_anonymous_struct [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function set_anonymous_struct: Sa{.a; .__anonCompField1.gcc_a} ∈ {42} {.__anonCompField1.gcc_b; .b} ∈ {3} [eva:final-states] Values at end of function main: Sa{.a; .__anonCompField1.gcc_a} ∈ {42} {.__anonCompField1.gcc_b; .b} ∈ {3} __retres ∈ {0} [from] Computing for function set_anonymous_struct [from] Done for function set_anonymous_struct [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function set_anonymous_struct: Sa.__anonCompField1.gcc_a FROM Sa.a .__anonCompField1.gcc_b FROM Sa.b [from] Function main: Sa FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function set_anonymous_struct: Sa.__anonCompField1 [inout] Inputs for function set_anonymous_struct: Sa{.a; .b} [inout] Out (internal) for function main: Sa; __retres [inout] Inputs for function main: Sa{.a; .b} frama-c-20.0-Calcium/tests/value/oracle/any_int.res.oracle0000666000000000000000000000246013571573400020360 0ustar [kernel] Parsing tests/value/any_int.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/any_int.c:9: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva:alarm] tests/value/any_int.c:9: Warning: signed overflow. assert y + 1 ≤ 2147483647; [eva:alarm] tests/value/any_int.c:9: Warning: signed overflow. assert -2147483648 ≤ y - 1; [eva] tests/value/any_int.c:9: starting to merge loop iterations [eva:alarm] tests/value/any_int.c:9: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva:alarm] tests/value/any_int.c:9: Warning: signed overflow. assert -2147483648 ≤ x - 1; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: y ∈ [--..--] x ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: y; x [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/arch.res.oracle0000666000000000000000000000164413571573400017637 0ustar [kernel] Parsing tests/value/arch.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} l ∈ {0} t[0..9] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {4} b ∈ {4} c ∈ {4} l ∈ {{ (unsigned long)&t }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: a FROM \nothing b FROM \nothing c FROM \nothing l FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b; c; l [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/arg_array.res.oracle0000666000000000000000000000221113571573400020660 0ustar [kernel] Parsing tests/value/arg_array.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/arg_array.i:2: Warning: out of bounds write. assert \valid(T); [eva:alarm] tests/value/arg_array.i:4: Warning: out of bounds write. assert \valid(ptr + 1); [eva:alarm] tests/value/arg_array.i:5: Warning: out of bounds write. assert \valid(ptr + 2); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: ptr ∈ {{ &S_T[0] }} T ∈ {{ &S_T[0] }} S_T[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: S_T[0..2] FROM T [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: ptr; T; S_T[0..2] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/arith_pointer.res.oracle0000666000000000000000000001735713571573400021601 0ustar [kernel] Parsing tests/value/arith_pointer.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} t[0..24] ∈ {0} vol ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/arith_pointer.c:69. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/arith_pointer.c:70. [eva:alarm] tests/value/arith_pointer.c:30: Warning: pointer subtraction. assert \base_addr(p1) ≡ \base_addr(p2); [eva] tests/value/arith_pointer.c:36: Frama_C_show_each: {-1} [eva] tests/value/arith_pointer.c:40: Frama_C_show_each: {0} [eva:alarm] tests/value/arith_pointer.c:49: Warning: pointer subtraction. assert \base_addr(p2) ≡ \base_addr(p1); [eva] tests/value/arith_pointer.c:50: Frama_C_show_each: {6; 11} [eva:alarm] tests/value/arith_pointer.c:51: Warning: pointer subtraction. assert \base_addr(p2) ≡ \base_addr(p2); [eva] tests/value/arith_pointer.c:52: Frama_C_show_each: {0} [eva] tests/value/arith_pointer.c:54: Assigning imprecise value to p1. The imprecision originates from Arithmetic {tests/value/arith_pointer.c:54} [eva:alarm] tests/value/arith_pointer.c:56: Warning: pointer subtraction. assert \base_addr(p2) ≡ \base_addr(p1); [eva:alarm] tests/value/arith_pointer.c:56: Warning: signed overflow. assert -2147483648 ≤ p2 - p1; [eva:alarm] tests/value/arith_pointer.c:56: Warning: signed overflow. assert p2 - p1 ≤ 2147483647; [eva] tests/value/arith_pointer.c:56: Assigning imprecise value to d. The imprecision originates from Arithmetic {tests/value/arith_pointer.c:54} [eva] tests/value/arith_pointer.c:57: Frama_C_show_each: {{ garbled mix of &{x} (origin: Arithmetic {tests/value/arith_pointer.c:54}) }} [eva:alarm] tests/value/arith_pointer.c:60: Warning: assertion got status unknown. [eva] tests/value/arith_pointer.c:64: Frama_C_show_each: [-3..5] [eva:alarm] tests/value/arith_pointer.c:65: Warning: assertion got status unknown. [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] tests/value/arith_pointer.c:30: assertion 'Eva,differing_blocks' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: t[0..1] ∈ {-3} [2..5] ∈ {-2} [6..9] ∈ {-1} [10..13] ∈ {0} [14..17] ∈ {1} [18..19] ∈ {2} [20..24] ∈ {0} i ∈ {10} j ∈ {-10} [eva:final-states] Values at end of function main2: d ∈ {1} p1 ∈ {{ &x + {0; 4; 8; 12; 16} }} p2 ∈ {{ &x + {4; 8; 12; 16; 20} }} i ∈ {0; 1; 2; 3; 4} [eva:final-states] Values at end of function main: t[0..1] ∈ {-3} [2..5] ∈ {-2} [6..9] ∈ {-1} [10..13] ∈ {0} [14..17] ∈ {1} [18..19] ∈ {2} [20..24] ∈ {0} [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: t[0..19] FROM \nothing [from] Function main2: NO EFFECTS [from] Function main: t[0..19] FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: t[0..19]; i; j [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: d; p1; p2; i [inout] Inputs for function main2: vol [inout] Out (internal) for function main: t[0..19] [inout] Inputs for function main: vol [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} t[0..24] ∈ {0} vol ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/arith_pointer.c:69. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/arith_pointer.c:70. [eva:alarm] tests/value/arith_pointer.c:30: Warning: signed overflow. assert -2147483648 ≤ p1 - p2; [eva:alarm] tests/value/arith_pointer.c:30: Warning: signed overflow. assert p1 - p2 ≤ 2147483647; [eva] tests/value/arith_pointer.c:30: Assigning imprecise value to d. The imprecision originates from Arithmetic {tests/value/arith_pointer.c:30} [eva] tests/value/arith_pointer.c:31: Frama_C_show_each: {{ garbled mix of &{x; y} (origin: Arithmetic {tests/value/arith_pointer.c:30}) }} [eva] tests/value/arith_pointer.c:36: Frama_C_show_each: {-1} [eva] tests/value/arith_pointer.c:40: Frama_C_show_each: {0} [eva:alarm] tests/value/arith_pointer.c:49: Warning: signed overflow. assert -2147483648 ≤ p2 - p1; [eva:alarm] tests/value/arith_pointer.c:49: Warning: signed overflow. assert p2 - p1 ≤ 2147483647; [eva] tests/value/arith_pointer.c:49: Assigning imprecise value to d. The imprecision originates from Arithmetic {tests/value/arith_pointer.c:49} [eva] tests/value/arith_pointer.c:50: Frama_C_show_each: {{ garbled mix of &{x; y} (origin: Arithmetic {tests/value/arith_pointer.c:49}) }} [eva:alarm] tests/value/arith_pointer.c:51: Warning: signed overflow. assert -2147483648 ≤ p2 - p2; [eva:alarm] tests/value/arith_pointer.c:51: Warning: signed overflow. assert p2 - p2 ≤ 2147483647; [eva] tests/value/arith_pointer.c:51: Assigning imprecise value to d. The imprecision originates from Arithmetic {tests/value/arith_pointer.c:51} [eva] tests/value/arith_pointer.c:52: Frama_C_show_each: {{ garbled mix of &{x; y} (origin: Arithmetic {tests/value/arith_pointer.c:51}) }} [eva:alarm] tests/value/arith_pointer.c:56: Warning: signed overflow. assert -2147483648 ≤ p2 - p1; [eva:alarm] tests/value/arith_pointer.c:56: Warning: signed overflow. assert p2 - p1 ≤ 2147483647; [eva] tests/value/arith_pointer.c:56: Assigning imprecise value to d. The imprecision originates from Arithmetic [eva] tests/value/arith_pointer.c:57: Frama_C_show_each: {{ garbled mix of &{x} (origin: Arithmetic) }} [eva] tests/value/arith_pointer.c:64: Frama_C_show_each: [-3..5] [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: t[0..1] ∈ {-3} [2..5] ∈ {-2} [6..9] ∈ {-1} [10..13] ∈ {0} [14..17] ∈ {1} [18..19] ∈ {2} [20..24] ∈ {0} i ∈ {10} j ∈ {-10} [eva:final-states] Values at end of function main2: d ∈ {1} p1 ∈ {{ &x + {0; 4; 8; 12; 16} }} p2 ∈ {{ &x + {4; 8; 12; 16; 20} }} i ∈ {0; 1; 2; 3; 4} [eva:final-states] Values at end of function main: t[0..1] ∈ {-3} [2..5] ∈ {-2} [6..9] ∈ {-1} [10..13] ∈ {0} [14..17] ∈ {1} [18..19] ∈ {2} [20..24] ∈ {0} [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: t[0..19] FROM \nothing [from] Function main2: NO EFFECTS [from] Function main: t[0..19] FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: t[0..19]; i; j [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: d; p1; p2; i [inout] Inputs for function main2: vol [inout] Out (internal) for function main: t[0..19] [inout] Inputs for function main: vol frama-c-20.0-Calcium/tests/value/oracle/array_access.res.oracle0000666000000000000000000000766513571573400021372 0ustar [kernel] Parsing tests/value/array_access.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t1[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} t2[0] ∈ {11} [1] ∈ {12} [2] ∈ {13} [3] ∈ {14} [4] ∈ {15} [5] ∈ {16} [6] ∈ {17} [7] ∈ {18} [8] ∈ {19} ch[0] ∈ {0} [1] ∈ {1} [2] ∈ {0} [3] ∈ {1} [4] ∈ {0} [5] ∈ {1} [6] ∈ {0} [7] ∈ {1} [8] ∈ {0} [9] ∈ {1} [10] ∈ {0} [11] ∈ {1} [12] ∈ {0} [13] ∈ {1} [14] ∈ {0} [15..17] ∈ {1} [18] ∈ {0} [19] ∈ {1} [20] ∈ {0} [21] ∈ {1} [22] ∈ {0} [23] ∈ {1} [24] ∈ {0} [25] ∈ {1} [26] ∈ {0} [27] ∈ {1} [28] ∈ {0} [29] ∈ {1} [30] ∈ {0} [31] ∈ {1} [32] ∈ {0} [33] ∈ {1} [34] ∈ {0} [35] ∈ {1} [36] ∈ {0} [37] ∈ {1} [38] ∈ {0} [39] ∈ {1} [40] ∈ {0} [41] ∈ {1} [42] ∈ {0} [43] ∈ {1} [44] ∈ {0} [45] ∈ {1} [46] ∈ {0} [47] ∈ {1} [48] ∈ {0} [49] ∈ {1} [50] ∈ {0} [51] ∈ {1} [52] ∈ {0} [53] ∈ {1} [54] ∈ {0} [55] ∈ {1} [56] ∈ {0} [57] ∈ {1} [58] ∈ {0} [59] ∈ {1} [60] ∈ {0} [61] ∈ {1} [62] ∈ {0} [63] ∈ {1} [64] ∈ {0} [65] ∈ {1} [66] ∈ {0} [67] ∈ {1} [68] ∈ {0} [69] ∈ {1} [70] ∈ {0} [71] ∈ {1} [72] ∈ {0} [73] ∈ {1} [74] ∈ {0} [75] ∈ {1} [76] ∈ {0} [77] ∈ {1} [78] ∈ {0} [79] ∈ {1} [80] ∈ {0} [81] ∈ {1} [82] ∈ {0} [83] ∈ {1} [84] ∈ {0} [85] ∈ {1} [86] ∈ {0} [87] ∈ {1} [88] ∈ {0} [89] ∈ {1} [90] ∈ {0} [91] ∈ {1} [92] ∈ {0} [93] ∈ {1} [94] ∈ {0} [95] ∈ {1} [96] ∈ {0} [97] ∈ {1} [98] ∈ {0} [99] ∈ {1} [100] ∈ {0} [101] ∈ {1} [102] ∈ {0} [103] ∈ {1} [104] ∈ {2} [105] ∈ {3} [106] ∈ {4} R ∈ {0} [eva] computing for function any_int <- main. Called from tests/value/array_access.c:16. [eva] using specification for function any_int [eva] Done for function any_int [eva] computing for function any_int <- main. Called from tests/value/array_access.c:16. [eva] Done for function any_int [eva] tests/value/array_access.c:18: Frama_C_show_each_I: [0..8] [eva:alarm] tests/value/array_access.c:19: Warning: accessing out of bounds index. assert 0 ≤ (int)((int)(-i) - 1); [eva] computing for function any_int <- main. Called from tests/value/array_access.c:21. [eva] Done for function any_int [eva:alarm] tests/value/array_access.c:21: Warning: out of bounds read. assert \valid_read((int *)((char *)ch) + tmp_0); (tmp_0 from any_int()) [eva] Recording results for main [eva] done for function main [eva] tests/value/array_access.c:19: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: R ∈ {16777472; 16777473} i ∈ [--..--] j ∈ {10} k ∈ {88} c ∈ [--..--] p ∈ UNINITIALIZED LT[0] ∈ {1} [1..9] ∈ {0} [from] Computing for function main [from] Computing for function any_int <-main [from] Done for function any_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function any_int: \result FROM \nothing [from] Function main: R FROM ch[0..103] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: R; i; j; k; c; p; LT[0..9]; tmp; tmp_0 [inout] Inputs for function main: t1[0..8]; t2[0..8]; ch[0..103] frama-c-20.0-Calcium/tests/value/oracle/array_array.0.res.oracle0000666000000000000000000000430213571573400021366 0ustar [kernel] Parsing tests/value/array_array.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization StaticAllocHEAP[0..3] ∈ {2} [4..9999] ∈ {0} LIB_MEM_StaticAlloc_next_free ∈ {0} [eva] computing for function LIB_MEM_StaticAlloc <- main. Called from tests/value/array_array.c:24. [eva] tests/value/array_array.c:13: Frama_C_show_each_ALLOCATION_WITH_STATIC_ALLOC: {24} [eva] Recording results for LIB_MEM_StaticAlloc [eva] Done for function LIB_MEM_StaticAlloc [eva] tests/value/array_array.c:27: Frama_C_show_each_I: {29} [eva:alarm] tests/value/array_array.c:28: Warning: accessing out of bounds index. assert i < 3; [kernel] tests/value/array_array.c:28: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/array_array.c:28: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function LIB_MEM_StaticAlloc: new ∈ {{ (void *)&StaticAllocHEAP }} LIB_MEM_StaticAlloc_next_free ∈ {24} [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function LIB_MEM_StaticAlloc [from] Done for function LIB_MEM_StaticAlloc [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function LIB_MEM_StaticAlloc: LIB_MEM_StaticAlloc_next_free FROM size; LIB_MEM_StaticAlloc_next_free \result FROM LIB_MEM_StaticAlloc_next_free [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function LIB_MEM_StaticAlloc: new; tmp; LIB_MEM_StaticAlloc_next_free [inout] Inputs for function LIB_MEM_StaticAlloc: LIB_MEM_StaticAlloc_next_free [inout] Out (internal) for function main: v; i; LIB_MEM_StaticAlloc_next_free [inout] Inputs for function main: LIB_MEM_StaticAlloc_next_free frama-c-20.0-Calcium/tests/value/oracle/array_array.1.res.oracle0000666000000000000000000000442513571573400021375 0ustar [kernel] Parsing tests/value/array_array.c (with preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization StaticAllocHEAP[0..3] ∈ {2} [4..9999] ∈ {0} LIB_MEM_StaticAlloc_next_free ∈ {0} [eva] computing for function LIB_MEM_StaticAlloc <- main2. Called from tests/value/array_array.c:41. [eva] tests/value/array_array.c:13: Frama_C_show_each_ALLOCATION_WITH_STATIC_ALLOC: {24} [eva] Recording results for LIB_MEM_StaticAlloc [eva] Done for function LIB_MEM_StaticAlloc [eva] tests/value/array_array.c:46: Frama_C_show_each_TMP: {0} [eva] tests/value/array_array.c:47: Frama_C_show_each_I: {29} [eva:alarm] tests/value/array_array.c:48: Warning: accessing out of bounds index. assert i < 3; [kernel] tests/value/array_array.c:48: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main2 [eva] done for function main2 [eva] tests/value/array_array.c:48: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function LIB_MEM_StaticAlloc: new ∈ {{ (void *)&StaticAllocHEAP }} LIB_MEM_StaticAlloc_next_free ∈ {24} [eva:final-states] Values at end of function main2: NON TERMINATING FUNCTION [from] Computing for function LIB_MEM_StaticAlloc [from] Done for function LIB_MEM_StaticAlloc [from] Computing for function main2 [from] Non-terminating function main2 (no dependencies) [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function LIB_MEM_StaticAlloc: LIB_MEM_StaticAlloc_next_free FROM size; LIB_MEM_StaticAlloc_next_free \result FROM LIB_MEM_StaticAlloc_next_free [from] Function main2: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function LIB_MEM_StaticAlloc: new; tmp; LIB_MEM_StaticAlloc_next_free [inout] Inputs for function LIB_MEM_StaticAlloc: LIB_MEM_StaticAlloc_next_free [inout] Out (internal) for function main2: v; i; tmp___0; LIB_MEM_StaticAlloc_next_free [inout] Inputs for function main2: LIB_MEM_StaticAlloc_next_free frama-c-20.0-Calcium/tests/value/oracle/array_array.2.res.oracle0000666000000000000000000000421713571573400021375 0ustar [kernel] Parsing tests/value/array_array.c (with preprocessing) [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization StaticAllocHEAP[0..3] ∈ {2} [4..9999] ∈ {0} LIB_MEM_StaticAlloc_next_free ∈ {0} [eva] computing for function LIB_MEM_StaticAlloc <- main3. Called from tests/value/array_array.c:66. [eva] tests/value/array_array.c:13: Frama_C_show_each_ALLOCATION_WITH_STATIC_ALLOC: {24} [eva] Recording results for LIB_MEM_StaticAlloc [eva] Done for function LIB_MEM_StaticAlloc [eva:alarm] tests/value/array_array.c:69: Warning: accessing out of bounds index. assert i < 3; [kernel] tests/value/array_array.c:69: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main3 [eva] done for function main3 [eva] tests/value/array_array.c:69: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function LIB_MEM_StaticAlloc: new ∈ {{ (void *)&StaticAllocHEAP }} LIB_MEM_StaticAlloc_next_free ∈ {24} [eva:final-states] Values at end of function main3: NON TERMINATING FUNCTION [from] Computing for function LIB_MEM_StaticAlloc [from] Done for function LIB_MEM_StaticAlloc [from] Computing for function main3 [from] Non-terminating function main3 (no dependencies) [from] Done for function main3 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function LIB_MEM_StaticAlloc: LIB_MEM_StaticAlloc_next_free FROM size; LIB_MEM_StaticAlloc_next_free \result FROM LIB_MEM_StaticAlloc_next_free [from] Function main3: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function LIB_MEM_StaticAlloc: new; tmp; LIB_MEM_StaticAlloc_next_free [inout] Inputs for function LIB_MEM_StaticAlloc: LIB_MEM_StaticAlloc_next_free [inout] Out (internal) for function main3: v; i; LIB_MEM_StaticAlloc_next_free [inout] Inputs for function main3: LIB_MEM_StaticAlloc_next_free frama-c-20.0-Calcium/tests/value/oracle/array_bounds.0.res.oracle0000666000000000000000000000412713571573400021547 0ustar [kernel] Parsing tests/value/array_bounds.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] s.a ∈ {1} .T[0] ∈ {0} .T[1] ∈ {1} .T[2] ∈ {2} .T[3] ∈ {3} .T[4] ∈ {4} .T[5] ∈ {5} .T[6] ∈ {6} .T[7] ∈ {7} .T[8] ∈ {8} .T[9] ∈ {9} .T[10] ∈ {10} .T[11] ∈ {11} .b ∈ {20} u.a ∈ {1} .T[0] ∈ {0} .T[1] ∈ {1} .T[2] ∈ {2} .T[3] ∈ {3} .T[4] ∈ {4} .T[5] ∈ {5} .T[6] ∈ {6} .T[7] ∈ {7} .T[8] ∈ {8} .T[9] ∈ {9} .T[10] ∈ {10} .T[11] ∈ {11} .b ∈ {20} [eva] tests/value/array_bounds.i:15: Frama_C_show_each: {0} [eva] tests/value/array_bounds.i:14: starting to merge loop iterations [eva] tests/value/array_bounds.i:15: Frama_C_show_each: {0; 1} [eva] tests/value/array_bounds.i:15: Frama_C_show_each: {0; 1; 2} [eva] tests/value/array_bounds.i:15: Frama_C_show_each: [0..11] [eva] tests/value/array_bounds.i:15: Frama_C_show_each: [0..11] [eva] tests/value/array_bounds.i:19: starting to merge loop iterations [eva:alarm] tests/value/array_bounds.i:20: Warning: accessing out of bounds index. assert j < 12; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s.a ∈ {9} .T[0] ∈ {0} .T[1] ∈ {1} .T[2] ∈ {2} .T[3] ∈ {3} .T[4] ∈ {4} .T[5] ∈ {5} .T[6] ∈ {6} .T[7] ∈ {7} .T[8] ∈ {8} .T[9] ∈ {9} .T[10] ∈ {10} .T[11] ∈ {11} .b ∈ {9} u.a ∈ {1} .T[0..11] ∈ [--..--] .b ∈ {20} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: s{.a; .b} FROM \nothing u.T[0..11] FROM c (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: s; u.T[0..11]; i; j [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/value/oracle/array_bounds.1.res.oracle0000666000000000000000000000374113571573400021551 0ustar [kernel] Parsing tests/value/array_bounds.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] s.a ∈ {1} .T[0] ∈ {0} .T[1] ∈ {1} .T[2] ∈ {2} .T[3] ∈ {3} .T[4] ∈ {4} .T[5] ∈ {5} .T[6] ∈ {6} .T[7] ∈ {7} .T[8] ∈ {8} .T[9] ∈ {9} .T[10] ∈ {10} .T[11] ∈ {11} .b ∈ {20} u.a ∈ {1} .T[0] ∈ {0} .T[1] ∈ {1} .T[2] ∈ {2} .T[3] ∈ {3} .T[4] ∈ {4} .T[5] ∈ {5} .T[6] ∈ {6} .T[7] ∈ {7} .T[8] ∈ {8} .T[9] ∈ {9} .T[10] ∈ {10} .T[11] ∈ {11} .b ∈ {20} [eva] tests/value/array_bounds.i:15: Frama_C_show_each: {0} [eva] tests/value/array_bounds.i:14: starting to merge loop iterations [eva] tests/value/array_bounds.i:15: Frama_C_show_each: {0; 1} [eva] tests/value/array_bounds.i:15: Frama_C_show_each: {0; 1; 2} [eva] tests/value/array_bounds.i:15: Frama_C_show_each: [0..11] [eva] tests/value/array_bounds.i:15: Frama_C_show_each: [0..11] [eva] tests/value/array_bounds.i:19: starting to merge loop iterations [eva:alarm] tests/value/array_bounds.i:19: Warning: signed overflow. assert j + 5 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s.a ∈ {9} {.T[0..11]; .b} ∈ [--..--] u.a ∈ {-1; 1} .T[0..11] ∈ [--..--] .b ∈ {20} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: s.a FROM \nothing .T[0..11] FROM c (and SELF) .b FROM c u.a FROM c (and SELF) .T[0..11] FROM c (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: s; u{.a; .T[0..11]}; i; j [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/value/oracle/array_degenerating_loop.res.oracle0000666000000000000000000000233413571573400023602 0ustar [kernel] Parsing tests/value/array_degenerating_loop.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..1] ∈ {1} [2..99] ∈ {0} [eva] tests/value/array_degenerating_loop.i:8: starting to merge loop iterations [eva:alarm] tests/value/array_degenerating_loop.i:9: Warning: accessing out of bounds index. assert i < 100; [eva:alarm] tests/value/array_degenerating_loop.i:9: Warning: signed overflow. assert G + t[i] ≤ 2147483647; [eva] tests/value/array_degenerating_loop.i:10: Frama_C_show_each: [55..2147483647], [-2147483648..99] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G ∈ [55..2147483647] i ∈ [0..100] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G; i [inout] Inputs for function main: t[0..99] frama-c-20.0-Calcium/tests/value/oracle/array_initializer.res.oracle0000666000000000000000000000223313571573400022436 0ustar [kernel] Parsing tests/value/array_initializer.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..1] ∈ {0} [2] ∈ {3} [3..4] ∈ {0} s.a ∈ {97} {.t[0..1]; .[bits 8 to 31]} ∈ {0} .t[2] ∈ {3} .t[3..4] ∈ {0} u[0..1] ∈ {0} [2] ∈ {2} [3] ∈ {0} [4] ∈ {4} [5] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..1] ∈ {0} [2] ∈ {3} [3..4] ∈ {0} s.a ∈ {97} .[bits 8 to 31] ∈ {0} or UNINITIALIZED .t[0..1] ∈ {0} .t[2] ∈ {3} .t[3..4] ∈ {0} u[0..1] ∈ {0} [2] ∈ {2} [3] ∈ {0} [4] ∈ {4} [5] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: frama-c-20.0-Calcium/tests/value/oracle/array_loop.res.oracle0000666000000000000000000000235113571573400021065 0ustar [kernel] Parsing tests/value/array_loop.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {17} [1] ∈ {18} [2] ∈ {19} [3] ∈ {20} [4] ∈ {21} [5] ∈ {22} [6] ∈ {23} [7] ∈ {24} [8..17] ∈ {1} [18..19] ∈ {0} tt[0] ∈ {17} [1] ∈ {18} [2] ∈ {19} [3] ∈ {20} [4] ∈ {21} [5] ∈ {22} [6] ∈ {23} [7] ∈ {24} [8..17] ∈ {1} [18..19] ∈ {0} [eva] tests/value/array_loop.i:7: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0..7] ∈ [-14..24] [8..17] ∈ {1} [18..19] ∈ {0} i ∈ {16} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[0..7] FROM tt[0..15] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[0..7]; i [inout] Inputs for function main: tt[0..15] frama-c-20.0-Calcium/tests/value/oracle/array_overlap.res.oracle0000666000000000000000000000321713571573400021566 0ustar [kernel] Parsing tests/value/array_overlap.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..2] ∈ {1} [3..4] ∈ {2} [5] ∈ {3} [6..9] ∈ {0} U[0..2] ∈ {1} [3..4] ∈ {2} [5] ∈ {3} [6..9] ∈ {0} rand ∈ [--..--] [eva:alarm] tests/value/array_overlap.i:12: Warning: partially overlapping lvalue assignment. assert ptr ≡ (struct S *)((char *)T) ∨ \separated(ptr, (struct S *)((char *)T)); [eva:alarm] tests/value/array_overlap.i:16: Warning: partially overlapping lvalue assignment. assert ptr ≡ (struct S *)((char *)U) ∨ \separated(ptr, (struct S *)((char *)U)); [eva] Recording results for main [eva] done for function main [eva] tests/value/array_overlap.i:12: assertion 'Eva,overlap' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[0..2] ∈ {1} [3..4] ∈ {2} [5] ∈ {3} [6..9] ∈ {0} U[0..2] ∈ {1} [3] ∈ {1; 2} [4] ∈ {2} [5] ∈ {2; 3} [6] ∈ {0; 3} [7..9] ∈ {0} ptr ∈ {{ (struct S *)&U{[0], [1]} }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: T[1..6] FROM T[0..5]; rand (and SELF) U[0..6] FROM U[0..5]; rand (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: T[1..6]; U[0..6]; ptr; i [inout] Inputs for function main: T[0..5]; U[0..5]; rand frama-c-20.0-Calcium/tests/value/oracle/array_ptr.res.oracle0000666000000000000000000000261713571573400020726 0ustar [kernel] Parsing tests/value/array_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {1} l[0] ∈ {1} [1..19] ∈ {0} [eva] computing for function f <- main. Called from tests/value/array_ptr.i:15. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: G ∈ {1} l[0] ∈ {2} [1..19] ∈ {0} __retres ∈ {2} [eva:final-states] Values at end of function main: G ∈ {1} l[0] ∈ {2} [1..19] ∈ {0} g ∈ {{ (int)&l }} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: G FROM x; l[0]; g l[0] FROM x; g \result FROM \nothing [from] Function main: G FROM l[0] l[0] FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: G; l[0]; __retres [inout] Inputs for function f: l[0]; g [inout] Out (internal) for function main: G; l[0]; g; __retres [inout] Inputs for function main: l[0] frama-c-20.0-Calcium/tests/value/oracle/array_zero_length.0.res.oracle0000666000000000000000000000725013571573400022575 0ustar [kernel] Parsing tests/value/array_zero_length.i (no preprocessing) [kernel] tests/value/array_zero_length.i:10: Warning: declaration of array of 'zero-length arrays' ('char [0]`); zero-length arrays are a compiler extension [kernel] tests/value/array_zero_length.i:15: Warning: declaration of array of 'zero-length arrays' ('char [0]`); zero-length arrays are a compiler extension [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] tests/value/array_zero_length.i:7: Warning: during initialization of variable 'T', size of type 'char []' cannot be computed (Size of array without number of elements.) [eva] tests/value/array_zero_length.i:9: Warning: during initialization of variable 'V', size of type 'char [][2]' cannot be computed (Size of array without number of elements.) [eva] tests/value/array_zero_length.i:10: Warning: during initialization of variable 'W', size of type 'char [][0]' cannot be computed (Size of array without number of elements.) [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..4294967295] ∈ {0} or UNINITIALIZED V[0..2147483647][0..1] ∈ {0} or UNINITIALIZED W[bits 0 to ..] ∈ {0} or UNINITIALIZED W2[0..1][0] ∈ {0} pW ∈ {0} [eva] tests/value/array_zero_length.i:24: assertion got status valid. [eva] tests/value/array_zero_length.i:28: assertion got status valid. [eva] tests/value/array_zero_length.i:30: assertion got status valid. [eva] tests/value/array_zero_length.i:32: assertion got status valid. [eva] tests/value/array_zero_length.i:34: assertion got status valid. [eva:alarm] tests/value/array_zero_length.i:36: Warning: out of bounds write. assert \valid(&T[2]); [eva:alarm] tests/value/array_zero_length.i:37: Warning: out of bounds write. assert \valid(&T[1]); [eva:alarm] tests/value/array_zero_length.i:37: Warning: accessing uninitialized left-value. assert \initialized(&T[3]); [eva:alarm] tests/value/array_zero_length.i:37: Warning: out of bounds read. assert \valid_read(&T[3]); [eva:alarm] tests/value/array_zero_length.i:39: Warning: out of bounds write. assert \valid(&V[2][1]); [eva:alarm] tests/value/array_zero_length.i:40: Warning: out of bounds write. assert \valid(&V[1][1]); [eva:alarm] tests/value/array_zero_length.i:40: Warning: accessing uninitialized left-value. assert \initialized(&V[3][1]); [eva:alarm] tests/value/array_zero_length.i:40: Warning: out of bounds read. assert \valid_read(&V[3][1]); [eva:alarm] tests/value/array_zero_length.i:42: Warning: out of bounds write. assert \valid(&W[2][1]); [eva:alarm] tests/value/array_zero_length.i:43: Warning: out of bounds write. assert \valid(&W[1][1]); [eva:alarm] tests/value/array_zero_length.i:43: Warning: accessing uninitialized left-value. assert \initialized(&W[3][1]); [eva:alarm] tests/value/array_zero_length.i:43: Warning: out of bounds read. assert \valid_read(&W[3][1]); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[0] ∈ {0} or UNINITIALIZED [1] ∈ {0; 3} or UNINITIALIZED [2] ∈ {3} [3..4294967295] ∈ {0} or UNINITIALIZED V{[0][0..1]; [1][0]} ∈ {0} or UNINITIALIZED [1][1] ∈ {0; 3} or UNINITIALIZED [2][0] ∈ {0} or UNINITIALIZED [2][1] ∈ {0; 3} or UNINITIALIZED [3..2147483647][0..1] ∈ {0} or UNINITIALIZED W[bits 0 to 7] ∈ {0} or UNINITIALIZED [bits 8 to 15] ∈ {0; 3; 6} or UNINITIALIZED [bits 16 to ..] ∈ {0} or UNINITIALIZED pW ∈ {{ NULL ; &W[-1] }} sT ∈ [--..--] sU ∈ {0} sV ∈ [--..--] sW ∈ [--..--] sT1 ∈ {0} sU1 ∈ {0} sV1 ∈ {0} sW1 ∈ {0} sW2 ∈ {2} frama-c-20.0-Calcium/tests/value/oracle/array_zero_length.1.res.oracle0000666000000000000000000000675713571573400022611 0ustar [kernel] Parsing tests/value/array_zero_length.i (no preprocessing) [kernel] tests/value/array_zero_length.i:10: Warning: declaration of array of 'zero-length arrays' ('char [0]`); zero-length arrays are a compiler extension [kernel] tests/value/array_zero_length.i:15: Warning: declaration of array of 'zero-length arrays' ('char [0]`); zero-length arrays are a compiler extension [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] tests/value/array_zero_length.i:7: Warning: during initialization of variable 'T', size of type 'char []' cannot be computed (Size of array without number of elements.) [eva] tests/value/array_zero_length.i:9: Warning: during initialization of variable 'V', size of type 'char [][2]' cannot be computed (Size of array without number of elements.) [eva] tests/value/array_zero_length.i:10: Warning: during initialization of variable 'W', size of type 'char [][0]' cannot be computed (Size of array without number of elements.) [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..4294967295] ∈ [--..--] or UNINITIALIZED V[0..2147483647][0..1] ∈ [--..--] or UNINITIALIZED W[bits 0 to ..] ∈ [--..--] or UNINITIALIZED W2[0..1][0] ∈ [--..--] pW ∈ {{ NULL ; &S_pW[0] }} S_pW[0..1] ∈ [--..--] [eva] tests/value/array_zero_length.i:24: assertion got status valid. [eva] tests/value/array_zero_length.i:28: assertion got status valid. [eva] tests/value/array_zero_length.i:30: assertion got status valid. [eva] tests/value/array_zero_length.i:32: assertion got status valid. [eva] tests/value/array_zero_length.i:34: assertion got status valid. [eva:alarm] tests/value/array_zero_length.i:36: Warning: out of bounds write. assert \valid(&T[2]); [eva:alarm] tests/value/array_zero_length.i:37: Warning: out of bounds write. assert \valid(&T[1]); [eva:alarm] tests/value/array_zero_length.i:37: Warning: accessing uninitialized left-value. assert \initialized(&T[3]); [eva:alarm] tests/value/array_zero_length.i:37: Warning: out of bounds read. assert \valid_read(&T[3]); [eva:alarm] tests/value/array_zero_length.i:39: Warning: out of bounds write. assert \valid(&V[2][1]); [eva:alarm] tests/value/array_zero_length.i:40: Warning: out of bounds write. assert \valid(&V[1][1]); [eva:alarm] tests/value/array_zero_length.i:40: Warning: accessing uninitialized left-value. assert \initialized(&V[3][1]); [eva:alarm] tests/value/array_zero_length.i:40: Warning: out of bounds read. assert \valid_read(&V[3][1]); [eva:alarm] tests/value/array_zero_length.i:42: Warning: out of bounds write. assert \valid(&W[2][1]); [eva:alarm] tests/value/array_zero_length.i:43: Warning: out of bounds write. assert \valid(&W[1][1]); [eva:alarm] tests/value/array_zero_length.i:43: Warning: accessing uninitialized left-value. assert \initialized(&W[3][1]); [eva:alarm] tests/value/array_zero_length.i:43: Warning: out of bounds read. assert \valid_read(&W[3][1]); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[0..1] ∈ [--..--] or UNINITIALIZED [2] ∈ {3} [3..4294967295] ∈ [--..--] or UNINITIALIZED V[0..2147483647][0..1] ∈ [--..--] or UNINITIALIZED W[bits 0 to ..] ∈ [--..--] or UNINITIALIZED pW ∈ {{ NULL ; &W[-1] ; &S_pW[0] }} sT ∈ [--..--] sU ∈ {0} sV ∈ [--..--] sW ∈ [--..--] sT1 ∈ {0} sU1 ∈ {0} sV1 ∈ {0} sW1 ∈ {0} sW2 ∈ {2} frama-c-20.0-Calcium/tests/value/oracle/array_zero_length.2.res.oracle0000666000000000000000000000145213571573400022575 0ustar [kernel] Parsing tests/value/array_zero_length.i (no preprocessing) [kernel] tests/value/array_zero_length.i:8: User Error: zero-length arrays only allowed for GCC/MSVC [kernel] tests/value/array_zero_length.i:10: User Error: zero-length arrays only allowed for GCC/MSVC [kernel] tests/value/array_zero_length.i:10: User Error: declaration of array of 'zero-length arrays' ('char [0]`); zero-length arrays are not allowed in C99 [kernel] tests/value/array_zero_length.i:12: User Error: empty initializers only allowed for GCC/MSVC 10 char W[][0]; 11 12 char T1[] = {}; ^^^^^^^^^^^^^^^ 13 char U1[0] = {}; 14 char V1[][2] = {}; [kernel] User Error: stopping on file "tests/value/array_zero_length.i" that has errors. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/asm_contracts.res.oracle0000666000000000000000000000506213571573400021560 0ustar [kernel] Parsing tests/value/asm_contracts.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/value/asm_contracts.c:38. [eva] tests/value/asm_contracts.c:15: assertion 'OK' got status valid. [eva:alarm] tests/value/asm_contracts.c:16: Warning: assertion 'UNKNOWN1' got status unknown. [eva:alarm] tests/value/asm_contracts.c:17: Warning: assertion 'UNKNOWN2' got status unknown. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/value/asm_contracts.c:39. [eva] tests/value/asm_contracts.c:27: assertion 'OK' got status valid. [eva:alarm] tests/value/asm_contracts.c:28: Warning: assertion 'UNKNOWN1' got status unknown. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/value/asm_contracts.c:40. [eva] tests/value/asm_contracts.c:33: Warning: assuming assembly code has no effects in function f3 [eva] tests/value/asm_contracts.c:34: assertion 'UNKNOWN' got status valid. [eva] Recording results for f3 [eva] Done for function f3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f1: src ∈ {1} dst ∈ {2} [eva:final-states] Values at end of function f2: dwSomeValue ∈ {42} [eva:final-states] Values at end of function f3: x ∈ {1} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: NO EFFECTS [from] Function f2: NO EFFECTS [from] Function f3: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f1: src; dst [inout] Inputs for function f1: \nothing [inout] Out (internal) for function f2: dwSomeValue [inout] Inputs for function f2: \nothing [inout] Out (internal) for function f3: x [inout] Inputs for function f3: \nothing [inout] Out (internal) for function main: __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/assert_ptr.res.oracle0000666000000000000000000000246213571573400021107 0ustar [kernel] Parsing tests/value/assert_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization ptr ∈ {0} q ∈ {0} s_q ∈ {0} a ∈ {0} r ∈ {0} [eva] tests/value/assert_ptr.i:8: assertion got status valid. [eva] tests/value/assert_ptr.i:9: Frama_C_show_each_ptr: {{ NULL ; &a }} [eva:alarm] tests/value/assert_ptr.i:12: Warning: assertion got status unknown. [eva] tests/value/assert_ptr.i:13: Frama_C_show_each_q: {{ &a }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: ptr ∈ {{ NULL ; &a }} q ∈ {{ (int **)&s_q }} s_q ∈ {{ (int)&a }} a ∈ {0; 1} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: ptr FROM c (and SELF) q FROM \nothing s_q FROM d; e (and SELF) a FROM ptr; a; c (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: ptr; q; s_q; a; __retres [inout] Inputs for function main: ptr; q; s_q; a frama-c-20.0-Calcium/tests/value/oracle/assign-leaf-indirect.res.oracle0000666000000000000000000000262313571573400022710 0ustar [kernel] Parsing tests/value/assign-leaf-indirect.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} [eva] computing for function f <- main. Called from tests/value/assign-leaf-indirect.i:8. [eva] using specification for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/assign-leaf-indirect.i:9. [eva] using specification for function g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: y ∈ {{ garbled mix of &{x} (origin: Library function {tests/value/assign-leaf-indirect.i:8}) }} z ∈ [--..--] [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: y FROM x; p [from] Function g: z FROM x; p [from] Function main: y FROM x z FROM x [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: y; z [inout] Inputs for function main: x frama-c-20.0-Calcium/tests/value/oracle/assigns.res.oracle0000666000000000000000000010671113571573400020372 0ustar [kernel] Parsing tests/value/assigns.i (no preprocessing) [kernel] tests/value/assigns.i:31: Warning: parsing obsolete ACSL construct 'logic declaration'. 'an axiomatic block' should be used instead. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] G ∈ {0} T[0..99] ∈ {0} Tpost[0..99] ∈ {0} t[0..9] ∈ {0} t2[0..99999] ∈ {0} t3[0..99999] ∈ {0} x ∈ {0} k ∈ {53} y1 ∈ {0} y2 ∈ {0} y3 ∈ {0} t_main3_1[0..6][0..7] ∈ {0} t_main3_2[0..2][0..3][0..4] ∈ {0} t_main4[0..999] ∈ {0} u_main4[0..99] ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/assigns.i:110. [eva] computing for function F1 <- main1 <- main. Called from tests/value/assigns.i:46. [eva] using specification for function F1 [eva] Done for function F1 [eva] computing for function f <- main1 <- main. Called from tests/value/assigns.i:49. [eva] using specification for function f [eva] Done for function f [eva] tests/value/assigns.i:48: starting to merge loop iterations [eva] computing for function f <- main1 <- main. Called from tests/value/assigns.i:49. [eva] Done for function f [eva] computing for function f <- main1 <- main. Called from tests/value/assigns.i:49. [eva] Done for function f [eva] computing for function f <- main1 <- main. Called from tests/value/assigns.i:49. [eva] Done for function f [eva] computing for function f <- main1 <- main. Called from tests/value/assigns.i:49. [eva] Done for function f [eva:alarm] tests/value/assigns.i:51: Warning: signed overflow. assert -2147483648 ≤ 2 * (int)(&T); [eva:alarm] tests/value/assigns.i:51: Warning: signed overflow. assert 2 * (int)(&T) ≤ 2147483647; [eva] computing for function g <- main1 <- main. Called from tests/value/assigns.i:51. [eva] using specification for function g [eva] Done for function g [eva:alarm] tests/value/assigns.i:52: Warning: signed overflow. assert -2147483648 ≤ 2 * (int)(&t3); [eva:alarm] tests/value/assigns.i:52: Warning: signed overflow. assert 2 * (int)(&t3) ≤ 2147483647; [eva] computing for function h <- main1 <- main. Called from tests/value/assigns.i:52. [eva] using specification for function h [eva] Done for function h [eva] computing for function j <- main1 <- main. Called from tests/value/assigns.i:54. [eva] tests/value/assigns.i:32: Cannot evaluate range bound foo(*p) (unsupported ACSL construct: logic function foo). Approximating [eva] using specification for function j [eva] Done for function j [eva] computing for function assigns_post <- main1 <- main. Called from tests/value/assigns.i:56. [eva] using specification for function assigns_post [eva] tests/value/assigns.i:39: Warning: no \from part for clause 'assigns Tpost[\at(\old(i),Post)], Tpost[\at(k,Post)];' [eva] tests/value/assigns.i:56: Warning: cannot interpret assigns clause Tpost[\at(\old(i),Post)] (no environment to evaluate \at(_,Post)); effects will be ignored [eva] tests/value/assigns.i:56: Warning: cannot interpret assigns clause Tpost[\at(k,Post)] (no environment to evaluate \at(_,Post)); effects will be ignored [eva] tests/value/assigns.i:56: Warning: cannot interpret 'from' clause 'assigns x \from \at(x,Post);' (no environment to evaluate \at(_,Post)) [eva] Done for function assigns_post [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/assigns.i:111. [eva] computing for function ff1 <- main2 <- main. Called from tests/value/assigns.i:76. [eva] using specification for function ff1 [eva] tests/value/assigns.i:60: Warning: no 'assigns \result \from ...' clause specified for function ff1 [eva] Done for function ff1 [eva] computing for function ff3 <- main2 <- main. Called from tests/value/assigns.i:78. [eva] using specification for function ff3 [eva] tests/value/assigns.i:68: Warning: no \from part for clause 'assigns y1, y3;' [eva] Done for function ff3 [eva] computing for function ff4 <- main2 <- main. Called from tests/value/assigns.i:79. [kernel:annot:missing-spec] tests/value/assigns.i:79: Warning: Neither code nor specification for function ff4, generating default assigns from the prototype [eva] using specification for function ff4 [eva] Done for function ff4 [eva] computing for function ff5 <- main2 <- main. Called from tests/value/assigns.i:80. [kernel:annot:missing-spec] tests/value/assigns.i:80: Warning: Neither code nor specification for function ff5, generating default assigns from the prototype [eva] using specification for function ff5 [eva] Done for function ff5 [eva] computing for function ff2 <- main2 <- main. Called from tests/value/assigns.i:82. [kernel:annot:missing-spec] tests/value/assigns.i:82: Warning: Neither code nor specification for function ff2, generating default assigns from the prototype [eva] using specification for function ff2 [eva] Done for function ff2 [eva] computing for function ff2_bis <- main2 <- main. Called from tests/value/assigns.i:83. [eva] using specification for function ff2_bis [eva] tests/value/assigns.i:64: Warning: no 'assigns \result \from ...' clause specified for function ff2_bis [eva] Done for function ff2_bis [eva:alarm] tests/value/assigns.i:84: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)(&x)); [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/assigns.i:112. [kernel:annot:missing-spec] tests/value/assigns.i:112: Warning: Neither code nor specification for function main3, generating default assigns from the prototype [eva] using specification for function main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/assigns.i:113. [eva] computing for function f_main4_1 <- main4 <- main. Called from tests/value/assigns.i:104. [kernel] tests/value/assigns.i:104: more than 200(1000) elements to enumerate. Approximating. [eva] using specification for function f_main4_1 [kernel] tests/value/assigns.i:104: more than 200(1000) locations to update in array. Approximating. [eva] Done for function f_main4_1 [eva] computing for function f_main4_2 <- main4 <- main. Called from tests/value/assigns.i:105. [eva] using specification for function f_main4_2 [kernel] tests/value/assigns.i:105: more than 200(1000) locations to update in array. Approximating. [eva] Done for function f_main4_2 [eva] Recording results for main4 [eva] Done for function main4 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: T[0..99] ∈ [--..--] Tpost[0..99] ∈ {0} t[0].f1 ∈ {0} {[0].f2; [1..5]} ∈ [--..--] [6..9] ∈ {0} t2[0..99999] ∈ [--..--] t3[0..99999] ∈ [--..--] x ∈ {{ ANYTHING }} [eva:final-states] Values at end of function main2: y1 ∈ [--..--] y2 ∈ [--..--] y3 ∈ [--..--] l ∈ [--..--] p ∈ [--..--] q ∈ {0} __retres ∈ {1} [eva:final-states] Values at end of function main4: t_main4{[0..998]; [999].f1} ∈ [--..--] [999].f2 ∈ {0} u_main4[0].f1 ∈ [--..--] [0].f2 ∈ {0} [1].f1 ∈ [--..--] [1].f2 ∈ {0} [2].f1 ∈ [--..--] [2].f2 ∈ {0} [3].f1 ∈ [--..--] [3].f2 ∈ {0} [4].f1 ∈ [--..--] [4].f2 ∈ {0} [5].f1 ∈ [--..--] [5].f2 ∈ {0} [6].f1 ∈ [--..--] [6].f2 ∈ {0} [7].f1 ∈ [--..--] [7].f2 ∈ {0} [8].f1 ∈ [--..--] [8].f2 ∈ {0} [9].f1 ∈ [--..--] [9].f2 ∈ {0} [10].f1 ∈ [--..--] [10].f2 ∈ {0} [11].f1 ∈ [--..--] [11].f2 ∈ {0} [12].f1 ∈ [--..--] [12].f2 ∈ {0} [13].f1 ∈ [--..--] [13].f2 ∈ {0} [14].f1 ∈ [--..--] [14].f2 ∈ {0} [15].f1 ∈ [--..--] [15].f2 ∈ {0} [16].f1 ∈ [--..--] [16].f2 ∈ {0} [17].f1 ∈ [--..--] [17].f2 ∈ {0} [18].f1 ∈ [--..--] [18].f2 ∈ {0} [19].f1 ∈ [--..--] [19].f2 ∈ {0} [20].f1 ∈ [--..--] [20].f2 ∈ {0} [21].f1 ∈ [--..--] [21].f2 ∈ {0} [22].f1 ∈ [--..--] [22].f2 ∈ {0} [23].f1 ∈ [--..--] [23].f2 ∈ {0} [24].f1 ∈ [--..--] [24].f2 ∈ {0} [25].f1 ∈ [--..--] [25].f2 ∈ {0} [26].f1 ∈ [--..--] [26].f2 ∈ {0} [27].f1 ∈ [--..--] [27].f2 ∈ {0} [28].f1 ∈ [--..--] [28].f2 ∈ {0} [29].f1 ∈ [--..--] [29].f2 ∈ {0} [30].f1 ∈ [--..--] [30].f2 ∈ {0} [31].f1 ∈ [--..--] [31].f2 ∈ {0} [32].f1 ∈ [--..--] [32].f2 ∈ {0} [33].f1 ∈ [--..--] [33].f2 ∈ {0} [34].f1 ∈ [--..--] [34].f2 ∈ {0} [35].f1 ∈ [--..--] [35].f2 ∈ {0} [36].f1 ∈ [--..--] [36].f2 ∈ {0} [37].f1 ∈ [--..--] [37].f2 ∈ {0} [38].f1 ∈ [--..--] [38].f2 ∈ {0} [39].f1 ∈ [--..--] [39].f2 ∈ {0} [40].f1 ∈ [--..--] [40].f2 ∈ {0} [41].f1 ∈ [--..--] [41].f2 ∈ {0} [42].f1 ∈ [--..--] [42].f2 ∈ {0} [43].f1 ∈ [--..--] [43].f2 ∈ {0} [44].f1 ∈ [--..--] [44].f2 ∈ {0} [45].f1 ∈ [--..--] [45].f2 ∈ {0} [46].f1 ∈ [--..--] [46].f2 ∈ {0} [47].f1 ∈ [--..--] [47].f2 ∈ {0} [48].f1 ∈ [--..--] [48].f2 ∈ {0} [49].f1 ∈ [--..--] [49].f2 ∈ {0} [50].f1 ∈ [--..--] [50].f2 ∈ {0} [51].f1 ∈ [--..--] [51].f2 ∈ {0} [52].f1 ∈ [--..--] [52].f2 ∈ {0} [53].f1 ∈ [--..--] [53].f2 ∈ {0} [54].f1 ∈ [--..--] [54].f2 ∈ {0} [55].f1 ∈ [--..--] [55].f2 ∈ {0} [56].f1 ∈ [--..--] [56].f2 ∈ {0} [57].f1 ∈ [--..--] [57].f2 ∈ {0} [58].f1 ∈ [--..--] [58].f2 ∈ {0} [59].f1 ∈ [--..--] [59].f2 ∈ {0} [60].f1 ∈ [--..--] [60].f2 ∈ {0} [61].f1 ∈ [--..--] [61].f2 ∈ {0} [62].f1 ∈ [--..--] [62].f2 ∈ {0} [63].f1 ∈ [--..--] [63].f2 ∈ {0} [64].f1 ∈ [--..--] [64].f2 ∈ {0} [65].f1 ∈ [--..--] [65].f2 ∈ {0} [66].f1 ∈ [--..--] [66].f2 ∈ {0} [67].f1 ∈ [--..--] [67].f2 ∈ {0} [68].f1 ∈ [--..--] [68].f2 ∈ {0} [69].f1 ∈ [--..--] [69].f2 ∈ {0} [70].f1 ∈ [--..--] [70].f2 ∈ {0} [71].f1 ∈ [--..--] [71].f2 ∈ {0} [72].f1 ∈ [--..--] [72].f2 ∈ {0} [73].f1 ∈ [--..--] [73].f2 ∈ {0} [74].f1 ∈ [--..--] [74].f2 ∈ {0} [75].f1 ∈ [--..--] [75].f2 ∈ {0} [76].f1 ∈ [--..--] [76].f2 ∈ {0} [77].f1 ∈ [--..--] [77].f2 ∈ {0} [78].f1 ∈ [--..--] [78].f2 ∈ {0} [79].f1 ∈ [--..--] [79].f2 ∈ {0} [80].f1 ∈ [--..--] [80].f2 ∈ {0} [81].f1 ∈ [--..--] [81].f2 ∈ {0} [82].f1 ∈ [--..--] [82].f2 ∈ {0} [83].f1 ∈ [--..--] [83].f2 ∈ {0} [84].f1 ∈ [--..--] [84].f2 ∈ {0} [85].f1 ∈ [--..--] [85].f2 ∈ {0} [86].f1 ∈ [--..--] [86].f2 ∈ {0} [87].f1 ∈ [--..--] [87].f2 ∈ {0} [88].f1 ∈ [--..--] [88].f2 ∈ {0} [89].f1 ∈ [--..--] [89].f2 ∈ {0} [90].f1 ∈ [--..--] [90].f2 ∈ {0} [91].f1 ∈ [--..--] [91].f2 ∈ {0} [92].f1 ∈ [--..--] [92].f2 ∈ {0} [93].f1 ∈ [--..--] [93].f2 ∈ {0} [94].f1 ∈ [--..--] [94].f2 ∈ {0} [95].f1 ∈ [--..--] [95].f2 ∈ {0} [96].f1 ∈ [--..--] [96].f2 ∈ {0} [97].f1 ∈ [--..--] [97].f2 ∈ {0} [98].f1 ∈ [--..--] [98].f2 ∈ {0} [99].f1 ∈ [--..--] [99].f2 ∈ {0} [eva:final-states] Values at end of function main: T[0..99] ∈ [--..--] Tpost[0..99] ∈ {0} t[0].f1 ∈ {0} {[0].f2; [1..5]} ∈ [--..--] [6..9] ∈ {0} t2[0..99999] ∈ [--..--] t3[0..99999] ∈ [--..--] x ∈ {{ ANYTHING }} y1 ∈ [--..--] y2 ∈ [--..--] y3 ∈ [--..--] t_main3_1[0][0..7] ∈ [--..--] [1..6][0..7] ∈ {0} t_main3_2[0..2][0..3][0..4] ∈ [--..--] t_main4{[0..998]; [999].f1} ∈ [--..--] [999].f2 ∈ {0} u_main4[0].f1 ∈ [--..--] [0].f2 ∈ {0} [1].f1 ∈ [--..--] [1].f2 ∈ {0} [2].f1 ∈ [--..--] [2].f2 ∈ {0} [3].f1 ∈ [--..--] [3].f2 ∈ {0} [4].f1 ∈ [--..--] [4].f2 ∈ {0} [5].f1 ∈ [--..--] [5].f2 ∈ {0} [6].f1 ∈ [--..--] [6].f2 ∈ {0} [7].f1 ∈ [--..--] [7].f2 ∈ {0} [8].f1 ∈ [--..--] [8].f2 ∈ {0} [9].f1 ∈ [--..--] [9].f2 ∈ {0} [10].f1 ∈ [--..--] [10].f2 ∈ {0} [11].f1 ∈ [--..--] [11].f2 ∈ {0} [12].f1 ∈ [--..--] [12].f2 ∈ {0} [13].f1 ∈ [--..--] [13].f2 ∈ {0} [14].f1 ∈ [--..--] [14].f2 ∈ {0} [15].f1 ∈ [--..--] [15].f2 ∈ {0} [16].f1 ∈ [--..--] [16].f2 ∈ {0} [17].f1 ∈ [--..--] [17].f2 ∈ {0} [18].f1 ∈ [--..--] [18].f2 ∈ {0} [19].f1 ∈ [--..--] [19].f2 ∈ {0} [20].f1 ∈ [--..--] [20].f2 ∈ {0} [21].f1 ∈ [--..--] [21].f2 ∈ {0} [22].f1 ∈ [--..--] [22].f2 ∈ {0} [23].f1 ∈ [--..--] [23].f2 ∈ {0} [24].f1 ∈ [--..--] [24].f2 ∈ {0} [25].f1 ∈ [--..--] [25].f2 ∈ {0} [26].f1 ∈ [--..--] [26].f2 ∈ {0} [27].f1 ∈ [--..--] [27].f2 ∈ {0} [28].f1 ∈ [--..--] [28].f2 ∈ {0} [29].f1 ∈ [--..--] [29].f2 ∈ {0} [30].f1 ∈ [--..--] [30].f2 ∈ {0} [31].f1 ∈ [--..--] [31].f2 ∈ {0} [32].f1 ∈ [--..--] [32].f2 ∈ {0} [33].f1 ∈ [--..--] [33].f2 ∈ {0} [34].f1 ∈ [--..--] [34].f2 ∈ {0} [35].f1 ∈ [--..--] [35].f2 ∈ {0} [36].f1 ∈ [--..--] [36].f2 ∈ {0} [37].f1 ∈ [--..--] [37].f2 ∈ {0} [38].f1 ∈ [--..--] [38].f2 ∈ {0} [39].f1 ∈ [--..--] [39].f2 ∈ {0} [40].f1 ∈ [--..--] [40].f2 ∈ {0} [41].f1 ∈ [--..--] [41].f2 ∈ {0} [42].f1 ∈ [--..--] [42].f2 ∈ {0} [43].f1 ∈ [--..--] [43].f2 ∈ {0} [44].f1 ∈ [--..--] [44].f2 ∈ {0} [45].f1 ∈ [--..--] [45].f2 ∈ {0} [46].f1 ∈ [--..--] [46].f2 ∈ {0} [47].f1 ∈ [--..--] [47].f2 ∈ {0} [48].f1 ∈ [--..--] [48].f2 ∈ {0} [49].f1 ∈ [--..--] [49].f2 ∈ {0} [50].f1 ∈ [--..--] [50].f2 ∈ {0} [51].f1 ∈ [--..--] [51].f2 ∈ {0} [52].f1 ∈ [--..--] [52].f2 ∈ {0} [53].f1 ∈ [--..--] [53].f2 ∈ {0} [54].f1 ∈ [--..--] [54].f2 ∈ {0} [55].f1 ∈ [--..--] [55].f2 ∈ {0} [56].f1 ∈ [--..--] [56].f2 ∈ {0} [57].f1 ∈ [--..--] [57].f2 ∈ {0} [58].f1 ∈ [--..--] [58].f2 ∈ {0} [59].f1 ∈ [--..--] [59].f2 ∈ {0} [60].f1 ∈ [--..--] [60].f2 ∈ {0} [61].f1 ∈ [--..--] [61].f2 ∈ {0} [62].f1 ∈ [--..--] [62].f2 ∈ {0} [63].f1 ∈ [--..--] [63].f2 ∈ {0} [64].f1 ∈ [--..--] [64].f2 ∈ {0} [65].f1 ∈ [--..--] [65].f2 ∈ {0} [66].f1 ∈ [--..--] [66].f2 ∈ {0} [67].f1 ∈ [--..--] [67].f2 ∈ {0} [68].f1 ∈ [--..--] [68].f2 ∈ {0} [69].f1 ∈ [--..--] [69].f2 ∈ {0} [70].f1 ∈ [--..--] [70].f2 ∈ {0} [71].f1 ∈ [--..--] [71].f2 ∈ {0} [72].f1 ∈ [--..--] [72].f2 ∈ {0} [73].f1 ∈ [--..--] [73].f2 ∈ {0} [74].f1 ∈ [--..--] [74].f2 ∈ {0} [75].f1 ∈ [--..--] [75].f2 ∈ {0} [76].f1 ∈ [--..--] [76].f2 ∈ {0} [77].f1 ∈ [--..--] [77].f2 ∈ {0} [78].f1 ∈ [--..--] [78].f2 ∈ {0} [79].f1 ∈ [--..--] [79].f2 ∈ {0} [80].f1 ∈ [--..--] [80].f2 ∈ {0} [81].f1 ∈ [--..--] [81].f2 ∈ {0} [82].f1 ∈ [--..--] [82].f2 ∈ {0} [83].f1 ∈ [--..--] [83].f2 ∈ {0} [84].f1 ∈ [--..--] [84].f2 ∈ {0} [85].f1 ∈ [--..--] [85].f2 ∈ {0} [86].f1 ∈ [--..--] [86].f2 ∈ {0} [87].f1 ∈ [--..--] [87].f2 ∈ {0} [88].f1 ∈ [--..--] [88].f2 ∈ {0} [89].f1 ∈ [--..--] [89].f2 ∈ {0} [90].f1 ∈ [--..--] [90].f2 ∈ {0} [91].f1 ∈ [--..--] [91].f2 ∈ {0} [92].f1 ∈ [--..--] [92].f2 ∈ {0} [93].f1 ∈ [--..--] [93].f2 ∈ {0} [94].f1 ∈ [--..--] [94].f2 ∈ {0} [95].f1 ∈ [--..--] [95].f2 ∈ {0} [96].f1 ∈ [--..--] [96].f2 ∈ {0} [97].f1 ∈ [--..--] [97].f2 ∈ {0} [98].f1 ∈ [--..--] [98].f2 ∈ {0} [99].f1 ∈ [--..--] [99].f2 ∈ {0} [from] Computing for function main1 [from] Computing for function F1 <-main1 [from] Done for function F1 [from] Computing for function f <-main1 [from] Done for function f [from] Computing for function g <-main1 [from] Done for function g [from] Computing for function h <-main1 [from] Done for function h [from] Computing for function j <-main1 [from] Done for function j [from] Computing for function assigns_post <-main1 [eva] tests/value/assigns.i:56: Warning: Failed to interpret inputs in assigns clause 'assigns x \from \at(x,Post);'no environment to evaluate \at(_,Post) [from] Done for function assigns_post [from] Done for function main1 [from] Computing for function main2 [from] Computing for function ff1 <-main2 [from] Done for function ff1 [from] Computing for function ff3 <-main2 [from] Done for function ff3 [from] Computing for function ff4 <-main2 [from] Done for function ff4 [from] Computing for function ff5 <-main2 [from] Done for function ff5 [from] Computing for function ff2 <-main2 [from] Done for function ff2 [from] Computing for function ff2_bis <-main2 [from] Done for function ff2_bis [from] Done for function main2 [from] Computing for function main4 [from] Computing for function f_main4_1 <-main4 [kernel] tests/value/assigns.i:104: more than 200(1000) dependencies to update. Approximating. [from] Done for function f_main4_1 [from] Computing for function f_main4_2 <-main4 [kernel] tests/value/assigns.i:105: more than 200(1000) dependencies to update. Approximating. [from] Done for function f_main4_2 [from] Done for function main4 [from] Computing for function main [from] Computing for function main3 <-main [from] Done for function main3 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function F1: T[0..99] FROM T[0..99] (and SELF) [from] Function assigns_post: Tpost{[18]; [53]} FROM ANYTHING(origin:Unknown) (and SELF) x FROM ANYTHING(origin:Unknown) (and SELF) [from] Function f: t{[0].f2; [1..5]} FROM t{[1..5]; [6].f1} (and SELF) [from] Function f_main4_1: t_main4{[0..998]; [999].f1} FROM \nothing (and SELF) u_main4{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1; [10].f1; [11].f1; [12].f1; [13].f1; [14].f1; [15].f1; [16].f1; [17].f1; [18].f1; [19].f1; [20].f1; [21].f1; [22].f1; [23].f1; [24].f1; [25].f1; [26].f1; [27].f1; [28].f1; [29].f1; [30].f1; [31].f1; [32].f1; [33].f1; [34].f1; [35].f1; [36].f1; [37].f1; [38].f1; [39].f1; [40].f1; [41].f1; [42].f1; [43].f1; [44].f1; [45].f1; [46].f1; [47].f1; [48].f1; [49].f1; [50].f1; [51].f1; [52].f1; [53].f1; [54].f1; [55].f1; [56].f1; [57].f1; [58].f1; [59].f1; [60].f1; [61].f1; [62].f1; [63].f1; [64].f1; [65].f1; [66].f1; [67].f1; [68].f1; [69].f1; [70].f1; [71].f1; [72].f1; [73].f1; [74].f1; [75].f1; [76].f1; [77].f1; [78].f1; [79].f1; [80].f1; [81].f1; [82].f1; [83].f1; [84].f1; [85].f1; [86].f1; [87].f1; [88].f1; [89].f1; [90].f1; [91].f1; [92].f1; [93].f1; [94].f1; [95].f1; [96].f1; [97].f1; [98].f1; [99].f1} FROM \nothing (and SELF) [from] Function f_main4_2: t_main4{[0..998]; [999].f1} FROM \nothing (and SELF) u_main4{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1; [10].f1; [11].f1; [12].f1; [13].f1; [14].f1; [15].f1; [16].f1; [17].f1; [18].f1; [19].f1; [20].f1; [21].f1; [22].f1; [23].f1; [24].f1; [25].f1; [26].f1; [27].f1; [28].f1; [29].f1; [30].f1; [31].f1; [32].f1; [33].f1; [34].f1; [35].f1; [36].f1; [37].f1; [38].f1; [39].f1; [40].f1; [41].f1; [42].f1; [43].f1; [44].f1; [45].f1; [46].f1; [47].f1; [48].f1; [49].f1; [50].f1; [51].f1; [52].f1; [53].f1; [54].f1; [55].f1; [56].f1; [57].f1; [58].f1; [59].f1; [60].f1; [61].f1; [62].f1; [63].f1; [64].f1; [65].f1; [66].f1; [67].f1; [68].f1; [69].f1; [70].f1; [71].f1; [72].f1; [73].f1; [74].f1; [75].f1; [76].f1; [77].f1; [78].f1; [79].f1; [80].f1; [81].f1; [82].f1; [83].f1; [84].f1; [85].f1; [86].f1; [87].f1; [88].f1; [89].f1; [90].f1; [91].f1; [92].f1; [93].f1; [94].f1; [95].f1; [96].f1; [97].f1; [98].f1; [99].f1} FROM \nothing [from] Function ff1: \result FROM ANYTHING(origin:Unknown) [from] Function ff2: \result FROM \nothing [from] Function ff2_bis: \result FROM ANYTHING(origin:Unknown) [from] Function ff3: y1 FROM ANYTHING(origin:Unknown) (and SELF) y2 FROM y2 (and SELF) y3 FROM ANYTHING(origin:Unknown) (and SELF) [from] Function ff4: NO EFFECTS [from] Function ff5: \result FROM \nothing [from] Function g: t2[0..99999] FROM \nothing (and SELF) [from] Function h: t3[0..99999] FROM \nothing (and SELF) [from] Function j: T[9..96] FROM \nothing (and SELF) [from] Function main1: T[0..99] FROM T[0..99] (and SELF) Tpost{[18]; [53]} FROM ANYTHING(origin:Unknown) (and SELF) t{[0].f2; [1..5]} FROM t{[1..5]; [6].f1} (and SELF) t2[0..99999] FROM \nothing (and SELF) t3[0..99999] FROM \nothing (and SELF) x FROM ANYTHING(origin:Unknown) (and SELF) [from] Function main2: y1 FROM ANYTHING(origin:Unknown) (and SELF) y2 FROM y2 (and SELF) y3 FROM ANYTHING(origin:Unknown) (and SELF) \result FROM \nothing [from] Function main3: t_main3_1[0][0..7] FROM t_main3_1[0][0..7]; t_main3_2[0..2][0..3][0..4] (and SELF) t_main3_2[0..2][0..3][0..4] FROM t_main3_1[0][0..7]; t_main3_2[0..2][0..3][0..4] (and SELF) \result FROM t_main3_1[0][0..7]; t_main3_2[0..2][0..3][0..4] [from] Function main4: t_main4{[0..998]; [999].f1} FROM \nothing (and SELF) u_main4{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1; [10].f1; [11].f1; [12].f1; [13].f1; [14].f1; [15].f1; [16].f1; [17].f1; [18].f1; [19].f1; [20].f1; [21].f1; [22].f1; [23].f1; [24].f1; [25].f1; [26].f1; [27].f1; [28].f1; [29].f1; [30].f1; [31].f1; [32].f1; [33].f1; [34].f1; [35].f1; [36].f1; [37].f1; [38].f1; [39].f1; [40].f1; [41].f1; [42].f1; [43].f1; [44].f1; [45].f1; [46].f1; [47].f1; [48].f1; [49].f1; [50].f1; [51].f1; [52].f1; [53].f1; [54].f1; [55].f1; [56].f1; [57].f1; [58].f1; [59].f1; [60].f1; [61].f1; [62].f1; [63].f1; [64].f1; [65].f1; [66].f1; [67].f1; [68].f1; [69].f1; [70].f1; [71].f1; [72].f1; [73].f1; [74].f1; [75].f1; [76].f1; [77].f1; [78].f1; [79].f1; [80].f1; [81].f1; [82].f1; [83].f1; [84].f1; [85].f1; [86].f1; [87].f1; [88].f1; [89].f1; [90].f1; [91].f1; [92].f1; [93].f1; [94].f1; [95].f1; [96].f1; [97].f1; [98].f1; [99].f1} FROM \nothing [from] Function main: T[0..99] FROM T[0..99] (and SELF) Tpost{[18]; [53]} FROM ANYTHING(origin:Unknown) (and SELF) t{[0].f2; [1..5]} FROM t{[1..5]; [6].f1} (and SELF) t2[0..99999] FROM \nothing (and SELF) t3[0..99999] FROM \nothing (and SELF) x FROM ANYTHING(origin:Unknown) (and SELF) y1 FROM ANYTHING(origin:Unknown) (and SELF) y2 FROM y2 (and SELF) y3 FROM ANYTHING(origin:Unknown) (and SELF) t_main3_1[0][0..7] FROM t_main3_1[0][0..7]; t_main3_2[0..2][0..3][0..4] (and SELF) t_main3_2[0..2][0..3][0..4] FROM t_main3_1[0][0..7]; t_main3_2[0..2][0..3][0..4] (and SELF) t_main4{[0..998]; [999].f1} FROM \nothing (and SELF) u_main4{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1; [10].f1; [11].f1; [12].f1; [13].f1; [14].f1; [15].f1; [16].f1; [17].f1; [18].f1; [19].f1; [20].f1; [21].f1; [22].f1; [23].f1; [24].f1; [25].f1; [26].f1; [27].f1; [28].f1; [29].f1; [30].f1; [31].f1; [32].f1; [33].f1; [34].f1; [35].f1; [36].f1; [37].f1; [38].f1; [39].f1; [40].f1; [41].f1; [42].f1; [43].f1; [44].f1; [45].f1; [46].f1; [47].f1; [48].f1; [49].f1; [50].f1; [51].f1; [52].f1; [53].f1; [54].f1; [55].f1; [56].f1; [57].f1; [58].f1; [59].f1; [60].f1; [61].f1; [62].f1; [63].f1; [64].f1; [65].f1; [66].f1; [67].f1; [68].f1; [69].f1; [70].f1; [71].f1; [72].f1; [73].f1; [74].f1; [75].f1; [76].f1; [77].f1; [78].f1; [79].f1; [80].f1; [81].f1; [82].f1; [83].f1; [84].f1; [85].f1; [86].f1; [87].f1; [88].f1; [89].f1; [90].f1; [91].f1; [92].f1; [93].f1; [94].f1; [95].f1; [96].f1; [97].f1; [98].f1; [99].f1} FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: T[0..99]; Tpost{[18]; [53]}; t{[0].f2; [1..5]}; t2[0..99999]; t3[0..99999]; x; i [inout] Inputs for function main1: ANYTHING(origin:Unknown) [inout] InOut (internal) for function main1: Operational inputs: ANYTHING(origin:Unknown) Operational inputs on termination: ANYTHING(origin:Unknown) Sure outputs: i [inout] Out (internal) for function main2: y1; y2; y3; l; p; q; __retres [inout] Inputs for function main2: ANYTHING(origin:Unknown) [inout] InOut (internal) for function main2: Operational inputs: ANYTHING(origin:Unknown) Operational inputs on termination: ANYTHING(origin:Unknown) Sure outputs: l; p; q; __retres [inout] Out (internal) for function main4: t_main4{[0..998]; [999].f1}; u_main4{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1; [10].f1; [11].f1; [12].f1; [13].f1; [14].f1; [15].f1; [16].f1; [17].f1; [18].f1; [19].f1; [20].f1; [21].f1; [22].f1; [23].f1; [24].f1; [25].f1; [26].f1; [27].f1; [28].f1; [29].f1; [30].f1; [31].f1; [32].f1; [33].f1; [34].f1; [35].f1; [36].f1; [37].f1; [38].f1; [39].f1; [40].f1; [41].f1; [42].f1; [43].f1; [44].f1; [45].f1; [46].f1; [47].f1; [48].f1; [49].f1; [50].f1; [51].f1; [52].f1; [53].f1; [54].f1; [55].f1; [56].f1; [57].f1; [58].f1; [59].f1; [60].f1; [61].f1; [62].f1; [63].f1; [64].f1; [65].f1; [66].f1; [67].f1; [68].f1; [69].f1; [70].f1; [71].f1; [72].f1; [73].f1; [74].f1; [75].f1; [76].f1; [77].f1; [78].f1; [79].f1; [80].f1; [81].f1; [82].f1; [83].f1; [84].f1; [85].f1; [86].f1; [87].f1; [88].f1; [89].f1; [90].f1; [91].f1; [92].f1; [93].f1; [94].f1; [95].f1; [96].f1; [97].f1; [98].f1; [99].f1} [inout] Inputs for function main4: v [inout] InOut (internal) for function main4: Operational inputs: v Operational inputs on termination: v Sure outputs: u_main4{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1; [10].f1; [11].f1; [12].f1; [13].f1; [14].f1; [15].f1; [16].f1; [17].f1; [18].f1; [19].f1; [20].f1; [21].f1; [22].f1; [23].f1; [24].f1; [25].f1; [26].f1; [27].f1; [28].f1; [29].f1; [30].f1; [31].f1; [32].f1; [33].f1; [34].f1; [35].f1; [36].f1; [37].f1; [38].f1; [39].f1; [40].f1; [41].f1; [42].f1; [43].f1; [44].f1; [45].f1; [46].f1; [47].f1; [48].f1; [49].f1; [50].f1; [51].f1; [52].f1; [53].f1; [54].f1; [55].f1; [56].f1; [57].f1; [58].f1; [59].f1; [60].f1; [61].f1; [62].f1; [63].f1; [64].f1; [65].f1; [66].f1; [67].f1; [68].f1; [69].f1; [70].f1; [71].f1; [72].f1; [73].f1; [74].f1; [75].f1; [76].f1; [77].f1; [78].f1; [79].f1; [80].f1; [81].f1; [82].f1; [83].f1; [84].f1; [85].f1; [86].f1; [87].f1; [88].f1; [89].f1; [90].f1; [91].f1; [92].f1; [93].f1; [94].f1; [95].f1; [96].f1; [97].f1; [98].f1; [99].f1} [inout] Out (internal) for function main: T[0..99]; Tpost{[18]; [53]}; t{[0].f2; [1..5]}; t2[0..99999]; t3[0..99999]; x; y1; y2; y3; t_main3_1[0][0..7]; t_main3_2[0..2][0..3][0..4]; t_main4{[0..998]; [999].f1}; u_main4{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1; [10].f1; [11].f1; [12].f1; [13].f1; [14].f1; [15].f1; [16].f1; [17].f1; [18].f1; [19].f1; [20].f1; [21].f1; [22].f1; [23].f1; [24].f1; [25].f1; [26].f1; [27].f1; [28].f1; [29].f1; [30].f1; [31].f1; [32].f1; [33].f1; [34].f1; [35].f1; [36].f1; [37].f1; [38].f1; [39].f1; [40].f1; [41].f1; [42].f1; [43].f1; [44].f1; [45].f1; [46].f1; [47].f1; [48].f1; [49].f1; [50].f1; [51].f1; [52].f1; [53].f1; [54].f1; [55].f1; [56].f1; [57].f1; [58].f1; [59].f1; [60].f1; [61].f1; [62].f1; [63].f1; [64].f1; [65].f1; [66].f1; [67].f1; [68].f1; [69].f1; [70].f1; [71].f1; [72].f1; [73].f1; [74].f1; [75].f1; [76].f1; [77].f1; [78].f1; [79].f1; [80].f1; [81].f1; [82].f1; [83].f1; [84].f1; [85].f1; [86].f1; [87].f1; [88].f1; [89].f1; [90].f1; [91].f1; [92].f1; [93].f1; [94].f1; [95].f1; [96].f1; [97].f1; [98].f1; [99].f1} [inout] Inputs for function main: ANYTHING(origin:Unknown) [inout] InOut (internal) for function main: Operational inputs: ANYTHING(origin:Unknown) Operational inputs on termination: ANYTHING(origin:Unknown) Sure outputs: u_main4{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1; [10].f1; [11].f1; [12].f1; [13].f1; [14].f1; [15].f1; [16].f1; [17].f1; [18].f1; [19].f1; [20].f1; [21].f1; [22].f1; [23].f1; [24].f1; [25].f1; [26].f1; [27].f1; [28].f1; [29].f1; [30].f1; [31].f1; [32].f1; [33].f1; [34].f1; [35].f1; [36].f1; [37].f1; [38].f1; [39].f1; [40].f1; [41].f1; [42].f1; [43].f1; [44].f1; [45].f1; [46].f1; [47].f1; [48].f1; [49].f1; [50].f1; [51].f1; [52].f1; [53].f1; [54].f1; [55].f1; [56].f1; [57].f1; [58].f1; [59].f1; [60].f1; [61].f1; [62].f1; [63].f1; [64].f1; [65].f1; [66].f1; [67].f1; [68].f1; [69].f1; [70].f1; [71].f1; [72].f1; [73].f1; [74].f1; [75].f1; [76].f1; [77].f1; [78].f1; [79].f1; [80].f1; [81].f1; [82].f1; [83].f1; [84].f1; [85].f1; [86].f1; [87].f1; [88].f1; [89].f1; [90].f1; [91].f1; [92].f1; [93].f1; [94].f1; [95].f1; [96].f1; [97].f1; [98].f1; [99].f1} /* Generated by Frama-C */ struct __anonstruct_ts_1 { int f1 ; int f2 ; }; typedef struct __anonstruct_ts_1 ts; int volatile v; int G; /*@ assigns *(s + (..)); assigns *(s + (..)) \from *(s + (..)); */ void F1(char *s); char T[100]; char Tpost[100]; ts t[10]; int t2[100000]; int t3[100000]; /*@ assigns *(p + (0 .. 3)); assigns *(p + (0 .. 3)) \from *(p + (4 .. 7)); */ void f(char *p); /*@ assigns t2[(unsigned char)len + 1 .. (unsigned char)len + 1]; assigns t2[(unsigned char)len + 1 .. (unsigned char)len + 1] \from \nothing; */ void g(int len); /*@ assigns *(p + (..)); assigns *(p + (..)) \from \nothing; */ void h(int *p); /*@ type Lint = int; */ /*@ logic Lint foo(Lint p) ; */ /*@ assigns *(p + (0 .. foo(*p))); assigns *(p + (0 .. foo(*p))) \from \nothing; */ void j(int *p); int x; int k = 53; /*@ assigns x, Tpost[\at(\old(i),Post)], Tpost[\at(k,Post)]; assigns x \from \at(x,Post); */ void assigns_post(int i); void main1(void) { F1(T); { int i = 0; while (i <= 5) { f((char *)(& t[i].f2)); i ++; } } /*@ assert Eva: signed_overflow: -2147483648 ≤ 2 * (int)(&T); */ /*@ assert Eva: signed_overflow: 2 * (int)(&T) ≤ 2147483647; */ g(2 * (int)(& T)); /*@ assert Eva: signed_overflow: -2147483648 ≤ 2 * (int)(&t3); */ /*@ assert Eva: signed_overflow: 2 * (int)(&t3) ≤ 2147483647; */ h((int *)(2 * (int)(& t3))); j((int *)(& T[9])); assigns_post(18); return; } /*@ assigns \nothing; */ int ff1(void); /*@ assigns \result; assigns \result \from \nothing; */ int *ff2(void); /*@ assigns \nothing; */ int *ff2_bis(void); int y1; int y2; int y3; /*@ assigns y1, y2, y3; assigns y2 \from y2; */ void ff3(void); /*@ assigns \nothing; */ void ff4(void); /*@ assigns \result; assigns \result \from \nothing; */ int ff5(void); int main2(void) { int __retres; int l = ff1(); ff3(); ff4(); ff5(); int *p = ff2(); int *q = ff2_bis(); /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)p, (void *)(&x)); */ if (p != & x) { __retres = 1; goto return_label; } __retres = 0; return_label: return __retres; } int t_main3_1[7][8]; int t_main3_2[3][4][5]; /*@ assigns \result, (*a)[0 .. 7], (*(b + (0 .. 2)))[0 .. 3][0 .. 4]; assigns \result \from (*a)[0 .. 7], (*(b + (0 .. 2)))[0 .. 3][0 .. 4]; assigns (*a)[0 .. 7] \from (*a)[0 .. 7], (*(b + (0 .. 2)))[0 .. 3][0 .. 4]; assigns (*(b + (0 .. 2)))[0 .. 3][0 .. 4] \from (*a)[0 .. 7], (*(b + (0 .. 2)))[0 .. 3][0 .. 4]; */ int main3(int (*a)[8], int (* /*[3]*/ b)[4][5]); ts t_main4[1000]; ts u_main4[100]; /*@ assigns t_main4[i].f1, u_main4[i].f1; assigns t_main4[i].f1 \from \nothing; assigns u_main4[i].f1 \from \nothing; */ void f_main4_1(int i); /*@ assigns t_main4[0 .. 999].f1, u_main4[0 .. 99].f1; assigns t_main4[0 .. 999].f1 \from \nothing; assigns u_main4[0 .. 99].f1 \from \nothing; */ void f_main4_2(void); void main4(void) { f_main4_1(v); f_main4_2(); return; } void main(void) { main1(); main2(); main3(t_main3_1,t_main3_2); main4(); return; } frama-c-20.0-Calcium/tests/value/oracle/assigns_from.res.oracle0000666000000000000000000007013013571573400021410 0ustar [kernel] Parsing tests/value/assigns_from.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization u ∈ {0} v ∈ {0} k ∈ {0} a[0..9] ∈ {0} constante ∈ {2} t[0..99] ∈ {0} p_t ∈ {{ &t[0] }} t17[0..9] ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/assigns_from.i:224. [eva] computing for function f <- main1 <- main. Called from tests/value/assigns_from.i:30. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for main1 [from] Computing for function main1 [from] Done for function main1 [eva] tests/value/assigns_from.i:12: function main1: assigns got status valid. [eva] tests/value/assigns_from.i:15: function main1, behavior true: assigns got status valid. [eva] tests/value/assigns_from.i:15: function main1, behavior true: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:16: function main1, behavior true: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:19: function main1, behavior ok_too_large: assigns got status valid. [eva] tests/value/assigns_from.i:19: function main1, behavior ok_too_large: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:20: function main1, behavior ok_too_large: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:23: function main1, behavior wrong: assigns got status valid. [eva] tests/value/assigns_from.i:23: function main1, behavior wrong: \from ... part in assign clause got status valid. [eva:alarm] tests/value/assigns_from.i:24: Warning: function main1, behavior wrong: \from ... part in assign clause got status unknown (cannot validate direct dependencies). [eva] Done for function main1 [eva] computing for function main15 <- main. Called from tests/value/assigns_from.i:225. [eva] Recording results for main15 [from] Computing for function main15 [from] Done for function main15 [eva] tests/value/assigns_from.i:37: function main15: assigns got status valid. [eva] tests/value/assigns_from.i:37: function main15: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:37: function main15: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:37: function main15: \from ... part in assign clause got status valid. [eva] Done for function main15 [eva] computing for function main2 <- main. Called from tests/value/assigns_from.i:226. [eva] Recording results for main2 [from] Computing for function main2 [from] Done for function main2 [eva] tests/value/assigns_from.i:45: function main2: assigns got status valid. [eva] tests/value/assigns_from.i:45: function main2: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:48: function main2, behavior true: assigns got status valid. [eva] tests/value/assigns_from.i:48: function main2, behavior true: \from ... part in assign clause got status valid. [eva:alarm] tests/value/assigns_from.i:52: Warning: function main2, behavior wrongassigns: assigns got status unknown. [eva] tests/value/assigns_from.i:52: function main2, behavior wrongassigns: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:56: function main2, behavior true2: assigns got status valid. [eva] tests/value/assigns_from.i:56: function main2, behavior true2: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:60: function main2, behavior wrongfrom: assigns got status valid. [eva:alarm] tests/value/assigns_from.i:60: Warning: function main2, behavior wrongfrom: \from ... part in assign clause got status unknown (cannot validate direct dependencies). [eva] Done for function main2 [eva] computing for function Frama_C_interval <- main. Called from tests/value/assigns_from.i:227. [eva] using specification for function Frama_C_interval [eva] Done for function Frama_C_interval [eva] computing for function main3 <- main. Called from tests/value/assigns_from.i:228. [eva] Recording results for main3 [from] Computing for function main3 [from] Done for function main3 [eva] tests/value/assigns_from.i:67: function main3: assigns got status valid. [eva] tests/value/assigns_from.i:67: function main3: \from ... part in assign clause got status valid. [eva] Done for function main3 [eva] computing for function main3 <- main. Called from tests/value/assigns_from.i:229. [eva] Recording results for main3 [from] Computing for function main3 [from] Done for function main3 [eva:alarm] tests/value/assigns_from.i:67: Warning: function main3: assigns got status unknown. [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/assigns_from.i:230. [eva] Recording results for main4 [from] Computing for function main4 [from] Done for function main4 [eva] tests/value/assigns_from.i:78: function main4, behavior true: assigns got status valid. [eva] tests/value/assigns_from.i:78: function main4, behavior true: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:82: function main4, behavior wrong: assigns got status valid. [eva:alarm] tests/value/assigns_from.i:82: Warning: function main4, behavior wrong: \from ... part in assign clause got status unknown (cannot validate direct dependencies). [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/assigns_from.i:231. [eva] Recording results for main5 [from] Computing for function main5 [from] Done for function main5 [eva] tests/value/assigns_from.i:92: function main5, behavior wrong: assigns got status valid. [eva:alarm] tests/value/assigns_from.i:92: Warning: function main5, behavior wrong: \from ... part in assign clause got status unknown (cannot validate direct dependencies). [eva] tests/value/assigns_from.i:95: function main5, behavior true: assigns got status valid. [eva] tests/value/assigns_from.i:95: function main5, behavior true: \from ... part in assign clause got status valid. [eva] Done for function main5 [eva] computing for function Frama_C_interval <- main. Called from tests/value/assigns_from.i:232. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- main. Called from tests/value/assigns_from.i:233. [eva] Done for function Frama_C_interval [eva] computing for function main6_right <- main. Called from tests/value/assigns_from.i:234. [eva] Recording results for main6_right [from] Computing for function main6_right [from] Done for function main6_right [eva] tests/value/assigns_from.i:111: function main6_right: assigns got status valid. [eva] Done for function main6_right [eva] computing for function main6_wrong <- main. Called from tests/value/assigns_from.i:235. [eva] Recording results for main6_wrong [from] Computing for function main6_wrong [from] Done for function main6_wrong [eva:alarm] tests/value/assigns_from.i:102: Warning: function main6_wrong: assigns got status unknown. [eva] Done for function main6_wrong [eva] computing for function main7 <- main. Called from tests/value/assigns_from.i:236. [eva] Recording results for main7 [from] Computing for function main7 [from] Done for function main7 [eva] tests/value/assigns_from.i:119: function main7, behavior right: assigns got status valid. [eva:alarm] tests/value/assigns_from.i:122: Warning: function main7, behavior wrong: assigns got status unknown. [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/value/assigns_from.i:239. [eva] Recording results for main8 [from] Computing for function main8 [from] Done for function main8 [eva] tests/value/assigns_from.i:130: function main8: assigns got status valid. [eva] tests/value/assigns_from.i:130: function main8: \from ... part in assign clause got status valid. [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/assigns_from.i:241. [eva] Recording results for main8 [from] Computing for function main8 [from] Done for function main8 [eva:alarm] tests/value/assigns_from.i:130: Warning: function main8: assigns got status unknown. [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/value/assigns_from.i:243. [eva] Recording results for main9 [from] Computing for function main9 [from] Done for function main9 [eva] tests/value/assigns_from.i:135: function main9: assigns got status valid. [eva] Done for function main9 [eva] computing for function main10 <- main. Called from tests/value/assigns_from.i:244. [eva] computing for function c <- main10 <- main. Called from tests/value/assigns_from.i:152. [kernel:annot:missing-spec] tests/value/assigns_from.i:152: Warning: Neither code nor specification for function c, generating default assigns from the prototype [eva] using specification for function c [eva] Done for function c [eva] tests/value/assigns_from.i:152: starting to merge loop iterations [eva] computing for function c <- main10 <- main. Called from tests/value/assigns_from.i:152. [eva] Done for function c [eva] computing for function c <- main10 <- main. Called from tests/value/assigns_from.i:152. [eva] Done for function c [eva] computing for function c <- main10 <- main. Called from tests/value/assigns_from.i:152. [eva] Done for function c [eva] computing for function c <- main10 <- main. Called from tests/value/assigns_from.i:152. [eva] Done for function c [eva:alarm] tests/value/assigns_from.i:154: Warning: assertion got status unknown. [eva] Recording results for main10 [from] Computing for function main10 [from] Done for function main10 [eva] Done for function main10 [eva] computing for function main11 <- main. Called from tests/value/assigns_from.i:245. [eva] Recording results for main11 [from] Computing for function main11 [from] Done for function main11 [eva] tests/value/assigns_from.i:157: function main11: assigns got status valid. [eva] tests/value/assigns_from.i:157: function main11: \from ... part in assign clause got status valid. [eva] Done for function main11 [eva] computing for function main11 <- main. Called from tests/value/assigns_from.i:246. [eva] Recording results for main11 [from] Computing for function main11 [from] Done for function main11 [eva:alarm] tests/value/assigns_from.i:157: Warning: function main11: assigns got status unknown. [eva:alarm] tests/value/assigns_from.i:157: Warning: function main11: \from ... part in assign clause got status unknown (cannot validate direct dependencies). [eva] Done for function main11 [eva] computing for function Frama_C_interval <- main. Called from tests/value/assigns_from.i:247. [eva] Done for function Frama_C_interval [eva] computing for function main11 <- main. Called from tests/value/assigns_from.i:247. [eva] Recording results for main11 [from] Computing for function main11 [from] Done for function main11 [eva] Done for function main11 [eva] computing for function main12 <- main. Called from tests/value/assigns_from.i:248. [eva] Recording results for main12 [from] Computing for function main12 [from] Done for function main12 [eva] tests/value/assigns_from.i:169: function main12, behavior ok: assigns got status valid. [eva] tests/value/assigns_from.i:167: function main12, behavior ok: \from ... part in assign clause got status valid. [eva] Done for function main12 [eva] computing for function main13 <- main. Called from tests/value/assigns_from.i:249. [eva] Recording results for main13 [from] Computing for function main13 [from] Done for function main13 [eva] tests/value/assigns_from.i:179: function main13, behavior ok: assigns got status valid. [eva] tests/value/assigns_from.i:174: function main13, behavior ok: \from ... part in assign clause got status valid. [eva] tests/value/assigns_from.i:179: function main13, behavior bad: assigns got status valid. [eva:alarm] tests/value/assigns_from.i:177: Warning: function main13, behavior bad: \from ... part in assign clause got status unknown (cannot validate direct dependencies). [eva] Done for function main13 [eva] computing for function main14 <- main. Called from tests/value/assigns_from.i:250. [eva] tests/value/assigns_from.i:183: starting to merge loop iterations [eva] Recording results for main14 [from] Computing for function main14 [from] Done for function main14 [eva] tests/value/assigns_from.i:181: function main14: assigns got status valid. [eva:alarm] tests/value/assigns_from.i:181: Warning: function main14: \from ... part in assign clause got status unknown (cannot validate direct dependencies). [eva] Done for function main14 [eva] computing for function main16 <- main. Called from tests/value/assigns_from.i:251. [eva] tests/value/assigns_from.i:188: starting to merge loop iterations [eva] Recording results for main16 [from] Computing for function main16 [from] Done for function main16 [eva] tests/value/assigns_from.i:186: function main16: assigns got status valid. [eva:alarm] tests/value/assigns_from.i:186: Warning: function main16: \from ... part in assign clause got status unknown (cannot validate direct dependencies). [eva] Done for function main16 [eva] computing for function main17 <- main. Called from tests/value/assigns_from.i:252. [eva] tests/value/assigns_from.i:195: starting to merge loop iterations [eva] Recording results for main17 [from] Computing for function main17 [from] Done for function main17 [eva] tests/value/assigns_from.i:193: function main17: assigns got status valid. [eva:alarm] tests/value/assigns_from.i:193: Warning: function main17: \from ... part in assign clause got status unknown (cannot validate direct and indirect dependencies). [eva] Done for function main17 [eva] computing for function main18 <- main. Called from tests/value/assigns_from.i:253. [eva] computing for function f18 <- main18 <- main. Called from tests/value/assigns_from.i:215. [eva] using specification for function f18 [eva] Done for function f18 [eva] Recording results for main18 [from] Computing for function main18 [from] Done for function main18 [eva] Done for function main18 [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: k ∈ {0} [eva:final-states] Values at end of function main1: u ∈ {0} k ∈ {3} [eva:final-states] Values at end of function main10: t10[0..13] ∈ {3} or UNINITIALIZED [14..37] ∈ {3} [38..49] ∈ {3} or UNINITIALIZED i ∈ {50} [eva:final-states] Values at end of function main11: a[0..1] ∈ {0; 3} [2] ∈ {3} [3..8] ∈ {0} [9] ∈ {0; 3} [eva:final-states] Values at end of function main12: __retres ∈ {{ &t[0] }} [eva:final-states] Values at end of function main13: [eva:final-states] Values at end of function main14: t[0..1] ∈ {0} [2..38] ∈ [0..38] [39..99] ∈ {0} i ∈ {39} [eva:final-states] Values at end of function main15: a[0..2] ∈ {0} [3] ∈ {2} [4] ∈ {3} [5] ∈ {4} [6..9] ∈ {0} [eva:final-states] Values at end of function main16: t[0] ∈ {0} [1] ∈ [0..19] [2..38] ∈ [0..38] [39..99] ∈ {0} i ∈ {20} [eva:final-states] Values at end of function main17: t17[0][bits 0 to 7] ∈ [0..9] [0][bits 8 to 31] ∈ {0} [1][bits 0 to 7] ∈ [0..9] [1][bits 8 to 31] ∈ {0} [2][bits 0 to 7] ∈ [0..9] [2][bits 8 to 31] ∈ {0} [3][bits 0 to 7] ∈ [0..9] [3][bits 8 to 31] ∈ {0} [4][bits 0 to 7] ∈ [0..9] [4][bits 8 to 31] ∈ {0} [5][bits 0 to 7] ∈ [0..9] [5][bits 8 to 31] ∈ {0} [6][bits 0 to 7] ∈ [0..9] [6][bits 8 to 31] ∈ {0} [7][bits 0 to 7] ∈ [0..9] [7][bits 8 to 31] ∈ {0} [8][bits 0 to 7] ∈ [0..9] [8][bits 8 to 31] ∈ {0} [9][bits 0 to 7] ∈ [0..9] [9][bits 8 to 31] ∈ {0} j ∈ [10..2147483647] [eva:final-states] Values at end of function main18: base_a ∈ {17} a_0.addr ∈ {{ garbled mix of &{base_a; base_b} (origin: Misaligned {tests/value/assigns_from.i:215}) }} .i ∈ {{ garbled mix of &{base_a; base_b} (origin: Misaligned {tests/value/assigns_from.i:215}) }} or UNINITIALIZED base_b ∈ {11} b.addr ∈ {{ garbled mix of &{base_a; base_b} (origin: Misaligned {tests/value/assigns_from.i:215}) }} .i ∈ {{ garbled mix of &{base_a; base_b} (origin: Misaligned {tests/value/assigns_from.i:215}) }} or UNINITIALIZED [eva:final-states] Values at end of function main2: a[0..2] ∈ {0} [3] ∈ {2} [4] ∈ {3} [5] ∈ {4} [6..9] ∈ {0} [eva:final-states] Values at end of function main3: a[0..2] ∈ {0; 3} [3] ∈ {2; 3} [4] ∈ {3} [5] ∈ {3; 4} [6] ∈ {3} [7..9] ∈ {0; 3} [eva:final-states] Values at end of function main4: a[0..1] ∈ {0; 3} [2] ∈ {3} [3] ∈ {2; 3} [4] ∈ {3} [5] ∈ {3; 4} [6] ∈ {3} [7..9] ∈ {0; 3} [eva:final-states] Values at end of function main5: a[0..1] ∈ {0; 3} [2] ∈ {3} [3] ∈ {2; 3} [4] ∈ {3} [5] ∈ {3; 4} [6] ∈ {3} [7..9] ∈ {0; 3} [eva:final-states] Values at end of function main6_right: a[0..1] ∈ {0; 3} [2] ∈ {3} [3..5] ∈ {0} [6] ∈ {3} [7..9] ∈ {0; 3} [eva:final-states] Values at end of function main6_wrong: a[0..1] ∈ {0; 3} [2..6] ∈ {0} [7..9] ∈ {0; 3} [eva:final-states] Values at end of function main7: a[0..1] ∈ {0; 3} [2..8] ∈ {0} [9] ∈ {0; 3} [eva:final-states] Values at end of function main8: c_0 ∈ {4} d ∈ {4} or UNINITIALIZED [eva:final-states] Values at end of function main9: [eva:final-states] Values at end of function main: u ∈ {0} k ∈ {3} a[0..1] ∈ {0; 3} [2] ∈ {3} [3..8] ∈ {0} [9] ∈ {0; 3} constante ∈ {2} t[0] ∈ {0} [1] ∈ [0..19] [2..38] ∈ [0..38] [39..99] ∈ {0} t17[0][bits 0 to 7] ∈ [0..9] [0][bits 8 to 31] ∈ {0} [1][bits 0 to 7] ∈ [0..9] [1][bits 8 to 31] ∈ {0} [2][bits 0 to 7] ∈ [0..9] [2][bits 8 to 31] ∈ {0} [3][bits 0 to 7] ∈ [0..9] [3][bits 8 to 31] ∈ {0} [4][bits 0 to 7] ∈ [0..9] [4][bits 8 to 31] ∈ {0} [5][bits 0 to 7] ∈ [0..9] [5][bits 8 to 31] ∈ {0} [6][bits 0 to 7] ∈ [0..9] [6][bits 8 to 31] ∈ {0} [7][bits 0 to 7] ∈ [0..9] [7][bits 8 to 31] ∈ {0} [8][bits 0 to 7] ∈ [0..9] [8][bits 8 to 31] ∈ {0} [9][bits 0 to 7] ∈ [0..9] [9][bits 8 to 31] ∈ {0} j ∈ [0..9] a_0 ∈ {0; 1; 2; 3} b ∈ {6; 7; 8; 9} c_0 ∈ {4} d ∈ {4} or UNINITIALIZED p ∈ {{ &c_0 ; &d }} [from] Computing for function f [from] Done for function f [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main10 [from] Computing for function c <-main10 [from] Done for function c [from] Done for function main10 [from] Computing for function main11 [from] Done for function main11 [from] Computing for function main12 [from] Done for function main12 [from] Computing for function main13 [from] Done for function main13 [from] Computing for function main14 [from] Done for function main14 [from] Computing for function main15 [from] Done for function main15 [from] Computing for function main16 [from] Done for function main16 [from] Computing for function main17 [from] Done for function main17 [from] Computing for function main18 [from] Computing for function f18 <-main18 [from] Done for function f18 [from] Done for function main18 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main6_right [from] Done for function main6_right [from] Computing for function main6_wrong [from] Done for function main6_wrong [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8 [from] Done for function main8 [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main [from] Computing for function Frama_C_interval <-main [from] Done for function Frama_C_interval [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: \result FROM a; b [from] Function c: \result FROM \nothing [from] Function f: k FROM u [from] Function f18: a_0 FROM a_0; b (and SELF) b FROM a_0; b (and SELF) [from] Function main1: u FROM v k FROM \nothing [from] Function main10: NO EFFECTS [from] Function main11: a[2] FROM \nothing [from] Function main12: \result FROM \nothing [from] Function main13: \result FROM p_t [from] Function main14: t[2..38] FROM \nothing (and SELF) [from] Function main15: a[3..5] FROM \nothing [from] Function main16: t[1..19] FROM \nothing (and SELF) [from] Function main17: t17{[0][bits 0 to 7]; [1][bits 0 to 7]; [2][bits 0 to 7]; [3][bits 0 to 7]; [4][bits 0 to 7]; [5][bits 0 to 7]; [6][bits 0 to 7]; [7][bits 0 to 7]; [8][bits 0 to 7]; [9][bits 0 to 7]} FROM p; i (and SELF) [from] Function main18: NO EFFECTS [from] Function main2: a[3..5] FROM \nothing [from] Function main3: a[0..9] FROM i (and SELF) [from] Function main4: a[2] FROM \nothing [from] Function main5: a[2] FROM a[4] [from] Function main6_right: a[3..5] FROM \nothing [from] Function main6_wrong: a[2..6] FROM \nothing [from] Function main7: a{[2]; [7..8]} FROM \nothing [from] Function main8: c_0 FROM p (and SELF) d FROM p (and SELF) [from] Function main9: NO EFFECTS [from] Function main: u FROM v k FROM \nothing a{[0..1]; [9]} FROM \nothing (and SELF) [2..8] FROM \nothing constante FROM \nothing t[1..38] FROM \nothing (and SELF) t17{[0][bits 0 to 7]; [1][bits 0 to 7]; [2][bits 0 to 7]; [3][bits 0 to 7]; [4][bits 0 to 7]; [5][bits 0 to 7]; [6][bits 0 to 7]; [7][bits 0 to 7]; [8][bits 0 to 7]; [9][bits 0 to 7]} FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/value/assigns_from.i:30 (by main1): k FROM u [from] call to c at tests/value/assigns_from.i:152 (by main10): \result FROM \nothing [from] call to f18 at tests/value/assigns_from.i:215 (by main18): a_0 FROM a_0; b (and SELF) b FROM a_0; b (and SELF) [from] call to main1 at tests/value/assigns_from.i:224 (by main): u FROM v k FROM \nothing [from] call to main15 at tests/value/assigns_from.i:225 (by main): a[3..5] FROM \nothing [from] call to main2 at tests/value/assigns_from.i:226 (by main): a[3..5] FROM \nothing [from] call to Frama_C_interval at tests/value/assigns_from.i:227 (by main): \result FROM a; b [from] call to main3 at tests/value/assigns_from.i:228 (by main): a[6] FROM i [from] call to main3 at tests/value/assigns_from.i:229 (by main): a[0..9] FROM i (and SELF) [from] call to main4 at tests/value/assigns_from.i:230 (by main): a[2] FROM \nothing [from] call to main5 at tests/value/assigns_from.i:231 (by main): a[2] FROM a[4] [from] call to Frama_C_interval at tests/value/assigns_from.i:232 (by main): \result FROM a; b [from] call to Frama_C_interval at tests/value/assigns_from.i:233 (by main): \result FROM a; b [from] call to main6_right at tests/value/assigns_from.i:234 (by main): a[3..5] FROM \nothing [from] call to main6_wrong at tests/value/assigns_from.i:235 (by main): a[2..6] FROM \nothing [from] call to main7 at tests/value/assigns_from.i:236 (by main): a{[2]; [7..8]} FROM \nothing [from] call to main8 at tests/value/assigns_from.i:239 (by main): c_0 FROM p [from] call to main8 at tests/value/assigns_from.i:241 (by main): c_0 FROM p (and SELF) d FROM p (and SELF) [from] call to main9 at tests/value/assigns_from.i:243 (by main): NO EFFECTS [from] call to main10 at tests/value/assigns_from.i:244 (by main): NO EFFECTS [from] call to main11 at tests/value/assigns_from.i:245 (by main): a[2] FROM \nothing [from] call to main11 at tests/value/assigns_from.i:246 (by main): a[2] FROM \nothing [from] call to main11 at tests/value/assigns_from.i:247 (by main): a[2] FROM \nothing [from] call to Frama_C_interval at tests/value/assigns_from.i:247 (by main): \result FROM a; b [from] call to main12 at tests/value/assigns_from.i:248 (by main): \result FROM \nothing [from] call to main13 at tests/value/assigns_from.i:249 (by main): \result FROM p_t [from] call to main14 at tests/value/assigns_from.i:250 (by main): t[2..38] FROM \nothing (and SELF) [from] call to main16 at tests/value/assigns_from.i:251 (by main): t[1..19] FROM \nothing (and SELF) [from] call to main17 at tests/value/assigns_from.i:252 (by main): t17{[0][bits 0 to 7]; [1][bits 0 to 7]; [2][bits 0 to 7]; [3][bits 0 to 7]; [4][bits 0 to 7]; [5][bits 0 to 7]; [6][bits 0 to 7]; [7][bits 0 to 7]; [8][bits 0 to 7]; [9][bits 0 to 7]} FROM p; i (and SELF) [from] call to main18 at tests/value/assigns_from.i:253 (by main): NO EFFECTS [from] entry point: u FROM v k FROM \nothing a{[0..1]; [9]} FROM \nothing (and SELF) [2..8] FROM \nothing constante FROM \nothing t[1..38] FROM \nothing (and SELF) t17{[0][bits 0 to 7]; [1][bits 0 to 7]; [2][bits 0 to 7]; [3][bits 0 to 7]; [4][bits 0 to 7]; [5][bits 0 to 7]; [6][bits 0 to 7]; [7][bits 0 to 7]; [8][bits 0 to 7]; [9][bits 0 to 7]} FROM \nothing (and SELF) [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function f: k [inout] Inputs for function f: u [inout] Out (internal) for function main1: u; k [inout] Inputs for function main1: u; v [inout] Out (internal) for function main10: t10[0..49]; i; tmp [inout] Inputs for function main10: \nothing [inout] Out (internal) for function main11: a[2] [inout] Inputs for function main11: \nothing [inout] Out (internal) for function main12: __retres [inout] Inputs for function main12: \nothing [inout] Out (internal) for function main13: \nothing [inout] Inputs for function main13: p_t [inout] Out (internal) for function main14: t[2..38]; i [inout] Inputs for function main14: \nothing [inout] Out (internal) for function main15: a[3..5] [inout] Inputs for function main15: \nothing [inout] Out (internal) for function main16: t[1..19]; i [inout] Inputs for function main16: \nothing [inout] Out (internal) for function main17: t17{[0][bits 0 to 7]; [1][bits 0 to 7]; [2][bits 0 to 7]; [3][bits 0 to 7]; [4][bits 0 to 7]; [5][bits 0 to 7]; [6][bits 0 to 7]; [7][bits 0 to 7]; [8][bits 0 to 7]; [9][bits 0 to 7]}; j [inout] Inputs for function main17: \nothing [inout] Out (internal) for function main18: base_a; a_0; base_b; b [inout] Inputs for function main18: \nothing [inout] Out (internal) for function main2: a[3..5] [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main3: a[0..9] [inout] Inputs for function main3: \nothing [inout] Out (internal) for function main4: a[2] [inout] Inputs for function main4: \nothing [inout] Out (internal) for function main5: a[2] [inout] Inputs for function main5: a[4] [inout] Out (internal) for function main6_right: a[3..5] [inout] Inputs for function main6_right: \nothing [inout] Out (internal) for function main6_wrong: a[2..6] [inout] Inputs for function main6_wrong: \nothing [inout] Out (internal) for function main7: a{[2]; [7..8]} [inout] Inputs for function main7: \nothing [inout] Out (internal) for function main8: c_0; d [inout] Inputs for function main8: \nothing [inout] Out (internal) for function main9: \nothing [inout] Inputs for function main9: \nothing [inout] Out (internal) for function main: u; k; a[0..9]; constante; t[1..38]; t17{[0][bits 0 to 7]; [1][bits 0 to 7]; [2][bits 0 to 7]; [3][bits 0 to 7]; [4][bits 0 to 7]; [5][bits 0 to 7]; [6][bits 0 to 7]; [7][bits 0 to 7]; [8][bits 0 to 7]; [9][bits 0 to 7]}; j; a_0; b; c_0; d; p; tmp_2; tmp_3 [inout] Inputs for function main: u; v; a[4]; p_t frama-c-20.0-Calcium/tests/value/oracle/assigns_from_direct.res.oracle0000666000000000000000000001325213571573400022744 0ustar [kernel] Parsing tests/value/assigns_from_direct.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f_valid <- main. Called from tests/value/assigns_from_direct.i:14. [eva] Recording results for f_valid [from] Computing for function f_valid [from] Done for function f_valid [eva] tests/value/assigns_from_direct.i:21: function f_valid: assigns got status valid. [eva] tests/value/assigns_from_direct.i:21: function f_valid: \from ... part in assign clause got status valid. [eva] Done for function f_valid [eva] computing for function f_invalid_direct <- main. Called from tests/value/assigns_from_direct.i:15. [eva] Recording results for f_invalid_direct [from] Computing for function f_invalid_direct [from] Done for function f_invalid_direct [eva] tests/value/assigns_from_direct.i:30: function f_invalid_direct: assigns got status valid. [eva:alarm] tests/value/assigns_from_direct.i:30: Warning: function f_invalid_direct: \from ... part in assign clause got status unknown (cannot validate direct dependencies). [eva] Done for function f_invalid_direct [eva] computing for function f_invalid_address <- main. Called from tests/value/assigns_from_direct.i:16. [eva] Recording results for f_invalid_address [from] Computing for function f_invalid_address [from] Done for function f_invalid_address [eva] tests/value/assigns_from_direct.i:39: function f_invalid_address: assigns got status valid. [eva:alarm] tests/value/assigns_from_direct.i:39: Warning: function f_invalid_address: \from ... part in assign clause got status unknown (cannot validate indirect dependencies). [eva] Done for function f_invalid_address [eva] computing for function f_invalid_condition <- main. Called from tests/value/assigns_from_direct.i:17. [eva] Recording results for f_invalid_condition [from] Computing for function f_invalid_condition [from] Done for function f_invalid_condition [eva] tests/value/assigns_from_direct.i:48: function f_invalid_condition: assigns got status valid. [eva:alarm] tests/value/assigns_from_direct.i:48: Warning: function f_invalid_condition: \from ... part in assign clause got status unknown (cannot validate indirect dependencies). [eva] Done for function f_invalid_condition [eva] computing for function f_invalid_all <- main. Called from tests/value/assigns_from_direct.i:18. [eva] Recording results for f_invalid_all [from] Computing for function f_invalid_all [from] Done for function f_invalid_all [eva] tests/value/assigns_from_direct.i:57: function f_invalid_all: assigns got status valid. [eva:alarm] tests/value/assigns_from_direct.i:57: Warning: function f_invalid_all: \from ... part in assign clause got status unknown (cannot validate direct and indirect dependencies). [eva] Done for function f_invalid_all [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f_invalid_address: y ∈ {3} [eva:final-states] Values at end of function f_invalid_all: y ∈ {3} [eva:final-states] Values at end of function f_invalid_condition: y ∈ {3} [eva:final-states] Values at end of function f_invalid_direct: y ∈ {3} [eva:final-states] Values at end of function f_valid: y ∈ {3} [eva:final-states] Values at end of function main: x ∈ {3} y ∈ {3} [from] Computing for function f_invalid_address [from] Done for function f_invalid_address [from] Computing for function f_invalid_all [from] Done for function f_invalid_all [from] Computing for function f_invalid_condition [from] Done for function f_invalid_condition [from] Computing for function f_invalid_direct [from] Done for function f_invalid_direct [from] Computing for function f_valid [from] Done for function f_valid [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f_invalid_address: y FROM a; b; c [from] Function f_invalid_all: y FROM a; b; c [from] Function f_invalid_condition: y FROM a; b; c [from] Function f_invalid_direct: y FROM a; b; c [from] Function f_valid: y FROM a; b; c [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f_valid at tests/value/assigns_from_direct.i:14 (by main): y FROM a; b; c [from] call to f_invalid_direct at tests/value/assigns_from_direct.i:15 (by main): y FROM a; b; c [from] call to f_invalid_address at tests/value/assigns_from_direct.i:16 (by main): y FROM a; b; c [from] call to f_invalid_condition at tests/value/assigns_from_direct.i:17 (by main): y FROM a; b; c [from] call to f_invalid_all at tests/value/assigns_from_direct.i:18 (by main): y FROM a; b; c [from] entry point: NO EFFECTS [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function f_invalid_address: y [inout] Inputs for function f_invalid_address: \nothing [inout] Out (internal) for function f_invalid_all: y [inout] Inputs for function f_invalid_all: \nothing [inout] Out (internal) for function f_invalid_condition: y [inout] Inputs for function f_invalid_condition: \nothing [inout] Out (internal) for function f_invalid_direct: y [inout] Inputs for function f_invalid_direct: \nothing [inout] Out (internal) for function f_valid: y [inout] Inputs for function f_valid: \nothing [inout] Out (internal) for function main: x; y [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/attribute-aligned.res.oracle0000666000000000000000000000776413571573400022337 0ustar [kernel] Parsing tests/value/attribute-aligned.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ {0} A ∈ {0} B ∈ {0} [eva] computing for function ct <- main. Called from tests/value/attribute-aligned.c:97. [eva] Recording results for ct [eva] Done for function ct [eva] computing for function dt <- main. Called from tests/value/attribute-aligned.c:98. [eva] Recording results for dt [eva] Done for function dt [eva] computing for function pt <- main. Called from tests/value/attribute-aligned.c:99. [eva] Recording results for pt [eva] Done for function pt [eva] computing for function qt <- main. Called from tests/value/attribute-aligned.c:100. [eva] Recording results for qt [eva] Done for function qt [eva] computing for function rt <- main. Called from tests/value/attribute-aligned.c:101. [eva] Recording results for rt [eva] Done for function rt [eva] computing for function st <- main. Called from tests/value/attribute-aligned.c:102. [eva] Recording results for st [eva] Done for function st [eva] computing for function tt <- main. Called from tests/value/attribute-aligned.c:103. [eva] Recording results for tt [eva] Done for function tt [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function ct: S ∈ {1} A ∈ {0} [eva:final-states] Values at end of function dt: S ∈ {4} A ∈ {0} [eva:final-states] Values at end of function pt: S ∈ {4} A ∈ {0} [eva:final-states] Values at end of function qt: S ∈ {4} A ∈ {0} B ∈ {1} [eva:final-states] Values at end of function rt: S ∈ {8} A ∈ {0} B ∈ {4} [eva:final-states] Values at end of function st: S ∈ {8} A ∈ {0} B ∈ {4} [eva:final-states] Values at end of function tt: S ∈ {4} A ∈ {0} B ∈ {4} [eva:final-states] Values at end of function main: S ∈ {4} A ∈ {0} B ∈ {4} __retres ∈ {0} [from] Computing for function ct [from] Done for function ct [from] Computing for function dt [from] Done for function dt [from] Computing for function pt [from] Done for function pt [from] Computing for function qt [from] Done for function qt [from] Computing for function rt [from] Done for function rt [from] Computing for function st [from] Done for function st [from] Computing for function tt [from] Done for function tt [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function ct: S FROM \nothing A FROM \nothing [from] Function dt: S FROM \nothing A FROM \nothing [from] Function pt: S FROM \nothing A FROM \nothing [from] Function qt: S FROM \nothing A FROM \nothing B FROM \nothing [from] Function rt: S FROM \nothing A FROM \nothing B FROM \nothing [from] Function st: S FROM \nothing A FROM \nothing B FROM \nothing [from] Function tt: S FROM \nothing A FROM \nothing B FROM \nothing [from] Function main: S FROM \nothing A FROM \nothing B FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function ct: S; A [inout] Inputs for function ct: \nothing [inout] Out (internal) for function dt: S; A [inout] Inputs for function dt: \nothing [inout] Out (internal) for function pt: S; A [inout] Inputs for function pt: \nothing [inout] Out (internal) for function qt: S; A; B [inout] Inputs for function qt: \nothing [inout] Out (internal) for function rt: S; A; B [inout] Inputs for function rt: \nothing [inout] Out (internal) for function st: S; A; B [inout] Inputs for function st: \nothing [inout] Out (internal) for function tt: S; A; B [inout] Inputs for function tt: \nothing [inout] Out (internal) for function main: S; A; B; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/auto_loop_unroll.0.res.oracle0000666000000000000000000003267113571573400022460 0ustar [kernel] Parsing tests/value/auto_loop_unroll.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization undet ∈ [--..--] g ∈ {0} [eva] computing for function simple_loops <- main. Called from tests/value/auto_loop_unroll.c:189. [eva] tests/value/auto_loop_unroll.c:24: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:25: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:27: Frama_C_show_each_auto: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:30: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:31: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:33: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:38: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:39: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:41: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:46: Trace partitioning superposing up to 100 states [eva] tests/value/auto_loop_unroll.c:49: Frama_C_show_each_singleton: {100} [eva] Recording results for simple_loops [eva] Done for function simple_loops [eva] computing for function various_loops <- main. Called from tests/value/auto_loop_unroll.c:190. [eva] tests/value/auto_loop_unroll.c:57: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:58: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:59: Frama_C_show_each_64: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:62: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:63: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:64: Frama_C_show_each_40: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:67: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:69: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:72: Frama_C_show_each_80: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:75: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:76: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:82: Frama_C_show_each_32_80: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:85: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:86: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:90: Frama_C_show_each_11_111: [0..2147483647] [eva] computing for function Frama_C_interval <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:94. [eva] using specification for function Frama_C_interval [eva] tests/value/auto_loop_unroll.c:94: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/auto_loop_unroll.c:95: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:96: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:97: Frama_C_show_each_40_50: [0..2147483647] [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] tests/value/auto_loop_unroll.c:100: starting to merge loop iterations [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:103. [eva] Recording results for incr [eva] Done for function incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] tests/value/auto_loop_unroll.c:102: Reusing old results for call to incr [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:103. [eva] Recording results for incr [eva] Done for function incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva:alarm] tests/value/auto_loop_unroll.c:14: Warning: signed overflow. assert g + 1 ≤ 2147483647; [eva] Recording results for incr_g [eva] Done for function incr_g [eva] tests/value/auto_loop_unroll.c:102: Reusing old results for call to incr [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:103. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:101: Reusing old results for call to incr_g [eva] tests/value/auto_loop_unroll.c:102: Reusing old results for call to incr [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:103. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:101: Reusing old results for call to incr_g [eva] tests/value/auto_loop_unroll.c:102: Reusing old results for call to incr [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:103. [eva:alarm] tests/value/auto_loop_unroll.c:18: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:105: Frama_C_show_each_25: [0..2147483647] [eva:loop-unroll] tests/value/auto_loop_unroll.c:110: Automatic loop unrolling. [eva] tests/value/auto_loop_unroll.c:109: starting to merge loop iterations [eva] tests/value/auto_loop_unroll.c:110: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:111: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:114: Frama_C_show_each_120: [0..2147483647] [eva] Recording results for various_loops [eva] Done for function various_loops [eva] computing for function complex_loops <- main. Called from tests/value/auto_loop_unroll.c:191. [eva] tests/value/auto_loop_unroll.c:124: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:126: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:128: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:132: starting to merge loop iterations [eva] tests/value/auto_loop_unroll.c:133: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:134: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva:alarm] tests/value/auto_loop_unroll.c:137: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva:alarm] tests/value/auto_loop_unroll.c:136: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:139: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:143: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:146: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:148: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:151: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:156: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:158: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:163: Reusing old results for call to incr_g [eva] tests/value/auto_loop_unroll.c:162: starting to merge loop iterations [eva] computing for function incr_g <- complex_loops <- main. Called from tests/value/auto_loop_unroll.c:163. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr_g <- complex_loops <- main. Called from tests/value/auto_loop_unroll.c:163. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr_g <- complex_loops <- main. Called from tests/value/auto_loop_unroll.c:163. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] tests/value/auto_loop_unroll.c:163: Reusing old results for call to incr_g [eva] tests/value/auto_loop_unroll.c:163: Reusing old results for call to incr_g [eva:alarm] tests/value/auto_loop_unroll.c:165: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:167: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:172: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:174: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:176: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:180: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:182: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:184: Frama_C_show_each_imprecise: [0..2147483647] [eva] Recording results for complex_loops [eva] Done for function complex_loops [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function incr: __retres ∈ [1..2147483647] [eva:final-states] Values at end of function incr_g: g ∈ [1..2147483647] [eva:final-states] Values at end of function complex_loops: g ∈ {64} res ∈ [0..2147483647] i ∈ [0..64] p ∈ {{ &i }} t[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [eva:final-states] Values at end of function simple_loops: res ∈ {100} [eva:final-states] Values at end of function various_loops: Frama_C_entropy_source ∈ [--..--] g ∈ [0..2147483647] res ∈ {0} x ∈ {24} k ∈ [0..10] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] g ∈ {64} [from] Computing for function incr [from] Done for function incr [from] Computing for function incr_g [from] Done for function incr_g [from] Computing for function complex_loops [from] Done for function complex_loops [from] Computing for function simple_loops [from] Done for function simple_loops [from] Computing for function various_loops [from] Computing for function Frama_C_interval <-various_loops [from] Done for function Frama_C_interval [from] Done for function various_loops [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function incr: \result FROM i [from] Function incr_g: g FROM g [from] Function complex_loops: g FROM \nothing [from] Function simple_loops: NO EFFECTS [from] Function various_loops: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) g FROM g (and SELF) [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) g FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function incr: __retres [inout] Inputs for function incr: \nothing [inout] Out (internal) for function incr_g: g [inout] Inputs for function incr_g: g [inout] Out (internal) for function complex_loops: g; res; i; p; j; t[0..9] [inout] Inputs for function complex_loops: undet; g [inout] Out (internal) for function simple_loops: res; i; i_0; i_1; i_2 [inout] Inputs for function simple_loops: \nothing [inout] Out (internal) for function various_loops: Frama_C_entropy_source; g; res; i; i_0; i_1; i_2; i_3; x; k; i_4; i_5; t; i_6; j [inout] Inputs for function various_loops: Frama_C_entropy_source; undet; g [inout] Out (internal) for function main: Frama_C_entropy_source; g [inout] Inputs for function main: Frama_C_entropy_source; undet; g frama-c-20.0-Calcium/tests/value/oracle/auto_loop_unroll.1.res.oracle0000666000000000000000000004705413571573400022462 0ustar [kernel] Parsing tests/value/auto_loop_unroll.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization undet ∈ [--..--] g ∈ {0} [eva] computing for function simple_loops <- main. Called from tests/value/auto_loop_unroll.c:189. [eva:loop-unroll] tests/value/auto_loop_unroll.c:24: Automatic loop unrolling. [eva] tests/value/auto_loop_unroll.c:24: Trace partitioning superposing up to 100 states [eva] tests/value/auto_loop_unroll.c:27: Frama_C_show_each_auto: {100} [eva] tests/value/auto_loop_unroll.c:30: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:31: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:33: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:38: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:39: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:41: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:49: Frama_C_show_each_singleton: {100} [eva] Recording results for simple_loops [eva] Done for function simple_loops [eva] computing for function various_loops <- main. Called from tests/value/auto_loop_unroll.c:190. [eva:loop-unroll] tests/value/auto_loop_unroll.c:57: Automatic loop unrolling. [eva] tests/value/auto_loop_unroll.c:59: Frama_C_show_each_64: {64} [eva:loop-unroll] tests/value/auto_loop_unroll.c:62: Automatic loop unrolling. [eva] tests/value/auto_loop_unroll.c:64: Frama_C_show_each_40: {40} [eva:loop-unroll] tests/value/auto_loop_unroll.c:67: Automatic loop unrolling. [eva] tests/value/auto_loop_unroll.c:72: Frama_C_show_each_80: {80} [eva:loop-unroll] tests/value/auto_loop_unroll.c:75: Automatic loop unrolling. [eva] tests/value/auto_loop_unroll.c:75: Trace partitioning superposing up to 100 states [eva] tests/value/auto_loop_unroll.c:82: Frama_C_show_each_32_80: [32..80] [eva:loop-unroll] tests/value/auto_loop_unroll.c:85: Automatic loop unrolling. [eva] tests/value/auto_loop_unroll.c:90: Frama_C_show_each_11_111: [11..111] [eva] computing for function Frama_C_interval <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:94. [eva] using specification for function Frama_C_interval [eva] tests/value/auto_loop_unroll.c:94: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:loop-unroll] tests/value/auto_loop_unroll.c:95: Automatic loop unrolling. [eva] tests/value/auto_loop_unroll.c:97: Frama_C_show_each_40_50: [40..50] [eva:loop-unroll] tests/value/auto_loop_unroll.c:100: Automatic loop unrolling. [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] computing for function incr_g <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:101. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr <- various_loops <- main. Called from tests/value/auto_loop_unroll.c:102. [eva] Recording results for incr [eva] Done for function incr [eva] tests/value/auto_loop_unroll.c:103: Reusing old results for call to incr [eva] tests/value/auto_loop_unroll.c:105: Frama_C_show_each_25: {25} [eva:loop-unroll] tests/value/auto_loop_unroll.c:109: Automatic loop unrolling. [eva:loop-unroll] tests/value/auto_loop_unroll.c:110: Automatic loop unrolling. [eva] tests/value/auto_loop_unroll.c:114: Frama_C_show_each_120: {120} [eva] Recording results for various_loops [eva] Done for function various_loops [eva] computing for function complex_loops <- main. Called from tests/value/auto_loop_unroll.c:191. [eva] tests/value/auto_loop_unroll.c:124: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:126: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:128: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:132: starting to merge loop iterations [eva] tests/value/auto_loop_unroll.c:133: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:134: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva:alarm] tests/value/auto_loop_unroll.c:137: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva:alarm] tests/value/auto_loop_unroll.c:136: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:139: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:143: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:146: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:148: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:151: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:156: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:158: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:163: Reusing old results for call to incr_g [eva] tests/value/auto_loop_unroll.c:162: starting to merge loop iterations [eva] computing for function incr_g <- complex_loops <- main. Called from tests/value/auto_loop_unroll.c:163. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr_g <- complex_loops <- main. Called from tests/value/auto_loop_unroll.c:163. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] computing for function incr_g <- complex_loops <- main. Called from tests/value/auto_loop_unroll.c:163. [eva] Recording results for incr_g [eva] Done for function incr_g [eva] tests/value/auto_loop_unroll.c:163: Reusing old results for call to incr_g [eva] tests/value/auto_loop_unroll.c:163: Reusing old results for call to incr_g [eva:alarm] tests/value/auto_loop_unroll.c:165: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:167: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:172: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:174: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:176: Frama_C_show_each_imprecise: [0..2147483647] [eva] tests/value/auto_loop_unroll.c:180: starting to merge loop iterations [eva:alarm] tests/value/auto_loop_unroll.c:182: Warning: signed overflow. assert res + 1 ≤ 2147483647; [eva] tests/value/auto_loop_unroll.c:184: Frama_C_show_each_imprecise: [0..2147483647] [eva] Recording results for complex_loops [eva] Done for function complex_loops [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function incr: __retres ∈ [1..25] [eva:final-states] Values at end of function incr_g: g ∈ [1..63] [eva:final-states] Values at end of function complex_loops: g ∈ {64} res ∈ [0..2147483647] i ∈ [0..64] p ∈ {{ &i }} t[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [eva:final-states] Values at end of function simple_loops: res ∈ {100} [eva:final-states] Values at end of function various_loops: Frama_C_entropy_source ∈ [--..--] g ∈ {25} res ∈ {0} x ∈ {24} k ∈ [0..10] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] g ∈ {64} [from] Computing for function incr [from] Done for function incr [from] Computing for function incr_g [from] Done for function incr_g [from] Computing for function complex_loops [from] Done for function complex_loops [from] Computing for function simple_loops [from] Done for function simple_loops [from] Computing for function various_loops [from] Computing for function Frama_C_interval <-various_loops [from] Done for function Frama_C_interval [from] Done for function various_loops [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function incr: \result FROM i [from] Function incr_g: g FROM g [from] Function complex_loops: g FROM \nothing [from] Function simple_loops: NO EFFECTS [from] Function various_loops: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) g FROM g (and SELF) [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) g FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function incr: __retres [inout] Inputs for function incr: \nothing [inout] Out (internal) for function incr_g: g [inout] Inputs for function incr_g: g [inout] Out (internal) for function complex_loops: g; res; i; p; j; t[0..9] [inout] Inputs for function complex_loops: undet; g [inout] Out (internal) for function simple_loops: res; i; i_0; i_1; i_2 [inout] Inputs for function simple_loops: \nothing [inout] Out (internal) for function various_loops: Frama_C_entropy_source; g; res; i; i_0; i_1; i_2; i_3; x; k; i_4; i_5; t; i_6; j [inout] Inputs for function various_loops: Frama_C_entropy_source; undet; g [inout] Out (internal) for function main: Frama_C_entropy_source; g [inout] Inputs for function main: Frama_C_entropy_source; undet; g frama-c-20.0-Calcium/tests/value/oracle/automalloc.res.oracle0000666000000000000000000000375613571573400021070 0ustar [kernel] Parsing tests/value/automalloc.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function malloc <- main. Called from tests/value/automalloc.i:14. [kernel:annot:missing-spec] tests/value/automalloc.i:14: Warning: Neither code nor specification for function malloc, generating default assigns from the prototype [eva] using specification for function malloc [eva] Done for function malloc [eva] computing for function realloc <- main. Called from tests/value/automalloc.i:15. [kernel:annot:missing-spec] tests/value/automalloc.i:15: Warning: Neither code nor specification for function realloc, generating default assigns from the prototype [eva] using specification for function realloc [eva] Done for function realloc [eva:alarm] tests/value/automalloc.i:17: Warning: out of bounds write. assert \valid(buf + 1); [kernel] tests/value/automalloc.i:17: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/automalloc.i:17: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: test ∈ {0} buf ∈ [--..--] [from] Computing for function main [from] Computing for function malloc <-main [from] Done for function malloc [from] Computing for function realloc <-main [from] Done for function realloc [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function malloc: \result FROM s [from] Function realloc: test FROM s; test (and SELF) \result FROM s; test [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: test; buf [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/backward_add_ptr.res.oracle0000666000000000000000000003416713571573400022203 0ustar [kernel] Parsing tests/value/backward_add_ptr.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/backward_add_ptr.c:185. [eva:alarm] tests/value/backward_add_ptr.c:25: Warning: out of bounds read. assert \valid_read(p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:26: Frama_C_show_each_only_a: {0; 1}, {{ &a }}, {0} [eva:alarm] tests/value/backward_add_ptr.c:32: Warning: out of bounds read. assert \valid_read((char *)p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:33: Frama_C_show_each_reduced_offset: {0; 1}, {{ NULL + {0; 1; 2; 3} ; &a }}, {{ NULL + {0; 1; 2; 3} ; &b }} [eva:alarm] tests/value/backward_add_ptr.c:38: Warning: out of bounds read. assert \valid_read(p + (unsigned int)((unsigned int)q / 4)); [eva] tests/value/backward_add_ptr.c:39: Frama_C_show_each_no_reduction: {0; 1}, {{ NULL + [0..4294967295] ; &a }}, {{ NULL + [0..4294967295] ; &b }} [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/backward_add_ptr.c:186. [eva:alarm] tests/value/backward_add_ptr.c:54: Warning: out of bounds read. assert \valid_read((int *)((char *)p + (unsigned int)q)); [eva] tests/value/backward_add_ptr.c:55: Frama_C_show_each_int_if: {{ &a }}, {0} [eva] tests/value/backward_add_ptr.c:57: Frama_C_show_each_int_else: {0}, {{ &b }} [eva:alarm] tests/value/backward_add_ptr.c:60: Warning: out of bounds read. assert \valid_read((char *)p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:61: Frama_C_show_each_char_if: {{ NULL + {1; 2; 3} ; &a }}, {{ NULL + {0; 1; 2; 3} ; &b }} [eva] tests/value/backward_add_ptr.c:63: Frama_C_show_each_char_else: {0}, {{ &b }} [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/backward_add_ptr.c:187. [eva] computing for function gm <- main3 <- main. Called from tests/value/backward_add_ptr.c:75. [eva] tests/value/backward_add_ptr.c:68: Assigning imprecise value to __retres. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva] tests/value/backward_add_ptr.c:68: Assigning imprecise value to \result. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva] Recording results for gm [eva] Done for function gm [eva] tests/value/backward_add_ptr.c:75: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva:alarm] tests/value/backward_add_ptr.c:81: Warning: out of bounds read. assert \valid_read(p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:82: Frama_C_show_each_GM_only_a: {{ &a + [-17179869180..0],0%4 }}, [0..4294967295] [eva:alarm] tests/value/backward_add_ptr.c:87: Warning: out of bounds read. assert \valid_read((char *)p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:88: Frama_C_show_each_GM_reduce_p_offset: {{ NULL + {0; 1; 2; 3} ; &a + [-4294967295..3] }}, {{ NULL + [0..4294967295] ; &b }} [eva] tests/value/backward_add_ptr.c:91: Reusing old results for call to gm [eva] tests/value/backward_add_ptr.c:91: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva:alarm] tests/value/backward_add_ptr.c:96: Warning: out of bounds read. assert \valid_read(p + (unsigned int)q); [eva] computing for function gm <- main3 <- main. Called from tests/value/backward_add_ptr.c:100. [eva] Recording results for gm [eva] Done for function gm [eva] tests/value/backward_add_ptr.c:100: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva:alarm] tests/value/backward_add_ptr.c:106: Warning: out of bounds read. assert \valid_read(p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:107: Frama_C_show_each_GM_no_reduction: {{ garbled mix of &{a; b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, {{ NULL + [0..4294967295] ; &b }} [eva] tests/value/backward_add_ptr.c:110: Reusing old results for call to gm [eva] tests/value/backward_add_ptr.c:110: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva:alarm] tests/value/backward_add_ptr.c:115: Warning: out of bounds read. assert \valid_read((char *)p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:116: Frama_C_show_each_GM_only_c: {0}, {{ &c }} [eva:alarm] tests/value/backward_add_ptr.c:121: Warning: out of bounds read. assert \valid_read(p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:122: Frama_C_show_each_GM_only_b: {{ &b + [-17179869180..0],0%4 }}, [0..4294967295] [eva] tests/value/backward_add_ptr.c:125: Reusing old results for call to gm [eva] tests/value/backward_add_ptr.c:125: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva:alarm] tests/value/backward_add_ptr.c:130: Warning: out of bounds read. assert \valid_read((char *)p + (unsigned int)q); [eva:alarm] tests/value/backward_add_ptr.c:136: Warning: out of bounds read. assert \valid_read((char *)p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:137: Frama_C_show_each_GM_only_b_and_gm: {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, {{ NULL + [0..4294967295] ; &b }} [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/backward_add_ptr.c:188. [eva] computing for function gm <- main4 <- main. Called from tests/value/backward_add_ptr.c:145. [eva] Recording results for gm [eva] Done for function gm [eva] tests/value/backward_add_ptr.c:145: Assigning imprecise value to tmp_0. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva] tests/value/backward_add_ptr.c:145: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva] computing for function gm <- main4 <- main. Called from tests/value/backward_add_ptr.c:146. [eva] Recording results for gm [eva] Done for function gm [eva] tests/value/backward_add_ptr.c:146: Assigning imprecise value to q. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva:alarm] tests/value/backward_add_ptr.c:150: Warning: out of bounds read. assert \valid_read(p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:151: Frama_C_show_each_2GM_no_reduction: {{ garbled mix of &{a; b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, {{ garbled mix of &{c} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} [eva:alarm] tests/value/backward_add_ptr.c:156: Warning: out of bounds read. assert \valid_read((char *)p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:157: Frama_C_show_each_2GM_only_b: {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, [0..4294967295] [eva] tests/value/backward_add_ptr.c:160: Reusing old results for call to gm [eva] tests/value/backward_add_ptr.c:160: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva] computing for function gm <- main4 <- main. Called from tests/value/backward_add_ptr.c:161. [eva] Recording results for gm [eva] Done for function gm [eva] tests/value/backward_add_ptr.c:161: Assigning imprecise value to q. The imprecision originates from Arithmetic {tests/value/backward_add_ptr.c:68} [eva:alarm] tests/value/backward_add_ptr.c:165: Warning: out of bounds read. assert \valid_read((char *)p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:166: Frama_C_show_each_2GM_TEST: {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} [eva:alarm] tests/value/backward_add_ptr.c:171: Warning: out of bounds read. assert \valid_read(p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:172: Frama_C_show_each_2GM_gm_of_a_b: {{ garbled mix of &{a; b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} [eva:alarm] tests/value/backward_add_ptr.c:177: Warning: out of bounds read. assert \valid_read((char *)p + (unsigned int)q); [eva] tests/value/backward_add_ptr.c:178: Frama_C_show_each_2GM_gm_of_b_c: {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }}, {{ garbled mix of &{b; c} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} [eva] Recording results for main4 [eva] Done for function main4 [eva] Recording results for main [eva] done for function main [eva:garbled-mix] Warning: Garbled mix generated during analysis: {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:25}) }} {{ garbled mix of &{a} (origin: Arithmetic {tests/value/backward_add_ptr.c:25}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:32}) }} {{ garbled mix of &{a} (origin: Arithmetic {tests/value/backward_add_ptr.c:32}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:38}) }} {{ garbled mix of &{a} (origin: Arithmetic {tests/value/backward_add_ptr.c:38}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:54}) }} {{ garbled mix of &{a} (origin: Arithmetic {tests/value/backward_add_ptr.c:54}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:60}) }} {{ garbled mix of &{a} (origin: Arithmetic {tests/value/backward_add_ptr.c:60}) }} {{ garbled mix of &{a} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:81}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:87}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:96}) }} {{ garbled mix of &{a; b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:106}) }} {{ garbled mix of &{c} (origin: Arithmetic {tests/value/backward_add_ptr.c:115}) }} {{ garbled mix of &{a; b} (origin: Arithmetic {tests/value/backward_add_ptr.c:115}) }} {{ garbled mix of &{c} (origin: Arithmetic {tests/value/backward_add_ptr.c:121}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:130}) }} {{ garbled mix of &{b} (origin: Arithmetic {tests/value/backward_add_ptr.c:136}) }} {{ garbled mix of &{a; b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} {{ garbled mix of &{c} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} {{ garbled mix of &{b; c} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function gm: __retres ∈ {{ garbled mix of &{a; b; a; b; c} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} [eva:final-states] Values at end of function main1: a ∈ {0} b ∈ {1} p ∈ {{ NULL + [0..4294967295] ; &a }} q ∈ {{ NULL + [0..4294967295] ; &b }} v ∈ {0; 1} or UNINITIALIZED w ∈ {0; 1} or UNINITIALIZED [eva:final-states] Values at end of function main2: a ∈ {0} b[bits 0 to 7] ∈ {1} [bits 8 to 31]# ∈ {1}%32, bits 8 to 31 p ∈ {{ NULL + [0..4294967295] ; &a }} q ∈ {{ NULL + [0..4294967295] ; &b }} [eva:final-states] Values at end of function main3: a ∈ {0} b[bits 0 to 7] ∈ {1} [bits 8 to 31]# ∈ {1}%32, bits 8 to 31 c[bits 0 to 7] ∈ {2} [bits 8 to 31]# ∈ {2}%32, bits 8 to 31 p ∈ {{ garbled mix of &{a; b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} q ∈ {{ NULL + [--..--] ; &b }} v ∈ {0; 1} or UNINITIALIZED w ∈ {0; 1} or UNINITIALIZED [eva:final-states] Values at end of function main4: a ∈ {0} b[bits 0 to 7] ∈ {1} [bits 8 to 31]# ∈ {1}%32, bits 8 to 31 c[bits 0 to 7] ∈ {2} [bits 8 to 31]# ∈ {2}%32, bits 8 to 31 p ∈ {{ garbled mix of &{a; b} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} q ∈ {{ garbled mix of &{b; c} (origin: Arithmetic {tests/value/backward_add_ptr.c:68}) }} v ∈ {0; 1; 2} or UNINITIALIZED [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function gm [from] Done for function gm [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function gm: \result FROM p [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function main3: NO EFFECTS [from] Function main4: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function gm: __retres [inout] Inputs for function gm: \nothing [inout] Out (internal) for function main1: a; b; p; tmp; q; tmp_0; v; w [inout] Inputs for function main1: rand [inout] Out (internal) for function main2: a; b; p; tmp; q; tmp_0 [inout] Inputs for function main2: rand [inout] Out (internal) for function main3: a; b; c; p; q; tmp_0; v; w; tmp_1; tmp_2; tmp_3 [inout] Inputs for function main3: rand [inout] Out (internal) for function main4: a; b; c; p; tmp; tmp_0; q; v; tmp_2; tmp_3 [inout] Inputs for function main4: rand [inout] Out (internal) for function main: __retres [inout] Inputs for function main: rand frama-c-20.0-Calcium/tests/value/oracle/backward_arith.res.oracle0000666000000000000000000000401413571573400021661 0ustar [kernel] Parsing tests/value/backward_arith.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function unsigned_neg <- main. Called from tests/value/backward_arith.i:31. [eva] tests/value/backward_arith.i:12: Frama_C_show_each_ten: {10} [eva] tests/value/backward_arith.i:14: Frama_C_show_each_not_ten: [0..4294967295] [eva] tests/value/backward_arith.i:16: Frama_C_show_each_greater_than_ten_or_zero: [0..4294967295] [eva] tests/value/backward_arith.i:18: Frama_C_show_each_smaller_than_ten_but_zero: [1..10] [eva] tests/value/backward_arith.i:20: Frama_C_show_each_minus_ten: {4294967286} [eva] tests/value/backward_arith.i:22: Frama_C_show_each_not_minus_ten: [0..4294967295] [eva] tests/value/backward_arith.i:24: Frama_C_show_each_greater_than_minus_ten_or_zero: [0..4294967295] [eva] tests/value/backward_arith.i:26: Frama_C_show_each_smaller_than_minus_ten_but_zero: [1..4294967286] [eva] Recording results for unsigned_neg [eva] Done for function unsigned_neg [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function unsigned_neg: x ∈ [--..--] minus_ten ∈ {4294967286} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function unsigned_neg [from] Done for function unsigned_neg [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function unsigned_neg: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function unsigned_neg: x; minus_ten [inout] Inputs for function unsigned_neg: nondet [inout] Out (internal) for function main: __retres [inout] Inputs for function main: nondet frama-c-20.0-Calcium/tests/value/oracle/bad_loop.res.oracle0000666000000000000000000000154413571573400020500 0ustar [kernel] Parsing tests/value/bad_loop.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] [eva] tests/value/bad_loop.i:6: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {0; 1; 2} d ∈ [--..--] e ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; d; e [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/value/oracle/base_addr_offset_block_length.res.oracle0000666000000000000000000000462713571573400024713 0ustar [kernel] Parsing tests/value/base_addr_offset_block_length.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} [eva:alarm] tests/value/base_addr_offset_block_length.i:9: Warning: function main: precondition got status unknown. [eva] tests/value/base_addr_offset_block_length.i:17: assertion got status valid. [eva] tests/value/base_addr_offset_block_length.i:18: assertion got status valid. [eva] tests/value/base_addr_offset_block_length.i:19: assertion got status valid. [eva:alarm] tests/value/base_addr_offset_block_length.i:20: Warning: assertion got status unknown. [eva] tests/value/base_addr_offset_block_length.i:21: assertion got status valid. [eva] tests/value/base_addr_offset_block_length.i:22: assertion got status valid. [eva:alarm] tests/value/base_addr_offset_block_length.i:23: Warning: assertion got status unknown. [eva] tests/value/base_addr_offset_block_length.i:24: assertion got status valid. [eva] tests/value/base_addr_offset_block_length.i:25: assertion got status valid. [eva] tests/value/base_addr_offset_block_length.i:26: assertion got status valid. [eva] tests/value/base_addr_offset_block_length.i:27: assertion got status valid. [eva] tests/value/base_addr_offset_block_length.i:28: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: px ∈ {{ &x + {4} }} px2 ∈ {{ &x + {12} }} py ∈ {{ &y + {8} }} pz ∈ {{ &z + {4} }} p ∈ {{ &x + {4} ; &y }} q ∈ {{ &x + {8} ; &y + {4} }} [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} [eva] tests/value/base_addr_offset_block_length.i:20: assertion got status valid. [eva] tests/value/base_addr_offset_block_length.i:23: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: px ∈ {{ &x + {4} }} px2 ∈ {{ &x + {12} }} py ∈ {{ &y + {8} }} pz ∈ {{ &z + {4} }} p ∈ {{ &x + {4} ; &y }} q ∈ {{ &x + {8} ; &y + {4} }} frama-c-20.0-Calcium/tests/value/oracle/behavior_statuses.0.res.oracle0000666000000000000000000000654613571573400022620 0ustar [kernel] Parsing tests/value/behavior_statuses.i (no preprocessing) [kernel:prop-status:emit] Frama-C kernel emits status unknown for property default behavior under 2 hypothesis [kernel:prop-status:emit] Frama-C kernel emits status unknown for property behavior t_null under 0 hypothesis [kernel:prop-status:emit] Frama-C kernel emits status unknown for property behavior t_not_null under 0 hypothesis [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function f <- main. Called from tests/value/behavior_statuses.i:26. [kernel:prop-status:emit] Call Preconditions emits status unknown for property requires \valid_read(filename) under 2 hypothesis [eva] tests/value/behavior_statuses.i:26: function f: precondition got status valid. [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(filename)' of f at stmt 4 under 0 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(filename)' of f at stmt 4 under 0 hypothesis [kernel:prop-status:emit] Call Preconditions emits status unknown for property requires \valid_read(t) under 2 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(t)' of f at stmt 4 under 0 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(t)' of f at stmt 4 under 0 hypothesis [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/behavior_statuses.i:27. [eva] tests/value/behavior_statuses.i:27: function f: precondition got status valid. [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(filename)' of f at stmt 5 under 0 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(filename)' of f at stmt 5 under 0 hypothesis [eva] tests/value/behavior_statuses.i:27: function f, behavior t_not_null: precondition got status valid. [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(t)' of f at stmt 5 under 0 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(t)' of f at stmt 5 under 0 hypothesis [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {1} [eva:final-states] Values at end of function main: t.t ∈ {1} r1 ∈ {1} r2 ∈ {1} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: t; r1; r2; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/behavior_statuses.1.res.oracle0000666000000000000000000000642413571573400022614 0ustar [kernel] Parsing tests/value/behavior_statuses.i (no preprocessing) [kernel:prop-status:emit] Frama-C kernel emits status unknown for property default behavior under 2 hypothesis [kernel:prop-status:emit] Frama-C kernel emits status unknown for property behavior t_null under 0 hypothesis [kernel:prop-status:emit] Frama-C kernel emits status unknown for property behavior t_not_null under 0 hypothesis [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function f <- main. Called from tests/value/behavior_statuses.i:26. [eva] using specification for function f [kernel:prop-status:emit] Call Preconditions emits status unknown for property requires \valid_read(filename) under 2 hypothesis [eva] tests/value/behavior_statuses.i:26: function f: precondition got status valid. [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(filename)' of f at stmt 4 under 0 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(filename)' of f at stmt 4 under 0 hypothesis [kernel:prop-status:emit] Call Preconditions emits status unknown for property requires \valid_read(t) under 2 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(t)' of f at stmt 4 under 0 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(t)' of f at stmt 4 under 0 hypothesis [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/behavior_statuses.i:27. [eva] tests/value/behavior_statuses.i:27: function f: precondition got status valid. [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(filename)' of f at stmt 5 under 0 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(filename)' of f at stmt 5 under 0 hypothesis [eva] tests/value/behavior_statuses.i:27: function f, behavior t_not_null: precondition got status valid. [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(t)' of f at stmt 5 under 0 hypothesis [kernel:prop-status:emit] Eva emits status VALID for property status of 'requires \valid_read(t)' of f at stmt 5 under 0 hypothesis [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t.t ∈ {1} r1 ∈ [--..--] r2 ∈ [--..--] __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM nondet [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: nondet [inout] Out (internal) for function main: t; r1; r2; __retres [inout] Inputs for function main: nondet frama-c-20.0-Calcium/tests/value/oracle/behaviors1.res.oracle0000666000000000000000000010643113571573400020765 0ustar [kernel] Parsing tests/value/behaviors1.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] T[0..9] ∈ {0} [eva] computing for function test_none <- main. Called from tests/value/behaviors1.i:638. [eva] computing for function f_none <- test_none <- main. Called from tests/value/behaviors1.i:328. [eva] using specification for function f_none [eva] tests/value/behaviors1.i:328: function f_none, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:328: function f_none, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:328: function f_none, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_none [eva] computing for function f_none <- test_none <- main. Called from tests/value/behaviors1.i:329. [eva] tests/value/behaviors1.i:329: function f_none, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:329: function f_none, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f_none [eva] computing for function f_none <- test_none <- main. Called from tests/value/behaviors1.i:330. [eva] tests/value/behaviors1.i:330: function f_none, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:330: function f_none, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_none [eva] computing for function f_none <- test_none <- main. Called from tests/value/behaviors1.i:331. [eva] Done for function f_none [eva] Recording results for test_none [eva] Done for function test_none [eva] computing for function test_comp_disj <- main. Called from tests/value/behaviors1.i:639. [eva] computing for function f_comp_disj <- test_comp_disj <- main. Called from tests/value/behaviors1.i:342. [eva] using specification for function f_comp_disj [eva] tests/value/behaviors1.i:342: function f_comp_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:342: function f_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:342: function f_comp_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_comp_disj [eva] computing for function f_comp_disj <- test_comp_disj <- main. Called from tests/value/behaviors1.i:350. [eva] tests/value/behaviors1.i:350: function f_comp_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:350: function f_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f_comp_disj [eva] computing for function f_comp_disj <- test_comp_disj <- main. Called from tests/value/behaviors1.i:358. [eva] tests/value/behaviors1.i:358: function f_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:358: function f_comp_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_comp_disj [eva] computing for function f_comp_disj <- test_comp_disj <- main. Called from tests/value/behaviors1.i:366. [eva] Done for function f_comp_disj [eva] Recording results for test_comp_disj [eva] Done for function test_comp_disj [eva] computing for function test_comp <- main. Called from tests/value/behaviors1.i:640. [eva] computing for function f_comp <- test_comp <- main. Called from tests/value/behaviors1.i:388. [eva] using specification for function f_comp [eva] tests/value/behaviors1.i:388: function f_comp, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:388: function f_comp, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:388: function f_comp, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_comp [eva] computing for function f_comp <- test_comp <- main. Called from tests/value/behaviors1.i:389. [eva] tests/value/behaviors1.i:389: function f_comp, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:389: function f_comp, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f_comp [eva] computing for function f_comp <- test_comp <- main. Called from tests/value/behaviors1.i:390. [eva] tests/value/behaviors1.i:390: function f_comp, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:390: function f_comp, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_comp [eva] computing for function f_comp <- test_comp <- main. Called from tests/value/behaviors1.i:391. [eva] Done for function f_comp [eva] Recording results for test_comp [eva] Done for function test_comp [eva] computing for function test_disj <- main. Called from tests/value/behaviors1.i:641. [eva] computing for function f_disj <- test_disj <- main. Called from tests/value/behaviors1.i:377. [eva] using specification for function f_disj [eva] tests/value/behaviors1.i:377: function f_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:377: function f_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:377: function f_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_disj [eva] computing for function f_disj <- test_disj <- main. Called from tests/value/behaviors1.i:378. [eva] tests/value/behaviors1.i:378: function f_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:378: function f_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f_disj [eva] computing for function f_disj <- test_disj <- main. Called from tests/value/behaviors1.i:379. [eva] tests/value/behaviors1.i:379: function f_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:379: function f_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_disj [eva] computing for function f_disj <- test_disj <- main. Called from tests/value/behaviors1.i:380. [eva] Done for function f_disj [eva] Recording results for test_disj [eva] Done for function test_disj [eva] computing for function test_123_comp_disj <- main. Called from tests/value/behaviors1.i:642. [eva] computing for function f_123_comp_disj <- test_123_comp_disj <- main. Called from tests/value/behaviors1.i:399. [eva] using specification for function f_123_comp_disj [eva] tests/value/behaviors1.i:399: function f_123_comp_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:399: function f_123_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:399: function f_123_comp_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_disj [eva] computing for function f_123_comp_disj <- test_123_comp_disj <- main. Called from tests/value/behaviors1.i:400. [eva] tests/value/behaviors1.i:400: function f_123_comp_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:400: function f_123_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_disj [eva] computing for function f_123_comp_disj <- test_123_comp_disj <- main. Called from tests/value/behaviors1.i:401. [eva] tests/value/behaviors1.i:401: function f_123_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:401: function f_123_comp_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_disj [eva] computing for function f_123_comp_disj <- test_123_comp_disj <- main. Called from tests/value/behaviors1.i:402. [eva] Done for function f_123_comp_disj [eva] Recording results for test_123_comp_disj [eva] Done for function test_123_comp_disj [eva] computing for function test_123_comp_disj_2345_disj <- main. Called from tests/value/behaviors1.i:643. [eva] computing for function f_123_comp_disj_2345_disj <- test_123_comp_disj_2345_disj <- main. Called from tests/value/behaviors1.i:410. [eva] using specification for function f_123_comp_disj_2345_disj [eva] tests/value/behaviors1.i:410: function f_123_comp_disj_2345_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:410: function f_123_comp_disj_2345_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:410: function f_123_comp_disj_2345_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_disj_2345_disj [eva] computing for function f_123_comp_disj_2345_disj <- test_123_comp_disj_2345_disj <- main. Called from tests/value/behaviors1.i:411. [eva] tests/value/behaviors1.i:411: function f_123_comp_disj_2345_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:411: function f_123_comp_disj_2345_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_disj_2345_disj [eva] computing for function f_123_comp_disj_2345_disj <- test_123_comp_disj_2345_disj <- main. Called from tests/value/behaviors1.i:412. [eva] tests/value/behaviors1.i:412: function f_123_comp_disj_2345_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:412: function f_123_comp_disj_2345_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_disj_2345_disj [eva] computing for function f_123_comp_disj_2345_disj <- test_123_comp_disj_2345_disj <- main. Called from tests/value/behaviors1.i:413. [eva] Done for function f_123_comp_disj_2345_disj [eva] Recording results for test_123_comp_disj_2345_disj [eva] Done for function test_123_comp_disj_2345_disj [eva] computing for function test_123_comp_disj_2345_comp <- main. Called from tests/value/behaviors1.i:644. [eva] computing for function f_123_comp_disj_2345_comp <- test_123_comp_disj_2345_comp <- main. Called from tests/value/behaviors1.i:421. [eva] using specification for function f_123_comp_disj_2345_comp [eva] tests/value/behaviors1.i:421: function f_123_comp_disj_2345_comp, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:421: function f_123_comp_disj_2345_comp, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:421: function f_123_comp_disj_2345_comp, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_disj_2345_comp [eva] computing for function f_123_comp_disj_2345_comp <- test_123_comp_disj_2345_comp <- main. Called from tests/value/behaviors1.i:422. [eva] tests/value/behaviors1.i:422: function f_123_comp_disj_2345_comp, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:422: function f_123_comp_disj_2345_comp, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_disj_2345_comp [eva] computing for function f_123_comp_disj_2345_comp <- test_123_comp_disj_2345_comp <- main. Called from tests/value/behaviors1.i:423. [eva] tests/value/behaviors1.i:423: function f_123_comp_disj_2345_comp, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:423: function f_123_comp_disj_2345_comp, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_disj_2345_comp [eva] computing for function f_123_comp_disj_2345_comp <- test_123_comp_disj_2345_comp <- main. Called from tests/value/behaviors1.i:424. [eva] Done for function f_123_comp_disj_2345_comp [eva] Recording results for test_123_comp_disj_2345_comp [eva] Done for function test_123_comp_disj_2345_comp [eva] computing for function test_123_disj_2345_comp_disj <- main. Called from tests/value/behaviors1.i:645. [eva] computing for function f_123_disj_2345_comp_disj <- test_123_disj_2345_comp_disj <- main. Called from tests/value/behaviors1.i:432. [eva] using specification for function f_123_disj_2345_comp_disj [eva] tests/value/behaviors1.i:432: function f_123_disj_2345_comp_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:432: function f_123_disj_2345_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:432: function f_123_disj_2345_comp_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_disj_2345_comp_disj [eva] computing for function f_123_disj_2345_comp_disj <- test_123_disj_2345_comp_disj <- main. Called from tests/value/behaviors1.i:433. [eva] tests/value/behaviors1.i:433: function f_123_disj_2345_comp_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:433: function f_123_disj_2345_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_disj_2345_comp_disj [eva] computing for function f_123_disj_2345_comp_disj <- test_123_disj_2345_comp_disj <- main. Called from tests/value/behaviors1.i:434. [eva] tests/value/behaviors1.i:434: function f_123_disj_2345_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:434: function f_123_disj_2345_comp_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_disj_2345_comp_disj [eva] computing for function f_123_disj_2345_comp_disj <- test_123_disj_2345_comp_disj <- main. Called from tests/value/behaviors1.i:435. [eva] Done for function f_123_disj_2345_comp_disj [eva] Recording results for test_123_disj_2345_comp_disj [eva] Done for function test_123_disj_2345_comp_disj [eva] computing for function test_123_comp_2345_comp_disj <- main. Called from tests/value/behaviors1.i:646. [eva] computing for function f_123_comp_2345_comp_disj <- test_123_comp_2345_comp_disj <- main. Called from tests/value/behaviors1.i:443. [eva] using specification for function f_123_comp_2345_comp_disj [eva] tests/value/behaviors1.i:443: function f_123_comp_2345_comp_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:443: function f_123_comp_2345_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:443: function f_123_comp_2345_comp_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_2345_comp_disj [eva] computing for function f_123_comp_2345_comp_disj <- test_123_comp_2345_comp_disj <- main. Called from tests/value/behaviors1.i:444. [eva] tests/value/behaviors1.i:444: function f_123_comp_2345_comp_disj, behavior b2: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:444: function f_123_comp_2345_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_2345_comp_disj [eva] computing for function f_123_comp_2345_comp_disj <- test_123_comp_2345_comp_disj <- main. Called from tests/value/behaviors1.i:445. [eva] tests/value/behaviors1.i:445: function f_123_comp_2345_comp_disj, behavior b3: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors1.i:445: function f_123_comp_2345_comp_disj, behavior b5: assumes got status invalid; behavior not evaluated. [eva] Done for function f_123_comp_2345_comp_disj [eva] computing for function f_123_comp_2345_comp_disj <- test_123_comp_2345_comp_disj <- main. Called from tests/value/behaviors1.i:446. [eva] Done for function f_123_comp_2345_comp_disj [eva] Recording results for test_123_comp_2345_comp_disj [eva] Done for function test_123_comp_2345_comp_disj [eva] computing for function test_assigns <- main. Called from tests/value/behaviors1.i:647. [eva] computing for function f <- test_assigns <- main. Called from tests/value/behaviors1.i:473. [eva] using specification for function f [eva] Done for function f [eva] tests/value/behaviors1.i:473: Assigning imprecise value to tmp. The imprecision originates from Library function {tests/value/behaviors1.i:473} [eva] tests/value/behaviors1.i:473: Assigning imprecise value to p1. The imprecision originates from Library function {tests/value/behaviors1.i:473} [eva] computing for function f <- test_assigns <- main. Called from tests/value/behaviors1.i:474. [eva] Done for function f [eva] tests/value/behaviors1.i:474: Assigning imprecise value to tmp_0. The imprecision originates from Library function {tests/value/behaviors1.i:474} [eva] tests/value/behaviors1.i:474: Assigning imprecise value to p2. The imprecision originates from Library function {tests/value/behaviors1.i:474} [eva] computing for function f <- test_assigns <- main. Called from tests/value/behaviors1.i:475. [eva] Done for function f [eva] Recording results for test_assigns [eva] Done for function test_assigns [eva] computing for function test_assigns2 <- main. Called from tests/value/behaviors1.i:648. [eva] computing for function f2 <- test_assigns2 <- main. Called from tests/value/behaviors1.i:490. [eva] using specification for function f2 [eva] tests/value/behaviors1.i:490: function f2: precondition got status valid. [eva] Done for function f2 [eva] Recording results for test_assigns2 [eva] Done for function test_assigns2 [eva] computing for function test_small1 <- main. Called from tests/value/behaviors1.i:649. [eva] computing for function f3 <- test_small1 <- main. Called from tests/value/behaviors1.i:506. [kernel] tests/value/behaviors1.i:506: Warning: No code nor implicit assigns clause for function f3, generating default assigns from the prototype [eva] using specification for function f3 [eva:alarm] tests/value/behaviors1.i:506: Warning: function f3: precondition got status unknown. [eva:alarm] tests/value/behaviors1.i:506: Warning: function f3, behavior b1: precondition got status invalid. [eva] Done for function f3 [eva] Recording results for test_small1 [eva] Done for function test_small1 [eva] computing for function test_small2 <- main. Called from tests/value/behaviors1.i:650. [eva] computing for function f4 <- test_small2 <- main. Called from tests/value/behaviors1.i:521. [kernel] tests/value/behaviors1.i:521: Warning: No code nor implicit assigns clause for function f4, generating default assigns from the prototype [eva] using specification for function f4 [eva:alarm] tests/value/behaviors1.i:521: Warning: function f4: precondition got status unknown. [eva:alarm] tests/value/behaviors1.i:521: Warning: function f4, behavior b1: precondition x ≡ 0 got status invalid. [eva] tests/value/behaviors1.i:521: function f4, behavior b1: no state left, precondition x ≢ 1 got status valid. [eva] tests/value/behaviors1.i:521: function f4, behavior b1: requires got status invalid; postconditions not evaluated. [eva] Done for function f4 [eva] Recording results for test_small2 [eva] Done for function test_small2 [eva] computing for function test_small3 <- main. Called from tests/value/behaviors1.i:651. [eva] computing for function f5 <- test_small3 <- main. Called from tests/value/behaviors1.i:534. [kernel] tests/value/behaviors1.i:534: Warning: No code nor implicit assigns clause for function f5, generating default assigns from the prototype [eva] using specification for function f5 [eva] Done for function f5 [eva] Recording results for test_small3 [eva] Done for function test_small3 [eva] computing for function test_small4 <- main. Called from tests/value/behaviors1.i:652. [eva] computing for function f6 <- test_small4 <- main. Called from tests/value/behaviors1.i:548. [kernel] tests/value/behaviors1.i:548: Warning: No code nor implicit assigns clause for function f6, generating default assigns from the prototype [eva] using specification for function f6 [eva] Done for function f6 [eva] Recording results for test_small4 [eva] Done for function test_small4 [eva] computing for function test_small5 <- main. Called from tests/value/behaviors1.i:653. [eva] computing for function f7 <- test_small5 <- main. Called from tests/value/behaviors1.i:561. [kernel] tests/value/behaviors1.i:561: Warning: No code nor implicit assigns clause for function f7, generating default assigns from the prototype [eva] using specification for function f7 [eva:alarm] tests/value/behaviors1.i:561: Warning: function f7: precondition got status unknown. [eva] Done for function f7 [eva] Recording results for test_small5 [eva] Done for function test_small5 [eva] computing for function test_small6 <- main. Called from tests/value/behaviors1.i:654. [eva] computing for function f8 <- test_small6 <- main. Called from tests/value/behaviors1.i:576. [eva] using specification for function f8 [eva] tests/value/behaviors1.i:576: function f8: precondition got status valid. [eva] Done for function f8 [eva] Recording results for test_small6 [eva] Done for function test_small6 [eva] computing for function test_small6_bis <- main. Called from tests/value/behaviors1.i:655. [eva] computing for function f8_bis <- test_small6_bis <- main. Called from tests/value/behaviors1.i:591. [eva] using specification for function f8_bis [eva] tests/value/behaviors1.i:591: function f8_bis: precondition got status valid. [eva] Done for function f8_bis [eva] Recording results for test_small6_bis [eva] Done for function test_small6_bis [eva] computing for function test_promote <- main. Called from tests/value/behaviors1.i:656. [eva] computing for function f9 <- test_promote <- main. Called from tests/value/behaviors1.i:609. [eva] using specification for function f9 [eva] tests/value/behaviors1.i:601: cannot evaluate ACSL term, unsupported ACSL construct: logic function length [eva] tests/value/behaviors1.i:609: function f9, behavior b1: assumes got status invalid; behavior not evaluated. [eva] Done for function f9 [eva] Recording results for test_promote [eva] Done for function test_promote [eva] computing for function test_narrow <- main. Called from tests/value/behaviors1.i:657. [eva] computing for function f10 <- test_narrow <- main. Called from tests/value/behaviors1.i:634. [eva] using specification for function f10 [eva] tests/value/behaviors1.i:616: cannot evaluate ACSL term, unsupported ACSL construct: logic function fl [eva] tests/value/behaviors1.i:619: cannot evaluate ACSL term, unsupported ACSL construct: logic function fl [eva] tests/value/behaviors1.i:622: cannot evaluate ACSL term, unsupported ACSL construct: logic function fl [eva] tests/value/behaviors1.i:625: cannot evaluate ACSL term, unsupported ACSL construct: logic function fl [eva] Done for function f10 [eva] Recording results for test_narrow [eva] Done for function test_narrow [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test_123_comp_2345_comp_disj: a ∈ [--..--] b ∈ [--..--] c1 ∈ {4} or UNINITIALIZED c2 ∈ {4; 5} or UNINITIALIZED c3 ∈ {2; 4} or UNINITIALIZED c4 ∈ {2; 3; 4; 5} or UNINITIALIZED [eva:final-states] Values at end of function test_123_comp_disj: a ∈ [--..--] b ∈ [--..--] c1 ∈ {4} or UNINITIALIZED c2 ∈ {4; 5} or UNINITIALIZED c3 ∈ {2; 4; 5} or UNINITIALIZED c4 ∈ {2; 3; 4; 5} or UNINITIALIZED [eva:final-states] Values at end of function test_123_comp_disj_2345_comp: a ∈ [--..--] b ∈ [--..--] c1 ∈ {4} or UNINITIALIZED c2 ∈ {4; 5} or UNINITIALIZED c3 ∈ {2; 4} or UNINITIALIZED c4 ∈ {2; 3; 4; 5} or UNINITIALIZED [eva:final-states] Values at end of function test_123_comp_disj_2345_disj: a ∈ [--..--] b ∈ [--..--] c1 ∈ {4} or UNINITIALIZED c2 ∈ {4; 5} or UNINITIALIZED c3 ∈ {2; 4; 5} or UNINITIALIZED c4 ∈ {2; 3; 4; 5} or UNINITIALIZED [eva:final-states] Values at end of function test_123_disj_2345_comp_disj: a ∈ [--..--] b ∈ [--..--] c1 ∈ {4} or UNINITIALIZED c2 ∈ {4; 5} or UNINITIALIZED c3 ∈ {2; 4} or UNINITIALIZED c4 ∈ {2; 3; 4; 5} or UNINITIALIZED [eva:final-states] Values at end of function test_assigns: p1 ∈ {{ garbled mix of &{a} (origin: Library function {tests/value/behaviors1.i:473}) }} p2 ∈ {{ garbled mix of &{b} (origin: Library function {tests/value/behaviors1.i:474}) }} p3 ∈ [--..--] [eva:final-states] Values at end of function test_assigns2: T[0..4] ∈ [--..--] [5..9] ∈ {0} p ∈ {{ &T[0] }} [eva:final-states] Values at end of function test_comp: a ∈ [--..--] b ∈ [--..--] c1 ∈ {4} or UNINITIALIZED c2 ∈ {4; 5} or UNINITIALIZED c3 ∈ {2; 4} or UNINITIALIZED c4 ∈ {2; 3; 4; 5} or UNINITIALIZED [eva:final-states] Values at end of function test_comp_disj: a ∈ [--..--] b ∈ [--..--] c1 ∈ {4} or UNINITIALIZED c2 ∈ {4; 5} or UNINITIALIZED c3 ∈ {2; 4} or UNINITIALIZED c4 ∈ {2; 3; 4; 5} or UNINITIALIZED [eva:final-states] Values at end of function test_disj: a ∈ [--..--] b ∈ [--..--] c1 ∈ {4} or UNINITIALIZED c2 ∈ {4; 5} or UNINITIALIZED c3 ∈ [1..2147483647] or UNINITIALIZED c4 ∈ [1..2147483647] or UNINITIALIZED [eva:final-states] Values at end of function test_narrow: r ∈ {100; 200; 300} [eva:final-states] Values at end of function test_none: a ∈ [--..--] b ∈ [--..--] c1 ∈ {4} or UNINITIALIZED c2 ∈ {4; 5} or UNINITIALIZED c3 ∈ [1..2147483647] or UNINITIALIZED c4 ∈ [1..2147483647] or UNINITIALIZED [eva:final-states] Values at end of function test_promote: x ∈ [--..--] r ∈ {1} [eva:final-states] Values at end of function test_small1: x ∈ {4} [eva:final-states] Values at end of function test_small2: x ∈ {2; 4} [eva:final-states] Values at end of function test_small3: r ∈ [0..1000] [eva:final-states] Values at end of function test_small4: r ∈ [0..1000] [eva:final-states] Values at end of function test_small5: r ∈ [--..--] [eva:final-states] Values at end of function test_small6: a ∈ [--..--] or UNINITIALIZED p ∈ {{ &a }} [eva:final-states] Values at end of function test_small6_bis: a ∈ [--..--] p ∈ {{ &a }} [eva:final-states] Values at end of function main: T[0..4] ∈ [--..--] [5..9] ∈ {0} __retres ∈ {0} [from] Computing for function test_123_comp_2345_comp_disj [from] Computing for function f_123_comp_2345_comp_disj <-test_123_comp_2345_comp_disj [from] Done for function f_123_comp_2345_comp_disj [from] Done for function test_123_comp_2345_comp_disj [from] Computing for function test_123_comp_disj [from] Computing for function f_123_comp_disj <-test_123_comp_disj [from] Done for function f_123_comp_disj [from] Done for function test_123_comp_disj [from] Computing for function test_123_comp_disj_2345_comp [from] Computing for function f_123_comp_disj_2345_comp <-test_123_comp_disj_2345_comp [from] Done for function f_123_comp_disj_2345_comp [from] Done for function test_123_comp_disj_2345_comp [from] Computing for function test_123_comp_disj_2345_disj [from] Computing for function f_123_comp_disj_2345_disj <-test_123_comp_disj_2345_disj [from] Done for function f_123_comp_disj_2345_disj [from] Done for function test_123_comp_disj_2345_disj [from] Computing for function test_123_disj_2345_comp_disj [from] Computing for function f_123_disj_2345_comp_disj <-test_123_disj_2345_comp_disj [from] Done for function f_123_disj_2345_comp_disj [from] Done for function test_123_disj_2345_comp_disj [from] Computing for function test_assigns [from] Computing for function f <-test_assigns [from] Done for function f [from] Done for function test_assigns [from] Computing for function test_assigns2 [from] Computing for function f2 <-test_assigns2 [from] Done for function f2 [from] Done for function test_assigns2 [from] Computing for function test_comp [from] Computing for function f_comp <-test_comp [from] Done for function f_comp [from] Done for function test_comp [from] Computing for function test_comp_disj [from] Computing for function f_comp_disj <-test_comp_disj [from] Done for function f_comp_disj [from] Done for function test_comp_disj [from] Computing for function test_disj [from] Computing for function f_disj <-test_disj [from] Done for function f_disj [from] Done for function test_disj [from] Computing for function test_narrow [from] Computing for function f10 <-test_narrow [from] Done for function f10 [from] Done for function test_narrow [from] Computing for function test_none [from] Computing for function f_none <-test_none [from] Done for function f_none [from] Done for function test_none [from] Computing for function test_promote [from] Computing for function f9 <-test_promote [from] Done for function f9 [from] Done for function test_promote [from] Computing for function test_small1 [from] Computing for function f3 <-test_small1 [from] Done for function f3 [from] Done for function test_small1 [from] Computing for function test_small2 [from] Computing for function f4 <-test_small2 [from] Done for function f4 [from] Done for function test_small2 [from] Computing for function test_small3 [from] Computing for function f5 <-test_small3 [from] Done for function f5 [from] Done for function test_small3 [from] Computing for function test_small4 [from] Computing for function f6 <-test_small4 [from] Done for function f6 [from] Done for function test_small4 [from] Computing for function test_small5 [from] Computing for function f7 <-test_small5 [from] Done for function f7 [from] Done for function test_small5 [from] Computing for function test_small6 [from] Computing for function f8 <-test_small6 [from] Done for function f8 [from] Done for function test_small6 [from] Computing for function test_small6_bis [from] Computing for function f8_bis <-test_small6_bis [from] Done for function f8_bis [from] Done for function test_small6_bis [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM p; q [from] Function f10: \result FROM x [from] Function f2: T[0..4] FROM \nothing [from] Function f3: \result FROM x [from] Function f4: \result FROM x [from] Function f5: \result FROM x [from] Function f6: \result FROM x [from] Function f7: \result FROM x [from] Function f8: a FROM \nothing \result FROM p [from] Function f8_bis: a FROM \nothing \result FROM p [from] Function f9: \result FROM n; "a"[bits 0 to 7] [from] Function f_123_comp_2345_comp_disj: \result FROM a; b [from] Function f_123_comp_disj: \result FROM a; b [from] Function f_123_comp_disj_2345_comp: \result FROM a; b [from] Function f_123_comp_disj_2345_disj: \result FROM a; b [from] Function f_123_disj_2345_comp_disj: \result FROM a; b [from] Function f_comp: \result FROM a; b [from] Function f_comp_disj: \result FROM a; b [from] Function f_disj: \result FROM a; b [from] Function f_none: \result FROM a; b [from] Function test_123_comp_2345_comp_disj: NO EFFECTS [from] Function test_123_comp_disj: NO EFFECTS [from] Function test_123_comp_disj_2345_comp: NO EFFECTS [from] Function test_123_comp_disj_2345_disj: NO EFFECTS [from] Function test_123_disj_2345_comp_disj: NO EFFECTS [from] Function test_assigns: NO EFFECTS [from] Function test_assigns2: T[0..4] FROM \nothing [from] Function test_comp: NO EFFECTS [from] Function test_comp_disj: NO EFFECTS [from] Function test_disj: NO EFFECTS [from] Function test_narrow: NO EFFECTS [from] Function test_none: NO EFFECTS [from] Function test_promote: NO EFFECTS [from] Function test_small1: NO EFFECTS [from] Function test_small2: NO EFFECTS [from] Function test_small3: NO EFFECTS [from] Function test_small4: NO EFFECTS [from] Function test_small5: NO EFFECTS [from] Function test_small6: NO EFFECTS [from] Function test_small6_bis: NO EFFECTS [from] Function main: T[0..4] FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function test_123_comp_2345_comp_disj: a; b; c1; c2; c3; c4 [inout] Inputs for function test_123_comp_2345_comp_disj: nondet [inout] Out (internal) for function test_123_comp_disj: a; b; c1; c2; c3; c4 [inout] Inputs for function test_123_comp_disj: nondet [inout] Out (internal) for function test_123_comp_disj_2345_comp: a; b; c1; c2; c3; c4 [inout] Inputs for function test_123_comp_disj_2345_comp: nondet [inout] Out (internal) for function test_123_comp_disj_2345_disj: a; b; c1; c2; c3; c4 [inout] Inputs for function test_123_comp_disj_2345_disj: nondet [inout] Out (internal) for function test_123_disj_2345_comp_disj: a; b; c1; c2; c3; c4 [inout] Inputs for function test_123_disj_2345_comp_disj: nondet [inout] Out (internal) for function test_assigns: p1; p2; p3; tmp; tmp_0; tmp_1 [inout] Inputs for function test_assigns: \nothing [inout] Out (internal) for function test_assigns2: T[0..4]; p [inout] Inputs for function test_assigns2: \nothing [inout] Out (internal) for function test_comp: a; b; c1; c2; c3; c4 [inout] Inputs for function test_comp: nondet [inout] Out (internal) for function test_comp_disj: a; b; c1; c2; c3; c4 [inout] Inputs for function test_comp_disj: nondet [inout] Out (internal) for function test_disj: a; b; c1; c2; c3; c4 [inout] Inputs for function test_disj: nondet [inout] Out (internal) for function test_narrow: r [inout] Inputs for function test_narrow: nondet [inout] Out (internal) for function test_none: a; b; c1; c2; c3; c4 [inout] Inputs for function test_none: nondet [inout] Out (internal) for function test_promote: x; r [inout] Inputs for function test_promote: nondet; "a"[bits 0 to 7] [inout] Out (internal) for function test_small1: x [inout] Inputs for function test_small1: nondet [inout] Out (internal) for function test_small2: x [inout] Inputs for function test_small2: nondet [inout] Out (internal) for function test_small3: r [inout] Inputs for function test_small3: nondet [inout] Out (internal) for function test_small4: r [inout] Inputs for function test_small4: nondet [inout] Out (internal) for function test_small5: r [inout] Inputs for function test_small5: nondet [inout] Out (internal) for function test_small6: a; p [inout] Inputs for function test_small6: \nothing [inout] Out (internal) for function test_small6_bis: a; p [inout] Inputs for function test_small6_bis: \nothing [inout] Out (internal) for function main: T[0..4]; __retres [inout] Inputs for function main: nondet; "a"[bits 0 to 7] frama-c-20.0-Calcium/tests/value/oracle/behaviors2.res.oracle0000666000000000000000000003555313571573400020774 0ustar [kernel] Parsing tests/value/behaviors2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function test1 <- main. Called from tests/value/behaviors2.c:328. [eva] computing for function divi <- test1 <- main. Called from tests/value/behaviors2.c:178. [eva] using specification for function divi [eva] tests/value/behaviors2.c:178: function divi: precondition got status valid. [eva] tests/value/behaviors2.c:178: function divi, behavior division_by_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:178: function divi, behavior invalid_parameter: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:178: function divi, behavior error: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:178: function divi, behavior ok_res_sign_nonpositive: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:178: function divi, behavior ok_quotient_zero: assumes got status invalid; behavior not evaluated. [eva] Done for function divi [eva] computing for function divi <- test1 <- main. Called from tests/value/behaviors2.c:180. [eva] tests/value/behaviors2.c:180: function divi: precondition got status valid. [eva] tests/value/behaviors2.c:180: function divi, behavior division_by_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:180: function divi, behavior invalid_parameter: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:180: function divi, behavior error: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:180: function divi, behavior ok_res_sign_nonpositive: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:180: function divi, behavior ok_quotient_non_zero: assumes got status invalid; behavior not evaluated. [eva] Done for function divi [eva] computing for function divi <- test1 <- main. Called from tests/value/behaviors2.c:182. [eva] tests/value/behaviors2.c:182: function divi: precondition got status valid. [eva] tests/value/behaviors2.c:182: function divi, behavior division_by_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:182: function divi, behavior invalid_parameter: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:182: function divi, behavior error: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:182: function divi, behavior ok_res_sign_nonpositive: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:182: function divi, behavior ok_quotient_non_zero: assumes got status invalid; behavior not evaluated. [eva] Done for function divi [eva] computing for function divi <- test1 <- main. Called from tests/value/behaviors2.c:184. [eva] tests/value/behaviors2.c:184: function divi: precondition got status valid. [eva] tests/value/behaviors2.c:184: function divi, behavior invalid_parameter: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:184: function divi, behavior ok: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:184: function divi, behavior ok_res_sign_nonnegative: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:184: function divi, behavior ok_res_sign_nonpositive: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:184: function divi, behavior ok_quotient_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:184: function divi, behavior ok_quotient_non_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:184: function divi, behavior division_by_zero: precondition got status valid. [eva] tests/value/behaviors2.c:184: function divi, behavior error: precondition got status valid. [eva] Done for function divi [eva] computing for function divi <- test1 <- main. Called from tests/value/behaviors2.c:186. [eva] tests/value/behaviors2.c:186: function divi: precondition got status valid. [eva] tests/value/behaviors2.c:186: function divi, behavior division_by_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:186: function divi, behavior ok: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:186: function divi, behavior ok_res_sign_nonnegative: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:186: function divi, behavior ok_res_sign_nonpositive: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:186: function divi, behavior ok_quotient_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:186: function divi, behavior ok_quotient_non_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:186: function divi, behavior invalid_parameter: precondition got status valid. [eva] tests/value/behaviors2.c:186: function divi, behavior error: precondition got status valid. [eva] Done for function divi [eva] computing for function divi <- test1 <- main. Called from tests/value/behaviors2.c:188. [eva] tests/value/behaviors2.c:188: function divi: precondition got status valid. [eva] tests/value/behaviors2.c:188: function divi, behavior division_by_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:188: function divi, behavior ok: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:188: function divi, behavior ok_res_sign_nonnegative: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:188: function divi, behavior ok_res_sign_nonpositive: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:188: function divi, behavior ok_quotient_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:188: function divi, behavior ok_quotient_non_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:188: function divi, behavior invalid_parameter: precondition got status valid. [eva] tests/value/behaviors2.c:188: function divi, behavior error: precondition got status valid. [eva] Done for function divi [eva] computing for function divi <- test1 <- main. Called from tests/value/behaviors2.c:190. [eva] tests/value/behaviors2.c:190: function divi: precondition got status valid. [eva] tests/value/behaviors2.c:190: function divi, behavior division_by_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:190: function divi, behavior ok: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:190: function divi, behavior ok_res_sign_nonnegative: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:190: function divi, behavior ok_res_sign_nonpositive: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:190: function divi, behavior ok_quotient_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:190: function divi, behavior ok_quotient_non_zero: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:190: function divi, behavior invalid_parameter: precondition got status valid. [eva] tests/value/behaviors2.c:190: function divi, behavior error: precondition got status valid. [eva] Done for function divi [eva] computing for function divi <- test1 <- main. Called from tests/value/behaviors2.c:192. [eva] tests/value/behaviors2.c:192: function divi: precondition got status valid. [eva] tests/value/behaviors2.c:192: function divi, behavior invalid_parameter: assumes got status invalid; behavior not evaluated. [eva] tests/value/behaviors2.c:192: function divi, behavior error: precondition got status valid. [eva] tests/value/behaviors2.c:192: function divi, behavior division_by_zero: precondition got status valid. [eva] Done for function divi [eva] Recording results for test1 [eva] Done for function test1 [eva] computing for function test2 <- main. Called from tests/value/behaviors2.c:329. [eva] computing for function f1 <- test2 <- main. Called from tests/value/behaviors2.c:229. [eva] using specification for function f1 [eva:alarm] tests/value/behaviors2.c:229: Warning: function f1: precondition got status unknown. [eva] tests/value/behaviors2.c:229: function f1, behavior b2: precondition \initialized(p2) got status valid. [eva] tests/value/behaviors2.c:229: function f1, behavior b2: precondition \valid(y) got status valid. [eva] tests/value/behaviors2.c:229: function f1, behavior b1: precondition \initialized(p1) got status valid. [eva] tests/value/behaviors2.c:229: function f1, behavior b1: precondition \valid(y) got status valid. [eva] Done for function f1 [eva] Recording results for test2 [eva] Done for function test2 [eva] computing for function test3 <- main. Called from tests/value/behaviors2.c:330. [eva] computing for function f2 <- test3 <- main. Called from tests/value/behaviors2.c:265. [eva] using specification for function f2 [eva:alarm] tests/value/behaviors2.c:265: Warning: function f2: precondition got status unknown. [eva] tests/value/behaviors2.c:265: function f2, behavior b2: precondition \initialized(p2) got status valid. [eva] tests/value/behaviors2.c:265: function f2, behavior b2: precondition \valid(y) got status valid. [eva] tests/value/behaviors2.c:265: function f2, behavior b1: precondition \initialized(p1) got status valid. [eva] tests/value/behaviors2.c:265: function f2, behavior b1: precondition \valid(y) got status valid. [eva] Done for function f2 [eva] Recording results for test3 [eva] Done for function test3 [eva] computing for function test4 <- main. Called from tests/value/behaviors2.c:331. [eva] computing for function f3 <- test4 <- main. Called from tests/value/behaviors2.c:285. [eva] using specification for function f3 [eva:alarm] tests/value/behaviors2.c:285: Warning: function f3: precondition got status unknown. [eva] tests/value/behaviors2.c:285: function f3, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f3 [eva] Recording results for test4 [eva] Done for function test4 [eva] computing for function test5 <- main. Called from tests/value/behaviors2.c:332. [eva] computing for function f4 <- test5 <- main. Called from tests/value/behaviors2.c:306. [eva] using specification for function f4 [eva:alarm] tests/value/behaviors2.c:306: Warning: function f4: precondition got status unknown. [eva] tests/value/behaviors2.c:306: function f4, behavior b3: assumes got status invalid; behavior not evaluated. [eva] Done for function f4 [eva] Recording results for test5 [eva] Done for function test5 [eva] computing for function test_red <- main. Called from tests/value/behaviors2.c:333. [eva] computing for function opt_ptr <- test_red <- main. Called from tests/value/behaviors2.c:319. [eva] using specification for function opt_ptr [eva] Done for function opt_ptr [eva] tests/value/behaviors2.c:320: assertion got status valid. [eva] Recording results for test_red [eva] Done for function test_red [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test1: quotient ∈ [--..--] remainder ∈ [--..--] sign ∈ {-1; 0; 1} errmsg[0..19] ∈ [--..--] or UNINITIALIZED r1 ∈ {0} r2 ∈ {0} r3 ∈ {0} r4 ∈ {1} r5 ∈ {2} r6 ∈ {2} r7 ∈ {2} r8 ∈ {0; 1} [eva:final-states] Values at end of function test2: a ∈ {1} b ∈ {2} p ∈ {{ &a ; &b }} y ∈ {-4; 2} x ∈ {2; 4} [eva:final-states] Values at end of function test3: a ∈ {1} b ∈ {2} p ∈ {{ &a ; &b }} y ∈ {-4; 2} x ∈ {2; 4} [eva:final-states] Values at end of function test4: x ∈ {2; 4} [eva:final-states] Values at end of function test5: x ∈ {4} [eva:final-states] Values at end of function test_red: a ∈ {1} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function test1 [from] Computing for function divi <-test1 [from] Done for function divi [from] Done for function test1 [from] Computing for function test2 [from] Computing for function f1 <-test2 [from] Done for function f1 [from] Done for function test2 [from] Computing for function test3 [from] Computing for function f2 <-test3 [from] Done for function f2 [from] Done for function test3 [from] Computing for function test4 [from] Computing for function f3 <-test4 [from] Done for function f3 [from] Done for function test4 [from] Computing for function test5 [from] Computing for function f4 <-test5 [from] Done for function f4 [from] Done for function test5 [from] Computing for function test_red [from] Computing for function opt_ptr <-test_red [from] Done for function opt_ptr [from] Done for function test_red [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function divi: quotient FROM dividend; divisor (and SELF) remainder FROM dividend; divisor (and SELF) sign FROM dividend; divisor (and SELF) errmsg[0..19] FROM dividend; divisor; quotient; remainder; sign \result FROM dividend; divisor; quotient; remainder; sign [from] Function f1: y FROM x \result FROM p1; p2 [from] Function f2: y FROM x \result FROM p1; p2 [from] Function f3: \result FROM x [from] Function f4: \result FROM x [from] Function opt_ptr: a FROM p [from] Function test1: NO EFFECTS [from] Function test2: NO EFFECTS [from] Function test3: NO EFFECTS [from] Function test4: NO EFFECTS [from] Function test5: NO EFFECTS [from] Function test_red: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function test1: quotient; remainder; sign; errmsg[0..19]; r1; r2; r3; r4; r5; r6; r7; r8 [inout] Inputs for function test1: nondet [inout] Out (internal) for function test2: a; b; p; y; x [inout] Inputs for function test2: nondet [inout] Out (internal) for function test3: a; b; p; y; x [inout] Inputs for function test3: nondet [inout] Out (internal) for function test4: x [inout] Inputs for function test4: nondet [inout] Out (internal) for function test5: x [inout] Inputs for function test5: nondet [inout] Out (internal) for function test_red: a [inout] Inputs for function test_red: \nothing [inout] Out (internal) for function main: __retres [inout] Inputs for function main: nondet frama-c-20.0-Calcium/tests/value/oracle/big_lib_entry.res.oracle0000666000000000000000000121367013571573400021537 0ustar [kernel] Parsing tests/value/big_lib_entry.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] tests/value/big_lib_entry.i:32: Initializing a complex array of 1000 elements. This may take some time [eva] Initial state computed [eva:initial-state] Values of globals at initialization s.c1 ∈ [--..--] .[bits 8 to 31] ∈ UNINITIALIZED .tcs[0].f1 ∈ [--..--] .tcs[0].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[0].f3 ∈ [--..--] .tcs[0].[bits 72 to 95] ∈ UNINITIALIZED .tcs[0].f4 ∈ {{ NULL ; &S_f4_0_tcs_s[0] }} .tcs[0].f5 ∈ [--..--] .tcs[0].[bits 136 to 159] ∈ UNINITIALIZED .tcs[1].f1 ∈ [--..--] .tcs[1].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[1].f3 ∈ [--..--] .tcs[1].[bits 72 to 95] ∈ UNINITIALIZED .tcs[1].f4 ∈ {{ NULL ; &S_f4_1_tcs_s[0] }} .tcs[1].f5 ∈ [--..--] .tcs[1].[bits 136 to 159] ∈ UNINITIALIZED .tcs[2].f1 ∈ [--..--] .tcs[2].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[2].f3 ∈ [--..--] .tcs[2].[bits 72 to 95] ∈ UNINITIALIZED .tcs[2].f4 ∈ {{ NULL ; &S_f4_2_tcs_s[0] }} .tcs[2].f5 ∈ [--..--] .tcs[2].[bits 136 to 159] ∈ UNINITIALIZED .tcs[3].f1 ∈ [--..--] .tcs[3].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[3].f3 ∈ [--..--] .tcs[3].[bits 72 to 95] ∈ UNINITIALIZED .tcs[3].f4 ∈ {{ NULL ; &S_f4_3_tcs_s[0] }} .tcs[3].f5 ∈ [--..--] .tcs[3].[bits 136 to 159] ∈ UNINITIALIZED .tcs[4].f1 ∈ [--..--] .tcs[4].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[4].f3 ∈ [--..--] .tcs[4].[bits 72 to 95] ∈ UNINITIALIZED .tcs[4].f4 ∈ {{ NULL ; &S_f4_0_tcs_s[0] ; &S_f4_1_tcs_s[0] ; &S_f4_2_tcs_s[0] ; &S_f4_3_tcs_s[0] }} .tcs[4].f5 ∈ [--..--] .tcs[4].[bits 136 to 159] ∈ UNINITIALIZED .tcs[5].f1 ∈ [--..--] .tcs[5].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[5].f3 ∈ [--..--] .tcs[5].[bits 72 to 95] ∈ UNINITIALIZED .tcs[5].f4 ∈ {{ NULL ; &S_f4_0_tcs_s[0] ; &S_f4_1_tcs_s[0] ; &S_f4_2_tcs_s[0] ; &S_f4_3_tcs_s[0] }} .tcs[5].f5 ∈ [--..--] .tcs[5].[bits 136 to 159] ∈ UNINITIALIZED .tcs[6].f1 ∈ [--..--] .tcs[6].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[6].f3 ∈ [--..--] .tcs[6].[bits 72 to 95] ∈ UNINITIALIZED .tcs[6].f4 ∈ {{ NULL ; &S_f4_0_tcs_s[0] ; &S_f4_1_tcs_s[0] ; &S_f4_2_tcs_s[0] ; &S_f4_3_tcs_s[0] }} .tcs[6].f5 ∈ [--..--] .tcs[6].[bits 136 to 159] ∈ UNINITIALIZED .tcs[7].f1 ∈ [--..--] .tcs[7].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[7].f3 ∈ [--..--] .tcs[7].[bits 72 to 95] ∈ UNINITIALIZED .tcs[7].f4 ∈ {{ NULL ; &S_f4_0_tcs_s[0] ; &S_f4_1_tcs_s[0] ; &S_f4_2_tcs_s[0] ; &S_f4_3_tcs_s[0] }} .tcs[7].f5 ∈ [--..--] .tcs[7].[bits 136 to 159] ∈ UNINITIALIZED .tcs[8].f1 ∈ [--..--] .tcs[8].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[8].f3 ∈ [--..--] .tcs[8].[bits 72 to 95] ∈ UNINITIALIZED .tcs[8].f4 ∈ {{ NULL ; &S_f4_0_tcs_s[0] ; &S_f4_1_tcs_s[0] ; &S_f4_2_tcs_s[0] ; &S_f4_3_tcs_s[0] }} .tcs[8].f5 ∈ [--..--] .tcs[8].[bits 136 to 159] ∈ UNINITIALIZED .tcs[9].f1 ∈ [--..--] .tcs[9].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] .tcs[9].f3 ∈ [--..--] .tcs[9].[bits 72 to 95] ∈ UNINITIALIZED .tcs[9].f4 ∈ {{ NULL ; &S_f4_0_tcs_s[0] ; &S_f4_1_tcs_s[0] ; &S_f4_2_tcs_s[0] ; &S_f4_3_tcs_s[0] }} .tcs[9].f5 ∈ [--..--] .tcs[9].[bits 136 to 159] ∈ UNINITIALIZED .c2 ∈ [--..--] .[bits 1640 to 1663] ∈ UNINITIALIZED t1[0] ∈ {{ NULL ; &S_0_t1[0] }} [1] ∈ {{ NULL ; &S_1_t1[0] }} [2] ∈ {{ NULL ; &S_2_t1[0] }} [3] ∈ {{ NULL ; &S_3_t1[0] }} [4..4999999] ∈ {{ NULL ; &S_0_t1[0] ; &S_1_t1[0] ; &S_2_t1[0] ; &S_3_t1[0] }} t2[0..4999999] ∈ [--..--] t3[0].f1 ∈ [--..--] [0].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [0].f3 ∈ [--..--] [0].[bits 72 to 95] ∈ UNINITIALIZED [0].f4 ∈ {{ NULL ; &S_f4_0_t3[0] }} [0].f5 ∈ [--..--] [0].[bits 136 to 159] ∈ UNINITIALIZED [1].f1 ∈ [--..--] [1].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [1].f3 ∈ [--..--] [1].[bits 72 to 95] ∈ UNINITIALIZED [1].f4 ∈ {{ NULL ; &S_f4_1_t3[0] }} [1].f5 ∈ [--..--] [1].[bits 136 to 159] ∈ UNINITIALIZED [2].f1 ∈ [--..--] [2].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [2].f3 ∈ [--..--] [2].[bits 72 to 95] ∈ UNINITIALIZED [2].f4 ∈ {{ NULL ; &S_f4_2_t3[0] }} [2].f5 ∈ [--..--] [2].[bits 136 to 159] ∈ UNINITIALIZED [3].f1 ∈ [--..--] [3].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [3].f3 ∈ [--..--] [3].[bits 72 to 95] ∈ UNINITIALIZED [3].f4 ∈ {{ NULL ; &S_f4_3_t3[0] }} [3].f5 ∈ [--..--] [3].[bits 136 to 159] ∈ UNINITIALIZED [4].f1 ∈ [--..--] [4].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [4].f3 ∈ [--..--] [4].[bits 72 to 95] ∈ UNINITIALIZED [4].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [4].f5 ∈ [--..--] [4].[bits 136 to 159] ∈ UNINITIALIZED [5].f1 ∈ [--..--] [5].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [5].f3 ∈ [--..--] [5].[bits 72 to 95] ∈ UNINITIALIZED [5].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [5].f5 ∈ [--..--] [5].[bits 136 to 159] ∈ UNINITIALIZED [6].f1 ∈ [--..--] [6].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [6].f3 ∈ [--..--] [6].[bits 72 to 95] ∈ UNINITIALIZED [6].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [6].f5 ∈ [--..--] [6].[bits 136 to 159] ∈ UNINITIALIZED [7].f1 ∈ [--..--] [7].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [7].f3 ∈ [--..--] [7].[bits 72 to 95] ∈ UNINITIALIZED [7].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [7].f5 ∈ [--..--] [7].[bits 136 to 159] ∈ UNINITIALIZED [8].f1 ∈ [--..--] [8].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [8].f3 ∈ [--..--] [8].[bits 72 to 95] ∈ UNINITIALIZED [8].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [8].f5 ∈ [--..--] [8].[bits 136 to 159] ∈ UNINITIALIZED [9].f1 ∈ [--..--] [9].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [9].f3 ∈ [--..--] [9].[bits 72 to 95] ∈ UNINITIALIZED [9].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [9].f5 ∈ [--..--] [9].[bits 136 to 159] ∈ UNINITIALIZED [10].f1 ∈ [--..--] [10].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [10].f3 ∈ [--..--] [10].[bits 72 to 95] ∈ UNINITIALIZED [10].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [10].f5 ∈ [--..--] [10].[bits 136 to 159] ∈ UNINITIALIZED [11].f1 ∈ [--..--] [11].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [11].f3 ∈ [--..--] [11].[bits 72 to 95] ∈ UNINITIALIZED [11].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [11].f5 ∈ [--..--] [11].[bits 136 to 159] ∈ UNINITIALIZED [12].f1 ∈ [--..--] [12].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [12].f3 ∈ [--..--] [12].[bits 72 to 95] ∈ UNINITIALIZED [12].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [12].f5 ∈ [--..--] [12].[bits 136 to 159] ∈ UNINITIALIZED [13].f1 ∈ [--..--] [13].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [13].f3 ∈ [--..--] [13].[bits 72 to 95] ∈ UNINITIALIZED [13].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [13].f5 ∈ [--..--] [13].[bits 136 to 159] ∈ UNINITIALIZED [14].f1 ∈ [--..--] [14].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [14].f3 ∈ [--..--] [14].[bits 72 to 95] ∈ UNINITIALIZED [14].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [14].f5 ∈ [--..--] [14].[bits 136 to 159] ∈ UNINITIALIZED [15].f1 ∈ [--..--] [15].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [15].f3 ∈ [--..--] [15].[bits 72 to 95] ∈ UNINITIALIZED [15].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [15].f5 ∈ [--..--] [15].[bits 136 to 159] ∈ UNINITIALIZED [16].f1 ∈ [--..--] [16].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [16].f3 ∈ [--..--] [16].[bits 72 to 95] ∈ UNINITIALIZED [16].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [16].f5 ∈ [--..--] [16].[bits 136 to 159] ∈ UNINITIALIZED [17].f1 ∈ [--..--] [17].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [17].f3 ∈ [--..--] [17].[bits 72 to 95] ∈ UNINITIALIZED [17].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [17].f5 ∈ [--..--] [17].[bits 136 to 159] ∈ UNINITIALIZED [18].f1 ∈ [--..--] [18].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [18].f3 ∈ [--..--] [18].[bits 72 to 95] ∈ UNINITIALIZED [18].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [18].f5 ∈ [--..--] [18].[bits 136 to 159] ∈ UNINITIALIZED [19].f1 ∈ [--..--] [19].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [19].f3 ∈ [--..--] [19].[bits 72 to 95] ∈ UNINITIALIZED [19].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [19].f5 ∈ [--..--] [19].[bits 136 to 159] ∈ UNINITIALIZED [20].f1 ∈ [--..--] [20].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [20].f3 ∈ [--..--] [20].[bits 72 to 95] ∈ UNINITIALIZED [20].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [20].f5 ∈ [--..--] [20].[bits 136 to 159] ∈ UNINITIALIZED [21].f1 ∈ [--..--] [21].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [21].f3 ∈ [--..--] [21].[bits 72 to 95] ∈ UNINITIALIZED [21].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [21].f5 ∈ [--..--] [21].[bits 136 to 159] ∈ UNINITIALIZED [22].f1 ∈ [--..--] [22].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [22].f3 ∈ [--..--] [22].[bits 72 to 95] ∈ UNINITIALIZED [22].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [22].f5 ∈ [--..--] [22].[bits 136 to 159] ∈ UNINITIALIZED [23].f1 ∈ [--..--] [23].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [23].f3 ∈ [--..--] [23].[bits 72 to 95] ∈ UNINITIALIZED [23].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [23].f5 ∈ [--..--] [23].[bits 136 to 159] ∈ UNINITIALIZED [24].f1 ∈ [--..--] [24].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [24].f3 ∈ [--..--] [24].[bits 72 to 95] ∈ UNINITIALIZED [24].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [24].f5 ∈ [--..--] [24].[bits 136 to 159] ∈ UNINITIALIZED [25].f1 ∈ [--..--] [25].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [25].f3 ∈ [--..--] [25].[bits 72 to 95] ∈ UNINITIALIZED [25].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [25].f5 ∈ [--..--] [25].[bits 136 to 159] ∈ UNINITIALIZED [26].f1 ∈ [--..--] [26].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [26].f3 ∈ [--..--] [26].[bits 72 to 95] ∈ UNINITIALIZED [26].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [26].f5 ∈ [--..--] [26].[bits 136 to 159] ∈ UNINITIALIZED [27].f1 ∈ [--..--] [27].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [27].f3 ∈ [--..--] [27].[bits 72 to 95] ∈ UNINITIALIZED [27].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [27].f5 ∈ [--..--] [27].[bits 136 to 159] ∈ UNINITIALIZED [28].f1 ∈ [--..--] [28].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [28].f3 ∈ [--..--] [28].[bits 72 to 95] ∈ UNINITIALIZED [28].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [28].f5 ∈ [--..--] [28].[bits 136 to 159] ∈ UNINITIALIZED [29].f1 ∈ [--..--] [29].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [29].f3 ∈ [--..--] [29].[bits 72 to 95] ∈ UNINITIALIZED [29].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [29].f5 ∈ [--..--] [29].[bits 136 to 159] ∈ UNINITIALIZED [30].f1 ∈ [--..--] [30].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [30].f3 ∈ [--..--] [30].[bits 72 to 95] ∈ UNINITIALIZED [30].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [30].f5 ∈ [--..--] [30].[bits 136 to 159] ∈ UNINITIALIZED [31].f1 ∈ [--..--] [31].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [31].f3 ∈ [--..--] [31].[bits 72 to 95] ∈ UNINITIALIZED [31].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [31].f5 ∈ [--..--] [31].[bits 136 to 159] ∈ UNINITIALIZED [32].f1 ∈ [--..--] [32].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [32].f3 ∈ [--..--] [32].[bits 72 to 95] ∈ UNINITIALIZED [32].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [32].f5 ∈ [--..--] [32].[bits 136 to 159] ∈ UNINITIALIZED [33].f1 ∈ [--..--] [33].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [33].f3 ∈ [--..--] [33].[bits 72 to 95] ∈ UNINITIALIZED [33].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [33].f5 ∈ [--..--] [33].[bits 136 to 159] ∈ UNINITIALIZED [34].f1 ∈ [--..--] [34].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [34].f3 ∈ [--..--] [34].[bits 72 to 95] ∈ UNINITIALIZED [34].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [34].f5 ∈ [--..--] [34].[bits 136 to 159] ∈ UNINITIALIZED [35].f1 ∈ [--..--] [35].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [35].f3 ∈ [--..--] [35].[bits 72 to 95] ∈ UNINITIALIZED [35].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [35].f5 ∈ [--..--] [35].[bits 136 to 159] ∈ UNINITIALIZED [36].f1 ∈ [--..--] [36].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [36].f3 ∈ [--..--] [36].[bits 72 to 95] ∈ UNINITIALIZED [36].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [36].f5 ∈ [--..--] [36].[bits 136 to 159] ∈ UNINITIALIZED [37].f1 ∈ [--..--] [37].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [37].f3 ∈ [--..--] [37].[bits 72 to 95] ∈ UNINITIALIZED [37].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [37].f5 ∈ [--..--] [37].[bits 136 to 159] ∈ UNINITIALIZED [38].f1 ∈ [--..--] [38].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [38].f3 ∈ [--..--] [38].[bits 72 to 95] ∈ UNINITIALIZED [38].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [38].f5 ∈ [--..--] [38].[bits 136 to 159] ∈ UNINITIALIZED [39].f1 ∈ [--..--] [39].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [39].f3 ∈ [--..--] [39].[bits 72 to 95] ∈ UNINITIALIZED [39].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [39].f5 ∈ [--..--] [39].[bits 136 to 159] ∈ UNINITIALIZED [40].f1 ∈ [--..--] [40].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [40].f3 ∈ [--..--] [40].[bits 72 to 95] ∈ UNINITIALIZED [40].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [40].f5 ∈ [--..--] [40].[bits 136 to 159] ∈ UNINITIALIZED [41].f1 ∈ [--..--] [41].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [41].f3 ∈ [--..--] [41].[bits 72 to 95] ∈ UNINITIALIZED [41].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [41].f5 ∈ [--..--] [41].[bits 136 to 159] ∈ UNINITIALIZED [42].f1 ∈ [--..--] [42].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [42].f3 ∈ [--..--] [42].[bits 72 to 95] ∈ UNINITIALIZED [42].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [42].f5 ∈ [--..--] [42].[bits 136 to 159] ∈ UNINITIALIZED [43].f1 ∈ [--..--] [43].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [43].f3 ∈ [--..--] [43].[bits 72 to 95] ∈ UNINITIALIZED [43].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [43].f5 ∈ [--..--] [43].[bits 136 to 159] ∈ UNINITIALIZED [44].f1 ∈ [--..--] [44].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [44].f3 ∈ [--..--] [44].[bits 72 to 95] ∈ UNINITIALIZED [44].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [44].f5 ∈ [--..--] [44].[bits 136 to 159] ∈ UNINITIALIZED [45].f1 ∈ [--..--] [45].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [45].f3 ∈ [--..--] [45].[bits 72 to 95] ∈ UNINITIALIZED [45].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [45].f5 ∈ [--..--] [45].[bits 136 to 159] ∈ UNINITIALIZED [46].f1 ∈ [--..--] [46].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [46].f3 ∈ [--..--] [46].[bits 72 to 95] ∈ UNINITIALIZED [46].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [46].f5 ∈ [--..--] [46].[bits 136 to 159] ∈ UNINITIALIZED [47].f1 ∈ [--..--] [47].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [47].f3 ∈ [--..--] [47].[bits 72 to 95] ∈ UNINITIALIZED [47].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [47].f5 ∈ [--..--] [47].[bits 136 to 159] ∈ UNINITIALIZED [48].f1 ∈ [--..--] [48].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [48].f3 ∈ [--..--] [48].[bits 72 to 95] ∈ UNINITIALIZED [48].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [48].f5 ∈ [--..--] [48].[bits 136 to 159] ∈ UNINITIALIZED [49].f1 ∈ [--..--] [49].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [49].f3 ∈ [--..--] [49].[bits 72 to 95] ∈ UNINITIALIZED [49].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [49].f5 ∈ [--..--] [49].[bits 136 to 159] ∈ UNINITIALIZED [50].f1 ∈ [--..--] [50].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [50].f3 ∈ [--..--] [50].[bits 72 to 95] ∈ UNINITIALIZED [50].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [50].f5 ∈ [--..--] [50].[bits 136 to 159] ∈ UNINITIALIZED [51].f1 ∈ [--..--] [51].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [51].f3 ∈ [--..--] [51].[bits 72 to 95] ∈ UNINITIALIZED [51].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [51].f5 ∈ [--..--] [51].[bits 136 to 159] ∈ UNINITIALIZED [52].f1 ∈ [--..--] [52].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [52].f3 ∈ [--..--] [52].[bits 72 to 95] ∈ UNINITIALIZED [52].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [52].f5 ∈ [--..--] [52].[bits 136 to 159] ∈ UNINITIALIZED [53].f1 ∈ [--..--] [53].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [53].f3 ∈ [--..--] [53].[bits 72 to 95] ∈ UNINITIALIZED [53].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [53].f5 ∈ [--..--] [53].[bits 136 to 159] ∈ UNINITIALIZED [54].f1 ∈ [--..--] [54].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [54].f3 ∈ [--..--] [54].[bits 72 to 95] ∈ UNINITIALIZED [54].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [54].f5 ∈ [--..--] [54].[bits 136 to 159] ∈ UNINITIALIZED [55].f1 ∈ [--..--] [55].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [55].f3 ∈ [--..--] [55].[bits 72 to 95] ∈ UNINITIALIZED [55].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [55].f5 ∈ [--..--] [55].[bits 136 to 159] ∈ UNINITIALIZED [56].f1 ∈ [--..--] [56].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [56].f3 ∈ [--..--] [56].[bits 72 to 95] ∈ UNINITIALIZED [56].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [56].f5 ∈ [--..--] [56].[bits 136 to 159] ∈ UNINITIALIZED [57].f1 ∈ [--..--] [57].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [57].f3 ∈ [--..--] [57].[bits 72 to 95] ∈ UNINITIALIZED [57].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [57].f5 ∈ [--..--] [57].[bits 136 to 159] ∈ UNINITIALIZED [58].f1 ∈ [--..--] [58].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [58].f3 ∈ [--..--] [58].[bits 72 to 95] ∈ UNINITIALIZED [58].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [58].f5 ∈ [--..--] [58].[bits 136 to 159] ∈ UNINITIALIZED [59].f1 ∈ [--..--] [59].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [59].f3 ∈ [--..--] [59].[bits 72 to 95] ∈ UNINITIALIZED [59].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [59].f5 ∈ [--..--] [59].[bits 136 to 159] ∈ UNINITIALIZED [60].f1 ∈ [--..--] [60].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [60].f3 ∈ [--..--] [60].[bits 72 to 95] ∈ UNINITIALIZED [60].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [60].f5 ∈ [--..--] [60].[bits 136 to 159] ∈ UNINITIALIZED [61].f1 ∈ [--..--] [61].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [61].f3 ∈ [--..--] [61].[bits 72 to 95] ∈ UNINITIALIZED [61].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [61].f5 ∈ [--..--] [61].[bits 136 to 159] ∈ UNINITIALIZED [62].f1 ∈ [--..--] [62].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [62].f3 ∈ [--..--] [62].[bits 72 to 95] ∈ UNINITIALIZED [62].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [62].f5 ∈ [--..--] [62].[bits 136 to 159] ∈ UNINITIALIZED [63].f1 ∈ [--..--] [63].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [63].f3 ∈ [--..--] [63].[bits 72 to 95] ∈ UNINITIALIZED [63].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [63].f5 ∈ [--..--] [63].[bits 136 to 159] ∈ UNINITIALIZED [64].f1 ∈ [--..--] [64].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [64].f3 ∈ [--..--] [64].[bits 72 to 95] ∈ UNINITIALIZED [64].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [64].f5 ∈ [--..--] [64].[bits 136 to 159] ∈ UNINITIALIZED [65].f1 ∈ [--..--] [65].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [65].f3 ∈ [--..--] [65].[bits 72 to 95] ∈ UNINITIALIZED [65].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [65].f5 ∈ [--..--] [65].[bits 136 to 159] ∈ UNINITIALIZED [66].f1 ∈ [--..--] [66].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [66].f3 ∈ [--..--] [66].[bits 72 to 95] ∈ UNINITIALIZED [66].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [66].f5 ∈ [--..--] [66].[bits 136 to 159] ∈ UNINITIALIZED [67].f1 ∈ [--..--] [67].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [67].f3 ∈ [--..--] [67].[bits 72 to 95] ∈ UNINITIALIZED [67].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [67].f5 ∈ [--..--] [67].[bits 136 to 159] ∈ UNINITIALIZED [68].f1 ∈ [--..--] [68].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [68].f3 ∈ [--..--] [68].[bits 72 to 95] ∈ UNINITIALIZED [68].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [68].f5 ∈ [--..--] [68].[bits 136 to 159] ∈ UNINITIALIZED [69].f1 ∈ [--..--] [69].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [69].f3 ∈ [--..--] [69].[bits 72 to 95] ∈ UNINITIALIZED [69].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [69].f5 ∈ [--..--] [69].[bits 136 to 159] ∈ UNINITIALIZED [70].f1 ∈ [--..--] [70].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [70].f3 ∈ [--..--] [70].[bits 72 to 95] ∈ UNINITIALIZED [70].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [70].f5 ∈ [--..--] [70].[bits 136 to 159] ∈ UNINITIALIZED [71].f1 ∈ [--..--] [71].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [71].f3 ∈ [--..--] [71].[bits 72 to 95] ∈ UNINITIALIZED [71].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [71].f5 ∈ [--..--] [71].[bits 136 to 159] ∈ UNINITIALIZED [72].f1 ∈ [--..--] [72].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [72].f3 ∈ [--..--] [72].[bits 72 to 95] ∈ UNINITIALIZED [72].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [72].f5 ∈ [--..--] [72].[bits 136 to 159] ∈ UNINITIALIZED [73].f1 ∈ [--..--] [73].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [73].f3 ∈ [--..--] [73].[bits 72 to 95] ∈ UNINITIALIZED [73].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [73].f5 ∈ [--..--] [73].[bits 136 to 159] ∈ UNINITIALIZED [74].f1 ∈ [--..--] [74].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [74].f3 ∈ [--..--] [74].[bits 72 to 95] ∈ UNINITIALIZED [74].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [74].f5 ∈ [--..--] [74].[bits 136 to 159] ∈ UNINITIALIZED [75].f1 ∈ [--..--] [75].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [75].f3 ∈ [--..--] [75].[bits 72 to 95] ∈ UNINITIALIZED [75].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [75].f5 ∈ [--..--] [75].[bits 136 to 159] ∈ UNINITIALIZED [76].f1 ∈ [--..--] [76].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [76].f3 ∈ [--..--] [76].[bits 72 to 95] ∈ UNINITIALIZED [76].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [76].f5 ∈ [--..--] [76].[bits 136 to 159] ∈ UNINITIALIZED [77].f1 ∈ [--..--] [77].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [77].f3 ∈ [--..--] [77].[bits 72 to 95] ∈ UNINITIALIZED [77].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [77].f5 ∈ [--..--] [77].[bits 136 to 159] ∈ UNINITIALIZED [78].f1 ∈ [--..--] [78].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [78].f3 ∈ [--..--] [78].[bits 72 to 95] ∈ UNINITIALIZED [78].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [78].f5 ∈ [--..--] [78].[bits 136 to 159] ∈ UNINITIALIZED [79].f1 ∈ [--..--] [79].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [79].f3 ∈ [--..--] [79].[bits 72 to 95] ∈ UNINITIALIZED [79].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [79].f5 ∈ [--..--] [79].[bits 136 to 159] ∈ UNINITIALIZED [80].f1 ∈ [--..--] [80].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [80].f3 ∈ [--..--] [80].[bits 72 to 95] ∈ UNINITIALIZED [80].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [80].f5 ∈ [--..--] [80].[bits 136 to 159] ∈ UNINITIALIZED [81].f1 ∈ [--..--] [81].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [81].f3 ∈ [--..--] [81].[bits 72 to 95] ∈ UNINITIALIZED [81].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [81].f5 ∈ [--..--] [81].[bits 136 to 159] ∈ UNINITIALIZED [82].f1 ∈ [--..--] [82].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [82].f3 ∈ [--..--] [82].[bits 72 to 95] ∈ UNINITIALIZED [82].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [82].f5 ∈ [--..--] [82].[bits 136 to 159] ∈ UNINITIALIZED [83].f1 ∈ [--..--] [83].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [83].f3 ∈ [--..--] [83].[bits 72 to 95] ∈ UNINITIALIZED [83].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [83].f5 ∈ [--..--] [83].[bits 136 to 159] ∈ UNINITIALIZED [84].f1 ∈ [--..--] [84].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [84].f3 ∈ [--..--] [84].[bits 72 to 95] ∈ UNINITIALIZED [84].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [84].f5 ∈ [--..--] [84].[bits 136 to 159] ∈ UNINITIALIZED [85].f1 ∈ [--..--] [85].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [85].f3 ∈ [--..--] [85].[bits 72 to 95] ∈ UNINITIALIZED [85].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [85].f5 ∈ [--..--] [85].[bits 136 to 159] ∈ UNINITIALIZED [86].f1 ∈ [--..--] [86].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [86].f3 ∈ [--..--] [86].[bits 72 to 95] ∈ UNINITIALIZED [86].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [86].f5 ∈ [--..--] [86].[bits 136 to 159] ∈ UNINITIALIZED [87].f1 ∈ [--..--] [87].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [87].f3 ∈ [--..--] [87].[bits 72 to 95] ∈ UNINITIALIZED [87].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [87].f5 ∈ [--..--] [87].[bits 136 to 159] ∈ UNINITIALIZED [88].f1 ∈ [--..--] [88].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [88].f3 ∈ [--..--] [88].[bits 72 to 95] ∈ UNINITIALIZED [88].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [88].f5 ∈ [--..--] [88].[bits 136 to 159] ∈ UNINITIALIZED [89].f1 ∈ [--..--] [89].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [89].f3 ∈ [--..--] [89].[bits 72 to 95] ∈ UNINITIALIZED [89].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [89].f5 ∈ [--..--] [89].[bits 136 to 159] ∈ UNINITIALIZED [90].f1 ∈ [--..--] [90].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [90].f3 ∈ [--..--] [90].[bits 72 to 95] ∈ UNINITIALIZED [90].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [90].f5 ∈ [--..--] [90].[bits 136 to 159] ∈ UNINITIALIZED [91].f1 ∈ [--..--] [91].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [91].f3 ∈ [--..--] [91].[bits 72 to 95] ∈ UNINITIALIZED [91].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [91].f5 ∈ [--..--] [91].[bits 136 to 159] ∈ UNINITIALIZED [92].f1 ∈ [--..--] [92].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [92].f3 ∈ [--..--] [92].[bits 72 to 95] ∈ UNINITIALIZED [92].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [92].f5 ∈ [--..--] [92].[bits 136 to 159] ∈ UNINITIALIZED [93].f1 ∈ [--..--] [93].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [93].f3 ∈ [--..--] [93].[bits 72 to 95] ∈ UNINITIALIZED [93].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [93].f5 ∈ [--..--] [93].[bits 136 to 159] ∈ UNINITIALIZED [94].f1 ∈ [--..--] [94].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [94].f3 ∈ [--..--] [94].[bits 72 to 95] ∈ UNINITIALIZED [94].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [94].f5 ∈ [--..--] [94].[bits 136 to 159] ∈ UNINITIALIZED [95].f1 ∈ [--..--] [95].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [95].f3 ∈ [--..--] [95].[bits 72 to 95] ∈ UNINITIALIZED [95].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [95].f5 ∈ [--..--] [95].[bits 136 to 159] ∈ UNINITIALIZED [96].f1 ∈ [--..--] [96].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [96].f3 ∈ [--..--] [96].[bits 72 to 95] ∈ UNINITIALIZED [96].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [96].f5 ∈ [--..--] [96].[bits 136 to 159] ∈ UNINITIALIZED [97].f1 ∈ [--..--] [97].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [97].f3 ∈ [--..--] [97].[bits 72 to 95] ∈ UNINITIALIZED [97].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [97].f5 ∈ [--..--] [97].[bits 136 to 159] ∈ UNINITIALIZED [98].f1 ∈ [--..--] [98].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [98].f3 ∈ [--..--] [98].[bits 72 to 95] ∈ UNINITIALIZED [98].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [98].f5 ∈ [--..--] [98].[bits 136 to 159] ∈ UNINITIALIZED [99].f1 ∈ [--..--] [99].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [99].f3 ∈ [--..--] [99].[bits 72 to 95] ∈ UNINITIALIZED [99].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [99].f5 ∈ [--..--] [99].[bits 136 to 159] ∈ UNINITIALIZED [100].f1 ∈ [--..--] [100].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [100].f3 ∈ [--..--] [100].[bits 72 to 95] ∈ UNINITIALIZED [100].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [100].f5 ∈ [--..--] [100].[bits 136 to 159] ∈ UNINITIALIZED [101].f1 ∈ [--..--] [101].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [101].f3 ∈ [--..--] [101].[bits 72 to 95] ∈ UNINITIALIZED [101].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [101].f5 ∈ [--..--] [101].[bits 136 to 159] ∈ UNINITIALIZED [102].f1 ∈ [--..--] [102].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [102].f3 ∈ [--..--] [102].[bits 72 to 95] ∈ UNINITIALIZED [102].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [102].f5 ∈ [--..--] [102].[bits 136 to 159] ∈ UNINITIALIZED [103].f1 ∈ [--..--] [103].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [103].f3 ∈ [--..--] [103].[bits 72 to 95] ∈ UNINITIALIZED [103].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [103].f5 ∈ [--..--] [103].[bits 136 to 159] ∈ UNINITIALIZED [104].f1 ∈ [--..--] [104].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [104].f3 ∈ [--..--] [104].[bits 72 to 95] ∈ UNINITIALIZED [104].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [104].f5 ∈ [--..--] [104].[bits 136 to 159] ∈ UNINITIALIZED [105].f1 ∈ [--..--] [105].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [105].f3 ∈ [--..--] [105].[bits 72 to 95] ∈ UNINITIALIZED [105].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [105].f5 ∈ [--..--] [105].[bits 136 to 159] ∈ UNINITIALIZED [106].f1 ∈ [--..--] [106].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [106].f3 ∈ [--..--] [106].[bits 72 to 95] ∈ UNINITIALIZED [106].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [106].f5 ∈ [--..--] [106].[bits 136 to 159] ∈ UNINITIALIZED [107].f1 ∈ [--..--] [107].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [107].f3 ∈ [--..--] [107].[bits 72 to 95] ∈ UNINITIALIZED [107].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [107].f5 ∈ [--..--] [107].[bits 136 to 159] ∈ UNINITIALIZED [108].f1 ∈ [--..--] [108].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [108].f3 ∈ [--..--] [108].[bits 72 to 95] ∈ UNINITIALIZED [108].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [108].f5 ∈ [--..--] [108].[bits 136 to 159] ∈ UNINITIALIZED [109].f1 ∈ [--..--] [109].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [109].f3 ∈ [--..--] [109].[bits 72 to 95] ∈ UNINITIALIZED [109].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [109].f5 ∈ [--..--] [109].[bits 136 to 159] ∈ UNINITIALIZED [110].f1 ∈ [--..--] [110].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [110].f3 ∈ [--..--] [110].[bits 72 to 95] ∈ UNINITIALIZED [110].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [110].f5 ∈ [--..--] [110].[bits 136 to 159] ∈ UNINITIALIZED [111].f1 ∈ [--..--] [111].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [111].f3 ∈ [--..--] [111].[bits 72 to 95] ∈ UNINITIALIZED [111].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [111].f5 ∈ [--..--] [111].[bits 136 to 159] ∈ UNINITIALIZED [112].f1 ∈ [--..--] [112].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [112].f3 ∈ [--..--] [112].[bits 72 to 95] ∈ UNINITIALIZED [112].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [112].f5 ∈ [--..--] [112].[bits 136 to 159] ∈ UNINITIALIZED [113].f1 ∈ [--..--] [113].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [113].f3 ∈ [--..--] [113].[bits 72 to 95] ∈ UNINITIALIZED [113].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [113].f5 ∈ [--..--] [113].[bits 136 to 159] ∈ UNINITIALIZED [114].f1 ∈ [--..--] [114].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [114].f3 ∈ [--..--] [114].[bits 72 to 95] ∈ UNINITIALIZED [114].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [114].f5 ∈ [--..--] [114].[bits 136 to 159] ∈ UNINITIALIZED [115].f1 ∈ [--..--] [115].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [115].f3 ∈ [--..--] [115].[bits 72 to 95] ∈ UNINITIALIZED [115].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [115].f5 ∈ [--..--] [115].[bits 136 to 159] ∈ UNINITIALIZED [116].f1 ∈ [--..--] [116].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [116].f3 ∈ [--..--] [116].[bits 72 to 95] ∈ UNINITIALIZED [116].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [116].f5 ∈ [--..--] [116].[bits 136 to 159] ∈ UNINITIALIZED [117].f1 ∈ [--..--] [117].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [117].f3 ∈ [--..--] [117].[bits 72 to 95] ∈ UNINITIALIZED [117].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [117].f5 ∈ [--..--] [117].[bits 136 to 159] ∈ UNINITIALIZED [118].f1 ∈ [--..--] [118].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [118].f3 ∈ [--..--] [118].[bits 72 to 95] ∈ UNINITIALIZED [118].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [118].f5 ∈ [--..--] [118].[bits 136 to 159] ∈ UNINITIALIZED [119].f1 ∈ [--..--] [119].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [119].f3 ∈ [--..--] [119].[bits 72 to 95] ∈ UNINITIALIZED [119].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [119].f5 ∈ [--..--] [119].[bits 136 to 159] ∈ UNINITIALIZED [120].f1 ∈ [--..--] [120].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [120].f3 ∈ [--..--] [120].[bits 72 to 95] ∈ UNINITIALIZED [120].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [120].f5 ∈ [--..--] [120].[bits 136 to 159] ∈ UNINITIALIZED [121].f1 ∈ [--..--] [121].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [121].f3 ∈ [--..--] [121].[bits 72 to 95] ∈ UNINITIALIZED [121].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [121].f5 ∈ [--..--] [121].[bits 136 to 159] ∈ UNINITIALIZED [122].f1 ∈ [--..--] [122].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [122].f3 ∈ [--..--] [122].[bits 72 to 95] ∈ UNINITIALIZED [122].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [122].f5 ∈ [--..--] [122].[bits 136 to 159] ∈ UNINITIALIZED [123].f1 ∈ [--..--] [123].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [123].f3 ∈ [--..--] [123].[bits 72 to 95] ∈ UNINITIALIZED [123].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [123].f5 ∈ [--..--] [123].[bits 136 to 159] ∈ UNINITIALIZED [124].f1 ∈ [--..--] [124].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [124].f3 ∈ [--..--] [124].[bits 72 to 95] ∈ UNINITIALIZED [124].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [124].f5 ∈ [--..--] [124].[bits 136 to 159] ∈ UNINITIALIZED [125].f1 ∈ [--..--] [125].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [125].f3 ∈ [--..--] [125].[bits 72 to 95] ∈ UNINITIALIZED [125].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [125].f5 ∈ [--..--] [125].[bits 136 to 159] ∈ UNINITIALIZED [126].f1 ∈ [--..--] [126].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [126].f3 ∈ [--..--] [126].[bits 72 to 95] ∈ UNINITIALIZED [126].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [126].f5 ∈ [--..--] [126].[bits 136 to 159] ∈ UNINITIALIZED [127].f1 ∈ [--..--] [127].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [127].f3 ∈ [--..--] [127].[bits 72 to 95] ∈ UNINITIALIZED [127].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [127].f5 ∈ [--..--] [127].[bits 136 to 159] ∈ UNINITIALIZED [128].f1 ∈ [--..--] [128].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [128].f3 ∈ [--..--] [128].[bits 72 to 95] ∈ UNINITIALIZED [128].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [128].f5 ∈ [--..--] [128].[bits 136 to 159] ∈ UNINITIALIZED [129].f1 ∈ [--..--] [129].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [129].f3 ∈ [--..--] [129].[bits 72 to 95] ∈ UNINITIALIZED [129].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [129].f5 ∈ [--..--] [129].[bits 136 to 159] ∈ UNINITIALIZED [130].f1 ∈ [--..--] [130].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [130].f3 ∈ [--..--] [130].[bits 72 to 95] ∈ UNINITIALIZED [130].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [130].f5 ∈ [--..--] [130].[bits 136 to 159] ∈ UNINITIALIZED [131].f1 ∈ [--..--] [131].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [131].f3 ∈ [--..--] [131].[bits 72 to 95] ∈ UNINITIALIZED [131].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [131].f5 ∈ [--..--] [131].[bits 136 to 159] ∈ UNINITIALIZED [132].f1 ∈ [--..--] [132].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [132].f3 ∈ [--..--] [132].[bits 72 to 95] ∈ UNINITIALIZED [132].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [132].f5 ∈ [--..--] [132].[bits 136 to 159] ∈ UNINITIALIZED [133].f1 ∈ [--..--] [133].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [133].f3 ∈ [--..--] [133].[bits 72 to 95] ∈ UNINITIALIZED [133].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [133].f5 ∈ [--..--] [133].[bits 136 to 159] ∈ UNINITIALIZED [134].f1 ∈ [--..--] [134].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [134].f3 ∈ [--..--] [134].[bits 72 to 95] ∈ UNINITIALIZED [134].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [134].f5 ∈ [--..--] [134].[bits 136 to 159] ∈ UNINITIALIZED [135].f1 ∈ [--..--] [135].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [135].f3 ∈ [--..--] [135].[bits 72 to 95] ∈ UNINITIALIZED [135].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [135].f5 ∈ [--..--] [135].[bits 136 to 159] ∈ UNINITIALIZED [136].f1 ∈ [--..--] [136].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [136].f3 ∈ [--..--] [136].[bits 72 to 95] ∈ UNINITIALIZED [136].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [136].f5 ∈ [--..--] [136].[bits 136 to 159] ∈ UNINITIALIZED [137].f1 ∈ [--..--] [137].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [137].f3 ∈ [--..--] [137].[bits 72 to 95] ∈ UNINITIALIZED [137].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [137].f5 ∈ [--..--] [137].[bits 136 to 159] ∈ UNINITIALIZED [138].f1 ∈ [--..--] [138].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [138].f3 ∈ [--..--] [138].[bits 72 to 95] ∈ UNINITIALIZED [138].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [138].f5 ∈ [--..--] [138].[bits 136 to 159] ∈ UNINITIALIZED [139].f1 ∈ [--..--] [139].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [139].f3 ∈ [--..--] [139].[bits 72 to 95] ∈ UNINITIALIZED [139].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [139].f5 ∈ [--..--] [139].[bits 136 to 159] ∈ UNINITIALIZED [140].f1 ∈ [--..--] [140].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [140].f3 ∈ [--..--] [140].[bits 72 to 95] ∈ UNINITIALIZED [140].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [140].f5 ∈ [--..--] [140].[bits 136 to 159] ∈ UNINITIALIZED [141].f1 ∈ [--..--] [141].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [141].f3 ∈ [--..--] [141].[bits 72 to 95] ∈ UNINITIALIZED [141].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [141].f5 ∈ [--..--] [141].[bits 136 to 159] ∈ UNINITIALIZED [142].f1 ∈ [--..--] [142].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [142].f3 ∈ [--..--] [142].[bits 72 to 95] ∈ UNINITIALIZED [142].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [142].f5 ∈ [--..--] [142].[bits 136 to 159] ∈ UNINITIALIZED [143].f1 ∈ [--..--] [143].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [143].f3 ∈ [--..--] [143].[bits 72 to 95] ∈ UNINITIALIZED [143].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [143].f5 ∈ [--..--] [143].[bits 136 to 159] ∈ UNINITIALIZED [144].f1 ∈ [--..--] [144].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [144].f3 ∈ [--..--] [144].[bits 72 to 95] ∈ UNINITIALIZED [144].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [144].f5 ∈ [--..--] [144].[bits 136 to 159] ∈ UNINITIALIZED [145].f1 ∈ [--..--] [145].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [145].f3 ∈ [--..--] [145].[bits 72 to 95] ∈ UNINITIALIZED [145].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [145].f5 ∈ [--..--] [145].[bits 136 to 159] ∈ UNINITIALIZED [146].f1 ∈ [--..--] [146].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [146].f3 ∈ [--..--] [146].[bits 72 to 95] ∈ UNINITIALIZED [146].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [146].f5 ∈ [--..--] [146].[bits 136 to 159] ∈ UNINITIALIZED [147].f1 ∈ [--..--] [147].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [147].f3 ∈ [--..--] [147].[bits 72 to 95] ∈ UNINITIALIZED [147].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [147].f5 ∈ [--..--] [147].[bits 136 to 159] ∈ UNINITIALIZED [148].f1 ∈ [--..--] [148].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [148].f3 ∈ [--..--] [148].[bits 72 to 95] ∈ UNINITIALIZED [148].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [148].f5 ∈ [--..--] [148].[bits 136 to 159] ∈ UNINITIALIZED [149].f1 ∈ [--..--] [149].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [149].f3 ∈ [--..--] [149].[bits 72 to 95] ∈ UNINITIALIZED [149].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [149].f5 ∈ [--..--] [149].[bits 136 to 159] ∈ UNINITIALIZED [150].f1 ∈ [--..--] [150].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [150].f3 ∈ [--..--] [150].[bits 72 to 95] ∈ UNINITIALIZED [150].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [150].f5 ∈ [--..--] [150].[bits 136 to 159] ∈ UNINITIALIZED [151].f1 ∈ [--..--] [151].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [151].f3 ∈ [--..--] [151].[bits 72 to 95] ∈ UNINITIALIZED [151].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [151].f5 ∈ [--..--] [151].[bits 136 to 159] ∈ UNINITIALIZED [152].f1 ∈ [--..--] [152].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [152].f3 ∈ [--..--] [152].[bits 72 to 95] ∈ UNINITIALIZED [152].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [152].f5 ∈ [--..--] [152].[bits 136 to 159] ∈ UNINITIALIZED [153].f1 ∈ [--..--] [153].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [153].f3 ∈ [--..--] [153].[bits 72 to 95] ∈ UNINITIALIZED [153].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [153].f5 ∈ [--..--] [153].[bits 136 to 159] ∈ UNINITIALIZED [154].f1 ∈ [--..--] [154].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [154].f3 ∈ [--..--] [154].[bits 72 to 95] ∈ UNINITIALIZED [154].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [154].f5 ∈ [--..--] [154].[bits 136 to 159] ∈ UNINITIALIZED [155].f1 ∈ [--..--] [155].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [155].f3 ∈ [--..--] [155].[bits 72 to 95] ∈ UNINITIALIZED [155].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [155].f5 ∈ [--..--] [155].[bits 136 to 159] ∈ UNINITIALIZED [156].f1 ∈ [--..--] [156].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [156].f3 ∈ [--..--] [156].[bits 72 to 95] ∈ UNINITIALIZED [156].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [156].f5 ∈ [--..--] [156].[bits 136 to 159] ∈ UNINITIALIZED [157].f1 ∈ [--..--] [157].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [157].f3 ∈ [--..--] [157].[bits 72 to 95] ∈ UNINITIALIZED [157].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [157].f5 ∈ [--..--] [157].[bits 136 to 159] ∈ UNINITIALIZED [158].f1 ∈ [--..--] [158].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [158].f3 ∈ [--..--] [158].[bits 72 to 95] ∈ UNINITIALIZED [158].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [158].f5 ∈ [--..--] [158].[bits 136 to 159] ∈ UNINITIALIZED [159].f1 ∈ [--..--] [159].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [159].f3 ∈ [--..--] [159].[bits 72 to 95] ∈ UNINITIALIZED [159].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [159].f5 ∈ [--..--] [159].[bits 136 to 159] ∈ UNINITIALIZED [160].f1 ∈ [--..--] [160].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [160].f3 ∈ [--..--] [160].[bits 72 to 95] ∈ UNINITIALIZED [160].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [160].f5 ∈ [--..--] [160].[bits 136 to 159] ∈ UNINITIALIZED [161].f1 ∈ [--..--] [161].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [161].f3 ∈ [--..--] [161].[bits 72 to 95] ∈ UNINITIALIZED [161].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [161].f5 ∈ [--..--] [161].[bits 136 to 159] ∈ UNINITIALIZED [162].f1 ∈ [--..--] [162].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [162].f3 ∈ [--..--] [162].[bits 72 to 95] ∈ UNINITIALIZED [162].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [162].f5 ∈ [--..--] [162].[bits 136 to 159] ∈ UNINITIALIZED [163].f1 ∈ [--..--] [163].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [163].f3 ∈ [--..--] [163].[bits 72 to 95] ∈ UNINITIALIZED [163].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [163].f5 ∈ [--..--] [163].[bits 136 to 159] ∈ UNINITIALIZED [164].f1 ∈ [--..--] [164].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [164].f3 ∈ [--..--] [164].[bits 72 to 95] ∈ UNINITIALIZED [164].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [164].f5 ∈ [--..--] [164].[bits 136 to 159] ∈ UNINITIALIZED [165].f1 ∈ [--..--] [165].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [165].f3 ∈ [--..--] [165].[bits 72 to 95] ∈ UNINITIALIZED [165].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [165].f5 ∈ [--..--] [165].[bits 136 to 159] ∈ UNINITIALIZED [166].f1 ∈ [--..--] [166].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [166].f3 ∈ [--..--] [166].[bits 72 to 95] ∈ UNINITIALIZED [166].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [166].f5 ∈ [--..--] [166].[bits 136 to 159] ∈ UNINITIALIZED [167].f1 ∈ [--..--] [167].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [167].f3 ∈ [--..--] [167].[bits 72 to 95] ∈ UNINITIALIZED [167].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [167].f5 ∈ [--..--] [167].[bits 136 to 159] ∈ UNINITIALIZED [168].f1 ∈ [--..--] [168].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [168].f3 ∈ [--..--] [168].[bits 72 to 95] ∈ UNINITIALIZED [168].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [168].f5 ∈ [--..--] [168].[bits 136 to 159] ∈ UNINITIALIZED [169].f1 ∈ [--..--] [169].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [169].f3 ∈ [--..--] [169].[bits 72 to 95] ∈ UNINITIALIZED [169].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [169].f5 ∈ [--..--] [169].[bits 136 to 159] ∈ UNINITIALIZED [170].f1 ∈ [--..--] [170].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [170].f3 ∈ [--..--] [170].[bits 72 to 95] ∈ UNINITIALIZED [170].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [170].f5 ∈ [--..--] [170].[bits 136 to 159] ∈ UNINITIALIZED [171].f1 ∈ [--..--] [171].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [171].f3 ∈ [--..--] [171].[bits 72 to 95] ∈ UNINITIALIZED [171].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [171].f5 ∈ [--..--] [171].[bits 136 to 159] ∈ UNINITIALIZED [172].f1 ∈ [--..--] [172].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [172].f3 ∈ [--..--] [172].[bits 72 to 95] ∈ UNINITIALIZED [172].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [172].f5 ∈ [--..--] [172].[bits 136 to 159] ∈ UNINITIALIZED [173].f1 ∈ [--..--] [173].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [173].f3 ∈ [--..--] [173].[bits 72 to 95] ∈ UNINITIALIZED [173].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [173].f5 ∈ [--..--] [173].[bits 136 to 159] ∈ UNINITIALIZED [174].f1 ∈ [--..--] [174].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [174].f3 ∈ [--..--] [174].[bits 72 to 95] ∈ UNINITIALIZED [174].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [174].f5 ∈ [--..--] [174].[bits 136 to 159] ∈ UNINITIALIZED [175].f1 ∈ [--..--] [175].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [175].f3 ∈ [--..--] [175].[bits 72 to 95] ∈ UNINITIALIZED [175].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [175].f5 ∈ [--..--] [175].[bits 136 to 159] ∈ UNINITIALIZED [176].f1 ∈ [--..--] [176].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [176].f3 ∈ [--..--] [176].[bits 72 to 95] ∈ UNINITIALIZED [176].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [176].f5 ∈ [--..--] [176].[bits 136 to 159] ∈ UNINITIALIZED [177].f1 ∈ [--..--] [177].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [177].f3 ∈ [--..--] [177].[bits 72 to 95] ∈ UNINITIALIZED [177].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [177].f5 ∈ [--..--] [177].[bits 136 to 159] ∈ UNINITIALIZED [178].f1 ∈ [--..--] [178].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [178].f3 ∈ [--..--] [178].[bits 72 to 95] ∈ UNINITIALIZED [178].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [178].f5 ∈ [--..--] [178].[bits 136 to 159] ∈ UNINITIALIZED [179].f1 ∈ [--..--] [179].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [179].f3 ∈ [--..--] [179].[bits 72 to 95] ∈ UNINITIALIZED [179].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [179].f5 ∈ [--..--] [179].[bits 136 to 159] ∈ UNINITIALIZED [180].f1 ∈ [--..--] [180].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [180].f3 ∈ [--..--] [180].[bits 72 to 95] ∈ UNINITIALIZED [180].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [180].f5 ∈ [--..--] [180].[bits 136 to 159] ∈ UNINITIALIZED [181].f1 ∈ [--..--] [181].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [181].f3 ∈ [--..--] [181].[bits 72 to 95] ∈ UNINITIALIZED [181].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [181].f5 ∈ [--..--] [181].[bits 136 to 159] ∈ UNINITIALIZED [182].f1 ∈ [--..--] [182].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [182].f3 ∈ [--..--] [182].[bits 72 to 95] ∈ UNINITIALIZED [182].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [182].f5 ∈ [--..--] [182].[bits 136 to 159] ∈ UNINITIALIZED [183].f1 ∈ [--..--] [183].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [183].f3 ∈ [--..--] [183].[bits 72 to 95] ∈ UNINITIALIZED [183].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [183].f5 ∈ [--..--] [183].[bits 136 to 159] ∈ UNINITIALIZED [184].f1 ∈ [--..--] [184].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [184].f3 ∈ [--..--] [184].[bits 72 to 95] ∈ UNINITIALIZED [184].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [184].f5 ∈ [--..--] [184].[bits 136 to 159] ∈ UNINITIALIZED [185].f1 ∈ [--..--] [185].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [185].f3 ∈ [--..--] [185].[bits 72 to 95] ∈ UNINITIALIZED [185].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [185].f5 ∈ [--..--] [185].[bits 136 to 159] ∈ UNINITIALIZED [186].f1 ∈ [--..--] [186].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [186].f3 ∈ [--..--] [186].[bits 72 to 95] ∈ UNINITIALIZED [186].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [186].f5 ∈ [--..--] [186].[bits 136 to 159] ∈ UNINITIALIZED [187].f1 ∈ [--..--] [187].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [187].f3 ∈ [--..--] [187].[bits 72 to 95] ∈ UNINITIALIZED [187].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [187].f5 ∈ [--..--] [187].[bits 136 to 159] ∈ UNINITIALIZED [188].f1 ∈ [--..--] [188].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [188].f3 ∈ [--..--] [188].[bits 72 to 95] ∈ UNINITIALIZED [188].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [188].f5 ∈ [--..--] [188].[bits 136 to 159] ∈ UNINITIALIZED [189].f1 ∈ [--..--] [189].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [189].f3 ∈ [--..--] [189].[bits 72 to 95] ∈ UNINITIALIZED [189].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [189].f5 ∈ [--..--] [189].[bits 136 to 159] ∈ UNINITIALIZED [190].f1 ∈ [--..--] [190].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [190].f3 ∈ [--..--] [190].[bits 72 to 95] ∈ UNINITIALIZED [190].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [190].f5 ∈ [--..--] [190].[bits 136 to 159] ∈ UNINITIALIZED [191].f1 ∈ [--..--] [191].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [191].f3 ∈ [--..--] [191].[bits 72 to 95] ∈ UNINITIALIZED [191].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [191].f5 ∈ [--..--] [191].[bits 136 to 159] ∈ UNINITIALIZED [192].f1 ∈ [--..--] [192].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [192].f3 ∈ [--..--] [192].[bits 72 to 95] ∈ UNINITIALIZED [192].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [192].f5 ∈ [--..--] [192].[bits 136 to 159] ∈ UNINITIALIZED [193].f1 ∈ [--..--] [193].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [193].f3 ∈ [--..--] [193].[bits 72 to 95] ∈ UNINITIALIZED [193].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [193].f5 ∈ [--..--] [193].[bits 136 to 159] ∈ UNINITIALIZED [194].f1 ∈ [--..--] [194].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [194].f3 ∈ [--..--] [194].[bits 72 to 95] ∈ UNINITIALIZED [194].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [194].f5 ∈ [--..--] [194].[bits 136 to 159] ∈ UNINITIALIZED [195].f1 ∈ [--..--] [195].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [195].f3 ∈ [--..--] [195].[bits 72 to 95] ∈ UNINITIALIZED [195].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [195].f5 ∈ [--..--] [195].[bits 136 to 159] ∈ UNINITIALIZED [196].f1 ∈ [--..--] [196].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [196].f3 ∈ [--..--] [196].[bits 72 to 95] ∈ UNINITIALIZED [196].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [196].f5 ∈ [--..--] [196].[bits 136 to 159] ∈ UNINITIALIZED [197].f1 ∈ [--..--] [197].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [197].f3 ∈ [--..--] [197].[bits 72 to 95] ∈ UNINITIALIZED [197].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [197].f5 ∈ [--..--] [197].[bits 136 to 159] ∈ UNINITIALIZED [198].f1 ∈ [--..--] [198].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [198].f3 ∈ [--..--] [198].[bits 72 to 95] ∈ UNINITIALIZED [198].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [198].f5 ∈ [--..--] [198].[bits 136 to 159] ∈ UNINITIALIZED [199].f1 ∈ [--..--] [199].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [199].f3 ∈ [--..--] [199].[bits 72 to 95] ∈ UNINITIALIZED [199].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [199].f5 ∈ [--..--] [199].[bits 136 to 159] ∈ UNINITIALIZED [200].f1 ∈ [--..--] [200].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [200].f3 ∈ [--..--] [200].[bits 72 to 95] ∈ UNINITIALIZED [200].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [200].f5 ∈ [--..--] [200].[bits 136 to 159] ∈ UNINITIALIZED [201].f1 ∈ [--..--] [201].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [201].f3 ∈ [--..--] [201].[bits 72 to 95] ∈ UNINITIALIZED [201].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [201].f5 ∈ [--..--] [201].[bits 136 to 159] ∈ UNINITIALIZED [202].f1 ∈ [--..--] [202].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [202].f3 ∈ [--..--] [202].[bits 72 to 95] ∈ UNINITIALIZED [202].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [202].f5 ∈ [--..--] [202].[bits 136 to 159] ∈ UNINITIALIZED [203].f1 ∈ [--..--] [203].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [203].f3 ∈ [--..--] [203].[bits 72 to 95] ∈ UNINITIALIZED [203].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [203].f5 ∈ [--..--] [203].[bits 136 to 159] ∈ UNINITIALIZED [204].f1 ∈ [--..--] [204].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [204].f3 ∈ [--..--] [204].[bits 72 to 95] ∈ UNINITIALIZED [204].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [204].f5 ∈ [--..--] [204].[bits 136 to 159] ∈ UNINITIALIZED [205].f1 ∈ [--..--] [205].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [205].f3 ∈ [--..--] [205].[bits 72 to 95] ∈ UNINITIALIZED [205].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [205].f5 ∈ [--..--] [205].[bits 136 to 159] ∈ UNINITIALIZED [206].f1 ∈ [--..--] [206].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [206].f3 ∈ [--..--] [206].[bits 72 to 95] ∈ UNINITIALIZED [206].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [206].f5 ∈ [--..--] [206].[bits 136 to 159] ∈ UNINITIALIZED [207].f1 ∈ [--..--] [207].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [207].f3 ∈ [--..--] [207].[bits 72 to 95] ∈ UNINITIALIZED [207].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [207].f5 ∈ [--..--] [207].[bits 136 to 159] ∈ UNINITIALIZED [208].f1 ∈ [--..--] [208].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [208].f3 ∈ [--..--] [208].[bits 72 to 95] ∈ UNINITIALIZED [208].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [208].f5 ∈ [--..--] [208].[bits 136 to 159] ∈ UNINITIALIZED [209].f1 ∈ [--..--] [209].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [209].f3 ∈ [--..--] [209].[bits 72 to 95] ∈ UNINITIALIZED [209].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [209].f5 ∈ [--..--] [209].[bits 136 to 159] ∈ UNINITIALIZED [210].f1 ∈ [--..--] [210].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [210].f3 ∈ [--..--] [210].[bits 72 to 95] ∈ UNINITIALIZED [210].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [210].f5 ∈ [--..--] [210].[bits 136 to 159] ∈ UNINITIALIZED [211].f1 ∈ [--..--] [211].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [211].f3 ∈ [--..--] [211].[bits 72 to 95] ∈ UNINITIALIZED [211].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [211].f5 ∈ [--..--] [211].[bits 136 to 159] ∈ UNINITIALIZED [212].f1 ∈ [--..--] [212].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [212].f3 ∈ [--..--] [212].[bits 72 to 95] ∈ UNINITIALIZED [212].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [212].f5 ∈ [--..--] [212].[bits 136 to 159] ∈ UNINITIALIZED [213].f1 ∈ [--..--] [213].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [213].f3 ∈ [--..--] [213].[bits 72 to 95] ∈ UNINITIALIZED [213].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [213].f5 ∈ [--..--] [213].[bits 136 to 159] ∈ UNINITIALIZED [214].f1 ∈ [--..--] [214].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [214].f3 ∈ [--..--] [214].[bits 72 to 95] ∈ UNINITIALIZED [214].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [214].f5 ∈ [--..--] [214].[bits 136 to 159] ∈ UNINITIALIZED [215].f1 ∈ [--..--] [215].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [215].f3 ∈ [--..--] [215].[bits 72 to 95] ∈ UNINITIALIZED [215].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [215].f5 ∈ [--..--] [215].[bits 136 to 159] ∈ UNINITIALIZED [216].f1 ∈ [--..--] [216].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [216].f3 ∈ [--..--] [216].[bits 72 to 95] ∈ UNINITIALIZED [216].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [216].f5 ∈ [--..--] [216].[bits 136 to 159] ∈ UNINITIALIZED [217].f1 ∈ [--..--] [217].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [217].f3 ∈ [--..--] [217].[bits 72 to 95] ∈ UNINITIALIZED [217].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [217].f5 ∈ [--..--] [217].[bits 136 to 159] ∈ UNINITIALIZED [218].f1 ∈ [--..--] [218].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [218].f3 ∈ [--..--] [218].[bits 72 to 95] ∈ UNINITIALIZED [218].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [218].f5 ∈ [--..--] [218].[bits 136 to 159] ∈ UNINITIALIZED [219].f1 ∈ [--..--] [219].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [219].f3 ∈ [--..--] [219].[bits 72 to 95] ∈ UNINITIALIZED [219].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [219].f5 ∈ [--..--] [219].[bits 136 to 159] ∈ UNINITIALIZED [220].f1 ∈ [--..--] [220].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [220].f3 ∈ [--..--] [220].[bits 72 to 95] ∈ UNINITIALIZED [220].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [220].f5 ∈ [--..--] [220].[bits 136 to 159] ∈ UNINITIALIZED [221].f1 ∈ [--..--] [221].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [221].f3 ∈ [--..--] [221].[bits 72 to 95] ∈ UNINITIALIZED [221].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [221].f5 ∈ [--..--] [221].[bits 136 to 159] ∈ UNINITIALIZED [222].f1 ∈ [--..--] [222].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [222].f3 ∈ [--..--] [222].[bits 72 to 95] ∈ UNINITIALIZED [222].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [222].f5 ∈ [--..--] [222].[bits 136 to 159] ∈ UNINITIALIZED [223].f1 ∈ [--..--] [223].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [223].f3 ∈ [--..--] [223].[bits 72 to 95] ∈ UNINITIALIZED [223].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [223].f5 ∈ [--..--] [223].[bits 136 to 159] ∈ UNINITIALIZED [224].f1 ∈ [--..--] [224].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [224].f3 ∈ [--..--] [224].[bits 72 to 95] ∈ UNINITIALIZED [224].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [224].f5 ∈ [--..--] [224].[bits 136 to 159] ∈ UNINITIALIZED [225].f1 ∈ [--..--] [225].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [225].f3 ∈ [--..--] [225].[bits 72 to 95] ∈ UNINITIALIZED [225].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [225].f5 ∈ [--..--] [225].[bits 136 to 159] ∈ UNINITIALIZED [226].f1 ∈ [--..--] [226].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [226].f3 ∈ [--..--] [226].[bits 72 to 95] ∈ UNINITIALIZED [226].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [226].f5 ∈ [--..--] [226].[bits 136 to 159] ∈ UNINITIALIZED [227].f1 ∈ [--..--] [227].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [227].f3 ∈ [--..--] [227].[bits 72 to 95] ∈ UNINITIALIZED [227].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [227].f5 ∈ [--..--] [227].[bits 136 to 159] ∈ UNINITIALIZED [228].f1 ∈ [--..--] [228].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [228].f3 ∈ [--..--] [228].[bits 72 to 95] ∈ UNINITIALIZED [228].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [228].f5 ∈ [--..--] [228].[bits 136 to 159] ∈ UNINITIALIZED [229].f1 ∈ [--..--] [229].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [229].f3 ∈ [--..--] [229].[bits 72 to 95] ∈ UNINITIALIZED [229].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [229].f5 ∈ [--..--] [229].[bits 136 to 159] ∈ UNINITIALIZED [230].f1 ∈ [--..--] [230].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [230].f3 ∈ [--..--] [230].[bits 72 to 95] ∈ UNINITIALIZED [230].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [230].f5 ∈ [--..--] [230].[bits 136 to 159] ∈ UNINITIALIZED [231].f1 ∈ [--..--] [231].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [231].f3 ∈ [--..--] [231].[bits 72 to 95] ∈ UNINITIALIZED [231].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [231].f5 ∈ [--..--] [231].[bits 136 to 159] ∈ UNINITIALIZED [232].f1 ∈ [--..--] [232].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [232].f3 ∈ [--..--] [232].[bits 72 to 95] ∈ UNINITIALIZED [232].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [232].f5 ∈ [--..--] [232].[bits 136 to 159] ∈ UNINITIALIZED [233].f1 ∈ [--..--] [233].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [233].f3 ∈ [--..--] [233].[bits 72 to 95] ∈ UNINITIALIZED [233].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [233].f5 ∈ [--..--] [233].[bits 136 to 159] ∈ UNINITIALIZED [234].f1 ∈ [--..--] [234].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [234].f3 ∈ [--..--] [234].[bits 72 to 95] ∈ UNINITIALIZED [234].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [234].f5 ∈ [--..--] [234].[bits 136 to 159] ∈ UNINITIALIZED [235].f1 ∈ [--..--] [235].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [235].f3 ∈ [--..--] [235].[bits 72 to 95] ∈ UNINITIALIZED [235].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [235].f5 ∈ [--..--] [235].[bits 136 to 159] ∈ UNINITIALIZED [236].f1 ∈ [--..--] [236].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [236].f3 ∈ [--..--] [236].[bits 72 to 95] ∈ UNINITIALIZED [236].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [236].f5 ∈ [--..--] [236].[bits 136 to 159] ∈ UNINITIALIZED [237].f1 ∈ [--..--] [237].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [237].f3 ∈ [--..--] [237].[bits 72 to 95] ∈ UNINITIALIZED [237].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [237].f5 ∈ [--..--] [237].[bits 136 to 159] ∈ UNINITIALIZED [238].f1 ∈ [--..--] [238].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [238].f3 ∈ [--..--] [238].[bits 72 to 95] ∈ UNINITIALIZED [238].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [238].f5 ∈ [--..--] [238].[bits 136 to 159] ∈ UNINITIALIZED [239].f1 ∈ [--..--] [239].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [239].f3 ∈ [--..--] [239].[bits 72 to 95] ∈ UNINITIALIZED [239].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [239].f5 ∈ [--..--] [239].[bits 136 to 159] ∈ UNINITIALIZED [240].f1 ∈ [--..--] [240].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [240].f3 ∈ [--..--] [240].[bits 72 to 95] ∈ UNINITIALIZED [240].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [240].f5 ∈ [--..--] [240].[bits 136 to 159] ∈ UNINITIALIZED [241].f1 ∈ [--..--] [241].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [241].f3 ∈ [--..--] [241].[bits 72 to 95] ∈ UNINITIALIZED [241].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [241].f5 ∈ [--..--] [241].[bits 136 to 159] ∈ UNINITIALIZED [242].f1 ∈ [--..--] [242].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [242].f3 ∈ [--..--] [242].[bits 72 to 95] ∈ UNINITIALIZED [242].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [242].f5 ∈ [--..--] [242].[bits 136 to 159] ∈ UNINITIALIZED [243].f1 ∈ [--..--] [243].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [243].f3 ∈ [--..--] [243].[bits 72 to 95] ∈ UNINITIALIZED [243].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [243].f5 ∈ [--..--] [243].[bits 136 to 159] ∈ UNINITIALIZED [244].f1 ∈ [--..--] [244].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [244].f3 ∈ [--..--] [244].[bits 72 to 95] ∈ UNINITIALIZED [244].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [244].f5 ∈ [--..--] [244].[bits 136 to 159] ∈ UNINITIALIZED [245].f1 ∈ [--..--] [245].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [245].f3 ∈ [--..--] [245].[bits 72 to 95] ∈ UNINITIALIZED [245].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [245].f5 ∈ [--..--] [245].[bits 136 to 159] ∈ UNINITIALIZED [246].f1 ∈ [--..--] [246].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [246].f3 ∈ [--..--] [246].[bits 72 to 95] ∈ UNINITIALIZED [246].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [246].f5 ∈ [--..--] [246].[bits 136 to 159] ∈ UNINITIALIZED [247].f1 ∈ [--..--] [247].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [247].f3 ∈ [--..--] [247].[bits 72 to 95] ∈ UNINITIALIZED [247].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [247].f5 ∈ [--..--] [247].[bits 136 to 159] ∈ UNINITIALIZED [248].f1 ∈ [--..--] [248].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [248].f3 ∈ [--..--] [248].[bits 72 to 95] ∈ UNINITIALIZED [248].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [248].f5 ∈ [--..--] [248].[bits 136 to 159] ∈ UNINITIALIZED [249].f1 ∈ [--..--] [249].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [249].f3 ∈ [--..--] [249].[bits 72 to 95] ∈ UNINITIALIZED [249].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [249].f5 ∈ [--..--] [249].[bits 136 to 159] ∈ UNINITIALIZED [250].f1 ∈ [--..--] [250].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [250].f3 ∈ [--..--] [250].[bits 72 to 95] ∈ UNINITIALIZED [250].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [250].f5 ∈ [--..--] [250].[bits 136 to 159] ∈ UNINITIALIZED [251].f1 ∈ [--..--] [251].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [251].f3 ∈ [--..--] [251].[bits 72 to 95] ∈ UNINITIALIZED [251].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [251].f5 ∈ [--..--] [251].[bits 136 to 159] ∈ UNINITIALIZED [252].f1 ∈ [--..--] [252].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [252].f3 ∈ [--..--] [252].[bits 72 to 95] ∈ UNINITIALIZED [252].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [252].f5 ∈ [--..--] [252].[bits 136 to 159] ∈ UNINITIALIZED [253].f1 ∈ [--..--] [253].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [253].f3 ∈ [--..--] [253].[bits 72 to 95] ∈ UNINITIALIZED [253].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [253].f5 ∈ [--..--] [253].[bits 136 to 159] ∈ UNINITIALIZED [254].f1 ∈ [--..--] [254].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [254].f3 ∈ [--..--] [254].[bits 72 to 95] ∈ UNINITIALIZED [254].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [254].f5 ∈ [--..--] [254].[bits 136 to 159] ∈ UNINITIALIZED [255].f1 ∈ [--..--] [255].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [255].f3 ∈ [--..--] [255].[bits 72 to 95] ∈ UNINITIALIZED [255].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [255].f5 ∈ [--..--] [255].[bits 136 to 159] ∈ UNINITIALIZED [256].f1 ∈ [--..--] [256].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [256].f3 ∈ [--..--] [256].[bits 72 to 95] ∈ UNINITIALIZED [256].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [256].f5 ∈ [--..--] [256].[bits 136 to 159] ∈ UNINITIALIZED [257].f1 ∈ [--..--] [257].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [257].f3 ∈ [--..--] [257].[bits 72 to 95] ∈ UNINITIALIZED [257].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [257].f5 ∈ [--..--] [257].[bits 136 to 159] ∈ UNINITIALIZED [258].f1 ∈ [--..--] [258].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [258].f3 ∈ [--..--] [258].[bits 72 to 95] ∈ UNINITIALIZED [258].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [258].f5 ∈ [--..--] [258].[bits 136 to 159] ∈ UNINITIALIZED [259].f1 ∈ [--..--] [259].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [259].f3 ∈ [--..--] [259].[bits 72 to 95] ∈ UNINITIALIZED [259].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [259].f5 ∈ [--..--] [259].[bits 136 to 159] ∈ UNINITIALIZED [260].f1 ∈ [--..--] [260].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [260].f3 ∈ [--..--] [260].[bits 72 to 95] ∈ UNINITIALIZED [260].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [260].f5 ∈ [--..--] [260].[bits 136 to 159] ∈ UNINITIALIZED [261].f1 ∈ [--..--] [261].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [261].f3 ∈ [--..--] [261].[bits 72 to 95] ∈ UNINITIALIZED [261].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [261].f5 ∈ [--..--] [261].[bits 136 to 159] ∈ UNINITIALIZED [262].f1 ∈ [--..--] [262].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [262].f3 ∈ [--..--] [262].[bits 72 to 95] ∈ UNINITIALIZED [262].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [262].f5 ∈ [--..--] [262].[bits 136 to 159] ∈ UNINITIALIZED [263].f1 ∈ [--..--] [263].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [263].f3 ∈ [--..--] [263].[bits 72 to 95] ∈ UNINITIALIZED [263].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [263].f5 ∈ [--..--] [263].[bits 136 to 159] ∈ UNINITIALIZED [264].f1 ∈ [--..--] [264].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [264].f3 ∈ [--..--] [264].[bits 72 to 95] ∈ UNINITIALIZED [264].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [264].f5 ∈ [--..--] [264].[bits 136 to 159] ∈ UNINITIALIZED [265].f1 ∈ [--..--] [265].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [265].f3 ∈ [--..--] [265].[bits 72 to 95] ∈ UNINITIALIZED [265].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [265].f5 ∈ [--..--] [265].[bits 136 to 159] ∈ UNINITIALIZED [266].f1 ∈ [--..--] [266].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [266].f3 ∈ [--..--] [266].[bits 72 to 95] ∈ UNINITIALIZED [266].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [266].f5 ∈ [--..--] [266].[bits 136 to 159] ∈ UNINITIALIZED [267].f1 ∈ [--..--] [267].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [267].f3 ∈ [--..--] [267].[bits 72 to 95] ∈ UNINITIALIZED [267].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [267].f5 ∈ [--..--] [267].[bits 136 to 159] ∈ UNINITIALIZED [268].f1 ∈ [--..--] [268].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [268].f3 ∈ [--..--] [268].[bits 72 to 95] ∈ UNINITIALIZED [268].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [268].f5 ∈ [--..--] [268].[bits 136 to 159] ∈ UNINITIALIZED [269].f1 ∈ [--..--] [269].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [269].f3 ∈ [--..--] [269].[bits 72 to 95] ∈ UNINITIALIZED [269].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [269].f5 ∈ [--..--] [269].[bits 136 to 159] ∈ UNINITIALIZED [270].f1 ∈ [--..--] [270].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [270].f3 ∈ [--..--] [270].[bits 72 to 95] ∈ UNINITIALIZED [270].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [270].f5 ∈ [--..--] [270].[bits 136 to 159] ∈ UNINITIALIZED [271].f1 ∈ [--..--] [271].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [271].f3 ∈ [--..--] [271].[bits 72 to 95] ∈ UNINITIALIZED [271].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [271].f5 ∈ [--..--] [271].[bits 136 to 159] ∈ UNINITIALIZED [272].f1 ∈ [--..--] [272].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [272].f3 ∈ [--..--] [272].[bits 72 to 95] ∈ UNINITIALIZED [272].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [272].f5 ∈ [--..--] [272].[bits 136 to 159] ∈ UNINITIALIZED [273].f1 ∈ [--..--] [273].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [273].f3 ∈ [--..--] [273].[bits 72 to 95] ∈ UNINITIALIZED [273].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [273].f5 ∈ [--..--] [273].[bits 136 to 159] ∈ UNINITIALIZED [274].f1 ∈ [--..--] [274].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [274].f3 ∈ [--..--] [274].[bits 72 to 95] ∈ UNINITIALIZED [274].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [274].f5 ∈ [--..--] [274].[bits 136 to 159] ∈ UNINITIALIZED [275].f1 ∈ [--..--] [275].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [275].f3 ∈ [--..--] [275].[bits 72 to 95] ∈ UNINITIALIZED [275].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [275].f5 ∈ [--..--] [275].[bits 136 to 159] ∈ UNINITIALIZED [276].f1 ∈ [--..--] [276].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [276].f3 ∈ [--..--] [276].[bits 72 to 95] ∈ UNINITIALIZED [276].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [276].f5 ∈ [--..--] [276].[bits 136 to 159] ∈ UNINITIALIZED [277].f1 ∈ [--..--] [277].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [277].f3 ∈ [--..--] [277].[bits 72 to 95] ∈ UNINITIALIZED [277].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [277].f5 ∈ [--..--] [277].[bits 136 to 159] ∈ UNINITIALIZED [278].f1 ∈ [--..--] [278].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [278].f3 ∈ [--..--] [278].[bits 72 to 95] ∈ UNINITIALIZED [278].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [278].f5 ∈ [--..--] [278].[bits 136 to 159] ∈ UNINITIALIZED [279].f1 ∈ [--..--] [279].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [279].f3 ∈ [--..--] [279].[bits 72 to 95] ∈ UNINITIALIZED [279].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [279].f5 ∈ [--..--] [279].[bits 136 to 159] ∈ UNINITIALIZED [280].f1 ∈ [--..--] [280].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [280].f3 ∈ [--..--] [280].[bits 72 to 95] ∈ UNINITIALIZED [280].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [280].f5 ∈ [--..--] [280].[bits 136 to 159] ∈ UNINITIALIZED [281].f1 ∈ [--..--] [281].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [281].f3 ∈ [--..--] [281].[bits 72 to 95] ∈ UNINITIALIZED [281].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [281].f5 ∈ [--..--] [281].[bits 136 to 159] ∈ UNINITIALIZED [282].f1 ∈ [--..--] [282].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [282].f3 ∈ [--..--] [282].[bits 72 to 95] ∈ UNINITIALIZED [282].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [282].f5 ∈ [--..--] [282].[bits 136 to 159] ∈ UNINITIALIZED [283].f1 ∈ [--..--] [283].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [283].f3 ∈ [--..--] [283].[bits 72 to 95] ∈ UNINITIALIZED [283].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [283].f5 ∈ [--..--] [283].[bits 136 to 159] ∈ UNINITIALIZED [284].f1 ∈ [--..--] [284].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [284].f3 ∈ [--..--] [284].[bits 72 to 95] ∈ UNINITIALIZED [284].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [284].f5 ∈ [--..--] [284].[bits 136 to 159] ∈ UNINITIALIZED [285].f1 ∈ [--..--] [285].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [285].f3 ∈ [--..--] [285].[bits 72 to 95] ∈ UNINITIALIZED [285].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [285].f5 ∈ [--..--] [285].[bits 136 to 159] ∈ UNINITIALIZED [286].f1 ∈ [--..--] [286].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [286].f3 ∈ [--..--] [286].[bits 72 to 95] ∈ UNINITIALIZED [286].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [286].f5 ∈ [--..--] [286].[bits 136 to 159] ∈ UNINITIALIZED [287].f1 ∈ [--..--] [287].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [287].f3 ∈ [--..--] [287].[bits 72 to 95] ∈ UNINITIALIZED [287].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [287].f5 ∈ [--..--] [287].[bits 136 to 159] ∈ UNINITIALIZED [288].f1 ∈ [--..--] [288].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [288].f3 ∈ [--..--] [288].[bits 72 to 95] ∈ UNINITIALIZED [288].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [288].f5 ∈ [--..--] [288].[bits 136 to 159] ∈ UNINITIALIZED [289].f1 ∈ [--..--] [289].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [289].f3 ∈ [--..--] [289].[bits 72 to 95] ∈ UNINITIALIZED [289].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [289].f5 ∈ [--..--] [289].[bits 136 to 159] ∈ UNINITIALIZED [290].f1 ∈ [--..--] [290].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [290].f3 ∈ [--..--] [290].[bits 72 to 95] ∈ UNINITIALIZED [290].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [290].f5 ∈ [--..--] [290].[bits 136 to 159] ∈ UNINITIALIZED [291].f1 ∈ [--..--] [291].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [291].f3 ∈ [--..--] [291].[bits 72 to 95] ∈ UNINITIALIZED [291].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [291].f5 ∈ [--..--] [291].[bits 136 to 159] ∈ UNINITIALIZED [292].f1 ∈ [--..--] [292].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [292].f3 ∈ [--..--] [292].[bits 72 to 95] ∈ UNINITIALIZED [292].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [292].f5 ∈ [--..--] [292].[bits 136 to 159] ∈ UNINITIALIZED [293].f1 ∈ [--..--] [293].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [293].f3 ∈ [--..--] [293].[bits 72 to 95] ∈ UNINITIALIZED [293].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [293].f5 ∈ [--..--] [293].[bits 136 to 159] ∈ UNINITIALIZED [294].f1 ∈ [--..--] [294].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [294].f3 ∈ [--..--] [294].[bits 72 to 95] ∈ UNINITIALIZED [294].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [294].f5 ∈ [--..--] [294].[bits 136 to 159] ∈ UNINITIALIZED [295].f1 ∈ [--..--] [295].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [295].f3 ∈ [--..--] [295].[bits 72 to 95] ∈ UNINITIALIZED [295].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [295].f5 ∈ [--..--] [295].[bits 136 to 159] ∈ UNINITIALIZED [296].f1 ∈ [--..--] [296].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [296].f3 ∈ [--..--] [296].[bits 72 to 95] ∈ UNINITIALIZED [296].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [296].f5 ∈ [--..--] [296].[bits 136 to 159] ∈ UNINITIALIZED [297].f1 ∈ [--..--] [297].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [297].f3 ∈ [--..--] [297].[bits 72 to 95] ∈ UNINITIALIZED [297].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [297].f5 ∈ [--..--] [297].[bits 136 to 159] ∈ UNINITIALIZED [298].f1 ∈ [--..--] [298].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [298].f3 ∈ [--..--] [298].[bits 72 to 95] ∈ UNINITIALIZED [298].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [298].f5 ∈ [--..--] [298].[bits 136 to 159] ∈ UNINITIALIZED [299].f1 ∈ [--..--] [299].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [299].f3 ∈ [--..--] [299].[bits 72 to 95] ∈ UNINITIALIZED [299].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [299].f5 ∈ [--..--] [299].[bits 136 to 159] ∈ UNINITIALIZED [300].f1 ∈ [--..--] [300].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [300].f3 ∈ [--..--] [300].[bits 72 to 95] ∈ UNINITIALIZED [300].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [300].f5 ∈ [--..--] [300].[bits 136 to 159] ∈ UNINITIALIZED [301].f1 ∈ [--..--] [301].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [301].f3 ∈ [--..--] [301].[bits 72 to 95] ∈ UNINITIALIZED [301].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [301].f5 ∈ [--..--] [301].[bits 136 to 159] ∈ UNINITIALIZED [302].f1 ∈ [--..--] [302].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [302].f3 ∈ [--..--] [302].[bits 72 to 95] ∈ UNINITIALIZED [302].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [302].f5 ∈ [--..--] [302].[bits 136 to 159] ∈ UNINITIALIZED [303].f1 ∈ [--..--] [303].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [303].f3 ∈ [--..--] [303].[bits 72 to 95] ∈ UNINITIALIZED [303].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [303].f5 ∈ [--..--] [303].[bits 136 to 159] ∈ UNINITIALIZED [304].f1 ∈ [--..--] [304].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [304].f3 ∈ [--..--] [304].[bits 72 to 95] ∈ UNINITIALIZED [304].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [304].f5 ∈ [--..--] [304].[bits 136 to 159] ∈ UNINITIALIZED [305].f1 ∈ [--..--] [305].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [305].f3 ∈ [--..--] [305].[bits 72 to 95] ∈ UNINITIALIZED [305].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [305].f5 ∈ [--..--] [305].[bits 136 to 159] ∈ UNINITIALIZED [306].f1 ∈ [--..--] [306].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [306].f3 ∈ [--..--] [306].[bits 72 to 95] ∈ UNINITIALIZED [306].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [306].f5 ∈ [--..--] [306].[bits 136 to 159] ∈ UNINITIALIZED [307].f1 ∈ [--..--] [307].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [307].f3 ∈ [--..--] [307].[bits 72 to 95] ∈ UNINITIALIZED [307].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [307].f5 ∈ [--..--] [307].[bits 136 to 159] ∈ UNINITIALIZED [308].f1 ∈ [--..--] [308].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [308].f3 ∈ [--..--] [308].[bits 72 to 95] ∈ UNINITIALIZED [308].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [308].f5 ∈ [--..--] [308].[bits 136 to 159] ∈ UNINITIALIZED [309].f1 ∈ [--..--] [309].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [309].f3 ∈ [--..--] [309].[bits 72 to 95] ∈ UNINITIALIZED [309].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [309].f5 ∈ [--..--] [309].[bits 136 to 159] ∈ UNINITIALIZED [310].f1 ∈ [--..--] [310].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [310].f3 ∈ [--..--] [310].[bits 72 to 95] ∈ UNINITIALIZED [310].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [310].f5 ∈ [--..--] [310].[bits 136 to 159] ∈ UNINITIALIZED [311].f1 ∈ [--..--] [311].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [311].f3 ∈ [--..--] [311].[bits 72 to 95] ∈ UNINITIALIZED [311].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [311].f5 ∈ [--..--] [311].[bits 136 to 159] ∈ UNINITIALIZED [312].f1 ∈ [--..--] [312].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [312].f3 ∈ [--..--] [312].[bits 72 to 95] ∈ UNINITIALIZED [312].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [312].f5 ∈ [--..--] [312].[bits 136 to 159] ∈ UNINITIALIZED [313].f1 ∈ [--..--] [313].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [313].f3 ∈ [--..--] [313].[bits 72 to 95] ∈ UNINITIALIZED [313].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [313].f5 ∈ [--..--] [313].[bits 136 to 159] ∈ UNINITIALIZED [314].f1 ∈ [--..--] [314].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [314].f3 ∈ [--..--] [314].[bits 72 to 95] ∈ UNINITIALIZED [314].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [314].f5 ∈ [--..--] [314].[bits 136 to 159] ∈ UNINITIALIZED [315].f1 ∈ [--..--] [315].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [315].f3 ∈ [--..--] [315].[bits 72 to 95] ∈ UNINITIALIZED [315].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [315].f5 ∈ [--..--] [315].[bits 136 to 159] ∈ UNINITIALIZED [316].f1 ∈ [--..--] [316].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [316].f3 ∈ [--..--] [316].[bits 72 to 95] ∈ UNINITIALIZED [316].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [316].f5 ∈ [--..--] [316].[bits 136 to 159] ∈ UNINITIALIZED [317].f1 ∈ [--..--] [317].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [317].f3 ∈ [--..--] [317].[bits 72 to 95] ∈ UNINITIALIZED [317].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [317].f5 ∈ [--..--] [317].[bits 136 to 159] ∈ UNINITIALIZED [318].f1 ∈ [--..--] [318].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [318].f3 ∈ [--..--] [318].[bits 72 to 95] ∈ UNINITIALIZED [318].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [318].f5 ∈ [--..--] [318].[bits 136 to 159] ∈ UNINITIALIZED [319].f1 ∈ [--..--] [319].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [319].f3 ∈ [--..--] [319].[bits 72 to 95] ∈ UNINITIALIZED [319].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [319].f5 ∈ [--..--] [319].[bits 136 to 159] ∈ UNINITIALIZED [320].f1 ∈ [--..--] [320].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [320].f3 ∈ [--..--] [320].[bits 72 to 95] ∈ UNINITIALIZED [320].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [320].f5 ∈ [--..--] [320].[bits 136 to 159] ∈ UNINITIALIZED [321].f1 ∈ [--..--] [321].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [321].f3 ∈ [--..--] [321].[bits 72 to 95] ∈ UNINITIALIZED [321].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [321].f5 ∈ [--..--] [321].[bits 136 to 159] ∈ UNINITIALIZED [322].f1 ∈ [--..--] [322].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [322].f3 ∈ [--..--] [322].[bits 72 to 95] ∈ UNINITIALIZED [322].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [322].f5 ∈ [--..--] [322].[bits 136 to 159] ∈ UNINITIALIZED [323].f1 ∈ [--..--] [323].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [323].f3 ∈ [--..--] [323].[bits 72 to 95] ∈ UNINITIALIZED [323].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [323].f5 ∈ [--..--] [323].[bits 136 to 159] ∈ UNINITIALIZED [324].f1 ∈ [--..--] [324].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [324].f3 ∈ [--..--] [324].[bits 72 to 95] ∈ UNINITIALIZED [324].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [324].f5 ∈ [--..--] [324].[bits 136 to 159] ∈ UNINITIALIZED [325].f1 ∈ [--..--] [325].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [325].f3 ∈ [--..--] [325].[bits 72 to 95] ∈ UNINITIALIZED [325].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [325].f5 ∈ [--..--] [325].[bits 136 to 159] ∈ UNINITIALIZED [326].f1 ∈ [--..--] [326].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [326].f3 ∈ [--..--] [326].[bits 72 to 95] ∈ UNINITIALIZED [326].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [326].f5 ∈ [--..--] [326].[bits 136 to 159] ∈ UNINITIALIZED [327].f1 ∈ [--..--] [327].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [327].f3 ∈ [--..--] [327].[bits 72 to 95] ∈ UNINITIALIZED [327].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [327].f5 ∈ [--..--] [327].[bits 136 to 159] ∈ UNINITIALIZED [328].f1 ∈ [--..--] [328].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [328].f3 ∈ [--..--] [328].[bits 72 to 95] ∈ UNINITIALIZED [328].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [328].f5 ∈ [--..--] [328].[bits 136 to 159] ∈ UNINITIALIZED [329].f1 ∈ [--..--] [329].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [329].f3 ∈ [--..--] [329].[bits 72 to 95] ∈ UNINITIALIZED [329].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [329].f5 ∈ [--..--] [329].[bits 136 to 159] ∈ UNINITIALIZED [330].f1 ∈ [--..--] [330].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [330].f3 ∈ [--..--] [330].[bits 72 to 95] ∈ UNINITIALIZED [330].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [330].f5 ∈ [--..--] [330].[bits 136 to 159] ∈ UNINITIALIZED [331].f1 ∈ [--..--] [331].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [331].f3 ∈ [--..--] [331].[bits 72 to 95] ∈ UNINITIALIZED [331].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [331].f5 ∈ [--..--] [331].[bits 136 to 159] ∈ UNINITIALIZED [332].f1 ∈ [--..--] [332].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [332].f3 ∈ [--..--] [332].[bits 72 to 95] ∈ UNINITIALIZED [332].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [332].f5 ∈ [--..--] [332].[bits 136 to 159] ∈ UNINITIALIZED [333].f1 ∈ [--..--] [333].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [333].f3 ∈ [--..--] [333].[bits 72 to 95] ∈ UNINITIALIZED [333].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [333].f5 ∈ [--..--] [333].[bits 136 to 159] ∈ UNINITIALIZED [334].f1 ∈ [--..--] [334].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [334].f3 ∈ [--..--] [334].[bits 72 to 95] ∈ UNINITIALIZED [334].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [334].f5 ∈ [--..--] [334].[bits 136 to 159] ∈ UNINITIALIZED [335].f1 ∈ [--..--] [335].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [335].f3 ∈ [--..--] [335].[bits 72 to 95] ∈ UNINITIALIZED [335].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [335].f5 ∈ [--..--] [335].[bits 136 to 159] ∈ UNINITIALIZED [336].f1 ∈ [--..--] [336].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [336].f3 ∈ [--..--] [336].[bits 72 to 95] ∈ UNINITIALIZED [336].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [336].f5 ∈ [--..--] [336].[bits 136 to 159] ∈ UNINITIALIZED [337].f1 ∈ [--..--] [337].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [337].f3 ∈ [--..--] [337].[bits 72 to 95] ∈ UNINITIALIZED [337].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [337].f5 ∈ [--..--] [337].[bits 136 to 159] ∈ UNINITIALIZED [338].f1 ∈ [--..--] [338].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [338].f3 ∈ [--..--] [338].[bits 72 to 95] ∈ UNINITIALIZED [338].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [338].f5 ∈ [--..--] [338].[bits 136 to 159] ∈ UNINITIALIZED [339].f1 ∈ [--..--] [339].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [339].f3 ∈ [--..--] [339].[bits 72 to 95] ∈ UNINITIALIZED [339].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [339].f5 ∈ [--..--] [339].[bits 136 to 159] ∈ UNINITIALIZED [340].f1 ∈ [--..--] [340].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [340].f3 ∈ [--..--] [340].[bits 72 to 95] ∈ UNINITIALIZED [340].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [340].f5 ∈ [--..--] [340].[bits 136 to 159] ∈ UNINITIALIZED [341].f1 ∈ [--..--] [341].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [341].f3 ∈ [--..--] [341].[bits 72 to 95] ∈ UNINITIALIZED [341].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [341].f5 ∈ [--..--] [341].[bits 136 to 159] ∈ UNINITIALIZED [342].f1 ∈ [--..--] [342].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [342].f3 ∈ [--..--] [342].[bits 72 to 95] ∈ UNINITIALIZED [342].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [342].f5 ∈ [--..--] [342].[bits 136 to 159] ∈ UNINITIALIZED [343].f1 ∈ [--..--] [343].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [343].f3 ∈ [--..--] [343].[bits 72 to 95] ∈ UNINITIALIZED [343].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [343].f5 ∈ [--..--] [343].[bits 136 to 159] ∈ UNINITIALIZED [344].f1 ∈ [--..--] [344].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [344].f3 ∈ [--..--] [344].[bits 72 to 95] ∈ UNINITIALIZED [344].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [344].f5 ∈ [--..--] [344].[bits 136 to 159] ∈ UNINITIALIZED [345].f1 ∈ [--..--] [345].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [345].f3 ∈ [--..--] [345].[bits 72 to 95] ∈ UNINITIALIZED [345].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [345].f5 ∈ [--..--] [345].[bits 136 to 159] ∈ UNINITIALIZED [346].f1 ∈ [--..--] [346].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [346].f3 ∈ [--..--] [346].[bits 72 to 95] ∈ UNINITIALIZED [346].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [346].f5 ∈ [--..--] [346].[bits 136 to 159] ∈ UNINITIALIZED [347].f1 ∈ [--..--] [347].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [347].f3 ∈ [--..--] [347].[bits 72 to 95] ∈ UNINITIALIZED [347].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [347].f5 ∈ [--..--] [347].[bits 136 to 159] ∈ UNINITIALIZED [348].f1 ∈ [--..--] [348].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [348].f3 ∈ [--..--] [348].[bits 72 to 95] ∈ UNINITIALIZED [348].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [348].f5 ∈ [--..--] [348].[bits 136 to 159] ∈ UNINITIALIZED [349].f1 ∈ [--..--] [349].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [349].f3 ∈ [--..--] [349].[bits 72 to 95] ∈ UNINITIALIZED [349].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [349].f5 ∈ [--..--] [349].[bits 136 to 159] ∈ UNINITIALIZED [350].f1 ∈ [--..--] [350].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [350].f3 ∈ [--..--] [350].[bits 72 to 95] ∈ UNINITIALIZED [350].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [350].f5 ∈ [--..--] [350].[bits 136 to 159] ∈ UNINITIALIZED [351].f1 ∈ [--..--] [351].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [351].f3 ∈ [--..--] [351].[bits 72 to 95] ∈ UNINITIALIZED [351].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [351].f5 ∈ [--..--] [351].[bits 136 to 159] ∈ UNINITIALIZED [352].f1 ∈ [--..--] [352].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [352].f3 ∈ [--..--] [352].[bits 72 to 95] ∈ UNINITIALIZED [352].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [352].f5 ∈ [--..--] [352].[bits 136 to 159] ∈ UNINITIALIZED [353].f1 ∈ [--..--] [353].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [353].f3 ∈ [--..--] [353].[bits 72 to 95] ∈ UNINITIALIZED [353].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [353].f5 ∈ [--..--] [353].[bits 136 to 159] ∈ UNINITIALIZED [354].f1 ∈ [--..--] [354].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [354].f3 ∈ [--..--] [354].[bits 72 to 95] ∈ UNINITIALIZED [354].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [354].f5 ∈ [--..--] [354].[bits 136 to 159] ∈ UNINITIALIZED [355].f1 ∈ [--..--] [355].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [355].f3 ∈ [--..--] [355].[bits 72 to 95] ∈ UNINITIALIZED [355].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [355].f5 ∈ [--..--] [355].[bits 136 to 159] ∈ UNINITIALIZED [356].f1 ∈ [--..--] [356].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [356].f3 ∈ [--..--] [356].[bits 72 to 95] ∈ UNINITIALIZED [356].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [356].f5 ∈ [--..--] [356].[bits 136 to 159] ∈ UNINITIALIZED [357].f1 ∈ [--..--] [357].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [357].f3 ∈ [--..--] [357].[bits 72 to 95] ∈ UNINITIALIZED [357].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [357].f5 ∈ [--..--] [357].[bits 136 to 159] ∈ UNINITIALIZED [358].f1 ∈ [--..--] [358].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [358].f3 ∈ [--..--] [358].[bits 72 to 95] ∈ UNINITIALIZED [358].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [358].f5 ∈ [--..--] [358].[bits 136 to 159] ∈ UNINITIALIZED [359].f1 ∈ [--..--] [359].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [359].f3 ∈ [--..--] [359].[bits 72 to 95] ∈ UNINITIALIZED [359].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [359].f5 ∈ [--..--] [359].[bits 136 to 159] ∈ UNINITIALIZED [360].f1 ∈ [--..--] [360].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [360].f3 ∈ [--..--] [360].[bits 72 to 95] ∈ UNINITIALIZED [360].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [360].f5 ∈ [--..--] [360].[bits 136 to 159] ∈ UNINITIALIZED [361].f1 ∈ [--..--] [361].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [361].f3 ∈ [--..--] [361].[bits 72 to 95] ∈ UNINITIALIZED [361].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [361].f5 ∈ [--..--] [361].[bits 136 to 159] ∈ UNINITIALIZED [362].f1 ∈ [--..--] [362].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [362].f3 ∈ [--..--] [362].[bits 72 to 95] ∈ UNINITIALIZED [362].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [362].f5 ∈ [--..--] [362].[bits 136 to 159] ∈ UNINITIALIZED [363].f1 ∈ [--..--] [363].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [363].f3 ∈ [--..--] [363].[bits 72 to 95] ∈ UNINITIALIZED [363].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [363].f5 ∈ [--..--] [363].[bits 136 to 159] ∈ UNINITIALIZED [364].f1 ∈ [--..--] [364].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [364].f3 ∈ [--..--] [364].[bits 72 to 95] ∈ UNINITIALIZED [364].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [364].f5 ∈ [--..--] [364].[bits 136 to 159] ∈ UNINITIALIZED [365].f1 ∈ [--..--] [365].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [365].f3 ∈ [--..--] [365].[bits 72 to 95] ∈ UNINITIALIZED [365].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [365].f5 ∈ [--..--] [365].[bits 136 to 159] ∈ UNINITIALIZED [366].f1 ∈ [--..--] [366].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [366].f3 ∈ [--..--] [366].[bits 72 to 95] ∈ UNINITIALIZED [366].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [366].f5 ∈ [--..--] [366].[bits 136 to 159] ∈ UNINITIALIZED [367].f1 ∈ [--..--] [367].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [367].f3 ∈ [--..--] [367].[bits 72 to 95] ∈ UNINITIALIZED [367].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [367].f5 ∈ [--..--] [367].[bits 136 to 159] ∈ UNINITIALIZED [368].f1 ∈ [--..--] [368].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [368].f3 ∈ [--..--] [368].[bits 72 to 95] ∈ UNINITIALIZED [368].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [368].f5 ∈ [--..--] [368].[bits 136 to 159] ∈ UNINITIALIZED [369].f1 ∈ [--..--] [369].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [369].f3 ∈ [--..--] [369].[bits 72 to 95] ∈ UNINITIALIZED [369].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [369].f5 ∈ [--..--] [369].[bits 136 to 159] ∈ UNINITIALIZED [370].f1 ∈ [--..--] [370].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [370].f3 ∈ [--..--] [370].[bits 72 to 95] ∈ UNINITIALIZED [370].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [370].f5 ∈ [--..--] [370].[bits 136 to 159] ∈ UNINITIALIZED [371].f1 ∈ [--..--] [371].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [371].f3 ∈ [--..--] [371].[bits 72 to 95] ∈ UNINITIALIZED [371].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [371].f5 ∈ [--..--] [371].[bits 136 to 159] ∈ UNINITIALIZED [372].f1 ∈ [--..--] [372].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [372].f3 ∈ [--..--] [372].[bits 72 to 95] ∈ UNINITIALIZED [372].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [372].f5 ∈ [--..--] [372].[bits 136 to 159] ∈ UNINITIALIZED [373].f1 ∈ [--..--] [373].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [373].f3 ∈ [--..--] [373].[bits 72 to 95] ∈ UNINITIALIZED [373].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [373].f5 ∈ [--..--] [373].[bits 136 to 159] ∈ UNINITIALIZED [374].f1 ∈ [--..--] [374].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [374].f3 ∈ [--..--] [374].[bits 72 to 95] ∈ UNINITIALIZED [374].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [374].f5 ∈ [--..--] [374].[bits 136 to 159] ∈ UNINITIALIZED [375].f1 ∈ [--..--] [375].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [375].f3 ∈ [--..--] [375].[bits 72 to 95] ∈ UNINITIALIZED [375].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [375].f5 ∈ [--..--] [375].[bits 136 to 159] ∈ UNINITIALIZED [376].f1 ∈ [--..--] [376].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [376].f3 ∈ [--..--] [376].[bits 72 to 95] ∈ UNINITIALIZED [376].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [376].f5 ∈ [--..--] [376].[bits 136 to 159] ∈ UNINITIALIZED [377].f1 ∈ [--..--] [377].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [377].f3 ∈ [--..--] [377].[bits 72 to 95] ∈ UNINITIALIZED [377].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [377].f5 ∈ [--..--] [377].[bits 136 to 159] ∈ UNINITIALIZED [378].f1 ∈ [--..--] [378].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [378].f3 ∈ [--..--] [378].[bits 72 to 95] ∈ UNINITIALIZED [378].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [378].f5 ∈ [--..--] [378].[bits 136 to 159] ∈ UNINITIALIZED [379].f1 ∈ [--..--] [379].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [379].f3 ∈ [--..--] [379].[bits 72 to 95] ∈ UNINITIALIZED [379].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [379].f5 ∈ [--..--] [379].[bits 136 to 159] ∈ UNINITIALIZED [380].f1 ∈ [--..--] [380].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [380].f3 ∈ [--..--] [380].[bits 72 to 95] ∈ UNINITIALIZED [380].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [380].f5 ∈ [--..--] [380].[bits 136 to 159] ∈ UNINITIALIZED [381].f1 ∈ [--..--] [381].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [381].f3 ∈ [--..--] [381].[bits 72 to 95] ∈ UNINITIALIZED [381].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [381].f5 ∈ [--..--] [381].[bits 136 to 159] ∈ UNINITIALIZED [382].f1 ∈ [--..--] [382].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [382].f3 ∈ [--..--] [382].[bits 72 to 95] ∈ UNINITIALIZED [382].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [382].f5 ∈ [--..--] [382].[bits 136 to 159] ∈ UNINITIALIZED [383].f1 ∈ [--..--] [383].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [383].f3 ∈ [--..--] [383].[bits 72 to 95] ∈ UNINITIALIZED [383].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [383].f5 ∈ [--..--] [383].[bits 136 to 159] ∈ UNINITIALIZED [384].f1 ∈ [--..--] [384].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [384].f3 ∈ [--..--] [384].[bits 72 to 95] ∈ UNINITIALIZED [384].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [384].f5 ∈ [--..--] [384].[bits 136 to 159] ∈ UNINITIALIZED [385].f1 ∈ [--..--] [385].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [385].f3 ∈ [--..--] [385].[bits 72 to 95] ∈ UNINITIALIZED [385].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [385].f5 ∈ [--..--] [385].[bits 136 to 159] ∈ UNINITIALIZED [386].f1 ∈ [--..--] [386].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [386].f3 ∈ [--..--] [386].[bits 72 to 95] ∈ UNINITIALIZED [386].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [386].f5 ∈ [--..--] [386].[bits 136 to 159] ∈ UNINITIALIZED [387].f1 ∈ [--..--] [387].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [387].f3 ∈ [--..--] [387].[bits 72 to 95] ∈ UNINITIALIZED [387].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [387].f5 ∈ [--..--] [387].[bits 136 to 159] ∈ UNINITIALIZED [388].f1 ∈ [--..--] [388].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [388].f3 ∈ [--..--] [388].[bits 72 to 95] ∈ UNINITIALIZED [388].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [388].f5 ∈ [--..--] [388].[bits 136 to 159] ∈ UNINITIALIZED [389].f1 ∈ [--..--] [389].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [389].f3 ∈ [--..--] [389].[bits 72 to 95] ∈ UNINITIALIZED [389].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [389].f5 ∈ [--..--] [389].[bits 136 to 159] ∈ UNINITIALIZED [390].f1 ∈ [--..--] [390].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [390].f3 ∈ [--..--] [390].[bits 72 to 95] ∈ UNINITIALIZED [390].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [390].f5 ∈ [--..--] [390].[bits 136 to 159] ∈ UNINITIALIZED [391].f1 ∈ [--..--] [391].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [391].f3 ∈ [--..--] [391].[bits 72 to 95] ∈ UNINITIALIZED [391].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [391].f5 ∈ [--..--] [391].[bits 136 to 159] ∈ UNINITIALIZED [392].f1 ∈ [--..--] [392].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [392].f3 ∈ [--..--] [392].[bits 72 to 95] ∈ UNINITIALIZED [392].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [392].f5 ∈ [--..--] [392].[bits 136 to 159] ∈ UNINITIALIZED [393].f1 ∈ [--..--] [393].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [393].f3 ∈ [--..--] [393].[bits 72 to 95] ∈ UNINITIALIZED [393].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [393].f5 ∈ [--..--] [393].[bits 136 to 159] ∈ UNINITIALIZED [394].f1 ∈ [--..--] [394].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [394].f3 ∈ [--..--] [394].[bits 72 to 95] ∈ UNINITIALIZED [394].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [394].f5 ∈ [--..--] [394].[bits 136 to 159] ∈ UNINITIALIZED [395].f1 ∈ [--..--] [395].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [395].f3 ∈ [--..--] [395].[bits 72 to 95] ∈ UNINITIALIZED [395].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [395].f5 ∈ [--..--] [395].[bits 136 to 159] ∈ UNINITIALIZED [396].f1 ∈ [--..--] [396].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [396].f3 ∈ [--..--] [396].[bits 72 to 95] ∈ UNINITIALIZED [396].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [396].f5 ∈ [--..--] [396].[bits 136 to 159] ∈ UNINITIALIZED [397].f1 ∈ [--..--] [397].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [397].f3 ∈ [--..--] [397].[bits 72 to 95] ∈ UNINITIALIZED [397].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [397].f5 ∈ [--..--] [397].[bits 136 to 159] ∈ UNINITIALIZED [398].f1 ∈ [--..--] [398].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [398].f3 ∈ [--..--] [398].[bits 72 to 95] ∈ UNINITIALIZED [398].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [398].f5 ∈ [--..--] [398].[bits 136 to 159] ∈ UNINITIALIZED [399].f1 ∈ [--..--] [399].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [399].f3 ∈ [--..--] [399].[bits 72 to 95] ∈ UNINITIALIZED [399].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [399].f5 ∈ [--..--] [399].[bits 136 to 159] ∈ UNINITIALIZED [400].f1 ∈ [--..--] [400].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [400].f3 ∈ [--..--] [400].[bits 72 to 95] ∈ UNINITIALIZED [400].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [400].f5 ∈ [--..--] [400].[bits 136 to 159] ∈ UNINITIALIZED [401].f1 ∈ [--..--] [401].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [401].f3 ∈ [--..--] [401].[bits 72 to 95] ∈ UNINITIALIZED [401].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [401].f5 ∈ [--..--] [401].[bits 136 to 159] ∈ UNINITIALIZED [402].f1 ∈ [--..--] [402].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [402].f3 ∈ [--..--] [402].[bits 72 to 95] ∈ UNINITIALIZED [402].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [402].f5 ∈ [--..--] [402].[bits 136 to 159] ∈ UNINITIALIZED [403].f1 ∈ [--..--] [403].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [403].f3 ∈ [--..--] [403].[bits 72 to 95] ∈ UNINITIALIZED [403].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [403].f5 ∈ [--..--] [403].[bits 136 to 159] ∈ UNINITIALIZED [404].f1 ∈ [--..--] [404].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [404].f3 ∈ [--..--] [404].[bits 72 to 95] ∈ UNINITIALIZED [404].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [404].f5 ∈ [--..--] [404].[bits 136 to 159] ∈ UNINITIALIZED [405].f1 ∈ [--..--] [405].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [405].f3 ∈ [--..--] [405].[bits 72 to 95] ∈ UNINITIALIZED [405].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [405].f5 ∈ [--..--] [405].[bits 136 to 159] ∈ UNINITIALIZED [406].f1 ∈ [--..--] [406].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [406].f3 ∈ [--..--] [406].[bits 72 to 95] ∈ UNINITIALIZED [406].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [406].f5 ∈ [--..--] [406].[bits 136 to 159] ∈ UNINITIALIZED [407].f1 ∈ [--..--] [407].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [407].f3 ∈ [--..--] [407].[bits 72 to 95] ∈ UNINITIALIZED [407].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [407].f5 ∈ [--..--] [407].[bits 136 to 159] ∈ UNINITIALIZED [408].f1 ∈ [--..--] [408].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [408].f3 ∈ [--..--] [408].[bits 72 to 95] ∈ UNINITIALIZED [408].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [408].f5 ∈ [--..--] [408].[bits 136 to 159] ∈ UNINITIALIZED [409].f1 ∈ [--..--] [409].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [409].f3 ∈ [--..--] [409].[bits 72 to 95] ∈ UNINITIALIZED [409].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [409].f5 ∈ [--..--] [409].[bits 136 to 159] ∈ UNINITIALIZED [410].f1 ∈ [--..--] [410].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [410].f3 ∈ [--..--] [410].[bits 72 to 95] ∈ UNINITIALIZED [410].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [410].f5 ∈ [--..--] [410].[bits 136 to 159] ∈ UNINITIALIZED [411].f1 ∈ [--..--] [411].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [411].f3 ∈ [--..--] [411].[bits 72 to 95] ∈ UNINITIALIZED [411].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [411].f5 ∈ [--..--] [411].[bits 136 to 159] ∈ UNINITIALIZED [412].f1 ∈ [--..--] [412].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [412].f3 ∈ [--..--] [412].[bits 72 to 95] ∈ UNINITIALIZED [412].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [412].f5 ∈ [--..--] [412].[bits 136 to 159] ∈ UNINITIALIZED [413].f1 ∈ [--..--] [413].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [413].f3 ∈ [--..--] [413].[bits 72 to 95] ∈ UNINITIALIZED [413].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [413].f5 ∈ [--..--] [413].[bits 136 to 159] ∈ UNINITIALIZED [414].f1 ∈ [--..--] [414].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [414].f3 ∈ [--..--] [414].[bits 72 to 95] ∈ UNINITIALIZED [414].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [414].f5 ∈ [--..--] [414].[bits 136 to 159] ∈ UNINITIALIZED [415].f1 ∈ [--..--] [415].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [415].f3 ∈ [--..--] [415].[bits 72 to 95] ∈ UNINITIALIZED [415].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [415].f5 ∈ [--..--] [415].[bits 136 to 159] ∈ UNINITIALIZED [416].f1 ∈ [--..--] [416].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [416].f3 ∈ [--..--] [416].[bits 72 to 95] ∈ UNINITIALIZED [416].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [416].f5 ∈ [--..--] [416].[bits 136 to 159] ∈ UNINITIALIZED [417].f1 ∈ [--..--] [417].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [417].f3 ∈ [--..--] [417].[bits 72 to 95] ∈ UNINITIALIZED [417].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [417].f5 ∈ [--..--] [417].[bits 136 to 159] ∈ UNINITIALIZED [418].f1 ∈ [--..--] [418].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [418].f3 ∈ [--..--] [418].[bits 72 to 95] ∈ UNINITIALIZED [418].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [418].f5 ∈ [--..--] [418].[bits 136 to 159] ∈ UNINITIALIZED [419].f1 ∈ [--..--] [419].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [419].f3 ∈ [--..--] [419].[bits 72 to 95] ∈ UNINITIALIZED [419].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [419].f5 ∈ [--..--] [419].[bits 136 to 159] ∈ UNINITIALIZED [420].f1 ∈ [--..--] [420].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [420].f3 ∈ [--..--] [420].[bits 72 to 95] ∈ UNINITIALIZED [420].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [420].f5 ∈ [--..--] [420].[bits 136 to 159] ∈ UNINITIALIZED [421].f1 ∈ [--..--] [421].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [421].f3 ∈ [--..--] [421].[bits 72 to 95] ∈ UNINITIALIZED [421].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [421].f5 ∈ [--..--] [421].[bits 136 to 159] ∈ UNINITIALIZED [422].f1 ∈ [--..--] [422].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [422].f3 ∈ [--..--] [422].[bits 72 to 95] ∈ UNINITIALIZED [422].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [422].f5 ∈ [--..--] [422].[bits 136 to 159] ∈ UNINITIALIZED [423].f1 ∈ [--..--] [423].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [423].f3 ∈ [--..--] [423].[bits 72 to 95] ∈ UNINITIALIZED [423].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [423].f5 ∈ [--..--] [423].[bits 136 to 159] ∈ UNINITIALIZED [424].f1 ∈ [--..--] [424].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [424].f3 ∈ [--..--] [424].[bits 72 to 95] ∈ UNINITIALIZED [424].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [424].f5 ∈ [--..--] [424].[bits 136 to 159] ∈ UNINITIALIZED [425].f1 ∈ [--..--] [425].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [425].f3 ∈ [--..--] [425].[bits 72 to 95] ∈ UNINITIALIZED [425].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [425].f5 ∈ [--..--] [425].[bits 136 to 159] ∈ UNINITIALIZED [426].f1 ∈ [--..--] [426].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [426].f3 ∈ [--..--] [426].[bits 72 to 95] ∈ UNINITIALIZED [426].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [426].f5 ∈ [--..--] [426].[bits 136 to 159] ∈ UNINITIALIZED [427].f1 ∈ [--..--] [427].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [427].f3 ∈ [--..--] [427].[bits 72 to 95] ∈ UNINITIALIZED [427].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [427].f5 ∈ [--..--] [427].[bits 136 to 159] ∈ UNINITIALIZED [428].f1 ∈ [--..--] [428].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [428].f3 ∈ [--..--] [428].[bits 72 to 95] ∈ UNINITIALIZED [428].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [428].f5 ∈ [--..--] [428].[bits 136 to 159] ∈ UNINITIALIZED [429].f1 ∈ [--..--] [429].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [429].f3 ∈ [--..--] [429].[bits 72 to 95] ∈ UNINITIALIZED [429].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [429].f5 ∈ [--..--] [429].[bits 136 to 159] ∈ UNINITIALIZED [430].f1 ∈ [--..--] [430].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [430].f3 ∈ [--..--] [430].[bits 72 to 95] ∈ UNINITIALIZED [430].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [430].f5 ∈ [--..--] [430].[bits 136 to 159] ∈ UNINITIALIZED [431].f1 ∈ [--..--] [431].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [431].f3 ∈ [--..--] [431].[bits 72 to 95] ∈ UNINITIALIZED [431].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [431].f5 ∈ [--..--] [431].[bits 136 to 159] ∈ UNINITIALIZED [432].f1 ∈ [--..--] [432].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [432].f3 ∈ [--..--] [432].[bits 72 to 95] ∈ UNINITIALIZED [432].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [432].f5 ∈ [--..--] [432].[bits 136 to 159] ∈ UNINITIALIZED [433].f1 ∈ [--..--] [433].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [433].f3 ∈ [--..--] [433].[bits 72 to 95] ∈ UNINITIALIZED [433].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [433].f5 ∈ [--..--] [433].[bits 136 to 159] ∈ UNINITIALIZED [434].f1 ∈ [--..--] [434].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [434].f3 ∈ [--..--] [434].[bits 72 to 95] ∈ UNINITIALIZED [434].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [434].f5 ∈ [--..--] [434].[bits 136 to 159] ∈ UNINITIALIZED [435].f1 ∈ [--..--] [435].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [435].f3 ∈ [--..--] [435].[bits 72 to 95] ∈ UNINITIALIZED [435].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [435].f5 ∈ [--..--] [435].[bits 136 to 159] ∈ UNINITIALIZED [436].f1 ∈ [--..--] [436].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [436].f3 ∈ [--..--] [436].[bits 72 to 95] ∈ UNINITIALIZED [436].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [436].f5 ∈ [--..--] [436].[bits 136 to 159] ∈ UNINITIALIZED [437].f1 ∈ [--..--] [437].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [437].f3 ∈ [--..--] [437].[bits 72 to 95] ∈ UNINITIALIZED [437].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [437].f5 ∈ [--..--] [437].[bits 136 to 159] ∈ UNINITIALIZED [438].f1 ∈ [--..--] [438].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [438].f3 ∈ [--..--] [438].[bits 72 to 95] ∈ UNINITIALIZED [438].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [438].f5 ∈ [--..--] [438].[bits 136 to 159] ∈ UNINITIALIZED [439].f1 ∈ [--..--] [439].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [439].f3 ∈ [--..--] [439].[bits 72 to 95] ∈ UNINITIALIZED [439].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [439].f5 ∈ [--..--] [439].[bits 136 to 159] ∈ UNINITIALIZED [440].f1 ∈ [--..--] [440].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [440].f3 ∈ [--..--] [440].[bits 72 to 95] ∈ UNINITIALIZED [440].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [440].f5 ∈ [--..--] [440].[bits 136 to 159] ∈ UNINITIALIZED [441].f1 ∈ [--..--] [441].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [441].f3 ∈ [--..--] [441].[bits 72 to 95] ∈ UNINITIALIZED [441].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [441].f5 ∈ [--..--] [441].[bits 136 to 159] ∈ UNINITIALIZED [442].f1 ∈ [--..--] [442].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [442].f3 ∈ [--..--] [442].[bits 72 to 95] ∈ UNINITIALIZED [442].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [442].f5 ∈ [--..--] [442].[bits 136 to 159] ∈ UNINITIALIZED [443].f1 ∈ [--..--] [443].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [443].f3 ∈ [--..--] [443].[bits 72 to 95] ∈ UNINITIALIZED [443].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [443].f5 ∈ [--..--] [443].[bits 136 to 159] ∈ UNINITIALIZED [444].f1 ∈ [--..--] [444].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [444].f3 ∈ [--..--] [444].[bits 72 to 95] ∈ UNINITIALIZED [444].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [444].f5 ∈ [--..--] [444].[bits 136 to 159] ∈ UNINITIALIZED [445].f1 ∈ [--..--] [445].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [445].f3 ∈ [--..--] [445].[bits 72 to 95] ∈ UNINITIALIZED [445].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [445].f5 ∈ [--..--] [445].[bits 136 to 159] ∈ UNINITIALIZED [446].f1 ∈ [--..--] [446].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [446].f3 ∈ [--..--] [446].[bits 72 to 95] ∈ UNINITIALIZED [446].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [446].f5 ∈ [--..--] [446].[bits 136 to 159] ∈ UNINITIALIZED [447].f1 ∈ [--..--] [447].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [447].f3 ∈ [--..--] [447].[bits 72 to 95] ∈ UNINITIALIZED [447].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [447].f5 ∈ [--..--] [447].[bits 136 to 159] ∈ UNINITIALIZED [448].f1 ∈ [--..--] [448].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [448].f3 ∈ [--..--] [448].[bits 72 to 95] ∈ UNINITIALIZED [448].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [448].f5 ∈ [--..--] [448].[bits 136 to 159] ∈ UNINITIALIZED [449].f1 ∈ [--..--] [449].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [449].f3 ∈ [--..--] [449].[bits 72 to 95] ∈ UNINITIALIZED [449].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [449].f5 ∈ [--..--] [449].[bits 136 to 159] ∈ UNINITIALIZED [450].f1 ∈ [--..--] [450].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [450].f3 ∈ [--..--] [450].[bits 72 to 95] ∈ UNINITIALIZED [450].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [450].f5 ∈ [--..--] [450].[bits 136 to 159] ∈ UNINITIALIZED [451].f1 ∈ [--..--] [451].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [451].f3 ∈ [--..--] [451].[bits 72 to 95] ∈ UNINITIALIZED [451].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [451].f5 ∈ [--..--] [451].[bits 136 to 159] ∈ UNINITIALIZED [452].f1 ∈ [--..--] [452].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [452].f3 ∈ [--..--] [452].[bits 72 to 95] ∈ UNINITIALIZED [452].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [452].f5 ∈ [--..--] [452].[bits 136 to 159] ∈ UNINITIALIZED [453].f1 ∈ [--..--] [453].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [453].f3 ∈ [--..--] [453].[bits 72 to 95] ∈ UNINITIALIZED [453].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [453].f5 ∈ [--..--] [453].[bits 136 to 159] ∈ UNINITIALIZED [454].f1 ∈ [--..--] [454].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [454].f3 ∈ [--..--] [454].[bits 72 to 95] ∈ UNINITIALIZED [454].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [454].f5 ∈ [--..--] [454].[bits 136 to 159] ∈ UNINITIALIZED [455].f1 ∈ [--..--] [455].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [455].f3 ∈ [--..--] [455].[bits 72 to 95] ∈ UNINITIALIZED [455].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [455].f5 ∈ [--..--] [455].[bits 136 to 159] ∈ UNINITIALIZED [456].f1 ∈ [--..--] [456].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [456].f3 ∈ [--..--] [456].[bits 72 to 95] ∈ UNINITIALIZED [456].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [456].f5 ∈ [--..--] [456].[bits 136 to 159] ∈ UNINITIALIZED [457].f1 ∈ [--..--] [457].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [457].f3 ∈ [--..--] [457].[bits 72 to 95] ∈ UNINITIALIZED [457].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [457].f5 ∈ [--..--] [457].[bits 136 to 159] ∈ UNINITIALIZED [458].f1 ∈ [--..--] [458].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [458].f3 ∈ [--..--] [458].[bits 72 to 95] ∈ UNINITIALIZED [458].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [458].f5 ∈ [--..--] [458].[bits 136 to 159] ∈ UNINITIALIZED [459].f1 ∈ [--..--] [459].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [459].f3 ∈ [--..--] [459].[bits 72 to 95] ∈ UNINITIALIZED [459].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [459].f5 ∈ [--..--] [459].[bits 136 to 159] ∈ UNINITIALIZED [460].f1 ∈ [--..--] [460].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [460].f3 ∈ [--..--] [460].[bits 72 to 95] ∈ UNINITIALIZED [460].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [460].f5 ∈ [--..--] [460].[bits 136 to 159] ∈ UNINITIALIZED [461].f1 ∈ [--..--] [461].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [461].f3 ∈ [--..--] [461].[bits 72 to 95] ∈ UNINITIALIZED [461].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [461].f5 ∈ [--..--] [461].[bits 136 to 159] ∈ UNINITIALIZED [462].f1 ∈ [--..--] [462].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [462].f3 ∈ [--..--] [462].[bits 72 to 95] ∈ UNINITIALIZED [462].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [462].f5 ∈ [--..--] [462].[bits 136 to 159] ∈ UNINITIALIZED [463].f1 ∈ [--..--] [463].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [463].f3 ∈ [--..--] [463].[bits 72 to 95] ∈ UNINITIALIZED [463].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [463].f5 ∈ [--..--] [463].[bits 136 to 159] ∈ UNINITIALIZED [464].f1 ∈ [--..--] [464].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [464].f3 ∈ [--..--] [464].[bits 72 to 95] ∈ UNINITIALIZED [464].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [464].f5 ∈ [--..--] [464].[bits 136 to 159] ∈ UNINITIALIZED [465].f1 ∈ [--..--] [465].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [465].f3 ∈ [--..--] [465].[bits 72 to 95] ∈ UNINITIALIZED [465].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [465].f5 ∈ [--..--] [465].[bits 136 to 159] ∈ UNINITIALIZED [466].f1 ∈ [--..--] [466].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [466].f3 ∈ [--..--] [466].[bits 72 to 95] ∈ UNINITIALIZED [466].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [466].f5 ∈ [--..--] [466].[bits 136 to 159] ∈ UNINITIALIZED [467].f1 ∈ [--..--] [467].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [467].f3 ∈ [--..--] [467].[bits 72 to 95] ∈ UNINITIALIZED [467].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [467].f5 ∈ [--..--] [467].[bits 136 to 159] ∈ UNINITIALIZED [468].f1 ∈ [--..--] [468].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [468].f3 ∈ [--..--] [468].[bits 72 to 95] ∈ UNINITIALIZED [468].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [468].f5 ∈ [--..--] [468].[bits 136 to 159] ∈ UNINITIALIZED [469].f1 ∈ [--..--] [469].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [469].f3 ∈ [--..--] [469].[bits 72 to 95] ∈ UNINITIALIZED [469].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [469].f5 ∈ [--..--] [469].[bits 136 to 159] ∈ UNINITIALIZED [470].f1 ∈ [--..--] [470].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [470].f3 ∈ [--..--] [470].[bits 72 to 95] ∈ UNINITIALIZED [470].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [470].f5 ∈ [--..--] [470].[bits 136 to 159] ∈ UNINITIALIZED [471].f1 ∈ [--..--] [471].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [471].f3 ∈ [--..--] [471].[bits 72 to 95] ∈ UNINITIALIZED [471].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [471].f5 ∈ [--..--] [471].[bits 136 to 159] ∈ UNINITIALIZED [472].f1 ∈ [--..--] [472].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [472].f3 ∈ [--..--] [472].[bits 72 to 95] ∈ UNINITIALIZED [472].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [472].f5 ∈ [--..--] [472].[bits 136 to 159] ∈ UNINITIALIZED [473].f1 ∈ [--..--] [473].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [473].f3 ∈ [--..--] [473].[bits 72 to 95] ∈ UNINITIALIZED [473].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [473].f5 ∈ [--..--] [473].[bits 136 to 159] ∈ UNINITIALIZED [474].f1 ∈ [--..--] [474].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [474].f3 ∈ [--..--] [474].[bits 72 to 95] ∈ UNINITIALIZED [474].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [474].f5 ∈ [--..--] [474].[bits 136 to 159] ∈ UNINITIALIZED [475].f1 ∈ [--..--] [475].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [475].f3 ∈ [--..--] [475].[bits 72 to 95] ∈ UNINITIALIZED [475].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [475].f5 ∈ [--..--] [475].[bits 136 to 159] ∈ UNINITIALIZED [476].f1 ∈ [--..--] [476].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [476].f3 ∈ [--..--] [476].[bits 72 to 95] ∈ UNINITIALIZED [476].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [476].f5 ∈ [--..--] [476].[bits 136 to 159] ∈ UNINITIALIZED [477].f1 ∈ [--..--] [477].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [477].f3 ∈ [--..--] [477].[bits 72 to 95] ∈ UNINITIALIZED [477].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [477].f5 ∈ [--..--] [477].[bits 136 to 159] ∈ UNINITIALIZED [478].f1 ∈ [--..--] [478].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [478].f3 ∈ [--..--] [478].[bits 72 to 95] ∈ UNINITIALIZED [478].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [478].f5 ∈ [--..--] [478].[bits 136 to 159] ∈ UNINITIALIZED [479].f1 ∈ [--..--] [479].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [479].f3 ∈ [--..--] [479].[bits 72 to 95] ∈ UNINITIALIZED [479].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [479].f5 ∈ [--..--] [479].[bits 136 to 159] ∈ UNINITIALIZED [480].f1 ∈ [--..--] [480].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [480].f3 ∈ [--..--] [480].[bits 72 to 95] ∈ UNINITIALIZED [480].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [480].f5 ∈ [--..--] [480].[bits 136 to 159] ∈ UNINITIALIZED [481].f1 ∈ [--..--] [481].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [481].f3 ∈ [--..--] [481].[bits 72 to 95] ∈ UNINITIALIZED [481].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [481].f5 ∈ [--..--] [481].[bits 136 to 159] ∈ UNINITIALIZED [482].f1 ∈ [--..--] [482].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [482].f3 ∈ [--..--] [482].[bits 72 to 95] ∈ UNINITIALIZED [482].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [482].f5 ∈ [--..--] [482].[bits 136 to 159] ∈ UNINITIALIZED [483].f1 ∈ [--..--] [483].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [483].f3 ∈ [--..--] [483].[bits 72 to 95] ∈ UNINITIALIZED [483].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [483].f5 ∈ [--..--] [483].[bits 136 to 159] ∈ UNINITIALIZED [484].f1 ∈ [--..--] [484].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [484].f3 ∈ [--..--] [484].[bits 72 to 95] ∈ UNINITIALIZED [484].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [484].f5 ∈ [--..--] [484].[bits 136 to 159] ∈ UNINITIALIZED [485].f1 ∈ [--..--] [485].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [485].f3 ∈ [--..--] [485].[bits 72 to 95] ∈ UNINITIALIZED [485].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [485].f5 ∈ [--..--] [485].[bits 136 to 159] ∈ UNINITIALIZED [486].f1 ∈ [--..--] [486].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [486].f3 ∈ [--..--] [486].[bits 72 to 95] ∈ UNINITIALIZED [486].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [486].f5 ∈ [--..--] [486].[bits 136 to 159] ∈ UNINITIALIZED [487].f1 ∈ [--..--] [487].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [487].f3 ∈ [--..--] [487].[bits 72 to 95] ∈ UNINITIALIZED [487].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [487].f5 ∈ [--..--] [487].[bits 136 to 159] ∈ UNINITIALIZED [488].f1 ∈ [--..--] [488].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [488].f3 ∈ [--..--] [488].[bits 72 to 95] ∈ UNINITIALIZED [488].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [488].f5 ∈ [--..--] [488].[bits 136 to 159] ∈ UNINITIALIZED [489].f1 ∈ [--..--] [489].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [489].f3 ∈ [--..--] [489].[bits 72 to 95] ∈ UNINITIALIZED [489].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [489].f5 ∈ [--..--] [489].[bits 136 to 159] ∈ UNINITIALIZED [490].f1 ∈ [--..--] [490].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [490].f3 ∈ [--..--] [490].[bits 72 to 95] ∈ UNINITIALIZED [490].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [490].f5 ∈ [--..--] [490].[bits 136 to 159] ∈ UNINITIALIZED [491].f1 ∈ [--..--] [491].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [491].f3 ∈ [--..--] [491].[bits 72 to 95] ∈ UNINITIALIZED [491].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [491].f5 ∈ [--..--] [491].[bits 136 to 159] ∈ UNINITIALIZED [492].f1 ∈ [--..--] [492].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [492].f3 ∈ [--..--] [492].[bits 72 to 95] ∈ UNINITIALIZED [492].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [492].f5 ∈ [--..--] [492].[bits 136 to 159] ∈ UNINITIALIZED [493].f1 ∈ [--..--] [493].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [493].f3 ∈ [--..--] [493].[bits 72 to 95] ∈ UNINITIALIZED [493].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [493].f5 ∈ [--..--] [493].[bits 136 to 159] ∈ UNINITIALIZED [494].f1 ∈ [--..--] [494].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [494].f3 ∈ [--..--] [494].[bits 72 to 95] ∈ UNINITIALIZED [494].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [494].f5 ∈ [--..--] [494].[bits 136 to 159] ∈ UNINITIALIZED [495].f1 ∈ [--..--] [495].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [495].f3 ∈ [--..--] [495].[bits 72 to 95] ∈ UNINITIALIZED [495].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [495].f5 ∈ [--..--] [495].[bits 136 to 159] ∈ UNINITIALIZED [496].f1 ∈ [--..--] [496].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [496].f3 ∈ [--..--] [496].[bits 72 to 95] ∈ UNINITIALIZED [496].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [496].f5 ∈ [--..--] [496].[bits 136 to 159] ∈ UNINITIALIZED [497].f1 ∈ [--..--] [497].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [497].f3 ∈ [--..--] [497].[bits 72 to 95] ∈ UNINITIALIZED [497].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [497].f5 ∈ [--..--] [497].[bits 136 to 159] ∈ UNINITIALIZED [498].f1 ∈ [--..--] [498].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [498].f3 ∈ [--..--] [498].[bits 72 to 95] ∈ UNINITIALIZED [498].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [498].f5 ∈ [--..--] [498].[bits 136 to 159] ∈ UNINITIALIZED [499].f1 ∈ [--..--] [499].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [499].f3 ∈ [--..--] [499].[bits 72 to 95] ∈ UNINITIALIZED [499].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [499].f5 ∈ [--..--] [499].[bits 136 to 159] ∈ UNINITIALIZED [500].f1 ∈ [--..--] [500].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [500].f3 ∈ [--..--] [500].[bits 72 to 95] ∈ UNINITIALIZED [500].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [500].f5 ∈ [--..--] [500].[bits 136 to 159] ∈ UNINITIALIZED [501].f1 ∈ [--..--] [501].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [501].f3 ∈ [--..--] [501].[bits 72 to 95] ∈ UNINITIALIZED [501].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [501].f5 ∈ [--..--] [501].[bits 136 to 159] ∈ UNINITIALIZED [502].f1 ∈ [--..--] [502].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [502].f3 ∈ [--..--] [502].[bits 72 to 95] ∈ UNINITIALIZED [502].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [502].f5 ∈ [--..--] [502].[bits 136 to 159] ∈ UNINITIALIZED [503].f1 ∈ [--..--] [503].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [503].f3 ∈ [--..--] [503].[bits 72 to 95] ∈ UNINITIALIZED [503].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [503].f5 ∈ [--..--] [503].[bits 136 to 159] ∈ UNINITIALIZED [504].f1 ∈ [--..--] [504].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [504].f3 ∈ [--..--] [504].[bits 72 to 95] ∈ UNINITIALIZED [504].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [504].f5 ∈ [--..--] [504].[bits 136 to 159] ∈ UNINITIALIZED [505].f1 ∈ [--..--] [505].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [505].f3 ∈ [--..--] [505].[bits 72 to 95] ∈ UNINITIALIZED [505].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [505].f5 ∈ [--..--] [505].[bits 136 to 159] ∈ UNINITIALIZED [506].f1 ∈ [--..--] [506].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [506].f3 ∈ [--..--] [506].[bits 72 to 95] ∈ UNINITIALIZED [506].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [506].f5 ∈ [--..--] [506].[bits 136 to 159] ∈ UNINITIALIZED [507].f1 ∈ [--..--] [507].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [507].f3 ∈ [--..--] [507].[bits 72 to 95] ∈ UNINITIALIZED [507].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [507].f5 ∈ [--..--] [507].[bits 136 to 159] ∈ UNINITIALIZED [508].f1 ∈ [--..--] [508].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [508].f3 ∈ [--..--] [508].[bits 72 to 95] ∈ UNINITIALIZED [508].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [508].f5 ∈ [--..--] [508].[bits 136 to 159] ∈ UNINITIALIZED [509].f1 ∈ [--..--] [509].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [509].f3 ∈ [--..--] [509].[bits 72 to 95] ∈ UNINITIALIZED [509].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [509].f5 ∈ [--..--] [509].[bits 136 to 159] ∈ UNINITIALIZED [510].f1 ∈ [--..--] [510].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [510].f3 ∈ [--..--] [510].[bits 72 to 95] ∈ UNINITIALIZED [510].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [510].f5 ∈ [--..--] [510].[bits 136 to 159] ∈ UNINITIALIZED [511].f1 ∈ [--..--] [511].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [511].f3 ∈ [--..--] [511].[bits 72 to 95] ∈ UNINITIALIZED [511].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [511].f5 ∈ [--..--] [511].[bits 136 to 159] ∈ UNINITIALIZED [512].f1 ∈ [--..--] [512].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [512].f3 ∈ [--..--] [512].[bits 72 to 95] ∈ UNINITIALIZED [512].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [512].f5 ∈ [--..--] [512].[bits 136 to 159] ∈ UNINITIALIZED [513].f1 ∈ [--..--] [513].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [513].f3 ∈ [--..--] [513].[bits 72 to 95] ∈ UNINITIALIZED [513].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [513].f5 ∈ [--..--] [513].[bits 136 to 159] ∈ UNINITIALIZED [514].f1 ∈ [--..--] [514].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [514].f3 ∈ [--..--] [514].[bits 72 to 95] ∈ UNINITIALIZED [514].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [514].f5 ∈ [--..--] [514].[bits 136 to 159] ∈ UNINITIALIZED [515].f1 ∈ [--..--] [515].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [515].f3 ∈ [--..--] [515].[bits 72 to 95] ∈ UNINITIALIZED [515].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [515].f5 ∈ [--..--] [515].[bits 136 to 159] ∈ UNINITIALIZED [516].f1 ∈ [--..--] [516].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [516].f3 ∈ [--..--] [516].[bits 72 to 95] ∈ UNINITIALIZED [516].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [516].f5 ∈ [--..--] [516].[bits 136 to 159] ∈ UNINITIALIZED [517].f1 ∈ [--..--] [517].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [517].f3 ∈ [--..--] [517].[bits 72 to 95] ∈ UNINITIALIZED [517].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [517].f5 ∈ [--..--] [517].[bits 136 to 159] ∈ UNINITIALIZED [518].f1 ∈ [--..--] [518].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [518].f3 ∈ [--..--] [518].[bits 72 to 95] ∈ UNINITIALIZED [518].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [518].f5 ∈ [--..--] [518].[bits 136 to 159] ∈ UNINITIALIZED [519].f1 ∈ [--..--] [519].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [519].f3 ∈ [--..--] [519].[bits 72 to 95] ∈ UNINITIALIZED [519].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [519].f5 ∈ [--..--] [519].[bits 136 to 159] ∈ UNINITIALIZED [520].f1 ∈ [--..--] [520].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [520].f3 ∈ [--..--] [520].[bits 72 to 95] ∈ UNINITIALIZED [520].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [520].f5 ∈ [--..--] [520].[bits 136 to 159] ∈ UNINITIALIZED [521].f1 ∈ [--..--] [521].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [521].f3 ∈ [--..--] [521].[bits 72 to 95] ∈ UNINITIALIZED [521].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [521].f5 ∈ [--..--] [521].[bits 136 to 159] ∈ UNINITIALIZED [522].f1 ∈ [--..--] [522].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [522].f3 ∈ [--..--] [522].[bits 72 to 95] ∈ UNINITIALIZED [522].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [522].f5 ∈ [--..--] [522].[bits 136 to 159] ∈ UNINITIALIZED [523].f1 ∈ [--..--] [523].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [523].f3 ∈ [--..--] [523].[bits 72 to 95] ∈ UNINITIALIZED [523].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [523].f5 ∈ [--..--] [523].[bits 136 to 159] ∈ UNINITIALIZED [524].f1 ∈ [--..--] [524].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [524].f3 ∈ [--..--] [524].[bits 72 to 95] ∈ UNINITIALIZED [524].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [524].f5 ∈ [--..--] [524].[bits 136 to 159] ∈ UNINITIALIZED [525].f1 ∈ [--..--] [525].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [525].f3 ∈ [--..--] [525].[bits 72 to 95] ∈ UNINITIALIZED [525].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [525].f5 ∈ [--..--] [525].[bits 136 to 159] ∈ UNINITIALIZED [526].f1 ∈ [--..--] [526].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [526].f3 ∈ [--..--] [526].[bits 72 to 95] ∈ UNINITIALIZED [526].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [526].f5 ∈ [--..--] [526].[bits 136 to 159] ∈ UNINITIALIZED [527].f1 ∈ [--..--] [527].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [527].f3 ∈ [--..--] [527].[bits 72 to 95] ∈ UNINITIALIZED [527].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [527].f5 ∈ [--..--] [527].[bits 136 to 159] ∈ UNINITIALIZED [528].f1 ∈ [--..--] [528].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [528].f3 ∈ [--..--] [528].[bits 72 to 95] ∈ UNINITIALIZED [528].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [528].f5 ∈ [--..--] [528].[bits 136 to 159] ∈ UNINITIALIZED [529].f1 ∈ [--..--] [529].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [529].f3 ∈ [--..--] [529].[bits 72 to 95] ∈ UNINITIALIZED [529].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [529].f5 ∈ [--..--] [529].[bits 136 to 159] ∈ UNINITIALIZED [530].f1 ∈ [--..--] [530].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [530].f3 ∈ [--..--] [530].[bits 72 to 95] ∈ UNINITIALIZED [530].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [530].f5 ∈ [--..--] [530].[bits 136 to 159] ∈ UNINITIALIZED [531].f1 ∈ [--..--] [531].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [531].f3 ∈ [--..--] [531].[bits 72 to 95] ∈ UNINITIALIZED [531].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [531].f5 ∈ [--..--] [531].[bits 136 to 159] ∈ UNINITIALIZED [532].f1 ∈ [--..--] [532].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [532].f3 ∈ [--..--] [532].[bits 72 to 95] ∈ UNINITIALIZED [532].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [532].f5 ∈ [--..--] [532].[bits 136 to 159] ∈ UNINITIALIZED [533].f1 ∈ [--..--] [533].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [533].f3 ∈ [--..--] [533].[bits 72 to 95] ∈ UNINITIALIZED [533].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [533].f5 ∈ [--..--] [533].[bits 136 to 159] ∈ UNINITIALIZED [534].f1 ∈ [--..--] [534].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [534].f3 ∈ [--..--] [534].[bits 72 to 95] ∈ UNINITIALIZED [534].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [534].f5 ∈ [--..--] [534].[bits 136 to 159] ∈ UNINITIALIZED [535].f1 ∈ [--..--] [535].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [535].f3 ∈ [--..--] [535].[bits 72 to 95] ∈ UNINITIALIZED [535].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [535].f5 ∈ [--..--] [535].[bits 136 to 159] ∈ UNINITIALIZED [536].f1 ∈ [--..--] [536].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [536].f3 ∈ [--..--] [536].[bits 72 to 95] ∈ UNINITIALIZED [536].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [536].f5 ∈ [--..--] [536].[bits 136 to 159] ∈ UNINITIALIZED [537].f1 ∈ [--..--] [537].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [537].f3 ∈ [--..--] [537].[bits 72 to 95] ∈ UNINITIALIZED [537].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [537].f5 ∈ [--..--] [537].[bits 136 to 159] ∈ UNINITIALIZED [538].f1 ∈ [--..--] [538].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [538].f3 ∈ [--..--] [538].[bits 72 to 95] ∈ UNINITIALIZED [538].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [538].f5 ∈ [--..--] [538].[bits 136 to 159] ∈ UNINITIALIZED [539].f1 ∈ [--..--] [539].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [539].f3 ∈ [--..--] [539].[bits 72 to 95] ∈ UNINITIALIZED [539].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [539].f5 ∈ [--..--] [539].[bits 136 to 159] ∈ UNINITIALIZED [540].f1 ∈ [--..--] [540].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [540].f3 ∈ [--..--] [540].[bits 72 to 95] ∈ UNINITIALIZED [540].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [540].f5 ∈ [--..--] [540].[bits 136 to 159] ∈ UNINITIALIZED [541].f1 ∈ [--..--] [541].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [541].f3 ∈ [--..--] [541].[bits 72 to 95] ∈ UNINITIALIZED [541].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [541].f5 ∈ [--..--] [541].[bits 136 to 159] ∈ UNINITIALIZED [542].f1 ∈ [--..--] [542].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [542].f3 ∈ [--..--] [542].[bits 72 to 95] ∈ UNINITIALIZED [542].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [542].f5 ∈ [--..--] [542].[bits 136 to 159] ∈ UNINITIALIZED [543].f1 ∈ [--..--] [543].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [543].f3 ∈ [--..--] [543].[bits 72 to 95] ∈ UNINITIALIZED [543].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [543].f5 ∈ [--..--] [543].[bits 136 to 159] ∈ UNINITIALIZED [544].f1 ∈ [--..--] [544].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [544].f3 ∈ [--..--] [544].[bits 72 to 95] ∈ UNINITIALIZED [544].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [544].f5 ∈ [--..--] [544].[bits 136 to 159] ∈ UNINITIALIZED [545].f1 ∈ [--..--] [545].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [545].f3 ∈ [--..--] [545].[bits 72 to 95] ∈ UNINITIALIZED [545].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [545].f5 ∈ [--..--] [545].[bits 136 to 159] ∈ UNINITIALIZED [546].f1 ∈ [--..--] [546].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [546].f3 ∈ [--..--] [546].[bits 72 to 95] ∈ UNINITIALIZED [546].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [546].f5 ∈ [--..--] [546].[bits 136 to 159] ∈ UNINITIALIZED [547].f1 ∈ [--..--] [547].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [547].f3 ∈ [--..--] [547].[bits 72 to 95] ∈ UNINITIALIZED [547].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [547].f5 ∈ [--..--] [547].[bits 136 to 159] ∈ UNINITIALIZED [548].f1 ∈ [--..--] [548].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [548].f3 ∈ [--..--] [548].[bits 72 to 95] ∈ UNINITIALIZED [548].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [548].f5 ∈ [--..--] [548].[bits 136 to 159] ∈ UNINITIALIZED [549].f1 ∈ [--..--] [549].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [549].f3 ∈ [--..--] [549].[bits 72 to 95] ∈ UNINITIALIZED [549].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [549].f5 ∈ [--..--] [549].[bits 136 to 159] ∈ UNINITIALIZED [550].f1 ∈ [--..--] [550].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [550].f3 ∈ [--..--] [550].[bits 72 to 95] ∈ UNINITIALIZED [550].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [550].f5 ∈ [--..--] [550].[bits 136 to 159] ∈ UNINITIALIZED [551].f1 ∈ [--..--] [551].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [551].f3 ∈ [--..--] [551].[bits 72 to 95] ∈ UNINITIALIZED [551].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [551].f5 ∈ [--..--] [551].[bits 136 to 159] ∈ UNINITIALIZED [552].f1 ∈ [--..--] [552].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [552].f3 ∈ [--..--] [552].[bits 72 to 95] ∈ UNINITIALIZED [552].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [552].f5 ∈ [--..--] [552].[bits 136 to 159] ∈ UNINITIALIZED [553].f1 ∈ [--..--] [553].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [553].f3 ∈ [--..--] [553].[bits 72 to 95] ∈ UNINITIALIZED [553].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [553].f5 ∈ [--..--] [553].[bits 136 to 159] ∈ UNINITIALIZED [554].f1 ∈ [--..--] [554].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [554].f3 ∈ [--..--] [554].[bits 72 to 95] ∈ UNINITIALIZED [554].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [554].f5 ∈ [--..--] [554].[bits 136 to 159] ∈ UNINITIALIZED [555].f1 ∈ [--..--] [555].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [555].f3 ∈ [--..--] [555].[bits 72 to 95] ∈ UNINITIALIZED [555].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [555].f5 ∈ [--..--] [555].[bits 136 to 159] ∈ UNINITIALIZED [556].f1 ∈ [--..--] [556].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [556].f3 ∈ [--..--] [556].[bits 72 to 95] ∈ UNINITIALIZED [556].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [556].f5 ∈ [--..--] [556].[bits 136 to 159] ∈ UNINITIALIZED [557].f1 ∈ [--..--] [557].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [557].f3 ∈ [--..--] [557].[bits 72 to 95] ∈ UNINITIALIZED [557].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [557].f5 ∈ [--..--] [557].[bits 136 to 159] ∈ UNINITIALIZED [558].f1 ∈ [--..--] [558].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [558].f3 ∈ [--..--] [558].[bits 72 to 95] ∈ UNINITIALIZED [558].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [558].f5 ∈ [--..--] [558].[bits 136 to 159] ∈ UNINITIALIZED [559].f1 ∈ [--..--] [559].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [559].f3 ∈ [--..--] [559].[bits 72 to 95] ∈ UNINITIALIZED [559].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [559].f5 ∈ [--..--] [559].[bits 136 to 159] ∈ UNINITIALIZED [560].f1 ∈ [--..--] [560].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [560].f3 ∈ [--..--] [560].[bits 72 to 95] ∈ UNINITIALIZED [560].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [560].f5 ∈ [--..--] [560].[bits 136 to 159] ∈ UNINITIALIZED [561].f1 ∈ [--..--] [561].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [561].f3 ∈ [--..--] [561].[bits 72 to 95] ∈ UNINITIALIZED [561].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [561].f5 ∈ [--..--] [561].[bits 136 to 159] ∈ UNINITIALIZED [562].f1 ∈ [--..--] [562].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [562].f3 ∈ [--..--] [562].[bits 72 to 95] ∈ UNINITIALIZED [562].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [562].f5 ∈ [--..--] [562].[bits 136 to 159] ∈ UNINITIALIZED [563].f1 ∈ [--..--] [563].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [563].f3 ∈ [--..--] [563].[bits 72 to 95] ∈ UNINITIALIZED [563].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [563].f5 ∈ [--..--] [563].[bits 136 to 159] ∈ UNINITIALIZED [564].f1 ∈ [--..--] [564].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [564].f3 ∈ [--..--] [564].[bits 72 to 95] ∈ UNINITIALIZED [564].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [564].f5 ∈ [--..--] [564].[bits 136 to 159] ∈ UNINITIALIZED [565].f1 ∈ [--..--] [565].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [565].f3 ∈ [--..--] [565].[bits 72 to 95] ∈ UNINITIALIZED [565].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [565].f5 ∈ [--..--] [565].[bits 136 to 159] ∈ UNINITIALIZED [566].f1 ∈ [--..--] [566].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [566].f3 ∈ [--..--] [566].[bits 72 to 95] ∈ UNINITIALIZED [566].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [566].f5 ∈ [--..--] [566].[bits 136 to 159] ∈ UNINITIALIZED [567].f1 ∈ [--..--] [567].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [567].f3 ∈ [--..--] [567].[bits 72 to 95] ∈ UNINITIALIZED [567].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [567].f5 ∈ [--..--] [567].[bits 136 to 159] ∈ UNINITIALIZED [568].f1 ∈ [--..--] [568].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [568].f3 ∈ [--..--] [568].[bits 72 to 95] ∈ UNINITIALIZED [568].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [568].f5 ∈ [--..--] [568].[bits 136 to 159] ∈ UNINITIALIZED [569].f1 ∈ [--..--] [569].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [569].f3 ∈ [--..--] [569].[bits 72 to 95] ∈ UNINITIALIZED [569].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [569].f5 ∈ [--..--] [569].[bits 136 to 159] ∈ UNINITIALIZED [570].f1 ∈ [--..--] [570].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [570].f3 ∈ [--..--] [570].[bits 72 to 95] ∈ UNINITIALIZED [570].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [570].f5 ∈ [--..--] [570].[bits 136 to 159] ∈ UNINITIALIZED [571].f1 ∈ [--..--] [571].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [571].f3 ∈ [--..--] [571].[bits 72 to 95] ∈ UNINITIALIZED [571].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [571].f5 ∈ [--..--] [571].[bits 136 to 159] ∈ UNINITIALIZED [572].f1 ∈ [--..--] [572].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [572].f3 ∈ [--..--] [572].[bits 72 to 95] ∈ UNINITIALIZED [572].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [572].f5 ∈ [--..--] [572].[bits 136 to 159] ∈ UNINITIALIZED [573].f1 ∈ [--..--] [573].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [573].f3 ∈ [--..--] [573].[bits 72 to 95] ∈ UNINITIALIZED [573].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [573].f5 ∈ [--..--] [573].[bits 136 to 159] ∈ UNINITIALIZED [574].f1 ∈ [--..--] [574].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [574].f3 ∈ [--..--] [574].[bits 72 to 95] ∈ UNINITIALIZED [574].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [574].f5 ∈ [--..--] [574].[bits 136 to 159] ∈ UNINITIALIZED [575].f1 ∈ [--..--] [575].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [575].f3 ∈ [--..--] [575].[bits 72 to 95] ∈ UNINITIALIZED [575].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [575].f5 ∈ [--..--] [575].[bits 136 to 159] ∈ UNINITIALIZED [576].f1 ∈ [--..--] [576].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [576].f3 ∈ [--..--] [576].[bits 72 to 95] ∈ UNINITIALIZED [576].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [576].f5 ∈ [--..--] [576].[bits 136 to 159] ∈ UNINITIALIZED [577].f1 ∈ [--..--] [577].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [577].f3 ∈ [--..--] [577].[bits 72 to 95] ∈ UNINITIALIZED [577].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [577].f5 ∈ [--..--] [577].[bits 136 to 159] ∈ UNINITIALIZED [578].f1 ∈ [--..--] [578].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [578].f3 ∈ [--..--] [578].[bits 72 to 95] ∈ UNINITIALIZED [578].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [578].f5 ∈ [--..--] [578].[bits 136 to 159] ∈ UNINITIALIZED [579].f1 ∈ [--..--] [579].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [579].f3 ∈ [--..--] [579].[bits 72 to 95] ∈ UNINITIALIZED [579].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [579].f5 ∈ [--..--] [579].[bits 136 to 159] ∈ UNINITIALIZED [580].f1 ∈ [--..--] [580].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [580].f3 ∈ [--..--] [580].[bits 72 to 95] ∈ UNINITIALIZED [580].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [580].f5 ∈ [--..--] [580].[bits 136 to 159] ∈ UNINITIALIZED [581].f1 ∈ [--..--] [581].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [581].f3 ∈ [--..--] [581].[bits 72 to 95] ∈ UNINITIALIZED [581].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [581].f5 ∈ [--..--] [581].[bits 136 to 159] ∈ UNINITIALIZED [582].f1 ∈ [--..--] [582].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [582].f3 ∈ [--..--] [582].[bits 72 to 95] ∈ UNINITIALIZED [582].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [582].f5 ∈ [--..--] [582].[bits 136 to 159] ∈ UNINITIALIZED [583].f1 ∈ [--..--] [583].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [583].f3 ∈ [--..--] [583].[bits 72 to 95] ∈ UNINITIALIZED [583].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [583].f5 ∈ [--..--] [583].[bits 136 to 159] ∈ UNINITIALIZED [584].f1 ∈ [--..--] [584].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [584].f3 ∈ [--..--] [584].[bits 72 to 95] ∈ UNINITIALIZED [584].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [584].f5 ∈ [--..--] [584].[bits 136 to 159] ∈ UNINITIALIZED [585].f1 ∈ [--..--] [585].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [585].f3 ∈ [--..--] [585].[bits 72 to 95] ∈ UNINITIALIZED [585].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [585].f5 ∈ [--..--] [585].[bits 136 to 159] ∈ UNINITIALIZED [586].f1 ∈ [--..--] [586].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [586].f3 ∈ [--..--] [586].[bits 72 to 95] ∈ UNINITIALIZED [586].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [586].f5 ∈ [--..--] [586].[bits 136 to 159] ∈ UNINITIALIZED [587].f1 ∈ [--..--] [587].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [587].f3 ∈ [--..--] [587].[bits 72 to 95] ∈ UNINITIALIZED [587].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [587].f5 ∈ [--..--] [587].[bits 136 to 159] ∈ UNINITIALIZED [588].f1 ∈ [--..--] [588].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [588].f3 ∈ [--..--] [588].[bits 72 to 95] ∈ UNINITIALIZED [588].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [588].f5 ∈ [--..--] [588].[bits 136 to 159] ∈ UNINITIALIZED [589].f1 ∈ [--..--] [589].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [589].f3 ∈ [--..--] [589].[bits 72 to 95] ∈ UNINITIALIZED [589].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [589].f5 ∈ [--..--] [589].[bits 136 to 159] ∈ UNINITIALIZED [590].f1 ∈ [--..--] [590].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [590].f3 ∈ [--..--] [590].[bits 72 to 95] ∈ UNINITIALIZED [590].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [590].f5 ∈ [--..--] [590].[bits 136 to 159] ∈ UNINITIALIZED [591].f1 ∈ [--..--] [591].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [591].f3 ∈ [--..--] [591].[bits 72 to 95] ∈ UNINITIALIZED [591].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [591].f5 ∈ [--..--] [591].[bits 136 to 159] ∈ UNINITIALIZED [592].f1 ∈ [--..--] [592].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [592].f3 ∈ [--..--] [592].[bits 72 to 95] ∈ UNINITIALIZED [592].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [592].f5 ∈ [--..--] [592].[bits 136 to 159] ∈ UNINITIALIZED [593].f1 ∈ [--..--] [593].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [593].f3 ∈ [--..--] [593].[bits 72 to 95] ∈ UNINITIALIZED [593].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [593].f5 ∈ [--..--] [593].[bits 136 to 159] ∈ UNINITIALIZED [594].f1 ∈ [--..--] [594].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [594].f3 ∈ [--..--] [594].[bits 72 to 95] ∈ UNINITIALIZED [594].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [594].f5 ∈ [--..--] [594].[bits 136 to 159] ∈ UNINITIALIZED [595].f1 ∈ [--..--] [595].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [595].f3 ∈ [--..--] [595].[bits 72 to 95] ∈ UNINITIALIZED [595].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [595].f5 ∈ [--..--] [595].[bits 136 to 159] ∈ UNINITIALIZED [596].f1 ∈ [--..--] [596].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [596].f3 ∈ [--..--] [596].[bits 72 to 95] ∈ UNINITIALIZED [596].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [596].f5 ∈ [--..--] [596].[bits 136 to 159] ∈ UNINITIALIZED [597].f1 ∈ [--..--] [597].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [597].f3 ∈ [--..--] [597].[bits 72 to 95] ∈ UNINITIALIZED [597].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [597].f5 ∈ [--..--] [597].[bits 136 to 159] ∈ UNINITIALIZED [598].f1 ∈ [--..--] [598].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [598].f3 ∈ [--..--] [598].[bits 72 to 95] ∈ UNINITIALIZED [598].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [598].f5 ∈ [--..--] [598].[bits 136 to 159] ∈ UNINITIALIZED [599].f1 ∈ [--..--] [599].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [599].f3 ∈ [--..--] [599].[bits 72 to 95] ∈ UNINITIALIZED [599].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [599].f5 ∈ [--..--] [599].[bits 136 to 159] ∈ UNINITIALIZED [600].f1 ∈ [--..--] [600].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [600].f3 ∈ [--..--] [600].[bits 72 to 95] ∈ UNINITIALIZED [600].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [600].f5 ∈ [--..--] [600].[bits 136 to 159] ∈ UNINITIALIZED [601].f1 ∈ [--..--] [601].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [601].f3 ∈ [--..--] [601].[bits 72 to 95] ∈ UNINITIALIZED [601].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [601].f5 ∈ [--..--] [601].[bits 136 to 159] ∈ UNINITIALIZED [602].f1 ∈ [--..--] [602].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [602].f3 ∈ [--..--] [602].[bits 72 to 95] ∈ UNINITIALIZED [602].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [602].f5 ∈ [--..--] [602].[bits 136 to 159] ∈ UNINITIALIZED [603].f1 ∈ [--..--] [603].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [603].f3 ∈ [--..--] [603].[bits 72 to 95] ∈ UNINITIALIZED [603].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [603].f5 ∈ [--..--] [603].[bits 136 to 159] ∈ UNINITIALIZED [604].f1 ∈ [--..--] [604].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [604].f3 ∈ [--..--] [604].[bits 72 to 95] ∈ UNINITIALIZED [604].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [604].f5 ∈ [--..--] [604].[bits 136 to 159] ∈ UNINITIALIZED [605].f1 ∈ [--..--] [605].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [605].f3 ∈ [--..--] [605].[bits 72 to 95] ∈ UNINITIALIZED [605].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [605].f5 ∈ [--..--] [605].[bits 136 to 159] ∈ UNINITIALIZED [606].f1 ∈ [--..--] [606].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [606].f3 ∈ [--..--] [606].[bits 72 to 95] ∈ UNINITIALIZED [606].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [606].f5 ∈ [--..--] [606].[bits 136 to 159] ∈ UNINITIALIZED [607].f1 ∈ [--..--] [607].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [607].f3 ∈ [--..--] [607].[bits 72 to 95] ∈ UNINITIALIZED [607].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [607].f5 ∈ [--..--] [607].[bits 136 to 159] ∈ UNINITIALIZED [608].f1 ∈ [--..--] [608].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [608].f3 ∈ [--..--] [608].[bits 72 to 95] ∈ UNINITIALIZED [608].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [608].f5 ∈ [--..--] [608].[bits 136 to 159] ∈ UNINITIALIZED [609].f1 ∈ [--..--] [609].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [609].f3 ∈ [--..--] [609].[bits 72 to 95] ∈ UNINITIALIZED [609].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [609].f5 ∈ [--..--] [609].[bits 136 to 159] ∈ UNINITIALIZED [610].f1 ∈ [--..--] [610].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [610].f3 ∈ [--..--] [610].[bits 72 to 95] ∈ UNINITIALIZED [610].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [610].f5 ∈ [--..--] [610].[bits 136 to 159] ∈ UNINITIALIZED [611].f1 ∈ [--..--] [611].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [611].f3 ∈ [--..--] [611].[bits 72 to 95] ∈ UNINITIALIZED [611].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [611].f5 ∈ [--..--] [611].[bits 136 to 159] ∈ UNINITIALIZED [612].f1 ∈ [--..--] [612].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [612].f3 ∈ [--..--] [612].[bits 72 to 95] ∈ UNINITIALIZED [612].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [612].f5 ∈ [--..--] [612].[bits 136 to 159] ∈ UNINITIALIZED [613].f1 ∈ [--..--] [613].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [613].f3 ∈ [--..--] [613].[bits 72 to 95] ∈ UNINITIALIZED [613].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [613].f5 ∈ [--..--] [613].[bits 136 to 159] ∈ UNINITIALIZED [614].f1 ∈ [--..--] [614].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [614].f3 ∈ [--..--] [614].[bits 72 to 95] ∈ UNINITIALIZED [614].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [614].f5 ∈ [--..--] [614].[bits 136 to 159] ∈ UNINITIALIZED [615].f1 ∈ [--..--] [615].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [615].f3 ∈ [--..--] [615].[bits 72 to 95] ∈ UNINITIALIZED [615].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [615].f5 ∈ [--..--] [615].[bits 136 to 159] ∈ UNINITIALIZED [616].f1 ∈ [--..--] [616].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [616].f3 ∈ [--..--] [616].[bits 72 to 95] ∈ UNINITIALIZED [616].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [616].f5 ∈ [--..--] [616].[bits 136 to 159] ∈ UNINITIALIZED [617].f1 ∈ [--..--] [617].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [617].f3 ∈ [--..--] [617].[bits 72 to 95] ∈ UNINITIALIZED [617].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [617].f5 ∈ [--..--] [617].[bits 136 to 159] ∈ UNINITIALIZED [618].f1 ∈ [--..--] [618].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [618].f3 ∈ [--..--] [618].[bits 72 to 95] ∈ UNINITIALIZED [618].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [618].f5 ∈ [--..--] [618].[bits 136 to 159] ∈ UNINITIALIZED [619].f1 ∈ [--..--] [619].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [619].f3 ∈ [--..--] [619].[bits 72 to 95] ∈ UNINITIALIZED [619].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [619].f5 ∈ [--..--] [619].[bits 136 to 159] ∈ UNINITIALIZED [620].f1 ∈ [--..--] [620].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [620].f3 ∈ [--..--] [620].[bits 72 to 95] ∈ UNINITIALIZED [620].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [620].f5 ∈ [--..--] [620].[bits 136 to 159] ∈ UNINITIALIZED [621].f1 ∈ [--..--] [621].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [621].f3 ∈ [--..--] [621].[bits 72 to 95] ∈ UNINITIALIZED [621].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [621].f5 ∈ [--..--] [621].[bits 136 to 159] ∈ UNINITIALIZED [622].f1 ∈ [--..--] [622].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [622].f3 ∈ [--..--] [622].[bits 72 to 95] ∈ UNINITIALIZED [622].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [622].f5 ∈ [--..--] [622].[bits 136 to 159] ∈ UNINITIALIZED [623].f1 ∈ [--..--] [623].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [623].f3 ∈ [--..--] [623].[bits 72 to 95] ∈ UNINITIALIZED [623].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [623].f5 ∈ [--..--] [623].[bits 136 to 159] ∈ UNINITIALIZED [624].f1 ∈ [--..--] [624].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [624].f3 ∈ [--..--] [624].[bits 72 to 95] ∈ UNINITIALIZED [624].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [624].f5 ∈ [--..--] [624].[bits 136 to 159] ∈ UNINITIALIZED [625].f1 ∈ [--..--] [625].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [625].f3 ∈ [--..--] [625].[bits 72 to 95] ∈ UNINITIALIZED [625].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [625].f5 ∈ [--..--] [625].[bits 136 to 159] ∈ UNINITIALIZED [626].f1 ∈ [--..--] [626].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [626].f3 ∈ [--..--] [626].[bits 72 to 95] ∈ UNINITIALIZED [626].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [626].f5 ∈ [--..--] [626].[bits 136 to 159] ∈ UNINITIALIZED [627].f1 ∈ [--..--] [627].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [627].f3 ∈ [--..--] [627].[bits 72 to 95] ∈ UNINITIALIZED [627].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [627].f5 ∈ [--..--] [627].[bits 136 to 159] ∈ UNINITIALIZED [628].f1 ∈ [--..--] [628].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [628].f3 ∈ [--..--] [628].[bits 72 to 95] ∈ UNINITIALIZED [628].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [628].f5 ∈ [--..--] [628].[bits 136 to 159] ∈ UNINITIALIZED [629].f1 ∈ [--..--] [629].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [629].f3 ∈ [--..--] [629].[bits 72 to 95] ∈ UNINITIALIZED [629].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [629].f5 ∈ [--..--] [629].[bits 136 to 159] ∈ UNINITIALIZED [630].f1 ∈ [--..--] [630].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [630].f3 ∈ [--..--] [630].[bits 72 to 95] ∈ UNINITIALIZED [630].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [630].f5 ∈ [--..--] [630].[bits 136 to 159] ∈ UNINITIALIZED [631].f1 ∈ [--..--] [631].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [631].f3 ∈ [--..--] [631].[bits 72 to 95] ∈ UNINITIALIZED [631].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [631].f5 ∈ [--..--] [631].[bits 136 to 159] ∈ UNINITIALIZED [632].f1 ∈ [--..--] [632].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [632].f3 ∈ [--..--] [632].[bits 72 to 95] ∈ UNINITIALIZED [632].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [632].f5 ∈ [--..--] [632].[bits 136 to 159] ∈ UNINITIALIZED [633].f1 ∈ [--..--] [633].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [633].f3 ∈ [--..--] [633].[bits 72 to 95] ∈ UNINITIALIZED [633].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [633].f5 ∈ [--..--] [633].[bits 136 to 159] ∈ UNINITIALIZED [634].f1 ∈ [--..--] [634].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [634].f3 ∈ [--..--] [634].[bits 72 to 95] ∈ UNINITIALIZED [634].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [634].f5 ∈ [--..--] [634].[bits 136 to 159] ∈ UNINITIALIZED [635].f1 ∈ [--..--] [635].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [635].f3 ∈ [--..--] [635].[bits 72 to 95] ∈ UNINITIALIZED [635].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [635].f5 ∈ [--..--] [635].[bits 136 to 159] ∈ UNINITIALIZED [636].f1 ∈ [--..--] [636].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [636].f3 ∈ [--..--] [636].[bits 72 to 95] ∈ UNINITIALIZED [636].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [636].f5 ∈ [--..--] [636].[bits 136 to 159] ∈ UNINITIALIZED [637].f1 ∈ [--..--] [637].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [637].f3 ∈ [--..--] [637].[bits 72 to 95] ∈ UNINITIALIZED [637].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [637].f5 ∈ [--..--] [637].[bits 136 to 159] ∈ UNINITIALIZED [638].f1 ∈ [--..--] [638].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [638].f3 ∈ [--..--] [638].[bits 72 to 95] ∈ UNINITIALIZED [638].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [638].f5 ∈ [--..--] [638].[bits 136 to 159] ∈ UNINITIALIZED [639].f1 ∈ [--..--] [639].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [639].f3 ∈ [--..--] [639].[bits 72 to 95] ∈ UNINITIALIZED [639].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [639].f5 ∈ [--..--] [639].[bits 136 to 159] ∈ UNINITIALIZED [640].f1 ∈ [--..--] [640].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [640].f3 ∈ [--..--] [640].[bits 72 to 95] ∈ UNINITIALIZED [640].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [640].f5 ∈ [--..--] [640].[bits 136 to 159] ∈ UNINITIALIZED [641].f1 ∈ [--..--] [641].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [641].f3 ∈ [--..--] [641].[bits 72 to 95] ∈ UNINITIALIZED [641].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [641].f5 ∈ [--..--] [641].[bits 136 to 159] ∈ UNINITIALIZED [642].f1 ∈ [--..--] [642].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [642].f3 ∈ [--..--] [642].[bits 72 to 95] ∈ UNINITIALIZED [642].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [642].f5 ∈ [--..--] [642].[bits 136 to 159] ∈ UNINITIALIZED [643].f1 ∈ [--..--] [643].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [643].f3 ∈ [--..--] [643].[bits 72 to 95] ∈ UNINITIALIZED [643].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [643].f5 ∈ [--..--] [643].[bits 136 to 159] ∈ UNINITIALIZED [644].f1 ∈ [--..--] [644].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [644].f3 ∈ [--..--] [644].[bits 72 to 95] ∈ UNINITIALIZED [644].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [644].f5 ∈ [--..--] [644].[bits 136 to 159] ∈ UNINITIALIZED [645].f1 ∈ [--..--] [645].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [645].f3 ∈ [--..--] [645].[bits 72 to 95] ∈ UNINITIALIZED [645].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [645].f5 ∈ [--..--] [645].[bits 136 to 159] ∈ UNINITIALIZED [646].f1 ∈ [--..--] [646].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [646].f3 ∈ [--..--] [646].[bits 72 to 95] ∈ UNINITIALIZED [646].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [646].f5 ∈ [--..--] [646].[bits 136 to 159] ∈ UNINITIALIZED [647].f1 ∈ [--..--] [647].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [647].f3 ∈ [--..--] [647].[bits 72 to 95] ∈ UNINITIALIZED [647].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [647].f5 ∈ [--..--] [647].[bits 136 to 159] ∈ UNINITIALIZED [648].f1 ∈ [--..--] [648].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [648].f3 ∈ [--..--] [648].[bits 72 to 95] ∈ UNINITIALIZED [648].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [648].f5 ∈ [--..--] [648].[bits 136 to 159] ∈ UNINITIALIZED [649].f1 ∈ [--..--] [649].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [649].f3 ∈ [--..--] [649].[bits 72 to 95] ∈ UNINITIALIZED [649].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [649].f5 ∈ [--..--] [649].[bits 136 to 159] ∈ UNINITIALIZED [650].f1 ∈ [--..--] [650].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [650].f3 ∈ [--..--] [650].[bits 72 to 95] ∈ UNINITIALIZED [650].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [650].f5 ∈ [--..--] [650].[bits 136 to 159] ∈ UNINITIALIZED [651].f1 ∈ [--..--] [651].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [651].f3 ∈ [--..--] [651].[bits 72 to 95] ∈ UNINITIALIZED [651].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [651].f5 ∈ [--..--] [651].[bits 136 to 159] ∈ UNINITIALIZED [652].f1 ∈ [--..--] [652].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [652].f3 ∈ [--..--] [652].[bits 72 to 95] ∈ UNINITIALIZED [652].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [652].f5 ∈ [--..--] [652].[bits 136 to 159] ∈ UNINITIALIZED [653].f1 ∈ [--..--] [653].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [653].f3 ∈ [--..--] [653].[bits 72 to 95] ∈ UNINITIALIZED [653].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [653].f5 ∈ [--..--] [653].[bits 136 to 159] ∈ UNINITIALIZED [654].f1 ∈ [--..--] [654].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [654].f3 ∈ [--..--] [654].[bits 72 to 95] ∈ UNINITIALIZED [654].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [654].f5 ∈ [--..--] [654].[bits 136 to 159] ∈ UNINITIALIZED [655].f1 ∈ [--..--] [655].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [655].f3 ∈ [--..--] [655].[bits 72 to 95] ∈ UNINITIALIZED [655].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [655].f5 ∈ [--..--] [655].[bits 136 to 159] ∈ UNINITIALIZED [656].f1 ∈ [--..--] [656].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [656].f3 ∈ [--..--] [656].[bits 72 to 95] ∈ UNINITIALIZED [656].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [656].f5 ∈ [--..--] [656].[bits 136 to 159] ∈ UNINITIALIZED [657].f1 ∈ [--..--] [657].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [657].f3 ∈ [--..--] [657].[bits 72 to 95] ∈ UNINITIALIZED [657].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [657].f5 ∈ [--..--] [657].[bits 136 to 159] ∈ UNINITIALIZED [658].f1 ∈ [--..--] [658].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [658].f3 ∈ [--..--] [658].[bits 72 to 95] ∈ UNINITIALIZED [658].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [658].f5 ∈ [--..--] [658].[bits 136 to 159] ∈ UNINITIALIZED [659].f1 ∈ [--..--] [659].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [659].f3 ∈ [--..--] [659].[bits 72 to 95] ∈ UNINITIALIZED [659].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [659].f5 ∈ [--..--] [659].[bits 136 to 159] ∈ UNINITIALIZED [660].f1 ∈ [--..--] [660].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [660].f3 ∈ [--..--] [660].[bits 72 to 95] ∈ UNINITIALIZED [660].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [660].f5 ∈ [--..--] [660].[bits 136 to 159] ∈ UNINITIALIZED [661].f1 ∈ [--..--] [661].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [661].f3 ∈ [--..--] [661].[bits 72 to 95] ∈ UNINITIALIZED [661].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [661].f5 ∈ [--..--] [661].[bits 136 to 159] ∈ UNINITIALIZED [662].f1 ∈ [--..--] [662].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [662].f3 ∈ [--..--] [662].[bits 72 to 95] ∈ UNINITIALIZED [662].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [662].f5 ∈ [--..--] [662].[bits 136 to 159] ∈ UNINITIALIZED [663].f1 ∈ [--..--] [663].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [663].f3 ∈ [--..--] [663].[bits 72 to 95] ∈ UNINITIALIZED [663].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [663].f5 ∈ [--..--] [663].[bits 136 to 159] ∈ UNINITIALIZED [664].f1 ∈ [--..--] [664].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [664].f3 ∈ [--..--] [664].[bits 72 to 95] ∈ UNINITIALIZED [664].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [664].f5 ∈ [--..--] [664].[bits 136 to 159] ∈ UNINITIALIZED [665].f1 ∈ [--..--] [665].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [665].f3 ∈ [--..--] [665].[bits 72 to 95] ∈ UNINITIALIZED [665].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [665].f5 ∈ [--..--] [665].[bits 136 to 159] ∈ UNINITIALIZED [666].f1 ∈ [--..--] [666].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [666].f3 ∈ [--..--] [666].[bits 72 to 95] ∈ UNINITIALIZED [666].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [666].f5 ∈ [--..--] [666].[bits 136 to 159] ∈ UNINITIALIZED [667].f1 ∈ [--..--] [667].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [667].f3 ∈ [--..--] [667].[bits 72 to 95] ∈ UNINITIALIZED [667].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [667].f5 ∈ [--..--] [667].[bits 136 to 159] ∈ UNINITIALIZED [668].f1 ∈ [--..--] [668].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [668].f3 ∈ [--..--] [668].[bits 72 to 95] ∈ UNINITIALIZED [668].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [668].f5 ∈ [--..--] [668].[bits 136 to 159] ∈ UNINITIALIZED [669].f1 ∈ [--..--] [669].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [669].f3 ∈ [--..--] [669].[bits 72 to 95] ∈ UNINITIALIZED [669].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [669].f5 ∈ [--..--] [669].[bits 136 to 159] ∈ UNINITIALIZED [670].f1 ∈ [--..--] [670].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [670].f3 ∈ [--..--] [670].[bits 72 to 95] ∈ UNINITIALIZED [670].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [670].f5 ∈ [--..--] [670].[bits 136 to 159] ∈ UNINITIALIZED [671].f1 ∈ [--..--] [671].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [671].f3 ∈ [--..--] [671].[bits 72 to 95] ∈ UNINITIALIZED [671].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [671].f5 ∈ [--..--] [671].[bits 136 to 159] ∈ UNINITIALIZED [672].f1 ∈ [--..--] [672].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [672].f3 ∈ [--..--] [672].[bits 72 to 95] ∈ UNINITIALIZED [672].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [672].f5 ∈ [--..--] [672].[bits 136 to 159] ∈ UNINITIALIZED [673].f1 ∈ [--..--] [673].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [673].f3 ∈ [--..--] [673].[bits 72 to 95] ∈ UNINITIALIZED [673].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [673].f5 ∈ [--..--] [673].[bits 136 to 159] ∈ UNINITIALIZED [674].f1 ∈ [--..--] [674].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [674].f3 ∈ [--..--] [674].[bits 72 to 95] ∈ UNINITIALIZED [674].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [674].f5 ∈ [--..--] [674].[bits 136 to 159] ∈ UNINITIALIZED [675].f1 ∈ [--..--] [675].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [675].f3 ∈ [--..--] [675].[bits 72 to 95] ∈ UNINITIALIZED [675].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [675].f5 ∈ [--..--] [675].[bits 136 to 159] ∈ UNINITIALIZED [676].f1 ∈ [--..--] [676].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [676].f3 ∈ [--..--] [676].[bits 72 to 95] ∈ UNINITIALIZED [676].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [676].f5 ∈ [--..--] [676].[bits 136 to 159] ∈ UNINITIALIZED [677].f1 ∈ [--..--] [677].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [677].f3 ∈ [--..--] [677].[bits 72 to 95] ∈ UNINITIALIZED [677].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [677].f5 ∈ [--..--] [677].[bits 136 to 159] ∈ UNINITIALIZED [678].f1 ∈ [--..--] [678].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [678].f3 ∈ [--..--] [678].[bits 72 to 95] ∈ UNINITIALIZED [678].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [678].f5 ∈ [--..--] [678].[bits 136 to 159] ∈ UNINITIALIZED [679].f1 ∈ [--..--] [679].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [679].f3 ∈ [--..--] [679].[bits 72 to 95] ∈ UNINITIALIZED [679].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [679].f5 ∈ [--..--] [679].[bits 136 to 159] ∈ UNINITIALIZED [680].f1 ∈ [--..--] [680].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [680].f3 ∈ [--..--] [680].[bits 72 to 95] ∈ UNINITIALIZED [680].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [680].f5 ∈ [--..--] [680].[bits 136 to 159] ∈ UNINITIALIZED [681].f1 ∈ [--..--] [681].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [681].f3 ∈ [--..--] [681].[bits 72 to 95] ∈ UNINITIALIZED [681].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [681].f5 ∈ [--..--] [681].[bits 136 to 159] ∈ UNINITIALIZED [682].f1 ∈ [--..--] [682].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [682].f3 ∈ [--..--] [682].[bits 72 to 95] ∈ UNINITIALIZED [682].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [682].f5 ∈ [--..--] [682].[bits 136 to 159] ∈ UNINITIALIZED [683].f1 ∈ [--..--] [683].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [683].f3 ∈ [--..--] [683].[bits 72 to 95] ∈ UNINITIALIZED [683].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [683].f5 ∈ [--..--] [683].[bits 136 to 159] ∈ UNINITIALIZED [684].f1 ∈ [--..--] [684].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [684].f3 ∈ [--..--] [684].[bits 72 to 95] ∈ UNINITIALIZED [684].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [684].f5 ∈ [--..--] [684].[bits 136 to 159] ∈ UNINITIALIZED [685].f1 ∈ [--..--] [685].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [685].f3 ∈ [--..--] [685].[bits 72 to 95] ∈ UNINITIALIZED [685].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [685].f5 ∈ [--..--] [685].[bits 136 to 159] ∈ UNINITIALIZED [686].f1 ∈ [--..--] [686].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [686].f3 ∈ [--..--] [686].[bits 72 to 95] ∈ UNINITIALIZED [686].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [686].f5 ∈ [--..--] [686].[bits 136 to 159] ∈ UNINITIALIZED [687].f1 ∈ [--..--] [687].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [687].f3 ∈ [--..--] [687].[bits 72 to 95] ∈ UNINITIALIZED [687].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [687].f5 ∈ [--..--] [687].[bits 136 to 159] ∈ UNINITIALIZED [688].f1 ∈ [--..--] [688].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [688].f3 ∈ [--..--] [688].[bits 72 to 95] ∈ UNINITIALIZED [688].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [688].f5 ∈ [--..--] [688].[bits 136 to 159] ∈ UNINITIALIZED [689].f1 ∈ [--..--] [689].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [689].f3 ∈ [--..--] [689].[bits 72 to 95] ∈ UNINITIALIZED [689].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [689].f5 ∈ [--..--] [689].[bits 136 to 159] ∈ UNINITIALIZED [690].f1 ∈ [--..--] [690].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [690].f3 ∈ [--..--] [690].[bits 72 to 95] ∈ UNINITIALIZED [690].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [690].f5 ∈ [--..--] [690].[bits 136 to 159] ∈ UNINITIALIZED [691].f1 ∈ [--..--] [691].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [691].f3 ∈ [--..--] [691].[bits 72 to 95] ∈ UNINITIALIZED [691].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [691].f5 ∈ [--..--] [691].[bits 136 to 159] ∈ UNINITIALIZED [692].f1 ∈ [--..--] [692].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [692].f3 ∈ [--..--] [692].[bits 72 to 95] ∈ UNINITIALIZED [692].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [692].f5 ∈ [--..--] [692].[bits 136 to 159] ∈ UNINITIALIZED [693].f1 ∈ [--..--] [693].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [693].f3 ∈ [--..--] [693].[bits 72 to 95] ∈ UNINITIALIZED [693].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [693].f5 ∈ [--..--] [693].[bits 136 to 159] ∈ UNINITIALIZED [694].f1 ∈ [--..--] [694].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [694].f3 ∈ [--..--] [694].[bits 72 to 95] ∈ UNINITIALIZED [694].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [694].f5 ∈ [--..--] [694].[bits 136 to 159] ∈ UNINITIALIZED [695].f1 ∈ [--..--] [695].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [695].f3 ∈ [--..--] [695].[bits 72 to 95] ∈ UNINITIALIZED [695].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [695].f5 ∈ [--..--] [695].[bits 136 to 159] ∈ UNINITIALIZED [696].f1 ∈ [--..--] [696].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [696].f3 ∈ [--..--] [696].[bits 72 to 95] ∈ UNINITIALIZED [696].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [696].f5 ∈ [--..--] [696].[bits 136 to 159] ∈ UNINITIALIZED [697].f1 ∈ [--..--] [697].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [697].f3 ∈ [--..--] [697].[bits 72 to 95] ∈ UNINITIALIZED [697].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [697].f5 ∈ [--..--] [697].[bits 136 to 159] ∈ UNINITIALIZED [698].f1 ∈ [--..--] [698].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [698].f3 ∈ [--..--] [698].[bits 72 to 95] ∈ UNINITIALIZED [698].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [698].f5 ∈ [--..--] [698].[bits 136 to 159] ∈ UNINITIALIZED [699].f1 ∈ [--..--] [699].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [699].f3 ∈ [--..--] [699].[bits 72 to 95] ∈ UNINITIALIZED [699].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [699].f5 ∈ [--..--] [699].[bits 136 to 159] ∈ UNINITIALIZED [700].f1 ∈ [--..--] [700].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [700].f3 ∈ [--..--] [700].[bits 72 to 95] ∈ UNINITIALIZED [700].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [700].f5 ∈ [--..--] [700].[bits 136 to 159] ∈ UNINITIALIZED [701].f1 ∈ [--..--] [701].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [701].f3 ∈ [--..--] [701].[bits 72 to 95] ∈ UNINITIALIZED [701].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [701].f5 ∈ [--..--] [701].[bits 136 to 159] ∈ UNINITIALIZED [702].f1 ∈ [--..--] [702].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [702].f3 ∈ [--..--] [702].[bits 72 to 95] ∈ UNINITIALIZED [702].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [702].f5 ∈ [--..--] [702].[bits 136 to 159] ∈ UNINITIALIZED [703].f1 ∈ [--..--] [703].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [703].f3 ∈ [--..--] [703].[bits 72 to 95] ∈ UNINITIALIZED [703].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [703].f5 ∈ [--..--] [703].[bits 136 to 159] ∈ UNINITIALIZED [704].f1 ∈ [--..--] [704].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [704].f3 ∈ [--..--] [704].[bits 72 to 95] ∈ UNINITIALIZED [704].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [704].f5 ∈ [--..--] [704].[bits 136 to 159] ∈ UNINITIALIZED [705].f1 ∈ [--..--] [705].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [705].f3 ∈ [--..--] [705].[bits 72 to 95] ∈ UNINITIALIZED [705].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [705].f5 ∈ [--..--] [705].[bits 136 to 159] ∈ UNINITIALIZED [706].f1 ∈ [--..--] [706].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [706].f3 ∈ [--..--] [706].[bits 72 to 95] ∈ UNINITIALIZED [706].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [706].f5 ∈ [--..--] [706].[bits 136 to 159] ∈ UNINITIALIZED [707].f1 ∈ [--..--] [707].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [707].f3 ∈ [--..--] [707].[bits 72 to 95] ∈ UNINITIALIZED [707].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [707].f5 ∈ [--..--] [707].[bits 136 to 159] ∈ UNINITIALIZED [708].f1 ∈ [--..--] [708].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [708].f3 ∈ [--..--] [708].[bits 72 to 95] ∈ UNINITIALIZED [708].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [708].f5 ∈ [--..--] [708].[bits 136 to 159] ∈ UNINITIALIZED [709].f1 ∈ [--..--] [709].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [709].f3 ∈ [--..--] [709].[bits 72 to 95] ∈ UNINITIALIZED [709].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [709].f5 ∈ [--..--] [709].[bits 136 to 159] ∈ UNINITIALIZED [710].f1 ∈ [--..--] [710].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [710].f3 ∈ [--..--] [710].[bits 72 to 95] ∈ UNINITIALIZED [710].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [710].f5 ∈ [--..--] [710].[bits 136 to 159] ∈ UNINITIALIZED [711].f1 ∈ [--..--] [711].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [711].f3 ∈ [--..--] [711].[bits 72 to 95] ∈ UNINITIALIZED [711].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [711].f5 ∈ [--..--] [711].[bits 136 to 159] ∈ UNINITIALIZED [712].f1 ∈ [--..--] [712].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [712].f3 ∈ [--..--] [712].[bits 72 to 95] ∈ UNINITIALIZED [712].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [712].f5 ∈ [--..--] [712].[bits 136 to 159] ∈ UNINITIALIZED [713].f1 ∈ [--..--] [713].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [713].f3 ∈ [--..--] [713].[bits 72 to 95] ∈ UNINITIALIZED [713].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [713].f5 ∈ [--..--] [713].[bits 136 to 159] ∈ UNINITIALIZED [714].f1 ∈ [--..--] [714].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [714].f3 ∈ [--..--] [714].[bits 72 to 95] ∈ UNINITIALIZED [714].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [714].f5 ∈ [--..--] [714].[bits 136 to 159] ∈ UNINITIALIZED [715].f1 ∈ [--..--] [715].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [715].f3 ∈ [--..--] [715].[bits 72 to 95] ∈ UNINITIALIZED [715].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [715].f5 ∈ [--..--] [715].[bits 136 to 159] ∈ UNINITIALIZED [716].f1 ∈ [--..--] [716].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [716].f3 ∈ [--..--] [716].[bits 72 to 95] ∈ UNINITIALIZED [716].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [716].f5 ∈ [--..--] [716].[bits 136 to 159] ∈ UNINITIALIZED [717].f1 ∈ [--..--] [717].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [717].f3 ∈ [--..--] [717].[bits 72 to 95] ∈ UNINITIALIZED [717].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [717].f5 ∈ [--..--] [717].[bits 136 to 159] ∈ UNINITIALIZED [718].f1 ∈ [--..--] [718].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [718].f3 ∈ [--..--] [718].[bits 72 to 95] ∈ UNINITIALIZED [718].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [718].f5 ∈ [--..--] [718].[bits 136 to 159] ∈ UNINITIALIZED [719].f1 ∈ [--..--] [719].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [719].f3 ∈ [--..--] [719].[bits 72 to 95] ∈ UNINITIALIZED [719].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [719].f5 ∈ [--..--] [719].[bits 136 to 159] ∈ UNINITIALIZED [720].f1 ∈ [--..--] [720].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [720].f3 ∈ [--..--] [720].[bits 72 to 95] ∈ UNINITIALIZED [720].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [720].f5 ∈ [--..--] [720].[bits 136 to 159] ∈ UNINITIALIZED [721].f1 ∈ [--..--] [721].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [721].f3 ∈ [--..--] [721].[bits 72 to 95] ∈ UNINITIALIZED [721].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [721].f5 ∈ [--..--] [721].[bits 136 to 159] ∈ UNINITIALIZED [722].f1 ∈ [--..--] [722].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [722].f3 ∈ [--..--] [722].[bits 72 to 95] ∈ UNINITIALIZED [722].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [722].f5 ∈ [--..--] [722].[bits 136 to 159] ∈ UNINITIALIZED [723].f1 ∈ [--..--] [723].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [723].f3 ∈ [--..--] [723].[bits 72 to 95] ∈ UNINITIALIZED [723].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [723].f5 ∈ [--..--] [723].[bits 136 to 159] ∈ UNINITIALIZED [724].f1 ∈ [--..--] [724].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [724].f3 ∈ [--..--] [724].[bits 72 to 95] ∈ UNINITIALIZED [724].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [724].f5 ∈ [--..--] [724].[bits 136 to 159] ∈ UNINITIALIZED [725].f1 ∈ [--..--] [725].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [725].f3 ∈ [--..--] [725].[bits 72 to 95] ∈ UNINITIALIZED [725].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [725].f5 ∈ [--..--] [725].[bits 136 to 159] ∈ UNINITIALIZED [726].f1 ∈ [--..--] [726].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [726].f3 ∈ [--..--] [726].[bits 72 to 95] ∈ UNINITIALIZED [726].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [726].f5 ∈ [--..--] [726].[bits 136 to 159] ∈ UNINITIALIZED [727].f1 ∈ [--..--] [727].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [727].f3 ∈ [--..--] [727].[bits 72 to 95] ∈ UNINITIALIZED [727].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [727].f5 ∈ [--..--] [727].[bits 136 to 159] ∈ UNINITIALIZED [728].f1 ∈ [--..--] [728].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [728].f3 ∈ [--..--] [728].[bits 72 to 95] ∈ UNINITIALIZED [728].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [728].f5 ∈ [--..--] [728].[bits 136 to 159] ∈ UNINITIALIZED [729].f1 ∈ [--..--] [729].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [729].f3 ∈ [--..--] [729].[bits 72 to 95] ∈ UNINITIALIZED [729].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [729].f5 ∈ [--..--] [729].[bits 136 to 159] ∈ UNINITIALIZED [730].f1 ∈ [--..--] [730].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [730].f3 ∈ [--..--] [730].[bits 72 to 95] ∈ UNINITIALIZED [730].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [730].f5 ∈ [--..--] [730].[bits 136 to 159] ∈ UNINITIALIZED [731].f1 ∈ [--..--] [731].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [731].f3 ∈ [--..--] [731].[bits 72 to 95] ∈ UNINITIALIZED [731].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [731].f5 ∈ [--..--] [731].[bits 136 to 159] ∈ UNINITIALIZED [732].f1 ∈ [--..--] [732].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [732].f3 ∈ [--..--] [732].[bits 72 to 95] ∈ UNINITIALIZED [732].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [732].f5 ∈ [--..--] [732].[bits 136 to 159] ∈ UNINITIALIZED [733].f1 ∈ [--..--] [733].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [733].f3 ∈ [--..--] [733].[bits 72 to 95] ∈ UNINITIALIZED [733].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [733].f5 ∈ [--..--] [733].[bits 136 to 159] ∈ UNINITIALIZED [734].f1 ∈ [--..--] [734].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [734].f3 ∈ [--..--] [734].[bits 72 to 95] ∈ UNINITIALIZED [734].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [734].f5 ∈ [--..--] [734].[bits 136 to 159] ∈ UNINITIALIZED [735].f1 ∈ [--..--] [735].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [735].f3 ∈ [--..--] [735].[bits 72 to 95] ∈ UNINITIALIZED [735].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [735].f5 ∈ [--..--] [735].[bits 136 to 159] ∈ UNINITIALIZED [736].f1 ∈ [--..--] [736].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [736].f3 ∈ [--..--] [736].[bits 72 to 95] ∈ UNINITIALIZED [736].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [736].f5 ∈ [--..--] [736].[bits 136 to 159] ∈ UNINITIALIZED [737].f1 ∈ [--..--] [737].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [737].f3 ∈ [--..--] [737].[bits 72 to 95] ∈ UNINITIALIZED [737].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [737].f5 ∈ [--..--] [737].[bits 136 to 159] ∈ UNINITIALIZED [738].f1 ∈ [--..--] [738].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [738].f3 ∈ [--..--] [738].[bits 72 to 95] ∈ UNINITIALIZED [738].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [738].f5 ∈ [--..--] [738].[bits 136 to 159] ∈ UNINITIALIZED [739].f1 ∈ [--..--] [739].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [739].f3 ∈ [--..--] [739].[bits 72 to 95] ∈ UNINITIALIZED [739].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [739].f5 ∈ [--..--] [739].[bits 136 to 159] ∈ UNINITIALIZED [740].f1 ∈ [--..--] [740].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [740].f3 ∈ [--..--] [740].[bits 72 to 95] ∈ UNINITIALIZED [740].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [740].f5 ∈ [--..--] [740].[bits 136 to 159] ∈ UNINITIALIZED [741].f1 ∈ [--..--] [741].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [741].f3 ∈ [--..--] [741].[bits 72 to 95] ∈ UNINITIALIZED [741].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [741].f5 ∈ [--..--] [741].[bits 136 to 159] ∈ UNINITIALIZED [742].f1 ∈ [--..--] [742].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [742].f3 ∈ [--..--] [742].[bits 72 to 95] ∈ UNINITIALIZED [742].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [742].f5 ∈ [--..--] [742].[bits 136 to 159] ∈ UNINITIALIZED [743].f1 ∈ [--..--] [743].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [743].f3 ∈ [--..--] [743].[bits 72 to 95] ∈ UNINITIALIZED [743].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [743].f5 ∈ [--..--] [743].[bits 136 to 159] ∈ UNINITIALIZED [744].f1 ∈ [--..--] [744].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [744].f3 ∈ [--..--] [744].[bits 72 to 95] ∈ UNINITIALIZED [744].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [744].f5 ∈ [--..--] [744].[bits 136 to 159] ∈ UNINITIALIZED [745].f1 ∈ [--..--] [745].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [745].f3 ∈ [--..--] [745].[bits 72 to 95] ∈ UNINITIALIZED [745].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [745].f5 ∈ [--..--] [745].[bits 136 to 159] ∈ UNINITIALIZED [746].f1 ∈ [--..--] [746].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [746].f3 ∈ [--..--] [746].[bits 72 to 95] ∈ UNINITIALIZED [746].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [746].f5 ∈ [--..--] [746].[bits 136 to 159] ∈ UNINITIALIZED [747].f1 ∈ [--..--] [747].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [747].f3 ∈ [--..--] [747].[bits 72 to 95] ∈ UNINITIALIZED [747].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [747].f5 ∈ [--..--] [747].[bits 136 to 159] ∈ UNINITIALIZED [748].f1 ∈ [--..--] [748].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [748].f3 ∈ [--..--] [748].[bits 72 to 95] ∈ UNINITIALIZED [748].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [748].f5 ∈ [--..--] [748].[bits 136 to 159] ∈ UNINITIALIZED [749].f1 ∈ [--..--] [749].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [749].f3 ∈ [--..--] [749].[bits 72 to 95] ∈ UNINITIALIZED [749].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [749].f5 ∈ [--..--] [749].[bits 136 to 159] ∈ UNINITIALIZED [750].f1 ∈ [--..--] [750].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [750].f3 ∈ [--..--] [750].[bits 72 to 95] ∈ UNINITIALIZED [750].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [750].f5 ∈ [--..--] [750].[bits 136 to 159] ∈ UNINITIALIZED [751].f1 ∈ [--..--] [751].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [751].f3 ∈ [--..--] [751].[bits 72 to 95] ∈ UNINITIALIZED [751].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [751].f5 ∈ [--..--] [751].[bits 136 to 159] ∈ UNINITIALIZED [752].f1 ∈ [--..--] [752].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [752].f3 ∈ [--..--] [752].[bits 72 to 95] ∈ UNINITIALIZED [752].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [752].f5 ∈ [--..--] [752].[bits 136 to 159] ∈ UNINITIALIZED [753].f1 ∈ [--..--] [753].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [753].f3 ∈ [--..--] [753].[bits 72 to 95] ∈ UNINITIALIZED [753].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [753].f5 ∈ [--..--] [753].[bits 136 to 159] ∈ UNINITIALIZED [754].f1 ∈ [--..--] [754].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [754].f3 ∈ [--..--] [754].[bits 72 to 95] ∈ UNINITIALIZED [754].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [754].f5 ∈ [--..--] [754].[bits 136 to 159] ∈ UNINITIALIZED [755].f1 ∈ [--..--] [755].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [755].f3 ∈ [--..--] [755].[bits 72 to 95] ∈ UNINITIALIZED [755].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [755].f5 ∈ [--..--] [755].[bits 136 to 159] ∈ UNINITIALIZED [756].f1 ∈ [--..--] [756].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [756].f3 ∈ [--..--] [756].[bits 72 to 95] ∈ UNINITIALIZED [756].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [756].f5 ∈ [--..--] [756].[bits 136 to 159] ∈ UNINITIALIZED [757].f1 ∈ [--..--] [757].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [757].f3 ∈ [--..--] [757].[bits 72 to 95] ∈ UNINITIALIZED [757].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [757].f5 ∈ [--..--] [757].[bits 136 to 159] ∈ UNINITIALIZED [758].f1 ∈ [--..--] [758].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [758].f3 ∈ [--..--] [758].[bits 72 to 95] ∈ UNINITIALIZED [758].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [758].f5 ∈ [--..--] [758].[bits 136 to 159] ∈ UNINITIALIZED [759].f1 ∈ [--..--] [759].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [759].f3 ∈ [--..--] [759].[bits 72 to 95] ∈ UNINITIALIZED [759].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [759].f5 ∈ [--..--] [759].[bits 136 to 159] ∈ UNINITIALIZED [760].f1 ∈ [--..--] [760].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [760].f3 ∈ [--..--] [760].[bits 72 to 95] ∈ UNINITIALIZED [760].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [760].f5 ∈ [--..--] [760].[bits 136 to 159] ∈ UNINITIALIZED [761].f1 ∈ [--..--] [761].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [761].f3 ∈ [--..--] [761].[bits 72 to 95] ∈ UNINITIALIZED [761].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [761].f5 ∈ [--..--] [761].[bits 136 to 159] ∈ UNINITIALIZED [762].f1 ∈ [--..--] [762].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [762].f3 ∈ [--..--] [762].[bits 72 to 95] ∈ UNINITIALIZED [762].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [762].f5 ∈ [--..--] [762].[bits 136 to 159] ∈ UNINITIALIZED [763].f1 ∈ [--..--] [763].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [763].f3 ∈ [--..--] [763].[bits 72 to 95] ∈ UNINITIALIZED [763].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [763].f5 ∈ [--..--] [763].[bits 136 to 159] ∈ UNINITIALIZED [764].f1 ∈ [--..--] [764].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [764].f3 ∈ [--..--] [764].[bits 72 to 95] ∈ UNINITIALIZED [764].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [764].f5 ∈ [--..--] [764].[bits 136 to 159] ∈ UNINITIALIZED [765].f1 ∈ [--..--] [765].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [765].f3 ∈ [--..--] [765].[bits 72 to 95] ∈ UNINITIALIZED [765].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [765].f5 ∈ [--..--] [765].[bits 136 to 159] ∈ UNINITIALIZED [766].f1 ∈ [--..--] [766].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [766].f3 ∈ [--..--] [766].[bits 72 to 95] ∈ UNINITIALIZED [766].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [766].f5 ∈ [--..--] [766].[bits 136 to 159] ∈ UNINITIALIZED [767].f1 ∈ [--..--] [767].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [767].f3 ∈ [--..--] [767].[bits 72 to 95] ∈ UNINITIALIZED [767].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [767].f5 ∈ [--..--] [767].[bits 136 to 159] ∈ UNINITIALIZED [768].f1 ∈ [--..--] [768].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [768].f3 ∈ [--..--] [768].[bits 72 to 95] ∈ UNINITIALIZED [768].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [768].f5 ∈ [--..--] [768].[bits 136 to 159] ∈ UNINITIALIZED [769].f1 ∈ [--..--] [769].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [769].f3 ∈ [--..--] [769].[bits 72 to 95] ∈ UNINITIALIZED [769].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [769].f5 ∈ [--..--] [769].[bits 136 to 159] ∈ UNINITIALIZED [770].f1 ∈ [--..--] [770].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [770].f3 ∈ [--..--] [770].[bits 72 to 95] ∈ UNINITIALIZED [770].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [770].f5 ∈ [--..--] [770].[bits 136 to 159] ∈ UNINITIALIZED [771].f1 ∈ [--..--] [771].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [771].f3 ∈ [--..--] [771].[bits 72 to 95] ∈ UNINITIALIZED [771].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [771].f5 ∈ [--..--] [771].[bits 136 to 159] ∈ UNINITIALIZED [772].f1 ∈ [--..--] [772].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [772].f3 ∈ [--..--] [772].[bits 72 to 95] ∈ UNINITIALIZED [772].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [772].f5 ∈ [--..--] [772].[bits 136 to 159] ∈ UNINITIALIZED [773].f1 ∈ [--..--] [773].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [773].f3 ∈ [--..--] [773].[bits 72 to 95] ∈ UNINITIALIZED [773].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [773].f5 ∈ [--..--] [773].[bits 136 to 159] ∈ UNINITIALIZED [774].f1 ∈ [--..--] [774].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [774].f3 ∈ [--..--] [774].[bits 72 to 95] ∈ UNINITIALIZED [774].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [774].f5 ∈ [--..--] [774].[bits 136 to 159] ∈ UNINITIALIZED [775].f1 ∈ [--..--] [775].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [775].f3 ∈ [--..--] [775].[bits 72 to 95] ∈ UNINITIALIZED [775].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [775].f5 ∈ [--..--] [775].[bits 136 to 159] ∈ UNINITIALIZED [776].f1 ∈ [--..--] [776].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [776].f3 ∈ [--..--] [776].[bits 72 to 95] ∈ UNINITIALIZED [776].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [776].f5 ∈ [--..--] [776].[bits 136 to 159] ∈ UNINITIALIZED [777].f1 ∈ [--..--] [777].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [777].f3 ∈ [--..--] [777].[bits 72 to 95] ∈ UNINITIALIZED [777].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [777].f5 ∈ [--..--] [777].[bits 136 to 159] ∈ UNINITIALIZED [778].f1 ∈ [--..--] [778].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [778].f3 ∈ [--..--] [778].[bits 72 to 95] ∈ UNINITIALIZED [778].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [778].f5 ∈ [--..--] [778].[bits 136 to 159] ∈ UNINITIALIZED [779].f1 ∈ [--..--] [779].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [779].f3 ∈ [--..--] [779].[bits 72 to 95] ∈ UNINITIALIZED [779].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [779].f5 ∈ [--..--] [779].[bits 136 to 159] ∈ UNINITIALIZED [780].f1 ∈ [--..--] [780].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [780].f3 ∈ [--..--] [780].[bits 72 to 95] ∈ UNINITIALIZED [780].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [780].f5 ∈ [--..--] [780].[bits 136 to 159] ∈ UNINITIALIZED [781].f1 ∈ [--..--] [781].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [781].f3 ∈ [--..--] [781].[bits 72 to 95] ∈ UNINITIALIZED [781].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [781].f5 ∈ [--..--] [781].[bits 136 to 159] ∈ UNINITIALIZED [782].f1 ∈ [--..--] [782].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [782].f3 ∈ [--..--] [782].[bits 72 to 95] ∈ UNINITIALIZED [782].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [782].f5 ∈ [--..--] [782].[bits 136 to 159] ∈ UNINITIALIZED [783].f1 ∈ [--..--] [783].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [783].f3 ∈ [--..--] [783].[bits 72 to 95] ∈ UNINITIALIZED [783].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [783].f5 ∈ [--..--] [783].[bits 136 to 159] ∈ UNINITIALIZED [784].f1 ∈ [--..--] [784].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [784].f3 ∈ [--..--] [784].[bits 72 to 95] ∈ UNINITIALIZED [784].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [784].f5 ∈ [--..--] [784].[bits 136 to 159] ∈ UNINITIALIZED [785].f1 ∈ [--..--] [785].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [785].f3 ∈ [--..--] [785].[bits 72 to 95] ∈ UNINITIALIZED [785].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [785].f5 ∈ [--..--] [785].[bits 136 to 159] ∈ UNINITIALIZED [786].f1 ∈ [--..--] [786].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [786].f3 ∈ [--..--] [786].[bits 72 to 95] ∈ UNINITIALIZED [786].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [786].f5 ∈ [--..--] [786].[bits 136 to 159] ∈ UNINITIALIZED [787].f1 ∈ [--..--] [787].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [787].f3 ∈ [--..--] [787].[bits 72 to 95] ∈ UNINITIALIZED [787].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [787].f5 ∈ [--..--] [787].[bits 136 to 159] ∈ UNINITIALIZED [788].f1 ∈ [--..--] [788].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [788].f3 ∈ [--..--] [788].[bits 72 to 95] ∈ UNINITIALIZED [788].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [788].f5 ∈ [--..--] [788].[bits 136 to 159] ∈ UNINITIALIZED [789].f1 ∈ [--..--] [789].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [789].f3 ∈ [--..--] [789].[bits 72 to 95] ∈ UNINITIALIZED [789].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [789].f5 ∈ [--..--] [789].[bits 136 to 159] ∈ UNINITIALIZED [790].f1 ∈ [--..--] [790].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [790].f3 ∈ [--..--] [790].[bits 72 to 95] ∈ UNINITIALIZED [790].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [790].f5 ∈ [--..--] [790].[bits 136 to 159] ∈ UNINITIALIZED [791].f1 ∈ [--..--] [791].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [791].f3 ∈ [--..--] [791].[bits 72 to 95] ∈ UNINITIALIZED [791].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [791].f5 ∈ [--..--] [791].[bits 136 to 159] ∈ UNINITIALIZED [792].f1 ∈ [--..--] [792].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [792].f3 ∈ [--..--] [792].[bits 72 to 95] ∈ UNINITIALIZED [792].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [792].f5 ∈ [--..--] [792].[bits 136 to 159] ∈ UNINITIALIZED [793].f1 ∈ [--..--] [793].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [793].f3 ∈ [--..--] [793].[bits 72 to 95] ∈ UNINITIALIZED [793].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [793].f5 ∈ [--..--] [793].[bits 136 to 159] ∈ UNINITIALIZED [794].f1 ∈ [--..--] [794].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [794].f3 ∈ [--..--] [794].[bits 72 to 95] ∈ UNINITIALIZED [794].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [794].f5 ∈ [--..--] [794].[bits 136 to 159] ∈ UNINITIALIZED [795].f1 ∈ [--..--] [795].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [795].f3 ∈ [--..--] [795].[bits 72 to 95] ∈ UNINITIALIZED [795].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [795].f5 ∈ [--..--] [795].[bits 136 to 159] ∈ UNINITIALIZED [796].f1 ∈ [--..--] [796].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [796].f3 ∈ [--..--] [796].[bits 72 to 95] ∈ UNINITIALIZED [796].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [796].f5 ∈ [--..--] [796].[bits 136 to 159] ∈ UNINITIALIZED [797].f1 ∈ [--..--] [797].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [797].f3 ∈ [--..--] [797].[bits 72 to 95] ∈ UNINITIALIZED [797].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [797].f5 ∈ [--..--] [797].[bits 136 to 159] ∈ UNINITIALIZED [798].f1 ∈ [--..--] [798].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [798].f3 ∈ [--..--] [798].[bits 72 to 95] ∈ UNINITIALIZED [798].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [798].f5 ∈ [--..--] [798].[bits 136 to 159] ∈ UNINITIALIZED [799].f1 ∈ [--..--] [799].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [799].f3 ∈ [--..--] [799].[bits 72 to 95] ∈ UNINITIALIZED [799].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [799].f5 ∈ [--..--] [799].[bits 136 to 159] ∈ UNINITIALIZED [800].f1 ∈ [--..--] [800].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [800].f3 ∈ [--..--] [800].[bits 72 to 95] ∈ UNINITIALIZED [800].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [800].f5 ∈ [--..--] [800].[bits 136 to 159] ∈ UNINITIALIZED [801].f1 ∈ [--..--] [801].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [801].f3 ∈ [--..--] [801].[bits 72 to 95] ∈ UNINITIALIZED [801].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [801].f5 ∈ [--..--] [801].[bits 136 to 159] ∈ UNINITIALIZED [802].f1 ∈ [--..--] [802].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [802].f3 ∈ [--..--] [802].[bits 72 to 95] ∈ UNINITIALIZED [802].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [802].f5 ∈ [--..--] [802].[bits 136 to 159] ∈ UNINITIALIZED [803].f1 ∈ [--..--] [803].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [803].f3 ∈ [--..--] [803].[bits 72 to 95] ∈ UNINITIALIZED [803].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [803].f5 ∈ [--..--] [803].[bits 136 to 159] ∈ UNINITIALIZED [804].f1 ∈ [--..--] [804].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [804].f3 ∈ [--..--] [804].[bits 72 to 95] ∈ UNINITIALIZED [804].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [804].f5 ∈ [--..--] [804].[bits 136 to 159] ∈ UNINITIALIZED [805].f1 ∈ [--..--] [805].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [805].f3 ∈ [--..--] [805].[bits 72 to 95] ∈ UNINITIALIZED [805].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [805].f5 ∈ [--..--] [805].[bits 136 to 159] ∈ UNINITIALIZED [806].f1 ∈ [--..--] [806].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [806].f3 ∈ [--..--] [806].[bits 72 to 95] ∈ UNINITIALIZED [806].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [806].f5 ∈ [--..--] [806].[bits 136 to 159] ∈ UNINITIALIZED [807].f1 ∈ [--..--] [807].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [807].f3 ∈ [--..--] [807].[bits 72 to 95] ∈ UNINITIALIZED [807].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [807].f5 ∈ [--..--] [807].[bits 136 to 159] ∈ UNINITIALIZED [808].f1 ∈ [--..--] [808].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [808].f3 ∈ [--..--] [808].[bits 72 to 95] ∈ UNINITIALIZED [808].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [808].f5 ∈ [--..--] [808].[bits 136 to 159] ∈ UNINITIALIZED [809].f1 ∈ [--..--] [809].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [809].f3 ∈ [--..--] [809].[bits 72 to 95] ∈ UNINITIALIZED [809].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [809].f5 ∈ [--..--] [809].[bits 136 to 159] ∈ UNINITIALIZED [810].f1 ∈ [--..--] [810].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [810].f3 ∈ [--..--] [810].[bits 72 to 95] ∈ UNINITIALIZED [810].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [810].f5 ∈ [--..--] [810].[bits 136 to 159] ∈ UNINITIALIZED [811].f1 ∈ [--..--] [811].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [811].f3 ∈ [--..--] [811].[bits 72 to 95] ∈ UNINITIALIZED [811].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [811].f5 ∈ [--..--] [811].[bits 136 to 159] ∈ UNINITIALIZED [812].f1 ∈ [--..--] [812].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [812].f3 ∈ [--..--] [812].[bits 72 to 95] ∈ UNINITIALIZED [812].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [812].f5 ∈ [--..--] [812].[bits 136 to 159] ∈ UNINITIALIZED [813].f1 ∈ [--..--] [813].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [813].f3 ∈ [--..--] [813].[bits 72 to 95] ∈ UNINITIALIZED [813].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [813].f5 ∈ [--..--] [813].[bits 136 to 159] ∈ UNINITIALIZED [814].f1 ∈ [--..--] [814].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [814].f3 ∈ [--..--] [814].[bits 72 to 95] ∈ UNINITIALIZED [814].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [814].f5 ∈ [--..--] [814].[bits 136 to 159] ∈ UNINITIALIZED [815].f1 ∈ [--..--] [815].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [815].f3 ∈ [--..--] [815].[bits 72 to 95] ∈ UNINITIALIZED [815].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [815].f5 ∈ [--..--] [815].[bits 136 to 159] ∈ UNINITIALIZED [816].f1 ∈ [--..--] [816].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [816].f3 ∈ [--..--] [816].[bits 72 to 95] ∈ UNINITIALIZED [816].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [816].f5 ∈ [--..--] [816].[bits 136 to 159] ∈ UNINITIALIZED [817].f1 ∈ [--..--] [817].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [817].f3 ∈ [--..--] [817].[bits 72 to 95] ∈ UNINITIALIZED [817].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [817].f5 ∈ [--..--] [817].[bits 136 to 159] ∈ UNINITIALIZED [818].f1 ∈ [--..--] [818].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [818].f3 ∈ [--..--] [818].[bits 72 to 95] ∈ UNINITIALIZED [818].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [818].f5 ∈ [--..--] [818].[bits 136 to 159] ∈ UNINITIALIZED [819].f1 ∈ [--..--] [819].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [819].f3 ∈ [--..--] [819].[bits 72 to 95] ∈ UNINITIALIZED [819].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [819].f5 ∈ [--..--] [819].[bits 136 to 159] ∈ UNINITIALIZED [820].f1 ∈ [--..--] [820].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [820].f3 ∈ [--..--] [820].[bits 72 to 95] ∈ UNINITIALIZED [820].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [820].f5 ∈ [--..--] [820].[bits 136 to 159] ∈ UNINITIALIZED [821].f1 ∈ [--..--] [821].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [821].f3 ∈ [--..--] [821].[bits 72 to 95] ∈ UNINITIALIZED [821].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [821].f5 ∈ [--..--] [821].[bits 136 to 159] ∈ UNINITIALIZED [822].f1 ∈ [--..--] [822].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [822].f3 ∈ [--..--] [822].[bits 72 to 95] ∈ UNINITIALIZED [822].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [822].f5 ∈ [--..--] [822].[bits 136 to 159] ∈ UNINITIALIZED [823].f1 ∈ [--..--] [823].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [823].f3 ∈ [--..--] [823].[bits 72 to 95] ∈ UNINITIALIZED [823].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [823].f5 ∈ [--..--] [823].[bits 136 to 159] ∈ UNINITIALIZED [824].f1 ∈ [--..--] [824].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [824].f3 ∈ [--..--] [824].[bits 72 to 95] ∈ UNINITIALIZED [824].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [824].f5 ∈ [--..--] [824].[bits 136 to 159] ∈ UNINITIALIZED [825].f1 ∈ [--..--] [825].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [825].f3 ∈ [--..--] [825].[bits 72 to 95] ∈ UNINITIALIZED [825].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [825].f5 ∈ [--..--] [825].[bits 136 to 159] ∈ UNINITIALIZED [826].f1 ∈ [--..--] [826].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [826].f3 ∈ [--..--] [826].[bits 72 to 95] ∈ UNINITIALIZED [826].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [826].f5 ∈ [--..--] [826].[bits 136 to 159] ∈ UNINITIALIZED [827].f1 ∈ [--..--] [827].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [827].f3 ∈ [--..--] [827].[bits 72 to 95] ∈ UNINITIALIZED [827].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [827].f5 ∈ [--..--] [827].[bits 136 to 159] ∈ UNINITIALIZED [828].f1 ∈ [--..--] [828].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [828].f3 ∈ [--..--] [828].[bits 72 to 95] ∈ UNINITIALIZED [828].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [828].f5 ∈ [--..--] [828].[bits 136 to 159] ∈ UNINITIALIZED [829].f1 ∈ [--..--] [829].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [829].f3 ∈ [--..--] [829].[bits 72 to 95] ∈ UNINITIALIZED [829].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [829].f5 ∈ [--..--] [829].[bits 136 to 159] ∈ UNINITIALIZED [830].f1 ∈ [--..--] [830].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [830].f3 ∈ [--..--] [830].[bits 72 to 95] ∈ UNINITIALIZED [830].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [830].f5 ∈ [--..--] [830].[bits 136 to 159] ∈ UNINITIALIZED [831].f1 ∈ [--..--] [831].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [831].f3 ∈ [--..--] [831].[bits 72 to 95] ∈ UNINITIALIZED [831].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [831].f5 ∈ [--..--] [831].[bits 136 to 159] ∈ UNINITIALIZED [832].f1 ∈ [--..--] [832].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [832].f3 ∈ [--..--] [832].[bits 72 to 95] ∈ UNINITIALIZED [832].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [832].f5 ∈ [--..--] [832].[bits 136 to 159] ∈ UNINITIALIZED [833].f1 ∈ [--..--] [833].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [833].f3 ∈ [--..--] [833].[bits 72 to 95] ∈ UNINITIALIZED [833].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [833].f5 ∈ [--..--] [833].[bits 136 to 159] ∈ UNINITIALIZED [834].f1 ∈ [--..--] [834].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [834].f3 ∈ [--..--] [834].[bits 72 to 95] ∈ UNINITIALIZED [834].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [834].f5 ∈ [--..--] [834].[bits 136 to 159] ∈ UNINITIALIZED [835].f1 ∈ [--..--] [835].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [835].f3 ∈ [--..--] [835].[bits 72 to 95] ∈ UNINITIALIZED [835].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [835].f5 ∈ [--..--] [835].[bits 136 to 159] ∈ UNINITIALIZED [836].f1 ∈ [--..--] [836].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [836].f3 ∈ [--..--] [836].[bits 72 to 95] ∈ UNINITIALIZED [836].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [836].f5 ∈ [--..--] [836].[bits 136 to 159] ∈ UNINITIALIZED [837].f1 ∈ [--..--] [837].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [837].f3 ∈ [--..--] [837].[bits 72 to 95] ∈ UNINITIALIZED [837].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [837].f5 ∈ [--..--] [837].[bits 136 to 159] ∈ UNINITIALIZED [838].f1 ∈ [--..--] [838].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [838].f3 ∈ [--..--] [838].[bits 72 to 95] ∈ UNINITIALIZED [838].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [838].f5 ∈ [--..--] [838].[bits 136 to 159] ∈ UNINITIALIZED [839].f1 ∈ [--..--] [839].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [839].f3 ∈ [--..--] [839].[bits 72 to 95] ∈ UNINITIALIZED [839].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [839].f5 ∈ [--..--] [839].[bits 136 to 159] ∈ UNINITIALIZED [840].f1 ∈ [--..--] [840].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [840].f3 ∈ [--..--] [840].[bits 72 to 95] ∈ UNINITIALIZED [840].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [840].f5 ∈ [--..--] [840].[bits 136 to 159] ∈ UNINITIALIZED [841].f1 ∈ [--..--] [841].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [841].f3 ∈ [--..--] [841].[bits 72 to 95] ∈ UNINITIALIZED [841].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [841].f5 ∈ [--..--] [841].[bits 136 to 159] ∈ UNINITIALIZED [842].f1 ∈ [--..--] [842].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [842].f3 ∈ [--..--] [842].[bits 72 to 95] ∈ UNINITIALIZED [842].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [842].f5 ∈ [--..--] [842].[bits 136 to 159] ∈ UNINITIALIZED [843].f1 ∈ [--..--] [843].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [843].f3 ∈ [--..--] [843].[bits 72 to 95] ∈ UNINITIALIZED [843].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [843].f5 ∈ [--..--] [843].[bits 136 to 159] ∈ UNINITIALIZED [844].f1 ∈ [--..--] [844].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [844].f3 ∈ [--..--] [844].[bits 72 to 95] ∈ UNINITIALIZED [844].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [844].f5 ∈ [--..--] [844].[bits 136 to 159] ∈ UNINITIALIZED [845].f1 ∈ [--..--] [845].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [845].f3 ∈ [--..--] [845].[bits 72 to 95] ∈ UNINITIALIZED [845].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [845].f5 ∈ [--..--] [845].[bits 136 to 159] ∈ UNINITIALIZED [846].f1 ∈ [--..--] [846].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [846].f3 ∈ [--..--] [846].[bits 72 to 95] ∈ UNINITIALIZED [846].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [846].f5 ∈ [--..--] [846].[bits 136 to 159] ∈ UNINITIALIZED [847].f1 ∈ [--..--] [847].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [847].f3 ∈ [--..--] [847].[bits 72 to 95] ∈ UNINITIALIZED [847].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [847].f5 ∈ [--..--] [847].[bits 136 to 159] ∈ UNINITIALIZED [848].f1 ∈ [--..--] [848].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [848].f3 ∈ [--..--] [848].[bits 72 to 95] ∈ UNINITIALIZED [848].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [848].f5 ∈ [--..--] [848].[bits 136 to 159] ∈ UNINITIALIZED [849].f1 ∈ [--..--] [849].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [849].f3 ∈ [--..--] [849].[bits 72 to 95] ∈ UNINITIALIZED [849].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [849].f5 ∈ [--..--] [849].[bits 136 to 159] ∈ UNINITIALIZED [850].f1 ∈ [--..--] [850].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [850].f3 ∈ [--..--] [850].[bits 72 to 95] ∈ UNINITIALIZED [850].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [850].f5 ∈ [--..--] [850].[bits 136 to 159] ∈ UNINITIALIZED [851].f1 ∈ [--..--] [851].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [851].f3 ∈ [--..--] [851].[bits 72 to 95] ∈ UNINITIALIZED [851].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [851].f5 ∈ [--..--] [851].[bits 136 to 159] ∈ UNINITIALIZED [852].f1 ∈ [--..--] [852].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [852].f3 ∈ [--..--] [852].[bits 72 to 95] ∈ UNINITIALIZED [852].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [852].f5 ∈ [--..--] [852].[bits 136 to 159] ∈ UNINITIALIZED [853].f1 ∈ [--..--] [853].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [853].f3 ∈ [--..--] [853].[bits 72 to 95] ∈ UNINITIALIZED [853].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [853].f5 ∈ [--..--] [853].[bits 136 to 159] ∈ UNINITIALIZED [854].f1 ∈ [--..--] [854].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [854].f3 ∈ [--..--] [854].[bits 72 to 95] ∈ UNINITIALIZED [854].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [854].f5 ∈ [--..--] [854].[bits 136 to 159] ∈ UNINITIALIZED [855].f1 ∈ [--..--] [855].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [855].f3 ∈ [--..--] [855].[bits 72 to 95] ∈ UNINITIALIZED [855].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [855].f5 ∈ [--..--] [855].[bits 136 to 159] ∈ UNINITIALIZED [856].f1 ∈ [--..--] [856].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [856].f3 ∈ [--..--] [856].[bits 72 to 95] ∈ UNINITIALIZED [856].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [856].f5 ∈ [--..--] [856].[bits 136 to 159] ∈ UNINITIALIZED [857].f1 ∈ [--..--] [857].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [857].f3 ∈ [--..--] [857].[bits 72 to 95] ∈ UNINITIALIZED [857].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [857].f5 ∈ [--..--] [857].[bits 136 to 159] ∈ UNINITIALIZED [858].f1 ∈ [--..--] [858].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [858].f3 ∈ [--..--] [858].[bits 72 to 95] ∈ UNINITIALIZED [858].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [858].f5 ∈ [--..--] [858].[bits 136 to 159] ∈ UNINITIALIZED [859].f1 ∈ [--..--] [859].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [859].f3 ∈ [--..--] [859].[bits 72 to 95] ∈ UNINITIALIZED [859].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [859].f5 ∈ [--..--] [859].[bits 136 to 159] ∈ UNINITIALIZED [860].f1 ∈ [--..--] [860].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [860].f3 ∈ [--..--] [860].[bits 72 to 95] ∈ UNINITIALIZED [860].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [860].f5 ∈ [--..--] [860].[bits 136 to 159] ∈ UNINITIALIZED [861].f1 ∈ [--..--] [861].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [861].f3 ∈ [--..--] [861].[bits 72 to 95] ∈ UNINITIALIZED [861].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [861].f5 ∈ [--..--] [861].[bits 136 to 159] ∈ UNINITIALIZED [862].f1 ∈ [--..--] [862].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [862].f3 ∈ [--..--] [862].[bits 72 to 95] ∈ UNINITIALIZED [862].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [862].f5 ∈ [--..--] [862].[bits 136 to 159] ∈ UNINITIALIZED [863].f1 ∈ [--..--] [863].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [863].f3 ∈ [--..--] [863].[bits 72 to 95] ∈ UNINITIALIZED [863].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [863].f5 ∈ [--..--] [863].[bits 136 to 159] ∈ UNINITIALIZED [864].f1 ∈ [--..--] [864].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [864].f3 ∈ [--..--] [864].[bits 72 to 95] ∈ UNINITIALIZED [864].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [864].f5 ∈ [--..--] [864].[bits 136 to 159] ∈ UNINITIALIZED [865].f1 ∈ [--..--] [865].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [865].f3 ∈ [--..--] [865].[bits 72 to 95] ∈ UNINITIALIZED [865].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [865].f5 ∈ [--..--] [865].[bits 136 to 159] ∈ UNINITIALIZED [866].f1 ∈ [--..--] [866].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [866].f3 ∈ [--..--] [866].[bits 72 to 95] ∈ UNINITIALIZED [866].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [866].f5 ∈ [--..--] [866].[bits 136 to 159] ∈ UNINITIALIZED [867].f1 ∈ [--..--] [867].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [867].f3 ∈ [--..--] [867].[bits 72 to 95] ∈ UNINITIALIZED [867].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [867].f5 ∈ [--..--] [867].[bits 136 to 159] ∈ UNINITIALIZED [868].f1 ∈ [--..--] [868].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [868].f3 ∈ [--..--] [868].[bits 72 to 95] ∈ UNINITIALIZED [868].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [868].f5 ∈ [--..--] [868].[bits 136 to 159] ∈ UNINITIALIZED [869].f1 ∈ [--..--] [869].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [869].f3 ∈ [--..--] [869].[bits 72 to 95] ∈ UNINITIALIZED [869].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [869].f5 ∈ [--..--] [869].[bits 136 to 159] ∈ UNINITIALIZED [870].f1 ∈ [--..--] [870].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [870].f3 ∈ [--..--] [870].[bits 72 to 95] ∈ UNINITIALIZED [870].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [870].f5 ∈ [--..--] [870].[bits 136 to 159] ∈ UNINITIALIZED [871].f1 ∈ [--..--] [871].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [871].f3 ∈ [--..--] [871].[bits 72 to 95] ∈ UNINITIALIZED [871].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [871].f5 ∈ [--..--] [871].[bits 136 to 159] ∈ UNINITIALIZED [872].f1 ∈ [--..--] [872].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [872].f3 ∈ [--..--] [872].[bits 72 to 95] ∈ UNINITIALIZED [872].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [872].f5 ∈ [--..--] [872].[bits 136 to 159] ∈ UNINITIALIZED [873].f1 ∈ [--..--] [873].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [873].f3 ∈ [--..--] [873].[bits 72 to 95] ∈ UNINITIALIZED [873].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [873].f5 ∈ [--..--] [873].[bits 136 to 159] ∈ UNINITIALIZED [874].f1 ∈ [--..--] [874].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [874].f3 ∈ [--..--] [874].[bits 72 to 95] ∈ UNINITIALIZED [874].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [874].f5 ∈ [--..--] [874].[bits 136 to 159] ∈ UNINITIALIZED [875].f1 ∈ [--..--] [875].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [875].f3 ∈ [--..--] [875].[bits 72 to 95] ∈ UNINITIALIZED [875].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [875].f5 ∈ [--..--] [875].[bits 136 to 159] ∈ UNINITIALIZED [876].f1 ∈ [--..--] [876].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [876].f3 ∈ [--..--] [876].[bits 72 to 95] ∈ UNINITIALIZED [876].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [876].f5 ∈ [--..--] [876].[bits 136 to 159] ∈ UNINITIALIZED [877].f1 ∈ [--..--] [877].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [877].f3 ∈ [--..--] [877].[bits 72 to 95] ∈ UNINITIALIZED [877].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [877].f5 ∈ [--..--] [877].[bits 136 to 159] ∈ UNINITIALIZED [878].f1 ∈ [--..--] [878].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [878].f3 ∈ [--..--] [878].[bits 72 to 95] ∈ UNINITIALIZED [878].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [878].f5 ∈ [--..--] [878].[bits 136 to 159] ∈ UNINITIALIZED [879].f1 ∈ [--..--] [879].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [879].f3 ∈ [--..--] [879].[bits 72 to 95] ∈ UNINITIALIZED [879].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [879].f5 ∈ [--..--] [879].[bits 136 to 159] ∈ UNINITIALIZED [880].f1 ∈ [--..--] [880].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [880].f3 ∈ [--..--] [880].[bits 72 to 95] ∈ UNINITIALIZED [880].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [880].f5 ∈ [--..--] [880].[bits 136 to 159] ∈ UNINITIALIZED [881].f1 ∈ [--..--] [881].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [881].f3 ∈ [--..--] [881].[bits 72 to 95] ∈ UNINITIALIZED [881].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [881].f5 ∈ [--..--] [881].[bits 136 to 159] ∈ UNINITIALIZED [882].f1 ∈ [--..--] [882].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [882].f3 ∈ [--..--] [882].[bits 72 to 95] ∈ UNINITIALIZED [882].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [882].f5 ∈ [--..--] [882].[bits 136 to 159] ∈ UNINITIALIZED [883].f1 ∈ [--..--] [883].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [883].f3 ∈ [--..--] [883].[bits 72 to 95] ∈ UNINITIALIZED [883].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [883].f5 ∈ [--..--] [883].[bits 136 to 159] ∈ UNINITIALIZED [884].f1 ∈ [--..--] [884].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [884].f3 ∈ [--..--] [884].[bits 72 to 95] ∈ UNINITIALIZED [884].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [884].f5 ∈ [--..--] [884].[bits 136 to 159] ∈ UNINITIALIZED [885].f1 ∈ [--..--] [885].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [885].f3 ∈ [--..--] [885].[bits 72 to 95] ∈ UNINITIALIZED [885].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [885].f5 ∈ [--..--] [885].[bits 136 to 159] ∈ UNINITIALIZED [886].f1 ∈ [--..--] [886].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [886].f3 ∈ [--..--] [886].[bits 72 to 95] ∈ UNINITIALIZED [886].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [886].f5 ∈ [--..--] [886].[bits 136 to 159] ∈ UNINITIALIZED [887].f1 ∈ [--..--] [887].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [887].f3 ∈ [--..--] [887].[bits 72 to 95] ∈ UNINITIALIZED [887].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [887].f5 ∈ [--..--] [887].[bits 136 to 159] ∈ UNINITIALIZED [888].f1 ∈ [--..--] [888].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [888].f3 ∈ [--..--] [888].[bits 72 to 95] ∈ UNINITIALIZED [888].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [888].f5 ∈ [--..--] [888].[bits 136 to 159] ∈ UNINITIALIZED [889].f1 ∈ [--..--] [889].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [889].f3 ∈ [--..--] [889].[bits 72 to 95] ∈ UNINITIALIZED [889].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [889].f5 ∈ [--..--] [889].[bits 136 to 159] ∈ UNINITIALIZED [890].f1 ∈ [--..--] [890].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [890].f3 ∈ [--..--] [890].[bits 72 to 95] ∈ UNINITIALIZED [890].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [890].f5 ∈ [--..--] [890].[bits 136 to 159] ∈ UNINITIALIZED [891].f1 ∈ [--..--] [891].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [891].f3 ∈ [--..--] [891].[bits 72 to 95] ∈ UNINITIALIZED [891].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [891].f5 ∈ [--..--] [891].[bits 136 to 159] ∈ UNINITIALIZED [892].f1 ∈ [--..--] [892].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [892].f3 ∈ [--..--] [892].[bits 72 to 95] ∈ UNINITIALIZED [892].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [892].f5 ∈ [--..--] [892].[bits 136 to 159] ∈ UNINITIALIZED [893].f1 ∈ [--..--] [893].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [893].f3 ∈ [--..--] [893].[bits 72 to 95] ∈ UNINITIALIZED [893].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [893].f5 ∈ [--..--] [893].[bits 136 to 159] ∈ UNINITIALIZED [894].f1 ∈ [--..--] [894].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [894].f3 ∈ [--..--] [894].[bits 72 to 95] ∈ UNINITIALIZED [894].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [894].f5 ∈ [--..--] [894].[bits 136 to 159] ∈ UNINITIALIZED [895].f1 ∈ [--..--] [895].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [895].f3 ∈ [--..--] [895].[bits 72 to 95] ∈ UNINITIALIZED [895].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [895].f5 ∈ [--..--] [895].[bits 136 to 159] ∈ UNINITIALIZED [896].f1 ∈ [--..--] [896].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [896].f3 ∈ [--..--] [896].[bits 72 to 95] ∈ UNINITIALIZED [896].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [896].f5 ∈ [--..--] [896].[bits 136 to 159] ∈ UNINITIALIZED [897].f1 ∈ [--..--] [897].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [897].f3 ∈ [--..--] [897].[bits 72 to 95] ∈ UNINITIALIZED [897].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [897].f5 ∈ [--..--] [897].[bits 136 to 159] ∈ UNINITIALIZED [898].f1 ∈ [--..--] [898].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [898].f3 ∈ [--..--] [898].[bits 72 to 95] ∈ UNINITIALIZED [898].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [898].f5 ∈ [--..--] [898].[bits 136 to 159] ∈ UNINITIALIZED [899].f1 ∈ [--..--] [899].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [899].f3 ∈ [--..--] [899].[bits 72 to 95] ∈ UNINITIALIZED [899].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [899].f5 ∈ [--..--] [899].[bits 136 to 159] ∈ UNINITIALIZED [900].f1 ∈ [--..--] [900].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [900].f3 ∈ [--..--] [900].[bits 72 to 95] ∈ UNINITIALIZED [900].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [900].f5 ∈ [--..--] [900].[bits 136 to 159] ∈ UNINITIALIZED [901].f1 ∈ [--..--] [901].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [901].f3 ∈ [--..--] [901].[bits 72 to 95] ∈ UNINITIALIZED [901].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [901].f5 ∈ [--..--] [901].[bits 136 to 159] ∈ UNINITIALIZED [902].f1 ∈ [--..--] [902].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [902].f3 ∈ [--..--] [902].[bits 72 to 95] ∈ UNINITIALIZED [902].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [902].f5 ∈ [--..--] [902].[bits 136 to 159] ∈ UNINITIALIZED [903].f1 ∈ [--..--] [903].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [903].f3 ∈ [--..--] [903].[bits 72 to 95] ∈ UNINITIALIZED [903].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [903].f5 ∈ [--..--] [903].[bits 136 to 159] ∈ UNINITIALIZED [904].f1 ∈ [--..--] [904].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [904].f3 ∈ [--..--] [904].[bits 72 to 95] ∈ UNINITIALIZED [904].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [904].f5 ∈ [--..--] [904].[bits 136 to 159] ∈ UNINITIALIZED [905].f1 ∈ [--..--] [905].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [905].f3 ∈ [--..--] [905].[bits 72 to 95] ∈ UNINITIALIZED [905].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [905].f5 ∈ [--..--] [905].[bits 136 to 159] ∈ UNINITIALIZED [906].f1 ∈ [--..--] [906].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [906].f3 ∈ [--..--] [906].[bits 72 to 95] ∈ UNINITIALIZED [906].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [906].f5 ∈ [--..--] [906].[bits 136 to 159] ∈ UNINITIALIZED [907].f1 ∈ [--..--] [907].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [907].f3 ∈ [--..--] [907].[bits 72 to 95] ∈ UNINITIALIZED [907].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [907].f5 ∈ [--..--] [907].[bits 136 to 159] ∈ UNINITIALIZED [908].f1 ∈ [--..--] [908].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [908].f3 ∈ [--..--] [908].[bits 72 to 95] ∈ UNINITIALIZED [908].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [908].f5 ∈ [--..--] [908].[bits 136 to 159] ∈ UNINITIALIZED [909].f1 ∈ [--..--] [909].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [909].f3 ∈ [--..--] [909].[bits 72 to 95] ∈ UNINITIALIZED [909].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [909].f5 ∈ [--..--] [909].[bits 136 to 159] ∈ UNINITIALIZED [910].f1 ∈ [--..--] [910].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [910].f3 ∈ [--..--] [910].[bits 72 to 95] ∈ UNINITIALIZED [910].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [910].f5 ∈ [--..--] [910].[bits 136 to 159] ∈ UNINITIALIZED [911].f1 ∈ [--..--] [911].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [911].f3 ∈ [--..--] [911].[bits 72 to 95] ∈ UNINITIALIZED [911].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [911].f5 ∈ [--..--] [911].[bits 136 to 159] ∈ UNINITIALIZED [912].f1 ∈ [--..--] [912].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [912].f3 ∈ [--..--] [912].[bits 72 to 95] ∈ UNINITIALIZED [912].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [912].f5 ∈ [--..--] [912].[bits 136 to 159] ∈ UNINITIALIZED [913].f1 ∈ [--..--] [913].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [913].f3 ∈ [--..--] [913].[bits 72 to 95] ∈ UNINITIALIZED [913].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [913].f5 ∈ [--..--] [913].[bits 136 to 159] ∈ UNINITIALIZED [914].f1 ∈ [--..--] [914].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [914].f3 ∈ [--..--] [914].[bits 72 to 95] ∈ UNINITIALIZED [914].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [914].f5 ∈ [--..--] [914].[bits 136 to 159] ∈ UNINITIALIZED [915].f1 ∈ [--..--] [915].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [915].f3 ∈ [--..--] [915].[bits 72 to 95] ∈ UNINITIALIZED [915].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [915].f5 ∈ [--..--] [915].[bits 136 to 159] ∈ UNINITIALIZED [916].f1 ∈ [--..--] [916].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [916].f3 ∈ [--..--] [916].[bits 72 to 95] ∈ UNINITIALIZED [916].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [916].f5 ∈ [--..--] [916].[bits 136 to 159] ∈ UNINITIALIZED [917].f1 ∈ [--..--] [917].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [917].f3 ∈ [--..--] [917].[bits 72 to 95] ∈ UNINITIALIZED [917].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [917].f5 ∈ [--..--] [917].[bits 136 to 159] ∈ UNINITIALIZED [918].f1 ∈ [--..--] [918].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [918].f3 ∈ [--..--] [918].[bits 72 to 95] ∈ UNINITIALIZED [918].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [918].f5 ∈ [--..--] [918].[bits 136 to 159] ∈ UNINITIALIZED [919].f1 ∈ [--..--] [919].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [919].f3 ∈ [--..--] [919].[bits 72 to 95] ∈ UNINITIALIZED [919].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [919].f5 ∈ [--..--] [919].[bits 136 to 159] ∈ UNINITIALIZED [920].f1 ∈ [--..--] [920].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [920].f3 ∈ [--..--] [920].[bits 72 to 95] ∈ UNINITIALIZED [920].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [920].f5 ∈ [--..--] [920].[bits 136 to 159] ∈ UNINITIALIZED [921].f1 ∈ [--..--] [921].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [921].f3 ∈ [--..--] [921].[bits 72 to 95] ∈ UNINITIALIZED [921].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [921].f5 ∈ [--..--] [921].[bits 136 to 159] ∈ UNINITIALIZED [922].f1 ∈ [--..--] [922].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [922].f3 ∈ [--..--] [922].[bits 72 to 95] ∈ UNINITIALIZED [922].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [922].f5 ∈ [--..--] [922].[bits 136 to 159] ∈ UNINITIALIZED [923].f1 ∈ [--..--] [923].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [923].f3 ∈ [--..--] [923].[bits 72 to 95] ∈ UNINITIALIZED [923].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [923].f5 ∈ [--..--] [923].[bits 136 to 159] ∈ UNINITIALIZED [924].f1 ∈ [--..--] [924].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [924].f3 ∈ [--..--] [924].[bits 72 to 95] ∈ UNINITIALIZED [924].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [924].f5 ∈ [--..--] [924].[bits 136 to 159] ∈ UNINITIALIZED [925].f1 ∈ [--..--] [925].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [925].f3 ∈ [--..--] [925].[bits 72 to 95] ∈ UNINITIALIZED [925].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [925].f5 ∈ [--..--] [925].[bits 136 to 159] ∈ UNINITIALIZED [926].f1 ∈ [--..--] [926].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [926].f3 ∈ [--..--] [926].[bits 72 to 95] ∈ UNINITIALIZED [926].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [926].f5 ∈ [--..--] [926].[bits 136 to 159] ∈ UNINITIALIZED [927].f1 ∈ [--..--] [927].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [927].f3 ∈ [--..--] [927].[bits 72 to 95] ∈ UNINITIALIZED [927].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [927].f5 ∈ [--..--] [927].[bits 136 to 159] ∈ UNINITIALIZED [928].f1 ∈ [--..--] [928].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [928].f3 ∈ [--..--] [928].[bits 72 to 95] ∈ UNINITIALIZED [928].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [928].f5 ∈ [--..--] [928].[bits 136 to 159] ∈ UNINITIALIZED [929].f1 ∈ [--..--] [929].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [929].f3 ∈ [--..--] [929].[bits 72 to 95] ∈ UNINITIALIZED [929].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [929].f5 ∈ [--..--] [929].[bits 136 to 159] ∈ UNINITIALIZED [930].f1 ∈ [--..--] [930].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [930].f3 ∈ [--..--] [930].[bits 72 to 95] ∈ UNINITIALIZED [930].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [930].f5 ∈ [--..--] [930].[bits 136 to 159] ∈ UNINITIALIZED [931].f1 ∈ [--..--] [931].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [931].f3 ∈ [--..--] [931].[bits 72 to 95] ∈ UNINITIALIZED [931].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [931].f5 ∈ [--..--] [931].[bits 136 to 159] ∈ UNINITIALIZED [932].f1 ∈ [--..--] [932].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [932].f3 ∈ [--..--] [932].[bits 72 to 95] ∈ UNINITIALIZED [932].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [932].f5 ∈ [--..--] [932].[bits 136 to 159] ∈ UNINITIALIZED [933].f1 ∈ [--..--] [933].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [933].f3 ∈ [--..--] [933].[bits 72 to 95] ∈ UNINITIALIZED [933].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [933].f5 ∈ [--..--] [933].[bits 136 to 159] ∈ UNINITIALIZED [934].f1 ∈ [--..--] [934].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [934].f3 ∈ [--..--] [934].[bits 72 to 95] ∈ UNINITIALIZED [934].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [934].f5 ∈ [--..--] [934].[bits 136 to 159] ∈ UNINITIALIZED [935].f1 ∈ [--..--] [935].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [935].f3 ∈ [--..--] [935].[bits 72 to 95] ∈ UNINITIALIZED [935].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [935].f5 ∈ [--..--] [935].[bits 136 to 159] ∈ UNINITIALIZED [936].f1 ∈ [--..--] [936].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [936].f3 ∈ [--..--] [936].[bits 72 to 95] ∈ UNINITIALIZED [936].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [936].f5 ∈ [--..--] [936].[bits 136 to 159] ∈ UNINITIALIZED [937].f1 ∈ [--..--] [937].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [937].f3 ∈ [--..--] [937].[bits 72 to 95] ∈ UNINITIALIZED [937].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [937].f5 ∈ [--..--] [937].[bits 136 to 159] ∈ UNINITIALIZED [938].f1 ∈ [--..--] [938].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [938].f3 ∈ [--..--] [938].[bits 72 to 95] ∈ UNINITIALIZED [938].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [938].f5 ∈ [--..--] [938].[bits 136 to 159] ∈ UNINITIALIZED [939].f1 ∈ [--..--] [939].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [939].f3 ∈ [--..--] [939].[bits 72 to 95] ∈ UNINITIALIZED [939].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [939].f5 ∈ [--..--] [939].[bits 136 to 159] ∈ UNINITIALIZED [940].f1 ∈ [--..--] [940].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [940].f3 ∈ [--..--] [940].[bits 72 to 95] ∈ UNINITIALIZED [940].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [940].f5 ∈ [--..--] [940].[bits 136 to 159] ∈ UNINITIALIZED [941].f1 ∈ [--..--] [941].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [941].f3 ∈ [--..--] [941].[bits 72 to 95] ∈ UNINITIALIZED [941].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [941].f5 ∈ [--..--] [941].[bits 136 to 159] ∈ UNINITIALIZED [942].f1 ∈ [--..--] [942].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [942].f3 ∈ [--..--] [942].[bits 72 to 95] ∈ UNINITIALIZED [942].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [942].f5 ∈ [--..--] [942].[bits 136 to 159] ∈ UNINITIALIZED [943].f1 ∈ [--..--] [943].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [943].f3 ∈ [--..--] [943].[bits 72 to 95] ∈ UNINITIALIZED [943].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [943].f5 ∈ [--..--] [943].[bits 136 to 159] ∈ UNINITIALIZED [944].f1 ∈ [--..--] [944].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [944].f3 ∈ [--..--] [944].[bits 72 to 95] ∈ UNINITIALIZED [944].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [944].f5 ∈ [--..--] [944].[bits 136 to 159] ∈ UNINITIALIZED [945].f1 ∈ [--..--] [945].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [945].f3 ∈ [--..--] [945].[bits 72 to 95] ∈ UNINITIALIZED [945].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [945].f5 ∈ [--..--] [945].[bits 136 to 159] ∈ UNINITIALIZED [946].f1 ∈ [--..--] [946].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [946].f3 ∈ [--..--] [946].[bits 72 to 95] ∈ UNINITIALIZED [946].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [946].f5 ∈ [--..--] [946].[bits 136 to 159] ∈ UNINITIALIZED [947].f1 ∈ [--..--] [947].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [947].f3 ∈ [--..--] [947].[bits 72 to 95] ∈ UNINITIALIZED [947].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [947].f5 ∈ [--..--] [947].[bits 136 to 159] ∈ UNINITIALIZED [948].f1 ∈ [--..--] [948].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [948].f3 ∈ [--..--] [948].[bits 72 to 95] ∈ UNINITIALIZED [948].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [948].f5 ∈ [--..--] [948].[bits 136 to 159] ∈ UNINITIALIZED [949].f1 ∈ [--..--] [949].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [949].f3 ∈ [--..--] [949].[bits 72 to 95] ∈ UNINITIALIZED [949].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [949].f5 ∈ [--..--] [949].[bits 136 to 159] ∈ UNINITIALIZED [950].f1 ∈ [--..--] [950].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [950].f3 ∈ [--..--] [950].[bits 72 to 95] ∈ UNINITIALIZED [950].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [950].f5 ∈ [--..--] [950].[bits 136 to 159] ∈ UNINITIALIZED [951].f1 ∈ [--..--] [951].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [951].f3 ∈ [--..--] [951].[bits 72 to 95] ∈ UNINITIALIZED [951].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [951].f5 ∈ [--..--] [951].[bits 136 to 159] ∈ UNINITIALIZED [952].f1 ∈ [--..--] [952].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [952].f3 ∈ [--..--] [952].[bits 72 to 95] ∈ UNINITIALIZED [952].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [952].f5 ∈ [--..--] [952].[bits 136 to 159] ∈ UNINITIALIZED [953].f1 ∈ [--..--] [953].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [953].f3 ∈ [--..--] [953].[bits 72 to 95] ∈ UNINITIALIZED [953].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [953].f5 ∈ [--..--] [953].[bits 136 to 159] ∈ UNINITIALIZED [954].f1 ∈ [--..--] [954].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [954].f3 ∈ [--..--] [954].[bits 72 to 95] ∈ UNINITIALIZED [954].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [954].f5 ∈ [--..--] [954].[bits 136 to 159] ∈ UNINITIALIZED [955].f1 ∈ [--..--] [955].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [955].f3 ∈ [--..--] [955].[bits 72 to 95] ∈ UNINITIALIZED [955].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [955].f5 ∈ [--..--] [955].[bits 136 to 159] ∈ UNINITIALIZED [956].f1 ∈ [--..--] [956].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [956].f3 ∈ [--..--] [956].[bits 72 to 95] ∈ UNINITIALIZED [956].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [956].f5 ∈ [--..--] [956].[bits 136 to 159] ∈ UNINITIALIZED [957].f1 ∈ [--..--] [957].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [957].f3 ∈ [--..--] [957].[bits 72 to 95] ∈ UNINITIALIZED [957].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [957].f5 ∈ [--..--] [957].[bits 136 to 159] ∈ UNINITIALIZED [958].f1 ∈ [--..--] [958].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [958].f3 ∈ [--..--] [958].[bits 72 to 95] ∈ UNINITIALIZED [958].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [958].f5 ∈ [--..--] [958].[bits 136 to 159] ∈ UNINITIALIZED [959].f1 ∈ [--..--] [959].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [959].f3 ∈ [--..--] [959].[bits 72 to 95] ∈ UNINITIALIZED [959].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [959].f5 ∈ [--..--] [959].[bits 136 to 159] ∈ UNINITIALIZED [960].f1 ∈ [--..--] [960].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [960].f3 ∈ [--..--] [960].[bits 72 to 95] ∈ UNINITIALIZED [960].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [960].f5 ∈ [--..--] [960].[bits 136 to 159] ∈ UNINITIALIZED [961].f1 ∈ [--..--] [961].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [961].f3 ∈ [--..--] [961].[bits 72 to 95] ∈ UNINITIALIZED [961].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [961].f5 ∈ [--..--] [961].[bits 136 to 159] ∈ UNINITIALIZED [962].f1 ∈ [--..--] [962].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [962].f3 ∈ [--..--] [962].[bits 72 to 95] ∈ UNINITIALIZED [962].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [962].f5 ∈ [--..--] [962].[bits 136 to 159] ∈ UNINITIALIZED [963].f1 ∈ [--..--] [963].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [963].f3 ∈ [--..--] [963].[bits 72 to 95] ∈ UNINITIALIZED [963].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [963].f5 ∈ [--..--] [963].[bits 136 to 159] ∈ UNINITIALIZED [964].f1 ∈ [--..--] [964].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [964].f3 ∈ [--..--] [964].[bits 72 to 95] ∈ UNINITIALIZED [964].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [964].f5 ∈ [--..--] [964].[bits 136 to 159] ∈ UNINITIALIZED [965].f1 ∈ [--..--] [965].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [965].f3 ∈ [--..--] [965].[bits 72 to 95] ∈ UNINITIALIZED [965].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [965].f5 ∈ [--..--] [965].[bits 136 to 159] ∈ UNINITIALIZED [966].f1 ∈ [--..--] [966].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [966].f3 ∈ [--..--] [966].[bits 72 to 95] ∈ UNINITIALIZED [966].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [966].f5 ∈ [--..--] [966].[bits 136 to 159] ∈ UNINITIALIZED [967].f1 ∈ [--..--] [967].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [967].f3 ∈ [--..--] [967].[bits 72 to 95] ∈ UNINITIALIZED [967].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [967].f5 ∈ [--..--] [967].[bits 136 to 159] ∈ UNINITIALIZED [968].f1 ∈ [--..--] [968].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [968].f3 ∈ [--..--] [968].[bits 72 to 95] ∈ UNINITIALIZED [968].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [968].f5 ∈ [--..--] [968].[bits 136 to 159] ∈ UNINITIALIZED [969].f1 ∈ [--..--] [969].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [969].f3 ∈ [--..--] [969].[bits 72 to 95] ∈ UNINITIALIZED [969].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [969].f5 ∈ [--..--] [969].[bits 136 to 159] ∈ UNINITIALIZED [970].f1 ∈ [--..--] [970].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [970].f3 ∈ [--..--] [970].[bits 72 to 95] ∈ UNINITIALIZED [970].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [970].f5 ∈ [--..--] [970].[bits 136 to 159] ∈ UNINITIALIZED [971].f1 ∈ [--..--] [971].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [971].f3 ∈ [--..--] [971].[bits 72 to 95] ∈ UNINITIALIZED [971].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [971].f5 ∈ [--..--] [971].[bits 136 to 159] ∈ UNINITIALIZED [972].f1 ∈ [--..--] [972].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [972].f3 ∈ [--..--] [972].[bits 72 to 95] ∈ UNINITIALIZED [972].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [972].f5 ∈ [--..--] [972].[bits 136 to 159] ∈ UNINITIALIZED [973].f1 ∈ [--..--] [973].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [973].f3 ∈ [--..--] [973].[bits 72 to 95] ∈ UNINITIALIZED [973].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [973].f5 ∈ [--..--] [973].[bits 136 to 159] ∈ UNINITIALIZED [974].f1 ∈ [--..--] [974].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [974].f3 ∈ [--..--] [974].[bits 72 to 95] ∈ UNINITIALIZED [974].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [974].f5 ∈ [--..--] [974].[bits 136 to 159] ∈ UNINITIALIZED [975].f1 ∈ [--..--] [975].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [975].f3 ∈ [--..--] [975].[bits 72 to 95] ∈ UNINITIALIZED [975].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [975].f5 ∈ [--..--] [975].[bits 136 to 159] ∈ UNINITIALIZED [976].f1 ∈ [--..--] [976].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [976].f3 ∈ [--..--] [976].[bits 72 to 95] ∈ UNINITIALIZED [976].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [976].f5 ∈ [--..--] [976].[bits 136 to 159] ∈ UNINITIALIZED [977].f1 ∈ [--..--] [977].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [977].f3 ∈ [--..--] [977].[bits 72 to 95] ∈ UNINITIALIZED [977].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [977].f5 ∈ [--..--] [977].[bits 136 to 159] ∈ UNINITIALIZED [978].f1 ∈ [--..--] [978].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [978].f3 ∈ [--..--] [978].[bits 72 to 95] ∈ UNINITIALIZED [978].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [978].f5 ∈ [--..--] [978].[bits 136 to 159] ∈ UNINITIALIZED [979].f1 ∈ [--..--] [979].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [979].f3 ∈ [--..--] [979].[bits 72 to 95] ∈ UNINITIALIZED [979].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [979].f5 ∈ [--..--] [979].[bits 136 to 159] ∈ UNINITIALIZED [980].f1 ∈ [--..--] [980].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [980].f3 ∈ [--..--] [980].[bits 72 to 95] ∈ UNINITIALIZED [980].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [980].f5 ∈ [--..--] [980].[bits 136 to 159] ∈ UNINITIALIZED [981].f1 ∈ [--..--] [981].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [981].f3 ∈ [--..--] [981].[bits 72 to 95] ∈ UNINITIALIZED [981].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [981].f5 ∈ [--..--] [981].[bits 136 to 159] ∈ UNINITIALIZED [982].f1 ∈ [--..--] [982].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [982].f3 ∈ [--..--] [982].[bits 72 to 95] ∈ UNINITIALIZED [982].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [982].f5 ∈ [--..--] [982].[bits 136 to 159] ∈ UNINITIALIZED [983].f1 ∈ [--..--] [983].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [983].f3 ∈ [--..--] [983].[bits 72 to 95] ∈ UNINITIALIZED [983].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [983].f5 ∈ [--..--] [983].[bits 136 to 159] ∈ UNINITIALIZED [984].f1 ∈ [--..--] [984].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [984].f3 ∈ [--..--] [984].[bits 72 to 95] ∈ UNINITIALIZED [984].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [984].f5 ∈ [--..--] [984].[bits 136 to 159] ∈ UNINITIALIZED [985].f1 ∈ [--..--] [985].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [985].f3 ∈ [--..--] [985].[bits 72 to 95] ∈ UNINITIALIZED [985].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [985].f5 ∈ [--..--] [985].[bits 136 to 159] ∈ UNINITIALIZED [986].f1 ∈ [--..--] [986].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [986].f3 ∈ [--..--] [986].[bits 72 to 95] ∈ UNINITIALIZED [986].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [986].f5 ∈ [--..--] [986].[bits 136 to 159] ∈ UNINITIALIZED [987].f1 ∈ [--..--] [987].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [987].f3 ∈ [--..--] [987].[bits 72 to 95] ∈ UNINITIALIZED [987].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [987].f5 ∈ [--..--] [987].[bits 136 to 159] ∈ UNINITIALIZED [988].f1 ∈ [--..--] [988].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [988].f3 ∈ [--..--] [988].[bits 72 to 95] ∈ UNINITIALIZED [988].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [988].f5 ∈ [--..--] [988].[bits 136 to 159] ∈ UNINITIALIZED [989].f1 ∈ [--..--] [989].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [989].f3 ∈ [--..--] [989].[bits 72 to 95] ∈ UNINITIALIZED [989].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [989].f5 ∈ [--..--] [989].[bits 136 to 159] ∈ UNINITIALIZED [990].f1 ∈ [--..--] [990].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [990].f3 ∈ [--..--] [990].[bits 72 to 95] ∈ UNINITIALIZED [990].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [990].f5 ∈ [--..--] [990].[bits 136 to 159] ∈ UNINITIALIZED [991].f1 ∈ [--..--] [991].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [991].f3 ∈ [--..--] [991].[bits 72 to 95] ∈ UNINITIALIZED [991].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [991].f5 ∈ [--..--] [991].[bits 136 to 159] ∈ UNINITIALIZED [992].f1 ∈ [--..--] [992].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [992].f3 ∈ [--..--] [992].[bits 72 to 95] ∈ UNINITIALIZED [992].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [992].f5 ∈ [--..--] [992].[bits 136 to 159] ∈ UNINITIALIZED [993].f1 ∈ [--..--] [993].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [993].f3 ∈ [--..--] [993].[bits 72 to 95] ∈ UNINITIALIZED [993].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [993].f5 ∈ [--..--] [993].[bits 136 to 159] ∈ UNINITIALIZED [994].f1 ∈ [--..--] [994].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [994].f3 ∈ [--..--] [994].[bits 72 to 95] ∈ UNINITIALIZED [994].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [994].f5 ∈ [--..--] [994].[bits 136 to 159] ∈ UNINITIALIZED [995].f1 ∈ [--..--] [995].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [995].f3 ∈ [--..--] [995].[bits 72 to 95] ∈ UNINITIALIZED [995].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [995].f5 ∈ [--..--] [995].[bits 136 to 159] ∈ UNINITIALIZED [996].f1 ∈ [--..--] [996].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [996].f3 ∈ [--..--] [996].[bits 72 to 95] ∈ UNINITIALIZED [996].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [996].f5 ∈ [--..--] [996].[bits 136 to 159] ∈ UNINITIALIZED [997].f1 ∈ [--..--] [997].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [997].f3 ∈ [--..--] [997].[bits 72 to 95] ∈ UNINITIALIZED [997].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [997].f5 ∈ [--..--] [997].[bits 136 to 159] ∈ UNINITIALIZED [998].f1 ∈ [--..--] [998].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [998].f3 ∈ [--..--] [998].[bits 72 to 95] ∈ UNINITIALIZED [998].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [998].f5 ∈ [--..--] [998].[bits 136 to 159] ∈ UNINITIALIZED [999].f1 ∈ [--..--] [999].f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [999].f3 ∈ [--..--] [999].[bits 72 to 95] ∈ UNINITIALIZED [999].f4 ∈ {{ NULL ; &S_f4_0_t3[0] ; &S_f4_1_t3[0] ; &S_f4_2_t3[0] ; &S_f4_3_t3[0] }} [999].f5 ∈ [--..--] [999].[bits 136 to 159] ∈ UNINITIALIZED t4[0..4999999] ∈ [--..--] t5[0] ∈ {{ NULL ; &S_0_t5[0] }} [1] ∈ {{ NULL ; &S_1_t5[0] }} [2] ∈ {{ NULL ; &S_2_t5[0] }} t6[0..4999999]{.f1; .f2} ∈ [-1.79769313486e+308 .. 1.79769313486e+308] S_f4_0_tcs_s[0..3] ∈ [--..--] S_f4_1_tcs_s[0..3] ∈ [--..--] S_f4_2_tcs_s[0..3] ∈ [--..--] S_f4_3_tcs_s[0..3] ∈ [--..--] S_0_t1[0..3] ∈ [--..--] S_1_t1[0..3] ∈ [--..--] S_2_t1[0..3] ∈ [--..--] S_3_t1[0..3] ∈ [--..--] S_f4_0_t3[0..3] ∈ [--..--] S_f4_1_t3[0..3] ∈ [--..--] S_f4_2_t3[0..3] ∈ [--..--] S_f4_3_t3[0..3] ∈ [--..--] S_0_t5[0..3] ∈ [--..--] S_1_t5[0..3] ∈ [--..--] S_2_t5[0..3] ∈ [--..--] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: frama-c-20.0-Calcium/tests/value/oracle/bigarray.res.oracle0000666000000000000000000000216713571573400020523 0ustar [kernel] Parsing tests/value/bigarray.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0] ∈ {2} [1] ∈ {3} [2..8388607] ∈ {0} S ∈ {{ "uututututututu" }} [eva:alarm] tests/value/bigarray.c:7: Warning: out of bounds write. assert \valid(S); [kernel] tests/value/bigarray.c:7: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/bigarray.c:7: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres [inout] Inputs for function main: S frama-c-20.0-Calcium/tests/value/oracle/bitfield.res.oracle0000666000000000000000000004432213571573400020504 0ustar [kernel] Parsing tests/value/bitfield.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization h ∈ {0} k ∈ {0} k8 ∈ {0} kr8 ∈ {0} ll ∈ {0} ini.a ∈ {2} .b ∈ {-7} .c ∈ {99999} {.d; .[bits 28 to 31]} ∈ {0} VV ∈ {55} q4 ∈ {40000} X ∈ {0} x{.f; .sf} ∈ {28349} us ∈ {56355} G ∈ {0} H ∈ {0} b ∈ {0} c ∈ {0} ee ∈ {0} foo ∈ [--..--] y ∈ [--..--] [eva] computing for function main_old <- main. Called from tests/value/bitfield.i:164. [eva] tests/value/bitfield.i:113: Frama_C_show_each: {1} [eva] tests/value/bitfield.i:117: Frama_C_show_each: {3} [eva] tests/value/bitfield.i:123: Assigning imprecise value to v.c. The imprecision originates from Arithmetic {tests/value/bitfield.i:123} [eva:alarm] tests/value/bitfield.i:125: Warning: signed overflow. assert -2147483648 ≤ (int)v.d + 1; [eva:alarm] tests/value/bitfield.i:125: Warning: signed overflow. assert (int)v.d + 1 ≤ 2147483647; [eva] computing for function f <- main_old <- main. Called from tests/value/bitfield.i:128. [eva] tests/value/bitfield.i:21: Frama_C_dump_each: # Cvalue domain: h ∈ {0} k ∈ {0} k8 ∈ {0} kr8 ∈ {0} ll ∈ {0} ini.a ∈ {2} .b ∈ {-7} .c ∈ {99999} {.d; .[bits 28 to 31]} ∈ {0} VV ∈ {0} q4 ∈ {40000} X ∈ {7} x_0 ∈ {7} x{.f; .sf} ∈ {28349} us ∈ {56355} G ∈ {0} H ∈ {0} b ∈ {0} c ∈ {0} ee ∈ {0} foo ∈ [--..--] y ∈ [--..--] v.a ∈ {0} .b ∈ {7} .c ∈ {{ garbled mix of &{v} (origin: Arithmetic {tests/value/bitfield.i:123}) }} .[bits 28 to 31] ∈ UNINITIALIZED .d ∈ {{ &v + {9} }} l_161{.f0; .f1[bits 0 to 31]} ∈ {-1} tmp ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for f [eva] Done for function f [eva:alarm] tests/value/bitfield.i:129: Warning: signed overflow. assert -2147483648 ≤ foo + foo; [eva:alarm] tests/value/bitfield.i:129: Warning: signed overflow. assert foo + foo ≤ 2147483647; [eva] tests/value/bitfield.i:130: Assigning imprecise value to h.c. The imprecision originates from Arithmetic {tests/value/bitfield.i:130} [eva] computing for function return_8 <- main_old <- main. Called from tests/value/bitfield.i:133. [eva] Recording results for return_8 [eva] Done for function return_8 [eva] computing for function g <- main_old <- main. Called from tests/value/bitfield.i:136. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main_old [eva] Done for function main_old [eva:locals-escaping] tests/value/bitfield.i:164: Warning: locals {v} escaping the scope of main_old through h [eva] computing for function imprecise_bts_1671 <- main. Called from tests/value/bitfield.i:165. [eva] computing for function leaf <- imprecise_bts_1671 <- main. Called from tests/value/bitfield.i:70. [kernel:annot:missing-spec] tests/value/bitfield.i:70: Warning: Neither code nor specification for function leaf, generating default assigns from the prototype [eva] using specification for function leaf [eva] Done for function leaf [eva] tests/value/bitfield.i:71: Frama_C_show_each: {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} [eva] tests/value/bitfield.i:73: Frama_C_show_each: .next ∈ {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} .bitf ∈ {0} .[bits 65 to 95] ∈ {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} [eva] tests/value/bitfield.i:74: Assigning imprecise value to c. The imprecision originates from Misaligned {tests/value/bitfield.i:70} [eva] tests/value/bitfield.i:69: starting to merge loop iterations [eva] computing for function leaf <- imprecise_bts_1671 <- main. Called from tests/value/bitfield.i:70. [eva] Done for function leaf [eva] tests/value/bitfield.i:71: Frama_C_show_each: {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} [eva:alarm] tests/value/bitfield.i:72: Warning: out of bounds write. assert \valid(&c->bitf); [eva] tests/value/bitfield.i:73: Frama_C_show_each: {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} [eva:alarm] tests/value/bitfield.i:74: Warning: out of bounds read. assert \valid_read(&c->next.next); [eva] computing for function leaf <- imprecise_bts_1671 <- main. Called from tests/value/bitfield.i:70. [eva] Done for function leaf [eva] Recording results for imprecise_bts_1671 [eva] Done for function imprecise_bts_1671 [eva] computing for function logic <- main. Called from tests/value/bitfield.i:166. [eva] tests/value/bitfield.i:89: Frama_C_show_each: .v0_3 ∈ [--..--] .v4 ∈ {0} .v5_31 ∈ [--..--] [eva] tests/value/bitfield.i:91: Frama_C_show_each: .v0_3 ∈ [--..--] .v4 ∈ {0} .v5_31 ∈ [--..--] [eva] tests/value/bitfield.i:92: Frama_C_show_each: {0} [eva] tests/value/bitfield.i:93: assertion got status valid. [eva] tests/value/bitfield.i:95: Frama_C_show_each: [0..4294967287] [eva] tests/value/bitfield.i:99: assertion got status valid. [eva] tests/value/bitfield.i:100: assertion got status valid. [eva:alarm] tests/value/bitfield.i:102: Warning: accessing uninitialized left-value. assert \initialized(&w.v4); [eva] tests/value/bitfield.i:105: assertion got status valid. [eva] Recording results for logic [eva] Done for function logic [eva] computing for function eq_bitfields <- main. Called from tests/value/bitfield.i:167. [eva] tests/value/bitfield.i:146: Frama_C_dump_each: # Cvalue domain: h.a ∈ {0} .b ∈ [--..--] .c ∈ [--..--] or ESCAPINGADDR {.d; .[bits 28 to 31]} ∈ {0} k ∈ {0} k8.a ∈ {0} .b ∈ {-8} {.c; .d; .[bits 28 to 31]} ∈ {0} kr8.a ∈ {0} .b ∈ {-8} {.c; .d; .[bits 28 to 31]} ∈ {0} ll.b ∈ {-25536} .[bits 16 to 31] ∈ {0} ini.a ∈ {2} .b ∈ {-7} .c ∈ {99999} {.d; .[bits 28 to 31]} ∈ {0} VV ∈ {0} q4 ∈ {40000} X ∈ {7} x{.f; .sf} ∈ {28349} us ∈ {56355} G ∈ {1} H ∈ {0} b ∈ {0} c ∈ {{ garbled mix of &{b; ee} (origin: Misaligned {tests/value/bitfield.i:70}) }} ee ∈ {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} foo ∈ [--..--] y.v0_3 ∈ [--..--] .v4 ∈ {0} .v5_31 ∈ [--..--] i ∈ {16; 17} s.a ∈ {0; 1} .b ∈ UNINITIALIZED .c ∈ {16; 17} {.d; .[bits 28 to 31]} ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for eq_bitfields [eva] Done for function eq_bitfields [eva] computing for function char_short <- main. Called from tests/value/bitfield.i:168. [eva] Recording results for char_short [eva] Done for function char_short [eva] Recording results for main [eva] done for function main [eva] tests/value/bitfield.i:102: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function char_short: S.c ∈ {1} .s ∈ {2} .[bits 3 to 15] ∈ {0} x_0 ∈ {1} y_0 ∈ {2} [eva:final-states] Values at end of function eq_bitfields: i ∈ [--..--] [eva:final-states] Values at end of function f: X ∈ {7} [eva:final-states] Values at end of function g: H ∈ {0} r ∈ {1} [eva:final-states] Values at end of function imprecise_bts_1671: b ∈ {0} c ∈ {{ garbled mix of &{b; ee} (origin: Misaligned {tests/value/bitfield.i:70}) }} ee ∈ {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} [eva:final-states] Values at end of function logic: y.v0_3 ∈ [--..--] .v4 ∈ {0} .v5_31 ∈ [--..--] w.v0_3 ∈ {1} {.v4; .v5_31} ∈ UNINITIALIZED [eva:final-states] Values at end of function return_8: __retres ∈ {8} [eva:final-states] Values at end of function main_old: h.a ∈ {0} .b ∈ [--..--] .c ∈ {{ garbled mix of &{v} (origin: Arithmetic {tests/value/bitfield.i:130}) }} {.d; .[bits 28 to 31]} ∈ {0} k8.a ∈ {0} .b ∈ {-8} {.c; .d; .[bits 28 to 31]} ∈ {0} kr8.a ∈ {0} .b ∈ {-8} {.c; .d; .[bits 28 to 31]} ∈ {0} ll.b ∈ {-25536} .[bits 16 to 31] ∈ {0} VV ∈ {0} X ∈ {7} G ∈ {1} H ∈ {0} v.a ∈ {0} .b ∈ {7} .c ∈ {{ garbled mix of &{v} (origin: Arithmetic {tests/value/bitfield.i:123}) }} .[bits 28 to 31] ∈ UNINITIALIZED .d ∈ {{ &v + {9} }} l_161{.f0; .f1[bits 0 to 31]} ∈ {-1} [eva:final-states] Values at end of function main: h.a ∈ {0} .b ∈ [--..--] .c ∈ [--..--] or ESCAPINGADDR {.d; .[bits 28 to 31]} ∈ {0} k8.a ∈ {0} .b ∈ {-8} {.c; .d; .[bits 28 to 31]} ∈ {0} kr8.a ∈ {0} .b ∈ {-8} {.c; .d; .[bits 28 to 31]} ∈ {0} ll.b ∈ {-25536} .[bits 16 to 31] ∈ {0} VV ∈ {0} X ∈ {7} G ∈ {1} H ∈ {0} b ∈ {0} c ∈ {{ garbled mix of &{b; ee} (origin: Misaligned {tests/value/bitfield.i:70}) }} ee ∈ {{ garbled mix of &{b} (origin: Misaligned {tests/value/bitfield.i:70}) }} y.v0_3 ∈ [--..--] .v4 ∈ {0} .v5_31 ∈ [--..--] [from] Computing for function char_short [from] Done for function char_short [from] Computing for function eq_bitfields [from] Done for function eq_bitfields [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function imprecise_bts_1671 [from] Computing for function leaf <-imprecise_bts_1671 [from] Done for function leaf [from] Done for function imprecise_bts_1671 [from] Computing for function logic [from] Done for function logic [from] Computing for function return_8 [from] Done for function return_8 [from] Computing for function main_old [from] Done for function main_old [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function char_short: NO EFFECTS [from] Function eq_bitfields: NO EFFECTS [from] Function f: X FROM x_0 [from] Function g: H FROM x.sf; us \result FROM x.f; us [from] Function leaf: ee FROM ee (and SELF) [from] Function imprecise_bts_1671: b FROM ee{.next.next; {.bitf; .[bits 65 to 95]}}; foo (and SELF) c FROM ee{.next.next; {.bitf; .[bits 65 to 95]}}; foo ee{.next.next; {.bitf; .[bits 65 to 95]}} FROM ee{.next.next; {.bitf; .[bits 65 to 95]}}; foo (and SELF) .next.prev FROM ee{.next.next; {.bitf; .[bits 65 to 95]}}; foo [from] Function logic: y.v4 FROM y.v4 (and SELF) [from] Function return_8: \result FROM \nothing [from] Function main_old: h.a FROM h.a .b FROM h{.a; .b}; foo .c FROM \nothing k8.b FROM \nothing kr8.b FROM \nothing ll.b FROM q4 VV FROM h.a X FROM \nothing G FROM x.f; us H FROM x.sf; us [from] Function main: h.a FROM h.a .b FROM h{.a; .b}; foo .c FROM \nothing k8.b FROM \nothing kr8.b FROM \nothing ll.b FROM q4 VV FROM h.a X FROM \nothing G FROM x.f; us H FROM x.sf; us b FROM ee{.next.next; {.bitf; .[bits 65 to 95]}}; foo (and SELF) c FROM ee{.next.next; {.bitf; .[bits 65 to 95]}}; foo ee{.next.next; {.bitf; .[bits 65 to 95]}} FROM ee{.next.next; {.bitf; .[bits 65 to 95]}}; foo (and SELF) .next.prev FROM ee{.next.next; {.bitf; .[bits 65 to 95]}}; foo y.v4 FROM y.v4 (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function char_short: S{.c; .s}; x_0; y_0 [inout] Inputs for function char_short: \nothing [inout] Out (internal) for function eq_bitfields: i; s{.a; .c} [inout] Inputs for function eq_bitfields: foo [inout] Out (internal) for function f: X [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: H; r [inout] Inputs for function g: x; us [inout] Out (internal) for function imprecise_bts_1671: b; c; ee [inout] Inputs for function imprecise_bts_1671: c; ee; foo [inout] Out (internal) for function logic: y.v4; w.v0_3; wc [inout] Inputs for function logic: foo; y [inout] Out (internal) for function return_8: __retres [inout] Inputs for function return_8: \nothing [inout] Out (internal) for function main_old: h{.a; .b; .c}; k8.b; kr8.b; ll.b; VV; X; G; H; v{{.a; .b; .c}; .d}; l_161; tmp [inout] Inputs for function main_old: h{.a; .b}; VV; q4; x; us; foo [inout] Out (internal) for function main: h{.a; .b; .c}; k8.b; kr8.b; ll.b; VV; X; G; H; b; c; ee; y.v4 [inout] Inputs for function main: h{.a; .b}; VV; q4; x; us; c; ee; foo; y /* Generated by Frama-C */ struct t1 { unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(2))) a : 2 ; int __attribute__((__FRAMA_C_BITFIELD_SIZE__(4))) b : 4 ; int __attribute__((__FRAMA_C_BITFIELD_SIZE__(22))) c : 22 ; int __attribute__((__FRAMA_C_BITFIELD_SIZE__(32))) d : 32 ; }; struct t2 { unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(2))) a : 2 ; int __attribute__((__FRAMA_C_BITFIELD_SIZE__(4))) b : 4 ; int __attribute__((__FRAMA_C_BITFIELD_SIZE__(22))) c : 22 ; int d ; }; struct t3 { int __attribute__((__FRAMA_C_BITFIELD_SIZE__(16))) b : 16 ; }; struct S { unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(32))) f : 32 ; int __attribute__((__FRAMA_C_BITFIELD_SIZE__(32))) sf : 32 ; }; union U1 { int f0 ; int __attribute__((__FRAMA_C_BITFIELD_SIZE__(15))) f1 : 15 ; }; struct foo; struct B { struct foo *next ; struct foo **prev ; }; struct A { struct B next ; int __attribute__((__FRAMA_C_BITFIELD_SIZE__(1))) bitf : 1 ; }; struct bitf { unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(3))) v0_3 : 3 ; unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(1))) v4 : 1 ; unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(28))) v5_31 : 28 ; }; struct char_short { unsigned char __attribute__((__FRAMA_C_BITFIELD_SIZE__(1))) c : 1 ; unsigned short __attribute__((__FRAMA_C_BITFIELD_SIZE__(2))) s : 2 ; }; struct t1 h; struct t2 k; struct t2 k8; struct t2 kr8; struct t3 ll; struct t1 ini = {.a = (unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(2))))14, .b = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(4))))(-55), .c = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(22))))99999, .d = 0}; unsigned int VV = (unsigned int)55; unsigned short q4 = (unsigned short)40000; int X; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_dump_each)(); void f(int x_0) { X = x_0; Frama_C_dump_each(); return; } int return_8(void) { int __retres; __retres = 8; return __retres; } struct S x = {.f = (unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(32))))28349, .sf = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(32))))28349}; unsigned short us = (unsigned short)0xDC23L; int G; int H; int g(void) { int r = ((unsigned int)x.f ^ (unsigned int)((short)(-87))) >= (unsigned int)us; H = ((int)x.sf ^ (int)((short)(-87))) >= (int)us; return r; } struct A *b; struct A *c; struct A ee; /*@ assigns *p1; assigns *p1 \from *p1; */ void leaf(struct A *p1); int volatile foo; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each)(); void imprecise_bts_1671(void) { ee.next.prev = (struct foo **)(& b); c = & ee; while (foo) { leaf(c); Frama_C_show_each(ee); /*@ assert Eva: mem_access: \valid(&c->bitf); */ c->bitf = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(1))))0; Frama_C_show_each(ee); /*@ assert Eva: mem_access: \valid_read(&c->next.next); */ c = (struct A *)c->next.next; } return; } extern struct bitf y; void logic(void) { struct bitf w; if (y.v4) { y.v4 = (unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(1))))0; Frama_C_show_each(y); } else Frama_C_show_each(y); Frama_C_show_each(y.v4); /*@ assert y.v4 ≡ 0; */ ; Frama_C_show_each(*((unsigned int *)(& y))); w.v0_3 = (unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(3))))1; /*@ assert \initialized(&w.v0_3); */ ; /*@ assert ¬\initialized(&w.v4); */ ; if (foo) { /*@ assert Eva: initialization: \initialized(&w.v4); */ int wc = (int)w.v4 + 1; } /*@ assert \separated(&w.v0_3, &w.v4); */ ; return; } void main_old(void) { struct t1 v; union U1 l_161; int tmp; l_161.f0 = (int)(-1L); Frama_C_show_each(1); if (! l_161.f0 <= (int)l_161.f1) Frama_C_show_each(2); else Frama_C_show_each(3); VV = (unsigned int)h.a; h.a = (unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(2))))VV; v.c = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(22))))((int)(& v)); v.d = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(32))))((int)(& v + 1)); /*@ assert Eva: signed_overflow: -2147483648 ≤ (int)v.d + 1; */ /*@ assert Eva: signed_overflow: (int)v.d + 1 ≤ 2147483647; */ v.d = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(32))))((int)v.d + 1); v.a = (unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(2))))4; v.b = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(4))))7; f((int)v.b); /*@ assert Eva: signed_overflow: -2147483648 ≤ foo + foo; */ /*@ assert Eva: signed_overflow: foo + foo ≤ 2147483647; */ h.b = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(4))))(((foo + foo) + (int)h.a) + (int)h.b); h.c = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(22))))((int)(& v + 1)); k8.b = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(4))))8; tmp = return_8(); kr8.b = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(4))))tmp; ll.b = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(16))))q4; G = g(); return; } extern int ( /* missing proto */ Frama_C_show_each_unreachable)(); void eq_bitfields(void) { int i = foo; if (i >= 16) if (i <= 17) { struct t1 s; s.a = (unsigned int __attribute__((__FRAMA_C_BITFIELD_SIZE__(2))))i; s.c = (int __attribute__((__FRAMA_C_BITFIELD_SIZE__(22))))i; Frama_C_dump_each(); if ((int)s.a == (int)s.c) Frama_C_show_each_unreachable(); } return; } void char_short(void) { struct char_short S = {.c = (unsigned char __attribute__((__FRAMA_C_BITFIELD_SIZE__(1))))1, .s = (unsigned short __attribute__((__FRAMA_C_BITFIELD_SIZE__(2))))2}; int x_0 = (int)S.c + 0; int y_0 = (int)S.s + 0; return; } void main(void) { main_old(); imprecise_bts_1671(); logic(); eq_bitfields(); char_short(); return; } frama-c-20.0-Calcium/tests/value/oracle/bitfield_assign.res.oracle0000666000000000000000000000356013571573400022047 0ustar [kernel] Parsing tests/value/bitfield_assign.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g_18 ∈ {0} g_5 ∈ {0} g_2 ∈ {0} g_7[0]{.f0; .f1[bits 0 to 6]; .f2[bits 0 to 6]; .f3.f0[bits 0 to 6]} ∈ {52} [0]{.f0[bits 7 to 159]; .f1[bits 7 to 159]; .f2[bits 7 to 159]; .f3{.f0[bits 7 to 31]; .f1; .f2; .f3; .[bits 48 to 63]; .[bits 90 to 95]}} ∈ {0} [eva] tests/value/bitfield_assign.i:34: Frama_C_show_each: {21668890} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: g_2 ∈ {21668890} l_8 ∈ {1} l_16 ∈ {3175785498} g_7[0]{.f0; .f1[bits 0 to 6]; .f2[bits 0 to 6]; .f3.f0[bits 0 to 6]} ∈ {52} [0]{.f0[bits 7 to 63]; .f1[bits 7 to 63]; .f2[bits 7 to 63]; .f3{.f0[bits 7 to 31]; .f1; .[bits 48 to 63]}} ∈ {0} [0]{.f0[bits 64 to 89]; .f1[bits 64 to 89]; .f2[bits 64 to 89]; .f3.f2} ∈ {21668890} [0]{.f0[bits 90 to 159]; .f1[bits 90 to 159]; .f2[bits 90 to 159]; .f3{.f3; .[bits 90 to 95]}} ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: g_2 FROM g_5; g_2 g_7[0]{.f0[bits 64 to 89]; .f1[bits 64 to 89]; .f2[bits 64 to 89]; .f3.f2} FROM g_5 \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: g_2; l_8; l_16; g_7[0]{.f0[bits 64 to 89]; .f1[bits 64 to 89]; .f2[bits 64 to 89]; .f3.f2}; __retres [inout] Inputs for function main: g_5; g_2; g_7[0]{.f0[bits 64 to 89]; .f1[bits 64 to 89]; .f2[bits 64 to 89]; .f3.f2} frama-c-20.0-Calcium/tests/value/oracle/bitfield_longlong.res.oracle0000666000000000000000000000137713571573400022406 0ustar [kernel] Parsing tests/value/bitfield_longlong.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s50.z ∈ {2} .[bits 50 to 63] ∈ {0} s10.z ∈ {2} .[bits 10 to 31] ∈ {0} u32.z ∈ {4294967295} s32.z ∈ {-1} [eva] tests/value/bitfield_longlong.c:25: Frama_C_show_each: {{ "%zu %zu %zu %zu\n" }}, {8}, {4}, {8}, {4} [eva] tests/value/bitfield_longlong.c:31: Frama_C_show_each: {{ "%d %d\n" }}, {1}, {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {1} y ∈ {0} __retres ∈ {0} frama-c-20.0-Calcium/tests/value/oracle/bitfield_receives_result.res.oracle0000666000000000000000000000271513571573400023767 0ustar [kernel] Parsing tests/value/bitfield_receives_result.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s ∈ {0} [eva] computing for function f <- main. Called from tests/value/bitfield_receives_result.i:9. [eva] Recording results for f [eva] Done for function f [eva] tests/value/bitfield_receives_result.i:10: Frama_C_dump_each: # Cvalue domain: s.b ∈ {-1} .[bits 31 to 31] ∈ {0} tmp ∈ {-1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {-1} [eva:final-states] Values at end of function main: s.b ∈ {-1} .[bits 31 to 31] ∈ {0} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function main: s.b FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: s.b; tmp; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/bitwise.res.oracle0000666000000000000000000001773613571573400020401 0ustar [kernel] Parsing tests/value/bitwise.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] input[0..2] ∈ [--..--] s ∈ [--..--] [eva] computing for function test1 <- main. Called from tests/value/bitwise.i:149. [eva] computing for function Frama_C_interval <- test1 <- main. Called from tests/value/bitwise.i:23. [eva] using specification for function Frama_C_interval [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- test1 <- main. Called from tests/value/bitwise.i:24. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- test1 <- main. Called from tests/value/bitwise.i:25. [eva] Done for function Frama_C_interval [eva] Recording results for test1 [eva] Done for function test1 [eva] computing for function test2 <- main. Called from tests/value/bitwise.i:150. [eva] computing for function Frama_C_interval <- test2 <- main. Called from tests/value/bitwise.i:50. [eva] Done for function Frama_C_interval [eva] Recording results for test2 [eva] Done for function test2 [eva] computing for function test3 <- main. Called from tests/value/bitwise.i:151. [eva] Recording results for test3 [eva] Done for function test3 [eva] computing for function test4 <- main. Called from tests/value/bitwise.i:152. [eva] tests/value/bitwise.i:62: assertion got status valid. [eva] tests/value/bitwise.i:64: Frama_C_show_each_1: [0x80000000..0xFFFFFFFF], {0x80000000} [eva] tests/value/bitwise.i:64: Frama_C_show_each_1: [0..0x7FFFFFFF], {0} [eva] tests/value/bitwise.i:66: Frama_C_show_each_2: [0..0x7FFFFFFF], {0}, {0x80000000} [eva] tests/value/bitwise.i:66: Frama_C_show_each_2: [0..0x7FFFFFFF], {0}, {0} [eva] tests/value/bitwise.i:72: Frama_C_show_each_false: [0..0x7FFFFFFF] [eva] tests/value/bitwise.i:72: Frama_C_show_each_false: [0..0x7FFFFFFF] [eva] Recording results for test4 [eva] Done for function test4 [eva] computing for function and_or_rel <- main. Called from tests/value/bitwise.i:153. [eva:alarm] tests/value/bitwise.i:87: Warning: assertion got status unknown. [eva] Recording results for and_or_rel [eva] Done for function and_or_rel [eva] computing for function double_neg <- main. Called from tests/value/bitwise.i:154. [eva] Recording results for double_neg [eva] Done for function double_neg [eva] computing for function bug1 <- main. Called from tests/value/bitwise.i:155. [eva] Recording results for bug1 [eva] Done for function bug1 [eva] computing for function bug2 <- main. Called from tests/value/bitwise.i:156. [eva] tests/value/bitwise.i:114: Frama_C_show_each_then: [eva] tests/value/bitwise.i:114: Frama_C_show_each_else: [eva] Recording results for bug2 [eva] Done for function bug2 [eva] computing for function bug3 <- main. Called from tests/value/bitwise.i:157. [eva] tests/value/bitwise.i:121: Frama_C_show_each: {0x41F656F}, {0xFBE09A91} [eva] Recording results for bug3 [eva] Done for function bug3 [eva] computing for function bug4 <- main. Called from tests/value/bitwise.i:158. [eva] tests/value/bitwise.i:131: Frama_C_show_each_then: [eva] tests/value/bitwise.i:133: Frama_C_show_each_else: [eva] Recording results for bug4 [eva] Done for function bug4 [eva] computing for function bug5 <- main. Called from tests/value/bitwise.i:159. [eva] tests/value/bitwise.i:144: Frama_C_show_each_dead: {0} [eva] Recording results for bug5 [eva] Done for function bug5 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function and_or_rel: x ∈ [20..40] r1 ∈ [17..63] or UNINITIALIZED r2 ∈ [20..40] or UNINITIALIZED r3 ∈ [24..37] or UNINITIALIZED [eva:final-states] Values at end of function bug1: msb ∈ {6} lsb ∈ {3} par ∈ {5} p1 ∈ {5} p2 ∈ {0} [eva:final-states] Values at end of function bug2: t ∈ {1; 2} [eva:final-states] Values at end of function bug3: l_1180 ∈ {0x41F656F} foo ∈ {0xFBE09A91} [eva:final-states] Values at end of function bug4: g_2 ∈ {-1; 0} tmp_0 ∈ {-0x1578} [eva:final-states] Values at end of function bug5: x ∈ [-0x7FFFFFFE..0x7FFFFFFF] [eva:final-states] Values at end of function double_neg: i ∈ {5} j ∈ {0xFFFFFFFA} k ∈ {-6} [eva:final-states] Values at end of function test1: or1 ∈ [-3..31] or2 ∈ [13..31] or3 ∈ [-3..31] and1 ∈ [0..17] and2 ∈ [0..17] and3 ∈ [0..27] xor1 ∈ [0..31] xor2 ∈ [-20..31] uand4 ∈ {8; 16; 24} a ∈ [3..17] b ∈ [-3..17] c ∈ [13..27] i1 ∈ [0..0x1FFFE],0%2 i2 ∈ [0..0x3FFFC],0%4 v1 ∈ [0..0x1FFFC],0%4 v2 ∈ [0..0x3FFFE],0%2 mask07 ∈ {5} mask0f ∈ {13} mask1f ∈ {13; 29} [eva:final-states] Values at end of function test2: x ∈ {56; 64; 72; 80; 88; 96; 104} [eva:final-states] Values at end of function test3: x ∈ [-256..255] y ∈ [-256..255] [eva:final-states] Values at end of function test4: something ∈ [0..0x7FFFFFFF] topBitOnly ∈ {0; 0x80000000} __retres ∈ {1} [eva:final-states] Values at end of function main: [from] Computing for function and_or_rel [from] Done for function and_or_rel [from] Computing for function bug1 [from] Done for function bug1 [from] Computing for function bug2 [from] Done for function bug2 [from] Computing for function bug3 [from] Done for function bug3 [from] Computing for function bug4 [from] Done for function bug4 [from] Computing for function bug5 [from] Done for function bug5 [from] Computing for function double_neg [from] Done for function double_neg [from] Computing for function test1 [from] Computing for function Frama_C_interval <-test1 [from] Done for function Frama_C_interval [from] Done for function test1 [from] Computing for function test2 [from] Done for function test2 [from] Computing for function test3 [from] Done for function test3 [from] Computing for function test4 [from] Done for function test4 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: \result FROM min; max [from] Function and_or_rel: NO EFFECTS [from] Function bug1: NO EFFECTS [from] Function bug2: NO EFFECTS [from] Function bug3: NO EFFECTS [from] Function bug4: NO EFFECTS [from] Function bug5: NO EFFECTS [from] Function double_neg: NO EFFECTS [from] Function test1: NO EFFECTS [from] Function test2: NO EFFECTS [from] Function test3: NO EFFECTS [from] Function test4: \result FROM v [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function and_or_rel: x; r1; r2; r3 [inout] Inputs for function and_or_rel: v [inout] Out (internal) for function bug1: msb; lsb; par; p1; p2 [inout] Inputs for function bug1: \nothing [inout] Out (internal) for function bug2: t; tmp [inout] Inputs for function bug2: v [inout] Out (internal) for function bug3: l_1180; foo [inout] Inputs for function bug3: \nothing [inout] Out (internal) for function bug4: g_2; tmp; tmp_0 [inout] Inputs for function bug4: v [inout] Out (internal) for function bug5: x [inout] Inputs for function bug5: v [inout] Out (internal) for function double_neg: i; j; k [inout] Inputs for function double_neg: \nothing [inout] Out (internal) for function test1: or1; or2; or3; and1; and2; and3; xor1; xor2; uand4; a; b; c; i1; i2; v1; v2; mask07; mask0f; mask1f [inout] Inputs for function test1: s [inout] Out (internal) for function test2: x; tmp [inout] Inputs for function test2: \nothing [inout] Out (internal) for function test3: x; tmp; y; tmp_0 [inout] Inputs for function test3: input[0..2] [inout] Out (internal) for function test4: something; topBitOnly; __retres [inout] Inputs for function test4: v [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: v; input[0..2]; s frama-c-20.0-Calcium/tests/value/oracle/bitwise_float.res.oracle0000666000000000000000000000167013571573400021554 0ustar [kernel] Parsing tests/value/bitwise_float.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/bitwise_float.c:1: Warning: function main: precondition got status unknown. [eva] tests/value/bitwise_float.c:5: Frama_C_show_each_x: [1028443341..1084227584] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {0; 2} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM a [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/bitwise_pointer.res.oracle0000666000000000000000000000475613571573400022137 0ustar [kernel] Parsing tests/value/bitwise_pointer.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [10..99] ∈ {0} p ∈ {0} x ∈ {0} t1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [10..99] ∈ {0} p1 ∈ {0} x1 ∈ {0} [eva] tests/value/bitwise_pointer.i:18: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/bitwise_pointer.i:18} [eva:alarm] tests/value/bitwise_pointer.i:19: Warning: out of bounds write. assert \valid(p); [eva] tests/value/bitwise_pointer.i:22: Assigning imprecise value to p1. The imprecision originates from Arithmetic {tests/value/bitwise_pointer.i:22} [eva:alarm] tests/value/bitwise_pointer.i:23: Warning: out of bounds write. assert \valid(p1); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0] ∈ {0; 5} [1] ∈ {1; 5} [2] ∈ {2; 5} [3] ∈ {3; 5} [4] ∈ {4; 5} [5] ∈ {5} [6] ∈ {5; 6} [7] ∈ {5; 7} [8] ∈ {5; 8} [9] ∈ {5; 9} [10..99] ∈ {0; 5} p ∈ {{ &t + [0..99] }} x ∈ [0..9] t1[0] ∈ {0; 5} [1] ∈ {1; 5} [2] ∈ {2; 5} [3] ∈ {3; 5} [4] ∈ {4; 5} [5] ∈ {5} [6] ∈ {5; 6} [7] ∈ {5; 7} [8] ∈ {5; 8} [9] ∈ {5; 9} [10..99] ∈ {0; 5} p1 ∈ {{ &t1 + [0..99] }} x1 ∈ [0..9] mask ∈ {7} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[0..99] FROM \nothing (and SELF) p FROM \nothing x FROM t[0..99] t1[0..99] FROM \nothing (and SELF) p1 FROM \nothing x1 FROM t1[0..99] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[0..99]; p; x; t1[0..99]; p1; x1; mask [inout] Inputs for function main: t[0..99]; p; t1[0..99]; p1 [inout] InOut (internal) for function main: Operational inputs: t[0..99]; t1[0..99] Operational inputs on termination: t[0..99]; t1[0..99] Sure outputs: p; x; p1; x1; mask frama-c-20.0-Calcium/tests/value/oracle/bitwise_reduction.res.oracle0000666000000000000000000000474613571573400022452 0ustar [kernel] Parsing tests/value/bitwise_reduction.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/bitwise_reduction.i:33. [eva:alarm] tests/value/bitwise_reduction.i:10: Warning: assertion got status unknown. [eva:alarm] tests/value/bitwise_reduction.i:11: Warning: assertion got status unknown. [eva:alarm] tests/value/bitwise_reduction.i:14: Warning: accessing out of bounds index. assert 0 ≤ i; [eva:alarm] tests/value/bitwise_reduction.i:14: Warning: accessing out of bounds index. assert i < 2; [eva] tests/value/bitwise_reduction.i:15: Frama_C_show_each_then1: {1}, {0; 1} [eva] tests/value/bitwise_reduction.i:17: Frama_C_show_each_else1: {0; 1}, {0; 1; 0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} [eva] tests/value/bitwise_reduction.i:19: Frama_C_show_each_else_then1: {0; 1}, {0; 1; 0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} [eva:alarm] tests/value/bitwise_reduction.i:23: Warning: out of bounds read. assert \valid_read(p); [eva] tests/value/bitwise_reduction.i:24: Frama_C_show_each_then2: {{ &t + {4} }}, {0; 1} [eva] tests/value/bitwise_reduction.i:26: Frama_C_show_each_else2: {{ &t + {0; 4} }}, {0; 1; 0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} [eva] tests/value/bitwise_reduction.i:28: Frama_C_show_each_else_then2: {0; 1}, {0; 1; 0x3000; 0x3001; 0x3200; 0x3201; 0xF000; 0xFF00} [eva] Recording results for main1 [eva] Done for function main1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: t[0] ∈ {0xF000; 0xFF00} [1] ∈ {0; 1; 0x3000; 0x3001; 0x3200; 0x3201; 0xF000} i ∈ {0; 1} p ∈ {{ &t{[0], [1]} }} [eva:final-states] Values at end of function main: [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: t[0..1]; i; p [inout] Inputs for function main1: v [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/biz.res.oracle0000666000000000000000000000154713571573400017510 0ustar [kernel] Parsing tests/value/biz.i (no preprocessing) [eva] Analyzing a complete application starting at f2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} q ∈ {0} G ∈ {0} [eva] Recording results for f2 [eva] done for function f2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f2: p ∈ {{ &G + {1} }} G[bits 0 to 7] ∈ {3} [bits 8 to 31] ∈ {0} [from] Computing for function f2 [from] Done for function f2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f2: p FROM \nothing G[bits 0 to 7] FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f2: p; G[bits 0 to 7]; tmp [inout] Inputs for function f2: p frama-c-20.0-Calcium/tests/value/oracle/bool.res.oracle0000666000000000000000000000632413571573400017655 0ustar [kernel] Parsing tests/value/bool.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] [eva] computing for function valid_bool <- main. Called from tests/value/bool.i:61. [eva] tests/value/bool.i:12: Frama_C_show_each: {0} [eva] tests/value/bool.i:14: Frama_C_show_each: {1} [eva] tests/value/bool.i:16: Frama_C_show_each: {1}, {2} [eva] tests/value/bool.i:18: Frama_C_show_each: {1} [eva] tests/value/bool.i:20: Frama_C_show_each: {1} [eva] Recording results for valid_bool [eva] Done for function valid_bool [eva] computing for function invalid_bool <- main. Called from tests/value/bool.i:62. [eva:alarm] tests/value/bool.i:33: Warning: trap representation of a _Bool lvalue. assert ub.b ≡ 0 ∨ ub.b ≡ 1; [eva] tests/value/bool.i:36: Frama_C_show_each_zero: {0} [eva] tests/value/bool.i:39: Frama_C_show_each_one: {1} [eva:alarm] tests/value/bool.i:42: Warning: trap representation of a _Bool lvalue. assert ub.b ≡ 0 ∨ ub.b ≡ 1; [eva:alarm] tests/value/bool.i:45: Warning: trap representation of a _Bool lvalue. assert ub.b ≡ 0 ∨ ub.b ≡ 1; [eva] tests/value/bool.i:46: Frama_C_show_each_zero_or_one: {0; 1} [eva] tests/value/bool.i:49: Frama_C_show_each_one: {1} [eva:alarm] tests/value/bool.i:52: Warning: trap representation of a _Bool lvalue. assert b ≡ 0 ∨ b ≡ 1; [eva:alarm] tests/value/bool.i:56: Warning: trap representation of a _Bool lvalue. assert *p ≡ 0 ∨ *p ≡ 1; [eva] tests/value/bool.i:57: Frama_C_show_each_zero_or_one: {0; 1} [eva] Recording results for invalid_bool [eva] Done for function invalid_bool [eva] Recording results for main [eva] done for function main [eva] tests/value/bool.i:33: assertion 'Eva,bool_value' got final status invalid. [eva] tests/value/bool.i:42: assertion 'Eva,bool_value' got final status invalid. [eva] tests/value/bool.i:52: assertion 'Eva,bool_value' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function invalid_bool: ub{.b; .c; .s[bits 0 to 7]} ∈ {0; 1} {.b[bits 8 to 15]; .c[bits 8 to 15]; .s[bits 8 to 15]} ∈ [--..--] b ∈ {0; 1} c ∈ {0; 1} p ∈ {{ (_Bool *)&c }} [eva:final-states] Values at end of function valid_bool: x ∈ {1} y ∈ {2} [eva:final-states] Values at end of function main: [from] Computing for function invalid_bool [from] Done for function invalid_bool [from] Computing for function valid_bool [from] Done for function valid_bool [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function invalid_bool: NO EFFECTS [from] Function valid_bool: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function invalid_bool: ub; b; c; p [inout] Inputs for function invalid_bool: rand [inout] Out (internal) for function valid_bool: x; y [inout] Inputs for function valid_bool: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: rand frama-c-20.0-Calcium/tests/value/oracle/branch.res.oracle0000666000000000000000000000157013571573400020155 0ustar [kernel] Parsing tests/value/branch.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} d ∈ {0} e ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/value/oracle/branch2.res.oracle0000666000000000000000000000177013571573400020241 0ustar [kernel] Parsing tests/value/branch2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} etat_to ∈ {0} changepage ∈ {0} plein ∈ {0} NumFonct ∈ {0} NumSsPage ∈ {0} [eva] tests/value/branch2.i:14: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: plein ∈ {1} NumSsPage ∈ {9} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: plein FROM \nothing NumSsPage FROM NumSsPage (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: plein; NumSsPage [inout] Inputs for function main: changepage; NumSsPage frama-c-20.0-Calcium/tests/value/oracle/broken_loop.res.oracle0000666000000000000000000000137613571573400021235 0ustar [kernel] Parsing tests/value/broken_loop.i (no preprocessing) [eva] Analyzing a complete application starting at loop [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} [eva] Recording results for loop [eva] done for function loop [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function loop: X ∈ {2} [from] Computing for function loop [from] Done for function loop [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: X FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function loop: X [inout] Inputs for function loop: \nothing frama-c-20.0-Calcium/tests/value/oracle/bts0506.0.res.oracle0000666000000000000000000002233313571573400020161 0ustar [kernel] Parsing tests/value/bts0506.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/bts0506.i:47. [eva] Recording results for f [eva] Done for function f [eva] computing for function main2 <- main. Called from tests/value/bts0506.i:49. [eva] computing for function f1 <- main2 <- main. Called from tests/value/bts0506.i:15. [kernel:annot:missing-spec] tests/value/bts0506.i:15: Warning: Neither code nor specification for function f1, generating default assigns from the prototype [eva] using specification for function f1 [eva] Done for function f1 [eva] computing for function f1 <- main2 <- main. Called from tests/value/bts0506.i:16. [eva] Done for function f1 [eva] computing for function f1 <- main2 <- main. Called from tests/value/bts0506.i:17. [eva] Done for function f1 [eva] computing for function f1 <- main2 <- main. Called from tests/value/bts0506.i:18. [eva] Done for function f1 [eva] computing for function f2 <- main2 <- main. Called from tests/value/bts0506.i:20. [kernel:annot:missing-spec] tests/value/bts0506.i:20: Warning: Neither code nor specification for function f2, generating default assigns from the prototype [eva] using specification for function f2 [eva] Done for function f2 [eva] computing for function f2 <- main2 <- main. Called from tests/value/bts0506.i:21. [eva] Done for function f2 [eva] computing for function f2 <- main2 <- main. Called from tests/value/bts0506.i:22. [eva] Done for function f2 [eva] computing for function f3 <- main2 <- main. Called from tests/value/bts0506.i:24. [kernel:annot:missing-spec] tests/value/bts0506.i:24: Warning: Neither code nor specification for function f3, generating default assigns from the prototype [eva] using specification for function f3 [eva] Done for function f3 [eva] computing for function f3 <- main2 <- main. Called from tests/value/bts0506.i:25. [eva] Done for function f3 [eva] computing for function f4 <- main2 <- main. Called from tests/value/bts0506.i:27. [kernel:annot:missing-spec] tests/value/bts0506.i:27: Warning: Neither code nor specification for function f4, generating default assigns from the prototype [eva] using specification for function f4 [eva] Done for function f4 [eva:alarm] tests/value/bts0506.i:27: Warning: non-finite float value. assert \is_finite(tmp_8); (tmp_8 from f4()) [eva] computing for function f4 <- main2 <- main. Called from tests/value/bts0506.i:28. [eva] Done for function f4 [eva:alarm] tests/value/bts0506.i:28: Warning: non-finite float value. assert \is_finite(tmp_9); (tmp_9 from f4()) [eva] computing for function f5 <- main2 <- main. Called from tests/value/bts0506.i:30. [kernel:annot:missing-spec] tests/value/bts0506.i:30: Warning: Neither code nor specification for function f5, generating default assigns from the prototype [eva] using specification for function f5 [eva] Done for function f5 [eva:alarm] tests/value/bts0506.i:30: Warning: non-finite double value. assert \is_finite(tmp_10); (tmp_10 from f5()) [eva:alarm] tests/value/bts0506.i:30: Warning: non-finite float value. assert \is_finite((float)tmp_10); (tmp_10 from f5()) [eva] computing for function f5 <- main2 <- main. Called from tests/value/bts0506.i:31. [eva] Done for function f5 [eva:alarm] tests/value/bts0506.i:31: Warning: non-finite double value. assert \is_finite(tmp_11); (tmp_11 from f5()) [eva] computing for function f6 <- main2 <- main. Called from tests/value/bts0506.i:33. [kernel:annot:missing-spec] tests/value/bts0506.i:33: Warning: Neither code nor specification for function f6, generating default assigns from the prototype [eva] using specification for function f6 [eva] Done for function f6 [eva] computing for function f6 <- main2 <- main. Called from tests/value/bts0506.i:34. [eva] Done for function f6 [eva] computing for function f6 <- main2 <- main. Called from tests/value/bts0506.i:35. [eva] Done for function f6 [eva] computing for function f7 <- main2 <- main. Called from tests/value/bts0506.i:37. [kernel:annot:missing-spec] tests/value/bts0506.i:37: Warning: Neither code nor specification for function f7, generating default assigns from the prototype [eva] using specification for function f7 [eva] Done for function f7 [eva] computing for function f7 <- main2 <- main. Called from tests/value/bts0506.i:38. [eva] Done for function f7 [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {43} [eva:final-states] Values at end of function main2: r1 ∈ [--..--] r2 ∈ [--..--] r3 ∈ [--..--] r4 ∈ [--..--] r5 ∈ [--..--] r6 ∈ [--..--] r7 ∈ [--..--] r8 ∈ [--..--] r8bis ∈ [--..--] r9 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] r10 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] r11 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] r12 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] r13 ∈ [--..--] r14 ∈ [--..--] r15 ∈ [--..--] r16 ∈ [--..--] r17 ∈ [--..--] [eva:final-states] Values at end of function main: x ∈ {43} [from] Computing for function f [from] Done for function f [from] Computing for function main2 [from] Computing for function f1 <-main2 [from] Done for function f1 [from] Computing for function f2 <-main2 [from] Done for function f2 [from] Computing for function f3 <-main2 [from] Done for function f3 [from] Computing for function f4 <-main2 [from] Done for function f4 [from] Computing for function f5 <-main2 [from] Done for function f5 [from] Computing for function f6 <-main2 [from] Done for function f6 [from] Computing for function f7 <-main2 [from] Done for function f7 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function f1: \result FROM \nothing [from] Function f2: \result FROM \nothing [from] Function f3: \result FROM \nothing [from] Function f4: \result FROM \nothing [from] Function f5: \result FROM \nothing [from] Function f6: \result FROM \nothing [from] Function f7: \result FROM \nothing [from] Function main2: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main2: r1; tmp; r2; tmp_0; r3; tmp_1; r4; tmp_2; r5; tmp_3; r6; tmp_4; r7; tmp_5; r8; tmp_6; r8bis; tmp_7; r9; tmp_8; r10; tmp_9; r11; tmp_10; r12; tmp_11; r13; tmp_12; r14; tmp_13; r15; tmp_14; r16; tmp_15; r17; tmp_16 [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main: x; tmp [inout] Inputs for function main: \nothing /* Generated by Frama-C */ /*@ assigns \result; assigns \result \from \nothing; */ int f1(void); /*@ assigns \result; assigns \result \from \nothing; */ long f2(void); /*@ assigns \result; assigns \result \from \nothing; */ unsigned int f3(void); /*@ assigns \result; assigns \result \from \nothing; */ float f4(void); /*@ assigns \result; assigns \result \from \nothing; */ double f5(void); /*@ assigns \result; assigns \result \from \nothing; */ int *f6(void); /*@ assigns \result; assigns \result \from \nothing; */ void *f7(void); void main2(void) { int tmp; int tmp_0; int tmp_1; int tmp_2; long tmp_3; long tmp_4; long tmp_5; unsigned int tmp_6; unsigned int tmp_7; float tmp_8; float tmp_9; double tmp_10; double tmp_11; int *tmp_12; int *tmp_13; int *tmp_14; void *tmp_15; void *tmp_16; tmp = f1(); long r1 = (long)tmp; tmp_0 = f1(); short r2 = (short)tmp_0; tmp_1 = f1(); int r3 = tmp_1; tmp_2 = f1(); unsigned int r4 = (unsigned int)tmp_2; tmp_3 = f2(); long r5 = tmp_3; tmp_4 = f2(); int r6 = (int)tmp_4; tmp_5 = f2(); unsigned long r7 = (unsigned long)tmp_5; tmp_6 = f3(); unsigned int r8 = tmp_6; tmp_7 = f3(); int r8bis = (int)tmp_7; tmp_8 = f4(); /*@ assert Eva: is_nan_or_infinite: \is_finite(tmp_8); */ float r9 = tmp_8; tmp_9 = f4(); /*@ assert Eva: is_nan_or_infinite: \is_finite(tmp_9); */ double r10 = (double)tmp_9; tmp_10 = f5(); /*@ assert Eva: is_nan_or_infinite: \is_finite(tmp_10); */ /*@ assert Eva: is_nan_or_infinite: \is_finite((float)tmp_10); */ float r11 = (float)tmp_10; tmp_11 = f5(); /*@ assert Eva: is_nan_or_infinite: \is_finite(tmp_11); */ double r12 = tmp_11; tmp_12 = f6(); void *r13 = (void *)tmp_12; tmp_13 = f6(); int *r14 = tmp_13; tmp_14 = f6(); char *r15 = (char *)tmp_14; tmp_15 = f7(); void *r16 = tmp_15; tmp_16 = f7(); int *r17 = (int *)tmp_16; return; } int f(int x) { int __retres; __retres = x + 1; return __retres; } void main(void) { int tmp; short x = (short)4; tmp = f(42); x = (short)tmp; main2(); return; } frama-c-20.0-Calcium/tests/value/oracle/bts0506.1.res.oracle0000666000000000000000000002041213571573400020156 0ustar [kernel] Parsing tests/value/bts0506.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/bts0506.i:47. [eva] Recording results for f [eva] Done for function f [eva] computing for function main2 <- main. Called from tests/value/bts0506.i:49. [eva] computing for function f1 <- main2 <- main. Called from tests/value/bts0506.i:15. [kernel:annot:missing-spec] tests/value/bts0506.i:15: Warning: Neither code nor specification for function f1, generating default assigns from the prototype [eva] using specification for function f1 [eva] Done for function f1 [eva] computing for function f1 <- main2 <- main. Called from tests/value/bts0506.i:16. [eva] Done for function f1 [eva] computing for function f1 <- main2 <- main. Called from tests/value/bts0506.i:17. [eva] Done for function f1 [eva] computing for function f1 <- main2 <- main. Called from tests/value/bts0506.i:18. [eva] Done for function f1 [eva] computing for function f2 <- main2 <- main. Called from tests/value/bts0506.i:20. [kernel:annot:missing-spec] tests/value/bts0506.i:20: Warning: Neither code nor specification for function f2, generating default assigns from the prototype [eva] using specification for function f2 [eva] Done for function f2 [eva] computing for function f2 <- main2 <- main. Called from tests/value/bts0506.i:21. [eva] Done for function f2 [eva] computing for function f2 <- main2 <- main. Called from tests/value/bts0506.i:22. [eva] Done for function f2 [eva] computing for function f3 <- main2 <- main. Called from tests/value/bts0506.i:24. [kernel:annot:missing-spec] tests/value/bts0506.i:24: Warning: Neither code nor specification for function f3, generating default assigns from the prototype [eva] using specification for function f3 [eva] Done for function f3 [eva] computing for function f3 <- main2 <- main. Called from tests/value/bts0506.i:25. [eva] Done for function f3 [eva] computing for function f4 <- main2 <- main. Called from tests/value/bts0506.i:27. [kernel:annot:missing-spec] tests/value/bts0506.i:27: Warning: Neither code nor specification for function f4, generating default assigns from the prototype [eva] using specification for function f4 [eva] Done for function f4 [eva] computing for function f4 <- main2 <- main. Called from tests/value/bts0506.i:28. [eva] Done for function f4 [eva:alarm] tests/value/bts0506.i:28: Warning: non-finite float value. assert \is_finite(tmp_9); (tmp_9 from f4()) [eva] computing for function f5 <- main2 <- main. Called from tests/value/bts0506.i:30. [kernel:annot:missing-spec] tests/value/bts0506.i:30: Warning: Neither code nor specification for function f5, generating default assigns from the prototype [eva] using specification for function f5 [eva] Done for function f5 [eva:alarm] tests/value/bts0506.i:30: Warning: non-finite double value. assert \is_finite(tmp_10); (tmp_10 from f5()) [eva:alarm] tests/value/bts0506.i:30: Warning: non-finite float value. assert \is_finite((float)tmp_10); (tmp_10 from f5()) [eva] computing for function f5 <- main2 <- main. Called from tests/value/bts0506.i:31. [eva] Done for function f5 [eva] computing for function f6 <- main2 <- main. Called from tests/value/bts0506.i:33. [kernel:annot:missing-spec] tests/value/bts0506.i:33: Warning: Neither code nor specification for function f6, generating default assigns from the prototype [eva] using specification for function f6 [eva] Done for function f6 [eva] computing for function f6 <- main2 <- main. Called from tests/value/bts0506.i:34. [eva] Done for function f6 [eva] computing for function f6 <- main2 <- main. Called from tests/value/bts0506.i:35. [eva] Done for function f6 [eva] computing for function f7 <- main2 <- main. Called from tests/value/bts0506.i:37. [kernel:annot:missing-spec] tests/value/bts0506.i:37: Warning: Neither code nor specification for function f7, generating default assigns from the prototype [eva] using specification for function f7 [eva] Done for function f7 [eva] computing for function f7 <- main2 <- main. Called from tests/value/bts0506.i:38. [eva] Done for function f7 [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {43} [eva:final-states] Values at end of function main2: r1 ∈ [--..--] r2 ∈ [--..--] r3 ∈ [--..--] r4 ∈ [--..--] r5 ∈ [--..--] r6 ∈ [--..--] r7 ∈ [--..--] r8 ∈ [--..--] r8bis ∈ [--..--] r9 ∈ [-inf .. inf] ∪ {NaN} r10 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] r11 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] r12 ∈ [-inf .. inf] ∪ {NaN} r13 ∈ [--..--] r14 ∈ [--..--] r15 ∈ [--..--] r16 ∈ [--..--] r17 ∈ [--..--] [eva:final-states] Values at end of function main: x ∈ {43} [from] Computing for function f [from] Done for function f [from] Computing for function main2 [from] Computing for function f1 <-main2 [from] Done for function f1 [from] Computing for function f2 <-main2 [from] Done for function f2 [from] Computing for function f3 <-main2 [from] Done for function f3 [from] Computing for function f4 <-main2 [from] Done for function f4 [from] Computing for function f5 <-main2 [from] Done for function f5 [from] Computing for function f6 <-main2 [from] Done for function f6 [from] Computing for function f7 <-main2 [from] Done for function f7 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function f1: \result FROM \nothing [from] Function f2: \result FROM \nothing [from] Function f3: \result FROM \nothing [from] Function f4: \result FROM \nothing [from] Function f5: \result FROM \nothing [from] Function f6: \result FROM \nothing [from] Function f7: \result FROM \nothing [from] Function main2: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main2: r1; r2; tmp_0; r3; r4; tmp_2; r5; r6; r7; tmp_5; r8; r8bis; tmp_7; r9; r10; tmp_9; r11; tmp_10; r12; r13; r14; r15; r16; r17 [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main: x; tmp [inout] Inputs for function main: \nothing /* Generated by Frama-C */ /*@ assigns \result; assigns \result \from \nothing; */ int f1(void); /*@ assigns \result; assigns \result \from \nothing; */ long f2(void); /*@ assigns \result; assigns \result \from \nothing; */ unsigned int f3(void); /*@ assigns \result; assigns \result \from \nothing; */ float f4(void); /*@ assigns \result; assigns \result \from \nothing; */ double f5(void); /*@ assigns \result; assigns \result \from \nothing; */ int *f6(void); /*@ assigns \result; assigns \result \from \nothing; */ void *f7(void); void main2(void) { int tmp_0; int tmp_2; long tmp_5; unsigned int tmp_7; float tmp_9; double tmp_10; long r1 = f1(); tmp_0 = f1(); short r2 = (short)tmp_0; int r3 = f1(); tmp_2 = f1(); unsigned int r4 = (unsigned int)tmp_2; long r5 = f2(); int r6 = f2(); tmp_5 = f2(); unsigned long r7 = (unsigned long)tmp_5; unsigned int r8 = f3(); tmp_7 = f3(); int r8bis = (int)tmp_7; float r9 = f4(); tmp_9 = f4(); /*@ assert Eva: is_nan_or_infinite: \is_finite(tmp_9); */ double r10 = (double)tmp_9; tmp_10 = f5(); /*@ assert Eva: is_nan_or_infinite: \is_finite(tmp_10); */ /*@ assert Eva: is_nan_or_infinite: \is_finite((float)tmp_10); */ float r11 = (float)tmp_10; double r12 = f5(); void *r13 = f6(); int *r14 = f6(); char *r15 = f6(); void *r16 = f7(); int *r17 = f7(); return; } int f(int x) { int __retres; __retres = x + 1; return __retres; } void main(void) { int tmp; short x = (short)4; tmp = f(42); x = (short)tmp; main2(); return; } frama-c-20.0-Calcium/tests/value/oracle/bts0775.res.oracle0000666000000000000000000000136713571573400020037 0ustar [kernel] Parsing tests/value/bts0775.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: r ∈ {1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: r [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/bts0858.res.oracle0000666000000000000000000000144113571573400020032 0ustar [kernel] Parsing tests/value/bts0858.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: tmp ∈ {4294967295} __retres ∈ {1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: tmp; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/bts1306.res.oracle0000666000000000000000000000355213571573400020024 0ustar [kernel] Parsing tests/value/bts1306.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function g <- main. Called from tests/value/bts1306.i:9. [eva:alarm] tests/value/bts1306.i:5: Warning: non-finite double value. assert \is_finite((double)(x * x)); [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: y ∈ [-1.79769313486e+308 .. 1.79769313486e+308] [eva:final-states] Values at end of function main: __retres ∈ {0} /* Generated by Frama-C */ void g(double x) { /*@ assert Eva: is_nan_or_infinite: \is_finite((double)(x * x)); */ double y = x * x; return; } int main(double x) { int __retres; g(x); __retres = 0; return __retres; } [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function g <- main. Called from tests/value/bts1306.i:9. [eva:alarm] tests/value/bts1306.i:5: Warning: non-finite double value. assert \is_finite((double)(x * x)); [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: y ∈ [-1.79769313486e+308 .. 1.79769313486e+308] [eva:final-states] Values at end of function main: __retres ∈ {0} /* Generated by Frama-C */ void g(double x) { /*@ assert Eva: is_nan_or_infinite: \is_finite((double)(x * x)); */ double y = x * x; return; } int main(double x) { int __retres; g(x); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/value/oracle/buffer_overflow.0.res.oracle0000666000000000000000000000205313571573400022247 0ustar [kernel] Parsing tests/value/buffer_overflow.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/buffer_overflow.i:15: starting to merge loop iterations [eva:alarm] tests/value/buffer_overflow.i:18: Warning: accessing out of bounds index. assert loop_counter < 10; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: test_value; loop_counter; buf[1..9] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/buffer_overflow.1.res.oracle0000666000000000000000000000227513571573400022256 0ustar [kernel] Parsing tests/value/buffer_overflow.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/buffer_overflow.i:18: Warning: accessing out of bounds index. assert loop_counter < 10; [kernel] tests/value/buffer_overflow.i:18: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/buffer_overflow.i:18: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: test_value; loop_counter; buf[1..9] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/bug.res.oracle0000666000000000000000000000131313571573400017470 0ustar [kernel] Parsing tests/value/bug.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: \nothing frama-c-20.0-Calcium/tests/value/oracle/bug0196.res.oracle0000666000000000000000000000376013571573400020020 0ustar [kernel] Parsing tests/value/bug0196.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function fact <- main. Called from tests/value/bug0196.c:16. [eva] tests/value/bug0196.c:8: assertion got status valid. [eva] tests/value/bug0196.c:11: cannot evaluate ACSL term, \at() on a C label is unsupported [eva:alarm] tests/value/bug0196.c:11: Warning: assertion got status unknown. [eva] tests/value/bug0196.c:7: starting to merge loop iterations [eva:alarm] tests/value/bug0196.c:10: Warning: signed overflow. assert r * tmp ≤ 2147483647; (tmp from n--) [eva] Recording results for fact [eva] Done for function fact [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fact: n ∈ {0} r ∈ [1..2147483647] [eva:final-states] Values at end of function main: [from] Computing for function fact [from] Done for function fact [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function fact: \result FROM n [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function fact: n; r; tmp [inout] Inputs for function fact: \nothing [inout] Out (internal) for function main: tmp [inout] Inputs for function main: \nothing /* Generated by Frama-C */ int fact(int n) { int r = 1; while (n > 0) { int tmp; /*@ assert n > 0; */ ; before: { /* sequence */ tmp = n; n --; /*@ assert Eva: signed_overflow: r * tmp ≤ 2147483647; */ r *= tmp; } /*@ assert r ≡ \at(r * n,before); */ ; } while_0_break: ; return r; } int main(void) { int tmp; tmp = fact(3); return tmp; } frama-c-20.0-Calcium/tests/value/oracle/bug0223.0.res.oracle0000666000000000000000000000444713571573400020150 0ustar [kernel] Parsing tests/value/bug0223.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization ch1 ∈ {{ NULL ; &S_ch1[0] }} ch2 ∈ {{ NULL ; &S_ch2[0] }} S_ch1[0..1] ∈ [--..--] S_ch2[0..1] ∈ [--..--] [eva] computing for function F <- main. Called from tests/value/bug0223.i:33. [kernel:annot:missing-spec] tests/value/bug0223.i:33: Warning: Neither code nor specification for function F, generating default assigns from the prototype [eva] using specification for function F [eva] Done for function F [eva] computing for function F <- main. Called from tests/value/bug0223.i:34. [eva] Done for function F [eva] computing for function h2 <- main. Called from tests/value/bug0223.i:35. [eva] computing for function my_strcnmp <- h2 <- main. Called from tests/value/bug0223.i:16. [kernel:annot:missing-spec] tests/value/bug0223.i:16: Warning: Neither code nor specification for function my_strcnmp, generating default assigns from the prototype [eva] using specification for function my_strcnmp [eva] Done for function my_strcnmp [eva] Recording results for h2 [eva] Done for function h2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function h2: test ∈ {0; 1} [eva:final-states] Values at end of function main: i ∈ {0} j ∈ {0; 1} k ∈ {0} l ∈ {0; 1} p ∈ {{ &j }} [from] Computing for function h2 [from] Computing for function my_strcnmp <-h2 [from] Done for function my_strcnmp [from] Done for function h2 [from] Computing for function main [from] Computing for function F <-main [from] Done for function F [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function F: \result FROM \nothing [from] Function my_strcnmp: \result FROM n [from] Function h2: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function h2: test; tmp [inout] Inputs for function h2: ch1; ch2 [inout] Out (internal) for function main: i; j; k; l; p; tmp; tmp_0 [inout] Inputs for function main: ch1; ch2 frama-c-20.0-Calcium/tests/value/oracle/bug0223.1.res.oracle0000666000000000000000000000444713571573400020151 0ustar [kernel] Parsing tests/value/bug0223.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization ch1 ∈ {{ NULL ; &S_ch1[0] }} ch2 ∈ {{ NULL ; &S_ch2[0] }} S_ch1[0..1] ∈ [--..--] S_ch2[0..1] ∈ [--..--] [eva] computing for function F <- main. Called from tests/value/bug0223.i:33. [kernel:annot:missing-spec] tests/value/bug0223.i:33: Warning: Neither code nor specification for function F, generating default assigns from the prototype [eva] using specification for function F [eva] Done for function F [eva] computing for function F <- main. Called from tests/value/bug0223.i:34. [eva] Done for function F [eva] computing for function h2 <- main. Called from tests/value/bug0223.i:35. [eva] computing for function my_strcnmp <- h2 <- main. Called from tests/value/bug0223.i:16. [kernel:annot:missing-spec] tests/value/bug0223.i:16: Warning: Neither code nor specification for function my_strcnmp, generating default assigns from the prototype [eva] using specification for function my_strcnmp [eva] Done for function my_strcnmp [eva] Recording results for h2 [eva] Done for function h2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function h2: test ∈ {0; 1} [eva:final-states] Values at end of function main: i ∈ {0} j ∈ {0; 1} k ∈ {0} l ∈ {0; 1} p ∈ {{ &j }} [from] Computing for function h2 [from] Computing for function my_strcnmp <-h2 [from] Done for function my_strcnmp [from] Done for function h2 [from] Computing for function main [from] Computing for function F <-main [from] Done for function F [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function F: \result FROM \nothing [from] Function my_strcnmp: \result FROM n [from] Function h2: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function h2: test; tmp [inout] Inputs for function h2: ch1; ch2 [inout] Out (internal) for function main: i; j; k; l; p; tmp; tmp_0 [inout] Inputs for function main: ch1; ch2 frama-c-20.0-Calcium/tests/value/oracle/bug0245.res.oracle0000666000000000000000000000315313571573400020007 0ustar [kernel] Parsing tests/value/bug0245.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization R ∈ {0} p ∈ {0} S ∈ {0} q ∈ {0} [eva:locals-escaping] tests/value/bug0245.i:20: Warning: locals {v} escaping the scope of a block of main through q [eva:locals-escaping] tests/value/bug0245.i:20: Warning: locals {u} escaping the scope of a block of main through p [eva:alarm] tests/value/bug0245.i:23: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [eva:alarm] tests/value/bug0245.i:24: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&q); [eva] Recording results for main [eva] done for function main [eva] tests/value/bug0245.i:23: assertion 'Eva,dangling_pointer' got final status invalid. [eva] tests/value/bug0245.i:24: assertion 'Eva,dangling_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: R ∈ {0} p ∈ ESCAPINGADDR S ∈ {0} q ∈ ESCAPINGADDR a ∈ {2} i ∈ {2} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: R FROM c (and SELF) p FROM \nothing S FROM d (and SELF) q FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: R; p; S; q; a; i; u; v [inout] Inputs for function main: p; q frama-c-20.0-Calcium/tests/value/oracle/bug_023.res.oracle0000666000000000000000000000232413571573400020057 0ustar [kernel] Parsing tests/value/bug_023.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} x ∈ {0} [eva] computing for function f <- main. Called from tests/value/bug_023.i:8. [kernel:annot:missing-spec] tests/value/bug_023.i:8: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ [--..--] __retres ∈ {0} [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function main: i FROM i \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; tmp; __retres [inout] Inputs for function main: i frama-c-20.0-Calcium/tests/value/oracle/bug_0244.res.oracle0000666000000000000000000000252413571573400020146 0ustar [kernel] Parsing tests/value/bug_0244.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization R ∈ {0} p ∈ {0} [eva:locals-escaping] tests/value/bug_0244.i:10: Warning: locals {u} escaping the scope of a block of main through p [eva] tests/value/bug_0244.i:7: starting to merge loop iterations [eva:alarm] tests/value/bug_0244.i:12: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [eva:alarm] tests/value/bug_0244.i:12: Warning: out of bounds read. assert \valid_read(p); [eva] Recording results for main [eva] done for function main [eva] tests/value/bug_0244.i:12: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: R; p; a; i; u [inout] Inputs for function main: p frama-c-20.0-Calcium/tests/value/oracle/builtins_split.res.oracle0000666000000000000000000003424613571573400021772 0ustar [kernel] Parsing tests/value/builtins_split.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} x ∈ {0} y ∈ {0} t[0..9] ∈ {0} v ∈ [--..--] s0 ∈ {0} s1 ∈ {0} s2 ∈ {0} s3 ∈ {0} s4 ∈ {0} s5 ∈ {0} s6 ∈ {0} s7 ∈ {0} ps ∈ {0} [eva] computing for function test1 <- main. Called from tests/value/builtins_split.c:150. [eva] computing for function setup1 <- test1 <- main. Called from tests/value/builtins_split.c:20. [eva] Recording results for setup1 [eva] Done for function setup1 [eva] tests/value/builtins_split.c:22: Call to builtin Frama_C_builtin_split [eva] tests/value/builtins_split.c:22: Location *p is not a singleton ({{ x -> {0}; y -> {0} }} (size:<32>)). Cannot split. [eva] tests/value/builtins_split.c:23: Frama_C_show_each_split: {{ &x ; &y }} [eva] tests/value/builtins_split.c:25: Call to builtin Frama_C_builtin_split_pointer [eva] tests/value/builtins_split.c:26: Frama_C_show_each_split_pointer: {{ &y }} [eva] tests/value/builtins_split.c:26: Frama_C_show_each_split_pointer: {{ &x }} [eva] Recording results for test1 [eva] Done for function test1 [eva] computing for function test2 <- main. Called from tests/value/builtins_split.c:151. [eva] computing for function setup2 <- test2 <- main. Called from tests/value/builtins_split.c:40. [eva] Recording results for setup2 [eva] Done for function setup2 [eva:alarm] tests/value/builtins_split.c:42: Warning: assertion got status unknown. [eva] tests/value/builtins_split.c:43: Frama_C_show_each_t_i_1: [0..9], {0; 4; 8; 12} [eva] tests/value/builtins_split.c:44: Call to builtin Frama_C_builtin_split_all [eva] tests/value/builtins_split.c:46: Frama_C_show_each_t_i_2: {2}, {8} [eva] Recording results for test2 [eva] Done for function test2 [eva] computing for function test3 <- main. Called from tests/value/builtins_split.c:152. [eva] computing for function setup3 <- test3 <- main. Called from tests/value/builtins_split.c:77. [eva] Recording results for setup3 [eva] Done for function setup3 [eva] tests/value/builtins_split.c:82: Frama_C_show_each_s_1: {{ &s3 + {4} }}, {1} [eva:alarm] tests/value/builtins_split.c:89: Warning: out of bounds read. assert \valid_read(&(ps->p)->p); [eva] tests/value/builtins_split.c:91: Frama_C_show_each_s_2: {{ &s5 + {4} }}, {{ &s3 + {4} }}, {{ &s1 }}, {1} [eva:alarm] tests/value/builtins_split.c:96: Warning: out of bounds read. assert \valid_read(&(ps->p)->p); [eva] tests/value/builtins_split.c:96: Call to builtin Frama_C_builtin_split_all [eva] tests/value/builtins_split.c:99: Frama_C_show_each_s_3: {{ &s5 + {4} }}, {{ &s3 + {4} }}, {{ &s1 }}, {1} [eva:alarm] tests/value/builtins_split.c:104: Warning: out of bounds read. assert \valid_read(&(ps->p)->p); [eva] tests/value/builtins_split.c:104: Call to builtin Frama_C_builtin_split_all [eva:alarm] tests/value/builtins_split.c:106: Warning: assertion got status invalid (stopping propagation). [eva] tests/value/builtins_split.c:106: assertion got status valid. [eva] tests/value/builtins_split.c:107: Frama_C_show_each_s_4: {{ &s5 + {4} }}, {{ &s3 + {4} }}, {{ &s1 }}, {1} [eva:alarm] tests/value/builtins_split.c:112: Warning: out of bounds read. assert \valid_read(&(ps->p)->p); [eva] tests/value/builtins_split.c:112: Call to builtin Frama_C_builtin_split_all [eva] tests/value/builtins_split.c:112: Location ((ps->p)->p)->v points to too many values ([--..--]). Cannot split. [eva] tests/value/builtins_split.c:114: Frama_C_show_each_s_5: {{ &s5 + {4} }}, {{ &s4 + {4} }}, {{ &s0 }}, {0} [eva] tests/value/builtins_split.c:114: Frama_C_show_each_s_5: {{ &s5 + {4} }}, {{ &s4 + {4} }}, {{ &s2 }}, [-2147483648..2147483647] [eva] tests/value/builtins_split.c:114: Frama_C_show_each_s_5: {{ &s5 + {4} }}, {{ &s3 + {4} }}, {{ &s0 }}, {0} [eva] tests/value/builtins_split.c:114: Frama_C_show_each_s_5: {{ &s5 + {4} }}, {{ &s3 + {4} }}, {{ &s1 }}, {1} [eva] tests/value/builtins_split.c:114: Frama_C_show_each_s_5: {{ &s5 + {4} }}, {{ &s3 + {4} }}, {{ &s1 }}, {-1} [eva] tests/value/builtins_split.c:114: Frama_C_show_each_s_5: {{ &s6 + {4} }}, {{ &s4 + {4} }}, {{ &s0 }}, {0} [eva] tests/value/builtins_split.c:114: Frama_C_show_each_s_5: {{ &s6 + {4} }}, {{ &s4 + {4} }}, {{ &s2 }}, [-2147483648..2147483647] [eva] Recording results for test3 [eva] Done for function test3 [eva] computing for function test4 <- main. Called from tests/value/builtins_split.c:153. [eva:alarm] tests/value/builtins_split.c:121: Warning: assertion got status unknown. [eva] tests/value/builtins_split.c:122: Call to builtin Frama_C_abstract_cardinal [eva] tests/value/builtins_split.c:123: Frama_C_show_each_nb: {29} [eva] tests/value/builtins_split.c:124: Call to builtin Frama_C_builtin_split [eva] tests/value/builtins_split.c:124: Location x_0 points to too many values ([-3..25]). Cannot split. [eva] tests/value/builtins_split.c:125: Frama_C_show_each_test4_1: [-3..25] [eva] tests/value/builtins_split.c:127: Call to builtin Frama_C_builtin_split [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {25} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {24} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {23} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {22} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {21} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {20} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {19} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {18} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {17} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {16} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {15} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {14} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {13} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {12} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {11} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {10} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {9} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {8} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {7} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {6} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {5} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {4} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {3} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {2} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {1} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {0} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {-1} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {-2} [eva] tests/value/builtins_split.c:128: Frama_C_show_each_test4_2: {-3} [eva] Recording results for test4 [eva] Done for function test4 [eva] computing for function test5 <- main. Called from tests/value/builtins_split.c:154. [eva] tests/value/builtins_split.c:134: Call to builtin Frama_C_abstract_max [eva] tests/value/builtins_split.c:135: Frama_C_show_each_max: [-922337203255980851..922337203685477580], {922337203685477580} [eva] Recording results for test5 [eva] Done for function test5 [eva] computing for function test6 <- main. Called from tests/value/builtins_split.c:155. [eva:alarm] tests/value/builtins_split.c:142: Warning: assertion got status unknown. [eva] tests/value/builtins_split.c:145: Call to builtin Frama_C_builtin_split [eva] tests/value/builtins_split.c:146: Frama_C_domain_show_each_test6: z : # Cvalue domain: {5} or UNINITIALIZED [eva] tests/value/builtins_split.c:146: Frama_C_domain_show_each_test6: z : # Cvalue domain: {4} or UNINITIALIZED [eva] tests/value/builtins_split.c:146: Frama_C_domain_show_each_test6: z : # Cvalue domain: {3} or UNINITIALIZED [eva] tests/value/builtins_split.c:146: Frama_C_domain_show_each_test6: z : # Cvalue domain: {2} or UNINITIALIZED [eva] tests/value/builtins_split.c:146: Frama_C_domain_show_each_test6: z : # Cvalue domain: {1} or UNINITIALIZED [eva] tests/value/builtins_split.c:146: Frama_C_domain_show_each_test6: z : # Cvalue domain: {0} or UNINITIALIZED [eva] Recording results for test6 [eva] Done for function test6 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function setup1: p ∈ {{ &x ; &y }} [eva:final-states] Values at end of function setup2: t[0] ∈ {0} [1] ∈ {0; 4} [2] ∈ {0; 8; 12} [3..9] ∈ {0} [eva:final-states] Values at end of function setup3: s0 ∈ {0} s1.v ∈ {-1; 1} .p ∈ {0} s2.v ∈ {2} .p ∈ {0} s3.v ∈ {3} .p ∈ {{ &s0 ; &s1 }} s4.v ∈ {4} .p ∈ {{ &s0 ; &s2 }} s5.v ∈ {5} .p ∈ {{ &s3 ; &s4 }} s6.v ∈ {6} .p ∈ {{ &s4 }} ps ∈ {{ &s5 ; &s6 ; &s7 }} [eva:final-states] Values at end of function test1: p ∈ {{ &x ; &y }} [eva:final-states] Values at end of function test2: t[0] ∈ {0} [1] ∈ {0; 4} [2] ∈ {0; 8; 12} [3..9] ∈ {0} i ∈ [0..9] [eva:final-states] Values at end of function test3: s0 ∈ {0} s1.v ∈ {-1; 1} .p ∈ {0} s2.v ∈ [--..--] .p ∈ {0} s3.v ∈ {3} .p ∈ {{ &s0 ; &s1 }} s4.v ∈ {4} .p ∈ {{ &s0 ; &s2 }} s5.v ∈ {5} .p ∈ {{ &s3 ; &s4 }} s6.v ∈ {6} .p ∈ {{ &s4 }} ps ∈ {{ &s5 ; &s6 ; &s7 }} [eva:final-states] Values at end of function test4: x_0 ∈ [-3..25] nb ∈ {29} [eva:final-states] Values at end of function test5: x_0 ∈ [--..--] y_0 ∈ [-922337203255980851..922337203685477580] r ∈ {922337203685477580} [eva:final-states] Values at end of function test6: z ∈ {0; 1; 2; 3; 4; 5} or UNINITIALIZED [eva:final-states] Values at end of function main: p ∈ {{ &x ; &y }} t[0] ∈ {0} [1] ∈ {0; 4} [2] ∈ {0; 8; 12} [3..9] ∈ {0} s0 ∈ {0} s1.v ∈ {-1; 1} .p ∈ {0} s2.v ∈ [--..--] .p ∈ {0} s3.v ∈ {3} .p ∈ {{ &s0 ; &s1 }} s4.v ∈ {4} .p ∈ {{ &s0 ; &s2 }} s5.v ∈ {5} .p ∈ {{ &s3 ; &s4 }} s6.v ∈ {6} .p ∈ {{ &s4 }} ps ∈ {{ &s5 ; &s6 ; &s7 }} [from] Computing for function setup1 [from] Done for function setup1 [from] Computing for function setup2 [from] Done for function setup2 [from] Computing for function setup3 [from] Done for function setup3 [from] Computing for function test1 [from] Done for function test1 [from] Computing for function test2 [from] Done for function test2 [from] Computing for function test3 [from] Done for function test3 [from] Computing for function test4 [from] Computing for function Frama_C_abstract_cardinal <-test4 [from] Done for function Frama_C_abstract_cardinal [from] Done for function test4 [from] Computing for function test5 [from] Computing for function Frama_C_abstract_max <-test5 [from] Done for function Frama_C_abstract_max [from] Done for function test5 [from] Computing for function test6 [from] Done for function test6 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_abstract_cardinal: \result FROM i [from] Function Frama_C_abstract_max: \result FROM i [from] Function Frama_C_builtin_split: [from] Computing for function Frama_C_builtin_split [from] Done for function Frama_C_builtin_split \result FROM \nothing [from] Function Frama_C_builtin_split_all: [from] Computing for function Frama_C_builtin_split_all [from] Done for function Frama_C_builtin_split_all \result FROM \nothing [from] Function Frama_C_builtin_split_pointer: [from] Computing for function Frama_C_builtin_split_pointer [from] Done for function Frama_C_builtin_split_pointer \result FROM \nothing [from] Function setup1: p FROM v [from] Function setup2: t[1..2] FROM v (and SELF) [from] Function setup3: s0.v FROM \nothing s1.v FROM v s2.v FROM \nothing s3.v FROM \nothing .p FROM v s4.v FROM \nothing .p FROM v s5.v FROM \nothing .p FROM v s6 FROM \nothing ps FROM v [from] Function test1: p FROM v [from] Function test2: t[1..2] FROM v (and SELF) [from] Function test3: s0.v FROM \nothing s1.v FROM v s2.v FROM v s3.v FROM \nothing .p FROM v s4.v FROM \nothing .p FROM v s5.v FROM \nothing .p FROM v s6 FROM \nothing ps FROM v [from] Function test4: NO EFFECTS [from] Function test5: NO EFFECTS [from] Function test6: NO EFFECTS [from] Function main: p FROM v t[1..2] FROM v (and SELF) s0.v FROM \nothing s1.v FROM v s2.v FROM v s3.v FROM \nothing .p FROM v s4.v FROM \nothing .p FROM v s5.v FROM \nothing .p FROM v s6 FROM \nothing ps FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function setup1: p [inout] Inputs for function setup1: v [inout] Out (internal) for function setup2: t[1..2] [inout] Inputs for function setup2: v [inout] Out (internal) for function setup3: s0.v; s1.v; s2.v; s3; s4; s5; s6; ps; tmp [inout] Inputs for function setup3: v [inout] Out (internal) for function test1: p [inout] Inputs for function test1: p; x; y; v [inout] Out (internal) for function test2: t[1..2]; i [inout] Inputs for function test2: t[0..9]; v [inout] Out (internal) for function test3: s0.v; s1.v; s2.v; s3; s4; s5; s6; ps [inout] Inputs for function test3: v; s0.v; s1.v; s2.v; s3.p; s4.p; s5.p; s6.p; s7.p; ps [inout] Out (internal) for function test4: x_0; nb [inout] Inputs for function test4: v [inout] Out (internal) for function test5: x_0; y_0; r [inout] Inputs for function test5: v [inout] Out (internal) for function test6: z [inout] Inputs for function test6: v [inout] Out (internal) for function main: p; t[1..2]; s0.v; s1.v; s2.v; s3; s4; s5; s6; ps [inout] Inputs for function main: p; x; y; t[0..9]; v; s0.v; s1.v; s2.v; s3.p; s4.p; s5.p; s6.p; s7.p; ps frama-c-20.0-Calcium/tests/value/oracle/call.res.oracle0000666000000000000000000000571713571573400017642 0ustar [kernel] Parsing tests/value/call.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p[0..9] ∈ {0} q[0..9] ∈ {0} r ∈ {0} res ∈ {0} x ∈ {0} [eva:alarm] tests/value/call.i:19: Warning: out of bounds read. assert \valid_read(v + 1); [eva] computing for function leaf_fun_int <- main. Called from tests/value/call.i:19. [kernel:annot:missing-spec] tests/value/call.i:19: Warning: Neither code nor specification for function leaf_fun_int, generating default assigns from the prototype [eva] using specification for function leaf_fun_int [eva] Done for function leaf_fun_int [eva:alarm] tests/value/call.i:20: Warning: out of bounds read. assert \valid_read(v + 1); [eva] computing for function leaf_fun_charp <- main. Called from tests/value/call.i:20. [kernel:annot:missing-spec] tests/value/call.i:20: Warning: Neither code nor specification for function leaf_fun_charp, generating default assigns from the prototype [eva] using specification for function leaf_fun_charp [eva] Done for function leaf_fun_charp [eva] tests/value/call.i:23: starting to merge loop iterations [eva] computing for function f <- main. Called from tests/value/call.i:39. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: res ∈ {177; 188} [eva:final-states] Values at end of function main: p[0..4] ∈ {0; 1; 2; 3; 4; 5; 6} [5] ∈ {177} [6] ∈ {0; 1; 2; 3; 4; 5; 6} [7..9] ∈ {0} q[0..4] ∈ {0; 10; 11; 12; 13; 14; 15; 16} [5] ∈ {188} [6] ∈ {0; 10; 11; 12; 13; 14; 15; 16} [7..9] ∈ {0} res ∈ {177; 188} lcount ∈ {7} tmp ∈ {{ &p[0] ; &q[0] }} S_1_S_v[0..1] ∈ [--..--] [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Computing for function leaf_fun_int <-main [from] Done for function leaf_fun_int [from] Computing for function leaf_fun_charp <-main [from] Done for function leaf_fun_charp [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: res FROM p[5]; q[5]; t [from] Function leaf_fun_charp: S_1_S_v[0..1] FROM S_1_S_v[0..1] (and SELF) [from] Function leaf_fun_int: NO EFFECTS [from] Function main: p{[0..4]; [6]} FROM \nothing (and SELF) [5] FROM \nothing q{[0..4]; [6]} FROM \nothing (and SELF) [5] FROM \nothing res FROM c S_1_S_v[0..1] FROM c; S_1_S_v[0..1] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: res [inout] Inputs for function f: p[5]; q[5] [inout] Out (internal) for function main: p[0..6]; q[0..6]; res; lcount; tmp; S_1_S_v[0..1] [inout] Inputs for function main: p[5]; q[5]; S_v[1]; S_1_S_v[0..1] frama-c-20.0-Calcium/tests/value/oracle/call_2.res.oracle0000666000000000000000000000330513571573400020052 0ustar [kernel] Parsing tests/value/call_2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/call_2.i:15: Warning: accessing uninitialized left-value. assert \initialized(&z); [eva:alarm] tests/value/call_2.i:15: Warning: non-finite float value. assert \is_finite(f); [eva:alarm] tests/value/call_2.i:15: Warning: signed overflow. assert -2147483648 ≤ i + j; [eva:alarm] tests/value/call_2.i:15: Warning: signed overflow. assert i + j ≤ 2147483647; [eva] computing for function ff <- main. Called from tests/value/call_2.i:15. [eva] tests/value/call_2.i:6: Frama_C_show_each: [-2147483648..2147483647], [-3.40282346639e+38 .. 3.40282346639e+38], {1} [eva] Recording results for ff [eva] Done for function ff [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function ff: [eva:final-states] Values at end of function main: f ∈ [-3.40282346639e+38 .. 3.40282346639e+38] z ∈ {1} p ∈ {{ (int *)&f }} [from] Computing for function ff [from] Done for function ff [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function ff: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function ff: \nothing [inout] Inputs for function ff: \nothing [inout] Out (internal) for function main: f; z; p [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/call_3.res.oracle0000666000000000000000000000243713571573400020060 0ustar [kernel] Parsing tests/value/call_3.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization GG ∈ {0} [eva] computing for function f <- main. Called from tests/value/call_3.i:13. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: GG ∈ {3} G ∈ {2} __retres ∈ {1} [eva:final-states] Values at end of function main: GG ∈ {77} lm ∈ {77} res_f ∈ {1} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: GG FROM \nothing \result FROM \nothing [from] Function main: GG FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: GG; G; __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: GG; lm; res_f; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/call_alias.0.res.oracle0000666000000000000000000000260513571573400021142 0ustar [kernel] Parsing tests/value/call_alias.i (no preprocessing) [eva] Analyzing a complete application starting at main0 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} c ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} G ∈ {0} H ∈ {0} I ∈ {0} [eva] computing for function incr <- main0. Called from tests/value/call_alias.i:23. [eva] Recording results for incr [eva] Done for function incr [eva] Recording results for main0 [eva] done for function main0 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function incr: G ∈ {1} H ∈ {1} __retres ∈ {2} [eva:final-states] Values at end of function main0: G ∈ {1} H ∈ {1} I ∈ {2} [from] Computing for function incr [from] Done for function incr [from] Computing for function main0 [from] Done for function main0 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function incr: G FROM G; a H FROM b; H \result FROM G; a; b; H [from] Function main0: G FROM G H FROM H I FROM G; H \result FROM G; H [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function incr: G; H; __retres [inout] Inputs for function incr: G; H [inout] Out (internal) for function main0: G; H; I [inout] Inputs for function main0: G; H; I frama-c-20.0-Calcium/tests/value/oracle/call_alias.1.res.oracle0000666000000000000000000000250213571573400021137 0ustar [kernel] Parsing tests/value/call_alias.i (no preprocessing) [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} c ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} G ∈ {0} H ∈ {0} I ∈ {0} [eva] computing for function incr <- main1. Called from tests/value/call_alias.i:28. [eva] Recording results for incr [eva] Done for function incr [eva] Recording results for main1 [eva] done for function main1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function incr: G ∈ {2} __retres ∈ {4} [eva:final-states] Values at end of function main1: G ∈ {2} I ∈ {4} [from] Computing for function incr [from] Done for function incr [from] Computing for function main1 [from] Done for function main1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function incr: G FROM G; a; b \result FROM G; a; b [from] Function main1: G FROM G I FROM G \result FROM G [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function incr: G; __retres [inout] Inputs for function incr: G [inout] Out (internal) for function main1: G; I [inout] Inputs for function main1: G; I frama-c-20.0-Calcium/tests/value/oracle/call_alias.2.res.oracle0000666000000000000000000000241413571573400021142 0ustar [kernel] Parsing tests/value/call_alias.i (no preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} c ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} G ∈ {0} H ∈ {0} I ∈ {0} [eva] computing for function sum <- main2. Called from tests/value/call_alias.i:33. [eva] Recording results for sum [eva] Done for function sum [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function sum: __retres ∈ {0} [eva:final-states] Values at end of function main2: I ∈ {0} [from] Computing for function sum [from] Done for function sum [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function sum: \result FROM a; b [from] Function main2: I FROM G; H \result FROM G; H [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function sum: __retres [inout] Inputs for function sum: \nothing [inout] Out (internal) for function main2: I [inout] Inputs for function main2: G; H; I frama-c-20.0-Calcium/tests/value/oracle/call_deep.res.oracle0000666000000000000000000000420013571573400020621 0ustar [kernel] Parsing tests/value/call_deep.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization R ∈ {77} G ∈ {0} pG ∈ {0} F0 ∈ {0} F1 ∈ {0} H ∈ {0} XX ∈ {0} Fmain ∈ {0} [eva] computing for function f1 <- main. Called from tests/value/call_deep.i:31. [eva] computing for function f0 <- f1 <- main. Called from tests/value/call_deep.i:17. [eva] Recording results for f0 [eva] Done for function f0 [eva] Recording results for f1 [eva] Done for function f1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f0: G ∈ {77} F0 ∈ {77} [eva:final-states] Values at end of function f1: G ∈ {77} F0 ∈ {77} F1 ∈ {77} H ∈ {77} ph ∈ {{ &G }} __retres ∈ {77} [eva:final-states] Values at end of function main: G ∈ {77} pG ∈ {{ &G }} F0 ∈ {77} F1 ∈ {77} H ∈ {77} XX ∈ {0} Fmain ∈ {77} ph ∈ {{ &G }} pph ∈ {{ &ph }} __retres ∈ {0} [from] Computing for function f0 [from] Done for function f0 [from] Computing for function f1 [from] Done for function f1 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f0: G FROM R; p0 F0 FROM R \result FROM R [from] Function f1: G FROM R; pG F0 FROM R F1 FROM R H FROM R; pp1; ph ph FROM pG; pp1 \result FROM R; pG; pp1 [from] Function main: G FROM R pG FROM \nothing F0 FROM R F1 FROM R H FROM R XX FROM \nothing Fmain FROM R \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f0: G; F0 [inout] Inputs for function f0: R [inout] Out (internal) for function f1: G; F0; F1; H; ph; __retres [inout] Inputs for function f1: R; G; pG; ph [inout] Out (internal) for function main: G; pG; F0; F1; H; XX; Fmain; ph; pph; __retres [inout] Inputs for function main: R; G; pG frama-c-20.0-Calcium/tests/value/oracle/call_multi.res.oracle0000666000000000000000000000373213571573400021047 0ustar [kernel] Parsing tests/value/call_multi.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] computing for function uppol2 <- main. Called from tests/value/call_multi.i:29. [eva] tests/value/call_multi.i:23: Frama_C_show_each_GOT: {128} [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol2 <- main. Called from tests/value/call_multi.i:30. [eva] tests/value/call_multi.i:23: Frama_C_show_each_GOT: {128} [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol2 <- main. Called from tests/value/call_multi.i:31. [eva] tests/value/call_multi.i:23: Frama_C_show_each_GOT: {-128} [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] computing for function uppol2 <- main. Called from tests/value/call_multi.i:32. [eva] tests/value/call_multi.i:23: Frama_C_show_each_GOT: {128} [eva] Recording results for uppol2 [eva] Done for function uppol2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function uppol2: wd2 ∈ {0} wd4 ∈ {-128; 128} apl2 ∈ {-128; 128} [eva:final-states] Values at end of function main: G ∈ {256} [from] Computing for function uppol2 [from] Done for function uppol2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function uppol2: \result FROM al1; al2; plt; plt1; plt2 [from] Function main: G FROM G [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function uppol2: wd2; wd4; apl2 [inout] Inputs for function uppol2: \nothing [inout] Out (internal) for function main: G; tmp; tmp_0; tmp_1; tmp_2 [inout] Inputs for function main: G frama-c-20.0-Calcium/tests/value/oracle/call_simple.res.oracle0000666000000000000000000000306313571573400021203 0ustar [kernel] Parsing tests/value/call_simple.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} c ∈ {0} u ∈ {0} v ∈ {0} w ∈ {0} G ∈ {0} [eva] computing for function f <- main. Called from tests/value/call_simple.i:14. [eva] Recording results for f [eva] Done for function f [eva:alarm] tests/value/call_simple.i:15: Warning: signed overflow. assert ll + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: X ∈ {68} u ∈ {0} a ∈ {0} i ∈ {{ &u }} [eva:final-states] Values at end of function main: X ∈ {68} c ∈ [--..--] u ∈ {0} v ∈ {0} w ∈ {17} ll ∈ [-2147483647..2147483647] __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: X FROM b; c_0 u FROM a [from] Function main: X FROM G c FROM ll u FROM \nothing v FROM G w FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: X; u; a; i [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: X; c; u; v; w; ll; tmp; __retres [inout] Inputs for function main: v; w; G frama-c-20.0-Calcium/tests/value/oracle/case_analysis.res.oracle0000666000000000000000000000130713571573400021534 0ustar [kernel] Parsing tests/value/case_analysis.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization sq ∈ {0} s ∈ {0} rq ∈ {0} r ∈ {0} [eva] tests/value/case_analysis.i:14: assertion got status valid. [eva] tests/value/case_analysis.i:17: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: sq ∈ [0..100] s ∈ [-10..10] rq ∈ [-0.0000000000000000 .. 100.0000000000000000] r ∈ [-10.0000000000000000 .. 10.0000000000000000] frama-c-20.0-Calcium/tests/value/oracle/cast.res.oracle0000666000000000000000000001455613571573400017662 0ustar [kernel] Parsing tests/value/cast.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization __fc_stdout ∈ {{ NULL ; &S___fc_stdout[0] }} G ∈ {0} H ∈ {0} K ∈ {0} L ∈ {0} i ∈ {0} b ∈ {0} I ∈ {0} c ∈ {0} d ∈ {0} e ∈ {0} uc ∈ {0} ud ∈ {0} ll ∈ {0} gg ∈ {0} ull ∈ {0} ugg ∈ {0} S___fc_stdout[0..1] ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/cast.i:73. [eva] computing for function any_int_4 <- main1 <- main. Called from tests/value/cast.i:33. [eva] Recording results for any_int_4 [eva] Done for function any_int_4 [eva] computing for function printf_va_1 <- main1 <- main. Called from tests/value/cast.i:46. [eva] using specification for function printf_va_1 [eva:alarm] tests/value/cast.i:46: Warning: function printf_va_1: precondition got status unknown. [eva] Done for function printf_va_1 [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/cast.i:74. [eva] computing for function printf_va_2 <- main2 <- main. Called from tests/value/cast.i:67. [eva] using specification for function printf_va_2 [eva:alarm] tests/value/cast.i:67: Warning: function printf_va_2: precondition got status unknown. [eva] Done for function printf_va_2 [eva] tests/value/cast.i:64: starting to merge loop iterations [eva] computing for function printf_va_2 <- main2 <- main. Called from tests/value/cast.i:67. [eva] Done for function printf_va_2 [eva] computing for function printf_va_2 <- main2 <- main. Called from tests/value/cast.i:67. [eva] Done for function printf_va_2 [eva] computing for function printf_va_2 <- main2 <- main. Called from tests/value/cast.i:67. [eva] Done for function printf_va_2 [eva] computing for function printf_va_3 <- main2 <- main. Called from tests/value/cast.i:69. [eva] using specification for function printf_va_3 [eva:alarm] tests/value/cast.i:69: Warning: function printf_va_3: precondition got status unknown. [eva] Done for function printf_va_3 [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function any_int_4: i_0 ∈ [--..--] __retres ∈ [-536870912..536870911] [eva:final-states] Values at end of function main1: G ∈ [2..12] H ∈ [-536870912..536870911] K ∈ [-10..20] L ∈ [-4000..2],0%2 I ∈ {4294967295} c ∈ [-10..20] d ∈ [--..--] e ∈ [-128..126],0%2 uc ∈ [--..--] ull ∈ {1} S___fc_stdout[0..1] ∈ [--..--] [eva:final-states] Values at end of function main2: min ∈ {130} max ∈ {135} i_0 ∈ [136..2147483647] G_0 ∈ {-126; -125; -124; -123; -122; -121} or UNINITIALIZED S___fc_stdout[0..1] ∈ [--..--] [eva:final-states] Values at end of function main: G ∈ [2..12] H ∈ [-536870912..536870911] K ∈ [-10..20] L ∈ [-4000..2],0%2 I ∈ {4294967295} c ∈ [-10..20] d ∈ [--..--] e ∈ [-128..126],0%2 uc ∈ [--..--] ull ∈ {1} S___fc_stdout[0..1] ∈ [--..--] [from] Computing for function any_int_4 [from] Done for function any_int_4 [from] Computing for function main1 [from] Computing for function printf_va_1 <-main1 [from] Done for function printf_va_1 [from] Done for function main1 [from] Computing for function main2 [from] Computing for function printf_va_2 <-main2 [from] Done for function printf_va_2 [from] Computing for function printf_va_3 <-main2 [from] Done for function printf_va_3 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function any_int_4: \result FROM \nothing [from] Function printf_va_1: S___fc_stdout[0].__fc_FILE_data FROM param0; S___fc_stdout[0]; "%ud\n"[bits 0 to 39] (and SELF) \result FROM param0; S___fc_stdout[0]; "%ud\n"[bits 0 to 39] [from] Function main1: G FROM \nothing H FROM \nothing K FROM \nothing L FROM \nothing I FROM \nothing c FROM \nothing d FROM \nothing e FROM \nothing uc FROM \nothing ull FROM \nothing S___fc_stdout[0].__fc_FILE_data FROM S___fc_stdout[0]; "%ud\n"[bits 0 to 39] (and SELF) [from] Function printf_va_2: S___fc_stdout[0].__fc_FILE_data FROM param0; param1; S___fc_stdout[0]; "cast:%d formule:%d\n"[bits 0 to 159] (and SELF) \result FROM param0; param1; S___fc_stdout[0]; "cast:%d formule:%d\n"[bits 0 to 159] [from] Function printf_va_3: S___fc_stdout[0].__fc_FILE_data FROM param0; S___fc_stdout[0]; "usc: %ud"[bits 0 to 71] (and SELF) \result FROM param0; S___fc_stdout[0]; "usc: %ud"[bits 0 to 71] [from] Function main2: S___fc_stdout[0].__fc_FILE_data FROM S___fc_stdout[0]; "cast:%d formule:%d\n"[bits 0 to 159]; "usc: %ud"[bits 0 to 71] (and SELF) [from] Function main: G FROM \nothing H FROM \nothing K FROM \nothing L FROM \nothing I FROM \nothing c FROM \nothing d FROM \nothing e FROM \nothing uc FROM \nothing ull FROM \nothing S___fc_stdout[0].__fc_FILE_data FROM S___fc_stdout[0]; "%ud\n"[bits 0 to 39]; "cast:%d formule:%d\n"[bits 0 to 159]; "usc: %ud"[bits 0 to 71] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function any_int_4: i_0; __retres [inout] Inputs for function any_int_4: \nothing [inout] Out (internal) for function main1: G; H; K; L; I; c; d; e; uc; ull; S___fc_stdout[0].__fc_FILE_data [inout] Inputs for function main1: G; H; K; L; I; c; S___fc_stdout[0]; "%ud\n"[bits 0 to 39] [inout] Out (internal) for function main2: min; max; i_0; G_0; S___fc_stdout[0].__fc_FILE_data [inout] Inputs for function main2: S___fc_stdout[0]; "cast:%d formule:%d\n"[bits 0 to 159]; "usc: %ud"[bits 0 to 71] [inout] Out (internal) for function main: G; H; K; L; I; c; d; e; uc; ull; S___fc_stdout[0].__fc_FILE_data [inout] Inputs for function main: G; H; K; L; I; c; S___fc_stdout[0]; "%ud\n"[bits 0 to 39]; "cast:%d formule:%d\n"[bits 0 to 159]; "usc: %ud"[bits 0 to 71] frama-c-20.0-Calcium/tests/value/oracle/cast1.res.oracle0000666000000000000000000000221313571573400017726 0ustar [kernel] Parsing tests/value/cast1.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization si ∈ {0} i ∈ {0} S[0] ∈ {1} [1..4] ∈ {0} I[0] ∈ {1} [1..4] ∈ {0} [eva] tests/value/cast1.i:7: starting to merge loop iterations [eva] tests/value/cast1.i:8: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: si ∈ {2} i ∈ {2} S[0] ∈ {1; 2} [1..4] ∈ {0} I[0] ∈ {1; 2} [1] ∈ {0; 2} [2..4] ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: si FROM \nothing i FROM \nothing S[0] FROM i (and SELF) I[0..1] FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: si; i; S[0]; I[0..1] [inout] Inputs for function main: si; i frama-c-20.0-Calcium/tests/value/oracle/cast2.res.oracle0000666000000000000000000000503013571573400017727 0ustar [kernel] Parsing tests/value/cast2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {255} [eva] computing for function g <- main. Called from tests/value/cast2.i:28. [eva] computing for function any_int <- g <- main. Called from tests/value/cast2.i:7. [eva] using specification for function any_int [eva] Done for function any_int [eva:alarm] tests/value/cast2.i:9: Warning: signed overflow. assert t + 1 ≤ 2147483647; [eva] Recording results for g [eva] Done for function g [eva] computing for function h <- main. Called from tests/value/cast2.i:29. [eva] Recording results for h [eva] Done for function h [eva] computing for function passcast <- main. Called from tests/value/cast2.i:30. [eva] computing for function any_int <- passcast <- main. Called from tests/value/cast2.i:20. [eva] Done for function any_int [eva] tests/value/cast2.i:23: Frama_C_show_each: [-128..100] [eva] Recording results for passcast [eva] Done for function passcast [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: t ∈ [-2147483647..2147483647] G_0 ∈ [--..--] [eva:final-states] Values at end of function h: G ∈ {1} [eva:final-states] Values at end of function passcast: i ∈ [-128..100] [eva:final-states] Values at end of function main: G ∈ {1} [from] Computing for function g [from] Computing for function any_int <-g [from] Done for function any_int [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function passcast [from] Done for function passcast [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function any_int: \result FROM \nothing [from] Function g: NO EFFECTS [from] Function h: G FROM \nothing [from] Function passcast: NO EFFECTS [from] Function main: G FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function g: t; G_0 [inout] Inputs for function g: \nothing [inout] Out (internal) for function h: G [inout] Inputs for function h: \nothing [inout] Out (internal) for function passcast: i; tmp [inout] Inputs for function passcast: \nothing [inout] Out (internal) for function main: G [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/cast_axalto.res.oracle0000666000000000000000000000335313571573400021223 0ustar [kernel] Parsing tests/value/cast_axalto.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization my_tab ∈ {0} G[0] ∈ {77} [1] ∈ {88} [2] ∈ {99} [3] ∈ {100} [4..9] ∈ {0} [eva] computing for function f <- main. Called from tests/value/cast_axalto.c:26. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: p ∈ {{ (my_structure *)&G[1] }} G[0] ∈ {77} [1][bits 0 to 7] ∈ {1} [1][bits 8 to 31]# ∈ {88}%32, bits 8 to 31 [2] ∈ {99} [3] ∈ {100} [4] ∈ {99} [5..9] ∈ {0} [eva:final-states] Values at end of function main: my_tab ∈ {{ &G[1] }} G[0] ∈ {77} [1][bits 0 to 7] ∈ {1} [1][bits 8 to 31]# ∈ {88}%32, bits 8 to 31 [2] ∈ {99} [3] ∈ {100} [4] ∈ {99} [5..9] ∈ {0} __retres ∈ {1} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: G{[1][bits 0 to 7]; [4]} FROM my_tab [from] Function main: my_tab FROM \nothing G{[1][bits 0 to 7]; [4]} FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: p; G{[1][bits 0 to 7]; [4]} [inout] Inputs for function f: my_tab [inout] Out (internal) for function main: my_tab; G{[1][bits 0 to 7]; [4]}; __retres [inout] Inputs for function main: my_tab frama-c-20.0-Calcium/tests/value/oracle/cast_fun.res.oracle0000666000000000000000000001756613571573400020536 0ustar [kernel] Parsing tests/value/cast_fun.i (no preprocessing) [kernel:typing:incompatible-types-call] tests/value/cast_fun.i:64: Warning: implicit conversion between incompatible function types: int (*)(void) and int (*)(int ) [kernel:typing:incompatible-types-call] tests/value/cast_fun.i:79: Warning: implicit conversion between incompatible function types: void (*)(int ) and int (*)(int ) [kernel:typing:incompatible-types-call] tests/value/cast_fun.i:94: Warning: implicit conversion between incompatible function types: void (*)(struct s2 ) and void (*)(struct s1 ) [kernel:typing:incompatible-types-call] tests/value/cast_fun.i:99: Warning: implicit conversion between incompatible function types: void (*)(struct s3 ) and void (*)(struct s1 ) [kernel:typing:incompatible-types-call] tests/value/cast_fun.i:125: Warning: implicit conversion between incompatible function types: void (*)() and int (*)(int ) [kernel:typing:incompatible-types-call] tests/value/cast_fun.i:130: Warning: implicit conversion between incompatible function types: void (*)() and int (*)(int ) [kernel:typing:incompatible-pointer-types] tests/value/cast_fun.i:140: Warning: casting function to int * [kernel:typing:incompatible-pointer-types] tests/value/cast_fun.i:141: Warning: casting function from int * [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/value/cast_fun.i:60. [eva] using specification for function f1 [eva] tests/value/cast_fun.i:6: Warning: no 'assigns \result \from ...' clause specified for function f1 [eva] Done for function f1 [eva:alarm] tests/value/cast_fun.i:65: Warning: pointer to function with incompatible type. assert \valid_function(p1); [eva] computing for function f2 <- main. Called from tests/value/cast_fun.i:65. [eva] using specification for function f2 [eva] tests/value/cast_fun.i:8: Warning: no 'assigns \result \from ...' clause specified for function f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/value/cast_fun.i:70. [eva] using specification for function f3 [eva] tests/value/cast_fun.i:10: Warning: no 'assigns \result \from ...' clause specified for function f3 [eva] Done for function f3 [eva] computing for function f3 <- main. Called from tests/value/cast_fun.i:75. [eva] Done for function f3 [eva:alarm] tests/value/cast_fun.i:80: Warning: pointer to function with incompatible type. assert \valid_function(p1); [eva:alarm] tests/value/cast_fun.i:85: Warning: pointer to function with incompatible type. assert \valid_function((void (*)(int ))p4); [eva] computing for function f6 <- main. Called from tests/value/cast_fun.i:90. [eva] using specification for function f6 [eva] Done for function f6 [eva:alarm] tests/value/cast_fun.i:95: Warning: pointer to function with incompatible type. assert \valid_function(p2); [eva:alarm] tests/value/cast_fun.i:100: Warning: pointer to function with incompatible type. assert \valid_function(p2); [eva] computing for function f9 <- main. Called from tests/value/cast_fun.i:105. [eva] using specification for function f9 [eva] Done for function f9 [eva] computing for function f10 <- main. Called from tests/value/cast_fun.i:110. [eva] using specification for function f10 [eva] Done for function f10 [eva] computing for function f10 <- main. Called from tests/value/cast_fun.i:121. [eva] Done for function f10 [eva:alarm] tests/value/cast_fun.i:126: Warning: pointer to function with incompatible type. assert \valid_function(p1); [eva:alarm] tests/value/cast_fun.i:131: Warning: pointer to function with incompatible type. assert \valid_function(p1); [eva] computing for function f1 <- main. Called from tests/value/cast_fun.i:136. [eva] Done for function f1 [eva] computing for function f1 <- main. Called from tests/value/cast_fun.i:142. [eva] Done for function f1 [eva] Recording results for main [from] Computing for function main [from] tests/value/cast_fun.i:60: Warning: variadic call detected. Using only 0 argument(s). [from] tests/value/cast_fun.i:65: Warning: variadic call detected. Using only 0 argument(s). [from] tests/value/cast_fun.i:110: Warning: variadic call detected. Using only 0 argument(s). [from] tests/value/cast_fun.i:121: Warning: variadic call detected. Using only 0 argument(s). [from] tests/value/cast_fun.i:136: Warning: variadic call detected. Using only 0 argument(s). [from] tests/value/cast_fun.i:142: Warning: variadic call detected. Using only 0 argument(s). [from] Done for function main [eva] done for function main [eva] tests/value/cast_fun.i:80: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/cast_fun.i:85: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/cast_fun.i:95: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/cast_fun.i:100: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/cast_fun.i:126: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/cast_fun.i:131: assertion 'Eva,function_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p1 ∈ {{ &f1 ; (int (*)(int ))&f2 ; &f3 }} or UNINITIALIZED p2 ∈ {{ &f6 }} or UNINITIALIZED p3 ∈ {{ &f9 }} or UNINITIALIZED p4 ∈ {{ (void (*)())&f1 ; &f10 }} or UNINITIALIZED p5 ∈ {{ (void (*)(int ))&f3 }} or UNINITIALIZED y ∈ {{ (int *)&f1 }} or UNINITIALIZED x ∈ [--..--] or UNINITIALIZED s ∈ {0} [from] Computing for function main [from] Computing for function f1 <-main [from] Done for function f1 [from] Computing for function f2 <-main [from] Done for function f2 [from] Computing for function f3 <-main [from] Done for function f3 [from] Computing for function f5 <-main [from] Done for function f5 [from] tests/value/cast_fun.i:85: Warning: variadic call detected. Using only 1 argument(s). [from] Computing for function f6 <-main [from] Done for function f6 [from] Computing for function f9 <-main [from] Done for function f9 [from] Computing for function f10 <-main [from] Done for function f10 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: \result FROM ANYTHING(origin:Unknown) [from] Function f10: NO EFFECTS [from] Function f2: \result FROM ANYTHING(origin:Unknown) [from] Function f3: \result FROM ANYTHING(origin:Unknown) [from] Function f6: NO EFFECTS [from] Function f9: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f1 at tests/value/cast_fun.i:60 (by main): \result FROM ANYTHING(origin:Unknown) [from] call to f2 at tests/value/cast_fun.i:65 (by main): \result FROM ANYTHING(origin:Unknown) [from] call to f3 at tests/value/cast_fun.i:70 (by main): \result FROM ANYTHING(origin:Unknown) [from] call to f3 at tests/value/cast_fun.i:75 (by main): \result FROM ANYTHING(origin:Unknown) [from] call to f6 at tests/value/cast_fun.i:90 (by main): NO EFFECTS [from] call to f9 at tests/value/cast_fun.i:105 (by main): NO EFFECTS [from] call to f10 at tests/value/cast_fun.i:110 (by main): NO EFFECTS [from] call to f10 at tests/value/cast_fun.i:121 (by main): NO EFFECTS [from] call to f1 at tests/value/cast_fun.i:136 (by main): \result FROM ANYTHING(origin:Unknown) [from] call to f1 at tests/value/cast_fun.i:142 (by main): \result FROM ANYTHING(origin:Unknown) [from] entry point: NO EFFECTS [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function main: p1; p2; p3; p4; p5; y; x; s; __va_arg0; __va_args[0] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/cast_hetero.res.oracle0000666000000000000000000000241513571573400021217 0ustar [kernel] Parsing tests/value/cast_hetero.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} pt ∈ {0} T[0..9] ∈ {0} [eva] computing for function g <- main. Called from tests/value/cast_hetero.i:16. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: pt ∈ {{ &X }} T[0] ∈ {1} [1..9] ∈ {0} [eva:final-states] Values at end of function main: pt ∈ {{ &X }} T[0] ∈ {1} [1..9] ∈ {0} [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: pt FROM \nothing T[0] FROM X; c [from] Function main: pt FROM \nothing T[0] FROM X [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function g: pt; T[0] [inout] Inputs for function g: X [inout] Out (internal) for function main: pt; T[0] [inout] Inputs for function main: X frama-c-20.0-Calcium/tests/value/oracle/cast_return.0.res.oracle0000666000000000000000000002727213571573400021416 0ustar [kernel] Parsing tests/value/cast_return.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ [--..--] c ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/cast_return.c:63. [eva] computing for function f <- main1 <- main. Called from tests/value/cast_return.c:26. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main1 <- main. Called from tests/value/cast_return.c:27. [eva] Recording results for g [eva] Done for function g [eva:alarm] tests/value/cast_return.c:27: Warning: accessing uninitialized left-value. assert \initialized(&tmp_0); (tmp_0 from g()) [eva] computing for function h <- main1 <- main. Called from tests/value/cast_return.c:31. [eva] Recording results for h [eva] Done for function h [eva:alarm] tests/value/cast_return.c:31: Warning: out of bounds write. assert \valid(*p); [kernel] tests/value/cast_return.c:31: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/cast_return.c:64. [eva] computing for function fl1 <- main2 <- main. Called from tests/value/cast_return.c:50. [eva] Recording results for fl1 [eva] Done for function fl1 [eva:alarm] tests/value/cast_return.c:50: Warning: accessing uninitialized left-value. assert \initialized(&tmp); (tmp from fl1()) [eva] computing for function fl2 <- main2 <- main. Called from tests/value/cast_return.c:51. [eva] Recording results for fl2 [eva] Done for function fl2 [eva:alarm] tests/value/cast_return.c:51: Warning: accessing uninitialized left-value. assert \initialized(&tmp_0); (tmp_0 from fl2()) [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/cast_return.c:65. [eva] computing for function ret_float <- main3 <- main. Called from tests/value/cast_return.c:58. [eva] using specification for function ret_float [eva] Done for function ret_float [eva:alarm] tests/value/cast_return.c:59: Warning: non-finite float value. assert \is_finite(f1); [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] tests/value/cast_return.c:31: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/cast_return.c:50: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function fl1: v[bits 0 to 7] ∈ {1} [bits 8 to 31] ∈ UNINITIALIZED [eva:final-states] Values at end of function fl2: v ∈ {1.} or UNINITIALIZED [eva:final-states] Values at end of function g: x ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function h: __retres ∈ {1} [eva:final-states] Values at end of function main1: [eva:final-states] Values at end of function main2: d1 ∈ UNINITIALIZED d2 ∈ {1.} [eva:final-states] Values at end of function main3: f1 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [eva:final-states] Values at end of function main: [from] Computing for function f [from] Done for function f [from] Computing for function fl1 [from] Done for function fl1 [from] Computing for function fl2 [from] Done for function fl2 [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Computing for function ret_float <-main3 [from] Done for function ret_float [from] Done for function main3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM i [from] Function fl1: \result FROM \nothing [from] Function fl2: \result FROM c [from] Function g: \result FROM c [from] Function h: \result FROM \nothing [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function ret_float: \result FROM \nothing [from] Function main3: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: i [inout] Out (internal) for function fl1: v[bits 0 to 7] [inout] Inputs for function fl1: \nothing [inout] Out (internal) for function fl2: v [inout] Inputs for function fl2: c [inout] Out (internal) for function g: x [inout] Inputs for function g: c [inout] Out (internal) for function h: __retres [inout] Inputs for function h: \nothing [inout] Out (internal) for function main1: f_; tmp; v; tmp_0; x; p; tmp_1 [inout] Inputs for function main1: i; c [inout] Out (internal) for function main2: d1; d2; tmp; tmp_0 [inout] Inputs for function main2: c [inout] Out (internal) for function main3: f1; f2 [inout] Inputs for function main3: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: i; c /* Generated by Frama-C */ extern int i; int f(void) { return i; } int volatile c; int g(void) { int x; if (c) x = 1; return x; } char h(void) { char __retres; __retres = (char)1; return __retres; } void main1(void) { if (c) { int tmp; tmp = f(); float f_ = (float)tmp; } if (c) { int tmp_0; tmp_0 = g(); /*@ assert Eva: initialization: \initialized(&tmp_0); */ long long v = (long long)tmp_0; } if (c) { char tmp_1; int *x = (int *)0; int **p = & x; tmp_1 = h(); /*@ assert Eva: mem_access: \valid(*p); */ *(*p) = (int)tmp_1; } return; } float fl1(void) { float v; *((char *)(& v)) = (char)1; return v; } float fl2(void) { float v; if (c) v = (float)1; return v; } void main2(void) { double d1; double d2; float tmp_0; if (c) { float tmp; tmp = fl1(); /*@ assert Eva: initialization: \initialized(&tmp); */ d1 = (double)tmp; } tmp_0 = fl2(); /*@ assert Eva: initialization: \initialized(&tmp_0); */ d2 = (double)tmp_0; return; } /*@ assigns \result; assigns \result \from \nothing; */ float ret_float(void); void main3(void) { float f1 = ret_float(); /*@ assert Eva: is_nan_or_infinite: \is_finite(f1); */ float f2 = f1 + (float)1; return; } void main(void) { main1(); main2(); main3(); return; } [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ [--..--] c ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/cast_return.c:63. [eva] computing for function f <- main1 <- main. Called from tests/value/cast_return.c:26. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main1 <- main. Called from tests/value/cast_return.c:27. [eva:alarm] tests/value/cast_return.c:17: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for g [eva] Done for function g [eva] computing for function h <- main1 <- main. Called from tests/value/cast_return.c:31. [eva] Recording results for h [eva] Done for function h [eva:alarm] tests/value/cast_return.c:31: Warning: out of bounds write. assert \valid(*p); [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/cast_return.c:64. [eva] computing for function fl1 <- main2 <- main. Called from tests/value/cast_return.c:50. [eva:alarm] tests/value/cast_return.c:38: Warning: accessing uninitialized left-value. assert \initialized(&v); [eva] Recording results for fl1 [eva] Done for function fl1 [eva] computing for function fl2 <- main2 <- main. Called from tests/value/cast_return.c:51. [eva:alarm] tests/value/cast_return.c:44: Warning: accessing uninitialized left-value. assert \initialized(&v); [eva] Recording results for fl2 [eva] Done for function fl2 [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/cast_return.c:65. [eva] computing for function ret_float <- main3 <- main. Called from tests/value/cast_return.c:58. [eva] Done for function ret_float [eva:alarm] tests/value/cast_return.c:59: Warning: non-finite float value. assert \is_finite(f1); [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] tests/value/cast_return.c:38: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function fl1: v[bits 0 to 7] ∈ {1} [bits 8 to 31] ∈ UNINITIALIZED [eva:final-states] Values at end of function fl2: v ∈ {1.} or UNINITIALIZED [eva:final-states] Values at end of function g: x ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function h: __retres ∈ {1} [eva:final-states] Values at end of function main1: [eva:final-states] Values at end of function main2: d2 ∈ {1.} [eva:final-states] Values at end of function main3: f1 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [eva:final-states] Values at end of function main: [from] Computing for function f [from] Done for function f [from] Computing for function fl1 [from] Done for function fl1 [from] Computing for function fl2 [from] Done for function fl2 [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Computing for function ret_float <-main3 [from] Done for function ret_float [from] Done for function main3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM i [from] Function fl1: \result FROM \nothing [from] Function fl2: \result FROM c [from] Function g: \result FROM c [from] Function h: \result FROM \nothing [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function ret_float: \result FROM \nothing [from] Function main3: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: i [inout] Out (internal) for function fl1: v[bits 0 to 7] [inout] Inputs for function fl1: \nothing [inout] Out (internal) for function fl2: v [inout] Inputs for function fl2: c [inout] Out (internal) for function g: x [inout] Inputs for function g: c [inout] Out (internal) for function h: __retres [inout] Inputs for function h: \nothing [inout] Out (internal) for function main1: f_; tmp; v; tmp_0; x; p; tmp_1 [inout] Inputs for function main1: i; c [inout] Out (internal) for function main2: d2; tmp; tmp_0 [inout] Inputs for function main2: c [inout] Out (internal) for function main3: f1; f2 [inout] Inputs for function main3: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: i; c frama-c-20.0-Calcium/tests/value/oracle/cast_return.1.res.oracle0000666000000000000000000001545213571573400021414 0ustar [kernel] Parsing tests/value/cast_return.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ [--..--] c ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/cast_return.c:63. [eva] computing for function f <- main1 <- main. Called from tests/value/cast_return.c:26. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main1 <- main. Called from tests/value/cast_return.c:27. [eva] Recording results for g [eva] Done for function g [eva:alarm] tests/value/cast_return.c:27: Warning: accessing uninitialized left-value. assert \initialized(&tmp_0); (tmp_0 from g()) [eva] computing for function h <- main1 <- main. Called from tests/value/cast_return.c:31. [eva] Recording results for h [eva] Done for function h [eva:alarm] tests/value/cast_return.c:31: Warning: out of bounds write. assert \valid(*p); [kernel] tests/value/cast_return.c:31: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/cast_return.c:64. [eva] computing for function fl1 <- main2 <- main. Called from tests/value/cast_return.c:50. [eva] Recording results for fl1 [eva] Done for function fl1 [eva:alarm] tests/value/cast_return.c:50: Warning: accessing uninitialized left-value. assert \initialized(&tmp); (tmp from fl1()) [eva] computing for function fl2 <- main2 <- main. Called from tests/value/cast_return.c:51. [eva] Recording results for fl2 [eva] Done for function fl2 [eva:alarm] tests/value/cast_return.c:51: Warning: accessing uninitialized left-value. assert \initialized(&tmp_0); (tmp_0 from fl2()) [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/cast_return.c:65. [eva] computing for function ret_float <- main3 <- main. Called from tests/value/cast_return.c:58. [eva] using specification for function ret_float [eva] Done for function ret_float [eva:alarm] tests/value/cast_return.c:58: Warning: non-finite float value. assert \is_finite(tmp); (tmp from ret_float()) [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] tests/value/cast_return.c:31: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/cast_return.c:50: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function fl1: v[bits 0 to 7] ∈ {1} [bits 8 to 31] ∈ UNINITIALIZED [eva:final-states] Values at end of function fl2: v ∈ {1.} or UNINITIALIZED [eva:final-states] Values at end of function g: x ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function h: __retres ∈ {1} [eva:final-states] Values at end of function main1: [eva:final-states] Values at end of function main2: d1 ∈ UNINITIALIZED d2 ∈ {1.} [eva:final-states] Values at end of function main3: f1 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] [eva:final-states] Values at end of function main: [from] Computing for function f [from] Done for function f [from] Computing for function fl1 [from] Done for function fl1 [from] Computing for function fl2 [from] Done for function fl2 [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Computing for function ret_float <-main3 [from] Done for function ret_float [from] Done for function main3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM i [from] Function fl1: \result FROM \nothing [from] Function fl2: \result FROM c [from] Function g: \result FROM c [from] Function h: \result FROM \nothing [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function ret_float: \result FROM \nothing [from] Function main3: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: i [inout] Out (internal) for function fl1: v[bits 0 to 7] [inout] Inputs for function fl1: \nothing [inout] Out (internal) for function fl2: v [inout] Inputs for function fl2: c [inout] Out (internal) for function g: x [inout] Inputs for function g: c [inout] Out (internal) for function h: __retres [inout] Inputs for function h: \nothing [inout] Out (internal) for function main1: f_; tmp; v; tmp_0; x; p; tmp_1 [inout] Inputs for function main1: i; c [inout] Out (internal) for function main2: d1; d2; tmp; tmp_0 [inout] Inputs for function main2: c [inout] Out (internal) for function main3: f1; tmp; f2 [inout] Inputs for function main3: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: i; c /* Generated by Frama-C */ extern int i; int f(void) { return i; } int volatile c; int g(void) { int x; if (c) x = 1; return x; } char h(void) { char __retres; __retres = (char)1; return __retres; } void main1(void) { if (c) { int tmp; tmp = f(); float f_ = (float)tmp; } if (c) { int tmp_0; tmp_0 = g(); /*@ assert Eva: initialization: \initialized(&tmp_0); */ long long v = (long long)tmp_0; } if (c) { char tmp_1; int *x = (int *)0; int **p = & x; tmp_1 = h(); /*@ assert Eva: mem_access: \valid(*p); */ *(*p) = (int)tmp_1; } return; } float fl1(void) { float v; *((char *)(& v)) = (char)1; return v; } float fl2(void) { float v; if (c) v = (float)1; return v; } void main2(void) { double d1; double d2; float tmp_0; if (c) { float tmp; tmp = fl1(); /*@ assert Eva: initialization: \initialized(&tmp); */ d1 = (double)tmp; } tmp_0 = fl2(); /*@ assert Eva: initialization: \initialized(&tmp_0); */ d2 = (double)tmp_0; return; } /*@ assigns \result; assigns \result \from \nothing; */ float ret_float(void); void main3(void) { float tmp; tmp = ret_float(); /*@ assert Eva: is_nan_or_infinite: \is_finite(tmp); */ float f1 = tmp; float f2 = f1 + (float)1; return; } void main(void) { main1(); main2(); main3(); return; } frama-c-20.0-Calcium/tests/value/oracle/cert_exp35_c.res.oracle0000666000000000000000000000462613571573400021210 0ustar [kernel] Parsing tests/value/cert_exp35_c.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization __fc_stdout ∈ {{ NULL ; &S___fc_stdout[0] }} S___fc_stdout[0..1] ∈ [--..--] [eva] computing for function addressee <- main. Called from tests/value/cert_exp35_c.i:24. [eva] Recording results for addressee [eva] Done for function addressee [eva] computing for function printf_va_1 <- main. Called from tests/value/cert_exp35_c.i:24. [eva] using specification for function printf_va_1 [eva:alarm] tests/value/cert_exp35_c.i:24: Warning: function printf_va_1: precondition valid_read_string(format) got status unknown. [eva:alarm] tests/value/cert_exp35_c.i:24: Warning: function printf_va_1: precondition valid_read_string(param0) got status unknown. [eva] Done for function printf_va_1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function addressee: result.a[0] ∈ {119} .a[1] ∈ {111} .a[2] ∈ {114} .a[3] ∈ {108} .a[4] ∈ {100} .a[5] ∈ {0} [eva:final-states] Values at end of function main: __retres ∈ {0} S___fc_stdout[0..1] ∈ [--..--] [from] Computing for function addressee [from] Done for function addressee [from] Computing for function main [from] Computing for function printf_va_1 <-main [from] Done for function printf_va_1 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function addressee: \result FROM \nothing [from] Function printf_va_1: S___fc_stdout[0].__fc_FILE_data FROM tmp; S___fc_stdout[0]; "Hello, %s!\n"[bits 0 to 95] (and SELF) \result FROM tmp; S___fc_stdout[0]; "Hello, %s!\n"[bits 0 to 95] [from] Function main: S___fc_stdout[0].__fc_FILE_data FROM S___fc_stdout[0]; "Hello, %s!\n"[bits 0 to 95] (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function addressee: result [inout] Inputs for function addressee: \nothing [inout] Out (internal) for function main: tmp; __retres; S___fc_stdout[0].__fc_FILE_data [inout] Inputs for function main: S___fc_stdout[0]; "Hello, %s!\n"[bits 0 to 95] frama-c-20.0-Calcium/tests/value/oracle/changeret.res.oracle0000666000000000000000000000524113571573400020657 0ustar [kernel] Parsing tests/value/changeret.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} p ∈ {0} v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/changeret.i:31. [eva] computing for function f <- main1 <- main. Called from tests/value/changeret.i:15. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/changeret.i:32. [eva] computing for function g <- main2 <- main. Called from tests/value/changeret.i:27. [eva:alarm] tests/value/changeret.i:19: Warning: out of bounds read. assert \valid_read(p); [eva] Recording results for g [eva] Done for function g [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: p ∈ {{ &y }} __retres ∈ {1} [eva:final-states] Values at end of function g: z ∈ {1} __retres ∈ {1} [eva:final-states] Values at end of function main1: x ∈ {0} p ∈ {{ &y }} [eva:final-states] Values at end of function main2: y ∈ {1} p ∈ {{ &y }} [eva:final-states] Values at end of function main: x ∈ {0} y ∈ {1} p ∈ {{ &y }} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: p FROM \nothing \result FROM \nothing [from] Function g: \result FROM \nothing [from] Function main1: x FROM \nothing p FROM \nothing [from] Function main2: y FROM v p FROM v [from] Function main: x FROM \nothing y FROM v p FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: p; __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: z; __retres [inout] Inputs for function g: y; p [inout] Out (internal) for function main1: x; p [inout] Inputs for function main1: p [inout] Out (internal) for function main2: y; p [inout] Inputs for function main2: y; p; v [inout] Out (internal) for function main: x; y; p [inout] Inputs for function main: y; p; v frama-c-20.0-Calcium/tests/value/oracle/cmp.res.oracle0000666000000000000000000000313613571573400017477 0ustar [kernel] Parsing tests/value/cmp.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/cmp.i:10: Warning: accessing out of bounds index. assert 0 ≤ d; [eva:alarm] tests/value/cmp.i:10: Warning: accessing out of bounds index. assert d < 10; [eva] computing for function cmp <- main. Called from tests/value/cmp.i:11. [eva:alarm] tests/value/cmp.i:4: Warning: accessing uninitialized left-value. assert \initialized(s1); [eva:alarm] tests/value/cmp.i:4: Warning: out of bounds read. assert \valid_read(s1); [eva] Recording results for cmp [eva] Done for function cmp [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function cmp: __retres ∈ {1} [eva:final-states] Values at end of function main: T[0..9] ∈ [--..--] or UNINITIALIZED r ∈ {1} [from] Computing for function cmp [from] Done for function cmp [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function cmp: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function cmp: __retres [inout] Inputs for function cmp: T[0..9]; "V1.2"[bits 0 to 7] [inout] Out (internal) for function main: T[0..9]; r [inout] Inputs for function main: "V1.2"[bits 0 to 7] frama-c-20.0-Calcium/tests/value/oracle/cmp_ptr.0.res.oracle0000666000000000000000000000716013571573400020523 0ustar [kernel] Parsing tests/value/cmp_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} T[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} C[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} q ∈ {0} top_p ∈ [--..--] top_q ∈ [--..--] x ∈ {0} y ∈ {0} z ∈ {0} t ∈ {0} r ∈ {0} ff ∈ {0} [eva:pointer-comparison] tests/value/cmp_ptr.i:21: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr.i:21: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)(&T[5])); [eva:alarm] tests/value/cmp_ptr.i:21: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/value/cmp_ptr.i:21: Warning: out of bounds write. assert \valid(q); [eva:pointer-comparison] tests/value/cmp_ptr.i:22: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr.i:22: Warning: pointer comparison. assert \pointer_comparable((void *)0, (void *)(&y + 2)); [eva:pointer-comparison] tests/value/cmp_ptr.i:24: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr.i:24: Warning: non-finite float value. assert \is_finite(ff); [eva:pointer-comparison] tests/value/cmp_ptr.i:28: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr.i:28: Warning: signed overflow. assert -2147483648 ≤ 1 + (int)tmp_0; (tmp_0 from u?& f:& g) [eva:alarm] tests/value/cmp_ptr.i:28: Warning: signed overflow. assert 1 + (int)tmp_0 ≤ 2147483647; (tmp_0 from u?& f:& g) [eva:pointer-comparison] tests/value/cmp_ptr.i:30: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr.i:30: Warning: pointer comparison. assert \pointer_comparable((void *)((int *)T - 1), (void *)0); [eva:pointer-comparison] tests/value/cmp_ptr.i:32: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr.i:32: Warning: pointer comparison. assert \pointer_comparable((void (*)())0, (void (*)())(&f + 3)); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &T + [-8589934588..36],0%4 }} T[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5; 88} [6] ∈ {6; 88} [7] ∈ {7; 88} [8] ∈ {8; 88} [9] ∈ {9; 88} C[0] ∈ {0; 77} [1] ∈ {1; 77} [2] ∈ {2; 77} [3] ∈ {3; 77} [4] ∈ {4; 77} [5] ∈ {5; 77} [6] ∈ {6; 77} [7] ∈ {7; 77} [8] ∈ {8; 77} [9] ∈ {9; 77} q ∈ {{ &C + [-2147483647..2147483648] }} x ∈ {0} y ∈ {0; 1} z ∈ {0} t ∈ {0; 1} r ∈ {0} ff ∈ {{ &y + {8} }} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM top_p T[5..9] FROM top_p (and SELF) C[0..9] FROM top_p; top_q (and SELF) q FROM top_q x FROM \nothing y FROM \nothing z FROM u t FROM u r FROM \nothing ff FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; T[5..9]; C[0..9]; q; x; y; z; t; r; ff; tmp; tmp_0; __retres [inout] Inputs for function main: p; q; top_p; top_q; ff frama-c-20.0-Calcium/tests/value/oracle/cmp_ptr.1.res.oracle0000666000000000000000000001160513571573400020523 0ustar [kernel] Parsing tests/value/cmp_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} T[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} C[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} q ∈ {0} top_p ∈ [--..--] top_q ∈ [--..--] x ∈ {0} y ∈ {0} z ∈ {0} t ∈ {0} r ∈ {0} ff ∈ {0} [eva:pointer-comparison] tests/value/cmp_ptr.i:21: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/cmp_ptr.i:21: evaluating condition to {0; 1} instead of {0; 1} because of UPCPA [eva:pointer-comparison] tests/value/cmp_ptr.i:21: not reducing {{ &T + [-8589934588..8589934592],0%4 }} to {{ &T + [20..8589934592],0%4 }} because of UPCPA [eva:pointer-comparison] tests/value/cmp_ptr.i:21: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva:pointer-comparison] tests/value/cmp_ptr.i:21: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva:alarm] tests/value/cmp_ptr.i:21: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)(&T[5])); [eva:alarm] tests/value/cmp_ptr.i:21: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/value/cmp_ptr.i:21: Warning: out of bounds write. assert \valid(q); [eva:pointer-comparison] tests/value/cmp_ptr.i:21: not reducing {{ &T + [-8589934588..8589934592],0%4 }} to {{ &T + [-8589934588..16],0%4 }} because of UPCPA [eva:pointer-comparison] tests/value/cmp_ptr.i:22: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/cmp_ptr.i:22: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva:alarm] tests/value/cmp_ptr.i:22: Warning: pointer comparison. assert \pointer_comparable((void *)0, (void *)(&y + 2)); [eva:pointer-comparison] tests/value/cmp_ptr.i:24: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr.i:24: Warning: non-finite float value. assert \is_finite(ff); [eva:pointer-comparison] tests/value/cmp_ptr.i:28: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr.i:28: Warning: signed overflow. assert -2147483648 ≤ 1 + (int)tmp_0; (tmp_0 from u?& f:& g) [eva:alarm] tests/value/cmp_ptr.i:28: Warning: signed overflow. assert 1 + (int)tmp_0 ≤ 2147483647; (tmp_0 from u?& f:& g) [eva:pointer-comparison] tests/value/cmp_ptr.i:30: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/cmp_ptr.i:30: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva:alarm] tests/value/cmp_ptr.i:30: Warning: pointer comparison. assert \pointer_comparable((void *)((int *)T - 1), (void *)0); [eva:pointer-comparison] tests/value/cmp_ptr.i:32: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/cmp_ptr.i:32: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva:alarm] tests/value/cmp_ptr.i:32: Warning: pointer comparison. assert \pointer_comparable((void (*)())0, (void (*)())(&f + 3)); [eva:pointer-comparison] tests/value/cmp_ptr.i:32: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &T + [-8589934588..8589934592],0%4 }} T[0] ∈ {0; 88} [1] ∈ {1; 88} [2] ∈ {2; 88} [3] ∈ {3; 88} [4] ∈ {4; 88} [5] ∈ {5; 88} [6] ∈ {6; 88} [7] ∈ {7; 88} [8] ∈ {8; 88} [9] ∈ {9; 88} C[0] ∈ {0; 77} [1] ∈ {1; 77} [2] ∈ {2; 77} [3] ∈ {3; 77} [4] ∈ {4; 77} [5] ∈ {5; 77} [6] ∈ {6; 77} [7] ∈ {7; 77} [8] ∈ {8; 77} [9] ∈ {9; 77} q ∈ {{ &C + [-2147483647..2147483648] }} x ∈ {0; 1} y ∈ {0; 1} z ∈ {0} t ∈ {0; 1} r ∈ {0; 1} ff ∈ {{ &y + {8} }} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM top_p T[0..9] FROM top_p (and SELF) C[0..9] FROM top_p; top_q (and SELF) q FROM top_q x FROM \nothing y FROM \nothing z FROM u t FROM u r FROM \nothing ff FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; T[0..9]; C[0..9]; q; x; y; z; t; r; ff; tmp; tmp_0; __retres [inout] Inputs for function main: p; q; top_p; top_q; ff frama-c-20.0-Calcium/tests/value/oracle/cmp_ptr_follow_all_branches.0.res.oracle0000666000000000000000000000305013571573400024574 0ustar [kernel] Parsing tests/value/cmp_ptr_follow_all_branches.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} p ∈ {{ (char *)&a }} q ∈ {{ &a }} [eva:pointer-comparison] tests/value/cmp_ptr_follow_all_branches.i:14: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr_follow_all_branches.i:14: Warning: pointer comparison. assert \pointer_comparable((void *)(p + (unsigned int)((int)(-5))), (void *)p); [eva] tests/value/cmp_ptr_follow_all_branches.i:14: Frama_C_show_each_2: [eva:pointer-comparison] tests/value/cmp_ptr_follow_all_branches.i:15: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/cmp_ptr_follow_all_branches.i:15: Warning: pointer comparison. assert \pointer_comparable((void *)(q + (unsigned int)((int)(-5))), (void *)q); [eva] tests/value/cmp_ptr_follow_all_branches.i:15: Frama_C_show_each_4: [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres [inout] Inputs for function main: p; q frama-c-20.0-Calcium/tests/value/oracle/cmp_ptr_follow_all_branches.1.res.oracle0000666000000000000000000000433613571573400024605 0ustar [kernel] Parsing tests/value/cmp_ptr_follow_all_branches.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} p ∈ {{ (char *)&a }} q ∈ {{ &a }} [eva:pointer-comparison] tests/value/cmp_ptr_follow_all_branches.i:14: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/cmp_ptr_follow_all_branches.i:14: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva:alarm] tests/value/cmp_ptr_follow_all_branches.i:14: Warning: pointer comparison. assert \pointer_comparable((void *)(p + (unsigned int)((int)(-5))), (void *)p); [eva] tests/value/cmp_ptr_follow_all_branches.i:14: Frama_C_show_each_1: [eva:pointer-comparison] tests/value/cmp_ptr_follow_all_branches.i:14: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva] tests/value/cmp_ptr_follow_all_branches.i:14: Frama_C_show_each_2: [eva:pointer-comparison] tests/value/cmp_ptr_follow_all_branches.i:15: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/cmp_ptr_follow_all_branches.i:15: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva:alarm] tests/value/cmp_ptr_follow_all_branches.i:15: Warning: pointer comparison. assert \pointer_comparable((void *)(q + (unsigned int)((int)(-5))), (void *)q); [eva] tests/value/cmp_ptr_follow_all_branches.i:15: Frama_C_show_each_3: [eva:pointer-comparison] tests/value/cmp_ptr_follow_all_branches.i:15: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva] tests/value/cmp_ptr_follow_all_branches.i:15: Frama_C_show_each_4: [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres [inout] Inputs for function main: p; q frama-c-20.0-Calcium/tests/value/oracle/cond.res.oracle0000666000000000000000000000664713571573400017655 0ustar [kernel] Parsing tests/value/cond.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/value/cond.i:34: Warning: Calling undeclared function unknf. Old style K&R code? [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} x ∈ {0} y ∈ {0} i ∈ {0} t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} p ∈ {0} z ∈ {0} R ∈ {0} U[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [10] ∈ {10} [11] ∈ {11} [12] ∈ {0} [eva:alarm] tests/value/cond.i:14: Warning: out of bounds read. assert \valid_read(argv); [eva:alarm] tests/value/cond.i:14: Warning: out of bounds read. assert \valid_read(*argv); [eva] computing for function f <- main. Called from tests/value/cond.i:20. [eva] Recording results for f [eva] Done for function f [eva] computing for function unknf <- main. Called from tests/value/cond.i:34. [kernel:annot:missing-spec] tests/value/cond.i:34: Warning: Neither code nor specification for function unknf, generating default assigns from the prototype [eva] using specification for function unknf [eva] Done for function unknf [eva] tests/value/cond.i:37: Frama_C_show_each_2: {0; 1; 2; 4; 5; 6; 7; 8} [eva] tests/value/cond.i:38: Frama_C_show_each_3: [0..8] [eva] tests/value/cond.i:42: Frama_C_show_each_4: [0..16],0%2 [eva] tests/value/cond.i:43: Frama_C_show_each_5: [0..16],0%2 [eva] tests/value/cond.i:45: Frama_C_show_each_6: {0; 2; 4; 6; 8; 12; 14; 16} [eva] tests/value/cond.i:46: Frama_C_show_each_7: [0..16],0%2 [eva] computing for function unknf <- main. Called from tests/value/cond.i:48. [eva] Done for function unknf [eva:alarm] tests/value/cond.i:49: Warning: accessing out of bounds index. assert w < 13; [eva] tests/value/cond.i:52: Frama_C_show_each_w: [1..11] [eva] tests/value/cond.i:53: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function main: x ∈ [-128..0] y ∈ [-10..32767] i ∈ {1; 2; 3; 4; 5; 6; 7} p ∈ {{ &t }} z ∈ {0; 2} R ∈ {0; 3} r ∈ {-51} inRet ∈ {-51} c ∈ [--..--] s ∈ [--..--] u ∈ [0..8] v ∈ [0..16],0%2 w ∈ [0..12] [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Computing for function unknf <-main [from] Done for function unknf [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM G [from] Function unknf: \result FROM \nothing [from] Function main: x FROM argv; S_argv[0]; S_0_S_argv[0] (and SELF) y FROM argc (and SELF) i FROM argc p FROM \nothing z FROM t[1..3]; argc (and SELF) R FROM t[1..7]; argc (and SELF) \result FROM G [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: tmp [inout] Inputs for function f: G [inout] Out (internal) for function main: x; y; i; p; z; R; r; inRet; c; s; tmp; tmp_0; u; tmp_1; v; w; tmp_2 [inout] Inputs for function main: G; i; t[1..7]; p; U[0..12]; S_argv[0]; S_0_S_argv[0] frama-c-20.0-Calcium/tests/value/oracle/cond2.0.res.oracle0000666000000000000000000000305013571573400020056 0ustar [kernel] Parsing tests/value/cond2.i (no preprocessing) [eva] Analyzing a complete application starting at zero_ou_un_0 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Gx ∈ [--..--] Gy ∈ [--..--] px ∈ {0} py ∈ {0} x ∈ {0} y ∈ {0} T[0..99] ∈ {0} r ∈ {0} s ∈ {0} t ∈ {0} u ∈ {0} [eva] tests/value/cond2.i:26: starting to merge loop iterations [eva:alarm] tests/value/cond2.i:26: Warning: signed overflow. assert x + 2 ≤ 2147483647; [eva] tests/value/cond2.i:27: starting to merge loop iterations [eva:alarm] tests/value/cond2.i:27: Warning: signed overflow. assert y + 5 ≤ 2147483647; [eva] Recording results for zero_ou_un_0 [eva] done for function zero_ou_un_0 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function zero_ou_un_0: x ∈ {0; 2} y ∈ {1; 2} r ∈ {0; 1} s ∈ {0; 1} t ∈ {0; 1} u ∈ {1} i ∈ [0..2147483647] [from] Computing for function zero_ou_un_0 [from] Done for function zero_ou_un_0 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function zero_ou_un_0: x FROM Gx y FROM Gy r FROM Gx (and SELF) s FROM Gx; Gy (and SELF) t FROM Gx; Gy (and SELF) u FROM Gx [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function zero_ou_un_0: x; y; r; s; t; u; i [inout] Out (external) for function zero_ou_un_0: x; y; r; s; t; u [inout] Inputs for function zero_ou_un_0: Gx; Gy; x; y frama-c-20.0-Calcium/tests/value/oracle/cond2.1.res.oracle0000666000000000000000000001063213571573400020063 0ustar [kernel] Parsing tests/value/cond2.i (no preprocessing) [eva] Analyzing a complete application starting at un_1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Gx ∈ [--..--] Gy ∈ [--..--] px ∈ {0} py ∈ {0} x ∈ {0} y ∈ {0} T[0..99] ∈ {0} r ∈ {0} s ∈ {0} t ∈ {0} u ∈ {0} [eva] tests/value/cond2.i:52: starting to merge loop iterations [eva:alarm] tests/value/cond2.i:52: Warning: signed overflow. assert x + 2 ≤ 2147483647; [eva] tests/value/cond2.i:53: starting to merge loop iterations [eva:alarm] tests/value/cond2.i:53: Warning: signed overflow. assert y + 2 ≤ 2147483647; [eva] tests/value/cond2.i:59: starting to merge loop iterations [eva:alarm] tests/value/cond2.i:59: Warning: signed overflow. assert x + 4 ≤ 2147483647; [eva] tests/value/cond2.i:60: starting to merge loop iterations [eva:alarm] tests/value/cond2.i:60: Warning: signed overflow. assert y + 4 ≤ 2147483647; [eva] tests/value/cond2.i:66: starting to merge loop iterations [eva:alarm] tests/value/cond2.i:66: Warning: out of bounds write. assert \valid(px); [eva] tests/value/cond2.i:67: starting to merge loop iterations [eva:alarm] tests/value/cond2.i:67: Warning: out of bounds write. assert \valid(py); [eva] Recording results for un_1 [eva] done for function un_1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function un_1: px ∈ {{ &T + [0..384],0%16 }} py ∈ {{ &T + [4..388],4%16 }} x ∈ [0..2147483646],0%2 y ∈ [1..2147483647],1%2 T[0..3] ∈ {0} [4] ∈ {0; 1} [5] ∈ {0; 2} [6..7] ∈ {0} [8] ∈ {0; 1} [9] ∈ {0; 2} [10..11] ∈ {0} [12] ∈ {0; 1} [13] ∈ {0; 2} [14..15] ∈ {0} [16] ∈ {0; 1} [17] ∈ {0; 2} [18..19] ∈ {0} [20] ∈ {0; 1} [21] ∈ {0; 2} [22..23] ∈ {0} [24] ∈ {0; 1} [25] ∈ {0; 2} [26..27] ∈ {0} [28] ∈ {0; 1} [29] ∈ {0; 2} [30..31] ∈ {0} [32] ∈ {0; 1} [33] ∈ {0; 2} [34..35] ∈ {0} [36] ∈ {0; 1} [37] ∈ {0; 2} [38..39] ∈ {0} [40] ∈ {0; 1} [41] ∈ {0; 2} [42..43] ∈ {0} [44] ∈ {0; 1} [45] ∈ {0; 2} [46..47] ∈ {0} [48] ∈ {0; 1} [49] ∈ {0; 2} [50..51] ∈ {0} [52] ∈ {0; 1} [53] ∈ {0; 2} [54..55] ∈ {0} [56] ∈ {0; 1} [57] ∈ {0; 2} [58..59] ∈ {0} [60] ∈ {0; 1} [61] ∈ {0; 2} [62..63] ∈ {0} [64] ∈ {0; 1} [65] ∈ {0; 2} [66..67] ∈ {0} [68] ∈ {0; 1} [69] ∈ {0; 2} [70..71] ∈ {0} [72] ∈ {0; 1} [73] ∈ {0; 2} [74..75] ∈ {0} [76] ∈ {0; 1} [77] ∈ {0; 2} [78..79] ∈ {0} [80] ∈ {0; 1} [81] ∈ {0; 2} [82..83] ∈ {0} [84] ∈ {0; 1} [85] ∈ {0; 2} [86..87] ∈ {0} [88] ∈ {0; 1} [89] ∈ {0; 2} [90..91] ∈ {0} [92] ∈ {0; 1} [93] ∈ {0; 2} [94..95] ∈ {0} [96] ∈ {0; 1} [97] ∈ {0; 2} [98..99] ∈ {0} s ∈ {1} t ∈ {1} u ∈ {1} r_0 ∈ {1} i ∈ [0..2147483647] [from] Computing for function un_1 [from] Done for function un_1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function un_1: px FROM Gx py FROM Gy x FROM Gx y FROM Gy T{[4]; [8]; [12]; [16]; [20]; [24]; [28]; [32]; [36]; [40]; [44]; [48]; [52]; [56]; [60]; [64]; [68]; [72]; [76]; [80]; [84]; [88]; [92]; [96]} FROM Gx (and SELF) {[5]; [9]; [13]; [17]; [21]; [25]; [29]; [33]; [37]; [41]; [45]; [49]; [53]; [57]; [61]; [65]; [69]; [73]; [77]; [81]; [85]; [89]; [93]; [97]} FROM Gy (and SELF) s FROM Gx; Gy t FROM Gx; Gy u FROM Gx; Gy \result FROM Gx; Gy [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function un_1: px; py; x; y; T{[4..5]; [8..9]; [12..13]; [16..17]; [20..21]; [24..25]; [28..29]; [32..33]; [36..37]; [40..41]; [44..45]; [48..49]; [52..53]; [56..57]; [60..61]; [64..65]; [68..69]; [72..73]; [76..77]; [80..81]; [84..85]; [88..89]; [92..93]; [96..97]}; s; t; u; r_0; i [inout] Out (external) for function un_1: px; py; x; y; T{[4..5]; [8..9]; [12..13]; [16..17]; [20..21]; [24..25]; [28..29]; [32..33]; [36..37]; [40..41]; [44..45]; [48..49]; [52..53]; [56..57]; [60..61]; [64..65]; [68..69]; [72..73]; [76..77]; [80..81]; [84..85]; [88..89]; [92..93]; [96..97]}; s; t; u [inout] Inputs for function un_1: Gx; Gy; px; py; x; y; u frama-c-20.0-Calcium/tests/value/oracle/cond_integer_cast_of_float.res.oracle0000666000000000000000000002470013571573400024243 0ustar [kernel] Parsing tests/value/cond_integer_cast_of_float.i (no preprocessing) [kernel:parser:decimal-float] tests/value/cond_integer_cast_of_float.i:79: Warning: Floating-point constant 1.17 is not represented exactly. Will use 0x1.2b851eb851eb8p0. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization b ∈ {0} f1 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f3 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f4 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] d1 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] d2 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] i ∈ [--..--] c ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/cond_integer_cast_of_float.i:121. [eva:alarm] tests/value/cond_integer_cast_of_float.i:121: Warning: function main1: precondition got status unknown. [eva] tests/value/cond_integer_cast_of_float.i:17: Frama_C_show_each_float_: [2. .. 8.] [eva] tests/value/cond_integer_cast_of_float.i:20: Frama_C_show_each_float_: [-0. .. 4.99999952316] [eva] tests/value/cond_integer_cast_of_float.i:23: Frama_C_show_each_float_: [1. .. 8.] [eva] tests/value/cond_integer_cast_of_float.i:26: Frama_C_show_each_float_: [3. .. 3.99999976158] [eva] tests/value/cond_integer_cast_of_float.i:29: Frama_C_show_each_double: [2. .. 8.] [eva] tests/value/cond_integer_cast_of_float.i:32: Frama_C_show_each_double: [-0. .. 5.] [eva] tests/value/cond_integer_cast_of_float.i:35: Frama_C_show_each_double: [1. .. 8.] [eva] tests/value/cond_integer_cast_of_float.i:38: Frama_C_show_each_double: [3. .. 4.] [eva] tests/value/cond_integer_cast_of_float.i:73: Frama_C_show_each: [-0. .. 8.], [0..8] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/cond_integer_cast_of_float.i:123. [eva] tests/value/cond_integer_cast_of_float.i:78: Frama_C_dump_each: # Cvalue domain: b ∈ {0} f1 ∈ [1.17000007629 .. 3.40282346639e+38] f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f3 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f4 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] d1 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] d2 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] i ∈ [--..--] c ∈ [--..--] ==END OF DUMP== [eva] tests/value/cond_integer_cast_of_float.i:81: Frama_C_dump_each: # Cvalue domain: b ∈ {0} f1 ∈ [-3.40282346639e+38 .. 1.16999995708] f2 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f3 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] f4 ∈ [-3.40282346639e+38 .. 3.40282346639e+38] d1 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] d2 ∈ [-1.79769313486e+308 .. 1.79769313486e+308] i ∈ [--..--] c ∈ [--..--] ==END OF DUMP== [eva] tests/value/cond_integer_cast_of_float.i:84: Frama_C_show_each_double: [1.16999995708 .. 1.79769313486e+308] [eva] tests/value/cond_integer_cast_of_float.i:88: Frama_C_show_each_double: [1.17 .. 1.79769313486e+308] [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/cond_integer_cast_of_float.i:125. [eva:alarm] tests/value/cond_integer_cast_of_float.i:125: Warning: function main3: precondition 'f4' got status unknown. [eva:alarm] tests/value/cond_integer_cast_of_float.i:125: Warning: function main3: precondition 'd2' got status unknown. [eva:alarm] tests/value/cond_integer_cast_of_float.i:101: Warning: assertion got status unknown. [eva:alarm] tests/value/cond_integer_cast_of_float.i:102: Warning: assertion got status unknown. [eva:alarm] tests/value/cond_integer_cast_of_float.i:103: Warning: assertion got status unknown. [eva:alarm] tests/value/cond_integer_cast_of_float.i:106: Warning: assertion got status unknown. [eva:alarm] tests/value/cond_integer_cast_of_float.i:109: Warning: assertion got status unknown. [eva:alarm] tests/value/cond_integer_cast_of_float.i:112: Warning: assertion got status unknown. [eva:alarm] tests/value/cond_integer_cast_of_float.i:113: Warning: assertion got status unknown. [eva] tests/value/cond_integer_cast_of_float.i:115: Frama_C_dump_each: # Cvalue domain: b ∈ {0} f1 ∈ [10.0000009537 .. 3.40282346639e+38] f2 ∈ [10.0000009537 .. 3.40282346639e+38] f3 ∈ [10.0000009537 .. 3.40282346639e+38] f4 ∈ [-1000. .. 1000.] d1 ∈ [10. .. 1.79769313486e+308] d2 ∈ [-1000. .. 1000.] i ∈ [--..--] c ∈ [--..--] ==END OF DUMP== [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main3 <- main. Called from tests/value/cond_integer_cast_of_float.i:127. [eva:alarm] tests/value/cond_integer_cast_of_float.i:127: Warning: function main3: precondition 'f4' got status unknown. [eva:alarm] tests/value/cond_integer_cast_of_float.i:127: Warning: function main3: precondition 'd2' got status unknown. [eva] tests/value/cond_integer_cast_of_float.i:115: Frama_C_dump_each: # Cvalue domain: b ∈ {0} f1 ∈ [10.0000009537 .. 3.40282346639e+38] f2 ∈ [10.0000009537 .. 3.40282346639e+38] f3 ∈ [10.0000009537 .. 3.40282346639e+38] f4 ∈ [-1000. .. 1000.] d1 ∈ [10. .. 1.79769313486e+308] d2 ∈ [-1000. .. 1000.] i ∈ [--..--] c ∈ [--..--] ==END OF DUMP== [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva] Analyzing a complete application starting at mainbis [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization b ∈ {0} f1 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] f2 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] f3 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] f4 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] d1 ∈ [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] d2 ∈ [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] i ∈ [--..--] c ∈ [--..--] [eva] computing for function main <- mainbis. Called from tests/value/cond_integer_cast_of_float.i:132. [eva] computing for function main1 <- main <- mainbis. Called from tests/value/cond_integer_cast_of_float.i:121. [eva] tests/value/cond_integer_cast_of_float.i:17: Frama_C_show_each_float_: [0x1.0000000000000p1 .. 0x1.0000000000000p3] [eva] tests/value/cond_integer_cast_of_float.i:20: Frama_C_show_each_float_: [-0x0.0000000000000p-1022 .. 0x1.3ffffe0000000p2] [eva] tests/value/cond_integer_cast_of_float.i:23: Frama_C_show_each_float_: [0x1.0000000000000p0 .. 0x1.0000000000000p3] [eva] tests/value/cond_integer_cast_of_float.i:26: Frama_C_show_each_float_: [0x1.8000000000000p1 .. 0x1.fffffe0000000p1] [eva] tests/value/cond_integer_cast_of_float.i:29: Frama_C_show_each_double: [0x1.0000000000000p1 .. 0x1.0000000000000p3] [eva] tests/value/cond_integer_cast_of_float.i:32: Frama_C_show_each_double: [-0x0.0000000000000p-1022 .. 0x1.3ffffffffffffp2] [eva] tests/value/cond_integer_cast_of_float.i:35: Frama_C_show_each_double: [0x1.0000000000000p0 .. 0x1.0000000000000p3] [eva] tests/value/cond_integer_cast_of_float.i:38: Frama_C_show_each_double: [0x1.8000000000000p1 .. 0x1.fffffffffffffp1] [eva] tests/value/cond_integer_cast_of_float.i:73: Frama_C_show_each: [-0x0.0000000000000p-1022 .. 0x1.0000000000000p3], [0..8] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main <- mainbis. Called from tests/value/cond_integer_cast_of_float.i:123. [eva] tests/value/cond_integer_cast_of_float.i:78: Frama_C_dump_each: # Cvalue domain: b ∈ {0} f1 ∈ [0x1.2b85200000000p0 .. 0x1.fffffe0000000p127] f2 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] f3 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] f4 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] d1 ∈ [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] d2 ∈ [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] i ∈ [--..--] c ∈ [--..--] ==END OF DUMP== [eva] tests/value/cond_integer_cast_of_float.i:81: Frama_C_dump_each: # Cvalue domain: b ∈ {0} f1 ∈ [-0x1.fffffe0000000p127 .. 0x1.2b851e0000000p0] f2 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] f3 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] f4 ∈ [-0x1.fffffe0000000p127 .. 0x1.fffffe0000000p127] d1 ∈ [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] d2 ∈ [-0x1.fffffffffffffp1023 .. 0x1.fffffffffffffp1023] i ∈ [--..--] c ∈ [--..--] ==END OF DUMP== [eva] tests/value/cond_integer_cast_of_float.i:84: Frama_C_show_each_double: [0x1.2b851e0000001p0 .. 0x1.fffffffffffffp1023] [eva] tests/value/cond_integer_cast_of_float.i:88: Frama_C_show_each_double: [0x1.2b851eb851eb9p0 .. 0x1.fffffffffffffp1023] [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main <- mainbis. Called from tests/value/cond_integer_cast_of_float.i:125. [eva] tests/value/cond_integer_cast_of_float.i:115: Frama_C_dump_each: # Cvalue domain: b ∈ {0} f1 ∈ [0x1.4000020000000p3 .. 0x1.fffffe0000000p127] f2 ∈ [0x1.4000020000000p3 .. 0x1.fffffe0000000p127] f3 ∈ [0x1.4000020000000p3 .. 0x1.fffffe0000000p127] f4 ∈ [-0x1.f400000000000p9 .. 0x1.f400000000000p9] d1 ∈ [0x1.4000000000001p3 .. 0x1.fffffffffffffp1023] d2 ∈ [-0x1.f400000000000p9 .. 0x1.f400000000000p9] i ∈ [--..--] c ∈ [--..--] ==END OF DUMP== [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main3 <- main <- mainbis. Called from tests/value/cond_integer_cast_of_float.i:127. [eva] tests/value/cond_integer_cast_of_float.i:115: Frama_C_dump_each: # Cvalue domain: b ∈ {0} f1 ∈ [0x1.4000020000000p3 .. 0x1.fffffe0000000p127] f2 ∈ [0x1.4000020000000p3 .. 0x1.fffffe0000000p127] f3 ∈ [0x1.4000020000000p3 .. 0x1.fffffe0000000p127] f4 ∈ [-0x1.f400000000000p9 .. 0x1.f400000000000p9] d1 ∈ [0x1.4000000000001p3 .. 0x1.fffffffffffffp1023] d2 ∈ [-0x1.f400000000000p9 .. 0x1.f400000000000p9] i ∈ [--..--] c ∈ [--..--] ==END OF DUMP== [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] Done for function main [eva] Recording results for mainbis [eva] done for function mainbis [eva] ====== VALUES COMPUTED ====== frama-c-20.0-Calcium/tests/value/oracle/conditional_initializer.res.oracle0000666000000000000000000000140613571573400023624 0ustar [kernel] Parsing tests/value/conditional_initializer.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0] ∈ {2} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/const.res.oracle0000666000000000000000000002620613571573400020051 0ustar [kernel] Parsing tests/value/const.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] I ∈ {2} J ∈ {8} v ∈ [--..--] X ∈ {0} s.i1 ∈ {3} .i2 ∈ {4} t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6..9] ∈ {0} [eva] computing for function const_formal <- main. Called from tests/value/const.i:116. [eva] tests/value/const.i:20: Frama_C_show_each: [-2147483648..2147483647] [eva:alarm] tests/value/const.i:21: Warning: out of bounds write. assert \valid(&i); [kernel] tests/value/const.i:21: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for const_formal [eva] Done for function const_formal [eva] computing for function const_formal <- main. Called from tests/value/const.i:117. [eva] tests/value/const.i:20: Frama_C_show_each: {42} [eva] Recording results for const_formal [eva] Done for function const_formal [eva] computing for function modify_I <- main. Called from tests/value/const.i:118. [eva] tests/value/const.i:37: Frama_C_show_each: {2} [eva] computing for function pointer_to_const <- modify_I <- main. Called from tests/value/const.i:38. [eva] tests/value/const.i:25: Frama_C_show_each: {2} [eva:alarm] tests/value/const.i:26: Warning: out of bounds write. assert \valid(p); [kernel] tests/value/const.i:26: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for pointer_to_const [eva] Done for function pointer_to_const [eva] computing for function const_destination <- modify_I <- main. Called from tests/value/const.i:39. [eva] tests/value/const.i:31: Frama_C_show_each: {2} [eva:alarm] tests/value/const.i:32: Warning: out of bounds write. assert \valid(p); [kernel] tests/value/const.i:32: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for const_destination [eva] Done for function const_destination [eva] Recording results for modify_I [eva] Done for function modify_I [eva] computing for function modify_J <- main. Called from tests/value/const.i:119. [eva] tests/value/const.i:43: Frama_C_show_each: {8} [eva] computing for function pointer_to_const <- modify_J <- main. Called from tests/value/const.i:45. [eva] tests/value/const.i:25: Frama_C_show_each: {8; 9} [eva] tests/value/const.i:27: Frama_C_show_each_dead: [eva] Recording results for pointer_to_const [eva] Done for function pointer_to_const [eva] computing for function const_destination <- modify_J <- main. Called from tests/value/const.i:46. [eva] tests/value/const.i:31: Frama_C_show_each: {0; 8; 9} [eva] tests/value/const.i:33: Frama_C_show_each: {{ &J }} [eva] Recording results for const_destination [eva] Done for function const_destination [eva] Recording results for modify_J [eva] Done for function modify_J [eva] computing for function modify_s <- main. Called from tests/value/const.i:120. [eva] tests/value/const.i:50: Frama_C_show_each: {3} [eva] computing for function pointer_to_const <- modify_s <- main. Called from tests/value/const.i:51. [eva] tests/value/const.i:25: Frama_C_show_each: {4} [eva] Recording results for pointer_to_const [eva] Done for function pointer_to_const [eva] computing for function const_destination <- modify_s <- main. Called from tests/value/const.i:52. [eva] tests/value/const.i:31: Frama_C_show_each: {4} [eva] Recording results for const_destination [eva] Done for function const_destination [eva] Recording results for modify_s [eva] Done for function modify_s [eva] computing for function modify_t <- main. Called from tests/value/const.i:121. [eva] tests/value/const.i:56: Frama_C_show_each: {6} [eva] computing for function pointer_to_const <- modify_t <- main. Called from tests/value/const.i:57. [eva] tests/value/const.i:25: Frama_C_show_each: {4} [eva] Recording results for pointer_to_const [eva] Done for function pointer_to_const [eva] computing for function const_destination <- modify_t <- main. Called from tests/value/const.i:58. [eva] tests/value/const.i:31: Frama_C_show_each: {3} [eva] Recording results for const_destination [eva] Done for function const_destination [eva] Recording results for modify_t [eva] Done for function modify_t [eva] computing for function constrain_G <- main. Called from tests/value/const.i:122. [eva:alarm] tests/value/const.i:67: Warning: assertion got status unknown. [eva] tests/value/const.i:70: Frama_C_show_each: {1; 4} [eva] Recording results for constrain_G [eva] Done for function constrain_G [eva] computing for function pointer_to_const_logic <- main. Called from tests/value/const.i:123. [eva] Recording results for pointer_to_const_logic [eva] Done for function pointer_to_const_logic [eva] computing for function local_const <- main. Called from tests/value/const.i:124. [eva] computing for function f <- local_const <- main. Called from tests/value/const.i:84. [eva] Recording results for f [eva] Done for function f [eva] Recording results for local_const [eva] Done for function local_const [eva] computing for function ret_const <- main. Called from tests/value/const.i:125. [eva] computing for function aux_ret_const <- ret_const <- main. Called from tests/value/const.i:94. [eva] Recording results for aux_ret_const [eva] Done for function aux_ret_const [eva] Recording results for ret_const [eva] Done for function ret_const [eva] computing for function build_S <- main. Called from tests/value/const.i:127. [eva] Recording results for build_S [eva] Done for function build_S [eva] tests/value/const.i:128: Frama_C_show_each_S1: {1}, {2} [eva] computing for function mutable_test <- main. Called from tests/value/const.i:129. [eva] Recording results for mutable_test [eva] Done for function mutable_test [eva] tests/value/const.i:130: Frama_C_show_each_S2: {45}, {2} [eva] Recording results for main [eva] done for function main [eva] tests/value/const.i:21: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function aux_ret_const: __retres ∈ {1} [eva:final-states] Values at end of function build_S: ls.x ∈ {1} .y ∈ {2} [eva:final-states] Values at end of function const_destination: J ∈ {0} [eva:final-states] Values at end of function const_formal: [eva:final-states] Values at end of function constrain_G: r ∈ {3; 5} [eva:final-states] Values at end of function f: __retres ∈ {7} [eva:final-states] Values at end of function local_const: x ∈ {5} y ∈ {7} [eva:final-states] Values at end of function mutable_test: ls.x ∈ {45} .y ∈ {2} [eva:final-states] Values at end of function pointer_to_const: J ∈ {0} [eva:final-states] Values at end of function modify_I: [eva:final-states] Values at end of function modify_J: J ∈ {0; 8; 9} [eva:final-states] Values at end of function modify_s: [eva:final-states] Values at end of function modify_t: [eva:final-states] Values at end of function pointer_to_const_logic: J ∈ {0; 8; 9; 12} [eva:final-states] Values at end of function ret_const: [eva:final-states] Values at end of function main: J ∈ {0; 8; 9; 12} [from] Computing for function aux_ret_const [from] Done for function aux_ret_const [from] Computing for function build_S [from] Done for function build_S [from] Computing for function const_destination [from] Done for function const_destination [from] Computing for function const_formal [from] Done for function const_formal [from] Computing for function constrain_G [from] Done for function constrain_G [from] Computing for function f [from] Done for function f [from] Computing for function local_const [from] Done for function local_const [from] Computing for function mutable_test [from] Done for function mutable_test [from] Computing for function pointer_to_const [from] Done for function pointer_to_const [from] Computing for function modify_I [from] Done for function modify_I [from] Computing for function modify_J [from] Done for function modify_J [from] Computing for function modify_s [from] Done for function modify_s [from] Computing for function modify_t [from] Done for function modify_t [from] Computing for function pointer_to_const_logic [from] Done for function pointer_to_const_logic [from] Computing for function ret_const [from] Done for function ret_const [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function aux_ret_const: \result FROM \nothing [from] Function build_S: ls.x FROM s_0; x .y FROM s_0; y [from] Function const_destination: J FROM p [from] Function const_formal: NO EFFECTS [from] Function constrain_G: NO EFFECTS [from] Function f: \result FROM \nothing [from] Function local_const: NO EFFECTS [from] Function mutable_test: ls.x FROM s_0 [from] Function pointer_to_const: J FROM p [from] Function modify_I: J FROM v (and SELF) [from] Function modify_J: J FROM J; v (and SELF) [from] Function modify_s: J FROM v (and SELF) [from] Function modify_t: J FROM v (and SELF) [from] Function pointer_to_const_logic: J FROM v; p (and SELF) [from] Function ret_const: \result FROM \nothing [from] Function main: J FROM J; v (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function aux_ret_const: __retres [inout] Inputs for function aux_ret_const: \nothing [inout] Out (internal) for function build_S: ls [inout] Inputs for function build_S: \nothing [inout] Out (internal) for function const_destination: J [inout] Inputs for function const_destination: I; J; s.i2; t[2] [inout] Out (internal) for function const_formal: \nothing [inout] Inputs for function const_formal: v [inout] Out (internal) for function constrain_G: r [inout] Inputs for function constrain_G: G [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function local_const: x; y [inout] Inputs for function local_const: \nothing [inout] Out (internal) for function mutable_test: ls.x [inout] Inputs for function mutable_test: ls.x [inout] Out (internal) for function pointer_to_const: J [inout] Inputs for function pointer_to_const: I; J; s.i2; t[3] [inout] Out (internal) for function modify_I: \nothing [inout] Inputs for function modify_I: I; J; v; s.i2; t[2..3] [inout] Out (internal) for function modify_J: J [inout] Inputs for function modify_J: I; J; v; s.i2; t[2..3] [inout] Out (internal) for function modify_s: \nothing [inout] Inputs for function modify_s: I; J; v; s; t[2..3] [inout] Out (internal) for function modify_t: \nothing [inout] Inputs for function modify_t: I; J; v; s.i2; t{[2..3]; [5]} [inout] Out (internal) for function pointer_to_const_logic: J [inout] Inputs for function pointer_to_const_logic: v [inout] Out (internal) for function ret_const: tmp [inout] Inputs for function ret_const: \nothing [inout] Out (internal) for function main: J [inout] Inputs for function main: G; I; J; v; s; t{[2..3]; [5]} frama-c-20.0-Calcium/tests/value/oracle/const2.res.oracle0000666000000000000000000000157513571573400020135 0ustar [kernel] Parsing tests/value/const2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0].a ∈ {1} [0].[bits 8 to 31] ∈ {0} [0].b ∈ {2} [1].a ∈ {3} [1].[bits 8 to 31] ∈ {0} [1].b ∈ {4} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {2} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM T[0].b [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres [inout] Inputs for function main: T[0].b frama-c-20.0-Calcium/tests/value/oracle/const_syntax.res.oracle0000666000000000000000000000171513571573400021455 0ustar [kernel] Parsing tests/value/const_syntax.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization INSTRU_N_00_01_001_CRC___1525983317999999999994352352523523993424999 ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: INSTRU_N_00_01_001_CRC___1525983317999999999994352352523523993424999_0 ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: INSTRU_N_00_01_001_CRC___1525983317999999999994352352523523993424999_0 [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/const_typedef.res.oracle0000666000000000000000000000363513571573400021572 0ustar [kernel] Parsing tests/value/const_typedef.i (no preprocessing) /* Generated by Frama-C */ typedef int INT[3][3]; typedef int INT3[2][7]; struct __anonstruct_ts_1 { int s1 ; int s2 ; }; typedef struct __anonstruct_ts_1 ts; typedef int INT4[7]; INT const __attribute__((__BLA__)) x1 = {{1, 2, 3}, {4, 5, 6}, {7}}; INT const __attribute__((__BLA__)) x1bis; int const ( __attribute__((__BLA__)) x2)[3][3] = {{1, 2, 3}, {4, 5, 6}, {7}}; INT3 const __attribute__((__BLA__)) x3 = {{1, 2, 3, 4, 5, 6, 7}}; ts const __attribute__((__BLA__)) s[3] = {{.s1 = 1, .s2 = 2}, {.s1 = 3, .s2 = 4}, {.s1 = 5, .s2 = 0}}; INT4 const y1 = {0, 1, 2, 3, 4}; int const y2[5] = {1, 2, 3, 4, 5}; int const y4[7] = {1, 2}; int main(void) { int __retres; __retres = 0; return __retres; } [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x1[0][0] ∈ {1} [0][1] ∈ {2} [0][2] ∈ {3} [1][0] ∈ {4} [1][1] ∈ {5} [1][2] ∈ {6} [2][0] ∈ {7} [2][1..2] ∈ {0} x1bis[0..2][0..2] ∈ {0} x2[0][0] ∈ {1} [0][1] ∈ {2} [0][2] ∈ {3} [1][0] ∈ {4} [1][1] ∈ {5} [1][2] ∈ {6} [2][0] ∈ {7} [2][1..2] ∈ {0} x3[0][0] ∈ {1} [0][1] ∈ {2} [0][2] ∈ {3} [0][3] ∈ {4} [0][4] ∈ {5} [0][5] ∈ {6} [0][6] ∈ {7} [1][0..6] ∈ {0} s[0].s1 ∈ {1} [0].s2 ∈ {2} [1].s1 ∈ {3} [1].s2 ∈ {4} [2].s1 ∈ {5} [2].s2 ∈ {0} y1[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5..6] ∈ {0} y2[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} y4[0] ∈ {1} [1] ∈ {2} [2..6] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} frama-c-20.0-Calcium/tests/value/oracle/constarraystructlibentry.res.oracle0000666000000000000000000000774113571573400024131 0ustar [kernel] Parsing tests/value/constarraystructlibentry.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} t2[0][0] ∈ {1} [0][1] ∈ {2} [0][2] ∈ {3} [1][0] ∈ {4} [1][1] ∈ {5} [1][2] ∈ {6} [2][0] ∈ {7} [2][1] ∈ {8} [2][2] ∈ {9} t3[0][0] ∈ {10} [0][1] ∈ {20} [0][2] ∈ {30} [1][0] ∈ {40} [1][1] ∈ {50} [1][2] ∈ {60} [2][0] ∈ {70} [2][1] ∈ {80} [2][2] ∈ {90} t4[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} [10..11] ∈ {0} t5[0].f1 ∈ [--..--] [0].f2 ∈ {2} [1].f1 ∈ [--..--] [1].f2 ∈ {0} [2].f1 ∈ [--..--] [2].f2 ∈ {6} [3].f1 ∈ [--..--] [3].f2 ∈ {8} [4].f1 ∈ [--..--] [4].f2 ∈ {10} [5].f1 ∈ [--..--] [5].f2 ∈ {0} [6].f1 ∈ [--..--] [6].f2 ∈ {0} t6[0].f0 ∈ [--..--] [0].f2 ∈ {2} {[0].[bits 40 to 63]; [1].f0} ∈ [--..--] [1].f2 ∈ {4} {[1].[bits 40 to 63]; [2].f0} ∈ [--..--] [2].f2 ∈ {6} {[2].[bits 40 to 63]; [3].f0} ∈ [--..--] [3].f2 ∈ {8} {[3].[bits 40 to 63]; [4].f0} ∈ [--..--] [4].f2 ∈ {10} {[4].[bits 40 to 63]; [5].f0} ∈ [--..--] [5].f2 ∈ {0} [5].[bits 40 to 63] ∈ [--..--] t7[0..4] ∈ [--..--] t8[0] ∈ {1} [1] ∈ {2} [2..4] ∈ {0} s1 ∈ {0} s2 ∈ {0} s3.a{.b; .c} ∈ {0} {.a.[bits 40 to 63]; .c; .[bits 72 to 95]} ∈ [--..--] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {{ &t7[0] }} [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} t2[0][0] ∈ {1} [0][1] ∈ {2} [0][2] ∈ {3} [1][0] ∈ {4} [1][1] ∈ {5} [1][2] ∈ {6} [2][0] ∈ {7} [2][1] ∈ {8} [2][2] ∈ {9} t3[0][0] ∈ {10} [0][1] ∈ {20} [0][2] ∈ {30} [1][0] ∈ {40} [1][1] ∈ {50} [1][2] ∈ {60} [2][0] ∈ {70} [2][1] ∈ {80} [2][2] ∈ {90} t4[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {10} [10..11] ∈ {0} t5[0].f1 ∈ [--..--] [0].f2 ∈ {2} [1].f1 ∈ [--..--] [1].f2 ∈ {0} [2].f1 ∈ [--..--] [2].f2 ∈ {6} [3].f1 ∈ [--..--] [3].f2 ∈ {8} [4].f1 ∈ [--..--] [4].f2 ∈ {10} [5].f1 ∈ [--..--] [5].f2 ∈ {0} [6].f1 ∈ [--..--] [6].f2 ∈ {0} t6[0].f0 ∈ [--..--] [0].f2 ∈ {2} [0].[bits 40 to 63] ∈ UNINITIALIZED [1].f0 ∈ [--..--] [1].f2 ∈ {4} [1].[bits 40 to 63] ∈ UNINITIALIZED [2].f0 ∈ [--..--] [2].f2 ∈ {6} [2].[bits 40 to 63] ∈ UNINITIALIZED [3].f0 ∈ [--..--] [3].f2 ∈ {8} [3].[bits 40 to 63] ∈ UNINITIALIZED [4].f0 ∈ [--..--] [4].f2 ∈ {10} [4].[bits 40 to 63] ∈ UNINITIALIZED [5].f0 ∈ [--..--] [5].f2 ∈ {0} [5].[bits 40 to 63] ∈ UNINITIALIZED t7[0..4] ∈ [--..--] t8[0] ∈ {1} [1] ∈ {2} [2..4] ∈ {0} s1{.b; .c} ∈ {0} .[bits 40 to 63] ∈ UNINITIALIZED s2.a{.b; .c} ∈ {0} .a.[bits 40 to 63] ∈ UNINITIALIZED .c ∈ {0} .[bits 72 to 95] ∈ UNINITIALIZED s3.a{.b; .c} ∈ {0} .a.[bits 40 to 63] ∈ UNINITIALIZED .c ∈ [--..--] .[bits 72 to 95] ∈ UNINITIALIZED [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {{ &t7[0] }} frama-c-20.0-Calcium/tests/value/oracle/context_free.res.oracle0000666000000000000000000001534213571573400021407 0ustar [kernel] Parsing tests/value/context_free.i (no preprocessing) [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva:initial-state] creating variable S_p_svoid with imprecise size (type void) [eva:initial-state] creating variable S_qvoid with imprecise size (type void) [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ [--..--] b ∈ [--..--] c ∈ [--..--] vol ∈ [--..--] star_p ∈ [--..--] star_w___500 ∈ [--..--] s{.s1; .s2} ∈ [--..--] .sp ∈ {{ NULL ; &S_sp_s[0] }} .sg ∈ {0} t{.s1; .s2} ∈ [--..--] .sp ∈ {{ NULL ; &S_sp_t[0] }} .sg ∈ {0} tt.ss1{.s1; .s2} ∈ [--..--] .ss1.sp ∈ {{ NULL ; &S_sp_ss1_tt[0] }} .ss1.sg ∈ {0} .ss2 ∈ [--..--] u[0..11] ∈ [--..--] v[0..11][0..2] ∈ [--..--] w[0] ∈ {{ NULL ; &S_0_w[0] }} [1] ∈ {{ NULL ; &S_1_w[0] }} [2..11] ∈ {{ NULL ; &S_0_w[0] ; &S_1_w[0] }} ts[0]{.s1; .s2} ∈ [--..--] [0].sp ∈ {{ NULL ; &S_sp_0_ts[0] }} [0].sg ∈ {0} [1]{.s1; .s2} ∈ [--..--] [1].sp ∈ {{ NULL ; &S_sp_1_ts[0] }} [1].sg ∈ {0} [2]{.s1; .s2} ∈ [--..--] [2].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [2].sg ∈ {0} [3]{.s1; .s2} ∈ [--..--] [3].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [3].sg ∈ {0} [4]{.s1; .s2} ∈ [--..--] [4].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [4].sg ∈ {0} [5]{.s1; .s2} ∈ [--..--] [5].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [5].sg ∈ {0} [6]{.s1; .s2} ∈ [--..--] [6].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [6].sg ∈ {0} [7]{.s1; .s2} ∈ [--..--] [7].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [7].sg ∈ {0} [8]{.s1; .s2} ∈ [--..--] [8].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [8].sg ∈ {0} [9]{.s1; .s2} ∈ [--..--] [9].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [9].sg ∈ {0} uu ∈ {{ garbled mix of &{WELL_uu} (origin: Well) }} uuu ∈ [--..--] c_int ∈ [--..--] svoid.f1 ∈ [--..--] .p ∈ {{ garbled mix of &{S_p_svoid} (origin: Well) }} qvoid ∈ {{ garbled mix of &{S_qvoid} (origin: Well) }} S_sp_s[0..1] ∈ [--..--] S_sp_t[0..1] ∈ [--..--] S_sp_ss1_tt[0..1] ∈ [--..--] S_0_w[0..1] ∈ [--..--] S_1_w[0..1] ∈ [--..--] S_sp_0_ts[0..1] ∈ [--..--] S_sp_1_ts[0..1] ∈ [--..--] WELL_uu[bits 0 to ..] ∈ {{ garbled mix of &{WELL_uu} (origin: Well) }} S_p_svoid[bits 0 to ..] ∈ {{ garbled mix of &{S_p_svoid} (origin: Well) }} S_qvoid[bits 0 to ..] ∈ {{ garbled mix of &{S_qvoid} (origin: Well) }} [eva:initial-state] creating variable S_0_S_vvv with imprecise size (type void) [eva:initial-state] creating variable S_1_S_vvv with imprecise size (type void) [eva:initial-state] creating variable S_vv with imprecise size (type void) [eva:alarm] tests/value/context_free.i:46: Warning: out of bounds write. assert \valid(p); [eva] tests/value/context_free.i:51: Assigning imprecise value to vv. The imprecision originates from Well [eva:alarm] tests/value/context_free.i:52: Warning: out of bounds write. assert \valid(vvv); [eva] tests/value/context_free.i:52: Assigning imprecise value to *vvv (pointing to S_vvv with offsets {0}). The imprecision originates from Well [eva] tests/value/context_free.i:54: Assigning imprecise value to uu.u1. The imprecision originates from Well [eva:alarm] tests/value/context_free.i:56: Warning: out of bounds write. assert \valid(ta + 1); [eva] tests/value/context_free.i:58: Assigning imprecise value to pvoid. The imprecision originates from Well [eva:alarm] tests/value/context_free.i:59: Warning: out of bounds write. assert \valid(pvoid); [eva] tests/value/context_free.i:60: Assigning imprecise value to pvoid. The imprecision originates from Well [eva:alarm] tests/value/context_free.i:61: Warning: out of bounds write. assert \valid(pvoid); [eva] tests/value/context_free.i:61: Assigning imprecise value to *pvoid (pointing to S_qvoid with offsets [0..34359738360],0%8). The imprecision originates from Arithmetic {tests/value/context_free.i:61} [eva:alarm] tests/value/context_free.i:62: Warning: pointer to function with incompatible type. assert \valid_function(g); [eva] Recording results for f [eva] done for function f [eva] tests/value/context_free.i:62: assertion 'Eva,function_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: a ∈ [--..--] b ∈ [--..--] t.s1 ∈ [--..--] .s2 ∈ {3} .sp ∈ {{ NULL ; &S_sp_t[0] }} .sg ∈ {0} tt.ss1{.s1; .s2} ∈ [--..--] .ss1.sp ∈ {{ NULL ; &S_sp_ss1_tt[0] }} .ss1.sg ∈ {0} .ss2 ∈ [--..--] u[0] ∈ [--..--] [1] ∈ {2} [2..11] ∈ [--..--] v[0][0] ∈ {5} {[0][1..2]; [1..11][0..2]} ∈ [--..--] w[0] ∈ {{ NULL ; &S_0_w[0] }} [1] ∈ {{ NULL ; &S_1_w[0] }} [2..3] ∈ {{ NULL ; &S_0_w[0] ; &S_1_w[0] }} [4] ∈ {{ &a }} [5..11] ∈ {{ NULL ; &S_0_w[0] ; &S_1_w[0] }} ts[0]{.s1; .s2} ∈ [--..--] [0].sp ∈ {{ NULL ; &S_sp_0_ts[0] }} [0].sg ∈ {0} [1]{.s1; .s2} ∈ [--..--] [1].sp ∈ {{ NULL ; &S_sp_1_ts[0] }} [1].sg ∈ {0} [2]{.s1; .s2} ∈ [--..--] [2].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [2].sg ∈ {0} [3]{.s1; .s2} ∈ [--..--] [3].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [3].sg ∈ {0} [4]{.s1; .s2} ∈ [--..--] [4].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [4].sg ∈ {0} [5]{.s1; .s2} ∈ [--..--] [5].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [5].sg ∈ {0} [6]{.s1; .s2} ∈ [--..--] [6].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [6].sg ∈ {0} [7]{.s1; .s2} ∈ [--..--] [7].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [7].sg ∈ {0} [8]{.s1; .s2} ∈ [--..--] [8].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [8].sg ∈ {0} [9]{.s1; .s2} ∈ [--..--] [9].sp ∈ {{ NULL ; &S_sp_0_ts[0] ; &S_sp_1_ts[0] }} [9].sg ∈ {0} uu ∈ {{ garbled mix of &{WELL_uu} (origin: Well) }} uuu ∈ [--..--] c_int ∈ [--..--] p ∈ {{ &S_p[0] }} vv ∈ {{ garbled mix of &{S_vv} (origin: Well) }} ta ∈ {{ &S_ta[0] }} pvoid ∈ {{ &S_qvoid + [0..4294967295] }} S_p_svoid[bits 0 to ..] ∈ {{ garbled mix of &{S_p_svoid} (origin: Well) }} S_qvoid[bits 0 to ..] ∈ {{ garbled mix of &{pvoid; S_qvoid} (origin: Well) }} S_ta[0] ∈ [--..--] [1] ∈ {3} [2..4] ∈ [--..--] S_vvv[0] ∈ {{ garbled mix of &{S_0_S_vvv} (origin: Well) }} [1] ∈ {{ garbled mix of &{S_1_S_vvv} (origin: Well) }} S_p[0] ∈ {{ NULL ; &S_0_S_p[0] }} [1] ∈ {{ NULL ; &S_1_S_p[0] }} frama-c-20.0-Calcium/tests/value/oracle/context_free_simple.res.oracle0000666000000000000000000000227113571573400022755 0ustar [kernel] Parsing tests/value/context_free_simple.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization z ∈ {1} [eva] computing for function f <- main. Called from tests/value/context_free_simple.i:12. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: z ∈ {5} __retres ∈ {4} [eva:final-states] Values at end of function main: z ∈ {5} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: z FROM x; y \result FROM y [from] Function main: z FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: z; __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: z [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/context_width.res.oracle0000666000000000000000000000754413571573400021612 0ustar [kernel] Parsing tests/value/context_width.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} [eva:alarm] tests/value/context_width.i:10: Warning: pointer comparison. assert \pointer_comparable((void *)(p + 2), (void *)0); [eva:alarm] tests/value/context_width.i:12: Warning: pointer comparison. assert \pointer_comparable((void *)(p + 1), (void *)(&a)); [eva:alarm] tests/value/context_width.i:15: Warning: out of bounds write. assert \valid(p + 1); [eva:alarm] tests/value/context_width.i:16: Warning: out of bounds write. assert \valid(p + 2); [eva:alarm] tests/value/context_width.i:17: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: S_p[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: S_p[0..2] FROM p (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: S_p[0..2] [inout] Inputs for function main: \nothing /* Generated by Frama-C */ int a; void main(int *p) { if (! (p == (int *)0)) { if (! (p + 1 == (int *)0)) /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(p + 2), (void *)0); */ if (! (p + 2 == (int *)0)) ; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(p + 1), (void *)(&a)); */ if (p + 1 == & a) ; *p = 1; /*@ assert Eva: mem_access: \valid(p + 1); */ *(p + 1) = 2; /*@ assert Eva: mem_access: \valid(p + 2); */ *(p + 2) = 3; } else /*@ assert \false; */ ; return; } [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} [eva:alarm] tests/value/context_width.i:10: Warning: pointer comparison. assert \pointer_comparable((void *)(p + 2), (void *)0); [eva:alarm] tests/value/context_width.i:12: Warning: pointer comparison. assert \pointer_comparable((void *)(p + 1), (void *)(&a)); [eva:alarm] tests/value/context_width.i:15: Warning: out of bounds write. assert \valid(p + 1); [kernel] tests/value/context_width.i:15: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/context_width.i:15: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: S_p_0[0] [inout] Inputs for function main: \nothing /* Generated by Frama-C */ int a; void main(int *p) { if (! (p == (int *)0)) { if (! (p + 1 == (int *)0)) /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(p + 2), (void *)0); */ if (! (p + 2 == (int *)0)) ; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(p + 1), (void *)(&a)); */ if (p + 1 == & a) ; *p = 1; /*@ assert Eva: mem_access: \valid(p + 1); */ *(p + 1) = 2; *(p + 2) = 3; } else /*@ assert \false; */ ; return; } frama-c-20.0-Calcium/tests/value/oracle/control.res.oracle0000666000000000000000000000170013571573400020373 0ustar [kernel] Parsing tests/value/control.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} c ∈ {0} d ∈ {0} [eva] tests/value/control.i:11: starting to merge loop iterations [eva:alarm] tests/value/control.i:14: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ [0..2147483647] i ∈ {4} [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: x FROM x (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: x; i [inout] Inputs for function f: x; c frama-c-20.0-Calcium/tests/value/oracle/conversion.res.oracle0000666000000000000000000001414413571573400021106 0ustar [kernel] Parsing tests/value/conversion.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] tests/value/conversion.i:16: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ {1} y ∈ UNINITIALIZED f ∈ {1.40129846432e-45} l ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/conversion.i:19: Warning: assertion 'ASSUME' got status unknown. [eva] tests/value/conversion.i:21: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ [0..1120000000] y ∈ UNINITIALIZED f ∈ [0. .. 96.921875] l ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/conversion.i:24: Warning: assertion 'ASSUME' got status unknown. [eva] tests/value/conversion.i:26: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ [-10..10] y ∈ UNINITIALIZED f ∈ [0. .. 1.40129846432e-44] ∪ {NaN} l ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/conversion.i:29: Warning: assertion 'ASSUME' got status unknown. [eva] tests/value/conversion.i:31: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ [-10..10] y ∈ [-10..10] f ∈ [0. .. 1.40129846432e-44] ∪ {NaN} l ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/conversion.i:34: Warning: assertion 'ASSUME' got status unknown. [eva] tests/value/conversion.i:36: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ [1077936128..1084227584] y ∈ [-10..10] f ∈ [3. .. 5.] l ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/conversion.i:40: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ {{ (int)&x }} y ∈ [-10..10] f ∈ {{ (float)&x }} l ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/conversion.i:45: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x[bits 0 to 15] ∈ {1} [bits 16 to 31] ∈ {2} y ∈ [-10..10] f[bits 0 to 15] ∈ {1} [bits 16 to 31] ∈ {2} l ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/conversion.i:50: Warning: assertion 'ASSUME' got status unknown. [eva] tests/value/conversion.i:53: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x[bits 0 to 15] ∈ {1} [bits 16 to 31] ∈ {2} y ∈ [-10..10] f ∈ [7.00649232162e-45 .. 2.10194769649e-44] or UNINITIALIZED l ∈ [5..15] or UNINITIALIZED ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x[bits 0 to 15] ∈ {1} [bits 16 to 31] ∈ {2} y ∈ [-10..10] f ∈ [7.00649232162e-45 .. 2.10194769649e-44] or UNINITIALIZED l ∈ [5..15] or UNINITIALIZED [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; y; f; l [inout] Inputs for function main: v [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] tests/value/conversion.i:16: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ {1} y ∈ UNINITIALIZED f ∈ {1.40129846432e-45} l ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/conversion.i:21: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ [0..1120000000] y ∈ UNINITIALIZED f ∈ [0. .. 96.921875] l ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/conversion.i:25: Warning: non-finite float value. assert \is_finite(*((float *)(&x))); [eva] tests/value/conversion.i:26: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ [0. .. 1.40129846432e-44] y ∈ UNINITIALIZED f ∈ [0. .. 1.40129846432e-44] l ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/conversion.i:31: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ [-10..10] y ∈ [--..--] f ∈ [0. .. 1.40129846432e-44] l ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/conversion.i:36: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ [1077936128..1084227584] y ∈ [--..--] f ∈ [3. .. 5.] l ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/conversion.i:39: Warning: non-finite float value. assert \is_finite(*((float *)(&x))); [eva] tests/value/conversion.i:39: Assigning imprecise value to f. The imprecision originates from Arithmetic {tests/value/conversion.i:39} [eva] tests/value/conversion.i:40: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x ∈ {{ (int)&x }} y ∈ [--..--] f ∈ {{ garbled mix of &{x} (origin: Arithmetic {tests/value/conversion.i:39}) }} l ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/conversion.i:45: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x[bits 0 to 15] ∈ {1} [bits 16 to 31] ∈ {2} y ∈ [--..--] f ∈ {1.83672393614e-40} l ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/conversion.i:52: Warning: accessing uninitialized left-value. assert \initialized((float *)(&l)); [eva] tests/value/conversion.i:53: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] x[bits 0 to 15] ∈ {1} [bits 16 to 31] ∈ {2} y ∈ [--..--] f ∈ [7.00649232162e-45 .. 2.10194769649e-44] l ∈ [5..15] ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x[bits 0 to 15] ∈ {1} [bits 16 to 31] ∈ {2} y ∈ [--..--] f ∈ [7.00649232162e-45 .. 2.10194769649e-44] l ∈ [5..15] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; y; f; l [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/copy_paste.res.oracle0000666000000000000000000000236213571573400021066 0ustar [kernel] Parsing tests/value/copy_paste.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..11] ∈ {0} G ∈ {0} [eva:alarm] tests/value/copy_paste.i:8: Warning: accessing out of bounds index. assert 0 ≤ j; [eva:alarm] tests/value/copy_paste.i:9: Warning: out of bounds read. assert \valid_read((int *)l); [eva] Recording results for main [eva] done for function main [eva] tests/value/copy_paste.i:9: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0..2] ∈ {0} [3] ∈ {0; 3; 4} [4] ∈ {4} [5..11] ∈ {0} G ∈ [--..--] l ∈ [--..--] i ∈ {3; 4} j ∈ {4} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[3] FROM c (and SELF) [4] FROM c G FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[3..4]; G; l; i; tmp; j; tmp_0 [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/copy_paste_hidden_by_dummy_cast.res.oracle0000666000000000000000000000151013571573400025312 0ustar [kernel] Parsing tests/value/copy_paste_hidden_by_dummy_cast.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A4O1_Ci_sNO_ERREUR_ANO ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Rl_sErreurAno ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: Rl_sErreurAno [inout] Inputs for function main: A4O1_Ci_sNO_ERREUR_ANO frama-c-20.0-Calcium/tests/value/oracle/copy_stdin.res.oracle0000666000000000000000000000231613571573400021072 0ustar [kernel] Parsing tests/value/copy_stdin.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function leaf <- main. Called from tests/value/copy_stdin.i:4. [kernel:annot:missing-spec] tests/value/copy_stdin.i:4: Warning: Neither code nor specification for function leaf, generating default assigns from the prototype [eva] using specification for function leaf [eva] Done for function leaf [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: stdin ∈ [--..--] toto ∈ [--..--] [from] Computing for function main [from] Computing for function leaf <-main [from] Done for function leaf [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function leaf: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: stdin; toto [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/dangling.res.oracle0000666000000000000000000000335513571573400020506 0ustar [kernel] Parsing tests/value/dangling.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:locals-escaping] tests/value/dangling.i:9: Warning: locals {v_0} escaping the scope of a block of main through x [eva:alarm] tests/value/dangling.i:15: Warning: assertion got status unknown. [eva] tests/value/dangling.i:16: assertion got status valid. [eva:alarm] tests/value/dangling.i:19: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&x); [eva:alarm] tests/value/dangling.i:23: Warning: assertion got status unknown. [eva:alarm] tests/value/dangling.i:24: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&x); [eva:locals-escaping] tests/value/dangling.i:31: Warning: locals {z} escaping the scope of a block of main through p [eva] tests/value/dangling.i:33: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] tests/value/dangling.i:24: assertion 'Eva,dangling_pointer' got final status invalid. [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {{ &y }} or ESCAPINGADDR y ∈ {1} p[0] ∈ ESCAPINGADDR [1] ∈ {42} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; y; i; j; j_0; p[0..1] [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/dataflow_order.res.oracle0000666000000000000000000001333513571573400021716 0ustar [kernel] Parsing tests/value/dataflow_order.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] j ∈ {0} k ∈ {0} [eva] tests/value/dataflow_order.i:18: Frama_C_show_each_1: {0}, {0} [eva] tests/value/dataflow_order.i:21: Frama_C_show_each_then: {1}, {0} [eva] computing for function f <- main. Called from tests/value/dataflow_order.i:22. [eva] Recording results for f [eva] Done for function f [eva] tests/value/dataflow_order.i:24: Frama_C_show_each_else: {1}, {0} [eva] computing for function g <- main. Called from tests/value/dataflow_order.i:25. [eva] Recording results for g [eva] Done for function g [eva] tests/value/dataflow_order.i:17: starting to merge loop iterations [eva] tests/value/dataflow_order.i:18: Frama_C_show_each_1: {0; 1}, {0; 1} [eva] tests/value/dataflow_order.i:21: Frama_C_show_each_then: {1; 2}, {0; 1} [eva] computing for function f <- main. Called from tests/value/dataflow_order.i:22. [eva] Recording results for f [eva] Done for function f [eva] tests/value/dataflow_order.i:24: Frama_C_show_each_else: {1; 2}, {0; 1} [eva] computing for function g <- main. Called from tests/value/dataflow_order.i:25. [eva] Recording results for g [eva] Done for function g [eva] tests/value/dataflow_order.i:18: Frama_C_show_each_1: {0; 1; 2}, {0; 1; 2} [eva] tests/value/dataflow_order.i:21: Frama_C_show_each_then: {1; 2; 3}, {0; 1; 2} [eva] computing for function f <- main. Called from tests/value/dataflow_order.i:22. [eva] Recording results for f [eva] Done for function f [eva] tests/value/dataflow_order.i:24: Frama_C_show_each_else: {1; 2; 3}, {0; 1; 2} [eva] computing for function g <- main. Called from tests/value/dataflow_order.i:25. [eva] Recording results for g [eva] Done for function g [eva] tests/value/dataflow_order.i:18: Frama_C_show_each_1: [0..64999], {0; 1; 2; 3} [eva] tests/value/dataflow_order.i:21: Frama_C_show_each_then: [1..65000], {0; 1; 2; 3} [eva] computing for function f <- main. Called from tests/value/dataflow_order.i:22. [eva] Recording results for f [eva] Done for function f [eva] tests/value/dataflow_order.i:24: Frama_C_show_each_else: [1..65000], {0; 1; 2; 3} [eva] computing for function g <- main. Called from tests/value/dataflow_order.i:25. [eva] Recording results for g [eva] Done for function g [eva] tests/value/dataflow_order.i:18: Frama_C_show_each_1: [0..64999], {0; 1; 2; 3; 4} [eva] tests/value/dataflow_order.i:21: Frama_C_show_each_then: [1..65000], {0; 1; 2; 3; 4} [eva] computing for function f <- main. Called from tests/value/dataflow_order.i:22. [eva] Recording results for f [eva] Done for function f [eva] tests/value/dataflow_order.i:24: Frama_C_show_each_else: [1..65000], {0; 1; 2; 3; 4} [eva] computing for function g <- main. Called from tests/value/dataflow_order.i:25. [eva] Recording results for g [eva] Done for function g [eva] tests/value/dataflow_order.i:18: Frama_C_show_each_1: [0..64999], [0..2147483647] [eva] tests/value/dataflow_order.i:21: Frama_C_show_each_then: [1..65000], [0..2147483647] [eva] computing for function f <- main. Called from tests/value/dataflow_order.i:22. [eva] Recording results for f [eva] Done for function f [eva] tests/value/dataflow_order.i:24: Frama_C_show_each_else: [1..65000], [0..2147483647] [eva] computing for function g <- main. Called from tests/value/dataflow_order.i:25. [eva] Recording results for g [eva] Done for function g [eva] tests/value/dataflow_order.i:18: Frama_C_show_each_1: [0..64999], [0..2147483648] [eva] tests/value/dataflow_order.i:21: Frama_C_show_each_then: [1..65000], [0..2147483648] [eva] computing for function f <- main. Called from tests/value/dataflow_order.i:22. [eva] Recording results for f [eva] Done for function f [eva] tests/value/dataflow_order.i:24: Frama_C_show_each_else: [1..65000], [0..2147483648] [eva] computing for function g <- main. Called from tests/value/dataflow_order.i:25. [eva] Recording results for g [eva] Done for function g [eva] tests/value/dataflow_order.i:18: Frama_C_show_each_1: [0..64999], [0..4294967295] [eva] tests/value/dataflow_order.i:21: Frama_C_show_each_then: [1..65000], [0..4294967295] [eva] computing for function f <- main. Called from tests/value/dataflow_order.i:22. [eva] Recording results for f [eva] Done for function f [eva] tests/value/dataflow_order.i:24: Frama_C_show_each_else: [1..65000], [0..4294967295] [eva] computing for function g <- main. Called from tests/value/dataflow_order.i:25. [eva] Recording results for g [eva] Done for function g [eva] tests/value/dataflow_order.i:28: Frama_C_show_each_end: [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: j ∈ [--..--] [eva:final-states] Values at end of function g: k ∈ [--..--] [eva:final-states] Values at end of function main: j ∈ [--..--] k ∈ [--..--] i ∈ {65000} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: j FROM j [from] Function g: k FROM k [from] Function main: j FROM c; j (and SELF) k FROM c; k (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: j [inout] Inputs for function f: j [inout] Out (internal) for function g: k [inout] Inputs for function g: k [inout] Out (internal) for function main: j; k; i [inout] Inputs for function main: c; j; k frama-c-20.0-Calcium/tests/value/oracle/dead_code.res.oracle0000666000000000000000000000141613571573400020606 0ustar [kernel] Parsing tests/value/dead_code.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {1} j ∈ {17} l ∈ {17} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; l [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/dead_code2.res.oracle0000666000000000000000000000143413571573400020670 0ustar [kernel] Parsing tests/value/dead_code2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G ∈ {0} i ∈ {1} l ∈ {17} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: G FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G; i; l [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/dead_inout.res.oracle0000666000000000000000000000515313571573400021034 0ustar [kernel] Parsing tests/value/dead_inout.i (no preprocessing) [eva] Analyzing a complete application starting at main_all [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} [eva] computing for function main <- main_all. Called from tests/value/dead_inout.i:40. [eva] computing for function f <- main <- main_all. Called from tests/value/dead_inout.i:18. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main <- main_all. Called from tests/value/dead_inout.i:19. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] Done for function main [eva] computing for function main2 <- main_all. Called from tests/value/dead_inout.i:41. [eva] computing for function f2 <- main2 <- main_all. Called from tests/value/dead_inout.i:33. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f2 <- main2 <- main_all. Called from tests/value/dead_inout.i:34. [eva] Recording results for f2 [eva] Done for function f2 [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main_all [eva] done for function main_all [inout] Out (internal) for function f: a [inout] Inputs for function f: b [inout] InOut (internal) for function f: Operational inputs: b Operational inputs on termination: b Sure outputs: a [inout] Out (internal) for function f2: x; y [inout] Inputs for function f2: \nothing [inout] InOut (internal) for function f2: Operational inputs: v; p; q Operational inputs on termination: v; p; q Sure outputs: \nothing [inout] Out (internal) for function g: x [inout] Inputs for function g: \nothing [inout] InOut (internal) for function g: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: x [inout] Out (internal) for function main: a [inout] Inputs for function main: b [inout] InOut (internal) for function main: Operational inputs: b Operational inputs on termination: b Sure outputs: a [inout] Out (internal) for function main2: x; y [inout] Inputs for function main2: \nothing [inout] InOut (internal) for function main2: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: x; y [inout] Out (internal) for function main_all: a [inout] Inputs for function main_all: b [inout] InOut (internal) for function main_all: Operational inputs: b Operational inputs on termination: b Sure outputs: a frama-c-20.0-Calcium/tests/value/oracle/dead_statuses.res.oracle0000666000000000000000000001011713571573400021545 0ustar [kernel] Parsing tests/value/dead_statuses.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/dead_statuses.i:9. [eva] using specification for function f [eva] tests/value/dead_statuses.i:9: function f: precondition got status valid. [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/dead_statuses.i:11. [eva] tests/value/dead_statuses.i:11: function f: precondition got status valid. [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Pre-condition (file tests/value/dead_statuses.i, line 5) by Call Preconditions. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Dead ] Pre-condition (file tests/value/dead_statuses.i, line 18) at instruction (file tests/value/dead_statuses.i, line 19) Locally valid, but unreachable. By Eva because: - Unreachable instruction (file tests/value/dead_statuses.i, line 19) [ Dead ] Assertion (file tests/value/dead_statuses.i, line 15) Locally valid, but unreachable. By Eva because: - Unreachable program point (file tests/value/dead_statuses.i, line 15) [ Dead ] Invariant (file tests/value/dead_statuses.i, line 16) Locally valid, but unreachable. By Eva because: - Unreachable loop (file tests/value/dead_statuses.i, line 17) [ Valid ] Default behavior at instruction (file tests/value/dead_statuses.i, line 19) by Frama-C kernel. [Unreachable] Unreachable call 'f' (file tests/value/dead_statuses.i, line 13) by Eva. [Unreachable] Unreachable program point (file tests/value/dead_statuses.i, line 15) by Eva. [Unreachable] Unreachable loop (file tests/value/dead_statuses.i, line 17) by Eva. [Unreachable] Unreachable instruction (file tests/value/dead_statuses.i, line 19) by Eva. [ Valid ] Instance of 'Pre-condition (file tests/value/dead_statuses.i, line 5)' at call 'f' (file tests/value/dead_statuses.i, line 9) by Eva. [ Valid ] Instance of 'Pre-condition (file tests/value/dead_statuses.i, line 5)' at call 'f' (file tests/value/dead_statuses.i, line 11) by Eva. [ Dead ] Instance of 'Pre-condition (file tests/value/dead_statuses.i, line 5)' at call 'f' (file tests/value/dead_statuses.i, line 13) Locally valid, but unreachable. By Eva because: - Unreachable call 'f' (file tests/value/dead_statuses.i, line 13) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 Completely validated 1 Considered valid 4 Dead properties 4 Unreachable 14 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/deep_conditionals.res.oracle0000666000000000000000000000141413571573400022400 0ustar [kernel] Parsing tests/value/deep_conditionals.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: X ∈ {33} Y ∈ {77} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: X; Y; tmp [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/degeneration2.res.oracle0000666000000000000000000000376013571573400021451 0ustar [kernel] Parsing tests/value/degeneration2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:alarm] tests/value/degeneration2.i:14: Warning: accessing uninitialized left-value. assert \initialized(&A); [eva:alarm] tests/value/degeneration2.i:14: Warning: signed overflow. assert -2147483648 ≤ -((int)A); [eva:alarm] tests/value/degeneration2.i:14: Warning: signed overflow. assert -((int)A) ≤ 2147483647; [eva] tests/value/degeneration2.i:14: Assigning imprecise value to A. The imprecision originates from Arithmetic {tests/value/degeneration2.i:14} [eva:alarm] tests/value/degeneration2.i:17: Warning: accessing uninitialized left-value. assert \initialized((int *)A); [eva:alarm] tests/value/degeneration2.i:17: Warning: out of bounds read. assert \valid_read((int *)A); [eva] tests/value/degeneration2.i:16: starting to merge loop iterations [eva:alarm] tests/value/degeneration2.i:25: Warning: accessing uninitialized left-value. assert \initialized(&offset_uninit); [eva] Recording results for main [eva] done for function main [eva] tests/value/degeneration2.i:25: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: A ∈ {{ garbled mix of &{B; C; D; E} (origin: Arithmetic {tests/value/degeneration2.i:14}) }} B ∈ {{ (void *)&C }} or UNINITIALIZED C ∈ {{ (void *)&D }} or UNINITIALIZED D ∈ {{ (void *)&E }} or UNINITIALIZED x ∈ [0..10] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: A; B; C; D; x; tmp; tmp_0; vv [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/deps.0.res.oracle0000666000000000000000000000164313571573400020012 0ustar [kernel] Parsing tests/value/deps.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/deps.i:11: Warning: accessing uninitialized left-value. assert \initialized(&w); [eva] Recording results for f [eva] done for function f [eva] tests/value/deps.i:11: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: b ∈ [--..--] [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: b [inout] Inputs for function f: \nothing frama-c-20.0-Calcium/tests/value/oracle/deps.1.res.oracle0000666000000000000000000000262613571573400020015 0ustar [kernel] Parsing tests/value/deps.i (no preprocessing) [eva] Analyzing a complete application starting at fonc1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/deps.i:17: Warning: signed overflow. assert -2147483648 ≤ a + b; [eva:alarm] tests/value/deps.i:17: Warning: signed overflow. assert a + b ≤ 2147483647; [eva:alarm] tests/value/deps.i:24: Warning: signed overflow. assert -2147483648 ≤ w + v2.x; [eva:alarm] tests/value/deps.i:24: Warning: signed overflow. assert w + v2.x ≤ 2147483647; [eva:alarm] tests/value/deps.i:24: Warning: signed overflow. assert -2147483648 ≤ (int)(w + v2.x) + v3.x; [eva:alarm] tests/value/deps.i:24: Warning: signed overflow. assert (int)(w + v2.x) + v3.x ≤ 2147483647; [eva] Recording results for fonc1 [eva] done for function fonc1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fonc1: w ∈ [--..--] v1.x ∈ [--..--] .y ∈ UNINITIALIZED [from] Computing for function fonc1 [from] Done for function fonc1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function fonc1: \result FROM a; b [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function fonc1: w; v1.x; v2.x; v3.x [inout] Inputs for function fonc1: \nothing frama-c-20.0-Calcium/tests/value/oracle/deps.2.res.oracle0000666000000000000000000000175413571573400020017 0ustar [kernel] Parsing tests/value/deps.i (no preprocessing) [eva] Analyzing a complete application starting at fonc2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/deps.i:32: Warning: signed overflow. assert -2147483648 ≤ a + b; [eva:alarm] tests/value/deps.i:32: Warning: signed overflow. assert a + b ≤ 2147483647; [eva] Recording results for fonc2 [eva] done for function fonc2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fonc2: w ∈ [--..--] v1.x ∈ [--..--] .y ∈ UNINITIALIZED [from] Computing for function fonc2 [from] Done for function fonc2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function fonc2: \result FROM a; b [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function fonc2: w; v1.x [inout] Inputs for function fonc2: \nothing frama-c-20.0-Calcium/tests/value/oracle/deps_addr.res.oracle0000666000000000000000000000173613571573400020651 0ustar [kernel] Parsing tests/value/deps_addr.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t ∈ {0} a ∈ {0} tt[0..4][0..4] ∈ {0} [eva:alarm] tests/value/deps_addr.i:6: Warning: out of bounds read. assert \valid_read(t + (int)(&a)); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres [inout] Inputs for function main: t frama-c-20.0-Calcium/tests/value/oracle/deps_compose.res.oracle0000666000000000000000000000360713571573400021403 0ustar [kernel] Parsing tests/value/deps_compose.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ {1} z ∈ {0} x1 ∈ {0} y1 ∈ {0} x2 ∈ {0} y2 ∈ {0} x3 ∈ {0} y3 ∈ {0} x4 ∈ {0} y4 ∈ {0} x5 ∈ {0} y5 ∈ {0} x6 ∈ {0} y6 ∈ {0} [eva] computing for function f <- main. Called from tests/value/deps_compose.i:17. [eva] Recording results for f [eva] Done for function f [eva] tests/value/deps_compose.i:26: Reusing old results for call to f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x1 ∈ {0} x2 ∈ {0} x3 ∈ {0} x4 ∈ {0} x5 ∈ {0} x6 ∈ {0} [eva:final-states] Values at end of function main: x1 ∈ {0} y1 ∈ {0} x2 ∈ {0} y2 ∈ {0} x3 ∈ {0} y3 ∈ {0} x4 ∈ {0} y4 ∈ {0} x5 ∈ {0} y5 ∈ {0} x6 ∈ {0} y6 ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: x1 FROM c; y1 x2 FROM c; y2 x3 FROM c; y3 x4 FROM c; y4 x5 FROM c; y5 x6 FROM c; y6 [from] Function main: x1 FROM c; z y1 FROM z x2 FROM c; z y2 FROM z x3 FROM c; z y3 FROM z x4 FROM c; z y4 FROM z x5 FROM c; z y5 FROM z x6 FROM c; z y6 FROM z [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: x1; x2; x3; x4; x5; x6 [inout] Inputs for function f: c; y1; y2; y3; y4; y5; y6 [inout] Out (internal) for function main: x1; y1; x2; y2; x3; y3; x4; y4; x5; y5; x6; y6 [inout] Inputs for function main: c; z; y1; y2; y3; y4; y5; y6 frama-c-20.0-Calcium/tests/value/oracle/deps_local.res.oracle0000666000000000000000000000425413571573400021027 0ustar [kernel] Parsing tests/value/deps_local.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} H ∈ {0} [eva] computing for function f <- main. Called from tests/value/deps_local.i:22. [eva] computing for function h <- f <- main. Called from tests/value/deps_local.i:17. [eva] Recording results for h [eva] Done for function h [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/deps_local.i:23. [eva] computing for function h <- g <- main. Called from tests/value/deps_local.i:11. [eva] Recording results for h [eva] Done for function h [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function h: ga ∈ {0} fa ∈ {0} [eva:final-states] Values at end of function f: fa ∈ {0} __retres ∈ {0} [eva:final-states] Values at end of function g: ga ∈ {0} __retres ∈ {0} [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function h [from] Done for function h [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function h: ga FROM H; argh (and SELF) fa FROM H; argh (and SELF) \result FROM H [from] Function f: \result FROM \nothing [from] Function g: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function h: ga; fa [inout] Inputs for function h: H [inout] Out (internal) for function f: fa; __retres [inout] Inputs for function f: H [inout] Out (internal) for function g: ga; __retres [inout] Inputs for function g: H [inout] Out (internal) for function main: __retres [inout] Inputs for function main: H frama-c-20.0-Calcium/tests/value/oracle/deps_mixed.res.oracle0000666000000000000000000000477713571573400021055 0ustar [kernel] Parsing tests/value/deps_mixed.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} q ∈ {0} a ∈ {0} b ∈ {0} r ∈ {2} s ∈ {0} v ∈ [--..--] t[0] ∈ {{ &f }} [1] ∈ {{ &g }} [eva:alarm] tests/value/deps_mixed.i:20: Warning: out of bounds read. assert \valid_read(p + (int)q); [eva:alarm] tests/value/deps_mixed.i:22: Warning: accessing out of bounds index. assert 0 ≤ i0; [eva:alarm] tests/value/deps_mixed.i:22: Warning: accessing out of bounds index. assert i0 < 2; [eva] computing for function g <- main. Called from tests/value/deps_mixed.i:22. [eva] Recording results for g [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/deps_mixed.i:22. [eva] Recording results for f [eva] Done for function f [eva] tests/value/deps_mixed.i:24: Assigning imprecise value to __retres. The imprecision originates from Arithmetic {tests/value/deps_mixed.i:24} [eva] tests/value/deps_mixed.i:24: Assigning imprecise value to \result
    . The imprecision originates from Arithmetic {tests/value/deps_mixed.i:24} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function g: [eva:final-states] Values at end of function main: p ∈ {{ NULL + {3} ; &a }} q ∈ {{ NULL + {2} ; &b }} r ∈ {2} s ∈ [--..--] __retres ∈ {{ garbled mix of &{a; b} (origin: Arithmetic {tests/value/deps_mixed.i:24}) }} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function g: \result FROM y [from] Function main: p FROM c q FROM d r FROM v; c; d (and SELF) s FROM t[0..1]; i0; i1; i2 \result FROM c; d [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: \nothing [inout] Inputs for function g: \nothing [inout] Out (internal) for function main: p; q; r; s; __retres [inout] Inputs for function main: p; q; v; t[0..1] frama-c-20.0-Calcium/tests/value/oracle/deps_unitialized_locals.res.oracle0000666000000000000000000000612613571573400023613 0ustar [kernel] Parsing tests/value/deps_unitialized_locals.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization maybe ∈ [--..--] v1 ∈ {0} v2 ∈ {0} v ∈ {0} [eva] computing for function f <- main. Called from tests/value/deps_unitialized_locals.i:33. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/deps_unitialized_locals.i:36. [eva:alarm] tests/value/deps_unitialized_locals.i:23: Warning: accessing uninitialized left-value. assert \initialized(&i); [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] computing for function h <- main. Called from tests/value/deps_unitialized_locals.i:39. [eva] Recording results for h [from] Computing for function h [from] Done for function h [eva] Done for function h [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: v1.ts ∈ {1} .[bits 16 to 31] ∈ {0} .ti ∈ {2} ty.ts ∈ {1} .[bits 16 to 31] ∈ {0} .ti ∈ {2} [eva:final-states] Values at end of function g: v ∈ {1} i ∈ {1} [eva:final-states] Values at end of function h: v ∈ {1} i ∈ {1} [eva:final-states] Values at end of function main: v1.ts ∈ {1} .[bits 16 to 31] ∈ {0} .ti ∈ {2} v2.ts ∈ {1} .[bits 16 to 31] ∈ {0} .ti ∈ {2} v ∈ {1} x ∈ {1} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: v1 FROM \nothing [from] Function g: v FROM maybe [from] Function h: v FROM maybe; i [from] Function main: v1 FROM \nothing v2 FROM \nothing v FROM maybe [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/value/deps_unitialized_locals.i:33 (by main): v1 FROM \nothing [from] call to g at tests/value/deps_unitialized_locals.i:36 (by main): v FROM maybe [from] call to h at tests/value/deps_unitialized_locals.i:39 (by main): v FROM maybe; i [from] entry point: v1 FROM \nothing v2 FROM \nothing v FROM maybe [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function f: v1; ty{.ts; .ti} [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: v; i [inout] Inputs for function g: maybe [inout] Out (internal) for function h: v; i [inout] Inputs for function h: maybe [inout] Out (internal) for function main: v1; v2; v; x [inout] Inputs for function main: maybe; v1 frama-c-20.0-Calcium/tests/value/oracle/deref.res.oracle0000666000000000000000000000152613571573400020006 0ustar [kernel] Parsing tests/value/deref.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} d ∈ {0} e ∈ {0} p ∈ {0} t[0..9] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &a }} i ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM \nothing \result FROM a; b; c; d; t[0] [from] ====== END OF DEPENDENCIES ====== [inout] Derefs for function main: a; d frama-c-20.0-Calcium/tests/value/oracle/descending.res.oracle0000666000000000000000000000531413571573400021023 0ustar [kernel] Parsing tests/value/descending.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function test1 <- main. Called from tests/value/descending.i:33. [eva] computing for function f <- test1 <- main. Called from tests/value/descending.i:12. [eva] tests/value/descending.i:4: starting to merge loop iterations [eva] Recording results for f [eva] Done for function f [eva:alarm] tests/value/descending.i:13: Warning: accessing out of bounds index. assert (int)(i - 1) < 10; [eva:alarm] tests/value/descending.i:13: Warning: accessing uninitialized left-value. assert \initialized(&A[i - 1]); [eva] Recording results for test1 [eva] Done for function test1 [eva] computing for function test2 <- main. Called from tests/value/descending.i:34. [eva] tests/value/descending.i:22: starting to merge loop iterations [eva:alarm] tests/value/descending.i:28: Warning: accessing out of bounds index. assert j < 33; [eva] Recording results for test2 [eva] Done for function test2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: i ∈ [10..2147483647] A[0..9] ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function test1: A[0..8] ∈ {0} or UNINITIALIZED [9] ∈ {0} i ∈ {10} __retres ∈ {0} [eva:final-states] Values at end of function test2: A[0..30] ∈ {0} or UNINITIALIZED [31] ∈ UNINITIALIZED [32] ∈ {1} i ∈ {31; 32} n ∈ {31} j ∈ {32} [eva:final-states] Values at end of function main: [from] Computing for function f [from] Done for function f [from] Computing for function test1 [from] Done for function test1 [from] Computing for function test2 [from] Done for function test2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: A[0..9] FROM A; n (and SELF) \result FROM n [from] Function test1: \result FROM \nothing [from] Function test2: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: i; tmp; A[0..9] [inout] Inputs for function f: \nothing [inout] Out (internal) for function test1: A[0..9]; i; __retres [inout] Inputs for function test1: \nothing [inout] Out (internal) for function test2: A{[0..30]; [32]}; i; n; j [inout] Inputs for function test2: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/disjoint_status.res.oracle0000666000000000000000000000771113571573400022151 0ustar [kernel] Parsing tests/value/disjoint_status.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva:alarm] tests/value/disjoint_status.i:13: Warning: function main: precondition c + 1 ≡ 2 got status unknown. [eva:alarm] tests/value/disjoint_status.i:14: Warning: function main: precondition c + d ≡ 3 got status unknown. [eva] computing for function f <- main. Called from tests/value/disjoint_status.i:18. [eva] tests/value/disjoint_status.i:18: function f: precondition 'ReqTrue' got status valid. [eva:alarm] tests/value/disjoint_status.i:8: Warning: assertion 'A1' got status invalid (stopping propagation). [eva] tests/value/disjoint_status.i:6: function f: no state left, postcondition 'PostTrue' got status valid. [eva] Recording results for f [eva] Done for function f [eva:alarm] tests/value/disjoint_status.i:19: Warning: assertion got status unknown. [eva] computing for function f <- main. Called from tests/value/disjoint_status.i:20. [eva] tests/value/disjoint_status.i:20: function f: precondition 'ReqTrue' got status valid. [eva] tests/value/disjoint_status.i:8: assertion 'A1' got status valid. [eva] tests/value/disjoint_status.i:9: assertion 'A2' got status valid. [eva] tests/value/disjoint_status.i:6: function f: postcondition 'PostTrue' got status valid. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ {0} [eva:final-states] Values at end of function main: x ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: x FROM c; d [from] Function main: x FROM c; d [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: x [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: x [inout] Inputs for function main: \nothing [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Pre-condition 'ReqTrue' by Call Preconditions. [ Valid ] Post-condition 'PostTrue' by Eva. [ - ] Assertion 'A1' (file tests/value/disjoint_status.i, line 8) tried with Eva. [ Valid ] Assertion 'A2' (file tests/value/disjoint_status.i, line 9) by Eva. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Pre-condition (file tests/value/disjoint_status.i, line 13) tried with Eva. [ - ] Pre-condition (file tests/value/disjoint_status.i, line 14) tried with Eva. [ - ] Assertion (file tests/value/disjoint_status.i, line 19) tried with Eva. [ Valid ] Default behavior by Frama-C kernel. [ Valid ] Instance of 'Pre-condition 'ReqTrue'' at call 'f' (file tests/value/disjoint_status.i, line 18) by Eva. [ Valid ] Instance of 'Pre-condition 'ReqTrue'' at call 'f' (file tests/value/disjoint_status.i, line 20) by Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 7 Completely validated 4 To be validated 11 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/div.0.res.oracle0000666000000000000000000001045613571573400017643 0ustar [kernel] Parsing tests/value/div.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} Y ∈ {0} Z1 ∈ {0} Z2 ∈ {0} T ∈ {0} U1 ∈ {0} U2 ∈ {0} V ∈ {0} W1 ∈ {0} W2 ∈ {0} a ∈ {0} b ∈ {0} d1 ∈ {0} d2 ∈ {0} d0 ∈ {0} e ∈ {0} t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3..4] ∈ {0} p ∈ {0} [eva:alarm] tests/value/div.i:14: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva:alarm] tests/value/div.i:17: Warning: signed overflow. assert c + 2 ≤ 2147483647; [eva] tests/value/div.i:14: starting to merge loop iterations [eva:alarm] tests/value/div.i:17: Warning: signed overflow. assert -2147483648 ≤ X - 1; [eva:alarm] tests/value/div.i:16: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva:alarm] tests/value/div.i:32: Warning: division by zero. assert Z2 ≢ 0; [eva:alarm] tests/value/div.i:33: Warning: division by zero. assert Z2 ≢ 0; [eva:alarm] tests/value/div.i:33: Warning: signed overflow. assert -2147483648 ≤ (int)(&Z2) / Z2; [eva:alarm] tests/value/div.i:33: Warning: signed overflow. assert (int)(&Z2) / Z2 ≤ 2147483647; [eva] tests/value/div.i:33: Assigning imprecise value to b. The imprecision originates from Arithmetic {tests/value/div.i:33} [eva:alarm] tests/value/div.i:34: Warning: division by zero. assert (int)(&X + 2) ≢ 0; [eva:alarm] tests/value/div.i:34: Warning: signed overflow. assert -2147483648 ≤ 100 / (int)(&X + 2); [eva:alarm] tests/value/div.i:34: Warning: signed overflow. assert 100 / (int)(&X + 2) ≤ 2147483647; [eva] tests/value/div.i:34: Assigning imprecise value to d2. The imprecision originates from Arithmetic {tests/value/div.i:34} [eva:alarm] tests/value/div.i:35: Warning: signed overflow. assert -2147483648 ≤ 100 / (int)(&X + 1); [eva:alarm] tests/value/div.i:35: Warning: signed overflow. assert 100 / (int)(&X + 1) ≤ 2147483647; [eva] tests/value/div.i:35: Assigning imprecise value to d1. The imprecision originates from Arithmetic {tests/value/div.i:35} [eva:alarm] tests/value/div.i:36: Warning: signed overflow. assert -2147483648 ≤ 100 / (int)(&X); [eva:alarm] tests/value/div.i:36: Warning: signed overflow. assert 100 / (int)(&X) ≤ 2147483647; [eva] tests/value/div.i:36: Assigning imprecise value to d0. The imprecision originates from Arithmetic {tests/value/div.i:36} [eva:alarm] tests/value/div.i:37: Warning: signed overflow. assert -2147483648 ≤ -((int)(&X)); [eva:alarm] tests/value/div.i:37: Warning: signed overflow. assert -((int)(&X)) ≤ 2147483647; [eva] tests/value/div.i:37: Assigning imprecise value to e. The imprecision originates from Arithmetic {tests/value/div.i:37} [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: X ∈ [--..--] Y ∈ [-126..333],9%27 Z1 ∈ [-42..111],3%9 Z2 ∈ [-25..66] T ∈ [34..493],7%27 U1 ∈ [11..164],2%9 U2 ∈ [6..98] V ∈ [-125..334],10%27 W1 ∈ [-41..111] W2 ∈ [-25..66] a ∈ [-40000..40000] b ∈ {{ garbled mix of &{Z2} (origin: Arithmetic {tests/value/div.i:33}) }} d1 ∈ {{ garbled mix of &{X} (origin: Arithmetic {tests/value/div.i:35}) }} d2 ∈ {{ garbled mix of &{X} (origin: Arithmetic {tests/value/div.i:34}) }} d0 ∈ {{ garbled mix of &{X} (origin: Arithmetic {tests/value/div.i:36}) }} e ∈ {{ garbled mix of &{X} (origin: Arithmetic {tests/value/div.i:37}) }} p ∈ {{ &t[3] }} c ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: X FROM X (and SELF) Y FROM X Z1 FROM X Z2 FROM X T FROM X U1 FROM X U2 FROM X V FROM X W1 FROM X W2 FROM X a FROM X b FROM X d1 FROM \nothing d2 FROM \nothing d0 FROM \nothing e FROM \nothing p FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: X; Y; Z1; Z2; T; U1; U2; V; W1; W2; a; b; d1; d2; d0; e; p; c [inout] Inputs for function main: X; Y; Z2; T; V frama-c-20.0-Calcium/tests/value/oracle/div.1.res.oracle0000666000000000000000000001302113571573400017633 0ustar [kernel] Parsing tests/value/div.i (no preprocessing) [rte] annotating function main [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} Y ∈ {0} Z1 ∈ {0} Z2 ∈ {0} T ∈ {0} U1 ∈ {0} U2 ∈ {0} V ∈ {0} W1 ∈ {0} W2 ∈ {0} a ∈ {0} b ∈ {0} d1 ∈ {0} d2 ∈ {0} d0 ∈ {0} e ∈ {0} t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3..4] ∈ {0} p ∈ {0} [eva:alarm] tests/value/div.i:14: Warning: assertion 'rte,signed_overflow' got status unknown. [eva:alarm] tests/value/div.i:14: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva] tests/value/div.i:16: assertion 'rte,signed_overflow' got status valid. [eva:alarm] tests/value/div.i:17: Warning: assertion 'rte,signed_overflow' got status unknown. [eva:alarm] tests/value/div.i:17: Warning: signed overflow. assert c + 2 ≤ 2147483647; [eva] tests/value/div.i:17: assertion 'rte,signed_overflow' got status valid. [eva] tests/value/div.i:14: starting to merge loop iterations [eva:alarm] tests/value/div.i:17: Warning: assertion 'rte,signed_overflow' got status unknown. [eva:alarm] tests/value/div.i:17: Warning: signed overflow. assert -2147483648 ≤ X - 1; [eva:alarm] tests/value/div.i:16: Warning: assertion 'rte,signed_overflow' got status unknown. [eva:alarm] tests/value/div.i:16: Warning: signed overflow. assert X + 1 ≤ 2147483647; [eva] tests/value/div.i:22: assertion 'rte,signed_overflow' got status valid. [eva] tests/value/div.i:25: assertion 'rte,signed_overflow' got status valid. [eva] tests/value/div.i:28: assertion 'rte,signed_overflow' got status valid. [eva:alarm] tests/value/div.i:32: Warning: assertion 'rte,division_by_zero' got status unknown. [eva:alarm] tests/value/div.i:32: Warning: division by zero. assert Z2 ≢ 0; [eva:alarm] tests/value/div.i:33: Warning: assertion 'rte,division_by_zero' got status unknown. [eva:alarm] tests/value/div.i:33: Warning: assertion 'rte,signed_overflow' got status unknown. [eva:alarm] tests/value/div.i:33: Warning: division by zero. assert Z2 ≢ 0; [eva:alarm] tests/value/div.i:33: Warning: signed overflow. assert -2147483648 ≤ (int)(&Z2) / Z2; [eva:alarm] tests/value/div.i:33: Warning: signed overflow. assert (int)(&Z2) / Z2 ≤ 2147483647; [eva] tests/value/div.i:33: Assigning imprecise value to b. The imprecision originates from Arithmetic {tests/value/div.i:33} [eva:alarm] tests/value/div.i:34: Warning: assertion 'rte,division_by_zero' got status unknown. [eva:alarm] tests/value/div.i:34: Warning: division by zero. assert (int)(&X + 2) ≢ 0; [eva:alarm] tests/value/div.i:34: Warning: signed overflow. assert -2147483648 ≤ 100 / (int)(&X + 2); [eva:alarm] tests/value/div.i:34: Warning: signed overflow. assert 100 / (int)(&X + 2) ≤ 2147483647; [eva] tests/value/div.i:34: Assigning imprecise value to d2. The imprecision originates from Arithmetic {tests/value/div.i:34} [eva] tests/value/div.i:35: assertion 'rte,division_by_zero' got status valid. [eva:alarm] tests/value/div.i:35: Warning: signed overflow. assert -2147483648 ≤ 100 / (int)(&X + 1); [eva:alarm] tests/value/div.i:35: Warning: signed overflow. assert 100 / (int)(&X + 1) ≤ 2147483647; [eva] tests/value/div.i:35: Assigning imprecise value to d1. The imprecision originates from Arithmetic {tests/value/div.i:35} [eva] tests/value/div.i:36: assertion 'rte,division_by_zero' got status valid. [eva:alarm] tests/value/div.i:36: Warning: signed overflow. assert -2147483648 ≤ 100 / (int)(&X); [eva:alarm] tests/value/div.i:36: Warning: signed overflow. assert 100 / (int)(&X) ≤ 2147483647; [eva] tests/value/div.i:36: Assigning imprecise value to d0. The imprecision originates from Arithmetic {tests/value/div.i:36} [eva:alarm] tests/value/div.i:37: Warning: assertion 'rte,signed_overflow' got status unknown. [eva:alarm] tests/value/div.i:37: Warning: signed overflow. assert -2147483648 ≤ -((int)(&X)); [eva:alarm] tests/value/div.i:37: Warning: signed overflow. assert -((int)(&X)) ≤ 2147483647; [eva] tests/value/div.i:37: Assigning imprecise value to e. The imprecision originates from Arithmetic {tests/value/div.i:37} [eva] Recording results for main [eva] done for function main [eva] tests/value/div.i:22: assertion 'rte,signed_overflow' got final status valid. [eva] tests/value/div.i:25: assertion 'rte,signed_overflow' got final status valid. [eva] tests/value/div.i:28: assertion 'rte,signed_overflow' got final status valid. [eva] tests/value/div.i:35: assertion 'rte,division_by_zero' got final status valid. [eva] tests/value/div.i:36: assertion 'rte,division_by_zero' got final status valid. [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: X ∈ [--..--] Y ∈ [-126..333],9%27 Z1 ∈ [-42..111],3%9 Z2 ∈ [-25..66] T ∈ [34..493],7%27 U1 ∈ [11..164],2%9 U2 ∈ [6..98] V ∈ [-125..334],10%27 W1 ∈ [-41..111] W2 ∈ [-25..66] a ∈ [-40000..40000] b ∈ {{ garbled mix of &{Z2} (origin: Arithmetic {tests/value/div.i:33}) }} d1 ∈ {{ garbled mix of &{X} (origin: Arithmetic {tests/value/div.i:35}) }} d2 ∈ {{ garbled mix of &{X} (origin: Arithmetic {tests/value/div.i:34}) }} d0 ∈ {{ garbled mix of &{X} (origin: Arithmetic {tests/value/div.i:36}) }} e ∈ {{ garbled mix of &{X} (origin: Arithmetic {tests/value/div.i:37}) }} p ∈ {{ &t[3] }} c ∈ [--..--] frama-c-20.0-Calcium/tests/value/oracle/div_strange.res.oracle0000666000000000000000000000154613571573400021230 0ustar [kernel] Parsing tests/value/div_strange.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/div_strange.i:7: Frama_C_show_each_F: {1073741823} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {1073741823} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/divneg.res.oracle0000666000000000000000000000421713571573400020175 0ustar [kernel] Parsing tests/value/divneg.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ [--..--] r0 ∈ {0} r1 ∈ {6} r2 ∈ {-8} r6 ∈ {0} r7 ∈ {0} r8 ∈ {0} r9 ∈ {0} rn1 ∈ {5} rn2 ∈ {0} rn3 ∈ {0} rn4 ∈ {-3} rn5 ∈ {0} vic ∈ {0} [eva] tests/value/divneg.i:13: Frama_C_show_each: [-185..-5],4%9, [1..61],1%3 [eva] tests/value/divneg.i:42: Frama_C_dump_each: # Cvalue domain: i ∈ [-100..100] r0 ∈ [-100..100],0%5 r1 ∈ [1..96],1%5 r2 ∈ [-98..-3],2%5 r6 ∈ {0} r7 ∈ [-100..100] r8 ∈ [-100..100] r9 ∈ {0} rn1 ∈ [-99..99],1%2 rn2 ∈ [-100..100],0%2 rn3 ∈ [-100..100],0%2 rn4 ∈ [-99..99],1%2 rn5 ∈ [-100..99] vic ∈ {0} c ∈ [-185..-5],4%9 rc ∈ [-176..-14],4%18 or UNINITIALIZED __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/divneg.i:52: Frama_C_show_each_should: {-1} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: r0 ∈ [-100..100],0%5 r1 ∈ [1..96],1%5 r2 ∈ [-98..-3],2%5 r7 ∈ [-100..100] r8 ∈ [-100..100] rn1 ∈ [-99..99],1%2 rn2 ∈ [-100..100],0%2 rn3 ∈ [-100..100],0%2 rn4 ∈ [-99..99],1%2 rn5 ∈ [-100..99] vic ∈ {4294967295} c ∈ [5..185],5%9 rc ∈ [14..176],14%18 __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: r0 FROM i (and SELF) r1 FROM i (and SELF) r2 FROM i (and SELF) r7 FROM i (and SELF) r8 FROM i (and SELF) rn1 FROM i (and SELF) rn2 FROM i (and SELF) rn3 FROM i (and SELF) rn4 FROM i (and SELF) rn5 FROM i (and SELF) vic FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: r0; r1; r2; r7; r8; rn1; rn2; rn3; rn4; rn5; vic; c; rc; __retres [inout] Inputs for function main: i; vic frama-c-20.0-Calcium/tests/value/oracle/domains.res.oracle0000666000000000000000000000163413571573400020353 0ustar [kernel] Parsing tests/value/domains.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/domains.i:19: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {8} b ∈ [--..--] i ∈ [1..2147483647] k ∈ {12} r ∈ {1} t[0..1] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b; i; k; r; t[0..1] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/downcast.res.oracle0000666000000000000000000017005313571573400020545 0ustar [kernel] Parsing tests/value/downcast.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization sx ∈ [--..--] sy ∈ [--..--] sz ∈ [--..--] uc ∈ [--..--] x ∈ [--..--] ux ∈ [--..--] uy ∈ [--..--] uz ∈ [--..--] s ∈ [--..--] v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/downcast.i:152. [eva:alarm] tests/value/downcast.i:19: Warning: signed downcast. assert -128 ≤ (int)sx + (int)sy; [eva:alarm] tests/value/downcast.i:19: Warning: signed downcast. assert (int)sx + (int)sy ≤ 127; [eva:alarm] tests/value/downcast.i:22: Warning: signed downcast. assert uy + uz ≤ 2147483647; [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2_bitfield <- main. Called from tests/value/downcast.i:153. [eva:alarm] tests/value/downcast.i:32: Warning: signed downcast. assert i ≤ 15; [eva] Recording results for main2_bitfield [eva] Done for function main2_bitfield [eva] computing for function main3_reduction <- main. Called from tests/value/downcast.i:154. [eva:alarm] tests/value/downcast.i:38: Warning: signed downcast. assert -128 ≤ x_0; [eva:alarm] tests/value/downcast.i:38: Warning: signed downcast. assert x_0 ≤ 127; [eva] Recording results for main3_reduction [eva] Done for function main3_reduction [eva] computing for function main4_pointer <- main. Called from tests/value/downcast.i:155. [eva:alarm] tests/value/downcast.i:50: Warning: signed overflow. assert -9223372036854775808 ≤ p + (long long)100; [eva:alarm] tests/value/downcast.i:50: Warning: signed overflow. assert p + (long long)100 ≤ 9223372036854775807; [eva:alarm] tests/value/downcast.i:52: Warning: signed downcast. assert -2147483648 ≤ p; [eva:alarm] tests/value/downcast.i:52: Warning: signed downcast. assert p ≤ 2147483647; [eva] Recording results for main4_pointer [eva] Done for function main4_pointer [eva] computing for function main5_wrap_signed <- main. Called from tests/value/downcast.i:156. [eva:alarm] tests/value/downcast.i:58: Warning: assertion 'ASSUME' got status unknown. [eva] tests/value/downcast.i:59: assertion got status valid. [eva:alarm] tests/value/downcast.i:62: Warning: signed downcast. assert y ≤ 2147483647; [eva] tests/value/downcast.i:63: Frama_C_show_each: [100000..2147483647], [100145..2147483647], [100145..2147483647] [eva] tests/value/downcast.i:64: assertion got status valid. [eva] Recording results for main5_wrap_signed [eva] Done for function main5_wrap_signed [eva] computing for function main6_val_warn_converted_signed <- main. Called from tests/value/downcast.i:157. [eva:alarm] tests/value/downcast.i:71: Warning: signed downcast. assert 65300u ≤ 32767; [eva:alarm] tests/value/downcast.i:82: Warning: signed downcast. assert e_0 ≤ 32767; [eva:alarm] tests/value/downcast.i:87: Warning: signed downcast. assert e_1 ≤ 32767; [eva:alarm] tests/value/downcast.i:91: Warning: signed downcast. assert p ≤ 2147483647; [eva:alarm] tests/value/downcast.i:92: Warning: signed downcast. assert p ≤ 32767; [eva] tests/value/downcast.i:93: Assigning imprecise value to z. The imprecision originates from Arithmetic {tests/value/downcast.i:93} [eva] Recording results for main6_val_warn_converted_signed [eva] Done for function main6_val_warn_converted_signed [eva] computing for function main7_signed_upcast <- main. Called from tests/value/downcast.i:158. [eva] Recording results for main7_signed_upcast [eva] Done for function main7_signed_upcast [eva] computing for function main8_bitfields <- main. Called from tests/value/downcast.i:159. [eva:alarm] tests/value/downcast.i:114: Warning: signed downcast. assert S.i1 ≤ 31; [eva:alarm] tests/value/downcast.i:115: Warning: signed downcast. assert S.i1 ≤ 127; [eva:alarm] tests/value/downcast.i:119: Warning: signed downcast. assert S.i1 ≤ 31; [eva:alarm] tests/value/downcast.i:120: Warning: signed downcast. assert S.i1 ≤ 127; [eva:alarm] tests/value/downcast.i:124: Warning: signed downcast. assert S.i1 ≤ 31; [eva] Recording results for main8_bitfields [eva] Done for function main8_bitfields [eva] computing for function main9_bitfield <- main. Called from tests/value/downcast.i:160. [eva:alarm] tests/value/downcast.i:133: Warning: signed downcast. assert bf.a ≤ 1023; [eva:alarm] tests/value/downcast.i:137: Warning: signed downcast. assert bf.a ≤ 127; [eva] Recording results for main9_bitfield [eva] Done for function main9_bitfield [eva] computing for function main10_loop <- main. Called from tests/value/downcast.i:161. [eva:alarm] tests/value/downcast.i:147: Warning: signed downcast. assert bf.b ≤ 127; [eva] tests/value/downcast.i:145: starting to merge loop iterations [eva] Recording results for main10_loop [eva] Done for function main10_loop [eva] Recording results for main [eva] done for function main [eva] tests/value/downcast.i:32: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:71: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:82: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:87: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:114: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:115: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:119: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:120: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:124: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:133: assertion 'Eva,signed_downcast' got final status invalid. [eva] tests/value/downcast.i:137: assertion 'Eva,signed_downcast' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: sz ∈ [--..--] uc ∈ [--..--] x ∈ [0..2147483647] ux ∈ [--..--] s ∈ [--..--] [eva:final-states] Values at end of function main10_loop: c ∈ [0..127] or UNINITIALIZED bf.b ∈ [--..--] or UNINITIALIZED .[bits 10 to 31] ∈ UNINITIALIZED k ∈ {10} [eva:final-states] Values at end of function main2_bitfield: i ∈ {117} j ∈ {254} ss.i ∈ UNINITIALIZED .j ∈ {30} or UNINITIALIZED .[bits 10 to 31] ∈ UNINITIALIZED [eva:final-states] Values at end of function main3_reduction: x_0 ∈ [-128..127] c ∈ [--..--] y ∈ [--..--] d ∈ [--..--] [eva:final-states] Values at end of function main4_pointer: p ∈ {{ &x_0 + {100} }} q ∈ {{ &x_0 + {100} }} r ∈ {{ &x_0 + {100} }} [eva:final-states] Values at end of function main5_wrap_signed: x_0 ∈ [100000..2147483647] y ∈ [100145..2147483647] z ∈ [100145..2147483647] [eva:final-states] Values at end of function main6_val_warn_converted_signed: [eva:final-states] Values at end of function main7_signed_upcast: c ∈ {240} i ∈ {240} [eva:final-states] Values at end of function main8_bitfields: S.i1 ∈ {65} {.i2; .[bits 24 to 31]} ∈ UNINITIALIZED c ∈ {65} or UNINITIALIZED [eva:final-states] Values at end of function main9_bitfield: bf.a ∈ {1648} .[bits 11 to 31] ∈ UNINITIALIZED c ∈ UNINITIALIZED [eva:final-states] Values at end of function main: sz ∈ [--..--] uc ∈ [--..--] x ∈ [0..2147483647] ux ∈ [--..--] s ∈ [--..--] [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main10_loop [from] Done for function main10_loop [from] Computing for function main2_bitfield [from] Done for function main2_bitfield [from] Computing for function main3_reduction [from] Done for function main3_reduction [from] Computing for function main4_pointer [from] Done for function main4_pointer [from] Computing for function main5_wrap_signed [from] Done for function main5_wrap_signed [from] Computing for function main6_val_warn_converted_signed [from] Done for function main6_val_warn_converted_signed [from] Computing for function main7_signed_upcast [from] Done for function main7_signed_upcast [from] Computing for function main8_bitfields [from] Done for function main8_bitfields [from] Computing for function main9_bitfield [from] Done for function main9_bitfield [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: sz FROM sx; sy uc FROM x x FROM uy; uz ux FROM uy; uz s FROM uy; uz [from] Function main10_loop: NO EFFECTS [from] Function main2_bitfield: NO EFFECTS [from] Function main3_reduction: NO EFFECTS [from] Function main4_pointer: NO EFFECTS [from] Function main5_wrap_signed: NO EFFECTS [from] Function main6_val_warn_converted_signed: NO EFFECTS [from] Function main7_signed_upcast: NO EFFECTS [from] Function main8_bitfields: NO EFFECTS [from] Function main9_bitfield: NO EFFECTS [from] Function main: sz FROM sx; sy uc FROM x x FROM uy; uz ux FROM uy; uz s FROM uy; uz [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: sz; uc; x; ux; s [inout] Inputs for function main1: sx; sy; x; uy; uz [inout] Out (internal) for function main10_loop: c; bf.b; k [inout] Inputs for function main10_loop: v [inout] Out (internal) for function main2_bitfield: i; j; ss{.i; .j} [inout] Inputs for function main2_bitfield: v [inout] Out (internal) for function main3_reduction: x_0; c; y; d [inout] Inputs for function main3_reduction: v [inout] Out (internal) for function main4_pointer: p; q; r [inout] Inputs for function main4_pointer: \nothing [inout] Out (internal) for function main5_wrap_signed: x_0; y; z [inout] Inputs for function main5_wrap_signed: v [inout] Out (internal) for function main6_val_warn_converted_signed: s_0; u; e; b; e_0; b_0; e_1; b_1; p; x_0; y; z [inout] Inputs for function main6_val_warn_converted_signed: v [inout] Out (internal) for function main7_signed_upcast: c; i [inout] Inputs for function main7_signed_upcast: \nothing [inout] Out (internal) for function main8_bitfields: S{.i1; .i2}; c [inout] Inputs for function main8_bitfields: v [inout] Out (internal) for function main9_bitfield: bf.a; signed_a; c [inout] Inputs for function main9_bitfield: v [inout] Out (internal) for function main: sz; uc; x; ux; s [inout] Inputs for function main: sx; sy; x; uy; uz; v [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main1' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 19) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 19) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 22) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main2_bitfield' -------------------------------------------------------------------------------- [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 32) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 32) -------------------------------------------------------------------------------- --- Properties of Function 'main3_reduction' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 38) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 38) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main4_pointer' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_overflow' (file tests/value/downcast.i, line 50) tried with Eva. [ - ] Assertion 'Eva,signed_overflow' (file tests/value/downcast.i, line 50) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 52) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 52) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main5_wrap_signed' -------------------------------------------------------------------------------- [ - ] Assertion 'ASSUME' (file tests/value/downcast.i, line 58) tried with Eva. [ Valid ] Assertion (file tests/value/downcast.i, line 59) by Eva. [ Valid ] Assertion (file tests/value/downcast.i, line 64) by Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 62) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main6_val_warn_converted_signed' -------------------------------------------------------------------------------- [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 71) By Eva, with pending: - Unreachable initialization of 's_0' (file tests/value/downcast.i, line 71) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 82) By Eva, with pending: - Unreachable initialization of 'b_0' (file tests/value/downcast.i, line 82) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 87) By Eva, with pending: - Unreachable initialization of 'b_1' (file tests/value/downcast.i, line 87) [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 91) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 92) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main8_bitfields' -------------------------------------------------------------------------------- [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 114) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 114) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 115) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 115) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 119) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 119) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 120) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 120) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 124) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 124) -------------------------------------------------------------------------------- --- Properties of Function 'main9_bitfield' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/value/downcast.i, line 134) Locally valid, but unreachable. By Eva because: - Unreachable program point (file tests/value/downcast.i, line 134) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 133) By Eva, with pending: - Unreachable initialization of 'signed_a' (file tests/value/downcast.i, line 133) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 137) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 137) [Unreachable] Unreachable program point (file tests/value/downcast.i, line 134) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main10_loop' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 147) tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 14 To be validated 11 Alarms emitted 1 Dead property 1 Unreachable 29 Total -------------------------------------------------------------------------------- /* Generated by Frama-C */ struct s { int i : 5 ; unsigned int j : 5 ; }; struct bitf { unsigned int i1 : 18 ; int i2 : 6 ; }; struct __anonstruct_bf_1 { unsigned int a : 11 ; }; struct __anonstruct_bf_2 { unsigned int b : 10 ; }; signed char sx; signed char sy; signed char sz; unsigned char uc; int x; unsigned int ux; unsigned int uy; unsigned int uz; unsigned short s; int volatile v; void main1(void) { /*@ assert Eva: signed_downcast: -128 ≤ (int)sx + (int)sy; */ /*@ assert Eva: signed_downcast: (int)sx + (int)sy ≤ 127; */ sz = (signed char)((int)sx + (int)sy); uc = (unsigned char)((int)sx + (int)sy); uc = (unsigned char)x; /*@ assert Eva: signed_downcast: uy + uz ≤ 2147483647; */ x = (int)(uy + uz); ux = uy + uz; s = (unsigned short)(uy + uz); return; } void main2_bitfield(void) { struct s ss; int i = 117; unsigned int j = (unsigned int)254; if (v) /*@ assert Eva: signed_downcast: i ≤ 15; */ ss.i = (int)i; if (v) ss.j = (unsigned int)j; return; } void main3_reduction(void) { int x_0 = v; /*@ assert Eva: signed_downcast: -128 ≤ x_0; */ /*@ assert Eva: signed_downcast: x_0 ≤ 127; */ char c = (char)x_0; unsigned int y = (unsigned int)v; unsigned char d = (unsigned char)y; return; } void main4_pointer(void) { int x_0; long long p = (long long)(& x_0); /*@ assert Eva: signed_overflow: -9223372036854775808 ≤ p + (long long)100; */ /*@ assert Eva: signed_overflow: p + (long long)100 ≤ 9223372036854775807; */ p += (long long)100; unsigned int q = (unsigned int)p; /*@ assert Eva: signed_downcast: -2147483648 ≤ p; */ /*@ assert Eva: signed_downcast: p ≤ 2147483647; */ int r = (int)p; return; } /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each)(); void main5_wrap_signed(void) { int x_0 = v; /*@ assert ASSUME: x_0 ≥ 100000; */ ; /*@ assert x_0 > 0x7FFFFFFF - 145 ∨ x_0 ≤ 0x7FFFFFFF - 145; */ ; unsigned int y = (unsigned int)x_0; y += (unsigned int)145; /*@ assert Eva: signed_downcast: y ≤ 2147483647; */ int z = (int)y; Frama_C_show_each(x_0,y,z); /*@ assert z ≥ 100000 + 145 ∨ z ≤ (int)(0x7FFFFFFF + 145); */ ; return; } void main6_val_warn_converted_signed(void) { if (v) { /*@ assert Eva: signed_downcast: 65300u ≤ 32767; */ short s_0 = (short)65300u; } if (v) { unsigned short u = (unsigned short)65300u; } if (v) { unsigned long e = (unsigned long)17; short b = (short)e; } if (v) { unsigned long e_0 = (unsigned long)(-12); /*@ assert Eva: signed_downcast: e_0 ≤ 32767; */ short b_0 = (short)e_0; } if (v) { unsigned int e_1 = (unsigned int)(-64000); /*@ assert Eva: signed_downcast: e_1 ≤ 32767; */ short b_1 = (short)e_1; } if (v) { int *p = (int *)(& v); /*@ assert Eva: signed_downcast: p ≤ 2147483647; */ int x_0 = (int)p; /*@ assert Eva: signed_downcast: p ≤ 32767; */ short y = (short)p; unsigned short z = (unsigned short)p; } return; } void main7_signed_upcast(void) { unsigned char c = (unsigned char)240; int i = (int)c; return; } void main8_bitfields(void) { struct bitf S; signed char c; S.i1 = (unsigned int)0x3FFFF; if (v) /*@ assert Eva: signed_downcast: S.i1 ≤ 31; */ S.i2 = (int)S.i1; if (v) /*@ assert Eva: signed_downcast: S.i1 ≤ 127; */ c = (signed char)S.i1; S.i1 = (unsigned int)257u; if (v) /*@ assert Eva: signed_downcast: S.i1 ≤ 31; */ S.i2 = (int)S.i1; if (v) /*@ assert Eva: signed_downcast: S.i1 ≤ 127; */ c = (signed char)S.i1; S.i1 = (unsigned int)65u; if (v) /*@ assert Eva: signed_downcast: S.i1 ≤ 31; */ S.i2 = (int)S.i1; if (v) c = (signed char)S.i1; return; } void main9_bitfield(void) { struct __anonstruct_bf_1 bf; signed char c; bf.a = (unsigned int)1648; if (v) { /*@ assert Eva: signed_downcast: bf.a ≤ 1023; */ int signed_a = (int)((int)bf.a); /*@ assert signed_a ≡ -400; */ ; } if (v) /*@ assert Eva: signed_downcast: bf.a ≤ 127; */ c = (signed char)bf.a; return; } void main10_loop(void) { signed char c; struct __anonstruct_bf_2 bf; int k = 0; while (k < 10) { bf.b = (unsigned int)v; if (v) /*@ assert Eva: signed_downcast: bf.b ≤ 127; */ c = (signed char)bf.b; k ++; } return; } void main(void) { main1(); main2_bitfield(); main3_reduction(); main4_pointer(); main5_wrap_signed(); main6_val_warn_converted_signed(); main7_signed_upcast(); main8_bitfields(); main9_bitfield(); main10_loop(); return; } [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization sx ∈ [--..--] sy ∈ [--..--] sz ∈ [--..--] uc ∈ [--..--] x ∈ [--..--] ux ∈ [--..--] uy ∈ [--..--] uz ∈ [--..--] s ∈ [--..--] v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/downcast.i:152. [eva:alarm] tests/value/downcast.i:20: Warning: unsigned downcast. assert 0 ≤ (int)sx + (int)sy; [eva:alarm] tests/value/downcast.i:21: Warning: unsigned downcast. assert 0 ≤ x; [eva:alarm] tests/value/downcast.i:21: Warning: unsigned downcast. assert x ≤ 255; [eva:alarm] tests/value/downcast.i:24: Warning: unsigned downcast. assert uy + uz ≤ 65535; [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2_bitfield <- main. Called from tests/value/downcast.i:153. [eva:alarm] tests/value/downcast.i:33: Warning: unsigned downcast. assert j ≤ 31; [eva] Recording results for main2_bitfield [eva] Done for function main2_bitfield [eva] computing for function main3_reduction <- main. Called from tests/value/downcast.i:154. [eva:alarm] tests/value/downcast.i:40: Warning: unsigned downcast. assert 0 ≤ v; [eva:alarm] tests/value/downcast.i:41: Warning: unsigned downcast. assert y ≤ 255; [eva] Recording results for main3_reduction [eva] Done for function main3_reduction [eva] computing for function main4_pointer <- main. Called from tests/value/downcast.i:155. [eva:alarm] tests/value/downcast.i:50: Warning: signed overflow. assert -9223372036854775808 ≤ p + (long long)100; [eva:alarm] tests/value/downcast.i:50: Warning: signed overflow. assert p + (long long)100 ≤ 9223372036854775807; [eva:alarm] tests/value/downcast.i:51: Warning: unsigned downcast. assert 0 ≤ p; [eva:alarm] tests/value/downcast.i:51: Warning: unsigned downcast. assert p ≤ 4294967295; [eva] Recording results for main4_pointer [eva] Done for function main4_pointer [eva] computing for function main5_wrap_signed <- main. Called from tests/value/downcast.i:156. [eva] tests/value/downcast.i:63: Frama_C_show_each: [100000..2147483647], [100145..2147483792], [-2147483648..2147483647] [eva:alarm] tests/value/downcast.i:64: Warning: assertion got status unknown. [eva] Recording results for main5_wrap_signed [eva] Done for function main5_wrap_signed [eva] computing for function main6_val_warn_converted_signed <- main. Called from tests/value/downcast.i:157. [eva:alarm] tests/value/downcast.i:81: Warning: unsigned downcast. assert 0 ≤ -12; [eva:alarm] tests/value/downcast.i:86: Warning: unsigned downcast. assert 0 ≤ -64000; [eva] tests/value/downcast.i:92: Assigning imprecise value to y. The imprecision originates from Arithmetic {tests/value/downcast.i:92} [eva:alarm] tests/value/downcast.i:93: Warning: unsigned downcast. assert p ≤ 65535; [eva] Recording results for main6_val_warn_converted_signed [eva] Done for function main6_val_warn_converted_signed [eva] computing for function main7_signed_upcast <- main. Called from tests/value/downcast.i:158. [eva] Recording results for main7_signed_upcast [eva] Done for function main7_signed_upcast [eva] computing for function main8_bitfields <- main. Called from tests/value/downcast.i:159. [eva] Recording results for main8_bitfields [eva] Done for function main8_bitfields [eva] computing for function main9_bitfield <- main. Called from tests/value/downcast.i:160. [eva] tests/value/downcast.i:134: assertion got status valid. [eva] Recording results for main9_bitfield [eva] Done for function main9_bitfield [eva] computing for function main10_loop <- main. Called from tests/value/downcast.i:161. [eva:alarm] tests/value/downcast.i:146: Warning: unsigned downcast. assert 0 ≤ v; [eva:alarm] tests/value/downcast.i:146: Warning: unsigned downcast. assert v ≤ 1023; [eva] Recording results for main10_loop [eva] Done for function main10_loop [eva] Recording results for main [eva] done for function main [eva] tests/value/downcast.i:33: assertion 'Eva,unsigned_downcast' got final status invalid. [eva] tests/value/downcast.i:81: assertion 'Eva,unsigned_downcast' got final status invalid. [eva] tests/value/downcast.i:86: assertion 'Eva,unsigned_downcast' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: sz ∈ [--..--] uc ∈ [--..--] x ∈ [--..--] ux ∈ [--..--] s ∈ [--..--] [eva:final-states] Values at end of function main10_loop: c ∈ [--..--] or UNINITIALIZED bf.b ∈ [--..--] or UNINITIALIZED .[bits 10 to 31] ∈ UNINITIALIZED k ∈ {10} [eva:final-states] Values at end of function main2_bitfield: i ∈ {117} j ∈ {254} ss.i ∈ {-11} or UNINITIALIZED {.j; .[bits 10 to 31]} ∈ UNINITIALIZED [eva:final-states] Values at end of function main3_reduction: x_0 ∈ [--..--] c ∈ [--..--] y ∈ [0..255] d ∈ [--..--] [eva:final-states] Values at end of function main4_pointer: p ∈ {{ &x_0 + {100} }} q ∈ {{ &x_0 + {100} }} r ∈ {{ &x_0 + {100} }} [eva:final-states] Values at end of function main5_wrap_signed: x_0 ∈ [100000..2147483647] y ∈ [100145..2147483792] z ∈ [--..--] [eva:final-states] Values at end of function main6_val_warn_converted_signed: [eva:final-states] Values at end of function main7_signed_upcast: c ∈ {240} i ∈ {240} [eva:final-states] Values at end of function main8_bitfields: S.i1 ∈ {65} .i2 ∈ {-1; 1} or UNINITIALIZED .[bits 24 to 31] ∈ UNINITIALIZED c ∈ {-1; 1; 65} or UNINITIALIZED [eva:final-states] Values at end of function main9_bitfield: bf.a ∈ {1648} .[bits 11 to 31] ∈ UNINITIALIZED c ∈ {112} or UNINITIALIZED [eva:final-states] Values at end of function main: sz ∈ [--..--] uc ∈ [--..--] x ∈ [--..--] ux ∈ [--..--] s ∈ [--..--] [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main10_loop [from] Done for function main10_loop [from] Computing for function main2_bitfield [from] Done for function main2_bitfield [from] Computing for function main3_reduction [from] Done for function main3_reduction [from] Computing for function main4_pointer [from] Done for function main4_pointer [from] Computing for function main5_wrap_signed [from] Done for function main5_wrap_signed [from] Computing for function main6_val_warn_converted_signed [from] Done for function main6_val_warn_converted_signed [from] Computing for function main7_signed_upcast [from] Done for function main7_signed_upcast [from] Computing for function main8_bitfields [from] Done for function main8_bitfields [from] Computing for function main9_bitfield [from] Done for function main9_bitfield [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: sz FROM sx; sy uc FROM x x FROM uy; uz ux FROM uy; uz s FROM uy; uz [from] Function main10_loop: NO EFFECTS [from] Function main2_bitfield: NO EFFECTS [from] Function main3_reduction: NO EFFECTS [from] Function main4_pointer: NO EFFECTS [from] Function main5_wrap_signed: NO EFFECTS [from] Function main6_val_warn_converted_signed: NO EFFECTS [from] Function main7_signed_upcast: NO EFFECTS [from] Function main8_bitfields: NO EFFECTS [from] Function main9_bitfield: NO EFFECTS [from] Function main: sz FROM sx; sy uc FROM x x FROM uy; uz ux FROM uy; uz s FROM uy; uz [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: sz; uc; x; ux; s [inout] Inputs for function main1: sx; sy; x; uy; uz [inout] Out (internal) for function main10_loop: c; bf.b; k [inout] Inputs for function main10_loop: v [inout] Out (internal) for function main2_bitfield: i; j; ss{.i; .j} [inout] Inputs for function main2_bitfield: v [inout] Out (internal) for function main3_reduction: x_0; c; y; d [inout] Inputs for function main3_reduction: v [inout] Out (internal) for function main4_pointer: p; q; r [inout] Inputs for function main4_pointer: \nothing [inout] Out (internal) for function main5_wrap_signed: x_0; y; z [inout] Inputs for function main5_wrap_signed: v [inout] Out (internal) for function main6_val_warn_converted_signed: s_0; u; e; b; e_0; e_1; p; x_0; y; z [inout] Inputs for function main6_val_warn_converted_signed: v [inout] Out (internal) for function main7_signed_upcast: c; i [inout] Inputs for function main7_signed_upcast: \nothing [inout] Out (internal) for function main8_bitfields: S{.i1; .i2}; c [inout] Inputs for function main8_bitfields: v [inout] Out (internal) for function main9_bitfield: bf.a; signed_a; c [inout] Inputs for function main9_bitfield: v [inout] Out (internal) for function main: sz; uc; x; ux; s [inout] Inputs for function main: sx; sy; x; uy; uz; v [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main1' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 20) tried with Eva. [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 21) tried with Eva. [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 21) tried with Eva. [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 24) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main2_bitfield' -------------------------------------------------------------------------------- [ Alarm ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 33) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 33) -------------------------------------------------------------------------------- --- Properties of Function 'main3_reduction' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 40) tried with Eva. [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 41) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main4_pointer' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_overflow' (file tests/value/downcast.i, line 50) tried with Eva. [ - ] Assertion 'Eva,signed_overflow' (file tests/value/downcast.i, line 50) tried with Eva. [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 51) tried with Eva. [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 51) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main5_wrap_signed' -------------------------------------------------------------------------------- [ - ] Assertion 'ASSUME' (file tests/value/downcast.i, line 58) tried with Eva. [ Valid ] Assertion (file tests/value/downcast.i, line 59) by Eva. [ - ] Assertion (file tests/value/downcast.i, line 64) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main6_val_warn_converted_signed' -------------------------------------------------------------------------------- [ Alarm ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 81) By Eva, with pending: - Unreachable initialization of 'e_0' (file tests/value/downcast.i, line 81) [ Alarm ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 86) By Eva, with pending: - Unreachable initialization of 'e_1' (file tests/value/downcast.i, line 86) [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 93) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main9_bitfield' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/value/downcast.i, line 134) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main10_loop' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 146) tried with Eva. [ - ] Assertion 'Eva,unsigned_downcast' (file tests/value/downcast.i, line 146) tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 15 To be validated 3 Alarms emitted 20 Total -------------------------------------------------------------------------------- /* Generated by Frama-C */ struct s { int i : 5 ; unsigned int j : 5 ; }; struct bitf { unsigned int i1 : 18 ; int i2 : 6 ; }; struct __anonstruct_bf_1 { unsigned int a : 11 ; }; struct __anonstruct_bf_2 { unsigned int b : 10 ; }; signed char sx; signed char sy; signed char sz; unsigned char uc; int x; unsigned int ux; unsigned int uy; unsigned int uz; unsigned short s; int volatile v; void main1(void) { sz = (signed char)((int)sx + (int)sy); /*@ assert Eva: unsigned_downcast: 0 ≤ (int)sx + (int)sy; */ uc = (unsigned char)((int)sx + (int)sy); /*@ assert Eva: unsigned_downcast: 0 ≤ x; */ /*@ assert Eva: unsigned_downcast: x ≤ 255; */ uc = (unsigned char)x; x = (int)(uy + uz); ux = uy + uz; /*@ assert Eva: unsigned_downcast: uy + uz ≤ 65535; */ s = (unsigned short)(uy + uz); return; } void main2_bitfield(void) { struct s ss; int i = 117; unsigned int j = (unsigned int)254; if (v) ss.i = (int)i; if (v) /*@ assert Eva: unsigned_downcast: j ≤ 31; */ ss.j = (unsigned int)j; return; } void main3_reduction(void) { int x_0 = v; char c = (char)x_0; /*@ assert Eva: unsigned_downcast: 0 ≤ v; */ unsigned int y = (unsigned int)v; /*@ assert Eva: unsigned_downcast: y ≤ 255; */ unsigned char d = (unsigned char)y; return; } void main4_pointer(void) { int x_0; long long p = (long long)(& x_0); /*@ assert Eva: signed_overflow: -9223372036854775808 ≤ p + (long long)100; */ /*@ assert Eva: signed_overflow: p + (long long)100 ≤ 9223372036854775807; */ p += (long long)100; /*@ assert Eva: unsigned_downcast: 0 ≤ p; */ /*@ assert Eva: unsigned_downcast: p ≤ 4294967295; */ unsigned int q = (unsigned int)p; int r = (int)p; return; } /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each)(); void main5_wrap_signed(void) { int x_0 = v; /*@ assert ASSUME: x_0 ≥ 100000; */ ; /*@ assert x_0 > 0x7FFFFFFF - 145 ∨ x_0 ≤ 0x7FFFFFFF - 145; */ ; unsigned int y = (unsigned int)x_0; y += (unsigned int)145; int z = (int)y; Frama_C_show_each(x_0,y,z); /*@ assert z ≥ 100000 + 145 ∨ z ≤ (int)(0x7FFFFFFF + 145); */ ; return; } void main6_val_warn_converted_signed(void) { if (v) { short s_0 = (short)65300u; } if (v) { unsigned short u = (unsigned short)65300u; } if (v) { unsigned long e = (unsigned long)17; short b = (short)e; } if (v) { /*@ assert Eva: unsigned_downcast: 0 ≤ -12; */ unsigned long e_0 = (unsigned long)(-12); short b_0 = (short)e_0; } if (v) { /*@ assert Eva: unsigned_downcast: 0 ≤ -64000; */ unsigned int e_1 = (unsigned int)(-64000); short b_1 = (short)e_1; } if (v) { int *p = (int *)(& v); int x_0 = (int)p; short y = (short)p; /*@ assert Eva: unsigned_downcast: p ≤ 65535; */ unsigned short z = (unsigned short)p; } return; } void main7_signed_upcast(void) { unsigned char c = (unsigned char)240; int i = (int)c; return; } void main8_bitfields(void) { struct bitf S; signed char c; S.i1 = (unsigned int)0x3FFFF; if (v) S.i2 = (int)S.i1; if (v) c = (signed char)S.i1; S.i1 = (unsigned int)257u; if (v) S.i2 = (int)S.i1; if (v) c = (signed char)S.i1; S.i1 = (unsigned int)65u; if (v) S.i2 = (int)S.i1; if (v) c = (signed char)S.i1; return; } void main9_bitfield(void) { struct __anonstruct_bf_1 bf; signed char c; bf.a = (unsigned int)1648; if (v) { int signed_a = (int)((int)bf.a); /*@ assert signed_a ≡ -400; */ ; } if (v) c = (signed char)bf.a; return; } void main10_loop(void) { signed char c; struct __anonstruct_bf_2 bf; int k = 0; while (k < 10) { /*@ assert Eva: unsigned_downcast: 0 ≤ v; */ /*@ assert Eva: unsigned_downcast: v ≤ 1023; */ bf.b = (unsigned int)v; if (v) c = (signed char)bf.b; k ++; } return; } void main(void) { main1(); main2_bitfield(); main3_reduction(); main4_pointer(); main5_wrap_signed(); main6_val_warn_converted_signed(); main7_signed_upcast(); main8_bitfields(); main9_bitfield(); main10_loop(); return; } [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization sx ∈ [--..--] sy ∈ [--..--] sz ∈ [--..--] uc ∈ [--..--] x ∈ [--..--] ux ∈ [--..--] uy ∈ [--..--] uz ∈ [--..--] s ∈ [--..--] v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/downcast.i:152. [eva:alarm] tests/value/downcast.i:19: Warning: signed downcast. assert -128 ≤ (int)sx + (int)sy; [eva:alarm] tests/value/downcast.i:19: Warning: signed downcast. assert (int)sx + (int)sy ≤ 127; [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2_bitfield <- main. Called from tests/value/downcast.i:153. [eva:alarm] tests/value/downcast.i:32: Warning: signed downcast. assert i ≤ 15; [eva] Recording results for main2_bitfield [eva] Done for function main2_bitfield [eva] computing for function main3_reduction <- main. Called from tests/value/downcast.i:154. [eva:alarm] tests/value/downcast.i:38: Warning: signed downcast. assert -128 ≤ x_0; [eva:alarm] tests/value/downcast.i:38: Warning: signed downcast. assert x_0 ≤ 127; [eva] Recording results for main3_reduction [eva] Done for function main3_reduction [eva] computing for function main4_pointer <- main. Called from tests/value/downcast.i:155. [eva:alarm] tests/value/downcast.i:50: Warning: signed overflow. assert -9223372036854775808 ≤ p + (long long)100; [eva:alarm] tests/value/downcast.i:50: Warning: signed overflow. assert p + (long long)100 ≤ 9223372036854775807; [eva:alarm] tests/value/downcast.i:52: Warning: signed downcast. assert -2147483648 ≤ p; [eva:alarm] tests/value/downcast.i:52: Warning: signed downcast. assert p ≤ 2147483647; [eva] Recording results for main4_pointer [eva] Done for function main4_pointer [eva] computing for function main5_wrap_signed <- main. Called from tests/value/downcast.i:156. [eva] tests/value/downcast.i:63: Frama_C_show_each: [100000..2147483647], [100145..2147483792], [-2147483648..2147483647] [eva] Recording results for main5_wrap_signed [eva] Done for function main5_wrap_signed [eva] computing for function main6_val_warn_converted_signed <- main. Called from tests/value/downcast.i:157. [eva:alarm] tests/value/downcast.i:71: Warning: signed downcast. assert (int)65300u ≤ 32767; [eva:alarm] tests/value/downcast.i:87: Warning: signed downcast. assert -32768 ≤ (int)e_1; [eva:alarm] tests/value/downcast.i:92: Warning: signed downcast. assert -32768 ≤ (int)p; [eva:alarm] tests/value/downcast.i:92: Warning: signed downcast. assert (int)p ≤ 32767; [eva] Recording results for main6_val_warn_converted_signed [eva] Done for function main6_val_warn_converted_signed [eva] computing for function main7_signed_upcast <- main. Called from tests/value/downcast.i:158. [eva] Recording results for main7_signed_upcast [eva] Done for function main7_signed_upcast [eva] computing for function main8_bitfields <- main. Called from tests/value/downcast.i:159. [eva:alarm] tests/value/downcast.i:119: Warning: signed downcast. assert (int)S.i1 ≤ 31; [eva:alarm] tests/value/downcast.i:120: Warning: signed downcast. assert (int)S.i1 ≤ 127; [eva:alarm] tests/value/downcast.i:124: Warning: signed downcast. assert (int)S.i1 ≤ 31; [eva] Recording results for main8_bitfields [eva] Done for function main8_bitfields [eva] computing for function main9_bitfield <- main. Called from tests/value/downcast.i:160. [eva:alarm] tests/value/downcast.i:137: Warning: signed downcast. assert -128 ≤ (int)bf.a; [eva] Recording results for main9_bitfield [eva] Done for function main9_bitfield [eva] computing for function main10_loop <- main. Called from tests/value/downcast.i:161. [eva:alarm] tests/value/downcast.i:147: Warning: signed downcast. assert -128 ≤ (int)bf.b; [eva:alarm] tests/value/downcast.i:147: Warning: signed downcast. assert (int)bf.b ≤ 127; [eva] Recording results for main10_loop [eva] Done for function main10_loop [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: sz ∈ [--..--] uc ∈ [--..--] x ∈ [--..--] ux ∈ [--..--] s ∈ [--..--] [eva:final-states] Values at end of function main10_loop: c ∈ [--..--] or UNINITIALIZED bf.b ∈ [--..--] or UNINITIALIZED .[bits 10 to 31] ∈ UNINITIALIZED k ∈ {10} [eva:final-states] Values at end of function main2_bitfield: i ∈ {117} j ∈ {254} ss.i ∈ UNINITIALIZED .j ∈ {30} or UNINITIALIZED .[bits 10 to 31] ∈ UNINITIALIZED [eva:final-states] Values at end of function main3_reduction: x_0 ∈ [-128..127] c ∈ [--..--] y ∈ [--..--] d ∈ [--..--] [eva:final-states] Values at end of function main4_pointer: p ∈ {{ &x_0 + {100} }} q ∈ {{ &x_0 + {100} }} r ∈ {{ &x_0 + {100} }} [eva:final-states] Values at end of function main5_wrap_signed: x_0 ∈ [100000..2147483647] y ∈ [100145..2147483792] z ∈ [--..--] [eva:final-states] Values at end of function main6_val_warn_converted_signed: [eva:final-states] Values at end of function main7_signed_upcast: c ∈ {240} i ∈ {240} [eva:final-states] Values at end of function main8_bitfields: S.i1 ∈ {65} .i2 ∈ {-1} or UNINITIALIZED .[bits 24 to 31] ∈ UNINITIALIZED c ∈ {-1; 65} or UNINITIALIZED [eva:final-states] Values at end of function main9_bitfield: bf.a ∈ {1648} .[bits 11 to 31] ∈ UNINITIALIZED c ∈ UNINITIALIZED [eva:final-states] Values at end of function main: sz ∈ [--..--] uc ∈ [--..--] x ∈ [--..--] ux ∈ [--..--] s ∈ [--..--] [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main10_loop [from] Done for function main10_loop [from] Computing for function main2_bitfield [from] Done for function main2_bitfield [from] Computing for function main3_reduction [from] Done for function main3_reduction [from] Computing for function main4_pointer [from] Done for function main4_pointer [from] Computing for function main5_wrap_signed [from] Done for function main5_wrap_signed [from] Computing for function main6_val_warn_converted_signed [from] Done for function main6_val_warn_converted_signed [from] Computing for function main7_signed_upcast [from] Done for function main7_signed_upcast [from] Computing for function main8_bitfields [from] Done for function main8_bitfields [from] Computing for function main9_bitfield [from] Done for function main9_bitfield [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: sz FROM sx; sy uc FROM x x FROM uy; uz ux FROM uy; uz s FROM uy; uz [from] Function main10_loop: NO EFFECTS [from] Function main2_bitfield: NO EFFECTS [from] Function main3_reduction: NO EFFECTS [from] Function main4_pointer: NO EFFECTS [from] Function main5_wrap_signed: NO EFFECTS [from] Function main6_val_warn_converted_signed: NO EFFECTS [from] Function main7_signed_upcast: NO EFFECTS [from] Function main8_bitfields: NO EFFECTS [from] Function main9_bitfield: NO EFFECTS [from] Function main: sz FROM sx; sy uc FROM x x FROM uy; uz ux FROM uy; uz s FROM uy; uz [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: sz; uc; x; ux; s [inout] Inputs for function main1: sx; sy; x; uy; uz [inout] Out (internal) for function main10_loop: c; bf.b; k [inout] Inputs for function main10_loop: v [inout] Out (internal) for function main2_bitfield: i; j; ss{.i; .j} [inout] Inputs for function main2_bitfield: v [inout] Out (internal) for function main3_reduction: x_0; c; y; d [inout] Inputs for function main3_reduction: v [inout] Out (internal) for function main4_pointer: p; q; r [inout] Inputs for function main4_pointer: \nothing [inout] Out (internal) for function main5_wrap_signed: x_0; y; z [inout] Inputs for function main5_wrap_signed: v [inout] Out (internal) for function main6_val_warn_converted_signed: s_0; u; e; b; e_0; b_0; e_1; b_1; p; x_0; y; z [inout] Inputs for function main6_val_warn_converted_signed: v [inout] Out (internal) for function main7_signed_upcast: c; i [inout] Inputs for function main7_signed_upcast: \nothing [inout] Out (internal) for function main8_bitfields: S{.i1; .i2}; c [inout] Inputs for function main8_bitfields: v [inout] Out (internal) for function main9_bitfield: bf.a; signed_a; c [inout] Inputs for function main9_bitfield: v [inout] Out (internal) for function main: sz; uc; x; ux; s [inout] Inputs for function main: sx; sy; x; uy; uz; v [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main1' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 19) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 19) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main2_bitfield' -------------------------------------------------------------------------------- [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 32) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 32) -------------------------------------------------------------------------------- --- Properties of Function 'main3_reduction' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 38) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 38) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main4_pointer' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_overflow' (file tests/value/downcast.i, line 50) tried with Eva. [ - ] Assertion 'Eva,signed_overflow' (file tests/value/downcast.i, line 50) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 52) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 52) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main5_wrap_signed' -------------------------------------------------------------------------------- [ - ] Assertion 'ASSUME' (file tests/value/downcast.i, line 58) tried with Eva. [ Valid ] Assertion (file tests/value/downcast.i, line 59) by Eva. [ - ] Assertion (file tests/value/downcast.i, line 64) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main6_val_warn_converted_signed' -------------------------------------------------------------------------------- [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 71) By Eva, with pending: - Unreachable initialization of 's_0' (file tests/value/downcast.i, line 71) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 87) By Eva, with pending: - Unreachable initialization of 'b_1' (file tests/value/downcast.i, line 87) [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 92) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 92) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main8_bitfields' -------------------------------------------------------------------------------- [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 119) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 119) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 120) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 120) [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 124) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 124) -------------------------------------------------------------------------------- --- Properties of Function 'main9_bitfield' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/value/downcast.i, line 134) by Eva. [ Alarm ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 137) By Eva, with pending: - Unreachable instruction (file tests/value/downcast.i, line 137) -------------------------------------------------------------------------------- --- Properties of Function 'main10_loop' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 147) tried with Eva. [ - ] Assertion 'Eva,signed_downcast' (file tests/value/downcast.i, line 147) tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 14 To be validated 7 Alarms emitted 23 Total -------------------------------------------------------------------------------- /* Generated by Frama-C */ struct s { int i : 5 ; unsigned int j : 5 ; }; struct bitf { unsigned int i1 : 18 ; int i2 : 6 ; }; struct __anonstruct_bf_1 { unsigned int a : 11 ; }; struct __anonstruct_bf_2 { unsigned int b : 10 ; }; signed char sx; signed char sy; signed char sz; unsigned char uc; int x; unsigned int ux; unsigned int uy; unsigned int uz; unsigned short s; int volatile v; void main1(void) { /*@ assert Eva: signed_downcast: -128 ≤ (int)sx + (int)sy; */ /*@ assert Eva: signed_downcast: (int)sx + (int)sy ≤ 127; */ sz = (signed char)((int)sx + (int)sy); uc = (unsigned char)((int)sx + (int)sy); uc = (unsigned char)x; x = (int)(uy + uz); ux = uy + uz; s = (unsigned short)(uy + uz); return; } void main2_bitfield(void) { struct s ss; int i = 117; unsigned int j = (unsigned int)254; if (v) /*@ assert Eva: signed_downcast: i ≤ 15; */ ss.i = (int)i; if (v) ss.j = (unsigned int)j; return; } void main3_reduction(void) { int x_0 = v; /*@ assert Eva: signed_downcast: -128 ≤ x_0; */ /*@ assert Eva: signed_downcast: x_0 ≤ 127; */ char c = (char)x_0; unsigned int y = (unsigned int)v; unsigned char d = (unsigned char)y; return; } void main4_pointer(void) { int x_0; long long p = (long long)(& x_0); /*@ assert Eva: signed_overflow: -9223372036854775808 ≤ p + (long long)100; */ /*@ assert Eva: signed_overflow: p + (long long)100 ≤ 9223372036854775807; */ p += (long long)100; unsigned int q = (unsigned int)p; /*@ assert Eva: signed_downcast: -2147483648 ≤ p; */ /*@ assert Eva: signed_downcast: p ≤ 2147483647; */ int r = (int)p; return; } /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each)(); void main5_wrap_signed(void) { int x_0 = v; /*@ assert ASSUME: x_0 ≥ 100000; */ ; /*@ assert x_0 > 0x7FFFFFFF - 145 ∨ x_0 ≤ 0x7FFFFFFF - 145; */ ; unsigned int y = (unsigned int)x_0; y += (unsigned int)145; int z = (int)y; Frama_C_show_each(x_0,y,z); /*@ assert z ≥ 100000 + 145 ∨ z ≤ (int)(0x7FFFFFFF + 145); */ ; return; } void main6_val_warn_converted_signed(void) { if (v) { /*@ assert Eva: signed_downcast: (int)65300u ≤ 32767; */ short s_0 = (short)65300u; } if (v) { unsigned short u = (unsigned short)65300u; } if (v) { unsigned long e = (unsigned long)17; short b = (short)e; } if (v) { unsigned long e_0 = (unsigned long)(-12); short b_0 = (short)e_0; } if (v) { unsigned int e_1 = (unsigned int)(-64000); /*@ assert Eva: signed_downcast: -32768 ≤ (int)e_1; */ short b_1 = (short)e_1; } if (v) { int *p = (int *)(& v); int x_0 = (int)p; /*@ assert Eva: signed_downcast: -32768 ≤ (int)p; */ /*@ assert Eva: signed_downcast: (int)p ≤ 32767; */ short y = (short)p; unsigned short z = (unsigned short)p; } return; } void main7_signed_upcast(void) { unsigned char c = (unsigned char)240; int i = (int)c; return; } void main8_bitfields(void) { struct bitf S; signed char c; S.i1 = (unsigned int)0x3FFFF; if (v) S.i2 = (int)S.i1; if (v) c = (signed char)S.i1; S.i1 = (unsigned int)257u; if (v) /*@ assert Eva: signed_downcast: (int)S.i1 ≤ 31; */ S.i2 = (int)S.i1; if (v) /*@ assert Eva: signed_downcast: (int)S.i1 ≤ 127; */ c = (signed char)S.i1; S.i1 = (unsigned int)65u; if (v) /*@ assert Eva: signed_downcast: (int)S.i1 ≤ 31; */ S.i2 = (int)S.i1; if (v) c = (signed char)S.i1; return; } void main9_bitfield(void) { struct __anonstruct_bf_1 bf; signed char c; bf.a = (unsigned int)1648; if (v) { int signed_a = (int)((int)bf.a); /*@ assert signed_a ≡ -400; */ ; } if (v) /*@ assert Eva: signed_downcast: -128 ≤ (int)bf.a; */ c = (signed char)bf.a; return; } void main10_loop(void) { signed char c; struct __anonstruct_bf_2 bf; int k = 0; while (k < 10) { bf.b = (unsigned int)v; if (v) /*@ assert Eva: signed_downcast: -128 ≤ (int)bf.b; */ /*@ assert Eva: signed_downcast: (int)bf.b ≤ 127; */ c = (signed char)bf.b; k ++; } return; } void main(void) { main1(); main2_bitfield(); main3_reduction(); main4_pointer(); main5_wrap_signed(); main6_val_warn_converted_signed(); main7_signed_upcast(); main8_bitfields(); main9_bitfield(); main10_loop(); return; } [eva] Analyzing an incomplete application starting at main5_wrap_signed [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization sx ∈ [--..--] sy ∈ [--..--] sz ∈ [--..--] uc ∈ [--..--] x ∈ [--..--] ux ∈ [--..--] uy ∈ [--..--] uz ∈ [--..--] s ∈ [--..--] v ∈ [--..--] [eva] tests/value/downcast.i:63: Frama_C_show_each: [2147483503..2147483647], [2147483648..2147483792], [-2147483648..-2147483504] [eva] tests/value/downcast.i:63: Frama_C_show_each: [100000..2147483502], [100145..2147483647], [100145..2147483647] [eva] Recording results for main5_wrap_signed [eva] done for function main5_wrap_signed [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main5_wrap_signed: x_0 ∈ [100000..2147483647] y ∈ [100145..2147483792] z ∈ [--..--] [from] Computing for function main5_wrap_signed [from] Done for function main5_wrap_signed [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main5_wrap_signed: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main5_wrap_signed: x_0; y; z [inout] Inputs for function main5_wrap_signed: v [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main5_wrap_signed' -------------------------------------------------------------------------------- [ - ] Assertion 'ASSUME' (file tests/value/downcast.i, line 58) tried with Eva (v2). [ Valid ] Assertion (file tests/value/downcast.i, line 59) by Eva (v2). [ Valid ] Assertion (file tests/value/downcast.i, line 64) by Eva (v2). -------------------------------------------------------------------------------- --- Properties of Function 'main9_bitfield' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/value/downcast.i, line 134) Locally valid, but unreachable. By Eva (v2) because: - Unreachable program point (file tests/value/downcast.i, line 134) [Unreachable] Unreachable program point (file tests/value/downcast.i, line 134) by Eva (v2). -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 1 To be validated 1 Dead property 1 Unreachable 5 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/dur.res.oracle0000666000000000000000000004302713571573400017515 0ustar [kernel] Parsing tests/value/dur.i (no preprocessing) [eva] Analyzing a complete application starting at F2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G1 ∈ {0} G2 ∈ {0} G3 ∈ [--..--] G4{.M6; .M7; .M8; .M9; .M10; .M11; .M12; .M13; .M14; .M15; .M16; .M17; .M18; .M19; .M20; .M21; .M22; .M23; .M24; .M25; .M26[0..25]; .M27[0..12]; .M28[0..2]; .M29; .M30; .M31; .M32; .M33; .M34; .M35; .M36; .M37; .M38; .M39; .M40; .M41; .M42; .M43; .M44; .M45; .M46; .M47; .M48; .M49; .M50; .M51; .M52; .M53; .M54; .M55; .M56; .M57; .M58; .M59; .M60; .M61; .M62; .M63; .M64[0..26]; .M65[0..26]; .M66[0..47]; .M67[0..47]; .M68[0..47]; .M69[0..47]; .M70[0..47]; .M71[0..47]; .M72[0..47]; .M73[0..47]; .M74[0..9]} ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] G5{.M75; .[bits 16 to 31]} ∈ [--..--] .M76[0].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[0]{.M2; .M3} ∈ [--..--] .M76[1].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[1]{.M2; .M3} ∈ [--..--] .M76[2].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[2]{.M2; .M3} ∈ [--..--] .M76[3].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[3]{.M2; .M3} ∈ [--..--] .M76[4].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[4]{.M2; .M3} ∈ [--..--] .M76[5].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[5]{.M2; .M3} ∈ [--..--] .M76[6].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[6]{.M2; .M3} ∈ [--..--] .M76[7].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[7]{.M2; .M3} ∈ [--..--] .M76[8].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[8]{.M2; .M3} ∈ [--..--] .M76[9].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[9]{.M2; .M3} ∈ [--..--] .M76[10].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[10]{.M2; .M3} ∈ [--..--] .M76[11].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[11]{.M2; .M3} ∈ [--..--] .M76[12].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[12]{.M2; .M3} ∈ [--..--] .M76[13].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[13]{.M2; .M3} ∈ [--..--] .M76[14].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[14]{.M2; .M3} ∈ [--..--] .M76[15].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[15]{.M2; .M3} ∈ [--..--] .M76[16].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[16]{.M2; .M3} ∈ [--..--] .M76[17].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[17]{.M2; .M3} ∈ [--..--] .M76[18].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[18]{.M2; .M3} ∈ [--..--] .M76[19].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[19]{.M2; .M3} ∈ [--..--] .M76[20].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[20]{.M2; .M3} ∈ [--..--] .M76[21].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[21]{.M2; .M3} ∈ [--..--] .M76[22].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[22]{.M2; .M3} ∈ [--..--] .M76[23].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[23]{.M2; .M3} ∈ [--..--] .M76[24].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[24]{.M2; .M3} ∈ [--..--] .M76[25].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[25]{.M2; .M3} ∈ [--..--] .M76[26].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[26]{.M2; .M3} ∈ [--..--] .M76[27].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[27]{.M2; .M3} ∈ [--..--] .M76[28].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[28]{.M2; .M3} ∈ [--..--] .M76[29].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[29]{.M2; .M3} ∈ [--..--] .M76[30].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[30]{.M2; .M3} ∈ [--..--] .M76[31].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[31]{.M2; .M3} ∈ [--..--] .M76[32].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[32]{.M2; .M3} ∈ [--..--] .M76[33].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[33]{.M2; .M3} ∈ [--..--] .M76[34].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[34]{.M2; .M3} ∈ [--..--] .M76[35].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[35]{.M2; .M3} ∈ [--..--] .M76[36].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[36]{.M2; .M3} ∈ [--..--] .M76[37].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[37]{.M2; .M3} ∈ [--..--] .M76[38].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[38]{.M2; .M3} ∈ [--..--] .M76[39].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[39]{.M2; .M3} ∈ [--..--] .M76[40].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[40]{.M2; .M3} ∈ [--..--] .M76[41].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[41]{.M2; .M3} ∈ [--..--] .M76[42].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[42]{.M2; .M3} ∈ [--..--] .M76[43].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[43]{.M2; .M3} ∈ [--..--] .M76[44].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[44]{.M2; .M3} ∈ [--..--] .M76[45].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[45]{.M2; .M3} ∈ [--..--] .M76[46].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[46]{.M2; .M3} ∈ [--..--] .M76[47].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[47]{.M2; .M3} ∈ [--..--] .M76[48].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[48]{.M2; .M3} ∈ [--..--] .M76[49].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[49]{.M2; .M3} ∈ [--..--] .M76[50].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[50]{.M2; .M3} ∈ [--..--] .M76[51].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[51]{.M2; .M3} ∈ [--..--] .M76[52].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[52]{.M2; .M3} ∈ [--..--] .M77.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M77{.M2; .M3} ∈ [--..--] .M78.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M78{.M2; .M3} ∈ [--..--] .M79.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M79{.M2; .M3} ∈ [--..--] .M80.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M80{.M2; .M3} ∈ [--..--] .M81.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M81{.M2; .M3} ∈ [--..--] .M82.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M82{.M2; .M3} ∈ [--..--] .M83.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M83{.M2; .M3} ∈ [--..--] .M84.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M84{.M2; .M3} ∈ [--..--] .M85.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M85{.M2; .M3} ∈ [--..--] .M86.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M86{.M2; .M3} ∈ [--..--] .M87.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M87{.M2; .M3} ∈ [--..--] .M88.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M88{.M2; .M3} ∈ [--..--] .M89.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {.M89{.M2; .M3}; .M90[0..3]; .M91} ∈ [--..--] .M92[0].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[0]{.M2; .M3} ∈ [--..--] .M92[1].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[1]{.M2; .M3} ∈ [--..--] .M92[2].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[2]{.M2; .M3} ∈ [--..--] .M92[3].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[3]{.M2; .M3} ∈ [--..--] .M92[4].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[4]{.M2; .M3} ∈ [--..--] .M92[5].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {.M92[5]{.M2; .M3}; .M93[0..4]} ∈ [--..--] G6 ∈ [--..--] G7[0..160] ∈ [--..--] [eva] tests/value/dur.i:167: starting to merge loop iterations [eva] Recording results for F2 [eva] done for function F2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function F2: G5.M75 ∈ [0..255] .[bits 16 to 31] ∈ [--..--] .M76[0].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[0]{.M2; .M3} ∈ [--..--] .M76[1].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[1]{.M2; .M3} ∈ [--..--] .M76[2].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[2]{.M2; .M3} ∈ [--..--] .M76[3].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[3]{.M2; .M3} ∈ [--..--] .M76[4].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[4]{.M2; .M3} ∈ [--..--] .M76[5].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[5]{.M2; .M3} ∈ [--..--] .M76[6].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[6]{.M2; .M3} ∈ [--..--] .M76[7].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[7]{.M2; .M3} ∈ [--..--] .M76[8].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[8]{.M2; .M3} ∈ [--..--] .M76[9].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[9]{.M2; .M3} ∈ [--..--] .M76[10].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[10]{.M2; .M3} ∈ [--..--] .M76[11].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[11]{.M2; .M3} ∈ [--..--] .M76[12].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[12]{.M2; .M3} ∈ [--..--] .M76[13].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[13]{.M2; .M3} ∈ [--..--] .M76[14].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[14]{.M2; .M3} ∈ [--..--] .M76[15].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[15]{.M2; .M3} ∈ [--..--] .M76[16].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[16]{.M2; .M3} ∈ [--..--] .M76[17].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[17]{.M2; .M3} ∈ [--..--] .M76[18].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[18]{.M2; .M3} ∈ [--..--] .M76[19].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[19]{.M2; .M3} ∈ [--..--] .M76[20].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[20]{.M2; .M3} ∈ [--..--] .M76[21].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[21]{.M2; .M3} ∈ [--..--] .M76[22].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[22]{.M2; .M3} ∈ [--..--] .M76[23].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[23]{.M2; .M3} ∈ [--..--] .M76[24].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[24]{.M2; .M3} ∈ [--..--] .M76[25].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[25]{.M2; .M3} ∈ [--..--] .M76[26].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[26]{.M2; .M3} ∈ [--..--] .M76[27].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[27]{.M2; .M3} ∈ [--..--] .M76[28].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[28]{.M2; .M3} ∈ [--..--] .M76[29].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[29]{.M2; .M3} ∈ [--..--] .M76[30].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[30]{.M2; .M3} ∈ [--..--] .M76[31].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[31]{.M2; .M3} ∈ [--..--] .M76[32].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[32]{.M2; .M3} ∈ [--..--] .M76[33].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[33]{.M2; .M3} ∈ [--..--] .M76[34].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[34]{.M2; .M3} ∈ [--..--] .M76[35].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[35]{.M2; .M3} ∈ [--..--] .M76[36].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[36]{.M2; .M3} ∈ [--..--] .M76[37].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[37]{.M2; .M3} ∈ [--..--] .M76[38].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[38]{.M2; .M3} ∈ [--..--] .M76[39].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[39]{.M2; .M3} ∈ [--..--] .M76[40].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[40]{.M2; .M3} ∈ [--..--] .M76[41].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[41]{.M2; .M3} ∈ [--..--] .M76[42].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[42]{.M2; .M3} ∈ [--..--] .M76[43].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[43]{.M2; .M3} ∈ [--..--] .M76[44].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[44]{.M2; .M3} ∈ [--..--] .M76[45].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[45]{.M2; .M3} ∈ [--..--] .M76[46].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[46]{.M2; .M3} ∈ [--..--] .M76[47].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[47]{.M2; .M3} ∈ [--..--] .M76[48].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[48]{.M2; .M3} ∈ [--..--] .M76[49].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[49]{.M2; .M3} ∈ [--..--] .M76[50].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[50]{.M2; .M3} ∈ [--..--] .M76[51].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[51]{.M2; .M3} ∈ [--..--] .M76[52].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M76[52]{.M2; .M3} ∈ [--..--] .M77.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M77{.M2; .M3} ∈ [--..--] .M78.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M78{.M2; .M3} ∈ [--..--] .M79.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M79{.M2; .M3} ∈ [--..--] .M80.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M80{.M2; .M3} ∈ [--..--] .M81.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M81{.M2; .M3} ∈ [--..--] .M82.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M82{.M2; .M3} ∈ [--..--] .M83.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M83{.M2; .M3} ∈ [--..--] .M84.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M84{.M2; .M3} ∈ [--..--] .M85.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M85{.M2; .M3} ∈ [--..--] .M86.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M86{.M2; .M3} ∈ [--..--] .M87.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M87{.M2; .M3} ∈ [--..--] .M88.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M88{.M2; .M3} ∈ [--..--] .M89.M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {.M89{.M2; .M3}; .M90[0..3]; .M91} ∈ [--..--] .M92[0].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[0]{.M2; .M3} ∈ [--..--] .M92[1].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[1]{.M2; .M3} ∈ [--..--] .M92[2].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[2]{.M2; .M3} ∈ [--..--] .M92[3].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[3]{.M2; .M3} ∈ [--..--] .M92[4].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] .M92[4]{.M2; .M3} ∈ [--..--] .M92[5].M1 ∈ [-1.9999998807907104*2^127 .. 1.9999998807907104*2^127] {.M92[5]{.M2; .M3}; .M93[0..4]} ∈ [--..--] V5 ∈ {4} or UNINITIALIZED V6 ∈ [--..--] or UNINITIALIZED V7 ∈ [0..65532],0%2 or UNINITIALIZED [from] Computing for function F2 [from] Done for function F2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function F2: G5.M75 FROM G3 {.M90[0].M4; .M90[1].M4; .M90[2].M4; .M90[3].M4} FROM G1; G2; V8 (and SELF) {.M90[0].M5; .M90[1].M5; .M90[2].M5; .M90[3].M5} FROM G2; V8 (and SELF) .M91.M4 FROM G6{.M96[0]; .M97[0]}; V8 (and SELF) .M91.M5 FROM G6.M97[0]; V8 (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function F2: G5{.M75; {.M90[0..3]; .M91}}; V5; V6; V7 [inout] Inputs for function F2: G1; G2; G3; G5{.M90[0].M4; .M90[1].M4; .M90[2].M4; .M90[3].M4}; G6{.M96[0]; .M97[0]} frama-c-20.0-Calcium/tests/value/oracle/empty_base.0.res.oracle0000666000000000000000000000124213571573400021202 0ustar [kernel] Parsing tests/value/empty_base.c (with preprocessing) [kernel] tests/value/empty_base.c:62: User Error: variable `c' has initializer but incomplete type [kernel] tests/value/empty_base.c:66: Warning: Too many initializers for structure [kernel] tests/value/empty_base.c:74: User Error: field `z' declared with a type containing a flexible array member. [kernel] tests/value/empty_base.c:79: User Error: field `f1' declared with a type containing a flexible array member. [kernel] User Error: stopping on file "tests/value/empty_base.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/empty_base.1.res.oracle0000666000000000000000000000125513571573400021207 0ustar [kernel] Parsing tests/value/empty_base.c (with preprocessing) [kernel] tests/value/empty_base.c:47: User Error: zero-length arrays only allowed for GCC/MSVC [kernel] tests/value/empty_base.c:49: User Error: empty initializers only allowed for GCC/MSVC 47 struct empty empty_array_of_empty[0]; 48 struct empty array_of_empty[1]; 49 struct empty many_empty[3] = {{}}; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 50 51 comp array_of_comp[1] = {{.a = 17, .b = 45, .e = {}}}; [kernel] User Error: stopping on file "tests/value/empty_base.c" that has errors. Add '-kernel-msg-key pp' for preprocessing command. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/empty_struct.0.res.oracle0000666000000000000000000000302113571573400021611 0ustar [kernel] Parsing tests/value/empty_struct.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s2 ∈ {0} pgs ∈ {{ &gs }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ (void *)&s }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p [inout] Inputs for function main: \nothing [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s2 ∈ [--..--] pgs ∈ {{ NULL ; &S_pgs[-1] }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ (void *)&s }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/empty_struct.1.res.oracle0000666000000000000000000000146413571573400021623 0ustar [kernel] Parsing tests/value/empty_struct.c (with preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s2 ∈ [--..--] pgs ∈ {{ NULL ; &S_pgs[-1] }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ (void *)&s }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/empty_struct.2.res.oracle0000666000000000000000000000146413571573400021624 0ustar [kernel] Parsing tests/value/empty_struct.c (with preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s2 ∈ [--..--] pgs ∈ {{ NULL ; &S_pgs[-1] }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ (void *)&s }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/empty_struct.3.res.oracle0000666000000000000000000000056513571573400021626 0ustar [kernel] Parsing tests/value/empty_struct.c (with preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] tests/value/empty_struct.c:22: User Error: empty structs are unsupported (type 'struct s', location s) in C99 (only allowed as GCC/MSVC extension). Aborting. [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/empty_struct.4.res.oracle0000666000000000000000000000201613571573400021620 0ustar [kernel] Parsing tests/value/empty_struct.c (with preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 15] ∈ [--..--] s2 ∈ {0} pgs ∈ {{ &gs }} [eva:alarm] tests/value/empty_struct.c:70: Warning: out of bounds read. assert \valid_read(ptr_ret); [eva] Recording results for main2 [eva] done for function main2 [eva] tests/value/empty_struct.c:70: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: ptr_ret ∈ {2} [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: ptr_ret [inout] Inputs for function main2: \nothing frama-c-20.0-Calcium/tests/value/oracle/empty_struct.5.res.oracle0000666000000000000000000000427613571573400021633 0ustar [kernel] Parsing tests/value/empty_struct.c (with preprocessing) [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 15] ∈ [--..--] s2 ∈ {0} nondet ∈ [--..--] pgs ∈ {{ &gs }} [eva] tests/value/empty_struct.c:78: Call to builtin malloc [eva] tests/value/empty_struct.c:78: allocating variable __malloc_main3_l78 [eva] tests/value/empty_struct.c:79: Call to builtin realloc [eva] tests/value/empty_struct.c:79: function realloc: precondition 'freeable' got status valid. [eva] tests/value/empty_struct.c:79: allocating variable __realloc_main3_l79 [eva] tests/value/empty_struct.c:81: starting to merge loop iterations [eva] tests/value/empty_struct.c:86: Call to builtin free [eva] tests/value/empty_struct.c:86: function free: precondition 'freeable' got status valid. [eva] Recording results for main3 [eva] done for function main3 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main3: __fc_heap_status ∈ [--..--] q ∈ {{ NULL ; &__malloc_main3_l78[-1] }} or ESCAPINGADDR r ∈ {{ NULL ; &__realloc_main3_l79[-1] }} or ESCAPINGADDR p ∈ {{ &empties[-1] }} [from] Computing for function main3 [from] Computing for function malloc <-main3 [from] Done for function malloc [from] Computing for function realloc <-main3 [from] Done for function realloc [from] Computing for function free <-main3 [from] Done for function free [from] Done for function main3 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function free: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function realloc: __fc_heap_status FROM __fc_heap_status (and SELF) \result FROM __fc_heap_status; ptr; size [from] Function main3: __fc_heap_status FROM __fc_heap_status (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main3: __fc_heap_status; q; r; p; i [inout] Inputs for function main3: __fc_heap_status frama-c-20.0-Calcium/tests/value/oracle/empty_struct.6.res.oracle0000666000000000000000000000325713571573400021632 0ustar [kernel] Parsing tests/value/empty_struct.c (with preprocessing) [eva] Analyzing a complete application starting at main4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s2 ∈ {0} pgs ∈ {{ &gs }} [eva] computing for function f <- main4. Called from tests/value/empty_struct.c:99. [eva] using specification for function f [eva] Done for function f [eva] tests/value/empty_struct.c:99: Assigning imprecise value to r. The imprecision originates from Library function {tests/value/empty_struct.c:99} [eva] computing for function g <- main4. Called from tests/value/empty_struct.c:100. [kernel:annot:missing-spec] tests/value/empty_struct.c:100: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] Recording results for main4 [eva] done for function main4 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main4: r ∈ {{ garbled mix of &{gs} (origin: Library function {tests/value/empty_struct.c:99}) }} [from] Computing for function main4 [from] Computing for function f <-main4 [from] Done for function f [from] Computing for function g <-main4 [from] Done for function g [from] Done for function main4 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM pgs [from] Function g: NO EFFECTS [from] Function main4: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main4: r [inout] Inputs for function main4: pgs frama-c-20.0-Calcium/tests/value/oracle/empty_struct2.res.oracle0000666000000000000000000000710713571573400021546 0ustar [kernel] Parsing tests/value/empty_struct2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] pg ∈ {{ &global_empty }} [eva] tests/value/empty_struct2.c:44: assertion got status valid. [eva] tests/value/empty_struct2.c:46: Frama_C_show_each_global_empty: ∅ [eva] tests/value/empty_struct2.c:47: Frama_C_show_each_e1: ∅ [eva] tests/value/empty_struct2.c:48: Call to builtin memcpy [eva] tests/value/empty_struct2.c:48: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/value/empty_struct2.c:48: function memcpy: precondition 'valid_src' got status valid. [eva] tests/value/empty_struct2.c:48: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] tests/value/empty_struct2.c:53: Call to builtin memcpy [eva] tests/value/empty_struct2.c:53: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/value/empty_struct2.c:53: function memcpy: precondition 'valid_src' got status valid. [eva] tests/value/empty_struct2.c:53: function memcpy: precondition 'separation' got status valid. [eva] tests/value/empty_struct2.c:54: Frama_C_show_each_c2: .a ∈ {42} .b ∈ {77} [eva] tests/value/empty_struct2.c:55: Frama_C_show_each_c2_e: ∅ [eva] computing for function f <- main. Called from tests/value/empty_struct2.c:56. [eva] Recording results for f [eva] Done for function f [eva] tests/value/empty_struct2.c:58: Frama_C_show_each_res: .a ∈ {87} .b ∈ {39} [eva] tests/value/empty_struct2.c:62: assertion got status valid. [eva] computing for function ret_empty <- main. Called from tests/value/empty_struct2.c:64. [eva] using specification for function ret_empty [eva] Done for function ret_empty [eva] computing for function ret_ptr_empty <- main. Called from tests/value/empty_struct2.c:65. [eva] using specification for function ret_ptr_empty [eva] Done for function ret_ptr_empty [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: res.a ∈ {87} .b ∈ {39} [eva:final-states] Values at end of function main: c1.a ∈ {42} .b ∈ {77} c2.a ∈ {42} .b ∈ {77} res.a ∈ {87} .b ∈ {39} cb.i ∈ {91} ce.ch ∈ {90} p ∈ {{ (struct empty *)&cb }} ptr_ret ∈ {{ &global_empty }} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Computing for function memcpy <-main [from] Done for function memcpy [from] Computing for function ret_empty <-main [from] Done for function ret_empty [from] Computing for function ret_ptr_empty <-main [from] Done for function ret_ptr_empty [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM s [from] Function memcpy: c2 FROM c1 (and SELF) \result FROM dest [from] Function ret_empty: \result FROM \nothing [from] Function ret_ptr_empty: \result FROM pg [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: res [inout] Inputs for function f: nondet [inout] Out (internal) for function main: c1; c2; res; cb; ce; p; ptr_ret; __retres [inout] Inputs for function main: nondet; pg frama-c-20.0-Calcium/tests/value/oracle/empty_union.res.oracle0000666000000000000000000000717513571573400021275 0ustar [kernel] Parsing tests/value/empty_union.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] tests/value/empty_union.c:59: Warning: during initialization of variable 'f1', size of type 'int []' cannot be computed (Size of array without number of elements.) [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] array_of_comp[0]{.a; .e{}; .b} ∈ {17} f1[bits 0 to ..] ∈ {0} or UNINITIALIZED f2.data[0] ∈ {1} .data[1..2] ∈ {0} [eva] tests/value/empty_union.c:67: assertion got status valid. [eva] tests/value/empty_union.c:68: assertion got status valid. [eva] tests/value/empty_union.c:70: Frama_C_show_each_global_empty: ∅ [eva] tests/value/empty_union.c:71: Frama_C_show_each_e1: ∅ [eva] tests/value/empty_union.c:72: Call to builtin memcpy [eva] tests/value/empty_union.c:72: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/value/empty_union.c:72: function memcpy: precondition 'valid_src' got status valid. [eva] tests/value/empty_union.c:72: function memcpy: precondition 'separation' got status valid. [eva] share/libc/string.h:98: cannot evaluate ACSL term, unsupported ACSL construct: logic function memcmp [eva] tests/value/empty_union.c:77: Call to builtin memcpy [eva] tests/value/empty_union.c:77: function memcpy: precondition 'valid_dest' got status valid. [eva] tests/value/empty_union.c:77: function memcpy: precondition 'valid_src' got status valid. [eva] tests/value/empty_union.c:77: function memcpy: precondition 'separation' got status valid. [eva] tests/value/empty_union.c:78: Frama_C_show_each_c2: {77} [eva] tests/value/empty_union.c:79: Frama_C_show_each_c2_e: ∅ [eva] computing for function f <- main. Called from tests/value/empty_union.c:80. [eva] Recording results for f [eva] Done for function f [eva] computing for function copy_empty <- main. Called from tests/value/empty_union.c:81. [eva] tests/value/empty_union.c:37: function copy_empty: postcondition got status valid. [eva] Recording results for copy_empty [eva] Done for function copy_empty [eva] tests/value/empty_union.c:83: Frama_C_show_each_res: {74} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function copy_empty: [eva:final-states] Values at end of function f: res{.a; .e{}; .b} ∈ {74} [eva:final-states] Values at end of function main: c1{.a; .e{}; .b} ∈ {77} c2{.a; .e{}; .b} ∈ {77} res{.a; .e{}; .b} ∈ {74} cb{.s{}; .i} ∈ {91} ce{.ch; .ss{}} ∈ {90} p ∈ {{ (union empty *)&cb }} pc ∈ {{ &empty_init_array[0] }} __retres ∈ {0} [from] Computing for function copy_empty [from] Done for function copy_empty [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Computing for function memcpy <-main [from] Done for function memcpy [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function copy_empty: NO EFFECTS [from] Function f: \result FROM s [from] Function memcpy: c2 FROM c1 (and SELF) \result FROM dest [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function copy_empty: \nothing [inout] Inputs for function copy_empty: \nothing [inout] Out (internal) for function f: res [inout] Inputs for function f: nondet [inout] Out (internal) for function main: c1; c2; res; cb; ce; p; pc; __retres [inout] Inputs for function main: nondet frama-c-20.0-Calcium/tests/value/oracle/endian.0.res.oracle0000666000000000000000000000505113571573400020312 0ustar [kernel] Parsing tests/value/endian.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v1 ∈ {0} UU ∈ {0} undet ∈ [--..--] [eva] computing for function main0 <- main. Called from tests/value/endian.i:101. [eva] Recording results for main0 [eva] Done for function main0 [eva] computing for function interpret_bits <- main. Called from tests/value/endian.i:102. [eva] Recording results for interpret_bits [eva] Done for function interpret_bits [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function interpret_bits: x{.integer[bits 0 to 0]; .bits.bit0} ∈ {0} {.integer[bits 1 to 1]; .bits.bit1} ∈ {1} {.integer[bits 2 to 2]; .bits.bit2} ∈ {0} {.integer[bits 3 to 6]; .bits{.bit3; .bit4; .bit5; .bit6}} ∈ [--..--] {.integer[bits 7 to 7]; .bits.bit7} ∈ {0} a ∈ {8} b ∈ {239} c ∈ {0; 128} d ∈ {0; 1} e ∈ {251; 255} f ∈ [2..122],2%8 [eva:final-states] Values at end of function main0: b0 ∈ {1} b1 ∈ {2} b2 ∈ {3} b3 ∈ {255} f ∈ {4278387200} data0{.full[bits 0 to 7]; .part.a} ∈ {0} {.full[bits 8 to 31]#; .part{.b#; .c#; .d#}} ∈ {4278387201}%32, bits 8 to 31 G0 ∈ {65532} G1 ∈ {65532} G2 ∈ {-4} G3 ∈ {252} G{.f0; .f1[bits 0 to 15]; .f2[bits 0 to 15]; .f3[bits 0 to 15]} ∈ {65532} {.f0[bits 16 to 31]; .f1[bits 16 to 31]; .f2[bits 16 to 31]; .f3[bits 16 to 31]} ∈ {0} [eva:final-states] Values at end of function main: [from] Computing for function interpret_bits [from] Done for function interpret_bits [from] Computing for function main0 [from] Done for function main0 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function interpret_bits: NO EFFECTS [from] Function main0: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function interpret_bits: x; a; b; c; d; e; f [inout] Inputs for function interpret_bits: undet [inout] Out (internal) for function main0: b0; b1; b2; b3; f; data0; G0; G1; G2; G3; G{.f0; .f1[bits 0 to 15]; .f2[bits 0 to 15]; .f3[bits 0 to 15]} [inout] Inputs for function main0: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: undet frama-c-20.0-Calcium/tests/value/oracle/endian.1.res.oracle0000666000000000000000000000505013571573400020312 0ustar [kernel] Parsing tests/value/endian.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v1 ∈ {0} UU ∈ {0} undet ∈ [--..--] [eva] computing for function main0 <- main. Called from tests/value/endian.i:101. [eva] Recording results for main0 [eva] Done for function main0 [eva] computing for function interpret_bits <- main. Called from tests/value/endian.i:102. [eva] Recording results for interpret_bits [eva] Done for function interpret_bits [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function interpret_bits: x{.integer[bits 0 to 0]; .bits.bit0} ∈ {0} {.integer[bits 1 to 1]; .bits.bit1} ∈ {1} {.integer[bits 2 to 2]; .bits.bit2} ∈ {0} {.integer[bits 3 to 6]; .bits{.bit3; .bit4; .bit5; .bit6}} ∈ [--..--] {.integer[bits 7 to 7]; .bits.bit7} ∈ {0} a ∈ {16} b ∈ {247} c ∈ {0; 1} d ∈ {0; 128} e ∈ {223; 255} f ∈ [64..94],0%2 [eva:final-states] Values at end of function main0: b0 ∈ {255} b1 ∈ {3} b2 ∈ {2} b3 ∈ {1} f ∈ {197121} data0{.full[bits 0 to 7]; .part.a} ∈ {0} {.full[bits 8 to 31]#; .part{.b#; .c#; .d#}} ∈ {4278387201}%32, bits 8 to 31 G0 ∈ {65532} G1 ∈ {-262144} G2 ∈ {-1} G3 ∈ {255} G{.f0; .f1[bits 0 to 15]; .f2[bits 0 to 15]; .f3[bits 0 to 15]} ∈ {65532} {.f0[bits 16 to 31]; .f1[bits 16 to 31]; .f2[bits 16 to 31]; .f3[bits 16 to 31]} ∈ {0} [eva:final-states] Values at end of function main: [from] Computing for function interpret_bits [from] Done for function interpret_bits [from] Computing for function main0 [from] Done for function main0 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function interpret_bits: NO EFFECTS [from] Function main0: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function interpret_bits: x; a; b; c; d; e; f [inout] Inputs for function interpret_bits: undet [inout] Out (internal) for function main0: b0; b1; b2; b3; f; data0; G0; G1; G2; G3; G{.f0; .f1[bits 0 to 15]; .f2[bits 0 to 15]; .f3[bits 0 to 15]} [inout] Inputs for function main0: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: undet frama-c-20.0-Calcium/tests/value/oracle/enum.res.oracle0000666000000000000000000000210613571573400017660 0ustar [kernel] Parsing tests/value/enum.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {1} [1..2] ∈ {0} u[0] ∈ {2} [1..2] ∈ {0} [eva] tests/value/enum.i:16: starting to merge loop iterations [eva] tests/value/enum.i:20: assertion got status valid. [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: t[0] ∈ {1} [1] ∈ {0} [2] ∈ {42} u[0] ∈ {2} [1] ∈ {0} [2] ∈ {36} i[0..1] ∈ {0; 1} [2] ∈ {0} j ∈ {2} k ∈ {0} [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: t[2] FROM \nothing u[2] FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: t[2]; u[2]; i[0..2]; j; k [inout] Inputs for function f: \nothing frama-c-20.0-Calcium/tests/value/oracle/enum2.res.oracle0000666000000000000000000000513413571573400017746 0ustar [kernel] Parsing tests/value/enum2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization must_be_one ∈ {0} must_be_zero ∈ {0} [eva] computing for function enum1_sgn1_inf_sgn0 <- main. Called from tests/value/enum2.c:33. [eva] tests/value/enum2.c:27: Frama_C_show_each_enum1_sgn1_inf_sgn0: {0} [eva] Recording results for enum1_sgn1_inf_sgn0 [eva] Done for function enum1_sgn1_inf_sgn0 [eva] computing for function enum1_sgn1_positif <- main. Called from tests/value/enum2.c:34. [eva] computing for function f <- enum1_sgn1_positif <- main. Called from tests/value/enum2.c:21. [eva] Recording results for f [eva] Done for function f [eva] tests/value/enum2.c:22: Frama_C_show_each_enum1_sgn1_positif: {1} [eva] Recording results for enum1_sgn1_positif [eva] Done for function enum1_sgn1_positif [eva] tests/value/enum2.c:35: Frama_C_show_each_sizeof_enum1: {8} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function enum1_sgn1_inf_sgn0: res ∈ {0} [eva:final-states] Values at end of function f: y ∈ {2557891634} [eva:final-states] Values at end of function enum1_sgn1_positif: res ∈ {1} [eva:final-states] Values at end of function main: must_be_one ∈ {1} must_be_zero ∈ {0} res ∈ {8} [from] Computing for function enum1_sgn1_inf_sgn0 [from] Done for function enum1_sgn1_inf_sgn0 [from] Computing for function f [from] Done for function f [from] Computing for function enum1_sgn1_positif [from] Done for function enum1_sgn1_positif [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function enum1_sgn1_inf_sgn0: \result FROM \nothing [from] Function f: \result FROM x [from] Function enum1_sgn1_positif: \result FROM \nothing [from] Function main: must_be_one FROM \nothing must_be_zero FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function enum1_sgn1_inf_sgn0: res [inout] Inputs for function enum1_sgn1_inf_sgn0: \nothing [inout] Out (internal) for function f: y [inout] Inputs for function f: \nothing [inout] Out (internal) for function enum1_sgn1_positif: res; tmp [inout] Inputs for function enum1_sgn1_positif: \nothing [inout] Out (internal) for function main: must_be_one; must_be_zero; res [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/equality.res.oracle0000666000000000000000000000544513571573400020562 0ustar [kernel] Parsing tests/value/equality.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] [eva] computing for function replace_lvalue <- main. Called from tests/value/equality.c:47. [eva] Recording results for replace_lvalue [eva] Done for function replace_lvalue [eva] computing for function assign_by_copy <- main. Called from tests/value/equality.c:48. [eva] computing for function Frama_C_interval <- assign_by_copy <- main. Called from tests/value/equality.c:39. [eva] using specification for function Frama_C_interval [eva] tests/value/equality.c:39: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/equality.c:43: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for assign_by_copy [eva] Done for function assign_by_copy [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function assign_by_copy: Frama_C_entropy_source ∈ [--..--] x ∈ [0..42] y ∈ [0..42] or UNINITIALIZED w ∈ [0..42] or UNINITIALIZED z ∈ [1..43] [eva:final-states] Values at end of function replace_lvalue: x ∈ [-2147483647..2147483647] y ∈ [--..--] z ∈ [-8..8] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] [from] Computing for function assign_by_copy [from] Computing for function Frama_C_interval <-assign_by_copy [from] Done for function Frama_C_interval [from] Done for function assign_by_copy [from] Computing for function replace_lvalue [from] Done for function replace_lvalue [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function assign_by_copy: Frama_C_entropy_source FROM Frama_C_entropy_source; rand (and SELF) [from] Function replace_lvalue: NO EFFECTS [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source; rand (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function assign_by_copy: Frama_C_entropy_source; x; y; w; z [inout] Inputs for function assign_by_copy: Frama_C_entropy_source; rand [inout] Out (internal) for function replace_lvalue: x; y; z; tmp [inout] Inputs for function replace_lvalue: rand [inout] Out (internal) for function main: Frama_C_entropy_source [inout] Inputs for function main: Frama_C_entropy_source; rand frama-c-20.0-Calcium/tests/value/oracle/eval_separated.res.oracle0000666000000000000000000000672413571573400021705 0ustar [kernel] Parsing tests/value/eval_separated.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} t1[0..5] ∈ {0} t2[0..5] ∈ {0} [eva] tests/value/eval_separated.c:5: assertion got status valid. [eva] tests/value/eval_separated.c:6: assertion got status valid. [eva] tests/value/eval_separated.c:8: assertion got status valid. [eva] tests/value/eval_separated.c:9: assertion got status valid. [eva:alarm] tests/value/eval_separated.c:11: Warning: signed overflow. assert -2147483648 ≤ (int)(&q) + (int)(&q); [eva:alarm] tests/value/eval_separated.c:11: Warning: signed overflow. assert (int)(&q) + (int)(&q) ≤ 2147483647; [eva] tests/value/eval_separated.c:11: Assigning imprecise value to q. The imprecision originates from Arithmetic {tests/value/eval_separated.c:11} [eva:alarm] tests/value/eval_separated.c:12: Warning: signed overflow. assert -2147483648 ≤ (int)(&r) + (int)(&r); [eva:alarm] tests/value/eval_separated.c:12: Warning: signed overflow. assert (int)(&r) + (int)(&r) ≤ 2147483647; [eva] tests/value/eval_separated.c:12: Assigning imprecise value to r. The imprecision originates from Arithmetic {tests/value/eval_separated.c:12} [eva:alarm] tests/value/eval_separated.c:13: Warning: assertion got status unknown. [eva:alarm] tests/value/eval_separated.c:14: Warning: assertion got status unknown. [eva:alarm] tests/value/eval_separated.c:15: Warning: assertion got status unknown. [eva] tests/value/eval_separated.c:17: assertion got status valid. [eva] tests/value/eval_separated.c:18: assertion got status valid. [eva] tests/value/eval_separated.c:20: assertion got status valid. [eva] tests/value/eval_separated.c:21: assertion got status valid. [eva] tests/value/eval_separated.c:23: assertion got status valid. [eva] tests/value/eval_separated.c:24: assertion got status valid. [eva] tests/value/eval_separated.c:26: assertion got status valid. [eva] tests/value/eval_separated.c:27: assertion got status valid. [eva] tests/value/eval_separated.c:28: assertion got status valid. [eva] tests/value/eval_separated.c:30: assertion got status valid. [eva] tests/value/eval_separated.c:31: assertion got status valid. [eva] tests/value/eval_separated.c:33: assertion got status valid. [eva] tests/value/eval_separated.c:36: assertion got status valid. [eva] tests/value/eval_separated.c:38: assertion got status valid. [eva] tests/value/eval_separated.c:41: assertion got status valid. [eva:alarm] tests/value/eval_separated.c:43: Warning: assertion got status unknown. [eva:alarm] tests/value/eval_separated.c:45: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &t1 + [-8589934592..8589934588],0%4 }} q ∈ {{ garbled mix of &{q} (origin: Arithmetic {tests/value/eval_separated.c:11}) }} r ∈ {{ garbled mix of &{r} (origin: Arithmetic {tests/value/eval_separated.c:12}) }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; q; r [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/exit_paths.res.oracle0000666000000000000000000002131513571573400021067 0ustar [kernel] Parsing tests/value/exit_paths.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function test1 <- main. Called from tests/value/exit_paths.i:71. [eva] tests/value/exit_paths.i:11: Frama_C_show_each_1: {{ "On exit path" }}, {0} [eva] tests/value/exit_paths.i:16: Frama_C_show_each_3: {{ "Not on exit path" }}, {0} [eva] tests/value/exit_paths.i:10: starting to merge loop iterations [eva] tests/value/exit_paths.i:11: Frama_C_show_each_1: {{ "On exit path" }}, {0; 1} [eva] tests/value/exit_paths.i:16: Frama_C_show_each_3: {{ "Not on exit path" }}, {0; 1} [eva] tests/value/exit_paths.i:11: Frama_C_show_each_1: {{ "On exit path" }}, {0; 1; 2} [eva] tests/value/exit_paths.i:16: Frama_C_show_each_3: {{ "Not on exit path" }}, {0; 1; 2} [eva] tests/value/exit_paths.i:11: Frama_C_show_each_1: {{ "On exit path" }}, [0..2147483647] [eva] tests/value/exit_paths.i:16: Frama_C_show_each_3: {{ "Not on exit path" }}, [0..9] [eva] tests/value/exit_paths.i:13: Frama_C_show_each_2: {{ "On exit path" }}, [10..2147483647] [eva] Recording results for test1 [eva] Done for function test1 [eva] computing for function test2 <- main. Called from tests/value/exit_paths.i:72. [eva] tests/value/exit_paths.i:25: Frama_C_show_each_4: {{ "On exit path" }}, {0} [eva] tests/value/exit_paths.i:28: Frama_C_show_each_5: {{ "On exit path" }}, {0}, {0} [eva] tests/value/exit_paths.i:37: Frama_C_show_each_8: {{ "Not on exit path" }}, {0}, {0} [eva] tests/value/exit_paths.i:27: starting to merge loop iterations [eva] tests/value/exit_paths.i:28: Frama_C_show_each_5: {{ "On exit path" }}, {0}, {0; 1} [eva] tests/value/exit_paths.i:37: Frama_C_show_each_8: {{ "Not on exit path" }}, {0}, {0; 1} [eva] tests/value/exit_paths.i:28: Frama_C_show_each_5: {{ "On exit path" }}, {0}, {0; 1; 2} [eva] tests/value/exit_paths.i:37: Frama_C_show_each_8: {{ "Not on exit path" }}, {0}, {0; 1; 2} [eva] tests/value/exit_paths.i:28: Frama_C_show_each_5: {{ "On exit path" }}, {0}, [0..2147483647] [eva] tests/value/exit_paths.i:37: Frama_C_show_each_8: {{ "Not on exit path" }}, {0}, [0..9] [eva] tests/value/exit_paths.i:30: Frama_C_show_each_6: {{ "Not on exit path" }}, {0}, [10..2147483647] [eva] tests/value/exit_paths.i:40: Frama_C_show_each_9: {{ "Not on exit path" }}, {0} [eva] tests/value/exit_paths.i:24: starting to merge loop iterations [eva] tests/value/exit_paths.i:25: Frama_C_show_each_4: {{ "On exit path" }}, {0; 1} [eva] tests/value/exit_paths.i:28: Frama_C_show_each_5: {{ "On exit path" }}, {0; 1}, [0..2147483647] [eva] tests/value/exit_paths.i:37: Frama_C_show_each_8: {{ "Not on exit path" }}, {0; 1}, [0..9] [eva] tests/value/exit_paths.i:30: Frama_C_show_each_6: {{ "Not on exit path" }}, {0; 1}, [10..2147483647] [eva] tests/value/exit_paths.i:40: Frama_C_show_each_9: {{ "Not on exit path" }}, {0; 1} [eva] tests/value/exit_paths.i:25: Frama_C_show_each_4: {{ "On exit path" }}, {0; 1; 2} [eva] tests/value/exit_paths.i:28: Frama_C_show_each_5: {{ "On exit path" }}, {0; 1; 2}, [0..2147483647] [eva] tests/value/exit_paths.i:37: Frama_C_show_each_8: {{ "Not on exit path" }}, {0; 1; 2}, [0..9] [eva] tests/value/exit_paths.i:30: Frama_C_show_each_6: {{ "Not on exit path" }}, {0; 1; 2}, [10..2147483647] [eva] tests/value/exit_paths.i:40: Frama_C_show_each_9: {{ "Not on exit path" }}, {0; 1; 2} [eva] tests/value/exit_paths.i:25: Frama_C_show_each_4: {{ "On exit path" }}, [0..2147483647] [eva] tests/value/exit_paths.i:28: Frama_C_show_each_5: {{ "On exit path" }}, [0..2147483647], [0..2147483647] [eva:alarm] tests/value/exit_paths.i:33: Warning: signed overflow. assert i + j ≤ 2147483647; [eva] tests/value/exit_paths.i:37: Frama_C_show_each_8: {{ "Not on exit path" }}, [0..19], [0..9] [eva] tests/value/exit_paths.i:30: Frama_C_show_each_6: {{ "Not on exit path" }}, [0..2147483647], [10..2147483647] [eva] tests/value/exit_paths.i:40: Frama_C_show_each_9: {{ "Not on exit path" }}, [0..2147483647] [eva:alarm] tests/value/exit_paths.i:41: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva] tests/value/exit_paths.i:34: Frama_C_show_each_7: {{ "On exit path" }}, [11..2147483647], [0..9] [eva] Recording results for test2 [eva] Done for function test2 [eva] computing for function test3 <- main. Called from tests/value/exit_paths.i:73. [eva] tests/value/exit_paths.i:49: Frama_C_show_each_10: {{ "On exit path" }}, {0} [eva] tests/value/exit_paths.i:52: Frama_C_show_each_11: {{ "On exit path" }}, {0}, {0} [eva] tests/value/exit_paths.i:57: Frama_C_show_each_13: {{ "On exit path" }}, {0}, {0} [eva] tests/value/exit_paths.i:51: starting to merge loop iterations [eva] tests/value/exit_paths.i:52: Frama_C_show_each_11: {{ "On exit path" }}, {0}, {0; 1} [eva] tests/value/exit_paths.i:57: Frama_C_show_each_13: {{ "On exit path" }}, {0}, {0; 1} [eva] tests/value/exit_paths.i:52: Frama_C_show_each_11: {{ "On exit path" }}, {0}, {0; 1; 2} [eva] tests/value/exit_paths.i:57: Frama_C_show_each_13: {{ "On exit path" }}, {0}, {0; 1; 2} [eva] tests/value/exit_paths.i:52: Frama_C_show_each_11: {{ "On exit path" }}, {0}, [0..2147483647] [eva] tests/value/exit_paths.i:57: Frama_C_show_each_13: {{ "On exit path" }}, {0}, [0..9] [eva] tests/value/exit_paths.i:54: Frama_C_show_each_12: {{ "On exit path" }}, {0}, [10..2147483647] [eva] tests/value/exit_paths.i:64: Frama_C_show_each_15: {{ "Not on exit path" }}, {0} [eva] tests/value/exit_paths.i:48: starting to merge loop iterations [eva] tests/value/exit_paths.i:49: Frama_C_show_each_10: {{ "On exit path" }}, {0; 1} [eva] tests/value/exit_paths.i:52: Frama_C_show_each_11: {{ "On exit path" }}, {0; 1}, [0..2147483647] [eva] tests/value/exit_paths.i:57: Frama_C_show_each_13: {{ "On exit path" }}, {0; 1}, [0..9] [eva] tests/value/exit_paths.i:54: Frama_C_show_each_12: {{ "On exit path" }}, {0; 1}, [10..2147483647] [eva] tests/value/exit_paths.i:64: Frama_C_show_each_15: {{ "Not on exit path" }}, {0; 1} [eva] tests/value/exit_paths.i:49: Frama_C_show_each_10: {{ "On exit path" }}, {0; 1; 2} [eva] tests/value/exit_paths.i:52: Frama_C_show_each_11: {{ "On exit path" }}, {0; 1; 2}, [0..2147483647] [eva] tests/value/exit_paths.i:57: Frama_C_show_each_13: {{ "On exit path" }}, {0; 1; 2}, [0..9] [eva] tests/value/exit_paths.i:54: Frama_C_show_each_12: {{ "On exit path" }}, {0; 1; 2}, [10..2147483647] [eva] tests/value/exit_paths.i:64: Frama_C_show_each_15: {{ "Not on exit path" }}, {0; 1; 2} [eva] tests/value/exit_paths.i:49: Frama_C_show_each_10: {{ "On exit path" }}, [0..2147483647] [eva] tests/value/exit_paths.i:52: Frama_C_show_each_11: {{ "On exit path" }}, [0..2147483647], [0..2147483647] [eva] tests/value/exit_paths.i:57: Frama_C_show_each_13: {{ "On exit path" }}, [0..2147483647], [0..9] [eva] tests/value/exit_paths.i:54: Frama_C_show_each_12: {{ "On exit path" }}, [0..2147483647], [10..2147483647] [eva] tests/value/exit_paths.i:64: Frama_C_show_each_15: {{ "Not on exit path" }}, [0..9] [eva] tests/value/exit_paths.i:61: Frama_C_show_each_14: {{ "On exit path" }}, [10..2147483647] [eva] Recording results for test3 [eva] Done for function test3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test1: i ∈ [10..2147483647] __retres ∈ [10..2147483647] [eva:final-states] Values at end of function test2: i ∈ [11..2147483647] __retres ∈ [11..2147483647] [eva:final-states] Values at end of function test3: i ∈ [10..2147483647] __retres ∈ [10..2147483647] [eva:final-states] Values at end of function main: [from] Computing for function test1 [from] Done for function test1 [from] Computing for function test2 [from] Done for function test2 [from] Computing for function test3 [from] Done for function test3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function test1: \result FROM n [from] Function test2: \result FROM n [from] Function test3: \result FROM n [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function test1: i; __retres [inout] Inputs for function test1: \nothing [inout] Out (internal) for function test2: i; j; __retres [inout] Inputs for function test2: \nothing [inout] Out (internal) for function test3: i; j; __retres [inout] Inputs for function test3: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/extern.res.oracle0000666000000000000000000000440113571573400020221 0ustar [kernel] Parsing tests/value/extern.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] tests/value/extern.i:6: Warning: during initialization of variable 'T3', size of type 'int []' cannot be computed (Size of array without number of elements.) [eva] tests/value/extern.i:7: Warning: during initialization of variable 'T4', size of type 'int const []' cannot be computed (Size of array without number of elements.) [eva] tests/value/extern.i:16: no size specified for array, assuming 0 [eva] Initial state computed [eva:initial-state] Values of globals at initialization T1 ∈ [--..--] T2 ∈ [--..--] pT2 ∈ {{ &T2 }} T3[0..1073741823] ∈ [--..--] or UNINITIALIZED T4[0..1073741823] ∈ [--..--] or UNINITIALIZED T5[0..2] ∈ [--..--] T6[0..2] ∈ [--..--] c ∈ [--..--] s ∈ [--..--] [eva:alarm] tests/value/extern.i:19: Warning: accessing uninitialized left-value. assert \initialized(&T3[3]); [eva:alarm] tests/value/extern.i:19: Warning: out of bounds read. assert \valid_read(&T3[3]); [eva:alarm] tests/value/extern.i:20: Warning: out of bounds write. assert \valid(pT2); [kernel] tests/value/extern.i:20: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/value/extern.i:22: Warning: out of bounds write. assert \valid(pT2); [kernel] tests/value/extern.i:22: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/extern.i:20: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/extern.i:22: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: T1 [inout] Inputs for function main: pT2; T3[3]; T4[3]; T5[1]; T6[1]; c frama-c-20.0-Calcium/tests/value/oracle/f1.res.oracle0000666000000000000000000000216113571573400017223 0ustar [kernel] Parsing tests/value/f1.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/f1.i:5. [kernel:annot:missing-spec] tests/value/f1.i:5: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/f2.res.oracle0000666000000000000000000000134513571573400017227 0ustar [kernel] Parsing tests/value/f2.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing frama-c-20.0-Calcium/tests/value/oracle/false.res.oracle0000666000000000000000000000354613571573400020017 0ustar [kernel] Parsing tests/value/false.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/false.i:18. [kernel] tests/value/false.i:18: Warning: No code nor implicit assigns clause for function f, generating default assigns from the prototype [eva] using specification for function f [eva:alarm] tests/value/false.i:18: Warning: function f: precondition i ≡ 1 got status invalid. [eva] tests/value/false.i:18: function f: no state left, precondition i ≡ 1 got status valid. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/false.i:19. [eva:alarm] tests/value/false.i:10: Warning: function g: postcondition got status invalid. [eva] tests/value/false.i:11: function g: no state left, postcondition got status valid. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: [eva:final-states] Values at end of function main: i ∈ {0} [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NO EFFECTS [from] Function g: \result FROM i [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function g: \nothing [inout] Inputs for function g: \nothing [inout] Out (internal) for function main: i [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/fam_sizeof.res.oracle0000666000000000000000000000213213571573400021035 0ustar [kernel] Parsing tests/value/fam_sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization fam ∈ {0} nested ∈ {0} fam2 ∈ {0} gcc_fam ∈ {0} [eva] tests/value/fam_sizeof.i:44: assertion got status valid. [eva] tests/value/fam_sizeof.i:48: assertion got status valid. [eva] tests/value/fam_sizeof.i:50: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: z1 ∈ {4} z2 ∈ {20} z3 ∈ {12} z4 ∈ {16} z5 ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: z1; z2; z3; z4; z5; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/find_ivaltop.res.oracle0000666000000000000000000000227313571573400021377 0ustar [kernel] Parsing tests/value/find_ivaltop.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {6} [6] ∈ {7} [7] ∈ {8} [8] ∈ {9} [9] ∈ {0} [10] ∈ {1} [11] ∈ {2} [12] ∈ {3} [13] ∈ {4} [14] ∈ {5} [15] ∈ {6} [16] ∈ {7} [17] ∈ {8} [18] ∈ {9} [19] ∈ {0} [eva] tests/value/find_ivaltop.i:6: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {8} j ∈ {0; 1; 2; 3; 4; 5; 6; 7} X ∈ {1; 2; 3; 4; 5; 6; 7; 8} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM t[0..7] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; X [inout] Inputs for function main: t[0..7] frama-c-20.0-Calcium/tests/value/oracle/folding.res.oracle0000666000000000000000000000444613571573400020347 0ustar [kernel] Parsing tests/value/folding.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function g <- main. Called from tests/value/folding.i:23. [eva] computing for function f <- g <- main. Called from tests/value/folding.i:11. [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] Done for function g [eva] computing for function foo <- main. Called from tests/value/folding.i:24. [eva] Recording results for foo [eva] Done for function foo [eva] computing for function foo <- main. Called from tests/value/folding.i:24. [eva] Recording results for foo [eva] Done for function foo [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function foo: unknown ∈ [--..--] __retres ∈ {8; 9; 779} [eva:final-states] Values at end of function g: pfct ∈ {{ &f }} un ∈ {1} p ∈ {{ &deux }} deux ∈ {2} trois ∈ {5} [eva:final-states] Values at end of function main: a ∈ {17; 18; 787; 788} b ∈ {4} c ∈ {33; 34; 803; 804} __retres ∈ {37; 38; 807; 808} [from] Computing for function f [from] Done for function f [from] Computing for function foo [from] Done for function foo [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function foo: \result FROM x; y [from] Function g: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: \nothing [inout] Out (internal) for function foo: unknown; __retres [inout] Inputs for function foo: \nothing [inout] Out (internal) for function g: pfct; un; p; deux; trois; tmp [inout] Inputs for function g: \nothing [inout] Out (internal) for function main: a; b; c; tmp; tmp_0; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/for_loops.0.res.oracle0000666000000000000000000000372513571573400021064 0ustar [kernel] Parsing tests/value/for_loops.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] computing for function Frama_C_interval <- main. Called from tests/value/for_loops.c:24. [eva] using specification for function Frama_C_interval [eva] tests/value/for_loops.c:24: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/for_loops.c:30: Frama_C_show_each_F: {0} [eva] tests/value/for_loops.c:27: starting to merge loop iterations [eva] tests/value/for_loops.c:29: starting to merge loop iterations [eva] tests/value/for_loops.c:30: Frama_C_show_each_F: {0; 1} [eva] tests/value/for_loops.c:30: Frama_C_show_each_F: {0; 1; 2} [eva] tests/value/for_loops.c:30: Frama_C_show_each_F: [0..2147483647] [eva:alarm] tests/value/for_loops.c:27: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] j ∈ [1..2147483647] nSelectors ∈ [0..2147483646] w ∈ {0} v ∈ {0} [from] Computing for function main [from] Computing for function Frama_C_interval <-main [from] Done for function Frama_C_interval [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: Frama_C_entropy_source; j; nSelectors; w; v [inout] Inputs for function main: Frama_C_entropy_source frama-c-20.0-Calcium/tests/value/oracle/for_loops.1.res.oracle0000666000000000000000000000577413571573400021073 0ustar [kernel] Parsing tests/value/for_loops.c (with preprocessing) [eva] Analyzing a complete application starting at main_2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] computing for function Frama_C_interval <- main_2. Called from tests/value/for_loops.c:13. [eva] using specification for function Frama_C_interval [eva] tests/value/for_loops.c:13: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- main_2. Called from tests/value/for_loops.c:16. [eva] tests/value/for_loops.c:16: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: {0; 1} [eva] tests/value/for_loops.c:16: starting to merge loop iterations [eva] computing for function Frama_C_interval <- main_2. Called from tests/value/for_loops.c:16. [eva] Done for function Frama_C_interval [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: {0; 1; 2} [eva] computing for function Frama_C_interval <- main_2. Called from tests/value/for_loops.c:16. [eva] Done for function Frama_C_interval [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: {0; 1; 2; 3} [eva] computing for function Frama_C_interval <- main_2. Called from tests/value/for_loops.c:16. [eva] Done for function Frama_C_interval [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: {0; 1; 2; 3; 4} [eva] computing for function Frama_C_interval <- main_2. Called from tests/value/for_loops.c:16. [eva] Done for function Frama_C_interval [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: {0; 1; 2; 3; 4; 5} [eva] computing for function Frama_C_interval <- main_2. Called from tests/value/for_loops.c:16. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/for_loops.c:16: Warning: signed overflow. assert w + 1 ≤ 2147483647; [eva] tests/value/for_loops.c:17: Frama_C_show_each_F: [0..2147483647] [eva] Recording results for main_2 [eva] done for function main_2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main_2: Frama_C_entropy_source ∈ [--..--] j ∈ [0..2147483647] nSelectors ∈ [0..100] w ∈ [0..2147483647] v ∈ {0} [from] Computing for function main_2 [from] Computing for function Frama_C_interval <-main_2 [from] Done for function Frama_C_interval [from] Done for function main_2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function main_2: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main_2: Frama_C_entropy_source; j; nSelectors; w; v; tmp_0 [inout] Inputs for function main_2: Frama_C_entropy_source frama-c-20.0-Calcium/tests/value/oracle/for_loops.2.res.oracle0000666000000000000000000000463613571573400021070 0ustar [kernel] Parsing tests/value/for_loops.c (with preprocessing) [eva] Analyzing a complete application starting at main_3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] computing for function Frama_C_interval <- main_3. Called from tests/value/for_loops.c:37. [eva] using specification for function Frama_C_interval [eva] tests/value/for_loops.c:37: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/for_loops.c:39: Frama_C_dump_each: # Cvalue domain: Frama_C_entropy_source ∈ [--..--] x ∈ {0} j ∈ UNINITIALIZED T[0..999] ∈ UNINITIALIZED nSelectors ∈ [0..1000] w ∈ {0} ==END OF DUMP== [eva] tests/value/for_loops.c:40: starting to merge loop iterations [eva] tests/value/for_loops.c:41: Frama_C_dump_each: # Cvalue domain: Frama_C_entropy_source ∈ [--..--] x ∈ {0} j ∈ [0..1000] T[0..999] ∈ {1} or UNINITIALIZED nSelectors ∈ [0..1000] w ∈ {0} ==END OF DUMP== [eva:alarm] tests/value/for_loops.c:42: Warning: accessing uninitialized left-value. assert \initialized(&T[j]); [eva] tests/value/for_loops.c:42: starting to merge loop iterations [eva:alarm] tests/value/for_loops.c:42: Warning: signed overflow. assert w + T[j] ≤ 2147483647; [eva] tests/value/for_loops.c:43: Frama_C_show_each: [0..2147483647] [eva] Recording results for main_3 [eva] done for function main_3 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main_3: Frama_C_entropy_source ∈ [--..--] j ∈ [0..1000] T[0..999] ∈ {1} or UNINITIALIZED nSelectors ∈ [0..1000] w ∈ [0..2147483647] [from] Computing for function main_3 [from] Computing for function Frama_C_interval <-main_3 [from] Done for function Frama_C_interval [from] Done for function main_3 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function main_3: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main_3: Frama_C_entropy_source; j; T[0..999]; nSelectors; w [inout] Inputs for function main_3: Frama_C_entropy_source frama-c-20.0-Calcium/tests/value/oracle/for_loops.3.res.oracle0000666000000000000000000000236013571573400021061 0ustar [kernel] Parsing tests/value/for_loops.c (with preprocessing) [eva] Analyzing a complete application starting at main_4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] tests/value/for_loops.c:55: Frama_C_show_each_F: {0}, {0} [eva] tests/value/for_loops.c:50: starting to merge loop iterations [eva] tests/value/for_loops.c:52: starting to merge loop iterations [eva] tests/value/for_loops.c:55: Frama_C_show_each_F: {0; 1}, [0..2147483647] [eva] tests/value/for_loops.c:55: Frama_C_show_each_F: {0; 1; 2}, [0..2147483647] [eva] tests/value/for_loops.c:55: Frama_C_show_each_F: {0; 1; 2; 3; 4; 5}, [0..2147483647] [eva] Recording results for main_4 [eva] done for function main_4 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main_4: j ∈ {6} v ∈ [0..2147483647] [from] Computing for function main_4 [from] Done for function main_4 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main_4: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main_4: j; v [inout] Inputs for function main_4: \nothing frama-c-20.0-Calcium/tests/value/oracle/forall.res.oracle0000666000000000000000000000261613571573400020201 0ustar [kernel] Parsing tests/value/forall.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ {0} j ∈ [--..--] [eva:alarm] tests/value/forall.i:9: Warning: function main: precondition got status unknown. [eva] tests/value/forall.i:11: assertion got status valid. [eva:alarm] tests/value/forall.i:12: Warning: assertion got status unknown. [eva] tests/value/forall.i:13: assertion got status valid. [eva:alarm] tests/value/forall.i:15: Warning: assertion got status unknown. [eva:alarm] tests/value/forall.i:16: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0] ∈ {0} [1] ∈ {2} [2..9] ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[1] FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[1] [inout] Inputs for function main: \nothing [inout] InOut (internal) for function main: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: t[1] frama-c-20.0-Calcium/tests/value/oracle/fptr.0.res.oracle0000666000000000000000000001335413571573400020034 0ustar [kernel] Parsing tests/value/fptr.i (no preprocessing) [kernel:typing:incompatible-types-call] tests/value/fptr.i:44: Warning: implicit conversion between incompatible function types: short (*)(void) and int (*)() [kernel:typing:incompatible-types-call] tests/value/fptr.i:45: Warning: implicit conversion between incompatible function types: int (*)(void) and short (*)() [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization R ∈ {77} v ∈ [--..--] n ∈ {0} X ∈ {77} XH ∈ {0} XHH ∈ {0} GLOBAL[0..9] ∈ {0} G ∈ {0} TA ∈ {0} [eva] computing for function retshort <- main. Called from tests/value/fptr.i:42. [eva] Recording results for retshort [eva] Done for function retshort [eva] computing for function retint <- main. Called from tests/value/fptr.i:43. [eva] Recording results for retint [eva] Done for function retint [eva:alarm] tests/value/fptr.i:44: Warning: pointer to function with incompatible type. assert \valid_function((int (*)(void))(&retshort)); [eva:alarm] tests/value/fptr.i:45: Warning: pointer to function with incompatible type. assert \valid_function((short (*)(void))(&retint)); [eva] tests/value/fptr.i:51: Frama_C_show_each_F: {{ &h }} [eva] computing for function f <- main. Called from tests/value/fptr.i:52. [eva] computing for function h <- f <- main. Called from tests/value/fptr.i:9. [eva] Recording results for h [eva] Done for function h [eva] Recording results for f [eva] Done for function f [eva] tests/value/fptr.i:52: Frama_C_show_each: {0} [eva] tests/value/fptr.i:50: starting to merge loop iterations [eva] tests/value/fptr.i:51: Frama_C_show_each_F: {{ &h ; &hh }} [eva] computing for function f <- main. Called from tests/value/fptr.i:52. [eva] computing for function hh <- f <- main. Called from tests/value/fptr.i:9. [eva] Recording results for hh [eva] Done for function hh [eva] tests/value/fptr.i:9: Reusing old results for call to h [eva] Recording results for f [eva] Done for function f [eva] tests/value/fptr.i:52: Frama_C_show_each: {0; 1} [eva] tests/value/fptr.i:51: Frama_C_show_each_F: {{ NULL ; &h ; &hh }} [eva] computing for function f <- main. Called from tests/value/fptr.i:52. [eva:alarm] tests/value/fptr.i:9: Warning: pointer to function with incompatible type. assert \valid_function(ptr); [eva] tests/value/fptr.i:9: Reusing old results for call to hh [eva] tests/value/fptr.i:9: Reusing old results for call to h [eva] Recording results for f [eva] Done for function f [eva] tests/value/fptr.i:52: Frama_C_show_each: {0; 1} [eva] tests/value/fptr.i:51: Frama_C_show_each_F: {{ NULL ; &h ; &hh }} [eva] tests/value/fptr.i:52: Reusing old results for call to f [eva:alarm] tests/value/fptr.i:56: Warning: division by zero. assert (int)(c & 64) ≢ 0; [eva] computing for function hh <- main. Called from tests/value/fptr.i:56. [eva] Recording results for hh [eva] Done for function hh [eva] computing for function h <- main. Called from tests/value/fptr.i:56. [eva] Recording results for h [eva] Done for function h [eva] Recording results for main [eva] done for function main [eva] tests/value/fptr.i:44: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/fptr.i:45: assertion 'Eva,function_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function h: X ∈ {0; 1} XH ∈ {0; 1} [eva:final-states] Values at end of function hh: X ∈ {0; 2} XHH ∈ {0; 1} [eva:final-states] Values at end of function f: R ∈ {1; 2} n ∈ {1; 2; 3} X ∈ {1; 2} XH ∈ {0; 1} XHH ∈ {0; 1} [eva:final-states] Values at end of function retint: __retres ∈ {42} [eva:final-states] Values at end of function retshort: __retres ∈ {12} [eva:final-states] Values at end of function main: R ∈ {1; 2; 77} n ∈ {0; 1; 2; 3} X ∈ {0; 1; 2; 77} XH ∈ {0; 1} XHH ∈ {0; 1} GLOBAL[0] ∈ {{ &h }} [1] ∈ {{ &hh }} [2..9] ∈ {0} G ∈ {0; 1; 2} TA ∈ {0} in ∈ {12} or UNINITIALIZED pin ∈ UNINITIALIZED sh ∈ {42} or UNINITIALIZED psh ∈ UNINITIALIZED i ∈ {3} p ∈ {{ &h ; &hh }} [from] Computing for function h [from] Done for function h [from] Computing for function hh [from] Done for function hh [from] Computing for function f [from] Done for function f [from] Computing for function retint [from] Done for function retint [from] Computing for function retshort [from] Done for function retshort [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function h: X FROM y XH FROM y \result FROM y [from] Function hh: X FROM y XHH FROM y \result FROM y [from] Function f: R FROM ptr n FROM i X FROM ptr XH FROM ptr (and SELF) XHH FROM ptr (and SELF) \result FROM ptr [from] Function retint: \result FROM \nothing [from] Function retshort: \result FROM \nothing [from] Function main: R FROM v; GLOBAL[2] (and SELF) n FROM v (and SELF) X FROM v; GLOBAL[2]; c (and SELF) XH FROM v; GLOBAL[2]; c (and SELF) XHH FROM v; GLOBAL[2]; c (and SELF) GLOBAL[0..1] FROM \nothing G FROM v; GLOBAL[2] (and SELF) TA FROM c (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function h: X; XH [inout] Out (internal) for function hh: X; XHH [inout] Out (internal) for function f: R; n; X; XH; XHH [inout] Out (internal) for function retint: __retres [inout] Out (internal) for function retshort: __retres [inout] Out (internal) for function main: R; n; X; XH; XHH; GLOBAL[0..1]; G; TA; in; pin; sh; psh; tmp; tmp_0; i; p; tmp_1 frama-c-20.0-Calcium/tests/value/oracle/fptr.1.res.oracle0000666000000000000000000000712113571573400020030 0ustar [kernel] Parsing tests/value/fptr.i (no preprocessing) [kernel:typing:incompatible-types-call] tests/value/fptr.i:44: Warning: implicit conversion between incompatible function types: short (*)(void) and int (*)() [kernel:typing:incompatible-types-call] tests/value/fptr.i:45: Warning: implicit conversion between incompatible function types: int (*)(void) and short (*)() [eva] Analyzing a complete application starting at main_uninit [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization R ∈ {77} v ∈ [--..--] n ∈ {0} X ∈ {77} XH ∈ {0} XHH ∈ {0} GLOBAL[0..9] ∈ {0} G ∈ {0} TA ∈ {0} [eva] tests/value/fptr.i:67: Frama_C_show_each_F: {{ &h }} [eva] computing for function f <- main_uninit. Called from tests/value/fptr.i:68. [eva] computing for function h <- f <- main_uninit. Called from tests/value/fptr.i:9. [eva] Recording results for h [eva] Done for function h [eva] Recording results for f [eva] Done for function f [eva] tests/value/fptr.i:66: starting to merge loop iterations [eva] tests/value/fptr.i:67: Frama_C_show_each_F: {{ &h ; &hh }} [eva] computing for function f <- main_uninit. Called from tests/value/fptr.i:68. [eva] computing for function hh <- f <- main_uninit. Called from tests/value/fptr.i:9. [eva] Recording results for hh [eva] Done for function hh [eva] tests/value/fptr.i:9: Reusing old results for call to h [eva] Recording results for f [eva] Done for function f [eva] tests/value/fptr.i:67: Frama_C_show_each_F: {{ NULL + [0..4294967295] ; &h ; &hh }} [eva] computing for function f <- main_uninit. Called from tests/value/fptr.i:68. [eva:alarm] tests/value/fptr.i:9: Warning: pointer to function with incompatible type. assert \valid_function(ptr); [eva] tests/value/fptr.i:9: Reusing old results for call to hh [eva] tests/value/fptr.i:9: Reusing old results for call to h [eva] Recording results for f [eva] Done for function f [eva] tests/value/fptr.i:67: Frama_C_show_each_F: {{ NULL + [0..4294967295] ; &h ; &hh }} [eva] tests/value/fptr.i:68: Reusing old results for call to f [eva] Recording results for main_uninit [eva] done for function main_uninit [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function h: X ∈ {1} XH ∈ {1} [eva:final-states] Values at end of function hh: X ∈ {2} XHH ∈ {1} [eva:final-states] Values at end of function f: R ∈ {1; 2} n ∈ {0; 1; 2} X ∈ {1; 2} XH ∈ {0; 1} XHH ∈ {0; 1} [eva:final-states] Values at end of function main_uninit: NON TERMINATING FUNCTION [from] Computing for function h [from] Done for function h [from] Computing for function hh [from] Done for function hh [from] Computing for function f [from] Done for function f [from] Computing for function main_uninit [from] Non-terminating function main_uninit (no dependencies) [from] Done for function main_uninit [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function h: X FROM y XH FROM y \result FROM y [from] Function hh: X FROM y XHH FROM y \result FROM y [from] Function f: R FROM ptr n FROM i X FROM ptr XH FROM ptr (and SELF) XHH FROM ptr (and SELF) \result FROM ptr [from] Function main_uninit: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function h: X; XH [inout] Out (internal) for function hh: X; XHH [inout] Out (internal) for function f: R; n; X; XH; XHH [inout] Out (internal) for function main_uninit: R; n; X; XH; XHH; GLOBAL[0..2]; G; i; j frama-c-20.0-Calcium/tests/value/oracle/from1.res.oracle0000666000000000000000000000330513571573400017742 0ustar [kernel] Parsing tests/value/from1.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} cx ∈ {0} cy ∈ {0} cz ∈ {0} sx ∈ {0} sy ∈ {0} s ∈ {0} [eva] computing for function f <- main. Called from tests/value/from1.i:23. [eva] Recording results for f [eva] Done for function f [eva] computing for function sf <- main. Called from tests/value/from1.i:25. [eva] Recording results for sf [eva] Done for function sf [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: cy ∈ {0} [eva:final-states] Values at end of function sf: __retres ∈ {0} [eva:final-states] Values at end of function main: G ∈ [--..--] cx ∈ {0} cy ∈ {0} s_0 ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function sf [from] Done for function sf [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: cy FROM cx [from] Function sf: \result FROM ps; s_0.a [from] Function main: G FROM x; y (and SELF) cx FROM cz cy FROM cz \result FROM sx [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: cy [inout] Inputs for function f: cx [inout] Out (internal) for function sf: __retres [inout] Inputs for function sf: s_0.a [inout] Out (internal) for function main: G; cx; cy; s_0; tmp [inout] Inputs for function main: cx; cz; sx; sy frama-c-20.0-Calcium/tests/value/oracle/from_call.0.res.oracle0000666000000000000000000002623013571573400021014 0ustar [kernel] Parsing tests/value/from_call.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} d ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t ∈ {0} A1 ∈ {0} A2 ∈ {0} A3 ∈ {0} A4 ∈ {0} A5 ∈ {0} A6 ∈ {0} A7 ∈ {0} A8 ∈ {0} R1 ∈ {0} R2 ∈ {0} R3 ∈ {0} S1 ∈ {0} S2 ∈ {0} S3 ∈ {0} T0 ∈ {0} T1 ∈ {0} T2 ∈ {0} tab[0..4] ∈ {0} AA ∈ {0} AR ∈ {0} AS ∈ {0} At[0] ∈ {{ (int)&AA }} [1] ∈ {0} Ar[0] ∈ {{ (int)&AA }} [1] ∈ {0} Ap ∈ {{ &At[0] }} f_previous ∈ {{ &a }} [eva] computing for function f <- main. Called from tests/value/from_call.i:81. [eva] computing for function h <- f <- main. Called from tests/value/from_call.i:20. [kernel:annot:missing-spec] tests/value/from_call.i:20: Warning: Neither code nor specification for function h, generating default assigns from the prototype [eva] using specification for function h [eva] Done for function h [eva] computing for function g <- f <- main. Called from tests/value/from_call.i:20. [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/from_call.i:82. [eva] computing for function h <- f <- main. Called from tests/value/from_call.i:20. [eva] Done for function h [eva] tests/value/from_call.i:20: Reusing old results for call to g [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/from_call.i:82. [eva] computing for function h <- f <- main. Called from tests/value/from_call.i:20. [eva] Done for function h [eva] tests/value/from_call.i:20: Reusing old results for call to g [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva:alarm] tests/value/from_call.i:82: Warning: signed overflow. assert -2147483648 ≤ tmp + tmp_0; (tmp from f(& c), tmp_0 from f(& d)) [eva:alarm] tests/value/from_call.i:82: Warning: signed overflow. assert tmp + tmp_0 ≤ 2147483647; (tmp from f(& c), tmp_0 from f(& d)) [eva] computing for function dispatcher <- main. Called from tests/value/from_call.i:83. [eva] Recording results for dispatcher [from] Computing for function dispatcher [from] Done for function dispatcher [eva] Done for function dispatcher [eva] computing for function dispatcher <- main. Called from tests/value/from_call.i:84. [eva] Recording results for dispatcher [from] Computing for function dispatcher [from] Done for function dispatcher [eva] Done for function dispatcher [eva] computing for function dispatcher <- main. Called from tests/value/from_call.i:85. [eva] Recording results for dispatcher [from] Computing for function dispatcher [from] Done for function dispatcher [eva] Done for function dispatcher [eva] computing for function call_dispatcher2_1 <- main. Called from tests/value/from_call.i:86. [eva] computing for function dispatcher2 <- call_dispatcher2_1 <- main. Called from tests/value/from_call.i:49. [eva] computing for function return_A1 <- dispatcher2 <- call_dispatcher2_1 <- main. Called from tests/value/from_call.i:44. [eva] Recording results for return_A1 [from] Computing for function return_A1 [from] Done for function return_A1 [eva] Done for function return_A1 [eva] Recording results for dispatcher2 [from] Computing for function dispatcher2 [from] Done for function dispatcher2 [eva] Done for function dispatcher2 [eva] Recording results for call_dispatcher2_1 [from] Computing for function call_dispatcher2_1 [from] Done for function call_dispatcher2_1 [eva] Done for function call_dispatcher2_1 [eva] computing for function call_dispatcher2_0 <- main. Called from tests/value/from_call.i:87. [eva] computing for function dispatcher2 <- call_dispatcher2_0 <- main. Called from tests/value/from_call.i:54. [eva] computing for function return_A2 <- dispatcher2 <- call_dispatcher2_0 <- main. Called from tests/value/from_call.i:44. [eva] Recording results for return_A2 [from] Computing for function return_A2 [from] Done for function return_A2 [eva] Done for function return_A2 [eva] Recording results for dispatcher2 [from] Computing for function dispatcher2 [from] Done for function dispatcher2 [eva] Done for function dispatcher2 [eva] Recording results for call_dispatcher2_0 [from] Computing for function call_dispatcher2_0 [from] Done for function call_dispatcher2_0 [eva] Done for function call_dispatcher2_0 [eva] computing for function call_dispatcher2 <- main. Called from tests/value/from_call.i:88. [eva] computing for function dispatcher2 <- call_dispatcher2 <- main. Called from tests/value/from_call.i:59. [eva] tests/value/from_call.i:44: Reusing old results for call to return_A1 [eva] tests/value/from_call.i:44: Reusing old results for call to return_A2 [eva] Recording results for dispatcher2 [from] Computing for function dispatcher2 [from] Done for function dispatcher2 [eva] Done for function dispatcher2 [eva] Recording results for call_dispatcher2 [from] Computing for function call_dispatcher2 [from] Done for function call_dispatcher2 [eva] Done for function call_dispatcher2 [eva] computing for function access_tab <- main. Called from tests/value/from_call.i:92. [eva] Recording results for access_tab [from] Computing for function access_tab [from] Done for function access_tab [eva] Done for function access_tab [eva] computing for function access_tab <- main. Called from tests/value/from_call.i:93. [eva] Recording results for access_tab [from] Computing for function access_tab [from] Done for function access_tab [eva] Done for function access_tab [eva] computing for function access_tab <- main. Called from tests/value/from_call.i:94. [eva] Recording results for access_tab [from] Computing for function access_tab [from] Done for function access_tab [eva] Done for function access_tab [eva] computing for function unavailable_f <- main. Called from tests/value/from_call.i:96. [eva] using specification for function unavailable_f [eva] Done for function unavailable_f [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function access_tab: __retres ∈ {0} [eva:final-states] Values at end of function dispatcher: [eva:final-states] Values at end of function g: __retres ∈ [--..--] [eva:final-states] Values at end of function f: b ∈ {0} c ∈ {0} d ∈ {0} f_previous ∈ {{ &b ; &c ; &d }} [eva:final-states] Values at end of function return_A1: [eva:final-states] Values at end of function return_A2: [eva:final-states] Values at end of function dispatcher2: [eva:final-states] Values at end of function call_dispatcher2: [eva:final-states] Values at end of function call_dispatcher2_0: [eva:final-states] Values at end of function call_dispatcher2_1: [eva:final-states] Values at end of function main: b ∈ {0} c ∈ {0} d ∈ {0} y ∈ [--..--] z ∈ [--..--] R1 ∈ {0} R2 ∈ {0} R3 ∈ {0} S1 ∈ {0} S2 ∈ {0} S3 ∈ {0} T0 ∈ {0} T1 ∈ {0} T2 ∈ {0} tab[0..4] ∈ {0} AR ∈ {{ garbled mix of &{AA} (origin: Library function {tests/value/from_call.i:96}) }} AS ∈ {{ garbled mix of &{AA} (origin: Library function {tests/value/from_call.i:96}) }} f_previous ∈ {{ &d }} [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to g at tests/value/from_call.i:20 (by f): \result FROM t; w [from] call to h at tests/value/from_call.i:20 (by f): \result FROM \nothing [from] call to return_A1 at tests/value/from_call.i:44 (by dispatcher2): \result FROM A1 [from] call to return_A2 at tests/value/from_call.i:44 (by dispatcher2): \result FROM A2 [from] call to dispatcher2 at tests/value/from_call.i:59 (by call_dispatcher2): \result FROM A1; A2; c_0 [from] call to dispatcher2 at tests/value/from_call.i:54 (by call_dispatcher2_0): \result FROM A2; c_0 [from] call to dispatcher2 at tests/value/from_call.i:49 (by call_dispatcher2_1): \result FROM A1; c_0 [from] call to f at tests/value/from_call.i:81 (by main): b FROM a; p; f_previous f_previous FROM p \result FROM a; t; p; f_previous [from] call to f at tests/value/from_call.i:82 (by main): c FROM b; p; f_previous f_previous FROM p \result FROM b; t; p; f_previous [from] call to f at tests/value/from_call.i:82 (by main): d FROM c; p; f_previous f_previous FROM p \result FROM c; t; p; f_previous [from] call to dispatcher at tests/value/from_call.i:83 (by main): \result FROM c_0; y_0 [from] call to dispatcher at tests/value/from_call.i:84 (by main): \result FROM c_0; z_0 [from] call to dispatcher at tests/value/from_call.i:85 (by main): \result FROM c_0; y_0; z_0 [from] call to call_dispatcher2_1 at tests/value/from_call.i:86 (by main): \result FROM A1 [from] call to call_dispatcher2_0 at tests/value/from_call.i:87 (by main): \result FROM A2 [from] call to call_dispatcher2 at tests/value/from_call.i:88 (by main): \result FROM A1; A2; r [from] call to access_tab at tests/value/from_call.i:92 (by main): \result FROM tab[0]; ind [from] call to access_tab at tests/value/from_call.i:93 (by main): \result FROM tab[1]; ind [from] call to access_tab at tests/value/from_call.i:94 (by main): \result FROM tab[2]; ind [from] call to unavailable_f at tests/value/from_call.i:96 (by main): AR FROM At[0..1] AS FROM Ar[0..1] [from] entry point: b FROM a; f_previous c FROM a; f_previous d FROM a; f_previous y FROM a; t; f_previous z FROM a; t; f_previous R1 FROM A1 R2 FROM A4 R3 FROM A4; A5; r S1 FROM A1 S2 FROM A2 S3 FROM A1; A2; r T0 FROM A1 T1 FROM A2; A3 T2 FROM A4 tab[0] FROM A1 [1] FROM A2; A3 [2] FROM A4 AR FROM At[0..1] AS FROM Ar[0..1] f_previous FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [users] ====== DISPLAYING USERS ====== f: g h dispatcher2: return_A1 return_A2 call_dispatcher2: return_A1 return_A2 dispatcher2 call_dispatcher2_0: return_A2 dispatcher2 call_dispatcher2_1: return_A1 dispatcher2 main: g h f dispatcher return_A1 return_A2 dispatcher2 call_dispatcher2_1 call_dispatcher2_0 call_dispatcher2 access_tab unavailable_f ====== END OF USERS ========== [inout] Inputs for function access_tab: tab[0..2] [inout] Inputs for function dispatcher: \nothing [inout] Inputs for function g: t [inout] Inputs for function f: a; b; c; d; x; t; f_previous [inout] Inputs for function return_A1: A1 [inout] Inputs for function return_A2: A2 [inout] Inputs for function dispatcher2: A1; A2 [inout] Inputs for function call_dispatcher2: A1; A2 [inout] Inputs for function call_dispatcher2_0: A1; A2 [inout] Inputs for function call_dispatcher2_1: A1; A2 [inout] Inputs for function main: a; b; c; d; x; t; A1; A2; A3; A4; A5; A6; A7; tab[0..2]; At[0..1]; Ar[0..1]; f_previous frama-c-20.0-Calcium/tests/value/oracle/from_call.1.res.oracle0000666000000000000000000001762013571573400021020 0ustar [kernel] Parsing tests/value/from_call.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} d ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t ∈ {0} A1 ∈ {0} A2 ∈ {0} A3 ∈ {0} A4 ∈ {0} A5 ∈ {0} A6 ∈ {0} A7 ∈ {0} A8 ∈ {0} R1 ∈ {0} R2 ∈ {0} R3 ∈ {0} S1 ∈ {0} S2 ∈ {0} S3 ∈ {0} T0 ∈ {0} T1 ∈ {0} T2 ∈ {0} tab[0..4] ∈ {0} AA ∈ {0} AR ∈ {0} AS ∈ {0} At[0] ∈ {{ (int)&AA }} [1] ∈ {0} Ar[0] ∈ {{ (int)&AA }} [1] ∈ {0} Ap ∈ {{ &At[0] }} f_previous ∈ {{ &a }} [eva] computing for function f <- main. Called from tests/value/from_call.i:81. [eva] computing for function h <- f <- main. Called from tests/value/from_call.i:20. [kernel:annot:missing-spec] tests/value/from_call.i:20: Warning: Neither code nor specification for function h, generating default assigns from the prototype [eva] using specification for function h [eva] Done for function h [eva] computing for function g <- f <- main. Called from tests/value/from_call.i:20. [eva] Recording results for g [eva] Done for function g [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/from_call.i:82. [eva] computing for function h <- f <- main. Called from tests/value/from_call.i:20. [eva] Done for function h [eva] tests/value/from_call.i:20: Reusing old results for call to g [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/from_call.i:82. [eva] computing for function h <- f <- main. Called from tests/value/from_call.i:20. [eva] Done for function h [eva] tests/value/from_call.i:20: Reusing old results for call to g [eva] Recording results for f [eva] Done for function f [eva:alarm] tests/value/from_call.i:82: Warning: signed overflow. assert -2147483648 ≤ tmp + tmp_0; (tmp from f(& c), tmp_0 from f(& d)) [eva:alarm] tests/value/from_call.i:82: Warning: signed overflow. assert tmp + tmp_0 ≤ 2147483647; (tmp from f(& c), tmp_0 from f(& d)) [eva] computing for function dispatcher <- main. Called from tests/value/from_call.i:83. [eva] Recording results for dispatcher [eva] Done for function dispatcher [eva] computing for function dispatcher <- main. Called from tests/value/from_call.i:84. [eva] Recording results for dispatcher [eva] Done for function dispatcher [eva] computing for function dispatcher <- main. Called from tests/value/from_call.i:85. [eva] Recording results for dispatcher [eva] Done for function dispatcher [eva] computing for function call_dispatcher2_1 <- main. Called from tests/value/from_call.i:86. [eva] computing for function dispatcher2 <- call_dispatcher2_1 <- main. Called from tests/value/from_call.i:49. [eva] computing for function return_A1 <- dispatcher2 <- call_dispatcher2_1 <- main. Called from tests/value/from_call.i:44. [eva] Recording results for return_A1 [eva] Done for function return_A1 [eva] Recording results for dispatcher2 [eva] Done for function dispatcher2 [eva] Recording results for call_dispatcher2_1 [eva] Done for function call_dispatcher2_1 [eva] computing for function call_dispatcher2_0 <- main. Called from tests/value/from_call.i:87. [eva] computing for function dispatcher2 <- call_dispatcher2_0 <- main. Called from tests/value/from_call.i:54. [eva] computing for function return_A2 <- dispatcher2 <- call_dispatcher2_0 <- main. Called from tests/value/from_call.i:44. [eva] Recording results for return_A2 [eva] Done for function return_A2 [eva] Recording results for dispatcher2 [eva] Done for function dispatcher2 [eva] Recording results for call_dispatcher2_0 [eva] Done for function call_dispatcher2_0 [eva] computing for function call_dispatcher2 <- main. Called from tests/value/from_call.i:88. [eva] computing for function dispatcher2 <- call_dispatcher2 <- main. Called from tests/value/from_call.i:59. [eva] tests/value/from_call.i:44: Reusing old results for call to return_A1 [eva] tests/value/from_call.i:44: Reusing old results for call to return_A2 [eva] Recording results for dispatcher2 [eva] Done for function dispatcher2 [eva] Recording results for call_dispatcher2 [eva] Done for function call_dispatcher2 [eva] computing for function access_tab <- main. Called from tests/value/from_call.i:92. [eva] Recording results for access_tab [eva] Done for function access_tab [eva] computing for function access_tab <- main. Called from tests/value/from_call.i:93. [eva] Recording results for access_tab [eva] Done for function access_tab [eva] computing for function access_tab <- main. Called from tests/value/from_call.i:94. [eva] Recording results for access_tab [eva] Done for function access_tab [eva] computing for function unavailable_f <- main. Called from tests/value/from_call.i:96. [eva] using specification for function unavailable_f [eva] Done for function unavailable_f [eva] Recording results for main [eva] done for function main [from] Computing for function access_tab [from] Done for function access_tab [from] Computing for function dispatcher [from] Done for function dispatcher [from] Computing for function g [from] Done for function g [from] Computing for function f [from] Computing for function h <-f [from] Done for function h [from] Done for function f [from] Computing for function return_A1 [from] Done for function return_A1 [from] Computing for function return_A2 [from] Done for function return_A2 [from] Computing for function dispatcher2 [from] Done for function dispatcher2 [from] Computing for function call_dispatcher2 [from] Done for function call_dispatcher2 [from] Computing for function call_dispatcher2_0 [from] Done for function call_dispatcher2_0 [from] Computing for function call_dispatcher2_1 [from] Done for function call_dispatcher2_1 [from] Computing for function main [from] Computing for function unavailable_f <-main [from] Done for function unavailable_f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function access_tab: \result FROM indirect: ind; direct: tab[0..2] [from] Function dispatcher: \result FROM indirect: c_0; direct: y_0; z_0 [from] Function g: \result FROM direct: t; w [from] Function h: \result FROM \nothing [from] Function f: b FROM indirect: p; f_previous; direct: a; b; c (and SELF) c FROM indirect: p; f_previous; direct: a; b; c (and SELF) d FROM indirect: p; f_previous; direct: a; b; c (and SELF) f_previous FROM direct: p \result FROM indirect: p; f_previous; direct: a; b; c; d; t [from] Function return_A1: \result FROM direct: A1 [from] Function return_A2: \result FROM direct: A2 [from] Function dispatcher2: \result FROM indirect: c_0; direct: A1; A2 [from] Function call_dispatcher2: \result FROM indirect: r; direct: A1; A2 [from] Function call_dispatcher2_0: \result FROM direct: A1; A2 [from] Function call_dispatcher2_1: \result FROM direct: A1; A2 [from] Function unavailable_f: AR FROM direct: At[0..1] AS FROM direct: Ar[0..1] [from] Function main: b FROM indirect: f_previous; direct: a; b; c (and SELF) c FROM indirect: f_previous; direct: a; b; c (and SELF) d FROM indirect: f_previous; direct: a; b; c (and SELF) y FROM indirect: f_previous; direct: a; b; c; d; t z FROM indirect: f_previous; direct: a; b; c; d; t R1 FROM direct: A1; A2 R2 FROM direct: A3; A4 R3 FROM indirect: r; direct: A4; A5 S1 FROM direct: A1; A2 S2 FROM direct: A1; A2 S3 FROM indirect: r; direct: A1; A2 T0 FROM direct: A1; A2; A3; A4 T1 FROM direct: A1; A2; A3; A4 T2 FROM direct: A1; A2; A3; A4 tab[0] FROM direct: A1 [1] FROM direct: A2; A3 [2] FROM direct: A4 AR FROM direct: At[0..1] AS FROM direct: Ar[0..1] f_previous FROM \nothing [from] ====== END OF DEPENDENCIES ====== frama-c-20.0-Calcium/tests/value/oracle/from_global.res.oracle0000666000000000000000000000246313571573400021205 0ustar [kernel] Parsing tests/value/from_global.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} [eva] computing for function f <- main. Called from tests/value/from_global.i:13. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: B ∈ {0} C ∈ {0} [eva:final-states] Values at end of function main: A ∈ {0} B ∈ {0} C ∈ {0} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: B FROM A C FROM x \result FROM x [from] Function main: A FROM D B FROM D C FROM E \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: B; C [inout] Inputs for function f: A; C [inout] Out (internal) for function main: A; B; C; __retres [inout] Inputs for function main: A; C; D; E frama-c-20.0-Calcium/tests/value/oracle/from_ind.res.oracle0000666000000000000000000000154613571573400020520 0ustar [kernel] Parsing tests/value/from_ind.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a[0..3] ∈ {0} p ∈ {{ &a[0] }} r ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: r ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: r FROM indirect: p; direct: a[1] \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: r; __retres [inout] Inputs for function main: a[1]; p frama-c-20.0-Calcium/tests/value/oracle/from_pb.0.res.oracle0000666000000000000000000000151113571573400020475 0ustar [kernel] Parsing tests/value/from_pb.i (no preprocessing) [eva] Analyzing a complete application starting at main0 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} i ∈ {0} j ∈ {0} x ∈ {0} c ∈ {0} d ∈ {0} T[0..9] ∈ {0} [eva] Recording results for main0 [eva] done for function main0 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main0: x ∈ {0} [from] Computing for function main0 [from] Done for function main0 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main0: x FROM k; j [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main0: x [inout] Inputs for function main0: k; j frama-c-20.0-Calcium/tests/value/oracle/from_pb.1.res.oracle0000666000000000000000000000151113571573400020476 0ustar [kernel] Parsing tests/value/from_pb.i (no preprocessing) [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} i ∈ {0} j ∈ {0} x ∈ {0} c ∈ {0} d ∈ {0} T[0..9] ∈ {0} [eva] Recording results for main1 [eva] done for function main1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: x ∈ {0} [from] Computing for function main1 [from] Done for function main1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: x FROM k; j [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: x [inout] Inputs for function main1: k; j frama-c-20.0-Calcium/tests/value/oracle/from_pb.2.res.oracle0000666000000000000000000000151113571573400020477 0ustar [kernel] Parsing tests/value/from_pb.i (no preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} i ∈ {0} j ∈ {0} x ∈ {0} c ∈ {0} d ∈ {0} T[0..9] ∈ {0} [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: x ∈ {0} [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2: x FROM k; j [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: x [inout] Inputs for function main2: k; j frama-c-20.0-Calcium/tests/value/oracle/from_pb.3.res.oracle0000666000000000000000000000155713571573400020512 0ustar [kernel] Parsing tests/value/from_pb.i (no preprocessing) [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} i ∈ {0} j ∈ {0} x ∈ {0} c ∈ {0} d ∈ {0} T[0..9] ∈ {0} [eva] Recording results for main3 [eva] done for function main3 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main3: T[0..9] ∈ {0} p ∈ {{ &T + {1} }} [from] Computing for function main3 [from] Done for function main3 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main3: T[1] FROM x; c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main3: T[1]; p [inout] Inputs for function main3: x; c frama-c-20.0-Calcium/tests/value/oracle/from_pb.4.res.oracle0000666000000000000000000000152513571573400020506 0ustar [kernel] Parsing tests/value/from_pb.i (no preprocessing) [eva] Analyzing a complete application starting at main4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} i ∈ {0} j ∈ {0} x ∈ {0} c ∈ {0} d ∈ {0} T[0..9] ∈ {0} [eva] Recording results for main4 [eva] done for function main4 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main4: T[0..9] ∈ {0} [from] Computing for function main4 [from] Done for function main4 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main4: T[0] FROM k; c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main4: T[0] [inout] Inputs for function main4: k; c frama-c-20.0-Calcium/tests/value/oracle/from_pb.5.res.oracle0000666000000000000000000000161313571573400020505 0ustar [kernel] Parsing tests/value/from_pb.i (no preprocessing) [eva] Analyzing a complete application starting at main4bis [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} i ∈ {0} j ∈ {0} x ∈ {0} c ∈ {0} d ∈ {0} T[0..9] ∈ {0} [eva] Recording results for main4bis [eva] done for function main4bis [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main4bis: T[0..9] ∈ {0} [from] Computing for function main4bis [from] Done for function main4bis [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main4bis: T[0] FROM i; c [2] FROM j; c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main4bis: T{[0]; [2]} [inout] Inputs for function main4bis: i; j; c frama-c-20.0-Calcium/tests/value/oracle/from_pb.6.res.oracle0000666000000000000000000000152513571573400020510 0ustar [kernel] Parsing tests/value/from_pb.i (no preprocessing) [eva] Analyzing a complete application starting at main5 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} i ∈ {0} j ∈ {0} x ∈ {0} c ∈ {0} d ∈ {0} T[0..9] ∈ {0} [eva] Recording results for main5 [eva] done for function main5 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main5: T[0..9] ∈ {0} [from] Computing for function main5 [from] Done for function main5 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main5: T[0] FROM k; c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main5: T[0] [inout] Inputs for function main5: k; c frama-c-20.0-Calcium/tests/value/oracle/from_pb.7.res.oracle0000666000000000000000000000160713571573400020512 0ustar [kernel] Parsing tests/value/from_pb.i (no preprocessing) [eva] Analyzing a complete application starting at main5bis [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} i ∈ {0} j ∈ {0} x ∈ {0} c ∈ {0} d ∈ {0} T[0..9] ∈ {0} [eva] Recording results for main5bis [eva] done for function main5bis [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main5bis: T[0..9] ∈ {0} [from] Computing for function main5bis [from] Done for function main5bis [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main5bis: T[0] FROM i; c [1] FROM j; c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main5bis: T[0..1] [inout] Inputs for function main5bis: i; j; c frama-c-20.0-Calcium/tests/value/oracle/from_ptr.0.res.oracle0000666000000000000000000000241413571573400020704 0ustar [kernel] Parsing tests/value/from_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} a ∈ {0} b ∈ {0} p[0..9][0..9][0..9] ∈ {0} q ∈ {0} [eva:alarm] tests/value/from_ptr.i:17: Warning: out of bounds write. assert \valid((int *)i); [kernel] tests/value/from_ptr.i:17: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/from_ptr.i:17: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {{ (long)&p[10] }} d ∈ {0} q ∈ {{ &b }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: i FROM \nothing d FROM b; c q FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; d; q [inout] Inputs for function main: i; a; b; q frama-c-20.0-Calcium/tests/value/oracle/from_ptr.1.res.oracle0000666000000000000000000000206713571573400020711 0ustar [kernel] Parsing tests/value/from_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} a ∈ {0} b ∈ {0} p[0..9][0..9][0..9] ∈ {0} q ∈ {0} [eva] Recording results for main1 [eva] done for function main1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: i ∈ {{ (long)&p }} d ∈ {0} p[0..9][0..9][0..9] ∈ {0} q ∈ {{ &a ; &b }} [from] Computing for function main1 [from] Done for function main1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: i FROM \nothing d FROM a; b; c p[0][0][0] FROM a; c (and SELF) q FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: i; d; p[0][0][0]; q [inout] Inputs for function main1: i; a; b; q frama-c-20.0-Calcium/tests/value/oracle/from_ptr2.res.oracle0000666000000000000000000000221513571573400020627 0ustar [kernel] Parsing tests/value/from_ptr2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/from_ptr2.i:7. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ [--..--] [eva:final-states] Values at end of function main: s ∈ [--..--] [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM ps; s.a [from] Function main: \result FROM x [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: s.a [inout] Out (internal) for function main: s; tmp [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/from_res_2.res.oracle0000666000000000000000000000527213571573400020760 0ustar [kernel] Parsing tests/value/from_res_2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} A ∈ {0} B ∈ {0} C ∈ {0} x1 ∈ {0} x2 ∈ {0} x3 ∈ {0} y1 ∈ {0} y2 ∈ {0} y3 ∈ {0} [eva] computing for function f <- main. Called from tests/value/from_res_2.i:26. [eva] Recording results for f [eva] Done for function f [eva] computing for function g1 <- main. Called from tests/value/from_res_2.i:30. [eva] Recording results for g1 [eva] Done for function g1 [eva] computing for function g2 <- main. Called from tests/value/from_res_2.i:34. [eva] Recording results for g2 [eva] Done for function g2 [eva] computing for function g3 <- main. Called from tests/value/from_res_2.i:38. [eva] Recording results for g3 [eva] Done for function g3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {3} [eva:final-states] Values at end of function g1: [eva:final-states] Values at end of function g2: [eva:final-states] Values at end of function g3: [eva:final-states] Values at end of function main: G ∈ {3} x1 ∈ {0} x2 ∈ {0} x3 ∈ {0} y1 ∈ {0} y2 ∈ {0} y3 ∈ {0} p ∈ {{ &G }} [from] Computing for function f [from] Done for function f [from] Computing for function g1 [from] Done for function g1 [from] Computing for function g2 [from] Done for function g2 [from] Computing for function g3 [from] Done for function g3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM left; right [from] Function g1: \result FROM x1 [from] Function g2: \result FROM x2 [from] Function g3: \result FROM x3 [from] Function main: G FROM G x1.a FROM A .c FROM C x2.a FROM A .b FROM B x3.b FROM B .c FROM C y1 FROM A; C; x1.b y2 FROM A; B; x2.c y3 FROM B; C; x3.a [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function g1: \nothing [inout] Inputs for function g1: x1 [inout] Out (internal) for function g2: \nothing [inout] Inputs for function g2: x2 [inout] Out (internal) for function g3: \nothing [inout] Inputs for function g3: x3 [inout] Out (internal) for function main: G; x1{.a; .c}; x2{.a; .b}; x3{.b; .c}; y1; y2; y3; p; tmp [inout] Inputs for function main: G; A; B; C; x1; x2; x3 frama-c-20.0-Calcium/tests/value/oracle/from_termin.res.oracle0000666000000000000000000000144613571573400021243 0ustar [kernel] Parsing tests/value/from_termin.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization b ∈ {0} c ∈ {0} d ∈ {0} e ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: b ∈ {0} d ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: b FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: b; d [inout] Inputs for function main: c; e frama-c-20.0-Calcium/tests/value/oracle/fun_ptr.0.res.oracle0000666000000000000000000001742213571573400020536 0ustar [kernel] Parsing tests/value/fun_ptr.i (no preprocessing) [kernel:typing:incompatible-types-call] tests/value/fun_ptr.i:55: Warning: implicit conversion between incompatible function types: void (*)(int j, void *p) and void (*)(long , short *) [kernel:typing:incompatible-types-call] tests/value/fun_ptr.i:56: Warning: expected 'short *' but got argument of type 'int *': & x [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {{ (long long)&f }} [1] ∈ {{ (long long)&g }} R1 ∈ {0} R2 ∈ {0} R3 ∈ {0} v ∈ [--..--] [eva] computing for function test1 <- main. Called from tests/value/fun_ptr.i:78. [eva:alarm] tests/value/fun_ptr.i:28: Warning: pointer to function with incompatible type. assert \valid_function((int (*)(int ))t[nd]); [eva] computing for function f <- test1 <- main. Called from tests/value/fun_ptr.i:28. [eva] Recording results for f [eva] Done for function f [eva] Recording results for test1 [eva] Done for function test1 [eva] computing for function test2 <- main. Called from tests/value/fun_ptr.i:79. [eva:alarm] tests/value/fun_ptr.i:33: Warning: pointer to function with incompatible type. assert \valid_function((int (*)(int , int ))t[nd]); [eva] computing for function g <- test2 <- main. Called from tests/value/fun_ptr.i:33. [eva] Recording results for g [eva] Done for function g [eva] tests/value/fun_ptr.i:33: Reusing old results for call to f [eva] Recording results for test2 [eva] Done for function test2 [eva] computing for function test3 <- main. Called from tests/value/fun_ptr.i:80. [eva:alarm] tests/value/fun_ptr.i:38: Warning: pointer to function with incompatible type. assert \valid_function((double (*)(int ))t[nd]); [eva] Recording results for test3 [eva] Done for function test3 [eva:alarm] tests/value/fun_ptr.i:83: Warning: pointer to function with incompatible type. assert \valid_function((double (*)(double , double ))ph); [eva:alarm] tests/value/fun_ptr.i:85: Warning: pointer to function with incompatible type. assert \valid_function((double (*)(void))ph); [eva] computing for function h <- main. Called from tests/value/fun_ptr.i:87. [eva] Recording results for h [eva] Done for function h [eva] computing for function test_benign <- main. Called from tests/value/fun_ptr.i:89. [eva:alarm] tests/value/fun_ptr.i:56: Warning: pointer to function with incompatible type. assert \valid_function(p); [eva] computing for function benign <- test_benign <- main. Called from tests/value/fun_ptr.i:56. [eva] Recording results for benign [eva] Done for function benign [eva] Recording results for test_benign [eva] Done for function test_benign [eva] computing for function test_too_much_benign <- main. Called from tests/value/fun_ptr.i:90. [eva:alarm] tests/value/fun_ptr.i:70: Warning: pointer to function with incompatible type. assert \valid_function((void (*)(int , int ))p); [eva] computing for function too_much <- test_too_much_benign <- main. Called from tests/value/fun_ptr.i:70. [eva] Recording results for too_much [eva] Done for function too_much [eva:alarm] tests/value/fun_ptr.i:73: Warning: pointer to function with incompatible type. assert \valid_function((void (*)(int , int ))p); [eva] Recording results for test_too_much_benign [eva] Done for function test_too_much_benign [eva] Recording results for main [eva] done for function main [eva] tests/value/fun_ptr.i:38: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/fun_ptr.i:73: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/fun_ptr.i:83: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/fun_ptr.i:85: assertion 'Eva,function_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function benign: q ∈ {{ &x }} k ∈ {-2147483648} x ∈ {-2147483648} [eva:final-states] Values at end of function f: __retres ∈ {4} [eva:final-states] Values at end of function g: __retres ∈ {7} [eva:final-states] Values at end of function h: __retres ∈ {3.} [eva:final-states] Values at end of function test1: R1 ∈ {4} [eva:final-states] Values at end of function test2: R2 ∈ {4; 7} [eva:final-states] Values at end of function test3: NON TERMINATING FUNCTION [eva:final-states] Values at end of function test_benign: x ∈ {-2147483648} p ∈ {{ (void (*)(long , short *))&benign }} [eva:final-states] Values at end of function too_much: j ∈ {1} [eva:final-states] Values at end of function test_too_much_benign: p ∈ {{ &too_much }} [eva:final-states] Values at end of function main: R1 ∈ {4} R2 ∈ {4; 7} R3 ∈ {0} ph ∈ {{ &h }} __retres ∈ {0} [from] Computing for function benign [from] Done for function benign [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function test1 [from] Done for function test1 [from] Computing for function test2 [from] tests/value/fun_ptr.i:33: Warning: variadic call detected. Using only 1 argument(s). [from] Done for function test2 [from] Computing for function test3 [from] Non-terminating function test3 (no dependencies) [from] Done for function test3 [from] Computing for function test_benign [from] Done for function test_benign [from] Computing for function too_much [from] Done for function too_much [from] Computing for function test_too_much_benign [from] tests/value/fun_ptr.i:70: Warning: variadic call detected. Using only 1 argument(s). [from] Computing for function too_much2 <-test_too_much_benign [from] Non-terminating function too_much2 (no dependencies) [from] Done for function too_much2 [from] Done for function test_too_much_benign [from] Computing for function main [from] tests/value/fun_ptr.i:85: Warning: variadic call detected. Using only 0 argument(s). [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function benign: x FROM j; p [from] Function f: \result FROM x [from] Function g: \result FROM x; y [from] Function h: \result FROM a; b [from] Function test1: R1 FROM t[0..1]; nd [from] Function test2: R2 FROM t[0..1]; nd [from] Function test3: NON TERMINATING - NO EFFECTS [from] Function test_benign: NO EFFECTS [from] Function too_much: NO EFFECTS [from] Function test_too_much_benign: NO EFFECTS [from] Function main: R1 FROM t[0..1]; v R2 FROM t[0..1]; v \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function benign: q; k; x [inout] Inputs for function benign: \nothing [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: __retres [inout] Inputs for function g: \nothing [inout] Out (internal) for function h: __retres [inout] Inputs for function h: \nothing [inout] Out (internal) for function test1: R1 [inout] Inputs for function test1: t[0..1] [inout] Out (internal) for function test2: R2 [inout] Inputs for function test2: t[0..1] [inout] Out (internal) for function test3: R3 [inout] Inputs for function test3: t[0..1] [inout] Out (internal) for function test_benign: x; p [inout] Inputs for function test_benign: \nothing [inout] Out (internal) for function too_much: j [inout] Inputs for function too_much: \nothing [inout] Out (internal) for function test_too_much_benign: p [inout] Inputs for function test_too_much_benign: v [inout] Out (internal) for function main: R1; R2; R3; ph; __retres [inout] Inputs for function main: t[0..1]; v frama-c-20.0-Calcium/tests/value/oracle/fun_ptr.1.res.oracle0000666000000000000000000001741613571573400020542 0ustar [kernel] Parsing tests/value/fun_ptr.i (no preprocessing) [kernel:typing:incompatible-types-call] tests/value/fun_ptr.i:55: Warning: implicit conversion between incompatible function types: void (*)(int j, void *p) and void (*)(long , short *) [kernel:typing:incompatible-types-call] tests/value/fun_ptr.i:56: Warning: expected 'short *' but got argument of type 'int *': & x [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {{ (__int64)&f }} [1] ∈ {{ (__int64)&g }} R1 ∈ {0} R2 ∈ {0} R3 ∈ {0} v ∈ [--..--] [eva] computing for function test1 <- main. Called from tests/value/fun_ptr.i:78. [eva:alarm] tests/value/fun_ptr.i:28: Warning: pointer to function with incompatible type. assert \valid_function((int (*)(int ))t[nd]); [eva] computing for function f <- test1 <- main. Called from tests/value/fun_ptr.i:28. [eva] Recording results for f [eva] Done for function f [eva] Recording results for test1 [eva] Done for function test1 [eva] computing for function test2 <- main. Called from tests/value/fun_ptr.i:79. [eva:alarm] tests/value/fun_ptr.i:33: Warning: pointer to function with incompatible type. assert \valid_function((int (*)(int , int ))t[nd]); [eva] computing for function g <- test2 <- main. Called from tests/value/fun_ptr.i:33. [eva] Recording results for g [eva] Done for function g [eva] tests/value/fun_ptr.i:33: Reusing old results for call to f [eva] Recording results for test2 [eva] Done for function test2 [eva] computing for function test3 <- main. Called from tests/value/fun_ptr.i:80. [eva:alarm] tests/value/fun_ptr.i:38: Warning: pointer to function with incompatible type. assert \valid_function((double (*)(int ))t[nd]); [eva] Recording results for test3 [eva] Done for function test3 [eva:alarm] tests/value/fun_ptr.i:83: Warning: pointer to function with incompatible type. assert \valid_function((double (*)(double , double ))ph); [eva:alarm] tests/value/fun_ptr.i:85: Warning: pointer to function with incompatible type. assert \valid_function((double (*)(void))ph); [eva] computing for function h <- main. Called from tests/value/fun_ptr.i:87. [eva] Recording results for h [eva] Done for function h [eva] computing for function test_benign <- main. Called from tests/value/fun_ptr.i:89. [eva:alarm] tests/value/fun_ptr.i:56: Warning: pointer to function with incompatible type. assert \valid_function(p); [eva] computing for function benign <- test_benign <- main. Called from tests/value/fun_ptr.i:56. [eva] Recording results for benign [eva] Done for function benign [eva] Recording results for test_benign [eva] Done for function test_benign [eva] computing for function test_too_much_benign <- main. Called from tests/value/fun_ptr.i:90. [eva:alarm] tests/value/fun_ptr.i:70: Warning: pointer to function with incompatible type. assert \valid_function((void (*)(int , int ))p); [eva] computing for function too_much <- test_too_much_benign <- main. Called from tests/value/fun_ptr.i:70. [eva] Recording results for too_much [eva] Done for function too_much [eva:alarm] tests/value/fun_ptr.i:73: Warning: pointer to function with incompatible type. assert \valid_function((void (*)(int , int ))p); [eva] Recording results for test_too_much_benign [eva] Done for function test_too_much_benign [eva] Recording results for main [eva] done for function main [eva] tests/value/fun_ptr.i:38: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/fun_ptr.i:73: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/fun_ptr.i:83: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/fun_ptr.i:85: assertion 'Eva,function_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function benign: q ∈ {{ &x }} k ∈ {-2147483648} x ∈ {-2147483648} [eva:final-states] Values at end of function f: __retres ∈ {4} [eva:final-states] Values at end of function g: __retres ∈ {7} [eva:final-states] Values at end of function h: __retres ∈ {3.} [eva:final-states] Values at end of function test1: R1 ∈ {4} [eva:final-states] Values at end of function test2: R2 ∈ {4; 7} [eva:final-states] Values at end of function test3: NON TERMINATING FUNCTION [eva:final-states] Values at end of function test_benign: x ∈ {-2147483648} p ∈ {{ (void (*)(long , short *))&benign }} [eva:final-states] Values at end of function too_much: j ∈ {1} [eva:final-states] Values at end of function test_too_much_benign: p ∈ {{ &too_much }} [eva:final-states] Values at end of function main: R1 ∈ {4} R2 ∈ {4; 7} R3 ∈ {0} ph ∈ {{ &h }} __retres ∈ {0} [from] Computing for function benign [from] Done for function benign [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function test1 [from] Done for function test1 [from] Computing for function test2 [from] tests/value/fun_ptr.i:33: Warning: variadic call detected. Using only 1 argument(s). [from] Done for function test2 [from] Computing for function test3 [from] Non-terminating function test3 (no dependencies) [from] Done for function test3 [from] Computing for function test_benign [from] Done for function test_benign [from] Computing for function too_much [from] Done for function too_much [from] Computing for function test_too_much_benign [from] tests/value/fun_ptr.i:70: Warning: variadic call detected. Using only 1 argument(s). [from] Computing for function too_much2 <-test_too_much_benign [from] Non-terminating function too_much2 (no dependencies) [from] Done for function too_much2 [from] Done for function test_too_much_benign [from] Computing for function main [from] tests/value/fun_ptr.i:85: Warning: variadic call detected. Using only 0 argument(s). [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function benign: x FROM j; p [from] Function f: \result FROM x [from] Function g: \result FROM x; y [from] Function h: \result FROM a; b [from] Function test1: R1 FROM t[0..1]; nd [from] Function test2: R2 FROM t[0..1]; nd [from] Function test3: NON TERMINATING - NO EFFECTS [from] Function test_benign: NO EFFECTS [from] Function too_much: NO EFFECTS [from] Function test_too_much_benign: NO EFFECTS [from] Function main: R1 FROM t[0..1]; v R2 FROM t[0..1]; v \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function benign: q; k; x [inout] Inputs for function benign: \nothing [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: __retres [inout] Inputs for function g: \nothing [inout] Out (internal) for function h: __retres [inout] Inputs for function h: \nothing [inout] Out (internal) for function test1: R1 [inout] Inputs for function test1: t[0..1] [inout] Out (internal) for function test2: R2 [inout] Inputs for function test2: t[0..1] [inout] Out (internal) for function test3: R3 [inout] Inputs for function test3: t[0..1] [inout] Out (internal) for function test_benign: x; p [inout] Inputs for function test_benign: \nothing [inout] Out (internal) for function too_much: j [inout] Inputs for function too_much: \nothing [inout] Out (internal) for function test_too_much_benign: p [inout] Inputs for function test_too_much_benign: v [inout] Out (internal) for function main: R1; R2; R3; ph; __retres [inout] Inputs for function main: t[0..1]; v frama-c-20.0-Calcium/tests/value/oracle/function_return_serial_casts.res.oracle0000666000000000000000000000332213571573400024675 0ustar [kernel] Parsing tests/value/function_return_serial_casts.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {-10} y ∈ {0} z ∈ {0} t ∈ {0} [eva] computing for function f <- main. Called from tests/value/function_return_serial_casts.i:17. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/function_return_serial_casts.i:18. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {65526} [eva:final-states] Values at end of function g: l ∈ {65526} [eva:final-states] Values at end of function main: y ∈ {65526} z ∈ {65526} t ∈ {65526} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function g: \result FROM x [from] Function main: y FROM x z FROM x t FROM x \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: x [inout] Out (internal) for function g: l [inout] Inputs for function g: x [inout] Out (internal) for function main: y; z; t; tmp; tmp_0; __retres [inout] Inputs for function main: x frama-c-20.0-Calcium/tests/value/oracle/g1.res.oracle0000666000000000000000000000135613571573400017231 0ustar [kernel] Parsing tests/value/g1.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {1} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/garbled_init.res.oracle0000666000000000000000000000143613571573400021344 0ustar [kernel] Parsing tests/value/garbled_init.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization PTR ∈ {0} G ∈ {{ &PTR + {-4278190080} }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: PTR ∈ {1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: PTR FROM G [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: PTR [inout] Inputs for function main: G frama-c-20.0-Calcium/tests/value/oracle/gauges.res.oracle0000666000000000000000000012033413571573400020173 0ustar [kernel] Parsing tests/value/gauges.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] t[0..37] ∈ {0} u[0..99] ∈ {0} T[0..99] ∈ [--..--] [eva] computing for function main0 <- main. Called from tests/value/gauges.c:350. [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:18: starting to merge loop iterations [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva:alarm] tests/value/gauges.c:23: Warning: signed overflow. assert -2147483648 ≤ j - 4; [eva] tests/value/gauges.c:16: starting to merge loop iterations [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:19: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:21: Frama_C_show_each_1: {{ "in" }} [eva:alarm] tests/value/gauges.c:26: Warning: signed overflow. assert l + 1 ≤ 2147483647; [eva] Recording results for main0 [eva] Done for function main0 [eva] computing for function main0_bis <- main. Called from tests/value/gauges.c:351. [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:40: starting to merge loop iterations [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva:alarm] tests/value/gauges.c:45: Warning: signed overflow. assert -2147483648 ≤ j - 4; [eva] tests/value/gauges.c:38: starting to merge loop iterations [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva] tests/value/gauges.c:41: Frama_C_show_each_0: {{ "in" }} [eva] tests/value/gauges.c:43: Frama_C_show_each_1: {{ "in" }} [eva:alarm] tests/value/gauges.c:48: Warning: signed overflow. assert l + 1 ≤ 2147483647; [eva] Recording results for main0_bis [eva] Done for function main0_bis [eva] computing for function main1 <- main. Called from tests/value/gauges.c:352. [eva] tests/value/gauges.c:59: Frama_C_show_each: {{ "in" }} [eva] tests/value/gauges.c:57: starting to merge loop iterations [eva] tests/value/gauges.c:59: Frama_C_show_each: {{ "in" }} [eva] tests/value/gauges.c:59: Frama_C_show_each: {{ "in" }} [eva] tests/value/gauges.c:59: Frama_C_show_each: {{ "in" }} [eva] tests/value/gauges.c:59: Frama_C_show_each: {{ "in" }} [eva] tests/value/gauges.c:59: Frama_C_show_each: {{ "in" }} [eva:alarm] tests/value/gauges.c:58: Warning: accessing out of bounds index. assert j < 38; [eva] tests/value/gauges.c:62: Frama_C_show_each: {{ "out" }} [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/gauges.c:353. [eva] tests/value/gauges.c:72: Frama_C_show_each: [eva] tests/value/gauges.c:70: starting to merge loop iterations [eva] tests/value/gauges.c:72: Frama_C_show_each: [eva] tests/value/gauges.c:72: Frama_C_show_each: [eva] tests/value/gauges.c:72: Frama_C_show_each: [eva] tests/value/gauges.c:72: Frama_C_show_each: [eva] tests/value/gauges.c:72: Frama_C_show_each: [eva:alarm] tests/value/gauges.c:71: Warning: out of bounds write. assert \valid(tmp); (tmp from p++) [eva] tests/value/gauges.c:72: Frama_C_show_each: [eva] tests/value/gauges.c:72: Frama_C_show_each: [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/gauges.c:354. [eva] tests/value/gauges.c:80: Frama_C_show_each: {{ "inner" }} [eva] tests/value/gauges.c:79: starting to merge loop iterations [eva] tests/value/gauges.c:80: Frama_C_show_each: {{ "inner" }} [eva] tests/value/gauges.c:80: Frama_C_show_each: {{ "inner" }} [eva] tests/value/gauges.c:80: Frama_C_show_each: {{ "inner" }} [eva] tests/value/gauges.c:80: Frama_C_show_each: {{ "inner" }} [eva] tests/value/gauges.c:80: Frama_C_show_each: {{ "inner" }} [eva:alarm] tests/value/gauges.c:81: Warning: signed overflow. assert k + 1 ≤ 2147483647; [eva] tests/value/gauges.c:83: Frama_C_show_each: {{ "outer" }} [eva:alarm] tests/value/gauges.c:84: Warning: signed overflow. assert k + 1 ≤ 2147483647; [eva] tests/value/gauges.c:78: starting to merge loop iterations [eva] tests/value/gauges.c:80: Frama_C_show_each: {{ "inner" }} [eva] tests/value/gauges.c:83: Frama_C_show_each: {{ "outer" }} [eva] tests/value/gauges.c:80: Frama_C_show_each: {{ "inner" }} [eva] tests/value/gauges.c:83: Frama_C_show_each: {{ "outer" }} [eva] tests/value/gauges.c:80: Frama_C_show_each: {{ "inner" }} [eva] tests/value/gauges.c:83: Frama_C_show_each: {{ "outer" }} [eva] tests/value/gauges.c:86: Frama_C_show_each: [0..2147483647] [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/gauges.c:355. [eva] computing for function main4_search <- main4 <- main. Called from tests/value/gauges.c:107. [eva] tests/value/gauges.c:97: Frama_C_show_each: [eva] tests/value/gauges.c:96: starting to merge loop iterations [eva] tests/value/gauges.c:97: Frama_C_show_each: [eva] tests/value/gauges.c:97: Frama_C_show_each: [eva] tests/value/gauges.c:97: Frama_C_show_each: [eva] tests/value/gauges.c:97: Frama_C_show_each: [eva] tests/value/gauges.c:97: Frama_C_show_each: [eva:alarm] tests/value/gauges.c:99: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva] Recording results for main4_search [eva] Done for function main4_search [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/gauges.c:356. [eva] tests/value/gauges.c:116: Frama_C_show_each: {{ &x }} [eva] tests/value/gauges.c:113: starting to merge loop iterations [eva] tests/value/gauges.c:116: Frama_C_show_each: {{ &x + {0; 4} }} [eva] tests/value/gauges.c:116: Frama_C_show_each: {{ &x + {0; 4; 8} }} [eva] tests/value/gauges.c:116: Frama_C_show_each: {{ &x + {0; 4; 8; 12} ; &y }} [eva] tests/value/gauges.c:116: Frama_C_show_each: {{ &x + {0; 4; 8; 12; 16} ; &y + {0; 4} }} [eva] tests/value/gauges.c:116: Frama_C_show_each: {{ &x + {0; 4; 8; 12; 16; 20} ; &y + {0; 4; 8} }} [eva] tests/value/gauges.c:116: Frama_C_show_each: {{ &x + {0; 4; 8; 12; 16; 20; 24} ; &y + {0; 4; 8; 12} }} [eva] tests/value/gauges.c:116: Frama_C_show_each: {{ &x + [0..36],0%4 ; &y + [0..36],0%4 }} [eva] tests/value/gauges.c:116: Frama_C_show_each: {{ &x + [0..40],0%4 ; &y + [0..40],0%4 }} [eva:alarm] tests/value/gauges.c:117: Warning: out of bounds write. assert \valid(p); [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main5_bis <- main. Called from tests/value/gauges.c:357. [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &x }} [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &x + {4} }} [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &x + {8} }} [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y }} [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y + {4} }} [eva] tests/value/gauges.c:126: starting to merge loop iterations [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y + {4; 8} }} [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y + {4; 8; 12} }} [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y + {4; 8; 12; 16} }} [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y + {4; 8; 12; 16; 20} }} [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y + [4..36],0%4 }} [eva] tests/value/gauges.c:129: Frama_C_show_each: {{ &y + [4..40],0%4 }} [eva:alarm] tests/value/gauges.c:130: Warning: out of bounds write. assert \valid(p); [eva] Recording results for main5_bis [eva] Done for function main5_bis [eva] computing for function main6 <- main. Called from tests/value/gauges.c:358. [eva] tests/value/gauges.c:138: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:140: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/value/gauges.c:359. [eva] computing for function main7_aux <- main7 <- main. Called from tests/value/gauges.c:164. [eva] tests/value/gauges.c:145: Frama_C_show_each: [eva] tests/value/gauges.c:147: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:149: Warning: out of bounds write. assert \valid(tmp); (tmp from p--) [eva] Recording results for main7_aux [eva] Done for function main7_aux [eva] computing for function main7_aux2 <- main7 <- main. Called from tests/value/gauges.c:165. [eva] tests/value/gauges.c:154: Frama_C_show_each: [eva] tests/value/gauges.c:156: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:158: Warning: out of bounds write. assert \valid(tmp); (tmp from p--) [eva:alarm] tests/value/gauges.c:156: Warning: signed overflow. assert -2147483648 ≤ toCopy - 1; [eva] Recording results for main7_aux2 [eva] Done for function main7_aux2 [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/value/gauges.c:360. [eva] computing for function main8_aux <- main8 <- main. Called from tests/value/gauges.c:178. [eva] tests/value/gauges.c:172: Frama_C_show_each: {0} [eva] tests/value/gauges.c:172: Frama_C_show_each: {4294967295} [eva] tests/value/gauges.c:172: Frama_C_show_each: {4294967294} [eva] tests/value/gauges.c:171: starting to merge loop iterations [eva] tests/value/gauges.c:172: Frama_C_show_each: {4294967293; 4294967294} [eva] tests/value/gauges.c:172: Frama_C_show_each: {4294967292; 4294967293; 4294967294} [eva] tests/value/gauges.c:172: Frama_C_show_each: [2147483647..4294967294] [eva] tests/value/gauges.c:172: Frama_C_show_each: [2147483646..4294967294] [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] [eva:alarm] tests/value/gauges.c:173: Warning: out of bounds write. assert \valid(tmp); (tmp from p++) [eva] tests/value/gauges.c:172: Frama_C_show_each: [1..4294967294] [eva] Recording results for main8_aux [eva] Done for function main8_aux [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/value/gauges.c:361. [eva] tests/value/gauges.c:186: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:188: Warning: signed overflow. assert -2147483648 ≤ (int)p + (int)q; [eva:alarm] tests/value/gauges.c:188: Warning: signed overflow. assert (int)p + (int)q ≤ 2147483647; [eva] tests/value/gauges.c:188: Assigning imprecise value to z. The imprecision originates from Arithmetic {tests/value/gauges.c:188} [eva] tests/value/gauges.c:189: Assigning imprecise value to r. The imprecision originates from Arithmetic {tests/value/gauges.c:188} [eva:alarm] tests/value/gauges.c:190: Warning: out of bounds write. assert \valid(r); [eva:alarm] tests/value/gauges.c:192: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/value/gauges.c:193: Warning: out of bounds write. assert \valid(q); [eva] Recording results for main9 [eva] Done for function main9 [eva] computing for function main10 <- main. Called from tests/value/gauges.c:362. [eva] computing for function main10_aux <- main10 <- main. Called from tests/value/gauges.c:211. [eva] tests/value/gauges.c:201: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:202: Warning: out of bounds read. assert \valid_read(tmp); (tmp from A++) [eva:alarm] tests/value/gauges.c:202: Warning: out of bounds read. assert \valid_read(tmp_0); (tmp_0 from B++) [eva:alarm] tests/value/gauges.c:201: Warning: signed overflow. assert -2147483648 ≤ numNonZero - 1; [eva:alarm] tests/value/gauges.c:202: Warning: non-finite float value. assert \is_finite((float)(*p * (float)(*tmp * *tmp_0))); (tmp from A++, tmp_0 from B++) [eva] Recording results for main10_aux [eva] Done for function main10_aux [eva:alarm] tests/value/gauges.c:211: Warning: overflow in conversion from floating-point to integer. assert tmp < 2147483648; (tmp from main10_aux(& p, (float const *)(A), (float const *)(B), 10)) [eva] Recording results for main10 [eva] Done for function main10 [eva] computing for function main11 <- main. Called from tests/value/gauges.c:363. [eva] tests/value/gauges.c:218: Frama_C_show_each: [eva] tests/value/gauges.c:217: starting to merge loop iterations [eva] tests/value/gauges.c:218: Frama_C_show_each: [eva] tests/value/gauges.c:218: Frama_C_show_each: [eva] tests/value/gauges.c:218: Frama_C_show_each: [eva:alarm] tests/value/gauges.c:219: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva] tests/value/gauges.c:218: Frama_C_show_each: [eva] tests/value/gauges.c:218: Frama_C_show_each: [eva] tests/value/gauges.c:218: Frama_C_show_each: [eva] tests/value/gauges.c:218: Frama_C_show_each: [eva:alarm] tests/value/gauges.c:220: Warning: signed overflow. assert -2147483648 ≤ n - 1; [eva] Recording results for main11 [eva] Done for function main11 [eva] computing for function main12 <- main. Called from tests/value/gauges.c:364. [eva] tests/value/gauges.c:225: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:225: Warning: signed overflow. assert i + 1 ≤ 2147483647; [eva] Recording results for main12 [eva] Done for function main12 [eva] computing for function main13 <- main. Called from tests/value/gauges.c:365. [eva] computing for function main13_1 <- main13 <- main. Called from tests/value/gauges.c:280. [eva] tests/value/gauges.c:238: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:240: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] tests/value/gauges.c:242: Frama_C_show_each: {45; 46; 47; 48; 49; 50; 51}, [0..2147483647] [eva] Recording results for main13_1 [eva] Done for function main13_1 [eva] computing for function main13_2 <- main13 <- main. Called from tests/value/gauges.c:281. [eva] tests/value/gauges.c:249: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:251: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] tests/value/gauges.c:254: Frama_C_show_each: {48; 49; 50; 51; 52; 53; 54}, [0..2147483647] [eva] Recording results for main13_2 [eva] Done for function main13_2 [eva] computing for function main13_3 <- main13 <- main. Called from tests/value/gauges.c:282. [eva] tests/value/gauges.c:261: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:263: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] tests/value/gauges.c:265: Frama_C_show_each: {-59; -58; -57; -56; -55; -54; -53}, [0..2147483647] [eva] Recording results for main13_3 [eva] Done for function main13_3 [eva] computing for function main13_4 <- main13 <- main. Called from tests/value/gauges.c:283. [eva] tests/value/gauges.c:272: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:274: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] tests/value/gauges.c:276: Frama_C_show_each: {-64; -63; -62; -61; -60; -59; -58}, [0..2147483647] [eva] Recording results for main13_4 [eva] Done for function main13_4 [eva] Recording results for main13 [eva] Done for function main13 [eva] computing for function main14 <- main. Called from tests/value/gauges.c:366. [eva] tests/value/gauges.c:291: starting to merge loop iterations [eva:alarm] tests/value/gauges.c:293: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] tests/value/gauges.c:297: Frama_C_show_each: {-593; -592; -591; -590; -589; -588}, [0..2147483647] [eva] Recording results for main14 [eva] Done for function main14 [eva] computing for function main15 <- main. Called from tests/value/gauges.c:367. [eva] tests/value/gauges.c:306: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] v ∈ [--..--] t[0..4] ∈ {0} [5] ∈ [0..48],0%3 [6] ∈ {0} [7] ∈ [0..48],0%3 [8] ∈ {0} [9] ∈ [0..48],0%3 [10] ∈ {0} [11] ∈ [0..48],0%3 [12] ∈ {0} [13] ∈ [0..48],0%3 [14] ∈ {0} [15] ∈ [0..48],0%3 [16] ∈ {0} [17] ∈ [0..48],0%3 [18] ∈ {0} [19] ∈ [0..48],0%3 [20] ∈ {0} [21] ∈ [0..48],0%3 [22] ∈ {0} [23] ∈ [0..48],0%3 [24] ∈ {0} [25] ∈ [0..48],0%3 [26] ∈ {0} [27] ∈ [0..48],0%3 [28] ∈ {0} [29] ∈ [0..48],0%3 [30] ∈ {0} [31] ∈ [0..48],0%3 [32] ∈ {0} [33] ∈ [0..48],0%3 [34] ∈ {0} [35] ∈ [0..48],0%3 [36] ∈ {0} [37] ∈ [0..48],0%3 u[0..99] ∈ [0..100] T[0..99] ∈ [--..--] x ∈ UNINITIALIZED y ∈ UNINITIALIZED p ∈ {{ &x }} i ∈ {1} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/value/gauges.c:304: starting to merge loop iterations [eva] tests/value/gauges.c:306: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] v ∈ [--..--] t[0..4] ∈ {0} [5] ∈ [0..48],0%3 [6] ∈ {0} [7] ∈ [0..48],0%3 [8] ∈ {0} [9] ∈ [0..48],0%3 [10] ∈ {0} [11] ∈ [0..48],0%3 [12] ∈ {0} [13] ∈ [0..48],0%3 [14] ∈ {0} [15] ∈ [0..48],0%3 [16] ∈ {0} [17] ∈ [0..48],0%3 [18] ∈ {0} [19] ∈ [0..48],0%3 [20] ∈ {0} [21] ∈ [0..48],0%3 [22] ∈ {0} [23] ∈ [0..48],0%3 [24] ∈ {0} [25] ∈ [0..48],0%3 [26] ∈ {0} [27] ∈ [0..48],0%3 [28] ∈ {0} [29] ∈ [0..48],0%3 [30] ∈ {0} [31] ∈ [0..48],0%3 [32] ∈ {0} [33] ∈ [0..48],0%3 [34] ∈ {0} [35] ∈ [0..48],0%3 [36] ∈ {0} [37] ∈ [0..48],0%3 u[0..99] ∈ [0..100] T[0..99] ∈ [--..--] x ∈ UNINITIALIZED y ∈ UNINITIALIZED p ∈ {{ &x ; &y }} i ∈ {1; 2} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/value/gauges.c:306: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] v ∈ [--..--] t[0..4] ∈ {0} [5] ∈ [0..48],0%3 [6] ∈ {0} [7] ∈ [0..48],0%3 [8] ∈ {0} [9] ∈ [0..48],0%3 [10] ∈ {0} [11] ∈ [0..48],0%3 [12] ∈ {0} [13] ∈ [0..48],0%3 [14] ∈ {0} [15] ∈ [0..48],0%3 [16] ∈ {0} [17] ∈ [0..48],0%3 [18] ∈ {0} [19] ∈ [0..48],0%3 [20] ∈ {0} [21] ∈ [0..48],0%3 [22] ∈ {0} [23] ∈ [0..48],0%3 [24] ∈ {0} [25] ∈ [0..48],0%3 [26] ∈ {0} [27] ∈ [0..48],0%3 [28] ∈ {0} [29] ∈ [0..48],0%3 [30] ∈ {0} [31] ∈ [0..48],0%3 [32] ∈ {0} [33] ∈ [0..48],0%3 [34] ∈ {0} [35] ∈ [0..48],0%3 [36] ∈ {0} [37] ∈ [0..48],0%3 u[0..99] ∈ [0..100] T[0..99] ∈ [--..--] x ∈ UNINITIALIZED y ∈ UNINITIALIZED p ∈ {{ &x ; &y }} i ∈ {1; 2; 3} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/value/gauges.c:306: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] v ∈ [--..--] t[0..4] ∈ {0} [5] ∈ [0..48],0%3 [6] ∈ {0} [7] ∈ [0..48],0%3 [8] ∈ {0} [9] ∈ [0..48],0%3 [10] ∈ {0} [11] ∈ [0..48],0%3 [12] ∈ {0} [13] ∈ [0..48],0%3 [14] ∈ {0} [15] ∈ [0..48],0%3 [16] ∈ {0} [17] ∈ [0..48],0%3 [18] ∈ {0} [19] ∈ [0..48],0%3 [20] ∈ {0} [21] ∈ [0..48],0%3 [22] ∈ {0} [23] ∈ [0..48],0%3 [24] ∈ {0} [25] ∈ [0..48],0%3 [26] ∈ {0} [27] ∈ [0..48],0%3 [28] ∈ {0} [29] ∈ [0..48],0%3 [30] ∈ {0} [31] ∈ [0..48],0%3 [32] ∈ {0} [33] ∈ [0..48],0%3 [34] ∈ {0} [35] ∈ [0..48],0%3 [36] ∈ {0} [37] ∈ [0..48],0%3 u[0..99] ∈ [0..100] T[0..99] ∈ [--..--] x ∈ UNINITIALIZED y ∈ UNINITIALIZED p ∈ {{ &x ; &y }} i ∈ [1..11] S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] Recording results for main15 [eva] Done for function main15 [eva] computing for function main16 <- main. Called from tests/value/gauges.c:368. [eva] tests/value/gauges.c:323: starting to merge loop iterations [eva] tests/value/gauges.c:324: starting to merge loop iterations [eva] tests/value/gauges.c:325: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] v ∈ [--..--] t[0..4] ∈ {0} [5] ∈ [0..48],0%3 [6] ∈ {0} [7] ∈ [0..48],0%3 [8] ∈ {0} [9] ∈ [0..48],0%3 [10] ∈ {0} [11] ∈ [0..48],0%3 [12] ∈ {0} [13] ∈ [0..48],0%3 [14] ∈ {0} [15] ∈ [0..48],0%3 [16] ∈ {0} [17] ∈ [0..48],0%3 [18] ∈ {0} [19] ∈ [0..48],0%3 [20] ∈ {0} [21] ∈ [0..48],0%3 [22] ∈ {0} [23] ∈ [0..48],0%3 [24] ∈ {0} [25] ∈ [0..48],0%3 [26] ∈ {0} [27] ∈ [0..48],0%3 [28] ∈ {0} [29] ∈ [0..48],0%3 [30] ∈ {0} [31] ∈ [0..48],0%3 [32] ∈ {0} [33] ∈ [0..48],0%3 [34] ∈ {0} [35] ∈ [0..48],0%3 [36] ∈ {0} [37] ∈ [0..48],0%3 u[0..99] ∈ [0..100] T[0..99] ∈ [--..--] a ∈ {1} b ∈ {0} p ∈ {{ &a }} i ∈ {2} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/value/gauges.c:326: starting to merge loop iterations [eva] tests/value/gauges.c:321: starting to merge loop iterations [eva] tests/value/gauges.c:325: Frama_C_dump_each: # Cvalue domain: __fc_heap_status ∈ [--..--] __fc_random_counter ∈ [--..--] __fc_rand_max ∈ {32767} __fc_random48_init ∈ {0} __fc_random48_counter[0..2] ∈ [--..--] __fc_p_random48_counter ∈ {{ &__fc_random48_counter[0] }} __fc_env[0] ∈ {{ NULL ; &S_0___fc_env[0] }} [1] ∈ {{ NULL ; &S_1___fc_env[0] }} [2..4095] ∈ {{ NULL ; &S_0___fc_env[0] ; &S_1___fc_env[0] }} __fc_mblen_state ∈ [--..--] __fc_mbtowc_state ∈ [--..--] __fc_wctomb_state ∈ [--..--] v ∈ [--..--] t[0..4] ∈ {0} [5] ∈ [0..48],0%3 [6] ∈ {0} [7] ∈ [0..48],0%3 [8] ∈ {0} [9] ∈ [0..48],0%3 [10] ∈ {0} [11] ∈ [0..48],0%3 [12] ∈ {0} [13] ∈ [0..48],0%3 [14] ∈ {0} [15] ∈ [0..48],0%3 [16] ∈ {0} [17] ∈ [0..48],0%3 [18] ∈ {0} [19] ∈ [0..48],0%3 [20] ∈ {0} [21] ∈ [0..48],0%3 [22] ∈ {0} [23] ∈ [0..48],0%3 [24] ∈ {0} [25] ∈ [0..48],0%3 [26] ∈ {0} [27] ∈ [0..48],0%3 [28] ∈ {0} [29] ∈ [0..48],0%3 [30] ∈ {0} [31] ∈ [0..48],0%3 [32] ∈ {0} [33] ∈ [0..48],0%3 [34] ∈ {0} [35] ∈ [0..48],0%3 [36] ∈ {0} [37] ∈ [0..48],0%3 u[0..99] ∈ [0..100] T[0..99] ∈ [--..--] a ∈ {1} b ∈ {0} p ∈ {{ &a ; &b }} i ∈ {2} S_0___fc_env[0..1] ∈ [--..--] S_1___fc_env[0..1] ∈ [--..--] ==END OF DUMP== [eva] tests/value/gauges.c:327: starting to merge loop iterations [eva] Recording results for main16 [eva] Done for function main16 [eva] computing for function main17 <- main. Called from tests/value/gauges.c:369. [eva] tests/value/gauges.c:343: Call to builtin malloc [eva] tests/value/gauges.c:343: allocating variable __malloc_main17_l343 [eva] tests/value/gauges.c:342: starting to merge loop iterations [eva] tests/value/gauges.c:343: Call to builtin malloc [eva] Recording results for main17 [eva] Done for function main17 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main0: i ∈ {1; 162} j ∈ [-2147483646..2],2%4 k ∈ {101} l ∈ [4..2147483647] [eva:final-states] Values at end of function main0_bis: i ∈ {1; 163} j ∈ [-2147483646..2],2%4 k ∈ {101} l ∈ [4..2147483647] [eva:final-states] Values at end of function main1: t[0..4] ∈ {0} [5] ∈ [0..48],0%3 [6] ∈ {0} [7] ∈ [0..48],0%3 [8] ∈ {0} [9] ∈ [0..48],0%3 [10] ∈ {0} [11] ∈ [0..48],0%3 [12] ∈ {0} [13] ∈ [0..48],0%3 [14] ∈ {0} [15] ∈ [0..48],0%3 [16] ∈ {0} [17] ∈ [0..48],0%3 [18] ∈ {0} [19] ∈ [0..48],0%3 [20] ∈ {0} [21] ∈ [0..48],0%3 [22] ∈ {0} [23] ∈ [0..48],0%3 [24] ∈ {0} [25] ∈ [0..48],0%3 [26] ∈ {0} [27] ∈ [0..48],0%3 [28] ∈ {0} [29] ∈ [0..48],0%3 [30] ∈ {0} [31] ∈ [0..48],0%3 [32] ∈ {0} [33] ∈ [0..48],0%3 [34] ∈ {0} [35] ∈ [0..48],0%3 [36] ∈ {0} [37] ∈ [0..48],0%3 j ∈ [5..39],1%2 [eva:final-states] Values at end of function main10_aux: A ∈ {{ &A + [0..--],0%4 }} B ∈ {{ &B + [0..--],0%4 }} numNonZero ∈ [-2147483648..8] p ∈ [0. .. 3.40282346639e+38] __retres ∈ [0. .. 3.40282346639e+38] [eva:final-states] Values at end of function main10: p ∈ [0. .. 3.40282346639e+38] A[0] ∈ {1.} [1..9] ∈ {0} B[0] ∈ {2.} [1..9] ∈ {0} __retres ∈ [0..2147483520] [eva:final-states] Values at end of function main11: n ∈ [-2147483648..99] i ∈ [1..2147483647] [eva:final-states] Values at end of function main12: i ∈ [0..2147483647] j ∈ {10} [eva:final-states] Values at end of function main13_1: i ∈ {45; 46; 47; 48; 49; 50; 51} j ∈ [0..2147483647] [eva:final-states] Values at end of function main13_2: i ∈ {48; 49; 50; 51; 52; 53; 54} j ∈ [0..2147483647] [eva:final-states] Values at end of function main13_3: i ∈ {-59; -58; -57; -56; -55; -54; -53} j ∈ [0..2147483647] [eva:final-states] Values at end of function main13_4: i ∈ {-64; -63; -62; -61; -60; -59; -58} j ∈ [0..2147483647] [eva:final-states] Values at end of function main13: [eva:final-states] Values at end of function main14: i ∈ {-593; -592; -591; -590; -589; -588} s ∈ {5; 6} j ∈ [0..2147483647] [eva:final-states] Values at end of function main15: p ∈ {{ &x ; &y }} i ∈ {11} [eva:final-states] Values at end of function main16: a ∈ {1} b ∈ {0} p ∈ {{ &b }} [eva:final-states] Values at end of function main2: u[0..99] ∈ [0..100] p ∈ {{ &u + [0..--],0%4 }} [eva:final-states] Values at end of function main3: k ∈ [0..2147483647] [eva:final-states] Values at end of function main4_search: c ∈ [0..2147483647] i ∈ {21} [eva:final-states] Values at end of function main4: i ∈ [0..2147483647] [eva:final-states] Values at end of function main5: x[0..9] ∈ [0..9] or UNINITIALIZED y[0..9] ∈ [0..9] or UNINITIALIZED p ∈ {{ &x + [0..40],0%4 ; &y + [4..40],0%4 }} [eva:final-states] Values at end of function main5_bis: x[0] ∈ {0} [1] ∈ {1} [2] ∈ {2} [3..9] ∈ UNINITIALIZED y[0] ∈ {3} [1..9] ∈ {4; 5; 6; 7; 8; 9} or UNINITIALIZED p ∈ {{ &y + [4..40],0%4 }} [eva:final-states] Values at end of function main6: i ∈ {13} j ∈ [0..2147483647] [eva:final-states] Values at end of function main7_aux: T[0..99] ∈ [--..--] toCopy ∈ [--..--] p ∈ {{ &T + [--..396],0%4 }} [eva:final-states] Values at end of function main7_aux2: T[0..99] ∈ [--..--] toCopy ∈ [-2147483648..99] p ∈ {{ &T + [--..396],0%4 }} [eva:final-states] Values at end of function main7: T[0..99] ∈ [--..--] toCopy ∈ {100} [eva:final-states] Values at end of function main8_aux: n ∈ {0} arr[0] ∈ {0} [1] ∈ {-1} [2..65535] ∈ [--..--] or UNINITIALIZED p ∈ {{ &arr + [12..--],0%4 }} [eva:final-states] Values at end of function main8: [eva:final-states] Values at end of function main9: x[0..9] ∈ [--..--] or UNINITIALIZED y[0..9] ∈ [--..--] or UNINITIALIZED p ∈ {{ &x + [0..40],0%4 }} q ∈ {{ &y + [0..40],0%4 }} z ∈ {{ garbled mix of &{x; y} (origin: Arithmetic {tests/value/gauges.c:188}) }} or UNINITIALIZED [eva:final-states] Values at end of function main17: __fc_heap_status ∈ [--..--] q ∈ {0} p ∈ {{ &x ; &__malloc_w_main17_l343 }} [eva:final-states] Values at end of function main: __fc_heap_status ∈ [--..--] t[0..4] ∈ {0} [5] ∈ [0..48],0%3 [6] ∈ {0} [7] ∈ [0..48],0%3 [8] ∈ {0} [9] ∈ [0..48],0%3 [10] ∈ {0} [11] ∈ [0..48],0%3 [12] ∈ {0} [13] ∈ [0..48],0%3 [14] ∈ {0} [15] ∈ [0..48],0%3 [16] ∈ {0} [17] ∈ [0..48],0%3 [18] ∈ {0} [19] ∈ [0..48],0%3 [20] ∈ {0} [21] ∈ [0..48],0%3 [22] ∈ {0} [23] ∈ [0..48],0%3 [24] ∈ {0} [25] ∈ [0..48],0%3 [26] ∈ {0} [27] ∈ [0..48],0%3 [28] ∈ {0} [29] ∈ [0..48],0%3 [30] ∈ {0} [31] ∈ [0..48],0%3 [32] ∈ {0} [33] ∈ [0..48],0%3 [34] ∈ {0} [35] ∈ [0..48],0%3 [36] ∈ {0} [37] ∈ [0..48],0%3 u[0..99] ∈ [0..100] T[0..99] ∈ [--..--] [from] Computing for function main0 [from] Done for function main0 [from] Computing for function main0_bis [from] Done for function main0_bis [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main10_aux [from] Done for function main10_aux [from] Computing for function main10 [from] Done for function main10 [from] Computing for function main11 [from] Done for function main11 [from] Computing for function main12 [from] Done for function main12 [from] Computing for function main13_1 [from] Done for function main13_1 [from] Computing for function main13_2 [from] Done for function main13_2 [from] Computing for function main13_3 [from] Done for function main13_3 [from] Computing for function main13_4 [from] Done for function main13_4 [from] Computing for function main13 [from] Done for function main13 [from] Computing for function main14 [from] Done for function main14 [from] Computing for function main15 [from] Done for function main15 [from] Computing for function main16 [from] Done for function main16 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4_search [from] Done for function main4_search [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main5_bis [from] Done for function main5_bis [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main7_aux [from] Done for function main7_aux [from] Computing for function main7_aux2 [from] Done for function main7_aux2 [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8_aux [from] Done for function main8_aux [from] Computing for function main8 [from] Done for function main8 [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main17 [from] Computing for function malloc <-main17 [from] Done for function malloc [from] Done for function main17 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main0: NO EFFECTS [from] Function main0_bis: NO EFFECTS [from] Function main1: t{[5]; [7]; [9]; [11]; [13]; [15]; [17]; [19]; [21]; [23]; [25]; [27]; [29]; [31]; [33]; [35]; [37]} FROM \nothing (and SELF) [from] Function main10_aux: p FROM p; A; B; n; p; A[0..9]; B[0..9] (and SELF) \result FROM p; A; B; n; p; A[0..9]; B[0..9] [from] Function main10: \result FROM \nothing [from] Function main11: NO EFFECTS [from] Function main12: NO EFFECTS [from] Function main13_1: NO EFFECTS [from] Function main13_2: NO EFFECTS [from] Function main13_3: NO EFFECTS [from] Function main13_4: NO EFFECTS [from] Function main13: NO EFFECTS [from] Function main14: NO EFFECTS [from] Function main15: NO EFFECTS [from] Function main16: NO EFFECTS [from] Function main2: u[0..99] FROM \nothing (and SELF) [from] Function main3: NO EFFECTS [from] Function main4_search: \result FROM T[0..20] [from] Function main4: NO EFFECTS [from] Function main5: NO EFFECTS [from] Function main5_bis: NO EFFECTS [from] Function main6: NO EFFECTS [from] Function main7_aux: T[0..99] FROM toCopy (and SELF) [from] Function main7_aux2: T[0..99] FROM toCopy (and SELF) [from] Function main7: T[0..99] FROM \nothing (and SELF) [from] Function main8_aux: NO EFFECTS [from] Function main8: NO EFFECTS [from] Function main9: NO EFFECTS [from] Function malloc: __fc_heap_status FROM __fc_heap_status; size (and SELF) \result FROM __fc_heap_status; size [from] Function main17: __fc_heap_status FROM __fc_heap_status (and SELF) [from] Function main: __fc_heap_status FROM __fc_heap_status (and SELF) t{[5]; [7]; [9]; [11]; [13]; [15]; [17]; [19]; [21]; [23]; [25]; [27]; [29]; [31]; [33]; [35]; [37]} FROM \nothing (and SELF) u[0..99] FROM \nothing (and SELF) T[0..99] FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main0: i; j; k; l [inout] Inputs for function main0: \nothing [inout] Out (internal) for function main0_bis: i; j; k; l [inout] Inputs for function main0_bis: \nothing [inout] Out (internal) for function main1: t{[5]; [7]; [9]; [11]; [13]; [15]; [17]; [19]; [21]; [23]; [25]; [27]; [29]; [31]; [33]; [35]; [37]}; j; i [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main10_aux: A; B; numNonZero; tmp; tmp_0; tmp_1; p; __retres [inout] Inputs for function main10_aux: p; A[0..9]; B[0..9] [inout] Out (internal) for function main10: p; A[0..9]; B[0..9]; tmp; __retres [inout] Inputs for function main10: \nothing [inout] Out (internal) for function main11: n; i; tmp [inout] Inputs for function main11: \nothing [inout] Out (internal) for function main12: i; j [inout] Inputs for function main12: v [inout] Out (internal) for function main13_1: i; tmp; j [inout] Inputs for function main13_1: v [inout] Out (internal) for function main13_2: i; tmp; j [inout] Inputs for function main13_2: v [inout] Out (internal) for function main13_3: i; tmp; j [inout] Inputs for function main13_3: v [inout] Out (internal) for function main13_4: i; tmp; j [inout] Inputs for function main13_4: v [inout] Out (internal) for function main13: \nothing [inout] Inputs for function main13: v [inout] Out (internal) for function main14: i; s; tmp; j [inout] Inputs for function main14: v [inout] Out (internal) for function main15: p; i [inout] Inputs for function main15: \nothing [inout] Out (internal) for function main16: a; b; p; i [inout] Inputs for function main16: \nothing [inout] Out (internal) for function main2: u[0..99]; p; i; tmp [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main3: k; i; j [inout] Inputs for function main3: \nothing [inout] Out (internal) for function main4_search: c; i [inout] Inputs for function main4_search: T[0..20] [inout] Out (internal) for function main4: i [inout] Inputs for function main4: T[0..20] [inout] Out (internal) for function main5: x[0..9]; y[0..9]; p; i [inout] Inputs for function main5: \nothing [inout] Out (internal) for function main5_bis: x[0..2]; y[0..9]; p; i [inout] Inputs for function main5_bis: \nothing [inout] Out (internal) for function main6: i; j [inout] Inputs for function main6: \nothing [inout] Out (internal) for function main7_aux: T[0..99]; toCopy; p; tmp; tmp_0 [inout] Inputs for function main7_aux: \nothing [inout] Out (internal) for function main7_aux2: T[0..99]; toCopy; p; tmp; tmp_0 [inout] Inputs for function main7_aux2: \nothing [inout] Out (internal) for function main7: T[0..99]; toCopy [inout] Inputs for function main7: \nothing [inout] Out (internal) for function main8_aux: n; arr[0..65535]; p; tmp [inout] Inputs for function main8_aux: \nothing [inout] Out (internal) for function main8: \nothing [inout] Inputs for function main8: v [inout] Out (internal) for function main9: x[0..9]; y[0..9]; p; q; z; i; r [inout] Inputs for function main9: \nothing [inout] Out (internal) for function main17: __fc_heap_status; q; p [inout] Inputs for function main17: __fc_heap_status [inout] Out (internal) for function main: __fc_heap_status; t{[5]; [7]; [9]; [11]; [13]; [15]; [17]; [19]; [21]; [23]; [25]; [27]; [29]; [31]; [33]; [35]; [37]}; u[0..99]; T[0..99] [inout] Inputs for function main: __fc_heap_status; v; T[0..20] frama-c-20.0-Calcium/tests/value/oracle/ghost.res.oracle0000666000000000000000000000201713571573400020041 0ustar [kernel] Parsing tests/value/ghost.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} GHOST ∈ {0} H ∈ {0} [eva] tests/value/ghost.i:16: starting to merge loop iterations [eva:alarm] tests/value/ghost.i:17: Warning: signed overflow. assert G + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G ∈ [0..2147483647] GHOST ∈ {0} i ∈ {11} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: G FROM \nothing GHOST FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G; GHOST; i; j [inout] Inputs for function main: G frama-c-20.0-Calcium/tests/value/oracle/global_bug.res.oracle0000666000000000000000000000243513571573400021016 0ustar [kernel] Parsing tests/value/global_bug.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva:alarm] tests/value/global_bug.i:6: Warning: invalid RHS operand for shift. assert 0 ≤ 63 < 32; [eva] tests/value/global_bug.i:7: Warning: evaluation of initializer '99 << 63' failed [eva] Initial state computed [eva:initial-state] Values of globals at initialization NOT ACCESSIBLE [eva] Eva not started because globals initialization is not computable. [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] ====== END OF DEPENDENCIES ====== [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Bug ] Assertion 'Eva,shift' (file tests/value/global_bug.i, line 7) by Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Bugs found 1 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/goto.res.oracle0000666000000000000000000000240513571573400017666 0ustar [kernel] Parsing tests/value/goto.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function stop <- main. Called from tests/value/goto.i:10. [eva] Recording results for stop [eva] Done for function stop [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function stop: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: c ∈ [--..--] __retres ∈ {0} [from] Computing for function stop [from] Non-terminating function stop (no dependencies) [from] Done for function stop [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function stop: NON TERMINATING - NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function stop: \nothing [inout] Inputs for function stop: \nothing [inout] Out (internal) for function main: c; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/hierarchical_convergence.res.oracle0000666000000000000000000000507713571573400023722 0ustar [kernel] Parsing tests/value/hierarchical_convergence.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/hierarchical_convergence.c:19. [eva] tests/value/hierarchical_convergence.c:8: Frama_C_show_each: {0} [eva] tests/value/hierarchical_convergence.c:7: starting to merge loop iterations [eva] tests/value/hierarchical_convergence.c:8: Frama_C_show_each: {0; 1} [eva] tests/value/hierarchical_convergence.c:10: Frama_C_show_each: {1}, {0} [eva] tests/value/hierarchical_convergence.c:9: starting to merge loop iterations [eva] tests/value/hierarchical_convergence.c:8: Frama_C_show_each: {0; 1; 2} [eva] tests/value/hierarchical_convergence.c:10: Frama_C_show_each: {1; 2}, {0} [eva] tests/value/hierarchical_convergence.c:10: Frama_C_show_each: {1; 2}, {0; 1} [eva] tests/value/hierarchical_convergence.c:8: Frama_C_show_each: [0..99] [eva] tests/value/hierarchical_convergence.c:10: Frama_C_show_each: [1..99], {0} [eva] tests/value/hierarchical_convergence.c:10: Frama_C_show_each: [1..99], {0; 1} [eva] tests/value/hierarchical_convergence.c:10: Frama_C_show_each: [1..99], {0; 1; 2} [eva] tests/value/hierarchical_convergence.c:10: Frama_C_show_each: [1..99], [0..98] [eva] tests/value/hierarchical_convergence.c:8: Frama_C_show_each: [0..99] [eva:alarm] tests/value/hierarchical_convergence.c:15: Warning: accessing uninitialized left-value. assert \initialized(&j); [eva:alarm] tests/value/hierarchical_convergence.c:15: Warning: signed overflow. assert i * j ≤ 2147483647; [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: i ∈ [100..2147483647] j ∈ [0..2147483647] __retres ∈ [0..2147483647] [eva:final-states] Values at end of function main: [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: i; j; __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/if.0.res.oracle0000666000000000000000000000153613571573400017456 0ustar [kernel] Parsing tests/value/if.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} H ∈ {0} J ∈ {0} p ∈ {0} q ∈ {0} t[0..99] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &t[0] }} q ∈ {{ &t[0] }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM G q FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; q [inout] Inputs for function main: G; p frama-c-20.0-Calcium/tests/value/oracle/if.1.res.oracle0000666000000000000000000000141313571573400017451 0ustar [kernel] Parsing tests/value/if.i (no preprocessing) [eva] Analyzing a complete application starting at main6 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} H ∈ {0} J ∈ {0} p ∈ {0} q ∈ {0} t[0..99] ∈ {0} [eva] Recording results for main6 [eva] done for function main6 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main6: G ∈ {0} __retres ∈ {1} [from] Computing for function main6 [from] Done for function main6 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main6: G FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== frama-c-20.0-Calcium/tests/value/oracle/if2.res.oracle0000666000000000000000000000313513571573400017377 0ustar [kernel] Parsing tests/value/if2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G2 ∈ {0} G3 ∈ {75} G4 ∈ {0} R ∈ {0} v ∈ [--..--] G1 ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G3 ∈ {0} R ∈ {4; 10; 11} b ∈ {1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: G3 FROM G4 R FROM R; v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G3; R; b [inout] Inputs for function main: G4; R; v; G1 /* Generated by Frama-C */ enum __anonenum_T1_t_1 { E1 = 0, E2 = 0x0001, E3 = 0x0002, E4 = 0x0004, E5 = 0x0008, E6 = 0x0010, E7 = 0x0020 }; typedef enum __anonenum_T1_t_1 T1_t; enum Bool { FALSE = 0, TRUE = 2 }; static T1_t G1; T1_t G2 = E1; int G3 = 75; int G4; int R; int volatile v; void main(void) { enum Bool b; if ((unsigned int)E6 == G1) G2 = G1; if (0 == G4) G3 = G4; if (v) if (E1) R = 5; else R = 6; if (v) if (! E1) R = 6; else R = 5; if (v) if (E5) R = 7; else R = 5; if (v) if (! E5) R = 5; else R = 7; b = FALSE; if (! b) R += ! b; b = TRUE; if (b) R = (int)((unsigned int)R + b); b = (enum Bool)1; if (b) R = (int)((unsigned int)R + b); return; } frama-c-20.0-Calcium/tests/value/oracle/ilevel.res.oracle0000666000000000000000000000765213571573400020207 0ustar [kernel] Parsing tests/value/ilevel.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] i ∈ {0} j ∈ {0} k ∈ {0} l ∈ {0} [eva] tests/value/ilevel.i:9: starting to merge loop iterations [eva] tests/value/ilevel.i:12: starting to merge loop iterations [eva:alarm] tests/value/ilevel.i:20: Warning: assertion got status unknown. [eva:alarm] tests/value/ilevel.i:22: Warning: assertion got status unknown. [eva] tests/value/ilevel.i:24: Frama_C_show_each: [0..9] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {0; 1; 2; 3; 4; 5; 6; 7} j ∈ [0..16] k ∈ [0..15] l ∈ [0..9] __retres ∈ [0..47] [slicing] slicing requests in progress... [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main [from] Computing for function Frama_C_show_each [from] Done for function Frama_C_show_each [pdg] done for function main [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] i ∈ {0} j ∈ {0} k ∈ {0} l ∈ {0} [eva] tests/value/ilevel.i:9: starting to merge loop iterations [eva] tests/value/ilevel.i:12: starting to merge loop iterations [eva:alarm] tests/value/ilevel.i:26: Warning: signed overflow. assert (int)((int)(i + j) + k) + l ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {0; 1; 2; 3; 4; 5; 6; 7} j ∈ [0..16] k ∈ {0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15} l ∈ [--..--] __retres ∈ [--..--] [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] i ∈ {0} j ∈ {0} k ∈ {0} l ∈ {0} [eva] tests/value/ilevel.i:24: Frama_C_show_each: {0; 1; 2; 3; 4; 6; 7; 8; 9} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {0; 1; 2; 3; 4; 5; 6; 7} j ∈ {0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16} k ∈ {0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15} l ∈ {0; 1; 2; 3; 4; 6; 7; 8; 9} __retres ∈ [0..47] [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] i ∈ {0} j ∈ {0} k ∈ {0} l ∈ {0} [eva] tests/value/ilevel.i:24: Frama_C_show_each: {0; 1; 2; 3; 4; 6; 7; 8; 9} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {0; 1; 2; 3; 4; 5; 6; 7} j ∈ {0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16} k ∈ {0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15} l ∈ {0; 1; 2; 3; 4; 6; 7; 8; 9} __retres ∈ {0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47} frama-c-20.0-Calcium/tests/value/oracle/implies.res.oracle0000666000000000000000000000170513571573400020362 0ustar [kernel] Parsing tests/value/implies.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} B ∈ {0} [eva:alarm] tests/value/implies.i:6: Warning: assertion got status unknown. [eva:alarm] tests/value/implies.i:8: Warning: assertion got status unknown. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: A ∈ {1} __retres ∈ {1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: A FROM d \result FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: A; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/imprecise_invalid_write.res.oracle0000666000000000000000000000776613571573400023635 0ustar [kernel] Parsing tests/value/imprecise_invalid_write.i (no preprocessing) [kernel] tests/value/imprecise_invalid_write.i:5: Warning: Body of function main1 falls-through. Adding a return statement [kernel] tests/value/imprecise_invalid_write.i:10: Warning: Body of function main2 falls-through. Adding a return statement [kernel] tests/value/imprecise_invalid_write.i:17: Warning: Body of function main3 falls-through. Adding a return statement [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} s ∈ {{ "abc" }} [eva] computing for function main1 <- main. Called from tests/value/imprecise_invalid_write.i:22. [eva:alarm] tests/value/imprecise_invalid_write.i:5: Warning: out of bounds write. assert \valid((int *)c); [kernel] tests/value/imprecise_invalid_write.i:5: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/imprecise_invalid_write.i:25. [eva] tests/value/imprecise_invalid_write.i:9: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/imprecise_invalid_write.i:9} [eva:alarm] tests/value/imprecise_invalid_write.i:10: Warning: out of bounds write. assert \valid((int *)p); [kernel] tests/value/imprecise_invalid_write.i:10: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/imprecise_invalid_write.i:28. [eva] tests/value/imprecise_invalid_write.i:16: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/imprecise_invalid_write.i:16} [eva:alarm] tests/value/imprecise_invalid_write.i:17: Warning: out of bounds write. assert \valid(p); [kernel] tests/value/imprecise_invalid_write.i:17: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] tests/value/imprecise_invalid_write.i:5: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/imprecise_invalid_write.i:10: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/imprecise_invalid_write.i:17: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main2: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main3: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: [from] Computing for function main1 [from] Non-terminating function main1 (no dependencies) [from] Done for function main1 [from] Computing for function main2 [from] Non-terminating function main2 (no dependencies) [from] Done for function main2 [from] Computing for function main3 [from] Non-terminating function main3 (no dependencies) [from] Done for function main3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: NON TERMINATING - NO EFFECTS [from] Function main2: NON TERMINATING - NO EFFECTS [from] Function main3: NON TERMINATING - NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: \nothing [inout] Inputs for function main1: x [inout] Out (internal) for function main2: p [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main3: p [inout] Inputs for function main3: s [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: x; s frama-c-20.0-Calcium/tests/value/oracle/incompatible_states.res.oracle0000666000000000000000000001101113571573400022740 0ustar [kernel] Parsing tests/value/incompatible_states.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main1 <- main. Called from tests/value/incompatible_states.c:60. [eva] computing for function Frama_C_interval <- main1 <- main. Called from tests/value/incompatible_states.c:19. [eva] using specification for function Frama_C_interval [eva] tests/value/incompatible_states.c:19: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/incompatible_states.c:61. [eva] computing for function Frama_C_interval <- main2 <- main. Called from tests/value/incompatible_states.c:36. [eva] tests/value/incompatible_states.c:36: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/incompatible_states.c:38: Warning: accessing uninitialized left-value. assert \initialized(&t[(2 * i) / 2]); [eva:alarm] tests/value/incompatible_states.c:41: Warning: accessing uninitialized left-value. assert \initialized(&t[(2 * i) / 2]); [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/incompatible_states.c:62. [eva] computing for function Frama_C_interval <- main3 <- main. Called from tests/value/incompatible_states.c:51. [eva] tests/value/incompatible_states.c:51: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/incompatible_states.c:52: Warning: division by zero. assert t[i] ≢ 0; [eva:alarm] tests/value/incompatible_states.c:53: Warning: division by zero. assert t[i] ≢ 0; [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] tests/value/incompatible_states.c:41: assertion 'Eva,initialization' got final status invalid. [scope:rm_asserts] removing 2 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: Frama_C_entropy_source ∈ [--..--] x ∈ [0..10] y ∈ [0..100] z ∈ [-3..100] [eva:final-states] Values at end of function main2: Frama_C_entropy_source ∈ [--..--] t[0] ∈ {0; 1} [1] ∈ UNINITIALIZED i ∈ {0} x ∈ {0; 1} y ∈ {-1} [eva:final-states] Values at end of function main3: Frama_C_entropy_source ∈ [--..--] t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3] ∈ {4} [4] ∈ {5} [5] ∈ {0} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} i ∈ [0..9] x ∈ {0; 1} y ∈ {0; 1} [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] [from] Computing for function main1 [from] Computing for function Frama_C_interval <-main1 [from] Done for function Frama_C_interval [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function main1: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function main2: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source [from] Function main3: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: Frama_C_entropy_source; x; y; z [inout] Inputs for function main1: Frama_C_entropy_source [inout] Out (internal) for function main2: Frama_C_entropy_source; t[0]; i; x; y [inout] Inputs for function main2: Frama_C_entropy_source [inout] Out (internal) for function main3: Frama_C_entropy_source; t[0..9]; i; x; y [inout] Inputs for function main3: Frama_C_entropy_source [inout] Out (internal) for function main: Frama_C_entropy_source [inout] Inputs for function main: Frama_C_entropy_source frama-c-20.0-Calcium/tests/value/oracle/incorrect_reduce_expr.res.oracle0000666000000000000000000000103413571573400023270 0ustar [kernel] Parsing tests/value/incorrect_reduce_expr.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 256 to 295] ∈ [--..--] t[0..4] ∈ {0} p ∈ {0} x ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NULL[rbits 256 to 295] ∈ [--..--] p ∈ {32; 36} x ∈ {13} frama-c-20.0-Calcium/tests/value/oracle/ineq.res.oracle0000666000000000000000000000343213571573400017653 0ustar [kernel] Parsing tests/value/ineq.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G[0..9] ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} j ∈ {0} k ∈ {1} l ∈ {1} m ∈ {-1} n ∈ {-1} [eva] computing for function any_int <- main. Called from tests/value/ineq.c:6. [kernel:annot:missing-spec] tests/value/ineq.c:6: Warning: Neither code nor specification for function any_int, generating default assigns from the prototype [eva] using specification for function any_int [eva] Done for function any_int [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G[0] ∈ {0; 7} [1..9] ∈ {0} g ∈ [0..2147483647] h ∈ [-2147483648..0] i ∈ [0..2147483647] j ∈ [-2147483648..0] k ∈ [1..2147483647] l ∈ [1..2147483647] m ∈ [-2147483648..-1] n ∈ [-2147483648..-1] x ∈ [--..--] [from] Computing for function main [from] Computing for function any_int <-main [from] Done for function any_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function any_int: \result FROM \nothing [from] Function main: G[0] FROM \nothing g FROM \nothing (and SELF) h FROM \nothing (and SELF) i FROM \nothing (and SELF) j FROM \nothing (and SELF) k FROM \nothing (and SELF) l FROM \nothing (and SELF) m FROM \nothing (and SELF) n FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G[0]; g; h; i; j; k; l; m; n; x [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/infinite.res.oracle0000666000000000000000000000236713571573400020532 0ustar [kernel] Parsing tests/value/infinite.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} [eva] computing for function pause <- main. Called from tests/value/infinite.i:9. [kernel:annot:missing-spec] tests/value/infinite.i:9: Warning: Neither code nor specification for function pause, generating default assigns from the prototype [eva] using specification for function pause [eva] Done for function pause [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Computing for function pause <-main [from] Done for function pause [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function pause: NO EFFECTS [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G [inout] Inputs for function main: G frama-c-20.0-Calcium/tests/value/oracle/init.0.res.oracle0000666000000000000000000000253513571573400020023 0ustar [kernel] Parsing tests/value/init.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S[0] ∈ {49} [1] ∈ {50} [2] ∈ {51} [3] ∈ {52} [4] ∈ {53} v1 ∈ {0} TS[0].x ∈ {1} [0].y ∈ {3} [0].name[0] ∈ {175304776} {[0].name[1..9]; [1..28]} ∈ {0} v2 ∈ {0} C ∈ {0} PC[0] ∈ {108} [1] ∈ {107} [2] ∈ {106} [3] ∈ {108} [4] ∈ {106} [5] ∈ {0} T2[0].x2 ∈ {1} [0].y2 ∈ {2} [0].[bits 48 to 63] ∈ {0} [0].ptr ∈ {{ &PC[0] }} [1].x2 ∈ {1} [1].y2 ∈ {2} {[1]{.ptr; .[bits 48 to 63]}; [2..49]} ∈ {0} T[0] ∈ {1} [1..9] ∈ {0} U[0] ∈ {3} [1] ∈ {4} x ∈ {8} y ∈ {40} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {8} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/init.1.res.oracle0000666000000000000000000001237413571573400020026 0ustar [kernel] Parsing tests/value/init.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S[0] ∈ {49} [1] ∈ {50} [2] ∈ {51} [3] ∈ {52} [4] ∈ {53} v1 ∈ {0} TS[0].x ∈ {1} [0].y ∈ {3} [0].name[0] ∈ {175304776} {[0].name[1..9]; [1..28]} ∈ {0} v2{.x2; .y2} ∈ {0} .[bits 48 to 63] ∈ UNINITIALIZED .ptr ∈ {0} C ∈ {0} PC[0] ∈ {108} [1] ∈ {107} [2] ∈ {106} [3] ∈ {108} [4] ∈ {106} [5] ∈ {0} T2[0].x2 ∈ {1} [0].y2 ∈ {2} [0].[bits 48 to 63] ∈ UNINITIALIZED [0].ptr ∈ {{ &PC[0] }} [1].x2 ∈ {1} [1].y2 ∈ {2} [1].[bits 48 to 63] ∈ UNINITIALIZED {[1].ptr; [2]{.x2; .y2}} ∈ {0} [2].[bits 48 to 63] ∈ UNINITIALIZED {[2].ptr; [3]{.x2; .y2}} ∈ {0} [3].[bits 48 to 63] ∈ UNINITIALIZED {[3].ptr; [4]{.x2; .y2}} ∈ {0} [4].[bits 48 to 63] ∈ UNINITIALIZED {[4].ptr; [5]{.x2; .y2}} ∈ {0} [5].[bits 48 to 63] ∈ UNINITIALIZED {[5].ptr; [6]{.x2; .y2}} ∈ {0} [6].[bits 48 to 63] ∈ UNINITIALIZED {[6].ptr; [7]{.x2; .y2}} ∈ {0} [7].[bits 48 to 63] ∈ UNINITIALIZED {[7].ptr; [8]{.x2; .y2}} ∈ {0} [8].[bits 48 to 63] ∈ UNINITIALIZED {[8].ptr; [9]{.x2; .y2}} ∈ {0} [9].[bits 48 to 63] ∈ UNINITIALIZED {[9].ptr; [10]{.x2; .y2}} ∈ {0} [10].[bits 48 to 63] ∈ UNINITIALIZED {[10].ptr; [11]{.x2; .y2}} ∈ {0} [11].[bits 48 to 63] ∈ UNINITIALIZED {[11].ptr; [12]{.x2; .y2}} ∈ {0} [12].[bits 48 to 63] ∈ UNINITIALIZED {[12].ptr; [13]{.x2; .y2}} ∈ {0} [13].[bits 48 to 63] ∈ UNINITIALIZED {[13].ptr; [14]{.x2; .y2}} ∈ {0} [14].[bits 48 to 63] ∈ UNINITIALIZED {[14].ptr; [15]{.x2; .y2}} ∈ {0} [15].[bits 48 to 63] ∈ UNINITIALIZED {[15].ptr; [16]{.x2; .y2}} ∈ {0} [16].[bits 48 to 63] ∈ UNINITIALIZED {[16].ptr; [17]{.x2; .y2}} ∈ {0} [17].[bits 48 to 63] ∈ UNINITIALIZED {[17].ptr; [18]{.x2; .y2}} ∈ {0} [18].[bits 48 to 63] ∈ UNINITIALIZED {[18].ptr; [19]{.x2; .y2}} ∈ {0} [19].[bits 48 to 63] ∈ UNINITIALIZED {[19].ptr; [20]{.x2; .y2}} ∈ {0} [20].[bits 48 to 63] ∈ UNINITIALIZED {[20].ptr; [21]{.x2; .y2}} ∈ {0} [21].[bits 48 to 63] ∈ UNINITIALIZED {[21].ptr; [22]{.x2; .y2}} ∈ {0} [22].[bits 48 to 63] ∈ UNINITIALIZED {[22].ptr; [23]{.x2; .y2}} ∈ {0} [23].[bits 48 to 63] ∈ UNINITIALIZED {[23].ptr; [24]{.x2; .y2}} ∈ {0} [24].[bits 48 to 63] ∈ UNINITIALIZED {[24].ptr; [25]{.x2; .y2}} ∈ {0} [25].[bits 48 to 63] ∈ UNINITIALIZED {[25].ptr; [26]{.x2; .y2}} ∈ {0} [26].[bits 48 to 63] ∈ UNINITIALIZED {[26].ptr; [27]{.x2; .y2}} ∈ {0} [27].[bits 48 to 63] ∈ UNINITIALIZED {[27].ptr; [28]{.x2; .y2}} ∈ {0} [28].[bits 48 to 63] ∈ UNINITIALIZED {[28].ptr; [29]{.x2; .y2}} ∈ {0} [29].[bits 48 to 63] ∈ UNINITIALIZED {[29].ptr; [30]{.x2; .y2}} ∈ {0} [30].[bits 48 to 63] ∈ UNINITIALIZED {[30].ptr; [31]{.x2; .y2}} ∈ {0} [31].[bits 48 to 63] ∈ UNINITIALIZED {[31].ptr; [32]{.x2; .y2}} ∈ {0} [32].[bits 48 to 63] ∈ UNINITIALIZED {[32].ptr; [33]{.x2; .y2}} ∈ {0} [33].[bits 48 to 63] ∈ UNINITIALIZED {[33].ptr; [34]{.x2; .y2}} ∈ {0} [34].[bits 48 to 63] ∈ UNINITIALIZED {[34].ptr; [35]{.x2; .y2}} ∈ {0} [35].[bits 48 to 63] ∈ UNINITIALIZED {[35].ptr; [36]{.x2; .y2}} ∈ {0} [36].[bits 48 to 63] ∈ UNINITIALIZED {[36].ptr; [37]{.x2; .y2}} ∈ {0} [37].[bits 48 to 63] ∈ UNINITIALIZED {[37].ptr; [38]{.x2; .y2}} ∈ {0} [38].[bits 48 to 63] ∈ UNINITIALIZED {[38].ptr; [39]{.x2; .y2}} ∈ {0} [39].[bits 48 to 63] ∈ UNINITIALIZED {[39].ptr; [40]{.x2; .y2}} ∈ {0} [40].[bits 48 to 63] ∈ UNINITIALIZED {[40].ptr; [41]{.x2; .y2}} ∈ {0} [41].[bits 48 to 63] ∈ UNINITIALIZED {[41].ptr; [42]{.x2; .y2}} ∈ {0} [42].[bits 48 to 63] ∈ UNINITIALIZED {[42].ptr; [43]{.x2; .y2}} ∈ {0} [43].[bits 48 to 63] ∈ UNINITIALIZED {[43].ptr; [44]{.x2; .y2}} ∈ {0} [44].[bits 48 to 63] ∈ UNINITIALIZED {[44].ptr; [45]{.x2; .y2}} ∈ {0} [45].[bits 48 to 63] ∈ UNINITIALIZED {[45].ptr; [46]{.x2; .y2}} ∈ {0} [46].[bits 48 to 63] ∈ UNINITIALIZED {[46].ptr; [47]{.x2; .y2}} ∈ {0} [47].[bits 48 to 63] ∈ UNINITIALIZED {[47].ptr; [48]{.x2; .y2}} ∈ {0} [48].[bits 48 to 63] ∈ UNINITIALIZED {[48].ptr; [49]{.x2; .y2}} ∈ {0} [49].[bits 48 to 63] ∈ UNINITIALIZED [49].ptr ∈ {0} T[0] ∈ {1} [1..9] ∈ {0} U[0] ∈ {3} [1] ∈ {4} x ∈ {8} y ∈ {40} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {8} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/init_const_guard.res.oracle0000666000000000000000000002401613571573400022253 0ustar [kernel] Parsing tests/value/init_const_guard.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} q ∈ {{ &x }} p ∈ {{ &x }} v ∈ [--..--] [eva] tests/value/init_const_guard.i:14: function f: postcondition 'Const' got status valid. [eva] tests/value/init_const_guard.i:15: function f: postcondition 'Pointed_Valid' got status valid. [eva] tests/value/init_const_guard.i:16: function f: postcondition 'Q_ReadOnly' got status valid. [eva] tests/value/init_const_guard.i:17: function f: postcondition 'Q_NotWrite' got status valid. [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Post-condition 'Const' by Eva. [ Valid ] Post-condition 'Pointed_Valid' by Eva. [ Valid ] Post-condition 'Q_ReadOnly' by Eva. [ Valid ] Post-condition 'Q_NotWrite' by Eva. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion 'Read' (file tests/value/init_const_guard.i, line 32) Locally valid, but unreachable. By Eva because: - Unreachable program point (file tests/value/init_const_guard.i, line 32) [ Dead ] Assertion 'Guard_against_Const' (file tests/value/init_const_guard.i, line 33) Locally valid, but unreachable. By Eva because: - Unreachable program point (file tests/value/init_const_guard.i, line 33) [Unreachable] Unreachable program point (file tests/value/init_const_guard.i, line 32) by Eva. [Unreachable] Unreachable program point (file tests/value/init_const_guard.i, line 33) by Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 Completely validated 2 Dead properties 2 Unreachable 9 Total -------------------------------------------------------------------------------- [eva] Analyzing a complete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} q ∈ {{ &x }} p ∈ {{ &x }} v ∈ [--..--] [eva] tests/value/init_const_guard.i:32: assertion 'Read' got status valid. [eva] tests/value/init_const_guard.i:33: assertion 'Guard_against_Const' got status valid. [eva] tests/value/init_const_guard.i:27: function g: postcondition 'P_not_Const' got status valid. [eva] Recording results for g [eva] done for function g [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: x ∈ {0; 2} p ∈ {{ &x }} [from] Computing for function g [from] Done for function g [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: x FROM v (and SELF) p FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function g: x; p [inout] Inputs for function g: p; v [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Partial ] Default behavior By Frama-C kernel, with pending: - Post-condition 'Const' - Post-condition 'Pointed_Valid' - Post-condition 'Q_ReadOnly' - Post-condition 'Q_NotWrite' -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Post-condition 'P_not_Const' by Eva. [ Valid ] Assertion 'Read' (file tests/value/init_const_guard.i, line 32) by Eva. [ Valid ] Assertion 'Guard_against_Const' (file tests/value/init_const_guard.i, line 33) by Eva. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 1 Locally validated 5 Total -------------------------------------------------------------------------------- [eva] Analyzing an incomplete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ [--..--] q ∈ {{ &x }} p ∈ {{ NULL ; &S_p[0] }} v ∈ [--..--] S_p[0..1] ∈ [--..--] [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Post-condition 'Const' by Eva. [ Valid ] Post-condition 'Pointed_Valid' by Eva. [ Valid ] Post-condition 'Q_ReadOnly' by Eva. [ Valid ] Post-condition 'Q_NotWrite' by Eva. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Dead ] Assertion 'Read' (file tests/value/init_const_guard.i, line 32) Locally valid, but unreachable. By Eva because: - Unreachable program point (file tests/value/init_const_guard.i, line 32) [ Dead ] Assertion 'Guard_against_Const' (file tests/value/init_const_guard.i, line 33) Locally valid, but unreachable. By Eva because: - Unreachable program point (file tests/value/init_const_guard.i, line 33) [ Partial ] Default behavior By Frama-C kernel, with pending: - Post-condition 'P_not_Const' [Unreachable] Unreachable program point (file tests/value/init_const_guard.i, line 32) by Eva. [Unreachable] Unreachable program point (file tests/value/init_const_guard.i, line 33) by Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 Completely validated 1 Locally validated 2 Dead properties 2 Unreachable 10 Total -------------------------------------------------------------------------------- [eva] Analyzing an incomplete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ [--..--] q ∈ {{ &x }} p ∈ {{ NULL ; &S_p_0[0] }} v ∈ [--..--] S_p_0[0..1] ∈ [--..--] [eva] Recording results for g [eva] done for function g [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: x ∈ [--..--] p ∈ {{ &x }} [from] Computing for function g [from] Done for function g [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: x FROM v (and SELF) p FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function g: x; p [inout] Inputs for function g: p; v [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Partial ] Default behavior By Frama-C kernel, with pending: - Post-condition 'Const' - Post-condition 'Pointed_Valid' - Post-condition 'Q_ReadOnly' - Post-condition 'Q_NotWrite' -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Post-condition 'P_not_Const' by Eva. [ Valid ] Assertion 'Read' (file tests/value/init_const_guard.i, line 32) by Eva. [ Valid ] Assertion 'Guard_against_Const' (file tests/value/init_const_guard.i, line 33) by Eva. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 1 Locally validated 5 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/initialized.res.oracle0000666000000000000000000004246313571573400021233 0ustar [kernel] Parsing tests/value/initialized.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization b1 ∈ [--..--] b2 ∈ [--..--] b3 ∈ [--..--] b4 ∈ [--..--] b5 ∈ [--..--] b6 ∈ [--..--] rand ∈ [--..--] v1 ∈ {0} i6 ∈ [--..--] [eva] computing for function g1 <- main. Called from tests/value/initialized.c:193. [eva] tests/value/initialized.c:19: starting to merge loop iterations [eva:alarm] tests/value/initialized.c:21: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:22: Warning: assertion got status unknown. [eva] computing for function Frama_C_interval <- g1 <- main. Called from tests/value/initialized.c:24. [eva] using specification for function Frama_C_interval [eva] tests/value/initialized.c:24: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- g1 <- main. Called from tests/value/initialized.c:25. [eva] tests/value/initialized.c:25: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/initialized.c:26: Warning: assertion got status unknown. [eva] computing for function Frama_C_interval <- g1 <- main. Called from tests/value/initialized.c:28. [eva] tests/value/initialized.c:28: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- g1 <- main. Called from tests/value/initialized.c:29. [eva] tests/value/initialized.c:29: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/initialized.c:30: Warning: assertion got status unknown. [eva] computing for function Frama_C_interval <- g1 <- main. Called from tests/value/initialized.c:32. [eva] tests/value/initialized.c:32: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- g1 <- main. Called from tests/value/initialized.c:33. [eva] tests/value/initialized.c:33: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/initialized.c:34: assertion got status valid. [eva] computing for function Frama_C_interval <- g1 <- main. Called from tests/value/initialized.c:36. [eva] tests/value/initialized.c:36: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- g1 <- main. Called from tests/value/initialized.c:37. [eva] tests/value/initialized.c:37: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/initialized.c:38: Warning: assertion got status unknown. [eva] Recording results for g1 [eva] Done for function g1 [eva] computing for function g2 <- main. Called from tests/value/initialized.c:194. [eva:alarm] tests/value/initialized.c:50: Warning: signed overflow. assert -2147483648 ≤ (int)(&b4) + (int)(&b4); [eva:alarm] tests/value/initialized.c:50: Warning: signed overflow. assert (int)(&b4) + (int)(&b4) ≤ 2147483647; [eva] tests/value/initialized.c:50: Assigning imprecise value to t[6]. The imprecision originates from Arithmetic {tests/value/initialized.c:50} [eva] tests/value/initialized.c:51: Assigning imprecise value to t[7]. The imprecision originates from Arithmetic {tests/value/initialized.c:50} [eva] tests/value/initialized.c:63: Frama_C_dump_each: # Cvalue domain: Frama_C_entropy_source ∈ [--..--] b1 ∈ [--..--] b2 ∈ [--..--] b3 ∈ [--..--] b4 ∈ [--..--] b5 ∈ [--..--] b6 ∈ [--..--] rand ∈ [--..--] t[0..1] ∈ {0x11223344} or UNINITIALIZED [2..3] ∈ {0x55667788} or UNINITIALIZED [4..5] ∈ {0x12345678; 0x23456789} or UNINITIALIZED [6..7] ∈ {{ garbled mix of &{b4} (origin: Arithmetic {tests/value/initialized.c:50}) }} or UNINITIALIZED [8..9] ∈ {1; 2} or UNINITIALIZED [10][bits 0 to 23] ∈ {0} or UNINITIALIZED {[10][bits 24 to 31]#; [11][bits 0 to 23]#} ∈ {0x11111111} or UNINITIALIZED {[11][bits 24 to 31]; [12][bits 0 to 23]} ∈ {0} or UNINITIALIZED {[12][bits 24 to 31]#; [13][bits 0 to 23]#} ∈ {0x11111111; 0x22222222} or UNINITIALIZED [13][bits 24 to 31] ∈ {0} or UNINITIALIZED v1 ∈ {0} i6 ∈ [--..--] __retres ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/initialized.c:66: Warning: assertion got status unknown. [eva] tests/value/initialized.c:68: Frama_C_dump_each: # Cvalue domain: Frama_C_entropy_source ∈ [--..--] b1 ∈ [--..--] b2 ∈ [--..--] b3 ∈ [--..--] b4 ∈ [--..--] b5 ∈ [--..--] b6 ∈ [--..--] rand ∈ [--..--] t{[0]; [1][bits 0 to 23]#} ∈ {0x11223344} or UNINITIALIZED repeated %32, bits 0 to 55 [1][bits 24 to 31]# ∈ {0x11223344}%32, bits 24 to 31 [2][bits 0 to 23]# ∈ {0x55667788}%32, bits 0 to 23 [bits 88 to 127]# ∈ {0x55667788} or UNINITIALIZED repeated %32, bits 24 to 63 [4..5] ∈ {0x12345678; 0x23456789} or UNINITIALIZED [6..7] ∈ {{ garbled mix of &{b4} (origin: Arithmetic {tests/value/initialized.c:50}) }} or UNINITIALIZED [8..9] ∈ {1; 2} or UNINITIALIZED [10][bits 0 to 23] ∈ {0} or UNINITIALIZED {[10][bits 24 to 31]#; [11][bits 0 to 23]#} ∈ {0x11111111} or UNINITIALIZED {[11][bits 24 to 31]; [12][bits 0 to 23]} ∈ {0} or UNINITIALIZED {[12][bits 24 to 31]#; [13][bits 0 to 23]#} ∈ {0x11111111; 0x22222222} or UNINITIALIZED [13][bits 24 to 31] ∈ {0} or UNINITIALIZED p_0 ∈ {{ &t + {7} }} v1 ∈ {0} i6 ∈ [--..--] __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/initialized.c:70: Frama_C_show_each: {0x66778811} [eva:alarm] tests/value/initialized.c:72: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:74: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:76: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:78: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:80: Warning: assertion got status unknown. [eva] Recording results for g2 [eva] Done for function g2 [eva] computing for function g3 <- main. Called from tests/value/initialized.c:195. [eva:alarm] tests/value/initialized.c:89: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:93: Warning: accessing uninitialized left-value. assert \initialized(&r2); [eva:alarm] tests/value/initialized.c:96: Warning: accessing uninitialized left-value. assert \initialized(&x3); [eva] computing for function f <- g3 <- main. Called from tests/value/initialized.c:98. [eva] tests/value/initialized.c:11: starting to merge loop iterations [eva:alarm] tests/value/initialized.c:8: Warning: function f: postcondition got status invalid. [eva:alarm] tests/value/initialized.c:8: Warning: function f: postcondition got status unknown. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- g3 <- main. Called from tests/value/initialized.c:99. [eva] Recording results for f [eva] Done for function f [eva] Recording results for g3 [eva] Done for function g3 [eva] computing for function g4 <- main. Called from tests/value/initialized.c:196. [eva:alarm] tests/value/initialized.c:104: Warning: accessing uninitialized left-value. assert \initialized(&y); [eva] Recording results for g4 [eva] Done for function g4 [eva] computing for function g5 <- main. Called from tests/value/initialized.c:197. [eva] computing for function wrong_assigns <- g5 <- main. Called from tests/value/initialized.c:127. [eva] using specification for function wrong_assigns [eva] tests/value/initialized.c:114: Warning: function wrong_assigns: this postcondition evaluates to false in this context. If it is valid, either a precondition was not verified for this call, or some assigns/from clauses are incomplete (or incorrect). [eva] Done for function wrong_assigns [eva] tests/value/initialized.c:130: assertion got status valid. [eva] tests/value/initialized.c:131: assertion got status valid. [eva:alarm] tests/value/initialized.c:133: Warning: assertion got status unknown. [eva] Recording results for g5 [eva] Done for function g5 [eva] computing for function g6 <- main. Called from tests/value/initialized.c:198. [eva:alarm] tests/value/initialized.c:143: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:144: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:145: Warning: assertion got status unknown. [eva] tests/value/initialized.c:146: assertion got status valid. [eva:alarm] tests/value/initialized.c:147: Warning: assertion got status unknown. [eva] tests/value/initialized.c:148: assertion got status valid. [eva] Recording results for g6 [eva] Done for function g6 [eva] computing for function g7 <- main. Called from tests/value/initialized.c:199. [eva] computing for function Frama_C_make_unknown <- g7 <- main. Called from tests/value/initialized.c:153. [eva] using specification for function Frama_C_make_unknown [eva] tests/value/initialized.c:153: function Frama_C_make_unknown: precondition 'valid_p' got status valid. [eva] Done for function Frama_C_make_unknown [eva] tests/value/initialized.c:154: assertion got status valid. [eva] Recording results for g7 [eva] Done for function g7 [eva] computing for function reduce_by_negation <- main. Called from tests/value/initialized.c:200. [eva:alarm] tests/value/initialized.c:164: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:165: Warning: check 'invalid' got status invalid. [eva:alarm] tests/value/initialized.c:168: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:169: Warning: check 'unknown' got status unknown. [eva:alarm] tests/value/initialized.c:172: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:173: Warning: check 'unknown' got status unknown. [eva:alarm] tests/value/initialized.c:177: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:178: Warning: check 'unknown' got status unknown. [eva:alarm] tests/value/initialized.c:182: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:183: Warning: check 'invalid' got status unknown. [eva] tests/value/initialized.c:186: starting to merge loop iterations [eva:alarm] tests/value/initialized.c:188: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized.c:189: Warning: check 'unknown' got status unknown. [eva] Recording results for reduce_by_negation [eva] Done for function reduce_by_negation [eva] Recording results for main [eva] done for function main [eva] tests/value/initialized.c:93: assertion 'Eva,initialization' got final status invalid. [eva] tests/value/initialized.c:104: assertion 'Eva,initialization' got final status invalid. [scope:rm_asserts] removing 3 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: t1[0] ∈ UNINITIALIZED [1..2] ∈ {1; 2} or UNINITIALIZED [3..4] ∈ UNINITIALIZED t2[0] ∈ UNINITIALIZED [1..248] ∈ [1..248] or UNINITIALIZED [249] ∈ UNINITIALIZED [eva:final-states] Values at end of function g1: Frama_C_entropy_source ∈ [--..--] t1[0..19] ∈ {1} t2[0..3] ∈ {2} or UNINITIALIZED [4..19] ∈ {2} t3[0..5] ∈ {3} or UNINITIALIZED [6..12] ∈ {3} [13..19] ∈ {3} or UNINITIALIZED t4[0..6] ∈ {4} or UNINITIALIZED [7] ∈ {4} [8..19] ∈ {4} or UNINITIALIZED t5[0..19] ∈ {5} or UNINITIALIZED t6[0..19] ∈ {6} or UNINITIALIZED i ∈ {7; 8; 9} j ∈ {4; 5; 6; 7} [eva:final-states] Values at end of function g2: t{[0]; [1][bits 0 to 23]#} ∈ {0x11223344} or UNINITIALIZED repeated %32, bits 0 to 55 [1][bits 24 to 31]# ∈ {0x11223344}%32, bits 24 to 31 [2][bits 0 to 23]# ∈ {0x55667788}%32, bits 0 to 23 [bits 88 to 119]# ∈ {0x55667788} or UNINITIALIZED repeated %32, bits 24 to 55 [3][bits 24 to 31]# ∈ {0x55667788}%32, bits 24 to 31 [4..5] ∈ {0x12345678; 0x23456789} or UNINITIALIZED [6][bits 0 to 23] ∈ {{ garbled mix of &{b4} (origin: Arithmetic {tests/value/initialized.c:50}) }} {[6][bits 24 to 31]; [7]} ∈ {{ garbled mix of &{b4} (origin: Arithmetic {tests/value/initialized.c:50}) }} or UNINITIALIZED [8] ∈ {1; 2} or UNINITIALIZED [9] ∈ {1; 2} [10][bits 0 to 23] ∈ {0} or UNINITIALIZED [10][bits 24 to 31]# ∈ {0x11111111} or UNINITIALIZED%32, bits 0 to 7 [11][bits 0 to 23]# ∈ {0x11111111}%32, bits 8 to 31 [11][bits 24 to 31] ∈ {0} [12][bits 0 to 23] ∈ {0} or UNINITIALIZED {[12][bits 24 to 31]#; [13][bits 0 to 23]#} ∈ {0x11111111; 0x22222222} or UNINITIALIZED [13][bits 24 to 31] ∈ {0} p_0 ∈ {{ &t + {7} }} [eva:final-states] Values at end of function g3: r1 ∈ {2} x1 ∈ {1} x2 ∈ UNINITIALIZED x3 ∈ {1} r3 ∈ {2} t1[0] ∈ UNINITIALIZED [1..2] ∈ {1; 2} [3..4] ∈ UNINITIALIZED t2[0] ∈ UNINITIALIZED [1..248] ∈ [1..248] [249] ∈ UNINITIALIZED [eva:final-states] Values at end of function g4: NON TERMINATING FUNCTION [eva:final-states] Values at end of function g6: i6 ∈ UNINITIALIZED [eva:final-states] Values at end of function g7: Frama_C_entropy_source ∈ [--..--] key[0..63] ∈ [--..--] [64..127] ∈ UNINITIALIZED [eva:final-states] Values at end of function reduce_by_negation: x ∈ {0} or UNINITIALIZED y ∈ {0} or UNINITIALIZED p ∈ {{ &x ; &y }} t[0..9] ∈ [0..9] or UNINITIALIZED [eva:final-states] Values at end of function g5: v ∈ UNINITIALIZED p ∈ {{ &v1 ; &v2 }} [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] i6 ∈ UNINITIALIZED __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function g1 [from] Computing for function Frama_C_interval <-g1 [from] Done for function Frama_C_interval [from] Done for function g1 [from] Computing for function g2 [from] Done for function g2 [from] Computing for function g3 [from] Done for function g3 [from] Computing for function g4 [from] Non-terminating function g4 (no dependencies) [from] Done for function g4 [from] Computing for function g6 [from] Done for function g6 [from] Computing for function g7 [from] Computing for function Frama_C_make_unknown <-g7 [from] Done for function Frama_C_make_unknown [from] Done for function g7 [from] Computing for function reduce_by_negation [from] Done for function reduce_by_negation [from] Computing for function g5 [from] Computing for function wrong_assigns <-g5 [from] Done for function wrong_assigns [from] Done for function g5 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function Frama_C_make_unknown: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) key[0..63] FROM Frama_C_entropy_source [from] Function f: t1[1..4] FROM m; t; n (and SELF) t2[1..248] FROM m; t; n (and SELF) [from] Function g1: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function g2: NO EFFECTS [from] Function g3: NO EFFECTS [from] Function g4: NON TERMINATING - NO EFFECTS [from] Function g6: i6 FROM rand (and SELF) [from] Function g7: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function reduce_by_negation: NO EFFECTS [from] Function wrong_assigns: v{.a; .b} FROM \nothing [from] Function g5: NO EFFECTS [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) i6 FROM rand (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: i; t1[1..4]; t2[1..248] [inout] Inputs for function f: \nothing [inout] Out (internal) for function g1: Frama_C_entropy_source; t1[0..19]; t2[0..19]; t3[0..19]; t4[0..19]; t5[0..19]; t6[0..19]; i; j; i_0 [inout] Inputs for function g1: Frama_C_entropy_source; rand [inout] Out (internal) for function g2: t[0..13]; p; p_0 [inout] Inputs for function g2: b4; b5 [inout] Out (internal) for function g3: r1; x1; x2; x3; r3; t1[1..2]; t2[1..248] [inout] Inputs for function g3: b1; b2; b3; b6 [inout] Out (internal) for function g4: x [inout] Inputs for function g4: \nothing [inout] Out (internal) for function g6: i6 [inout] Inputs for function g6: rand [inout] Out (internal) for function g7: Frama_C_entropy_source; key[0..63] [inout] Inputs for function g7: Frama_C_entropy_source [inout] Out (internal) for function reduce_by_negation: x; y; p; tmp; t[0..9]; i [inout] Inputs for function reduce_by_negation: rand [inout] Out (internal) for function g5: v{.a; .b}; p; tmp [inout] Inputs for function g5: rand [inout] Out (internal) for function main: Frama_C_entropy_source; i6; __retres [inout] Inputs for function main: Frama_C_entropy_source; b1; b2; b3; b4; b5; b6; rand frama-c-20.0-Calcium/tests/value/oracle/initialized_copy.0.res.oracle0000666000000000000000000001704213571573400022416 0ustar [kernel] Parsing tests/value/initialized_copy.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization w[0..9] ∈ {0} v ∈ [--..--] [eva:alarm] tests/value/initialized_copy.i:29: Warning: accessing uninitialized left-value. assert \initialized(&b); [eva:alarm] tests/value/initialized_copy.i:37: Warning: accessing uninitialized left-value. assert \initialized(&b_0); [eva] tests/value/initialized_copy.i:38: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0} v ∈ [--..--] b_0 ∈ {1} a_0 ∈ {1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/initialized_copy.i:47: Warning: accessing uninitialized left-value. assert \initialized(&c); [eva:alarm] tests/value/initialized_copy.i:64: Warning: accessing uninitialized left-value. assert \initialized(&c_0); [eva] tests/value/initialized_copy.i:65: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0} v ∈ [--..--] c_0 ∈ {67305985} p_0 ∈ {{ &c_0 + {3} }} a_2 ∈ {67305985} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/initialized_copy.i:73: Frama_C_show_each: .c ∈ {1} .[bits 8 to 31] ∈ UNINITIALIZED .i ∈ {5} [eva] tests/value/initialized_copy.i:79: Frama_C_show_each: UNINITIALIZED [eva] tests/value/initialized_copy.i:85: Frama_C_show_each: .i1 ∈ {1} .i2 ∈ UNINITIALIZED [eva:alarm] tests/value/initialized_copy.i:90: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized_copy.i:92: Warning: accessing uninitialized left-value. assert \initialized(&v_0[i]); [eva:alarm] tests/value/initialized_copy.i:98: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized_copy.i:101: Warning: accessing uninitialized left-value. assert \initialized(&v_1[i_0]); [eva] tests/value/initialized_copy.i:102: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0} v ∈ [--..--] i_0 ∈ [0..9] t_0[0..9] ∈ {1} or UNINITIALIZED v_1[0] ∈ UNINITIALIZED [1] ∈ {1} [2..9] ∈ UNINITIALIZED __retres ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/initialized_copy.i:108: Warning: assertion got status unknown. [eva:alarm] tests/value/initialized_copy.i:111: Warning: accessing uninitialized left-value. assert \initialized(&v_2[i_1]); [eva] tests/value/initialized_copy.i:112: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0; 12} v ∈ [--..--] i_1 ∈ [0..9] v_2[0] ∈ UNINITIALIZED [1] ∈ {12} [2..9] ∈ UNINITIALIZED __retres ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/initialized_copy.i:117: Warning: accessing uninitialized left-value. assert \initialized(&a_3); [eva:alarm] tests/value/initialized_copy.i:124: Warning: accessing uninitialized left-value. assert \initialized(&a_4); [eva:alarm] tests/value/initialized_copy.i:129: Warning: accessing uninitialized left-value. assert \initialized(&a_5); [eva:alarm] tests/value/initialized_copy.i:135: Warning: accessing uninitialized left-value. assert \initialized(&a_6); [eva:alarm] tests/value/initialized_copy.i:143: Warning: accessing uninitialized left-value. assert \initialized(&a_7); [eva] computing for function f <- main. Called from tests/value/initialized_copy.i:143. [eva] Recording results for f [eva] Done for function f [eva] tests/value/initialized_copy.i:144: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0; 12} v ∈ [--..--] a_7 ∈ {1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/initialized_copy.i:151: Warning: accessing uninitialized left-value. assert \initialized(&a_8); [eva] computing for function g <- main. Called from tests/value/initialized_copy.i:151. [kernel:annot:missing-spec] tests/value/initialized_copy.i:151: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] tests/value/initialized_copy.i:152: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0; 12} v ∈ [--..--] a_8 ∈ {1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] tests/value/initialized_copy.i:29: assertion 'Eva,initialization' got final status invalid. [eva] tests/value/initialized_copy.i:47: assertion 'Eva,initialization' got final status invalid. [eva] tests/value/initialized_copy.i:92: assertion 'Eva,initialization' got final status invalid. [eva] tests/value/initialized_copy.i:117: assertion 'Eva,initialization' got final status invalid. [eva] tests/value/initialized_copy.i:129: assertion 'Eva,initialization' got final status invalid. [eva] tests/value/initialized_copy.i:135: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function main: w[0..9] ∈ {0; 12} __retres ∈ {0; 8} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NO EFFECTS [from] Function g: NO EFFECTS [from] Function main: w[0..9] FROM v (and SELF) \result FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: w[0..9]; a; b_0; a_0; c[bits 0 to 7]; p; a_1; c_0; p_0; a_2; s1{.c; .i}; s2; sv1; sv1_0; sv2_0.i1; i; t[0..9]; i_0; t_0[0..9]; v_1[1]; i_1; v_2[1]; a_4; a_7; a_8; __retres [inout] Inputs for function main: v [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization w[0..9] ∈ {0} v ∈ [--..--] [eva:alarm] tests/value/initialized_copy.i:160: Warning: accessing uninitialized left-value. assert \initialized(&x); [eva] Recording results for main2 [eva] done for function main2 [eva] tests/value/initialized_copy.i:160: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: \nothing [inout] Inputs for function main2: \nothing [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization w[0..9] ∈ {0} v ∈ [--..--] [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: \nothing [inout] Inputs for function main2: \nothing frama-c-20.0-Calcium/tests/value/oracle/initialized_copy.1.res.oracle0000666000000000000000000001150013571573400022410 0ustar [kernel] Parsing tests/value/initialized_copy.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization w[0..9] ∈ {0} v ∈ [--..--] [eva] tests/value/initialized_copy.i:30: Frama_C_show_each_unreached: [eva] tests/value/initialized_copy.i:38: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0} v ∈ [--..--] b_0 ∈ {1} or UNINITIALIZED a_0 ∈ {1} or UNINITIALIZED __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/initialized_copy.i:48: Frama_C_show_each_unreached: [eva] tests/value/initialized_copy.i:65: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0} v ∈ [--..--] c_0[bits 0 to 7] ∈ {1} or UNINITIALIZED [bits 8 to 15] ∈ {2} [bits 16 to 23] ∈ {3} [bits 24 to 31] ∈ {4} p_0 ∈ {{ &c_0 + {3} }} a_2[bits 0 to 7] ∈ {1} or UNINITIALIZED [bits 8 to 15] ∈ {2} [bits 16 to 23] ∈ {3} [bits 24 to 31] ∈ {4} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/initialized_copy.i:73: Frama_C_show_each: .c ∈ {1} .[bits 8 to 31] ∈ UNINITIALIZED .i ∈ {5} [eva] tests/value/initialized_copy.i:79: Frama_C_show_each: UNINITIALIZED [eva] tests/value/initialized_copy.i:85: Frama_C_show_each: .i1 ∈ {1} .i2 ∈ UNINITIALIZED [eva:alarm] tests/value/initialized_copy.i:90: Warning: assertion got status unknown. [eva] tests/value/initialized_copy.i:93: Frama_C_show_each_unreached: [eva:alarm] tests/value/initialized_copy.i:98: Warning: assertion got status unknown. [eva] tests/value/initialized_copy.i:102: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0} v ∈ [--..--] i_0 ∈ [0..9] t_0[0..9] ∈ {1} or UNINITIALIZED v_1[0] ∈ UNINITIALIZED [1] ∈ {1} [2..9] ∈ UNINITIALIZED __retres ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/initialized_copy.i:108: Warning: assertion got status unknown. [eva] tests/value/initialized_copy.i:112: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0; 12} or UNINITIALIZED v ∈ [--..--] i_1 ∈ [0..9] v_2[0] ∈ UNINITIALIZED [1] ∈ {12} [2..9] ∈ UNINITIALIZED __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] computing for function f <- main. Called from tests/value/initialized_copy.i:129. [eva] Recording results for f [eva] Done for function f [eva] tests/value/initialized_copy.i:130: Frama_C_show_each_unreached: [eva:alarm] tests/value/initialized_copy.i:135: Warning: accessing uninitialized left-value. assert \initialized(&a_6); [eva] computing for function f <- main. Called from tests/value/initialized_copy.i:143. [eva] Recording results for f [eva] Done for function f [eva] tests/value/initialized_copy.i:144: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0; 12} or UNINITIALIZED v ∈ [--..--] a_7 ∈ {1} or UNINITIALIZED __retres ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/initialized_copy.i:151: Warning: accessing uninitialized left-value. assert \initialized(&a_8); [eva] computing for function g <- main. Called from tests/value/initialized_copy.i:151. [kernel:annot:missing-spec] tests/value/initialized_copy.i:151: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] tests/value/initialized_copy.i:152: Frama_C_dump_each: # Cvalue domain: w[0..9] ∈ {0; 12} or UNINITIALIZED v ∈ [--..--] a_8 ∈ {1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] tests/value/initialized_copy.i:135: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function main: w[0..9] ∈ {0; 12} or UNINITIALIZED __retres ∈ {0; 8} or UNINITIALIZED [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NO EFFECTS [from] Function g: NO EFFECTS [from] Function main: w[0..9] FROM v (and SELF) \result FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: w[0..9]; a; b_0; a_0; c[bits 0 to 7]; p; a_1; c_0; p_0; a_2; s1{.c; .i}; s2; sv1; sv1_0; sv2_0.i1; i; t[0..9]; i_0; t_0[0..9]; v_1[1]; i_1; v_2[1]; a_4; a_7; a_8; __retres [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/inout.0.res.oracle0000666000000000000000000000261513571573400020215 0ustar [kernel] Parsing tests/value/inout.i (no preprocessing) [eva] Analyzing a complete application starting at inout_11_0 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Xt ∈ {0} Xs ∈ {0} Xs_I ∈ {0} Ys ∈ {0} Ys_I ∈ {0} Z ∈ {0} I ∈ {0} I_size ∈ {8} Itab[0] ∈ {-40} [1] ∈ {-25} [2] ∈ {-15} [3] ∈ {-5} [4] ∈ {5} [5] ∈ {15} [6] ∈ {25} [7] ∈ {40} I5_nt ∈ {0} [eva:alarm] tests/value/inout.i:16: Warning: signed overflow. assert -2147483648 ≤ i1 + i2; [eva:alarm] tests/value/inout.i:16: Warning: signed overflow. assert i1 + i2 ≤ 2147483647; [eva:alarm] tests/value/inout.i:18: Warning: out of bounds write. assert \valid(i); [eva] Recording results for inout_11_0 [eva] done for function inout_11_0 [from] Computing for function inout_11_0 [from] Done for function inout_11_0 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function inout_11_0: Xt FROM I Xs FROM i1 Xs_I FROM Xs_I Ys FROM i1; i2 Z FROM i S_i[0] FROM i [from] ====== END OF DEPENDENCIES ====== [inout] InOut (internal) for function inout_11_0: Operational inputs: Xs_I; I; i1; i2; i Operational inputs on termination: Xs_I; I; i1; i2; i Sure outputs: Xt; Xs; Xs_I; Ys; Z; S_i[0] frama-c-20.0-Calcium/tests/value/oracle/inout.1.res.oracle0000666000000000000000000000245713571573400020222 0ustar [kernel] Parsing tests/value/inout.i (no preprocessing) [eva] Analyzing a complete application starting at inout_11_3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Xt ∈ {0} Xs ∈ {0} Xs_I ∈ {0} Ys ∈ {0} Ys_I ∈ {0} Z ∈ {0} I ∈ {0} I_size ∈ {8} Itab[0] ∈ {-40} [1] ∈ {-25} [2] ∈ {-15} [3] ∈ {-5} [4] ∈ {5} [5] ∈ {15} [6] ∈ {25} [7] ∈ {40} I5_nt ∈ {0} [eva] tests/value/inout.i:37: starting to merge loop iterations [eva:alarm] tests/value/inout.i:42: Warning: accessing uninitialized left-value. assert \initialized(&r); [eva] Recording results for inout_11_3 [eva] done for function inout_11_3 [from] Computing for function inout_11_3 [from] Done for function inout_11_3 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function inout_11_3: Xs FROM i1 Z FROM I_size; Itab{[0]; [7]}; i2 (and SELF) \result FROM I_size; Itab[0..7]; i2 [from] ====== END OF DEPENDENCIES ====== [inout] InOut (internal) for function inout_11_3: Operational inputs: I_size; Itab[0..7]; i1; i2; r Operational inputs on termination: I_size; Itab[0..7]; i1; i2; r Sure outputs: Xs; es frama-c-20.0-Calcium/tests/value/oracle/inout.2.res.oracle0000666000000000000000000000222713571573400020216 0ustar [kernel] Parsing tests/value/inout.i (no preprocessing) [eva] Analyzing a complete application starting at never_terminate [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Xt ∈ {0} Xs ∈ {0} Xs_I ∈ {0} Ys ∈ {0} Ys_I ∈ {0} Z ∈ {0} I ∈ {0} I_size ∈ {8} Itab[0] ∈ {-40} [1] ∈ {-25} [2] ∈ {-15} [3] ∈ {-5} [4] ∈ {5} [5] ∈ {15} [6] ∈ {25} [7] ∈ {40} I5_nt ∈ {0} [eva] Recording results for never_terminate [eva] done for function never_terminate [from] Computing for function never_terminate [from] Non-terminating function never_terminate (no dependencies) [from] Done for function never_terminate [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function never_terminate: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] InOut (internal) for function never_terminate: Operational inputs: i1_nt; i2_nt; i3_nt Operational inputs on termination: \nothing Sure outputs: ANYTHING(origin:Unknown) frama-c-20.0-Calcium/tests/value/oracle/inout.3.res.oracle0000666000000000000000000000211613571573400020214 0ustar [kernel] Parsing tests/value/inout.i (no preprocessing) [eva] Analyzing a complete application starting at may_not_terminate [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Xt ∈ {0} Xs ∈ {0} Xs_I ∈ {0} Ys ∈ {0} Ys_I ∈ {0} Z ∈ {0} I ∈ {0} I_size ∈ {8} Itab[0] ∈ {-40} [1] ∈ {-25} [2] ∈ {-15} [3] ∈ {-5} [4] ∈ {5} [5] ∈ {15} [6] ∈ {25} [7] ∈ {40} I5_nt ∈ {0} [eva] Recording results for may_not_terminate [eva] done for function may_not_terminate [from] Computing for function may_not_terminate [from] Done for function may_not_terminate [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function may_not_terminate: Xs FROM i3 [from] ====== END OF DEPENDENCIES ====== [inout] InOut (internal) for function may_not_terminate: Operational inputs: I5_nt; i1; i2; i3; i4; i5_nt Operational inputs on termination: i1; i2; i3; i4 Sure outputs: Xs; es frama-c-20.0-Calcium/tests/value/oracle/inout.4.res.oracle0000666000000000000000000000322413571573400020216 0ustar [kernel] Parsing tests/value/inout.i (no preprocessing) [eva] Analyzing a complete application starting at call_may_not_terminate [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Xt ∈ {0} Xs ∈ {0} Xs_I ∈ {0} Ys ∈ {0} Ys_I ∈ {0} Z ∈ {0} I ∈ {0} I_size ∈ {8} Itab[0] ∈ {-40} [1] ∈ {-25} [2] ∈ {-15} [3] ∈ {-5} [4] ∈ {5} [5] ∈ {15} [6] ∈ {25} [7] ∈ {40} I5_nt ∈ {0} [eva] computing for function may_not_terminate <- call_may_not_terminate. Called from tests/value/inout.i:68. [eva] Recording results for may_not_terminate [eva] Done for function may_not_terminate [eva] Recording results for call_may_not_terminate [eva] done for function call_may_not_terminate [from] Computing for function may_not_terminate [from] Done for function may_not_terminate [from] Computing for function call_may_not_terminate [from] Done for function call_may_not_terminate [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function may_not_terminate: Xs FROM i3 [from] Function call_may_not_terminate: Xs FROM j3 [from] ====== END OF DEPENDENCIES ====== [inout] InOut (internal) for function may_not_terminate: Operational inputs: I5_nt; i1; i2; i3; i4; i5_nt Operational inputs on termination: i1; i2; i3; i4 Sure outputs: Xs; es [inout] InOut (internal) for function call_may_not_terminate: Operational inputs: I5_nt; j1; j2; j3; j4; j5; c1; c2 Operational inputs on termination: j1; j2; j3; j4; j5; c1; c2 Sure outputs: Xs frama-c-20.0-Calcium/tests/value/oracle/inout_diff.res.oracle0000666000000000000000000000567713571573400021062 0ustar [kernel] Parsing tests/value/inout_diff.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..49] ∈ {0} u[0..49] ∈ {0} x ∈ {0} [eva:alarm] tests/value/inout_diff.i:18: Warning: accessing out of bounds index. assert c < 50; [eva:alarm] tests/value/inout_diff.i:20: Warning: accessing out of bounds index. assert (int)(c + 1) < 50; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0..1] ∈ {1} [2..4] ∈ {0} [5..6] ∈ {1} [7..9] ∈ {0} [10..11] ∈ {1} [12..14] ∈ {0} [15..16] ∈ {1} [17..19] ∈ {0} [20..21] ∈ {1} [22..24] ∈ {0} [25..26] ∈ {1} [27..29] ∈ {0} [30..31] ∈ {1} [32..34] ∈ {0} [35..36] ∈ {1} [37..39] ∈ {0} [40..41] ∈ {1} [42..44] ∈ {0} [45..46] ∈ {1} [47..49] ∈ {0} u[0] ∈ {1} [1..4] ∈ {0} [5] ∈ {1} [6..9] ∈ {0} [10] ∈ {1} [11..14] ∈ {0} [15] ∈ {1} [16..19] ∈ {0} [20] ∈ {1} [21..24] ∈ {0} [25] ∈ {1} [26..29] ∈ {0} [30] ∈ {1} [31..34] ∈ {0} [35] ∈ {1} [36..39] ∈ {0} [40] ∈ {1} [41..44] ∈ {0} [45] ∈ {1} [46..49] ∈ {0} x ∈ {0; 1; 2; 3} c ∈ {0; 7; 14; 21; 28; 35; 42} i ∈ {50} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t{[0..1]; [5..6]; [10..11]; [15..16]; [20..21]; [25..26]; [30..31]; [35..36]; [40..41]; [45..46]} FROM \nothing u{[0]; [5]; [10]; [15]; [20]; [25]; [30]; [35]; [40]; [45]} FROM \nothing x FROM t{[7]; [14]; [28]; [42]; [49]}; u{[1]; [7..8]; [14]; [21..22]; [28..29]; [36]; [42..43]; [49]}; c \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t{[0..1]; [5..6]; [10..11]; [15..16]; [20..21]; [25..26]; [30..31]; [35..36]; [40..41]; [45..46]}; u{[0]; [5]; [10]; [15]; [20]; [25]; [30]; [35]; [40]; [45]}; x; c; i; __retres [inout] Inputs for function main: t{[0]; [7]; [14]; [21]; [28]; [35]; [42]; [49]}; u{[0..1]; [7..8]; [14..15]; [21..22]; [28..29]; [35..36]; [42..43]; [49]}; x [inout] InOut (internal) for function main: Operational inputs: t{[7]; [14]; [28]; [42]; [49]}; u{[1]; [7..8]; [14]; [21..22]; [28..29]; [36]; [42..43]; [49]}; c Operational inputs on termination: t{[7]; [14]; [28]; [42]; [49]}; u{[1]; [7..8]; [14]; [21..22]; [28..29]; [36]; [42..43]; [49]}; c Sure outputs: t{[0..1]; [5..6]; [10..11]; [15..16]; [20..21]; [25..26]; [30..31]; [35..36]; [40..41]; [45..46]}; u{[0]; [5]; [10]; [15]; [20]; [25]; [30]; [35]; [40]; [45]}; x; c; i; __retres frama-c-20.0-Calcium/tests/value/oracle/inout_formals.res.oracle0000666000000000000000000000153713571573400021604 0ustar [kernel] Parsing tests/value/inout_formals.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva:alarm] tests/value/inout_formals.i:7: Warning: out of bounds write. assert \valid(i); [eva] tests/value/inout_formals.i:8: Frama_C_show_each: {{ &S_i }} [eva] Recording results for main [eva] done for function main [inout] InOut (internal) for function main: Operational inputs: x; y; i Operational inputs on termination: x; y; i Sure outputs: S_i[0] [inout] InOut (with formals) for function main: Operational inputs: x; y; i Operational inputs on termination: x; y; i Sure outputs: S_i[0] [inout] Inputs (with formals) for function main: x; y; i; S_i[0] frama-c-20.0-Calcium/tests/value/oracle/inout_on_alarms.res.oracle0000666000000000000000000000746413571573400022121 0ustar [kernel] Parsing tests/value/inout_on_alarms.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} t[0..9] ∈ {0} p ∈ {0} S[0..9] ∈ {0} c ∈ [--..--] [eva] computing for function f <- main. Called from tests/value/inout_on_alarms.i:37. [eva:alarm] tests/value/inout_on_alarms.i:17: Warning: accessing out of bounds index. assert p->i < 10; [kernel] tests/value/inout_on_alarms.i:17: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/inout_on_alarms.i:40. [eva:alarm] tests/value/inout_on_alarms.i:21: Warning: accessing out of bounds index. assert i < 10; [kernel] tests/value/inout_on_alarms.i:21: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for g [eva] Done for function g [eva] computing for function h <- main. Called from tests/value/inout_on_alarms.i:44. [eva:alarm] tests/value/inout_on_alarms.i:26: Warning: accessing uninitialized left-value. assert \initialized(q); [eva] Recording results for h [eva] Done for function h [eva] Recording results for main [eva] done for function main [eva] tests/value/inout_on_alarms.i:17: assertion 'Eva,index_bound' got final status invalid. [eva] tests/value/inout_on_alarms.i:21: assertion 'Eva,index_bound' got final status invalid. [eva] tests/value/inout_on_alarms.i:26: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: NON TERMINATING FUNCTION [eva:final-states] Values at end of function g: NON TERMINATING FUNCTION [eva:final-states] Values at end of function h: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: i ∈ {12} p ∈ {{ &S[8] }} S[0..7] ∈ {0} [8].i ∈ {12} [9] ∈ {0} [from] Computing for function f [from] Non-terminating function f (no dependencies) [from] Done for function f [from] Computing for function g [from] Non-terminating function g (no dependencies) [from] Done for function g [from] Computing for function h [from] Non-terminating function h (no dependencies) [from] Done for function h [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NON TERMINATING - NO EFFECTS [from] Function g: NON TERMINATING - NO EFFECTS [from] Function h: NON TERMINATING - NO EFFECTS [from] Function main: i FROM \nothing p FROM \nothing S[8] FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: p; S[8] [inout] InOut (internal) for function f: Operational inputs: p; S[8] Operational inputs on termination: \nothing Sure outputs: ANYTHING(origin:Unknown) [inout] Out (internal) for function g: \nothing [inout] Inputs for function g: i [inout] InOut (internal) for function g: Operational inputs: i Operational inputs on termination: \nothing Sure outputs: ANYTHING(origin:Unknown) [inout] Out (internal) for function h: \nothing [inout] Inputs for function h: z [inout] InOut (internal) for function h: Operational inputs: q; z Operational inputs on termination: \nothing Sure outputs: ANYTHING(origin:Unknown) [inout] Out (internal) for function main: i; p; S[8] [inout] Inputs for function main: i; p; S[8]; c [inout] InOut (internal) for function main: Operational inputs: c; z Operational inputs on termination: c Sure outputs: i; p; S[8] frama-c-20.0-Calcium/tests/value/oracle/inout_proto.res.oracle0000666000000000000000000001051613571573400021301 0ustar [kernel] Parsing tests/value/inout_proto.i (no preprocessing) [eva] Analyzing a complete application starting at main_main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} t[0..9] ∈ {0} u[0..19] ∈ {0} [eva] computing for function main <- main_main. Called from tests/value/inout_proto.i:54. [eva] computing for function SendBuffer <- main <- main_main. Called from tests/value/inout_proto.i:19. [eva] using specification for function SendBuffer [eva] Done for function SendBuffer [eva] Recording results for main [eva] Done for function main [eva] computing for function main2 <- main_main. Called from tests/value/inout_proto.i:55. [eva] computing for function f <- main2 <- main_main. Called from tests/value/inout_proto.i:46. [eva] using specification for function f [eva] Done for function f [eva] computing for function g1 <- main2 <- main_main. Called from tests/value/inout_proto.i:47. [eva] computing for function g <- g1 <- main2 <- main_main. Called from tests/value/inout_proto.i:34. [eva] using specification for function g [eva] Done for function g [eva] Recording results for g1 [eva] Done for function g1 [eva] computing for function g2 <- main2 <- main_main. Called from tests/value/inout_proto.i:48. [eva] computing for function g <- g2 <- main2 <- main_main. Called from tests/value/inout_proto.i:38. [eva] Done for function g [eva] Recording results for g2 [eva] Done for function g2 [eva] computing for function g3 <- main2 <- main_main. Called from tests/value/inout_proto.i:50. [eva] computing for function g <- g3 <- main2 <- main_main. Called from tests/value/inout_proto.i:42. [eva] Done for function g [eva] Recording results for g3 [eva] Done for function g3 [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main_main [eva] done for function main_main [inout] InOut (internal) for function g1: Operational inputs: t[6..7] Operational inputs on termination: t[6..7] Sure outputs: t[3..5] [inout] InOut (with formals) for function g1: Operational inputs: t[6..7] Operational inputs on termination: t[6..7] Sure outputs: t[3..5] [inout] Inputs (with formals) for function g1: t[6..7] [inout] InOut (internal) for function g2: Operational inputs: t[3..4] Operational inputs on termination: t[3..4] Sure outputs: t[0..2] [inout] InOut (with formals) for function g2: Operational inputs: t[3..4] Operational inputs on termination: t[3..4] Sure outputs: t[0..2] [inout] Inputs (with formals) for function g2: t[3..4] [inout] InOut (internal) for function g3: Operational inputs: u[8..10]; p Operational inputs on termination: u[8..10]; p Sure outputs: \nothing [inout] InOut (with formals) for function g3: Operational inputs: u[8..10]; p Operational inputs on termination: u[8..10]; p Sure outputs: \nothing [inout] Inputs (with formals) for function g3: u[8..10]; p [inout] InOut (internal) for function main: Operational inputs: msg Operational inputs on termination: msg Sure outputs: ret [inout] InOut (with formals) for function main: Operational inputs: msg Operational inputs on termination: msg Sure outputs: \nothing [inout] Inputs (with formals) for function main: msg [inout] InOut (internal) for function main2: Operational inputs: b; t[6..7]; u[8..10]; i Operational inputs on termination: b; t[6..7]; u[8..10]; i Sure outputs: a; c; t[0..5] [inout] InOut (with formals) for function main2: Operational inputs: b; t[6..7]; u[8..10]; i Operational inputs on termination: b; t[6..7]; u[8..10]; i Sure outputs: a; c; t[0..5] [inout] Inputs (with formals) for function main2: b; t{[3..4]; [6..7]}; u[8..10]; i [inout] InOut (internal) for function main_main: Operational inputs: b; t[6..7]; u[8..10]; msg; i Operational inputs on termination: b; t[6..7]; u[8..10]; msg; i Sure outputs: a; c; t[0..5] [inout] InOut (with formals) for function main_main: Operational inputs: b; t[6..7]; u[8..10]; msg; i Operational inputs on termination: b; t[6..7]; u[8..10]; msg; i Sure outputs: a; c; t[0..5] [inout] Inputs (with formals) for function main_main: b; t{[3..4]; [6..7]}; u[8..10]; msg; i frama-c-20.0-Calcium/tests/value/oracle/input.res.oracle0000666000000000000000000000224313571573400020055 0ustar [kernel] Parsing tests/value/input.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} [eva] computing for function f <- main. Called from tests/value/input.i:7. [kernel:annot:missing-spec] tests/value/input.i:7: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function main: \result FROM a [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: tmp; __va_arg0; __va_args[0] [inout] Inputs for function main: a; b frama-c-20.0-Calcium/tests/value/oracle/integers.res.oracle0000666000000000000000000000174213571573400020541 0ustar [kernel] Parsing tests/value/integers.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization bin ∈ {0} hex ∈ {0} oct ∈ {0} dec ∈ {0} [eva] tests/value/integers.i:7: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: bin ∈ {84} hex ∈ {84} oct ∈ {84} dec ∈ {42} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: bin FROM \nothing hex FROM \nothing oct FROM \nothing dec FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: bin; hex; oct; dec [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/interpol.res.oracle0000666000000000000000000000246013571573400020553 0ustar [kernel] Parsing tests/value/interpol.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {1} [1] ∈ {2} [2] ∈ {4} [3] ∈ {8} [4] ∈ {16} [5] ∈ {32} [6] ∈ {64} [7] ∈ {128} [eva] tests/value/interpol.c:16: Frama_C_show_each_ok: {0}, {-1} [eva] tests/value/interpol.c:10: starting to merge loop iterations [eva] tests/value/interpol.c:16: Frama_C_show_each_ok: {0; 1}, {-2; -1} [eva] tests/value/interpol.c:16: Frama_C_show_each_ok: {0; 1; 2}, {-4; -2; -1} [eva] tests/value/interpol.c:16: Frama_C_show_each_ok: {0; 1; 2; 3; 4; 5; 6}, {-64; -32; -16; -8; -4; -2; -1} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: d ∈ {-64; -32; -16; -8; -4; -2; -1} or UNINITIALIZED i ∈ {7} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: d; i [inout] Inputs for function main: t[0..7] frama-c-20.0-Calcium/tests/value/oracle/interpreter-mode-syracuse.res.oracle0000666000000000000000000001076613571573400024050 0ustar [kernel] Parsing tests/value/interpreter-mode-syracuse.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/interpreter-mode-syracuse.i:10: Frama_C_show_each: {1}, {127} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {2}, {382} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {3}, {191} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {4}, {574} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {5}, {287} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {6}, {862} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {7}, {431} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {8}, {1294} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {9}, {647} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {10}, {1942} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {11}, {971} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {12}, {2914} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {13}, {1457} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {14}, {4372} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {15}, {2186} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {16}, {1093} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {17}, {3280} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {18}, {1640} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {19}, {820} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {20}, {410} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {21}, {205} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {22}, {616} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {23}, {308} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {24}, {154} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {25}, {77} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {26}, {232} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {27}, {116} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {28}, {58} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {29}, {29} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {30}, {88} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {31}, {44} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {32}, {22} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {33}, {11} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {34}, {34} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {35}, {17} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {36}, {52} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {37}, {26} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {38}, {13} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {39}, {40} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {40}, {20} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {41}, {10} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {42}, {5} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {43}, {16} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {44}, {8} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {45}, {4} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {46}, {2} [eva] tests/value/interpreter-mode-syracuse.i:18: Frama_C_show_each: {47}, {1} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {1} n ∈ {47} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; n [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/invalid_loc_return.res.oracle0000666000000000000000000000716413571573400022607 0ustar [kernel] Parsing tests/value/invalid_loc_return.i (no preprocessing) [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] [eva] computing for function main <- main1. Called from tests/value/invalid_loc_return.i:21. [eva] computing for function foo <- main <- main1. Called from tests/value/invalid_loc_return.i:17. [eva] Recording results for foo [eva] Done for function foo [eva:alarm] tests/value/invalid_loc_return.i:17: Warning: accessing uninitialized left-value. assert \initialized(&p); [eva] Recording results for main [eva] Done for function main [eva] Recording results for main1 [eva] done for function main1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function foo: __retres ∈ {1} [eva:final-states] Values at end of function main: x ∈ {1} p ∈ {{ &q }} q ∈ {{ &x }} [eva:final-states] Values at end of function main1: [from] Computing for function foo [from] Done for function foo [from] Computing for function main [from] Done for function main [from] Computing for function main1 [from] Done for function main1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function foo: \result FROM \nothing [from] Function main: NO EFFECTS [from] Function main1: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function foo: __retres [inout] Inputs for function foo: \nothing [inout] Out (internal) for function main: x; p; q [inout] Inputs for function main: c [inout] Out (internal) for function main1: \nothing [inout] Inputs for function main1: c [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] [eva] computing for function main <- main2. Called from tests/value/invalid_loc_return.i:25. [eva] computing for function foo <- main <- main2. Called from tests/value/invalid_loc_return.i:17. [eva] Recording results for foo [eva] Done for function foo [eva:alarm] tests/value/invalid_loc_return.i:17: Warning: accessing uninitialized left-value. assert \initialized(&p); [kernel] tests/value/invalid_loc_return.i:17: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/value/invalid_loc_return.i:17: Reusing old results for call to foo [eva] Recording results for main [eva] Done for function main [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function foo: __retres ∈ {1} [eva:final-states] Values at end of function main: x ∈ {1} p ∈ {{ &q }} q ∈ {{ &x }} [eva:final-states] Values at end of function main2: [from] Computing for function foo [from] Done for function foo [from] Computing for function main [from] Done for function main [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function foo: \result FROM \nothing [from] Function main: NO EFFECTS [from] Function main2: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function foo: __retres [inout] Inputs for function foo: \nothing [inout] Out (internal) for function main: x; p; q [inout] Inputs for function main: c [inout] Out (internal) for function main2: \nothing [inout] Inputs for function main2: c frama-c-20.0-Calcium/tests/value/oracle/invalid_lval_arg.res.oracle0000666000000000000000000000345013571573400022214 0ustar [kernel] Parsing tests/value/invalid_lval_arg.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} p ∈ {0} [eva:alarm] tests/value/invalid_lval_arg.i:15: Warning: out of bounds read. assert \valid_read((int **)0); [eva:alarm] tests/value/invalid_lval_arg.i:17: Warning: out of bounds read. assert \valid_read((int **)0); [eva:alarm] tests/value/invalid_lval_arg.i:19: Warning: out of bounds read. assert \valid_read((int **)0); [eva] Recording results for main [eva] done for function main [eva] tests/value/invalid_lval_arg.i:15: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/invalid_lval_arg.i:17: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/invalid_lval_arg.i:19: assertion 'Eva,mem_access' got final status invalid. [kernel:annot:missing-spec] tests/value/invalid_lval_arg.i:15: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Computing for function g <-main [from] Non-terminating function g (no dependencies) [from] Done for function g [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p [inout] Inputs for function main: p frama-c-20.0-Calcium/tests/value/oracle/inversion.res.oracle0000666000000000000000000000330413571573400020731 0ustar [kernel] Parsing tests/value/inversion.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} z ∈ {0} pz ∈ {{ &z }} px ∈ {{ &x }} py ∈ {{ &y }} X ∈ {0} pX ∈ {0} t[0] ∈ {0} [1].ok ∈ {1} [1].p ∈ {{ &pz }} [2].ok ∈ {1} [2].p ∈ {{ &py }} [3..4] ∈ {0} t2[0..1] ∈ {0} [2].ok ∈ {1} [2].p ∈ {{ &px }} [3..4] ∈ {0} ii[0..1] ∈ {0} [eva] tests/value/inversion.i:23: starting to merge loop iterations [eva] tests/value/inversion.i:30: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {0; 2} y ∈ {0; 1; 2} z ∈ {0; 1; 2} X ∈ {0; 1; 2; 3; 4} pX ∈ {{ NULL ; &X }} ii[0] ∈ {0} [1] ∈ {5} i ∈ {5} k ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: x FROM px; t2{[0].ok; [1].ok; {[2]; [3].ok}; [4].ok} (and SELF) y FROM pz; py; t{[0].ok; {[1..2]; [3].ok}; [4].ok} (and SELF) z FROM pz; py; t{[0].ok; {[1..2]; [3].ok}; [4].ok} (and SELF) X FROM \nothing (and SELF) pX FROM \nothing ii[1] FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; y; z; X; pX; ii[1]; i; k [inout] Inputs for function main: pz; px; py; t{[0].ok; {[1..2]; [3].ok}; [4].ok}; t2{[0].ok; [1].ok; {[2]; [3].ok}; [4].ok}; ii[1] frama-c-20.0-Calcium/tests/value/oracle/inversion2.res.oracle0000666000000000000000000000455513571573400021024 0ustar [kernel] Parsing tests/value/inversion2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0] ∈ {3} [1] ∈ {1} [2] ∈ {2} TT[0][0..2] ∈ {3} [0][3..4] ∈ {0} [1][0] ∈ {1} [1][1..4] ∈ {0} [2][0..1] ∈ {2} [2][2..4] ∈ {0} G ∈ {99} [eva] tests/value/inversion2.i:11: starting to merge loop iterations [eva] tests/value/inversion2.i:10: starting to merge loop iterations [eva:alarm] tests/value/inversion2.i:12: Warning: division by zero. assert TT[i][j] ≢ 0; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G ∈ [5..99],1%2 i ∈ {3} j ∈ {1; 2; 3; 4; 77} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: G FROM T[0..2]; TT{[0][0..2]; [1][0..2]; [2][0..2]} (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G; i; j [inout] Inputs for function main: T[0..2]; TT{[0][0..2]; [1][0..2]; [2][0..2]} [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0] ∈ {3} [1] ∈ {1} [2] ∈ {2} TT[0][0..2] ∈ {3} [0][3..4] ∈ {0} [1][0] ∈ {1} [1][1..4] ∈ {0} [2][0..1] ∈ {2} [2][2..4] ∈ {0} G ∈ {99} [eva:alarm] tests/value/inversion2.i:12: Warning: division by zero. assert TT[i][j] ≢ 0; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G ∈ {5; 7; 15; 99} i ∈ {3} j ∈ {1; 2; 3; 77} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: G FROM T[0..2]; TT{[0][0..2]; [1][0..2]; [2][0..2]} (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G; i; j [inout] Inputs for function main: T[0..2]; TT{[0][0..2]; [1][0..2]; [2][0..2]} frama-c-20.0-Calcium/tests/value/oracle/jacques.res.oracle0000666000000000000000000000344013571573400020351 0ustar [kernel] Parsing tests/value/jacques.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..3] ∈ {0} p ∈ {0} q ∈ {0} A ∈ {0} B ∈ {0} C ∈ {0} [eva] tests/value/jacques.i:21: Frama_C_show_each_f: {{ NULL ; &S_pp }} [eva:alarm] tests/value/jacques.i:23: Warning: assertion got status unknown. [eva] tests/value/jacques.i:25: Frama_C_show_each_f: {{ &S_pp }} [eva] tests/value/jacques.i:29: assertion got status valid. [eva] computing for function f <- main. Called from tests/value/jacques.i:36. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/jacques.i:40. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: A ∈ {4; 5} B ∈ {5} [eva:final-states] Values at end of function main: p ∈ {{ &A }} q ∈ {{ &A }} A ∈ {5} B ∈ {5} S_pp[0] ∈ {5} [1] ∈ [--..--] [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: A FROM p; q B FROM q (and SELF) [from] Function main: p FROM \nothing q FROM \nothing A FROM \nothing B FROM \nothing S_pp[0] FROM pp [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: A; B [inout] Inputs for function f: p; q [inout] Out (internal) for function main: p; q; A; B; S_pp[0] [inout] Inputs for function main: p; q frama-c-20.0-Calcium/tests/value/oracle/join_misaligned.res.oracle0000666000000000000000000000616513571573400022060 0ustar [kernel] Parsing tests/value/join_misaligned.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..4] ∈ {0} u[0..4] ∈ {1} v[0..2] ∈ {0x22222222} [3..6] ∈ {1} w[0..6] ∈ {0} x[0..4] ∈ {0} y[0..2] ∈ {0x22222222} [3..6] ∈ {1} z[0..4] ∈ {255} a ∈ {0} va ∈ [--..--] [eva] Recording results for main [eva] done for function main [eva:garbled-mix] Warning: Garbled mix generated during analysis: {{ garbled mix of &{t} (origin: Merge {tests/value/join_misaligned.i:42}) }} {{ garbled mix of &{u} (origin: Merge {tests/value/join_misaligned.i:42}) }} [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t{[0]; [1][bits 0 to 15]} ∈ {0} [1][bits 16 to 23] ∈ {97; 98} {[1][bits 24 to 31]; [2..4]} ∈ {0} u{[0]; [1][bits 0 to 15]#} ∈ {1} repeated %32, bits 0 to 47 [1][bits 16 to 23] ∈ {99; 100} [bits 56 to 159]# ∈ {1} repeated %32, bits 24 to 127 v{[0]; [1][bits 0 to 15]#} ∈ {0x22222222} repeated %32, bits 0 to 47 [1][bits 16 to 23] ∈ {34; 68} [1][bits 24 to 31] ∈ {68; 85} [2][bits 0 to 7] ∈ {34; 85} [2][bits 8 to 31]# ∈ {0x22222222}%32, bits 8 to 31 [3..6] ∈ {1} w{[0]; [1][bits 0 to 15]} ∈ {0} [1][bits 16 to 23]# ∈ {0; 57}%16, bits 0 to 7 [1][bits 24 to 31] ∈ {0; 59} [2][bits 0 to 7]# ∈ {0; 59}%16, bits 8 to 15 {[2][bits 8 to 31]; [3..6]} ∈ {0} x[0] ∈ {0; 1} [1] ∈ {0} [2] ∈ {0; 1} [3..4] ∈ {0} y{[0]; [1][bits 0 to 15]#} ∈ {0x22222222} repeated %32, bits 0 to 47 [1][bits 16 to 23] ∈ {{ garbled mix of &{t} (origin: Merge {tests/value/join_misaligned.i:42}) }} {[1][bits 24 to 31]; [2][bits 0 to 15]} ∈ {{ garbled mix of &{t; u} (origin: Merge {tests/value/join_misaligned.i:42}) }} [2][bits 16 to 23] ∈ {{ garbled mix of &{u} (origin: Merge {tests/value/join_misaligned.i:42}) }} [2][bits 24 to 31]# ∈ {0x22222222}%32, bits 24 to 31 [3..6] ∈ {1} z[0..2] ∈ {255} [bits 24 to 39] ∈ {0x1111; 0xFFFF} a ∈ [0xFFF..0xFFFFFFFF],0xFFF%0x1000 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[1][bits 16 to 23] FROM c u[1][bits 16 to 23] FROM c v{[1][bits 16 to 23]; [2][bits 0 to 7]} FROM c (and SELF) [1][bits 24 to 31] FROM c w{[1][bits 16 to 23]; [2][bits 0 to 7]} FROM c (and SELF) [1][bits 24 to 31] FROM c x[0..2] FROM c (and SELF) y{[1][bits 16 to 23]; [2][bits 16 to 23]} FROM c (and SELF) {[1][bits 24 to 31]; [2][bits 0 to 15]} FROM c z[3..4] FROM c (and SELF) a FROM va; c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[1][bits 16 to 23]; u[1][bits 16 to 23]; v{[1][bits 16 to 31]; [2][bits 0 to 7]}; w{[1][bits 16 to 31]; [2][bits 0 to 7]}; x[0..2]; y{[1][bits 16 to 31]; [2][bits 0 to 23]}; z[3..4]; a [inout] Inputs for function main: a; va frama-c-20.0-Calcium/tests/value/oracle/label.res.oracle0000666000000000000000000000342713571573400020002 0ustar [kernel] Parsing tests/value/label.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} d ∈ {0} e ∈ {0} i ∈ {0} p ∈ {0} q ∈ {0} [eva] tests/value/label.i:18: Assigning imprecise value to *((char *)(& p) + i) (pointing to p with offsets {0}). The imprecision originates from Misaligned {tests/value/label.i:18} [eva] tests/value/label.i:18: Assigning imprecise value to *((char *)(& p) + i) (pointing to p with offsets {0; 8}). The imprecision originates from Misaligned {tests/value/label.i:18} [eva] tests/value/label.i:18: Assigning imprecise value to *((char *)(& p) + i) (pointing to p with offsets {0; 8; 16}). The imprecision originates from Misaligned {tests/value/label.i:18} [eva] tests/value/label.i:18: Assigning imprecise value to *((char *)(& p) + i) (pointing to p with offsets {0; 8; 16; 24}). The imprecision originates from Misaligned {tests/value/label.i:18} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {{ &d + {4} }} b ∈ {1; 2} i ∈ {4} p ∈ {{ garbled mix of &{a; b} (origin: Misaligned {tests/value/label.i:18}) }} q ∈ {{ &a }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: a FROM \nothing b FROM c i FROM i p FROM i; c q FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b; i; p; q [inout] Inputs for function main: i; p; q frama-c-20.0-Calcium/tests/value/oracle/lazy.0.res.oracle0000666000000000000000000000330013571573400020026 0ustar [kernel] Parsing tests/value/lazy.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {-1} b ∈ {0} d ∈ {0} q ∈ {0} r ∈ {0} s ∈ {0} t ∈ {0} [eva:pointer-comparison] tests/value/lazy.i:11: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/lazy.i:11: Warning: pointer comparison. assert \pointer_comparable((void *)0, (void *)q); [eva:pointer-comparison] tests/value/lazy.i:14: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/lazy.i:14: Warning: pointer comparison. assert \pointer_comparable((void *)0, (void *)s); [eva:pointer-comparison] tests/value/lazy.i:19: invalid pointer comparison: invalid pointer(s) [eva:alarm] tests/value/lazy.i:19: Warning: pointer comparison. assert \pointer_comparable((void *)0, (void *)(&a + 2)); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {6} b ∈ {1} q ∈ {{ &a + {-4; 0} }} r ∈ {{ &a + {-4; 0} }} s ∈ {{ &a + {-4; 0} }} S_p[0..1] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: a FROM \nothing b FROM \nothing q FROM c r FROM c (and SELF) s FROM d_0 S_p[0] FROM p; S_p[0] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b; q; r; s; S_p[0] [inout] Inputs for function main: a; q; s; S_p[0] frama-c-20.0-Calcium/tests/value/oracle/lazy.1.res.oracle0000666000000000000000000000466013571573400020041 0ustar [kernel] Parsing tests/value/lazy.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {-1} b ∈ {0} d ∈ {0} q ∈ {0} r ∈ {0} s ∈ {0} t ∈ {0} [eva:pointer-comparison] tests/value/lazy.i:11: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/lazy.i:11: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva:alarm] tests/value/lazy.i:11: Warning: pointer comparison. assert \pointer_comparable((void *)0, (void *)q); [eva:pointer-comparison] tests/value/lazy.i:11: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva:pointer-comparison] tests/value/lazy.i:14: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/lazy.i:14: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva:alarm] tests/value/lazy.i:14: Warning: pointer comparison. assert \pointer_comparable((void *)0, (void *)s); [eva:pointer-comparison] tests/value/lazy.i:14: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva:pointer-comparison] tests/value/lazy.i:19: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/lazy.i:19: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva:alarm] tests/value/lazy.i:19: Warning: pointer comparison. assert \pointer_comparable((void *)0, (void *)(&a + 2)); [eva:pointer-comparison] tests/value/lazy.i:19: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {2; 6} b ∈ {1} q ∈ {{ &a + {-4; 0} }} r ∈ {{ NULL ; &a + {-4; 0} }} s ∈ {{ &a + {-4; 0} }} t ∈ {{ NULL ; &a + {-4} }} S_p[0..1] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: a FROM \nothing b FROM \nothing q FROM c r FROM c (and SELF) s FROM d_0 t FROM d_0 (and SELF) S_p[0] FROM p; S_p[0] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b; q; r; s; t; S_p[0] [inout] Inputs for function main: a; q; s; S_p[0] frama-c-20.0-Calcium/tests/value/oracle/leaf.res.oracle0000666000000000000000000002474113571573400017634 0ustar [kernel] Parsing tests/value/leaf.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0] ∈ {1} [1..29] ∈ {0} g ∈ [--..--] pg ∈ {{ &g }} ppg ∈ {{ &pg }} cv1 ∈ {10} cv2 ∈ {20} cv3 ∈ {30} st_star_cint_1.p ∈ {{ &cv1 }} st_star_cint_2.p ∈ {{ &cv2 }} st_star_cint_3.p ∈ {{ &cv3 }} v1 ∈ {10} v2 ∈ {20} v3 ∈ {30} st_star_int_1.p ∈ {{ &v1 }} st_star_int_2.p ∈ {{ &v2 }} st_star_int_3.p ∈ {{ &v3 }} st_tab3_int_1.t[0] ∈ {10} .t[1] ∈ {11} .t[2] ∈ {12} st_tab3_int_2.t[0] ∈ {20} .t[1] ∈ {21} .t[2] ∈ {22} st_tab3_int_3.t[0] ∈ {30} .t[1] ∈ {31} .t[2] ∈ {32} [eva] computing for function f_int_int <- main. Called from tests/value/leaf.i:48. [kernel:annot:missing-spec] tests/value/leaf.i:48: Warning: Neither code nor specification for function f_int_int, generating default assigns from the prototype [eva] using specification for function f_int_int [eva] Done for function f_int_int [eva] computing for function f_int_star_int <- main. Called from tests/value/leaf.i:50. [eva] using specification for function f_int_star_int [eva] Done for function f_int_star_int [eva] tests/value/leaf.i:50: Assigning imprecise value to p. The imprecision originates from Library function {tests/value/leaf.i:50} [eva] tests/value/leaf.i:51: Frama_C_show_each_F: [-2147483648..2147483647] [eva:alarm] tests/value/leaf.i:52: Warning: out of bounds write. assert \valid(p); [eva] tests/value/leaf.i:53: Frama_C_show_each_F: {5} [eva] computing for function f_int_star_int_star_int <- main. Called from tests/value/leaf.i:55. [eva] using specification for function f_int_star_int_star_int [eva] Done for function f_int_star_int_star_int [eva] tests/value/leaf.i:55: Assigning imprecise value to pp. The imprecision originates from Library function {tests/value/leaf.i:55} [eva] tests/value/leaf.i:56: Frama_C_show_each_G: {{ &g }} [eva] tests/value/leaf.i:57: Frama_C_show_each_F: {5} [eva] tests/value/leaf.i:59: Frama_C_show_each_G: {{ &g }} [eva] tests/value/leaf.i:60: Frama_C_show_each_F: {5} [eva] computing for function f_star_int_cint <- main. Called from tests/value/leaf.i:62. [kernel:annot:missing-spec] tests/value/leaf.i:62: Warning: Neither code nor specification for function f_star_int_cint, generating default assigns from the prototype [eva] using specification for function f_star_int_cint [eva] Done for function f_star_int_cint [eva] computing for function f_star_int_int <- main. Called from tests/value/leaf.i:64. [kernel:annot:missing-spec] tests/value/leaf.i:64: Warning: Neither code nor specification for function f_star_int_int, generating default assigns from the prototype [eva] using specification for function f_star_int_int [eva] Done for function f_star_int_int [eva] computing for function f_tab3_int_int <- main. Called from tests/value/leaf.i:65. [kernel:annot:missing-spec] tests/value/leaf.i:65: Warning: Neither code nor specification for function f_tab3_int_int, generating default assigns from the prototype [eva] using specification for function f_tab3_int_int [eva] Done for function f_tab3_int_int [eva] computing for function f_tab_int_int <- main. Called from tests/value/leaf.i:66. [kernel:annot:missing-spec] tests/value/leaf.i:66: Warning: Neither code nor specification for function f_tab_int_int, generating default assigns from the prototype [eva] using specification for function f_tab_int_int [eva] Done for function f_tab_int_int [eva] computing for function f_st_star_cint_st_star_cint <- main. Called from tests/value/leaf.i:68. [kernel:annot:missing-spec] tests/value/leaf.i:68: Warning: Neither code nor specification for function f_st_star_cint_st_star_cint, generating default assigns from the prototype [eva] using specification for function f_st_star_cint_st_star_cint [eva] Done for function f_st_star_cint_st_star_cint [eva] tests/value/leaf.i:68: Assigning imprecise value to st_star_cint_1. The imprecision originates from Library function {tests/value/leaf.i:68} [eva] computing for function f_st_star_int_st_star_int <- main. Called from tests/value/leaf.i:69. [kernel:annot:missing-spec] tests/value/leaf.i:69: Warning: Neither code nor specification for function f_st_star_int_st_star_int, generating default assigns from the prototype [eva] using specification for function f_st_star_int_st_star_int [eva] Done for function f_st_star_int_st_star_int [eva] tests/value/leaf.i:69: Assigning imprecise value to st_star_int_1. The imprecision originates from Library function {tests/value/leaf.i:69} [eva] computing for function f_st_tab3_int_st_tab3_int <- main. Called from tests/value/leaf.i:70. [kernel:annot:missing-spec] tests/value/leaf.i:70: Warning: Neither code nor specification for function f_st_tab3_int_st_tab3_int, generating default assigns from the prototype [eva] using specification for function f_st_tab3_int_st_tab3_int [eva] Done for function f_st_tab3_int_st_tab3_int [eva] computing for function f_star_st_star_cint_int <- main. Called from tests/value/leaf.i:72. [kernel:annot:missing-spec] tests/value/leaf.i:72: Warning: Neither code nor specification for function f_star_st_star_cint_int, generating default assigns from the prototype [eva] using specification for function f_star_st_star_cint_int [eva] Done for function f_star_st_star_cint_int [eva] computing for function f_star_st_star_int_int <- main. Called from tests/value/leaf.i:73. [kernel:annot:missing-spec] tests/value/leaf.i:73: Warning: Neither code nor specification for function f_star_st_star_int_int, generating default assigns from the prototype [eva] using specification for function f_star_st_star_int_int [eva] Done for function f_star_st_star_int_int [eva] computing for function f_star_st_tab3_int_int <- main. Called from tests/value/leaf.i:74. [kernel:annot:missing-spec] tests/value/leaf.i:74: Warning: Neither code nor specification for function f_star_st_tab3_int_int, generating default assigns from the prototype [eva] using specification for function f_star_st_tab3_int_int [eva] Done for function f_star_st_tab3_int_int [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[0] ∈ [--..--] [1] ∈ {0} [2] ∈ [--..--] [3] ∈ {0} [4] ∈ [--..--] [5] ∈ {0} [6..8] ∈ [--..--] [9] ∈ {0} [10] ∈ [--..--] [11..29] ∈ {0} g ∈ {5} st_star_cint_1 ∈ {{ garbled mix of &{cv2} (origin: Library function {tests/value/leaf.i:68}) }} st_star_cint_3 ∈ {{ garbled mix of &{cv3} (origin: Library function {tests/value/leaf.i:72}) }} st_star_int_1 ∈ {{ garbled mix of &{v2} (origin: Library function {tests/value/leaf.i:69}) }} st_star_int_3 ∈ {{ garbled mix of &{v3} (origin: Library function {tests/value/leaf.i:73}) }} st_tab3_int_1 ∈ [--..--] st_tab3_int_3 ∈ [--..--] p ∈ {{ &g }} pp ∈ {{ garbled mix of &{pg} (origin: Library function {tests/value/leaf.i:55}) }} [from] Computing for function main [from] Computing for function f_int_int <-main [from] Done for function f_int_int [from] Computing for function f_int_star_int <-main [from] Done for function f_int_star_int [from] Computing for function f_int_star_int_star_int <-main [from] Done for function f_int_star_int_star_int [from] Computing for function f_star_int_cint <-main [from] Done for function f_star_int_cint [from] Computing for function f_star_int_int <-main [from] Done for function f_star_int_int [from] Computing for function f_tab3_int_int <-main [from] Done for function f_tab3_int_int [from] Computing for function f_tab_int_int <-main [from] Done for function f_tab_int_int [from] Computing for function f_st_star_cint_st_star_cint <-main [from] Done for function f_st_star_cint_st_star_cint [from] Computing for function f_st_star_int_st_star_int <-main [from] Done for function f_st_star_int_st_star_int [from] Computing for function f_st_tab3_int_st_tab3_int <-main [from] Done for function f_st_tab3_int_st_tab3_int [from] Computing for function f_star_st_star_cint_int <-main [from] Done for function f_star_st_star_cint_int [from] Computing for function f_star_st_star_int_int <-main [from] Done for function f_star_st_star_int_int [from] Computing for function f_star_st_tab3_int_int <-main [from] Done for function f_star_st_tab3_int_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f_int_int: \result FROM x [from] Function f_int_star_int: \result FROM pg [from] Function f_int_star_int_star_int: \result FROM ppg [from] Function f_st_star_cint_st_star_cint: \result FROM s [from] Function f_st_star_int_st_star_int: \result FROM s [from] Function f_st_tab3_int_st_tab3_int: \result FROM s [from] Function f_star_int_cint: \result FROM T[3] [from] Function f_star_int_int: T[4] FROM T[4] (and SELF) \result FROM T[4] [from] Function f_star_st_star_cint_int: st_star_cint_3 FROM st_star_cint_3 (and SELF) \result FROM st_star_cint_3 [from] Function f_star_st_star_int_int: st_star_int_3 FROM st_star_int_3 (and SELF) \result FROM st_star_int_3 [from] Function f_star_st_tab3_int_int: st_tab3_int_3 FROM st_tab3_int_3 (and SELF) \result FROM st_tab3_int_3 [from] Function f_tab3_int_int: T[6..8] FROM T[6..8] (and SELF) \result FROM T[6..8] [from] Function f_tab_int_int: T[10] FROM T[10] (and SELF) \result FROM T[10] [from] Function main: T[0] FROM \nothing [2] FROM T[3] [4] FROM T[4] (and SELF) [6..8] FROM T[6..8] (and SELF) [10] FROM T[10] (and SELF) g FROM pg st_star_cint_1 FROM st_star_cint_2 st_star_cint_3 FROM st_star_cint_3 (and SELF) st_star_int_1 FROM st_star_int_2 st_star_int_3 FROM st_star_int_3 (and SELF) st_tab3_int_1 FROM st_tab3_int_2 st_tab3_int_3 FROM st_tab3_int_3 (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: T{[0]; [2]; [4]; [6..8]; [10]}; g; st_star_cint_1; st_star_cint_3; st_star_int_1; st_star_int_3; st_tab3_int_1; st_tab3_int_3; p; pp [inout] Inputs for function main: T{[3..4]; [6..8]; [10]}; g; pg; ppg; st_star_cint_2; st_star_cint_3; st_star_int_2; st_star_int_3; st_tab3_int_2; st_tab3_int_3 frama-c-20.0-Calcium/tests/value/oracle/leaf2.res.oracle0000666000000000000000000000351713571573400017714 0ustar [kernel] Parsing tests/value/leaf2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} H ∈ {0} I ∈ {0} [eva] computing for function f <- main. Called from tests/value/leaf2.i:6. [kernel:annot:missing-spec] tests/value/leaf2.i:6: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] tests/value/leaf2.i:6: Assigning imprecise value to G. The imprecision originates from Library function {tests/value/leaf2.i:6} [eva:alarm] tests/value/leaf2.i:7: Warning: signed overflow. assert -2147483648 ≤ G + 1; [eva:alarm] tests/value/leaf2.i:7: Warning: signed overflow. assert G + 1 ≤ 2147483647; [eva] tests/value/leaf2.i:7: Assigning imprecise value to G. The imprecision originates from Library function {tests/value/leaf2.i:6} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G ∈ {{ garbled mix of &{I} (origin: Library function {tests/value/leaf2.i:6}) }} H ∈ {{ garbled mix of &{I} (origin: Library function {tests/value/leaf2.i:6}) }} [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: H FROM q; i; H (and SELF) \result FROM q; i; H [from] Function main: G FROM H H FROM H (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G; H [inout] Inputs for function main: G; H frama-c-20.0-Calcium/tests/value/oracle/leaf_spec.0.res.oracle0000666000000000000000000000560513571573400021002 0ustar [kernel] Parsing tests/value/leaf_spec.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f1 <- main. Called from tests/value/leaf_spec.i:19. [kernel:annot:missing-spec] tests/value/leaf_spec.i:19: Warning: Neither code nor specification for function f1, generating default assigns from the prototype [eva] using specification for function f1 [eva] Done for function f1 [eva] computing for function g <- main. Called from tests/value/leaf_spec.i:20. [kernel:annot:missing-spec] tests/value/leaf_spec.i:20: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] computing for function h <- main. Called from tests/value/leaf_spec.i:21. [kernel:annot:missing-spec] tests/value/leaf_spec.i:21: Warning: Neither code nor specification for function h, generating default assigns from the prototype [eva] using specification for function h [eva] Done for function h [eva] computing for function k <- main. Called from tests/value/leaf_spec.i:22. [kernel:annot:missing-spec] tests/value/leaf_spec.i:22: Warning: Neither code nor specification for function k, generating default assigns from the prototype [eva] using specification for function k [eva:invalid-assigns] tests/value/leaf_spec.i:22: Completely invalid destination for assigns clause *l. Ignoring. [eva] Done for function k [eva] computing for function k0 <- main. Called from tests/value/leaf_spec.i:22. [kernel:annot:missing-spec] tests/value/leaf_spec.i:22: Warning: Neither code nor specification for function k0, generating default assigns from the prototype [eva] using specification for function k0 [eva] Done for function k0 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Computing for function f1 <-main [from] Done for function f1 [from] Computing for function g <-main [from] Done for function g [from] Computing for function h <-main [from] Done for function h [from] Computing for function k <-main [from] Done for function k [from] Computing for function k0 <-main [from] Done for function k0 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: NO EFFECTS [from] Function g: \result FROM x [from] Function h: \result FROM y [from] Function k: \result FROM \nothing [from] Function k0: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/leaf_spec.1.res.oracle0000666000000000000000000000257113571573400021002 0ustar [kernel] Parsing tests/value/leaf_spec.i (no preprocessing) [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main1. Called from tests/value/leaf_spec.i:27. [kernel:annot:missing-spec] tests/value/leaf_spec.i:27: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva:invalid-assigns] tests/value/leaf_spec.i:27: Completely invalid destination for assigns clause *x. Ignoring. [eva:invalid-assigns] tests/value/leaf_spec.i:27: Completely invalid destination for assigns clause *y. Ignoring. [eva] Done for function f [eva] Recording results for main1 [eva] done for function main1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: [from] Computing for function main1 [from] Computing for function f <-main1 [from] Done for function f [from] Done for function main1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NO EFFECTS [from] Function main1: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: \nothing [inout] Inputs for function main1: \nothing frama-c-20.0-Calcium/tests/value/oracle/library.res.oracle0000666000000000000000000006563213571573400020375 0ustar [kernel] Parsing tests/value/library.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva:initial-state] creating variable S_0_p_ss with imprecise size (type struct ss [2]) [eva] tests/value/library.i:57: Warning: during initialization of variable 'ss', size of type 'struct ss' cannot be computed (abstract type 'struct ss') [eva:initial-state] creating variable S_1_p_ss with imprecise size (type struct ss [2]) [eva:initial-state] creating variable S_0_0_S_q_ss with imprecise size (type struct ss [2]) [eva:initial-state] creating variable S_1_0_S_q_ss with imprecise size (type struct ss [2]) [eva:initial-state] creating variable S_0_1_S_q_ss with imprecise size (type struct ss [2]) [eva:initial-state] creating variable S_1_1_S_q_ss with imprecise size (type struct ss [2]) [eva] Initial state computed [eva:initial-state] Values of globals at initialization gpi ∈ {{ NULL ; &S_gpi[0] }} G ∈ {{ NULL ; &S_G[0] }} v ∈ [--..--] G0 ∈ [--..--] G1 ∈ {{ NULL ; &S_G1[0] }} f ∈ {0} gpf ∈ {{ NULL ; &S_gpf[0] }} gpd ∈ {{ NULL ; &S_gpd[0] }} s ∈ {0} ss.p[0] ∈ {{ NULL ; (struct ss *)&S_0_p_ss }} .p[1] ∈ {{ NULL ; (struct ss *)&S_1_p_ss }} .p[2..7] ∈ {{ NULL ; (struct ss *)&S_0_p_ss ; (struct ss *)&S_1_p_ss }} .q ∈ {{ NULL ; &S_q_ss[0] }} ff ∈ {0} s_bitfield.bf1 ∈ [--..--] .[bits 5 to 15] ∈ UNINITIALIZED .control ∈ [--..--] .[bits 30 to 31] ∈ UNINITIALIZED S_gpi[0..1] ∈ [--..--] S_G[0] ∈ {{ NULL ; &S_0_S_G[0] }} [1] ∈ {{ NULL ; &S_1_S_G[0] }} S_0_S_G[0] ∈ {{ NULL ; &S_0_S_0_S_G[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_G[0] }} S_0_S_0_S_G[0] ∈ {{ NULL ; &S_0_S_0_S_0_S_G[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_0_S_G[0] }} S_0_S_0_S_0_S_G[0..1] ∈ [--..--] S_1_S_0_S_0_S_G[0..1] ∈ [--..--] S_1_S_0_S_G[0] ∈ {{ NULL ; &S_0_S_1_S_0_S_G[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_0_S_G[0] }} S_0_S_1_S_0_S_G[0..1] ∈ [--..--] S_1_S_1_S_0_S_G[0..1] ∈ [--..--] S_1_S_G[0] ∈ {{ NULL ; &S_0_S_1_S_G[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_G[0] }} S_0_S_1_S_G[0] ∈ {{ NULL ; &S_0_S_0_S_1_S_G[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_1_S_G[0] }} S_0_S_0_S_1_S_G[0..1] ∈ [--..--] S_1_S_0_S_1_S_G[0..1] ∈ [--..--] S_1_S_1_S_G[0] ∈ {{ NULL ; &S_0_S_1_S_1_S_G[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_1_S_G[0] }} S_0_S_1_S_1_S_G[0..1] ∈ [--..--] S_1_S_1_S_1_S_G[0..1] ∈ [--..--] S_G1[0..1] ∈ [--..--] S_gpf[0..1] ∈ [-3.40282346639e+38 .. 3.40282346639e+38] S_gpd[0..1] ∈ [-1.79769313486e+308 .. 1.79769313486e+308] S_0_p_ss[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_p_ss[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_q_ss[0][0] ∈ {{ NULL ; (struct ss *)&S_0_0_S_q_ss }} [0][1] ∈ {{ NULL ; (struct ss *)&S_1_0_S_q_ss }} [0][2..7] ∈ {{ NULL ; (struct ss *)&S_0_0_S_q_ss ; (struct ss *)&S_1_0_S_q_ss }} [1][0] ∈ {{ NULL ; (struct ss *)&S_0_1_S_q_ss }} [1][1] ∈ {{ NULL ; (struct ss *)&S_1_1_S_q_ss }} [1][2..7] ∈ {{ NULL ; (struct ss *)&S_0_1_S_q_ss ; (struct ss *)&S_1_1_S_q_ss }} S_0_0_S_q_ss[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_0_S_q_ss[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_0_1_S_q_ss[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_1_S_q_ss[bits 0 to ..] ∈ [--..--] or UNINITIALIZED [eva] computing for function f_int <- main. Called from tests/value/library.i:30. [kernel:annot:missing-spec] tests/value/library.i:30: Warning: Neither code nor specification for function f_int, generating default assigns from the prototype [eva] using specification for function f_int [eva] Done for function f_int [eva] computing for function f_star_int <- main. Called from tests/value/library.i:31. [eva] using specification for function f_star_int [eva] Done for function f_star_int [eva] tests/value/library.i:31: Assigning imprecise value to G1. The imprecision originates from Library function {tests/value/library.i:31} [eva:alarm] tests/value/library.i:32: Warning: out of bounds write. assert \valid(G1); [eva:alarm] tests/value/library.i:33: Warning: out of bounds read. assert \valid_read(G); [eva:alarm] tests/value/library.i:33: Warning: out of bounds read. assert \valid_read(*G); [eva:alarm] tests/value/library.i:33: Warning: out of bounds read. assert \valid_read(*(*G)); [eva:alarm] tests/value/library.i:33: Warning: out of bounds write. assert \valid(*(*(*G))); [eva] computing for function gen <- main. Called from tests/value/library.i:37. [kernel:annot:missing-spec] tests/value/library.i:37: Warning: Neither code nor specification for function gen, generating default assigns from the prototype [eva] using specification for function gen [eva] Done for function gen [eva:alarm] tests/value/library.i:38: Warning: pointer to function with incompatible type. assert \valid_function(f); [eva:alarm] tests/value/library.i:39: Warning: pointer to function with incompatible type. assert \valid_function(g); [eva:alarm] tests/value/library.i:40: Warning: pointer to function with incompatible type. assert \valid_function(h); [eva] computing for function i <- main. Called from tests/value/library.i:41. [eva] using specification for function i [eva] Done for function i [eva] tests/value/library.i:41: Assigning imprecise value to pf. The imprecision originates from Library function {tests/value/library.i:41} [eva:alarm] tests/value/library.i:42: Warning: out of bounds read. assert \valid_read(pf); [eva:alarm] tests/value/library.i:42: Warning: non-finite float value. assert \is_finite(*pf); [eva:alarm] tests/value/library.i:43: Warning: out of bounds write. assert \valid(pf); [eva:alarm] tests/value/library.i:44: Warning: out of bounds write. assert \valid(pf); [eva:alarm] tests/value/library.i:44: Warning: non-finite float value. assert \is_finite(*pf); [eva:alarm] tests/value/library.i:44: Warning: non-finite float value. assert \is_finite((float)(*pf + *pf)); [eva] computing for function k <- main. Called from tests/value/library.i:45. [eva] using specification for function k [eva] Done for function k [eva] tests/value/library.i:45: Assigning imprecise value to pd. The imprecision originates from Library function {tests/value/library.i:45} [eva:alarm] tests/value/library.i:46: Warning: out of bounds write. assert \valid(pd); [eva] Recording results for main [eva] done for function main [eva] tests/value/library.i:38: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/library.i:39: assertion 'Eva,function_pointer' got final status invalid. [eva] tests/value/library.i:40: assertion 'Eva,function_pointer' got final status invalid. [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G0 ∈ [--..--] G1 ∈ {{ &S_gpi + {0; 1; 2; 3; 4} }} x ∈ {3} y ∈ {4} h ∈ [--..--] pf ∈ {{ &S_gpf + {0; 1; 2; 3; 4} }} vf ∈ [-3.40282346639e+38 .. 3.40282346639e+38] pd ∈ {{ &S_gpd + [0..8] }} S_gpi[0..1] ∈ [--..--] S_0_S_0_S_0_S_G[0] ∈ {1} [1] ∈ [--..--] S_gpf[0][bits 0 to 7]# ∈ [-3.40282346639e+38 .. 3.40282346639e+38]%32, bits 0 to 7 {[0][bits 8 to 31]; [1][bits 0 to 23]} ∈ [--..--] [1][bits 24 to 31]# ∈ [-3.40282346639e+38 .. 3.40282346639e+38]%32, bits 24 to 31 S_gpd[0..1] ∈ [--..--] [from] Computing for function main [from] Computing for function f_int <-main [from] Done for function f_int [from] Computing for function f_star_int <-main [from] Done for function f_star_int [from] Computing for function gen <-main [from] Done for function gen [from] Computing for function i <-main [from] Done for function i [from] Computing for function k <-main [from] Done for function k [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f_int: \result FROM x [from] Function f_star_int: \result FROM gpi; x [from] Function gen: \result FROM \nothing [from] Function i: \result FROM gpf [from] Function k: \result FROM gpd [from] Function main: G0 FROM \nothing G1 FROM gpi S_gpi[0..1] FROM gpi (and SELF) S_0_S_0_S_0_S_G[0] FROM G; S_G[0]; S_0_S_G[0]; S_0_S_0_S_G[0] S_gpf[0..1] FROM gpf; S_gpf[0..1] (and SELF) S_gpd[0..1] FROM gpd (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G0; G1; x; y; h; tmp_0; tmp_1; tmp_2; pf; vf; pd; S_gpi[0..1]; S_0_S_0_S_0_S_G[0]; S_gpf[0..1]; S_gpd[0..1] [inout] Inputs for function main: gpi; G; v; G1; f; gpf; gpd; S_G[0]; S_0_S_G[0]; S_0_S_0_S_G[0]; S_gpf[0..1] [eva] Analyzing an incomplete application starting at main2 [eva] Computing initial state [eva:initial-state] creating variable S_0_p_ss_0 with imprecise size (type struct ss [2]) [eva:initial-state] creating variable S_1_p_ss_0 with imprecise size (type struct ss [2]) [eva:initial-state] creating variable S_0_0_S_q_ss_0 with imprecise size (type struct ss [2]) [eva:initial-state] creating variable S_1_0_S_q_ss_0 with imprecise size (type struct ss [2]) [eva:initial-state] creating variable S_0_1_S_q_ss_0 with imprecise size (type struct ss [2]) [eva:initial-state] creating variable S_1_1_S_q_ss_0 with imprecise size (type struct ss [2]) [eva] Initial state computed [eva:initial-state] Values of globals at initialization gpi ∈ {{ NULL ; &S_gpi_0[0] }} G ∈ {{ NULL ; &S_G_0[0] }} v ∈ [--..--] G0 ∈ [--..--] G1 ∈ {{ NULL ; &S_G1_0[0] }} f ∈ {0} gpf ∈ {{ NULL ; &S_gpf_0[0] }} gpd ∈ {{ NULL ; &S_gpd_0[0] }} s ∈ {0} ss.p[0] ∈ {{ NULL ; (struct ss *)&S_0_p_ss_0 }} .p[1] ∈ {{ NULL ; (struct ss *)&S_1_p_ss_0 }} .p[2..7] ∈ {{ NULL ; (struct ss *)&S_0_p_ss_0 ; (struct ss *)&S_1_p_ss_0 }} .q ∈ {{ NULL ; &S_q_ss_0[0] }} ff ∈ {0} s_bitfield.bf1 ∈ [--..--] .[bits 5 to 15] ∈ UNINITIALIZED .control ∈ [--..--] .[bits 30 to 31] ∈ UNINITIALIZED S_gpi_0[0..1] ∈ [--..--] S_G_0[0] ∈ {{ NULL ; &S_0_S_G_0[0] }} [1] ∈ {{ NULL ; &S_1_S_G_0[0] }} S_0_S_G_0[0] ∈ {{ NULL ; &S_0_S_0_S_G_0[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_G_0[0] }} S_0_S_0_S_G_0[0] ∈ {{ NULL ; &S_0_S_0_S_0_S_G_0[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_0_S_G_0[0] }} S_0_S_0_S_0_S_G_0[0..1] ∈ [--..--] S_1_S_0_S_0_S_G_0[0..1] ∈ [--..--] S_1_S_0_S_G_0[0] ∈ {{ NULL ; &S_0_S_1_S_0_S_G_0[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_0_S_G_0[0] }} S_0_S_1_S_0_S_G_0[0..1] ∈ [--..--] S_1_S_1_S_0_S_G_0[0..1] ∈ [--..--] S_1_S_G_0[0] ∈ {{ NULL ; &S_0_S_1_S_G_0[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_G_0[0] }} S_0_S_1_S_G_0[0] ∈ {{ NULL ; &S_0_S_0_S_1_S_G_0[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_1_S_G_0[0] }} S_0_S_0_S_1_S_G_0[0..1] ∈ [--..--] S_1_S_0_S_1_S_G_0[0..1] ∈ [--..--] S_1_S_1_S_G_0[0] ∈ {{ NULL ; &S_0_S_1_S_1_S_G_0[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_1_S_G_0[0] }} S_0_S_1_S_1_S_G_0[0..1] ∈ [--..--] S_1_S_1_S_1_S_G_0[0..1] ∈ [--..--] S_G1_0[0..1] ∈ [--..--] S_gpf_0[0..1] ∈ [-3.40282346639e+38 .. 3.40282346639e+38] S_gpd_0[0..1] ∈ [-1.79769313486e+308 .. 1.79769313486e+308] S_0_p_ss_0[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_p_ss_0[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_q_ss_0[0][0] ∈ {{ NULL ; (struct ss *)&S_0_0_S_q_ss_0 }} [0][1] ∈ {{ NULL ; (struct ss *)&S_1_0_S_q_ss_0 }} [0][2..7] ∈ {{ NULL ; (struct ss *)&S_0_0_S_q_ss_0 ; (struct ss *)&S_1_0_S_q_ss_0 }} [1][0] ∈ {{ NULL ; (struct ss *)&S_0_1_S_q_ss_0 }} [1][1] ∈ {{ NULL ; (struct ss *)&S_1_1_S_q_ss_0 }} [1][2..7] ∈ {{ NULL ; (struct ss *)&S_0_1_S_q_ss_0 ; (struct ss *)&S_1_1_S_q_ss_0 }} S_0_0_S_q_ss_0[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_0_S_q_ss_0[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_0_1_S_q_ss_0[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_1_S_q_ss_0[bits 0 to ..] ∈ [--..--] or UNINITIALIZED [eva:alarm] tests/value/library.i:69: Warning: assertion 'Unknown' got status unknown. [eva] tests/value/library.i:70: assertion got status valid. [eva] tests/value/library.i:71: assertion got status valid. [eva:alarm] tests/value/library.i:73: Warning: assertion 'Unknown' got status unknown. [eva] tests/value/library.i:74: Frama_C_show_each_reached_1: [eva:alarm] tests/value/library.i:77: Warning: assertion 'Unknown' got status unknown. [eva] tests/value/library.i:78: Frama_C_show_each_reached_2: [eva:alarm] tests/value/library.i:81: Warning: assertion 'Unknown_Invalid' got status invalid (stopping propagation). [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: \nothing [inout] Inputs for function main2: v [eva] Analyzing an incomplete application starting at main2 [eva] Computing initial state [eva:initial-state] creating variable S_0_p_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_1_p_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_2_p_ss with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_3_p_ss with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_0_0_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_1_0_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_2_0_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_3_0_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_0_1_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_1_1_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_2_1_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_3_1_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_0_2_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_1_2_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_2_2_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_3_2_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_0_3_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_1_3_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_2_3_S_q_ss_1 with imprecise size (type struct ss [4]) [eva:initial-state] creating variable S_3_3_S_q_ss_1 with imprecise size (type struct ss [4]) [eva] Initial state computed [eva:initial-state] Values of globals at initialization gpi ∈ {{ NULL ; &S_gpi_1[0] }} G ∈ {{ NULL ; &S_G_1[0] }} v ∈ [--..--] G0 ∈ [--..--] G1 ∈ {{ NULL ; &S_G1_1[0] }} f ∈ {0} gpf ∈ {{ NULL ; &S_gpf_1[0] }} gpd ∈ {{ NULL ; &S_gpd_1[0] }} s ∈ {0} ss.p[0] ∈ {{ NULL ; (struct ss *)&S_0_p_ss_1 }} .p[1] ∈ {{ NULL ; (struct ss *)&S_1_p_ss_1 }} .p[2] ∈ {{ NULL ; (struct ss *)&S_2_p_ss }} .p[3] ∈ {{ NULL ; (struct ss *)&S_3_p_ss }} .p[4..7] ∈ {{ NULL ; (struct ss *)&S_0_p_ss_1 ; (struct ss *)&S_1_p_ss_1 ; (struct ss *)&S_2_p_ss ; (struct ss *)&S_3_p_ss }} .q ∈ {{ NULL ; &S_q_ss_1[0] }} ff ∈ {0} s_bitfield.bf1 ∈ [--..--] .[bits 5 to 15] ∈ UNINITIALIZED .control ∈ [--..--] .[bits 30 to 31] ∈ UNINITIALIZED S_gpi_1[0..3] ∈ [--..--] S_G_1[0] ∈ {{ NULL ; &S_0_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_G_1[0] }} S_0_S_G_1[0] ∈ {{ NULL ; &S_0_S_0_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_0_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_0_S_G_1[0] }} S_0_S_0_S_G_1[0] ∈ {{ NULL ; &S_0_S_0_S_0_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_0_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_0_S_0_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_0_S_0_S_G_1[0] }} S_0_S_0_S_0_S_G_1[0..3] ∈ [--..--] S_1_S_0_S_0_S_G_1[0..3] ∈ [--..--] S_2_S_0_S_0_S_G_1[0..3] ∈ [--..--] S_3_S_0_S_0_S_G_1[0..3] ∈ [--..--] S_1_S_0_S_G_1[0] ∈ {{ NULL ; &S_0_S_1_S_0_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_0_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_1_S_0_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_1_S_0_S_G_1[0] }} S_0_S_1_S_0_S_G_1[0..3] ∈ [--..--] S_1_S_1_S_0_S_G_1[0..3] ∈ [--..--] S_2_S_1_S_0_S_G_1[0..3] ∈ [--..--] S_3_S_1_S_0_S_G_1[0..3] ∈ [--..--] S_2_S_0_S_G_1[0] ∈ {{ NULL ; &S_0_S_2_S_0_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_2_S_0_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_2_S_0_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_2_S_0_S_G_1[0] }} S_0_S_2_S_0_S_G_1[0..3] ∈ [--..--] S_1_S_2_S_0_S_G_1[0..3] ∈ [--..--] S_2_S_2_S_0_S_G_1[0..3] ∈ [--..--] S_3_S_2_S_0_S_G_1[0..3] ∈ [--..--] S_3_S_0_S_G_1[0] ∈ {{ NULL ; &S_0_S_3_S_0_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_3_S_0_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_3_S_0_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_3_S_0_S_G_1[0] }} S_0_S_3_S_0_S_G_1[0..3] ∈ [--..--] S_1_S_3_S_0_S_G_1[0..3] ∈ [--..--] S_2_S_3_S_0_S_G_1[0..3] ∈ [--..--] S_3_S_3_S_0_S_G_1[0..3] ∈ [--..--] S_1_S_G_1[0] ∈ {{ NULL ; &S_0_S_1_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_1_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_1_S_G_1[0] }} S_0_S_1_S_G_1[0] ∈ {{ NULL ; &S_0_S_0_S_1_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_1_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_0_S_1_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_0_S_1_S_G_1[0] }} S_0_S_0_S_1_S_G_1[0..3] ∈ [--..--] S_1_S_0_S_1_S_G_1[0..3] ∈ [--..--] S_2_S_0_S_1_S_G_1[0..3] ∈ [--..--] S_3_S_0_S_1_S_G_1[0..3] ∈ [--..--] S_1_S_1_S_G_1[0] ∈ {{ NULL ; &S_0_S_1_S_1_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_1_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_1_S_1_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_1_S_1_S_G_1[0] }} S_0_S_1_S_1_S_G_1[0..3] ∈ [--..--] S_1_S_1_S_1_S_G_1[0..3] ∈ [--..--] S_2_S_1_S_1_S_G_1[0..3] ∈ [--..--] S_3_S_1_S_1_S_G_1[0..3] ∈ [--..--] S_2_S_1_S_G_1[0] ∈ {{ NULL ; &S_0_S_2_S_1_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_2_S_1_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_2_S_1_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_2_S_1_S_G_1[0] }} S_0_S_2_S_1_S_G_1[0..3] ∈ [--..--] S_1_S_2_S_1_S_G_1[0..3] ∈ [--..--] S_2_S_2_S_1_S_G_1[0..3] ∈ [--..--] S_3_S_2_S_1_S_G_1[0..3] ∈ [--..--] S_3_S_1_S_G_1[0] ∈ {{ NULL ; &S_0_S_3_S_1_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_3_S_1_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_3_S_1_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_3_S_1_S_G_1[0] }} S_0_S_3_S_1_S_G_1[0..3] ∈ [--..--] S_1_S_3_S_1_S_G_1[0..3] ∈ [--..--] S_2_S_3_S_1_S_G_1[0..3] ∈ [--..--] S_3_S_3_S_1_S_G_1[0..3] ∈ [--..--] S_2_S_G_1[0] ∈ {{ NULL ; &S_0_S_2_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_2_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_2_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_2_S_G_1[0] }} S_0_S_2_S_G_1[0] ∈ {{ NULL ; &S_0_S_0_S_2_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_2_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_0_S_2_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_0_S_2_S_G_1[0] }} S_0_S_0_S_2_S_G_1[0..3] ∈ [--..--] S_1_S_0_S_2_S_G_1[0..3] ∈ [--..--] S_2_S_0_S_2_S_G_1[0..3] ∈ [--..--] S_3_S_0_S_2_S_G_1[0..3] ∈ [--..--] S_1_S_2_S_G_1[0] ∈ {{ NULL ; &S_0_S_1_S_2_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_2_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_1_S_2_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_1_S_2_S_G_1[0] }} S_0_S_1_S_2_S_G_1[0..3] ∈ [--..--] S_1_S_1_S_2_S_G_1[0..3] ∈ [--..--] S_2_S_1_S_2_S_G_1[0..3] ∈ [--..--] S_3_S_1_S_2_S_G_1[0..3] ∈ [--..--] S_2_S_2_S_G_1[0] ∈ {{ NULL ; &S_0_S_2_S_2_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_2_S_2_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_2_S_2_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_2_S_2_S_G_1[0] }} S_0_S_2_S_2_S_G_1[0..3] ∈ [--..--] S_1_S_2_S_2_S_G_1[0..3] ∈ [--..--] S_2_S_2_S_2_S_G_1[0..3] ∈ [--..--] S_3_S_2_S_2_S_G_1[0..3] ∈ [--..--] S_3_S_2_S_G_1[0] ∈ {{ NULL ; &S_0_S_3_S_2_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_3_S_2_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_3_S_2_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_3_S_2_S_G_1[0] }} S_0_S_3_S_2_S_G_1[0..3] ∈ [--..--] S_1_S_3_S_2_S_G_1[0..3] ∈ [--..--] S_2_S_3_S_2_S_G_1[0..3] ∈ [--..--] S_3_S_3_S_2_S_G_1[0..3] ∈ [--..--] S_3_S_G_1[0] ∈ {{ NULL ; &S_0_S_3_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_3_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_3_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_3_S_G_1[0] }} S_0_S_3_S_G_1[0] ∈ {{ NULL ; &S_0_S_0_S_3_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_0_S_3_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_0_S_3_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_0_S_3_S_G_1[0] }} S_0_S_0_S_3_S_G_1[0..3] ∈ [--..--] S_1_S_0_S_3_S_G_1[0..3] ∈ [--..--] S_2_S_0_S_3_S_G_1[0..3] ∈ [--..--] S_3_S_0_S_3_S_G_1[0..3] ∈ [--..--] S_1_S_3_S_G_1[0] ∈ {{ NULL ; &S_0_S_1_S_3_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_1_S_3_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_1_S_3_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_1_S_3_S_G_1[0] }} S_0_S_1_S_3_S_G_1[0..3] ∈ [--..--] S_1_S_1_S_3_S_G_1[0..3] ∈ [--..--] S_2_S_1_S_3_S_G_1[0..3] ∈ [--..--] S_3_S_1_S_3_S_G_1[0..3] ∈ [--..--] S_2_S_3_S_G_1[0] ∈ {{ NULL ; &S_0_S_2_S_3_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_2_S_3_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_2_S_3_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_2_S_3_S_G_1[0] }} S_0_S_2_S_3_S_G_1[0..3] ∈ [--..--] S_1_S_2_S_3_S_G_1[0..3] ∈ [--..--] S_2_S_2_S_3_S_G_1[0..3] ∈ [--..--] S_3_S_2_S_3_S_G_1[0..3] ∈ [--..--] S_3_S_3_S_G_1[0] ∈ {{ NULL ; &S_0_S_3_S_3_S_G_1[0] }} [1] ∈ {{ NULL ; &S_1_S_3_S_3_S_G_1[0] }} [2] ∈ {{ NULL ; &S_2_S_3_S_3_S_G_1[0] }} [3] ∈ {{ NULL ; &S_3_S_3_S_3_S_G_1[0] }} S_0_S_3_S_3_S_G_1[0..3] ∈ [--..--] S_1_S_3_S_3_S_G_1[0..3] ∈ [--..--] S_2_S_3_S_3_S_G_1[0..3] ∈ [--..--] S_3_S_3_S_3_S_G_1[0..3] ∈ [--..--] S_G1_1[0..3] ∈ [--..--] S_gpf_1[0..3] ∈ [-3.40282346639e+38 .. 3.40282346639e+38] S_gpd_1[0..3] ∈ [-1.79769313486e+308 .. 1.79769313486e+308] S_0_p_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_p_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_2_p_ss[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_3_p_ss[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_q_ss_1[0][0] ∈ {{ NULL ; (struct ss *)&S_0_0_S_q_ss_1 }} [0][1] ∈ {{ NULL ; (struct ss *)&S_1_0_S_q_ss_1 }} [0][2] ∈ {{ NULL ; (struct ss *)&S_2_0_S_q_ss_1 }} [0][3] ∈ {{ NULL ; (struct ss *)&S_3_0_S_q_ss_1 }} [0][4..7] ∈ {{ NULL ; (struct ss *)&S_0_0_S_q_ss_1 ; (struct ss *)&S_1_0_S_q_ss_1 ; (struct ss *)&S_2_0_S_q_ss_1 ; (struct ss *)&S_3_0_S_q_ss_1 }} [1][0] ∈ {{ NULL ; (struct ss *)&S_0_1_S_q_ss_1 }} [1][1] ∈ {{ NULL ; (struct ss *)&S_1_1_S_q_ss_1 }} [1][2] ∈ {{ NULL ; (struct ss *)&S_2_1_S_q_ss_1 }} [1][3] ∈ {{ NULL ; (struct ss *)&S_3_1_S_q_ss_1 }} [1][4..7] ∈ {{ NULL ; (struct ss *)&S_0_1_S_q_ss_1 ; (struct ss *)&S_1_1_S_q_ss_1 ; (struct ss *)&S_2_1_S_q_ss_1 ; (struct ss *)&S_3_1_S_q_ss_1 }} [2][0] ∈ {{ NULL ; (struct ss *)&S_0_2_S_q_ss_1 }} [2][1] ∈ {{ NULL ; (struct ss *)&S_1_2_S_q_ss_1 }} [2][2] ∈ {{ NULL ; (struct ss *)&S_2_2_S_q_ss_1 }} [2][3] ∈ {{ NULL ; (struct ss *)&S_3_2_S_q_ss_1 }} [2][4..7] ∈ {{ NULL ; (struct ss *)&S_0_2_S_q_ss_1 ; (struct ss *)&S_1_2_S_q_ss_1 ; (struct ss *)&S_2_2_S_q_ss_1 ; (struct ss *)&S_3_2_S_q_ss_1 }} [3][0] ∈ {{ NULL ; (struct ss *)&S_0_3_S_q_ss_1 }} [3][1] ∈ {{ NULL ; (struct ss *)&S_1_3_S_q_ss_1 }} [3][2] ∈ {{ NULL ; (struct ss *)&S_2_3_S_q_ss_1 }} [3][3] ∈ {{ NULL ; (struct ss *)&S_3_3_S_q_ss_1 }} [3][4..7] ∈ {{ NULL ; (struct ss *)&S_0_3_S_q_ss_1 ; (struct ss *)&S_1_3_S_q_ss_1 ; (struct ss *)&S_2_3_S_q_ss_1 ; (struct ss *)&S_3_3_S_q_ss_1 }} S_0_0_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_0_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_2_0_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_3_0_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_0_1_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_1_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_2_1_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_3_1_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_0_2_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_2_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_2_2_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_3_2_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_0_3_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_1_3_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_2_3_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED S_3_3_S_q_ss_1[bits 0 to ..] ∈ [--..--] or UNINITIALIZED [eva] tests/value/library.i:74: Frama_C_show_each_reached_1: [eva] tests/value/library.i:78: Frama_C_show_each_reached_2: [eva:alarm] tests/value/library.i:81: Warning: assertion 'Unknown_Invalid' got status unknown. [eva] tests/value/library.i:82: Frama_C_show_each_reached_3: [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: \nothing [inout] Inputs for function main2: v frama-c-20.0-Calcium/tests/value/oracle/library_precond.res.oracle0000666000000000000000000000252613571573400022100 0ustar [kernel] Parsing tests/value/library_precond.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function mxml <- main. Called from tests/value/library_precond.i:9. [eva] using specification for function mxml [eva] tests/value/library_precond.i:5: Warning: no 'assigns \result \from ...' clause specified for function mxml [eva:alarm] tests/value/library_precond.i:9: Warning: function mxml: precondition got status invalid. [eva] Done for function mxml [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Computing for function mxml <-main [from] Done for function mxml [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function mxml: \result FROM ANYTHING(origin:Unknown) [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; a [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/limits.res.oracle0000666000000000000000000000150313571573400020215 0ustar [kernel] Parsing tests/value/limits.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization cl ∈ {0} cu ∈ {0} ucu ∈ {0} il ∈ {0} iu ∈ {0} uiu ∈ {0} ll ∈ {0} lu ∈ {0} ulu ∈ {0} lll ∈ {0} llu ∈ {0} ullu ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: cl ∈ {-128} cu ∈ {127} ucu ∈ {255} il ∈ {-2147483648} iu ∈ {2147483647} uiu ∈ {-1} ll ∈ {-2147483648} lu ∈ {2147483647} ulu ∈ {4294967295} lll ∈ {-9223372036854775808} llu ∈ {9223372036854775807} ullu ∈ {18446744073709551615} __retres ∈ {0} frama-c-20.0-Calcium/tests/value/oracle/local.res.oracle0000666000000000000000000000753313571573400020017 0ustar [kernel] Parsing tests/value/local.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization X ∈ {0} Y ∈ {0} Z ∈ {0} T ∈ {0} U ∈ {0} V ∈ {0} [eva] computing for function f <- main. Called from tests/value/local.i:33. [eva] Recording results for f [eva] Done for function f [eva:locals-escaping] tests/value/local.i:33: Warning: locals {a} escaping the scope of f through X [eva:locals-escaping] tests/value/local.i:33: Warning: locals {b} escaping the scope of f through \result [eva] computing for function g <- main. Called from tests/value/local.i:34. [eva] tests/value/local.i:13: Reusing old results for call to f [eva:locals-escaping] tests/value/local.i:13: Warning: locals {a} escaping the scope of f through X [eva:locals-escaping] tests/value/local.i:13: Warning: locals {b} escaping the scope of f through \result [eva:alarm] tests/value/local.i:14: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&T); [eva] Recording results for g [eva] Done for function g [eva:locals-escaping] tests/value/local.i:34: Warning: locals {d} escaping the scope of g through U [eva:locals-escaping] tests/value/local.i:34: Warning: locals {d} escaping the scope of g through \result [eva] tests/value/local.i:35: Frama_C_dump_each: # Cvalue domain: X ∈ ESCAPINGADDR Y ∈ ESCAPINGADDR Z ∈ ESCAPINGADDR T ∈ ESCAPINGADDR U ∈ ESCAPINGADDR V ∈ {0} e ∈ UNINITIALIZED ==END OF DUMP== [eva] computing for function h <- main. Called from tests/value/local.i:36. [eva] Recording results for h [eva] Done for function h [eva] computing for function i <- main. Called from tests/value/local.i:37. [eva] Recording results for i [eva] Done for function i [eva] Recording results for main [eva] done for function main [eva] tests/value/local.i:14: assertion 'Eva,dangling_pointer' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: X ∈ {{ &a }} __retres ∈ {{ &b }} [eva:final-states] Values at end of function g: X ∈ ESCAPINGADDR T ∈ ESCAPINGADDR U ∈ {{ &d }} d ∈ [--..--] [eva:final-states] Values at end of function h: __retres ∈ {{ &e + {4} }} [eva:final-states] Values at end of function i: x ∈ {{ &local }} [eva:final-states] Values at end of function main: X ∈ ESCAPINGADDR Y ∈ ESCAPINGADDR Z ∈ ESCAPINGADDR T ∈ ESCAPINGADDR U ∈ ESCAPINGADDR V ∈ {{ &e + {4} }} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function i [from] Done for function i [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: X FROM \nothing \result FROM \nothing [from] Function g: X FROM \nothing T FROM \nothing U FROM \nothing \result FROM \nothing [from] Function h: \result FROM x [from] Function i: NO EFFECTS [from] Function main: X FROM \nothing Y FROM \nothing Z FROM \nothing T FROM \nothing U FROM \nothing V FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: X; __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: X; T; U; d [inout] Inputs for function g: T; U [inout] Out (internal) for function h: __retres [inout] Inputs for function h: \nothing [inout] Out (internal) for function i: x [inout] Inputs for function i: \nothing [inout] Out (internal) for function main: X; Y; Z; T; U; V [inout] Inputs for function main: T; U frama-c-20.0-Calcium/tests/value/oracle/local_cleanup.res.oracle0000666000000000000000000000461013571573400021517 0ustar [kernel] Parsing tests/value/local_cleanup.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/local_cleanup.c:20. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/local_cleanup.c:21. [eva] computing for function f <- g <- main. Called from tests/value/local_cleanup.c:15. [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] Done for function g [eva] computing for function h <- main. Called from tests/value/local_cleanup.c:22. [eva] Recording results for h [eva] Done for function h [eva] tests/value/local_cleanup.c:23: Frama_C_dump_each: # Cvalue domain: lmain[0] ∈ UNINITIALIZED [1] ∈ {12} ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: t[0] ∈ UNINITIALIZED [1] ∈ {12} lmain[0] ∈ UNINITIALIZED [1] ∈ {12} [eva:final-states] Values at end of function g: t[0] ∈ UNINITIALIZED [1] ∈ {12} [eva:final-states] Values at end of function h: x ∈ {1} [eva:final-states] Values at end of function main: lmain[0] ∈ UNINITIALIZED [1] ∈ {12} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: t[1] FROM p (and SELF) lmain[1] FROM p (and SELF) [from] Function g: lmain[1] FROM \nothing (and SELF) [from] Function h: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: t[1]; lmain[1] [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: t[1] [inout] Inputs for function g: \nothing [inout] Out (internal) for function h: x; y [inout] Inputs for function h: \nothing [inout] Out (internal) for function main: lmain[1] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/local_slevel.res.oracle0000666000000000000000000005127013571573400021366 0ustar [kernel] Parsing tests/value/local_slevel.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} t[0..99] ∈ {0} vol ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/local_slevel.i:48. [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0} [eva] tests/value/local_slevel.i:10: starting to merge loop iterations [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0; 1} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1; 2} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0; 2}, {0; 1; 2} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, {0; 1; 2; 3} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3; 4} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, {0; 1; 2; 3; 4} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, [0..2147483647] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483647] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, [0..2147483648] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483648] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, [0..4294967295] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, [0..4294967295] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/local_slevel.i:49. [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {0} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {1} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {2} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {3} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {4} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {5} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {6} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {7} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {8} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {9} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {10} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {11} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {12} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {13} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {14} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {15} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {16} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {17} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {18} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {19} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {20} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {21} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {22} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {23} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {24} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {25} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {26} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {27} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {28} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {29} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {30} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {31} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {32} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {33} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {34} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {35} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {36} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {37} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {38} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {39} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {40} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {41} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {42} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {43} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {44} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {45} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {46} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {47} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {48} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {49} [eva] tests/value/local_slevel.i:43: Trace partitioning superposing up to 100 states [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {50} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {51} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {52} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {53} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {54} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {55} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {56} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {57} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {58} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {59} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {60} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {61} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {62} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {63} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {64} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {65} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {66} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {67} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {68} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {69} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {70} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {71} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {72} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {73} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {74} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {75} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {76} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {77} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {78} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {79} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {80} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {81} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {82} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {83} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {84} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {85} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {86} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {87} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {88} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {89} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {90} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {91} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {92} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {93} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {94} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {95} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {96} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {97} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {98} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {99} [eva] tests/value/local_slevel.i:43: Trace partitioning superposing up to 200 states [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: v ∈ {1} or UNINITIALIZED r ∈ [--..--] [eva:final-states] Values at end of function main2: t[0..99] ∈ [-1073741823..2147483647] i ∈ {100} [eva:final-states] Values at end of function main: t[0..99] ∈ [-1073741823..2147483647] [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: NO EFFECTS [from] Function main2: t[0..99] FROM vol (and SELF) [from] Function main: t[0..99] FROM vol (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: v; r; i [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: t[0..99]; i; n [inout] Inputs for function main2: vol [inout] Out (internal) for function main: t[0..99] [inout] Inputs for function main: vol /* Generated by Frama-C */ int *p; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each)(); void main1(void) { int v; unsigned int r = (unsigned int)0; { int i = 0; while (i < 80) { /*@ ensures \true; assigns v; */ /*@ slevel 50; */ if (i % 2) v = 1; else v = -1; Frama_C_show_each(v,i,r); v *= v; r += (unsigned int)(2 / (v + 1)); /*@ slevel default; */ ; i ++; } } return; } void g(void) { int i = 0; if (! (i < 5)) goto unrolling_2_loop; i ++; unrolling_3_loop: ; /*@ loop pragma UNROLL 1; loop pragma UNROLL "done", 1; */ while (i < 5) i ++; unrolling_2_loop: ; return; } int t[100]; int volatile vol; void main2(void) { int i = 0; while (i < 100) { { Frama_C_show_each(i); int n = vol; if (n >= 3) t[i] = n; else t[i] = (n + (1 << 30)) + 1; /*@ slevel merge; */ ; } i ++; } return; } void main(void) { main1(); main2(); return; } [scf] beginning constant propagation /* Generated by Frama-C */ int *p; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each)(); void main1(void) { int v; unsigned int r = 0U; { int i = 0; while (i < 80) { /*@ ensures \true; assigns v; */ /*@ slevel 50; */ if (i % 2) v = 1; else v = -1; Frama_C_show_each(v,i,r); v *= v; r ++; /*@ slevel default; */ ; i ++; } } return; } void g(void) { int i = 0; if (! (i < 5)) goto unrolling_2_loop; i ++; unrolling_3_loop: ; /*@ loop pragma UNROLL 1; loop pragma UNROLL "done", 1; */ while (i < 5) i ++; unrolling_2_loop: ; return; } int t[100]; int volatile vol; void main2(void) { int i = 0; while (i < 100) { { Frama_C_show_each(i); int n = vol; if (n >= 3) t[i] = n; else t[i] = (n + 1073741824) + 1; /*@ slevel merge; */ ; } i ++; } return; } void main(void) { main1(); main2(); return; } [scf] constant propagation done /* Generated by Frama-C */ int *p; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each)(); void main1(void) { int v; unsigned int r = (unsigned int)0; { int i = 0; while (i < 80) { /*@ ensures \true; assigns v; */ /*@ slevel 50; */ if (i % 2) v = 1; else v = -1; Frama_C_show_each(v,i,r); v *= v; r += (unsigned int)(2 / (v + 1)); /*@ slevel default; */ ; i ++; } } return; } void g(void) { int i = 0; if (! (i < 5)) goto unrolling_2_loop; i ++; unrolling_3_loop: ; /*@ loop pragma UNROLL 1; loop pragma UNROLL "done", 1; */ while (i < 5) i ++; unrolling_2_loop: ; return; } int t[100]; int volatile vol; void main2(void) { int i = 0; while (i < 100) { { Frama_C_show_each(i); int n = vol; if (n >= 3) t[i] = n; else t[i] = (n + (1 << 30)) + 1; /*@ slevel merge; */ ; } i ++; } return; } void main(void) { main1(); main2(); return; } [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} t[0..99] ∈ {0} vol ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/local_slevel.i:48. [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0} [eva] tests/value/local_slevel.i:10: starting to merge loop iterations [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0}, {0; 1} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, {1}, {0; 1; 2} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, {0; 2}, {0; 1; 2} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, {0; 1; 2; 3} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, {0; 1; 2; 3; 4} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, {0; 1; 2; 3; 4} [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, [0..2147483647] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483647] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, [0..2147483648] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, [0..2147483648] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {1}, [1..79],1%2, [0..4294967295] [eva] tests/value/local_slevel.i:18: Frama_C_show_each: {-1}, [0..78],0%2, [0..4294967295] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/local_slevel.i:49. [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {0} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {1} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {2} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {3} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {4} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {5} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {6} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {7} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {8} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {9} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {10} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {11} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {12} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {13} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {14} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {15} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {16} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {17} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {18} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {19} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {20} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {21} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {22} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {23} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {24} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {25} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {26} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {27} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {28} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {29} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {30} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {31} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {32} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {33} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {34} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {35} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {36} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {37} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {38} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {39} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {40} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {41} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {42} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {43} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {44} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {45} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {46} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {47} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {48} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {49} [eva] tests/value/local_slevel.i:43: Trace partitioning superposing up to 100 states [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {50} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {51} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {52} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {53} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {54} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {55} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {56} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {57} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {58} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {59} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {60} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {61} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {62} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {63} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {64} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {65} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {66} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {67} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {68} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {69} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {70} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {71} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {72} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {73} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {74} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {75} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {76} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {77} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {78} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {79} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {80} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {81} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {82} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {83} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {84} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {85} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {86} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {87} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {88} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {89} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {90} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {91} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {92} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {93} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {94} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {95} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {96} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {97} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {98} [eva] tests/value/local_slevel.i:37: Frama_C_show_each: {99} [eva] tests/value/local_slevel.i:43: Trace partitioning superposing up to 200 states [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: v ∈ {1} or UNINITIALIZED r ∈ [--..--] [eva:final-states] Values at end of function main2: t[0..99] ∈ [-1073741823..2147483647] i ∈ {100} [eva:final-states] Values at end of function main: t[0..99] ∈ [-1073741823..2147483647] frama-c-20.0-Calcium/tests/value/oracle/local_variables.res.oracle0000666000000000000000000001032213571573400022035 0ustar [kernel] Parsing tests/value/local_variables.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} R ∈ {0} S ∈ {0} [eva] computing for function u <- main. Called from tests/value/local_variables.i:30. [eva] computing for function w <- u <- main. Called from tests/value/local_variables.i:11. [eva] computing for function unkn <- w <- u <- main. Called from tests/value/local_variables.i:24. [kernel:annot:missing-spec] tests/value/local_variables.i:24: Warning: Neither code nor specification for function unkn, generating default assigns from the prototype [eva] using specification for function unkn [eva] Done for function unkn [eva] Recording results for w [eva] Done for function w [eva] Recording results for u [eva] Done for function u [eva] computing for function v <- main. Called from tests/value/local_variables.i:31. [eva] computing for function w <- v <- main. Called from tests/value/local_variables.i:18. [eva] computing for function unkn <- w <- v <- main. Called from tests/value/local_variables.i:24. [eva] Done for function unkn [eva] Recording results for w [eva] Done for function w [eva] Recording results for v [eva] Done for function v [eva:locals-escaping] tests/value/local_variables.i:35: Warning: locals {x} escaping the scope of a block of main through p [eva] tests/value/local_variables.i:43: starting to merge loop iterations [eva:alarm] tests/value/local_variables.i:47: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [eva:alarm] tests/value/local_variables.i:47: Warning: out of bounds read. assert \valid_read(p); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function w: B ∈ {0} wu ∈ {0} wv ∈ {0} __retres ∈ {0} [eva:final-states] Values at end of function u: B ∈ {0} ru ∈ {0} wu ∈ {0} [eva:final-states] Values at end of function v: B ∈ {0} rv ∈ {0} wv ∈ {0} [eva:final-states] Values at end of function main: B ∈ {0} R ∈ {0} S ∈ {0} p ∈ {{ &S_p[0] }} __retres ∈ [--..--] [from] Computing for function w [from] Computing for function unkn <-w [from] Done for function unkn [from] Done for function w [from] Computing for function u [from] Done for function u [from] Computing for function v [from] Done for function v [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function unkn: \result FROM \nothing [from] Function w: B FROM ru; rv; pr (and SELF) wu FROM A; pw (and SELF) wv FROM A; pw (and SELF) \result FROM ru; rv; pr [from] Function u: B FROM C (and SELF) \result FROM C [from] Function v: B FROM D (and SELF) \result FROM D [from] Function main: B FROM C; D (and SELF) R FROM C S FROM D \result FROM c; p; S_p[0] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function w: B; wu; wv; tmp; __retres [inout] Inputs for function w: A; ru; rv [inout] InOut (internal) for function w: Operational inputs: A; ru; rv; pr; pw Operational inputs on termination: A; ru; rv; pr; pw Sure outputs: tmp; __retres [inout] Out (internal) for function u: B; ru; wu; tmp [inout] Inputs for function u: A; C [inout] InOut (internal) for function u: Operational inputs: A; C Operational inputs on termination: A; C Sure outputs: ru; wu; tmp [inout] Out (internal) for function v: B; rv; wv; tmp [inout] Inputs for function v: A; D [inout] InOut (internal) for function v: Operational inputs: A; D Operational inputs on termination: A; D Sure outputs: rv; wv; tmp [inout] Out (internal) for function main: B; R; S; p; x; y; z; t; i; a; __retres [inout] Inputs for function main: A; C; D; S_p[0] [inout] InOut (internal) for function main: Operational inputs: A; C; D; c; p; S_p[0] Operational inputs on termination: A; C; D; c; p; S_p[0] Sure outputs: R; S; y; z; t; i; __retres frama-c-20.0-Calcium/tests/value/oracle/lock.res.oracle0000666000000000000000000000425413571573400017652 0ustar [kernel] Parsing tests/value/lock.i (no preprocessing) [eva] Analyzing a complete application starting at locks0_good [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization ghost_loctable[0..99] ∈ {0} pmutex ∈ {0} [eva:alarm] tests/value/lock.i:48: Warning: function locks0_good: precondition got status unknown. [eva] computing for function acquire_lock <- locks0_good. Called from tests/value/lock.i:51. [eva] using specification for function acquire_lock [eva:alarm] tests/value/lock.i:51: Warning: function acquire_lock: precondition got status unknown. [eva] tests/value/lock.i:21: Warning: no \from part for clause 'assigns ghost_loctable[0 .. 99];' [eva] Done for function acquire_lock [eva] computing for function release_lock <- locks0_good. Called from tests/value/lock.i:52. [eva] using specification for function release_lock [eva:alarm] tests/value/lock.i:52: Warning: function release_lock: precondition got status unknown. [eva] tests/value/lock.i:29: Warning: no \from part for clause 'assigns ghost_loctable[..];' [eva] Done for function release_lock [eva] Recording results for locks0_good [eva] done for function locks0_good [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function locks0_good: ghost_loctable[0..99] ∈ [--..--] [from] Computing for function locks0_good [from] Computing for function acquire_lock <-locks0_good [from] Done for function acquire_lock [from] Computing for function release_lock <-locks0_good [from] Done for function release_lock [from] Done for function locks0_good [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function acquire_lock: ghost_loctable[0..99] FROM ANYTHING(origin:Unknown) (and SELF) [from] Function release_lock: ghost_loctable[0..99] FROM ANYTHING(origin:Unknown) (and SELF) [from] Function locks0_good: ghost_loctable[0..99] FROM ANYTHING(origin:Unknown) (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function locks0_good: ghost_loctable[0..99] [inout] Inputs for function locks0_good: ANYTHING(origin:Unknown) frama-c-20.0-Calcium/tests/value/oracle/logic.res.oracle0000666000000000000000000005025413571573400020020 0ustar [kernel] Parsing tests/value/logic.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ {0} u[0..10] ∈ {0} s1 ∈ {0} s2 ∈ {0} s3[0..9] ∈ {0} x ∈ {0} v ∈ [--..--] t_T ∈ {0} arr_ptr[0..2] ∈ {0} arr_ptr_arr[0..5] ∈ {0} [eva] computing for function eq_tsets <- main. Called from tests/value/logic.c:312. [eva] tests/value/logic.c:103: cannot evaluate ACSL term, unsupported ACSL construct: == operation on non-supported type set<_#8> [eva:alarm] tests/value/logic.c:103: Warning: assertion got status unknown. [eva] tests/value/logic.c:105: assertion got status valid. [eva:alarm] tests/value/logic.c:106: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:107: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:108: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:109: Warning: assertion got status unknown. [eva] tests/value/logic.c:110: assertion got status valid. [eva:alarm] tests/value/logic.c:111: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:112: Warning: assertion got status unknown. [eva] tests/value/logic.c:113: assertion got status valid. [eva] tests/value/logic.c:115: assertion got status valid. [eva] tests/value/logic.c:117: assertion got status valid. [eva] tests/value/logic.c:119: assertion got status valid. [eva:alarm] tests/value/logic.c:120: Warning: assertion got status unknown. [eva] tests/value/logic.c:121: assertion got status valid. [eva:alarm] tests/value/logic.c:122: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:125: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:126: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:127: Warning: assertion got status unknown. [eva] tests/value/logic.c:128: assertion got status valid. [eva] tests/value/logic.c:130: assertion got status valid. [eva] tests/value/logic.c:131: assertion got status valid. [eva:alarm] tests/value/logic.c:132: Warning: assertion got status unknown. [eva] tests/value/logic.c:134: cannot evaluate ACSL term, unsupported ACSL construct: == operation on non-supported type struct ts [eva:alarm] tests/value/logic.c:134: Warning: assertion got status unknown. [eva] tests/value/logic.c:135: cannot evaluate ACSL term, unsupported ACSL construct: != operation on non-supported type int [10] [eva:alarm] tests/value/logic.c:135: Warning: assertion got status unknown. [eva] tests/value/logic.c:137: assertion got status valid. [eva] tests/value/logic.c:138: assertion got status valid. [eva] tests/value/logic.c:139: assertion got status valid. [eva] tests/value/logic.c:141: assertion got status valid. [eva] tests/value/logic.c:143: cannot evaluate ACSL term, unsupported ACSL construct: set intersection [eva:alarm] tests/value/logic.c:143: Warning: assertion got status unknown. [eva] Recording results for eq_tsets [eva] Done for function eq_tsets [eva] computing for function eq_char <- main. Called from tests/value/logic.c:313. [eva] tests/value/logic.c:149: Frama_C_show_each: {-126} [eva] tests/value/logic.c:150: assertion got status valid. [eva] tests/value/logic.c:151: assertion got status valid. [eva] Recording results for eq_char [eva] Done for function eq_char [eva] computing for function casts <- main. Called from tests/value/logic.c:314. [eva] tests/value/logic.c:155: assertion got status valid. [eva] tests/value/logic.c:156: assertion got status valid. [eva] Recording results for casts [eva] Done for function casts [eva] computing for function empty_tset <- main. Called from tests/value/logic.c:315. [eva] computing for function f_empty_tset <- empty_tset <- main. Called from tests/value/logic.c:166. [eva] using specification for function f_empty_tset [eva] tests/value/logic.c:166: function f_empty_tset: precondition 'r1' got status valid. [eva] tests/value/logic.c:166: function f_empty_tset: precondition 'r2' got status valid. [eva] Done for function f_empty_tset [eva] tests/value/logic.c:167: assertion got status valid. [eva] Recording results for empty_tset [eva] Done for function empty_tset [eva] computing for function reduce_by_equal <- main. Called from tests/value/logic.c:316. [eva:alarm] tests/value/logic.c:172: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/value/logic.c:172: Warning: accessing out of bounds index. assert v < 10; [eva:alarm] tests/value/logic.c:173: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:174: Warning: assertion got status unknown. [eva] Recording results for reduce_by_equal [eva] Done for function reduce_by_equal [eva] computing for function alarms <- main. Called from tests/value/logic.c:317. [eva:alarm] tests/value/logic.c:182: Warning: assertion 'ASSUME' got status unknown. [eva:alarm] tests/value/logic.c:184: Warning: assertion 'UNK' got status unknown. [eva] tests/value/logic.c:185: Frama_C_show_each: {-1; 1} [eva:alarm] tests/value/logic.c:186: Warning: assertion 'UNK' got status unknown. [eva] tests/value/logic.c:187: Frama_C_show_each: {-1; 1} [eva:alarm] tests/value/logic.c:189: Warning: assertion 'ASSUME' got status unknown. [eva] tests/value/logic.c:190: assertion 'OK' got status valid. [eva] tests/value/logic.c:191: Frama_C_show_each: {1} [eva] tests/value/logic.c:192: assertion 'OK' got status valid. [eva] tests/value/logic.c:193: Frama_C_show_each: {1} [eva:alarm] tests/value/logic.c:197: Warning: assertion 'ASSUME' got status unknown. [eva:alarm] tests/value/logic.c:198: Warning: assertion 'UNK' got status unknown. [eva] tests/value/logic.c:199: Frama_C_show_each: {0; 1} [eva:alarm] tests/value/logic.c:200: Warning: assertion 'UNK' got status unknown. [eva] tests/value/logic.c:201: Frama_C_show_each: {0; 1} [eva:alarm] tests/value/logic.c:203: Warning: assertion 'ASSUME' got status unknown. [eva] tests/value/logic.c:204: assertion 'OK' got status valid. [eva] tests/value/logic.c:205: Frama_C_show_each: {1} [eva] tests/value/logic.c:206: assertion 'OK' got status valid. [eva] tests/value/logic.c:207: Frama_C_show_each: {1} [eva] Recording results for alarms [eva] Done for function alarms [eva] computing for function cond_in_lval <- main. Called from tests/value/logic.c:318. [eva] computing for function select_like <- cond_in_lval <- main. Called from tests/value/logic.c:228. [eva] using specification for function select_like [eva] Done for function select_like [eva] tests/value/logic.c:229: assertion got status valid. [eva] computing for function select_like <- cond_in_lval <- main. Called from tests/value/logic.c:230. [eva] Done for function select_like [eva] tests/value/logic.c:231: assertion got status valid. [eva] tests/value/logic.c:232: assertion got status valid. [eva] tests/value/logic.c:233: assertion got status valid. [eva] computing for function select_like <- cond_in_lval <- main. Called from tests/value/logic.c:234. [eva] Done for function select_like [eva] tests/value/logic.c:235: assertion got status valid. [eva] tests/value/logic.c:236: assertion got status valid. [eva] computing for function select_like <- cond_in_lval <- main. Called from tests/value/logic.c:239. [eva] Done for function select_like [eva] tests/value/logic.c:240: assertion got status valid. [eva] tests/value/logic.c:241: assertion got status valid. [eva] tests/value/logic.c:243: assertion got status valid. [eva] tests/value/logic.c:245: assertion got status valid. [eva:alarm] tests/value/logic.c:246: Warning: assertion got status unknown. [eva] Recording results for cond_in_lval [eva] Done for function cond_in_lval [eva] computing for function pred <- main. Called from tests/value/logic.c:319. [eva] tests/value/logic.c:90: assertion got status valid. [eva] tests/value/logic.c:91: assertion got status valid. [eva] tests/value/logic.c:31: cannot evaluate ACSL term, \at() on a C label is unsupported [eva:alarm] tests/value/logic.c:92: Warning: assertion got status unknown. [eva] tests/value/logic.c:92: cannot evaluate ACSL term, \at() on a C label is unsupported [eva] tests/value/logic.c:93: assertion got status valid. [eva] computing for function f <- pred <- main. Called from tests/value/logic.c:94. [eva] tests/value/logic.c:46: assertion got status valid. [eva] tests/value/logic.c:47: assertion got status valid. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- pred <- main. Called from tests/value/logic.c:95. [eva] tests/value/logic.c:55: assertion got status valid. [eva] tests/value/logic.c:56: assertion got status valid. [eva] tests/value/logic.c:57: assertion got status valid. [eva] tests/value/logic.c:35: cannot evaluate ACSL term, \at() on a C label is unsupported [eva:alarm] tests/value/logic.c:58: Warning: assertion got status unknown. [eva] tests/value/logic.c:58: cannot evaluate ACSL term, \at() on a C label is unsupported [eva] Recording results for g [eva] Done for function g [eva] computing for function unsup <- pred <- main. Called from tests/value/logic.c:96. [eva:alarm] tests/value/logic.c:81: Warning: assertion got status unknown. [eva] Recording results for unsup [eva] Done for function unsup [eva] computing for function h <- pred <- main. Called from tests/value/logic.c:97. [eva] tests/value/logic.c:69: cannot evaluate ACSL term, unsupported ACSL construct: logic function h_acsl [eva:alarm] tests/value/logic.c:69: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:70: Warning: assertion got status unknown. [eva] tests/value/logic.c:71: assertion got status valid. [eva:alarm] tests/value/logic.c:72: Warning: assertion got status invalid (stopping propagation). [eva] tests/value/logic.c:73: assertion got status valid. [eva] tests/value/logic.c:75: assertion got status valid. [eva] tests/value/logic.c:76: assertion got status valid. [eva] Recording results for h [eva] Done for function h [eva] Recording results for pred [eva] Done for function pred [eva] computing for function float_sign <- main. Called from tests/value/logic.c:320. [eva] tests/value/logic.c:251: assertion got status valid. [eva] tests/value/logic.c:252: assertion got status valid. [eva] tests/value/logic.c:253: assertion got status valid. [eva] tests/value/logic.c:254: assertion got status valid. [eva:alarm] tests/value/logic.c:256: Warning: assertion got status unknown. [eva] Recording results for float_sign [eva] Done for function float_sign [eva] computing for function min_max <- main. Called from tests/value/logic.c:321. [eva] computing for function Frama_C_interval <- min_max <- main. Called from tests/value/logic.c:274. [eva] using specification for function Frama_C_interval [eva] tests/value/logic.c:274: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- min_max <- main. Called from tests/value/logic.c:275. [eva] tests/value/logic.c:275: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- min_max <- main. Called from tests/value/logic.c:276. [eva] tests/value/logic.c:276: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/logic.c:281: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:282: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:283: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:284: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:288: Warning: assertion got status unknown. [eva] Recording results for min_max [eva] Done for function min_max [eva] computing for function assign_tsets <- main. Called from tests/value/logic.c:322. [eva] computing for function assign_tsets_aux <- assign_tsets <- main. Called from tests/value/logic.c:269. [eva] using specification for function assign_tsets_aux [eva] Done for function assign_tsets_aux [eva] Recording results for assign_tsets [eva] Done for function assign_tsets [eva] computing for function check_and_assert <- main. Called from tests/value/logic.c:323. [eva:alarm] tests/value/logic.c:295: Warning: assertion got status unknown. [eva] tests/value/logic.c:296: Frama_C_show_each_42: {42} [eva] tests/value/logic.c:297: check got status valid. [eva:alarm] tests/value/logic.c:299: Warning: check got status unknown. [eva] tests/value/logic.c:300: Frama_C_show_each_imprecise: [-2147483648..2147483647] [eva:alarm] tests/value/logic.c:301: Warning: assertion got status unknown. [eva:alarm] tests/value/logic.c:303: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/value/logic.c:306: Warning: check got status invalid. [eva] tests/value/logic.c:307: Frama_C_show_each_reachable: {42} [eva] Recording results for check_and_assert [eva] Done for function check_and_assert [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 5 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function alarms: x_0 ∈ {1} [eva:final-states] Values at end of function assign_tsets: arr_ptr[0] ∈ {{ &arr_ptr_arr[1] }} [1] ∈ {{ &arr_ptr_arr[4] }} [2] ∈ {{ &arr_ptr_arr[5] }} arr_ptr_arr[0] ∈ {0} [1] ∈ [--..--] [2..3] ∈ {0} [4..5] ∈ [--..--] [eva:final-states] Values at end of function casts: [eva:final-states] Values at end of function check_and_assert: x_0 ∈ {42} [eva:final-states] Values at end of function eq_char: c ∈ {-126} [eva:final-states] Values at end of function eq_tsets: [eva:final-states] Values at end of function f: temp_1 ∈ {0} temp_2 ∈ {0} [eva:final-states] Values at end of function empty_tset: T[0] ∈ {2} [eva:final-states] Values at end of function float_sign: d ∈ [-0. .. 0.] [eva:final-states] Values at end of function g: x_0 ∈ {0} y ∈ {1} [eva:final-states] Values at end of function h: s1.f1 ∈ {1} .f2 ∈ {0} x_0 ∈ {0} y ∈ {0} k ∈ {5} j ∈ {6} p ∈ {{ &k }} q ∈ {{ &j }} [eva:final-states] Values at end of function min_max: Frama_C_entropy_source ∈ [--..--] x_0 ∈ [3..17] y ∈ {1; 2; 3; 4; 5} z ∈ [1..100] r1 ∈ [3..17] r2 ∈ [3..100] r3 ∈ {1; 2; 3; 4; 5} r4 ∈ [1..17] a ∈ {0} b ∈ {-0.} d ∈ [-0. .. 0.] [eva:final-states] Values at end of function reduce_by_equal: a[0..8] ∈ {1} [9] ∈ [--..--] [eva:final-states] Values at end of function cond_in_lval: a ∈ {4} out ∈ {40} b.i1 ∈ {6} .i2 ∈ {8} x_0 ∈ [-2147483648..0] [eva:final-states] Values at end of function unsup: t_T{.z; .t} ∈ {21} [eva:final-states] Values at end of function pred: s1.f1 ∈ {1} .f2 ∈ {0} t_T{.z; .t} ∈ {21} x_0 ∈ {10} y ∈ {11} [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] s1.f1 ∈ {1} .f2 ∈ {0} t_T{.z; .t} ∈ {21} arr_ptr[0] ∈ {{ &arr_ptr_arr[1] }} [1] ∈ {{ &arr_ptr_arr[4] }} [2] ∈ {{ &arr_ptr_arr[5] }} arr_ptr_arr[0] ∈ {0} [1] ∈ [--..--] [2..3] ∈ {0} [4..5] ∈ [--..--] [from] Computing for function alarms [from] Done for function alarms [from] Computing for function assign_tsets [from] Computing for function assign_tsets_aux <-assign_tsets [from] Done for function assign_tsets_aux [from] Done for function assign_tsets [from] Computing for function casts [from] Done for function casts [from] Computing for function check_and_assert [from] Done for function check_and_assert [from] Computing for function eq_char [from] Done for function eq_char [from] Computing for function eq_tsets [from] Done for function eq_tsets [from] Computing for function f [from] Done for function f [from] Computing for function empty_tset [from] Computing for function f_empty_tset <-empty_tset [from] Done for function f_empty_tset [from] Done for function empty_tset [from] Computing for function float_sign [from] Done for function float_sign [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function min_max [from] Computing for function Frama_C_interval <-min_max [from] Done for function Frama_C_interval [from] Done for function min_max [from] Computing for function reduce_by_equal [from] Done for function reduce_by_equal [from] Computing for function cond_in_lval [from] Computing for function select_like <-cond_in_lval [from] Done for function select_like [from] Done for function cond_in_lval [from] Computing for function unsup [from] Done for function unsup [from] Computing for function pred [from] Done for function pred [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function alarms: NO EFFECTS [from] Function assign_tsets_aux: arr_ptr_arr{[1]; [4..5]} FROM \nothing [from] Function assign_tsets: arr_ptr[0..2] FROM \nothing arr_ptr_arr{[1]; [4..5]} FROM \nothing [from] Function casts: NO EFFECTS [from] Function check_and_assert: NO EFFECTS [from] Function eq_char: NO EFFECTS [from] Function eq_tsets: NO EFFECTS [from] Function f: NO EFFECTS [from] Function f_empty_tset: NO EFFECTS [from] Function empty_tset: NO EFFECTS [from] Function float_sign: NO EFFECTS [from] Function g: NO EFFECTS [from] Function h: s1.f1 FROM \nothing [from] Function min_max: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function reduce_by_equal: NO EFFECTS [from] Function select_like: a FROM p; q; a; b (and SELF) out FROM p; q; a; b b FROM p; q; a; b (and SELF) [from] Function cond_in_lval: NO EFFECTS [from] Function unsup: t_T FROM \nothing [from] Function pred: s1.f1 FROM \nothing t_T FROM \nothing [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) s1.f1 FROM \nothing t_T FROM \nothing arr_ptr[0..2] FROM \nothing arr_ptr_arr{[1]; [4..5]} FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function alarms: x_0 [inout] Inputs for function alarms: v [inout] Out (internal) for function assign_tsets: arr_ptr[0..2]; arr_ptr_arr{[1]; [4..5]} [inout] Inputs for function assign_tsets: \nothing [inout] Out (internal) for function casts: \nothing [inout] Inputs for function casts: \nothing [inout] Out (internal) for function check_and_assert: x_0 [inout] Inputs for function check_and_assert: v [inout] Out (internal) for function eq_char: c [inout] Inputs for function eq_char: \nothing [inout] Out (internal) for function eq_tsets: \nothing [inout] Inputs for function eq_tsets: \nothing [inout] Out (internal) for function f: temp_1; temp_2 [inout] Inputs for function f: \nothing [inout] Out (internal) for function empty_tset: T[0] [inout] Inputs for function empty_tset: \nothing [inout] Out (internal) for function float_sign: d; tmp [inout] Inputs for function float_sign: v [inout] Out (internal) for function g: x_0; y [inout] Inputs for function g: \nothing [inout] Out (internal) for function h: s1.f1; x_0; y; k; j; p; q [inout] Inputs for function h: v [inout] Out (internal) for function min_max: Frama_C_entropy_source; x_0; y; z; r1; r2; r3; r4; a; b; d [inout] Inputs for function min_max: Frama_C_entropy_source; v [inout] Out (internal) for function reduce_by_equal: a[0..9] [inout] Inputs for function reduce_by_equal: v [inout] Out (internal) for function cond_in_lval: a; out; b; x_0 [inout] Inputs for function cond_in_lval: v [inout] Out (internal) for function unsup: t_T [inout] Inputs for function unsup: \nothing [inout] Out (internal) for function pred: s1.f1; t_T; x_0; y [inout] Inputs for function pred: v [inout] Out (internal) for function main: Frama_C_entropy_source; s1.f1; t_T; arr_ptr[0..2]; arr_ptr_arr{[1]; [4..5]} [inout] Inputs for function main: Frama_C_entropy_source; v frama-c-20.0-Calcium/tests/value/oracle/logic_ptr_cast.res.oracle0000666000000000000000000000252713571573400021717 0ustar [kernel] Parsing tests/value/logic_ptr_cast.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} t[0..89] ∈ {0} [eva] tests/value/logic_ptr_cast.i:8: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/logic_ptr_cast.i:8} [eva:alarm] tests/value/logic_ptr_cast.i:9: Warning: assertion got status unknown. [eva] tests/value/logic_ptr_cast.i:14: Frama_C_show_each: {{ &t + {0; 1; 2; 3; 4; 5; 6; 7} }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== /* Generated by Frama-C */ int *p; int t[90]; /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each)(); int main(void) { int __retres; p = (int *)(((unsigned long)(t) + (unsigned long)7) & ~ 7UL); /*@ assert p ≡ (int *)t ∨ p ≡ (int *)((char *)((int *)t) + 1) ∨ p ≡ (int *)((char *)((int *)t) + 2) ∨ p ≡ (int *)((char *)((int *)t) + 3) ∨ p ≡ (int *)((char *)((int *)t) + 4) ∨ p ≡ (int *)((char *)((int *)t) + 5) ∨ p ≡ (int *)((char *)((int *)t) + 6) ∨ p ≡ (int *)((char *)((int *)t) + 7); */ ; Frama_C_show_each(p); __retres = 0; return __retres; } frama-c-20.0-Calcium/tests/value/oracle/logicdeps.res.oracle0000666000000000000000000000721213571573400020670 0ustar [kernel] Parsing tests/value/logicdeps.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..49] ∈ {0} p ∈ {0} y ∈ [--..--] z ∈ [--..--] [eva:alarm] tests/value/logicdeps.i:19: Warning: assertion got status unknown. [eva:alarm] tests/value/logicdeps.i:20: Warning: assertion got status unknown. [eva] computing for function g <- main. Called from tests/value/logicdeps.i:23. [eva] computing for function f <- g <- main. Called from tests/value/logicdeps.i:13. [eva] using specification for function f [eva] Done for function f [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] computing for function g <- main. Called from tests/value/logicdeps.i:24. [eva] computing for function f <- g <- main. Called from tests/value/logicdeps.i:13. [eva] Done for function f [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/value/logicdeps.i:25: Reusing old results for call to g [eva] tests/value/logicdeps.i:27: assertion got status valid. [eva] computing for function g <- main. Called from tests/value/logicdeps.i:30. [eva] computing for function f <- g <- main. Called from tests/value/logicdeps.i:13. [eva] Done for function f [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] computing for function g <- main. Called from tests/value/logicdeps.i:31. [eva] computing for function f <- g <- main. Called from tests/value/logicdeps.i:13. [eva] Done for function f [eva] Recording results for g [from] Computing for function g [from] Done for function g [eva] Done for function g [eva] tests/value/logicdeps.i:32: Reusing old results for call to g [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: t[0..19] ∈ {0} [20..40] ∈ [--..--] [41..49] ∈ {0} [eva:final-states] Values at end of function main: t[0..19] ∈ {0} [20..40] ∈ [--..--] [41..49] ∈ {0} p ∈ {{ &z }} [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/value/logicdeps.i:13 (by g): t[20..40] FROM t[0..20] (and SELF) [from] call to g at tests/value/logicdeps.i:23 (by main): t[20] FROM t[0..10] [21..30] FROM t[0..10] (and SELF) [from] call to g at tests/value/logicdeps.i:24 (by main): t[20] FROM t[0..10] [21..30] FROM t[0..10] (and SELF) [from] call to g at tests/value/logicdeps.i:25 (by main): t[20] FROM t[0..10] [21..30] FROM t[0..10] (and SELF) [from] call to g at tests/value/logicdeps.i:30 (by main): t{[20]; [36..40]} FROM t[0..20] (and SELF) [21..35] FROM t[0..20] [from] call to g at tests/value/logicdeps.i:31 (by main): t{[20]; [36..40]} FROM t[0..20] (and SELF) [21..35] FROM t[0..20] [from] call to g at tests/value/logicdeps.i:32 (by main): t{[20]; [36..40]} FROM t[0..20] (and SELF) [21..35] FROM t[0..20] [from] entry point: t[20..35] FROM t[0..19] [36..40] FROM t[0..19] (and SELF) p FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] InOut (internal) for function g: Operational inputs: t[0..20]; p; y; z Operational inputs on termination: t[0..20]; p; y; z Sure outputs: \nothing [inout] InOut (internal) for function main: Operational inputs: t[0..19]; y; z Operational inputs on termination: t[0..19]; y; z Sure outputs: t[20..35]; p frama-c-20.0-Calcium/tests/value/oracle/long.res.oracle0000666000000000000000000000276013571573400017661 0ustar [kernel] Parsing tests/value/long.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} k ∈ {0} [eva] computing for function f <- main. Called from tests/value/long.i:12. [eva] tests/value/long.i:6: starting to merge loop iterations [eva] Recording results for f [eva] Done for function f [eva] tests/value/long.i:11: starting to merge loop iterations [eva] tests/value/long.i:12: Reusing old results for call to f [eva] tests/value/long.i:12: Reusing old results for call to f [eva] tests/value/long.i:12: Reusing old results for call to f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: i ∈ {1000} [eva:final-states] Values at end of function main: i ∈ {0; 1000} j ∈ {1000} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: i FROM \nothing [from] Function main: i FROM \nothing (and SELF) j FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: i [inout] Inputs for function f: i [inout] Out (internal) for function main: i; j [inout] Inputs for function main: i; j frama-c-20.0-Calcium/tests/value/oracle/long_const.0.res.oracle0000666000000000000000000000454213571573400021225 0ustar [kernel] Parsing tests/value/long_const.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/long_const.i:35: Frama_C_show_each_f: {4}, {18446603611099103232}, {0} [eva] computing for function div64 <- main. Called from tests/value/long_const.i:37. [eva:alarm] tests/value/long_const.i:37: Warning: function div64: precondition 'num' got status unknown. [eva:alarm] tests/value/long_const.i:37: Warning: function div64: precondition 'denom' got status unknown. [eva] computing for function LL_ABS <- div64 <- main. Called from tests/value/long_const.i:24. [eva] Recording results for LL_ABS [eva] Done for function LL_ABS [eva] tests/value/long_const.i:25: Reusing old results for call to LL_ABS [eva] tests/value/long_const.i:26: Frama_C_show_each: [-9223372036854775807..9223372036854775807], [0..9223372036854775807], [-9223372036854775807..9223372036854775807], [0..9223372036854775807] [eva] Recording results for div64 [eva] Done for function div64 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function LL_ABS: [eva:final-states] Values at end of function div64: loc_num ∈ [0..9223372036854775807] loc_den ∈ [0..9223372036854775807] signe_negatif ∈ {-9223372036854775808; 0} __retres ∈ {0} [eva:final-states] Values at end of function main: i ∈ {18446603611099103232} j ∈ {0} [from] Computing for function LL_ABS [from] Done for function LL_ABS [from] Computing for function div64 [from] Done for function div64 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function LL_ABS: \result FROM a [from] Function div64: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function LL_ABS: tmp [inout] Inputs for function LL_ABS: \nothing [inout] Out (internal) for function div64: loc_num; loc_den; signe_negatif; __retres [inout] Inputs for function div64: \nothing [inout] Out (internal) for function main: i; j [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/long_const.1.res.oracle0000666000000000000000000000454213571573400021226 0ustar [kernel] Parsing tests/value/long_const.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/long_const.i:35: Frama_C_show_each_f: {4}, {18446603611099103232}, {0} [eva] computing for function div64 <- main. Called from tests/value/long_const.i:37. [eva:alarm] tests/value/long_const.i:37: Warning: function div64: precondition 'num' got status unknown. [eva:alarm] tests/value/long_const.i:37: Warning: function div64: precondition 'denom' got status unknown. [eva] computing for function LL_ABS <- div64 <- main. Called from tests/value/long_const.i:24. [eva] Recording results for LL_ABS [eva] Done for function LL_ABS [eva] tests/value/long_const.i:25: Reusing old results for call to LL_ABS [eva] tests/value/long_const.i:26: Frama_C_show_each: [-9223372036854775807..9223372036854775807], [0..9223372036854775807], [-9223372036854775807..9223372036854775807], [0..9223372036854775807] [eva] Recording results for div64 [eva] Done for function div64 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function LL_ABS: [eva:final-states] Values at end of function div64: loc_num ∈ [0..9223372036854775807] loc_den ∈ [0..9223372036854775807] signe_negatif ∈ {-9223372036854775808; 0} __retres ∈ {0} [eva:final-states] Values at end of function main: i ∈ {18446603611099103232} j ∈ {0} [from] Computing for function LL_ABS [from] Done for function LL_ABS [from] Computing for function div64 [from] Done for function div64 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function LL_ABS: \result FROM a [from] Function div64: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function LL_ABS: tmp [inout] Inputs for function LL_ABS: \nothing [inout] Out (internal) for function div64: loc_num; loc_den; signe_negatif; __retres [inout] Inputs for function div64: \nothing [inout] Out (internal) for function main: i; j [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/loop.res.oracle0000666000000000000000000000260013571573400017664 0ustar [kernel] Parsing tests/value/loop.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} k ∈ {0} n ∈ {0} r ∈ {0} G ∈ {0} [eva] tests/value/loop.i:8: Frama_C_show_each_F: {0} [eva] tests/value/loop.i:7: starting to merge loop iterations [eva] tests/value/loop.i:8: Frama_C_show_each_F: {0; 2} [eva] tests/value/loop.i:8: Frama_C_show_each_F: {0; 2; 4} [eva] tests/value/loop.i:8: Frama_C_show_each_F: [0..48],0%2 [eva] tests/value/loop.i:8: Frama_C_show_each_F: [0..48],0%2 [eva] tests/value/loop.i:8: Frama_C_show_each_F: [0..48],0%2 [eva:alarm] tests/value/loop.i:9: Warning: signed overflow. assert i_0 + r ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: n ∈ {50} r ∈ [0..2147483646],0%2 i_0 ∈ [50..2147483646],0%2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: n FROM \nothing r FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: n; r; i_0 [inout] Inputs for function main: n; r frama-c-20.0-Calcium/tests/value/oracle/loop1.res.oracle0000666000000000000000000000473313571573400017756 0ustar [kernel] Parsing tests/value/loop1.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization U[0] ∈ {1} [1] ∈ {2} [2..99] ∈ {0} NULL_GLOBAL_LOOSING_BITS_ONE_BY_ONE ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/loop1.i:25. [eva] tests/value/loop1.i:8: cannot evaluate ACSL term, no environment to evaluate \at(_,LoopCurrent) [eva:alarm] tests/value/loop1.i:8: Warning: assertion got status unknown. [eva] tests/value/loop1.i:9: cannot evaluate ACSL term, no environment to evaluate \at(_,LoopEntry) [eva:alarm] tests/value/loop1.i:9: Warning: assertion got status unknown. [eva] tests/value/loop1.i:5: starting to merge loop iterations [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/loop1.i:26. [eva] tests/value/loop1.i:17: starting to merge loop iterations [eva:alarm] tests/value/loop1.i:19: Warning: accessing out of bounds index. assert i < 100; [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: U[0] ∈ {1; 7} [1] ∈ {2; 7} [2..99] ∈ {0; 7} i ∈ {100} [eva:final-states] Values at end of function main2: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Non-terminating function main2 (no dependencies) [from] Done for function main2 [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: U[0..99] FROM \nothing (and SELF) [from] Function main2: NON TERMINATING - NO EFFECTS [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: U[0..99]; i [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: U[0..99]; i [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main: U[0..99] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/loop2.res.oracle0000666000000000000000000000251713571573400017755 0ustar [kernel] Parsing tests/value/loop2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} k ∈ {0} l ∈ {0} n ∈ {0} r ∈ {0} G[0..4] ∈ {0} Reg5 ∈ {0} [eva] tests/value/loop2.i:8: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {5} n ∈ {5} G[0].a ∈ {0; 55; 56; 57; 58; 59} [0].b ∈ {0; 57; 58; 59; 60; 61} [1].a ∈ {0; 55; 56; 57; 58; 59} [1].b ∈ {0; 57; 58; 59; 60; 61} [2].a ∈ {0; 55; 56; 57; 58; 59} [2].b ∈ {0; 57; 58; 59; 60; 61} [3].a ∈ {0; 55; 56; 57; 58; 59} [3].b ∈ {0; 57; 58; 59; 60; 61} [4].a ∈ {0; 55; 56; 57; 58; 59} [4].b ∈ {0; 57; 58; 59; 60; 61} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: i FROM \nothing n FROM \nothing G[0..4] FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; n; G[0..4] [inout] Inputs for function main: i; n frama-c-20.0-Calcium/tests/value/oracle/loop3.res.oracle0000666000000000000000000000265213571573400017756 0ustar [kernel] Parsing tests/value/loop3.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} k ∈ {0} [eva] computing for function any_int <- main. Called from tests/value/loop3.c:8. [eva] using specification for function any_int [eva] Done for function any_int [eva] tests/value/loop3.c:11: starting to merge loop iterations [eva:alarm] tests/value/loop3.c:11: Warning: signed overflow. assert j + 3 ≤ 2147483647; [eva:alarm] tests/value/loop3.c:11: Warning: signed overflow. assert k + 8 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {100} j ∈ [0..2147483646],0%3 k ∈ [0..2147483640],0%8 b ∈ [--..--] [from] Computing for function main [from] Computing for function any_int <-main [from] Done for function any_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function any_int: \result FROM \nothing [from] Function main: i FROM \nothing j FROM \nothing k FROM k (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; k; b [inout] Inputs for function main: i; j; k frama-c-20.0-Calcium/tests/value/oracle/loop_array.res.oracle0000666000000000000000000000233713571573400021071 0ustar [kernel] Parsing tests/value/loop_array.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9999] ∈ {0} U[0..9999] ∈ {0} [eva] tests/value/loop_array.i:5: starting to merge loop iterations [eva] tests/value/loop_array.i:8: starting to merge loop iterations [eva] tests/value/loop_array.i:12: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[0..4] ∈ {0; 2} [5] ∈ {0} [6..9999] ∈ {0; 7} U[0..199] ∈ {0} [200] ∈ {-1; 0} [201..9999] ∈ {0} i ∈ {400} j ∈ {10000} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: T{[0..4]; [6..9999]} FROM \nothing (and SELF) U[0..1000] FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: T{[0..4]; [6..9999]}; U[0..1000]; i; j [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/loop_join.res.oracle0000666000000000000000000000165213571573400020711 0ustar [kernel] Parsing tests/value/loop_join.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization U[0..9999] ∈ {0} [eva] tests/value/loop_join.i:5: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: U[0..199] ∈ {0} [200] ∈ {-1; 0} [201..9999] ∈ {0} i ∈ {400} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: U[0..1000] FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: U[0..1000]; i [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/loop_long.res.oracle0000666000000000000000000000166313571573400020713 0ustar [kernel] Parsing tests/value/loop_long.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..368199] ∈ {0} [eva] tests/value/loop_long.i:5: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[0..367] ∈ {0; 33} [368..368199] ∈ {0} i ∈ {368} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: T[0..367] FROM \nothing (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: T[0..367]; i [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/loop_no_var.res.oracle0000666000000000000000000000151713571573400021236 0ustar [kernel] Parsing tests/value/loop_no_var.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/loop_simple.res.oracle0000666000000000000000000000267713571573400021253 0ustar [kernel] Parsing tests/value/loop_simple.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} k ∈ {0} n ∈ {0} r ∈ {0} [eva] tests/value/loop_simple.i:26: starting to merge loop iterations [eva:alarm] tests/value/loop_simple.i:27: Warning: signed overflow. assert (int)((int)(i + j) + k) + r ≤ 2147483647; [eva:alarm] tests/value/loop_simple.i:27: Warning: signed overflow. assert (int)((int)((int)(i + j) + k) + r) + 1 ≤ 2147483647; [eva] tests/value/loop_simple.i:25: starting to merge loop iterations [eva] tests/value/loop_simple.i:24: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {2} j ∈ {0; 2} k ∈ {0; 2} n ∈ {2} r ∈ [0..2147483647] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: i FROM \nothing j FROM \nothing (and SELF) k FROM \nothing n FROM \nothing r FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; k; n; r [inout] Inputs for function main: i; j; k; n; r frama-c-20.0-Calcium/tests/value/oracle/loop_test.0.res.oracle0000666000000000000000000000726313571573400021073 0ustar [kernel] Parsing tests/value/loop_test.i (no preprocessing) [eva] Analyzing a complete application starting at test_onzes [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization r0 ∈ {0} r1 ∈ {0} r2 ∈ {0} r3 ∈ {0} r4 ∈ {0} r5 ∈ {0} r6 ∈ {0} r7 ∈ {0} r8 ∈ {0} r9 ∈ {0} c0 ∈ {0} c1 ∈ {0} c2 ∈ {0} c3 ∈ {0} c4 ∈ {0} c5 ∈ {0} c6 ∈ {0} c7 ∈ {0} c8 ∈ {0} c9 ∈ {0} [eva] computing for function onze_0 <- test_onzes. Called from tests/value/loop_test.i:43. [eva] tests/value/loop_test.i:9: starting to merge loop iterations [eva] Recording results for onze_0 [eva] Done for function onze_0 [eva] computing for function onze_1 <- test_onzes. Called from tests/value/loop_test.i:44. [eva] tests/value/loop_test.i:12: starting to merge loop iterations [eva] Recording results for onze_1 [eva] Done for function onze_1 [eva] computing for function onze_2 <- test_onzes. Called from tests/value/loop_test.i:45. [eva] tests/value/loop_test.i:15: starting to merge loop iterations [eva] Recording results for onze_2 [eva] Done for function onze_2 [eva] computing for function onze_3 <- test_onzes. Called from tests/value/loop_test.i:46. [eva] tests/value/loop_test.i:18: starting to merge loop iterations [eva] Recording results for onze_3 [eva] Done for function onze_3 [eva] computing for function onze_4 <- test_onzes. Called from tests/value/loop_test.i:47. [eva] tests/value/loop_test.i:21: starting to merge loop iterations [eva] Recording results for onze_4 [eva] Done for function onze_4 [eva] computing for function onze_5 <- test_onzes. Called from tests/value/loop_test.i:48. [eva] tests/value/loop_test.i:25: starting to merge loop iterations [eva] Recording results for onze_5 [eva] Done for function onze_5 [eva] computing for function onze_6 <- test_onzes. Called from tests/value/loop_test.i:49. [eva] tests/value/loop_test.i:28: starting to merge loop iterations [eva] Recording results for onze_6 [eva] Done for function onze_6 [eva] computing for function onze_7 <- test_onzes. Called from tests/value/loop_test.i:50. [eva] tests/value/loop_test.i:31: starting to merge loop iterations [eva] Recording results for onze_7 [eva] Done for function onze_7 [eva] computing for function onze_8 <- test_onzes. Called from tests/value/loop_test.i:51. [eva] tests/value/loop_test.i:34: starting to merge loop iterations [eva] Recording results for onze_8 [eva] Done for function onze_8 [eva] computing for function onze_9 <- test_onzes. Called from tests/value/loop_test.i:52. [eva] tests/value/loop_test.i:37: starting to merge loop iterations [eva] Recording results for onze_9 [eva] Done for function onze_9 [eva] Recording results for test_onzes [eva] done for function test_onzes [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function onze_0: onze ∈ {11} [eva:final-states] Values at end of function onze_1: onze ∈ {11} [eva:final-states] Values at end of function onze_2: onze ∈ {11} [eva:final-states] Values at end of function onze_3: onze ∈ {11} [eva:final-states] Values at end of function onze_4: onze ∈ {11} [eva:final-states] Values at end of function onze_5: onze ∈ {11} [eva:final-states] Values at end of function onze_6: onze ∈ {11} [eva:final-states] Values at end of function onze_7: onze ∈ {11} [eva:final-states] Values at end of function onze_8: onze ∈ {11} [eva:final-states] Values at end of function onze_9: onze ∈ {11} [eva:final-states] Values at end of function test_onzes: r0 ∈ {11} r1 ∈ {11} r2 ∈ {11} r3 ∈ {11} r4 ∈ {11} r5 ∈ {11} r6 ∈ {11} r7 ∈ {11} r8 ∈ {11} r9 ∈ {11} frama-c-20.0-Calcium/tests/value/oracle/loop_test.1.res.oracle0000666000000000000000000001002213571573400021057 0ustar [kernel] Parsing tests/value/loop_test.i (no preprocessing) [eva] Analyzing a complete application starting at test_cent_onzes [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization r0 ∈ {0} r1 ∈ {0} r2 ∈ {0} r3 ∈ {0} r4 ∈ {0} r5 ∈ {0} r6 ∈ {0} r7 ∈ {0} r8 ∈ {0} r9 ∈ {0} c0 ∈ {0} c1 ∈ {0} c2 ∈ {0} c3 ∈ {0} c4 ∈ {0} c5 ∈ {0} c6 ∈ {0} c7 ∈ {0} c8 ∈ {0} c9 ∈ {0} [eva] computing for function cent_onze_0 <- test_cent_onzes. Called from tests/value/loop_test.i:101. [eva] tests/value/loop_test.i:57: starting to merge loop iterations [eva] Recording results for cent_onze_0 [eva] Done for function cent_onze_0 [eva] computing for function cent_onze_1 <- test_cent_onzes. Called from tests/value/loop_test.i:102. [eva] tests/value/loop_test.i:60: starting to merge loop iterations [eva] Recording results for cent_onze_1 [eva] Done for function cent_onze_1 [eva] computing for function cent_onze_2 <- test_cent_onzes. Called from tests/value/loop_test.i:103. [eva] tests/value/loop_test.i:64: starting to merge loop iterations [eva] Recording results for cent_onze_2 [eva] Done for function cent_onze_2 [eva] computing for function cent_onze_3 <- test_cent_onzes. Called from tests/value/loop_test.i:104. [eva] tests/value/loop_test.i:68: starting to merge loop iterations [eva] Recording results for cent_onze_3 [eva] Done for function cent_onze_3 [eva] computing for function cent_onze_4 <- test_cent_onzes. Called from tests/value/loop_test.i:105. [eva] tests/value/loop_test.i:72: starting to merge loop iterations [eva] Recording results for cent_onze_4 [eva] Done for function cent_onze_4 [eva] computing for function cent_onze_5 <- test_cent_onzes. Called from tests/value/loop_test.i:106. [eva] tests/value/loop_test.i:77: starting to merge loop iterations [eva] Recording results for cent_onze_5 [eva] Done for function cent_onze_5 [eva] computing for function cent_onze_6 <- test_cent_onzes. Called from tests/value/loop_test.i:107. [eva] tests/value/loop_test.i:80: starting to merge loop iterations [eva] Recording results for cent_onze_6 [eva] Done for function cent_onze_6 [eva] computing for function cent_onze_7 <- test_cent_onzes. Called from tests/value/loop_test.i:108. [eva] tests/value/loop_test.i:84: starting to merge loop iterations [eva] Recording results for cent_onze_7 [eva] Done for function cent_onze_7 [eva] computing for function cent_onze_8 <- test_cent_onzes. Called from tests/value/loop_test.i:109. [eva] tests/value/loop_test.i:88: starting to merge loop iterations [eva] Recording results for cent_onze_8 [eva] Done for function cent_onze_8 [eva] computing for function cent_onze_9 <- test_cent_onzes. Called from tests/value/loop_test.i:110. [eva] tests/value/loop_test.i:92: starting to merge loop iterations [eva] Recording results for cent_onze_9 [eva] Done for function cent_onze_9 [eva] Recording results for test_cent_onzes [eva] done for function test_cent_onzes [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function cent_onze_0: cent_onze ∈ {111} [eva:final-states] Values at end of function cent_onze_1: cent_onze ∈ {111} [eva:final-states] Values at end of function cent_onze_2: cent_onze ∈ {111} [eva:final-states] Values at end of function cent_onze_3: cent_onze ∈ {111} [eva:final-states] Values at end of function cent_onze_4: cent_onze ∈ {111} [eva:final-states] Values at end of function cent_onze_5: cent_onze ∈ {111} [eva:final-states] Values at end of function cent_onze_6: cent_onze ∈ {111} [eva:final-states] Values at end of function cent_onze_7: cent_onze ∈ {111} [eva:final-states] Values at end of function cent_onze_8: cent_onze ∈ {111} [eva:final-states] Values at end of function cent_onze_9: cent_onze ∈ {111} [eva:final-states] Values at end of function test_cent_onzes: c0 ∈ {111} c1 ∈ {111} c2 ∈ {111} c3 ∈ {111} c4 ∈ {111} c5 ∈ {111} c6 ∈ {111} c7 ∈ {111} c8 ∈ {111} c9 ∈ {111} frama-c-20.0-Calcium/tests/value/oracle/loop_wvar.0.res.oracle0000666000000000000000000000217313571573400021066 0ustar [kernel] Parsing tests/value/loop_wvar.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/loop_wvar.i:16: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: n ∈ {13} i ∈ [13..2147483647] j ∈ [7..55],3%4 or UNINITIALIZED [kernel] Parsing tests/value/loop_wvar.i (no preprocessing) [kernel:annot-error] tests/value/loop_wvar.i:38: Warning: invalid pragma '12'. Ignoring loop annotation [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/loop_wvar.i:16: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: n ∈ {13} i ∈ {13} j ∈ [7..55],3%4 or UNINITIALIZED frama-c-20.0-Calcium/tests/value/oracle/loop_wvar.1.res.oracle0000666000000000000000000000360613571573400021071 0ustar [kernel] Parsing tests/value/loop_wvar.i (no preprocessing) [kernel:annot-error] tests/value/loop_wvar.i:38: Warning: invalid pragma '12'. Ignoring loop annotation [eva] Analyzing a complete application starting at main3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main_unhelpful <- main3. Called from tests/value/loop_wvar.i:84. [eva] tests/value/loop_wvar.i:52: starting to merge loop iterations [eva:alarm] tests/value/loop_wvar.i:57: Warning: signed overflow. assert next + 1 ≤ 2147483647; [eva] Recording results for main_unhelpful [eva] Done for function main_unhelpful [eva] computing for function main_multiple_hints <- main3. Called from tests/value/loop_wvar.i:85. [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: {0}, {0}, {0} [eva] tests/value/loop_wvar.i:69: starting to merge loop iterations [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: {0; 1}, {0; 1}, {0; 1} [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: {0; 1; 2}, {0; 1; 2}, {0; 1; 2} [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], {0; 1; 2; 3}, {0; 1; 2; 3} [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], {0; 1; 2; 3; 4}, {0; 1; 2; 3; 4} [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], [0..17], [0..11] [eva] tests/value/loop_wvar.i:71: Frama_C_show_each: [0..9], [0..18], [0..12] [eva] Recording results for main_multiple_hints [eva] Done for function main_multiple_hints [eva] Recording results for main3 [eva] done for function main3 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main_multiple_hints: maxj ∈ {17} maxk ∈ {11} j ∈ [0..18] k ∈ [0..12] [eva:final-states] Values at end of function main_unhelpful: max ∈ {25} next ∈ [0..2147483647] i ∈ {30} [eva:final-states] Values at end of function main3: frama-c-20.0-Calcium/tests/value/oracle/loop_wvar.2.res.oracle0000666000000000000000000000120113571573400021057 0ustar [kernel] Parsing tests/value/loop_wvar.i (no preprocessing) [kernel:annot-error] tests/value/loop_wvar.i:38: Warning: invalid pragma '12'. Ignoring loop annotation [eva] Analyzing a complete application starting at main_err1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/loop_wvar.i:27: starting to merge loop iterations [eva] Recording results for main_err1 [eva] done for function main_err1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main_err1: n ∈ {13} i ∈ {13} j ∈ [7..55],3%4 or UNINITIALIZED frama-c-20.0-Calcium/tests/value/oracle/loop_wvar.3.res.oracle0000666000000000000000000000121513571573400021065 0ustar [kernel] Parsing tests/value/loop_wvar.i (no preprocessing) [kernel:annot-error] tests/value/loop_wvar.i:38: Warning: invalid pragma '12'. Ignoring loop annotation [eva] Analyzing a complete application starting at main_err2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/loop_wvar.i:39: starting to merge loop iterations [eva] Recording results for main_err2 [eva] done for function main_err2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main_err2: n ∈ {13} i ∈ [13..2147483647] j ∈ [7..55],3%4 or UNINITIALIZED frama-c-20.0-Calcium/tests/value/oracle/loopfun.0.res.oracle0000666000000000000000000000467013571573400020544 0ustar [kernel] Parsing tests/value/loopfun.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] a ∈ {7} [eva] computing for function test <- main. Called from tests/value/loopfun.i:14. [eva] Recording results for test [eva] Done for function test [eva] computing for function test <- main. Called from tests/value/loopfun.i:14. [eva] Recording results for test [eva] Done for function test [eva] computing for function test <- main. Called from tests/value/loopfun.i:16. [eva] Recording results for test [eva] Done for function test [eva] tests/value/loopfun.i:16: Frama_C_show_each_t: {5} [eva] computing for function test <- main. Called from tests/value/loopfun.i:14. [eva] Recording results for test [eva] Done for function test [eva] computing for function test <- main. Called from tests/value/loopfun.i:14. [eva] Recording results for test [eva] Done for function test [eva] computing for function test <- main. Called from tests/value/loopfun.i:16. [eva] Recording results for test [eva] Done for function test [eva] tests/value/loopfun.i:16: Frama_C_show_each_t: {2} [eva] computing for function test <- main. Called from tests/value/loopfun.i:14. [eva] Recording results for test [eva] Done for function test [eva] computing for function test <- main. Called from tests/value/loopfun.i:14. [eva] Recording results for test [eva] Done for function test [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [from] Computing for function main2 [from] Done for function main2 [from] Computing for function test [from] Done for function test [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2: FROMTOP [from] Function test: FROMTOP \result FROM ANYTHING(origin:Unknown) [from] Function main: FROMTOP \result FROM ANYTHING(origin:Unknown) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: \nothing [inout] Inputs for function main2: v [inout] Out (internal) for function test: tmp; a [inout] Inputs for function test: a [inout] Out (internal) for function main: ANYTHING(origin:Unknown) [inout] Inputs for function main: ANYTHING(origin:Unknown) frama-c-20.0-Calcium/tests/value/oracle/loopfun.1.res.oracle0000666000000000000000000000204713571573400020541 0ustar [kernel] Parsing tests/value/loopfun.i (no preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] a ∈ {7} [eva:missing-loop-unroll] tests/value/loopfun.i:23: while loop without unroll annotation [eva:missing-loop-unroll:for] tests/value/loopfun.i:26: Warning: for loop without unroll annotation [eva:missing-loop-unroll] tests/value/loopfun.i:27: dowhile loop without unroll annotation [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: \nothing [inout] Inputs for function main2: v frama-c-20.0-Calcium/tests/value/oracle/loopinv.res.oracle0000666000000000000000000001420613571573400020406 0ustar [kernel] Parsing tests/value/loopinv.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function main1 <- main. Called from tests/value/loopinv.c:63. [eva] computing for function init <- main1 <- main. Called from tests/value/loopinv.c:22. [eva] tests/value/loopinv.c:22: function init: precondition 'valid' got status valid. [eva] tests/value/loopinv.c:22: function init: precondition 'c' got status valid. [eva] tests/value/loopinv.c:9: loop invariant got status valid. [eva] tests/value/loopinv.c:10: starting to merge loop iterations [eva] Recording results for init [eva] Done for function init [eva] computing for function init <- main1 <- main. Called from tests/value/loopinv.c:25. [eva] tests/value/loopinv.c:25: function init: precondition 'valid' got status valid. [eva] tests/value/loopinv.c:25: function init: precondition 'c' got status valid. [eva] Recording results for init [eva] Done for function init [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/loopinv.c:64. [eva] tests/value/loopinv.c:32: loop invariant got status valid. [eva] tests/value/loopinv.c:33: loop invariant got status valid. [eva:alarm] tests/value/loopinv.c:32: Warning: loop invariant got status invalid (stopping propagation). [eva] tests/value/loopinv.c:33: no state left, loop invariant got status valid. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/loopinv.c:65. [eva] tests/value/loopinv.c:42: loop invariant got status valid. [eva] tests/value/loopinv.c:46: Frama_C_show_each: {0}, {0} [eva] tests/value/loopinv.c:43: starting to merge loop iterations [eva] tests/value/loopinv.c:46: Frama_C_show_each: {0; 1}, {0; 1} [eva:alarm] tests/value/loopinv.c:42: Warning: loop invariant got status unknown. [eva] tests/value/loopinv.c:46: Frama_C_show_each: {0; 1; 2}, {0; 1; 2} [eva] tests/value/loopinv.c:46: Frama_C_show_each: {0; 1; 2; 3; 4; 5}, {0; 1; 2; 3} [eva] tests/value/loopinv.c:46: Frama_C_show_each: {0; 1; 2; 3; 4; 5; 6}, {0; 1; 2; 3; 4} [eva:alarm] tests/value/loopinv.c:45: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] tests/value/loopinv.c:46: Frama_C_show_each: [0..99], [0..2147483647] [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/loopinv.c:66. [eva] tests/value/loopinv.c:58: loop invariant got status valid. [eva] tests/value/loopinv.c:59: starting to merge loop iterations [eva:alarm] tests/value/loopinv.c:58: Warning: loop invariant got status unknown. [eva] Recording results for main4 [eva] Done for function main4 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function init: p ∈ {{ &t1 + [4..284],0%4 ; &t2 + [4..40],0%4 }} t1[0] ∈ UNINITIALIZED [1..71] ∈ {1} or UNINITIALIZED t2[0] ∈ UNINITIALIZED [1..10] ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function main1: t1[0] ∈ UNINITIALIZED [1..71] ∈ {1} or UNINITIALIZED t2[0] ∈ UNINITIALIZED [1..10] ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function main2: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main3: j ∈ [0..2147483647] [eva:final-states] Values at end of function main4: a ∈ {9} x ∈ {9} [eva:final-states] Values at end of function main: [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'init' -------------------------------------------------------------------------------- [ Valid ] Pre-condition 'valid' by Call Preconditions. [ Valid ] Pre-condition 'c' by Call Preconditions. [ Valid ] Invariant (file tests/value/loopinv.c, line 9) by Eva. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main1' -------------------------------------------------------------------------------- [ Valid ] Instance of 'Pre-condition 'valid'' at call 'init' (file tests/value/loopinv.c, line 22) by Eva. [ Valid ] Instance of 'Pre-condition 'c'' at call 'init' (file tests/value/loopinv.c, line 22) by Eva. [ Valid ] Instance of 'Pre-condition 'valid'' at call 'init' (file tests/value/loopinv.c, line 25) by Eva. [ Valid ] Instance of 'Pre-condition 'c'' at call 'init' (file tests/value/loopinv.c, line 25) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main2' -------------------------------------------------------------------------------- [ - ] Invariant (file tests/value/loopinv.c, line 32) tried with Eva. [ Valid ] Invariant (file tests/value/loopinv.c, line 33) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main3' -------------------------------------------------------------------------------- [ - ] Invariant (file tests/value/loopinv.c, line 42) tried with Eva. [ - ] Assertion 'Eva,signed_overflow' (file tests/value/loopinv.c, line 45) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main4' -------------------------------------------------------------------------------- [ - ] Invariant (file tests/value/loopinv.c, line 58) tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 9 Completely validated 4 To be validated 13 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/machdep.res.oracle0000666000000000000000000000403313571573400020316 0ustar [kernel] Parsing tests/value/machdep.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function test1 <- main. Called from tests/value/machdep.c:25. [eva] Recording results for test1 [eva] Done for function test1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test1: u ∈ {18446744073709551615} w ∈ {4294967295} q ∈ {4294967295} c1 ∈ {0} c2 ∈ {0} [eva:final-states] Values at end of function main: [kernel] Parsing tests/value/machdep.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function test1 <- main. Called from tests/value/machdep.c:25. [eva] Recording results for test1 [eva] Done for function test1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test1: u ∈ {18446744073709551615} w ∈ {18446744073709551615} q ∈ {18446744073709551615} c1 ∈ {1} c2 ∈ {1} [eva:final-states] Values at end of function main: [kernel] Parsing tests/value/machdep.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function test1 <- main. Called from tests/value/machdep.c:25. [eva] Recording results for test1 [eva] Done for function test1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test1: u ∈ {18446744073709551615} w ∈ {4294967295} q ∈ {4294967295} c1 ∈ {0} c2 ∈ {0} [eva:final-states] Values at end of function main: frama-c-20.0-Calcium/tests/value/oracle/max_pointed.res.oracle0000666000000000000000000000157213571573400021231 0ustar [kernel] Parsing tests/value/max_pointed.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {42.} b ∈ {11.} min ∈ {11.} max ∈ {42.} p ∈ {{ &a ; &b }} q ∈ {{ &a ; &b }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b; min; max; p; tmp; q; tmp_0 [inout] Inputs for function main: rand frama-c-20.0-Calcium/tests/value/oracle/memexec.res.oracle0000666000000000000000000003046613571573400020351 0ustar [kernel] Parsing tests/value/memexec.c (with preprocessing) [rte] annotating function fbug [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x1 ∈ {0} y1 ∈ {0} z1 ∈ {0} c ∈ [--..--] p ∈ {0} i ∈ {0} t[0..9] ∈ {0} ps ∈ {0} S[0..9] ∈ {0} g_f5_1 ∈ {0} g_f5_2 ∈ {0} two_fields ∈ {0} [eva] computing for function f1 <- main. Called from tests/value/memexec.c:154. [eva] computing for function f11 <- f1 <- main. Called from tests/value/memexec.c:12. [eva] Recording results for f11 [eva] Done for function f11 [eva] tests/value/memexec.c:13: Reusing old results for call to f11 [eva] tests/value/memexec.c:14: Reusing old results for call to f11 [eva] tests/value/memexec.c:16: Reusing old results for call to f11 [eva] tests/value/memexec.c:18: Reusing old results for call to f11 [eva] tests/value/memexec.c:20: Reusing old results for call to f11 [eva] tests/value/memexec.c:21: Reusing old results for call to f11 [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/value/memexec.c:155. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/value/memexec.c:156. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function bug <- main. Called from tests/value/memexec.c:157. [eva] computing for function fbug <- bug <- main. Called from tests/value/memexec.c:40. [eva:alarm] tests/value/memexec.c:33: Warning: assertion 'rte,mem_access' got status invalid (stopping propagation). [eva] Recording results for fbug [eva] Done for function fbug [eva] computing for function fbug <- bug <- main. Called from tests/value/memexec.c:42. [eva] tests/value/memexec.c:33: assertion 'rte,mem_access' got status valid. [eva] Recording results for fbug [eva] Done for function fbug [eva] Recording results for bug [eva] Done for function bug [eva:locals-escaping] tests/value/memexec.c:157: Warning: locals {x} escaping the scope of bug through p [eva] computing for function f4 <- main. Called from tests/value/memexec.c:158. [eva] computing for function f4_2 <- f4 <- main. Called from tests/value/memexec.c:84. [eva] computing for function f4_11 <- f4_2 <- f4 <- main. Called from tests/value/memexec.c:74. [eva:alarm] tests/value/memexec.c:59: Warning: accessing out of bounds index. assert ps->i < 10; [kernel] tests/value/memexec.c:59: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for f4_11 [eva] Done for function f4_11 [eva] computing for function f4_12 <- f4_2 <- f4 <- main. Called from tests/value/memexec.c:76. [eva:alarm] tests/value/memexec.c:63: Warning: accessing out of bounds index. assert i < 10; [kernel] tests/value/memexec.c:63: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for f4_12 [eva] Done for function f4_12 [eva] Recording results for f4_2 [eva] Done for function f4_2 [eva] computing for function f4_2 <- f4 <- main. Called from tests/value/memexec.c:87. [eva] computing for function f4_11 <- f4_2 <- f4 <- main. Called from tests/value/memexec.c:74. [eva] Recording results for f4_11 [eva] Done for function f4_11 [eva] computing for function f4_12 <- f4_2 <- f4 <- main. Called from tests/value/memexec.c:76. [eva] Recording results for f4_12 [eva] Done for function f4_12 [eva] Recording results for f4_2 [eva] Done for function f4_2 [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/value/memexec.c:159. [eva] computing for function f5_aux <- f5 <- main. Called from tests/value/memexec.c:107. [eva:alarm] tests/value/memexec.c:94: Warning: assertion got status unknown. [eva:alarm] tests/value/memexec.c:96: Warning: assertion got status unknown. [eva] Recording results for f5_aux [eva] Done for function f5_aux [eva] tests/value/memexec.c:108: Frama_C_show_each_f5: [9..2147483647], [-2147483648..6], [-2147483648..7] [eva] tests/value/memexec.c:113: Reusing old results for call to f5_aux [eva] tests/value/memexec.c:114: Frama_C_show_each_f5: [9..2147483647], [-2147483648..2147483647], [-2147483648..7] [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/value/memexec.c:160. [eva] computing for function f6_1 <- f6 <- main. Called from tests/value/memexec.c:123. [eva] Recording results for f6_1 [eva] Done for function f6_1 [eva] computing for function f6_1 <- f6 <- main. Called from tests/value/memexec.c:126. [eva] Recording results for f6_1 [eva] Done for function f6_1 [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/value/memexec.c:161. [eva] computing for function f7_1 <- f7 <- main. Called from tests/value/memexec.c:136. [eva] Recording results for f7_1 [eva] Done for function f7_1 [eva] tests/value/memexec.c:137: Reusing old results for call to f7_1 [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/value/memexec.c:162. [eva] computing for function f8_1 <- f8 <- main. Called from tests/value/memexec.c:147. [eva:alarm] tests/value/memexec.c:141: Warning: accessing uninitialized left-value. assert \initialized(q); [eva] Recording results for f8_1 [eva] Done for function f8_1 [eva] computing for function f8_1 <- f8 <- main. Called from tests/value/memexec.c:149. [eva] Recording results for f8_1 [eva] Done for function f8_1 [eva] tests/value/memexec.c:150: Reusing old results for call to f8_1 [eva] Recording results for f8 [eva] Done for function f8 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f11: x1 ∈ {1} [eva:final-states] Values at end of function f1: x1 ∈ {1} [eva:final-states] Values at end of function f2: [eva:final-states] Values at end of function f3: [eva:final-states] Values at end of function f4_11: t[0..5] ∈ {0} [6] ∈ {1} [7..9] ∈ {0} [eva:final-states] Values at end of function f4_12: t[0..1] ∈ {0} [2] ∈ {3} [3..4] ∈ {0} [5] ∈ {2} [6..9] ∈ {0} [eva:final-states] Values at end of function f4_2: i ∈ {5} t[0..1] ∈ {0} [2] ∈ {0; 3} [3..4] ∈ {0} [5] ∈ {0; 2} [6] ∈ {0; 1} [7..9] ∈ {0} ps ∈ {{ &S[8] }} S[0..7] ∈ {0} [8].i ∈ {6} [9] ∈ {0} [eva:final-states] Values at end of function f4: i ∈ {0; 5} t[0..1] ∈ {0} [2] ∈ {0; 3} [3..4] ∈ {0} [5] ∈ {0; 2} [6] ∈ {0; 1} [7..9] ∈ {0} ps ∈ {{ NULL ; &S[8] }} S[0..7] ∈ {0} [8].i ∈ {0; 6} [9] ∈ {0} n ∈ {6; 12} [eva:final-states] Values at end of function f5_aux: v ∈ [--..--] [eva:final-states] Values at end of function f5: g_f5_1 ∈ [--..--] g_f5_2 ∈ [-2147483648..7] arg ∈ [9..2147483647] [eva:final-states] Values at end of function f6_1: two_fields.x ∈ {1} .y ∈ {2; 3} [eva:final-states] Values at end of function f6: two_fields.x ∈ {1} .y ∈ {3} [eva:final-states] Values at end of function f7_1: x{.x; .y} ∈ {1} [eva:final-states] Values at end of function f7: x{.x; .y} ∈ {1} [eva:final-states] Values at end of function f8_1: q ∈ {0} [eva:final-states] Values at end of function f8: x ∈ {1} [eva:final-states] Values at end of function fbug: __retres ∈ {1} [eva:final-states] Values at end of function bug: p ∈ {{ &x }} x ∈ {1} [eva:final-states] Values at end of function main: x1 ∈ {1} p ∈ ESCAPINGADDR i ∈ {0; 5} t[0..1] ∈ {0} [2] ∈ {0; 3} [3..4] ∈ {0} [5] ∈ {0; 2} [6] ∈ {0; 1} [7..9] ∈ {0} ps ∈ {{ NULL ; &S[8] }} S[0..7] ∈ {0} [8].i ∈ {0; 6} [9] ∈ {0} g_f5_1 ∈ [--..--] g_f5_2 ∈ [-2147483648..7] two_fields.x ∈ {1} .y ∈ {3} [from] Computing for function f11 [from] Done for function f11 [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4_11 [from] Done for function f4_11 [from] Computing for function f4_12 [from] Done for function f4_12 [from] Computing for function f4_2 [from] Done for function f4_2 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5_aux [from] Done for function f5_aux [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6_1 [from] Done for function f6_1 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7_1 [from] Done for function f7_1 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8_1 [from] Done for function f8_1 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function fbug [from] Done for function fbug [from] Computing for function bug [from] Done for function bug [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f11: x1 FROM \nothing [from] Function f1: x1 FROM \nothing [from] Function f2: NO EFFECTS [from] Function f3: NO EFFECTS [from] Function f4_11: t[6] FROM ps; S[8] [from] Function f4_12: t{[2]; [5]} FROM i [from] Function f4_2: i FROM v; n t{[2]; [5..6]} FROM c; v; n (and SELF) ps FROM \nothing S[8] FROM v; n [from] Function f4: i FROM c (and SELF) t{[2]; [5..6]} FROM c (and SELF) ps FROM c (and SELF) S[8] FROM c (and SELF) [from] Function f5_aux: NO EFFECTS [from] Function f5: g_f5_1 FROM c g_f5_2 FROM c [from] Function f6_1: two_fields.x FROM \nothing [from] Function f6: two_fields FROM \nothing [from] Function f7_1: x FROM p_0 [from] Function f7: NO EFFECTS [from] Function f8_1: NO EFFECTS [from] Function f8: NO EFFECTS [from] Function fbug: \result FROM p; x [from] Function bug: p FROM \nothing [from] Function main: x1 FROM \nothing p FROM \nothing i FROM c (and SELF) t{[2]; [5..6]} FROM c (and SELF) ps FROM c (and SELF) S[8] FROM c (and SELF) g_f5_1 FROM c g_f5_2 FROM c two_fields FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f11: x1 [inout] Inputs for function f11: \nothing [inout] Out (internal) for function f1: x1 [inout] Inputs for function f1: \nothing [inout] Out (internal) for function f2: \nothing [inout] Inputs for function f2: \nothing [inout] Out (internal) for function f3: \nothing [inout] Inputs for function f3: \nothing [inout] Out (internal) for function f4_11: t[6] [inout] Inputs for function f4_11: ps; S[8] [inout] Out (internal) for function f4_12: t{[2]; [5]} [inout] Inputs for function f4_12: i [inout] Out (internal) for function f4_2: i; t{[2]; [5..6]}; ps; S[8] [inout] Inputs for function f4_2: c; i; ps; S[8]; n [inout] Out (internal) for function f4: i; t{[2]; [5..6]}; ps; S[8]; n [inout] Inputs for function f4: c; i; ps; S[8] [inout] Out (internal) for function f5_aux: v [inout] Inputs for function f5_aux: g_f5_2 [inout] Out (internal) for function f5: g_f5_1; g_f5_2; arg [inout] Inputs for function f5: c; g_f5_1; g_f5_2 [inout] Out (internal) for function f6_1: two_fields.x [inout] Inputs for function f6_1: \nothing [inout] Out (internal) for function f6: two_fields [inout] Inputs for function f6: \nothing [inout] Out (internal) for function f7_1: x [inout] Inputs for function f7_1: \nothing [inout] Out (internal) for function f7: x [inout] Inputs for function f7: \nothing [inout] Out (internal) for function f8_1: q [inout] Inputs for function f8_1: x [inout] Out (internal) for function f8: x [inout] Inputs for function f8: c [inout] Out (internal) for function fbug: __retres [inout] Inputs for function fbug: p; x [inout] Out (internal) for function bug: p; x [inout] Inputs for function bug: c; p [inout] Out (internal) for function main: x1; p; i; t{[2]; [5..6]}; ps; S[8]; g_f5_1; g_f5_2; two_fields [inout] Inputs for function main: c; p; i; ps; S[8]; g_f5_1; g_f5_2 frama-c-20.0-Calcium/tests/value/oracle/merge_bits.res.oracle0000666000000000000000000000523713571573400021044 0ustar [kernel] Parsing tests/value/merge_bits.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0] ∈ {1} [1..3] ∈ {0} [4] ∈ {1} [5] ∈ {2} [6] ∈ {3} [7] ∈ {4} [8] ∈ {5} [9] ∈ {0} [10..12] ∈ {1} nondet ∈ [--..--] [eva] computing for function join_offsetmap <- main. Called from tests/value/merge_bits.i:35. [eva] Recording results for join_offsetmap [eva] Done for function join_offsetmap [eva] computing for function merge_bits <- main. Called from tests/value/merge_bits.i:36. [eva] tests/value/merge_bits.i:24: Frama_C_show_each_F: {1} [eva] tests/value/merge_bits.i:25: Frama_C_show_each_F: {16777216} [eva] tests/value/merge_bits.i:26: Frama_C_show_each_F: {67305985} [eva] tests/value/merge_bits.i:27: Frama_C_show_each_F: {16843008} [eva] tests/value/merge_bits.i:29: Frama_C_show_each_F: {1048577} [eva] Recording results for merge_bits [eva] Done for function merge_bits [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function join_offsetmap: u{.i[bits 0 to 15]; .s[0]} ∈ {65534} {.i[bits 16 to 31]; .s[1]} ∈ {65535} r ∈ {-2} [eva:final-states] Values at end of function merge_bits: T[0] ∈ {1} [1] ∈ {0} [bits 16 to 47] ∈ {-1879048176} [6] ∈ {3} [7] ∈ {4} [8] ∈ {5} [9] ∈ {0} [10..12] ∈ {1} __retres ∈ {0} [eva:final-states] Values at end of function main: T[0] ∈ {1} [1] ∈ {0} [bits 16 to 47] ∈ {-1879048176} [6] ∈ {3} [7] ∈ {4} [8] ∈ {5} [9] ∈ {0} [10..12] ∈ {1} __retres ∈ {0} [from] Computing for function join_offsetmap [from] Done for function join_offsetmap [from] Computing for function merge_bits [from] Done for function merge_bits [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function join_offsetmap: NO EFFECTS [from] Function merge_bits: T[2..5] FROM \nothing \result FROM \nothing [from] Function main: T[2..5] FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function join_offsetmap: u; r [inout] Inputs for function join_offsetmap: nondet [inout] Out (internal) for function merge_bits: T[2..5]; __retres [inout] Inputs for function merge_bits: T{[0..7]; [9..12]} [inout] Out (internal) for function main: T[2..5]; __retres [inout] Inputs for function main: T{[0..7]; [9..12]}; nondet frama-c-20.0-Calcium/tests/value/oracle/mini_pointrer.res.oracle0000666000000000000000000000277213571573400021603 0ustar [kernel] Parsing tests/value/mini_pointrer.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..1] ∈ {0} ppp ∈ {0} pp[0..1] ∈ {0} p ∈ {0} [eva:alarm] tests/value/mini_pointrer.i:6: Warning: accessing out of bounds index. assert 0 ≤ c1; [eva:alarm] tests/value/mini_pointrer.i:6: Warning: accessing out of bounds index. assert c1 < 2; [eva:alarm] tests/value/mini_pointrer.i:8: Warning: out of bounds read. assert \valid_read(ppp); [eva:alarm] tests/value/mini_pointrer.i:8: Warning: out of bounds write. assert \valid(*ppp); [eva:alarm] tests/value/mini_pointrer.i:10: Warning: accessing out of bounds index. assert c2 < 2; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[0..1] ∈ {0; 4; 9} ppp ∈ {{ (int **)&pp }} pp[0] ∈ {{ (int)&T{[0], [1]} }} [1] ∈ {{ NULL ; (int)&T{[0], [1]} }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: T[0..1] FROM pp[0]; c1; c2 (and SELF) ppp FROM c2 pp[0..1] FROM c1 (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: T[0..1]; ppp; pp[0..1] [inout] Inputs for function main: ppp; pp[0] frama-c-20.0-Calcium/tests/value/oracle/misaligned_tabs.res.oracle0000666000000000000000000001074513571573400022051 0ustar [kernel] Parsing tests/value/misaligned_tabs.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..299] ∈ {0} S1{.i1; .i2} ∈ {4369} {.c1; .c2} ∈ {17} {.i3; .i4} ∈ {4369} S2{.i1; .i2} ∈ {4369} {.c1; .c2} ∈ {17} {.i3; .i4} ∈ {4369} S3{.i1; .i2} ∈ {4369} {.c1; .c2} ∈ {17} {.i3; .i4} ∈ {4369} S4{.i1; .i2} ∈ {4369} {.c1; .c2} ∈ {17} {.i3; .i4} ∈ {4369} [eva] computing for function misaligned_struct <- main. Called from tests/value/misaligned_tabs.i:58. [eva] tests/value/misaligned_tabs.i:10: Frama_C_show_each_1: {1} [eva] tests/value/misaligned_tabs.i:13: Frama_C_show_each_2: {1} [eva] tests/value/misaligned_tabs.i:14: Frama_C_show_each_3: {1} [eva] tests/value/misaligned_tabs.i:15: Frama_C_show_each_4: {1} [eva] tests/value/misaligned_tabs.i:19: Frama_C_show_each_5: {1} [eva] tests/value/misaligned_tabs.i:20: Frama_C_show_each_6: {1} [eva] tests/value/misaligned_tabs.i:21: Frama_C_show_each_7: {1} [eva] tests/value/misaligned_tabs.i:22: Frama_C_show_each_8: {1} [eva] tests/value/misaligned_tabs.i:41: Frama_C_show_each_9: {1} [eva] tests/value/misaligned_tabs.i:42: Frama_C_show_each_a: {1} [eva] tests/value/misaligned_tabs.i:43: Frama_C_show_each_b: {1} [eva] tests/value/misaligned_tabs.i:44: Frama_C_show_each_c: {1} [eva] tests/value/misaligned_tabs.i:45: Frama_C_show_each_d: {1} [eva] tests/value/misaligned_tabs.i:46: Frama_C_show_each_e: {1} [eva] tests/value/misaligned_tabs.i:47: Frama_C_show_each_f: {1} [eva] Recording results for misaligned_struct [eva] Done for function misaligned_struct [eva] tests/value/misaligned_tabs.i:64: Frama_C_show_each_g: {1} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function misaligned_struct: S1.i1[bits 0 to 7] ∈ {17} {.i1[bits 8 to 15]#; .i2} ∈ {4369} repeated %16, bits 8 to 31 {.c1; .c2} ∈ {17} {.i3; .i4} ∈ {4369} S2.i1# ∈ {17} repeated %8 .i2 ∈ {4369} {.c1; .c2} ∈ {17} {.i3; .i4} ∈ {4369} S3.i1[bits 0 to 7]# ∈ {4369}%16, bits 0 to 7 {.i1[bits 8 to 15]; .i2#; .c1; .c2; .i3#; .i4[bits 0 to 7]} ∈ {17} repeated %8 .i4[bits 8 to 15]# ∈ {4369}%16, bits 8 to 15 S4{.i1#; .i2#} ∈ {17} repeated %8 {.c1#; .c2#} ∈ {4369}%32, bits 0 to 15 {.i3#; .i4#} ∈ {17} repeated %8 [eva:final-states] Values at end of function main: T[0]# ∈ {1; 2}%32, bits 0 to 7 [1] ∈ {0} [bits 16 to 95]# ∈ {1; 2} repeated %32, bits 16 to 95 [12..299] ∈ {0} S1.i1[bits 0 to 7] ∈ {17} {.i1[bits 8 to 15]#; .i2} ∈ {4369} repeated %16, bits 8 to 31 {.c1; .c2} ∈ {17} {.i3; .i4} ∈ {4369} S2.i1# ∈ {17} repeated %8 .i2 ∈ {4369} {.c1; .c2} ∈ {17} {.i3; .i4} ∈ {4369} S3.i1[bits 0 to 7]# ∈ {4369}%16, bits 0 to 7 {.i1[bits 8 to 15]; .i2#; .c1; .c2; .i3#; .i4[bits 0 to 7]} ∈ {17} repeated %8 .i4[bits 8 to 15]# ∈ {4369}%16, bits 8 to 15 S4{.i1#; .i2#} ∈ {17} repeated %8 {.c1#; .c2#} ∈ {4369}%32, bits 0 to 15 {.i3#; .i4#} ∈ {17} repeated %8 [from] Computing for function misaligned_struct [from] Done for function misaligned_struct [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function misaligned_struct: S1.i1[bits 0 to 7] FROM \nothing S2.i1 FROM \nothing S3{{.i1[bits 8 to 15]; .i2}; {.i3; .i4[bits 0 to 7]}} FROM \nothing S4 FROM \nothing [from] Function main: T{[0]; [2..3]} FROM c1 {[1]; [4..11]} FROM c2 S1.i1[bits 0 to 7] FROM \nothing S2.i1 FROM \nothing S3{{.i1[bits 8 to 15]; .i2}; {.i3; .i4[bits 0 to 7]}} FROM \nothing S4 FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function misaligned_struct: S1.i1[bits 0 to 7]; S2.i1; S3{{.i1[bits 8 to 15]; .i2}; {.i3; .i4[bits 0 to 7]}}; S4 [inout] Inputs for function misaligned_struct: S1{.i1; .i2; .c1; .c2}; S2{{.i1; .i2}; .c2}; S3{{.i1; .i2; .c1}; .i3}; S4{.i1; .i2; .c1; .c2; .i3} [inout] Out (internal) for function main: T[0..11]; S1.i1[bits 0 to 7]; S2.i1; S3{{.i1[bits 8 to 15]; .i2}; {.i3; .i4[bits 0 to 7]}}; S4 [inout] Inputs for function main: T[4..7]; S1{.i1; .i2; .c1; .c2}; S2{{.i1; .i2}; .c2}; S3{{.i1; .i2; .c1}; .i3}; S4{.i1; .i2; .c1; .c2; .i3} frama-c-20.0-Calcium/tests/value/oracle/mixed_val.res.oracle0000666000000000000000000000174613571573400020675 0ustar [kernel] Parsing tests/value/mixed_val.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0] ∈ {97} [1..9] ∈ {0} a ∈ {0} b ∈ {0} c ∈ {0} d ∈ {0} e ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[0] ∈ {-2999} [1..9] ∈ {0} a ∈ {128073} d ∈ {128073} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: T[0] FROM c a FROM c d FROM e \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: T[0]; a; d; __retres [inout] Inputs for function main: a[bits 0 to 15]; c; e frama-c-20.0-Calcium/tests/value/oracle/modifies.res.oracle0000666000000000000000000000275713571573400020527 0ustar [kernel] Parsing tests/value/modifies.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization TAB[0..9] ∈ [--..--] G ∈ [--..--] H ∈ [--..--] J ∈ [--..--] [eva:alarm] tests/value/modifies.i:8: Warning: signed overflow. assert J + 1 ≤ 2147483647; [eva:alarm] tests/value/modifies.i:8: Warning: signed overflow. assert -2147483648 ≤ TAB[4] - 1; [eva:alarm] tests/value/modifies.i:11: Warning: signed overflow. assert TAB[1] + 1 ≤ 2147483647; [eva:alarm] tests/value/modifies.i:11: Warning: signed overflow. assert TAB[6] + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: TAB[0..9] ∈ [--..--] G ∈ [--..--] H ∈ {0; 1; 3} J ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: TAB[1] FROM TAB[1]; G; H; J (and SELF) [4] FROM TAB[4]; H (and SELF) [6] FROM TAB[6]; G; H; J (and SELF) G FROM H; J (and SELF) H FROM G; H; J (and SELF) J FROM H; J (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: TAB{[1]; [4]; [6]}; G; H; J [inout] Inputs for function main: TAB{[1]; [4]; [6]}; G; H; J frama-c-20.0-Calcium/tests/value/oracle/modulo.res.oracle0000666000000000000000000002260613571573400020222 0ustar [kernel] Parsing tests/value/modulo.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} F ∈ {0} G ∈ {0} H ∈ {0} I ∈ {0} J ∈ {0} K ∈ {0} L ∈ {0} M ∈ {0} N ∈ {0} O ∈ {0} P ∈ {0} Q ∈ {0} R ∈ {0} v ∈ [--..--] a ∈ [--..--] b ∈ [--..--] i2 ∈ [--..--] [eva] computing for function pgcd1 <- main. Called from tests/value/modulo.i:151. [eva:alarm] tests/value/modulo.i:151: Warning: function pgcd1: precondition got status unknown. [eva] tests/value/modulo.i:37: loop invariant got status valid. [eva] tests/value/modulo.i:38: loop invariant got status valid. [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [1..10], [0..9] [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {0}, [1..10], {0} [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [1..10], [-9..0] [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [1..10], [-10..-1], [0..9] [eva] tests/value/modulo.i:41: Frama_C_show_each_1: {0}, [-10..-1], {0} [eva] tests/value/modulo.i:41: Frama_C_show_each_1: [-10..-1], [-10..-1], [-9..0] [eva] Recording results for pgcd1 [eva] Done for function pgcd1 [eva] computing for function pgcd2 <- main. Called from tests/value/modulo.i:152. [eva:alarm] tests/value/modulo.i:152: Warning: function pgcd2: precondition got status unknown. [eva] tests/value/modulo.i:50: loop invariant got status valid. [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..10], [1..10], [-9..9] [eva] tests/value/modulo.i:53: Frama_C_show_each_2: [-10..10], [-10..-1], [-9..9] [eva] Recording results for pgcd2 [eva] Done for function pgcd2 [eva] computing for function pgcd3 <- main. Called from tests/value/modulo.i:153. [eva:alarm] tests/value/modulo.i:153: Warning: function pgcd3: precondition got status unknown. [eva:alarm] tests/value/modulo.i:63: Warning: division by zero. assert b_0 ≢ 0; [eva] tests/value/modulo.i:64: Frama_C_show_each_3: [-10..10], [-10..10], [-9..9] [eva] Recording results for pgcd3 [eva] Done for function pgcd3 [eva] computing for function main2 <- main. Called from tests/value/modulo.i:155. [eva:alarm] tests/value/modulo.i:9: Warning: signed overflow. assert -2147483648 ≤ 4 * i; [eva:alarm] tests/value/modulo.i:9: Warning: signed overflow. assert 4 * i ≤ 2147483647; [eva:alarm] tests/value/modulo.i:10: Warning: signed overflow. assert -2147483648 ≤ 4 * i; [eva:alarm] tests/value/modulo.i:10: Warning: signed overflow. assert 4 * i ≤ 2147483647; [eva:alarm] tests/value/modulo.i:11: Warning: assertion got status unknown. [eva:alarm] tests/value/modulo.i:13: Warning: assertion got status unknown. [eva:alarm] tests/value/modulo.i:27: Warning: division by zero. assert G ≢ 0; [eva:alarm] tests/value/modulo.i:29: Warning: division by zero. assert L ≢ 0; [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function simultaneous_congruences <- main. Called from tests/value/modulo.i:156. [eva:alarm] tests/value/modulo.i:76: Warning: assertion got status unknown. [eva] Recording results for simultaneous_congruences [eva] Done for function simultaneous_congruences [eva] computing for function shift_modulo <- main. Called from tests/value/modulo.i:157. [eva:alarm] tests/value/modulo.i:100: Warning: assertion got status unknown. [eva:alarm] tests/value/modulo.i:103: Warning: signed overflow. assert (int)((int)(i * 12) + 5) << 25 ≤ 2147483647; [eva:alarm] tests/value/modulo.i:104: Warning: signed overflow. assert (int)((int)(i * 13) + 7) << 25 ≤ 2147483647; [eva] Recording results for shift_modulo [eva] Done for function shift_modulo [eva] computing for function extract_bits_modulo <- main. Called from tests/value/modulo.i:158. [eva:alarm] tests/value/modulo.i:109: Warning: assertion got status unknown. [eva] Recording results for extract_bits_modulo [eva] Done for function extract_bits_modulo [eva] computing for function pos_rem <- main. Called from tests/value/modulo.i:159. [eva:alarm] tests/value/modulo.i:137: Warning: assertion got status unknown. [eva:alarm] tests/value/modulo.i:142: Warning: assertion got status unknown. [eva:alarm] tests/value/modulo.i:146: Warning: assertion got status unknown. [eva] Recording results for pos_rem [eva] Done for function pos_rem [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 2 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function extract_bits_modulo: i ∈ [0..10] aa1 ∈ [1291..32011],1291%3072 ptr1 ∈ {{ (unsigned char *)&aa1 }} m1 ∈ {11} n1 ∈ [5..125],1%4 aa2 ∈ [1294..32124] ptr2 ∈ {{ (unsigned char *)&aa2 }} m2 ∈ [0..255] n2 ∈ [5..125] aa3 ∈ [1296..32126] ptr3 ∈ {{ (unsigned char *)&aa3 }} m3 ∈ [0..255] n3 ∈ [5..125] aa4 ∈ [16..126],5%11 ptr4 ∈ {{ (unsigned char *)&aa4 }} m4 ∈ [16..126] n4 ∈ {0} [eva:final-states] Values at end of function main2: A ∈ {0} B ∈ {-3; 1} C ∈ {1} D ∈ {1; 4; 7; 10} E ∈ {-11; -8; -5; -2; 1; 4; 7; 10} F ∈ {5} G ∈ [1..12] H ∈ [0..100] I ∈ [101..301],1%2 J ∈ [-201..299],4%5 K ∈ {-6; -1; 4; 9} L ∈ [-9..9] M ∈ {-6; -2; -1; 0; 1; 2; 4; 9} N ∈ [-299..299] O ∈ [0..11] P ∈ {0} Q ∈ [-8..8] i ∈ [0..100] [eva:final-states] Values at end of function pgcd1: a_0 ∈ [-10..10] b_0 ∈ {0} [eva:final-states] Values at end of function pgcd2: a_0 ∈ [-10..10] b_0 ∈ {0} [eva:final-states] Values at end of function pgcd3: a_0 ∈ [-10..10] b_0 ∈ {0} [eva:final-states] Values at end of function pos_rem: n ∈ [-1..72] j ∈ [-128..127] k ∈ [0..135] l ∈ [-128..127] [eva:final-states] Values at end of function shift_modulo: i ∈ [0..10] r ∈ [20..500],20%48 s ∈ [5..125],5%12 q ∈ {5; 17; 29; 41; 53} t ∈ {7; 20; 33; 46; 59} [eva:final-states] Values at end of function simultaneous_congruences: n1 ∈ [98..436207493],98%195 n2 ∈ [98..436207493],98%195 n3 ∈ [98..436207493],98%195 m1 ∈ [7..134217735],3%4 m2 ∈ [10..201326602],4%6 o1 ∈ [11..268435451],11%24 o2 ∈ [11..268435451],11%24 o3 ∈ [11..268435451],11%24 [eva:final-states] Values at end of function main: A ∈ {0} B ∈ {-3; 1} C ∈ {1} D ∈ {1; 4; 7; 10} E ∈ {-11; -8; -5; -2; 1; 4; 7; 10} F ∈ {5} G ∈ [1..12] H ∈ [0..100] I ∈ [101..301],1%2 J ∈ [-201..299],4%5 K ∈ {-6; -1; 4; 9} L ∈ [-9..9] M ∈ {-6; -2; -1; 0; 1; 2; 4; 9} N ∈ [-299..299] O ∈ [0..11] P ∈ {0} Q ∈ [-8..8] [from] Computing for function extract_bits_modulo [from] Done for function extract_bits_modulo [from] Computing for function main2 [from] Done for function main2 [from] Computing for function pgcd1 [from] Done for function pgcd1 [from] Computing for function pgcd2 [from] Done for function pgcd2 [from] Computing for function pgcd3 [from] Done for function pgcd3 [from] Computing for function pos_rem [from] Done for function pos_rem [from] Computing for function shift_modulo [from] Done for function shift_modulo [from] Computing for function simultaneous_congruences [from] Done for function simultaneous_congruences [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function extract_bits_modulo: NO EFFECTS [from] Function main2: A FROM v B FROM v C FROM v D FROM v E FROM v F FROM v G FROM v H FROM v I FROM v J FROM v K FROM v L FROM v M FROM v N FROM v O FROM v P FROM v Q FROM v [from] Function pgcd1: \result FROM x; y [from] Function pgcd2: \result FROM x; y [from] Function pgcd3: \result FROM x; y [from] Function pos_rem: NO EFFECTS [from] Function shift_modulo: NO EFFECTS [from] Function simultaneous_congruences: NO EFFECTS [from] Function main: A FROM v B FROM v C FROM v D FROM v E FROM v F FROM v G FROM v H FROM v I FROM v J FROM v K FROM v L FROM v M FROM v N FROM v O FROM v P FROM v Q FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function extract_bits_modulo: i; aa1; ptr1; m1; n1; aa2; ptr2; m2; n2; aa3; ptr3; m3; n3; aa4; ptr4; m4; n4 [inout] Inputs for function extract_bits_modulo: v [inout] Out (internal) for function main2: A; B; C; D; E; F; G; H; I; J; K; L; M; N; O; P; Q; i [inout] Inputs for function main2: A; D; G; I; J; K; L; v [inout] Out (internal) for function pgcd1: a_0; b_0; tmp [inout] Inputs for function pgcd1: \nothing [inout] Out (internal) for function pgcd2: a_0; b_0; tmp [inout] Inputs for function pgcd2: \nothing [inout] Out (internal) for function pgcd3: a_0; b_0; tmp [inout] Inputs for function pgcd3: \nothing [inout] Out (internal) for function pos_rem: n; j; k; l [inout] Inputs for function pos_rem: v [inout] Out (internal) for function shift_modulo: i; r; s; q; t [inout] Inputs for function shift_modulo: v [inout] Out (internal) for function simultaneous_congruences: n1; n2; n3; m1; m2; o1; o2; o3 [inout] Inputs for function simultaneous_congruences: i2 [inout] Out (internal) for function main: A; B; C; D; E; F; G; H; I; J; K; L; M; N; O; P; Q [inout] Inputs for function main: A; D; G; I; J; K; L; v; a; b; i2 frama-c-20.0-Calcium/tests/value/oracle/multi_access.res.oracle0000666000000000000000000000144113571573400021370 0ustar [kernel] Parsing tests/value/multi_access.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s{.a; .b} ∈ {2} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: s; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/narrow_behaviors.res.oracle0000666000000000000000000001160313571573400022270 0ustar [kernel] Parsing tests/value/narrow_behaviors.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function f1 <- main. Called from tests/value/narrow_behaviors.i:56. [eva] using specification for function f1 [eva] Done for function f1 [eva] tests/value/narrow_behaviors.i:56: Frama_C_dump_each: # Cvalue domain: nondet ∈ [--..--] p.x ∈ {2} .y ∈ {1; 2} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/narrow_behaviors.i:56: Frama_C_dump_each: # Cvalue domain: nondet ∈ {0} p{.x; .y} ∈ {1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] computing for function f2 <- main. Called from tests/value/narrow_behaviors.i:57. [eva] using specification for function f2 [eva] Done for function f2 [eva] computing for function f2 <- main. Called from tests/value/narrow_behaviors.i:57. [eva] tests/value/narrow_behaviors.i:57: function f2, behavior b: assumes got status invalid; behavior not evaluated. [eva] tests/value/narrow_behaviors.i:57: function f2, behavior c: assumes got status invalid; behavior not evaluated. [eva] Done for function f2 [eva] tests/value/narrow_behaviors.i:57: Frama_C_dump_each: # Cvalue domain: nondet ∈ [--..--] p.x ∈ {2} .y ∈ {1; 2} q.x ∈ {2} .y ∈ {1; 2} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/narrow_behaviors.i:57: Frama_C_dump_each: # Cvalue domain: nondet ∈ {0} p.x ∈ {2} .y ∈ {1; 2} q.x ∈ {1; 2} .y ∈ {1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/narrow_behaviors.i:57: Frama_C_dump_each: # Cvalue domain: nondet ∈ {0} p{.x; .y} ∈ {1} q.x ∈ {1; 2} .y ∈ {1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/narrow_behaviors.i:61: Warning: assertion got status unknown. [eva] computing for function f1 <- main. Called from tests/value/narrow_behaviors.i:62. [eva] tests/value/narrow_behaviors.i:62: function f1, behavior b: assumes got status invalid; behavior not evaluated. [eva] tests/value/narrow_behaviors.i:62: function f1, behavior c: assumes got status invalid; behavior not evaluated. [eva] Done for function f1 [eva] computing for function f1 <- main. Called from tests/value/narrow_behaviors.i:62. [eva] tests/value/narrow_behaviors.i:62: function f1, behavior a: assumes got status invalid; behavior not evaluated. [eva] tests/value/narrow_behaviors.i:62: function f1, behavior d: assumes got status invalid; behavior not evaluated. [eva] Done for function f1 [eva] tests/value/narrow_behaviors.i:62: Frama_C_dump_each: # Cvalue domain: nondet ∈ {0} r{.x; .y} ∈ {1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/narrow_behaviors.i:62: Frama_C_dump_each: # Cvalue domain: nondet ∈ {1} r{.x; .y} ∈ {2} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] computing for function f2 <- main. Called from tests/value/narrow_behaviors.i:63. [eva] tests/value/narrow_behaviors.i:63: function f2, behavior b: assumes got status invalid; behavior not evaluated. [eva] tests/value/narrow_behaviors.i:63: function f2, behavior c: assumes got status invalid; behavior not evaluated. [eva] Done for function f2 [eva] computing for function f2 <- main. Called from tests/value/narrow_behaviors.i:63. [eva] tests/value/narrow_behaviors.i:63: function f2, behavior a: assumes got status invalid; behavior not evaluated. [eva] tests/value/narrow_behaviors.i:63: function f2, behavior d: assumes got status invalid; behavior not evaluated. [eva] tests/value/narrow_behaviors.i:43: Warning: function f2, behavior c: this postcondition evaluates to false in this context. If it is valid, either a precondition was not verified for this call, or some assigns/from clauses are incomplete (or incorrect). [eva] Done for function f2 [eva] tests/value/narrow_behaviors.i:63: Frama_C_dump_each: # Cvalue domain: nondet ∈ {0} r{.x; .y} ∈ {1} s.x ∈ {1; 2} .y ∈ {1} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [from] Computing for function main [from] Computing for function f1 <-main [from] Done for function f1 [from] Computing for function f2 <-main [from] Done for function f2 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: \result FROM nondet [from] Function f2: \result FROM nondet [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; q; r; s; __retres [inout] Inputs for function main: nondet frama-c-20.0-Calcium/tests/value/oracle/nested_struct_init.res.oracle0000666000000000000000000002543713571573400022641 0ustar [kernel] Parsing tests/value/nested_struct_init.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g_3.f0 ∈ {-1} .[bits 8 to 15] ∈ {0} .f1 ∈ {19284} .f2 ∈ {6} .f3 ∈ {7} .f4 ∈ {-1} .[bits 120 to 127] ∈ {0} .f5 ∈ {1} .f6 ∈ {-10} .[bits 176 to 191] ∈ {0} .f7 ∈ {1732606355} .f8 ∈ {15485} .[bits 240 to 255] ∈ {0} g_8.f0.f0 ∈ {-43} .f0.[bits 8 to 15] ∈ {0} .f0.f1 ∈ {-10} .f0{.f2; .[bits 48 to 63]} ∈ {0} .f0.f3 ∈ {-1878325119} .f0.f4 ∈ {218} .f0.[bits 104 to 127] ∈ {0} .f0.f5.f0 ∈ {-37} .f0.f5.[bits 8 to 15] ∈ {0} .f0.f5.f1 ∈ {-31637} .f0.f5.f2 ∈ {1} .f0.f5.f3 ∈ {65529} .f0.f5.f4 ∈ {-13} .f0.f5.[bits 120 to 127] ∈ {0} .f0.f5.f5 ∈ {-66898258} .f0.f5.f6 ∈ {6} .f0.f5.[bits 176 to 191] ∈ {0} .f0.f5.f7 ∈ {1390716594} .f0.f5.f8 ∈ {20144} .f0.f5.[bits 240 to 255] ∈ {0} .f0.f6 ∈ {1257091918934088959} .f0.f7 ∈ {-100} .f0.[bits 456 to 463] ∈ {0} .f0.f8 ∈ {-1} .f1 ∈ {372666747} .f2 ∈ {4294967292} .f3 ∈ {4} .f4.f0 ∈ {-29} .f4.[bits 8 to 15] ∈ {0} .f4.f1 ∈ {-4900} .f4.f2 ∈ {-1010372691391514597} .f4.f3 ∈ {63392} .f4.f4 ∈ {124} .f4{.f5; .[bits 120 to 127]} ∈ {0} .f4.f6 ∈ {-22659} .f4.[bits 176 to 191] ∈ {0} .f4.f7 ∈ {2143805241} .f4.f8 ∈ {15450} .f4.[bits 240 to 255] ∈ {0} .f5.f0 ∈ {-1593529130} .f5.f1 ∈ {168} .f5.[bits 40 to 63] ∈ {0} .f6 ∈ {-83} .f7 ∈ {8} .[bits 944 to 959] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g_3.f0 ∈ {-1} .[bits 8 to 15] ∈ UNINITIALIZED .f1 ∈ {19284} .f2 ∈ {6} .f3 ∈ {7} .f4 ∈ {-1} .[bits 120 to 127] ∈ UNINITIALIZED .f5 ∈ {1} .f6 ∈ {-10} .[bits 176 to 191] ∈ UNINITIALIZED .f7 ∈ {1732606355} .f8 ∈ {15485} .[bits 240 to 255] ∈ UNINITIALIZED g_8.f0.f0 ∈ {-43} .f0.[bits 8 to 15] ∈ UNINITIALIZED .f0.f1 ∈ {-10} .f0.f2 ∈ {0} .f0.[bits 48 to 63] ∈ UNINITIALIZED .f0.f3 ∈ {-1878325119} .f0.f4 ∈ {218} .f0.[bits 104 to 127] ∈ UNINITIALIZED .f0.f5.f0 ∈ {-37} .f0.f5.[bits 8 to 15] ∈ UNINITIALIZED .f0.f5.f1 ∈ {-31637} .f0.f5.f2 ∈ {1} .f0.f5.f3 ∈ {65529} .f0.f5.f4 ∈ {-13} .f0.f5.[bits 120 to 127] ∈ UNINITIALIZED .f0.f5.f5 ∈ {-66898258} .f0.f5.f6 ∈ {6} .f0.f5.[bits 176 to 191] ∈ UNINITIALIZED .f0.f5.f7 ∈ {1390716594} .f0.f5.f8 ∈ {20144} .f0.f5.[bits 240 to 255] ∈ UNINITIALIZED .f0.f6 ∈ {1257091918934088959} .f0.f7 ∈ {-100} .f0.[bits 456 to 463] ∈ UNINITIALIZED .f0.f8 ∈ {-1} .f1 ∈ {372666747} .f2 ∈ {4294967292} .f3 ∈ {4} .f4.f0 ∈ {-29} .f4.[bits 8 to 15] ∈ UNINITIALIZED .f4.f1 ∈ {-4900} .f4.f2 ∈ {-1010372691391514597} .f4.f3 ∈ {63392} .f4.f4 ∈ {124} .f4.[bits 120 to 127] ∈ UNINITIALIZED .f4.f5 ∈ {0} .f4.f6 ∈ {-22659} .f4.[bits 176 to 191] ∈ UNINITIALIZED .f4.f7 ∈ {2143805241} .f4.f8 ∈ {15450} .f4.[bits 240 to 255] ∈ UNINITIALIZED .f5.f0 ∈ {-1593529130} .f5.f1 ∈ {168} .f5.[bits 40 to 63] ∈ UNINITIALIZED .f6 ∈ {-83} .f7 ∈ {8} .[bits 944 to 959] ∈ UNINITIALIZED [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g_3.f0 ∈ {-1} .[bits 8 to 15] ∈ {0} or UNINITIALIZED .f1 ∈ {19284} .f2 ∈ {6} .f3 ∈ {7} .f4 ∈ {-1} .[bits 120 to 127] ∈ {0} or UNINITIALIZED .f5 ∈ {1} .f6 ∈ {-10} .[bits 176 to 191] ∈ {0} or UNINITIALIZED .f7 ∈ {1732606355} .f8 ∈ {15485} .[bits 240 to 255] ∈ {0} or UNINITIALIZED g_8.f0.f0 ∈ {-43} .f0.[bits 8 to 15] ∈ {0} or UNINITIALIZED .f0.f1 ∈ {-10} .f0.f2 ∈ {0} .f0.[bits 48 to 63] ∈ {0} or UNINITIALIZED .f0.f3 ∈ {-1878325119} .f0.f4 ∈ {218} .f0.[bits 104 to 127] ∈ {0} or UNINITIALIZED .f0.f5.f0 ∈ {-37} .f0.f5.[bits 8 to 15] ∈ {0} or UNINITIALIZED .f0.f5.f1 ∈ {-31637} .f0.f5.f2 ∈ {1} .f0.f5.f3 ∈ {65529} .f0.f5.f4 ∈ {-13} .f0.f5.[bits 120 to 127] ∈ {0} or UNINITIALIZED .f0.f5.f5 ∈ {-66898258} .f0.f5.f6 ∈ {6} .f0.f5.[bits 176 to 191] ∈ {0} or UNINITIALIZED .f0.f5.f7 ∈ {1390716594} .f0.f5.f8 ∈ {20144} .f0.f5.[bits 240 to 255] ∈ {0} or UNINITIALIZED .f0.f6 ∈ {1257091918934088959} .f0.f7 ∈ {-100} .f0.[bits 456 to 463] ∈ {0} or UNINITIALIZED .f0.f8 ∈ {-1} .f1 ∈ {372666747} .f2 ∈ {4294967292} .f3 ∈ {4} .f4.f0 ∈ {-29} .f4.[bits 8 to 15] ∈ {0} or UNINITIALIZED .f4.f1 ∈ {-4900} .f4.f2 ∈ {-1010372691391514597} .f4.f3 ∈ {63392} .f4.f4 ∈ {124} .f4.[bits 120 to 127] ∈ {0} or UNINITIALIZED .f4.f5 ∈ {0} .f4.f6 ∈ {-22659} .f4.[bits 176 to 191] ∈ {0} or UNINITIALIZED .f4.f7 ∈ {2143805241} .f4.f8 ∈ {15450} .f4.[bits 240 to 255] ∈ {0} or UNINITIALIZED .f5.f0 ∈ {-1593529130} .f5.f1 ∈ {168} .f5.[bits 40 to 63] ∈ {0} or UNINITIALIZED .f6 ∈ {-83} .f7 ∈ {8} .[bits 944 to 959] ∈ {0} or UNINITIALIZED [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g_3.f0 ∈ [--..--] .[bits 8 to 15] ∈ [--..--] or UNINITIALIZED {.f1; .f2; .f3; .f4} ∈ [--..--] .[bits 120 to 127] ∈ [--..--] or UNINITIALIZED {.f5; .f6} ∈ [--..--] .[bits 176 to 191] ∈ [--..--] or UNINITIALIZED {.f7; .f8} ∈ [--..--] .[bits 240 to 255] ∈ [--..--] or UNINITIALIZED g_8.f0.f0 ∈ [--..--] .f0.[bits 8 to 15] ∈ [--..--] or UNINITIALIZED .f0.f1 ∈ {-10} .f0.f2 ∈ [--..--] .f0.[bits 48 to 63] ∈ [--..--] or UNINITIALIZED .f0{.f3; .f4} ∈ [--..--] .f0.[bits 104 to 127] ∈ [--..--] or UNINITIALIZED .f0.f5.f0 ∈ [--..--] .f0.f5.[bits 8 to 15] ∈ [--..--] or UNINITIALIZED .f0.f5{.f1; .f2; .f3; .f4} ∈ [--..--] .f0.f5.[bits 120 to 127] ∈ [--..--] or UNINITIALIZED .f0.f5{.f5; .f6} ∈ [--..--] .f0.f5.[bits 176 to 191] ∈ [--..--] or UNINITIALIZED .f0.f5{.f7; .f8} ∈ [--..--] .f0.f5.[bits 240 to 255] ∈ [--..--] or UNINITIALIZED .f0{.f6; .f7} ∈ [--..--] .f0.[bits 456 to 463] ∈ [--..--] or UNINITIALIZED .f0.f8 ∈ [--..--] .f1 ∈ {372666747} .f2 ∈ {4294967292} {.f3; .f4.f0} ∈ [--..--] .f4.[bits 8 to 15] ∈ [--..--] or UNINITIALIZED .f4{.f1; .f2; .f3; .f4} ∈ [--..--] .f4.[bits 120 to 127] ∈ [--..--] or UNINITIALIZED .f4{.f5; .f6} ∈ [--..--] .f4.[bits 176 to 191] ∈ [--..--] or UNINITIALIZED .f4{.f7; .f8} ∈ [--..--] .f4.[bits 240 to 255] ∈ [--..--] or UNINITIALIZED .f5.f0 ∈ {-1593529130} .f5.f1 ∈ {168} .f5.[bits 40 to 63] ∈ [--..--] or UNINITIALIZED .f6 ∈ [--..--] .f7 ∈ {8} .[bits 944 to 959] ∈ [--..--] or UNINITIALIZED [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g_3.f0 ∈ [--..--] .[bits 8 to 15] ∈ UNINITIALIZED {.f1; .f2; .f3; .f4} ∈ [--..--] .[bits 120 to 127] ∈ UNINITIALIZED {.f5; .f6} ∈ [--..--] .[bits 176 to 191] ∈ UNINITIALIZED {.f7; .f8} ∈ [--..--] .[bits 240 to 255] ∈ UNINITIALIZED g_8.f0.f0 ∈ [--..--] .f0.[bits 8 to 15] ∈ UNINITIALIZED .f0.f1 ∈ {-10} .f0.f2 ∈ [--..--] .f0.[bits 48 to 63] ∈ UNINITIALIZED .f0{.f3; .f4} ∈ [--..--] .f0.[bits 104 to 127] ∈ UNINITIALIZED .f0.f5.f0 ∈ [--..--] .f0.f5.[bits 8 to 15] ∈ UNINITIALIZED .f0.f5{.f1; .f2; .f3; .f4} ∈ [--..--] .f0.f5.[bits 120 to 127] ∈ UNINITIALIZED .f0.f5{.f5; .f6} ∈ [--..--] .f0.f5.[bits 176 to 191] ∈ UNINITIALIZED .f0.f5{.f7; .f8} ∈ [--..--] .f0.f5.[bits 240 to 255] ∈ UNINITIALIZED .f0{.f6; .f7} ∈ [--..--] .f0.[bits 456 to 463] ∈ UNINITIALIZED .f0.f8 ∈ [--..--] .f1 ∈ {372666747} .f2 ∈ {4294967292} {.f3; .f4.f0} ∈ [--..--] .f4.[bits 8 to 15] ∈ UNINITIALIZED .f4{.f1; .f2; .f3; .f4} ∈ [--..--] .f4.[bits 120 to 127] ∈ UNINITIALIZED .f4{.f5; .f6} ∈ [--..--] .f4.[bits 176 to 191] ∈ UNINITIALIZED .f4{.f7; .f8} ∈ [--..--] .f4.[bits 240 to 255] ∈ UNINITIALIZED .f5.f0 ∈ {-1593529130} .f5.f1 ∈ {168} .f5.[bits 40 to 63] ∈ UNINITIALIZED .f6 ∈ [--..--] .f7 ∈ {8} .[bits 944 to 959] ∈ UNINITIALIZED [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g_3 ∈ [--..--] g_8.f0{.f0; .[bits 8 to 15]} ∈ [--..--] .f0.f1 ∈ {-10} .f0{.f2; .f3; .f4; .f5; .f6; .f7; .f8; .[bits 48 to 63]; .[bits 104 to 127]; .[bits 456 to 463]} ∈ [--..--] .f1 ∈ {372666747} .f2 ∈ {4294967292} {.f3; .f4} ∈ [--..--] .f5.f0 ∈ {-1593529130} .f5.f1 ∈ {168} {.f5.[bits 40 to 63]; .f6} ∈ [--..--] .f7 ∈ {8} .[bits 944 to 959] ∈ [--..--] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} frama-c-20.0-Calcium/tests/value/oracle/no_results.res.oracle0000666000000000000000000036725413571573400021133 0ustar [kernel] Parsing tests/value/no_results.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..2999] ∈ {0} [eva] computing for function init <- main. Called from tests/value/no_results.c:19. [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 100 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 200 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 300 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 400 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 500 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 600 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 700 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 800 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 900 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1000 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1100 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1200 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1300 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1400 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1500 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1600 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1700 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1800 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 1900 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2000 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2100 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2200 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2300 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2400 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2500 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2600 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2700 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2800 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 2900 states [eva] tests/value/no_results.c:10: Trace partitioning superposing up to 3000 states [eva] Recording results for init [eva] Done for function init [eva] computing for function f <- main. Called from tests/value/no_results.c:20. [eva] Recording results for f [from] Computing for function f [from] Done for function f [eva] Done for function f [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: t[0..1] ∈ {0} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [10] ∈ {10} [11] ∈ {11} [12] ∈ {12} [13] ∈ {13} [14] ∈ {14} [15] ∈ {15} [16] ∈ {16} [17] ∈ {17} [18] ∈ {18} [19] ∈ {19} [20] ∈ {20} [21] ∈ {21} [22] ∈ {22} [23] ∈ {23} [24] ∈ {24} [25] ∈ {25} [26] ∈ {26} [27] ∈ {27} [28] ∈ {28} [29] ∈ {29} [30] ∈ {30} [31] ∈ {31} [32] ∈ {32} [33] ∈ {33} [34] ∈ {34} [35] ∈ {35} [36] ∈ {36} [37] ∈ {37} [38] ∈ {38} [39] ∈ {39} [40] ∈ {40} [41] ∈ {41} [42] ∈ {42} [43] ∈ {43} [44] ∈ {44} [45] ∈ {45} [46] ∈ {46} [47] ∈ {47} [48] ∈ {48} [49] ∈ {49} [50] ∈ {50} [51] ∈ {51} [52] ∈ {52} [53] ∈ {53} [54] ∈ {54} [55] ∈ {55} [56] ∈ {56} [57] ∈ {57} [58] ∈ {58} [59] ∈ {59} [60] ∈ {60} [61] ∈ {61} [62] ∈ {62} [63] ∈ {63} [64] ∈ {64} [65] ∈ {65} [66] ∈ {66} [67] ∈ {67} [68] ∈ {68} [69] ∈ {69} [70] ∈ {70} [71] ∈ {71} [72] ∈ {72} [73] ∈ {73} [74] ∈ {74} [75] ∈ {75} [76] ∈ {76} [77] ∈ {77} [78] ∈ {78} [79] ∈ {79} [80] ∈ {80} [81] ∈ {81} [82] ∈ {82} [83] ∈ {83} [84] ∈ {84} [85] ∈ {85} [86] ∈ {86} [87] ∈ {87} [88] ∈ {88} [89] ∈ {89} [90] ∈ {90} [91] ∈ {91} [92] ∈ {92} [93] ∈ {93} [94] ∈ {94} [95] ∈ {95} [96] ∈ {96} [97] ∈ {97} [98] ∈ {98} [99] ∈ {99} [100] ∈ {100} [101] ∈ {101} [102] ∈ {102} [103] ∈ {103} [104] ∈ {104} [105] ∈ {105} [106] ∈ {106} [107] ∈ {107} [108] ∈ {108} [109] ∈ {109} [110] ∈ {110} [111] ∈ {111} [112] ∈ {112} [113] ∈ {113} [114] ∈ {114} [115] ∈ {115} [116] ∈ {116} [117] ∈ {117} [118] ∈ {118} [119] ∈ {119} [120] ∈ {120} [121] ∈ {121} [122] ∈ {122} [123] ∈ {123} [124] ∈ {124} [125] ∈ {125} [126] ∈ {126} [127] ∈ {127} [128] ∈ {128} [129] ∈ {129} [130] ∈ {130} [131] ∈ {131} [132] ∈ {132} [133] ∈ {133} [134] ∈ {134} [135] ∈ {135} [136] ∈ {136} [137] ∈ {137} [138] ∈ {138} [139] ∈ {139} [140] ∈ {140} [141] ∈ {141} [142] ∈ {142} [143] ∈ {143} [144] ∈ {144} [145] ∈ {145} [146] ∈ {146} [147] ∈ {147} [148] ∈ {148} [149] ∈ {149} [150] ∈ {150} [151] ∈ {151} [152] ∈ {152} [153] ∈ {153} [154] ∈ {154} [155] ∈ {155} [156] ∈ {156} [157] ∈ {157} [158] ∈ {158} [159] ∈ {159} [160] ∈ {160} [161] ∈ {161} [162] ∈ {162} [163] ∈ {163} [164] ∈ {164} [165] ∈ {165} [166] ∈ {166} [167] ∈ {167} [168] ∈ {168} [169] ∈ {169} [170] ∈ {170} [171] ∈ {171} [172] ∈ {172} [173] ∈ {173} [174] ∈ {174} [175] ∈ {175} [176] ∈ {176} [177] ∈ {177} [178] ∈ {178} [179] ∈ {179} [180] ∈ {180} [181] ∈ {181} [182] ∈ {182} [183] ∈ {183} [184] ∈ {184} [185] ∈ {185} [186] ∈ {186} [187] ∈ {187} [188] ∈ {188} [189] ∈ {189} [190] ∈ {190} [191] ∈ {191} [192] ∈ {192} [193] ∈ {193} [194] ∈ {194} [195] ∈ {195} [196] ∈ {196} [197] ∈ {197} [198] ∈ {198} [199] ∈ {199} [200] ∈ {200} [201] ∈ {201} [202] ∈ {202} [203] ∈ {203} [204] ∈ {204} [205] ∈ {205} [206] ∈ {206} [207] ∈ {207} [208] ∈ {208} [209] ∈ {209} [210] ∈ {210} [211] ∈ {211} [212] ∈ {212} [213] ∈ {213} [214] ∈ {214} [215] ∈ {215} [216] ∈ {216} [217] ∈ {217} [218] ∈ {218} [219] ∈ {219} [220] ∈ {220} [221] ∈ {221} [222] ∈ {222} [223] ∈ {223} [224] ∈ {224} [225] ∈ {225} [226] ∈ {226} [227] ∈ {227} [228] ∈ {228} [229] ∈ {229} [230] ∈ {230} [231] ∈ {231} [232] ∈ {232} [233] ∈ {233} [234] ∈ {234} [235] ∈ {235} [236] ∈ {236} [237] ∈ {237} [238] ∈ {238} [239] ∈ {239} [240] ∈ {240} [241] ∈ {241} [242] ∈ {242} [243] ∈ {243} [244] ∈ {244} [245] ∈ {245} [246] ∈ {246} [247] ∈ {247} [248] ∈ {248} [249] ∈ {249} [250] ∈ {250} [251] ∈ {251} [252] ∈ {252} [253] ∈ {253} [254] ∈ {254} [255] ∈ {255} [256] ∈ {256} [257] ∈ {257} [258] ∈ {258} [259] ∈ {259} [260] ∈ {260} [261] ∈ {261} [262] ∈ {262} [263] ∈ {263} [264] ∈ {264} [265] ∈ {265} [266] ∈ {266} [267] ∈ {267} [268] ∈ {268} [269] ∈ {269} [270] ∈ {270} [271] ∈ {271} [272] ∈ {272} [273] ∈ {273} [274] ∈ {274} [275] ∈ {275} [276] ∈ {276} [277] ∈ {277} [278] ∈ {278} [279] ∈ {279} [280] ∈ {280} [281] ∈ {281} [282] ∈ {282} [283] ∈ {283} [284] ∈ {284} [285] ∈ {285} [286] ∈ {286} [287] ∈ {287} [288] ∈ {288} [289] ∈ {289} [290] ∈ {290} [291] ∈ {291} [292] ∈ {292} [293] ∈ {293} [294] ∈ {294} [295] ∈ {295} [296] ∈ {296} [297] ∈ {297} [298] ∈ {298} [299] ∈ {299} [300] ∈ {300} [301] ∈ {301} [302] ∈ {302} [303] ∈ {303} [304] ∈ {304} [305] ∈ {305} [306] ∈ {306} [307] ∈ {307} [308] ∈ {308} [309] ∈ {309} [310] ∈ {310} [311] ∈ {311} [312] ∈ {312} [313] ∈ {313} [314] ∈ {314} [315] ∈ {315} [316] ∈ {316} [317] ∈ {317} [318] ∈ {318} [319] ∈ {319} [320] ∈ {320} [321] ∈ {321} [322] ∈ {322} [323] ∈ {323} [324] ∈ {324} [325] ∈ {325} [326] ∈ {326} [327] ∈ {327} [328] ∈ {328} [329] ∈ {329} [330] ∈ {330} [331] ∈ {331} [332] ∈ {332} [333] ∈ {333} [334] ∈ {334} [335] ∈ {335} [336] ∈ {336} [337] ∈ {337} [338] ∈ {338} [339] ∈ {339} [340] ∈ {340} [341] ∈ {341} [342] ∈ {342} [343] ∈ {343} [344] ∈ {344} [345] ∈ {345} [346] ∈ {346} [347] ∈ {347} [348] ∈ {348} [349] ∈ {349} [350] ∈ {350} [351] ∈ {351} [352] ∈ {352} [353] ∈ {353} [354] ∈ {354} [355] ∈ {355} [356] ∈ {356} [357] ∈ {357} [358] ∈ {358} [359] ∈ {359} [360] ∈ {360} [361] ∈ {361} [362] ∈ {362} [363] ∈ {363} [364] ∈ {364} [365] ∈ {365} [366] ∈ {366} [367] ∈ {367} [368] ∈ {368} [369] ∈ {369} [370] ∈ {370} [371] ∈ {371} [372] ∈ {372} [373] ∈ {373} [374] ∈ {374} [375] ∈ {375} [376] ∈ {376} [377] ∈ {377} [378] ∈ {378} [379] ∈ {379} [380] ∈ {380} [381] ∈ {381} [382] ∈ {382} [383] ∈ {383} [384] ∈ {384} [385] ∈ {385} [386] ∈ {386} [387] ∈ {387} [388] ∈ {388} [389] ∈ {389} [390] ∈ {390} [391] ∈ {391} [392] ∈ {392} [393] ∈ {393} [394] ∈ {394} [395] ∈ {395} [396] ∈ {396} [397] ∈ {397} [398] ∈ {398} [399] ∈ {399} [400] ∈ {400} [401] ∈ {401} [402] ∈ {402} [403] ∈ {403} [404] ∈ {404} [405] ∈ {405} [406] ∈ {406} [407] ∈ {407} [408] ∈ {408} [409] ∈ {409} [410] ∈ {410} [411] ∈ {411} [412] ∈ {412} [413] ∈ {413} [414] ∈ {414} [415] ∈ {415} [416] ∈ {416} [417] ∈ {417} [418] ∈ {418} [419] ∈ {419} [420] ∈ {420} [421] ∈ {421} [422] ∈ {422} [423] ∈ {423} [424] ∈ {424} [425] ∈ {425} [426] ∈ {426} [427] ∈ {427} [428] ∈ {428} [429] ∈ {429} [430] ∈ {430} [431] ∈ {431} [432] ∈ {432} [433] ∈ {433} [434] ∈ {434} [435] ∈ {435} [436] ∈ {436} [437] ∈ {437} [438] ∈ {438} [439] ∈ {439} [440] ∈ {440} [441] ∈ {441} [442] ∈ {442} [443] ∈ {443} [444] ∈ {444} [445] ∈ {445} [446] ∈ {446} [447] ∈ {447} [448] ∈ {448} [449] ∈ {449} [450] ∈ {450} [451] ∈ {451} [452] ∈ {452} [453] ∈ {453} [454] ∈ {454} [455] ∈ {455} [456] ∈ {456} [457] ∈ {457} [458] ∈ {458} [459] ∈ {459} [460] ∈ {460} [461] ∈ {461} [462] ∈ {462} [463] ∈ {463} [464] ∈ {464} [465] ∈ {465} [466] ∈ {466} [467] ∈ {467} [468] ∈ {468} [469] ∈ {469} [470] ∈ {470} [471] ∈ {471} [472] ∈ {472} [473] ∈ {473} [474] ∈ {474} [475] ∈ {475} [476] ∈ {476} [477] ∈ {477} [478] ∈ {478} [479] ∈ {479} [480] ∈ {480} [481] ∈ {481} [482] ∈ {482} [483] ∈ {483} [484] ∈ {484} [485] ∈ {485} [486] ∈ {486} [487] ∈ {487} [488] ∈ {488} [489] ∈ {489} [490] ∈ {490} [491] ∈ {491} [492] ∈ {492} [493] ∈ {493} [494] ∈ {494} [495] ∈ {495} [496] ∈ {496} [497] ∈ {497} [498] ∈ {498} [499] ∈ {499} [500] ∈ {500} [501] ∈ {501} [502] ∈ {502} [503] ∈ {503} [504] ∈ {504} [505] ∈ {505} [506] ∈ {506} [507] ∈ {507} [508] ∈ {508} [509] ∈ {509} [510] ∈ {510} [511] ∈ {511} [512] ∈ {512} [513] ∈ {513} [514] ∈ {514} [515] ∈ {515} [516] ∈ {516} [517] ∈ {517} [518] ∈ {518} [519] ∈ {519} [520] ∈ {520} [521] ∈ {521} [522] ∈ {522} [523] ∈ {523} [524] ∈ {524} [525] ∈ {525} [526] ∈ {526} [527] ∈ {527} [528] ∈ {528} [529] ∈ {529} [530] ∈ {530} [531] ∈ {531} [532] ∈ {532} [533] ∈ {533} [534] ∈ {534} [535] ∈ {535} [536] ∈ {536} [537] ∈ {537} [538] ∈ {538} [539] ∈ {539} [540] ∈ {540} [541] ∈ {541} [542] ∈ {542} [543] ∈ {543} [544] ∈ {544} [545] ∈ {545} [546] ∈ {546} [547] ∈ {547} [548] ∈ {548} [549] ∈ {549} [550] ∈ {550} [551] ∈ {551} [552] ∈ {552} [553] ∈ {553} [554] ∈ {554} [555] ∈ {555} [556] ∈ {556} [557] ∈ {557} [558] ∈ {558} [559] ∈ {559} [560] ∈ {560} [561] ∈ {561} [562] ∈ {562} [563] ∈ {563} [564] ∈ {564} [565] ∈ {565} [566] ∈ {566} [567] ∈ {567} [568] ∈ {568} [569] ∈ {569} [570] ∈ {570} [571] ∈ {571} [572] ∈ {572} [573] ∈ {573} [574] ∈ {574} [575] ∈ {575} [576] ∈ {576} [577] ∈ {577} [578] ∈ {578} [579] ∈ {579} [580] ∈ {580} [581] ∈ {581} [582] ∈ {582} [583] ∈ {583} [584] ∈ {584} [585] ∈ {585} [586] ∈ {586} [587] ∈ {587} [588] ∈ {588} [589] ∈ {589} [590] ∈ {590} [591] ∈ {591} [592] ∈ {592} [593] ∈ {593} [594] ∈ {594} [595] ∈ {595} [596] ∈ {596} [597] ∈ {597} [598] ∈ {598} [599] ∈ {599} [600] ∈ {600} [601] ∈ {601} [602] ∈ {602} [603] ∈ {603} [604] ∈ {604} [605] ∈ {605} [606] ∈ {606} [607] ∈ {607} [608] ∈ {608} [609] ∈ {609} [610] ∈ {610} [611] ∈ {611} [612] ∈ {612} [613] ∈ {613} [614] ∈ {614} [615] ∈ {615} [616] ∈ {616} [617] ∈ {617} [618] ∈ {618} [619] ∈ {619} [620] ∈ {620} [621] ∈ {621} [622] ∈ {622} [623] ∈ {623} [624] ∈ {624} [625] ∈ {625} [626] ∈ {626} [627] ∈ {627} [628] ∈ {628} [629] ∈ {629} [630] ∈ {630} [631] ∈ {631} [632] ∈ {632} [633] ∈ {633} [634] ∈ {634} [635] ∈ {635} [636] ∈ {636} [637] ∈ {637} [638] ∈ {638} [639] ∈ {639} [640] ∈ {640} [641] ∈ {641} [642] ∈ {642} [643] ∈ {643} [644] ∈ {644} [645] ∈ {645} [646] ∈ {646} [647] ∈ {647} [648] ∈ {648} [649] ∈ {649} [650] ∈ {650} [651] ∈ {651} [652] ∈ {652} [653] ∈ {653} [654] ∈ {654} [655] ∈ {655} [656] ∈ {656} [657] ∈ {657} [658] ∈ {658} [659] ∈ {659} [660] ∈ {660} [661] ∈ {661} [662] ∈ {662} [663] ∈ {663} [664] ∈ {664} [665] ∈ {665} [666] ∈ {666} [667] ∈ {667} [668] ∈ {668} [669] ∈ {669} [670] ∈ {670} [671] ∈ {671} [672] ∈ {672} [673] ∈ {673} [674] ∈ {674} [675] ∈ {675} [676] ∈ {676} [677] ∈ {677} [678] ∈ {678} [679] ∈ {679} [680] ∈ {680} [681] ∈ {681} [682] ∈ {682} [683] ∈ {683} [684] ∈ {684} [685] ∈ {685} [686] ∈ {686} [687] ∈ {687} [688] ∈ {688} [689] ∈ {689} [690] ∈ {690} [691] ∈ {691} [692] ∈ {692} [693] ∈ {693} [694] ∈ {694} [695] ∈ {695} [696] ∈ {696} [697] ∈ {697} [698] ∈ {698} [699] ∈ {699} [700] ∈ {700} [701] ∈ {701} [702] ∈ {702} [703] ∈ {703} [704] ∈ {704} [705] ∈ {705} [706] ∈ {706} [707] ∈ {707} [708] ∈ {708} [709] ∈ {709} [710] ∈ {710} [711] ∈ {711} [712] ∈ {712} [713] ∈ {713} [714] ∈ {714} [715] ∈ {715} [716] ∈ {716} [717] ∈ {717} [718] ∈ {718} [719] ∈ {719} [720] ∈ {720} [721] ∈ {721} [722] ∈ {722} [723] ∈ {723} [724] ∈ {724} [725] ∈ {725} [726] ∈ {726} [727] ∈ {727} [728] ∈ {728} [729] ∈ {729} [730] ∈ {730} [731] ∈ {731} [732] ∈ {732} [733] ∈ {733} [734] ∈ {734} [735] ∈ {735} [736] ∈ {736} [737] ∈ {737} [738] ∈ {738} [739] ∈ {739} [740] ∈ {740} [741] ∈ {741} [742] ∈ {742} [743] ∈ {743} [744] ∈ {744} [745] ∈ {745} [746] ∈ {746} [747] ∈ {747} [748] ∈ {748} [749] ∈ {749} [750] ∈ {750} [751] ∈ {751} [752] ∈ {752} [753] ∈ {753} [754] ∈ {754} [755] ∈ {755} [756] ∈ {756} [757] ∈ {757} [758] ∈ {758} [759] ∈ {759} [760] ∈ {760} [761] ∈ {761} [762] ∈ {762} [763] ∈ {763} [764] ∈ {764} [765] ∈ {765} [766] ∈ {766} [767] ∈ {767} [768] ∈ {768} [769] ∈ {769} [770] ∈ {770} [771] ∈ {771} [772] ∈ {772} [773] ∈ {773} [774] ∈ {774} [775] ∈ {775} [776] ∈ {776} [777] ∈ {777} [778] ∈ {778} [779] ∈ {779} [780] ∈ {780} [781] ∈ {781} [782] ∈ {782} [783] ∈ {783} [784] ∈ {784} [785] ∈ {785} [786] ∈ {786} [787] ∈ {787} [788] ∈ {788} [789] ∈ {789} [790] ∈ {790} [791] ∈ {791} [792] ∈ {792} [793] ∈ {793} [794] ∈ {794} [795] ∈ {795} [796] ∈ {796} [797] ∈ {797} [798] ∈ {798} [799] ∈ {799} [800] ∈ {800} [801] ∈ {801} [802] ∈ {802} [803] ∈ {803} [804] ∈ {804} [805] ∈ {805} [806] ∈ {806} [807] ∈ {807} [808] ∈ {808} [809] ∈ {809} [810] ∈ {810} [811] ∈ {811} [812] ∈ {812} [813] ∈ {813} [814] ∈ {814} [815] ∈ {815} [816] ∈ {816} [817] ∈ {817} [818] ∈ {818} [819] ∈ {819} [820] ∈ {820} [821] ∈ {821} [822] ∈ {822} [823] ∈ {823} [824] ∈ {824} [825] ∈ {825} [826] ∈ {826} [827] ∈ {827} [828] ∈ {828} [829] ∈ {829} [830] ∈ {830} [831] ∈ {831} [832] ∈ {832} [833] ∈ {833} [834] ∈ {834} [835] ∈ {835} [836] ∈ {836} [837] ∈ {837} [838] ∈ {838} [839] ∈ {839} [840] ∈ {840} [841] ∈ {841} [842] ∈ {842} [843] ∈ {843} [844] ∈ {844} [845] ∈ {845} [846] ∈ {846} [847] ∈ {847} [848] ∈ {848} [849] ∈ {849} [850] ∈ {850} [851] ∈ {851} [852] ∈ {852} [853] ∈ {853} [854] ∈ {854} [855] ∈ {855} [856] ∈ {856} [857] ∈ {857} [858] ∈ {858} [859] ∈ {859} [860] ∈ {860} [861] ∈ {861} [862] ∈ {862} [863] ∈ {863} [864] ∈ {864} [865] ∈ {865} [866] ∈ {866} [867] ∈ {867} [868] ∈ {868} [869] ∈ {869} [870] ∈ {870} [871] ∈ {871} [872] ∈ {872} [873] ∈ {873} [874] ∈ {874} [875] ∈ {875} [876] ∈ {876} [877] ∈ {877} [878] ∈ {878} [879] ∈ {879} [880] ∈ {880} [881] ∈ {881} [882] ∈ {882} [883] ∈ {883} [884] ∈ {884} [885] ∈ {885} [886] ∈ {886} [887] ∈ {887} [888] ∈ {888} [889] ∈ {889} [890] ∈ {890} [891] ∈ {891} [892] ∈ {892} [893] ∈ {893} [894] ∈ {894} [895] ∈ {895} [896] ∈ {896} [897] ∈ {897} [898] ∈ {898} [899] ∈ {899} [900] ∈ {900} [901] ∈ {901} [902] ∈ {902} [903] ∈ {903} [904] ∈ {904} [905] ∈ {905} [906] ∈ {906} [907] ∈ {907} [908] ∈ {908} [909] ∈ {909} [910] ∈ {910} [911] ∈ {911} [912] ∈ {912} [913] ∈ {913} [914] ∈ {914} [915] ∈ {915} [916] ∈ {916} [917] ∈ {917} [918] ∈ {918} [919] ∈ {919} [920] ∈ {920} [921] ∈ {921} [922] ∈ {922} [923] ∈ {923} [924] ∈ {924} [925] ∈ {925} [926] ∈ {926} [927] ∈ {927} [928] ∈ {928} [929] ∈ {929} [930] ∈ {930} [931] ∈ {931} [932] ∈ {932} [933] ∈ {933} [934] ∈ {934} [935] ∈ {935} [936] ∈ {936} [937] ∈ {937} [938] ∈ {938} [939] ∈ {939} [940] ∈ {940} [941] ∈ {941} [942] ∈ {942} [943] ∈ {943} [944] ∈ {944} [945] ∈ {945} [946] ∈ {946} [947] ∈ {947} [948] ∈ {948} [949] ∈ {949} [950] ∈ {950} [951] ∈ {951} [952] ∈ {952} [953] ∈ {953} [954] ∈ {954} [955] ∈ {955} [956] ∈ {956} [957] ∈ {957} [958] ∈ {958} [959] ∈ {959} [960] ∈ {960} [961] ∈ {961} [962] ∈ {962} [963] ∈ {963} [964] ∈ {964} [965] ∈ {965} [966] ∈ {966} [967] ∈ {967} [968] ∈ {968} [969] ∈ {969} [970] ∈ {970} [971] ∈ {971} [972] ∈ {972} [973] ∈ {973} [974] ∈ {974} [975] ∈ {975} [976] ∈ {976} [977] ∈ {977} [978] ∈ {978} [979] ∈ {979} [980] ∈ {980} [981] ∈ {981} [982] ∈ {982} [983] ∈ {983} [984] ∈ {984} [985] ∈ {985} [986] ∈ {986} [987] ∈ {987} [988] ∈ {988} [989] ∈ {989} [990] ∈ {990} [991] ∈ {991} [992] ∈ {992} [993] ∈ {993} [994] ∈ {994} [995] ∈ {995} [996] ∈ {996} [997] ∈ {997} [998] ∈ {998} [999] ∈ {999} [1000] ∈ {1000} [1001] ∈ {1001} [1002] ∈ {1002} [1003] ∈ {1003} [1004] ∈ {1004} [1005] ∈ {1005} [1006] ∈ {1006} [1007] ∈ {1007} [1008] ∈ {1008} [1009] ∈ {1009} [1010] ∈ {1010} [1011] ∈ {1011} [1012] ∈ {1012} [1013] ∈ {1013} [1014] ∈ {1014} [1015] ∈ {1015} [1016] ∈ {1016} [1017] ∈ {1017} [1018] ∈ {1018} [1019] ∈ {1019} [1020] ∈ {1020} [1021] ∈ {1021} [1022] ∈ {1022} [1023] ∈ {1023} [1024] ∈ {1024} [1025] ∈ {1025} [1026] ∈ {1026} [1027] ∈ {1027} [1028] ∈ {1028} [1029] ∈ {1029} [1030] ∈ {1030} [1031] ∈ {1031} [1032] ∈ {1032} [1033] ∈ {1033} [1034] ∈ {1034} [1035] ∈ {1035} [1036] ∈ {1036} [1037] ∈ {1037} [1038] ∈ {1038} [1039] ∈ {1039} [1040] ∈ {1040} [1041] ∈ {1041} [1042] ∈ {1042} [1043] ∈ {1043} [1044] ∈ {1044} [1045] ∈ {1045} [1046] ∈ {1046} [1047] ∈ {1047} [1048] ∈ {1048} [1049] ∈ {1049} [1050] ∈ {1050} [1051] ∈ {1051} [1052] ∈ {1052} [1053] ∈ {1053} [1054] ∈ {1054} [1055] ∈ {1055} [1056] ∈ {1056} [1057] ∈ {1057} [1058] ∈ {1058} [1059] ∈ {1059} [1060] ∈ {1060} [1061] ∈ {1061} [1062] ∈ {1062} [1063] ∈ {1063} [1064] ∈ {1064} [1065] ∈ {1065} [1066] ∈ {1066} [1067] ∈ {1067} [1068] ∈ {1068} [1069] ∈ {1069} [1070] ∈ {1070} [1071] ∈ {1071} [1072] ∈ {1072} [1073] ∈ {1073} [1074] ∈ {1074} [1075] ∈ {1075} [1076] ∈ {1076} [1077] ∈ {1077} [1078] ∈ {1078} [1079] ∈ {1079} [1080] ∈ {1080} [1081] ∈ {1081} [1082] ∈ {1082} [1083] ∈ {1083} [1084] ∈ {1084} [1085] ∈ {1085} [1086] ∈ {1086} [1087] ∈ {1087} [1088] ∈ {1088} [1089] ∈ {1089} [1090] ∈ {1090} [1091] ∈ {1091} [1092] ∈ {1092} [1093] ∈ {1093} [1094] ∈ {1094} [1095] ∈ {1095} [1096] ∈ {1096} [1097] ∈ {1097} [1098] ∈ {1098} [1099] ∈ {1099} [1100] ∈ {1100} [1101] ∈ {1101} [1102] ∈ {1102} [1103] ∈ {1103} [1104] ∈ {1104} [1105] ∈ {1105} [1106] ∈ {1106} [1107] ∈ {1107} [1108] ∈ {1108} [1109] ∈ {1109} [1110] ∈ {1110} [1111] ∈ {1111} [1112] ∈ {1112} [1113] ∈ {1113} [1114] ∈ {1114} [1115] ∈ {1115} [1116] ∈ {1116} [1117] ∈ {1117} [1118] ∈ {1118} [1119] ∈ {1119} [1120] ∈ {1120} [1121] ∈ {1121} [1122] ∈ {1122} [1123] ∈ {1123} [1124] ∈ {1124} [1125] ∈ {1125} [1126] ∈ {1126} [1127] ∈ {1127} [1128] ∈ {1128} [1129] ∈ {1129} [1130] ∈ {1130} [1131] ∈ {1131} [1132] ∈ {1132} [1133] ∈ {1133} [1134] ∈ {1134} [1135] ∈ {1135} [1136] ∈ {1136} [1137] ∈ {1137} [1138] ∈ {1138} [1139] ∈ {1139} [1140] ∈ {1140} [1141] ∈ {1141} [1142] ∈ {1142} [1143] ∈ {1143} [1144] ∈ {1144} [1145] ∈ {1145} [1146] ∈ {1146} [1147] ∈ {1147} [1148] ∈ {1148} [1149] ∈ {1149} [1150] ∈ {1150} [1151] ∈ {1151} [1152] ∈ {1152} [1153] ∈ {1153} [1154] ∈ {1154} [1155] ∈ {1155} [1156] ∈ {1156} [1157] ∈ {1157} [1158] ∈ {1158} [1159] ∈ {1159} [1160] ∈ {1160} [1161] ∈ {1161} [1162] ∈ {1162} [1163] ∈ {1163} [1164] ∈ {1164} [1165] ∈ {1165} [1166] ∈ {1166} [1167] ∈ {1167} [1168] ∈ {1168} [1169] ∈ {1169} [1170] ∈ {1170} [1171] ∈ {1171} [1172] ∈ {1172} [1173] ∈ {1173} [1174] ∈ {1174} [1175] ∈ {1175} [1176] ∈ {1176} [1177] ∈ {1177} [1178] ∈ {1178} [1179] ∈ {1179} [1180] ∈ {1180} [1181] ∈ {1181} [1182] ∈ {1182} [1183] ∈ {1183} [1184] ∈ {1184} [1185] ∈ {1185} [1186] ∈ {1186} [1187] ∈ {1187} [1188] ∈ {1188} [1189] ∈ {1189} [1190] ∈ {1190} [1191] ∈ {1191} [1192] ∈ {1192} [1193] ∈ {1193} [1194] ∈ {1194} [1195] ∈ {1195} [1196] ∈ {1196} [1197] ∈ {1197} [1198] ∈ {1198} [1199] ∈ {1199} [1200] ∈ {1200} [1201] ∈ {1201} [1202] ∈ {1202} [1203] ∈ {1203} [1204] ∈ {1204} [1205] ∈ {1205} [1206] ∈ {1206} [1207] ∈ {1207} [1208] ∈ {1208} [1209] ∈ {1209} [1210] ∈ {1210} [1211] ∈ {1211} [1212] ∈ {1212} [1213] ∈ {1213} [1214] ∈ {1214} [1215] ∈ {1215} [1216] ∈ {1216} [1217] ∈ {1217} [1218] ∈ {1218} [1219] ∈ {1219} [1220] ∈ {1220} [1221] ∈ {1221} [1222] ∈ {1222} [1223] ∈ {1223} [1224] ∈ {1224} [1225] ∈ {1225} [1226] ∈ {1226} [1227] ∈ {1227} [1228] ∈ {1228} [1229] ∈ {1229} [1230] ∈ {1230} [1231] ∈ {1231} [1232] ∈ {1232} [1233] ∈ {1233} [1234] ∈ {1234} [1235] ∈ {1235} [1236] ∈ {1236} [1237] ∈ {1237} [1238] ∈ {1238} [1239] ∈ {1239} [1240] ∈ {1240} [1241] ∈ {1241} [1242] ∈ {1242} [1243] ∈ {1243} [1244] ∈ {1244} [1245] ∈ {1245} [1246] ∈ {1246} [1247] ∈ {1247} [1248] ∈ {1248} [1249] ∈ {1249} [1250] ∈ {1250} [1251] ∈ {1251} [1252] ∈ {1252} [1253] ∈ {1253} [1254] ∈ {1254} [1255] ∈ {1255} [1256] ∈ {1256} [1257] ∈ {1257} [1258] ∈ {1258} [1259] ∈ {1259} [1260] ∈ {1260} [1261] ∈ {1261} [1262] ∈ {1262} [1263] ∈ {1263} [1264] ∈ {1264} [1265] ∈ {1265} [1266] ∈ {1266} [1267] ∈ {1267} [1268] ∈ {1268} [1269] ∈ {1269} [1270] ∈ {1270} [1271] ∈ {1271} [1272] ∈ {1272} [1273] ∈ {1273} [1274] ∈ {1274} [1275] ∈ {1275} [1276] ∈ {1276} [1277] ∈ {1277} [1278] ∈ {1278} [1279] ∈ {1279} [1280] ∈ {1280} [1281] ∈ {1281} [1282] ∈ {1282} [1283] ∈ {1283} [1284] ∈ {1284} [1285] ∈ {1285} [1286] ∈ {1286} [1287] ∈ {1287} [1288] ∈ {1288} [1289] ∈ {1289} [1290] ∈ {1290} [1291] ∈ {1291} [1292] ∈ {1292} [1293] ∈ {1293} [1294] ∈ {1294} [1295] ∈ {1295} [1296] ∈ {1296} [1297] ∈ {1297} [1298] ∈ {1298} [1299] ∈ {1299} [1300] ∈ {1300} [1301] ∈ {1301} [1302] ∈ {1302} [1303] ∈ {1303} [1304] ∈ {1304} [1305] ∈ {1305} [1306] ∈ {1306} [1307] ∈ {1307} [1308] ∈ {1308} [1309] ∈ {1309} [1310] ∈ {1310} [1311] ∈ {1311} [1312] ∈ {1312} [1313] ∈ {1313} [1314] ∈ {1314} [1315] ∈ {1315} [1316] ∈ {1316} [1317] ∈ {1317} [1318] ∈ {1318} [1319] ∈ {1319} [1320] ∈ {1320} [1321] ∈ {1321} [1322] ∈ {1322} [1323] ∈ {1323} [1324] ∈ {1324} [1325] ∈ {1325} [1326] ∈ {1326} [1327] ∈ {1327} [1328] ∈ {1328} [1329] ∈ {1329} [1330] ∈ {1330} [1331] ∈ {1331} [1332] ∈ {1332} [1333] ∈ {1333} [1334] ∈ {1334} [1335] ∈ {1335} [1336] ∈ {1336} [1337] ∈ {1337} [1338] ∈ {1338} [1339] ∈ {1339} [1340] ∈ {1340} [1341] ∈ {1341} [1342] ∈ {1342} [1343] ∈ {1343} [1344] ∈ {1344} [1345] ∈ {1345} [1346] ∈ {1346} [1347] ∈ {1347} [1348] ∈ {1348} [1349] ∈ {1349} [1350] ∈ {1350} [1351] ∈ {1351} [1352] ∈ {1352} [1353] ∈ {1353} [1354] ∈ {1354} [1355] ∈ {1355} [1356] ∈ {1356} [1357] ∈ {1357} [1358] ∈ {1358} [1359] ∈ {1359} [1360] ∈ {1360} [1361] ∈ {1361} [1362] ∈ {1362} [1363] ∈ {1363} [1364] ∈ {1364} [1365] ∈ {1365} [1366] ∈ {1366} [1367] ∈ {1367} [1368] ∈ {1368} [1369] ∈ {1369} [1370] ∈ {1370} [1371] ∈ {1371} [1372] ∈ {1372} [1373] ∈ {1373} [1374] ∈ {1374} [1375] ∈ {1375} [1376] ∈ {1376} [1377] ∈ {1377} [1378] ∈ {1378} [1379] ∈ {1379} [1380] ∈ {1380} [1381] ∈ {1381} [1382] ∈ {1382} [1383] ∈ {1383} [1384] ∈ {1384} [1385] ∈ {1385} [1386] ∈ {1386} [1387] ∈ {1387} [1388] ∈ {1388} [1389] ∈ {1389} [1390] ∈ {1390} [1391] ∈ {1391} [1392] ∈ {1392} [1393] ∈ {1393} [1394] ∈ {1394} [1395] ∈ {1395} [1396] ∈ {1396} [1397] ∈ {1397} [1398] ∈ {1398} [1399] ∈ {1399} [1400] ∈ {1400} [1401] ∈ {1401} [1402] ∈ {1402} [1403] ∈ {1403} [1404] ∈ {1404} [1405] ∈ {1405} [1406] ∈ {1406} [1407] ∈ {1407} [1408] ∈ {1408} [1409] ∈ {1409} [1410] ∈ {1410} [1411] ∈ {1411} [1412] ∈ {1412} [1413] ∈ {1413} [1414] ∈ {1414} [1415] ∈ {1415} [1416] ∈ {1416} [1417] ∈ {1417} [1418] ∈ {1418} [1419] ∈ {1419} [1420] ∈ {1420} [1421] ∈ {1421} [1422] ∈ {1422} [1423] ∈ {1423} [1424] ∈ {1424} [1425] ∈ {1425} [1426] ∈ {1426} [1427] ∈ {1427} [1428] ∈ {1428} [1429] ∈ {1429} [1430] ∈ {1430} [1431] ∈ {1431} [1432] ∈ {1432} [1433] ∈ {1433} [1434] ∈ {1434} [1435] ∈ {1435} [1436] ∈ {1436} [1437] ∈ {1437} [1438] ∈ {1438} [1439] ∈ {1439} [1440] ∈ {1440} [1441] ∈ {1441} [1442] ∈ {1442} [1443] ∈ {1443} [1444] ∈ {1444} [1445] ∈ {1445} [1446] ∈ {1446} [1447] ∈ {1447} [1448] ∈ {1448} [1449] ∈ {1449} [1450] ∈ {1450} [1451] ∈ {1451} [1452] ∈ {1452} [1453] ∈ {1453} [1454] ∈ {1454} [1455] ∈ {1455} [1456] ∈ {1456} [1457] ∈ {1457} [1458] ∈ {1458} [1459] ∈ {1459} [1460] ∈ {1460} [1461] ∈ {1461} [1462] ∈ {1462} [1463] ∈ {1463} [1464] ∈ {1464} [1465] ∈ {1465} [1466] ∈ {1466} [1467] ∈ {1467} [1468] ∈ {1468} [1469] ∈ {1469} [1470] ∈ {1470} [1471] ∈ {1471} [1472] ∈ {1472} [1473] ∈ {1473} [1474] ∈ {1474} [1475] ∈ {1475} [1476] ∈ {1476} [1477] ∈ {1477} [1478] ∈ {1478} [1479] ∈ {1479} [1480] ∈ {1480} [1481] ∈ {1481} [1482] ∈ {1482} [1483] ∈ {1483} [1484] ∈ {1484} [1485] ∈ {1485} [1486] ∈ {1486} [1487] ∈ {1487} [1488] ∈ {1488} [1489] ∈ {1489} [1490] ∈ {1490} [1491] ∈ {1491} [1492] ∈ {1492} [1493] ∈ {1493} [1494] ∈ {1494} [1495] ∈ {1495} [1496] ∈ {1496} [1497] ∈ {1497} [1498] ∈ {1498} [1499] ∈ {1499} [1500] ∈ {1500} [1501] ∈ {1501} [1502] ∈ {1502} [1503] ∈ {1503} [1504] ∈ {1504} [1505] ∈ {1505} [1506] ∈ {1506} [1507] ∈ {1507} [1508] ∈ {1508} [1509] ∈ {1509} [1510] ∈ {1510} [1511] ∈ {1511} [1512] ∈ {1512} [1513] ∈ {1513} [1514] ∈ {1514} [1515] ∈ {1515} [1516] ∈ {1516} [1517] ∈ {1517} [1518] ∈ {1518} [1519] ∈ {1519} [1520] ∈ {1520} [1521] ∈ {1521} [1522] ∈ {1522} [1523] ∈ {1523} [1524] ∈ {1524} [1525] ∈ {1525} [1526] ∈ {1526} [1527] ∈ {1527} [1528] ∈ {1528} [1529] ∈ {1529} [1530] ∈ {1530} [1531] ∈ {1531} [1532] ∈ {1532} [1533] ∈ {1533} [1534] ∈ {1534} [1535] ∈ {1535} [1536] ∈ {1536} [1537] ∈ {1537} [1538] ∈ {1538} [1539] ∈ {1539} [1540] ∈ {1540} [1541] ∈ {1541} [1542] ∈ {1542} [1543] ∈ {1543} [1544] ∈ {1544} [1545] ∈ {1545} [1546] ∈ {1546} [1547] ∈ {1547} [1548] ∈ {1548} [1549] ∈ {1549} [1550] ∈ {1550} [1551] ∈ {1551} [1552] ∈ {1552} [1553] ∈ {1553} [1554] ∈ {1554} [1555] ∈ {1555} [1556] ∈ {1556} [1557] ∈ {1557} [1558] ∈ {1558} [1559] ∈ {1559} [1560] ∈ {1560} [1561] ∈ {1561} [1562] ∈ {1562} [1563] ∈ {1563} [1564] ∈ {1564} [1565] ∈ {1565} [1566] ∈ {1566} [1567] ∈ {1567} [1568] ∈ {1568} [1569] ∈ {1569} [1570] ∈ {1570} [1571] ∈ {1571} [1572] ∈ {1572} [1573] ∈ {1573} [1574] ∈ {1574} [1575] ∈ {1575} [1576] ∈ {1576} [1577] ∈ {1577} [1578] ∈ {1578} [1579] ∈ {1579} [1580] ∈ {1580} [1581] ∈ {1581} [1582] ∈ {1582} [1583] ∈ {1583} [1584] ∈ {1584} [1585] ∈ {1585} [1586] ∈ {1586} [1587] ∈ {1587} [1588] ∈ {1588} [1589] ∈ {1589} [1590] ∈ {1590} [1591] ∈ {1591} [1592] ∈ {1592} [1593] ∈ {1593} [1594] ∈ {1594} [1595] ∈ {1595} [1596] ∈ {1596} [1597] ∈ {1597} [1598] ∈ {1598} [1599] ∈ {1599} [1600] ∈ {1600} [1601] ∈ {1601} [1602] ∈ {1602} [1603] ∈ {1603} [1604] ∈ {1604} [1605] ∈ {1605} [1606] ∈ {1606} [1607] ∈ {1607} [1608] ∈ {1608} [1609] ∈ {1609} [1610] ∈ {1610} [1611] ∈ {1611} [1612] ∈ {1612} [1613] ∈ {1613} [1614] ∈ {1614} [1615] ∈ {1615} [1616] ∈ {1616} [1617] ∈ {1617} [1618] ∈ {1618} [1619] ∈ {1619} [1620] ∈ {1620} [1621] ∈ {1621} [1622] ∈ {1622} [1623] ∈ {1623} [1624] ∈ {1624} [1625] ∈ {1625} [1626] ∈ {1626} [1627] ∈ {1627} [1628] ∈ {1628} [1629] ∈ {1629} [1630] ∈ {1630} [1631] ∈ {1631} [1632] ∈ {1632} [1633] ∈ {1633} [1634] ∈ {1634} [1635] ∈ {1635} [1636] ∈ {1636} [1637] ∈ {1637} [1638] ∈ {1638} [1639] ∈ {1639} [1640] ∈ {1640} [1641] ∈ {1641} [1642] ∈ {1642} [1643] ∈ {1643} [1644] ∈ {1644} [1645] ∈ {1645} [1646] ∈ {1646} [1647] ∈ {1647} [1648] ∈ {1648} [1649] ∈ {1649} [1650] ∈ {1650} [1651] ∈ {1651} [1652] ∈ {1652} [1653] ∈ {1653} [1654] ∈ {1654} [1655] ∈ {1655} [1656] ∈ {1656} [1657] ∈ {1657} [1658] ∈ {1658} [1659] ∈ {1659} [1660] ∈ {1660} [1661] ∈ {1661} [1662] ∈ {1662} [1663] ∈ {1663} [1664] ∈ {1664} [1665] ∈ {1665} [1666] ∈ {1666} [1667] ∈ {1667} [1668] ∈ {1668} [1669] ∈ {1669} [1670] ∈ {1670} [1671] ∈ {1671} [1672] ∈ {1672} [1673] ∈ {1673} [1674] ∈ {1674} [1675] ∈ {1675} [1676] ∈ {1676} [1677] ∈ {1677} [1678] ∈ {1678} [1679] ∈ {1679} [1680] ∈ {1680} [1681] ∈ {1681} [1682] ∈ {1682} [1683] ∈ {1683} [1684] ∈ {1684} [1685] ∈ {1685} [1686] ∈ {1686} [1687] ∈ {1687} [1688] ∈ {1688} [1689] ∈ {1689} [1690] ∈ {1690} [1691] ∈ {1691} [1692] ∈ {1692} [1693] ∈ {1693} [1694] ∈ {1694} [1695] ∈ {1695} [1696] ∈ {1696} [1697] ∈ {1697} [1698] ∈ {1698} [1699] ∈ {1699} [1700] ∈ {1700} [1701] ∈ {1701} [1702] ∈ {1702} [1703] ∈ {1703} [1704] ∈ {1704} [1705] ∈ {1705} [1706] ∈ {1706} [1707] ∈ {1707} [1708] ∈ {1708} [1709] ∈ {1709} [1710] ∈ {1710} [1711] ∈ {1711} [1712] ∈ {1712} [1713] ∈ {1713} [1714] ∈ {1714} [1715] ∈ {1715} [1716] ∈ {1716} [1717] ∈ {1717} [1718] ∈ {1718} [1719] ∈ {1719} [1720] ∈ {1720} [1721] ∈ {1721} [1722] ∈ {1722} [1723] ∈ {1723} [1724] ∈ {1724} [1725] ∈ {1725} [1726] ∈ {1726} [1727] ∈ {1727} [1728] ∈ {1728} [1729] ∈ {1729} [1730] ∈ {1730} [1731] ∈ {1731} [1732] ∈ {1732} [1733] ∈ {1733} [1734] ∈ {1734} [1735] ∈ {1735} [1736] ∈ {1736} [1737] ∈ {1737} [1738] ∈ {1738} [1739] ∈ {1739} [1740] ∈ {1740} [1741] ∈ {1741} [1742] ∈ {1742} [1743] ∈ {1743} [1744] ∈ {1744} [1745] ∈ {1745} [1746] ∈ {1746} [1747] ∈ {1747} [1748] ∈ {1748} [1749] ∈ {1749} [1750] ∈ {1750} [1751] ∈ {1751} [1752] ∈ {1752} [1753] ∈ {1753} [1754] ∈ {1754} [1755] ∈ {1755} [1756] ∈ {1756} [1757] ∈ {1757} [1758] ∈ {1758} [1759] ∈ {1759} [1760] ∈ {1760} [1761] ∈ {1761} [1762] ∈ {1762} [1763] ∈ {1763} [1764] ∈ {1764} [1765] ∈ {1765} [1766] ∈ {1766} [1767] ∈ {1767} [1768] ∈ {1768} [1769] ∈ {1769} [1770] ∈ {1770} [1771] ∈ {1771} [1772] ∈ {1772} [1773] ∈ {1773} [1774] ∈ {1774} [1775] ∈ {1775} [1776] ∈ {1776} [1777] ∈ {1777} [1778] ∈ {1778} [1779] ∈ {1779} [1780] ∈ {1780} [1781] ∈ {1781} [1782] ∈ {1782} [1783] ∈ {1783} [1784] ∈ {1784} [1785] ∈ {1785} [1786] ∈ {1786} [1787] ∈ {1787} [1788] ∈ {1788} [1789] ∈ {1789} [1790] ∈ {1790} [1791] ∈ {1791} [1792] ∈ {1792} [1793] ∈ {1793} [1794] ∈ {1794} [1795] ∈ {1795} [1796] ∈ {1796} [1797] ∈ {1797} [1798] ∈ {1798} [1799] ∈ {1799} [1800] ∈ {1800} [1801] ∈ {1801} [1802] ∈ {1802} [1803] ∈ {1803} [1804] ∈ {1804} [1805] ∈ {1805} [1806] ∈ {1806} [1807] ∈ {1807} [1808] ∈ {1808} [1809] ∈ {1809} [1810] ∈ {1810} [1811] ∈ {1811} [1812] ∈ {1812} [1813] ∈ {1813} [1814] ∈ {1814} [1815] ∈ {1815} [1816] ∈ {1816} [1817] ∈ {1817} [1818] ∈ {1818} [1819] ∈ {1819} [1820] ∈ {1820} [1821] ∈ {1821} [1822] ∈ {1822} [1823] ∈ {1823} [1824] ∈ {1824} [1825] ∈ {1825} [1826] ∈ {1826} [1827] ∈ {1827} [1828] ∈ {1828} [1829] ∈ {1829} [1830] ∈ {1830} [1831] ∈ {1831} [1832] ∈ {1832} [1833] ∈ {1833} [1834] ∈ {1834} [1835] ∈ {1835} [1836] ∈ {1836} [1837] ∈ {1837} [1838] ∈ {1838} [1839] ∈ {1839} [1840] ∈ {1840} [1841] ∈ {1841} [1842] ∈ {1842} [1843] ∈ {1843} [1844] ∈ {1844} [1845] ∈ {1845} [1846] ∈ {1846} [1847] ∈ {1847} [1848] ∈ {1848} [1849] ∈ {1849} [1850] ∈ {1850} [1851] ∈ {1851} [1852] ∈ {1852} [1853] ∈ {1853} [1854] ∈ {1854} [1855] ∈ {1855} [1856] ∈ {1856} [1857] ∈ {1857} [1858] ∈ {1858} [1859] ∈ {1859} [1860] ∈ {1860} [1861] ∈ {1861} [1862] ∈ {1862} [1863] ∈ {1863} [1864] ∈ {1864} [1865] ∈ {1865} [1866] ∈ {1866} [1867] ∈ {1867} [1868] ∈ {1868} [1869] ∈ {1869} [1870] ∈ {1870} [1871] ∈ {1871} [1872] ∈ {1872} [1873] ∈ {1873} [1874] ∈ {1874} [1875] ∈ {1875} [1876] ∈ {1876} [1877] ∈ {1877} [1878] ∈ {1878} [1879] ∈ {1879} [1880] ∈ {1880} [1881] ∈ {1881} [1882] ∈ {1882} [1883] ∈ {1883} [1884] ∈ {1884} [1885] ∈ {1885} [1886] ∈ {1886} [1887] ∈ {1887} [1888] ∈ {1888} [1889] ∈ {1889} [1890] ∈ {1890} [1891] ∈ {1891} [1892] ∈ {1892} [1893] ∈ {1893} [1894] ∈ {1894} [1895] ∈ {1895} [1896] ∈ {1896} [1897] ∈ {1897} [1898] ∈ {1898} [1899] ∈ {1899} [1900] ∈ {1900} [1901] ∈ {1901} [1902] ∈ {1902} [1903] ∈ {1903} [1904] ∈ {1904} [1905] ∈ {1905} [1906] ∈ {1906} [1907] ∈ {1907} [1908] ∈ {1908} [1909] ∈ {1909} [1910] ∈ {1910} [1911] ∈ {1911} [1912] ∈ {1912} [1913] ∈ {1913} [1914] ∈ {1914} [1915] ∈ {1915} [1916] ∈ {1916} [1917] ∈ {1917} [1918] ∈ {1918} [1919] ∈ {1919} [1920] ∈ {1920} [1921] ∈ {1921} [1922] ∈ {1922} [1923] ∈ {1923} [1924] ∈ {1924} [1925] ∈ {1925} [1926] ∈ {1926} [1927] ∈ {1927} [1928] ∈ {1928} [1929] ∈ {1929} [1930] ∈ {1930} [1931] ∈ {1931} [1932] ∈ {1932} [1933] ∈ {1933} [1934] ∈ {1934} [1935] ∈ {1935} [1936] ∈ {1936} [1937] ∈ {1937} [1938] ∈ {1938} [1939] ∈ {1939} [1940] ∈ {1940} [1941] ∈ {1941} [1942] ∈ {1942} [1943] ∈ {1943} [1944] ∈ {1944} [1945] ∈ {1945} [1946] ∈ {1946} [1947] ∈ {1947} [1948] ∈ {1948} [1949] ∈ {1949} [1950] ∈ {1950} [1951] ∈ {1951} [1952] ∈ {1952} [1953] ∈ {1953} [1954] ∈ {1954} [1955] ∈ {1955} [1956] ∈ {1956} [1957] ∈ {1957} [1958] ∈ {1958} [1959] ∈ {1959} [1960] ∈ {1960} [1961] ∈ {1961} [1962] ∈ {1962} [1963] ∈ {1963} [1964] ∈ {1964} [1965] ∈ {1965} [1966] ∈ {1966} [1967] ∈ {1967} [1968] ∈ {1968} [1969] ∈ {1969} [1970] ∈ {1970} [1971] ∈ {1971} [1972] ∈ {1972} [1973] ∈ {1973} [1974] ∈ {1974} [1975] ∈ {1975} [1976] ∈ {1976} [1977] ∈ {1977} [1978] ∈ {1978} [1979] ∈ {1979} [1980] ∈ {1980} [1981] ∈ {1981} [1982] ∈ {1982} [1983] ∈ {1983} [1984] ∈ {1984} [1985] ∈ {1985} [1986] ∈ {1986} [1987] ∈ {1987} [1988] ∈ {1988} [1989] ∈ {1989} [1990] ∈ {1990} [1991] ∈ {1991} [1992] ∈ {1992} [1993] ∈ {1993} [1994] ∈ {1994} [1995] ∈ {1995} [1996] ∈ {1996} [1997] ∈ {1997} [1998] ∈ {1998} [1999] ∈ {1999} [2000] ∈ {2000} [2001] ∈ {2001} [2002] ∈ {2002} [2003] ∈ {2003} [2004] ∈ {2004} [2005] ∈ {2005} [2006] ∈ {2006} [2007] ∈ {2007} [2008] ∈ {2008} [2009] ∈ {2009} [2010] ∈ {2010} [2011] ∈ {2011} [2012] ∈ {2012} [2013] ∈ {2013} [2014] ∈ {2014} [2015] ∈ {2015} [2016] ∈ {2016} [2017] ∈ {2017} [2018] ∈ {2018} [2019] ∈ {2019} [2020] ∈ {2020} [2021] ∈ {2021} [2022] ∈ {2022} [2023] ∈ {2023} [2024] ∈ {2024} [2025] ∈ {2025} [2026] ∈ {2026} [2027] ∈ {2027} [2028] ∈ {2028} [2029] ∈ {2029} [2030] ∈ {2030} [2031] ∈ {2031} [2032] ∈ {2032} [2033] ∈ {2033} [2034] ∈ {2034} [2035] ∈ {2035} [2036] ∈ {2036} [2037] ∈ {2037} [2038] ∈ {2038} [2039] ∈ {2039} [2040] ∈ {2040} [2041] ∈ {2041} [2042] ∈ {2042} [2043] ∈ {2043} [2044] ∈ {2044} [2045] ∈ {2045} [2046] ∈ {2046} [2047] ∈ {2047} [2048] ∈ {2048} [2049] ∈ {2049} [2050] ∈ {2050} [2051] ∈ {2051} [2052] ∈ {2052} [2053] ∈ {2053} [2054] ∈ {2054} [2055] ∈ {2055} [2056] ∈ {2056} [2057] ∈ {2057} [2058] ∈ {2058} [2059] ∈ {2059} [2060] ∈ {2060} [2061] ∈ {2061} [2062] ∈ {2062} [2063] ∈ {2063} [2064] ∈ {2064} [2065] ∈ {2065} [2066] ∈ {2066} [2067] ∈ {2067} [2068] ∈ {2068} [2069] ∈ {2069} [2070] ∈ {2070} [2071] ∈ {2071} [2072] ∈ {2072} [2073] ∈ {2073} [2074] ∈ {2074} [2075] ∈ {2075} [2076] ∈ {2076} [2077] ∈ {2077} [2078] ∈ {2078} [2079] ∈ {2079} [2080] ∈ {2080} [2081] ∈ {2081} [2082] ∈ {2082} [2083] ∈ {2083} [2084] ∈ {2084} [2085] ∈ {2085} [2086] ∈ {2086} [2087] ∈ {2087} [2088] ∈ {2088} [2089] ∈ {2089} [2090] ∈ {2090} [2091] ∈ {2091} [2092] ∈ {2092} [2093] ∈ {2093} [2094] ∈ {2094} [2095] ∈ {2095} [2096] ∈ {2096} [2097] ∈ {2097} [2098] ∈ {2098} [2099] ∈ {2099} [2100] ∈ {2100} [2101] ∈ {2101} [2102] ∈ {2102} [2103] ∈ {2103} [2104] ∈ {2104} [2105] ∈ {2105} [2106] ∈ {2106} [2107] ∈ {2107} [2108] ∈ {2108} [2109] ∈ {2109} [2110] ∈ {2110} [2111] ∈ {2111} [2112] ∈ {2112} [2113] ∈ {2113} [2114] ∈ {2114} [2115] ∈ {2115} [2116] ∈ {2116} [2117] ∈ {2117} [2118] ∈ {2118} [2119] ∈ {2119} [2120] ∈ {2120} [2121] ∈ {2121} [2122] ∈ {2122} [2123] ∈ {2123} [2124] ∈ {2124} [2125] ∈ {2125} [2126] ∈ {2126} [2127] ∈ {2127} [2128] ∈ {2128} [2129] ∈ {2129} [2130] ∈ {2130} [2131] ∈ {2131} [2132] ∈ {2132} [2133] ∈ {2133} [2134] ∈ {2134} [2135] ∈ {2135} [2136] ∈ {2136} [2137] ∈ {2137} [2138] ∈ {2138} [2139] ∈ {2139} [2140] ∈ {2140} [2141] ∈ {2141} [2142] ∈ {2142} [2143] ∈ {2143} [2144] ∈ {2144} [2145] ∈ {2145} [2146] ∈ {2146} [2147] ∈ {2147} [2148] ∈ {2148} [2149] ∈ {2149} [2150] ∈ {2150} [2151] ∈ {2151} [2152] ∈ {2152} [2153] ∈ {2153} [2154] ∈ {2154} [2155] ∈ {2155} [2156] ∈ {2156} [2157] ∈ {2157} [2158] ∈ {2158} [2159] ∈ {2159} [2160] ∈ {2160} [2161] ∈ {2161} [2162] ∈ {2162} [2163] ∈ {2163} [2164] ∈ {2164} [2165] ∈ {2165} [2166] ∈ {2166} [2167] ∈ {2167} [2168] ∈ {2168} [2169] ∈ {2169} [2170] ∈ {2170} [2171] ∈ {2171} [2172] ∈ {2172} [2173] ∈ {2173} [2174] ∈ {2174} [2175] ∈ {2175} [2176] ∈ {2176} [2177] ∈ {2177} [2178] ∈ {2178} [2179] ∈ {2179} [2180] ∈ {2180} [2181] ∈ {2181} [2182] ∈ {2182} [2183] ∈ {2183} [2184] ∈ {2184} [2185] ∈ {2185} [2186] ∈ {2186} [2187] ∈ {2187} [2188] ∈ {2188} [2189] ∈ {2189} [2190] ∈ {2190} [2191] ∈ {2191} [2192] ∈ {2192} [2193] ∈ {2193} [2194] ∈ {2194} [2195] ∈ {2195} [2196] ∈ {2196} [2197] ∈ {2197} [2198] ∈ {2198} [2199] ∈ {2199} [2200] ∈ {2200} [2201] ∈ {2201} [2202] ∈ {2202} [2203] ∈ {2203} [2204] ∈ {2204} [2205] ∈ {2205} [2206] ∈ {2206} [2207] ∈ {2207} [2208] ∈ {2208} [2209] ∈ {2209} [2210] ∈ {2210} [2211] ∈ {2211} [2212] ∈ {2212} [2213] ∈ {2213} [2214] ∈ {2214} [2215] ∈ {2215} [2216] ∈ {2216} [2217] ∈ {2217} [2218] ∈ {2218} [2219] ∈ {2219} [2220] ∈ {2220} [2221] ∈ {2221} [2222] ∈ {2222} [2223] ∈ {2223} [2224] ∈ {2224} [2225] ∈ {2225} [2226] ∈ {2226} [2227] ∈ {2227} [2228] ∈ {2228} [2229] ∈ {2229} [2230] ∈ {2230} [2231] ∈ {2231} [2232] ∈ {2232} [2233] ∈ {2233} [2234] ∈ {2234} [2235] ∈ {2235} [2236] ∈ {2236} [2237] ∈ {2237} [2238] ∈ {2238} [2239] ∈ {2239} [2240] ∈ {2240} [2241] ∈ {2241} [2242] ∈ {2242} [2243] ∈ {2243} [2244] ∈ {2244} [2245] ∈ {2245} [2246] ∈ {2246} [2247] ∈ {2247} [2248] ∈ {2248} [2249] ∈ {2249} [2250] ∈ {2250} [2251] ∈ {2251} [2252] ∈ {2252} [2253] ∈ {2253} [2254] ∈ {2254} [2255] ∈ {2255} [2256] ∈ {2256} [2257] ∈ {2257} [2258] ∈ {2258} [2259] ∈ {2259} [2260] ∈ {2260} [2261] ∈ {2261} [2262] ∈ {2262} [2263] ∈ {2263} [2264] ∈ {2264} [2265] ∈ {2265} [2266] ∈ {2266} [2267] ∈ {2267} [2268] ∈ {2268} [2269] ∈ {2269} [2270] ∈ {2270} [2271] ∈ {2271} [2272] ∈ {2272} [2273] ∈ {2273} [2274] ∈ {2274} [2275] ∈ {2275} [2276] ∈ {2276} [2277] ∈ {2277} [2278] ∈ {2278} [2279] ∈ {2279} [2280] ∈ {2280} [2281] ∈ {2281} [2282] ∈ {2282} [2283] ∈ {2283} [2284] ∈ {2284} [2285] ∈ {2285} [2286] ∈ {2286} [2287] ∈ {2287} [2288] ∈ {2288} [2289] ∈ {2289} [2290] ∈ {2290} [2291] ∈ {2291} [2292] ∈ {2292} [2293] ∈ {2293} [2294] ∈ {2294} [2295] ∈ {2295} [2296] ∈ {2296} [2297] ∈ {2297} [2298] ∈ {2298} [2299] ∈ {2299} [2300] ∈ {2300} [2301] ∈ {2301} [2302] ∈ {2302} [2303] ∈ {2303} [2304] ∈ {2304} [2305] ∈ {2305} [2306] ∈ {2306} [2307] ∈ {2307} [2308] ∈ {2308} [2309] ∈ {2309} [2310] ∈ {2310} [2311] ∈ {2311} [2312] ∈ {2312} [2313] ∈ {2313} [2314] ∈ {2314} [2315] ∈ {2315} [2316] ∈ {2316} [2317] ∈ {2317} [2318] ∈ {2318} [2319] ∈ {2319} [2320] ∈ {2320} [2321] ∈ {2321} [2322] ∈ {2322} [2323] ∈ {2323} [2324] ∈ {2324} [2325] ∈ {2325} [2326] ∈ {2326} [2327] ∈ {2327} [2328] ∈ {2328} [2329] ∈ {2329} [2330] ∈ {2330} [2331] ∈ {2331} [2332] ∈ {2332} [2333] ∈ {2333} [2334] ∈ {2334} [2335] ∈ {2335} [2336] ∈ {2336} [2337] ∈ {2337} [2338] ∈ {2338} [2339] ∈ {2339} [2340] ∈ {2340} [2341] ∈ {2341} [2342] ∈ {2342} [2343] ∈ {2343} [2344] ∈ {2344} [2345] ∈ {2345} [2346] ∈ {2346} [2347] ∈ {2347} [2348] ∈ {2348} [2349] ∈ {2349} [2350] ∈ {2350} [2351] ∈ {2351} [2352] ∈ {2352} [2353] ∈ {2353} [2354] ∈ {2354} [2355] ∈ {2355} [2356] ∈ {2356} [2357] ∈ {2357} [2358] ∈ {2358} [2359] ∈ {2359} [2360] ∈ {2360} [2361] ∈ {2361} [2362] ∈ {2362} [2363] ∈ {2363} [2364] ∈ {2364} [2365] ∈ {2365} [2366] ∈ {2366} [2367] ∈ {2367} [2368] ∈ {2368} [2369] ∈ {2369} [2370] ∈ {2370} [2371] ∈ {2371} [2372] ∈ {2372} [2373] ∈ {2373} [2374] ∈ {2374} [2375] ∈ {2375} [2376] ∈ {2376} [2377] ∈ {2377} [2378] ∈ {2378} [2379] ∈ {2379} [2380] ∈ {2380} [2381] ∈ {2381} [2382] ∈ {2382} [2383] ∈ {2383} [2384] ∈ {2384} [2385] ∈ {2385} [2386] ∈ {2386} [2387] ∈ {2387} [2388] ∈ {2388} [2389] ∈ {2389} [2390] ∈ {2390} [2391] ∈ {2391} [2392] ∈ {2392} [2393] ∈ {2393} [2394] ∈ {2394} [2395] ∈ {2395} [2396] ∈ {2396} [2397] ∈ {2397} [2398] ∈ {2398} [2399] ∈ {2399} [2400] ∈ {2400} [2401] ∈ {2401} [2402] ∈ {2402} [2403] ∈ {2403} [2404] ∈ {2404} [2405] ∈ {2405} [2406] ∈ {2406} [2407] ∈ {2407} [2408] ∈ {2408} [2409] ∈ {2409} [2410] ∈ {2410} [2411] ∈ {2411} [2412] ∈ {2412} [2413] ∈ {2413} [2414] ∈ {2414} [2415] ∈ {2415} [2416] ∈ {2416} [2417] ∈ {2417} [2418] ∈ {2418} [2419] ∈ {2419} [2420] ∈ {2420} [2421] ∈ {2421} [2422] ∈ {2422} [2423] ∈ {2423} [2424] ∈ {2424} [2425] ∈ {2425} [2426] ∈ {2426} [2427] ∈ {2427} [2428] ∈ {2428} [2429] ∈ {2429} [2430] ∈ {2430} [2431] ∈ {2431} [2432] ∈ {2432} [2433] ∈ {2433} [2434] ∈ {2434} [2435] ∈ {2435} [2436] ∈ {2436} [2437] ∈ {2437} [2438] ∈ {2438} [2439] ∈ {2439} [2440] ∈ {2440} [2441] ∈ {2441} [2442] ∈ {2442} [2443] ∈ {2443} [2444] ∈ {2444} [2445] ∈ {2445} [2446] ∈ {2446} [2447] ∈ {2447} [2448] ∈ {2448} [2449] ∈ {2449} [2450] ∈ {2450} [2451] ∈ {2451} [2452] ∈ {2452} [2453] ∈ {2453} [2454] ∈ {2454} [2455] ∈ {2455} [2456] ∈ {2456} [2457] ∈ {2457} [2458] ∈ {2458} [2459] ∈ {2459} [2460] ∈ {2460} [2461] ∈ {2461} [2462] ∈ {2462} [2463] ∈ {2463} [2464] ∈ {2464} [2465] ∈ {2465} [2466] ∈ {2466} [2467] ∈ {2467} [2468] ∈ {2468} [2469] ∈ {2469} [2470] ∈ {2470} [2471] ∈ {2471} [2472] ∈ {2472} [2473] ∈ {2473} [2474] ∈ {2474} [2475] ∈ {2475} [2476] ∈ {2476} [2477] ∈ {2477} [2478] ∈ {2478} [2479] ∈ {2479} [2480] ∈ {2480} [2481] ∈ {2481} [2482] ∈ {2482} [2483] ∈ {2483} [2484] ∈ {2484} [2485] ∈ {2485} [2486] ∈ {2486} [2487] ∈ {2487} [2488] ∈ {2488} [2489] ∈ {2489} [2490] ∈ {2490} [2491] ∈ {2491} [2492] ∈ {2492} [2493] ∈ {2493} [2494] ∈ {2494} [2495] ∈ {2495} [2496] ∈ {2496} [2497] ∈ {2497} [2498] ∈ {2498} [2499] ∈ {2499} [2500] ∈ {2500} [2501] ∈ {2501} [2502] ∈ {2502} [2503] ∈ {2503} [2504] ∈ {2504} [2505] ∈ {2505} [2506] ∈ {2506} [2507] ∈ {2507} [2508] ∈ {2508} [2509] ∈ {2509} [2510] ∈ {2510} [2511] ∈ {2511} [2512] ∈ {2512} [2513] ∈ {2513} [2514] ∈ {2514} [2515] ∈ {2515} [2516] ∈ {2516} [2517] ∈ {2517} [2518] ∈ {2518} [2519] ∈ {2519} [2520] ∈ {2520} [2521] ∈ {2521} [2522] ∈ {2522} [2523] ∈ {2523} [2524] ∈ {2524} [2525] ∈ {2525} [2526] ∈ {2526} [2527] ∈ {2527} [2528] ∈ {2528} [2529] ∈ {2529} [2530] ∈ {2530} [2531] ∈ {2531} [2532] ∈ {2532} [2533] ∈ {2533} [2534] ∈ {2534} [2535] ∈ {2535} [2536] ∈ {2536} [2537] ∈ {2537} [2538] ∈ {2538} [2539] ∈ {2539} [2540] ∈ {2540} [2541] ∈ {2541} [2542] ∈ {2542} [2543] ∈ {2543} [2544] ∈ {2544} [2545] ∈ {2545} [2546] ∈ {2546} [2547] ∈ {2547} [2548] ∈ {2548} [2549] ∈ {2549} [2550] ∈ {2550} [2551] ∈ {2551} [2552] ∈ {2552} [2553] ∈ {2553} [2554] ∈ {2554} [2555] ∈ {2555} [2556] ∈ {2556} [2557] ∈ {2557} [2558] ∈ {2558} [2559] ∈ {2559} [2560] ∈ {2560} [2561] ∈ {2561} [2562] ∈ {2562} [2563] ∈ {2563} [2564] ∈ {2564} [2565] ∈ {2565} [2566] ∈ {2566} [2567] ∈ {2567} [2568] ∈ {2568} [2569] ∈ {2569} [2570] ∈ {2570} [2571] ∈ {2571} [2572] ∈ {2572} [2573] ∈ {2573} [2574] ∈ {2574} [2575] ∈ {2575} [2576] ∈ {2576} [2577] ∈ {2577} [2578] ∈ {2578} [2579] ∈ {2579} [2580] ∈ {2580} [2581] ∈ {2581} [2582] ∈ {2582} [2583] ∈ {2583} [2584] ∈ {2584} [2585] ∈ {2585} [2586] ∈ {2586} [2587] ∈ {2587} [2588] ∈ {2588} [2589] ∈ {2589} [2590] ∈ {2590} [2591] ∈ {2591} [2592] ∈ {2592} [2593] ∈ {2593} [2594] ∈ {2594} [2595] ∈ {2595} [2596] ∈ {2596} [2597] ∈ {2597} [2598] ∈ {2598} [2599] ∈ {2599} [2600] ∈ {2600} [2601] ∈ {2601} [2602] ∈ {2602} [2603] ∈ {2603} [2604] ∈ {2604} [2605] ∈ {2605} [2606] ∈ {2606} [2607] ∈ {2607} [2608] ∈ {2608} [2609] ∈ {2609} [2610] ∈ {2610} [2611] ∈ {2611} [2612] ∈ {2612} [2613] ∈ {2613} [2614] ∈ {2614} [2615] ∈ {2615} [2616] ∈ {2616} [2617] ∈ {2617} [2618] ∈ {2618} [2619] ∈ {2619} [2620] ∈ {2620} [2621] ∈ {2621} [2622] ∈ {2622} [2623] ∈ {2623} [2624] ∈ {2624} [2625] ∈ {2625} [2626] ∈ {2626} [2627] ∈ {2627} [2628] ∈ {2628} [2629] ∈ {2629} [2630] ∈ {2630} [2631] ∈ {2631} [2632] ∈ {2632} [2633] ∈ {2633} [2634] ∈ {2634} [2635] ∈ {2635} [2636] ∈ {2636} [2637] ∈ {2637} [2638] ∈ {2638} [2639] ∈ {2639} [2640] ∈ {2640} [2641] ∈ {2641} [2642] ∈ {2642} [2643] ∈ {2643} [2644] ∈ {2644} [2645] ∈ {2645} [2646] ∈ {2646} [2647] ∈ {2647} [2648] ∈ {2648} [2649] ∈ {2649} [2650] ∈ {2650} [2651] ∈ {2651} [2652] ∈ {2652} [2653] ∈ {2653} [2654] ∈ {2654} [2655] ∈ {2655} [2656] ∈ {2656} [2657] ∈ {2657} [2658] ∈ {2658} [2659] ∈ {2659} [2660] ∈ {2660} [2661] ∈ {2661} [2662] ∈ {2662} [2663] ∈ {2663} [2664] ∈ {2664} [2665] ∈ {2665} [2666] ∈ {2666} [2667] ∈ {2667} [2668] ∈ {2668} [2669] ∈ {2669} [2670] ∈ {2670} [2671] ∈ {2671} [2672] ∈ {2672} [2673] ∈ {2673} [2674] ∈ {2674} [2675] ∈ {2675} [2676] ∈ {2676} [2677] ∈ {2677} [2678] ∈ {2678} [2679] ∈ {2679} [2680] ∈ {2680} [2681] ∈ {2681} [2682] ∈ {2682} [2683] ∈ {2683} [2684] ∈ {2684} [2685] ∈ {2685} [2686] ∈ {2686} [2687] ∈ {2687} [2688] ∈ {2688} [2689] ∈ {2689} [2690] ∈ {2690} [2691] ∈ {2691} [2692] ∈ {2692} [2693] ∈ {2693} [2694] ∈ {2694} [2695] ∈ {2695} [2696] ∈ {2696} [2697] ∈ {2697} [2698] ∈ {2698} [2699] ∈ {2699} [2700] ∈ {2700} [2701] ∈ {2701} [2702] ∈ {2702} [2703] ∈ {2703} [2704] ∈ {2704} [2705] ∈ {2705} [2706] ∈ {2706} [2707] ∈ {2707} [2708] ∈ {2708} [2709] ∈ {2709} [2710] ∈ {2710} [2711] ∈ {2711} [2712] ∈ {2712} [2713] ∈ {2713} [2714] ∈ {2714} [2715] ∈ {2715} [2716] ∈ {2716} [2717] ∈ {2717} [2718] ∈ {2718} [2719] ∈ {2719} [2720] ∈ {2720} [2721] ∈ {2721} [2722] ∈ {2722} [2723] ∈ {2723} [2724] ∈ {2724} [2725] ∈ {2725} [2726] ∈ {2726} [2727] ∈ {2727} [2728] ∈ {2728} [2729] ∈ {2729} [2730] ∈ {2730} [2731] ∈ {2731} [2732] ∈ {2732} [2733] ∈ {2733} [2734] ∈ {2734} [2735] ∈ {2735} [2736] ∈ {2736} [2737] ∈ {2737} [2738] ∈ {2738} [2739] ∈ {2739} [2740] ∈ {2740} [2741] ∈ {2741} [2742] ∈ {2742} [2743] ∈ {2743} [2744] ∈ {2744} [2745] ∈ {2745} [2746] ∈ {2746} [2747] ∈ {2747} [2748] ∈ {2748} [2749] ∈ {2749} [2750] ∈ {2750} [2751] ∈ {2751} [2752] ∈ {2752} [2753] ∈ {2753} [2754] ∈ {2754} [2755] ∈ {2755} [2756] ∈ {2756} [2757] ∈ {2757} [2758] ∈ {2758} [2759] ∈ {2759} [2760] ∈ {2760} [2761] ∈ {2761} [2762] ∈ {2762} [2763] ∈ {2763} [2764] ∈ {2764} [2765] ∈ {2765} [2766] ∈ {2766} [2767] ∈ {2767} [2768] ∈ {2768} [2769] ∈ {2769} [2770] ∈ {2770} [2771] ∈ {2771} [2772] ∈ {2772} [2773] ∈ {2773} [2774] ∈ {2774} [2775] ∈ {2775} [2776] ∈ {2776} [2777] ∈ {2777} [2778] ∈ {2778} [2779] ∈ {2779} [2780] ∈ {2780} [2781] ∈ {2781} [2782] ∈ {2782} [2783] ∈ {2783} [2784] ∈ {2784} [2785] ∈ {2785} [2786] ∈ {2786} [2787] ∈ {2787} [2788] ∈ {2788} [2789] ∈ {2789} [2790] ∈ {2790} [2791] ∈ {2791} [2792] ∈ {2792} [2793] ∈ {2793} [2794] ∈ {2794} [2795] ∈ {2795} [2796] ∈ {2796} [2797] ∈ {2797} [2798] ∈ {2798} [2799] ∈ {2799} [2800] ∈ {2800} [2801] ∈ {2801} [2802] ∈ {2802} [2803] ∈ {2803} [2804] ∈ {2804} [2805] ∈ {2805} [2806] ∈ {2806} [2807] ∈ {2807} [2808] ∈ {2808} [2809] ∈ {2809} [2810] ∈ {2810} [2811] ∈ {2811} [2812] ∈ {2812} [2813] ∈ {2813} [2814] ∈ {2814} [2815] ∈ {2815} [2816] ∈ {2816} [2817] ∈ {2817} [2818] ∈ {2818} [2819] ∈ {2819} [2820] ∈ {2820} [2821] ∈ {2821} [2822] ∈ {2822} [2823] ∈ {2823} [2824] ∈ {2824} [2825] ∈ {2825} [2826] ∈ {2826} [2827] ∈ {2827} [2828] ∈ {2828} [2829] ∈ {2829} [2830] ∈ {2830} [2831] ∈ {2831} [2832] ∈ {2832} [2833] ∈ {2833} [2834] ∈ {2834} [2835] ∈ {2835} [2836] ∈ {2836} [2837] ∈ {2837} [2838] ∈ {2838} [2839] ∈ {2839} [2840] ∈ {2840} [2841] ∈ {2841} [2842] ∈ {2842} [2843] ∈ {2843} [2844] ∈ {2844} [2845] ∈ {2845} [2846] ∈ {2846} [2847] ∈ {2847} [2848] ∈ {2848} [2849] ∈ {2849} [2850] ∈ {2850} [2851] ∈ {2851} [2852] ∈ {2852} [2853] ∈ {2853} [2854] ∈ {2854} [2855] ∈ {2855} [2856] ∈ {2856} [2857] ∈ {2857} [2858] ∈ {2858} [2859] ∈ {2859} [2860] ∈ {2860} [2861] ∈ {2861} [2862] ∈ {2862} [2863] ∈ {2863} [2864] ∈ {2864} [2865] ∈ {2865} [2866] ∈ {2866} [2867] ∈ {2867} [2868] ∈ {2868} [2869] ∈ {2869} [2870] ∈ {2870} [2871] ∈ {2871} [2872] ∈ {2872} [2873] ∈ {2873} [2874] ∈ {2874} [2875] ∈ {2875} [2876] ∈ {2876} [2877] ∈ {2877} [2878] ∈ {2878} [2879] ∈ {2879} [2880] ∈ {2880} [2881] ∈ {2881} [2882] ∈ {2882} [2883] ∈ {2883} [2884] ∈ {2884} [2885] ∈ {2885} [2886] ∈ {2886} [2887] ∈ {2887} [2888] ∈ {2888} [2889] ∈ {2889} [2890] ∈ {2890} [2891] ∈ {2891} [2892] ∈ {2892} [2893] ∈ {2893} [2894] ∈ {2894} [2895] ∈ {2895} [2896] ∈ {2896} [2897] ∈ {2897} [2898] ∈ {2898} [2899] ∈ {2899} [2900] ∈ {2900} [2901] ∈ {2901} [2902] ∈ {2902} [2903] ∈ {2903} [2904] ∈ {2904} [2905] ∈ {2905} [2906] ∈ {2906} [2907] ∈ {2907} [2908] ∈ {2908} [2909] ∈ {2909} [2910] ∈ {2910} [2911] ∈ {2911} [2912] ∈ {2912} [2913] ∈ {2913} [2914] ∈ {2914} [2915] ∈ {2915} [2916] ∈ {2916} [2917] ∈ {2917} [2918] ∈ {2918} [2919] ∈ {2919} [2920] ∈ {2920} [2921] ∈ {2921} [2922] ∈ {2922} [2923] ∈ {2923} [2924] ∈ {2924} [2925] ∈ {2925} [2926] ∈ {2926} [2927] ∈ {2927} [2928] ∈ {2928} [2929] ∈ {2929} [2930] ∈ {2930} [2931] ∈ {2931} [2932] ∈ {2932} [2933] ∈ {2933} [2934] ∈ {2934} [2935] ∈ {2935} [2936] ∈ {2936} [2937] ∈ {2937} [2938] ∈ {2938} [2939] ∈ {2939} [2940] ∈ {2940} [2941] ∈ {2941} [2942] ∈ {2942} [2943] ∈ {2943} [2944] ∈ {2944} [2945] ∈ {2945} [2946] ∈ {2946} [2947] ∈ {2947} [2948] ∈ {2948} [2949] ∈ {2949} [2950] ∈ {2950} [2951] ∈ {2951} [2952] ∈ {2952} [2953] ∈ {2953} [2954] ∈ {2954} [2955] ∈ {2955} [2956] ∈ {2956} [2957] ∈ {2957} [2958] ∈ {2958} [2959] ∈ {2959} [2960] ∈ {2960} [2961] ∈ {2961} [2962] ∈ {2962} [2963] ∈ {2963} [2964] ∈ {2964} [2965] ∈ {2965} [2966] ∈ {2966} [2967] ∈ {2967} [2968] ∈ {2968} [2969] ∈ {2969} [2970] ∈ {2970} [2971] ∈ {2971} [2972] ∈ {2972} [2973] ∈ {2973} [2974] ∈ {2974} [2975] ∈ {2975} [2976] ∈ {2976} [2977] ∈ {2977} [2978] ∈ {2978} [2979] ∈ {2979} [2980] ∈ {2980} [2981] ∈ {2981} [2982] ∈ {2982} [2983] ∈ {2983} [2984] ∈ {2984} [2985] ∈ {2985} [2986] ∈ {2986} [2987] ∈ {2987} [2988] ∈ {2988} [2989] ∈ {2989} [2990] ∈ {2990} [2991] ∈ {2991} [2992] ∈ {2992} [2993] ∈ {2993} [2994] ∈ {2994} [2995] ∈ {2995} [2996] ∈ {2996} [2997] ∈ {2997} [2998] ∈ {2998} [2999] ∈ {2999} [eva:final-states] Values at end of function main: Cannot filter: dumping raw memory (including unchanged variables) t[0..1] ∈ {0} [2] ∈ {2} [3] ∈ {3} [4] ∈ {4} [5] ∈ {5} [6] ∈ {6} [7] ∈ {7} [8] ∈ {8} [9] ∈ {9} [10] ∈ {10} [11] ∈ {11} [12] ∈ {12} [13] ∈ {13} [14] ∈ {14} [15] ∈ {15} [16] ∈ {16} [17] ∈ {17} [18] ∈ {18} [19] ∈ {19} [20] ∈ {20} [21] ∈ {21} [22] ∈ {22} [23] ∈ {23} [24] ∈ {24} [25] ∈ {25} [26] ∈ {26} [27] ∈ {27} [28] ∈ {28} [29] ∈ {29} [30] ∈ {30} [31] ∈ {31} [32] ∈ {32} [33] ∈ {33} [34] ∈ {34} [35] ∈ {35} [36] ∈ {36} [37] ∈ {37} [38] ∈ {38} [39] ∈ {39} [40] ∈ {40} [41] ∈ {41} [42] ∈ {42} [43] ∈ {43} [44] ∈ {44} [45] ∈ {45} [46] ∈ {46} [47] ∈ {47} [48] ∈ {48} [49] ∈ {49} [50] ∈ {50} [51] ∈ {51} [52] ∈ {52} [53] ∈ {53} [54] ∈ {54} [55] ∈ {55} [56] ∈ {56} [57] ∈ {57} [58] ∈ {58} [59] ∈ {59} [60] ∈ {60} [61] ∈ {61} [62] ∈ {62} [63] ∈ {63} [64] ∈ {64} [65] ∈ {65} [66] ∈ {66} [67] ∈ {67} [68] ∈ {68} [69] ∈ {69} [70] ∈ {70} [71] ∈ {71} [72] ∈ {72} [73] ∈ {73} [74] ∈ {74} [75] ∈ {75} [76] ∈ {76} [77] ∈ {77} [78] ∈ {78} [79] ∈ {79} [80] ∈ {80} [81] ∈ {81} [82] ∈ {82} [83] ∈ {83} [84] ∈ {84} [85] ∈ {85} [86] ∈ {86} [87] ∈ {87} [88] ∈ {88} [89] ∈ {89} [90] ∈ {90} [91] ∈ {91} [92] ∈ {92} [93] ∈ {93} [94] ∈ {94} [95] ∈ {95} [96] ∈ {96} [97] ∈ {97} [98] ∈ {98} [99] ∈ {99} [100] ∈ {100} [101] ∈ {101} [102] ∈ {102} [103] ∈ {103} [104] ∈ {104} [105] ∈ {105} [106] ∈ {106} [107] ∈ {107} [108] ∈ {108} [109] ∈ {109} [110] ∈ {110} [111] ∈ {111} [112] ∈ {112} [113] ∈ {113} [114] ∈ {114} [115] ∈ {115} [116] ∈ {116} [117] ∈ {117} [118] ∈ {118} [119] ∈ {119} [120] ∈ {120} [121] ∈ {121} [122] ∈ {122} [123] ∈ {123} [124] ∈ {124} [125] ∈ {125} [126] ∈ {126} [127] ∈ {127} [128] ∈ {128} [129] ∈ {129} [130] ∈ {130} [131] ∈ {131} [132] ∈ {132} [133] ∈ {133} [134] ∈ {134} [135] ∈ {135} [136] ∈ {136} [137] ∈ {137} [138] ∈ {138} [139] ∈ {139} [140] ∈ {140} [141] ∈ {141} [142] ∈ {142} [143] ∈ {143} [144] ∈ {144} [145] ∈ {145} [146] ∈ {146} [147] ∈ {147} [148] ∈ {148} [149] ∈ {149} [150] ∈ {150} [151] ∈ {151} [152] ∈ {152} [153] ∈ {153} [154] ∈ {154} [155] ∈ {155} [156] ∈ {156} [157] ∈ {157} [158] ∈ {158} [159] ∈ {159} [160] ∈ {160} [161] ∈ {161} [162] ∈ {162} [163] ∈ {163} [164] ∈ {164} [165] ∈ {165} [166] ∈ {166} [167] ∈ {167} [168] ∈ {168} [169] ∈ {169} [170] ∈ {170} [171] ∈ {171} [172] ∈ {172} [173] ∈ {173} [174] ∈ {174} [175] ∈ {175} [176] ∈ {176} [177] ∈ {177} [178] ∈ {178} [179] ∈ {179} [180] ∈ {180} [181] ∈ {181} [182] ∈ {182} [183] ∈ {183} [184] ∈ {184} [185] ∈ {185} [186] ∈ {186} [187] ∈ {187} [188] ∈ {188} [189] ∈ {189} [190] ∈ {190} [191] ∈ {191} [192] ∈ {192} [193] ∈ {193} [194] ∈ {194} [195] ∈ {195} [196] ∈ {196} [197] ∈ {197} [198] ∈ {198} [199] ∈ {199} [200] ∈ {200} [201] ∈ {201} [202] ∈ {202} [203] ∈ {203} [204] ∈ {204} [205] ∈ {205} [206] ∈ {206} [207] ∈ {207} [208] ∈ {208} [209] ∈ {209} [210] ∈ {210} [211] ∈ {211} [212] ∈ {212} [213] ∈ {213} [214] ∈ {214} [215] ∈ {215} [216] ∈ {216} [217] ∈ {217} [218] ∈ {218} [219] ∈ {219} [220] ∈ {220} [221] ∈ {221} [222] ∈ {222} [223] ∈ {223} [224] ∈ {224} [225] ∈ {225} [226] ∈ {226} [227] ∈ {227} [228] ∈ {228} [229] ∈ {229} [230] ∈ {230} [231] ∈ {231} [232] ∈ {232} [233] ∈ {233} [234] ∈ {234} [235] ∈ {235} [236] ∈ {236} [237] ∈ {237} [238] ∈ {238} [239] ∈ {239} [240] ∈ {240} [241] ∈ {241} [242] ∈ {242} [243] ∈ {243} [244] ∈ {244} [245] ∈ {245} [246] ∈ {246} [247] ∈ {247} [248] ∈ {248} [249] ∈ {249} [250] ∈ {250} [251] ∈ {251} [252] ∈ {252} [253] ∈ {253} [254] ∈ {254} [255] ∈ {255} [256] ∈ {256} [257] ∈ {257} [258] ∈ {258} [259] ∈ {259} [260] ∈ {260} [261] ∈ {261} [262] ∈ {262} [263] ∈ {263} [264] ∈ {264} [265] ∈ {265} [266] ∈ {266} [267] ∈ {267} [268] ∈ {268} [269] ∈ {269} [270] ∈ {270} [271] ∈ {271} [272] ∈ {272} [273] ∈ {273} [274] ∈ {274} [275] ∈ {275} [276] ∈ {276} [277] ∈ {277} [278] ∈ {278} [279] ∈ {279} [280] ∈ {280} [281] ∈ {281} [282] ∈ {282} [283] ∈ {283} [284] ∈ {284} [285] ∈ {285} [286] ∈ {286} [287] ∈ {287} [288] ∈ {288} [289] ∈ {289} [290] ∈ {290} [291] ∈ {291} [292] ∈ {292} [293] ∈ {293} [294] ∈ {294} [295] ∈ {295} [296] ∈ {296} [297] ∈ {297} [298] ∈ {298} [299] ∈ {299} [300] ∈ {300} [301] ∈ {301} [302] ∈ {302} [303] ∈ {303} [304] ∈ {304} [305] ∈ {305} [306] ∈ {306} [307] ∈ {307} [308] ∈ {308} [309] ∈ {309} [310] ∈ {310} [311] ∈ {311} [312] ∈ {312} [313] ∈ {313} [314] ∈ {314} [315] ∈ {315} [316] ∈ {316} [317] ∈ {317} [318] ∈ {318} [319] ∈ {319} [320] ∈ {320} [321] ∈ {321} [322] ∈ {322} [323] ∈ {323} [324] ∈ {324} [325] ∈ {325} [326] ∈ {326} [327] ∈ {327} [328] ∈ {328} [329] ∈ {329} [330] ∈ {330} [331] ∈ {331} [332] ∈ {332} [333] ∈ {333} [334] ∈ {334} [335] ∈ {335} [336] ∈ {336} [337] ∈ {337} [338] ∈ {338} [339] ∈ {339} [340] ∈ {340} [341] ∈ {341} [342] ∈ {342} [343] ∈ {343} [344] ∈ {344} [345] ∈ {345} [346] ∈ {346} [347] ∈ {347} [348] ∈ {348} [349] ∈ {349} [350] ∈ {350} [351] ∈ {351} [352] ∈ {352} [353] ∈ {353} [354] ∈ {354} [355] ∈ {355} [356] ∈ {356} [357] ∈ {357} [358] ∈ {358} [359] ∈ {359} [360] ∈ {360} [361] ∈ {361} [362] ∈ {362} [363] ∈ {363} [364] ∈ {364} [365] ∈ {365} [366] ∈ {366} [367] ∈ {367} [368] ∈ {368} [369] ∈ {369} [370] ∈ {370} [371] ∈ {371} [372] ∈ {372} [373] ∈ {373} [374] ∈ {374} [375] ∈ {375} [376] ∈ {376} [377] ∈ {377} [378] ∈ {378} [379] ∈ {379} [380] ∈ {380} [381] ∈ {381} [382] ∈ {382} [383] ∈ {383} [384] ∈ {384} [385] ∈ {385} [386] ∈ {386} [387] ∈ {387} [388] ∈ {388} [389] ∈ {389} [390] ∈ {390} [391] ∈ {391} [392] ∈ {392} [393] ∈ {393} [394] ∈ {394} [395] ∈ {395} [396] ∈ {396} [397] ∈ {397} [398] ∈ {398} [399] ∈ {399} [400] ∈ {400} [401] ∈ {401} [402] ∈ {402} [403] ∈ {403} [404] ∈ {404} [405] ∈ {405} [406] ∈ {406} [407] ∈ {407} [408] ∈ {408} [409] ∈ {409} [410] ∈ {410} [411] ∈ {411} [412] ∈ {412} [413] ∈ {413} [414] ∈ {414} [415] ∈ {415} [416] ∈ {416} [417] ∈ {417} [418] ∈ {418} [419] ∈ {419} [420] ∈ {420} [421] ∈ {421} [422] ∈ {422} [423] ∈ {423} [424] ∈ {424} [425] ∈ {425} [426] ∈ {426} [427] ∈ {427} [428] ∈ {428} [429] ∈ {429} [430] ∈ {430} [431] ∈ {431} [432] ∈ {432} [433] ∈ {433} [434] ∈ {434} [435] ∈ {435} [436] ∈ {436} [437] ∈ {437} [438] ∈ {438} [439] ∈ {439} [440] ∈ {440} [441] ∈ {441} [442] ∈ {442} [443] ∈ {443} [444] ∈ {444} [445] ∈ {445} [446] ∈ {446} [447] ∈ {447} [448] ∈ {448} [449] ∈ {449} [450] ∈ {450} [451] ∈ {451} [452] ∈ {452} [453] ∈ {453} [454] ∈ {454} [455] ∈ {455} [456] ∈ {456} [457] ∈ {457} [458] ∈ {458} [459] ∈ {459} [460] ∈ {460} [461] ∈ {461} [462] ∈ {462} [463] ∈ {463} [464] ∈ {464} [465] ∈ {465} [466] ∈ {466} [467] ∈ {467} [468] ∈ {468} [469] ∈ {469} [470] ∈ {470} [471] ∈ {471} [472] ∈ {472} [473] ∈ {473} [474] ∈ {474} [475] ∈ {475} [476] ∈ {476} [477] ∈ {477} [478] ∈ {478} [479] ∈ {479} [480] ∈ {480} [481] ∈ {481} [482] ∈ {482} [483] ∈ {483} [484] ∈ {484} [485] ∈ {485} [486] ∈ {486} [487] ∈ {487} [488] ∈ {488} [489] ∈ {489} [490] ∈ {490} [491] ∈ {491} [492] ∈ {492} [493] ∈ {493} [494] ∈ {494} [495] ∈ {495} [496] ∈ {496} [497] ∈ {497} [498] ∈ {498} [499] ∈ {499} [500] ∈ {500} [501] ∈ {501} [502] ∈ {502} [503] ∈ {503} [504] ∈ {504} [505] ∈ {505} [506] ∈ {506} [507] ∈ {507} [508] ∈ {508} [509] ∈ {509} [510] ∈ {510} [511] ∈ {511} [512] ∈ {512} [513] ∈ {513} [514] ∈ {514} [515] ∈ {515} [516] ∈ {516} [517] ∈ {517} [518] ∈ {518} [519] ∈ {519} [520] ∈ {520} [521] ∈ {521} [522] ∈ {522} [523] ∈ {523} [524] ∈ {524} [525] ∈ {525} [526] ∈ {526} [527] ∈ {527} [528] ∈ {528} [529] ∈ {529} [530] ∈ {530} [531] ∈ {531} [532] ∈ {532} [533] ∈ {533} [534] ∈ {534} [535] ∈ {535} [536] ∈ {536} [537] ∈ {537} [538] ∈ {538} [539] ∈ {539} [540] ∈ {540} [541] ∈ {541} [542] ∈ {542} [543] ∈ {543} [544] ∈ {544} [545] ∈ {545} [546] ∈ {546} [547] ∈ {547} [548] ∈ {548} [549] ∈ {549} [550] ∈ {550} [551] ∈ {551} [552] ∈ {552} [553] ∈ {553} [554] ∈ {554} [555] ∈ {555} [556] ∈ {556} [557] ∈ {557} [558] ∈ {558} [559] ∈ {559} [560] ∈ {560} [561] ∈ {561} [562] ∈ {562} [563] ∈ {563} [564] ∈ {564} [565] ∈ {565} [566] ∈ {566} [567] ∈ {567} [568] ∈ {568} [569] ∈ {569} [570] ∈ {570} [571] ∈ {571} [572] ∈ {572} [573] ∈ {573} [574] ∈ {574} [575] ∈ {575} [576] ∈ {576} [577] ∈ {577} [578] ∈ {578} [579] ∈ {579} [580] ∈ {580} [581] ∈ {581} [582] ∈ {582} [583] ∈ {583} [584] ∈ {584} [585] ∈ {585} [586] ∈ {586} [587] ∈ {587} [588] ∈ {588} [589] ∈ {589} [590] ∈ {590} [591] ∈ {591} [592] ∈ {592} [593] ∈ {593} [594] ∈ {594} [595] ∈ {595} [596] ∈ {596} [597] ∈ {597} [598] ∈ {598} [599] ∈ {599} [600] ∈ {600} [601] ∈ {601} [602] ∈ {602} [603] ∈ {603} [604] ∈ {604} [605] ∈ {605} [606] ∈ {606} [607] ∈ {607} [608] ∈ {608} [609] ∈ {609} [610] ∈ {610} [611] ∈ {611} [612] ∈ {612} [613] ∈ {613} [614] ∈ {614} [615] ∈ {615} [616] ∈ {616} [617] ∈ {617} [618] ∈ {618} [619] ∈ {619} [620] ∈ {620} [621] ∈ {621} [622] ∈ {622} [623] ∈ {623} [624] ∈ {624} [625] ∈ {625} [626] ∈ {626} [627] ∈ {627} [628] ∈ {628} [629] ∈ {629} [630] ∈ {630} [631] ∈ {631} [632] ∈ {632} [633] ∈ {633} [634] ∈ {634} [635] ∈ {635} [636] ∈ {636} [637] ∈ {637} [638] ∈ {638} [639] ∈ {639} [640] ∈ {640} [641] ∈ {641} [642] ∈ {642} [643] ∈ {643} [644] ∈ {644} [645] ∈ {645} [646] ∈ {646} [647] ∈ {647} [648] ∈ {648} [649] ∈ {649} [650] ∈ {650} [651] ∈ {651} [652] ∈ {652} [653] ∈ {653} [654] ∈ {654} [655] ∈ {655} [656] ∈ {656} [657] ∈ {657} [658] ∈ {658} [659] ∈ {659} [660] ∈ {660} [661] ∈ {661} [662] ∈ {662} [663] ∈ {663} [664] ∈ {664} [665] ∈ {665} [666] ∈ {666} [667] ∈ {667} [668] ∈ {668} [669] ∈ {669} [670] ∈ {670} [671] ∈ {671} [672] ∈ {672} [673] ∈ {673} [674] ∈ {674} [675] ∈ {675} [676] ∈ {676} [677] ∈ {677} [678] ∈ {678} [679] ∈ {679} [680] ∈ {680} [681] ∈ {681} [682] ∈ {682} [683] ∈ {683} [684] ∈ {684} [685] ∈ {685} [686] ∈ {686} [687] ∈ {687} [688] ∈ {688} [689] ∈ {689} [690] ∈ {690} [691] ∈ {691} [692] ∈ {692} [693] ∈ {693} [694] ∈ {694} [695] ∈ {695} [696] ∈ {696} [697] ∈ {697} [698] ∈ {698} [699] ∈ {699} [700] ∈ {700} [701] ∈ {701} [702] ∈ {702} [703] ∈ {703} [704] ∈ {704} [705] ∈ {705} [706] ∈ {706} [707] ∈ {707} [708] ∈ {708} [709] ∈ {709} [710] ∈ {710} [711] ∈ {711} [712] ∈ {712} [713] ∈ {713} [714] ∈ {714} [715] ∈ {715} [716] ∈ {716} [717] ∈ {717} [718] ∈ {718} [719] ∈ {719} [720] ∈ {720} [721] ∈ {721} [722] ∈ {722} [723] ∈ {723} [724] ∈ {724} [725] ∈ {725} [726] ∈ {726} [727] ∈ {727} [728] ∈ {728} [729] ∈ {729} [730] ∈ {730} [731] ∈ {731} [732] ∈ {732} [733] ∈ {733} [734] ∈ {734} [735] ∈ {735} [736] ∈ {736} [737] ∈ {737} [738] ∈ {738} [739] ∈ {739} [740] ∈ {740} [741] ∈ {741} [742] ∈ {742} [743] ∈ {743} [744] ∈ {744} [745] ∈ {745} [746] ∈ {746} [747] ∈ {747} [748] ∈ {748} [749] ∈ {749} [750] ∈ {750} [751] ∈ {751} [752] ∈ {752} [753] ∈ {753} [754] ∈ {754} [755] ∈ {755} [756] ∈ {756} [757] ∈ {757} [758] ∈ {758} [759] ∈ {759} [760] ∈ {760} [761] ∈ {761} [762] ∈ {762} [763] ∈ {763} [764] ∈ {764} [765] ∈ {765} [766] ∈ {766} [767] ∈ {767} [768] ∈ {768} [769] ∈ {769} [770] ∈ {770} [771] ∈ {771} [772] ∈ {772} [773] ∈ {773} [774] ∈ {774} [775] ∈ {775} [776] ∈ {776} [777] ∈ {777} [778] ∈ {778} [779] ∈ {779} [780] ∈ {780} [781] ∈ {781} [782] ∈ {782} [783] ∈ {783} [784] ∈ {784} [785] ∈ {785} [786] ∈ {786} [787] ∈ {787} [788] ∈ {788} [789] ∈ {789} [790] ∈ {790} [791] ∈ {791} [792] ∈ {792} [793] ∈ {793} [794] ∈ {794} [795] ∈ {795} [796] ∈ {796} [797] ∈ {797} [798] ∈ {798} [799] ∈ {799} [800] ∈ {800} [801] ∈ {801} [802] ∈ {802} [803] ∈ {803} [804] ∈ {804} [805] ∈ {805} [806] ∈ {806} [807] ∈ {807} [808] ∈ {808} [809] ∈ {809} [810] ∈ {810} [811] ∈ {811} [812] ∈ {812} [813] ∈ {813} [814] ∈ {814} [815] ∈ {815} [816] ∈ {816} [817] ∈ {817} [818] ∈ {818} [819] ∈ {819} [820] ∈ {820} [821] ∈ {821} [822] ∈ {822} [823] ∈ {823} [824] ∈ {824} [825] ∈ {825} [826] ∈ {826} [827] ∈ {827} [828] ∈ {828} [829] ∈ {829} [830] ∈ {830} [831] ∈ {831} [832] ∈ {832} [833] ∈ {833} [834] ∈ {834} [835] ∈ {835} [836] ∈ {836} [837] ∈ {837} [838] ∈ {838} [839] ∈ {839} [840] ∈ {840} [841] ∈ {841} [842] ∈ {842} [843] ∈ {843} [844] ∈ {844} [845] ∈ {845} [846] ∈ {846} [847] ∈ {847} [848] ∈ {848} [849] ∈ {849} [850] ∈ {850} [851] ∈ {851} [852] ∈ {852} [853] ∈ {853} [854] ∈ {854} [855] ∈ {855} [856] ∈ {856} [857] ∈ {857} [858] ∈ {858} [859] ∈ {859} [860] ∈ {860} [861] ∈ {861} [862] ∈ {862} [863] ∈ {863} [864] ∈ {864} [865] ∈ {865} [866] ∈ {866} [867] ∈ {867} [868] ∈ {868} [869] ∈ {869} [870] ∈ {870} [871] ∈ {871} [872] ∈ {872} [873] ∈ {873} [874] ∈ {874} [875] ∈ {875} [876] ∈ {876} [877] ∈ {877} [878] ∈ {878} [879] ∈ {879} [880] ∈ {880} [881] ∈ {881} [882] ∈ {882} [883] ∈ {883} [884] ∈ {884} [885] ∈ {885} [886] ∈ {886} [887] ∈ {887} [888] ∈ {888} [889] ∈ {889} [890] ∈ {890} [891] ∈ {891} [892] ∈ {892} [893] ∈ {893} [894] ∈ {894} [895] ∈ {895} [896] ∈ {896} [897] ∈ {897} [898] ∈ {898} [899] ∈ {899} [900] ∈ {900} [901] ∈ {901} [902] ∈ {902} [903] ∈ {903} [904] ∈ {904} [905] ∈ {905} [906] ∈ {906} [907] ∈ {907} [908] ∈ {908} [909] ∈ {909} [910] ∈ {910} [911] ∈ {911} [912] ∈ {912} [913] ∈ {913} [914] ∈ {914} [915] ∈ {915} [916] ∈ {916} [917] ∈ {917} [918] ∈ {918} [919] ∈ {919} [920] ∈ {920} [921] ∈ {921} [922] ∈ {922} [923] ∈ {923} [924] ∈ {924} [925] ∈ {925} [926] ∈ {926} [927] ∈ {927} [928] ∈ {928} [929] ∈ {929} [930] ∈ {930} [931] ∈ {931} [932] ∈ {932} [933] ∈ {933} [934] ∈ {934} [935] ∈ {935} [936] ∈ {936} [937] ∈ {937} [938] ∈ {938} [939] ∈ {939} [940] ∈ {940} [941] ∈ {941} [942] ∈ {942} [943] ∈ {943} [944] ∈ {944} [945] ∈ {945} [946] ∈ {946} [947] ∈ {947} [948] ∈ {948} [949] ∈ {949} [950] ∈ {950} [951] ∈ {951} [952] ∈ {952} [953] ∈ {953} [954] ∈ {954} [955] ∈ {955} [956] ∈ {956} [957] ∈ {957} [958] ∈ {958} [959] ∈ {959} [960] ∈ {960} [961] ∈ {961} [962] ∈ {962} [963] ∈ {963} [964] ∈ {964} [965] ∈ {965} [966] ∈ {966} [967] ∈ {967} [968] ∈ {968} [969] ∈ {969} [970] ∈ {970} [971] ∈ {971} [972] ∈ {972} [973] ∈ {973} [974] ∈ {974} [975] ∈ {975} [976] ∈ {976} [977] ∈ {977} [978] ∈ {978} [979] ∈ {979} [980] ∈ {980} [981] ∈ {981} [982] ∈ {982} [983] ∈ {983} [984] ∈ {984} [985] ∈ {985} [986] ∈ {986} [987] ∈ {987} [988] ∈ {988} [989] ∈ {989} [990] ∈ {990} [991] ∈ {991} [992] ∈ {992} [993] ∈ {993} [994] ∈ {994} [995] ∈ {995} [996] ∈ {996} [997] ∈ {997} [998] ∈ {998} [999] ∈ {999} [1000] ∈ {1000} [1001] ∈ {1001} [1002] ∈ {1002} [1003] ∈ {1003} [1004] ∈ {1004} [1005] ∈ {1005} [1006] ∈ {1006} [1007] ∈ {1007} [1008] ∈ {1008} [1009] ∈ {1009} [1010] ∈ {1010} [1011] ∈ {1011} [1012] ∈ {1012} [1013] ∈ {1013} [1014] ∈ {1014} [1015] ∈ {1015} [1016] ∈ {1016} [1017] ∈ {1017} [1018] ∈ {1018} [1019] ∈ {1019} [1020] ∈ {1020} [1021] ∈ {1021} [1022] ∈ {1022} [1023] ∈ {1023} [1024] ∈ {1024} [1025] ∈ {1025} [1026] ∈ {1026} [1027] ∈ {1027} [1028] ∈ {1028} [1029] ∈ {1029} [1030] ∈ {1030} [1031] ∈ {1031} [1032] ∈ {1032} [1033] ∈ {1033} [1034] ∈ {1034} [1035] ∈ {1035} [1036] ∈ {1036} [1037] ∈ {1037} [1038] ∈ {1038} [1039] ∈ {1039} [1040] ∈ {1040} [1041] ∈ {1041} [1042] ∈ {1042} [1043] ∈ {1043} [1044] ∈ {1044} [1045] ∈ {1045} [1046] ∈ {1046} [1047] ∈ {1047} [1048] ∈ {1048} [1049] ∈ {1049} [1050] ∈ {1050} [1051] ∈ {1051} [1052] ∈ {1052} [1053] ∈ {1053} [1054] ∈ {1054} [1055] ∈ {1055} [1056] ∈ {1056} [1057] ∈ {1057} [1058] ∈ {1058} [1059] ∈ {1059} [1060] ∈ {1060} [1061] ∈ {1061} [1062] ∈ {1062} [1063] ∈ {1063} [1064] ∈ {1064} [1065] ∈ {1065} [1066] ∈ {1066} [1067] ∈ {1067} [1068] ∈ {1068} [1069] ∈ {1069} [1070] ∈ {1070} [1071] ∈ {1071} [1072] ∈ {1072} [1073] ∈ {1073} [1074] ∈ {1074} [1075] ∈ {1075} [1076] ∈ {1076} [1077] ∈ {1077} [1078] ∈ {1078} [1079] ∈ {1079} [1080] ∈ {1080} [1081] ∈ {1081} [1082] ∈ {1082} [1083] ∈ {1083} [1084] ∈ {1084} [1085] ∈ {1085} [1086] ∈ {1086} [1087] ∈ {1087} [1088] ∈ {1088} [1089] ∈ {1089} [1090] ∈ {1090} [1091] ∈ {1091} [1092] ∈ {1092} [1093] ∈ {1093} [1094] ∈ {1094} [1095] ∈ {1095} [1096] ∈ {1096} [1097] ∈ {1097} [1098] ∈ {1098} [1099] ∈ {1099} [1100] ∈ {1100} [1101] ∈ {1101} [1102] ∈ {1102} [1103] ∈ {1103} [1104] ∈ {1104} [1105] ∈ {1105} [1106] ∈ {1106} [1107] ∈ {1107} [1108] ∈ {1108} [1109] ∈ {1109} [1110] ∈ {1110} [1111] ∈ {1111} [1112] ∈ {1112} [1113] ∈ {1113} [1114] ∈ {1114} [1115] ∈ {1115} [1116] ∈ {1116} [1117] ∈ {1117} [1118] ∈ {1118} [1119] ∈ {1119} [1120] ∈ {1120} [1121] ∈ {1121} [1122] ∈ {1122} [1123] ∈ {1123} [1124] ∈ {1124} [1125] ∈ {1125} [1126] ∈ {1126} [1127] ∈ {1127} [1128] ∈ {1128} [1129] ∈ {1129} [1130] ∈ {1130} [1131] ∈ {1131} [1132] ∈ {1132} [1133] ∈ {1133} [1134] ∈ {1134} [1135] ∈ {1135} [1136] ∈ {1136} [1137] ∈ {1137} [1138] ∈ {1138} [1139] ∈ {1139} [1140] ∈ {1140} [1141] ∈ {1141} [1142] ∈ {1142} [1143] ∈ {1143} [1144] ∈ {1144} [1145] ∈ {1145} [1146] ∈ {1146} [1147] ∈ {1147} [1148] ∈ {1148} [1149] ∈ {1149} [1150] ∈ {1150} [1151] ∈ {1151} [1152] ∈ {1152} [1153] ∈ {1153} [1154] ∈ {1154} [1155] ∈ {1155} [1156] ∈ {1156} [1157] ∈ {1157} [1158] ∈ {1158} [1159] ∈ {1159} [1160] ∈ {1160} [1161] ∈ {1161} [1162] ∈ {1162} [1163] ∈ {1163} [1164] ∈ {1164} [1165] ∈ {1165} [1166] ∈ {1166} [1167] ∈ {1167} [1168] ∈ {1168} [1169] ∈ {1169} [1170] ∈ {1170} [1171] ∈ {1171} [1172] ∈ {1172} [1173] ∈ {1173} [1174] ∈ {1174} [1175] ∈ {1175} [1176] ∈ {1176} [1177] ∈ {1177} [1178] ∈ {1178} [1179] ∈ {1179} [1180] ∈ {1180} [1181] ∈ {1181} [1182] ∈ {1182} [1183] ∈ {1183} [1184] ∈ {1184} [1185] ∈ {1185} [1186] ∈ {1186} [1187] ∈ {1187} [1188] ∈ {1188} [1189] ∈ {1189} [1190] ∈ {1190} [1191] ∈ {1191} [1192] ∈ {1192} [1193] ∈ {1193} [1194] ∈ {1194} [1195] ∈ {1195} [1196] ∈ {1196} [1197] ∈ {1197} [1198] ∈ {1198} [1199] ∈ {1199} [1200] ∈ {1200} [1201] ∈ {1201} [1202] ∈ {1202} [1203] ∈ {1203} [1204] ∈ {1204} [1205] ∈ {1205} [1206] ∈ {1206} [1207] ∈ {1207} [1208] ∈ {1208} [1209] ∈ {1209} [1210] ∈ {1210} [1211] ∈ {1211} [1212] ∈ {1212} [1213] ∈ {1213} [1214] ∈ {1214} [1215] ∈ {1215} [1216] ∈ {1216} [1217] ∈ {1217} [1218] ∈ {1218} [1219] ∈ {1219} [1220] ∈ {1220} [1221] ∈ {1221} [1222] ∈ {1222} [1223] ∈ {1223} [1224] ∈ {1224} [1225] ∈ {1225} [1226] ∈ {1226} [1227] ∈ {1227} [1228] ∈ {1228} [1229] ∈ {1229} [1230] ∈ {1230} [1231] ∈ {1231} [1232] ∈ {1232} [1233] ∈ {1233} [1234] ∈ {1234} [1235] ∈ {1235} [1236] ∈ {1236} [1237] ∈ {1237} [1238] ∈ {1238} [1239] ∈ {1239} [1240] ∈ {1240} [1241] ∈ {1241} [1242] ∈ {1242} [1243] ∈ {1243} [1244] ∈ {1244} [1245] ∈ {1245} [1246] ∈ {1246} [1247] ∈ {1247} [1248] ∈ {1248} [1249] ∈ {1249} [1250] ∈ {1250} [1251] ∈ {1251} [1252] ∈ {1252} [1253] ∈ {1253} [1254] ∈ {1254} [1255] ∈ {1255} [1256] ∈ {1256} [1257] ∈ {1257} [1258] ∈ {1258} [1259] ∈ {1259} [1260] ∈ {1260} [1261] ∈ {1261} [1262] ∈ {1262} [1263] ∈ {1263} [1264] ∈ {1264} [1265] ∈ {1265} [1266] ∈ {1266} [1267] ∈ {1267} [1268] ∈ {1268} [1269] ∈ {1269} [1270] ∈ {1270} [1271] ∈ {1271} [1272] ∈ {1272} [1273] ∈ {1273} [1274] ∈ {1274} [1275] ∈ {1275} [1276] ∈ {1276} [1277] ∈ {1277} [1278] ∈ {1278} [1279] ∈ {1279} [1280] ∈ {1280} [1281] ∈ {1281} [1282] ∈ {1282} [1283] ∈ {1283} [1284] ∈ {1284} [1285] ∈ {1285} [1286] ∈ {1286} [1287] ∈ {1287} [1288] ∈ {1288} [1289] ∈ {1289} [1290] ∈ {1290} [1291] ∈ {1291} [1292] ∈ {1292} [1293] ∈ {1293} [1294] ∈ {1294} [1295] ∈ {1295} [1296] ∈ {1296} [1297] ∈ {1297} [1298] ∈ {1298} [1299] ∈ {1299} [1300] ∈ {1300} [1301] ∈ {1301} [1302] ∈ {1302} [1303] ∈ {1303} [1304] ∈ {1304} [1305] ∈ {1305} [1306] ∈ {1306} [1307] ∈ {1307} [1308] ∈ {1308} [1309] ∈ {1309} [1310] ∈ {1310} [1311] ∈ {1311} [1312] ∈ {1312} [1313] ∈ {1313} [1314] ∈ {1314} [1315] ∈ {1315} [1316] ∈ {1316} [1317] ∈ {1317} [1318] ∈ {1318} [1319] ∈ {1319} [1320] ∈ {1320} [1321] ∈ {1321} [1322] ∈ {1322} [1323] ∈ {1323} [1324] ∈ {1324} [1325] ∈ {1325} [1326] ∈ {1326} [1327] ∈ {1327} [1328] ∈ {1328} [1329] ∈ {1329} [1330] ∈ {1330} [1331] ∈ {1331} [1332] ∈ {1332} [1333] ∈ {1333} [1334] ∈ {1334} [1335] ∈ {1335} [1336] ∈ {1336} [1337] ∈ {1337} [1338] ∈ {1338} [1339] ∈ {1339} [1340] ∈ {1340} [1341] ∈ {1341} [1342] ∈ {1342} [1343] ∈ {1343} [1344] ∈ {1344} [1345] ∈ {1345} [1346] ∈ {1346} [1347] ∈ {1347} [1348] ∈ {1348} [1349] ∈ {1349} [1350] ∈ {1350} [1351] ∈ {1351} [1352] ∈ {1352} [1353] ∈ {1353} [1354] ∈ {1354} [1355] ∈ {1355} [1356] ∈ {1356} [1357] ∈ {1357} [1358] ∈ {1358} [1359] ∈ {1359} [1360] ∈ {1360} [1361] ∈ {1361} [1362] ∈ {1362} [1363] ∈ {1363} [1364] ∈ {1364} [1365] ∈ {1365} [1366] ∈ {1366} [1367] ∈ {1367} [1368] ∈ {1368} [1369] ∈ {1369} [1370] ∈ {1370} [1371] ∈ {1371} [1372] ∈ {1372} [1373] ∈ {1373} [1374] ∈ {1374} [1375] ∈ {1375} [1376] ∈ {1376} [1377] ∈ {1377} [1378] ∈ {1378} [1379] ∈ {1379} [1380] ∈ {1380} [1381] ∈ {1381} [1382] ∈ {1382} [1383] ∈ {1383} [1384] ∈ {1384} [1385] ∈ {1385} [1386] ∈ {1386} [1387] ∈ {1387} [1388] ∈ {1388} [1389] ∈ {1389} [1390] ∈ {1390} [1391] ∈ {1391} [1392] ∈ {1392} [1393] ∈ {1393} [1394] ∈ {1394} [1395] ∈ {1395} [1396] ∈ {1396} [1397] ∈ {1397} [1398] ∈ {1398} [1399] ∈ {1399} [1400] ∈ {1400} [1401] ∈ {1401} [1402] ∈ {1402} [1403] ∈ {1403} [1404] ∈ {1404} [1405] ∈ {1405} [1406] ∈ {1406} [1407] ∈ {1407} [1408] ∈ {1408} [1409] ∈ {1409} [1410] ∈ {1410} [1411] ∈ {1411} [1412] ∈ {1412} [1413] ∈ {1413} [1414] ∈ {1414} [1415] ∈ {1415} [1416] ∈ {1416} [1417] ∈ {1417} [1418] ∈ {1418} [1419] ∈ {1419} [1420] ∈ {1420} [1421] ∈ {1421} [1422] ∈ {1422} [1423] ∈ {1423} [1424] ∈ {1424} [1425] ∈ {1425} [1426] ∈ {1426} [1427] ∈ {1427} [1428] ∈ {1428} [1429] ∈ {1429} [1430] ∈ {1430} [1431] ∈ {1431} [1432] ∈ {1432} [1433] ∈ {1433} [1434] ∈ {1434} [1435] ∈ {1435} [1436] ∈ {1436} [1437] ∈ {1437} [1438] ∈ {1438} [1439] ∈ {1439} [1440] ∈ {1440} [1441] ∈ {1441} [1442] ∈ {1442} [1443] ∈ {1443} [1444] ∈ {1444} [1445] ∈ {1445} [1446] ∈ {1446} [1447] ∈ {1447} [1448] ∈ {1448} [1449] ∈ {1449} [1450] ∈ {1450} [1451] ∈ {1451} [1452] ∈ {1452} [1453] ∈ {1453} [1454] ∈ {1454} [1455] ∈ {1455} [1456] ∈ {1456} [1457] ∈ {1457} [1458] ∈ {1458} [1459] ∈ {1459} [1460] ∈ {1460} [1461] ∈ {1461} [1462] ∈ {1462} [1463] ∈ {1463} [1464] ∈ {1464} [1465] ∈ {1465} [1466] ∈ {1466} [1467] ∈ {1467} [1468] ∈ {1468} [1469] ∈ {1469} [1470] ∈ {1470} [1471] ∈ {1471} [1472] ∈ {1472} [1473] ∈ {1473} [1474] ∈ {1474} [1475] ∈ {1475} [1476] ∈ {1476} [1477] ∈ {1477} [1478] ∈ {1478} [1479] ∈ {1479} [1480] ∈ {1480} [1481] ∈ {1481} [1482] ∈ {1482} [1483] ∈ {1483} [1484] ∈ {1484} [1485] ∈ {1485} [1486] ∈ {1486} [1487] ∈ {1487} [1488] ∈ {1488} [1489] ∈ {1489} [1490] ∈ {1490} [1491] ∈ {1491} [1492] ∈ {1492} [1493] ∈ {1493} [1494] ∈ {1494} [1495] ∈ {1495} [1496] ∈ {1496} [1497] ∈ {1497} [1498] ∈ {1498} [1499] ∈ {1499} [1500] ∈ {1500} [1501] ∈ {1501} [1502] ∈ {1502} [1503] ∈ {1503} [1504] ∈ {1504} [1505] ∈ {1505} [1506] ∈ {1506} [1507] ∈ {1507} [1508] ∈ {1508} [1509] ∈ {1509} [1510] ∈ {1510} [1511] ∈ {1511} [1512] ∈ {1512} [1513] ∈ {1513} [1514] ∈ {1514} [1515] ∈ {1515} [1516] ∈ {1516} [1517] ∈ {1517} [1518] ∈ {1518} [1519] ∈ {1519} [1520] ∈ {1520} [1521] ∈ {1521} [1522] ∈ {1522} [1523] ∈ {1523} [1524] ∈ {1524} [1525] ∈ {1525} [1526] ∈ {1526} [1527] ∈ {1527} [1528] ∈ {1528} [1529] ∈ {1529} [1530] ∈ {1530} [1531] ∈ {1531} [1532] ∈ {1532} [1533] ∈ {1533} [1534] ∈ {1534} [1535] ∈ {1535} [1536] ∈ {1536} [1537] ∈ {1537} [1538] ∈ {1538} [1539] ∈ {1539} [1540] ∈ {1540} [1541] ∈ {1541} [1542] ∈ {1542} [1543] ∈ {1543} [1544] ∈ {1544} [1545] ∈ {1545} [1546] ∈ {1546} [1547] ∈ {1547} [1548] ∈ {1548} [1549] ∈ {1549} [1550] ∈ {1550} [1551] ∈ {1551} [1552] ∈ {1552} [1553] ∈ {1553} [1554] ∈ {1554} [1555] ∈ {1555} [1556] ∈ {1556} [1557] ∈ {1557} [1558] ∈ {1558} [1559] ∈ {1559} [1560] ∈ {1560} [1561] ∈ {1561} [1562] ∈ {1562} [1563] ∈ {1563} [1564] ∈ {1564} [1565] ∈ {1565} [1566] ∈ {1566} [1567] ∈ {1567} [1568] ∈ {1568} [1569] ∈ {1569} [1570] ∈ {1570} [1571] ∈ {1571} [1572] ∈ {1572} [1573] ∈ {1573} [1574] ∈ {1574} [1575] ∈ {1575} [1576] ∈ {1576} [1577] ∈ {1577} [1578] ∈ {1578} [1579] ∈ {1579} [1580] ∈ {1580} [1581] ∈ {1581} [1582] ∈ {1582} [1583] ∈ {1583} [1584] ∈ {1584} [1585] ∈ {1585} [1586] ∈ {1586} [1587] ∈ {1587} [1588] ∈ {1588} [1589] ∈ {1589} [1590] ∈ {1590} [1591] ∈ {1591} [1592] ∈ {1592} [1593] ∈ {1593} [1594] ∈ {1594} [1595] ∈ {1595} [1596] ∈ {1596} [1597] ∈ {1597} [1598] ∈ {1598} [1599] ∈ {1599} [1600] ∈ {1600} [1601] ∈ {1601} [1602] ∈ {1602} [1603] ∈ {1603} [1604] ∈ {1604} [1605] ∈ {1605} [1606] ∈ {1606} [1607] ∈ {1607} [1608] ∈ {1608} [1609] ∈ {1609} [1610] ∈ {1610} [1611] ∈ {1611} [1612] ∈ {1612} [1613] ∈ {1613} [1614] ∈ {1614} [1615] ∈ {1615} [1616] ∈ {1616} [1617] ∈ {1617} [1618] ∈ {1618} [1619] ∈ {1619} [1620] ∈ {1620} [1621] ∈ {1621} [1622] ∈ {1622} [1623] ∈ {1623} [1624] ∈ {1624} [1625] ∈ {1625} [1626] ∈ {1626} [1627] ∈ {1627} [1628] ∈ {1628} [1629] ∈ {1629} [1630] ∈ {1630} [1631] ∈ {1631} [1632] ∈ {1632} [1633] ∈ {1633} [1634] ∈ {1634} [1635] ∈ {1635} [1636] ∈ {1636} [1637] ∈ {1637} [1638] ∈ {1638} [1639] ∈ {1639} [1640] ∈ {1640} [1641] ∈ {1641} [1642] ∈ {1642} [1643] ∈ {1643} [1644] ∈ {1644} [1645] ∈ {1645} [1646] ∈ {1646} [1647] ∈ {1647} [1648] ∈ {1648} [1649] ∈ {1649} [1650] ∈ {1650} [1651] ∈ {1651} [1652] ∈ {1652} [1653] ∈ {1653} [1654] ∈ {1654} [1655] ∈ {1655} [1656] ∈ {1656} [1657] ∈ {1657} [1658] ∈ {1658} [1659] ∈ {1659} [1660] ∈ {1660} [1661] ∈ {1661} [1662] ∈ {1662} [1663] ∈ {1663} [1664] ∈ {1664} [1665] ∈ {1665} [1666] ∈ {1666} [1667] ∈ {1667} [1668] ∈ {1668} [1669] ∈ {1669} [1670] ∈ {1670} [1671] ∈ {1671} [1672] ∈ {1672} [1673] ∈ {1673} [1674] ∈ {1674} [1675] ∈ {1675} [1676] ∈ {1676} [1677] ∈ {1677} [1678] ∈ {1678} [1679] ∈ {1679} [1680] ∈ {1680} [1681] ∈ {1681} [1682] ∈ {1682} [1683] ∈ {1683} [1684] ∈ {1684} [1685] ∈ {1685} [1686] ∈ {1686} [1687] ∈ {1687} [1688] ∈ {1688} [1689] ∈ {1689} [1690] ∈ {1690} [1691] ∈ {1691} [1692] ∈ {1692} [1693] ∈ {1693} [1694] ∈ {1694} [1695] ∈ {1695} [1696] ∈ {1696} [1697] ∈ {1697} [1698] ∈ {1698} [1699] ∈ {1699} [1700] ∈ {1700} [1701] ∈ {1701} [1702] ∈ {1702} [1703] ∈ {1703} [1704] ∈ {1704} [1705] ∈ {1705} [1706] ∈ {1706} [1707] ∈ {1707} [1708] ∈ {1708} [1709] ∈ {1709} [1710] ∈ {1710} [1711] ∈ {1711} [1712] ∈ {1712} [1713] ∈ {1713} [1714] ∈ {1714} [1715] ∈ {1715} [1716] ∈ {1716} [1717] ∈ {1717} [1718] ∈ {1718} [1719] ∈ {1719} [1720] ∈ {1720} [1721] ∈ {1721} [1722] ∈ {1722} [1723] ∈ {1723} [1724] ∈ {1724} [1725] ∈ {1725} [1726] ∈ {1726} [1727] ∈ {1727} [1728] ∈ {1728} [1729] ∈ {1729} [1730] ∈ {1730} [1731] ∈ {1731} [1732] ∈ {1732} [1733] ∈ {1733} [1734] ∈ {1734} [1735] ∈ {1735} [1736] ∈ {1736} [1737] ∈ {1737} [1738] ∈ {1738} [1739] ∈ {1739} [1740] ∈ {1740} [1741] ∈ {1741} [1742] ∈ {1742} [1743] ∈ {1743} [1744] ∈ {1744} [1745] ∈ {1745} [1746] ∈ {1746} [1747] ∈ {1747} [1748] ∈ {1748} [1749] ∈ {1749} [1750] ∈ {1750} [1751] ∈ {1751} [1752] ∈ {1752} [1753] ∈ {1753} [1754] ∈ {1754} [1755] ∈ {1755} [1756] ∈ {1756} [1757] ∈ {1757} [1758] ∈ {1758} [1759] ∈ {1759} [1760] ∈ {1760} [1761] ∈ {1761} [1762] ∈ {1762} [1763] ∈ {1763} [1764] ∈ {1764} [1765] ∈ {1765} [1766] ∈ {1766} [1767] ∈ {1767} [1768] ∈ {1768} [1769] ∈ {1769} [1770] ∈ {1770} [1771] ∈ {1771} [1772] ∈ {1772} [1773] ∈ {1773} [1774] ∈ {1774} [1775] ∈ {1775} [1776] ∈ {1776} [1777] ∈ {1777} [1778] ∈ {1778} [1779] ∈ {1779} [1780] ∈ {1780} [1781] ∈ {1781} [1782] ∈ {1782} [1783] ∈ {1783} [1784] ∈ {1784} [1785] ∈ {1785} [1786] ∈ {1786} [1787] ∈ {1787} [1788] ∈ {1788} [1789] ∈ {1789} [1790] ∈ {1790} [1791] ∈ {1791} [1792] ∈ {1792} [1793] ∈ {1793} [1794] ∈ {1794} [1795] ∈ {1795} [1796] ∈ {1796} [1797] ∈ {1797} [1798] ∈ {1798} [1799] ∈ {1799} [1800] ∈ {1800} [1801] ∈ {1801} [1802] ∈ {1802} [1803] ∈ {1803} [1804] ∈ {1804} [1805] ∈ {1805} [1806] ∈ {1806} [1807] ∈ {1807} [1808] ∈ {1808} [1809] ∈ {1809} [1810] ∈ {1810} [1811] ∈ {1811} [1812] ∈ {1812} [1813] ∈ {1813} [1814] ∈ {1814} [1815] ∈ {1815} [1816] ∈ {1816} [1817] ∈ {1817} [1818] ∈ {1818} [1819] ∈ {1819} [1820] ∈ {1820} [1821] ∈ {1821} [1822] ∈ {1822} [1823] ∈ {1823} [1824] ∈ {1824} [1825] ∈ {1825} [1826] ∈ {1826} [1827] ∈ {1827} [1828] ∈ {1828} [1829] ∈ {1829} [1830] ∈ {1830} [1831] ∈ {1831} [1832] ∈ {1832} [1833] ∈ {1833} [1834] ∈ {1834} [1835] ∈ {1835} [1836] ∈ {1836} [1837] ∈ {1837} [1838] ∈ {1838} [1839] ∈ {1839} [1840] ∈ {1840} [1841] ∈ {1841} [1842] ∈ {1842} [1843] ∈ {1843} [1844] ∈ {1844} [1845] ∈ {1845} [1846] ∈ {1846} [1847] ∈ {1847} [1848] ∈ {1848} [1849] ∈ {1849} [1850] ∈ {1850} [1851] ∈ {1851} [1852] ∈ {1852} [1853] ∈ {1853} [1854] ∈ {1854} [1855] ∈ {1855} [1856] ∈ {1856} [1857] ∈ {1857} [1858] ∈ {1858} [1859] ∈ {1859} [1860] ∈ {1860} [1861] ∈ {1861} [1862] ∈ {1862} [1863] ∈ {1863} [1864] ∈ {1864} [1865] ∈ {1865} [1866] ∈ {1866} [1867] ∈ {1867} [1868] ∈ {1868} [1869] ∈ {1869} [1870] ∈ {1870} [1871] ∈ {1871} [1872] ∈ {1872} [1873] ∈ {1873} [1874] ∈ {1874} [1875] ∈ {1875} [1876] ∈ {1876} [1877] ∈ {1877} [1878] ∈ {1878} [1879] ∈ {1879} [1880] ∈ {1880} [1881] ∈ {1881} [1882] ∈ {1882} [1883] ∈ {1883} [1884] ∈ {1884} [1885] ∈ {1885} [1886] ∈ {1886} [1887] ∈ {1887} [1888] ∈ {1888} [1889] ∈ {1889} [1890] ∈ {1890} [1891] ∈ {1891} [1892] ∈ {1892} [1893] ∈ {1893} [1894] ∈ {1894} [1895] ∈ {1895} [1896] ∈ {1896} [1897] ∈ {1897} [1898] ∈ {1898} [1899] ∈ {1899} [1900] ∈ {1900} [1901] ∈ {1901} [1902] ∈ {1902} [1903] ∈ {1903} [1904] ∈ {1904} [1905] ∈ {1905} [1906] ∈ {1906} [1907] ∈ {1907} [1908] ∈ {1908} [1909] ∈ {1909} [1910] ∈ {1910} [1911] ∈ {1911} [1912] ∈ {1912} [1913] ∈ {1913} [1914] ∈ {1914} [1915] ∈ {1915} [1916] ∈ {1916} [1917] ∈ {1917} [1918] ∈ {1918} [1919] ∈ {1919} [1920] ∈ {1920} [1921] ∈ {1921} [1922] ∈ {1922} [1923] ∈ {1923} [1924] ∈ {1924} [1925] ∈ {1925} [1926] ∈ {1926} [1927] ∈ {1927} [1928] ∈ {1928} [1929] ∈ {1929} [1930] ∈ {1930} [1931] ∈ {1931} [1932] ∈ {1932} [1933] ∈ {1933} [1934] ∈ {1934} [1935] ∈ {1935} [1936] ∈ {1936} [1937] ∈ {1937} [1938] ∈ {1938} [1939] ∈ {1939} [1940] ∈ {1940} [1941] ∈ {1941} [1942] ∈ {1942} [1943] ∈ {1943} [1944] ∈ {1944} [1945] ∈ {1945} [1946] ∈ {1946} [1947] ∈ {1947} [1948] ∈ {1948} [1949] ∈ {1949} [1950] ∈ {1950} [1951] ∈ {1951} [1952] ∈ {1952} [1953] ∈ {1953} [1954] ∈ {1954} [1955] ∈ {1955} [1956] ∈ {1956} [1957] ∈ {1957} [1958] ∈ {1958} [1959] ∈ {1959} [1960] ∈ {1960} [1961] ∈ {1961} [1962] ∈ {1962} [1963] ∈ {1963} [1964] ∈ {1964} [1965] ∈ {1965} [1966] ∈ {1966} [1967] ∈ {1967} [1968] ∈ {1968} [1969] ∈ {1969} [1970] ∈ {1970} [1971] ∈ {1971} [1972] ∈ {1972} [1973] ∈ {1973} [1974] ∈ {1974} [1975] ∈ {1975} [1976] ∈ {1976} [1977] ∈ {1977} [1978] ∈ {1978} [1979] ∈ {1979} [1980] ∈ {1980} [1981] ∈ {1981} [1982] ∈ {1982} [1983] ∈ {1983} [1984] ∈ {1984} [1985] ∈ {1985} [1986] ∈ {1986} [1987] ∈ {1987} [1988] ∈ {1988} [1989] ∈ {1989} [1990] ∈ {1990} [1991] ∈ {1991} [1992] ∈ {1992} [1993] ∈ {1993} [1994] ∈ {1994} [1995] ∈ {1995} [1996] ∈ {1996} [1997] ∈ {1997} [1998] ∈ {1998} [1999] ∈ {1999} [2000] ∈ {2000} [2001] ∈ {2001} [2002] ∈ {2002} [2003] ∈ {2003} [2004] ∈ {2004} [2005] ∈ {2005} [2006] ∈ {2006} [2007] ∈ {2007} [2008] ∈ {2008} [2009] ∈ {2009} [2010] ∈ {2010} [2011] ∈ {2011} [2012] ∈ {2012} [2013] ∈ {2013} [2014] ∈ {2014} [2015] ∈ {2015} [2016] ∈ {2016} [2017] ∈ {2017} [2018] ∈ {2018} [2019] ∈ {2019} [2020] ∈ {2020} [2021] ∈ {2021} [2022] ∈ {2022} [2023] ∈ {2023} [2024] ∈ {2024} [2025] ∈ {2025} [2026] ∈ {2026} [2027] ∈ {2027} [2028] ∈ {2028} [2029] ∈ {2029} [2030] ∈ {2030} [2031] ∈ {2031} [2032] ∈ {2032} [2033] ∈ {2033} [2034] ∈ {2034} [2035] ∈ {2035} [2036] ∈ {2036} [2037] ∈ {2037} [2038] ∈ {2038} [2039] ∈ {2039} [2040] ∈ {2040} [2041] ∈ {2041} [2042] ∈ {2042} [2043] ∈ {2043} [2044] ∈ {2044} [2045] ∈ {2045} [2046] ∈ {2046} [2047] ∈ {2047} [2048] ∈ {2048} [2049] ∈ {2049} [2050] ∈ {2050} [2051] ∈ {2051} [2052] ∈ {2052} [2053] ∈ {2053} [2054] ∈ {2054} [2055] ∈ {2055} [2056] ∈ {2056} [2057] ∈ {2057} [2058] ∈ {2058} [2059] ∈ {2059} [2060] ∈ {2060} [2061] ∈ {2061} [2062] ∈ {2062} [2063] ∈ {2063} [2064] ∈ {2064} [2065] ∈ {2065} [2066] ∈ {2066} [2067] ∈ {2067} [2068] ∈ {2068} [2069] ∈ {2069} [2070] ∈ {2070} [2071] ∈ {2071} [2072] ∈ {2072} [2073] ∈ {2073} [2074] ∈ {2074} [2075] ∈ {2075} [2076] ∈ {2076} [2077] ∈ {2077} [2078] ∈ {2078} [2079] ∈ {2079} [2080] ∈ {2080} [2081] ∈ {2081} [2082] ∈ {2082} [2083] ∈ {2083} [2084] ∈ {2084} [2085] ∈ {2085} [2086] ∈ {2086} [2087] ∈ {2087} [2088] ∈ {2088} [2089] ∈ {2089} [2090] ∈ {2090} [2091] ∈ {2091} [2092] ∈ {2092} [2093] ∈ {2093} [2094] ∈ {2094} [2095] ∈ {2095} [2096] ∈ {2096} [2097] ∈ {2097} [2098] ∈ {2098} [2099] ∈ {2099} [2100] ∈ {2100} [2101] ∈ {2101} [2102] ∈ {2102} [2103] ∈ {2103} [2104] ∈ {2104} [2105] ∈ {2105} [2106] ∈ {2106} [2107] ∈ {2107} [2108] ∈ {2108} [2109] ∈ {2109} [2110] ∈ {2110} [2111] ∈ {2111} [2112] ∈ {2112} [2113] ∈ {2113} [2114] ∈ {2114} [2115] ∈ {2115} [2116] ∈ {2116} [2117] ∈ {2117} [2118] ∈ {2118} [2119] ∈ {2119} [2120] ∈ {2120} [2121] ∈ {2121} [2122] ∈ {2122} [2123] ∈ {2123} [2124] ∈ {2124} [2125] ∈ {2125} [2126] ∈ {2126} [2127] ∈ {2127} [2128] ∈ {2128} [2129] ∈ {2129} [2130] ∈ {2130} [2131] ∈ {2131} [2132] ∈ {2132} [2133] ∈ {2133} [2134] ∈ {2134} [2135] ∈ {2135} [2136] ∈ {2136} [2137] ∈ {2137} [2138] ∈ {2138} [2139] ∈ {2139} [2140] ∈ {2140} [2141] ∈ {2141} [2142] ∈ {2142} [2143] ∈ {2143} [2144] ∈ {2144} [2145] ∈ {2145} [2146] ∈ {2146} [2147] ∈ {2147} [2148] ∈ {2148} [2149] ∈ {2149} [2150] ∈ {2150} [2151] ∈ {2151} [2152] ∈ {2152} [2153] ∈ {2153} [2154] ∈ {2154} [2155] ∈ {2155} [2156] ∈ {2156} [2157] ∈ {2157} [2158] ∈ {2158} [2159] ∈ {2159} [2160] ∈ {2160} [2161] ∈ {2161} [2162] ∈ {2162} [2163] ∈ {2163} [2164] ∈ {2164} [2165] ∈ {2165} [2166] ∈ {2166} [2167] ∈ {2167} [2168] ∈ {2168} [2169] ∈ {2169} [2170] ∈ {2170} [2171] ∈ {2171} [2172] ∈ {2172} [2173] ∈ {2173} [2174] ∈ {2174} [2175] ∈ {2175} [2176] ∈ {2176} [2177] ∈ {2177} [2178] ∈ {2178} [2179] ∈ {2179} [2180] ∈ {2180} [2181] ∈ {2181} [2182] ∈ {2182} [2183] ∈ {2183} [2184] ∈ {2184} [2185] ∈ {2185} [2186] ∈ {2186} [2187] ∈ {2187} [2188] ∈ {2188} [2189] ∈ {2189} [2190] ∈ {2190} [2191] ∈ {2191} [2192] ∈ {2192} [2193] ∈ {2193} [2194] ∈ {2194} [2195] ∈ {2195} [2196] ∈ {2196} [2197] ∈ {2197} [2198] ∈ {2198} [2199] ∈ {2199} [2200] ∈ {2200} [2201] ∈ {2201} [2202] ∈ {2202} [2203] ∈ {2203} [2204] ∈ {2204} [2205] ∈ {2205} [2206] ∈ {2206} [2207] ∈ {2207} [2208] ∈ {2208} [2209] ∈ {2209} [2210] ∈ {2210} [2211] ∈ {2211} [2212] ∈ {2212} [2213] ∈ {2213} [2214] ∈ {2214} [2215] ∈ {2215} [2216] ∈ {2216} [2217] ∈ {2217} [2218] ∈ {2218} [2219] ∈ {2219} [2220] ∈ {2220} [2221] ∈ {2221} [2222] ∈ {2222} [2223] ∈ {2223} [2224] ∈ {2224} [2225] ∈ {2225} [2226] ∈ {2226} [2227] ∈ {2227} [2228] ∈ {2228} [2229] ∈ {2229} [2230] ∈ {2230} [2231] ∈ {2231} [2232] ∈ {2232} [2233] ∈ {2233} [2234] ∈ {2234} [2235] ∈ {2235} [2236] ∈ {2236} [2237] ∈ {2237} [2238] ∈ {2238} [2239] ∈ {2239} [2240] ∈ {2240} [2241] ∈ {2241} [2242] ∈ {2242} [2243] ∈ {2243} [2244] ∈ {2244} [2245] ∈ {2245} [2246] ∈ {2246} [2247] ∈ {2247} [2248] ∈ {2248} [2249] ∈ {2249} [2250] ∈ {2250} [2251] ∈ {2251} [2252] ∈ {2252} [2253] ∈ {2253} [2254] ∈ {2254} [2255] ∈ {2255} [2256] ∈ {2256} [2257] ∈ {2257} [2258] ∈ {2258} [2259] ∈ {2259} [2260] ∈ {2260} [2261] ∈ {2261} [2262] ∈ {2262} [2263] ∈ {2263} [2264] ∈ {2264} [2265] ∈ {2265} [2266] ∈ {2266} [2267] ∈ {2267} [2268] ∈ {2268} [2269] ∈ {2269} [2270] ∈ {2270} [2271] ∈ {2271} [2272] ∈ {2272} [2273] ∈ {2273} [2274] ∈ {2274} [2275] ∈ {2275} [2276] ∈ {2276} [2277] ∈ {2277} [2278] ∈ {2278} [2279] ∈ {2279} [2280] ∈ {2280} [2281] ∈ {2281} [2282] ∈ {2282} [2283] ∈ {2283} [2284] ∈ {2284} [2285] ∈ {2285} [2286] ∈ {2286} [2287] ∈ {2287} [2288] ∈ {2288} [2289] ∈ {2289} [2290] ∈ {2290} [2291] ∈ {2291} [2292] ∈ {2292} [2293] ∈ {2293} [2294] ∈ {2294} [2295] ∈ {2295} [2296] ∈ {2296} [2297] ∈ {2297} [2298] ∈ {2298} [2299] ∈ {2299} [2300] ∈ {2300} [2301] ∈ {2301} [2302] ∈ {2302} [2303] ∈ {2303} [2304] ∈ {2304} [2305] ∈ {2305} [2306] ∈ {2306} [2307] ∈ {2307} [2308] ∈ {2308} [2309] ∈ {2309} [2310] ∈ {2310} [2311] ∈ {2311} [2312] ∈ {2312} [2313] ∈ {2313} [2314] ∈ {2314} [2315] ∈ {2315} [2316] ∈ {2316} [2317] ∈ {2317} [2318] ∈ {2318} [2319] ∈ {2319} [2320] ∈ {2320} [2321] ∈ {2321} [2322] ∈ {2322} [2323] ∈ {2323} [2324] ∈ {2324} [2325] ∈ {2325} [2326] ∈ {2326} [2327] ∈ {2327} [2328] ∈ {2328} [2329] ∈ {2329} [2330] ∈ {2330} [2331] ∈ {2331} [2332] ∈ {2332} [2333] ∈ {2333} [2334] ∈ {2334} [2335] ∈ {2335} [2336] ∈ {2336} [2337] ∈ {2337} [2338] ∈ {2338} [2339] ∈ {2339} [2340] ∈ {2340} [2341] ∈ {2341} [2342] ∈ {2342} [2343] ∈ {2343} [2344] ∈ {2344} [2345] ∈ {2345} [2346] ∈ {2346} [2347] ∈ {2347} [2348] ∈ {2348} [2349] ∈ {2349} [2350] ∈ {2350} [2351] ∈ {2351} [2352] ∈ {2352} [2353] ∈ {2353} [2354] ∈ {2354} [2355] ∈ {2355} [2356] ∈ {2356} [2357] ∈ {2357} [2358] ∈ {2358} [2359] ∈ {2359} [2360] ∈ {2360} [2361] ∈ {2361} [2362] ∈ {2362} [2363] ∈ {2363} [2364] ∈ {2364} [2365] ∈ {2365} [2366] ∈ {2366} [2367] ∈ {2367} [2368] ∈ {2368} [2369] ∈ {2369} [2370] ∈ {2370} [2371] ∈ {2371} [2372] ∈ {2372} [2373] ∈ {2373} [2374] ∈ {2374} [2375] ∈ {2375} [2376] ∈ {2376} [2377] ∈ {2377} [2378] ∈ {2378} [2379] ∈ {2379} [2380] ∈ {2380} [2381] ∈ {2381} [2382] ∈ {2382} [2383] ∈ {2383} [2384] ∈ {2384} [2385] ∈ {2385} [2386] ∈ {2386} [2387] ∈ {2387} [2388] ∈ {2388} [2389] ∈ {2389} [2390] ∈ {2390} [2391] ∈ {2391} [2392] ∈ {2392} [2393] ∈ {2393} [2394] ∈ {2394} [2395] ∈ {2395} [2396] ∈ {2396} [2397] ∈ {2397} [2398] ∈ {2398} [2399] ∈ {2399} [2400] ∈ {2400} [2401] ∈ {2401} [2402] ∈ {2402} [2403] ∈ {2403} [2404] ∈ {2404} [2405] ∈ {2405} [2406] ∈ {2406} [2407] ∈ {2407} [2408] ∈ {2408} [2409] ∈ {2409} [2410] ∈ {2410} [2411] ∈ {2411} [2412] ∈ {2412} [2413] ∈ {2413} [2414] ∈ {2414} [2415] ∈ {2415} [2416] ∈ {2416} [2417] ∈ {2417} [2418] ∈ {2418} [2419] ∈ {2419} [2420] ∈ {2420} [2421] ∈ {2421} [2422] ∈ {2422} [2423] ∈ {2423} [2424] ∈ {2424} [2425] ∈ {2425} [2426] ∈ {2426} [2427] ∈ {2427} [2428] ∈ {2428} [2429] ∈ {2429} [2430] ∈ {2430} [2431] ∈ {2431} [2432] ∈ {2432} [2433] ∈ {2433} [2434] ∈ {2434} [2435] ∈ {2435} [2436] ∈ {2436} [2437] ∈ {2437} [2438] ∈ {2438} [2439] ∈ {2439} [2440] ∈ {2440} [2441] ∈ {2441} [2442] ∈ {2442} [2443] ∈ {2443} [2444] ∈ {2444} [2445] ∈ {2445} [2446] ∈ {2446} [2447] ∈ {2447} [2448] ∈ {2448} [2449] ∈ {2449} [2450] ∈ {2450} [2451] ∈ {2451} [2452] ∈ {2452} [2453] ∈ {2453} [2454] ∈ {2454} [2455] ∈ {2455} [2456] ∈ {2456} [2457] ∈ {2457} [2458] ∈ {2458} [2459] ∈ {2459} [2460] ∈ {2460} [2461] ∈ {2461} [2462] ∈ {2462} [2463] ∈ {2463} [2464] ∈ {2464} [2465] ∈ {2465} [2466] ∈ {2466} [2467] ∈ {2467} [2468] ∈ {2468} [2469] ∈ {2469} [2470] ∈ {2470} [2471] ∈ {2471} [2472] ∈ {2472} [2473] ∈ {2473} [2474] ∈ {2474} [2475] ∈ {2475} [2476] ∈ {2476} [2477] ∈ {2477} [2478] ∈ {2478} [2479] ∈ {2479} [2480] ∈ {2480} [2481] ∈ {2481} [2482] ∈ {2482} [2483] ∈ {2483} [2484] ∈ {2484} [2485] ∈ {2485} [2486] ∈ {2486} [2487] ∈ {2487} [2488] ∈ {2488} [2489] ∈ {2489} [2490] ∈ {2490} [2491] ∈ {2491} [2492] ∈ {2492} [2493] ∈ {2493} [2494] ∈ {2494} [2495] ∈ {2495} [2496] ∈ {2496} [2497] ∈ {2497} [2498] ∈ {2498} [2499] ∈ {2499} [2500] ∈ {2500} [2501] ∈ {2501} [2502] ∈ {2502} [2503] ∈ {2503} [2504] ∈ {2504} [2505] ∈ {2505} [2506] ∈ {2506} [2507] ∈ {2507} [2508] ∈ {2508} [2509] ∈ {2509} [2510] ∈ {2510} [2511] ∈ {2511} [2512] ∈ {2512} [2513] ∈ {2513} [2514] ∈ {2514} [2515] ∈ {2515} [2516] ∈ {2516} [2517] ∈ {2517} [2518] ∈ {2518} [2519] ∈ {2519} [2520] ∈ {2520} [2521] ∈ {2521} [2522] ∈ {2522} [2523] ∈ {2523} [2524] ∈ {2524} [2525] ∈ {2525} [2526] ∈ {2526} [2527] ∈ {2527} [2528] ∈ {2528} [2529] ∈ {2529} [2530] ∈ {2530} [2531] ∈ {2531} [2532] ∈ {2532} [2533] ∈ {2533} [2534] ∈ {2534} [2535] ∈ {2535} [2536] ∈ {2536} [2537] ∈ {2537} [2538] ∈ {2538} [2539] ∈ {2539} [2540] ∈ {2540} [2541] ∈ {2541} [2542] ∈ {2542} [2543] ∈ {2543} [2544] ∈ {2544} [2545] ∈ {2545} [2546] ∈ {2546} [2547] ∈ {2547} [2548] ∈ {2548} [2549] ∈ {2549} [2550] ∈ {2550} [2551] ∈ {2551} [2552] ∈ {2552} [2553] ∈ {2553} [2554] ∈ {2554} [2555] ∈ {2555} [2556] ∈ {2556} [2557] ∈ {2557} [2558] ∈ {2558} [2559] ∈ {2559} [2560] ∈ {2560} [2561] ∈ {2561} [2562] ∈ {2562} [2563] ∈ {2563} [2564] ∈ {2564} [2565] ∈ {2565} [2566] ∈ {2566} [2567] ∈ {2567} [2568] ∈ {2568} [2569] ∈ {2569} [2570] ∈ {2570} [2571] ∈ {2571} [2572] ∈ {2572} [2573] ∈ {2573} [2574] ∈ {2574} [2575] ∈ {2575} [2576] ∈ {2576} [2577] ∈ {2577} [2578] ∈ {2578} [2579] ∈ {2579} [2580] ∈ {2580} [2581] ∈ {2581} [2582] ∈ {2582} [2583] ∈ {2583} [2584] ∈ {2584} [2585] ∈ {2585} [2586] ∈ {2586} [2587] ∈ {2587} [2588] ∈ {2588} [2589] ∈ {2589} [2590] ∈ {2590} [2591] ∈ {2591} [2592] ∈ {2592} [2593] ∈ {2593} [2594] ∈ {2594} [2595] ∈ {2595} [2596] ∈ {2596} [2597] ∈ {2597} [2598] ∈ {2598} [2599] ∈ {2599} [2600] ∈ {2600} [2601] ∈ {2601} [2602] ∈ {2602} [2603] ∈ {2603} [2604] ∈ {2604} [2605] ∈ {2605} [2606] ∈ {2606} [2607] ∈ {2607} [2608] ∈ {2608} [2609] ∈ {2609} [2610] ∈ {2610} [2611] ∈ {2611} [2612] ∈ {2612} [2613] ∈ {2613} [2614] ∈ {2614} [2615] ∈ {2615} [2616] ∈ {2616} [2617] ∈ {2617} [2618] ∈ {2618} [2619] ∈ {2619} [2620] ∈ {2620} [2621] ∈ {2621} [2622] ∈ {2622} [2623] ∈ {2623} [2624] ∈ {2624} [2625] ∈ {2625} [2626] ∈ {2626} [2627] ∈ {2627} [2628] ∈ {2628} [2629] ∈ {2629} [2630] ∈ {2630} [2631] ∈ {2631} [2632] ∈ {2632} [2633] ∈ {2633} [2634] ∈ {2634} [2635] ∈ {2635} [2636] ∈ {2636} [2637] ∈ {2637} [2638] ∈ {2638} [2639] ∈ {2639} [2640] ∈ {2640} [2641] ∈ {2641} [2642] ∈ {2642} [2643] ∈ {2643} [2644] ∈ {2644} [2645] ∈ {2645} [2646] ∈ {2646} [2647] ∈ {2647} [2648] ∈ {2648} [2649] ∈ {2649} [2650] ∈ {2650} [2651] ∈ {2651} [2652] ∈ {2652} [2653] ∈ {2653} [2654] ∈ {2654} [2655] ∈ {2655} [2656] ∈ {2656} [2657] ∈ {2657} [2658] ∈ {2658} [2659] ∈ {2659} [2660] ∈ {2660} [2661] ∈ {2661} [2662] ∈ {2662} [2663] ∈ {2663} [2664] ∈ {2664} [2665] ∈ {2665} [2666] ∈ {2666} [2667] ∈ {2667} [2668] ∈ {2668} [2669] ∈ {2669} [2670] ∈ {2670} [2671] ∈ {2671} [2672] ∈ {2672} [2673] ∈ {2673} [2674] ∈ {2674} [2675] ∈ {2675} [2676] ∈ {2676} [2677] ∈ {2677} [2678] ∈ {2678} [2679] ∈ {2679} [2680] ∈ {2680} [2681] ∈ {2681} [2682] ∈ {2682} [2683] ∈ {2683} [2684] ∈ {2684} [2685] ∈ {2685} [2686] ∈ {2686} [2687] ∈ {2687} [2688] ∈ {2688} [2689] ∈ {2689} [2690] ∈ {2690} [2691] ∈ {2691} [2692] ∈ {2692} [2693] ∈ {2693} [2694] ∈ {2694} [2695] ∈ {2695} [2696] ∈ {2696} [2697] ∈ {2697} [2698] ∈ {2698} [2699] ∈ {2699} [2700] ∈ {2700} [2701] ∈ {2701} [2702] ∈ {2702} [2703] ∈ {2703} [2704] ∈ {2704} [2705] ∈ {2705} [2706] ∈ {2706} [2707] ∈ {2707} [2708] ∈ {2708} [2709] ∈ {2709} [2710] ∈ {2710} [2711] ∈ {2711} [2712] ∈ {2712} [2713] ∈ {2713} [2714] ∈ {2714} [2715] ∈ {2715} [2716] ∈ {2716} [2717] ∈ {2717} [2718] ∈ {2718} [2719] ∈ {2719} [2720] ∈ {2720} [2721] ∈ {2721} [2722] ∈ {2722} [2723] ∈ {2723} [2724] ∈ {2724} [2725] ∈ {2725} [2726] ∈ {2726} [2727] ∈ {2727} [2728] ∈ {2728} [2729] ∈ {2729} [2730] ∈ {2730} [2731] ∈ {2731} [2732] ∈ {2732} [2733] ∈ {2733} [2734] ∈ {2734} [2735] ∈ {2735} [2736] ∈ {2736} [2737] ∈ {2737} [2738] ∈ {2738} [2739] ∈ {2739} [2740] ∈ {2740} [2741] ∈ {2741} [2742] ∈ {2742} [2743] ∈ {2743} [2744] ∈ {2744} [2745] ∈ {2745} [2746] ∈ {2746} [2747] ∈ {2747} [2748] ∈ {2748} [2749] ∈ {2749} [2750] ∈ {2750} [2751] ∈ {2751} [2752] ∈ {2752} [2753] ∈ {2753} [2754] ∈ {2754} [2755] ∈ {2755} [2756] ∈ {2756} [2757] ∈ {2757} [2758] ∈ {2758} [2759] ∈ {2759} [2760] ∈ {2760} [2761] ∈ {2761} [2762] ∈ {2762} [2763] ∈ {2763} [2764] ∈ {2764} [2765] ∈ {2765} [2766] ∈ {2766} [2767] ∈ {2767} [2768] ∈ {2768} [2769] ∈ {2769} [2770] ∈ {2770} [2771] ∈ {2771} [2772] ∈ {2772} [2773] ∈ {2773} [2774] ∈ {2774} [2775] ∈ {2775} [2776] ∈ {2776} [2777] ∈ {2777} [2778] ∈ {2778} [2779] ∈ {2779} [2780] ∈ {2780} [2781] ∈ {2781} [2782] ∈ {2782} [2783] ∈ {2783} [2784] ∈ {2784} [2785] ∈ {2785} [2786] ∈ {2786} [2787] ∈ {2787} [2788] ∈ {2788} [2789] ∈ {2789} [2790] ∈ {2790} [2791] ∈ {2791} [2792] ∈ {2792} [2793] ∈ {2793} [2794] ∈ {2794} [2795] ∈ {2795} [2796] ∈ {2796} [2797] ∈ {2797} [2798] ∈ {2798} [2799] ∈ {2799} [2800] ∈ {2800} [2801] ∈ {2801} [2802] ∈ {2802} [2803] ∈ {2803} [2804] ∈ {2804} [2805] ∈ {2805} [2806] ∈ {2806} [2807] ∈ {2807} [2808] ∈ {2808} [2809] ∈ {2809} [2810] ∈ {2810} [2811] ∈ {2811} [2812] ∈ {2812} [2813] ∈ {2813} [2814] ∈ {2814} [2815] ∈ {2815} [2816] ∈ {2816} [2817] ∈ {2817} [2818] ∈ {2818} [2819] ∈ {2819} [2820] ∈ {2820} [2821] ∈ {2821} [2822] ∈ {2822} [2823] ∈ {2823} [2824] ∈ {2824} [2825] ∈ {2825} [2826] ∈ {2826} [2827] ∈ {2827} [2828] ∈ {2828} [2829] ∈ {2829} [2830] ∈ {2830} [2831] ∈ {2831} [2832] ∈ {2832} [2833] ∈ {2833} [2834] ∈ {2834} [2835] ∈ {2835} [2836] ∈ {2836} [2837] ∈ {2837} [2838] ∈ {2838} [2839] ∈ {2839} [2840] ∈ {2840} [2841] ∈ {2841} [2842] ∈ {2842} [2843] ∈ {2843} [2844] ∈ {2844} [2845] ∈ {2845} [2846] ∈ {2846} [2847] ∈ {2847} [2848] ∈ {2848} [2849] ∈ {2849} [2850] ∈ {2850} [2851] ∈ {2851} [2852] ∈ {2852} [2853] ∈ {2853} [2854] ∈ {2854} [2855] ∈ {2855} [2856] ∈ {2856} [2857] ∈ {2857} [2858] ∈ {2858} [2859] ∈ {2859} [2860] ∈ {2860} [2861] ∈ {2861} [2862] ∈ {2862} [2863] ∈ {2863} [2864] ∈ {2864} [2865] ∈ {2865} [2866] ∈ {2866} [2867] ∈ {2867} [2868] ∈ {2868} [2869] ∈ {2869} [2870] ∈ {2870} [2871] ∈ {2871} [2872] ∈ {2872} [2873] ∈ {2873} [2874] ∈ {2874} [2875] ∈ {2875} [2876] ∈ {2876} [2877] ∈ {2877} [2878] ∈ {2878} [2879] ∈ {2879} [2880] ∈ {2880} [2881] ∈ {2881} [2882] ∈ {2882} [2883] ∈ {2883} [2884] ∈ {2884} [2885] ∈ {2885} [2886] ∈ {2886} [2887] ∈ {2887} [2888] ∈ {2888} [2889] ∈ {2889} [2890] ∈ {2890} [2891] ∈ {2891} [2892] ∈ {2892} [2893] ∈ {2893} [2894] ∈ {2894} [2895] ∈ {2895} [2896] ∈ {2896} [2897] ∈ {2897} [2898] ∈ {2898} [2899] ∈ {2899} [2900] ∈ {2900} [2901] ∈ {2901} [2902] ∈ {2902} [2903] ∈ {2903} [2904] ∈ {2904} [2905] ∈ {2905} [2906] ∈ {2906} [2907] ∈ {2907} [2908] ∈ {2908} [2909] ∈ {2909} [2910] ∈ {2910} [2911] ∈ {2911} [2912] ∈ {2912} [2913] ∈ {2913} [2914] ∈ {2914} [2915] ∈ {2915} [2916] ∈ {2916} [2917] ∈ {2917} [2918] ∈ {2918} [2919] ∈ {2919} [2920] ∈ {2920} [2921] ∈ {2921} [2922] ∈ {2922} [2923] ∈ {2923} [2924] ∈ {2924} [2925] ∈ {2925} [2926] ∈ {2926} [2927] ∈ {2927} [2928] ∈ {2928} [2929] ∈ {2929} [2930] ∈ {2930} [2931] ∈ {2931} [2932] ∈ {2932} [2933] ∈ {2933} [2934] ∈ {2934} [2935] ∈ {2935} [2936] ∈ {2936} [2937] ∈ {2937} [2938] ∈ {2938} [2939] ∈ {2939} [2940] ∈ {2940} [2941] ∈ {2941} [2942] ∈ {2942} [2943] ∈ {2943} [2944] ∈ {2944} [2945] ∈ {2945} [2946] ∈ {2946} [2947] ∈ {2947} [2948] ∈ {2948} [2949] ∈ {2949} [2950] ∈ {2950} [2951] ∈ {2951} [2952] ∈ {2952} [2953] ∈ {2953} [2954] ∈ {2954} [2955] ∈ {2955} [2956] ∈ {2956} [2957] ∈ {2957} [2958] ∈ {2958} [2959] ∈ {2959} [2960] ∈ {2960} [2961] ∈ {2961} [2962] ∈ {2962} [2963] ∈ {2963} [2964] ∈ {2964} [2965] ∈ {2965} [2966] ∈ {2966} [2967] ∈ {2967} [2968] ∈ {2968} [2969] ∈ {2969} [2970] ∈ {2970} [2971] ∈ {2971} [2972] ∈ {2972} [2973] ∈ {2973} [2974] ∈ {2974} [2975] ∈ {2975} [2976] ∈ {2976} [2977] ∈ {2977} [2978] ∈ {2978} [2979] ∈ {2979} [2980] ∈ {2980} [2981] ∈ {2981} [2982] ∈ {2982} [2983] ∈ {2983} [2984] ∈ {2984} [2985] ∈ {2985} [2986] ∈ {2986} [2987] ∈ {2987} [2988] ∈ {2988} [2989] ∈ {2989} [2990] ∈ {2990} [2991] ∈ {2991} [2992] ∈ {2992} [2993] ∈ {2993} [2994] ∈ {2994} [2995] ∈ {2995} [2996] ∈ {2996} [2997] ∈ {2997} [2998] ∈ {2998} [2999] ∈ {2999} [from] Computing for function f [from] Done for function f [from] Computing for function init [from] Done for function init [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: t[1] FROM t[0] [from] Function init: FROMTOP [from] Function main: FROMTOP [from] ====== END OF DEPENDENCIES ====== [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to init at tests/value/no_results.c:19 (by main): FROMTOP [from] call to f at tests/value/no_results.c:20 (by main): t[1] FROM t[0] [from] entry point: FROMTOP [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] Out (internal) for function f: t[1] [inout] Inputs for function f: t[0] [inout] InOut (internal) for function f: Operational inputs: t[0] Operational inputs on termination: t[0] Sure outputs: t[1] [inout] Out (internal) for function init: ANYTHING(origin:Unknown) [inout] Inputs for function init: \nothing [inout] InOut (internal) for function init: Operational inputs: ANYTHING(origin:Unknown) Operational inputs on termination: ANYTHING(origin:Unknown) Sure outputs: \nothing [inout] Out (internal) for function main: ANYTHING(origin:Unknown) [inout] Inputs for function main: t[0] [inout] InOut (internal) for function main: Operational inputs: ANYTHING(origin:Unknown) Operational inputs on termination: ANYTHING(origin:Unknown) Sure outputs: t[1] frama-c-20.0-Calcium/tests/value/oracle/non_iso_initializer.res.oracle0000666000000000000000000000146313571573400022770 0ustar [kernel] Parsing tests/value/non_iso_initializer.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G0 ∈ {42} G1 ∈ {21} G2 ∈ {63} G3 ∈ {-1} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G3 ∈ {105} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: G3 FROM G0; G2 [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G3 [inout] Inputs for function main: G0; G2 frama-c-20.0-Calcium/tests/value/oracle/non_natural.res.oracle0000666000000000000000000004101613571573400021237 0ustar [kernel] Parsing tests/value/non_natural.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/non_natural.i:63. [eva] tests/value/non_natural.i:11: Frama_C_show_each: {0} [eva] tests/value/non_natural.i:11: Frama_C_show_each: {0; 1} [eva] tests/value/non_natural.i:11: Frama_C_show_each: {0; 1; 2} [eva] tests/value/non_natural.i:11: Frama_C_show_each: [0..999999] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/non_natural.i:64. [eva] computing for function duff1 <- main2 <- main. Called from tests/value/non_natural.i:57. [eva] tests/value/non_natural.i:22: Frama_C_show_each: {{ &p2 }} [eva:alarm] tests/value/non_natural.i:23: Warning: accessing uninitialized left-value. assert \initialized(tmp_0); (tmp_0 from from++) [eva:alarm] tests/value/non_natural.i:24: Warning: accessing uninitialized left-value. assert \initialized(tmp_2); (tmp_2 from from++) [eva:alarm] tests/value/non_natural.i:25: Warning: accessing uninitialized left-value. assert \initialized(tmp_4); (tmp_4 from from++) [eva:alarm] tests/value/non_natural.i:26: Warning: accessing uninitialized left-value. assert \initialized(tmp_6); (tmp_6 from from++) [eva:alarm] tests/value/non_natural.i:27: Warning: accessing uninitialized left-value. assert \initialized(tmp_8); (tmp_8 from from++) [eva:alarm] tests/value/non_natural.i:28: Warning: accessing uninitialized left-value. assert \initialized(tmp_10); (tmp_10 from from++) [eva:alarm] tests/value/non_natural.i:29: Warning: accessing uninitialized left-value. assert \initialized(tmp_12); (tmp_12 from from++) [eva:alarm] tests/value/non_natural.i:30: Warning: accessing uninitialized left-value. assert \initialized(tmp_14); (tmp_14 from from++) [eva] tests/value/non_natural.i:21: starting to merge loop iterations [eva] tests/value/non_natural.i:22: Frama_C_show_each: {{ &p2 + {0; 32} }} [eva] tests/value/non_natural.i:22: Frama_C_show_each: {{ &p2 + {0; 32; 64} }} [eva] tests/value/non_natural.i:22: Frama_C_show_each: {{ &p2 + {0; 32; 64; 96} }} [kernel] tests/value/non_natural.i:30: more than 200(12500) locations to update in array. Approximating. [eva] tests/value/non_natural.i:22: Frama_C_show_each: {{ &p2 + [0..400000],0%32 }} [eva:alarm] tests/value/non_natural.i:23: Warning: out of bounds write. assert \valid(tmp); (tmp from to++) [kernel] tests/value/non_natural.i:23: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:24: Warning: out of bounds write. assert \valid(tmp_1); (tmp_1 from to++) [kernel] tests/value/non_natural.i:24: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:25: Warning: out of bounds write. assert \valid(tmp_3); (tmp_3 from to++) [eva:alarm] tests/value/non_natural.i:25: Warning: out of bounds read. assert \valid_read(tmp_4); (tmp_4 from from++) [kernel] tests/value/non_natural.i:25: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:26: Warning: out of bounds write. assert \valid(tmp_5); (tmp_5 from to++) [eva:alarm] tests/value/non_natural.i:26: Warning: out of bounds read. assert \valid_read(tmp_6); (tmp_6 from from++) [kernel] tests/value/non_natural.i:26: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:27: Warning: out of bounds write. assert \valid(tmp_7); (tmp_7 from to++) [eva:alarm] tests/value/non_natural.i:27: Warning: out of bounds read. assert \valid_read(tmp_8); (tmp_8 from from++) [kernel] tests/value/non_natural.i:27: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:28: Warning: out of bounds write. assert \valid(tmp_9); (tmp_9 from to++) [eva:alarm] tests/value/non_natural.i:28: Warning: out of bounds read. assert \valid_read(tmp_10); (tmp_10 from from++) [kernel] tests/value/non_natural.i:28: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:29: Warning: out of bounds write. assert \valid(tmp_11); (tmp_11 from to++) [eva:alarm] tests/value/non_natural.i:29: Warning: out of bounds read. assert \valid_read(tmp_12); (tmp_12 from from++) [kernel] tests/value/non_natural.i:29: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:30: Warning: out of bounds write. assert \valid(tmp_13); (tmp_13 from to++) [eva:alarm] tests/value/non_natural.i:30: Warning: out of bounds read. assert \valid_read(tmp_14); (tmp_14 from from++) [eva] tests/value/non_natural.i:22: Frama_C_show_each: {{ &p2 + [0..400032],0%32 }} [eva:alarm] tests/value/non_natural.i:23: Warning: out of bounds read. assert \valid_read(tmp_0); (tmp_0 from from++) [eva:alarm] tests/value/non_natural.i:24: Warning: out of bounds read. assert \valid_read(tmp_2); (tmp_2 from from++) [eva] tests/value/non_natural.i:22: Frama_C_show_each: {{ &p2 + [0..--],0%32 }} [eva] Recording results for duff1 [kernel] tests/value/non_natural.i:23: more than 200(12501) elements to enumerate. Approximating. [kernel] tests/value/non_natural.i:23: more than 200(12500) elements to enumerate. Approximating. [kernel] tests/value/non_natural.i:24: more than 200(12501) elements to enumerate. Approximating. [kernel] tests/value/non_natural.i:24: more than 200(12500) elements to enumerate. Approximating. [kernel] tests/value/non_natural.i:25: more than 200(12500) elements to enumerate. Approximating. [kernel] tests/value/non_natural.i:26: more than 200(12500) elements to enumerate. Approximating. [kernel] tests/value/non_natural.i:27: more than 200(12500) elements to enumerate. Approximating. [kernel] tests/value/non_natural.i:28: more than 200(12500) elements to enumerate. Approximating. [kernel] tests/value/non_natural.i:29: more than 200(12500) elements to enumerate. Approximating. [kernel] tests/value/non_natural.i:30: more than 200(12500) elements to enumerate. Approximating. [eva] Done for function duff1 [eva:alarm] tests/value/non_natural.i:58: Warning: accessing out of bounds index. assert 0 ≤ o; [eva:alarm] tests/value/non_natural.i:58: Warning: accessing out of bounds index. assert o < 100002; [eva] computing for function duff2 <- main2 <- main. Called from tests/value/non_natural.i:59. [eva] tests/value/non_natural.i:38: Frama_C_show_each: {{ &p2 }} [eva:alarm] tests/value/non_natural.i:39: Warning: accessing uninitialized left-value. assert \initialized(tmp_0); (tmp_0 from from++) [eva:alarm] tests/value/non_natural.i:40: Warning: accessing uninitialized left-value. assert \initialized(tmp_2); (tmp_2 from from++) [eva:alarm] tests/value/non_natural.i:41: Warning: accessing uninitialized left-value. assert \initialized(tmp_4); (tmp_4 from from++) [eva:alarm] tests/value/non_natural.i:42: Warning: accessing uninitialized left-value. assert \initialized(tmp_6); (tmp_6 from from++) [eva:alarm] tests/value/non_natural.i:43: Warning: accessing uninitialized left-value. assert \initialized(tmp_8); (tmp_8 from from++) [eva:alarm] tests/value/non_natural.i:44: Warning: accessing uninitialized left-value. assert \initialized(tmp_10); (tmp_10 from from++) [eva:alarm] tests/value/non_natural.i:45: Warning: accessing uninitialized left-value. assert \initialized(tmp_12); (tmp_12 from from++) [eva:alarm] tests/value/non_natural.i:46: Warning: accessing uninitialized left-value. assert \initialized(tmp_14); (tmp_14 from from++) [eva] tests/value/non_natural.i:38: Frama_C_show_each: {{ &p2 + {0; 32} }} [eva] tests/value/non_natural.i:38: Frama_C_show_each: {{ &p2 + {0; 32; 64} }} [eva] tests/value/non_natural.i:38: Frama_C_show_each: {{ &p2 + {0; 32; 64; 96} }} [kernel] tests/value/non_natural.i:46: more than 200(12500) locations to update in array. Approximating. [eva] tests/value/non_natural.i:38: Frama_C_show_each: {{ &p2 + [0..400000],0%32 }} [eva:alarm] tests/value/non_natural.i:39: Warning: out of bounds write. assert \valid(tmp); (tmp from to++) [kernel] tests/value/non_natural.i:39: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:40: Warning: out of bounds write. assert \valid(tmp_1); (tmp_1 from to++) [kernel] tests/value/non_natural.i:40: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:41: Warning: out of bounds write. assert \valid(tmp_3); (tmp_3 from to++) [eva:alarm] tests/value/non_natural.i:41: Warning: out of bounds read. assert \valid_read(tmp_4); (tmp_4 from from++) [kernel] tests/value/non_natural.i:41: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:42: Warning: out of bounds write. assert \valid(tmp_5); (tmp_5 from to++) [eva:alarm] tests/value/non_natural.i:42: Warning: out of bounds read. assert \valid_read(tmp_6); (tmp_6 from from++) [kernel] tests/value/non_natural.i:42: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:43: Warning: out of bounds write. assert \valid(tmp_7); (tmp_7 from to++) [eva:alarm] tests/value/non_natural.i:43: Warning: out of bounds read. assert \valid_read(tmp_8); (tmp_8 from from++) [kernel] tests/value/non_natural.i:43: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:44: Warning: out of bounds write. assert \valid(tmp_9); (tmp_9 from to++) [eva:alarm] tests/value/non_natural.i:44: Warning: out of bounds read. assert \valid_read(tmp_10); (tmp_10 from from++) [kernel] tests/value/non_natural.i:44: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:45: Warning: out of bounds write. assert \valid(tmp_11); (tmp_11 from to++) [eva:alarm] tests/value/non_natural.i:45: Warning: out of bounds read. assert \valid_read(tmp_12); (tmp_12 from from++) [kernel] tests/value/non_natural.i:45: more than 200(12500) locations to update in array. Approximating. [eva:alarm] tests/value/non_natural.i:46: Warning: out of bounds write. assert \valid(tmp_13); (tmp_13 from to++) [eva:alarm] tests/value/non_natural.i:46: Warning: out of bounds read. assert \valid_read(tmp_14); (tmp_14 from from++) [eva] tests/value/non_natural.i:38: Frama_C_show_each: {{ &p2 + [0..400032],0%32 }} [eva:alarm] tests/value/non_natural.i:39: Warning: out of bounds read. assert \valid_read(tmp_0); (tmp_0 from from++) [eva:alarm] tests/value/non_natural.i:40: Warning: out of bounds read. assert \valid_read(tmp_2); (tmp_2 from from++) [eva] tests/value/non_natural.i:38: Frama_C_show_each: {{ &p2 + [0..--],0%32 }} [eva] Recording results for duff2 [eva] Done for function duff2 [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function duff1: to ∈ {{ &p2 + [32..--],0%32 }} from ∈ {{ &p1 + [32..--],0%32 }} n ∈ {0} p2[0..99999] ∈ {1} or UNINITIALIZED [eva:final-states] Values at end of function duff2: to ∈ {{ &p2 + [32..--],0%32 }} from ∈ {{ &p1 + [32..--],0%32 }} n ∈ {0} p2[0..99999] ∈ {1; 2} or UNINITIALIZED [eva:final-states] Values at end of function main1: c ∈ {1000000} [eva:final-states] Values at end of function main2: p1[0..100001] ∈ {1; 2} or UNINITIALIZED p2[0..99999] ∈ {1; 2} or UNINITIALIZED o ∈ [0..100001] [eva:final-states] Values at end of function main: [from] Computing for function duff1 [kernel] tests/value/non_natural.i:23: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:24: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:25: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:26: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:27: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:28: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:29: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:30: more than 200(12500) dependencies to update. Approximating. [from] Done for function duff1 [from] Computing for function duff2 [kernel] tests/value/non_natural.i:39: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:40: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:41: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:42: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:43: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:44: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:45: more than 200(12500) dependencies to update. Approximating. [kernel] tests/value/non_natural.i:46: more than 200(12500) dependencies to update. Approximating. [from] Done for function duff2 [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function duff1: p2[0] FROM to; from; count; p1[0..100000] (and SELF) [1..99992] FROM to; from; count; p1[0..100001] (and SELF) [99993] FROM to; from; count; p1[1..100001] (and SELF) [99994] FROM to; from; count; p1[2..99999] (and SELF) [99995] FROM to; from; count; p1[3..99999] (and SELF) [99996] FROM to; from; count; p1[4..99999] (and SELF) [99997] FROM to; from; count; p1[5..99999] (and SELF) [99998] FROM to; from; count; p1[6..99999] (and SELF) [99999] FROM to; from; count; p1[7..99999] (and SELF) [from] Function duff2: p2[0] FROM to; from; count; p1[0..100000] (and SELF) [1..99992] FROM to; from; count; p1[0..100001] (and SELF) [99993] FROM to; from; count; p1[1..100001] (and SELF) [99994] FROM to; from; count; p1[2..99999] (and SELF) [99995] FROM to; from; count; p1[3..99999] (and SELF) [99996] FROM to; from; count; p1[4..99999] (and SELF) [99997] FROM to; from; count; p1[5..99999] (and SELF) [99998] FROM to; from; count; p1[6..99999] (and SELF) [99999] FROM to; from; count; p1[7..99999] (and SELF) [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function duff1: to; from; n; tmp; tmp_0; tmp_1; tmp_2; tmp_3; tmp_4; tmp_5; tmp_6; tmp_7; tmp_8; tmp_9; tmp_10; tmp_11; tmp_12; tmp_13; tmp_14; p2[0..99999] [inout] Inputs for function duff1: p1[0..100001] [inout] Out (internal) for function duff2: to; from; n; tmp; tmp_0; tmp_1; tmp_2; tmp_3; tmp_4; tmp_5; tmp_6; tmp_7; tmp_8; tmp_9; tmp_10; tmp_11; tmp_12; tmp_13; tmp_14; p2[0..99999] [inout] Inputs for function duff2: p1[0..100001] [inout] Out (internal) for function main1: c [inout] Inputs for function main1: v [inout] Out (internal) for function main2: p1[0..100001]; p2[0..99999]; o [inout] Inputs for function main2: v [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/nonlin.res.oracle0000666000000000000000000002412113571573400020212 0ustar [kernel] Parsing tests/value/nonlin.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] vs ∈ [--..--] table[0..3] ∈ {66} [4] ∈ {1} [5] ∈ {8} [6] ∈ {7} [7] ∈ {2} [8..11] ∈ {0} [12..15] ∈ {66} [16] ∈ {9} [17] ∈ {3} [18] ∈ {4} [19] ∈ {5} [20..23] ∈ {0} [24..27] ∈ {66} [28] ∈ {2} [29] ∈ {3} [30] ∈ {7} [31] ∈ {5} [32..35] ∈ {0} [eva] computing for function subdivide_integer <- main. Called from tests/value/nonlin.c:107. [eva:nonlin] tests/value/nonlin.c:31: non-linear '((int)z + 675) * ((int)z + 675)', lv 'z' [eva:nonlin] tests/value/nonlin.c:31: subdividing on z [eva:nonlin] tests/value/nonlin.c:32: non-linear '((int)z + 17817) * ((int)z + 17817)', lv 'z' [eva:nonlin] tests/value/nonlin.c:32: subdividing on z [eva:alarm] tests/value/nonlin.c:32: Warning: signed overflow. assert (int)((int)z + 17817) * (int)((int)z + 17817) ≤ 2147483647; [eva:nonlin] tests/value/nonlin.c:39: non-linear '(i2 + (long long)3) * (i2 + (long long)3)', lv 'i2' [eva:nonlin] tests/value/nonlin.c:39: non-linear 'i1 * i1', lv 'i1' [eva:nonlin] tests/value/nonlin.c:39: subdividing on i2 [eva:nonlin] tests/value/nonlin.c:39: subdividing on i1 [eva:alarm] tests/value/nonlin.c:43: Warning: assertion got status unknown. [eva:nonlin] tests/value/nonlin.c:44: non-linear '(int)idx * (int)idx', lv 'idx' [eva:nonlin] tests/value/nonlin.c:44: subdividing on idx [eva] Recording results for subdivide_integer [eva] Done for function subdivide_integer [eva] computing for function subdivide_pointer <- main. Called from tests/value/nonlin.c:108. [eva] computing for function Frama_C_interval <- subdivide_pointer <- main. Called from tests/value/nonlin.c:12. [eva] using specification for function Frama_C_interval [eva] tests/value/nonlin.c:12: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- subdivide_pointer <- main. Called from tests/value/nonlin.c:14. [eva] tests/value/nonlin.c:14: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/nonlin.c:18: Warning: out of bounds read. assert \valid_read((&y + i) - i); [eva:nonlin] tests/value/nonlin.c:21: non-linear '(p + i) - i', lv 'i' [eva:nonlin] tests/value/nonlin.c:21: subdividing on i [eva:alarm] tests/value/nonlin.c:21: Warning: out of bounds read. assert \valid_read((p + i) - i); [eva:alarm] tests/value/nonlin.c:24: Warning: out of bounds read. assert \valid_read((p + i) - i); [eva] Recording results for subdivide_pointer [eva] Done for function subdivide_pointer [eva] computing for function subdivide_several_variables <- main. Called from tests/value/nonlin.c:109. [eva] computing for function Frama_C_interval <- subdivide_several_variables <- main. Called from tests/value/nonlin.c:51. [eva] tests/value/nonlin.c:51: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- subdivide_several_variables <- main. Called from tests/value/nonlin.c:52. [eva] tests/value/nonlin.c:52: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- subdivide_several_variables <- main. Called from tests/value/nonlin.c:53. [eva] tests/value/nonlin.c:53: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- subdivide_several_variables <- main. Called from tests/value/nonlin.c:54. [eva] tests/value/nonlin.c:54: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:nonlin] tests/value/nonlin.c:56: non-linear 'x * x', lv 'x' [eva:nonlin] tests/value/nonlin.c:56: non-linear 'y * y', lv 'y' [eva:nonlin] tests/value/nonlin.c:56: subdividing on x [eva:nonlin] tests/value/nonlin.c:56: subdividing on y [eva:nonlin] tests/value/nonlin.c:62: non-linear 'x * x', lv 'x' [eva:nonlin] tests/value/nonlin.c:62: non-linear '((x * x) * y) * y', lv 'y' [eva:nonlin] tests/value/nonlin.c:62: subdividing on x [eva:nonlin] tests/value/nonlin.c:62: subdividing on y [eva:nonlin] tests/value/nonlin.c:64: non-linear 'x * y - y * x', lv 'y, x' [eva:nonlin] tests/value/nonlin.c:64: subdividing on x, y [eva:nonlin] tests/value/nonlin.c:67: non-linear '(x * x - (2 * x) * y) + y * y', lv 'y, x' [eva:nonlin] tests/value/nonlin.c:67: subdividing on x, y [eva:nonlin] tests/value/nonlin.c:68: non-linear '(x * x + y * y) - (2 * x) * y', lv 'y, x' [eva:nonlin] tests/value/nonlin.c:68: subdividing on x, y [eva:nonlin] tests/value/nonlin.c:70: non-linear '(z * x + x * y) + y * z', lv 'z, y, x' [eva:nonlin] tests/value/nonlin.c:70: non-linear 'w * w', lv 'w' [eva:nonlin] tests/value/nonlin.c:70: subdividing on x, y, z [eva:nonlin] tests/value/nonlin.c:70: subdividing on w [eva] Recording results for subdivide_several_variables [eva] Done for function subdivide_several_variables [eva] computing for function subdivide_table <- main. Called from tests/value/nonlin.c:110. [eva] tests/value/nonlin.c:89: loop invariant got status valid. [eva] tests/value/nonlin.c:90: starting to merge loop iterations [eva:nonlin] tests/value/nonlin.c:91: non-linear '(4 + ((x >> 2) * 3 << 2)) + x % 4', lv 'x' [eva:nonlin] tests/value/nonlin.c:91: subdividing on x [eva] Recording results for subdivide_table [eva] Done for function subdivide_table [eva] computing for function subdivide_reduced_value <- main. Called from tests/value/nonlin.c:111. [eva:nonlin] tests/value/nonlin.c:103: non-linear 't1[i] - t2[i]', lv 'i' [eva:nonlin] tests/value/nonlin.c:103: subdividing on i [eva:alarm] tests/value/nonlin.c:103: Warning: accessing out of bounds index. assert 0 ≤ i; [eva:alarm] tests/value/nonlin.c:103: Warning: accessing out of bounds index. assert i < 2; [eva] Recording results for subdivide_reduced_value [eva] Done for function subdivide_reduced_value [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function subdivide_integer: z ∈ [-32768..28523] k ∈ [-2..1118367364] l ∈ [0..2147395600] x ∈ {8} p ∈ {{ &x + {32} }} i1 ∈ [-32768..32767] i2 ∈ [-32768..32767] r ∈ [-2..2147614724] t[0..100] ∈ {1} or UNINITIALIZED [101] ∈ UNINITIALIZED idx ∈ [0..10] [eva:final-states] Values at end of function subdivide_pointer: Frama_C_entropy_source ∈ [--..--] y ∈ [-10..10] x ∈ [-10..10] p ∈ {{ &x }} i ∈ {{ NULL + [0..100] ; (int)&x }} q ∈ {{ &x + [-400..400],0%4 }} [eva:final-states] Values at end of function subdivide_reduced_value: t1[0] ∈ {0} [1] ∈ {1} t2[0] ∈ {0} [1] ∈ {1} i ∈ {0; 1} r ∈ {-1; 0; 1} [eva:final-states] Values at end of function subdivide_several_variables: Frama_C_entropy_source ∈ [--..--] w ∈ [-10..10] x ∈ [-10..10] y ∈ [-10..10] z ∈ [-10..10] norm ∈ [0..200] mult ∈ [-10000..10000] zero ∈ [-26..26] square ∈ [-48..400] square2 ∈ [-48..400] res ∈ [-144..400] [eva:final-states] Values at end of function subdivide_table: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] [from] Computing for function subdivide_integer [from] Done for function subdivide_integer [from] Computing for function subdivide_pointer [from] Computing for function Frama_C_interval <-subdivide_pointer [from] Done for function Frama_C_interval [from] Done for function subdivide_pointer [from] Computing for function subdivide_reduced_value [from] Done for function subdivide_reduced_value [from] Computing for function subdivide_several_variables [from] Done for function subdivide_several_variables [from] Computing for function subdivide_table [from] Non-terminating function subdivide_table (no dependencies) [from] Done for function subdivide_table [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function subdivide_integer: NO EFFECTS [from] Function subdivide_pointer: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function subdivide_reduced_value: NO EFFECTS [from] Function subdivide_several_variables: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function subdivide_table: NON TERMINATING - NO EFFECTS [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function subdivide_integer: z; k; l; x; p; i1; i2; r; t[0..100]; idx [inout] Inputs for function subdivide_integer: v; vs [inout] Out (internal) for function subdivide_pointer: Frama_C_entropy_source; y; x; p; i; q [inout] Inputs for function subdivide_pointer: Frama_C_entropy_source; v [inout] Out (internal) for function subdivide_reduced_value: t1[0..1]; t2[0..1]; i; r [inout] Inputs for function subdivide_reduced_value: v [inout] Out (internal) for function subdivide_several_variables: Frama_C_entropy_source; w; x; y; z; norm; mult; zero; square; square2; res [inout] Inputs for function subdivide_several_variables: Frama_C_entropy_source [inout] Out (internal) for function subdivide_table: x [inout] Inputs for function subdivide_table: table[4..29] [inout] Out (internal) for function main: Frama_C_entropy_source [inout] Inputs for function main: Frama_C_entropy_source; v; vs; table[4..29] frama-c-20.0-Calcium/tests/value/oracle/noreturn.res.oracle0000666000000000000000000001036213571573400020573 0ustar [kernel] Parsing tests/value/noreturn.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function warn_may_never_end <- main. Called from tests/value/noreturn.i:26. [eva] Recording results for warn_may_never_end [eva] Done for function warn_may_never_end [eva] computing for function warn_may_never_end <- main. Called from tests/value/noreturn.i:27. [eva] Recording results for warn_may_never_end [eva] Done for function warn_may_never_end [eva] computing for function warn_never_ends <- main. Called from tests/value/noreturn.i:28. [eva] Recording results for warn_never_ends [eva] Done for function warn_never_ends [eva] computing for function stop <- main. Called from tests/value/noreturn.i:29. [kernel:annot:missing-spec] tests/value/noreturn.i:29: Warning: Neither code nor specification for function stop, generating default assigns from the prototype [eva] using specification for function stop [eva] Done for function stop [eva] computing for function haltme <- main. Called from tests/value/noreturn.i:30. [kernel:annot:missing-spec] tests/value/noreturn.i:30: Warning: Neither code nor specification for function haltme, generating default assigns from the prototype [eva] using specification for function haltme [eva] Done for function haltme [eva] computing for function never_ends <- main. Called from tests/value/noreturn.i:31. [eva] Recording results for never_ends [eva] Done for function never_ends [eva] computing for function should_never_end <- main. Called from tests/value/noreturn.i:32. [eva] Recording results for should_never_end [eva] tests/value/noreturn.i:13: Warning: function should_never_end may terminate but has the noreturn attribute [eva] Done for function should_never_end [eva] computing for function should_never_end <- main. Called from tests/value/noreturn.i:33. [eva] Recording results for should_never_end [eva] Done for function should_never_end [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function never_ends: NON TERMINATING FUNCTION [eva:final-states] Values at end of function should_never_end: [eva:final-states] Values at end of function warn_may_never_end: [eva:final-states] Values at end of function warn_never_ends: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: x ∈ {0} [from] Computing for function never_ends [from] Non-terminating function never_ends (no dependencies) [from] Done for function never_ends [from] Computing for function should_never_end [from] Done for function should_never_end [from] Computing for function warn_may_never_end [from] Done for function warn_may_never_end [from] Computing for function warn_never_ends [from] Non-terminating function warn_never_ends (no dependencies) [from] Done for function warn_never_ends [from] Computing for function main [from] Computing for function stop <-main [from] Done for function stop [from] Computing for function haltme <-main [from] Done for function haltme [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function haltme: \result FROM \nothing [from] Function never_ends: NON TERMINATING - NO EFFECTS [from] Function should_never_end: NO EFFECTS [from] Function stop: NO EFFECTS [from] Function warn_may_never_end: NO EFFECTS [from] Function warn_never_ends: NON TERMINATING - NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function never_ends: \nothing [inout] Inputs for function never_ends: \nothing [inout] Out (internal) for function should_never_end: \nothing [inout] Inputs for function should_never_end: \nothing [inout] Out (internal) for function warn_may_never_end: \nothing [inout] Inputs for function warn_may_never_end: \nothing [inout] Out (internal) for function warn_never_ends: \nothing [inout] Inputs for function warn_never_ends: \nothing [inout] Out (internal) for function main: x [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/not.res.oracle0000666000000000000000000000142113571573400017513 0ustar [kernel] Parsing tests/value/not.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {0; 1} loc ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: x FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; loc [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/not_ct_array_arg.res.oracle0000666000000000000000000000556013571573400022240 0ustar [kernel] Parsing tests/value/not_ct_array_arg.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:initial-state] creating variable S_tb with imprecise size (type int [10][a]) [eva] tests/value/not_ct_array_arg.i:9: Warning: during initialization of variable 'tb', size of type 'int [a]' cannot be computed (Array with non-constant length.) [eva:alarm] tests/value/not_ct_array_arg.i:10: Warning: out of bounds write. assert \valid((int *)tb); [eva] tests/value/not_ct_array_arg.i:11: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] a ∈ [--..--] tb ∈ {{ (int (*)[a])&S_tb }} tc ∈ {{ NULL ; &S_tc[0] }} S_tc[0..1][0..9] ∈ [--..--] S_tb[bits 0 to 31] ∈ {1} [bits 32 to ..] ∈ [--..--] or UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/not_ct_array_arg.i:12: Warning: out of bounds write. assert \valid(&(*(tb + 9))[100]); [eva] tests/value/not_ct_array_arg.i:13: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] a ∈ [--..--] tb ∈ {{ (int (*)[a])&S_tb }} tc ∈ {{ NULL ; &S_tc[0] }} S_tc[0..1][0..9] ∈ [--..--] S_tb[bits 0 to 31] ∈ {{ garbled mix of &{tb} (origin: Misaligned {tests/value/not_ct_array_arg.i:12}) }} [bits 32 to ..] ∈ {{ garbled mix of &{tb} (origin: Misaligned {tests/value/not_ct_array_arg.i:12}) }} or UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/not_ct_array_arg.i:14: Warning: out of bounds write. assert \valid(&(*(tc + 1))[1]); [eva:alarm] tests/value/not_ct_array_arg.i:16: Warning: accessing out of bounds index. assert 16 < 10; [kernel] tests/value/not_ct_array_arg.i:16: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/not_ct_array_arg.i:16: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: S_tc{[0][0..9]; [1][0]} ∈ [--..--] [1][1] ∈ {3} [1][2..9] ∈ [--..--] S_tb[bits 0 to 31] ∈ {{ garbled mix of &{tb} (origin: Misaligned {tests/value/not_ct_array_arg.i:12}) }} [bits 32 to ..] ∈ {{ garbled mix of &{tb} (origin: Misaligned {tests/value/not_ct_array_arg.i:12}) }} or UNINITIALIZED [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: S_tc[1][1] FROM tc S_tb[bits 0 to 31] FROM tb [bits 32 to ..] FROM tb (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: S_tc[1][1]; S_tb[bits 0 to ..] [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/null_lt_valid.res.oracle0000666000000000000000000000665013571573400021554 0ustar [kernel] Parsing tests/value/null_lt_valid.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..22] ∈ {0} p ∈ {0} q ∈ {0} r ∈ {0} [eva] computing for function f <- main. Called from tests/value/null_lt_valid.i:27. [eva:alarm] tests/value/null_lt_valid.i:5: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)((int *)t)); [eva:alarm] tests/value/null_lt_valid.i:6: Warning: out of bounds write. assert \valid(p); [kernel] tests/value/null_lt_valid.i:6: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/null_lt_valid.i:30. [eva:alarm] tests/value/null_lt_valid.i:11: Warning: pointer comparison. assert \pointer_comparable((void *)q, (void *)(&t[22])); [eva] Recording results for g [eva] Done for function g [eva] computing for function h <- main. Called from tests/value/null_lt_valid.i:33. [eva:alarm] tests/value/null_lt_valid.i:19: Warning: pointer comparison. assert \pointer_comparable((void *)r, (void *)(&t[22])); [eva] Recording results for h [eva] Done for function h [eva:alarm] tests/value/null_lt_valid.i:34: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)((int *)t)); [eva:alarm] tests/value/null_lt_valid.i:35: Warning: pointer comparison. assert \pointer_comparable((void *)q, (void *)(&t[22])); [eva:alarm] tests/value/null_lt_valid.i:36: Warning: pointer comparison. assert \pointer_comparable((void *)r, (void *)(&t[22])); [eva] Recording results for main [eva] done for function main [eva] tests/value/null_lt_valid.i:6: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: NON TERMINATING FUNCTION [eva:final-states] Values at end of function g: q1 ∈ {{ NULL ; &t + [0..60],0%4 }} [eva:final-states] Values at end of function h: r1 ∈ {{ NULL ; &t + [0..84],0%4 }} or UNINITIALIZED r2 ∈ {{ &t + [88..124],0%4 }} or UNINITIALIZED [eva:final-states] Values at end of function main: t[0] ∈ {1} [1..2] ∈ {0; 1} [3..22] ∈ {0} q ∈ {{ NULL ; &t + [0..60],0%4 }} r ∈ {{ NULL ; &t + [0..124],0%4 }} __retres ∈ {0} [from] Computing for function f [from] Non-terminating function f (no dependencies) [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NON TERMINATING - NO EFFECTS [from] Function g: NO EFFECTS [from] Function h: NO EFFECTS [from] Function main: t[0] FROM p [1..2] FROM p; c q FROM p; c r FROM p; c \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: p [inout] Out (internal) for function g: q1 [inout] Inputs for function g: q [inout] Out (internal) for function h: r1; r2 [inout] Inputs for function h: r [inout] Out (internal) for function main: t[0..2]; q; r; __retres [inout] Inputs for function main: p; q; r frama-c-20.0-Calcium/tests/value/oracle/octagons.res.oracle0000666000000000000000000004100413571573400020531 0ustar [kernel] Parsing tests/value/octagons.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization undet ∈ [--..--] [eva] computing for function demo <- main. Called from tests/value/octagons.c:187. [eva] computing for function Frama_C_interval <- demo <- main. Called from tests/value/octagons.c:12. [eva] using specification for function Frama_C_interval [eva] tests/value/octagons.c:12: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/octagons.c:13: Warning: signed overflow. assert -2147483648 ≤ y - k; [eva:alarm] tests/value/octagons.c:14: Warning: signed overflow. assert x + 3 ≤ 2147483647; [eva] Recording results for demo [eva] Done for function demo [eva] computing for function integer_types <- main. Called from tests/value/octagons.c:188. [eva] computing for function Frama_C_interval <- integer_types <- main. Called from tests/value/octagons.c:24. [eva] tests/value/octagons.c:24: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:29: Frama_C_show_each_unreduced_unsigned: [0..4294967295], [0..4294967295] [eva] computing for function Frama_C_interval <- integer_types <- main. Called from tests/value/octagons.c:32. [eva] tests/value/octagons.c:32: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:37: Frama_C_show_each_reduced_char: [-7..3], [6..127] [eva] Recording results for integer_types [eva] Done for function integer_types [eva] computing for function arith <- main. Called from tests/value/octagons.c:189. [eva] computing for function Frama_C_interval <- arith <- main. Called from tests/value/octagons.c:43. [eva] tests/value/octagons.c:43: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- arith <- main. Called from tests/value/octagons.c:46. [eva] tests/value/octagons.c:46: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- arith <- main. Called from tests/value/octagons.c:47. [eva] tests/value/octagons.c:47: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:52: Frama_C_show_each_precise: [42..66],0%2 [eva] tests/value/octagons.c:54: Frama_C_show_each_imprecise: [2..106],0%2 [eva] computing for function Frama_C_interval <- arith <- main. Called from tests/value/octagons.c:55. [eva] tests/value/octagons.c:55: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:59: Frama_C_show_each: {50; 60; 70} [eva] computing for function Frama_C_interval <- arith <- main. Called from tests/value/octagons.c:62. [eva] tests/value/octagons.c:62: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- arith <- main. Called from tests/value/octagons.c:63. [eva] tests/value/octagons.c:63: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:67: Frama_C_show_each: [-29..29] [eva] Recording results for arith [eva] Done for function arith [eva] computing for function join <- main. Called from tests/value/octagons.c:190. [eva] computing for function Frama_C_interval <- join <- main. Called from tests/value/octagons.c:76. [eva] tests/value/octagons.c:76: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/octagons.c:79: Warning: signed overflow. assert -2147483648 ≤ a + k; [eva:alarm] tests/value/octagons.c:79: Warning: signed overflow. assert a + k ≤ 2147483647; [eva] computing for function Frama_C_interval <- join <- main. Called from tests/value/octagons.c:81. [eva] tests/value/octagons.c:81: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:86: Frama_C_show_each_join_positive: [0..53] [eva:alarm] tests/value/octagons.c:89: Warning: signed overflow. assert -2147483648 ≤ a + k; [eva:alarm] tests/value/octagons.c:89: Warning: signed overflow. assert a + k ≤ 2147483647; [eva:alarm] tests/value/octagons.c:89: Warning: signed overflow. assert -((int)(a + k)) ≤ 2147483647; [eva] computing for function Frama_C_interval <- join <- main. Called from tests/value/octagons.c:91. [eva] tests/value/octagons.c:91: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:96: Frama_C_show_each_join_negative: [-47..0] [eva] Recording results for join [eva] Done for function join [eva] computing for function loop <- main. Called from tests/value/octagons.c:191. [eva] computing for function Frama_C_interval <- loop <- main. Called from tests/value/octagons.c:101. [eva] tests/value/octagons.c:101: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- loop <- main. Called from tests/value/octagons.c:102. [eva] tests/value/octagons.c:102: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:106: starting to merge loop iterations [eva:alarm] tests/value/octagons.c:107: Warning: signed overflow. assert a + 2 ≤ 2147483647; [eva:alarm] tests/value/octagons.c:108: Warning: signed overflow. assert b + 2 ≤ 2147483647; [eva:alarm] tests/value/octagons.c:110: Warning: signed overflow. assert a + k ≤ 2147483647; [eva:alarm] tests/value/octagons.c:113: Warning: signed overflow. assert -2147483648 ≤ c - a; [eva] tests/value/octagons.c:115: Frama_C_show_each_singleton_1: {1} [eva] tests/value/octagons.c:116: Frama_C_show_each_imprecise: [-2147483648..1] [eva] tests/value/octagons.c:117: Frama_C_show_each_precise: [-8..8] [eva] Recording results for loop [eva] Done for function loop [eva] computing for function pointers <- main. Called from tests/value/octagons.c:192. [eva] computing for function Frama_C_interval <- pointers <- main. Called from tests/value/octagons.c:124. [eva] tests/value/octagons.c:124: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:127: Frama_C_show_each_singleton_1: {1} [eva] computing for function Frama_C_interval <- pointers <- main. Called from tests/value/octagons.c:128. [eva] tests/value/octagons.c:128: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:129: Frama_C_show_each_singleton_1: {1} [eva] computing for function Frama_C_interval <- pointers <- main. Called from tests/value/octagons.c:130. [eva] tests/value/octagons.c:130: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:131: Frama_C_show_each_unknown: [-1024..1024] [eva] tests/value/octagons.c:133: Frama_C_show_each_unknown: [-2047..2049] [eva] tests/value/octagons.c:136: Frama_C_show_each_singleton_2: {2} [eva] Recording results for pointers [eva] Done for function pointers [eva] computing for function saturate <- main. Called from tests/value/octagons.c:193. [eva] computing for function Frama_C_interval <- saturate <- main. Called from tests/value/octagons.c:142. [eva] tests/value/octagons.c:142: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- saturate <- main. Called from tests/value/octagons.c:143. [eva] tests/value/octagons.c:143: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:147: Frama_C_show_each_saturate: [-5..5] [eva] Recording results for saturate [eva] Done for function saturate [eva] computing for function interprocedural <- main. Called from tests/value/octagons.c:194. [eva] computing for function Frama_C_interval <- interprocedural <- main. Called from tests/value/octagons.c:155. [eva] tests/value/octagons.c:155: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- interprocedural <- main. Called from tests/value/octagons.c:156. [eva] tests/value/octagons.c:156: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function neg <- interprocedural <- main. Called from tests/value/octagons.c:157. [eva] Recording results for neg [eva] Done for function neg [eva] computing for function neg <- interprocedural <- main. Called from tests/value/octagons.c:158. [eva] Recording results for neg [eva] Done for function neg [eva] computing for function diff <- interprocedural <- main. Called from tests/value/octagons.c:167. [eva] Recording results for diff [eva] Done for function diff [eva] computing for function diff <- interprocedural <- main. Called from tests/value/octagons.c:171. [eva] Recording results for diff [eva] Done for function diff [eva] tests/value/octagons.c:174: Frama_C_show_each_equal: [0..16], [0..16], [0..16] [eva] Recording results for interprocedural [eva] Done for function interprocedural [eva] computing for function dump <- main. Called from tests/value/octagons.c:195. [eva] computing for function Frama_C_interval <- dump <- main. Called from tests/value/octagons.c:179. [eva] tests/value/octagons.c:179: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/octagons.c:183: Frama_C_dump_each: # Octagon domain: {[ k - tmp ∈ {0} a - b ∈ [-8..0] b - c ∈ [0..8] a - c ∈ [-8..8] ]} ==END OF DUMP== [eva] Recording results for dump [eva] Done for function dump [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function arith: Frama_C_entropy_source ∈ [--..--] k ∈ {0; 1; 2; 3; 4} a ∈ [-1024..1024] b ∈ [-1024..1024] x ∈ [-28..0] y ∈ [1..29] r ∈ [-29..106] [eva:final-states] Values at end of function demo: Frama_C_entropy_source ∈ [--..--] y ∈ [--..--] k ∈ [0..10] x ∈ [-2147483648..2147483644] r ∈ [-7..3] t ∈ [6..2147483644] or UNINITIALIZED [eva:final-states] Values at end of function diff: __retres ∈ [0..16] [eva:final-states] Values at end of function dump: Frama_C_entropy_source ∈ [--..--] k ∈ [0..8] a ∈ [--..--] b ∈ [--..--] c ∈ [--..--] [eva:final-states] Values at end of function integer_types: Frama_C_entropy_source ∈ [--..--] k ∈ [0..10] x ∈ [--..--] y ∈ [--..--] r ∈ [--..--] t ∈ [--..--] or UNINITIALIZED ck ∈ [0..10] cx ∈ [--..--] cy ∈ [--..--] cr ∈ [-7..3] ct ∈ [6..127] or UNINITIALIZED [eva:final-states] Values at end of function join: Frama_C_entropy_source ∈ [--..--] a ∈ [--..--] b ∈ [-2147483647..2147483647] r ∈ [-47..0] k ∈ {-1; 0; 1; 2; 3; 4} [eva:final-states] Values at end of function loop: Frama_C_entropy_source ∈ [--..--] k ∈ [-8..8] a ∈ [-1024..2147483647] b ∈ [-1023..2147483647] c ∈ [-1023..2147483647] d ∈ [-1032..2147483647] d1 ∈ {1} d2 ∈ [-2147483648..1] d3 ∈ [-8..8] [eva:final-states] Values at end of function neg: __retres ∈ [-12..4] [eva:final-states] Values at end of function interprocedural: Frama_C_entropy_source ∈ [--..--] a ∈ [-4..12] b ∈ [-4..12] neg_a ∈ [-12..4] neg_b ∈ [-12..4] r1 ∈ [0..16] r2 ∈ [0..16] r3 ∈ [0..16] [eva:final-states] Values at end of function pointers: Frama_C_entropy_source ∈ [--..--] x ∈ [-1024..1024] y ∈ [-1022..1026] r ∈ {2} px ∈ {{ &x }} pr ∈ {{ &r }} [eva:final-states] Values at end of function saturate: Frama_C_entropy_source ∈ [--..--] k ∈ [-6..4] x ∈ [-1024..1024] y ∈ [-1030..1028] z ∈ [-1029..1029] result ∈ [-5..5] [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] [from] Computing for function arith [from] Computing for function Frama_C_interval <-arith [from] Done for function Frama_C_interval [from] Done for function arith [from] Computing for function demo [from] Done for function demo [from] Computing for function diff [from] Done for function diff [from] Computing for function dump [from] Done for function dump [from] Computing for function integer_types [from] Done for function integer_types [from] Computing for function join [from] Done for function join [from] Computing for function loop [from] Done for function loop [from] Computing for function neg [from] Done for function neg [from] Computing for function interprocedural [from] Done for function interprocedural [from] Computing for function pointers [from] Done for function pointers [from] Computing for function saturate [from] Done for function saturate [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function arith: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function demo: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function diff: \result FROM x; y [from] Function dump: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function integer_types: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function join: Frama_C_entropy_source FROM Frama_C_entropy_source; undet (and SELF) [from] Function loop: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function neg: \result FROM x [from] Function interprocedural: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function pointers: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function saturate: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source; undet (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function arith: Frama_C_entropy_source; k; a; b; x; y; r [inout] Inputs for function arith: Frama_C_entropy_source [inout] Out (internal) for function demo: Frama_C_entropy_source; y; k; x; r; t [inout] Inputs for function demo: Frama_C_entropy_source; undet [inout] Out (internal) for function diff: __retres [inout] Inputs for function diff: \nothing [inout] Out (internal) for function dump: Frama_C_entropy_source; k; tmp; a; b; c [inout] Inputs for function dump: Frama_C_entropy_source; undet [inout] Out (internal) for function integer_types: Frama_C_entropy_source; k; x; y; r; t; tmp; ck; cx; cy; cr; ct; tmp_0 [inout] Inputs for function integer_types: Frama_C_entropy_source; undet [inout] Out (internal) for function join: Frama_C_entropy_source; a; b; r; k [inout] Inputs for function join: Frama_C_entropy_source; undet [inout] Out (internal) for function loop: Frama_C_entropy_source; k; a; b; c; d; i; d1; d2; d3 [inout] Inputs for function loop: Frama_C_entropy_source [inout] Out (internal) for function neg: __retres [inout] Inputs for function neg: \nothing [inout] Out (internal) for function interprocedural: Frama_C_entropy_source; a; b; neg_a; neg_b; r1; r2; r3 [inout] Inputs for function interprocedural: Frama_C_entropy_source [inout] Out (internal) for function pointers: Frama_C_entropy_source; x; y; r; px; pr [inout] Inputs for function pointers: Frama_C_entropy_source [inout] Out (internal) for function saturate: Frama_C_entropy_source; k; x; y; z; result [inout] Inputs for function saturate: Frama_C_entropy_source [inout] Out (internal) for function main: Frama_C_entropy_source [inout] Inputs for function main: Frama_C_entropy_source; undet frama-c-20.0-Calcium/tests/value/oracle/offset_misaligned.res.oracle0000666000000000000000000000172613571573400022405 0ustar [kernel] Parsing tests/value/offset_misaligned.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..299] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0] ∈ {1} [bits 8 to 39] ∈ {2} [5..9] ∈ {0} [10..265] ∈ {0; 3} [266..299] ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[0..4] FROM \nothing [10..265] FROM u (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t{[0..4]; [10..265]}; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/offset_neg.res.oracle0000666000000000000000000000271513571573400021041 0ustar [kernel] Parsing tests/value/offset_neg.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization mem[0] ∈ {0} addr ∈ {{ &mem[0] }} off ∈ {18446744073709551615} G[0..4] ∈ {0} [eva] tests/value/offset_neg.i:8: Frama_C_dump_each: # Cvalue domain: mem[0] ∈ {0} addr ∈ {{ &mem + {18446744073709551616} }} off ∈ {18446744073709551615} G[0..4] ∈ {0} __retres ∈ UNINITIALIZED ==END OF DUMP== [eva:alarm] tests/value/offset_neg.i:9: Warning: accessing out of bounds index. assert 0 ≤ (int)(-1); [kernel] tests/value/offset_neg.i:9: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/offset_neg.i:9: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: addr [inout] Inputs for function main: addr; off frama-c-20.0-Calcium/tests/value/oracle/offset_top.res.oracle0000666000000000000000000000153513571573400021071 0ustar [kernel] Parsing tests/value/offset_top.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 2047] ∈ [--..--] T ∈ {0} TAB[0..9] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {{ &TAB + [-8589934592..8589934588],0%4 }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i [inout] Inputs for function main: NULL[0..3]; T frama-c-20.0-Calcium/tests/value/oracle/offsetmap.0.res.oracle0000666000000000000000000001410713571573400021042 0ustar [kernel] Parsing tests/value/offsetmap.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization TT[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3..9] ∈ {0} T[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3..9] ∈ {0} i ∈ {0} a ∈ {0} b ∈ {0} a7 ∈ {0} b7 ∈ {0} O1[0..19] ∈ {0} O2[0..19] ∈ {0} p ∈ {0} x2 ∈ {0} b2 ∈ {0} a2 ∈ {0} s[0..9999999] ∈ {0} [eva] computing for function f <- main. Called from tests/value/offsetmap.i:75. [eva] tests/value/offsetmap.i:19: starting to merge loop iterations [eva] tests/value/offsetmap.i:29: starting to merge loop iterations [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/offsetmap.i:76. [eva:alarm] tests/value/offsetmap.i:66: Warning: accessing out of bounds index. assert 0 ≤ i_0; [eva:alarm] tests/value/offsetmap.i:66: Warning: accessing out of bounds index. assert i_0 < 10000000; [eva] Recording results for g [kernel] tests/value/offsetmap.i:68: more than 200(10000000) elements to enumerate. Approximating. [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: TT[0][bits 0 to 7]# ∈ [0..8]%32, bits 0 to 7 [bits 8 to 39]# ∈ [0..8] repeated %32, bits 8 to 39 [bits 40 to 71]# ∈ [0..8] repeated %32, bits 8 to 39 [bits 72 to 287]# ∈ [0..8] repeated %32, bits 8 to 223 [9] ∈ {0} T[0][bits 0 to 7]# ∈ {1}%32, bits 0 to 7 [0][bits 8 to 31]# ∈ {0; 1}%32, bits 8 to 31 [1][bits 0 to 7]# ∈ {0; 2}%32, bits 0 to 7 [1][bits 8 to 31]# ∈ {0; 2}%32, bits 8 to 31 [2][bits 0 to 7]# ∈ {0; 3}%32, bits 0 to 7 [2][bits 8 to 31]# ∈ {0; 3}%32, bits 8 to 31 [3..5] ∈ {0} [6][bits 0 to 7]# ∈ {0; 7}%32, bits 0 to 7 [6][bits 8 to 31]# ∈ {0; 7}%32, bits 8 to 31 [7..9] ∈ {0} i ∈ {9} a[bits 0 to 7] ∈ {1; 6} [bits 8 to 31]# ∈ {6}%32, bits 8 to 31 b ∈ {0; 1} a7[bits 0 to 7] ∈ {1} [bits 8 to 31]# ∈ {97}%32, bits 8 to 31 b7 ∈ {1} O1[0][bits 0 to 7] ∈ {0} [0][bits 8 to 15] ∈ {18} [0][bits 16 to 31] ∈ {0} [1] ∈ {17} [2..8] ∈ {0} [9] ∈ {1} [10..19] ∈ {0} O2[0][bits 0 to 7]# ∈ {10}%32, bits 0 to 7 [0][bits 8 to 15] ∈ {11} [0][bits 16 to 31]# ∈ {10}%32, bits 16 to 31 [1..19] ∈ {0} p ∈ {{ &O1[9] }} x2 ∈ {1} b2 ∈ {{ &x2 }} a2 ∈ {{ (int)&x2 }} [eva:final-states] Values at end of function g: s[0..9999999] ∈ {0; 16975879} p_0 ∈ {{ &s + [0..39999996],0%4 }} c1 ∈ {0; 7} q ∈ {{ &s + [0..9999999] }} c2 ∈ {0; 1; 3; 7; 8} [eva:final-states] Values at end of function main: TT[0][bits 0 to 7]# ∈ [0..8]%32, bits 0 to 7 [bits 8 to 39]# ∈ [0..8] repeated %32, bits 8 to 39 [bits 40 to 71]# ∈ [0..8] repeated %32, bits 8 to 39 [bits 72 to 287]# ∈ [0..8] repeated %32, bits 8 to 223 [9] ∈ {0} T[0][bits 0 to 7]# ∈ {1}%32, bits 0 to 7 [0][bits 8 to 31]# ∈ {0; 1}%32, bits 8 to 31 [1][bits 0 to 7]# ∈ {0; 2}%32, bits 0 to 7 [1][bits 8 to 31]# ∈ {0; 2}%32, bits 8 to 31 [2][bits 0 to 7]# ∈ {0; 3}%32, bits 0 to 7 [2][bits 8 to 31]# ∈ {0; 3}%32, bits 8 to 31 [3..5] ∈ {0} [6][bits 0 to 7]# ∈ {0; 7}%32, bits 0 to 7 [6][bits 8 to 31]# ∈ {0; 7}%32, bits 8 to 31 [7..9] ∈ {0} i ∈ {9} a[bits 0 to 7] ∈ {1; 6} [bits 8 to 31]# ∈ {6}%32, bits 8 to 31 b ∈ {0; 1} a7[bits 0 to 7] ∈ {1} [bits 8 to 31]# ∈ {97}%32, bits 8 to 31 b7 ∈ {1} O1[0][bits 0 to 7] ∈ {0} [0][bits 8 to 15] ∈ {18} [0][bits 16 to 31] ∈ {0} [1] ∈ {17} [2..8] ∈ {0} [9] ∈ {1} [10..19] ∈ {0} O2[0][bits 0 to 7]# ∈ {10}%32, bits 0 to 7 [0][bits 8 to 15] ∈ {11} [0][bits 16 to 31]# ∈ {10}%32, bits 16 to 31 [1..19] ∈ {0} p ∈ {{ &O1[9] }} x2 ∈ {1} b2 ∈ {{ &x2 }} a2 ∈ {{ (int)&x2 }} s[0..9999999] ∈ {0; 16975879} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: TT{[0..8]; [9][bits 0 to 7]} FROM \nothing (and SELF) T{{[0][bits 8 to 31]; [1..5]}; {[7..8]; [9][bits 0 to 7]}} FROM \nothing (and SELF) [6] FROM b i FROM \nothing a FROM b b FROM b (and SELF) a7 FROM \nothing b7 FROM \nothing O1{[0][bits 8 to 15]; [1]; [6]; [9]} FROM \nothing O2[0] FROM \nothing p FROM \nothing x2 FROM \nothing b2 FROM \nothing a2 FROM \nothing [from] Function g: s[0..9999999] FROM i_0 (and SELF) [from] Function main: TT{[0..8]; [9][bits 0 to 7]} FROM \nothing (and SELF) T{{[0][bits 8 to 31]; [1..5]}; {[7..8]; [9][bits 0 to 7]}} FROM \nothing (and SELF) [6] FROM b i FROM \nothing a FROM b b FROM b (and SELF) a7 FROM \nothing b7 FROM \nothing O1{[0][bits 8 to 15]; [1]; [6]; [9]} FROM \nothing O2[0] FROM \nothing p FROM \nothing x2 FROM \nothing b2 FROM \nothing a2 FROM \nothing s[0..9999999] FROM i_0 (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: TT{[0..8]; [9][bits 0 to 7]}; T{[0][bits 8 to 31]; [1..8]; [9][bits 0 to 7]}; i; a; b; a7; b7; O1{[0][bits 8 to 15]; [1]; [6]; [9]}; O2[0]; p; x2; b2; a2 [inout] Inputs for function f: i; a; b; a7; p; x2; b2; a2 [inout] Out (internal) for function g: s[0..9999999]; p_0; c1; q; c2 [inout] Inputs for function g: s{[0..9999998]; [9999999][bits 0 to 7]} [inout] Out (internal) for function main: TT{[0..8]; [9][bits 0 to 7]}; T{[0][bits 8 to 31]; [1..8]; [9][bits 0 to 7]}; i; a; b; a7; b7; O1{[0][bits 8 to 15]; [1]; [6]; [9]}; O2[0]; p; x2; b2; a2; s[0..9999999] [inout] Inputs for function main: i; a; b; a7; p; x2; b2; a2; s{[0..9999998]; [9999999][bits 0 to 7]} frama-c-20.0-Calcium/tests/value/oracle/offsetmap.1.res.oracle0000666000000000000000000001433213571573400021043 0ustar [kernel] Parsing tests/value/offsetmap.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization TT[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3..9] ∈ {0} T[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} [3..9] ∈ {0} i ∈ {0} a ∈ {0} b ∈ {0} a7 ∈ {0} b7 ∈ {0} O1[0..19] ∈ {0} O2[0..19] ∈ {0} p ∈ {0} x2 ∈ {0} b2 ∈ {0} a2 ∈ {0} s[0..9999999] ∈ {0} [eva] computing for function f <- main. Called from tests/value/offsetmap.i:75. [eva] tests/value/offsetmap.i:19: starting to merge loop iterations [eva] tests/value/offsetmap.i:29: starting to merge loop iterations [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/offsetmap.i:76. [eva:alarm] tests/value/offsetmap.i:66: Warning: accessing out of bounds index. assert 0 ≤ i_0; [eva:alarm] tests/value/offsetmap.i:66: Warning: accessing out of bounds index. assert i_0 < 10000000; [eva] Recording results for g [kernel] tests/value/offsetmap.i:68: more than 200(10000000) elements to enumerate. Approximating. [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: TT[0][bits 0 to 7]# ∈ [0..8]%32, bits 0 to 7 [bits 8 to 39]# ∈ [0..8] repeated %32, bits 8 to 39 [bits 40 to 71]# ∈ [0..8] repeated %32, bits 8 to 39 [bits 72 to 287]# ∈ [0..8] repeated %32, bits 8 to 223 [9] ∈ {0} T[0][bits 0 to 7]# ∈ {1}%32, bits 0 to 7 [0][bits 8 to 31]# ∈ {0; 1}%32, bits 8 to 31 [1][bits 0 to 7]# ∈ {0; 2}%32, bits 0 to 7 [1][bits 8 to 31]# ∈ {0; 2}%32, bits 8 to 31 [2][bits 0 to 7]# ∈ {0; 3}%32, bits 0 to 7 [2][bits 8 to 31]# ∈ {0; 3}%32, bits 8 to 31 [3..5] ∈ {0} [6][bits 0 to 7]# ∈ {0; 7}%32, bits 0 to 7 [6][bits 8 to 31]# ∈ {0; 7}%32, bits 8 to 31 [7..9] ∈ {0} i ∈ {9} a[bits 0 to 7] ∈ {1; 6} [bits 8 to 31]# ∈ {6}%32, bits 8 to 31 b[bits 0 to 7] ∈ {0; 1} [bits 8 to 31]# ∈ {0; 6}%32, bits 8 to 31 a7[bits 0 to 7] ∈ {1} [bits 8 to 31]# ∈ {97}%32, bits 8 to 31 b7 ∈ {1} O1[0][bits 0 to 7] ∈ {0} [0][bits 8 to 15] ∈ {18} [0][bits 16 to 31] ∈ {0} [1] ∈ {17} [2..8] ∈ {0} [9] ∈ {1} [10..19] ∈ {0} O2[0][bits 0 to 7]# ∈ {10}%32, bits 0 to 7 [0][bits 8 to 15] ∈ {11} [0][bits 16 to 31]# ∈ {10}%32, bits 16 to 31 [1..19] ∈ {0} p ∈ {{ &O1[9] }} x2 ∈ {1} b2 ∈ {{ &x2 }} a2 ∈ {{ (int)&x2 }} [eva:final-states] Values at end of function g: s[0..9999999] ∈ {0; 16975879} p_0 ∈ {{ &s + [0..39999996],0%4 }} c1# ∈ {0; 16975879}%32, bits 0 to 7 q ∈ {{ &s + [0..9999999] }} c2 ∈ {0; 1; 3; 7; 8} [eva:final-states] Values at end of function main: TT[0][bits 0 to 7]# ∈ [0..8]%32, bits 0 to 7 [bits 8 to 39]# ∈ [0..8] repeated %32, bits 8 to 39 [bits 40 to 71]# ∈ [0..8] repeated %32, bits 8 to 39 [bits 72 to 287]# ∈ [0..8] repeated %32, bits 8 to 223 [9] ∈ {0} T[0][bits 0 to 7]# ∈ {1}%32, bits 0 to 7 [0][bits 8 to 31]# ∈ {0; 1}%32, bits 8 to 31 [1][bits 0 to 7]# ∈ {0; 2}%32, bits 0 to 7 [1][bits 8 to 31]# ∈ {0; 2}%32, bits 8 to 31 [2][bits 0 to 7]# ∈ {0; 3}%32, bits 0 to 7 [2][bits 8 to 31]# ∈ {0; 3}%32, bits 8 to 31 [3..5] ∈ {0} [6][bits 0 to 7]# ∈ {0; 7}%32, bits 0 to 7 [6][bits 8 to 31]# ∈ {0; 7}%32, bits 8 to 31 [7..9] ∈ {0} i ∈ {9} a[bits 0 to 7] ∈ {1; 6} [bits 8 to 31]# ∈ {6}%32, bits 8 to 31 b[bits 0 to 7] ∈ {0; 1} [bits 8 to 31]# ∈ {0; 6}%32, bits 8 to 31 a7[bits 0 to 7] ∈ {1} [bits 8 to 31]# ∈ {97}%32, bits 8 to 31 b7 ∈ {1} O1[0][bits 0 to 7] ∈ {0} [0][bits 8 to 15] ∈ {18} [0][bits 16 to 31] ∈ {0} [1] ∈ {17} [2..8] ∈ {0} [9] ∈ {1} [10..19] ∈ {0} O2[0][bits 0 to 7]# ∈ {10}%32, bits 0 to 7 [0][bits 8 to 15] ∈ {11} [0][bits 16 to 31]# ∈ {10}%32, bits 16 to 31 [1..19] ∈ {0} p ∈ {{ &O1[9] }} x2 ∈ {1} b2 ∈ {{ &x2 }} a2 ∈ {{ (int)&x2 }} s[0..9999999] ∈ {0; 16975879} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: TT{[0..8]; [9][bits 0 to 7]} FROM \nothing (and SELF) T{{[0][bits 8 to 31]; [1..5]}; {[7..8]; [9][bits 0 to 7]}} FROM \nothing (and SELF) [6] FROM b i FROM \nothing a FROM b b FROM b (and SELF) a7 FROM \nothing b7 FROM \nothing O1{[0][bits 8 to 15]; [1]; [6]; [9]} FROM \nothing O2[0] FROM \nothing p FROM \nothing x2 FROM \nothing b2 FROM \nothing a2 FROM \nothing [from] Function g: s[0..9999999] FROM i_0 (and SELF) [from] Function main: TT{[0..8]; [9][bits 0 to 7]} FROM \nothing (and SELF) T{{[0][bits 8 to 31]; [1..5]}; {[7..8]; [9][bits 0 to 7]}} FROM \nothing (and SELF) [6] FROM b i FROM \nothing a FROM b b FROM b (and SELF) a7 FROM \nothing b7 FROM \nothing O1{[0][bits 8 to 15]; [1]; [6]; [9]} FROM \nothing O2[0] FROM \nothing p FROM \nothing x2 FROM \nothing b2 FROM \nothing a2 FROM \nothing s[0..9999999] FROM i_0 (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: TT{[0..8]; [9][bits 0 to 7]}; T{[0][bits 8 to 31]; [1..8]; [9][bits 0 to 7]}; i; a; b; a7; b7; O1{[0][bits 8 to 15]; [1]; [6]; [9]}; O2[0]; p; x2; b2; a2 [inout] Inputs for function f: i; a; b; a7; p; x2; b2; a2 [inout] Out (internal) for function g: s[0..9999999]; p_0; c1; q; c2 [inout] Inputs for function g: s{[0..9999998]; [9999999][bits 0 to 7]} [inout] Out (internal) for function main: TT{[0..8]; [9][bits 0 to 7]}; T{[0][bits 8 to 31]; [1..8]; [9][bits 0 to 7]}; i; a; b; a7; b7; O1{[0][bits 8 to 15]; [1]; [6]; [9]}; O2[0]; p; x2; b2; a2; s[0..9999999] [inout] Inputs for function main: i; a; b; a7; p; x2; b2; a2; s{[0..9999998]; [9999999][bits 0 to 7]} frama-c-20.0-Calcium/tests/value/oracle/origin.0.res.oracle0000666000000000000000000003540713571573400020353 0ustar [kernel] Parsing tests/value/origin.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} aa2 ∈ {0} p ∈ {0} pa1 ∈ {0} pa2 ∈ {0} qa2 ∈ {0} pa3 ∈ {0} q ∈ {0} t[0..11] ∈ {0} tt[0..9] ∈ {0} ta1[0..9] ∈ {0} ta2[0..9] ∈ {0} ta3[0..9] ∈ {0} tta2[0..9] ∈ {0} gpp ∈ {{ NULL ; &S_gpp[0] }} l1 ∈ {0} l2 ∈ {0} l3 ∈ {0} pl ∈ {0} Tm1[0] ∈ {{ &a }} [1] ∈ {{ &b }} Tm2[0] ∈ {{ &a }} [1] ∈ {{ &b }} Tm3[0] ∈ {{ &a }} [1] ∈ {{ &b }} Tm4[0] ∈ {{ &a }} [1] ∈ {{ &b }} pm1 ∈ {0} pm2 ∈ {0} qm2 ∈ {0} pun ∈ {0} pun2 ∈ {0} qun2 ∈ {0} random ∈ [--..--] esc1 ∈ {0} esc2 ∈ {0} esc3 ∈ {0} esc4 ∈ {0} esc5 ∈ {0} x ∈ {0} y ∈ {0} v.c ∈ {1} .[bits 8 to 15] ∈ {0} .i ∈ {2} .p ∈ {{ &x }} .t[0] ∈ {{ &y }} .t[1] ∈ {0} S_gpp[0..1] ∈ [--..--] [eva] computing for function origin_arithmetic_1 <- main. Called from tests/value/origin.i:94. [eva:alarm] tests/value/origin.i:14: Warning: signed overflow. assert -2147483648 ≤ -((int)((int *)ta1)); [eva:alarm] tests/value/origin.i:14: Warning: signed overflow. assert -((int)((int *)ta1)) ≤ 2147483647; [eva] tests/value/origin.i:14: Assigning imprecise value to pa1. The imprecision originates from Arithmetic {tests/value/origin.i:14} [eva:alarm] tests/value/origin.i:15: Warning: out of bounds write. assert \valid(pa1); [eva] Recording results for origin_arithmetic_1 [eva] Done for function origin_arithmetic_1 [eva] computing for function origin_arithmetic_2 <- main. Called from tests/value/origin.i:95. [eva:alarm] tests/value/origin.i:19: Warning: signed overflow. assert -2147483648 ≤ -((int)((int *)ta2)); [eva:alarm] tests/value/origin.i:19: Warning: signed overflow. assert -((int)((int *)ta2)) ≤ 2147483647; [eva] tests/value/origin.i:19: Assigning imprecise value to pa2. The imprecision originates from Arithmetic {tests/value/origin.i:19} [eva] tests/value/origin.i:20: Assigning imprecise value to qa2. The imprecision originates from Arithmetic {tests/value/origin.i:19} [eva:alarm] tests/value/origin.i:20: Warning: signed overflow. assert -2147483648 ≤ -((int)((int *)tta2)); [eva:alarm] tests/value/origin.i:20: Warning: signed overflow. assert -((int)((int *)tta2)) ≤ 2147483647; [eva] tests/value/origin.i:20: Assigning imprecise value to qa2. The imprecision originates from Arithmetic {tests/value/origin.i:20} [eva:alarm] tests/value/origin.i:21: Warning: out of bounds write. assert \valid(qa2); [eva] Recording results for origin_arithmetic_2 [eva] Done for function origin_arithmetic_2 [eva] computing for function origin_arithmetic_3 <- main. Called from tests/value/origin.i:96. [eva:alarm] tests/value/origin.i:25: Warning: signed overflow. assert -2147483648 ≤ -((int)((int *)ta3)); [eva:alarm] tests/value/origin.i:25: Warning: signed overflow. assert -((int)((int *)ta3)) ≤ 2147483647; [eva] tests/value/origin.i:25: Assigning imprecise value to pa3. The imprecision originates from Arithmetic {tests/value/origin.i:25} [eva:alarm] tests/value/origin.i:26: Warning: out of bounds write. assert \valid(pa3); [eva] Recording results for origin_arithmetic_3 [eva] Done for function origin_arithmetic_3 [eva] computing for function origin_leaf_1 <- main. Called from tests/value/origin.i:97. [eva] computing for function g <- origin_leaf_1 <- main. Called from tests/value/origin.i:38. [kernel:annot:missing-spec] tests/value/origin.i:38: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] Recording results for origin_leaf_1 [eva] Done for function origin_leaf_1 [eva] computing for function g <- main. Called from tests/value/origin.i:99. [eva] Done for function g [eva:alarm] tests/value/origin.i:99: Warning: signed overflow. assert -2147483648 ≤ l2 + tmp; (tmp from g()) [eva:alarm] tests/value/origin.i:99: Warning: signed overflow. assert l2 + tmp ≤ 2147483647; (tmp from g()) [eva] computing for function gp <- main. Called from tests/value/origin.i:100. [eva] using specification for function gp [eva] Done for function gp [eva] tests/value/origin.i:100: Assigning imprecise value to pl. The imprecision originates from Library function {tests/value/origin.i:100} [eva:alarm] tests/value/origin.i:101: Warning: out of bounds read. assert \valid_read(pl); [eva] computing for function origin_misalign_1 <- main. Called from tests/value/origin.i:102. [eva] tests/value/origin.i:48: Assigning imprecise value to pm1. The imprecision originates from Misaligned {tests/value/origin.i:48} [eva:alarm] tests/value/origin.i:49: Warning: out of bounds write. assert \valid(pm1); [eva] Recording results for origin_misalign_1 [eva] Done for function origin_misalign_1 [eva] computing for function origin_misalign_2 <- main. Called from tests/value/origin.i:103. [eva] tests/value/origin.i:54: Assigning imprecise value to qm2. The imprecision originates from Misaligned {tests/value/origin.i:54} [eva] tests/value/origin.i:55: Frama_C_show_each: {{ garbled mix of &{a; b} (origin: Misaligned {tests/value/origin.i:54}) }} [eva:alarm] tests/value/origin.i:56: Warning: out of bounds write. assert \valid(qm2); [eva] Recording results for origin_misalign_2 [eva] Done for function origin_misalign_2 [eva] computing for function origin_uninitialized_1 <- main. Called from tests/value/origin.i:106. [eva:alarm] tests/value/origin.i:65: Warning: accessing uninitialized left-value. assert \initialized(&pi); [eva] Recording results for origin_uninitialized_1 [eva] Done for function origin_uninitialized_1 [eva] computing for function origin_uninitialized_2 <- main. Called from tests/value/origin.i:107. [eva:alarm] tests/value/origin.i:72: Warning: accessing uninitialized left-value. assert \initialized(&pi); [eva:alarm] tests/value/origin.i:75: Warning: accessing uninitialized left-value. assert \initialized(&i); [eva] Recording results for origin_uninitialized_2 [eva] Done for function origin_uninitialized_2 [eva] computing for function local_escape_1 <- main. Called from tests/value/origin.i:108. [eva:alarm] tests/value/origin.i:85: Warning: signed overflow. assert -2147483648 ≤ -((int)(&arg)); [eva:alarm] tests/value/origin.i:85: Warning: signed overflow. assert -((int)(&arg)) ≤ 2147483647; [eva] tests/value/origin.i:85: Assigning imprecise value to esc3. The imprecision originates from Arithmetic {tests/value/origin.i:85} [eva] Recording results for local_escape_1 [eva] Done for function local_escape_1 [eva:locals-escaping] tests/value/origin.i:108: Warning: locals {arg} escaping the scope of local_escape_1 through esc1 [eva:locals-escaping] tests/value/origin.i:108: Warning: locals {local1} escaping the scope of local_escape_1 through esc2 [eva:locals-escaping] tests/value/origin.i:108: Warning: locals {arg} escaping the scope of local_escape_1 through esc3 [eva:locals-escaping] tests/value/origin.i:108: Warning: locals {local1} escaping the scope of local_escape_1 through esc4 [eva] Recording results for main [eva] done for function main [eva] tests/value/origin.i:75: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function local_escape_1: esc1 ∈ {{ (int)&arg }} esc2 ∈ {{ (int)&local1 }} esc3 ∈ {{ garbled mix of &{arg} (origin: Arithmetic {tests/value/origin.i:85}) }} esc4 ∈ {{ NULL + {12} ; (int)&local1 }} esc5 ∈ {{ (int)&esc1 }} local2 ∈ {{ (int)&local1 }} [eva:final-states] Values at end of function origin_arithmetic_1: pa1 ∈ {{ &ta1 + [0..36] }} ta1[0..9] ∈ {0} [eva:final-states] Values at end of function origin_arithmetic_2: pa2 ∈ {{ garbled mix of &{ta2} (origin: Arithmetic {tests/value/origin.i:19}) }} qa2 ∈ {{ &ta2 + [0..36] ; &tta2 + [0..36] }} ta2[0..9] ∈ {{ garbled mix of &{aa2} (origin: Misaligned {tests/value/origin.i:21}) }} tta2[0..9] ∈ {{ garbled mix of &{aa2} (origin: Misaligned {tests/value/origin.i:21}) }} [eva:final-states] Values at end of function origin_arithmetic_3: pa3 ∈ {{ &ta3 + [0..36] }} ta3[0..9] ∈ [--..--] [eva:final-states] Values at end of function origin_leaf_1: l1 ∈ [--..--] [eva:final-states] Values at end of function origin_misalign_1: a ∈ {0; 1} b ∈ {0; 1} pm1 ∈ {{ &a ; &b }} [eva:final-states] Values at end of function origin_misalign_2: a ∈ {{ NULL + {0; 1} ; (int)&a }} b ∈ {{ NULL + {0; 1} ; (int)&a }} pm2[bits 0 to 15]# ∈ {{ (? *)&a }}%32, bits 16 to 31 [bits 16 to 31]# ∈ {{ (? *)&b }}%32, bits 0 to 15 qm2 ∈ {{ &a ; &b }} [eva:final-states] Values at end of function origin_uninitialized_1: pun ∈ {{ &a }} pi ∈ {{ &a }} [eva:final-states] Values at end of function origin_uninitialized_2: pun2 ∈ {{ &a }} qun2 ∈ {0} pi ∈ {{ &a }} [eva:final-states] Values at end of function main: a ∈ {{ NULL + {0; 1} ; (int)&a }} b ∈ {{ NULL + {0; 1} ; (int)&a }} p[bits 0 to 15]# ∈ {{ (? *)&a }}%32, bits 16 to 31 [bits 16 to 31]# ∈ {{ (? *)&b }}%32, bits 0 to 15 pa1 ∈ {{ &ta1 + [0..36] }} pa2 ∈ {{ garbled mix of &{ta2} (origin: Arithmetic {tests/value/origin.i:19}) }} qa2 ∈ {{ &ta2 + [0..36] ; &tta2 + [0..36] }} pa3 ∈ {{ &ta3 + [0..36] }} q[bits 0 to 7] ∈ {{ garbled mix of &{a} (origin: Merge {tests/value/origin.i:106}) }} [bits 8 to 15] ∈ {{ garbled mix of &{a; b} (origin: Merge {tests/value/origin.i:106}) }} [bits 16 to 31] ∈ {{ garbled mix of &{b} (origin: Merge {tests/value/origin.i:106}) }} ta1[0..9] ∈ {0} ta2[0..9] ∈ {{ garbled mix of &{aa2} (origin: Misaligned {tests/value/origin.i:21}) }} ta3[0..9] ∈ [--..--] tta2[0..9] ∈ {{ garbled mix of &{aa2} (origin: Misaligned {tests/value/origin.i:21}) }} l1 ∈ [--..--] l2 ∈ [--..--] l3 ∈ [--..--] pl ∈ {{ &S_gpp + {0; 1; 2; 3; 4} }} pm1 ∈ {{ &a ; &b }} pm2[bits 0 to 15]# ∈ {{ (? *)&a }}%32, bits 16 to 31 [bits 16 to 31]# ∈ {{ (? *)&b }}%32, bits 0 to 15 qm2 ∈ {{ &a ; &b }} pun ∈ {{ &a }} pun2 ∈ {{ &a }} qun2 ∈ {0} esc1 ∈ ESCAPINGADDR esc2 ∈ ESCAPINGADDR esc3 ∈ [--..--] or ESCAPINGADDR esc4 ∈ {12} or ESCAPINGADDR esc5 ∈ {{ (int)&esc1 }} [from] Computing for function local_escape_1 [from] Done for function local_escape_1 [from] Computing for function origin_arithmetic_1 [from] Done for function origin_arithmetic_1 [from] Computing for function origin_arithmetic_2 [from] Done for function origin_arithmetic_2 [from] Computing for function origin_arithmetic_3 [from] Done for function origin_arithmetic_3 [from] Computing for function origin_leaf_1 [from] Computing for function g <-origin_leaf_1 [from] Done for function g [from] Done for function origin_leaf_1 [from] Computing for function origin_misalign_1 [from] Done for function origin_misalign_1 [from] Computing for function origin_misalign_2 [from] Done for function origin_misalign_2 [from] Computing for function origin_uninitialized_1 [from] Done for function origin_uninitialized_1 [from] Computing for function origin_uninitialized_2 [from] Done for function origin_uninitialized_2 [from] Computing for function main [from] Computing for function gp <-main [from] Done for function gp [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: \result FROM \nothing [from] Function gp: \result FROM gpp [from] Function local_escape_1: esc1 FROM \nothing esc2 FROM \nothing esc3 FROM \nothing esc4 FROM random esc5 FROM \nothing [from] Function origin_arithmetic_1: pa1 FROM \nothing ta1[0..9] FROM \nothing (and SELF) [from] Function origin_arithmetic_2: pa2 FROM \nothing qa2 FROM c1 ta2[0..9] FROM c1 (and SELF) tta2[0..9] FROM c1 (and SELF) [from] Function origin_arithmetic_3: pa3 FROM \nothing ta3[0..9] FROM \nothing (and SELF) [from] Function origin_leaf_1: l1 FROM \nothing [from] Function origin_misalign_1: a FROM Tm1{[0][bits 16 to 31]; [1][bits 0 to 15]} (and SELF) b FROM Tm1{[0][bits 16 to 31]; [1][bits 0 to 15]} (and SELF) pm1 FROM Tm1{[0][bits 16 to 31]; [1][bits 0 to 15]} [from] Function origin_misalign_2: a FROM Tm2{[0][bits 16 to 31]; [1][bits 0 to 15]} (and SELF) b FROM Tm2{[0][bits 16 to 31]; [1][bits 0 to 15]} (and SELF) pm2 FROM Tm2{[0][bits 16 to 31]; [1][bits 0 to 15]} qm2 FROM Tm2{[0][bits 16 to 31]; [1][bits 0 to 15]} [from] Function origin_uninitialized_1: pun FROM c1 [from] Function origin_uninitialized_2: pun2 FROM c1 qun2 FROM c1; c2 (and SELF) [from] Function main: a FROM Tm1{[0][bits 16 to 31]; [1][bits 0 to 15]}; Tm2{[0][bits 16 to 31]; [1][bits 0 to 15]} (and SELF) b FROM Tm1{[0][bits 16 to 31]; [1][bits 0 to 15]}; Tm2{[0][bits 16 to 31]; [1][bits 0 to 15]} (and SELF) p FROM Tm3{[0][bits 16 to 31]; [1][bits 0 to 15]} pa1 FROM \nothing pa2 FROM \nothing qa2 FROM c1 pa3 FROM \nothing q FROM Tm3{[0][bits 16 to 31]; [1][bits 0 to 15]}; Tm4{[0][bits 24 to 31]; [1][bits 0 to 23]}; c1 ta1[0..9] FROM \nothing (and SELF) ta2[0..9] FROM c1 (and SELF) ta3[0..9] FROM \nothing (and SELF) tta2[0..9] FROM c1 (and SELF) l1 FROM \nothing l2 FROM \nothing l3 FROM gpp; S_gpp[0..1] pl FROM gpp pm1 FROM Tm1{[0][bits 16 to 31]; [1][bits 0 to 15]} pm2 FROM Tm2{[0][bits 16 to 31]; [1][bits 0 to 15]} qm2 FROM Tm2{[0][bits 16 to 31]; [1][bits 0 to 15]} pun FROM c1 pun2 FROM c1 qun2 FROM c1; c2 (and SELF) esc1 FROM \nothing esc2 FROM \nothing esc3 FROM \nothing esc4 FROM random esc5 FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function local_escape_1: esc1; esc2; esc3; esc4; esc5; local2 [inout] Out (internal) for function origin_arithmetic_1: pa1; ta1[0..9] [inout] Out (internal) for function origin_arithmetic_2: pa2; qa2; ta2[0..9]; tta2[0..9] [inout] Out (internal) for function origin_arithmetic_3: pa3; ta3[0..9] [inout] Out (internal) for function origin_leaf_1: l1 [inout] Out (internal) for function origin_misalign_1: a; b; pm1 [inout] Out (internal) for function origin_misalign_2: a; b; pm2; qm2 [inout] Out (internal) for function origin_uninitialized_1: pun; pi [inout] Out (internal) for function origin_uninitialized_2: pun2; qun2; pi [inout] Out (internal) for function main: a; b; p; pa1; pa2; qa2; pa3; q; ta1[0..9]; ta2[0..9]; ta3[0..9]; tta2[0..9]; l1; l2; l3; pl; pm1; pm2; qm2; pun; pun2; qun2; esc1; esc2; esc3; esc4; esc5; tmp frama-c-20.0-Calcium/tests/value/oracle/origin.1.res.oracle0000666000000000000000000000705113571573400020346 0ustar [kernel] Parsing tests/value/origin.i (no preprocessing) [eva] Analyzing a complete application starting at origin [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} aa2 ∈ {0} p ∈ {0} pa1 ∈ {0} pa2 ∈ {0} qa2 ∈ {0} pa3 ∈ {0} q ∈ {0} t[0..11] ∈ {0} tt[0..9] ∈ {0} ta1[0..9] ∈ {0} ta2[0..9] ∈ {0} ta3[0..9] ∈ {0} tta2[0..9] ∈ {0} gpp ∈ {{ NULL ; &S_gpp[0] }} l1 ∈ {0} l2 ∈ {0} l3 ∈ {0} pl ∈ {0} Tm1[0] ∈ {{ &a }} [1] ∈ {{ &b }} Tm2[0] ∈ {{ &a }} [1] ∈ {{ &b }} Tm3[0] ∈ {{ &a }} [1] ∈ {{ &b }} Tm4[0] ∈ {{ &a }} [1] ∈ {{ &b }} pm1 ∈ {0} pm2 ∈ {0} qm2 ∈ {0} pun ∈ {0} pun2 ∈ {0} qun2 ∈ {0} random ∈ [--..--] esc1 ∈ {0} esc2 ∈ {0} esc3 ∈ {0} esc4 ∈ {0} esc5 ∈ {0} x ∈ {0} y ∈ {0} v.c ∈ {1} .[bits 8 to 15] ∈ {0} .i ∈ {2} .p ∈ {{ &x }} .t[0] ∈ {{ &y }} .t[1] ∈ {0} S_gpp[0..1] ∈ [--..--] [eva] computing for function f <- origin. Called from tests/value/origin.i:124. [kernel:annot:missing-spec] tests/value/origin.i:124: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] tests/value/origin.i:126: Assigning imprecise value to r.p. The imprecision originates from Misaligned {tests/value/origin.i:126} [eva] tests/value/origin.i:129: Assigning imprecise value to r.t[0]. The imprecision originates from Merge {tests/value/origin.i:129} [eva:alarm] tests/value/origin.i:130: Warning: signed overflow. assert -2147483648 ≤ -((int)(&x)); [eva:alarm] tests/value/origin.i:130: Warning: signed overflow. assert -((int)(&x)) ≤ 2147483647; [eva] tests/value/origin.i:130: Assigning imprecise value to r.t[1]. The imprecision originates from Arithmetic {tests/value/origin.i:130} [eva] tests/value/origin.i:131: Assigning imprecise value to \result. The imprecision originates from Misaligned {tests/value/origin.i:126} [eva] Recording results for origin [eva] done for function origin [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function origin: r.c ∈ [--..--] .[bits 8 to 15] ∈ UNINITIALIZED .i ∈ [--..--] .p ∈ {{ garbled mix of &{x} (origin: Misaligned {tests/value/origin.i:126}) }} .t[0][bits 0 to 7] ∈ {{ garbled mix of &{y} (origin: Merge {tests/value/origin.i:129}) }} .t[0][bits 8 to 15]# ∈ {{ NULL ; (? *)&y }}%32, bits 24 to 31 .t[0][bits 16 to 31] ∈ {0} .t[1] ∈ {{ garbled mix of &{x} (origin: Arithmetic {tests/value/origin.i:130}) }} q1[bits 0 to 15]# ∈ {{ (? *)&y }}%32, bits 16 to 31 [bits 16 to 31] ∈ {0} q2[bits 0 to 7] ∈ {{ garbled mix of &{y} (origin: Merge {tests/value/origin.i:129}) }} [bits 8 to 15]# ∈ {{ NULL ; (? *)&y }}%32, bits 24 to 31 [bits 16 to 31] ∈ {0} [from] Computing for function origin [from] Computing for function f <-origin [from] Done for function f [from] Done for function origin [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function origin: \result FROM v{{.i[bits 8 to 15]; .p[bits 0 to 23]}; .t{[0][bits 16 to 31]; [1][bits 0 to 23]}}; c0 [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function origin: r{.c; {.i; .p; .t[0..1]}}; q1; q2 frama-c-20.0-Calcium/tests/value/oracle/output_leafs.res.oracle0000666000000000000000000001077113571573400021435 0ustar [kernel] Parsing tests/value/output_leafs.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization H ∈ {0} G ∈ {0} K ∈ {0} L ∈ {0} M ∈ {0} N ∈ {0} P ∈ {0} a ∈ {0} b ∈ {0} c ∈ {0} d ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/output_leafs.i:45. [eva] computing for function crypt <- main1 <- main. Called from tests/value/output_leafs.i:13. [eva] using specification for function crypt [eva] Done for function crypt [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/output_leafs.i:46. [eva] computing for function g1 <- main2 <- main. Called from tests/value/output_leafs.i:31. [eva] computing for function g <- g1 <- main2 <- main. Called from tests/value/output_leafs.i:23. [eva] using specification for function g [eva] Done for function g [eva] Recording results for g1 [eva] Done for function g1 [eva] computing for function g2 <- main2 <- main. Called from tests/value/output_leafs.i:32. [eva] computing for function g <- g2 <- main2 <- main. Called from tests/value/output_leafs.i:27. [eva] Done for function g [eva] Recording results for g2 [eva] Done for function g2 [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/output_leafs.i:47. [eva] computing for function f <- main3 <- main. Called from tests/value/output_leafs.i:40. [kernel:annot:missing-spec] tests/value/output_leafs.i:40: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g1: b ∈ [--..--] [eva:final-states] Values at end of function g2: d ∈ [--..--] [eva:final-states] Values at end of function main1: H ∈ {{ &K }} G ∈ [--..--] K ∈ [--..--] L ∈ [--..--] [eva:final-states] Values at end of function main2: b ∈ [--..--] d ∈ [--..--] [eva:final-states] Values at end of function main3: x ∈ [--..--] [eva:final-states] Values at end of function main: H ∈ {{ &K }} G ∈ [--..--] K ∈ [--..--] L ∈ [--..--] b ∈ [--..--] d ∈ [--..--] [from] Computing for function g1 [from] Computing for function g <-g1 [from] Done for function g [from] Done for function g1 [from] Computing for function g2 [from] Done for function g2 [from] Computing for function main1 [from] Computing for function crypt <-main1 [from] Done for function crypt [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Computing for function f <-main3 [from] Done for function f [from] Done for function main3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function crypt: G FROM G; K (and SELF) K FROM P L FROM \nothing [from] Function f: x FROM x (and SELF) [from] Function g: b FROM a; c (and SELF) d FROM a; c (and SELF) [from] Function g1: b FROM a; c (and SELF) d FROM a; c (and SELF) [from] Function g2: b FROM a; c (and SELF) d FROM a; c (and SELF) [from] Function main1: H FROM \nothing G FROM G; K (and SELF) K FROM P L FROM \nothing [from] Function main2: b FROM a; c (and SELF) d FROM a; c (and SELF) [from] Function main3: \result FROM \nothing [from] Function main: H FROM \nothing G FROM G; K (and SELF) K FROM P L FROM \nothing b FROM a; c (and SELF) d FROM a; c (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function g1: b [inout] Inputs for function g1: a [inout] Out (internal) for function g2: d [inout] Inputs for function g2: c [inout] Out (internal) for function main1: H; G; K; L [inout] Inputs for function main1: G; K; P [inout] Out (internal) for function main2: b; d [inout] Inputs for function main2: a; c [inout] Out (internal) for function main3: x [inout] Inputs for function main3: \nothing [inout] Out (internal) for function main: H; G; K; L; b; d [inout] Inputs for function main: G; K; P; a; c frama-c-20.0-Calcium/tests/value/oracle/overflow.0.res.oracle0000666000000000000000000000270413571573400020721 0ustar [kernel] Parsing tests/value/overflow.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/overflow.i:20: Warning: signed overflow. assert 60000 * y ≤ 2147483647; [eva:alarm] tests/value/overflow.i:21: Warning: signed overflow. assert (int)(y * 1000) * 1000 ≤ 2147483647; [eva:alarm] tests/value/overflow.i:22: Warning: signed overflow. assert -2147483648 ≤ (int)(-y) * 10000000; [eva:alarm] tests/value/overflow.i:31: Warning: signed overflow. assert -c ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {18446744073709551615} j ∈ {4294967295} is ∈ {-1} js ∈ {-1} minjs ∈ {-2147483648} maxjs ∈ {2147483647} i1 ∈ {0} j1 ∈ {0} y ∈ {1; 100000} x ∈ {0} z ∈ {1000000} t ∈ {-10000000} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; is; js; minjs; maxjs; i1; j1; y; tmp; x; z; t; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/overflow.1.res.oracle0000666000000000000000000000270013571573400020716 0ustar [kernel] Parsing tests/value/overflow.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:signed-overflow] tests/value/overflow.i:20: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/value/overflow.i:21: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/value/overflow.i:22: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/value/overflow.i:31: Warning: 2's complement assumed for overflow [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {18446744073709551615} j ∈ {4294967295} is ∈ {-1} js ∈ {-1} minjs ∈ {-2147483648} maxjs ∈ {2147483647} i1 ∈ {0} j1 ∈ {0} y ∈ {1; 100000} x ∈ {0; 17050} z ∈ {1000000; 1215752192} t ∈ {-10000000; 727379968} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; j; is; js; minjs; maxjs; i1; j1; y; tmp; x; z; t; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/overflow_cast_float_int.res.oracle0000666000000000000000000000333713571573400023637 0ustar [kernel] Parsing tests/value/overflow_cast_float_int.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:alarm] tests/value/overflow_cast_float_int.i:16: Warning: overflow in conversion from floating-point to integer. assert vf1 < 2147483648; [eva:alarm] tests/value/overflow_cast_float_int.i:20: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < -2147483649.5; [eva:alarm] tests/value/overflow_cast_float_int.i:24: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < dd; [eva] Recording results for main [eva] done for function main [eva] tests/value/overflow_cast_float_int.i:16: assertion 'Eva,float_to_int' got final status invalid. [eva] tests/value/overflow_cast_float_int.i:20: assertion 'Eva,float_to_int' got final status invalid. [eva] tests/value/overflow_cast_float_int.i:24: assertion 'Eva,float_to_int' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: vf1 ∈ UNINITIALIZED e ∈ UNINITIALIZED d ∈ {2147483647} c1 ∈ {2147483647} c2 ∈ UNINITIALIZED dd ∈ [-1.17159917953e+20 .. -30459646388.] __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: vf1; e; d; c1; c2; dd; tmp; k; __retres [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/packed.res.oracle0000666000000000000000000000141213571573400020142 0ustar [kernel] Parsing tests/value/packed.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ [--..--] y ∈ [--..--] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/partitioning-annots.0.res.oracle0000666000000000000000000000331113571573400023060 0ustar [kernel] Parsing tests/value/partitioning-annots.c (with preprocessing) [eva] Analyzing a complete application starting at test_unroll [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} [eva:loop-unroll] tests/value/partitioning-annots.c:26: loop not completely unrolled [eva] tests/value/partitioning-annots.c:26: starting to merge loop iterations [eva:loop-unroll] tests/value/partitioning-annots.c:34: loop not completely unrolled [eva] tests/value/partitioning-annots.c:34: starting to merge loop iterations [eva] tests/value/partitioning-annots.c:36: starting to merge loop iterations [eva:loop-unroll] tests/value/partitioning-annots.c:50: loop not completely unrolled [eva] tests/value/partitioning-annots.c:50: starting to merge loop iterations [eva] Recording results for test_unroll [eva] done for function test_unroll [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test_unroll: a[0..9] ∈ {42} b[0..9] ∈ {42} c[0..9] ∈ {0} d[0..9] ∈ {0} [10..19] ∈ {0} or UNINITIALIZED e[0] ∈ {1} [1] ∈ {9} [2] ∈ {36} [3] ∈ {84} [4..5] ∈ {126} [6] ∈ {84} [7] ∈ {36} [8] ∈ {9} [9] ∈ {1} [from] Computing for function test_unroll [from] Done for function test_unroll [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function test_unroll: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function test_unroll: a[0..9]; b[0..9]; c[0..9]; d[0..19]; e[0..9]; i; j; i_0; j_0; i_1; i_2; i_3; j_1 [inout] Inputs for function test_unroll: \nothing frama-c-20.0-Calcium/tests/value/oracle/partitioning-annots.1.res.oracle0000666000000000000000000000617313571573400023072 0ustar [kernel] Parsing tests/value/partitioning-annots.c (with preprocessing) [eva] Analyzing a complete application starting at test_split [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} [eva] computing for function Frama_C_interval <- test_split. Called from tests/value/partitioning-annots.c:69. [eva] using specification for function Frama_C_interval [eva] tests/value/partitioning-annots.c:69: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- test_split. Called from tests/value/partitioning-annots.c:70. [eva] tests/value/partitioning-annots.c:70: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/partitioning-annots.c:76: Frama_C_show_each_before_first_split: {0; 1}, {0; 1; 2}, {0} [eva] tests/value/partitioning-annots.c:79: Frama_C_show_each_before_second_split: {1}, {0; 1; 2}, {1} [eva] tests/value/partitioning-annots.c:79: Frama_C_show_each_before_second_split: {0}, {0; 1; 2}, {0} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {1}, {2}, {1} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {1}, {1}, {1} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {1}, {0}, {1} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {0}, {2}, {0} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {0}, {1}, {0} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {0}, {0}, {0} [eva] tests/value/partitioning-annots.c:83: Frama_C_show_each_before_second_merge: {0; 1}, {2}, {0; 1} [eva] tests/value/partitioning-annots.c:83: Frama_C_show_each_before_second_merge: {0; 1}, {1}, {0; 1} [eva] tests/value/partitioning-annots.c:83: Frama_C_show_each_before_second_merge: {0; 1}, {0}, {0; 1} [eva] tests/value/partitioning-annots.c:85: Frama_C_show_each_end: {0; 1}, {0; 1; 2}, {0; 1} [eva] Recording results for test_split [eva] done for function test_split [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test_split: Frama_C_entropy_source ∈ [--..--] k ∈ {0; 1} i ∈ {0; 1} j ∈ {0; 1; 2} [from] Computing for function test_split [from] Computing for function Frama_C_interval <-test_split [from] Done for function Frama_C_interval [from] Done for function test_split [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function test_split: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) k FROM Frama_C_entropy_source [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function test_split: Frama_C_entropy_source; k; i; j [inout] Inputs for function test_split: Frama_C_entropy_source; k frama-c-20.0-Calcium/tests/value/oracle/partitioning-annots.2.res.oracle0000666000000000000000000000675113571573400023075 0ustar [kernel] Parsing tests/value/partitioning-annots.c (with preprocessing) [eva] Analyzing a complete application starting at test_split [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} [eva] computing for function Frama_C_interval <- test_split. Called from tests/value/partitioning-annots.c:69. [eva] using specification for function Frama_C_interval [eva] tests/value/partitioning-annots.c:69: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- test_split. Called from tests/value/partitioning-annots.c:70. [eva] tests/value/partitioning-annots.c:70: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/partitioning-annots.c:76: Frama_C_show_each_before_first_split: {0; 1}, {0; 1; 2}, {0} [eva] tests/value/partitioning-annots.c:79: Frama_C_show_each_before_second_split: {1}, {0; 1; 2}, {1} [eva] tests/value/partitioning-annots.c:79: Frama_C_show_each_before_second_split: {0}, {0; 1; 2}, {0} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {1}, {2}, {1} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {1}, {1}, {1} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {1}, {0}, {1} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {0}, {2}, {0} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {0}, {1}, {0} [eva] tests/value/partitioning-annots.c:81: Frama_C_show_each_before_first_merge: {0}, {0}, {0} [eva] tests/value/partitioning-annots.c:83: Frama_C_show_each_before_second_merge: {1}, {2}, {1} [eva] tests/value/partitioning-annots.c:83: Frama_C_show_each_before_second_merge: {0}, {2}, {0} [eva] tests/value/partitioning-annots.c:83: Frama_C_show_each_before_second_merge: {1}, {1}, {1} [eva] tests/value/partitioning-annots.c:83: Frama_C_show_each_before_second_merge: {0}, {1}, {0} [eva] tests/value/partitioning-annots.c:83: Frama_C_show_each_before_second_merge: {1}, {0}, {1} [eva] tests/value/partitioning-annots.c:83: Frama_C_show_each_before_second_merge: {0}, {0}, {0} [eva] tests/value/partitioning-annots.c:85: Frama_C_show_each_end: {1}, {0; 1; 2}, {1} [eva] tests/value/partitioning-annots.c:85: Frama_C_show_each_end: {0}, {0; 1; 2}, {0} [eva] Recording results for test_split [eva] done for function test_split [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test_split: Frama_C_entropy_source ∈ [--..--] k ∈ {0; 1} i ∈ {0; 1} j ∈ {0; 1; 2} [from] Computing for function test_split [from] Computing for function Frama_C_interval <-test_split [from] Done for function Frama_C_interval [from] Done for function test_split [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function test_split: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) k FROM Frama_C_entropy_source [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function test_split: Frama_C_entropy_source; k; i; j [inout] Inputs for function test_split: Frama_C_entropy_source; k frama-c-20.0-Calcium/tests/value/oracle/partitioning-annots.3.res.oracle0000666000000000000000000000675613571573400023103 0ustar [kernel] Parsing tests/value/partitioning-annots.c (with preprocessing) [eva] Analyzing a complete application starting at test_loop_split [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} [eva] computing for function Frama_C_interval <- test_loop_split. Called from tests/value/partitioning-annots.c:103. [eva] using specification for function Frama_C_interval [eva] tests/value/partitioning-annots.c:103: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- test_loop_split. Called from tests/value/partitioning-annots.c:103. [eva] Done for function Frama_C_interval [eva] tests/value/partitioning-annots.c:101: starting to merge loop iterations [eva] computing for function Frama_C_interval <- test_loop_split. Called from tests/value/partitioning-annots.c:103. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- test_loop_split. Called from tests/value/partitioning-annots.c:103. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- test_loop_split. Called from tests/value/partitioning-annots.c:103. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- test_loop_split. Called from tests/value/partitioning-annots.c:103. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/partitioning-annots.c:110: Warning: accessing uninitialized left-value. assert \initialized(&A[i]); [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {9}, {42} [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {8}, {42} [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {7}, {42} [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {6}, {42} [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {5}, {42} [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {4}, {42} [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {3}, {42} [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {2}, {42} [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {1}, {42} [eva] tests/value/partitioning-annots.c:115: Frama_C_show_each: {0}, {42} [eva] tests/value/partitioning-annots.c:116: assertion got status valid. [eva] tests/value/partitioning-annots.c:119: Frama_C_show_each: {{ "Value 42 not found" }} [eva] Recording results for test_loop_split [eva] done for function test_loop_split [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test_loop_split: Frama_C_entropy_source ∈ [--..--] A[0] ∈ [0..100] [1..9] ∈ [0..100] or UNINITIALIZED i ∈ [0..10] [from] Computing for function test_loop_split [from] Computing for function Frama_C_interval <-test_loop_split [from] Done for function Frama_C_interval [from] Done for function test_loop_split [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function test_loop_split: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function test_loop_split: Frama_C_entropy_source; A[0..9]; i [inout] Inputs for function test_loop_split: Frama_C_entropy_source frama-c-20.0-Calcium/tests/value/oracle/partitioning-annots.4.res.oracle0000666000000000000000000000334313571573400023071 0ustar [kernel] Parsing tests/value/partitioning-annots.c (with preprocessing) [eva] Analyzing a complete application starting at test_history [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} [eva] computing for function Frama_C_interval <- test_history. Called from tests/value/partitioning-annots.c:125. [eva] using specification for function Frama_C_interval [eva] tests/value/partitioning-annots.c:125: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/partitioning-annots.c:131: Frama_C_show_each: {0; 1}, {0; 1} [eva:alarm] tests/value/partitioning-annots.c:134: Warning: division by zero. assert j ≢ 0; [eva] Recording results for test_history [eva] done for function test_history [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test_history: Frama_C_entropy_source ∈ [--..--] i ∈ {0; 1} j ∈ {0; 1} k_0 ∈ {1} [from] Computing for function test_history [from] Computing for function Frama_C_interval <-test_history [from] Done for function Frama_C_interval [from] Done for function test_history [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function test_history: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function test_history: Frama_C_entropy_source; i; j; k_0 [inout] Inputs for function test_history: Frama_C_entropy_source frama-c-20.0-Calcium/tests/value/oracle/partitioning-annots.5.res.oracle0000666000000000000000000000330513571573400023070 0ustar [kernel] Parsing tests/value/partitioning-annots.c (with preprocessing) [eva] Analyzing a complete application starting at test_history [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization k ∈ {0} [eva] computing for function Frama_C_interval <- test_history. Called from tests/value/partitioning-annots.c:125. [eva] using specification for function Frama_C_interval [eva] tests/value/partitioning-annots.c:125: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/partitioning-annots.c:131: Frama_C_show_each: {0}, {0} [eva] tests/value/partitioning-annots.c:131: Frama_C_show_each: {1}, {1} [eva] Recording results for test_history [eva] done for function test_history [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function test_history: Frama_C_entropy_source ∈ [--..--] i ∈ {0; 1} j ∈ {0; 1} k_0 ∈ {1} [from] Computing for function test_history [from] Computing for function Frama_C_interval <-test_history [from] Done for function Frama_C_interval [from] Done for function test_history [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function test_history: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function test_history: Frama_C_entropy_source; i; j; k_0 [inout] Inputs for function test_history: Frama_C_entropy_source frama-c-20.0-Calcium/tests/value/oracle/pb.res.oracle0000666000000000000000000000237113571573400017321 0ustar [kernel] Parsing tests/value/pb.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/value/pb.i:2: Warning: Calling undeclared function f. Old style K&R code? [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/pb.i:2. [kernel:annot:missing-spec] tests/value/pb.i:2: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/period.res.oracle0000666000000000000000000001047513571573400020206 0ustar [kernel] Parsing tests/value/period.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g[0..9] ∈ {0} Frama_C_periodic_t_320[0] ∈ {1} [1..59] ∈ {0} u[0] ∈ {-1} [1] ∈ {-2} [2] ∈ {-3} [3..59] ∈ {0} v[0] ∈ {-1} [1] ∈ {-2} [2] ∈ {-3} w[0..9] ∈ {0} Au ∈ {0} Bu ∈ {0} Cu ∈ {0} Du ∈ {0} Eu ∈ {0} Fu ∈ {0} Gu ∈ {12} Hu ∈ {0} At ∈ {0} Bt ∈ {0} Ct ∈ {0} Dt ∈ {0} Et ∈ {0} Ft ∈ {0} Gt ∈ {12} Ht ∈ {0} [eva] tests/value/period.c:49: Frama_C_dump_each: # Cvalue domain: g[0..9] ∈ {0} Frama_C_periodic_t_320[0] ∈ {1} [1..3] ∈ {0} [4] ∈ {24} [5..12] ∈ {0} [13] ∈ {2} [14..40] ∈ {0} [41] ∈ {6} [42..59] ∈ {0} u[0] ∈ {-1} [1] ∈ {-2} [2] ∈ {-3} [3] ∈ {0} [4] ∈ {24} [5..12] ∈ {0} [13] ∈ {2} [14..40] ∈ {0} [41] ∈ {6} [42..59] ∈ {0} v[0] ∈ {-1} [1] ∈ {1} [2] ∈ {-3} w[0].s1 ∈ {1} {[0]{.s2; .s3}; [1].s1} ∈ {0} [1].s2 ∈ {2} {[1].s3; [2]{.s1; .s2}} ∈ {0} [2].s3 ∈ {3} [3..9] ∈ {0} Au ∈ {-1} Bu ∈ {0} Cu ∈ {-3} Du ∈ {0} Eu ∈ {0} Fu ∈ {2} Gu ∈ {12} Hu ∈ {1} At ∈ {1} Bt ∈ {0} Ct ∈ {0} Dt ∈ {0} Et ∈ {0} Ft ∈ {2} Gt ∈ {12} Ht ∈ {1} ==END OF DUMP== [eva] tests/value/period.c:51: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/period.c:51} [eva:alarm] tests/value/period.c:52: Warning: out of bounds write. assert \valid(p); [eva] tests/value/period.c:53: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/period.c:53} [eva:alarm] tests/value/period.c:54: Warning: out of bounds read. assert \valid_read(p); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: g[0..9] ∈ {{ garbled mix of &{vg} (origin: Misaligned {tests/value/period.c:55}) }} Frama_C_periodic_t_320[0] ∈ {1} [1..3] ∈ {0} [4] ∈ {24} [5..12] ∈ {0} [13] ∈ {2} [14..40] ∈ {0} [41] ∈ {6} [42..59] ∈ {0} u[0] ∈ {-1} [1] ∈ {-2} [2] ∈ {-3} [3] ∈ {0} [4] ∈ {24} [5..12] ∈ {0} [13] ∈ {2} [14..40] ∈ {0} [41] ∈ {6} [42..59] ∈ {0} v[0] ∈ {-1} [1] ∈ {1} [2] ∈ {-3} w[0].s1 ∈ {1} {[0]{.s2; .s3}; [1].s1} ∈ {0} [1].s2 ∈ {2} {[1].s3; [2]{.s1; .s2}} ∈ {0} [2].s3 ∈ {3} [3..9] ∈ {0} Au ∈ {-1} Bu ∈ {0} Cu ∈ {-3} Eu ∈ {0} Fu ∈ {2} Hu ∈ {1} At ∈ {1} Bt ∈ {0} Ct ∈ {0} Et ∈ {0} Ft ∈ {2} Ht ∈ {1} p ∈ {{ &g + [0..36] }} vg ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: g[0..9] FROM \nothing (and SELF) Frama_C_periodic_t_320[4] FROM Gt {[13]; [41]} FROM Frama_C_periodic_t_320[20] u[4] FROM Gu {[13]; [41]} FROM u[22] v[1] FROM \nothing w{[0].s1; [1].s2; [2].s3} FROM \nothing Au FROM u[0] Bu FROM u[11] Cu FROM u[2] Eu FROM u[12] Fu FROM u[22] Hu FROM u[25] At FROM Frama_C_periodic_t_320[0] Bt FROM Frama_C_periodic_t_320[11] Ct FROM Frama_C_periodic_t_320[2] Et FROM Frama_C_periodic_t_320[12] Ft FROM Frama_C_periodic_t_320[20] Ht FROM Frama_C_periodic_t_320[25] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: g[0..9]; Frama_C_periodic_t_320{[4]; [13]; [41]}; u{[4]; [13]; [41]}; v[1]; w{[0].s1; [1].s2; [2].s3}; Au; Bu; Cu; Eu; Fu; Hu; At; Bt; Ct; Et; Ft; Ht; p; vg [inout] Inputs for function main: g[0..9]; Frama_C_periodic_t_320{[0]; [2]; [11..12]; [20]; [25]}; u{[0]; [2]; [11..12]; [22]; [25]}; w{[0].s1; [1].s2}; Fu; Gu; Ft; Gt frama-c-20.0-Calcium/tests/value/oracle/plevel.res.oracle0000666000000000000000000001045513571573400020211 0ustar [kernel] Parsing tests/value/plevel.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..0xFFFE] ∈ {0} i ∈ [--..--] [eva:alarm] tests/value/plevel.i:11: Warning: assertion got status unknown. [eva:alarm] tests/value/plevel.i:13: Warning: assertion got status unknown. [kernel] tests/value/plevel.i:21: more than 40(65) locations to update in array. Approximating. [eva] Recording results for main [kernel] tests/value/plevel.i:21: more than 40(65) elements to enumerate. Approximating. [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0..0xFF] ∈ {0} [0x100..0x120] ∈ {0; 1} [0x121..0x1FF] ∈ {0} [0x200..0x240] ∈ {0; 2} [0x241..0x2FF] ∈ {0} [0x300] ∈ {0; 3} [0x301] ∈ {0} [0x302] ∈ {0; 3} [0x303] ∈ {0} [0x304] ∈ {0; 3} [0x305] ∈ {0} [0x306] ∈ {0; 3} [0x307] ∈ {0} [0x308] ∈ {0; 3} [0x309] ∈ {0} [0x30A] ∈ {0; 3} [0x30B] ∈ {0} [0x30C] ∈ {0; 3} [0x30D] ∈ {0} [0x30E] ∈ {0; 3} [0x30F] ∈ {0} [0x310] ∈ {0; 3} [0x311] ∈ {0} [0x312] ∈ {0; 3} [0x313] ∈ {0} [0x314] ∈ {0; 3} [0x315] ∈ {0} [0x316] ∈ {0; 3} [0x317] ∈ {0} [0x318] ∈ {0; 3} [0x319] ∈ {0} [0x31A] ∈ {0; 3} [0x31B] ∈ {0} [0x31C] ∈ {0; 3} [0x31D] ∈ {0} [0x31E] ∈ {0; 3} [0x31F] ∈ {0} [0x320] ∈ {0; 3} [0x321] ∈ {0} [0x322] ∈ {0; 3} [0x323] ∈ {0} [0x324] ∈ {0; 3} [0x325] ∈ {0} [0x326] ∈ {0; 3} [0x327] ∈ {0} [0x328] ∈ {0; 3} [0x329] ∈ {0} [0x32A] ∈ {0; 3} [0x32B] ∈ {0} [0x32C] ∈ {0; 3} [0x32D] ∈ {0} [0x32E] ∈ {0; 3} [0x32F] ∈ {0} [0x330] ∈ {0; 3} [0x331] ∈ {0} [0x332] ∈ {0; 3} [0x333] ∈ {0} [0x334] ∈ {0; 3} [0x335] ∈ {0} [0x336] ∈ {0; 3} [0x337] ∈ {0} [0x338] ∈ {0; 3} [0x339] ∈ {0} [0x33A] ∈ {0; 3} [0x33B] ∈ {0} [0x33C] ∈ {0; 3} [0x33D] ∈ {0} [0x33E] ∈ {0; 3} [0x33F] ∈ {0} [0x340] ∈ {0; 3} [0x341..0x3FF] ∈ {0} [0x400..0x480] ∈ {0; 4} [0x481..0x4FF] ∈ {0} [0x500][bits 0 to 15]# ∈ {0; 0x5555}%32, bits 0 to 15 {[0x500][bits 16 to 31]; [0x501..0x520]} ∈ [--..--] [0x521][bits 0 to 15]# ∈ {0; 0x5656}%32, bits 16 to 31 {[0x521][bits 16 to 31]; [0x522..0x5FF]} ∈ {0} [0x600][bits 0 to 15]# ∈ {0; 0x6666}%32, bits 0 to 15 {[0x600][bits 16 to 31]; [0x601..0x640]} ∈ [--..--] [0x641][bits 0 to 15]# ∈ {0; 0x6767}%32, bits 16 to 31 {[0x641][bits 16 to 31]; [0x642..0x6FF]} ∈ {0} [0x700..0x708] ∈ [--..--] [0x709..0x7FF] ∈ {0} [0x800..0x810] ∈ [--..--] [0x811..0xFFFE] ∈ {0} i1 ∈ [0..32] i2 ∈ [0..64] p ∈ {{ &t + [0x2000..0x2040] }} [from] Computing for function main [kernel] tests/value/plevel.i:21: more than 40(65) dependencies to update. Approximating. [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t{[0x100..0x120]; [0x200..0x240]; [0x300]; [0x302]; [0x304]; [0x306]; [0x308]; [0x30A]; [0x30C]; [0x30E]; [0x310]; [0x312]; [0x314]; [0x316]; [0x318]; [0x31A]; [0x31C]; [0x31E]; [0x320]; [0x322]; [0x324]; [0x326]; [0x328]; [0x32A]; [0x32C]; [0x32E]; [0x330]; [0x332]; [0x334]; [0x336]; [0x338]; [0x33A]; [0x33C]; [0x33E]; [0x340]; [0x400..0x480]; {[0x500..0x520]; [0x521][bits 0 to 15]}; {[0x600..0x640]; [0x641][bits 0 to 15]}; [0x700..0x708]; [0x800..0x810]} FROM i (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t{[0x100..0x120]; [0x200..0x240]; [0x300]; [0x302]; [0x304]; [0x306]; [0x308]; [0x30A]; [0x30C]; [0x30E]; [0x310]; [0x312]; [0x314]; [0x316]; [0x318]; [0x31A]; [0x31C]; [0x31E]; [0x320]; [0x322]; [0x324]; [0x326]; [0x328]; [0x32A]; [0x32C]; [0x32E]; [0x330]; [0x332]; [0x334]; [0x336]; [0x338]; [0x33A]; [0x33C]; [0x33E]; [0x340]; [0x400..0x480]; {[0x500..0x520]; [0x521][bits 0 to 15]}; {[0x600..0x640]; [0x641][bits 0 to 15]}; [0x700..0x708]; [0x800..0x810]}; i1; i2; p [inout] Inputs for function main: i frama-c-20.0-Calcium/tests/value/oracle/pointer.res.oracle0000666000000000000000000000451513571573400020402 0ustar [kernel] Parsing tests/value/pointer.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} c ∈ {0} p ∈ {0} q ∈ {0} T[0..9] ∈ {0} cc1 ∈ {0} cc2 ∈ {0} [eva] computing for function k <- main. Called from tests/value/pointer.i:37. [eva] computing for function l <- k <- main. Called from tests/value/pointer.i:29. [eva] Recording results for l [eva] Done for function l [eva] Recording results for k [eva] Done for function k [eva] computing for function k <- main. Called from tests/value/pointer.i:38. [eva] computing for function l <- k <- main. Called from tests/value/pointer.i:29. [eva] Recording results for l [eva] Done for function l [eva] Recording results for k [eva] Done for function k [eva:alarm] tests/value/pointer.i:40: Warning: pointer comparison. assert \pointer_comparable((void *)((int *)T - 1), (void *)((int *)T)); [eva:alarm] tests/value/pointer.i:41: Warning: pointer comparison. assert \pointer_comparable((void *)((int *)T), (void *)(&T[12])); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function l: x ∈ {19} c ∈ {19} [eva:final-states] Values at end of function k: x ∈ {19} c ∈ {19} [eva:final-states] Values at end of function main: x ∈ {19} c ∈ {19} cc1 ∈ {1; 99} cc2 ∈ {1; 99} [from] Computing for function l [from] Done for function l [from] Computing for function k [from] Done for function k [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function l: x FROM x; y_0 (and SELF) c FROM x; y_0 (and SELF) [from] Function k: x FROM x; x_0 (and SELF) c FROM x; x_0 (and SELF) [from] Function main: x FROM \nothing c FROM \nothing cc1 FROM en cc2 FROM en [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function l: x; c [inout] Inputs for function l: x [inout] Out (internal) for function k: x; c [inout] Inputs for function k: x [inout] Out (internal) for function main: x; c; cc1; cc2 [inout] Inputs for function main: x; cc2 frama-c-20.0-Calcium/tests/value/oracle/pointer2.0.res.oracle0000666000000000000000000000221513571573400020615 0ustar [kernel] Parsing tests/value/pointer2.i (no preprocessing) [eva] Analyzing a complete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} q ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} [eva] computing for function f <- g. Called from tests/value/pointer2.i:14. [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function g: p ∈ {{ &x }} [from] Computing for function f [from] Done for function f [from] Computing for function g [from] Done for function g [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM r [from] Function g: p FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: \nothing [inout] Out (internal) for function g: p [inout] Inputs for function g: \nothing frama-c-20.0-Calcium/tests/value/oracle/pointer2.1.res.oracle0000666000000000000000000000221513571573400020616 0ustar [kernel] Parsing tests/value/pointer2.i (no preprocessing) [eva] Analyzing a complete application starting at h [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} q ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} [eva] computing for function f <- h. Called from tests/value/pointer2.i:18. [eva] Recording results for f [eva] Done for function f [eva] Recording results for h [eva] done for function h [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function h: q ∈ {{ &y }} [from] Computing for function f [from] Done for function f [from] Computing for function h [from] Done for function h [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM r [from] Function h: q FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: \nothing [inout] Out (internal) for function h: q [inout] Inputs for function h: \nothing frama-c-20.0-Calcium/tests/value/oracle/pointer3.res.oracle0000666000000000000000000000265613571573400020471 0ustar [kernel] Parsing tests/value/pointer3.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} c ∈ {0} p ∈ {0} q ∈ {0} [eva] computing for function f <- main. Called from tests/value/pointer3.i:11. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/pointer3.i:12. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: c ∈ {2} [eva:final-states] Values at end of function main: x ∈ {2} c ∈ {2} p ∈ {{ &x }} q ∈ {{ &y }} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: c FROM \nothing \result FROM x_0 [from] Function main: x FROM \nothing c FROM \nothing p FROM \nothing q FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: c [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: x; c; p; q [inout] Inputs for function main: c; p frama-c-20.0-Calcium/tests/value/oracle/pointer4.res.oracle0000666000000000000000000000210713571573400020461 0ustar [kernel] Parsing tests/value/pointer4.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 0 to 63] ∈ [--..--] d ∈ {0} e[0..9] ∈ {0} c ∈ {0} [eva] tests/value/pointer4.i:12: starting to merge loop iterations [eva:alarm] tests/value/pointer4.i:15: Warning: out of bounds write. assert \valid((int *)0x0 + c); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: NULL[0..7]; d; e[0]; c [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/value/oracle/pointer_arg.res.oracle0000666000000000000000000000446613571573400021240 0ustar [kernel] Parsing tests/value/pointer_arg.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:alarm] tests/value/pointer_arg.i:4: Warning: out of bounds write. assert \valid(arg + 0); [eva:alarm] tests/value/pointer_arg.i:5: Warning: out of bounds write. assert \valid(arg + 1); [eva:alarm] tests/value/pointer_arg.i:6: Warning: out of bounds write. assert \valid(arg + 2); [kernel] tests/value/pointer_arg.i:6: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/value/pointer_arg.i:7: Warning: out of bounds write. assert \valid(arg + 1000); [kernel] tests/value/pointer_arg.i:7: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/value/pointer_arg.i:8: Warning: out of bounds write. assert \valid(arg + argc); [eva:alarm] tests/value/pointer_arg.i:11: Warning: out of bounds write. assert \valid(argv + 1); [eva:alarm] tests/value/pointer_arg.i:15: Warning: out of bounds read. assert \valid_read(argv + 0); [eva:alarm] tests/value/pointer_arg.i:15: Warning: out of bounds write. assert \valid(*(argv + 0) + 0); [eva] Recording results for main [eva] done for function main [eva] tests/value/pointer_arg.i:6: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/pointer_arg.i:7: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __retres ∈ {0} S_argv[0] ∈ {{ &S_0_S_argv[0] }} [1] ∈ {{ NULL ; &S_1_S_argv[0] ; "5069" }} S_0_S_argv[0] ∈ {48} [1] ∈ [--..--] S_arg[0] ∈ {0; 4} [1] ∈ {1; 4} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: S_argv[0..1] FROM v; argv (and SELF) S_0_S_argv[0] FROM v; argv; S_argv[0] S_arg[0..1] FROM arg; argc \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: __retres; S_argv[0..1]; S_0_S_argv[0]; S_arg[0..1] [inout] Inputs for function main: v; S_argv[0] frama-c-20.0-Calcium/tests/value/oracle/pointer_comp.res.oracle0000666000000000000000000001041613571573400021415 0ustar [kernel] Parsing tests/value/pointer_comp.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] str1[0] ∈ {97} [1] ∈ {98} [2] ∈ {115} [3] ∈ {100} [4] ∈ {0} str2[0] ∈ {97} [1] ∈ {98} [2..3] ∈ {100} [4] ∈ {0} s1 ∈ {0} s2[0..7] ∈ {0} [eva:alarm] tests/value/pointer_comp.c:37: Warning: pointer comparison. assert \pointer_comparable((void *)(&s2[9]), (void *)0); [eva:alarm] tests/value/pointer_comp.c:38: Warning: pointer comparison. assert \pointer_comparable((void *)(&s2[9]), (void *)(&s2[9])); [eva:alarm] tests/value/pointer_comp.c:41: Warning: pointer comparison. assert \pointer_comparable((void *)(&str1), (void *)(&str2)); [eva:alarm] tests/value/pointer_comp.c:42: Warning: pointer comparison. assert \pointer_comparable((void *)(&s1), (void *)(&s2)); [eva:alarm] tests/value/pointer_comp.c:43: Warning: pointer comparison. assert \pointer_comparable((void (*)())(&f), (void (*)())(&g)); [eva:alarm] tests/value/pointer_comp.c:46: Warning: pointer comparison. assert \pointer_comparable((void *)(&s1), (void *)0); [eva:alarm] tests/value/pointer_comp.c:47: Warning: pointer comparison. assert \pointer_comparable((void *)(&s1 + 1), (void *)0); [eva:alarm] tests/value/pointer_comp.c:48: Warning: pointer comparison. assert \pointer_comparable((void *)(&s2[8]), (void *)0); [eva:alarm] tests/value/pointer_comp.c:50: Warning: pointer comparison. assert \pointer_comparable((void (*)())(&f), (void (*)())0); [eva:alarm] tests/value/pointer_comp.c:51: Warning: pointer comparison. assert \pointer_comparable((void (*)())p, (void (*)())0); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {0; 1} p ∈ {{ &f ; &g }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; p; tmp [inout] Inputs for function main: v /* Generated by Frama-C */ struct s { int x ; }; extern int v; char str1[5] = {(char)'a', (char)'b', (char)'s', (char)'d', (char)'\000'}; char str2[5] = {(char)'a', (char)'b', (char)'d', (char)'d', (char)'\000'}; struct s s1; struct s s2[8]; void f(void); void g(void); void main(void) { int i; void (*tmp)(void); if (v) tmp = & f; else tmp = & g; void (*p)(void) = tmp; i = & str1 == & str2; i = & s1 == (struct s *)0; i = & s1 + 1 == (struct s *)0; i = & s2[2] == & s2[4]; i = & s2[8] == (struct s *)0; i = & f == (void (*)(void))0; i = (void *)(& s1) == (void *)(& s2); i = & f == & g; i = p == (void (*)(void))0; i = & s2[2] < & s2[4]; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(&s2[9]), (void *)0); */ i = & s2[9] == (struct s *)0; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(&s2[9]), (void *)(&s2[9])); */ i = & s2[9] == & s2[9]; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(&str1), (void *)(&str2)); */ i = & str1 < & str2; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(&s1), (void *)(&s2)); */ i = (void *)(& s1) < (void *)(& s2); /*@ assert Eva: ptr_comparison: \pointer_comparable((void (*)())(&f), (void (*)())(&g)); */ i = & f < & g; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(&s1), (void *)0); */ i = & s1 > (struct s *)0; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(&s1 + 1), (void *)0); */ i = & s1 + 1 > (struct s *)0; /*@ assert Eva: ptr_comparison: \pointer_comparable((void *)(&s2[8]), (void *)0); */ i = & s2[8] > (struct s *)0; i = & f == (void (*)(void))0; /*@ assert Eva: ptr_comparison: \pointer_comparable((void (*)())(&f), (void (*)())0); */ i = & f > (void (*)(void))0; /*@ assert Eva: ptr_comparison: \pointer_comparable((void (*)())p, (void (*)())0); */ i = p > (void (*)(void))0; return; } frama-c-20.0-Calcium/tests/value/oracle/pointer_comparison.0.res.oracle0000666000000000000000000002444113571573400022772 0ustar [kernel] Parsing tests/value/pointer_comparison.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} p ∈ {0} [eva] tests/value/pointer_comparison.c:8: Frama_C_show_each_1t: {{ &x + {4} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:10: invalid pointer comparison: invalid pointer(s) [eva] tests/value/pointer_comparison.c:10: Frama_C_show_each_2: {{ &x + {8} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:12: invalid pointer comparison: invalid pointer(s) [eva] tests/value/pointer_comparison.c:12: Frama_C_show_each_3: {{ &x + {12} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:14: invalid pointer comparison: invalid pointer(s) [eva] tests/value/pointer_comparison.c:14: Frama_C_show_each_4: {{ &x + {16} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:16: invalid pointer comparison: invalid pointer(s) [eva] tests/value/pointer_comparison.c:16: Frama_C_show_each_5: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:17: Frama_C_show_each_5e: {{ &x + {16} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:18: invalid pointer comparison: invalid pointer(s) [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20} }} [eva] tests/value/pointer_comparison.c:18: starting to merge loop iterations [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24; 28} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + [20..--],0%4 }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; tmp; tmp_0; tmp_1; tmp_2; tmp_3 [inout] Inputs for function main: p [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} p ∈ {0} [eva] tests/value/pointer_comparison.c:8: Frama_C_show_each_1t: {{ &x + {4} }} [eva:alarm] tests/value/pointer_comparison.c:10: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_0, (void *)(&y)); (tmp_0 from p++) [eva] tests/value/pointer_comparison.c:10: Frama_C_show_each_2: {{ &x + {8} }} [eva:alarm] tests/value/pointer_comparison.c:12: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_1, (void *)(&y)); (tmp_1 from p++) [eva] tests/value/pointer_comparison.c:12: Frama_C_show_each_3: {{ &x + {12} }} [eva:alarm] tests/value/pointer_comparison.c:14: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_2, (void *)(&y)); (tmp_2 from p++) [eva] tests/value/pointer_comparison.c:14: Frama_C_show_each_4: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:16: Frama_C_show_each_5: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:17: Frama_C_show_each_5e: {{ &x + {16} }} [eva:alarm] tests/value/pointer_comparison.c:18: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_3, (void *)(&y)); (tmp_3 from p++) [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24; 28} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + [20..--],0%4 }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; tmp; tmp_0; tmp_1; tmp_2; tmp_3 [inout] Inputs for function main: p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 10) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_0, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 12) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_1, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 14) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_2, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 18) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_3, (void *)(&y)); tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 To be validated 4 Total -------------------------------------------------------------------------------- [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} p ∈ {0} [eva] tests/value/pointer_comparison.c:8: Frama_C_show_each_1t: {{ &x + {4} }} [eva:alarm] tests/value/pointer_comparison.c:10: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_0, (void *)(&y)); (tmp_0 from p++) [eva] tests/value/pointer_comparison.c:10: Frama_C_show_each_2: {{ &x + {8} }} [eva:alarm] tests/value/pointer_comparison.c:12: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_1, (void *)(&y)); (tmp_1 from p++) [eva] tests/value/pointer_comparison.c:12: Frama_C_show_each_3: {{ &x + {12} }} [eva:alarm] tests/value/pointer_comparison.c:14: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_2, (void *)(&y)); (tmp_2 from p++) [eva] tests/value/pointer_comparison.c:14: Frama_C_show_each_4: {{ &x + {16} }} [eva:alarm] tests/value/pointer_comparison.c:16: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)(&y)); [eva] tests/value/pointer_comparison.c:16: Frama_C_show_each_5: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:17: Frama_C_show_each_5e: {{ &x + {16} }} [eva:alarm] tests/value/pointer_comparison.c:18: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_3, (void *)(&y)); (tmp_3 from p++) [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24; 28} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + [20..--],0%4 }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; tmp; tmp_0; tmp_1; tmp_2; tmp_3 [inout] Inputs for function main: p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 10) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_0, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 12) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_1, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 14) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_2, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 16) assert Eva: ptr_comparison: \pointer_comparable((void *)p, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 18) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_3, (void *)(&y)); tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 To be validated 5 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/pointer_comparison.1.res.oracle0000666000000000000000000002773113571573400023000 0ustar [kernel] Parsing tests/value/pointer_comparison.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} p ∈ {0} [eva] tests/value/pointer_comparison.c:8: Frama_C_show_each_1t: {{ &x + {4} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:10: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/pointer_comparison.c:10: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva] tests/value/pointer_comparison.c:10: Frama_C_show_each_2: {{ &x + {8} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:10: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva] tests/value/pointer_comparison.c:11: Frama_C_show_each_2e: {{ &x + {8} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:12: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/pointer_comparison.c:12: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva] tests/value/pointer_comparison.c:12: Frama_C_show_each_3: {{ &x + {12} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:12: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva] tests/value/pointer_comparison.c:13: Frama_C_show_each_3e: {{ &x + {12} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:14: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/pointer_comparison.c:14: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva] tests/value/pointer_comparison.c:14: Frama_C_show_each_4: {{ &x + {16} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:14: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva] tests/value/pointer_comparison.c:15: Frama_C_show_each_4e: {{ &x + {16} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:16: invalid pointer comparison: invalid pointer(s) [eva] tests/value/pointer_comparison.c:16: Frama_C_show_each_5: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:17: Frama_C_show_each_5e: {{ &x + {16} }} [eva:pointer-comparison] tests/value/pointer_comparison.c:18: invalid pointer comparison: invalid pointer(s) [eva:pointer-comparison] tests/value/pointer_comparison.c:18: evaluating condition to {0; 1} instead of {0} because of UPCPA [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20} }} [eva] tests/value/pointer_comparison.c:18: starting to merge loop iterations [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24; 28} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + [20..--],0%4 }} [eva:pointer-comparison] tests/value/pointer_comparison.c:18: evaluating condition to {0; 1} instead of {1} because of UPCPA [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &x + [20..--],0%4 }} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; tmp; tmp_0; tmp_1; tmp_2; tmp_3; __retres [inout] Inputs for function main: p [report] Computing properties status... -------------------------------------------------------------------------------- --- No status to report -------------------------------------------------------------------------------- [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} p ∈ {0} [eva] tests/value/pointer_comparison.c:8: Frama_C_show_each_1t: {{ &x + {4} }} [eva:alarm] tests/value/pointer_comparison.c:10: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_0, (void *)(&y)); (tmp_0 from p++) [eva] tests/value/pointer_comparison.c:10: Frama_C_show_each_2: {{ &x + {8} }} [eva] tests/value/pointer_comparison.c:11: Frama_C_show_each_2e: {{ &x + {8} }} [eva:alarm] tests/value/pointer_comparison.c:12: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_1, (void *)(&y)); (tmp_1 from p++) [eva] tests/value/pointer_comparison.c:12: Frama_C_show_each_3: {{ &x + {12} }} [eva] tests/value/pointer_comparison.c:13: Frama_C_show_each_3e: {{ &x + {12} }} [eva:alarm] tests/value/pointer_comparison.c:14: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_2, (void *)(&y)); (tmp_2 from p++) [eva] tests/value/pointer_comparison.c:14: Frama_C_show_each_4: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:15: Frama_C_show_each_4e: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:16: Frama_C_show_each_5: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:17: Frama_C_show_each_5e: {{ &x + {16} }} [eva:alarm] tests/value/pointer_comparison.c:18: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_3, (void *)(&y)); (tmp_3 from p++) [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24; 28} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + [20..--],0%4 }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &x + [20..--],0%4 }} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; tmp; tmp_0; tmp_1; tmp_2; tmp_3; __retres [inout] Inputs for function main: p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 10) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_0, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 12) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_1, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 14) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_2, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 18) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_3, (void *)(&y)); tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 To be validated 4 Total -------------------------------------------------------------------------------- [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} p ∈ {0} [eva] tests/value/pointer_comparison.c:8: Frama_C_show_each_1t: {{ &x + {4} }} [eva:alarm] tests/value/pointer_comparison.c:10: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_0, (void *)(&y)); (tmp_0 from p++) [eva] tests/value/pointer_comparison.c:10: Frama_C_show_each_2: {{ &x + {8} }} [eva] tests/value/pointer_comparison.c:11: Frama_C_show_each_2e: {{ &x + {8} }} [eva:alarm] tests/value/pointer_comparison.c:12: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_1, (void *)(&y)); (tmp_1 from p++) [eva] tests/value/pointer_comparison.c:12: Frama_C_show_each_3: {{ &x + {12} }} [eva] tests/value/pointer_comparison.c:13: Frama_C_show_each_3e: {{ &x + {12} }} [eva:alarm] tests/value/pointer_comparison.c:14: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_2, (void *)(&y)); (tmp_2 from p++) [eva] tests/value/pointer_comparison.c:14: Frama_C_show_each_4: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:15: Frama_C_show_each_4e: {{ &x + {16} }} [eva:alarm] tests/value/pointer_comparison.c:16: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)(&y)); [eva] tests/value/pointer_comparison.c:16: Frama_C_show_each_5: {{ &x + {16} }} [eva] tests/value/pointer_comparison.c:17: Frama_C_show_each_5e: {{ &x + {16} }} [eva:alarm] tests/value/pointer_comparison.c:18: Warning: pointer comparison. assert \pointer_comparable((void *)tmp_3, (void *)(&y)); (tmp_3 from p++) [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + {20; 24; 28} }} [eva] tests/value/pointer_comparison.c:18: Frama_C_show_each_6: {{ &x + [20..--],0%4 }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &x + [20..--],0%4 }} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; tmp; tmp_0; tmp_1; tmp_2; tmp_3; __retres [inout] Inputs for function main: p [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 10) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_0, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 12) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_1, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 14) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_2, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 16) assert Eva: ptr_comparison: \pointer_comparable((void *)p, (void *)(&y)); tried with Eva. [ - ] Assertion 'Eva,ptr_comparison' (file tests/value/pointer_comparison.c, line 18) assert Eva: ptr_comparison: \pointer_comparable((void *)tmp_3, (void *)(&y)); tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 To be validated 5 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/pointer_int_cast.res.oracle0000666000000000000000000000170113571573400022260 0ustar [kernel] Parsing tests/value/pointer_int_cast.i (no preprocessing) [kernel:typing:int-conversion] tests/value/pointer_int_cast.i:9: Warning: Conversion from a pointer to an integer without an explicit cast [eva] Analyzing a complete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization q ∈ {0} x ∈ {0} y ∈ {0} [eva] Recording results for g [eva] done for function g [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: q ∈ {{ &y }} y ∈ {0} i ∈ {{ (int)&y }} [from] Computing for function g [from] Done for function g [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: q FROM y y FROM x; y [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function g: q; y; i [inout] Inputs for function g: q; x; y frama-c-20.0-Calcium/tests/value/oracle/pointer_loop.res.oracle0000666000000000000000000000251313571573400021427 0ustar [kernel] Parsing tests/value/pointer_loop.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization base0 ∈ {7} base1 ∈ {1} base2 ∈ {2} base_p[0] ∈ {{ &base1 }} [1] ∈ {{ &base2 }} Ctrl_p ∈ {0} Ctrl[0..1] ∈ {0} Slot[0].Elements ∈ {2} [0].Ctrl_p ∈ {{ &ACtrl[0] }} [1] ∈ {0} ACtrl[0] ∈ {{ &Ctrl[0] }} [1] ∈ {{ &Ctrl[1] }} [eva] tests/value/pointer_loop.i:13: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: base1 ∈ {1; 3; 4} base2 ∈ {2; 3; 4} Ctrl_p ∈ {{ NULL ; &base1 ; &base2 }} i ∈ {2} Elements ∈ {2} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: base1 FROM base_p[0..1] (and SELF) base2 FROM base_p[0..1] (and SELF) Ctrl_p FROM base_p[0..1] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: base1; base2; Ctrl_p; i; Elements [inout] Inputs for function main: base_p[0..1]; Ctrl_p frama-c-20.0-Calcium/tests/value/oracle/postcond_leaf.res.oracle0000666000000000000000000002143713571573400021544 0ustar [kernel] Parsing tests/value/postcond_leaf.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ [--..--] j ∈ [--..--] [kernel] tests/value/postcond_leaf.c:109: Warning: No code nor implicit assigns clause for function f1, generating default assigns from the prototype [eva] using specification for function f1 [eva] tests/value/postcond_leaf.c:21: Warning: function f1: this postcondition evaluates to false in this context. If it is valid, either a precondition was not verified for this call, or some assigns/from clauses are incomplete (or incorrect). [eva] using specification for function f2 [eva] tests/value/postcond_leaf.c:28: Warning: function f2, behavior b: this postcondition evaluates to false in this context. If it is valid, either a precondition was not verified for this call, or some assigns/from clauses are incomplete (or incorrect). [eva] using specification for function f3 [eva] using specification for function f4 [eva] using specification for function g1 [eva] tests/value/postcond_leaf.c:46: Warning: function g1: this postcondition evaluates to false in this context. If it is valid, either a precondition was not verified for this call, or some assigns/from clauses are incomplete (or incorrect). [eva] using specification for function g2 [eva] tests/value/postcond_leaf.c:55: Warning: function g2, behavior b: this postcondition evaluates to false in this context. If it is valid, either a precondition was not verified for this call, or some assigns/from clauses are incomplete (or incorrect). [eva] using specification for function g3 [eva:alarm] tests/value/postcond_leaf.c:69: Warning: function h1: postcondition got status invalid. [eva:alarm] tests/value/postcond_leaf.c:78: Warning: function h2, behavior b: postcondition got status invalid. (Behavior may be inactive, no reduction performed.) [eva:alarm] tests/value/postcond_leaf.c:85: Warning: function h3: postcondition got status unknown. [eva:alarm] tests/value/postcond_leaf.c:92: Warning: function h4: postcondition got status invalid. [eva] using specification for function k [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function h1: [eva:final-states] Values at end of function h2: [eva:final-states] Values at end of function h3: [eva:final-states] Values at end of function h4: [eva:final-states] Values at end of function main: i ∈ [--..--] [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f1' -------------------------------------------------------------------------------- [ Extern ] Post-condition (file tests/value/postcond_leaf.c, line 21) Unverifiable but considered Valid. [ - ] Assigns nothing tried with Inferred annotations. [ - ] Default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ Extern ] Post-condition for 'b' (file tests/value/postcond_leaf.c, line 28) Unverifiable but considered Valid. [ Extern ] Assigns (file tests/value/postcond_leaf.c, line 25) Unverifiable but considered Valid. [ Extern ] Froms (file tests/value/postcond_leaf.c, line 25) Unverifiable but considered Valid. [ Valid ] Behavior 'b' by Frama-C kernel. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f3' -------------------------------------------------------------------------------- [ Extern ] Post-condition (file tests/value/postcond_leaf.c, line 34) Unverifiable but considered Valid. [ Extern ] Assigns (file tests/value/postcond_leaf.c, line 33) Unverifiable but considered Valid. [ Extern ] Froms (file tests/value/postcond_leaf.c, line 33) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'f4' -------------------------------------------------------------------------------- [ Extern ] Post-condition (file tests/value/postcond_leaf.c, line 40) Unverifiable but considered Valid. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g1' -------------------------------------------------------------------------------- [ Alarm ] Post-condition (file tests/value/postcond_leaf.c, line 46) By Eva, with pending: - Unreachable g1 [ Alarm ] Default behavior By Frama-C kernel, with pending: - Assigns (file tests/value/postcond_leaf.c, line 45) - Froms (file tests/value/postcond_leaf.c, line 45) - Unreachable g1 -------------------------------------------------------------------------------- --- Properties of Function 'g2' -------------------------------------------------------------------------------- [ Alarm ] Post-condition for 'b' (file tests/value/postcond_leaf.c, line 55) By Eva, with pending: - Unreachable g2 [ Alarm ] Behavior 'b' By Frama-C kernel, with pending: - Unreachable g2 -------------------------------------------------------------------------------- --- Properties of Function 'g3' -------------------------------------------------------------------------------- [ - ] Post-condition (file tests/value/postcond_leaf.c, line 62) tried with Eva. [ - ] Default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h1' -------------------------------------------------------------------------------- [ Alarm ] Post-condition (file tests/value/postcond_leaf.c, line 69) By Eva, with pending: - Unreachable h1 [ Alarm ] Default behavior By Frama-C kernel, with pending: - Assigns nothing - Unreachable h1 -------------------------------------------------------------------------------- --- Properties of Function 'h2' -------------------------------------------------------------------------------- [ Alarm ] Post-condition for 'b' (file tests/value/postcond_leaf.c, line 78) By Eva, with pending: - Unreachable h2 [ Alarm ] Behavior 'b' By Frama-C kernel, with pending: - Unreachable h2 -------------------------------------------------------------------------------- --- Properties of Function 'h3' -------------------------------------------------------------------------------- [ - ] Post-condition (file tests/value/postcond_leaf.c, line 85) tried with Eva. [ - ] Default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'h4' -------------------------------------------------------------------------------- [ Alarm ] Post-condition (file tests/value/postcond_leaf.c, line 92) By Eva, with pending: - Unreachable h4 [ Alarm ] Default behavior By Frama-C kernel, with pending: - Assigns nothing - Unreachable h4 -------------------------------------------------------------------------------- --- Properties of Function 'k' -------------------------------------------------------------------------------- [ Extern ] Post-condition (file tests/value/postcond_leaf.c, line 101) Unverifiable but considered Valid. [ Extern ] Assigns (file tests/value/postcond_leaf.c, line 99) Unverifiable but considered Valid. [ Extern ] Froms (file tests/value/postcond_leaf.c, line 99) Unverifiable but considered Valid. [ Extern ] Froms (file tests/value/postcond_leaf.c, line 100) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 Completely validated 13 Considered valid 6 To be validated 10 Alarms emitted 34 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/postcondition.res.oracle0000666000000000000000000002263513571573400021621 0ustar [kernel] Parsing tests/value/postcondition.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} A ∈ {0} B ∈ {0} C ∈ {0} D ∈ {0} E ∈ {0} EX ∈ {0} X ∈ {0} p ∈ {0} TAB[0..9] ∈ {0} [eva] computing for function get_index <- main. Called from tests/value/postcondition.i:84. [eva] tests/value/postcondition.i:84: function get_index: precondition got status valid. [eva] tests/value/postcondition.i:17: Frama_C_show_each_cmd: {1} [eva] computing for function u <- get_index <- main. Called from tests/value/postcondition.i:20. [kernel] tests/value/postcondition.i:20: Warning: No code nor implicit assigns clause for function u, generating default assigns from the prototype [eva] using specification for function u [eva] Done for function u [eva] tests/value/postcondition.i:18: starting to merge loop iterations [eva] computing for function u <- get_index <- main. Called from tests/value/postcondition.i:20. [eva] Done for function u [eva] computing for function u <- get_index <- main. Called from tests/value/postcondition.i:20. [eva] Done for function u [eva] computing for function u <- get_index <- main. Called from tests/value/postcondition.i:20. [eva] Done for function u [eva:alarm] tests/value/postcondition.i:12: Warning: function get_index: postcondition got status unknown. [eva] tests/value/postcondition.i:12: function get_index: postcondition got status valid. [eva] Recording results for get_index [eva] Done for function get_index [eva] computing for function u <- main. Called from tests/value/postcondition.i:85. [eva] Done for function u [eva] computing for function bound <- main. Called from tests/value/postcondition.i:86. [eva:alarm] tests/value/postcondition.i:26: Warning: function bound: postcondition got status unknown. [eva] Recording results for bound [eva] Done for function bound [eva] computing for function u <- main. Called from tests/value/postcondition.i:87. [eva] Done for function u [eva] computing for function get_index <- main. Called from tests/value/postcondition.i:87. [eva:alarm] tests/value/postcondition.i:87: Warning: function get_index: precondition got status unknown. [eva] tests/value/postcondition.i:17: Frama_C_show_each_cmd: {4} [eva] computing for function u <- get_index <- main. Called from tests/value/postcondition.i:20. [eva] Done for function u [eva] computing for function u <- get_index <- main. Called from tests/value/postcondition.i:20. [eva] Done for function u [eva] computing for function u <- get_index <- main. Called from tests/value/postcondition.i:20. [eva] Done for function u [eva] computing for function u <- get_index <- main. Called from tests/value/postcondition.i:20. [eva] Done for function u [eva:alarm] tests/value/postcondition.i:12: Warning: function get_index: postcondition got status invalid. [eva] Recording results for get_index [eva] Done for function get_index [eva] computing for function u <- main. Called from tests/value/postcondition.i:88. [eva] Done for function u [eva] computing for function cap <- main. Called from tests/value/postcondition.i:89. [kernel] tests/value/postcondition.i:89: Warning: No code nor implicit assigns clause for function cap, generating default assigns from the prototype [eva] using specification for function cap [eva] Done for function cap [eva] computing for function u <- main. Called from tests/value/postcondition.i:90. [eva] Done for function u [eva] computing for function t0 <- main. Called from tests/value/postcondition.i:90. [eva] tests/value/postcondition.i:33: function t0: postcondition got status valid. [eva] Recording results for t0 [eva] Done for function t0 [eva] computing for function u <- main. Called from tests/value/postcondition.i:91. [eva] Done for function u [eva] computing for function t1 <- main. Called from tests/value/postcondition.i:91. [eva:alarm] tests/value/postcondition.i:38: Warning: function t1: postcondition got status invalid. [eva] Recording results for t1 [eva] Done for function t1 [eva] computing for function u <- main. Called from tests/value/postcondition.i:92. [eva] Done for function u [eva] computing for function t2 <- main. Called from tests/value/postcondition.i:92. [eva] tests/value/postcondition.i:45: function t2: postcondition got status valid. [eva] Recording results for t2 [eva] Done for function t2 [eva] computing for function u <- main. Called from tests/value/postcondition.i:93. [eva] Done for function u [eva] computing for function t3 <- main. Called from tests/value/postcondition.i:93. [eva] tests/value/postcondition.i:60: function t3: postcondition got status valid. [eva] Recording results for t3 [eva] Done for function t3 [eva] computing for function t4 <- main. Called from tests/value/postcondition.i:94. [eva] tests/value/postcondition.i:65: function t4: postcondition got status valid. [eva] Recording results for t4 [eva] Done for function t4 [eva] computing for function u <- main. Called from tests/value/postcondition.i:95. [eva] Done for function u [eva] computing for function t5 <- main. Called from tests/value/postcondition.i:95. [eva] tests/value/postcondition.i:71: function t5: postcondition got status valid. [eva] tests/value/postcondition.i:72: function t5: postcondition got status valid. [eva] Recording results for t5 [eva] Done for function t5 [eva] computing for function f <- main. Called from tests/value/postcondition.i:96. [eva] tests/value/postcondition.i:78: function f: postcondition got status valid. [eva:alarm] tests/value/postcondition.i:79: Warning: function f: postcondition got status invalid. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function bound: cmd ∈ {2} __retres ∈ {0} [eva:final-states] Values at end of function f: __retres ∈ {0} [eva:final-states] Values at end of function t0: G ∈ {6} [eva:final-states] Values at end of function t1: G ∈ {6} [eva:final-states] Values at end of function t2: G ∈ {6} p ∈ {{ &G }} [eva:final-states] Values at end of function t3: TAB[0].a ∈ {12} {[0]{.b; .c}; [1..9]} ∈ {0} [eva:final-states] Values at end of function t4: x ∈ {4} y ∈ {3} [eva:final-states] Values at end of function t5: x ∈ {9} [eva:final-states] Values at end of function get_index: ret ∈ [0..2147483647] __retres ∈ [0..2147483647] [eva:final-states] Values at end of function main: G ∈ {0; 6} B ∈ {0} C ∈ [0..299] D ∈ [-100..100] E ∈ [20..80] EX ∈ [-100..8] X ∈ {0; 8} p ∈ {{ NULL ; &G }} TAB[0].a ∈ {0; 12} {[0]{.b; .c}; [1..9]} ∈ {0} [from] Computing for function bound [from] Done for function bound [from] Computing for function f [from] Done for function f [from] Computing for function t0 [from] Done for function t0 [from] Computing for function t1 [from] Done for function t1 [from] Computing for function t2 [from] Done for function t2 [from] Computing for function t3 [from] Done for function t3 [from] Computing for function t4 [from] Done for function t4 [from] Computing for function t5 [from] Done for function t5 [from] Computing for function get_index [from] Computing for function u <-get_index [from] Done for function u [from] Done for function get_index [from] Computing for function main [from] Computing for function cap <-main [from] Done for function cap [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function bound: \result FROM \nothing [from] Function cap: \result FROM min; max [from] Function f: \result FROM \nothing [from] Function t0: G FROM \nothing [from] Function t1: G FROM \nothing [from] Function t2: G FROM \nothing p FROM \nothing [from] Function t3: TAB[0].a FROM \nothing [from] Function t4: NO EFFECTS [from] Function t5: \result FROM X [from] Function u: \result FROM \nothing [from] Function get_index: \result FROM cmd [from] Function main: G FROM \nothing (and SELF) B FROM \nothing C FROM \nothing D FROM \nothing E FROM \nothing EX FROM \nothing X FROM \nothing (and SELF) p FROM \nothing (and SELF) TAB[0].a FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function bound: cmd; __retres [inout] Inputs for function bound: \nothing [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function t0: G [inout] Inputs for function t0: \nothing [inout] Out (internal) for function t1: G [inout] Inputs for function t1: \nothing [inout] Out (internal) for function t2: G; p [inout] Inputs for function t2: p [inout] Out (internal) for function t3: TAB[0].a [inout] Inputs for function t3: \nothing [inout] Out (internal) for function t4: x; y [inout] Inputs for function t4: \nothing [inout] Out (internal) for function t5: x [inout] Inputs for function t5: X [inout] Out (internal) for function get_index: ret; tmp; __retres [inout] Inputs for function get_index: \nothing [inout] Out (internal) for function main: G; B; C; D; E; EX; X; p; TAB[0].a; tmp; tmp_0; tmp_1; tmp_2; tmp_3; tmp_4; tmp_5 [inout] Inputs for function main: B; X; p frama-c-20.0-Calcium/tests/value/oracle/pragma.res.oracle0000666000000000000000000000135313571573400020166 0ustar [kernel] Parsing tests/value/pragma.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/precise_locations.res.oracle0000666000000000000000000014234613571573400022434 0ustar [kernel] Parsing tests/value/precise_locations.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..49] ∈ {0} i ∈ {0} j ∈ {0} q ∈ {0} r ∈ {0} [eva] tests/value/precise_locations.i:29: starting to merge loop iterations [eva] tests/value/precise_locations.i:28: starting to merge loop iterations [eva] tests/value/precise_locations.i:33: Frama_C_dump_each: # Cvalue domain: t{[0..48]{.f1[0..4]; .f_inter[0..4]; .f2#; .f_inter2[0..4]; .[bits 328 to 351]#}; [49].f1[0..4]} ∈ {0; 10} repeated %32 [49]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} i ∈ {5} j ∈ {0; 50} q ∈ {0} r ∈ {0} v ∈ [--..--] __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] tests/value/precise_locations.i:34: starting to merge loop iterations [eva] computing for function ct <- main. Called from tests/value/precise_locations.i:39. [eva] Recording results for ct [eva] Done for function ct [eva] tests/value/precise_locations.i:38: starting to merge loop iterations [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:37: starting to merge loop iterations [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:42: Frama_C_dump_each: # Cvalue domain: t[0]{.f1[0..4]; .f_inter[0..4]} ∈ {0; 10; 20} [0].f2 ∈ [--..--] [bits 328 to 831]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [1].f2 ∈ [--..--] [bits 840 to 1343]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [2].f2 ∈ [--..--] [bits 1352 to 1855]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [3].f2 ∈ [--..--] [bits 1864 to 2367]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [4].f2 ∈ [--..--] [bits 2376 to 2879]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [5].f2 ∈ [--..--] [bits 2888 to 3391]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [6].f2 ∈ [--..--] [bits 3400 to 3903]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [7].f2 ∈ [--..--] [bits 3912 to 4415]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [8].f2 ∈ [--..--] [bits 4424 to 4927]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [9].f2 ∈ [--..--] [bits 4936 to 5439]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [10].f2 ∈ [--..--] [bits 5448 to 5951]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [11].f2 ∈ [--..--] [bits 5960 to 6463]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [12].f2 ∈ [--..--] [bits 6472 to 6975]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [13].f2 ∈ [--..--] [bits 6984 to 7487]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [14].f2 ∈ [--..--] [bits 7496 to 7999]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [15].f2 ∈ [--..--] [bits 8008 to 8511]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [16].f2 ∈ [--..--] [bits 8520 to 9023]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [17].f2 ∈ [--..--] [bits 9032 to 9535]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [18].f2 ∈ [--..--] [bits 9544 to 10047]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [19].f2 ∈ [--..--] [bits 10056 to 10559]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [20].f2 ∈ [--..--] [bits 10568 to 11071]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [21].f2 ∈ [--..--] [bits 11080 to 11583]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [22].f2 ∈ [--..--] [bits 11592 to 12095]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [23].f2 ∈ [--..--] [bits 12104 to 12607]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [24].f2 ∈ [--..--] [bits 12616 to 13119]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [25].f2 ∈ [--..--] [bits 13128 to 13631]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [26].f2 ∈ [--..--] [bits 13640 to 14143]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [27].f2 ∈ [--..--] [bits 14152 to 14655]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [28].f2 ∈ [--..--] [bits 14664 to 15167]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [29].f2 ∈ [--..--] [bits 15176 to 15679]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [30].f2 ∈ [--..--] [bits 15688 to 16191]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [31].f2 ∈ [--..--] [bits 16200 to 16703]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [32].f2 ∈ [--..--] [bits 16712 to 17215]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [33].f2 ∈ [--..--] [bits 17224 to 17727]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [34].f2 ∈ [--..--] [bits 17736 to 18239]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [35].f2 ∈ [--..--] [bits 18248 to 18751]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [36].f2 ∈ [--..--] [bits 18760 to 19263]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [37].f2 ∈ [--..--] [bits 19272 to 19775]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [38].f2 ∈ [--..--] [bits 19784 to 20287]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [39].f2 ∈ [--..--] [bits 20296 to 20799]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [40].f2 ∈ [--..--] [bits 20808 to 21311]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [41].f2 ∈ [--..--] [bits 21320 to 21823]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [42].f2 ∈ [--..--] [bits 21832 to 22335]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [43].f2 ∈ [--..--] [bits 22344 to 22847]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [44].f2 ∈ [--..--] [bits 22856 to 23359]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [45].f2 ∈ [--..--] [bits 23368 to 23871]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [46].f2 ∈ [--..--] [bits 23880 to 24383]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [47].f2 ∈ [--..--] [bits 24392 to 24895]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [48].f2 ∈ [--..--] [bits 24904 to 25247]# ∈ {0; 10; 20} repeated %32, bits 8 to 351 [49].f_inter[0..4] ∈ {0} [49].f2 ∈ {-99; 0} [49]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} i ∈ {5} j ∈ {50} q ∈ {0} r ∈ {0} v ∈ [--..--] __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] using specification for function f [eva] tests/value/precise_locations.i:48: function f: precondition got status valid. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] using specification for function g [eva] tests/value/precise_locations.i:49: function g: precondition got status valid. [eva] Done for function g [eva] tests/value/precise_locations.i:45: starting to merge loop iterations [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] tests/value/precise_locations.i:44: starting to merge loop iterations [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva:alarm] tests/value/precise_locations.i:48: Warning: function f: precondition got status unknown. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva:alarm] tests/value/precise_locations.i:49: Warning: function g: precondition got status unknown. [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function ct: __retres ∈ {20} [eva:final-states] Values at end of function main: t[0]{.f1[0..4]; .f_inter[0..4]} ∈ {0; 10; 20} [0].f2 ∈ [--..--] [bits 328 to 831]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [1].f2 ∈ [--..--] [bits 840 to 1343]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [2].f2 ∈ [--..--] [bits 1352 to 1855]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [3].f2 ∈ [--..--] [bits 1864 to 2367]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [4].f2 ∈ [--..--] [bits 2376 to 2879]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [5].f2 ∈ [--..--] [bits 2888 to 3391]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [6].f2 ∈ [--..--] [bits 3400 to 3903]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [7].f2 ∈ [--..--] [bits 3912 to 4415]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [8].f2 ∈ [--..--] [bits 4424 to 4927]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [9].f2 ∈ [--..--] [bits 4936 to 5439]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [10].f2 ∈ [--..--] [bits 5448 to 5951]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [11].f2 ∈ [--..--] [bits 5960 to 6463]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [12].f2 ∈ [--..--] [bits 6472 to 6975]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [13].f2 ∈ [--..--] [bits 6984 to 7487]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [14].f2 ∈ [--..--] [bits 7496 to 7999]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [15].f2 ∈ [--..--] [bits 8008 to 8511]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [16].f2 ∈ [--..--] [bits 8520 to 9023]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [17].f2 ∈ [--..--] [bits 9032 to 9535]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [18].f2 ∈ [--..--] [bits 9544 to 10047]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [19].f2 ∈ [--..--] [bits 10056 to 10559]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [20].f2 ∈ [--..--] [bits 10568 to 11071]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [21].f2 ∈ [--..--] [bits 11080 to 11583]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [22].f2 ∈ [--..--] [bits 11592 to 12095]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [23].f2 ∈ [--..--] [bits 12104 to 12607]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [24].f2 ∈ [--..--] [bits 12616 to 13119]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [25].f2 ∈ [--..--] [bits 13128 to 13631]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [26].f2 ∈ [--..--] [bits 13640 to 14143]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [27].f2 ∈ [--..--] [bits 14152 to 14655]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [28].f2 ∈ [--..--] [bits 14664 to 15167]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [29].f2 ∈ [--..--] [bits 15176 to 15679]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [30].f2 ∈ [--..--] [bits 15688 to 16191]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [31].f2 ∈ [--..--] [bits 16200 to 16703]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [32].f2 ∈ [--..--] [bits 16712 to 17215]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [33].f2 ∈ [--..--] [bits 17224 to 17727]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [34].f2 ∈ [--..--] [bits 17736 to 18239]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [35].f2 ∈ [--..--] [bits 18248 to 18751]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [36].f2 ∈ [--..--] [bits 18760 to 19263]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [37].f2 ∈ [--..--] [bits 19272 to 19775]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [38].f2 ∈ [--..--] [bits 19784 to 20287]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [39].f2 ∈ [--..--] [bits 20296 to 20799]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [40].f2 ∈ [--..--] [bits 20808 to 21311]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [41].f2 ∈ [--..--] [bits 21320 to 21823]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [42].f2 ∈ [--..--] [bits 21832 to 22335]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [43].f2 ∈ [--..--] [bits 22344 to 22847]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [44].f2 ∈ [--..--] [bits 22856 to 23359]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [45].f2 ∈ [--..--] [bits 23368 to 23871]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [46].f2 ∈ [--..--] [bits 23880 to 24383]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [47].f2 ∈ [--..--] [bits 24392 to 24895]# ∈ {0; 10; 20} repeated %32, bits 8 to 511 [48].f2 ∈ [--..--] [bits 24904 to 25247]# ∈ {0; 10; 20} repeated %32, bits 8 to 351 [49].f_inter[0..4] ∈ {0} [49].f2 ∈ {-99; 0} [49]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} i ∈ {5} j ∈ {50} q ∈ [0..255] r ∈ [0..256] __retres ∈ [0..511] [from] Computing for function ct [from] Done for function ct [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function ct: \result FROM \nothing [from] Function f: NO EFFECTS [from] Function g: NO EFFECTS [from] Function main: t{{[0..48]; [49].f1[0..4]}; [49].f2} FROM \nothing (and SELF) i FROM \nothing j FROM \nothing q FROM t{[0..48]; [49].f1[0..4]} (and SELF) r FROM t{[0..48]; [49].f1[0..4]} (and SELF) \result FROM t{[0..48]; [49].f1[0..4]}; q; r [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function ct: __retres [inout] Inputs for function ct: \nothing [inout] Out (internal) for function main: t{{[0..48]; [49].f1[0..4]}; [49].f2}; i; j; q; r; __retres [inout] Inputs for function main: t{[0..48]; [49].f1[0..4]}; i; j; q; r [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ - ] Pre-condition (file tests/value/precise_locations.i, line 18) tried with Call Preconditions. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Pre-condition (file tests/value/precise_locations.i, line 21) tried with Call Preconditions. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ - ] Instance of 'Pre-condition (file tests/value/precise_locations.i, line 18)' at call 'f' (file tests/value/precise_locations.i, line 48) tried with Eva. [ - ] Instance of 'Pre-condition (file tests/value/precise_locations.i, line 21)' at call 'g' (file tests/value/precise_locations.i, line 49) tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 2 Completely validated 2 Considered valid 4 To be validated 8 Total -------------------------------------------------------------------------------- [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..49] ∈ {0} i ∈ {0} j ∈ {0} q ∈ {0} r ∈ {0} [eva] tests/value/precise_locations.i:33: Frama_C_dump_each: # Cvalue domain: t[0].f1[0..4] ∈ {0; 10} [0]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [1].f1[0..4] ∈ {0; 10} [1]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [2].f1[0..4] ∈ {0; 10} [2]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [3].f1[0..4] ∈ {0; 10} [3]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [4].f1[0..4] ∈ {0; 10} [4]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [5].f1[0..4] ∈ {0; 10} [5]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [6].f1[0..4] ∈ {0; 10} [6]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [7].f1[0..4] ∈ {0; 10} [7]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [8].f1[0..4] ∈ {0; 10} [8]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [9].f1[0..4] ∈ {0; 10} [9]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [10].f1[0..4] ∈ {0; 10} [10]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [11].f1[0..4] ∈ {0; 10} [11]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [12].f1[0..4] ∈ {0; 10} [12]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [13].f1[0..4] ∈ {0; 10} [13]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [14].f1[0..4] ∈ {0; 10} [14]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [15].f1[0..4] ∈ {0; 10} [15]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [16].f1[0..4] ∈ {0; 10} [16]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [17].f1[0..4] ∈ {0; 10} [17]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [18].f1[0..4] ∈ {0; 10} [18]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [19].f1[0..4] ∈ {0; 10} [19]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [20].f1[0..4] ∈ {0; 10} [20]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [21].f1[0..4] ∈ {0; 10} [21]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [22].f1[0..4] ∈ {0; 10} [22]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [23].f1[0..4] ∈ {0; 10} [23]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [24].f1[0..4] ∈ {0; 10} [24]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [25].f1[0..4] ∈ {0; 10} [25]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [26].f1[0..4] ∈ {0; 10} [26]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [27].f1[0..4] ∈ {0; 10} [27]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [28].f1[0..4] ∈ {0; 10} [28]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [29].f1[0..4] ∈ {0; 10} [29]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [30].f1[0..4] ∈ {0; 10} [30]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [31].f1[0..4] ∈ {0; 10} [31]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [32].f1[0..4] ∈ {0; 10} [32]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [33].f1[0..4] ∈ {0; 10} [33]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [34].f1[0..4] ∈ {0; 10} [34]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [35].f1[0..4] ∈ {0; 10} [35]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [36].f1[0..4] ∈ {0; 10} [36]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [37].f1[0..4] ∈ {0; 10} [37]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [38].f1[0..4] ∈ {0; 10} [38]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [39].f1[0..4] ∈ {0; 10} [39]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [40].f1[0..4] ∈ {0; 10} [40]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [41].f1[0..4] ∈ {0; 10} [41]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [42].f1[0..4] ∈ {0; 10} [42]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [43].f1[0..4] ∈ {0; 10} [43]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [44].f1[0..4] ∈ {0; 10} [44]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [45].f1[0..4] ∈ {0; 10} [45]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [46].f1[0..4] ∈ {0; 10} [46]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [47].f1[0..4] ∈ {0; 10} [47]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [48].f1[0..4] ∈ {0; 10} [48]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [49].f1[0..4] ∈ {0; 10} [49]{.f_inter[0..4]; .f2; .f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} i ∈ {5} j ∈ {0; 50} q ∈ {0} r ∈ {0} v ∈ [--..--] __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] computing for function ct <- main. Called from tests/value/precise_locations.i:39. [eva] Recording results for ct [eva] Done for function ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:39: Reusing old results for call to ct [eva] tests/value/precise_locations.i:42: Frama_C_dump_each: # Cvalue domain: t[0].f1[0..4] ∈ {0; 10; 20} [0].f_inter[0..4] ∈ {0} [0].f2 ∈ {-99; 0} [0]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [1].f1[0..4] ∈ {0; 10; 20} [1].f_inter[0..4] ∈ {0} [1].f2 ∈ {-99; 0} [1]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [2].f1[0..4] ∈ {0; 10; 20} [2].f_inter[0..4] ∈ {0} [2].f2 ∈ {-99; 0} [2]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [3].f1[0..4] ∈ {0; 10; 20} [3].f_inter[0..4] ∈ {0} [3].f2 ∈ {-99; 0} [3]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [4].f1[0..4] ∈ {0; 10; 20} [4].f_inter[0..4] ∈ {0} [4].f2 ∈ {-99; 0} [4]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [5].f1[0..4] ∈ {0; 10; 20} [5].f_inter[0..4] ∈ {0} [5].f2 ∈ {-99; 0} [5]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [6].f1[0..4] ∈ {0; 10; 20} [6].f_inter[0..4] ∈ {0} [6].f2 ∈ {-99; 0} [6]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [7].f1[0..4] ∈ {0; 10; 20} [7].f_inter[0..4] ∈ {0} [7].f2 ∈ {-99; 0} [7]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [8].f1[0..4] ∈ {0; 10; 20} [8].f_inter[0..4] ∈ {0} [8].f2 ∈ {-99; 0} [8]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [9].f1[0..4] ∈ {0; 10; 20} [9].f_inter[0..4] ∈ {0} [9].f2 ∈ {-99; 0} [9]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [10].f1[0..4] ∈ {0; 10; 20} [10].f_inter[0..4] ∈ {0} [10].f2 ∈ {-99; 0} [10]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [11].f1[0..4] ∈ {0; 10; 20} [11].f_inter[0..4] ∈ {0} [11].f2 ∈ {-99; 0} [11]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [12].f1[0..4] ∈ {0; 10; 20} [12].f_inter[0..4] ∈ {0} [12].f2 ∈ {-99; 0} [12]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [13].f1[0..4] ∈ {0; 10; 20} [13].f_inter[0..4] ∈ {0} [13].f2 ∈ {-99; 0} [13]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [14].f1[0..4] ∈ {0; 10; 20} [14].f_inter[0..4] ∈ {0} [14].f2 ∈ {-99; 0} [14]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [15].f1[0..4] ∈ {0; 10; 20} [15].f_inter[0..4] ∈ {0} [15].f2 ∈ {-99; 0} [15]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [16].f1[0..4] ∈ {0; 10; 20} [16].f_inter[0..4] ∈ {0} [16].f2 ∈ {-99; 0} [16]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [17].f1[0..4] ∈ {0; 10; 20} [17].f_inter[0..4] ∈ {0} [17].f2 ∈ {-99; 0} [17]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [18].f1[0..4] ∈ {0; 10; 20} [18].f_inter[0..4] ∈ {0} [18].f2 ∈ {-99; 0} [18]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [19].f1[0..4] ∈ {0; 10; 20} [19].f_inter[0..4] ∈ {0} [19].f2 ∈ {-99; 0} [19]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [20].f1[0..4] ∈ {0; 10; 20} [20].f_inter[0..4] ∈ {0} [20].f2 ∈ {-99; 0} [20]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [21].f1[0..4] ∈ {0; 10; 20} [21].f_inter[0..4] ∈ {0} [21].f2 ∈ {-99; 0} [21]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [22].f1[0..4] ∈ {0; 10; 20} [22].f_inter[0..4] ∈ {0} [22].f2 ∈ {-99; 0} [22]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [23].f1[0..4] ∈ {0; 10; 20} [23].f_inter[0..4] ∈ {0} [23].f2 ∈ {-99; 0} [23]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [24].f1[0..4] ∈ {0; 10; 20} [24].f_inter[0..4] ∈ {0} [24].f2 ∈ {-99; 0} [24]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [25].f1[0..4] ∈ {0; 10; 20} [25].f_inter[0..4] ∈ {0} [25].f2 ∈ {-99; 0} [25]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [26].f1[0..4] ∈ {0; 10; 20} [26].f_inter[0..4] ∈ {0} [26].f2 ∈ {-99; 0} [26]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [27].f1[0..4] ∈ {0; 10; 20} [27].f_inter[0..4] ∈ {0} [27].f2 ∈ {-99; 0} [27]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [28].f1[0..4] ∈ {0; 10; 20} [28].f_inter[0..4] ∈ {0} [28].f2 ∈ {-99; 0} [28]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [29].f1[0..4] ∈ {0; 10; 20} [29].f_inter[0..4] ∈ {0} [29].f2 ∈ {-99; 0} [29]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [30].f1[0..4] ∈ {0; 10; 20} [30].f_inter[0..4] ∈ {0} [30].f2 ∈ {-99; 0} [30]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [31].f1[0..4] ∈ {0; 10; 20} [31].f_inter[0..4] ∈ {0} [31].f2 ∈ {-99; 0} [31]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [32].f1[0..4] ∈ {0; 10; 20} [32].f_inter[0..4] ∈ {0} [32].f2 ∈ {-99; 0} [32]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [33].f1[0..4] ∈ {0; 10; 20} [33].f_inter[0..4] ∈ {0} [33].f2 ∈ {-99; 0} [33]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [34].f1[0..4] ∈ {0; 10; 20} [34].f_inter[0..4] ∈ {0} [34].f2 ∈ {-99; 0} [34]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [35].f1[0..4] ∈ {0; 10; 20} [35].f_inter[0..4] ∈ {0} [35].f2 ∈ {-99; 0} [35]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [36].f1[0..4] ∈ {0; 10; 20} [36].f_inter[0..4] ∈ {0} [36].f2 ∈ {-99; 0} [36]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [37].f1[0..4] ∈ {0; 10; 20} [37].f_inter[0..4] ∈ {0} [37].f2 ∈ {-99; 0} [37]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [38].f1[0..4] ∈ {0; 10; 20} [38].f_inter[0..4] ∈ {0} [38].f2 ∈ {-99; 0} [38]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [39].f1[0..4] ∈ {0; 10; 20} [39].f_inter[0..4] ∈ {0} [39].f2 ∈ {-99; 0} [39]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [40].f1[0..4] ∈ {0; 10; 20} [40].f_inter[0..4] ∈ {0} [40].f2 ∈ {-99; 0} [40]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [41].f1[0..4] ∈ {0; 10; 20} [41].f_inter[0..4] ∈ {0} [41].f2 ∈ {-99; 0} [41]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [42].f1[0..4] ∈ {0; 10; 20} [42].f_inter[0..4] ∈ {0} [42].f2 ∈ {-99; 0} [42]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [43].f1[0..4] ∈ {0; 10; 20} [43].f_inter[0..4] ∈ {0} [43].f2 ∈ {-99; 0} [43]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [44].f1[0..4] ∈ {0; 10; 20} [44].f_inter[0..4] ∈ {0} [44].f2 ∈ {-99; 0} [44]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [45].f1[0..4] ∈ {0; 10; 20} [45].f_inter[0..4] ∈ {0} [45].f2 ∈ {-99; 0} [45]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [46].f1[0..4] ∈ {0; 10; 20} [46].f_inter[0..4] ∈ {0} [46].f2 ∈ {-99; 0} [46]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [47].f1[0..4] ∈ {0; 10; 20} [47].f_inter[0..4] ∈ {0} [47].f2 ∈ {-99; 0} [47]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [48].f1[0..4] ∈ {0; 10; 20} [48].f_inter[0..4] ∈ {0} [48].f2 ∈ {-99; 0} [48]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [49].f1[0..4] ∈ {0; 10; 20} [49].f_inter[0..4] ∈ {0} [49].f2 ∈ {-99; 0} [49]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} i ∈ {5} j ∈ {50} q ∈ {0} r ∈ {0} v ∈ [--..--] __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/precise_locations.i:48. [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precise_locations.i:49. [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function ct: __retres ∈ {20} [eva:final-states] Values at end of function main: t[0].f1[0..4] ∈ {0; 10; 20} [0].f_inter[0..4] ∈ {0} [0].f2 ∈ {-99; 0} [0]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [1].f1[0..4] ∈ {0; 10; 20} [1].f_inter[0..4] ∈ {0} [1].f2 ∈ {-99; 0} [1]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [2].f1[0..4] ∈ {0; 10; 20} [2].f_inter[0..4] ∈ {0} [2].f2 ∈ {-99; 0} [2]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [3].f1[0..4] ∈ {0; 10; 20} [3].f_inter[0..4] ∈ {0} [3].f2 ∈ {-99; 0} [3]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [4].f1[0..4] ∈ {0; 10; 20} [4].f_inter[0..4] ∈ {0} [4].f2 ∈ {-99; 0} [4]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [5].f1[0..4] ∈ {0; 10; 20} [5].f_inter[0..4] ∈ {0} [5].f2 ∈ {-99; 0} [5]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [6].f1[0..4] ∈ {0; 10; 20} [6].f_inter[0..4] ∈ {0} [6].f2 ∈ {-99; 0} [6]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [7].f1[0..4] ∈ {0; 10; 20} [7].f_inter[0..4] ∈ {0} [7].f2 ∈ {-99; 0} [7]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [8].f1[0..4] ∈ {0; 10; 20} [8].f_inter[0..4] ∈ {0} [8].f2 ∈ {-99; 0} [8]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [9].f1[0..4] ∈ {0; 10; 20} [9].f_inter[0..4] ∈ {0} [9].f2 ∈ {-99; 0} [9]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [10].f1[0..4] ∈ {0; 10; 20} [10].f_inter[0..4] ∈ {0} [10].f2 ∈ {-99; 0} [10]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [11].f1[0..4] ∈ {0; 10; 20} [11].f_inter[0..4] ∈ {0} [11].f2 ∈ {-99; 0} [11]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [12].f1[0..4] ∈ {0; 10; 20} [12].f_inter[0..4] ∈ {0} [12].f2 ∈ {-99; 0} [12]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [13].f1[0..4] ∈ {0; 10; 20} [13].f_inter[0..4] ∈ {0} [13].f2 ∈ {-99; 0} [13]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [14].f1[0..4] ∈ {0; 10; 20} [14].f_inter[0..4] ∈ {0} [14].f2 ∈ {-99; 0} [14]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [15].f1[0..4] ∈ {0; 10; 20} [15].f_inter[0..4] ∈ {0} [15].f2 ∈ {-99; 0} [15]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [16].f1[0..4] ∈ {0; 10; 20} [16].f_inter[0..4] ∈ {0} [16].f2 ∈ {-99; 0} [16]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [17].f1[0..4] ∈ {0; 10; 20} [17].f_inter[0..4] ∈ {0} [17].f2 ∈ {-99; 0} [17]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [18].f1[0..4] ∈ {0; 10; 20} [18].f_inter[0..4] ∈ {0} [18].f2 ∈ {-99; 0} [18]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [19].f1[0..4] ∈ {0; 10; 20} [19].f_inter[0..4] ∈ {0} [19].f2 ∈ {-99; 0} [19]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [20].f1[0..4] ∈ {0; 10; 20} [20].f_inter[0..4] ∈ {0} [20].f2 ∈ {-99; 0} [20]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [21].f1[0..4] ∈ {0; 10; 20} [21].f_inter[0..4] ∈ {0} [21].f2 ∈ {-99; 0} [21]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [22].f1[0..4] ∈ {0; 10; 20} [22].f_inter[0..4] ∈ {0} [22].f2 ∈ {-99; 0} [22]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [23].f1[0..4] ∈ {0; 10; 20} [23].f_inter[0..4] ∈ {0} [23].f2 ∈ {-99; 0} [23]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [24].f1[0..4] ∈ {0; 10; 20} [24].f_inter[0..4] ∈ {0} [24].f2 ∈ {-99; 0} [24]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [25].f1[0..4] ∈ {0; 10; 20} [25].f_inter[0..4] ∈ {0} [25].f2 ∈ {-99; 0} [25]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [26].f1[0..4] ∈ {0; 10; 20} [26].f_inter[0..4] ∈ {0} [26].f2 ∈ {-99; 0} [26]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [27].f1[0..4] ∈ {0; 10; 20} [27].f_inter[0..4] ∈ {0} [27].f2 ∈ {-99; 0} [27]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [28].f1[0..4] ∈ {0; 10; 20} [28].f_inter[0..4] ∈ {0} [28].f2 ∈ {-99; 0} [28]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [29].f1[0..4] ∈ {0; 10; 20} [29].f_inter[0..4] ∈ {0} [29].f2 ∈ {-99; 0} [29]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [30].f1[0..4] ∈ {0; 10; 20} [30].f_inter[0..4] ∈ {0} [30].f2 ∈ {-99; 0} [30]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [31].f1[0..4] ∈ {0; 10; 20} [31].f_inter[0..4] ∈ {0} [31].f2 ∈ {-99; 0} [31]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [32].f1[0..4] ∈ {0; 10; 20} [32].f_inter[0..4] ∈ {0} [32].f2 ∈ {-99; 0} [32]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [33].f1[0..4] ∈ {0; 10; 20} [33].f_inter[0..4] ∈ {0} [33].f2 ∈ {-99; 0} [33]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [34].f1[0..4] ∈ {0; 10; 20} [34].f_inter[0..4] ∈ {0} [34].f2 ∈ {-99; 0} [34]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [35].f1[0..4] ∈ {0; 10; 20} [35].f_inter[0..4] ∈ {0} [35].f2 ∈ {-99; 0} [35]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [36].f1[0..4] ∈ {0; 10; 20} [36].f_inter[0..4] ∈ {0} [36].f2 ∈ {-99; 0} [36]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [37].f1[0..4] ∈ {0; 10; 20} [37].f_inter[0..4] ∈ {0} [37].f2 ∈ {-99; 0} [37]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [38].f1[0..4] ∈ {0; 10; 20} [38].f_inter[0..4] ∈ {0} [38].f2 ∈ {-99; 0} [38]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [39].f1[0..4] ∈ {0; 10; 20} [39].f_inter[0..4] ∈ {0} [39].f2 ∈ {-99; 0} [39]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [40].f1[0..4] ∈ {0; 10; 20} [40].f_inter[0..4] ∈ {0} [40].f2 ∈ {-99; 0} [40]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [41].f1[0..4] ∈ {0; 10; 20} [41].f_inter[0..4] ∈ {0} [41].f2 ∈ {-99; 0} [41]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [42].f1[0..4] ∈ {0; 10; 20} [42].f_inter[0..4] ∈ {0} [42].f2 ∈ {-99; 0} [42]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [43].f1[0..4] ∈ {0; 10; 20} [43].f_inter[0..4] ∈ {0} [43].f2 ∈ {-99; 0} [43]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [44].f1[0..4] ∈ {0; 10; 20} [44].f_inter[0..4] ∈ {0} [44].f2 ∈ {-99; 0} [44]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [45].f1[0..4] ∈ {0; 10; 20} [45].f_inter[0..4] ∈ {0} [45].f2 ∈ {-99; 0} [45]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [46].f1[0..4] ∈ {0; 10; 20} [46].f_inter[0..4] ∈ {0} [46].f2 ∈ {-99; 0} [46]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [47].f1[0..4] ∈ {0; 10; 20} [47].f_inter[0..4] ∈ {0} [47].f2 ∈ {-99; 0} [47]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [48].f1[0..4] ∈ {0; 10; 20} [48].f_inter[0..4] ∈ {0} [48].f2 ∈ {-99; 0} [48]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} [49].f1[0..4] ∈ {0; 10; 20} [49].f_inter[0..4] ∈ {0} [49].f2 ∈ {-99; 0} [49]{.f_inter2[0..4]; .[bits 328 to 351]} ∈ {0} i ∈ {5} j ∈ {50} q ∈ {0; 10; 20} r ∈ {0; 1; 11; 21} __retres ∈ {0; 1; 10; 11; 20; 21; 31; 41} [from] Computing for function ct [from] Done for function ct [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function ct: \result FROM \nothing [from] Function f: NO EFFECTS [from] Function g: NO EFFECTS [from] Function main: t{[0].f1[0..4]; [0].f2; [1].f1[0..4]; [1].f2; [2].f1[0..4]; [2].f2; [3].f1[0..4]; [3].f2; [4].f1[0..4]; [4].f2; [5].f1[0..4]; [5].f2; [6].f1[0..4]; [6].f2; [7].f1[0..4]; [7].f2; [8].f1[0..4]; [8].f2; [9].f1[0..4]; [9].f2; [10].f1[0..4]; [10].f2; [11].f1[0..4]; [11].f2; [12].f1[0..4]; [12].f2; [13].f1[0..4]; [13].f2; [14].f1[0..4]; [14].f2; [15].f1[0..4]; [15].f2; [16].f1[0..4]; [16].f2; [17].f1[0..4]; [17].f2; [18].f1[0..4]; [18].f2; [19].f1[0..4]; [19].f2; [20].f1[0..4]; [20].f2; [21].f1[0..4]; [21].f2; [22].f1[0..4]; [22].f2; [23].f1[0..4]; [23].f2; [24].f1[0..4]; [24].f2; [25].f1[0..4]; [25].f2; [26].f1[0..4]; [26].f2; [27].f1[0..4]; [27].f2; [28].f1[0..4]; [28].f2; [29].f1[0..4]; [29].f2; [30].f1[0..4]; [30].f2; [31].f1[0..4]; [31].f2; [32].f1[0..4]; [32].f2; [33].f1[0..4]; [33].f2; [34].f1[0..4]; [34].f2; [35].f1[0..4]; [35].f2; [36].f1[0..4]; [36].f2; [37].f1[0..4]; [37].f2; [38].f1[0..4]; [38].f2; [39].f1[0..4]; [39].f2; [40].f1[0..4]; [40].f2; [41].f1[0..4]; [41].f2; [42].f1[0..4]; [42].f2; [43].f1[0..4]; [43].f2; [44].f1[0..4]; [44].f2; [45].f1[0..4]; [45].f2; [46].f1[0..4]; [46].f2; [47].f1[0..4]; [47].f2; [48].f1[0..4]; [48].f2; [49].f1[0..4]; [49].f2} FROM \nothing (and SELF) i FROM \nothing j FROM \nothing q FROM t{[0].f1[0..4]; [1].f1[0..4]; [2].f1[0..4]; [3].f1[0..4]; [4].f1[0..4]; [5].f1[0..4]; [6].f1[0..4]; [7].f1[0..4]; [8].f1[0..4]; [9].f1[0..4]; [10].f1[0..4]; [11].f1[0..4]; [12].f1[0..4]; [13].f1[0..4]; [14].f1[0..4]; [15].f1[0..4]; [16].f1[0..4]; [17].f1[0..4]; [18].f1[0..4]; [19].f1[0..4]; [20].f1[0..4]; [21].f1[0..4]; [22].f1[0..4]; [23].f1[0..4]; [24].f1[0..4]; [25].f1[0..4]; [26].f1[0..4]; [27].f1[0..4]; [28].f1[0..4]; [29].f1[0..4]; [30].f1[0..4]; [31].f1[0..4]; [32].f1[0..4]; [33].f1[0..4]; [34].f1[0..4]; [35].f1[0..4]; [36].f1[0..4]; [37].f1[0..4]; [38].f1[0..4]; [39].f1[0..4]; [40].f1[0..4]; [41].f1[0..4]; [42].f1[0..4]; [43].f1[0..4]; [44].f1[0..4]; [45].f1[0..4]; [46].f1[0..4]; [47].f1[0..4]; [48].f1[0..4]; [49].f1[0..4]} (and SELF) r FROM t{[0].f1[0..4]; [1].f1[0..4]; [2].f1[0..4]; [3].f1[0..4]; [4].f1[0..4]; [5].f1[0..4]; [6].f1[0..4]; [7].f1[0..4]; [8].f1[0..4]; [9].f1[0..4]; [10].f1[0..4]; [11].f1[0..4]; [12].f1[0..4]; [13].f1[0..4]; [14].f1[0..4]; [15].f1[0..4]; [16].f1[0..4]; [17].f1[0..4]; [18].f1[0..4]; [19].f1[0..4]; [20].f1[0..4]; [21].f1[0..4]; [22].f1[0..4]; [23].f1[0..4]; [24].f1[0..4]; [25].f1[0..4]; [26].f1[0..4]; [27].f1[0..4]; [28].f1[0..4]; [29].f1[0..4]; [30].f1[0..4]; [31].f1[0..4]; [32].f1[0..4]; [33].f1[0..4]; [34].f1[0..4]; [35].f1[0..4]; [36].f1[0..4]; [37].f1[0..4]; [38].f1[0..4]; [39].f1[0..4]; [40].f1[0..4]; [41].f1[0..4]; [42].f1[0..4]; [43].f1[0..4]; [44].f1[0..4]; [45].f1[0..4]; [46].f1[0..4]; [47].f1[0..4]; [48].f1[0..4]; [49].f1[0..4]} (and SELF) \result FROM t{[0].f1[0..4]; [1].f1[0..4]; [2].f1[0..4]; [3].f1[0..4]; [4].f1[0..4]; [5].f1[0..4]; [6].f1[0..4]; [7].f1[0..4]; [8].f1[0..4]; [9].f1[0..4]; [10].f1[0..4]; [11].f1[0..4]; [12].f1[0..4]; [13].f1[0..4]; [14].f1[0..4]; [15].f1[0..4]; [16].f1[0..4]; [17].f1[0..4]; [18].f1[0..4]; [19].f1[0..4]; [20].f1[0..4]; [21].f1[0..4]; [22].f1[0..4]; [23].f1[0..4]; [24].f1[0..4]; [25].f1[0..4]; [26].f1[0..4]; [27].f1[0..4]; [28].f1[0..4]; [29].f1[0..4]; [30].f1[0..4]; [31].f1[0..4]; [32].f1[0..4]; [33].f1[0..4]; [34].f1[0..4]; [35].f1[0..4]; [36].f1[0..4]; [37].f1[0..4]; [38].f1[0..4]; [39].f1[0..4]; [40].f1[0..4]; [41].f1[0..4]; [42].f1[0..4]; [43].f1[0..4]; [44].f1[0..4]; [45].f1[0..4]; [46].f1[0..4]; [47].f1[0..4]; [48].f1[0..4]; [49].f1[0..4]}; q; r [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function ct: __retres [inout] Inputs for function ct: \nothing [inout] InOut (internal) for function ct: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: __retres [inout] Out (internal) for function main: t{[0].f1[0..4]; [0].f2; [1].f1[0..4]; [1].f2; [2].f1[0..4]; [2].f2; [3].f1[0..4]; [3].f2; [4].f1[0..4]; [4].f2; [5].f1[0..4]; [5].f2; [6].f1[0..4]; [6].f2; [7].f1[0..4]; [7].f2; [8].f1[0..4]; [8].f2; [9].f1[0..4]; [9].f2; [10].f1[0..4]; [10].f2; [11].f1[0..4]; [11].f2; [12].f1[0..4]; [12].f2; [13].f1[0..4]; [13].f2; [14].f1[0..4]; [14].f2; [15].f1[0..4]; [15].f2; [16].f1[0..4]; [16].f2; [17].f1[0..4]; [17].f2; [18].f1[0..4]; [18].f2; [19].f1[0..4]; [19].f2; [20].f1[0..4]; [20].f2; [21].f1[0..4]; [21].f2; [22].f1[0..4]; [22].f2; [23].f1[0..4]; [23].f2; [24].f1[0..4]; [24].f2; [25].f1[0..4]; [25].f2; [26].f1[0..4]; [26].f2; [27].f1[0..4]; [27].f2; [28].f1[0..4]; [28].f2; [29].f1[0..4]; [29].f2; [30].f1[0..4]; [30].f2; [31].f1[0..4]; [31].f2; [32].f1[0..4]; [32].f2; [33].f1[0..4]; [33].f2; [34].f1[0..4]; [34].f2; [35].f1[0..4]; [35].f2; [36].f1[0..4]; [36].f2; [37].f1[0..4]; [37].f2; [38].f1[0..4]; [38].f2; [39].f1[0..4]; [39].f2; [40].f1[0..4]; [40].f2; [41].f1[0..4]; [41].f2; [42].f1[0..4]; [42].f2; [43].f1[0..4]; [43].f2; [44].f1[0..4]; [44].f2; [45].f1[0..4]; [45].f2; [46].f1[0..4]; [46].f2; [47].f1[0..4]; [47].f2; [48].f1[0..4]; [48].f2; [49].f1[0..4]; [49].f2}; i; j; q; r; __retres [inout] Inputs for function main: t{[0].f1[0..4]; [1].f1[0..4]; [2].f1[0..4]; [3].f1[0..4]; [4].f1[0..4]; [5].f1[0..4]; [6].f1[0..4]; [7].f1[0..4]; [8].f1[0..4]; [9].f1[0..4]; [10].f1[0..4]; [11].f1[0..4]; [12].f1[0..4]; [13].f1[0..4]; [14].f1[0..4]; [15].f1[0..4]; [16].f1[0..4]; [17].f1[0..4]; [18].f1[0..4]; [19].f1[0..4]; [20].f1[0..4]; [21].f1[0..4]; [22].f1[0..4]; [23].f1[0..4]; [24].f1[0..4]; [25].f1[0..4]; [26].f1[0..4]; [27].f1[0..4]; [28].f1[0..4]; [29].f1[0..4]; [30].f1[0..4]; [31].f1[0..4]; [32].f1[0..4]; [33].f1[0..4]; [34].f1[0..4]; [35].f1[0..4]; [36].f1[0..4]; [37].f1[0..4]; [38].f1[0..4]; [39].f1[0..4]; [40].f1[0..4]; [41].f1[0..4]; [42].f1[0..4]; [43].f1[0..4]; [44].f1[0..4]; [45].f1[0..4]; [46].f1[0..4]; [47].f1[0..4]; [48].f1[0..4]; [49].f1[0..4]}; i; j; q; r [inout] InOut (internal) for function main: Operational inputs: t{[0].f1[0..4]; [1].f1[0..4]; [2].f1[0..4]; [3].f1[0..4]; [4].f1[0..4]; [5].f1[0..4]; [6].f1[0..4]; [7].f1[0..4]; [8].f1[0..4]; [9].f1[0..4]; [10].f1[0..4]; [11].f1[0..4]; [12].f1[0..4]; [13].f1[0..4]; [14].f1[0..4]; [15].f1[0..4]; [16].f1[0..4]; [17].f1[0..4]; [18].f1[0..4]; [19].f1[0..4]; [20].f1[0..4]; [21].f1[0..4]; [22].f1[0..4]; [23].f1[0..4]; [24].f1[0..4]; [25].f1[0..4]; [26].f1[0..4]; [27].f1[0..4]; [28].f1[0..4]; [29].f1[0..4]; [30].f1[0..4]; [31].f1[0..4]; [32].f1[0..4]; [33].f1[0..4]; [34].f1[0..4]; [35].f1[0..4]; [36].f1[0..4]; [37].f1[0..4]; [38].f1[0..4]; [39].f1[0..4]; [40].f1[0..4]; [41].f1[0..4]; [42].f1[0..4]; [43].f1[0..4]; [44].f1[0..4]; [45].f1[0..4]; [46].f1[0..4]; [47].f1[0..4]; [48].f1[0..4]; [49].f1[0..4]}; q; r Operational inputs on termination: t{[0].f1[0..4]; [1].f1[0..4]; [2].f1[0..4]; [3].f1[0..4]; [4].f1[0..4]; [5].f1[0..4]; [6].f1[0..4]; [7].f1[0..4]; [8].f1[0..4]; [9].f1[0..4]; [10].f1[0..4]; [11].f1[0..4]; [12].f1[0..4]; [13].f1[0..4]; [14].f1[0..4]; [15].f1[0..4]; [16].f1[0..4]; [17].f1[0..4]; [18].f1[0..4]; [19].f1[0..4]; [20].f1[0..4]; [21].f1[0..4]; [22].f1[0..4]; [23].f1[0..4]; [24].f1[0..4]; [25].f1[0..4]; [26].f1[0..4]; [27].f1[0..4]; [28].f1[0..4]; [29].f1[0..4]; [30].f1[0..4]; [31].f1[0..4]; [32].f1[0..4]; [33].f1[0..4]; [34].f1[0..4]; [35].f1[0..4]; [36].f1[0..4]; [37].f1[0..4]; [38].f1[0..4]; [39].f1[0..4]; [40].f1[0..4]; [41].f1[0..4]; [42].f1[0..4]; [43].f1[0..4]; [44].f1[0..4]; [45].f1[0..4]; [46].f1[0..4]; [47].f1[0..4]; [48].f1[0..4]; [49].f1[0..4]}; q; r Sure outputs: i; j; __retres [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Pre-condition (file tests/value/precise_locations.i, line 18) by Call Preconditions. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Pre-condition (file tests/value/precise_locations.i, line 21) by Call Preconditions. [ Extern ] Assigns nothing Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Instance of 'Pre-condition (file tests/value/precise_locations.i, line 18)' at call 'f' (file tests/value/precise_locations.i, line 48) by Eva (v2). [ Valid ] Instance of 'Pre-condition (file tests/value/precise_locations.i, line 21)' at call 'g' (file tests/value/precise_locations.i, line 49) by Eva (v2). -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 6 Completely validated 2 Considered valid 8 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/precond.res.oracle0000666000000000000000000002217013571573400020351 0ustar [kernel] Parsing tests/value/precond.c (with preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ [--..--] pf2 ∈ {{ &f2 }} [eva] computing for function f <- main. Called from tests/value/precond.c:31. [eva] tests/value/precond.c:31: function f: precondition 'i_plus_one' got status valid. [eva] tests/value/precond.c:31: function f: precondition 'i' got status valid. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/precond.c:32. [eva] tests/value/precond.c:32: function f: precondition 'i_plus_one' got status valid. [eva] tests/value/precond.c:32: function f: precondition 'i' got status valid. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precond.c:34. [kernel] tests/value/precond.c:34: Warning: No code nor implicit assigns clause for function g, generating default assigns from the prototype [eva] using specification for function g [eva:alarm] tests/value/precond.c:34: Warning: function g: precondition got status unknown. [eva] Done for function g [eva] computing for function aux <- main. Called from tests/value/precond.c:36. [eva] computing for function f2 <- aux <- main. Called from tests/value/precond.c:21. [kernel] tests/value/precond.c:21: Warning: No code nor implicit assigns clause for function f2, generating default assigns from the prototype [eva] using specification for function f2 [eva] tests/value/precond.c:21: function f2: precondition got status valid. [eva] Done for function f2 [eva] Recording results for aux [eva] Done for function aux [eva] computing for function aux <- main. Called from tests/value/precond.c:37. [eva] computing for function f2 <- aux <- main. Called from tests/value/precond.c:21. [eva:alarm] tests/value/precond.c:21: Warning: function f2: precondition got status unknown. [eva] Done for function f2 [eva] Recording results for aux [eva] Done for function aux [eva] tests/value/precond.c:39: function f: precondition 'i_plus_one' got status valid. [eva] tests/value/precond.c:39: function f: precondition 'i' got status valid. [eva] tests/value/precond.c:39: Reusing old results for call to f [eva] computing for function f <- main. Called from tests/value/precond.c:40. [eva] tests/value/precond.c:40: function f: precondition 'i_plus_one' got status valid. [eva:alarm] tests/value/precond.c:40: Warning: function f: precondition 'i' got status invalid. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ {0; 1} [eva:final-states] Values at end of function aux: [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Pre-condition 'i_plus_one' requires i_plus_one: i + 1 ≥ 0 by Call Preconditions. [ Alarm ] Pre-condition 'i' requires i: i ≥ 0 By Call Preconditions, with pending: - Unreachable instruction (file tests/value/precond.c, line 40) -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ - ] Pre-condition (file tests/value/precond.c, line 15) requires i ≥ 0 tried with Call Preconditions. [ - ] Assigns nothing assigns \nothing; tried with Inferred annotations. [ - ] Default behavior default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'aux' -------------------------------------------------------------------------------- [ - ] Instance of 'Pre-condition (file tests/value/precond.c, line 15)' at instruction (file tests/value/precond.c, line 21) status of 'requires i ≥ 0' of f2 at stmt 4 tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Pre-condition (file tests/value/precond.c, line 24) requires x ≤ 8 tried with Call Preconditions. [ - ] Assigns nothing assigns \nothing; tried with Inferred annotations. [ - ] Default behavior default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Instance of 'Pre-condition 'i_plus_one'' at call 'f' (file tests/value/precond.c, line 31) status of 'requires i_plus_one: i + 1 ≥ 0' of f at stmt 10 by Eva. [ Valid ] Instance of 'Pre-condition 'i'' at call 'f' (file tests/value/precond.c, line 31) status of 'requires i: i ≥ 0' of f at stmt 10 by Eva. [ Valid ] Instance of 'Pre-condition 'i_plus_one'' at call 'f' (file tests/value/precond.c, line 32) status of 'requires i_plus_one: i + 1 ≥ 0' of f at stmt 13 by Eva. [ Valid ] Instance of 'Pre-condition 'i'' at call 'f' (file tests/value/precond.c, line 32) status of 'requires i: i ≥ 0' of f at stmt 13 by Eva. [ - ] Instance of 'Pre-condition (file tests/value/precond.c, line 24)' at call 'g' (file tests/value/precond.c, line 34) status of 'requires x ≤ 8' of g at stmt 16 tried with Eva. [ Valid ] Instance of 'Pre-condition 'i_plus_one'' at instruction (file tests/value/precond.c, line 39) status of 'requires i_plus_one: i + 1 ≥ 0' of f at stmt 19 by Eva. [ Valid ] Instance of 'Pre-condition 'i'' at instruction (file tests/value/precond.c, line 39) status of 'requires i: i ≥ 0' of f at stmt 19 by Eva. [ Valid ] Instance of 'Pre-condition 'i_plus_one'' at instruction (file tests/value/precond.c, line 40) status of 'requires i_plus_one: i + 1 ≥ 0' of f at stmt 20 by Eva. [ Alarm ] Instance of 'Pre-condition 'i'' at instruction (file tests/value/precond.c, line 40) status of 'requires i: i ≥ 0' of f at stmt 20 By Eva, with pending: - Unreachable instruction (file tests/value/precond.c, line 40) -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 8 Completely validated 8 To be validated 2 Alarms emitted 18 Total -------------------------------------------------------------------------------- [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Pre-condition 'i_plus_one' requires i_plus_one: i + 1 ≥ 0 by Call Preconditions. [ Alarm ] Pre-condition 'i' requires i: i ≥ 0 By Call Preconditions, with pending: - Unreachable instruction (file tests/value/precond.c, line 40) -------------------------------------------------------------------------------- --- Properties of Function 'f2' -------------------------------------------------------------------------------- [ - ] Pre-condition (file tests/value/precond.c, line 15) requires i ≥ 0 tried with Call Preconditions. [ - ] Assigns nothing assigns \nothing; tried with Inferred annotations. [ - ] Default behavior default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ - ] Pre-condition (file tests/value/precond.c, line 24) requires x ≤ 8 tried with Call Preconditions. [ - ] Assigns nothing assigns \nothing; tried with Inferred annotations. [ - ] Default behavior default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 1 Completely validated 6 To be validated 1 Alarm emitted 8 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/precond2.0.res.oracle0000666000000000000000000001075113571573400020573 0ustar [kernel] Parsing tests/value/precond2.c (with preprocessing) [rte] annotating function f [rte] annotating function main [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] computing for function f <- main. Called from tests/value/precond2.c:21. [eva] tests/value/precond2.c:21: function f: precondition 'i_plus_one' got status valid. [eva] tests/value/precond2.c:21: function f: precondition 'i' got status valid. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/precond2.c:22. [eva] tests/value/precond2.c:22: function f: precondition 'i_plus_one' got status valid. [eva:alarm] tests/value/precond2.c:22: Warning: function f: precondition 'i' got status invalid. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precond2.c:24. [kernel] tests/value/precond2.c:24: Warning: No code nor implicit assigns clause for function g, generating default assigns from the prototype [eva] using specification for function g [eva] tests/value/precond2.c:24: function g: precondition got status valid. [eva] Done for function g [eva] computing for function g <- main. Called from tests/value/precond2.c:24. [eva] tests/value/precond2.c:24: function g: precondition got status valid. [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ {1} [eva:final-states] Values at end of function main: x ∈ {0; 1} [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Pre-condition 'i_plus_one' requires i_plus_one: i + 1 ≥ 0 by Call Preconditions. [ Alarm ] Pre-condition 'i' requires i: i ≥ 0 By Call Preconditions, with pending: - Unreachable call 'f' (file tests/value/precond2.c, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Pre-condition (file tests/value/precond2.c, line 16) requires x ≤ 8 by Call Preconditions. [ - ] Assigns nothing assigns \nothing; tried with Inferred annotations. [ - ] Default behavior default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Instance of 'Pre-condition 'i_plus_one'' at call 'f' (file tests/value/precond2.c, line 21) status of 'requires i_plus_one: i + 1 ≥ 0' of f at stmt 6 by Eva. [ Valid ] Instance of 'Pre-condition 'i'' at call 'f' (file tests/value/precond2.c, line 21) status of 'requires i: i ≥ 0' of f at stmt 6 by Eva. [ Valid ] Instance of 'Pre-condition 'i_plus_one'' at call 'f' (file tests/value/precond2.c, line 22) status of 'requires i_plus_one: i + 1 ≥ 0' of f at stmt 9 by Eva. [ Alarm ] Instance of 'Pre-condition 'i'' at call 'f' (file tests/value/precond2.c, line 22) status of 'requires i: i ≥ 0' of f at stmt 9 By Eva, with pending: - Unreachable call 'f' (file tests/value/precond2.c, line 22) [ Valid ] Instance of 'Pre-condition (file tests/value/precond2.c, line 16)' at call 'g' (file tests/value/precond2.c, line 24) status of 'requires x ≤ 8' of g at stmt 12 by Eva. [ Valid ] Instance of 'Pre-condition (file tests/value/precond2.c, line 16)' at call 'g' (file tests/value/precond2.c, line 24) status of 'requires x ≤ 8' of g at stmt 13 by Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 7 Completely validated 2 To be validated 2 Alarms emitted 11 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/precond2.1.res.oracle0000666000000000000000000001075113571573400020574 0ustar [kernel] Parsing tests/value/precond2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] computing for function f <- main. Called from tests/value/precond2.c:21. [eva] tests/value/precond2.c:21: function f: precondition 'i_plus_one' got status valid. [eva] tests/value/precond2.c:21: function f: precondition 'i' got status valid. [eva] Recording results for f [eva] Done for function f [eva] computing for function f <- main. Called from tests/value/precond2.c:22. [eva] tests/value/precond2.c:22: function f: precondition 'i_plus_one' got status valid. [eva:alarm] tests/value/precond2.c:22: Warning: function f: precondition 'i' got status invalid. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/precond2.c:24. [kernel] tests/value/precond2.c:24: Warning: No code nor implicit assigns clause for function g, generating default assigns from the prototype [eva] using specification for function g [eva] tests/value/precond2.c:24: function g: precondition got status valid. [eva] Done for function g [eva] computing for function g <- main. Called from tests/value/precond2.c:24. [eva] tests/value/precond2.c:24: function g: precondition got status valid. [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ {1} [eva:final-states] Values at end of function main: x ∈ {0; 1} [rte] annotating function f [rte] annotating function main [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'f' -------------------------------------------------------------------------------- [ Valid ] Pre-condition 'i_plus_one' requires i_plus_one: i + 1 ≥ 0 by Call Preconditions. [ Alarm ] Pre-condition 'i' requires i: i ≥ 0 By Call Preconditions, with pending: - Unreachable call 'f' (file tests/value/precond2.c, line 22) -------------------------------------------------------------------------------- --- Properties of Function 'g' -------------------------------------------------------------------------------- [ Valid ] Pre-condition (file tests/value/precond2.c, line 16) requires x ≤ 8 by Call Preconditions. [ - ] Assigns nothing assigns \nothing; tried with Inferred annotations. [ - ] Default behavior default behavior tried with Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main' -------------------------------------------------------------------------------- [ Valid ] Instance of 'Pre-condition 'i_plus_one'' at call 'f' (file tests/value/precond2.c, line 21) status of 'requires i_plus_one: i + 1 ≥ 0' of f at stmt 6 by Eva. [ Valid ] Instance of 'Pre-condition 'i'' at call 'f' (file tests/value/precond2.c, line 21) status of 'requires i: i ≥ 0' of f at stmt 6 by Eva. [ Valid ] Instance of 'Pre-condition 'i_plus_one'' at call 'f' (file tests/value/precond2.c, line 22) status of 'requires i_plus_one: i + 1 ≥ 0' of f at stmt 9 by Eva. [ Alarm ] Instance of 'Pre-condition 'i'' at call 'f' (file tests/value/precond2.c, line 22) status of 'requires i: i ≥ 0' of f at stmt 9 By Eva, with pending: - Unreachable call 'f' (file tests/value/precond2.c, line 22) [ Valid ] Instance of 'Pre-condition (file tests/value/precond2.c, line 16)' at call 'g' (file tests/value/precond2.c, line 24) status of 'requires x ≤ 8' of g at stmt 12 by Eva. [ Valid ] Instance of 'Pre-condition (file tests/value/precond2.c, line 16)' at call 'g' (file tests/value/precond2.c, line 24) status of 'requires x ≤ 8' of g at stmt 13 by Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 7 Completely validated 2 To be validated 2 Alarms emitted 11 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/propagate_bottom.res.oracle0000666000000000000000000000643313571573400022271 0ustar [kernel] Parsing tests/value/propagate_bottom.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva:alarm] tests/value/propagate_bottom.i:5: Warning: division by zero. assert 0 ≢ 0; [eva:alarm] tests/value/propagate_bottom.i:8: Warning: division by zero. assert 0 ≢ 0; [eva:alarm] tests/value/propagate_bottom.i:11: Warning: division by zero. assert 0 ≢ 0; [eva:alarm] tests/value/propagate_bottom.i:14: Warning: division by zero. assert 0 ≢ 0; [eva:alarm] tests/value/propagate_bottom.i:17: Warning: division by zero. assert 0 ≢ 0; [eva:alarm] tests/value/propagate_bottom.i:20: Warning: division by zero. assert 0 ≢ 0; [eva:alarm] tests/value/propagate_bottom.i:25: Warning: non-finite double value. assert \is_finite((double)(1. / (double)0)); [eva:alarm] tests/value/propagate_bottom.i:28: Warning: non-finite double value. assert \is_finite((double)(1. / (double)0)); [eva:alarm] tests/value/propagate_bottom.i:31: Warning: non-finite double value. assert \is_finite((double)(1. / (double)0)); [eva:alarm] tests/value/propagate_bottom.i:34: Warning: non-finite double value. assert \is_finite((double)(1. / 0.)); [eva:alarm] tests/value/propagate_bottom.i:37: Warning: non-finite double value. assert \is_finite((double)(1. / 0.)); [eva:alarm] tests/value/propagate_bottom.i:40: Warning: non-finite double value. assert \is_finite((double)(1. / 0.)); [eva] Recording results for main [eva] done for function main [eva] tests/value/propagate_bottom.i:5: assertion 'Eva,division_by_zero' got final status invalid. [eva] tests/value/propagate_bottom.i:8: assertion 'Eva,division_by_zero' got final status invalid. [eva] tests/value/propagate_bottom.i:11: assertion 'Eva,division_by_zero' got final status invalid. [eva] tests/value/propagate_bottom.i:14: assertion 'Eva,division_by_zero' got final status invalid. [eva] tests/value/propagate_bottom.i:17: assertion 'Eva,division_by_zero' got final status invalid. [eva] tests/value/propagate_bottom.i:20: assertion 'Eva,division_by_zero' got final status invalid. [eva] tests/value/propagate_bottom.i:25: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/value/propagate_bottom.i:28: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/value/propagate_bottom.i:31: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/value/propagate_bottom.i:34: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/value/propagate_bottom.i:37: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] tests/value/propagate_bottom.i:40: assertion 'Eva,is_nan_or_infinite' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x1; x2; x3; x4; x5; x6; y1; y2; y3; y4; y5; y6 [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/protomain.res.oracle0000666000000000000000000000074313571573400020731 0ustar [kernel] Parsing tests/value/protomain.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [kernel:annot:missing-spec] :0: Warning: Neither code nor specification for function main, generating default assigns from the prototype [eva] using specification for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== frama-c-20.0-Calcium/tests/value/oracle/ptr_call_object.res.oracle0000666000000000000000000000470113571573400022045 0ustar [kernel] Parsing tests/value/ptr_call_object.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function rand <- main. Called from tests/value/ptr_call_object.c:30. [eva] using specification for function rand [eva] Done for function rand [eva] computing for function next_0 <- main. Called from tests/value/ptr_call_object.c:34. [eva] tests/value/ptr_call_object.c:16: Frama_C_show_each_p_in_next_0: {{ &o0 }}, .next ∈ {{ &next_0 }} .i ∈ UNINITIALIZED [eva] Recording results for next_0 [eva] Done for function next_0 [eva] computing for function next_1 <- main. Called from tests/value/ptr_call_object.c:34. [eva] tests/value/ptr_call_object.c:11: Frama_C_show_each_p_in_next_1: {{ &o1 }}, .next ∈ {{ &next_1 }} .i ∈ UNINITIALIZED [eva] Recording results for next_1 [eva] Done for function next_1 [eva] tests/value/ptr_call_object.c:35: Frama_C_show_each_x: {{ &o1 }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function next_0: __retres ∈ {0} [eva:final-states] Values at end of function next_1: __retres ∈ {1} [eva:final-states] Values at end of function main: o1.next ∈ {{ &next_1 }} .i ∈ UNINITIALIZED o0.next ∈ {{ &next_0 }} .i ∈ UNINITIALIZED p ∈ {{ &o1 ; &o0 }} __retres ∈ {0} [from] Computing for function next_0 [from] Done for function next_0 [from] Computing for function next_1 [from] Done for function next_1 [from] Computing for function main [from] Computing for function rand <-main [from] Done for function rand [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function next_0: \result FROM \nothing [from] Function next_1: \result FROM \nothing [from] Function rand: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function next_0: __retres [inout] Inputs for function next_0: \nothing [inout] Out (internal) for function next_1: __retres [inout] Inputs for function next_1: \nothing [inout] Out (internal) for function main: o1.next; o0.next; p; tmp; tmp_0; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/ptr_relation.0.res.oracle0000666000000000000000000000206213571573400021555 0ustar [kernel] Parsing tests/value/ptr_relation.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} a ∈ {0} b ∈ {0} ptr ∈ {0} tab_ptr_fct2[0] ∈ {{ &f2 }} [1] ∈ {{ &g2 }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {0; 77; 333} a ∈ {77; 333} b ∈ {0; 77} ptr ∈ {{ &a ; &b }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: i FROM b; c a FROM c b FROM c (and SELF) ptr FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; a; b; ptr [inout] Inputs for function main: a; b; ptr frama-c-20.0-Calcium/tests/value/oracle/ptr_relation.1.res.oracle0000666000000000000000000000177013571573400021563 0ustar [kernel] Parsing tests/value/ptr_relation.i (no preprocessing) [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} a ∈ {0} b ∈ {0} ptr ∈ {0} tab_ptr_fct2[0] ∈ {{ &f2 }} [1] ∈ {{ &g2 }} [eva] Recording results for main1 [eva] done for function main1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: i ∈ {3; 4} j ∈ {-1; 0; 1} x ∈ {3; 4} [from] Computing for function main1 [from] Done for function main1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: i FROM c j FROM c x FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: i; j; x [inout] Inputs for function main1: i; x frama-c-20.0-Calcium/tests/value/oracle/ptr_relation.2.res.oracle0000666000000000000000000000361713571573400021566 0ustar [kernel] Parsing tests/value/ptr_relation.i (no preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} a ∈ {0} b ∈ {0} ptr ∈ {0} tab_ptr_fct2[0] ∈ {{ &f2 }} [1] ∈ {{ &g2 }} [eva] computing for function g2 <- main2. Called from tests/value/ptr_relation.i:38. [eva] Recording results for g2 [eva] Done for function g2 [eva] computing for function f2 <- main2. Called from tests/value/ptr_relation.i:38. [eva] Recording results for f2 [eva] Done for function f2 [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f2: a ∈ [--..--] b ∈ [--..--] [eva:final-states] Values at end of function g2: a ∈ [--..--] [eva:final-states] Values at end of function main2: j ∈ {0; 1} a ∈ [--..--] b ∈ [--..--] [from] Computing for function f2 [from] Done for function f2 [from] Computing for function g2 [from] Done for function g2 [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f2: a FROM m; arg b FROM l; arg [from] Function g2: a FROM n; arg [from] Function main2: j FROM c a FROM m; n; tab_ptr_fct2[0..1]; c; arg b FROM l; tab_ptr_fct2[0..1]; c; arg (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f2: a; b [inout] Inputs for function f2: l; m [inout] Out (internal) for function g2: a [inout] Inputs for function g2: n [inout] Out (internal) for function main2: j; a; b [inout] Inputs for function main2: j; l; m; n; tab_ptr_fct2[0..1] frama-c-20.0-Calcium/tests/value/oracle/pure_exp.res.oracle0000666000000000000000000000177613571573400020557 0ustar [kernel] Parsing tests/value/pure_exp.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t ∈ {0} [eva:alarm] tests/value/pure_exp.i:8: Warning: out of bounds read. assert \valid_read(t); [eva] Recording results for main [eva] done for function main [eva] tests/value/pure_exp.i:8: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: tmp [inout] Inputs for function main: t frama-c-20.0-Calcium/tests/value/oracle/qualified_arrays.res.oracle0000666000000000000000000000312213571573400022237 0ustar [kernel] Parsing tests/value/qualified_arrays.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization volatile_tab_120_2[0..1][0..119] ∈ [--..--] p_first_volatile ∈ {{ &volatile_tab_120_2[0][0] }} pp_first_volatile ∈ {{ &p_first_volatile }} f ∈ [--..--] x ∈ {{ &f.x }} [eva] tests/value/qualified_arrays.i:16: function main: precondition p_first_volatile ≡ &volatile_tab_120_2[0][0] got status valid. [eva] tests/value/qualified_arrays.i:17: function main: precondition x ≡ &f.x got status valid. [eva:alarm] tests/value/qualified_arrays.i:20: Warning: out of bounds write. assert \valid(pp_first_volatile); [kernel] tests/value/qualified_arrays.i:20: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/qualified_arrays.i:20: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: pp_first_volatile frama-c-20.0-Calcium/tests/value/oracle/raz.res.oracle0000666000000000000000000000154613571573400017517 0ustar [kernel] Parsing tests/value/raz.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization h ∈ [--..--] [eva] tests/value/raz.i:8: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: n ∈ {0; 10} r ∈ {0; 1} i ∈ [0..2147483647] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM h [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: n; tmp; r; i [inout] Inputs for function main: h frama-c-20.0-Calcium/tests/value/oracle/reading_null.res.oracle0000666000000000000000000000314513571573400021363 0ustar [kernel] Parsing tests/value/reading_null.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization AutoTest[0..999] ∈ [--..--] X ∈ [--..--] T[0] ∈ {{ NULL ; &S_0_T[0] }} [1] ∈ {{ NULL ; &S_1_T[0] }} X1 ∈ [--..--] X2 ∈ [--..--] X3 ∈ [--..--] X4 ∈ [--..--] X5 ∈ [--..--] X6 ∈ [--..--] X7 ∈ [--..--] X8 ∈ [--..--] X9 ∈ [--..--] S_0_T[0..1] ∈ [--..--] S_1_T[0..1] ∈ [--..--] [eva] tests/value/reading_null.i:25: Frama_C_show_each_F: [-2147483648..2147483647], {0} [eva] tests/value/reading_null.i:24: starting to merge loop iterations [eva] tests/value/reading_null.i:25: Frama_C_show_each_F: [-2147483648..2147483647], {0; 1} [eva] tests/value/reading_null.i:25: Frama_C_show_each_F: [-2147483648..2147483647], {0; 1; 2} [eva] tests/value/reading_null.i:25: Frama_C_show_each_F: [-2147483648..2147483647], [0..9] [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: X ∈ [--..--] count ∈ {10} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: X FROM X1; X2; X3; X4; X5; X6; X7; X8; X9 (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: X; count [inout] Inputs for function main: X; X1; X2; X3; X4; X5; X6; X7; X8; X9 frama-c-20.0-Calcium/tests/value/oracle/rec.res.oracle0000666000000000000000000000135013571573400017465 0ustar [kernel] Parsing tests/value/rec.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: X ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: X [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/recol.0.res.oracle0000666000000000000000000000413613571573400020163 0ustar [kernel] Parsing tests/value/recol.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s[0..99] ∈ {0} c ∈ {0} s_int ∈ {0} p_int ∈ {0} ones[0..7] ∈ {49} [8] ∈ {0} one23[0] ∈ {49} [1..2] ∈ {50} [3] ∈ {51} [4] ∈ {0} col_ones ∈ {0} col_123 ∈ {0} [eva:signed-overflow] tests/value/recol.c:30: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/value/recol.c:47: Warning: 2's complement assumed for overflow [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s[bits 0 to 15] ∈ {97} [bits 16 to 47] ∈ {776} [6] ∈ {-103} [bits 56 to 71] ∈ {-26736} [bits 72 to 103] ∈ {271697} [13] ∈ {-104} [bits 112 to 127] ∈ {10121} [bits 128 to 159] ∈ {93197600} [20] ∈ {65} [21] ∈ {40} [bits 176 to 191] ∈ {25465} [bits 192 to 223] ∈ {429177008} [bits 224 to 255] ∈ {-1290728143} [bits 256 to 287] ∈ {-445162312} [bits 288 to 303] ∈ {-30359} [38] ∈ {64} [bits 312 to 343] ∈ {1928155169} [43] ∈ {72} [44] ∈ {89} [bits 360 to 391] ∈ {-67735088} [bits 392 to 423] ∈ {-474145519} [bits 424 to 439] ∈ {-13352} [55] ∈ {73} [bits 448 to 463] ∈ {1888} [bits 464 to 495] ∈ {-257018879} [bits 496 to 527] ∈ {-1799132056} [66] ∈ {57} [bits 536 to 551] ∈ {-15632} [bits 552 to 583] ∈ {1373000945} [bits 584 to 599] ∈ {21240} [75] ∈ {41} [76] ∈ {-128} [77] ∈ {-31} [bits 624 to 655] ∈ {-832127096} [82] ∈ {25} [83] ∈ {16} [bits 672 to 703] ∈ {-1951746863} [bits 704 to 735] ∈ {-777326056} [bits 736 to 767] ∈ {-1146314999} [bits 768 to 783] ∈ {22944} [98..99] ∈ {0} c ∈ {565729696} s_int ∈ {-833811464} p_int ∈ {{ (int *)&s[100] }} col_ones ∈ {825307442} col_123 ∈ {858927666} p ∈ {{ &s[98] }} __retres ∈ {0} frama-c-20.0-Calcium/tests/value/oracle/recol.1.res.oracle0000666000000000000000000000413713571573400020165 0ustar [kernel] Parsing tests/value/recol.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s[0..99] ∈ {0} c ∈ {0} s_int ∈ {0} p_int ∈ {0} ones[0..7] ∈ {49} [8] ∈ {0} one23[0] ∈ {49} [1..2] ∈ {50} [3] ∈ {51} [4] ∈ {0} col_ones ∈ {0} col_123 ∈ {0} [eva:signed-overflow] tests/value/recol.c:30: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/value/recol.c:47: Warning: 2's complement assumed for overflow [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s[bits 0 to 15] ∈ {97} [bits 16 to 47] ∈ {776} [6] ∈ {-103} [bits 56 to 71] ∈ {-26736} [bits 72 to 103] ∈ {271697} [13] ∈ {-104} [bits 112 to 127] ∈ {10121} [bits 128 to 159] ∈ {93197600} [20] ∈ {65} [21] ∈ {40} [bits 176 to 191] ∈ {25465} [bits 192 to 223] ∈ {429177008} [bits 224 to 255] ∈ {-1290728143} [bits 256 to 287] ∈ {-445162312} [bits 288 to 303] ∈ {-30359} [38] ∈ {64} [bits 312 to 343] ∈ {1928155169} [43] ∈ {72} [44] ∈ {89} [bits 360 to 391] ∈ {-67735088} [bits 392 to 423] ∈ {-474145519} [bits 424 to 439] ∈ {-13352} [55] ∈ {73} [bits 448 to 463] ∈ {1888} [bits 464 to 495] ∈ {-257018879} [bits 496 to 527] ∈ {-1799132056} [66] ∈ {57} [bits 536 to 551] ∈ {-15632} [bits 552 to 583] ∈ {1373000945} [bits 584 to 599] ∈ {21240} [75] ∈ {41} [76] ∈ {-128} [77] ∈ {-31} [bits 624 to 655] ∈ {-832127096} [82] ∈ {25} [83] ∈ {16} [bits 672 to 703] ∈ {-1951746863} [bits 704 to 735] ∈ {-777326056} [bits 736 to 767] ∈ {-1146314999} [bits 768 to 783] ∈ {22944} [98..99] ∈ {0} c ∈ {565729696} s_int ∈ {-1480071902} p_int ∈ {{ (int *)&s[100] }} col_ones ∈ {825307442} col_123 ∈ {825373236} p ∈ {{ &s[98] }} __retres ∈ {0} frama-c-20.0-Calcium/tests/value/oracle/recursion.0.res.oracle0000666000000000000000000000166613571573400021075 0ustar [kernel] Parsing tests/value/recursion.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] x ∈ [--..--] c ∈ [--..--] s ∈ [--..--] pg ∈ {{ NULL ; &S_pg[0] }} S_pg[0..1] ∈ [--..--] [eva] computing for function ff <- main. Called from tests/value/recursion.i:67. [eva] tests/value/recursion.i:8: User Error: detected recursive call (ff <- ff :: tests/value/recursion.i:67 <- main) Use -eva-ignore-recursive-calls to ignore (beware this will make the analysis unsound) [eva] User Error: Degeneration occurred: results are not correct for lines of code that can be reached from the degeneration point. [eva] User Error: Deferred error message was emitted during execution. See above messages for more information. [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/recursion.1.res.oracle0000666000000000000000000001111413571573400021063 0ustar [kernel] Parsing tests/value/recursion.i (no preprocessing) [eva] Analyzing an incomplete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] x ∈ [--..--] c ∈ [--..--] s ∈ [--..--] pg ∈ {{ NULL ; &S_pg[0] }} S_pg[0..1] ∈ [--..--] [eva] computing for function ff <- main. Called from tests/value/recursion.i:67. [eva] tests/value/recursion.i:8: Warning: recursive call during value analysis of ff (ff <- ff :: tests/value/recursion.i:67 <- main). Assuming the call has no effect. The analysis will be unsound. [eva] computing for function ff <- ff <- main. Called from tests/value/recursion.i:8. [eva] using specification for function ff [eva] Done for function ff [eva] Recording results for ff [eva] Done for function ff [eva] computing for function g <- main. Called from tests/value/recursion.i:68. [eva] tests/value/recursion.i:39: Warning: recursive call during value analysis of g (g <- g :: tests/value/recursion.i:68 <- main). Assuming the call has no effect. The analysis will be unsound. [eva] computing for function g <- g <- main. Called from tests/value/recursion.i:39. [eva] using specification for function g [eva] Done for function g [eva] Recording results for g [eva] Done for function g [eva] computing for function h <- main. Called from tests/value/recursion.i:70. [eva] tests/value/recursion.i:44: Warning: recursive call during value analysis of h (h <- h :: tests/value/recursion.i:70 <- main). Assuming the call has no effect. The analysis will be unsound. [eva] computing for function h <- h <- main. Called from tests/value/recursion.i:44. [eva] using specification for function h [eva] Done for function h [eva] Recording results for h [eva] Done for function h [eva] tests/value/recursion.i:71: Frama_C_show_each: Bottom, Bottom [eva] computing for function escaping_formal <- main. Called from tests/value/recursion.i:72. [eva] tests/value/recursion.i:72: function escaping_formal: precondition got status valid. [eva] tests/value/recursion.i:58: Frama_C_show_each: {{ &i }}, {10}, {0}, {10} [eva] tests/value/recursion.i:59: Warning: recursive call during value analysis of escaping_formal (escaping_formal <- escaping_formal :: tests/value/recursion.i:72 <- main). Assuming the call has no effect. The analysis will be unsound. [eva] tests/value/recursion.i:59: User Error: function 'escaping_formal' (involved in a recursive call) has a formal parameter whose address is taken. Analysis may be unsound. [eva] computing for function escaping_formal <- escaping_formal <- main. Called from tests/value/recursion.i:59. [eva] using specification for function escaping_formal [eva] Done for function escaping_formal [eva] tests/value/recursion.i:62: Frama_C_show_each: {{ &i }}, {10}, {0}, {10} [eva] tests/value/recursion.i:54: function escaping_formal: postcondition got status valid. [eva] Recording results for escaping_formal [eva] Done for function escaping_formal [eva] computing for function f <- main. Called from tests/value/recursion.i:73. [eva] tests/value/recursion.i:28: Frama_C_show_each: {2}, {0} [eva] tests/value/recursion.i:30: Warning: recursive call during value analysis of f (f <- f :: tests/value/recursion.i:73 <- main). Assuming the call has no effect. The analysis will be unsound. [eva] computing for function f <- f <- main. Called from tests/value/recursion.i:30. [eva] using specification for function f [eva] Done for function f [eva] tests/value/recursion.i:31: Frama_C_show_each: {2}, {0} [eva] Recording results for f [eva] Done for function f [eva] tests/value/recursion.i:74: Frama_C_show_each: {2} [eva:alarm] tests/value/recursion.i:75: Warning: signed overflow. assert r.f1 + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function escaping_formal: pg ∈ {0} [eva:final-states] Values at end of function f: x ∈ {2} s ∈ [--..--] [eva:final-states] Values at end of function ff: __retres ∈ {5} [eva:final-states] Values at end of function g: [eva:final-states] Values at end of function h: [eva:final-states] Values at end of function main: G ∈ {5} x ∈ {2} s ∈ [--..--] pg ∈ {0} r.f1 ∈ [-2147483648..2147483646] .f2 ∈ [--..--] __retres ∈ [-2147483647..2147483647] [eva] User Error: Deferred error message was emitted during execution. See above messages for more information. [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/recursion2.res.oracle0000666000000000000000000000351413571573400021013 0ustar [kernel] Parsing tests/value/recursion2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] computing for function h2 <- main. Called from tests/value/recursion2.i:21. [eva] computing for function h1 <- h2 <- main. Called from tests/value/recursion2.i:17. [eva] Recording results for h1 [eva] Done for function h1 [eva] Recording results for h2 [eva] Done for function h2 [eva] computing for function h1 <- main. Called from tests/value/recursion2.i:22. [eva] computing for function h2 <- h1 <- main. Called from tests/value/recursion2.i:12. [eva] Recording results for h2 [eva] Done for function h2 [eva] Recording results for h1 [eva] Done for function h1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function h1: r ∈ {0} q ∈ {0} [eva:final-states] Values at end of function h2: r ∈ {0} q ∈ {0} [eva:final-states] Values at end of function main: [inout] Out (internal) for function h1: r; q [inout] Inputs for function h1: x; y; i; j [inout] InOut (internal) for function h1: Operational inputs: x; y; i Operational inputs on termination: x; y; i Sure outputs: r [inout] Out (internal) for function h2: r; q [inout] Inputs for function h2: x; y; i; j [inout] InOut (internal) for function h2: Operational inputs: x; y; j Operational inputs on termination: x; y; j Sure outputs: q [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: x; y [inout] InOut (internal) for function main: Operational inputs: x; y Operational inputs on termination: x; y Sure outputs: \nothing frama-c-20.0-Calcium/tests/value/oracle/reduce_by_valid.res.oracle0000666000000000000000000003316613571573400022046 0ustar [kernel] Parsing tests/value/reduce_by_valid.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..4] ∈ {0} u[0..4] ∈ {0} v ∈ [--..--] sv ∈ [--..--] vs ∈ {{ NULL ; &S_vs[0] }} S_vs[0].f1 ∈ {{ NULL ; &S_f1_0_S_vs[0] }} [1].f1 ∈ {{ NULL ; &S_f1_1_S_vs[0] }} S_f1_0_S_vs[0..1] ∈ [--..--] S_f1_1_S_vs[0..1] ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/reduce_by_valid.i:260. [eva:alarm] tests/value/reduce_by_valid.i:14: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:17: Warning: assertion got status unknown. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/reduce_by_valid.i:261. [eva:alarm] tests/value/reduce_by_valid.i:29: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:31: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:33: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:35: Warning: assertion got status unknown. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/reduce_by_valid.i:262. [eva] tests/value/reduce_by_valid.i:48: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:49: Warning: assertion got status unknown. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/reduce_by_valid.i:263. [eva:alarm] tests/value/reduce_by_valid.i:54: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:55: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:57: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:59: Warning: assertion got status unknown. [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/reduce_by_valid.i:264. [eva:locals-escaping] tests/value/reduce_by_valid.i:72: Warning: locals {x} escaping the scope of a block of main5 through p [eva] tests/value/reduce_by_valid.i:74: assertion got status valid. [eva] tests/value/reduce_by_valid.i:75: assertion got status valid. [eva] tests/value/reduce_by_valid.i:76: assertion got status valid. [eva] tests/value/reduce_by_valid.i:80: assertion got status valid. [eva] tests/value/reduce_by_valid.i:82: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:85: Warning: assertion got status unknown. [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/value/reduce_by_valid.i:265. [eva:alarm] tests/value/reduce_by_valid.i:265: Warning: function main6: precondition 'r1' got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:265: Warning: function main6: precondition 'r2' got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:265: Warning: function main6: precondition 'r3' got status unknown. [eva] tests/value/reduce_by_valid.i:265: function main6: precondition 'r4' got status valid. [eva:alarm] tests/value/reduce_by_valid.i:265: Warning: function main6: precondition 'r5' got status unknown. [eva] tests/value/reduce_by_valid.i:265: function main6: precondition 'r6' got status valid. [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/value/reduce_by_valid.i:266. [eva] tests/value/reduce_by_valid.i:111: assertion got status valid. [eva] tests/value/reduce_by_valid.i:112: assertion got status valid. [eva] tests/value/reduce_by_valid.i:113: assertion got status valid. [eva] tests/value/reduce_by_valid.i:117: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:120: Warning: assertion got status unknown. [eva] tests/value/reduce_by_valid.i:121: assertion got status valid. [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/value/reduce_by_valid.i:267. [eva:alarm] tests/value/reduce_by_valid.i:137: Warning: assertion got status unknown. [eva] tests/value/reduce_by_valid.i:138: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:141: Warning: assertion got status unknown. [eva] tests/value/reduce_by_valid.i:142: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:146: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:147: Warning: assertion got status unknown. [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/value/reduce_by_valid.i:268. [eva:alarm] tests/value/reduce_by_valid.i:162: Warning: assertion got status unknown. [eva] tests/value/reduce_by_valid.i:165: assertion got status valid. [eva] Recording results for main9 [eva] Done for function main9 [eva] computing for function main10 <- main. Called from tests/value/reduce_by_valid.i:269. [eva:alarm] tests/value/reduce_by_valid.i:176: Warning: out of bounds write. assert \valid((int *)p); [eva] tests/value/reduce_by_valid.i:177: Frama_C_show_each_main10_1: {{ &t_0 + [0..36] }} [eva] tests/value/reduce_by_valid.i:178: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:181: Warning: out of bounds write. assert \valid((int *)p + 2); [eva] tests/value/reduce_by_valid.i:182: Frama_C_show_each_main10_2: {{ &t_0 + [-8..28] }} [eva] tests/value/reduce_by_valid.i:183: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:186: Warning: out of bounds write. assert \valid((int *)(p + 2)); [eva] tests/value/reduce_by_valid.i:187: Frama_C_show_each_main10_3: {{ &t_0 + [-2..34] }} [eva] tests/value/reduce_by_valid.i:188: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:197: Warning: out of bounds write. assert \valid(&((struct s_1 *)p)->b); [eva] tests/value/reduce_by_valid.i:198: Frama_C_show_each_main10_4: {{ &t_0 + [-4..32] }} [eva] tests/value/reduce_by_valid.i:200: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:203: Warning: out of bounds write. assert \valid(&((struct s_1 *)p + 2)->b); [eva] tests/value/reduce_by_valid.i:204: Frama_C_show_each_main10_4: {{ &t_0 + [-20..16] }} [eva] tests/value/reduce_by_valid.i:206: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:210: Warning: out of bounds write. assert \valid((char *)q); [eva] tests/value/reduce_by_valid.i:211: Frama_C_show_each: {{ &u_0 + [0..79] }} [eva] tests/value/reduce_by_valid.i:213: assertion got status valid. [eva:alarm] tests/value/reduce_by_valid.i:216: Warning: out of bounds write. assert \valid((char *)q + 2); [eva] tests/value/reduce_by_valid.i:217: Frama_C_show_each: {{ &u_0 + [-2..77] }} [eva] tests/value/reduce_by_valid.i:219: assertion got status valid. [eva] Recording results for main10 [eva] Done for function main10 [eva] computing for function main11 <- main. Called from tests/value/reduce_by_valid.i:270. [eva:alarm] tests/value/reduce_by_valid.i:228: Warning: assertion got status unknown. [eva] tests/value/reduce_by_valid.i:230: Frama_C_show_each: {{ &TC + [10..410] }} [eva:alarm] tests/value/reduce_by_valid.i:231: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:237: Warning: assertion got status unknown. [eva] tests/value/reduce_by_valid.i:239: Frama_C_show_each: {{ &TU + [40..1640],0%4 }} [eva:alarm] tests/value/reduce_by_valid.i:240: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:245: Warning: assertion got status unknown. [eva] tests/value/reduce_by_valid.i:247: Frama_C_show_each: {{ &TU + [40..840] }} [eva:alarm] tests/value/reduce_by_valid.i:248: Warning: assertion got status unknown. [eva:alarm] tests/value/reduce_by_valid.i:253: Warning: assertion got status unknown. [eva] tests/value/reduce_by_valid.i:255: Frama_C_show_each: {{ &TC + [10..410],2%4 }} [eva:alarm] tests/value/reduce_by_valid.i:256: Warning: assertion got status unknown. [eva] Recording results for main11 [eva] Done for function main11 [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 12 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: t[0..2] ∈ {0} [3] ∈ {0; 1} [4] ∈ {1} p ∈ {{ &t{[0], [1]} }} q ∈ {{ &t[1] }} [eva:final-states] Values at end of function main10: t_0[0..39] ∈ [--..--] or UNINITIALIZED p ∈ {{ &t_0 + [-20..16] }} u_0[0..19]# ∈ {1} or UNINITIALIZED repeated %8 q ∈ {{ &u_0 + [-2..77] }} [eva:final-states] Values at end of function main11: p ∈ {{ &TU + [40..200] }} off ∈ [0..100] len ∈ [50..100] q ∈ {{ &TC + [10..298],2%4 }} [eva:final-states] Values at end of function main2: u[0].a ∈ {0; 1} [0].b ∈ {0; 2; 4} [1].a ∈ {0; 1; 3} [1].b ∈ {0; 2; 4} [2].a ∈ {0; 1; 3} [2].b ∈ {0; 2; 4} [3].a ∈ {0; 1; 3} [3].b ∈ {0; 2; 4} [4].a ∈ {0; 1; 3} [4].b ∈ {0; 2} p ∈ {{ &u{[0], [1], [2], [3], [4]} }} q ∈ {{ (ts *)&u{[0].b, [1].b, [2].b, [3].b, [4].b} }} r ∈ {{ (ts *)&u{[0].b, [1].b, [2].b, [3].b} }} s ∈ {{ (ts *)&u{[0].b, [1].b, [2].b, [3].b} }} [eva:final-states] Values at end of function main3: p ∈ {{ (int *)&t{[0], [1], [2], [3], [4]} }} q ∈ {{ (int *)&c2 }} [eva:final-states] Values at end of function main4: c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] p ∈ {{ (int *)&t }} q ∈ {{ &u[0] }} [eva:final-states] Values at end of function main5: q ∈ {{ &y }} p ∈ {0} r ∈ {{ &y }} or UNINITIALIZED [eva:final-states] Values at end of function main6: S_f1_0_S_vs[0] ∈ {1} [1] ∈ [--..--] [eva:final-states] Values at end of function main7: p ∈ {{ &t7_2 + [20..38996],0%4 }} [eva:final-states] Values at end of function main8: tp[0] ∈ {{ &t8_1[0] }} [1] ∈ {{ &t8_1 + [0..17179869180],0%4 }} [2] ∈ {{ &t8_2 + [0..17179869180],0%4 }} [3] ∈ {{ &t8_1 + [0..17179869180],0%4 ; &t8_2 + [0..17179869180],0%4 }} p ∈ {{ &tp[0] }} [eva:final-states] Values at end of function main9: tc[0..58] ∈ {1} or UNINITIALIZED [59..98] ∈ UNINITIALIZED [99..157] ∈ {2} or UNINITIALIZED p ∈ {{ &tc + [-8..50] }} [eva:final-states] Values at end of function main: t[0..2] ∈ {0} [3] ∈ {0; 1} [4] ∈ {1} u[0].a ∈ {0; 1} [0].b ∈ {0; 2; 4} [1].a ∈ {0; 1; 3} [1].b ∈ {0; 2; 4} [2].a ∈ {0; 1; 3} [2].b ∈ {0; 2; 4} [3].a ∈ {0; 1; 3} [3].b ∈ {0; 2; 4} [4].a ∈ {0; 1; 3} [4].b ∈ {0; 2} S_f1_0_S_vs[0] ∈ {1} [1] ∈ [--..--] [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main10 [from] Done for function main10 [from] Computing for function main11 [from] Done for function main11 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8 [from] Done for function main8 [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: t[3] FROM v (and SELF) [4] FROM v [from] Function main10: NO EFFECTS [from] Function main11: NO EFFECTS [from] Function main2: u[0..4] FROM v (and SELF) [from] Function main3: NO EFFECTS [from] Function main4: NO EFFECTS [from] Function main5: NO EFFECTS [from] Function main6: S_f1_0_S_vs[0] FROM p; S_vs[0] [from] Function main7: NO EFFECTS [from] Function main8: NO EFFECTS [from] Function main9: NO EFFECTS [from] Function main: t[3] FROM v (and SELF) [4] FROM v u[0..4] FROM v (and SELF) S_f1_0_S_vs[0] FROM vs; S_vs[0] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: t[3..4]; p; q [inout] Inputs for function main1: v [inout] Out (internal) for function main10: t_0[0..39]; p; u_0[0..19]; q [inout] Inputs for function main10: sv [inout] Out (internal) for function main11: p; off; len; q [inout] Inputs for function main11: v [inout] Out (internal) for function main2: u[0..4]; p; q; r; s [inout] Inputs for function main2: v [inout] Out (internal) for function main3: p; q [inout] Inputs for function main3: \nothing [inout] Out (internal) for function main4: c1; c2; c3; c4; p; q [inout] Inputs for function main4: \nothing [inout] Out (internal) for function main5: q; p; r; x [inout] Inputs for function main5: v [inout] Out (internal) for function main6: S_f1_0_S_vs[0] [inout] Inputs for function main6: S_vs[0] [inout] Out (internal) for function main7: p [inout] Inputs for function main7: v [inout] Out (internal) for function main8: tp[0..3]; p [inout] Inputs for function main8: v [inout] Out (internal) for function main9: tc{[0..58]; [99..157]}; p [inout] Inputs for function main9: v [inout] Out (internal) for function main: t[3..4]; u[0..4]; S_f1_0_S_vs[0] [inout] Inputs for function main: v; sv; vs; S_vs[0] frama-c-20.0-Calcium/tests/value/oracle/reduce_formals.res.oracle0000666000000000000000000001562613571573400021721 0ustar [kernel] Parsing tests/value/reduce_formals.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/reduce_formals.i:69. [eva:alarm] tests/value/reduce_formals.i:2: Warning: assertion got status unknown. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/reduce_formals.i:70. [eva] using specification for function main2 [eva:alarm] tests/value/reduce_formals.i:70: Warning: function main2: precondition got status unknown. [eva] Done for function main2 [eva] tests/value/reduce_formals.i:72: Frama_C_dump_each: # Cvalue domain: g ∈ [--..--] v ∈ [--..--] w ∈ [6..2147483647] x ∈ [5..2147483647] y ∈ [--..--] z ∈ [8..2147483647] ==END OF DUMP== [eva] computing for function main3 <- main. Called from tests/value/reduce_formals.i:75. [eva] tests/value/reduce_formals.i:18: assertion got status valid. [eva] computing for function f_main3 <- main3 <- main. Called from tests/value/reduce_formals.i:19. [eva] Recording results for f_main3 [eva] Done for function f_main3 [eva] tests/value/reduce_formals.i:20: Frama_C_show_each: {6} [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/reduce_formals.i:76. [eva] computing for function f_main4_1 <- main4 <- main. Called from tests/value/reduce_formals.i:33. [eva:alarm] tests/value/reduce_formals.i:24: Warning: assertion got status unknown. [eva] Recording results for f_main4_1 [eva] Done for function f_main4_1 [eva] tests/value/reduce_formals.i:34: Frama_C_show_each_v: {10; 11; 12; 13; 14; 15} [eva] computing for function f_main4_2 <- main4 <- main. Called from tests/value/reduce_formals.i:36. [eva:alarm] tests/value/reduce_formals.i:28: Warning: assertion got status unknown. [eva] Recording results for f_main4_2 [eva] Done for function f_main4_2 [eva] tests/value/reduce_formals.i:37: Frama_C_show_each_v: {16; 17; 18; 19; 20} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/reduce_formals.i:77. [eva] computing for function f_main_1 <- main5 <- main. Called from tests/value/reduce_formals.i:52. [eva] computing for function f_main_2 <- f_main_1 <- main5 <- main. Called from tests/value/reduce_formals.i:47. [eva] Recording results for f_main_2 [eva] Done for function f_main_2 [eva] Recording results for f_main_1 [eva] Done for function f_main_1 [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/value/reduce_formals.i:78. [eva:alarm] tests/value/reduce_formals.i:63: Warning: assertion got status unknown. [eva] computing for function f_main6 <- main6 <- main. Called from tests/value/reduce_formals.i:64. [eva:alarm] tests/value/reduce_formals.i:58: Warning: assertion got status unknown. [eva] Recording results for f_main6 [eva] Done for function f_main6 [eva] tests/value/reduce_formals.i:65: Frama_C_show_each_6: {3} [eva] Recording results for main6 [eva] Done for function main6 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f_main3: x ∈ {6} [eva:final-states] Values at end of function f_main4_1: [eva:final-states] Values at end of function f_main4_2: [eva:final-states] Values at end of function f_main6: g ∈ {3} [eva:final-states] Values at end of function f_main_2: __retres ∈ {0} [eva:final-states] Values at end of function f_main_1: v ∈ {0} [eva:final-states] Values at end of function main1: j ∈ [-306783375..306783381] [eva:final-states] Values at end of function main3: x ∈ {6} p ∈ {{ &x }} [eva:final-states] Values at end of function main4: [eva:final-states] Values at end of function main5: l ∈ {2} [eva:final-states] Values at end of function main6: g ∈ {3} [eva:final-states] Values at end of function main: g ∈ {3} [from] Computing for function f_main3 [from] Done for function f_main3 [from] Computing for function f_main4_1 [from] Done for function f_main4_1 [from] Computing for function f_main4_2 [from] Done for function f_main4_2 [from] Computing for function f_main6 [from] Done for function f_main6 [from] Computing for function f_main_2 [from] Done for function f_main_2 [from] Computing for function f_main_1 [from] Done for function f_main_1 [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main [from] Computing for function main2 <-main [from] Done for function main2 [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f_main3: x FROM p; a; x [from] Function f_main4_1: NO EFFECTS [from] Function f_main4_2: NO EFFECTS [from] Function f_main6: g FROM \nothing [from] Function f_main_2: \result FROM \nothing [from] Function f_main_1: NO EFFECTS [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function main3: NO EFFECTS [from] Function main4: NO EFFECTS [from] Function main5: NO EFFECTS [from] Function main6: g FROM \nothing [from] Function main: g FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f_main3: x [inout] Inputs for function f_main3: x [inout] Out (internal) for function f_main4_1: \nothing [inout] Inputs for function f_main4_1: \nothing [inout] Out (internal) for function f_main4_2: \nothing [inout] Inputs for function f_main4_2: \nothing [inout] Out (internal) for function f_main6: g [inout] Inputs for function f_main6: \nothing [inout] Out (internal) for function f_main_2: __retres [inout] Inputs for function f_main_2: \nothing [inout] Out (internal) for function f_main_1: v [inout] Inputs for function f_main_1: \nothing [inout] Out (internal) for function main1: j [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main3: x; p [inout] Inputs for function main3: \nothing [inout] Out (internal) for function main4: \nothing [inout] Inputs for function main4: \nothing [inout] Out (internal) for function main5: l [inout] Inputs for function main5: \nothing [inout] Out (internal) for function main6: g [inout] Inputs for function main6: g [inout] Out (internal) for function main: g [inout] Inputs for function main: g frama-c-20.0-Calcium/tests/value/oracle/reduce_index.res.oracle0000666000000000000000000003532613571573400021364 0ustar [kernel] Parsing tests/value/reduce_index.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ {0} u[0..10] ∈ {0} maybe ∈ [--..--] c1 ∈ [--..--] c2 ∈ [--..--] c3 ∈ [--..--] c4 ∈ [--..--] c5 ∈ [--..--] c6 ∈ [--..--] c7 ∈ [--..--] c8 ∈ [--..--] c9 ∈ [--..--] c10 ∈ [--..--] c11 ∈ [--..--] c12 ∈ [--..--] ts[0..9] ∈ {0} p8 ∈ {0} ti_4[0..3] ∈ {0} ti_7[0..6] ∈ {0} k1 ∈ [--..--] k2 ∈ [--..--] k3 ∈ [--..--] k4 ∈ [--..--] nulli ∈ [--..--] [eva] computing for function f1 <- main. Called from tests/value/reduce_index.i:130. [eva] computing for function f1_aux <- f1 <- main. Called from tests/value/reduce_index.i:11. [eva] Recording results for f1_aux [eva] Done for function f1_aux [eva:alarm] tests/value/reduce_index.i:11: Warning: accessing out of bounds index. assert 0 ≤ c1; [eva:alarm] tests/value/reduce_index.i:11: Warning: accessing out of bounds index. assert c1 < 10; [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/value/reduce_index.i:131. [eva:alarm] tests/value/reduce_index.i:17: Warning: accessing out of bounds index. assert 0 ≤ c2; [eva:alarm] tests/value/reduce_index.i:17: Warning: accessing out of bounds index. assert c2 < 10; [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/value/reduce_index.i:132. [eva:alarm] tests/value/reduce_index.i:21: Warning: accessing out of bounds index. assert 0 ≤ c3; [eva:alarm] tests/value/reduce_index.i:21: Warning: accessing out of bounds index. assert c3 < 10; [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/value/reduce_index.i:133. [eva:alarm] tests/value/reduce_index.i:27: Warning: accessing out of bounds index. assert 0 ≤ c4; [eva:alarm] tests/value/reduce_index.i:27: Warning: accessing out of bounds index. assert c4 < 10; [eva] Recording results for f4 [eva] Done for function f4 [eva] computing for function f5 <- main. Called from tests/value/reduce_index.i:134. [eva:alarm] tests/value/reduce_index.i:35: Warning: accessing out of bounds index. assert 0 ≤ c5; [eva:alarm] tests/value/reduce_index.i:35: Warning: accessing out of bounds index. assert c5 < 10; [eva] Recording results for f5 [eva] Done for function f5 [eva] computing for function f6 <- main. Called from tests/value/reduce_index.i:135. [eva:alarm] tests/value/reduce_index.i:42: Warning: accessing out of bounds index. assert 0 ≤ c6; [eva:alarm] tests/value/reduce_index.i:42: Warning: accessing out of bounds index. assert c6 < 11; [eva:alarm] tests/value/reduce_index.i:42: Warning: accessing out of bounds index. assert c6 < 10; [eva] Recording results for f6 [eva] Done for function f6 [eva] computing for function f7 <- main. Called from tests/value/reduce_index.i:136. [eva:alarm] tests/value/reduce_index.i:48: Warning: accessing out of bounds index. assert 0 ≤ c7; [eva:alarm] tests/value/reduce_index.i:48: Warning: accessing out of bounds index. assert c7 < 10; [eva] Recording results for f7 [eva] Done for function f7 [eva] computing for function f8 <- main. Called from tests/value/reduce_index.i:137. [eva:alarm] tests/value/reduce_index.i:64: Warning: out of bounds write. assert \valid(&p8->f1); [eva] Recording results for f8 [eva] Done for function f8 [eva] computing for function f9 <- main. Called from tests/value/reduce_index.i:138. [eva:alarm] tests/value/reduce_index.i:72: Warning: accessing out of bounds index. assert 0 ≤ c9; [eva:alarm] tests/value/reduce_index.i:72: Warning: accessing out of bounds index. assert c9 < 10; [eva] Recording results for f9 [eva] Done for function f9 [eva] computing for function f10 <- main. Called from tests/value/reduce_index.i:139. [eva:alarm] tests/value/reduce_index.i:86: Warning: accessing out of bounds index. assert 0 ≤ c10; [eva:alarm] tests/value/reduce_index.i:86: Warning: accessing out of bounds index. assert c10 < 7; [eva] Recording results for f10 [eva] Done for function f10 [eva] computing for function f11 <- main. Called from tests/value/reduce_index.i:140. [eva:alarm] tests/value/reduce_index.i:93: Warning: accessing out of bounds index. assert 0 ≤ c11; [eva:alarm] tests/value/reduce_index.i:93: Warning: accessing out of bounds index. assert c11 < 7; [eva:alarm] tests/value/reduce_index.i:93: Warning: out of bounds write. assert \valid(&(*p7)[c11]); [eva] Recording results for f11 [eva] Done for function f11 [eva] computing for function f12 <- main. Called from tests/value/reduce_index.i:141. [eva:alarm] tests/value/reduce_index.i:100: Warning: accessing out of bounds index. assert 0 ≤ c12; [eva:alarm] tests/value/reduce_index.i:100: Warning: accessing out of bounds index. assert c12 < 4; [eva] Recording results for f12 [eva] Done for function f12 [eva] computing for function pointer_index <- main. Called from tests/value/reduce_index.i:143. [eva:alarm] tests/value/reduce_index.i:110: Warning: out of bounds read. assert \valid_read(p + k1); [eva:alarm] tests/value/reduce_index.i:113: Warning: out of bounds read. assert \valid_read(p + k2); [eva:alarm] tests/value/reduce_index.i:116: Warning: out of bounds read. assert \valid_read(p + k3); [eva:alarm] tests/value/reduce_index.i:119: Warning: out of bounds read. assert \valid_read(p + k4); [eva] Recording results for pointer_index [eva] Done for function pointer_index [eva] computing for function null_index <- main. Called from tests/value/reduce_index.i:144. [eva:alarm] tests/value/reduce_index.i:126: Warning: out of bounds write. assert \valid((int *)0 + nulli); [kernel] tests/value/reduce_index.i:126: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for null_index [eva] Done for function null_index [eva] Recording results for main [eva] done for function main [eva] tests/value/reduce_index.i:126: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f10: c10 ∈ {0; 1; 2; 3; 4; 5; 6} ti_7[0..6] ∈ {0; 10} p7 ∈ {{ &ti_7 }} [eva:final-states] Values at end of function f11: c11 ∈ {0; 1; 2; 3} ti_4[0..3] ∈ {0; 11} p4 ∈ {{ &ti_4 }} p7 ∈ {{ (ti7 *)&ti_4 }} [eva:final-states] Values at end of function f12: c12 ∈ {0; 1; 2; 3} ti_7[0..3] ∈ {0; 10; 12} [4..6] ∈ {0; 10} p7 ∈ {{ &ti_7 }} p4 ∈ {{ (ti4 *)&ti_7 }} [eva:final-states] Values at end of function f1_aux: __retres ∈ {1} [eva:final-states] Values at end of function f1: t[0..9] ∈ {0; 1} c1 ∈ [0..9] [eva:final-states] Values at end of function f2: c2 ∈ [0..9] __retres ∈ {0; 1} [eva:final-states] Values at end of function f3: c3 ∈ [0..9] __retres ∈ {0} [eva:final-states] Values at end of function f4: c4 ∈ [0..9] __retres ∈ {0} [eva:final-states] Values at end of function f5: c5 ∈ [0..9] c ∈ {0; 1} __retres ∈ {0} [eva:final-states] Values at end of function f6: t[0..9] ∈ {0; 1} u[0..10] ∈ {0; 1} c6 ∈ [0..9] [eva:final-states] Values at end of function f7: t[0..9] ∈ {0; 1} u[0..10] ∈ {0; 1} c7 ∈ [0..9] [eva:final-states] Values at end of function f8: c8 ∈ [--..--] ts[0].f1 ∈ {0; 1} [0].f2 ∈ {0; 2} [1].f1 ∈ {0; 1} [1].f2 ∈ {0; 2} [2].f1 ∈ {0; 1} [2].f2 ∈ {0; 2} [3].f1 ∈ {0; 1} [3].f2 ∈ {0; 2} [4].f1 ∈ {0; 1} [4].f2 ∈ {0; 2} [5].f1 ∈ {0; 1} [5].f2 ∈ {0; 2} [6].f1 ∈ {0; 1} [6].f2 ∈ {0; 2} [7].f1 ∈ {0; 1} [7].f2 ∈ {0; 2} [8].f1 ∈ {0; 1} [8].f2 ∈ {0; 2} [9].f1 ∈ {0; 1} [9].f2 ∈ {0; 2} p8 ∈ {{ &ts + [0..72],0%8 }} __retres ∈ {0} [eva:final-states] Values at end of function f9: c9 ∈ [0..9] ts[0].f1 ∈ {0; 1} [0].f2 ∈ {0; 2} [1].f1 ∈ {0; 1} [1].f2 ∈ {0; 2} [2].f1 ∈ {0; 1} [2].f2 ∈ {0; 2} [3].f1 ∈ {0; 1} [3].f2 ∈ {0; 2} [4].f1 ∈ {0; 1} [4].f2 ∈ {0; 2} [5].f1 ∈ {0; 1} [5].f2 ∈ {0; 2} [6].f1 ∈ {0; 1} [6].f2 ∈ {0; 2} [7].f1 ∈ {0; 1} [7].f2 ∈ {0; 2} [8].f1 ∈ {0; 1} [8].f2 ∈ {0; 2} [9].f1 ∈ {0; 1} [9].f2 ∈ {0; 2} __retres ∈ {0} [eva:final-states] Values at end of function null_index: NON TERMINATING FUNCTION [eva:final-states] Values at end of function pointer_index: k1 ∈ [0..10] k2 ∈ [-1..8] k3 ∈ [-2..7] k4 ∈ [-3..7] p ∈ {{ &u[3] }} l ∈ {0; 1} [eva:final-states] Values at end of function main: t[0..9] ∈ {0; 1} u[0..10] ∈ {0; 1} c1 ∈ [0..9] c2 ∈ [0..9] c3 ∈ [0..9] c4 ∈ [0..9] c5 ∈ [0..9] c6 ∈ [0..9] c7 ∈ [0..9] c8 ∈ [--..--] c9 ∈ [0..9] c10 ∈ {0; 1; 2; 3; 4; 5; 6} c11 ∈ {0; 1; 2; 3} c12 ∈ {0; 1; 2; 3} ts[0].f1 ∈ {0; 1} [0].f2 ∈ {0; 2} [1].f1 ∈ {0; 1} [1].f2 ∈ {0; 2} [2].f1 ∈ {0; 1} [2].f2 ∈ {0; 2} [3].f1 ∈ {0; 1} [3].f2 ∈ {0; 2} [4].f1 ∈ {0; 1} [4].f2 ∈ {0; 2} [5].f1 ∈ {0; 1} [5].f2 ∈ {0; 2} [6].f1 ∈ {0; 1} [6].f2 ∈ {0; 2} [7].f1 ∈ {0; 1} [7].f2 ∈ {0; 2} [8].f1 ∈ {0; 1} [8].f2 ∈ {0; 2} [9].f1 ∈ {0; 1} [9].f2 ∈ {0; 2} p8 ∈ {{ &ts + [0..72],0%8 }} ti_4[0..3] ∈ {0; 11} ti_7[0..3] ∈ {0; 10; 12} [4..6] ∈ {0; 10} k1 ∈ [0..10] k2 ∈ [-1..8] k3 ∈ [-2..7] k4 ∈ [-3..7] [from] Computing for function f10 [from] Done for function f10 [from] Computing for function f11 [from] Done for function f11 [from] Computing for function f12 [from] Done for function f12 [from] Computing for function f1_aux [from] Done for function f1_aux [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function f9 [from] Done for function f9 [from] Computing for function null_index [from] Non-terminating function null_index (no dependencies) [from] Done for function null_index [from] Computing for function pointer_index [from] Done for function pointer_index [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f10: c10 FROM c10 ti_7[0..6] FROM c10 (and SELF) [from] Function f11: c11 FROM c11 ti_4[0..3] FROM c11 (and SELF) [from] Function f12: c12 FROM c12 ti_7[0..3] FROM c12 (and SELF) [from] Function f1_aux: \result FROM \nothing [from] Function f1: t[0..9] FROM c1 (and SELF) c1 FROM c1 [from] Function f2: c2 FROM c2 \result FROM t[0..9]; c2 [from] Function f3: c3 FROM c3 \result FROM \nothing [from] Function f4: c4 FROM c4 \result FROM \nothing [from] Function f5: c5 FROM c5 \result FROM \nothing [from] Function f6: t[0..9] FROM t[0..9]; u[0..9]; c6 (and SELF) u[0..10] FROM t[0..9]; c6 (and SELF) c6 FROM c6 [from] Function f7: t[0..9] FROM u[0..10]; c7 (and SELF) u[0..9] FROM t[0..9]; u[0..10]; c7 (and SELF) c7 FROM c7 [from] Function f8: c8 FROM c8 ts[0..9] FROM c8 (and SELF) p8 FROM c8 \result FROM \nothing [from] Function f9: c9 FROM c9 ts{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1} FROM c9 (and SELF) \result FROM \nothing [from] Function null_index: NON TERMINATING - NO EFFECTS [from] Function pointer_index: k1 FROM k1 k2 FROM k2 k3 FROM k3 k4 FROM k4 [from] Function main: t[0..9] FROM t[0..9]; u[0..10]; c1; c6; c7 (and SELF) u[0..9] FROM t[0..9]; u[0..10]; c1; c6; c7 (and SELF) [10] FROM t[0..9]; c1; c6 (and SELF) c1 FROM c1 c2 FROM c2 c3 FROM c3 c4 FROM c4 c5 FROM c5 c6 FROM c6 c7 FROM c7 c8 FROM c8 c9 FROM c9 c10 FROM c10 c11 FROM c11 c12 FROM c12 ts{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1} FROM c8; c9 (and SELF) {[0].f2; [1].f2; [2].f2; [3].f2; [4].f2; [5].f2; [6].f2; [7].f2; [8].f2; [9].f2} FROM c8 (and SELF) p8 FROM c8 ti_4[0..3] FROM c11 (and SELF) ti_7[0..3] FROM c10; c12 (and SELF) [4..6] FROM c10 (and SELF) k1 FROM k1 k2 FROM k2 k3 FROM k3 k4 FROM k4 [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f10: c10; ti_7[0..6]; p7 [inout] Inputs for function f10: c10 [inout] Out (internal) for function f11: c11; ti_4[0..3]; p4; p7 [inout] Inputs for function f11: c11 [inout] Out (internal) for function f12: c12; ti_7[0..3]; p7; p4 [inout] Inputs for function f12: c12 [inout] Out (internal) for function f1_aux: __retres [inout] Inputs for function f1_aux: \nothing [inout] Out (internal) for function f1: t[0..9]; c1 [inout] Inputs for function f1: c1 [inout] Out (internal) for function f2: c2; __retres [inout] Inputs for function f2: t[0..9]; c2 [inout] Out (internal) for function f3: c3; tmp; __retres [inout] Inputs for function f3: t[0..9]; c3 [inout] Out (internal) for function f4: c4; x; __retres [inout] Inputs for function f4: t[0..9]; c4 [inout] Out (internal) for function f5: c5; c; __retres [inout] Inputs for function f5: t[0..9]; c5 [inout] Out (internal) for function f6: t[0..9]; u[0..10]; c6 [inout] Inputs for function f6: t[0..9]; u[0..9]; c6 [inout] Out (internal) for function f7: t[0..9]; u[0..9]; c7 [inout] Inputs for function f7: t[0..9]; u[0..10]; c7 [inout] Out (internal) for function f8: c8; ts[0..9]; p8; __retres [inout] Inputs for function f8: c8; p8 [inout] Out (internal) for function f9: c9; ts{[0].f1; [1].f1; [2].f1; [3].f1; [4].f1; [5].f1; [6].f1; [7].f1; [8].f1; [9].f1}; __retres [inout] Inputs for function f9: c9 [inout] Out (internal) for function null_index: \nothing [inout] Inputs for function null_index: nulli [inout] Out (internal) for function pointer_index: k1; k2; k3; k4; p; l [inout] Inputs for function pointer_index: u[0..10]; k1; k2; k3; k4 [inout] Out (internal) for function main: t[0..9]; u[0..10]; c1; c2; c3; c4; c5; c6; c7; c8; c9; c10; c11; c12; ts[0..9]; p8; ti_4[0..3]; ti_7[0..6]; k1; k2; k3; k4 [inout] Inputs for function main: t[0..9]; u[0..10]; maybe; c1; c2; c3; c4; c5; c6; c7; c8; c9; c10; c11; c12; p8; k1; k2; k3; k4; nulli frama-c-20.0-Calcium/tests/value/oracle/reduce_valid.res.oracle0000666000000000000000000000351513571573400021347 0ustar [kernel] Parsing tests/value/reduce_valid.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..1] ∈ {0} u[0..1] ∈ {0} p ∈ {0} q ∈ {0} r ∈ {0} A ∈ {0} offs ∈ {0} [eva:alarm] tests/value/reduce_valid.i:9: Warning: out of bounds write. assert \valid(p); [eva] tests/value/reduce_valid.i:16: Frama_C_show_each_ici: {0} [eva:alarm] tests/value/reduce_valid.i:17: Warning: out of bounds write. assert \valid(q); [kernel] tests/value/reduce_valid.i:17: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/value/reduce_valid.i:24: Warning: out of bounds read. assert \valid_read(r + offs); [eva] tests/value/reduce_valid.i:25: Frama_C_show_each_r: {{ &t }} [eva:alarm] tests/value/reduce_valid.i:26: Warning: accessing out of bounds index. assert (int)((int)h + 1) < 2; [eva] Recording results for main [eva] done for function main [eva] tests/value/reduce_valid.i:17: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0] ∈ {4} [1] ∈ {3} u[0] ∈ {0} [1] ∈ {1} p ∈ {{ &t[0] }} q ∈ {0} r ∈ {{ &t[0] }} A ∈ {3} offs ∈ {1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[0..1] FROM c u[1] FROM h p FROM c q FROM \nothing r FROM e; f A FROM c; e; f; g offs FROM g [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[0..1]; u[1]; p; q; r; A; offs; tmp [inout] Inputs for function main: t[1]; p; q; r; offs frama-c-20.0-Calcium/tests/value/oracle/redundant_alarms.res.oracle0000666000000000000000000001446613571573400022253 0ustar [kernel] Parsing tests/value/redundant_alarms.c (with preprocessing) [slicing] slicing requests in progress... [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/redundant_alarms.c:62. [eva:alarm] tests/value/redundant_alarms.c:11: Warning: accessing uninitialized left-value. assert \initialized(p); [eva:alarm] tests/value/redundant_alarms.c:12: Warning: accessing uninitialized left-value. assert \initialized(p); [eva:alarm] tests/value/redundant_alarms.c:15: Warning: accessing uninitialized left-value. assert \initialized(p); [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/redundant_alarms.c:63. [eva:alarm] tests/value/redundant_alarms.c:20: Warning: accessing out of bounds index. assert 0 ≤ i; [eva:alarm] tests/value/redundant_alarms.c:20: Warning: accessing out of bounds index. assert i < 10; [eva:alarm] tests/value/redundant_alarms.c:21: Warning: accessing uninitialized left-value. assert \initialized(&t[i]); [eva:alarm] tests/value/redundant_alarms.c:22: Warning: accessing uninitialized left-value. assert \initialized(&t[i]); [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/redundant_alarms.c:64. [eva:alarm] tests/value/redundant_alarms.c:64: Warning: function main3: precondition got status unknown. [eva:alarm] tests/value/redundant_alarms.c:31: Warning: accessing uninitialized left-value. assert \initialized(&t[i]); [eva:alarm] tests/value/redundant_alarms.c:31: Warning: accessing uninitialized left-value. assert \initialized(&t[j]); [eva:alarm] tests/value/redundant_alarms.c:32: Warning: accessing uninitialized left-value. assert \initialized(&t[j]); [eva:alarm] tests/value/redundant_alarms.c:33: Warning: accessing uninitialized left-value. assert \initialized(&t[i]); [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/redundant_alarms.c:65. [eva:alarm] tests/value/redundant_alarms.c:41: Warning: assertion got status unknown. [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/redundant_alarms.c:66. [eva] tests/value/redundant_alarms.c:55: assertion got status valid. [eva:locals-escaping] tests/value/redundant_alarms.c:55: Warning: locals {x} escaping the scope of a block of main5 through p [eva:alarm] tests/value/redundant_alarms.c:58: Warning: assertion got status unknown. [eva] Recording results for main5 [eva] Done for function main5 [eva] Recording results for main [eva] done for function main [eva] tests/value/redundant_alarms.c:15: assertion 'Eva,initialization' got final status invalid. [scope:rm_asserts] removing 3 assertion(s) [scope:rm_asserts] tests/value/redundant_alarms.c:12: removing redundant assert Eva: initialization: \initialized(p); [scope:rm_asserts] tests/value/redundant_alarms.c:32: removing redundant assert Eva: initialization: \initialized(&t[j]); [scope:rm_asserts] tests/value/redundant_alarms.c:33: removing redundant assert Eva: initialization: \initialized(&t[i]); [slicing] initializing slicing ... [slicing] interpreting slicing requests from the command line... [pdg] computing for function main1 [pdg] done for function main1 [slicing] applying all slicing requests... [slicing] applying 0 actions... [slicing] applying all slicing requests... [slicing] applying 1 actions... [slicing] applying actions: 1/1... [pdg] computing for function main [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Non-terminating function main4 (no dependencies) [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [pdg] done for function main [slicing] exporting project to 'Slicing export'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Slicing export tmp' [sparecode] removed unused global declarations in new project 'Slicing export' /* Generated by Frama-C */ int volatile v; void main1(int c) { int x; int y; int t; int *tmp; if (c) tmp = & x; else tmp = & y; int *p = tmp; *p = 1; /*@ assert Eva: initialization: \initialized(p); */ int z = *p + 1; /*@ assert Eva: initialization: \initialized(p); */ int w = *p + 2; x = t; y = t; x = t; if (v) /*@ assert Eva: initialization: \initialized(p); */ z = *p + 2; return; } void main2(int i) { int t[10]; /*@ assert Eva: index_bound: 0 ≤ i; */ /*@ assert Eva: index_bound: i < 10; */ t[i] = 1; /*@ assert Eva: initialization: \initialized(&t[i]); */ t[i] += 3; /*@ assert Eva: initialization: \initialized(&t[i]); */ t[i] += 5; return; } /*@ requires i < 10 ∧ j < 10; */ void main3(unsigned int i, unsigned int j) { int t[10]; if (v) t[i] = v; /*@ assert Eva: initialization: \initialized(&t[i]); */ /*@ assert Eva: initialization: \initialized(&t[j]); */ if (t[i] < t[j]) { /*@ assert Eva: initialization: \initialized(&t[j]); */ int tmp = t[j]; /*@ assert Eva: initialization: \initialized(&t[i]); */ t[j] = t[i]; t[i] = tmp; } return; } void main4(int i) { while (1) { { int j = 0; /*@ assert i ≤ 0; */ ; int k = 0; int z = 0; int w = 0; } } return; } void main5(void) { int *p; { int x; p = & x; *p = 1; /*@ assert *p ≡ 1; */ ; } /*@ assert *p ≡ 1; */ ; return; } void main(void) { if (v) main1(v); main2(v); main3((unsigned int)v,(unsigned int)v); if (v) main4(v); main5(); return; } /* Generated by Frama-C */ int volatile v; void main1_slice_1(int c) { int x; int y; int t; int *tmp; if (c) tmp = & x; else tmp = & y; int *p = tmp; *p = 1; int z = *p + 1; int w = *p + 2; y = t; x = t; if (v) z = *p + 2; return; } void main(void) { if (v) main1_slice_1(v); return; } frama-c-20.0-Calcium/tests/value/oracle/reevaluate_alarms.res.oracle0000666000000000000000000002462013571573400022415 0ustar [kernel] Parsing tests/value/reevaluate_alarms.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ {0} T[0..4] ∈ {0} n ∈ {1} [eva] computing for function loop <- main. Called from tests/value/reevaluate_alarms.i:34. [eva] tests/value/reevaluate_alarms.i:13: starting to merge loop iterations [eva:alarm] tests/value/reevaluate_alarms.i:14: Warning: signed overflow. assert S + i ≤ 2147483647; [eva:alarm] tests/value/reevaluate_alarms.i:14: Warning: out of bounds write. assert \valid(tmp); (tmp from p++) [eva] Recording results for loop [eva] Done for function loop [eva] computing for function compute_n <- main. Called from tests/value/reevaluate_alarms.i:36. [eva] tests/value/reevaluate_alarms.i:19: starting to merge loop iterations [eva:alarm] tests/value/reevaluate_alarms.i:20: Warning: signed overflow. assert n * i ≤ 2147483647; [eva] Recording results for compute_n [eva] Done for function compute_n [eva] computing for function init_p <- main. Called from tests/value/reevaluate_alarms.i:40. [eva] Recording results for init_p [eva] Done for function init_p [eva] computing for function initialized_p <- main. Called from tests/value/reevaluate_alarms.i:41. [eva:alarm] tests/value/reevaluate_alarms.i:30: Warning: accessing uninitialized left-value. assert \initialized(p); [eva] Recording results for initialized_p [eva] Done for function initialized_p [eva] computing for function init_p <- main. Called from tests/value/reevaluate_alarms.i:43. [eva] Recording results for init_p [eva] Done for function init_p [eva] computing for function initialized_p <- main. Called from tests/value/reevaluate_alarms.i:44. [eva] Recording results for initialized_p [eva] Done for function initialized_p [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function compute_n: n ∈ [1..2147483647] i ∈ {6} [eva:final-states] Values at end of function init_p: x ∈ {0} or UNINITIALIZED y ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function initialized_p: x ∈ {1} [eva:final-states] Values at end of function loop: S ∈ [0..2147483647] T[0..4] ∈ [0..2147483647] i ∈ {5} p ∈ {{ &T + [0..--],0%4 }} [eva:final-states] Values at end of function main: S ∈ [0..2147483647] T[0..4] ∈ [0..2147483647] n ∈ [1..2147483647] x ∈ {0} y ∈ {0} __retres ∈ {0} [from] Computing for function compute_n [from] Done for function compute_n [from] Computing for function init_p [from] Done for function init_p [from] Computing for function initialized_p [from] Done for function initialized_p [from] Computing for function loop [from] Done for function loop [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function compute_n: n FROM n (and SELF) [from] Function init_p: x FROM n; p (and SELF) y FROM n; p (and SELF) [from] Function initialized_p: NO EFFECTS [from] Function loop: S FROM S (and SELF) T[0..4] FROM S (and SELF) \result FROM S [from] Function main: S FROM S (and SELF) T[0..4] FROM S (and SELF) n FROM n (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function compute_n: n; i [inout] Inputs for function compute_n: n [inout] Out (internal) for function init_p: x; y [inout] Inputs for function init_p: n [inout] Out (internal) for function initialized_p: x [inout] Inputs for function initialized_p: x; y [inout] Out (internal) for function loop: S; T[0..4]; i; p; tmp [inout] Inputs for function loop: S [inout] Out (internal) for function main: S; T[0..4]; n; x; y; __retres [inout] Inputs for function main: S; n [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'loop' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_overflow' (file tests/value/reevaluate_alarms.i, line 14) tried with Eva. [ - ] Assertion 'Eva,mem_access' (file tests/value/reevaluate_alarms.i, line 14) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'compute_n' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,signed_overflow' (file tests/value/reevaluate_alarms.i, line 20) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'initialized_p' -------------------------------------------------------------------------------- [ - ] Assertion 'Eva,initialization' (file tests/value/reevaluate_alarms.i, line 30) tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 To be validated 4 Total -------------------------------------------------------------------------------- [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization S ∈ {0} T[0..4] ∈ {0} n ∈ {1} [eva] computing for function loop <- main. Called from tests/value/reevaluate_alarms.i:34. [eva] Recording results for loop [eva] Done for function loop [eva] computing for function compute_n <- main. Called from tests/value/reevaluate_alarms.i:36. [eva] Recording results for compute_n [eva] Done for function compute_n [eva] computing for function init_p <- main. Called from tests/value/reevaluate_alarms.i:40. [eva] Recording results for init_p [eva] Done for function init_p [eva] computing for function initialized_p <- main. Called from tests/value/reevaluate_alarms.i:41. [eva] Recording results for initialized_p [eva] Done for function initialized_p [eva] computing for function init_p <- main. Called from tests/value/reevaluate_alarms.i:43. [eva] Recording results for init_p [eva] Done for function init_p [eva] computing for function initialized_p <- main. Called from tests/value/reevaluate_alarms.i:44. [eva] Recording results for initialized_p [eva] Done for function initialized_p [eva] Recording results for main [eva] done for function main [eva] tests/value/reevaluate_alarms.i:14: assertion 'Eva,signed_overflow' got final status valid. [eva] tests/value/reevaluate_alarms.i:14: assertion 'Eva,mem_access' got final status valid. [eva] tests/value/reevaluate_alarms.i:20: assertion 'Eva,signed_overflow' got final status valid. [eva] tests/value/reevaluate_alarms.i:30: assertion 'Eva,initialization' got final status valid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function compute_n: n ∈ {120} i ∈ {6} [eva:final-states] Values at end of function init_p: x ∈ {0} y ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function initialized_p: x ∈ {1} [eva:final-states] Values at end of function loop: S ∈ {10} T[0] ∈ {0} [1] ∈ {1} [2] ∈ {3} [3] ∈ {6} [4] ∈ {10} i ∈ {5} p ∈ {{ &T[5] }} [eva:final-states] Values at end of function main: S ∈ {10} T[0] ∈ {0} [1] ∈ {1} [2] ∈ {3} [3] ∈ {6} [4] ∈ {10} n ∈ {120} x ∈ {0} y ∈ {0} __retres ∈ {0} [from] Computing for function compute_n [from] Done for function compute_n [from] Computing for function init_p [from] Done for function init_p [from] Computing for function initialized_p [from] Done for function initialized_p [from] Computing for function loop [from] Done for function loop [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function compute_n: n FROM n (and SELF) [from] Function init_p: x FROM n; p (and SELF) y FROM n; p (and SELF) [from] Function initialized_p: NO EFFECTS [from] Function loop: S FROM S (and SELF) T[0..4] FROM S (and SELF) \result FROM S [from] Function main: S FROM S (and SELF) T[0..4] FROM S (and SELF) n FROM n (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function compute_n: n; i [inout] Inputs for function compute_n: n [inout] Out (internal) for function init_p: x; y [inout] Inputs for function init_p: n [inout] Out (internal) for function initialized_p: x [inout] Inputs for function initialized_p: x; y [inout] Out (internal) for function loop: S; T[0..4]; i; p; tmp [inout] Inputs for function loop: S [inout] Out (internal) for function main: S; T[0..4]; n; x; y; __retres [inout] Inputs for function main: S; n [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'loop' -------------------------------------------------------------------------------- [ Valid ] Assertion 'Eva,signed_overflow' (file tests/value/reevaluate_alarms.i, line 14) by Eva (v2). [ Valid ] Assertion 'Eva,mem_access' (file tests/value/reevaluate_alarms.i, line 14) by Eva (v2). -------------------------------------------------------------------------------- --- Properties of Function 'compute_n' -------------------------------------------------------------------------------- [ Valid ] Assertion 'Eva,signed_overflow' (file tests/value/reevaluate_alarms.i, line 20) by Eva (v2). -------------------------------------------------------------------------------- --- Properties of Function 'initialized_p' -------------------------------------------------------------------------------- [ Valid ] Assertion 'Eva,initialization' (file tests/value/reevaluate_alarms.i, line 30) by Eva (v2). -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 4 Completely validated 4 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/relation_reduction.res.oracle0000666000000000000000000000315613571573400022613 0ustar [kernel] Parsing tests/value/relation_reduction.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization y ∈ {0} t ∈ {0} R1 ∈ {0} R2 ∈ {0} R3 ∈ {0} R4 ∈ {0} c ∈ {0} tab[0] ∈ {101} [1] ∈ {102} [2] ∈ {103} [3] ∈ {104} [4] ∈ {105} [5] ∈ {106} [6] ∈ {103} [7] ∈ {102} [8] ∈ {101} [eva:alarm] tests/value/relation_reduction.i:9: Warning: signed overflow. assert y + 10 ≤ 2147483647; [eva:alarm] tests/value/relation_reduction.i:20: Warning: accessing out of bounds index. assert 0 ≤ y; [eva:alarm] tests/value/relation_reduction.i:20: Warning: accessing out of bounds index. assert y < 9; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: y ∈ [-2147483648..2147483637] t ∈ [-2147483638..2147483647] R1 ∈ [-2147483648..2147483637] R2 ∈ [-2147483638..2147483647] R3 ∈ [--..--] R4 ∈ {0; 1; 2; 3; 4; 5} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: y FROM x t FROM x R1 FROM x (and SELF) R2 FROM x (and SELF) R3 FROM x (and SELF) R4 FROM tab[0..8]; x (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: y; t; R1; R2; R3; R4 [inout] Inputs for function main: y; t; tab[0..8] frama-c-20.0-Calcium/tests/value/oracle/relation_shift.res.oracle0000666000000000000000000000463613571573400021740 0ustar [kernel] Parsing tests/value/relation_shift.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization r1 ∈ {0} r2 ∈ {0} r3 ∈ {0} r4 ∈ {0} [eva:alarm] tests/value/relation_shift.i:5: Warning: signed overflow. assert x + 1 ≤ 2147483647; [eva:alarm] tests/value/relation_shift.i:6: Warning: signed overflow. assert -2147483648 ≤ y - 1; [eva:alarm] tests/value/relation_shift.i:11: Warning: signed overflow. assert z + t ≤ 2147483647; [eva:alarm] tests/value/relation_shift.i:12: Warning: out of bounds write. assert \valid(q); [eva:alarm] tests/value/relation_shift.i:15: Warning: signed overflow. assert -2147483648 ≤ x - y; [eva:alarm] tests/value/relation_shift.i:15: Warning: signed overflow. assert x - y ≤ 2147483647; [eva:alarm] tests/value/relation_shift.i:16: Warning: signed overflow. assert -2147483648 ≤ z - y; [eva:alarm] tests/value/relation_shift.i:16: Warning: signed overflow. assert z - y ≤ 2147483647; [eva:alarm] tests/value/relation_shift.i:18: Warning: out of bounds read. assert \valid_read(q); [eva] tests/value/relation_shift.i:19: Frama_C_dump_each: # Cvalue domain: r1 ∈ [--..--] r2 ∈ [--..--] r3 ∈ {3} r4 ∈ [--..--] x ∈ [-2147483647..2147483647] y ∈ [-2147483648..2147483646] z ∈ [-2147483642..2147483647] t ∈ {5} p ∈ {{ &p + {4} }} q ∈ {{ &S_q[1] }} S_q[0] ∈ {3} [1] ∈ [--..--] S_p[0..1] ∈ [--..--] ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: r1 ∈ [--..--] r2 ∈ [--..--] r3 ∈ {3} r4 ∈ [--..--] x ∈ [-2147483647..2147483647] y ∈ [-2147483648..2147483646] z ∈ [-2147483642..2147483647] t ∈ {5} p ∈ {{ &p + {4} }} q ∈ {{ &S_q[1] }} S_q[0] ∈ {3} [1] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: r1 FROM y r2 FROM y r3 FROM q r4 FROM q; S_q[1] S_q[0] FROM q [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: r1; r2; r3; r4; x; y; z; t; p; q; S_q[0] [inout] Inputs for function main: S_q[0..1] frama-c-20.0-Calcium/tests/value/oracle/relations.res.oracle0000666000000000000000000000645113571573400020723 0ustar [kernel] Parsing tests/value/relations.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0] ∈ {1} [1] ∈ {2} [2] ∈ {3} p ∈ {0} x ∈ {0} u[0..19] ∈ {0} R1 ∈ {0} R2 ∈ {0} R3 ∈ {0} R4 ∈ {0} R5 ∈ {0} R6 ∈ {0} R7 ∈ {0} A7 ∈ {0} R8 ∈ {0} A8 ∈ {0} S1 ∈ {0} S2 ∈ {0} S3 ∈ {0} S4 ∈ {0} S5 ∈ {0} S6 ∈ {0} S7 ∈ {0} B7 ∈ {0} S8 ∈ {0} B8 ∈ {0} [eva:alarm] tests/value/relations.i:35: Warning: signed overflow. assert u[0] + 1 ≤ 2147483647; [eva:alarm] tests/value/relations.i:41: Warning: signed overflow. assert -2147483648 ≤ u[5] - u[0]; [eva:alarm] tests/value/relations.i:41: Warning: signed overflow. assert u[5] - u[0] ≤ 2147483647; [eva:alarm] tests/value/relations.i:46: Warning: signed overflow. assert -2147483648 ≤ u[10] - u[11]; [eva:alarm] tests/value/relations.i:46: Warning: signed overflow. assert u[10] - u[11] ≤ 2147483647; [eva:alarm] tests/value/relations.i:48: Warning: signed overflow. assert -2147483648 ≤ u[1] - u[0]; [eva:alarm] tests/value/relations.i:48: Warning: signed overflow. assert u[1] - u[0] ≤ 2147483647; [eva:alarm] tests/value/relations.i:52: Warning: signed overflow. assert -2147483648 ≤ u[5] - u[1]; [eva:alarm] tests/value/relations.i:52: Warning: signed overflow. assert u[5] - u[1] ≤ 2147483647; [eva:alarm] tests/value/relations.i:56: Warning: out of bounds read. assert \valid_read(&pCs->L0); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0..1] ∈ {4} [2] ∈ {3} p ∈ {{ &t[1] }} x ∈ {4} u[0] ∈ [-2147483648..2147483646] [1] ∈ [--..--] [2..4] ∈ {0} [5] ∈ [-2147483647..2147483647] [6..9] ∈ {0} [10..11] ∈ [--..--] [12..19] ∈ {0} R1 ∈ [--..--] R2 ∈ [--..--] R3 ∈ [-2147483648..2147483646] R4 ∈ [--..--] R5 ∈ [--..--] R6 ∈ [--..--] R7 ∈ {0; 1} A7 ∈ [--..--] R8 ∈ {0; 1} A8 ∈ [--..--] S1 ∈ {-1; 0; 1} S2 ∈ {0; 1} c ∈ {0} e ∈ [--..--] f ∈ [--..--] S_pCs[0]{.L0; .L1} ∈ [--..--] [0]{.T13; .T; .L8} ∈ {0; 1} [1] ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t[0..1] FROM \nothing p FROM \nothing x FROM \nothing u{[0..1]; [5]} FROM g [10] FROM h [11] FROM i R1 FROM g (and SELF) R2 FROM g (and SELF) R3 FROM g (and SELF) R4 FROM g (and SELF) R5 FROM g R6 FROM h; i (and SELF) R7 FROM g (and SELF) A7 FROM g R8 FROM g (and SELF) A8 FROM g S1 FROM pCs; S_pCs[0]{.L0; .L1} S2 FROM pCs; S_pCs[0]{.L0; .L1} (and SELF) S_pCs[0]{.T13; .T; .L8} FROM pCs; S_pCs[0]{.L0; .L1} [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[0..1]; p; x; u{[0..1]; [5]; [10..11]}; R1; R2; R3; R4; R5; R6; R7; A7; R8; A8; S1; S2; c; e; f; tmp; tmp_0; S_pCs[0]{.T13; .T; .L8} [inout] Inputs for function main: t[0..1]; p; x; u{[0..1]; [5]; [10..11]}; S_pCs[0]{.L0; .L1; .T13; .T} frama-c-20.0-Calcium/tests/value/oracle/relations2.res.oracle0000666000000000000000000001311713571573400021002 0ustar [kernel] Parsing tests/value/relations2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization sv ∈ [--..--] a[0..513] ∈ [--..--] T[0] ∈ {0} [1] ∈ {1} [2] ∈ {42} [3] ∈ {5} [4] ∈ {6} [5] ∈ {41} [6] ∈ {42} [eva] computing for function bts2166 <- main. Called from tests/value/relations2.i:63. [eva:alarm] tests/value/relations2.i:63: Warning: function bts2166: precondition 'len' got status unknown. [eva:alarm] tests/value/relations2.i:63: Warning: function bts2166: precondition 'n' got status unknown. [eva] tests/value/relations2.i:15: Frama_C_dump_each: # Cvalue domain: sv ∈ [--..--] len ∈ [--..--] n ∈ [1..64] a[0..513] ∈ [--..--] T[0] ∈ {0} [1] ∈ {1} [2] ∈ {42} [3] ∈ {5} [4] ∈ {6} [5] ∈ {41} [6] ∈ {42} ==END OF DUMP== [eva] tests/value/relations2.i:17: Frama_C_show_each_end: [0..4294967295], [0..64] [eva] Recording results for bts2166 [eva] Done for function bts2166 [eva] computing for function main2 <- main. Called from tests/value/relations2.i:64. [eva] computing for function unsigned_interval <- main2 <- main. Called from tests/value/relations2.i:29. [eva] using specification for function unsigned_interval [eva] Done for function unsigned_interval [eva] computing for function unsigned_interval <- main2 <- main. Called from tests/value/relations2.i:30. [eva] Done for function unsigned_interval [eva] computing for function unsigned_interval <- main2 <- main. Called from tests/value/relations2.i:31. [eva] Done for function unsigned_interval [eva] tests/value/relations2.i:33: Frama_C_dump_each: # Cvalue domain: sv ∈ [--..--] a[0..513] ∈ [--..--] i ∈ [1..512] t ∈ [0..511] n ∈ [0..512] s ∈ {0} T[0] ∈ {0} [1] ∈ {1} [2] ∈ {42} [3] ∈ {5} [4] ∈ {6} [5] ∈ {41} [6] ∈ {42} ==END OF DUMP== [eva:alarm] tests/value/relations2.i:34: Warning: accessing out of bounds index. assert (unsigned int)(i - (unsigned int)(t + 1)) < 514; [eva] tests/value/relations2.i:32: starting to merge loop iterations [eva] tests/value/relations2.i:33: Frama_C_dump_each: # Cvalue domain: sv ∈ [--..--] a[0..513] ∈ [--..--] i ∈ [1..512] t ∈ [0..511] n ∈ [0..512] s ∈ {0; 1} T[0] ∈ {0} [1] ∈ {1} [2] ∈ {42} [3] ∈ {5} [4] ∈ {6} [5] ∈ {41} [6] ∈ {42} ==END OF DUMP== [eva] tests/value/relations2.i:33: Frama_C_dump_each: # Cvalue domain: sv ∈ [--..--] a[0..513] ∈ [--..--] i ∈ [1..512] t ∈ [0..511] n ∈ [0..512] s ∈ {0; 1; 2} T[0] ∈ {0} [1] ∈ {1} [2] ∈ {42} [3] ∈ {5} [4] ∈ {6} [5] ∈ {41} [6] ∈ {42} ==END OF DUMP== [eva] tests/value/relations2.i:33: Frama_C_dump_each: # Cvalue domain: sv ∈ [--..--] a[0..513] ∈ [--..--] i ∈ [1..512] t ∈ [0..511] n ∈ [0..512] s ∈ [0..2147483647] T[0] ∈ {0} [1] ∈ {1} [2] ∈ {42} [3] ∈ {5} [4] ∈ {6} [5] ∈ {41} [6] ∈ {42} ==END OF DUMP== [eva:alarm] tests/value/relations2.i:35: Warning: signed overflow. assert s + b3 ≤ 2147483647; [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/relations2.i:65. [eva] tests/value/relations2.i:47: Frama_C_show_each_NO1: [eva] tests/value/relations2.i:49: Frama_C_show_each_OK1: [eva] tests/value/relations2.i:55: Frama_C_show_each_OK2: [eva] tests/value/relations2.i:57: Frama_C_show_each_NO2: [eva] Recording results for main3 [eva] Done for function main3 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function bts2166: len ∈ [--..--] n ∈ [0..64] [eva:final-states] Values at end of function main3: T[0] ∈ {0; 2} [1] ∈ {1; 2} [2] ∈ {42} [3] ∈ {5} [4] ∈ {6} [5] ∈ {17; 41} [6] ∈ {17; 42} [eva:final-states] Values at end of function main2: i ∈ [0..512] t ∈ [0..512] n ∈ [0..512] s ∈ [0..2147483647] [eva:final-states] Values at end of function main: T[0] ∈ {0; 2} [1] ∈ {1; 2} [2] ∈ {42} [3] ∈ {5} [4] ∈ {6} [5] ∈ {17; 41} [6] ∈ {17; 42} [from] Computing for function bts2166 [from] Done for function bts2166 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main2 [from] Computing for function unsigned_interval <-main2 [from] Done for function unsigned_interval [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function bts2166: NO EFFECTS [from] Function main3: T[0..1] FROM T[0..1]; i (and SELF) [5..6] FROM T[3..4]; i (and SELF) [from] Function unsigned_interval: \result FROM i1; i2 [from] Function main2: \result FROM a[0..513] [from] Function main: T[0..1] FROM sv; T[0..1] (and SELF) [5..6] FROM sv; T[3..4] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function bts2166: len; n [inout] Inputs for function bts2166: \nothing [inout] Out (internal) for function main3: T{[0..1]; [5..6]} [inout] Inputs for function main3: T[0..6] [inout] Out (internal) for function main2: i; t; n; s; b3 [inout] Inputs for function main2: a[0..513] [inout] Out (internal) for function main: T{[0..1]; [5..6]} [inout] Inputs for function main: sv; a[0..513]; T[0..6] frama-c-20.0-Calcium/tests/value/oracle/relations_difficult.res.oracle0000666000000000000000000000205113571573400022744 0ustar [kernel] Parsing tests/value/relations_difficult.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} p ∈ {0} A ∈ {0} B ∈ {0} C ∈ {0} Z ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {4} y ∈ {1; 2} p ∈ {{ &x ; &y }} A ∈ {1; 2; 3} B ∈ {1; 2; 4} C ∈ {1; 2; 4} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: x FROM \nothing y FROM c p FROM c A FROM c B FROM Z; c C FROM c \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; y; p; A; B; C; __retres [inout] Inputs for function main: x; y; p; Z frama-c-20.0-Calcium/tests/value/oracle/replace_by_show_each.res.oracle0000666000000000000000000000304713571573400023046 0ustar [kernel] Parsing tests/value/replace_by_show_each.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} [eva] tests/value/replace_by_show_each.c:23: Frama_C_show_each_2: [eva] tests/value/replace_by_show_each.c:25: Frama_C_show_each_1: [inout] Warning: no assigns clauses for function Frama_C_show_each_1. Results will be imprecise. [from] Warning: no assigns clauses for function Frama_C_show_each_1. Results will be imprecise. [eva:alarm] tests/value/replace_by_show_each.c:26: Warning: signed overflow. assert j + 1 ≤ 2147483647; [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Cannot filter: dumping raw memory (including unchanged variables) x ∈ {0} j ∈ [-2147483648..2147483646] i ∈ [-2147483647..2147483647] [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to Frama_C_show_each_2 at tests/value/replace_by_show_each.c:23 (by main): NO EFFECTS [from] call to Frama_C_show_each_1 at tests/value/replace_by_show_each.c:25 (by main): FROMTOP [from] entry point: \result FROM j [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] InOut (internal) for function main: Operational inputs: ANYTHING(origin:Unknown) Operational inputs on termination: ANYTHING(origin:Unknown) Sure outputs: i frama-c-20.0-Calcium/tests/value/oracle/resolve.res.oracle0000666000000000000000000000221713571573400020376 0ustar [kernel] Parsing tests/value/resolve.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/resolve.i:12. [kernel:annot:missing-spec] tests/value/resolve.i:12: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: tmp [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/return.res.oracle0000666000000000000000000000237113571573400020237 0ustar [kernel] Parsing tests/value/return.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} H ∈ {0} [eva] computing for function f <- main. Called from tests/value/return.i:18. [eva] Recording results for f [eva] Done for function f [eva] tests/value/return.i:19: Reusing old results for call to f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {0} [eva:final-states] Values at end of function main: G ∈ {0} H ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM G; x [from] Function main: G FROM G; c (and SELF) H FROM G; H; c (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: G [inout] Out (internal) for function main: G; H [inout] Inputs for function main: G; H frama-c-20.0-Calcium/tests/value/oracle/semaphore.res.oracle0000666000000000000000000000626113571573400020705 0ustar [kernel] Parsing tests/value/semaphore.i (no preprocessing) [eva] Analyzing a complete application starting at g [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Sa ∈ {0} Sb ∈ {0} [eva] computing for function V <- g. Called from tests/value/semaphore.i:31. [kernel:annot:missing-spec] tests/value/semaphore.i:31: Warning: Neither code nor specification for function V, generating default assigns from the prototype [eva] using specification for function V [eva] Done for function V [eva] tests/value/semaphore.i:29: starting to merge loop iterations [eva] computing for function V <- g. Called from tests/value/semaphore.i:31. [eva] Done for function V [eva] computing for function V <- g. Called from tests/value/semaphore.i:31. [eva] Done for function V [eva] computing for function V <- g. Called from tests/value/semaphore.i:31. [eva] Done for function V [eva] tests/value/semaphore.i:28: starting to merge loop iterations [eva] computing for function P <- g. Called from tests/value/semaphore.i:34. [kernel:annot:missing-spec] tests/value/semaphore.i:34: Warning: Neither code nor specification for function P, generating default assigns from the prototype [eva] using specification for function P [eva] Done for function P [eva] computing for function P <- g. Called from tests/value/semaphore.i:35. [eva] Done for function P [eva] computing for function V <- g. Called from tests/value/semaphore.i:37. [eva] Done for function V [eva] computing for function V <- g. Called from tests/value/semaphore.i:38. [eva] Done for function V [eva] computing for function f <- g. Called from tests/value/semaphore.i:40. [eva] computing for function P <- f <- g. Called from tests/value/semaphore.i:14. [eva] Done for function P [eva] computing for function P <- f <- g. Called from tests/value/semaphore.i:16. [eva] Done for function P [eva] computing for function P <- f <- g. Called from tests/value/semaphore.i:17. [eva] Done for function P [eva] computing for function V <- f <- g. Called from tests/value/semaphore.i:19. [eva] Done for function V [eva] computing for function V <- f <- g. Called from tests/value/semaphore.i:20. [eva] Done for function V [eva] Recording results for f [eva] Done for function f [eva] Recording results for g [eva] done for function g [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: c ∈ {12} [eva:final-states] Values at end of function g: c ∈ {-26; -1} [from] Computing for function f [from] Computing for function P <-f [from] Done for function P [from] Computing for function V <-f [from] Done for function V [from] Done for function f [from] Computing for function g [from] Done for function g [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function P: NO EFFECTS [from] Function V: NO EFFECTS [from] Function f: NO EFFECTS [from] Function g: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: c [inout] Inputs for function f: Sa; Sb [inout] Out (internal) for function g: c; tmp [inout] Inputs for function g: Sa; Sb frama-c-20.0-Calcium/tests/value/oracle/separated.res.oracle0000666000000000000000000000241013571573400020662 0ustar [kernel] Parsing tests/value/separated.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..14] ∈ {0} p ∈ {{ &t[0] }} x ∈ {0} [eva] tests/value/separated.i:10: assertion got status valid. [eva:alarm] tests/value/separated.i:13: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/value/separated.i:16: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/value/separated.i:19: Warning: assertion got status invalid (stopping propagation). [eva] tests/value/separated.i:22: assertion got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {1} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: x FROM c \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/shift.0.res.oracle0000666000000000000000000000730713571573400020177 0ustar [kernel] Parsing tests/value/shift.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} d ∈ {0} e ∈ {0} f ∈ {0} g ∈ {0} h ∈ {0} ua ∈ {0} ub ∈ {0} uc ∈ {0} ud ∈ {0} ue ∈ {0} uf ∈ {0} t[0..9] ∈ {0} v ∈ [--..--] [eva:alarm] tests/value/shift.i:21: Warning: invalid RHS operand for shift. assert 0 ≤ c < 32; [eva] tests/value/shift.i:22: assertion got status valid. [eva:alarm] tests/value/shift.i:25: Warning: invalid RHS operand for shift. assert 0 ≤ c < 32; [eva] tests/value/shift.i:26: assertion got status valid. [eva:alarm] tests/value/shift.i:29: Warning: invalid RHS operand for shift. assert 0 ≤ c < 32; [eva:alarm] tests/value/shift.i:31: Warning: invalid LHS operand for left shift. assert 0 ≤ c; [eva] tests/value/shift.i:32: assertion got status valid. [eva:alarm] tests/value/shift.i:35: Warning: invalid RHS operand for shift. assert 0 ≤ 32 < 32; [eva:alarm] tests/value/shift.i:36: Warning: invalid RHS operand for shift. assert 0 ≤ 5555 < 32; [eva:alarm] tests/value/shift.i:40: Warning: invalid RHS operand for shift. assert 0 ≤ b < 32; [eva] tests/value/shift.i:48: Frama_C_show_each: {{ "ua:%u\nub:%u\n" }}, {1401}, {1073741074} [eva:alarm] tests/value/shift.i:52: Warning: unsigned overflow. assert 0 ≤ (unsigned long)((char *)t) << 8; [eva:alarm] tests/value/shift.i:52: Warning: unsigned overflow. assert (unsigned long)((char *)t) << 8 ≤ 4294967295; [eva] tests/value/shift.i:52: Assigning imprecise value to r. The imprecision originates from Arithmetic {tests/value/shift.i:52} [eva:alarm] tests/value/shift.i:53: Warning: invalid LHS operand for left shift. assert 0 ≤ (long)((char *)t); [eva:alarm] tests/value/shift.i:53: Warning: signed overflow. assert -2147483648 ≤ (long)((char *)t) << 8; [eva:alarm] tests/value/shift.i:53: Warning: signed overflow. assert (long)((char *)t) << 8 ≤ 2147483647; [eva:alarm] tests/value/shift.i:53: Warning: signed overflow. assert -2147483648 ≤ (long)r + (long)((long)((char *)t) << 8); [eva:alarm] tests/value/shift.i:53: Warning: signed overflow. assert (long)r + (long)((long)((char *)t) << 8) ≤ 2147483647; [eva] tests/value/shift.i:53: Assigning imprecise value to r. The imprecision originates from Arithmetic [eva:alarm] tests/value/shift.i:58: Warning: unsigned overflow. assert 2U << 31 ≤ 4294967295; [eva] Recording results for main [eva] done for function main [eva] tests/value/shift.i:35: assertion 'Eva,shift' got final status invalid. [eva] tests/value/shift.i:36: assertion 'Eva,shift' got final status invalid. [eva] tests/value/shift.i:40: assertion 'Eva,shift' got final status invalid. [eva] tests/value/shift.i:58: assertion 'Eva,unsigned_overflow' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {314; 1256; 5024} b ∈ {0} d ∈ {61; 246; 255; 987} f ∈ {-988; -255; -247; -62} ua ∈ {1401} ub ∈ {1073741074} c ∈ [--..--] z ∈ [-2147483648..2147483630],0%2 zz ∈ {0} shl ∈ {1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: a FROM v; c b FROM z (and SELF) d FROM v; c f FROM v; c ua FROM \nothing ub FROM \nothing \result FROM b; z [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b; d; f; ua; ub; c; z; zz; r; shl [inout] Inputs for function main: b; d; f; ua; ub; v frama-c-20.0-Calcium/tests/value/oracle/shift.1.res.oracle0000666000000000000000000000613013571573400020171 0ustar [kernel] Parsing tests/value/shift.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} d ∈ {0} e ∈ {0} f ∈ {0} g ∈ {0} h ∈ {0} ua ∈ {0} ub ∈ {0} uc ∈ {0} ud ∈ {0} ue ∈ {0} uf ∈ {0} t[0..9] ∈ {0} v ∈ [--..--] [eva:alarm] tests/value/shift.i:21: Warning: invalid RHS operand for shift. assert 0 ≤ c < 32; [eva] tests/value/shift.i:22: assertion got status valid. [eva:alarm] tests/value/shift.i:25: Warning: invalid RHS operand for shift. assert 0 ≤ c < 32; [eva] tests/value/shift.i:26: assertion got status valid. [eva:alarm] tests/value/shift.i:29: Warning: invalid RHS operand for shift. assert 0 ≤ c < 32; [eva:alarm] tests/value/shift.i:32: Warning: assertion got status unknown. [eva:alarm] tests/value/shift.i:35: Warning: invalid RHS operand for shift. assert 0 ≤ 32 < 32; [eva:alarm] tests/value/shift.i:36: Warning: invalid RHS operand for shift. assert 0 ≤ 5555 < 32; [eva:alarm] tests/value/shift.i:40: Warning: invalid RHS operand for shift. assert 0 ≤ b < 32; [eva] tests/value/shift.i:48: Frama_C_show_each: {{ "ua:%u\nub:%u\n" }}, {1401}, {1073741074} [eva] tests/value/shift.i:52: Assigning imprecise value to r. The imprecision originates from Arithmetic {tests/value/shift.i:52} [eva:alarm] tests/value/shift.i:53: Warning: signed overflow. assert -2147483648 ≤ (long)((char *)t) << 8; [eva:alarm] tests/value/shift.i:53: Warning: signed overflow. assert (long)((char *)t) << 8 ≤ 2147483647; [eva:alarm] tests/value/shift.i:53: Warning: signed overflow. assert -2147483648 ≤ (long)r + (long)((long)((char *)t) << 8); [eva:alarm] tests/value/shift.i:53: Warning: signed overflow. assert (long)r + (long)((long)((char *)t) << 8) ≤ 2147483647; [eva] tests/value/shift.i:53: Assigning imprecise value to r. The imprecision originates from Arithmetic [eva] Recording results for main [eva] done for function main [eva] tests/value/shift.i:35: assertion 'Eva,shift' got final status invalid. [eva] tests/value/shift.i:36: assertion 'Eva,shift' got final status invalid. [eva] tests/value/shift.i:40: assertion 'Eva,shift' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {314; 1256; 5024} b ∈ {0} d ∈ {61; 246; 255; 987} f ∈ {-988; -255; -247; -62} ua ∈ {1401} ub ∈ {1073741074} c ∈ [--..--] z ∈ [-2147483648..2147483630],0%2 zz ∈ {0} shl ∈ {0; 1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: a FROM v; c b FROM z (and SELF) d FROM v; c f FROM v; c ua FROM \nothing ub FROM \nothing \result FROM b; z [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b; d; f; ua; ub; c; z; zz; r; shl [inout] Inputs for function main: b; d; f; ua; ub; v frama-c-20.0-Calcium/tests/value/oracle/shift_big.res.oracle0000666000000000000000000001220413571573400020652 0ustar [kernel] Parsing tests/value/shift_big.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization nondet ∈ [--..--] [eva] computing for function t1 <- main. Called from tests/value/shift_big.i:63. [eva:alarm] tests/value/shift_big.i:5: Warning: invalid RHS operand for shift. assert 0 ≤ j < 32; [eva:alarm] tests/value/shift_big.i:5: Warning: signed overflow. assert 1 << j ≤ 2147483647; [eva] Recording results for t1 [eva] Done for function t1 [eva] computing for function t2 <- main. Called from tests/value/shift_big.i:64. [eva:alarm] tests/value/shift_big.i:15: Warning: invalid RHS operand for shift. assert 0 ≤ j < 32; [eva:alarm] tests/value/shift_big.i:15: Warning: signed overflow. assert 1 << j ≤ 2147483647; [eva] Recording results for t2 [eva] Done for function t2 [eva:alarm] tests/value/shift_big.i:64: Warning: signed overflow. assert r + tmp_0 ≤ 2147483647; (tmp_0 from t2()) [eva] computing for function t3 <- main. Called from tests/value/shift_big.i:65. [eva] tests/value/shift_big.i:22: starting to merge loop iterations [eva] tests/value/shift_big.i:25: assertion got status valid. [eva] Recording results for t3 [eva] Done for function t3 [eva] computing for function t4 <- main. Called from tests/value/shift_big.i:66. [eva] tests/value/shift_big.i:31: assertion got status valid. [eva] Recording results for t4 [eva] Done for function t4 [eva] computing for function t5 <- main. Called from tests/value/shift_big.i:67. [eva] tests/value/shift_big.i:37: starting to merge loop iterations [eva] tests/value/shift_big.i:40: assertion got status valid. [eva] Recording results for t5 [eva] Done for function t5 [eva] computing for function t6 <- main. Called from tests/value/shift_big.i:68. [eva] tests/value/shift_big.i:46: assertion got status valid. [eva] Recording results for t6 [eva] Done for function t6 [eva] computing for function t7 <- main. Called from tests/value/shift_big.i:69. [eva:alarm] tests/value/shift_big.i:52: Warning: assertion got status unknown. [eva] Recording results for t7 [eva] Done for function t7 [eva] computing for function t8 <- main. Called from tests/value/shift_big.i:70. [eva] tests/value/shift_big.i:58: assertion got status valid. [eva] Recording results for t8 [eva] Done for function t8 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function t1: j ∈ [0..31] i ∈ [1..2147483647] __retres ∈ [1..2147483647] [eva:final-states] Values at end of function t2: j ∈ {1; 10; 31} i ∈ {2; 1024} __retres ∈ {2; 1024} [eva:final-states] Values at end of function t3: x ∈ [1000000000..1999999999] i ∈ {2000000000} [eva:final-states] Values at end of function t4: x ∈ {1000000000; 1000000001} [eva:final-states] Values at end of function t5: x ∈ [1000000000..1999999999] i ∈ {2000000000} [eva:final-states] Values at end of function t6: x ∈ {1000000000; 1000000001} [eva:final-states] Values at end of function t7: x ∈ {1022; 1023} [eva:final-states] Values at end of function t8: x ∈ {1022; 1023} [eva:final-states] Values at end of function main: r ∈ [0..2147483647] [from] Computing for function t1 [from] Done for function t1 [from] Computing for function t2 [from] Done for function t2 [from] Computing for function t3 [from] Done for function t3 [from] Computing for function t4 [from] Done for function t4 [from] Computing for function t5 [from] Done for function t5 [from] Computing for function t6 [from] Done for function t6 [from] Computing for function t7 [from] Done for function t7 [from] Computing for function t8 [from] Done for function t8 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function t1: \result FROM nondet [from] Function t2: \result FROM nondet [from] Function t3: NO EFFECTS [from] Function t4: NO EFFECTS [from] Function t5: NO EFFECTS [from] Function t6: NO EFFECTS [from] Function t7: NO EFFECTS [from] Function t8: NO EFFECTS [from] Function main: \result FROM nondet [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function t1: j; i; __retres [inout] Inputs for function t1: nondet [inout] Out (internal) for function t2: j; i; __retres [inout] Inputs for function t2: nondet [inout] Out (internal) for function t3: x; i [inout] Inputs for function t3: nondet [inout] Out (internal) for function t4: x [inout] Inputs for function t4: nondet [inout] Out (internal) for function t5: x; i [inout] Inputs for function t5: nondet [inout] Out (internal) for function t6: x [inout] Inputs for function t6: nondet [inout] Out (internal) for function t7: x [inout] Inputs for function t7: nondet [inout] Out (internal) for function t8: x [inout] Inputs for function t8: nondet [inout] Out (internal) for function main: r; tmp; tmp_0 [inout] Inputs for function main: nondet frama-c-20.0-Calcium/tests/value/oracle/shift_neg.0.res.oracle0000666000000000000000000000475213571573400021031 0ustar [kernel] Parsing tests/value/shift_neg.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] [eva] computing for function Frama_C_interval <- main. Called from tests/value/shift_neg.c:17. [eva] using specification for function Frama_C_interval [eva] tests/value/shift_neg.c:17: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- main. Called from tests/value/shift_neg.c:21. [eva] tests/value/shift_neg.c:21: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/shift_neg.c:22: Warning: invalid LHS operand for left shift. assert 0 ≤ x; [eva] tests/value/shift_neg.c:23: Frama_C_show_each_left_shift: [0..12], [0..48],0%4 [eva] computing for function Frama_C_interval <- main. Called from tests/value/shift_neg.c:24. [eva] tests/value/shift_neg.c:24: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/shift_neg.c:26: Frama_C_show_each_right_shift: [-8..12], {-2; -1; 0; 1; 2; 3} [eva:alarm] tests/value/shift_neg.c:29: Warning: invalid LHS operand for left shift. assert 0 ≤ (int)(-44); [eva] tests/value/shift_neg.c:36: Frama_C_show_each_neg_right_shift: {-1}, {-6} [eva] Recording results for main [eva] done for function main [eva] tests/value/shift_neg.c:29: assertion 'Eva,shift' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] x ∈ [-8..12] r ∈ {-2; -1; 0; 1; 2; 3} [from] Computing for function main [from] Computing for function Frama_C_interval <-main [from] Done for function Frama_C_interval [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: Frama_C_entropy_source; x; r; k; i; j [inout] Inputs for function main: Frama_C_entropy_source; rand frama-c-20.0-Calcium/tests/value/oracle/shift_neg.1.res.oracle0000666000000000000000000000474513571573400021034 0ustar [kernel] Parsing tests/value/shift_neg.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization rand ∈ [--..--] [eva] computing for function Frama_C_interval <- main. Called from tests/value/shift_neg.c:17. [eva] using specification for function Frama_C_interval [eva] tests/value/shift_neg.c:17: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] computing for function Frama_C_interval <- main. Called from tests/value/shift_neg.c:21. [eva] tests/value/shift_neg.c:21: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva] tests/value/shift_neg.c:23: Frama_C_show_each_left_shift: [-8..12], [-32..48],0%4 [eva] computing for function Frama_C_interval <- main. Called from tests/value/shift_neg.c:24. [eva] tests/value/shift_neg.c:24: function Frama_C_interval: precondition 'order' got status valid. [eva] Done for function Frama_C_interval [eva:alarm] tests/value/shift_neg.c:25: Warning: invalid LHS operand for left shift. assert 0 ≤ x; [eva] tests/value/shift_neg.c:26: Frama_C_show_each_right_shift: [0..12], {0; 1; 2; 3} [eva] tests/value/shift_neg.c:31: Frama_C_show_each_neg_left_shift: {-1441792}, {-352} [eva:alarm] tests/value/shift_neg.c:34: Warning: invalid LHS operand for left shift. assert 0 ≤ (int)(-44); [eva] Recording results for main [eva] done for function main [eva] tests/value/shift_neg.c:34: assertion 'Eva,shift' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Frama_C_entropy_source ∈ [--..--] x ∈ [0..12] r ∈ {0; 1; 2; 3} [from] Computing for function main [from] Computing for function Frama_C_interval <-main [from] Done for function Frama_C_interval [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function Frama_C_interval: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) \result FROM Frama_C_entropy_source; min; max [from] Function main: Frama_C_entropy_source FROM Frama_C_entropy_source (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: Frama_C_entropy_source; x; r; k; l; i [inout] Inputs for function main: Frama_C_entropy_source; rand frama-c-20.0-Calcium/tests/value/oracle/sign_of_bitfiled_int.0.res.oracle0000666000000000000000000000074313571573400023217 0ustar [kernel] Parsing tests/value/sign_of_bitfiled_int.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization bf ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: bf.c ∈ {-1} .u ∈ {65535} int_inside_bitfield_is_unsigned ∈ {1} frama-c-20.0-Calcium/tests/value/oracle/sign_of_bitfiled_int.1.res.oracle0000666000000000000000000000074313571573400023220 0ustar [kernel] Parsing tests/value/sign_of_bitfiled_int.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization bf ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: bf.c ∈ {-1} .u ∈ {65535} int_inside_bitfield_is_unsigned ∈ {1} frama-c-20.0-Calcium/tests/value/oracle/simple_packed.res.oracle0000666000000000000000000000232313571573400021515 0ustar [kernel] Parsing tests/value/simple_packed.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/simple_packed.c:19. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: bar{.c; .i; .s.c} ∈ [--..--] .s.[bits 8 to 31] ∈ UNINITIALIZED .s.i ∈ [--..--] [eva:final-states] Values at end of function main: [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM foo [from] Function main: \result FROM foo [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: bar [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/simple_path.res.oracle0000666000000000000000000000154513571573400021227 0ustar [kernel] Parsing tests/value/simple_path.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {0} H ∈ {0} p ∈ {{ &G }} q ∈ {{ &H }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G ∈ {3} H ∈ {5} p ∈ {{ &H }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: G FROM p H FROM \nothing p FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G; H; p [inout] Inputs for function main: p frama-c-20.0-Calcium/tests/value/oracle/simplify_cfg.0.res.oracle0000666000000000000000000000064013571573400021526 0ustar [kernel] Parsing tests/value/simplify_cfg.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: z ∈ {1; 100} c ∈ {99} frama-c-20.0-Calcium/tests/value/oracle/simplify_cfg.1.res.oracle0000666000000000000000000000064013571573400021527 0ustar [kernel] Parsing tests/value/simplify_cfg.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: z ∈ {1; 100} c ∈ {99} frama-c-20.0-Calcium/tests/value/oracle/sizeof.res.oracle0000666000000000000000000001070713571573400020221 0ustar [kernel] Parsing tests/value/sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization sz_str ∈ {0} sz_typ ∈ {0} align_str ∈ {0} align_typ ∈ {0} s1 ∈ {0} i ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/sizeof.i:40. [eva] tests/value/sizeof.i:10: assertion got status valid. [eva] tests/value/sizeof.i:14: assertion got status valid. [eva] tests/value/sizeof.i:17: assertion got status valid. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/sizeof.i:41. [eva] tests/value/sizeof.i:32: Assigning imprecise value to p. The imprecision originates from Arithmetic {tests/value/sizeof.i:32} [eva:alarm] tests/value/sizeof.i:33: Warning: accessing out of bounds index. assert (unsigned int)(sizeof(s1.t) - (unsigned int)i) < 10; [eva:alarm] tests/value/sizeof.i:33: Warning: out of bounds write. assert \valid(&p->t[(unsigned int)(sizeof(s1.t) - (unsigned int)i)]); [eva:alarm] tests/value/sizeof.i:34: Warning: accessing out of bounds index. assert (unsigned int)(sizeof(s1.t) - (unsigned int)i) < 10; [eva:alarm] tests/value/sizeof.i:34: Warning: out of bounds write. assert \valid(&p->t[(unsigned int)(sizeof(s1.t) - (unsigned int)i)]); [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function f <- main. Called from tests/value/sizeof.i:42. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: [eva:final-states] Values at end of function main1: sz_str ∈ {4} sz_typ ∈ {1} align_str ∈ {1} align_typ ∈ {4} [eva:final-states] Values at end of function main2: s1 ∈ [--..--] p ∈ {{ &s1 + [-36..36] }} [eva:final-states] Values at end of function main: sz_str ∈ {4} sz_typ ∈ {1} align_str ∈ {1} align_typ ∈ {4} s1 ∈ [--..--] [from] Computing for function f [from] Done for function f [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NO EFFECTS [from] Function main1: sz_str FROM \nothing sz_typ FROM \nothing align_str FROM \nothing align_typ FROM \nothing [from] Function main2: s1 FROM i (and SELF) [from] Function main: sz_str FROM \nothing sz_typ FROM \nothing align_str FROM \nothing align_typ FROM \nothing s1 FROM i (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: \nothing [inout] Inputs for function f: \nothing [inout] Out (internal) for function main1: sz_str; sz_typ; align_str; align_typ [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: s1; p [inout] Inputs for function main2: i [inout] Out (internal) for function main: sz_str; sz_typ; align_str; align_typ; s1 [inout] Inputs for function main: i /* Generated by Frama-C */ struct s { int t[10] ; }; int sz_str; int sz_typ; int align_str; int align_typ; void main1(void) { sz_str = (int)sizeof("ONE"); /*@ assert sz_str ≡ sizeof("ONE"); */ ; align_str = (int)__alignof__("FOO"); sz_typ = (int)sizeof(char); /*@ assert sz_typ ≡ sizeof(char); */ ; align_typ = (int)__alignof__(char *); /*@ assert sizeof("BLA") ≢ sizeof("FOOBAR"); */ ; return; } struct s s1; int volatile i; void main2(void) { struct s *p = (& s1 + (int)(& s1)) - (int)(& s1); /*@ assert Eva: index_bound: (unsigned int)(sizeof(s1.t) - (unsigned int)i) < 10; */ /*@ assert Eva: mem_access: \valid(&p->t[(unsigned int)(sizeof(s1.t) - (unsigned int)i)]); */ p->t[sizeof(s1.t) - (unsigned int)i] = 1; /*@ assert Eva: index_bound: (unsigned int)(sizeof(s1.t) - (unsigned int)i) < 10; */ /*@ assert Eva: mem_access: \valid(&p->t[(unsigned int)(sizeof(s1.t) - (unsigned int)i)]); */ p->t[sizeof(s1.t) - (unsigned int)i] = 2; return; } void f(int sz) { return; } void main(int *p, int *q, int j) { main1(); main2(); f((int)(sizeof(*p) * (unsigned int)j)); return; } frama-c-20.0-Calcium/tests/value/oracle/slevel_return.res.oracle0000666000000000000000000000405613571573400021613 0ustar [kernel] Parsing tests/value/slevel_return.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} y ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/slevel_return.i:44. [eva] tests/value/slevel_return.i:7: function main1: postcondition got status valid. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/slevel_return.i:45. [eva] tests/value/slevel_return.i:38: Frama_C_dump_each: # Cvalue domain: x ∈ {-3} y ∈ {0; 1; 6} c ∈ [--..--] c ∈ [--..--] ==END OF DUMP== [eva] tests/value/slevel_return.i:23: function main2: postcondition got status valid. [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: x ∈ {-3; 0; 5} y ∈ {0; 1; 6} [eva:final-states] Values at end of function main2: x ∈ {-3; 0; 5} y ∈ {0; 1; 6} [eva:final-states] Values at end of function main: x ∈ {-3; 0; 5} y ∈ {0; 1; 6} [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: x FROM c y FROM c (and SELF) [from] Function main2: x FROM c y FROM c (and SELF) [from] Function main: x FROM c y FROM c (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: x; y [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: x; y [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main: x; y [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/slevelex.res.oracle0000666000000000000000000001120313571573400020541 0ustar [kernel] Parsing tests/value/slevelex.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] [eva:alarm] tests/value/slevelex.i:80: Warning: assertion got status unknown. [eva] tests/value/slevelex.i:82: Frama_C_show_each_xy: {1; 2}, {1; 2} [eva] computing for function f <- main. Called from tests/value/slevelex.i:83. [eva] Recording results for f [eva] Done for function f [eva] tests/value/slevelex.i:84: assertion got status valid. [eva] computing for function gu <- main. Called from tests/value/slevelex.i:88. [eva] tests/value/slevelex.i:26: assertion got status valid. [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {1} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {2} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {3} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {4} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {5} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {6} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {7} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {8} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {9} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {10} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {11} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {12} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {13} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {14} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {15} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {16} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {17} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {18} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {19} [eva] tests/value/slevelex.i:40: Frama_C_show_each_u: {20} [eva] Recording results for gu [eva] Done for function gu [eva] computing for function ginc <- main. Called from tests/value/slevelex.i:89. [eva] tests/value/slevelex.i:49: assertion got status valid. [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {4} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {8} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {12} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {16} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {20} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {24} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {28} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {32} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {36} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {40} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {44} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {48} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {52} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {56} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {60} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {64} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {68} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {72} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {76} [eva] tests/value/slevelex.i:63: Frama_C_show_each_inc: {80} [eva] Recording results for ginc [eva] Done for function ginc [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: x ∈ {1; 2} y ∈ {1; 2} __retres ∈ {0} [eva:final-states] Values at end of function ginc: inc ∈ [4..80],0%4 [eva:final-states] Values at end of function gu: [eva:final-states] Values at end of function main: un ∈ [1..20] x ∈ {0} y ∈ {1; 2} [from] Computing for function f [from] Done for function f [from] Computing for function ginc [from] Done for function ginc [from] Computing for function gu [from] Done for function gu [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM c [from] Function ginc: NO EFFECTS [from] Function gu: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: x; y; __retres [inout] Inputs for function f: c [inout] Out (internal) for function ginc: inc [inout] Inputs for function ginc: \nothing [inout] Out (internal) for function gu: \nothing [inout] Inputs for function gu: \nothing [inout] Out (internal) for function main: un; x; y [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/value/oracle/small_conditionals.res.oracle0000666000000000000000000000146313571573400022577 0ustar [kernel] Parsing tests/value/small_conditionals.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization Y ∈ {0} Z ∈ {0} U ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: Y ∈ [--..--] Z ∈ {4} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: Y FROM X Z FROM U [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: Y; Z; tmp [inout] Inputs for function main: U frama-c-20.0-Calcium/tests/value/oracle/sort4.0.res.oracle0000666000000000000000000000243513571573400020132 0ustar [kernel] Parsing tests/value/sort4.i (no preprocessing) [kernel] tests/value/sort4.i:25: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [eva] Analyzing an incomplete application starting at sort4_1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ [--..--] b ∈ [--..--] c ∈ [--..--] d ∈ [--..--] [eva:alarm] tests/value/sort4.i:20: Warning: assertion got status unknown. [eva] Recording results for sort4_1 [eva] done for function sort4_1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function sort4_1: a ∈ [--..--] b ∈ [--..--] c ∈ [--..--] d ∈ [--..--] tmp ∈ [-2147483647..2147483647] or UNINITIALIZED [from] Computing for function sort4_1 [from] Done for function sort4_1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function sort4_1: a FROM a; b; c; d (and SELF) b FROM a; b; c; d (and SELF) c FROM a; b; c; d (and SELF) d FROM a; b; c; d (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function sort4_1: a; b; c; d; tmp [inout] Inputs for function sort4_1: a; b; c; d frama-c-20.0-Calcium/tests/value/oracle/sort4.1.res.oracle0000666000000000000000000000713113571573400020131 0ustar [kernel] Parsing tests/value/sort4.i (no preprocessing) [kernel] tests/value/sort4.i:25: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [eva] Analyzing an incomplete application starting at sort4_4 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ [--..--] b ∈ [--..--] c ∈ [--..--] d ∈ [--..--] [eva:alarm] tests/value/sort4.i:25: Warning: function sort4_4: precondition got status unknown. [eva:alarm] tests/value/sort4.i:29: Warning: out of bounds read. assert \valid_read(t + 1); [eva:alarm] tests/value/sort4.i:29: Warning: out of bounds read. assert \valid_read(t + 1); [eva:alarm] tests/value/sort4.i:29: Warning: out of bounds write. assert \valid(t + 1); [eva:alarm] tests/value/sort4.i:30: Warning: out of bounds read. assert \valid_read(t + 2); [eva:alarm] tests/value/sort4.i:30: Warning: out of bounds read. assert \valid_read(t + 3); [eva:alarm] tests/value/sort4.i:30: Warning: out of bounds read. assert \valid_read(t + 2); [eva:alarm] tests/value/sort4.i:30: Warning: out of bounds write. assert \valid(t + 2); [eva:alarm] tests/value/sort4.i:30: Warning: out of bounds read. assert \valid_read(t + 3); [eva:alarm] tests/value/sort4.i:30: Warning: out of bounds write. assert \valid(t + 3); [eva:alarm] tests/value/sort4.i:31: Warning: out of bounds read. assert \valid_read(t + 2); [eva:alarm] tests/value/sort4.i:31: Warning: out of bounds read. assert \valid_read(t + 2); [eva:alarm] tests/value/sort4.i:31: Warning: out of bounds write. assert \valid(t + 2); [eva:alarm] tests/value/sort4.i:32: Warning: out of bounds read. assert \valid_read(t + 1); [eva:alarm] tests/value/sort4.i:32: Warning: out of bounds read. assert \valid_read(t + 3); [eva:alarm] tests/value/sort4.i:32: Warning: out of bounds read. assert \valid_read(t + 1); [eva:alarm] tests/value/sort4.i:32: Warning: out of bounds write. assert \valid(t + 1); [eva:alarm] tests/value/sort4.i:32: Warning: out of bounds read. assert \valid_read(t + 3); [eva:alarm] tests/value/sort4.i:32: Warning: out of bounds write. assert \valid(t + 3); [eva:alarm] tests/value/sort4.i:33: Warning: out of bounds read. assert \valid_read(t + 1); [eva:alarm] tests/value/sort4.i:33: Warning: out of bounds read. assert \valid_read(t + 2); [eva:alarm] tests/value/sort4.i:33: Warning: out of bounds read. assert \valid_read(t + 1); [eva:alarm] tests/value/sort4.i:33: Warning: out of bounds write. assert \valid(t + 1); [eva:alarm] tests/value/sort4.i:33: Warning: out of bounds read. assert \valid_read(t + 2); [eva:alarm] tests/value/sort4.i:33: Warning: out of bounds write. assert \valid(t + 2); [eva:alarm] tests/value/sort4.i:26: Warning: function sort4_4: postcondition got status unknown. [eva] Recording results for sort4_4 [eva] done for function sort4_4 [scope:rm_asserts] removing 13 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function sort4_4: tmp ∈ [-2147483647..2147483647] or UNINITIALIZED S_t[0..3] ∈ [--..--] [from] Computing for function sort4_4 [from] Done for function sort4_4 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function sort4_4: S_t[0] FROM t; S_t[0..3] (and SELF) [1..2] FROM t; S_t[0..3] (and SELF) [3] FROM t; S_t[0..3] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function sort4_4: tmp; S_t[0..3] [inout] Inputs for function sort4_4: S_t[0..3] frama-c-20.0-Calcium/tests/value/oracle/sort4.2.res.oracle0000666000000000000000000000344113571573400020132 0ustar [kernel] Parsing tests/value/sort4.i (no preprocessing) [kernel] tests/value/sort4.i:25: Warning: parsing obsolete ACSL construct '\valid_range(addr,min,max)'. '\valid(addr+(min..max))' should be used instead. [eva] Analyzing an incomplete application starting at sort4_3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ [--..--] b ∈ [--..--] c ∈ [--..--] d ∈ [--..--] [eva:alarm] tests/value/sort4.i:59: Warning: function sort4_3: precondition got status unknown. [eva:alarm] tests/value/sort4.i:61: Warning: function sort4_3: postcondition got status unknown. [eva] Recording results for sort4_3 [eva] done for function sort4_3 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function sort4_3: tmp ∈ [-2147483647..2147483647] or UNINITIALIZED S_d_0[0..1] ∈ [--..--] S_c_0[0..1] ∈ [--..--] S_b_0[0..1] ∈ [--..--] S_a_0[0..1] ∈ [--..--] [from] Computing for function sort4_3 [from] Done for function sort4_3 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function sort4_3: S_d_0[0] FROM a_0; b_0; c_0; d_0; S_d_0[0]; S_c_0[0]; S_b_0[0]; S_a_0[0] (and SELF) S_c_0[0] FROM a_0; b_0; c_0; d_0; S_d_0[0]; S_c_0[0]; S_b_0[0]; S_a_0[0] (and SELF) S_b_0[0] FROM a_0; b_0; c_0; d_0; S_d_0[0]; S_c_0[0]; S_b_0[0]; S_a_0[0] (and SELF) S_a_0[0] FROM a_0; b_0; c_0; d_0; S_d_0[0]; S_c_0[0]; S_b_0[0]; S_a_0[0] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function sort4_3: tmp; S_d_0[0]; S_c_0[0]; S_b_0[0]; S_a_0[0] [inout] Inputs for function sort4_3: S_d_0[0]; S_c_0[0]; S_b_0[0]; S_a_0[0] frama-c-20.0-Calcium/tests/value/oracle/split_return.0.res.oracle0000666000000000000000000003476613571573400021625 0ustar [kernel] Parsing tests/value/split_return.i (no preprocessing) [eva] Warning: ignoring non-existing function 'NON_EXISTING'. [eva] Splitting return states on: \return(f2) == 0 (user) \return(f3) == -2, -4 (user) \return(f4) == 4 (user) \return(f5) == -2 (user) \return(uninit) == 0 (user) \return(escaping) == 0 (user) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i2 ∈ [--..--] i3 ∈ [--..--] i4 ∈ [--..--] i5 ∈ [--..--] v ∈ [--..--] v7 ∈ {0} rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/split_return.i:204. [eva] computing for function init <- main1 <- main. Called from tests/value/split_return.i:17. [eva] using specification for function init [eva] Done for function init [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/split_return.i:205. [eva] computing for function f2 <- main2 <- main. Called from tests/value/split_return.i:48. [eva] Recording results for f2 [eva] Done for function f2 [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {0}, {0} [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {5; 7}, {5} [eva] tests/value/split_return.i:51: assertion got status valid. [eva] tests/value/split_return.i:53: Frama_C_show_each_f2_2: {5; 7}, {5} [eva] tests/value/split_return.i:54: assertion got status valid. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/split_return.i:206. [eva] computing for function f3 <- main3 <- main. Called from tests/value/split_return.i:73. [eva] tests/value/split_return.i:69: cannot properly split on \result == -2 [eva] Recording results for f3 [eva] Done for function f3 [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {-2; 7}, {0; 5} [eva:alarm] tests/value/split_return.i:76: Warning: assertion got status unknown. [eva:alarm] tests/value/split_return.i:78: Warning: assertion got status unknown. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4; 7}, {0; 5} [eva:alarm] tests/value/split_return.i:97: Warning: assertion got status unknown. [eva:alarm] tests/value/split_return.i:99: Warning: assertion got status unknown. [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/split_return.i:208. [eva] computing for function f5 <- main5 <- main. Called from tests/value/split_return.i:117. [eva] Recording results for f5 [eva] Done for function f5 [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {-2}, {0} [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {7}, {5} [eva] tests/value/split_return.i:120: assertion got status valid. [eva] tests/value/split_return.i:122: assertion got status valid. [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/value/split_return.i:209. [eva] computing for function f6 <- main6 <- main. Called from tests/value/split_return.i:135. [eva:alarm] tests/value/split_return.i:130: Warning: assertion got status unknown. [eva] Recording results for f6 [eva] Done for function f6 [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/value/split_return.i:210. [eva] computing for function f7 <- main7 <- main. Called from tests/value/split_return.i:148. [eva] Recording results for f7 [eva] Done for function f7 [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {{ NULL ; &v }}, {0; 1} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1; 4}, {{ NULL ; &x }} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/value/split_return.i:212. [eva] computing for function uninit <- main9 <- main. Called from tests/value/split_return.i:199. [eva] Recording results for uninit [eva] Done for function uninit [eva] computing for function escaping <- main9 <- main. Called from tests/value/split_return.i:200. [eva:locals-escaping] tests/value/split_return.i:192: Warning: locals {x} escaping the scope of a block of escaping through p [eva] Recording results for escaping [eva] Done for function escaping [eva] computing for function escaping <- main9 <- main. Called from tests/value/split_return.i:200. [eva] Recording results for escaping [eva] Done for function escaping [eva] Recording results for main9 [eva] Done for function main9 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function escaping: p ∈ ESCAPINGADDR [eva:final-states] Values at end of function f2: i2 ∈ {0; 5} __retres ∈ {0; 5; 7} [eva:final-states] Values at end of function f3: i3 ∈ {0; 5} res1 ∈ {-2; 7} res2 ∈ {-2; 7} [eva:final-states] Values at end of function f4: i4 ∈ {0; 5} __retres ∈ {4; 7} [eva:final-states] Values at end of function f5: i5 ∈ {0; 5} res ∈ {-2; 7} [eva:final-states] Values at end of function f6: i ∈ [-5..5] [eva:final-states] Values at end of function f7: v7 ∈ {0; 1} __retres ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function f8: x ∈ {-1; 4} __retres ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function main1: x ∈ [0..2147483649] r ∈ {0; 1} [eva:final-states] Values at end of function main2: i2 ∈ {0; 5} r ∈ {0; 5; 7} [eva:final-states] Values at end of function main3: i3 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main4: i4 ∈ {0; 5} r ∈ {4; 7} [eva:final-states] Values at end of function main5: i5 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main6: [eva:final-states] Values at end of function main7: v7 ∈ {0; 1} p ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function main8: x ∈ {-1; 4} pf ∈ {{ &f8 }} p ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function uninit: x ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function main9: y ∈ {0} or UNINITIALIZED q ∈ ESCAPINGADDR [eva:final-states] Values at end of function main: i2 ∈ {0; 5} i3 ∈ {0; 5} i4 ∈ {0; 5} i5 ∈ {0; 5} v7 ∈ {0; 1} [from] Computing for function escaping [from] Done for function escaping [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function main1 [from] Computing for function init <-main1 [from] Done for function init [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8 [from] Done for function main8 [from] Computing for function uninit [from] Done for function uninit [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function escaping: \result FROM \nothing [from] Function f2: i2 FROM i2 \result FROM i2 [from] Function f3: i3 FROM i3 \result FROM i3 [from] Function f4: i4 FROM i4 \result FROM i4 [from] Function f5: i5 FROM i5 \result FROM i5 [from] Function f6: \result FROM v [from] Function f7: v7 FROM v \result FROM v [from] Function f8: x FROM v; p \result FROM v; p [from] Function init: x FROM \nothing \result FROM \nothing [from] Function main1: \result FROM \nothing [from] Function main2: i2 FROM i2 [from] Function main3: i3 FROM i3 [from] Function main4: i4 FROM i4 [from] Function main5: i5 FROM i5 [from] Function main6: NO EFFECTS [from] Function main7: v7 FROM v [from] Function main8: NO EFFECTS [from] Function uninit: \result FROM rand [from] Function main9: NO EFFECTS [from] Function main: i2 FROM i2 i3 FROM i3 i4 FROM i4 i5 FROM i5 v7 FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function escaping: p [inout] Inputs for function escaping: \nothing [inout] Out (internal) for function f2: i2; __retres [inout] Inputs for function f2: i2 [inout] Out (internal) for function f3: i3; res1; res2 [inout] Inputs for function f3: i3 [inout] Out (internal) for function f4: i4; __retres [inout] Inputs for function f4: i4 [inout] Out (internal) for function f5: i5; res [inout] Inputs for function f5: i5 [inout] Out (internal) for function f6: i [inout] Inputs for function f6: v [inout] Out (internal) for function f7: v7; __retres [inout] Inputs for function f7: v [inout] Out (internal) for function f8: x; __retres [inout] Inputs for function f8: v [inout] Out (internal) for function main1: x; r [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: i2; r [inout] Inputs for function main2: i2 [inout] Out (internal) for function main3: i3; r [inout] Inputs for function main3: i3 [inout] Out (internal) for function main4: i4; r [inout] Inputs for function main4: i4 [inout] Out (internal) for function main5: i5; r [inout] Inputs for function main5: i5 [inout] Out (internal) for function main6: tmp [inout] Inputs for function main6: v [inout] Out (internal) for function main7: v7; p [inout] Inputs for function main7: v; v7 [inout] Out (internal) for function main8: x; pf; p; tmp [inout] Inputs for function main8: v [inout] Out (internal) for function uninit: x [inout] Inputs for function uninit: rand [inout] Out (internal) for function main9: y; q [inout] Inputs for function main9: rand [inout] Out (internal) for function main: i2; i3; i4; i5; v7 [inout] Inputs for function main: i2; i3; i4; i5; v; v7; rand [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'init' -------------------------------------------------------------------------------- [ Extern ] Post-condition (file tests/value/split_return.i, line 12) Unverifiable but considered Valid. [ Extern ] Assigns (file tests/value/split_return.i, line 10) Unverifiable but considered Valid. [ Extern ] Froms (file tests/value/split_return.i, line 10) Unverifiable but considered Valid. [ Extern ] Froms (file tests/value/split_return.i, line 11) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main1' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/value/split_return.i, line 27) Locally valid, but unreachable. By Eva because: - Unreachable program point (file tests/value/split_return.i, line 27) [Unreachable] Unreachable program point (file tests/value/split_return.i, line 27) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main2' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/value/split_return.i, line 51) by Eva. [ Valid ] Assertion (file tests/value/split_return.i, line 54) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main3' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/value/split_return.i, line 76) tried with Eva. [ - ] Assertion (file tests/value/split_return.i, line 78) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main4' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/value/split_return.i, line 97) tried with Eva. [ - ] Assertion (file tests/value/split_return.i, line 99) tried with Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main5' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/value/split_return.i, line 120) by Eva. [ Valid ] Assertion (file tests/value/split_return.i, line 122) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'f6' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/value/split_return.i, line 130) tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 5 Completely validated 4 Considered valid 5 To be validated 1 Dead property 1 Unreachable 16 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/split_return.1.res.oracle0000666000000000000000000003473013571573400021615 0ustar [kernel] Parsing tests/value/split_return.i (no preprocessing) [eva] Splitting return states on: \return(f7) == 0, 3 (user) \return(init) == 0 (auto) \return(f2) == 0 (auto) \return(f3) == -2 (auto) \return(f4) == 4 (auto) \return(f5) == -2 (auto) \return(f6) == 0 (auto) \return(f8) == 0 (auto) \return(escaping) == 0 (auto) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i2 ∈ [--..--] i3 ∈ [--..--] i4 ∈ [--..--] i5 ∈ [--..--] v ∈ [--..--] v7 ∈ {0} rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/split_return.i:204. [eva] computing for function init <- main1 <- main. Called from tests/value/split_return.i:17. [eva] using specification for function init [eva] Done for function init [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/split_return.i:205. [eva] computing for function f2 <- main2 <- main. Called from tests/value/split_return.i:48. [eva] Recording results for f2 [eva] Done for function f2 [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {0}, {0} [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {5; 7}, {5} [eva] tests/value/split_return.i:51: assertion got status valid. [eva] tests/value/split_return.i:53: Frama_C_show_each_f2_2: {5; 7}, {5} [eva] tests/value/split_return.i:54: assertion got status valid. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/split_return.i:206. [eva] computing for function f3 <- main3 <- main. Called from tests/value/split_return.i:73. [eva] Recording results for f3 [eva] Done for function f3 [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {-2}, {0} [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {7}, {5} [eva] tests/value/split_return.i:76: assertion got status valid. [eva] tests/value/split_return.i:78: assertion got status valid. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] tests/value/split_return.i:97: assertion got status valid. [eva] tests/value/split_return.i:99: assertion got status valid. [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/split_return.i:208. [eva] computing for function f5 <- main5 <- main. Called from tests/value/split_return.i:117. [eva] Recording results for f5 [eva] Done for function f5 [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {-2}, {0} [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {7}, {5} [eva] tests/value/split_return.i:120: assertion got status valid. [eva] tests/value/split_return.i:122: assertion got status valid. [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/value/split_return.i:209. [eva] computing for function f6 <- main6 <- main. Called from tests/value/split_return.i:135. [eva:alarm] tests/value/split_return.i:130: Warning: assertion got status unknown. [eva] tests/value/split_return.i:131: cannot properly split on \result == 0 [eva] Recording results for f6 [eva] Done for function f6 [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/value/split_return.i:210. [eva] computing for function f7 <- main7 <- main. Called from tests/value/split_return.i:148. [eva] Recording results for f7 [eva] Done for function f7 [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {0}, {0} [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {{ &v }}, {1} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/value/split_return.i:212. [eva] computing for function uninit <- main9 <- main. Called from tests/value/split_return.i:199. [eva] Recording results for uninit [eva] Done for function uninit [eva] computing for function escaping <- main9 <- main. Called from tests/value/split_return.i:200. [eva:locals-escaping] tests/value/split_return.i:192: Warning: locals {x} escaping the scope of a block of escaping through p [eva] Recording results for escaping [eva] Done for function escaping [eva] Recording results for main9 [eva] Done for function main9 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function escaping: p ∈ ESCAPINGADDR [eva:final-states] Values at end of function f2: i2 ∈ {0; 5} __retres ∈ {0; 5; 7} [eva:final-states] Values at end of function f3: i3 ∈ {0; 5} res1 ∈ {-2; 7} res2 ∈ {-2; 7} [eva:final-states] Values at end of function f4: i4 ∈ {0; 5} __retres ∈ {4; 7} [eva:final-states] Values at end of function f5: i5 ∈ {0; 5} res ∈ {-2; 7} [eva:final-states] Values at end of function f6: i ∈ [-5..5] [eva:final-states] Values at end of function f7: v7 ∈ {0; 1} __retres ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function f8: x ∈ {-1; 4} __retres ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function main1: x ∈ [0..2147483649] r ∈ {0; 1} [eva:final-states] Values at end of function main2: i2 ∈ {0; 5} r ∈ {0; 5; 7} [eva:final-states] Values at end of function main3: i3 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main4: i4 ∈ {0; 5} r ∈ {4; 7} [eva:final-states] Values at end of function main5: i5 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main6: [eva:final-states] Values at end of function main7: v7 ∈ {0; 1} p ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function main8: x ∈ {-1; 4} pf ∈ {{ &f8 }} p ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function uninit: x ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function main9: y ∈ {0} or UNINITIALIZED q ∈ ESCAPINGADDR [eva:final-states] Values at end of function main: i2 ∈ {0; 5} i3 ∈ {0; 5} i4 ∈ {0; 5} i5 ∈ {0; 5} v7 ∈ {0; 1} [from] Computing for function escaping [from] Done for function escaping [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function main1 [from] Computing for function init <-main1 [from] Done for function init [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8 [from] Done for function main8 [from] Computing for function uninit [from] Done for function uninit [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function escaping: \result FROM \nothing [from] Function f2: i2 FROM i2 \result FROM i2 [from] Function f3: i3 FROM i3 \result FROM i3 [from] Function f4: i4 FROM i4 \result FROM i4 [from] Function f5: i5 FROM i5 \result FROM i5 [from] Function f6: \result FROM v [from] Function f7: v7 FROM v \result FROM v [from] Function f8: x FROM v; p \result FROM v; p [from] Function init: x FROM \nothing \result FROM \nothing [from] Function main1: \result FROM \nothing [from] Function main2: i2 FROM i2 [from] Function main3: i3 FROM i3 [from] Function main4: i4 FROM i4 [from] Function main5: i5 FROM i5 [from] Function main6: NO EFFECTS [from] Function main7: v7 FROM v [from] Function main8: NO EFFECTS [from] Function uninit: \result FROM rand [from] Function main9: NO EFFECTS [from] Function main: i2 FROM i2 i3 FROM i3 i4 FROM i4 i5 FROM i5 v7 FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function escaping: p [inout] Inputs for function escaping: \nothing [inout] Out (internal) for function f2: i2; __retres [inout] Inputs for function f2: i2 [inout] Out (internal) for function f3: i3; res1; res2 [inout] Inputs for function f3: i3 [inout] Out (internal) for function f4: i4; __retres [inout] Inputs for function f4: i4 [inout] Out (internal) for function f5: i5; res [inout] Inputs for function f5: i5 [inout] Out (internal) for function f6: i [inout] Inputs for function f6: v [inout] Out (internal) for function f7: v7; __retres [inout] Inputs for function f7: v [inout] Out (internal) for function f8: x; __retres [inout] Inputs for function f8: v [inout] Out (internal) for function main1: x; r [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: i2; r [inout] Inputs for function main2: i2 [inout] Out (internal) for function main3: i3; r [inout] Inputs for function main3: i3 [inout] Out (internal) for function main4: i4; r [inout] Inputs for function main4: i4 [inout] Out (internal) for function main5: i5; r [inout] Inputs for function main5: i5 [inout] Out (internal) for function main6: tmp [inout] Inputs for function main6: v [inout] Out (internal) for function main7: v7; p [inout] Inputs for function main7: v; v7 [inout] Out (internal) for function main8: x; pf; p; tmp [inout] Inputs for function main8: v [inout] Out (internal) for function uninit: x [inout] Inputs for function uninit: rand [inout] Out (internal) for function main9: y; q [inout] Inputs for function main9: rand [inout] Out (internal) for function main: i2; i3; i4; i5; v7 [inout] Inputs for function main: i2; i3; i4; i5; v; v7; rand [report] Computing properties status... -------------------------------------------------------------------------------- --- Properties of Function 'init' -------------------------------------------------------------------------------- [ Extern ] Post-condition (file tests/value/split_return.i, line 12) Unverifiable but considered Valid. [ Extern ] Assigns (file tests/value/split_return.i, line 10) Unverifiable but considered Valid. [ Extern ] Froms (file tests/value/split_return.i, line 10) Unverifiable but considered Valid. [ Extern ] Froms (file tests/value/split_return.i, line 11) Unverifiable but considered Valid. [ Valid ] Default behavior by Frama-C kernel. -------------------------------------------------------------------------------- --- Properties of Function 'main1' -------------------------------------------------------------------------------- [ Dead ] Assertion (file tests/value/split_return.i, line 27) Locally valid, but unreachable. By Eva because: - Unreachable program point (file tests/value/split_return.i, line 27) [Unreachable] Unreachable program point (file tests/value/split_return.i, line 27) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main2' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/value/split_return.i, line 51) by Eva. [ Valid ] Assertion (file tests/value/split_return.i, line 54) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main3' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/value/split_return.i, line 76) by Eva. [ Valid ] Assertion (file tests/value/split_return.i, line 78) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main4' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/value/split_return.i, line 97) by Eva. [ Valid ] Assertion (file tests/value/split_return.i, line 99) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'main5' -------------------------------------------------------------------------------- [ Valid ] Assertion (file tests/value/split_return.i, line 120) by Eva. [ Valid ] Assertion (file tests/value/split_return.i, line 122) by Eva. -------------------------------------------------------------------------------- --- Properties of Function 'f6' -------------------------------------------------------------------------------- [ - ] Assertion (file tests/value/split_return.i, line 130) tried with Eva. -------------------------------------------------------------------------------- --- Status Report Summary -------------------------------------------------------------------------------- 9 Completely validated 4 Considered valid 1 To be validated 1 Dead property 1 Unreachable 16 Total -------------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/value/oracle/split_return.2.res.oracle0000666000000000000000000000032613571573400021610 0ustar [kernel] Parsing tests/value/split_return.i (no preprocessing) [eva] User Error: incorrect argument for option -eva-slevel-function (no function 'NON_EXISTING'). [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/split_return.3.res.oracle0000666000000000000000000003567113571573400021624 0ustar [kernel] Parsing tests/value/split_return.i (no preprocessing) [eva] Splitting return states on: \full_split(@all) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i2 ∈ [--..--] i3 ∈ [--..--] i4 ∈ [--..--] i5 ∈ [--..--] v ∈ [--..--] v7 ∈ {0} rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/split_return.i:204. [eva] computing for function init <- main1 <- main. Called from tests/value/split_return.i:17. [eva] using specification for function init [eva] Done for function init [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/split_return.i:205. [eva] computing for function f2 <- main2 <- main. Called from tests/value/split_return.i:48. [eva] Recording results for f2 [eva] Done for function f2 [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {0}, {0} [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {5}, {5} [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {7}, {5} [eva] tests/value/split_return.i:51: assertion got status valid. [eva] tests/value/split_return.i:53: Frama_C_show_each_f2_2: {5}, {5} [eva] tests/value/split_return.i:53: Frama_C_show_each_f2_2: {7}, {5} [eva] tests/value/split_return.i:54: assertion got status valid. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/split_return.i:206. [eva] computing for function f3 <- main3 <- main. Called from tests/value/split_return.i:73. [eva] Recording results for f3 [eva] Done for function f3 [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {7}, {5} [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {-2}, {0} [eva] tests/value/split_return.i:76: assertion got status valid. [eva] tests/value/split_return.i:78: assertion got status valid. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main3 <- main. Called from tests/value/split_return.i:206. [eva] computing for function f3 <- main3 <- main. Called from tests/value/split_return.i:73. [eva] Recording results for f3 [eva] Done for function f3 [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {7}, {5} [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {-2}, {0} [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] tests/value/split_return.i:97: assertion got status valid. [eva] tests/value/split_return.i:99: assertion got status valid. [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/split_return.i:208. [eva] computing for function f5 <- main5 <- main. Called from tests/value/split_return.i:117. [eva] Recording results for f5 [eva] Done for function f5 [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {7}, {5} [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {-2}, {0} [eva] tests/value/split_return.i:120: assertion got status valid. [eva] tests/value/split_return.i:122: assertion got status valid. [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/value/split_return.i:209. [eva] computing for function f6 <- main6 <- main. Called from tests/value/split_return.i:135. [eva:alarm] tests/value/split_return.i:130: Warning: assertion got status unknown. [eva] Recording results for f6 [eva] Done for function f6 [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main6 <- main. Called from tests/value/split_return.i:209. [eva] computing for function f6 <- main6 <- main. Called from tests/value/split_return.i:135. [eva] Recording results for f6 [eva] Done for function f6 [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/value/split_return.i:210. [eva] computing for function f7 <- main7 <- main. Called from tests/value/split_return.i:148. [eva] Recording results for f7 [eva] Done for function f7 [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {0}, {0} [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {{ &v }}, {1} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main7 <- main. Called from tests/value/split_return.i:210. [eva] computing for function f7 <- main7 <- main. Called from tests/value/split_return.i:148. [eva] Recording results for f7 [eva] Done for function f7 [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {0}, {0} [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {{ &v }}, {1} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/value/split_return.i:212. [eva] computing for function uninit <- main9 <- main. Called from tests/value/split_return.i:199. [eva] Recording results for uninit [eva] Done for function uninit [eva] computing for function escaping <- main9 <- main. Called from tests/value/split_return.i:200. [eva:locals-escaping] tests/value/split_return.i:192: Warning: locals {x} escaping the scope of a block of escaping through p [eva] Recording results for escaping [eva] Done for function escaping [eva] computing for function escaping <- main9 <- main. Called from tests/value/split_return.i:200. [eva] Recording results for escaping [eva] Done for function escaping [eva] Recording results for main9 [eva] Done for function main9 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function escaping: p ∈ ESCAPINGADDR [eva:final-states] Values at end of function f2: i2 ∈ {0; 5} __retres ∈ {0; 5; 7} [eva:final-states] Values at end of function f3: i3 ∈ {0; 5} res1 ∈ {-2; 7} res2 ∈ {-2; 7} [eva:final-states] Values at end of function f4: i4 ∈ {0; 5} __retres ∈ {4; 7} [eva:final-states] Values at end of function f5: i5 ∈ {0; 5} res ∈ {-2; 7} [eva:final-states] Values at end of function f6: i ∈ [-5..5] [eva:final-states] Values at end of function f7: v7 ∈ {0; 1} __retres ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function f8: x ∈ {-1; 4} __retres ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function main1: x ∈ [0..2147483649] r ∈ {0; 1} [eva:final-states] Values at end of function main2: i2 ∈ {0; 5} r ∈ {0; 5; 7} [eva:final-states] Values at end of function main3: i3 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main4: i4 ∈ {0; 5} r ∈ {4; 7} [eva:final-states] Values at end of function main5: i5 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main6: [eva:final-states] Values at end of function main7: v7 ∈ {0; 1} p ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function main8: x ∈ {-1; 4} pf ∈ {{ &f8 }} p ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function uninit: x ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function main9: y ∈ {0} or UNINITIALIZED q ∈ ESCAPINGADDR [eva:final-states] Values at end of function main: i2 ∈ {0; 5} i3 ∈ {0; 5} i4 ∈ {0; 5} i5 ∈ {0; 5} v7 ∈ {0; 1} [from] Computing for function escaping [from] Done for function escaping [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function main1 [from] Computing for function init <-main1 [from] Done for function init [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8 [from] Done for function main8 [from] Computing for function uninit [from] Done for function uninit [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function escaping: \result FROM \nothing [from] Function f2: i2 FROM i2 \result FROM i2 [from] Function f3: i3 FROM i3 \result FROM i3 [from] Function f4: i4 FROM i4 \result FROM i4 [from] Function f5: i5 FROM i5 \result FROM i5 [from] Function f6: \result FROM v [from] Function f7: v7 FROM v \result FROM v [from] Function f8: x FROM v; p \result FROM v; p [from] Function init: x FROM \nothing \result FROM \nothing [from] Function main1: \result FROM \nothing [from] Function main2: i2 FROM i2 [from] Function main3: i3 FROM i3 [from] Function main4: i4 FROM i4 [from] Function main5: i5 FROM i5 [from] Function main6: NO EFFECTS [from] Function main7: v7 FROM v [from] Function main8: NO EFFECTS [from] Function uninit: \result FROM rand [from] Function main9: NO EFFECTS [from] Function main: i2 FROM i2 i3 FROM i3 i4 FROM i4 i5 FROM i5 v7 FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function escaping: p [inout] Inputs for function escaping: \nothing [inout] Out (internal) for function f2: i2; __retres [inout] Inputs for function f2: i2 [inout] Out (internal) for function f3: i3; res1; res2 [inout] Inputs for function f3: i3 [inout] Out (internal) for function f4: i4; __retres [inout] Inputs for function f4: i4 [inout] Out (internal) for function f5: i5; res [inout] Inputs for function f5: i5 [inout] Out (internal) for function f6: i [inout] Inputs for function f6: v [inout] Out (internal) for function f7: v7; __retres [inout] Inputs for function f7: v [inout] Out (internal) for function f8: x; __retres [inout] Inputs for function f8: v [inout] Out (internal) for function main1: x; r [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: i2; r [inout] Inputs for function main2: i2 [inout] Out (internal) for function main3: i3; r [inout] Inputs for function main3: i3 [inout] Out (internal) for function main4: i4; r [inout] Inputs for function main4: i4 [inout] Out (internal) for function main5: i5; r [inout] Inputs for function main5: i5 [inout] Out (internal) for function main6: tmp [inout] Inputs for function main6: v [inout] Out (internal) for function main7: v7; p [inout] Inputs for function main7: v; v7 [inout] Out (internal) for function main8: x; pf; p; tmp [inout] Inputs for function main8: v [inout] Out (internal) for function uninit: x [inout] Inputs for function uninit: rand [inout] Out (internal) for function main9: y; q [inout] Inputs for function main9: rand [inout] Out (internal) for function main: i2; i3; i4; i5; v7 [inout] Inputs for function main: i2; i3; i4; i5; v; v7; rand frama-c-20.0-Calcium/tests/value/oracle/split_return.4.res.oracle0000666000000000000000000007224413571573400021622 0ustar [kernel] Parsing tests/value/split_return.i (no preprocessing) [eva] Splitting return states on: \full_split(f2) \return(f7) == 0, 3 (user) other functions: \full_split(@all) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i2 ∈ [--..--] i3 ∈ [--..--] i4 ∈ [--..--] i5 ∈ [--..--] v ∈ [--..--] v7 ∈ {0} rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/split_return.i:204. [eva] computing for function init <- main1 <- main. Called from tests/value/split_return.i:17. [eva] using specification for function init [eva] Done for function init [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/split_return.i:205. [eva] computing for function f2 <- main2 <- main. Called from tests/value/split_return.i:48. [eva] Recording results for f2 [eva] Done for function f2 [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {0}, {0} [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {5}, {5} [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {7}, {5} [eva] tests/value/split_return.i:51: assertion got status valid. [eva] tests/value/split_return.i:53: Frama_C_show_each_f2_2: {5}, {5} [eva] tests/value/split_return.i:53: Frama_C_show_each_f2_2: {7}, {5} [eva] tests/value/split_return.i:54: assertion got status valid. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/split_return.i:206. [eva] computing for function f3 <- main3 <- main. Called from tests/value/split_return.i:73. [eva] Recording results for f3 [eva] Done for function f3 [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {7}, {5} [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {-2}, {0} [eva] tests/value/split_return.i:76: assertion got status valid. [eva] tests/value/split_return.i:78: assertion got status valid. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main3 <- main. Called from tests/value/split_return.i:206. [eva] computing for function f3 <- main3 <- main. Called from tests/value/split_return.i:73. [eva] Recording results for f3 [eva] Done for function f3 [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {7}, {5} [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {-2}, {0} [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] tests/value/split_return.i:97: assertion got status valid. [eva] tests/value/split_return.i:99: assertion got status valid. [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/split_return.i:208. [eva] computing for function f5 <- main5 <- main. Called from tests/value/split_return.i:117. [eva] Recording results for f5 [eva] Done for function f5 [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {7}, {5} [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {-2}, {0} [eva] tests/value/split_return.i:120: assertion got status valid. [eva] tests/value/split_return.i:122: assertion got status valid. [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/value/split_return.i:209. [eva] computing for function f6 <- main6 <- main. Called from tests/value/split_return.i:135. [eva:alarm] tests/value/split_return.i:130: Warning: assertion got status unknown. [eva] Recording results for f6 [eva] Done for function f6 [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main6 <- main. Called from tests/value/split_return.i:209. [eva] computing for function f6 <- main6 <- main. Called from tests/value/split_return.i:135. [eva] Recording results for f6 [eva] Done for function f6 [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/value/split_return.i:210. [eva] computing for function f7 <- main7 <- main. Called from tests/value/split_return.i:148. [eva] Recording results for f7 [eva] Done for function f7 [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {0}, {0} [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {{ &v }}, {1} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main7 <- main. Called from tests/value/split_return.i:210. [eva] computing for function f7 <- main7 <- main. Called from tests/value/split_return.i:148. [eva] Recording results for f7 [eva] Done for function f7 [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {0}, {0} [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {{ &v }}, {1} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/value/split_return.i:212. [eva] computing for function uninit <- main9 <- main. Called from tests/value/split_return.i:199. [eva] Recording results for uninit [eva] Done for function uninit [eva] computing for function escaping <- main9 <- main. Called from tests/value/split_return.i:200. [eva:locals-escaping] tests/value/split_return.i:192: Warning: locals {x} escaping the scope of a block of escaping through p [eva] Recording results for escaping [eva] Done for function escaping [eva] computing for function escaping <- main9 <- main. Called from tests/value/split_return.i:200. [eva] Recording results for escaping [eva] Done for function escaping [eva] Recording results for main9 [eva] Done for function main9 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function escaping: p ∈ ESCAPINGADDR [eva:final-states] Values at end of function f2: i2 ∈ {0; 5} __retres ∈ {0; 5; 7} [eva:final-states] Values at end of function f3: i3 ∈ {0; 5} res1 ∈ {-2; 7} res2 ∈ {-2; 7} [eva:final-states] Values at end of function f4: i4 ∈ {0; 5} __retres ∈ {4; 7} [eva:final-states] Values at end of function f5: i5 ∈ {0; 5} res ∈ {-2; 7} [eva:final-states] Values at end of function f6: i ∈ [-5..5] [eva:final-states] Values at end of function f7: v7 ∈ {0; 1} __retres ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function f8: x ∈ {-1; 4} __retres ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function main1: x ∈ [0..2147483649] r ∈ {0; 1} [eva:final-states] Values at end of function main2: i2 ∈ {0; 5} r ∈ {0; 5; 7} [eva:final-states] Values at end of function main3: i3 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main4: i4 ∈ {0; 5} r ∈ {4; 7} [eva:final-states] Values at end of function main5: i5 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main6: [eva:final-states] Values at end of function main7: v7 ∈ {0; 1} p ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function main8: x ∈ {-1; 4} pf ∈ {{ &f8 }} p ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function uninit: x ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function main9: y ∈ {0} or UNINITIALIZED q ∈ ESCAPINGADDR [eva:final-states] Values at end of function main: i2 ∈ {0; 5} i3 ∈ {0; 5} i4 ∈ {0; 5} i5 ∈ {0; 5} v7 ∈ {0; 1} [from] Computing for function escaping [from] Done for function escaping [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function main1 [from] Computing for function init <-main1 [from] Done for function init [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8 [from] Done for function main8 [from] Computing for function uninit [from] Done for function uninit [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function escaping: \result FROM \nothing [from] Function f2: i2 FROM i2 \result FROM i2 [from] Function f3: i3 FROM i3 \result FROM i3 [from] Function f4: i4 FROM i4 \result FROM i4 [from] Function f5: i5 FROM i5 \result FROM i5 [from] Function f6: \result FROM v [from] Function f7: v7 FROM v \result FROM v [from] Function f8: x FROM v; p \result FROM v; p [from] Function init: x FROM \nothing \result FROM \nothing [from] Function main1: \result FROM \nothing [from] Function main2: i2 FROM i2 [from] Function main3: i3 FROM i3 [from] Function main4: i4 FROM i4 [from] Function main5: i5 FROM i5 [from] Function main6: NO EFFECTS [from] Function main7: v7 FROM v [from] Function main8: NO EFFECTS [from] Function uninit: \result FROM rand [from] Function main9: NO EFFECTS [from] Function main: i2 FROM i2 i3 FROM i3 i4 FROM i4 i5 FROM i5 v7 FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function escaping: p [inout] Inputs for function escaping: \nothing [inout] Out (internal) for function f2: i2; __retres [inout] Inputs for function f2: i2 [inout] Out (internal) for function f3: i3; res1; res2 [inout] Inputs for function f3: i3 [inout] Out (internal) for function f4: i4; __retres [inout] Inputs for function f4: i4 [inout] Out (internal) for function f5: i5; res [inout] Inputs for function f5: i5 [inout] Out (internal) for function f6: i [inout] Inputs for function f6: v [inout] Out (internal) for function f7: v7; __retres [inout] Inputs for function f7: v [inout] Out (internal) for function f8: x; __retres [inout] Inputs for function f8: v [inout] Out (internal) for function main1: x; r [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: i2; r [inout] Inputs for function main2: i2 [inout] Out (internal) for function main3: i3; r [inout] Inputs for function main3: i3 [inout] Out (internal) for function main4: i4; r [inout] Inputs for function main4: i4 [inout] Out (internal) for function main5: i5; r [inout] Inputs for function main5: i5 [inout] Out (internal) for function main6: tmp [inout] Inputs for function main6: v [inout] Out (internal) for function main7: v7; p [inout] Inputs for function main7: v; v7 [inout] Out (internal) for function main8: x; pf; p; tmp [inout] Inputs for function main8: v [inout] Out (internal) for function uninit: x [inout] Inputs for function uninit: rand [inout] Out (internal) for function main9: y; q [inout] Inputs for function main9: rand [inout] Out (internal) for function main: i2; i3; i4; i5; v7 [inout] Inputs for function main: i2; i3; i4; i5; v; v7; rand [eva] Warning: option -eva-split-return-function: 'f2' previously bound to 'full split'; now bound to 'auto split'. [eva] Splitting return states on: \return(f2) == 0 (auto) \return(f7) == 0, 3 (user) other functions: \full_split(@all) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i2 ∈ [--..--] i3 ∈ [--..--] i4 ∈ [--..--] i5 ∈ [--..--] v ∈ [--..--] v7 ∈ {0} rand ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/split_return.i:204. [eva] computing for function init <- main1 <- main. Called from tests/value/split_return.i:17. [eva] Done for function init [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/split_return.i:205. [eva] computing for function f2 <- main2 <- main. Called from tests/value/split_return.i:48. [eva] Recording results for f2 [eva] Done for function f2 [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {0}, {0} [eva] tests/value/split_return.i:49: Frama_C_show_each_f2: {5; 7}, {5} [eva] tests/value/split_return.i:53: Frama_C_show_each_f2_2: {5; 7}, {5} [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/split_return.i:206. [eva] computing for function f3 <- main3 <- main. Called from tests/value/split_return.i:73. [eva] Recording results for f3 [eva] Done for function f3 [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {7}, {5} [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {-2}, {0} [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main3 <- main. Called from tests/value/split_return.i:206. [eva] computing for function f3 <- main3 <- main. Called from tests/value/split_return.i:73. [eva] Recording results for f3 [eva] Done for function f3 [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {7}, {5} [eva] tests/value/split_return.i:74: Frama_C_show_each_f3: {-2}, {0} [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main4 <- main. Called from tests/value/split_return.i:207. [eva] computing for function f4 <- main4 <- main. Called from tests/value/split_return.i:94. [eva] Recording results for f4 [eva] Done for function f4 [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {4}, {0} [eva] tests/value/split_return.i:95: Frama_C_show_each_f4: {7}, {5} [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/split_return.i:208. [eva] computing for function f5 <- main5 <- main. Called from tests/value/split_return.i:117. [eva] Recording results for f5 [eva] Done for function f5 [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {7}, {5} [eva] tests/value/split_return.i:118: Frama_C_show_each_f5: {-2}, {0} [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/value/split_return.i:209. [eva] computing for function f6 <- main6 <- main. Called from tests/value/split_return.i:135. [eva] Recording results for f6 [eva] Done for function f6 [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main6 <- main. Called from tests/value/split_return.i:209. [eva] computing for function f6 <- main6 <- main. Called from tests/value/split_return.i:135. [eva] Recording results for f6 [eva] Done for function f6 [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/value/split_return.i:210. [eva] computing for function f7 <- main7 <- main. Called from tests/value/split_return.i:148. [eva] Recording results for f7 [eva] Done for function f7 [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {0}, {0} [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {{ &v }}, {1} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main7 <- main. Called from tests/value/split_return.i:210. [eva] computing for function f7 <- main7 <- main. Called from tests/value/split_return.i:148. [eva] Recording results for f7 [eva] Done for function f7 [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {0}, {0} [eva] tests/value/split_return.i:153: Frama_C_show_each_NULL: {{ &v }}, {1} [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main8 <- main. Called from tests/value/split_return.i:211. [eva] computing for function f8 <- main8 <- main. Called from tests/value/split_return.i:171. [eva] Recording results for f8 [eva] Done for function f8 [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {4}, {{ &x }} [eva] tests/value/split_return.i:172: Frama_C_show_each_then8: {-1}, {0} [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/value/split_return.i:212. [eva] computing for function uninit <- main9 <- main. Called from tests/value/split_return.i:199. [eva] Recording results for uninit [eva] Done for function uninit [eva] computing for function escaping <- main9 <- main. Called from tests/value/split_return.i:200. [eva] Recording results for escaping [eva] Done for function escaping [eva] computing for function escaping <- main9 <- main. Called from tests/value/split_return.i:200. [eva] Recording results for escaping [eva] Done for function escaping [eva] Recording results for main9 [eva] Done for function main9 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function escaping: p ∈ ESCAPINGADDR [eva:final-states] Values at end of function f2: i2 ∈ {0; 5} __retres ∈ {0; 5; 7} [eva:final-states] Values at end of function f3: i3 ∈ {0; 5} res1 ∈ {-2; 7} res2 ∈ {-2; 7} [eva:final-states] Values at end of function f4: i4 ∈ {0; 5} __retres ∈ {4; 7} [eva:final-states] Values at end of function f5: i5 ∈ {0; 5} res ∈ {-2; 7} [eva:final-states] Values at end of function f6: i ∈ [-5..5] [eva:final-states] Values at end of function f7: v7 ∈ {0; 1} __retres ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function f8: x ∈ {-1; 4} __retres ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function main1: x ∈ [0..2147483649] r ∈ {0; 1} [eva:final-states] Values at end of function main2: i2 ∈ {0; 5} r ∈ {0; 5; 7} [eva:final-states] Values at end of function main3: i3 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main4: i4 ∈ {0; 5} r ∈ {4; 7} [eva:final-states] Values at end of function main5: i5 ∈ {0; 5} r ∈ {-2; 7} [eva:final-states] Values at end of function main6: [eva:final-states] Values at end of function main7: v7 ∈ {0; 1} p ∈ {{ NULL ; &v }} [eva:final-states] Values at end of function main8: x ∈ {-1; 4} pf ∈ {{ &f8 }} p ∈ {{ NULL ; &x }} [eva:final-states] Values at end of function uninit: x ∈ {0} or UNINITIALIZED [eva:final-states] Values at end of function main9: y ∈ {0} or UNINITIALIZED q ∈ ESCAPINGADDR [eva:final-states] Values at end of function main: i2 ∈ {0; 5} i3 ∈ {0; 5} i4 ∈ {0; 5} i5 ∈ {0; 5} v7 ∈ {0; 1} [from] Computing for function escaping [from] Done for function escaping [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function f5 [from] Done for function f5 [from] Computing for function f6 [from] Done for function f6 [from] Computing for function f7 [from] Done for function f7 [from] Computing for function f8 [from] Done for function f8 [from] Computing for function main1 [from] Computing for function init <-main1 [from] Done for function init [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main5 [from] Done for function main5 [from] Computing for function main6 [from] Done for function main6 [from] Computing for function main7 [from] Done for function main7 [from] Computing for function main8 [from] Done for function main8 [from] Computing for function uninit [from] Done for function uninit [from] Computing for function main9 [from] Done for function main9 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function escaping: \result FROM \nothing [from] Function f2: i2 FROM i2 \result FROM i2 [from] Function f3: i3 FROM i3 \result FROM i3 [from] Function f4: i4 FROM i4 \result FROM i4 [from] Function f5: i5 FROM i5 \result FROM i5 [from] Function f6: \result FROM v [from] Function f7: v7 FROM v \result FROM v [from] Function f8: x FROM v; p \result FROM v; p [from] Function init: x FROM \nothing \result FROM \nothing [from] Function main1: \result FROM \nothing [from] Function main2: i2 FROM i2 [from] Function main3: i3 FROM i3 [from] Function main4: i4 FROM i4 [from] Function main5: i5 FROM i5 [from] Function main6: NO EFFECTS [from] Function main7: v7 FROM v [from] Function main8: NO EFFECTS [from] Function uninit: \result FROM rand [from] Function main9: NO EFFECTS [from] Function main: i2 FROM i2 i3 FROM i3 i4 FROM i4 i5 FROM i5 v7 FROM v [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function escaping: p [inout] Inputs for function escaping: \nothing [inout] Out (internal) for function f2: i2; __retres [inout] Inputs for function f2: i2 [inout] Out (internal) for function f3: i3; res1; res2 [inout] Inputs for function f3: i3 [inout] Out (internal) for function f4: i4; __retres [inout] Inputs for function f4: i4 [inout] Out (internal) for function f5: i5; res [inout] Inputs for function f5: i5 [inout] Out (internal) for function f6: i [inout] Inputs for function f6: v [inout] Out (internal) for function f7: v7; __retres [inout] Inputs for function f7: v [inout] Out (internal) for function f8: x; __retres [inout] Inputs for function f8: v [inout] Out (internal) for function main1: x; r [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: i2; r [inout] Inputs for function main2: i2 [inout] Out (internal) for function main3: i3; r [inout] Inputs for function main3: i3 [inout] Out (internal) for function main4: i4; r [inout] Inputs for function main4: i4 [inout] Out (internal) for function main5: i5; r [inout] Inputs for function main5: i5 [inout] Out (internal) for function main6: tmp [inout] Inputs for function main6: v [inout] Out (internal) for function main7: v7; p [inout] Inputs for function main7: v; v7 [inout] Out (internal) for function main8: x; pf; p; tmp [inout] Inputs for function main8: v [inout] Out (internal) for function uninit: x [inout] Inputs for function uninit: rand [inout] Out (internal) for function main9: y; q [inout] Inputs for function main9: rand [inout] Out (internal) for function main: i2; i3; i4; i5; v7 [inout] Inputs for function main: i2; i3; i4; i5; v; v7; rand frama-c-20.0-Calcium/tests/value/oracle/statement_contract.res.oracle0000666000000000000000000000156613571573400022626 0ustar [kernel] Parsing tests/value/statement_contract.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization A ∈ {0} [eva] tests/value/statement_contract.i:5: function main, behavior test: postcondition got status valid. [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: d ∈ {3} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: d [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/static.res.oracle0000666000000000000000000000335613571573400020213 0ustar [kernel] Parsing tests/value/static.i (no preprocessing) [kernel] tests/value/static.i:21: Dropping side-effect in sizeof. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization GLOB ∈ {0} T[0..9] ∈ {0} IT[0..9] ∈ {0} G ∈ {0} H ∈ {0} R ∈ {0} p ∈ {0} a[0] ∈ {77} [1] ∈ {0} Rv ∈ {99} f_x ∈ {0} [eva] computing for function f <- main. Called from tests/value/static.i:19. [eva] Recording results for f [eva] Done for function f [eva] tests/value/static.i:20: Reusing old results for call to f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {{ &f_x }} [eva:final-states] Values at end of function main: GLOB ∈ {4} G ∈ {0} H ∈ {0} R ∈ {3} p ∈ {{ &a[0] }} Rv ∈ [--..--] f_x ∈ {3} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM \nothing [from] Function main: GLOB FROM \nothing G FROM T[1..4] H FROM IT[9][bits 0 to 7] R FROM \nothing p FROM \nothing Rv FROM a[0] f_x FROM \nothing \result FROM T[0] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: GLOB; G; H; R; p; Rv; tmp; tmp_0; f_x; __retres [inout] Inputs for function main: T[0..4]; IT[9][bits 0 to 7]; p; a[0]; f_x frama-c-20.0-Calcium/tests/value/oracle/strange.res.oracle0000666000000000000000000000244113571573400020361 0ustar [kernel] Parsing tests/value/strange.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization GG ∈ {0} [eva] computing for function f <- main. Called from tests/value/strange.i:13. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: GG ∈ {3} G ∈ {2} __retres ∈ {1} [eva:final-states] Values at end of function main: GG ∈ {77} lm ∈ {77} res_f ∈ {1} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: GG FROM \nothing \result FROM \nothing [from] Function main: GG FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: GG; G; __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: GG; lm; res_f; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/strings.0.res.oracle0000666000000000000000000001145213571573400020547 0ustar [kernel] Parsing tests/value/strings.i (no preprocessing) [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s1[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} [6] ∈ {32} [7] ∈ {119} [8] ∈ {111} [9] ∈ {114} [10] ∈ {108} [11] ∈ {100} [12] ∈ {0} s2[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} s5 ∈ {0} s6 ∈ {0} cc ∈ {97} Q ∈ {0} R ∈ {0} S ∈ {0} T ∈ {0} U ∈ {0} V ∈ {0} W ∈ {0} X ∈ {0} Y ∈ {0} Z ∈ {0} s3 ∈ {{ "tutu" }} s4 ∈ {{ "tutu" }} s7 ∈ {{ "hello\000 world" }} s8 ∈ {{ "hello" }} [eva] computing for function u <- main1. Called from tests/value/strings.i:39. [kernel:annot:missing-spec] tests/value/strings.i:39: Warning: Neither code nor specification for function u, generating default assigns from the prototype [eva] using specification for function u [eva] Done for function u [eva:alarm] tests/value/strings.i:39: Warning: out of bounds read. assert \valid_read(p - 4); [eva] computing for function u <- main1. Called from tests/value/strings.i:42. [eva] Done for function u [eva:alarm] tests/value/strings.i:42: Warning: out of bounds read. assert \valid_read(p + 12); [eva] computing for function u <- main1. Called from tests/value/strings.i:44. [eva] Done for function u [eva] computing for function u <- main1. Called from tests/value/strings.i:48. [eva] Done for function u [eva:alarm] tests/value/strings.i:48: Warning: out of bounds read. assert \valid_read(p - 4); [eva] computing for function u <- main1. Called from tests/value/strings.i:53. [eva] Done for function u [eva] computing for function strcpy <- main1. Called from tests/value/strings.i:53. [eva:alarm] tests/value/strings.i:21: Warning: out of bounds write. assert \valid(tmp_unroll_46); (tmp_unroll_46 from ldst++) [kernel] tests/value/strings.i:21: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for strcpy [eva] Done for function strcpy [eva] computing for function strlen <- main1. Called from tests/value/strings.i:58. [eva] Recording results for strlen [eva] Done for function strlen [eva] Recording results for main1 [eva] done for function main1 [eva] tests/value/strings.i:21: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/strings.i:39: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/strings.i:42: assertion 'Eva,mem_access' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function strcpy: NON TERMINATING FUNCTION [eva:final-states] Values at end of function strlen: s ∈ {{ &s1[6] }} l ∈ {5} [eva:final-states] Values at end of function main1: s1[0] ∈ {104} [1] ∈ {101} [2] ∈ {108} [3] ∈ {97} [4] ∈ {111} [5] ∈ {0} [6] ∈ {97} [7] ∈ {119} [8] ∈ {111} [9] ∈ {114} [10] ∈ {108} [11] ∈ {100} [12] ∈ {0} R ∈ {0} S ∈ {0} T ∈ {0; 101} p ∈ {{ &s1[5] ; &s2[3] }} __retres ∈ {5} [from] Computing for function strcpy [from] Non-terminating function strcpy (no dependencies) [from] Done for function strcpy [from] Computing for function strlen [from] Done for function strlen [from] Computing for function main1 [from] Computing for function u <-main1 [from] Done for function u [from] Done for function main1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function strcpy: NON TERMINATING - NO EFFECTS [from] Function strlen: \result FROM s1[0..4]; s [from] Function u: \result FROM \nothing [from] Function main1: s1{[3]; [6]} FROM cc R FROM \nothing (and SELF) S FROM \nothing (and SELF) T FROM s1[1] (and SELF) \result FROM s1{[0..2]; [4]}; cc [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function strcpy: src; ldst; b[0..4]; tmp_unroll_46; tmp_1_unroll_46; tmp_0_unroll_46; tmp_unroll_49; tmp_1_unroll_49; tmp_0_unroll_49; tmp_unroll_52; tmp_1_unroll_52; tmp_0_unroll_52; tmp_unroll_55; tmp_1_unroll_55; tmp_0_unroll_55; tmp_unroll_58; tmp_1_unroll_58; tmp_0_unroll_58; tmp_unroll_61; tmp_1_unroll_61; tmp_0_unroll_61 [inout] Inputs for function strcpy: a[0..5] [inout] Out (internal) for function strlen: s; l; tmp_unroll_106; tmp_unroll_109; tmp_unroll_112; tmp_unroll_115; tmp_unroll_118; tmp_unroll_121 [inout] Inputs for function strlen: s1[0..5] [inout] Out (internal) for function main1: s1{[3]; [6]}; R; S; T; p; tmp; tmp_0; tmp_1; tmp_2; a[0..9]; b[0..4]; tmp_3; tmp_4; __retres [inout] Inputs for function main1: s1[0..5]; cc frama-c-20.0-Calcium/tests/value/oracle/strings.1.res.oracle0000666000000000000000000001075213571573400020552 0ustar [kernel] Parsing tests/value/strings.i (no preprocessing) [eva] Analyzing a complete application starting at main6 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s1[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} [6] ∈ {32} [7] ∈ {119} [8] ∈ {111} [9] ∈ {114} [10] ∈ {108} [11] ∈ {100} [12] ∈ {0} s2[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} s5 ∈ {0} s6 ∈ {0} cc ∈ {97} Q ∈ {0} R ∈ {0} S ∈ {0} T ∈ {0} U ∈ {0} V ∈ {0} W ∈ {0} X ∈ {0} Y ∈ {0} Z ∈ {0} s3 ∈ {{ "tutu" }} s4 ∈ {{ "tutu" }} s7 ∈ {{ "hello\000 world" }} s8 ∈ {{ "hello" }} [eva] computing for function u <- main6. Called from tests/value/strings.i:72. [kernel:annot:missing-spec] tests/value/strings.i:72: Warning: Neither code nor specification for function u, generating default assigns from the prototype [eva] using specification for function u [eva] Done for function u [eva:alarm] tests/value/strings.i:73: Warning: pointer comparison. assert \pointer_comparable((void *)s3, (void *)s4); [eva] computing for function u <- main6. Called from tests/value/strings.i:74. [eva] Done for function u [eva] computing for function u <- main6. Called from tests/value/strings.i:76. [eva] Done for function u [eva] computing for function u <- main6. Called from tests/value/strings.i:78. [eva] Done for function u [eva:alarm] tests/value/strings.i:79: Warning: pointer comparison. assert \pointer_comparable((void *)s7, (void *)s8); [eva] computing for function u <- main6. Called from tests/value/strings.i:80. [eva] Done for function u [eva] computing for function u <- main6. Called from tests/value/strings.i:82. [eva] Done for function u [eva:alarm] tests/value/strings.i:83: Warning: pointer comparison. assert \pointer_comparable((void *)(s7 + 1), (void *)(s8 + 1)); [eva] computing for function u <- main6. Called from tests/value/strings.i:84. [eva] Done for function u [eva] computing for function u <- main6. Called from tests/value/strings.i:86. [eva] Done for function u [eva] computing for function u <- main6. Called from tests/value/strings.i:87. [eva] Done for function u [eva] computing for function u <- main6. Called from tests/value/strings.i:88. [eva] Done for function u [eva] computing for function u <- main6. Called from tests/value/strings.i:89. [eva] Done for function u [eva] computing for function u <- main6. Called from tests/value/strings.i:89. [eva] Done for function u [eva] computing for function u <- main6. Called from tests/value/strings.i:90. [eva] Done for function u [eva:alarm] tests/value/strings.i:91: Warning: pointer comparison. assert \pointer_comparable((void *)s5, (void *)s6); [eva] computing for function u <- main6. Called from tests/value/strings.i:92. [eva] Done for function u [eva:alarm] tests/value/strings.i:93: Warning: pointer comparison. assert \pointer_comparable((void *)("oh, hello" + 4), (void *)s7); [eva] Recording results for main6 [eva] done for function main6 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main6: s5 ∈ {{ "tutu" ; "hello" }} s6 ∈ {{ "tutu" ; "tutu" ; "hello" }} cc ∈ {116} Q ∈ {0} R ∈ {0} S ∈ {0} T ∈ {0} U ∈ {0} V ∈ {0} W ∈ {0} X ∈ {0; 1} Y ∈ {0; 1} Z ∈ {0; 1} s ∈ {{ "toto" }} __retres ∈ {116} [from] Computing for function main6 [from] Computing for function u <-main6 [from] Done for function u [from] Done for function main6 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function u: \result FROM \nothing [from] Function main6: s5 FROM s3; s8 s6 FROM s3; s4; s8 cc FROM "toto"[bits 0 to 7] Q FROM s7 (and SELF) R FROM s3; s4 (and SELF) S FROM \nothing (and SELF) T FROM s3 (and SELF) U FROM s7; s8 (and SELF) V FROM s4; s7 (and SELF) W FROM s7; s8 (and SELF) X FROM s3 (and SELF) Y FROM s3; s8 (and SELF) Z FROM s3; s4; s8 (and SELF) \result FROM "toto"[bits 0 to 7] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main6: s5; s6; cc; Q; R; S; T; U; V; W; X; Y; Z; s; tmp; tmp_0; tmp_1; tmp_2; tmp_3; tmp_4; tmp_5; tmp_6; tmp_7; tmp_8; tmp_9; tmp_10; tmp_11; tmp_12; tmp_13; tmp_14; __retres [inout] Inputs for function main6: s5; s6; cc; s3; s4; s7; s8; "toto"[bits 0 to 7] frama-c-20.0-Calcium/tests/value/oracle/strings.2.res.oracle0000666000000000000000000000347013571573400020552 0ustar [kernel] Parsing tests/value/strings.i (no preprocessing) [eva] Analyzing a complete application starting at main7 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s1[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} [6] ∈ {32} [7] ∈ {119} [8] ∈ {111} [9] ∈ {114} [10] ∈ {108} [11] ∈ {100} [12] ∈ {0} s2[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} s5 ∈ {0} s6 ∈ {0} cc ∈ {97} Q ∈ {0} R ∈ {0} S ∈ {0} T ∈ {0} U ∈ {0} V ∈ {0} W ∈ {0} X ∈ {0} Y ∈ {0} Z ∈ {0} s3 ∈ {{ "tutu" }} s4 ∈ {{ "tutu" }} s7 ∈ {{ "hello\000 world" }} s8 ∈ {{ "hello" }} [eva:alarm] tests/value/strings.i:101: Warning: out of bounds write. assert \valid(tmp); (tmp from f?s5 + 2:& c) [eva:alarm] tests/value/strings.i:103: Warning: out of bounds write. assert \valid(s5); [eva:alarm] tests/value/strings.i:105: Warning: out of bounds write. assert \valid(s6); [eva] Recording results for main7 [eva] done for function main7 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main7: s5 ∈ {{ &c }} s6 ∈ {{ &c }} R ∈ {84} c ∈ {116} __retres ∈ {116} [from] Computing for function main7 [from] Done for function main7 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main7: s5 FROM s3; d s6 FROM s3; e R FROM s3; d; f \result FROM s4; "tutu"[bits 0 to 7] [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main7: s5; s6; R; c; tmp; __retres [inout] Inputs for function main7: s5; s6; cc; s3; s4; "tutu"[bits 0 to 7] frama-c-20.0-Calcium/tests/value/oracle/strings.3.res.oracle0000666000000000000000000000645113571573400020555 0ustar [kernel] Parsing tests/value/strings.i (no preprocessing) [eva] Analyzing a complete application starting at main8 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s1[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} [6] ∈ {32} [7] ∈ {119} [8] ∈ {111} [9] ∈ {114} [10] ∈ {108} [11] ∈ {100} [12] ∈ {0} s2[0] ∈ {104} [1] ∈ {101} [2..3] ∈ {108} [4] ∈ {111} [5] ∈ {0} s5 ∈ {0} s6 ∈ {0} cc ∈ {97} Q ∈ {0} R ∈ {0} S ∈ {0} T ∈ {0} U ∈ {0} V ∈ {0} W ∈ {0} X ∈ {0} Y ∈ {0} Z ∈ {0} s3 ∈ {{ "tutu" }} s4 ∈ {{ "tutu" }} s7 ∈ {{ "hello\000 world" }} s8 ∈ {{ "hello" }} [eva] computing for function assigns <- main8. Called from tests/value/strings.i:127. [eva] using specification for function assigns [eva] tests/value/strings.i:121: Warning: no \from part for clause 'assigns *(p + (0 .. s - 1));' [eva] Done for function assigns [eva] computing for function strcmp <- main8. Called from tests/value/strings.i:128. [eva:alarm] tests/value/strings.i:114: Warning: out of bounds read. assert \valid_read(tmp_0); (tmp_0 from s2_0++) [eva] Recording results for strcmp [eva] Done for function strcmp [eva] Recording results for main8 [eva] done for function main8 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function strcmp: s1_0 ∈ {{ &long_chain + [0..29] }} s2_0 ∈ {{ &tc + [0..29] }} __retres ∈ [-223..121] [eva:final-states] Values at end of function main8: tc[0..29] ∈ [--..--] long_chain[0] ∈ {114} [1] ∈ {101} [2] ∈ {97} [3..4] ∈ {108} [5] ∈ {121} [6] ∈ {32} [7] ∈ {114} [8] ∈ {101} [9] ∈ {97} [10..11] ∈ {108} [12] ∈ {121} [13] ∈ {32} [14] ∈ {114} [15] ∈ {101} [16] ∈ {97} [17..18] ∈ {108} [19] ∈ {121} [20] ∈ {32} [21] ∈ {108} [22] ∈ {111} [23] ∈ {110} [24] ∈ {103} [25] ∈ {32} [26] ∈ {99} [27] ∈ {104} [28] ∈ {97} [29] ∈ {105} [30] ∈ {110} [31] ∈ {0} x ∈ [-223..121] [from] Computing for function strcmp [from] Done for function strcmp [from] Computing for function main8 [from] Computing for function assigns <-main8 [from] Done for function assigns [from] Done for function main8 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function assigns: tc[0..29] FROM ANYTHING(origin:Unknown) (and SELF) [from] Function strcmp: \result FROM s1_0; s2_0; tc[0..29]; long_chain[0..30] [from] Function main8: \result FROM ANYTHING(origin:Unknown) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function strcmp: s1_0; s2_0; tmp; tmp_0; __retres [inout] Inputs for function strcmp: tc[0..29]; long_chain[0..30] [inout] Out (internal) for function main8: tc[0..29]; long_chain[0..31]; x [inout] Inputs for function main8: ANYTHING(origin:Unknown) frama-c-20.0-Calcium/tests/value/oracle/strings_cond.res.oracle0000666000000000000000000000304213571573400021410 0ustar [kernel] Parsing tests/value/strings_cond.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function foo <- main. Called from tests/value/strings_cond.i:8. [eva] tests/value/strings_cond.i:3: Frama_C_dump_each: # Cvalue domain: s ∈ {{ "Bla" }} ==END OF DUMP== [eva] tests/value/strings_cond.i:4: Frama_C_show_each_s: {{ "Bla" }} [eva] tests/value/strings_cond.i:4: starting to merge loop iterations [eva] tests/value/strings_cond.i:4: Frama_C_show_each_s: {{ "Bla" + {0; 1} }} [eva] tests/value/strings_cond.i:4: Frama_C_show_each_s: {{ "Bla" + {0; 1; 2} }} [eva] Recording results for foo [eva] Done for function foo [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function foo: s ∈ {{ "Bla" + {3} }} [eva:final-states] Values at end of function main: [from] Computing for function foo [from] Done for function foo [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function foo: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function foo: s [inout] Inputs for function foo: "Bla" [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: "Bla" frama-c-20.0-Calcium/tests/value/oracle/struct.res.oracle0000666000000000000000000000273613571573400020251 0ustar [kernel] Parsing tests/value/struct.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization GG ∈ {0} w ∈ {0} v1 ∈ {0} v2 ∈ {0} v3 ∈ {0} T[0..1] ∈ {1} R1 ∈ {0} R2 ∈ {0} G ∈ {0} [eva:alarm] tests/value/struct.i:47: Warning: signed overflow. assert -2147483648 ≤ a + b; [eva:alarm] tests/value/struct.i:47: Warning: signed overflow. assert a + b ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: w ∈ [--..--] v1.x ∈ [--..--] .y ∈ {0} v2.x ∈ [--..--] .y ∈ {0} T[0][bits 0 to 7] ∈ {2} [bits 8 to 63]# ∈ {1} repeated %32, bits 8 to 63 R1 ∈ {65537} R2 ∈ {3} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: w FROM a; b v1.x FROM a; b .y FROM v2 v2.x FROM a (and SELF) T[0][bits 0 to 7] FROM \nothing R1 FROM T{[0][bits 16 to 31]; [1][bits 0 to 15]} R2 FROM T[0][bits 8 to 31] \result FROM a; b [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: w; v1; v2.x; T[0][bits 0 to 7]; R1; R2 [inout] Inputs for function main: w; v1.x; v2; T{[0]; [1][bits 0 to 15]} frama-c-20.0-Calcium/tests/value/oracle/struct2.res.oracle0000666000000000000000000001707513571573400020335 0ustar [kernel] Parsing tests/value/struct2.i (no preprocessing) [eva] Analyzing a complete application starting at f_precis [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 32768 to 65543] ∈ [--..--] tabst[0..9] ∈ {0} tabst2[0..9] ∈ {0} tab_s[0..1] ∈ {0} tab_s1[0..1] ∈ {0} tab_s2[0..1] ∈ {0} tab_s3[0..1] ∈ {0} tab_s4[0..1] ∈ {0} s1 ∈ {0} s2 ∈ {0} s4 ∈ {0} s5 ∈ {0} s6 ∈ {0} s8 ∈ {0} s7 ∈ {0} tabl[0..9] ∈ {0} tab1[0..1] ∈ {0} tab2[0..1] ∈ {0} tab3[0..1] ∈ {0} tab4[0..1] ∈ {0} tab5[0..1] ∈ {0} tab6[0..1] ∈ {0} p ∈ {0} p2 ∈ {0} p3 ∈ {0} p4 ∈ {0} p5 ∈ {0} p6 ∈ {0} p7 ∈ {0} q ∈ {0} r ∈ {0} s ∈ {0} t ∈ {0} a ∈ {0} b ∈ {0} v ∈ [--..--] Tab[0..9] ∈ {0} P ∈ {0} [eva:alarm] tests/value/struct2.i:74: Warning: accessing out of bounds index. assert 0 ≤ i; [eva:alarm] tests/value/struct2.i:74: Warning: accessing out of bounds index. assert i < 2; [eva:alarm] tests/value/struct2.i:76: Warning: accessing out of bounds index. assert 0 ≤ (int)(i + j); [eva:alarm] tests/value/struct2.i:76: Warning: accessing out of bounds index. assert (int)(i + j) < 2; [eva:alarm] tests/value/struct2.i:76: Warning: signed overflow. assert i + j ≤ 2147483647; [eva:alarm] tests/value/struct2.i:78: Warning: accessing out of bounds index. assert tab2[i] < 2; [eva:alarm] tests/value/struct2.i:80: Warning: accessing out of bounds index. assert tab2[1] < 2; [eva:alarm] tests/value/struct2.i:82: Warning: accessing out of bounds index. assert 0 ≤ (int)(tab2[i] + j); [eva:alarm] tests/value/struct2.i:82: Warning: accessing out of bounds index. assert (int)(tab2[i] + j) < 2; [eva:alarm] tests/value/struct2.i:99: Warning: accessing out of bounds index. assert 0 ≤ (int)(tabl[i] + y); [eva:alarm] tests/value/struct2.i:99: Warning: accessing out of bounds index. assert (int)(tabl[i] + y) < 2; [eva:alarm] tests/value/struct2.i:117: Warning: signed overflow. assert -2147483648 ≤ *p + x; [eva:alarm] tests/value/struct2.i:117: Warning: signed overflow. assert *p + x ≤ 2147483647; [eva:alarm] tests/value/struct2.i:124: Warning: out of bounds read. assert \valid_read(r); [kernel] tests/value/struct2.i:124: Warning: all target addresses were invalid. This path is assumed to be dead. [eva:alarm] tests/value/struct2.i:130: Warning: out of bounds read. assert \valid_read(p3 + 2); [eva:alarm] tests/value/struct2.i:138: Warning: signed overflow. assert *((int *)0x1020) + i ≤ 2147483647; [eva:alarm] tests/value/struct2.i:149: Warning: out of bounds write. assert \valid(*t + i); [eva:alarm] tests/value/struct2.i:185: Warning: accessing out of bounds index. assert 0 ≤ (int)(i + j); [eva:alarm] tests/value/struct2.i:185: Warning: accessing out of bounds index. assert (int)(i + j) < 2; [eva:alarm] tests/value/struct2.i:185: Warning: accessing out of bounds index. assert 0 ≤ k; [eva:alarm] tests/value/struct2.i:185: Warning: accessing out of bounds index. assert k < 2; [eva:alarm] tests/value/struct2.i:185: Warning: accessing out of bounds index. assert 0 ≤ l; [eva:alarm] tests/value/struct2.i:185: Warning: accessing out of bounds index. assert l < 2; [eva:alarm] tests/value/struct2.i:185: Warning: accessing out of bounds index. assert 0 ≤ (int)(tab3[l] + m); [eva:alarm] tests/value/struct2.i:185: Warning: accessing out of bounds index. assert (int)(tab3[l] + m) < 10; [eva:alarm] tests/value/struct2.i:185: Warning: signed overflow. assert -2147483648 ≤ tab3[l] + m; [eva:alarm] tests/value/struct2.i:185: Warning: signed overflow. assert tab3[l] + m ≤ 2147483647; [eva] Recording results for f_precis [eva] done for function f_precis [eva] tests/value/struct2.i:124: assertion 'Eva,mem_access' got final status invalid. [eva] tests/value/struct2.i:130: assertion 'Eva,mem_access' got final status invalid. [scope:rm_asserts] removing 2 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f_precis: NULL[rbits 32768 to 32799] ∈ {{ NULL + [--..--] ; (? *)&a }} [rbits 32800 to 65543] ∈ [--..--] tab_s[0] ∈ {0} [1].a ∈ [--..--] [1]{.d[0..9]; .b; .e[0..9]; .c} ∈ {0} tab_s1[0..1] ∈ {0} tab_s2[0].a ∈ [--..--] {[0]{.d[0..9]; .b; .e[0..9]; .c}; [1]} ∈ {0} tab_s3[0].a ∈ [--..--] {[0]{.d[0..9]; .b; .e[0..9]; .c}; [1]} ∈ {0} tab_s4[0].a ∈ [--..--] [0]{.d[0..9]; .b; .e[0..9]; .c} ∈ {0} [1].a ∈ [--..--] [1]{.d[0..9]; .b; .e[0..9]; .c} ∈ {0} s1.a ∈ [--..--] .d[0] ∈ {0} .d[1] ∈ [--..--] {.d[2..9]; .b; .e[0..9]} ∈ {0} .c ∈ {{ &s2 }} s2{.a; .d[0..1]} ∈ [--..--] .d[2..9] ∈ {0} .b.a ∈ [--..--] .b.b ∈ {{ &a }} .e[0..9] ∈ {0} .c ∈ {{ &s2 }} s4{.a; .d[0..9]; .b} ∈ {0} .e[0].a ∈ [-128..127] {.e{[0].b; [1..9]}; .c} ∈ {0} s8.a ∈ {0} .b ∈ {{ &a }} s7 ∈ {0} tab1[0..1] ∈ {2} tab2[0] ∈ {0; 2} [1] ∈ {0} tab3[0..1] ∈ [--..--] tab4[0] ∈ {0; 2} [1] ∈ {0} tab5[0] ∈ {2} [1] ∈ {0} tab6[0..1] ∈ {0; 2} p ∈ {{ &a }} p2 ∈ {{ &tab1[2] }} p3 ∈ {{ &tab1{[0], [1]} }} p4 ∈ {{ &a }} p5 ∈ {4096} p6 ∈ {4112} p7 ∈ {{ &tab1[3] }} q ∈ {4096} r ∈ {0} s ∈ {4144} t ∈ {4176} a ∈ [--..--] b ∈ {0} [from] Computing for function f_precis [from] Done for function f_precis [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f_precis: NULL{[4096..4099]; [4144..4147]} FROM NULL[4176..4179]; i {[4100..4111]; [4116..4143]; [4148..8192]} FROM NULL[4176..4179]; i (and SELF) [4112..4115] FROM NULL{[4128..4131]; [4176..4179]}; i tab_s[0] FROM s2 [1].a FROM x tab_s1{[0].b; [1].b} FROM s8; i (and SELF) tab_s2[0] FROM s2; s8; tabl[0]; x tab_s3[0].a FROM tabl[1]; x tab_s4{[0].a; [1].a} FROM tabl[0..1]; x; i; y (and SELF) s1{.a; .d[1]} FROM x {.d[0]; .d[2..9]; .e[0..9]} FROM s2 .b FROM s8 .c FROM \nothing s2{.a; .b.a} FROM x .d[0..1] FROM x; i (and SELF) {.b.b; .c} FROM \nothing s4.e[0].a FROM NULL{[4176..4179]; [4192]; [4200]}; tabst[2].a; tabst2{[0].a; [1].a; [2].a; [3].a; [4].a; [5].a; [6].a; [7].a; [8].a; [9].a}; s5.e[0].b; tab2[0..1]; tab3[0..1]; i; j; k; l; m s8.b FROM \nothing s7 FROM s6.b tab1[0..1] FROM \nothing tab2[0..1] FROM i (and SELF) tab3[0..1] FROM i; j; k (and SELF) tab4[0] FROM tab2[0..1]; v; i (and SELF) tab5[0] FROM tab2[1]; i tab6[0..1] FROM tab2[0..1]; i; j (and SELF) p FROM \nothing p2 FROM \nothing p3 FROM i p4 FROM \nothing p5 FROM \nothing p6 FROM \nothing p7 FROM \nothing q FROM \nothing r FROM \nothing s FROM \nothing t FROM \nothing a FROM x b FROM v; i (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f_precis: NULL[4096..8192]; tab_s{[0]; [1].a}; tab_s1{[0].b; [1].b}; tab_s2[0]; tab_s3[0].a; tab_s4{[0].a; [1].a}; s1; s2{{.a; .d[0..1]}; .b; .c}; s4.e[0].a; s8.b; s7; tab1[0..1]; tab2[0..1]; tab3[0..1]; tab4[0]; tab5[0]; tab6[0..1]; p; p2; p3; p4; p5; p6; p7; q; r; s; t; a; b [inout] Inputs for function f_precis: NULL{[4128..4131]; [4176..4179]; [4192]; [4200]}; tabst[2].a; tabst2{[0].a; [1].a; [2].a; [3].a; [4].a; [5].a; [6].a; [7].a; [8].a; [9].a}; s1; s2; s5.e[0].b; s6.b; s8; tabl[0..1]; tab1[0..1]; tab2[0..1]; tab3[0..1]; p; p2; p3; p6; q; r; s; t; a; v frama-c-20.0-Calcium/tests/value/oracle/struct3.res.oracle0000666000000000000000000000404713571573400020331 0ustar [kernel] Parsing tests/value/struct3.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization tabst[0..9] ∈ {0} tabst2[0..9] ∈ {0} tab_s[0..1] ∈ {0} tab_s1[0..1] ∈ {0} tab_s2[0..1] ∈ {0} tab_s3[0..1] ∈ {0} tab_s4[0..1] ∈ {0} s1 ∈ {0} s2 ∈ {0} s8 ∈ {0} s7 ∈ {0} v ∈ [--..--] [eva:alarm] tests/value/struct3.i:42: Warning: accessing out of bounds index. assert 10 < 10; [kernel] tests/value/struct3.i:42: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] tests/value/struct3.i:46: Assigning imprecise value to s2.a. The imprecision originates from Arithmetic {tests/value/struct3.i:46} [eva] Recording results for main [eva] done for function main [eva:garbled-mix] Warning: Garbled mix generated during analysis: {{ garbled mix of &{s1} (origin: Arithmetic {tests/value/struct3.i:46}) }} [eva] tests/value/struct3.i:42: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s1.a ∈ {2} .d[0] ∈ {1} .d[1..2] ∈ {2} .d[3..7] ∈ {0} .d[8..9] ∈ {2} .b.a ∈ {3} {.b.b; .e[0..9]} ∈ {0} .c ∈ {{ &s1 }} s2.a ∈ {{ garbled mix of &{s1} (origin: Arithmetic {tests/value/struct3.i:46}) }} .d[0] ∈ {1} .d[1..2] ∈ {2} .d[3..7] ∈ {0} .d[8..9] ∈ {2} .b.a ∈ {3} {.b.b; .e[0..9]} ∈ {0} .c ∈ {{ &s1 }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: s1{{.a; .d[0..2]}; {.d[8..9]; .b.a}; .c} FROM \nothing s2 FROM s1{.d[3..7]; {.b.b; .e[0..9]}} [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: s1{{.a; .d[0..2]}; {.d[8..9]; .b.a}; .c}; s2 [inout] Inputs for function main: s1; s2.c; v frama-c-20.0-Calcium/tests/value/oracle/struct_array.res.oracle0000666000000000000000000003236313571573400021446 0ustar [kernel] Parsing tests/value/struct_array.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] outp ∈ {0} x ∈ {0} y ∈ {0} z1 ∈ {0} z2 ∈ {0} z3 ∈ {0} z4 ∈ {0} T[0].a ∈ {1} [0].b ∈ {2} [0].pp ∈ {0} [0].p ∈ {{ &x }} [1].a ∈ {{ (int)&z1 }} [1].b ∈ {{ (int)&z2 }} [1].pp ∈ {{ &z3 }} [1].p ∈ {{ &y }} [2].a ∈ {{ (int)&z4 }} [2].b ∈ {2} [2].pp ∈ {0} [2].p ∈ {{ &x }} [3].a ∈ {1} [3].b ∈ {2} [3].pp ∈ {0} [3].p ∈ {{ &x }} [4..21] ∈ {0} s.a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} s1 ∈ {0} s2 ∈ {0} s3 ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/struct_array.i:56. [eva:alarm] tests/value/struct_array.i:35: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/value/struct_array.i:35: Warning: accessing out of bounds index. assert v < 22; [eva:alarm] tests/value/struct_array.i:36: Warning: out of bounds write. assert \valid(outp); [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/struct_array.i:57. [eva] tests/value/struct_array.i:41: Frama_C_show_each: .a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} [eva] computing for function f1 <- main2 <- main. Called from tests/value/struct_array.i:42. [eva] using specification for function f1 [eva] Done for function f1 [eva] tests/value/struct_array.i:43: Frama_C_show_each: .a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} .t[5..6] ∈ [--..--] .b ∈ {9} [eva] computing for function f2 <- main2 <- main. Called from tests/value/struct_array.i:44. [eva] using specification for function f2 [eva] Done for function f2 [eva] tests/value/struct_array.i:45: Frama_C_show_each: .a ∈ {1} .t[0..2] ∈ [--..--] .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} [eva] computing for function f3 <- main2 <- main. Called from tests/value/struct_array.i:46. [eva] using specification for function f3 [eva] Done for function f3 [eva] tests/value/struct_array.i:47: Frama_C_show_each: .a ∈ {1} .t[0..6] ∈ [--..--] .b ∈ {9} [eva] tests/value/struct_array.i:50: assertion got status valid. [eva] tests/value/struct_array.i:51: Frama_C_show_each_reach: [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: outp ∈ {{ &x ; &y }} x ∈ {0; 5} y ∈ {0; 5} z1 ∈ {1} [eva:final-states] Values at end of function main2: s1.a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} .t[5..6] ∈ [--..--] .b ∈ {9} s2.a ∈ {1} .t[0..2] ∈ [--..--] .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} s3.a ∈ {1} .t[0..6] ∈ [--..--] .b ∈ {9} [eva:final-states] Values at end of function main: outp ∈ {{ &x ; &y }} x ∈ {0; 5} y ∈ {0; 5} z1 ∈ {1} s1.a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} .t[5..6] ∈ [--..--] .b ∈ {9} s2.a ∈ {1} .t[0..2] ∈ [--..--] .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} s3.a ∈ {1} .t[0..6] ∈ [--..--] .b ∈ {9} [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Computing for function f1 <-main2 [from] Done for function f1 [from] Computing for function f2 <-main2 [from] Done for function f2 [from] Computing for function f3 <-main2 [from] Done for function f3 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: s1.t[5..6] FROM \nothing [from] Function f2: s2.t[0..2] FROM \nothing [from] Function f3: s3.t[0..6] FROM \nothing [from] Function main1: outp FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} x FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} (and SELF) y FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} (and SELF) z1 FROM z1 [from] Function main2: s1{{.a; .t[0..4]}; .b} FROM s .t[5..6] FROM \nothing s2{.a; {.t[3..6]; .b}} FROM s .t[0..2] FROM \nothing s3{.a; .b} FROM s .t[0..6] FROM \nothing [from] Function main: outp FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} x FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} (and SELF) y FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} (and SELF) z1 FROM z1 s1{{.a; .t[0..4]}; .b} FROM s .t[5..6] FROM \nothing s2{.a; {.t[3..6]; .b}} FROM s .t[0..2] FROM \nothing s3{.a; .b} FROM s .t[0..6] FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: outp; x; y; z1 [inout] Inputs for function main1: v; outp; z1; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} [inout] Out (internal) for function main2: s1; s2; s3 [inout] Inputs for function main2: v; s; s1; s2; s3 [inout] Out (internal) for function main: outp; x; y; z1; s1; s2; s3 [inout] Inputs for function main: v; outp; z1; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p}; s; s1; s2; s3 [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] outp ∈ {0} x ∈ {0} y ∈ {0} z1 ∈ {0} z2 ∈ {0} z3 ∈ {0} z4 ∈ {0} T[0].a ∈ {1} [0].b ∈ {2} [0].pp ∈ {0} [0].p ∈ {{ &x }} [1].a ∈ {{ (int)&z1 }} [1].b ∈ {{ (int)&z2 }} [1].pp ∈ {{ &z3 }} [1].p ∈ {{ &y }} [2].a ∈ {{ (int)&z4 }} [2].b ∈ {2} [2].pp ∈ {0} [2].p ∈ {{ &x }} [3].a ∈ {1} [3].b ∈ {2} [3].pp ∈ {0} [3].p ∈ {{ &x }} [4..21] ∈ {0} s.a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} s1 ∈ {0} s2 ∈ {0} s3 ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/struct_array.i:56. [eva:alarm] tests/value/struct_array.i:35: Warning: out of bounds read. assert \valid_read(&T[v].p); [eva:alarm] tests/value/struct_array.i:36: Warning: out of bounds write. assert \valid(outp); [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/struct_array.i:57. [eva] tests/value/struct_array.i:41: Frama_C_show_each: .a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} [eva] computing for function f1 <- main2 <- main. Called from tests/value/struct_array.i:42. [eva] Done for function f1 [eva] tests/value/struct_array.i:43: Frama_C_show_each: .a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} {.t[5..6]; .b} ∈ [--..--] [eva] computing for function f2 <- main2 <- main. Called from tests/value/struct_array.i:44. [eva] Done for function f2 [eva] tests/value/struct_array.i:45: Frama_C_show_each: {.a; .t[0..2]} ∈ [--..--] .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} [eva] computing for function f3 <- main2 <- main. Called from tests/value/struct_array.i:46. [eva] Done for function f3 [eva] tests/value/struct_array.i:47: Frama_C_show_each: [--..--] [eva:alarm] tests/value/struct_array.i:50: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: outp ∈ {{ &x ; &y }} x ∈ {0; 5} y ∈ {0; 5} z1 ∈ {1} [eva:final-states] Values at end of function main2: s1.a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} {.t[5..6]; .b} ∈ [--..--] s2{.a; .t[0..2]} ∈ [--..--] .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} s3 ∈ [--..--] [eva:final-states] Values at end of function main: outp ∈ {{ &x ; &y }} x ∈ {0; 5} y ∈ {0; 5} z1 ∈ {1} s1.a ∈ {1} .t[0] ∈ {2} .t[1] ∈ {3} .t[2] ∈ {4} .t[3] ∈ {5} .t[4] ∈ {6} {.t[5..6]; .b} ∈ [--..--] s2{.a; .t[0..2]} ∈ [--..--] .t[3] ∈ {5} .t[4] ∈ {6} .t[5] ∈ {7} .t[6] ∈ {8} .b ∈ {9} s3 ∈ [--..--] [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Computing for function f1 <-main2 [from] Done for function f1 [from] Computing for function f2 <-main2 [from] Done for function f2 [from] Computing for function f3 <-main2 [from] Done for function f3 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: s1{.t[5..6]; .b} FROM \nothing [from] Function f2: s2{.a; .t[0..2]} FROM \nothing [from] Function f3: s3 FROM \nothing [from] Function main1: outp FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} x FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} (and SELF) y FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} (and SELF) z1 FROM z1 [from] Function main2: s1{.a; .t[0..4]} FROM s {.t[5..6]; .b} FROM \nothing s2{.a; .t[0..2]} FROM \nothing {.t[3..6]; .b} FROM s s3 FROM \nothing [from] Function main: outp FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} x FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} (and SELF) y FROM v; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} (and SELF) z1 FROM z1 s1{.a; .t[0..4]} FROM s {.t[5..6]; .b} FROM \nothing s2{.a; .t[0..2]} FROM \nothing {.t[3..6]; .b} FROM s s3 FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: outp; x; y; z1 [inout] Inputs for function main1: v; outp; z1; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p} [inout] Out (internal) for function main2: s1; s2; s3 [inout] Inputs for function main2: v; s; s1; s2; s3 [inout] Out (internal) for function main: outp; x; y; z1; s1; s2; s3 [inout] Inputs for function main: v; outp; z1; T{[0].p; [1].p; [2].p; [3].p; [4].p; [5].p; [6].p; [7].p; [8].p; [9].p; [10].p; [11].p; [12].p; [13].p; [14].p; [15].p; [16].p; [17].p; [18].p; [19].p; [20].p; [21].p}; s; s1; s2; s3 frama-c-20.0-Calcium/tests/value/oracle/struct_call.0.res.oracle0000666000000000000000000000651013571573400021374 0ustar [kernel] Parsing tests/value/struct_call.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {77} GG ∈ {0} t[0..3] ∈ {0} tt[0..4] ∈ {0} C{.c1; .[bits 16 to 31]} ∈ [--..--] .c2 ∈ {{ NULL ; &S_c2_C[0] }} S_c2_C[0..1] ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/struct_call.i:46. [eva] computing for function g <- main1 <- main. Called from tests/value/struct_call.i:33. [eva] tests/value/struct_call.i:16: Frama_C_show_each_G: {0} [eva] Recording results for g [eva] Done for function g [eva] computing for function create_A <- main1 <- main. Called from tests/value/struct_call.i:34. [eva] tests/value/struct_call.i:25: Frama_C_show_each_GG: .x ∈ {1} .y ∈ {0} [eva] Recording results for create_A [eva] Done for function create_A [eva] computing for function g <- main1 <- main. Called from tests/value/struct_call.i:35. [eva] tests/value/struct_call.i:16: Frama_C_show_each_G: .x ∈ {0} .y ∈ {77} [eva] Recording results for g [eva] Done for function g [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function h <- main. Called from tests/value/struct_call.i:47. [eva] tests/value/struct_call.i:42: Frama_C_show_each: [-32768..32767], {{ NULL ; &S_c2_C }} [eva] Recording results for h [eva] Done for function h [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function create_A: r.x ∈ {1} .y ∈ {0} [eva:final-states] Values at end of function g: __retres ∈ {0; 77} [eva:final-states] Values at end of function h: [eva:final-states] Values at end of function main1: GG ∈ {0} t{[0]; [1].x} ∈ {0} [1].y ∈ {77} [2..3] ∈ {0} i ∈ {1} init.x ∈ {1} .y ∈ {0} [eva:final-states] Values at end of function main: GG ∈ {0} t{[0]; [1].x} ∈ {0} [1].y ∈ {77} [2..3] ∈ {0} [from] Computing for function create_A [from] Done for function create_A [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function create_A: \result FROM \nothing [from] Function g: \result FROM s.y [from] Function h: NO EFFECTS [from] Function main1: GG FROM tt[1] t[1].y FROM G \result FROM G; t[1].x [from] Function main: GG FROM tt[1] t[1].y FROM G [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function create_A: r [inout] Inputs for function create_A: \nothing [inout] Out (internal) for function g: __retres [inout] Inputs for function g: \nothing [inout] Out (internal) for function h: \nothing [inout] Inputs for function h: \nothing [inout] Out (internal) for function main1: GG; t[1].y; i; init; tmp_0 [inout] Inputs for function main1: G; t[1]; tt[1] [inout] Out (internal) for function main: GG; t[1].y [inout] Inputs for function main: G; t[1]; tt[1]; C frama-c-20.0-Calcium/tests/value/oracle/struct_call.1.res.oracle0000666000000000000000000000651013571573400021375 0ustar [kernel] Parsing tests/value/struct_call.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ {77} GG ∈ {0} t[0..3] ∈ {0} tt[0..4] ∈ {0} C{.c1; .[bits 16 to 31]} ∈ [--..--] .c2 ∈ {{ NULL ; &S_c2_C[0] }} S_c2_C[0..1] ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/struct_call.i:46. [eva] computing for function g <- main1 <- main. Called from tests/value/struct_call.i:33. [eva] tests/value/struct_call.i:16: Frama_C_show_each_G: {0} [eva] Recording results for g [eva] Done for function g [eva] computing for function create_A <- main1 <- main. Called from tests/value/struct_call.i:34. [eva] tests/value/struct_call.i:25: Frama_C_show_each_GG: .x ∈ {1} .y ∈ {0} [eva] Recording results for create_A [eva] Done for function create_A [eva] computing for function g <- main1 <- main. Called from tests/value/struct_call.i:35. [eva] tests/value/struct_call.i:16: Frama_C_show_each_G: .x ∈ {0} .y ∈ {77} [eva] Recording results for g [eva] Done for function g [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function h <- main. Called from tests/value/struct_call.i:47. [eva] tests/value/struct_call.i:42: Frama_C_show_each: [-32768..32767], {{ NULL ; &S_c2_C }} [eva] Recording results for h [eva] Done for function h [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function create_A: r.x ∈ {1} .y ∈ {0} [eva:final-states] Values at end of function g: __retres ∈ {0; 77} [eva:final-states] Values at end of function h: [eva:final-states] Values at end of function main1: GG ∈ {0} t{[0]; [1].x} ∈ {0} [1].y ∈ {77} [2..3] ∈ {0} i ∈ {1} init.x ∈ {1} .y ∈ {0} [eva:final-states] Values at end of function main: GG ∈ {0} t{[0]; [1].x} ∈ {0} [1].y ∈ {77} [2..3] ∈ {0} [from] Computing for function create_A [from] Done for function create_A [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function create_A: \result FROM \nothing [from] Function g: \result FROM s.y [from] Function h: NO EFFECTS [from] Function main1: GG FROM tt[1] t[1].y FROM G \result FROM G; t[1].x [from] Function main: GG FROM tt[1] t[1].y FROM G [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function create_A: r [inout] Inputs for function create_A: \nothing [inout] Out (internal) for function g: __retres [inout] Inputs for function g: \nothing [inout] Out (internal) for function h: \nothing [inout] Inputs for function h: \nothing [inout] Out (internal) for function main1: GG; t[1].y; i; init; tmp_0 [inout] Inputs for function main1: G; t[1]; tt[1] [inout] Out (internal) for function main: GG; t[1].y [inout] Inputs for function main: G; t[1]; tt[1]; C frama-c-20.0-Calcium/tests/value/oracle/struct_deps.res.oracle0000666000000000000000000000222213571573400021252 0ustar [kernel] Parsing tests/value/struct_deps.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/struct_deps.i:12. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ [--..--] [eva:final-states] Values at end of function main: s ∈ [--..--] [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM ps; s.a [from] Function main: \result FROM x [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: s.a [inout] Out (internal) for function main: s; tmp [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/struct_incl.res.oracle0000666000000000000000000000335613571573400021255 0ustar [kernel] Parsing tests/value/struct_incl.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization tabst[0..9] ∈ {0} tabst2[0..9] ∈ {0} tab_s[0..1] ∈ {0} tab_s1[0..1] ∈ {0} tab_s2[0..1] ∈ {0} tab_s3[0..1] ∈ {0} tab_s4[0..1] ∈ {0} s1 ∈ {0} s2 ∈ {0} s4 ∈ {0} s5 ∈ {0} s6 ∈ {0} s8 ∈ {0} s7 ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} t ∈ {0} v ∈ [--..--] [eva:alarm] tests/value/struct_incl.i:48: Warning: accessing out of bounds index. assert 10 < 10; [kernel] tests/value/struct_incl.i:48: Warning: all target addresses were invalid. This path is assumed to be dead. [eva] Recording results for main [eva] done for function main [eva] tests/value/struct_incl.i:48: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: s1{.a; .d[0..2]} ∈ {2} .d[3..4] ∈ {0} .d[5] ∈ {7} .d[6..7] ∈ {0} .d[8..9] ∈ {8} .b.a ∈ {3} {.b.b; .e[0..9]} ∈ {0} .c ∈ {{ &s1 }} x ∈ {{ (long)&s1.d[9] }} y ∈ {{ (long)&s1.b }} z ∈ {{ (long)&s1.b }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: s1{{.a; .d[0..2]}; .d[5]; {.d[8..9]; .b.a}; .c} FROM \nothing x FROM \nothing y FROM \nothing z FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: s1{{.a; .d[0..2]}; .d[5]; {.d[8..9]; .b.a}; .c}; x; y; z [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/struct_p_call.res.oracle0000666000000000000000000000244213571573400021555 0ustar [kernel] Parsing tests/value/struct_p_call.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/struct_p_call.i:14. [eva] Recording results for f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: H1.v ∈ {1} .[bits 8 to 31] ∈ UNINITIALIZED .w ∈ {0} [eva:final-states] Values at end of function main: H1.v ∈ {1} .[bits 8 to 31] ∈ UNINITIALIZED .w ∈ {0} __retres ∈ {1} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: H1{.v; .w} FROM G1 [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: H1{.v; .w} [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: H1{.v; .w}; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/strucval.res.oracle0000666000000000000000000000223413571573400020561 0ustar [kernel] Parsing tests/value/strucval.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function h <- main. Called from tests/value/strucval.c:27. [eva] using specification for function h [eva] Done for function h [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: SharedData.FunctionCode ∈ {0} .MachineNumber ∈ {1456} .[bits 48 to 63] ∈ UNINITIALIZED .Line ∈ {25} [from] Computing for function main [from] Computing for function h <-main [from] Done for function h [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function h: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: SharedData{{.FunctionCode; .MachineNumber}; .Line} [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/subset.res.oracle0000666000000000000000000001277213571573400020233 0ustar [kernel] Parsing tests/value/subset.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ {0} __fc_fopen[0..511] ∈ {0} _p__fc_fopen ∈ {{ &__fc_fopen[0] }} v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/subset.c:80. [eva:alarm] tests/value/subset.c:23: Warning: assertion got status unknown. [eva] tests/value/subset.c:24: assertion got status valid. [eva] tests/value/subset.c:25: assertion got status valid. [eva:alarm] tests/value/subset.c:29: Warning: assertion got status unknown. [eva] computing for function fopen <- main1 <- main. Called from tests/value/subset.c:32. [eva] using specification for function fopen [eva] Done for function fopen [eva] tests/value/subset.c:33: assertion got status valid. [eva] computing for function fopen2 <- main1 <- main. Called from tests/value/subset.c:34. [eva] using specification for function fopen2 [eva] Done for function fopen2 [eva] tests/value/subset.c:35: assertion got status valid. [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/subset.c:81. [eva] tests/value/subset.c:44: assertion got status valid. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/subset.c:82. [eva:alarm] tests/value/subset.c:49: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/value/subset.c:49: Warning: accessing out of bounds index. assert v < 10; [eva:alarm] tests/value/subset.c:50: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/value/subset.c:50: Warning: accessing out of bounds index. assert v < 300; [eva:alarm] tests/value/subset.c:51: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:52: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:54: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:57: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:58: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:59: Warning: assertion got status unknown. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/subset.c:83. [eva:alarm] tests/value/subset.c:64: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/value/subset.c:64: Warning: accessing out of bounds index. assert v < 10; [eva:alarm] tests/value/subset.c:65: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:66: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:68: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:69: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:70: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:72: Warning: assertion got status unknown. [eva:alarm] tests/value/subset.c:73: Warning: assertion got status unknown. [eva] tests/value/subset.c:74: assertion 'OK' got status valid. [eva:alarm] tests/value/subset.c:75: Warning: assertion 'KO' got status invalid (stopping propagation). [eva] Recording results for main4 [eva] Done for function main4 [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 3 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: p ∈ {{ NULL ; &__fc_fopen + [0..4088],0%8 }} [eva:final-states] Values at end of function main2: x ∈ {1} y ∈ {1} z ∈ {1} [eva:final-states] Values at end of function main3: a[0..8] ∈ {5} [9] ∈ [--..--] b[0..100] ∈ [-10..10] [101..299] ∈ [--..--] z ∈ [-10..10] [eva:final-states] Values at end of function main4: a[0..4] ∈ {4; 5; 6; 7; 8} [5] ∈ {5} [6..9] ∈ {4; 5; 6; 7; 8} k ∈ {4; 5; 6; 7; 8} [eva:final-states] Values at end of function main: [from] Computing for function main1 [from] Computing for function fopen <-main1 [from] Done for function fopen [from] Computing for function fopen2 <-main1 [from] Done for function fopen2 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function fopen: \result FROM _p__fc_fopen; "bla" [from] Function fopen2: \result FROM _p__fc_fopen; "bli" [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function main3: NO EFFECTS [from] Function main4: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: p [inout] Inputs for function main1: _p__fc_fopen; "bla"; "bli" [inout] Out (internal) for function main2: x; y; z [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main3: a[0..9]; b[0..299]; z [inout] Inputs for function main3: v [inout] Out (internal) for function main4: a[0..9]; k [inout] Inputs for function main4: v [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: _p__fc_fopen; v; "bla"; "bli" frama-c-20.0-Calcium/tests/value/oracle/summary.0.res.oracle0000666000000000000000000000310413571573400020546 0ustar [kernel] Parsing tests/value/summary.i (no preprocessing) [eva] Analyzing a complete application starting at minimalist [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization undet ∈ [--..--] volatile_d ∈ [--..--] [kernel:annot:missing-spec] tests/value/summary.i:19: Warning: Neither code nor specification for function minimalist, generating default assigns from the prototype [eva] using specification for function minimalist [eva] done for function minimalist [eva] ====== VALUES COMPUTED ====== [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 0 functions analyzed (out of 6): 0% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 0 warnings by the Frama-C kernel: 0 errors 1 warning ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function minimalist: [from] Computing for function minimalist [from] Done for function minimalist NO EFFECTS [from] ====== END OF DEPENDENCIES ====== frama-c-20.0-Calcium/tests/value/oracle/summary.1.res.oracle0000666000000000000000000000276213571573400020560 0ustar [kernel] Parsing tests/value/summary.i (no preprocessing) [eva] Analyzing a complete application starting at minimal [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization undet ∈ [--..--] volatile_d ∈ [--..--] [eva] Recording results for minimal [eva] done for function minimal [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function minimal: [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 6): 16% coverage. In this function, 1 statements reached (out of 1): 100% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 0 alarms generated by the analysis. ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] Computing for function minimal [from] Done for function minimal [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function minimal: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function minimal: \nothing [inout] Inputs for function minimal: \nothing frama-c-20.0-Calcium/tests/value/oracle/summary.2.res.oracle0000666000000000000000000000347213571573400020560 0ustar [kernel] Parsing tests/value/summary.i (no preprocessing) [eva] Analyzing a complete application starting at bottom [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization undet ∈ [--..--] volatile_d ∈ [--..--] [eva:alarm] tests/value/summary.i:15: Warning: division by zero. assert 0 ≢ 0; [eva] Recording results for bottom [eva] done for function bottom [eva] tests/value/summary.i:15: assertion 'Eva,division_by_zero' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function bottom: NON TERMINATING FUNCTION [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 1 function analyzed (out of 6): 16% coverage. In this function, 1 statements reached (out of 2): 50% coverage. ---------------------------------------------------------------------------- No errors or warnings raised during the analysis. ---------------------------------------------------------------------------- 1 alarm generated by the analysis: 1 division by zero 1 of them is a sure alarm (invalid status). ---------------------------------------------------------------------------- No logical properties have been reached by the analysis. ---------------------------------------------------------------------------- [from] Computing for function bottom [from] Non-terminating function bottom (no dependencies) [from] Done for function bottom [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function bottom: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function bottom: x [inout] Inputs for function bottom: \nothing frama-c-20.0-Calcium/tests/value/oracle/summary.3.res.oracle0000666000000000000000000001373513571573400020564 0ustar [kernel] Parsing tests/value/summary.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization undet ∈ [--..--] volatile_d ∈ [--..--] [eva] computing for function alarms <- main. Called from tests/value/summary.i:62. [eva:alarm] tests/value/summary.i:27: Warning: out of bounds read. assert \valid_read(p); [eva:alarm] tests/value/summary.i:29: Warning: out of bounds write. assert \valid(p); [eva:alarm] tests/value/summary.i:30: Warning: accessing out of bounds index. assert 0 ≤ undet; [eva:alarm] tests/value/summary.i:30: Warning: accessing out of bounds index. assert undet < 10; [eva:alarm] tests/value/summary.i:31: Warning: division by zero. assert undet ≢ 0; [eva:alarm] tests/value/summary.i:32: Warning: signed overflow. assert -2147483648 ≤ undet + undet; [eva:alarm] tests/value/summary.i:32: Warning: signed overflow. assert undet + undet ≤ 2147483647; [eva:alarm] tests/value/summary.i:33: Warning: invalid LHS operand for left shift. assert 0 ≤ undet; [eva:alarm] tests/value/summary.i:33: Warning: invalid RHS operand for shift. assert 0 ≤ undet < 32; [eva:alarm] tests/value/summary.i:33: Warning: signed overflow. assert undet << undet ≤ 2147483647; [eva:alarm] tests/value/summary.i:34: Warning: non-finite double value. assert \is_finite(volatile_d); [eva:alarm] tests/value/summary.i:35: Warning: non-finite double value. assert \is_finite((double)(d - d)); [eva:alarm] tests/value/summary.i:36: Warning: overflow in conversion from floating-point to integer. assert -2147483649 < d; [eva:alarm] tests/value/summary.i:36: Warning: overflow in conversion from floating-point to integer. assert d < 2147483648; [eva:alarm] tests/value/summary.i:39: Warning: pointer subtraction. assert \base_addr(p) ≡ \base_addr(q); [eva:alarm] tests/value/summary.i:40: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)q); [eva:locals-escaping] tests/value/summary.i:43: Warning: locals {z} escaping the scope of a block of alarms through p [eva:alarm] tests/value/summary.i:45: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [eva] Recording results for alarms [eva] Done for function alarms [eva] computing for function logic <- main. Called from tests/value/summary.i:63. [eva] tests/value/summary.i:53: assertion got status valid. [eva:alarm] tests/value/summary.i:54: Warning: assertion got status unknown. [eva:alarm] tests/value/summary.i:56: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for logic [eva] Done for function logic [eva] computing for function f <- main. Called from tests/value/summary.i:64. [kernel:annot:missing-spec] tests/value/summary.i:64: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/summary.i:65. [kernel:annot:missing-spec] tests/value/summary.i:65: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function alarms: x ∈ [--..--] y ∈ {0} p ∈ {{ &x ; &y }} q ∈ {{ &x ; &y }} t[0..9] ∈ {0} d ∈ [-2147483649. .. 2147483648.] [eva:final-states] Values at end of function logic: [eva:final-states] Values at end of function main: [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 3 functions analyzed (out of 6): 50% coverage. In these functions, 38 statements reached (out of 38): 100% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 1 warning by the Frama-C kernel: 0 errors 2 warnings ---------------------------------------------------------------------------- 17 alarms generated by the analysis: 1 division by zero 2 invalid memory accesses 2 accesses out of bounds index 3 integer overflows 2 invalid shifts 1 escaping address 2 nan or infinite floating-point values 2 illegal conversions from floating-point to integer 2 others ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 1 valid 1 unknown 1 invalid 3 total Preconditions 0 valid 0 unknown 0 invalid 0 total 33% of the logical properties reached have been proven. ---------------------------------------------------------------------------- [from] Computing for function alarms [from] Done for function alarms [from] Computing for function logic [from] Done for function logic [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function alarms: NO EFFECTS [from] Function f: NO EFFECTS [from] Function g: NO EFFECTS [from] Function logic: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function alarms: x; y; p; q; t[0..9]; d [inout] Inputs for function alarms: undet; volatile_d [inout] Out (internal) for function logic: \nothing [inout] Inputs for function logic: undet [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: undet; volatile_d frama-c-20.0-Calcium/tests/value/oracle/summary.4.res.oracle0000666000000000000000000001560013571573400020556 0ustar [kernel] Parsing tests/value/summary.i (no preprocessing) [rte] annotating function alarms [rte] annotating function bottom [rte] tests/value/summary.i:15: Warning: guaranteed RTE: assert division_by_zero: 0 ≢ 0; [rte] annotating function dead [rte] annotating function logic [rte] annotating function main [rte] annotating function minimal [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization undet ∈ [--..--] volatile_d ∈ [--..--] [eva] computing for function alarms <- main. Called from tests/value/summary.i:62. [eva:alarm] tests/value/summary.i:27: Warning: assertion 'rte,mem_access' got status unknown. [eva:alarm] tests/value/summary.i:29: Warning: assertion 'rte,mem_access' got status unknown. [eva:alarm] tests/value/summary.i:30: Warning: assertion 'rte,index_bound' got status unknown. [eva:alarm] tests/value/summary.i:30: Warning: accessing out of bounds index. assert 0 ≤ undet; [eva:alarm] tests/value/summary.i:30: Warning: accessing out of bounds index. assert undet < 10; [eva:alarm] tests/value/summary.i:31: Warning: assertion 'rte,division_by_zero' got status unknown. [eva:alarm] tests/value/summary.i:31: Warning: division by zero. assert undet ≢ 0; [eva:alarm] tests/value/summary.i:32: Warning: assertion 'rte,signed_overflow' got status unknown. [eva:alarm] tests/value/summary.i:32: Warning: signed overflow. assert -2147483648 ≤ undet + undet; [eva:alarm] tests/value/summary.i:32: Warning: signed overflow. assert undet + undet ≤ 2147483647; [eva:alarm] tests/value/summary.i:33: Warning: assertion 'rte,shift' got status unknown. [eva:alarm] tests/value/summary.i:33: Warning: assertion 'rte,shift' got status unknown. [eva:alarm] tests/value/summary.i:33: Warning: assertion 'rte,signed_overflow' got status unknown. [eva:alarm] tests/value/summary.i:33: Warning: invalid LHS operand for left shift. assert 0 ≤ undet; [eva:alarm] tests/value/summary.i:33: Warning: invalid RHS operand for shift. assert 0 ≤ undet < 32; [eva:alarm] tests/value/summary.i:33: Warning: signed overflow. assert undet << undet ≤ 2147483647; [eva:alarm] tests/value/summary.i:34: Warning: non-finite double value. assert \is_finite(volatile_d); [eva:alarm] tests/value/summary.i:35: Warning: assertion 'rte,is_nan_or_infinite' got status unknown. [eva:alarm] tests/value/summary.i:35: Warning: non-finite double value. assert \is_finite((double)(d - d)); [eva:alarm] tests/value/summary.i:36: Warning: assertion 'rte,float_to_int' got status unknown. [eva:alarm] tests/value/summary.i:39: Warning: pointer subtraction. assert \base_addr(p) ≡ \base_addr(q); [eva:alarm] tests/value/summary.i:40: Warning: pointer comparison. assert \pointer_comparable((void *)p, (void *)q); [eva:locals-escaping] tests/value/summary.i:43: Warning: locals {z} escaping the scope of a block of alarms through p [eva:alarm] tests/value/summary.i:45: Warning: assertion 'rte,mem_access' got status unknown. [eva:alarm] tests/value/summary.i:45: Warning: accessing left-value that contains escaping addresses. assert ¬\dangling(&p); [eva] Recording results for alarms [eva] Done for function alarms [eva] computing for function logic <- main. Called from tests/value/summary.i:63. [eva] tests/value/summary.i:53: assertion got status valid. [eva:alarm] tests/value/summary.i:54: Warning: assertion got status unknown. [eva:alarm] tests/value/summary.i:56: Warning: assertion got status invalid (stopping propagation). [eva] Recording results for logic [eva] Done for function logic [eva] computing for function f <- main. Called from tests/value/summary.i:64. [kernel:annot:missing-spec] tests/value/summary.i:64: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/summary.i:65. [kernel:annot:missing-spec] tests/value/summary.i:65: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function alarms: x ∈ [--..--] y ∈ {0} p ∈ {{ &x ; &y }} q ∈ {{ &x ; &y }} t[0..9] ∈ {0} d ∈ [-2147483649. .. 2147483648.] [eva:final-states] Values at end of function logic: [eva:final-states] Values at end of function main: [eva:summary] ====== ANALYSIS SUMMARY ====== ---------------------------------------------------------------------------- 3 functions analyzed (out of 6): 50% coverage. In these functions, 38 statements reached (out of 38): 100% coverage. ---------------------------------------------------------------------------- Some errors and warnings have been raised during the analysis: by the Eva analyzer: 0 errors 1 warning by the Frama-C kernel: 0 errors 2 warnings ---------------------------------------------------------------------------- 18 alarms generated by the analysis: 1 division by zero 3 invalid memory accesses 2 accesses out of bounds index 3 integer overflows 2 invalid shifts 1 escaping address 2 nan or infinite floating-point values 2 illegal conversions from floating-point to integer 2 others ---------------------------------------------------------------------------- Evaluation of the logical properties reached by the analysis: Assertions 1 valid 1 unknown 1 invalid 3 total Preconditions 0 valid 0 unknown 0 invalid 0 total 33% of the logical properties reached have been proven. ---------------------------------------------------------------------------- [from] Computing for function alarms [from] Done for function alarms [from] Computing for function logic [from] Done for function logic [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function alarms: NO EFFECTS [from] Function f: NO EFFECTS [from] Function g: NO EFFECTS [from] Function logic: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function alarms: x; y; p; q; t[0..9]; d [inout] Inputs for function alarms: undet; volatile_d [inout] Out (internal) for function logic: \nothing [inout] Inputs for function logic: undet [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: undet; volatile_d frama-c-20.0-Calcium/tests/value/oracle/switch.0.res.oracle0000666000000000000000000000256213571573400020361 0ustar [kernel] Parsing tests/value/switch.i (no preprocessing) [kernel] tests/value/switch.i:52: Case label 0xFFFFFFFF exceeds range of long for switch expression. Nothing to worry. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization result1 ∈ {0} result3 ∈ {0} result4 ∈ {0} result2 ∈ {7} d2 ∈ {0} [eva] tests/value/switch.i:29: Frama_C_show_each_F: {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: result1 ∈ {0; 1; 2; 4} result3 ∈ {0; 42} result4 ∈ {0; 1; 2} result2 ∈ {0; 7} d2 ∈ [-0.0000000000000000 .. 1.9999999999999998*2^1023] f ∈ [--..--] __retres ∈ {0; 2; 77} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: result1 FROM d (and SELF) result3 FROM c; f (and SELF) result4 FROM c; l (and SELF) result2 FROM c; e (and SELF) d2 FROM c; d1 (and SELF) \result FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: result1; result3; result4; result2; d2; f; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/switch.1.res.oracle0000666000000000000000000000256213571573400020362 0ustar [kernel] Parsing tests/value/switch.i (no preprocessing) [kernel] tests/value/switch.i:52: Case label 0xFFFFFFFF exceeds range of long for switch expression. Nothing to worry. [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization result1 ∈ {0} result3 ∈ {0} result4 ∈ {0} result2 ∈ {7} d2 ∈ {0} [eva] tests/value/switch.i:29: Frama_C_show_each_F: {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: result1 ∈ {0; 1; 2; 4} result3 ∈ {0; 42} result4 ∈ {0; 1; 2} result2 ∈ {0; 7} d2 ∈ [-0.0000000000000000 .. 1.9999999999999998*2^1023] f ∈ [--..--] __retres ∈ {0; 2; 77} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: result1 FROM d (and SELF) result3 FROM c; f (and SELF) result4 FROM c; l (and SELF) result2 FROM c; e (and SELF) d2 FROM c; d1 (and SELF) \result FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: result1; result3; result4; result2; d2; f; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/switch2.res.oracle0000666000000000000000000000312013571573400020274 0ustar [kernel] Parsing tests/value/switch2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/switch2.i:13. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/switch2.i:13. [kernel:annot:missing-spec] tests/value/switch2.i:13: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {3} [eva:final-states] Values at end of function main: exit_loop ∈ {3} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] Computing for function main [from] Computing for function g <-main [from] Done for function g [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function g: NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function main: exit_loop; tmp_0; tmp_1; __retres [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/switch_cast.res.oracle0000666000000000000000000000231413571573400021230 0ustar [kernel] Parsing tests/value/switch_cast.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ [--..--] [eva] computing for function g <- main. Called from tests/value/switch_cast.i:71. [eva] tests/value/switch_cast.i:67: Frama_C_show_each: [1..241],1%2 [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function g: x ∈ [0..15] y ∈ [1..241],1%2 [eva:final-states] Values at end of function main: x ∈ [0..15] [from] Computing for function g [from] Done for function g [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function g: x FROM x [from] Function main: x FROM x [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function g: x; y [inout] Inputs for function g: x [inout] Out (internal) for function main: x [inout] Inputs for function main: x frama-c-20.0-Calcium/tests/value/oracle/symbolic_locs.res.oracle0000666000000000000000000001701213571573400021557 0ustar [kernel] Parsing tests/value/symbolic_locs.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] t[0..9] ∈ {0} u[0..9] ∈ [--..--] [eva] computing for function main2_kill_direct <- main. Called from tests/value/symbolic_locs.i:119. [eva:alarm] tests/value/symbolic_locs.i:29: Warning: assertion got status unknown. [eva] tests/value/symbolic_locs.i:32: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..8] ∈ {0; 4} [9] ∈ {0} u[0..9] ∈ [--..--] i ∈ [0..8] ==END OF DUMP== [eva] tests/value/symbolic_locs.i:34: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..1] ∈ {0; 4} [2] ∈ {1} [3..8] ∈ {0; 4} [9] ∈ {0} u[0..9] ∈ [--..--] i ∈ [0..8] ==END OF DUMP== [eva] Recording results for main2_kill_direct [eva] Done for function main2_kill_direct [eva] computing for function main3_kill_indirect <- main. Called from tests/value/symbolic_locs.i:120. [eva:alarm] tests/value/symbolic_locs.i:41: Warning: assertion got status unknown. [eva] tests/value/symbolic_locs.i:44: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..1] ∈ {0; 4} [2] ∈ {0; 1; 4} [3..8] ∈ {0; 4} [9] ∈ {0} u[0..9] ∈ [--..--] i ∈ [0..8] ==END OF DUMP== [eva] tests/value/symbolic_locs.i:46: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..1] ∈ {0; 4} [2] ∈ {0; 1; 4} [3..8] ∈ {0; 4} [9] ∈ {0} u[0..9] ∈ [--..--] i ∈ {8} ==END OF DUMP== [eva] Recording results for main3_kill_indirect [eva] Done for function main3_kill_indirect [eva] computing for function main4_scope_right <- main. Called from tests/value/symbolic_locs.i:121. [eva:alarm] tests/value/symbolic_locs.i:51: Warning: assertion got status unknown. [eva] tests/value/symbolic_locs.i:55: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..1] ∈ {{ NULL + {0; 4} ; (int)&x }} [2] ∈ {{ NULL + {0; 1; 4} ; (int)&x }} [3..8] ∈ {{ NULL + {0; 4} ; (int)&x }} [9] ∈ {0} u[0..9] ∈ [--..--] i ∈ [0..8] x ∈ UNINITIALIZED ==END OF DUMP== [eva:locals-escaping] tests/value/symbolic_locs.i:55: Warning: locals {x} escaping the scope of a block of main4_scope_right through t [eva] tests/value/symbolic_locs.i:57: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..1] ∈ {0; 4} or ESCAPINGADDR [2] ∈ {0; 1; 4} or ESCAPINGADDR [3..8] ∈ {0; 4} or ESCAPINGADDR [9] ∈ {0} u[0..9] ∈ [--..--] i ∈ [0..8] ==END OF DUMP== [eva] Recording results for main4_scope_right [eva] Done for function main4_scope_right [eva] computing for function main5_scope_lv <- main. Called from tests/value/symbolic_locs.i:122. [eva:alarm] tests/value/symbolic_locs.i:63: Warning: assertion got status unknown. [eva] tests/value/symbolic_locs.i:65: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..8] ∈ {0; 1; 4} or ESCAPINGADDR [9] ∈ {0} u[0..9] ∈ [--..--] z ∈ {1} i ∈ [0..8] ==END OF DUMP== [eva] tests/value/symbolic_locs.i:67: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..8] ∈ {0; 1; 4} or ESCAPINGADDR [9] ∈ {0} u[0..9] ∈ [--..--] z ∈ {1} ==END OF DUMP== [eva] Recording results for main5_scope_lv [eva] Done for function main5_scope_lv [eva] computing for function main6_ghost_dep <- main. Called from tests/value/symbolic_locs.i:123. [eva:alarm] tests/value/symbolic_locs.i:83: Warning: assertion got status unknown. [eva:alarm] tests/value/symbolic_locs.i:86: Warning: assertion got status unknown. [eva] tests/value/symbolic_locs.i:98: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..8] ∈ {0; 1; 4} or ESCAPINGADDR [9] ∈ {0} u[0..9] ∈ [--..--] x ∈ [--..--] ==END OF DUMP== [eva] Recording results for main6_ghost_dep [eva] Done for function main6_ghost_dep [eva] computing for function main7_widening <- main. Called from tests/value/symbolic_locs.i:124. [eva] tests/value/symbolic_locs.i:110: starting to merge loop iterations [eva:alarm] tests/value/symbolic_locs.i:111: Warning: signed overflow. assert *p + 1 ≤ 2147483647; [eva] tests/value/symbolic_locs.i:113: Frama_C_show_each: [0..2147483647] [eva] Recording results for main7_widening [eva] Done for function main7_widening [eva] tests/value/symbolic_locs.i:125: Frama_C_dump_each: # Cvalue domain: v ∈ [--..--] t[0..8] ∈ {0; 1; 4} or ESCAPINGADDR [9] ∈ {0} u[0..9] ∈ [--..--] ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2_kill_direct: t[0..1] ∈ {0; 4} [2] ∈ {1} [3..8] ∈ {0; 4} [9] ∈ {0} i ∈ [0..8] [eva:final-states] Values at end of function main3_kill_indirect: t[0..1] ∈ {0; 4} [2] ∈ {0; 1; 4} [3..8] ∈ {0; 4} [9] ∈ {0} i ∈ {8} [eva:final-states] Values at end of function main4_scope_right: t[0..1] ∈ {0; 4} or ESCAPINGADDR [2] ∈ {0; 1; 4} or ESCAPINGADDR [3..8] ∈ {0; 4} or ESCAPINGADDR [9] ∈ {0} i ∈ [0..8] [eva:final-states] Values at end of function main5_scope_lv: t[0..8] ∈ {0; 1; 4} or ESCAPINGADDR [9] ∈ {0} z ∈ {1} [eva:final-states] Values at end of function main6_ghost_dep: x ∈ {1} [eva:final-states] Values at end of function main7_widening: b ∈ [0..2147483647] c ∈ [0..2147483647] p ∈ {{ &b ; &c }} [eva:final-states] Values at end of function main: t[0..8] ∈ {0; 1; 4} or ESCAPINGADDR [9] ∈ {0} [from] Computing for function main2_kill_direct [from] Done for function main2_kill_direct [from] Computing for function main3_kill_indirect [from] Done for function main3_kill_indirect [from] Computing for function main4_scope_right [from] Done for function main4_scope_right [from] Computing for function main5_scope_lv [from] Done for function main5_scope_lv [from] Computing for function main6_ghost_dep [from] Done for function main6_ghost_dep [from] Computing for function main7_widening [from] Done for function main7_widening [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2_kill_direct: t{[0..1]; [3..8]} FROM v (and SELF) [2] FROM \nothing [from] Function main3_kill_indirect: t[0..8] FROM v (and SELF) [from] Function main4_scope_right: t[0..8] FROM v (and SELF) [from] Function main5_scope_lv: t[0..8] FROM v (and SELF) [from] Function main6_ghost_dep: NO EFFECTS [from] Function main7_widening: NO EFFECTS [from] Function main: t[0..8] FROM v (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2_kill_direct: t[0..8]; i [inout] Inputs for function main2_kill_direct: v [inout] Out (internal) for function main3_kill_indirect: t[0..8]; i [inout] Inputs for function main3_kill_indirect: v [inout] Out (internal) for function main4_scope_right: t[0..8]; i [inout] Inputs for function main4_scope_right: v [inout] Out (internal) for function main5_scope_lv: t[0..8]; z; i [inout] Inputs for function main5_scope_lv: v [inout] Out (internal) for function main6_ghost_dep: x; y; z; k; p; tmp; tmp_0 [inout] Inputs for function main6_ghost_dep: v [inout] Out (internal) for function main7_widening: b; c; p; tmp [inout] Inputs for function main7_widening: v [inout] Out (internal) for function main: t[0..8] [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/tab.res.oracle0000666000000000000000000000323313571573400017464 0ustar [kernel] Parsing tests/value/tab.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {55} y ∈ {77} t[0..3] ∈ {0} TT[0][0] ∈ {0} [0][1..2] ∈ {1} {[0][3..4]; [1][0..4]; [2][0]} ∈ {0} [2][1] ∈ {1} {[2][2..4]; [3..4][0..4]} ∈ {0} TTT[0][0] ∈ {1} [0][1] ∈ {2} [0][2] ∈ {3} [0][3] ∈ {4} [0][4] ∈ {5} [1][0..4] ∈ {0} [2][0] ∈ {1} {[2][1..4]; [3..4][0..4]} ∈ {0} [eva] computing for function any_int <- main. Called from tests/value/tab.c:11. [eva] using specification for function any_int [eva] Done for function any_int [eva:alarm] tests/value/tab.c:12: Warning: accessing out of bounds index. assert 0 ≤ i; [eva:alarm] tests/value/tab.c:12: Warning: accessing out of bounds index. assert i < 4; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0] ∈ {0; 1} [1] ∈ {77} [2..3] ∈ {0; 1} i ∈ {0; 1; 2; 3} [from] Computing for function main [from] Computing for function any_int <-main [from] Done for function any_int [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function any_int: \result FROM \nothing [from] Function main: t{[0]; [2..3]} FROM \nothing (and SELF) [1] FROM y [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t[0..3]; i [inout] Inputs for function main: y frama-c-20.0-Calcium/tests/value/oracle/tab1.res.oracle0000666000000000000000000000151213571573400017543 0ustar [kernel] Parsing tests/value/tab1.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G[0..9] ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: G[0] ∈ [0..2147483647] [1] ∈ [-2147483648..0] [2..9] ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: G[0..1] FROM x (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: G[0..1] [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/termination.res.oracle0000666000000000000000000000226113571573400021247 0ustar [kernel] Parsing tests/value/termination.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G[0..9] ∈ {0} X ∈ {0} [eva] computing for function loop <- main. Called from tests/value/termination.i:33. [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function loop: X ∈ {2} [eva:final-states] Values at end of function main: X ∈ {2} [from] Computing for function loop [from] Done for function loop [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: X FROM \nothing [from] Function main: X FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function loop: X [inout] Inputs for function loop: \nothing [inout] Out (internal) for function main: X; tmp [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/test.0.res.oracle0000666000000000000000000000340313571573400020032 0ustar [kernel] Parsing tests/value/test.i (no preprocessing) [eva] Analyzing a complete application starting at inst_F6 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/test.i:11: Warning: out of bounds read. assert \valid_read(v + j); [eva:alarm] tests/value/test.i:11: Warning: out of bounds read. assert \valid_read(v + (int)(j + ecart)); [eva:alarm] tests/value/test.i:13: Warning: out of bounds read. assert \valid_read(v + (int)(j + ecart)); [eva:alarm] tests/value/test.i:14: Warning: out of bounds write. assert \valid(v + (int)(j + ecart)); [eva] tests/value/test.i:11: starting to merge loop iterations [eva] tests/value/test.i:10: starting to merge loop iterations [eva:alarm] tests/value/test.i:11: Warning: signed overflow. assert j + ecart ≤ 2147483647; [eva] tests/value/test.i:9: starting to merge loop iterations [eva] Recording results for inst_F6 [eva] done for function inst_F6 [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function inst_F6: t[0] ∈ UNINITIALIZED [1] ∈ {4} [2] ∈ UNINITIALIZED i ∈ [1..2147483647] or UNINITIALIZED j ∈ [-1073741822..1] ecart ∈ [-1073741824..0] tmp ∈ [--..--] or UNINITIALIZED S_v[0..1] ∈ [--..--] [from] Computing for function inst_F6 [from] Done for function inst_F6 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function inst_F6: S_v[0..1] FROM v; n; S_v[0..1] (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function inst_F6: t[1]; i; j; ecart; tmp; i_0; S_v[0..1] [inout] Inputs for function inst_F6: S_v[0..1] frama-c-20.0-Calcium/tests/value/oracle/test.1.res.oracle0000666000000000000000000000170213571573400020033 0ustar [kernel] Parsing tests/value/test.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/test.i:21: Warning: accessing uninitialized left-value. assert \initialized(&t[100]); [eva] Recording results for f [eva] done for function f [eva] tests/value/test.i:21: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: t[0] ∈ {99} [1..88887] ∈ UNINITIALIZED [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: t[0..1] [inout] Inputs for function f: \nothing frama-c-20.0-Calcium/tests/value/oracle/test_arith.res.oracle0000666000000000000000000000310713571573400021064 0ustar [kernel] Parsing tests/value/test_arith.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ {0} j ∈ {0} k ∈ {0} ecart ∈ {0} tmp ∈ {0} pptr ∈ {0} ptr ∈ {0} qtr ∈ {0} m1 ∈ {0} m2 ∈ {0} m3 ∈ {0} G ∈ {0} [eva:alarm] tests/value/test_arith.c:16: Warning: signed overflow. assert n + 1 ≤ 2147483647; [eva:alarm] tests/value/test_arith.c:18: Warning: signed overflow. assert -2147483648 ≤ (int)ptr + 1; [eva:alarm] tests/value/test_arith.c:18: Warning: signed overflow. assert (int)ptr + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: t[0..4] ∈ {0} [5] ∈ {11} [6..9] ∈ {0} j ∈ {23} k ∈ {{ &t + {5} }} ecart ∈ {2} pptr ∈ {{ &ptr }} ptr ∈ {{ &t[1] }} qtr ∈ {{ &t[2] }} n ∈ [-2147483647..2147483647] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: t{[1]; [5]} FROM \nothing j FROM \nothing k FROM \nothing ecart FROM \nothing pptr FROM \nothing ptr FROM \nothing qtr FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: t{[1]; [5]}; j; k; ecart; pptr; ptr; qtr; n [inout] Inputs for function main: t{[1]; [5]}; j; ptr frama-c-20.0-Calcium/tests/value/oracle/threat_array.res.oracle0000666000000000000000000000275213571573400021410 0ustar [kernel] Parsing tests/value/threat_array.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization T[0..9] ∈ {0} p ∈ {0} q ∈ {0} [eva:alarm] tests/value/threat_array.i:6: Warning: assertion got status unknown. [eva] tests/value/threat_array.i:8: assertion got status valid. [eva] tests/value/threat_array.i:9: assertion got status valid. [eva] tests/value/threat_array.i:14: assertion got status valid. [eva:alarm] tests/value/threat_array.i:17: Warning: assertion got status invalid (stopping propagation). [eva:alarm] tests/value/threat_array.i:20: Warning: accessing out of bounds index. assert 0 ≤ c; [eva:alarm] tests/value/threat_array.i:20: Warning: accessing out of bounds index. assert c < 10; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[0..9] ∈ {0; 4} p ∈ {{ (int (*)[5])&T[5] }} q ∈ {{ (int (*)[10])&T[5] }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: T[0..9] FROM c (and SELF) p FROM \nothing q FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: T[0..9]; p; q [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/threat_if.res.oracle0000666000000000000000000000213213571573400020660 0ustar [kernel] Parsing tests/value/threat_if.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} l ∈ {0} m ∈ {0} i ∈ {0} X ∈ {-992} [eva:alarm] tests/value/threat_if.i:14: Warning: out of bounds write. assert \valid(p); [eva] tests/value/threat_if.i:18: Frama_C_show_each: {-126} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ NULL ; &l }} l ∈ {0; 1} G ∈ {-126} c ∈ {-126} __retres ∈ {-126} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM i_0 (and SELF) l FROM p; i_0 (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; l; G; c; __retres [inout] Inputs for function main: p frama-c-20.0-Calcium/tests/value/oracle/threat_redundant.res.oracle0000666000000000000000000000327113571573400022253 0ustar [kernel] Parsing tests/value/threat_redundant.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization s1[0] ∈ {97} [1] ∈ {98} [2] ∈ {97} [3] ∈ {98} [4] ∈ {97} [5] ∈ {98} [6] ∈ {97} [7] ∈ {98} [8] ∈ {97} [9] ∈ {98} x ∈ {0} [eva] computing for function strchr <- main. Called from tests/value/threat_redundant.c:19. [eva] tests/value/threat_redundant.c:8: starting to merge loop iterations [eva:alarm] tests/value/threat_redundant.c:8: Warning: out of bounds read. assert \valid_read(s); [eva] Recording results for strchr [eva] Done for function strchr [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function strchr: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function strchr [from] Non-terminating function strchr (no dependencies) [from] Done for function strchr [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function strchr: NON TERMINATING - NO EFFECTS [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function strchr: s [inout] Inputs for function strchr: s1[0..9] [inout] Out (internal) for function main: x [inout] Inputs for function main: s1[0..9] frama-c-20.0-Calcium/tests/value/oracle/tricky_logic.res.oracle0000666000000000000000000000735513571573400021411 0ustar [kernel] Parsing tests/value/tricky_logic.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization vol ∈ [--..--] str ∈ {{ "abc" }} x ∈ {0} y ∈ {0} [eva] tests/value/tricky_logic.i:56: function main: precondition got status valid. [eva] computing for function f1 <- main. Called from tests/value/tricky_logic.i:58. [eva] tests/value/tricky_logic.i:15: assertion got status valid. [eva] tests/value/tricky_logic.i:16: assertion got status valid. [eva] Recording results for f1 [eva] Done for function f1 [eva] computing for function f2 <- main. Called from tests/value/tricky_logic.i:62. [eva] tests/value/tricky_logic.i:23: assertion got status valid. [eva] tests/value/tricky_logic.i:24: assertion got status valid. [eva] Recording results for f2 [eva] Done for function f2 [eva] computing for function f3 <- main. Called from tests/value/tricky_logic.i:65. [eva] tests/value/tricky_logic.i:29: assertion got status valid. [eva] tests/value/tricky_logic.i:30: assertion got status valid. [eva:alarm] tests/value/tricky_logic.i:31: Warning: assertion got status unknown. [eva] Recording results for f3 [eva] Done for function f3 [eva] computing for function f4 <- main. Called from tests/value/tricky_logic.i:67. [eva] computing for function g4 <- f4 <- main. Called from tests/value/tricky_logic.i:51. [eva] tests/value/tricky_logic.i:38: assertion got status valid. [eva:alarm] tests/value/tricky_logic.i:39: Warning: assertion got status unknown. [eva] Recording results for g4 [eva] Done for function g4 [eva] tests/value/tricky_logic.i:52: assertion got status valid. [eva] tests/value/tricky_logic.i:53: assertion got status valid. [eva] Recording results for f4 [eva] Done for function f4 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f1: [eva:final-states] Values at end of function f2: x ∈ {4} y ∈ {5} [eva:final-states] Values at end of function f3: [eva:final-states] Values at end of function g4: s.i1 ∈ {3} .i2 ∈ {2} or UNINITIALIZED x_0 ∈ {1} [eva:final-states] Values at end of function f4: p ∈ {{ &z }} q ∈ {{ &x }} s.i1 ∈ {1} or UNINITIALIZED .i2 ∈ {2} or UNINITIALIZED [eva:final-states] Values at end of function main: x ∈ {2; 3} y ∈ {5} [from] Computing for function f1 [from] Done for function f1 [from] Computing for function f2 [from] Done for function f2 [from] Computing for function f3 [from] Done for function f3 [from] Computing for function g4 [from] Done for function g4 [from] Computing for function f4 [from] Done for function f4 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: NO EFFECTS [from] Function f2: x FROM \nothing y FROM \nothing [from] Function f3: NO EFFECTS [from] Function g4: NO EFFECTS [from] Function f4: NO EFFECTS [from] Function main: x FROM vol y FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f1: \nothing [inout] Inputs for function f1: \nothing [inout] Out (internal) for function f2: x; y [inout] Inputs for function f2: \nothing [inout] Out (internal) for function f3: \nothing [inout] Inputs for function f3: \nothing [inout] Out (internal) for function g4: s.i1; x_0 [inout] Inputs for function g4: \nothing [inout] Out (internal) for function f4: p; q; s [inout] Inputs for function f4: vol [inout] Out (internal) for function main: x; y [inout] Inputs for function main: vol frama-c-20.0-Calcium/tests/value/oracle/typedef_function.res.oracle0000666000000000000000000000150513571573400022263 0ustar [kernel] Parsing tests/value/typedef_function.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G209[0] ∈ {0} [1] ∈ {{ &F476 }} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {0} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; __retres [inout] Inputs for function main: G209[0] frama-c-20.0-Calcium/tests/value/oracle/typeof.res.oracle0000666000000000000000000000135113571573400020223 0ustar [kernel] Parsing tests/value/typeof.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/ulongvslonglong.0.res.oracle0000666000000000000000000000120613571573400022307 0ustar [kernel] Parsing tests/value/ulongvslonglong.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} x2 ∈ {0} x9[0..5][0..1] ∈ {0} [eva] tests/value/ulongvslonglong.i:14: starting to merge loop iterations [eva] tests/value/ulongvslonglong.i:12: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {1} x2 ∈ {2793414595} x9[0..5][0..1] ∈ {0; 1} frama-c-20.0-Calcium/tests/value/oracle/ulongvslonglong.1.res.oracle0000666000000000000000000000120713571573400022311 0ustar [kernel] Parsing tests/value/ulongvslonglong.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization x ∈ {0} x2 ∈ {0} x9[0..5][0..1] ∈ {0} [eva] tests/value/ulongvslonglong.i:14: starting to merge loop iterations [eva] tests/value/ulongvslonglong.i:12: starting to merge loop iterations [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {0} x2 ∈ {-1501552701} x9[0..5][0..1] ∈ {0; 1} frama-c-20.0-Calcium/tests/value/oracle/undef_behavior_bts1059.res.oracle0000666000000000000000000000330713571573400023067 0ustar [kernel] Parsing tests/value/undef_behavior_bts1059.i (no preprocessing) [kernel] tests/value/undef_behavior_bts1059.i:15: Warning: Unspecified sequence with side effect: /* a <- */ if (b) tmp = 1; else { a ++; if (a == 2) tmp = 1; else tmp = 0; } /* a <- */ a = tmp; [kernel] tests/value/undef_behavior_bts1059.i:23: Warning: Unspecified sequence with side effect: /* <- */ tmp_4 = a; /* a <- */ a ++; /* a <- tmp_4 */ a = tmp_4; [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization c ∈ [--..--] [eva:alarm] tests/value/undef_behavior_bts1059.i:15: Warning: undefined multiple accesses in expression. assert \separated(&a, &a); [eva:alarm] tests/value/undef_behavior_bts1059.i:23: Warning: undefined multiple accesses in expression. assert \separated(&a, &a); [eva] Recording results for main [eva] done for function main [eva] tests/value/undef_behavior_bts1059.i:15: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undef_behavior_bts1059.i:23: assertion 'Eva,separation' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: a ∈ {1} b ∈ {2} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: a; b; tmp_0; tmp_1; tmp_2; tmp_3; __retres [inout] Inputs for function main: c frama-c-20.0-Calcium/tests/value/oracle/undef_fct.res.oracle0000666000000000000000000000242613571573400020656 0ustar [kernel] Parsing tests/value/undef_fct.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/value/undef_fct.i:3: Warning: Calling undeclared function f. Old style K&R code? [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function f <- main. Called from tests/value/undef_fct.i:3. [kernel:annot:missing-spec] tests/value/undef_fct.i:3: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] using specification for function f [eva] Done for function f [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: [from] Computing for function main [from] Computing for function f <-main [from] Done for function f [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x_0 [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: tmp [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/undefined_sequence.0.res.oracle0000666000000000000000000001720213571573400022706 0ustar [kernel] Parsing tests/value/undefined_sequence.i (no preprocessing) [kernel] tests/value/undefined_sequence.i:16: Warning: Unspecified sequence with side effect: /* <- */ tmp = r; /* r <- */ r ++; /* r <- tmp */ r = tmp; [kernel] tests/value/undefined_sequence.i:28: Warning: Unspecified sequence with side effect: /* d <- */ d = 0; /* <- d */ [kernel] tests/value/undefined_sequence.i:35: Warning: Unspecified sequence with side effect: /* x <- */ x = 0; /* *y <- y */ tmp = 1; *y = tmp; /* i <- */ i = x + tmp; [kernel] tests/value/undefined_sequence.i:44: Warning: Unspecified sequence with side effect: /* <- */ tmp_4 = j; /* j <- */ j ++; /* G[j] <- j G[tmp_4] tmp_4 */ G[j] = G[tmp_4]; [kernel] tests/value/undefined_sequence.i:45: Warning: Unspecified sequence with side effect: /* <- */ tmp_5 = i; /* i <- */ i ++; /* G[tmp_5] <- tmp_5 G[i] i */ G[tmp_5] = G[i]; [kernel] tests/value/undefined_sequence.i:50: Warning: Unspecified sequence with side effect: /* <- */ tmp_6 = j; /* j <- */ j ++; /* G[j] <- j G[tmp_6] tmp_6 */ G[j] += G[tmp_6]; [kernel] tests/value/undefined_sequence.i:51: Warning: Unspecified sequence with side effect: /* <- */ tmp_7 = i; /* i <- */ i ++; /* G[tmp_7] <- tmp_7 G[i] i */ G[tmp_7] += G[i]; [kernel] tests/value/undefined_sequence.i:53: Warning: Unspecified sequence with side effect: /* <- x */ tmp_8 = g(3); tmp_9 = f(tmp_8 + x); /* <- */ tmp_10 = x; /* x <- */ x ++; /* i <- tmp_10 */ i = tmp_9 + tmp_10; [kernel] tests/value/undefined_sequence.i:67: Warning: Unspecified sequence with side effect: /* my_f <- */ my_f = & g; tmp_16 = f(1); /* <- my_f */ tmp_17 = (*my_f)(2); /* <- */ tmp_18 = tmp_16 + tmp_17; [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G[0..9] ∈ {0} c ∈ [--..--] r ∈ {0} H ∈ {0} [eva:alarm] tests/value/undefined_sequence.i:35: Warning: undefined multiple accesses in expression. assert \separated(&x, y); [eva] tests/value/undefined_sequence.i:36: starting to merge loop iterations [eva] tests/value/undefined_sequence.i:38: starting to merge loop iterations [eva] tests/value/undefined_sequence.i:40: starting to merge loop iterations [eva:alarm] tests/value/undefined_sequence.i:40: Warning: signed overflow. assert G[tmp_2] + G[tmp_3] ≤ 2147483647; (tmp_2 from j++, tmp_3 from i++) [eva:alarm] tests/value/undefined_sequence.i:44: Warning: undefined multiple accesses in expression. assert \separated(&j, &j); [eva:alarm] tests/value/undefined_sequence.i:45: Warning: undefined multiple accesses in expression. assert \separated(&i, &i); [eva:alarm] tests/value/undefined_sequence.i:50: Warning: undefined multiple accesses in expression. assert \separated(&j, &j); [eva:alarm] tests/value/undefined_sequence.i:51: Warning: undefined multiple accesses in expression. assert \separated(&i, &i); [eva:alarm] tests/value/undefined_sequence.i:53: Warning: undefined multiple accesses in expression. assert \separated(&x, &x); [eva] computing for function g <- main. Called from tests/value/undefined_sequence.i:54. [eva] Recording results for g [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/undefined_sequence.i:54. [eva] Recording results for f [eva] Done for function f [eva] computing for function h <- main. Called from tests/value/undefined_sequence.i:56. [eva:alarm] tests/value/undefined_sequence.i:16: Warning: undefined multiple accesses in expression. assert \separated(&r, &r); [eva] Recording results for h [eva] Done for function h [eva] computing for function h <- main. Called from tests/value/undefined_sequence.i:56. [eva] Recording results for h [eva] Done for function h [eva] computing for function func <- main. Called from tests/value/undefined_sequence.i:60. [eva] Recording results for func [eva] Done for function func [eva] computing for function ub_ret <- main. Called from tests/value/undefined_sequence.i:65. [eva:alarm] tests/value/undefined_sequence.i:28: Warning: undefined multiple accesses in expression. assert \separated(&d, &d); [eva] Recording results for ub_ret [eva] Done for function ub_ret [eva:alarm] tests/value/undefined_sequence.i:67: Warning: undefined multiple accesses in expression. assert \separated(&my_f, &my_f); [eva] Recording results for main [eva] done for function main [eva] tests/value/undefined_sequence.i:16: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence.i:28: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence.i:35: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence.i:44: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence.i:45: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence.i:50: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence.i:51: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence.i:53: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence.i:67: assertion 'Eva,separation' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {6} [eva:final-states] Values at end of function func: __retres ∈ {5; 6} [eva:final-states] Values at end of function g: __retres ∈ {5} [eva:final-states] Values at end of function h: r ∈ {1; 2} H ∈ {0; 1} i ∈ {0; 1} [eva:final-states] Values at end of function ub_ret: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: G[0..1] ∈ [0..2147483647] [2] ∈ {0; 1} [3..9] ∈ [0..2147483647] r ∈ {0; 1} H ∈ {0; 1} x ∈ {6} y ∈ {{ &G[2] }} i ∈ {0} j ∈ {0} my_f ∈ {{ &f }} [from] Computing for function f [from] Done for function f [from] Computing for function func [from] Done for function func [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function ub_ret [from] Non-terminating function ub_ret (no dependencies) [from] Done for function ub_ret [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function func: \result FROM x; y [from] Function g: \result FROM x [from] Function h: r FROM r H FROM r \result FROM r [from] Function ub_ret: NON TERMINATING - NO EFFECTS [from] Function main: G{[0..1]; [3..9]} FROM G[0..9] (and SELF) [2] FROM G[0..9] r FROM r; a (and SELF) H FROM r; a (and SELF) \result FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function func: __retres [inout] Inputs for function func: \nothing [inout] Out (internal) for function g: __retres [inout] Inputs for function g: \nothing [inout] Out (internal) for function h: r; H; i; tmp_0 [inout] Inputs for function h: c; r [inout] Out (internal) for function ub_ret: d [inout] Inputs for function ub_ret: \nothing [inout] Out (internal) for function main: G[0..9]; r; H; x; y; i; j; tmp_0; tmp_1; tmp_2; tmp_3; tmp_11; tmp_12; tmp_13; tmp_14; tmp_15; my_f; tmp_18 [inout] Inputs for function main: G[0..9]; c; r frama-c-20.0-Calcium/tests/value/oracle/undefined_sequence.1.res.oracle0000666000000000000000000001166113571573400022712 0ustar [kernel] Parsing tests/value/undefined_sequence.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G[0..9] ∈ {0} c ∈ [--..--] r ∈ {0} H ∈ {0} [eva] tests/value/undefined_sequence.i:36: starting to merge loop iterations [eva] tests/value/undefined_sequence.i:38: starting to merge loop iterations [eva] tests/value/undefined_sequence.i:40: starting to merge loop iterations [eva:alarm] tests/value/undefined_sequence.i:40: Warning: signed overflow. assert G[tmp_2] + G[tmp_3] ≤ 2147483647; (tmp_2 from j++, tmp_3 from i++) [eva] tests/value/undefined_sequence.i:43: starting to merge loop iterations [eva:alarm] tests/value/undefined_sequence.i:50: Warning: signed overflow. assert G[j] + G[tmp_6] ≤ 2147483647; (tmp_6 from j++) [eva:alarm] tests/value/undefined_sequence.i:51: Warning: signed overflow. assert G[tmp_7] + G[i] ≤ 2147483647; (tmp_7 from i++) [eva] tests/value/undefined_sequence.i:49: starting to merge loop iterations [eva] computing for function g <- main. Called from tests/value/undefined_sequence.i:53. [eva] Recording results for g [eva] Done for function g [eva] computing for function f <- main. Called from tests/value/undefined_sequence.i:53. [eva] Recording results for f [eva] Done for function f [eva] tests/value/undefined_sequence.i:54: Reusing old results for call to g [eva] computing for function f <- main. Called from tests/value/undefined_sequence.i:54. [eva] Recording results for f [eva] Done for function f [eva] computing for function h <- main. Called from tests/value/undefined_sequence.i:56. [eva] Recording results for h [eva] Done for function h [eva] computing for function h <- main. Called from tests/value/undefined_sequence.i:56. [eva] Recording results for h [eva] Done for function h [eva] computing for function func <- main. Called from tests/value/undefined_sequence.i:60. [eva] Recording results for func [eva] Done for function func [eva] computing for function ub_ret <- main. Called from tests/value/undefined_sequence.i:65. [eva] Recording results for ub_ret [eva] Done for function ub_ret [eva] computing for function f <- main. Called from tests/value/undefined_sequence.i:67. [eva] Recording results for f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/undefined_sequence.i:67. [eva] Recording results for g [eva] Done for function g [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: __retres ∈ {2; 6; 7; 8} [eva:final-states] Values at end of function func: __retres ∈ {5; 6} [eva:final-states] Values at end of function g: __retres ∈ {4; 5} [eva:final-states] Values at end of function h: r ∈ {1; 2} H ∈ {0; 1} i ∈ {0; 1} [eva:final-states] Values at end of function ub_ret: d ∈ {0} __retres ∈ {0} [eva:final-states] Values at end of function main: G[0..1] ∈ [0..2147483647] [2] ∈ {0; 1} [3..9] ∈ [0..2147483647] r ∈ {0; 1} H ∈ {0; 1} x ∈ {6; 7; 8} y ∈ {{ &G[2] }} i ∈ [0..9] j ∈ [0..9] my_f ∈ {{ &f ; &g }} [from] Computing for function f [from] Done for function f [from] Computing for function func [from] Done for function func [from] Computing for function g [from] Done for function g [from] Computing for function h [from] Done for function h [from] Computing for function ub_ret [from] Done for function ub_ret [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM x [from] Function func: \result FROM x; y [from] Function g: \result FROM x [from] Function h: r FROM c; r H FROM c; r \result FROM c; r [from] Function ub_ret: \result FROM \nothing [from] Function main: G{[0..1]; [3..9]} FROM G[0..9]; c (and SELF) [2] FROM G[0..9]; c r FROM c; r; a (and SELF) H FROM c; r; a (and SELF) \result FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: __retres [inout] Inputs for function f: \nothing [inout] Out (internal) for function func: __retres [inout] Inputs for function func: \nothing [inout] Out (internal) for function g: __retres [inout] Inputs for function g: \nothing [inout] Out (internal) for function h: r; H; i; tmp; tmp_0 [inout] Inputs for function h: c; r [inout] Out (internal) for function ub_ret: d; __retres [inout] Inputs for function ub_ret: \nothing [inout] Out (internal) for function main: G[0..9]; r; H; x; y; i; j; tmp; tmp_0; tmp_1; tmp_2; tmp_3; tmp_4; tmp_5; tmp_6; tmp_7; tmp_8; tmp_9; tmp_10; tmp_11; tmp_12; tmp_13; tmp_14; tmp_15; my_f; tmp_16; tmp_17; tmp_18 [inout] Inputs for function main: G[0..9]; c; r frama-c-20.0-Calcium/tests/value/oracle/undefined_sequence2.res.oracle0000666000000000000000000001470713571573400022641 0ustar [kernel] Parsing tests/value/undefined_sequence2.i (no preprocessing) [kernel] tests/value/undefined_sequence2.i:11: Warning: Unspecified sequence with side effect: /* *x <- x */ tmp = 0; *x = tmp; /* *x <- x */ tmp_0 = 0; *x = tmp_0; [kernel] tests/value/undefined_sequence2.i:18: Warning: Unspecified sequence with side effect: /* i <- */ i ++; /* i <- */ i ++; [kernel] tests/value/undefined_sequence2.i:26: Warning: Unspecified sequence with side effect: /* <- */ tmp = i; /* i <- */ i ++; /* a[tmp] <- tmp i */ a[tmp] = i; [kernel] tests/value/undefined_sequence2.i:34: Warning: Unspecified sequence with side effect: /* *x <- x */ tmp = 0; *x = tmp; /* *y <- y */ tmp_0 = 0; *y = tmp_0; [kernel] tests/value/undefined_sequence2.i:47: Warning: Unspecified sequence with side effect: /* *x <- x */ tmp = 0; *x = tmp; /* *y <- y */ tmp_0 = 0; *y = tmp_0; [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a[0..1] ∈ {0} foo ∈ [--..--] [eva] computing for function multiple_update_wrong_1 <- main. Called from tests/value/undefined_sequence2.i:56. [eva:alarm] tests/value/undefined_sequence2.i:11: Warning: undefined multiple accesses in expression. assert \separated(x, x); [eva] Recording results for multiple_update_wrong_1 [eva] Done for function multiple_update_wrong_1 [eva] computing for function multiple_update_wrong_2 <- main. Called from tests/value/undefined_sequence2.i:58. [eva:alarm] tests/value/undefined_sequence2.i:18: Warning: undefined multiple accesses in expression. assert \separated(&i, &i); [eva] Recording results for multiple_update_wrong_2 [eva] Done for function multiple_update_wrong_2 [eva] computing for function multiple_update_wrong_3 <- main. Called from tests/value/undefined_sequence2.i:60. [eva:alarm] tests/value/undefined_sequence2.i:26: Warning: undefined multiple accesses in expression. assert \separated(&i, &i); [eva] Recording results for multiple_update_wrong_3 [eva] Done for function multiple_update_wrong_3 [eva] computing for function multiple_update_unsafe <- main. Called from tests/value/undefined_sequence2.i:62. [eva] Recording results for multiple_update_unsafe [eva] Done for function multiple_update_unsafe [eva] tests/value/undefined_sequence2.i:62: Frama_C_show_each_passed4: [eva] computing for function multiple_update_unsafe <- main. Called from tests/value/undefined_sequence2.i:64. [eva:alarm] tests/value/undefined_sequence2.i:34: Warning: undefined multiple accesses in expression. assert \separated(x, y); [eva] Recording results for multiple_update_unsafe [eva] Done for function multiple_update_unsafe [eva] computing for function multiple_update_safe <- main. Called from tests/value/undefined_sequence2.i:66. [eva] Recording results for multiple_update_safe [eva] Done for function multiple_update_safe [eva] tests/value/undefined_sequence2.i:66: Frama_C_show_each_passed6: [eva] computing for function multiple_update_safe <- main. Called from tests/value/undefined_sequence2.i:68. [eva] Recording results for multiple_update_safe [eva] Done for function multiple_update_safe [eva] tests/value/undefined_sequence2.i:68: Frama_C_show_each_passed7: [eva] Recording results for main [eva] done for function main [eva] tests/value/undefined_sequence2.i:11: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence2.i:18: assertion 'Eva,separation' got final status invalid. [eva] tests/value/undefined_sequence2.i:26: assertion 'Eva,separation' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function multiple_update_safe: b ∈ {0} c ∈ {0} __retres ∈ {0} [eva:final-states] Values at end of function multiple_update_unsafe: b ∈ {0} c ∈ {0} __retres ∈ {0} [eva:final-states] Values at end of function multiple_update_wrong_1: NON TERMINATING FUNCTION [eva:final-states] Values at end of function multiple_update_wrong_2: NON TERMINATING FUNCTION [eva:final-states] Values at end of function multiple_update_wrong_3: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: b ∈ {0} c ∈ {0} __retres ∈ {0} [from] Computing for function multiple_update_safe [from] Done for function multiple_update_safe [from] Computing for function multiple_update_unsafe [from] Done for function multiple_update_unsafe [from] Computing for function multiple_update_wrong_1 [from] Non-terminating function multiple_update_wrong_1 (no dependencies) [from] Done for function multiple_update_wrong_1 [from] Computing for function multiple_update_wrong_2 [from] Non-terminating function multiple_update_wrong_2 (no dependencies) [from] Done for function multiple_update_wrong_2 [from] Computing for function multiple_update_wrong_3 [from] Non-terminating function multiple_update_wrong_3 (no dependencies) [from] Done for function multiple_update_wrong_3 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function multiple_update_safe: b FROM x; y (and SELF) c FROM x; y (and SELF) \result FROM x; y [from] Function multiple_update_unsafe: b FROM x c FROM y \result FROM \nothing [from] Function multiple_update_wrong_1: NON TERMINATING - NO EFFECTS [from] Function multiple_update_wrong_2: NON TERMINATING - NO EFFECTS [from] Function multiple_update_wrong_3: NON TERMINATING - NO EFFECTS [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function multiple_update_safe: tmp; tmp_0; b; c; __retres [inout] Inputs for function multiple_update_safe: \nothing [inout] Out (internal) for function multiple_update_unsafe: tmp; tmp_0; b; c; __retres [inout] Inputs for function multiple_update_unsafe: \nothing [inout] Out (internal) for function multiple_update_wrong_1: \nothing [inout] Inputs for function multiple_update_wrong_1: \nothing [inout] Out (internal) for function multiple_update_wrong_2: \nothing [inout] Inputs for function multiple_update_wrong_2: \nothing [inout] Out (internal) for function multiple_update_wrong_3: \nothing [inout] Inputs for function multiple_update_wrong_3: \nothing [inout] Out (internal) for function main: b; c; __retres [inout] Inputs for function main: foo frama-c-20.0-Calcium/tests/value/oracle/uninit.res.oracle0000666000000000000000000000201213571573400020216 0ustar [kernel] Parsing tests/value/uninit.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/uninit.i:3: Warning: accessing uninitialized left-value. assert \initialized(&i); [eva] Recording results for main [eva] done for function main [eva] tests/value/uninit.i:3: assertion 'Eva,initialization' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/uninit_callstack.res.oracle0000666000000000000000000000076513571573400022254 0ustar [kernel] Parsing tests/value/uninit_callstack.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} x ∈ {0} [eva:alarm] tests/value/uninit_callstack.i:8: Warning: accessing uninitialized left-value. assert \initialized(p); stack: f :: tests/value/uninit_callstack.i:14 <- main [eva] done for function main [eva] ====== VALUES COMPUTED ====== frama-c-20.0-Calcium/tests/value/oracle/uninitialized_gnubody.res.oracle0000666000000000000000000000141613571573400023316 0ustar [kernel] Parsing tests/value/uninitialized_gnubody.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: x ∈ {44} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: x; y; tmp [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/unknown_sizeof.0.res.oracle0000666000000000000000000000112713571573400022132 0ustar [kernel] Parsing tests/value/unknown_sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main1 [eva] Computing initial state [eva] tests/value/unknown_sizeof.i:8: Warning: during initialization of variable 's', size of type 'struct s' cannot be computed (abstract type 'struct s') [eva] Initial state computed [eva:initial-state] Values of globals at initialization s.[bits 0 to ..] ∈ {0} or UNINITIALIZED [eva] tests/value/unknown_sizeof.i:19: User Error: function g returns a value of unknown size. Aborting [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/unknown_sizeof.1.res.oracle0000666000000000000000000000116213571573400022132 0ustar [kernel] Parsing tests/value/unknown_sizeof.i (no preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] tests/value/unknown_sizeof.i:8: Warning: during initialization of variable 's', size of type 'struct s' cannot be computed (abstract type 'struct s') [eva] Initial state computed [eva:initial-state] Values of globals at initialization s.[bits 0 to ..] ∈ {0} or UNINITIALIZED [eva] tests/value/unknown_sizeof.i:24: User Error: Function argument *((struct s *)((char *)(& s) + 1)) has unknown size. Aborting [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/unop.res.oracle0000666000000000000000000000411113571573400017673 0ustar [kernel] Parsing tests/value/unop.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization v ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/unop.c:22. [eva] tests/value/unop.c:2: Frama_C_show_each_1: [-2147483648. .. 2147483648.] [eva] tests/value/unop.c:4: Frama_C_show_each_1_then: [-2147483648. .. -3.] [eva] tests/value/unop.c:6: Frama_C_show_each_1_else: [-2.99999976158 .. 2147483648.] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/unop.c:23. [eva] tests/value/unop.c:11: Frama_C_show_each_2: [-2147483648..2147483647] [eva:alarm] tests/value/unop.c:12: Warning: signed overflow. assert -i ≤ 2147483647; [eva] tests/value/unop.c:13: Frama_C_show_each_2_then: [-2147483647..-3] [eva] tests/value/unop.c:15: Frama_C_show_each_2_else: [-2..2147483647] [eva] Recording results for main2 [eva] Done for function main2 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: [eva:final-states] Values at end of function main2: [eva:final-states] Values at end of function main: [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: \nothing [inout] Inputs for function main1: \nothing [inout] Out (internal) for function main2: \nothing [inout] Inputs for function main2: \nothing [inout] Out (internal) for function main: \nothing [inout] Inputs for function main: v frama-c-20.0-Calcium/tests/value/oracle/unroll.res.oracle0000666000000000000000000000312113571573400020225 0ustar [kernel] Parsing tests/value/unroll.i (no preprocessing) [kernel] tests/value/unroll.i:49: Warning: ignoring unrolling directive (not an understood constant expression) [kernel] tests/value/unroll.i:54: Warning: ignoring invalid unrolling directive [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t_biosmap[0..9] ∈ {0} g_biosmap ∈ {{ &t_biosmap[0] }} biosmap ∈ {0} [eva] tests/value/unroll.i:31: starting to merge loop iterations [eva:alarm] tests/value/unroll.i:34: Warning: signed overflow. assert -2147483648 ≤ j - 1; [eva:alarm] tests/value/unroll.i:32: Warning: signed overflow. assert G + i ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: c ∈ {0} G ∈ [17739..2147483647] i ∈ {257} MAX ∈ {12} JMAX ∈ {5} j ∈ [-2147483648..-123] k ∈ {13} S ∈ {479001600} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: c; G; i; MAX; JMAX; j; k; S; tmp; tmp_unroll_3752; tmp_unroll_3760; tmp_unroll_3768; tmp_unroll_3776; tmp_unroll_3784; tmp_unroll_3792; tmp_unroll_3800; tmp_unroll_3808; tmp_unroll_3816; tmp_unroll_3824 [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/unroll_simple.res.oracle0000666000000000000000000000245113571573400021603 0ustar [kernel] Parsing tests/value/unroll_simple.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/unroll_simple.i:8: starting to merge loop iterations [eva:alarm] tests/value/unroll_simple.i:11: Warning: signed overflow. assert -2147483648 ≤ j - 1; [eva:alarm] tests/value/unroll_simple.i:9: Warning: signed overflow. assert G + i ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: c ∈ {0} G ∈ [8772..2147483647] i ∈ {257} MAX ∈ {12} JMAX ∈ {5} j ∈ [-2147483648..-126] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: c; G; i; MAX; JMAX; j; tmp; tmp_unroll_774; tmp_unroll_782; tmp_unroll_790; tmp_unroll_798; tmp_unroll_806; tmp_unroll_814; tmp_unroll_822; tmp_unroll_830; tmp_unroll_838; tmp_unroll_846 [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/unsigned_overflow.res.oracle0000666000000000000000000000207313571573400022456 0ustar [kernel] Parsing tests/value/unsigned_overflow.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i1 ∈ [--..--] i2 ∈ [--..--] [eva:alarm] tests/value/unsigned_overflow.c:4: Warning: assertion got status unknown. [eva:alarm] tests/value/unsigned_overflow.c:5: Warning: assertion got status unknown. [eva] tests/value/unsigned_overflow.c:10: Frama_C_show_each_dead: [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: v ∈ [--..--] __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: v; w; __retres [inout] Inputs for function main: i1; i2 frama-c-20.0-Calcium/tests/value/oracle/use_spec.0.res.oracle0000666000000000000000000000541413571573400020665 0ustar [kernel] Parsing tests/value/use_spec.i (no preprocessing) [eva] User Error: no assigns specified for function 'f', for which a builtin or the specification will be used. Potential unsoundness. [eva] Warning: Generating potentially incorrect assigns for function 'f' for which option -eva-use-spec is set [kernel:annot:missing-spec] tests/value/use_spec.i:7: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} [eva] computing for function f <- main. Called from tests/value/use_spec.i:22. [eva] using specification for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/use_spec.i:23. [kernel:annot:missing-spec] tests/value/use_spec.i:23: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] computing for function h <- main. Called from tests/value/use_spec.i:24. [eva] using specification for function h [eva] Done for function h [eva] computing for function i <- main. Called from tests/value/use_spec.i:25. [eva] using specification for function i [eva] Done for function i [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: w ∈ [--..--] x ∈ [--..--] y ∈ [--..--] z ∈ [--..--] [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/value/use_spec.i:22 (by main): x FROM x (and SELF) [from] call to g at tests/value/use_spec.i:23 (by main): y FROM y (and SELF) [from] call to h at tests/value/use_spec.i:24 (by main): z FROM \nothing [from] call to i at tests/value/use_spec.i:25 (by main): w FROM \nothing [from] entry point: w FROM \nothing x FROM x (and SELF) y FROM y (and SELF) z FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] InOut (internal) for function f: Operational inputs: x Operational inputs on termination: x Sure outputs: \nothing [inout] InOut (internal) for function h: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: z [inout] InOut (internal) for function main: Operational inputs: x; y Operational inputs on termination: x; y Sure outputs: w; z [eva] User Error: Deferred error message was emitted during execution. See above messages for more information. [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/use_spec.1.res.oracle0000666000000000000000000000545413571573400020672 0ustar [kernel] Parsing tests/value/use_spec.i (no preprocessing) [eva] User Error: no assigns specified for function 'f', for which a builtin or the specification will be used. Potential unsoundness. [eva] Warning: Generating potentially incorrect assigns for function 'f' for which option -eva-use-spec is set [kernel:annot:missing-spec] tests/value/use_spec.i:7: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization w ∈ {0} x ∈ {0} y ∈ {0} z ∈ {0} [eva] computing for function f <- main. Called from tests/value/use_spec.i:22. [eva] using specification for function f [eva] Done for function f [eva] computing for function g <- main. Called from tests/value/use_spec.i:23. [kernel:annot:missing-spec] tests/value/use_spec.i:23: Warning: Neither code nor specification for function g, generating default assigns from the prototype [eva] using specification for function g [eva] Done for function g [eva] computing for function h <- main. Called from tests/value/use_spec.i:24. [eva] using specification for function h [eva] Done for function h [eva] computing for function i <- main. Called from tests/value/use_spec.i:25. [eva] using specification for function i [eva] Done for function i [eva] Recording results for main [from] Computing for function main [from] Done for function main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: w ∈ [--..--] x ∈ [--..--] y ∈ [--..--] z ∈ [--..--] [from] ====== DISPLAYING CALLWISE DEPENDENCIES ====== [from] call to f at tests/value/use_spec.i:22 (by main): x FROM direct: x (and SELF) [from] call to g at tests/value/use_spec.i:23 (by main): y FROM direct: y (and SELF) [from] call to h at tests/value/use_spec.i:24 (by main): z FROM \nothing [from] call to i at tests/value/use_spec.i:25 (by main): w FROM \nothing [from] entry point: w FROM \nothing x FROM direct: x (and SELF) y FROM direct: y (and SELF) z FROM \nothing [from] ====== END OF CALLWISE DEPENDENCIES ====== [inout] InOut (internal) for function f: Operational inputs: x Operational inputs on termination: x Sure outputs: \nothing [inout] InOut (internal) for function h: Operational inputs: \nothing Operational inputs on termination: \nothing Sure outputs: z [inout] InOut (internal) for function main: Operational inputs: x; y Operational inputs on termination: x; y Sure outputs: w; z [eva] User Error: Deferred error message was emitted during execution. See above messages for more information. [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/user_assertion_uninit_var.res.oracle0000666000000000000000000000213213571573400024216 0ustar [kernel] Parsing tests/value/user_assertion_uninit_var.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/user_assertion_uninit_var.i:3: starting to merge loop iterations [eva:alarm] tests/value/user_assertion_uninit_var.i:4: Warning: assertion got status unknown. [eva:alarm] tests/value/user_assertion_uninit_var.i:6: Warning: accessing uninitialized left-value. assert \initialized(&n); [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ {10} n ∈ [0..9] x ∈ {0; 1} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: i; n; x [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/usp.res.oracle0000666000000000000000000000257513571573400017535 0ustar [kernel] Parsing tests/value/usp.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {-12} b ∈ {0} p ∈ {{ (unsigned int *)&a }} q ∈ {{ (unsigned int *)&b }} X ∈ {0} Y ∈ {0} Z ∈ {0} T ∈ {0} [eva] tests/value/usp.i:17: Frama_C_show_each: {-1; 5} [eva] tests/value/usp.i:18: Frama_C_dump_each: # Cvalue domain: a ∈ {-12} b ∈ {5; 4294967295} p ∈ {{ (unsigned int *)&a }} q ∈ {{ (unsigned int *)&b }} X ∈ {0} Y ∈ {-12} Z ∈ {-1; 0} T ∈ {0; 5} c ∈ [--..--] __retres ∈ UNINITIALIZED ==END OF DUMP== [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: b ∈ {-1; 5} Y ∈ {-12} Z ∈ {-1; 0} T ∈ {0; 5} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: b FROM c Y FROM a; p Z FROM q; c (and SELF) T FROM q; c (and SELF) \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: b; Y; Z; T; __retres [inout] Inputs for function main: a; b; p; q frama-c-20.0-Calcium/tests/value/oracle/va_list.0.res.oracle0000666000000000000000000000273213571573400020520 0ustar [kernel] Parsing tests/value/va_list.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:initial-state] creating variable S_0_S___va_params with imprecise size (type void) [eva:initial-state] creating variable S_1_S___va_params with imprecise size (type void) [eva] computing for function __builtin_next_arg <- main. Called from tests/value/va_list.c:13. [kernel:annot:missing-spec] tests/value/va_list.c:13: Warning: Neither code nor specification for function __builtin_next_arg, generating default assigns from the prototype [eva] using specification for function __builtin_next_arg [eva] Done for function __builtin_next_arg [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: vlParameters ∈ [--..--] [from] Computing for function main [from] Computing for function __builtin_next_arg <-main [from] Done for function __builtin_next_arg [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function __builtin_next_arg: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: vlParameters; tmp [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/oracle/va_list.1.res.oracle0000666000000000000000000000305413571573400020517 0ustar [kernel] Parsing tests/value/va_list.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function __builtin_next_arg <- main. Called from tests/value/va_list.c:13. [kernel:annot:missing-spec] tests/value/va_list.c:13: Warning: Neither code nor specification for function __builtin_next_arg, generating default assigns from the prototype [eva] using specification for function __builtin_next_arg [eva] tests/value/va_list.c:13: User Error: functions returning variadic arguments must be stubbed [eva] Done for function __builtin_next_arg [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: vlParameters ∈ [--..--] [from] Computing for function main [from] Computing for function __builtin_next_arg <-main [from] Done for function __builtin_next_arg [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function __builtin_next_arg: \result FROM \nothing [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: vlParameters; tmp [inout] Inputs for function main: \nothing [eva] User Error: Deferred error message was emitted during execution. See above messages for more information. [kernel] Plug-in eva aborted: invalid user input. frama-c-20.0-Calcium/tests/value/oracle/va_list2.0.res.oracle0000666000000000000000000000572413571573400020606 0ustar [kernel] Parsing tests/value/va_list2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:initial-state] creating variable S_0_S___va_params with imprecise size (type void) [eva:initial-state] creating variable S_1_S___va_params with imprecise size (type void) [eva:alarm] tests/value/va_list2.c:12: Warning: out of bounds read. assert \valid_read(fmt); [eva:alarm] tests/value/va_list2.c:15: Warning: out of bounds read. assert \valid_read(args); [eva:alarm] tests/value/va_list2.c:15: Warning: out of bounds read. assert \valid_read((int *)*args); [eva] tests/value/va_list2.c:15: Assigning imprecise value to tmp. The imprecision originates from Well [eva] tests/value/va_list2.c:15: Assigning imprecise value to i. The imprecision originates from Well [eva] tests/value/va_list2.c:16: Frama_C_show_each_i: {{ garbled mix of &{S_0_S___va_params} (origin: Well) }} [eva:alarm] tests/value/va_list2.c:20: Warning: out of bounds read. assert \valid_read(args); [eva:alarm] tests/value/va_list2.c:20: Warning: out of bounds read. assert \valid_read((float *)*args); [eva:alarm] tests/value/va_list2.c:20: Warning: non-finite float value. assert \is_finite(*((float *)*args)); [eva] tests/value/va_list2.c:20: Assigning imprecise value to tmp_0. The imprecision originates from Well [eva:alarm] tests/value/va_list2.c:20: Warning: non-finite float value. assert \is_finite(tmp_0); (tmp_0 from vararg) [eva] tests/value/va_list2.c:20: Assigning imprecise value to f. The imprecision originates from Well [eva] tests/value/va_list2.c:21: Frama_C_show_each_f: {{ garbled mix of &{S_0_S___va_params} (origin: Well) }} [eva] tests/value/va_list2.c:12: starting to merge loop iterations [eva:alarm] tests/value/va_list2.c:13: Warning: out of bounds read. assert \valid_read(fmt); [eva] tests/value/va_list2.c:16: Frama_C_show_each_i: {{ garbled mix of &{S_0_S___va_params; S_1_S___va_params} (origin: Well) }} [eva] tests/value/va_list2.c:21: Frama_C_show_each_f: {{ garbled mix of &{S_0_S___va_params; S_1_S___va_params} (origin: Well) }} [eva] Recording results for main [eva] done for function main [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: fmt ∈ {{ &S_fmt{[0], [1]} }} args ∈ {{ NULL ; &S___va_params{[0], [1], [2]} }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: fmt; args; i; tmp; f; tmp_0 [inout] Inputs for function main: S___va_params[0..1]; S_0_S___va_params[bits 0 to ..]; S_1_S___va_params[bits 0 to ..]; S_fmt[0..1] frama-c-20.0-Calcium/tests/value/oracle/va_list2.1.res.oracle0000666000000000000000000000666113571573400020610 0ustar [kernel] Parsing tests/value/va_list2.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function __builtin_va_start <- main. Called from tests/value/va_list2.c:11. [kernel:annot:missing-spec] tests/value/va_list2.c:11: Warning: Neither code nor specification for function __builtin_va_start, generating default assigns from the prototype [eva] using specification for function __builtin_va_start [eva] Done for function __builtin_va_start [eva:alarm] tests/value/va_list2.c:12: Warning: out of bounds read. assert \valid_read(fmt); [eva] computing for function __builtin_va_arg <- main. Called from tests/value/va_list2.c:15. [kernel:annot:missing-spec] tests/value/va_list2.c:15: Warning: Neither code nor specification for function __builtin_va_arg, generating default assigns from the prototype [eva] using specification for function __builtin_va_arg [eva] Done for function __builtin_va_arg [eva:alarm] tests/value/va_list2.c:15: Warning: accessing uninitialized left-value. assert \initialized(&tmp); (tmp from vararg) [eva] computing for function __builtin_va_arg <- main. Called from tests/value/va_list2.c:20. [eva] Done for function __builtin_va_arg [eva:alarm] tests/value/va_list2.c:20: Warning: accessing uninitialized left-value. assert \initialized(&tmp_0); (tmp_0 from vararg) [eva] tests/value/va_list2.c:12: starting to merge loop iterations [eva:alarm] tests/value/va_list2.c:13: Warning: out of bounds read. assert \valid_read(fmt); [eva] computing for function __builtin_va_arg <- main. Called from tests/value/va_list2.c:15. [eva] Done for function __builtin_va_arg [eva] computing for function __builtin_va_arg <- main. Called from tests/value/va_list2.c:20. [eva] Done for function __builtin_va_arg [eva] computing for function __builtin_va_end <- main. Called from tests/value/va_list2.c:28. [kernel:annot:missing-spec] tests/value/va_list2.c:28: Warning: Neither code nor specification for function __builtin_va_end, generating default assigns from the prototype [eva] using specification for function __builtin_va_end [eva] Done for function __builtin_va_end [eva] Recording results for main [eva] done for function main [eva] tests/value/va_list2.c:15: assertion 'Eva,initialization' got final status invalid. [eva] tests/value/va_list2.c:20: assertion 'Eva,initialization' got final status invalid. [scope:rm_asserts] removing 1 assertion(s) [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: fmt ∈ {{ &S_fmt{[0], [1]} }} [from] Computing for function main [from] Computing for function __builtin_va_start <-main [from] Done for function __builtin_va_start [from] Computing for function __builtin_va_arg <-main [from] Done for function __builtin_va_arg [from] Computing for function __builtin_va_end <-main [from] Done for function __builtin_va_end [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function __builtin_va_arg: NO EFFECTS [from] Function __builtin_va_end: NO EFFECTS [from] Function __builtin_va_start: NO EFFECTS [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: fmt; i; f [inout] Inputs for function main: S_fmt[0..1] frama-c-20.0-Calcium/tests/value/oracle/val6.0.res.oracle0000666000000000000000000000236513571573400017731 0ustar [kernel] Parsing tests/value/val6.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 8 to 8388607] ∈ [--..--] c ∈ {0} a ∈ {0} b ∈ {0} y ∈ {0} x ∈ {0} [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: NULL[rbits 8 to 143] ∈ [--..--] [rbits 144 to 175] ∈ {{ (? *)&b }} [rbits 176 to 8388607] ∈ [--..--] c ∈ {{ &b }} a ∈ {98} b[bits 0 to 7] ∈ {97} [bits 8 to 31]# ∈ {{ (? *)&a }}%32, bits 8 to 31 y ∈ {{ &b }} x ∈ {{ (int)&b }} __retres ∈ {0} [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: NULL[18..21] FROM \nothing c FROM \nothing a FROM \nothing b FROM \nothing y FROM \nothing x FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: NULL[18..21]; c; a; b; y; x; __retres [inout] Inputs for function f: NULL[18..21]; c; x frama-c-20.0-Calcium/tests/value/oracle/val6.1.res.oracle0000666000000000000000000000217213571573400017726 0ustar [kernel] Parsing tests/value/val6.i (no preprocessing) [eva] Analyzing a complete application starting at f1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 8 to 8388607] ∈ [--..--] c ∈ {0} a ∈ {0} b ∈ {0} y ∈ {0} x ∈ {0} [eva] Recording results for f1 [eva] done for function f1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f1: NULL[rbits 8 to 135] ∈ [--..--] [rbits 136 to 143] ∈ {27} [rbits 144 to 151] ∈ [--..--] [rbits 152 to 159] ∈ {0} [rbits 160 to 8388607] ∈ [--..--] b ∈ {19} x ∈ {19} __retres ∈ {0} [from] Computing for function f1 [from] Done for function f1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: NULL[17] FROM \nothing [19] FROM c b FROM c x FROM c \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f1: NULL{[17]; [19]}; b; x; __retres [inout] Inputs for function f1: c; b; x frama-c-20.0-Calcium/tests/value/oracle/val_if.0.res.oracle0000666000000000000000000000153613571573400020320 0ustar [kernel] Parsing tests/value/val_if.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: i ∈ {10} x ∈ {-1; 1} j_0 ∈ {12} [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: i FROM \nothing x FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: i; x; j_0 [inout] Inputs for function f: x frama-c-20.0-Calcium/tests/value/oracle/val_if.1.res.oracle0000666000000000000000000000166313571573400020322 0ustar [kernel] Parsing tests/value/val_if.i (no preprocessing) [eva] Analyzing a complete application starting at f1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} [eva] Recording results for f1 [eva] done for function f1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f1: i ∈ {10} j ∈ {-1; 13} x ∈ {-1; 1} k ∈ {14} l ∈ {-1; 15} [from] Computing for function f1 [from] Done for function f1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: i FROM \nothing j FROM c x FROM c k FROM \nothing l FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f1: i; j; x; k; l [inout] Inputs for function f1: x frama-c-20.0-Calcium/tests/value/oracle/val_if.2.res.oracle0000666000000000000000000000166613571573400020326 0ustar [kernel] Parsing tests/value/val_if.i (no preprocessing) [eva] Analyzing a complete application starting at f2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} [eva] Recording results for f2 [eva] done for function f2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f2: i ∈ {10} j ∈ {2} x ∈ {2} k ∈ {17} l ∈ {18} [from] Computing for function f2 [from] Done for function f2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f2: i FROM \nothing j FROM d; c x FROM d; c k FROM \nothing l FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f2: i; j; x; k; l [inout] Inputs for function f2: x; d frama-c-20.0-Calcium/tests/value/oracle/val_ptr.0.res.oracle0000666000000000000000000000215713571573400020527 0ustar [kernel] Parsing tests/value/val_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at f [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} a ∈ {0} b ∈ {0} c ∈ {0} p ∈ {0} T[0..7] ∈ {0} [eva] Recording results for f [eva] done for function f [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f: i ∈ {10} j ∈ {10; 12; 16} k ∈ {10; 11; 12} l ∈ {18} d ∈ {13} a ∈ {10; 11} b ∈ {12} p ∈ {{ &a ; &b }} [from] Computing for function f [from] Done for function f [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: i FROM \nothing j FROM c_0 k FROM c_0 l FROM \nothing d FROM \nothing a FROM c_0 b FROM \nothing p FROM c_0 [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f: i; j; k; l; d; a; b; p [inout] Inputs for function f: d; a; b; p frama-c-20.0-Calcium/tests/value/oracle/val_ptr.1.res.oracle0000666000000000000000000000157713571573400020535 0ustar [kernel] Parsing tests/value/val_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at f1 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} a ∈ {0} b ∈ {0} c ∈ {0} p ∈ {0} T[0..7] ∈ {0} [eva] Recording results for f1 [eva] done for function f1 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f1: p ∈ {{ &T[0] }} [from] Computing for function f1 [from] Done for function f1 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f1: p FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f1: p [inout] Inputs for function f1: p frama-c-20.0-Calcium/tests/value/oracle/val_ptr.2.res.oracle0000666000000000000000000000165413571573400020532 0ustar [kernel] Parsing tests/value/val_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at f3 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} a ∈ {0} b ∈ {0} c ∈ {0} p ∈ {0} T[0..7] ∈ {0} [eva] Recording results for f3 [eva] done for function f3 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f3: p ∈ {{ &T[0] }} T[0..7] ∈ {0} [from] Computing for function f3 [from] Done for function f3 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f3: p FROM \nothing T[0] FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f3: p; T[0] [inout] Inputs for function f3: p frama-c-20.0-Calcium/tests/value/oracle/val_ptr.3.res.oracle0000666000000000000000000000176213571573400020533 0ustar [kernel] Parsing tests/value/val_ptr.i (no preprocessing) [eva] Analyzing a complete application starting at f2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization i ∈ {0} j ∈ {0} x ∈ {0} k ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} d ∈ {0} a ∈ {0} b ∈ {0} c ∈ {0} p ∈ {0} T[0..7] ∈ {0} [eva] Recording results for f2 [eva] done for function f2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function f2: j ∈ {3} a ∈ {1} b ∈ {2} p ∈ {{ &a }} c_0 ∈ {0} [from] Computing for function f2 [from] Done for function f2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f2: j FROM \nothing a FROM \nothing b FROM \nothing p FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function f2: j; a; b; p; c_0 [inout] Inputs for function f2: p frama-c-20.0-Calcium/tests/value/oracle/video_detect.res.oracle0000666000000000000000000000322013571573400021350 0ustar [kernel] Parsing tests/value/video_detect.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization NULL[rbits 256 to 287] ∈ [--..--] G ∈ {0} [eva] computing for function detect_video <- main. Called from tests/value/video_detect.i:36. [eva] Recording results for detect_video [eva] Done for function detect_video [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function detect_video: NULL[rbits 256 to 287] ∈ [--..--] p ∈ {32} saved1 ∈ [--..--] saved2 ∈ [--..--] video_found ∈ {0} [eva:final-states] Values at end of function main: NULL[rbits 256 to 287] ∈ [--..--] ADDR ∈ {32} [from] Computing for function detect_video [from] Done for function detect_video [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function detect_video: NULL[32..33] FROM NULL[32..33]; video_base [34..35] FROM NULL[34..35]; video_base \result FROM video_base [from] Function main: NULL[32..33] FROM NULL[32..33] [34..35] FROM NULL[34..35] \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function detect_video: NULL[32..35]; p; saved1; saved2; video_found [inout] Inputs for function detect_video: NULL[32..35] [inout] Out (internal) for function main: NULL[32..35]; ADDR; tmp [inout] Inputs for function main: NULL[32..35] frama-c-20.0-Calcium/tests/value/oracle/volatile.res.oracle0000666000000000000000000004720613571573400020545 0ustar [kernel] Parsing tests/value/volatile.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] F ∈ [--..--] E ∈ [--..--] X ∈ [--..--] Y ∈ [--..--] pV ∈ {0} k ∈ {1} x ∈ {2} y ∈ {3} a ∈ {0} b ∈ {0} c ∈ {0} d ∈ {0} e ∈ {0} f ∈ {0} g ∈ {0} h ∈ {0} i ∈ {0} j ∈ {0} l ∈ {0} m ∈ {0} n ∈ {0} o ∈ {0} pv ∈ {0} s1.a ∈ {0} .b ∈ [--..--] s2.a ∈ {1} .b ∈ [--..--] sv1 ∈ [--..--] sv2 ∈ [--..--] sv3.a ∈ {3} .b ∈ [--..--] sv4.a ∈ {4} .b ∈ [--..--] nested.__anonCompField1.a ∈ {1} {.__anonCompField1.b; .__anonCompField2; .t[0..11]} ∈ [--..--] .e ∈ {0} .[bits 240 to 255] ∈ {0} or UNINITIALIZED R1 ∈ {0} R2 ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/volatile.c:176. [eva] computing for function fn1 <- main1 <- main. Called from tests/value/volatile.c:39. [eva] tests/value/volatile.c:24: Frama_C_show_each_1: [-2147483648..2147483647] [eva] tests/value/volatile.c:25: Frama_C_show_each_2: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:26: Warning: signed overflow. assert -2147483648 ≤ x_0 + y_0; [eva:alarm] tests/value/volatile.c:26: Warning: signed overflow. assert x_0 + y_0 ≤ 2147483647; [eva] Recording results for fn1 [eva] Done for function fn1 [eva] computing for function fn2 <- main1 <- main. Called from tests/value/volatile.c:40. [kernel:annot:missing-spec] tests/value/volatile.c:40: Warning: Neither code nor specification for function fn2, generating default assigns from the prototype [eva] using specification for function fn2 [eva] Done for function fn2 [eva] tests/value/volatile.c:41: Frama_C_show_each_d: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:52: Warning: signed overflow. assert -2147483648 ≤ b - c; [eva:alarm] tests/value/volatile.c:52: Warning: signed overflow. assert b - c ≤ 2147483647; [eva:alarm] tests/value/volatile.c:53: Warning: signed overflow. assert -2147483648 ≤ F - F; [eva:alarm] tests/value/volatile.c:53: Warning: signed overflow. assert F - F ≤ 2147483647; [eva:alarm] tests/value/volatile.c:55: Warning: signed overflow. assert -2147483648 ≤ F - g; [eva:alarm] tests/value/volatile.c:55: Warning: signed overflow. assert F - g ≤ 2147483647; [eva:alarm] tests/value/volatile.c:56: Warning: signed overflow. assert F + 1 ≤ 2147483647; [eva:alarm] tests/value/volatile.c:57: Warning: signed overflow. assert 2 + F ≤ 2147483647; [eva:alarm] tests/value/volatile.c:58: Warning: signed overflow. assert -2147483648 ≤ F - l; [eva:alarm] tests/value/volatile.c:58: Warning: signed overflow. assert F - l ≤ 2147483647; [eva:alarm] tests/value/volatile.c:59: Warning: signed overflow. assert -2147483648 ≤ m - l; [eva:alarm] tests/value/volatile.c:59: Warning: signed overflow. assert m - l ≤ 2147483647; [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/volatile.c:177. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/volatile.c:178. [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert v < 1; [eva] tests/value/volatile.c:118: Frama_C_show_each_v: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert 0 ≤ (int)(v + 1); [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert (int)(v + 1) < 1; [eva:alarm] tests/value/volatile.c:118: Warning: signed overflow. assert v + 1 ≤ 2147483647; [eva] tests/value/volatile.c:118: Frama_C_show_each_v_plus: [-2147483647..2147483647] [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert v < 2; [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert a_0[v] < 1; [eva] tests/value/volatile.c:118: Frama_C_show_each_a: {0; 1} [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert v < 2; [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert 0 ≤ (int)(a_0[v] - 1); [eva] tests/value/volatile.c:118: Frama_C_show_each_a_minus: {-1; 0} [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert 0 ≤ v; [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert v < 2; [eva:alarm] tests/value/volatile.c:118: Warning: accessing out of bounds index. assert a_0[v] < 1; [eva] tests/value/volatile.c:118: Frama_C_show_each_av: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:119: Warning: assertion 'NORED' got status unknown. [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert 0 ≤ *v_ptr; [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert *v_ptr < 1; [eva] tests/value/volatile.c:123: Frama_C_show_each_v: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert 0 ≤ (int)(*v_ptr + 1); [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert (int)(*v_ptr + 1) < 1; [eva:alarm] tests/value/volatile.c:123: Warning: signed overflow. assert *v_ptr + 1 ≤ 2147483647; [eva] tests/value/volatile.c:123: Frama_C_show_each_v_plus: [-2147483647..2147483647] [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert 0 ≤ *v_ptr; [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert *v_ptr < 2; [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert a_0[*v_ptr] < 1; [eva] tests/value/volatile.c:123: Frama_C_show_each_a: {0; 1} [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert 0 ≤ *v_ptr; [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert *v_ptr < 2; [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert 0 ≤ (int)(a_0[*v_ptr] - 1); [eva] tests/value/volatile.c:123: Frama_C_show_each_a_minus: {-1; 0} [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert 0 ≤ *v_ptr; [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert *v_ptr < 2; [eva:alarm] tests/value/volatile.c:123: Warning: accessing out of bounds index. assert a_0[*v_ptr] < 1; [eva] tests/value/volatile.c:123: Frama_C_show_each_av: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:124: Warning: assertion 'NORED' got status unknown. [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert 0 ≤ svol.f[0]; [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert svol.f[0] < 1; [eva] tests/value/volatile.c:131: Frama_C_show_each_v: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert 0 ≤ (int)(svol.f[0] + 1); [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert (int)(svol.f[0] + 1) < 1; [eva:alarm] tests/value/volatile.c:131: Warning: signed overflow. assert svol.f[0] + 1 ≤ 2147483647; [eva] tests/value/volatile.c:131: Frama_C_show_each_v_plus: [-2147483647..2147483647] [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert 0 ≤ svol.f[0]; [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert svol.f[0] < 2; [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert a_0[svol.f[0]] < 1; [eva] tests/value/volatile.c:131: Frama_C_show_each_a: {0; 1} [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert 0 ≤ svol.f[0]; [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert svol.f[0] < 2; [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert 0 ≤ (int)(a_0[svol.f[0]] - 1); [eva] tests/value/volatile.c:131: Frama_C_show_each_a_minus: {-1; 0} [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert 0 ≤ svol.f[0]; [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert svol.f[0] < 2; [eva:alarm] tests/value/volatile.c:131: Warning: accessing out of bounds index. assert a_0[svol.f[0]] < 1; [eva] tests/value/volatile.c:131: Frama_C_show_each_av: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:132: Warning: assertion 'NORED' got status unknown. [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert 0 ≤ svol_ptr->f[0]; [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert svol_ptr->f[0] < 1; [eva] tests/value/volatile.c:136: Frama_C_show_each_v: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert 0 ≤ (int)(svol_ptr->f[0] + 1); [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert (int)(svol_ptr->f[0] + 1) < 1; [eva:alarm] tests/value/volatile.c:136: Warning: signed overflow. assert svol_ptr->f[0] + 1 ≤ 2147483647; [eva] tests/value/volatile.c:136: Frama_C_show_each_v_plus: [-2147483647..2147483647] [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert 0 ≤ svol_ptr->f[0]; [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert svol_ptr->f[0] < 2; [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert a_0[svol_ptr->f[0]] < 1; [eva] tests/value/volatile.c:136: Frama_C_show_each_a: {0; 1} [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert 0 ≤ svol_ptr->f[0]; [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert svol_ptr->f[0] < 2; [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert 0 ≤ (int)(a_0[svol_ptr->f[0]] - 1); [eva] tests/value/volatile.c:136: Frama_C_show_each_a_minus: {-1; 0} [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert 0 ≤ svol_ptr->f[0]; [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert svol_ptr->f[0] < 2; [eva:alarm] tests/value/volatile.c:136: Warning: accessing out of bounds index. assert a_0[svol_ptr->f[0]] < 1; [eva] tests/value/volatile.c:136: Frama_C_show_each_av: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:137: Warning: assertion 'NORED' got status unknown. [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert 0 ≤ sdeepvol.g[0]; [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert sdeepvol.g[0] < 1; [eva] tests/value/volatile.c:144: Frama_C_show_each_v: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert 0 ≤ (int)(sdeepvol.g[0] + 1); [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert (int)(sdeepvol.g[0] + 1) < 1; [eva:alarm] tests/value/volatile.c:144: Warning: signed overflow. assert sdeepvol.g[0] + 1 ≤ 2147483647; [eva] tests/value/volatile.c:144: Frama_C_show_each_v_plus: [-2147483647..2147483647] [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert 0 ≤ sdeepvol.g[0]; [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert sdeepvol.g[0] < 2; [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert a_0[sdeepvol.g[0]] < 1; [eva] tests/value/volatile.c:144: Frama_C_show_each_a: {0; 1} [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert 0 ≤ sdeepvol.g[0]; [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert sdeepvol.g[0] < 2; [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert 0 ≤ (int)(a_0[sdeepvol.g[0]] - 1); [eva] tests/value/volatile.c:144: Frama_C_show_each_a_minus: {-1; 0} [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert 0 ≤ sdeepvol.g[0]; [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert sdeepvol.g[0] < 2; [eva:alarm] tests/value/volatile.c:144: Warning: accessing out of bounds index. assert a_0[sdeepvol.g[0]] < 1; [eva] tests/value/volatile.c:144: Frama_C_show_each_av: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:145: Warning: assertion 'NORED' got status unknown. [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert 0 ≤ volt[0].f[0]; [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert volt[0].f[0] < 1; [eva] tests/value/volatile.c:149: Frama_C_show_each_v: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert 0 ≤ (int)(volt[0].f[0] + 1); [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert (int)(volt[0].f[0] + 1) < 1; [eva:alarm] tests/value/volatile.c:149: Warning: signed overflow. assert volt[0].f[0] + 1 ≤ 2147483647; [eva] tests/value/volatile.c:149: Frama_C_show_each_v_plus: [-2147483647..2147483647] [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert 0 ≤ volt[0].f[0]; [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert volt[0].f[0] < 2; [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert a_0[volt[0].f[0]] < 1; [eva] tests/value/volatile.c:149: Frama_C_show_each_a: {0; 1} [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert 0 ≤ volt[0].f[0]; [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert volt[0].f[0] < 2; [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert 0 ≤ (int)(a_0[volt[0].f[0]] - 1); [eva] tests/value/volatile.c:149: Frama_C_show_each_a_minus: {-1; 0} [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert 0 ≤ volt[0].f[0]; [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert volt[0].f[0] < 2; [eva:alarm] tests/value/volatile.c:149: Warning: accessing out of bounds index. assert a_0[volt[0].f[0]] < 1; [eva] tests/value/volatile.c:149: Frama_C_show_each_av: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:150: Warning: assertion 'NORED' got status unknown. [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert 0 ≤ deepvolt[0].g[0]; [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert deepvolt[0].g[0] < 1; [eva] tests/value/volatile.c:154: Frama_C_show_each_v: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert 0 ≤ (int)(deepvolt[0].g[0] + 1); [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert (int)(deepvolt[0].g[0] + 1) < 1; [eva:alarm] tests/value/volatile.c:154: Warning: signed overflow. assert deepvolt[0].g[0] + 1 ≤ 2147483647; [eva] tests/value/volatile.c:154: Frama_C_show_each_v_plus: [-2147483647..2147483647] [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert 0 ≤ deepvolt[0].g[0]; [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert deepvolt[0].g[0] < 2; [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert a_0[deepvolt[0].g[0]] < 1; [eva] tests/value/volatile.c:154: Frama_C_show_each_a: {0; 1} [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert 0 ≤ deepvolt[0].g[0]; [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert deepvolt[0].g[0] < 2; [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert 0 ≤ (int)(a_0[deepvolt[0].g[0]] - 1); [eva] tests/value/volatile.c:154: Frama_C_show_each_a_minus: {-1; 0} [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert 0 ≤ deepvolt[0].g[0]; [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert deepvolt[0].g[0] < 2; [eva:alarm] tests/value/volatile.c:154: Warning: accessing out of bounds index. assert a_0[deepvolt[0].g[0]] < 1; [eva] tests/value/volatile.c:154: Frama_C_show_each_av: [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:155: Warning: assertion 'NORED' got status unknown. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/volatile.c:179. [eva:alarm] tests/value/volatile.c:162: Warning: accessing uninitialized left-value. assert \initialized(&v1); [eva] tests/value/volatile.c:165: Frama_C_show_each_int_volatile: [-2147483648..2147483647], [-2147483648..2147483647] [eva:alarm] tests/value/volatile.c:167: Warning: accessing uninitialized left-value. assert \initialized(&p1); [eva] tests/value/volatile.c:168: Frama_C_show_each_ptr: [0..4294967295] [eva] tests/value/volatile.c:172: Frama_C_show_each_ptr_volatile: {{ &x_0 + [--..--] }}, {{ &x_0 + [--..--] }} [eva] Recording results for main4 [eva] Done for function main4 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function fn1: __retres ∈ [--..--] [eva:final-states] Values at end of function main1: G ∈ [--..--] E ∈ [--..--] X ∈ {2} Y ∈ [--..--] pV ∈ {{ &Y }} k ∈ [--..--] x ∈ {2} y ∈ [--..--] a ∈ {11; 12} b ∈ [--..--] c ∈ [--..--] d ∈ [--..--] e ∈ [--..--] f ∈ [--..--] g ∈ [--..--] h ∈ {1} l ∈ [-2147483647..2147483647] m ∈ [-2147483646..2147483647] n ∈ [--..--] o ∈ [--..--] pv ∈ {{ &X }} R1 ∈ [--..--] R2 ∈ [--..--] [eva:final-states] Values at end of function main2: k ∈ {{ NULL ; (int)&X }} p1 ∈ {{ NULL + [--..--] ; &X + [--..--] }} p2 ∈ {{ &X + [--..--] }} p3 ∈ {{ NULL + [--..--] ; &X + [--..--] }} __retres ∈ {{ NULL ; &X }} [eva:final-states] Values at end of function main3: t[0] ∈ {0} a_0[0] ∈ {0} [1] ∈ {1} v ∈ [--..--] v_ptr ∈ {{ &v }} svol ∈ [--..--] svol_ptr ∈ {{ &svol }} sdeepvol ∈ [--..--] volt[0] ∈ [--..--] deepvolt[0] ∈ [--..--] [eva:final-states] Values at end of function main4: x_0 ∈ [--..--] v2 ∈ [--..--] p1 ∈ {{ &x_0 + [--..--] }} q ∈ [--..--] p2 ∈ {{ &x_0 + [--..--] }} [eva:final-states] Values at end of function main: G ∈ [--..--] E ∈ [--..--] X ∈ {2} Y ∈ [--..--] pV ∈ {{ &Y }} k ∈ {{ NULL ; (int)&X }} x ∈ {2} y ∈ [--..--] a ∈ {11; 12} b ∈ [--..--] c ∈ [--..--] d ∈ [--..--] e ∈ [--..--] f ∈ [--..--] g ∈ [--..--] h ∈ {1} l ∈ [-2147483647..2147483647] m ∈ [-2147483646..2147483647] n ∈ [--..--] o ∈ [--..--] pv ∈ {{ &X }} R1 ∈ [--..--] R2 ∈ [--..--] frama-c-20.0-Calcium/tests/value/oracle/volatile2.res.oracle0000666000000000000000000002251713571573400020625 0ustar [kernel] Parsing tests/value/volatile2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization t[0..9] ∈ [--..--] u ∈ [--..--] pu ∈ {{ &u }} s ∈ {0} ps ∈ {{ &s }} v ∈ [--..--] BITF ∈ [--..--] S9 ∈ [--..--] u9[0..9] ∈ [--..--] [eva] computing for function main1 <- main. Called from tests/value/volatile2.i:136. [eva:alarm] tests/value/volatile2.i:23: Warning: signed overflow. assert (int)c << 8 ≤ 32767; [eva:alarm] tests/value/volatile2.i:24: Warning: signed overflow. assert (int)*p << 8 ≤ 32767; [eva:alarm] tests/value/volatile2.i:25: Warning: signed overflow. assert (int)t[1] << 8 ≤ 32767; [eva:alarm] tests/value/volatile2.i:26: Warning: signed overflow. assert (int)u.f1 << 8 ≤ 32767; [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/volatile2.i:137. [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/volatile2.i:138. [eva:alarm] tests/value/volatile2.i:47: Warning: assertion got status invalid (stopping propagation). [eva] tests/value/volatile2.i:52: assertion got status valid. [eva:alarm] tests/value/volatile2.i:55: Warning: assertion got status unknown. [eva:alarm] tests/value/volatile2.i:56: Warning: assertion got status unknown. [eva] tests/value/volatile2.i:59: assertion got status valid. [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/volatile2.i:139. [eva] Recording results for main4 [eva] Done for function main4 [eva] computing for function main5 <- main. Called from tests/value/volatile2.i:140. [eva:alarm] tests/value/volatile2.i:76: Warning: signed overflow. assert i + 1 ≤ 32767; [eva:alarm] tests/value/volatile2.i:76: Warning: signed overflow. assert j + 1 ≤ 32767; [eva:alarm] tests/value/volatile2.i:76: Warning: signed overflow. assert -32768 ≤ tmp + tmp_0; (tmp from i++, tmp_0 from j++) [eva:alarm] tests/value/volatile2.i:76: Warning: signed overflow. assert tmp + tmp_0 ≤ 32767; (tmp from i++, tmp_0 from j++) [eva:alarm] tests/value/volatile2.i:78: Warning: signed overflow. assert i + 1 ≤ 32767; [eva:alarm] tests/value/volatile2.i:78: Warning: signed overflow. assert j + 1 ≤ 32767; [eva:alarm] tests/value/volatile2.i:78: Warning: signed overflow. assert -32768 ≤ i + j; [eva:alarm] tests/value/volatile2.i:78: Warning: signed overflow. assert i + j ≤ 32767; [eva] tests/value/volatile2.i:80: Frama_C_dump_each: # Cvalue domain: t[0..9] ∈ [--..--] u ∈ [--..--] pu ∈ {{ &u }} s ∈ {0} ps ∈ {{ &s }} v ∈ [--..--] i ∈ [--..--] j ∈ [--..--] k ∈ [--..--] tmp ∈ [--..--] tmp_0 ∈ [--..--] l ∈ [--..--] BITF ∈ [--..--] S9 ∈ [--..--] u9[0..9] ∈ [--..--] ==END OF DUMP== [eva] Recording results for main5 [eva] Done for function main5 [eva] computing for function main6 <- main. Called from tests/value/volatile2.i:141. [eva] Recording results for main6 [eva] Done for function main6 [eva] computing for function main7 <- main. Called from tests/value/volatile2.i:142. [eva] Recording results for main7 [eva] Done for function main7 [eva] computing for function main8 <- main. Called from tests/value/volatile2.i:143. [eva] tests/value/volatile2.i:119: Frama_C_show_each: [--..--], [--..--], [--..--], [--..--], [--..--] [eva] Recording results for main8 [eva] Done for function main8 [eva] computing for function main9 <- main. Called from tests/value/volatile2.i:144. [eva:alarm] tests/value/volatile2.i:129: Warning: accessing out of bounds index. assert 0 ≤ S9.i1; [eva:alarm] tests/value/volatile2.i:129: Warning: accessing out of bounds index. assert S9.i1 < 10; [eva:alarm] tests/value/volatile2.i:130: Warning: accessing out of bounds index. assert 0 ≤ S9.i1; [eva:alarm] tests/value/volatile2.i:130: Warning: accessing out of bounds index. assert S9.i1 < 10; [eva:alarm] tests/value/volatile2.i:131: Warning: accessing out of bounds index. assert 0 ≤ u9[1]; [eva:alarm] tests/value/volatile2.i:131: Warning: accessing out of bounds index. assert u9[1] < 10; [eva:alarm] tests/value/volatile2.i:132: Warning: accessing out of bounds index. assert 0 ≤ u9[1]; [eva:alarm] tests/value/volatile2.i:132: Warning: accessing out of bounds index. assert u9[1] < 10; [eva] Recording results for main9 [eva] Done for function main9 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: c ∈ [--..--] x ∈ {1} p ∈ {{ (unsigned char volatile *)&x }} i ∈ [0..32767] j ∈ [0..32767] k ∈ [0..32767] l ∈ [0..32767] [eva:final-states] Values at end of function main2: i ∈ [-128..127] j ∈ [0..255] k ∈ [0..255] [eva:final-states] Values at end of function main3: [eva:final-states] Values at end of function main4: p1 ∈ {{ &i }} p2 ∈ {{ &i + [--..--] }} [eva:final-states] Values at end of function main5: i ∈ [--..--] j ∈ [--..--] k ∈ [--..--] l ∈ [--..--] [eva:final-states] Values at end of function main6: i ∈ {1} j ∈ {1} [eva:final-states] Values at end of function main7: i ∈ {-3; -2; -1; 0; 1; 2; 3; 4} k ∈ [1..16] [eva:final-states] Values at end of function main8: a ∈ [--..--] b ∈ [--..--] c ∈ [--..--] d ∈ [--..--] e ∈ [--..--] [eva:final-states] Values at end of function main9: t9[0..9] ∈ {1; 2; 3; 4} or UNINITIALIZED [eva:final-states] Values at end of function main: /* Generated by Frama-C */ struct u { unsigned char f1 ; unsigned char f2 ; }; struct s { char i1 ; char i2 ; }; struct bitf { int i : 3 ; unsigned int j : 4 ; }; struct __anonstruct_S_1 { int field ; }; typedef struct __anonstruct_S_1 S; typedef S volatile vS; struct __anonstruct_vS2_2 { int field ; }; typedef struct __anonstruct_vS2_2 volatile vS2; union __anonunion_U_3 { int field ; }; typedef union __anonunion_U_3 U; typedef U volatile vU; struct __anonstruct_S9_4 { int volatile i1 ; int i2 ; }; unsigned char volatile t[10]; struct u volatile u; struct u *pu = (struct u *)(& u); void main1(void) { unsigned char volatile c = (unsigned char)1; int x = 1; unsigned char volatile *p = (unsigned char volatile *)(& x); /*@ assert Eva: signed_overflow: (int)c << 8 ≤ 32767; */ unsigned int i = (unsigned int)(((int)c << 8) + (int)c); /*@ assert Eva: signed_overflow: (int)*p << 8 ≤ 32767; */ unsigned int j = (unsigned int)(((int)*p << 8) + (int)*p); /*@ assert Eva: signed_overflow: (int)t[1] << 8 ≤ 32767; */ unsigned int k = (unsigned int)(((int)t[1] << 8) + (int)t[2]); /*@ assert Eva: signed_overflow: (int)u.f1 << 8 ≤ 32767; */ unsigned int l = (unsigned int)(((int)u.f1 << 8) + (int)u.f2); return; } struct s s; struct s volatile *ps = (struct s volatile *)(& s); void main2(void) { int i = (int)ps->i1; int j = (int)u.f1; int k = (int)t[1]; return; } int volatile v; void main3(void) { if (v) /*@ assert \false; */ ; if (v) /*@ assert \true; */ ; /*@ assert v ≡ 0; */ ; /*@ assert v ≡ 0; */ ; if (v) /*@ assert \true; */ ; return; } void main4(void) { int volatile i; int volatile *p1 = & i; int volatile * volatile p2 = & i; return; } /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_dump_each)(); void main5(void) { int tmp; int tmp_0; int volatile i = 0; int volatile j = 0; tmp = i; /*@ assert Eva: signed_overflow: i + 1 ≤ 32767; */ i ++; tmp_0 = j; /*@ assert Eva: signed_overflow: j + 1 ≤ 32767; */ j ++; /*@ assert Eva: signed_overflow: -32768 ≤ tmp + tmp_0; */ /*@ assert Eva: signed_overflow: tmp + tmp_0 ≤ 32767; */ int k = tmp + tmp_0; /*@ assert Eva: signed_overflow: i + 1 ≤ 32767; */ i ++; /*@ assert Eva: signed_overflow: j + 1 ≤ 32767; */ j ++; /*@ assert Eva: signed_overflow: -32768 ≤ i + j; */ /*@ assert Eva: signed_overflow: i + j ≤ 32767; */ int l = i + j; Frama_C_dump_each(); return; } void main6(void) { int i = 1; int j = i; return; } struct bitf volatile BITF; void main7(void) { int i = (int)BITF.i + 1; int k = (int)BITF.j + 1; return; } /*@ assigns \result; assigns \result \from \nothing; */ extern int ( /* missing proto */ Frama_C_show_each)(); void main8(void) { S volatile a = {.field = 0}; vS b = {.field = 0}; vS2 c = {.field = 0}; U volatile d = {.field = 0}; vU e = {.field = 0}; Frama_C_show_each(a,b,c,d,e); return; } extern struct __anonstruct_S9_4 S9; int volatile u9[10]; void main9(void) { int t9[10]; /*@ assert Eva: index_bound: 0 ≤ S9.i1; */ /*@ assert Eva: index_bound: S9.i1 < 10; */ t9[S9.i1] = 1; /*@ assert Eva: index_bound: 0 ≤ S9.i1; */ /*@ assert Eva: index_bound: S9.i1 < 10; */ t9[S9.i1] = 2; /*@ assert Eva: index_bound: 0 ≤ u9[1]; */ /*@ assert Eva: index_bound: u9[1] < 10; */ t9[u9[1]] = 3; /*@ assert Eva: index_bound: 0 ≤ u9[1]; */ /*@ assert Eva: index_bound: u9[1] < 10; */ t9[u9[1]] = 4; return; } void main(void) { main1(); main2(); main3(); main4(); main5(); main6(); main7(); main8(); main9(); return; } frama-c-20.0-Calcium/tests/value/oracle/volatilestruct.res.oracle0000666000000000000000000000607113571573400022005 0ustar [kernel] Parsing tests/value/volatilestruct.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} s2 ∈ {0} x ∈ {0} y ∈ {0} [eva:alarm] tests/value/volatilestruct.c:33: Warning: signed overflow. assert -2147483648 ≤ &x - p->f4.f1; [eva:alarm] tests/value/volatilestruct.c:33: Warning: signed overflow. assert &x - p->f4.f1 ≤ 2147483647; [eva:alarm] tests/value/volatilestruct.c:33: Warning: signed overflow. assert (int)(&x - p->f4.f1) + 1 ≤ 2147483647; [eva:alarm] tests/value/volatilestruct.c:34: Warning: signed overflow. assert -2147483648 ≤ &y - p->f4.f2; [eva:alarm] tests/value/volatilestruct.c:34: Warning: signed overflow. assert &y - p->f4.f2 ≤ 2147483647; [eva:alarm] tests/value/volatilestruct.c:34: Warning: signed overflow. assert (int)(&y - p->f4.f2) + 3 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &s2 }} s2.f4.f1 ∈ {{ &x + [--..--] }} .f4.f2 ∈ {{ &y + [--..--] }} {.f4.f3; .f5} ∈ {0} q1 ∈ {{ &x + [--..--] }} q2 ∈ {{ &y + [--..--] }} i ∈ [--..--] j ∈ {{ &y + [--..--] }} r ∈ [-2147483647..2147483647] s ∈ [-2147483645..2147483647] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM \nothing s2.f4{.f1; .f2} FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; s2.f4{.f1; .f2}; q1; q2; i; j; r; s [inout] Inputs for function main: p; s2{.f4{.f1; .f2}; .f5} [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization p ∈ {0} s2 ∈ {0} x ∈ {0} y ∈ {0} [eva:signed-overflow] tests/value/volatilestruct.c:33: Warning: 2's complement assumed for overflow [eva:signed-overflow] tests/value/volatilestruct.c:34: Warning: 2's complement assumed for overflow [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ &s2 }} s2.f4.f1 ∈ {{ &x + [--..--] }} .f4.f2 ∈ {{ &y + [--..--] }} {.f4.f3; .f5} ∈ {0} q1 ∈ {{ &x + [--..--] }} q2 ∈ {{ &y + [--..--] }} i ∈ [--..--] j ∈ {{ &y + [--..--] }} r ∈ [--..--] s ∈ [--..--] [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: p FROM \nothing s2.f4{.f1; .f2} FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; s2.f4{.f1; .f2}; q1; q2; i; j; r; s [inout] Inputs for function main: p; s2{.f4{.f1; .f2}; .f5} frama-c-20.0-Calcium/tests/value/oracle/wide_string.res.oracle0000666000000000000000000000254613571573400021242 0ustar [kernel] Parsing tests/value/wide_string.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva:alarm] tests/value/wide_string.c:16: Warning: accessing out of bounds index. assert 4 < 4; [eva:alarm] tests/value/wide_string.c:19: Warning: accessing out of bounds index. assert 4 < 4; [eva] Recording results for main [eva] done for function main [eva] tests/value/wide_string.c:16: assertion 'Eva,index_bound' got final status invalid. [eva] tests/value/wide_string.c:19: assertion 'Eva,index_bound' got final status invalid. [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: p ∈ {{ "bar" }} q ∈ {{ L"foO" }} __retres ∈ {0} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM "bar"{[bits 8 to 15]; [bits 24 to 31]}; L"foO"{[bits 32 to 63]; [bits 96 to 127]} [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: p; q; c; wc; __retres [inout] Inputs for function main: "bar"{[bits 8 to 15]; [bits 24 to 31]}; L"foO"{[bits 32 to 63]; [bits 96 to 127]} frama-c-20.0-Calcium/tests/value/oracle/widen_non_constant.res.oracle0000666000000000000000000001467113571573400022617 0ustar [kernel] Parsing tests/value/widen_non_constant.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization N ∈ {24} A[0..23] ∈ [--..--] B[0..25] ∈ [--..--] C[0..23] ∈ [--..--] t[0..19] ∈ {0} u[0..39] ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/widen_non_constant.i:84. [eva] tests/value/widen_non_constant.i:11: Frama_C_show_each_out: {0} [eva] tests/value/widen_non_constant.i:13: Frama_C_show_each_in: {0}, {1} [eva] tests/value/widen_non_constant.i:12: starting to merge loop iterations [eva] tests/value/widen_non_constant.i:13: Frama_C_show_each_in: {0}, {1; 2} [eva] tests/value/widen_non_constant.i:13: Frama_C_show_each_in: {0}, {1; 2; 3} [eva] tests/value/widen_non_constant.i:13: Frama_C_show_each_in: {0}, [1..23] [eva] tests/value/widen_non_constant.i:10: starting to merge loop iterations [eva] tests/value/widen_non_constant.i:11: Frama_C_show_each_out: {0; 1} [eva] tests/value/widen_non_constant.i:13: Frama_C_show_each_in: {0; 1}, [1..23] [eva] tests/value/widen_non_constant.i:11: Frama_C_show_each_out: {0; 1; 2} [eva] tests/value/widen_non_constant.i:13: Frama_C_show_each_in: {0; 1; 2}, [1..23] [eva] tests/value/widen_non_constant.i:11: Frama_C_show_each_out: [0..22] [eva] tests/value/widen_non_constant.i:13: Frama_C_show_each_in: [0..22], [1..23] [eva] Recording results for main1 [eva] Done for function main1 [eva] computing for function main2 <- main. Called from tests/value/widen_non_constant.i:85. [eva] tests/value/widen_non_constant.i:27: Frama_C_show_each_out: {0} [eva] tests/value/widen_non_constant.i:29: Frama_C_show_each_in: {0}, {1} [eva] tests/value/widen_non_constant.i:28: starting to merge loop iterations [eva] tests/value/widen_non_constant.i:29: Frama_C_show_each_in: {0}, {1; 2} [eva] tests/value/widen_non_constant.i:29: Frama_C_show_each_in: {0}, {1; 2; 3} [eva] tests/value/widen_non_constant.i:29: Frama_C_show_each_in: {0}, [1..23] [eva] tests/value/widen_non_constant.i:26: starting to merge loop iterations [eva] tests/value/widen_non_constant.i:27: Frama_C_show_each_out: {0; 1} [eva] tests/value/widen_non_constant.i:29: Frama_C_show_each_in: {0; 1}, [1..23] [eva] tests/value/widen_non_constant.i:27: Frama_C_show_each_out: {0; 1; 2} [eva] tests/value/widen_non_constant.i:29: Frama_C_show_each_in: {0; 1; 2}, [1..23] [eva] tests/value/widen_non_constant.i:27: Frama_C_show_each_out: [0..22] [eva] tests/value/widen_non_constant.i:29: Frama_C_show_each_in: [0..22], [1..23] [eva] Recording results for main2 [eva] Done for function main2 [eva] computing for function main3 <- main. Called from tests/value/widen_non_constant.i:86. [eva] tests/value/widen_non_constant.i:46: Frama_C_show_each_out: {0} [eva] tests/value/widen_non_constant.i:48: Frama_C_show_each_in: {0}, {1} [eva] tests/value/widen_non_constant.i:47: starting to merge loop iterations [eva] tests/value/widen_non_constant.i:48: Frama_C_show_each_in: {0}, {1; 2} [eva] tests/value/widen_non_constant.i:48: Frama_C_show_each_in: {0}, {1; 2; 3} [eva] tests/value/widen_non_constant.i:48: Frama_C_show_each_in: {0}, [1..23] [eva] tests/value/widen_non_constant.i:45: starting to merge loop iterations [eva] tests/value/widen_non_constant.i:46: Frama_C_show_each_out: {0; 1} [eva] tests/value/widen_non_constant.i:48: Frama_C_show_each_in: {0; 1}, [1..23] [eva] tests/value/widen_non_constant.i:46: Frama_C_show_each_out: {0; 1; 2} [eva] tests/value/widen_non_constant.i:48: Frama_C_show_each_in: {0; 1; 2}, [1..23] [eva] tests/value/widen_non_constant.i:46: Frama_C_show_each_out: [0..22] [eva] tests/value/widen_non_constant.i:48: Frama_C_show_each_in: [0..22], [1..23] [eva] Recording results for main3 [eva] Done for function main3 [eva] computing for function main4 <- main. Called from tests/value/widen_non_constant.i:87. [eva] tests/value/widen_non_constant.i:63: starting to merge loop iterations [eva] tests/value/widen_non_constant.i:69: starting to merge loop iterations [eva] tests/value/widen_non_constant.i:72: Frama_C_show_each: {43} [eva] tests/value/widen_non_constant.i:75: starting to merge loop iterations [eva] tests/value/widen_non_constant.i:78: Frama_C_show_each: {35; 36; 37; 38; 39; 40; 41; 42} [eva] Recording results for main4 [eva] Done for function main4 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: i ∈ {24} or UNINITIALIZED j ∈ {23} [eva:final-states] Values at end of function main2: i ∈ {24; 25} or UNINITIALIZED j ∈ {23; 24; 25} [eva:final-states] Values at end of function main3: i ∈ [24..2147483647] or UNINITIALIZED j ∈ [23..2147483647] p ∈ {{ &C[0] }} [eva:final-states] Values at end of function main4: t[0] ∈ {-1} [1..19] ∈ [0..18] u[0..39] ∈ [0..42] i ∈ {19} j ∈ {35; 36; 37; 38; 39; 40; 41; 42} maxi ∈ {19} maxj ∈ {35} [eva:final-states] Values at end of function main: t[0] ∈ {-1} [1..19] ∈ [0..18] u[0..39] ∈ [0..42] [from] Computing for function main1 [from] Done for function main1 [from] Computing for function main2 [from] Done for function main2 [from] Computing for function main3 [from] Done for function main3 [from] Computing for function main4 [from] Done for function main4 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: NO EFFECTS [from] Function main2: NO EFFECTS [from] Function main3: NO EFFECTS [from] Function main4: t[0] FROM \nothing [1..19] FROM \nothing (and SELF) u[0..39] FROM \nothing (and SELF) [from] Function main: t[0] FROM \nothing [1..19] FROM \nothing (and SELF) u[0..39] FROM \nothing (and SELF) [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: i; j [inout] Inputs for function main1: N; A[0..23] [inout] Out (internal) for function main2: i; j [inout] Inputs for function main2: N; B[0..23] [inout] Out (internal) for function main3: i; j; p [inout] Inputs for function main3: N; C[0..23] [inout] Out (internal) for function main4: t[0..19]; u[0..39]; i; j; maxi; maxj [inout] Inputs for function main4: \nothing [inout] Out (internal) for function main: t[0..19]; u[0..39] [inout] Inputs for function main: N; A[0..23]; B[0..23]; C[0..23] frama-c-20.0-Calcium/tests/value/oracle/widen_on_non_monotonic.res.oracle0000666000000000000000000000427713571573400023470 0ustar [kernel] Parsing tests/value/widen_on_non_monotonic.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/value/widen_on_non_monotonic.i:57: Warning: Calling undeclared function fn1. Old style K&R code? [kernel:typing:implicit-function-declaration] tests/value/widen_on_non_monotonic.i:58: Warning: Calling undeclared function fn2. Old style K&R code? [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization a ∈ {0} b ∈ {0} c ∈ {0} d ∈ {0} u ∈ {0} g ∈ {0} i ∈ {0} j ∈ {0} k ∈ {0} [eva] computing for function main1 <- main. Called from tests/value/widen_on_non_monotonic.i:71. [eva] tests/value/widen_on_non_monotonic.i:25: starting to merge loop iterations [eva] tests/value/widen_on_non_monotonic.i:23: starting to merge loop iterations [eva] tests/value/widen_on_non_monotonic.i:26: starting to merge loop iterations [eva:alarm] tests/value/widen_on_non_monotonic.i:27: Warning: signed overflow. assert -2147483648 ≤ b - 1; [eva] Recording results for main1 [eva] Done for function main1 [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main1: NON TERMINATING FUNCTION [eva:final-states] Values at end of function main: NON TERMINATING FUNCTION [from] Computing for function main1 [from] Non-terminating function main1 (no dependencies) [from] Done for function main1 [from] Computing for function main [from] Non-terminating function main (no dependencies) [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main1: NON TERMINATING - NO EFFECTS [from] Function main: NON TERMINATING - NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main1: a; b; c; d [inout] Inputs for function main1: a{.f0[bits 0 to 15]; .f1[bits 0 to 15]; .f3}; b; c; d [inout] Out (internal) for function main: a; b; c; d [inout] Inputs for function main: a{.f0[bits 0 to 15]; .f1[bits 0 to 15]; .f3}; b; c; d frama-c-20.0-Calcium/tests/value/oracle/widen_overflow.res.oracle0000666000000000000000000000306313571573400021750 0ustar [kernel] Parsing tests/value/widen_overflow.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/value/widen_overflow.i:9: Warning: Calling undeclared function u. Old style K&R code? [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/widen_overflow.i:6: Frama_C_show_each: {4} [eva] computing for function u <- main. Called from tests/value/widen_overflow.i:9. [kernel:annot:missing-spec] tests/value/widen_overflow.i:9: Warning: Neither code nor specification for function u, generating default assigns from the prototype [eva] using specification for function u [eva] Done for function u [eva] tests/value/widen_overflow.i:9: starting to merge loop iterations [eva] computing for function u <- main. Called from tests/value/widen_overflow.i:9. [eva] Done for function u [eva] computing for function u <- main. Called from tests/value/widen_overflow.i:9. [eva] Done for function u [eva] computing for function u <- main. Called from tests/value/widen_overflow.i:9. [eva] Done for function u [eva] computing for function u <- main. Called from tests/value/widen_overflow.i:9. [eva] Done for function u [eva] computing for function u <- main. Called from tests/value/widen_overflow.i:9. [eva] Done for function u [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: i ∈ [0..4294967294],0%2 __retres ∈ {0} frama-c-20.0-Calcium/tests/value/oracle/with_comment.res.oracle0000666000000000000000000000176213571573400021420 0ustar [kernel] Parsing tests/value/with_comment.i (no preprocessing) [eva] Analyzing a complete application starting at main2 [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization HHH ∈ {0} G ∈ {0} [eva] tests/value/with_comment.i:20: starting to merge loop iterations [eva:alarm] tests/value/with_comment.i:21: Warning: signed overflow. assert G + 1 ≤ 2147483647; [eva] Recording results for main2 [eva] done for function main2 [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main2: i ∈ {11} G ∈ [0..2147483647] [from] Computing for function main2 [from] Done for function main2 [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main2: G FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main2: i; j; G [inout] Inputs for function main2: G frama-c-20.0-Calcium/tests/value/oracle/zerolengtharrays.res.oracle0000666000000000000000000000154313571573400022323 0ustar [kernel] Parsing tests/value/zerolengtharrays.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: T[bits 0 to 31] ∈ {4} [bits 32 to 63] ∈ {5} [8..99] ∈ UNINITIALIZED F ∈ {{ (struct foo *)&T }} [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: NO EFFECTS [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: T[0..7]; F [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/origin.i0000666000000000000000000000506513571573400015140 0ustar /* run.config* GCC: OPT: -no-autoload-plugins -load-module from,inout,eva @EVA_CONFIG@ -eva -eva-warn-copy-indeterminate=-origin_misalign_2,-main -main main -journal-disable -then -out -deps OPT: -no-autoload-plugins -load-module from,inout,eva @EVA_CONFIG@ -eva -eva-warn-copy-indeterminate=-origin_misalign_2,-origin -main origin -journal-disable -then -out -deps */ char f(void); int a, b, aa2, *p, *pa1, *pa2, *qa2, *pa3, *q; int t[12], tt[10], ta1[10], ta2[10], ta3[10], tta2[10]; void origin_arithmetic_1(void) { pa1 = (int*)(-(int)ta1); *pa1 = 0; } /************/ void origin_arithmetic_2(int c1) { pa2 = (int*)(-(int)ta2); qa2 = c1 ? pa2 : (int*)(-(int)tta2); *qa2 = (int) &aa2; } /************/ void origin_arithmetic_3(void) { pa3 = (int*)(-(int)ta3); *pa3 = 3; } int g(void); extern int *gpp; /*@ assigns \result \from gpp; */ int *gp(void); int l1, l2, l3, *pl; void origin_leaf_1 () { l1 = g(); } int * Tm1[2] ={&a, &b}; int * Tm2[2] ={&a, &b}; int * Tm3[2] ={&a, &b}; int * Tm4[2] ={&a, &b}; int *pm1, *pm2, *qm2; void origin_misalign_1(void) { pm1 = *(int**)(2 + (char *) Tm1); *pm1 = 1; } void origin_misalign_2(void) { pm2 = *(int**)(2 + (char *) Tm2); qm2 = pm2+1; Frama_C_show_each(qm2); *qm2 = (int)&a; } int *pun, *pun2, *qun2; void origin_uninitialized_1(int c1) { int i, * pi ; if (c1) pi = &a ; pun = pi; } void origin_uninitialized_2(int c1, int c2) { int i, * pi ; if (c1) pi = &a ; pun2 = pi; if (c2) qun2 = pun2 + i; } volatile int random; int esc1, esc2, esc3, esc4, esc5; void local_escape_1(int arg) { int local1, local2; esc1 = (int) &arg; esc2 = (int) &local1; esc3 = - (int) &arg; esc4 = random ? esc2 : 12; local2 = (int) &local1; esc5 = (int) &esc1; } void main(int c1, int c2) { origin_arithmetic_1(); origin_arithmetic_2(c1); origin_arithmetic_3(); origin_leaf_1 (); l2 = l1; l2 += g(); pl = gp(); l3 = *pl; origin_misalign_1(); origin_misalign_2(); p = *(int**)(2 + (char *) Tm3); q = c1 ? p : *(int**)(3 + (char *) Tm4); origin_uninitialized_1(c1); origin_uninitialized_2(c1, c2); local_escape_1(12); } /************************************/ int x, y; struct st { char c; short i; int *p, *t[2]; } v = { 1, 2, &x, &y}; struct st origin (int c0) { struct st r; int *q1, *q2; r.c = f() ; r.i = c0 ; r.p = *(int *) (&v.c + 3); q1 = *(int**)(2 + (char *) v.t); q2 = c0 ? q1 : *(int**)(3 + (char *) v.t); r.t[0] = q2 ; r.t[1] = (int *)(- (int)&x) ; return r; } /************************************/ frama-c-20.0-Calcium/tests/value/output_leafs.i0000666000000000000000000000071413571573400016357 0ustar int *H,G,K,L,M,N,P; /*@ assigns G \from G,*H; @ assigns *H \from P; @ assigns *x \from \empty; */ void crypt(int*x); void main1(int y) { H = &K; crypt(&L); } int a, b, c, d; //@ assigns *u \from *v; void g(int *v, const int *u); void g1() { g(&a,&b); } void g2() { g(&c,&d); } void main2 () { g1(); g2(); } void f(int* x); int main3 () { int x = 0; f(&x); return x; } void main(int y) { main1(y); main2(); main3(); } frama-c-20.0-Calcium/tests/value/overflow.i0000666000000000000000000000155413571573400015513 0ustar /* run.config* STDOPT: #"-warn-signed-overflow" STDOPT: #"-no-warn-signed-overflow" */ extern int printf (__const char *__restrict __format, ...); /* L'analyseur déborde et dit i=-1 */ int main (int c) { unsigned long long i = 0xFFFFFFFFFFFFFFFFULL; unsigned long j = 0xFFFFFFFFUL; long long is = 0xFFFFFFFFFFFFFFFFULL; long js = 0xFFFFFFFFUL; long minjs = - (j/2) -1 ; long maxjs = j/2 ; unsigned long long i1 = i+1; unsigned long j1 = j+1; int y = c?1:100000; int x = (60000 * y) / 100000; int z = y * 1000 * 1000; int t = (-y) * 10000000; /* printf("unsigned long long:%llu (+1:%llu)\nunsigned long:%lu (+1:%lu)\n" ,i,i1,j,j1); printf("signed long long:%lld (+1:%lld)\nlong:%ld (+1:%ld)\n" ,is,is+1,js,js+1); printf("min signed long:%ld (-1:%ld)\n" ,minjs,minjs-1L); */ if (-c) {} return 0; } frama-c-20.0-Calcium/tests/value/overflow_cast_float_int.i0000666000000000000000000000053313571573400020560 0ustar /* run.config* */ volatile v; int main() { float vf1; signed int e; unsigned int d; int c1, c2; d = 0x7FFFFFFFll; if (v) { vf1 = d * 1.0; e = (int)vf1; } c1 = 2147483647.5; if (v) { c2 = -2147483649.5; } double dd = v ? -0x1.967ae928d56b0p66 : -0x1.c5e2546cfeb1ap34; if (v) { double k = (int)dd; } } frama-c-20.0-Calcium/tests/value/packed.c0000666000000000000000000000044613571573400015070 0ustar typedef __attribute__((__packed__ (1,256,1))) struct { volatile char Reserved[4]; } T_HCCA; #define __packed__(...) __attribute__((__packed__(__VA_ARGS__))) typedef __packed__ (1,256,1) struct { volatile char Reserved[4]; } T_HCCB; T_HCCA x; T_HCCB y; void main() { } frama-c-20.0-Calcium/tests/value/partitioning-annots.c0000666000000000000000000000610513571573400017646 0ustar /* run.config* GCC: STDOPT: #"-main test_unroll -eva-default-loop-unroll 10" STDOPT: #"-main test_split" STDOPT: +"-main test_split -eva-partition-value k" STDOPT: #"-main test_loop_split -eva-partition-history 1" STDOPT: #"-main test_history -eva-partition-history 0" STDOPT: #"-main test_history -eva-partition-history 1" */ #include "__fc_builtin.h" #define N 10 void test_unroll() { int a[N], b[N], c[N], d[2*N], e[N]; // The inner loop needs to be unrolled to allow strong updates // The outer loops doesn't need to be unrolled //@ loop unroll N; for (int i = 0; i < N; i++) { //@ loop unroll 1; for (int j = 0; j < N; j++) { a[i] = 42; } } // This time the outer loop needs unrolling but not the inner loop //@ loop unroll 1; for (int i = 0; i < N; i++) { //@ loop unroll N; for (int j = 0; j < N; j++) { b[j] = 42; } } // At the end, we must have both arrays a and b to be fully initialized at 42 // Small loops can be unrolled without giving an unroll parameter //@ loop unroll N; for (int i = 0 ; i < N ; i++) c[i] = 0; // Longer loops won't be completely unrolled when not giving a parameter //@ loop unroll N; for (int i = 0 ; i < 2*N ; i++) d[i] = 0; // Variable unroll limits can be specified as long as they evaluate as // a singleton in each state //@ loop unroll N; for (int i = 0 ; i < N ; i++) { e[i] = 1; //@ loop unroll i-1; for (int j = i - 1 ; j > 0 ; j--) { e[j] += e[j-1]; } } } int k; void test_split() { int i = Frama_C_interval(0,1); int j = Frama_C_interval(0,2); // The splits are done on i and j and undone in the same order // If global dynamic split is done on k, since it is equaly to i, merge i will // have no effects. Frama_C_show_each_before_first_split(i,j,k); //@ split i; k = i; Frama_C_show_each_before_second_split(i,j,k); //@ split j; Frama_C_show_each_before_first_merge(i,j,k); //@ merge i; Frama_C_show_each_before_second_merge(i,j,k); //@ merge j; Frama_C_show_each_end(i,j,k); } void test_loop_split() { int A[N]; int i; // In this example we can split on the value of the loop index in order to // keep the relation between i and the value A[i] found in the array to be // equal to 42. // However, since the split is not dynamic, an history partitioning must be // added to distinguish between the two states that share i = 9 : those who // left the loop at the break point and those who left after the loop test. // Init a random array for (i = 0 ; i < N ; i ++) { A[i] = Frama_C_interval(0,100); } // Search for some value for (i = 0 ; i < N ; i++) { //@ split i; if (A[i] == 42) break; } if (i < N) { Frama_C_show_each(i, A[i]); //@ assert A[i] == 42; } else { Frama_C_show_each("Value 42 not found"); } } void test_history() { int i = Frama_C_interval(0,1); int j = 0, k = 1; if (i) j = 1; Frama_C_show_each(i, j); if (i) k = k / j; } void main(void) { test_unroll(); test_split(); test_loop_split(); } frama-c-20.0-Calcium/tests/value/pb.i0000666000000000000000000000003013571573400014235 0ustar void main () { f() ; } frama-c-20.0-Calcium/tests/value/period.c0000666000000000000000000000172613571573400015125 0ustar #define t Frama_C_periodic_t_320 int g[10] __attribute__ ((Frama_C_periodic)); // garbled typedef struct { short s1; short s2; short s3; } ts; int t[60]= {1}; int (u __attribute__ ((Frama_C_periodic)))[60]= {-1,-2,-3}; int v[3] __attribute__ ((Frama_C_periodic)) = {-1,-2,-3}; ts w[10] __attribute__ ((Frama_C_periodic)); int Au,Bu,Cu,Du,Eu,Fu,Gu = 12, Hu; int At,Bt,Ct,Dt,Et,Ft,Gt = 12, Ht; void main() { At = t[0]; Bt = t[11]; Ft = 2 * (t[20] + 1); t[13] = Ft; Ct = t[2]; t[41] = 3 * Ft; Et = t[12]; t[4] = 2 * Gt; Ht = 2 * t[25] + 1; Au = u[0]; Bu = u[11]; Fu = 2 * (u[22] + 1); u[13] = Fu; Cu = u[2]; u[41] = 3 * Fu; Eu = u[12]; u[4] = 2 * Gu; Hu = 2 * u[25] + 1; v[1] = 1; w[0].s1 = 1; w[1].s2 = 2; w[2].s3 = w[0].s1 + w[1].s2; Frama_C_dump_each(); int *p = (&g + (int)&g) - (int)&g; // creates a garbled mix *p = 1; p = (&g + (int)&g) - (int)&g; // creates a garbled mix int vg = *p; *p = (int) &vg; } frama-c-20.0-Calcium/tests/value/plevel.i0000666000000000000000000000103413571573400015130 0ustar /* run.config* STDOPT: #"-plevel 40 -big-ints-hex 0x55" */ int t[0xFFFF]; volatile int i; void main() { int i1 = i; //@ assert 0 <= i1 <= 0x20; int i2 = i; //@ assert 0 <= i2 <= 0x40; t[0x100 + i1] = 1; t[0x200 + i2] = 2; t[0x300 + 2*i1] = 3; t[0x400 + 2*i2] = 4; int *p; p = &t[0x500+i1]; *p = 0x5555; p = (int*)((short*)p+1); *p = 0x5656; p = &t[0x600+i2]; *p = 0x6666; p = (int*)((short*)p+1); *p = 0x6767; p = ((char*)&t[0x700])+i1; *p = 7; p = ((char*)&t[0x800])+i2; *p = 8; } frama-c-20.0-Calcium/tests/value/pointer.i0000666000000000000000000000065713571573400015333 0ustar int x,y,c,*p,*q,T[10]; void g() { p = (int*)(void*)&y; *p = c; } void f1() { x = y; q= &x; if (c) p = &x; p = &c; // p = &T[c]; *p = *q; } /*@ ensures x > 0; */ void h() { p = &x; c = *p; *p = y; } void l(int *y) { *y = x; } void k(int *x) { l(x); } int cc1, cc2;; void main(int en) { c=17; x=19; k(&c); k(&x); cc1 = cc2 = 99; if (en & 1) cc1 = T-1 <= T; if (en & 2) cc2 = T <= T+12; } frama-c-20.0-Calcium/tests/value/pointer2.i0000666000000000000000000000026313571573400015406 0ustar /* run.config* GCC: STDOPT: #"-main g" STDOPT: #"-main h" */ int * f (int *r) { return r; } int * p, *q; int x,y,z; void g() { p = f(&x); } void h() { q = f(&y); } frama-c-20.0-Calcium/tests/value/pointer3.i0000666000000000000000000000017313571573400015407 0ustar int x,y,c; int *p,*q; int* f(int * x) { c=2; return x; } void main() { c=1; p = f(&x); q = f(&y); *p = c; } frama-c-20.0-Calcium/tests/value/pointer4.i0000666000000000000000000000037213571573400015411 0ustar /* run.config* GCC: STDOPT: #"-absolute-valid-range 0-0x7" */ unsigned short d,e[10]={0},c = 0; void main(void) { ((int*)0x0)[1] = 1; ((int*)0x0)[0] = 2; d = 1; for (c=0; c<=10; c++){ e[0] = 1; d=0; ((int*)0x0)[c] = 0;} } frama-c-20.0-Calcium/tests/value/pointer_arg.i0000666000000000000000000000036413571573400016157 0ustar volatile int v; int main(char*arg,int argc,char *argv[2]) { arg[0] = 0; arg[1] = 1; if (v) { arg[2] = 1;} if (!argc) arg[1000]=1000; arg[argc] = 4; if (v) { argv[1] = "5069"; argv[0] = "5069"; } argv[0][0] = '0'; } frama-c-20.0-Calcium/tests/value/pointer_comp.c0000666000000000000000000000147313571573400016340 0ustar /* run.config* STDOPT: +"-print" */ extern int v; char str1[] = "absd"; char str2[] = "abdd"; struct s { int x; }; struct s s1; struct s s2[8]; void f(void); void g(void); #define NULL (void*)0 void main () { int i; void (*p)(void) = (v ? &f : &g); // Valid i = (&str1 == &str2); i = (&s1 == NULL); i = (&s1+1 == NULL); i = (&s2[2] == &s2[4]); i = (&s2[8] == NULL); i = (&f == NULL); i = (&s1 == &s2); i = (&f == &g); i = (p == NULL); // Valid i = (&s2[2] < &s2[4]); // Invalid i = (&s2[9] == NULL); i = (&s2[9] == &s2[9]); // Invalid i = (&str1 < &str2); i = (&s1 < &s2); i = (&f < &g); // ? i = (&s1 > NULL); i = (&s1+1 > NULL); i = (&s2[8] > NULL); i = (&f == NULL); // Cabs2cil typing bug here; tolerated for now i = (&f > NULL); // Same i = (p > NULL); } frama-c-20.0-Calcium/tests/value/pointer_comparison.c0000666000000000000000000000211213571573400017543 0ustar /* run.config* STDOPT: +" -load-module report -report-print-properties -eva-warn-undefined-pointer-comparison none -eva-msg-key pointer-comparison -then -report -then -eva-warn-undefined-pointer-comparison pointer -then -report -then -eva-warn-undefined-pointer-comparison all -then -report" STDOPT: +" -load-module report -report-print-properties -undefined-pointer-comparison-propagate-all -eva-warn-undefined-pointer-comparison none -eva-msg-key pointer-comparison -then -report -then -eva-warn-undefined-pointer-comparison pointer -then -report -then -eva-warn-undefined-pointer-comparison all -then -report" */ int x,y,*p; int main(){ p = &x; if (p++ != &y) Frama_C_show_each_1t(p); else Frama_C_show_each_1e(p); if (p++ != &y) Frama_C_show_each_2(p); else Frama_C_show_each_2e(p); if (p++ != &y) Frama_C_show_each_3(p); else Frama_C_show_each_3e(p); if (p++ != &y) Frama_C_show_each_4(p); else Frama_C_show_each_4e(p); if ((int)p != (int)&y) Frama_C_show_each_5((int)p); else Frama_C_show_each_5e((int)p); while (p++ != &y) Frama_C_show_each_6(p); return 0; } frama-c-20.0-Calcium/tests/value/pointer_int_cast.i0000666000000000000000000000021013571573400017200 0ustar /* run.config* GCC: STDOPT: #"-main g" */ int * q; int x,y=0; void g(){ int i = 0; if (y==0) i = &y; q = (int*)i; *q = x; } frama-c-20.0-Calcium/tests/value/pointer_loop.i0000666000000000000000000000141713571573400016357 0ustar /* run.config* COMMENT: this line preserves location... */ int base0=7; int base1=1; int base2=2; int *base_p[2]={&base1,&base2}; int *Ctrl_p; void main () { short int i; int Elements = 2; for (i = 0; i < Elements; i++) { Ctrl_p = base_p[i]; *Ctrl_p = 3+i; } } struct Ctrl; typedef struct Slot { int Elements; struct Ctrl *const *Ctrl_p; } Slot_t; typedef struct Ctrl { const Slot_t *slot_p; int Status; } Ctrl_t; Ctrl_t Ctrl[2]; static Ctrl_t *const ACtrl[2] = { &Ctrl[0], &Ctrl[1] }; const Slot_t Slot[2] = { { 2, &ACtrl[0]}, { 0, (void *) 0} }; void f(void) { int i; int j; i=0; (Slot[i].Ctrl_p[0])->Status = 0; (Slot[i].Ctrl_p[1])->Status = 0; for(j = 0; j < 2; j++) { (Slot[i].Ctrl_p[j])->Status = 1; } } frama-c-20.0-Calcium/tests/value/postcond_leaf.c0000666000000000000000000000413713571573400016462 0ustar /* run.config* OPT: -no-autoload-plugins @EVA_CONFIG@ -load-module eva,inout,report -eva-no-show-progress -eva -eva-use-spec g1,g2,g3 -then -report */ /* Test what is printed when Value evaluates a post-condition: - function with a body (h below): emit a status, plus message "postcondition got status..." - function with only a spec: do not emit a status (respect the Kernel's green/blue statuses) + emit a message only in case of invalid: messages for Valid/Unkown are not informative - function with a body, but for which we evaluate the spec (val-use-spec, g below): emit the status (otherwise the verification is incomplete), emit message only in the invalid case. - in the last two cases, do nothing in the case 'ensures \false' (the warning is too distracting otherwise) */ extern int i; //@ ensures 0 == 1; void f1(void); /*@ assigns i \from i; behavior b: assumes i == 1; ensures 0 == 1; complete behaviors b; */ void f2(void); /*@ assigns i \from i; ensures i == 4; */ void f3(void); /*@ assigns \nothing; ensures \false; */ void f4(void); /*@ assigns i \from \nothing; ensures 0 == 1; */ void g1() { } /*@ assigns i \from i; behavior b: assumes i == 1; ensures 0 == 1; complete behaviors b; */ void g2() { } /*@ assigns \nothing; ensures i == 4; */ void g3() { } /*@ assigns \nothing; ensures 0 == 1; */ void h1() { } /*@ assigns \nothing; behavior b: assumes i == 1; ensures 0 == 1; complete behaviors b; */ void h2() { } /*@ assigns \nothing; ensures i == 4; */ void h3() { } /*@ assigns \nothing; ensures \false; */ void h4() { } /*@ assigns *p \from i; assigns \result \from p; ensures \result == p; */ int* k(int *p); volatile int j; void main() { if (j) { f1(); } if (j) { f2(); } if (j) { f3(); } if (j) { f4(); } if (j) { g1(); } if (j) { g2(); } if (j) { g3(); } if (j) { h1(); } if (j) { h2(); } if (j) { h3(); } if (j & 11) { h4(); } if (j & 12) { int v; k(&v); } } frama-c-20.0-Calcium/tests/value/postcondition.i0000666000000000000000000000240113571573400016534 0ustar int G; int A,B,C,D,E,EX,X; //@ ensures -100 <= \result <= 100 ; int u(void); //@ ensures min <= \result <= max ; int cap(int min, int max); /*@ @ requires 0<=cmd<5; @ ensures 0<=\result<300; // Seems to be a false postcondition @*/ int get_index(int /* in */ cmd) { int ret=0; Frama_C_show_each_cmd(cmd); while (ret <= 100*cmd) { if (u()) return ret; ret++; } return ret; } /*@ ensures EX <= cmd ; */ int bound(int cmd) { cmd = 2; /* vicious */ return 0; } //@ ensures G == 6; void t0 () { G = 6; } //@ ensures G == 7; void t1 () { G = 6; } int *p; //@ ensures *p == 6 && G == *p && G == 6; void t2 () { p = &G; *p = 6; } typedef struct { int a; int b; int c; } st; st TAB[10]; //@ ensures TAB->a == 12; void t3 () { TAB->a = 12; } //@ ensures x<=y; void t4(int x, int y) { x++; y--; return; } /*@ ensures x == \old(x); ensures \result > \old(X); */ int t5(int x) { x = X; return ++x; } /*@ ensures \result == 0; @ ensures \false; @ */ int f(void) { return 0; } void main(){ B=get_index(1); EX = u(); bound(8); C=get_index(u()?4:6); D = u(); E = cap(20, 80); if (u()) t0(); if (u()) t1(); if (u()) t2(); if (u()) t3(); t4(3,4); if (u()) { X = 8; t5(2); } if (B) f(); } frama-c-20.0-Calcium/tests/value/pragma.c0000666000000000000000000000140013571573400015077 0ustar #pragma section DATA ".CRCPPRAM_TIME_I" ".CRCPPRAM_TIME" far-absolute #pragma section DATA ".IRAM_BIT_I" ".IRAM_BIT" near-data #pragma section CONST ".CA_ROM" ".CA_ROM" far-absolute #pragma section SCONST ".CA_ROM" ".CA_ROM" far-absolute #pragma option -Xpragma-section-last #pragma option -Xsmall-const=0 #pragma section CODE ".illegal_code" standard RX #pragma section CONST ".illegal_const" ".illegal_const" far-absolute R #pragma section SCONST ".illegal_sconst" ".illegal_sconst" near-code R #pragma section STRING ".illegal_string" far-absolute R #pragma section DATA ".illegal_data" ".illegal_bss" near-data RW #pragma section SDATA ".illegal_sdata" ".illegal_sbss" near-data RW #pragma section CODE ".illegal_code" standard RX void main () { return; } frama-c-20.0-Calcium/tests/value/precise_locations.i0000666000000000000000000000146513571573400017356 0ustar /* run.config* STDOPT: +"-eva-widening-period 3 -then -inout -load-module report -report -then -plevel 250" */ struct s { int f1[5]; int f_inter[5]; char f2; int f_inter2[5]; }; struct s t[50]; int ct() { return 20; } //@ requires i != 157; assigns \nothing; void f(int i); //@ requires i != 158; assigns \nothing; void g(int i); int i, j; int q, r; int main(int v) { for (i=0; i<5; i++) { for (j=0; j<50; j++) { t[j].f1[i] = 10; } } Frama_C_dump_each(); for (j=0; j<50; j++) { t[j].f2 = 157; } for (i=0; i<5; i++) { for (j=0; j<50; j++) { t[j].f1[i] = ct(); } } Frama_C_dump_each(); for (i=0; i<5; i++) { for (j=0; j<50; j++) { r = t[j].f1[i]+1; q = t[j].f1[i]; f(t[j].f1[i]); g(t[j].f1[i]+1); } } return q+r; } frama-c-20.0-Calcium/tests/value/precond.c0000666000000000000000000000112213571573400015263 0ustar /* run.config* OPT: -no-autoload-plugins -load-module from,inout,eva,report -lib-entry -eva @EVA_CONFIG@ -then -report -report-print-properties -then -report-no-specialized */ int x; /*@ requires i_plus_one: i+1 >= 0; requires i: i >= 0; assigns x; */ void f (int i) { x = i; } //@ requires i >= 0; void f2(int i); void (* const pf2)(int) = f2; // const for lib-entry mode void aux(int i) { pf2(i); } //@ requires x <= 8; void g(void); void main (int c) { void (*p)(int) = f; if (c) { f(1); if(c) f(0); } g (); aux(0); aux(c); (*p)(0); (*p)(-1); } frama-c-20.0-Calcium/tests/value/precond2.c0000666000000000000000000000107013571573400015347 0ustar /* run.config* OPT: -no-autoload-plugins -load-module from,inout,eva,report,rtegen -rte -then -eva @EVA_CONFIG@ -then -report -report-print-properties OPT: -no-autoload-plugins -load-module from,inout,eva,report,rtegen -eva @EVA_CONFIG@ -then -rte -then -report -report-print-properties */ // Fuse with precond.c when bts #1208 is solved int x; /*@ requires i_plus_one: i+1 >= 0; requires i: i >= 0; assigns x; */ void f (int i) { x = i; } //@ requires x <= 8; void g(void); void main (int c) { if (c) { f(1); if(c) f(-1); } g ();g (); } frama-c-20.0-Calcium/tests/value/propagate_bottom.i0000666000000000000000000000103013571573400017203 0ustar volatile int v; void main() { if (v) { int x1 = 1 / 0; } if (v) { int x2 = (long)(1 / 0); } if (v) { int x3 = (float)(1 / 0); } if (v) { int x4 = 1 / 0 + 4; } if (v) { int x5 = -(1 / 0); } if (v) { int x6 = ~(1 / 0); } if (v) { double y1 = 1. / 0; } if (v) { double y2 = (int)(1. / 0); } if (v) { double y3 = (float)(1. / 0); } if (v) { double y4 = 1. / 0. + 4.; } if (v) { double y5 = -(1. / 0.); } if (v) { double y6 = !(1. / 0.); } } frama-c-20.0-Calcium/tests/value/protomain.i0000666000000000000000000000016213571573400015652 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,eva -eva @EVA_CONFIG@ */ int main(int c, char **); frama-c-20.0-Calcium/tests/value/ptr_call_object.c0000666000000000000000000000116413571573400016765 0ustar /* run.config* STDOPT: +"-slevel 2" */ struct obj { int (*next)(); int i; }; int next_1(struct obj *p, struct obj s) { Frama_C_show_each_p_in_next_1(p, s); return 1; } int next_0(struct obj *p, struct obj s) { Frama_C_show_each_p_in_next_0(p, s); return 0; } //@ assigns \result \from \nothing; int rand(void); int main() { struct obj o1, o0; struct obj *p; o1.next = &next_1; o0.next = &next_0; p = rand () ? &o1 : &o0; //@slevel merge; if (p->next(p, *p)){ // p must be precise in each call, including as a formal Frama_C_show_each_x(p); // only p == &o1 is possible } } frama-c-20.0-Calcium/tests/value/ptr_relation.i0000666000000000000000000000141413571573400016345 0ustar /* run.config* GCC: STDOPT: #"-main main" STDOPT: #"-main main1" STDOPT: #"-main main2" */ long i,j,x,k,l,m,n,d,a,b; long *ptr; //----------------------------------------- void main(int c) { a = 333; ptr = c ? &a : &b ; *ptr = 77; i=*ptr+1-1; return; // needs relations to be accurate } //----------------------------------------- void main1(int c) { i = c?3:4; x = i; j = x - i; } //----------------------------------------- // Just a test for dependencies void f2 (int arg) { b = arg + l; a = arg + m ; } void g2 (int arg) { a = arg + n ; } void (*tab_ptr_fct2[2])(int) = { &f2, &g2}; void main2(int c,int arg) { j = c?0:1; (*tab_ptr_fct2[j])(arg); // Dependency of j are taken into account. } //----------------------------------------- frama-c-20.0-Calcium/tests/value/pure_exp.i0000666000000000000000000000020213571573400015464 0ustar /* bug #5877 on gforge */ int *t = 0; int main(void) { /* should lead to an alarm. */ *t == 42; return 0; } frama-c-20.0-Calcium/tests/value/qualified_arrays.i0000666000000000000000000000077513571573400017200 0ustar typedef unsigned int TAB120[ 120 ] ; extern volatile TAB120 volatile_tab_120_2[ 2 ]; volatile unsigned int* const p_first_volatile = &volatile_tab_120_2[0][0] ; volatile unsigned int** pp_first_volatile = (volatile unsigned int **)& p_first_volatile; struct foo { int x; }; volatile struct foo f = { 1 }; volatile int* x = &f.x; /*@ requires p_first_volatile == &volatile_tab_120_2[0][0] ; requires x == &f.x; */ int main(void) { *pp_first_volatile = &volatile_tab_120_2[1][112] ; return 0; } frama-c-20.0-Calcium/tests/value/raz.i0000666000000000000000000000047213571573400014442 0ustar volatile int h; int main() { int n = h?0:10; int r = 0, i; // @ ensures i==n // @ invariant 0 <= i && i <= n for (i=0; i #endif #define S 100 char s[S]; int c=0; int s_int; int *p_int; char ones[]="11111111"; char one23[]="1223"; int col_ones; int col_123; int main(void) { char *p = s; col_ones = 1 + * (int*) ones; col_123 = 1 + * (int*) one23; while (p <= s+S-sizeof(int)) { c = 7 * c + 97; if (c % 3 == 0) *p++ = c; else if (c % 3 == 1) { *(short*)p = c; p += sizeof(short); } else { *(int*)p = c; p += sizeof(int); } } for (p_int = (int*) s; p_int < (int*)(s+S); p_int++) { s_int = 11 * s_int + *p_int; } #ifndef PTEST printf("s_int: %d col_ones: %d col_123:%d\n", s_int, col_ones, col_123); #endif /* résultat attendu, avec int 32-bits : little endian: s_int = -833811464 big_endian : s_int: -1480071902 col_ones: 825307442 col_123:825373236 */ return 0; } frama-c-20.0-Calcium/tests/value/recursion.i0000666000000000000000000000266313571573400015663 0ustar /*run.config* OPT: -no-autoload-plugins -load-module from,inout,eva -lib-entry -main main -eva @EVA_CONFIG@ -journal-disable OPT: -no-autoload-plugins -load-module from,inout,eva -lib-entry -main main -eva @EVA_CONFIG@ -eva-ignore-recursive-calls -journal-disable */ int G; int ff() { if (G) ff(); return 5; } int x; volatile int c; struct s { int f1; int f2; } s; // Use given assigns /*@ assigns x \from x, y; assigns s.f1 \from s.f2; assigns \result \from s; */ struct s f(int y) { x = 2+y; Frama_C_show_each(x, y); if (c) { s = f(y); Frama_C_show_each(x, y); } s.f1 = s.f2; return s; } // Infers assigns \nothing void g() { g(); } // Infer assigns clause that overwrite *p1 and *p2. Currently unsound void h(int *p1, int *p2) { h(p1, p2); } int *pg; /* &i escapes. The precondition is true on all calls, but could be computed false if one overwrites the value of i naively at each call. Currently unsound */ /*@ requires stage > 0 ==> *pg == i-5; assigns *pg \from \nothing; ensures stage > 0 ==> *pg == 8; */ void escaping_formal(int stage, int i) { pg = &i; Frama_C_show_each (pg, *pg, stage, i); escaping_formal (1, i+5); if (stage > 0) *pg = 8; Frama_C_show_each (pg, *pg, stage, i); pg = 0; } int main() { G = ff(); g(); int v1, v2; h(&v1, &v2); Frama_C_show_each(v1, v2); escaping_formal(0, 10); struct s r = f(0); Frama_C_show_each(x); return r.f1+1; } frama-c-20.0-Calcium/tests/value/recursion2.i0000666000000000000000000000050013571573400015731 0ustar /*run.config* OPT: -no-autoload-plugins -load-module from,inout,eva -eva @EVA_CONFIG@ -journal-disable -then -input -out -inout */ int x, y; void h2 (int); void h1 (int); void h1 (int i) { int r = x; if (i) h2 (i); } void h2 (int j) { int q = y; if (!j) h1 (j); } void main() { h2(0); h1(1); } frama-c-20.0-Calcium/tests/value/reduce_by_valid.i0000666000000000000000000001057313571573400016771 0ustar typedef struct { int a; int b; } ts; long t[5]; ts u[5]; volatile unsigned int v; volatile signed int sv; void main1 () { long *p = &t[v]; //@ assert \valid(p+3); p[3]=1; long *q = ((int*)&t[v])+1; //@ assert \valid(q+3); q[3]=1; p = p; q = q; } void main2() { ts *p = &u[v]; ts *q = ((int*)&u[v])+1; ts *r = ((int*)&u[v])+1; ts *s = ((int*)&u[v])+1; //@ assert \valid(&p->b); p->a = 1; //@ assert \valid(&q->a); q->a = 2; //@ assert \valid(&r->b); r->b = 3; //@ assert \valid(s); s->a = 4; p = p; q = q; r = r; s = s; } void main3(unsigned int c1, unsigned int c2) { int *p = &t[c1]; int *q = &c2; //@ assert \valid(\union(q, q)); //@ assert \valid(\union(p, q)); p = p; } void main4(unsigned int c1, unsigned int c2, unsigned int c3, unsigned int c4) { //@ assert \valid(&t[c1]); //@ assert \valid(&t[c2]); int *p = &t[0]; //@ assert \valid(p+c3); ts *q = &u[0]; //@ assert \valid(&(q+c4)->a); c1 = c1; c2 = c2; c3 = c3; c4 = c4; } void main5() { int y; int *q = &y; int *p; int *r; { int x = 0; p = &x; } //@ assert \valid(q); //@ assert \valid(&y); //@ assert !\valid(p); if (v) p = & y+3; else p = &q+4; //@ assert !\valid(p); p = 0; //@ assert !\valid(p); if (v) r = &y; //@ assert \valid(r); } struct s { int *f1; }; extern struct s *vs; /*@ requires r1: \valid(p->f1); requires r2: \valid(p->f1); requires r3: \valid(p); requires r4: \valid(p); requires r5: \valid(p->f1); requires r6: \valid(p->f1); */ void main6(struct s *p) { *(p->f1)=1; } void main7 () { int t7_1[10]; int *p = t7_1; //@ assert !\valid(p+(0..1000)); //@ assert !\valid(p+(-1..9)); //@ assert \valid(p+(0..9)); int t7_2[10000]; p = t7_2; //@ assert !\valid(p+(0..10000)); p = t7_2+v; //@ assert \valid(p+(-5..250)); //@ assert \valid(p+(-5..250)); } void main8 () { int t8_1[10]; int t8_2[20]; int *tp[4]; tp[0] = t8_1; tp[1] = t8_1+v; tp[2] = t8_2+v; tp[3] = v ? t8_1+v : t8_2+v; int **p = &tp; if (v) { //@ assert \valid(p[0..3]); //@ assert \valid(p[0..3]); // Reduction succeeds } if (v) { //@ assert \valid(tp[0..3]); //@ assert \valid(tp[0..3]); // Same } if (v) { //@ assert \valid(tp[0..3]+1); //@ assert \valid(tp[0..3]+1); // Not written yet } } void main9() { struct s { int a; int b; char t[100]; }; char tc[sizeof(struct s) + 50]; struct s* p = tc + v - 100; //@ assert \valid(&p->t[0..99]); p->t[0] = 1; p->t[99] = 2; //@ assert \valid(&p->t[0..99]); } void main10() { char t[40]; char *p; int u[20]; int *q; p = &t[sv]; *((int *)p) = 1; Frama_C_show_each_main10_1(p); //@ assert \valid((int *)p); p = &t[sv]; *((int *)p+2) = 2; Frama_C_show_each_main10_2(p); //@ assert \valid(((int *)p)+2); p = &t[sv]; *((int *)(p+2)) = 1; Frama_C_show_each_main10_3(p); //@ assert \valid((int *)(p+2)); struct s { int a; int b; }; p = &t[sv]; ((struct s *)p)->b = 4; Frama_C_show_each_main10_4(p); ((struct s *)p)->b = 4; //@ assert \valid(&(((struct s *)p)->b)); p = &t[sv]; ((struct s *)p+2)->b = 4; Frama_C_show_each_main10_4(p); ((struct s *)p+2)->b = 4; //@ assert \valid(&(((struct s *)p+2)->b)); q = (int*)(((char*)&u)+sv); *((char *)q) = 1; Frama_C_show_each(q); *((char *)q) = 1; //@ assert \valid((char *)q); q = (int*)(((char*)&u)+sv); *((char *)q+2) = 1; Frama_C_show_each(q); *((char *)q+2) = 1; //@ assert \valid((char *)q+2); } void main11() { char TC[500]; char * p = TC+10; int off = v; int len = v; //@ assert 0 <= off <= 400 && 200 <= len <= 400; p = p + off; Frama_C_show_each(p); //@ assert \valid(p+(0 .. len-1)); int TU[500]; int * q = TU+10; off = v; len = v; //@ assert 0 <= off <= 400 && 200 <= len <= 400; q = q + off; Frama_C_show_each(q); //@ assert \valid(q+(0 .. len-1)); p = TU+10; off = v; len = v; //@ assert 0 <= off <= 800 && 1800 <= len <= 2200; p = p + off; Frama_C_show_each(p); //@ assert \valid(p+(0 .. len-1)); q = TC+10; off = v; len = v; //@ assert 0 <= off <= 100 && 50 <= len <= 100; q = q + off; Frama_C_show_each(q); //@ assert \valid(q+(0 .. len-1)); } void main () { main1(); main2(); main3(v,v); main4(v,v,v,v); main5(); main6(vs); main7(); main8(); main9(); main10(); main11(); } frama-c-20.0-Calcium/tests/value/reduce_formals.i0000666000000000000000000000250113571573400016633 0ustar void main1(int i, int j, int k) { //@ assert i >= 5; j = j/7+3; if (k <= 7) while (1); } //@ requires i >= 6; assigns \nothing; void main2(int i); void f_main3 (int * p, int a) { *p += a; } void main3 (void) { long x = 3; long * p = &x; //@ assert sizeof(long) == sizeof(int); f_main3 ((int *)p, x); // go through the casts on p and x Frama_C_show_each(x); } void f_main4_1 (float f) { //@ assert f >= 10; } void f_main4_2 (unsigned int f) { //@ assert f <= 20; } void main4 (int v) { if (v <= 15) { f_main4_1(v); Frama_C_show_each_v(v); // reduction on eva thx to backward propagation on exps } else { f_main4_2(v); Frama_C_show_each_v(v); // same } } int f_main_2() { return 0; } void f_main_1(int v) { v = f_main_2(); } void main5() { int l = 2; f_main_1(l); // no reduction here, l is written in f_main_1 } extern int g; void f_main6(int x) { //@ assert x >= 4; g = 3; } void main6() { //@ assert 0 <= g <= 10; f_main6(g); // No reduction there, the global may be/is modified externally Frama_C_show_each_6(g); } void main(int v, int w, int x, int y, int z) { main1(x, y, z); main2(w); Frama_C_dump_each(); // i, j, k must have been removed. // w, x and z should have been reduced. main3(); main4(v); main5(); main6(); } frama-c-20.0-Calcium/tests/value/reduce_index.i0000666000000000000000000000274513571573400016311 0ustar int t[10]; int u[11]; volatile int maybe; extern int c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12; int f1_aux () { return 1; } void f1 () { t[c1]=f1_aux(); c1 = c1; } int f2() { c2 = c2; return t[c2]; } int f3() { t[c3]; c3 = c3; return 0; } int f4() { if(t[c4]) { int x = 1; } c4 = c4; return 0; } int f5() { int c = t[c5]; c5 = c5; return 0; } void f6() { u[c6] = t[c6]; t[c6] = u[c6]; c6 = c6; } void f7() { t[c7] = u[c7]; u[c7] = t[c7]; c7 = c7; } typedef struct { int f1; int f2; } typs; typs ts[10]; typs *p8; int f8 () { p8 = &ts[c8]; p8->f1 = 1; p8->f2 = 2; c8 = c8; p8 = p8; return 0; } int f9 () { ts[c9].f1 = 1; c9 = c9; return 0; } typedef int ti4[4]; typedef int ti7[7]; int ti_4[4]; int ti_7[7]; void f10 () { ti7* p7 = &ti_7; (*p7)[c10] = 10; c10 = c10; } void f11 () { ti4* p4 = &ti_4; ti7* p7 = (ti7*)p4; (*p7)[c11]=11; c11 = c11; } void f12 () { ti7* p7 = &ti_7; ti4* p4 = (ti4*)p7; (*p4)[c12]=12; c12 = c12; } extern int k1, k2, k3, k4; void pointer_index(void) { int *p = u; int l; l = p[k1]; k1 = k1; p = (char*)u + 5; l = p[k2]; k2 = k2; p = (char*)u + 11; l = p[k3]; k3 = k3; p = u + 3; l = p[k4]; k4 = k4; } extern int nulli; void null_index(void) { *((int*)0+nulli) = 0; } void main () { f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); pointer_index(); if (maybe) null_index(); } frama-c-20.0-Calcium/tests/value/reduce_valid.i0000666000000000000000000000063213571573400016272 0ustar int t[2], u[2]; int *p,*q,*r, A, offs; void main(int c, int d, int e, int f, int g, unsigned short h) { p = c ? t : (void*)0; *p = 2; p[1] = 3; *p = 4; q = (void*)0; if (d) { Frama_C_show_each_ici(0); *q = 3; *q = 4; Frama_C_show_each_la(0); } r = e ? (f ? t : t+1) : (void*)0; offs = g ? 1 : 2; A = r[offs]; Frama_C_show_each_r(r); u[h+1] = 1; } frama-c-20.0-Calcium/tests/value/redundant_alarms.c0000666000000000000000000000212713571573400017162 0ustar /* run.config* OPT: -no-autoload-plugins -load-module inout,scope,slicing,sparecode @EVA_CONFIG@ -eva-warn-copy-indeterminate=-@all,main3 -scope-msg-key rm_asserts -scope-verbose 2 -remove-redundant-alarms -print -slice-threat main1 -then-on 'Slicing export' -print **/ volatile int v; void main1(int c) { int x, y, t; int *p = c ? &x : &y; *p = 1; int z = *p+1; int w = *p+2; x = t; y = t; x = t; if (v) {z = *p+2;} } void main2(int i) { int t[10]; t[i] = 1; t[i] += 3; t[i] += 5; } //@ requires i < 10 && j < 10; void main3(unsigned int i, unsigned int j) { int t[10]; if (v) t[i] = v; if (t[i] < t[j]) { int tmp = t[j]; t[j] = t[i]; t[i] = tmp; } } void main4(int i) { while(1) { int j = 0; //@ assert i <= 0; // Do not prove this assertion using itself int k = 0; int z = 0; int w = 0; } } void main5() { int *p; { int x; p = &x; *p = 1; //@ assert *p == 1; } //@ assert *p == 1; // Should *not* be proven } void main() { if (v) main1(v); main2(v); main3(v, v); if (v) main4(v); main5(); } frama-c-20.0-Calcium/tests/value/reevaluate_alarms.i0000666000000000000000000000102013571573400017330 0ustar /* run.config* STDOPT: +"-load-module report -report -then -slevel 10" */ int S=0; int T[5]; int n = 1; int loop () { int i; int *p = &T[0] ; for (i=0; i<5; i++) { S = S+i; *p++ = S; } return S; } void compute_n () { for (int i=1; i <= 5; i++) { n *= i; } } void init_p (int *p) { if (n == 120) *p = 0; } void initialized_p (int *p) { int x = *p + 1; } int main(void) { loop (); compute_n (); int x, y; init_p (&x); initialized_p (&x); init_p (&y); initialized_p (&y); } frama-c-20.0-Calcium/tests/value/relation_reduction.i0000666000000000000000000000043013571573400017531 0ustar int y,t; int R1,R2,R3,R4; int c; int tab[9] = { 101, 102, 103, 104, 105, 106, 103, 102, 101 }; void main(int x) { y = x; t = y + 10; if (x == 2) { R1 = y; R2 = t; } if (t == 17) R3 = x; if (x>=0 && x<=5) if (tab[y] == 103) R4 = x; } frama-c-20.0-Calcium/tests/value/relation_shift.i0000666000000000000000000000055213571573400016657 0ustar int r1,r2,r3,r4; void main (int x,int y,int z,int t,int *p,int q[2]) { x = y ; x++; y--; p=(int*)(&p); p++; z = x; t=5; z+=t; *q=3; q++; r1 = x-y; r2 = z-y; r3 = *(q-1); r4 = *q; Frama_C_dump_each(); } void main1 (int x,int y,int z,int t,int *p,int *q) { *q = 3; q++; r3 = *(q-1); r4 = *q; Frama_C_dump_each(); } frama-c-20.0-Calcium/tests/value/relations.i0000666000000000000000000000156713571573400015654 0ustar int t[3]={1,2,3}; int *p,x; int u[20]; int R1,R2,R3,R4,R5,R6,R7,A7,R8,A8; int S1,S2,S3,S4,S5,S6,S7,B7,S8,B8; typedef struct { int L0; int L1; int T13; int T; int L8; } Cs; void main(int c,char d,char e, int f, int g, int h, int i, Cs *pCs) { u[0] = g; p=&t[1]; *p=4; if (c) c=0; t[0]=t[1]; x=*(p-1); e=d; e=d-e +1; if (d) (*(char*)&f)=e; else f = x; u[1] = u[0]; if (u[1] == 3) { R1 = u[0]; R2 = g; } u[5] = u[0] + 1; if (u[5] == 3) { R3 = u[0]; R4 = g; } R5 = u[5] - u[0]; u[10] = h; u[11] = i; if (u[10] == u[11]) R6 = u[10] - u[11]; A7 = u[1] - u[0]; if (u[1] == u[0]) R7 = 1; A8 = u[5] - u[1]; if (u[5] == u[1]) R8 = 1; pCs->T13 = pCs->L0 || pCs->L1; pCs->T = pCs->T13; pCs->L8 = pCs->L0 || pCs->T13; S1 = pCs->T - pCs->T13; if ( pCs->T == pCs->T13) S2 = 1; } frama-c-20.0-Calcium/tests/value/relations2.i0000666000000000000000000000260013571573400015723 0ustar typedef unsigned long size_t; volatile size_t sv; /*@ requires len: len > 0 && len <= 1024; requires n: n < 64; */ void bts2166(size_t len, size_t n) { if (len > 0 && len <= 1024 && n < 64) { // logic reductions do not work in the Apron domain. We use this 'if' for now if (len >= 64 || len + n >= 64) { n = 64 - n; len -= n; Frama_C_dump_each(); } Frama_C_show_each_end(len, n); } } extern int a[514]; //@ assigns \result \from i1, i2; ensures i1 <= \result <= i2; unsigned int unsigned_interval(int i1, int i2); int main2() { unsigned int i, t, n; int s = 0; i = unsigned_interval(0,512); t = unsigned_interval(0,512); n = unsigned_interval(0,512); for (i = n; i >= t+1; i--) { Frama_C_dump_each(); int b3 = a[i-(t+1)] == 3; s += b3; } return s; } int T[7] = {0, 1, 42, 5, 6, 41, 42}; void main3 (int i) { if (i >= 0 && i < 2) { T[T[i]] = 2; // may trick symbolic domains: T[T[i]] == 2 may not hold afterwards, because the instruction writes on the locations involved in T[T[i]] if (T[T[i]] == 2) Frama_C_show_each_NO1(); else Frama_C_show_each_OK1(); } if (i >= 3 && i < 5) { T[T[i]] = 17; if (T[T[i]] == 17) // here the equality holds Frama_C_show_each_OK2(); else Frama_C_show_each_NO2(); } } void main() { bts2166(sv, sv); main2(); main3(sv); } frama-c-20.0-Calcium/tests/value/relations_difficult.i0000666000000000000000000000052013571573400017671 0ustar int x,y,*p; int A,B,C,Z; int main(int c) { x = 0; y = 1; p = c ? &x : &y; *p = 2; x = 3; A = *p; /* optimal : {2,3} ; sans relations : {1,2,3} */ x = 4; B = (*p) + Z; /* optimal : {2,4} ; sans relations : {1,2,4}; avec relations actuelles : {2,3,4} */ C = *p; /* meme chose avec copy-paste */ return 0; } frama-c-20.0-Calcium/tests/value/replace_by_show_each.c0000666000000000000000000000061713571573400017766 0ustar /* run.config* OPT: -no-autoload-plugins -load-module from,inout,eva -eva @EVA_CONFIG@ -inout -calldeps */ #define show_each_1 Frama_C_show_each_1 #define show_each_2 Frama_C_show_each_2 void show_each_1() { } void show_each_2() { } //@ assigns \nothing; void Frama_C_show_each_2(); int x = 0; int main(int j) { int i = 1; show_each_2(); i = 2; show_each_1(); return i = (j+1); } frama-c-20.0-Calcium/tests/value/resolve.i0000666000000000000000000000023613571573400015323 0ustar int f( int , int); int f(int , int ); int f(int , int ); //@ assigns \result; int main(void) { return f(0,1); } //@ assigns \result; int main(void); frama-c-20.0-Calcium/tests/value/return.i0000666000000000000000000000025713571573400015166 0ustar int G,H; int f(int x) { return (x+G); } int g(int x) { return 1; } int h(int x) { return x; } void main (int c) { if (c) H = f(H); else G = f(G); } frama-c-20.0-Calcium/tests/value/scade_types.h0000666000000000000000000000154413571573400016151 0ustar /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** Command : ** l2C CruiseControl.lus -node CruiseControl ** -noexp @ALL@ ** -keep_named_var ** -const ** -bitwise ** -loc_ctx ** -no_copy_mem ** -debug ** date of generation (MM/DD/YYYY): 07/06/2007 13:30:09 ** last modification date for CruiseControl.lus (MM/DD/YYYY): 07/06/2007 ********************************************************************$*/ /* ===== */ /* TYPES */ /* ===== */ #include "config_types.h" #define _INCLUDE_SCADE_TYPES typedef real Percent; typedef real Speed; /*$************* SCADE_KCG KCG Version 5.1.1 (build i10) ************** ** End of file scade_types.h ** End of generation (MM/DD/YYYY) : 07/06/2007 13:30:09 ********************************************************************$*/ frama-c-20.0-Calcium/tests/value/semaphore.i0000666000000000000000000000072213571573400015627 0ustar /* run.config* GCC: STDOPT: #"-main g" */ int Sa, Sb; void P(int), V(int); void f (void) { int c = 12; if (c) P (Sa); P (Sa); P (Sb); V (Sa); V (Sb); } void g (void) { int c = -25; while (c--) while (c) { V (Sa); c++; } P (Sb); P (Sa); V (Sa); V (Sb); f(); } /* void creation_tache( void (*f)(void)) { (*f)(); }; void main (void) { Screation_tache (&f); Screation_tache (&g); } */ frama-c-20.0-Calcium/tests/value/separated.i0000666000000000000000000000063113571573400015613 0ustar char t[15]; char *p = t; int x; int main(int c){ if (c&1) /*@ assert \separated(p, p+1) ; */ x = 1; else if (c&2) /*@ assert \separated(p, p) ; */ x = 1; else if (c&4) /*@ assert \separated(p+1, p+1) ; */ x = 1; else if (c&8) /*@ assert \separated(p+(0..8), p+(8..12)) ; */ x = 1; else /*@ assert \separated(p+(0..5), p+(6..12)) ; */ x = 1; return 0; } frama-c-20.0-Calcium/tests/value/shift.i0000666000000000000000000000202413571573400014756 0ustar /* run.config* STDOPT: #"-eva -warn-unsigned-overflow" STDOPT: #"-no-warn-left-shift-negative" */ int a,b,d,e,f,g,h; unsigned int ua,ub,uc,ud,ue,uf; char t[10]; volatile v; int main(int c, int z, int zz) { a=5024; d = 255; f= -255; if ((c<=3) && (c>=0)) { c = 2*c-1; if (v) { a = 157 << c; /*@ assert c >= 0; */ /* Reduction by the alarm on RHS */ } if (v) { d=1975; d = d >> c; /*@ assert c >= 0; */ /* Reduction by the alarm on RHS */ } if (v) { f= -1975; f = f >> c; } if (v) { c = c << 3; /*@ assert c >= 0; */ /* Reduction by the alarm on LHS */ } } if (z & 1) z=1<<32; if (zz) zz=1>>5555; if (z & 16) { b = 66; b = b << b; }; ua = 5607; ua >>= 2 ; ub = (unsigned int)(-3000); ub >>= 2; Frama_C_show_each("ua:%u\nub:%u\n",ua,ub); if (z & 32) { int r = (unsigned long)t << 8; r += (long)t << 8; } unsigned int shl = 1; if (v) { shl = 2U << 31; // "Unsigned overflow." } return b; } frama-c-20.0-Calcium/tests/value/shift_big.i0000666000000000000000000000216113571573400015601 0ustar volatile int nondet; int t1() { unsigned int j = nondet; unsigned i = 1 << j; return i; } int t2() { unsigned int j = 1; if (nondet) j = 10; if (nondet) j = 31; if (nondet) j = 1000000000; if (nondet) j = 2000000000; unsigned i = 1 << j; return i; } void t3() { unsigned int x = 1000000000; int i; for (i = 1000000000; i < 2000000000; i++) { if (nondet) x = i; } //@assert 1 << (1 << x) > 0; } void t4() { unsigned int x = 1000000000; if (nondet) x = 1000000001; //@assert 1 << (1 << x) > 0; } void t5() { unsigned int x = 1000000000; int i; for (i = 1000000000; i < 2000000000; i++) { if (nondet) x = i; } //@assert 1 << (1 >> x) > 0; } void t6() { unsigned int x = 1000000000; if (nondet) x = 1000000001; //@assert 1 << (1 >> x) > 0; } void t7() { unsigned int x = 1022; if (nondet) x = 1023; //@assert 1 << (1 << x) > 0; } void t8() { unsigned int x = 1022; if (nondet) x = 1023; //@assert 1 << (1 >> x) > 0; } int main() { int r = 0; if (nondet) r += t1(); if (nondet) r += t2(); t3(); t4(); t5(); t6(); t7(); t8(); return r; } frama-c-20.0-Calcium/tests/value/shift_neg.c0000666000000000000000000000157013571573400015606 0ustar /* run.config* STDOPT: #"" STDOPT: #"-no-warn-left-shift-negative -warn-right-shift-negative" */ /* The first run emits alarms on left shifts on negative values; the second run emits alarms on right shifts on negative values. */ #include <__fc_builtin.h> volatile int rand; /* Tests left and right shift of negative integers. */ void main() { int x, r; // no alarm x = Frama_C_interval(24, 128); r = x >> 4; r = x << 4; // alarm and reduction of [x] x = Frama_C_interval(-8, 12); r = x << 2; Frama_C_show_each_left_shift(x, r); x = Frama_C_interval(-8, 12); r = x >> 2; Frama_C_show_each_right_shift(x, r); // invalid alarm if (rand) { int k = (-44) << 15; int l = (-44) << 3; Frama_C_show_each_neg_left_shift(k, l); } if (rand) { int i = (-44) >> 15; int j = (-44) >> 3; Frama_C_show_each_neg_right_shift(i, j); } } frama-c-20.0-Calcium/tests/value/sign_of_bitfiled_int.c0000666000000000000000000000120413571573400017772 0ustar /* run.config* OPT: -no-autoload-plugins -load-module eva,inout -eva @EVA_CONFIG@ -cpp-extra-args="-DPTEST" -journal-disable OPT: -no-autoload-plugins -load-module eva,inout -machdep ppc_32 -eva @EVA_CONFIG@ -cpp-extra-args="-DPTEST" -journal-disable */ #ifndef PTEST #include #endif struct sbf { int c:16 ; unsigned int u:16 ;} bf ; int main () { int int_inside_bitfield_is_unsigned ; bf.u --; bf.c --; int_inside_bitfield_is_unsigned = (bf.u > bf.c) ; #ifndef PTEST printf("int_inside_bitfield_is_unsigned = %d\n", int_inside_bitfield_is_unsigned); #endif return int_inside_bitfield_is_unsigned ; } frama-c-20.0-Calcium/tests/value/simple_packed.c0000666000000000000000000000054213571573400016436 0ustar struct my_unpacked_struct { char c; int i; }; struct my_packed_struct { char c; int i; struct my_unpacked_struct s; } __attribute__ ((__packed__)); struct my_packed_struct f(struct my_packed_struct foo) { struct my_packed_struct bar=foo; return foo; } struct my_packed_struct main(struct my_packed_struct foo) { f(foo); return foo; } frama-c-20.0-Calcium/tests/value/simple_path.i0000666000000000000000000000013713571573400016151 0ustar int G,H; int *p = &G; int *q = &H; void main(void) { G = 4; *p = 3; p = &H; *p = 5; } frama-c-20.0-Calcium/tests/value/simplify_cfg.i0000666000000000000000000000054513571573400016322 0ustar /* run.config* OPT: -no-autoload-plugins -load-module eva,inout -simplify-cfg -keep-switch -eva @EVA_CONFIG@ -journal-disable OPT: -no-autoload-plugins -load-module eva,inout -simplify-cfg -eva @EVA_CONFIG@ -journal-disable */ int main(int x, int y) { int z = 0; char c = 'c'; switch (x) { case 0: z=(int)c; default: z++; } return z; } frama-c-20.0-Calcium/tests/value/sizeof.i0000666000000000000000000000170513571573400015145 0ustar /* run.config* STDOPT: +"-print" */ int sz_str,sz_typ,align_str,align_typ; void main1() { sz_str= sizeof("ONE"); //@ assert sz_str == sizeof("ONE"); align_str= __alignof("FOO"); // assert align_str == __alignof("FOO"); sz_typ= sizeof(char); //@ assert sz_typ == sizeof(char); align_typ= __alignof(char*); // assert align_typ == __alignof((char*)); //@ assert sizeof("BLA") != sizeof("FOOBAR"); return; } struct s { int t[10]; }; struct s s1; volatile int i; /* Test a not so intelligent bug of Logic_interp, that used to call the dependencies of the sizeof() construct present in the alarms. Since those have an array type, Value was unhappy. */ void main2() { struct s *p = (&s1 + (int)&s1) - (int)&s1; // creates a garbled mix p->t[sizeof(s1.t)-i] = 1; p->t[sizeof(s1.t)-i] = 2; } void f(int sz) {} void main(int *p, int *q, int j) { main1(); main2(); f(sizeof(*p) * j); // must not crash with equality domain } frama-c-20.0-Calcium/tests/value/slevel_return.i0000666000000000000000000000111613571573400016533 0ustar /* Test that we do not perform a merge on return instructions, even if there is insufficient slevel. */ int x; int y; //@ ensures x < 0 || y == x + 1; void main1(int c) { if (c == 1) { x = 0; y = 1; return; } else if (c == 2) { x = 5; y = 6; return; } else { x = -3; return; } } //@ ensures x < 0 || y == x + 1; void main2(int c) { if (c == 1) { x = 0; y = 1; return; } if (c == 2) { x = 5; y = 6; return; } x = -3; Frama_C_dump_each(); } void main3(); void main(int c) { main1(c); main2(c); } frama-c-20.0-Calcium/tests/value/slevelex.i0000666000000000000000000000254213571573400015475 0ustar /* run.config* STDOPT: #"-slevel 5 -slevel-function main:0 -slevel-function gu:21 -slevel-function ginc:21" */ volatile int c; int f(void) { int x, y; if (c) { x = 1; y = 1; } else { x = 2; y = 2; } return x*x - y*y; } void gu(int u) { /*@ assert u == 1 || u == 2 || u == 3 || u == 4 || u == 5 || u == 6 || u == 7 || u == 8 || u == 9 || u == 10 || u == 11 || u == 12 || u == 13 || u == 14 || u == 15 || u == 16 || u == 17 || u == 18 || u == 19 || u == 20 ; */ Frama_C_show_each_u(u); } void ginc(int u) { int inc; inc = 4 * u; /*@ assert inc == 4 || inc == 8 || inc == 12 || inc == 16 || inc == 20 || inc == 24 || inc == 28 || inc == 32 || inc == 36 || inc == 40 || inc == 44 || inc == 48 || inc == 52 || inc == 56 || inc == 60 || inc == 64 || inc == 68 || inc == 72 || inc == 76 || inc == 80 ; */ Frama_C_show_each_inc(inc); } void main(int un) { int x, y; if (c) { x = 1; y = 1; } else { x = 2; y = 2; } //@ assert x*x == y*y ; Frama_C_show_each_xy(x,y); x = f(); //@ assert x == 0; if (un>=20) un = 20; if (un<=1) un = 1; gu(un); ginc(un); } frama-c-20.0-Calcium/tests/value/small_conditionals.i0000666000000000000000000000007613571573400017524 0ustar char Y,Z,U ; void main(char X) { Y = X?:2; Z = U?3:4; } frama-c-20.0-Calcium/tests/value/sort4.i0000666000000000000000000000453413571573400014724 0ustar /* run.config* GCC: STDOPT: #"-lib-entry -main sort4_1" STDOPT: #"-lib-entry -main sort4_4" STDOPT: #"-lib-entry -main sort4_3" */ /* sort 4 integers */ int a, b, c, d; void sort4_1() { int tmp; if (a > b) { tmp = a; a = b; b = tmp; } if (c > d) { tmp = c; c = d; d = tmp; } if (a > c) { tmp = a; a = c; c = tmp; } if (b > d) { tmp = b; b = d; d = tmp; } if (b > c) { tmp = b; b = c; c = tmp; } /*@ assert a <= b <= c <= d; */ } /*@ requires \valid_range(t,0,3); ensures t[0] <= t[1] <= t[2] <= t[3]; */ void sort4_4(int t[4]) { int tmp; if (t[0] > t[1]) { tmp = t[0]; t[0] = t[1]; t[1] = tmp; } if (t[2] > t[3]) { tmp = t[2]; t[2] = t[3]; t[3] = tmp; } if (t[0] > t[2]) { tmp = t[0]; t[0] = t[2]; t[2] = tmp; } if (t[1] > t[3]) { tmp = t[1]; t[1] = t[3]; t[3] = tmp; } if (t[1] > t[2]) { tmp = t[1]; t[1] = t[2]; t[2] = tmp; } } /* commented because of memory explosion */ #if 0 /*@ requires \valid(a) && \valid(b) && \valid(c) && \valid(d) && @ a != b && a != c && a != d && b != c && b != d && c != d; @ ensures *a <= *b <= *c <= *d; */ void sort4_2(int *a, int *b, int *c, int *d) { int tmp; if (*a > *b) { tmp = *a; *a = *b; *b = tmp; } if (*c > *d) { tmp = *c; *c = *d; *d = tmp; } if (*a > *c) { tmp = *a; *a = *c; *c = tmp; } if (*b > *d) { tmp = *b; *b = *d; *d = tmp; } if (*b > *c) { tmp = *b; *b = *c; *c = tmp; } } #endif //@ type Lint = int; /*@ predicate swap_ord(Lint a2,Lint b2,Lint a1,Lint b1) = @ (a1 <= b1 ==> (a2 == a1 && b2 == b1)) && @ (a1 > b1 ==> (a2 == b1 && b2 == a1)) ; @*/ /*@ requires \valid(a) && \valid(b) && \valid(c) && \valid(d) && @ a != b && a != c && a != d && b != c && b != d && c != d; @ ensures *a <= *b <= *c <= *d; */ void sort4_3(int *a, int *b, int *c, int *d) { int tmp; // assigns *a,*b,tmp; ensures swap_ord( *a,*b,\old( *a),\old( *b)); if (*a > *b) { tmp = *a; *a = *b; *b = tmp; } // assigns *c,*d,tmp; ensures swap_ord( *c,*d,\old( *c),\old( *d)); if (*c > *d) { tmp = *c; *c = *d; *d = tmp; } // assigns *a,*c,tmp; ensures swap_ord( *a,*c,\old( *a),\old( *c)); if (*a > *c) { tmp = *a; *a = *c; *c = tmp; } // assigns *b,*d,tmp; ensures swap_ord( *b,*d,\old( *b),\old( *d)); if (*b > *d) { tmp = *b; *b = *d; *d = tmp; } // assigns *b,*c,tmp; ensures swap_ord( *b,*c,\old( *b),\old( *c)); if (*b > *c) { tmp = *b; *b = *c; *c = tmp; } } frama-c-20.0-Calcium/tests/value/split_return.i0000666000000000000000000000777713571573400016417 0ustar /* run.config* STDOPT: +"-deterministic -eva-no-memexec -slevel-function init:3,main1:3,f2:4,main2:4,f4:3,main5:3,uninit:2,main9:2 -eva-split-return-function f2:0,f3:-2:-4,f4:4,f5:-2,NON_EXISTING:4,uninit:0,escaping:0 -eva-warn-copy-indeterminate=-uninit,-escaping,-main9 -permissive -then -load-module report -report" STDOPT: +"-deterministic -eva-no-memexec -eva -journal-disable -out -input -deps -slevel 6 -eva-split-return auto -eva-split-return-function f7:0:3 -eva-warn-copy-indeterminate=-uninit,-escaping,-main9 -then -load-module report -report" COMMENT: below command must fail, as -permissive is not set STDOPT: +"-deterministic -eva-no-memexec -eva -slevel-function NON_EXISTING:4 -eva-warn-copy-indeterminate=-uninit,-escaping,-main9" STDOPT: +"-deterministic -eva-no-memexec -eva -journal-disable -out -input -deps -slevel 6 -eva-split-return full -eva-warn-copy-indeterminate=-uninit,-escaping,-main9" STDOPT: +"-deterministic -eva-no-memexec -eva -journal-disable -out -input -deps -slevel 6 -eva-split-return full -eva-split-return-function f7:0:3 -eva-split-return-function f2:full -eva-warn-copy-indeterminate=-uninit,-escaping,-main9 -then -eva-split-return-function f2:auto" */ /*@ assigns \result \from \nothing; assigns *p \from \nothing; ensures \result == 0 && \initialized(p) || \result == 1; */ int init(unsigned int *p); unsigned int main1() { unsigned int x; int r = init(&x); switch(r) { case 0: x = x /2 + 2; break; case 1: x = 0; break; default: //@ assert \false; break; } return x; } extern unsigned int i2; unsigned int f2() { if (!i2) { i2 = 0; return 0; } else if (!(i2+1)) { i2 = 5; return 5; } else { i2 = 5; return 7; } } void main2() { unsigned int r = f2(); Frama_C_show_each_f2(r, i2); if (r == 0) { //@ assert i2 == 0; } else { Frama_C_show_each_f2_2(r, i2); //@ assert i2 != 0; } } extern int i3; int f3() { int res1, res2; if (i3) { i3 = 0; res1 = -2; } else { i3 = 5; res1 = 7; } res2 = res1; return res2; } void main3() { int r = f3(); Frama_C_show_each_f3(r, i3); if (r == -2) { //@ assert i3 == 0; } else { //@ assert i3 != 0; } } extern int i4; int f4() { if (i4) { i4 = 0; return 4; } else { i4 = 5; return 7; } } void main4() { int r = f4(); Frama_C_show_each_f4(r, i4); if (r == 4) { //@ assert i4 == 0; } else { //@ assert i4 != 0; } } extern int i5; int f5() { int res; if (i5) { i5 = 0; res = -2; } else { i5 = 5; res = 7; } return res; } void main5() { int r = f5(); Frama_C_show_each_f5(r, i5); if (r == -2) { //@ assert i5 == 0; } else { //@ assert i5 != 0; } } volatile v; int f6() { int i = v; //@ assert -5 <= i <= 5; return i; } void main6() { if ((short)(f6())) { } } volatile v; int v7; int* f7() { if (v) { v7 = 0; return 0; } else { v7 = 1; return &v; } } void main7() { int* p = f7(); if (p == (void*)0) { } else { } Frama_C_show_each_NULL(p, v7); } int* f8(int *p) { if (v) { *p = 4; return p; } else { *p = -1; return 0; } } void main8() { int x; int * (*pf)(int *) = &f8; int *p = (*pf)(&x); Frama_C_show_each_then8(x, p); } /* [main9] checks that -split-return does not remove states in which the result is an escaping pointer or an uninitialized variable (and thus evaluates to bottom) when -eva-warn-copy-indeterminate is disabled. */ volatile int rand; int uninit () { int x; if (rand) x = 0; return x; } int *escaping () { int *p; { int x; p = &x; } return p; } /* At the end, [y] may be uninitialized and [q] is a dangling pointer. */ void main9 () { int y = uninit(); int *q = escaping(); } void main() { main1(); main2(); main3(); // not enough slevel in f3. One warning main4(); // not enough slevel in main4. No warning main5(); // no need for slevel, because we do not fuse on return instr main6(); main7(); main8(); main9(); } frama-c-20.0-Calcium/tests/value/statement_contract.i0000666000000000000000000000043613571573400017547 0ustar int A; /*@ behavior test: assumes A == 0; ensures \result == 3; behavior test2: // invalid assumes \false; ensures \result == 0; */ int main() { int d; d=4; /*@ requires d>0; assigns d; ensures d==3; behavior foo: assumes d == 0; ensures d == 42; */ d=3; return d; } frama-c-20.0-Calcium/tests/value/static.i0000666000000000000000000000050713571573400015134 0ustar int * f (void) { static int x; return &x; } int GLOB={{{{0}}}}; char T[10]={0}; int IT[10]={0}; int G; char H; int R; int volatile *p; int a[2]={77}; int Rv=99; int main() { *(f()) = 3; R = *f(); GLOB = sizeof main (); G = *((int*)&(T[1])); H = *((char*)&(IT[9])); p = &a; Rv = *p; return T[0]; } frama-c-20.0-Calcium/tests/value/strange.i0000666000000000000000000000022013571573400015300 0ustar int GG; int f (void) { int G; G = 2; GG = 3; return 1; } int main (void) { int lm = 77; int res_f = f(); GG = lm; return 0; } frama-c-20.0-Calcium/tests/value/strings.i0000666000000000000000000000411713571573400015337 0ustar /* run.config* GCC: STDOPT: #"-main main1 -eva-no-builtins-auto" STDOPT: #"-main main6 -eva-no-builtins-auto" STDOPT: #"-main main7 -eva-no-builtins-auto" STDOPT: #"-main main8 -slevel-function strcmp:50 -eva-no-builtins-auto" */ char s1[]="hello\000 world"; char s2[]="hello"; char *s5, *s6; int u(void); char cc = 'a'; char Q, R, S, T, U, V, W, X, Y, Z; char *strcpy(char*dst, char*src) { char* ldst=dst; /*@ loop pragma UNROLL 20; */ while (*ldst++ = *src++) ; return dst; } unsigned int strlen(char *s) { unsigned int l=0; /*@ loop pragma UNROLL 20; */ while(*s++ != 0) l++; return l; } int main1(void) { char *p; p = &s1[3]; if (u()) R=*(p-4); p = &s1[3]; if (u()) S=*(p+12); if (u()) p = &s1[5]; else p = &s2[3]; if (u()) T=*(p-4); { char a[10] = "Not ok"; char b [5]; if (u()) strcpy(b,a); } s1[3]=cc; s1[6]=cc; return strlen(s1); } char *s3="tutu"; char *s4="tutu"; char *s7="hello\x00 world"; char *s8="hello"; int main6(void) { char *s; s = "toto"; cc = *s; if (u()) R = (s3 == s4); if (u()) S = (s1 == s2); if (u()) T = (s1 == s3); if (u()) U = (s7 == s8); if (u()) V = (s7 == s4); if (u()) W = (s7 + 1 == s8 + 1); if (u()) X = (s3 == s3); s5 = (u()?s3:s8); if (u()) Y = ((u()?s3:s8) == s5); s6 = (u()?(u()?s3:s8):s4); if (u()) Z = (s5 == s6); if (u()) Q = ("oh, hello"+4 == s7); return cc; } int main7(int d, int e, int f) { char c=-1; if (d) s5 = s3; else s5 = &c; *(f ? s5 + 2 : &c) = 'T'; R=c; *s5=' '; if (e) s6 = s3+1; else s6 = &c; *s6=cc; c=*s4; return c; } int strcmp(const char *s1, const char *s2) { if (s1 == s2) return (0); while (*s1 == *s2++) if (*s1++ == '\0') return (0); return (*(unsigned char *)s1 - *(unsigned char *)--s2); } //@ assigns p[0..s-1]; ensures \initialized(&p[0..s-1]); void assigns(char *p, unsigned int s); int main8() { char tc[30]; char long_chain[] = "really really really long chain"; assigns(&tc[0],30); int x = strcmp(long_chain, tc); return x; } frama-c-20.0-Calcium/tests/value/strings_cond.i0000666000000000000000000000020613571573400016335 0ustar void foo(char const *s) { Frama_C_dump_each(); while(*s) { Frama_C_show_each_s(s); s++; } } void main(void) { foo("Bla"); } frama-c-20.0-Calcium/tests/value/struct.i0000666000000000000000000000201413571573400015164 0ustar int f (int a, int b){ int w; struct t1 { int x; int y;} v1,v2; v1.x = w; if (w) w=1; v1=v2; if (v1.y) v1.x = a; v1.y = b; a = b; return v1.x; } int GG; int simple (int a, int b){ int w=3; struct t1 { int x; int y;} v1,v2; v2.x=3; v2.y=5; v1=v2; return v1.x; } int less_simple (int a, int b){ int w=3; struct t1 { int x; int y;} v1,v2,v3; v2.x=3; v2.y=5; v3.x=7; v3.y=9; v1=a?v2:v3; return v1.x; } int w; struct t1 { int x; int y;} v1; struct t1 v2; struct t2 { int x; int y;} v3; int T[2] = { 1, 1 }; int R1, R2; int main (int a, int b){ R1 = 1 + *(int*)((char*)T+2); *(char*)T = 2; R2 = 1 + T[0]; v1 = v2; v1.x = a+b; w = v1.x; if (a) { v2.x = a; /* v3.x = b; w = w + v2.x + v3.x;*/ } return w; } int fonc2 (int a, int b){ int w; struct t1 { int x; int y;} v1; v1.x = a+b; w = v1.x; return w; } void mune (int a, int b){ v1=v2; v1.x = a; } int G; void mtwo (int c1,int c2) { if (c1) v1.x = G; v1.y = v1.x; } frama-c-20.0-Calcium/tests/value/struct2.i0000666000000000000000000001434713571573400015262 0ustar /* run.config* GCC: STDOPT: #"-main f_precis -absolute-valid-range 0x1000-0x2000" */ struct st1 { int a; int *b; }; struct st2 { int a; int d[10]; struct st1 b; struct st1 e[10]; struct st2 *c; }; struct st1 tabst[10], tabst2[10]; struct st2 tab_s[2]; struct st2 tab_s1[2]; struct st2 tab_s2[2]; struct st2 tab_s3[2]; struct st2 tab_s4[2]; struct st2 s1,s2,s4,s5,s6; struct st1 s8,s7; typedef int Ttabl[5+5]; Ttabl tabl; int tab1[2]; int tab2[2]; int tab3[2]; int tab4[2]; int tab5[2]; int tab6[2]; int *p, *p2, *p3, *p4, *p5, *p6, *p7; int **q,**r,**s,**t; int a,b; volatile int v; void f_precis(int x, int i, int j, int k, int l, int m, int y){ /* --------------------------- */ /* Scalaires */ /* --------------------------- */ a = i; /* --------------------------- */ /* Structures */ /* --------------------------- */ s1 = s2; s1.a = x; s1.b.a = x; s1.b = s8; s7 = s6.b; /* --------------------------- */ /* Tableaux */ /* --------------------------- */ tab1[0] = 2; tab1[1] = 2; tab2[i] = 2; tab3[i+j] = k; if (v) { tab4[tab2[i]] = 2; } tab5[tab2[1]] = 2; tab6[tab2[i]+j] = 2; /* --------------------------- */ /* Tableaux de structures */ /* --------------------------- */ tab_s[0] = s2; /* @tab_s[0...] */ tab_s[1].a = x; tab_s1[i].b = s8; /* @tab_s[?,b...] */ tab_s2[tabl[0]] = s1; /* @tab_s[?...] */ tab_s3[tabl[1]].a = x; tab_s4[tabl[i]+y].a = x; /* --------------------------- */ /* Structures et tableaux */ /* --------------------------- */ s1.d[1] = x; s2.d[i] = x; /* --------- */ /* Pointeurs */ /* --------- */ p = &a; *p = x; *p = *p + x; q = (int*)0x1000; r = (int*)0; *q = p; if (v) **r = a; p2 = &tab1[2]; p3 = &tab1[i]; if (v) b = *(p3+2); p4 = p; p5 = (int *) 0x1000; p6 = (int*)0x1010; *p6 = *(int *) 0x1020 + i; p7 = p2 + 1; /* p8 = p2 - i; */ s = (int*)0x1030; *s = (int *) 0x1040; t = (int*)0x1050; (*t)[i] = 2; /* --------- */ s8.b = &a; *(s8.b) = x; s1.c = &s2; s1.c->a = x; s1.c->b = s8; s1.c->b.a = x; s1.c->b.b = &a; *(s1.c->b.b) = x; s1.c->c = &s2; s1.c->c->a = x; s1.c->c->b = s8; s1.c->c->b.a = x; s1.c->c->b.b = &a; *(s1.c->c->b.b) = x; s1.c->c->c = &s2; s1.c->c->c->a = x; s4.e[tabst[tab1[i+j]].a].a = *((char*)(tab2[k] + s5.e[tabst2[tab3[l] + m].a].b)+0x1060); /*------------------------------*/ /* Clauses From attendues */ /*------------------------------*/ /* Clause From : @a[] From @i[*]; */ /* Clause From : @s1[] From @s2[...]; */ /* Clause From : @s1[a] From @x[*]; */ /* Clause From : @s1[b,a] From @x[*]; */ /* Clause From : @s1[b] From @s8[...]; */ /* Clause From : @s7 From @s6[b...]; */ /* Clause From : @tab1[(0)] From ; */ /* Clause From : @tab1[(1)] From ; */ /* Clause From : @tab2[(?)] From @i[*],@tab2[(?)]; */ /* Clause From : @tab3[(?)] From @i[*],@j[*],@k[*],@tab3[(?)]; */ /* Clause From : @tab4[(?)] From @tab2[(?),*],@i[*],@tab4[(?)]; */ /* Clause From : @tab5[(?)] From @tab2[(2),*],@tab5[(?)]; */ /* Clause From : @tab6[(?)] From @tab2[(?),*],@i[*],@j[*],@tab6[(?)]; */ /* Clause From : @tab_s[(0)] From @s2[...]; */ /* Clause From : @tab_s[(1),a] From @x[*]; */ /* Clause From : @tab_s1[(?),b] From @i[*],@s8[...],@tab_s1[(?)]; */ /* Clause From : @tab_s2[(?)] From @tabl[(0),*],@s1[...],@tab_s2[(?)]; */ /* Clause From : @tab_s3[(?),a] From @tabl[(1),*],@x[*],@tab_s3[(?)]; */ /* Clause From : @tab_s4[(?),a] From @tabl[(?),*],@i[*],@x[*],@x[*],@tab_s4[(?)]; */ /* Clause From : @s1[d,(1)] From @x[*]; */ /* Clause From : @s2[d,(?)] From @i[*],@x[*],@s2[d,(?)]; */ /* Clause From : @p[] From @a[]; */ /* Clause From : @p[*] From @x[*]; */ /* Clause From : @p[*] From @p[*][*],@x[*]; */ /* Clause From : @q[*] From @p[*]; */ /* Clause From : @r[*][*] From @a[*]; */ /* Clause From : @p2[] From @tab1[(2)]; */ /* Clause From : @p3[] From @tab1[(?)],@i[*]; */ /* Clause From : @p4[] From @p[*]; */ /* Clause From : @p5[] From @Pt!4096[*]; */ /* Clause From : @p6[*] From @Pt!4096[*][*],@i[*]; */ /* Clause From : @s[*] From @Pt!4096[*]; */ /* Clause From : @t[*][*][(?)] From @i[*],@t[*][*][(?)]; */ /* Clause From : @s8[b] From @a[]; */ /* Clause From : @s8[b,*] From @x[*]; */ /* Clause From : @s1[c] From @s2[]; */ /* Clause From : @s1[c,*][a] From @x[*]; */ /* Clause From : @s1[c,*][b] From @s8[...]; */ /* Clause From : @s1[c,*][b,a] From @x[*]; */ /* Clause From : @s1[c,*][b,b] From @a[]; */ /* Clause From : @s1[c,*][b,b,*] From @x[*]; */ /* Clause From : @s1[c,*][c] From @s2[]; */ /* Clause From : @s1[c,*][c,*][a] From @x[*]; */ /* Clause From : @s1[c,*][c,*][b] From @s8[...]; */ /* Clause From : @s1[c,*][c,*][b,a] From @x[*]; */ /* Clause From : @s1[c,*][c,*][b,b] From @a[]; */ /* Clause From : @s1[c,*][c,*][b,b,*] From @x[*]; */ /* Clause From : @s1[c,*][c,*][c] From @s2[]; */ /* Clause From : @s1[c,*][c,*][c,*][a] From @x[*]; */ /* Clause From : @s4[e,(?),a] From */ /* @tabst[(?),a,*],@tab1[(?),*],@i[*],@j[*],@s5[e,(?),b,*][(?),*], */ /* @tab2[(?),*],@k[*],@tabst2[(?),a,*],@tab3[(?),*],@l[*],@m[*],@s4[e,(?)]; */ } static void fonc (int * p, int x) { *(p+3) = *p + x; } int Tab[10]; int * P; void f_tab_0 (int y) { fonc (Tab, y); } void f_tab_2 (int y) { fonc (Tab+2, y); } void f_p_0 (int y) { fonc (P, y); } void f_p_2 (int y) { fonc (P+2, y); } void g (int * p) { *p = *p+1; } int test_g (void) { int x = 3; g (&x); return x; } frama-c-20.0-Calcium/tests/value/struct3.i0000666000000000000000000000125313571573400015253 0ustar /* run.config* STDOPT: +"-eva-warn-key garbled-mix" */ struct st1 { int a; int *b; }; struct st2 { int a; int d[10]; struct st1 b; struct st1 e[10]; struct st2 *c; }; struct st1 tabst[10], tabst2[10]; struct st2 tab_s[2]; struct st2 tab_s1[2]; struct st2 tab_s2[2]; struct st2 tab_s3[2]; struct st2 tab_s4[2]; struct st2 s1,s2; struct st1 s8,s7; volatile int v; void main () { s1.a=2; s1.c = &s1; s1.d[0] = 1; s1.d[1] = 2; s1.d[2] = 2; s1.b.a = 3; s1.d[8] = 2; s1.d[9] = 2; if (v) s1.d[10] = 2; s2 = s1; // Creates a garbled mix internally; make sure not to log it s2.a = (int) (s2.c + (int) s2.c); // creates a garbled mix in the struct } frama-c-20.0-Calcium/tests/value/struct_array.i0000666000000000000000000000203213571573400016362 0ustar /* run.config* STDOPT: +" -then -unsafe-arrays" */ volatile v; struct st1 { int a; int b; int *pp; int *p; }; int *outp; int x,y,z1,z2,z3,z4; struct st1 T[22] = { {1,2,0,&x}, {(int)&z1,(int)&z2,&z3,&y},{(int)&z4,2,0,&x},{1,2,0,&x} }; struct S { int a; int t[7]; int b; }; struct S s = { 1, 2, 3, 4, 5, 6, 7, 8, 9}, s1, s2, s3; //@ assigns s->t[5..] \from \nothing; // Must not write on a or b void f1(struct S *s); //@ assigns s->t[..2] \from \nothing; // Must not write on a or b void f2(struct S *s); //@ assigns s->t[..] \from \nothing; // Must not write on a or b void f3(struct S *s); void main1 () { outp = T[v].p; *outp = 5; z1++; } void main2() { // Semantics of ACSL [..] in Trange Frama_C_show_each(s); s1 = s; f1(&s1); Frama_C_show_each(s1); s2 = s; f2(&s2); Frama_C_show_each(s2); s3 = s; f3(&s3); Frama_C_show_each(s3); if (v) { //@ assert \valid(&s.t[..]); // True in -safe-arrays mode, false otherwise Frama_C_show_each_reach(); } } void main() { main1(); main2(); } frama-c-20.0-Calcium/tests/value/struct_call.i0000666000000000000000000000122213571573400016157 0ustar /* run.config* STDOPT: #"-machdep x86_32" STDOPT: #"-machdep ppc_32" */ int G= 77; int GG; struct A { int x; int y; }; struct B { int z; int t; }; struct A t[4]; struct A tt[5]; int g(struct A s) { Frama_C_show_each_G(s); return s.y; // (*((struct B*)(&t[1]))).t; } struct A create_A() { struct A r={0,0}; r.x = 1; // r.y = 2; Frama_C_show_each_GG(r); return r; } int main1(void) { int i = 2 - 1; t[1].y = G; GG = g(tt[i]); struct A init = create_A(); return g(t[i]); } struct CC { short c1; char * c2; }; extern struct CC C; void h(struct CC c) { Frama_C_show_each(c.c1, c.c2); } void main() { main1(); h(C); } frama-c-20.0-Calcium/tests/value/struct_deps.i0000666000000000000000000000047113571573400016204 0ustar struct Tstr { int a; int b; }; int f (struct Tstr * ps) { return ps->a; } int f3(int*p) { return *p ;} int main (int x, int y) { struct Tstr s = {x, y}; // return f3(&s); return f(&s); } int f2 (struct Tstr s) { return s.a; } int main2 (int x, int y) { struct Tstr s = {x, y}; return f2(s); } frama-c-20.0-Calcium/tests/value/struct_incl.i0000666000000000000000000000111713571573400016174 0ustar struct st1 { int a; long b; }; struct st2 { int a; int d[10]; struct st1 b; struct st1 e[10]; struct st2 *c; }; struct st1 tabst[10], tabst2[10]; struct st2 tab_s[2]; struct st2 tab_s1[2]; struct st2 tab_s2[2]; struct st2 tab_s3[2]; struct st2 tab_s4[2]; struct st2 s1,s2,s4,s5,s6; struct st1 s8,s7; long x,y,z,t; volatile int v; void main () { x = (long) &s1.d[9]; y = (long) &s1.d[10]; z = (long) &s1.b; s1.a=2; s1.c = &s1; s1.d[0] = 2; s1.d[1] = 2; s1.d[2] = 2; s1.b.a = 3; s1.d[5] = 7; s1.d[8] = 8; s1.d[9] = 8; if (v) s1.d[10] = 777; } frama-c-20.0-Calcium/tests/value/struct_p_call.i0000666000000000000000000000022213571573400016475 0ustar typedef struct S {char v; int w;} U; void f(U* G1) { G1->w = 0; G1->v = 1; return; } char main () { U H1; f(&H1); return H1.v; } frama-c-20.0-Calcium/tests/value/strucval.c0000666000000000000000000000113513571573400015500 0ustar /* run.config* */ typedef enum { BDP_BITE_NORMAL, BDP_BITE_ANORMAL, BDP_BITE_TRUC } BDP_Te_FunctionCode; typedef struct { BDP_Te_FunctionCode FunctionCode; unsigned short int MachineNumber; /* machine number */ unsigned long int Line; /* line number*/ } BDP_Ts_SharedData; #define BNR_Ct_MachineNumber 1456 //@ assigns \nothing; extern void h(const BDP_Ts_SharedData sd); void main() { BDP_Ts_SharedData SharedData; SharedData.FunctionCode = BDP_BITE_NORMAL; SharedData.MachineNumber = BNR_Ct_MachineNumber; SharedData.Line = __LINE__; h(SharedData); } frama-c-20.0-Calcium/tests/value/subset.c0000666000000000000000000000373413571573400015151 0ustar #include "__fc_define_file.h" int t[10]; FILE __fc_fopen[512]; const FILE* _p__fc_fopen = __fc_fopen; /*@ assigns \result \from filename[..],mode[..], _p__fc_fopen; ensures \result==\null || \subset(\result, &__fc_fopen[0 .. 512-1]); */ FILE *fopen(const char * restrict filename, const char * restrict mode); /*@ assigns \result \from filename[..],mode[..], _p__fc_fopen; ensures \result==\null || (\result \in &__fc_fopen[0 .. 512-1]) ; */ FILE *fopen2(const char * restrict filename, const char * restrict mode); void main1(int i, int j) { //@ assert \subset(&t[i], &t[..]); //@ assert !\subset(&t[0..5], &t[1..6]); //@ assert i >= 5 ==> !\subset(&t[i], &t[0..4]); // assert i == 6 && j == 5; if (i >= j) { //@ assert \subset(&t[0..j], &t[0..i]); } FILE* p = fopen ("bla", 0); //@ assert p == \null || \valid(p); p = fopen2 ("bli", 0); //@ assert p == \null || \valid(p); } volatile v; void main2() { int x = 1; int y = 1; int z = x; //@ assert \subset(z, \union(x, y)); // Test coercion int -> set } void main3() { int a[10], b[300]; a[v] = v; b[v] = v; //@ assert \initialized(&a[0..9]); //@ assert \initialized(&b[0..299]); //@ assert \subset(a[0..8], 5); // Reduction succeeds int z = v; //@ assert -10 <= z <= 10; //@ assert \subset(b[0..100], z); // Reduction succeeds //@ assert \subset(b[50..260], z/2); // Reduction fails: not enough plevel } void main4() { int a[10]; a[v] = v; //@ assert \initialized(&a[0..9]); //@ assert a[5] == 5; int k = v; //@ assert 4 <= k <= 8; //@ assert \subset(a[0..9], k); // Reduction //@ assert \subset(a[0..9], k); //Still not true, because k is not a singleton if (v) { //@ assert k == 6; //@ assert \subset(a[0..4], k); // Reduction //@ assert OK: \subset(a[0..4], k); // True //@ assert KO: \subset(a[0..9], k); // Reduces to bottom (currently evaluates to true) } } void main() { main1(v, v); main2(); main3(); main4(); } frama-c-20.0-Calcium/tests/value/summary.i0000666000000000000000000000364013571573400015343 0ustar /* run.config* STDOPT: +"-eva-msg-key=summary -main minimalist" STDOPT: +"-eva-msg-key=summary -main minimal" STDOPT: +"-eva-msg-key=summary -main bottom" STDOPT: +"-eva-msg-key=summary -main main" STDOPT: +"-rte -eva-msg-key=summary -main main" */ /* Tests the summary on the smallest possible program. */ void minimalist (); void minimal () {} /* Sure alarm and non-terminating function. */ void bottom () { int x = 10 / 0; } volatile int undet; volatile double volatile_d; /* Tests the summary on most kinds of alarms. */ void alarms () { int x = 0, y = 0; int *p, *q; int t[10] = {0}; p = &x + undet; x = *p; // invalid read memory access p = &x + undet; *p = x; // invalid write memory access x = t[undet]; // out of bound index + uninitialized read x = 100 / undet; // division by zero x = undet + undet; // overflow x = undet << undet; // invalid shift double d = volatile_d; d = d - d; // nan and infinite floating-point value x = (int) d; // invalid cast from floating-point to integer p = undet ? &x : &y; q = undet ? &y : &x; if (undet) x = p - q; // invalid pointer comparison if (p < q) x = 0; // invalid pointer comparison if (undet) { int z; p = &z; // eva warning about escaping z } x = *p; // dangling pointer } void f(void); void g(void); /* 1 valid assertion, 1 unknown assertion, 1 invalid assertion. */ void logic () { /*@ assert \true; */ /*@ assert undet == 0; */ if (undet) /*@ assert \false; */ ; } // 2 kernel warnings, 1 eva warning, no error. void main () { alarms (); logic (); f(); // kernel warning: no specification for function f g(); // kernel warning: no specification for function g } /* Assertions in this function should not appear in the summary. */ void dead () { /*@ assert \true; */ /*@ assert \false; */ } frama-c-20.0-Calcium/tests/value/switch.i0000666000000000000000000000146213571573400015147 0ustar /* run.config* STDOPT: #"-float-normal" STDOPT: #"-float-normal -simplify-cfg" */ int result1, result3, result4; int result2=7; double d2; int main (int c, int d, int e, int f, double d1, long l) { switch (d) { case 1: result1 = 1; break; case 2: result1 = 2; break; case 3: result1 = 3; case 4: result1 = 4; break; } switch(c) { case 0: Frama_C_show_each_F(c); return c; case 2: return c; } switch (e) { case 0: result2 = e; } f = f ? 14 : 42; switch (f==14) { case 0: result3 = f; } switch(d1>=0.0) { case 0: d2=-d1;break; default: d2=d1; break; } switch(l) { case 0x0FFFFFFF: result4 = 1; break; case 0xFFFFFFFF: result4 = 2; break; } return 77; } frama-c-20.0-Calcium/tests/value/switch2.i0000666000000000000000000000047213571573400015231 0ustar /*run.config* STDOPT: #"-simplify-cfg" */ int f(int x) { return x+1; } extern void g(int,int); int main () { int exit_loop = 0; switch (16) { case 16: g(exit_loop++,({exit_loop++; exit_loop++;f(exit_loop);})); break; default: exit_loop = 1; break; } return 0; } frama-c-20.0-Calcium/tests/value/switch_cast.i0000666000000000000000000000147313571573400016163 0ustar extern unsigned char x; void g() { int y; x = x / 16; switch((int)x) { case 0: y = x; break; case 1: y = x * 2; break; case 2: y = x * 3; break; case 3: y = x * 4; break; case 4: y = x * 5; break; case 5: y = x * 6; break; case 6: y = x * 7; break; case 7: y = x * 8; break; case 8: y = x * 9; break; case 9: y = x * 10; break; case 10: y = x * 11; break; case 11: y = x * 12; break; case 12: y = x * 13; break; case 13: y = x * 14; break; case 14: y = x * 15; break; case 15: y = x * 16; break; case 16: y = x * 17; break; case 17: y = x * 18; break; default: break; } y += 1; Frama_C_show_each(y); } void main() { g(); } frama-c-20.0-Calcium/tests/value/symbolic_locs.i0000666000000000000000000000532413571573400016510 0ustar /* run.config* STDOPT: +"-eva-msg-key d-symblocs" */ volatile v; int t[10]; extern u[10]; void main1() { unsigned int i = v; int k = v; t[i] = 3; t[i] = t[i]+1; // The equality domain loses information here u[k] = t[i] + 2; Frama_C_dump_each(); int j = t[i] + u[k]; int *p = &t[i]; Frama_C_dump_each(); int q = *p+1; // Does not write without adding something here, because otherwise we do a copy... if (u[i]+12 < 18) { Frama_C_dump_each(); int iz = u[i]+11; } } void main2_kill_direct() { unsigned int i = v; //@ assert i <= 8; t[i] = 4; Frama_C_dump_each(); t[2] = 1; Frama_C_dump_each(); // t written, should be empty. Could be improved by // detecting we write exactly in the location stored, // and joining the current and previous value. // Can be done syntactically on the lvalue } void main3_kill_indirect() { unsigned int i = v; //@ assert i <= 8; t[i] = 4; Frama_C_dump_each(); i = 8; Frama_C_dump_each(); // i written, should be empty } void main4_scope_right() { unsigned int i = v; //@ assert i <= 8; { int x; t[i] = (int) &x; Frama_C_dump_each(); } Frama_C_dump_each(); // Should be empty, x out-of-scope } void main5_scope_lv() { int z = 1; { unsigned int i = v; //@ assert i <= 8; t[i] = z; Frama_C_dump_each(); } Frama_C_dump_each(); // Should be empty, i out-of-scope } // This function checks that we remove 'stale' dependencies in some weird cases void main6_ghost_dep() { int x = v; { int y = v, z = v, k = v; int *p = v ? &x : (v ? &y : &z); // Learn something about *p. Depends on p, x, y, z *p = v; /* Drop dependency on x. The domain does not learn this information, and *p still depends on x. */ //@ assert p != &x; // Restrict k so that we have a precise interval to constrain *p to //@ assert k <= 100; if (*p == k) { /* We have learnt something on *p through the valuation. The dependencies are now v, y, z. x must have been dropped, everywhere */ goto L; } else { while (1); } } L: // y and z have left scope, so the information on *p should have been removed Frama_C_dump_each(); // if *p was erroneously considered as depending on x, we get a crash here x = 1; } void main7_widening() { int b = 0; int c = 0; int *p = v ? &b : &c; *p = 0; while (*p <= 10000) { *p += 1; } Frama_C_show_each(*p); } void main() { // if (v) main1(); if (v) main2_kill_direct(); if (v) main3_kill_indirect(); if (v) main4_scope_right(); if (v) main5_scope_lv(); if (v) main6_ghost_dep(); if (v) main7_widening(); Frama_C_dump_each(); // empty } frama-c-20.0-Calcium/tests/value/tab.c0000666000000000000000000000115613571573400014406 0ustar //@ assigns \result \from \nothing; int any_int(void); int x=55,y=77,t[4]; void main0() { int i = any_int (); t[1] = x; t[i] = y; } void main() { int i = any_int (); t[i] = 1; t[1] = y; } int TT[5][5]={0,1,1,0,0,0,0,0,0,0,0,1}; int TTT[5][5]={1,2,3,4,5,0,0,0,0,0,1}; void main1(){ TT[5][5] =2; } /* typedef struct {int a; int b;} T; void g() { int x,y,i,t[4],*p; T s1,s2; t[i] = y; t[1] = x; s1 = s2; s1.a = s2.a; s1.b = s2.b; } int t[10][10]; int ***p, i,j,x; char **c; void g1() { // *(*(p+2)) = &i; // ***(p+i) = x; *(*(c+2)+1) = 'a'; } void h1() { *(*(*(&c+2)+1)+5) = 'a'; } */ frama-c-20.0-Calcium/tests/value/tab1.i0000666000000000000000000000020113571573400014463 0ustar int G[10] ={0}; void main (int x) { if (0 <= x) { G[0] =x; } if (0 >= x) { G[1] =x; } } frama-c-20.0-Calcium/tests/value/termination.i0000666000000000000000000000054613571573400016201 0ustar int G[10]= {0}; int X; void loop(int d) { // int *p = &d; // G[1] = 6; if(d) ; else ; X=0; if(d) X=1; else L:; X=2; // while(1) { X = 2; G[2] = 77; } return; } void main(int c) { /* if (c) {loop (c);} if (c+1) {loop (c);} if (c+2) {loop (c);} if (c+3) {loop (c);} if (1) loop (0); G[2] = 5; */ // c = 1; loop(c?1:0); } frama-c-20.0-Calcium/tests/value/test.i0000666000000000000000000000075413571573400014630 0ustar /* run.config* GCC: STDOPT: #"-main inst_F6 -absolute-valid-range 0x200-0x199" STDOPT: #"-main f" */ void inst_F6(int *v,int n){ int t[3]; t[1] = 4; int i,j,ecart,tmp; { int i = 0 ; i++ ; j = i; }; for (ecart = n/2; ecart >0; ecart /=2) for (i = ecart; i < n; i++) for (j = i-ecart; j>=0 && v[j]>v[j+ecart]; j = j-ecart){ tmp = v[j]; v[j] = v[j+ecart]; v[j+ecart] = tmp; } } void f(int c) { int t[88888]; t[0] = 99; if (c) t[1] = t[100]; } frama-c-20.0-Calcium/tests/value/test_arith.c0000666000000000000000000000054413571573400016006 0ustar int t[10]; int j,k,ecart,tmp,**pptr,*ptr,*qtr,m1,m2,m3; void main(int v,int n) { t[1] = 4; pptr = &ptr; ptr = t+1; t[5] = 7+t[1]; j = t[2+3]+t[5]; j = j+1; *ptr = 0; n = n + 1; qtr = ptr + 1; k = (int)ptr + 1; ecart = &t[7] - &t[5]; } int G; void main1() { // Currently unused G=0; G = 1; *((char*)&G) = 0; G = G+1; } frama-c-20.0-Calcium/tests/value/threat_array.i0000666000000000000000000000052313571573400016330 0ustar int T [10]; int (*p)[5]; int (*q)[10]; void main (int c) { /*@ assert \valid(T + c); // synthesized alarm caused by a memory access */ /*@ assert \valid(&T); */ /*@ assert \valid(&T[0..9]); */ p = (int (*)[5])&T[5]; q = (int (*)[10])&T[5]; /*@ assert \valid(p); */ if(!c) { /*@ assert \valid(q); */ } T[c] = 4; } frama-c-20.0-Calcium/tests/value/threat_if.i0000666000000000000000000000040313571573400015605 0ustar int *p; int l,m; int i; int X=-992; int main(int i) { int G = 258+128; signed char c; if(i==0) p = &l; if(i==0) *p = 1; c = (signed char)G; // -126 G = c; Frama_C_show_each(G); return G; for (i=-1000+8; i<2008; i+=100) X = i; } frama-c-20.0-Calcium/tests/value/threat_redundant.c0000666000000000000000000000047413571573400017175 0ustar /*run.config* STDOPT: +"-eva-no-builtins-auto" */ #define NULL ((void*)0) char * strchr(const char * s, int c) { for(; *s != (char) c; ++s) if (*s == '\0') return NULL; return (char *) s; } char s1[10]={'a','b','a','b','a','b','a','b','a','b'}; char *x; void main(void) { x = strchr(s1, 'c'); } frama-c-20.0-Calcium/tests/value/traces/0000777000000000000000000000000013571573400014752 5ustar frama-c-20.0-Calcium/tests/value/traces/oracle/0000777000000000000000000000000013571573400016217 5ustar frama-c-20.0-Calcium/tests/value/traces/oracle/test1.res.oracle0000666000000000000000000001051413571573400021237 0ustar [kernel] Parsing tests/value/traces/test1.c (with preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization entropy_source ∈ [--..--] g ∈ {42} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: g ∈ {5; 45} tmp ∈ {5; 45} [eva:d-traces] Trace domains: start: 0; globals = g, entropy_source; main_formals = c; {[ 0 -> initialize variable: entropy_source -> 1 1 -> initialize variable using type Library_Global entropy_source -> 2 2 -> initialize variable: g -> 3 3 -> Assign: g = 42 -> 4 4 -> initialize variable using type Main_Formal c -> 5 5 -> EnterScope: tmp -> 6 6 -> Assign: tmp = 0 -> 7 7 -> Assume: c true -> 8; Assume: c false -> 10 8 -> Assign: tmp = g -> 9 9 -> EnterScope: i -> 12 10 -> Assign: tmp = 2 -> 11 11 -> EnterScope: i -> 15 12 -> initialize variable: i -> 13 13 -> Assign: i = 0 -> 14 14 -> enter_loop -> 19 15 -> initialize variable: i -> 16 16 -> Assign: i = 0 -> 17 17 -> enter_loop -> 18 18 -> Assume: i < 3 true -> 20 19 -> Assume: i < 3 true -> 21 20 -> Assign: tmp = tmp + 1 -> 22 21 -> Assign: tmp = tmp + 1 -> 23 22 -> Assign: i = i + 1 -> 24 23 -> Assign: i = i + 1 -> 25 24 -> Assume: i < 3 true -> 27 25 -> Assume: i < 3 true -> 26 26 -> Assign: tmp = tmp + 1 -> 28 27 -> Assign: tmp = tmp + 1 -> 29 28 -> Assign: i = i + 1 -> 30 29 -> Assign: i = i + 1 -> 31 30 -> Assume: i < 3 true -> 33 31 -> Assume: i < 3 true -> 32 32 -> Assign: tmp = tmp + 1 -> 34 33 -> Assign: tmp = tmp + 1 -> 35 34 -> Assign: i = i + 1 -> 36 35 -> Assign: i = i + 1 -> 37 36 -> Assume: i < 3 false -> 39 37 -> Assume: i < 3 false -> 38 38 -> LeaveScope: i -> 41 39 -> LeaveScope: i -> 40 40 -> LeaveScope: i -> 42 41 -> LeaveScope: i -> 43 42 -> Assign: g = tmp -> 44 43 -> Assign: g = tmp -> 45 44 -> EnterScope: \result
    -> 46 45 -> EnterScope: \result
    -> 48 46 -> Assign: \result
    = tmp -> 47 47 -> join -> 50 48 -> Assign: \result
    = tmp -> 49 49 -> join -> 50 ]} at 50 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: g FROM g; c \result FROM g; c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: g; tmp; i [inout] Inputs for function main: g [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization entropy_source ∈ [--..--] g ∈ {42} [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: g ∈ {5; 45} __traces_domain_return ∈ {5; 45} /* Generated by Frama-C */ extern int volatile entropy_source; /*@ requires min ≤ max; ensures \old(min) ≤ \result ≤ \old(max); assigns \result, entropy_source; assigns \result \from min, max, entropy_source; assigns entropy_source \from entropy_source; */ extern int interval(int min, int max); int g = 42; int main(int c) { int __traces_domain_return; g = 42; { int tmp; tmp = 0; if (c) { tmp = g; { int i; i = 0; /*@ assert i < 3; */ tmp ++; i ++; /*@ assert i < 3; */ tmp ++; i ++; /*@ assert i < 3; */ tmp ++; i ++; /*@ assert ¬(i < 3); */ g = tmp; { int _result_main_; _result_main_ = tmp; __traces_domain_return = tmp; } } } else { tmp = 2; { int i; i = 0; /*@ assert i < 3; */ tmp ++; i ++; /*@ assert i < 3; */ tmp ++; i ++; /*@ assert i < 3; */ tmp ++; i ++; /*@ assert ¬(i < 3); */ g = tmp; { int _result_main_; _result_main_ = tmp; __traces_domain_return = tmp; } } } } return __traces_domain_return; } frama-c-20.0-Calcium/tests/value/traces/oracle/test2.res.oracle0000666000000000000000000001227013571573400021241 0ustar [kernel] Parsing tests/value/traces/test2.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function loop <- main. Called from tests/value/traces/test2.i:18. [eva] Recording results for loop [eva] Done for function loop [eva] computing for function loop <- main. Called from tests/value/traces/test2.i:18. [eva] Recording results for loop [eva] Done for function loop [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function loop: j ∈ {4; 5} [eva:final-states] Values at end of function main: tmp ∈ {4; 5} [eva:d-traces] Trace domains: start: 0; globals = ; main_formals = c; {[ 0 -> initialize variable using type Main_Formal c -> 1 1 -> EnterScope: tmp -> 2 2 -> Assign: tmp = 0 -> 3 3 -> Assume: c true -> 4; Assume: c false -> 6 4 -> Assign: tmp = 1 -> 5 5 -> start_call: loop (true) -> 8 6 -> Assign: tmp = 2 -> 7 7 -> start_call: loop (true) -> 40 8 -> EnterScope: j -> 9 9 -> Assign: j = tmp -> 10 10 -> EnterScope: i -> 11 11 -> initialize variable: i -> 12 12 -> Assign: i = 0 -> 13 13 -> enter_loop -> 14 14 -> Assume: i < 3 true -> 15 15 -> Assign: j = j + 1 -> 16 16 -> Assign: i = i + 1 -> 17 17 -> Assume: i < 3 true -> 18 18 -> Assign: j = j + 1 -> 19 19 -> Assign: i = i + 1 -> 20 20 -> Assume: i < 3 true -> 21 21 -> Assign: j = j + 1 -> 22 22 -> Assign: i = i + 1 -> 23 23 -> Assume: i < 3 false -> 24 24 -> LeaveScope: i -> 25 25 -> LeaveScope: i -> 26 26 -> EnterScope: \result -> 27 27 -> Assign: \result = j -> 28 28 -> LeaveScope: j -> 36 36 -> finalize_call: loop -> 37 37 -> Assign: tmp = \result -> 38 38 -> LeaveScope: \result -> 39 39 -> EnterScope: \result
    -> 80 40 -> EnterScope: j -> 41 41 -> Assign: j = tmp -> 42 42 -> EnterScope: i -> 44 44 -> initialize variable: i -> 45 45 -> Assign: i = 0 -> 46 46 -> enter_loop -> 47 47 -> Assume: i < 3 true -> 48 48 -> Assign: j = j + 1 -> 49 49 -> Assign: i = i + 1 -> 50 50 -> Assume: i < 3 true -> 51 51 -> Assign: j = j + 1 -> 52 52 -> Assign: i = i + 1 -> 53 53 -> Assume: i < 3 true -> 54 54 -> Assign: j = j + 1 -> 55 55 -> Assign: i = i + 1 -> 56 56 -> Assume: i < 3 false -> 57 57 -> LeaveScope: i -> 58 58 -> LeaveScope: i -> 59 59 -> EnterScope: \result -> 60 60 -> Assign: \result = j -> 61 61 -> LeaveScope: j -> 76 76 -> finalize_call: loop -> 77 77 -> Assign: tmp = \result -> 78 78 -> LeaveScope: \result -> 79 79 -> EnterScope: \result
    -> 82 80 -> Assign: \result
    = tmp -> 81 81 -> join -> 84 82 -> Assign: \result
    = tmp -> 83 83 -> join -> 84 ]} at 84 [from] Computing for function loop [from] Done for function loop [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function loop: \result FROM j [from] Function main: \result FROM c [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function loop: j; i [inout] Inputs for function loop: \nothing [inout] Out (internal) for function main: tmp [inout] Inputs for function main: \nothing [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: __traces_domain_return ∈ {4; 5} /* Generated by Frama-C */ int main(int c) { int __traces_domain_return; { int tmp; tmp = 0; if (c) { tmp = 1; { int j; j = tmp; { int i; i = 0; /*@ assert i < 3; */ j ++; i ++; /*@ assert i < 3; */ j ++; i ++; /*@ assert i < 3; */ j ++; i ++; /*@ assert ¬(i < 3); */ { int _result_loop_; _result_loop_ = j; tmp = _result_loop_; { int _result_main_; _result_main_ = tmp; __traces_domain_return = tmp; } } } } } else { tmp = 2; { int j; j = tmp; { int i; i = 0; /*@ assert i < 3; */ j ++; i ++; /*@ assert i < 3; */ j ++; i ++; /*@ assert i < 3; */ j ++; i ++; /*@ assert ¬(i < 3); */ { int _result_loop_; _result_loop_ = j; tmp = _result_loop_; { int _result_main_; _result_main_ = tmp; __traces_domain_return = tmp; } } } } } } return __traces_domain_return; } frama-c-20.0-Calcium/tests/value/traces/oracle/test3.res.oracle0000666000000000000000000000400713571573400021241 0ustar [kernel] Parsing tests/value/traces/test3.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g ∈ {0} [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: g ∈ {4} tmp ∈ {4} __retres ∈ {5} [eva:d-traces] Trace domains: start: 0; globals = g; main_formals = c; {[ 0 -> initialize variable: g -> 1 1 -> initialize variable using type Main_Formal c -> 2 2 -> EnterScope: __retres -> 3 3 -> EnterScope: tmp -> 4 4 -> initialize variable: tmp -> 5 5 -> Assign: tmp = 4 -> 6 6 -> Assume: tmp true -> 7 7 -> Assign: g = tmp -> 8 8 -> Assign: __retres = g + 1 -> 9 9 -> EnterScope: \result
    -> 10 10 -> Assign: \result
    = __retres -> 11 ]} at 11 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: g FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: g; tmp; __retres [inout] Inputs for function main: g [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization g ∈ {0} [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: g ∈ {4} __traces_domain_return ∈ {5} /* Generated by Frama-C */ int g; int main(int c) { int __traces_domain_return; { int __retres; { int tmp; tmp = 4; /*@ assert tmp ≢ 0; */ g = tmp; __retres = g + 1; { int _result_main_; _result_main_ = __retres; __traces_domain_return = __retres; } } } return __traces_domain_return; } frama-c-20.0-Calcium/tests/value/traces/oracle/test4.res.oracle0000666000000000000000000002510613571573400021245 0ustar [kernel] Parsing tests/value/traces/test4.i (no preprocessing) [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] tests/value/traces/test4.i:9: starting to merge loop iterations [eva:alarm] tests/value/traces/test4.i:11: Warning: signed overflow. assert tmp + 1 ≤ 2147483647; [eva:alarm] tests/value/traces/test4.i:14: Warning: signed overflow. assert tmp + 1 ≤ 2147483647; [eva:alarm] tests/value/traces/test4.i:17: Warning: signed overflow. assert tmp + 1 ≤ 2147483647; [eva:alarm] tests/value/traces/test4.i:20: Warning: signed overflow. assert tmp + 1 ≤ 2147483647; [eva:alarm] tests/value/traces/test4.i:23: Warning: signed overflow. assert tmp + 1 ≤ 2147483647; [eva:alarm] tests/value/traces/test4.i:25: Warning: signed overflow. assert tmp + 1 ≤ 2147483647; [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: tmp ∈ [46..2147483647] [eva:d-traces] Trace domains: start: 0; globals = ; main_formals = c; {[ 0 -> initialize variable using type Main_Formal c -> 1 1 -> EnterScope: tmp -> 2 2 -> initialize variable: tmp -> 3 3 -> Assign: tmp = 0 -> 4 4 -> EnterScope: i -> 5 5 -> initialize variable: i -> 6 6 -> Assign: i = 0 -> 7 7 -> enter_loop -> 8 8 -> Assume: i < 100 true -> 9 9 -> Assume: i % 2 false -> 10 10 -> Assume: i % 3 false -> 11 11 -> Assume: i % 5 false -> 12 12 -> Assume: i % 7 false -> 13 13 -> Assume: i % 11 false -> 14 14 -> Assign: tmp = tmp + 1 -> 15 15 -> Assign: i = i + 1 -> 16 16 -> Assume: i < 100 true -> 17 17 -> Assume: i % 2 true -> 18 18 -> Assign: tmp = tmp + 1 -> 19 19 -> Assume: i % 3 true -> 20 20 -> Assign: tmp = tmp + 1 -> 21 21 -> Assume: i % 5 true -> 22 22 -> Assign: tmp = tmp + 1 -> 23 23 -> Assume: i % 7 true -> 24 24 -> Assign: tmp = tmp + 1 -> 25 25 -> Assume: i % 11 true -> 26 26 -> Assign: tmp = tmp + 1 -> 27 27 -> Assign: tmp = tmp + 1 -> 28 28 -> Assign: i = i + 1 -> 29 29 -> Assume: i < 100 true -> 30 30 -> Assume: i % 2 false -> 31 31 -> Assume: i % 3 true -> 32 32 -> Assign: tmp = tmp + 1 -> 33 33 -> Assume: i % 5 true -> 34 34 -> Assign: tmp = tmp + 1 -> 35 35 -> Assume: i % 7 true -> 36 36 -> Assign: tmp = tmp + 1 -> 37 37 -> Assume: i % 11 true -> 38 38 -> Assign: tmp = tmp + 1 -> 39 39 -> Assign: tmp = tmp + 1 -> 40 40 -> Assign: i = i + 1 -> 41 41 -> Assume: i < 100 true -> 42 42 -> Assume: i % 2 true -> 43 43 -> Assign: tmp = tmp + 1 -> 44 44 -> Assume: i % 3 false -> 45 45 -> Assume: i % 5 true -> 46 46 -> Assign: tmp = tmp + 1 -> 47 47 -> Assume: i % 7 true -> 48 48 -> Assign: tmp = tmp + 1 -> 49 49 -> Assume: i % 11 true -> 50 50 -> Assign: tmp = tmp + 1 -> 51 51 -> Assign: tmp = tmp + 1 -> 52 52 -> Assign: i = i + 1 -> 53 53 -> Assume: i < 100 true -> 54 54 -> Assume: i % 2 false -> 55 55 -> Assume: i % 3 true -> 56 56 -> Assign: tmp = tmp + 1 -> 57 57 -> Assume: i % 5 true -> 58 58 -> Assign: tmp = tmp + 1 -> 59 59 -> Assume: i % 7 true -> 60 60 -> Assign: tmp = tmp + 1 -> 61 61 -> Assume: i % 11 true -> 62 62 -> Assign: tmp = tmp + 1 -> 63 63 -> Assign: tmp = tmp + 1 -> 64 64 -> Assign: i = i + 1 -> 65 65 -> Assume: i < 100 true -> 66 66 -> Assume: i % 2 true -> 67 67 -> Assign: tmp = tmp + 1 -> 68 68 -> Assume: i % 3 true -> 69 69 -> Assign: tmp = tmp + 1 -> 70 70 -> Assume: i % 5 false -> 71 71 -> Assume: i % 7 true -> 72 72 -> Assign: tmp = tmp + 1 -> 73 73 -> Assume: i % 11 true -> 74 74 -> Assign: tmp = tmp + 1 -> 75 75 -> Assign: tmp = tmp + 1 -> 76 76 -> Assign: i = i + 1 -> 77 77 -> Assume: i < 100 true -> 78 78 -> Assume: i % 2 false -> 79 79 -> Assume: i % 3 false -> 80 80 -> Assume: i % 5 true -> 81 81 -> Assign: tmp = tmp + 1 -> 82 82 -> Assume: i % 7 true -> 83 83 -> Assign: tmp = tmp + 1 -> 84 84 -> Assume: i % 11 true -> 85 85 -> Assign: tmp = tmp + 1 -> 86 86 -> Assign: tmp = tmp + 1 -> 87 87 -> Assign: i = i + 1 -> 88 88 -> Assume: i < 100 true -> 89 89 -> Assume: i % 2 true -> 90 90 -> Assign: tmp = tmp + 1 -> 91 91 -> Assume: i % 3 true -> 92 92 -> Assign: tmp = tmp + 1 -> 93 93 -> Assume: i % 5 true -> 94 94 -> Assign: tmp = tmp + 1 -> 95 95 -> Assume: i % 7 false -> 96 96 -> Assume: i % 11 true -> 97 97 -> Assign: tmp = tmp + 1 -> 98 98 -> Assign: tmp = tmp + 1 -> 99 99 -> Assign: i = i + 1 -> 100 100 -> Assume: i < 100 true -> 101 101 -> Assume: i % 2 false -> 102 102 -> Assume: i % 3 true -> 103 103 -> Assign: tmp = tmp + 1 -> 104 104 -> Assume: i % 5 true -> 105 105 -> Assign: tmp = tmp + 1 -> 106 106 -> Assume: i % 7 true -> 107 107 -> Assign: tmp = tmp + 1 -> 108 108 -> Assume: i % 11 true -> 109 109 -> Assign: tmp = tmp + 1 -> 110 110 -> Assign: tmp = tmp + 1 -> 111 111 -> Assign: i = i + 1 -> 112 112 -> Assume: i < 100 true -> 113 113 -> Assume: i % 2 true -> 114 114 -> Assign: tmp = tmp + 1 -> 115 115 -> Assume: i % 3 false -> 116 116 -> Assume: i % 5 true -> 117 117 -> Assign: tmp = tmp + 1 -> 118 118 -> Assume: i % 7 true -> 119 119 -> Assign: tmp = tmp + 1 -> 120 120 -> Assume: i % 11 true -> 121 121 -> Assign: tmp = tmp + 1 -> 122 122 -> Assign: tmp = tmp + 1 -> 123 123 -> Assign: i = i + 1 -> 124 124 -> Assume: i < 100 true -> 125; join -> 136 125 -> Assume: i % 2 false -> 126; join -> 138 126 -> Assume: i % 3 true -> 127; join -> 143 127 -> Assign: tmp = tmp + 1 -> 128 128 -> Assume: i % 5 false -> 129; join -> 146 129 -> Assume: i % 7 true -> 130; join -> 151 130 -> Assign: tmp = tmp + 1 -> 131 131 -> Assume: i % 11 true -> 132; join -> 154 132 -> Assign: tmp = tmp + 1 -> 133 133 -> Assign: tmp = tmp + 1 -> 134; join -> 159 134 -> Assign: i = i + 1 -> 135; join -> 161 135 -> join -> 136 136 -> Assume: i < 100 true -> 137; join -> 163 137 -> join -> 138 138 -> Assume: i % 2 true -> 139; Assume: i % 2 false -> 141; join -> 165 139 -> Assign: tmp = tmp + 1 -> 140 140 -> join -> 142 141 -> join -> 142 142 -> join -> 143 143 -> Assume: i % 3 true -> 144; join -> 170 144 -> Assign: tmp = tmp + 1 -> 145 145 -> join -> 146 146 -> Assume: i % 5 true -> 147; Assume: i % 5 false -> 149; join -> 175 147 -> Assign: tmp = tmp + 1 -> 148 148 -> join -> 150 149 -> join -> 150 150 -> join -> 151 151 -> Assume: i % 7 true -> 152; join -> 180 152 -> Assign: tmp = tmp + 1 -> 153 153 -> join -> 154 154 -> Assume: i % 11 true -> 155; Assume: i % 11 false -> 157; join -> 183 155 -> Assign: tmp = tmp + 1 -> 156; join -> 185 156 -> join -> 158 157 -> join -> 158 158 -> join -> 159 159 -> Assign: tmp = tmp + 1 -> 160; join -> 189 160 -> join -> 161 161 -> Assign: i = i + 1 -> 162; join -> 191 162 -> join -> 163 163 -> Assume: i < 100 true -> 164; join -> 193 164 -> join -> 165 165 -> Assume: i % 2 true -> 166; Assume: i % 2 false -> 168; join -> 196 166 -> Assign: tmp = tmp + 1 -> 167 167 -> join -> 169 168 -> join -> 169 169 -> join -> 170 170 -> Assume: i % 3 true -> 171; Assume: i % 3 false -> 173; join -> 201 171 -> Assign: tmp = tmp + 1 -> 172 172 -> join -> 174 173 -> join -> 174 174 -> join -> 175 175 -> Assume: i % 5 true -> 176; Assume: i % 5 false -> 178; join -> 206 176 -> Assign: tmp = tmp + 1 -> 177 177 -> join -> 179 178 -> join -> 179 179 -> join -> 180 180 -> Assume: i % 7 true -> 181; join -> 211 181 -> Assign: tmp = tmp + 1 -> 182; join -> 213 182 -> join -> 183 183 -> Assume: i % 11 true -> 184; Assume: i % 11 false -> 187; join -> 217 184 -> join -> 185 185 -> Assign: tmp = tmp + 1 -> 186; join -> 219 186 -> join -> 188 187 -> join -> 188 188 -> join -> 189 189 -> Assign: tmp = tmp + 1 -> 190; join -> 223 190 -> join -> 191 191 -> Assign: i = i + 1 -> 192; join -> 225 192 -> join -> 193 193 -> join -> 196 196 -> join -> 201 201 -> join -> 206 206 -> join -> 211 211 -> join -> 213 213 -> join -> 217 217 -> join -> 219 219 -> join -> 223 223 -> join -> 225 225 -> Loop(4) 194 {[ 194 -> Assume: i < 100 true -> 195 195 -> Assume: i % 2 true -> 197; Assume: i % 2 false -> 199 197 -> Assign: tmp = tmp + 1 -> 198 198 -> join -> 200 199 -> join -> 200 200 -> Assume: i % 3 true -> 202; Assume: i % 3 false -> 204 202 -> Assign: tmp = tmp + 1 -> 203 203 -> join -> 205 204 -> join -> 205 205 -> Assume: i % 5 true -> 207; Assume: i % 5 false -> 209 207 -> Assign: tmp = tmp + 1 -> 208 208 -> join -> 210 209 -> join -> 210 210 -> Assume: i % 7 true -> 212; Assume: i % 7 false -> 215 212 -> Assign: tmp = tmp + 1 -> 214 214 -> join -> 216 215 -> join -> 216 216 -> Assume: i % 11 true -> 218; Assume: i % 11 false -> 221 218 -> Assign: tmp = tmp + 1 -> 220 220 -> join -> 222 221 -> join -> 222 222 -> Assign: tmp = tmp + 1 -> 224 224 -> Assign: i = i + 1 -> 226 ]} -> 228 228 -> Assume: i < 100 false -> 229 229 -> leave_loop -> 230 230 -> LeaveScope: i -> 231 231 -> LeaveScope: i -> 232 232 -> EnterScope: \result
    -> 233 233 -> Assign: \result
    = tmp -> 234 ]} at 234 [from] Computing for function main [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: tmp; i [inout] Inputs for function main: \nothing frama-c-20.0-Calcium/tests/value/traces/oracle/test5.res.oracle0000666000000000000000000006503713571573400021255 0ustar [kernel] Parsing tests/value/traces/test5.i (no preprocessing) [kernel:typing:implicit-function-declaration] tests/value/traces/test5.i:21: Warning: Calling undeclared function my_switch. Old style K&R code? [eva] Analyzing a complete application starting at main [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [kernel:annot:missing-spec] tests/value/traces/test5.i:21: Warning: Neither code nor specification for function my_switch, generating default assigns from the prototype [eva] using specification for function my_switch [eva] Done for function my_switch [eva:alarm] tests/value/traces/test5.i:21: Warning: signed overflow. assert tmp_0 + tmp ≤ 2147483647; (tmp_0 from my_switch(tmp)) [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva:alarm] tests/value/traces/test5.i:21: Warning: signed overflow. assert -2147483648 ≤ tmp_0 + tmp; (tmp_0 from my_switch(tmp)) [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] tests/value/traces/test5.i:20: starting to merge loop iterations [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] tests/value/traces/test5.i:19: starting to merge loop iterations [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] computing for function my_switch <- main. Called from tests/value/traces/test5.i:21. [eva] Done for function my_switch [eva] Recording results for main [eva] done for function main [eva] ====== VALUES COMPUTED ====== [eva:final-states] Values at end of function main: tmp ∈ [--..--] [eva:d-traces] Trace domains: start: 0; globals = ; main_formals = c; {[ 0 -> initialize variable using type Main_Formal c -> 1 1 -> EnterScope: tmp -> 2 2 -> initialize variable: tmp -> 3 3 -> Assign: tmp = 1 -> 4 4 -> EnterScope: i -> 5 5 -> initialize variable: i -> 6 6 -> Assign: i = 0 -> 7 7 -> enter_loop -> 8 8 -> Assume: i < 10 true -> 9 9 -> EnterScope: j -> 10 10 -> initialize variable: j -> 11 11 -> Assign: j = 0 -> 12 12 -> enter_loop -> 13 13 -> Assume: j < 10 true -> 14 14 -> EnterScope: tmp_0 -> 15 15 -> EnterScope: \result -> 16 16 -> CallDeclared: \result = my_switch(tmp) -> 17 17 -> Assign: tmp_0 = \result -> 18 18 -> LeaveScope: \result -> 19 19 -> Assign: tmp = tmp_0 + tmp -> 20 20 -> LeaveScope: tmp_0 -> 21 21 -> Assign: j = j + 1 -> 22 22 -> Assume: j < 10 true -> 23 23 -> EnterScope: tmp_0 -> 24 24 -> EnterScope: \result -> 25 25 -> CallDeclared: \result = my_switch(tmp) -> 26 26 -> Assign: tmp_0 = \result -> 28 28 -> LeaveScope: \result -> 29 29 -> Assign: tmp = tmp_0 + tmp -> 30 30 -> LeaveScope: tmp_0 -> 31 31 -> Assign: j = j + 1 -> 32 32 -> Assume: j < 10 true -> 33 33 -> EnterScope: tmp_0 -> 34 34 -> EnterScope: \result -> 35 35 -> CallDeclared: \result = my_switch(tmp) -> 36 36 -> Assign: tmp_0 = \result -> 38 38 -> LeaveScope: \result -> 39 39 -> Assign: tmp = tmp_0 + tmp -> 40 40 -> LeaveScope: tmp_0 -> 41 41 -> Assign: j = j + 1 -> 42 42 -> Assume: j < 10 true -> 43 43 -> EnterScope: tmp_0 -> 44 44 -> EnterScope: \result -> 45 45 -> CallDeclared: \result = my_switch(tmp) -> 46 46 -> Assign: tmp_0 = \result -> 48 48 -> LeaveScope: \result -> 49 49 -> Assign: tmp = tmp_0 + tmp -> 50 50 -> LeaveScope: tmp_0 -> 51 51 -> Assign: j = j + 1 -> 52 52 -> Assume: j < 10 true -> 53 53 -> EnterScope: tmp_0 -> 54 54 -> EnterScope: \result -> 55 55 -> CallDeclared: \result = my_switch(tmp) -> 56 56 -> Assign: tmp_0 = \result -> 58 58 -> LeaveScope: \result -> 59 59 -> Assign: tmp = tmp_0 + tmp -> 60 60 -> LeaveScope: tmp_0 -> 61 61 -> Assign: j = j + 1 -> 62 62 -> Assume: j < 10 true -> 63 63 -> EnterScope: tmp_0 -> 64 64 -> EnterScope: \result -> 65 65 -> CallDeclared: \result = my_switch(tmp) -> 66 66 -> Assign: tmp_0 = \result -> 68 68 -> LeaveScope: \result -> 69 69 -> Assign: tmp = tmp_0 + tmp -> 70 70 -> LeaveScope: tmp_0 -> 71 71 -> Assign: j = j + 1 -> 72 72 -> Assume: j < 10 true -> 73 73 -> EnterScope: tmp_0 -> 74 74 -> EnterScope: \result -> 75 75 -> CallDeclared: \result = my_switch(tmp) -> 76 76 -> Assign: tmp_0 = \result -> 78 78 -> LeaveScope: \result -> 79 79 -> Assign: tmp = tmp_0 + tmp -> 80 80 -> LeaveScope: tmp_0 -> 81 81 -> Assign: j = j + 1 -> 82 82 -> Assume: j < 10 true -> 83 83 -> EnterScope: tmp_0 -> 84 84 -> EnterScope: \result -> 85 85 -> CallDeclared: \result = my_switch(tmp) -> 86 86 -> Assign: tmp_0 = \result -> 88 88 -> LeaveScope: \result -> 89 89 -> Assign: tmp = tmp_0 + tmp -> 90 90 -> LeaveScope: tmp_0 -> 91 91 -> Assign: j = j + 1 -> 92 92 -> Assume: j < 10 true -> 93 93 -> EnterScope: tmp_0 -> 94 94 -> EnterScope: \result -> 95 95 -> CallDeclared: \result = my_switch(tmp) -> 96 96 -> Assign: tmp_0 = \result -> 98 98 -> LeaveScope: \result -> 99 99 -> Assign: tmp = tmp_0 + tmp -> 100 100 -> LeaveScope: tmp_0 -> 101 101 -> Assign: j = j + 1 -> 102 102 -> Assume: j < 10 true -> 103 103 -> EnterScope: tmp_0 -> 104 104 -> EnterScope: \result -> 105 105 -> CallDeclared: \result = my_switch(tmp) -> 106 106 -> Assign: tmp_0 = \result -> 108 108 -> LeaveScope: \result -> 109 109 -> Assign: tmp = tmp_0 + tmp -> 110 110 -> LeaveScope: tmp_0 -> 111 111 -> Assign: j = j + 1 -> 112 112 -> Assume: j < 10 false -> 113; join -> 122 113 -> LeaveScope: j -> 114 114 -> LeaveScope: j -> 115 115 -> Assign: i = i + 1 -> 116 116 -> Assume: i < 10 true -> 117 117 -> EnterScope: j -> 118 118 -> initialize variable: j -> 119 119 -> Assign: j = 0 -> 120 120 -> enter_loop -> 121 121 -> join -> 122 122 -> Assume: j < 10 true -> 123; join -> 133 123 -> EnterScope: tmp_0 -> 124; join -> 135 124 -> EnterScope: \result -> 125; join -> 137 125 -> CallDeclared: \result = my_switch(tmp) -> 126 126 -> Assign: tmp_0 = \result -> 128 128 -> LeaveScope: \result -> 129 129 -> Assign: tmp = tmp_0 + tmp -> 130; join -> 143 130 -> LeaveScope: tmp_0 -> 131 131 -> Assign: j = j + 1 -> 132; join -> 146 132 -> join -> 133 133 -> Assume: j < 10 true -> 134; join -> 148 134 -> join -> 135 135 -> EnterScope: tmp_0 -> 136; join -> 151 136 -> join -> 137 137 -> EnterScope: \result -> 138; join -> 153 138 -> CallDeclared: \result = my_switch(tmp) -> 139 139 -> Assign: tmp_0 = \result -> 141 141 -> LeaveScope: \result -> 142 142 -> join -> 143 143 -> Assign: tmp = tmp_0 + tmp -> 144; join -> 159 144 -> LeaveScope: tmp_0 -> 145 145 -> join -> 146 146 -> Assign: j = j + 1 -> 147; join -> 162 147 -> join -> 148 148 -> join -> 151 151 -> join -> 153 153 -> join -> 159 159 -> join -> 162 162 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 166; join -> 177 166 -> Assume: j < 10 false -> 167 167 -> leave_loop -> 168 168 -> LeaveScope: j -> 169 169 -> LeaveScope: j -> 170 170 -> Assign: i = i + 1 -> 171 171 -> Assume: i < 10 true -> 172 172 -> EnterScope: j -> 173 173 -> initialize variable: j -> 174 174 -> Assign: j = 0 -> 175 175 -> enter_loop -> 176 176 -> join -> 177 177 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 179; join -> 190 179 -> Assume: j < 10 false -> 180 180 -> leave_loop -> 181 181 -> LeaveScope: j -> 182 182 -> LeaveScope: j -> 183 183 -> Assign: i = i + 1 -> 184 184 -> Assume: i < 10 true -> 185 185 -> EnterScope: j -> 186 186 -> initialize variable: j -> 187 187 -> Assign: j = 0 -> 188 188 -> enter_loop -> 189 189 -> join -> 190 190 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 192; join -> 203 192 -> Assume: j < 10 false -> 193 193 -> leave_loop -> 194 194 -> LeaveScope: j -> 195 195 -> LeaveScope: j -> 196 196 -> Assign: i = i + 1 -> 197 197 -> Assume: i < 10 true -> 198 198 -> EnterScope: j -> 199 199 -> initialize variable: j -> 200 200 -> Assign: j = 0 -> 201 201 -> enter_loop -> 202 202 -> join -> 203 203 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 205; join -> 216 205 -> Assume: j < 10 false -> 206 206 -> leave_loop -> 207 207 -> LeaveScope: j -> 208 208 -> LeaveScope: j -> 209 209 -> Assign: i = i + 1 -> 210 210 -> Assume: i < 10 true -> 211 211 -> EnterScope: j -> 212 212 -> initialize variable: j -> 213 213 -> Assign: j = 0 -> 214 214 -> enter_loop -> 215 215 -> join -> 216 216 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 218; join -> 229 218 -> Assume: j < 10 false -> 219 219 -> leave_loop -> 220 220 -> LeaveScope: j -> 221 221 -> LeaveScope: j -> 222 222 -> Assign: i = i + 1 -> 223 223 -> Assume: i < 10 true -> 224 224 -> EnterScope: j -> 225 225 -> initialize variable: j -> 226 226 -> Assign: j = 0 -> 227 227 -> enter_loop -> 228 228 -> join -> 229 229 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 231; join -> 242 231 -> Assume: j < 10 false -> 232 232 -> leave_loop -> 233 233 -> LeaveScope: j -> 234 234 -> LeaveScope: j -> 235 235 -> Assign: i = i + 1 -> 236 236 -> Assume: i < 10 true -> 237 237 -> EnterScope: j -> 238 238 -> initialize variable: j -> 239 239 -> Assign: j = 0 -> 240 240 -> enter_loop -> 241 241 -> join -> 242 242 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 244; join -> 255 244 -> Assume: j < 10 false -> 245 245 -> leave_loop -> 246 246 -> LeaveScope: j -> 247 247 -> LeaveScope: j -> 248 248 -> Assign: i = i + 1 -> 249 249 -> Assume: i < 10 true -> 250 250 -> EnterScope: j -> 251 251 -> initialize variable: j -> 252 252 -> Assign: j = 0 -> 253 253 -> enter_loop -> 254 254 -> join -> 255 255 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 257; join -> 268 257 -> Assume: j < 10 false -> 258 258 -> leave_loop -> 259 259 -> LeaveScope: j -> 260 260 -> LeaveScope: j -> 261 261 -> Assign: i = i + 1 -> 262 262 -> Assume: i < 10 true -> 263 263 -> EnterScope: j -> 264 264 -> initialize variable: j -> 265 265 -> Assign: j = 0 -> 266 266 -> enter_loop -> 267 267 -> join -> 268 268 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 270; join -> 281 270 -> Assume: j < 10 false -> 271 271 -> leave_loop -> 272 272 -> LeaveScope: j -> 273 273 -> LeaveScope: j -> 274 274 -> Assign: i = i + 1 -> 275 275 -> Assume: i < 10 true -> 276; join -> 289 276 -> EnterScope: j -> 277; join -> 291 277 -> initialize variable: j -> 278 278 -> Assign: j = 0 -> 279 279 -> enter_loop -> 280 280 -> join -> 281 281 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 283; join -> 296 283 -> Assume: j < 10 false -> 284 284 -> leave_loop -> 285 285 -> LeaveScope: j -> 286; join -> 301 286 -> LeaveScope: j -> 287 287 -> Assign: i = i + 1 -> 288; join -> 304 288 -> join -> 289 289 -> Assume: i < 10 true -> 290; join -> 306 290 -> join -> 291 291 -> EnterScope: j -> 292; join -> 308 292 -> initialize variable: j -> 293 293 -> Assign: j = 0 -> 294 294 -> enter_loop -> 295 295 -> join -> 296 296 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 298; join -> 313 298 -> Assume: j < 10 false -> 299 299 -> leave_loop -> 300 300 -> join -> 301 301 -> LeaveScope: j -> 302; join -> 318 302 -> LeaveScope: j -> 303 303 -> join -> 304 304 -> Assign: i = i + 1 -> 305; join -> 321 305 -> join -> 306 306 -> Assume: i < 10 true -> 307; join -> 323 307 -> join -> 308 308 -> EnterScope: j -> 309; join -> 326 309 -> initialize variable: j -> 310 310 -> Assign: j = 0 -> 311 311 -> enter_loop -> 312 312 -> join -> 313 313 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch(tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 315; join -> 331 315 -> Assume: j < 10 false -> 316 316 -> leave_loop -> 317 317 -> join -> 318 318 -> LeaveScope: j -> 319; join -> 336 319 -> LeaveScope: j -> 320 320 -> join -> 321 321 -> Assign: i = i + 1 -> 322; join -> 339 322 -> join -> 323 323 -> join -> 326 326 -> join -> 331 331 -> join -> 336 336 -> join -> 339 339 -> Loop(10) 324 {[ 324 -> Assume: i < 10 true -> 325 325 -> EnterScope: j -> 327 327 -> initialize variable: j -> 328 328 -> Assign: j = 0 -> 329 329 -> enter_loop -> 330 330 -> Loop(16) 149 {[ 149 -> Assume: j < 10 true -> 150 150 -> EnterScope: tmp_0 -> 152 152 -> EnterScope: \result -> 154 154 -> CallDeclared: \result = my_switch( tmp) -> 155 155 -> Assign: tmp_0 = \result -> 157 157 -> LeaveScope: \result -> 158 158 -> Assign: tmp = tmp_0 + tmp -> 160 160 -> LeaveScope: tmp_0 -> 161 161 -> Assign: j = j + 1 -> 163 ]} -> 333 333 -> Assume: j < 10 false -> 334 334 -> leave_loop -> 335 335 -> LeaveScope: j -> 337 337 -> LeaveScope: j -> 338 338 -> Assign: i = i + 1 -> 340 ]} -> 343 343 -> Assume: i < 10 false -> 344 344 -> leave_loop -> 345 345 -> LeaveScope: i -> 346 346 -> LeaveScope: i -> 347 347 -> EnterScope: \result
    -> 348 348 -> Assign: \result
    = tmp -> 349 ]} at 349 [from] Computing for function main [from] Computing for function my_switch <-main [from] Done for function my_switch [from] Done for function main [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function my_switch: \result FROM x_0 [from] Function main: \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [inout] Out (internal) for function main: tmp; i; j; tmp_0 [inout] Inputs for function main: \nothing [kernel] User Error: no known last created project. [kernel] Frama-C aborted: invalid user input. frama-c-20.0-Calcium/tests/value/traces/test1.c0000666000000000000000000000111313571573400016152 0ustar /* run.config STDOPT: #"-eva-traces-domain -value-msg-key d-traces -slevel 10 -eva-traces-project" +"-then-last -val -print -value-msg-key=-d-traces" */ extern volatile int entropy_source; /*@ requires min <= max; assigns \result \from min, max, entropy_source; assigns entropy_source \from entropy_source; ensures min <= \result <= max ; */ extern int interval(int min, int max); int g = 42; int main(int c){ /* c = interval(0,1); */ int tmp; tmp = 0; if (c) tmp = g; else tmp = 2; for(int i = 0; i < 3; i++){ tmp ++; } g = tmp; return tmp; } frama-c-20.0-Calcium/tests/value/traces/test2.i0000666000000000000000000000052613571573400016170 0ustar /* run.config STDOPT: #"-eva-traces-domain -value-msg-key d-traces -slevel 10 -eva-traces-project" +"-then-last -val -print -value-msg-key=-d-traces" */ int loop(int j){ for(int i = 0; i < 3; i++){ j ++; } return j; } int main(int c){ int tmp; tmp = 0; if (c) tmp = 1; else tmp = 2; tmp = loop(tmp); return tmp; } frama-c-20.0-Calcium/tests/value/traces/test3.i0000666000000000000000000000040713571573400016167 0ustar /* run.config STDOPT: #"-eva-traces-domain -value-msg-key d-traces -slevel 10 -eva-traces-project" +"-then-last -val -print -value-msg-key=-d-traces" */ int g; int main(int c){ int tmp = 4; if(tmp){ g = tmp; } else { g = 1; } return g+1; } frama-c-20.0-Calcium/tests/value/traces/test4.i0000666000000000000000000000061013571573400016164 0ustar /* run.config STDOPT: #"-eva-traces-domain -value-msg-key d-traces -slevel 10" */ /* Test of join inside a loop */ int main(c){ int tmp = 0; for(int i = 0; i < 100; i++){ if(i % 2){ tmp ++; }; if(i % 3){ tmp ++; }; if(i % 5){ tmp ++; }; if(i % 7){ tmp ++; }; if(i % 11){ tmp ++; }; tmp++; } return tmp; } frama-c-20.0-Calcium/tests/value/traces/test5.i0000666000000000000000000000076713571573400016202 0ustar /* run.config STDOPT: #"-eva-traces-domain -value-msg-key d-traces -slevel 10" +"-then-last -val -slevel 10 -print -no-eva-traces-domain" */ /* Check the fix for the creation of expression by dataflows2 for switch (conversion to list of if) */ int myswitch(i){ switch(i){ case 0: return 0; case 1: return 1; default: return 2; } } int main(c){ int tmp = 1; for(int i = 0; i < 10; i++){ for(int j = 0; j < 10; j++){ tmp = my_switch(tmp) + tmp; } } return tmp; } frama-c-20.0-Calcium/tests/value/tricky_logic.i0000666000000000000000000000163113571573400016326 0ustar volatile int vol; char * str = "abc"; int x; int y; struct ts { int i1; int i2; }; void f1 () { //@ assert \valid_read(str); //@ assert !\valid(str); } void f2() { x = 4; y = 5; //@ assert \at(x == 2 && y == 3, Pre) && x == 4 && y == 5; //@ assert x == 4+\at(x, Init); } void f3() { //@ assert \at(x == 2, Pre) || \at(x == 3, Pre); //@ assert \at(x == 2 || x == 3, Pre); //@ assert \at(x == 2, Pre) ==> x == 2; } void g4(struct ts s) { int x = 1; s.i1 = 3; //@ assert \initialized{Pre}(&s) ==> \at(s.i1 == 1,Pre); //@ assert \initialized{Pre}(&s) ==> s.i1 == 1; } void f4() { int *p, *q; int z; p = &z; q = &x; struct ts s; if (vol) { s.i1 = 1; s.i2 = 2; } g4(s); //@ assert !\initialized{Pre}(p); //@ assert \initialized{Pre}(q); } //@ requires x==\at(x,Init)==0; void main() { f1(); x = 2; y = 3; f2(); x = vol ? 2 : 3; f3(); f4(); } frama-c-20.0-Calcium/tests/value/typedef_function.i0000666000000000000000000000020713571573400017207 0ustar typedef void T(void); extern T F476 ; static T* const G209[] = { 0,& F476}; int main () { int i = (int)G209[0]; return 0; } frama-c-20.0-Calcium/tests/value/typeof.i0000666000000000000000000000006713571573400015154 0ustar extern void y(void); void main() { (typeof(y()))0; } frama-c-20.0-Calcium/tests/value/ulongvslonglong.i0000666000000000000000000000071013571573400017076 0ustar /* run.config* OPT: -no-autoload-plugins -load-module eva,inout -eva @EVA_CONFIG@ -journal-disable -machdep x86_64 OPT: -no-autoload-plugins -load-module eva,inout -eva @EVA_CONFIG@ -journal-disable */ int x; long x2; unsigned long x9[6][2]; int main(){ x2 = 2793414595; for (int i = 0; i < 6; i++) { for (int j = 0; j < 2; j++) x9[i][j] = 1U; } x = ((0x090E7AF82577C8A6LL | x9[0][1]) <= (~(x2 || x9[0][1]))); return x; } frama-c-20.0-Calcium/tests/value/undef_behavior_bts1059.i0000666000000000000000000000104513571573400020012 0ustar /* run.config* STDOPT: #"-unspecified-access" */ /*@ assigns \nothing; */ void f(int,int); /*@ assigns \nothing; */ void g(int,int); volatile int c; int main() { int a = 1; int b = 0; if (c) if (a = b || ++a == 2) //UB (no sequence point between ++a and a=...) f(a, b); else g(a, b); b = b++ || a--; // NO UB (we first incr b, decr a, set b to the result, // with a sequence point between all operations. a = (a++,b++); // NO UB if (c) a = (b++, a++); // UB return 0; } frama-c-20.0-Calcium/tests/value/undef_fct.i0000666000000000000000000000003713571573400015600 0ustar int main() { return f(3); } frama-c-20.0-Calcium/tests/value/undefined_sequence.i0000666000000000000000000000242413571573400017476 0ustar /* run.config* STDOPT: #"-unspecified-access" STDOPT: #"-no-unspecified-access" */ /* detection of undefined behavior for read/write accesses in unspecified order */ int G[10]; volatile int c; int f (int x) { return x+1;} int g (int x) { return x+2;} int r, H; int h(int i) { if (c) r = r++; //UB i = r++; //Not UB H = i; return i; } int func(int x, int y) { return x + y; } //volatile int c; int ub_ret(void) { int d = 5; return d + (d=0); // UB } int main (int a) { int x, *y, i,j; x = 0; y = &x; if (c) i=(x=0)+(*y=1); // UB for (i=0; i < 10; i++) G[i] = i; i=j=0; while (j<10 && i<10) G[j++] = G[i++]; i=j=0; while (j<10 && i<10) G[j++] += G[i++]; i=j=0; if (c) { while(j<9 && i<9) { if (c) G[j] = G[j++]; // UB if (c) G[i++] = G[i]; // UB }} i=j=0; if (c) { while(j<9 && i<9) { if (c) G[j] += G[j++]; // UB if (c) G[i++] += G[i]; // UB }} if (c) i = f(g(3)+x) + x++; //UB *y = f(g(3)+x); // no UB: x is read to write to x (through an alias) if (a) r = h(1) + h(2); // missing alarm! y = &G[2]; *y = (G[2] < (func((0U || (((G[2] ^ G[2]) <= G[2]) < ((*y) || G[2]))), 5))); int (*my_f) (int) = f; if (c) G[9] = ub_ret(); return (c ? (my_f=g, f(1)) + my_f(2) : 0); } frama-c-20.0-Calcium/tests/value/undefined_sequence2.i0000666000000000000000000000254713571573400017566 0ustar /* run.config* STDOPT: #"-unspecified-access" */ /* based on an example from J. Regehr on the why list */ /* precondition: false */ int a[2]; volatile int foo; int multiple_update_wrong_1 (int *x, int *y) { return (*x = 0) + (*x = 0); } /* precondition: false */ int multiple_update_wrong_2 (int i) { i = ++i + 1; return i; } /* precondition: false */ int multiple_update_wrong_3 (int i) { a[i++] = i; return i; } /* precondition: x != y */ int multiple_update_unsafe (int *x, int *y) { return (*x = 0) + (*y = 0); } /* precondition: true */ int multiple_update_safe (int *x, int *y) { if (x == y) { return 0; } else { return (*x = 0) + (*y = 0); } } int main () { int b,c; b = 0; c = 0; if (foo) { multiple_update_wrong_1(&b, &c); Frama_C_show_each_passed1(); } if (foo) { multiple_update_wrong_2(b); Frama_C_show_each_passed2(); } if (foo) { multiple_update_wrong_3(c); Frama_C_show_each_passed3(); } if (foo) { multiple_update_unsafe(&b,&c); /* does not lead to an alarm */ Frama_C_show_each_passed4(); } if (foo) { multiple_update_unsafe(&b, &b); Frama_C_show_each_passed5(); } if (foo) { multiple_update_safe(&b,&c); /* does not lead to an alarm */ Frama_C_show_each_passed6(); } if (foo) { multiple_update_safe(&c,&c); /* does not lead to an alarm */ Frama_C_show_each_passed7(); } return 0; } frama-c-20.0-Calcium/tests/value/uninit.i0000666000000000000000000000005413571573400015150 0ustar int main () { int i; i++; return i; } frama-c-20.0-Calcium/tests/value/uninit_callstack.i0000666000000000000000000000036213571573400017173 0ustar /* run.config* OPT: -no-autoload-plugins -load-module eva -eva @EVA_CONFIG@ -eva-no-show-progress -eva-print-callstacks -journal-disable -no-results */ int *p, x; void f(void) { if (*p) x = 1; } int main(){ int a; p = &a; f(); } frama-c-20.0-Calcium/tests/value/uninitialized_gnubody.i0000666000000000000000000000012113571573400020234 0ustar int main () { int x = 0; x = ({ int y = 0; y++; y + 1;}) + 42; return x; } frama-c-20.0-Calcium/tests/value/unknown_sizeof.i0000666000000000000000000000105713571573400016724 0ustar /* run.config* OPT: -no-autoload-plugins -load-module eva -eva @EVA_CONFIG@ -main main1 OPT: -no-autoload-plugins -load-module eva -eva @EVA_CONFIG@ -main main2 */ struct s; struct s s; void f(struct s) { // Argument has unknown size return; } struct s g() { return *(struct s*)((char*)(&s)+1); // Return has unknown size } void main1() { g(); // We used to not stop on this line because the return code was not used, but now we do // struct s r; r = g(); // now syntactically rejected } void main2() { f(*(struct s*)((char*)(&s)+1)); } frama-c-20.0-Calcium/tests/value/unop.c0000666000000000000000000000054513571573400014622 0ustar void main1(float f) { Frama_C_show_each_1(f); if (-f >= 3.) { Frama_C_show_each_1_then(f); } else { Frama_C_show_each_1_else(f); } } void main2(int i) { Frama_C_show_each_2(i); if (-i >= 3) { Frama_C_show_each_2_then(i); } else { Frama_C_show_each_2_else(i); } } volatile v; void main() { main1((float)v); main2(v); } frama-c-20.0-Calcium/tests/value/unroll.i0000666000000000000000000000306713571573400015164 0ustar enum { NB_TIMES=12, FIFTY_TIMES = 50 }; void main (int c) { int G=0,i; int MAX = 12; int JMAX=5; int j,k,S; /*@ loop pragma UNROLL 14; */ // first loop unrolled 14 times for (i=0; i<=MAX; i++) { G+=i; } /*@ loop pragma UNROLL 124; */ for (i=0; i<=10*MAX; i++) { G+=i; } /*@ loop pragma UNROLL 12+2; */ // loop unrolled 14 times for (i=0; i<=MAX; i++) { j=0; /*@ loop pragma UNROLL FIFTY_TIMES; */ while (j<=JMAX) { G+=i; j++; } } //@ loop pragma UNROLL 128*sizeof(char); do { G += i; i++; j--; } while (i<=256 || j>=0); //@ loop pragma UNROLL 10; do { if(c) continue; if(c--) goto L; c++; L: c++; } while(c); //@ loop pragma UNROLL c; while(0); S=1; k=1; //@ loop pragma UNROLL "completly", NB_TIMES; do { S=S*k; k++; } while (k <= NB_TIMES) ; } #if 0 struct T { unsigned long long addr; unsigned long long size; unsigned long type; } t_biosmap[10]; struct T * const g_biosmap = t_biosmap; struct T * biosmap; int main2(int c,signed char nr_map) { biosmap = g_biosmap; if (nr_map<2) return (-1); //@ loop pragma UNROLL 200; do { unsigned long long start = biosmap->addr; unsigned long long size = biosmap->size; unsigned long long end = start + size; unsigned long type = biosmap->type; Frama_C_show_each_F(nr_map); if (start>end) return -1; if (c) { start = 0x100000L; size = end - start; continue; }; } while (biosmap++,--nr_map); return 0; } #endif frama-c-20.0-Calcium/tests/value/unroll_simple.i0000666000000000000000000000044213571573400016527 0ustar void main (int c) { int G=0,i=4; int MAX = 12; int JMAX=5; int j=3; //@ loop pragma UNROLL 128; do { G += i; i++; j--; } while (i<=256 || j>=0); //@ loop pragma UNROLL 10; do { if(c) continue; if(c--) goto L; c++; L: c++; } while(c); } frama-c-20.0-Calcium/tests/value/unsigned_overflow.c0000666000000000000000000000030213571573400017367 0ustar extern unsigned int i1, i2; int main(int c) { //@ assert i1 > 10; //@ assert i2 > 10; unsigned int v = i1 + i2; if (c) { unsigned int w = -i1; Frama_C_show_each_dead (); } } frama-c-20.0-Calcium/tests/value/use_spec.i0000666000000000000000000000071513571573400015454 0ustar /* run.config* OPT: -no-autoload-plugins -load-module from,inout,eva -eva-use-spec f,h -eva @EVA_CONFIG@ -inout -calldeps OPT: -no-autoload-plugins -load-module from,inout,eva -eva-use-spec f,h -eva @EVA_CONFIG@ -inout -calldeps -show-indirect-deps */ void f(int *x) { } void g(int *y); //@ assigns *z \from \nothing; void h(int *z) { } //@ assigns *w \from \nothing; void i(int *w); int w, x, y, z; void main() { f(&x); g(&y); h(&z); i(&w); } frama-c-20.0-Calcium/tests/value/user_assertion_uninit_var.i0000666000000000000000000000027313571573400021150 0ustar void main(void) { int i,n,x; for(i = 0; i < 10; i++) { n = i; } /*@ assert 0 <= n <= 9; */ // only to show that n may be uninitialized at this point if (n) x = 0; else x = 1; } frama-c-20.0-Calcium/tests/value/usp.i0000666000000000000000000000075213571573400014456 0ustar int a = -12; int b; unsigned int *p=&a; unsigned int *q=&b; int X, Y, Z, T; int main(int c){ b = c ? -1 : 5; if (*p == 3) X = *p; else Y = *p; if (*q == ((unsigned int)-1)) // Evaluating this condition changes the value of b to a set of unsigned values. This is not ideal, but not really problematic either, as we always recast binary representations to the good type. Z = *q; else T = *q; Frama_C_show_each(b); Frama_C_dump_each(); b = b+0; return 0; } frama-c-20.0-Calcium/tests/value/va_list.c0000666000000000000000000000042313571573400015275 0ustar /*run.config* STDOPT: STDOPT: #"-variadic-no-translation" */ typedef void *va_list; #define va_start(AP, LASTARG) \ (AP = ((va_list) __builtin_next_arg (LASTARG))) void main(const char *pszMessage,...) { va_list vlParameters; va_start(vlParameters,pszMessage); } frama-c-20.0-Calcium/tests/value/va_list2.c0000666000000000000000000000070113571573400015356 0ustar /*run.config* STDOPT: STDOPT: #"-variadic-no-translation" */ #include "stdarg.h" void main(const char* fmt, ...) { va_list args; va_start(args, fmt); while (*fmt) { switch(*fmt) { case 1: { int i = va_arg(args, int); Frama_C_show_each_i(i); break; } case 2: { float f = va_arg(args, float); Frama_C_show_each_f(f); break; } //default: } fmt++; } va_end(args); } frama-c-20.0-Calcium/tests/value/val6.i0000666000000000000000000000063213571573400014514 0ustar /* run.config* GCC: STDOPT: #"-main f -absolute-valid-range 0x1-0xFFFFF" STDOPT: #"-main f1 -absolute-valid-range 0x1-0xFFFFF" */ char **c,a,*b,**y; int x; int f() { a = 'b'; b = &a; c = &b; x = (int)c; y = (char**)x; *((char**)0x12) = &b; **((char**)0x12)='a'; return 0; } int f1() { *((char*)17) = 27; *((char*)19) = 29; x = c?17:19; b = (char*)x; *b = 0; return 0; } frama-c-20.0-Calcium/tests/value/val_if.i0000666000000000000000000000104313571573400015101 0ustar /* run.config* GCC: STDOPT: #"-main f" STDOPT: #"-main f1" STDOPT: #"-main f2" */ int i,j,x,k,l,m,n,d; void f(int c){ int j = 12; if (c) x=1; else x = -1; if (x<=-2) j = x; i = 10; } void f1(int c){ j= 13; k= 14; l= 15; if (c) x=1; else x = -1; if (x<=0) {j = x; if (x<=-2) k = x; l=x; } i = 10; } void f2(int c) { j= 16; k= 17; l= 18; if (c) x=1; else { if (d) x=2; else x = 3; } if (x <= 1 || x>=3 ) { x = 2; j = x; } else { x++ ; k = x;}; i = 10; } frama-c-20.0-Calcium/tests/value/val_ptr.i0000666000000000000000000000115313571573400015312 0ustar /* run.config* GCC: STDOPT: #"-main f" STDOPT: #"-main f1" STDOPT: #"-main f3" STDOPT: #"-main f2" */ int i,j,x,k,l,m,n,d,a,b,c; int *p; void f(int c) { j= 16; k= 17; l= 18; a= 11; b = 12; d= 13; p = &a; if (c) p=&a; else { a = 10; if (d) p=&b; else p = &d; } if (a <= 10) { j = *p; k = a; } else { k = *p ;}; i = 10; } int T[8],*p; void f1() { for (p=T;p==&T[8];p++) *p = 0 ; } void f3() { p = T; if (p + 8 <= &T[8]) *p = 0 ; } void f2(int c) { j = 3; a = 1; b = 2; c = 0; if (!c) p = &a; else p = &b; if (!p) j = *p; } frama-c-20.0-Calcium/tests/value/video_detect.i0000666000000000000000000000117313571573400016303 0ustar /* run.config* STDOPT: #"-absolute-valid-range 0x20-0x23" */ int G; typedef short u16; static int detect_video(void *video_base) { volatile u16 *p = (u16 *)video_base; // Frama_C_show_each_F(p,p[0]); u16 saved1 = p[0]; u16 saved2 = p[1]; int video_found = 1; p[0] = 0xAA55; p[1] = 0x55AA; if ( (p[0] != 0xAA55) || (p[1] != 0x55AA) ) video_found = 0; p[0] = 0x55AA; p[1] = 0xAA55; if ( (p[0] != 0x55AA) || (p[1] != 0xAA55) ) video_found = 0; p[0] = saved1; p[1] = saved2; return video_found; } int main(void) { void * ADDR=(void*)0x20; return(detect_video(ADDR)); } frama-c-20.0-Calcium/tests/value/volatile.c0000666000000000000000000001110213571573400015447 0ustar /* run.config* STDOPT: +"-no-deps -no-input -no-out -eva-initialization-padding-globals maybe -c11" */ int volatile G = 1; volatile int F, E, X, Y, *pV; int k = 1, x = 2, y = 3; int a,b,c,d,e,f,g,h,i,j,l,m,n,o, *pv; struct s { int a; volatile int b; } s1,s2={1,1}; struct sv { int a; volatile int b; }; volatile struct sv sv1, sv2={1,1}; struct sv sv3 = {3}; struct sv sv4 = {4, 5}; int fn2(int, int); int fn1(int x, int y) { Frama_C_show_each_1(x); Frama_C_show_each_2(y); return x + y; } struct { struct ss1 { int a; volatile int b;}; volatile struct ss2 { short c; volatile int d;}; volatile char t[12]; short e;} nested = { {1}, 0}; int R1, R2; int main1 () { /* passing volatile things to functions */ R1 = fn1(G, G|0); R2 = fn2(G, G|0); Frama_C_show_each_d(G); G = G; k = G; /* reading an uninitialized volatile variable */ a = F ? 11 : 12; /* relations involving volatile variables */ b = F; c = F; d = b - c; e = F - F; g = F; f = F - g; l = F + 1; m = 2 + F; n = F - l; o = m - l; /* lval to lval assignment to volatile variable */ h = 1; E = h; /* assignment via pointer */ X = -1; Y = -1; pv = (int *) &X; *pv = x; /* assignment to volatile X */ x = *pv; pV = &Y; *pV = y; /* assignment to volatile Y */ y = *pV; return Y; } // Test volatile pointers int * volatile main2() { int * volatile p1, * volatile p2, * volatile p3; p1 = G ? 0 : &X; p2 = &X; k = G ? 0 : (int) &X; p3 = k; return k; } /* Macro to test the non-reduction of a volatile expression [v]. */ #define do_not_reduce_volatile(v) \ if (t[v] != v) Frama_C_show_each_v(v); \ if (t[v+1] != v+1) Frama_C_show_each_v_plus(v+1); \ if (t[a[v]] != a[v]) Frama_C_show_each_a(a[v]); \ if (t[a[v]-1] != a[v]-1) Frama_C_show_each_a_minus(a[v]-1); \ if (t[a[v]] != v) Frama_C_show_each_av(v) // Assertion that can be true only if v is properly seen as volatile #define do_not_reduce_volatile_logic(v) \ assert NORED: (v) == 1 && (v) == 2 /* Tests the non-reduction of volatile expressions (expression containing the dereference of a volatile location) during the backward propagation of an evaluation. */ void main3 () { int t[1] = {0}; int a[2] = {0,1}; /* The idea of each test is the same: in the evaluation of the condition t[x] != x, the access to t[x] may try to reduce the value of x to 0, and thus make the condition false. In all the lines below, x is a volatile or an expression whose value depends on a volatile, thus its reduction is prevented, and the following Frama_C_show_each appears on the log. Otherwise, the branch is dead, which is a bug. */ /* Volatile variable */ volatile int v = 42; do_not_reduce_volatile(v); //@ do_not_reduce_volatile_logic(v); /* Pointer to volatile variable */ volatile int *v_ptr = &v; do_not_reduce_volatile(*v_ptr); //@ do_not_reduce_volatile_logic(*v_ptr); /* Volatile structure. */ volatile struct vol { int f[1]; } svol; svol.f[0] = 42; do_not_reduce_volatile(svol.f[0]); //@ do_not_reduce_volatile_logic(svol.f[0]); /* Pointer to volatile structure. */ volatile struct vol *svol_ptr = &svol; do_not_reduce_volatile(svol_ptr->f[0]); //@ do_not_reduce_volatile_logic(svol_ptr->f[0]); /* Non volatile structure with a volatile field. */ struct deepvol { volatile int g[1]; } sdeepvol; sdeepvol.g[0] = 42; do_not_reduce_volatile(sdeepvol.g[0]); //@ do_not_reduce_volatile_logic(sdeepvol.g[0]); /* Array of volatile structs. */ volatile struct vol volt[1] = {svol}; do_not_reduce_volatile(volt[0].f[0]); //@ do_not_reduce_volatile_logic(volt[0].f[0]); /* Array of structs with a volatile field. */ struct deepvol deepvolt[1] = {sdeepvol}; do_not_reduce_volatile(deepvolt[0].g[0]); //@ do_not_reduce_volatile_logic(deepvolt[0].g[0]); } /* Tests the initialization of volatile local variables. */ void main4 () { int x; volatile int v1; x = v1; /* Initialization alarm, and imprecise value. */ volatile int v2 = 17; x = v2; /* No alarm, but imprecise value. */ Frama_C_show_each_int_volatile(v1, v2); /* Both variables should be top_int. */ int* volatile p1; int *q = p1; /* Initialization alarm, and imprecise value. */ Frama_C_show_each_ptr(q); p1 = &x; int* volatile p2 = &x; /* Both pointers should have the same imprecise value: &x + imprecise offset. */ Frama_C_show_each_ptr_volatile(p1, p2); } void main() { main1(); main2(); main3(); main4(); } frama-c-20.0-Calcium/tests/value/volatile2.i0000666000000000000000000000544113571573400015550 0ustar /* run.config* OPT: -no-autoload-plugins -load-module from,inout,eva -print -eva @EVA_CONFIG@ -machdep x86_16 */ volatile unsigned char t[10]; struct u { unsigned char f1; unsigned char f2;}; volatile struct u u; struct u * pu = &u; // Cast: remove volatile qualifier void main1() { volatile unsigned char c = 1; int x = 1; volatile unsigned char *p = &x; /* The computation c << 8 overflows: c is promoted to _signed_ int, hence there is an overflow on 16 bits architecture. However, the entire computation does NOT overflow. c << 8 is NOT volatile (it is an expression), hence the last 8 bits are not set and the sum does not overflow. We check this for all kinds of lvalues, as they correspond to different branches of Cabs2cil. */ unsigned int i = (c << 8) + c; unsigned int j = (*p << 8) + *p; unsigned int k = (t[1] << 8) + t[2]; unsigned int l = (u.f1 << 8) + u.f2; } struct s { char i1; char i2; } s; volatile struct s *ps = &s; // Cast: add volatile qualifier void main2() { // i and s are not volatile, but the access ps->i1 is. int i = ps->i1; int j = u.f1; // this field access is volatile int k = t[1]; } volatile int v; void main3() { if (v) { //@ assert \false; } if (v) { // Should be reachable: v must not be reduced by the 'if(v)' //@ assert \true; } //@ assert v == 0; //@ assert v == 0; if (v) { // Same //@ assert \true; } } void main4() { volatile int i; volatile int * p1 = &i; // No cast, &i has volatile qualifier volatile int * volatile p2 = &i; // No cast needed either. However, p2 itself // is also is volatile } void main5() { volatile int i = 0; volatile int j = 0; int k = i++ + j++; int l = ++i + ++j; Frama_C_dump_each(); } void main6() { int i = 1; int j = (volatile int)i; // The cast can be dismissed: C99 6.5.4:4, note 86 } struct bitf { int i: 3; unsigned j: 4; }; volatile struct bitf BITF; void main7() { int i = BITF.i + 1; int k = BITF.j + 1; } typedef struct { int field; } S; typedef volatile S vS; typedef volatile struct { int field; } vS2; typedef union { int field; } U; typedef volatile U vU; void main8() { // Test that volatile qualifiers hidden inside typedefs are taken into account volatile S a = 0; vS b = 0; vS2 c = 0; volatile U d = 0; vU e = 0; Frama_C_show_each(a, b, c, d, e); } extern struct { volatile int i1; int i2; } S9; volatile int u9[10]; // Check that remove-redundant-alarms does not propagate information // about predicates that involve volatile memory zones void main9 () { int t9[10]; t9[S9.i1] = 1; t9[S9.i1] = 2; t9[u9[1]] = 3; t9[u9[1]] = 4; } void main() { main1(); main2(); main3(); main4(); main5(); main6(); main7(); main8(); main9(); } frama-c-20.0-Calcium/tests/value/volatilestruct.c0000666000000000000000000000070513571573400016723 0ustar /* run.config* STDOPT: +"-then -no-warn-signed-overflow -eva-no-warn-pointer-subtraction" */ struct ss { char *f1; int *f2; int f3; }; struct s { struct ss f4; int f5; }; volatile struct s *p; struct s s2; char x; int y; void main() { p = &s2; p->f4.f1 = &x+1; p->f4.f2 = &y-3; char *q1 = p->f4.f1; int *q2 = p->f4.f2; int i = p->f5; int j = (int) p->f4.f2; int r = (&x - p->f4.f1)+1; int s = (&y - p->f4.f2)+3; } frama-c-20.0-Calcium/tests/value/wide_string.c0000666000000000000000000000056113571573400016155 0ustar #include "share/libc/stddef.h" int main(volatile int v) { // String literals are lvalues char (*p)[4] = &("bar"); wchar_t (*q)[4] = &(L"foO"); if((*p)[1] != 'a') return 1; if((*q)[1] != 'o') return 2; if((*p)[3] != 0) return 3; if((*q)[3] != 0) return 4; if (v) { char c = (*p)[4]; } if (v) { wchar_t wc = (*q)[4]; } return 0; } frama-c-20.0-Calcium/tests/value/widen_non_constant.i0000666000000000000000000000315013571573400017533 0ustar // NOT defined as a constant. This file tests complicated widenings in presence // of non-obvious bounds int N = 24; extern int A[24], B[26], C[24]; void main1() { int i, j; for (j=0; j A[j]) { // Swap } } } } // Same as maiN1, except that the array is a bit larger. Ideally, we would // infer the tight bound, not the size of B void main2() { int i, j; for (j=0; j B[j]) { // Swap } } } } // Same again, except that we access the array through an indirection. Our // Syntactic heuristic does not work here, we should infer something directly // from N void main3() { int i, j; int *p = C; for (j=0; j p[j]) { // Swap } } } } int t[20]; int u[40]; void main4() { int i, j; int maxi = 19; for (i = 0; i < maxi; i++) { t[i+1] = i; } t[i-maxi] = -1; // Optimal, inferred from t[i+1] int maxj = 40+3; for (j = 3; j < maxj; j++) { u[j-3] = j; } Frama_C_show_each(j); // Optimal, inferred from u[j-3] maxj = 35; for (j = 4; j < maxj; j++) { u[j-4] = j+1; } Frama_C_show_each(j); // Not optimal, inferred from u[j-4]. Could be improved // by considering j < maxj instead } void main() { main1(); main2(); main3(); main4(); } frama-c-20.0-Calcium/tests/value/widen_on_non_monotonic.i0000666000000000000000000000222313571573400020403 0ustar /* run.config* STDOPT: #"-slevel 20" */ /* Problem with Value's memory model, that does not guarantee that we call Cvalue.V.widen with two arguments that are guaranteed to be increasing. Csmith-found examples reduced by creduce. */ union { char f0; int f1; short f3; } a; int b, c, d; void main1 () { for (;; d++) { d = 0; for (; d < 3; d++) { c = 0; for (; c < 1; c++); c = 0; for (; c < 2; c++); for (; a.f3 < 1; a.f3 = 1) --b; a.f0 = 0; } a.f1 = 1; } } union { int f0; int f4; } u; union U4 { int f0:13; char f2; int f4; }; int g, i, j, k; void main2 () { union U4 u4 = 1; for (;; --u.f0) { i = 0; for (; i < 3; i++) { j = 0; for (; j < 2; j++); } g = fn1 (); k = fn2 () || 0; if (g) { for (; u4.f2 = 0;); if (u.f4) break; } else for (u4.f4 = 0; u4.f4 < 38; ++u4.f4); } } void main() { main1(); main2(); } frama-c-20.0-Calcium/tests/value/widen_overflow.i0000666000000000000000000000032113571573400016670 0ustar /* run.config* OPT: -no-autoload-plugins -load-module eva,inout -eva @EVA_CONFIG@ */ int main() { Frama_C_show_each(sizeof(unsigned int)); unsigned int i = 0; while (u()) { i+=2; } } frama-c-20.0-Calcium/tests/value/with_comment.i0000666000000000000000000000114413571573400016340 0ustar /* run.config* GCC: STDOPT: #"-main main2" */ /* Commentaire avant G comment*/ /* Commentaire avant G2 comment*/ static int G; /* Commentaire apres G avant main comment*/ int main2 () { /* Commentaire apres main comment*/ int i; /* Commentaire apres int i comment Big Comment line 1 Bif Comment line 2 */ G = 0; /* Commentaire avant loop comment*/ /*@ loop pragma UNROLL 0; */ for(i=0; i<=10; i++) G++; // AVANT j {int /* milieu jcomment*/ j; j = /* milieu j 2comment*/ 0; } // APRES j return i; } /* ICI avant H comment*/ static int H; /* ICI apres H comment*/ // fin int HHH; frama-c-20.0-Calcium/tests/value/zerolengtharrays.i0000666000000000000000000000031013571573400017240 0ustar /* This is a test for the zero-sized arrays of GCC. */ struct foo { int x; int y[0]; }; struct bar { struct foo z; }; void main() { unsigned char T[100]; struct foo * F=T; F->x=4; F->y[0]=5; } frama-c-20.0-Calcium/tests/verisec/0000777000000000000000000000000013571573400014015 5ustar frama-c-20.0-Calcium/tests/verisec/suite/0000777000000000000000000000000013571573400015146 5ustar frama-c-20.0-Calcium/tests/verisec/suite/README.verisec_suite0000666000000000000000000000542613571573400020705 0ustar -= Directory Structure of the Verisec Suite =- /lib contains stubs (simple implementations) of library functions in a file stubs.c which should be linked into each testcase at analysis time. It also includes two header files, stubs.h and base.h. The header file stubs.h is #included in every testcase in the suite and itself #includes base.h. The file base.h #defines the macro BASE_SZ which sets the base buffer size for all testcases. This macro can be changed either by directly modifying base.h or, if a tool supports it, by overriding it at the command line, e.g., via the -D option in SatAbs and CBMC. /programs/apps contains the testcases which are first organized into directories by program, e.g., as shown in Figure 1 below, sendmail, OpenSER, and MADWiFi. Within each directory is a README file containing a brief description of the related program. Then there is a directory for each vulnerability in the program for which we developed testcases. Each vulnerability has a README file which explains the vulnerability and briefly describes its testcases. There are typically multiple testcases capturing the vulnerability. For example, in the figure, there are two sets of testcases for the CVE-2006-6749 vulnerability in OpenSER. These testcases are partitioned into directories according to the depth of the function in the calling context of the vulnerability. For example, in the figure below, in vulnerability CVE-2006-6749, the overflow occurs in function parse_expression which is called by function parse_expression_list. Thus, the testcases in the directory parse_expression only capture the body of parse_expression, whereas the testcases in the directory parse_expression_list capture the bodies of both functions, i.e., they include some of the calling context of parse_expression. Each testcase has unsafe and safe variants, indicated by the suffixes "bad" and "ok", respectively. The vulnerable statements in unsafe variants are indicated by the comment, "/* BAD */," on the line immediately preceding the statement. The corresponding statements in safe variants are indicated by the comment, "/* OK */." Some vulnerabilities include a subdirectory "complete", which includes a testcase capturing most of the calling context of the vulnerability. -------------------------------------------------------------------------- suite/ README.verisec_suite lib/ programs/ apps/ OpenSER/ README CVE-2006-6749/ README complete/ parse_expression/ guard_random_index_bad.c guard_random_index_ok.c guard_strchr_bad.c guard_strchr_ok.c guard_strstr_bad.c guard_strstr_ok.c parse_expression_list/ sendmail/ MADWiFi/ ... Fig. 1 -- Suite directory structure. -------------------------------------------------------------------------- frama-c-20.0-Calcium/tests/verisec/suite/lib/0000777000000000000000000000000013571573400015714 5ustar frama-c-20.0-Calcium/tests/verisec/suite/lib/base.h0000666000000000000000000000030013571573400016770 0ustar #ifndef _BASE_H #define _BASE_H /* Only #define it if it hasn't already been defined using -D */ #ifndef BASE_SZ #define BASE_SZ 2 #endif #ifndef MAX_GETC #define MAX_GETC 10 #endif #endif frama-c-20.0-Calcium/tests/verisec/suite/lib/stubs.c0000666000000000000000000001677613571573400017241 0ustar #include "stubs.h" /* * KK: I think SatAbs/CBMC front-end complains about this, but the backend * knows what it means. */ /* extern int nondet_int(); */ /**************************************************************************** * * Begin duplicate relevant functions. * ***************************************************************************/ char *r_strcat(char *dest, const char *src) { int i, j; char tmp; i = 0; j = 0; while (dest[i] != EOS) i++; do { tmp = src[j]; /* replace this line.... */ dest[i] = tmp; i++; j++; } while (src[j] != EOS); /* strcat man page says that strcat null-terminates dest */ /* r_strcat RELEVANT */ dest[i] = EOS; return dest; } char *r_strncat(char *dest, const char *src, size_t n) { int i, j; char tmp; i = 0; j = 0; while (dest[i] != EOS) i++; do { if (j >= n) break; tmp = src[j]; /* replace this line.... */ dest[i] = tmp; i++; j++; } while (src[j] != EOS); /* strncat man page says that strcat null-terminates dest */ /* r_strncat RELEVANT */ dest[i] = EOS; return dest; } /* We do the copy backwards in order to trip upper bounds assertion * failures more quickly. */ void *r_memcpy(void *dest, const void *src, size_t n) { int i; /*@ assert \valid((char *)dest+(n-1)); */ /* dest[n-1]; */ for (i = n-1; i >= 0; i--) { ((char *) dest)[i] = ((char *) src)[i]; } return dest; } char *r_strncpy (char *dest, const char *src, size_t n) { int _i; /* r_strncpy RELEVANT */ dest[n]; for (_i = 0; _i < n; _i++) { dest[_i] = src[_i]; // DO NOT CHANGE THE POSITION OF THIS LINE if (src[_i] == EOS) break; } return dest; } char *r_strcpy (char *dest, const char *src) { int i; char tmp; for (i = 0; ; i++) { tmp = src[i]; /* r_strcpy RELEVANT */ dest[i] = tmp; // DO NOT CHANGE THE POSITION OF THIS LINE if (src[i] == EOS) break; } return dest; } /**************************************************************************** * * End duplicate relevant functions. * ***************************************************************************/ char *strcat(char *dest, const char *src) { int i, j; char tmp; i = 0; j = 0; while (dest[i] != EOS) i++; do { tmp = src[j]; dest[i] = tmp; i++; j++; } while (src[j] != EOS); /* strcat man page says that strcat null-terminates dest */ dest[i] = EOS; return dest; } /* We do the copy backwards in order to trip upper bounds assertion * failures more quickly. */ void *memcpy(void *dest, const void *src, size_t n) { int i; for (i = n-1; i >= 0; i--) { /* I can't find a way to use a temporary here. :-/ */ ((char *)dest)[i] = ((char *)src)[i]; } return dest; } char *strchr(const char *s, int c) { int i; for (i = 0; s[i] != EOS; i++) if (s[i] == c) return &s[i]; return (c == EOS) ? &s[i] : NULL; } char *strrchr(const char *s, int c) { char *ret = NULL; int i; for (i = 0; s[i] != EOS; i++) if (s[i] == c) ret = &s[i]; if (c == EOS) return &s[i]; return ret; } char *strncpy (char *dest, const char *src, size_t n) { int _i; char tmp; for (_i = 0; _i < n; _i++) { tmp = src[_i]; dest[_i] = tmp; if (src[_i] == EOS) break; } return dest; } char *strncpy_ptr (char *dest, const char *src, size_t n) { char *p, *q; p = dest; q = src; for (; q - src < n; q++, p++) { *p = *q; if (*p == 0) break; } return dest; } char *strcpy (char *dest, char *src) { int i; char tmp; for (i = 0; ; i++) { tmp = src[i]; dest[i] = tmp; if (src[i] == EOS) break; } return dest; } /* Version of strstr written for analyzability rather than performance. * * In this version, EVERYTHING is inlined. This seems to aid * analyzability considerably. */ char *strstr(const char *haystack, const char *needle) { int len; int i; int j; len = 0; while (needle[len] != EOS) len++; for (i = 0; haystack[i] != EOS; i++) { for (j = 0; j < len-1; j++) { if (haystack[i+j] == EOS) break; if (haystack[i+j] != needle[j]) break; } if (j == len-1 && haystack[i+len-1] == needle[len-1]) return &haystack[i]; } return NULL; } unsigned strlen(char *s) { int i; i = 0; while (s[i] != EOS) ++i; return i; } int strncmp (const char *s1, const char *s2, size_t n) { int i; int retval; i = 0; do { retval = s1[i] - s2[i]; if (i >= n-1) return retval; if (retval != 0) return retval; if (s1[i] == EOS) return 0; i++; } while (1); } int strcmp (const char *s1, const char *s2) { int i; for (i = 0; s1[i] == s2[i]; i++) if (s1[i] == EOS) return 0; return s1[i] - s2[i]; } /* * getc which returns EOF within MAX_GETC calls if preprocessor macro CBMC is * defined. */ int getc () { #ifdef CBMC static int getc_count = 0; if (getc_count++ < MAX_GETC) { if (nondet_int ()) return (int) nondet_unsigned_char (); return EOF; } else { getc_count = 0; return EOF; } #else return nondet_int (); #endif } int isascii (int c) { return ('!' <= c && c <= '~'); } int isspace (int c) { return (c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r' || c == ' '); } /***************************************************************** * * Functions which are like the functions in libc, but return indexes * into arrays rather than pointers into arrays. -1 becomes the * stand-in for NULL, which is hashish and evil in general. * ****************************************************************/ char *strrand (char *s) { int i; for (i = 0; s[i] != EOS; i++) if (nondet_int () == 1) return &s[i]; return NULL; } int istrrand (char *s) { int i; for (i = 0; s[i] != EOS; i++) if (nondet_int () == 1) return i; return -1; } int istrchr(const char *s, int c) { int i; for (i = 0; s[i] != EOS; i++) if (s[i] == c) return i; return (c == EOS) ? i : -1; } int istrrchr(const char *s, int c) { int ret = -1; int i; for (i = 0; s[i] != EOS; i++) if (s[i] == c) ret = i; if (c == EOS) return i; return ret; } int istrncmp (const char *s1, int start, const char *s2, size_t n) { int i; int end = start + (n-1); for (i = start; i < end; i++) { if (s1[i] == EOS) return 0; if (s1[i] - s2[i] != 0) return s1[i] - s2[i]; } assert (i == end); //KK: what's this here for? return s1[end] - s2[end]; } int istrstr(const char *haystack, const char *needle) { int len; int i; int j; len = 0; while (needle[len] != EOS) len++; for (i = 0; haystack[i] != EOS; i++) { for (j = 0; j < len-1; j++) { if (haystack[i+j] == EOS) break; if (haystack[i+j] != needle[j]) break; } if (j == len-1 && haystack[i+len-1] == needle[len-1]) return i; } return NULL; } typedef struct modem; int put_command( struct modem *mdm, char* command, int clen, char* answer, int max, int timeout,char* expect) { strcpy(answer,"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\ ABCDEF+CMGR:"); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/lib/stubs.h0000666000000000000000000000312613571573400017227 0ustar #ifndef _STUBS_H #define _STUBS_H #include "base.h" #define NULL ((void *)0) #define EOS 0 #define EOF -1 #define ERR -1 /* I had size_t being an unsigned long before, but that led to the * infamous "Equality without matching types" error when I used a * size_t to index into an array. */ typedef int size_t; typedef int bool; #define true 1 #define false 0 char *strchr(const char *s, int c); char *strrchr(const char *s, int c); char *strstr(const char *haystack, const char *needle); char *strncpy (char *dest, const char *src, size_t n); char *strncpy_ptr (char *dest, const char *src, size_t n); char *strcpy (char *dest, const char *src); unsigned strlen(const char *s); int strncmp (const char *s1, const char *s2, size_t n); int strcmp (const char *s1, const char *s2); char *strcat(char *dest, const char *src); void *memcpy(void *dest, const void *src, size_t n); int isascii (int c); int isspace (int c); int getc (/* ignore FILE* arg */); /* Extensions to libc's string library */ char *strrand (char *s); int istrrand (char *s); int istrchr(const char *s, int c); int istrrchr(const char *s, int c); int istrncmp (const char *s1, int start, const char *s2, size_t n); int istrstr(const char *haystack, const char *needle); /* Hackish duplicate functions to enable us to determine which claims * are relevant. Oh, the hilarity. */ char *r_strncpy (char *dest, const char *src, size_t n); char *r_strcpy (char *dest, const char *src); char *r_strcat(char *dest, const char *src); char *r_strncat(char *dest, const char *src, size_t n); void *r_memcpy(void *dest, const void *src, size_t n); #endif frama-c-20.0-Calcium/tests/verisec/suite/programs/0000777000000000000000000000000013571573400017000 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/0000777000000000000000000000000013571573400017743 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/0000777000000000000000000000000013571573400021123 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/0000777000000000000000000000000013571573400022520 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/README0000666000000000000000000000152113571573400023377 0ustar -= CVE-2006-6332 =- Vulnerable versions: MadWifi < 0.9.2.1 File(s): net80211/ieee80211_wireless.c Download from: http://madwifi.org/wiki/UserDocs/GettingMadwifi Domain: Device Driver _ Vulnerable Functions and Buffers _ The overflows are due to lack of bounds checking. buf in encode_ie() can be overflowed by a call to sprintf(), and buf in giwscan_cb() can by overflowed by a call to memcpy(). _ Notes _ The buffer overflows in this example are simple; however, there are technical issues in the original implementation which would make analysis difficult. First, in the original program, the overflow in encode_ie() is due to a write by sprintf(). Second, giwscan_cb() is called via a function pointer stored in a struct in the original. _ Decomposed Programs _ encode_ie/ no_sprintf_bad.c interproc_bad.c giwscan_cb/ giwscan_cb.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/constants.h0000666000000000000000000000114713571573400024710 0ustar #include "../../../../lib/stubs.h" typedef unsigned int u_int; typedef unsigned char u_int8_t; struct ieee80211_scan_entry { u_int8_t *se_rsn_ie; /* captured RSN ie */ }; #define IEEE80211_ELEMID_RSN 200 /* fake */ /* Size of an array leader[] which is written to buf[] before it is * overflowed by the ie[] array. */ #define LEADERSZ 1 /* We first write the "leader" to buf[], and then write from the "ie" * array. buf[] has to be bigger than LEADERSZ by at least 2. */ #define BUFSZ BASE_SZ + LEADERSZ + 2 /* Just has to be big enough to overflow buf[] */ #define IESZ (BUFSZ - LEADERSZ) + 5 frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/encode_ie/0000777000000000000000000000000013571573400024432 5ustar ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/encode_ie/interproc_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/encode_ie/interproc_bad0000666000000000000000000000311113571573400027164 0ustar #include "../constants.h" static u_int encode_ie(void *buf, size_t bufsize, // 8-byte character array const u_int8_t *ie, size_t ielen, // 8-byte uint array const char *leader, size_t leader_len) { /* buf is treated as an array of unsigned 8-byte ints */ u_int8_t *p; int i; // copy the contents of leader into buf if (bufsize < leader_len) return 0; p = buf; memcpy(p, leader, leader_len); bufsize -= leader_len; p += leader_len; for (i = 0; i < ielen && bufsize > 2; i++) { /* This was originally * p += sprintf(p, "%02x", ie[i]); * This would print two digits from ie[i] into p, and * return the number of bytes written. * * Simplified to remove sprintf. * */ /* BAD */ *p = 'x'; /* BAD. */ *(p+1) = 'x'; p += 2; } // if we wrote all of ie[], say how many bytes written in total, // otherwise, claim we wrote nothing return (i == ielen ? p - (u_int8_t *)buf : 0); } static int giwscan_cb(const struct ieee80211_scan_entry *se) { u_int8_t buf[BUFSZ]; char rsn_leader [LEADERSZ]; /* Everything up to this point seems irrelevant to the following. */ if (se->se_rsn_ie != NULL) { if (se->se_rsn_ie[0] == IEEE80211_ELEMID_RSN) encode_ie(buf, sizeof(buf), se->se_rsn_ie, se->se_rsn_ie[1] + 2, rsn_leader, sizeof(rsn_leader) - 1); } return 0; } int main () { struct ieee80211_scan_entry se; u_int8_t ie [IESZ]; se.se_rsn_ie = ie; se.se_rsn_ie[1] = IESZ - 2; giwscan_cb (&se); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/encode_ie/interproc_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/encode_ie/interproc_ok.0000666000000000000000000000320613571573400027132 0ustar #include "../constants.h" static u_int encode_ie(void *buf, size_t bufsize, // 8-byte character array const u_int8_t *ie, size_t ielen, // 8-byte uint array const char *leader, size_t leader_len) { /* buf is treated as an array of unsigned 8-byte ints */ u_int8_t *p; int i; // copy the contents of leader into buf if (bufsize < leader_len) return 0; p = buf; memcpy(p, leader, leader_len); bufsize -= leader_len; p += leader_len; /* This is the fix. */ if (bufsize < ielen) return 0; for (i = 0; i < ielen && bufsize > 2; i++) { /* This was originally * p += sprintf(p, "%02x", ie[i]); * This would print two digits from ie[i] into p, and * return the number of bytes written. * * Simplified to remove sprintf. * */ /* OK */ *p = 'x'; /* OK. */ *(p+1) = 'x'; p += 2; } // if we wrote all of ie[], say how many bytes written in total, // otherwise, claim we wrote nothing return (i == ielen ? p - (u_int8_t *)buf : 0); } static int giwscan_cb(const struct ieee80211_scan_entry *se) { u_int8_t buf[BUFSZ]; char rsn_leader [LEADERSZ]; /* Everything up to this point seems irrelevant to the following. */ if (se->se_rsn_ie != NULL) { if (se->se_rsn_ie[0] == IEEE80211_ELEMID_RSN) encode_ie(buf, sizeof(buf), se->se_rsn_ie, se->se_rsn_ie[1] + 2, rsn_leader, sizeof(rsn_leader) - 1); } return 0; } int main () { struct ieee80211_scan_entry se; u_int8_t ie [IESZ]; se.se_rsn_ie = ie; se.se_rsn_ie[1] = IESZ - 2; giwscan_cb (&se); return 0; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/encode_ie/no_sprintf_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/encode_ie/no_sprintf_ba0000666000000000000000000000226013571573400027200 0ustar #include "../constants.h" static u_int encode_ie(void *buf, size_t bufsize, // 8-byte character array const u_int8_t *ie, size_t ielen, // 8-byte uint array const char *leader, size_t leader_len) { /* buf is treated as an array of unsigned 8-byte ints */ u_int8_t *p; int i; // copy the contents of leader into buf if (bufsize < leader_len) return 0; p = buf; memcpy(p, leader, leader_len); bufsize -= leader_len; p += leader_len; for (i = 0; i < ielen && bufsize > 2; i++) { /* This was originally * p += sprintf(p, "%02x", ie[i]); * This would print two digits from ie[i] into p, and * return the number of bytes written. * * Simplified to remove sprintf. * */ /* BAD */ *p = 'x'; /* BAD. */ *(p+1) = 'x'; p += 2; } // if we wrote all of ie[], say how many bytes written in total, // otherwise, claim we wrote nothing return (i == ielen ? p - (u_int8_t *)buf : 0); } int main() { u_int8_t buf [BUFSZ]; u_int8_t ie [IESZ]; char leader [LEADERSZ]; encode_ie (buf, BUFSZ, ie, IESZ, leader, LEADERSZ); return 0; } ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/encode_ie/no_sprintf_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/encode_ie/no_sprintf_ok0000666000000000000000000000235513571573400027234 0ustar #include "../constants.h" static u_int encode_ie(void *buf, size_t bufsize, // 8-byte character array const u_int8_t *ie, size_t ielen, // 8-byte uint array const char *leader, size_t leader_len) { /* buf is treated as an array of unsigned 8-byte ints */ u_int8_t *p; int i; // copy the contents of leader into buf if (bufsize < leader_len) return 0; p = buf; memcpy(p, leader, leader_len); bufsize -= leader_len; p += leader_len; /* This is the fix. */ if (bufsize < ielen) return 0; for (i = 0; i < ielen && bufsize > 2; i++) { /* This was originally * p += sprintf(p, "%02x", ie[i]); * This would print two digits from ie[i] into p, and * return the number of bytes written. * * Simplified to remove sprintf. * */ /* OK */ *p = 'x'; /* OK. */ *(p+1) = 'x'; p += 2; } // if we wrote all of ie[], say how many bytes written in total, // otherwise, claim we wrote nothing return (i == ielen ? p - (u_int8_t *)buf : 0); } int main() { u_int8_t buf [BUFSZ]; u_int8_t ie [IESZ]; char leader [LEADERSZ]; encode_ie (buf, BUFSZ, ie, IESZ, leader, LEADERSZ); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/giwscan_cb/0000777000000000000000000000000013571573400024617 5ustar ././@LongLink0000644000000000000000000000015100000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/giwscan_cb/giwscan_cb_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/giwscan_cb/giwscan_cb_b0000666000000000000000000000072713571573400027150 0ustar #include "../constants.h" static int giwscan_cb(const struct ieee80211_scan_entry *se) { char buf[IESZ]; /* Everything up to this point seems irrelevant to the following. */ if (se->se_rsn_ie != NULL) { /* BAD */ r_memcpy(buf, se->se_rsn_ie, se->se_rsn_ie[1] + 2); } return 0; } int main () { struct ieee80211_scan_entry se; u_int8_t ie [IESZ * 2]; se.se_rsn_ie = ie; se.se_rsn_ie[1] = (IESZ * 2) - 2; giwscan_cb (&se); return 0; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/giwscan_cb/giwscan_cb_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/CVE-2006-6332/giwscan_cb/giwscan_cb_o0000666000000000000000000000105313571573400027156 0ustar #include "../constants.h" static int giwscan_cb(const struct ieee80211_scan_entry *se) { char buf[IESZ]; /* Everything up to this point seems irrelevant to the following. */ if (se->se_rsn_ie != NULL) { /* Here's the fix. */ if ((se->se_rsn_ie[1] + 2) > IESZ) return E2BIG; /* OK */ r_memcpy(buf, se->se_rsn_ie, se->se_rsn_ie[1] + 2); } return 0; } int main () { struct ieee80211_scan_entry se; u_int8_t ie [IESZ * 2]; se.se_rsn_ie = ie; se.se_rsn_ie[1] = (IESZ * 2) - 2; giwscan_cb (&se); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/MADWiFi/README0000666000000000000000000000022613571573400022003 0ustar -= MadWiFi =- Homepage: http://madwifi.org/ Domain: Device Driver MadWifi is an open source Linux driver for wireless LAN chipsets made by Atheros. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/Makefile0000666000000000000000000000306113571573400021403 0ustar FRAMAC=frama-c STUBS=../../lib/stubs.c BIND_DIR=bind BIND_CA_DIR=$(BIND_DIR)/CA-1999-14 BIND_RREXTRACT_NXT_DIR=$(BIND_CA_DIR)/rrextract-nxt APACHE_DIR=apache APACHE_2004_DIR=$(APACHE_DIR)/CVE-2004-0940 EDBROWSE_DIR=edbrowse/CVE-2006-6909/ftpls GXINE_DIR=gxine/CVE-2007-0406/main OPENSER_DIR=OpenSER OPENSER_6876_DIR=$(OPENSER_DIR)/CVE-2006-6876/fetchsms all:bind gxine apache edbrowse openser bind:bind_CA bind_CVE bind_CA:bind_rrextract_nxt bind_rrextract_nxt:$(BIND_RREXTRACT_NXT_DIR)/simp_bad.c $(FRAMAC) -val $(STUBS) $(BIND_RREXTRACT_NXT_DIR)/simp_bad.c >$(BIND_RREXTRACT_NXT_DIR)/bin_rrextract_nxt.log 2>$(BIND_RREXTRACT_NXT_DIR)/bind_rrxtract_nxt.err gxine:$(GXINE_DIR)/simp_bad.c $(FRAMAC) -val $(STUBS) $(GXINE_DIR)/simp_bad.c >$(GXINE_DIR)/frama-c.log 2>$(GXINE_DIR)/frama-c.err bind_CVE:$(APACHE_2004_DIR)/apache.c apache:apache_CVE_2004 apache_CVE_2006 apache_CVE_2004_iter1_prefixLong_arr: $(APACHE_2004_DIR)/apache.c $(FRAMAC) -val $(STUBS) $(APACHE_2004_DIR)/apache.c $(APACHE_2004_DIR)/get_tag/iter1_prefixLong_arr_bad.c >$(APACHE_2004_DIR)/ap_iter1_prefixLong_arr.log 2>$(APACHE_2004_DIR)/ap_iter1_prefixLong_arr.err apache_CVE_2004:apache_CVE_2004_iter1_prefixLong_arr apache_CVE_2006: edbrowse: $(EDBROWSE_DIR)/strchr_bad.c $(FRAMAC) -val $(STUBS) $(EDBROWSE_DIR)/strchr_bad.c >$(EDBROWSE_DIR)/strchr_bad.log 2>$(EDBROWSE_DIR)/strchr_bad.err openser:openser_6876 openser_6876:$(OPENSER_6876_DIR)/full_bad.c $(FRAMAC) -val $(STUBS) $(OPENSER_6876_DIR)/full_bad.c -slevel 500 >$(OPENSER_6876_DIR)/full_bad.log 2>$(OPENSER_6876_DIR)/full_bad.errframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/0000777000000000000000000000000013571573400021731 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/0000777000000000000000000000000013571573400023333 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/README0000666000000000000000000000232013571573400024210 0ustar -= CVE-2006-6652 =- Vulnerable versions: libc in NetBSD-current before 20050914, NetBSD 2.* and 3.* before 20061203 File(s): src/lib/libc/gen/glob.c Download from: To get the original file, do the following (using bash): $ CVSROOT=:pserver:anoncvs@anoncvs.NetBSD.org:/cvsroot; export CVSROOT $ cvs login ---> use the password "anoncvs" $ cvs co -D 2005-09-13 src/lib/libc/gen/glob.c If NetBSD has changed their anonymouns cvs checkout procedures since the time of this writing, visit http://www.netbsd.org/Documentation/current/#using-anoncvs-pserver for instructions. Domain: C library _ Vulnerable Functions and Buffers _ glob1() passes a buffer, pathbuf, to glob2(). glob1() also passes a pointer, pathlim, which is meant to point to the end of pathbuf, for glob2() and glob3() to use for bounds checking. pathlim is computed incorrectly, so multiple instructions in glob2() and glob3() can overflow pathbuf. _ Decomposed Programs _ glob.h glob1/ bounds_bad.c glob2/ loop_bad.c noAnyMeta_int_bad.c noAnyMeta_ptr_bad.c anyMeta_int_bad.c anyMeta_ptr_bad.c glob2_int_bad.c glob2_ptr_bad.c glob3/ loop_int_bad.c loop_ptr_bad.c glob3_int_bad.c glob3_ptr_bad.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob.h0000666000000000000000000000261313571573400024431 0ustar #include "../../../../lib/stubs.h" /* (One less than the) size of the buffer being overflowed. */ #define MAXPATHLEN BASE_SZ /* Make PATTERNLEN bigger than MAXPATHLEN -- we want to be able to overflow * the buffer of length MAXPATHLEN+1 without having a tool complain about * out-of-bounds reads of the pattern buffer. */ #define PATTERNLEN MAXPATHLEN+5 /* Size of d_name. We don't care about it; like PATTERNLEN, just make * it "big enough". */ #define MAXNAMLEN (MAXPATHLEN * 4) #define DOLLAR '$' #define DOT '.' #define LBRACKET '[' #define NOT '!' #define QUESTION '?' #define QUOTE '\\' #define RANGE '-' #define RBRACKET ']' #define SEP '/' #define STAR '*' #define TILDE '~' #define UNDERSCORE '_' #define LBRACE '{' #define RBRACE '}' #define SLASH '/' #define COMMA ',' #define M_QUOTE 0x80 #define M_PROTECT 0x40 #define M_MASK 0xff #define M_ASCII 0x7f /* In the original, a Char is an unsigned short. * * However, this triggers a bug in SatAbs. Hence, it's an int. */ //typedef unsigned short Char; typedef int Char; typedef char u_char; #define CHAR(c) ((Char)((c)&M_ASCII)) #define META(c) ((Char)((c)|M_QUOTE)) #define M_ALL META('*') #define M_END META(']') #define M_NOT META('!') #define M_ONE META('?') #define M_RNG META('-') #define M_SET META('[') #define ismeta(c) (((c)&(0x80)) != 0) #define GLOB_ABORTED -1 // For SatAbs extern int nondet_int (void); frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob1/0000777000000000000000000000000013571573400024337 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob1/bounds_bad.c0000666000000000000000000000051613571573400026605 0ustar #include "../glob.h" int main () { Char pathbuf[MAXPATHLEN+1]; Char *bound = pathbuf + sizeof(pathbuf) - 1; /* Force SatAbs to check that bound is in bounds. * * This test is meant to mimic checking that "bound" is computed * correctly *before* passing it to glob2(). */ /* BAD */ *bound = 10; return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob1/bounds_ok.c0000666000000000000000000000053513571573400026471 0ustar #include "../glob.h" int main () { Char pathbuf[MAXPATHLEN+1]; Char *bound = pathbuf + sizeof(pathbuf)/sizeof(*pathbuf) - 1; /* Force SatAbs to check that bound is in bounds. * * This test is meant to mimic checking that "bound" is computed * correctly *before* passing it to glob2(). */ /* OK */ *bound = 10; return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/0000777000000000000000000000000013571573400024340 5ustar ././@LongLink0000644000000000000000000000015100000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/anyMeta_int_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/anyMeta_int_b0000666000000000000000000000145113571573400027035 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { int i; int anymeta; Char tmp; for (anymeta = 0;;) { /* Copies a single string from pattern into pathend, checking for * the presence of meta-characters. */ i = 0; while (pattern[i] != EOS && pattern[i] != SEP) { if (ismeta(pattern[i])) anymeta = 1; if (pathend + i >= pathlim) return 1; tmp = pattern[i]; /* BAD */ pathend[i] = tmp; i++; } if (nondet_int ()) return 0; } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/anyMeta_int_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/anyMeta_int_o0000666000000000000000000000146313571573400027055 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { int i; int anymeta; Char tmp; for (anymeta = 0;;) { /* Copies a single string from pattern into pathend, checking for * the presence of meta-characters. */ i = 0; while (pattern[i] != EOS && pattern[i] != SEP) { if (ismeta(pattern[i])) anymeta = 1; if (pathend + i >= pathlim) return 1; tmp = pattern[i]; /* OK */ pathend[i] = tmp; i++; } if (nondet_int ()) return 0; } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000015100000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/anyMeta_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/anyMeta_ptr_b0000666000000000000000000000143713571573400027054 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { Char *p, *q; int anymeta; Char tmp; for (anymeta = 0;;) { /* Copies a single string from pattern into pathend, checking for * the presence of meta-characters. */ q = pathend; p = pattern; while (*p != EOS && *p != SEP) { if (ismeta(*p)) anymeta = 1; if (q >= pathlim) return 1; tmp = *p; /* BAD */ *q = tmp; q++; p++; } if (nondet_int ()) return 0; } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/anyMeta_ptr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/anyMeta_ptr_o0000666000000000000000000000145113571573400027065 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { Char *p, *q; int anymeta; Char tmp; for (anymeta = 0;;) { /* Copies a single string from pattern into pathend, checking for * the presence of meta-characters. */ q = pathend; p = pattern; while (*p != EOS && *p != SEP) { if (ismeta(*p)) anymeta = 1; if (q >= pathlim) return 1; tmp = *p; /* OK */ *q = tmp; q++; p++; } if (nondet_int ()) return 0; } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/glob2_int_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/glob2_int_bad0000666000000000000000000000344413571573400026755 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { int i; int anymeta; Char tmp; for (anymeta = 0;;) { /* End of the pattern. Recursion stops, and we extend the glob * structure. */ if (*pattern == EOS) { *pathend = EOS; if (NONDET()) { if (pathend >= pathlim) return 1; /* BAD */ *pathend = SEP; pathend++; /* BAD */ *pathend = EOS; } // replaces globextend return 0; } /* Copies a single string from pattern into pathend, checking for * the presence of meta-characters. */ i = 0; while (pattern[i] != EOS && pattern[i] != SEP) { if (ismeta(pattern[i])) anymeta = 1; if (pathend + i >= pathlim) return 1; tmp = pattern[i]; /* BAD */ pathend[i] = tmp; i++; } /* If there was no metacharacter, we take whatever came * after the string we previously copied, copy it into * pathend, and continue. * * If we did encounter a meta-character, we recurse * by calling glob3 () -- we elide glob3 () in * this example. */ if (!anymeta) { pathend = pathend + i; pattern = pattern + i; while (*pattern == SEP) { // bounds check if (pathend >= pathlim) return 1; tmp = *pattern; /* BAD */ *pathend = tmp; pathend++; pattern++; } } else { // stand-in for glob3 (which is recursive) return 0; } } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/glob2_int_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/glob2_int_ok.0000666000000000000000000000345313571573400026716 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { int i; int anymeta; Char tmp; for (anymeta = 0;;) { /* End of the pattern. Recursion stops, and we extend the glob * structure. */ if (*pattern == EOS) { *pathend = EOS; if (NONDET()) { if (pathend >= pathlim) return 1; /* OK */ *pathend = SEP; pathend++; /* OK */ *pathend = EOS; } // replaces globextend return 0; } /* Copies a single string from pattern into pathend, checking for * the presence of meta-characters. */ i = 0; while (pattern[i] != EOS && pattern[i] != SEP) { if (ismeta(pattern[i])) anymeta = 1; if (pathend + i >= pathlim) return 1; tmp = pattern[i]; /* OK */ pathend[i] = tmp; i++; } /* If there was no metacharacter, we take whatever came * after the string we previously copied, copy it into * pathend, and continue. * * If we did encounter a meta-character, we recurse * by calling glob3 () -- we elide glob3 () in * this example. */ if (!anymeta) { pathend = pathend + i; pattern = pattern + i; while (*pattern == SEP) { // bounds check if (pathend >= pathlim) return 1; tmp = *pattern; /* OK */ *pathend = tmp; pathend++; pattern++; } } else { // stand-in for glob3 (which is recursive) return 0; } } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/glob2_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/glob2_ptr_bad0000666000000000000000000000336413571573400026771 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { Char *p, *q; int anymeta; Char tmp; for (anymeta = 0;;) { /* End of the pattern. Recursion stops, and we extend the glob * structure. */ if (*pattern == EOS) { *pathend = EOS; if (NONDET()) { if (pathend >= pathlim) return 1; *pathend = SEP; pathend++; /* BAD */ *pathend = EOS; } // replaces globextend return 0; } /* Copies a single string from pattern into pathend, checking for * the presence of meta-characters. */ q = pathend; p = pattern; while (*p != EOS && *p != SEP) { if (ismeta(*p)) anymeta = 1; if (q >= pathlim) return 1; tmp = *p; /* BAD */ *q = tmp; q++; p++; } /* If there was no metacharacter, we take whatever came * after the string we previously copied, copy it into * pathend, and continue. * * If we did encounter a meta-character, we recurse * by calling glob3 () -- we elide glob3 () in * this example. */ if (!anymeta) { pathend = q; pattern = p; while (*pattern == SEP) { // bounds check if (pathend >= pathlim) return 1; tmp = *pattern; /* BAD */ *pathend = tmp; pathend++; pattern++; } } else { // stand-in for glob3 (which is recursive) return 0; } } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/glob2_ptr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/glob2_ptr_ok.0000666000000000000000000000337413571573400026733 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { Char *p, *q; int anymeta; Char tmp; for (anymeta = 0;;) { /* End of the pattern. Recursion stops, and we extend the glob * structure. */ if (*pattern == EOS) { *pathend = EOS; if (NONDET()) { if (pathend >= pathlim) return 1; *pathend = SEP; pathend++; /* OK */ *pathend = EOS; } // replaces globextend return 0; } /* Copies a single string from pattern into pathend, checking for * the presence of meta-characters. */ q = pathend; p = pattern; while (*p != EOS && *p != SEP) { if (ismeta(*p)) anymeta = 1; if (q >= pathlim) return 1; tmp = *p; /* OK */ *q = tmp; q++; p++; } /* If there was no metacharacter, we take whatever came * after the string we previously copied, copy it into * pathend, and continue. * * If we did encounter a meta-character, we recurse * by calling glob3 () -- we elide glob3 () in * this example. */ if (!anymeta) { pathend = q; pattern = p; while (*pattern == SEP) { // bounds check if (pathend >= pathlim) return 1; tmp = *pattern; /* OK */ *pathend = tmp; pathend++; pattern++; } } else { // stand-in for glob3 (which is recursive) return 0; } } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob2 (buf, buf, bound, pattern); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/loop_bad.c0000666000000000000000000000045213571573400026264 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathlim) { Char *p; for (p = pathbuf; p <= pathlim; p++) { /* BAD */ *p = 1; } return 0; } int main () { Char pathbuf[MAXPATHLEN+1]; Char *bound = pathbuf + sizeof(pathbuf) - 1; glob2 (pathbuf, bound); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/loop_ok.c0000666000000000000000000000047213571573400026151 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathlim) { Char *p; for (p = pathbuf; p <= pathlim; p++) { /* OK */ *p = 1; } return 0; } int main () { Char pathbuf[MAXPATHLEN+1]; Char *bound = pathbuf + sizeof(pathbuf)/sizeof(*pathbuf) - 1; glob2 (pathbuf, bound); return 0; } ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/noAnyMeta_int_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/noAnyMeta_int0000666000000000000000000000114213571573400027026 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { int i; Char tmp; i = 0; for (;;) { while (pattern[i] != EOS && pattern[i] != SEP) { if (pathend + i >= pathlim) return 1; tmp = pattern[i]; /* BAD */ pathend[i] = tmp; i++; } if (nondet_int ()) return 0; } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000015200000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/noAnyMeta_int_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/noAnyMeta_int0000666000000000000000000000115413571573400027031 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { int i; Char tmp; i = 0; for (;;) { while (pattern[i] != EOS && pattern[i] != SEP) { if (pathend + i >= pathlim) return 1; tmp = pattern[i]; /* OK */ pathend[i] = tmp; i++; } if (nondet_int ()) return 0; } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/noAnyMeta_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/noAnyMeta_ptr0000666000000000000000000000114213571573400027041 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { Char *p, *q; Char tmp; for (;;) { q = pathend; p = pattern; while (*p != EOS && *p != SEP) { if (q >= pathlim) return 1; tmp = *p; /* BAD */ *q = tmp; q++; p++; } if (nondet_int ()) return 0; } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob2 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000015200000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/noAnyMeta_ptr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob2/noAnyMeta_ptr0000666000000000000000000000115413571573400027044 0ustar #include "../glob.h" int glob2 (Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { Char *p, *q; Char tmp; for (;;) { q = pathend; p = pattern; while (*p != EOS && *p != SEP) { if (q >= pathlim) return 1; tmp = *p; /* OK */ *q = tmp; q++; p++; } if (nondet_int ()) return 0; } /* NOT REACHED */ } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob2 (buf, buf, bound, pattern); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/0000777000000000000000000000000013571573400024341 5ustar ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/glob3_int_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/glob3_int_bad0000666000000000000000000000423513571573400026756 0ustar #include "../glob.h" struct dirent { char d_name[MAXNAMLEN + 1]; }; static int g_Ctoc(Char *str, char *buf, size_t len) { int i; if (len == 0) return 1; for (i = 0; len && (buf[i] = str[i]) != EOS; len--) i++; return len == 0; } static int glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { struct dirent dp; int error; char buf[MAXPATHLEN]; *pathend = EOS; if (nondet_int()) { if (nondet_int()) { if (g_Ctoc(pathbuf, buf, sizeof(buf))) return (GLOB_ABORTED); if (nondet_int()) return (GLOB_ABORTED); } if (nondet_int()) return (GLOB_ABORTED); return(0); } error = 0; while (nondet_int()) { int i; /* Initial DOT must be matched literally. */ if (dp.d_name[0] == DOT && *pattern != DOT) continue; /* * The resulting string contains EOS, so we can * use the pathlim character, if it is the nul */ i = 0; for (;;) if (pathend + i > pathlim) break; else { pathend[i] = dp.d_name[i]; i++; /* BAD */ if (pathend[i] == EOS) break; } /* * Have we filled the buffer without seeing EOS? */ if (pathend + i > pathlim && *pathlim != EOS) { /* * Abort when requested by caller, otherwise * reset pathend back to last SEP and continue * with next dir entry. */ if (nondet_int()) { error = GLOB_ABORTED; break; } else { /* BAD */ pathend[i] = EOS; continue; } } /* match() is scary, and recursive, which Satabs can't handle. * Replacing it with a non-deterministic stub.... * * This is irrelevant to overflow detection anyhow, since this * is *after* the overflow. */ if (/*!match(pathend, pattern, restpattern)*/nondet_int()) { /* BAD */ pathend[i] = EOS; continue; } } return error; } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob3 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/glob3_int_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/glob3_int_ok.0000666000000000000000000000424513571573400026720 0ustar #include "../glob.h" struct dirent { char d_name[MAXNAMLEN + 1]; }; static int g_Ctoc(Char *str, char *buf, size_t len) { int i; if (len == 0) return 1; for (i = 0; len && (buf[i] = str[i]) != EOS; len--) i++; return len == 0; } static int glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { struct dirent dp; int error; char buf[MAXPATHLEN]; *pathend = EOS; if (nondet_int()) { if (nondet_int()) { if (g_Ctoc(pathbuf, buf, sizeof(buf))) return (GLOB_ABORTED); if (nondet_int()) return (GLOB_ABORTED); } if (nondet_int()) return (GLOB_ABORTED); return(0); } error = 0; while (nondet_int()) { int i; /* Initial DOT must be matched literally. */ if (dp.d_name[0] == DOT && *pattern != DOT) continue; /* * The resulting string contains EOS, so we can * use the pathlim character, if it is the nul */ i = 0; for (;;) if (pathend + i > pathlim) break; else { pathend[i] = dp.d_name[i]; i++; /* OK */ if (pathend[i] == EOS) break; } /* * Have we filled the buffer without seeing EOS? */ if (pathend + i > pathlim && *pathlim != EOS) { /* * Abort when requested by caller, otherwise * reset pathend back to last SEP and continue * with next dir entry. */ if (nondet_int()) { error = GLOB_ABORTED; break; } else { /* OK */ pathend[i] = EOS; continue; } } /* match() is scary, and recursive, which Satabs can't handle. * Replacing it with a non-deterministic stub.... * * This is irrelevant to overflow detection anyhow, since this * is *after* the overflow. */ if (/*!match(pathend, pattern, restpattern)*/nondet_int()) { /* OK */ pathend[i] = EOS; continue; } } return error; } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob3 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/glob3_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/glob3_ptr_bad0000666000000000000000000000407213571573400026770 0ustar #include "../glob.h" struct dirent { char d_name[MAXNAMLEN + 1]; }; static int g_Ctoc(Char *str, char *buf, size_t len) { char *dc; if (len == 0) return 1; for (dc = buf; len && (*dc++ = *str++) != EOS; len--) continue; return len == 0; } static int glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { struct dirent dp; int error; char buf[MAXPATHLEN]; *pathend = EOS; if (nondet_int()) { if (nondet_int()) { if (g_Ctoc(pathbuf, buf, sizeof(buf))) return (GLOB_ABORTED); if (nondet_int()) return (GLOB_ABORTED); } if (nondet_int()) return (GLOB_ABORTED); return(0); } error = 0; while (nondet_int()) { char *sc; Char *dc; /* Initial DOT must be matched literally. */ if (dp.d_name[0] == DOT && *pattern != DOT) continue; /* * The resulting string contains EOS, so we can * use the pathlim character, if it is the nul */ for (sc = dp.d_name, dc = pathend;;) if (dc > pathlim) break; else { *dc = *sc; dc++; sc++; /* BAD */ if (*dc == EOS) break; } /* * Have we filled the buffer without seeing EOS? */ if (dc > pathlim && *pathlim != EOS) { /* * Abort when requested by caller, otherwise * reset pathend back to last SEP and continue * with next dir entry. */ if (nondet_int()) { error = GLOB_ABORTED; break; } else { /* BAD */ *pathend = EOS; continue; } } /* match is scary */ if (/*!match(pathend, pattern, restpattern)*/nondet_int()) { /* BAD */ *pathend = EOS; continue; }/* error = glob2(pathbuf, --dc, pathlim, restpattern, pglob, limit); if (error) break;*/ } return error; } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob3 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/glob3_ptr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/glob3_ptr_ok.0000666000000000000000000000410213571573400026723 0ustar #include "../glob.h" struct dirent { char d_name[MAXNAMLEN + 1]; }; static int g_Ctoc(Char *str, char *buf, size_t len) { char *dc; if (len == 0) return 1; for (dc = buf; len && (*dc++ = *str++) != EOS; len--) continue; return len == 0; } static int glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { struct dirent dp; int error; char buf[MAXPATHLEN]; *pathend = EOS; if (nondet_int()) { if (nondet_int()) { if (g_Ctoc(pathbuf, buf, sizeof(buf))) return (GLOB_ABORTED); if (nondet_int()) return (GLOB_ABORTED); } if (nondet_int()) return (GLOB_ABORTED); return(0); } error = 0; while (nondet_int()) { char *sc; Char *dc; /* Initial DOT must be matched literally. */ if (dp.d_name[0] == DOT && *pattern != DOT) continue; /* * The resulting string contains EOS, so we can * use the pathlim character, if it is the nul */ for (sc = dp.d_name, dc = pathend;;) if (dc > pathlim) break; else { *dc = *sc; dc++; sc++; /* OK */ if (*dc == EOS) break; } /* * Have we filled the buffer without seeing EOS? */ if (dc > pathlim && *pathlim != EOS) { /* * Abort when requested by caller, otherwise * reset pathend back to last SEP and continue * with next dir entry. */ if (nondet_int()) { error = GLOB_ABORTED; break; } else { /* OK */ *pathend = EOS; continue; } } /* match is scary */ if (/*!match(pathend, pattern, restpattern)*/nondet_int()) { /* OK */ *pathend = EOS; continue; }/* error = glob2(pathbuf, --dc, pathlim, restpattern, pglob, limit); if (error) break;*/ } return error; } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob3 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/loop_int_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/loop_int_bad.0000666000000000000000000000077513571573400027004 0ustar #include "../glob.h" static int glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { int dc; dc = 0; for (;;) if (pathend + dc > pathlim) break; else { pathend[dc] = 1; dc++; /* BAD */ if (pathend[dc] == EOS) break; } return 0; } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob3 (buf, buf, bound, pattern); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/loop_int_ok.c0000666000000000000000000000100713571573400027017 0ustar #include "../glob.h" static int glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { int dc; dc = 0; for (;;) if (pathend + dc > pathlim) break; else { pathend[dc] = 1; dc++; /* OK */ if (pathend[dc] == EOS) break; } return 0; } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob3 (buf, buf, bound, pattern); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/loop_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/loop_ptr_bad.0000666000000000000000000000075313571573400027013 0ustar #include "../glob.h" static int glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { Char *dc; dc = pathend; for (;;) if (dc > pathlim) break; else { *dc = 1; dc++; /* BAD */ if (*dc == EOS) break; } return 0; } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A) - 1; glob3 (buf, buf, bound, pattern); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/CVE-2006-6652/glob3/loop_ptr_ok.c0000666000000000000000000000076513571573400027044 0ustar #include "../glob.h" static int glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern) { Char *dc; dc = pathend; for (;;) if (dc > pathlim) break; else { *dc = 1; dc++; /* OK */ if (*dc == EOS) break; } return 0; } int main () { Char *buf; Char *pattern; Char *bound; Char A [MAXPATHLEN+1]; Char B [PATTERNLEN]; buf = A; pattern = B; bound = A + sizeof(A)/sizeof(*A) - 1; glob3 (buf, buf, bound, pattern); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/NetBSD-libc/README0000666000000000000000000000025113571573400022607 0ustar -= NetBSD libc =- Homepage: http://www.netbsd.org Domain: C Library NetBSD is a Unix-like operating system, and this is it's implementation of the C standard library. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/0000777000000000000000000000000013571573400021216 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/0000777000000000000000000000000013571573400022627 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/README0000666000000000000000000000337313571573400023515 0ustar -= CVE-2006-6749 =- Vulnerable versions: OpenSER <= 1.1.0 File(s): openser-1.1.0-tls/modules/permissions/parse_config.c Download from: http://www.openser.org/pub/openser/1.1.0/ src/openser-1.1.0-tls_src.tar.gz Domain: SIP (Session Initiation Protocol) _ Vulnerable Functions and Buffers _ Due to the lack of bounds checking, the buffers str2 in parse_expression() and str2 in parse_expression_list() can both be overflowed. str2 in parse_expression() is overflowed by a call to strcpy(); reaching this call depends on the outcome of a call to strstr(). str2 in parse_expression_list() is also overflowed by a call to strncpy(); however, the overflow depends on several branches made according to the value of the characters in the input buffer -- including stripping of characters from both ends of the substring. _ Decomposed Programs _ stubs.h Defines LINE_LENGTH and EXPRESSION_LENGTH parse_expression/ guard_random_index_bad.c guard_strchr_e_bad.c guard_strstr_e_bad.c guard_strstr_eee_bad.c guard_strstr_except_bad.c parse_expression_list/ single_strip_spaces_copy_bad.c single_strip_full_copy_bad.c copy_zero_bad.c copy_bad.c copy_apost_bad.c copy_strip_spaces_bad.c copy_strip_full_bad.c complete/ parse_config_bad.c pel2/ cases{1,2,3}_strip{None,SpacesStart,SpacesBoth,FullStart,FullBoth}_{arr,ptr}_{ok,bad}.c cases1 - switch has only EOS case cases2 - switch has EOS and , cases cases3 - switch has EOS and , and " cases None - no whitespace stripping Spaces - strip only spaces Full - strip spaces, tabs, and quote marks Start - strip only from the start Both - strip from both sides arr - using array indexing (original) ptr - using pointers relevant assertion is an explicit assert before strncpy frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/complete/0000777000000000000000000000000013571573400024437 5ustar ././@LongLink0000644000000000000000000000015100000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/complete/parse_config_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/complete/parse_config_b0000666000000000000000000000335613571573400027331 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); r_strncpy(str2, str+start, j-start+1); /* BAD */ str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int parse_expression (char *str) { char *except; char str2 [LINE_LENGTH]; except = strstr(str, NEEDLE); if (except) { strncpy(str2, str, except-str); str2[except-str] = EOS; if (parse_expression_list(except+NEEDLE_SZ)) { /* error */ return -1; } } return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression (A); return 0; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/complete/parse_config_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/complete/parse_config_o0000666000000000000000000000347113571573400027344 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); r_strncpy(str2, str+start, j-start+1); /* OK */ str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int parse_expression (char *str) { char *except; char str2 [LINE_LENGTH+1]; except = strstr(str, NEEDLE); if (except) { strncpy(str2, str, except-str); str2[except-str] = EOS; if (parse_expression_list(except+NEEDLE_SZ)) { /* error */ return -1; } } return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression (A); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/constants.h0000666000000000000000000000052513571573400025016 0ustar #ifndef _CONSTANTS_H #define _CONSTANTS_H #include "../../../../lib/stubs.h" #define EXPRESSION_LENGTH BASE_SZ #define NEEDLE "EX" #define NEEDLE_SZ 2 /* Enough to fill a buffer of size EXPRESSION_LENGTH, enough to * contain the needle, and enough to overflow the buffer. */ #define LINE_LENGTH EXPRESSION_LENGTH + NEEDLE_SZ + 4 #endif frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/0000777000000000000000000000000013571573400026220 5ustar ././@LongLink0000644000000000000000000000016700000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_random_index_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_0000666000000000000000000000062113571573400027403 0ustar #include "../constants.h" int parse_expression (char *str) { int ind; char str2 [LINE_LENGTH]; ind = nondet_int (); if (ind < -1 || ind >= LINE_LENGTH) return -1; if (ind != -1) { strncpy (str2, str, ind); } else { /* BAD */ r_strcpy (str2, str); } return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression (A); return 0; } ././@LongLink0000644000000000000000000000016600000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_random_index_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_0000666000000000000000000000062213571573400027404 0ustar #include "../constants.h" int parse_expression (char *str) { int ind; char str2 [LINE_LENGTH+1]; ind = nondet_int (); if (ind < -1 || ind >= LINE_LENGTH) return -1; if (ind != -1) { strncpy (str2, str, ind); } else { /* OK */ r_strcpy (str2, str); } return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression (A); return 0; } ././@LongLink0000644000000000000000000000016100000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_strchr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_0000666000000000000000000000072713571573400027412 0ustar #include "../constants.h" int parse_expression (char *str) { char *except; char str2 [LINE_LENGTH]; except = strchr (str, 'e'); if (except) { // SAFE: the 'e' is not copied strncpy (str2, str, (unsigned int)(except-str)); } else { // UNSAFE: can copy up to LINE_LENGTH+1 characters /* BAD */ r_strcpy (str2, str); } return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression (A); return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_strchr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_0000666000000000000000000000057613571573400027414 0ustar #include "../constants.h" int parse_expression (char *str) { char *except; char str2 [LINE_LENGTH+1]; except = strchr (str, 'e'); if (except) { strncpy (str2, str, (unsigned int)(except-str)); } else { /* OK */ r_strcpy (str2, str); } return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression (A); return 0; } ././@LongLink0000644000000000000000000000016100000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_strstr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_0000666000000000000000000000073213571573400027406 0ustar #include "../constants.h" int parse_expression (char *str) { char *except; char str2 [LINE_LENGTH]; except = strstr(str, NEEDLE); if (except) { // SAFE: the needle is not copied strncpy (str2, str, (unsigned int)(except-str)); } else { // UNSAFE: can copy up to LINE_LENGTH+1 characters /* BAD */ r_strcpy (str2, str); } return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression (A); return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_strstr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression/guard_0000666000000000000000000000057613571573400027414 0ustar #include "../constants.h" int parse_expression (char *str) { char *except; char str2 [LINE_LENGTH+1]; except = strstr(str, NEEDLE); if (except) { strncpy (str2, str, (unsigned int)(except-str)); } else { /* OK */ r_strcpy (str2, str); } return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression (A); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/0000777000000000000000000000000013571573400027253 5ustar ././@LongLink0000644000000000000000000000020200000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullBoth_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000227313571573400027424 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021200000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullBoth_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000235113571573400027421 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021100000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullBoth_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000246313571573400027425 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020100000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullBoth_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000240513571573400027421 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020100000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullEnd_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000175013571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021100000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullEnd_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000202613571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021000000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullEnd_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000214013571573400027415 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020000000000000007763 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullEnd_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000206213571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020300000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullStart_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000201013571573400027411 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021300000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullStart_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000206613571573400027424 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021200000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullStart_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000220013571573400027412 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020200000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripFullStart_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000212213571573400027415 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripNone_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000146513571573400027426 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020600000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripNone_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000154313571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020500000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripNone_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000165513571573400027427 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000017500000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripNone_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000157713571573400027432 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020400000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesBoth_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000204013571573400027414 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021400000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesBoth_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000211613571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021300000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesBoth_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000223013571573400027415 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020300000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesBoth_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000215213571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020300000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesEnd_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000165113571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021300000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesEnd_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000172713571573400027427 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021200000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesEnd_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000204113571573400027415 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020200000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesEnd_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000176313571573400027427 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020500000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesStart_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000165413571573400027426 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021500000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesStart_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000173213571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021400000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesStart_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000204413571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020400000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases1_stripSpacesStart_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000176613571573400027432 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020200000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullBoth_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000250313571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021200000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullBoth_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000256113571573400027424 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021100000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullBoth_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000267313571573400027430 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020100000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullBoth_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000261513571573400027424 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020100000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullEnd_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000216013571573400027417 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021100000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullEnd_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000223613571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021000000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullEnd_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000235013571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020000000000000007763 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullEnd_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000227213571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020300000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullStart_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000222013571573400027414 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021300000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullStart_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000227613571573400027427 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021200000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullStart_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000241013571573400027415 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020200000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripFullStart_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000233213571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripNone_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000167513571573400027431 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020600000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripNone_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000175313571573400027426 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020500000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripNone_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000206513571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000017500000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripNone_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000200713571573400027417 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020400000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesBoth_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000225013571573400027417 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021400000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesBoth_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000232613571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021300000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesBoth_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000244013571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020300000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesBoth_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000236213571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020300000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesEnd_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000206113571573400027417 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021300000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesEnd_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000213713571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021200000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesEnd_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000225113571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020200000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesEnd_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000217313571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020500000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesStart_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000206413571573400027422 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021500000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesStart_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000214213571573400027417 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021400000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesStart_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000225413571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020400000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases2_stripSpacesStart_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000217613571573400027426 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020200000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullBoth_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000260213571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021200000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullBoth_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000266013571573400027424 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021100000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullBoth_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000277213571573400027430 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020100000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullBoth_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000271413571573400027424 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020100000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullEnd_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000225713571573400027426 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021100000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullEnd_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000233513571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021000000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullEnd_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000244713571573400027427 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020000000000000007763 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullEnd_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000237113571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' ') || (str[j] == '\t'))) j--; if ((0 < j) && (str[j] == '"')) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020300000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullStart_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000231713571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021300000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullStart_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000237513571573400027427 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021200000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullStart_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000250713571573400027424 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020200000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripFullStart_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000243113571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ') || (str[start] == '\t')) start++; /* Skip quote marks */ if (str[start] == '"') start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripNone_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000177413571573400027431 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020600000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripNone_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000205213571573400027417 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020500000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripNone_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000216413571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000017500000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripNone_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000210613571573400027417 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020400000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesBoth_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000234713571573400027426 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021400000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesBoth_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000242513571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021300000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesBoth_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000253713571573400027427 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020300000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesBoth_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000246113571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020300000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesEnd_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000216013571573400027417 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021300000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesEnd_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000223613571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021200000000000007766 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesEnd_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000235013571573400027420 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020200000000000007765 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesEnd_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000227213571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Set j to point to the end of the current word */ j = i-1; /* Skip over quotes and whitespace at the END of the word */ while ((0 < j) && ((str[j] == ' '))) j--; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020500000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesStart_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000216313571573400027422 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021500000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesStart_arr_inlined_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000224113571573400027417 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ /* BAD */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000021400000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesStart_arr_inlined_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000235313571573400027423 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ assert (j-start+1 < EXPRESSION_LENGTH); strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } ././@LongLink0000644000000000000000000000020400000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/cases3_stripSpacesStart_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6749/parse_expression_list/c0000666000000000000000000000227513571573400027426 0ustar #include "../constants.h" static int parse_expression_list(char *str) { int start=0, i=-1, j=-1, apost=0; char str2[EXPRESSION_LENGTH]; if (!str) return -1; do { /* i only changes here --> it's the "current character" */ i++; switch(str[i]) { case '"': apost = !apost; break; /* Comman and NULL are both word terminators, stop parsing if your word terminator is a NULL. */ case ',': if (apost) break; case EOS: /* word found */ /* Skip initial whitespace from start of the word being processed */ while ((str[start] == ' ')) start++; /* Set j to point to the end of the current word */ j = i-1; /* If word not empty.... */ if (start<=j) { /* valid word */ if (j-start+1>=EXPRESSION_LENGTH) { return -1; } /* OK */ r_strncpy(str2, str+start, j-start+1); str2[j-start+1] = EOS; } else { /* parsing error */ return -1; } /* for the next word */ start = i+1; } } while (str[i] != EOS); return 0; } int main () { char A [LINE_LENGTH+1]; A[LINE_LENGTH] = EOS; parse_expression_list (A); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/0000777000000000000000000000000013571573400022630 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/README0000666000000000000000000000133513571573400023512 0ustar -= CVE-2006-6876 =- Vulnerable versions: OpenSER <= 1.2.0 File(s): openser-1.1.0-tls/modules/sms/libsms_getsms.c Download from: http://www.openser.org/pub/openser/1.1.0/src/openser-1.1.0-tls_src.tar.gz Domain: SIP (Session Initiation Protocol) _ Vulnerable Functions and Buffers _ A buffer, pdu[], is passed to fetchsms(). fetchsms() writes into pdu[] from another buffer, answer[], which it gets from the modem. fetchsms() does some heavyweight string parsing of answer[], and copies part of answer[] into pdu[]. Unfortunately, pdu[] is too small to hold this substring of answer[]. _ Decomposed Programs _ constants.h fetchsms/ loops_bad.c istrstr_bad.c istrstr_loops_bad.c istrstr2_loops_bad.c full_bad.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/constants.h0000666000000000000000000000134213571573400025015 0ustar #include "../../../../lib/stubs.h" /* Note on NEEDLE_SZ: The original program searches for "+CMGR:" or * "+CMGL: ", and then skips seven characters in either case. I * *think* that they meant to have a space after teh "+CMGR:", but * just forgot it, and the parsing works right either way. */ #define NEEDLE "+C" // "+CMGR:" or "+CMGL: " #define NEEDLE_SZ 2 // 7 #define NEEDLE2 "," // ",,0\r" #define MIN_DIFF BASE_SZ /* fetchsms() aborts if it can't advance end at least MIN_DIFF * characters twice; so, make PDUSIZE 2*MIN_DIFF. */ #define PDUSIZE 2*MIN_DIFF /* NEEDLE_SZ -- because we search for NEEDLE and skip it * * PDUSIZE + 2 so we have enough left to overflow pdu[] */ #define ANSWERSIZE NEEDLE_SZ + PDUSIZE + 2 frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/0000777000000000000000000000000013571573400024444 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/fetchsms2.c0000666000000000000000000000352113571573400026507 0ustar /* SMS Server Tools Copyright (C) 2000-2002 Stefan Frings This program is free software unless you got it under another license directly from the author. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. Either version 2 of the License, or (at your option) any later version. http://www.isis.de/members/~s.frings mailto:s.frings@mail.isis.de */ #include "../constants.h" /* reads a SMS from the SIM-memory 1-10 */ /* returns number of SIM memory if successful */ /* on digicom the return value can be != sim */ static int fetchsms(char* pdu, int sim) { char command[16]; char answer[ANSWERSIZE]= "F+CMGR:"; char* position; char* beginning; char* end; int foo,err; int clen; /* int i; for (i = 0; i < ANSWERSIZE; i++) { answer[i] = nondet_int(); } */ answer[sizeof(answer)-1] = EOS; // Digicom reports date+time only with AT+CMGL if (0 && nondet_int() == 0) { /* search for beginning of the answer */ position=strstr(answer,"+CMGL: "); if (position) { end=position+7; while (*end<'9' && *end>'0') end++; position = 0; } } else { position=strstr(answer,"+CMGR:"); } /* keine SMS empfangen, weil Modem nicht mit +CMGR oder +CMGL geantwortet hat */ if (position==0) return 0; beginning=position+7; /* keine SMS, weil Modem mit +CMGR: 0,,0 geantwortet hat */ if (strstr(answer,",,0\r")) return 0; /* After that we have the PDU or ASCII string */ for( end=beginning ; *end && *end!='\r' ; end++ ); if ( !*end || end-beginning<4) return 0; for( end=end+1 ; *end && *end!='\r' ; end++ ); if ( !*end || end-beginning<4) return 0; /* Now we have the end of the PDU or ASCII string */ *end=0; r_strcpy(pdu,beginning); return sim; } int main () { char pdu [PDUSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/full_bad.c0000666000000000000000000000315413571573400026363 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE] = "ABCDE+C"; int position; int beginning; int end; int foo,err; #if 0 //@ loop pragma UNROLL 10 ; for (int i = 0; i < ANSWERSIZE-1; i++) answer[i] = nondet_int(); /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; #endif /* Still chopped down a bit from the original in the interests of * not being heinous */ if (0 && nondet_int() == 0) { /* Original program uses a different needle here */ position=istrstr(answer, NEEDLE); if (position != -1) { end=position+NEEDLE_SZ; while (answer[end] < '9' && answer[end] > '0') end++; position = 0; } } else { position=istrstr(answer, NEEDLE); } /* Skip the needle */ if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* Answer must contain NEEDLE2; we don't need to skip it. */ if (istrstr(answer, NEEDLE2) == -1) return 0; /* Find (something)\r(something)\r, where each (something) is at * least MIN_DIFF characters * * If we don't find anything satisfying that, abort */ for( end=beginning ; answer[end] != EOS && answer[end] != '\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF) return 0; for( end=end+1 ; answer[end] != EOS && answer[end] !='\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF ) return 0; /* Change the last '\r' to an EOS */ answer[end] = EOS; /* BAD */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [PDUSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/full_bad.err0000666000000000000000000000122713571573400026730 0ustar No code for function nondet_int, default assigns generated ../../lib/stubs.c:376: Warning: (TODO: emit a proper alarm) accessing uninitialized left-value: *(haystack + i) ../../lib/stubs.c:376: Warning: completely unspecified value in {{ answer -> {0; } ;}} (size:<8>). This path is assumed to be dead. ../../lib/stubs.c:376: Warning: non termination detected in function istrstr OpenSER/CVE-2006-6876/fetchsms/full_bad.c:30: Warning: non termination detected in function fetchsms OpenSER/CVE-2006-6876/fetchsms/full_bad.c:66: Warning: non termination detected in function main [dominators] computing for function r_memcpy [dominators] done for function r_memcpy frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/full_ok.c0000666000000000000000000000275613571573400026255 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE]; int position; int beginning; int end; int foo,err; /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; /* Still chopped down a bit from the original in the interests of * not being heinous */ if (nondet_int() == 0) { /* Original program uses a different needle here */ position=istrstr(answer, NEEDLE); if (position != -1) { end=position+NEEDLE_SZ; while (answer[end] < '9' && answer[end] > '0') end++; position = 0; } } else { position=istrstr(answer, NEEDLE); } /* Skip the needle */ if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* Answer must contain NEEDLE2; we don't need to skip it. */ if (istrstr(answer, NEEDLE2) == -1) return 0; /* Find (something)\r(something)\r, where each (something) is at * least MIN_DIFF characters * * If we don't find anything satisfying that, abort */ for( end=beginning ; answer[end] != EOS && answer[end] != '\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF) return 0; for( end=end+1 ; answer[end] != EOS && answer[end] !='\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF ) return 0; /* Change the last '\r' to an EOS */ answer[end] = EOS; /* OK */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [ANSWERSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr2_loops_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr2_loops0000666000000000000000000000217213571573400027401 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE]; int position; int beginning; int end; int foo,err; /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; /* Search for NEEDLE and skip it */ position=istrstr(answer,NEEDLE); if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* Answer must contain NEEDLE2; we don't need to skip it. */ if (istrstr(answer, NEEDLE2) == -1) return 0; /* Find (something)\r(something)\r, where each (something) is at * least MIN_DIFF characters * * If we don't find anything satisfying that, abort */ for( end=beginning ; answer[end] != EOS && answer[end] != '\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF) return 0; for( end=end+1 ; answer[end] != EOS && answer[end] !='\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF ) return 0; /* Change the last '\r' to an EOS */ answer[end] = EOS; /* BAD */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [PDUSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } ././@LongLink0000644000000000000000000000015200000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr2_loops_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr2_loops0000666000000000000000000000217413571573400027403 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE]; int position; int beginning; int end; int foo,err; /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; /* Search for NEEDLE and skip it */ position=istrstr(answer,NEEDLE); if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* Answer must contain NEEDLE2; we don't need to skip it. */ if (istrstr(answer, NEEDLE2) == -1) return 0; /* Find (something)\r(something)\r, where each (something) is at * least MIN_DIFF characters * * If we don't find anything satisfying that, abort */ for( end=beginning ; answer[end] != EOS && answer[end] != '\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF) return 0; for( end=end+1 ; answer[end] != EOS && answer[end] !='\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF ) return 0; /* Change the last '\r' to an EOS */ answer[end] = EOS; /* OK */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [ANSWERSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr_bad.c0000666000000000000000000000100613571573400027125 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE]; int position; int beginning; int end; int foo,err; /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; /* Search for NEEDLE and skip it */ position=istrstr(answer,NEEDLE); if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* BAD */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [PDUSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } ././@LongLink0000644000000000000000000000015200000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr_loops_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr_loops_0000666000000000000000000000200513571573400027451 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE]; int position; int beginning; int end; int foo,err; /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; /* Search for NEEDLE and skip it */ position=istrstr(answer,NEEDLE); if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* Find (something)\r(something)\r, where each (something) is at * least MIN_DIFF characters * * If we don't find anything satisfying that, abort */ for( end=beginning ; answer[end] != EOS && answer[end] != '\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF) return 0; for( end=end+1 ; answer[end] != EOS && answer[end] !='\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF ) return 0; /* Change the last '\r' to an EOS */ answer[end] = EOS; /* BAD */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [PDUSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } ././@LongLink0000644000000000000000000000015100000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr_loops_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr_loops_0000666000000000000000000000200713571573400027453 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE]; int position; int beginning; int end; int foo,err; /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; /* Search for NEEDLE and skip it */ position=istrstr(answer,NEEDLE); if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* Find (something)\r(something)\r, where each (something) is at * least MIN_DIFF characters * * If we don't find anything satisfying that, abort */ for( end=beginning ; answer[end] != EOS && answer[end] != '\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF) return 0; for( end=end+1 ; answer[end] != EOS && answer[end] !='\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF ) return 0; /* Change the last '\r' to an EOS */ answer[end] = EOS; /* OK */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [ANSWERSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/istrstr_ok.c0000666000000000000000000000101013571573400027003 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE]; int position; int beginning; int end; int foo,err; /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; /* Search for NEEDLE and skip it */ position=istrstr(answer,NEEDLE); if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* OK */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [ANSWERSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/loops_bad.c0000666000000000000000000000175013571573400026555 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE]; int position; int beginning; int end; int foo,err; /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; /* Don't skip anything */ position = 0; if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* Find (something)\r(something)\r, where each (something) is at * least MIN_DIFF characters * * If we don't find anything satisfying that, abort */ for( end=beginning ; answer[end] != EOS && answer[end] != '\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF) return 0; for( end=end+1 ; answer[end] != EOS && answer[end] !='\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF ) return 0; /* Change the last '\r' to an EOS */ answer[end] = EOS; /* BAD */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [PDUSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/CVE-2006-6876/fetchsms/loops_ok.c0000666000000000000000000000175213571573400026442 0ustar #include "../constants.h" int fetchsms (char *pdu, int sim) { char answer[ANSWERSIZE]; int position; int beginning; int end; int foo,err; /* Input magically appears */ answer[ANSWERSIZE-1] = EOS; /* Don't skip anything */ position = 0; if (position==-1) return 0; beginning = position + NEEDLE_SZ + 1; /* Find (something)\r(something)\r, where each (something) is at * least MIN_DIFF characters * * If we don't find anything satisfying that, abort */ for( end=beginning ; answer[end] != EOS && answer[end] != '\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF) return 0; for( end=end+1 ; answer[end] != EOS && answer[end] !='\r' ; end++ ); if ( answer[end] == EOS || end-beginning < MIN_DIFF ) return 0; /* Change the last '\r' to an EOS */ answer[end] = EOS; /* OK */ r_strcpy(pdu,answer+beginning); return sim; } int main () { char pdu [ANSWERSIZE]; int sim = 0; fetchsms (pdu, sim); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/OpenSER/README0000666000000000000000000000037113571573400022077 0ustar -= OpenSER =- Homepage: http://www.openser.org Domain: SIP (Session Initiation Protocol) Server SIP is the Session Initiation Protocol. It is an application-layer networking protocol which handles sessions. OpenSER is an open-source SIP server. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/0000777000000000000000000000000013571573400022350 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/0000777000000000000000000000000013571573400023357 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/README0000666000000000000000000000133113571573400024235 0ustar -= BID-6679 =- Vulnerable versions: SpamAssassin 2.40 to 2.43 File(s): spamd/libspamc.c Download from: http://www.cpan.org/modules/by-module/Mail/Mail-SpamAssassin-2.43.tar.gz Domain: Spam Filter _ Note _ This vulnerability doesn't seem to have a CVE entry, so I'm using its Bugtraq ID. It also has a Secunia Advisory number, SA7951. I heard about it via the CRunner paper. _ Vulnerable Functions and Buffers _ A buffer called buffer[] is allocated in message_write(). Writes to this buffer are protected by a limit check, but there's an off-by-one error in the check. I'm currently not including any of the calling context, but that can change if need be. _ Decomposed Programs _ constants.h message_write/ loop.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/constants.h0000666000000000000000000000012613571573400025543 0ustar #include "../../../../lib/stubs.h" #define BUFSZ BASE_SZ + 2 #define INSZ BUFSZ + 5 frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/message_write/0000777000000000000000000000000013571573400026215 5ustar ././@LongLink0000644000000000000000000000015600000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/message_write/frama-c-journal.mlframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/message_write/frama-c-j0000666000000000000000000000050613571573400027676 0ustar (* Frama-C journal generated at 15:32 the 02/09/2008 *) (* Running *) let () = Journal.run () let () = Cmdline.ForceValues.set true let () = Cmdline.Files.set ["loop_ok.c"; ] let () = File.init_from_cmdline () let () = !Db.Syntactic_callgraph.dump () let () = !Db.Value.compute () (* Finished *) let () = Journal.finished () ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/message_write/loop_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/message_write/loop_bad.0000666000000000000000000000133113571573400027773 0ustar #include "../constants.h" void message_write (char *msg, int len) { int i; int j; char buffer[BUFSZ]; int limit = BUFSZ - 1; for (i = 0; i < len; ) { for (j = 0; i < len && j < limit; ){ if (i + 1 < len && msg[i] == '\n' && msg[i+1]== '.') { buffer[j] = msg[i]; /* Suppose j == limit - 1 */ j++; i++; buffer[j] = msg[i]; /* Now j == limit */ j++; i++; /* BAD */ buffer[j] = '.'; /* Now j == limit + 1 = sizeof(buffer) */ j++; } else { buffer[j] = msg[i]; j++; i++; } } } } int main () { char msg [INSZ] = "message"; message_write (msg, INSZ); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/message_write/loop_ok.c0000666000000000000000000000117113571573400030023 0ustar #include "../constants.h" void message_write (char *msg, int len) { int i; int j; char buffer[BUFSZ]; int limit = BUFSZ - 4; for (i = 0; i < len; ) { for (j = 0; i < len && j < limit; ){ if (i + 1 < len && msg[i] == '\n' && msg[i+1]== '.') { buffer[j] = msg[i]; j++; i++; buffer[j] = msg[i]; j++; i++; /* OK */ buffer[j] = '.'; j++; } else { buffer[j] = msg[i]; j++; i++; } } } } int main () { char msg [INSZ] = "message"; message_write (msg, INSZ); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/BID-6679/message_write/test0000777000000000000000000001712613571573400027131 0ustar ELF4t4 (&#444 ((( Qtd/lib/ld-linux.so.2GNU K :) |__gmon_start__libc.so.6_IO_stdin_used__stack_chk_fail__libc_start_mainGLIBC_2.4GLIBC_2.0ii Lii VtUS[thX[5|%%h%h%h1^PTRhhЄQVh\U=t ҡuÐUtt $ÐUEEEE;E }^EE< uQUE<.u>UEEDEEUEEDEEED.EUEEDEEE;E } E;EkE;E SÍL$qUQ$eE1EEED$ E$Ue3tG$Y]aÐU]Ít&'UWVSOÝ )t$1ED$E D$E$9uރ [^_]Ë$ÐUSt1Ћu[]ÐUS[Y[message  \Hop ` x|oLoo@GCC: (GNU) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)GCC: (GNU) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)GCC: (GNU) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)GCC: (GNU) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)GCC: (GNU) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)GCC: (GNU) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)GCC: (GNU) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)$"\*$Ȃt!u_IO_stdin_used)message_writeJmainu44g$ZUi7intPpA|OK'/build/buildd/glibc-2.7/build-tree/i386-libc/csu/crti.S/build/buildd/glibc-2.7/build-tree/glibc-2.7/csuGNU AS 2.18.0]GNU C 4.2.3 (Ubuntu 4.2.3-2ubuntu7)loop_ok.c/home/geraud/projets/PFC/exemples/verisec/suite/programs/apps/SpamAssassin/BID-6679/message_writeintmessage_write\)msg)lenitjpbuffer7llimit h/char/GG  main#\,vmsg$vg /G  /build/buildd/glibc-2.7/build-tree/i386-libc/csu/crtn.S/build/buildd/glibc-2.7/build-tree/glibc-2.7/csuGNU AS 2.18.0% $ > $ > $ > 4: ; I?  &IU%% $ > .? : ; ' @: ; I 4: ; I  II!I/ $ > .? : ; I@ IU%# init.cN /build/buildd/glibc-2.7/build-tree/i386-libc/csucrti.S!/!=Z!gg//\(!/!=Z!Z  loop_ok.ckv+KKKLuJ .KpJ;1>0YxN /build/buildd/glibc-2.7/build-tree/i386-libc/csucrtn.SȂ !!!t!!!|  8\b    GNU C 4.2.3 (Ubuntu 4.2.3-2ubuntu7)short unsigned intshort int_IO_stdin_usedlong long unsigned intunsigned char/build/buildd/glibc-2.7/build-tree/glibc-2.7/csuinit.clong long intttutQtt*u\oȂ̂tx.symtab.strtab.shstrtab.interp.note.ABI-tag.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment.debug_aranges.debug_pubnames.debug_info.debug_abbrev.debug_line.debug_frame.debug_str.debug_loc.debug_ranges#(( 5HH(1opp ; PC`Ko@@ XoLL0g ||p  y0t̂@L\\xxttxx &p8R*   @p-08koC@ Qd%9 4"(Hp@L|   ̂  \xtx !",:G@ ]lsp 0 x  ! / ? F U ixp\v|ЄZ  * \b  init.cinitfini.ccrtstuff.c__CTOR_LIST____DTOR_LIST____JCR_LIST____do_global_dtors_auxcompleted.5843p.5841frame_dummy__CTOR_END____DTOR_END____FRAME_END____JCR_END____do_global_ctors_auxloop_ok.c_GLOBAL_OFFSET_TABLE___init_array_end__init_array_start_DYNAMICdata_startmessage_write__libc_csu_fini_start__gmon_start___Jv_RegisterClasses_fp_hw_fini__libc_start_main@@GLIBC_2.0_IO_stdin_used__data_start__dso_handle__libc_csu_init__bss_start__stack_chk_fail@@GLIBC_2.4_end_edata__i686.get_pc_thunk.bxmain_initframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/SpamAssassin/README0000666000000000000000000000023713571573400023232 0ustar -= SpamAssassin =- Homepage: http://spamassassin.apache.org/ Domain: Spam Filter SpamAssassin is a popular open source filter for getting rid of email spam. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/0000777000000000000000000000000013571573400021164 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/0000777000000000000000000000000013571573400022556 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/README0000666000000000000000000000224713571573400023443 0ustar -= CVE-2004-0940 =- Vulnerable versions: Apache 1.3.x to 1.3.32 File(s): src/modules/standard/mod_include.c Download from: http://archive.apache.org/dist/httpd/apache_1.3.32.tar.gz Domain: Web (HTTP) Server _ Vulnerable Functions and Buffers _ The function get_tag() is passed a buffer, and an integer representing the size of this buffer. A loop get_tag() iterates over this buffer, filling it with characters from a file. A bounds check, if (t - tag == tagbuf_len) is meant to keep get_tag() from writing passed the end of the buffer tag[], into which t points. Unfortunately, there is a path through this loop in which t is incremented twice without an intervening check; hence, t - tag can be greater than tagbuf_len. Multiple writes to tag[] are thus unsafe. _ Decomposed Programs _ apache.h apache.c get_tag/ iter{1,2}_prefix{Short,Long}_{arr,ptr}_{bad,ok}.c iter1 -- all iteration is forwards iter2 -- there is forwards and backwards iteration (only the bad cases do this) prefixShort -- little of get_tag() up to the relevant loop is preserved prefixLong -- almost all of get_tag() up to the relevant loop is preserved arr, ptr, bad, and ok mean the standard things ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/ap_iter1_prefixLong_arr.errframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/ap_iter1_prefixLong_arr.0000666000000000000000000000360413571573400027327 0ustar apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.c:12: Warning: entering loop for the first time No code for function nondet_char, default assigns generated apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.c:30: Warning: entering loop for the first time apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.c:19: Warning: entering loop for the first time apache/CVE-2004-0940/apache.c:19: Warning: assigning non deterministic value for the first time apache/CVE-2004-0940/apache.c:30: Warning: entering loop for the first time apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.c:47: Warning: entering loop for the first time apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.c:54: Warning: entering loop for the first time apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.c:62: Warning: entering loop for the first time apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.c:71: Warning: out of bounds write. assert \valid(tag + t); apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.c:80: Warning: out of bounds write. assert \valid(tag + t); apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.c:85: Warning: out of bounds write. assert \valid(tag + t); [from] computing for function nondet_char [from] done for function nondet_char [from] computing for function ap_isspace [postdominators] computing for function ap_isspace [postdominators] done for function ap_isspace [from] done for function ap_isspace [from] computing for function ap_cpystrn [postdominators] computing for function ap_cpystrn [postdominators] done for function ap_cpystrn [from] done for function ap_cpystrn [from] computing for function ap_tolower [from] done for function ap_tolower [dominators] computing for function get_tag [dominators] done for function get_tag [dominators] computing for function r_memcpy [dominators] done for function r_memcpy frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/apache.c0000666000000000000000000000114413571573400024143 0ustar #include "apache.h" int ap_isspace(char c) { if (c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r' || c == ' ') return 1; return 0; } int ap_tolower(char c) { /* do we have tolower() in our stubs? */ return c; } /* Rewritten to be more analyzable -- use explicit array indexing. */ char * ap_cpystrn(char *dst, const char *src, size_t dst_size) { int i; if (dst_size == 0) return (dst); for (i = 0; i < dst_size - 1; i++) { dst[i] = src[i]; if (src[i] == EOS) { return dst + i; } } dst[i] = EOS; return dst + i; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/apache.h0000666000000000000000000000060713571573400024153 0ustar #include "../../../../lib/stubs.h" #define MAX_STRING_LEN BASE_SZ + 2 int ap_isspace(char c); int ap_tolower(char c); char * ap_cpystrn(char *dst, const char *src, size_t dst_size); /* GET_CHAR reads a char from a file. We're not modelling the * underlying file, so just non-deterministically return something. */ extern int nondet_char (); #define GET_CHAR(c,ret) {c = nondet_char();} frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/frama-c-journal.ml0000666000000000000000000000072613571573400026073 0ustar (* Frama-C journal generated at 15:05 the 29/08/2008 *) (* Running *) let () = Journal.run () let () = Cmdline.widening level.set 20 let () = Cmdline.ForceValues.set true let () = Cmdline.Files.set ["get_tag/iter1_prefixLong_arr_bad.c"; ] let () = Cmdline.Files.set ["apache.c"; "get_tag/iter1_prefixLong_arr_bad.c"; ] let () = File.init_from_cmdline () let () = !Db.Syntactic_callgraph.dump () let () = !Db.Value.compute () (* Finished *) let () = Journal.finished () frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/0000777000000000000000000000000013571573400024170 5ustar ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixLong0000666000000000000000000000307313571573400027337 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; int t; t = 0; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '-') { GET_CHAR(c, NULL); if (c == '-') { do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '>') { ap_cpystrn(tag, "done", tagbuf_len); return tag; } } return NULL; } while (1) { if (t == tagbuf_len) { tag[t] = EOS; return NULL; } if (c == '=' || ap_isspace(c)) { break; } tag[t] = ap_tolower(c); t++; GET_CHAR(c, NULL); } tag[t] = EOS; t++; tag_val = tag + t; while (ap_isspace(c)) { GET_CHAR(c, NULL); } if (c != '=') { return NULL; } do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tagbuf_len) { /* Suppose t == tagbuf_len - 1 */ tag[t] = EOS; return NULL; } if (c == '\\') { /* BAD */ tag[t] = c; t++; /* Now t == tagbuf_len */ GET_CHAR(c, NULL); } else if (c == term) { break; } /* BAD */ tag[t] = c; t++; /* Now t == tagbuf_len + 1 * So the bounds check (t == tagbuf_len) will fail */ } /* BAD */ tag[t] = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000015600000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixLong_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixLong0000666000000000000000000000324313571573400027336 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; int t; t = 0; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '-') { GET_CHAR(c, NULL); if (c == '-') { do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '>') { ap_cpystrn(tag, "done", tagbuf_len); return tag; } } return NULL; } while (1) { if (t == tagbuf_len) { tag[t] = EOS; return NULL; } if (c == '=' || ap_isspace(c)) { break; } tag[t] = ap_tolower(c); t++; GET_CHAR(c, NULL); } tag[t] = EOS; t++; tag_val = tag + t; while (ap_isspace(c)) { GET_CHAR(c, NULL); } if (c != '=') { return NULL; } do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tagbuf_len) { /* Suppose t == tagbuf_len - 1 */ tag[t] = EOS; return NULL; } if (c == '\\') { GET_CHAR(c, NULL); if (c != term) { /* OK */ tag[t] = '\\'; t++; if (t == tagbuf_len) { /* OK */ tag[t] = EOS; return NULL; } } } else if (c == term) { break; } /* OK */ tag[t] = c; t++; /* Now t == tagbuf_len + 1 * So the bounds check (t == tagbuf_len) will fail */ } /* OK */ tag[t] = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixLong_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixLong0000666000000000000000000000310113571573400027327 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; char *t; t = tag; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '-') { GET_CHAR(c, NULL); if (c == '-') { do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '>') { ap_cpystrn(tag, "done", tagbuf_len); return tag; } } return NULL; } while (1) { if (t == tag + tagbuf_len) { *t = EOS; return NULL; } if (c == '=' || ap_isspace(c)) { break; } *t = ap_tolower(c); t++; GET_CHAR(c, NULL); } *t = EOS; t++; tag_val = t; while (ap_isspace(c)) { GET_CHAR(c, NULL); } if (c != '=') { return NULL; } do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tag + tagbuf_len) { /* Suppose t == tag + tagbuf_len - 1 */ *t = EOS; return NULL; } if (c == '\\') { /* BAD */ *t = c; t++; /* Now t == tag + tagbuf_len */ GET_CHAR(c, NULL); } else if (c == term) { break; } /* BAD */ *t = c; t++; /* Now t == tag + tagbuf_len + 1 * So the bounds check (t == tag + tagbuf_len) will fail */ } /* BAD */ *t = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000015600000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixLong_ptr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixLong0000666000000000000000000000324513571573400027340 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; char *t; t = tag; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '-') { GET_CHAR(c, NULL); if (c == '-') { do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '>') { ap_cpystrn(tag, "done", tagbuf_len); return tag; } } return NULL; } while (1) { if (t == tag + tagbuf_len) { *t = EOS; return NULL; } if (c == '=' || ap_isspace(c)) { break; } *t = ap_tolower(c); t++; GET_CHAR(c, NULL); } *t = EOS; t++; tag_val = t; while (ap_isspace(c)) { GET_CHAR(c, NULL); } if (c != '=') { return NULL; } do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tag + tagbuf_len) { /* Suppose t == tag + tagbuf_len - 1 */ *t = EOS; return NULL; } if (c == '\\') { GET_CHAR(c, NULL); if (c != term) { /* OK */ *t = '\\'; t++; if (t == tag + tagbuf_len) { /* OK */ *t = EOS; return NULL; } } } else if (c == term) { break; } /* OK */ *t = c; t++; /* Now t == tag + tagbuf_len + 1 * So the bounds check (t == tag + tagbuf_len) will fail */ } /* OK */ *t = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixShort_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixShor0000666000000000000000000000165613571573400027360 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; int t; t = 0; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tagbuf_len) { /* Suppose t == tagbuf_len - 1 */ tag[t] = EOS; return NULL; } if (c == '\\') { /* BAD */ tag[t] = c; t++; /* Now t == tagbuf_len */ GET_CHAR(c, NULL); } else if (c == term) { break; } /* BAD */ tag[t] = c; t++; /* Now t == tagbuf_len + 1 * So the bounds check (t == tagbuf_len) will fail */ } /* BAD */ tag[t] = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixShort_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixShor0000666000000000000000000000202613571573400027350 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; int t; t = 0; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tagbuf_len) { /* Suppose t == tagbuf_len - 1 */ tag[t] = EOS; return NULL; } if (c == '\\') { GET_CHAR(c, NULL); if (c != term) { /* OK */ tag[t] = '\\'; t++; if (t == tagbuf_len) { /* OK */ tag[t] = EOS; return NULL; } } } else if (c == term) { break; } /* OK */ tag[t] = c; t++; /* Now t == tagbuf_len + 1 * So the bounds check (t == tagbuf_len) will fail */ } /* OK */ tag[t] = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixShort_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixShor0000666000000000000000000000170013571573400027346 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; char *t; t = tag; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tag + tagbuf_len) { /* Suppose t == tag + tagbuf_len - 1 */ *t = EOS; return NULL; } if (c == '\\') { /* BAD */ *t = c; t++; /* Now t == tag + tagbuf_len */ GET_CHAR(c, NULL); } else if (c == term) { break; } /* BAD */ *t = c; t++; /* Now t == tag + tagbuf_len + 1 * So the bounds check (t == tag + tagbuf_len) will fail */ } /* BAD */ *t = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixShort_ptr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter1_prefixShor0000666000000000000000000000204413571573400027350 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; char *t; t = tag; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tag + tagbuf_len) { /* Suppose t == tag + tagbuf_len - 1 */ *t = EOS; return NULL; } if (c == '\\') { GET_CHAR(c, NULL); if (c != term) { /* OK */ *t = '\\'; t++; if (t == tag + tagbuf_len) { /* OK */ *t = EOS; return NULL; } } } else if (c == term) { break; } /* OK */ *t = c; t++; /* Now t == tag + tagbuf_len + 1 * So the bounds check (t == tag + tagbuf_len) will fail */ } /* OK */ *t = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter2_prefixLong_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter2_prefixLong0000666000000000000000000000326413571573400027342 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; int t; t = 0; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '-') { GET_CHAR(c, NULL); if (c == '-') { do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '>') { ap_cpystrn(tag, "done", tagbuf_len); return tag; } } return NULL; } while (1) { if (t == tagbuf_len) { tag[t] = EOS; return NULL; } if (c == '=' || ap_isspace(c)) { break; } tag[t] = ap_tolower(c); t++; GET_CHAR(c, NULL); } tag[t] = EOS; t++; tag_val = tag + t; while (ap_isspace(c)) { GET_CHAR(c, NULL); } if (c != '=') { return NULL; } do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tagbuf_len) { /* Suppose t == tagbuf_len - 1 */ tag[t] = EOS; return NULL; } if (c == '\\') { /* BAD */ tag[t] = c; t++; /* Now t == tagbuf_len */ GET_CHAR(c, NULL); if (c == term) { /* Assume this branch isn't taken */ --t; /* BAD */ tag[t] = c; } } else if (c == term) { break; } /* BAD */ tag[t] = c; t++; /* Now t == tagbuf_len + 1 * So the bounds check (t == tagbuf_len) will fail */ } /* BAD */ tag[t] = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter2_prefixLong_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter2_prefixLong0000666000000000000000000000326613571573400027344 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; char *t; t = tag; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '-') { GET_CHAR(c, NULL); if (c == '-') { do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c == '>') { ap_cpystrn(tag, "done", tagbuf_len); return tag; } } return NULL; } while (1) { if (t == tag + tagbuf_len) { *t = EOS; return NULL; } if (c == '=' || ap_isspace(c)) { break; } *t = ap_tolower(c); t++; GET_CHAR(c, NULL); } *t = EOS; t++; tag_val = t; while (ap_isspace(c)) { GET_CHAR(c, NULL); } if (c != '=') { return NULL; } do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tag + tagbuf_len) { /* Suppose t == tag + tagbuf_len - 1 */ *t = EOS; return NULL; } if (c == '\\') { /* BAD */ *t = c; t++; /* Now t == tag + tagbuf_len */ GET_CHAR(c, NULL); if (c == term) { /* Assume this branch isn't taken */ --t; /* BAD */ *t = c; } } else if (c == term) { break; } /* BAD */ *t = c; t++; /* Now t == tag + tagbuf_len + 1 * So the bounds check (t == tag + tagbuf_len) will fail */ } /* BAD */ *t = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter2_prefixShort_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter2_prefixShor0000666000000000000000000000205113571573400027347 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; int t; t = 0; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tagbuf_len) { /* Suppose t == tagbuf_len - 1 */ tag[t] = EOS; return NULL; } if (c == '\\') { /* BAD */ tag[t] = c; t++; /* Now t == tagbuf_len */ GET_CHAR(c, NULL); if (c == term) { /* Assume this branch isn't taken */ --t; /* BAD */ tag[t] = c; } } else if (c == term) { break; } /* BAD */ tag[t] = c; t++; /* Now t == tagbuf_len + 1 * So the bounds check (t == tagbuf_len) will fail */ } /* BAD */ tag[t] = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter2_prefixShort_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2004-0940/get_tag/iter2_prefixShor0000666000000000000000000000206713571573400027356 0ustar #include "../apache.h" char *get_tag(char *tag, int tagbuf_len) { char *tag_val, c, term; char *t; t = tag; --tagbuf_len; do { GET_CHAR(c, NULL); } while (ap_isspace(c)); if (c != '"' && c != '\'') { return NULL; } term = c; while (1) { GET_CHAR(c, NULL); if (t == tag + tagbuf_len) { /* Suppose t == tag + tagbuf_len - 1 */ *t = EOS; return NULL; } if (c == '\\') { /* BAD */ *t = c; t++; /* Now t == tag + tagbuf_len */ GET_CHAR(c, NULL); if (c == term) { /* Assume this branch isn't taken */ --t; /* BAD */ *t = c; } } else if (c == term) { break; } /* BAD */ *t = c; t++; /* Now t == tag + tagbuf_len + 1 * So the bounds check (t == tag + tagbuf_len) will fail */ } /* BAD */ *t = EOS; return tag; } int main () { char tag[MAX_STRING_LEN]; /* The caller always passes in (tag, sizeof(tag)) */ get_tag (tag, MAX_STRING_LEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/0000777000000000000000000000000013571573400022570 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/README0000666000000000000000000000176613571573400023462 0ustar -= CVE-2006-3747 =- Vulnerable versions: Apache 1.3.x, where x >= 28 Apache 2.0.x, where 46 <= x < 2.0.59 Apache 2.2.0, 2.2.2 File(s): modules/mappers/mod_rewrite.c Download from: http://archive.apache.org/dist/httpd/httpd-2.2.2.tar.gz Domain: Web (HTTP) Server _ Vulnerable Functions and Buffers _ The function escape_absolute_uri() declares an array of strings token[] of size 5 and uses an int, c, to index into it. c is protected by a bounds check, "c < 5"; however, c is incremented in the loop prior to being used as an array index, so we have an off-by-one error. _ Decomposed Programs _ apache.h apache.c escape_absolute_uri/ simp1_bad.c simp2_bad.c simp3_bad.c strncmp_bad.c full_bad.c _ Note _ Note that the original example uses apr_pstrdup(), which I elided to avoid dynamic memory allocation, and strncasecmp(), for which I substituted strncmp() to avoid penalizing tools for not understanding ASCII arithmetic. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/apache.h0000666000000000000000000000166213571573400024167 0ustar #include "../../../../lib/stubs.h" /* Vary these to affect the analysis difficulty of the variants * calling strncmp() */ #define LDAP "ldap" #define LDAP_SZ 4 /* Size of the buffer being overflowed * Must ensure that 0 < TOKEN_SZ - 1 */ #define TOKEN_SZ BASE_SZ + 1 /* This requires an explanation. escape_absolute_uri() gets passed a * buffer uri[] and an offset into uri[]. The loop which overflows * token[] is only executed if uri[] starts with the string LDAP of * size LDAP_SZ, and if the character in uri[] which is one past the * offset is a slash. Hence the LDAP_SZ (for the string LDAP) and the * first +1 (for the slash). * * The second +1 is because we increment our iterator over uri[] at * least once before reaching the loop which overflows token[]. * * The TOKEN_SZ + 2 is there so that uri[] will have enough characters * after the offset to overflow token[]. */ #define URI_SZ LDAP_SZ + 1 + 1 + TOKEN_SZ + 2 frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/0000777000000000000000000000000013571573400026605 5ustar ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/full_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/full0000666000000000000000000000155113571573400027474 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { int cp; char *token[TOKEN_SZ]; int c; if (scheme == 0 || strlen(uri) < scheme) { return; } cp = scheme; if (uri[cp-1] == '/') { while (uri[cp] != EOS && uri[cp] != '/') { ++cp; } if (uri[cp] == EOS || uri[cp+1] == EOS) return; ++cp; scheme = cp; if (strncmp(uri, LDAP, LDAP_SZ) == 0) { c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ) { if (uri[cp] == '?') { ++c; /* BAD */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } return; } } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } ././@LongLink0000644000000000000000000000015200000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/full_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/full0000666000000000000000000000155413571573400027477 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { int cp; char *token[TOKEN_SZ]; int c; if (scheme == 0 || strlen(uri) < scheme) { return; } cp = scheme; if (uri[cp-1] == '/') { while (uri[cp] != EOS && uri[cp] != '/') { ++cp; } if (uri[cp] == EOS || uri[cp+1] == EOS) return; ++cp; scheme = cp; if (strncmp(uri, LDAP, LDAP_SZ) == 0) { c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ - 1) { if (uri[cp] == '?') { ++c; /* OK */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } return; } } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/full_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/full0000666000000000000000000000151113571573400027470 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { char *cp; char *token[TOKEN_SZ]; int c; if (scheme == 0 || strlen(uri) < scheme) { return; } cp = uri + scheme; if (cp[-1] == '/') { while (*cp != EOS && *cp != '/') { ++cp; } if (*cp == EOS || *(cp+1) == EOS) return; ++cp; scheme = cp - uri; if (strncmp(uri, LDAP, LDAP_SZ) == 0) { c = 0; token[0] = uri; while (*cp != EOS && c < TOKEN_SZ) { if (*cp == '?') { ++c; /* BAD */ token[c] = cp + 1; *cp = EOS; } ++cp; } return; } } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } ././@LongLink0000644000000000000000000000015600000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/full_ptr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/full0000666000000000000000000000151413571573400027473 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { char *cp; char *token[TOKEN_SZ]; int c; if (scheme == 0 || strlen(uri) < scheme) { return; } cp = uri + scheme; if (cp[-1] == '/') { while (*cp != EOS && *cp != '/') { ++cp; } if (*cp == EOS || *(cp+1) == EOS) return; ++cp; scheme = cp - uri; if (strncmp(uri, LDAP, LDAP_SZ) == 0) { c = 0; token[0] = uri; while (*cp != EOS && c < TOKEN_SZ - 1) { if (*cp == '?') { ++c; /* OK */ token[c] = cp + 1; *cp = EOS; } ++cp; } return; } } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } ././@LongLink0000644000000000000000000000015400000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp1_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp0000666000000000000000000000067213571573400027505 0ustar #include "../apache.h" void escape_absolute_uri (char *uri) { int cp; char *token[TOKEN_SZ]; int c; cp = 0; c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ) { if (uri[cp] == '?') { ++c; /* BAD */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } return; } int main () { char uri [URI_SZ]; uri [URI_SZ-1] = EOS; escape_absolute_uri (uri); return 0; } ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp1_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp0000666000000000000000000000067513571573400027510 0ustar #include "../apache.h" void escape_absolute_uri (char *uri) { int cp; char *token[TOKEN_SZ]; int c; cp = 0; c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ - 1) { if (uri[cp] == '?') { ++c; /* OK */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } return; } int main () { char uri [URI_SZ]; uri [URI_SZ-1] = EOS; escape_absolute_uri (uri); return 0; } ././@LongLink0000644000000000000000000000015400000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp2_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp0000666000000000000000000000107513571573400027503 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { int cp; char *token[TOKEN_SZ]; int c; if (scheme == 0 || strlen(uri) < scheme) { return; } cp = scheme; c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ) { if (uri[cp] == '?') { ++c; /* BAD */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp2_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp0000666000000000000000000000110013571573400027470 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { int cp; char *token[TOKEN_SZ]; int c; if (scheme == 0 || strlen(uri) < scheme) { return; } cp = scheme; c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ - 1) { if (uri[cp] == '?') { ++c; /* OK */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } ././@LongLink0000644000000000000000000000015400000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp3_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp0000666000000000000000000000142113571573400027476 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { int cp; char *token[TOKEN_SZ]; int c; if (scheme == 0 || strlen(uri) < scheme) { return; } cp = scheme; if (uri[cp-1] == '/') { while (uri[cp] != EOS && uri[cp] != '/') { ++cp; } if (uri[cp] == EOS || uri[cp+1] == EOS) return; ++cp; scheme = cp; c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ) { if (uri[cp] == '?') { ++c; /* BAD */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp3_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/simp0000666000000000000000000000142413571573400027501 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { int cp; char *token[TOKEN_SZ]; int c; if (scheme == 0 || strlen(uri) < scheme) { return; } cp = scheme; if (uri[cp-1] == '/') { while (uri[cp] != EOS && uri[cp] != '/') { ++cp; } if (uri[cp] == EOS || uri[cp+1] == EOS) return; ++cp; scheme = cp; c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ - 1) { if (uri[cp] == '?') { ++c; /* OK */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } ././@LongLink0000644000000000000000000000015600000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/strncmp_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/strn0000666000000000000000000000111313571573400027512 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { int cp; char *token[TOKEN_SZ]; int c; cp = scheme; if (strncmp(uri, LDAP, LDAP_SZ) == 0) { c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ) { if (uri[cp] == '?') { ++c; /* BAD */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } return; } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } ././@LongLink0000644000000000000000000000015500000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/strncmp_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/CVE-2006-3747/escape_absolute_uri/strn0000666000000000000000000000111613571573400027515 0ustar #include "../apache.h" void escape_absolute_uri (char *uri, int scheme) { int cp; char *token[TOKEN_SZ]; int c; cp = scheme; if (strncmp(uri, LDAP, LDAP_SZ) == 0) { c = 0; token[0] = uri; while (uri[cp] != EOS && c < TOKEN_SZ - 1) { if (uri[cp] == '?') { ++c; /* OK */ token[c] = uri + cp + 1; uri[cp] = EOS; } ++cp; } return; } return; } int main () { char uri [URI_SZ]; int scheme; uri [URI_SZ-1] = EOS; scheme = LDAP_SZ + 2; escape_absolute_uri (uri, scheme); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/apache/README0000666000000000000000000000023113571573400022040 0ustar -= Apache =- Homepage: http://www.apache.org/ Domain: Web (HTTP) Server Apache is a popular open source web server, which can be extended via modules. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bargraph_tests0000666000000000000000000000061113571573400022674 0ustar sendmail/CVE-2002-1337/close_angle/close-angle_ptr_no_test_ok.c sendmail/CVE-2002-1337/close_angle/close-angle_ptr_two_tests_bad.c sendmail/CVE-2002-1337/close_angle/close-angle_ptr_one_test_ok.c sendmail/CVE-2002-1337/close_angle/close-angle_ptr_one_test_bad.c sendmail/CVE-2002-1337/close_angle/close-angle_ptr_no_test_bad.c sendmail/CVE-2002-1337/close_angle/close-angle_ptr_two_tests_ok.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/0000777000000000000000000000000013571573400020657 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/0000777000000000000000000000000013571573400021775 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/README0000666000000000000000000000501413571573400022655 0ustar -= CA-1999-14 =- Vulnerable versions: NXT: BIND [8.2, 8.2.2) SIG: BIND [4.9.5, 8.x] File(s): src/bin/named/ns_resp.c Download from: ftp://ftp.isc.org/isc/bind/src/DEPRECATED/8.2/bind-8.2-src.tar.gz Domain: DNS Server _ Vulnerable Functions and Buffers _ There are two unrelated vulnerabilities in rrextract(), reported in the same CERT advisory. rrextract() processes a Resource Record in packet form, and extracts fields out of it to store in BIND's internal database format. (For the format of Resource Records, see http://en.wikipedia.org/wiki/Domain_Name_System and http://tools.ietf.org/html/rfc1035). The Resource Record packet is an array of unsigned chars, ie. bytes. The data read from the packet initializes many of rrextract()'s local variables. The "nxt bug" can overflow the local buffer data[] in rrextract() via a call to memcpy(). The size argument comes from a call to dn_expand(), and there is no check that this is less than or equal to the size of dest[]. Creating a path to this error is complicated by numerous reads of the input buffer, and much arithmetic on pointers into the buffer. The "sig bug" is similar -- the data[] buffer is also overflowed. This time, the size argument for memcpy() is a function of both a call to dn_expand(), and the dlen field read out of the input buffer. It is possible for this size to be a negative signed int, which causes memcpy() to interpret it as a large unsigned amount. ** NOTE ** For a tool to find the "sig bug", it must have support for specific integer overflow semantics. The "nxt bug" is "b1" in Zitser's suite, and the "sig bug" is b2. These examples involve reading data "off-the-wire", offsets into packets which aren't necessarily related through IF conditions, and a bunch of pointer arithmetic based on these offsets. These factors make it difficult for SMC; hence, the current decompositions are significantly simpler than Zitser's. _ Simplifications _ rrextract-nxt: simp - aims for as little detail as possible while preserving the vulnerability two-expands - calls dn_expand() a second time, and increments cp by the result expand_vars - reads several fields out of the rrp packet rrextract-sig: vars - reads a variable out of rrp expand - uses dn_expand() and advances cp and cp1 simp - does neither of the above both - does both of the above _ Decomposed Programs _ bind.h bind.c rrextract-nxt/ simp_{ok,bad}.c two_expands_{ok,bad}.c expands_vars_{ok,bad}.c rrextract-sig/ simp_{ok,bad}.c vars_{ok,bad}.c expand_{ok,bad}.c both_{ok,bad}.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/bind.c0000666000000000000000000000037613571573400023063 0ustar #include "bind.h" int dn_expand(const u_char *msg, const u_char *eomorig, const u_char *comp_dn, char *exp_dn, int length) { if (nondet_int ()) return -1; else { exp_dn[length-1] = (u_char) EOS; } return strlen(comp_dn); } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/bind.h0000666000000000000000000000322313571573400023062 0ustar #include "../../../../lib/stubs.h" /* Make u_char be a char. If we use unsigned chars, SatAbs gives us an * error whenever we use strlen, since it won't iterate over a string * of unsigned chars passed as chars. */ typedef char u_char; typedef int u_int; typedef int u_int32_t; /* Buffer being overflowed has size (MAXDATA*2); I believe this is * because its a buffer of bytes, and two bytes keep being written at * a time. * * Overflowed buffers in rrextract-sig/ may have an additional * SPACE_FOR_VARS elements. */ #define MAXDATA BASE_SZ /* Input buffer has this size, plus some constant depent on how many * bytes get skipped before the operations involved in the * overflow. This constant is different different variants (and is 0 * for most of them). * * Input buffers buffers in rrextract-sig/ may have an additional * SPACE_FOR_VARS elements.*/ #define MSGLEN MAXDATA + 2 /* We don't loop over this, so we don't really care what it is. */ #define NAMELEN 3 #define INT16SZ 2 #define INT32SZ 4 #define CLASS_MAX 100 #define MAXIMUM_TTL 101 /* Macros rrextract() uses */ #define GETSHORT(to, from) \ do {(to) = nondet_short(); (from) += INT16SZ;} while(0) #define GETLONG(to, from) \ do {(to) = nondet_long(); (from) += INT32SZ;} while(0) #define BOUNDS_CHECK(ptr, count) \ do {if ((ptr) + (count) > eom) return -1;} while(0) /* dn_expand -- "domain name expand" * -- expands comp_dn (compressed domain name) to exp_dn (full domain name) * -- returns -1 on error, or else strlen(comp_dn) */ int dn_expand(const u_char *msg, const u_char *eomorig, const u_char *comp_dn, char *exp_dn, int length); extern int nondet_int(); frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/frama-c-journal.ml0000666000000000000000000000054513571573400025311 0ustar (* Frama-C journal generated at 16:32 the 05/09/2008 *) (* Running *) let () = Journal.run () let () = Cmdline.ForceValues.set true let () = Cmdline.Files.set ["bind.c"; ] let () = File.init_from_cmdline () let () = !Db.Syntactic_callgraph.dump () (* exception raised on: *) let __ : unit = !Db.Value.compute () (* Finished *) let () = Journal.finished () frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/0000777000000000000000000000000013571573400024622 5ustar ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/bind_rrxtract_nxt.errframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/bind_rrxtract_n0000666000000000000000000000247413571573400027736 0ustar bind/CA-1999-14/rrextract-nxt/simp_bad.c:15: Warning: entering loop for the first time No code for function nondet_short, default assigns generated bind/CA-1999-14/rrextract-nxt/simp_bad.c:16: Warning: entering loop for the first time No code for function dn_expand, default assigns generated No code for function nondet_int, default assigns generated bind/CA-1999-14/rrextract-nxt/simp_bad.c:29: Warning: assigning non deterministic value for the first time ../../lib/stubs.c:236: Warning: entering loop for the first time ../../lib/stubs.c:236: Warning: (TODO: emit a proper alarm) accessing uninitialized left-value: *(s + i) ../../lib/stubs.c:236: Warning: out of bounds read. assert \valid(s + i); ../../lib/stubs.c:64: Warning: Assertion got status unknown. ../../lib/stubs.c:67: Warning: entering loop for the first time ../../lib/stubs.c:68: Warning: out of bounds read. assert \valid((char *)src + i); ../../lib/stubs.c:68: Warning: (TODO: emit a proper alarm) accessing uninitialized left-value: *((char *)src + i) ../../lib/stubs.c:68: Warning: out of bounds write. assert \valid((char *)dest + i); [dominators] computing for function r_memcpy [dominators] done for function r_memcpy [dominators] computing for function strlen [dominators] done for function strlen ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/expands_vars_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/expands_vars_ba0000666000000000000000000000243013571573400027703 0ustar #include "../bind.h" #define BYTES_TO_SKIP 10 static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; u_int32_t ttl; u_char data[MAXDATA*2]; data [(MAXDATA*2)-1] = EOS; cp = rrp; eom = msg + msglen; if ((n = dn_expand(msg, eom, cp, (char *) dname, namelen)) < 0) { return (-1); } cp += n; BOUNDS_CHECK(cp, 2*INT16SZ + INT32SZ + INT16SZ); GETSHORT(type, cp); GETSHORT(class, cp); if (class > CLASS_MAX) { return (-1); } GETLONG(ttl, cp); if (ttl > MAXIMUM_TTL) { ttl = 0; } GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); rdatap = cp; if (nondet_int()) { return (-1); } /* Cut the switch.... */ n = dn_expand(msg, eom, cp, (char *)data, sizeof data); if (n < 0) { return (-1); } if (nondet_int()) { return (-1); } cp += n; cp1 = data + strlen((char *)data) + 1; /* BAD */ r_memcpy(cp1, cp, dlen - n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+BYTES_TO_SKIP]; name [NAMELEN-1] = EOS; msg [MSGLEN+BYTES_TO_SKIP-1] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/expands_vars_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/expands_vars_ok0000666000000000000000000000256113571573400027737 0ustar #include "../bind.h" #define BYTES_TO_SKIP 10 static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; int n1,n2; u_int32_t ttl; u_char data[MAXDATA*2]; data [(MAXDATA*2)-1] = EOS; cp = rrp; eom = msg + msglen; if ((n = dn_expand(msg, eom, cp, (char *) dname, namelen)) < 0) { return (-1); } cp += n; BOUNDS_CHECK(cp, 2*INT16SZ + INT32SZ + INT16SZ); GETSHORT(type, cp); GETSHORT(class, cp); if (class > CLASS_MAX) { return (-1); } GETLONG(ttl, cp); if (ttl > MAXIMUM_TTL) { ttl = 0; } GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); rdatap = cp; if (nondet_int()) { return (-1); } /* Cut the switch.... */ n = dn_expand(msg, eom, cp, (char *)data, sizeof data); if (n < 0) { return (-1); } if (nondet_int()) { return (-1); } cp += n; n1 = strlen((char *)data) + 1; cp1 = data + n1 + 1; n2 = dlen - n; if (n2 > sizeof data - n1) { return -1; } /* OK */ r_memcpy(cp1, cp, n2); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+BYTES_TO_SKIP]; name [NAMELEN-1] = EOS; msg [MSGLEN+BYTES_TO_SKIP-1] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/frama-c-journal.mlframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/frama-c-journal0000666000000000000000000000062013571573400027521 0ustar (* Frama-C journal generated at 16:10 the 26/08/2008 *) (* Running *) let () = Journal.run () let () = Cmdline.ForceValues.set true let () = Cmdline.Files.set ["expands_vars_bad.c"; ] let () = Cmdline.Files.set ["../bind.c"; "expands_vars_bad.c"; ] let () = File.init_from_cmdline () let () = !Db.Syntactic_callgraph.dump () let () = !Db.Value.compute () (* Finished *) let () = Journal.finished () frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/frama-c.err0000666000000000000000000000222613571573400026644 0ustar bind/CA-1999-14/rrextract-nxt/simp_bad.c:15: Warning: entering loop for the first time No code for function nondet_short, default assigns generated bind/CA-1999-14/rrextract-nxt/simp_bad.c:16: Warning: entering loop for the first time No code for function dn_expand, default assigns generated No code for function nondet_int, default assigns generated bind/CA-1999-14/rrextract-nxt/simp_bad.c:29: Warning: assigning non deterministic value for the first time ../../lib/stubs.c:236: Warning: entering loop for the first time ../../lib/stubs.c:236: Warning: (TODO: emit a proper alarm) accessing uninitialized left-value: *(s + i) ../../lib/stubs.c:236: Warning: out of bounds read. assert \valid(s + i); ../../lib/stubs.c:64: Warning: Assertion got status unknown. ../../lib/stubs.c:67: Warning: entering loop for the first time ../../lib/stubs.c:68: Warning: out of bounds read. assert \valid((char *)src + i); ../../lib/stubs.c:68: Warning: (TODO: emit a proper alarm) accessing uninitialized left-value: *((char *)src + i) ../../lib/stubs.c:68: Warning: out of bounds write. assert \valid((char *)dest + i); frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/simp_bad.c0000666000000000000000000000166513571573400026554 0ustar #include "../bind.h" #define SPACE_FOR_VARS 2 static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; u_char data[MAXDATA*2 + SPACE_FOR_VARS]; data [(MAXDATA*2 + SPACE_FOR_VARS)-1] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Cut a bunch of stuff which we can reintroduce later. */ n = dn_expand(msg, eom, cp, (char *)data, sizeof data); if (n < 0) { return (-1); } if (nondet_int()) { return (-1); } cp += n; cp1 = data + strlen((char *)data) + 1; /* BAD */ r_memcpy(cp1, cp, dlen - n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN]; name [NAMELEN-1] = EOS; msg [MSGLEN-1] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/simp_ok.c0000666000000000000000000000202013571573400026421 0ustar #include "../bind.h" #define SPACE_FOR_VARS 2 static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; int n1,n2; u_char data[MAXDATA*2 + SPACE_FOR_VARS]; data [(MAXDATA*2 + SPACE_FOR_VARS)-1] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Cut a bunch of stuff which we can reintroduce later. */ n = dn_expand(msg, eom, cp, (char *)data, sizeof data); if (n < 0) { return (-1); } if (nondet_int()) { return (-1); } cp += n; n1 = strlen((char *)data) + 1; cp1 = data + n1 + 1; n2 = dlen - n; if (n2 > sizeof data - n1) { return -1; } /* OK */ r_memcpy(cp1, cp, n2); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN]; name [NAMELEN-1] = EOS; msg [MSGLEN-1] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/two_expands_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/two_expands_bad0000666000000000000000000000203713571573400027710 0ustar #include "../bind.h" #define SPACE_FOR_VARS 2 static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; u_char data[MAXDATA*2 + SPACE_FOR_VARS]; data [(MAXDATA*2 + SPACE_FOR_VARS)-1] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); if ((n = dn_expand(msg, eom, cp, (char *) dname, namelen)) < 0) { return (-1); } cp += n; /* Cut a bunch of stuff which we can reintroduce later. */ n = dn_expand(msg, eom, cp, (char *)data, sizeof data); if (n < 0) { return (-1); } if (nondet_int()) { return (-1); } cp += n; cp1 = data + strlen((char *)data) + 1; /* BAD */ r_memcpy(cp1, cp, dlen - n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN]; name [NAMELEN-1] = EOS; msg [MSGLEN-1] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/two_expands_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-nxt/two_expands_ok.0000666000000000000000000000217213571573400027651 0ustar #include "../bind.h" #define SPACE_FOR_VARS 2 static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; int n1, n2; u_char data[MAXDATA*2 + SPACE_FOR_VARS]; data [(MAXDATA*2 + SPACE_FOR_VARS)-1] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); if ((n = dn_expand(msg, eom, cp, (char *) dname, namelen)) < 0) { return (-1); } cp += n; /* Cut a bunch of stuff which we can reintroduce later. */ n = dn_expand(msg, eom, cp, (char *)data, sizeof data); if (n < 0) { return (-1); } if (nondet_int()) { return (-1); } cp += n; n1 = strlen((char *)data) + 1; cp1 = data + n1 + 1; n2 = dlen - n; if (n2 > sizeof data - n1) { return -1; } /* OK */ r_memcpy(cp1, cp, n2); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN]; name [NAMELEN-1] = EOS; msg [MSGLEN-1] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-sig/0000777000000000000000000000000013571573400024573 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-sig/both_bad.c0000666000000000000000000000337513571573400026511 0ustar #include "../bind.h" #define SPACE_FOR_VARS INT32SZ static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { /* cp is used to read data from rrp[] (the Resource Record) * cp1 is used to write data into data[] * However, we sometimes abuse cp1 and use it for reading too. :-/ */ u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; long origTTL; u_char data[MAXDATA*2+SPACE_FOR_VARS]; data [(MAXDATA*2)-1+SPACE_FOR_VARS] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Begin case T_SIG: */ /* Just read one variable --- the original reads several. */ BOUNDS_CHECK(cp, SPACE_FOR_VARS); cp1 = cp; GETLONG(origTTL, cp1); /* Skip checks on times which are present in the original. */ /* Copy over initial fields, which we read above. */ cp1 = (u_char *)data; BOUNDS_CHECK(cp, SPACE_FOR_VARS); memcpy(cp1, cp, SPACE_FOR_VARS); cp += SPACE_FOR_VARS; cp1 += SPACE_FOR_VARS; /* Expand the domain name, set cp1 past the end of the uncompressed * domain name. */ n = dn_expand(msg, eom, cp, (char *)cp1, (sizeof data)); if (n < 0) { return (-1); } cp += n; cp1 += strlen((char*)cp1)+1; /* Figure out the length of the "signature" to copy over and copy it. */ n = dlen - (SPACE_FOR_VARS + n); if (n > (int)(sizeof data) - (cp1 - (u_char *)data)) { return (-1); /* out of room! */ } /* BAD */ r_memcpy(cp1, cp, n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+SPACE_FOR_VARS]; name [NAMELEN-1] = EOS; msg [MSGLEN-1+SPACE_FOR_VARS] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-sig/both_ok.c0000666000000000000000000000336713571573400026375 0ustar #include "../bind.h" #define SPACE_FOR_VARS INT32SZ static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { /* cp is used to read data from rrp[] (the Resource Record) * cp1 is used to write data into data[] * However, we sometimes abuse cp1 and use it for reading too. :-/ */ u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; long origTTL; u_char data[MAXDATA*2+SPACE_FOR_VARS]; data [(MAXDATA*2)-1+SPACE_FOR_VARS] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Begin case T_SIG: */ /* Just read one variable --- the original reads several. */ BOUNDS_CHECK(cp, SPACE_FOR_VARS); cp1 = cp; GETLONG(origTTL, cp1); /* Skip checks on times which are present in the original. */ /* Copy over initial fields, which we read above. */ cp1 = (u_char *)data; BOUNDS_CHECK(cp, SPACE_FOR_VARS); memcpy(cp1, cp, SPACE_FOR_VARS); cp += SPACE_FOR_VARS; cp1 += SPACE_FOR_VARS; /* Expand the domain name, set cp1 past the end of the uncompressed * domain name. */ n = dn_expand(msg, eom, cp, (char *)cp1, (sizeof data)); if (n < 0) { return (-1); } cp += n; cp1 += strlen((char*)cp1)+1; /* Figure out the length of the "signature" to copy over and copy it. */ n = dlen - (SPACE_FOR_VARS + n); if (n > (sizeof data) - (cp1 - (u_char *)data)) { return (-1); /* out of room! */ } /* OK */ r_memcpy(cp1, cp, n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+SPACE_FOR_VARS]; name [NAMELEN-1] = EOS; msg [MSGLEN-1+SPACE_FOR_VARS] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-sig/expand_bad.c0000666000000000000000000000322713571573400027030 0ustar #include "../bind.h" #define SPACE_FOR_VARS INT32SZ static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { /* cp is used to read data from rrp[] (the Resource Record) * cp1 is used to write data into data[] * However, we sometimes abuse cp1 and use it for reading too. :-/ */ u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; long origTTL; u_char data[MAXDATA*2+SPACE_FOR_VARS]; data [(MAXDATA*2)-1+SPACE_FOR_VARS] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Begin case T_SIG: */ /* Don't read any variables. */ /* Skip checks on times which are present in the original. */ /* Copy over initial fields, which we read above. */ cp1 = (u_char *)data; BOUNDS_CHECK(cp, SPACE_FOR_VARS); memcpy(cp1, cp, SPACE_FOR_VARS); cp += SPACE_FOR_VARS; cp1 += SPACE_FOR_VARS; /* Expand the domain name, set cp1 past the end of the uncompressed * domain name. */ n = dn_expand(msg, eom, cp, (char *)cp1, (sizeof data)); if (n < 0) { return (-1); } cp += n; cp1 += strlen((char*)cp1)+1; /* Figure out the length of the "signature" to copy over and copy it. */ n = dlen - (SPACE_FOR_VARS + n); if (n > (int)(sizeof data) - (cp1 - (u_char *)data)) { return (-1); /* out of room! */ } /* BAD */ r_memcpy(cp1, cp, n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+SPACE_FOR_VARS]; name [NAMELEN-1] = EOS; msg [MSGLEN-1+SPACE_FOR_VARS] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-sig/expand_ok.c0000666000000000000000000000322113571573400026705 0ustar #include "../bind.h" #define SPACE_FOR_VARS INT32SZ static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { /* cp is used to read data from rrp[] (the Resource Record) * cp1 is used to write data into data[] * However, we sometimes abuse cp1 and use it for reading too. :-/ */ u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; long origTTL; u_char data[MAXDATA*2+SPACE_FOR_VARS]; data [(MAXDATA*2)-1+SPACE_FOR_VARS] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Begin case T_SIG: */ /* Don't read any variables. */ /* Skip checks on times which are present in the original. */ /* Copy over initial fields, which we read above. */ cp1 = (u_char *)data; BOUNDS_CHECK(cp, SPACE_FOR_VARS); memcpy(cp1, cp, SPACE_FOR_VARS); cp += SPACE_FOR_VARS; cp1 += SPACE_FOR_VARS; /* Expand the domain name, set cp1 past the end of the uncompressed * domain name. */ n = dn_expand(msg, eom, cp, (char *)cp1, (sizeof data)); if (n < 0) { return (-1); } cp += n; cp1 += strlen((char*)cp1)+1; /* Figure out the length of the "signature" to copy over and copy it. */ n = dlen - (SPACE_FOR_VARS + n); if (n > (sizeof data) - (cp1 - (u_char *)data)) { return (-1); /* out of room! */ } /* OK */ r_memcpy(cp1, cp, n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+SPACE_FOR_VARS]; name [NAMELEN-1] = EOS; msg [MSGLEN-1+SPACE_FOR_VARS] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-sig/simp_bad.c0000666000000000000000000000304013571573400026512 0ustar #include "../bind.h" #define SPACE_FOR_VARS INT32SZ static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { /* cp is used to read data from rrp[] (the Resource Record) * cp1 is used to write data into data[] * However, we sometimes abuse cp1 and use it for reading too. :-/ */ u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; long origTTL; u_char data[MAXDATA*2+SPACE_FOR_VARS]; data [(MAXDATA*2)-1+SPACE_FOR_VARS] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Begin case T_SIG: */ /* Don't read any variables. */ /* Skip checks on times which are present in the original. */ /* Copy over initial fields, which we read above. */ cp1 = (u_char *)data; BOUNDS_CHECK(cp, SPACE_FOR_VARS); memcpy(cp1, cp, SPACE_FOR_VARS); cp += SPACE_FOR_VARS; cp1 += SPACE_FOR_VARS; /* No dn_expand(), no incrementing the pointers. */ n = nondet_int(); if (n < 0) { return (-1); } /* Figure out the length of the "signature" to copy over and copy it. */ n = dlen - (SPACE_FOR_VARS + n); if (n > (int)(sizeof data) - (cp1 - (u_char *)data)) { return (-1); /* out of room! */ } /* BAD */ r_memcpy(cp1, cp, n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+SPACE_FOR_VARS]; name [NAMELEN-1] = EOS; msg [MSGLEN-1+SPACE_FOR_VARS] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-sig/simp_ok.c0000666000000000000000000000303213571573400026376 0ustar #include "../bind.h" #define SPACE_FOR_VARS INT32SZ static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { /* cp is used to read data from rrp[] (the Resource Record) * cp1 is used to write data into data[] * However, we sometimes abuse cp1 and use it for reading too. :-/ */ u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; long origTTL; u_char data[MAXDATA*2+SPACE_FOR_VARS]; data [(MAXDATA*2)-1+SPACE_FOR_VARS] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Begin case T_SIG: */ /* Don't read any variables. */ /* Skip checks on times which are present in the original. */ /* Copy over initial fields, which we read above. */ cp1 = (u_char *)data; BOUNDS_CHECK(cp, SPACE_FOR_VARS); memcpy(cp1, cp, SPACE_FOR_VARS); cp += SPACE_FOR_VARS; cp1 += SPACE_FOR_VARS; /* No dn_expand(), no incrementing the pointers. */ n = nondet_int(); if (n < 0) { return (-1); } /* Figure out the length of the "signature" to copy over and copy it. */ n = dlen - (SPACE_FOR_VARS + n); if (n > (sizeof data) - (cp1 - (u_char *)data)) { return (-1); /* out of room! */ } /* OK */ r_memcpy(cp1, cp, n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+SPACE_FOR_VARS]; name [NAMELEN-1] = EOS; msg [MSGLEN-1+SPACE_FOR_VARS] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-sig/vars_bad.c0000666000000000000000000000320613571573400026521 0ustar #include "../bind.h" #define SPACE_FOR_VARS INT32SZ static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { /* cp is used to read data from rrp[] (the Resource Record) * cp1 is used to write data into data[] * However, we sometimes abuse cp1 and use it for reading too. :-/ */ u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; long origTTL; u_char data[MAXDATA*2+SPACE_FOR_VARS]; data [(MAXDATA*2)-1+SPACE_FOR_VARS] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Begin case T_SIG: */ /* Just read one variable --- the original reads several. */ BOUNDS_CHECK(cp, SPACE_FOR_VARS); cp1 = cp; GETLONG(origTTL, cp1); /* Skip checks on times which are present in the original. */ /* Copy over initial fields, which we read above. */ cp1 = (u_char *)data; BOUNDS_CHECK(cp, SPACE_FOR_VARS); memcpy(cp1, cp, SPACE_FOR_VARS); cp += SPACE_FOR_VARS; cp1 += SPACE_FOR_VARS; /* No dn_expand(), no incrementing the pointers. */ n = nondet_int(); if (n < 0) { return (-1); } /* Figure out the length of the "signature" to copy over and copy it. */ n = dlen - (SPACE_FOR_VARS + n); if (n > (int)(sizeof data) - (cp1 - (u_char *)data)) { return (-1); /* out of room! */ } /* BAD */ r_memcpy(cp1, cp, n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+SPACE_FOR_VARS]; name [NAMELEN-1] = EOS; msg [MSGLEN-1+SPACE_FOR_VARS] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CA-1999-14/rrextract-sig/vars_ok.c0000666000000000000000000000320013571573400026376 0ustar #include "../bind.h" #define SPACE_FOR_VARS INT32SZ static int rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) { /* cp is used to read data from rrp[] (the Resource Record) * cp1 is used to write data into data[] * However, we sometimes abuse cp1 and use it for reading too. :-/ */ u_char *eom, *cp, *cp1, *rdatap; u_int class, type, dlen; int n; long origTTL; u_char data[MAXDATA*2+SPACE_FOR_VARS]; data [(MAXDATA*2)-1+SPACE_FOR_VARS] = EOS; cp = rrp; eom = msg + msglen; GETSHORT(dlen, cp); BOUNDS_CHECK(cp, dlen); /* Begin case T_SIG: */ /* Just read one variable --- the original reads several. */ BOUNDS_CHECK(cp, SPACE_FOR_VARS); cp1 = cp; GETLONG(origTTL, cp1); /* Skip checks on times which are present in the original. */ /* Copy over initial fields, which we read above. */ cp1 = (u_char *)data; BOUNDS_CHECK(cp, SPACE_FOR_VARS); memcpy(cp1, cp, SPACE_FOR_VARS); cp += SPACE_FOR_VARS; cp1 += SPACE_FOR_VARS; /* No dn_expand(), no incrementing the pointers. */ n = nondet_int(); if (n < 0) { return (-1); } /* Figure out the length of the "signature" to copy over and copy it. */ n = dlen - (SPACE_FOR_VARS + n); if (n > (sizeof data) - (cp1 - (u_char *)data)) { return (-1); /* out of room! */ } /* OK */ r_memcpy(cp1, cp, n); return 0; } int main(){ int msglen, ret; u_char *dp; u_char name [NAMELEN]; u_char msg [MSGLEN+SPACE_FOR_VARS]; name [NAMELEN-1] = EOS; msg [MSGLEN-1+SPACE_FOR_VARS] = EOS; msglen = MSGLEN; dp = msg; ret = rrextract(msg, msglen, dp, name, NAMELEN); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/0000777000000000000000000000000013571573400022233 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/README0000666000000000000000000000217713571573400023122 0ustar -= CVE-2001-0011 =- Vulnerable versions: BIND 4.9.x, where x < 8 File(s): named/ns_forw.c Download from: ftp://ftp.isc.org/isc/bind/src/DEPRECATED/4.9.11/bind-4.9.11-REL.tar.gz Domain: DNS Server _ Vulnerable Functions and Buffers _ nslookupComplain uses sprintf() to overflow a local buffer. The input buffers used to overflow the output buffer are passed through many functions, and which contain data that must be logged. The program does not do heavy buffer manipulations, but the input buffers are long-lived, so the model-checker needs to discover long paths through the code. We observe two things: 1. We cannot see any way in which this code is "special" due to its involving a buffer overflow. 2. This code is much easier to analyze than many smaller programs containing buffer overflows, since it doesn't do much string manipulation. We take only a limited slice of this program -- pulling in more of the original program decreases the comprehensibility of the example, without leading to any useful variable static measures. _ Decomposed Programs _ bind.h nslookupComplain/ small_bad.c med_bad.c big_bad.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/bind.h0000666000000000000000000000400413571573400023316 0ustar #include "../../../../lib/stubs.h" /* Size of the buffer being overflowed. */ #define BUFSZ BASE_SZ /* Size of the input buffer. */ #define INSZ BUFSZ + 3 typedef char u_char; typedef short int16_t; typedef int time_t; typedef int u_int; typedef int uint32_t; typedef long u_long; struct databuf { struct databuf *d_next; /* linked list */ int16_t d_type; /* type number */ u_char d_data[sizeof(char*)]; /* malloc'd (padded) */ int16_t d_class; /* class number */ int d_flags; /* see below */ int16_t d_zone; /* zone number or 0 for the cache */ }; struct namebuf { u_int n_hashval; /* hash value of n_dname */ struct namebuf *n_next; /* linked list */ struct databuf *n_data; /* data records */ struct namebuf *n_parent; /* parent domain */ struct hashbuf *n_hash; /* hash table for children */ char _n_name[sizeof(void*)]; /* Counted str, malloc'ed. */ }; struct timeval { time_t tv_sec; /* Seconds. */ }; /* Internet address. */ typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; struct sockaddr_in { short sin_family; // e.g. AF_INET unsigned short sin_port; // e.g. htons(3490) struct in_addr sin_addr; // see struct in_addr, below }; #define NSMAX 16 /* from bind's ns_defs.h */ struct qinfo { struct databuf *q_usedns[NSMAX]; /* databuf for NS that we've tried */ u_char q_naddr; /* number of addr's in q_addr */ u_char q_nusedns; /* number of elements in q_usedns[] */ }; #define T_A 1 #define T_NS 2 #define INIT_REFRESH 600 /* retry time for initial secondary */ /* contact (10 minutes) */ #define NAME(nb) ((nb)._n_name + 1) #define C_ANY 255 /* wildcard match */ #define T_ANY 255 /* wildcard match */ /* * d_flags definitions */ #define DB_F_HINT 0x01 /* databuf belongs to fcachetab */ #define DB_F_ACTIVE 0x02 /* databuf is linked into a cache */ #define DB_Z_CACHE (0) /* cache-zone-only db_dump() */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/nslookupComplain/0000777000000000000000000000000013571573400025570 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/nslookupComplain/big_bad.c0000666000000000000000000001224413571573400027306 0ustar #include "../bind.h" extern int nondet_int(); /* Avoid mallocing databufs and namebufs. */ struct databuf dummybuf; struct namebuf dummyNameBuf; struct databuf dummybuf2; struct timeval tt; /* Another completely unsound stub brought to you by the Verisec Project. */ const char *p_type (int type) { return NULL; } /* Since I'm not providing a complete model, this'll complain about some * invalid pointer dereferences. */ int haveComplained (const char *tag1, const char *tag2) { struct complaint { const char *tag1, *tag2; time_t expire; struct complaint *next; }; static struct complaint *List = NULL; struct complaint *cur, *next, *prev; int r = 0; struct complaint dummy; for (cur = List, prev = NULL; cur; prev = cur, cur = next) { next = cur->next; if (tt.tv_sec > cur->expire) { if (prev) prev->next = next; else List = next; //free((char*) cur); cur = prev; } else if ((tag1 == cur->tag1) && (tag2 == cur->tag2)) { r++; } } if (!r) { cur = &dummy;//(struct complaint *)malloc(sizeof(struct complaint)); if (cur) { cur->tag1 = tag1; cur->tag2 = tag2; cur->expire = tt.tv_sec + INIT_REFRESH; /* "10:00" */ cur->next = NULL; if (prev) prev->next = cur; else List = cur; } } return (r); } static void nslookupComplain(const char *sysloginfo, const char *net_queryname, const char *complaint, const char *net_dname, const struct databuf *a_rr, const struct databuf *nsdp) { char queryname[INSZ+1], dname[INSZ+1]; const char *a, *ns; const char *a_type; int print_a; strncpy(queryname, net_queryname, sizeof queryname); queryname[(sizeof queryname) - 1] = EOS; strncpy(dname, net_dname, sizeof dname); dname[(sizeof dname) - 1] = EOS; if (sysloginfo && queryname && !haveComplained(queryname, complaint)) { char buf[BUFSZ]; a = ns = (char *)NULL; print_a = (a_rr->d_type == T_A); a_type = p_type(a_rr->d_type); if ( a != NULL || ns != NULL) { /* BAD */ r_strcpy (buf, sysloginfo); } else { /* BAD */ r_strcpy (buf, sysloginfo); } } } int match(struct databuf *dp, int class, int type) { if (dp->d_class != class && class != C_ANY) return (0); if (dp->d_type != type && type != T_ANY) return (0); return (1); } /* Really dumb stub. */ struct namebuf * nlookup(const char *name, struct hashbuf **htpp, const char **fname, int insert) { dummyNameBuf.n_data = &dummybuf2; /* I suspect SatAbs assumes globals are initialized to 0 -- I really shouldn't need to be hard-wiring these. - Tom */ dummybuf2.d_type = T_NS; dummybuf2.d_zone = 1; return &dummyNameBuf; } int findMyZone(struct namebuf *np, int class) { return nondet_int (); } int nslookup(struct databuf *nsp[], struct qinfo *qp, const char *syslogdname, const char *sysloginfo) { struct namebuf *np; struct databuf *dp, *nsdp; struct qserv *qs; int n; u_int i; struct hashbuf *tmphtp; char *dname; const char *fname; int oldn, naddr, class, found_arr, potential_ns; time_t curtime; potential_ns = 0; n = qp->q_naddr; naddr = n; curtime = (u_long) tt.tv_sec; while (1) { nsdp = *nsp; nsp++; if (nsdp == NULL) break; class = nsdp->d_class; dname = (char *)nsdp->d_data; for (i = 0; i < qp->q_nusedns; i++) { if (qp->q_usedns[i] == nsdp) { goto skipserver; } } /* Heap-allocated pointers seem to break SatAbs. */ /*tmphtp = ((nsdp->d_flags & DB_F_HINT) ?fcachetab :hashtab);*/ np = nlookup(dname, &tmphtp, &fname, 1); if (np == NULL) { found_arr = 0; goto need_sysquery; } if (fname != dname) { if (findMyZone(np, class) == DB_Z_CACHE) { assert (np != NULL); for (; np != NULL; /*np = np_parent(np)*/) { for (dp = np->n_data; dp; dp = dp->d_next) { if (match(dp, class, T_NS)) { /* SatAbs won't accept just "if (dp->d_zone)" :-/ */ if (dp->d_zone != 0) { //assert (0); static char *complaint = "Glue A RR missing"; nslookupComplain(sysloginfo, syslogdname, complaint, dname, dp, nsdp); goto skipserver; } else { found_arr = 0; goto need_sysquery; } } } } found_arr = 0; goto need_sysquery; } else { continue; } } break; } /* Totally bogus GOTO targets. */ need_sysquery: skipserver: return (n - naddr); } int main () { struct databuf *nsp[2]; struct qinfo qp; char sysloginfo [INSZ]; char syslogdname [INSZ]; nsp[0] = &dummybuf; nsp[1] = NULL; sysloginfo[INSZ-1] = EOS; syslogdname[INSZ-1] = EOS; nslookup(nsp, &qp, &sysloginfo, &syslogdname); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/nslookupComplain/big_ok.c0000666000000000000000000001226213571573400027171 0ustar #include "../bind.h" extern int nondet_int(); /* Avoid mallocing databufs and namebufs. */ struct databuf dummybuf; struct namebuf dummyNameBuf; struct databuf dummybuf2; struct timeval tt; /* Another completely unsound stub brought to you by the Verisec Project. */ const char *p_type (int type) { return NULL; } /* Since I'm not providing a complete model, this'll complain about some * invalid pointer dereferences. */ int haveComplained (const char *tag1, const char *tag2) { struct complaint { const char *tag1, *tag2; time_t expire; struct complaint *next; }; static struct complaint *List = NULL; struct complaint *cur, *next, *prev; int r = 0; struct complaint dummy; for (cur = List, prev = NULL; cur; prev = cur, cur = next) { next = cur->next; if (tt.tv_sec > cur->expire) { if (prev) prev->next = next; else List = next; //free((char*) cur); cur = prev; } else if ((tag1 == cur->tag1) && (tag2 == cur->tag2)) { r++; } } if (!r) { cur = &dummy;//(struct complaint *)malloc(sizeof(struct complaint)); if (cur) { cur->tag1 = tag1; cur->tag2 = tag2; cur->expire = tt.tv_sec + INIT_REFRESH; /* "10:00" */ cur->next = NULL; if (prev) prev->next = cur; else List = cur; } } return (r); } static void nslookupComplain(const char *sysloginfo, const char *net_queryname, const char *complaint, const char *net_dname, const struct databuf *a_rr, const struct databuf *nsdp) { char queryname[INSZ+1], dname[INSZ+1]; const char *a, *ns; const char *a_type; int print_a; strncpy(queryname, net_queryname, sizeof queryname); queryname[(sizeof queryname) - 1] = EOS; strncpy(dname, net_dname, sizeof dname); dname[(sizeof dname) - 1] = EOS; if (sysloginfo && queryname && !haveComplained(queryname, complaint)) { char buf[BUFSZ]; a = ns = (char *)NULL; print_a = (a_rr->d_type == T_A); a_type = p_type(a_rr->d_type); if ( a != NULL || ns != NULL) { /* OK */ r_strncpy (buf, sysloginfo, BUFSZ); } else { /* OK */ r_strncpy (buf, sysloginfo, BUFSZ); } } } int match(struct databuf *dp, int class, int type) { if (dp->d_class != class && class != C_ANY) return (0); if (dp->d_type != type && type != T_ANY) return (0); return (1); } /* Really dumb stub. */ struct namebuf * nlookup(const char *name, struct hashbuf **htpp, const char **fname, int insert) { dummyNameBuf.n_data = &dummybuf2; /* I suspect SatAbs assumes globals are initialized to 0 -- I really shouldn't need to be hard-wiring these. - Tom */ dummybuf2.d_type = T_NS; dummybuf2.d_zone = 1; return &dummyNameBuf; } int findMyZone(struct namebuf *np, int class) { return nondet_int (); } int nslookup(struct databuf *nsp[], struct qinfo *qp, const char *syslogdname, const char *sysloginfo) { struct namebuf *np; struct databuf *dp, *nsdp; struct qserv *qs; int n; u_int i; struct hashbuf *tmphtp; char *dname; const char *fname; int oldn, naddr, class, found_arr, potential_ns; time_t curtime; potential_ns = 0; n = qp->q_naddr; naddr = n; curtime = (u_long) tt.tv_sec; while (1) { nsdp = *nsp; nsp++; if (nsdp == NULL) break; class = nsdp->d_class; dname = (char *)nsdp->d_data; for (i = 0; i < qp->q_nusedns; i++) { if (qp->q_usedns[i] == nsdp) { goto skipserver; } } /* Heap-allocated pointers seem to break SatAbs. */ /*tmphtp = ((nsdp->d_flags & DB_F_HINT) ?fcachetab :hashtab);*/ np = nlookup(dname, &tmphtp, &fname, 1); if (np == NULL) { found_arr = 0; goto need_sysquery; } if (fname != dname) { if (findMyZone(np, class) == DB_Z_CACHE) { assert (np != NULL); for (; np != NULL; /*np = np_parent(np)*/) { for (dp = np->n_data; dp; dp = dp->d_next) { if (match(dp, class, T_NS)) { /* SatAbs won't accept just "if (dp->d_zone)" :-/ */ if (dp->d_zone != 0) { //assert (0); static char *complaint = "Glue A RR missing"; nslookupComplain(sysloginfo, syslogdname, complaint, dname, dp, nsdp); goto skipserver; } else { found_arr = 0; goto need_sysquery; } } } } found_arr = 0; goto need_sysquery; } else { continue; } } break; } /* Totally bogus GOTO targets. */ need_sysquery: skipserver: return (n - naddr); } int main () { struct databuf *nsp[2]; struct qinfo qp; char sysloginfo [INSZ]; char syslogdname [INSZ]; nsp[0] = &dummybuf; nsp[1] = NULL; sysloginfo[INSZ-1] = EOS; syslogdname[INSZ-1] = EOS; nslookup(nsp, &qp, &sysloginfo, &syslogdname); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/nslookupComplain/med_bad.c0000666000000000000000000000465013571573400027314 0ustar #include "../bind.h" extern int nondet_int(); struct timeval tt; /* Another completely unsound stub brought to you by the Verisec Project. */ const char *p_type (int type) { return NULL; } int haveComplained (const char *tag1, const char *tag2) { struct complaint { const char *tag1, *tag2; time_t expire; struct complaint *next; }; static struct complaint *List = NULL; struct complaint *cur, *next, *prev; int r = 0; struct complaint dummy; for (cur = List, prev = NULL; cur; prev = cur, cur = next) { next = cur->next; if (tt.tv_sec > cur->expire) { if (prev) prev->next = next; else List = next; //free((char*) cur); cur = prev; } else if ((tag1 == cur->tag1) && (tag2 == cur->tag2)) { r++; } } if (!r) { cur = &dummy;//(struct complaint *)malloc(sizeof(struct complaint)); if (cur) { cur->tag1 = tag1; cur->tag2 = tag2; cur->expire = tt.tv_sec + INIT_REFRESH; // "10:00" cur->next = NULL; if (prev) prev->next = cur; else List = cur; } } return (r); } static void nslookupComplain(const char *sysloginfo, const char *net_queryname, const char *complaint, const char *net_dname, const struct databuf *a_rr, const struct databuf *nsdp) { char queryname[INSZ+1], dname[INSZ+1]; const char *a, *ns; const char *a_type; int print_a; strncpy(queryname, net_queryname, sizeof queryname); queryname[(sizeof queryname) - 1] = EOS; strncpy(dname, net_dname, sizeof dname); dname[(sizeof dname) - 1] = EOS; if (sysloginfo && queryname && !haveComplained(queryname, complaint)) { char buf[BUFSZ]; a = ns = (char *)NULL; print_a = (a_rr->d_type == T_A); a_type = p_type(a_rr->d_type); if ( a != NULL || ns != NULL) { /* BAD */ r_strcpy (buf, sysloginfo); } else { /* BAD */ r_strcpy (buf, sysloginfo); } } } int main () { char sysloginfo [INSZ]; char net_queryname [INSZ]; char net_dname [INSZ]; struct databuf a_rr; struct databuf nsdp; static char *complaint = "Glue A RR missing"; sysloginfo [INSZ-1] = EOS; net_queryname [INSZ-1] = EOS; net_dname [INSZ-1] = EOS; nslookupComplain (sysloginfo, net_queryname, complaint, net_dname, &a_rr, &nsdp); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/nslookupComplain/med_ok.c0000666000000000000000000000466613571573400027206 0ustar #include "../bind.h" extern int nondet_int(); struct timeval tt; /* Another completely unsound stub brought to you by the Verisec Project. */ const char *p_type (int type) { return NULL; } int haveComplained (const char *tag1, const char *tag2) { struct complaint { const char *tag1, *tag2; time_t expire; struct complaint *next; }; static struct complaint *List = NULL; struct complaint *cur, *next, *prev; int r = 0; struct complaint dummy; for (cur = List, prev = NULL; cur; prev = cur, cur = next) { next = cur->next; if (tt.tv_sec > cur->expire) { if (prev) prev->next = next; else List = next; //free((char*) cur); cur = prev; } else if ((tag1 == cur->tag1) && (tag2 == cur->tag2)) { r++; } } if (!r) { cur = &dummy;//(struct complaint *)malloc(sizeof(struct complaint)); if (cur) { cur->tag1 = tag1; cur->tag2 = tag2; cur->expire = tt.tv_sec + INIT_REFRESH; // "10:00" cur->next = NULL; if (prev) prev->next = cur; else List = cur; } } return (r); } static void nslookupComplain(const char *sysloginfo, const char *net_queryname, const char *complaint, const char *net_dname, const struct databuf *a_rr, const struct databuf *nsdp) { char queryname[INSZ+1], dname[INSZ+1]; const char *a, *ns; const char *a_type; int print_a; strncpy(queryname, net_queryname, sizeof queryname); queryname[(sizeof queryname) - 1] = EOS; strncpy(dname, net_dname, sizeof dname); dname[(sizeof dname) - 1] = EOS; if (sysloginfo && queryname && !haveComplained(queryname, complaint)) { char buf[BUFSZ]; a = ns = (char *)NULL; print_a = (a_rr->d_type == T_A); a_type = p_type(a_rr->d_type); if ( a != NULL || ns != NULL) { /* OK */ r_strncpy (buf, sysloginfo, BUFSZ); } else { /* OK */ r_strncpy (buf, sysloginfo, BUFSZ); } } } int main () { char sysloginfo [INSZ]; char net_queryname [INSZ]; char net_dname [INSZ]; struct databuf a_rr; struct databuf nsdp; static char *complaint = "Glue A RR missing"; sysloginfo [INSZ-1] = EOS; net_queryname [INSZ-1] = EOS; net_dname [INSZ-1] = EOS; nslookupComplain (sysloginfo, net_queryname, complaint, net_dname, &a_rr, &nsdp); return 0; } ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/nslookupComplain/small_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/nslookupComplain/small_bad0000666000000000000000000000317513571573400027437 0ustar #include "../bind.h" extern int nondet_int(); int haveComplained (const char *tag1, const char *tag2) { return nondet_int(); } /* Another completely unsound stub brought to you by the Verisec Project. */ const char *p_type (int type) { return NULL; } static void nslookupComplain(const char *sysloginfo, const char *net_queryname, const char *complaint, const char *net_dname, const struct databuf *a_rr, const struct databuf *nsdp) { char queryname[INSZ+1], dname[INSZ+1]; const char *a, *ns; const char *a_type; int print_a; strncpy(queryname, net_queryname, sizeof queryname); queryname[(sizeof queryname) - 1] = EOS; strncpy(dname, net_dname, sizeof dname); dname[(sizeof dname) - 1] = EOS; if (sysloginfo && queryname && !haveComplained(queryname, complaint)) { char buf[BUFSZ]; a = ns = (char *)NULL; print_a = (a_rr->d_type == T_A); a_type = p_type(a_rr->d_type); if ( a != NULL || ns != NULL) { /* BAD */ r_strcpy (buf, sysloginfo); } else { /* BAD */ r_strcpy (buf, sysloginfo); } } } int main () { char sysloginfo [INSZ]; char net_queryname [INSZ]; char net_dname [INSZ]; struct databuf a_rr; struct databuf nsdp; static char *complaint = "Glue A RR missing"; sysloginfo [INSZ-1] = EOS; net_queryname [INSZ-1] = EOS; net_dname [INSZ-1] = EOS; nslookupComplain (sysloginfo, net_queryname, complaint, net_dname, &a_rr, &nsdp); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/nslookupComplain/small_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/CVE-2001-0011/nslookupComplain/small_ok.0000666000000000000000000000321313571573400027371 0ustar #include "../bind.h" extern int nondet_int(); int haveComplained (const char *tag1, const char *tag2) { return nondet_int(); } /* Another completely unsound stub brought to you by the Verisec Project. */ const char *p_type (int type) { return NULL; } static void nslookupComplain(const char *sysloginfo, const char *net_queryname, const char *complaint, const char *net_dname, const struct databuf *a_rr, const struct databuf *nsdp) { char queryname[INSZ+1], dname[INSZ+1]; const char *a, *ns; const char *a_type; int print_a; strncpy(queryname, net_queryname, sizeof queryname); queryname[(sizeof queryname) - 1] = EOS; strncpy(dname, net_dname, sizeof dname); dname[(sizeof dname) - 1] = EOS; if (sysloginfo && queryname && !haveComplained(queryname, complaint)) { char buf[BUFSZ]; a = ns = (char *)NULL; print_a = (a_rr->d_type == T_A); a_type = p_type(a_rr->d_type); if ( a != NULL || ns != NULL) { /* OK */ r_strncpy (buf, sysloginfo, BUFSZ); } else { /* OK */ r_strncpy (buf, sysloginfo, BUFSZ); } } } int main () { char sysloginfo [INSZ]; char net_queryname [INSZ]; char net_dname [INSZ]; struct databuf a_rr; struct databuf nsdp; static char *complaint = "Glue A RR missing"; sysloginfo [INSZ-1] = EOS; net_queryname [INSZ-1] = EOS; net_dname [INSZ-1] = EOS; nslookupComplain (sysloginfo, net_queryname, complaint, net_dname, &a_rr, &nsdp); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/README0000666000000000000000000000025113571573400021535 0ustar -= BIND =- Homepage: http://www.isc.org/sw/bind/ Domain: DNS Server DNS is the Domain Name System. BIND (Berkeley Internet Name Daemon) is the most common DNS server. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/bind/frama-c-journal.ml0000666000000000000000000000055013571573400024167 0ustar (* Frama-C journal generated at 16:31 the 05/09/2008 *) (* Running *) let () = Journal.run () let () = Cmdline.ForceValues.set true let () = Cmdline.Files.set ["loop_ok.c"; ] let () = File.init_from_cmdline () let () = !Db.Syntactic_callgraph.dump () (* exception raised on: *) let __ : unit = !Db.Value.compute () (* Finished *) let () = Journal.finished () frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/0000777000000000000000000000000013571573400021555 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/0000777000000000000000000000000013571573400023164 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/README0000666000000000000000000000206013571573400024042 0ustar -= CVE-2006-6909 =- Vulnerable versions: Edbrowse 3.1.3 File(s): {ebc,ebsmjs}/http.c Download from: http://sourceforge.net/projects/edbrowse/ Domain: Text-based editor/browser/email _ Vulnerable Functions and Buffers _ A call to sscanf() with no bounds checks allows a buffer user[] to be overflowed in ftpls(). The function which calls ftpls(), ftpConnect(), does some nifty looping to fill a buffer and see if ftpls() should be called. Note that there are technical issues in the original program which we elide in our current decomposed probrams: - ftpConnect() uses a custom string library which does reallocation of string buffers; we don't attempt to model this, and we use standard C strings instead - ftpls() uses sscanf(); since we don't have anything close to a sscanf() stub, we change it to strcpy() _ Decomposed Programs _ constants.h ftpls/ strchr_{bad,ok}.c /* No calling context */ no_strcmp_{bad,ok}.c /* Simplified ftpConnect() calls ftpls() */ strcmp_{bad,ok}.c /* Less simplified ftpConnect() calls ftpls() */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/constants.h0000666000000000000000000000141113571573400025346 0ustar #ifndef CONSTANTS_C #define CONSTANTS_C #include "../../../../lib/stubs.h" /* Originally "-rwxdls". This will affect the number of times strchr() * loops, so vary it to vary analysis difficulty. */ #define CHARS_NOT_WANTED "-" /* Size of the buffer being overflowed */ #define USERSZ BASE_SZ /* One less than the number of iterations the first FOR loop must go * through in order to hit the error. * * XXX Not sure how this affects analysis difficulty, except that the * XXX bigger this is, the bigger INSZ has to be.*/ #define J 2 /* Must read at least NPFLEN characters and contain the string NPF in * order to cal ftpls(). */ #define NPF "N" #define NPFSZ 1 /* Size of the input buffer. Also affects a loop bound. */ #define INSZ USERSZ + NPFSZ + J + 2 #endif frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/ftpls/0000777000000000000000000000000013571573400024314 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/ftpls/no_strcmp_bad.c0000666000000000000000000000206313571573400027273 0ustar #include "../constants.h" extern int nondet_int(); void ftpls (char *line) { int j; /* Stop at either: * (1) first char before EOS which isn't in "-rwxdls", or, * (2) first EOS */ for(j = 0; line[j] != EOS; ++j) if (!strchr("-", line[j])) break; if(j == J && line[j] == ' ') { /* long list */ /* BUG! No bounds check. */ char user[USERSZ]; /* BAD */ r_strcpy (user, line + j); } } int main () { char out [INSZ]; int out_l; bool dirmode; static const char npf[] = NPF; const int npfsize = NPFSZ; int c; dirmode = false; out_l = 0; out[INSZ-1] = EOS; top: while((c = nondet_int()) != EOF) { if(c == '\r') c = '\n'; if(c == '\n') { if(dirmode) { ftpls(out); } else { if(!out_l) continue; if (out_l > npfsize) { dirmode = true; goto top; } } out_l = 0; } else { out[out_l] = c; out_l++; if (out_l > INSZ-1) return ERR; } } return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/ftpls/no_strcmp_ok.c0000666000000000000000000000203113571573400027151 0ustar #include "../constants.h" extern int nondet_int(); void ftpls (char *line) { int j; /* Stop at either: * (1) first char before EOS which isn't in "-rwxdls", or, * (2) first EOS */ for(j = 0; line[j] != EOS; ++j) if (!strchr("-", line[j])) break; if(j == J && line[j] == ' ') { /* long list */ char user[USERSZ]; /* OK */ r_strncpy (user, line + j, USERSZ); } } int main () { char out [INSZ]; int out_l; bool dirmode; static const char npf[] = NPF; const int npfsize = NPFSZ; int c; dirmode = false; out_l = 0; out[INSZ-1] = EOS; top: while((c = nondet_int()) != EOF) { if(c == '\r') c = '\n'; if(c == '\n') { if(dirmode) { ftpls(out); } else { if(!out_l) continue; if (out_l > npfsize) { dirmode = true; goto top; } } out_l = 0; } else { out[out_l] = c; out_l++; if (out_l > INSZ-1) return ERR; } } return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/ftpls/strchr_bad.c0000666000000000000000000000111713571573400026573 0ustar #include "../constants.h" /* Input of death is: * (OTHER)^2(' ')(NOT_EOS)^(sizeof(user)) * */ void ftpls (char *line) { int j; /* Stop at either: * (1) first char before EOS which isn't in "-rwxdls", or, * (2) first EOS */ for(j = 0; line[j] != EOS; ++j) if (!strchr("-", line[j])) break; if(j == J && line[j] == ' ') { /* long list */ /* BUG! No bounds check. */ char user[USERSZ]; /* BAD */ r_strcpy (user, line + j); } } int main () { char in [INSZ]; in [INSZ-1] = EOS; ftpls(in); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/ftpls/strchr_bad.err0000666000000000000000000000121213571573400027135 0ustar edbrowse/CVE-2006-6909/ftpls/strchr_bad.c:16: Warning: entering loop for the first time edbrowse/CVE-2006-6909/ftpls/strchr_bad.c:16: Warning: (TODO: emit a proper alarm) accessing uninitialized left-value: *(line + j) edbrowse/CVE-2006-6909/ftpls/strchr_bad.c:16: Warning: completely unspecified value in {{ in -> {0; } ;}} (size:<8>). This path is assumed to be dead. edbrowse/CVE-2006-6909/ftpls/strchr_bad.c:16: Warning: non termination detected in function ftpls edbrowse/CVE-2006-6909/ftpls/strchr_bad.c:35: Warning: non termination detected in function main [dominators] computing for function r_memcpy [dominators] done for function r_memcpy frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/ftpls/strchr_ok.c0000666000000000000000000000106513571573400026460 0ustar #include "../constants.h" /* Input of death is: * (OTHER)^2(' ')(NOT_EOS)^(sizeof(user)) * */ void ftpls (char *line) { int j; /* Stop at either: * (1) first char before EOS which isn't in "-rwxdls", or, * (2) first EOS */ for(j = 0; line[j] != EOS; ++j) if (!strchr("-", line[j])) break; if(j == J && line[j] == ' ') { /* long list */ char user[USERSZ]; /* OK */ r_strncpy (user, line + j, USERSZ); } } int main () { char in [INSZ]; in [INSZ-1] = EOS; ftpls(in); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/ftpls/strcmp_bad.c0000666000000000000000000000243413571573400026601 0ustar #include "../constants.h" extern int nondet_int(); void ftpls (char *line) { int j; /* Stop at either: * (1) first char before EOS which isn't in "-rwxdls", or, * (2) first EOS */ for(j = 0; line[j] != EOS; ++j) if (!strchr("-", line[j])) break; if(j == J && line[j] == ' ') { /* long list */ /* BUG! No bounds check. */ char user[USERSZ]; /* BAD */ r_strcpy (user, line + j); } } int main () { char out [INSZ]; int out_l; bool dirmode; static const char npf[] = NPF; const int npfsize = NPFSZ; int c; dirmode = false; out_l = 0; out[INSZ-1] = EOS; top: while((c = nondet_int()) != EOF) { if(c == '\r') c = '\n'; if(c == '\n') { if(dirmode) { ftpls(out); } else { if(!out_l) continue; /* This assertion is meant to stop SatAbs from going insane * and reporting a spurious error in strcmp. Which it still * does. :-/ * */ assert (out_l <= INSZ-1); if (out_l > npfsize && !strcmp(out + out_l - npfsize, npf)) { dirmode = true; goto top; } } out_l = 0; } else { out_l++; if (out_l > INSZ-1) return ERR; } } return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/CVE-2006-6909/ftpls/strcmp_ok.c0000666000000000000000000000240213571573400026457 0ustar #include "../constants.h" extern int nondet_int(); void ftpls (char *line) { int j; /* Stop at either: * (1) first char before EOS which isn't in "-rwxdls", or, * (2) first EOS */ for(j = 0; line[j] != EOS; ++j) if (!strchr("-", line[j])) break; if(j == J && line[j] == ' ') { /* long list */ char user[USERSZ]; /* OK */ r_strncpy (user, line + j, USERSZ); } } int main () { char out [INSZ]; int out_l; bool dirmode; static const char npf[] = NPF; const int npfsize = NPFSZ; int c; dirmode = false; out_l = 0; out[INSZ-1] = EOS; top: while((c = nondet_int()) != EOF) { if(c == '\r') c = '\n'; if(c == '\n') { if(dirmode) { ftpls(out); } else { if(!out_l) continue; /* This assertion is meant to stop SatAbs from going insane * and reporting a spurious error in strcmp. Which it still * does. :-/ * */ assert (out_l <= INSZ-1); if (out_l > npfsize && !strcmp(out + out_l - npfsize, npf)) { dirmode = true; goto top; } } out_l = 0; } else { out_l++; if (out_l > INSZ-1) return ERR; } } return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/edbrowse/README0000666000000000000000000000030713571573400022435 0ustar -= Edbrowse =- Homepage: http://www.eklhad.net/linux/app/ Domain: Text-based editor/browser/email Edbrowse is a command-line editor, browser, and email client, intended to be usable by the blind. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/gxine/0000777000000000000000000000000013571573400021055 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/gxine/CVE-2007-0406/0000777000000000000000000000000013571573400022447 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/gxine/CVE-2007-0406/README0000666000000000000000000000144413571573400023332 0ustar -= CVE-2007-0406 =- Vulnerable versions: gxine <= 0.5.9 File(s): src/server.c, src/client.c Download from: http://prdownloads.sourceforge.net/xine/gxine-0.5.9.tar.bz2?download Domain: GUI (Media Player) _ Vulnerable Functions and Buffers _ Functions main() in client.c and functions server_setup() and server_client_connect() in server.c are vulnerable. All three functions use snprintf() to copy the $HOME environment variable into a fixed-size buffer (safe); however, the contents of this buffer are later copied into a smaller buffer using strcpy(). Algorithmically, this overflow is very simple, and isn't string-content-based. The difficult parts are the technical bits -- modelling snprintf, structures, and unions. _ Decomposed Programs _ constants.h main/ simp_bad.c nonsimp_bad.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/gxine/CVE-2007-0406/constants.h0000666000000000000000000000053013571573400024632 0ustar #include "../../../../lib/stubs.h" /* Size of buffer being overflowed. * Ensure that SUN_PATH_SZ - 1 is non-negative */ #define SUN_PATH_SZ BASE_SZ + 1/* originally 108 */ /* Size of input buffer. */ #define FILENAME_SZ SUN_PATH_SZ + 2 /* originally 1024 */ struct sockaddr_un { char sun_path[SUN_PATH_SZ]; /* Path name. */ }; frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/gxine/CVE-2007-0406/main/0000777000000000000000000000000013571573400023373 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/gxine/CVE-2007-0406/main/frama-c.err0000666000000000000000000000114113571573400025410 0ustar ../../lib/stubs.c:92: Warning: entering loop for the first time ../../lib/stubs.c:92: Warning: assigning non deterministic value for the first time ../../lib/stubs.c:95: Warning: out of bounds write. assert \valid(dest + i); ../../lib/stubs.c:93: Warning: out of bounds read. assert \valid(src + i); ../../lib/stubs.c:96: Warning: out of bounds read. assert \valid(src + i); [dominators] computing for function r_memcpy [dominators] done for function r_memcpy [dominators] computing for function r_strcpy [dominators] done for function r_strcpy frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/gxine/CVE-2007-0406/main/simp_bad.c0000666000000000000000000000047613571573400025324 0ustar #include "../constants.h" int main () { struct sockaddr_un serv_adr; char filename [FILENAME_SZ] = "test"; /* server filename */ filename[FILENAME_SZ-1] = EOS; /* initialize the server address structure */ /* BAD */ r_strcpy (serv_adr.sun_path, filename); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/gxine/CVE-2007-0406/main/simp_ok.c0000666000000000000000000000051013571573400025174 0ustar #include "../constants.h" int main () { struct sockaddr_un serv_adr; char filename [FILENAME_SZ]; /* server filename */ filename[FILENAME_SZ-1] = EOS; /* initialize the server address structure */ /* OK */ r_strncpy (serv_adr.sun_path, filename, SUN_PATH_SZ-1); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/gxine/README0000666000000000000000000000023213571573400021732 0ustar -= gxine =- Homepage: http://xinehq.de Domain: GUI (Media Player) Xine is an open source media player; gxine is a gtk-based graphical front-end for it. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/0000777000000000000000000000000013571573400021024 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/0000777000000000000000000000000013571573400022422 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/README0000666000000000000000000000311313571573400023300 0ustar -= CVE-2007-0455 =- Vulnerable versions: LibGD <= 2.0.33 File(s): gdft.c Download from: http://www.libgd.org/releases/oldreleases/gd-2.0.33.tar.gz Domain: Graphics Library _ Vulnerable Functions and Buffers _ This is actually an out-of-bounds read, but it seems structurally the same as the out-of-bounds writes, and was reported using the term "buffer overflow." A buffer, string[], is a parameter to the function gdImageStringFTEx(). This string is traversed using a loop containing a switch statement, with cases based on the character encoding of the string. If the string is JIS-encoded, the iterator variable can be incremented twice. The second increment is performed without first checking for the end-of-string character, which can thus cause the loop reading the string to access out-of-bounds memory. This can lead to a crash. I've chopped out the stuff that doesn't relate to how the iterator is incremented -- we don't care about cruft for which we just need to know "there is some path through this." The variants in the program actually come from variations in the algorithm used to parse Unicode characters. Since Unicode characters are encoded using a variable number of bytes, the iterator over string[] can be advanced by a variable number of bytes on each iteration. The helper function for reading Unicode recognizes HTML 4.0 entities; I've made versions of this function dealing with different subsets of the characters recognized by the original. _ Decomposed Programs _ gd.h gdImageStringFTEx/ gd_simp_bad.c gd_no_entities_bad.c gd_some_entities_bad.c gd_full_bad.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gd.h0000666000000000000000000000172213571573400023167 0ustar #include "../../../../lib/stubs.h" /* Size of the input buffer. Since this example is a read overflow, * there is no output buffer. Must be at least 2 for things to work. */ #define INSZ BASE_SZ + 1 /* Size of a buffer used in gd_full.c; will affect a loop bound, so is * important for that example. */ #define ENTITY_NAME_LENGTH_MAX 8 /* The number of entities in entities[] and NR_OF_ENTITIES must * match. NR_OF_ENTITIES affects the number of iterations of search() * in gd_full_bad.c, so varying it should affect difficulty of that * example. * * Note that this is a *very* chopped-down array of entities -- see * entities.h in the gd sources for the real one. */ struct entities_s { char *name; int value; }; struct entities_s entities[] = { {"AElig", 198}, {"Aacute", 193}, {"Acirc", 194}, }; #define NR_OF_ENTITIES 3 /* These things don't matter. */ #define Tcl_UniChar int #define gdFTEX_Unicode 0 #define gdFTEX_Shift_JIS 1 #define gdFTEX_Big5 2 frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/0000777000000000000000000000000013571573400025675 5ustar ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_full_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_full0000666000000000000000000001260013571573400027233 0ustar #include "../gd.h" struct entities_s * search(struct entities_s *key, struct entities_s *base, int nmemb) { int iter; for (iter = 0; iter < nmemb; iter++) if (strcmp (key->name, base[iter].name) == 0) return base + iter; return NULL; } /* All we care about is what it returns, and that it doesn't enable us * to skip past the terminating EOS. */ static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) { int byte; char entity_name_buf[ENTITY_NAME_LENGTH_MAX+1]; char *p; struct entities_s key, *res; byte = (unsigned char)(str[0]); /* If we see an ampersand, treat what follows as an HTML4.0 entity, * terminated with a semicolon */ if (byte == '&') { int i, n = 0; byte = *((unsigned char *) (str + 1)); if (byte == '#') { byte = *((unsigned char *) (str + 2)); if (byte == 'x' || byte == 'X') { for (i = 3; i < 8; i++) { byte = *((unsigned char *) (str + i)); if (byte >= 'A' && byte <= 'F') byte = byte - 'A' + 10; else if (byte >= 'a' && byte <= 'f') byte = byte - 'a' + 10; else if (byte >= '0' && byte <= '9') byte = byte - '0'; else break; /* end FOR */ n = (n * 16) + byte; } } else { for (i = 2; i < 8; i++) { byte = (unsigned char)(str[i]); if (byte >= '0' && byte <= '9') n = (n * 10) + (byte - '0'); else break; } } /* In each of the above branches, i was computed. It's the number of * characters representing an HTML4.0 entity. Increment i since we're * also consuming the semicolon. * * If this branch isn't taken, we're not dealing with an HTML4.0 * entity, so we go back to the start of str, and process it as * UTF-8. */ if (byte == ';') { return ++i; } } /* This isn't an HTML4.0 entity. But it could be an entity name -- * they're listed in the entities[] array. So we read until we see * an EOS or a comma, and write what we're seeing into * entity_name_buf as we go, using it to do a search. * * ... * * Ugh. That'll be hard. * * What can we vary? The size of this entities[] buffer, I * guess. We'd definitely have to provide a bsearch stub -- which * would easily be a linear search, since we don't care about * runtime performance. * */ else { key.name = p = entity_name_buf; for (i = 1; i < 1 + ENTITY_NAME_LENGTH_MAX; i++) { byte = (unsigned char)(str[i]); if (byte == EOS) break; if (byte == ';') { *p++ = EOS; /* This was originally bsearch(), which is a polymorphic * function that uses void pointers and size arguments. I * think most tools and tool users would rewrite the program * as a first phase, using type information to choose the * implementation of bsearch. */ res = search(&key, entities, NR_OF_ENTITIES); if (res != NULL) { return ++i; } break; } *p++ = byte; } /* End FOR */ } } /* This is the UTF-8 case. */ byte = (unsigned char)(str[0]); if (byte < 0xC0) { return 1; } else if (byte < 0xE0) { if ((str[1] & 0xC0) == 0x80) { return 2; } return 1; } else if (byte < 0xF0) { if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80)) { return 3; } return 1; } return 1; } /* Greatly, GREATLY simplified. There's a bunch of cruft that doesn't * have to do with the manipulation of "string". */ void gdImageStringFTEx (char *string) { int next; int encoding; int i; int ch; int len; encoding = nondet_int(); if (encoding > 2 || encoding < 0) return; next = 0; /* Unsafe read -- next can be out of bounds. */ /* BAD */ for (i=0; string[next] != EOS; i++) { /* grabbing a character and storing it in an int * * this'll fill the low-order byte, and keep more space free for * extra bytes for Unicode encoding, etc. */ ch = string[next]; /* carriage returns */ if (ch == '\r') { next++; continue; } /* newlines */ if (ch == '\n') { next++; continue; } switch (encoding) { case gdFTEX_Unicode: { len = gdTcl_UtfToUniChar (string + next, &ch); next += len; } break; case gdFTEX_Shift_JIS: { unsigned char c; c = (unsigned char) string[next]; if (0xA1 <= c && c <= 0xFE) { next++; } /* We're incrementing next twice, which could make us skip * the terminating EOS character. The read of "string" * could then be out of bounds. */ next++; } break; case gdFTEX_Big5: { ch = (string[next]) & 0xFF; /* don't extend sign */ next++; if (ch >= 161 && string[next] != EOS) { next++; } } break; } } } int main () { char in [INSZ]; in [INSZ-1] = EOS; gdImageStringFTEx (in); return 0; } ././@LongLink0000644000000000000000000000015200000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_full_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_full0000666000000000000000000001227313571573400027241 0ustar #include "../gd.h" struct entities_s * search(struct entities_s *key, struct entities_s *base, int nmemb) { int iter; for (iter = 0; iter < nmemb; iter++) if (strcmp (key->name, base[iter].name) == 0) return base + iter; return NULL; } /* All we care about is what it returns, and that it doesn't enable us * to skip past the terminating EOS. */ static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) { int byte; char entity_name_buf[ENTITY_NAME_LENGTH_MAX+1]; char *p; struct entities_s key, *res; byte = (unsigned char)(str[0]); /* If we see an ampersand, treat what follows as an HTML4.0 entity, * terminated with a semicolon */ if (byte == '&') { int i, n = 0; byte = *((unsigned char *) (str + 1)); if (byte == '#') { byte = *((unsigned char *) (str + 2)); if (byte == 'x' || byte == 'X') { for (i = 3; i < 8; i++) { byte = *((unsigned char *) (str + i)); if (byte >= 'A' && byte <= 'F') byte = byte - 'A' + 10; else if (byte >= 'a' && byte <= 'f') byte = byte - 'a' + 10; else if (byte >= '0' && byte <= '9') byte = byte - '0'; else break; /* end FOR */ n = (n * 16) + byte; } } else { for (i = 2; i < 8; i++) { byte = (unsigned char)(str[i]); if (byte >= '0' && byte <= '9') n = (n * 10) + (byte - '0'); else break; } } /* In each of the above branches, i was computed. It's the number of * characters representing an HTML4.0 entity. Increment i since we're * also consuming the semicolon. * * If this branch isn't taken, we're not dealing with an HTML4.0 * entity, so we go back to the start of str, and process it as * UTF-8. */ if (byte == ';') { return ++i; } } /* This isn't an HTML4.0 entity. But it could be an entity name -- * they're listed in the entities[] array. So we read until we see * an EOS or a comma, and write what we're seeing into * entity_name_buf as we go, using it to do a search. * * ... * * Ugh. That'll be hard. * * What can we vary? The size of this entities[] buffer, I * guess. We'd definitely have to provide a bsearch stub -- which * would easily be a linear search, since we don't care about * runtime performance. * */ else { key.name = p = entity_name_buf; for (i = 1; i < 1 + ENTITY_NAME_LENGTH_MAX; i++) { byte = (unsigned char)(str[i]); if (byte == EOS) break; if (byte == ';') { *p++ = EOS; /* This was originally bsearch(), which is a polymorphic * function that uses void pointers and size arguments. I * think most tools and tool users would rewrite the program * as a first phase, using type information to choose the * implementation of bsearch. */ res = search(&key, entities, NR_OF_ENTITIES); if (res != NULL) { return ++i; } break; } *p++ = byte; } /* End FOR */ } } /* This is the UTF-8 case. */ byte = (unsigned char)(str[0]); if (byte < 0xC0) { return 1; } else if (byte < 0xE0) { if ((str[1] & 0xC0) == 0x80) { return 2; } return 1; } else if (byte < 0xF0) { if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80)) { return 3; } return 1; } return 1; } /* Greatly, GREATLY simplified. There's a bunch of cruft that doesn't * have to do with the manipulation of "string". */ void gdImageStringFTEx (char *string) { int next; int encoding; int i; int ch; int len; encoding = nondet_int(); if (encoding > 2 || encoding < 0) return; next = 0; /* OK */ for (i=0; string[next] != EOS; i++) { /* grabbing a character and storing it in an int * * this'll fill the low-order byte, and keep more space free for * extra bytes for Unicode encoding, etc. */ ch = string[next]; /* carriage returns */ if (ch == '\r') { next++; continue; } /* newlines */ if (ch == '\n') { next++; continue; } switch (encoding) { case gdFTEX_Unicode: { len = gdTcl_UtfToUniChar (string + next, &ch); next += len; } break; case gdFTEX_Shift_JIS: { unsigned char c; c = (unsigned char) string[next]; if (0xA1 <= c && c <= 0xFE) { next++; } if (string[next] != EOS) next++; } break; case gdFTEX_Big5: { ch = (string[next]) & 0xFF; /* don't extend sign */ next++; if (ch >= 161 && string[next] != EOS) { next++; } } break; } } } int main () { char in [INSZ]; in [INSZ-1] = EOS; gdImageStringFTEx (in); return 0; } ././@LongLink0000644000000000000000000000016200000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_no_entities_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_no_e0000666000000000000000000000451313571573400027215 0ustar #include "../gd.h" /* All we care about is what it returns, and that it doesn't enable us * to skip past the terminating EOS. */ static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) { int byte; /* This is the UTF-8 case. */ byte = (unsigned char)(str[0]); if (byte < 0xC0) { return 1; } else if (byte < 0xE0) { if ((str[1] & 0xC0) == 0x80) { return 2; } return 1; } else if (byte < 0xF0) { if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80)) { return 3; } return 1; } return 1; } /* Greatly, GREATLY simplified. There's a bunch of cruft that doesn't * have to do with the manipulation of "string". */ void gdImageStringFTEx (char *string) { int next; int encoding; int i; int ch; int len; encoding = nondet_int(); if (encoding > 2 || encoding < 0) return; next = 0; /* Unsafe read -- next can be out of bounds. */ /* BAD */ for (i=0; string[next] != EOS; i++) { /* grabbing a character and storing it in an int * * this'll fill the low-order byte, and keep more space free for * extra bytes for Unicode encoding, etc. */ ch = string[next]; /* carriage returns */ if (ch == '\r') { next++; continue; } /* newlines */ if (ch == '\n') { next++; continue; } switch (encoding) { case gdFTEX_Unicode: { len = gdTcl_UtfToUniChar (string + next, &ch); next += len; } break; case gdFTEX_Shift_JIS: { unsigned char c; c = (unsigned char) string[next]; if (0xA1 <= c && c <= 0xFE) { next++; } /* We're incrementing next twice, which could make us skip * the terminating EOS character. The read of "string" * could then be out of bounds. */ next++; } break; case gdFTEX_Big5: { ch = (string[next]) & 0xFF; /* don't extend sign */ next++; if (ch >= 161 && string[next] != EOS) { next++; } } break; } } } int main () { char in [INSZ]; in [INSZ-1] = EOS; gdImageStringFTEx (in); return 0; } ././@LongLink0000644000000000000000000000016100000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_no_entities_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_no_e0000666000000000000000000000420613571573400027214 0ustar #include "../gd.h" /* All we care about is what it returns, and that it doesn't enable us * to skip past the terminating EOS. */ static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) { int byte; /* This is the UTF-8 case. */ byte = (unsigned char)(str[0]); if (byte < 0xC0) { return 1; } else if (byte < 0xE0) { if ((str[1] & 0xC0) == 0x80) { return 2; } return 1; } else if (byte < 0xF0) { if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80)) { return 3; } return 1; } return 1; } /* Greatly, GREATLY simplified. There's a bunch of cruft that doesn't * have to do with the manipulation of "string". */ void gdImageStringFTEx (char *string) { int next; int encoding; int i; int ch; int len; encoding = nondet_int(); if (encoding > 2 || encoding < 0) return; next = 0; /* OK */ for (i=0; string[next] != EOS; i++) { /* grabbing a character and storing it in an int * * this'll fill the low-order byte, and keep more space free for * extra bytes for Unicode encoding, etc. */ ch = string[next]; /* carriage returns */ if (ch == '\r') { next++; continue; } /* newlines */ if (ch == '\n') { next++; continue; } switch (encoding) { case gdFTEX_Unicode: { len = gdTcl_UtfToUniChar (string + next, &ch); next += len; } break; case gdFTEX_Shift_JIS: { unsigned char c; c = (unsigned char) string[next]; if (0xA1 <= c && c <= 0xFE) { next++; } if (string[next] != EOS) next++; } break; case gdFTEX_Big5: { ch = (string[next]) & 0xFF; /* don't extend sign */ next++; if (ch >= 161 && string[next] != EOS) { next++; } } break; } } } int main () { char in [INSZ]; in [INSZ-1] = EOS; gdImageStringFTEx (in); return 0; } ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_simp_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_simp0000666000000000000000000000372413571573400027250 0ustar #include "../gd.h" static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) { return 1; } /* Greatly, GREATLY simplified. There's a bunch of cruft that doesn't * have to do with the manipulation of "string". */ void gdImageStringFTEx (char *string) { int next; int encoding; int i; int ch; int len; encoding = nondet_int(); if (encoding > 2 || encoding < 0) return; next = 0; /* Unsafe read -- next can be out of bounds. */ /* BAD */ for (i=0; string[next] != EOS; i++) { /* grabbing a character and storing it in an int * * this'll fill the low-order byte, and keep more space free for * extra bytes for Unicode encoding, etc. */ ch = string[next]; /* carriage returns */ if (ch == '\r') { next++; continue; } /* newlines */ if (ch == '\n') { next++; continue; } switch (encoding) { case gdFTEX_Unicode: { len = gdTcl_UtfToUniChar (string + next, &ch); next += len; } break; case gdFTEX_Shift_JIS: { unsigned char c; c = (unsigned char) string[next]; if (0xA1 <= c && c <= 0xFE) { next++; } /* We're incrementing next twice, which could make us skip * the terminating EOS character. The read of "string" * could then be out of bounds. */ next++; } break; case gdFTEX_Big5: { ch = (string[next]) & 0xFF; /* don't extend sign */ next++; if (ch >= 161 /* first code of JIS-8 pair */ && string[next] != EOS) { ch = (ch * 256) + ((string[next]) & 255); next++; } } break; } } } int main () { char in [INSZ]; in [INSZ-1] = EOS; gdImageStringFTEx (in); return 0; } ././@LongLink0000644000000000000000000000015200000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_simp_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_simp0000666000000000000000000000341713571573400027247 0ustar #include "../gd.h" static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) { return 1; } /* Greatly, GREATLY simplified. There's a bunch of cruft that doesn't * have to do with the manipulation of "string". */ void gdImageStringFTEx (char *string) { int next; int encoding; int i; int ch; int len; encoding = nondet_int(); if (encoding > 2 || encoding < 0) return; next = 0; /* OK */ for (i=0; string[next] != EOS; i++) { /* grabbing a character and storing it in an int * * this'll fill the low-order byte, and keep more space free for * extra bytes for Unicode encoding, etc. */ ch = string[next]; /* carriage returns */ if (ch == '\r') { next++; continue; } /* newlines */ if (ch == '\n') { next++; continue; } switch (encoding) { case gdFTEX_Unicode: { len = gdTcl_UtfToUniChar (string + next, &ch); next += len; } break; case gdFTEX_Shift_JIS: { unsigned char c; c = (unsigned char) string[next]; if (0xA1 <= c && c <= 0xFE) { next++; } if (string[next] != EOS) next++; } break; case gdFTEX_Big5: { ch = (string[next]) & 0xFF; /* don't extend sign */ next++; if (ch >= 161 /* first code of JIS-8 pair */ && string[next] != EOS) { ch = (ch * 256) + ((string[next]) & 255); next++; } } break; } } } int main () { char in [INSZ]; in [INSZ-1] = EOS; gdImageStringFTEx (in); return 0; } ././@LongLink0000644000000000000000000000016400000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_some_entities_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_some0000666000000000000000000000732613571573400027245 0ustar #include "../gd.h" /* All we care about is what it returns, and that it doesn't enable us * to skip past the terminating EOS. */ static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) { int byte; byte = (unsigned char)(str[0]); /* If we see an ampersand, treat what follows as an HTML4.0 entity, * terminated with a semicolon */ if (byte == '&') { int i, n = 0; byte = *((unsigned char *) (str + 1)); if (byte == '#') { byte = *((unsigned char *) (str + 2)); if (byte == 'x' || byte == 'X') { for (i = 3; i < 8; i++) { byte = *((unsigned char *) (str + i)); if (byte >= 'A' && byte <= 'F') byte = byte - 'A' + 10; else if (byte >= 'a' && byte <= 'f') byte = byte - 'a' + 10; else if (byte >= '0' && byte <= '9') byte = byte - '0'; else break; /* end FOR */ n = (n * 16) + byte; } } else { for (i = 2; i < 8; i++) { byte = (unsigned char)(str[i]); if (byte >= '0' && byte <= '9') n = (n * 10) + (byte - '0'); else break; } } /* In each of the above branches, i was computed. It's the number of * characters representing an HTML4.0 entity. Increment i since we're * also consuming the semicolon. * * If this branch isn't taken, we're not dealing with an HTML4.0 * entity, so we go back to the start of str, and process it as * UTF-8. */ if (byte == ';') { return ++i; } } } /* This is the UTF-8 case. */ byte = (unsigned char)(str[0]); if (byte < 0xC0) { return 1; } else if (byte < 0xE0) { if ((str[1] & 0xC0) == 0x80) { return 2; } return 1; } else if (byte < 0xF0) { if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80)) { return 3; } return 1; } return 1; } /* Greatly, GREATLY simplified. There's a bunch of cruft that doesn't * have to do with the manipulation of "string". */ void gdImageStringFTEx (char *string) { int next; int encoding; int i; int ch; int len; encoding = nondet_int(); if (encoding > 2 || encoding < 0) return; next = 0; /* Unsafe read -- next can be out of bounds. */ /* BAD */ for (i=0; string[next] != EOS; i++) { /* grabbing a character and storing it in an int * * this'll fill the low-order byte, and keep more space free for * extra bytes for Unicode encoding, etc. */ ch = string[next]; /* carriage returns */ if (ch == '\r') { next++; continue; } /* newlines */ if (ch == '\n') { next++; continue; } switch (encoding) { case gdFTEX_Unicode: { len = gdTcl_UtfToUniChar (string + next, &ch); next += len; } break; case gdFTEX_Shift_JIS: { unsigned char c; c = (unsigned char) string[next]; if (0xA1 <= c && c <= 0xFE) { next++; } /* We're incrementing next twice, which could make us skip * the terminating EOS character. The read of "string" * could then be out of bounds. */ next++; } break; case gdFTEX_Big5: { ch = (string[next]) & 0xFF; /* don't extend sign */ next++; if (ch >= 161 && string[next] != EOS) { next++; } } break; } } } int main () { char in [INSZ]; in [INSZ-1] = EOS; gdImageStringFTEx (in); return 0; } ././@LongLink0000644000000000000000000000016300000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_some_entities_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/CVE-2007-0455/gdImageStringFTEx/gd_some0000666000000000000000000000702113571573400027235 0ustar #include "../gd.h" /* All we care about is what it returns, and that it doesn't enable us * to skip past the terminating EOS. */ static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) { int byte; byte = (unsigned char)(str[0]); /* If we see an ampersand, treat what follows as an HTML4.0 entity, * terminated with a semicolon */ if (byte == '&') { int i, n = 0; byte = *((unsigned char *) (str + 1)); if (byte == '#') { byte = *((unsigned char *) (str + 2)); if (byte == 'x' || byte == 'X') { for (i = 3; i < 8; i++) { byte = *((unsigned char *) (str + i)); if (byte >= 'A' && byte <= 'F') byte = byte - 'A' + 10; else if (byte >= 'a' && byte <= 'f') byte = byte - 'a' + 10; else if (byte >= '0' && byte <= '9') byte = byte - '0'; else break; /* end FOR */ n = (n * 16) + byte; } } else { for (i = 2; i < 8; i++) { byte = (unsigned char)(str[i]); if (byte >= '0' && byte <= '9') n = (n * 10) + (byte - '0'); else break; } } /* In each of the above branches, i was computed. It's the number of * characters representing an HTML4.0 entity. Increment i since we're * also consuming the semicolon. * * If this branch isn't taken, we're not dealing with an HTML4.0 * entity, so we go back to the start of str, and process it as * UTF-8. */ if (byte == ';') { return ++i; } } } /* This is the UTF-8 case. */ byte = (unsigned char)(str[0]); if (byte < 0xC0) { return 1; } else if (byte < 0xE0) { if ((str[1] & 0xC0) == 0x80) { return 2; } return 1; } else if (byte < 0xF0) { if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80)) { return 3; } return 1; } return 1; } /* Greatly, GREATLY simplified. There's a bunch of cruft that doesn't * have to do with the manipulation of "string". */ void gdImageStringFTEx (char *string) { int next; int encoding; int i; int ch; int len; encoding = nondet_int(); if (encoding > 2 || encoding < 0) return; next = 0; /* OK */ for (i=0; string[next] != EOS; i++) { /* grabbing a character and storing it in an int * * this'll fill the low-order byte, and keep more space free for * extra bytes for Unicode encoding, etc. */ ch = string[next]; /* carriage returns */ if (ch == '\r') { next++; continue; } /* newlines */ if (ch == '\n') { next++; continue; } switch (encoding) { case gdFTEX_Unicode: { len = gdTcl_UtfToUniChar (string + next, &ch); next += len; } break; case gdFTEX_Shift_JIS: { unsigned char c; c = (unsigned char) string[next]; if (0xA1 <= c && c <= 0xFE) { next++; } if (string[next] != EOS) next++; } break; case gdFTEX_Big5: { ch = (string[next]) & 0xFF; /* don't extend sign */ next++; if (ch >= 161 && string[next] != EOS) { next++; } } break; } } } int main () { char in [INSZ]; in [INSZ-1] = EOS; gdImageStringFTEx (in); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/libgd/README0000666000000000000000000000033213571573400021702 0ustar -= LibGD =- Homepage: http://www.libgd.org Domain: Graphics Library GD is an open source library for dynamically creating images. It is often used by higher-level languages, like PHP, to creates graphs, charts, etc. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/0000777000000000000000000000000013571573400021026 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/0000777000000000000000000000000013571573400022422 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/README0000666000000000000000000000140213571573400023277 0ustar -= CVE-2007-0453 =- Vulnerable versions: Samba 3.0.21 through 3.0.23d File(s): source/nsswitch/winbind_nss_solaris.c Download from: http://us4.samba.org/samba/ftp/old-versions/samba-3.0.23d.tar.gz Domain: SMB (Server Message Block) Suite _ Vulnerable Functions and Buffers _ The library functions _nss_winbind_ipnodes_getbyname() and _nss_winbind_hosts_getbyname() are both vulnerable. Each function copies data into request.data.winsreq, passing an incorrect bound to strncpy(). Algorithmically, this overflow is very simple, and isn't string-content-based. The difficult parts are the technical bits -- modelling structures, unions, and typecasting. _ Decomposed Programs _ constants.h structs.h _nss_winbind_ipnodes_getbyname/ simp_bad.c nonsimp_bad.c ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getbyname/frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getb0000777000000000000000000000000013571573400027541 5ustar ././@LongLink0000644000000000000000000000017000000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getbyname/nonsimp_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getb0000666000000000000000000000065013571573400027544 0ustar #include "../structs.h" char in [INSZ]; static NSS_STATUS _nss_winbind_ipnodes_getbyname(void *args) { nss_XbyY_args_t *argp = (nss_XbyY_args_t*) args; struct winbindd_request request; /* BAD */ r_strncpy(request.data.winsreq, argp->key.name, strlen(argp->key.name)) ; return 0; } int main () { nss_XbyY_args_t k; in[INSZ] = EOS; k.key.name = in; _nss_winbind_ipnodes_getbyname(&k); return 0; } ././@LongLink0000644000000000000000000000016700000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getbyname/nonsimp_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getb0000666000000000000000000000063413571573400027546 0ustar #include "../structs.h" char in [INSZ]; static NSS_STATUS _nss_winbind_ipnodes_getbyname(void *args) { nss_XbyY_args_t *argp = (nss_XbyY_args_t*) args; struct winbindd_request request; /* OK */ r_strncpy(request.data.winsreq, argp->key.name, FSTRING_LEN) ; return 0; } int main () { nss_XbyY_args_t k; in[INSZ] = EOS; k.key.name = in; _nss_winbind_ipnodes_getbyname(&k); return 0; } ././@LongLink0000644000000000000000000000016500000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getbyname/simp_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getb0000666000000000000000000000045213571573400027544 0ustar #include "../constants.h" static NSS_STATUS _nss_winbind_ipnodes_getbyname(char *name) { char winsreq [FSTRING_LEN]; /* BAD */ r_strncpy(winsreq, name, strlen(name)) ; return 0; } int main () { char in [INSZ]; in[INSZ-1] = EOS; _nss_winbind_ipnodes_getbyname(in); return 0; } ././@LongLink0000644000000000000000000000016400000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getbyname/simp_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/_nss_winbind_ipnodes_getb0000666000000000000000000000045013571573400027542 0ustar #include "../constants.h" static NSS_STATUS _nss_winbind_ipnodes_getbyname(char *name) { char winsreq [FSTRING_LEN]; /* OK */ r_strncpy(winsreq, name, FSTRING_LEN) ; return 0; } int main () { char in [INSZ]; in[INSZ-1] = EOS; _nss_winbind_ipnodes_getbyname(in); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/constants.h0000666000000000000000000000035413571573400024611 0ustar #include "../../../../lib/stubs.h" typedef int NSS_STATUS; /* Size of overflowed buffer. */ #define FSTRING_LEN BASE_SZ /* originally 256 */ typedef char fstring[FSTRING_LEN]; /* Size of input buffer. */ #define INSZ (FSTRING_LEN+2) frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/CVE-2007-0453/structs.h0000666000000000000000000000061613571573400024305 0ustar #include "constants.h" #ifndef BOOL typedef int BOOL; #endif struct winbindd_request { union { /* Got rid of most union fields.... */ fstring winsreq; /* WINS request */ BOOL list_all_domains; } data; }; union nss_XbyY_key { /* Got rid of most fields.... */ const char *name; int number; }; typedef struct nss_XbyY_args { union nss_XbyY_key key; } nss_XbyY_args_t; frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/samba/README0000666000000000000000000000042513571573400021707 0ustar -= Samba =- Homepage: http://www.samba.org Domain: SMB (Server Message Block) Suite SMB is the Server Message Block protocol. It is an application-layer networking protocol for accessing files, printers, etc. on Microsoft Windows networks. Samba is an open-source SMB suite. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/0000777000000000000000000000000013571573400021537 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/0000777000000000000000000000000013571573400023155 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/README0000666000000000000000000000231413571573400024035 0ustar -= CVE-1999-0047 =- Vulnerable version: Sendmail 8.8.3 and 8.8.4 File: sendmail/mime.c Download from: source not available anymore Domain: Server _ Vulnerable Functions and Buffers _ Function mime7to8 reads four characters at a time from a file and copies each character into a fixed sized buffer. The number of elements copied depends on the length of the input, but the pointer into the dest buffer is reset if a '\n' is encountered. A typo (fbuf >= &fbuf[X], which is always false, instead of fbufp >= &fbuf[X]) prevents the copying loop from stopping early if the end of the dest buffer is reached. The patched version fixes the typo. _ Decomposed Programs _ Zitser's model program: mime7to8/ mime7to8_{arr,ptr}_{one,two,three}_char*_{no,med,heavy}_test_{bad,ok}.c Variants arr and ptr use array indexing and pointer operations, respectively. Variants one, two, and three read (and test) one, two, and three characters from input on each iteration of the while loop. Variant no only checks whether the input char is EOF; med also checks whether the input is '=', '\n', or '\r'; heavy also checks the input with isascii and isspace. _ Notes _ This is Zitser's sendmail/s4, simplified. BASE_SZ was originally 50. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/complete/0000777000000000000000000000000013571573400024765 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/complete/mime2-bad.c0000666000000000000000000001647513571573400026703 0ustar /* MIT Copyright Notice Copyright 2003 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. $Author: tleek $ $Date: 2004/01/05 17:27:44 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s4/mime2-bad.c,v 1.1.1.1 2004/01/05 17:27:44 tleek Exp $ */ /* Sendmail Copyright Notice Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. All rights reserved. Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. By using this file, you agree to the terms and conditions set forth in the LICENSE file which can be found at the top level of the sendmail distribution. $Author: tleek $ $Date: 2004/01/05 17:27:44 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s4/mime2-bad.c,v 1.1.1.1 2004/01/05 17:27:44 tleek Exp $ */ /* */ # include "mime2.h" # include #include void mime7to8(HDR *, ENVELOPE *); char * hvalue(char *, HDR *); int main(int argc, char **argv){ HDR *header; register ENVELOPE *e; FILE *temp; assert (argc==2); header = (HDR *) malloc(sizeof(struct header)); header->h_field = "Content-Transfer-Encoding"; header->h_value = "base64"; e = (ENVELOPE *) malloc(sizeof(struct envelope)); e->e_id = "First Entry"; temp = fopen(argv[1],"r"); e->e_dfp = temp; mime7to8(header, e); fclose(temp); return 0; return 0; } static char index_64[128] = { -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 }; #define CHAR64(c) (((c) < 0 || (c) > 127) ? -1 : index_64[(c)]) /* ** MIME7TO8 -- output 7 bit encoded MIME body in 8 bit format ** ** This is a hack. Supports translating the two 7-bit body-encodings ** (quoted-printable and base64) to 8-bit coded bodies. ** ** There is not much point in supporting multipart here, as the UA ** will be able to deal with encoded MIME bodies if it can parse MIME ** multipart messages. ** ** Note also that we wont be called unless it is a text/plain MIME ** message, encoded base64 or QP and mailer flag '9' has been defined ** on mailer. ** ** Contributed by Marius Olaffson . Modified by Misha Zitser ** ** Parameters: ** header -- the header for this body part. ** e -- envelope. ** ** Returns: ** none. */ void mime7to8(header, e) HDR *header; register ENVELOPE *e; { register char *p; u_char *fbufp; char canary[10]; u_char fbuf[MAXLINE + 1]; strcpy(canary, "GOOD"); /* use canary to see if fbuf gets overflowed */ p = hvalue("Content-Transfer-Encoding", header); if (p == NULL) { printf("Content-Transfer-Encoding not found in header\n"); return; } /* ** Translate body encoding to 8-bit. Supports two types of ** encodings; "base64" and "quoted-printable". Assume qp if ** it is not base64. */ if (strcasecmp(p, "base64") == 0) { int c1, c2, c3, c4; fbufp = fbuf; while ((c1 = fgetc(e->e_dfp)) != EOF) { if (isascii(c1) && isspace(c1)) continue; do { c2 = fgetc(e->e_dfp); } while (isascii(c2) && isspace(c2)); if (c2 == EOF) break; do { c3 = fgetc(e->e_dfp); } while (isascii(c3) && isspace(c3)); if (c3 == EOF) break; do { c4 = fgetc(e->e_dfp); } while (isascii(c4) && isspace(c4)); if (c4 == EOF) break; if (c1 == '=' || c2 == '=') continue; c1 = CHAR64(c1); c2 = CHAR64(c2); /*We have read in four characters, skipping spaces */ /*BAD*/ *fbufp = (c1 << 2) | ((c2 & 0x30) >> 4); /* Write first char to fbuf */ /* Check to see if either 1) reached a '\n' or */ /* 2) fbufp about to point past end of fbuf (unfortunately there is a typo in the if-check) */ /* suppose the string in e->e_dfp is longer than MAXLINE + 1 and doesn't contain any '\n's, then" */ /* we will never catch the case when fbufp points past the end of fbuf because of the */ /*typo in the check below. fbuf will get overflowed with arbitrary data */ if (*fbufp++ == '\n' || fbuf >= &fbuf[MAXLINE]) /* it shoud say fbufp >= &fbuf[MAXLINE] */ { /*BAD*/ if (*--fbufp != '\n' || *--fbufp != '\r') /* possible illegal read *--fbufp != '\r'*/ fbufp++; /* if fbufp points to */ /* fbuf[0] and first char read in is \n */ *fbufp = '\0'; /* putline((char *) fbuf, mci); */ printf("resetting fbufp\n"); fbufp = fbuf; /* fbufp gets reset to fbuf. unfortunately this never */ /* happens */ } if (c3 == '=') continue; c3 = CHAR64(c3); /*BAD*/ *fbufp = ((c2 & 0x0f) << 4) | ((c3 & 0x3c) >> 2); if (*fbufp++ == '\n' || fbuf >= &fbuf[MAXLINE]) { /*BAD*/ if (*--fbufp != '\n' || *--fbufp != '\r') fbufp++; *fbufp = '\0'; /* putline((char *) fbuf, mci);*/ printf("resetting fbufp\n"); fbufp = fbuf; } if (c4 == '=') continue; c4 = CHAR64(c4); /*BAD*/ *fbufp = ((c3 & 0x03) << 6) | c4; if (*fbufp++ == '\n' || fbuf >= &fbuf[MAXLINE]) { /*BAD*/ if (*--fbufp != '\n' || *--fbufp != '\r') fbufp++; *fbufp = '\0'; /* putline((char *) fbuf, mci); */ printf("resetting fbufp\n"); fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /*BAD*/ *fbufp = '\0'; /* putline((char *) fbuf, mci); */ } } else { /* do something else... */ printf("We only support base64 encoding...\n"); } printf("canary should be GOOD\n"); printf("canary = %s\n", canary); } /* ** HVALUE -- return value of a header. ** ** Only "real" fields (i.e., ones that have not been supplied ** as a default) are used. ** ** Parameters: ** field -- the field name. ** header -- the header list. ** ** Returns: ** pointer to the value part. ** NULL if not found. ** ** Side Effects: ** none. */ char * hvalue(field, header) char *field; HDR *header; { register HDR *h; for (h = header; h != NULL; h = h->h_link) { if (!bitset(H_DEFAULT, h->h_flags) && strcasecmp(h->h_field, field) == 0) return (h->h_value); } return (NULL); } /* */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/complete/mime2.h0000666000000000000000000001236413571573400026155 0ustar /* MIT Copyright Notice Copyright 2003 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. $Author: tleek $ $Date: 2004/01/05 17:27:44 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s4/mime2.h,v 1.1.1.1 2004/01/05 17:27:44 tleek Exp $ */ /* Sendmail Copyright Notice Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. All rights reserved. Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. By using this file, you agree to the terms and conditions set forth in the LICENSE file which can be found at the top level of the sendmail distribution. $Author: tleek $ $Date: 2004/01/05 17:27:44 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s4/mime2.h,v 1.1.1.1 2004/01/05 17:27:44 tleek Exp $ */ /* */ #include #include #include #include #include #include #include /* I have cut out the BITMAP field of header */ struct header { char *h_field; /* the name of the field */ char *h_value; /* the value of that field */ struct header *h_link; /* the next header */ u_short h_flags; /* status bits, see below */ }; typedef struct header HDR; /* modified address structure */ struct address { char *q_paddr; /* the printname for the address */ char *q_user; /* user name */ char *q_ruser; /* real user name, or NULL if q_user */ char *q_host; /* host name */ /*struct mailer *q_mailer;*/ /* mailer to use */ u_long q_flags; /* status flags, see below */ uid_t q_uid; /* user-id of receiver (if known) */ gid_t q_gid; /* group-id of receiver (if known) */ char *q_home; /* home dir (local mailer only) */ char *q_fullname; /* full name if known */ struct address *q_next; /* chain */ struct address *q_alias; /* address this results from */ char *q_owner; /* owner of q_alias */ struct address *q_tchain; /* temporary use chain */ char *q_orcpt; /* ORCPT parameter from RCPT TO: line */ char *q_status; /* status code for DSNs */ char *q_rstatus; /* remote status message for DSNs */ /*time_t q_statdate; */ /* date of status messages */ char *q_statmta; /* MTA generating q_rstatus */ short q_specificity; /* how "specific" this address is */ }; typedef struct address ADDRESS; /* modified envelope structure */ struct envelope { HDR *e_header; /* head of header list */ long e_msgpriority; /* adjusted priority of this message */ time_t e_ctime; /* time message appeared in the queue */ char *e_to; /* the target person */ ADDRESS e_from; /* the person it is from */ char *e_sender; /* e_from.q_paddr w comments stripped */ char **e_fromdomain; /* the domain part of the sender */ ADDRESS *e_sendqueue; /* list of message recipients */ ADDRESS *e_errorqueue; /* the queue for error responses */ long e_msgsize; /* size of the message in bytes */ long e_flags; /* flags, see below */ int e_nrcpts; /* number of recipients */ short e_class; /* msg class (priority, junk, etc.) */ short e_hopcount; /* number of times processed */ short e_nsent; /* number of sends since checkpoint */ short e_sendmode; /* message send mode */ short e_errormode; /* error return mode */ short e_timeoutclass; /* message timeout class */ struct envelope *e_parent; /* the message this one encloses */ struct envelope *e_sibling; /* the next envelope of interest */ char *e_bodytype; /* type of message body */ FILE *e_dfp; /* temporary file */ char *e_id; /* code for this entry in queue */ FILE *e_xfp; /* transcript file */ FILE *e_lockfp; /* the lock file for this message */ char *e_message; /* error message */ char *e_statmsg; /* stat msg (changes per delivery) */ char *e_msgboundary; /* MIME-style message part boundary */ char *e_origrcpt; /* original recipient (one only) */ char *e_envid; /* envelope id from MAIL FROM: line */ char *e_status; /* DSN status for this message */ time_t e_dtime; /* time of last delivery attempt */ int e_ntries; /* number of delivery attempts */ dev_t e_dfdev; /* df file's device, for crash recov */ ino_t e_dfino; /* df file's ino, for crash recovery */ char *e_macro[256]; /* macro definitions */ }; typedef struct envelope ENVELOPE; # define bitset(bit, word) (((word) & (bit)) != 0) # define MAXLINE 50 /* modified max line length */ # define H_DEFAULT 0x0004 /* if another value is found, drop this */ /* */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/0000777000000000000000000000000013571573400024626 5ustar ././@LongLink0000644000000000000000000000015400000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/array_vs_pointer.odsframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/array_vs_poin0000666000000000000000000004144513571573400027434 0ustar PK+6l9..mimetypeapplication/vnd.oasis.opendocument.spreadsheetPK+6Configurations2/statusbar/PK+6'Configurations2/accelerator/current.xmlPKPK+6Configurations2/floater/PK+6Configurations2/popupmenu/PK+6Configurations2/progressbar/PK+6Configurations2/menubar/PK+6Configurations2/toolbar/PK+6Configurations2/images/Bitmaps/PK+6ObjectReplacements/Object 1\}lEBA[J@`^["FJM TZ ^A`> 1 FGM!D>4!9ovoKm޾};~ongpzݜƙ.*%}sQ.Y7]N=G/'SP mQ岓Ԭ8Q A;rECvΰ Y}#^j=nICKUϪ˵kj mDG VVfYáo*Vr]6#Śȩ^&I-6L[lΰ6#ةyD{%6IDS&pώ۫Dk)ljX%!Hƛ߱DfH]a<᧣o:O/+,:O\J@Ҟ[[vћd>~Clwgq3^pZ~n;Uͷq1煵۝u pT'hƤ gY4؝5pt(K@"zؕA Z,.Yb- v'qOODP'Yb- v'qOYb- v'qO{,F° } 厏 ,U|;{*\PQQ9*gUC#I/s$ hZ|hwҒou牦P8U&8=RxI-V'qưMoWl/㍗Ҩ`u2H4=kbM%^`,JFA*顏)6Yb iT:>DgPQd h=U&/1H @M4O5m?j_fmY\R{x-?!ꂞ l(Yl.5q:44ۅm\ktyd0OԹr>fh۴<<`s嘗]:v#wnX3O&yΕc^-lwAMq`VEYA1/+Cz 4ۗO 7m.5q:?ٴ<<`sw:twC]dtw@_O7m.5q:ݙa\ktyd0OԹr̫ÈCf{$ȯd6ǚy8g06u̻ӧOkEZ eZxG,7p*&Ckղg@M0X4K8z,rx)tz z!w4#)GґO!44ZU8wăL|}%>x,`"ܩ8p˓BJECOM$)܌Ou˟Ѥϥlc C" ? ^\J KGj`bR#D5϶&1$;ǀQWQsAl)-`?iMR"lamڅ|&mҚ `I`:{'!y^8 }y&Z'ف~+yMyRHg鵺ǜ߹wr|VJ/:Auar=xh#cYJX] c32*^[NSN9S<`=hծJJq0anhvjRv,8Z7f:7U&m=lW2IJD9[r{~_Kvdk4Nv.-*̍Ni@ 'hkNU#t`ؒ!~%@IzQ jj"g8@JYi\ ptA#/&o5(& ?3T4s47:P7`AMJ0B0 +B8Ga87W86[- zCډ#&j& ͡Л!4P)n9YSb`Dܽ* E& O/ύXZq(Ci`\0CJ-<< '6Xq>CssDDoF+ōxn䩚C^8hFP\9eoE3cTD0GlE)ЁqL/.|rO1>>ULZb<6՘gj fm0lhIN45G\2Mytu(=~rV7olTOf4;C,$OQ^ nAipP=8^.i;esIPK @(PK+6 styles.xmlYێ6}W"HʒٵE"H%KIeɒl5"M 3 ݇}N'[,$lEЛ`l}W{\Ӕx1ST\ͥW H`(r/0sB&zaLl7ޫےE )+iSV7JHl\J9ԧOpLV<ߚ,'HzXz/P.xJ3̰ pT#RQ1$ +v)z.RSպU'p+McL%BNULrʥ7;RT 2MW 4q^ 1݀-aGa]rx=O"(BK'T܇X'^9̗mU* wUrFգ3tt{6&}ׁ޶":QtA<Q֡D@:$B-6ȝ(YJh;؆':°AÔ r;jAsmEZgDafQinR; -%aXt1%6Y@6##j XA`!wØvSg5FeJعoZ֓uj&WN%$# \d uĥ0LE͇Нc)$e = SM;ۈڱ'weq̒!Y&U5Jh[N]e3h QQ'9K2|"Sou򠢠~+.Gc&D]8=itᤃkowSI0, Q?39h}(4f+_,FrJȎ$c9& I]`֒3*vG_'73è4(ɘ/y)a&)O0@QҋAGSI}]u޾`VF_E JWv$ݟ]'GF0o_z@):RT׃Ԟ Tk)ziK׭Mp:;HdGqwڋ·W\) NW;Sr{ltbq9YޚD$7 > )PbvLx9A?WίPIj f1)ߥrȑUfsMVt˞~`~. z|||N℃PM$oN?Tk;"gqjq~օC%f?₋:ĺI -M8EmB-K%sN`g,joЀ[ㇷl`6׿U^hꗉslNeOۿR 4ϳ|ڵ)ϴPK&+*PK+6Object 1/content.xmlko ]zR m[WFen$Q W}- 6q'3 - yyg-fb9lw'Z/or\+#.B.V,(/ c񂖸&B.x/e^zdElr' e`T}EeZQz^"Agx[B v.)K/"G6 ]aJbgX g{NMcOҚ*M:*ߦWG6=cxձ $&oOgXT_icʒSŌWSSFUɠTnhؠ]$1"03143yPXx+ô |i~wrC̓[/%&Ol THT%SG뢉6B8RAΟtzTY#q?%whTA9)@)%$%'g'驀x+ $;HDfI*נqeLGV- "YQ?G)dȾYjhtBu&.+D.ۃɻlj~D%? E݌kDsJq;y$"EȎ2np?Kѷ#d6*ޣC\TzUȠ:~`Ou7wiկ8aCRxC7F_Q A2* CƑ e4\4HqufCCuueG  9G8YXI3Bx!%%n Q'O*ֆcn^;)0G-xcTX[mOKIae$'dmSgbőC z b()\''+C8̲BkWb3ͺ J Oh6!A iXW=&!mD+6RDFH)dX粐vVr'`ҸRUo A6m/#zeu5A"U#0!gϕYȝavnnwmiL&E59RSM+M ty~n6*gs@֘k4Ȋ+CWZ NkVy^KDHCОa-oj|+問~xg/0F[nE8|+'b}r =jʌ 0ب^kfC %[1哷?7m ?kȁ]3mk3+#\UcD8= n"M.Iڵ>ړI]%#0}~NZzvdreZ޼ Syd4n |4I\ϡ>Ms`yfy~RFn3׷ӽ*͛c%PTH4 Rjܒv(zzVM҂T *4(k)ы9^Z*P;s$2y5+_@T7ЃHF}=KqyO}55FF_n!wVTaV4"S73ꈓ<$Fo#Ceʁhr6RB2dhNx΍b{s:ۛT0)ϭ$˘aOwQ8B;tV2| ~TRB{23ʳei afgp5n6h0F9ၢ4ȨEjvCӢ (JמN an6(=c0N jnhD5:j~nv{MzNN5<1|p҈o1&L֯@ⰆPKGG"9PK+6Object 1/styles.xmlr @ k ͭ_~A4Lu}4Qx]vYN穓ȵJgpŠ-[ F0Nj`CǕM$ Y7K4hEa72=W74Xámdcݹá]kb兝k ʓi)VbB}jmO0ve@8?n -=U3%_g9j.\GZ3fl:]-*.}EzCr/z}џ~{;-,JU{dr<)g4wAuuquPK3:LPK+6meta.xmlQo +,WF+RMrcn?V!/sʇcON]!'(͍ߣKiv;Ɂ &ZcSB4N:=蹅, o~{gƶEABuF_}oU'`)1᭡F<1f4S0.ML{zѴ.u l㍭_38!uօ5{O:}Y^ iFan!Ϡ>YnHE '_qZlʆE75W ή9SGeZ4M 5hj4e1$-WgH y_[ERz I " X*w&܂amX`ˏs~^ eh9(hh>Ɨ48dDɵ]PK?PK+6Thumbnails/thumbnail.pnguXwXS˶%! ;R $H UH3TM$D.@I^EMjJS v{${֬YUx= 4Wh.Qj࿞  Ob πaQ 191QnL1pV]md[~ħϩG& #z3n)Ii\r0\Z*q*ob”|cԨtlkoz{ny(=XxT9{fy'@܏ͳ S}2+ޏ1lG@ΐcMiʺ$:u&UI ?'<~5 thEC寭?ӻ8z- .oԌ[-o_#z-fd5gy3e'8jbsrK0I—o h Esn)sϗ Mxkd7 ;$M޽ob/ 6Ox-}ds1rI\kn֎[xO"߳ѕ7mfoK؂PT]+"Ia ba[o-sdfV"|z )==!ϥuNu݀ Sk^&`cKY!%S0bi;Lb>×:5hhyY3Dj; 8bjjqQ'SH6<9`Jc еCߛ4%srtR^*~eᬔ_̌g6Jli_^J{εN6,f1*7$,ѧj2a# %>α lr]׊*%`kdH{" ,ɼ񊞰 O+lOZR MTϨ3[#àʬGuubZ"Ww`1juy`trX&&4BA Z;[y8_=[©"yyhE]翃>˯ |Oy~;pȗ៓̍"IW$'KI1ʩ+@FOw>˫ijW?]$?JUB`C[u{s@թɸx5+Q$;JFhBhfy~l5)bwOFQF[]VaG=_eKn,hdQ_bEazf|64 )c 1i\c5'WPbz`#uFWKҬpX8w]~o)Y xքsmEv=ILIXを?<t͗*37i KV:%,KK@H7C9U|/;JqsUYQs%0J4f"ǩҹr  1HAͩz7!ыSH(D;.8zX;Ѳ-<(#VsQ A&3 Ոm r "셚Ĥl 0deH+ޟŦփ̓_4=>.7Ye Kd'k\u6+Ty8V$Y,@-Q). bT'a9s#ijJO% 8\';bD>셓R乐~Z" R#U`v-nwE!ͫ4  0ex s{:u7zR,#r;v[:hXzn*e0oNQjal8;_3>s,K/$U -x'KUSOuLDqpPm6wg?ԗ_Kd]9}?ANIU+#!B~Rݬ?L9,'ɒf, )U,  LzD˯Yowqryh Y\d1J-D&6\+IJG\1DF(̼EXzqحJTMfk~ϼ=ִ=Rk }T;pZeQ%eJʇBUǙ#Yo6:i5ˌqthd:o.֨ѿ_N$FFZ̿Eo"z3S͕Y6='!"6m~p2w'ˊm}eAŁ, $m>'`.(#ƿ?'1AACmͷDKзSDžVmLnJQR/iݟY0"5GC-e2T{L?ja)g b?A1FGYBF!E'^s֝?D͗{Qxc[-[e)ξUWsZYE 1IF+12JхWJ*;>Ǝ;`rͿzJ(i<ϥ/y/E,C7\g=Θ(ZV.bY'7\ {w9J-<҉aQϾ(P7mn iͭ#P !Q>?~jwgn5Eҵy;h`%Vh 3/sռ?;LM$hVOFm S7e܋ xa''BUd"G*:9qmB r;j$<[Oq9O;C,+КVCךdU6rŶ'K j1Zel /ԨJ@J;z>6&0&ꋼe6a\ⲻV 4(?5ڮFSډ;V%7񎬁W|L 0a5ɄpՕF[ t¥*ֲ->:=w0ytpAUvGvDMk=_oj@▷]|:e2%j DWtrNaW|mGH_b!řƁi rK-W(n4e4"s=}mAM=ݧhKR灿%6 CmN*bxg#Ƶ?#[f;ݒѣG+ySJiqHDP/6T@ tC `'7ŭh]ue~[˦1,e=]J}1l=xRtw->SQ,"et: |3!y"[U^s6 up0?#w^3}zf4F*NB > F$d:\~_Y+3sp`@R:'znGJcoܗΦ\81Q[zB+vޘfPȦރ9Ui0&/VI,j7cDC4=[w$NƦm,Y*j@o#ڎԌ67OxkM@D0 !XJ`x4Z б~dO9(QU(4LC<{ \G:=i6+xӝei~ͺeduQjY͖$*ep~'I">5S"ܑJJ$Pε1,7n|h]d90ƾoz[Ttd GV 驋q V$6m0jĒN$~v<~W%xo , )§?mmK(k]`6)evzL}Йp@ k^JMr0˜ N\-"F\n gBZR%`coLħʼ4,PyO|^lVmPT%j {s{  ̦ʹX.JY\`Ǹ)5-j})sWhN;,`[~]9LwE?LPlQӱ::IJ_)=Zb)3 &y7+= 2\ F[ZX*zGtƣks<H呀R)SL[ZiDESzMBY|:"K,0ZZ eجV8>OUkFL}@]Oc0+VZe-3մ7zl}&H?$Me8)ִm랯q@.`Bm3(DTjm]WAy|l'͂N?Y##D}~ ۭZ_"1~FL!:Z;K4#(%%vp͈ ƇL n Z9Vz1>Q b$C.w( O?I4+t Yz w#oqkk=qˍwoy4 ή_ţ cf)եP(f+!3$W ʴ&Ke C@BV<ɣ=o<tlj/9A5f<YBI@+} r>*HsIm@{I\ p, $ Jb]1B;:Y%vhD%oIzg=`5OP q 1{:㏼?W>0*i~#)-&#؋ Uq~t=H!G^e=s/QZv|wUK%\ХfƿoS'qm1Vgz]6&ҧwUwexzG~YI#:G&{=G}aZ?t<vmڌo6Ÿn}1ob@W܏nϩO'qOHMܹ.nM^NV*x/o@2{ewq>f8d$tkO1Ա]Rph6QouzXd$P$I950Rn:{LH+.gdIZJڃXIƸd o|KnjgNei55r7PK VPK+6META-INF/manifest.xmlMo1=p5儶T*BB&ٍcJRJ@My[ m]nPv7ry0`ՈݮQyݾvHQg u,;NF?㻬<QilR`V14V8)nk%Za5"n۳ufeAikNs=Ȝ~U._oPKdV PK+6l9..mimetypePK+6TConfigurations2/statusbar/PK+6'Configurations2/accelerator/current.xmlPK+6Configurations2/floater/PK+6Configurations2/popupmenu/PK+6QConfigurations2/progressbar/PK+6Configurations2/menubar/PK+6Configurations2/toolbar/PK+6Configurations2/images/Bitmaps/PK+6,ryb_4ObjectReplacements/Object 1PK+6 @( content.xmlPK+6&+* ostyles.xmlPK+6GG"9Object 1/content.xmlPK+63:LZ Object 1/styles.xmlPK+6?!meta.xmlPK+6졳tz#Thumbnails/thumbnail.pngPK+6 V x7settings.xmlPK+6dV g<META-INF/manifest.xmlPKU>././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/data_testing.odsframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/data_testing.0000666000000000000000000004375213571573400027310 0ustar PK$6l9..mimetypeapplication/vnd.oasis.opendocument.spreadsheetPK$6Configurations2/statusbar/PK$6'Configurations2/accelerator/current.xmlPKPK$6Configurations2/floater/PK$6Configurations2/popupmenu/PK$6Configurations2/progressbar/PK$6Configurations2/menubar/PK$6Configurations2/toolbar/PK$6Configurations2/images/Bitmaps/PK$6ObjectReplacements/Object 1]klU>E,o -v[ RV0&X*wEDQ(W??4i|&j#;ݽL3 Cf;|Μ;S.\juՑBTIʞ?!lQ[TQ98x3&k?{]:'GnډX aQJ;Qc HQDlܴ@V*{(F<#fnC QYnd-H֎kOy&Y3Ɉ&k[cav[ސWU[cavTao {a?R-#ru/I~u {Sf؛\ {3xrt%l<>s%N|rhMډTmɡՓP1vI@>kiL5ulV~VXl:A(c"Н\8DPxM $"cݐO @1N.G9֍Dx(U $"xǺ)<dc"Н\%4ODjܘt'K%ED c"Н\]8֋`'"W"+D; 'pOD/B@wP Ely_]VoaiAwp-la$u3yVI-yܧg\T@Hf) Jf9[>m3(UNS.'%If-1JfNY }S!s$%6VRke&d*r;eq.-dwE(UﵲyZb2Z98:9e{GV=>oYKLY+LfdvaDߛ${Ry4n$ HɬSC7d}r#1p.Fdʼ>yˍkeawRi~1\@4l#ۭ[w.s̡pydC2oZyqrMLW(lʛh;J Q S=s>Mss攴zyGd?'ܻY, rdOk KsG', ʼKs_c3qw_/j.tEEXhѥSصy{s;~7ay. Z\] B*ǖUTJzPs -&Og7ܳ*'rݝ7G1?&R.q(ՔQWyӗ,1KVNޗ,]&ѣ%ېK ;n1O74P,wn'n"' +s2wpVhv8sV͵!Yd߃.lU'{y\Yŀu@x9:y?g'1L>؇qaÊ)II!Q G]쮝Â9#Vъlt}Ǭڒ<ɾ {=kp|諬T[=e}DRQK,^2/KOﶄWV<Ө$HF35؜Hܗڔ*;4XgYxyIc6xחž*}Lc-U`PMw2Y[MSIocmY~)h=@ ʴ-|qEa,|I;0}h!$.TdvG7M4^+Hy%$feZ%qq3g5r;vЎS8P!N%1T#]xR+=B\ #.mJG!IN_<=nֻw-KWI#mM<3uVԯhVYNi Q!1JYC[ b ?D5XN\'ǯp $6-{Bw{oSA4%H_&sxJ#W<;u"bO(3|T36Y29Uji[~PB'DnVƵijjdo%/ř ^K#K@4z,H>NhՅy~P8) :n ,C&;g^@.TU{gAXRHNՕ|z _ά7{on5'ۤMY6iưtNvΤc7yy/z;-Ɨre٢s{Kn`} B7X~`gǖ3-ʮ^p(s+GKw>{ TF.{7P\wj\ %xN(,d Ԍ|4! |i{U iQ;i8r{cs^hQ߃ry)w 3,I-DATA? Diӯp)*|؅iNR1>}D{wZǢTLj7Ns)A)M(MʩJH`Qg. $P&PKF0΋ %R!\",[J_b;e%` 3)g &#MqzDk;BC_wCZZ-ЫC993TZ$Qw˵ܣH Up?5gEV 鰒s E׼%KT ېDPFFЂ܎񃜧n[ ,ź:i(~k͜6(όj:K?4]x)DM"z&lF7ykSB}r.z0`gj$j[yWNdȥ$# Vl u$0Lȝ)M (8w:o1rX'``cXGyn7,M17i}.%1h.ʓ.?VScAm|~ ZrT)Rpu@?={:yPQЊϠ\Gc&=iIGo57ZӫCF8.iYLADJeD! J!vtr$~72&UI$d(x0kY~;mbCsSq #C?d,zؑ{\@GLR\Qҍ FN_}^աy\0+F㯢ԅc+;tAaP}7LDŽNT3y`>':*uw-3ڎs^'^nDOD{N{QTWJEo8UηA7.X<,zT LeD揁(?&z;A|=?I"&^}S<_FdBg65M 4[/{}+[&.V+ENu(]&SZjjQනXT8t!q$ntK|!OM~ednQ: VxtƂɭ1 5At,W6 + 9xVvz({}&<϶Uh z8?PKR<PK$6Object 1/content.xml[[o8~4`A7[țȠytyYmDx~Lٲ+1ANs99$SN 悰֍up[MwwonbARBHTT-Gꦉ֒HiSUYJܭn19('x rY ˏ&ywcHW[M,PNNMZdQK)`8{+`zjA( h,wDl7tF8N5\",(Vu a#f){J@l-,4.Q*ȟk4'LƃdJ٥A~D%|?T3qƣZRc5}š<4OGbN;ְt8\~Yp FIօ,Q^]S2F8 Ut/l~ @EF14{pW ,}D keE+1l!p0P[ ` ͔ڊx(24ʁ]>gԓL7[`MݨGV o-0a= w7G\2 j9FAt}x9^!3M6PJr"hL O;y{ICMnh#YfD_m)t< "q~C&"RP*Em$%\媹(*:~zUgl/ ޜcvפqAS"<)"ٯ;U{ܙ)hiޚ*—= ~dwou˝ݻ!="v1hwkNKTMꭞmv -;eǘ^|wOîKtEyD9`6֟.UW}0g<$q' g;ΞLн}ۚ/}mϱ'Whaβ]3оTO շ(A\YW,WRpHVb Q-k&R$ޠզ$*R?𣸱 Au @>wKJ-pq>b!ItXp Dw#MPC3xPaު^<܍a4:PeJ$C0dgX"Őe}YPǝ coF3cK,[!ano ٶ2)QaVP ͸BA&T^z"d}0,9{ը??ǧ=b|ЪNQO̿ۯ|$vݑublM0NzDU?O$k׶џXy´YFM)hؖy_bBٶ= %4Gש"JGΰni XS]aHX(u[\ @M3e?Ta>3fZk6OԋM췰yX_ê ]kI:t3}R|¡t[ Vda80۩&c->j3ؚtoJ/ҳcxYiRpXv+}<вVM\ #?/:KVd! G+0ğ>e&DS+xfR]g+YH&C0jDB&3q-@q8_sV1G{9tWOH*C0_PK,2PK$6Object 1/styles.xmlr @ k ͭ_~A4Lu}4Qx]vYN穓ȵJgpŠ-[ F0Nj`CǕM$ Y7K4hEa72=W74Xámdcݹá]kb兝k ʓi)VbB}jmO0ve@8?n -=U3%_g9j.\GZ3fl:]-*.}EzCr/z}џ~{;-,JU{dr<)g4wAuuquPK3:LPK$6^ҥmeta.xml OpenOffice.org/2.0$Linux OpenOffice.org_project/680m5$Build-9073Kelvin Ku2007-05-29T11:58:06Kelvin Ku2007-05-29T12:09:08en-CA3PT11M2SPK$6Thumbnails/thumbnail.png PNG  IHDRu2# IDATx T&Y5zd{R%$['Q=*RJ"%KITJdINZB|o޹3wܷ;̜s||NEnݒ[oZz*38#yy/Ro?T5jP뭷M<@ŋsp뭷&Sug\XƍS\rI^iƍ絎D"_}M XdIEPիWLp 94d2}S/k6unOnj=\NTlVꪫJ 6,f͚#h5|dϞ=3vyg=\R_믿)dLa5KC9D?W͚5ȑ#y&i^rKZ!{" y}{r-U۶m|:c ZBjC%^~eUvmg'MdQlꫯRuպ@F*byΜ9<yW+hHVZJsٲeZQs=W| A'? +hӦM";vĂПz=Sw%0˼+UV`S]v~ϩ}7Ic*ѴiS&hQ,3/*Ȭg6Kܘ~)5G -C ̟?_!R]|kU͚5K+kۂ{ァ?pmwb N~ON_rsAjYƍۮ& Zœ鳶pae,74REK4hP sOZH])qfL(L:aµC=!QeK(5*)^ψxg nB-RȦ8E >ol?#LGbN}ԧ~-,PzL>),@g?cI:c[o!MTP0]-1n*l %)kiTޡ#/3QU]Sg%۾l]jrY$M\cK.9V+.H36C>'>裴xAh^` T[kko߾Z40 4H Rť^$36 Rsj"5y65]4_14Rmm_,EDtA +tꩧy6i6Mט M$bz( ڂԅ8Aa:k%aޣ:yUhO63MI˗/So.8}.\:8M?~ޓKC;Se5\#\ 2⫝={ ,{キ13fЮ9V+&L&Z08zr6Be˖y[/,N;:t?ǚY';qOlrώ; `3s,ӓq;}G}T/ҳB5sL} ai8!q͏tI'i)o^=%mݦkVw}z+ޫ`ذaYgiB x X!މ:׬YlʧG9o/eu]z4`mݺiGunfuFF;uWXz"-uvs9u/ȃrz)D@ܹ~辘WY!^z>{X}?dҷo_iNB-0B`9RG 4ZHVAZ*?be=~w]5JWf^zoR^{&MX)廽E{饗th ^ȰN9L <3nHZ^}U=wL2EooX {\O7/1?ia$Sin:u*9t/%5ĉk։e|rޏ*WqzV6 dpa L cǎU?V'^4gxPD"."= Af(ԭr s­Nzk{̟4$7!C.σ*Ҩ Nj܀:wPXK. RUXؼc'e@P[A1zh}ʔyS"N:yR~im#b#@ț([M8;AEPU,C6ۂPUOTI2QϻVw 0S2?$@6ʤWSgF\C݇ FbETvt108}6yTlʽjvj۶myTs :w@LjPi:`It_94&*n u$J\LBNI\D Jy-*ӄuR%-=ˤ);5,3[X'm7Ӥ)v;5l3[7KDiB RٌD+w " Q;T'*('RwD*%+. 9ULυ-[!W1۩;MSYVcíއ/JN-i"0̧43AQ67 [D) #'s;CHzb[zF(6"[̕lg4 lqw"Kouu" ! *d|`,%?n) :tP^K /L6-}%jYs'LsCRDѤ)fs%J&r(>1Fi.uBA`RɏKO>sr$5jKo2I]zN& qDJyu"0>>}"%Ðk"0d"Yp1X"0̋+ZnD RI fy a3  ;9ܝUvjluNjCnv.l\rE`R̜Yu&8kh7w(}gQ*&MLhnʤ!'=99ĎG;ʆcbϤYbjԨ4D4& zҧUB2ޤlBDc"c36]&|W@BPLY AH?~>7Qt0B6&9|Ie,Ni+"pժUjk׮z,8gsj=b!RKL|pDZf"W szN*e"{̙1i`TD!(,N "P+WkvnڂaۅQuR8ꄭ,~{#rZ(gTWS1&1wX'U'oҤI6uSe=Bc""/ǂ*ggScB:r>9(e-mNɣE\R9!E9&FI-AĤF\]LTF"jc]0Z#OTfMj~Ь#rLBj\~PAr~.匱d2B!մYiҘGTUor{TT1`aÆt҃nȐ!jŪA),) F͙3P)@=6Q0R%@P}?"L! 928iӦV,h"}?ί'$Gͭ)#-@-lDeǁ3GF݄%DLj "&q+T-TF*?i$pBOؠ ! & i,a &@EE^Qb &IX"͛#CԩS5@^|U޽.݋jРA:9 ƫSNKEwFxVVM_G{ݺuuN:zlDN f͚zG`5tPl1kLd4'z,]T1BN 5ǵ A.lc~7_1k)ð/IX˖-?Afr,ZI-AʰIENDB`PKpPK$6 settings.xmls:_VCkŏ[TIHDwZVv-̝9sW_W>>YB%ME;UH"2o*mR犾 6\>$¡r? oM%dAGAyC8 @x;0" 4(N)eV׫P4WT:(JOAɄT0]UϪrQiZ[;louT~bMsZS"KVSv{?g8ah04P"d'"BiW_!?qۅjg;ͽk/+>*pݬ,^_,Gcu݌\0J+>i9"R˃Ph{x2NYr$xeb+l^be`$ (;!9=Beѷo8->dcշ丵ʁrڦBPoY^:xspxXnѿR(9n:8R(u0I- hhL3.R QZ/sX\2֟ ,<ߣX;rB5),4B~Qiݺ*O4@(BցDF#л{(iZ?[0Jb p ]J]&a\P+0\DS_$5vB,CE<ɋ,*3pr3YbyR:VUar]77ן'm4z k޵7tb)V/ۆY+,wm+c09Wۿ<_ЕC=Ϋ*~ؓoG#== 46S hFõ|V_L*VD®?rܛi`룺d>n3=ѻ9o6 vx!ڦpI (IG#Bb)2߉)?F:I [F!E* tf@|w kJp\r /ªyo [PKVrlgPK$6META-INF/manifest.xmlMo1=p5儶T*BB&ٍcJRJ@My[ m]nPv7ry0`ՈݮQyݾvHQg u,;NF?㻬<QilR`V14V8)nk%Za5"n۳ufeAikNs=Ȝ~U._oPKdV PK$6l9..mimetypePK$6TConfigurations2/statusbar/PK$6'Configurations2/accelerator/current.xmlPK$6Configurations2/floater/PK$6Configurations2/popupmenu/PK$6QConfigurations2/progressbar/PK$6Configurations2/menubar/PK$6Configurations2/toolbar/PK$6Configurations2/images/Bitmaps/PK$6LN g4ObjectReplacements/Object 1PK$6-C content.xmlPK$6R< styles.xmlPK$6,2nObject 1/content.xmlPK$63:LObject 1/styles.xmlPK$6^ҥ !meta.xmlPK$6pH%Thumbnails/thumbnail.pngPK$6Vrlg <settings.xmlPK$6dV ,AMETA-INF/manifest.xmlPKC././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_one_char_heavy_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000121613571573400027225 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1; fb = 0; while ((c1 = nondet_int ()) != EOF) { if (isascii (c1) && isspace (c1)) continue; if (c1 == '=') continue; /* BAD */ fbuf[fb] = c1; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* BAD */ fbuf[fb] = 0; } return 0; } ././@LongLink0000644000000000000000000000017500000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_one_char_heavy_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000123313571573400027224 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1; fb = 0; while ((c1 = nondet_int ()) != EOF) { if (isascii (c1) && isspace (c1)) continue; if (c1 == '=') continue; /* OK */ fbuf[fb] = c1; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* OK */ fbuf[fb] = 0; } return 0; } ././@LongLink0000644000000000000000000000017400000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_one_char_med_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000113013571573400027220 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1; fb = 0; while ((c1 = nondet_int ()) != EOF) { if (c1 == '=') continue; /* BAD */ fbuf[fb] = c1; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* BAD */ fbuf[fb] = 0; } return 0; } ././@LongLink0000644000000000000000000000017300000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_one_char_med_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000114513571573400027226 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1; fb = 0; while ((c1 = nondet_int ()) != EOF) { if (c1 == '=') continue; /* OK */ fbuf[fb] = c1; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* OK */ fbuf[fb] = 0; } return 0; } ././@LongLink0000644000000000000000000000017300000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_one_char_no_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000056413571573400027232 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1; fb = 0; while ((c1 = nondet_int ()) != EOF) { /* BAD */ fbuf[fb] = c1; fb++; } /* force out partial last line */ if (fb > 0) { /* BAD */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017200000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_one_char_no_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000062713571573400027232 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1; fb = 0; while ((c1 = nondet_int ()) != EOF) { /* OK */ fbuf[fb] = c1; fb++; if (fb >= MAXLINE) fb = 0; } /* force out partial last line */ if (fb > 0) { /* OK */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000020100000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_three_chars_heavy_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000261113571573400027225 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2, c3; fb = 0; while ((c1 = nondet_int ()) != EOF) { if (isascii(c1) && isspace(c1)) continue; do { c2 = nondet_int (); } while (isascii(c2) && isspace(c2)); if (c2 == EOF) break; do { c3 = nondet_int (); } while (isascii(c3) && isspace(c3)); if (c3 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* BAD */ fbuf[fb] = c1; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; /* BAD */ fbuf[fb] = c2; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; if (c3 == '=') continue; /* BAD */ fbuf[fb] = c3; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* BAD */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000020000000000000007763 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_three_chars_heavy_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000266213571573400027233 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2, c3; fb = 0; while ((c1 = nondet_int ()) != EOF) { if (isascii(c1) && isspace(c1)) continue; do { c2 = nondet_int (); } while (isascii(c2) && isspace(c2)); if (c2 == EOF) break; do { c3 = nondet_int (); } while (isascii(c3) && isspace(c3)); if (c3 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* OK */ fbuf[fb] = c1; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; /* OK */ fbuf[fb] = c2; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; if (c3 == '=') continue; /* OK */ fbuf[fb] = c3; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* OK */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017700000000000010000 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_three_chars_med_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000234213571573400027226 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2, c3; fb = 0; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; c3 = nondet_int (); if (c3 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* BAD */ fbuf[fb] = c1; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; /* BAD */ fbuf[fb] = c2; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; if (c3 == '=') continue; /* BAD */ fbuf[fb] = c3; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* BAD */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_three_chars_med_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000241313571573400027225 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2, c3; fb = 0; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; c3 = nondet_int (); if (c3 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* OK */ fbuf[fb] = c1; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; /* OK */ fbuf[fb] = c2; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; if (c3 == '=') continue; /* OK */ fbuf[fb] = c3; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* OK */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_three_chars_no_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000110513571573400027222 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2, c3; fb = 0; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; c3 = nondet_int (); if (c3 == EOF) break; /* BAD */ fbuf[fb] = c1; fb++; /* BAD */ fbuf[fb] = c2; fb++; /* BAD */ fbuf[fb] = c3; fb++; } /* force out partial last line */ if (fb > 0) { /* BAD */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017500000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_three_chars_no_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000126013571573400027224 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2, c3; fb = 0; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; c3 = nondet_int (); if (c3 == EOF) break; /* OK */ fbuf[fb] = c1; fb++; if (fb >= MAXLINE) fb = 0; /* OK */ fbuf[fb] = c2; fb++; if (fb >= MAXLINE) fb = 0; /* OK */ fbuf[fb] = c3; fb++; if (fb >= MAXLINE) fb = 0; } /* force out partial last line */ if (fb > 0) { /* OK */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017700000000000010000 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_two_chars_heavy_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000200113571573400027216 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2; fb = 0; while ((c1 = nondet_int ()) != EOF) { if (isascii(c1) && isspace(c1)) continue; do { c2 = nondet_int (); } while (isascii(c2) && isspace(c2)); if (c2 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* BAD */ fbuf[fb] = c1; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; /* BAD */ fbuf[fb] = c2; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* BAD */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_two_chars_heavy_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000203413571573400027224 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2; fb = 0; while ((c1 = nondet_int ()) != EOF) { if (isascii(c1) && isspace(c1)) continue; do { c2 = nondet_int (); } while (isascii(c2) && isspace(c2)); if (c2 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* OK */ fbuf[fb] = c1; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; /* OK */ fbuf[fb] = c2; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* OK */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017500000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_two_chars_med_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000162313571573400027227 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2; fb = 0; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* BAD */ fbuf[fb] = c1; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; /* BAD */ fbuf[fb] = c2; /* BAD */ if (fbuf[fb] == '\n') { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* BAD */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* BAD */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017400000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_two_chars_med_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000165613571573400027235 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2; fb = 0; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* OK */ fbuf[fb] = c1; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; /* OK */ fbuf[fb] = c2; /* OK */ if (fbuf[fb] == '\n' || fb >= MAXLINE) { fb--; if (fb < 0) fb = 0; else if (fbuf[fb] != '\r') fb++; /* OK */ fbuf[fb] = 0; fb = 0; } else fb++; } /* force out partial last line */ if (fb > 0) { /* OK */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017400000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_two_chars_no_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000073413571573400027231 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2; fb = 0; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; /* BAD */ fbuf[fb] = c1; fb++; /* BAD */ fbuf[fb] = c2; fb++; } /* force out partial last line */ if (fb > 0) { /* BAD */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017300000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_two_chars_no_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_arr_0000666000000000000000000000104313571573400027223 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; int fb; int c1, c2; fb = 0; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; /* OK */ fbuf[fb] = c1; fb++; if (fb >= MAXLINE) fb = 0; /* OK */ fbuf[fb] = c2; fb++; if (fb >= MAXLINE) fb = 0; } /* force out partial last line */ if (fb > 0) { /* OK */ fbuf[fb] = EOS; } return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_one_char_heavy_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000122313571573400027244 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { if (isascii (c1) && isspace (c1)) continue; if (c1 == '=') continue; /* BAD */ *fbufp = c1; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* BAD */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017500000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_one_char_heavy_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000125213571573400027246 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { if (isascii (c1) && isspace (c1)) continue; if (c1 == '=') continue; /* OK */ *fbufp = c1; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* OK */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017400000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_one_char_med_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000113513571573400027246 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { if (c1 == '=') continue; /* BAD */ *fbufp = c1; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* BAD */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017300000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_one_char_med_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000116413571573400027250 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { if (c1 == '=') continue; /* OK */ *fbufp = c1; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* OK */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017300000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_one_char_no_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000057113571573400027251 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { /* BAD */ *fbufp++ = c1; } /* force out partial last line */ if (fbufp > fbuf) { /* BAD */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017200000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_one_char_no_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000065413571573400027253 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { /* OK */ *fbufp++ = c1; if (fbufp >= &fbuf[MAXLINE]) fbufp = fbuf; } /* force out partial last line */ if (fbufp > fbuf) { /* OK */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000020100000000000007764 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_three_chars_heavy_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000254213571573400027251 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2, c3; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { if (isascii(c1) && isspace(c1)) continue; do { c2 = nondet_int (); } while (isascii(c2) && isspace(c2)); if (c2 == EOF) break; do { c3 = nondet_int (); } while (isascii(c3) && isspace(c3)); if (c3 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* BAD */ *fbufp = c1; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; *fbufp = EOS; fbufp = fbuf; } /* BAD */ *fbufp = c2; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } if (c3 == '=') continue; /* BAD */ *fbufp = c3; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* BAD */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000020000000000000007763 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_three_chars_heavy_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000265213571573400027253 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2, c3; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { if (isascii(c1) && isspace(c1)) continue; do { c2 = nondet_int (); } while (isascii(c2) && isspace(c2)); if (c2 == EOF) break; do { c3 = nondet_int (); } while (isascii(c3) && isspace(c3)); if (c3 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* OK */ *fbufp = c1; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; *fbufp = EOS; fbufp = fbuf; } /* OK */ *fbufp = c2; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } if (c3 == '=') continue; /* OK */ *fbufp = c3; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* OK */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017700000000000010000 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_three_chars_med_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000231313571573400027245 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2, c3; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; c3 = nondet_int (); if (c3 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* BAD */ *fbufp = c1; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } /* BAD */ *fbufp = c2; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } if (c3 == '=') continue; /* BAD */ *fbufp = c3; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* BAD */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_three_chars_med_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000242213571573400027246 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2, c3; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; c3 = nondet_int (); if (c3 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* OK */ *fbufp = c1; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } /* OK */ *fbufp = c2; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } if (c3 == '=') continue; /* OK */ *fbufp = c3; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* OK */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_three_chars_no_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000106713571573400027252 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2, c3; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; c3 = nondet_int (); if (c3 == EOF) break; /* BAD */ *fbufp++ = c1; /* BAD */ *fbufp++ = c2; /* BAD */ *fbufp++ = c3; } /* force out partial last line */ if (fbufp > fbuf) { /* BAD */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017500000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_three_chars_no_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000132213571573400027244 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2, c3; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; c3 = nondet_int (); if (c3 == EOF) break; /* OK */ *fbufp++ = c1; if (fbufp >= &fbuf[MAXLINE]) fbufp = fbuf; /* OK */ *fbufp++ = c2; if (fbufp >= &fbuf[MAXLINE]) fbufp = fbuf; /* OK */ *fbufp++ = c3; if (fbufp >= &fbuf[MAXLINE]) fbufp = fbuf; } /* force out partial last line */ if (fbufp > fbuf) { /* OK */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017700000000000010000 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_two_chars_heavy_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000174713571573400027257 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { if (isascii(c1) && isspace(c1)) continue; do { c2 = nondet_int (); } while (isascii(c2) && isspace(c2)); if (c2 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* BAD */ *fbufp = c1; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; *fbufp = EOS; fbufp = fbuf; } /* BAD */ *fbufp = c2; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* BAD */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017600000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_two_chars_heavy_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000202713571573400027247 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { if (isascii(c1) && isspace(c1)) continue; do { c2 = nondet_int (); } while (isascii(c2) && isspace(c2)); if (c2 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* OK */ *fbufp = c1; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; *fbufp = EOS; fbufp = fbuf; } /* OK */ *fbufp = c2; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* OK */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017500000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_two_chars_med_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000161113571573400027245 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* BAD */ *fbufp = c1; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } /* BAD */ *fbufp = c2; /* BAD */ if (*fbufp++ == '\n') { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* BAD */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* BAD */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017400000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_two_chars_med_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000167013571573400027252 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; if (c1 == '=' || c2 == '=') continue; /* OK */ *fbufp = c1; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } /* OK */ *fbufp = c2; /* OK */ if (*fbufp++ == '\n' || fbufp >= &fbuf[MAXLINE]) { if (fbufp <= fbuf) fbufp = fbuf; else if (*--fbufp != '\r') fbufp++; /* OK */ *fbufp = EOS; fbufp = fbuf; } } /* force out partial last line */ if (fbufp > fbuf) { /* OK */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017400000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_two_chars_no_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000073013571573400027246 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; /* BAD */ *fbufp++ = c1; /* BAD */ *fbufp++ = c2; } /* force out partial last line */ if (fbufp > fbuf) { /* BAD */ *fbufp = EOS; } return 0; } ././@LongLink0000644000000000000000000000017300000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_two_chars_no_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0047/mime7to8/mime7to8_ptr_0000666000000000000000000000107713571573400027253 0ustar #include "../../../../../lib/stubs.h" #include "../../../../../lib/base.h" #define MAXLINE BASE_SZ int main (void) { char fbuf[MAXLINE+1]; char *fbufp; int c1, c2; fbufp = fbuf; while ((c1 = nondet_int ()) != EOF) { c2 = nondet_int (); if (c2 == EOF) break; /* OK */ *fbufp++ = c1; if (fbufp >= &fbuf[MAXLINE]) fbufp = fbuf; /* OK */ *fbufp++ = c2; if (fbufp >= &fbuf[MAXLINE]) fbufp = fbuf; } /* force out partial last line */ if (fbufp > fbuf) { /* OK */ *fbufp = EOS; } return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/0000777000000000000000000000000013571573400023152 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/README0000666000000000000000000000210413571573400024027 0ustar -= CVE-1999-0206 =- Vulnerable version: Sendmail 8.8.0 to ? File: sendmail/mime.c Download from: source not available anymore Domain: Server _ Vulnerable Functions and Buffers _ Function mime7to8 (not shown in testcases) loops over fgets, passing each fgets'd string to function mime_fromqp which decodes input into a fixed sized buffer passed in from mime7to8. However, mime_fromqp's return value indicates to mime7to8 whether the current fgets string includes the continuation string "=\n", in which case the subsequent fgets'd string is also passed to mime_fromqp which continues writing into the buffer where it previously left off. Thus, a sufficiently long input where each substring between "=\n"s is not too long will yield an overflow. In the patched version, the pointer into the dest buffer is reset to the start of dest before mime_fromqp is called again. _ Decomposed Programs _ mime_fromqp/ mime_fromqp_{arr,ptr}_{bad,ok}.c Variant arr replaces pointer operations with array operations. _ Notes _ This is Zitser's sendmail/s3, simplified. BASE_SZ was originally 50. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/mime_fromqp/0000777000000000000000000000000013571573400025465 5ustar ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/mime_fromqp/mime_fromqp_arr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/mime_fromqp/mime_fromq0000666000000000000000000000257113571573400027550 0ustar #include "../../../../../lib/stubs.h" int main (void) { // XXX infile originally at most MAXLINE long per call to mime_fromqp char outfile[BASE_SZ]; // originally MAXLINE // originally a function argument **ooutfile; this function modified // caller's pointer into outbut buffer int c1, c2; // number of chars copied from infile into outfile; reset when // continuation sequence "=\n" is read int nchar = 0; int out = 0; // index into outfile while ((c1 = nondet_char ()) != EOS) { if (c1 == '=') { // malformed: early EOS if ((c1 = nondet_char ()) == EOS) // in Zitser, these breaks actually return to the caller where the // pointer into outfile is reset before this is called again break; // =\n: continuation; signal to caller it's ok to pass in more infile // BAD: forgot to reset out if (c1 == '\n') { nchar = 0; continue; } else { // convert, e.g., "=5c" to int // malformed: early EOF if ((c2 = nondet_char ()) == EOS) break; nchar++; if (nchar > BASE_SZ) break; /* BAD */ outfile[out] = c1; out++; } } else { // regular character, copy verbatim nchar++; if (nchar > BASE_SZ) break; /* BAD */ outfile[out] = c1; out++; if (c1 == '\n') break; } } /* BAD */ outfile[out] = EOS; out++; return 0; } ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/mime_fromqp/mime_fromqp_arr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/mime_fromqp/mime_fromq0000666000000000000000000000261613571573400027550 0ustar #include "../../../../../lib/stubs.h" int main (void) { // XXX infile originally at most MAXLINE long per call to mime_fromqp char outfile[BASE_SZ]; // originally MAXLINE // originally a function argument **ooutfile; this function modified // caller's pointer into outbut buffer int c1, c2; // number of chars copied from infile into outfile; reset when // continuation sequence "=\n" is read int nchar = 0; int out = 0; // index into outfile while ((c1 = nondet_char ()) != EOS) { if (c1 == '=') { // malformed: early EOS if ((c1 = nondet_char ()) == EOS) // in Zitser, these breaks actually return to the caller where the // pointer into outfile is reset before this is called again break; // =\n: continuation; signal to caller it's ok to pass in more infile // OK: reset out before taking more input if (c1 == '\n') { out = 0; nchar = 0; continue; } else { // convert, e.g., "=5c" to int // malformed: early EOF if ((c2 = nondet_char ()) == EOS) break; nchar++; if (nchar > BASE_SZ) break; /* OK */ outfile[out] = c1; out++; } } else { // regular character, copy verbatim nchar++; if (nchar > BASE_SZ) break; /* OK */ outfile[out] = c1; out++; if (c1 == '\n') break; } } /* OK */ outfile[out] = EOS; out++; return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/mime_fromqp/mime_fromqp_ptr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/mime_fromqp/mime_fromq0000666000000000000000000000247713571573400027555 0ustar #include "../../../../../lib/stubs.h" int main (void) { // XXX infile originally at most MAXLINE long per call to mime_fromqp char outfile[BASE_SZ]; // originally MAXLINE // originally a function argument **ooutfile; this function modified // caller's pointer into outbut buffer char *outp = outfile; int c1, c2; // number of chars copied from infile into outfile; reset when // continuation sequence "=\n" is read int nchar = 0; while ((c1 = nondet_char ()) != EOS) { if (c1 == '=') { // malformed: early EOS if ((c1 = nondet_char ()) == EOS) // in Zitser, these breaks actually return to the caller where the // pointer into outfile is reset before this is called again break; // =\n: continuation; signal to caller it's ok to pass in more infile // BAD: forgot to reset outp if (c1 == '\n') { nchar = 0; continue; } else { // convert, e.g., "=5c" to int // malformed: early EOF if ((c2 = nondet_char ()) == EOS) break; nchar++; if (nchar > BASE_SZ) break; /* BAD */ *outp++ = c1; } } else { // regular character, copy verbatim nchar++; if (nchar > BASE_SZ) break; /* BAD */ *outp++ = c1; if (c1 == '\n') break; } } /* BAD */ *outp++ = EOS; return 0; } ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/mime_fromqp/mime_fromqp_ptr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-1999-0206/mime_fromqp/mime_fromq0000666000000000000000000000253213571573400027545 0ustar #include "../../../../../lib/stubs.h" int main (void) { // XXX infile originally at most MAXLINE long per call to mime_fromqp char outfile[BASE_SZ]; // originally MAXLINE // originally a function argument **ooutfile; this function modified // caller's pointer into outbut buffer char *outp = outfile; int c1, c2; // number of chars copied from infile into outfile; reset when // continuation sequence "=\n" is read int nchar = 0; while ((c1 = nondet_char ()) != EOS) { if (c1 == '=') { // malformed: early EOS if ((c1 = nondet_char ()) == EOS) // in Zitser, these breaks actually return to the caller where the // pointer into outfile is reset before this is called again break; // =\n: continuation; signal to caller it's ok to pass in more infile // OK: reset out before taking more input if (c1 == '\n') { outp = outfile; nchar = 0; continue; } else { // convert, e.g., "=5c" to int // malformed: early EOF if ((c2 = nondet_char ()) == EOS) break; nchar++; if (nchar > BASE_SZ) break; /* OK */ *outp++ = c1; } } else { // regular character, copy verbatim nchar++; if (nchar > BASE_SZ) break; /* OK */ *outp++ = c1; if (c1 == '\n') break; } } /* OK */ *outp++ = EOS; return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/0000777000000000000000000000000013571573400023127 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/README0000666000000000000000000000211013571573400024001 0ustar -= CVE-2001-0653 =- Vulnerable version: Sendmail up to 8.12.9 File: sendmail/parseaddr.c Download from: ftp://ftp.sendmail.org/pub/sendmail/past-releases/ Domain: Server _ Vulnerable Functions and Buffers _ Function tTflag parses a string of digits into two signed integers, first and last. If first <= last, first is used afterwards to index into an array. Since a signed integer is used to store the temporary values of the number being accumulated from the input, it is possible for arithmetic overflow to occur and a negative value is assigned to first. If this happens, first passes the comparison to last and is subsequently used to access negative indices of a local buffer. The patched version declares first and last as unsigned integers, thereby inhibiting the arithmetic overflow. _ Decomposed Programs _ tTflag/ tTflag_arr_one_loop_{bad,ok}.c tTflag_arr_two_loops_{bad,ok}.c Variant one_loop computes (lexes) a single int from the char input. Variant two_loops computs two ints from the input. _ Notes _ This is Zitser's sendmail/s6, simplified. BASE_SZ originally 100. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/complete/0000777000000000000000000000000013571573400024737 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/complete/my-main.c0000666000000000000000000000474313571573400026462 0ustar /* MIT Copyright Notice Copyright 2003 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. $Author: tleek $ $Date: 2004/01/05 17:27:45 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s6/my-main.c,v 1.1.1.1 2004/01/05 17:27:45 tleek Exp $ */ /* Sendmail Copyright Notice Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. All rights reserved. Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. By using this file, you agree to the terms and conditions set forth in the LICENSE file which can be found at the top level of the sendmail distribution. $Author: tleek $ $Date: 2004/01/05 17:27:45 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s6/my-main.c,v 1.1.1.1 2004/01/05 17:27:45 tleek Exp $ */ /* */ #include #include #include #include #include #include #include #define OPTIONS "B:b:C:cd:e:F:f:Gh:IiL:M:mN:nO:o:p:q:R:r:sTtUV:vX:" #define LEN 100 unsigned char tTdvect[LEN]; int main(argc, argv, envp) int argc; char **argv; char **envp; { int j; tTsetup(tTdvect, LEN, "0-99.1"); while ((j = getopt(argc, argv, OPTIONS)) != -1) { switch (j) { case 'd': /* hack attack -- see if should use ANSI mode */ if (strcmp(optarg, "ANSI") == 0) { break; } tTflag(optarg); setbuf(stdout, (char *) NULL); break; case 'G': /* relay (gateway) submission */ break; case 'L': break; case 'U': /* initial (user) submission */ break; } } return 0; } /* */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/complete/sendmail.h0000666000000000000000000000345013571573400026706 0ustar /* MIT Copyright Notice Copyright 2003 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. $Author: tleek $ $Date: 2004/01/05 17:27:46 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s6/sendmail.h,v 1.1.1.1 2004/01/05 17:27:46 tleek Exp $ */ /* Sendmail Copyright Notice Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. All rights reserved. Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. By using this file, you agree to the terms and conditions set forth in the LICENSE file which can be found at the top level of the sendmail distribution. $Author: tleek $ $Date: 2004/01/05 17:27:46 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s6/sendmail.h,v 1.1.1.1 2004/01/05 17:27:46 tleek Exp $ */ /* */ extern u_char tTdvect[]; /* trace vector */ extern void tTflag __P((char *)); extern void tTsetup __P((u_char *, int, char *)); /* */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/complete/tTflag-bad.c0000666000000000000000000000770113571573400027055 0ustar /* MIT Copyright Notice Copyright 2003 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. $Author: tleek $ $Date: 2004/01/05 17:27:46 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s6/tTflag-bad.c,v 1.1.1.1 2004/01/05 17:27:46 tleek Exp $ */ /* Sendmail Copyright Notice Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. All rights reserved. Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. By using this file, you agree to the terms and conditions set forth in the LICENSE file which can be found at the top level of the sendmail distribution. $Author: tleek $ $Date: 2004/01/05 17:27:46 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s6/tTflag-bad.c,v 1.1.1.1 2004/01/05 17:27:46 tleek Exp $ */ /* */ /** ** TtSETUP -- set up for trace package. ** ** Parameters: ** vect -- pointer to trace vector. ** size -- number of flags in trace vector. ** defflags -- flags to set if no value given. ** ** Returns: ** none ** ** Side Effects: ** environment is set up. */ #include #include #include #include #include #include #include static u_char *tTvect; static int tTsize; static char *DefFlags; #define OPTIONS "B:b:C:cd:e:F:f:Gh:IiL:M:mN:nO:o:p:q:R:r:sTtUV:vX:" void tTsetup(vect, size, defflags) u_char *vect; int size; char *defflags; { tTvect = vect; /* vect is an alias for tTdvect, tTvect is an alias for vect */ tTsize = size; DefFlags = defflags; } /* ** TtFLAG -- process an external trace flag description. ** ** Parameters: ** s -- the trace flag. ** ** Returns: ** none. ** ** Side Effects: ** sets/clears trace flags. */ void tTflag(s) register char *s; { int first, last; register unsigned int i; printf ("s: %s", s); if (*s == '\0') s = DefFlags; for (;;) { /* find first flag to set */ i = 0; while (isascii(*s) && isdigit(*s)) i = i * 10 + (*s++ - '0'); /* assigning unsigned int to signed int */ /* if i is a large positive number, first will become a negative number */ first = i; /* find last flag to set */ if (*s == '-') { i = 0; while (isascii(*++s) && isdigit(*s)) i = i * 10 + (*s - '0'); } last = i; /* find the level to set it to */ i = 1; if (*s == '.') { i = 0; while (isascii(*++s) && isdigit(*s)) i = i * 10 + (*s - '0'); } /* clean up args */ if (first >= tTsize) /* check will fail if first is negative! */ first = tTsize - 1; if (last >= tTsize) last = tTsize - 1; /* set the flags */ while (first <= last){ /* this check will hold true for a while if */ { /* first is negative and last is positive */ printf("index = %d\n", first); /*BAD*/ tTvect[first++] = i; /* UNDERFLOW CAN OCCUR HERE. */ /* tTvect can only hold tTsize elements */ } /* This is a potential BSS underflow of tTdvect defined inside sendmail.h */ } /* more arguments? */ if (*s++ == '\0') return; } } /* */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/complete/tTflag-ok.c0000666000000000000000000000716713571573400026746 0ustar /* MIT Copyright Notice Copyright 2003 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. $Author: tleek $ $Date: 2004/01/05 17:27:46 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s6/tTflag-ok.c,v 1.1.1.1 2004/01/05 17:27:46 tleek Exp $ */ /* Sendmail Copyright Notice Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. All rights reserved. Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. By using this file, you agree to the terms and conditions set forth in the LICENSE file which can be found at the top level of the sendmail distribution. $Author: tleek $ $Date: 2004/01/05 17:27:46 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s6/tTflag-ok.c,v 1.1.1.1 2004/01/05 17:27:46 tleek Exp $ */ /* */ /** ** TtSETUP -- set up for trace package. ** ** Parameters: ** vect -- pointer to trace vector. ** size -- number of flags in trace vector. ** defflags -- flags to set if no value given. ** ** Returns: ** none ** ** Side Effects: ** environment is set up. */ #include #include #include #include #include #include #include static u_char *tTvect; static int tTsize; static char *DefFlags; #define OPTIONS "B:b:C:cd:e:F:f:Gh:IiL:M:mN:nO:o:p:q:R:r:sTtUV:vX:" void tTsetup(vect, size, defflags) u_char *vect; int size; char *defflags; { tTvect = vect; /* vect is an alias for tTdvect, tTvect is an alias for vect */ tTsize = size; DefFlags = defflags; } /* ** TtFLAG -- process an external trace flag description. ** ** Parameters: ** s -- the trace flag. ** ** Returns: ** none. ** ** Side Effects: ** sets/clears trace flags. */ void tTflag(s) register char *s; { unsigned int first, last; /* here we make sure that first and last are unsigned */ register unsigned int i; if (*s == '\0') s = DefFlags; for (;;) { /* find first flag to set */ i = 0; while (isascii(*s) && isdigit(*s)) i = i * 10 + (*s++ - '0'); first = i; /* find last flag to set */ if (*s == '-') { i = 0; while (isascii(*++s) && isdigit(*s)) i = i * 10 + (*s - '0'); } last = i; /* find the level to set it to */ i = 1; if (*s == '.') { i = 0; while (isascii(*++s) && isdigit(*s)) i = i * 10 + (*s - '0'); } /* clean up args */ if (first >= tTsize) /* check will fail if first is negative! */ first = tTsize - 1; if (last >= tTsize) last = tTsize - 1; /* set the flags */ while (first <= last){ { printf("index = %u\n", first); /*OK*/ tTvect[first++] = i; } } /* more arguments? */ if (*s++ == '\0') return; } } /* */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/tTflag/0000777000000000000000000000000013571573400024350 5ustar ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/tTflag/tTflag_arr_one_loop_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/tTflag/tTflag_arr_one_0000666000000000000000000000051413571573400027360 0ustar int main (void) { char in[11]; // = "3277192070"; char *s; unsigned char c; int i, j; int idx_in; in[10] = 0; idx_in = 0; s = in; i = 0; c = in[idx_in]; while (('0' <= c) && (c <= '9')) { j = c - '0'; i = i * 10 + j; idx_in++; c = in[idx_in]; } /* BAD */ assert (i >= 0); return 0; } ././@LongLink0000644000000000000000000000015600000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/tTflag/tTflag_arr_one_loop_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/tTflag/tTflag_arr_one_0000666000000000000000000000052413571573400027361 0ustar int main (void) { char in[11]; // = "3277192070"; char *s; unsigned char c; unsigned int i, j; int idx_in; in[10] = 0; idx_in = 0; s = in; i = 0; c = in[idx_in]; while (('0' <= c) && (c <= '9')) { j = c - '0'; i = i * 10 + j; idx_in++; c = in[idx_in]; } /* OK */ assert (i >= 0); return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/tTflag/tTflag_arr_two_loops_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/tTflag/tTflag_arr_two_0000666000000000000000000000216513571573400027414 0ustar #include "../../../../../lib/stubs.h" #define INSIZE 14 int main (void) { unsigned char in[INSIZE+1]; // = "3277192070-100"; unsigned char buf[BASE_SZ]; unsigned char *s; unsigned char c; int first, last; int i, j; int idx_in; idx_in = 0; s = in; i = 0; /* accumulate first (int) from in (char[]) */ c = in[idx_in]; while (('0' <= c) && (c <= '9')) { j = c - '0'; i = i * 10 + j; idx_in++; c = in[idx_in]; } first = i; /* accumulate last (int) from in (char[]) */ c = in[idx_in]; if (c == '-') { i = 0; idx_in++; c = in[idx_in]; while (('0' <= c) && (c <= '9')) { j = c - '0'; i = i * 10 + j; idx_in++; c = in[idx_in]; } } last = i; // printf ("first: %d, last: %d\n", first, last); /* clean up args */ if (first >= BASE_SZ) /* check will fail if first is negative! */ first = BASE_SZ - 1; if (last >= BASE_SZ) last = BASE_SZ - 1; while (first <= last) { /* BAD */ buf[first] = 'a'; /* possibly first < 0, cast to uint is huuuuge */ first++; /* signed int arithmetic */ } return 0; } ././@LongLink0000644000000000000000000000015700000000000007776 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/tTflag/tTflag_arr_two_loops_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2001-0653/tTflag/tTflag_arr_two_0000666000000000000000000000217513571573400027415 0ustar #include "../../../../../lib/stubs.h" #define INSIZE 14 int main (void) { unsigned char in[INSIZE+1]; // = "3277192070-100"; unsigned char buf[BASE_SZ]; unsigned char *s; unsigned char c; unsigned int first, last; int i, j; int idx_in; idx_in = 0; s = in; i = 0; /* accumulate first (int) from in (char[]) */ c = in[idx_in]; while (('0' <= c) && (c <= '9')) { j = c - '0'; i = i * 10 + j; idx_in++; c = in[idx_in]; } first = i; /* accumulate last (int) from in (char[]) */ c = in[idx_in]; if (c == '-') { i = 0; idx_in++; c = in[idx_in]; while (('0' <= c) && (c <= '9')) { j = c - '0'; i = i * 10 + j; idx_in++; c = in[idx_in]; } } last = i; // printf ("first: %d, last: %d\n", first, last); /* clean up args */ if (first >= BASE_SZ) /* check will fail if first is negative! */ first = BASE_SZ - 1; if (last >= BASE_SZ) last = BASE_SZ - 1; while (first <= last) { /* OK */ buf[first] = 'a'; /* possibly first < 0, cast to uint is huuuuge */ first++; /* signed int arithmetic */ } return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/0000777000000000000000000000000013571573400023131 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/README0000666000000000000000000000171413571573400024014 0ustar -= CVE-2002-0906 =- Vulnerable version: Sendmail up to 8.12.5 File: sendmail/sm_resolve.c Download from: ftp://ftp.sendmail.org/pub/sendmail/past-releases/ Domain: Server _ Vulnerable Functions and Buffers _ Function parse_dns_reply allocates a buffer of a user-specified size, then copies a separately user-specified amount of user-data into that buffer. All data is passed into the function as an unsigned char array over which a sequence of different types of records is overlaid. The overflow only occurs if a record contains a specific "type" field value. The patched version only copies as much data as the buffer can hold. _ Decomposed Programs _ parse_dns_reply/ parse_dns_reply_no_cast_{bad,ok}.c parse_dns_reply_cast_{bad,ok}.c Variant cast casts an array of uchars to an int (size) using bitops. Variant no_cast assigns size non-deterministically. _ Notes _ This is Zitser's sendmail/s7, simplified. This vulnerability does not depend on BASE_SZ. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/0000777000000000000000000000000013571573400026322 5ustar ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_dns_reply.hframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_0000666000000000000000000000077013571573400027522 0ustar typedef unsigned short u_int16_t; typedef unsigned char u_char; void *malloc(unsigned int size); #define NS_GET32(l, cp) do { \ u_char *t_cp = (u_char *)(cp); \ (l) = ((u_int32_t)t_cp[0] << 24) \ | ((u_int32_t)t_cp[1] << 16) \ | ((u_int32_t)t_cp[2] << 8) \ | ((u_int32_t)t_cp[3]) \ ; \ (cp) += 4; \ } while (0) #define NS_GET16(s, cp) do { \ u_char *t_cp = (u_char *)(cp); \ (s) = ((u_int16_t)t_cp[0] << 8) \ | ((u_int16_t)t_cp[1]) \ ; \ (cp) += 2; \ } while (0) ././@LongLink0000644000000000000000000000017100000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_dns_reply_cast_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_0000666000000000000000000000063313571573400027520 0ustar #include "parse_dns_reply.h" #include "../../../../../lib/stubs.h" #define DATA 100 int main (void) { unsigned char data[sizeof (u_int16_t) + sizeof (u_char) + DATA]; unsigned char *p; int size; char *rr_txt; p = data; NS_GET16(size, p); rr_txt = (char *) malloc (size + 1); if (rr_txt == 0) return 0; /* BAD */ strncpy (rr_txt, (char *) p + 1, *p); /* BAD */ rr_txt[*p] = 0; } ././@LongLink0000644000000000000000000000017000000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_dns_reply_cast_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_0000666000000000000000000000067613571573400027527 0ustar #include "parse_dns_reply.h" #include "../../../../../lib/stubs.h" int main (void) { unsigned char data[sizeof (u_int16_t) + sizeof (u_char) + BASE_SZ]; unsigned char *p; int size, txtlen; char *rr_txt; p = data; NS_GET16(size, p); // size is no longer used txtlen = *p; rr_txt = (char *) malloc (txtlen + 1); if (rr_txt == 0) return 0; /* OK */ strncpy (rr_txt, (char *) p + 1, *p); /* OK */ rr_txt[*p] = 0; } ././@LongLink0000644000000000000000000000017400000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_dns_reply_no_cast_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_0000666000000000000000000000055713571573400027525 0ustar #include "parse_dns_reply.h" #include "../../../../../lib/stubs.h" #define DATA 100 int main (void) { unsigned char *p; int size; char *rr_txt; *p = nondet_unsigned_char (); size = nondet_int (); rr_txt = (char *) malloc (size + 1); if (rr_txt == 0) return 0; /* BAD */ strncpy (rr_txt, (char *) p + 1, *p); /* BAD */ rr_txt[*p] = 0; } ././@LongLink0000644000000000000000000000017300000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_dns_reply_no_cast_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/parse_0000666000000000000000000000054213571573400027517 0ustar #include "parse_dns_reply.h" #include "../../../../../lib/stubs.h" #define DATA 100 int main (void) { unsigned char *p; int size; char *rr_txt; *p = nondet_unsigned_char (); size = *p; rr_txt = (char *) malloc (size + 1); if (rr_txt == 0) return 0; /* OK */ strncpy (rr_txt, (char *) p + 1, *p); /* OK */ rr_txt[*p] = 0; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/txt-dns.hframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-0906/parse_dns_reply/txt-dn0000666000000000000000000000526413571573400027472 0ustar /* MIT Copyright Notice Copyright 2003 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. $Author: tleek $ $Date: 2004/01/05 17:27:47 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s7/txt-dns.h,v 1.1.1.1 2004/01/05 17:27:47 tleek Exp $ */ /* Sendmail Copyright Notice Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. All rights reserved. Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. By using this file, you agree to the terms and conditions set forth in the LICENSE file which can be found at the top level of the sendmail distribution. $Author: tleek $ $Date: 2004/01/05 17:27:47 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s7/txt-dns.h,v 1.1.1.1 2004/01/05 17:27:47 tleek Exp $ */ /* */ #include #define DNSMAP 1 typedef struct { char *dns_q_domain; unsigned int dns_q_type; unsigned int dns_q_class; } DNS_QUERY_T; typedef struct { unsigned int mx_r_preference; char mx_r_domain[1]; } MX_RECORD_T; typedef struct { unsigned int srv_r_priority; unsigned int srv_r_weight; unsigned int srv_r_port; char srv_r_target[1]; } SRV_RECORDT_T; typedef struct resource_record RESOURCE_RECORD_T; /* from sm_resolve.h */ struct resource_record { char *rr_domain; unsigned int rr_type; unsigned int rr_class; unsigned int rr_ttl; unsigned int rr_size; union { void *rr_data; MX_RECORD_T *rr_mx; MX_RECORD_T *rr_afsdb; /* mx and afsdb are identical */ SRV_RECORDT_T *rr_srv; # if NETINET struct in_addr *rr_a; # endif /* NETINET */ # if NETINET6 struct in6_addr *rr_aaaa; # endif /* NETINET6 */ char *rr_txt; } rr_u; RESOURCE_RECORD_T *rr_next; }; typedef struct { HEADER dns_r_h; DNS_QUERY_T dns_r_q; RESOURCE_RECORD_T *dns_r_head; } DNS_REPLY_T; /* */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/0000777000000000000000000000000013571573400023130 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/README0000666000000000000000000000177513571573400024022 0ustar -= CVE-2002-1337 =- Vulnerable versions: Sendmail 5.79 to 8.12.7 File: sendmail/headers.c Download from: ftp://ftp.sendmail.org/pub/sendmail/past-releases/sendmail.8.12.7.tar.gz Domain: Server _ Vulnerable Functions and Buffers _ Function crackaddr copies the source string, addr, into the dest buffer, buf, but incorrectly computes the amount of space to reserve at the end of buf to insert angle brackets ('>') which are missing in the input. Specific inputs can lead to an overflow of buf. The patched version reserves more space at the end of buf. _ Decomposed Programs _ close_angle/ close-angle_ptr_{no,one,two}_test*_{bad,ok}.c Variant no_test simply copies the input into the dest buffer and writes ">\0" at the end. Variant one_test additionally checks for '<' in the input and only writes '>' at the end if '<' was seen. Variant two_tests also keeps track of "skipping" mode, in which input is not copied into the dest buffer. _ Notes _ This is from Zitser's sendmail/s1. BASE_SZ was originally 30. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/0000777000000000000000000000000013571573400025403 5ustar ././@LongLink0000644000000000000000000000017000000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angle_ptr_no_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angl0000666000000000000000000000126213571573400027353 0ustar /* * This one just blindly copies the input into buffer and writes '>''\0' at the * end. */ #include "../../../../../lib/stubs.h" int main (void) { char buffer[BASE_SZ+1]; char input[BASE_SZ+70]; char *buf; char *buflim; char *in; char cur; // shouldn't be necessary unless checking for safety of *in // input[BASE_SZ+70-1] = EOS; in = input; buf = buffer; buflim = &buffer[sizeof buffer - 1]; // didn't reserve enough space for both '>' and '\0'! cur = *in; while (cur != EOS) { if (buf == buflim) break; *buf = cur; buf++; out: in++; cur = *in; } *buf = '>'; buf++; /* BAD */ *buf = EOS; buf++; return 0; } ././@LongLink0000644000000000000000000000016700000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angle_ptr_no_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angl0000666000000000000000000000126113571573400027352 0ustar /* * Variant: This one just blindly copies the input into buffer and writes '>''\0' at the end. */ #include "../../../../../lib/stubs.h" int main (void) { char buffer[BASE_SZ+1]; char input[BASE_SZ+70]; char *buf; char *buflim; char *in; char cur; // shouldn't be necessary unless checking for safety of *in // input[BASE_SZ+70-1] = EOS; in = input; buf = buffer; buflim = &buffer[sizeof buffer - 2]; // reserved enough space for both '>' and '\0'! cur = *in; while (cur != EOS) { if (buf == buflim) break; *buf = cur; buf++; out: in++; cur = *in; } *buf = '>'; buf++; /* OK */ *buf = EOS; buf++; return 0; } ././@LongLink0000644000000000000000000000017100000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angle_ptr_one_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angl0000666000000000000000000000147113571573400027355 0ustar /* * This one bails out of the copy loop as soon as the end of buffer is * reached, keeping only one extra spot at the end for either a '\0' or a * '<', but not both. */ #include "../../../../../lib/stubs.h" int main (void) { char buffer[BASE_SZ+1]; char input[BASE_SZ+70]; char *buf; char *buflim; char *in; char cur; int anglelev; int skipping; in = input; buf = buffer; buflim = &buffer[sizeof buffer - 1]; // didn't reserve enough space for both '>' and '\0'! skipping = 0; cur = *in; while (cur != EOS) { if (buf == buflim) break; if (cur == '<') anglelev = 1; else goto out; *buf = cur; buf++; out: in++; cur = *in; } if (anglelev > 0) { *buf = '>'; buf++; } /* BAD */ *buf = EOS; buf++; return 0; } ././@LongLink0000644000000000000000000000017000000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angle_ptr_one_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angl0000666000000000000000000000146013571573400027353 0ustar /* * This one bails out of the copy loop as soon as the end of buffer is * reached, keeping only one extra spot at the end for either a '\0' or a * '<', but not both. */ #include "../../../../../lib/stubs.h" int main (void) { char buffer[BASE_SZ+1]; char input[BASE_SZ+70]; char *buf; char *buflim; char *in; char cur; int anglelev; int skipping; in = input; buf = buffer; buflim = &buffer[sizeof buffer - 2]; // reserved enough space for both '>' and '\0'! skipping = 0; cur = *in; while (cur != EOS) { if (buf == buflim) break; if (cur == '<') anglelev = 1; else goto out; *buf = cur; buf++; out: in++; cur = *in; } if (anglelev > 0) { *buf = '>'; buf++; } /* OK */ *buf = 0; buf++; return 0; } ././@LongLink0000644000000000000000000000017200000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angle_ptr_two_tests_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angl0000666000000000000000000000157413571573400027361 0ustar /* * This one copies '<' as long as there's safe space, then writes * '>''\0' at the end if at least one '<' was read. */ #include "../../../../../lib/stubs.h" int main (void) { char buffer[BASE_SZ+1]; char input[BASE_SZ+70]; // = "<"; char *buf; char *buflim; char *in; char cur; int anglelev; int skipping; in = input; buf = buffer; buflim = &buffer[sizeof buffer - 1]; // didn't reserve enough space for both '>' and '\0'! skipping = 0; cur = *in; while (cur != EOS) { if (buf >= buflim) skipping = 1; else skipping = 0; if (cur == '<') { if (!skipping) anglelev = 1; } else goto out; if (!skipping) { *buf = cur; buf++; } out: in++; cur = *in; } if (anglelev > 0) { *buf = '>'; buf++; } /* BAD */ *buf = EOS; buf++; return 0; } ././@LongLink0000644000000000000000000000017100000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angle_ptr_two_tests_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/close_angle/close-angl0000666000000000000000000000156513571573400027361 0ustar /* * This one copies '<' as long as there's safe space, then writes * '>''\0' at the end if at least one '<' was read. */ #include "../../../../../lib/stubs.h" int main (void) { char buffer[BASE_SZ+1]; char input[BASE_SZ+70]; // = "<"; char *buf; char *buflim; char *in; char cur; int anglelev; int skipping; in = input; buf = buffer; buflim = &buffer[sizeof buffer - 2]; // reserved enough space for both '>' and '\0'! skipping = 0; cur = *in; while (cur != EOS) { if (buf >= buflim) skipping = 1; else skipping = 0; if (cur == '<') { if (!skipping) anglelev = 1; } else goto out; if (!skipping) { *buf = cur; buf++; } out: in++; cur = *in; } if (anglelev > 0) { *buf = '>'; buf++; } /* OK */ *buf = EOS; buf++; return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/complete/0000777000000000000000000000000013571573400024740 5ustar ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/complete/crackaddr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2002-1337/complete/crackaddr_bad0000666000000000000000000002445113571573400027415 0ustar /* MIT Copyright Notice Copyright 2003 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. $Author: tleek $ $Date: 2004/01/05 17:27:48 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s1/crackaddr-bad.c,v 1.1.1.1 2004/01/05 17:27:48 tleek Exp $ */ /* Sendmail Copyright Notice Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. All rights reserved. Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. By using this file, you agree to the terms and conditions set forth in the LICENSE file which can be found at the top level of the sendmail distribution. $Author: tleek $ $Date: 2004/01/05 17:27:48 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s1/crackaddr-bad.c,v 1.1.1.1 2004/01/05 17:27:48 tleek Exp $ */ /* */ // NB: Derived from sendmail/headers.c /* * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * */ #include #include #include #include /* ccured needs this */ #pragma ccuredvararg("scanf", printf(1)) /* macro substitution character */ #define MACROEXPAND ((unsigned char)0201) /* macro expansion */ #define MAXNAME 30 /* max length of a name */ #define MAXCANARY 10 enum bool {false, true}; int ColonOkInAddr; /* single colon legal in address */ char *MustQuoteChars; /* quote these characters in phrases */ /* ** CRACKADDR -- parse an address and turn it into a macro ** ** This doesn't actually parse the address -- it just extracts ** it and replaces it with "$g". The parse is totally ad hoc ** and isn't even guaranteed to leave something syntactically ** identical to what it started with. However, it does leave ** something semantically identical. ** ** This algorithm has been cleaned up to handle a wider range ** of cases -- notably quoted and backslash escaped strings. ** This modification makes it substantially better at preserving ** the original syntax. ** ** Parameters: ** addr -- the address to be cracked. ** ** Returns: ** a pointer to the new version. ** ** Side Effects: ** none. ** ** Warning: ** The return value is saved in local storage and should ** be copied if it is to be reused. */ char * crackaddr(addr) register char *addr; { register char *p; register char c; int cmtlev; int realcmtlev; int anglelev, realanglelev; int copylev; int bracklev; enum bool qmode; enum bool realqmode; enum bool skipping; enum bool putgmac = false; enum bool quoteit = false; enum bool gotangle = false; enum bool gotcolon = false; register char *bp; char *obp; char *buflim; char *bufhead; char *addrhead; static char canary[MAXCANARY+1]; static char buf[MAXNAME + 1]; static char test_buf[10]; /* will use as a canary to detect overflow */ /* of buf[] */ memset (canary, 'A', MAXCANARY+1); strcpy(test_buf, "GOOD"); printf("Inside crackaddr!\n"); /* strip leading spaces */ while (*addr != '\0' && isascii((int)*addr) && isspace((int)*addr)) addr++; /* ** Start by assuming we have no angle brackets. This will be ** adjusted later if we find them. */ bp = bufhead = buf; obp = bp; buflim = &buf[sizeof buf - 7]; p = addrhead = addr; copylev = anglelev = realanglelev = cmtlev = realcmtlev = 0; bracklev = 0; qmode = realqmode = false; printf("qmode = %d\n", qmode); while ((c = *p++) != '\0') { /* ** If the buffer is overful, go into a special "skipping" ** mode that tries to keep legal syntax but doesn't actually ** output things. */ printf("c = %c\n", c); skipping = bp >= buflim; if (copylev > 0 && !skipping) { /*BAD*/ *bp++ = c; } /* check for backslash escapes */ if (c == '\\') { /* arrange to quote the address */ if (cmtlev <= 0 && !qmode) quoteit = true; if ((c = *p++) == '\0') { /* too far */ p--; goto putg; } if (copylev > 0 && !skipping) { /*BAD*/ *bp++ = c; } goto putg; } /* check for quoted strings */ if (c == '"' && cmtlev <= 0) { printf("quoted string...\n"); qmode = !qmode; if (copylev > 0 && !skipping) realqmode = !realqmode; continue; } if (qmode) goto putg; /* check for comments */ if (c == '(') { printf("left ( seen....\n"); cmtlev++; /* allow space for closing paren */ if (!skipping) { buflim--; realcmtlev++; if (copylev++ <= 0) { if (bp != bufhead) { /*BAD*/ *bp++ = ' '; } /*BAD*/ *bp++ = c; } } } if (cmtlev > 0) { if (c == ')') { cmtlev--; copylev--; if (!skipping) { realcmtlev--; buflim++; } } continue; } else if (c == ')') { /* syntax error: unmatched ) */ if (copylev > 0 && !skipping) bp--; } /* count nesting on [ ... ] (for IPv6 domain literals) */ if (c == '[') bracklev++; else if (c == ']') bracklev--; /* check for group: list; syntax */ if (c == ':' && anglelev <= 0 && bracklev <= 0 && !gotcolon && !ColonOkInAddr) { register char *q; /* ** Check for DECnet phase IV ``::'' (host::user) ** or ** DECnet phase V ``:.'' syntaxes. The latter ** covers ``user@DEC:.tay.myhost'' and ** ``DEC:.tay.myhost::user'' syntaxes (bletch). */ if (*p == ':' || *p == '.') { if (cmtlev <= 0 && !qmode) quoteit = true; if (copylev > 0 && !skipping) { /*BAD*/ *bp++ = c; /*BAD*/ *bp++ = *p; } p++; goto putg; } gotcolon = true; bp = bufhead; if (quoteit) { /*BAD*/ *bp++ = '"'; /* back up over the ':' and any spaces */ --p; while (isascii((int) *--p) && isspace((int) *p)) continue; p++; } for (q = addrhead; q < p; ) { c = *q++; if (bp < buflim) { if (quoteit && c == '"') /*BAD*/ *bp++ = '\\'; /*BAD*/ *bp++ = c; } } if (quoteit) { if (bp == &bufhead[1]) bp--; else{ /*BAD*/ *bp++ = '"'; } while ((c = *p++) != ':') { if (bp < buflim){ /*BAD*/ *bp++ = c; } } /*BAD*/ *bp++ = c; } /* any trailing white space is part of group: */ while (isascii((int) *p) && isspace((int)*p) && bp < buflim) { /*BAD*/ *bp++ = *p++; } copylev = 0; putgmac = quoteit = false; bufhead = bp; addrhead = p; continue; } if (c == ';' && copylev <= 0 && !ColonOkInAddr) { if (bp < buflim) /*BAD*/ *bp++ = c; } /* check for characters that may have to be quoted */ if (strchr(MustQuoteChars, c) != NULL) { /* ** If these occur as the phrase part of a <> ** construct, but are not inside of () or already ** quoted, they will have to be quoted. Note that ** now (but don't actually do the quoting). */ if (cmtlev <= 0 && !qmode) quoteit = true; } /* check for angle brackets */ if (c == '<') { register char *q; /* assume first of two angles is bogus */ if (gotangle) quoteit = true; gotangle = true; /* oops -- have to change our mind */ anglelev = 1; if (!skipping) realanglelev = 1; bp = bufhead; if (quoteit) { /*BAD*/ *bp++ = '"'; /* back up over the '<' and any spaces */ --p; while (isascii((int)*--p) && isspace((int)*p)) continue; p++; } for (q = addrhead; q < p; ) { c = *q++; if (bp < buflim) { if (quoteit && c == '"') /*BAD*/ *bp++ = '\\'; /*BAD*/ *bp++ = c; } } if (quoteit) { if (bp == &buf[1]) bp--; else /*BAD*/ *bp++ = '"'; while ((c = *p++) != '<') { if (bp < buflim) /*BAD*/ *bp++ = c; } /*BAD*/ *bp++ = c; } copylev = 0; putgmac = quoteit = false; continue; } if (c == '>') { if (anglelev > 0) { anglelev--; if (!skipping) { realanglelev--; buflim++; } } else if (!skipping) { /* syntax error: unmatched > */ if (copylev > 0) bp--; quoteit = true; continue; } if (copylev++ <= 0) /*BAD*/ *bp++ = c; continue; } /* must be a real address character */ putg: if (copylev <= 0 && !putgmac) { if (bp > bufhead && bp[-1] == ')') /*BAD*/ *bp++ = ' '; /*BAD*/ *bp++ = MACROEXPAND; /*BAD*/ *bp++ = 'g'; putgmac = true; } printf("Buf = %s\n", buf); } /* repair any syntactic damage */ if (realqmode) /*BAD*/ *bp++ = '"'; while (realcmtlev-- > 0) /*BAD*/ *bp++ = ')'; while (realanglelev-- > 0) /*BAD*/ *bp++ = '>'; /*BAD*/ *bp++ = '\0'; printf("canary:\n"); printbuf (canary, MAXCANARY+1); printf("buf:\n"); printbuf (buf, MAXNAME+1); return buf; } int main(){ char address[100]; char *res_addr; MustQuoteChars = "@,;:\\()[].'"; printf("Enter email address:\n"); scanf("%99s", address); res_addr = crackaddr(address); return 0; } /* */ frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/0000777000000000000000000000000013571573400023123 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/README0000666000000000000000000000257113571573400024010 0ustar -= CVE-2003-0161 =- Vulnerable versions: Sendmail to 8.12.9 File: sendmail/parseaddr Download from: ftp://ftp.sendmail.org/pub/sendmail/past-releases/ Domain: Server _ Vulnerable Functions and Buffers _ Function prescan writes to a fixed size buffer, pvpbuf, while scanning a user string, addr. In the original code, it sets a temporary variable, int c, to the current character (char) in addr, but can also set c to (int) -1 to indicate that the current char should not be copied to pvpbuf. This causes the loop which scans addr to skip a bounds check on pvpbuf in the next iteration. Subsequently, if '\\' is the next char in addr, it is written into pvpbuf without a bounds check. The special value -1 is not supposed to be in the character set of addr, but due to sign extension from int to char, the (char) value '\377' is interpreted as (int) -1. Thus, a sufficiently long input of the pattern ('\\''\377')+ overflows pvpbuf. The patched version masks out the high bits of each input char to prevent sign extension. _ Decomposed Programs _ prescan/ prescan_arr_{min,med}_test_{bad,ok}.c Variant min_test omits an input test which guards a dereference and increment of the dest pointer. _ Notes _ This is Zitser's sendmail/s5, simplified. BASE_SZ was originally 50. LOGIN is originally unbounded, but passwd (1) probably limits it to something small. GECOS is shorter than BASE_SZ. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/prescan/0000777000000000000000000000000013571573400024556 5ustar ././@LongLink0000644000000000000000000000016100000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/prescan/prescan_arr_med_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/prescan/prescan_arr_me0000666000000000000000000000264613571573400027471 0ustar #include "../../../../../lib/stubs.h" #define ADDRSIZE 500 // originally 500 #define PSBUFSIZE BASE_SZ #define MAXNAME (4 * BASE_SZ / 5) #define NOCHAR -1 #define TRUE 1 #define FALSE 0 int main (void) { // originally function arguments char addr[ADDRSIZE]; char pvpbuf[PSBUFSIZE]; int p, q, q_old; int c; int pvpbuf_end = sizeof (pvpbuf); int bslashmode; int i; p = 0; q = 0; bslashmode = FALSE; c = NOCHAR; q_old = q; do { // bounds check and write lookahead (c) to pvpbuf if (c != NOCHAR && !bslashmode) { if (q >= pvpbuf_end - 1) return 0; pvpbuf[q] = c; q++; } // read next input char c = addr[p]; p++; if (c == EOS) break; //assert (q < pvpbuf_end); /* BAD */ pvpbuf[q] = EOS; // precautiously write EOS to dest if (bslashmode) { bslashmode = FALSE; if (c != '!') { //assert (q < pvpbuf_end); /* BAD */ pvpbuf[q] = '\\'; // SatAbs 1.8 says this is safe q++; continue; } } if (c == '\\') bslashmode = TRUE; if (c == NOCHAR) // not supposed to be in the input alphabet continue; // skip bounds check on next for loop so another \ can be copied if (c == EOS) break; } while (1); if (q_old != q) { //assert (q < pvpbuf_end); /* BAD */ pvpbuf[q] = 0; q++; if (q - q_old > MAXNAME) return 0; } return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/prescan/prescan_arr_med_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/prescan/prescan_arr_me0000666000000000000000000000273213571573400027465 0ustar #include "../../../../../lib/stubs.h" #define ADDRSIZE 500 // originally 500 #define PSBUFSIZE BASE_SZ #define MAXNAME (4 * BASE_SZ / 5) #define NOCHAR -1 #define TRUE 1 #define FALSE 0 int main (void) { // originally function arguments char addr[ADDRSIZE]; char pvpbuf[PSBUFSIZE]; int p, q, q_old; int c; int pvpbuf_end = sizeof (pvpbuf); int bslashmode; int i; p = 0; q = 0; bslashmode = FALSE; c = NOCHAR; q_old = q; do { // bounds check and write lookahead (c) to pvpbuf if (c != NOCHAR && !bslashmode) { if (q >= pvpbuf_end - 1) return 0; pvpbuf[q] = c; q++; } // read next input char c = addr[p] & 0xff; // mask out high bits to prevent sign extension p++; if (c == EOS) break; //assert (q < pvpbuf_end); /* OK */ pvpbuf[q] = EOS; // precautiously write EOS to dest if (bslashmode) { bslashmode = FALSE; if (c != '!') { //assert (q < pvpbuf_end); /* OK */ pvpbuf[q] = '\\'; // SatAbs 1.8 says this is safe q++; continue; } } if (c == '\\') bslashmode = TRUE; if (c == NOCHAR) // not supposed to be in the input alphabet continue; // skip bounds check on next for loop so another \ can be copied if (c == EOS) break; } while (1); if (q_old != q) { //assert (q < pvpbuf_end); /* OK */ pvpbuf[q] = 0; q++; if (q - q_old > MAXNAME) return 0; } return 0; } ././@LongLink0000644000000000000000000000016100000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/prescan/prescan_arr_min_test_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/prescan/prescan_arr_mi0000666000000000000000000000256513571573400027475 0ustar #include "../../../../../lib/stubs.h" #define ADDRSIZE 500 // originally 500 #define PSBUFSIZE BASE_SZ #define MAXNAME (4 * BASE_SZ / 5) #define NOCHAR -1 #define TRUE 1 #define FALSE 0 int main (void) { // originally function arguments char addr[ADDRSIZE]; char pvpbuf[PSBUFSIZE]; int p, q, q_old; int c; int pvpbuf_end = sizeof (pvpbuf); int bslashmode; int i; p = 0; q = 0; bslashmode = FALSE; c = NOCHAR; q_old = q; do { // bounds check and write lookahead (c) to pvpbuf if (c != NOCHAR && !bslashmode) { if (q >= pvpbuf_end - 1) return 0; pvpbuf[q] = c; q++; } // read next input char c = addr[p]; p++; if (c == EOS) break; //assert (q < pvpbuf_end); /*BAD*/ pvpbuf[q] = EOS; // precautiously write EOS to dest if (bslashmode) { bslashmode = FALSE; //assert (q < pvpbuf_end); /*BAD*/ pvpbuf[q] = '\\'; q++; continue; } if (c == '\\') bslashmode = TRUE; if (c == NOCHAR) // not supposed to be in the input alphabet continue; // skip bounds check on next for loop so another \ can be copied if (c == EOS) break; } while (1); if (q_old != q) { //assert (q < pvpbuf_end); /*BAD*/ pvpbuf[q] = 0; q++; if (q - q_old > MAXNAME) return 0; } return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/prescan/prescan_arr_min_test_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0161/prescan/prescan_arr_mi0000666000000000000000000000317113571573400027467 0ustar #include "../../../../../lib/stubs.h" #define ADDRSIZE 500 // originally 500 #define PSBUFSIZE BASE_SZ #define MAXNAME (4 * BASE_SZ / 5) #define NOCHAR -1 #define TRUE 1 #define FALSE 0 int main (void) { // originally function arguments char addr[ADDRSIZE]; char pvpbuf[PSBUFSIZE]; int p, q, q_old; int c; int pvpbuf_end = sizeof (pvpbuf); int bslashmode; int i; // alternative method to initialize addr to attack string /* for(i=0; i<20; i=i+2) { addr[i] = '\\'; addr[i+1] = '\377'; // when cast to int, gets sign extended to -1 (NOCHAR) } */ p = 0; q = 0; bslashmode = FALSE; c = NOCHAR; q_old = q; do { // bounds check and write lookahead (c) to pvpbuf if (c != NOCHAR && !bslashmode) { if (q >= pvpbuf_end - 1) return 0; pvpbuf[q] = c; q++; } // read next input char c = addr[p] & 0xff; // mask out high bits to prevent sign extension p++; if (c == EOS) break; //assert (q < pvpbuf_end); /* OK */ pvpbuf[q] = EOS; // precautiously write EOS to dest if (bslashmode) { bslashmode = FALSE; //assert (q < pvpbuf_end); /* OK */ pvpbuf[q] = '\\'; q++; continue; } if (c == '\\') bslashmode = TRUE; if (c == NOCHAR) // not supposed to be in the input alphabet continue; // skip bounds check on next for loop so another \ can be copied if (c == EOS) break; } while (1); if (q_old != q) { //assert (q < pvpbuf_end); /* OK */ pvpbuf[q] = 0; q++; if (q - q_old > MAXNAME) return 0; } return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/0000777000000000000000000000000013571573400023132 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/README0000666000000000000000000000147213571573400024016 0ustar -= CVE-2003-0681 =- Vulnerable versions: Sendmail 8.6.12 to ? File: libsm/mbdb.c Download from: source not available anymore Domain: Server _ Vulnerable Functions and Buffers _ Function buildfname (originally sm_pwfullname) takes a gecos and a login string as arguments and, for each occurence of the '&' character in the gecos string, blindly appends (strcpy) the login string to a fixed size buffer. The patched version uses strncpy with a safe bound instead of strcpy. _ Decomposed Programs _ buildfname/ buildfname_arr_{one,two}_gecos_{bad,ok}.c Variant two_gecos allocates a gecos string of strlen two (so the login string can be copied into the dest buffer twice), whereas one_gecos only allocates a gecos string of strlen one. _ Notes _ This is Zitser's sendmail/s2, simplified. BASE_SZ was originally 256. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/buildfname/0000777000000000000000000000000013571573400025240 5ustar ././@LongLink0000644000000000000000000000017000000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/buildfname/buildfname_arr_one_gecos_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/buildfname/buildfname_0000666000000000000000000000132313571573400027427 0ustar #define BUF BASE_SZ #define GECOS 1 #define LOGIN (BASE_SZ + 1)/GECOS // unbounded? #include "../../../../../lib/stubs.h" int main (void) { // these were parameters char login[LOGIN + 1]; char gecos[GECOS + 1]; char buf[BUF + 1]; char c; int i, j; login[(int) (sizeof login - 1)] = EOS; gecos[(int) (sizeof gecos - 1)] = EOS; i = 0; if (gecos[i] == '*') i++; c = gecos[i]; j = 0; while (c != EOS && c != ',' && c != ';' && c != '%') { if (c == '&') { /* BAD */ (void) strcpy (buf + j, login); while (buf[j] != EOS) j++; } else { /* BAD */ buf[j] = c; j++; } i++; c = gecos[i]; } buf[j] = EOS; return 0; } ././@LongLink0000644000000000000000000000016700000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/buildfname/buildfname_arr_one_gecos_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/buildfname/buildfname_0000666000000000000000000000141713571573400027433 0ustar #define BUF BASE_SZ #define GECOS 1 #define LOGIN (BASE_SZ + 1)/GECOS // unbounded? //#include //#include #include "../../../../../lib/stubs.h" int main (void) { // these were parameters char login[LOGIN + 1]; char gecos[GECOS + 1]; char buf[BUF + 1]; char c; int i, j; login[(int) (sizeof login - 1)] = EOS; gecos[(int) (sizeof gecos - 1)] = EOS; i = 0; if (gecos[i] == '*') i++; c = gecos[i]; j = 0; while (c != EOS && c != ',' && c != ';' && c != '%') { if (c == '&') { /* OK */ (void) strncpy (buf + j, login, sizeof (buf) - j); while (buf[j] != EOS) j++; } else { /* OK */ buf[j] = c; j++; } i++; c = gecos[i]; } buf[j] = EOS; return 0; } ././@LongLink0000644000000000000000000000017000000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/buildfname/buildfname_arr_two_gecos_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/buildfname/buildfname_0000666000000000000000000000130513571573400027427 0ustar #define BUF BASE_SZ #define GECOS 2 #define LOGIN (BASE_SZ + 2)/GECOS #include "../../../../../lib/stubs.h" int main (void) { // these were parameters char login[LOGIN + 1]; char gecos[GECOS + 1]; char buf[BUF + 1]; char c; int i, j; login[(int) (sizeof login - 1)] = EOS; gecos[(int) (sizeof gecos - 1)] = EOS; i = 0; if (gecos[i] == '*') i++; c = gecos[i]; j = 0; while (c != EOS && c != ',' && c != ';' && c != '%') { if (c == '&') { /* BAD */ (void) strcpy (buf + j, login); while (buf[j] != EOS) j++; } else { /* BAD */ buf[j] = c; j++; } i++; c = gecos[i]; } buf[j] = EOS; return 0; } ././@LongLink0000644000000000000000000000016700000000000007777 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/buildfname/buildfname_arr_two_gecos_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/buildfname/buildfname_0000666000000000000000000000132613571573400027432 0ustar #define BUF BASE_SZ #define GECOS 2 #define LOGIN (BASE_SZ + 2)/GECOS #include "../../../../../lib/stubs.h" int main (void) { // these were parameters char login[LOGIN + 1]; char gecos[GECOS + 1]; char buf[BUF + 1]; char c; int i, j; login[(int) (sizeof login - 1)] = EOS; gecos[(int) (sizeof gecos - 1)] = EOS; i = 0; if (gecos[i] == '*') i++; c = gecos[i]; j = 0; while (c != EOS && c != ',' && c != ';' && c != '%') { if (c == '&') { /* OK */ (void) strncpy (buf + j, login, sizeof (buf) - j); while (buf[j] != EOS) j++; } else { /* OK */ buf[j] = c; j++; } i++; c = gecos[i]; } buf[j] = EOS; return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/complete/0000777000000000000000000000000013571573400024742 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/CVE-2003-0681/complete/util-bad.c0000666000000000000000000000573213571573400026616 0ustar /* MIT Copyright Notice Copyright 2003 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. $Author: tleek $ $Date: 2004/02/05 15:19:49 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s2/util-bad.c,v 1.2 2004/02/05 15:19:49 tleek Exp $ */ /* Sendmail Copyright Notice Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. All rights reserved. Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. By using this file, you agree to the terms and conditions set forth in the LICENSE file which can be found at the top level of the sendmail distribution. $Author: tleek $ $Date: 2004/02/05 15:19:49 $ $Header: /mnt/leo2/cvs/sabo/hist-040105/sendmail/s2/util-bad.c,v 1.2 2004/02/05 15:19:49 tleek Exp $ */ /* */ #include #include #include /* ** BUILDFNAME -- build full name from gecos style entry. ** ** This routine interprets the strange entry that would appear ** in the GECOS field of the password file. ** ** Parameters: ** p -- name to build. ** login -- the login name of this user (for &). ** buf -- place to put the result. ** ** Returns: ** none. ** ** Side Effects: ** none. */ int main (void) { char *gecos, *login, *buf; // these were parameters char *p; char *bp; int l; bp = buf; if (*gecos == '*') gecos++; /* find length of final string */ l = 0; for (p = gecos; *p != '\0' && *p != ',' && *p != ';' && *p != '%'; p++) { if (*p == '&') l += strlen(login); else l++; } /* now fill in buf */ for (p = gecos; *p != '\0' && *p != ',' && *p != ';' && *p != '%'; p++) { if (*p == '&') { // printf ("strcpy(bp,login)\n"); // printf ("strlen(bp) = %d strlen(login) = %d\n", // strlen(bp), strlen(login)); /*BAD*/ (void) strcpy(bp, login); // *bp = toupper(*bp); while (*bp != '\0') bp++; } else { /*BAD*/ *bp++ = *p; // printf ("bp-buf = %d\n", (bp-buf)); } } *bp = '\0'; // printf("buf can store at most %d bytes; strlen(buf) = %d\n", MAXNAME+1, strlen(buf)); } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/README0000666000000000000000000000016413571573400022420 0ustar -= Sendmail =- Homepage: http://www.sendmail.org Domain: Server Sendmail is the standard Unix mail (SMTP) server. frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/sendmail/main_tests0000666000000000000000000000302013571573400023623 0ustar ./CVE-2003-0161/prescan/prescan_arr_min_test_ok.c ./CVE-2003-0161/prescan/prescan_arr_min_test_bad.c ./CVE-2003-0161/prescan/prescan_arr_med_test_bad.c ./CVE-2003-0161/prescan/prescan_arr_med_test_ok.c ./CVE-2002-0906/parse_dns_reply/parse_dns_reply_cast_bad.c ./CVE-2002-0906/parse_dns_reply/parse_dns_reply_no_cast_bad.c ./CVE-2002-0906/parse_dns_reply/parse_dns_reply_no_cast_ok.c ./CVE-2002-0906/parse_dns_reply/parse_dns_reply_cast_ok.c ./CVE-2001-0653/tTflag/tTflag_arr_two_loops_ok.c ./CVE-2001-0653/tTflag/tTflag_arr_one_loop_bad.c ./CVE-2001-0653/tTflag/tTflag_arr_two_loops_bad.c ./CVE-2001-0653/tTflag/tTflag_arr_one_loop_ok.c ./CVE-2003-0681/buildfname/buildfname_arr_one_gecos_ok.c ./CVE-2003-0681/buildfname/buildfname_arr_two_gecos_ok.c ./CVE-2003-0681/buildfname/buildfname_arr_one_gecos_bad.c ./CVE-2003-0681/buildfname/buildfname_arr_two_gecos_bad.c ./CVE-2002-1337/close_angle/close-angle_ptr_no_test_ok.c ./CVE-2002-1337/close_angle/close-angle_ptr_one_test_bad.c ./CVE-2002-1337/close_angle/close-angle_ptr_no_test_bad.c ./CVE-2002-1337/close_angle/close-angle_ptr_one_test_ok.c ./CVE-1999-0047/mime7to8/mime7to8_arr_one_char_no_test_ok.c ./CVE-1999-0047/mime7to8/mime7to8_arr_one_char_no_test_bad.c ./CVE-1999-0047/mime7to8/mime7to8_ptr_three_chars_heavy_test_bad.c ./CVE-1999-0047/mime7to8/mime7to8_ptr_three_chars_heavy_test_ok.c ./CVE-1999-0206/mime_fromqp/mime_fromqp_ptr_bad.c ./CVE-1999-0206/mime_fromqp/mime_fromqp_ptr_ok.c ./CVE-1999-0206/mime_fromqp/mime_fromqp_arr_bad.c ./CVE-1999-0206/mime_fromqp/mime_fromqp_arr_ok.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/0000777000000000000000000000000013571573400021331 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/0000777000000000000000000000000013571573400022755 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/README0000666000000000000000000000312713571573400023640 0ustar -= CVE-1999-0368 =- Vulnerable versions: wu-ftpd < 2.4.2-beta18-vr10 File(s): src/realpath.c Download from: ftp://ftp.wu-ftpd.org/pub/wu-ftpd-attic/wu-ftpd-2.4.2-beta18-vr8.tar.gz Domain: FTP Server _ Vulnerable Functions and Buffers _ The vulnerabilities are in the realpath() funtion. First, no bounds checking is done on the input pathname, which is blindly strcpy()'d into curpath, a global variable. Second, a local buffer workpath can be filled with up to MAXPATHLEN bytes via a call to getcwd(); workpath is then strcpy()'d to namebuf. More bytes are then written to namebuf using strcat(). Several subsequent calls to strcpy() and strcat() can propagate this overflow. We only try to find the initial overflow. Third, a buffer linkpath is filled, potentially to capacity of MAXPATHLEN, using readlink(). More data is then appended to linkpath using strcat(), which can overflow it. NOTE: SatAbs was having a lot of problems with the namebuf example in the original version which used pointers as iterators (similar to the NetBSD glob() example). Since my experience with YASM indicates that using pointers as iterators shouldn't be much harder than using ints (explicit aliasing, model pointers as pairs), I suspect this to be a technical limitation of SatAbs rather than an algorithmic one. I've therefore turned the iterators into ints in these examples. _ Decomposed Programs _ wu-ftpd.h realpath-curpath/ simple.c realpath-namebuf/ strcpy_strcat_bad.c iter_ints_simp_bad.c iter_ints_bad.c realpath-linkpath/ strcpy_strcat_bad.c prefix_simp_bad.c prefix_bad.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-curpath/0000777000000000000000000000000013571573400026221 5ustar ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-curpath/simple_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-curpath/simple0000666000000000000000000000121513571573400027434 0ustar #include "../wu-ftpd.h" /* Allocated size of buffer pathname[] in main () */ #define PATHNAME_SZ MAXPATHLEN+1 char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN]; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } /* BAD */ r_strcpy(curpath, pathname); return result; } int main () { char pathname [PATHNAME_SZ]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; pathname [PATHNAME_SZ-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000015200000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-curpath/simple_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-curpath/simple0000666000000000000000000000123113571573400027432 0ustar #include "../wu-ftpd.h" /* Allocated size of buffer pathname[] in main () */ #define PATHNAME_SZ MAXPATHLEN+1 char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN]; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } /* OK */ r_strncpy(curpath, pathname, MAXPATHLEN); return result; } int main () { char pathname [PATHNAME_SZ]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; pathname [PATHNAME_SZ-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/0000777000000000000000000000000013571573400026365 5ustar ././@LongLink0000644000000000000000000000015400000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/prefix_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/prefi0000666000000000000000000000446013571573400027421 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN]; int len; int where; int ptr; int last; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } strcpy(curpath, pathname); if (*pathname != '/') { uid_t userid; if (!getcwd(workpath,MAXPATHLEN)) { userid = geteuid(); delay_signaling(); seteuid(0); if (!getcwd(workpath,MAXPATHLEN)) { strcpy(result, "."); seteuid(userid); enable_signaling(); return (NULL); } seteuid(userid); enable_signaling(); } } else *workpath = EOS; where = 0; while (curpath[where] != EOS) { if (!strcmp(curpath + where, ".")) { where++; continue; } if (!strncmp(curpath + where, "./", 2)) { where += 2; continue; } if (!strncmp(curpath + where, "../", 3)) { where += 3; ptr = last = 0; while (workpath[ptr] != EOS) { if (workpath[ptr] == '/') last = ptr; ptr++; } workpath[last] = EOS; continue; } ptr = istrchr(curpath + where, '/'); if (curpath[ptr] == EOS) ptr = where + strlen(curpath + where) - 1; else curpath[ptr] = EOS; strcpy(namebuf, workpath); for (last = 0; namebuf[last] != EOS; last++) continue; /* Chop out the out-of-bounds writes.... */ } /* Stand-in for checking stat fields. */ if (nondet_int() == 1) { len = readlink(namebuf, linkpath, MAXPATHLEN); if (len <= 0) return NULL; linkpath[len] = EOS; if (linkpath[0] == '/') workpath[0] = EOS; if (curpath[where] != EOS) { /* BAD */ r_strcat(linkpath, "/"); /* BAD */ r_strcat(linkpath, curpath + where); } /* BAD */ r_strcpy(curpath, linkpath); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/prefix_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/prefi0000666000000000000000000000475713571573400027432 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN]; int len; int where; int ptr; int last; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } strcpy(curpath, pathname); if (*pathname != '/') { uid_t userid; if (!getcwd(workpath,MAXPATHLEN)) { userid = geteuid(); delay_signaling(); seteuid(0); if (!getcwd(workpath,MAXPATHLEN)) { strcpy(result, "."); seteuid(userid); enable_signaling(); return (NULL); } seteuid(userid); enable_signaling(); } } else *workpath = EOS; where = 0; while (curpath[where] != EOS) { if (!strcmp(curpath + where, ".")) { where++; continue; } if (!strncmp(curpath + where, "./", 2)) { where += 2; continue; } if (!strncmp(curpath + where, "../", 3)) { where += 3; ptr = last = 0; while (workpath[ptr] != EOS) { if (workpath[ptr] == '/') last = ptr; ptr++; } workpath[last] = EOS; continue; } ptr = istrchr(curpath + where, '/'); if (curpath[ptr] == EOS) ptr = where + strlen(curpath + where) - 1; else curpath[ptr] = EOS; strcpy(namebuf, workpath); for (last = 0; namebuf[last] != EOS; last++) continue; /* Chop out the out-of-bounds writes.... */ } /* Stand-in for checking stat fields. */ if (nondet_int() == 1) { len = readlink(namebuf, linkpath, MAXPATHLEN); if (len <= 0) return NULL; linkpath[len] = EOS; if (linkpath[0] == '/') workpath[0] = EOS; if (where[0] != EOS) { /* OK */ r_strncat(linkpath, "/", MAXPATHLEN-strlen(linkpath)-1); if (strlen(linkpath)+strlen(where)>=MAXPATHLEN) { return NULL; } /* OK */ r_strncat(linkpath, where, MAXPATHLEN-strlen(linkpath)- 1); } if (strlen(linkpath) >= MAXPATHLEN) { return NULL; } /* OK */ r_strcpy(curpath, linkpath); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000016100000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/prefix_simp_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/prefi0000666000000000000000000000351313571573400027417 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN]; int len; int where; int ptr; int last; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } strcpy(curpath, pathname); if (pathname[0] != '/') { uid_t userid; if (!getcwd(workpath,MAXPATHLEN)) { userid = geteuid(); delay_signaling(); seteuid(0); if (!getcwd(workpath,MAXPATHLEN)) { strcpy(result, "."); seteuid(userid); enable_signaling(); return (NULL); } seteuid(userid); enable_signaling(); } } else workpath[0] = EOS; where = 0; while (curpath[where] != EOS) { if (!strcmp(curpath + where, ".")) { where++; continue; } strcpy(namebuf, workpath); for (last = 0; namebuf[last] != EOS; last++) continue; /* Chop out the out-of-bounds writes.... */ } /* Stand-in for checking stat fields. */ if (nondet_int() == 1) { len = readlink(namebuf, linkpath, MAXPATHLEN); if (len <= 0) return NULL; linkpath[len] = EOS; if (linkpath[0] == '/') workpath[0] = EOS; if (curpath[where] != EOS) { /* BAD */ r_strcat(linkpath, "/"); /* BAD */ r_strcat(linkpath, curpath + where); } /* BAD */ r_strcpy(curpath, linkpath); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000016000000000000007770 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/prefix_simp_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/prefi0000666000000000000000000000401213571573400027412 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN]; int len; int where; int ptr; int last; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } strcpy(curpath, pathname); if (pathname[0] != '/') { uid_t userid; if (!getcwd(workpath,MAXPATHLEN)) { userid = geteuid(); delay_signaling(); seteuid(0); if (!getcwd(workpath,MAXPATHLEN)) { strcpy(result, "."); seteuid(userid); enable_signaling(); return (NULL); } seteuid(userid); enable_signaling(); } } else workpath[0] = EOS; where = 0; while (curpath[where] != EOS) { if (!strcmp(curpath + where, ".")) { where++; continue; } strcpy(namebuf, workpath); for (last = 0; namebuf[last] != EOS; last++) continue; /* Chop out the out-of-bounds writes.... */ } /* Stand-in for checking stat fields. */ if (nondet_int() == 1) { len = readlink(namebuf, linkpath, MAXPATHLEN); if (len <= 0) return NULL; linkpath[len] = EOS; if (linkpath[0] == '/') workpath[0] = EOS; if (where[0] != EOS) { /* OK */ r_strncat(linkpath, "/", MAXPATHLEN-strlen(linkpath)-1); if (strlen(linkpath)+strlen(where)>=MAXPATHLEN) { return NULL; } /* OK */ r_strncat(linkpath, where, MAXPATHLEN-strlen(linkpath)- 1); } if (strlen(linkpath) >= MAXPATHLEN) { return NULL; } /* OK */ r_strcpy(curpath, linkpath); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000016300000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/strcpy_strcat_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/strcp0000666000000000000000000000200413571573400027437 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN], *where; int len; where = curpath; /* Stand-in for checking stat fields. */ if (nondet_int() == 1) { len = readlink(namebuf, linkpath, MAXPATHLEN); if (len <= 0) return NULL; linkpath[len] = EOS; if (linkpath[0] == '/') workpath[0] = EOS; if (where[0] != EOS) { /* BAD */ r_strcat(linkpath, "/"); /* BAD */ r_strcat(linkpath, where); } /* BAD */ r_strcpy(curpath, linkpath); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000016200000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/strcpy_strcat_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-linkpath/strcp0000666000000000000000000000232313571573400027443 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN], *where; int len; where = curpath; /* Stand-in for checking stat fields. */ if (nondet_int() == 1) { len = readlink(namebuf, linkpath, MAXPATHLEN); if (len <= 0) return NULL; linkpath[len] = EOS; if (linkpath[0] == '/') workpath[0] = EOS; if (where[0] != EOS) { /* OK */ r_strncat(linkpath, "/", MAXPATHLEN-strlen(linkpath)-1); if (strlen(linkpath)+strlen(where)>=MAXPATHLEN) { return NULL; } /* OK */ r_strncat(linkpath, where, MAXPATHLEN-strlen(linkpath)- 1); } if (strlen(linkpath) >= MAXPATHLEN) { return NULL; } /* OK */ r_strcpy(curpath, linkpath); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/0000777000000000000000000000000013571573400026170 5ustar ././@LongLink0000644000000000000000000000015600000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/iter_ints_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/iter_i0000666000000000000000000000373713571573400027400 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN]; int len; int where; int ptr; int last; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } strcpy(curpath, pathname); if (*pathname != '/') { uid_t userid; if (!getcwd(workpath,MAXPATHLEN)) { userid = geteuid(); delay_signaling(); seteuid(0); if (!getcwd(workpath,MAXPATHLEN)) { strcpy(result, "."); seteuid(userid); enable_signaling(); return (NULL); } seteuid(userid); enable_signaling(); } } else *workpath = EOS; where = 0; while (curpath[where] != EOS) { if (!strcmp(curpath + where, ".")) { where++; continue; } if (!strncmp(curpath + where, "./", 2)) { where += 2; continue; } if (!strncmp(curpath + where, "../", 3)) { where += 3; ptr = last = 0; while (workpath[ptr] != EOS) { if (workpath[ptr] == '/') last = ptr; ptr++; } workpath[last] = EOS; continue; } ptr = istrchr(curpath + where, '/'); if (curpath[ptr] == EOS) ptr = where + strlen(curpath + where) - 1; else curpath[ptr] = EOS; strcpy(namebuf, workpath); for (last = 0; namebuf[last] != EOS; last++) continue; if ((last == 0) || (namebuf[--last] != '/')) /* BAD */ r_strcat(namebuf, "/"); /* BAD */ r_strcat(namebuf, curpath + where); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000015500000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/iter_ints_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/iter_i0000666000000000000000000000403313571573400027366 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN]; int len; int where; int ptr; int last; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } strcpy(curpath, pathname); if (*pathname != '/') { uid_t userid; if (!getcwd(workpath,MAXPATHLEN)) { userid = geteuid(); delay_signaling(); seteuid(0); if (!getcwd(workpath,MAXPATHLEN)) { strcpy(result, "."); seteuid(userid); enable_signaling(); return (NULL); } seteuid(userid); enable_signaling(); } } else *workpath = EOS; where = 0; while (curpath[where] != EOS) { if (!strcmp(curpath + where, ".")) { where++; continue; } if (!strncmp(curpath + where, "./", 2)) { where += 2; continue; } if (!strncmp(curpath + where, "../", 3)) { where += 3; ptr = last = 0; while (workpath[ptr] != EOS) { if (workpath[ptr] == '/') last = ptr; ptr++; } workpath[last] = EOS; continue; } ptr = istrchr(curpath + where, '/'); if (curpath[ptr] == EOS) ptr = where + strlen(curpath + where) - 1; else curpath[ptr] = EOS; strcpy(namebuf, workpath); for (last = 0; namebuf[last] != EOS; last++) continue; if ((last == 0) || (namebuf[--last] != '/')) /* OK */ r_strncat(namebuf, "/", MAXPATHLEN-strlen(namebuf)-1); /* OK */ r_strncat(namebuf, curpath + where, MAXPATHLEN-strlen(namebuf)-1); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000016300000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/iter_ints_simp_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/iter_i0000666000000000000000000000276713571573400027402 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN]; int len; int where; int ptr; int last; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } strcpy(curpath, pathname); if (pathname[0] != '/') { uid_t userid; if (!getcwd(workpath,MAXPATHLEN)) { userid = geteuid(); delay_signaling(); seteuid(0); if (!getcwd(workpath,MAXPATHLEN)) { strcpy(result, "."); seteuid(userid); enable_signaling(); return (NULL); } seteuid(userid); enable_signaling(); } } else workpath[0] = EOS; where = 0; while (curpath[where] != EOS) { if (!strcmp(curpath + where, ".")) { where++; continue; } strcpy(namebuf, workpath); for (last = 0; namebuf[last] != EOS; last++) continue; if ((last == 0) || (namebuf[--last] != '/')) /* BAD */ r_strcat(namebuf, "/"); /* BAD */ r_strcat(namebuf, curpath + where); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000016200000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/iter_ints_simp_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/iter_i0000666000000000000000000000306113571573400027366 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], linkpath[MAXPATHLEN], namebuf[MAXPATHLEN]; int len; int where; int ptr; int last; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } strcpy(curpath, pathname); if (pathname[0] != '/') { uid_t userid; if (!getcwd(workpath,MAXPATHLEN)) { userid = geteuid(); delay_signaling(); seteuid(0); if (!getcwd(workpath,MAXPATHLEN)) { strcpy(result, "."); seteuid(userid); enable_signaling(); return (NULL); } seteuid(userid); enable_signaling(); } } else workpath[0] = EOS; where = 0; while (curpath[where] != EOS) { if (!strcmp(curpath + where, ".")) { where++; continue; } strcpy(namebuf, workpath); for (last = 0; namebuf[last] != EOS; last++) continue; if ((last == 0) || (namebuf[--last] != '/')) /* OK */ r_strncat(namebuf, "/", MAXPATHLEN-strlen(namebuf)-1); /* OK */ r_strncat(namebuf, curpath + where, MAXPATHLEN-strlen(namebuf)-1); } return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000016200000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/strcpy_strcat_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/strcpy0000666000000000000000000000141413571573400027437 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], namebuf[MAXPATHLEN]; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } workpath[MAXPATHLEN-1] = EOS; strcpy(curpath, pathname); strcpy(namebuf, workpath); /* BAD */ r_strcat(namebuf, curpath); return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } ././@LongLink0000644000000000000000000000016100000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/strcpy_strcat_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/realpath-namebuf/strcpy0000666000000000000000000000145213571573400027441 0ustar #include "../wu-ftpd.h" char * realpath(const char *pathname, char *result, char* chroot_path) { char curpath[MAXPATHLEN], workpath[MAXPATHLEN], namebuf[MAXPATHLEN]; if (result == NULL) return(NULL); if(pathname == NULL){ *result = EOS; return(NULL); } workpath[MAXPATHLEN-1] = EOS; strcpy(curpath, pathname); strcpy(namebuf, workpath); /* OK */ r_strncat(namebuf, curpath, MAXPATHLEN-strlen(namebuf)-1); return result; } int main () { char pathname [MAXPATHLEN]; char result [MAXPATHLEN]; char chroot_path [MAXPATHLEN]; /* Don't use too big a pathname; we're not trying to overflow curpath */ pathname [MAXPATHLEN-1] = EOS; result [MAXPATHLEN-1] = EOS; chroot_path [MAXPATHLEN-1] = EOS; realpath(pathname, result, chroot_path); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/wu-ftpd.c0000666000000000000000000000131613571573400024510 0ustar #include "wu-ftpd.h" uid_t geteuid(void) { return nondet_short(); } int seteuid(uid_t euid) { if (nondet_int() == 0) return 0; return -1; } int enable_signaling() { return (0); } int delay_signaling() { return (0); } /* Returns the number of bytes written to buf, or -1 if there's an error. This'll do it, assuming buf is initially uninitialized. */ int readlink(const char *path, char *buf, int bufsiz) { int n = nondet_int (); if (n < bufsiz && n >= 0) return n; return -1; } /* Just make sure buf is null-terminated unless we simulate an error. */ char *getcwd(char *buf, size_t size) { if (nondet_int() == 0) { return NULL; } buf [size-1] = EOS; return buf; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-1999-0368/wu-ftpd.h0000666000000000000000000000064713571573400024523 0ustar #include "../../../../lib/stubs.h" /* Size of buffer being overflowed, and most input buffers. We * strncmp() it against "../", so make sure it has at least 3 * cells. */ #define MAXPATHLEN BASE_SZ + 3 typedef short uid_t; uid_t geteuid(void); int seteuid(uid_t euid); int enable_signaling(); int delay_signaling(); int readlink(const char *path, char *buf, int bufsiz); char *getcwd(char *buf, size_t size); frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/0000777000000000000000000000000013571573400022725 5ustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/README0000666000000000000000000000212613571573400023606 0ustar -= CVE-2003-0466 =- Vulnerable versions: wu-ftpd 2.5.0 - 2.6.2 File(s): src/realpath.c Download from: ftp://ftp.wu-ftpd.org/pub/wu-ftpd-attic/wu-ftpd-2.5.0.tar.gz Domain: FTP Server _ Vulnerable Functions and Buffers _ The buffer resolved[], which is an input to fb_realpath(), can be overflowed. This buffer can be filled with up to MAXPATHLEN bytes by a call to getcwd(). A slash ("/") and another buffer, wbuf[], can then be appended to resolved[] using strcat. The bounds check is wrong --- it should be saying that we need more room if we copy in a slash, but it says that we need more if we *don't*. Hence there's an off-by-one error if we do copy the salsh in. The patch involves adding a single exclamation point. ;-) fb_realpath() does some heavy string manipulations on the way to these calls, and makes calls to the filesystem (which we model with nondeterminism). For every decomposed program but the most simple one, SatAbs gets a lot of timeouts. _ Decomposed Programs _ wu-ftpd.h fb_realpath/ simple_bad.c almost_simple_bad.c istrrchr_bad.c no_symlinks_bad.c symlinks_bad.c frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/0000777000000000000000000000000013571573400025174 5ustar ././@LongLink0000644000000000000000000000015500000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/almost_simple_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/almost_simp0000666000000000000000000000204713571573400027451 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; int p, q; (void) strncpy(resolved, path, MAXPATHLEN - 1); resolved[MAXPATHLEN - 1] = EOS; p = 0; /* wbuf contains the filename, but not the path to it */ strcpy(wbuf, resolved + p); if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* BAD */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } ././@LongLink0000644000000000000000000000015400000000000007773 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/almost_simple_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/almost_simp0000666000000000000000000000204713571573400027451 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; int p, q; (void) strncpy(resolved, path, MAXPATHLEN - 1); resolved[MAXPATHLEN - 1] = EOS; p = 0; /* wbuf contains the filename, but not the path to it */ strcpy(wbuf, resolved + p); if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + !rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* OK */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/istrrchr_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/istrrchr_ba0000666000000000000000000000255613571573400027431 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; int p, q; (void) strncpy(resolved, path, MAXPATHLEN - 1); resolved[MAXPATHLEN - 1] = EOS; /* Once this loop terminates, the final slash in resolved has been * replaced with an EOS, and p points to the filename after it. */ q = istrrchr(resolved, '/'); if (q != -1) { /* p is whatever's after the last slash */ p = q + 1; } else /* no slashes found ==> just a filename */ p = 0; /* wbuf contains the filename, but not the path to it */ strcpy(wbuf, resolved + p); if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* BAD */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/istrrchr_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/istrrchr_ok0000666000000000000000000000255613571573400027460 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; int p, q; (void) strncpy(resolved, path, MAXPATHLEN - 1); resolved[MAXPATHLEN - 1] = EOS; /* Once this loop terminates, the final slash in resolved has been * replaced with an EOS, and p points to the filename after it. */ q = istrrchr(resolved, '/'); if (q != -1) { /* p is whatever's after the last slash */ p = q + 1; } else /* no slashes found ==> just a filename */ p = 0; /* wbuf contains the filename, but not the path to it */ strcpy(wbuf, resolved + p); if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + !rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* OK */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } ././@LongLink0000644000000000000000000000015300000000000007772 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/no_symlinks_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/no_symlinks0000666000000000000000000000343413571573400027470 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; int p, q; (void) strncpy(resolved, path, MAXPATHLEN - 1); resolved[MAXPATHLEN - 1] = EOS; /* Once this loop terminates, the final slash in resolved has been * replaced with an EOS, and p points to the filename after it. */ q = istrrchr(resolved, '/'); if (q != -1) { /* p is whatever's after the last slash */ p = q + 1; if (q == 0) { /* Don't do anything. Originally, q was a pointer, we set it * to "/", and chdir'd to "/". Since we're chopping out the chdir, * we don't need to do anything. */ } else { /* chops off the last slash and terminates resolved[] at it */ do { --q; } while (q > 0 && resolved[q] == '/'); resolved[q+1] = EOS; q = 0; } } else /* no slashes found ==> just a filename */ p = 0; /* wbuf contains the filename, but not the path to it */ strcpy(wbuf, resolved + p); if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* BAD */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } ././@LongLink0000644000000000000000000000015200000000000007771 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/no_symlinks_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/no_symlinks0000666000000000000000000000343413571573400027470 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; int p, q; (void) strncpy(resolved, path, MAXPATHLEN - 1); resolved[MAXPATHLEN - 1] = EOS; /* Once this loop terminates, the final slash in resolved has been * replaced with an EOS, and p points to the filename after it. */ q = istrrchr(resolved, '/'); if (q != -1) { /* p is whatever's after the last slash */ p = q + 1; if (q == 0) { /* Don't do anything. Originally, q was a pointer, we set it * to "/", and chdir'd to "/". Since we're chopping out the chdir, * we don't need to do anything. */ } else { /* chops off the last slash and terminates resolved[] at it */ do { --q; } while (q > 0 && resolved[q] == '/'); resolved[q+1] = EOS; q = 0; } } else /* no slashes found ==> just a filename */ p = 0; /* wbuf contains the filename, but not the path to it */ strcpy(wbuf, resolved + p); if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + !rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* OK */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } ././@LongLink0000644000000000000000000000014600000000000007774 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/simple_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/simple_bad.0000666000000000000000000000160713571573400027300 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char *p, *q, wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; wbuf[MAXPATHLEN-1] = EOS; if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* BAD */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/simple_ok.c0000666000000000000000000000160713571573400027326 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char *p, *q, wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; wbuf[MAXPATHLEN-1] = EOS; if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + !rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* OK */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } ././@LongLink0000644000000000000000000000015000000000000007767 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/symlinks_bad.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/symlinks_ba0000666000000000000000000000503713571573400027437 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; int p, q; (void) strncpy(resolved, path, MAXPATHLEN - 1); resolved[MAXPATHLEN - 1] = EOS; loop: /* Once this loop terminates, the final slash in resolved has been * replaced with an EOS, and p points to the filename after it. */ q = istrrchr(resolved, '/'); if (q != -1) { /* p is whatever's after the last slash */ p = q + 1; if (q == 0) { /* Don't do anything. Originally, q was a pointer, we set it * to "/", and chdir'd to "/". Since we're chopping out the chdir, * we don't need to do anything. */ } else { /* chops off the last slash and terminates resolved[] at it */ do { --q; } while (q > 0 && resolved[q] == '/'); resolved[q+1] = EOS; q = 0; } } else /* no slashes found ==> just a filename */ p = 0; if (resolved[p] != EOS) { resultcode = nondet_int(); /* If lstat() didn't fail.... */ if (resultcode == 0) { int symlinks = 0; int n; /* If this was a symlink.... */ if (nondet_int()) { if (++symlinks > MAXSYMLINKS) { return NULL; } strcpy(tmp, resolved + p); n = readlink(tmp, resolved, MAXPATHLEN); if (n < 0) { return NULL; } resolved[n] = EOS; goto loop; } /* p was originally a pointer, and it could have been set to "" * here if the final component were a directory. * * That's hard to do with an integer, so I'm slicing that * out. This example's already plenty complex. */ } } /* wbuf contains the filename, but not the path to it */ strcpy(wbuf, resolved + p); if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* BAD */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } ././@LongLink0000644000000000000000000000014700000000000007775 Lustar frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/symlinks_ok.cframa-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/fb_realpath/symlinks_ok0000666000000000000000000000503713571573400027466 0ustar #include "../wu-ftpd.h" /* resolved is an *input*, initially uninitialized */ char *fb_realpath(const char *path, char *resolved) { int rootd; char wbuf[MAXPATHLEN]; int resultcode; char tmp [MAXPATHLEN]; int p, q; (void) strncpy(resolved, path, MAXPATHLEN - 1); resolved[MAXPATHLEN - 1] = EOS; loop: /* Once this loop terminates, the final slash in resolved has been * replaced with an EOS, and p points to the filename after it. */ q = istrrchr(resolved, '/'); if (q != -1) { /* p is whatever's after the last slash */ p = q + 1; if (q == 0) { /* Don't do anything. Originally, q was a pointer, we set it * to "/", and chdir'd to "/". Since we're chopping out the chdir, * we don't need to do anything. */ } else { /* chops off the last slash and terminates resolved[] at it */ do { --q; } while (q > 0 && resolved[q] == '/'); resolved[q+1] = EOS; q = 0; } } else /* no slashes found ==> just a filename */ p = 0; if (resolved[p] != EOS) { resultcode = nondet_int(); /* If lstat() didn't fail.... */ if (resultcode == 0) { int symlinks = 0; int n; /* If this was a symlink.... */ if (nondet_int()) { if (++symlinks > MAXSYMLINKS) { return NULL; } strcpy(tmp, resolved + p); n = readlink(tmp, resolved, MAXPATHLEN); if (n < 0) { return NULL; } resolved[n] = EOS; goto loop; } /* p was originally a pointer, and it could have been set to "" * here if the final component were a directory. * * That's hard to do with an integer, so I'm slicing that * out. This example's already plenty complex. */ } } /* wbuf contains the filename, but not the path to it */ strcpy(wbuf, resolved + p); if (getcwd(resolved, MAXPATHLEN) == NULL) return NULL; if (resolved[0] == '/' && resolved[1] == EOS) rootd = 1; else rootd = 0; if (wbuf[0] != EOS) { if (strlen(resolved) + strlen(wbuf) + !rootd + 1 > MAXPATHLEN) { return NULL; } if (rootd == 0) (void) strcat(resolved, "/"); /* OK */ (void) r_strcat(resolved, wbuf); } return (NULL); } int main () { char pathname [MAXPATHLEN]; char resolved [MAXPATHLEN]; pathname [MAXPATHLEN-1] = EOS; resolved [MAXPATHLEN-1] = EOS; fb_realpath(pathname, resolved); return 0; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/wu-ftpd.c0000666000000000000000000000107513571573400024462 0ustar #include "wu-ftpd.h" extern char nondet_char(); /* Returns the number of bytes written to buf, or -1 if there's an error. This'll do it, assuming buf is initially uninitialized. */ int readlink(const char *path, char *buf, int bufsiz) { int n = nondet_int (); if (n < bufsiz && n >= 0) return n; return -1; } /* Havoc everything in buf, then null-terminate it. */ char *getcwd(char *buf, size_t size) { int i; if (nondet_int() == 0) { return NULL; } for (i = 0; i < size-1; i++) buf[i] = nondet_char(); buf [size-1] = EOS; return buf; } frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/CVE-2003-0466/wu-ftpd.h0000666000000000000000000000051713571573400024467 0ustar #include "../../../../lib/stubs.h" /* Size of input buffers and overflowed buffer; must be able to hold * null-terminators in addition to actual data. */ #define MAXPATHLEN BASE_SZ + 2 /* Used in symlinks_bad.c. */ #define MAXSYMLINKS 1 int readlink(const char *path, char *buf, int bufsiz); char *getcwd(char *buf, size_t size); frama-c-20.0-Calcium/tests/verisec/suite/programs/apps/wu-ftpd/README0000666000000000000000000000014713571573400022213 0ustar -= WU-FTPD =- Homepage: http://www.wu-ftpd.org Domain: FTP Server FTP is the File Transfer Protocol.